From d4c9852cb34376eef14e6082436fb7ab530b7f81 Mon Sep 17 00:00:00 2001 From: bernds Date: Wed, 11 Jan 2006 17:40:46 +0000 Subject: [PATCH] Merged revisions 96681,96683-96686,96689-96692,96698-96701,96705,96708,96710,96712,96714-96715,96719-96720,96725,96730,96733,96735-96737,96739-96740,96743,96745,96748,96753,96755,96759-96762,96764-96765,96768,96770-96771,96774,96776-96778,96782,96784-96785,96788,96790,96795-96803,96808,96812-96814,96816-96832,96834,96836-96837,96844,96847,96849-96853,96855,96862,96867,96870,96872,96879-96881,96883-96884,96889,96891-96895,96899,96902-96905,96908,96911,96913,96915-96917,96919-96921,96923-96924,96926-96927,96931-96935,96937-96939,96941,96944,96947-96948,96951,96953-96954,96957-96958,96960,96963,96966-96968,96980-96985,96988-96990,96995-96996,96998,97000,97003-97005,97013-97016,97018-97019,97024,97026,97028-97029,97031-97034,97036,97038-97039,97041,97044,97046-97048,97050,97054,97057-97063,97065,97070,97074,97076-97077,97079,97081-97086,97089,97091,97109,97111-97116,97120,97122-97123,97125-97130,97132-97136,97139,97143,97146-97148,97150-97153,97156-97157,97160-97161,97164-97192,97194-97197,97199-97200,97202,97204,97207-97212,97217,97220-97223,97229,97233,97236-97243,97249-97253,97255,97258,97263-97264,97267,97270,97273,97276-97278,97281-97285,97287,97289-97290,97292,97295,97298-97299,97301,97303,97308,97312-97314,97317-97319,97321-97322,97325-97326,97330-97334,97336-97344,97347-97349,97351-97352,97358,97360-97364,97367,97369-97370,97372-97373,97376-97381,97383,97385-97397,97399-97400,97402-97403,97406,97409,97411-97412,97414,97416-97417,97422,97424,97428-97430,97434-97438,97440-97441,97444,97446,97449,97452-97453,97455-97458,97461,97470,97472-97473,97475-97476,97478-97479,97481,97484-97486,97489-97493,97495-97496,97498,97511,97522,97525-97527,97529,97532-97533,97536-97538,97540-97551,97554-97555,97557-97558,97560-97561,97565,97567,97569-97572,97574-97578,97580-97582,97587,97589,97593-97599,97601-97602,97604-97605,97607,97609,97611,97613,97617,97620,97622,97624,97627,97631,97633,97635-97636,97640-97641,97643-97646,97648,97650,97652-97656,97659-97663,97666,97668,97671,97673-97674,97676-97678,97681,97685-97686,97691,97694,97696,97699-97702,97705,97708-97713,97719,97722-97723,97726,97728,97730-97731,97733,97737-97740,97742,97746-97747,97749,97751,97756,97759-97760,97763,97765,97770,97772-97773,97775,97778-97779,97781-97782,97784,97787-97788,97790,97792-97793,97795-97797,97804-97805,97807-97810,97813,97815-97819,97822,97825-97828,97830,97832,97836-97842,97846,97849,97851,97854,97857,97860-97862,97866,97868-97873,97880,97884-97887,97890,97894-97895,97897,97902-97908,97910-97912,97916,97919-97924,97928-97932,97935,97937-97941,97943-97951,97955,97958,97961,97964-97966,97968,97971-97974,97976-97983,97986-97988,97991,97994,97999-98001,98003,98009-98010,98012,98017-98023,98026-98029,98031-98032,98034,98039-98040,98044,98047-98048,98051-98053,98058,98061-98068,98070-98073,98076-98080,98082-98095,98097,98099,98101-98107,98110-98111,98118,98121,98127-98128,98131-98137,98140-98144,98146,98148-98149,98152,98154-98156,98159,98161-98162,98165-98168,98173-98174,98179,98183-98184,98186-98187,98189-98193,98195-98196,98199-98200,98202-98203,98206,98208-98210,98213,98216,98218,98220-98223,98225,98227,98232-98234,98236-98239,98242,98244-98245,98247,98252,98257-98260,98262,98265-98266,98269,98271,98273,98278,98283,98285-98288,98295,98297,98303,98307,98309-98313,98315-98316,98318-98321,98323-98324,98326-98335,98338-98343,98345-98350,98352,98355,98357,98362,98365-98379,98381,98384-98400,98402-98403,98405-98408,98412-98414,98416-98421,98425,98428-98430,98432-98451,98453,98456-98458,98460-98462,98464,98466,98468-98469,98471-98473,98476,98478,98482,98486,98493-98504,98507-98508,98510-98511,98513-98519,98522-98523,98527-98528,98530,98534,98540,98542-98544,98548-98551,98555,98559-98562,98567,98569-98570,98573-98574,98578-98583,98585-98587,98589,98594,98596-98603,98605-98607,98610-98611,98613-98622,98624,98631-98637,98640,98643-98644,98649-98650,98654,98658-98660,98663-98665,98668-98669,98673-98674,98676,98678-98679,98681,98684-98686,98691,98693-98695,98699,98708,98711-98712,98714-98715,98717,98723-98724,98726,98728,98730-98735,98737-98738,98740,98744-98746,98749,98752-98753,98755-98756,98762-98771,98774-98776,98778-98780,98782-98783,98785-98786,98788-98789,98791-98793,98795-98798,98800,98805,98808,98813-98814,98816-98818,98828-98829,98831-98832,98835-98837,98840,98843-98845,98848,98850-98854,98861-98862,98866-98868,98871-98875,98877-98886,98890,98893,98896,98898,98900-98901,98906-98908,98910-98916,98919,98922,98924,98928-98929,98932,98934-98936,98938-98942,98944,98947,98949-98950,98952,98955,98958,98961-98962,98966,98968,98975-98981,98983-98989,98991-98994,98998-99000,99006,99008,99010-99013,99016,99018-99021,99028,99032-99033,99035,99037-99038,99041,99043,99046-99047,99052,99054,99059,99064,99067-99068,99071-99072,99076,99080,99082-99083,99085-99086,99089,99091,99093-99096,99099-99100,99103-99105,99109,99111,99113-99115,99118,99121-99123,99125-99126,99131,99133,99135,99144,99152,99155-99158,99160-99164,99167-99175,99177,99179-99180,99182-99183,99185-99188,99196-99197,99200,99203-99211,99216-99225,99227,99230,99232,99234-99236,99238,99244,99247,99250-99257,99261-99262,99264-99265,99268-99269,99272-99275,99277,99279,99281-99282,99284,99287-99291,99296,99300-99306,99309,99314-99317,99319,99322,99324-99326,99329-99332,99334,99336-99337,99341,99343-99352,99355-99360,99362-99363,99365-99366,99370,99373,99375-99384,99386,99388,99391,99393-99395,99398-99399,99405-99408,99410-99411,99413,99415,99419,99421-99422,99424-99425,99429,99431-99433,99435,99441-99444,99446-99464,99466-99467,99470-99478,99483,99485,99487,99492-99493,99495-99499,99503,99505-99506,99508-99510,99513-99514,99516-99521,99523-99529,99535-99541,99544-99548,99553,99556,99558-99560,99563,99566,99568-99570,99573-99574,99577-99586,99588,99591-99592,99596-99597,99602,99604-99610,99613,99615,99617,99619,99621,99623,99625-99627,99631-99633,99635-99637,99640,99642-99643,99646-99648,99650,99652,99654-99660,99662-99664,99666,99668-99670,99672-99676,99679-99680,99684,99687,99691-99705,99708,99710-99711,99714-99716,99719-99724,99726,99728-99729,99731-99733,99735-99742,99745-99750,99755,99757,99759-99760,99765,99767,99769,99773-99775,99777-99779,99782-99783,99785,99787,99789,99791-99792,99794,99796,99799-99801,99803,99806,99810-99817,99823-99835,99837-99840,99842-99844,99846-99862,99871,99877-99882,99884-99885,99889-99890,99892-99893,99896-99897,99899-99901,99903-99904,99906,99908,99910,99916,99919-99920,99922-99928,99930,99933,99935-99936,99939,99941-99946,99948-99953,99957,99960,99966-99967,99971-99972,99974,99976-99978,99981-99982,99984,99986,99988,99993,99996-99997,99999 via svnmerge from svn+ssh://gcc.gnu.org/svn/gcc/trunk git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/reload-branch@109594 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog | 161 +- MAINTAINERS | 21 +- Makefile.def | 13 +- Makefile.in | 10136 ++-- Makefile.tpl | 419 +- README.SCO | 2 +- boehm-gc/ChangeLog | 31 + boehm-gc/configure | 63 +- boehm-gc/darwin_stop_world.c | 13 +- boehm-gc/include/private/gc_locks.h | 24 + boehm-gc/include/private/gcconfig.h | 41 +- boehm-gc/os_dep.c | 15 +- boehm-gc/powerpc_darwin_mach_dep.s | 19 +- config.sub | 15 +- config/ChangeLog | 23 + config/accross.m4 | 98 - config/acx.m4 | 1 - config/gcc-lib-path.m4 | 15 - config/gxx-include-dir.m4 | 6 +- config/mh-mingw32 | 7 - config/warnings.m4 | 2 +- configure | 240 +- configure.in | 83 +- contrib/ChangeLog | 16 + contrib/gcc_update | 42 +- contrib/gennews | 5 +- fastjar/ChangeLog | 17 + fastjar/Makefile.am | 2 - fastjar/Makefile.in | 7 +- fastjar/aclocal.m4 | 1 - fastjar/config.h.in | 20 +- fastjar/configure | 2195 +- fastjar/configure.ac | 12 +- fastjar/jartool.c | 25 +- fixincludes/ChangeLog | 73 +- fixincludes/Makefile.in | 15 +- fixincludes/aclocal.m4 | 2 - fixincludes/config.h.in | 77 + fixincludes/configure | 907 +- fixincludes/configure.ac | 15 +- fixincludes/fixfixes.c | 4 +- fixincludes/fixincl.c | 9 +- fixincludes/fixincl.x | 537 +- fixincludes/fixlib.c | 4 +- fixincludes/inclhack.def | 201 +- fixincludes/server.c | 12 +- fixincludes/system.h | 75 +- fixincludes/tests/base/iso/math_c99.h | 112 + fixincludes/tests/base/pthread.h | 5 + gcc/ChangeLog | 10453 +++- gcc/DATESTAMP | 2 +- gcc/Makefile.in | 1145 +- gcc/aclocal.m4 | 24 +- gcc/ada/5xcrtl.ads | 159 - gcc/ada/ChangeLog | 594 + gcc/ada/Makefile.in | 48 +- gcc/ada/Makefile.rtl | 1 + gcc/ada/a-direct.adb | 17 +- gcc/ada/a-direct.ads | 15 +- gcc/ada/a-interr.adb | 7 +- gcc/ada/a-interr.ads | 5 +- gcc/ada/a-nudira.adb | 15 +- gcc/ada/a-nuflra.adb | 21 +- gcc/ada/a-tags.adb | 58 +- gcc/ada/a-tags.ads | 33 +- gcc/ada/a-tgdico.ads | 29 + gcc/ada/ada-tree.h | 11 + gcc/ada/adaint.c | 43 +- gcc/ada/adaint.h | 1 - gcc/ada/cal.c | 4 +- gcc/ada/casing.adb | 23 +- gcc/ada/checks.adb | 217 +- gcc/ada/cio.c | 7 +- gcc/ada/decl.c | 59 +- gcc/ada/einfo.adb | 13 +- gcc/ada/errout.adb | 9 +- gcc/ada/errutil.adb | 10 +- gcc/ada/exp_ch2.adb | 5 +- gcc/ada/exp_ch3.adb | 155 +- gcc/ada/exp_ch4.adb | 2 +- gcc/ada/exp_ch6.adb | 6 +- gcc/ada/exp_disp.adb | 36 +- gcc/ada/exp_disp.ads | 2 - gcc/ada/exp_dist.adb | 176 +- gcc/ada/exp_intr.adb | 83 + gcc/ada/exp_strm.adb | 33 +- gcc/ada/exp_util.adb | 14 +- gcc/ada/expect.c | 62 +- gcc/ada/freeze.adb | 26 +- gcc/ada/g-expect.adb | 32 +- gcc/ada/gigi.h | 4 +- gcc/ada/gmem.c | 2 +- gcc/ada/gnat-style.texi | 2 +- gcc/ada/gnat_rm.texi | 30 +- gcc/ada/gnat_ugn.texi | 48 +- gcc/ada/i-cpp.adb | 59 +- gcc/ada/i-cpp.ads | 30 +- gcc/ada/impunit.adb | 1 + gcc/ada/init.c | 10 +- gcc/ada/lang.opt | 6 +- gcc/ada/link.c | 2 +- gcc/ada/make.adb | 21 +- gcc/ada/misc.c | 28 +- gcc/ada/mlib-tgt-darwin.adb | 23 +- gcc/ada/mlib-tgt-vms-alpha.adb | 12 +- gcc/ada/mlib-tgt-vms-ia64.adb | 12 +- gcc/ada/namet.adb | 16 +- gcc/ada/opt.ads | 5 + gcc/ada/par-ch10.adb | 4 +- gcc/ada/par-ch12.adb | 6 +- gcc/ada/par-ch3.adb | 34 +- gcc/ada/par-ch4.adb | 19 +- gcc/ada/par.adb | 60 +- gcc/ada/prj-nmsc.adb | 30 +- gcc/ada/prj-part.adb | 2 +- gcc/ada/prj-proc.adb | 62 +- gcc/ada/prj-strt.adb | 52 +- gcc/ada/prj.adb | 16 +- gcc/ada/prj.ads | 107 +- gcc/ada/raise.c | 6 +- gcc/ada/rtsfind.adb | 19 +- gcc/ada/rtsfind.ads | 8 - gcc/ada/s-crtl-vms64.ads | 183 + gcc/ada/s-interr-dummy.adb | 12 +- gcc/ada/s-interr-sigaction.adb | 37 +- gcc/ada/s-interr-vms.adb | 78 +- gcc/ada/s-interr-vxworks.adb | 76 +- gcc/ada/s-interr.adb | 68 +- gcc/ada/s-interr.ads | 76 +- gcc/ada/s-osinte-linux-hppa.ads | 533 + gcc/ada/s-taprob.adb | 70 +- gcc/ada/s-taprob.ads | 19 +- gcc/ada/s-taprop-tru64.adb | 6 +- gcc/ada/s-tpoben.adb | 121 +- gcc/ada/s-tpoben.ads | 100 +- gcc/ada/s-tpobop.adb | 24 +- gcc/ada/s-tposen.adb | 109 +- gcc/ada/s-tposen.ads | 35 +- gcc/ada/scng.adb | 8 +- gcc/ada/sem_attr.adb | 8 +- gcc/ada/sem_cat.adb | 15 +- gcc/ada/sem_ch11.adb | 2 +- gcc/ada/sem_ch12.adb | 2 +- gcc/ada/sem_ch13.adb | 4 +- gcc/ada/sem_ch3.adb | 4 +- gcc/ada/sem_ch4.adb | 94 +- gcc/ada/sem_ch5.adb | 49 +- gcc/ada/sem_ch6.adb | 24 +- gcc/ada/sem_ch7.adb | 13 +- gcc/ada/sem_ch8.adb | 109 +- gcc/ada/sem_dist.adb | 71 +- gcc/ada/sem_dist.ads | 51 +- gcc/ada/sem_prag.adb | 24 +- gcc/ada/sem_res.adb | 182 +- gcc/ada/sem_type.adb | 28 +- gcc/ada/sem_util.adb | 18 +- gcc/ada/sem_util.ads | 39 +- gcc/ada/snames.adb | 8 +- gcc/ada/snames.ads | 193 +- gcc/ada/styleg.adb | 65 +- gcc/ada/styleg.ads | 12 +- gcc/ada/stylesw.adb | 81 +- gcc/ada/stylesw.ads | 9 +- gcc/ada/switch-c.adb | 15 +- gcc/ada/switch-m.adb | 46 +- gcc/ada/symbols-vms-alpha.adb | 15 +- gcc/ada/system-hpux.ads | 2 +- gcc/ada/system-linux-hppa.ads | 151 + gcc/ada/tbuild.adb | 29 - gcc/ada/tbuild.ads | 14 - gcc/ada/tracebak.c | 4 +- gcc/ada/trans.c | 74 +- gcc/ada/ug_words | 2 + gcc/ada/usage.adb | 5 + gcc/ada/utils.c | 18 +- gcc/ada/utils2.c | 2 +- gcc/ada/vms_data.ads | 6 + gcc/ada/xnmake.adb | 28 +- gcc/ada/xtreeprs.adb | 28 +- gcc/alias.c | 4 +- gcc/attribs.c | 8 +- gcc/basic-block.h | 178 +- gcc/bb-reorder.c | 442 +- gcc/bitmap.c | 73 +- gcc/bitmap.h | 13 +- gcc/bt-load.c | 20 +- gcc/builtin-types.def | 31 +- gcc/builtins.c | 770 +- gcc/builtins.def | 215 + gcc/c-common.c | 642 +- gcc/c-common.def | 40 +- gcc/c-common.h | 103 +- gcc/c-convert.c | 5 +- gcc/c-cppbuiltin.c | 2 +- gcc/c-decl.c | 586 +- gcc/c-dump.c | 40 - gcc/c-format.c | 232 +- gcc/c-gimplify.c | 323 +- gcc/c-lex.c | 16 +- gcc/c-objc-common.c | 40 +- gcc/c-objc-common.h | 2 - gcc/c-opts.c | 55 +- gcc/c-parser.c | 102 +- gcc/c-pch.c | 129 +- gcc/c-pragma.c | 34 +- gcc/c-pretty-print.c | 129 +- gcc/c-semantics.c | 37 +- gcc/c-tree.h | 86 +- gcc/c-typeck.c | 660 +- gcc/c.opt | 63 +- gcc/caller-save.c | 24 +- gcc/calls.c | 83 +- gcc/cfg.c | 114 +- gcc/cfganal.c | 2 +- gcc/cfgcleanup.c | 34 +- gcc/cfgexpand.c | 22 +- gcc/cfghooks.c | 63 + gcc/cfghooks.h | 47 +- gcc/cfglayout.c | 74 +- gcc/cfglayout.h | 1 - gcc/cfgloop.c | 4 +- gcc/cfgloop.h | 10 +- gcc/cfgloopanal.c | 11 +- gcc/cfgloopmanip.c | 175 +- gcc/cfgrtl.c | 177 +- gcc/cgraph.c | 219 +- gcc/cgraph.h | 57 +- gcc/cgraphunit.c | 1070 +- gcc/collect2.c | 232 +- gcc/collect2.h | 10 +- gcc/combine.c | 737 +- gcc/common.opt | 32 +- gcc/config.gcc | 182 +- gcc/config.host | 19 +- gcc/config.in | 733 +- gcc/config/alpha/alpha-protos.h | 1 + gcc/config/alpha/alpha.c | 698 +- gcc/config/alpha/alpha.h | 5 +- gcc/config/alpha/alpha.md | 129 +- gcc/config/alpha/ev4.md | 19 +- gcc/config/alpha/ev5.md | 11 +- gcc/config/alpha/ev6.md | 11 +- gcc/config/alpha/freebsd.h | 2 +- gcc/config/alpha/linux.h | 2 +- gcc/config/alpha/netbsd.h | 2 +- gcc/config/alpha/osf5.h | 2 +- gcc/config/alpha/predicates.md | 4 +- gcc/config/alpha/sync.md | 312 + gcc/config/alpha/unicosmk.h | 8 +- gcc/config/alpha/vms.h | 27 +- gcc/config/arc/arc.c | 91 +- gcc/config/arc/arc.h | 2 +- gcc/config/arc/arc.md | 6 +- gcc/config/arm/arm-cores.def | 34 +- gcc/config/arm/arm-protos.h | 5 +- gcc/config/arm/arm.c | 1610 +- gcc/config/arm/arm.h | 340 +- gcc/config/arm/arm.md | 402 +- gcc/config/arm/arm.opt | 151 + gcc/config/arm/bpabi.h | 11 +- gcc/config/arm/cirrus.md | 12 +- gcc/config/arm/coff.h | 4 +- gcc/config/arm/elf.h | 11 +- gcc/config/arm/fpa.md | 3 +- gcc/config/arm/ieee754-df.S | 4 +- gcc/config/arm/ieee754-sf.S | 4 +- gcc/config/arm/iwmmxt.md | 10 +- gcc/config/arm/lib1funcs.asm | 147 +- gcc/config/arm/linux-elf.h | 5 +- gcc/config/arm/linux-gas.h | 13 - gcc/config/arm/netbsd-elf.h | 17 +- gcc/config/arm/netbsd.h | 19 +- gcc/config/arm/pe.c | 30 +- gcc/config/arm/pe.h | 18 +- gcc/config/arm/pe.opt | 24 + gcc/config/arm/semi.h | 4 +- gcc/config/arm/symbian.h | 14 +- gcc/config/arm/uclinux-elf.h | 4 +- gcc/config/arm/vfp.md | 68 +- gcc/config/arm/wince-pe.h | 4 +- gcc/config/avr/avr.c | 59 +- gcc/config/avr/avr.h | 57 +- gcc/config/avr/avr.opt | 65 + gcc/config/avr/t-avr | 4 - gcc/config/bfin/bfin-modes.def | 25 + gcc/config/bfin/bfin-protos.h | 88 + gcc/config/bfin/bfin.c | 2748 + gcc/config/bfin/bfin.h | 1151 + gcc/config/bfin/bfin.md | 1896 + gcc/config/bfin/bfin.opt | 40 + gcc/config/bfin/crti.s | 47 + gcc/config/bfin/crtn.s | 43 + gcc/config/bfin/elf.h | 16 + gcc/config/bfin/lib1funcs.asm | 120 + gcc/config/bfin/predicates.md | 127 + gcc/config/bfin/t-bfin | 29 + gcc/config/bfin/t-bfin-elf | 29 + gcc/config/c4x/c4x-c.c | 4 +- gcc/config/c4x/c4x-protos.h | 3 - gcc/config/c4x/c4x.c | 120 +- gcc/config/c4x/c4x.h | 201 +- gcc/config/c4x/c4x.opt | 140 + gcc/config/cris/aout.h | 45 +- gcc/config/cris/aout.opt | 32 + gcc/config/cris/cris-protos.h | 14 +- gcc/config/cris/cris.c | 1954 +- gcc/config/cris/cris.h | 319 +- gcc/config/cris/cris.md | 2350 +- gcc/config/cris/cris.opt | 191 + gcc/config/cris/elf.opt | 23 + gcc/config/cris/linux.h | 20 +- gcc/config/cris/linux.opt | 34 + gcc/config/cris/predicates.md | 170 + gcc/config/darwin-c.c | 38 +- gcc/config/darwin.c | 157 +- gcc/config/darwin.h | 39 +- gcc/config/darwin.opt | 28 + gcc/config/fp-bit.c | 6 +- gcc/config/fp-bit.h | 3 +- gcc/config/fr30/fr30-protos.h | 7 - gcc/config/fr30/fr30.c | 123 +- gcc/config/fr30/fr30.h | 32 - gcc/config/fr30/fr30.md | 15 +- gcc/config/fr30/fr30.opt | 27 + gcc/config/fr30/predicates.md | 124 + gcc/config/freebsd-spec.h | 1 + gcc/config/frv/frv-protos.h | 32 +- gcc/config/frv/frv.c | 2043 +- gcc/config/frv/frv.h | 337 +- gcc/config/frv/frv.md | 41 +- gcc/config/frv/frv.opt | 196 + gcc/config/frv/predicates.md | 1550 + gcc/config/h8300/h8300-protos.h | 2 +- gcc/config/h8300/h8300.c | 497 +- gcc/config/h8300/h8300.h | 2 +- gcc/config/h8300/h8300.md | 10 +- gcc/config/host-darwin.c | 79 + gcc/config/host-darwin.h | 28 + gcc/config/i386/cygming.h | 33 +- gcc/config/i386/cygming.opt | 48 + gcc/config/i386/darwin.h | 14 +- gcc/config/i386/djgpp.h | 16 +- gcc/config/i386/djgpp.opt | 26 + gcc/config/i386/host-i386-darwin.c | 31 + gcc/config/i386/i386-protos.h | 10 +- gcc/config/i386/i386.c | 1641 +- gcc/config/i386/i386.h | 345 +- gcc/config/i386/i386.md | 1568 +- gcc/config/i386/i386.opt | 217 + gcc/config/i386/lynx.h | 8 +- gcc/config/i386/mmx.md | 2 +- gcc/config/i386/netware.c | 12 +- gcc/config/i386/predicates.md | 31 +- gcc/config/i386/sco5.h | 8 - gcc/config/i386/sco5.opt | 25 + gcc/config/i386/sse.md | 286 +- gcc/config/i386/sync.md | 155 + gcc/config/i386/winnt.c | 100 +- gcc/config/i386/x-darwin | 4 + gcc/config/i860/i860.h | 29 - gcc/config/i860/i860.opt | 32 + gcc/config/ia64/hpux.h | 3 + gcc/config/ia64/ia64-c.c | 4 +- gcc/config/ia64/ia64-protos.h | 4 +- gcc/config/ia64/ia64.c | 1483 +- gcc/config/ia64/ia64.h | 76 +- gcc/config/ia64/ia64.md | 368 +- gcc/config/ia64/ia64intrin.h | 221 +- gcc/config/ia64/predicates.md | 267 +- gcc/config/ia64/sync.md | 178 + gcc/config/ia64/unwind-ia64.c | 8 +- gcc/config/ia64/vect.md | 2 +- gcc/config/ip2k/ip2k.c | 6 +- gcc/config/ip2k/ip2k.h | 5 - gcc/config/iq2000/iq2000.c | 344 +- gcc/config/iq2000/iq2000.h | 98 +- gcc/config/iq2000/iq2000.md | 6 +- gcc/config/iq2000/iq2000.opt | 45 + gcc/config/iq2000/predicates.md | 233 + gcc/config/lynx.h | 14 - gcc/config/lynx.opt | 32 + gcc/config/m32r/little.h | 4 +- gcc/config/m32r/m32r-protos.h | 24 +- gcc/config/m32r/m32r.c | 605 +- gcc/config/m32r/m32r.h | 173 +- gcc/config/m32r/m32r.md | 8 +- gcc/config/m32r/m32r.opt | 83 + gcc/config/m32r/predicates.md | 442 + gcc/config/m32r/xm-linux.h | 26 - gcc/config/m32r/xm-m32r.h | 43 - gcc/config/m68hc11/m68hc11-protos.h | 22 +- gcc/config/m68hc11/m68hc11.c | 593 +- gcc/config/m68hc11/m68hc11.h | 136 +- gcc/config/m68hc11/m68hc11.md | 74 +- gcc/config/m68hc11/m68hc11.opt | 95 + gcc/config/m68hc11/m68hc12.h | 2 - gcc/config/m68hc11/predicates.md | 229 + gcc/config/m68k/ieee.opt | 25 + gcc/config/m68k/linux.h | 4 - gcc/config/m68k/m68k-protos.h | 3 +- gcc/config/m68k/m68k.c | 415 +- gcc/config/m68k/m68k.h | 251 +- gcc/config/m68k/m68k.md | 105 +- gcc/config/m68k/m68k.opt | 149 + gcc/config/m68k/m68kelf.h | 2 - gcc/config/m68k/predicates.md | 196 + gcc/config/mcore/mcore-protos.h | 22 +- gcc/config/mcore/mcore.c | 455 +- gcc/config/mcore/mcore.h | 125 +- gcc/config/mcore/mcore.md | 23 +- gcc/config/mcore/mcore.opt | 80 + gcc/config/mcore/predicates.md | 333 + gcc/config/mips/24k.md | 455 + gcc/config/mips/3000.md | 4 +- gcc/config/mips/4000.md | 4 +- gcc/config/mips/4100.md | 6 +- gcc/config/mips/4130.md | 6 +- gcc/config/mips/4300.md | 6 +- gcc/config/mips/4600.md | 6 +- gcc/config/mips/4k.md | 154 + gcc/config/mips/5000.md | 6 +- gcc/config/mips/5400.md | 6 +- gcc/config/mips/5500.md | 4 +- gcc/config/mips/7000.md | 202 +- gcc/config/mips/9000.md | 6 +- gcc/config/mips/generic.md | 4 +- gcc/config/mips/iris6.h | 7 +- gcc/config/mips/linux.h | 49 +- gcc/config/mips/mips.c | 103 +- gcc/config/mips/mips.h | 27 +- gcc/config/mips/mips.md | 77 +- gcc/config/mips/mips.opt | 4 - gcc/config/mips/predicates.md | 4 - gcc/config/mips/sb1.md | 4 +- gcc/config/mips/sr71k.md | 332 +- gcc/config/mmix/crti.asm | 2 +- gcc/config/mmix/mmix.c | 154 +- gcc/config/mmix/mmix.h | 104 +- gcc/config/mmix/mmix.md | 28 +- gcc/config/mmix/mmix.opt | 100 + gcc/config/mmix/predicates.md | 151 + gcc/config/mn10300/linux.h | 11 +- gcc/config/mn10300/mn10300-protos.h | 5 +- gcc/config/mn10300/mn10300.c | 110 +- gcc/config/mn10300/mn10300.h | 56 +- gcc/config/mn10300/mn10300.md | 42 +- gcc/config/mn10300/mn10300.opt | 37 + gcc/config/mn10300/predicates.md | 50 + gcc/config/ns32k/netbsd.h | 5 +- gcc/config/ns32k/ns32k.c | 40 +- gcc/config/ns32k/ns32k.h | 97 +- gcc/config/ns32k/ns32k.opt | 108 + gcc/config/pa/pa-hpux.h | 5 - gcc/config/pa/pa-hpux.opt | 32 + gcc/config/pa/pa-hpux10.h | 6 - gcc/config/pa/pa-hpux1010.h | 6 - gcc/config/pa/pa-hpux1010.opt | 24 + gcc/config/pa/pa-hpux11.h | 19 +- gcc/config/pa/pa-hpux1111.h | 6 - gcc/config/pa/pa-hpux1111.opt | 24 + gcc/config/pa/pa-protos.h | 3 + gcc/config/pa/pa.c | 1035 +- gcc/config/pa/pa.h | 267 +- gcc/config/pa/pa.md | 49 +- gcc/config/pa/pa.opt | 119 + gcc/config/pa/pa64-hpux.h | 11 - gcc/config/pa/pa64-hpux.opt | 28 + gcc/config/pa/pa64-linux.h | 5 +- gcc/config/pa/pa64-start.h | 2 + gcc/config/pa/predicates.md | 550 + gcc/config/pa/quadlib.c | 14 +- gcc/config/pa/rtems.h | 39 - gcc/config/pdp11/2bsd.h | 2 +- gcc/config/pdp11/pdp11.c | 88 +- gcc/config/pdp11/pdp11.h | 96 +- gcc/config/pdp11/pdp11.md | 15 +- gcc/config/pdp11/pdp11.opt | 92 + gcc/config/rs6000/aix.h | 15 - gcc/config/rs6000/aix.opt | 25 + gcc/config/rs6000/aix41.h | 5 - gcc/config/rs6000/aix41.opt | 25 + gcc/config/rs6000/aix43.h | 17 +- gcc/config/rs6000/aix51.h | 16 +- gcc/config/rs6000/aix52.h | 17 +- gcc/config/rs6000/aix64.opt | 33 + gcc/config/rs6000/altivec.h | 12034 +---- gcc/config/rs6000/altivec.md | 360 +- gcc/config/rs6000/darwin-fallback.c | 114 +- gcc/config/rs6000/darwin.h | 75 +- gcc/config/rs6000/darwin.md | 12 +- gcc/config/rs6000/darwin.opt | 33 + gcc/config/rs6000/default64.h | 5 +- gcc/config/rs6000/eabispe.h | 10 +- gcc/config/rs6000/host-darwin.c | 66 +- gcc/config/rs6000/linux64.h | 22 +- gcc/config/rs6000/linux64.opt | 25 + gcc/config/rs6000/lynx.h | 3 - gcc/config/rs6000/predicates.md | 152 +- gcc/config/rs6000/rs6000-c.c | 2441 +- gcc/config/rs6000/rs6000-protos.h | 3 +- gcc/config/rs6000/rs6000.c | 2346 +- gcc/config/rs6000/rs6000.h | 596 +- gcc/config/rs6000/rs6000.md | 1436 +- gcc/config/rs6000/rs6000.opt | 231 + gcc/config/rs6000/spe.md | 4 +- gcc/config/rs6000/sysv4.h | 99 +- gcc/config/rs6000/sysv4.opt | 141 + gcc/config/rs6000/t-darwin | 7 +- gcc/config/rs6000/t-darwin8 | 6 +- gcc/config/rs6000/t-rtems | 2 + gcc/config/rs6000/x-darwin | 8 +- gcc/config/s390/2064.md | 12 +- gcc/config/s390/2084.md | 71 +- gcc/config/s390/fixdfdi.h | 4 +- gcc/config/s390/predicates.md | 386 + gcc/config/s390/s390-modes.def | 5 +- gcc/config/s390/s390-protos.h | 33 +- gcc/config/s390/s390.c | 3627 +- gcc/config/s390/s390.h | 113 +- gcc/config/s390/s390.md | 3230 +- gcc/config/s390/s390.opt | 96 + gcc/config/s390/tpf.h | 5 +- gcc/config/sh/crt1.asm | 1092 +- gcc/config/sh/divtab.c | 204 + gcc/config/sh/elf.h | 10 +- gcc/config/sh/lib1funcs.asm | 754 +- gcc/config/sh/libgcc-excl.ver | 1 + gcc/config/sh/linux.h | 10 +- gcc/config/sh/little.h | 2 +- gcc/config/sh/netbsd-elf.h | 30 +- gcc/config/sh/newlib.h | 26 + gcc/config/sh/predicates.md | 38 + gcc/config/sh/sh-modes.def | 4 +- gcc/config/sh/sh-protos.h | 25 +- gcc/config/sh/sh.c | 1866 +- gcc/config/sh/sh.h | 905 +- gcc/config/sh/sh.md | 3544 +- gcc/config/sh/sh.opt | 214 + gcc/config/sh/shmedia.md | 12 +- gcc/config/sh/sshmedia.h | 6 + gcc/config/sh/superh.h | 151 + gcc/config/sh/superh64.h | 50 + gcc/config/sh/symbian-pre.h | 2 +- gcc/config/sh/symbian.c | 36 +- gcc/config/sh/t-linux | 2 +- gcc/config/sh/t-sh64 | 4 +- gcc/config/sh/t-superh | 6 + gcc/config/sh/ushmedia.h | 886 +- gcc/config/sol2-c.c | 36 +- gcc/config/sol2.c | 4 +- gcc/config/sparc/freebsd.h | 5 - gcc/config/sparc/linux.h | 10 +- gcc/config/sparc/linux64.h | 10 +- gcc/config/sparc/lite.h | 31 - gcc/config/sparc/litecoff.h | 63 - gcc/config/sparc/liteelf.h | 46 - gcc/config/sparc/little-endian.opt | 28 + gcc/config/sparc/long-double-switch.opt | 28 + gcc/config/sparc/netbsd-elf.h | 7 - gcc/config/sparc/predicates.md | 472 + gcc/config/sparc/sol2-64.h | 2 +- gcc/config/sparc/sol2.h | 3 +- gcc/config/sparc/sp-elf.h | 3 - gcc/config/sparc/sp64-elf.h | 6 - gcc/config/sparc/sp86x-elf.h | 61 - gcc/config/sparc/sparc.c | 1389 +- gcc/config/sparc/sparc.h | 322 +- gcc/config/sparc/sparc.md | 1465 +- gcc/config/sparc/sparc.opt | 123 + gcc/config/sparc/t-sp86x | 23 - gcc/config/sparc/t-sparclite | 23 - gcc/config/stormy16/predicates.md | 146 + gcc/config/stormy16/stormy16-protos.h | 9 - gcc/config/stormy16/stormy16.c | 222 +- gcc/config/stormy16/stormy16.h | 19 - gcc/config/stormy16/stormy16.md | 5 +- gcc/config/stormy16/stormy16.opt | 25 + gcc/config/t-darwin | 6 +- gcc/config/t-slibgcc-darwin | 37 +- gcc/config/v850/predicates.md | 439 + gcc/config/v850/v850-c.c | 28 +- gcc/config/v850/v850-protos.h | 17 +- gcc/config/v850/v850.c | 742 +- gcc/config/v850/v850.h | 190 +- gcc/config/v850/v850.md | 47 +- gcc/config/v850/v850.opt | 91 + gcc/config/vax/elf.h | 35 +- gcc/config/vax/vax-modes.def | 2 +- gcc/config/vax/vax-protos.h | 11 +- gcc/config/vax/vax.c | 705 +- gcc/config/vax/vax.h | 320 +- gcc/config/vax/vax.md | 941 +- gcc/config/vax/vax.opt | 48 + gcc/config/x-darwin | 3 + gcc/config/xtensa/lib1funcs.asm | 59 +- gcc/config/xtensa/predicates.md | 157 + gcc/config/xtensa/xtensa-protos.h | 43 +- gcc/config/xtensa/xtensa.c | 564 +- gcc/config/xtensa/xtensa.h | 133 +- gcc/config/xtensa/xtensa.md | 124 +- gcc/config/xtensa/xtensa.opt | 40 + gcc/configure | 686 +- gcc/configure.ac | 156 +- gcc/convert.c | 27 + gcc/coverage.c | 69 +- gcc/coverage.h | 2 + gcc/cp/ChangeLog | 680 +- gcc/cp/ChangeLog-1993 | 606 + gcc/cp/ChangeLog-1994 | 5405 ++ gcc/cp/ChangeLog-1995 | 3791 ++ gcc/cp/ChangeLog-1996 | 4047 ++ gcc/cp/ChangeLog-1997 | 2607 + gcc/cp/ChangeLog-1998 | 6887 +++ gcc/cp/ChangeLog-1999 | 6787 +++ gcc/cp/ChangeLog-2000 | 7274 +++ gcc/cp/ChangeLog-2001 | 3895 ++ gcc/cp/ChangeLog-2002 | 4574 ++ gcc/cp/ChangeLog-2003 | 6904 +++ gcc/cp/ChangeLog-2004 | 6877 +++ gcc/cp/ChangeLog.1 | 9451 ---- gcc/cp/ChangeLog.2 | 20677 ------- gcc/cp/ChangeLog.3 | 22648 -------- gcc/cp/ChangeLog.egcs | 4 - gcc/cp/Make-lang.in | 20 +- gcc/cp/call.c | 55 +- gcc/cp/class.c | 120 +- gcc/cp/cp-gimplify.c | 307 +- gcc/cp/cp-objcp-common.h | 12 - gcc/cp/cp-tree.def | 62 +- gcc/cp/cp-tree.h | 192 +- gcc/cp/cvt.c | 18 +- gcc/cp/cxx-pretty-print.c | 118 + gcc/cp/decl.c | 321 +- gcc/cp/decl2.c | 238 +- gcc/cp/dump.c | 43 +- gcc/cp/error.c | 6 +- gcc/cp/except.c | 6 +- gcc/cp/friend.c | 12 +- gcc/cp/init.c | 54 +- gcc/cp/lex.c | 56 +- gcc/cp/mangle.c | 66 +- gcc/cp/method.c | 42 +- gcc/cp/name-lookup.c | 59 +- gcc/cp/name-lookup.h | 10 +- gcc/cp/parser.c | 1390 +- gcc/cp/pt.c | 455 +- gcc/cp/repo.c | 4 +- gcc/cp/rtti.c | 17 +- gcc/cp/search.c | 16 +- gcc/cp/semantics.c | 33 +- gcc/cp/tree.c | 33 +- gcc/cp/typeck.c | 292 +- gcc/cp/typeck2.c | 12 +- gcc/crtstuff.c | 41 +- gcc/cse.c | 69 +- gcc/cselib.c | 13 +- gcc/cselib.h | 3 +- gcc/dbxout.c | 92 +- gcc/ddg.c | 4 +- gcc/debug.c | 6 +- gcc/debug.h | 10 +- gcc/defaults.h | 4 +- gcc/diagnostic.c | 33 +- gcc/diagnostic.h | 6 + gcc/doc/contrib.texi | 8 +- gcc/doc/cpp.texi | 41 +- gcc/doc/cppopts.texi | 2 +- gcc/doc/extend.texi | 280 +- gcc/doc/gcov.texi | 72 +- gcc/doc/install.texi | 328 +- gcc/doc/invoke.texi | 471 +- gcc/doc/md.texi | 288 +- gcc/doc/options.texi | 64 +- gcc/doc/passes.texi | 21 +- gcc/doc/rtl.texi | 7 +- gcc/doc/sourcebuild.texi | 20 +- gcc/doc/tm.texi | 94 +- gcc/doc/tree-ssa.texi | 396 +- gcc/dojump.c | 18 +- gcc/dominance.c | 31 +- gcc/domwalk.c | 14 +- gcc/domwalk.h | 10 +- gcc/dummy-checksum.c | 1 + gcc/dwarf2out.c | 529 +- gcc/emit-rtl.c | 49 +- gcc/errors.c | 4 +- gcc/errors.h | 4 +- gcc/et-forest.c | 11 +- gcc/et-forest.h | 3 +- gcc/except.c | 318 +- gcc/except.h | 17 + gcc/explow.c | 178 +- gcc/expmed.c | 66 +- gcc/expr.c | 122 +- gcc/expr.h | 11 +- gcc/final.c | 185 +- gcc/flow.c | 40 +- gcc/fold-const.c | 2203 +- gcc/fortran/ChangeLog | 524 + gcc/fortran/Make-lang.in | 11 +- gcc/fortran/arith.c | 67 +- gcc/fortran/array.c | 61 +- gcc/fortran/check.c | 299 + gcc/fortran/convert.c | 6 +- gcc/fortran/decl.c | 62 +- gcc/fortran/dump-parse-tree.c | 11 +- gcc/fortran/expr.c | 11 +- gcc/fortran/f95-lang.c | 29 +- gcc/fortran/gfortran.h | 30 +- gcc/fortran/gfortran.texi | 87 +- gcc/fortran/interface.c | 6 +- gcc/fortran/intrinsic.c | 100 +- gcc/fortran/intrinsic.h | 36 + gcc/fortran/intrinsic.texi | 2028 + gcc/fortran/invoke.texi | 143 +- gcc/fortran/io.c | 9 +- gcc/fortran/iresolve.c | 228 +- gcc/fortran/lang.opt | 30 +- gcc/fortran/match.c | 69 +- gcc/fortran/match.h | 4 +- gcc/fortran/module.c | 4 +- gcc/fortran/options.c | 31 +- gcc/fortran/parse.c | 8 +- gcc/fortran/primary.c | 5 + gcc/fortran/resolve.c | 96 +- gcc/fortran/scanner.c | 40 +- gcc/fortran/simplify.c | 183 +- gcc/fortran/symbol.c | 16 +- gcc/fortran/trans-array.c | 200 +- gcc/fortran/trans-common.c | 33 +- gcc/fortran/trans-const.c | 67 +- gcc/fortran/trans-decl.c | 161 +- gcc/fortran/trans-expr.c | 101 +- gcc/fortran/trans-intrinsic.c | 157 +- gcc/fortran/trans-io.c | 367 +- gcc/fortran/trans-stmt.c | 352 +- gcc/fortran/trans-types.c | 127 +- gcc/fortran/trans.c | 2 +- gcc/fortran/trans.h | 6 +- gcc/function.c | 1031 +- gcc/function.h | 45 +- gcc/gcc.c | 250 +- gcc/gcov-dump.c | 5 +- gcc/gcov-io.c | 24 +- gcc/gcov-io.h | 100 +- gcc/gcov.c | 14 +- gcc/gcse.c | 197 +- gcc/gen-protos.c | 5 +- gcc/genattrtab.c | 27 +- gcc/genattrtab.h | 8 +- gcc/genautomata.c | 34 +- gcc/genchecksum.c | 77 + gcc/genextract.c | 9 +- gcc/gengtype-lex.l | 181 +- gcc/gengtype.c | 78 +- gcc/genopinit.c | 28 +- gcc/gensupport.c | 3 + gcc/ggc-page.c | 3 + gcc/ggc-zone.c | 12 +- gcc/ggc.h | 8 +- gcc/gimplify.c | 100 +- gcc/global.c | 83 +- gcc/gthr-posix.c | 27 +- gcc/gthr-win32.h | 6 +- gcc/haifa-sched.c | 47 +- gcc/hooks.c | 12 +- gcc/hooks.h | 6 +- gcc/ifcvt.c | 75 +- gcc/insn-notes.def | 9 +- gcc/integrate.c | 95 +- gcc/integrate.h | 10 +- gcc/intl.c | 2 +- gcc/ipa-inline.c | 740 + gcc/ipa.c | 207 + gcc/java/ChangeLog | 266 +- gcc/java/Make-lang.in | 41 +- gcc/java/builtins.c | 10 +- gcc/java/class.c | 134 +- gcc/java/config-lang.in | 2 +- gcc/java/constants.c | 74 +- gcc/java/decl.c | 70 +- gcc/java/except.c | 332 +- gcc/java/expr.c | 37 +- gcc/java/gcj.texi | 271 +- gcc/java/gjavah.c | 73 +- gcc/java/java-except.h | 4 +- gcc/java/java-tree.h | 14 +- gcc/java/jcf-dump.c | 25 +- gcc/java/jcf-io.c | 2 +- gcc/java/jcf-parse.c | 8 +- gcc/java/jcf-write.c | 2 - gcc/java/jv-scan.c | 19 +- gcc/java/jvgenmain.c | 5 +- gcc/java/lang.c | 4 +- gcc/java/lang.opt | 8 +- gcc/java/parse.h | 3 +- gcc/java/parse.y | 111 +- gcc/java/resource.c | 5 +- gcc/java/verify-glue.c | 2 +- gcc/java/verify.c | 1 - gcc/jump.c | 49 +- gcc/lambda-code.c | 283 +- gcc/lambda-mat.c | 7 +- gcc/lambda.h | 23 +- gcc/langhooks-def.h | 1 - gcc/langhooks.c | 73 +- gcc/langhooks.h | 17 +- gcc/lcm.c | 62 +- gcc/libgcc2.c | 34 +- gcc/libgcc2.h | 57 +- gcc/libgcov.c | 208 +- gcc/local-alloc.c | 21 +- gcc/loop-doloop.c | 14 +- gcc/loop-invariant.c | 41 +- gcc/loop-iv.c | 128 +- gcc/loop-unroll.c | 157 +- gcc/loop-unswitch.c | 39 +- gcc/loop.c | 197 +- gcc/machmode.def | 4 +- gcc/mips-tfile.c | 10 +- gcc/mkconfig.sh | 14 +- gcc/mklibgcc.in | 5 +- gcc/modulo-sched.c | 1039 +- gcc/objc/ChangeLog | 156 + gcc/objc/Make-lang.in | 19 +- gcc/objc/objc-act.c | 1202 +- gcc/objc/objc-act.h | 58 +- gcc/objc/objc-lang.c | 4 + gcc/objcp/ChangeLog | 25 + gcc/objcp/Make-lang.in | 149 + gcc/objcp/config-lang.in | 43 + gcc/objcp/lang-specs.h | 60 + gcc/objcp/objcp-decl.c | 134 + gcc/objcp/objcp-decl.h | 95 + gcc/objcp/objcp-lang.c | 145 + gcc/opt-functions.awk | 59 +- gcc/optabs.c | 860 +- gcc/optabs.h | 43 + gcc/optc-gen.awk | 127 +- gcc/opth-gen.awk | 78 +- gcc/opts.c | 47 +- gcc/opts.h | 5 +- gcc/output.h | 40 +- gcc/params.c | 5 +- gcc/params.def | 58 +- gcc/params.h | 6 + gcc/passes.c | 61 +- gcc/po/ChangeLog | 59 + gcc/po/be.po | 5100 +- gcc/po/ca.po | 5153 +- gcc/po/da.po | 5174 +- gcc/po/de.po | 10951 ++-- gcc/po/el.po | 5140 +- gcc/po/es.po | 7081 ++- gcc/po/exgettext | 27 +- gcc/po/fr.po | 5196 +- gcc/po/gcc.pot | 17909 +++---- gcc/po/ja.po | 5150 +- gcc/po/nl.po | 5124 +- gcc/po/rw.po | 28908 ++++++++++ gcc/po/sv.po | 5138 +- gcc/po/tr.po | 5176 +- gcc/po/zh_CN.po | 21332 ++++++++ gcc/postreload-gcse.c | 83 +- gcc/postreload.c | 11 +- gcc/predict.c | 16 +- gcc/predict.h | 3 - gcc/prefix.c | 2 +- gcc/pretty-print.c | 17 +- gcc/print-rtl.c | 12 +- gcc/print-tree.c | 23 + gcc/profile.c | 58 +- gcc/protoize.c | 62 +- gcc/read-rtl.c | 220 +- gcc/recog.c | 40 + gcc/recog.h | 1 + gcc/reg-notes.def | 4 - gcc/reg-stack.c | 29 +- gcc/regclass.c | 6 +- gcc/regmove.c | 4 +- gcc/reload.c | 34 +- gcc/reload1.c | 49 +- gcc/reorg.c | 13 +- gcc/resource.c | 4 +- gcc/rtl-profile.c | 159 +- gcc/rtl.c | 6 +- gcc/rtl.h | 30 +- gcc/rtlanal.c | 8 +- gcc/rtlhooks-def.h | 5 +- gcc/rtlhooks.c | 59 +- gcc/sched-deps.c | 19 + gcc/sched-int.h | 25 - gcc/sched-vis.c | 4 +- gcc/sdbout.c | 6 +- gcc/simplify-rtx.c | 229 +- gcc/stmt.c | 101 +- gcc/stor-layout.c | 153 +- gcc/stub-objc.c | 27 +- gcc/system.h | 90 +- gcc/target-def.h | 25 +- gcc/target.h | 43 +- gcc/testsuite/ChangeLog | 1929 +- gcc/testsuite/ada/acats/run_all.sh | 3 + gcc/testsuite/g++.dg/abi/covariant5.C | 52 + gcc/testsuite/g++.dg/abi/param2.C | 18 + gcc/testsuite/g++.dg/bprob/bprob.exp | 2 +- gcc/testsuite/g++.dg/cpp/weak.C | 5 + gcc/testsuite/g++.dg/debug/const2.C | 15 + gcc/testsuite/g++.dg/debug/using1.C | 15 + gcc/testsuite/g++.dg/eh/fp-regs.C | 94 + gcc/testsuite/g++.dg/eh/throw3.C | 8 + gcc/testsuite/g++.dg/expr/cast3.C | 22 + gcc/testsuite/g++.dg/expr/lval2.C | 27 + gcc/testsuite/g++.dg/ext/altivec-10.C | 2 + gcc/testsuite/g++.dg/ext/attrib21.C | 17 + gcc/testsuite/g++.dg/ext/selectany1.C | 21 + gcc/testsuite/g++.dg/ext/selectany2.C | 30 + gcc/testsuite/g++.dg/ext/stmtexpr4.C | 8 + gcc/testsuite/g++.dg/ext/sync-1.C | 40 + gcc/testsuite/g++.dg/ext/sync-2.C | 58 + gcc/testsuite/g++.dg/ext/visibility/arm2.C | 11 + gcc/testsuite/g++.dg/ext/visibility/arm3.C | 12 + .../g++.dg/ext/visibility/pragma-override1.C | 2 +- .../g++.dg/ext/visibility/pragma-override2.C | 2 +- gcc/testsuite/g++.dg/ext/visibility/symbian2.C | 11 + gcc/testsuite/g++.dg/ext/visibility/visibility-7.C | 2 +- gcc/testsuite/g++.dg/ext/weak2.C | 17 + gcc/testsuite/g++.dg/ext/weak3.C | 17 + gcc/testsuite/g++.dg/inherit/covariant13.C | 25 + gcc/testsuite/g++.dg/inherit/local3.C | 14 + gcc/testsuite/g++.dg/lookup/builtin2.C | 19 + gcc/testsuite/g++.dg/lookup/using13.C | 12 + gcc/testsuite/g++.dg/opt/20050511-1.C | 64 + gcc/testsuite/g++.dg/opt/alias2.C | 2 +- gcc/testsuite/g++.dg/opt/const4.C | 9 + gcc/testsuite/g++.dg/opt/crossjump1.C | 33 + gcc/testsuite/g++.dg/opt/max1.C | 2 +- gcc/testsuite/g++.dg/opt/nothrow1.C | 1 + gcc/testsuite/g++.dg/opt/pr13066-1.C | 22 + gcc/testsuite/g++.dg/opt/pr19108.C | 19 + gcc/testsuite/g++.dg/opt/pr20991.C | 34 + gcc/testsuite/g++.dg/opt/pr20995-1.C | 8 + gcc/testsuite/g++.dg/opt/pr7503-2.C | 2 +- gcc/testsuite/g++.dg/opt/pr7503-3.C | 2 +- gcc/testsuite/g++.dg/opt/pr7503-4.C | 2 +- gcc/testsuite/g++.dg/opt/pr7503-5.C | 2 +- gcc/testsuite/g++.dg/opt/rtti2.C | 17 + gcc/testsuite/g++.dg/other/profile1.C | 2 + gcc/testsuite/g++.dg/other/static11.C | 2 + gcc/testsuite/g++.dg/parse/ambig3.C | 15 +- gcc/testsuite/g++.dg/parse/cond2.C | 14 + gcc/testsuite/g++.dg/parse/crash24.C | 6 + gcc/testsuite/g++.dg/parse/crash25.C | 10 + gcc/testsuite/g++.dg/parse/error16.C | 4 +- gcc/testsuite/g++.dg/parse/extern1.C | 14 + gcc/testsuite/g++.dg/parse/repo1.C | 2 + gcc/testsuite/g++.dg/pch/pch.C | 2 + gcc/testsuite/g++.dg/special/ecos.exp | 1 + gcc/testsuite/g++.dg/template/crash35.C | 9 + gcc/testsuite/g++.dg/template/crash36.C | 9 + gcc/testsuite/g++.dg/template/crash37.C | 26 + gcc/testsuite/g++.dg/template/overload4.C | 20 + gcc/testsuite/g++.dg/template/ptrmem12.C | 29 + gcc/testsuite/g++.dg/template/ptrmem13.C | 11 + gcc/testsuite/g++.dg/template/ptrmem14.C | 12 + gcc/testsuite/g++.dg/template/redecl3.C | 7 + gcc/testsuite/g++.dg/template/repo1.C | 1 + gcc/testsuite/g++.dg/template/repo2.C | 2 + gcc/testsuite/g++.dg/template/repo3.C | 2 + gcc/testsuite/g++.dg/template/sizeof9.C | 6 + gcc/testsuite/g++.dg/template/spec20.C | 19 + gcc/testsuite/g++.dg/template/spec21.C | 28 + gcc/testsuite/g++.dg/template/spec22.C | 22 + gcc/testsuite/g++.dg/template/spec23.C | 25 + gcc/testsuite/g++.dg/tls/diag-2.C | 2 +- gcc/testsuite/g++.dg/tls/tls.exp | 3 +- gcc/testsuite/g++.dg/tree-ssa/builtin1.C | 10 + gcc/testsuite/g++.dg/tree-ssa/empty-1.C | 1 + gcc/testsuite/g++.dg/tree-ssa/nothrow-1.C | 1 + .../g++.dg/tree-ssa/pointer-reference-alias.C | 4 +- gcc/testsuite/g++.dg/tree-ssa/pr14814.C | 20 + gcc/testsuite/g++.dg/tree-ssa/pr15791-3.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/pr15791-4.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/pr15791-5.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/pr18178.C | 47 + gcc/testsuite/g++.dg/tree-ssa/pr19807.C | 24 + gcc/testsuite/g++.dg/tree-ssa/pr20920.C | 26 + gcc/testsuite/g++.dg/tree-ssa/pr20963.C | 23 + gcc/testsuite/g++.dg/tree-ssa/pr21082.C | 13 + gcc/testsuite/g++.dg/tree-ssa/pr21407.C | 8 + gcc/testsuite/g++.dg/tree-ssa/ssa-cast-1.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/ssa-sra-1.C | 1 + gcc/testsuite/g++.dg/tree-ssa/ssa-sra-2.C | 1 + gcc/testsuite/g++.dg/tree-ssa/ssa-sra-3.C | 83 + gcc/testsuite/g++.dg/tree-ssa/tmmti-2.C | 22 + gcc/testsuite/g++.dg/vect/pr19951.cc | 2 + gcc/testsuite/g++.dg/warn/Wdtor1.C | 22 + gcc/testsuite/g++.dg/warn/Wunused-11.C | 11 + gcc/testsuite/g++.dg/warn/format4.C | 13 + gcc/testsuite/g++.dg/warn/minmax.C | 15 + gcc/testsuite/g++.dg/warn/sentinel.C | 11 + gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C | 4 +- gcc/testsuite/g++.old-deja/g++.jason/warning9.C | 5 +- gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog | 5 + gcc/testsuite/g++.old-deja/g++.oliva/expr2.C | 2 +- gcc/testsuite/g++.old-deja/g++.pt/instantiate4.C | 2 + gcc/testsuite/g++.old-deja/g++.pt/instantiate6.C | 2 + gcc/testsuite/g++.old-deja/g++.pt/repo1.C | 2 + gcc/testsuite/g++.old-deja/g++.pt/repo2.C | 2 + gcc/testsuite/g++.old-deja/g++.pt/repo3.C | 2 + gcc/testsuite/g++.old-deja/g++.pt/repo4.C | 2 + gcc/testsuite/g++.old-deja/g++.robertl/eb83.C | 2 + gcc/testsuite/g++.old-deja/g++.warn/compare1.C | 2 +- gcc/testsuite/gcc.c-torture/compile/20011119-1.c | 8 +- gcc/testsuite/gcc.c-torture/compile/20011119-2.c | 8 +- gcc/testsuite/gcc.c-torture/compile/20040323-1.c | 2 +- gcc/testsuite/gcc.c-torture/compile/20050328-1.c | 24 + gcc/testsuite/gcc.c-torture/compile/20050510-1.c | 12 + gcc/testsuite/gcc.c-torture/compile/20050516-1.c | 12 + gcc/testsuite/gcc.c-torture/compile/981001-2.c | 2 + gcc/testsuite/gcc.c-torture/compile/pr13066-1.c | 10 + gcc/testsuite/gcc.c-torture/compile/pr17913.c | 7 + gcc/testsuite/gcc.c-torture/compile/pr20203.c | 16 + gcc/testsuite/gcc.c-torture/compile/pr20539-1.c | 10 + gcc/testsuite/gcc.c-torture/compile/pr21021.c | 19 + gcc/testsuite/gcc.c-torture/compile/pr21030.c | 19 + gcc/testsuite/gcc.c-torture/compile/pr21380.c | 42 + gcc/testsuite/gcc.c-torture/compile/pr21532.c | 14 + .../gcc.c-torture/compile/struct-non-lval-1.c | 7 + .../gcc.c-torture/compile/struct-non-lval-2.c | 7 + .../gcc.c-torture/compile/struct-non-lval-3.c | 7 + gcc/testsuite/gcc.c-torture/compile/sync-1.c | 276 + gcc/testsuite/gcc.c-torture/execute/20000523-1.c | 2 +- gcc/testsuite/gcc.c-torture/execute/20020720-1.x | 2 +- gcc/testsuite/gcc.c-torture/execute/20030216-1.x | 12 + gcc/testsuite/gcc.c-torture/execute/20041019-1.c | 52 + gcc/testsuite/gcc.c-torture/execute/20041218-2.c | 2 +- gcc/testsuite/gcc.c-torture/execute/20050316-1.c | 69 + gcc/testsuite/gcc.c-torture/execute/20050410-1.c | 13 + gcc/testsuite/gcc.c-torture/execute/20050502-1.c | 67 + gcc/testsuite/gcc.c-torture/execute/20050502-2.c | 34 + .../gcc.c-torture/execute/builtins/abs-1-lib.c | 1 + .../gcc.c-torture/execute/builtins/fputs-lib.c | 1 + .../gcc.c-torture/execute/builtins/lib/fprintf.c | 1 + .../gcc.c-torture/execute/builtins/lib/main.c | 1 + .../gcc.c-torture/execute/builtins/lib/memcmp.c | 1 + .../gcc.c-torture/execute/builtins/lib/memmove.c | 1 + .../gcc.c-torture/execute/builtins/lib/mempcpy.c | 1 + .../gcc.c-torture/execute/builtins/lib/memset.c | 1 + .../gcc.c-torture/execute/builtins/lib/printf.c | 1 + .../gcc.c-torture/execute/builtins/lib/sprintf.c | 1 + .../gcc.c-torture/execute/builtins/lib/stpcpy.c | 1 + .../gcc.c-torture/execute/builtins/lib/strchr.c | 1 + .../gcc.c-torture/execute/builtins/lib/strcmp.c | 1 + .../gcc.c-torture/execute/builtins/lib/strcpy.c | 1 + .../gcc.c-torture/execute/builtins/lib/strcspn.c | 1 + .../gcc.c-torture/execute/builtins/lib/strlen.c | 1 + .../gcc.c-torture/execute/builtins/lib/strncat.c | 3 +- .../gcc.c-torture/execute/builtins/lib/strncmp.c | 1 + .../gcc.c-torture/execute/builtins/lib/strncpy.c | 1 + .../gcc.c-torture/execute/builtins/lib/strpbrk.c | 5 +- .../gcc.c-torture/execute/builtins/lib/strrchr.c | 1 + .../gcc.c-torture/execute/builtins/lib/strspn.c | 1 + .../gcc.c-torture/execute/builtins/lib/strstr.c | 1 + .../execute/builtins/memops-asm-lib.c | 1 + .../gcc.c-torture/execute/builtins/strcat.c | 16 +- .../gcc.c-torture/execute/builtins/strlen-2.c | 1 + .../gcc.c-torture/execute/builtins/strlen-3.c | 2 + .../gcc.c-torture/execute/builtins/strncat.c | 68 +- .../gcc.c-torture/execute/builtins/strncmp-2.c | 10 +- .../gcc.c-torture/execute/builtins/strncmp.c | 1 - .../gcc.c-torture/execute/builtins/strncpy.c | 50 +- .../execute/builtins/strstr-asm-lib.c | 8 +- .../gcc.c-torture/execute/loop-ivopts-2.c | 50 + gcc/testsuite/gcc.c-torture/execute/medce-2.c | 42 - gcc/testsuite/gcc.c-torture/execute/pr20466-1.c | 26 + gcc/testsuite/gcc.c-torture/execute/pr20527-1.c | 81 + gcc/testsuite/gcc.c-torture/execute/pr20601-1.c | 122 + gcc/testsuite/gcc.c-torture/execute/pr21173.c | 21 + gcc/testsuite/gcc.c-torture/execute/stdarg-4.c | 137 + gcc/testsuite/gcc.dg/20020201-1.c | 2 + gcc/testsuite/gcc.dg/20020219-1.c | 13 +- gcc/testsuite/gcc.dg/20020312-2.c | 2 +- gcc/testsuite/gcc.dg/20020919-1.c | 5 +- gcc/testsuite/gcc.dg/20021029-1.c | 1 + gcc/testsuite/gcc.dg/20030107-1.c | 2 + gcc/testsuite/gcc.dg/20030702-1.c | 1 + gcc/testsuite/gcc.dg/20040206-1.c | 4 +- gcc/testsuite/gcc.dg/20050321-1.c | 26 + gcc/testsuite/gcc.dg/20050321-2.c | 54 + gcc/testsuite/gcc.dg/20050325-1.c | 19 + gcc/testsuite/gcc.dg/20050330-1.c | 14 + gcc/testsuite/gcc.dg/20050409-1.c | 18 + gcc/testsuite/gcc.dg/20050503-1.c | 49 + gcc/testsuite/gcc.dg/20050517-1.c | 8 + gcc/testsuite/gcc.dg/Foundation.framework/empty | 1 + gcc/testsuite/gcc.dg/Wint-to-pointer-cast-1.c | 12 + gcc/testsuite/gcc.dg/Wint-to-pointer-cast-2.c | 12 + gcc/testsuite/gcc.dg/Wint-to-pointer-cast-3.c | 20 + gcc/testsuite/gcc.dg/Wpointer-to-int-cast-1.c | 12 + gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c | 12 + gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c | 21 + gcc/testsuite/gcc.dg/alias-7.c | 20 + gcc/testsuite/gcc.dg/altivec-16.c | 2 + gcc/testsuite/gcc.dg/altivec-21.c | 4 +- gcc/testsuite/gcc.dg/altivec-3.c | 2 +- gcc/testsuite/gcc.dg/arm-g2.c | 6 +- gcc/testsuite/gcc.dg/arm-mmx-1.c | 5 +- gcc/testsuite/gcc.dg/arm-scd42-2.c | 6 +- gcc/testsuite/gcc.dg/arm-vfp1.c | 127 + gcc/testsuite/gcc.dg/bitfld-14.c | 11 + gcc/testsuite/gcc.dg/builtin-apply4.c | 30 + gcc/testsuite/gcc.dg/builtins-30.c | 6 +- gcc/testsuite/gcc.dg/builtins-43.c | 7 +- gcc/testsuite/gcc.dg/builtins-44.c | 2 +- gcc/testsuite/gcc.dg/builtins-45.c | 2 +- gcc/testsuite/gcc.dg/builtins-46.c | 39 +- gcc/testsuite/gcc.dg/builtins-47.c | 2 +- gcc/testsuite/gcc.dg/builtins-53.c | 121 + gcc/testsuite/gcc.dg/c99-math-double-1.c | 18 + gcc/testsuite/gcc.dg/c99-math-float-1.c | 18 + gcc/testsuite/gcc.dg/c99-math-long-double-1.c | 18 + gcc/testsuite/gcc.dg/c99-math.h | 111 + gcc/testsuite/gcc.dg/c99-vla-jump-1.c | 305 + gcc/testsuite/gcc.dg/c99-vla-jump-2.c | 305 + gcc/testsuite/gcc.dg/c99-vla-jump-3.c | 305 + gcc/testsuite/gcc.dg/c99-vla-jump-4.c | 305 + gcc/testsuite/gcc.dg/c99-vla-jump-5.c | 30 + gcc/testsuite/gcc.dg/cleanup-5.c | 3 +- gcc/testsuite/gcc.dg/compat/generate-random.c | 6 - gcc/testsuite/gcc.dg/compat/generate-random_r.c | 6 - gcc/testsuite/gcc.dg/compat/struct-layout-1.exp | 5 +- gcc/testsuite/gcc.dg/compat/struct-layout-1.h | 205 + .../gcc.dg/compat/struct-layout-1_generate.c | 420 +- gcc/testsuite/gcc.dg/const-elim-1.c | 4 +- gcc/testsuite/gcc.dg/cpp/direct2s.c | 2 + gcc/testsuite/gcc.dg/cpp/macspace1.c | 61 + gcc/testsuite/gcc.dg/cpp/macspace2.c | 61 + gcc/testsuite/gcc.dg/cpp/paste4.c | 2 + gcc/testsuite/gcc.dg/cpp/separate-1.c | 2 + gcc/testsuite/gcc.dg/cpp/very-long-comment.c | 14 + gcc/testsuite/gcc.dg/debug/pr16676.c | 5 + gcc/testsuite/gcc.dg/enum3.c | 11 + gcc/testsuite/gcc.dg/fold-div-1.c | 30 + gcc/testsuite/gcc.dg/fold-xor-1.c | 12 + gcc/testsuite/gcc.dg/fold-xor-2.c | 16 + gcc/testsuite/gcc.dg/format/asm_fprintf-2.c | 9 + gcc/testsuite/gcc.dg/format/asm_fprintf-3.c | 10 + gcc/testsuite/gcc.dg/format/asm_fprintf-4.c | 10 + gcc/testsuite/gcc.dg/format/asm_fprintf-5.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-2.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-3.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-4.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-5.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-6.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-7.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-8.c | 10 + gcc/testsuite/gcc.dg/format/gcc_diag-9.c | 10 + gcc/testsuite/gcc.dg/framework-2.c | 4 + gcc/testsuite/gcc.dg/i386-387-7.c | 1 + gcc/testsuite/gcc.dg/i386-3dnowA-1.c | 1 + gcc/testsuite/gcc.dg/i386-3dnowA-2.c | 1 + gcc/testsuite/gcc.dg/i386-darwin-fpmath.c | 9 + gcc/testsuite/gcc.dg/i386-sse-11.c | 92 + gcc/testsuite/gcc.dg/i386-ssefn-1.c | 30 + gcc/testsuite/gcc.dg/i386-ssefn-2.c | 30 + gcc/testsuite/gcc.dg/i386-ssefn-3.c | 43 + gcc/testsuite/gcc.dg/i386-ssefn-4.c | 43 + gcc/testsuite/gcc.dg/i386-xorps.c | 31 + gcc/testsuite/gcc.dg/ia64-fptr-1.c | 2 +- gcc/testsuite/gcc.dg/ia64-sync-1.c | 7 +- gcc/testsuite/gcc.dg/ia64-sync-2.c | 7 +- gcc/testsuite/gcc.dg/ia64-sync-3.c | 7 +- gcc/testsuite/gcc.dg/ia64-sync-4.c | 10 +- gcc/testsuite/gcc.dg/inline-mcpy.c | 11 + gcc/testsuite/gcc.dg/intmax_t-1.c | 2 +- gcc/testsuite/gcc.dg/loop-3.c | 2 +- gcc/testsuite/gcc.dg/mips-args-1.c | 35 - gcc/testsuite/gcc.dg/mips-args-2.c | 18 - gcc/testsuite/gcc.dg/mips-args-3.c | 38 - gcc/testsuite/gcc.dg/mips-movcc-1.c | 33 - gcc/testsuite/gcc.dg/mips-movcc-2.c | 33 - gcc/testsuite/gcc.dg/mips-movcc-3.c | 51 - gcc/testsuite/gcc.dg/mips-nmadd-1.c | 34 - gcc/testsuite/gcc.dg/mips-nmadd-2.c | 34 - gcc/testsuite/gcc.dg/mips-rsqrt-1.c | 21 - gcc/testsuite/gcc.dg/mips-rsqrt-2.c | 21 - gcc/testsuite/gcc.dg/mips-rsqrt-3.c | 28 - gcc/testsuite/gcc.dg/nonnull-3.c | 7 + gcc/testsuite/gcc.dg/noreturn-7.c | 2 +- gcc/testsuite/gcc.dg/old-style-then-proto-1.c | 44 + gcc/testsuite/gcc.dg/pch/save-temps-1.c | 2 + gcc/testsuite/gcc.dg/ppc-stfiwx.c | 8 + gcc/testsuite/gcc.dg/ppc-vec-merge.c | 600 + gcc/testsuite/gcc.dg/ppc-vector-memcpy.c | 1 + gcc/testsuite/gcc.dg/ppc-vector-memset.c | 1 + gcc/testsuite/gcc.dg/pr12092-1.c | 1 + gcc/testsuite/gcc.dg/pr15443-1.c | 10 + gcc/testsuite/gcc.dg/pr15443-2.c | 15 + gcc/testsuite/gcc.dg/pr15698-1.c | 23 + gcc/testsuite/gcc.dg/pr15698-2.c | 9 + gcc/testsuite/gcc.dg/pr15698-3.c | 11 + gcc/testsuite/gcc.dg/pr15698-4.c | 9 + gcc/testsuite/gcc.dg/pr15698-5.c | 10 + gcc/testsuite/gcc.dg/pr15698-6.c | 9 + gcc/testsuite/gcc.dg/pr15698-7.c | 10 + gcc/testsuite/gcc.dg/pr15698-8.c | 11 + gcc/testsuite/gcc.dg/pr15784-1.c | 5 +- gcc/testsuite/gcc.dg/pr15784-2.c | 5 +- gcc/testsuite/gcc.dg/pr15784-3.c | 6 +- gcc/testsuite/gcc.dg/pr18501.c | 2 +- gcc/testsuite/gcc.dg/pr19345.c | 12 + gcc/testsuite/gcc.dg/pr20115-1.c | 1 + gcc/testsuite/gcc.dg/pr20126.c | 50 + gcc/testsuite/gcc.dg/pr20130-1.c | 4 +- gcc/testsuite/gcc.dg/pr20368-1.c | 12 + gcc/testsuite/gcc.dg/pr20368-2.c | 12 + gcc/testsuite/gcc.dg/pr20368-3.c | 12 + gcc/testsuite/gcc.dg/pr20672-1.c | 7 + gcc/testsuite/gcc.dg/pr20922-1.c | 38 + gcc/testsuite/gcc.dg/pr20922-2.c | 18 + gcc/testsuite/gcc.dg/pr20922-3.c | 33 + gcc/testsuite/gcc.dg/pr20922-4.c | 38 + gcc/testsuite/gcc.dg/pr20922-5.c | 23 + gcc/testsuite/gcc.dg/pr20922-6.c | 33 + gcc/testsuite/gcc.dg/pr20927.c | 23 + gcc/testsuite/gcc.dg/pr21085.c | 9 + gcc/testsuite/gcc.dg/pr21282.c | 9 + gcc/testsuite/gcc.dg/pr8788-1.c | 20 + gcc/testsuite/gcc.dg/profile-generate-1.c | 2 + gcc/testsuite/gcc.dg/redecl-11.c | 9 + gcc/testsuite/gcc.dg/redecl-12.c | 9 + gcc/testsuite/gcc.dg/redecl-13.c | 9 + gcc/testsuite/gcc.dg/redecl-14.c | 22 + gcc/testsuite/gcc.dg/redecl-15.c | 14 + gcc/testsuite/gcc.dg/redecl-16.c | 18 + gcc/testsuite/gcc.dg/rs6000-fpint-2.c | 11 + gcc/testsuite/gcc.dg/rs6000-fpint.c | 11 + gcc/testsuite/gcc.dg/short-compare-1.c | 2 +- gcc/testsuite/gcc.dg/short-compare-2.c | 2 +- gcc/testsuite/gcc.dg/smod-1.c | 2 +- gcc/testsuite/gcc.dg/sparc-reg-1.c | 11 + gcc/testsuite/gcc.dg/stabs-attrib-vect-darwin.c | 11 + gcc/testsuite/gcc.dg/stmt-expr-label-1.c | 404 + gcc/testsuite/gcc.dg/stmt-expr-label-2.c | 27 + gcc/testsuite/gcc.dg/stmt-expr-label-3.c | 8 + gcc/testsuite/gcc.dg/sync-1.c | 40 + gcc/testsuite/gcc.dg/tls/opt-9.c | 7 + gcc/testsuite/gcc.dg/tls/tls.exp | 1 + gcc/testsuite/gcc.dg/torture/asm-subreg-1.c | 14 + gcc/testsuite/gcc.dg/torture/badshift.c | 29 + gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c | 35 + gcc/testsuite/gcc.dg/torture/pr19683-1.c | 8 + gcc/testsuite/gcc.dg/torture/tree-loop-1.c | 21 + gcc/testsuite/gcc.dg/transparent-union-3.c | 22 + gcc/testsuite/gcc.dg/tree-ssa/20030530-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030611-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030703-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030709-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030729-1.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030730-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030730-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030731-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030731-2.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/20030807-1.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030807-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030807-5.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030807-8.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030807-9.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030808-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030814-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030814-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030814-3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030814-7.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030815-1.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/20030821-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030824-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030824-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030825-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030907-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030917-1.c | 7 +- gcc/testsuite/gcc.dg/tree-ssa/20030917-3.c | 7 +- gcc/testsuite/gcc.dg/tree-ssa/20030922-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20030922-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031015-1.c | 6 +- gcc/testsuite/gcc.dg/tree-ssa/20031021-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031022-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031106-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031106-2.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20031106-3.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031106-4.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031106-5.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031106-6.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20031216-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040204-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040210-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040211-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040216-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20040305-1.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/20040430-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040513-1.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/20040513-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040517-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040518-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040518-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040615-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040624-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20040703-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040721-1.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/20040729-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20040911-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20041002-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c | 38 + gcc/testsuite/gcc.dg/tree-ssa/20041122-1.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/20050128-1.c | 7 +- gcc/testsuite/gcc.dg/tree-ssa/20050215-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/20050314-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/20050412-1.c | 16 + gcc/testsuite/gcc.dg/tree-ssa/alias-1.c | 17 + gcc/testsuite/gcc.dg/tree-ssa/asm-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/asm-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/asm-3.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/bool-1.c | 19 + gcc/testsuite/gcc.dg/tree-ssa/bool-2.c | 22 + gcc/testsuite/gcc.dg/tree-ssa/bool-3.c | 18 + gcc/testsuite/gcc.dg/tree-ssa/bool-4.c | 17 + gcc/testsuite/gcc.dg/tree-ssa/bool-5.c | 19 + gcc/testsuite/gcc.dg/tree-ssa/bool-6.c | 22 + gcc/testsuite/gcc.dg/tree-ssa/bool-7.c | 18 + gcc/testsuite/gcc.dg/tree-ssa/bool-8.c | 17 + gcc/testsuite/gcc.dg/tree-ssa/bool-9.c | 17 + gcc/testsuite/gcc.dg/tree-ssa/cfgcleanup-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/complex-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/complex-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/copy-headers.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c | 32 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c | 38 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c | 33 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c | 39 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c | 37 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c | 56 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c | 34 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c | 35 + gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c | 33 + gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ifc-20040816-2.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/ifc-3.c | 12 + gcc/testsuite/gcc.dg/tree-ssa/inline_asm-1.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/inline_asm-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/loop-1.c | 3 + gcc/testsuite/gcc.dg/tree-ssa/loop-2.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/loop-3.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/loop-4.c | 6 +- gcc/testsuite/gcc.dg/tree-ssa/loop-5.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/loop-6.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/loop-7.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/loop-8.c | 25 + gcc/testsuite/gcc.dg/tree-ssa/ltrans-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ltrans-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ltrans-3.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ltrans-4.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ltrans-5.c | 18 - gcc/testsuite/gcc.dg/tree-ssa/phi-opt-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/phi-opt-3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-4.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr14814.c | 25 + gcc/testsuite/gcc.dg/tree-ssa/pr14841.c | 29 + gcc/testsuite/gcc.dg/tree-ssa/pr15349.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr15791-3.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr15791-4.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr15791-5.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/pr16721.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c | 18 + gcc/testsuite/gcc.dg/tree-ssa/pr17141-2.c | 30 + gcc/testsuite/gcc.dg/tree-ssa/pr17598.c | 42 + gcc/testsuite/gcc.dg/tree-ssa/pr18133-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr18133-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr18134.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr19633.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/pr20470.c | 15 + gcc/testsuite/gcc.dg/tree-ssa/pr20657.c | 18 + gcc/testsuite/gcc.dg/tree-ssa/pr20702.c | 29 + gcc/testsuite/gcc.dg/tree-ssa/pr20739.c | 24 + gcc/testsuite/gcc.dg/tree-ssa/pr20913.c | 34 + gcc/testsuite/gcc.dg/tree-ssa/pr20933.c | 70 + gcc/testsuite/gcc.dg/tree-ssa/pr21001.c | 21 + gcc/testsuite/gcc.dg/tree-ssa/pr21031.c | 20 + gcc/testsuite/gcc.dg/tree-ssa/pr21171.c | 29 + gcc/testsuite/gcc.dg/tree-ssa/pr21294.c | 23 + gcc/testsuite/gcc.dg/tree-ssa/pr21563.c | 17 + gcc/testsuite/gcc.dg/tree-ssa/recip-1.c | 14 + gcc/testsuite/gcc.dg/tree-ssa/recip-2.c | 23 + gcc/testsuite/gcc.dg/tree-ssa/sra-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/sra-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/sra-3.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-1.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-10.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-11.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-12.c | 32 + gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-2.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-3.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-7.c | 6 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-9.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dce-3.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-ccp-1.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-1.c | 5 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-1.c | 26 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-2.c | 24 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-3.c | 16 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-4.c | 19 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-5.c | 33 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-6.c | 18 + gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-7.c | 23 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-1.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c | 14 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-11.c | 21 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-12.c | 27 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-13.c | 26 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-2.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-3.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-4.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-5.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-6.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c | 12 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c | 21 + gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c | 13 + gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-1.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-2.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-3.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/ssa-sink-4.c | 3 +- gcc/testsuite/gcc.dg/tree-ssa/stdarg-1.c | 13 + gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c | 268 + gcc/testsuite/gcc.dg/tree-ssa/stdarg-3.c | 171 + gcc/testsuite/gcc.dg/tree-ssa/stdarg-4.c | 86 + gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c | 112 + gcc/testsuite/gcc.dg/tree-ssa/structopt-1.c | 2 +- gcc/testsuite/gcc.dg/tree-ssa/structopt-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/structopt-3.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailcall-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailcall-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-1.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-2.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-3.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-4.c | 1 + gcc/testsuite/gcc.dg/tree-ssa/tailrecursion-5.c | 2 + gcc/testsuite/gcc.dg/tree-ssa/useless-1.c | 1 + gcc/testsuite/gcc.dg/ucnid-2.c | 1 + gcc/testsuite/gcc.dg/ucnid-3.c | 1 + gcc/testsuite/gcc.dg/ucnid-4.c | 3 +- gcc/testsuite/gcc.dg/ucnid-5.c | 1 + gcc/testsuite/gcc.dg/ucnid-6.c | 3 +- gcc/testsuite/gcc.dg/uninit-5.c | 4 +- gcc/testsuite/gcc.dg/varpool-1.c | 23 + gcc/testsuite/gcc.dg/vect/pr16105.c | 1 + gcc/testsuite/gcc.dg/vect/pr18308.c | 1 + gcc/testsuite/gcc.dg/vect/pr18400.c | 1 + gcc/testsuite/gcc.dg/vect/pr18425.c | 1 + gcc/testsuite/gcc.dg/vect/pr18536.c | 1 + gcc/testsuite/gcc.dg/vect/pr20122.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-1.c | 1 + gcc/testsuite/gcc.dg/vect/vect-10.c | 1 + gcc/testsuite/gcc.dg/vect/vect-100.c | 28 + gcc/testsuite/gcc.dg/vect/vect-11.c | 4 +- gcc/testsuite/gcc.dg/vect/vect-11a.c | 52 + gcc/testsuite/gcc.dg/vect/vect-12.c | 1 + gcc/testsuite/gcc.dg/vect/vect-13.c | 1 + gcc/testsuite/gcc.dg/vect/vect-14.c | 1 + gcc/testsuite/gcc.dg/vect/vect-15.c | 1 + gcc/testsuite/gcc.dg/vect/vect-16.c | 1 + gcc/testsuite/gcc.dg/vect/vect-17.c | 1 + gcc/testsuite/gcc.dg/vect/vect-18.c | 1 + gcc/testsuite/gcc.dg/vect/vect-19.c | 1 + gcc/testsuite/gcc.dg/vect/vect-2.c | 1 + gcc/testsuite/gcc.dg/vect/vect-20.c | 1 + gcc/testsuite/gcc.dg/vect/vect-21.c | 1 + gcc/testsuite/gcc.dg/vect/vect-22.c | 1 + gcc/testsuite/gcc.dg/vect/vect-23.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-24.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-25.c | 1 + gcc/testsuite/gcc.dg/vect/vect-26.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-27.c | 1 + gcc/testsuite/gcc.dg/vect/vect-28.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-29.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-3.c | 4 +- gcc/testsuite/gcc.dg/vect/vect-30.c | 1 + gcc/testsuite/gcc.dg/vect/vect-31.c | 1 + gcc/testsuite/gcc.dg/vect/vect-32.c | 1 + gcc/testsuite/gcc.dg/vect/vect-33.c | 1 + gcc/testsuite/gcc.dg/vect/vect-34.c | 1 + gcc/testsuite/gcc.dg/vect/vect-35.c | 1 + gcc/testsuite/gcc.dg/vect/vect-36.c | 1 + gcc/testsuite/gcc.dg/vect/vect-37.c | 1 + gcc/testsuite/gcc.dg/vect/vect-38.c | 1 + gcc/testsuite/gcc.dg/vect/vect-4.c | 1 + gcc/testsuite/gcc.dg/vect/vect-40.c | 1 + gcc/testsuite/gcc.dg/vect/vect-41.c | 1 + gcc/testsuite/gcc.dg/vect/vect-42.c | 1 + gcc/testsuite/gcc.dg/vect/vect-43.c | 1 + gcc/testsuite/gcc.dg/vect/vect-44.c | 1 + gcc/testsuite/gcc.dg/vect/vect-45.c | 1 + gcc/testsuite/gcc.dg/vect/vect-46.c | 1 + gcc/testsuite/gcc.dg/vect/vect-47.c | 1 + gcc/testsuite/gcc.dg/vect/vect-48.c | 1 + gcc/testsuite/gcc.dg/vect/vect-49.c | 1 + gcc/testsuite/gcc.dg/vect/vect-5.c | 1 + gcc/testsuite/gcc.dg/vect/vect-50.c | 1 + gcc/testsuite/gcc.dg/vect/vect-51.c | 1 + gcc/testsuite/gcc.dg/vect/vect-52.c | 1 + gcc/testsuite/gcc.dg/vect/vect-53.c | 1 + gcc/testsuite/gcc.dg/vect/vect-54.c | 1 + gcc/testsuite/gcc.dg/vect/vect-55.c | 1 + gcc/testsuite/gcc.dg/vect/vect-56.c | 1 + gcc/testsuite/gcc.dg/vect/vect-57.c | 1 + gcc/testsuite/gcc.dg/vect/vect-58.c | 1 + gcc/testsuite/gcc.dg/vect/vect-59.c | 1 + gcc/testsuite/gcc.dg/vect/vect-6.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-60.c | 1 + gcc/testsuite/gcc.dg/vect/vect-61.c | 1 + gcc/testsuite/gcc.dg/vect/vect-62.c | 1 + gcc/testsuite/gcc.dg/vect/vect-63.c | 1 + gcc/testsuite/gcc.dg/vect/vect-64.c | 1 + gcc/testsuite/gcc.dg/vect/vect-65.c | 1 + gcc/testsuite/gcc.dg/vect/vect-66.c | 1 + gcc/testsuite/gcc.dg/vect/vect-67.c | 1 + gcc/testsuite/gcc.dg/vect/vect-68.c | 1 + gcc/testsuite/gcc.dg/vect/vect-69.c | 1 + gcc/testsuite/gcc.dg/vect/vect-7.c | 1 + gcc/testsuite/gcc.dg/vect/vect-70.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-71.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-72.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-73.c | 1 + gcc/testsuite/gcc.dg/vect/vect-74.c | 1 + gcc/testsuite/gcc.dg/vect/vect-75.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-76.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-77.c | 1 + gcc/testsuite/gcc.dg/vect/vect-78.c | 1 + gcc/testsuite/gcc.dg/vect/vect-79.c | 1 + gcc/testsuite/gcc.dg/vect/vect-8.c | 1 + gcc/testsuite/gcc.dg/vect/vect-80.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-82.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-82_64.c | 6 +- gcc/testsuite/gcc.dg/vect/vect-83.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-83_64.c | 6 +- gcc/testsuite/gcc.dg/vect/vect-85.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-86.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-87.c | 5 +- gcc/testsuite/gcc.dg/vect/vect-88.c | 5 +- gcc/testsuite/gcc.dg/vect/vect-89.c | 1 + gcc/testsuite/gcc.dg/vect/vect-9.c | 1 + gcc/testsuite/gcc.dg/vect/vect-92.c | 1 + gcc/testsuite/gcc.dg/vect/vect-93.c | 1 + gcc/testsuite/gcc.dg/vect/vect-96.c | 3 +- gcc/testsuite/gcc.dg/vect/vect-97.c | 1 + gcc/testsuite/gcc.dg/vect/vect-98.c | 1 + gcc/testsuite/gcc.dg/vect/vect-99.c | 19 + gcc/testsuite/gcc.dg/vect/vect-all.c | 1 + gcc/testsuite/gcc.dg/vect/vect-dv-1.c | 22 + gcc/testsuite/gcc.dg/vect/vect-dv-2.c | 73 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-1.c | 74 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c | 12 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c | 31 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c | 31 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c | 31 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c | 31 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c | 31 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c | 31 + gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c | 36 + gcc/testsuite/gcc.dg/vect/vect-none.c | 9 +- gcc/testsuite/gcc.dg/vect/vect-shift-1.c | 28 + gcc/testsuite/gcc.dg/visibility-7.c | 2 +- gcc/testsuite/gcc.dg/vmx/varargs-1.c | 3 + gcc/testsuite/gcc.dg/void-cast-1.c | 11 + gcc/testsuite/gcc.dg/void-cast-2.c | 8 + gcc/testsuite/gcc.dg/vr-mult-1.c | 10 - gcc/testsuite/gcc.dg/vr-mult-2.c | 10 - gcc/testsuite/gcc.dg/weak/weak-12.c | 17 + gcc/testsuite/gcc.dg/weak/weak-13.c | 13 + gcc/testsuite/gcc.dg/winline-6.c | 2 +- gcc/testsuite/gcc.misc-tests/bprob.exp | 2 +- gcc/testsuite/gcc.misc-tests/options.exp | 10 +- .../gcc.target/cris/torture/cris-torture.exp | 41 + .../gcc.target/cris/torture/no-pro-epi-1.c | 4 + gcc/testsuite/gcc.target/i386/asm-1.c | 9 + gcc/testsuite/gcc.target/i386/pr21101.c | 32 + gcc/testsuite/gcc.target/i386/sse-2.c | 16 + gcc/testsuite/gcc.target/ia64/small-addr-1.c | 23 + gcc/testsuite/gcc.target/mips/args-1.c | 35 + gcc/testsuite/gcc.target/mips/args-2.c | 18 + gcc/testsuite/gcc.target/mips/args-3.c | 38 + gcc/testsuite/gcc.target/mips/asm-1.c | 2 +- gcc/testsuite/gcc.target/mips/branch-1.c | 11 + gcc/testsuite/gcc.target/mips/fix-vr4130-1.c | 9 +- gcc/testsuite/gcc.target/mips/fix-vr4130-2.c | 9 +- gcc/testsuite/gcc.target/mips/fix-vr4130-3.c | 9 +- gcc/testsuite/gcc.target/mips/fix-vr4130-4.c | 9 +- gcc/testsuite/gcc.target/mips/fpcmp-1.c | 6 + gcc/testsuite/gcc.target/mips/fpcmp-2.c | 6 + gcc/testsuite/gcc.target/mips/mips-3d-1.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-2.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-3.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-4.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-5.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-6.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-7.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-8.c | 2 +- gcc/testsuite/gcc.target/mips/mips-3d-9.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-1.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-2.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-3.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-4.c | 2 +- gcc/testsuite/gcc.target/mips/mips-ps-type.c | 4 +- gcc/testsuite/gcc.target/mips/mips.exp | 157 +- gcc/testsuite/gcc.target/mips/movcc-1.c | 18 + gcc/testsuite/gcc.target/mips/movcc-2.c | 18 + gcc/testsuite/gcc.target/mips/movcc-3.c | 63 + gcc/testsuite/gcc.target/mips/nmadd-1.c | 30 + gcc/testsuite/gcc.target/mips/nmadd-2.c | 30 + gcc/testsuite/gcc.target/mips/rsqrt-1.c | 17 + gcc/testsuite/gcc.target/mips/rsqrt-2.c | 17 + gcc/testsuite/gcc.target/mips/rsqrt-3.c | 27 + gcc/testsuite/gcc.target/mips/sb1-1.c | 4 +- gcc/testsuite/gcc.target/mips/vr-mult-1.c | 7 + gcc/testsuite/gcc.target/mips/vr-mult-2.c | 7 + gcc/testsuite/gfortran.dg/PR19872.f | 20 + gcc/testsuite/gfortran.dg/append-1.f90 | 36 + gcc/testsuite/gfortran.dg/array_constructor_1.f90 | 17 + gcc/testsuite/gfortran.dg/array_constructor_2.f90 | 8 + gcc/testsuite/gfortran.dg/assign_4.f | 11 + gcc/testsuite/gfortran.dg/backspace.f | 82 + .../gfortran.dg/comma_format_extension_1.f | 11 + .../gfortran.dg/comma_format_extension_2.f | 10 + .../gfortran.dg/comma_format_extension_3.f | 16 + .../gfortran.dg/comma_format_extension_4.f | 10 + gcc/testsuite/gfortran.dg/common_5.f | 10 + gcc/testsuite/gfortran.dg/dev_null.f90 | 11 + gcc/testsuite/gfortran.dg/dos_eol.f | 19 + gcc/testsuite/gfortran.dg/entry_3.f90 | 25 + gcc/testsuite/gfortran.dg/entry_4.f90 | 28 + gcc/testsuite/gfortran.dg/eor_1.f90 | 2 +- gcc/testsuite/gfortran.dg/eor_handling_1.f90 | 14 + gcc/testsuite/gfortran.dg/eor_handling_2.f90 | 13 + gcc/testsuite/gfortran.dg/eor_handling_3.f90 | 13 + gcc/testsuite/gfortran.dg/eor_handling_4.f90 | 17 + gcc/testsuite/gfortran.dg/eor_handling_5.f90 | 19 + gcc/testsuite/gfortran.dg/eoshift.f90 | 6 + gcc/testsuite/gfortran.dg/f2c_1.f90 | 73 + gcc/testsuite/gfortran.dg/f2c_2.f90 | 23 + gcc/testsuite/gfortran.dg/f2c_3.f90 | 18 + gcc/testsuite/gfortran.dg/fold_nearest.f90 | 27 + gcc/testsuite/gfortran.dg/func_result_2.f90 | 10 + gcc/testsuite/gfortran.dg/g77/12002.f | 2 +- gcc/testsuite/gfortran.dg/g77/20030326-1.f | 23 +- gcc/testsuite/gfortran.dg/g77_intrinsics_funcs.f | 51 + gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f | 82 + gcc/testsuite/gfortran.dg/hollerith_1.f90 | 11 + gcc/testsuite/gfortran.dg/ichar_1.f90 | 50 + gcc/testsuite/gfortran.dg/implicit_4.f90 | 21 + gcc/testsuite/gfortran.dg/in_pack_rank7.f90 | 12 + gcc/testsuite/gfortran.dg/matmul_1.f90 | 53 + gcc/testsuite/gfortran.dg/namelist_1.f90 | 3 +- gcc/testsuite/gfortran.dg/namelist_11.f | 55 + gcc/testsuite/gfortran.dg/namelist_12.f | 56 + gcc/testsuite/gfortran.dg/namelist_13.f90 | 38 + gcc/testsuite/gfortran.dg/namelist_14.f90 | 94 + gcc/testsuite/gfortran.dg/namelist_15.f90 | 58 + gcc/testsuite/gfortran.dg/namelist_16.f90 | 29 + gcc/testsuite/gfortran.dg/namelist_17.f90 | 30 + gcc/testsuite/gfortran.dg/namelist_18.f90 | 37 + gcc/testsuite/gfortran.dg/namelist_19.f90 | 135 + gcc/testsuite/gfortran.dg/namelist_2.f90 | 7 + gcc/testsuite/gfortran.dg/namelist_20.f90 | 35 + gcc/testsuite/gfortran.dg/namelist_3.f90 | 7 + gcc/testsuite/gfortran.dg/negative_unit.f | 22 + gcc/testsuite/gfortran.dg/nested_reshape.f90 | 12 + gcc/testsuite/gfortran.dg/nesting_1.f90 | 18 + gcc/testsuite/gfortran.dg/nint_1.f90 | 15 + gcc/testsuite/gfortran.dg/noadv_size.f90 | 11 + gcc/testsuite/gfortran.dg/open-options-blanks.f | 7 + gcc/testsuite/gfortran.dg/open_new.f90 | 2 +- gcc/testsuite/gfortran.dg/pad_no.f90 | 15 + gcc/testsuite/gfortran.dg/pr12884.f | 25 + gcc/testsuite/gfortran.dg/pr15332.f | 12 + gcc/testsuite/gfortran.dg/pr15754.f90 | 4 +- gcc/testsuite/gfortran.dg/pr15959.f90 | 5 + gcc/testsuite/gfortran.dg/pr16861.f90 | 32 + gcc/testsuite/gfortran.dg/pr17229.f | 23 + gcc/testsuite/gfortran.dg/pr17285.f90 | 25 + gcc/testsuite/gfortran.dg/pr17472.f | 12 + gcc/testsuite/gfortran.dg/pr18025.f90 | 8 + gcc/testsuite/gfortran.dg/pr18122.f90 | 45 + gcc/testsuite/gfortran.dg/pr18210.f90 | 21 + gcc/testsuite/gfortran.dg/pr18392.f90 | 22 + gcc/testsuite/gfortran.dg/pr19155.f | 15 + gcc/testsuite/gfortran.dg/pr19216.f | 18 + gcc/testsuite/gfortran.dg/pr19467.f90 | 18 + gcc/testsuite/gfortran.dg/pr19657.f | 21 + gcc/testsuite/gfortran.dg/pr20163-2.f | 5 + gcc/testsuite/gfortran.dg/pr20755.f | 10 + gcc/testsuite/gfortran.dg/pr20865.f90 | 10 + gcc/testsuite/gfortran.dg/pr20950.f | 7 + gcc/testsuite/gfortran.dg/pr20954.f | 11 + gcc/testsuite/gfortran.dg/pr21177.f90 | 53 + gcc/testsuite/gfortran.dg/promotion.f90 | 12 + gcc/testsuite/gfortran.dg/reshape-alloc.f90 | 32 + gcc/testsuite/gfortran.dg/reshape-complex.f90 | 11 + gcc/testsuite/gfortran.dg/reshape.f90 | 33 + gcc/testsuite/gfortran.dg/reshape_rank7.f90 | 27 + gcc/testsuite/gfortran.dg/return_1.f90 | 6 + gcc/testsuite/gfortran.dg/string_pad_trunc.f90 | 20 + gcc/testsuite/gfortran.dg/tiny_1.f90 | 9 + gcc/testsuite/gfortran.dg/tiny_2.f90 | 9 + gcc/testsuite/gfortran.dg/underflow.f90 | 5 + gcc/testsuite/gfortran.dg/vect/vect-1.f90 | 11 + gcc/testsuite/gfortran.dg/vect/vect-2.f90 | 14 + gcc/testsuite/gfortran.dg/vect/vect-3.f90 | 13 + gcc/testsuite/gfortran.dg/vect/vect-4.f90 | 14 + gcc/testsuite/gfortran.dg/vect/vect-5.f90 | 50 + gcc/testsuite/gfortran.dg/vect/vect.exp | 99 + gcc/testsuite/gfortran.dg/wtruncate.f | 10 + gcc/testsuite/gfortran.dg/wtruncate.f90 | 10 + .../gfortran.fortran-torture/execute/backspace.f90 | 2 +- .../gfortran.fortran-torture/execute/entry_1.f90 | 74 + .../gfortran.fortran-torture/execute/entry_2.f90 | 51 + .../gfortran.fortran-torture/execute/entry_3.f90 | 40 + .../gfortran.fortran-torture/execute/entry_4.f90 | 64 + .../gfortran.fortran-torture/execute/entry_5.f90 | 51 + .../gfortran.fortran-torture/execute/entry_6.f90 | 109 + .../gfortran.fortran-torture/execute/entry_7.f90 | 106 + .../gfortran.fortran-torture/execute/entry_8.f90 | 24 + .../gfortran.fortran-torture/execute/forall_3.f90 | 3 +- .../execute/intrinsic_anyall.f90 | 15 + .../execute/intrinsic_count.f90 | 13 + .../execute/intrinsic_mmloc.f90 | 67 +- .../execute/intrinsic_mmval.f90 | 19 +- .../execute/intrinsic_product.f90 | 24 +- .../execute/intrinsic_spread.f90 | 7 + .../execute/intrinsic_sum.f90 | 23 +- .../gfortran.fortran-torture/execute/where_7.f90 | 53 + .../gfortran.fortran-torture/execute/where_8.f90 | 28 + gcc/testsuite/lib/compat.exp | 14 +- gcc/testsuite/lib/file-format.exp | 1 + gcc/testsuite/lib/fortran-torture.exp | 2 +- gcc/testsuite/lib/g++.exp | 22 +- gcc/testsuite/lib/gcc-defs.exp | 32 + gcc/testsuite/lib/gcc-dg.exp | 121 +- gcc/testsuite/lib/gcc.exp | 1 + gcc/testsuite/lib/gfortran.exp | 18 +- gcc/testsuite/lib/objc.exp | 16 +- gcc/testsuite/lib/profopt.exp | 28 +- gcc/testsuite/lib/scantree.exp | 15 +- gcc/testsuite/lib/target-supports-dg.exp | 20 +- gcc/testsuite/lib/target-supports.exp | 269 +- gcc/testsuite/lib/treelang.exp | 18 +- gcc/testsuite/lib/wrapper.exp | 2 - gcc/testsuite/objc.dg/fix-and-continue-1.m | 90 + gcc/testsuite/objc.dg/method-5.m | 4 +- gcc/testsuite/objc.dg/method-6.m | 11 +- gcc/testsuite/objc.dg/method-7.m | 12 +- gcc/testsuite/objc.dg/method-9.m | 14 +- gcc/testsuite/objc.dg/objc-fast-4.m | 10 + gcc/testsuite/objc.dg/try-catch-2.m | 4 +- gcc/testsuite/treelang/ChangeLog | 4 + gcc/testsuite/treelang/compile/extrafunc.tree | 1 + gcc/testsuite/treelang/compile/extravar.tree | 1 + gcc/testsuite/treelang/compile/memory.tree | 18 + gcc/testsuite/treelang/compile/unsigned.tree | 1 + gcc/timevar.c | 24 +- gcc/timevar.def | 19 +- gcc/timevar.h | 5 + gcc/tlink.c | 39 +- gcc/toplev.c | 58 +- gcc/toplev.h | 3 +- gcc/tree-cfg.c | 771 +- gcc/tree-chrec.c | 80 +- gcc/tree-chrec.h | 6 +- gcc/tree-complex.c | 174 +- gcc/tree-data-ref.c | 124 +- gcc/tree-data-ref.h | 10 +- gcc/tree-dfa.c | 404 +- gcc/tree-dump.c | 10 +- gcc/tree-eh.c | 393 +- gcc/tree-flow-inline.h | 955 +- gcc/tree-flow.h | 235 +- gcc/tree-gimple.c | 3 +- gcc/tree-if-conv.c | 159 +- gcc/tree-inline.c | 1256 +- gcc/tree-inline.h | 7 +- gcc/tree-into-ssa.c | 2489 +- gcc/tree-loop-linear.c | 18 +- gcc/tree-mudflap.c | 53 +- gcc/tree-optimize.c | 273 +- gcc/tree-outof-ssa.c | 257 +- gcc/tree-pass.h | 74 +- gcc/tree-phinodes.c | 105 +- gcc/tree-pretty-print.c | 22 +- gcc/tree-profile.c | 188 +- gcc/tree-scalar-evolution.c | 192 +- gcc/tree-scalar-evolution.h | 5 +- gcc/tree-sra.c | 92 +- gcc/tree-ssa-alias.c | 465 +- gcc/tree-ssa-ccp.c | 1414 +- gcc/tree-ssa-copy.c | 847 +- gcc/tree-ssa-dce.c | 67 +- gcc/tree-ssa-dom.c | 580 +- gcc/tree-ssa-dse.c | 231 +- gcc/tree-ssa-forwprop.c | 1293 +- gcc/tree-ssa-live.c | 72 +- gcc/tree-ssa-live.h | 4 +- gcc/tree-ssa-loop-ch.c | 19 +- gcc/tree-ssa-loop-im.c | 670 +- gcc/tree-ssa-loop-ivcanon.c | 103 +- gcc/tree-ssa-loop-ivopts.c | 1286 +- gcc/tree-ssa-loop-manip.c | 365 +- gcc/tree-ssa-loop-niter.c | 515 +- gcc/tree-ssa-loop-unswitch.c | 24 +- gcc/tree-ssa-loop.c | 68 +- gcc/tree-ssa-math-opts.c | 164 + gcc/tree-ssa-operands.c | 1660 +- gcc/tree-ssa-operands.h | 324 +- gcc/tree-ssa-opfinalize.h | 175 + gcc/tree-ssa-phiopt.c | 144 +- gcc/tree-ssa-pre.c | 664 +- gcc/tree-ssa-propagate.c | 449 +- gcc/tree-ssa-propagate.h | 34 +- gcc/tree-ssa-sink.c | 129 +- gcc/tree-ssa-threadupdate.c | 9 +- gcc/tree-ssa-uncprop.c | 621 + gcc/tree-ssa.c | 498 +- gcc/tree-ssanames.c | 141 +- gcc/tree-stdarg.c | 863 + gcc/tree-stdarg.h | 37 + gcc/tree-tailcall.c | 30 +- gcc/tree-vect-analyze.c | 231 +- gcc/tree-vect-transform.c | 357 +- gcc/tree-vectorizer.c | 631 +- gcc/tree-vectorizer.h | 20 +- gcc/tree-vn.c | 90 +- gcc/tree-vrp.c | 2422 + gcc/tree.c | 174 +- gcc/tree.def | 17 +- gcc/tree.h | 125 +- gcc/treelang/ChangeLog | 47 + gcc/treelang/lang-specs.h | 29 +- gcc/treelang/lang.opt | 2 +- gcc/treelang/parse.y | 3 +- gcc/treelang/tree-convert.c | 2 +- gcc/treelang/treelang.h | 2 +- gcc/treelang/treelang.texi | 12 +- gcc/treelang/treetree.c | 58 +- gcc/tsystem.h | 15 +- gcc/typeclass.h | 4 +- gcc/unwind-compat.c | 2 + gcc/unwind-dw2-fde-compat.c | 2 + gcc/unwind-dw2-fde-darwin.c | 1 + gcc/unwind-dw2-fde-glibc.c | 7 +- gcc/unwind-dw2-fde.c | 18 +- gcc/unwind-dw2.c | 85 +- gcc/unwind-pe.h | 15 +- gcc/unwind.h | 3 +- gcc/unwind.inc | 13 +- gcc/value-prof.c | 929 +- gcc/value-prof.h | 40 +- gcc/varasm.c | 499 +- gcc/vec.c | 111 +- gcc/vec.h | 769 +- gcc/vmsdbgout.c | 4 +- gnattools/Makefile.in | 2 +- include/COPYING | 4 +- include/ChangeLog | 98 + include/ChangeLog-9103 | 633 +- include/ansidecl.h | 2 +- include/demangle.h | 74 +- include/dyn-string.h | 43 +- include/fibheap.h | 32 +- include/filenames.h | 2 +- include/floatformat.h | 11 +- include/fnmatch.h | 4 +- include/getopt.h | 2 +- include/hashtab.h | 95 +- include/libiberty.h | 300 +- include/md5.h | 27 +- include/objalloc.h | 16 +- include/obstack.h | 74 +- include/partition.h | 15 +- include/safe-ctype.h | 4 +- include/sort.h | 6 +- include/splay-tree.h | 75 +- include/symcat.h | 2 +- include/ternary.h | 10 +- include/xregex2.h | 80 +- include/xtensa-config.h | 2 +- intl/ChangeLog | 13 + intl/Makefile.in | 2 +- intl/bindtextdom.c | 2 +- intl/dcgettext.c | 2 +- intl/dcigettext.c | 2 +- intl/dcngettext.c | 2 +- intl/dgettext.c | 2 +- intl/dngettext.c | 2 +- intl/eval-plural.h | 2 +- intl/explodename.c | 2 +- intl/finddomain.c | 2 +- intl/gettext.c | 2 +- intl/gettextP.h | 2 +- intl/gmo.h | 2 +- intl/hash-string.h | 2 +- intl/intl-compat.c | 2 +- intl/l10nflist.c | 2 +- intl/libgnuintl.h | 2 +- intl/loadinfo.h | 2 +- intl/loadmsgcat.c | 2 +- intl/localcharset.c | 2 +- intl/localcharset.h | 2 +- intl/locale.alias | 2 +- intl/localealias.c | 2 +- intl/localename.c | 2 +- intl/log.c | 2 +- intl/ngettext.c | 2 +- intl/osdep.c | 2 +- intl/plural-exp.c | 2 +- intl/plural-exp.h | 2 +- intl/plural.c | 6 +- intl/plural.y | 2 +- intl/relocatable.c | 2 +- intl/relocatable.h | 2 +- intl/textdomain.c | 2 +- libada/ChangeLog | 4 + libada/Makefile.in | 3 + libcpp/ChangeLog | 60 +- libcpp/config.in | 77 + libcpp/configure | 885 +- libcpp/configure.ac | 13 +- libcpp/directives.c | 14 +- libcpp/files.c | 1 + libcpp/lex.c | 6 +- libcpp/line-map.c | 6 +- libcpp/macro.c | 35 +- libcpp/po/ChangeLog | 17 + libcpp/po/be.po | 82 +- libcpp/po/ca.po | 80 +- libcpp/po/da.po | 80 +- libcpp/po/de.po | 113 +- libcpp/po/el.po | 79 +- libcpp/po/es.po | 84 +- libcpp/po/fr.po | 80 +- libcpp/po/ja.po | 80 +- libcpp/po/nl.po | 8314 +-- libcpp/po/rw.po | 18006 +++++++ libcpp/po/sv.po | 82 +- libcpp/po/tr.po | 80 +- libcpp/po/vi.po | 90 +- libcpp/system.h | 75 +- libffi/ChangeLog | 99 +- libffi/Makefile.am | 6 +- libffi/Makefile.in | 79 +- libffi/aclocal.m4 | 2 - libffi/configure | 1265 +- libffi/configure.ac | 19 +- libffi/fficonfig.h.in | 14 +- libffi/include/Makefile.am | 5 +- libffi/include/Makefile.in | 17 +- libffi/src/alpha/osf.S | 94 +- libffi/src/cris/ffi.c | 381 + libffi/src/cris/ffitarget.h | 50 + libffi/src/cris/sysv.S | 215 + libffi/src/ia64/ffitarget.h | 4 +- libffi/src/ia64/unix.S | 51 +- libffi/src/powerpc/darwin.S | 22 +- libffi/src/powerpc/darwin_closure.S | 41 +- libffi/src/prep_cif.c | 6 + libffi/src/x86/ffi64.c | 23 +- libffi/src/x86/unix64.S | 123 +- libffi/testsuite/Makefile.in | 12 +- libffi/testsuite/lib/libffi-dg.exp | 18 +- libgfortran/AUTHORS | 2 - libgfortran/COPYING | 504 - libgfortran/ChangeLog | 757 +- libgfortran/INSTALL | 1 - libgfortran/Makefile.am | 31 +- libgfortran/Makefile.in | 135 +- libgfortran/NEWS | 1 - libgfortran/README | 14 - libgfortran/aclocal.m4 | 2 - libgfortran/config.h.in | 39 + libgfortran/configure | 657 +- libgfortran/configure.ac | 28 +- libgfortran/generated/all_l4.c | 25 +- libgfortran/generated/all_l8.c | 25 +- libgfortran/generated/any_l4.c | 25 +- libgfortran/generated/any_l8.c | 25 +- libgfortran/generated/count_4_l4.c | 25 +- libgfortran/generated/count_4_l8.c | 25 +- libgfortran/generated/count_8_l4.c | 25 +- libgfortran/generated/count_8_l8.c | 25 +- libgfortran/generated/cshift1_4.c | 10 +- libgfortran/generated/cshift1_8.c | 10 +- libgfortran/generated/eoshift1_4.c | 18 +- libgfortran/generated/eoshift1_8.c | 18 +- libgfortran/generated/eoshift3_4.c | 20 +- libgfortran/generated/eoshift3_8.c | 20 +- libgfortran/generated/in_pack_i4.c | 6 +- libgfortran/generated/in_pack_i8.c | 6 +- libgfortran/generated/in_unpack_i4.c | 6 +- libgfortran/generated/in_unpack_i8.c | 6 +- libgfortran/generated/matmul_c4.c | 16 +- libgfortran/generated/matmul_c8.c | 16 +- libgfortran/generated/matmul_i4.c | 16 +- libgfortran/generated/matmul_i8.c | 16 +- libgfortran/generated/matmul_l4.c | 10 +- libgfortran/generated/matmul_l8.c | 10 +- libgfortran/generated/matmul_r4.c | 16 +- libgfortran/generated/matmul_r8.c | 16 +- libgfortran/generated/maxloc0_4_i4.c | 67 +- libgfortran/generated/maxloc0_4_i8.c | 67 +- libgfortran/generated/maxloc0_4_r4.c | 67 +- libgfortran/generated/maxloc0_4_r8.c | 67 +- libgfortran/generated/maxloc0_8_i4.c | 67 +- libgfortran/generated/maxloc0_8_i8.c | 67 +- libgfortran/generated/maxloc0_8_r4.c | 67 +- libgfortran/generated/maxloc0_8_r8.c | 67 +- libgfortran/generated/maxloc1_4_i4.c | 72 +- libgfortran/generated/maxloc1_4_i8.c | 72 +- libgfortran/generated/maxloc1_4_r4.c | 72 +- libgfortran/generated/maxloc1_4_r8.c | 72 +- libgfortran/generated/maxloc1_8_i4.c | 72 +- libgfortran/generated/maxloc1_8_i8.c | 72 +- libgfortran/generated/maxloc1_8_r4.c | 72 +- libgfortran/generated/maxloc1_8_r8.c | 72 +- libgfortran/generated/maxval_i4.c | 72 +- libgfortran/generated/maxval_i8.c | 72 +- libgfortran/generated/maxval_r4.c | 72 +- libgfortran/generated/maxval_r8.c | 72 +- libgfortran/generated/minloc0_4_i4.c | 67 +- libgfortran/generated/minloc0_4_i8.c | 67 +- libgfortran/generated/minloc0_4_r4.c | 67 +- libgfortran/generated/minloc0_4_r8.c | 67 +- libgfortran/generated/minloc0_8_i4.c | 67 +- libgfortran/generated/minloc0_8_i8.c | 67 +- libgfortran/generated/minloc0_8_r4.c | 67 +- libgfortran/generated/minloc0_8_r8.c | 67 +- libgfortran/generated/minloc1_4_i4.c | 72 +- libgfortran/generated/minloc1_4_i8.c | 72 +- libgfortran/generated/minloc1_4_r4.c | 72 +- libgfortran/generated/minloc1_4_r8.c | 72 +- libgfortran/generated/minloc1_8_i4.c | 72 +- libgfortran/generated/minloc1_8_i8.c | 72 +- libgfortran/generated/minloc1_8_r4.c | 72 +- libgfortran/generated/minloc1_8_r8.c | 72 +- libgfortran/generated/minval_i4.c | 72 +- libgfortran/generated/minval_i8.c | 72 +- libgfortran/generated/minval_r4.c | 72 +- libgfortran/generated/minval_r8.c | 72 +- libgfortran/generated/product_c4.c | 72 +- libgfortran/generated/product_c8.c | 72 +- libgfortran/generated/product_i4.c | 72 +- libgfortran/generated/product_i8.c | 72 +- libgfortran/generated/product_r4.c | 72 +- libgfortran/generated/product_r8.c | 72 +- libgfortran/generated/reshape_c4.c | 258 + libgfortran/generated/reshape_c8.c | 258 + libgfortran/generated/reshape_i4.c | 50 +- libgfortran/generated/reshape_i8.c | 50 +- libgfortran/generated/sum_c4.c | 72 +- libgfortran/generated/sum_c8.c | 72 +- libgfortran/generated/sum_i4.c | 72 +- libgfortran/generated/sum_i8.c | 72 +- libgfortran/generated/sum_r4.c | 72 +- libgfortran/generated/sum_r8.c | 72 +- libgfortran/generated/transpose_c4.c | 2 +- libgfortran/generated/transpose_c8.c | 2 +- libgfortran/generated/transpose_i4.c | 2 +- libgfortran/generated/transpose_i8.c | 2 +- libgfortran/intrinsics/chdir.c | 121 + libgfortran/intrinsics/cshift0.c | 8 +- libgfortran/intrinsics/eoshift0.c | 17 +- libgfortran/intrinsics/eoshift2.c | 19 +- libgfortran/intrinsics/etime.c | 5 +- libgfortran/intrinsics/f2c_specifics.F90 | 169 + libgfortran/intrinsics/gerror.c | 67 + libgfortran/intrinsics/getcwd.c | 6 +- libgfortran/intrinsics/getlog.c | 68 + libgfortran/intrinsics/hostnm.c | 110 + libgfortran/intrinsics/ierrno.c | 57 + libgfortran/intrinsics/kill.c | 107 + libgfortran/intrinsics/link.c | 141 + libgfortran/intrinsics/pack_generic.c | 35 +- libgfortran/intrinsics/perror.c | 67 + libgfortran/intrinsics/random.c | 30 +- libgfortran/intrinsics/rename.c | 134 + libgfortran/intrinsics/reshape_generic.c | 57 +- libgfortran/intrinsics/sleep.c | 68 + libgfortran/intrinsics/spread_generic.c | 110 +- libgfortran/intrinsics/stat.c | 42 +- libgfortran/intrinsics/symlnk.c | 141 + libgfortran/intrinsics/system_clock.c | 36 +- libgfortran/intrinsics/time.c | 72 + libgfortran/intrinsics/unlink.c | 8 +- libgfortran/io/backspace.c | 24 +- libgfortran/io/close.c | 4 +- libgfortran/io/format.c | 13 +- libgfortran/io/inquire.c | 24 +- libgfortran/io/io.h | 85 +- libgfortran/io/list_read.c | 1062 +- libgfortran/io/lock.c | 30 +- libgfortran/io/open.c | 30 +- libgfortran/io/read.c | 6 +- libgfortran/io/rewind.c | 10 +- libgfortran/io/transfer.c | 206 +- libgfortran/io/unit.c | 14 +- libgfortran/io/unix.c | 45 +- libgfortran/io/write.c | 399 +- libgfortran/libgfortran.h | 2 +- libgfortran/m4/cshift1.m4 | 10 +- libgfortran/m4/eoshift1.m4 | 18 +- libgfortran/m4/eoshift3.m4 | 20 +- libgfortran/m4/iforeach.m4 | 67 +- libgfortran/m4/ifunction.m4 | 72 +- libgfortran/m4/in_pack.m4 | 6 +- libgfortran/m4/in_unpack.m4 | 6 +- libgfortran/m4/iparm.m4 | 1 + libgfortran/m4/matmul.m4 | 16 +- libgfortran/m4/matmull.m4 | 6 +- libgfortran/m4/reshape.m4 | 56 +- libgfortran/m4/transpose.m4 | 2 +- libgfortran/runtime/environ.c | 90 +- libgfortran/runtime/main.c | 4 +- libgfortran/runtime/memory.c | 2 +- libgfortran/runtime/normalize.c | 6 +- libgfortran/runtime/string.c | 17 +- libiberty/COPYING.LIB | 4 +- libiberty/ChangeLog | 456 +- libiberty/Makefile.in | 90 +- libiberty/_doprnt.c | 17 +- libiberty/aclocal.m4 | 10 - libiberty/alloca.c | 5 +- libiberty/argv.c | 37 +- libiberty/asprintf.c | 13 +- libiberty/atexit.c | 3 +- libiberty/basename.c | 6 +- libiberty/bcmp.c | 19 +- libiberty/bcopy.c | 20 +- libiberty/bsearch.c | 17 +- libiberty/bzero.c | 12 +- libiberty/calloc.c | 11 +- libiberty/choose-temp.c | 8 +- libiberty/clock.c | 4 +- libiberty/concat.c | 32 +- libiberty/config.in | 38 +- libiberty/configure | 848 +- libiberty/configure.ac | 27 +- libiberty/copying-lib.texi | 4 +- libiberty/copysign.c | 6 +- libiberty/cp-demangle.c | 490 +- libiberty/cp-demangle.h | 8 +- libiberty/cp-demint.c | 27 +- libiberty/cplus-dem.c | 493 +- libiberty/dyn-string.c | 78 +- libiberty/fdmatch.c | 11 +- libiberty/ffs.c | 3 +- libiberty/fibheap.c | 125 +- libiberty/floatformat.c | 76 +- libiberty/fnmatch.c | 9 +- libiberty/fopen_unlocked.c | 126 + libiberty/functions.texi | 360 +- libiberty/gather-docs | 4 +- libiberty/getcwd.c | 4 +- libiberty/getopt.c | 33 +- libiberty/getopt1.c | 28 +- libiberty/getpagesize.c | 4 +- libiberty/getpwd.c | 10 +- libiberty/getruntime.c | 6 +- libiberty/gettimeofday.c | 6 +- libiberty/hashtab.c | 152 +- libiberty/hex.c | 9 +- libiberty/index.c | 6 +- libiberty/insque.c | 7 +- libiberty/lbasename.c | 10 +- libiberty/lrealpath.c | 7 +- libiberty/maint-tool | 4 +- libiberty/make-relative-prefix.c | 27 +- libiberty/make-temp-file.c | 16 +- libiberty/md5.c | 32 +- libiberty/memchr.c | 9 +- libiberty/memcmp.c | 9 +- libiberty/memcpy.c | 7 +- libiberty/memmove.c | 7 +- libiberty/mempcpy.c | 17 +- libiberty/memset.c | 9 +- libiberty/mkstemps.c | 8 +- libiberty/objalloc.c | 21 +- libiberty/obstack.c | 137 +- libiberty/partition.c | 25 +- libiberty/pex-common.c | 472 + libiberty/pex-common.h | 88 +- libiberty/pex-djgpp.c | 291 +- libiberty/pex-msdos.c | 463 +- libiberty/pex-one.c | 43 + libiberty/pex-unix.c | 728 +- libiberty/pex-win32.c | 399 +- libiberty/pexecute.c | 121 + libiberty/pexecute.txh | 262 +- libiberty/physmem.c | 10 +- libiberty/putenv.c | 7 +- libiberty/random.c | 15 +- libiberty/regex.c | 485 +- libiberty/rename.c | 4 +- libiberty/rindex.c | 6 +- libiberty/safe-ctype.c | 7 +- libiberty/setenv.c | 12 +- libiberty/sigsetmask.c | 5 +- libiberty/snprintf.c | 11 +- libiberty/sort.c | 12 +- libiberty/spaces.c | 14 +- libiberty/splay-tree.c | 117 +- libiberty/stpcpy.c | 16 +- libiberty/stpncpy.c | 17 +- libiberty/strcasecmp.c | 7 +- libiberty/strchr.c | 4 +- libiberty/strdup.c | 13 +- libiberty/strerror.c | 17 +- libiberty/strncasecmp.c | 8 +- libiberty/strncmp.c | 8 +- libiberty/strndup.c | 55 + libiberty/strrchr.c | 4 +- libiberty/strsignal.c | 27 +- libiberty/strstr.c | 22 +- libiberty/strtod.c | 8 +- libiberty/strtol.c | 7 +- libiberty/strtoul.c | 5 +- libiberty/ternary.c | 19 +- libiberty/testsuite/Makefile.in | 11 + libiberty/testsuite/test-pexecute.c | 522 + libiberty/tmpnam.c | 5 +- libiberty/unlink-if-ordinary.c | 9 +- libiberty/vasprintf.c | 29 +- libiberty/vfork.c | 4 +- libiberty/vfprintf.c | 9 +- libiberty/vprintf.c | 8 +- libiberty/vsnprintf.c | 20 +- libiberty/vsprintf.c | 11 +- libiberty/waitpid.c | 5 +- libiberty/xatexit.c | 20 +- libiberty/xexit.c | 9 +- libiberty/xmalloc.c | 33 +- libiberty/xmemdup.c | 12 +- libiberty/xstrdup.c | 10 +- libiberty/xstrerror.c | 11 +- libiberty/xstrndup.c | 60 + libjava/ChangeLog | 28487 +++------- libjava/ChangeLog-1998 | 3601 ++ libjava/ChangeLog-1999 | 3601 -- libjava/ChangeLog-2000 | 5077 ++ libjava/ChangeLog-2001 | 5078 +- libjava/ChangeLog-2002 | 4 +- libjava/ChangeLog-2003 | 16 +- libjava/ChangeLog-2004 | 15948 ++++++ libjava/Makefile.am | 654 +- libjava/Makefile.in | 33729 +++--------- libjava/aclocal.m4 | 464 +- libjava/boehm.cc | 9 +- libjava/configure | 690 +- libjava/configure.ac | 52 +- libjava/configure.host | 1 + libjava/exception.cc | 14 +- libjava/external/Makefile.am | 3 + libjava/external/Makefile.in | 43 +- libjava/external/sax/Makefile.am | 21 +- libjava/external/sax/Makefile.in | 324 +- .../sax/org/xml/sax/helpers/NamespaceSupport.java | 5 +- libjava/external/w3c_dom/Makefile.am | 21 +- libjava/external/w3c_dom/Makefile.in | 2498 +- libjava/gcj/Makefile.am | 6 +- libjava/gcj/Makefile.in | 26 +- libjava/gcj/cni.h | 6 + libjava/gcj/javaprims.h | 16 +- libjava/gij.cc | 313 +- libjava/gnu/classpath/SystemProperties.java | 154 + libjava/gnu/classpath/natSystemProperties.cc | 390 + libjava/gnu/gcj/runtime/BootClassLoader.java | 71 + libjava/gnu/gcj/runtime/ExtensionClassLoader.java | 40 + libjava/gnu/gcj/runtime/HelperClassLoader.java | 67 + libjava/gnu/gcj/runtime/NameFinder.java | 10 +- libjava/gnu/gcj/runtime/PersistentByteMap.java | 2 +- libjava/gnu/gcj/runtime/SystemClassLoader.java | 33 +- libjava/gnu/gcj/runtime/VMClassLoader.java | 135 - libjava/gnu/gcj/runtime/natVMClassLoader.cc | 79 - libjava/gnu/gcj/tools/gcj_dbtool/Main.java | 185 +- libjava/gnu/gcj/tools/gcj_dbtool/natMain.cc | 24 + libjava/gnu/java/awt/Buffers.java | 12 +- libjava/gnu/java/awt/ComponentDataBlitOp.java | 2 +- libjava/gnu/java/awt/EmbeddedWindowSupport.java | 2 +- libjava/gnu/java/awt/color/CieXyzConverter.java | 147 +- .../gnu/java/awt/color/ClutProfileConverter.java | 67 +- libjava/gnu/java/awt/color/ColorLookUpTable.java | 67 +- .../gnu/java/awt/color/ColorSpaceConverter.java | 139 +- .../gnu/java/awt/color/GrayProfileConverter.java | 71 +- libjava/gnu/java/awt/color/GrayScaleConverter.java | 57 +- libjava/gnu/java/awt/color/LinearRGBConverter.java | 56 +- libjava/gnu/java/awt/color/ProfileHeader.java | 67 +- libjava/gnu/java/awt/color/PyccConverter.java | 145 +- .../gnu/java/awt/color/RgbProfileConverter.java | 73 +- libjava/gnu/java/awt/color/SrgbConverter.java | 67 +- libjava/gnu/java/awt/color/TagEntry.java | 67 +- .../gnu/java/awt/color/ToneReproductionCurve.java | 67 +- libjava/gnu/java/awt/image/ImageDecoder.java | 4 +- libjava/gnu/java/awt/image/XBMDecoder.java | 6 +- libjava/gnu/java/awt/peer/ClasspathFontPeer.java | 26 +- libjava/gnu/java/awt/peer/gtk/GdkGraphics.java | 30 +- libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java | 19 +- .../awt/peer/gtk/GdkGraphicsConfiguration.java | 4 +- .../java/awt/peer/gtk/GdkScreenGraphicsDevice.java | 33 + .../gnu/java/awt/peer/gtk/GtkComponentPeer.java | 54 +- libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java | 5 - .../gnu/java/awt/peer/gtk/GtkVolatileImage.java | 118 + libjava/gnu/java/beans/IntrospectionIncubator.java | 8 +- .../gnu/java/beans/decoder/PersistenceParser.java | 5 +- libjava/gnu/java/lang/ClassHelper.java | 2 +- libjava/gnu/java/lang/reflect/TypeSignature.java | 2 +- libjava/gnu/java/net/BASE64.java | 8 +- libjava/gnu/java/net/CRLFInputStream.java | 131 +- libjava/gnu/java/net/EmptyX509TrustManager.java | 1 + libjava/gnu/java/net/HeaderFieldHelper.java | 2 +- libjava/gnu/java/net/LineInputStream.java | 2 +- libjava/gnu/java/net/PlainDatagramSocketImpl.java | 2 +- libjava/gnu/java/net/PlainSocketImpl.java | 11 +- libjava/gnu/java/net/URLParseError.java | 2 +- libjava/gnu/java/net/protocol/file/Connection.java | 97 +- libjava/gnu/java/net/protocol/file/Handler.java | 2 +- .../gnu/java/net/protocol/ftp/ActiveModeDTP.java | 2 +- .../java/net/protocol/ftp/BlockInputStream.java | 2 +- .../net/protocol/ftp/CompressedInputStream.java | 2 +- libjava/gnu/java/net/protocol/ftp/DTP.java | 2 +- .../gnu/java/net/protocol/ftp/DTPInputStream.java | 2 +- .../gnu/java/net/protocol/ftp/FTPConnection.java | 2 +- .../java/net/protocol/ftp/FTPURLConnection.java | 2 +- .../gnu/java/net/protocol/ftp/PassiveModeDTP.java | 2 +- .../java/net/protocol/ftp/StreamInputStream.java | 2 +- .../java/net/protocol/http/ChunkedInputStream.java | 2 +- .../gnu/java/net/protocol/http/HTTPConnection.java | 30 +- .../java/net/protocol/http/HTTPURLConnection.java | 35 +- libjava/gnu/java/net/protocol/http/Headers.java | 12 +- libjava/gnu/java/net/protocol/http/Request.java | 4 +- libjava/gnu/java/net/protocol/https/Handler.java | 76 + libjava/gnu/java/net/protocol/jar/Connection.java | 4 +- libjava/gnu/java/net/protocol/jar/Handler.java | 3 +- libjava/gnu/java/nio/ChannelInputStream.java | 2 +- libjava/gnu/java/nio/ChannelOutputStream.java | 2 +- libjava/gnu/java/nio/InputStreamChannel.java | 2 +- libjava/gnu/java/nio/OutputStreamChannel.java | 2 +- libjava/gnu/java/nio/SelectorProviderImpl.java | 2 +- libjava/gnu/java/nio/channels/FileChannelImpl.java | 28 +- .../java/rmi/RMIMarshalledObjectInputStream.java | 5 +- .../java/rmi/RMIMarshalledObjectOutputStream.java | 4 +- libjava/gnu/java/rmi/dgc/DGCImpl.java | 11 +- libjava/gnu/java/rmi/registry/RegistryImpl.java | 25 +- libjava/gnu/java/rmi/server/ProtocolConstants.java | 4 +- .../java/rmi/server/RMIDefaultSocketFactory.java | 8 +- libjava/gnu/java/rmi/server/RMIIncomingThread.java | 4 +- .../gnu/java/rmi/server/RMIObjectInputStream.java | 2 +- .../gnu/java/rmi/server/RMIObjectOutputStream.java | 2 +- libjava/gnu/java/rmi/server/RMIVoidValue.java | 4 +- .../java/rmi/server/UnicastConnectionManager.java | 11 +- libjava/gnu/java/rmi/server/UnicastRef.java | 5 +- libjava/gnu/java/rmi/server/UnicastRemoteCall.java | 7 +- libjava/gnu/java/rmi/server/UnicastRemoteStub.java | 6 +- libjava/gnu/java/rmi/server/UnicastServerRef.java | 10 +- libjava/gnu/java/security/OID.java | 2 +- .../security/action/GetSecurityPropertyAction.java | 27 +- libjava/gnu/java/security/der/DERReader.java | 8 +- libjava/gnu/java/security/der/DERValue.java | 7 + .../security/provider/CollectionCertStoreImpl.java | 5 +- .../security/provider/DSAParameterGenerator.java | 6 +- .../gnu/java/security/provider/DSASignature.java | 210 +- .../gnu/java/security/provider/DefaultPolicy.java | 9 +- .../java/security/provider/EncodedKeyFactory.java | 5 +- .../gnu/java/security/provider/GnuDHPublicKey.java | 11 +- .../java/security/provider/GnuDSAPrivateKey.java | 5 +- .../java/security/provider/GnuDSAPublicKey.java | 5 +- .../java/security/provider/GnuRSAPrivateKey.java | 10 +- .../java/security/provider/GnuRSAPublicKey.java | 10 +- .../provider/PKIXCertPathValidatorImpl.java | 11 +- libjava/gnu/java/security/provider/RSA.java | 15 +- libjava/gnu/java/security/provider/SHA1PRNG.java | 6 +- .../gnu/java/security/provider/SHA1withRSA.java | 4 +- .../security/provider/X509CertificateFactory.java | 20 +- .../gnu/java/security/x509/GnuPKIExtension.java | 6 +- .../java/security/x509/X500DistinguishedName.java | 14 +- libjava/gnu/java/security/x509/X509CRL.java | 8 +- libjava/gnu/java/security/x509/X509CRLEntry.java | 12 +- libjava/gnu/java/security/x509/X509CertPath.java | 19 +- .../java/security/x509/X509CertSelectorImpl.java | 4 +- .../gnu/java/security/x509/X509Certificate.java | 32 +- .../security/x509/ext/AuthorityKeyIdentifier.java | 6 +- .../java/security/x509/ext/BasicConstraints.java | 10 +- libjava/gnu/java/security/x509/ext/CRLNumber.java | 6 +- .../security/x509/ext/CertificatePolicies.java | 11 +- .../java/security/x509/ext/ExtendedKeyUsage.java | 10 +- libjava/gnu/java/security/x509/ext/Extension.java | 10 +- .../gnu/java/security/x509/ext/GeneralNames.java | 16 +- .../security/x509/ext/IssuerAlternativeNames.java | 3 +- libjava/gnu/java/security/x509/ext/KeyUsage.java | 4 +- .../java/security/x509/ext/PolicyConstraint.java | 6 +- .../gnu/java/security/x509/ext/PolicyMappings.java | 10 +- .../security/x509/ext/PrivateKeyUsagePeriod.java | 10 +- libjava/gnu/java/security/x509/ext/ReasonCode.java | 6 +- .../security/x509/ext/SubjectAlternativeNames.java | 4 +- .../security/x509/ext/SubjectKeyIdentifier.java | 4 +- libjava/gnu/javax/swing/text/html/package.html | 50 + .../javax/swing/text/html/parser/HTML_401F.java | 3729 ++ .../gnu/javax/swing/text/html/parser/gnuDTD.java | 422 + .../swing/text/html/parser/htmlAttributeSet.java | 133 + .../swing/text/html/parser/htmlValidator.java | 610 + .../text/html/parser/models/PCDATAonly_model.java | 62 + .../html/parser/models/TableRowContentModel.java | 77 + .../javax/swing/text/html/parser/models/list.java | 382 + .../swing/text/html/parser/models/noTagModel.java | 75 + .../javax/swing/text/html/parser/models/node.java | 337 + .../swing/text/html/parser/models/package.html | 53 + .../swing/text/html/parser/models/transformer.java | 201 + .../gnu/javax/swing/text/html/parser/package.html | 51 + .../swing/text/html/parser/support/Parser.java | 1443 + .../html/parser/support/gnuStringIntMapper.java | 112 + .../swing/text/html/parser/support/low/Buffer.java | 238 + .../text/html/parser/support/low/Constants.java | 422 + .../text/html/parser/support/low/Location.java | 83 + .../html/parser/support/low/ParseException.java | 51 + .../swing/text/html/parser/support/low/Queue.java | 142 + .../html/parser/support/low/ReaderTokenizer.java | 374 + .../swing/text/html/parser/support/low/Token.java | 169 + .../swing/text/html/parser/support/low/node.java | 78 + .../text/html/parser/support/low/package.html | 47 + .../text/html/parser/support/low/pattern.java | 105 + .../swing/text/html/parser/support/package.html | 47 + .../html/parser/support/parameterDefaulter.java | 106 + .../text/html/parser/support/textPreProcessor.java | 193 + libjava/gnu/regexp/RE.java | 54 +- libjava/gnu/xml/aelfred2/JAXPFactory.java | 273 +- libjava/gnu/xml/aelfred2/SAXDriver.java | 3030 +- libjava/gnu/xml/aelfred2/XmlParser.java | 10948 ++-- libjava/gnu/xml/aelfred2/XmlReader.java | 689 +- libjava/gnu/xml/dom/DomImpl.java | 19 +- libjava/gnu/xml/dom/DomNode.java | 13 +- .../gnu/xml/dom/html2/DomHTMLAnchorElement.java | 189 + .../gnu/xml/dom/html2/DomHTMLAppletElement.java | 169 + libjava/gnu/xml/dom/html2/DomHTMLAreaElement.java | 139 + libjava/gnu/xml/dom/html2/DomHTMLBRElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLBaseElement.java | 79 + .../gnu/xml/dom/html2/DomHTMLBaseFontElement.java | 89 + libjava/gnu/xml/dom/html2/DomHTMLBodyElement.java | 119 + .../gnu/xml/dom/html2/DomHTMLButtonElement.java | 121 + libjava/gnu/xml/dom/html2/DomHTMLCollection.java | 218 + libjava/gnu/xml/dom/html2/DomHTMLDListElement.java | 69 + .../gnu/xml/dom/html2/DomHTMLDirectoryElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLDivElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLDocument.java | 425 + libjava/gnu/xml/dom/html2/DomHTMLElement.java | 269 + .../gnu/xml/dom/html2/DomHTMLFieldSetElement.java | 65 + libjava/gnu/xml/dom/html2/DomHTMLFontElement.java | 89 + libjava/gnu/xml/dom/html2/DomHTMLFormElement.java | 150 + libjava/gnu/xml/dom/html2/DomHTMLFrameElement.java | 146 + .../gnu/xml/dom/html2/DomHTMLFrameSetElement.java | 79 + libjava/gnu/xml/dom/html2/DomHTMLHRElement.java | 99 + libjava/gnu/xml/dom/html2/DomHTMLHeadElement.java | 69 + .../gnu/xml/dom/html2/DomHTMLHeadingElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLHtmlElement.java | 69 + .../gnu/xml/dom/html2/DomHTMLIFrameElement.java | 166 + libjava/gnu/xml/dom/html2/DomHTMLImageElement.java | 179 + libjava/gnu/xml/dom/html2/DomHTMLImpl.java | 67 + libjava/gnu/xml/dom/html2/DomHTMLInputElement.java | 266 + .../gnu/xml/dom/html2/DomHTMLIsIndexElement.java | 75 + libjava/gnu/xml/dom/html2/DomHTMLLIElement.java | 79 + libjava/gnu/xml/dom/html2/DomHTMLLabelElement.java | 85 + .../gnu/xml/dom/html2/DomHTMLLegendElement.java | 85 + libjava/gnu/xml/dom/html2/DomHTMLLinkElement.java | 149 + libjava/gnu/xml/dom/html2/DomHTMLMapElement.java | 79 + libjava/gnu/xml/dom/html2/DomHTMLMenuElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLMetaElement.java | 99 + libjava/gnu/xml/dom/html2/DomHTMLModElement.java | 79 + libjava/gnu/xml/dom/html2/DomHTMLOListElement.java | 89 + .../gnu/xml/dom/html2/DomHTMLObjectElement.java | 242 + .../gnu/xml/dom/html2/DomHTMLOptGroupElement.java | 79 + .../gnu/xml/dom/html2/DomHTMLOptionElement.java | 131 + .../gnu/xml/dom/html2/DomHTMLParagraphElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLParamElement.java | 99 + libjava/gnu/xml/dom/html2/DomHTMLParser.java | 266 + libjava/gnu/xml/dom/html2/DomHTMLPreElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLQuoteElement.java | 69 + .../gnu/xml/dom/html2/DomHTMLScriptElement.java | 129 + .../gnu/xml/dom/html2/DomHTMLSelectElement.java | 211 + libjava/gnu/xml/dom/html2/DomHTMLStyleElement.java | 89 + .../xml/dom/html2/DomHTMLTableCaptionElement.java | 70 + .../gnu/xml/dom/html2/DomHTMLTableCellElement.java | 205 + .../gnu/xml/dom/html2/DomHTMLTableColElement.java | 120 + libjava/gnu/xml/dom/html2/DomHTMLTableElement.java | 383 + .../gnu/xml/dom/html2/DomHTMLTableRowElement.java | 225 + .../xml/dom/html2/DomHTMLTableSectionElement.java | 158 + .../gnu/xml/dom/html2/DomHTMLTextAreaElement.java | 182 + libjava/gnu/xml/dom/html2/DomHTMLTitleElement.java | 69 + libjava/gnu/xml/dom/html2/DomHTMLUListElement.java | 79 + libjava/gnu/xml/pipeline/ValidationConsumer.java | 5 +- libjava/include/Makefile.am | 6 +- libjava/include/Makefile.in | 26 +- libjava/include/config.h.in | 18 +- libjava/include/java-props.h | 3 - libjava/include/jawt.h | 3 + libjava/include/jni.h | 404 +- libjava/include/jni_md.h | 151 + libjava/include/jvm.h | 31 +- libjava/include/posix.h | 2 +- libjava/interpret.cc | 1 - libjava/java/awt/AWTEvent.java | 5 +- libjava/java/awt/AWTKeyStroke.java | 5 +- libjava/java/awt/BorderLayout.java | 12 +- libjava/java/awt/BufferCapabilities.java | 149 +- libjava/java/awt/Button.java | 6 +- libjava/java/awt/Canvas.java | 152 +- libjava/java/awt/Checkbox.java | 3 +- libjava/java/awt/Choice.java | 3 +- libjava/java/awt/Component.java | 422 +- libjava/java/awt/Font.java | 9 +- libjava/java/awt/FontMetrics.java | 888 +- libjava/java/awt/Frame.java | 3 +- libjava/java/awt/GraphicsDevice.java | 33 +- libjava/java/awt/GraphicsEnvironment.java | 56 +- libjava/java/awt/ImageCapabilities.java | 47 +- libjava/java/awt/MediaTracker.java | 522 +- libjava/java/awt/MenuComponent.java | 3 +- libjava/java/awt/MenuItem.java | 9 +- libjava/java/awt/Robot.java | 3 +- libjava/java/awt/TextComponent.java | 19 +- libjava/java/awt/Transparency.java | 4 +- libjava/java/awt/Window.java | 166 +- libjava/java/awt/geom/Arc2D.java | 5 +- libjava/java/awt/geom/Area.java | 23 +- libjava/java/awt/geom/CubicCurve2D.java | 2 +- libjava/java/awt/geom/GeneralPath.java | 23 +- libjava/java/awt/geom/QuadCurve2D.java | 4 +- libjava/java/awt/image/BufferStrategy.java | 77 +- libjava/java/awt/image/ConvolveOp.java | 10 +- libjava/java/awt/image/IndexColorModel.java | 2 +- libjava/java/awt/image/PixelGrabber.java | 2 +- libjava/java/awt/image/RasterOp.java | 7 +- libjava/java/awt/image/VolatileImage.java | 187 +- libjava/java/awt/peer/ComponentPeer.java | 55 +- libjava/java/awt/print/PrinterJob.java | 18 +- libjava/java/beans/EventHandler.java | 537 +- libjava/java/beans/FeatureDescriptor.java | 14 +- libjava/java/beans/Introspector.java | 70 +- .../beancontext/BeanContextServicesSupport.java | 49 +- .../java/beans/beancontext/BeanContextSupport.java | 50 +- libjava/java/io/DataInputStream.java | 102 +- libjava/java/io/DataOutputStream.java | 18 +- libjava/java/io/FileInputStream.java | 11 +- libjava/java/io/FileOutputStream.java | 11 +- libjava/java/io/FilePermission.java | 19 +- libjava/java/io/PipedInputStream.java | 23 +- libjava/java/io/RandomAccessFile.java | 62 +- libjava/java/lang/AssertionError.java | 2 +- libjava/java/lang/Class.h | 7 + libjava/java/lang/ClassLoader.java | 54 +- libjava/java/lang/Package.java | 4 +- libjava/java/lang/Runtime.java | 123 +- libjava/java/lang/SecurityManager.java | 12 +- libjava/java/lang/String.java | 16 +- libjava/java/lang/StringBuilder.java | 937 + libjava/java/lang/System.java | 149 +- libjava/java/lang/ThreadGroup.java | 2 +- libjava/java/lang/Throwable.java | 12 +- libjava/java/lang/VMClassLoader.java | 71 +- libjava/java/lang/VMCompiler.java | 4 + libjava/java/lang/VMSecurityManager.java | 10 +- libjava/java/lang/ieeefp.h | 2 +- libjava/java/lang/natClass.cc | 35 +- libjava/java/lang/natClassLoader.cc | 113 +- libjava/java/lang/natDouble.cc | 19 +- libjava/java/lang/natObject.cc | 16 +- libjava/java/lang/natRuntime.cc | 335 - libjava/java/lang/natString.cc | 2 - libjava/java/lang/natStringBuilder.cc | 29 + libjava/java/lang/natSystem.cc | 13 - libjava/java/lang/natVMClassLoader.cc | 117 +- libjava/java/lang/natVMSecurityManager.cc | 4 +- libjava/java/lang/reflect/natMethod.cc | 43 +- libjava/java/net/Inet4Address.java | 68 +- libjava/java/net/InetAddress.java | 61 +- libjava/java/net/NetworkInterface.java | 26 +- libjava/java/net/ServerSocket.java | 6 +- libjava/java/net/URI.java | 92 +- libjava/java/net/URL.java | 28 +- libjava/java/net/URLClassLoader.java | 27 +- libjava/java/net/URLConnection.java | 4 + libjava/java/net/VMNetworkInterface.java | 66 + libjava/java/net/natNetworkInterfaceNoNet.cc | 21 - libjava/java/net/natNetworkInterfacePosix.cc | 115 - libjava/java/net/natNetworkInterfaceWin32.cc | 143 - libjava/java/net/natVMNetworkInterfaceNoNet.cc | 21 + libjava/java/net/natVMNetworkInterfacePosix.cc | 116 + libjava/java/net/natVMNetworkInterfaceWin32.cc | 143 + libjava/java/nio/ByteBufferImpl.java | 66 +- libjava/java/nio/CharBufferImpl.java | 50 +- libjava/java/nio/DirectByteBufferImpl.java | 2 +- libjava/java/nio/channels/FileLock.java | 17 +- libjava/java/nio/charset/Charset.java | 167 +- libjava/java/rmi/Naming.java | 134 +- libjava/java/rmi/server/RemoteObject.java | 3 +- libjava/java/security/AccessControlContext.java | 30 +- libjava/java/security/AccessController.java | 14 +- libjava/java/security/Security.java | 8 +- libjava/java/security/cert/X509CRLSelector.java | 6 +- libjava/java/security/cert/X509CertSelector.java | 6 +- libjava/java/text/SimpleDateFormat.java | 14 +- libjava/java/util/BitSet.java | 2 +- libjava/java/util/Calendar.java | 6 + libjava/java/util/GregorianCalendar.java | 45 +- libjava/java/util/Locale.java | 181 +- libjava/java/util/ResourceBundle.java | 14 +- libjava/java/util/TimeZone.java | 20 +- libjava/java/util/Timer.java | 5 +- libjava/java/util/logging/LogManager.java | 450 +- libjava/java/util/logging/natLogger.cc | 10 +- libjava/javax/imageio/ImageIO.java | 2 +- libjava/javax/imageio/spi/IIORegistry.java | 4 +- .../javax/naming/directory/BasicAttributes.java | 30 +- libjava/javax/swing/BoxLayout.java | 164 +- libjava/javax/swing/CellRendererPane.java | 271 +- libjava/javax/swing/ImageIcon.java | 60 +- libjava/javax/swing/JColorChooser.java | 4 +- libjava/javax/swing/JComboBox.java | 6 + libjava/javax/swing/JComponent.java | 22 +- libjava/javax/swing/JFormattedTextField.java | 3 +- libjava/javax/swing/JList.java | 60 +- libjava/javax/swing/JMenu.java | 3 +- libjava/javax/swing/JRootPane.java | 126 +- libjava/javax/swing/JTextArea.java | 4 +- libjava/javax/swing/JToggleButton.java | 2 +- libjava/javax/swing/JToolBar.java | 10 + libjava/javax/swing/RepaintManager.java | 5 +- libjava/javax/swing/Timer.java | 461 +- libjava/javax/swing/ToolTipManager.java | 7 +- libjava/javax/swing/TransferHandler.java | 3 +- libjava/javax/swing/UIDefaults.java | 320 +- libjava/javax/swing/UIManager.java | 23 +- .../swing/colorchooser/DefaultHSBChooserPanel.java | 79 +- .../swing/colorchooser/DefaultRGBChooserPanel.java | 43 +- .../colorchooser/DefaultSwatchChooserPanel.java | 3 +- .../javax/swing/plaf/basic/BasicArrowButton.java | 15 +- .../swing/plaf/basic/BasicButtonListener.java | 6 +- libjava/javax/swing/plaf/basic/BasicButtonUI.java | 32 +- .../swing/plaf/basic/BasicColorChooserUI.java | 17 +- .../javax/swing/plaf/basic/BasicComboBoxUI.java | 15 +- .../javax/swing/plaf/basic/BasicDesktopIconUI.java | 7 +- .../javax/swing/plaf/basic/BasicGraphicsUtils.java | 11 +- .../plaf/basic/BasicInternalFrameTitlePane.java | 5 +- libjava/javax/swing/plaf/basic/BasicListUI.java | 288 +- .../javax/swing/plaf/basic/BasicLookAndFeel.java | 410 +- libjava/javax/swing/plaf/basic/BasicMenuBarUI.java | 4 +- .../javax/swing/plaf/basic/BasicMenuItemUI.java | 14 +- libjava/javax/swing/plaf/basic/BasicMenuUI.java | 2 +- .../javax/swing/plaf/basic/BasicOptionPaneUI.java | 43 +- .../javax/swing/plaf/basic/BasicPopupMenuUI.java | 7 +- .../javax/swing/plaf/basic/BasicScrollBarUI.java | 122 +- .../javax/swing/plaf/basic/BasicScrollPaneUI.java | 9 +- libjava/javax/swing/plaf/basic/BasicSliderUI.java | 3 +- .../swing/plaf/basic/BasicSplitPaneDivider.java | 8 +- .../javax/swing/plaf/basic/BasicTabbedPaneUI.java | 54 +- .../swing/plaf/basic/BasicToggleButtonUI.java | 12 +- libjava/javax/swing/plaf/basic/BasicToolBarUI.java | 33 +- libjava/javax/swing/plaf/metal/MetalBorders.java | 443 + libjava/javax/swing/plaf/metal/MetalButtonUI.java | 101 + .../javax/swing/plaf/metal/MetalCheckBoxUI.java | 74 + .../javax/swing/plaf/metal/MetalComboBoxUI.java | 74 + .../javax/swing/plaf/metal/MetalDesktopIconUI.java | 74 + .../swing/plaf/metal/MetalInternalFrameUI.java | 88 + libjava/javax/swing/plaf/metal/MetalLabelUI.java | 74 + .../javax/swing/plaf/metal/MetalLookAndFeel.java | 224 +- .../plaf/metal/MetalPopupMenuSeparatorUI.java | 73 + .../javax/swing/plaf/metal/MetalProgressBarUI.java | 74 + .../javax/swing/plaf/metal/MetalRadioButtonUI.java | 74 + .../javax/swing/plaf/metal/MetalRootPaneUI.java | 74 + .../javax/swing/plaf/metal/MetalScrollBarUI.java | 165 + .../javax/swing/plaf/metal/MetalScrollPaneUI.java | 74 + .../javax/swing/plaf/metal/MetalSeparatorUI.java | 74 + libjava/javax/swing/plaf/metal/MetalSliderUI.java | 87 + .../javax/swing/plaf/metal/MetalSplitPaneUI.java | 74 + .../javax/swing/plaf/metal/MetalTabbedPaneUI.java | 86 + .../javax/swing/plaf/metal/MetalTextFieldUI.java | 86 + .../swing/plaf/metal/MetalToggleButtonUI.java | 74 + libjava/javax/swing/plaf/metal/MetalToolBarUI.java | 74 + libjava/javax/swing/plaf/metal/MetalToolTipUI.java | 74 + libjava/javax/swing/plaf/metal/MetalTreeUI.java | 74 + libjava/javax/swing/text/AbstractDocument.java | 30 +- .../javax/swing/text/ChangedCharSetException.java | 100 + libjava/javax/swing/text/DefaultEditorKit.java | 3 - libjava/javax/swing/text/Document.java | 138 +- libjava/javax/swing/text/GapContent.java | 293 +- libjava/javax/swing/text/JTextComponent.java | 34 +- libjava/javax/swing/text/PlainDocument.java | 42 +- libjava/javax/swing/text/PlainView.java | 2 +- libjava/javax/swing/text/SimpleAttributeSet.java | 2 +- libjava/javax/swing/text/StringContent.java | 9 +- libjava/javax/swing/text/StyleConstants.java | 8 +- libjava/javax/swing/text/StyleContext.java | 6 +- libjava/javax/swing/text/Utilities.java | 2 +- libjava/javax/swing/text/html/HTML.java | 1254 +- libjava/javax/swing/text/html/HTMLDocument.java | 53 + libjava/javax/swing/text/html/HTMLEditorKit.java | 173 + .../swing/text/html/HTMLFrameHyperlinkEvent.java | 132 + .../swing/text/html/parser/AttributeList.java | 294 + .../javax/swing/text/html/parser/ContentModel.java | 218 + libjava/javax/swing/text/html/parser/DTD.java | 607 + .../javax/swing/text/html/parser/DTDConstants.java | 290 + .../swing/text/html/parser/DocumentParser.java | 261 + libjava/javax/swing/text/html/parser/Element.java | 317 + libjava/javax/swing/text/html/parser/Entity.java | 185 + libjava/javax/swing/text/html/parser/Parser.java | 436 + .../swing/text/html/parser/ParserDelegator.java | 170 +- .../javax/swing/text/html/parser/TagElement.java | 142 + libjava/javax/swing/text/rtf/ControlWordToken.java | 86 + libjava/javax/swing/text/rtf/RTFEditorKit.java | 114 + .../javax/swing/text/rtf/RTFParseException.java | 65 + libjava/javax/swing/text/rtf/RTFParser.java | 195 + libjava/javax/swing/text/rtf/RTFScanner.java | 268 + libjava/javax/swing/text/rtf/TextToken.java | 65 + libjava/javax/swing/text/rtf/Token.java | 91 + .../swing/tree/DefaultTreeSelectionModel.java | 294 +- libjava/jawt.c | 10 +- libjava/jni.cc | 11 +- libjava/jni/classpath/classpath_jawt.h | 4 + .../gnu_java_awt_peer_gtk_GdkPixbufDecoder.c | 20 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c | 18 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c | 19 +- libjava/jni/gtk-peer/gtk_jawt.c | 31 + libjava/link.cc | 39 +- libjava/prims.cc | 367 +- libjava/scripts/TexinfoDoclet.java | 140 - libjava/stacktrace.cc | 33 +- libjava/testsuite/Makefile.am | 3 + libjava/testsuite/Makefile.in | 23 +- libjava/testsuite/lib/libjava.exp | 4 + libjava/testsuite/libjava.compile/pr21519.java | 8 + libjava/testsuite/libjava.compile/pr21519.no-link | 0 libjava/testsuite/libjava.jacks/jacks.xfail | 4 +- libjava/testsuite/libjava.jni/jni.exp | 4 + libjava/testsuite/libjava.lang/Process_3.java | 1 + libjava/testsuite/libjava.lang/bytearray.java | 10 + libjava/testsuite/libjava.lang/bytearray.out | 2 + libjava/testsuite/libjava.special/pr21115.java | 34 + libjava/testsuite/libjava.special/pr21115.out | 0 libjava/testsuite/libjava.special/pr21115I.java | 20 + libjava/testsuite/libjava.special/special.exp | 30 + libjava/verify.cc | 7 +- libmudflap/ChangeLog | 44 +- libmudflap/Makefile.am | 3 + libmudflap/Makefile.in | 13 +- libmudflap/aclocal.m4 | 1 - libmudflap/configure | 89 +- libmudflap/configure.ac | 4 +- libmudflap/mf-heuristics.c | 24 +- libmudflap/mf-hooks1.c | 60 +- libmudflap/mf-hooks2.c | 26 +- libmudflap/mf-hooks3.c | 52 +- libmudflap/mf-impl.h | 42 +- libmudflap/mf-runtime.c | 277 +- libmudflap/mf-runtime.h | 76 +- libmudflap/testsuite/Makefile.in | 7 +- libmudflap/testsuite/libmudflap.c++/c++frags.exp | 2 +- .../testsuite/libmudflap.c++/pass57-frag.cxx | 25 + libobjc/ChangeLog | 24 +- libobjc/Makefile.in | 2 +- libobjc/aclocal.m4 | 1 - libobjc/configure | 89 +- libobjc/configure.ac | 4 +- libobjc/exception.c | 1 + libstdc++-v3/ChangeLog | 1119 +- libstdc++-v3/Makefile.am | 2 + libstdc++-v3/Makefile.in | 22 +- libstdc++-v3/acconfig.h | 480 - libstdc++-v3/acinclude.m4 | 626 +- libstdc++-v3/aclocal.m4 | 4 + libstdc++-v3/config.h.in | 737 +- libstdc++-v3/config/cpu/s390/atomicity.h | 3 +- libstdc++-v3/config/linker-map.gnu | 2 - .../config/locale/gnu/c++locale_internal.h | 16 +- libstdc++-v3/config/locale/gnu/c_locale.h | 6 +- libstdc++-v3/config/os/aix/os_defines.h | 4 - libstdc++-v3/config/os/djgpp/os_defines.h | 6 +- libstdc++-v3/config/os/hpux/os_defines.h | 6 +- libstdc++-v3/config/os/irix/irix5.2/os_defines.h | 6 +- libstdc++-v3/config/os/irix/irix6.5/os_defines.h | 4 - libstdc++-v3/config/os/mingw32/os_defines.h | 5 +- libstdc++-v3/config/os/newlib/os_defines.h | 5 +- .../config/os/solaris/solaris2.5/os_defines.h | 8 +- .../config/os/solaris/solaris2.6/os_defines.h | 8 +- .../config/os/solaris/solaris2.7/os_defines.h | 8 +- libstdc++-v3/configure | 53219 ++++++++----------- libstdc++-v3/configure.ac | 23 +- libstdc++-v3/crossconfig.m4 | 81 +- libstdc++-v3/docs/doxygen/doxygroups.cc | 33 +- libstdc++-v3/docs/doxygen/user.cfg.in | 1031 +- libstdc++-v3/docs/html/17_intro/porting.html | 23 +- libstdc++-v3/docs/html/17_intro/porting.texi | 26 +- libstdc++-v3/docs/html/configopts.html | 15 +- libstdc++-v3/docs/html/ext/lwg-active.html | 677 +- libstdc++-v3/docs/html/ext/lwg-defects.html | 1762 +- libstdc++-v3/docs/html/install.html | 1 + libstdc++-v3/docs/html/test.html | 261 +- libstdc++-v3/fragment.am | 3 + libstdc++-v3/include/Makefile.am | 6 + libstdc++-v3/include/Makefile.in | 18 +- libstdc++-v3/include/bits/basic_string.h | 65 +- libstdc++-v3/include/bits/basic_string.tcc | 20 +- libstdc++-v3/include/bits/cpp_type_traits.h | 4 +- libstdc++-v3/include/bits/deque.tcc | 12 +- libstdc++-v3/include/bits/fstream.tcc | 41 +- libstdc++-v3/include/bits/locale_facets.tcc | 400 +- libstdc++-v3/include/bits/stl_algo.h | 19 +- libstdc++-v3/include/bits/stl_algobase.h | 9 +- libstdc++-v3/include/bits/stl_bvector.h | 54 +- libstdc++-v3/include/bits/stl_deque.h | 42 +- libstdc++-v3/include/bits/stl_list.h | 32 +- libstdc++-v3/include/bits/stl_map.h | 16 +- libstdc++-v3/include/bits/stl_multimap.h | 14 +- libstdc++-v3/include/bits/stl_multiset.h | 10 +- libstdc++-v3/include/bits/stl_set.h | 17 +- libstdc++-v3/include/bits/stl_vector.h | 26 +- libstdc++-v3/include/bits/vector.tcc | 10 +- libstdc++-v3/include/c_std/std_cstdio.h | 9 +- libstdc++-v3/include/c_std/std_cwctype.h | 12 +- libstdc++-v3/include/debug/bitset | 24 +- libstdc++-v3/include/debug/debug.h | 2 +- libstdc++-v3/include/debug/formatter.h | 11 +- libstdc++-v3/include/ext/array_allocator.h | 5 +- libstdc++-v3/include/ext/bitmap_allocator.h | 34 +- libstdc++-v3/include/ext/mt_allocator.h | 4 +- libstdc++-v3/include/ext/pod_char_traits.h | 76 +- libstdc++-v3/include/ext/pool_allocator.h | 2 +- libstdc++-v3/include/ext/rope | 6 +- libstdc++-v3/include/ext/ropeimpl.h | 40 +- libstdc++-v3/include/std/std_bitset.h | 65 +- libstdc++-v3/include/tr1/bind_iterate.h | 78 + libstdc++-v3/include/tr1/bind_repeat.h | 192 + libstdc++-v3/include/tr1/boost_shared_ptr.h | 981 + libstdc++-v3/include/tr1/functional | 241 + libstdc++-v3/include/tr1/functional_iterate.h | 86 +- libstdc++-v3/include/tr1/memory | 1030 +- libstdc++-v3/include/tr1/mu_iterate.h | 51 + libstdc++-v3/include/tr1/ref_fwd.h | 59 + libstdc++-v3/include/tr1/repeat.h | 569 +- libstdc++-v3/include/tr1/tuple | 1733 +- libstdc++-v3/include/tr1/tuple_iterate.h | 158 + libstdc++-v3/include/tr1/type_traits | 21 +- libstdc++-v3/libmath/Makefile.am | 3 + libstdc++-v3/libmath/Makefile.in | 12 +- libstdc++-v3/libsupc++/Makefile.in | 12 +- libstdc++-v3/libsupc++/unwind-cxx.h | 2 + libstdc++-v3/linkage.m4 | 78 +- libstdc++-v3/po/Makefile.in | 12 +- libstdc++-v3/scripts/check_survey.in | 449 - libstdc++-v3/scripts/create_testsuite_files | 18 +- libstdc++-v3/scripts/gen_bind_includers.pl | 30 + libstdc++-v3/scripts/gen_includers.pl | 108 + libstdc++-v3/src/Makefile.in | 12 +- libstdc++-v3/src/bitmap_allocator.cc | 26 +- libstdc++-v3/src/debug.cc | 19 +- libstdc++-v3/src/mt_allocator.cc | 5 +- libstdc++-v3/src/pool_allocator.cc | 1 + .../testsuite/18_support/numeric_limits.cc | 1 + .../inserters_extractors/pod/10081-in.cc | 21 +- .../inserters_extractors/pod/10081-out.cc | 21 +- .../codecvt/always_noconv/char/wrapped_env.cc | 4 +- .../codecvt/always_noconv/char/wrapped_locale.cc | 4 +- .../22_locale/codecvt/always_noconv/wchar_t/2.cc | 6 +- .../22_locale/codecvt/always_noconv/wchar_t/3.cc | 6 +- .../22_locale/codecvt/always_noconv/wchar_t/4.cc | 6 +- .../codecvt/always_noconv/wchar_t/wrapped_env.cc | 4 +- .../always_noconv/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/codecvt/encoding/char/wrapped_env.cc | 4 +- .../codecvt/encoding/char/wrapped_locale.cc | 4 +- .../22_locale/codecvt/encoding/wchar_t/2.cc | 6 +- .../22_locale/codecvt/encoding/wchar_t/3.cc | 6 +- .../22_locale/codecvt/encoding/wchar_t/4.cc | 6 +- .../codecvt/encoding/wchar_t/wrapped_env.cc | 4 +- .../codecvt/encoding/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/codecvt/in/char/wrapped_env.cc | 4 +- .../22_locale/codecvt/in/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/codecvt/in/wchar_t/2.cc | 6 +- .../testsuite/22_locale/codecvt/in/wchar_t/3.cc | 6 +- .../testsuite/22_locale/codecvt/in/wchar_t/4.cc | 6 +- .../testsuite/22_locale/codecvt/in/wchar_t/7.cc | 6 +- .../testsuite/22_locale/codecvt/in/wchar_t/8.cc | 6 +- .../testsuite/22_locale/codecvt/in/wchar_t/9.cc | 6 +- .../22_locale/codecvt/in/wchar_t/wrapped_env.cc | 4 +- .../22_locale/codecvt/in/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/codecvt/length/char/wrapped_env.cc | 4 +- .../codecvt/length/char/wrapped_locale.cc | 4 +- .../22_locale/codecvt/length/wchar_t/2.cc | 6 +- .../22_locale/codecvt/length/wchar_t/3.cc | 6 +- .../22_locale/codecvt/length/wchar_t/4.cc | 6 +- .../22_locale/codecvt/length/wchar_t/7.cc | 6 +- .../codecvt/length/wchar_t/wrapped_env.cc | 4 +- .../codecvt/length/wchar_t/wrapped_locale.cc | 4 +- .../codecvt/max_length/char/wrapped_env.cc | 4 +- .../codecvt/max_length/char/wrapped_locale.cc | 4 +- .../22_locale/codecvt/max_length/wchar_t/2.cc | 6 +- .../22_locale/codecvt/max_length/wchar_t/3.cc | 6 +- .../22_locale/codecvt/max_length/wchar_t/4.cc | 6 +- .../codecvt/max_length/wchar_t/wrapped_env.cc | 4 +- .../codecvt/max_length/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/codecvt/out/char/wrapped_env.cc | 4 +- .../22_locale/codecvt/out/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/codecvt/out/wchar_t/2.cc | 6 +- .../testsuite/22_locale/codecvt/out/wchar_t/3.cc | 6 +- .../testsuite/22_locale/codecvt/out/wchar_t/4.cc | 6 +- .../testsuite/22_locale/codecvt/out/wchar_t/7.cc | 6 +- .../22_locale/codecvt/out/wchar_t/wrapped_env.cc | 4 +- .../codecvt/out/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/codecvt/unshift/char/wrapped_env.cc | 4 +- .../codecvt/unshift/char/wrapped_locale.cc | 4 +- .../22_locale/codecvt/unshift/wchar_t/2.cc | 6 +- .../22_locale/codecvt/unshift/wchar_t/3.cc | 6 +- .../22_locale/codecvt/unshift/wchar_t/4.cc | 6 +- .../codecvt/unshift/wchar_t/wrapped_env.cc | 4 +- .../codecvt/unshift/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/collate/compare/char/1.cc | 10 +- .../testsuite/22_locale/collate/compare/char/2.cc | 10 +- .../testsuite/22_locale/collate/compare/char/3.cc | 6 +- .../22_locale/collate/compare/char/wrapped_env.cc | 4 +- .../collate/compare/char/wrapped_locale.cc | 4 +- .../22_locale/collate/compare/wchar_t/1.cc | 10 +- .../22_locale/collate/compare/wchar_t/2.cc | 19 +- .../22_locale/collate/compare/wchar_t/3.cc | 6 +- .../collate/compare/wchar_t/wrapped_env.cc | 13 +- .../collate/compare/wchar_t/wrapped_locale.cc | 13 +- .../testsuite/22_locale/collate/hash/char/2.cc | 10 +- .../22_locale/collate/hash/char/wrapped_env.cc | 4 +- .../22_locale/collate/hash/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/collate/hash/wchar_t/2.cc | 19 +- .../22_locale/collate/hash/wchar_t/wrapped_env.cc | 13 +- .../collate/hash/wchar_t/wrapped_locale.cc | 13 +- .../22_locale/collate/transform/char/2.cc | 10 +- .../22_locale/collate/transform/char/3.cc | 6 +- .../collate/transform/char/wrapped_env.cc | 4 +- .../collate/transform/char/wrapped_locale.cc | 4 +- .../22_locale/collate/transform/wchar_t/2.cc | 19 +- .../22_locale/collate/transform/wchar_t/3.cc | 6 +- .../collate/transform/wchar_t/wrapped_env.cc | 13 +- .../collate/transform/wchar_t/wrapped_locale.cc | 13 +- .../22_locale/collate_byname/named_equivalence.cc | 6 +- .../22_locale/ctype/cons/char/wrapped_env.cc | 4 +- .../22_locale/ctype/cons/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/ctype/is/char/2.cc | 4 +- .../22_locale/ctype/is/char/wrapped_env.cc | 4 +- .../22_locale/ctype/is/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/ctype/is/wchar_t/2.cc | 4 +- .../22_locale/ctype/is/wchar_t/wrapped_env.cc | 4 +- .../22_locale/ctype/is/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/ctype/narrow/char/wrapped_env.cc | 4 +- .../22_locale/ctype/narrow/char/wrapped_locale.cc | 2 + .../testsuite/22_locale/ctype/narrow/wchar_t/3.cc | 6 +- .../22_locale/ctype/narrow/wchar_t/wrapped_env.cc | 4 +- .../ctype/narrow/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/ctype/scan/char/wrapped_env.cc | 4 +- .../22_locale/ctype/scan/char/wrapped_locale.cc | 4 +- .../22_locale/ctype/scan/wchar_t/wrapped_env.cc | 4 +- .../22_locale/ctype/scan/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/ctype/to/char/wrapped_env.cc | 4 +- .../22_locale/ctype/to/char/wrapped_locale.cc | 4 +- .../22_locale/ctype/to/wchar_t/wrapped_env.cc | 4 +- .../22_locale/ctype/to/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/ctype/widen/char/wrapped_env.cc | 4 +- .../22_locale/ctype/widen/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/ctype/widen/wchar_t/2.cc | 6 +- .../testsuite/22_locale/ctype/widen/wchar_t/3.cc | 6 +- .../22_locale/ctype/widen/wchar_t/wrapped_env.cc | 4 +- .../ctype/widen/wchar_t/wrapped_locale.cc | 4 +- libstdc++-v3/testsuite/22_locale/facet/2.cc | 6 +- .../testsuite/22_locale/locale/cons/12352.cc | 6 +- .../testsuite/22_locale/locale/cons/12438.cc | 6 +- .../22_locale/locale/cons/12658_thread-1.cc | 5 +- .../22_locale/locale/cons/12658_thread-2.cc | 5 +- libstdc++-v3/testsuite/22_locale/locale/cons/2.cc | 6 +- libstdc++-v3/testsuite/22_locale/locale/cons/4.cc | 6 +- libstdc++-v3/testsuite/22_locale/locale/cons/5.cc | 18 +- libstdc++-v3/testsuite/22_locale/locale/cons/7.cc | 6 +- .../testsuite/22_locale/locale/cons/7222-env.cc | 8 +- .../locale/global_locale_objects/14071.cc | 8 +- .../22_locale/locale/global_locale_objects/2.cc | 12 +- .../testsuite/22_locale/messages/members/char/1.cc | 6 +- .../testsuite/22_locale/messages/members/char/2.cc | 6 +- .../testsuite/22_locale/messages/members/char/3.cc | 8 +- .../22_locale/messages/members/char/wrapped_env.cc | 4 +- .../messages/members/char/wrapped_locale.cc | 4 +- .../22_locale/messages_byname/named_equivalence.cc | 6 +- libstdc++-v3/testsuite/22_locale/money_get/3.cc | 41 + .../testsuite/22_locale/money_get/get/char/1.cc | 6 +- .../testsuite/22_locale/money_get/get/char/10.cc | 6 +- .../testsuite/22_locale/money_get/get/char/11.cc | 6 +- .../22_locale/money_get/get/char/11528.cc | 6 +- .../testsuite/22_locale/money_get/get/char/12.cc | 6 +- .../testsuite/22_locale/money_get/get/char/13.cc | 6 +- .../testsuite/22_locale/money_get/get/char/15.cc | 6 +- .../testsuite/22_locale/money_get/get/char/16.cc | 8 +- .../testsuite/22_locale/money_get/get/char/17.cc | 6 +- .../testsuite/22_locale/money_get/get/char/18.cc | 6 +- .../testsuite/22_locale/money_get/get/char/2.cc | 6 +- .../testsuite/22_locale/money_get/get/char/3.cc | 6 +- .../testsuite/22_locale/money_get/get/char/4.cc | 6 +- .../22_locale/money_get/get/char/wrapped_env.cc | 4 +- .../22_locale/money_get/get/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/money_get/get/wchar_t/1.cc | 6 +- .../22_locale/money_get/get/wchar_t/10.cc | 6 +- .../22_locale/money_get/get/wchar_t/11.cc | 6 +- .../22_locale/money_get/get/wchar_t/11528.cc | 6 +- .../22_locale/money_get/get/wchar_t/12.cc | 6 +- .../22_locale/money_get/get/wchar_t/13.cc | 6 +- .../22_locale/money_get/get/wchar_t/15.cc | 6 +- .../22_locale/money_get/get/wchar_t/16.cc | 8 +- .../22_locale/money_get/get/wchar_t/17.cc | 6 +- .../22_locale/money_get/get/wchar_t/18.cc | 6 +- .../testsuite/22_locale/money_get/get/wchar_t/2.cc | 6 +- .../testsuite/22_locale/money_get/get/wchar_t/3.cc | 6 +- .../testsuite/22_locale/money_get/get/wchar_t/4.cc | 6 +- .../22_locale/money_get/get/wchar_t/wrapped_env.cc | 4 +- .../money_get/get/wchar_t/wrapped_locale.cc | 4 +- libstdc++-v3/testsuite/22_locale/money_put/3.cc | 41 + .../testsuite/22_locale/money_put/put/char/1.cc | 6 +- .../testsuite/22_locale/money_put/put/char/2.cc | 6 +- .../testsuite/22_locale/money_put/put/char/3.cc | 6 +- .../22_locale/money_put/put/char/9780-3.cc | 8 +- .../22_locale/money_put/put/char/wrapped_env.cc | 4 +- .../22_locale/money_put/put/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/money_put/put/wchar_t/1.cc | 6 +- .../testsuite/22_locale/money_put/put/wchar_t/2.cc | 6 +- .../testsuite/22_locale/money_put/put/wchar_t/3.cc | 6 +- .../22_locale/money_put/put/wchar_t/wrapped_env.cc | 4 +- .../money_put/put/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/moneypunct/members/char/2.cc | 6 +- .../moneypunct/members/char/wrapped_env.cc | 4 +- .../moneypunct/members/char/wrapped_locale.cc | 4 +- .../22_locale/moneypunct/members/wchar_t/2.cc | 6 +- .../moneypunct/members/wchar_t/wrapped_env.cc | 4 +- .../moneypunct/members/wchar_t/wrapped_locale.cc | 4 +- .../moneypunct_byname/named_equivalence.cc | 6 +- libstdc++-v3/testsuite/22_locale/num_get/3.cc | 41 + .../testsuite/22_locale/num_get/get/char/1.cc | 6 +- .../testsuite/22_locale/num_get/get/char/16.cc | 202 + .../testsuite/22_locale/num_get/get/char/3.cc | 6 +- .../testsuite/22_locale/num_get/get/char/5.cc | 6 +- .../testsuite/22_locale/num_get/get/char/6.cc | 6 +- .../testsuite/22_locale/num_get/get/char/9.cc | 6 +- .../22_locale/num_get/get/char/wrapped_env.cc | 4 +- .../22_locale/num_get/get/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/num_get/get/wchar_t/1.cc | 4 +- .../testsuite/22_locale/num_get/get/wchar_t/16.cc | 202 + .../testsuite/22_locale/num_get/get/wchar_t/3.cc | 6 +- .../testsuite/22_locale/num_get/get/wchar_t/5.cc | 6 +- .../testsuite/22_locale/num_get/get/wchar_t/6.cc | 6 +- .../testsuite/22_locale/num_get/get/wchar_t/9.cc | 6 +- .../22_locale/num_get/get/wchar_t/wrapped_env.cc | 4 +- .../num_get/get/wchar_t/wrapped_locale.cc | 4 +- libstdc++-v3/testsuite/22_locale/num_put/3.cc | 41 + .../testsuite/22_locale/num_put/put/char/1.cc | 6 +- .../testsuite/22_locale/num_put/put/char/20909.cc | 81 + .../testsuite/22_locale/num_put/put/char/20914.cc | 81 + .../testsuite/22_locale/num_put/put/char/3.cc | 6 +- .../testsuite/22_locale/num_put/put/char/5.cc | 6 +- .../testsuite/22_locale/num_put/put/char/9780-2.cc | 8 +- .../22_locale/num_put/put/char/wrapped_env.cc | 4 +- .../22_locale/num_put/put/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/num_put/put/wchar_t/1.cc | 6 +- .../22_locale/num_put/put/wchar_t/20909.cc | 81 + .../22_locale/num_put/put/wchar_t/20914.cc | 81 + .../testsuite/22_locale/num_put/put/wchar_t/3.cc | 6 +- .../testsuite/22_locale/num_put/put/wchar_t/5.cc | 6 +- .../22_locale/num_put/put/wchar_t/wrapped_env.cc | 4 +- .../num_put/put/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/numpunct/members/char/2.cc | 10 +- .../testsuite/22_locale/numpunct/members/char/3.cc | 6 +- .../22_locale/numpunct/members/char/wrapped_env.cc | 4 +- .../numpunct/members/char/wrapped_locale.cc | 4 +- .../testsuite/22_locale/numpunct/members/pod/1.cc | 35 +- .../testsuite/22_locale/numpunct/members/pod/2.cc | 16 +- .../22_locale/numpunct/members/wchar_t/2.cc | 10 +- .../numpunct/members/wchar_t/wrapped_env.cc | 4 +- .../numpunct/members/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/numpunct_byname/named_equivalence.cc | 6 +- .../time_get/date_order/char/wrapped_env.cc | 4 +- .../time_get/date_order/char/wrapped_locale.cc | 4 +- .../time_get/date_order/wchar_t/wrapped_env.cc | 4 +- .../time_get/date_order/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_date/char/12750.cc | 6 +- .../22_locale/time_get/get_date/char/2.cc | 8 +- .../time_get/get_date/char/wrapped_env.cc | 4 +- .../time_get/get_date/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_date/wchar_t/12750.cc | 6 +- .../22_locale/time_get/get_date/wchar_t/2.cc | 8 +- .../22_locale/time_get/get_date/wchar_t/4.cc | 4 +- .../time_get/get_date/wchar_t/wrapped_env.cc | 4 +- .../time_get/get_date/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_monthname/char/2.cc | 8 +- .../time_get/get_monthname/char/wrapped_env.cc | 4 +- .../time_get/get_monthname/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_monthname/wchar_t/2.cc | 8 +- .../time_get/get_monthname/wchar_t/wrapped_env.cc | 4 +- .../get_monthname/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_time/char/1.cc | 6 +- .../22_locale/time_get/get_time/char/2.cc | 6 +- .../time_get/get_time/char/wrapped_env.cc | 4 +- .../time_get/get_time/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_time/wchar_t/1.cc | 6 +- .../22_locale/time_get/get_time/wchar_t/2.cc | 6 +- .../time_get/get_time/wchar_t/wrapped_env.cc | 4 +- .../time_get/get_time/wchar_t/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_weekday/char/2.cc | 8 +- .../time_get/get_weekday/char/wrapped_env.cc | 4 +- .../time_get/get_weekday/char/wrapped_locale.cc | 4 +- .../22_locale/time_get/get_weekday/wchar_t/2.cc | 8 +- .../time_get/get_weekday/wchar_t/wrapped_env.cc | 4 +- .../time_get/get_weekday/wchar_t/wrapped_locale.cc | 4 +- .../time_get/get_year/char/wrapped_env.cc | 4 +- .../time_get/get_year/char/wrapped_locale.cc | 4 +- .../time_get/get_year/wchar_t/wrapped_env.cc | 4 +- .../time_get/get_year/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/22_locale/time_put/put/char/17038.cc | 6 +- .../testsuite/22_locale/time_put/put/char/2.cc | 6 +- .../testsuite/22_locale/time_put/put/char/3.cc | 6 +- .../testsuite/22_locale/time_put/put/char/4.cc | 6 +- .../testsuite/22_locale/time_put/put/char/6.cc | 6 +- .../testsuite/22_locale/time_put/put/char/7.cc | 6 +- .../testsuite/22_locale/time_put/put/char/8.cc | 6 +- .../22_locale/time_put/put/char/9780-1.cc | 8 +- .../22_locale/time_put/put/char/wrapped_env.cc | 4 +- .../22_locale/time_put/put/char/wrapped_locale.cc | 4 +- .../22_locale/time_put/put/wchar_t/17038.cc | 6 +- .../testsuite/22_locale/time_put/put/wchar_t/2.cc | 6 +- .../testsuite/22_locale/time_put/put/wchar_t/3.cc | 6 +- .../testsuite/22_locale/time_put/put/wchar_t/4.cc | 6 +- .../testsuite/22_locale/time_put/put/wchar_t/6.cc | 6 +- .../testsuite/22_locale/time_put/put/wchar_t/7.cc | 6 +- .../testsuite/22_locale/time_put/put/wchar_t/8.cc | 6 +- .../22_locale/time_put/put/wchar_t/wrapped_env.cc | 4 +- .../time_put/put/wchar_t/wrapped_locale.cc | 4 +- .../testsuite/23_containers/bitset/18604.cc | 41 + .../testsuite/23_containers/deque/18604.cc | 41 + libstdc++-v3/testsuite/23_containers/list/18604.cc | 41 + libstdc++-v3/testsuite/23_containers/map/18604.cc | 41 + libstdc++-v3/testsuite/23_containers/set/18604.cc | 42 + .../testsuite/23_containers/vector/18604.cc | 41 + .../testsuite/23_containers/vector/bool/21244.cc | 36 + .../testsuite/25_algorithms/iter_swap/20577.cc | 71 + libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc | 3 +- .../testsuite/27_io/basic_filebuf/close/12790-1.cc | 20 +- .../27_io/basic_filebuf/close/char/4879.cc | 5 +- .../27_io/basic_filebuf/close/char/9964.cc | 5 +- .../27_io/basic_filebuf/imbue/char/13007.cc | 6 +- .../27_io/basic_filebuf/imbue/char/13171-1.cc | 8 +- .../27_io/basic_filebuf/imbue/char/13171-2.cc | 10 +- .../27_io/basic_filebuf/imbue/char/13171-4.cc | 9 +- .../27_io/basic_filebuf/imbue/char/13582-2.cc | 10 +- .../27_io/basic_filebuf/imbue/char/14975-1.cc | 6 +- .../testsuite/27_io/basic_filebuf/imbue/char/2.cc | 6 +- .../27_io/basic_filebuf/imbue/char/9322.cc | 8 +- .../27_io/basic_filebuf/imbue/wchar_t/12868.cc | 6 +- .../27_io/basic_filebuf/imbue/wchar_t/13007.cc | 6 +- .../27_io/basic_filebuf/imbue/wchar_t/13171-3.cc | 24 +- .../27_io/basic_filebuf/imbue/wchar_t/13582-2.cc | 12 +- .../27_io/basic_filebuf/imbue/wchar_t/13582-3.cc | 8 +- .../27_io/basic_filebuf/imbue/wchar_t/14975-2.cc | 8 +- .../27_io/basic_filebuf/imbue/wchar_t/2.cc | 6 +- .../27_io/basic_filebuf/imbue/wchar_t/9322.cc | 8 +- .../testsuite/27_io/basic_filebuf/open/12790-1.cc | 12 +- .../27_io/basic_filebuf/open/char/9507.cc | 4 +- .../basic_filebuf/overflow/wchar_t/11305-1.cc | 6 +- .../basic_filebuf/overflow/wchar_t/11305-2.cc | 6 +- .../basic_filebuf/overflow/wchar_t/11305-3.cc | 6 +- .../basic_filebuf/overflow/wchar_t/11305-4.cc | 6 +- .../27_io/basic_filebuf/seekoff/12790-1.cc | 26 +- .../27_io/basic_filebuf/seekoff/12790-2.cc | 26 +- .../27_io/basic_filebuf/seekoff/12790-3.cc | 24 +- .../27_io/basic_filebuf/seekoff/12790-4.cc | 22 +- .../27_io/basic_filebuf/seekoff/wchar_t/1.cc | 6 +- .../27_io/basic_filebuf/seekoff/wchar_t/2.cc | 6 +- .../27_io/basic_filebuf/seekpos/12790-1.cc | 18 +- .../27_io/basic_filebuf/seekpos/12790-2.cc | 24 +- .../27_io/basic_filebuf/seekpos/12790-3.cc | 28 +- .../27_io/basic_filebuf/seekpos/wchar_t/9874.cc | 4 +- .../27_io/basic_filebuf/showmanyc/char/9533-1.cc | 5 +- .../27_io/basic_filebuf/underflow/char/10097.cc | 5 +- .../27_io/basic_filebuf/underflow/wchar_t/1.cc | 6 +- .../basic_filebuf/underflow/wchar_t/11389-1.cc | 6 +- .../basic_filebuf/underflow/wchar_t/11389-2.cc | 6 +- .../basic_filebuf/underflow/wchar_t/11389-3.cc | 6 +- .../basic_filebuf/underflow/wchar_t/11389-4.cc | 6 +- .../27_io/basic_filebuf/underflow/wchar_t/2.cc | 6 +- .../27_io/basic_filebuf/underflow/wchar_t/3.cc | 6 +- .../27_io/basic_filebuf/underflow/wchar_t/4.cc | 6 +- .../27_io/basic_filebuf/underflow/wchar_t/5.cc | 6 +- .../27_io/basic_filebuf/underflow/wchar_t/9520.cc | 6 +- libstdc++-v3/testsuite/27_io/basic_fstream/2.cc | 3 +- .../testsuite/27_io/basic_ios/copyfmt/char/2.cc | 6 +- .../testsuite/27_io/basic_ios/imbue/14072.cc | 312 +- libstdc++-v3/testsuite/27_io/basic_istream/2.cc | 3 +- .../extractors_arithmetic/pod/3983-1.cc | 18 +- .../extractors_character/char/9826.cc | 3 +- .../extractors_character/pod/3983-2.cc | 21 +- .../basic_istream/extractors_other/pod/3983-3.cc | 18 +- .../testsuite/27_io/basic_istream/sentry/pod/1.cc | 21 +- libstdc++-v3/testsuite/27_io/basic_ostream/2.cc | 3 +- .../basic_ostream/inserters_arithmetic/char/2.cc | 4 +- .../inserters_arithmetic/wchar_t/2.cc | 4 +- .../testsuite/27_io/basic_ostream/sentry/pod/1.cc | 21 +- libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc | 3 +- .../27_io/basic_streambuf/imbue/char/13007-1.cc | 6 +- .../27_io/basic_streambuf/imbue/char/13007-2.cc | 6 +- .../27_io/basic_streambuf/imbue/char/9322.cc | 9 +- .../27_io/basic_streambuf/imbue/wchar_t/13007-1.cc | 6 +- .../27_io/basic_streambuf/imbue/wchar_t/13007-2.cc | 6 +- .../27_io/basic_streambuf/imbue/wchar_t/9322.cc | 8 +- .../27_io/basic_streambuf/sgetn/char/1.cc | 9 +- .../27_io/basic_streambuf/sgetn/wchar_t/1.cc | 8 +- .../27_io/basic_streambuf/sputn/char/1.cc | 9 +- .../27_io/basic_streambuf/sputn/wchar_t/1.cc | 8 +- libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc | 3 +- libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc | 3 +- .../27_io/basic_stringbuf/imbue/char/9322.cc | 8 +- .../27_io/basic_stringbuf/imbue/wchar_t/9322.cc | 8 +- .../testsuite/27_io/basic_stringstream/2.cc | 3 +- libstdc++-v3/testsuite/27_io/fpos/1.cc | 3 +- libstdc++-v3/testsuite/27_io/objects/char/7.cc | 5 +- .../testsuite/27_io/objects/char/9661-1.cc | 5 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc | 6 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc | 6 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc | 6 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc | 6 +- libstdc++-v3/testsuite/27_io/objects/wchar_t/7.cc | 5 +- .../testsuite/27_io/objects/wchar_t/9520.cc | 6 +- .../testsuite/27_io/objects/wchar_t/9661-1.cc | 5 +- libstdc++-v3/testsuite/Makefile.am | 111 +- libstdc++-v3/testsuite/Makefile.in | 248 +- libstdc++-v3/testsuite/abi_check.cc | 94 - libstdc++-v3/testsuite/ext/array_allocator/2.cc | 12 +- .../bitmap_allocator/check_allocate_max_size.cc | 8 +- .../ext/bitmap_allocator/check_deallocate_null.cc | 10 +- libstdc++-v3/testsuite/ext/mt_allocator/tune-1.cc | 5 +- libstdc++-v3/testsuite/ext/mt_allocator/tune-2.cc | 5 +- libstdc++-v3/testsuite/ext/stdio_filebuf/char/1.cc | 3 +- .../ext/stdio_sync_filebuf/wchar_t/12077.cc | 6 +- libstdc++-v3/testsuite/lib/dg-options.exp | 10 +- libstdc++-v3/testsuite/lib/libstdc++.exp | 225 +- libstdc++-v3/testsuite/libstdc++-abi/abi.exp | 43 + libstdc++-v3/testsuite/libstdc++-dg/normal.exp | 67 +- libstdc++-v3/testsuite/printnow.c | 13 - libstdc++-v3/testsuite/testsuite_abi.cc | 4 +- libstdc++-v3/testsuite/testsuite_abi.h | 2 +- libstdc++-v3/testsuite/testsuite_abi_check.cc | 95 + libstdc++-v3/testsuite/testsuite_character.cc | 195 + libstdc++-v3/testsuite/testsuite_character.h | 501 +- libstdc++-v3/testsuite/testsuite_hooks.cc | 187 +- libstdc++-v3/testsuite/testsuite_hooks.h | 135 - libstdc++-v3/testsuite/testsuite_tr1.h | 54 +- .../memory/enable_shared_from_this/not_shared.cc | 2 + .../memory/enable_shared_from_this/not_shared2.cc | 5 + .../memory/enable_shared_from_this/not_shared3.cc | 5 + .../memory/shared_ptr/assign/auto_ptr_neg.cc | 4 +- .../shared_ptr/assign/auto_ptr_rvalue_neg.cc | 3 +- .../memory/shared_ptr/cons/auto_ptr_neg.cc | 4 +- .../memory/shared_ptr/cons/weak_ptr_expired.cc | 5 +- .../tr1/3_function_objects/bind/all_bound.cc | 45 + .../tr1/3_function_objects/bind/nested.cc | 46 + .../tr1/3_function_objects/bind/placeholders.cc | 46 + .../testsuite/tr1/3_function_objects/bind/ref.cc | 60 + .../is_convertible/is_convertible.cc | 10 +- .../has_nothrow_assign/has_nothrow_assign.cc | 34 +- .../has_nothrow_copy/has_nothrow_copy.cc | 34 +- .../has_trivial_assign/has_trivial_assign.cc | 34 +- .../has_trivial_copy/has_trivial_copy.cc | 34 +- libtool.m4 | 61 + ltcf-c.sh | 1 + ltcf-cxx.sh | 1 + ltcf-gcj.sh | 1 + ltconfig | 9 +- ltmain.sh | 152 +- maintainer-scripts/ChangeLog | 5 + maintainer-scripts/crontab | 1 - maintainer-scripts/update_version | 2 +- ylwrap | 241 +- zlib/ChangeLog.gcj | 8 + zlib/configure | 63 +- 3314 files changed, 441701 insertions(+), 296202 deletions(-) delete mode 100644 config/accross.m4 delete mode 100644 config/gcc-lib-path.m4 delete mode 100644 config/mh-mingw32 create mode 100644 fixincludes/tests/base/iso/math_c99.h delete mode 100644 gcc/ada/5xcrtl.ads create mode 100644 gcc/ada/a-tgdico.ads create mode 100644 gcc/ada/s-crtl-vms64.ads create mode 100644 gcc/ada/s-osinte-linux-hppa.ads create mode 100644 gcc/ada/system-linux-hppa.ads create mode 100644 gcc/config/alpha/sync.md create mode 100644 gcc/config/arm/arm.opt create mode 100644 gcc/config/arm/pe.opt create mode 100644 gcc/config/avr/avr.opt create mode 100644 gcc/config/bfin/bfin-modes.def create mode 100644 gcc/config/bfin/bfin-protos.h create mode 100644 gcc/config/bfin/bfin.c create mode 100644 gcc/config/bfin/bfin.h create mode 100644 gcc/config/bfin/bfin.md create mode 100644 gcc/config/bfin/bfin.opt create mode 100644 gcc/config/bfin/crti.s create mode 100644 gcc/config/bfin/crtn.s create mode 100644 gcc/config/bfin/elf.h create mode 100644 gcc/config/bfin/lib1funcs.asm create mode 100644 gcc/config/bfin/predicates.md create mode 100644 gcc/config/bfin/t-bfin create mode 100644 gcc/config/bfin/t-bfin-elf create mode 100644 gcc/config/c4x/c4x.opt create mode 100644 gcc/config/cris/aout.opt create mode 100644 gcc/config/cris/cris.opt create mode 100644 gcc/config/cris/elf.opt create mode 100644 gcc/config/cris/linux.opt create mode 100644 gcc/config/cris/predicates.md create mode 100644 gcc/config/darwin.opt create mode 100644 gcc/config/fr30/fr30.opt create mode 100644 gcc/config/fr30/predicates.md create mode 100644 gcc/config/frv/frv.opt create mode 100644 gcc/config/frv/predicates.md create mode 100644 gcc/config/host-darwin.c create mode 100644 gcc/config/host-darwin.h create mode 100644 gcc/config/i386/cygming.opt create mode 100644 gcc/config/i386/djgpp.opt create mode 100644 gcc/config/i386/host-i386-darwin.c create mode 100644 gcc/config/i386/i386.opt create mode 100644 gcc/config/i386/sco5.opt create mode 100644 gcc/config/i386/sync.md create mode 100644 gcc/config/i386/x-darwin create mode 100644 gcc/config/i860/i860.opt rewrite gcc/config/ia64/ia64intrin.h (71%) create mode 100644 gcc/config/ia64/sync.md create mode 100644 gcc/config/iq2000/iq2000.opt create mode 100644 gcc/config/iq2000/predicates.md create mode 100644 gcc/config/lynx.opt create mode 100644 gcc/config/m32r/m32r.opt create mode 100644 gcc/config/m32r/predicates.md delete mode 100644 gcc/config/m32r/xm-linux.h delete mode 100644 gcc/config/m32r/xm-m32r.h create mode 100644 gcc/config/m68hc11/m68hc11.opt create mode 100644 gcc/config/m68hc11/predicates.md create mode 100644 gcc/config/m68k/ieee.opt create mode 100644 gcc/config/m68k/m68k.opt create mode 100644 gcc/config/m68k/predicates.md create mode 100644 gcc/config/mcore/mcore.opt create mode 100644 gcc/config/mcore/predicates.md create mode 100644 gcc/config/mips/24k.md create mode 100644 gcc/config/mips/4k.md create mode 100644 gcc/config/mmix/mmix.opt create mode 100644 gcc/config/mmix/predicates.md create mode 100644 gcc/config/mn10300/mn10300.opt create mode 100644 gcc/config/mn10300/predicates.md create mode 100644 gcc/config/ns32k/ns32k.opt create mode 100644 gcc/config/pa/pa-hpux.opt create mode 100644 gcc/config/pa/pa-hpux1010.opt create mode 100644 gcc/config/pa/pa-hpux1111.opt create mode 100644 gcc/config/pa/pa.opt create mode 100644 gcc/config/pa/pa64-hpux.opt create mode 100644 gcc/config/pa/predicates.md delete mode 100644 gcc/config/pa/rtems.h create mode 100644 gcc/config/pdp11/pdp11.opt create mode 100644 gcc/config/rs6000/aix.opt create mode 100644 gcc/config/rs6000/aix41.opt create mode 100644 gcc/config/rs6000/aix64.opt rewrite gcc/config/rs6000/altivec.h (99%) create mode 100644 gcc/config/rs6000/darwin.opt create mode 100644 gcc/config/rs6000/linux64.opt create mode 100644 gcc/config/rs6000/rs6000.opt create mode 100644 gcc/config/rs6000/sysv4.opt create mode 100644 gcc/config/s390/predicates.md create mode 100644 gcc/config/s390/s390.opt create mode 100644 gcc/config/sh/divtab.c create mode 100644 gcc/config/sh/newlib.h create mode 100644 gcc/config/sh/predicates.md create mode 100644 gcc/config/sh/sh.opt create mode 100644 gcc/config/sh/superh.h create mode 100644 gcc/config/sh/superh64.h create mode 100644 gcc/config/sh/t-superh delete mode 100644 gcc/config/sparc/lite.h delete mode 100644 gcc/config/sparc/litecoff.h delete mode 100644 gcc/config/sparc/liteelf.h create mode 100644 gcc/config/sparc/little-endian.opt create mode 100644 gcc/config/sparc/long-double-switch.opt create mode 100644 gcc/config/sparc/predicates.md delete mode 100644 gcc/config/sparc/sp86x-elf.h create mode 100644 gcc/config/sparc/sparc.opt delete mode 100644 gcc/config/sparc/t-sp86x delete mode 100644 gcc/config/sparc/t-sparclite create mode 100644 gcc/config/stormy16/predicates.md create mode 100644 gcc/config/stormy16/stormy16.opt create mode 100644 gcc/config/v850/predicates.md create mode 100644 gcc/config/v850/v850.opt create mode 100644 gcc/config/vax/vax.opt create mode 100644 gcc/config/x-darwin create mode 100644 gcc/config/xtensa/predicates.md create mode 100644 gcc/config/xtensa/xtensa.opt create mode 100644 gcc/cp/ChangeLog-1993 create mode 100644 gcc/cp/ChangeLog-1994 create mode 100644 gcc/cp/ChangeLog-1995 create mode 100644 gcc/cp/ChangeLog-1996 create mode 100644 gcc/cp/ChangeLog-1997 create mode 100644 gcc/cp/ChangeLog-1998 create mode 100644 gcc/cp/ChangeLog-1999 create mode 100644 gcc/cp/ChangeLog-2000 create mode 100644 gcc/cp/ChangeLog-2001 create mode 100644 gcc/cp/ChangeLog-2002 create mode 100644 gcc/cp/ChangeLog-2003 create mode 100644 gcc/cp/ChangeLog-2004 delete mode 100644 gcc/cp/ChangeLog.1 delete mode 100644 gcc/cp/ChangeLog.2 delete mode 100644 gcc/cp/ChangeLog.3 delete mode 100644 gcc/cp/ChangeLog.egcs create mode 100644 gcc/dummy-checksum.c create mode 100644 gcc/fortran/intrinsic.texi create mode 100644 gcc/genchecksum.c create mode 100644 gcc/ipa-inline.c create mode 100644 gcc/ipa.c create mode 100644 gcc/objcp/ChangeLog create mode 100644 gcc/objcp/Make-lang.in create mode 100644 gcc/objcp/config-lang.in create mode 100644 gcc/objcp/lang-specs.h create mode 100644 gcc/objcp/objcp-decl.c create mode 100644 gcc/objcp/objcp-decl.h create mode 100644 gcc/objcp/objcp-lang.c create mode 100644 gcc/po/rw.po create mode 100644 gcc/po/zh_CN.po create mode 100644 gcc/testsuite/g++.dg/abi/covariant5.C create mode 100644 gcc/testsuite/g++.dg/abi/param2.C create mode 100644 gcc/testsuite/g++.dg/cpp/weak.C create mode 100644 gcc/testsuite/g++.dg/debug/const2.C create mode 100644 gcc/testsuite/g++.dg/debug/using1.C create mode 100644 gcc/testsuite/g++.dg/eh/fp-regs.C create mode 100644 gcc/testsuite/g++.dg/eh/throw3.C create mode 100644 gcc/testsuite/g++.dg/expr/cast3.C create mode 100644 gcc/testsuite/g++.dg/expr/lval2.C create mode 100644 gcc/testsuite/g++.dg/ext/attrib21.C create mode 100644 gcc/testsuite/g++.dg/ext/selectany1.C create mode 100644 gcc/testsuite/g++.dg/ext/selectany2.C create mode 100644 gcc/testsuite/g++.dg/ext/stmtexpr4.C create mode 100644 gcc/testsuite/g++.dg/ext/sync-1.C create mode 100644 gcc/testsuite/g++.dg/ext/sync-2.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility/arm2.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility/arm3.C create mode 100644 gcc/testsuite/g++.dg/ext/visibility/symbian2.C create mode 100644 gcc/testsuite/g++.dg/ext/weak2.C create mode 100644 gcc/testsuite/g++.dg/ext/weak3.C create mode 100644 gcc/testsuite/g++.dg/inherit/covariant13.C create mode 100644 gcc/testsuite/g++.dg/inherit/local3.C create mode 100644 gcc/testsuite/g++.dg/lookup/builtin2.C create mode 100644 gcc/testsuite/g++.dg/lookup/using13.C create mode 100644 gcc/testsuite/g++.dg/opt/20050511-1.C create mode 100644 gcc/testsuite/g++.dg/opt/const4.C create mode 100644 gcc/testsuite/g++.dg/opt/crossjump1.C create mode 100644 gcc/testsuite/g++.dg/opt/pr13066-1.C create mode 100644 gcc/testsuite/g++.dg/opt/pr19108.C create mode 100644 gcc/testsuite/g++.dg/opt/pr20991.C create mode 100644 gcc/testsuite/g++.dg/opt/pr20995-1.C create mode 100644 gcc/testsuite/g++.dg/opt/rtti2.C create mode 100644 gcc/testsuite/g++.dg/parse/cond2.C create mode 100644 gcc/testsuite/g++.dg/parse/crash24.C create mode 100644 gcc/testsuite/g++.dg/parse/crash25.C create mode 100644 gcc/testsuite/g++.dg/parse/extern1.C create mode 100644 gcc/testsuite/g++.dg/template/crash35.C create mode 100644 gcc/testsuite/g++.dg/template/crash36.C create mode 100644 gcc/testsuite/g++.dg/template/crash37.C create mode 100644 gcc/testsuite/g++.dg/template/overload4.C create mode 100644 gcc/testsuite/g++.dg/template/ptrmem12.C create mode 100644 gcc/testsuite/g++.dg/template/ptrmem13.C create mode 100644 gcc/testsuite/g++.dg/template/ptrmem14.C create mode 100644 gcc/testsuite/g++.dg/template/redecl3.C create mode 100644 gcc/testsuite/g++.dg/template/sizeof9.C create mode 100644 gcc/testsuite/g++.dg/template/spec20.C create mode 100644 gcc/testsuite/g++.dg/template/spec21.C create mode 100644 gcc/testsuite/g++.dg/template/spec22.C create mode 100644 gcc/testsuite/g++.dg/template/spec23.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/builtin1.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr14814.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr18178.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr19807.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr20920.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr20963.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr21082.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr21407.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/ssa-sra-3.C create mode 100644 gcc/testsuite/g++.dg/tree-ssa/tmmti-2.C create mode 100644 gcc/testsuite/g++.dg/warn/Wdtor1.C create mode 100644 gcc/testsuite/g++.dg/warn/Wunused-11.C create mode 100644 gcc/testsuite/g++.dg/warn/format4.C create mode 100644 gcc/testsuite/g++.dg/warn/minmax.C create mode 100644 gcc/testsuite/g++.dg/warn/sentinel.C create mode 100644 gcc/testsuite/gcc.c-torture/compile/20050328-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20050510-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/20050516-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr13066-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr17913.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr20203.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr20539-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr21021.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr21030.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr21380.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr21532.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/struct-non-lval-1.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/struct-non-lval-2.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/struct-non-lval-3.c create mode 100644 gcc/testsuite/gcc.c-torture/compile/sync-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20030216-1.x create mode 100644 gcc/testsuite/gcc.c-torture/execute/20041019-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20050316-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20050410-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20050502-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/20050502-2.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/loop-ivopts-2.c delete mode 100644 gcc/testsuite/gcc.c-torture/execute/medce-2.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr20466-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr20527-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr20601-1.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr21173.c create mode 100644 gcc/testsuite/gcc.c-torture/execute/stdarg-4.c create mode 100644 gcc/testsuite/gcc.dg/20050321-1.c create mode 100644 gcc/testsuite/gcc.dg/20050321-2.c create mode 100644 gcc/testsuite/gcc.dg/20050325-1.c create mode 100644 gcc/testsuite/gcc.dg/20050330-1.c create mode 100644 gcc/testsuite/gcc.dg/20050409-1.c create mode 100644 gcc/testsuite/gcc.dg/20050503-1.c create mode 100644 gcc/testsuite/gcc.dg/20050517-1.c create mode 100644 gcc/testsuite/gcc.dg/Foundation.framework/empty create mode 100644 gcc/testsuite/gcc.dg/Wint-to-pointer-cast-1.c create mode 100644 gcc/testsuite/gcc.dg/Wint-to-pointer-cast-2.c create mode 100644 gcc/testsuite/gcc.dg/Wint-to-pointer-cast-3.c create mode 100644 gcc/testsuite/gcc.dg/Wpointer-to-int-cast-1.c create mode 100644 gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c create mode 100644 gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c create mode 100644 gcc/testsuite/gcc.dg/alias-7.c create mode 100644 gcc/testsuite/gcc.dg/arm-vfp1.c create mode 100644 gcc/testsuite/gcc.dg/bitfld-14.c create mode 100644 gcc/testsuite/gcc.dg/builtin-apply4.c create mode 100644 gcc/testsuite/gcc.dg/builtins-53.c create mode 100644 gcc/testsuite/gcc.dg/c99-math-double-1.c create mode 100644 gcc/testsuite/gcc.dg/c99-math-float-1.c create mode 100644 gcc/testsuite/gcc.dg/c99-math-long-double-1.c create mode 100644 gcc/testsuite/gcc.dg/c99-math.h create mode 100644 gcc/testsuite/gcc.dg/c99-vla-jump-1.c create mode 100644 gcc/testsuite/gcc.dg/c99-vla-jump-2.c create mode 100644 gcc/testsuite/gcc.dg/c99-vla-jump-3.c create mode 100644 gcc/testsuite/gcc.dg/c99-vla-jump-4.c create mode 100644 gcc/testsuite/gcc.dg/c99-vla-jump-5.c create mode 100644 gcc/testsuite/gcc.dg/cpp/macspace1.c create mode 100644 gcc/testsuite/gcc.dg/cpp/macspace2.c create mode 100644 gcc/testsuite/gcc.dg/cpp/very-long-comment.c create mode 100644 gcc/testsuite/gcc.dg/debug/pr16676.c create mode 100644 gcc/testsuite/gcc.dg/enum3.c create mode 100644 gcc/testsuite/gcc.dg/fold-div-1.c create mode 100644 gcc/testsuite/gcc.dg/fold-xor-1.c create mode 100644 gcc/testsuite/gcc.dg/fold-xor-2.c create mode 100644 gcc/testsuite/gcc.dg/format/asm_fprintf-2.c create mode 100644 gcc/testsuite/gcc.dg/format/asm_fprintf-3.c create mode 100644 gcc/testsuite/gcc.dg/format/asm_fprintf-4.c create mode 100644 gcc/testsuite/gcc.dg/format/asm_fprintf-5.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-2.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-3.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-4.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-5.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-6.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-7.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-8.c create mode 100644 gcc/testsuite/gcc.dg/format/gcc_diag-9.c create mode 100644 gcc/testsuite/gcc.dg/framework-2.c create mode 100644 gcc/testsuite/gcc.dg/i386-darwin-fpmath.c create mode 100644 gcc/testsuite/gcc.dg/i386-sse-11.c create mode 100644 gcc/testsuite/gcc.dg/i386-ssefn-1.c create mode 100644 gcc/testsuite/gcc.dg/i386-ssefn-2.c create mode 100644 gcc/testsuite/gcc.dg/i386-ssefn-3.c create mode 100644 gcc/testsuite/gcc.dg/i386-ssefn-4.c create mode 100644 gcc/testsuite/gcc.dg/i386-xorps.c create mode 100644 gcc/testsuite/gcc.dg/inline-mcpy.c delete mode 100644 gcc/testsuite/gcc.dg/mips-args-1.c delete mode 100644 gcc/testsuite/gcc.dg/mips-args-2.c delete mode 100644 gcc/testsuite/gcc.dg/mips-args-3.c delete mode 100644 gcc/testsuite/gcc.dg/mips-movcc-1.c delete mode 100644 gcc/testsuite/gcc.dg/mips-movcc-2.c delete mode 100644 gcc/testsuite/gcc.dg/mips-movcc-3.c delete mode 100644 gcc/testsuite/gcc.dg/mips-nmadd-1.c delete mode 100644 gcc/testsuite/gcc.dg/mips-nmadd-2.c delete mode 100644 gcc/testsuite/gcc.dg/mips-rsqrt-1.c delete mode 100644 gcc/testsuite/gcc.dg/mips-rsqrt-2.c delete mode 100644 gcc/testsuite/gcc.dg/mips-rsqrt-3.c create mode 100644 gcc/testsuite/gcc.dg/old-style-then-proto-1.c create mode 100644 gcc/testsuite/gcc.dg/ppc-stfiwx.c create mode 100644 gcc/testsuite/gcc.dg/ppc-vec-merge.c create mode 100644 gcc/testsuite/gcc.dg/pr15443-1.c create mode 100644 gcc/testsuite/gcc.dg/pr15443-2.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-1.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-2.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-3.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-4.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-5.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-6.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-7.c create mode 100644 gcc/testsuite/gcc.dg/pr15698-8.c create mode 100644 gcc/testsuite/gcc.dg/pr19345.c create mode 100644 gcc/testsuite/gcc.dg/pr20126.c create mode 100644 gcc/testsuite/gcc.dg/pr20368-1.c create mode 100644 gcc/testsuite/gcc.dg/pr20368-2.c create mode 100644 gcc/testsuite/gcc.dg/pr20368-3.c create mode 100644 gcc/testsuite/gcc.dg/pr20672-1.c create mode 100644 gcc/testsuite/gcc.dg/pr20922-1.c create mode 100644 gcc/testsuite/gcc.dg/pr20922-2.c create mode 100644 gcc/testsuite/gcc.dg/pr20922-3.c create mode 100644 gcc/testsuite/gcc.dg/pr20922-4.c create mode 100644 gcc/testsuite/gcc.dg/pr20922-5.c create mode 100644 gcc/testsuite/gcc.dg/pr20922-6.c create mode 100644 gcc/testsuite/gcc.dg/pr20927.c create mode 100644 gcc/testsuite/gcc.dg/pr21085.c create mode 100644 gcc/testsuite/gcc.dg/pr21282.c create mode 100644 gcc/testsuite/gcc.dg/pr8788-1.c create mode 100644 gcc/testsuite/gcc.dg/redecl-11.c create mode 100644 gcc/testsuite/gcc.dg/redecl-12.c create mode 100644 gcc/testsuite/gcc.dg/redecl-13.c create mode 100644 gcc/testsuite/gcc.dg/redecl-14.c create mode 100644 gcc/testsuite/gcc.dg/redecl-15.c create mode 100644 gcc/testsuite/gcc.dg/redecl-16.c create mode 100644 gcc/testsuite/gcc.dg/rs6000-fpint-2.c create mode 100644 gcc/testsuite/gcc.dg/rs6000-fpint.c create mode 100644 gcc/testsuite/gcc.dg/sparc-reg-1.c create mode 100644 gcc/testsuite/gcc.dg/stabs-attrib-vect-darwin.c create mode 100644 gcc/testsuite/gcc.dg/stmt-expr-label-1.c create mode 100644 gcc/testsuite/gcc.dg/stmt-expr-label-2.c create mode 100644 gcc/testsuite/gcc.dg/stmt-expr-label-3.c create mode 100644 gcc/testsuite/gcc.dg/sync-1.c create mode 100644 gcc/testsuite/gcc.dg/tls/opt-9.c create mode 100644 gcc/testsuite/gcc.dg/torture/asm-subreg-1.c create mode 100644 gcc/testsuite/gcc.dg/torture/badshift.c create mode 100644 gcc/testsuite/gcc.dg/torture/cris-asm-mof-1.c create mode 100644 gcc/testsuite/gcc.dg/torture/tree-loop-1.c create mode 100644 gcc/testsuite/gcc.dg/transparent-union-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/20041008-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/20050412-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/alias-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-4.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-5.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-6.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-7.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-8.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/bool-9.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11a.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11b.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-11c.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-25.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-26.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-28.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/gen-vect-32.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ifc-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/loop-8.c delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ltrans-5.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr14814.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr14841.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr17141-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr17141-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr17598.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20470.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20657.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20702.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20739.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20913.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr20933.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr21001.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr21031.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr21171.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr21294.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr21563.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/recip-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/recip-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-ccp-12.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-4.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-5.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-6.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-7.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-10.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-11.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-12.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-13.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-7.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-8.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-9.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/stdarg-1.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/stdarg-2.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/stdarg-3.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/stdarg-4.c create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c create mode 100644 gcc/testsuite/gcc.dg/varpool-1.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-100.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-11a.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-99.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-dv-1.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-dv-2.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-1.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-10.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c create mode 100644 gcc/testsuite/gcc.dg/vect/vect-shift-1.c create mode 100644 gcc/testsuite/gcc.dg/void-cast-1.c create mode 100644 gcc/testsuite/gcc.dg/void-cast-2.c delete mode 100644 gcc/testsuite/gcc.dg/vr-mult-1.c delete mode 100644 gcc/testsuite/gcc.dg/vr-mult-2.c create mode 100644 gcc/testsuite/gcc.dg/weak/weak-12.c create mode 100644 gcc/testsuite/gcc.dg/weak/weak-13.c create mode 100644 gcc/testsuite/gcc.target/cris/torture/cris-torture.exp create mode 100644 gcc/testsuite/gcc.target/cris/torture/no-pro-epi-1.c create mode 100644 gcc/testsuite/gcc.target/i386/asm-1.c create mode 100644 gcc/testsuite/gcc.target/i386/pr21101.c create mode 100644 gcc/testsuite/gcc.target/i386/sse-2.c create mode 100644 gcc/testsuite/gcc.target/ia64/small-addr-1.c create mode 100644 gcc/testsuite/gcc.target/mips/args-1.c create mode 100644 gcc/testsuite/gcc.target/mips/args-2.c create mode 100644 gcc/testsuite/gcc.target/mips/args-3.c create mode 100644 gcc/testsuite/gcc.target/mips/branch-1.c create mode 100644 gcc/testsuite/gcc.target/mips/fpcmp-1.c create mode 100644 gcc/testsuite/gcc.target/mips/fpcmp-2.c create mode 100644 gcc/testsuite/gcc.target/mips/movcc-1.c create mode 100644 gcc/testsuite/gcc.target/mips/movcc-2.c create mode 100644 gcc/testsuite/gcc.target/mips/movcc-3.c create mode 100644 gcc/testsuite/gcc.target/mips/nmadd-1.c create mode 100644 gcc/testsuite/gcc.target/mips/nmadd-2.c create mode 100644 gcc/testsuite/gcc.target/mips/rsqrt-1.c create mode 100644 gcc/testsuite/gcc.target/mips/rsqrt-2.c create mode 100644 gcc/testsuite/gcc.target/mips/rsqrt-3.c create mode 100644 gcc/testsuite/gcc.target/mips/vr-mult-1.c create mode 100644 gcc/testsuite/gcc.target/mips/vr-mult-2.c create mode 100644 gcc/testsuite/gfortran.dg/PR19872.f create mode 100644 gcc/testsuite/gfortran.dg/append-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/array_constructor_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/array_constructor_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/assign_4.f create mode 100644 gcc/testsuite/gfortran.dg/backspace.f create mode 100644 gcc/testsuite/gfortran.dg/comma_format_extension_1.f create mode 100644 gcc/testsuite/gfortran.dg/comma_format_extension_2.f create mode 100644 gcc/testsuite/gfortran.dg/comma_format_extension_3.f create mode 100644 gcc/testsuite/gfortran.dg/comma_format_extension_4.f create mode 100644 gcc/testsuite/gfortran.dg/common_5.f create mode 100644 gcc/testsuite/gfortran.dg/dev_null.f90 create mode 100644 gcc/testsuite/gfortran.dg/dos_eol.f create mode 100644 gcc/testsuite/gfortran.dg/entry_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/entry_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/eor_handling_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/eor_handling_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/eor_handling_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/eor_handling_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/eor_handling_5.f90 create mode 100644 gcc/testsuite/gfortran.dg/eoshift.f90 create mode 100644 gcc/testsuite/gfortran.dg/f2c_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/f2c_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/f2c_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/fold_nearest.f90 create mode 100644 gcc/testsuite/gfortran.dg/func_result_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/g77_intrinsics_funcs.f create mode 100644 gcc/testsuite/gfortran.dg/g77_intrinsics_sub.f create mode 100644 gcc/testsuite/gfortran.dg/hollerith_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/ichar_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/implicit_4.f90 create mode 100644 gcc/testsuite/gfortran.dg/in_pack_rank7.f90 create mode 100644 gcc/testsuite/gfortran.dg/matmul_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_11.f create mode 100644 gcc/testsuite/gfortran.dg/namelist_12.f create mode 100644 gcc/testsuite/gfortran.dg/namelist_13.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_14.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_15.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_16.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_17.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_18.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_19.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_20.f90 create mode 100644 gcc/testsuite/gfortran.dg/namelist_3.f90 create mode 100644 gcc/testsuite/gfortran.dg/negative_unit.f create mode 100644 gcc/testsuite/gfortran.dg/nested_reshape.f90 create mode 100644 gcc/testsuite/gfortran.dg/nesting_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/nint_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/noadv_size.f90 create mode 100644 gcc/testsuite/gfortran.dg/open-options-blanks.f create mode 100644 gcc/testsuite/gfortran.dg/pad_no.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr12884.f create mode 100644 gcc/testsuite/gfortran.dg/pr15332.f create mode 100644 gcc/testsuite/gfortran.dg/pr15959.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr16861.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr17229.f create mode 100644 gcc/testsuite/gfortran.dg/pr17285.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr17472.f create mode 100644 gcc/testsuite/gfortran.dg/pr18025.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr18122.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr18210.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr18392.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr19155.f create mode 100644 gcc/testsuite/gfortran.dg/pr19216.f create mode 100644 gcc/testsuite/gfortran.dg/pr19467.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr19657.f create mode 100644 gcc/testsuite/gfortran.dg/pr20163-2.f create mode 100644 gcc/testsuite/gfortran.dg/pr20755.f create mode 100644 gcc/testsuite/gfortran.dg/pr20865.f90 create mode 100644 gcc/testsuite/gfortran.dg/pr20950.f create mode 100644 gcc/testsuite/gfortran.dg/pr20954.f create mode 100644 gcc/testsuite/gfortran.dg/pr21177.f90 create mode 100644 gcc/testsuite/gfortran.dg/promotion.f90 create mode 100644 gcc/testsuite/gfortran.dg/reshape-alloc.f90 create mode 100644 gcc/testsuite/gfortran.dg/reshape-complex.f90 create mode 100644 gcc/testsuite/gfortran.dg/reshape.f90 create mode 100644 gcc/testsuite/gfortran.dg/reshape_rank7.f90 create mode 100644 gcc/testsuite/gfortran.dg/return_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/string_pad_trunc.f90 create mode 100644 gcc/testsuite/gfortran.dg/tiny_1.f90 create mode 100644 gcc/testsuite/gfortran.dg/tiny_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/underflow.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/vect-1.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/vect-2.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/vect-3.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/vect-4.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/vect-5.f90 create mode 100644 gcc/testsuite/gfortran.dg/vect/vect.exp create mode 100644 gcc/testsuite/gfortran.dg/wtruncate.f create mode 100644 gcc/testsuite/gfortran.dg/wtruncate.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_1.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_2.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_3.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_4.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_5.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_6.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_7.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/entry_8.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/where_7.f90 create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/where_8.f90 create mode 100644 gcc/testsuite/objc.dg/fix-and-continue-1.m create mode 100644 gcc/testsuite/objc.dg/objc-fast-4.m create mode 100644 gcc/testsuite/treelang/compile/memory.tree rewrite gcc/tree-ssa-forwprop.c (72%) create mode 100644 gcc/tree-ssa-math-opts.c create mode 100644 gcc/tree-ssa-opfinalize.h create mode 100644 gcc/tree-ssa-uncprop.c create mode 100644 gcc/tree-stdarg.c create mode 100644 gcc/tree-stdarg.h create mode 100644 gcc/tree-vrp.c rewrite libcpp/po/nl.po (94%) create mode 100644 libcpp/po/rw.po create mode 100644 libffi/src/cris/ffi.c create mode 100644 libffi/src/cris/ffitarget.h create mode 100644 libffi/src/cris/sysv.S delete mode 100644 libgfortran/AUTHORS delete mode 100644 libgfortran/COPYING delete mode 100644 libgfortran/INSTALL delete mode 100644 libgfortran/NEWS delete mode 100644 libgfortran/README create mode 100644 libgfortran/generated/reshape_c4.c create mode 100644 libgfortran/generated/reshape_c8.c create mode 100644 libgfortran/intrinsics/chdir.c create mode 100644 libgfortran/intrinsics/f2c_specifics.F90 create mode 100644 libgfortran/intrinsics/gerror.c create mode 100644 libgfortran/intrinsics/getlog.c create mode 100644 libgfortran/intrinsics/hostnm.c create mode 100644 libgfortran/intrinsics/ierrno.c create mode 100644 libgfortran/intrinsics/kill.c create mode 100644 libgfortran/intrinsics/link.c create mode 100644 libgfortran/intrinsics/perror.c create mode 100644 libgfortran/intrinsics/rename.c create mode 100644 libgfortran/intrinsics/sleep.c create mode 100644 libgfortran/intrinsics/symlnk.c create mode 100644 libgfortran/intrinsics/time.c create mode 100644 libiberty/fopen_unlocked.c create mode 100644 libiberty/pex-common.c rewrite libiberty/pex-msdos.c (65%) create mode 100644 libiberty/pex-one.c rewrite libiberty/pex-unix.c (67%) create mode 100644 libiberty/pexecute.c rewrite libiberty/pexecute.txh (86%) create mode 100644 libiberty/strndup.c create mode 100644 libiberty/testsuite/test-pexecute.c create mode 100644 libiberty/xstrndup.c rewrite libjava/ChangeLog (74%) create mode 100644 libjava/ChangeLog-1998 create mode 100644 libjava/ChangeLog-2000 create mode 100644 libjava/ChangeLog-2004 rewrite libjava/Makefile.in (76%) rewrite libjava/external/w3c_dom/Makefile.in (70%) create mode 100644 libjava/gnu/classpath/SystemProperties.java create mode 100644 libjava/gnu/classpath/natSystemProperties.cc create mode 100644 libjava/gnu/gcj/runtime/BootClassLoader.java create mode 100644 libjava/gnu/gcj/runtime/ExtensionClassLoader.java create mode 100644 libjava/gnu/gcj/runtime/HelperClassLoader.java delete mode 100644 libjava/gnu/gcj/runtime/VMClassLoader.java delete mode 100644 libjava/gnu/gcj/runtime/natVMClassLoader.cc create mode 100644 libjava/gnu/gcj/tools/gcj_dbtool/natMain.cc rewrite libjava/gnu/java/awt/color/CieXyzConverter.java (67%) rewrite libjava/gnu/java/awt/color/ColorSpaceConverter.java (63%) rewrite libjava/gnu/java/awt/color/PyccConverter.java (69%) create mode 100644 libjava/gnu/java/awt/peer/gtk/GtkVolatileImage.java create mode 100644 libjava/gnu/java/net/protocol/https/Handler.java create mode 100644 libjava/gnu/javax/swing/text/html/package.html create mode 100755 libjava/gnu/javax/swing/text/html/parser/HTML_401F.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/gnuDTD.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/htmlAttributeSet.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/htmlValidator.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/models/PCDATAonly_model.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/models/TableRowContentModel.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/models/list.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/models/noTagModel.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/models/node.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/models/package.html create mode 100755 libjava/gnu/javax/swing/text/html/parser/models/transformer.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/package.html create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/Parser.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/gnuStringIntMapper.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/low/Buffer.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/low/Constants.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/low/Location.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/low/ParseException.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/low/Queue.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/low/ReaderTokenizer.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/low/Token.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/low/node.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/low/package.html create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/low/pattern.java create mode 100644 libjava/gnu/javax/swing/text/html/parser/support/package.html create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/parameterDefaulter.java create mode 100755 libjava/gnu/javax/swing/text/html/parser/support/textPreProcessor.java rewrite libjava/gnu/xml/aelfred2/SAXDriver.java (81%) rewrite libjava/gnu/xml/aelfred2/XmlParser.java (92%) rewrite libjava/gnu/xml/aelfred2/XmlReader.java (65%) create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLAnchorElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLAppletElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLAreaElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLBRElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLBaseElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLBaseFontElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLBodyElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLButtonElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLCollection.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLDListElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLDirectoryElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLDivElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLDocument.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLFieldSetElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLFontElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLFormElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLFrameElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLFrameSetElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLHRElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLHeadElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLHeadingElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLHtmlElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLIFrameElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLImageElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLImpl.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLInputElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLIsIndexElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLLIElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLLabelElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLLegendElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLLinkElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLMapElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLMenuElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLMetaElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLModElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLOListElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLObjectElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLOptGroupElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLOptionElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLParagraphElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLParamElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLParser.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLPreElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLQuoteElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLScriptElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLSelectElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLStyleElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTableCaptionElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTableCellElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTableColElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTableElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTableRowElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTableSectionElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTextAreaElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLTitleElement.java create mode 100644 libjava/gnu/xml/dom/html2/DomHTMLUListElement.java create mode 100644 libjava/include/jni_md.h rewrite libjava/java/awt/FontMetrics.java (79%) create mode 100644 libjava/java/lang/StringBuilder.java create mode 100644 libjava/java/lang/natStringBuilder.cc create mode 100644 libjava/java/net/VMNetworkInterface.java delete mode 100644 libjava/java/net/natNetworkInterfaceNoNet.cc delete mode 100644 libjava/java/net/natNetworkInterfacePosix.cc delete mode 100644 libjava/java/net/natNetworkInterfaceWin32.cc create mode 100644 libjava/java/net/natVMNetworkInterfaceNoNet.cc create mode 100644 libjava/java/net/natVMNetworkInterfacePosix.cc create mode 100644 libjava/java/net/natVMNetworkInterfaceWin32.cc create mode 100644 libjava/javax/swing/plaf/metal/MetalBorders.java create mode 100644 libjava/javax/swing/plaf/metal/MetalButtonUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalCheckBoxUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalComboBoxUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalDesktopIconUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalInternalFrameUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalLabelUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalPopupMenuSeparatorUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalProgressBarUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalRadioButtonUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalRootPaneUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalScrollBarUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalScrollPaneUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalSeparatorUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalSliderUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalSplitPaneUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalTabbedPaneUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalTextFieldUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalToggleButtonUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalToolBarUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalToolTipUI.java create mode 100644 libjava/javax/swing/plaf/metal/MetalTreeUI.java create mode 100644 libjava/javax/swing/text/ChangedCharSetException.java create mode 100644 libjava/javax/swing/text/html/HTMLDocument.java create mode 100755 libjava/javax/swing/text/html/HTMLEditorKit.java create mode 100644 libjava/javax/swing/text/html/HTMLFrameHyperlinkEvent.java create mode 100755 libjava/javax/swing/text/html/parser/AttributeList.java create mode 100755 libjava/javax/swing/text/html/parser/ContentModel.java create mode 100755 libjava/javax/swing/text/html/parser/DTD.java create mode 100755 libjava/javax/swing/text/html/parser/DTDConstants.java create mode 100644 libjava/javax/swing/text/html/parser/DocumentParser.java create mode 100755 libjava/javax/swing/text/html/parser/Element.java create mode 100644 libjava/javax/swing/text/html/parser/Entity.java create mode 100755 libjava/javax/swing/text/html/parser/Parser.java create mode 100755 libjava/javax/swing/text/html/parser/TagElement.java create mode 100644 libjava/javax/swing/text/rtf/ControlWordToken.java create mode 100644 libjava/javax/swing/text/rtf/RTFEditorKit.java create mode 100644 libjava/javax/swing/text/rtf/RTFParseException.java create mode 100644 libjava/javax/swing/text/rtf/RTFParser.java create mode 100644 libjava/javax/swing/text/rtf/RTFScanner.java create mode 100644 libjava/javax/swing/text/rtf/TextToken.java create mode 100644 libjava/javax/swing/text/rtf/Token.java delete mode 100644 libjava/scripts/TexinfoDoclet.java create mode 100644 libjava/testsuite/libjava.compile/pr21519.java create mode 100644 libjava/testsuite/libjava.compile/pr21519.no-link create mode 100644 libjava/testsuite/libjava.lang/bytearray.java create mode 100644 libjava/testsuite/libjava.lang/bytearray.out create mode 100644 libjava/testsuite/libjava.special/pr21115.java create mode 100644 libjava/testsuite/libjava.special/pr21115.out create mode 100644 libjava/testsuite/libjava.special/pr21115I.java create mode 100644 libjava/testsuite/libjava.special/special.exp create mode 100644 libmudflap/testsuite/libmudflap.c++/pass57-frag.cxx delete mode 100644 libstdc++-v3/acconfig.h create mode 100644 libstdc++-v3/include/tr1/bind_iterate.h create mode 100644 libstdc++-v3/include/tr1/bind_repeat.h create mode 100644 libstdc++-v3/include/tr1/boost_shared_ptr.h rewrite libstdc++-v3/include/tr1/memory (92%) create mode 100644 libstdc++-v3/include/tr1/mu_iterate.h create mode 100644 libstdc++-v3/include/tr1/ref_fwd.h rewrite libstdc++-v3/include/tr1/tuple (96%) create mode 100644 libstdc++-v3/include/tr1/tuple_iterate.h delete mode 100755 libstdc++-v3/scripts/check_survey.in create mode 100644 libstdc++-v3/scripts/gen_bind_includers.pl create mode 100644 libstdc++-v3/scripts/gen_includers.pl create mode 100644 libstdc++-v3/testsuite/22_locale/money_get/3.cc create mode 100644 libstdc++-v3/testsuite/22_locale/money_put/3.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/3.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/char/16.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/16.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/3.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/put/char/20909.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/put/char/20914.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/20909.cc create mode 100644 libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/20914.cc create mode 100644 libstdc++-v3/testsuite/23_containers/bitset/18604.cc create mode 100644 libstdc++-v3/testsuite/23_containers/deque/18604.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/18604.cc create mode 100644 libstdc++-v3/testsuite/23_containers/map/18604.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/18604.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/18604.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/bool/21244.cc create mode 100644 libstdc++-v3/testsuite/25_algorithms/iter_swap/20577.cc rewrite libstdc++-v3/testsuite/27_io/basic_ios/imbue/14072.cc (62%) delete mode 100644 libstdc++-v3/testsuite/abi_check.cc create mode 100644 libstdc++-v3/testsuite/libstdc++-abi/abi.exp delete mode 100644 libstdc++-v3/testsuite/printnow.c create mode 100644 libstdc++-v3/testsuite/testsuite_abi_check.cc create mode 100644 libstdc++-v3/testsuite/testsuite_character.cc create mode 100644 libstdc++-v3/testsuite/tr1/3_function_objects/bind/all_bound.cc create mode 100644 libstdc++-v3/testsuite/tr1/3_function_objects/bind/nested.cc create mode 100644 libstdc++-v3/testsuite/tr1/3_function_objects/bind/placeholders.cc create mode 100644 libstdc++-v3/testsuite/tr1/3_function_objects/bind/ref.cc diff --git a/ChangeLog b/ChangeLog index 9b49eabf8d5..7b69b1e8c8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,160 @@ +2005-05-19 Paul Brook + + * configure.in: Rewrite misleading error message when requested + language cannot be built. + * configure: Regenerate. + +2005-05-15 Daniel Jacobowitz + + * ylwrap: Import from Automake 1.9.5. + +2005-05-13 David Ung + + * MAINTAINERS (Write After Approval): Add self. + +2005-05-09 Mike Stump + + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Use quotes on + lt_cv_sys_max_cmd_len for now. + +2005-05-09 Stan Cox + + * MAINTAINERS: Remove self, add Nick Clifton as iq2000 maintainer. + +2005-05-08 Matt Kraai + + * README.SCO: Update the URL. + +2005-05-05 David Edelsohn + + * ltconfig: Define file_list_spec. Pass file_list_spec and + with_gnu_ld to libtool. + * ltcf-c.sh (aix[45]): Define file_list_spec. + * ltcf-cxx.sh (aix[45]): Same. + * ltcf-gcj.sh (aix[45]): Same. + * ltmain.sh: If command exceeds max_cmd_len and file_list_spec + exists, write list of input files to temporary file. + +2005-05-04 Mike Stump + + * configure.in: Always pass --target to target configures as + otherwise rebuilds that do --recheck will fail. + * confiugure: Rebuilt. + +2005-05-04 Paolo Bonzini + + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Rename from + STAGE_HOST_EXPORTS. + (configure, all): Add bootstrap support. + (Host modules, target modules): Pass post-stage1 flags and exports. + (Top-level bootstrap): Remove bootstrap rules, expanded elsewhere. + * Makefile.in: Regenerate. + +2005-04-29 Paolo Bonzini + + * configure: Regenerate. + +2005-04-27 Mike Stump + + * MAINTAINERS: Add self as darwin maintainer. + +2005-04-22 Bernd Schmidt + + * config.sub: Update from master copy. + +2005-04-21 Mike Stump + + * MAINTAINERS: Add self as Objective-C/Objective-C++ maintainer. + * MAINTAINERS: Add Zem as Objective-C++ maintainer. + +2005-04-19 Hans-Peter Nilsson + + * configure.in : New local variable + libgcj_ex_libffi. Have specific match for *-*-linux*. Separate + matches for "*-*-aout" and "*-*-elf". Don't disable libffi for + "*-*-elf" and "*-*-linux*". + * configure: Regenerate. + +2005-04-14 Joseph S. Myers + + * MAINTAINERS (Various Maintainers): Add self as i18n maintainer. + +2005-04-12 Mike Stump + + * libtool.m4: Update AC_LIBTOOL_SYS_MAX_CMD_LEN bits from upstream. + +2005-04-04 Thomas Koenig + + * MAINTAINERS (Write After Approval): Add myself. + +2005-04-07 Bernd Schmidt + + * MAINTAINERS (Port Maintainers): Add self for Blackfin. + +2005-04-06 Paolo Bonzini + + * Makefile.tpl (BUILD_CONFIGARGS): Include --with-build-subdir. + (TARGET_CONFIGARGS): Include --with-target-subdir. + (configure, all): New macros. Use them throughout. + * Makefile.in: Regenerate. + +2005-04-04 Jon Grimm + + * MAINTAINERS (Write After Approval): Add myself. + +2005-03-31 Zdenek Dvorak + + * MAINTAINERS: Remove 'loop unrolling' maintainer. + +2005-03-30 Gerald Pfeifer + + * MAINTAINERS: Move John Carr to Write After Approval. + +2005-03-30 J"orn Rennecke + + * config/mh-mingw32: Delete. + * configure.in: Don't use it. + * configure: Regenerate. + +2005-03-31 Paolo Bonzini + + * Makefile.def (bfd, opcodes, libstdc++-v3, libmudflap): Set lib_path. + * Makefile.tpl (SET_LIB_PATH, REALLY_SET_LIB_PATH): Remove. + (HOST_EXPORTS, STAGE_HOST_EXPORTS, TARGET_EXPORTS): Set $(RPATH_ENVVAR). + (HOST_LIB_PATH): Generate from Makefile.def. + (TARGET_LIB_PATH): Likewise. + (Old bootstrap targets): Include TARGET_LIB_PATH into RPATH_ENVVAR. + * Makefile.in: Regenerate. + * configure.in (set_lib_path, SET_LIB_PATH, SET_GCC_LIB_PATH): Remove. + (RPATH_ENVVAR): Include Darwin case. + * configure: Regenerate. + +2005-03-29 Thomas Fitzsimmons + + * MAINTAINERS (Various Maintainers): Remove self. + (Write After Approval): Add self. + +2005-03-26 Thomas Fitzsimmons + + * MAINTAINERS (Various Maintainers): Add self. + +2005-03-25 Paolo Bonzini + + * configure.in (RPATH_ENVVAR): Set to DYLD_LIBRARY_PATH on Darwin. + * configure: Regenerate. + +2005-03-21 Zack Weinberg + + * Makefile.def: Remove libstdcxx_incdir, libsubdir, gxx_include_dir, + gcc_version, and gcc_version_trigger from set of flags to pass. + * Makefile.tpl: Remove definitions of above variables. + (config.status): Remove dependency on $(gcc_version_trigger). + * Makefile.in: Regenerate. + * configure.in: Do not reference config/gcc-version.m4 nor + config/gxx-include-dir.m4. Do not invoke TL_AC_GCC_VERSION nor + TL_AC_GXX_INCLUDE_DIR. Do not set gcc_version_trigger. + * configure: Regenerate. + 2005-03-16 Manfred Hollstein Andrew Pinski @@ -380,7 +537,7 @@ 2004-10-05 Tomer Levi * configure.in: Enable target-libgloss for crx-*-*. - * configure: Regenerate. + * configure: Regenerate. 2004-10-04 Kazu Hirata @@ -592,7 +749,7 @@ * configure.in: add test for powerpc-*-darwin* to specify makefile frag * configure: regenerate * config/mh-ppc-darwin: create file, override BOOT_CFLAGS for - -mdynamic-no-pic + -mdynamic-no-pic 2004-08-31 Paolo Bonzini diff --git a/MAINTAINERS b/MAINTAINERS index 32579796fec..5c0811fd1e7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -42,6 +42,7 @@ arm port Richard Earnshaw rearnsha@arm.com arm port Paul Brook paul@codesourcery.com avr port Denis Chertykov denisc@overta.ru avr port Marek Michalkiewicz marekm@amelek.gda.pl +bfin port Bernd Schmidt bernd.schmidt@analog.com c4x port Michael Hayes m.hayes@elec.canterbury.ac.nz cris port Hans-Peter Nilsson hp@axis.com fr30 port Nick Clifton nickc@redhat.com @@ -55,7 +56,7 @@ i386 port Richard Henderson rth@redhat.com i860 port Jason Eckhardt jle@rice.edu ia64 port Jim Wilson wilson@specifixinc.com ip2k port Denis Chertykov denisc@overta.ru -iq2000 port Stan Cox scox@redhat.com +iq2000 port Nick Clifton nickc@redhat.com m32r port Nick Clifton nickc@redhat.com m68hc11 port Stephane Carrez stcarrez@nerim.fr m68k port (?) Jeff Law law@redhat.com @@ -88,8 +89,9 @@ xtensa port Bob Wilson bob.wilson@acm.org OS Port Maintainers (OS alphabetical order) -darwin port Stan Shebs shebs@apple.com darwin port Dale Johannesen dalej@apple.com +darwin port Mike Stump mrs@apple.com +darwin port Stan Shebs shebs@apple.com DJGPP DJ Delorie dj@delorie.com freebsd Loren J. Rittle ljrittle@acm.org netbsd Jason Thorpe thorpej@netbsd.org @@ -120,7 +122,8 @@ java Andrew Haley aph@redhat.com mercury Fergus Henderson fjh@cs.mu.oz.au objective-c Stan Shebs shebs@apple.com objective-c Ovidiu Predescu ovidiu@cup.hp.com -objective-c Ziemowit Laski zlaski@apple.com +objective-c/c++ Ziemowit Laski zlaski@apple.com +objective-c/c++ Mike Stump mrs@apple.com treelang Tim Josling tej@melbpc.org.au treelang James A. Morrison phython@gcc.gnu.org @@ -133,8 +136,6 @@ libgcj Tom Tromey tromey@redhat.com libgcj Bryce McKinlay bryce@gcc.gnu.org libobjc Nicola Pero n.pero@mi.flashnet.it libobjc Andrew Pinski pinskia@physics.uc.edu -alias analysis John Carr jfc@mit.edu -loop unrolling Jim Wilson wilson@specifixinc.com loop discovery Michael Hayes m.hayes@elec.canterbury.ac.nz scheduler (+ haifa) Jim Wilson wilson@specifixinc.com scheduler (+ haifa) Michael Meissner gnu@the-meissners.org @@ -162,6 +163,7 @@ build status lists Janis Johnson janis187@us.ibm.com config.sub/config.guess Ben Elliston config-patches@gnu.org basic block reordering Jason Eckhardt jle@rice.edu i18n Philipp Thomas pthomas@suse.de +i18n Joseph Myers jsm@polyomino.org.uk diagnostic messages Gabriel Dos Reis gdr@integrable-solutions.net libiberty DJ Delorie dj@redhat.com libiberty Ian Lance Taylor ian@airs.com @@ -181,8 +183,12 @@ middle-end Roger Sayle roger@eyesopen.com tree-ssa Diego Novillo dnovillo@redhat.com tree-ssa Andrew MacLeod amacleod@redhat.com PRE, points-to Daniel Berlin dberlin@dberlin.org +code sinking Daniel Berlin dberlin@dberlin.org mudflap Frank Ch. Eigler fche@redhat.com tree browser/unparser Sebastian Pop pop@cri.ensmp.fr +scev, data dependence Daniel Berlin dberlin@dberlin.org +scev, data dependence Sebastian Pop pop@cri.ensmp.fr +linear loop transforms Daniel Berlin dberlin@dberlin.org profile feedback Jan Hubicka jh@suse.cz type-safe vectors Nathan Sidwell nathan@codesourcery.com @@ -212,6 +218,7 @@ Robert Bowdidge bowdidge@apple.com Joel Brobecker brobecker@gnat.com Kevin Buettner kevinb@redhat.com Andrew Cagney cagney@redhat.com +John Carr jfc@mit.edu Steve Chamberlain sac@transmeta.com Michael Chastain mec.gnu@mindspring.com Chandra Chavva cchavva@redhat.com @@ -228,11 +235,13 @@ Mohan Embar gnustuff@thisiscool.com Marc Espie espie@cvs.openbsd.org Ansgar Esztermann ansgar@thphy.uni-duesseldorf.de Doug Evans dje@transmeta.com +Thomas Fitzsimmons fitzsim@redhat.com Brian Ford ford@vss.fsi.com Kaveh Ghazi ghazi@caip.rutgers.edu Matthew Gingell gingell@gnat.com Anthony Green green@redhat.com Doug Gregor doug.gregor@gmail.com +Jon Grimm jgrimm2@us.ibm.com Richard Guenther rguenth@gcc.gnu.org Laurent Guerby laurent@guerby.net Mostafa Hagog hagog@gcc.gnu.org @@ -252,6 +261,7 @@ Mumit Khan khan@xraylith.wisc.edu Matthias Klose doko@debian.org Jeff Knaggs jknaggs@redhat.com Michael Koch konqueror@gmx.de +Thomas Koenig Thomas.Koenig@online.de Matt Kraai kraai@ftbfs.org Scott Robert Ladd scott.ladd@coyotegulch.com Razya Ladelsky razya@gcc.gnu.org @@ -308,6 +318,7 @@ Jeff Sturm jsturm@gcc.gnu.org Kresten Krab Thorup krab@gcc.gnu.org Caroline Tice ctice@apple.com Michael Tiemann tiemann@redhat.com +David Ung davidu@mips.com Jonathan Wakely redi@gcc.gnu.org Krister Walfridsson cato@df.lth.se Feng Wang fengwang@nudt.edu.cn diff --git a/Makefile.def b/Makefile.def index 3565f98320d..e338aa8599a 100644 --- a/Makefile.def +++ b/Makefile.def @@ -37,8 +37,8 @@ host_modules= { module= ash; }; host_modules= { module= autoconf; }; host_modules= { module= automake; }; host_modules= { module= bash; }; -host_modules= { module= bfd; bootstrap=true; }; -host_modules= { module= opcodes; bootstrap=true; }; +host_modules= { module= bfd; lib_path=.; bootstrap=true; }; +host_modules= { module= opcodes; lib_path=.; bootstrap=true; }; host_modules= { module= binutils; bootstrap=true; }; host_modules= { module= bison; no_check_cross= true; }; host_modules= { module= byacc; no_check_cross= true; }; @@ -113,8 +113,8 @@ host_modules= { module= libtermcap; no_check=true; host_modules= { module= utils; no_check=true; }; host_modules= { module= gnattools; }; -target_modules = { module= libstdc++-v3; raw_cxx=true; }; -target_modules = { module= libmudflap; }; +target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; }; +target_modules = { module= libmudflap; lib_path=.libs; }; target_modules = { module= newlib; }; target_modules = { module= libgfortran; }; target_modules = { module= libobjc; }; @@ -172,8 +172,6 @@ flags_to_pass = { flag= infodir ; }; flags_to_pass = { flag= libdir ; }; flags_to_pass = { flag= libexecdir ; }; flags_to_pass = { flag= lispdir ; }; -flags_to_pass = { flag= libstdcxx_incdir ; }; -flags_to_pass = { flag= libsubdir ; }; flags_to_pass = { flag= localstatedir ; }; flags_to_pass = { flag= mandir ; }; flags_to_pass = { flag= oldincludedir ; }; @@ -183,9 +181,6 @@ flags_to_pass = { flag= sharedstatedir ; }; flags_to_pass = { flag= sysconfdir ; }; flags_to_pass = { flag= tooldir ; }; flags_to_pass = { flag= build_tooldir ; }; -flags_to_pass = { flag= gxx_include_dir ; }; -flags_to_pass = { flag= gcc_version ; }; -flags_to_pass = { flag= gcc_version_trigger ; }; flags_to_pass = { flag= target_alias ; }; // Build tools diff --git a/Makefile.in b/Makefile.in index 84c36bb414b..7d6a55938bb 100644 --- a/Makefile.in +++ b/Makefile.in @@ -72,45 +72,25 @@ LN_S = @LN_S@ # Miscellaneous non-standard autoconf-set variables # ------------------------------------------------- -# The file containing GCC's version number. -gcc_version_trigger = @gcc_version_trigger@ -gcc_version = @gcc_version@ - # The gcc driver likes to know the arguments it was configured with. TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ -gxx_include_dir = @gxx_include_dir@ -libstdcxx_incdir = @libstdcxx_incdir@ - tooldir = @tooldir@ build_tooldir = @build_tooldir@ -# Directory in which the compiler finds executables, libraries, etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) GDB_NLM_DEPS = # This is the name of the environment variable used for the path to # the libraries. RPATH_ENVVAR = @RPATH_ENVVAR@ -# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared -# was used. -SET_LIB_PATH = @SET_LIB_PATH@ - -# configure.in sets SET_LIB_PATH to this if --enable-shared was used. -# Some platforms don't like blank entries, so we remove duplicate, -# leading and trailing colons. -REALLY_SET_LIB_PATH = \ - @SET_GCC_LIB_PATH@ \ - $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); - # This is the list of directories to be built for the build system. BUILD_CONFIGDIRS = libiberty # Build programs are put under this directory. BUILD_SUBDIR = @build_subdir@ # This is set by the configure script to the arguments to use when configuring # directories built for the build system. -BUILD_CONFIGARGS = @build_configargs@ +BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)" # This is the list of variables to export in the environment when # configuring any subdirectory. It must also be exported whenever @@ -175,11 +155,11 @@ HOST_EXPORTS = \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ - SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \ - @SET_GCC_LIB_PATH@ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); # Similar, for later GCC stages. -STAGE_HOST_EXPORTS = \ +POSTSTAGE1_HOST_EXPORTS = \ + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ $(HOST_EXPORTS) \ CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \ @@ -195,7 +175,7 @@ TARGET_CONFIGDIRS = @target_configdirs@ TARGET_SUBDIR = @target_subdir@ # This is set by the configure script to the arguments to use when configuring # directories built for the target. -TARGET_CONFIGARGS = @target_configargs@ +TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)" # This is the list of variables to export in the environment when # configuring subdirectories for the host system. BASE_TARGET_EXPORTS = \ @@ -215,8 +195,7 @@ BASE_TARGET_EXPORTS = \ NM="$(NM_FOR_TARGET)"; export NM; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \ - @SET_GCC_LIB_PATH@ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); RAW_CXX_TARGET_EXPORTS = \ $(BASE_TARGET_EXPORTS) \ @@ -322,10 +301,6 @@ RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ # Programs producing files for the HOST machine # --------------------------------------------- -# This is the list of directories that may be needed in RPATH_ENVVAR -# so that programs built for the host machine work. -HOST_LIB_PATH = $$r/$(HOST_SUBDIR)/bfd:$$r/$(HOST_SUBDIR)/opcodes - AS = @AS@ AR = @AR@ @@ -356,10 +331,6 @@ PICFLAG = # Programs producing files for the TARGET machine # ----------------------------------------------- -# This is the list of directories that may be needed in RPATH_ENVVAR -# so that prorgams built for the target machine work. -TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs - FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ AR_FOR_TARGET=@AR_FOR_TARGET@ @@ -507,6 +478,41 @@ PICFLAG_FOR_TARGET = @host_makefile_frag@ ### +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that prorgams built for the target machine work. +TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(HOST_LIB_PATH_gcc) + +@if target-libstdc++-v3 +TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/.libs: +@endif target-libstdc++-v3 + +@if target-libmudflap +TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs: +@endif target-libmudflap + + + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the host machine work. +HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes) + +# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch +@if gcc +HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc: +@endif gcc + + +@if bfd +HOST_LIB_PATH_bfd = \ + $$r/$(HOST_SUBDIR)/bfd/.:$$r/$(HOST_SUBDIR)/prev-bfd/.: +@endif bfd + +@if opcodes +HOST_LIB_PATH_opcodes = \ + $$r/$(HOST_SUBDIR)/opcodes/.:$$r/$(HOST_SUBDIR)/prev-opcodes/.: +@endif opcodes + + # Flags to pass down to all sub-makes. BASE_FLAGS_TO_PASS = \ "DESTDIR=$(DESTDIR)" \ @@ -520,8 +526,6 @@ BASE_FLAGS_TO_PASS = \ "libdir=$(libdir)" \ "libexecdir=$(libexecdir)" \ "lispdir=$(lispdir)" \ - "libstdcxx_incdir=$(libstdcxx_incdir)" \ - "libsubdir=$(libsubdir)" \ "localstatedir=$(localstatedir)" \ "mandir=$(mandir)" \ "oldincludedir=$(oldincludedir)" \ @@ -531,9 +535,6 @@ BASE_FLAGS_TO_PASS = \ "sysconfdir=$(sysconfdir)" \ "tooldir=$(tooldir)" \ "build_tooldir=$(build_tooldir)" \ - "gxx_include_dir=$(gxx_include_dir)" \ - "gcc_version=$(gcc_version)" \ - "gcc_version_trigger=$(gcc_version_trigger)" \ "target_alias=$(target_alias)" \ "BISON=$(BISON)" \ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ @@ -2141,7 +2142,6 @@ uninstall: install.all: install-no-fixedincludes @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD_COMMAND}` ; export r ; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd ./gcc && \ $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ @@ -2185,15 +2185,24 @@ etags tags: TAGS # built are. TAGS: do-TAGS +# ------------------------------------ +# Macros for configure and all targets +# ------------------------------------ + + + + + # -------------------------------------- # Modules which run on the build machine # -------------------------------------- + .PHONY: configure-build-libiberty maybe-configure-build-libiberty maybe-configure-build-libiberty: @if build-libiberty maybe-configure-build-libiberty: configure-build-libiberty -configure-build-libiberty: +configure-build-libiberty: @test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libiberty ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2210,11 +2219,14 @@ configure-build-libiberty: libsrcdir="$$s/libiberty"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-libiberty + + + + .PHONY: all-build-libiberty maybe-all-build-libiberty maybe-all-build-libiberty: @if build-libiberty @@ -2225,14 +2237,18 @@ all-build-libiberty: configure-build-libiberty s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/libiberty && \ - $(MAKE) $(TARGET-build-libiberty)) + $(MAKE) $(TARGET-build-libiberty)) @endif build-libiberty + + + + .PHONY: configure-build-bison maybe-configure-build-bison maybe-configure-build-bison: @if build-bison maybe-configure-build-bison: configure-build-bison -configure-build-bison: +configure-build-bison: @test ! -f $(BUILD_SUBDIR)/bison/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/bison ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2249,11 +2265,14 @@ configure-build-bison: libsrcdir="$$s/bison"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-bison + + + + .PHONY: all-build-bison maybe-all-build-bison maybe-all-build-bison: @if build-bison @@ -2264,14 +2283,18 @@ all-build-bison: configure-build-bison s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/bison && \ - $(MAKE) $(TARGET-build-bison)) + $(MAKE) $(TARGET-build-bison)) @endif build-bison + + + + .PHONY: configure-build-byacc maybe-configure-build-byacc maybe-configure-build-byacc: @if build-byacc maybe-configure-build-byacc: configure-build-byacc -configure-build-byacc: +configure-build-byacc: @test ! -f $(BUILD_SUBDIR)/byacc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/byacc ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2288,11 +2311,14 @@ configure-build-byacc: libsrcdir="$$s/byacc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-byacc + + + + .PHONY: all-build-byacc maybe-all-build-byacc maybe-all-build-byacc: @if build-byacc @@ -2303,14 +2329,18 @@ all-build-byacc: configure-build-byacc s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/byacc && \ - $(MAKE) $(TARGET-build-byacc)) + $(MAKE) $(TARGET-build-byacc)) @endif build-byacc + + + + .PHONY: configure-build-flex maybe-configure-build-flex maybe-configure-build-flex: @if build-flex maybe-configure-build-flex: configure-build-flex -configure-build-flex: +configure-build-flex: @test ! -f $(BUILD_SUBDIR)/flex/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/flex ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2327,11 +2357,14 @@ configure-build-flex: libsrcdir="$$s/flex"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-flex + + + + .PHONY: all-build-flex maybe-all-build-flex maybe-all-build-flex: @if build-flex @@ -2342,14 +2375,18 @@ all-build-flex: configure-build-flex s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/flex && \ - $(MAKE) $(TARGET-build-flex)) + $(MAKE) $(TARGET-build-flex)) @endif build-flex + + + + .PHONY: configure-build-m4 maybe-configure-build-m4 maybe-configure-build-m4: @if build-m4 maybe-configure-build-m4: configure-build-m4 -configure-build-m4: +configure-build-m4: @test ! -f $(BUILD_SUBDIR)/m4/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/m4 ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2366,11 +2403,14 @@ configure-build-m4: libsrcdir="$$s/m4"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-m4 + + + + .PHONY: all-build-m4 maybe-all-build-m4 maybe-all-build-m4: @if build-m4 @@ -2381,14 +2421,18 @@ all-build-m4: configure-build-m4 s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/m4 && \ - $(MAKE) $(TARGET-build-m4)) + $(MAKE) $(TARGET-build-m4)) @endif build-m4 + + + + .PHONY: configure-build-texinfo maybe-configure-build-texinfo maybe-configure-build-texinfo: @if build-texinfo maybe-configure-build-texinfo: configure-build-texinfo -configure-build-texinfo: +configure-build-texinfo: @test ! -f $(BUILD_SUBDIR)/texinfo/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/texinfo ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2405,11 +2449,14 @@ configure-build-texinfo: libsrcdir="$$s/texinfo"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-texinfo + + + + .PHONY: all-build-texinfo maybe-all-build-texinfo maybe-all-build-texinfo: @if build-texinfo @@ -2420,14 +2467,18 @@ all-build-texinfo: configure-build-texinfo s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/texinfo && \ - $(MAKE) $(TARGET-build-texinfo)) + $(MAKE) $(TARGET-build-texinfo)) @endif build-texinfo + + + + .PHONY: configure-build-fixincludes maybe-configure-build-fixincludes maybe-configure-build-fixincludes: @if build-fixincludes maybe-configure-build-fixincludes: configure-build-fixincludes -configure-build-fixincludes: +configure-build-fixincludes: @test ! -f $(BUILD_SUBDIR)/fixincludes/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/fixincludes ; \ r=`${PWD_COMMAND}`; export r; \ @@ -2444,11 +2495,14 @@ configure-build-fixincludes: libsrcdir="$$s/fixincludes"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif build-fixincludes + + + + .PHONY: all-build-fixincludes maybe-all-build-fixincludes maybe-all-build-fixincludes: @if build-fixincludes @@ -2459,26 +2513,30 @@ all-build-fixincludes: configure-build-fixincludes s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(BUILD_EXPORTS) \ (cd $(BUILD_SUBDIR)/fixincludes && \ - $(MAKE) $(TARGET-build-fixincludes)) + $(MAKE) $(TARGET-build-fixincludes)) @endif build-fixincludes + + + # -------------------------------------- # Modules which run on the host machine # -------------------------------------- + .PHONY: configure-ash maybe-configure-ash maybe-configure-ash: @if ash maybe-configure-ash: configure-ash -configure-ash: +configure-ash: @test ! -f $(HOST_SUBDIR)/ash/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ash ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in ash; \ - cd $(HOST_SUBDIR)/ash || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/ash; \ + cd "$(HOST_SUBDIR)/ash" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/ash/ | \ @@ -2491,6 +2549,10 @@ configure-ash: || exit 1 @endif ash + + + + .PHONY: all-ash maybe-all-ash maybe-all-ash: @if ash @@ -2499,12 +2561,14 @@ maybe-all-ash: all-ash all-ash: configure-ash @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/ash && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-ash)) @endif ash + + + .PHONY: check-ash maybe-check-ash maybe-check-ash: @if ash @@ -2513,7 +2577,6 @@ maybe-check-ash: check-ash check-ash: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/ash && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -2528,7 +2591,6 @@ maybe-install-ash: install-ash install-ash: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/ash && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -2547,7 +2609,6 @@ info-ash: \ @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2573,7 +2634,6 @@ dvi-ash: \ @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2599,7 +2659,6 @@ html-ash: \ @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2625,7 +2684,6 @@ TAGS-ash: \ @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2652,7 +2710,6 @@ install-info-ash: \ @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2678,7 +2735,6 @@ installcheck-ash: \ @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2703,7 +2759,6 @@ mostlyclean-ash: @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2728,7 +2783,6 @@ clean-ash: @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2753,7 +2807,6 @@ distclean-ash: @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2778,7 +2831,6 @@ maintainer-clean-ash: @[ -f ./ash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2795,18 +2847,19 @@ maintainer-clean-ash: @endif ash + .PHONY: configure-autoconf maybe-configure-autoconf maybe-configure-autoconf: @if autoconf maybe-configure-autoconf: configure-autoconf -configure-autoconf: +configure-autoconf: @test ! -f $(HOST_SUBDIR)/autoconf/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/autoconf ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in autoconf; \ - cd $(HOST_SUBDIR)/autoconf || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/autoconf; \ + cd "$(HOST_SUBDIR)/autoconf" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/autoconf/ | \ @@ -2819,6 +2872,10 @@ configure-autoconf: || exit 1 @endif autoconf + + + + .PHONY: all-autoconf maybe-all-autoconf maybe-all-autoconf: @if autoconf @@ -2827,12 +2884,14 @@ maybe-all-autoconf: all-autoconf all-autoconf: configure-autoconf @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/autoconf && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-autoconf)) @endif autoconf + + + .PHONY: check-autoconf maybe-check-autoconf maybe-check-autoconf: @if autoconf @@ -2841,7 +2900,6 @@ maybe-check-autoconf: check-autoconf check-autoconf: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/autoconf && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -2856,7 +2914,6 @@ maybe-install-autoconf: install-autoconf install-autoconf: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/autoconf && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -2875,7 +2932,6 @@ info-autoconf: \ @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2901,7 +2957,6 @@ dvi-autoconf: \ @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2927,7 +2982,6 @@ html-autoconf: \ @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2953,7 +3007,6 @@ TAGS-autoconf: \ @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -2980,7 +3033,6 @@ install-info-autoconf: \ @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3006,7 +3058,6 @@ installcheck-autoconf: \ @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3031,7 +3082,6 @@ mostlyclean-autoconf: @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3056,7 +3106,6 @@ clean-autoconf: @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3081,7 +3130,6 @@ distclean-autoconf: @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3106,7 +3154,6 @@ maintainer-clean-autoconf: @[ -f ./autoconf/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3123,18 +3170,19 @@ maintainer-clean-autoconf: @endif autoconf + .PHONY: configure-automake maybe-configure-automake maybe-configure-automake: @if automake maybe-configure-automake: configure-automake -configure-automake: +configure-automake: @test ! -f $(HOST_SUBDIR)/automake/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/automake ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in automake; \ - cd $(HOST_SUBDIR)/automake || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/automake; \ + cd "$(HOST_SUBDIR)/automake" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/automake/ | \ @@ -3147,6 +3195,10 @@ configure-automake: || exit 1 @endif automake + + + + .PHONY: all-automake maybe-all-automake maybe-all-automake: @if automake @@ -3155,12 +3207,14 @@ maybe-all-automake: all-automake all-automake: configure-automake @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/automake && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-automake)) @endif automake + + + .PHONY: check-automake maybe-check-automake maybe-check-automake: @if automake @@ -3169,7 +3223,6 @@ maybe-check-automake: check-automake check-automake: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/automake && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -3184,7 +3237,6 @@ maybe-install-automake: install-automake install-automake: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/automake && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -3203,7 +3255,6 @@ info-automake: \ @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3229,7 +3280,6 @@ dvi-automake: \ @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3255,7 +3305,6 @@ html-automake: \ @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3281,7 +3330,6 @@ TAGS-automake: \ @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3308,7 +3356,6 @@ install-info-automake: \ @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3334,7 +3381,6 @@ installcheck-automake: \ @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3359,7 +3405,6 @@ mostlyclean-automake: @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3384,7 +3429,6 @@ clean-automake: @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3409,7 +3453,6 @@ distclean-automake: @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3434,7 +3477,6 @@ maintainer-clean-automake: @[ -f ./automake/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3451,18 +3493,19 @@ maintainer-clean-automake: @endif automake + .PHONY: configure-bash maybe-configure-bash maybe-configure-bash: @if bash maybe-configure-bash: configure-bash -configure-bash: +configure-bash: @test ! -f $(HOST_SUBDIR)/bash/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bash ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in bash; \ - cd $(HOST_SUBDIR)/bash || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/bash; \ + cd "$(HOST_SUBDIR)/bash" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/bash/ | \ @@ -3475,6 +3518,10 @@ configure-bash: || exit 1 @endif bash + + + + .PHONY: all-bash maybe-all-bash maybe-all-bash: @if bash @@ -3483,12 +3530,14 @@ maybe-all-bash: all-bash all-bash: configure-bash @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bash && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bash)) @endif bash + + + .PHONY: check-bash maybe-check-bash maybe-check-bash: @if bash @@ -3497,7 +3546,6 @@ maybe-check-bash: check-bash check-bash: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bash && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -3512,7 +3560,6 @@ maybe-install-bash: install-bash install-bash: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bash && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -3531,7 +3578,6 @@ info-bash: \ @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3557,7 +3603,6 @@ dvi-bash: \ @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3583,7 +3628,6 @@ html-bash: \ @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3609,7 +3653,6 @@ TAGS-bash: \ @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3636,7 +3679,6 @@ install-info-bash: \ @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3662,7 +3704,6 @@ installcheck-bash: \ @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3687,7 +3728,6 @@ mostlyclean-bash: @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3712,7 +3752,6 @@ clean-bash: @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3737,7 +3776,6 @@ distclean-bash: @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3762,7 +3800,6 @@ maintainer-clean-bash: @[ -f ./bash/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3779,19 +3816,20 @@ maintainer-clean-bash: @endif bash + .PHONY: configure-bfd maybe-configure-bfd maybe-configure-bfd: @if bfd maybe-configure-bfd: configure-bfd -configure-bfd: +configure-bfd: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in bfd; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/bfd; \ + cd "$(HOST_SUBDIR)/bfd" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ @@ -3804,6 +3842,161 @@ configure-bfd: || exit 1 @endif bfd + + +.PHONY: configure-stage1-bfd maybe-configure-stage1-bfd +maybe-configure-stage1-bfd: +@if bfd-bootstrap +maybe-configure-stage1-bfd: configure-stage1-bfd +configure-stage1-bfd: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif bfd-bootstrap + +.PHONY: configure-stage2-bfd maybe-configure-stage2-bfd +maybe-configure-stage2-bfd: +@if bfd-bootstrap +maybe-configure-stage2-bfd: configure-stage2-bfd +configure-stage2-bfd: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif bfd-bootstrap + +.PHONY: configure-stage3-bfd maybe-configure-stage3-bfd +maybe-configure-stage3-bfd: +@if bfd-bootstrap +maybe-configure-stage3-bfd: configure-stage3-bfd +configure-stage3-bfd: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif bfd-bootstrap + +.PHONY: configure-stage4-bfd maybe-configure-stage4-bfd +maybe-configure-stage4-bfd: +@if bfd-bootstrap +maybe-configure-stage4-bfd: configure-stage4-bfd +configure-stage4-bfd: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif bfd-bootstrap + +.PHONY: configure-stageprofile-bfd maybe-configure-stageprofile-bfd +maybe-configure-stageprofile-bfd: +@if bfd-bootstrap +maybe-configure-stageprofile-bfd: configure-stageprofile-bfd +configure-stageprofile-bfd: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif bfd-bootstrap + +.PHONY: configure-stagefeedback-bfd maybe-configure-stagefeedback-bfd +maybe-configure-stagefeedback-bfd: +@if bfd-bootstrap +maybe-configure-stagefeedback-bfd: configure-stagefeedback-bfd +configure-stagefeedback-bfd: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/bfd ; \ + cd $(HOST_SUBDIR)/bfd || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/bfd"; \ + libsrcdir="$$s/bfd"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif bfd-bootstrap + + + + + .PHONY: all-bfd maybe-all-bfd maybe-all-bfd: @if bfd @@ -3813,12 +4006,188 @@ all-bfd: configure-bfd @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bfd)) @endif bfd + + +.PHONY: all-stage1-bfd maybe-all-stage1-bfd +.PHONY: clean-stage1-bfd maybe-clean-stage1-bfd +maybe-all-stage1-bfd: +maybe-clean-stage1-bfd: +@if bfd-bootstrap +maybe-all-stage1-bfd: all-stage1-bfd +all-stage1: all-stage1-bfd +all-stage1-bfd: configure-stage1-bfd + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-bfd: clean-stage1-bfd +clean-stage1: clean-stage1-bfd +clean-stage1-bfd: + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-bfd/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif bfd-bootstrap + + +.PHONY: all-stage2-bfd maybe-all-stage2-bfd +.PHONY: clean-stage2-bfd maybe-clean-stage2-bfd +maybe-all-stage2-bfd: +maybe-clean-stage2-bfd: +@if bfd-bootstrap +maybe-all-stage2-bfd: all-stage2-bfd +all-stage2: all-stage2-bfd +all-stage2-bfd: configure-stage2-bfd + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-bfd: clean-stage2-bfd +clean-stage2: clean-stage2-bfd +clean-stage2-bfd: + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-bfd/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stage3-bfd maybe-all-stage3-bfd +.PHONY: clean-stage3-bfd maybe-clean-stage3-bfd +maybe-all-stage3-bfd: +maybe-clean-stage3-bfd: +@if bfd-bootstrap +maybe-all-stage3-bfd: all-stage3-bfd +all-stage3: all-stage3-bfd +all-stage3-bfd: configure-stage3-bfd + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-bfd: clean-stage3-bfd +clean-stage3: clean-stage3-bfd +clean-stage3-bfd: + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-bfd/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stage4-bfd maybe-all-stage4-bfd +.PHONY: clean-stage4-bfd maybe-clean-stage4-bfd +maybe-all-stage4-bfd: +maybe-clean-stage4-bfd: +@if bfd-bootstrap +maybe-all-stage4-bfd: all-stage4-bfd +all-stage4: all-stage4-bfd +all-stage4-bfd: configure-stage4-bfd + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-bfd: clean-stage4-bfd +clean-stage4: clean-stage4-bfd +clean-stage4-bfd: + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-bfd/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif bfd-bootstrap + + +.PHONY: all-stageprofile-bfd maybe-all-stageprofile-bfd +.PHONY: clean-stageprofile-bfd maybe-clean-stageprofile-bfd +maybe-all-stageprofile-bfd: +maybe-clean-stageprofile-bfd: +@if bfd-bootstrap +maybe-all-stageprofile-bfd: all-stageprofile-bfd +all-stageprofile: all-stageprofile-bfd +all-stageprofile-bfd: configure-stageprofile-bfd + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-bfd: clean-stageprofile-bfd +clean-stageprofile: clean-stageprofile-bfd +clean-stageprofile-bfd: + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-bfd/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif bfd-bootstrap + + +.PHONY: all-stagefeedback-bfd maybe-all-stagefeedback-bfd +.PHONY: clean-stagefeedback-bfd maybe-clean-stagefeedback-bfd +maybe-all-stagefeedback-bfd: +maybe-clean-stagefeedback-bfd: +@if bfd-bootstrap +maybe-all-stagefeedback-bfd: all-stagefeedback-bfd +all-stagefeedback: all-stagefeedback-bfd +all-stagefeedback-bfd: configure-stagefeedback-bfd + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd +clean-stagefeedback: clean-stagefeedback-bfd +clean-stagefeedback-bfd: + @[ -f $(HOST_SUBDIR)/bfd/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-bfd/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/bfd/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/bfd && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif bfd-bootstrap + + + + + .PHONY: check-bfd maybe-check-bfd maybe-check-bfd: @if bfd @@ -3827,7 +4196,6 @@ maybe-check-bfd: check-bfd check-bfd: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -3842,7 +4210,6 @@ maybe-install-bfd: install-bfd install-bfd: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bfd && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -3861,7 +4228,6 @@ info-bfd: \ @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3887,7 +4253,6 @@ dvi-bfd: \ @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3913,7 +4278,6 @@ html-bfd: \ @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3939,7 +4303,6 @@ TAGS-bfd: \ @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3966,7 +4329,6 @@ install-info-bfd: \ @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -3992,7 +4354,6 @@ installcheck-bfd: \ @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4017,7 +4378,6 @@ mostlyclean-bfd: @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4042,7 +4402,6 @@ clean-bfd: @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4067,7 +4426,6 @@ distclean-bfd: @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4092,7 +4450,6 @@ maintainer-clean-bfd: @[ -f ./bfd/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4109,19 +4466,20 @@ maintainer-clean-bfd: @endif bfd + .PHONY: configure-opcodes maybe-configure-opcodes maybe-configure-opcodes: @if opcodes maybe-configure-opcodes: configure-opcodes -configure-opcodes: +configure-opcodes: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in opcodes; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/opcodes; \ + cd "$(HOST_SUBDIR)/opcodes" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ @@ -4134,6 +4492,161 @@ configure-opcodes: || exit 1 @endif opcodes + + +.PHONY: configure-stage1-opcodes maybe-configure-stage1-opcodes +maybe-configure-stage1-opcodes: +@if opcodes-bootstrap +maybe-configure-stage1-opcodes: configure-stage1-opcodes +configure-stage1-opcodes: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif opcodes-bootstrap + +.PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes +maybe-configure-stage2-opcodes: +@if opcodes-bootstrap +maybe-configure-stage2-opcodes: configure-stage2-opcodes +configure-stage2-opcodes: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif opcodes-bootstrap + +.PHONY: configure-stage3-opcodes maybe-configure-stage3-opcodes +maybe-configure-stage3-opcodes: +@if opcodes-bootstrap +maybe-configure-stage3-opcodes: configure-stage3-opcodes +configure-stage3-opcodes: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif opcodes-bootstrap + +.PHONY: configure-stage4-opcodes maybe-configure-stage4-opcodes +maybe-configure-stage4-opcodes: +@if opcodes-bootstrap +maybe-configure-stage4-opcodes: configure-stage4-opcodes +configure-stage4-opcodes: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif opcodes-bootstrap + +.PHONY: configure-stageprofile-opcodes maybe-configure-stageprofile-opcodes +maybe-configure-stageprofile-opcodes: +@if opcodes-bootstrap +maybe-configure-stageprofile-opcodes: configure-stageprofile-opcodes +configure-stageprofile-opcodes: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif opcodes-bootstrap + +.PHONY: configure-stagefeedback-opcodes maybe-configure-stagefeedback-opcodes +maybe-configure-stagefeedback-opcodes: +@if opcodes-bootstrap +maybe-configure-stagefeedback-opcodes: configure-stagefeedback-opcodes +configure-stagefeedback-opcodes: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/opcodes ; \ + cd $(HOST_SUBDIR)/opcodes || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/opcodes"; \ + libsrcdir="$$s/opcodes"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif opcodes-bootstrap + + + + + .PHONY: all-opcodes maybe-all-opcodes maybe-all-opcodes: @if opcodes @@ -4143,12 +4656,188 @@ all-opcodes: configure-opcodes @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-opcodes)) @endif opcodes + + +.PHONY: all-stage1-opcodes maybe-all-stage1-opcodes +.PHONY: clean-stage1-opcodes maybe-clean-stage1-opcodes +maybe-all-stage1-opcodes: +maybe-clean-stage1-opcodes: +@if opcodes-bootstrap +maybe-all-stage1-opcodes: all-stage1-opcodes +all-stage1: all-stage1-opcodes +all-stage1-opcodes: configure-stage1-opcodes + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-opcodes: clean-stage1-opcodes +clean-stage1: clean-stage1-opcodes +clean-stage1-opcodes: + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-opcodes/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif opcodes-bootstrap + + +.PHONY: all-stage2-opcodes maybe-all-stage2-opcodes +.PHONY: clean-stage2-opcodes maybe-clean-stage2-opcodes +maybe-all-stage2-opcodes: +maybe-clean-stage2-opcodes: +@if opcodes-bootstrap +maybe-all-stage2-opcodes: all-stage2-opcodes +all-stage2: all-stage2-opcodes +all-stage2-opcodes: configure-stage2-opcodes + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-opcodes: clean-stage2-opcodes +clean-stage2: clean-stage2-opcodes +clean-stage2-opcodes: + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-opcodes/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stage3-opcodes maybe-all-stage3-opcodes +.PHONY: clean-stage3-opcodes maybe-clean-stage3-opcodes +maybe-all-stage3-opcodes: +maybe-clean-stage3-opcodes: +@if opcodes-bootstrap +maybe-all-stage3-opcodes: all-stage3-opcodes +all-stage3: all-stage3-opcodes +all-stage3-opcodes: configure-stage3-opcodes + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-opcodes: clean-stage3-opcodes +clean-stage3: clean-stage3-opcodes +clean-stage3-opcodes: + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-opcodes/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stage4-opcodes maybe-all-stage4-opcodes +.PHONY: clean-stage4-opcodes maybe-clean-stage4-opcodes +maybe-all-stage4-opcodes: +maybe-clean-stage4-opcodes: +@if opcodes-bootstrap +maybe-all-stage4-opcodes: all-stage4-opcodes +all-stage4: all-stage4-opcodes +all-stage4-opcodes: configure-stage4-opcodes + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-opcodes: clean-stage4-opcodes +clean-stage4: clean-stage4-opcodes +clean-stage4-opcodes: + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-opcodes/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif opcodes-bootstrap + + +.PHONY: all-stageprofile-opcodes maybe-all-stageprofile-opcodes +.PHONY: clean-stageprofile-opcodes maybe-clean-stageprofile-opcodes +maybe-all-stageprofile-opcodes: +maybe-clean-stageprofile-opcodes: +@if opcodes-bootstrap +maybe-all-stageprofile-opcodes: all-stageprofile-opcodes +all-stageprofile: all-stageprofile-opcodes +all-stageprofile-opcodes: configure-stageprofile-opcodes + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes +clean-stageprofile: clean-stageprofile-opcodes +clean-stageprofile-opcodes: + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-opcodes/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif opcodes-bootstrap + + +.PHONY: all-stagefeedback-opcodes maybe-all-stagefeedback-opcodes +.PHONY: clean-stagefeedback-opcodes maybe-clean-stagefeedback-opcodes +maybe-all-stagefeedback-opcodes: +maybe-clean-stagefeedback-opcodes: +@if opcodes-bootstrap +maybe-all-stagefeedback-opcodes: all-stagefeedback-opcodes +all-stagefeedback: all-stagefeedback-opcodes +all-stagefeedback-opcodes: configure-stagefeedback-opcodes + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes +clean-stagefeedback: clean-stagefeedback-opcodes +clean-stagefeedback-opcodes: + @[ -f $(HOST_SUBDIR)/opcodes/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-opcodes/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/opcodes && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif opcodes-bootstrap + + + + + .PHONY: check-opcodes maybe-check-opcodes maybe-check-opcodes: @if opcodes @@ -4157,7 +4846,6 @@ maybe-check-opcodes: check-opcodes check-opcodes: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -4172,7 +4860,6 @@ maybe-install-opcodes: install-opcodes install-opcodes: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/opcodes && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -4191,7 +4878,6 @@ info-opcodes: \ @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4217,7 +4903,6 @@ dvi-opcodes: \ @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4243,7 +4928,6 @@ html-opcodes: \ @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4269,7 +4953,6 @@ TAGS-opcodes: \ @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4296,7 +4979,6 @@ install-info-opcodes: \ @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4322,7 +5004,6 @@ installcheck-opcodes: \ @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4347,7 +5028,6 @@ mostlyclean-opcodes: @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4372,7 +5052,6 @@ clean-opcodes: @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4397,7 +5076,6 @@ distclean-opcodes: @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4422,7 +5100,6 @@ maintainer-clean-opcodes: @[ -f ./opcodes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4439,19 +5116,20 @@ maintainer-clean-opcodes: @endif opcodes + .PHONY: configure-binutils maybe-configure-binutils maybe-configure-binutils: @if binutils maybe-configure-binutils: configure-binutils -configure-binutils: +configure-binutils: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in binutils; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/binutils; \ + cd "$(HOST_SUBDIR)/binutils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ @@ -4464,6 +5142,161 @@ configure-binutils: || exit 1 @endif binutils + + +.PHONY: configure-stage1-binutils maybe-configure-stage1-binutils +maybe-configure-stage1-binutils: +@if binutils-bootstrap +maybe-configure-stage1-binutils: configure-stage1-binutils +configure-stage1-binutils: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif binutils-bootstrap + +.PHONY: configure-stage2-binutils maybe-configure-stage2-binutils +maybe-configure-stage2-binutils: +@if binutils-bootstrap +maybe-configure-stage2-binutils: configure-stage2-binutils +configure-stage2-binutils: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif binutils-bootstrap + +.PHONY: configure-stage3-binutils maybe-configure-stage3-binutils +maybe-configure-stage3-binutils: +@if binutils-bootstrap +maybe-configure-stage3-binutils: configure-stage3-binutils +configure-stage3-binutils: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif binutils-bootstrap + +.PHONY: configure-stage4-binutils maybe-configure-stage4-binutils +maybe-configure-stage4-binutils: +@if binutils-bootstrap +maybe-configure-stage4-binutils: configure-stage4-binutils +configure-stage4-binutils: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif binutils-bootstrap + +.PHONY: configure-stageprofile-binutils maybe-configure-stageprofile-binutils +maybe-configure-stageprofile-binutils: +@if binutils-bootstrap +maybe-configure-stageprofile-binutils: configure-stageprofile-binutils +configure-stageprofile-binutils: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif binutils-bootstrap + +.PHONY: configure-stagefeedback-binutils maybe-configure-stagefeedback-binutils +maybe-configure-stagefeedback-binutils: +@if binutils-bootstrap +maybe-configure-stagefeedback-binutils: configure-stagefeedback-binutils +configure-stagefeedback-binutils: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/binutils ; \ + cd $(HOST_SUBDIR)/binutils || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/binutils"; \ + libsrcdir="$$s/binutils"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif binutils-bootstrap + + + + + .PHONY: all-binutils maybe-all-binutils maybe-all-binutils: @if binutils @@ -4473,84 +5306,256 @@ all-binutils: configure-binutils @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/binutils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-binutils)) @endif binutils -.PHONY: check-binutils maybe-check-binutils -maybe-check-binutils: -@if binutils -maybe-check-binutils: check-binutils -check-binutils: + +.PHONY: all-stage1-binutils maybe-all-stage1-binutils +.PHONY: clean-stage1-binutils maybe-clean-stage1-binutils +maybe-all-stage1-binutils: +maybe-clean-stage1-binutils: +@if binutils-bootstrap +maybe-all-stage1-binutils: all-stage1-binutils +all-stage1: all-stage1-binutils +all-stage1-binutils: configure-stage1-binutils + @$(MAKE) stage1-start @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) check) + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" -@endif binutils +maybe-clean-stage1-binutils: clean-stage1-binutils +clean-stage1: clean-stage1-binutils +clean-stage1-binutils: + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-binutils/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif binutils-bootstrap -.PHONY: install-binutils maybe-install-binutils -maybe-install-binutils: -@if binutils -maybe-install-binutils: install-binutils -install-binutils: installdirs +.PHONY: all-stage2-binutils maybe-all-stage2-binutils +.PHONY: clean-stage2-binutils maybe-clean-stage2-binutils +maybe-all-stage2-binutils: +maybe-clean-stage2-binutils: +@if binutils-bootstrap +maybe-all-stage2-binutils: all-stage2-binutils +all-stage2: all-stage2-binutils +all-stage2-binutils: configure-stage2-binutils + @$(MAKE) stage2-start @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) install) - -@endif binutils + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) -# Other targets (info, dvi, etc.) +maybe-clean-stage2-binutils: clean-stage2-binutils +clean-stage2: clean-stage2-binutils +clean-stage2-binutils: + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-binutils/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap -.PHONY: maybe-info-binutils info-binutils -maybe-info-binutils: -@if binutils -maybe-info-binutils: info-binutils -info-binutils: \ - configure-binutils - @[ -f ./binutils/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ +.PHONY: all-stage3-binutils maybe-all-stage3-binutils +.PHONY: clean-stage3-binutils maybe-clean-stage3-binutils +maybe-all-stage3-binutils: +maybe-clean-stage3-binutils: +@if binutils-bootstrap +maybe-all-stage3-binutils: all-stage3-binutils +all-stage3: all-stage3-binutils +all-stage3-binutils: configure-stage3-binutils + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing info in binutils" ; \ - (cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - info) \ - || exit 1 + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) -@endif binutils +maybe-clean-stage3-binutils: clean-stage3-binutils +clean-stage3: clean-stage3-binutils +clean-stage3-binutils: + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-binutils/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap -.PHONY: maybe-dvi-binutils dvi-binutils -maybe-dvi-binutils: -@if binutils -maybe-dvi-binutils: dvi-binutils -dvi-binutils: \ - configure-binutils - @[ -f ./binutils/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ - $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ +.PHONY: all-stage4-binutils maybe-all-stage4-binutils +.PHONY: clean-stage4-binutils maybe-clean-stage4-binutils +maybe-all-stage4-binutils: +maybe-clean-stage4-binutils: +@if binutils-bootstrap +maybe-all-stage4-binutils: all-stage4-binutils +all-stage4: all-stage4-binutils +all-stage4-binutils: configure-stage4-binutils + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-binutils: clean-stage4-binutils +clean-stage4: clean-stage4-binutils +clean-stage4-binutils: + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-binutils/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif binutils-bootstrap + + +.PHONY: all-stageprofile-binutils maybe-all-stageprofile-binutils +.PHONY: clean-stageprofile-binutils maybe-clean-stageprofile-binutils +maybe-all-stageprofile-binutils: +maybe-clean-stageprofile-binutils: +@if binutils-bootstrap +maybe-all-stageprofile-binutils: all-stageprofile-binutils +all-stageprofile: all-stageprofile-binutils +all-stageprofile-binutils: configure-stageprofile-binutils + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-binutils: clean-stageprofile-binutils +clean-stageprofile: clean-stageprofile-binutils +clean-stageprofile-binutils: + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-binutils/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif binutils-bootstrap + + +.PHONY: all-stagefeedback-binutils maybe-all-stagefeedback-binutils +.PHONY: clean-stagefeedback-binutils maybe-clean-stagefeedback-binutils +maybe-all-stagefeedback-binutils: +maybe-clean-stagefeedback-binutils: +@if binutils-bootstrap +maybe-all-stagefeedback-binutils: all-stagefeedback-binutils +all-stagefeedback: all-stagefeedback-binutils +all-stagefeedback-binutils: configure-stagefeedback-binutils + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils +clean-stagefeedback: clean-stagefeedback-binutils +clean-stagefeedback-binutils: + @[ -f $(HOST_SUBDIR)/binutils/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-binutils/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/binutils/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif binutils-bootstrap + + + + + +.PHONY: check-binutils maybe-check-binutils +maybe-check-binutils: +@if binutils +maybe-check-binutils: check-binutils + +check-binutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif binutils + +.PHONY: install-binutils maybe-install-binutils +maybe-install-binutils: +@if binutils +maybe-install-binutils: install-binutils + +install-binutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif binutils + +# Other targets (info, dvi, etc.) + +.PHONY: maybe-info-binutils info-binutils +maybe-info-binutils: +@if binutils +maybe-info-binutils: info-binutils + +info-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in binutils" ; \ + (cd $(HOST_SUBDIR)/binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif binutils + +.PHONY: maybe-dvi-binutils dvi-binutils +maybe-dvi-binutils: +@if binutils +maybe-dvi-binutils: dvi-binutils + +dvi-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ done; \ echo "Doing dvi in binutils" ; \ (cd $(HOST_SUBDIR)/binutils && \ @@ -4573,7 +5578,6 @@ html-binutils: \ @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4599,7 +5603,6 @@ TAGS-binutils: \ @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4626,7 +5629,6 @@ install-info-binutils: \ @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4652,7 +5654,6 @@ installcheck-binutils: \ @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4677,7 +5678,6 @@ mostlyclean-binutils: @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4702,7 +5702,6 @@ clean-binutils: @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4727,7 +5726,6 @@ distclean-binutils: @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4752,7 +5750,6 @@ maintainer-clean-binutils: @[ -f ./binutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4769,18 +5766,19 @@ maintainer-clean-binutils: @endif binutils + .PHONY: configure-bison maybe-configure-bison maybe-configure-bison: @if bison maybe-configure-bison: configure-bison -configure-bison: +configure-bison: @test ! -f $(HOST_SUBDIR)/bison/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bison ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in bison; \ - cd $(HOST_SUBDIR)/bison || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/bison; \ + cd "$(HOST_SUBDIR)/bison" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/bison/ | \ @@ -4793,6 +5791,10 @@ configure-bison: || exit 1 @endif bison + + + + .PHONY: all-bison maybe-all-bison maybe-all-bison: @if bison @@ -4801,12 +5803,14 @@ maybe-all-bison: all-bison all-bison: configure-bison @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bison && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bison)) @endif bison + + + .PHONY: check-bison maybe-check-bison maybe-check-bison: @if bison @@ -4817,7 +5821,6 @@ check-bison: @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bison && \ $(MAKE) $(FLAGS_TO_PASS) check); \ @@ -4833,7 +5836,6 @@ maybe-install-bison: install-bison install-bison: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bison && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -4852,7 +5854,6 @@ info-bison: \ @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4878,7 +5879,6 @@ dvi-bison: \ @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4904,7 +5904,6 @@ html-bison: \ @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4930,7 +5929,6 @@ TAGS-bison: \ @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4957,7 +5955,6 @@ install-info-bison: \ @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -4983,7 +5980,6 @@ installcheck-bison: \ @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5008,7 +6004,6 @@ mostlyclean-bison: @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5033,7 +6028,6 @@ clean-bison: @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5058,7 +6052,6 @@ distclean-bison: @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5083,7 +6076,6 @@ maintainer-clean-bison: @[ -f ./bison/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5100,18 +6092,19 @@ maintainer-clean-bison: @endif bison + .PHONY: configure-byacc maybe-configure-byacc maybe-configure-byacc: @if byacc maybe-configure-byacc: configure-byacc -configure-byacc: +configure-byacc: @test ! -f $(HOST_SUBDIR)/byacc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/byacc ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in byacc; \ - cd $(HOST_SUBDIR)/byacc || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/byacc; \ + cd "$(HOST_SUBDIR)/byacc" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/byacc/ | \ @@ -5124,6 +6117,10 @@ configure-byacc: || exit 1 @endif byacc + + + + .PHONY: all-byacc maybe-all-byacc maybe-all-byacc: @if byacc @@ -5132,12 +6129,14 @@ maybe-all-byacc: all-byacc all-byacc: configure-byacc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/byacc && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-byacc)) @endif byacc + + + .PHONY: check-byacc maybe-check-byacc maybe-check-byacc: @if byacc @@ -5148,7 +6147,6 @@ check-byacc: @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/byacc && \ $(MAKE) $(FLAGS_TO_PASS) check); \ @@ -5164,7 +6162,6 @@ maybe-install-byacc: install-byacc install-byacc: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/byacc && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -5183,7 +6180,6 @@ info-byacc: \ @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5209,7 +6205,6 @@ dvi-byacc: \ @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5235,7 +6230,6 @@ html-byacc: \ @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5261,7 +6255,6 @@ TAGS-byacc: \ @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5288,7 +6281,6 @@ install-info-byacc: \ @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5314,7 +6306,6 @@ installcheck-byacc: \ @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5339,7 +6330,6 @@ mostlyclean-byacc: @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5364,7 +6354,6 @@ clean-byacc: @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5389,7 +6378,6 @@ distclean-byacc: @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5414,7 +6402,6 @@ maintainer-clean-byacc: @[ -f ./byacc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5431,18 +6418,19 @@ maintainer-clean-byacc: @endif byacc + .PHONY: configure-bzip2 maybe-configure-bzip2 maybe-configure-bzip2: @if bzip2 maybe-configure-bzip2: configure-bzip2 -configure-bzip2: +configure-bzip2: @test ! -f $(HOST_SUBDIR)/bzip2/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bzip2 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in bzip2; \ - cd $(HOST_SUBDIR)/bzip2 || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/bzip2; \ + cd "$(HOST_SUBDIR)/bzip2" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/bzip2/ | \ @@ -5455,6 +6443,10 @@ configure-bzip2: || exit 1 @endif bzip2 + + + + .PHONY: all-bzip2 maybe-all-bzip2 maybe-all-bzip2: @if bzip2 @@ -5463,12 +6455,14 @@ maybe-all-bzip2: all-bzip2 all-bzip2: configure-bzip2 @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bzip2 && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-bzip2)) @endif bzip2 + + + .PHONY: check-bzip2 maybe-check-bzip2 maybe-check-bzip2: @if bzip2 @@ -5477,7 +6471,6 @@ maybe-check-bzip2: check-bzip2 check-bzip2: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bzip2 && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -5492,7 +6485,6 @@ maybe-install-bzip2: install-bzip2 install-bzip2: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/bzip2 && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -5511,7 +6503,6 @@ info-bzip2: \ @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5537,7 +6528,6 @@ dvi-bzip2: \ @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5563,7 +6553,6 @@ html-bzip2: \ @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5589,7 +6578,6 @@ TAGS-bzip2: \ @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5616,7 +6604,6 @@ install-info-bzip2: \ @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5642,7 +6629,6 @@ installcheck-bzip2: \ @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5667,7 +6653,6 @@ mostlyclean-bzip2: @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5692,7 +6677,6 @@ clean-bzip2: @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5717,7 +6701,6 @@ distclean-bzip2: @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5742,7 +6725,6 @@ maintainer-clean-bzip2: @[ -f ./bzip2/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5759,18 +6741,19 @@ maintainer-clean-bzip2: @endif bzip2 + .PHONY: configure-dejagnu maybe-configure-dejagnu maybe-configure-dejagnu: @if dejagnu maybe-configure-dejagnu: configure-dejagnu -configure-dejagnu: +configure-dejagnu: @test ! -f $(HOST_SUBDIR)/dejagnu/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/dejagnu ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in dejagnu; \ - cd $(HOST_SUBDIR)/dejagnu || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/dejagnu; \ + cd "$(HOST_SUBDIR)/dejagnu" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/dejagnu/ | \ @@ -5783,6 +6766,10 @@ configure-dejagnu: || exit 1 @endif dejagnu + + + + .PHONY: all-dejagnu maybe-all-dejagnu maybe-all-dejagnu: @if dejagnu @@ -5791,12 +6778,14 @@ maybe-all-dejagnu: all-dejagnu all-dejagnu: configure-dejagnu @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/dejagnu && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-dejagnu)) @endif dejagnu + + + .PHONY: check-dejagnu maybe-check-dejagnu maybe-check-dejagnu: @if dejagnu @@ -5805,7 +6794,6 @@ maybe-check-dejagnu: check-dejagnu check-dejagnu: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/dejagnu && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -5820,7 +6808,6 @@ maybe-install-dejagnu: install-dejagnu install-dejagnu: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/dejagnu && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -5839,7 +6826,6 @@ info-dejagnu: \ @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5865,7 +6851,6 @@ dvi-dejagnu: \ @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5891,7 +6876,6 @@ html-dejagnu: \ @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5917,7 +6901,6 @@ TAGS-dejagnu: \ @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5944,7 +6927,6 @@ install-info-dejagnu: \ @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5970,7 +6952,6 @@ installcheck-dejagnu: \ @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -5995,7 +6976,6 @@ mostlyclean-dejagnu: @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6020,7 +7000,6 @@ clean-dejagnu: @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6045,7 +7024,6 @@ distclean-dejagnu: @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6070,7 +7048,6 @@ maintainer-clean-dejagnu: @[ -f ./dejagnu/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6087,18 +7064,19 @@ maintainer-clean-dejagnu: @endif dejagnu + .PHONY: configure-diff maybe-configure-diff maybe-configure-diff: @if diff maybe-configure-diff: configure-diff -configure-diff: +configure-diff: @test ! -f $(HOST_SUBDIR)/diff/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/diff ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in diff; \ - cd $(HOST_SUBDIR)/diff || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/diff; \ + cd "$(HOST_SUBDIR)/diff" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/diff/ | \ @@ -6111,6 +7089,10 @@ configure-diff: || exit 1 @endif diff + + + + .PHONY: all-diff maybe-all-diff maybe-all-diff: @if diff @@ -6119,12 +7101,14 @@ maybe-all-diff: all-diff all-diff: configure-diff @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/diff && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-diff)) @endif diff + + + .PHONY: check-diff maybe-check-diff maybe-check-diff: @if diff @@ -6133,7 +7117,6 @@ maybe-check-diff: check-diff check-diff: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/diff && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -6148,7 +7131,6 @@ maybe-install-diff: install-diff install-diff: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/diff && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -6167,7 +7149,6 @@ info-diff: \ @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6193,7 +7174,6 @@ dvi-diff: \ @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6219,7 +7199,6 @@ html-diff: \ @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6245,7 +7224,6 @@ TAGS-diff: \ @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6272,7 +7250,6 @@ install-info-diff: \ @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6298,7 +7275,6 @@ installcheck-diff: \ @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6323,7 +7299,6 @@ mostlyclean-diff: @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6348,7 +7323,6 @@ clean-diff: @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6373,7 +7347,6 @@ distclean-diff: @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6398,7 +7371,6 @@ maintainer-clean-diff: @[ -f ./diff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6415,18 +7387,19 @@ maintainer-clean-diff: @endif diff + .PHONY: configure-dosutils maybe-configure-dosutils maybe-configure-dosutils: @if dosutils maybe-configure-dosutils: configure-dosutils -configure-dosutils: +configure-dosutils: @test ! -f $(HOST_SUBDIR)/dosutils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/dosutils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in dosutils; \ - cd $(HOST_SUBDIR)/dosutils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/dosutils; \ + cd "$(HOST_SUBDIR)/dosutils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/dosutils/ | \ @@ -6439,6 +7412,10 @@ configure-dosutils: || exit 1 @endif dosutils + + + + .PHONY: all-dosutils maybe-all-dosutils maybe-all-dosutils: @if dosutils @@ -6447,12 +7424,14 @@ maybe-all-dosutils: all-dosutils all-dosutils: configure-dosutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/dosutils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-dosutils)) @endif dosutils + + + .PHONY: check-dosutils maybe-check-dosutils maybe-check-dosutils: @if dosutils @@ -6470,7 +7449,6 @@ maybe-install-dosutils: install-dosutils install-dosutils: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/dosutils && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -6489,7 +7467,6 @@ info-dosutils: \ @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6515,7 +7492,6 @@ dvi-dosutils: \ @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6541,7 +7517,6 @@ html-dosutils: \ @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6567,7 +7542,6 @@ TAGS-dosutils: \ @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6594,7 +7568,6 @@ install-info-dosutils: \ @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6620,7 +7593,6 @@ installcheck-dosutils: \ @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6645,7 +7617,6 @@ mostlyclean-dosutils: @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6670,7 +7641,6 @@ clean-dosutils: @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6695,7 +7665,6 @@ distclean-dosutils: @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6720,7 +7689,6 @@ maintainer-clean-dosutils: @[ -f ./dosutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6737,18 +7705,19 @@ maintainer-clean-dosutils: @endif dosutils + .PHONY: configure-etc maybe-configure-etc maybe-configure-etc: @if etc maybe-configure-etc: configure-etc -configure-etc: +configure-etc: @test ! -f $(HOST_SUBDIR)/etc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/etc ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in etc; \ - cd $(HOST_SUBDIR)/etc || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/etc; \ + cd "$(HOST_SUBDIR)/etc" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/etc/ | \ @@ -6761,6 +7730,10 @@ configure-etc: || exit 1 @endif etc + + + + .PHONY: all-etc maybe-all-etc maybe-all-etc: @if etc @@ -6769,12 +7742,14 @@ maybe-all-etc: all-etc all-etc: configure-etc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/etc && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-etc)) @endif etc + + + .PHONY: check-etc maybe-check-etc maybe-check-etc: @if etc @@ -6783,7 +7758,6 @@ maybe-check-etc: check-etc check-etc: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/etc && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -6798,7 +7772,6 @@ maybe-install-etc: install-etc install-etc: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/etc && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -6817,7 +7790,6 @@ info-etc: \ @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6843,7 +7815,6 @@ dvi-etc: \ @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6869,7 +7840,6 @@ html-etc: \ @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6895,7 +7865,6 @@ TAGS-etc: \ @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6922,7 +7891,6 @@ install-info-etc: \ @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6948,7 +7916,6 @@ installcheck-etc: \ @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6973,7 +7940,6 @@ mostlyclean-etc: @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -6998,7 +7964,6 @@ clean-etc: @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7023,7 +7988,6 @@ distclean-etc: @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7048,7 +8012,6 @@ maintainer-clean-etc: @[ -f ./etc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7065,18 +8028,19 @@ maintainer-clean-etc: @endif etc + .PHONY: configure-fastjar maybe-configure-fastjar maybe-configure-fastjar: @if fastjar maybe-configure-fastjar: configure-fastjar -configure-fastjar: +configure-fastjar: @test ! -f $(HOST_SUBDIR)/fastjar/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fastjar ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in fastjar; \ - cd $(HOST_SUBDIR)/fastjar || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/fastjar; \ + cd "$(HOST_SUBDIR)/fastjar" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/fastjar/ | \ @@ -7089,6 +8053,10 @@ configure-fastjar: || exit 1 @endif fastjar + + + + .PHONY: all-fastjar maybe-all-fastjar maybe-all-fastjar: @if fastjar @@ -7097,12 +8065,14 @@ maybe-all-fastjar: all-fastjar all-fastjar: configure-fastjar @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fastjar && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fastjar)) @endif fastjar + + + .PHONY: check-fastjar maybe-check-fastjar maybe-check-fastjar: @if fastjar @@ -7113,7 +8083,6 @@ check-fastjar: @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fastjar && \ $(MAKE) $(FLAGS_TO_PASS) check); \ @@ -7129,7 +8098,6 @@ maybe-install-fastjar: install-fastjar install-fastjar: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fastjar && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -7148,7 +8116,6 @@ info-fastjar: \ @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7174,7 +8141,6 @@ dvi-fastjar: \ @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7200,7 +8166,6 @@ html-fastjar: \ @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7226,7 +8191,6 @@ TAGS-fastjar: \ @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7253,7 +8217,6 @@ install-info-fastjar: \ @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7279,7 +8242,6 @@ installcheck-fastjar: \ @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7304,7 +8266,6 @@ mostlyclean-fastjar: @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7329,7 +8290,6 @@ clean-fastjar: @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7354,7 +8314,6 @@ distclean-fastjar: @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7379,7 +8338,6 @@ maintainer-clean-fastjar: @[ -f ./fastjar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7396,18 +8354,19 @@ maintainer-clean-fastjar: @endif fastjar + .PHONY: configure-fileutils maybe-configure-fileutils maybe-configure-fileutils: @if fileutils maybe-configure-fileutils: configure-fileutils -configure-fileutils: +configure-fileutils: @test ! -f $(HOST_SUBDIR)/fileutils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fileutils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in fileutils; \ - cd $(HOST_SUBDIR)/fileutils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/fileutils; \ + cd "$(HOST_SUBDIR)/fileutils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/fileutils/ | \ @@ -7420,6 +8379,10 @@ configure-fileutils: || exit 1 @endif fileutils + + + + .PHONY: all-fileutils maybe-all-fileutils maybe-all-fileutils: @if fileutils @@ -7428,12 +8391,14 @@ maybe-all-fileutils: all-fileutils all-fileutils: configure-fileutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fileutils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fileutils)) @endif fileutils + + + .PHONY: check-fileutils maybe-check-fileutils maybe-check-fileutils: @if fileutils @@ -7442,7 +8407,6 @@ maybe-check-fileutils: check-fileutils check-fileutils: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fileutils && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -7457,7 +8421,6 @@ maybe-install-fileutils: install-fileutils install-fileutils: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fileutils && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -7476,7 +8439,6 @@ info-fileutils: \ @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7502,7 +8464,6 @@ dvi-fileutils: \ @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7528,7 +8489,6 @@ html-fileutils: \ @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7554,7 +8514,6 @@ TAGS-fileutils: \ @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7581,7 +8540,6 @@ install-info-fileutils: \ @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7607,7 +8565,6 @@ installcheck-fileutils: \ @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7632,7 +8589,6 @@ mostlyclean-fileutils: @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7657,7 +8613,6 @@ clean-fileutils: @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7682,7 +8637,6 @@ distclean-fileutils: @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7707,7 +8661,6 @@ maintainer-clean-fileutils: @[ -f ./fileutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7724,18 +8677,19 @@ maintainer-clean-fileutils: @endif fileutils + .PHONY: configure-findutils maybe-configure-findutils maybe-configure-findutils: @if findutils maybe-configure-findutils: configure-findutils -configure-findutils: +configure-findutils: @test ! -f $(HOST_SUBDIR)/findutils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/findutils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in findutils; \ - cd $(HOST_SUBDIR)/findutils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/findutils; \ + cd "$(HOST_SUBDIR)/findutils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/findutils/ | \ @@ -7748,6 +8702,10 @@ configure-findutils: || exit 1 @endif findutils + + + + .PHONY: all-findutils maybe-all-findutils maybe-all-findutils: @if findutils @@ -7756,12 +8714,14 @@ maybe-all-findutils: all-findutils all-findutils: configure-findutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/findutils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-findutils)) @endif findutils + + + .PHONY: check-findutils maybe-check-findutils maybe-check-findutils: @if findutils @@ -7770,7 +8730,6 @@ maybe-check-findutils: check-findutils check-findutils: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/findutils && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -7785,7 +8744,6 @@ maybe-install-findutils: install-findutils install-findutils: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/findutils && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -7804,7 +8762,6 @@ info-findutils: \ @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7830,7 +8787,6 @@ dvi-findutils: \ @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7856,7 +8812,6 @@ html-findutils: \ @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7882,7 +8837,6 @@ TAGS-findutils: \ @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7909,7 +8863,6 @@ install-info-findutils: \ @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7935,7 +8888,6 @@ installcheck-findutils: \ @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7960,7 +8912,6 @@ mostlyclean-findutils: @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -7985,7 +8936,6 @@ clean-findutils: @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8010,7 +8960,6 @@ distclean-findutils: @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8035,7 +8984,6 @@ maintainer-clean-findutils: @[ -f ./findutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8052,18 +9000,19 @@ maintainer-clean-findutils: @endif findutils + .PHONY: configure-find maybe-configure-find maybe-configure-find: @if find maybe-configure-find: configure-find -configure-find: +configure-find: @test ! -f $(HOST_SUBDIR)/find/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/find ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in find; \ - cd $(HOST_SUBDIR)/find || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/find; \ + cd "$(HOST_SUBDIR)/find" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/find/ | \ @@ -8076,6 +9025,10 @@ configure-find: || exit 1 @endif find + + + + .PHONY: all-find maybe-all-find maybe-all-find: @if find @@ -8084,12 +9037,14 @@ maybe-all-find: all-find all-find: configure-find @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/find && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-find)) @endif find + + + .PHONY: check-find maybe-check-find maybe-check-find: @if find @@ -8098,7 +9053,6 @@ maybe-check-find: check-find check-find: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/find && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -8113,7 +9067,6 @@ maybe-install-find: install-find install-find: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/find && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -8132,7 +9085,6 @@ info-find: \ @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8158,7 +9110,6 @@ dvi-find: \ @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8184,7 +9135,6 @@ html-find: \ @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8210,7 +9160,6 @@ TAGS-find: \ @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8237,7 +9186,6 @@ install-info-find: \ @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8263,7 +9211,6 @@ installcheck-find: \ @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8288,7 +9235,6 @@ mostlyclean-find: @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8313,7 +9259,6 @@ clean-find: @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8338,7 +9283,6 @@ distclean-find: @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8363,7 +9307,6 @@ maintainer-clean-find: @[ -f ./find/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8380,18 +9323,19 @@ maintainer-clean-find: @endif find + .PHONY: configure-fixincludes maybe-configure-fixincludes maybe-configure-fixincludes: @if fixincludes maybe-configure-fixincludes: configure-fixincludes -configure-fixincludes: +configure-fixincludes: @test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in fixincludes; \ - cd $(HOST_SUBDIR)/fixincludes || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/fixincludes; \ + cd "$(HOST_SUBDIR)/fixincludes" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/fixincludes/ | \ @@ -8404,6 +9348,10 @@ configure-fixincludes: || exit 1 @endif fixincludes + + + + .PHONY: all-fixincludes maybe-all-fixincludes maybe-all-fixincludes: @if fixincludes @@ -8412,12 +9360,14 @@ maybe-all-fixincludes: all-fixincludes all-fixincludes: configure-fixincludes @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fixincludes && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-fixincludes)) @endif fixincludes + + + .PHONY: check-fixincludes maybe-check-fixincludes maybe-check-fixincludes: @if fixincludes @@ -8426,7 +9376,6 @@ maybe-check-fixincludes: check-fixincludes check-fixincludes: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fixincludes && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -8441,7 +9390,6 @@ maybe-install-fixincludes: install-fixincludes install-fixincludes: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/fixincludes && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -8480,7 +9428,6 @@ html-fixincludes: \ @[ -f ./fixincludes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8535,7 +9482,6 @@ mostlyclean-fixincludes: @[ -f ./fixincludes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8560,7 +9506,6 @@ clean-fixincludes: @[ -f ./fixincludes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8585,7 +9530,6 @@ distclean-fixincludes: @[ -f ./fixincludes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8610,7 +9554,6 @@ maintainer-clean-fixincludes: @[ -f ./fixincludes/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8627,18 +9570,19 @@ maintainer-clean-fixincludes: @endif fixincludes + .PHONY: configure-flex maybe-configure-flex maybe-configure-flex: @if flex maybe-configure-flex: configure-flex -configure-flex: +configure-flex: @test ! -f $(HOST_SUBDIR)/flex/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/flex ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in flex; \ - cd $(HOST_SUBDIR)/flex || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/flex; \ + cd "$(HOST_SUBDIR)/flex" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/flex/ | \ @@ -8651,6 +9595,10 @@ configure-flex: || exit 1 @endif flex + + + + .PHONY: all-flex maybe-all-flex maybe-all-flex: @if flex @@ -8659,12 +9607,14 @@ maybe-all-flex: all-flex all-flex: configure-flex @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/flex && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-flex)) @endif flex + + + .PHONY: check-flex maybe-check-flex maybe-check-flex: @if flex @@ -8675,7 +9625,6 @@ check-flex: @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/flex && \ $(MAKE) $(FLAGS_TO_PASS) check); \ @@ -8691,7 +9640,6 @@ maybe-install-flex: install-flex install-flex: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/flex && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -8710,7 +9658,6 @@ info-flex: \ @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8736,7 +9683,6 @@ dvi-flex: \ @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8762,7 +9708,6 @@ html-flex: \ @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8788,7 +9733,6 @@ TAGS-flex: \ @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8815,7 +9759,6 @@ install-info-flex: \ @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8841,7 +9784,6 @@ installcheck-flex: \ @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8866,7 +9808,6 @@ mostlyclean-flex: @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8891,7 +9832,6 @@ clean-flex: @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8916,7 +9856,6 @@ distclean-flex: @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8941,7 +9880,6 @@ maintainer-clean-flex: @[ -f ./flex/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -8958,19 +9896,20 @@ maintainer-clean-flex: @endif flex + .PHONY: configure-gas maybe-configure-gas maybe-configure-gas: @if gas maybe-configure-gas: configure-gas -configure-gas: +configure-gas: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gas; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gas; \ + cd "$(HOST_SUBDIR)/gas" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ @@ -8983,6 +9922,161 @@ configure-gas: || exit 1 @endif gas + + +.PHONY: configure-stage1-gas maybe-configure-stage1-gas +maybe-configure-stage1-gas: +@if gas-bootstrap +maybe-configure-stage1-gas: configure-stage1-gas +configure-stage1-gas: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif gas-bootstrap + +.PHONY: configure-stage2-gas maybe-configure-stage2-gas +maybe-configure-stage2-gas: +@if gas-bootstrap +maybe-configure-stage2-gas: configure-stage2-gas +configure-stage2-gas: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gas-bootstrap + +.PHONY: configure-stage3-gas maybe-configure-stage3-gas +maybe-configure-stage3-gas: +@if gas-bootstrap +maybe-configure-stage3-gas: configure-stage3-gas +configure-stage3-gas: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gas-bootstrap + +.PHONY: configure-stage4-gas maybe-configure-stage4-gas +maybe-configure-stage4-gas: +@if gas-bootstrap +maybe-configure-stage4-gas: configure-stage4-gas +configure-stage4-gas: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gas-bootstrap + +.PHONY: configure-stageprofile-gas maybe-configure-stageprofile-gas +maybe-configure-stageprofile-gas: +@if gas-bootstrap +maybe-configure-stageprofile-gas: configure-stageprofile-gas +configure-stageprofile-gas: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gas-bootstrap + +.PHONY: configure-stagefeedback-gas maybe-configure-stagefeedback-gas +maybe-configure-stagefeedback-gas: +@if gas-bootstrap +maybe-configure-stagefeedback-gas: configure-stagefeedback-gas +configure-stagefeedback-gas: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/gas/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gas ; \ + cd $(HOST_SUBDIR)/gas || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gas"; \ + libsrcdir="$$s/gas"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gas-bootstrap + + + + + .PHONY: all-gas maybe-all-gas maybe-all-gas: @if gas @@ -8992,107 +10086,278 @@ all-gas: configure-gas @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gas && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gas)) @endif gas -.PHONY: check-gas maybe-check-gas -maybe-check-gas: -@if gas -maybe-check-gas: check-gas -check-gas: + +.PHONY: all-stage1-gas maybe-all-stage1-gas +.PHONY: clean-stage1-gas maybe-clean-stage1-gas +maybe-all-stage1-gas: +maybe-clean-stage1-gas: +@if gas-bootstrap +maybe-all-stage1-gas: all-stage1-gas +all-stage1: all-stage1-gas +all-stage1-gas: configure-stage1-gas + @$(MAKE) stage1-start @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) check) + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" -@endif gas +maybe-clean-stage1-gas: clean-stage1-gas +clean-stage1: clean-stage1-gas +clean-stage1-gas: + @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gas/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif gas-bootstrap -.PHONY: install-gas maybe-install-gas -maybe-install-gas: -@if gas -maybe-install-gas: install-gas -install-gas: installdirs +.PHONY: all-stage2-gas maybe-all-stage2-gas +.PHONY: clean-stage2-gas maybe-clean-stage2-gas +maybe-all-stage2-gas: +maybe-clean-stage2-gas: +@if gas-bootstrap +maybe-all-stage2-gas: all-stage2-gas +all-stage2: all-stage2-gas +all-stage2-gas: configure-stage2-gas + @$(MAKE) stage2-start @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) install) - -@endif gas + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) -# Other targets (info, dvi, etc.) +maybe-clean-stage2-gas: clean-stage2-gas +clean-stage2: clean-stage2-gas +clean-stage2-gas: + @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gas/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap -.PHONY: maybe-info-gas info-gas -maybe-info-gas: -@if gas -maybe-info-gas: info-gas -info-gas: \ - configure-gas - @[ -f ./gas/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ +.PHONY: all-stage3-gas maybe-all-stage3-gas +.PHONY: clean-stage3-gas maybe-clean-stage3-gas +maybe-all-stage3-gas: +maybe-clean-stage3-gas: +@if gas-bootstrap +maybe-all-stage3-gas: all-stage3-gas +all-stage3: all-stage3-gas +all-stage3-gas: configure-stage3-gas + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing info in gas" ; \ - (cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - info) \ - || exit 1 + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) -@endif gas +maybe-clean-stage3-gas: clean-stage3-gas +clean-stage3: clean-stage3-gas +clean-stage3-gas: + @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gas/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap -.PHONY: maybe-dvi-gas dvi-gas -maybe-dvi-gas: -@if gas -maybe-dvi-gas: dvi-gas -dvi-gas: \ - configure-gas - @[ -f ./gas/Makefile ] || exit 0; \ - r=`${PWD_COMMAND}`; export r; \ +.PHONY: all-stage4-gas maybe-all-stage4-gas +.PHONY: clean-stage4-gas maybe-clean-stage4-gas +maybe-all-stage4-gas: +maybe-clean-stage4-gas: +@if gas-bootstrap +maybe-all-stage4-gas: all-stage4-gas +all-stage4: all-stage4-gas +all-stage4-gas: configure-stage4-gas + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ - for flag in $(EXTRA_HOST_FLAGS) ; do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - echo "Doing dvi in gas" ; \ - (cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "RANLIB=$${RANLIB}" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - dvi) \ - || exit 1 + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) -@endif gas +maybe-clean-stage4-gas: clean-stage4-gas +clean-stage4: clean-stage4-gas +clean-stage4-gas: + @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gas/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif gas-bootstrap -.PHONY: maybe-html-gas html-gas -maybe-html-gas: -@if gas -maybe-html-gas: html-gas -html-gas: \ - configure-gas +.PHONY: all-stageprofile-gas maybe-all-stageprofile-gas +.PHONY: clean-stageprofile-gas maybe-clean-stageprofile-gas +maybe-all-stageprofile-gas: +maybe-clean-stageprofile-gas: +@if gas-bootstrap +maybe-all-stageprofile-gas: all-stageprofile-gas +all-stageprofile: all-stageprofile-gas +all-stageprofile-gas: configure-stageprofile-gas + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-gas: clean-stageprofile-gas +clean-stageprofile: clean-stageprofile-gas +clean-stageprofile-gas: + @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gas/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif gas-bootstrap + + +.PHONY: all-stagefeedback-gas maybe-all-stagefeedback-gas +.PHONY: clean-stagefeedback-gas maybe-clean-stagefeedback-gas +maybe-all-stagefeedback-gas: +maybe-clean-stagefeedback-gas: +@if gas-bootstrap +maybe-all-stagefeedback-gas: all-stagefeedback-gas +all-stagefeedback: all-stagefeedback-gas +all-stagefeedback-gas: configure-stagefeedback-gas + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-gas: clean-stagefeedback-gas +clean-stagefeedback: clean-stagefeedback-gas +clean-stagefeedback-gas: + @[ -f $(HOST_SUBDIR)/gas/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gas/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gas/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif gas-bootstrap + + + + + +.PHONY: check-gas maybe-check-gas +maybe-check-gas: +@if gas +maybe-check-gas: check-gas + +check-gas: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) check) + +@endif gas + +.PHONY: install-gas maybe-install-gas +maybe-install-gas: +@if gas +maybe-install-gas: install-gas + +install-gas: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(FLAGS_TO_PASS) install) + +@endif gas + +# Other targets (info, dvi, etc.) + +.PHONY: maybe-info-gas info-gas +maybe-info-gas: +@if gas +maybe-info-gas: info-gas + +info-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + +@endif gas + +.PHONY: maybe-dvi-gas dvi-gas +maybe-dvi-gas: +@if gas +maybe-dvi-gas: dvi-gas + +dvi-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + for flag in $(EXTRA_HOST_FLAGS) ; do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gas" ; \ + (cd $(HOST_SUBDIR)/gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +@endif gas + +.PHONY: maybe-html-gas html-gas +maybe-html-gas: +@if gas +maybe-html-gas: html-gas + +html-gas: \ + configure-gas @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9118,7 +10383,6 @@ TAGS-gas: \ @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9145,7 +10409,6 @@ install-info-gas: \ @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9171,7 +10434,6 @@ installcheck-gas: \ @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9196,7 +10458,6 @@ mostlyclean-gas: @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9221,7 +10482,6 @@ clean-gas: @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9246,7 +10506,6 @@ distclean-gas: @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9271,7 +10530,6 @@ maintainer-clean-gas: @[ -f ./gas/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9288,19 +10546,20 @@ maintainer-clean-gas: @endif gas + .PHONY: configure-gcc maybe-configure-gcc maybe-configure-gcc: @if gcc maybe-configure-gcc: configure-gcc -configure-gcc: +configure-gcc: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gcc; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gcc; \ + cd "$(HOST_SUBDIR)/gcc" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ @@ -9313,6 +10572,161 @@ configure-gcc: || exit 1 @endif gcc + + +.PHONY: configure-stage1-gcc maybe-configure-stage1-gcc +maybe-configure-stage1-gcc: +@if gcc-bootstrap +maybe-configure-stage1-gcc: configure-stage1-gcc +configure-stage1-gcc: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif gcc-bootstrap + +.PHONY: configure-stage2-gcc maybe-configure-stage2-gcc +maybe-configure-stage2-gcc: +@if gcc-bootstrap +maybe-configure-stage2-gcc: configure-stage2-gcc +configure-stage2-gcc: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gcc-bootstrap + +.PHONY: configure-stage3-gcc maybe-configure-stage3-gcc +maybe-configure-stage3-gcc: +@if gcc-bootstrap +maybe-configure-stage3-gcc: configure-stage3-gcc +configure-stage3-gcc: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gcc-bootstrap + +.PHONY: configure-stage4-gcc maybe-configure-stage4-gcc +maybe-configure-stage4-gcc: +@if gcc-bootstrap +maybe-configure-stage4-gcc: configure-stage4-gcc +configure-stage4-gcc: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gcc-bootstrap + +.PHONY: configure-stageprofile-gcc maybe-configure-stageprofile-gcc +maybe-configure-stageprofile-gcc: +@if gcc-bootstrap +maybe-configure-stageprofile-gcc: configure-stageprofile-gcc +configure-stageprofile-gcc: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gcc-bootstrap + +.PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc +maybe-configure-stagefeedback-gcc: +@if gcc-bootstrap +maybe-configure-stagefeedback-gcc: configure-stagefeedback-gcc +configure-stagefeedback-gcc: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/gcc ; \ + cd $(HOST_SUBDIR)/gcc || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gcc"; \ + libsrcdir="$$s/gcc"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif gcc-bootstrap + + + + + .PHONY: all-gcc maybe-all-gcc maybe-all-gcc: @if gcc @@ -9322,12 +10736,188 @@ all-gcc: configure-gcc @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) $(TARGET-gcc)) @endif gcc + + +.PHONY: all-stage1-gcc maybe-all-stage1-gcc +.PHONY: clean-stage1-gcc maybe-clean-stage1-gcc +maybe-all-stage1-gcc: +maybe-clean-stage1-gcc: +@if gcc-bootstrap +maybe-all-stage1-gcc: all-stage1-gcc +all-stage1: all-stage1-gcc +all-stage1-gcc: configure-stage1-gcc + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) + +maybe-clean-stage1-gcc: clean-stage1-gcc +clean-stage1: clean-stage1-gcc +clean-stage1-gcc: + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-gcc/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stage2-gcc maybe-all-stage2-gcc +.PHONY: clean-stage2-gcc maybe-clean-stage2-gcc +maybe-all-stage2-gcc: +maybe-clean-stage2-gcc: +@if gcc-bootstrap +maybe-all-stage2-gcc: all-stage2-gcc +all-stage2: all-stage2-gcc +all-stage2-gcc: configure-stage2-gcc + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) + +maybe-clean-stage2-gcc: clean-stage2-gcc +clean-stage2: clean-stage2-gcc +clean-stage2-gcc: + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-gcc/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stage3-gcc maybe-all-stage3-gcc +.PHONY: clean-stage3-gcc maybe-clean-stage3-gcc +maybe-all-stage3-gcc: +maybe-clean-stage3-gcc: +@if gcc-bootstrap +maybe-all-stage3-gcc: all-stage3-gcc +all-stage3: all-stage3-gcc +all-stage3-gcc: configure-stage3-gcc + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) + +maybe-clean-stage3-gcc: clean-stage3-gcc +clean-stage3: clean-stage3-gcc +clean-stage3-gcc: + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-gcc/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stage4-gcc maybe-all-stage4-gcc +.PHONY: clean-stage4-gcc maybe-clean-stage4-gcc +maybe-all-stage4-gcc: +maybe-clean-stage4-gcc: +@if gcc-bootstrap +maybe-all-stage4-gcc: all-stage4-gcc +all-stage4: all-stage4-gcc +all-stage4-gcc: configure-stage4-gcc + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) + +maybe-clean-stage4-gcc: clean-stage4-gcc +clean-stage4: clean-stage4-gcc +clean-stage4-gcc: + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-gcc/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stageprofile-gcc maybe-all-stageprofile-gcc +.PHONY: clean-stageprofile-gcc maybe-clean-stageprofile-gcc +maybe-all-stageprofile-gcc: +maybe-clean-stageprofile-gcc: +@if gcc-bootstrap +maybe-all-stageprofile-gcc: all-stageprofile-gcc +all-stageprofile: all-stageprofile-gcc +all-stageprofile-gcc: configure-stageprofile-gcc + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) + +maybe-clean-stageprofile-gcc: clean-stageprofile-gcc +clean-stageprofile: clean-stageprofile-gcc +clean-stageprofile-gcc: + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-gcc/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + +.PHONY: all-stagefeedback-gcc maybe-all-stagefeedback-gcc +.PHONY: clean-stagefeedback-gcc maybe-clean-stagefeedback-gcc +maybe-all-stagefeedback-gcc: +maybe-clean-stagefeedback-gcc: +@if gcc-bootstrap +maybe-all-stagefeedback-gcc: all-stagefeedback-gcc +all-stagefeedback: all-stagefeedback-gcc +all-stagefeedback-gcc: configure-stagefeedback-gcc + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) + +maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc +clean-stagefeedback: clean-stagefeedback-gcc +clean-stagefeedback-gcc: + @[ -f $(HOST_SUBDIR)/gcc/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-gcc/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/gcc/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/gcc && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean +@endif gcc-bootstrap + + + + + .PHONY: check-gcc maybe-check-gcc maybe-check-gcc: @if gcc @@ -9336,7 +10926,6 @@ maybe-check-gcc: check-gcc check-gcc: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) check) @@ -9351,7 +10940,6 @@ maybe-install-gcc: install-gcc install-gcc: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gcc && \ $(MAKE) $(FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) install) @@ -9370,7 +10958,6 @@ info-gcc: \ @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9396,7 +10983,6 @@ dvi-gcc: \ @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9422,7 +11008,6 @@ html-gcc: \ @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9448,7 +11033,6 @@ TAGS-gcc: \ @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9475,7 +11059,6 @@ install-info-gcc: \ @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9501,7 +11084,6 @@ installcheck-gcc: \ @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9526,7 +11108,6 @@ mostlyclean-gcc: @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9551,7 +11132,6 @@ clean-gcc: @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9576,7 +11156,6 @@ distclean-gcc: @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9601,7 +11180,6 @@ maintainer-clean-gcc: @[ -f ./gcc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9618,18 +11196,19 @@ maintainer-clean-gcc: @endif gcc + .PHONY: configure-gawk maybe-configure-gawk maybe-configure-gawk: @if gawk maybe-configure-gawk: configure-gawk -configure-gawk: +configure-gawk: @test ! -f $(HOST_SUBDIR)/gawk/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gawk ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gawk; \ - cd $(HOST_SUBDIR)/gawk || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gawk; \ + cd "$(HOST_SUBDIR)/gawk" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gawk/ | \ @@ -9642,6 +11221,10 @@ configure-gawk: || exit 1 @endif gawk + + + + .PHONY: all-gawk maybe-all-gawk maybe-all-gawk: @if gawk @@ -9650,12 +11233,14 @@ maybe-all-gawk: all-gawk all-gawk: configure-gawk @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gawk && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gawk)) @endif gawk + + + .PHONY: check-gawk maybe-check-gawk maybe-check-gawk: @if gawk @@ -9664,7 +11249,6 @@ maybe-check-gawk: check-gawk check-gawk: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gawk && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -9679,7 +11263,6 @@ maybe-install-gawk: install-gawk install-gawk: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gawk && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -9698,7 +11281,6 @@ info-gawk: \ @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9724,7 +11306,6 @@ dvi-gawk: \ @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9750,7 +11331,6 @@ html-gawk: \ @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9776,7 +11356,6 @@ TAGS-gawk: \ @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9803,7 +11382,6 @@ install-info-gawk: \ @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9829,7 +11407,6 @@ installcheck-gawk: \ @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9854,7 +11431,6 @@ mostlyclean-gawk: @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9879,7 +11455,6 @@ clean-gawk: @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9904,7 +11479,6 @@ distclean-gawk: @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9929,7 +11503,6 @@ maintainer-clean-gawk: @[ -f ./gawk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -9946,18 +11519,19 @@ maintainer-clean-gawk: @endif gawk + .PHONY: configure-gettext maybe-configure-gettext maybe-configure-gettext: @if gettext maybe-configure-gettext: configure-gettext -configure-gettext: +configure-gettext: @test ! -f $(HOST_SUBDIR)/gettext/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gettext ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gettext; \ - cd $(HOST_SUBDIR)/gettext || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gettext; \ + cd "$(HOST_SUBDIR)/gettext" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gettext/ | \ @@ -9970,6 +11544,10 @@ configure-gettext: || exit 1 @endif gettext + + + + .PHONY: all-gettext maybe-all-gettext maybe-all-gettext: @if gettext @@ -9978,12 +11556,14 @@ maybe-all-gettext: all-gettext all-gettext: configure-gettext @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gettext && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gettext)) @endif gettext + + + .PHONY: check-gettext maybe-check-gettext maybe-check-gettext: @if gettext @@ -9992,7 +11572,6 @@ maybe-check-gettext: check-gettext check-gettext: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gettext && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -10007,7 +11586,6 @@ maybe-install-gettext: install-gettext install-gettext: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gettext && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -10026,7 +11604,6 @@ info-gettext: \ @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10052,7 +11629,6 @@ dvi-gettext: \ @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10078,7 +11654,6 @@ html-gettext: \ @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10104,7 +11679,6 @@ TAGS-gettext: \ @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10131,7 +11705,6 @@ install-info-gettext: \ @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10157,7 +11730,6 @@ installcheck-gettext: \ @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10182,7 +11754,6 @@ mostlyclean-gettext: @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10207,7 +11778,6 @@ clean-gettext: @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10232,7 +11802,6 @@ distclean-gettext: @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10257,7 +11826,6 @@ maintainer-clean-gettext: @[ -f ./gettext/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10274,18 +11842,19 @@ maintainer-clean-gettext: @endif gettext + .PHONY: configure-gnuserv maybe-configure-gnuserv maybe-configure-gnuserv: @if gnuserv maybe-configure-gnuserv: configure-gnuserv -configure-gnuserv: +configure-gnuserv: @test ! -f $(HOST_SUBDIR)/gnuserv/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gnuserv ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gnuserv; \ - cd $(HOST_SUBDIR)/gnuserv || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gnuserv; \ + cd "$(HOST_SUBDIR)/gnuserv" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gnuserv/ | \ @@ -10298,6 +11867,10 @@ configure-gnuserv: || exit 1 @endif gnuserv + + + + .PHONY: all-gnuserv maybe-all-gnuserv maybe-all-gnuserv: @if gnuserv @@ -10306,12 +11879,14 @@ maybe-all-gnuserv: all-gnuserv all-gnuserv: configure-gnuserv @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gnuserv && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gnuserv)) @endif gnuserv + + + .PHONY: check-gnuserv maybe-check-gnuserv maybe-check-gnuserv: @if gnuserv @@ -10320,7 +11895,6 @@ maybe-check-gnuserv: check-gnuserv check-gnuserv: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gnuserv && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -10335,7 +11909,6 @@ maybe-install-gnuserv: install-gnuserv install-gnuserv: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gnuserv && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -10354,7 +11927,6 @@ info-gnuserv: \ @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10380,7 +11952,6 @@ dvi-gnuserv: \ @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10406,7 +11977,6 @@ html-gnuserv: \ @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10432,7 +12002,6 @@ TAGS-gnuserv: \ @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10459,7 +12028,6 @@ install-info-gnuserv: \ @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10485,7 +12053,6 @@ installcheck-gnuserv: \ @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10510,7 +12077,6 @@ mostlyclean-gnuserv: @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10535,7 +12101,6 @@ clean-gnuserv: @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10560,7 +12125,6 @@ distclean-gnuserv: @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10585,7 +12149,6 @@ maintainer-clean-gnuserv: @[ -f ./gnuserv/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10602,18 +12165,19 @@ maintainer-clean-gnuserv: @endif gnuserv + .PHONY: configure-gprof maybe-configure-gprof maybe-configure-gprof: @if gprof maybe-configure-gprof: configure-gprof -configure-gprof: +configure-gprof: @test ! -f $(HOST_SUBDIR)/gprof/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gprof ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gprof; \ - cd $(HOST_SUBDIR)/gprof || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gprof; \ + cd "$(HOST_SUBDIR)/gprof" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gprof/ | \ @@ -10626,6 +12190,10 @@ configure-gprof: || exit 1 @endif gprof + + + + .PHONY: all-gprof maybe-all-gprof maybe-all-gprof: @if gprof @@ -10634,12 +12202,14 @@ maybe-all-gprof: all-gprof all-gprof: configure-gprof @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gprof && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gprof)) @endif gprof + + + .PHONY: check-gprof maybe-check-gprof maybe-check-gprof: @if gprof @@ -10648,7 +12218,6 @@ maybe-check-gprof: check-gprof check-gprof: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gprof && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -10663,7 +12232,6 @@ maybe-install-gprof: install-gprof install-gprof: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gprof && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -10682,7 +12250,6 @@ info-gprof: \ @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10708,7 +12275,6 @@ dvi-gprof: \ @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10734,7 +12300,6 @@ html-gprof: \ @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10760,7 +12325,6 @@ TAGS-gprof: \ @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10787,7 +12351,6 @@ install-info-gprof: \ @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10813,7 +12376,6 @@ installcheck-gprof: \ @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10838,7 +12400,6 @@ mostlyclean-gprof: @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10863,7 +12424,6 @@ clean-gprof: @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10888,7 +12448,6 @@ distclean-gprof: @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10913,7 +12472,6 @@ maintainer-clean-gprof: @[ -f ./gprof/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -10930,18 +12488,19 @@ maintainer-clean-gprof: @endif gprof + .PHONY: configure-gzip maybe-configure-gzip maybe-configure-gzip: @if gzip maybe-configure-gzip: configure-gzip -configure-gzip: +configure-gzip: @test ! -f $(HOST_SUBDIR)/gzip/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gzip ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gzip; \ - cd $(HOST_SUBDIR)/gzip || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gzip; \ + cd "$(HOST_SUBDIR)/gzip" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gzip/ | \ @@ -10954,6 +12513,10 @@ configure-gzip: || exit 1 @endif gzip + + + + .PHONY: all-gzip maybe-all-gzip maybe-all-gzip: @if gzip @@ -10962,12 +12525,14 @@ maybe-all-gzip: all-gzip all-gzip: configure-gzip @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gzip && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gzip)) @endif gzip + + + .PHONY: check-gzip maybe-check-gzip maybe-check-gzip: @if gzip @@ -10976,7 +12541,6 @@ maybe-check-gzip: check-gzip check-gzip: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gzip && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -10991,7 +12555,6 @@ maybe-install-gzip: install-gzip install-gzip: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gzip && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -11010,7 +12573,6 @@ info-gzip: \ @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11036,7 +12598,6 @@ dvi-gzip: \ @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11062,7 +12623,6 @@ html-gzip: \ @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11088,7 +12648,6 @@ TAGS-gzip: \ @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11115,7 +12674,6 @@ install-info-gzip: \ @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11141,7 +12699,6 @@ installcheck-gzip: \ @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11166,7 +12723,6 @@ mostlyclean-gzip: @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11191,7 +12747,6 @@ clean-gzip: @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11216,7 +12771,6 @@ distclean-gzip: @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11241,7 +12795,6 @@ maintainer-clean-gzip: @[ -f ./gzip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11258,18 +12811,19 @@ maintainer-clean-gzip: @endif gzip + .PHONY: configure-hello maybe-configure-hello maybe-configure-hello: @if hello maybe-configure-hello: configure-hello -configure-hello: +configure-hello: @test ! -f $(HOST_SUBDIR)/hello/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/hello ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in hello; \ - cd $(HOST_SUBDIR)/hello || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/hello; \ + cd "$(HOST_SUBDIR)/hello" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/hello/ | \ @@ -11282,6 +12836,10 @@ configure-hello: || exit 1 @endif hello + + + + .PHONY: all-hello maybe-all-hello maybe-all-hello: @if hello @@ -11290,12 +12848,14 @@ maybe-all-hello: all-hello all-hello: configure-hello @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/hello && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-hello)) @endif hello + + + .PHONY: check-hello maybe-check-hello maybe-check-hello: @if hello @@ -11304,7 +12864,6 @@ maybe-check-hello: check-hello check-hello: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/hello && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -11319,7 +12878,6 @@ maybe-install-hello: install-hello install-hello: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/hello && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -11338,7 +12896,6 @@ info-hello: \ @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11364,7 +12921,6 @@ dvi-hello: \ @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11390,7 +12946,6 @@ html-hello: \ @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11416,7 +12971,6 @@ TAGS-hello: \ @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11443,7 +12997,6 @@ install-info-hello: \ @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11469,7 +13022,6 @@ installcheck-hello: \ @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11494,7 +13046,6 @@ mostlyclean-hello: @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11519,7 +13070,6 @@ clean-hello: @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11544,7 +13094,6 @@ distclean-hello: @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11569,7 +13118,6 @@ maintainer-clean-hello: @[ -f ./hello/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11586,18 +13134,19 @@ maintainer-clean-hello: @endif hello + .PHONY: configure-indent maybe-configure-indent maybe-configure-indent: @if indent maybe-configure-indent: configure-indent -configure-indent: +configure-indent: @test ! -f $(HOST_SUBDIR)/indent/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/indent ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in indent; \ - cd $(HOST_SUBDIR)/indent || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/indent; \ + cd "$(HOST_SUBDIR)/indent" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/indent/ | \ @@ -11610,6 +13159,10 @@ configure-indent: || exit 1 @endif indent + + + + .PHONY: all-indent maybe-all-indent maybe-all-indent: @if indent @@ -11618,12 +13171,14 @@ maybe-all-indent: all-indent all-indent: configure-indent @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/indent && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-indent)) @endif indent + + + .PHONY: check-indent maybe-check-indent maybe-check-indent: @if indent @@ -11632,7 +13187,6 @@ maybe-check-indent: check-indent check-indent: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/indent && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -11647,7 +13201,6 @@ maybe-install-indent: install-indent install-indent: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/indent && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -11666,7 +13219,6 @@ info-indent: \ @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11692,7 +13244,6 @@ dvi-indent: \ @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11718,7 +13269,6 @@ html-indent: \ @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11744,7 +13294,6 @@ TAGS-indent: \ @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11771,7 +13320,6 @@ install-info-indent: \ @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11797,7 +13345,6 @@ installcheck-indent: \ @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11822,7 +13369,6 @@ mostlyclean-indent: @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11847,7 +13393,6 @@ clean-indent: @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11872,7 +13417,6 @@ distclean-indent: @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11897,7 +13441,6 @@ maintainer-clean-indent: @[ -f ./indent/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -11914,19 +13457,20 @@ maintainer-clean-indent: @endif indent + .PHONY: configure-intl maybe-configure-intl maybe-configure-intl: @if intl maybe-configure-intl: configure-intl -configure-intl: +configure-intl: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in intl; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/intl; \ + cd "$(HOST_SUBDIR)/intl" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ @@ -11939,6 +13483,161 @@ configure-intl: || exit 1 @endif intl + + +.PHONY: configure-stage1-intl maybe-configure-stage1-intl +maybe-configure-stage1-intl: +@if intl-bootstrap +maybe-configure-stage1-intl: configure-stage1-intl +configure-stage1-intl: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif intl-bootstrap + +.PHONY: configure-stage2-intl maybe-configure-stage2-intl +maybe-configure-stage2-intl: +@if intl-bootstrap +maybe-configure-stage2-intl: configure-stage2-intl +configure-stage2-intl: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif intl-bootstrap + +.PHONY: configure-stage3-intl maybe-configure-stage3-intl +maybe-configure-stage3-intl: +@if intl-bootstrap +maybe-configure-stage3-intl: configure-stage3-intl +configure-stage3-intl: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif intl-bootstrap + +.PHONY: configure-stage4-intl maybe-configure-stage4-intl +maybe-configure-stage4-intl: +@if intl-bootstrap +maybe-configure-stage4-intl: configure-stage4-intl +configure-stage4-intl: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif intl-bootstrap + +.PHONY: configure-stageprofile-intl maybe-configure-stageprofile-intl +maybe-configure-stageprofile-intl: +@if intl-bootstrap +maybe-configure-stageprofile-intl: configure-stageprofile-intl +configure-stageprofile-intl: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif intl-bootstrap + +.PHONY: configure-stagefeedback-intl maybe-configure-stagefeedback-intl +maybe-configure-stagefeedback-intl: +@if intl-bootstrap +maybe-configure-stagefeedback-intl: configure-stagefeedback-intl +configure-stagefeedback-intl: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/intl/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/intl ; \ + cd $(HOST_SUBDIR)/intl || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/intl"; \ + libsrcdir="$$s/intl"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif intl-bootstrap + + + + + .PHONY: all-intl maybe-all-intl maybe-all-intl: @if intl @@ -11948,12 +13647,188 @@ all-intl: configure-intl @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-intl)) @endif intl + + +.PHONY: all-stage1-intl maybe-all-stage1-intl +.PHONY: clean-stage1-intl maybe-clean-stage1-intl +maybe-all-stage1-intl: +maybe-clean-stage1-intl: +@if intl-bootstrap +maybe-all-stage1-intl: all-stage1-intl +all-stage1: all-stage1-intl +all-stage1-intl: configure-stage1-intl + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-intl: clean-stage1-intl +clean-stage1: clean-stage1-intl +clean-stage1-intl: + @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-intl/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif intl-bootstrap + + +.PHONY: all-stage2-intl maybe-all-stage2-intl +.PHONY: clean-stage2-intl maybe-clean-stage2-intl +maybe-all-stage2-intl: +maybe-clean-stage2-intl: +@if intl-bootstrap +maybe-all-stage2-intl: all-stage2-intl +all-stage2: all-stage2-intl +all-stage2-intl: configure-stage2-intl + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-intl: clean-stage2-intl +clean-stage2: clean-stage2-intl +clean-stage2-intl: + @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-intl/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stage3-intl maybe-all-stage3-intl +.PHONY: clean-stage3-intl maybe-clean-stage3-intl +maybe-all-stage3-intl: +maybe-clean-stage3-intl: +@if intl-bootstrap +maybe-all-stage3-intl: all-stage3-intl +all-stage3: all-stage3-intl +all-stage3-intl: configure-stage3-intl + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-intl: clean-stage3-intl +clean-stage3: clean-stage3-intl +clean-stage3-intl: + @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-intl/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stage4-intl maybe-all-stage4-intl +.PHONY: clean-stage4-intl maybe-clean-stage4-intl +maybe-all-stage4-intl: +maybe-clean-stage4-intl: +@if intl-bootstrap +maybe-all-stage4-intl: all-stage4-intl +all-stage4: all-stage4-intl +all-stage4-intl: configure-stage4-intl + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-intl: clean-stage4-intl +clean-stage4: clean-stage4-intl +clean-stage4-intl: + @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-intl/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif intl-bootstrap + + +.PHONY: all-stageprofile-intl maybe-all-stageprofile-intl +.PHONY: clean-stageprofile-intl maybe-clean-stageprofile-intl +maybe-all-stageprofile-intl: +maybe-clean-stageprofile-intl: +@if intl-bootstrap +maybe-all-stageprofile-intl: all-stageprofile-intl +all-stageprofile: all-stageprofile-intl +all-stageprofile-intl: configure-stageprofile-intl + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-intl: clean-stageprofile-intl +clean-stageprofile: clean-stageprofile-intl +clean-stageprofile-intl: + @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-intl/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif intl-bootstrap + + +.PHONY: all-stagefeedback-intl maybe-all-stagefeedback-intl +.PHONY: clean-stagefeedback-intl maybe-clean-stagefeedback-intl +maybe-all-stagefeedback-intl: +maybe-clean-stagefeedback-intl: +@if intl-bootstrap +maybe-all-stagefeedback-intl: all-stagefeedback-intl +all-stagefeedback: all-stagefeedback-intl +all-stagefeedback-intl: configure-stagefeedback-intl + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-intl: clean-stagefeedback-intl +clean-stagefeedback: clean-stagefeedback-intl +clean-stagefeedback-intl: + @[ -f $(HOST_SUBDIR)/intl/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-intl/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/intl/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/intl && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif intl-bootstrap + + + + + .PHONY: check-intl maybe-check-intl maybe-check-intl: @if intl @@ -11962,7 +13837,6 @@ maybe-check-intl: check-intl check-intl: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -11977,7 +13851,6 @@ maybe-install-intl: install-intl install-intl: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/intl && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -11996,7 +13869,6 @@ info-intl: \ @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12022,7 +13894,6 @@ dvi-intl: \ @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12048,7 +13919,6 @@ html-intl: \ @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12074,7 +13944,6 @@ TAGS-intl: \ @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12101,7 +13970,6 @@ install-info-intl: \ @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12127,7 +13995,6 @@ installcheck-intl: \ @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12152,7 +14019,6 @@ mostlyclean-intl: @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12177,7 +14043,6 @@ clean-intl: @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12202,7 +14067,6 @@ distclean-intl: @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12227,7 +14091,6 @@ maintainer-clean-intl: @[ -f ./intl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12244,18 +14107,19 @@ maintainer-clean-intl: @endif intl + .PHONY: configure-tcl maybe-configure-tcl maybe-configure-tcl: @if tcl maybe-configure-tcl: configure-tcl -configure-tcl: +configure-tcl: @test ! -f $(HOST_SUBDIR)/tcl/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tcl ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in tcl; \ - cd $(HOST_SUBDIR)/tcl || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/tcl; \ + cd "$(HOST_SUBDIR)/tcl" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/tcl/ | \ @@ -12268,6 +14132,10 @@ configure-tcl: || exit 1 @endif tcl + + + + .PHONY: all-tcl maybe-all-tcl maybe-all-tcl: @if tcl @@ -12276,12 +14144,14 @@ maybe-all-tcl: all-tcl all-tcl: configure-tcl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tcl && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-tcl)) @endif tcl + + + .PHONY: check-tcl maybe-check-tcl maybe-check-tcl: @if tcl @@ -12290,7 +14160,6 @@ maybe-check-tcl: check-tcl check-tcl: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tcl && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -12305,7 +14174,6 @@ maybe-install-tcl: install-tcl install-tcl: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tcl && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -12324,7 +14192,6 @@ info-tcl: \ @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12350,7 +14217,6 @@ dvi-tcl: \ @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12376,7 +14242,6 @@ html-tcl: \ @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12402,7 +14267,6 @@ TAGS-tcl: \ @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12429,7 +14293,6 @@ install-info-tcl: \ @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12455,7 +14318,6 @@ installcheck-tcl: \ @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12490,7 +14352,6 @@ clean-tcl: @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12515,7 +14376,6 @@ distclean-tcl: @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12540,7 +14400,6 @@ maintainer-clean-tcl: @[ -f ./tcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12557,18 +14416,19 @@ maintainer-clean-tcl: @endif tcl + .PHONY: configure-itcl maybe-configure-itcl maybe-configure-itcl: @if itcl maybe-configure-itcl: configure-itcl -configure-itcl: +configure-itcl: @test ! -f $(HOST_SUBDIR)/itcl/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/itcl ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in itcl; \ - cd $(HOST_SUBDIR)/itcl || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/itcl; \ + cd "$(HOST_SUBDIR)/itcl" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/itcl/ | \ @@ -12581,6 +14441,10 @@ configure-itcl: || exit 1 @endif itcl + + + + .PHONY: all-itcl maybe-all-itcl maybe-all-itcl: @if itcl @@ -12589,12 +14453,14 @@ maybe-all-itcl: all-itcl all-itcl: configure-itcl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/itcl && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-itcl)) @endif itcl + + + .PHONY: check-itcl maybe-check-itcl maybe-check-itcl: @if itcl @@ -12603,7 +14469,6 @@ maybe-check-itcl: check-itcl check-itcl: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/itcl && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -12618,7 +14483,6 @@ maybe-install-itcl: install-itcl install-itcl: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/itcl && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -12637,7 +14501,6 @@ info-itcl: \ @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12663,7 +14526,6 @@ dvi-itcl: \ @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12689,7 +14551,6 @@ html-itcl: \ @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12715,7 +14576,6 @@ TAGS-itcl: \ @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12742,7 +14602,6 @@ install-info-itcl: \ @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12768,7 +14627,6 @@ installcheck-itcl: \ @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12793,7 +14651,6 @@ mostlyclean-itcl: @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12818,7 +14675,6 @@ clean-itcl: @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12843,7 +14699,6 @@ distclean-itcl: @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12868,7 +14723,6 @@ maintainer-clean-itcl: @[ -f ./itcl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12885,19 +14739,20 @@ maintainer-clean-itcl: @endif itcl + .PHONY: configure-ld maybe-configure-ld maybe-configure-ld: @if ld maybe-configure-ld: configure-ld -configure-ld: +configure-ld: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in ld; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/ld; \ + cd "$(HOST_SUBDIR)/ld" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ @@ -12910,6 +14765,161 @@ configure-ld: || exit 1 @endif ld + + +.PHONY: configure-stage1-ld maybe-configure-stage1-ld +maybe-configure-stage1-ld: +@if ld-bootstrap +maybe-configure-stage1-ld: configure-stage1-ld +configure-stage1-ld: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif ld-bootstrap + +.PHONY: configure-stage2-ld maybe-configure-stage2-ld +maybe-configure-stage2-ld: +@if ld-bootstrap +maybe-configure-stage2-ld: configure-stage2-ld +configure-stage2-ld: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif ld-bootstrap + +.PHONY: configure-stage3-ld maybe-configure-stage3-ld +maybe-configure-stage3-ld: +@if ld-bootstrap +maybe-configure-stage3-ld: configure-stage3-ld +configure-stage3-ld: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif ld-bootstrap + +.PHONY: configure-stage4-ld maybe-configure-stage4-ld +maybe-configure-stage4-ld: +@if ld-bootstrap +maybe-configure-stage4-ld: configure-stage4-ld +configure-stage4-ld: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif ld-bootstrap + +.PHONY: configure-stageprofile-ld maybe-configure-stageprofile-ld +maybe-configure-stageprofile-ld: +@if ld-bootstrap +maybe-configure-stageprofile-ld: configure-stageprofile-ld +configure-stageprofile-ld: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif ld-bootstrap + +.PHONY: configure-stagefeedback-ld maybe-configure-stagefeedback-ld +maybe-configure-stagefeedback-ld: +@if ld-bootstrap +maybe-configure-stagefeedback-ld: configure-stagefeedback-ld +configure-stagefeedback-ld: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/ld/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/ld ; \ + cd $(HOST_SUBDIR)/ld || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/ld"; \ + libsrcdir="$$s/ld"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif ld-bootstrap + + + + + .PHONY: all-ld maybe-all-ld maybe-all-ld: @if ld @@ -12919,12 +14929,188 @@ all-ld: configure-ld @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-ld)) @endif ld + + +.PHONY: all-stage1-ld maybe-all-stage1-ld +.PHONY: clean-stage1-ld maybe-clean-stage1-ld +maybe-all-stage1-ld: +maybe-clean-stage1-ld: +@if ld-bootstrap +maybe-all-stage1-ld: all-stage1-ld +all-stage1: all-stage1-ld +all-stage1-ld: configure-stage1-ld + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-ld: clean-stage1-ld +clean-stage1: clean-stage1-ld +clean-stage1-ld: + @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-ld/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif ld-bootstrap + + +.PHONY: all-stage2-ld maybe-all-stage2-ld +.PHONY: clean-stage2-ld maybe-clean-stage2-ld +maybe-all-stage2-ld: +maybe-clean-stage2-ld: +@if ld-bootstrap +maybe-all-stage2-ld: all-stage2-ld +all-stage2: all-stage2-ld +all-stage2-ld: configure-stage2-ld + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-ld: clean-stage2-ld +clean-stage2: clean-stage2-ld +clean-stage2-ld: + @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-ld/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stage3-ld maybe-all-stage3-ld +.PHONY: clean-stage3-ld maybe-clean-stage3-ld +maybe-all-stage3-ld: +maybe-clean-stage3-ld: +@if ld-bootstrap +maybe-all-stage3-ld: all-stage3-ld +all-stage3: all-stage3-ld +all-stage3-ld: configure-stage3-ld + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-ld: clean-stage3-ld +clean-stage3: clean-stage3-ld +clean-stage3-ld: + @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-ld/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stage4-ld maybe-all-stage4-ld +.PHONY: clean-stage4-ld maybe-clean-stage4-ld +maybe-all-stage4-ld: +maybe-clean-stage4-ld: +@if ld-bootstrap +maybe-all-stage4-ld: all-stage4-ld +all-stage4: all-stage4-ld +all-stage4-ld: configure-stage4-ld + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-ld: clean-stage4-ld +clean-stage4: clean-stage4-ld +clean-stage4-ld: + @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-ld/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif ld-bootstrap + + +.PHONY: all-stageprofile-ld maybe-all-stageprofile-ld +.PHONY: clean-stageprofile-ld maybe-clean-stageprofile-ld +maybe-all-stageprofile-ld: +maybe-clean-stageprofile-ld: +@if ld-bootstrap +maybe-all-stageprofile-ld: all-stageprofile-ld +all-stageprofile: all-stageprofile-ld +all-stageprofile-ld: configure-stageprofile-ld + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-ld: clean-stageprofile-ld +clean-stageprofile: clean-stageprofile-ld +clean-stageprofile-ld: + @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-ld/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif ld-bootstrap + + +.PHONY: all-stagefeedback-ld maybe-all-stagefeedback-ld +.PHONY: clean-stagefeedback-ld maybe-clean-stagefeedback-ld +maybe-all-stagefeedback-ld: +maybe-clean-stagefeedback-ld: +@if ld-bootstrap +maybe-all-stagefeedback-ld: all-stagefeedback-ld +all-stagefeedback: all-stagefeedback-ld +all-stagefeedback-ld: configure-stagefeedback-ld + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-ld: clean-stagefeedback-ld +clean-stagefeedback: clean-stagefeedback-ld +clean-stagefeedback-ld: + @[ -f $(HOST_SUBDIR)/ld/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-ld/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/ld/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/ld && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif ld-bootstrap + + + + + .PHONY: check-ld maybe-check-ld maybe-check-ld: @if ld @@ -12933,7 +15119,6 @@ maybe-check-ld: check-ld check-ld: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -12948,7 +15133,6 @@ maybe-install-ld: install-ld install-ld: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/ld && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -12967,7 +15151,6 @@ info-ld: \ @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -12993,7 +15176,6 @@ dvi-ld: \ @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13019,7 +15201,6 @@ html-ld: \ @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13045,7 +15226,6 @@ TAGS-ld: \ @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13072,7 +15252,6 @@ install-info-ld: \ @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13098,7 +15277,6 @@ installcheck-ld: \ @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13123,7 +15301,6 @@ mostlyclean-ld: @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13148,7 +15325,6 @@ clean-ld: @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13173,7 +15349,6 @@ distclean-ld: @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13198,7 +15373,6 @@ maintainer-clean-ld: @[ -f ./ld/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13215,19 +15389,20 @@ maintainer-clean-ld: @endif ld + .PHONY: configure-libcpp maybe-configure-libcpp maybe-configure-libcpp: @if libcpp maybe-configure-libcpp: configure-libcpp -configure-libcpp: +configure-libcpp: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in libcpp; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/libcpp; \ + cd "$(HOST_SUBDIR)/libcpp" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ @@ -13240,6 +15415,161 @@ configure-libcpp: || exit 1 @endif libcpp + + +.PHONY: configure-stage1-libcpp maybe-configure-stage1-libcpp +maybe-configure-stage1-libcpp: +@if libcpp-bootstrap +maybe-configure-stage1-libcpp: configure-stage1-libcpp +configure-stage1-libcpp: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif libcpp-bootstrap + +.PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp +maybe-configure-stage2-libcpp: +@if libcpp-bootstrap +maybe-configure-stage2-libcpp: configure-stage2-libcpp +configure-stage2-libcpp: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libcpp-bootstrap + +.PHONY: configure-stage3-libcpp maybe-configure-stage3-libcpp +maybe-configure-stage3-libcpp: +@if libcpp-bootstrap +maybe-configure-stage3-libcpp: configure-stage3-libcpp +configure-stage3-libcpp: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libcpp-bootstrap + +.PHONY: configure-stage4-libcpp maybe-configure-stage4-libcpp +maybe-configure-stage4-libcpp: +@if libcpp-bootstrap +maybe-configure-stage4-libcpp: configure-stage4-libcpp +configure-stage4-libcpp: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libcpp-bootstrap + +.PHONY: configure-stageprofile-libcpp maybe-configure-stageprofile-libcpp +maybe-configure-stageprofile-libcpp: +@if libcpp-bootstrap +maybe-configure-stageprofile-libcpp: configure-stageprofile-libcpp +configure-stageprofile-libcpp: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libcpp-bootstrap + +.PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp +maybe-configure-stagefeedback-libcpp: +@if libcpp-bootstrap +maybe-configure-stagefeedback-libcpp: configure-stagefeedback-libcpp +configure-stagefeedback-libcpp: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libcpp ; \ + cd $(HOST_SUBDIR)/libcpp || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libcpp"; \ + libsrcdir="$$s/libcpp"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libcpp-bootstrap + + + + + .PHONY: all-libcpp maybe-all-libcpp maybe-all-libcpp: @if libcpp @@ -13249,12 +15579,188 @@ all-libcpp: configure-libcpp @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libcpp)) @endif libcpp + + +.PHONY: all-stage1-libcpp maybe-all-stage1-libcpp +.PHONY: clean-stage1-libcpp maybe-clean-stage1-libcpp +maybe-all-stage1-libcpp: +maybe-clean-stage1-libcpp: +@if libcpp-bootstrap +maybe-all-stage1-libcpp: all-stage1-libcpp +all-stage1: all-stage1-libcpp +all-stage1-libcpp: configure-stage1-libcpp + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-libcpp: clean-stage1-libcpp +clean-stage1: clean-stage1-libcpp +clean-stage1-libcpp: + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libcpp/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif libcpp-bootstrap + + +.PHONY: all-stage2-libcpp maybe-all-stage2-libcpp +.PHONY: clean-stage2-libcpp maybe-clean-stage2-libcpp +maybe-all-stage2-libcpp: +maybe-clean-stage2-libcpp: +@if libcpp-bootstrap +maybe-all-stage2-libcpp: all-stage2-libcpp +all-stage2: all-stage2-libcpp +all-stage2-libcpp: configure-stage2-libcpp + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-libcpp: clean-stage2-libcpp +clean-stage2: clean-stage2-libcpp +clean-stage2-libcpp: + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libcpp/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stage3-libcpp maybe-all-stage3-libcpp +.PHONY: clean-stage3-libcpp maybe-clean-stage3-libcpp +maybe-all-stage3-libcpp: +maybe-clean-stage3-libcpp: +@if libcpp-bootstrap +maybe-all-stage3-libcpp: all-stage3-libcpp +all-stage3: all-stage3-libcpp +all-stage3-libcpp: configure-stage3-libcpp + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-libcpp: clean-stage3-libcpp +clean-stage3: clean-stage3-libcpp +clean-stage3-libcpp: + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libcpp/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stage4-libcpp maybe-all-stage4-libcpp +.PHONY: clean-stage4-libcpp maybe-clean-stage4-libcpp +maybe-all-stage4-libcpp: +maybe-clean-stage4-libcpp: +@if libcpp-bootstrap +maybe-all-stage4-libcpp: all-stage4-libcpp +all-stage4: all-stage4-libcpp +all-stage4-libcpp: configure-stage4-libcpp + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-libcpp: clean-stage4-libcpp +clean-stage4: clean-stage4-libcpp +clean-stage4-libcpp: + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libcpp/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libcpp-bootstrap + + +.PHONY: all-stageprofile-libcpp maybe-all-stageprofile-libcpp +.PHONY: clean-stageprofile-libcpp maybe-clean-stageprofile-libcpp +maybe-all-stageprofile-libcpp: +maybe-clean-stageprofile-libcpp: +@if libcpp-bootstrap +maybe-all-stageprofile-libcpp: all-stageprofile-libcpp +all-stageprofile: all-stageprofile-libcpp +all-stageprofile-libcpp: configure-stageprofile-libcpp + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp +clean-stageprofile: clean-stageprofile-libcpp +clean-stageprofile-libcpp: + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libcpp/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif libcpp-bootstrap + + +.PHONY: all-stagefeedback-libcpp maybe-all-stagefeedback-libcpp +.PHONY: clean-stagefeedback-libcpp maybe-clean-stagefeedback-libcpp +maybe-all-stagefeedback-libcpp: +maybe-clean-stagefeedback-libcpp: +@if libcpp-bootstrap +maybe-all-stagefeedback-libcpp: all-stagefeedback-libcpp +all-stagefeedback: all-stagefeedback-libcpp +all-stagefeedback-libcpp: configure-stagefeedback-libcpp + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp +clean-stagefeedback: clean-stagefeedback-libcpp +clean-stagefeedback-libcpp: + @[ -f $(HOST_SUBDIR)/libcpp/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libcpp/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/libcpp && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif libcpp-bootstrap + + + + + .PHONY: check-libcpp maybe-check-libcpp maybe-check-libcpp: @if libcpp @@ -13263,7 +15769,6 @@ maybe-check-libcpp: check-libcpp check-libcpp: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -13278,7 +15783,6 @@ maybe-install-libcpp: install-libcpp install-libcpp: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libcpp && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -13297,7 +15801,6 @@ info-libcpp: \ @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13323,7 +15826,6 @@ dvi-libcpp: \ @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13349,7 +15851,6 @@ html-libcpp: \ @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13375,7 +15876,6 @@ TAGS-libcpp: \ @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13402,7 +15902,6 @@ install-info-libcpp: \ @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13428,7 +15927,6 @@ installcheck-libcpp: \ @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13453,7 +15951,6 @@ mostlyclean-libcpp: @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13478,7 +15975,6 @@ clean-libcpp: @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13503,7 +15999,6 @@ distclean-libcpp: @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13528,7 +16023,6 @@ maintainer-clean-libcpp: @[ -f ./libcpp/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13545,18 +16039,19 @@ maintainer-clean-libcpp: @endif libcpp + .PHONY: configure-libgui maybe-configure-libgui maybe-configure-libgui: @if libgui maybe-configure-libgui: configure-libgui -configure-libgui: +configure-libgui: @test ! -f $(HOST_SUBDIR)/libgui/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libgui ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in libgui; \ - cd $(HOST_SUBDIR)/libgui || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/libgui; \ + cd "$(HOST_SUBDIR)/libgui" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/libgui/ | \ @@ -13569,6 +16064,10 @@ configure-libgui: || exit 1 @endif libgui + + + + .PHONY: all-libgui maybe-all-libgui maybe-all-libgui: @if libgui @@ -13577,12 +16076,14 @@ maybe-all-libgui: all-libgui all-libgui: configure-libgui @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libgui && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libgui)) @endif libgui + + + .PHONY: check-libgui maybe-check-libgui maybe-check-libgui: @if libgui @@ -13591,7 +16092,6 @@ maybe-check-libgui: check-libgui check-libgui: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libgui && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -13606,7 +16106,6 @@ maybe-install-libgui: install-libgui install-libgui: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libgui && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -13625,7 +16124,6 @@ info-libgui: \ @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13651,7 +16149,6 @@ dvi-libgui: \ @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13677,7 +16174,6 @@ html-libgui: \ @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13703,7 +16199,6 @@ TAGS-libgui: \ @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13730,7 +16225,6 @@ install-info-libgui: \ @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13756,7 +16250,6 @@ installcheck-libgui: \ @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13781,7 +16274,6 @@ mostlyclean-libgui: @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13806,7 +16298,6 @@ clean-libgui: @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13831,7 +16322,6 @@ distclean-libgui: @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13856,7 +16346,6 @@ maintainer-clean-libgui: @[ -f ./libgui/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13873,19 +16362,20 @@ maintainer-clean-libgui: @endif libgui + .PHONY: configure-libiberty maybe-configure-libiberty maybe-configure-libiberty: @if libiberty maybe-configure-libiberty: configure-libiberty -configure-libiberty: +configure-libiberty: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in libiberty; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/libiberty; \ + cd "$(HOST_SUBDIR)/libiberty" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ @@ -13898,6 +16388,161 @@ configure-libiberty: || exit 1 @endif libiberty + + +.PHONY: configure-stage1-libiberty maybe-configure-stage1-libiberty +maybe-configure-stage1-libiberty: +@if libiberty-bootstrap +maybe-configure-stage1-libiberty: configure-stage1-libiberty +configure-stage1-libiberty: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif libiberty-bootstrap + +.PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty +maybe-configure-stage2-libiberty: +@if libiberty-bootstrap +maybe-configure-stage2-libiberty: configure-stage2-libiberty +configure-stage2-libiberty: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libiberty-bootstrap + +.PHONY: configure-stage3-libiberty maybe-configure-stage3-libiberty +maybe-configure-stage3-libiberty: +@if libiberty-bootstrap +maybe-configure-stage3-libiberty: configure-stage3-libiberty +configure-stage3-libiberty: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libiberty-bootstrap + +.PHONY: configure-stage4-libiberty maybe-configure-stage4-libiberty +maybe-configure-stage4-libiberty: +@if libiberty-bootstrap +maybe-configure-stage4-libiberty: configure-stage4-libiberty +configure-stage4-libiberty: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libiberty-bootstrap + +.PHONY: configure-stageprofile-libiberty maybe-configure-stageprofile-libiberty +maybe-configure-stageprofile-libiberty: +@if libiberty-bootstrap +maybe-configure-stageprofile-libiberty: configure-stageprofile-libiberty +configure-stageprofile-libiberty: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libiberty-bootstrap + +.PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty +maybe-configure-stagefeedback-libiberty: +@if libiberty-bootstrap +maybe-configure-stagefeedback-libiberty: configure-stagefeedback-libiberty +configure-stagefeedback-libiberty: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/libiberty ; \ + cd $(HOST_SUBDIR)/libiberty || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif libiberty-bootstrap + + + + + .PHONY: all-libiberty maybe-all-libiberty maybe-all-libiberty: @if libiberty @@ -13907,12 +16552,188 @@ all-libiberty: configure-libiberty @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libiberty)) @endif libiberty + + +.PHONY: all-stage1-libiberty maybe-all-stage1-libiberty +.PHONY: clean-stage1-libiberty maybe-clean-stage1-libiberty +maybe-all-stage1-libiberty: +maybe-clean-stage1-libiberty: +@if libiberty-bootstrap +maybe-all-stage1-libiberty: all-stage1-libiberty +all-stage1: all-stage1-libiberty +all-stage1-libiberty: configure-stage1-libiberty + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-libiberty: clean-stage1-libiberty +clean-stage1: clean-stage1-libiberty +clean-stage1-libiberty: + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-libiberty/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif libiberty-bootstrap + + +.PHONY: all-stage2-libiberty maybe-all-stage2-libiberty +.PHONY: clean-stage2-libiberty maybe-clean-stage2-libiberty +maybe-all-stage2-libiberty: +maybe-clean-stage2-libiberty: +@if libiberty-bootstrap +maybe-all-stage2-libiberty: all-stage2-libiberty +all-stage2: all-stage2-libiberty +all-stage2-libiberty: configure-stage2-libiberty + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-libiberty: clean-stage2-libiberty +clean-stage2: clean-stage2-libiberty +clean-stage2-libiberty: + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-libiberty/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stage3-libiberty maybe-all-stage3-libiberty +.PHONY: clean-stage3-libiberty maybe-clean-stage3-libiberty +maybe-all-stage3-libiberty: +maybe-clean-stage3-libiberty: +@if libiberty-bootstrap +maybe-all-stage3-libiberty: all-stage3-libiberty +all-stage3: all-stage3-libiberty +all-stage3-libiberty: configure-stage3-libiberty + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-libiberty: clean-stage3-libiberty +clean-stage3: clean-stage3-libiberty +clean-stage3-libiberty: + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-libiberty/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stage4-libiberty maybe-all-stage4-libiberty +.PHONY: clean-stage4-libiberty maybe-clean-stage4-libiberty +maybe-all-stage4-libiberty: +maybe-clean-stage4-libiberty: +@if libiberty-bootstrap +maybe-all-stage4-libiberty: all-stage4-libiberty +all-stage4: all-stage4-libiberty +all-stage4-libiberty: configure-stage4-libiberty + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-libiberty: clean-stage4-libiberty +clean-stage4: clean-stage4-libiberty +clean-stage4-libiberty: + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-libiberty/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif libiberty-bootstrap + + +.PHONY: all-stageprofile-libiberty maybe-all-stageprofile-libiberty +.PHONY: clean-stageprofile-libiberty maybe-clean-stageprofile-libiberty +maybe-all-stageprofile-libiberty: +maybe-clean-stageprofile-libiberty: +@if libiberty-bootstrap +maybe-all-stageprofile-libiberty: all-stageprofile-libiberty +all-stageprofile: all-stageprofile-libiberty +all-stageprofile-libiberty: configure-stageprofile-libiberty + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty +clean-stageprofile: clean-stageprofile-libiberty +clean-stageprofile-libiberty: + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-libiberty/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif libiberty-bootstrap + + +.PHONY: all-stagefeedback-libiberty maybe-all-stagefeedback-libiberty +.PHONY: clean-stagefeedback-libiberty maybe-clean-stagefeedback-libiberty +maybe-all-stagefeedback-libiberty: +maybe-clean-stagefeedback-libiberty: +@if libiberty-bootstrap +maybe-all-stagefeedback-libiberty: all-stagefeedback-libiberty +all-stagefeedback: all-stagefeedback-libiberty +all-stagefeedback-libiberty: configure-stagefeedback-libiberty + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty +clean-stagefeedback: clean-stagefeedback-libiberty +clean-stagefeedback-libiberty: + @[ -f $(HOST_SUBDIR)/libiberty/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-libiberty/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/libiberty && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif libiberty-bootstrap + + + + + .PHONY: check-libiberty maybe-check-libiberty maybe-check-libiberty: @if libiberty @@ -13921,7 +16742,6 @@ maybe-check-libiberty: check-libiberty check-libiberty: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -13936,7 +16756,6 @@ maybe-install-libiberty: install-libiberty install-libiberty: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libiberty && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -13955,7 +16774,6 @@ info-libiberty: \ @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -13981,7 +16799,6 @@ dvi-libiberty: \ @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14007,7 +16824,6 @@ html-libiberty: \ @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14033,7 +16849,6 @@ TAGS-libiberty: \ @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14060,7 +16875,6 @@ install-info-libiberty: \ @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14086,7 +16900,6 @@ installcheck-libiberty: \ @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14111,7 +16924,6 @@ mostlyclean-libiberty: @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14136,7 +16948,6 @@ clean-libiberty: @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14161,7 +16972,6 @@ distclean-libiberty: @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14186,7 +16996,6 @@ maintainer-clean-libiberty: @[ -f ./libiberty/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14203,18 +17012,19 @@ maintainer-clean-libiberty: @endif libiberty + .PHONY: configure-libtool maybe-configure-libtool maybe-configure-libtool: @if libtool maybe-configure-libtool: configure-libtool -configure-libtool: +configure-libtool: @test ! -f $(HOST_SUBDIR)/libtool/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libtool ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in libtool; \ - cd $(HOST_SUBDIR)/libtool || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/libtool; \ + cd "$(HOST_SUBDIR)/libtool" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/libtool/ | \ @@ -14227,6 +17037,10 @@ configure-libtool: || exit 1 @endif libtool + + + + .PHONY: all-libtool maybe-all-libtool maybe-all-libtool: @if libtool @@ -14235,12 +17049,14 @@ maybe-all-libtool: all-libtool all-libtool: configure-libtool @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libtool && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libtool)) @endif libtool + + + .PHONY: check-libtool maybe-check-libtool maybe-check-libtool: @if libtool @@ -14249,7 +17065,6 @@ maybe-check-libtool: check-libtool check-libtool: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libtool && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -14264,7 +17079,6 @@ maybe-install-libtool: install-libtool install-libtool: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libtool && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -14283,7 +17097,6 @@ info-libtool: \ @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14309,7 +17122,6 @@ dvi-libtool: \ @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14335,7 +17147,6 @@ html-libtool: \ @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14361,7 +17172,6 @@ TAGS-libtool: \ @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14388,7 +17198,6 @@ install-info-libtool: \ @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14414,7 +17223,6 @@ installcheck-libtool: \ @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14439,7 +17247,6 @@ mostlyclean-libtool: @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14464,7 +17271,6 @@ clean-libtool: @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14489,7 +17295,6 @@ distclean-libtool: @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14514,7 +17319,6 @@ maintainer-clean-libtool: @[ -f ./libtool/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14531,18 +17335,19 @@ maintainer-clean-libtool: @endif libtool + .PHONY: configure-m4 maybe-configure-m4 maybe-configure-m4: @if m4 maybe-configure-m4: configure-m4 -configure-m4: +configure-m4: @test ! -f $(HOST_SUBDIR)/m4/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/m4 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in m4; \ - cd $(HOST_SUBDIR)/m4 || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/m4; \ + cd "$(HOST_SUBDIR)/m4" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/m4/ | \ @@ -14555,6 +17360,10 @@ configure-m4: || exit 1 @endif m4 + + + + .PHONY: all-m4 maybe-all-m4 maybe-all-m4: @if m4 @@ -14563,12 +17372,14 @@ maybe-all-m4: all-m4 all-m4: configure-m4 @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/m4 && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-m4)) @endif m4 + + + .PHONY: check-m4 maybe-check-m4 maybe-check-m4: @if m4 @@ -14577,7 +17388,6 @@ maybe-check-m4: check-m4 check-m4: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/m4 && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -14592,7 +17402,6 @@ maybe-install-m4: install-m4 install-m4: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/m4 && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -14611,7 +17420,6 @@ info-m4: \ @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14637,7 +17445,6 @@ dvi-m4: \ @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14663,7 +17470,6 @@ html-m4: \ @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14689,7 +17495,6 @@ TAGS-m4: \ @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14716,7 +17521,6 @@ install-info-m4: \ @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14742,7 +17546,6 @@ installcheck-m4: \ @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14767,7 +17570,6 @@ mostlyclean-m4: @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14792,7 +17594,6 @@ clean-m4: @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14817,7 +17618,6 @@ distclean-m4: @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14842,7 +17642,6 @@ maintainer-clean-m4: @[ -f ./m4/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14859,18 +17658,19 @@ maintainer-clean-m4: @endif m4 + .PHONY: configure-make maybe-configure-make maybe-configure-make: @if make maybe-configure-make: configure-make -configure-make: +configure-make: @test ! -f $(HOST_SUBDIR)/make/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/make ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in make; \ - cd $(HOST_SUBDIR)/make || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/make; \ + cd "$(HOST_SUBDIR)/make" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/make/ | \ @@ -14883,6 +17683,10 @@ configure-make: || exit 1 @endif make + + + + .PHONY: all-make maybe-all-make maybe-all-make: @if make @@ -14891,12 +17695,14 @@ maybe-all-make: all-make all-make: configure-make @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/make && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-make)) @endif make + + + .PHONY: check-make maybe-check-make maybe-check-make: @if make @@ -14905,7 +17711,6 @@ maybe-check-make: check-make check-make: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/make && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -14920,7 +17725,6 @@ maybe-install-make: install-make install-make: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/make && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -14939,7 +17743,6 @@ info-make: \ @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14965,7 +17768,6 @@ dvi-make: \ @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -14991,7 +17793,6 @@ html-make: \ @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15017,7 +17818,6 @@ TAGS-make: \ @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15044,7 +17844,6 @@ install-info-make: \ @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15070,7 +17869,6 @@ installcheck-make: \ @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15095,7 +17893,6 @@ mostlyclean-make: @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15120,7 +17917,6 @@ clean-make: @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15145,7 +17941,6 @@ distclean-make: @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15170,7 +17965,6 @@ maintainer-clean-make: @[ -f ./make/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15187,18 +17981,19 @@ maintainer-clean-make: @endif make + .PHONY: configure-mmalloc maybe-configure-mmalloc maybe-configure-mmalloc: @if mmalloc maybe-configure-mmalloc: configure-mmalloc -configure-mmalloc: +configure-mmalloc: @test ! -f $(HOST_SUBDIR)/mmalloc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mmalloc ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in mmalloc; \ - cd $(HOST_SUBDIR)/mmalloc || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/mmalloc; \ + cd "$(HOST_SUBDIR)/mmalloc" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/mmalloc/ | \ @@ -15211,6 +18006,10 @@ configure-mmalloc: || exit 1 @endif mmalloc + + + + .PHONY: all-mmalloc maybe-all-mmalloc maybe-all-mmalloc: @if mmalloc @@ -15219,12 +18018,14 @@ maybe-all-mmalloc: all-mmalloc all-mmalloc: configure-mmalloc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/mmalloc && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-mmalloc)) @endif mmalloc + + + .PHONY: check-mmalloc maybe-check-mmalloc maybe-check-mmalloc: @if mmalloc @@ -15242,7 +18043,6 @@ maybe-install-mmalloc: install-mmalloc install-mmalloc: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/mmalloc && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -15261,7 +18061,6 @@ info-mmalloc: \ @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15287,7 +18086,6 @@ dvi-mmalloc: \ @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15313,7 +18111,6 @@ html-mmalloc: \ @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15339,7 +18136,6 @@ TAGS-mmalloc: \ @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15366,7 +18162,6 @@ install-info-mmalloc: \ @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15392,7 +18187,6 @@ installcheck-mmalloc: \ @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15417,7 +18211,6 @@ mostlyclean-mmalloc: @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15442,7 +18235,6 @@ clean-mmalloc: @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15467,7 +18259,6 @@ distclean-mmalloc: @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15492,7 +18283,6 @@ maintainer-clean-mmalloc: @[ -f ./mmalloc/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15509,18 +18299,19 @@ maintainer-clean-mmalloc: @endif mmalloc + .PHONY: configure-patch maybe-configure-patch maybe-configure-patch: @if patch maybe-configure-patch: configure-patch -configure-patch: +configure-patch: @test ! -f $(HOST_SUBDIR)/patch/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/patch ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in patch; \ - cd $(HOST_SUBDIR)/patch || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/patch; \ + cd "$(HOST_SUBDIR)/patch" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/patch/ | \ @@ -15533,6 +18324,10 @@ configure-patch: || exit 1 @endif patch + + + + .PHONY: all-patch maybe-all-patch maybe-all-patch: @if patch @@ -15541,12 +18336,14 @@ maybe-all-patch: all-patch all-patch: configure-patch @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/patch && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-patch)) @endif patch + + + .PHONY: check-patch maybe-check-patch maybe-check-patch: @if patch @@ -15555,7 +18352,6 @@ maybe-check-patch: check-patch check-patch: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/patch && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -15570,7 +18366,6 @@ maybe-install-patch: install-patch install-patch: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/patch && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -15589,7 +18384,6 @@ info-patch: \ @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15615,7 +18409,6 @@ dvi-patch: \ @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15641,7 +18434,6 @@ html-patch: \ @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15667,7 +18459,6 @@ TAGS-patch: \ @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15694,7 +18485,6 @@ install-info-patch: \ @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15720,7 +18510,6 @@ installcheck-patch: \ @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15745,7 +18534,6 @@ mostlyclean-patch: @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15770,7 +18558,6 @@ clean-patch: @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15795,7 +18582,6 @@ distclean-patch: @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15820,7 +18606,6 @@ maintainer-clean-patch: @[ -f ./patch/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15837,18 +18622,19 @@ maintainer-clean-patch: @endif patch + .PHONY: configure-perl maybe-configure-perl maybe-configure-perl: @if perl maybe-configure-perl: configure-perl -configure-perl: +configure-perl: @test ! -f $(HOST_SUBDIR)/perl/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/perl ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in perl; \ - cd $(HOST_SUBDIR)/perl || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/perl; \ + cd "$(HOST_SUBDIR)/perl" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/perl/ | \ @@ -15861,6 +18647,10 @@ configure-perl: || exit 1 @endif perl + + + + .PHONY: all-perl maybe-all-perl maybe-all-perl: @if perl @@ -15869,12 +18659,14 @@ maybe-all-perl: all-perl all-perl: configure-perl @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/perl && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-perl)) @endif perl + + + .PHONY: check-perl maybe-check-perl maybe-check-perl: @if perl @@ -15883,7 +18675,6 @@ maybe-check-perl: check-perl check-perl: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/perl && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -15898,7 +18689,6 @@ maybe-install-perl: install-perl install-perl: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/perl && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -15917,7 +18707,6 @@ info-perl: \ @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15943,7 +18732,6 @@ dvi-perl: \ @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15969,7 +18757,6 @@ html-perl: \ @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -15995,7 +18782,6 @@ TAGS-perl: \ @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16022,7 +18808,6 @@ install-info-perl: \ @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16048,7 +18833,6 @@ installcheck-perl: \ @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16073,7 +18857,6 @@ mostlyclean-perl: @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16098,7 +18881,6 @@ clean-perl: @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16123,7 +18905,6 @@ distclean-perl: @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16148,7 +18929,6 @@ maintainer-clean-perl: @[ -f ./perl/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16165,18 +18945,19 @@ maintainer-clean-perl: @endif perl + .PHONY: configure-prms maybe-configure-prms maybe-configure-prms: @if prms maybe-configure-prms: configure-prms -configure-prms: +configure-prms: @test ! -f $(HOST_SUBDIR)/prms/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/prms ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in prms; \ - cd $(HOST_SUBDIR)/prms || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/prms; \ + cd "$(HOST_SUBDIR)/prms" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/prms/ | \ @@ -16189,6 +18970,10 @@ configure-prms: || exit 1 @endif prms + + + + .PHONY: all-prms maybe-all-prms maybe-all-prms: @if prms @@ -16197,12 +18982,14 @@ maybe-all-prms: all-prms all-prms: configure-prms @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/prms && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-prms)) @endif prms + + + .PHONY: check-prms maybe-check-prms maybe-check-prms: @if prms @@ -16211,7 +18998,6 @@ maybe-check-prms: check-prms check-prms: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/prms && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -16226,7 +19012,6 @@ maybe-install-prms: install-prms install-prms: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/prms && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -16245,7 +19030,6 @@ info-prms: \ @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16271,7 +19055,6 @@ dvi-prms: \ @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16297,7 +19080,6 @@ html-prms: \ @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16323,7 +19105,6 @@ TAGS-prms: \ @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16350,7 +19131,6 @@ install-info-prms: \ @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16376,7 +19156,6 @@ installcheck-prms: \ @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16401,7 +19180,6 @@ mostlyclean-prms: @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16426,7 +19204,6 @@ clean-prms: @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16451,7 +19228,6 @@ distclean-prms: @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16476,7 +19252,6 @@ maintainer-clean-prms: @[ -f ./prms/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16493,18 +19268,19 @@ maintainer-clean-prms: @endif prms + .PHONY: configure-rcs maybe-configure-rcs maybe-configure-rcs: @if rcs maybe-configure-rcs: configure-rcs -configure-rcs: +configure-rcs: @test ! -f $(HOST_SUBDIR)/rcs/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/rcs ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in rcs; \ - cd $(HOST_SUBDIR)/rcs || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/rcs; \ + cd "$(HOST_SUBDIR)/rcs" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/rcs/ | \ @@ -16517,6 +19293,10 @@ configure-rcs: || exit 1 @endif rcs + + + + .PHONY: all-rcs maybe-all-rcs maybe-all-rcs: @if rcs @@ -16525,12 +19305,14 @@ maybe-all-rcs: all-rcs all-rcs: configure-rcs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/rcs && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-rcs)) @endif rcs + + + .PHONY: check-rcs maybe-check-rcs maybe-check-rcs: @if rcs @@ -16539,7 +19321,6 @@ maybe-check-rcs: check-rcs check-rcs: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/rcs && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -16554,7 +19335,6 @@ maybe-install-rcs: install-rcs install-rcs: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/rcs && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -16573,7 +19353,6 @@ info-rcs: \ @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16599,7 +19378,6 @@ dvi-rcs: \ @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16625,7 +19403,6 @@ html-rcs: \ @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16651,7 +19428,6 @@ TAGS-rcs: \ @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16678,7 +19454,6 @@ install-info-rcs: \ @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16704,7 +19479,6 @@ installcheck-rcs: \ @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16729,7 +19503,6 @@ mostlyclean-rcs: @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16754,7 +19527,6 @@ clean-rcs: @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16779,7 +19551,6 @@ distclean-rcs: @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16804,7 +19575,6 @@ maintainer-clean-rcs: @[ -f ./rcs/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16821,18 +19591,19 @@ maintainer-clean-rcs: @endif rcs + .PHONY: configure-readline maybe-configure-readline maybe-configure-readline: @if readline maybe-configure-readline: configure-readline -configure-readline: +configure-readline: @test ! -f $(HOST_SUBDIR)/readline/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/readline ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in readline; \ - cd $(HOST_SUBDIR)/readline || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/readline; \ + cd "$(HOST_SUBDIR)/readline" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/readline/ | \ @@ -16845,6 +19616,10 @@ configure-readline: || exit 1 @endif readline + + + + .PHONY: all-readline maybe-all-readline maybe-all-readline: @if readline @@ -16853,12 +19628,14 @@ maybe-all-readline: all-readline all-readline: configure-readline @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/readline && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-readline)) @endif readline + + + .PHONY: check-readline maybe-check-readline maybe-check-readline: @if readline @@ -16867,7 +19644,6 @@ maybe-check-readline: check-readline check-readline: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/readline && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -16882,7 +19658,6 @@ maybe-install-readline: install-readline install-readline: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/readline && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -16901,7 +19676,6 @@ info-readline: \ @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16927,7 +19701,6 @@ dvi-readline: \ @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16953,7 +19726,6 @@ html-readline: \ @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -16979,7 +19751,6 @@ TAGS-readline: \ @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17006,7 +19777,6 @@ install-info-readline: \ @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17032,7 +19802,6 @@ installcheck-readline: \ @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17057,7 +19826,6 @@ mostlyclean-readline: @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17082,7 +19850,6 @@ clean-readline: @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17107,7 +19874,6 @@ distclean-readline: @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17132,7 +19898,6 @@ maintainer-clean-readline: @[ -f ./readline/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17149,18 +19914,19 @@ maintainer-clean-readline: @endif readline + .PHONY: configure-release maybe-configure-release maybe-configure-release: @if release maybe-configure-release: configure-release -configure-release: +configure-release: @test ! -f $(HOST_SUBDIR)/release/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/release ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in release; \ - cd $(HOST_SUBDIR)/release || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/release; \ + cd "$(HOST_SUBDIR)/release" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/release/ | \ @@ -17173,6 +19939,10 @@ configure-release: || exit 1 @endif release + + + + .PHONY: all-release maybe-all-release maybe-all-release: @if release @@ -17181,12 +19951,14 @@ maybe-all-release: all-release all-release: configure-release @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/release && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-release)) @endif release + + + .PHONY: check-release maybe-check-release maybe-check-release: @if release @@ -17217,7 +19989,6 @@ info-release: \ @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17243,7 +20014,6 @@ dvi-release: \ @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17269,7 +20039,6 @@ html-release: \ @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17295,7 +20064,6 @@ TAGS-release: \ @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17322,7 +20090,6 @@ install-info-release: \ @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17348,7 +20115,6 @@ installcheck-release: \ @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17373,7 +20139,6 @@ mostlyclean-release: @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17398,7 +20163,6 @@ clean-release: @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17423,7 +20187,6 @@ distclean-release: @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17448,7 +20211,6 @@ maintainer-clean-release: @[ -f ./release/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17465,18 +20227,19 @@ maintainer-clean-release: @endif release + .PHONY: configure-recode maybe-configure-recode maybe-configure-recode: @if recode maybe-configure-recode: configure-recode -configure-recode: +configure-recode: @test ! -f $(HOST_SUBDIR)/recode/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/recode ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in recode; \ - cd $(HOST_SUBDIR)/recode || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/recode; \ + cd "$(HOST_SUBDIR)/recode" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/recode/ | \ @@ -17489,6 +20252,10 @@ configure-recode: || exit 1 @endif recode + + + + .PHONY: all-recode maybe-all-recode maybe-all-recode: @if recode @@ -17497,12 +20264,14 @@ maybe-all-recode: all-recode all-recode: configure-recode @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/recode && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-recode)) @endif recode + + + .PHONY: check-recode maybe-check-recode maybe-check-recode: @if recode @@ -17511,7 +20280,6 @@ maybe-check-recode: check-recode check-recode: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/recode && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -17526,7 +20294,6 @@ maybe-install-recode: install-recode install-recode: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/recode && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -17545,7 +20312,6 @@ info-recode: \ @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17571,7 +20337,6 @@ dvi-recode: \ @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17597,7 +20362,6 @@ html-recode: \ @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17623,7 +20387,6 @@ TAGS-recode: \ @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17650,7 +20413,6 @@ install-info-recode: \ @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17676,7 +20438,6 @@ installcheck-recode: \ @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17701,7 +20462,6 @@ mostlyclean-recode: @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17726,7 +20486,6 @@ clean-recode: @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17751,7 +20510,6 @@ distclean-recode: @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17776,7 +20534,6 @@ maintainer-clean-recode: @[ -f ./recode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17793,18 +20550,19 @@ maintainer-clean-recode: @endif recode + .PHONY: configure-sed maybe-configure-sed maybe-configure-sed: @if sed maybe-configure-sed: configure-sed -configure-sed: +configure-sed: @test ! -f $(HOST_SUBDIR)/sed/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sed ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in sed; \ - cd $(HOST_SUBDIR)/sed || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/sed; \ + cd "$(HOST_SUBDIR)/sed" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/sed/ | \ @@ -17817,6 +20575,10 @@ configure-sed: || exit 1 @endif sed + + + + .PHONY: all-sed maybe-all-sed maybe-all-sed: @if sed @@ -17825,12 +20587,14 @@ maybe-all-sed: all-sed all-sed: configure-sed @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sed && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sed)) @endif sed + + + .PHONY: check-sed maybe-check-sed maybe-check-sed: @if sed @@ -17839,7 +20603,6 @@ maybe-check-sed: check-sed check-sed: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sed && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -17854,7 +20617,6 @@ maybe-install-sed: install-sed install-sed: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sed && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -17873,7 +20635,6 @@ info-sed: \ @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17899,7 +20660,6 @@ dvi-sed: \ @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17925,7 +20685,6 @@ html-sed: \ @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17951,7 +20710,6 @@ TAGS-sed: \ @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -17978,7 +20736,6 @@ install-info-sed: \ @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18004,7 +20761,6 @@ installcheck-sed: \ @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18029,7 +20785,6 @@ mostlyclean-sed: @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18054,7 +20809,6 @@ clean-sed: @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18079,7 +20833,6 @@ distclean-sed: @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18104,7 +20857,6 @@ maintainer-clean-sed: @[ -f ./sed/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18121,18 +20873,19 @@ maintainer-clean-sed: @endif sed + .PHONY: configure-send-pr maybe-configure-send-pr maybe-configure-send-pr: @if send-pr maybe-configure-send-pr: configure-send-pr -configure-send-pr: +configure-send-pr: @test ! -f $(HOST_SUBDIR)/send-pr/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/send-pr ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in send-pr; \ - cd $(HOST_SUBDIR)/send-pr || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/send-pr; \ + cd "$(HOST_SUBDIR)/send-pr" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/send-pr/ | \ @@ -18145,6 +20898,10 @@ configure-send-pr: || exit 1 @endif send-pr + + + + .PHONY: all-send-pr maybe-all-send-pr maybe-all-send-pr: @if send-pr @@ -18153,12 +20910,14 @@ maybe-all-send-pr: all-send-pr all-send-pr: configure-send-pr @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/send-pr && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-send-pr)) @endif send-pr + + + .PHONY: check-send-pr maybe-check-send-pr maybe-check-send-pr: @if send-pr @@ -18167,7 +20926,6 @@ maybe-check-send-pr: check-send-pr check-send-pr: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/send-pr && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -18182,7 +20940,6 @@ maybe-install-send-pr: install-send-pr install-send-pr: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/send-pr && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -18201,7 +20958,6 @@ info-send-pr: \ @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18227,7 +20983,6 @@ dvi-send-pr: \ @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18253,7 +21008,6 @@ html-send-pr: \ @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18279,7 +21033,6 @@ TAGS-send-pr: \ @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18306,7 +21059,6 @@ install-info-send-pr: \ @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18332,7 +21084,6 @@ installcheck-send-pr: \ @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18357,7 +21108,6 @@ mostlyclean-send-pr: @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18382,7 +21132,6 @@ clean-send-pr: @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18407,7 +21156,6 @@ distclean-send-pr: @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18432,7 +21180,6 @@ maintainer-clean-send-pr: @[ -f ./send-pr/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18449,18 +21196,19 @@ maintainer-clean-send-pr: @endif send-pr + .PHONY: configure-shellutils maybe-configure-shellutils maybe-configure-shellutils: @if shellutils maybe-configure-shellutils: configure-shellutils -configure-shellutils: +configure-shellutils: @test ! -f $(HOST_SUBDIR)/shellutils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/shellutils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in shellutils; \ - cd $(HOST_SUBDIR)/shellutils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/shellutils; \ + cd "$(HOST_SUBDIR)/shellutils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/shellutils/ | \ @@ -18473,6 +21221,10 @@ configure-shellutils: || exit 1 @endif shellutils + + + + .PHONY: all-shellutils maybe-all-shellutils maybe-all-shellutils: @if shellutils @@ -18481,12 +21233,14 @@ maybe-all-shellutils: all-shellutils all-shellutils: configure-shellutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/shellutils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-shellutils)) @endif shellutils + + + .PHONY: check-shellutils maybe-check-shellutils maybe-check-shellutils: @if shellutils @@ -18495,7 +21249,6 @@ maybe-check-shellutils: check-shellutils check-shellutils: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/shellutils && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -18510,7 +21263,6 @@ maybe-install-shellutils: install-shellutils install-shellutils: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/shellutils && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -18529,7 +21281,6 @@ info-shellutils: \ @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18555,7 +21306,6 @@ dvi-shellutils: \ @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18581,7 +21331,6 @@ html-shellutils: \ @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18607,7 +21356,6 @@ TAGS-shellutils: \ @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18634,7 +21382,6 @@ install-info-shellutils: \ @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18660,7 +21407,6 @@ installcheck-shellutils: \ @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18685,7 +21431,6 @@ mostlyclean-shellutils: @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18710,7 +21455,6 @@ clean-shellutils: @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18735,7 +21479,6 @@ distclean-shellutils: @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18760,7 +21503,6 @@ maintainer-clean-shellutils: @[ -f ./shellutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18777,18 +21519,19 @@ maintainer-clean-shellutils: @endif shellutils + .PHONY: configure-sid maybe-configure-sid maybe-configure-sid: @if sid maybe-configure-sid: configure-sid -configure-sid: +configure-sid: @test ! -f $(HOST_SUBDIR)/sid/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sid ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in sid; \ - cd $(HOST_SUBDIR)/sid || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/sid; \ + cd "$(HOST_SUBDIR)/sid" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/sid/ | \ @@ -18801,6 +21544,10 @@ configure-sid: || exit 1 @endif sid + + + + .PHONY: all-sid maybe-all-sid maybe-all-sid: @if sid @@ -18809,12 +21556,14 @@ maybe-all-sid: all-sid all-sid: configure-sid @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sid && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sid)) @endif sid + + + .PHONY: check-sid maybe-check-sid maybe-check-sid: @if sid @@ -18823,7 +21572,6 @@ maybe-check-sid: check-sid check-sid: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sid && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -18838,7 +21586,6 @@ maybe-install-sid: install-sid install-sid: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sid && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -18857,7 +21604,6 @@ info-sid: \ @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18883,7 +21629,6 @@ dvi-sid: \ @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18909,7 +21654,6 @@ html-sid: \ @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18935,7 +21679,6 @@ TAGS-sid: \ @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18962,7 +21705,6 @@ install-info-sid: \ @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -18988,7 +21730,6 @@ installcheck-sid: \ @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19013,7 +21754,6 @@ mostlyclean-sid: @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19038,7 +21778,6 @@ clean-sid: @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19063,7 +21802,6 @@ distclean-sid: @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19088,7 +21826,6 @@ maintainer-clean-sid: @[ -f ./sid/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19105,18 +21842,19 @@ maintainer-clean-sid: @endif sid + .PHONY: configure-sim maybe-configure-sim maybe-configure-sim: @if sim maybe-configure-sim: configure-sim -configure-sim: +configure-sim: @test ! -f $(HOST_SUBDIR)/sim/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/sim ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in sim; \ - cd $(HOST_SUBDIR)/sim || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/sim; \ + cd "$(HOST_SUBDIR)/sim" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/sim/ | \ @@ -19129,6 +21867,10 @@ configure-sim: || exit 1 @endif sim + + + + .PHONY: all-sim maybe-all-sim maybe-all-sim: @if sim @@ -19137,12 +21879,14 @@ maybe-all-sim: all-sim all-sim: configure-sim @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sim && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-sim)) @endif sim + + + .PHONY: check-sim maybe-check-sim maybe-check-sim: @if sim @@ -19151,7 +21895,6 @@ maybe-check-sim: check-sim check-sim: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sim && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -19166,7 +21909,6 @@ maybe-install-sim: install-sim install-sim: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/sim && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -19185,7 +21927,6 @@ info-sim: \ @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19211,7 +21952,6 @@ dvi-sim: \ @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19237,7 +21977,6 @@ html-sim: \ @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19263,7 +22002,6 @@ TAGS-sim: \ @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19290,7 +22028,6 @@ install-info-sim: \ @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19316,7 +22053,6 @@ installcheck-sim: \ @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19341,7 +22077,6 @@ mostlyclean-sim: @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19366,7 +22101,6 @@ clean-sim: @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19391,7 +22125,6 @@ distclean-sim: @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19416,7 +22149,6 @@ maintainer-clean-sim: @[ -f ./sim/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19433,18 +22165,19 @@ maintainer-clean-sim: @endif sim + .PHONY: configure-tar maybe-configure-tar maybe-configure-tar: @if tar maybe-configure-tar: configure-tar -configure-tar: +configure-tar: @test ! -f $(HOST_SUBDIR)/tar/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tar ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in tar; \ - cd $(HOST_SUBDIR)/tar || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/tar; \ + cd "$(HOST_SUBDIR)/tar" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/tar/ | \ @@ -19457,6 +22190,10 @@ configure-tar: || exit 1 @endif tar + + + + .PHONY: all-tar maybe-all-tar maybe-all-tar: @if tar @@ -19465,12 +22202,14 @@ maybe-all-tar: all-tar all-tar: configure-tar @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tar && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-tar)) @endif tar + + + .PHONY: check-tar maybe-check-tar maybe-check-tar: @if tar @@ -19479,7 +22218,6 @@ maybe-check-tar: check-tar check-tar: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tar && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -19494,7 +22232,6 @@ maybe-install-tar: install-tar install-tar: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tar && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -19513,7 +22250,6 @@ info-tar: \ @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19539,7 +22275,6 @@ dvi-tar: \ @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19565,7 +22300,6 @@ html-tar: \ @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19591,7 +22325,6 @@ TAGS-tar: \ @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19618,7 +22351,6 @@ install-info-tar: \ @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19644,7 +22376,6 @@ installcheck-tar: \ @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19669,7 +22400,6 @@ mostlyclean-tar: @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19694,7 +22424,6 @@ clean-tar: @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19719,7 +22448,6 @@ distclean-tar: @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19744,7 +22472,6 @@ maintainer-clean-tar: @[ -f ./tar/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19761,18 +22488,19 @@ maintainer-clean-tar: @endif tar + .PHONY: configure-texinfo maybe-configure-texinfo maybe-configure-texinfo: @if texinfo maybe-configure-texinfo: configure-texinfo -configure-texinfo: +configure-texinfo: @test ! -f $(HOST_SUBDIR)/texinfo/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/texinfo ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in texinfo; \ - cd $(HOST_SUBDIR)/texinfo || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/texinfo; \ + cd "$(HOST_SUBDIR)/texinfo" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/texinfo/ | \ @@ -19785,6 +22513,10 @@ configure-texinfo: || exit 1 @endif texinfo + + + + .PHONY: all-texinfo maybe-all-texinfo maybe-all-texinfo: @if texinfo @@ -19793,12 +22525,14 @@ maybe-all-texinfo: all-texinfo all-texinfo: configure-texinfo @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/texinfo && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-texinfo)) @endif texinfo + + + .PHONY: check-texinfo maybe-check-texinfo maybe-check-texinfo: @if texinfo @@ -19807,7 +22541,6 @@ maybe-check-texinfo: check-texinfo check-texinfo: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/texinfo && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -19835,7 +22568,6 @@ info-texinfo: \ @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19861,7 +22593,6 @@ dvi-texinfo: \ @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19887,7 +22618,6 @@ html-texinfo: \ @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19913,7 +22643,6 @@ TAGS-texinfo: \ @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19940,7 +22669,6 @@ install-info-texinfo: \ @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19966,7 +22694,6 @@ installcheck-texinfo: \ @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -19991,7 +22718,6 @@ mostlyclean-texinfo: @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20016,7 +22742,6 @@ clean-texinfo: @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20041,7 +22766,6 @@ distclean-texinfo: @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20066,7 +22790,6 @@ maintainer-clean-texinfo: @[ -f ./texinfo/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20083,18 +22806,19 @@ maintainer-clean-texinfo: @endif texinfo + .PHONY: configure-textutils maybe-configure-textutils maybe-configure-textutils: @if textutils maybe-configure-textutils: configure-textutils -configure-textutils: +configure-textutils: @test ! -f $(HOST_SUBDIR)/textutils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/textutils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in textutils; \ - cd $(HOST_SUBDIR)/textutils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/textutils; \ + cd "$(HOST_SUBDIR)/textutils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/textutils/ | \ @@ -20107,6 +22831,10 @@ configure-textutils: || exit 1 @endif textutils + + + + .PHONY: all-textutils maybe-all-textutils maybe-all-textutils: @if textutils @@ -20115,12 +22843,14 @@ maybe-all-textutils: all-textutils all-textutils: configure-textutils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/textutils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-textutils)) @endif textutils + + + .PHONY: check-textutils maybe-check-textutils maybe-check-textutils: @if textutils @@ -20129,7 +22859,6 @@ maybe-check-textutils: check-textutils check-textutils: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/textutils && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -20144,7 +22873,6 @@ maybe-install-textutils: install-textutils install-textutils: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/textutils && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -20163,7 +22891,6 @@ info-textutils: \ @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20189,7 +22916,6 @@ dvi-textutils: \ @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20215,7 +22941,6 @@ html-textutils: \ @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20241,7 +22966,6 @@ TAGS-textutils: \ @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20268,7 +22992,6 @@ install-info-textutils: \ @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20294,7 +23017,6 @@ installcheck-textutils: \ @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20319,7 +23041,6 @@ mostlyclean-textutils: @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20344,7 +23065,6 @@ clean-textutils: @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20369,7 +23089,6 @@ distclean-textutils: @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20394,7 +23113,6 @@ maintainer-clean-textutils: @[ -f ./textutils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20411,18 +23129,19 @@ maintainer-clean-textutils: @endif textutils + .PHONY: configure-time maybe-configure-time maybe-configure-time: @if time maybe-configure-time: configure-time -configure-time: +configure-time: @test ! -f $(HOST_SUBDIR)/time/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/time ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in time; \ - cd $(HOST_SUBDIR)/time || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/time; \ + cd "$(HOST_SUBDIR)/time" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/time/ | \ @@ -20435,6 +23154,10 @@ configure-time: || exit 1 @endif time + + + + .PHONY: all-time maybe-all-time maybe-all-time: @if time @@ -20443,12 +23166,14 @@ maybe-all-time: all-time all-time: configure-time @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/time && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-time)) @endif time + + + .PHONY: check-time maybe-check-time maybe-check-time: @if time @@ -20457,7 +23182,6 @@ maybe-check-time: check-time check-time: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/time && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -20472,7 +23196,6 @@ maybe-install-time: install-time install-time: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/time && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -20491,7 +23214,6 @@ info-time: \ @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20517,7 +23239,6 @@ dvi-time: \ @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20543,7 +23264,6 @@ html-time: \ @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20569,7 +23289,6 @@ TAGS-time: \ @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20596,7 +23315,6 @@ install-info-time: \ @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20622,7 +23340,6 @@ installcheck-time: \ @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20647,7 +23364,6 @@ mostlyclean-time: @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20672,7 +23388,6 @@ clean-time: @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20697,7 +23412,6 @@ distclean-time: @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20722,7 +23436,6 @@ maintainer-clean-time: @[ -f ./time/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20739,18 +23452,19 @@ maintainer-clean-time: @endif time + .PHONY: configure-uudecode maybe-configure-uudecode maybe-configure-uudecode: @if uudecode maybe-configure-uudecode: configure-uudecode -configure-uudecode: +configure-uudecode: @test ! -f $(HOST_SUBDIR)/uudecode/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/uudecode ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in uudecode; \ - cd $(HOST_SUBDIR)/uudecode || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/uudecode; \ + cd "$(HOST_SUBDIR)/uudecode" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/uudecode/ | \ @@ -20763,6 +23477,10 @@ configure-uudecode: || exit 1 @endif uudecode + + + + .PHONY: all-uudecode maybe-all-uudecode maybe-all-uudecode: @if uudecode @@ -20771,12 +23489,14 @@ maybe-all-uudecode: all-uudecode all-uudecode: configure-uudecode @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/uudecode && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-uudecode)) @endif uudecode + + + .PHONY: check-uudecode maybe-check-uudecode maybe-check-uudecode: @if uudecode @@ -20785,7 +23505,6 @@ maybe-check-uudecode: check-uudecode check-uudecode: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/uudecode && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -20800,7 +23519,6 @@ maybe-install-uudecode: install-uudecode install-uudecode: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/uudecode && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -20819,7 +23537,6 @@ info-uudecode: \ @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20845,7 +23562,6 @@ dvi-uudecode: \ @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20871,7 +23587,6 @@ html-uudecode: \ @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20897,7 +23612,6 @@ TAGS-uudecode: \ @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20924,7 +23638,6 @@ install-info-uudecode: \ @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20950,7 +23663,6 @@ installcheck-uudecode: \ @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -20975,7 +23687,6 @@ mostlyclean-uudecode: @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21000,7 +23711,6 @@ clean-uudecode: @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21025,7 +23735,6 @@ distclean-uudecode: @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21050,7 +23759,6 @@ maintainer-clean-uudecode: @[ -f ./uudecode/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21067,18 +23775,19 @@ maintainer-clean-uudecode: @endif uudecode + .PHONY: configure-wdiff maybe-configure-wdiff maybe-configure-wdiff: @if wdiff maybe-configure-wdiff: configure-wdiff -configure-wdiff: +configure-wdiff: @test ! -f $(HOST_SUBDIR)/wdiff/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/wdiff ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in wdiff; \ - cd $(HOST_SUBDIR)/wdiff || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/wdiff; \ + cd "$(HOST_SUBDIR)/wdiff" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/wdiff/ | \ @@ -21091,6 +23800,10 @@ configure-wdiff: || exit 1 @endif wdiff + + + + .PHONY: all-wdiff maybe-all-wdiff maybe-all-wdiff: @if wdiff @@ -21099,12 +23812,14 @@ maybe-all-wdiff: all-wdiff all-wdiff: configure-wdiff @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/wdiff && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-wdiff)) @endif wdiff + + + .PHONY: check-wdiff maybe-check-wdiff maybe-check-wdiff: @if wdiff @@ -21113,7 +23828,6 @@ maybe-check-wdiff: check-wdiff check-wdiff: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/wdiff && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -21128,7 +23842,6 @@ maybe-install-wdiff: install-wdiff install-wdiff: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/wdiff && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -21147,7 +23860,6 @@ info-wdiff: \ @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21173,7 +23885,6 @@ dvi-wdiff: \ @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21199,7 +23910,6 @@ html-wdiff: \ @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21225,7 +23935,6 @@ TAGS-wdiff: \ @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21252,7 +23961,6 @@ install-info-wdiff: \ @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21278,7 +23986,6 @@ installcheck-wdiff: \ @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21303,7 +24010,6 @@ mostlyclean-wdiff: @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21328,7 +24034,6 @@ clean-wdiff: @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21353,7 +24058,6 @@ distclean-wdiff: @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21378,7 +24082,6 @@ maintainer-clean-wdiff: @[ -f ./wdiff/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21395,18 +24098,19 @@ maintainer-clean-wdiff: @endif wdiff + .PHONY: configure-zip maybe-configure-zip maybe-configure-zip: @if zip maybe-configure-zip: configure-zip -configure-zip: +configure-zip: @test ! -f $(HOST_SUBDIR)/zip/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zip ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in zip; \ - cd $(HOST_SUBDIR)/zip || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/zip; \ + cd "$(HOST_SUBDIR)/zip" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/zip/ | \ @@ -21419,6 +24123,10 @@ configure-zip: || exit 1 @endif zip + + + + .PHONY: all-zip maybe-all-zip maybe-all-zip: @if zip @@ -21427,12 +24135,14 @@ maybe-all-zip: all-zip all-zip: configure-zip @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/zip && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-zip)) @endif zip + + + .PHONY: check-zip maybe-check-zip maybe-check-zip: @if zip @@ -21443,7 +24153,6 @@ check-zip: @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/zip && \ $(MAKE) $(FLAGS_TO_PASS) check); \ @@ -21459,7 +24168,6 @@ maybe-install-zip: install-zip install-zip: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/zip && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -21478,7 +24186,6 @@ info-zip: \ @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21504,7 +24211,6 @@ dvi-zip: \ @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21530,7 +24236,6 @@ html-zip: \ @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21556,7 +24261,6 @@ TAGS-zip: \ @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21583,7 +24287,6 @@ install-info-zip: \ @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21609,7 +24312,6 @@ installcheck-zip: \ @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21634,7 +24336,6 @@ mostlyclean-zip: @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21659,7 +24360,6 @@ clean-zip: @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21684,7 +24384,6 @@ distclean-zip: @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21709,7 +24408,6 @@ maintainer-clean-zip: @[ -f ./zip/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21726,19 +24424,20 @@ maintainer-clean-zip: @endif zip + .PHONY: configure-zlib maybe-configure-zlib maybe-configure-zlib: @if zlib maybe-configure-zlib: configure-zlib -configure-zlib: +configure-zlib: @test -f stage_last && exit 0; \ test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in zlib; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/zlib; \ + cd "$(HOST_SUBDIR)/zlib" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ @@ -21751,6 +24450,161 @@ configure-zlib: || exit 1 @endif zlib + + +.PHONY: configure-stage1-zlib maybe-configure-stage1-zlib +maybe-configure-stage1-zlib: +@if zlib-bootstrap +maybe-configure-stage1-zlib: configure-stage1-zlib +configure-stage1-zlib: + @$(MAKE) stage1-start + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + echo Configuring stage 1 in $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif zlib-bootstrap + +.PHONY: configure-stage2-zlib maybe-configure-stage2-zlib +maybe-configure-stage2-zlib: +@if zlib-bootstrap +maybe-configure-stage2-zlib: configure-stage2-zlib +configure-stage2-zlib: + @$(MAKE) stage2-start + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 2 in $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif zlib-bootstrap + +.PHONY: configure-stage3-zlib maybe-configure-stage3-zlib +maybe-configure-stage3-zlib: +@if zlib-bootstrap +maybe-configure-stage3-zlib: configure-stage3-zlib +configure-stage3-zlib: + @$(MAKE) stage3-start + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 3 in $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif zlib-bootstrap + +.PHONY: configure-stage4-zlib maybe-configure-stage4-zlib +maybe-configure-stage4-zlib: +@if zlib-bootstrap +maybe-configure-stage4-zlib: configure-stage4-zlib +configure-stage4-zlib: + @$(MAKE) stage4-start + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage 4 in $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif zlib-bootstrap + +.PHONY: configure-stageprofile-zlib maybe-configure-stageprofile-zlib +maybe-configure-stageprofile-zlib: +@if zlib-bootstrap +maybe-configure-stageprofile-zlib: configure-stageprofile-zlib +configure-stageprofile-zlib: + @$(MAKE) stageprofile-start + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage profile in $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif zlib-bootstrap + +.PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib +maybe-configure-stagefeedback-zlib: +@if zlib-bootstrap +maybe-configure-stagefeedback-zlib: configure-stagefeedback-zlib +configure-stagefeedback-zlib: + @$(MAKE) stagefeedback-start + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] && exit 0 || : ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + echo Configuring stage feedback in $(HOST_SUBDIR)/zlib ; \ + cd $(HOST_SUBDIR)/zlib || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ + *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + @stage2_werror_flag@ +@endif zlib-bootstrap + + + + + .PHONY: all-zlib maybe-all-zlib maybe-all-zlib: @if zlib @@ -21760,12 +24614,188 @@ all-zlib: configure-zlib @test -f stage_last && exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/zlib && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-zlib)) @endif zlib + + +.PHONY: all-stage1-zlib maybe-all-stage1-zlib +.PHONY: clean-stage1-zlib maybe-clean-stage1-zlib +maybe-all-stage1-zlib: +maybe-clean-stage1-zlib: +@if zlib-bootstrap +maybe-all-stage1-zlib: all-stage1-zlib +all-stage1: all-stage1-zlib +all-stage1-zlib: configure-stage1-zlib + @$(MAKE) stage1-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) CFLAGS="$(STAGE1_CFLAGS)" + +maybe-clean-stage1-zlib: clean-stage1-zlib +clean-stage1: clean-stage1-zlib +clean-stage1-zlib: + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage1-zlib/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage1-start ; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) \ + CFLAGS="$(STAGE1_CFLAGS)" clean +@endif zlib-bootstrap + + +.PHONY: all-stage2-zlib maybe-all-stage2-zlib +.PHONY: clean-stage2-zlib maybe-clean-stage2-zlib +maybe-all-stage2-zlib: +maybe-clean-stage2-zlib: +@if zlib-bootstrap +maybe-all-stage2-zlib: all-stage2-zlib +all-stage2: all-stage2-zlib +all-stage2-zlib: configure-stage2-zlib + @$(MAKE) stage2-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage2-zlib: clean-stage2-zlib +clean-stage2: clean-stage2-zlib +clean-stage2-zlib: + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage2-zlib/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage2-start ; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stage3-zlib maybe-all-stage3-zlib +.PHONY: clean-stage3-zlib maybe-clean-stage3-zlib +maybe-all-stage3-zlib: +maybe-clean-stage3-zlib: +@if zlib-bootstrap +maybe-all-stage3-zlib: all-stage3-zlib +all-stage3: all-stage3-zlib +all-stage3-zlib: configure-stage3-zlib + @$(MAKE) stage3-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage3-zlib: clean-stage3-zlib +clean-stage3: clean-stage3-zlib +clean-stage3-zlib: + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage3-zlib/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage3-start ; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stage4-zlib maybe-all-stage4-zlib +.PHONY: clean-stage4-zlib maybe-clean-stage4-zlib +maybe-all-stage4-zlib: +maybe-clean-stage4-zlib: +@if zlib-bootstrap +maybe-all-stage4-zlib: all-stage4-zlib +all-stage4: all-stage4-zlib +all-stage4-zlib: configure-stage4-zlib + @$(MAKE) stage4-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) + +maybe-clean-stage4-zlib: clean-stage4-zlib +clean-stage4: clean-stage4-zlib +clean-stage4-zlib: + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stage4-zlib/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stage4-start ; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + clean +@endif zlib-bootstrap + + +.PHONY: all-stageprofile-zlib maybe-all-stageprofile-zlib +.PHONY: clean-stageprofile-zlib maybe-clean-stageprofile-zlib +maybe-all-stageprofile-zlib: +maybe-clean-stageprofile-zlib: +@if zlib-bootstrap +maybe-all-stageprofile-zlib: all-stageprofile-zlib +all-stageprofile: all-stageprofile-zlib +all-stageprofile-zlib: configure-stageprofile-zlib + @$(MAKE) stageprofile-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + +maybe-clean-stageprofile-zlib: clean-stageprofile-zlib +clean-stageprofile: clean-stageprofile-zlib +clean-stageprofile-zlib: + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stageprofile-zlib/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stageprofile-start ; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean +@endif zlib-bootstrap + + +.PHONY: all-stagefeedback-zlib maybe-all-stagefeedback-zlib +.PHONY: clean-stagefeedback-zlib maybe-clean-stagefeedback-zlib +maybe-all-stagefeedback-zlib: +maybe-clean-stagefeedback-zlib: +@if zlib-bootstrap +maybe-all-stagefeedback-zlib: all-stagefeedback-zlib +all-stagefeedback: all-stagefeedback-zlib +all-stagefeedback-zlib: configure-stagefeedback-zlib + @$(MAKE) stagefeedback-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(HOST_EXPORTS) \ + $(POSTSTAGE1_HOST_EXPORTS) \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) $(POSTSTAGE1_FLAGS_TO_PASS) CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + +maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib +clean-stagefeedback: clean-stagefeedback-zlib +clean-stagefeedback-zlib: + @[ -f $(HOST_SUBDIR)/zlib/Makefile ] || [ -f $(HOST_SUBDIR)/stagefeedback-zlib/Makefile ] \ + || exit 0 ; \ + [ -f $(HOST_SUBDIR)/zlib/Makefile ] || $(MAKE) stagefeedback-start ; \ + cd $(HOST_SUBDIR)/zlib && \ + $(MAKE) $(FLAGS_TO_PASS) \ + $(POSTSTAGE1_FLAGS_TO_PASS) \ + CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean +@endif zlib-bootstrap + + + + + .PHONY: check-zlib maybe-check-zlib maybe-check-zlib: @if zlib @@ -21796,7 +24826,6 @@ info-zlib: \ @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21822,7 +24851,6 @@ dvi-zlib: \ @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21848,7 +24876,6 @@ html-zlib: \ @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21874,7 +24901,6 @@ TAGS-zlib: \ @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21901,7 +24927,6 @@ install-info-zlib: \ @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21927,7 +24952,6 @@ installcheck-zlib: \ @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21952,7 +24976,6 @@ mostlyclean-zlib: @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -21977,7 +25000,6 @@ clean-zlib: @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22002,7 +25024,6 @@ distclean-zlib: @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22027,7 +25048,6 @@ maintainer-clean-zlib: @[ -f ./zlib/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22044,18 +25064,19 @@ maintainer-clean-zlib: @endif zlib + .PHONY: configure-gdb maybe-configure-gdb maybe-configure-gdb: @if gdb maybe-configure-gdb: configure-gdb -configure-gdb: +configure-gdb: @test ! -f $(HOST_SUBDIR)/gdb/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gdb ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gdb; \ - cd $(HOST_SUBDIR)/gdb || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gdb; \ + cd "$(HOST_SUBDIR)/gdb" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gdb/ | \ @@ -22068,6 +25089,10 @@ configure-gdb: || exit 1 @endif gdb + + + + .PHONY: all-gdb maybe-all-gdb maybe-all-gdb: @if gdb @@ -22076,12 +25101,14 @@ maybe-all-gdb: all-gdb all-gdb: configure-gdb @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gdb && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-gdb)) @endif gdb + + + .PHONY: check-gdb maybe-check-gdb maybe-check-gdb: @if gdb @@ -22090,7 +25117,6 @@ maybe-check-gdb: check-gdb check-gdb: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gdb && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -22105,7 +25131,6 @@ maybe-install-gdb: install-gdb install-gdb: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gdb && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) @@ -22124,7 +25149,6 @@ info-gdb: \ @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22150,7 +25174,6 @@ dvi-gdb: \ @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22176,7 +25199,6 @@ html-gdb: \ @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22202,7 +25224,6 @@ TAGS-gdb: \ @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22229,7 +25250,6 @@ install-info-gdb: \ @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22255,7 +25275,6 @@ installcheck-gdb: \ @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22280,7 +25299,6 @@ mostlyclean-gdb: @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22305,7 +25323,6 @@ clean-gdb: @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22330,7 +25347,6 @@ distclean-gdb: @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22355,7 +25371,6 @@ maintainer-clean-gdb: @[ -f ./gdb/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22372,18 +25387,19 @@ maintainer-clean-gdb: @endif gdb + .PHONY: configure-expect maybe-configure-expect maybe-configure-expect: @if expect maybe-configure-expect: configure-expect -configure-expect: +configure-expect: @test ! -f $(HOST_SUBDIR)/expect/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/expect ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in expect; \ - cd $(HOST_SUBDIR)/expect || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/expect; \ + cd "$(HOST_SUBDIR)/expect" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/expect/ | \ @@ -22396,6 +25412,10 @@ configure-expect: || exit 1 @endif expect + + + + .PHONY: all-expect maybe-all-expect maybe-all-expect: @if expect @@ -22404,12 +25424,14 @@ maybe-all-expect: all-expect all-expect: configure-expect @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/expect && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-expect)) @endif expect + + + .PHONY: check-expect maybe-check-expect maybe-check-expect: @if expect @@ -22418,7 +25440,6 @@ maybe-check-expect: check-expect check-expect: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/expect && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -22433,7 +25454,6 @@ maybe-install-expect: install-expect install-expect: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/expect && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) @@ -22452,7 +25472,6 @@ info-expect: \ @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22478,7 +25497,6 @@ dvi-expect: \ @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22504,7 +25522,6 @@ html-expect: \ @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22530,7 +25547,6 @@ TAGS-expect: \ @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22557,7 +25573,6 @@ install-info-expect: \ @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22583,7 +25598,6 @@ installcheck-expect: \ @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22608,7 +25622,6 @@ mostlyclean-expect: @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22633,7 +25646,6 @@ clean-expect: @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22658,7 +25670,6 @@ distclean-expect: @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22683,7 +25694,6 @@ maintainer-clean-expect: @[ -f ./expect/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22700,18 +25710,19 @@ maintainer-clean-expect: @endif expect + .PHONY: configure-guile maybe-configure-guile maybe-configure-guile: @if guile maybe-configure-guile: configure-guile -configure-guile: +configure-guile: @test ! -f $(HOST_SUBDIR)/guile/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/guile ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in guile; \ - cd $(HOST_SUBDIR)/guile || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/guile; \ + cd "$(HOST_SUBDIR)/guile" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/guile/ | \ @@ -22724,6 +25735,10 @@ configure-guile: || exit 1 @endif guile + + + + .PHONY: all-guile maybe-all-guile maybe-all-guile: @if guile @@ -22732,12 +25747,14 @@ maybe-all-guile: all-guile all-guile: configure-guile @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/guile && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-guile)) @endif guile + + + .PHONY: check-guile maybe-check-guile maybe-check-guile: @if guile @@ -22746,7 +25763,6 @@ maybe-check-guile: check-guile check-guile: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/guile && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -22761,7 +25777,6 @@ maybe-install-guile: install-guile install-guile: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/guile && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) @@ -22780,7 +25795,6 @@ info-guile: \ @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22806,7 +25820,6 @@ dvi-guile: \ @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22832,7 +25845,6 @@ html-guile: \ @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22858,7 +25870,6 @@ TAGS-guile: \ @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22885,7 +25896,6 @@ install-info-guile: \ @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22911,7 +25921,6 @@ installcheck-guile: \ @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22936,7 +25945,6 @@ mostlyclean-guile: @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22961,7 +25969,6 @@ clean-guile: @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -22986,7 +25993,6 @@ distclean-guile: @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23011,7 +26017,6 @@ maintainer-clean-guile: @[ -f ./guile/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23028,18 +26033,19 @@ maintainer-clean-guile: @endif guile + .PHONY: configure-tk maybe-configure-tk maybe-configure-tk: @if tk maybe-configure-tk: configure-tk -configure-tk: +configure-tk: @test ! -f $(HOST_SUBDIR)/tk/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/tk ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in tk; \ - cd $(HOST_SUBDIR)/tk || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/tk; \ + cd "$(HOST_SUBDIR)/tk" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/tk/ | \ @@ -23052,6 +26058,10 @@ configure-tk: || exit 1 @endif tk + + + + .PHONY: all-tk maybe-all-tk maybe-all-tk: @if tk @@ -23060,12 +26070,14 @@ maybe-all-tk: all-tk all-tk: configure-tk @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tk && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) $(TARGET-tk)) @endif tk + + + .PHONY: check-tk maybe-check-tk maybe-check-tk: @if tk @@ -23074,7 +26086,6 @@ maybe-check-tk: check-tk check-tk: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tk && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) @@ -23089,7 +26100,6 @@ maybe-install-tk: install-tk install-tk: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/tk && \ $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) @@ -23108,7 +26118,6 @@ info-tk: \ @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23134,7 +26143,6 @@ dvi-tk: \ @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23160,7 +26168,6 @@ html-tk: \ @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23186,7 +26193,6 @@ TAGS-tk: \ @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23213,7 +26219,6 @@ install-info-tk: \ @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23239,7 +26244,6 @@ installcheck-tk: \ @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23264,7 +26268,6 @@ mostlyclean-tk: @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23289,7 +26292,6 @@ clean-tk: @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23314,7 +26316,6 @@ distclean-tk: @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23339,7 +26340,6 @@ maintainer-clean-tk: @[ -f ./tk/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) $(X11_FLAGS_TO_PASS); do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23356,18 +26356,19 @@ maintainer-clean-tk: @endif tk + .PHONY: configure-libtermcap maybe-configure-libtermcap maybe-configure-libtermcap: @if libtermcap maybe-configure-libtermcap: configure-libtermcap -configure-libtermcap: +configure-libtermcap: @test ! -f $(HOST_SUBDIR)/libtermcap/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libtermcap ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in libtermcap; \ - cd $(HOST_SUBDIR)/libtermcap || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/libtermcap; \ + cd "$(HOST_SUBDIR)/libtermcap" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/libtermcap/ | \ @@ -23380,6 +26381,10 @@ configure-libtermcap: || exit 1 @endif libtermcap + + + + .PHONY: all-libtermcap maybe-all-libtermcap maybe-all-libtermcap: @if libtermcap @@ -23388,12 +26393,14 @@ maybe-all-libtermcap: all-libtermcap all-libtermcap: configure-libtermcap @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libtermcap && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-libtermcap)) @endif libtermcap + + + .PHONY: check-libtermcap maybe-check-libtermcap maybe-check-libtermcap: @if libtermcap @@ -23411,7 +26418,6 @@ maybe-install-libtermcap: install-libtermcap install-libtermcap: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/libtermcap && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -23430,7 +26436,6 @@ info-libtermcap: \ @[ -f ./libtermcap/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23456,7 +26461,6 @@ dvi-libtermcap: \ @[ -f ./libtermcap/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23482,7 +26486,6 @@ html-libtermcap: \ @[ -f ./libtermcap/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23508,7 +26511,6 @@ TAGS-libtermcap: \ @[ -f ./libtermcap/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23535,7 +26537,6 @@ install-info-libtermcap: \ @[ -f ./libtermcap/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23561,7 +26562,6 @@ installcheck-libtermcap: \ @[ -f ./libtermcap/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23618,18 +26618,19 @@ maintainer-clean-libtermcap: @endif libtermcap + .PHONY: configure-utils maybe-configure-utils maybe-configure-utils: @if utils maybe-configure-utils: configure-utils -configure-utils: +configure-utils: @test ! -f $(HOST_SUBDIR)/utils/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/utils ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in utils; \ - cd $(HOST_SUBDIR)/utils || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/utils; \ + cd "$(HOST_SUBDIR)/utils" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/utils/ | \ @@ -23642,6 +26643,10 @@ configure-utils: || exit 1 @endif utils + + + + .PHONY: all-utils maybe-all-utils maybe-all-utils: @if utils @@ -23650,12 +26655,14 @@ maybe-all-utils: all-utils all-utils: configure-utils @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/utils && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-utils)) @endif utils + + + .PHONY: check-utils maybe-check-utils maybe-check-utils: @if utils @@ -23673,7 +26680,6 @@ maybe-install-utils: install-utils install-utils: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/utils && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -23692,7 +26698,6 @@ info-utils: \ @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23718,7 +26723,6 @@ dvi-utils: \ @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23744,7 +26748,6 @@ html-utils: \ @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23770,7 +26773,6 @@ TAGS-utils: \ @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23797,7 +26799,6 @@ install-info-utils: \ @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23823,7 +26824,6 @@ installcheck-utils: \ @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23848,7 +26848,6 @@ mostlyclean-utils: @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23873,7 +26872,6 @@ clean-utils: @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23898,7 +26896,6 @@ distclean-utils: @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23923,7 +26920,6 @@ maintainer-clean-utils: @[ -f ./utils/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -23940,18 +26936,19 @@ maintainer-clean-utils: @endif utils + .PHONY: configure-gnattools maybe-configure-gnattools maybe-configure-gnattools: @if gnattools maybe-configure-gnattools: configure-gnattools -configure-gnattools: +configure-gnattools: @test ! -f $(HOST_SUBDIR)/gnattools/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gnattools ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(HOST_EXPORTS) \ - echo Configuring in gnattools; \ - cd $(HOST_SUBDIR)/gnattools || exit 1; \ + echo Configuring in $(HOST_SUBDIR)/gnattools; \ + cd "$(HOST_SUBDIR)/gnattools" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ *) topdir=`echo $(HOST_SUBDIR)/gnattools/ | \ @@ -23964,6 +26961,10 @@ configure-gnattools: || exit 1 @endif gnattools + + + + .PHONY: all-gnattools maybe-all-gnattools maybe-all-gnattools: @if gnattools @@ -23972,12 +26973,14 @@ maybe-all-gnattools: all-gnattools all-gnattools: configure-gnattools @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gnattools && \ $(MAKE) $(FLAGS_TO_PASS) $(TARGET-gnattools)) @endif gnattools + + + .PHONY: check-gnattools maybe-check-gnattools maybe-check-gnattools: @if gnattools @@ -23986,7 +26989,6 @@ maybe-check-gnattools: check-gnattools check-gnattools: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gnattools && \ $(MAKE) $(FLAGS_TO_PASS) check) @@ -24001,7 +27003,6 @@ maybe-install-gnattools: install-gnattools install-gnattools: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/gnattools && \ $(MAKE) $(FLAGS_TO_PASS) install) @@ -24020,7 +27021,6 @@ info-gnattools: \ @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24046,7 +27046,6 @@ dvi-gnattools: \ @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24072,7 +27071,6 @@ html-gnattools: \ @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24098,7 +27096,6 @@ TAGS-gnattools: \ @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24125,7 +27122,6 @@ install-info-gnattools: \ @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24151,7 +27147,6 @@ installcheck-gnattools: \ @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24176,7 +27171,6 @@ mostlyclean-gnattools: @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24201,7 +27195,6 @@ clean-gnattools: @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24226,7 +27219,6 @@ distclean-gnattools: @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24251,7 +27243,6 @@ maintainer-clean-gnattools: @[ -f ./gnattools/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) ; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -24273,23 +27264,26 @@ maintainer-clean-gnattools: # Modules which run on the target machine # --------------------------------------- -.PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3 -maybe-configure-target-libstdc++-v3: -@if target-libstdc++-v3 -maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3 # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libstdc++-v3 $(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libstdc++-v3/multilib.out +@endif target-libstdc++-v3 + + +.PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3 +maybe-configure-target-libstdc++-v3: +@if target-libstdc++-v3 +maybe-configure-target-libstdc++-v3: configure-target-libstdc++-v3 configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out @test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \ cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \ @@ -24302,11 +27296,14 @@ configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out libsrcdir="$$s/libstdc++-v3"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libstdc++-v3 + + + + .PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3 maybe-all-target-libstdc++-v3: @if target-libstdc++-v3 @@ -24315,12 +27312,15 @@ maybe-all-target-libstdc++-v3: all-target-libstdc++-v3 all-target-libstdc++-v3: configure-target-libstdc++-v3 @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libstdc++-v3)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libstdc++-v3)) @endif target-libstdc++-v3 + + + + .PHONY: check-target-libstdc++-v3 maybe-check-target-libstdc++-v3 maybe-check-target-libstdc++-v3: @if target-libstdc++-v3 @@ -24329,7 +27329,6 @@ maybe-check-target-libstdc++-v3: check-target-libstdc++-v3 check-target-libstdc++-v3: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) @@ -24344,7 +27343,6 @@ maybe-install-target-libstdc++-v3: install-target-libstdc++-v3 install-target-libstdc++-v3: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -24363,7 +27361,6 @@ info-target-libstdc++-v3: \ @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24389,7 +27386,6 @@ dvi-target-libstdc++-v3: \ @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24415,7 +27411,6 @@ html-target-libstdc++-v3: \ @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24441,7 +27436,6 @@ TAGS-target-libstdc++-v3: \ @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24468,7 +27462,6 @@ install-info-target-libstdc++-v3: \ @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24494,7 +27487,6 @@ installcheck-target-libstdc++-v3: \ @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24519,7 +27511,6 @@ mostlyclean-target-libstdc++-v3: @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24544,7 +27535,6 @@ clean-target-libstdc++-v3: @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24569,7 +27559,6 @@ distclean-target-libstdc++-v3: @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24594,7 +27583,6 @@ maintainer-clean-target-libstdc++-v3: @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24611,23 +27599,26 @@ maintainer-clean-target-libstdc++-v3: @endif target-libstdc++-v3 -.PHONY: configure-target-libmudflap maybe-configure-target-libmudflap -maybe-configure-target-libmudflap: -@if target-libmudflap -maybe-configure-target-libmudflap: configure-target-libmudflap # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libmudflap $(TARGET_SUBDIR)/libmudflap/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \ rm -f $(TARGET_SUBDIR)/libmudflap/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libmudflap/multilib.out +@endif target-libmudflap + + +.PHONY: configure-target-libmudflap maybe-configure-target-libmudflap +maybe-configure-target-libmudflap: +@if target-libmudflap +maybe-configure-target-libmudflap: configure-target-libmudflap configure-target-libmudflap: $(TARGET_SUBDIR)/libmudflap/multilib.out @test ! -f $(TARGET_SUBDIR)/libmudflap/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmudflap ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libmudflap; \ cd "$(TARGET_SUBDIR)/libmudflap" || exit 1; \ @@ -24640,11 +27631,14 @@ configure-target-libmudflap: $(TARGET_SUBDIR)/libmudflap/multilib.out libsrcdir="$$s/libmudflap"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libmudflap + + + + .PHONY: all-target-libmudflap maybe-all-target-libmudflap maybe-all-target-libmudflap: @if target-libmudflap @@ -24653,12 +27647,15 @@ maybe-all-target-libmudflap: all-target-libmudflap all-target-libmudflap: configure-target-libmudflap @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libmudflap && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libmudflap)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libmudflap)) @endif target-libmudflap + + + + .PHONY: check-target-libmudflap maybe-check-target-libmudflap maybe-check-target-libmudflap: @if target-libmudflap @@ -24667,7 +27664,6 @@ maybe-check-target-libmudflap: check-target-libmudflap check-target-libmudflap: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libmudflap && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -24682,7 +27678,6 @@ maybe-install-target-libmudflap: install-target-libmudflap install-target-libmudflap: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libmudflap && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -24701,7 +27696,6 @@ info-target-libmudflap: \ @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24727,7 +27721,6 @@ dvi-target-libmudflap: \ @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24753,7 +27746,6 @@ html-target-libmudflap: \ @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24779,7 +27771,6 @@ TAGS-target-libmudflap: \ @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24806,7 +27797,6 @@ install-info-target-libmudflap: \ @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24832,7 +27822,6 @@ installcheck-target-libmudflap: \ @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24857,7 +27846,6 @@ mostlyclean-target-libmudflap: @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24882,7 +27870,6 @@ clean-target-libmudflap: @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24907,7 +27894,6 @@ distclean-target-libmudflap: @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24932,7 +27918,6 @@ maintainer-clean-target-libmudflap: @[ -f $(TARGET_SUBDIR)/libmudflap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libmudflap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -24949,23 +27934,26 @@ maintainer-clean-target-libmudflap: @endif target-libmudflap -.PHONY: configure-target-newlib maybe-configure-target-newlib -maybe-configure-target-newlib: -@if target-newlib -maybe-configure-target-newlib: configure-target-newlib # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-newlib $(TARGET_SUBDIR)/newlib/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \ rm -f $(TARGET_SUBDIR)/newlib/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/newlib/multilib.out +@endif target-newlib + + +.PHONY: configure-target-newlib maybe-configure-target-newlib +maybe-configure-target-newlib: +@if target-newlib +maybe-configure-target-newlib: configure-target-newlib configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out @test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/newlib; \ cd "$(TARGET_SUBDIR)/newlib" || exit 1; \ @@ -24978,11 +27966,14 @@ configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out libsrcdir="$$s/newlib"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-newlib + + + + .PHONY: all-target-newlib maybe-all-target-newlib maybe-all-target-newlib: @if target-newlib @@ -24991,12 +27982,15 @@ maybe-all-target-newlib: all-target-newlib all-target-newlib: configure-target-newlib @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/newlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-newlib)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-newlib)) @endif target-newlib + + + + .PHONY: check-target-newlib maybe-check-target-newlib maybe-check-target-newlib: @if target-newlib @@ -25005,7 +27999,6 @@ maybe-check-target-newlib: check-target-newlib check-target-newlib: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/newlib && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -25020,7 +28013,6 @@ maybe-install-target-newlib: install-target-newlib install-target-newlib: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/newlib && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -25039,7 +28031,6 @@ info-target-newlib: \ @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25065,7 +28056,6 @@ dvi-target-newlib: \ @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25091,7 +28081,6 @@ html-target-newlib: \ @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25117,7 +28106,6 @@ TAGS-target-newlib: \ @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25144,7 +28132,6 @@ install-info-target-newlib: \ @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25170,7 +28157,6 @@ installcheck-target-newlib: \ @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25195,7 +28181,6 @@ mostlyclean-target-newlib: @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25220,7 +28205,6 @@ clean-target-newlib: @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25245,7 +28229,6 @@ distclean-target-newlib: @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25270,7 +28253,6 @@ maintainer-clean-target-newlib: @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/newlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25287,23 +28269,26 @@ maintainer-clean-target-newlib: @endif target-newlib -.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran -maybe-configure-target-libgfortran: -@if target-libgfortran -maybe-configure-target-libgfortran: configure-target-libgfortran # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libgfortran $(TARGET_SUBDIR)/libgfortran/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \ rm -f $(TARGET_SUBDIR)/libgfortran/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libgfortran/multilib.out +@endif target-libgfortran + + +.PHONY: configure-target-libgfortran maybe-configure-target-libgfortran +maybe-configure-target-libgfortran: +@if target-libgfortran +maybe-configure-target-libgfortran: configure-target-libgfortran configure-target-libgfortran: $(TARGET_SUBDIR)/libgfortran/multilib.out @test ! -f $(TARGET_SUBDIR)/libgfortran/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgfortran ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libgfortran; \ cd "$(TARGET_SUBDIR)/libgfortran" || exit 1; \ @@ -25316,11 +28301,14 @@ configure-target-libgfortran: $(TARGET_SUBDIR)/libgfortran/multilib.out libsrcdir="$$s/libgfortran"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libgfortran + + + + .PHONY: all-target-libgfortran maybe-all-target-libgfortran maybe-all-target-libgfortran: @if target-libgfortran @@ -25329,12 +28317,15 @@ maybe-all-target-libgfortran: all-target-libgfortran all-target-libgfortran: configure-target-libgfortran @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libgfortran && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgfortran)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgfortran)) @endif target-libgfortran + + + + .PHONY: check-target-libgfortran maybe-check-target-libgfortran maybe-check-target-libgfortran: @if target-libgfortran @@ -25343,7 +28334,6 @@ maybe-check-target-libgfortran: check-target-libgfortran check-target-libgfortran: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libgfortran && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -25358,7 +28348,6 @@ maybe-install-target-libgfortran: install-target-libgfortran install-target-libgfortran: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libgfortran && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -25377,7 +28366,6 @@ info-target-libgfortran: \ @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25403,7 +28391,6 @@ dvi-target-libgfortran: \ @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25429,7 +28416,6 @@ html-target-libgfortran: \ @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25455,7 +28441,6 @@ TAGS-target-libgfortran: \ @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25482,7 +28467,6 @@ install-info-target-libgfortran: \ @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25508,7 +28492,6 @@ installcheck-target-libgfortran: \ @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25533,7 +28516,6 @@ mostlyclean-target-libgfortran: @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25558,7 +28540,6 @@ clean-target-libgfortran: @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25583,7 +28564,6 @@ distclean-target-libgfortran: @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25608,7 +28588,6 @@ maintainer-clean-target-libgfortran: @[ -f $(TARGET_SUBDIR)/libgfortran/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgfortran" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25625,23 +28604,26 @@ maintainer-clean-target-libgfortran: @endif target-libgfortran -.PHONY: configure-target-libobjc maybe-configure-target-libobjc -maybe-configure-target-libobjc: -@if target-libobjc -maybe-configure-target-libobjc: configure-target-libobjc # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libobjc $(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ rm -f $(TARGET_SUBDIR)/libobjc/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libobjc/multilib.out +@endif target-libobjc + + +.PHONY: configure-target-libobjc maybe-configure-target-libobjc +maybe-configure-target-libobjc: +@if target-libobjc +maybe-configure-target-libobjc: configure-target-libobjc configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out @test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libobjc; \ cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \ @@ -25654,11 +28636,14 @@ configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out libsrcdir="$$s/libobjc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libobjc + + + + .PHONY: all-target-libobjc maybe-all-target-libobjc maybe-all-target-libobjc: @if target-libobjc @@ -25667,12 +28652,15 @@ maybe-all-target-libobjc: all-target-libobjc all-target-libobjc: configure-target-libobjc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libobjc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libobjc)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libobjc)) @endif target-libobjc + + + + .PHONY: check-target-libobjc maybe-check-target-libobjc maybe-check-target-libobjc: @if target-libobjc @@ -25681,7 +28669,6 @@ maybe-check-target-libobjc: check-target-libobjc check-target-libobjc: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libobjc && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -25696,7 +28683,6 @@ maybe-install-target-libobjc: install-target-libobjc install-target-libobjc: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libobjc && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -25715,7 +28701,6 @@ info-target-libobjc: \ @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25741,7 +28726,6 @@ dvi-target-libobjc: \ @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25767,7 +28751,6 @@ html-target-libobjc: \ @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25793,7 +28776,6 @@ TAGS-target-libobjc: \ @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25820,7 +28802,6 @@ install-info-target-libobjc: \ @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25846,7 +28827,6 @@ installcheck-target-libobjc: \ @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25871,7 +28851,6 @@ mostlyclean-target-libobjc: @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25896,7 +28875,6 @@ clean-target-libobjc: @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25921,7 +28899,6 @@ distclean-target-libobjc: @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25946,7 +28923,6 @@ maintainer-clean-target-libobjc: @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libobjc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -25963,23 +28939,26 @@ maintainer-clean-target-libobjc: @endif target-libobjc -.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap -maybe-configure-target-libtermcap: -@if target-libtermcap -maybe-configure-target-libtermcap: configure-target-libtermcap # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libtermcap $(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \ rm -f $(TARGET_SUBDIR)/libtermcap/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libtermcap/multilib.out +@endif target-libtermcap + + +.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap +maybe-configure-target-libtermcap: +@if target-libtermcap +maybe-configure-target-libtermcap: configure-target-libtermcap configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out @test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libtermcap; \ cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \ @@ -25992,11 +28971,14 @@ configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out libsrcdir="$$s/libtermcap"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libtermcap + + + + .PHONY: all-target-libtermcap maybe-all-target-libtermcap maybe-all-target-libtermcap: @if target-libtermcap @@ -26005,12 +28987,15 @@ maybe-all-target-libtermcap: all-target-libtermcap all-target-libtermcap: configure-target-libtermcap @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libtermcap && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libtermcap)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libtermcap)) @endif target-libtermcap + + + + .PHONY: check-target-libtermcap maybe-check-target-libtermcap maybe-check-target-libtermcap: @if target-libtermcap @@ -26029,7 +29014,6 @@ maybe-install-target-libtermcap: install-target-libtermcap install-target-libtermcap: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libtermcap && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -26048,7 +29032,6 @@ info-target-libtermcap: \ @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libtermcap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26074,7 +29057,6 @@ dvi-target-libtermcap: \ @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libtermcap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26100,7 +29082,6 @@ html-target-libtermcap: \ @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libtermcap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26126,7 +29107,6 @@ TAGS-target-libtermcap: \ @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libtermcap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26153,7 +29133,6 @@ install-info-target-libtermcap: \ @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libtermcap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26179,7 +29158,6 @@ installcheck-target-libtermcap: \ @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libtermcap" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26236,23 +29214,26 @@ maintainer-clean-target-libtermcap: @endif target-libtermcap -.PHONY: configure-target-winsup maybe-configure-target-winsup -maybe-configure-target-winsup: -@if target-winsup -maybe-configure-target-winsup: configure-target-winsup # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-winsup $(TARGET_SUBDIR)/winsup/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \ rm -f $(TARGET_SUBDIR)/winsup/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/winsup/multilib.out +@endif target-winsup + + +.PHONY: configure-target-winsup maybe-configure-target-winsup +maybe-configure-target-winsup: +@if target-winsup +maybe-configure-target-winsup: configure-target-winsup configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out @test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/winsup; \ cd "$(TARGET_SUBDIR)/winsup" || exit 1; \ @@ -26265,11 +29246,14 @@ configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out libsrcdir="$$s/winsup"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-winsup + + + + .PHONY: all-target-winsup maybe-all-target-winsup maybe-all-target-winsup: @if target-winsup @@ -26278,12 +29262,15 @@ maybe-all-target-winsup: all-target-winsup all-target-winsup: configure-target-winsup @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/winsup && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-winsup)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-winsup)) @endif target-winsup + + + + .PHONY: check-target-winsup maybe-check-target-winsup maybe-check-target-winsup: @if target-winsup @@ -26292,7 +29279,6 @@ maybe-check-target-winsup: check-target-winsup check-target-winsup: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/winsup && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -26307,7 +29293,6 @@ maybe-install-target-winsup: install-target-winsup install-target-winsup: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/winsup && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -26326,7 +29311,6 @@ info-target-winsup: \ @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26352,7 +29336,6 @@ dvi-target-winsup: \ @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26378,7 +29361,6 @@ html-target-winsup: \ @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26404,7 +29386,6 @@ TAGS-target-winsup: \ @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26431,7 +29412,6 @@ install-info-target-winsup: \ @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26457,7 +29437,6 @@ installcheck-target-winsup: \ @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26482,7 +29461,6 @@ mostlyclean-target-winsup: @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26507,7 +29485,6 @@ clean-target-winsup: @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26532,7 +29509,6 @@ distclean-target-winsup: @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26557,7 +29533,6 @@ maintainer-clean-target-winsup: @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/winsup" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26574,23 +29549,26 @@ maintainer-clean-target-winsup: @endif target-winsup -.PHONY: configure-target-libgloss maybe-configure-target-libgloss -maybe-configure-target-libgloss: -@if target-libgloss -maybe-configure-target-libgloss: configure-target-libgloss # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libgloss $(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \ rm -f $(TARGET_SUBDIR)/libgloss/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libgloss/multilib.out +@endif target-libgloss + + +.PHONY: configure-target-libgloss maybe-configure-target-libgloss +maybe-configure-target-libgloss: +@if target-libgloss +maybe-configure-target-libgloss: configure-target-libgloss configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out @test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libgloss; \ cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \ @@ -26603,11 +29581,14 @@ configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out libsrcdir="$$s/libgloss"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libgloss + + + + .PHONY: all-target-libgloss maybe-all-target-libgloss maybe-all-target-libgloss: @if target-libgloss @@ -26616,12 +29597,15 @@ maybe-all-target-libgloss: all-target-libgloss all-target-libgloss: configure-target-libgloss @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libgloss && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgloss)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libgloss)) @endif target-libgloss + + + + .PHONY: check-target-libgloss maybe-check-target-libgloss maybe-check-target-libgloss: @if target-libgloss @@ -26640,7 +29624,6 @@ maybe-install-target-libgloss: install-target-libgloss install-target-libgloss: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libgloss && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -26659,7 +29642,6 @@ info-target-libgloss: \ @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26685,7 +29667,6 @@ dvi-target-libgloss: \ @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26711,7 +29692,6 @@ html-target-libgloss: \ @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26737,7 +29717,6 @@ TAGS-target-libgloss: \ @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26764,7 +29743,6 @@ install-info-target-libgloss: \ @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26790,7 +29768,6 @@ installcheck-target-libgloss: \ @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26815,7 +29792,6 @@ mostlyclean-target-libgloss: @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26840,7 +29816,6 @@ clean-target-libgloss: @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26865,7 +29840,6 @@ distclean-target-libgloss: @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26890,7 +29864,6 @@ maintainer-clean-target-libgloss: @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgloss" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -26907,23 +29880,26 @@ maintainer-clean-target-libgloss: @endif target-libgloss -.PHONY: configure-target-libiberty maybe-configure-target-libiberty -maybe-configure-target-libiberty: -@if target-libiberty -maybe-configure-target-libiberty: configure-target-libiberty # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libiberty $(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \ rm -f $(TARGET_SUBDIR)/libiberty/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libiberty/multilib.out +@endif target-libiberty + + +.PHONY: configure-target-libiberty maybe-configure-target-libiberty +maybe-configure-target-libiberty: +@if target-libiberty +maybe-configure-target-libiberty: configure-target-libiberty configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out @test ! -f $(TARGET_SUBDIR)/libiberty/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libiberty; \ cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \ @@ -26936,11 +29912,14 @@ configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out libsrcdir="$$s/libiberty"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libiberty + + + + .PHONY: all-target-libiberty maybe-all-target-libiberty maybe-all-target-libiberty: @if target-libiberty @@ -26949,12 +29928,15 @@ maybe-all-target-libiberty: all-target-libiberty all-target-libiberty: configure-target-libiberty @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libiberty && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libiberty)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libiberty)) @endif target-libiberty + + + + .PHONY: check-target-libiberty maybe-check-target-libiberty maybe-check-target-libiberty: @if target-libiberty @@ -26963,7 +29945,6 @@ maybe-check-target-libiberty: check-target-libiberty check-target-libiberty: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libiberty && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -26978,7 +29959,6 @@ maybe-install-target-libiberty: install-target-libiberty install-target-libiberty: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libiberty && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -26997,7 +29977,6 @@ info-target-libiberty: \ @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27023,7 +30002,6 @@ dvi-target-libiberty: \ @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27049,7 +30027,6 @@ html-target-libiberty: \ @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27075,7 +30052,6 @@ TAGS-target-libiberty: \ @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27102,7 +30078,6 @@ install-info-target-libiberty: \ @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27128,7 +30103,6 @@ installcheck-target-libiberty: \ @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27153,7 +30127,6 @@ mostlyclean-target-libiberty: @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27178,7 +30151,6 @@ clean-target-libiberty: @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27203,7 +30175,6 @@ distclean-target-libiberty: @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27228,7 +30199,6 @@ maintainer-clean-target-libiberty: @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libiberty" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27245,23 +30215,26 @@ maintainer-clean-target-libiberty: @endif target-libiberty -.PHONY: configure-target-gperf maybe-configure-target-gperf -maybe-configure-target-gperf: -@if target-gperf -maybe-configure-target-gperf: configure-target-gperf # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-gperf $(TARGET_SUBDIR)/gperf/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \ rm -f $(TARGET_SUBDIR)/gperf/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/gperf/multilib.out +@endif target-gperf + + +.PHONY: configure-target-gperf maybe-configure-target-gperf +maybe-configure-target-gperf: +@if target-gperf +maybe-configure-target-gperf: configure-target-gperf configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out @test ! -f $(TARGET_SUBDIR)/gperf/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/gperf; \ cd "$(TARGET_SUBDIR)/gperf" || exit 1; \ @@ -27274,11 +30247,14 @@ configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out libsrcdir="$$s/gperf"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-gperf + + + + .PHONY: all-target-gperf maybe-all-target-gperf maybe-all-target-gperf: @if target-gperf @@ -27287,12 +30263,15 @@ maybe-all-target-gperf: all-target-gperf all-target-gperf: configure-target-gperf @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/gperf && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-gperf)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-gperf)) @endif target-gperf + + + + .PHONY: check-target-gperf maybe-check-target-gperf maybe-check-target-gperf: @if target-gperf @@ -27301,7 +30280,6 @@ maybe-check-target-gperf: check-target-gperf check-target-gperf: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/gperf && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -27316,7 +30294,6 @@ maybe-install-target-gperf: install-target-gperf install-target-gperf: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/gperf && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -27335,7 +30312,6 @@ info-target-gperf: \ @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27361,7 +30337,6 @@ dvi-target-gperf: \ @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27387,7 +30362,6 @@ html-target-gperf: \ @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27413,7 +30387,6 @@ TAGS-target-gperf: \ @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27440,7 +30413,6 @@ install-info-target-gperf: \ @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27466,7 +30438,6 @@ installcheck-target-gperf: \ @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27491,7 +30462,6 @@ mostlyclean-target-gperf: @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27516,7 +30486,6 @@ clean-target-gperf: @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27541,7 +30510,6 @@ distclean-target-gperf: @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27566,7 +30534,6 @@ maintainer-clean-target-gperf: @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/gperf" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27583,23 +30550,26 @@ maintainer-clean-target-gperf: @endif target-gperf -.PHONY: configure-target-examples maybe-configure-target-examples -maybe-configure-target-examples: -@if target-examples -maybe-configure-target-examples: configure-target-examples # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-examples $(TARGET_SUBDIR)/examples/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \ rm -f $(TARGET_SUBDIR)/examples/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/examples/multilib.out +@endif target-examples + + +.PHONY: configure-target-examples maybe-configure-target-examples +maybe-configure-target-examples: +@if target-examples +maybe-configure-target-examples: configure-target-examples configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out @test ! -f $(TARGET_SUBDIR)/examples/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/examples; \ cd "$(TARGET_SUBDIR)/examples" || exit 1; \ @@ -27612,11 +30582,14 @@ configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out libsrcdir="$$s/examples"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-examples + + + + .PHONY: all-target-examples maybe-all-target-examples maybe-all-target-examples: @if target-examples @@ -27625,12 +30598,15 @@ maybe-all-target-examples: all-target-examples all-target-examples: configure-target-examples @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/examples && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-examples)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-examples)) @endif target-examples + + + + .PHONY: check-target-examples maybe-check-target-examples maybe-check-target-examples: @if target-examples @@ -27663,7 +30639,6 @@ info-target-examples: \ @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27689,7 +30664,6 @@ dvi-target-examples: \ @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27715,7 +30689,6 @@ html-target-examples: \ @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27741,7 +30714,6 @@ TAGS-target-examples: \ @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27768,7 +30740,6 @@ install-info-target-examples: \ @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27794,7 +30765,6 @@ installcheck-target-examples: \ @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27819,7 +30789,6 @@ mostlyclean-target-examples: @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27844,7 +30813,6 @@ clean-target-examples: @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27869,7 +30837,6 @@ distclean-target-examples: @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27894,7 +30861,6 @@ maintainer-clean-target-examples: @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/examples" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -27911,23 +30877,26 @@ maintainer-clean-target-examples: @endif target-examples -.PHONY: configure-target-libffi maybe-configure-target-libffi -maybe-configure-target-libffi: -@if target-libffi -maybe-configure-target-libffi: configure-target-libffi # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libffi $(TARGET_SUBDIR)/libffi/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \ rm -f $(TARGET_SUBDIR)/libffi/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libffi/multilib.out +@endif target-libffi + + +.PHONY: configure-target-libffi maybe-configure-target-libffi +maybe-configure-target-libffi: +@if target-libffi +maybe-configure-target-libffi: configure-target-libffi configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out @test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libffi; \ cd "$(TARGET_SUBDIR)/libffi" || exit 1; \ @@ -27940,11 +30909,14 @@ configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out libsrcdir="$$s/libffi"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libffi + + + + .PHONY: all-target-libffi maybe-all-target-libffi maybe-all-target-libffi: @if target-libffi @@ -27953,12 +30925,15 @@ maybe-all-target-libffi: all-target-libffi all-target-libffi: configure-target-libffi @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libffi && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libffi)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libffi)) @endif target-libffi + + + + .PHONY: check-target-libffi maybe-check-target-libffi maybe-check-target-libffi: @if target-libffi @@ -27967,7 +30942,6 @@ maybe-check-target-libffi: check-target-libffi check-target-libffi: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libffi && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -27982,7 +30956,6 @@ maybe-install-target-libffi: install-target-libffi install-target-libffi: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libffi && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -28001,7 +30974,6 @@ info-target-libffi: \ @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28027,7 +30999,6 @@ dvi-target-libffi: \ @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28053,7 +31024,6 @@ html-target-libffi: \ @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28079,7 +31049,6 @@ TAGS-target-libffi: \ @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28106,7 +31075,6 @@ install-info-target-libffi: \ @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28132,7 +31100,6 @@ installcheck-target-libffi: \ @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28157,7 +31124,6 @@ mostlyclean-target-libffi: @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28182,7 +31148,6 @@ clean-target-libffi: @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28207,7 +31172,6 @@ distclean-target-libffi: @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28232,7 +31196,6 @@ maintainer-clean-target-libffi: @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libffi" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28249,23 +31212,26 @@ maintainer-clean-target-libffi: @endif target-libffi -.PHONY: configure-target-libjava maybe-configure-target-libjava -maybe-configure-target-libjava: -@if target-libjava -maybe-configure-target-libjava: configure-target-libjava # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libjava $(TARGET_SUBDIR)/libjava/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \ rm -f $(TARGET_SUBDIR)/libjava/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libjava/multilib.out +@endif target-libjava + + +.PHONY: configure-target-libjava maybe-configure-target-libjava +maybe-configure-target-libjava: +@if target-libjava +maybe-configure-target-libjava: configure-target-libjava configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out @test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libjava; \ cd "$(TARGET_SUBDIR)/libjava" || exit 1; \ @@ -28278,11 +31244,14 @@ configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out libsrcdir="$$s/libjava"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libjava + + + + .PHONY: all-target-libjava maybe-all-target-libjava maybe-all-target-libjava: @if target-libjava @@ -28291,12 +31260,15 @@ maybe-all-target-libjava: all-target-libjava all-target-libjava: configure-target-libjava @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libjava && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libjava)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' $(TARGET-target-libjava)) @endif target-libjava + + + + .PHONY: check-target-libjava maybe-check-target-libjava maybe-check-target-libjava: @if target-libjava @@ -28305,7 +31277,6 @@ maybe-check-target-libjava: check-target-libjava check-target-libjava: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libjava && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) @@ -28320,7 +31291,6 @@ maybe-install-target-libjava: install-target-libjava install-target-libjava: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libjava && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -28339,7 +31309,6 @@ info-target-libjava: \ @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28365,7 +31334,6 @@ dvi-target-libjava: \ @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28391,7 +31359,6 @@ html-target-libjava: \ @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28417,7 +31384,6 @@ TAGS-target-libjava: \ @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28444,7 +31410,6 @@ install-info-target-libjava: \ @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28470,7 +31435,6 @@ installcheck-target-libjava: \ @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28495,7 +31459,6 @@ mostlyclean-target-libjava: @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28520,7 +31483,6 @@ clean-target-libjava: @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28545,7 +31507,6 @@ distclean-target-libjava: @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28570,7 +31531,6 @@ maintainer-clean-target-libjava: @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(RAW_CXX_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libjava" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28587,23 +31547,26 @@ maintainer-clean-target-libjava: @endif target-libjava -.PHONY: configure-target-zlib maybe-configure-target-zlib -maybe-configure-target-zlib: -@if target-zlib -maybe-configure-target-zlib: configure-target-zlib # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-zlib $(TARGET_SUBDIR)/zlib/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \ rm -f $(TARGET_SUBDIR)/zlib/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/zlib/multilib.out +@endif target-zlib + + +.PHONY: configure-target-zlib maybe-configure-target-zlib +maybe-configure-target-zlib: +@if target-zlib +maybe-configure-target-zlib: configure-target-zlib configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out @test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/zlib; \ cd "$(TARGET_SUBDIR)/zlib" || exit 1; \ @@ -28616,11 +31579,14 @@ configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out libsrcdir="$$s/zlib"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-zlib + + + + .PHONY: all-target-zlib maybe-all-target-zlib maybe-all-target-zlib: @if target-zlib @@ -28629,12 +31595,15 @@ maybe-all-target-zlib: all-target-zlib all-target-zlib: configure-target-zlib @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/zlib && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-zlib)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-zlib)) @endif target-zlib + + + + .PHONY: check-target-zlib maybe-check-target-zlib maybe-check-target-zlib: @if target-zlib @@ -28643,7 +31612,6 @@ maybe-check-target-zlib: check-target-zlib check-target-zlib: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/zlib && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -28658,7 +31626,6 @@ maybe-install-target-zlib: install-target-zlib install-target-zlib: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/zlib && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -28677,7 +31644,6 @@ info-target-zlib: \ @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28703,7 +31669,6 @@ dvi-target-zlib: \ @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28729,7 +31694,6 @@ html-target-zlib: \ @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28755,7 +31719,6 @@ TAGS-target-zlib: \ @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28782,7 +31745,6 @@ install-info-target-zlib: \ @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28808,7 +31770,6 @@ installcheck-target-zlib: \ @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28833,7 +31794,6 @@ mostlyclean-target-zlib: @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28858,7 +31818,6 @@ clean-target-zlib: @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28883,7 +31842,6 @@ distclean-target-zlib: @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28908,7 +31866,6 @@ maintainer-clean-target-zlib: @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/zlib" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -28925,23 +31882,26 @@ maintainer-clean-target-zlib: @endif target-zlib -.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc -maybe-configure-target-boehm-gc: -@if target-boehm-gc -maybe-configure-target-boehm-gc: configure-target-boehm-gc # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-boehm-gc $(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \ rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/boehm-gc/multilib.out +@endif target-boehm-gc + + +.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc +maybe-configure-target-boehm-gc: +@if target-boehm-gc +maybe-configure-target-boehm-gc: configure-target-boehm-gc configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out @test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \ cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \ @@ -28954,11 +31914,14 @@ configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out libsrcdir="$$s/boehm-gc"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-boehm-gc + + + + .PHONY: all-target-boehm-gc maybe-all-target-boehm-gc maybe-all-target-boehm-gc: @if target-boehm-gc @@ -28967,12 +31930,15 @@ maybe-all-target-boehm-gc: all-target-boehm-gc all-target-boehm-gc: configure-target-boehm-gc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/boehm-gc && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-boehm-gc)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-boehm-gc)) @endif target-boehm-gc + + + + .PHONY: check-target-boehm-gc maybe-check-target-boehm-gc maybe-check-target-boehm-gc: @if target-boehm-gc @@ -28981,7 +31947,6 @@ maybe-check-target-boehm-gc: check-target-boehm-gc check-target-boehm-gc: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/boehm-gc && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -28996,7 +31961,6 @@ maybe-install-target-boehm-gc: install-target-boehm-gc install-target-boehm-gc: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/boehm-gc && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -29015,7 +31979,6 @@ info-target-boehm-gc: \ @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29041,7 +32004,6 @@ dvi-target-boehm-gc: \ @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29067,7 +32029,6 @@ html-target-boehm-gc: \ @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29093,7 +32054,6 @@ TAGS-target-boehm-gc: \ @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29120,7 +32080,6 @@ install-info-target-boehm-gc: \ @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29146,7 +32105,6 @@ installcheck-target-boehm-gc: \ @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29171,7 +32129,6 @@ mostlyclean-target-boehm-gc: @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29196,7 +32153,6 @@ clean-target-boehm-gc: @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29221,7 +32177,6 @@ distclean-target-boehm-gc: @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29246,7 +32201,6 @@ maintainer-clean-target-boehm-gc: @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/boehm-gc" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29263,23 +32217,26 @@ maintainer-clean-target-boehm-gc: @endif target-boehm-gc -.PHONY: configure-target-qthreads maybe-configure-target-qthreads -maybe-configure-target-qthreads: -@if target-qthreads -maybe-configure-target-qthreads: configure-target-qthreads # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-qthreads $(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \ rm -f $(TARGET_SUBDIR)/qthreads/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/qthreads/multilib.out +@endif target-qthreads + + +.PHONY: configure-target-qthreads maybe-configure-target-qthreads +maybe-configure-target-qthreads: +@if target-qthreads +maybe-configure-target-qthreads: configure-target-qthreads configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out @test ! -f $(TARGET_SUBDIR)/qthreads/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/qthreads; \ cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \ @@ -29292,11 +32249,14 @@ configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out libsrcdir="$$s/qthreads"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-qthreads + + + + .PHONY: all-target-qthreads maybe-all-target-qthreads maybe-all-target-qthreads: @if target-qthreads @@ -29305,12 +32265,15 @@ maybe-all-target-qthreads: all-target-qthreads all-target-qthreads: configure-target-qthreads @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/qthreads && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-qthreads)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-qthreads)) @endif target-qthreads + + + + .PHONY: check-target-qthreads maybe-check-target-qthreads maybe-check-target-qthreads: @if target-qthreads @@ -29319,7 +32282,6 @@ maybe-check-target-qthreads: check-target-qthreads check-target-qthreads: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/qthreads && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -29334,7 +32296,6 @@ maybe-install-target-qthreads: install-target-qthreads install-target-qthreads: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/qthreads && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -29353,7 +32314,6 @@ info-target-qthreads: \ @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29379,7 +32339,6 @@ dvi-target-qthreads: \ @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29405,7 +32364,6 @@ html-target-qthreads: \ @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29431,7 +32389,6 @@ TAGS-target-qthreads: \ @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29458,7 +32415,6 @@ install-info-target-qthreads: \ @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29484,7 +32440,6 @@ installcheck-target-qthreads: \ @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29509,7 +32464,6 @@ mostlyclean-target-qthreads: @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29534,7 +32488,6 @@ clean-target-qthreads: @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29559,7 +32512,6 @@ distclean-target-qthreads: @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29584,7 +32536,6 @@ maintainer-clean-target-qthreads: @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/qthreads" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29601,23 +32552,26 @@ maintainer-clean-target-qthreads: @endif target-qthreads -.PHONY: configure-target-rda maybe-configure-target-rda -maybe-configure-target-rda: -@if target-rda -maybe-configure-target-rda: configure-target-rda # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-rda $(TARGET_SUBDIR)/rda/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \ rm -f $(TARGET_SUBDIR)/rda/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/rda/multilib.out +@endif target-rda + + +.PHONY: configure-target-rda maybe-configure-target-rda +maybe-configure-target-rda: +@if target-rda +maybe-configure-target-rda: configure-target-rda configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out @test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/rda; \ cd "$(TARGET_SUBDIR)/rda" || exit 1; \ @@ -29630,11 +32584,14 @@ configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out libsrcdir="$$s/rda"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-rda + + + + .PHONY: all-target-rda maybe-all-target-rda maybe-all-target-rda: @if target-rda @@ -29643,12 +32600,15 @@ maybe-all-target-rda: all-target-rda all-target-rda: configure-target-rda @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/rda && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-rda)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-rda)) @endif target-rda + + + + .PHONY: check-target-rda maybe-check-target-rda maybe-check-target-rda: @if target-rda @@ -29657,7 +32617,6 @@ maybe-check-target-rda: check-target-rda check-target-rda: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/rda && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -29672,7 +32631,6 @@ maybe-install-target-rda: install-target-rda install-target-rda: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/rda && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -29691,7 +32649,6 @@ info-target-rda: \ @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29717,7 +32674,6 @@ dvi-target-rda: \ @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29743,7 +32699,6 @@ html-target-rda: \ @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29769,7 +32724,6 @@ TAGS-target-rda: \ @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29796,7 +32750,6 @@ install-info-target-rda: \ @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29822,7 +32775,6 @@ installcheck-target-rda: \ @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29847,7 +32799,6 @@ mostlyclean-target-rda: @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29872,7 +32823,6 @@ clean-target-rda: @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29897,7 +32847,6 @@ distclean-target-rda: @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29922,7 +32871,6 @@ maintainer-clean-target-rda: @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/rda" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -29939,23 +32887,26 @@ maintainer-clean-target-rda: @endif target-rda -.PHONY: configure-target-libada maybe-configure-target-libada -maybe-configure-target-libada: -@if target-libada -maybe-configure-target-libada: configure-target-libada # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-libada $(TARGET_SUBDIR)/libada/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \ rm -f $(TARGET_SUBDIR)/libada/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/libada/multilib.out +@endif target-libada + + +.PHONY: configure-target-libada maybe-configure-target-libada +maybe-configure-target-libada: +@if target-libada +maybe-configure-target-libada: configure-target-libada configure-target-libada: $(TARGET_SUBDIR)/libada/multilib.out @test ! -f $(TARGET_SUBDIR)/libada/Makefile || exit 0; \ $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo Configuring in $(TARGET_SUBDIR)/libada; \ cd "$(TARGET_SUBDIR)/libada" || exit 1; \ @@ -29968,11 +32919,14 @@ configure-target-libada: $(TARGET_SUBDIR)/libada/multilib.out libsrcdir="$$s/libada"; \ rm -f no-such-file || : ; \ CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ || exit 1 @endif target-libada + + + + .PHONY: all-target-libada maybe-all-target-libada maybe-all-target-libada: @if target-libada @@ -29981,12 +32935,15 @@ maybe-all-target-libada: all-target-libada all-target-libada: configure-target-libada @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libada && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libada)) + $(MAKE) $(TARGET_FLAGS_TO_PASS) $(TARGET-target-libada)) @endif target-libada + + + + .PHONY: check-target-libada maybe-check-target-libada maybe-check-target-libada: @if target-libada @@ -29995,7 +32952,6 @@ maybe-check-target-libada: check-target-libada check-target-libada: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libada && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) check) @@ -30010,7 +32966,6 @@ maybe-install-target-libada: install-target-libada install-target-libada: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ (cd $(TARGET_SUBDIR)/libada && \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install) @@ -30029,7 +32984,6 @@ info-target-libada: \ @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing info in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30055,7 +33009,6 @@ dvi-target-libada: \ @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing dvi in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30081,7 +33034,6 @@ html-target-libada: \ @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing html in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30107,7 +33059,6 @@ TAGS-target-libada: \ @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing TAGS in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30134,7 +33085,6 @@ install-info-target-libada: \ @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing install-info in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30160,7 +33110,6 @@ installcheck-target-libada: \ @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing installcheck in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30185,7 +33134,6 @@ mostlyclean-target-libada: @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing mostlyclean in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30210,7 +33158,6 @@ clean-target-libada: @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing clean in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30235,7 +33182,6 @@ distclean-target-libada: @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing distclean in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30260,7 +33206,6 @@ maintainer-clean-target-libada: @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(NORMAL_TARGET_EXPORTS) \ echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libada" ; \ for flag in $(EXTRA_TARGET_FLAGS); do \ @@ -30292,9 +33237,9 @@ GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstra $(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Bootstrapping the compiler"; \ + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ @@ -30312,32 +33257,28 @@ $(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc msg="Comparing stage2 and stage3 of the compiler"; \ compare=compare ;; \ esac; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "$$msg"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all profiledbootstrap: all-prebootstrap configure-gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ echo "Bootstrapping training compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Building feedback based compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all @@ -30345,13 +33286,11 @@ profiledbootstrap: all-prebootstrap configure-gcc cross: all-build all-gas all-ld @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Building the C and C++ compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all @endif gcc-no-bootstrap @@ -30362,7 +33301,6 @@ check-gcc-c++: @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ else \ @@ -30386,7 +33324,6 @@ gcc-no-fixedincludes: rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd ./gcc && \ $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ @@ -30477,7 +33414,7 @@ stage1-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage1 > stage_current ; \ echo stage1 > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage1-bfd ] || \ mkdir stage1-bfd; \ @@ -30594,1289 +33531,219 @@ stage1-bubble:: fi .PHONY: all-stage1 clean-stage1 -all-stage1: \ - maybe-all-stage1-bfd \ - maybe-all-stage1-opcodes \ - maybe-all-stage1-binutils \ - maybe-all-stage1-gas \ - maybe-all-stage1-gcc \ - maybe-all-stage1-intl \ - maybe-all-stage1-ld \ - maybe-all-stage1-libcpp \ - maybe-all-stage1-libiberty \ - maybe-all-stage1-zlib - do-clean: clean-stage1 -clean-stage1: \ - maybe-clean-stage1-bfd \ - maybe-clean-stage1-opcodes \ - maybe-clean-stage1-binutils \ - maybe-clean-stage1-gas \ - maybe-clean-stage1-gcc \ - maybe-clean-stage1-intl \ - maybe-clean-stage1-ld \ - maybe-clean-stage1-libcpp \ - maybe-clean-stage1-libiberty \ - maybe-clean-stage1-zlib - - -.PHONY: configure-stage1-bfd maybe-configure-stage1-bfd -.PHONY: all-stage1-bfd maybe-all-stage1-bfd -.PHONY: clean-stage1-bfd maybe-clean-stage1-bfd - -maybe-configure-stage1-bfd: -maybe-all-stage1-bfd: -maybe-clean-stage1-bfd: - -@if bfd-bootstrap -maybe-configure-stage1-bfd: configure-stage1-bfd -configure-stage1-bfd: - @$(MAKE) stage1-start - @[ -f bfd/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in bfd ; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/bfd"; \ - libsrcdir="$$s/bfd"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" - -maybe-all-stage1-bfd: all-stage1-bfd -all-stage1-bfd: configure-stage1-bfd - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" - -maybe-clean-stage1-bfd: clean-stage1-bfd -clean-stage1-bfd: - @[ -f bfd/Makefile ] || [ -f stage1-bfd/Makefile ] \ - || exit 0 ; \ - [ -f bfd/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif bfd-bootstrap - - -.PHONY: configure-stage1-opcodes maybe-configure-stage1-opcodes -.PHONY: all-stage1-opcodes maybe-all-stage1-opcodes -.PHONY: clean-stage1-opcodes maybe-clean-stage1-opcodes -maybe-configure-stage1-opcodes: -maybe-all-stage1-opcodes: -maybe-clean-stage1-opcodes: +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap -@if opcodes-bootstrap -maybe-configure-stage1-opcodes: configure-stage1-opcodes -configure-stage1-opcodes: - @$(MAKE) stage1-start - @[ -f opcodes/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in opcodes ; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/opcodes"; \ - libsrcdir="$$s/opcodes"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" -maybe-all-stage1-opcodes: all-stage1-opcodes -all-stage1-opcodes: configure-stage1-opcodes - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" -maybe-clean-stage1-opcodes: clean-stage1-opcodes -clean-stage1-opcodes: - @[ -f opcodes/Makefile ] || [ -f stage1-opcodes/Makefile ] \ - || exit 0 ; \ - [ -f opcodes/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif opcodes-bootstrap +# Rules to wipe a stage and all the following ones, also used for cleanstrap -.PHONY: configure-stage1-binutils maybe-configure-stage1-binutils -.PHONY: all-stage1-binutils maybe-all-stage1-binutils -.PHONY: clean-stage1-binutils maybe-clean-stage1-binutils +.PHONY: distclean-stage1 +distclean-stage1:: + [ -f stage_current ] && $(MAKE) `cat stage_current`-end || : + rm -rf stage1-* -maybe-configure-stage1-binutils: -maybe-all-stage1-binutils: -maybe-clean-stage1-binutils: -@if binutils-bootstrap -maybe-configure-stage1-binutils: configure-stage1-binutils -configure-stage1-binutils: - @$(MAKE) stage1-start - @[ -f binutils/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in binutils ; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/binutils"; \ - libsrcdir="$$s/binutils"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +@endif gcc-bootstrap -maybe-all-stage1-binutils: all-stage1-binutils -all-stage1-binutils: configure-stage1-binutils - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" -maybe-clean-stage1-binutils: clean-stage1-binutils -clean-stage1-binutils: - @[ -f binutils/Makefile ] || [ -f stage1-binutils/Makefile ] \ - || exit 0 ; \ - [ -f binutils/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif binutils-bootstrap +.PHONY: stage2-start stage2-end +stage2-start:: + @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ + echo stage2 > stage_current ; \ + echo stage2 > stage_last; \ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) +@if bfd + @cd $(HOST_SUBDIR); [ -d stage2-bfd ] || \ + mkdir stage2-bfd; \ + set stage2-bfd bfd ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-bfd prev-bfd ; \ + @CREATE_LINK_TO_DIR@ +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); [ -d stage2-opcodes ] || \ + mkdir stage2-opcodes; \ + set stage2-opcodes opcodes ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-opcodes prev-opcodes ; \ + @CREATE_LINK_TO_DIR@ +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); [ -d stage2-binutils ] || \ + mkdir stage2-binutils; \ + set stage2-binutils binutils ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-binutils prev-binutils ; \ + @CREATE_LINK_TO_DIR@ +@endif binutils +@if gas + @cd $(HOST_SUBDIR); [ -d stage2-gas ] || \ + mkdir stage2-gas; \ + set stage2-gas gas ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-gas prev-gas ; \ + @CREATE_LINK_TO_DIR@ +@endif gas +@if gcc + @cd $(HOST_SUBDIR); [ -d stage2-gcc ] || \ + mkdir stage2-gcc; \ + set stage2-gcc gcc ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-gcc prev-gcc ; \ + @CREATE_LINK_TO_DIR@ +@endif gcc +@if intl + @cd $(HOST_SUBDIR); [ -d stage2-intl ] || \ + mkdir stage2-intl; \ + set stage2-intl intl ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-intl prev-intl ; \ + @CREATE_LINK_TO_DIR@ +@endif intl +@if ld + @cd $(HOST_SUBDIR); [ -d stage2-ld ] || \ + mkdir stage2-ld; \ + set stage2-ld ld ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-ld prev-ld ; \ + @CREATE_LINK_TO_DIR@ +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); [ -d stage2-libcpp ] || \ + mkdir stage2-libcpp; \ + set stage2-libcpp libcpp ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-libcpp prev-libcpp ; \ + @CREATE_LINK_TO_DIR@ +@endif libcpp +@if libiberty + @cd $(HOST_SUBDIR); [ -d stage2-libiberty ] || \ + mkdir stage2-libiberty; \ + set stage2-libiberty libiberty ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-libiberty prev-libiberty ; \ + @CREATE_LINK_TO_DIR@ +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); [ -d stage2-zlib ] || \ + mkdir stage2-zlib; \ + set stage2-zlib zlib ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-zlib prev-zlib ; \ + @CREATE_LINK_TO_DIR@ +@endif zlib -.PHONY: configure-stage1-gas maybe-configure-stage1-gas -.PHONY: all-stage1-gas maybe-all-stage1-gas -.PHONY: clean-stage1-gas maybe-clean-stage1-gas +stage2-end:: + @rm -f stage_current +@if bfd + @cd $(HOST_SUBDIR); set bfd stage2-bfd ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-bfd stage1-bfd ; \ + @UNDO_LINK_TO_DIR@ +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); set opcodes stage2-opcodes ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-opcodes stage1-opcodes ; \ + @UNDO_LINK_TO_DIR@ +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); set binutils stage2-binutils ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-binutils stage1-binutils ; \ + @UNDO_LINK_TO_DIR@ +@endif binutils +@if gas + @cd $(HOST_SUBDIR); set gas stage2-gas ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-gas stage1-gas ; \ + @UNDO_LINK_TO_DIR@ +@endif gas +@if gcc + @cd $(HOST_SUBDIR); set gcc stage2-gcc ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-gcc stage1-gcc ; \ + @UNDO_LINK_TO_DIR@ +@endif gcc +@if intl + @cd $(HOST_SUBDIR); set intl stage2-intl ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-intl stage1-intl ; \ + @UNDO_LINK_TO_DIR@ +@endif intl +@if ld + @cd $(HOST_SUBDIR); set ld stage2-ld ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-ld stage1-ld ; \ + @UNDO_LINK_TO_DIR@ +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); set libcpp stage2-libcpp ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-libcpp stage1-libcpp ; \ + @UNDO_LINK_TO_DIR@ +@endif libcpp +@if libiberty + @cd $(HOST_SUBDIR); set libiberty stage2-libiberty ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-libiberty stage1-libiberty ; \ + @UNDO_LINK_TO_DIR@ +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); set zlib stage2-zlib ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-zlib stage1-zlib ; \ + @UNDO_LINK_TO_DIR@ +@endif zlib -maybe-configure-stage1-gas: -maybe-all-stage1-gas: -maybe-clean-stage1-gas: +# Bubble a bugfix through all the stages up to stage 2. They +# are remade, but not reconfigured. The next stage (if any) will not +# be reconfigured as well. +.PHONY: stage2-bubble +stage2-bubble:: stage1-bubble + @if test -f stage2-lean || test -f stage1-lean ; then \ + echo Skipping rebuild of stage2 ; \ + else \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage2; \ + fi -@if gas-bootstrap -maybe-configure-stage1-gas: configure-stage1-gas -configure-stage1-gas: - @$(MAKE) stage1-start - @[ -f gas/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in gas ; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gas"; \ - libsrcdir="$$s/gas"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +.PHONY: all-stage2 clean-stage2 +do-clean: clean-stage2 -maybe-all-stage1-gas: all-stage1-gas -all-stage1-gas: configure-stage1-gas - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" +# FIXME: Will not need to be conditional when toplevel bootstrap is the +# only possibility, but now it conflicts with no-bootstrap rules +@if gcc-bootstrap -maybe-clean-stage1-gas: clean-stage1-gas -clean-stage1-gas: - @[ -f gas/Makefile ] || [ -f stage1-gas/Makefile ] \ - || exit 0 ; \ - [ -f gas/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif gas-bootstrap -.PHONY: configure-stage1-gcc maybe-configure-stage1-gcc -.PHONY: all-stage1-gcc maybe-all-stage1-gcc -.PHONY: clean-stage1-gcc maybe-clean-stage1-gcc +.PHONY: bootstrap2 +bootstrap2: stage2-bubble all -maybe-configure-stage1-gcc: -maybe-all-stage1-gcc: -maybe-clean-stage1-gcc: -@if gcc-bootstrap -maybe-configure-stage1-gcc: configure-stage1-gcc -configure-stage1-gcc: - @$(MAKE) stage1-start - @[ -f gcc/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in gcc ; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gcc"; \ - libsrcdir="$$s/gcc"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" +# Rules to wipe a stage and all the following ones, also used for cleanstrap +distclean-stage1:: distclean-stage2 +.PHONY: distclean-stage2 +distclean-stage2:: + [ -f stage_current ] && $(MAKE) `cat stage_current`-end || : + rm -rf stage2-* -maybe-all-stage1-gcc: all-stage1-gcc -all-stage1-gcc: configure-stage1-gcc - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) -maybe-clean-stage1-gcc: clean-stage1-gcc -clean-stage1-gcc: - @[ -f gcc/Makefile ] || [ -f stage1-gcc/Makefile ] \ - || exit 0 ; \ - [ -f gcc/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" $(EXTRA_GCC_FLAGS) clean @endif gcc-bootstrap -.PHONY: configure-stage1-intl maybe-configure-stage1-intl -.PHONY: all-stage1-intl maybe-all-stage1-intl -.PHONY: clean-stage1-intl maybe-clean-stage1-intl - -maybe-configure-stage1-intl: -maybe-all-stage1-intl: -maybe-clean-stage1-intl: - -@if intl-bootstrap -maybe-configure-stage1-intl: configure-stage1-intl -configure-stage1-intl: - @$(MAKE) stage1-start - @[ -f intl/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in intl ; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/intl"; \ - libsrcdir="$$s/intl"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" - -maybe-all-stage1-intl: all-stage1-intl -all-stage1-intl: configure-stage1-intl - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" - -maybe-clean-stage1-intl: clean-stage1-intl -clean-stage1-intl: - @[ -f intl/Makefile ] || [ -f stage1-intl/Makefile ] \ - || exit 0 ; \ - [ -f intl/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif intl-bootstrap - - -.PHONY: configure-stage1-ld maybe-configure-stage1-ld -.PHONY: all-stage1-ld maybe-all-stage1-ld -.PHONY: clean-stage1-ld maybe-clean-stage1-ld - -maybe-configure-stage1-ld: -maybe-all-stage1-ld: -maybe-clean-stage1-ld: - -@if ld-bootstrap -maybe-configure-stage1-ld: configure-stage1-ld -configure-stage1-ld: - @$(MAKE) stage1-start - @[ -f ld/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in ld ; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/ld"; \ - libsrcdir="$$s/ld"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" - -maybe-all-stage1-ld: all-stage1-ld -all-stage1-ld: configure-stage1-ld - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" - -maybe-clean-stage1-ld: clean-stage1-ld -clean-stage1-ld: - @[ -f ld/Makefile ] || [ -f stage1-ld/Makefile ] \ - || exit 0 ; \ - [ -f ld/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif ld-bootstrap - - -.PHONY: configure-stage1-libcpp maybe-configure-stage1-libcpp -.PHONY: all-stage1-libcpp maybe-all-stage1-libcpp -.PHONY: clean-stage1-libcpp maybe-clean-stage1-libcpp - -maybe-configure-stage1-libcpp: -maybe-all-stage1-libcpp: -maybe-clean-stage1-libcpp: - -@if libcpp-bootstrap -maybe-configure-stage1-libcpp: configure-stage1-libcpp -configure-stage1-libcpp: - @$(MAKE) stage1-start - @[ -f libcpp/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in libcpp ; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libcpp"; \ - libsrcdir="$$s/libcpp"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" - -maybe-all-stage1-libcpp: all-stage1-libcpp -all-stage1-libcpp: configure-stage1-libcpp - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" - -maybe-clean-stage1-libcpp: clean-stage1-libcpp -clean-stage1-libcpp: - @[ -f libcpp/Makefile ] || [ -f stage1-libcpp/Makefile ] \ - || exit 0 ; \ - [ -f libcpp/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif libcpp-bootstrap - - -.PHONY: configure-stage1-libiberty maybe-configure-stage1-libiberty -.PHONY: all-stage1-libiberty maybe-all-stage1-libiberty -.PHONY: clean-stage1-libiberty maybe-clean-stage1-libiberty - -maybe-configure-stage1-libiberty: -maybe-all-stage1-libiberty: -maybe-clean-stage1-libiberty: - -@if libiberty-bootstrap -maybe-configure-stage1-libiberty: configure-stage1-libiberty -configure-stage1-libiberty: - @$(MAKE) stage1-start - @[ -f libiberty/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in libiberty ; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" - -maybe-all-stage1-libiberty: all-stage1-libiberty -all-stage1-libiberty: configure-stage1-libiberty - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" - -maybe-clean-stage1-libiberty: clean-stage1-libiberty -clean-stage1-libiberty: - @[ -f libiberty/Makefile ] || [ -f stage1-libiberty/Makefile ] \ - || exit 0 ; \ - [ -f libiberty/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif libiberty-bootstrap - - -.PHONY: configure-stage1-zlib maybe-configure-stage1-zlib -.PHONY: all-stage1-zlib maybe-all-stage1-zlib -.PHONY: clean-stage1-zlib maybe-clean-stage1-zlib - -maybe-configure-stage1-zlib: -maybe-all-stage1-zlib: -maybe-clean-stage1-zlib: - -@if zlib-bootstrap -maybe-configure-stage1-zlib: configure-stage1-zlib -configure-stage1-zlib: - @$(MAKE) stage1-start - @[ -f zlib/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring stage 1 in zlib ; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - --disable-intermodule --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" - -maybe-all-stage1-zlib: all-stage1-zlib -all-stage1-zlib: configure-stage1-zlib - @$(MAKE) stage1-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" - -maybe-clean-stage1-zlib: clean-stage1-zlib -clean-stage1-zlib: - @[ -f zlib/Makefile ] || [ -f stage1-zlib/Makefile ] \ - || exit 0 ; \ - [ -f zlib/Makefile ] || $(MAKE) stage1-start ; \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - CFLAGS="$(STAGE1_CFLAGS)" clean -@endif zlib-bootstrap - - - -# FIXME: Will not need to be conditional when toplevel bootstrap is the -# only possibility, but now it conflicts with no-bootstrap rules -@if gcc-bootstrap - - - - -# Rules to wipe a stage and all the following ones, also used for cleanstrap - -.PHONY: distclean-stage1 -distclean-stage1:: - [ -f stage_current ] && $(MAKE) `cat stage_current`-end || : - rm -rf stage1-* - - -@endif gcc-bootstrap - - -.PHONY: stage2-start stage2-end - -stage2-start:: - @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ - echo stage2 > stage_current ; \ - echo stage2 > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR) -@if bfd - @cd $(HOST_SUBDIR); [ -d stage2-bfd ] || \ - mkdir stage2-bfd; \ - set stage2-bfd bfd ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-bfd prev-bfd ; \ - @CREATE_LINK_TO_DIR@ -@endif bfd -@if opcodes - @cd $(HOST_SUBDIR); [ -d stage2-opcodes ] || \ - mkdir stage2-opcodes; \ - set stage2-opcodes opcodes ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-opcodes prev-opcodes ; \ - @CREATE_LINK_TO_DIR@ -@endif opcodes -@if binutils - @cd $(HOST_SUBDIR); [ -d stage2-binutils ] || \ - mkdir stage2-binutils; \ - set stage2-binutils binutils ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-binutils prev-binutils ; \ - @CREATE_LINK_TO_DIR@ -@endif binutils -@if gas - @cd $(HOST_SUBDIR); [ -d stage2-gas ] || \ - mkdir stage2-gas; \ - set stage2-gas gas ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-gas prev-gas ; \ - @CREATE_LINK_TO_DIR@ -@endif gas -@if gcc - @cd $(HOST_SUBDIR); [ -d stage2-gcc ] || \ - mkdir stage2-gcc; \ - set stage2-gcc gcc ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-gcc prev-gcc ; \ - @CREATE_LINK_TO_DIR@ -@endif gcc -@if intl - @cd $(HOST_SUBDIR); [ -d stage2-intl ] || \ - mkdir stage2-intl; \ - set stage2-intl intl ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-intl prev-intl ; \ - @CREATE_LINK_TO_DIR@ -@endif intl -@if ld - @cd $(HOST_SUBDIR); [ -d stage2-ld ] || \ - mkdir stage2-ld; \ - set stage2-ld ld ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-ld prev-ld ; \ - @CREATE_LINK_TO_DIR@ -@endif ld -@if libcpp - @cd $(HOST_SUBDIR); [ -d stage2-libcpp ] || \ - mkdir stage2-libcpp; \ - set stage2-libcpp libcpp ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-libcpp prev-libcpp ; \ - @CREATE_LINK_TO_DIR@ -@endif libcpp -@if libiberty - @cd $(HOST_SUBDIR); [ -d stage2-libiberty ] || \ - mkdir stage2-libiberty; \ - set stage2-libiberty libiberty ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-libiberty prev-libiberty ; \ - @CREATE_LINK_TO_DIR@ -@endif libiberty -@if zlib - @cd $(HOST_SUBDIR); [ -d stage2-zlib ] || \ - mkdir stage2-zlib; \ - set stage2-zlib zlib ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-zlib prev-zlib ; \ - @CREATE_LINK_TO_DIR@ -@endif zlib - -stage2-end:: - @rm -f stage_current -@if bfd - @cd $(HOST_SUBDIR); set bfd stage2-bfd ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-bfd stage1-bfd ; \ - @UNDO_LINK_TO_DIR@ -@endif bfd -@if opcodes - @cd $(HOST_SUBDIR); set opcodes stage2-opcodes ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-opcodes stage1-opcodes ; \ - @UNDO_LINK_TO_DIR@ -@endif opcodes -@if binutils - @cd $(HOST_SUBDIR); set binutils stage2-binutils ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-binutils stage1-binutils ; \ - @UNDO_LINK_TO_DIR@ -@endif binutils -@if gas - @cd $(HOST_SUBDIR); set gas stage2-gas ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-gas stage1-gas ; \ - @UNDO_LINK_TO_DIR@ -@endif gas -@if gcc - @cd $(HOST_SUBDIR); set gcc stage2-gcc ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-gcc stage1-gcc ; \ - @UNDO_LINK_TO_DIR@ -@endif gcc -@if intl - @cd $(HOST_SUBDIR); set intl stage2-intl ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-intl stage1-intl ; \ - @UNDO_LINK_TO_DIR@ -@endif intl -@if ld - @cd $(HOST_SUBDIR); set ld stage2-ld ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-ld stage1-ld ; \ - @UNDO_LINK_TO_DIR@ -@endif ld -@if libcpp - @cd $(HOST_SUBDIR); set libcpp stage2-libcpp ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-libcpp stage1-libcpp ; \ - @UNDO_LINK_TO_DIR@ -@endif libcpp -@if libiberty - @cd $(HOST_SUBDIR); set libiberty stage2-libiberty ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-libiberty stage1-libiberty ; \ - @UNDO_LINK_TO_DIR@ -@endif libiberty -@if zlib - @cd $(HOST_SUBDIR); set zlib stage2-zlib ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-zlib stage1-zlib ; \ - @UNDO_LINK_TO_DIR@ -@endif zlib - -# Bubble a bugfix through all the stages up to stage 2. They -# are remade, but not reconfigured. The next stage (if any) will not -# be reconfigured as well. -.PHONY: stage2-bubble -stage2-bubble:: stage1-bubble - @if test -f stage2-lean || test -f stage1-lean ; then \ - echo Skipping rebuild of stage2 ; \ - else \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage2; \ - fi - -.PHONY: all-stage2 clean-stage2 -all-stage2: \ - maybe-all-stage2-bfd \ - maybe-all-stage2-opcodes \ - maybe-all-stage2-binutils \ - maybe-all-stage2-gas \ - maybe-all-stage2-gcc \ - maybe-all-stage2-intl \ - maybe-all-stage2-ld \ - maybe-all-stage2-libcpp \ - maybe-all-stage2-libiberty \ - maybe-all-stage2-zlib - -do-clean: clean-stage2 -clean-stage2: \ - maybe-clean-stage2-bfd \ - maybe-clean-stage2-opcodes \ - maybe-clean-stage2-binutils \ - maybe-clean-stage2-gas \ - maybe-clean-stage2-gcc \ - maybe-clean-stage2-intl \ - maybe-clean-stage2-ld \ - maybe-clean-stage2-libcpp \ - maybe-clean-stage2-libiberty \ - maybe-clean-stage2-zlib - - -.PHONY: configure-stage2-bfd maybe-configure-stage2-bfd -.PHONY: all-stage2-bfd maybe-all-stage2-bfd -.PHONY: clean-stage2-bfd maybe-clean-stage2-bfd - -maybe-configure-stage2-bfd: -maybe-all-stage2-bfd: -maybe-clean-stage2-bfd: - -@if bfd-bootstrap -maybe-configure-stage2-bfd: configure-stage2-bfd -configure-stage2-bfd: - @$(MAKE) stage2-start - @[ -f bfd/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in bfd ; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/bfd"; \ - libsrcdir="$$s/bfd"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-bfd: all-stage2-bfd -all-stage2-bfd: configure-stage2-bfd - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-bfd: clean-stage2-bfd -clean-stage2-bfd: - @[ -f bfd/Makefile ] || [ -f stage2-bfd/Makefile ] \ - || exit 0 ; \ - [ -f bfd/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif bfd-bootstrap - - -.PHONY: configure-stage2-opcodes maybe-configure-stage2-opcodes -.PHONY: all-stage2-opcodes maybe-all-stage2-opcodes -.PHONY: clean-stage2-opcodes maybe-clean-stage2-opcodes - -maybe-configure-stage2-opcodes: -maybe-all-stage2-opcodes: -maybe-clean-stage2-opcodes: - -@if opcodes-bootstrap -maybe-configure-stage2-opcodes: configure-stage2-opcodes -configure-stage2-opcodes: - @$(MAKE) stage2-start - @[ -f opcodes/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in opcodes ; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/opcodes"; \ - libsrcdir="$$s/opcodes"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-opcodes: all-stage2-opcodes -all-stage2-opcodes: configure-stage2-opcodes - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-opcodes: clean-stage2-opcodes -clean-stage2-opcodes: - @[ -f opcodes/Makefile ] || [ -f stage2-opcodes/Makefile ] \ - || exit 0 ; \ - [ -f opcodes/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif opcodes-bootstrap - - -.PHONY: configure-stage2-binutils maybe-configure-stage2-binutils -.PHONY: all-stage2-binutils maybe-all-stage2-binutils -.PHONY: clean-stage2-binutils maybe-clean-stage2-binutils - -maybe-configure-stage2-binutils: -maybe-all-stage2-binutils: -maybe-clean-stage2-binutils: - -@if binutils-bootstrap -maybe-configure-stage2-binutils: configure-stage2-binutils -configure-stage2-binutils: - @$(MAKE) stage2-start - @[ -f binutils/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in binutils ; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/binutils"; \ - libsrcdir="$$s/binutils"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-binutils: all-stage2-binutils -all-stage2-binutils: configure-stage2-binutils - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-binutils: clean-stage2-binutils -clean-stage2-binutils: - @[ -f binutils/Makefile ] || [ -f stage2-binutils/Makefile ] \ - || exit 0 ; \ - [ -f binutils/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif binutils-bootstrap - - -.PHONY: configure-stage2-gas maybe-configure-stage2-gas -.PHONY: all-stage2-gas maybe-all-stage2-gas -.PHONY: clean-stage2-gas maybe-clean-stage2-gas - -maybe-configure-stage2-gas: -maybe-all-stage2-gas: -maybe-clean-stage2-gas: - -@if gas-bootstrap -maybe-configure-stage2-gas: configure-stage2-gas -configure-stage2-gas: - @$(MAKE) stage2-start - @[ -f gas/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in gas ; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gas"; \ - libsrcdir="$$s/gas"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-gas: all-stage2-gas -all-stage2-gas: configure-stage2-gas - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-gas: clean-stage2-gas -clean-stage2-gas: - @[ -f gas/Makefile ] || [ -f stage2-gas/Makefile ] \ - || exit 0 ; \ - [ -f gas/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif gas-bootstrap - - -.PHONY: configure-stage2-gcc maybe-configure-stage2-gcc -.PHONY: all-stage2-gcc maybe-all-stage2-gcc -.PHONY: clean-stage2-gcc maybe-clean-stage2-gcc - -maybe-configure-stage2-gcc: -maybe-all-stage2-gcc: -maybe-clean-stage2-gcc: - -@if gcc-bootstrap -maybe-configure-stage2-gcc: configure-stage2-gcc -configure-stage2-gcc: - @$(MAKE) stage2-start - @[ -f gcc/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in gcc ; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gcc"; \ - libsrcdir="$$s/gcc"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-gcc: all-stage2-gcc -all-stage2-gcc: configure-stage2-gcc - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) - -maybe-clean-stage2-gcc: clean-stage2-gcc -clean-stage2-gcc: - @[ -f gcc/Makefile ] || [ -f stage2-gcc/Makefile ] \ - || exit 0 ; \ - [ -f gcc/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean -@endif gcc-bootstrap - - -.PHONY: configure-stage2-intl maybe-configure-stage2-intl -.PHONY: all-stage2-intl maybe-all-stage2-intl -.PHONY: clean-stage2-intl maybe-clean-stage2-intl - -maybe-configure-stage2-intl: -maybe-all-stage2-intl: -maybe-clean-stage2-intl: - -@if intl-bootstrap -maybe-configure-stage2-intl: configure-stage2-intl -configure-stage2-intl: - @$(MAKE) stage2-start - @[ -f intl/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in intl ; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/intl"; \ - libsrcdir="$$s/intl"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-intl: all-stage2-intl -all-stage2-intl: configure-stage2-intl - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-intl: clean-stage2-intl -clean-stage2-intl: - @[ -f intl/Makefile ] || [ -f stage2-intl/Makefile ] \ - || exit 0 ; \ - [ -f intl/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif intl-bootstrap - - -.PHONY: configure-stage2-ld maybe-configure-stage2-ld -.PHONY: all-stage2-ld maybe-all-stage2-ld -.PHONY: clean-stage2-ld maybe-clean-stage2-ld - -maybe-configure-stage2-ld: -maybe-all-stage2-ld: -maybe-clean-stage2-ld: - -@if ld-bootstrap -maybe-configure-stage2-ld: configure-stage2-ld -configure-stage2-ld: - @$(MAKE) stage2-start - @[ -f ld/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in ld ; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/ld"; \ - libsrcdir="$$s/ld"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-ld: all-stage2-ld -all-stage2-ld: configure-stage2-ld - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-ld: clean-stage2-ld -clean-stage2-ld: - @[ -f ld/Makefile ] || [ -f stage2-ld/Makefile ] \ - || exit 0 ; \ - [ -f ld/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif ld-bootstrap - - -.PHONY: configure-stage2-libcpp maybe-configure-stage2-libcpp -.PHONY: all-stage2-libcpp maybe-all-stage2-libcpp -.PHONY: clean-stage2-libcpp maybe-clean-stage2-libcpp - -maybe-configure-stage2-libcpp: -maybe-all-stage2-libcpp: -maybe-clean-stage2-libcpp: - -@if libcpp-bootstrap -maybe-configure-stage2-libcpp: configure-stage2-libcpp -configure-stage2-libcpp: - @$(MAKE) stage2-start - @[ -f libcpp/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in libcpp ; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libcpp"; \ - libsrcdir="$$s/libcpp"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-libcpp: all-stage2-libcpp -all-stage2-libcpp: configure-stage2-libcpp - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-libcpp: clean-stage2-libcpp -clean-stage2-libcpp: - @[ -f libcpp/Makefile ] || [ -f stage2-libcpp/Makefile ] \ - || exit 0 ; \ - [ -f libcpp/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif libcpp-bootstrap - - -.PHONY: configure-stage2-libiberty maybe-configure-stage2-libiberty -.PHONY: all-stage2-libiberty maybe-all-stage2-libiberty -.PHONY: clean-stage2-libiberty maybe-clean-stage2-libiberty - -maybe-configure-stage2-libiberty: -maybe-all-stage2-libiberty: -maybe-clean-stage2-libiberty: - -@if libiberty-bootstrap -maybe-configure-stage2-libiberty: configure-stage2-libiberty -configure-stage2-libiberty: - @$(MAKE) stage2-start - @[ -f libiberty/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in libiberty ; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-libiberty: all-stage2-libiberty -all-stage2-libiberty: configure-stage2-libiberty - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-libiberty: clean-stage2-libiberty -clean-stage2-libiberty: - @[ -f libiberty/Makefile ] || [ -f stage2-libiberty/Makefile ] \ - || exit 0 ; \ - [ -f libiberty/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif libiberty-bootstrap - - -.PHONY: configure-stage2-zlib maybe-configure-stage2-zlib -.PHONY: all-stage2-zlib maybe-all-stage2-zlib -.PHONY: clean-stage2-zlib maybe-clean-stage2-zlib - -maybe-configure-stage2-zlib: -maybe-all-stage2-zlib: -maybe-clean-stage2-zlib: - -@if zlib-bootstrap -maybe-configure-stage2-zlib: configure-stage2-zlib -configure-stage2-zlib: - @$(MAKE) stage2-start - @[ -f zlib/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 2 in zlib ; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage2-zlib: all-stage2-zlib -all-stage2-zlib: configure-stage2-zlib - @$(MAKE) stage2-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage2-zlib: clean-stage2-zlib -clean-stage2-zlib: - @[ -f zlib/Makefile ] || [ -f stage2-zlib/Makefile ] \ - || exit 0 ; \ - [ -f zlib/Makefile ] || $(MAKE) stage2-start ; \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif zlib-bootstrap - - - -# FIXME: Will not need to be conditional when toplevel bootstrap is the -# only possibility, but now it conflicts with no-bootstrap rules -@if gcc-bootstrap - - - -.PHONY: bootstrap2 -bootstrap2: stage2-bubble all - - -# Rules to wipe a stage and all the following ones, also used for cleanstrap -distclean-stage1:: distclean-stage2 -.PHONY: distclean-stage2 -distclean-stage2:: - [ -f stage_current ] && $(MAKE) `cat stage_current`-end || : - rm -rf stage2-* - - -@endif gcc-bootstrap - - -.PHONY: stage3-start stage3-end +.PHONY: stage3-start stage3-end stage3-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage3 > stage_current ; \ echo stage3 > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage3-bfd ] || \ mkdir stage3-bfd; \ @@ -31960,626 +33827,81 @@ stage3-start:: stage3-end:: @rm -f stage_current -@if bfd - @cd $(HOST_SUBDIR); set bfd stage3-bfd ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-bfd stage2-bfd ; \ - @UNDO_LINK_TO_DIR@ -@endif bfd -@if opcodes - @cd $(HOST_SUBDIR); set opcodes stage3-opcodes ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-opcodes stage2-opcodes ; \ - @UNDO_LINK_TO_DIR@ -@endif opcodes -@if binutils - @cd $(HOST_SUBDIR); set binutils stage3-binutils ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-binutils stage2-binutils ; \ - @UNDO_LINK_TO_DIR@ -@endif binutils -@if gas - @cd $(HOST_SUBDIR); set gas stage3-gas ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-gas stage2-gas ; \ - @UNDO_LINK_TO_DIR@ -@endif gas -@if gcc - @cd $(HOST_SUBDIR); set gcc stage3-gcc ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-gcc stage2-gcc ; \ - @UNDO_LINK_TO_DIR@ -@endif gcc -@if intl - @cd $(HOST_SUBDIR); set intl stage3-intl ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-intl stage2-intl ; \ - @UNDO_LINK_TO_DIR@ -@endif intl -@if ld - @cd $(HOST_SUBDIR); set ld stage3-ld ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-ld stage2-ld ; \ - @UNDO_LINK_TO_DIR@ -@endif ld -@if libcpp - @cd $(HOST_SUBDIR); set libcpp stage3-libcpp ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-libcpp stage2-libcpp ; \ - @UNDO_LINK_TO_DIR@ -@endif libcpp -@if libiberty - @cd $(HOST_SUBDIR); set libiberty stage3-libiberty ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-libiberty stage2-libiberty ; \ - @UNDO_LINK_TO_DIR@ -@endif libiberty -@if zlib - @cd $(HOST_SUBDIR); set zlib stage3-zlib ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-zlib stage2-zlib ; \ - @UNDO_LINK_TO_DIR@ -@endif zlib - -# Bubble a bugfix through all the stages up to stage 3. They -# are remade, but not reconfigured. The next stage (if any) will not -# be reconfigured as well. -.PHONY: stage3-bubble -stage3-bubble:: stage2-bubble - @bootstrap_lean@-rm -rf stage1-* ; $(STAMP) stage1-lean - @if test -f stage3-lean || test -f stage2-lean ; then \ - echo Skipping rebuild of stage3 ; \ - else \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage3; \ - fi - -.PHONY: all-stage3 clean-stage3 -all-stage3: \ - maybe-all-stage3-bfd \ - maybe-all-stage3-opcodes \ - maybe-all-stage3-binutils \ - maybe-all-stage3-gas \ - maybe-all-stage3-gcc \ - maybe-all-stage3-intl \ - maybe-all-stage3-ld \ - maybe-all-stage3-libcpp \ - maybe-all-stage3-libiberty \ - maybe-all-stage3-zlib - -do-clean: clean-stage3 -clean-stage3: \ - maybe-clean-stage3-bfd \ - maybe-clean-stage3-opcodes \ - maybe-clean-stage3-binutils \ - maybe-clean-stage3-gas \ - maybe-clean-stage3-gcc \ - maybe-clean-stage3-intl \ - maybe-clean-stage3-ld \ - maybe-clean-stage3-libcpp \ - maybe-clean-stage3-libiberty \ - maybe-clean-stage3-zlib - - -.PHONY: configure-stage3-bfd maybe-configure-stage3-bfd -.PHONY: all-stage3-bfd maybe-all-stage3-bfd -.PHONY: clean-stage3-bfd maybe-clean-stage3-bfd - -maybe-configure-stage3-bfd: -maybe-all-stage3-bfd: -maybe-clean-stage3-bfd: - -@if bfd-bootstrap -maybe-configure-stage3-bfd: configure-stage3-bfd -configure-stage3-bfd: - @$(MAKE) stage3-start - @[ -f bfd/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in bfd ; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/bfd"; \ - libsrcdir="$$s/bfd"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-bfd: all-stage3-bfd -all-stage3-bfd: configure-stage3-bfd - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-bfd: clean-stage3-bfd -clean-stage3-bfd: - @[ -f bfd/Makefile ] || [ -f stage3-bfd/Makefile ] \ - || exit 0 ; \ - [ -f bfd/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif bfd-bootstrap - - -.PHONY: configure-stage3-opcodes maybe-configure-stage3-opcodes -.PHONY: all-stage3-opcodes maybe-all-stage3-opcodes -.PHONY: clean-stage3-opcodes maybe-clean-stage3-opcodes - -maybe-configure-stage3-opcodes: -maybe-all-stage3-opcodes: -maybe-clean-stage3-opcodes: - -@if opcodes-bootstrap -maybe-configure-stage3-opcodes: configure-stage3-opcodes -configure-stage3-opcodes: - @$(MAKE) stage3-start - @[ -f opcodes/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in opcodes ; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/opcodes"; \ - libsrcdir="$$s/opcodes"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-opcodes: all-stage3-opcodes -all-stage3-opcodes: configure-stage3-opcodes - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-opcodes: clean-stage3-opcodes -clean-stage3-opcodes: - @[ -f opcodes/Makefile ] || [ -f stage3-opcodes/Makefile ] \ - || exit 0 ; \ - [ -f opcodes/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif opcodes-bootstrap - - -.PHONY: configure-stage3-binutils maybe-configure-stage3-binutils -.PHONY: all-stage3-binutils maybe-all-stage3-binutils -.PHONY: clean-stage3-binutils maybe-clean-stage3-binutils - -maybe-configure-stage3-binutils: -maybe-all-stage3-binutils: -maybe-clean-stage3-binutils: - -@if binutils-bootstrap -maybe-configure-stage3-binutils: configure-stage3-binutils -configure-stage3-binutils: - @$(MAKE) stage3-start - @[ -f binutils/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in binutils ; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/binutils"; \ - libsrcdir="$$s/binutils"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-binutils: all-stage3-binutils -all-stage3-binutils: configure-stage3-binutils - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-binutils: clean-stage3-binutils -clean-stage3-binutils: - @[ -f binutils/Makefile ] || [ -f stage3-binutils/Makefile ] \ - || exit 0 ; \ - [ -f binutils/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif binutils-bootstrap - - -.PHONY: configure-stage3-gas maybe-configure-stage3-gas -.PHONY: all-stage3-gas maybe-all-stage3-gas -.PHONY: clean-stage3-gas maybe-clean-stage3-gas - -maybe-configure-stage3-gas: -maybe-all-stage3-gas: -maybe-clean-stage3-gas: - -@if gas-bootstrap -maybe-configure-stage3-gas: configure-stage3-gas -configure-stage3-gas: - @$(MAKE) stage3-start - @[ -f gas/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in gas ; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gas"; \ - libsrcdir="$$s/gas"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-gas: all-stage3-gas -all-stage3-gas: configure-stage3-gas - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-gas: clean-stage3-gas -clean-stage3-gas: - @[ -f gas/Makefile ] || [ -f stage3-gas/Makefile ] \ - || exit 0 ; \ - [ -f gas/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif gas-bootstrap - - -.PHONY: configure-stage3-gcc maybe-configure-stage3-gcc -.PHONY: all-stage3-gcc maybe-all-stage3-gcc -.PHONY: clean-stage3-gcc maybe-clean-stage3-gcc - -maybe-configure-stage3-gcc: -maybe-all-stage3-gcc: -maybe-clean-stage3-gcc: - -@if gcc-bootstrap -maybe-configure-stage3-gcc: configure-stage3-gcc -configure-stage3-gcc: - @$(MAKE) stage3-start - @[ -f gcc/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in gcc ; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gcc"; \ - libsrcdir="$$s/gcc"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-gcc: all-stage3-gcc -all-stage3-gcc: configure-stage3-gcc - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) - -maybe-clean-stage3-gcc: clean-stage3-gcc -clean-stage3-gcc: - @[ -f gcc/Makefile ] || [ -f stage3-gcc/Makefile ] \ - || exit 0 ; \ - [ -f gcc/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean -@endif gcc-bootstrap - - -.PHONY: configure-stage3-intl maybe-configure-stage3-intl -.PHONY: all-stage3-intl maybe-all-stage3-intl -.PHONY: clean-stage3-intl maybe-clean-stage3-intl - -maybe-configure-stage3-intl: -maybe-all-stage3-intl: -maybe-clean-stage3-intl: - -@if intl-bootstrap -maybe-configure-stage3-intl: configure-stage3-intl -configure-stage3-intl: - @$(MAKE) stage3-start - @[ -f intl/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in intl ; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/intl"; \ - libsrcdir="$$s/intl"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-intl: all-stage3-intl -all-stage3-intl: configure-stage3-intl - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-intl: clean-stage3-intl -clean-stage3-intl: - @[ -f intl/Makefile ] || [ -f stage3-intl/Makefile ] \ - || exit 0 ; \ - [ -f intl/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif intl-bootstrap - - -.PHONY: configure-stage3-ld maybe-configure-stage3-ld -.PHONY: all-stage3-ld maybe-all-stage3-ld -.PHONY: clean-stage3-ld maybe-clean-stage3-ld - -maybe-configure-stage3-ld: -maybe-all-stage3-ld: -maybe-clean-stage3-ld: - -@if ld-bootstrap -maybe-configure-stage3-ld: configure-stage3-ld -configure-stage3-ld: - @$(MAKE) stage3-start - @[ -f ld/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in ld ; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/ld"; \ - libsrcdir="$$s/ld"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-ld: all-stage3-ld -all-stage3-ld: configure-stage3-ld - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-ld: clean-stage3-ld -clean-stage3-ld: - @[ -f ld/Makefile ] || [ -f stage3-ld/Makefile ] \ - || exit 0 ; \ - [ -f ld/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif ld-bootstrap - - -.PHONY: configure-stage3-libcpp maybe-configure-stage3-libcpp -.PHONY: all-stage3-libcpp maybe-all-stage3-libcpp -.PHONY: clean-stage3-libcpp maybe-clean-stage3-libcpp - -maybe-configure-stage3-libcpp: -maybe-all-stage3-libcpp: -maybe-clean-stage3-libcpp: - -@if libcpp-bootstrap -maybe-configure-stage3-libcpp: configure-stage3-libcpp -configure-stage3-libcpp: - @$(MAKE) stage3-start - @[ -f libcpp/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in libcpp ; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libcpp"; \ - libsrcdir="$$s/libcpp"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-libcpp: all-stage3-libcpp -all-stage3-libcpp: configure-stage3-libcpp - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-libcpp: clean-stage3-libcpp -clean-stage3-libcpp: - @[ -f libcpp/Makefile ] || [ -f stage3-libcpp/Makefile ] \ - || exit 0 ; \ - [ -f libcpp/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif libcpp-bootstrap - - -.PHONY: configure-stage3-libiberty maybe-configure-stage3-libiberty -.PHONY: all-stage3-libiberty maybe-all-stage3-libiberty -.PHONY: clean-stage3-libiberty maybe-clean-stage3-libiberty - -maybe-configure-stage3-libiberty: -maybe-all-stage3-libiberty: -maybe-clean-stage3-libiberty: - -@if libiberty-bootstrap -maybe-configure-stage3-libiberty: configure-stage3-libiberty -configure-stage3-libiberty: - @$(MAKE) stage3-start - @[ -f libiberty/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in libiberty ; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-libiberty: all-stage3-libiberty -all-stage3-libiberty: configure-stage3-libiberty - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-libiberty: clean-stage3-libiberty -clean-stage3-libiberty: - @[ -f libiberty/Makefile ] || [ -f stage3-libiberty/Makefile ] \ - || exit 0 ; \ - [ -f libiberty/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif libiberty-bootstrap - - -.PHONY: configure-stage3-zlib maybe-configure-stage3-zlib -.PHONY: all-stage3-zlib maybe-all-stage3-zlib -.PHONY: clean-stage3-zlib maybe-clean-stage3-zlib - -maybe-configure-stage3-zlib: -maybe-all-stage3-zlib: -maybe-clean-stage3-zlib: - -@if zlib-bootstrap -maybe-configure-stage3-zlib: configure-stage3-zlib -configure-stage3-zlib: - @$(MAKE) stage3-start - @[ -f zlib/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 3 in zlib ; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage3-zlib: all-stage3-zlib -all-stage3-zlib: configure-stage3-zlib - @$(MAKE) stage3-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage3-zlib: clean-stage3-zlib -clean-stage3-zlib: - @[ -f zlib/Makefile ] || [ -f stage3-zlib/Makefile ] \ - || exit 0 ; \ - [ -f zlib/Makefile ] || $(MAKE) stage3-start ; \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif zlib-bootstrap +@if bfd + @cd $(HOST_SUBDIR); set bfd stage3-bfd ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-bfd stage2-bfd ; \ + @UNDO_LINK_TO_DIR@ +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); set opcodes stage3-opcodes ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-opcodes stage2-opcodes ; \ + @UNDO_LINK_TO_DIR@ +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); set binutils stage3-binutils ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-binutils stage2-binutils ; \ + @UNDO_LINK_TO_DIR@ +@endif binutils +@if gas + @cd $(HOST_SUBDIR); set gas stage3-gas ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-gas stage2-gas ; \ + @UNDO_LINK_TO_DIR@ +@endif gas +@if gcc + @cd $(HOST_SUBDIR); set gcc stage3-gcc ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-gcc stage2-gcc ; \ + @UNDO_LINK_TO_DIR@ +@endif gcc +@if intl + @cd $(HOST_SUBDIR); set intl stage3-intl ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-intl stage2-intl ; \ + @UNDO_LINK_TO_DIR@ +@endif intl +@if ld + @cd $(HOST_SUBDIR); set ld stage3-ld ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-ld stage2-ld ; \ + @UNDO_LINK_TO_DIR@ +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); set libcpp stage3-libcpp ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-libcpp stage2-libcpp ; \ + @UNDO_LINK_TO_DIR@ +@endif libcpp +@if libiberty + @cd $(HOST_SUBDIR); set libiberty stage3-libiberty ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-libiberty stage2-libiberty ; \ + @UNDO_LINK_TO_DIR@ +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); set zlib stage3-zlib ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-zlib stage2-zlib ; \ + @UNDO_LINK_TO_DIR@ +@endif zlib +# Bubble a bugfix through all the stages up to stage 3. They +# are remade, but not reconfigured. The next stage (if any) will not +# be reconfigured as well. +.PHONY: stage3-bubble +stage3-bubble:: stage2-bubble + @bootstrap_lean@-rm -rf stage1-* ; $(STAMP) stage1-lean + @if test -f stage3-lean || test -f stage2-lean ; then \ + echo Skipping rebuild of stage3 ; \ + else \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage3; \ + fi +.PHONY: all-stage3 clean-stage3 +do-clean: clean-stage3 # FIXME: Will not need to be conditional when toplevel bootstrap is the # only possibility, but now it conflicts with no-bootstrap rules @@ -32638,7 +33960,7 @@ stage4-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage4 > stage_current ; \ echo stage4 > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stage4-bfd ] || \ mkdir stage4-bfd; \ @@ -32779,569 +34101,24 @@ stage4-end:: @if zlib @cd $(HOST_SUBDIR); set zlib stage4-zlib ; \ @UNDO_LINK_TO_DIR@ ; \ - set prev-zlib stage3-zlib ; \ - @UNDO_LINK_TO_DIR@ -@endif zlib - -# Bubble a bugfix through all the stages up to stage 4. They -# are remade, but not reconfigured. The next stage (if any) will not -# be reconfigured as well. -.PHONY: stage4-bubble -stage4-bubble:: stage3-bubble - @bootstrap_lean@-rm -rf stage2-* ; $(STAMP) stage2-lean - @if test -f stage4-lean || test -f stage3-lean ; then \ - echo Skipping rebuild of stage4 ; \ - else \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage4; \ - fi - -.PHONY: all-stage4 clean-stage4 -all-stage4: \ - maybe-all-stage4-bfd \ - maybe-all-stage4-opcodes \ - maybe-all-stage4-binutils \ - maybe-all-stage4-gas \ - maybe-all-stage4-gcc \ - maybe-all-stage4-intl \ - maybe-all-stage4-ld \ - maybe-all-stage4-libcpp \ - maybe-all-stage4-libiberty \ - maybe-all-stage4-zlib - -do-clean: clean-stage4 -clean-stage4: \ - maybe-clean-stage4-bfd \ - maybe-clean-stage4-opcodes \ - maybe-clean-stage4-binutils \ - maybe-clean-stage4-gas \ - maybe-clean-stage4-gcc \ - maybe-clean-stage4-intl \ - maybe-clean-stage4-ld \ - maybe-clean-stage4-libcpp \ - maybe-clean-stage4-libiberty \ - maybe-clean-stage4-zlib - - -.PHONY: configure-stage4-bfd maybe-configure-stage4-bfd -.PHONY: all-stage4-bfd maybe-all-stage4-bfd -.PHONY: clean-stage4-bfd maybe-clean-stage4-bfd - -maybe-configure-stage4-bfd: -maybe-all-stage4-bfd: -maybe-clean-stage4-bfd: - -@if bfd-bootstrap -maybe-configure-stage4-bfd: configure-stage4-bfd -configure-stage4-bfd: - @$(MAKE) stage4-start - @[ -f bfd/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in bfd ; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/bfd"; \ - libsrcdir="$$s/bfd"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-bfd: all-stage4-bfd -all-stage4-bfd: configure-stage4-bfd - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-bfd: clean-stage4-bfd -clean-stage4-bfd: - @[ -f bfd/Makefile ] || [ -f stage4-bfd/Makefile ] \ - || exit 0 ; \ - [ -f bfd/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif bfd-bootstrap - - -.PHONY: configure-stage4-opcodes maybe-configure-stage4-opcodes -.PHONY: all-stage4-opcodes maybe-all-stage4-opcodes -.PHONY: clean-stage4-opcodes maybe-clean-stage4-opcodes - -maybe-configure-stage4-opcodes: -maybe-all-stage4-opcodes: -maybe-clean-stage4-opcodes: - -@if opcodes-bootstrap -maybe-configure-stage4-opcodes: configure-stage4-opcodes -configure-stage4-opcodes: - @$(MAKE) stage4-start - @[ -f opcodes/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in opcodes ; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/opcodes"; \ - libsrcdir="$$s/opcodes"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-opcodes: all-stage4-opcodes -all-stage4-opcodes: configure-stage4-opcodes - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-opcodes: clean-stage4-opcodes -clean-stage4-opcodes: - @[ -f opcodes/Makefile ] || [ -f stage4-opcodes/Makefile ] \ - || exit 0 ; \ - [ -f opcodes/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif opcodes-bootstrap - - -.PHONY: configure-stage4-binutils maybe-configure-stage4-binutils -.PHONY: all-stage4-binutils maybe-all-stage4-binutils -.PHONY: clean-stage4-binutils maybe-clean-stage4-binutils - -maybe-configure-stage4-binutils: -maybe-all-stage4-binutils: -maybe-clean-stage4-binutils: - -@if binutils-bootstrap -maybe-configure-stage4-binutils: configure-stage4-binutils -configure-stage4-binutils: - @$(MAKE) stage4-start - @[ -f binutils/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in binutils ; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/binutils"; \ - libsrcdir="$$s/binutils"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-binutils: all-stage4-binutils -all-stage4-binutils: configure-stage4-binutils - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-binutils: clean-stage4-binutils -clean-stage4-binutils: - @[ -f binutils/Makefile ] || [ -f stage4-binutils/Makefile ] \ - || exit 0 ; \ - [ -f binutils/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif binutils-bootstrap - - -.PHONY: configure-stage4-gas maybe-configure-stage4-gas -.PHONY: all-stage4-gas maybe-all-stage4-gas -.PHONY: clean-stage4-gas maybe-clean-stage4-gas - -maybe-configure-stage4-gas: -maybe-all-stage4-gas: -maybe-clean-stage4-gas: - -@if gas-bootstrap -maybe-configure-stage4-gas: configure-stage4-gas -configure-stage4-gas: - @$(MAKE) stage4-start - @[ -f gas/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in gas ; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gas"; \ - libsrcdir="$$s/gas"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-gas: all-stage4-gas -all-stage4-gas: configure-stage4-gas - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-gas: clean-stage4-gas -clean-stage4-gas: - @[ -f gas/Makefile ] || [ -f stage4-gas/Makefile ] \ - || exit 0 ; \ - [ -f gas/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif gas-bootstrap - - -.PHONY: configure-stage4-gcc maybe-configure-stage4-gcc -.PHONY: all-stage4-gcc maybe-all-stage4-gcc -.PHONY: clean-stage4-gcc maybe-clean-stage4-gcc - -maybe-configure-stage4-gcc: -maybe-all-stage4-gcc: -maybe-clean-stage4-gcc: - -@if gcc-bootstrap -maybe-configure-stage4-gcc: configure-stage4-gcc -configure-stage4-gcc: - @$(MAKE) stage4-start - @[ -f gcc/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in gcc ; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gcc"; \ - libsrcdir="$$s/gcc"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-gcc: all-stage4-gcc -all-stage4-gcc: configure-stage4-gcc - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) - -maybe-clean-stage4-gcc: clean-stage4-gcc -clean-stage4-gcc: - @[ -f gcc/Makefile ] || [ -f stage4-gcc/Makefile ] \ - || exit 0 ; \ - [ -f gcc/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - $(EXTRA_GCC_FLAGS) clean -@endif gcc-bootstrap - - -.PHONY: configure-stage4-intl maybe-configure-stage4-intl -.PHONY: all-stage4-intl maybe-all-stage4-intl -.PHONY: clean-stage4-intl maybe-clean-stage4-intl - -maybe-configure-stage4-intl: -maybe-all-stage4-intl: -maybe-clean-stage4-intl: - -@if intl-bootstrap -maybe-configure-stage4-intl: configure-stage4-intl -configure-stage4-intl: - @$(MAKE) stage4-start - @[ -f intl/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in intl ; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/intl"; \ - libsrcdir="$$s/intl"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-intl: all-stage4-intl -all-stage4-intl: configure-stage4-intl - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-intl: clean-stage4-intl -clean-stage4-intl: - @[ -f intl/Makefile ] || [ -f stage4-intl/Makefile ] \ - || exit 0 ; \ - [ -f intl/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif intl-bootstrap - - -.PHONY: configure-stage4-ld maybe-configure-stage4-ld -.PHONY: all-stage4-ld maybe-all-stage4-ld -.PHONY: clean-stage4-ld maybe-clean-stage4-ld - -maybe-configure-stage4-ld: -maybe-all-stage4-ld: -maybe-clean-stage4-ld: - -@if ld-bootstrap -maybe-configure-stage4-ld: configure-stage4-ld -configure-stage4-ld: - @$(MAKE) stage4-start - @[ -f ld/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in ld ; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/ld"; \ - libsrcdir="$$s/ld"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-ld: all-stage4-ld -all-stage4-ld: configure-stage4-ld - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-ld: clean-stage4-ld -clean-stage4-ld: - @[ -f ld/Makefile ] || [ -f stage4-ld/Makefile ] \ - || exit 0 ; \ - [ -f ld/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif ld-bootstrap - - -.PHONY: configure-stage4-libcpp maybe-configure-stage4-libcpp -.PHONY: all-stage4-libcpp maybe-all-stage4-libcpp -.PHONY: clean-stage4-libcpp maybe-clean-stage4-libcpp - -maybe-configure-stage4-libcpp: -maybe-all-stage4-libcpp: -maybe-clean-stage4-libcpp: - -@if libcpp-bootstrap -maybe-configure-stage4-libcpp: configure-stage4-libcpp -configure-stage4-libcpp: - @$(MAKE) stage4-start - @[ -f libcpp/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in libcpp ; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libcpp"; \ - libsrcdir="$$s/libcpp"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-libcpp: all-stage4-libcpp -all-stage4-libcpp: configure-stage4-libcpp - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-libcpp: clean-stage4-libcpp -clean-stage4-libcpp: - @[ -f libcpp/Makefile ] || [ -f stage4-libcpp/Makefile ] \ - || exit 0 ; \ - [ -f libcpp/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif libcpp-bootstrap - - -.PHONY: configure-stage4-libiberty maybe-configure-stage4-libiberty -.PHONY: all-stage4-libiberty maybe-all-stage4-libiberty -.PHONY: clean-stage4-libiberty maybe-clean-stage4-libiberty - -maybe-configure-stage4-libiberty: -maybe-all-stage4-libiberty: -maybe-clean-stage4-libiberty: - -@if libiberty-bootstrap -maybe-configure-stage4-libiberty: configure-stage4-libiberty -configure-stage4-libiberty: - @$(MAKE) stage4-start - @[ -f libiberty/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in libiberty ; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-libiberty: all-stage4-libiberty -all-stage4-libiberty: configure-stage4-libiberty - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-libiberty: clean-stage4-libiberty -clean-stage4-libiberty: - @[ -f libiberty/Makefile ] || [ -f stage4-libiberty/Makefile ] \ - || exit 0 ; \ - [ -f libiberty/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif libiberty-bootstrap - - -.PHONY: configure-stage4-zlib maybe-configure-stage4-zlib -.PHONY: all-stage4-zlib maybe-all-stage4-zlib -.PHONY: clean-stage4-zlib maybe-clean-stage4-zlib - -maybe-configure-stage4-zlib: -maybe-all-stage4-zlib: -maybe-clean-stage4-zlib: - -@if zlib-bootstrap -maybe-configure-stage4-zlib: configure-stage4-zlib -configure-stage4-zlib: - @$(MAKE) stage4-start - @[ -f zlib/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage 4 in zlib ; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stage4-zlib: all-stage4-zlib -all-stage4-zlib: configure-stage4-zlib - @$(MAKE) stage4-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - - -maybe-clean-stage4-zlib: clean-stage4-zlib -clean-stage4-zlib: - @[ -f zlib/Makefile ] || [ -f stage4-zlib/Makefile ] \ - || exit 0 ; \ - [ -f zlib/Makefile ] || $(MAKE) stage4-start ; \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - clean -@endif zlib-bootstrap + set prev-zlib stage3-zlib ; \ + @UNDO_LINK_TO_DIR@ +@endif zlib +# Bubble a bugfix through all the stages up to stage 4. They +# are remade, but not reconfigured. The next stage (if any) will not +# be reconfigured as well. +.PHONY: stage4-bubble +stage4-bubble:: stage3-bubble + @bootstrap_lean@-rm -rf stage2-* ; $(STAMP) stage2-lean + @if test -f stage4-lean || test -f stage3-lean ; then \ + echo Skipping rebuild of stage4 ; \ + else \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stage4; \ + fi +.PHONY: all-stage4 clean-stage4 +do-clean: clean-stage4 # FIXME: Will not need to be conditional when toplevel bootstrap is the # only possibility, but now it conflicts with no-bootstrap rules @@ -33397,7 +34174,7 @@ stageprofile-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stageprofile > stage_current ; \ echo stageprofile > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stageprofile-bfd ] || \ mkdir stageprofile-bfd; \ @@ -33471,635 +34248,90 @@ stageprofile-start:: @CREATE_LINK_TO_DIR@ @endif libiberty @if zlib - @cd $(HOST_SUBDIR); [ -d stageprofile-zlib ] || \ - mkdir stageprofile-zlib; \ - set stageprofile-zlib zlib ; \ - @CREATE_LINK_TO_DIR@ ; \ - set stage1-zlib prev-zlib ; \ - @CREATE_LINK_TO_DIR@ -@endif zlib - -stageprofile-end:: - @rm -f stage_current -@if bfd - @cd $(HOST_SUBDIR); set bfd stageprofile-bfd ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-bfd stage1-bfd ; \ - @UNDO_LINK_TO_DIR@ -@endif bfd -@if opcodes - @cd $(HOST_SUBDIR); set opcodes stageprofile-opcodes ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-opcodes stage1-opcodes ; \ - @UNDO_LINK_TO_DIR@ -@endif opcodes -@if binutils - @cd $(HOST_SUBDIR); set binutils stageprofile-binutils ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-binutils stage1-binutils ; \ - @UNDO_LINK_TO_DIR@ -@endif binutils -@if gas - @cd $(HOST_SUBDIR); set gas stageprofile-gas ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-gas stage1-gas ; \ - @UNDO_LINK_TO_DIR@ -@endif gas -@if gcc - @cd $(HOST_SUBDIR); set gcc stageprofile-gcc ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-gcc stage1-gcc ; \ - @UNDO_LINK_TO_DIR@ -@endif gcc -@if intl - @cd $(HOST_SUBDIR); set intl stageprofile-intl ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-intl stage1-intl ; \ - @UNDO_LINK_TO_DIR@ -@endif intl -@if ld - @cd $(HOST_SUBDIR); set ld stageprofile-ld ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-ld stage1-ld ; \ - @UNDO_LINK_TO_DIR@ -@endif ld -@if libcpp - @cd $(HOST_SUBDIR); set libcpp stageprofile-libcpp ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-libcpp stage1-libcpp ; \ - @UNDO_LINK_TO_DIR@ -@endif libcpp -@if libiberty - @cd $(HOST_SUBDIR); set libiberty stageprofile-libiberty ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-libiberty stage1-libiberty ; \ - @UNDO_LINK_TO_DIR@ -@endif libiberty -@if zlib - @cd $(HOST_SUBDIR); set zlib stageprofile-zlib ; \ - @UNDO_LINK_TO_DIR@ ; \ - set prev-zlib stage1-zlib ; \ - @UNDO_LINK_TO_DIR@ -@endif zlib - -# Bubble a bugfix through all the stages up to stage profile. They -# are remade, but not reconfigured. The next stage (if any) will not -# be reconfigured as well. -.PHONY: stageprofile-bubble -stageprofile-bubble:: stage1-bubble - @if test -f stageprofile-lean || test -f stage1-lean ; then \ - echo Skipping rebuild of stageprofile ; \ - else \ - $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stageprofile; \ - fi - -.PHONY: all-stageprofile clean-stageprofile -all-stageprofile: \ - maybe-all-stageprofile-bfd \ - maybe-all-stageprofile-opcodes \ - maybe-all-stageprofile-binutils \ - maybe-all-stageprofile-gas \ - maybe-all-stageprofile-gcc \ - maybe-all-stageprofile-intl \ - maybe-all-stageprofile-ld \ - maybe-all-stageprofile-libcpp \ - maybe-all-stageprofile-libiberty \ - maybe-all-stageprofile-zlib - -do-clean: clean-stageprofile -clean-stageprofile: \ - maybe-clean-stageprofile-bfd \ - maybe-clean-stageprofile-opcodes \ - maybe-clean-stageprofile-binutils \ - maybe-clean-stageprofile-gas \ - maybe-clean-stageprofile-gcc \ - maybe-clean-stageprofile-intl \ - maybe-clean-stageprofile-ld \ - maybe-clean-stageprofile-libcpp \ - maybe-clean-stageprofile-libiberty \ - maybe-clean-stageprofile-zlib - - -.PHONY: configure-stageprofile-bfd maybe-configure-stageprofile-bfd -.PHONY: all-stageprofile-bfd maybe-all-stageprofile-bfd -.PHONY: clean-stageprofile-bfd maybe-clean-stageprofile-bfd - -maybe-configure-stageprofile-bfd: -maybe-all-stageprofile-bfd: -maybe-clean-stageprofile-bfd: - -@if bfd-bootstrap -maybe-configure-stageprofile-bfd: configure-stageprofile-bfd -configure-stageprofile-bfd: - @$(MAKE) stageprofile-start - @[ -f bfd/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in bfd ; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/bfd"; \ - libsrcdir="$$s/bfd"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-bfd: all-stageprofile-bfd -all-stageprofile-bfd: configure-stageprofile-bfd - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-bfd: clean-stageprofile-bfd -clean-stageprofile-bfd: - @[ -f bfd/Makefile ] || [ -f stageprofile-bfd/Makefile ] \ - || exit 0 ; \ - [ -f bfd/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif bfd-bootstrap - - -.PHONY: configure-stageprofile-opcodes maybe-configure-stageprofile-opcodes -.PHONY: all-stageprofile-opcodes maybe-all-stageprofile-opcodes -.PHONY: clean-stageprofile-opcodes maybe-clean-stageprofile-opcodes - -maybe-configure-stageprofile-opcodes: -maybe-all-stageprofile-opcodes: -maybe-clean-stageprofile-opcodes: - -@if opcodes-bootstrap -maybe-configure-stageprofile-opcodes: configure-stageprofile-opcodes -configure-stageprofile-opcodes: - @$(MAKE) stageprofile-start - @[ -f opcodes/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in opcodes ; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/opcodes"; \ - libsrcdir="$$s/opcodes"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-opcodes: all-stageprofile-opcodes -all-stageprofile-opcodes: configure-stageprofile-opcodes - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-opcodes: clean-stageprofile-opcodes -clean-stageprofile-opcodes: - @[ -f opcodes/Makefile ] || [ -f stageprofile-opcodes/Makefile ] \ - || exit 0 ; \ - [ -f opcodes/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif opcodes-bootstrap - - -.PHONY: configure-stageprofile-binutils maybe-configure-stageprofile-binutils -.PHONY: all-stageprofile-binutils maybe-all-stageprofile-binutils -.PHONY: clean-stageprofile-binutils maybe-clean-stageprofile-binutils - -maybe-configure-stageprofile-binutils: -maybe-all-stageprofile-binutils: -maybe-clean-stageprofile-binutils: - -@if binutils-bootstrap -maybe-configure-stageprofile-binutils: configure-stageprofile-binutils -configure-stageprofile-binutils: - @$(MAKE) stageprofile-start - @[ -f binutils/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in binutils ; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/binutils"; \ - libsrcdir="$$s/binutils"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-binutils: all-stageprofile-binutils -all-stageprofile-binutils: configure-stageprofile-binutils - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-binutils: clean-stageprofile-binutils -clean-stageprofile-binutils: - @[ -f binutils/Makefile ] || [ -f stageprofile-binutils/Makefile ] \ - || exit 0 ; \ - [ -f binutils/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif binutils-bootstrap - - -.PHONY: configure-stageprofile-gas maybe-configure-stageprofile-gas -.PHONY: all-stageprofile-gas maybe-all-stageprofile-gas -.PHONY: clean-stageprofile-gas maybe-clean-stageprofile-gas - -maybe-configure-stageprofile-gas: -maybe-all-stageprofile-gas: -maybe-clean-stageprofile-gas: - -@if gas-bootstrap -maybe-configure-stageprofile-gas: configure-stageprofile-gas -configure-stageprofile-gas: - @$(MAKE) stageprofile-start - @[ -f gas/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in gas ; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gas"; \ - libsrcdir="$$s/gas"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-gas: all-stageprofile-gas -all-stageprofile-gas: configure-stageprofile-gas - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-gas: clean-stageprofile-gas -clean-stageprofile-gas: - @[ -f gas/Makefile ] || [ -f stageprofile-gas/Makefile ] \ - || exit 0 ; \ - [ -f gas/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif gas-bootstrap - - -.PHONY: configure-stageprofile-gcc maybe-configure-stageprofile-gcc -.PHONY: all-stageprofile-gcc maybe-all-stageprofile-gcc -.PHONY: clean-stageprofile-gcc maybe-clean-stageprofile-gcc - -maybe-configure-stageprofile-gcc: -maybe-all-stageprofile-gcc: -maybe-clean-stageprofile-gcc: - -@if gcc-bootstrap -maybe-configure-stageprofile-gcc: configure-stageprofile-gcc -configure-stageprofile-gcc: - @$(MAKE) stageprofile-start - @[ -f gcc/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in gcc ; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gcc"; \ - libsrcdir="$$s/gcc"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-gcc: all-stageprofile-gcc -all-stageprofile-gcc: configure-stageprofile-gcc - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) - -maybe-clean-stageprofile-gcc: clean-stageprofile-gcc -clean-stageprofile-gcc: - @[ -f gcc/Makefile ] || [ -f stageprofile-gcc/Makefile ] \ - || exit 0 ; \ - [ -f gcc/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" $(EXTRA_GCC_FLAGS) clean -@endif gcc-bootstrap - - -.PHONY: configure-stageprofile-intl maybe-configure-stageprofile-intl -.PHONY: all-stageprofile-intl maybe-all-stageprofile-intl -.PHONY: clean-stageprofile-intl maybe-clean-stageprofile-intl - -maybe-configure-stageprofile-intl: -maybe-all-stageprofile-intl: -maybe-clean-stageprofile-intl: - -@if intl-bootstrap -maybe-configure-stageprofile-intl: configure-stageprofile-intl -configure-stageprofile-intl: - @$(MAKE) stageprofile-start - @[ -f intl/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in intl ; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/intl"; \ - libsrcdir="$$s/intl"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-intl: all-stageprofile-intl -all-stageprofile-intl: configure-stageprofile-intl - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-intl: clean-stageprofile-intl -clean-stageprofile-intl: - @[ -f intl/Makefile ] || [ -f stageprofile-intl/Makefile ] \ - || exit 0 ; \ - [ -f intl/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif intl-bootstrap - - -.PHONY: configure-stageprofile-ld maybe-configure-stageprofile-ld -.PHONY: all-stageprofile-ld maybe-all-stageprofile-ld -.PHONY: clean-stageprofile-ld maybe-clean-stageprofile-ld - -maybe-configure-stageprofile-ld: -maybe-all-stageprofile-ld: -maybe-clean-stageprofile-ld: - -@if ld-bootstrap -maybe-configure-stageprofile-ld: configure-stageprofile-ld -configure-stageprofile-ld: - @$(MAKE) stageprofile-start - @[ -f ld/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in ld ; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/ld"; \ - libsrcdir="$$s/ld"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-ld: all-stageprofile-ld -all-stageprofile-ld: configure-stageprofile-ld - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-ld: clean-stageprofile-ld -clean-stageprofile-ld: - @[ -f ld/Makefile ] || [ -f stageprofile-ld/Makefile ] \ - || exit 0 ; \ - [ -f ld/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif ld-bootstrap - - -.PHONY: configure-stageprofile-libcpp maybe-configure-stageprofile-libcpp -.PHONY: all-stageprofile-libcpp maybe-all-stageprofile-libcpp -.PHONY: clean-stageprofile-libcpp maybe-clean-stageprofile-libcpp - -maybe-configure-stageprofile-libcpp: -maybe-all-stageprofile-libcpp: -maybe-clean-stageprofile-libcpp: - -@if libcpp-bootstrap -maybe-configure-stageprofile-libcpp: configure-stageprofile-libcpp -configure-stageprofile-libcpp: - @$(MAKE) stageprofile-start - @[ -f libcpp/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in libcpp ; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libcpp"; \ - libsrcdir="$$s/libcpp"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-libcpp: all-stageprofile-libcpp -all-stageprofile-libcpp: configure-stageprofile-libcpp - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-libcpp: clean-stageprofile-libcpp -clean-stageprofile-libcpp: - @[ -f libcpp/Makefile ] || [ -f stageprofile-libcpp/Makefile ] \ - || exit 0 ; \ - [ -f libcpp/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif libcpp-bootstrap - - -.PHONY: configure-stageprofile-libiberty maybe-configure-stageprofile-libiberty -.PHONY: all-stageprofile-libiberty maybe-all-stageprofile-libiberty -.PHONY: clean-stageprofile-libiberty maybe-clean-stageprofile-libiberty - -maybe-configure-stageprofile-libiberty: -maybe-all-stageprofile-libiberty: -maybe-clean-stageprofile-libiberty: - -@if libiberty-bootstrap -maybe-configure-stageprofile-libiberty: configure-stageprofile-libiberty -configure-stageprofile-libiberty: - @$(MAKE) stageprofile-start - @[ -f libiberty/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in libiberty ; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-libiberty: all-stageprofile-libiberty -all-stageprofile-libiberty: configure-stageprofile-libiberty - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" - -maybe-clean-stageprofile-libiberty: clean-stageprofile-libiberty -clean-stageprofile-libiberty: - @[ -f libiberty/Makefile ] || [ -f stageprofile-libiberty/Makefile ] \ - || exit 0 ; \ - [ -f libiberty/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif libiberty-bootstrap - - -.PHONY: configure-stageprofile-zlib maybe-configure-stageprofile-zlib -.PHONY: all-stageprofile-zlib maybe-all-stageprofile-zlib -.PHONY: clean-stageprofile-zlib maybe-clean-stageprofile-zlib - -maybe-configure-stageprofile-zlib: -maybe-all-stageprofile-zlib: -maybe-clean-stageprofile-zlib: - -@if zlib-bootstrap -maybe-configure-stageprofile-zlib: configure-stageprofile-zlib -configure-stageprofile-zlib: - @$(MAKE) stageprofile-start - @[ -f zlib/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage profile in zlib ; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stageprofile-zlib: all-stageprofile-zlib -all-stageprofile-zlib: configure-stageprofile-zlib - @$(MAKE) stageprofile-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" + @cd $(HOST_SUBDIR); [ -d stageprofile-zlib ] || \ + mkdir stageprofile-zlib; \ + set stageprofile-zlib zlib ; \ + @CREATE_LINK_TO_DIR@ ; \ + set stage1-zlib prev-zlib ; \ + @CREATE_LINK_TO_DIR@ +@endif zlib -maybe-clean-stageprofile-zlib: clean-stageprofile-zlib -clean-stageprofile-zlib: - @[ -f zlib/Makefile ] || [ -f stageprofile-zlib/Makefile ] \ - || exit 0 ; \ - [ -f zlib/Makefile ] || $(MAKE) stageprofile-start ; \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-generate" clean -@endif zlib-bootstrap +stageprofile-end:: + @rm -f stage_current +@if bfd + @cd $(HOST_SUBDIR); set bfd stageprofile-bfd ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-bfd stage1-bfd ; \ + @UNDO_LINK_TO_DIR@ +@endif bfd +@if opcodes + @cd $(HOST_SUBDIR); set opcodes stageprofile-opcodes ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-opcodes stage1-opcodes ; \ + @UNDO_LINK_TO_DIR@ +@endif opcodes +@if binutils + @cd $(HOST_SUBDIR); set binutils stageprofile-binutils ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-binutils stage1-binutils ; \ + @UNDO_LINK_TO_DIR@ +@endif binutils +@if gas + @cd $(HOST_SUBDIR); set gas stageprofile-gas ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-gas stage1-gas ; \ + @UNDO_LINK_TO_DIR@ +@endif gas +@if gcc + @cd $(HOST_SUBDIR); set gcc stageprofile-gcc ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-gcc stage1-gcc ; \ + @UNDO_LINK_TO_DIR@ +@endif gcc +@if intl + @cd $(HOST_SUBDIR); set intl stageprofile-intl ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-intl stage1-intl ; \ + @UNDO_LINK_TO_DIR@ +@endif intl +@if ld + @cd $(HOST_SUBDIR); set ld stageprofile-ld ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-ld stage1-ld ; \ + @UNDO_LINK_TO_DIR@ +@endif ld +@if libcpp + @cd $(HOST_SUBDIR); set libcpp stageprofile-libcpp ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-libcpp stage1-libcpp ; \ + @UNDO_LINK_TO_DIR@ +@endif libcpp +@if libiberty + @cd $(HOST_SUBDIR); set libiberty stageprofile-libiberty ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-libiberty stage1-libiberty ; \ + @UNDO_LINK_TO_DIR@ +@endif libiberty +@if zlib + @cd $(HOST_SUBDIR); set zlib stageprofile-zlib ; \ + @UNDO_LINK_TO_DIR@ ; \ + set prev-zlib stage1-zlib ; \ + @UNDO_LINK_TO_DIR@ +@endif zlib +# Bubble a bugfix through all the stages up to stage profile. They +# are remade, but not reconfigured. The next stage (if any) will not +# be reconfigured as well. +.PHONY: stageprofile-bubble +stageprofile-bubble:: stage1-bubble + @if test -f stageprofile-lean || test -f stage1-lean ; then \ + echo Skipping rebuild of stageprofile ; \ + else \ + $(MAKE) $(RECURSE_FLAGS_TO_PASS) NOTPARALLEL= all-stageprofile; \ + fi +.PHONY: all-stageprofile clean-stageprofile +do-clean: clean-stageprofile # FIXME: Will not need to be conditional when toplevel bootstrap is the # only possibility, but now it conflicts with no-bootstrap rules @@ -34125,7 +34357,7 @@ stagefeedback-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stagefeedback > stage_current ; \ echo stagefeedback > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR) + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR) @if bfd @cd $(HOST_SUBDIR); [ -d stagefeedback-bfd ] || \ mkdir stagefeedback-bfd; \ @@ -34282,552 +34514,7 @@ stagefeedback-bubble:: stage1-bubble fi .PHONY: all-stagefeedback clean-stagefeedback -all-stagefeedback: \ - maybe-all-stagefeedback-bfd \ - maybe-all-stagefeedback-opcodes \ - maybe-all-stagefeedback-binutils \ - maybe-all-stagefeedback-gas \ - maybe-all-stagefeedback-gcc \ - maybe-all-stagefeedback-intl \ - maybe-all-stagefeedback-ld \ - maybe-all-stagefeedback-libcpp \ - maybe-all-stagefeedback-libiberty \ - maybe-all-stagefeedback-zlib - do-clean: clean-stagefeedback -clean-stagefeedback: \ - maybe-clean-stagefeedback-bfd \ - maybe-clean-stagefeedback-opcodes \ - maybe-clean-stagefeedback-binutils \ - maybe-clean-stagefeedback-gas \ - maybe-clean-stagefeedback-gcc \ - maybe-clean-stagefeedback-intl \ - maybe-clean-stagefeedback-ld \ - maybe-clean-stagefeedback-libcpp \ - maybe-clean-stagefeedback-libiberty \ - maybe-clean-stagefeedback-zlib - - -.PHONY: configure-stagefeedback-bfd maybe-configure-stagefeedback-bfd -.PHONY: all-stagefeedback-bfd maybe-all-stagefeedback-bfd -.PHONY: clean-stagefeedback-bfd maybe-clean-stagefeedback-bfd - -maybe-configure-stagefeedback-bfd: -maybe-all-stagefeedback-bfd: -maybe-clean-stagefeedback-bfd: - -@if bfd-bootstrap -maybe-configure-stagefeedback-bfd: configure-stagefeedback-bfd -configure-stagefeedback-bfd: - @$(MAKE) stagefeedback-start - @[ -f bfd/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in bfd ; \ - cd $(HOST_SUBDIR)/bfd || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/bfd"; \ - libsrcdir="$$s/bfd"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-bfd: all-stagefeedback-bfd -all-stagefeedback-bfd: configure-stagefeedback-bfd - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-bfd: clean-stagefeedback-bfd -clean-stagefeedback-bfd: - @[ -f bfd/Makefile ] || [ -f stagefeedback-bfd/Makefile ] \ - || exit 0 ; \ - [ -f bfd/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/bfd && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif bfd-bootstrap - - -.PHONY: configure-stagefeedback-opcodes maybe-configure-stagefeedback-opcodes -.PHONY: all-stagefeedback-opcodes maybe-all-stagefeedback-opcodes -.PHONY: clean-stagefeedback-opcodes maybe-clean-stagefeedback-opcodes - -maybe-configure-stagefeedback-opcodes: -maybe-all-stagefeedback-opcodes: -maybe-clean-stagefeedback-opcodes: - -@if opcodes-bootstrap -maybe-configure-stagefeedback-opcodes: configure-stagefeedback-opcodes -configure-stagefeedback-opcodes: - @$(MAKE) stagefeedback-start - @[ -f opcodes/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in opcodes ; \ - cd $(HOST_SUBDIR)/opcodes || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/opcodes"; \ - libsrcdir="$$s/opcodes"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-opcodes: all-stagefeedback-opcodes -all-stagefeedback-opcodes: configure-stagefeedback-opcodes - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-opcodes: clean-stagefeedback-opcodes -clean-stagefeedback-opcodes: - @[ -f opcodes/Makefile ] || [ -f stagefeedback-opcodes/Makefile ] \ - || exit 0 ; \ - [ -f opcodes/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/opcodes && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif opcodes-bootstrap - - -.PHONY: configure-stagefeedback-binutils maybe-configure-stagefeedback-binutils -.PHONY: all-stagefeedback-binutils maybe-all-stagefeedback-binutils -.PHONY: clean-stagefeedback-binutils maybe-clean-stagefeedback-binutils - -maybe-configure-stagefeedback-binutils: -maybe-all-stagefeedback-binutils: -maybe-clean-stagefeedback-binutils: - -@if binutils-bootstrap -maybe-configure-stagefeedback-binutils: configure-stagefeedback-binutils -configure-stagefeedback-binutils: - @$(MAKE) stagefeedback-start - @[ -f binutils/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in binutils ; \ - cd $(HOST_SUBDIR)/binutils || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/binutils"; \ - libsrcdir="$$s/binutils"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-binutils: all-stagefeedback-binutils -all-stagefeedback-binutils: configure-stagefeedback-binutils - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-binutils: clean-stagefeedback-binutils -clean-stagefeedback-binutils: - @[ -f binutils/Makefile ] || [ -f stagefeedback-binutils/Makefile ] \ - || exit 0 ; \ - [ -f binutils/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/binutils && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif binutils-bootstrap - - -.PHONY: configure-stagefeedback-gas maybe-configure-stagefeedback-gas -.PHONY: all-stagefeedback-gas maybe-all-stagefeedback-gas -.PHONY: clean-stagefeedback-gas maybe-clean-stagefeedback-gas - -maybe-configure-stagefeedback-gas: -maybe-all-stagefeedback-gas: -maybe-clean-stagefeedback-gas: - -@if gas-bootstrap -maybe-configure-stagefeedback-gas: configure-stagefeedback-gas -configure-stagefeedback-gas: - @$(MAKE) stagefeedback-start - @[ -f gas/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in gas ; \ - cd $(HOST_SUBDIR)/gas || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gas/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gas"; \ - libsrcdir="$$s/gas"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-gas: all-stagefeedback-gas -all-stagefeedback-gas: configure-stagefeedback-gas - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-gas: clean-stagefeedback-gas -clean-stagefeedback-gas: - @[ -f gas/Makefile ] || [ -f stagefeedback-gas/Makefile ] \ - || exit 0 ; \ - [ -f gas/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/gas && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif gas-bootstrap - - -.PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc -.PHONY: all-stagefeedback-gcc maybe-all-stagefeedback-gcc -.PHONY: clean-stagefeedback-gcc maybe-clean-stagefeedback-gcc - -maybe-configure-stagefeedback-gcc: -maybe-all-stagefeedback-gcc: -maybe-clean-stagefeedback-gcc: - -@if gcc-bootstrap -maybe-configure-stagefeedback-gcc: configure-stagefeedback-gcc -configure-stagefeedback-gcc: - @$(MAKE) stagefeedback-start - @[ -f gcc/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in gcc ; \ - cd $(HOST_SUBDIR)/gcc || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/gcc"; \ - libsrcdir="$$s/gcc"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-gcc: all-stagefeedback-gcc -all-stagefeedback-gcc: configure-stagefeedback-gcc - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) - -maybe-clean-stagefeedback-gcc: clean-stagefeedback-gcc -clean-stagefeedback-gcc: - @[ -f gcc/Makefile ] || [ -f stagefeedback-gcc/Makefile ] \ - || exit 0 ; \ - [ -f gcc/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/gcc && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" $(EXTRA_GCC_FLAGS) clean -@endif gcc-bootstrap - - -.PHONY: configure-stagefeedback-intl maybe-configure-stagefeedback-intl -.PHONY: all-stagefeedback-intl maybe-all-stagefeedback-intl -.PHONY: clean-stagefeedback-intl maybe-clean-stagefeedback-intl - -maybe-configure-stagefeedback-intl: -maybe-all-stagefeedback-intl: -maybe-clean-stagefeedback-intl: - -@if intl-bootstrap -maybe-configure-stagefeedback-intl: configure-stagefeedback-intl -configure-stagefeedback-intl: - @$(MAKE) stagefeedback-start - @[ -f intl/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in intl ; \ - cd $(HOST_SUBDIR)/intl || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/intl/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/intl"; \ - libsrcdir="$$s/intl"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-intl: all-stagefeedback-intl -all-stagefeedback-intl: configure-stagefeedback-intl - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-intl: clean-stagefeedback-intl -clean-stagefeedback-intl: - @[ -f intl/Makefile ] || [ -f stagefeedback-intl/Makefile ] \ - || exit 0 ; \ - [ -f intl/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/intl && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif intl-bootstrap - - -.PHONY: configure-stagefeedback-ld maybe-configure-stagefeedback-ld -.PHONY: all-stagefeedback-ld maybe-all-stagefeedback-ld -.PHONY: clean-stagefeedback-ld maybe-clean-stagefeedback-ld - -maybe-configure-stagefeedback-ld: -maybe-all-stagefeedback-ld: -maybe-clean-stagefeedback-ld: - -@if ld-bootstrap -maybe-configure-stagefeedback-ld: configure-stagefeedback-ld -configure-stagefeedback-ld: - @$(MAKE) stagefeedback-start - @[ -f ld/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in ld ; \ - cd $(HOST_SUBDIR)/ld || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/ld/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/ld"; \ - libsrcdir="$$s/ld"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-ld: all-stagefeedback-ld -all-stagefeedback-ld: configure-stagefeedback-ld - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-ld: clean-stagefeedback-ld -clean-stagefeedback-ld: - @[ -f ld/Makefile ] || [ -f stagefeedback-ld/Makefile ] \ - || exit 0 ; \ - [ -f ld/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/ld && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif ld-bootstrap - - -.PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp -.PHONY: all-stagefeedback-libcpp maybe-all-stagefeedback-libcpp -.PHONY: clean-stagefeedback-libcpp maybe-clean-stagefeedback-libcpp - -maybe-configure-stagefeedback-libcpp: -maybe-all-stagefeedback-libcpp: -maybe-clean-stagefeedback-libcpp: - -@if libcpp-bootstrap -maybe-configure-stagefeedback-libcpp: configure-stagefeedback-libcpp -configure-stagefeedback-libcpp: - @$(MAKE) stagefeedback-start - @[ -f libcpp/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in libcpp ; \ - cd $(HOST_SUBDIR)/libcpp || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libcpp"; \ - libsrcdir="$$s/libcpp"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-libcpp: all-stagefeedback-libcpp -all-stagefeedback-libcpp: configure-stagefeedback-libcpp - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-libcpp: clean-stagefeedback-libcpp -clean-stagefeedback-libcpp: - @[ -f libcpp/Makefile ] || [ -f stagefeedback-libcpp/Makefile ] \ - || exit 0 ; \ - [ -f libcpp/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/libcpp && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif libcpp-bootstrap - - -.PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty -.PHONY: all-stagefeedback-libiberty maybe-all-stagefeedback-libiberty -.PHONY: clean-stagefeedback-libiberty maybe-clean-stagefeedback-libiberty - -maybe-configure-stagefeedback-libiberty: -maybe-all-stagefeedback-libiberty: -maybe-clean-stagefeedback-libiberty: - -@if libiberty-bootstrap -maybe-configure-stagefeedback-libiberty: configure-stagefeedback-libiberty -configure-stagefeedback-libiberty: - @$(MAKE) stagefeedback-start - @[ -f libiberty/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in libiberty ; \ - cd $(HOST_SUBDIR)/libiberty || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/libiberty"; \ - libsrcdir="$$s/libiberty"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-libiberty: all-stagefeedback-libiberty -all-stagefeedback-libiberty: configure-stagefeedback-libiberty - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-libiberty: clean-stagefeedback-libiberty -clean-stagefeedback-libiberty: - @[ -f libiberty/Makefile ] || [ -f stagefeedback-libiberty/Makefile ] \ - || exit 0 ; \ - [ -f libiberty/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/libiberty && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif libiberty-bootstrap - - -.PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib -.PHONY: all-stagefeedback-zlib maybe-all-stagefeedback-zlib -.PHONY: clean-stagefeedback-zlib maybe-clean-stagefeedback-zlib - -maybe-configure-stagefeedback-zlib: -maybe-all-stagefeedback-zlib: -maybe-clean-stagefeedback-zlib: - -@if zlib-bootstrap -maybe-configure-stagefeedback-zlib: configure-stagefeedback-zlib -configure-stagefeedback-zlib: - @$(MAKE) stagefeedback-start - @[ -f zlib/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - echo Configuring stage feedback in zlib ; \ - cd $(HOST_SUBDIR)/zlib || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/zlib"; \ - libsrcdir="$$s/zlib"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - @stage2_werror_flag@ - -maybe-all-stagefeedback-zlib: all-stagefeedback-zlib -all-stagefeedback-zlib: configure-stagefeedback-zlib - @$(MAKE) stagefeedback-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(STAGE_HOST_EXPORTS) \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" - -maybe-clean-stagefeedback-zlib: clean-stagefeedback-zlib -clean-stagefeedback-zlib: - @[ -f zlib/Makefile ] || [ -f stagefeedback-zlib/Makefile ] \ - || exit 0 ; \ - [ -f zlib/Makefile ] || $(MAKE) stagefeedback-start ; \ - cd $(HOST_SUBDIR)/zlib && \ - $(MAKE) $(FLAGS_TO_PASS) \ - $(POSTSTAGE1_FLAGS_TO_PASS) \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" clean -@endif zlib-bootstrap - - # FIXME: Will not need to be conditional when toplevel bootstrap is the # only possibility, but now it conflicts with no-bootstrap rules @@ -34861,18 +34548,15 @@ stagefeedback-start:: profiledbootstrap: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Bootstrapping the compiler"; \ $(MAKE) stageprofile-bubble distclean-stagefeedback @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries and training compiler"; \ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Building feedback based compiler"; \ $(MAKE) stagefeedback-bubble stagefeedback-end @@ -35515,7 +35199,7 @@ $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def Makefile: $(srcdir)/Makefile.in config.status CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status -config.status: configure $(gcc_version_trigger) +config.status: configure CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck # Rebuilding configure. diff --git a/Makefile.tpl b/Makefile.tpl index 42531d0f752..2c114e40681 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -75,45 +75,25 @@ LN_S = @LN_S@ # Miscellaneous non-standard autoconf-set variables # ------------------------------------------------- -# The file containing GCC's version number. -gcc_version_trigger = @gcc_version_trigger@ -gcc_version = @gcc_version@ - # The gcc driver likes to know the arguments it was configured with. TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ -gxx_include_dir = @gxx_include_dir@ -libstdcxx_incdir = @libstdcxx_incdir@ - tooldir = @tooldir@ build_tooldir = @build_tooldir@ -# Directory in which the compiler finds executables, libraries, etc. -libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) GDB_NLM_DEPS = # This is the name of the environment variable used for the path to # the libraries. RPATH_ENVVAR = @RPATH_ENVVAR@ -# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared -# was used. -SET_LIB_PATH = @SET_LIB_PATH@ - -# configure.in sets SET_LIB_PATH to this if --enable-shared was used. -# Some platforms don't like blank entries, so we remove duplicate, -# leading and trailing colons. -REALLY_SET_LIB_PATH = \ - @SET_GCC_LIB_PATH@ \ - $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); - # This is the list of directories to be built for the build system. BUILD_CONFIGDIRS = libiberty # Build programs are put under this directory. BUILD_SUBDIR = @build_subdir@ # This is set by the configure script to the arguments to use when configuring # directories built for the build system. -BUILD_CONFIGARGS = @build_configargs@ +BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)" # This is the list of variables to export in the environment when # configuring any subdirectory. It must also be exported whenever @@ -178,11 +158,11 @@ HOST_EXPORTS = \ TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \ GMPINC="$(HOST_GMPINC)"; export GMPINC; \ - SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \ - @SET_GCC_LIB_PATH@ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); # Similar, for later GCC stages. -STAGE_HOST_EXPORTS = \ +POSTSTAGE1_HOST_EXPORTS = \ + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ $(HOST_EXPORTS) \ CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \ -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \ @@ -198,7 +178,7 @@ TARGET_CONFIGDIRS = @target_configdirs@ TARGET_SUBDIR = @target_subdir@ # This is set by the configure script to the arguments to use when configuring # directories built for the target. -TARGET_CONFIGARGS = @target_configargs@ +TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)" # This is the list of variables to export in the environment when # configuring subdirectories for the host system. BASE_TARGET_EXPORTS = \ @@ -218,8 +198,7 @@ BASE_TARGET_EXPORTS = \ NM="$(NM_FOR_TARGET)"; export NM; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - SET_GCC_LIB_PATH_CMD="@SET_GCC_LIB_PATH@"; export SET_GCC_LIB_PATH_CMD; \ - @SET_GCC_LIB_PATH@ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); RAW_CXX_TARGET_EXPORTS = \ $(BASE_TARGET_EXPORTS) \ @@ -325,10 +304,6 @@ RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ # Programs producing files for the HOST machine # --------------------------------------------- -# This is the list of directories that may be needed in RPATH_ENVVAR -# so that programs built for the host machine work. -HOST_LIB_PATH = $$r/$(HOST_SUBDIR)/bfd:$$r/$(HOST_SUBDIR)/opcodes - AS = @AS@ AR = @AR@ @@ -359,10 +334,6 @@ PICFLAG = # Programs producing files for the TARGET machine # ----------------------------------------------- -# This is the list of directories that may be needed in RPATH_ENVVAR -# so that prorgams built for the target machine work. -TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libmudflap/.libs - FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ AR_FOR_TARGET=@AR_FOR_TARGET@ @@ -510,6 +481,37 @@ PICFLAG_FOR_TARGET = @host_makefile_frag@ ### +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that prorgams built for the target machine work. +TARGET_LIB_PATH = [+ FOR target_modules +][+ + IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+ + ENDFOR target_modules +]$(HOST_LIB_PATH_gcc) +[+ FOR target_modules +][+ IF lib_path +] +@if target-[+module+] +TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]: +@endif target-[+module+] +[+ ENDIF lib_path +][+ ENDFOR target_modules +] + + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the host machine work. +HOST_LIB_PATH = [+ FOR host_modules +][+ + IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+ + ENDFOR host_modules +] + +# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch +@if gcc +HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc: +@endif gcc + +[+ FOR host_modules +][+ IF lib_path +] +@if [+module+] +HOST_LIB_PATH_[+module+] = \ + $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap + +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +] +@endif [+module+] +[+ ENDIF lib_path +][+ ENDFOR host_modules +] + # Flags to pass down to all sub-makes. BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\ "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\ @@ -773,7 +775,6 @@ uninstall: install.all: install-no-fixedincludes @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD_COMMAND}` ; export r ; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd ./gcc && \ $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ @@ -817,93 +818,143 @@ etags tags: TAGS # built are. TAGS: do-TAGS -# -------------------------------------- -# Modules which run on the build machine -# -------------------------------------- -[+ FOR build_modules +] -.PHONY: configure-build-[+module+] maybe-configure-build-[+module+] -maybe-configure-build-[+module+]: -@if build-[+module+] -maybe-configure-build-[+module+]: configure-build-[+module+] -configure-build-[+module+]: - @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \ +# ------------------------------------ +# Macros for configure and all targets +# ------------------------------------ + +[+ DEFINE configure +] +.PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+] +maybe-configure-[+prefix+][+module+]: +@if [+prefix+][+module+] +maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+] +configure-[+prefix+][+module+]: [+deps+] + @[+ IF bootstrap +]test -f stage_last && exit 0; \ + [+ ENDIF bootstrap +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(BUILD_EXPORTS) \ - echo Configuring in $(BUILD_SUBDIR)/[+module+]; \ - cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \ + [+exports+] \ + echo Configuring in [+subdir+]/[+module+]; \ + cd "[+subdir+]/[+module+]" || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(BUILD_SUBDIR)/[+module+]/ | \ + *) topdir=`echo [+subdir+]/[+module+]/ | \ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ esac; \ srcdiroption="--srcdir=$${topdir}/[+module+]"; \ libsrcdir="$$s/[+module+]"; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)" [+extra_configure_flags+] \ + [+ IF no-config-site +]rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) $${libsrcdir}/configure \ + [+args+] $${srcdiroption} [+extra_configure_flags+] \ || exit 1 -@endif build-[+module+] - -.PHONY: all-build-[+module+] maybe-all-build-[+module+] -maybe-all-build-[+module+]: -@if build-[+module+] -TARGET-build-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +] -maybe-all-build-[+module+]: all-build-[+module+] -all-build-[+module+]: configure-build-[+module+] - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(BUILD_EXPORTS) \ - (cd $(BUILD_SUBDIR)/[+module+] && \ - $(MAKE) [+extra_make_flags+] $(TARGET-build-[+module+])) -@endif build-[+module+] -[+ ENDFOR build_modules +] +@endif [+prefix+][+module+] -# -------------------------------------- -# Modules which run on the host machine -# -------------------------------------- -[+ FOR host_modules +] -.PHONY: configure-[+module+] maybe-configure-[+module+] -maybe-configure-[+module+]: -@if [+module+] -maybe-configure-[+module+]: configure-[+module+] -configure-[+module+]: - @[+ IF bootstrap +]test -f stage_last && exit 0; \ - [+ ENDIF bootstrap +]test ! -f $(HOST_SUBDIR)/[+module+]/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/[+module+] ; \ +[+ IF bootstrap +] +[+ FOR bootstrap_stage +] +.PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+] +maybe-configure-stage[+id+]-[+prefix+][+module+]: +@if [+module+]-bootstrap +maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] +configure-stage[+id+]-[+prefix+][+module+]: [+deps+] + @$(MAKE) stage[+id+]-start + @[ -f [+subdir+]/[+module+]/Makefile ] && exit 0 || : ; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(HOST_EXPORTS) \ - echo Configuring in [+module+]; \ - cd $(HOST_SUBDIR)/[+module+] || exit 1; \ + [+exports+][+ IF prev +] \ + [+poststage1_exports+][+ ENDIF prev +] \ + echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \ + cd [+subdir+]/[+module+] || exit 1; \ case $(srcdir) in \ /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/[+module+]/ | \ + *) topdir=`echo [+subdir+]/[+module+]/ | \ sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ esac; \ srcdiroption="--srcdir=$${topdir}/[+module+]"; \ libsrcdir="$$s/[+module+]"; \ $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} [+extra_configure_flags+] \ - || exit 1 -@endif [+module+] - -.PHONY: all-[+module+] maybe-all-[+module+] -maybe-all-[+module+]: -@if [+module+] -TARGET-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +] -maybe-all-[+module+]: all-[+module+] -all-[+module+]: configure-[+module+] + [+args+] $${srcdiroption} \ + [+stage_configure_flags+] [+extra_configure_flags+] +@endif [+module+]-bootstrap +[+ ENDFOR bootstrap_stage +] +[+ ENDIF bootstrap +] +[+ ENDDEF +] + +[+ DEFINE all +] +.PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+] +maybe-all-[+prefix+][+module+]: +@if [+prefix+][+module+] +TARGET-[+prefix+][+module+]=[+ + IF target +][+target+][+ ELSE +]all[+ ENDIF target +] +maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+] +all-[+prefix+][+module+]: configure-[+prefix+][+module+] @[+ IF bootstrap +]test -f stage_last && exit 0; \ [+ ENDIF bootstrap +]r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ - $(HOST_EXPORTS) \ - (cd $(HOST_SUBDIR)/[+module+] && \ - $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] $(TARGET-[+module+])) -@endif [+module+] + [+exports+] \ + (cd [+subdir+]/[+module+] && \ + $(MAKE) [+args+] [+extra_make_flags+] $(TARGET-[+prefix+][+module+])) +@endif [+prefix+][+module+] + +[+ IF bootstrap +] +[+ FOR bootstrap_stage +] +.PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+] +.PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+] +maybe-all-stage[+id+]-[+prefix+][+module+]: +maybe-clean-stage[+id+]-[+prefix+][+module+]: +@if [+module+]-bootstrap +maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+] +all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+] +all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+] + @$(MAKE) stage[+id+]-start + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + [+exports+][+ IF prev +] \ + [+poststage1_exports+][+ ENDIF prev +] \ + cd [+subdir+]/[+module+] && \ + $(MAKE) [+args+] [+ IF prev + +][+poststage1_args+][+ ENDIF prev + +] [+stage_make_flags+] [+extra_make_flags+] + +maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+] +clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+] +clean-stage[+id+]-[+prefix+][+module+]: + @[ -f [+subdir+]/[+module+]/Makefile ] || [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] \ + || exit 0 ; \ + [ -f [+subdir+]/[+module+]/Makefile ] || $(MAKE) stage[+id+]-start ; \ + cd [+subdir+]/[+module+] && \ + $(MAKE) [+args+] [+ IF prev +] \ + [+poststage1_args+] [+ ENDIF prev +] \ + [+stage_make_flags+] [+extra_make_flags+] clean +@endif [+module+]-bootstrap + +[+ ENDFOR bootstrap_stage +] +[+ ENDIF bootstrap +] +[+ ENDDEF +] + +# -------------------------------------- +# Modules which run on the build machine +# -------------------------------------- +[+ FOR build_modules +] +[+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" + args="$(BUILD_CONFIGARGS)" no-config-site=true +] + +[+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)" +] +[+ ENDFOR build_module +] + +# -------------------------------------- +# Modules which run on the host machine +# -------------------------------------- +[+ FOR host_modules +] +[+ configure prefix="" subdir="$(HOST_SUBDIR)" + exports="$(HOST_EXPORTS)" + poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" + args="$(HOST_CONFIGARGS)" +] + +[+ all prefix="" subdir="$(HOST_SUBDIR)" + exports="$(HOST_EXPORTS)" + poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)" + args="$(FLAGS_TO_PASS)" + poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +] .PHONY: check-[+module+] maybe-check-[+module+] maybe-check-[+module+]: @@ -917,7 +968,6 @@ check-[+module+]: @if [ '$(host)' = '$(target)' ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/[+module+] && \ $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check); \ @@ -926,7 +976,6 @@ check-[+module+]: check-[+module+]: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/[+module+] && \ $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] check) @@ -943,7 +992,6 @@ install-[+module+]: install-[+module+]: installdirs @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd $(HOST_SUBDIR)/[+module+] && \ $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install) @@ -967,7 +1015,6 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] @[ -f ./[+module+]/Makefile ] || exit 0; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \ eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ @@ -989,65 +1036,34 @@ maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+] # Modules which run on the target machine # --------------------------------------- [+ FOR target_modules +] -.PHONY: configure-target-[+module+] maybe-configure-target-[+module+] -maybe-configure-target-[+module+]: -@if target-[+module+] -maybe-configure-target-[+module+]: configure-target-[+module+] # There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +@if target-[+module+] $(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \ cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out - -configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out - @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \[+ -IF raw_cxx +] - $(RAW_CXX_TARGET_EXPORTS) \[+ -ELSE normal_cxx +] - $(NORMAL_TARGET_EXPORTS) \[+ -ENDIF raw_cxx +] - echo Configuring in $(TARGET_SUBDIR)/[+module+]; \ - cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(TARGET_SUBDIR)/[+module+]/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/[+module+]"; \ - libsrcdir="$$s/[+module+]"; \ - rm -f no-such-file || : ; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)" [+extra_configure_flags+] \ - || exit 1 @endif target-[+module+] -.PHONY: all-target-[+module+] maybe-all-target-[+module+] -maybe-all-target-[+module+]: -@if target-[+module+] -TARGET-target-[+module+]=[+ IF target +][+target+][+ ELSE +]all[+ ENDIF target +] -maybe-all-target-[+module+]: all-target-[+module+] -all-target-[+module+]: configure-target-[+module+] - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \[+ -IF raw_cxx +] - $(RAW_CXX_TARGET_EXPORTS) \[+ -ELSE normal_cxx +] - $(NORMAL_TARGET_EXPORTS) \[+ -ENDIF raw_cxx +] - (cd $(TARGET_SUBDIR)/[+module+] && \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ - IF raw_cxx - +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ - ENDIF raw_cxx - +] [+extra_make_flags+] $(TARGET-target-[+module+])) -@endif target-[+module+] +[+ IF raw_cxx +] +[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" + deps=(string-append "$(TARGET_SUBDIR)/" (get "module") "/multilib.out") + exports="$(RAW_CXX_TARGET_EXPORTS)" + args="$(TARGET_CONFIGARGS)" no-config-site=true +] + +[+ all prefix="target-" subdir="$(TARGET_SUBDIR)" + exports="$(RAW_CXX_TARGET_EXPORTS)" + args="$(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +] +[+ ELSE +] +[+ configure prefix="target-" subdir="$(TARGET_SUBDIR)" + deps=(string-append "$(TARGET_SUBDIR)/" (get "module") "/multilib.out") + exports="$(NORMAL_TARGET_EXPORTS)" + args="$(TARGET_CONFIGARGS)" no-config-site=true +] + +[+ all prefix="target-" subdir="$(TARGET_SUBDIR)" + exports="$(NORMAL_TARGET_EXPORTS)" + args="$(TARGET_FLAGS_TO_PASS)" +] +[+ ENDIF +] .PHONY: check-target-[+module+] maybe-check-target-[+module+] maybe-check-target-[+module+]: @@ -1059,8 +1075,7 @@ check-target-[+module+]: [+ ELSE check +] check-target-[+module+]: @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \[+ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ IF raw_cxx +] $(RAW_CXX_TARGET_EXPORTS) \[+ ELSE normal_cxx +] @@ -1085,8 +1100,7 @@ install-target-[+module+]: [+ ELSE install +] install-target-[+module+]: installdirs @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \[+ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ IF raw_cxx +] $(RAW_CXX_TARGET_EXPORTS) \[+ ELSE normal_cxx +] @@ -1113,8 +1127,7 @@ maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+] ENDFOR depend +] @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \ r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \[+ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+ IF raw_cxx +] $(RAW_CXX_TARGET_EXPORTS) \[+ ELSE normal_cxx +] @@ -1150,9 +1163,9 @@ GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstra $(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Bootstrapping the compiler"; \ + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ @@ -1170,32 +1183,28 @@ $(GCC_STRAP_TARGETS): all-prebootstrap configure-gcc msg="Comparing stage2 and stage3 of the compiler"; \ compare=compare ;; \ esac; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "$$msg"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all profiledbootstrap: all-prebootstrap configure-gcc @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ + $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,:[ :]*,:,g;s,^[ :]*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \ echo "Bootstrapping training compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Building feedback based compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) all @@ -1203,13 +1212,11 @@ profiledbootstrap: all-prebootstrap configure-gcc cross: all-build all-gas all-ld @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Building the C and C++ compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all @endif gcc-no-bootstrap @@ -1220,7 +1227,6 @@ check-gcc-c++: @if [ -f ./gcc/Makefile ] ; then \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ else \ @@ -1244,7 +1250,6 @@ gcc-no-fixedincludes: rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ (cd ./gcc && \ $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ @@ -1335,7 +1340,7 @@ stage[+id+]-start:: @[ -f stage_current ] && $(MAKE) `cat stage_current`-end || : ; \ echo stage[+id+] > stage_current ; \ echo stage[+id+] > stage_last; \ - $(mkinstalldirs) $(HOST_SUBDIR)[+ + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+ FOR host_modules +][+ IF bootstrap +] @if [+ module +] @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \ @@ -1369,70 +1374,7 @@ stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +][+IF lean +] fi .PHONY: all-stage[+id+] clean-stage[+id+] -all-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\ - maybe-all-stage[+id+]-[+module+][+ -ENDIF bootstrap+] [+ ENDFOR host_modules +] - do-clean: clean-stage[+id+] -clean-stage[+id+]: [+ FOR host_modules +][+ IF bootstrap +]\ - maybe-clean-stage[+id+]-[+module+][+ -ENDIF bootstrap+] [+ ENDFOR host_modules +] - -[+ FOR host_modules +][+ IF bootstrap +] -.PHONY: configure-stage[+id+]-[+module+] maybe-configure-stage[+id+]-[+module+] -.PHONY: all-stage[+id+]-[+module+] maybe-all-stage[+id+]-[+module+] -.PHONY: clean-stage[+id+]-[+module+] maybe-clean-stage[+id+]-[+module+] - -maybe-configure-stage[+id+]-[+module+]: -maybe-all-stage[+id+]-[+module+]: -maybe-clean-stage[+id+]-[+module+]: - -@if [+module+]-bootstrap -maybe-configure-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] -configure-stage[+id+]-[+module+]: - @$(MAKE) stage[+id+]-start - @[ -f [+module+]/Makefile ] && exit 0 || : ; \ - r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ - $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ - $(HOST_EXPORTS) [+ ENDIF prev +] \ - echo Configuring stage [+id+] in [+module+] ; \ - cd $(HOST_SUBDIR)/[+module+] || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \ - *) topdir=`echo $(HOST_SUBDIR)/[+module+]/ | \ - sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \ - esac; \ - srcdiroption="--srcdir=$${topdir}/[+module+]"; \ - libsrcdir="$$s/[+module+]"; \ - $(SHELL) $${libsrcdir}/configure \ - $(HOST_CONFIGARGS) $${srcdiroption} \ - [+stage_configure_flags+] [+extra_configure_flags+] - -maybe-all-stage[+id+]-[+module+]: all-stage[+id+]-[+module+] -all-stage[+id+]-[+module+]: configure-stage[+id+]-[+module+] - @$(MAKE) stage[+id+]-start - @r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; [+ IF prev +] \ - $(STAGE_HOST_EXPORTS) [+ ELSE prev +] \ - $(HOST_EXPORTS) [+ ENDIF prev +] \ - cd $(HOST_SUBDIR)/[+module+] && \ - $(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \ - $(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \ - [+stage_make_flags+] [+extra_make_flags+] - -maybe-clean-stage[+id+]-[+module+]: clean-stage[+id+]-[+module+] -clean-stage[+id+]-[+module+]: - @[ -f [+module+]/Makefile ] || [ -f stage[+id+]-[+module+]/Makefile ] \ - || exit 0 ; \ - [ -f [+module+]/Makefile ] || $(MAKE) stage[+id+]-start ; \ - cd $(HOST_SUBDIR)/[+module+] && \ - $(MAKE) $(FLAGS_TO_PASS) [+ IF prev +] \ - $(POSTSTAGE1_FLAGS_TO_PASS) [+ ENDIF prev +] \ - [+stage_make_flags+] [+extra_make_flags+] clean -@endif [+module+]-bootstrap - -[+ ENDIF bootstrap +][+ ENDFOR host_modules +] # FIXME: Will not need to be conditional when toplevel bootstrap is the # only possibility, but now it conflicts with no-bootstrap rules @@ -1500,18 +1442,15 @@ stagefeedback-start:: profiledbootstrap: @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Bootstrapping the compiler"; \ $(MAKE) stageprofile-bubble distclean-stagefeedback @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ - $(SET_LIB_PATH) \ echo "Building runtime libraries and training compiler"; \ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all @r=`${PWD_COMMAND}`; export r; \ s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - $(SET_LIB_PATH) \ $(HOST_EXPORTS) \ echo "Building feedback based compiler"; \ $(MAKE) stagefeedback-bubble stagefeedback-end @@ -1673,7 +1612,7 @@ $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def Makefile: $(srcdir)/Makefile.in config.status CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status -config.status: configure $(gcc_version_trigger) +config.status: configure CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck # Rebuilding configure. diff --git a/README.SCO b/README.SCO index fb2c0f81eae..1c32590274b 100644 --- a/README.SCO +++ b/README.SCO @@ -6,4 +6,4 @@ no longer believe that SCO is a serious threat. For more on the FSF's position regarding SCO's attacks on free software, please read: - http://www.gnu.org/philosophy/sco/sco.html + http://www.fsf.org/licensing/sco/ diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 9b5852d4777..6fa1406bd14 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,34 @@ +2005-05-09 Mike Stump + + * configure: Regenerate. + +2005-04-19 Hans-Peter Nilsson + + * os_dep.c, include/private/gc_locks.h: Import CRIS port by + Simon Posnjak from gc6.4. + * include/private/gcconfig.h: Ditto. Add M32R note from gc6.4. + +2005-04-17 David S. Miller + + * include/private/gcconfig.h (sparc-linux): Use LINUX_STACKBOTTOM. + * os_dep.c (GC_linux_stack_base): Check for bug present in some + Sparc glibc variants where __libc_stack_end is erroneously set + to "1". Fallback to procfs code in that case. + +2005-04-12 Mike Stump + + * configure: Regenerate. + +2005-04-12 Richard Henderson + + * include/private/gcconfig.h (alpha-linux): Use LINUX_STACKBOTTOM. + +2005-03-23 Mike Stump + + * darwin_stop_world.c: Update for -m64 multilib. + * include/private/gcconfig.h: Likewise. + * powerpc_darwin_mach_dep.s: Likewise. + 2005-03-01 Kelley Cook * Makefile.in, include/Makefile.in: Regenerate. diff --git a/boehm-gc/configure b/boehm-gc/configure index b205d328c03..7aa7c4ff03a 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -4379,6 +4379,67 @@ deplibs_check_method=$lt_cv_deplibs_check_method # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +# find the maximum length of command line arguments +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for *BSD + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len" ; then + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 +else + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 +fi + + # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) @@ -4712,7 +4773,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 4715 "configure"' > conftest.$ac_ext + echo '#line 4776 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? diff --git a/boehm-gc/darwin_stop_world.c b/boehm-gc/darwin_stop_world.c index 36378cbbce0..2fad9474716 100644 --- a/boehm-gc/darwin_stop_world.c +++ b/boehm-gc/darwin_stop_world.c @@ -1,5 +1,7 @@ #include "private/pthread_support.h" +/* This probably needs more porting work to ppc64. */ + # if defined(GC_DARWIN_THREADS) /* From "Inside Mac OS X - Mach-O Runtime Architecture" published by Apple @@ -14,13 +16,12 @@ */ #define PPC_RED_ZONE_SIZE 224 -/* Not 64-bit clean. Wait until Apple defines their 64-bit ABI */ typedef struct StackFrame { - unsigned int savedSP; - unsigned int savedCR; - unsigned int savedLR; - unsigned int reserved[2]; - unsigned int savedRTOC; + unsigned long savedSP; + unsigned long savedCR; + unsigned long savedLR; + unsigned long reserved[2]; + unsigned long savedRTOC; } StackFrame; diff --git a/boehm-gc/include/private/gc_locks.h b/boehm-gc/include/private/gc_locks.h index 775176b3151..46605caf72d 100644 --- a/boehm-gc/include/private/gc_locks.h +++ b/boehm-gc/include/private/gc_locks.h @@ -215,6 +215,30 @@ } # define GC_TEST_AND_SET_DEFINED # endif /* ARM32 */ +# ifdef CRIS + inline static int GC_test_and_set(volatile unsigned int *addr) { + /* Ripped from linuxthreads/sysdeps/cris/pt-machine.h. */ + /* Included with Hans-Peter Nilsson's permission. */ + register unsigned long int ret; + + /* Note the use of a dummy output of *addr to expose the write. + * The memory barrier is to stop *other* writes being moved past + * this code. + */ + __asm__ __volatile__("clearf\n" + "0:\n\t" + "movu.b [%2],%0\n\t" + "ax\n\t" + "move.b %3,[%2]\n\t" + "bwf 0b\n\t" + "clearf" + : "=&r" (ret), "=m" (*addr) + : "r" (addr), "r" ((int) 1), "m" (*addr) + : "memory"); + return ret; + } +# define GC_TEST_AND_SET_DEFINED +# endif /* CRIS */ # ifdef S390 inline static int GC_test_and_set(volatile unsigned int *addr) { int ret; diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index 64cbde22c30..5013dbd596b 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -229,6 +229,12 @@ # define ARM32 # define mach_type_known # endif +# if defined(LINUX) && defined(__cris__) +# ifndef CRIS +# define CRIS +# endif +# define mach_type_known +# endif # if defined(LINUX) && (defined(powerpc) || defined(__powerpc__) || defined(powerpc64) || defined(__powerpc64__)) # define POWERPC # define mach_type_known @@ -277,8 +283,9 @@ # define MACOS # define mach_type_known # endif -# if defined(macosx) || \ - defined(__APPLE__) && defined(__MACH__) && defined(__ppc__) +# if defined(macosx) \ + || defined(__APPLE__) && defined(__MACH__) && defined(__ppc__) \ + || defined(__APPLE__) && defined(__MACH__) && defined(__ppc64__) # define DARWIN # define POWERPC # define mach_type_known @@ -475,6 +482,8 @@ /* POWERPC ==> IBM/Apple PowerPC */ /* (MACOS(<=9),DARWIN(incl.MACOSX),*/ /* LINUX, NETBSD, NOSYS variants) */ + /* CRIS ==> Axis Etrax */ + /* M32R ==> Renesas M32R */ /* @@ -756,7 +765,12 @@ # define DATAEND (_end) # endif # ifdef DARWIN -# define ALIGNMENT 4 +# if (defined (__ppc64__)) +# define ALIGNMENT 8 +# define CPP_WORDSZ 64 +# else +# define ALIGNMENT 4 +# endif # define OS_TYPE "DARWIN" # define DYNAMIC_LOADING /* XXX: see get_end(3), get_etext() and get_end() should not be used. @@ -918,12 +932,10 @@ extern ptr_t GC_SysVGetDataStart(); # ifdef __arch64__ # define DATASTART GC_SysVGetDataStart(0x100000, _etext) - /* libc_stack_end is not set reliably for sparc64 */ -# define STACKBOTTOM ((ptr_t) 0x80000000000ULL) # else # define DATASTART GC_SysVGetDataStart(0x10000, _etext) -# define LINUX_STACKBOTTOM # endif +# define LINUX_STACKBOTTOM # endif # ifdef OPENBSD # define OS_TYPE "OPENBSD" @@ -1544,7 +1556,7 @@ # endif # ifdef LINUX # define OS_TYPE "LINUX" -# define STACKBOTTOM ((ptr_t) 0x120000000) +# define LINUX_STACKBOTTOM # ifdef __ELF__ # define SEARCH_FOR_DATA_START # define DYNAMIC_LOADING @@ -1797,6 +1809,19 @@ # endif #endif +# ifdef CRIS +# define MACH_TYPE "CRIS" +# define CPP_WORDSZ 32 +# define ALIGNMENT 1 +# define OS_TYPE "LINUX" +# define DYNAMIC_LOADING +# define LINUX_STACKBOTTOM +# define USE_GENERIC_PUSH_REGS +# define SEARCH_FOR_DATA_START + extern int _end[]; +# define DATAEND (_end) +# endif + # ifdef SH # define MACH_TYPE "SH" # define ALIGNMENT 4 @@ -2062,7 +2087,7 @@ # endif # if defined(HP_PA) || defined(M88K) || defined(POWERPC) && !defined(DARWIN) \ - || defined(LINT) || defined(MSWINCE) || defined(ARM32) \ + || defined(LINT) || defined(MSWINCE) || defined(ARM32) || defined(CRIS) \ || (defined(I386) && defined(__LCC__)) /* Use setjmp based hack to mark from callee-save registers. */ /* The define should move to the individual platform */ diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index 21d05635ab8..c4775c1978b 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -945,8 +945,17 @@ ptr_t GC_get_stack_base() } /* Otherwise it's not safe to add 16 bytes and we fall */ /* back to using /proc. */ # else +# ifdef SPARC + /* Older versions of glibc for 64-bit Sparc do not set + * this variable correctly, it gets set to either zero + * or one. + */ + if (__libc_stack_end != (ptr_t) (unsigned long)0x1) + return __libc_stack_end; +# else return __libc_stack_end; # endif +# endif } f = open("/proc/self/stat", O_RDONLY); if (f < 0 || STAT_READ(f, stat_buf, STAT_BUF_SIZE) < 2 * STAT_SKIP) { @@ -2510,7 +2519,11 @@ SIG_PF GC_old_segv_handler; /* Also old MSWIN32 ACCESS_VIOLATION filter */ # if defined(ARM32) char * addr = (char *)sc.fault_address; # else - --> architecture not supported +# if defined(CRIS) + char * addr = (char *)sc.regs.csraddr; +# else + --> architecture not supported +# endif # endif # endif # endif diff --git a/boehm-gc/powerpc_darwin_mach_dep.s b/boehm-gc/powerpc_darwin_mach_dep.s index 83f06cffca5..694005f416d 100644 --- a/boehm-gc/powerpc_darwin_mach_dep.s +++ b/boehm-gc/powerpc_darwin_mach_dep.s @@ -1,10 +1,21 @@ +#if defined(__ppc64__) +#define MODE_CHOICE(x, y) y +#else +#define MODE_CHOICE(x, y) x +#endif + +#define lgu MODE_CHOICE(lwzu, ldu) + +#define g_long MODE_CHOICE(long, quad) /* usage is ".g_long" */ + +#define LOG2_GPR_BYTES MODE_CHOICE(2,3) /* log2(GPR_BYTES) */ ; GC_push_regs function. Under some optimization levels GCC will clobber ; some of the non-volatile registers before we get a chance to save them ; therefore, this can't be inline asm. .text - .align 2 + .align LOG2_GPR_BYTES .globl _GC_push_regs _GC_push_regs: @@ -65,7 +76,7 @@ _GC_push_regs: .data .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32 - .align 2 + .align LOG2_GPR_BYTES L_GC_push_one$stub: .indirect_symbol _GC_push_one mflr r0 @@ -74,11 +85,11 @@ L0$_GC_push_one: mflr r11 addis r11,r11,ha16(L_GC_push_one$lazy_ptr-L0$_GC_push_one) mtlr r0 - lwzu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11) + lgu r12,lo16(L_GC_push_one$lazy_ptr-L0$_GC_push_one)(r11) mtctr r12 bctr .data .lazy_symbol_pointer L_GC_push_one$lazy_ptr: .indirect_symbol _GC_push_one - .long dyld_stub_binding_helper + .g_long dyld_stub_binding_helper diff --git a/config.sub b/config.sub index 987b17d8141..87a1ee49e67 100755 --- a/config.sub +++ b/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. -timestamp='2004-11-30' +timestamp='2005-04-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -70,7 +70,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -231,6 +231,7 @@ case $basic_machine in | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ @@ -262,7 +263,8 @@ case $basic_machine in | pyramid \ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ @@ -298,7 +300,7 @@ case $basic_machine in | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ - | bs2000-* \ + | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ @@ -336,7 +338,8 @@ case $basic_machine in | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ diff --git a/config/ChangeLog b/config/ChangeLog index 7d7dd7e11aa..c773aadd4a9 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,26 @@ +2005-05-19 Kelley Cook + + * accross.m4: Delete file. + +2005-05-12 Ryota Kunisawa + + PR bootstrap/21230 + * warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Add + double quotes around GCC variable. + +2005-04-29 Paolo Bonzini + + * acx.m4 (ACX_PROG_GNAT): Remove stray break. + +2005-03-31 Paolo Bonzini + + * gcc-lib-path.m4: Remove. + +2005-03-21 Zack Weinberg + + * gxx-include-dir.m4: In all substitutions, leave $(gcc_version) + to be expanded by the Makefile. + 2005-03-15 Zack Weinberg * gcc-version.m4: Delete. diff --git a/config/accross.m4 b/config/accross.m4 deleted file mode 100644 index 535a6f5c036..00000000000 --- a/config/accross.m4 +++ /dev/null @@ -1,98 +0,0 @@ -AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], -[changequote(<<, >>)dnl -dnl The name to #define. -define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl -dnl The cache variable name. -define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl -changequote([, ])dnl -AC_MSG_CHECKING(size of $1) -AC_CACHE_VAL(AC_CV_NAME, -[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence. - AC_TRY_COMPILE([#include "confdefs.h" -#include -$2 -], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) - if test x$AC_CV_NAME != x ; then break; fi -done -]) -if test x$AC_CV_NAME = x ; then - AC_MSG_ERROR([cannot determine a size for $1]) -fi -AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) -undefine([AC_TYPE_NAME])dnl -undefine([AC_CV_NAME])dnl -]) - -AC_DEFUN([AC_C_BIGENDIAN_CROSS], -[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, -[ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. -AC_TRY_COMPILE([#include -#include ], [ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. -AC_TRY_COMPILE([#include -#include ], [ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) -if test $ac_cv_c_bigendian = unknown; then -AC_TRY_RUN([main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, -[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) -fi]) -if test $ac_cv_c_bigendian = unknown; then -AC_MSG_CHECKING(to probe for byte ordering) -[ -cat >conftest.c <&AC_FD_MSG - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG - fi - fi -AC_MSG_RESULT($ac_cv_c_bigendian) -fi -if test $ac_cv_c_bigendian = yes; then - AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) - AC_DEFINE(HOST_WORDS_BIG_ENDIAN, 1, - [Define if the host machine stores words of multi-word integers in - big-endian order.]) - BYTEORDER=4321 -else - BYTEORDER=1234 -fi -AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) -if test $ac_cv_c_bigendian = unknown; then - AC_MSG_ERROR([unknown endianess - sorry, please pre-set ac_cv_c_bigendian]) -fi -]) diff --git a/config/acx.m4 b/config/acx.m4 index 6d3e6d5d5ab..b52342cf4ed 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -212,7 +212,6 @@ acx_cv_cc_gcc_supports_ada=no errors=`(${CC} -c conftest.adb) 2>&1 || echo failure` if test x"$errors" = x && test -f conftest.$ac_objext; then acx_cv_cc_gcc_supports_ada=yes - break fi rm -f conftest.*]) diff --git a/config/gcc-lib-path.m4 b/config/gcc-lib-path.m4 deleted file mode 100644 index 88c4023d01b..00000000000 --- a/config/gcc-lib-path.m4 +++ /dev/null @@ -1,15 +0,0 @@ -AC_DEFUN([TL_AC_GNU_MAKE_GCC_LIB_PATH], -[ -if test x"$SET_GCC_LIB_PATH_CMD" != x; then - # SET_GCC_LIB_PATH_CMD is "XXX=path; export XXX;". It is expanded to - # - # eval "set_gcc_lib_path=XXX=path; export XXX;" - # - eval "set_gcc_lib_path=$SET_GCC_LIB_PATH_CMD" - # It will set set_gcc_lib_path to "export XXX=path" for GNU make. - set_gcc_lib_path="export $set_gcc_lib_path" -else - set_gcc_lib_path= -fi -AC_SUBST(set_gcc_lib_path) -])dnl diff --git a/config/gxx-include-dir.m4 b/config/gxx-include-dir.m4 index 87a65adaa38..0e6e4ffc397 100644 --- a/config/gxx-include-dir.m4 +++ b/config/gxx-include-dir.m4 @@ -14,10 +14,10 @@ case "${with_gxx_include_dir}" in ;; no | "") case "${enable_version_specific_runtime_libs}" in - yes) gxx_include_dir='${libsubdir}/include/c++' ;; + yes) gxx_include_dir='$(libsubdir)/include/c++' ;; *) - libstdcxx_incdir=c++/${gcc_version} - gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;; + libstdcxx_incdir='c++/$(gcc_version)' + gxx_include_dir='$(prefix)/include/$(libstdcxx_incdir)' ;; esac ;; *) gxx_include_dir=${with_gxx_include_dir} ;; esac diff --git a/config/mh-mingw32 b/config/mh-mingw32 deleted file mode 100644 index f622c8bec01..00000000000 --- a/config/mh-mingw32 +++ /dev/null @@ -1,7 +0,0 @@ -# We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be -# built without debugging information - -LIBGCC2_DEBUG_CFLAGS= - -# custom installation rules for mingw32 (append .exe to binaries, etc.) -# INSTALL_DOSREL=install-dosrel diff --git a/config/warnings.m4 b/config/warnings.m4 index 2f44c922291..fdfa24b5781 100644 --- a/config/warnings.m4 +++ b/config/warnings.m4 @@ -50,7 +50,7 @@ AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC], AC_SUBST([WARN_PEDANTIC])dnl AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_$1])dnl WARN_PEDANTIC= -AS_IF([test $GCC = yes], +AS_IF([test "$GCC" = yes], [AC_CACHE_CHECK([whether $CC supports -pedantic $1], acx_Pedantic, [save_CFLAGS="$CFLAGS" CFLAGS="-pedantic $1" diff --git a/configure b/configure index 0077b55a7fa..be814518b79 100755 --- a/configure +++ b/configure @@ -852,37 +852,6 @@ topsrcdir=$srcpwd extra_host_args= -# Define the trigger file to make sure configure will re-run whenever -# the gcc version number changes. - -if test "${with_gcc_version_trigger+set}" = set; then - gcc_version_trigger=$with_gcc_version_trigger -else - gcc_version_trigger=$topsrcdir/gcc/version.c -fi -if test -f "${gcc_version_trigger}"; then - gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'` -else - gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'` -fi -gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` - - - - -if test -f $gcc_version_trigger ; then - case "$ac_configure_args" in - *--with-gcc-version-trigger=$gcc_version_trigger* ) - ;; - * ) - # Add to all subconfigure arguments: build, host, and target. - ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger" - ;; - esac -else - gcc_version_trigger= -fi - ### To add a new directory to the tree, first choose whether it is a target ### or a host dependent tool. Then put it into the appropriate list ### (library or tools, host or target), doing a dependency sort. @@ -1295,9 +1264,14 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-* | crisv32-*-*) + libgcj_ex_libffi=`echo ${libgcj} | sed -e 's/target-libffi//'` case "${target}" in - *-*-elf | *-*-aout) + *-*-aout) noconfigdirs="$noconfigdirs ${libgcj}";; + *-*-elf) + noconfigdirs="$noconfigdirs ${libgcj_ex_libffi}";; + *-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj_ex_libffi} target-newlib target-libgloss";; *) noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";; esac @@ -1707,7 +1681,6 @@ case "${host}" in host_makefile_frag="config/mh-cygwin" ;; *-mingw32*) - host_makefile_frag="config/mh-mingw32" ;; *-interix*) host_makefile_frag="config/mh-interix" @@ -1805,7 +1778,7 @@ else # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1809: checking for $ac_word" >&5 +echo "configure:1782: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1835,7 +1808,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1839: checking for $ac_word" >&5 +echo "configure:1812: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1886,7 +1859,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1890: checking for $ac_word" >&5 +echo "configure:1863: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1918,7 +1891,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1922: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1929,12 +1902,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1933 "configure" +#line 1906 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1960,12 +1933,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1964: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1969: checking whether we are using GNU C" >&5 +echo "configure:1942: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1974,7 +1947,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1978: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1993,7 +1966,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1997: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1970: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2060,7 +2033,7 @@ fi # Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args. set dummy ${ac_tool_prefix}gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2064: checking for $ac_word" >&5 +echo "configure:2037: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2092,7 +2065,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "gnatbind", so it can be a program name with args. set dummy gnatbind; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2096: checking for $ac_word" >&5 +echo "configure:2069: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2125,7 +2098,7 @@ fi fi echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6 -echo "configure:2129: checking whether compiler driver understands Ada" >&5 +echo "configure:2102: checking whether compiler driver understands Ada" >&5 if eval "test \"`echo '$''{'acx_cv_cc_gcc_supports_ada'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2144,7 +2117,6 @@ acx_cv_cc_gcc_supports_ada=no errors=`(${CC} -c conftest.adb) 2>&1 || echo failure` if test x"$errors" = x && test -f conftest.$ac_objext; then acx_cv_cc_gcc_supports_ada=yes - break fi rm -f conftest.* fi @@ -2158,7 +2130,7 @@ else fi echo $ac_n "checking how to compare bootstrapped objects""... $ac_c" 1>&6 -echo "configure:2162: checking how to compare bootstrapped objects" >&5 +echo "configure:2134: checking how to compare bootstrapped objects" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2256,9 +2228,9 @@ saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $gmpinc" # Check GMP actually works echo $ac_n "checking for correct version of gmp.h""... $ac_c" 1>&6 -echo "configure:2260: checking for correct version of gmp.h" >&5 +echo "configure:2232: checking for correct version of gmp.h" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2282,12 +2254,12 @@ rm -f conftest* if test x"$have_gmp" = xyes; then echo $ac_n "checking for MPFR""... $ac_c" 1>&6 -echo "configure:2286: checking for MPFR" >&5 +echo "configure:2258: checking for MPFR" >&5 saved_LIBS="$LIBS" LIBS="$LIBS $gmplibs" cat > conftest.$ac_ext < #include @@ -2295,7 +2267,7 @@ int main() { mpfr_t n; mpfr_init(n); ; return 0; } EOF -if { (eval echo configure:2299: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2452,8 +2424,8 @@ if test -d ${srcdir}/gcc; then missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` if test "x$missing_languages" != x; then { echo "configure: error: -The following requested languages were not found: ${missing_languages} -The available languages are: ${potential_languages}" 1>&2; exit 1; } +The following requested languages could not be built: ${missing_languages} +Recognised languages are: ${potential_languages}" 1>&2; exit 1; } fi if test "x$new_enable_languages" != "x$enable_languages"; then @@ -2782,7 +2754,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2786: checking for $ac_word" >&5 +echo "configure:2758: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2817,7 +2789,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2821: checking for $ac_word" >&5 +echo "configure:2793: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_YACC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2852,7 +2824,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2856: checking for $ac_word" >&5 +echo "configure:2828: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_M4'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2887,7 +2859,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2891: checking for $ac_word" >&5 +echo "configure:2863: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2922,7 +2894,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2926: checking for $ac_word" >&5 +echo "configure:2898: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2957,7 +2929,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2961: checking for $ac_word" >&5 +echo "configure:2933: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3054,30 +3026,9 @@ case "${host}" in ;; esac -# If no --enable-shared nor --disable-shared is specified, we set up -# LD_LIBRARY_PATH when we build for gcc. -case $enable_shared in -"") - if test -d ${srcdir}/gcc; then - set_lib_path=yes - else - set_lib_path=no - fi - ;; -*) - set_lib_path=$enable_shared - ;; -esac - -# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the -# binutils tools will find libbfd.so. -case "${set_lib_path}" in - no) SET_LIB_PATH= ;; - *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;; -esac - case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; + *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; esac @@ -3380,27 +3331,10 @@ fi # fixed in future. It's still worthwhile to use a cache file for each # directory. I think. -# Pass the appropriate --host, --build, and --cache-file arguments. -target_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}" - -# provide a proper gxx_include_dir. - -case "${with_gxx_include_dir}" in - yes) - { echo "configure: error: --with-gxx-include-dir=[dir] requires a directory" 1>&2; exit 1; } - ;; - no | "") - case "${enable_version_specific_runtime_libs}" in - yes) gxx_include_dir='${libsubdir}/include/c++' ;; - *) - libstdcxx_incdir=c++/${gcc_version} - gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;; - esac ;; - *) gxx_include_dir=${with_gxx_include_dir} ;; -esac - - - +# Pass the appropriate --build, --host, --target and --cache-file arguments. +# We need to pass --target, as newer autoconf's requires consistency +# for target_alias and gcc doesn't manage it consistently. +target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}" FLAGS_FOR_TARGET= case " $target_configdirs " in @@ -3576,7 +3510,6 @@ done - # Build module lists & subconfigure args. @@ -3603,7 +3536,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3607: checking for $ac_word" >&5 +echo "configure:3540: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3636,7 +3569,7 @@ if test -z "$ac_cv_prog_AR" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3640: checking for $ac_word" >&5 +echo "configure:3573: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3675,7 +3608,7 @@ fi # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3679: checking for $ac_word" >&5 +echo "configure:3612: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3708,7 +3641,7 @@ if test -z "$ac_cv_prog_AS" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3712: checking for $ac_word" >&5 +echo "configure:3645: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3747,7 +3680,7 @@ fi # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3751: checking for $ac_word" >&5 +echo "configure:3684: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3780,7 +3713,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3784: checking for $ac_word" >&5 +echo "configure:3717: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3819,7 +3752,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3823: checking for $ac_word" >&5 +echo "configure:3756: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3852,7 +3785,7 @@ if test -z "$ac_cv_prog_LD" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3856: checking for $ac_word" >&5 +echo "configure:3789: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3891,7 +3824,7 @@ fi # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3895: checking for $ac_word" >&5 +echo "configure:3828: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3924,7 +3857,7 @@ if test -z "$ac_cv_prog_NM" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3928: checking for $ac_word" >&5 +echo "configure:3861: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3963,7 +3896,7 @@ fi # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3967: checking for $ac_word" >&5 +echo "configure:3900: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3996,7 +3929,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4000: checking for $ac_word" >&5 +echo "configure:3933: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4035,7 +3968,7 @@ fi # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4039: checking for $ac_word" >&5 +echo "configure:3972: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4068,7 +4001,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4072: checking for $ac_word" >&5 +echo "configure:4005: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4107,7 +4040,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4111: checking for $ac_word" >&5 +echo "configure:4044: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4140,7 +4073,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4144: checking for $ac_word" >&5 +echo "configure:4077: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4179,7 +4112,7 @@ fi # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. set dummy ${ncn_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4183: checking for $ac_word" >&5 +echo "configure:4116: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4212,7 +4145,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4216: checking for $ac_word" >&5 +echo "configure:4149: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4258,7 +4191,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4262: checking for $ac_word" >&5 +echo "configure:4195: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4291,7 +4224,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AR_FOR_TARGET" ; then # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4295: checking for $ac_word" >&5 +echo "configure:4228: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AR_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4330,7 +4263,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4334: checking for $ac_word" >&5 +echo "configure:4267: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4363,7 +4296,7 @@ if test -z "$ac_cv_prog_CONFIGURED_AS_FOR_TARGET" ; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4367: checking for $ac_word" >&5 +echo "configure:4300: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_AS_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4402,7 +4335,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4406: checking for $ac_word" >&5 +echo "configure:4339: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4435,7 +4368,7 @@ if test -z "$ac_cv_prog_CONFIGURED_DLLTOOL_FOR_TARGET" ; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4439: checking for $ac_word" >&5 +echo "configure:4372: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4474,7 +4407,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4478: checking for $ac_word" >&5 +echo "configure:4411: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4507,7 +4440,7 @@ if test -z "$ac_cv_prog_CONFIGURED_LD_FOR_TARGET" ; then # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4511: checking for $ac_word" >&5 +echo "configure:4444: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_LD_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4546,7 +4479,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4550: checking for $ac_word" >&5 +echo "configure:4483: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4579,7 +4512,7 @@ if test -z "$ac_cv_prog_CONFIGURED_NM_FOR_TARGET" ; then # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4583: checking for $ac_word" >&5 +echo "configure:4516: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_NM_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4618,7 +4551,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4622: checking for $ac_word" >&5 +echo "configure:4555: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4651,7 +4584,7 @@ if test -z "$ac_cv_prog_CONFIGURED_RANLIB_FOR_TARGET" ; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4655: checking for $ac_word" >&5 +echo "configure:4588: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_RANLIB_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4690,7 +4623,7 @@ fi # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4694: checking for $ac_word" >&5 +echo "configure:4627: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4723,7 +4656,7 @@ if test -z "$ac_cv_prog_CONFIGURED_WINDRES_FOR_TARGET" ; then # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4727: checking for $ac_word" >&5 +echo "configure:4660: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_CONFIGURED_WINDRES_FOR_TARGET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4808,7 +4741,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4812: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4745: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -4855,7 +4788,7 @@ esac # gcc for stageN-gcc and stagePREV-gcc for stage(N-1). In case this is not # possible, however, we can resort to mv. echo $ac_n "checking if symbolic links between directories work""... $ac_c" 1>&6 -echo "configure:4859: checking if symbolic links between directories work" >&5 +echo "configure:4792: checking if symbolic links between directories work" >&5 if eval "test \"`echo '$''{'gcc_cv_prog_ln_s_dir'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4903,26 +4836,6 @@ case ${enable_werror} in esac -# If gcc is built natively with shared library enabled, set -# $RPATH_ENVVAR to make sure the newly built gcc shared librares are -# used. -SET_GCC_LIB_PATH= -if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then - case "${set_lib_path}" in - no) ;; - *) - eval "d=\$$RPATH_ENVVAR" - if test x"$d" != x; then - d="$pwd/gcc:$d" - else - d="$pwd/gcc" - fi - SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);" - ;; - esac -fi - - trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -5089,9 +5002,6 @@ s%@INSTALL_DATA@%$INSTALL_DATA%g s%@LN@%$LN%g s%@LN_S@%$LN_S%g s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g -s%@gcc_version_trigger@%$gcc_version_trigger%g -s%@gcc_version_full@%$gcc_version_full%g -s%@gcc_version@%$gcc_version%g s%@build_subdir@%$build_subdir%g s%@host_subdir@%$host_subdir%g s%@target_subdir@%$target_subdir%g @@ -5111,8 +5021,6 @@ s%@bootstrap_lean@%$bootstrap_lean%g s%@default_target@%$default_target%g /@serialization_dependencies@/r $serialization_dependencies s%@serialization_dependencies@%%g -s%@gxx_include_dir@%$gxx_include_dir%g -s%@libstdcxx_incdir@%$libstdcxx_incdir%g /@host_makefile_frag@/r $host_makefile_frag s%@host_makefile_frag@%%g /@target_makefile_frag@/r $target_makefile_frag @@ -5121,7 +5029,6 @@ s%@target_makefile_frag@%%g s%@alphaieee_frag@%%g /@ospace_frag@/r $ospace_frag s%@ospace_frag@%%g -s%@SET_LIB_PATH@%$SET_LIB_PATH%g s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g s%@BUILD_PREFIX@%$BUILD_PREFIX%g s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g @@ -5193,7 +5100,6 @@ s%@stage1_cflags@%$stage1_cflags%g s%@CREATE_LINK_TO_DIR@%$CREATE_LINK_TO_DIR%g s%@UNDO_LINK_TO_DIR@%$UNDO_LINK_TO_DIR%g s%@stage2_werror_flag@%$stage2_werror_flag%g -s%@SET_GCC_LIB_PATH@%$SET_GCC_LIB_PATH%g CEOF EOF diff --git a/configure.in b/configure.in index 59d349cd8d2..c2ced9168a7 100644 --- a/configure.in +++ b/configure.in @@ -19,8 +19,6 @@ ### WARNING: this file contains embedded tabs. Do not run untabify on this file. sinclude(config/acx.m4) -sinclude(config/gcc-version.m4) -sinclude(config/gxx-include-dir.m4) AC_INIT(move-if-change) AC_PREREQ(2.13) @@ -101,22 +99,6 @@ topsrcdir=$srcpwd extra_host_args= -# Define the trigger file to make sure configure will re-run whenever -# the gcc version number changes. -TL_AC_GCC_VERSION([$topsrcdir]) -if test -f $gcc_version_trigger ; then - case "$ac_configure_args" in - *--with-gcc-version-trigger=$gcc_version_trigger* ) - ;; - * ) - # Add to all subconfigure arguments: build, host, and target. - ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger" - ;; - esac -else - gcc_version_trigger= -fi - ### To add a new directory to the tree, first choose whether it is a target ### or a host dependent tool. Then put it into the appropriate list ### (library or tools, host or target), doing a dependency sort. @@ -499,9 +481,14 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-* | crisv32-*-*) + libgcj_ex_libffi=`echo ${libgcj} | sed -e 's/target-libffi//'` case "${target}" in - *-*-elf | *-*-aout) + *-*-aout) noconfigdirs="$noconfigdirs ${libgcj}";; + *-*-elf) + noconfigdirs="$noconfigdirs ${libgcj_ex_libffi}";; + *-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj_ex_libffi} target-newlib target-libgloss";; *) noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss";; esac @@ -911,7 +898,6 @@ case "${host}" in host_makefile_frag="config/mh-cygwin" ;; *-mingw32*) - host_makefile_frag="config/mh-mingw32" ;; *-interix*) host_makefile_frag="config/mh-interix" @@ -1245,8 +1231,8 @@ if test -d ${srcdir}/gcc; then missing_languages=`echo "$missing_languages" | sed -e "s/^,//" -e "s/,$//"` if test "x$missing_languages" != x; then AC_MSG_ERROR([ -The following requested languages were not found: ${missing_languages} -The available languages are: ${potential_languages}]) +The following requested languages could not be built: ${missing_languages} +Recognised languages are: ${potential_languages}]) fi if test "x$new_enable_languages" != "x$enable_languages"; then @@ -1643,30 +1629,9 @@ case "${host}" in ;; esac -# If no --enable-shared nor --disable-shared is specified, we set up -# LD_LIBRARY_PATH when we build for gcc. -case $enable_shared in -"") - if test -d ${srcdir}/gcc; then - set_lib_path=yes - else - set_lib_path=no - fi - ;; -*) - set_lib_path=$enable_shared - ;; -esac - -# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the -# binutils tools will find libbfd.so. -case "${set_lib_path}" in - no) SET_LIB_PATH= ;; - *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;; -esac - case "${host}" in *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; + *-*-darwin* | *-*-rhapsody* ) RPATH_ENVVAR=DYLD_LIBRARY_PATH ;; *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; esac @@ -1963,11 +1928,10 @@ fi # fixed in future. It's still worthwhile to use a cache file for each # directory. I think. -# Pass the appropriate --host, --build, and --cache-file arguments. -target_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}" - -# provide a proper gxx_include_dir. -TL_AC_GXX_INCLUDE_DIR +# Pass the appropriate --build, --host, --target and --cache-file arguments. +# We need to pass --target, as newer autoconf's requires consistency +# for target_alias and gcc doesn't manage it consistently. +target_configargs="--cache-file=./config.cache --build=${build_alias} --host=${target_alias} --target=${target_alias} ${target_configargs}" FLAGS_FOR_TARGET= case " $target_configdirs " in @@ -2136,7 +2100,6 @@ AC_SUBST_FILE(alphaieee_frag) AC_SUBST_FILE(ospace_frag) # Miscellanea: directories, flags, etc. -AC_SUBST(SET_LIB_PATH) AC_SUBST(RPATH_ENVVAR) AC_SUBST(BUILD_PREFIX) AC_SUBST(BUILD_PREFIX_1) @@ -2315,24 +2278,4 @@ case ${enable_werror} in esac AC_SUBST(stage2_werror_flag) -# If gcc is built natively with shared library enabled, set -# $RPATH_ENVVAR to make sure the newly built gcc shared librares are -# used. -SET_GCC_LIB_PATH= -if test -d ${srcdir}/gcc && test x${is_cross_compiler} = xno; then - case "${set_lib_path}" in - no) ;; - *) - eval "d=\$$RPATH_ENVVAR" - if test x"$d" != x; then - d="$pwd/gcc:$d" - else - d="$pwd/gcc" - fi - SET_GCC_LIB_PATH="\$(RPATH_ENVVAR)=$d; export \$(RPATH_ENVVAR);" - ;; - esac -fi -AC_SUBST(SET_GCC_LIB_PATH) - AC_OUTPUT(Makefile) diff --git a/contrib/ChangeLog b/contrib/ChangeLog index 04129112ba2..b5bc02cab31 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,19 @@ +2005-04-17 Joseph S. Myers + + * gennews (files): Update for GCC 4.0. + +2005-03-18 Alexandre Oliva + + * gcc_update (silent): Unset instead of initializing to null. + +2005-03-18 Andreas Schwab + + * gcc_update (apply_patch): Properly quote $1. + +2005-03-18 Zack Weinberg + + * gcc_update: Add --silent option. + 2005-03-08 Kaveh R. Ghazi * warn_summary (keywordFilter): Update sed pattern for new quoting diff --git a/contrib/gcc_update b/contrib/gcc_update index 7e0e837e1af..cab6c47ec12 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -19,6 +19,9 @@ # If the first parameter is --list, a list of the generated files and # their dependencies will be printed; --help prints this message. # +# If the first parameter is --silent, this script prints nothing other +# than error messages; the second parameter is then interpreted as above. +# # Examples: # # contrib/gcc_update -r gcc_latest_snapshot @@ -29,7 +32,7 @@ # contrib/gcc_update --list # # -# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation +# (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation # Originally by Gerald Pfeifer , August 1998. # # This script is Free Software, and it can be copied, distributed and @@ -51,6 +54,15 @@ UPDATE_OPTIONS=-Pd # Arrange for the value of $0 to be available for functions self=$0 +# This function prints its arguments to standard output unless +# "silent" is set. +unset silent +chat () { + if [ -z "$silent" ]; then + echo "$@" + fi +} + # This function prints a list of all generated files, along with their # dependencies. Note that only one target is supported per line: the # colon is stripped from the output. @@ -125,7 +137,7 @@ touch_files () { echo ':' >> Makefile.$$ echo ' @for f in $? $@; do test -f $$f || exit 0; done; \' >> Makefile.$$ echo ' echo Touching $@...; \' >> Makefile.$$ - echo ' echo Touching $@... 1>&2; \' >> Makefile.$$ + chat ' echo Touching $@... 1>&2; \' >> Makefile.$$ echo ' touch $@' >> Makefile.$$ files_and_dependencies | sed 's,[^ ]* ,,;s,$, :,' >> Makefile.$$ @@ -148,21 +160,21 @@ touch_files () { # this script. By re-execing it, we ensure that the appropriate # dependencies and rules will be used. touch_files_reexec () { - echo "Adjusting file timestamps" - exec ${CONFIG_SHELL-/bin/sh} $self --touch + chat "Adjusting file timestamps" + exec ${CONFIG_SHELL-/bin/sh} $self ${silent+"--silent"} --touch } # This functions applies a patch to an existing tree. apply_patch () { - if [ -f $1 ]; then + if [ -f "$1" ]; then echo "Applying patch file $1" - case "$1" in + case $1 in *gz) - gzip -d -c $1 | patch -p1 ;; + gzip -d -c "$1" | patch -p1 ;; *bz2) - bzip2 -d -c $1 | patch -p1 ;; + bzip2 -d -c "$1" | patch -p1 ;; *) - cat $1 | patch -p1 ;; + patch -p1 < "$1";; esac fi touch_files_reexec @@ -175,6 +187,13 @@ if [ ! -f gcc/version.c ]; then fi case "$1" in +--silent) + silent=t + shift + ;; +esac + +case "$1" in # First of all, check whether we are going to process a patch. --patch) if test "$#" != 2; then @@ -228,8 +247,9 @@ else set -- $UPDATE_OPTIONS ${1+"$@"} fi -echo "Updating CVS tree" -$GCC_CVS -q update ${1+"$@"} +chat "Updating CVS tree" + +$GCC_CVS -q ${silent+-Q} update ${1+"$@"} if [ $? -ne 0 ]; then (touch_files_reexec) echo "CVS update of full tree failed." >&2 diff --git a/contrib/gennews b/contrib/gennews index 37eb659134b..14a76b22510 100755 --- a/contrib/gennews +++ b/contrib/gennews @@ -3,7 +3,7 @@ # Script to generate the NEWS file from online release notes. # Contributed by Joseph Myers . # -# Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. # This file is part of GCC. # # GCC is free software; you can redistribute it and/or modify @@ -22,7 +22,8 @@ # Boston, MA 02111-1307, USA. website=http://gcc.gnu.org/ -files="gcc-3.4/index.html gcc-3.4/changes.html +files="gcc-4.0/index.html gcc-4.0/changes.html + gcc-3.4/index.html gcc-3.4/changes.html gcc-3.3/index.html gcc-3.3/changes.html gcc-3.2/index.html gcc-3.2/changes.html gcc-3.1/index.html gcc-3.1/changes.html diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog index 2adedb2af45..e17b5e18671 100644 --- a/fastjar/ChangeLog +++ b/fastjar/ChangeLog @@ -1,3 +1,20 @@ +2005-05-17 Kelley Cook + + * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. + Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. + * Makefile.am: Remove ACLOCAL_AMFLAGS. + * aclocal.m4, Makefile.in, configure, config.h.in: Regenerate. + +2005-03-28 Marcin Dalecki + + * jartool.c (main): Indentation fixlet. + (add_entry): Likewise. + (init_args): Don't use K&R style. + (jt_strdup): Likewise. + (get_next_arg): Add explicit '(void)'. + (init_headers): Likewise. + (version): Likewise. + 2005-03-15 Zack Weinberg * Makefile.am (fastjar_TEXINFOS): Add gcc-vers.texi. diff --git a/fastjar/Makefile.am b/fastjar/Makefile.am index 6e105b5ba59..099656a34e2 100644 --- a/fastjar/Makefile.am +++ b/fastjar/Makefile.am @@ -1,7 +1,5 @@ # Process this with automake to create Makefile.in -ACLOCAL_AMFLAGS = -I ../config - # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and # friends when we are called from the top level Makefile. diff --git a/fastjar/Makefile.in b/fastjar/Makefile.in index 49716a1d5fb..24bd78898b3 100644 --- a/fastjar/Makefile.in +++ b/fastjar/Makefile.in @@ -48,8 +48,8 @@ DIST_COMMON = README $(am__configure_deps) $(fastjar_TEXINFOS) \ $(srcdir)/install-defs.sh.in $(top_srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL NEWS ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../config/accross.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -190,7 +190,6 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -ACLOCAL_AMFLAGS = -I ../config # Work around what appears to be a GNU make bug handling MAKEFLAGS # values defined in terms of make variables, as is the case for CC and @@ -645,7 +644,7 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - $(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../config $(distdir)/../gcc/doc/include + $(mkdir_p) $(distdir)/. $(distdir)/.. $(distdir)/../gcc/doc/include @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ diff --git a/fastjar/aclocal.m4 b/fastjar/aclocal.m4 index f8ccf0d9654..1759af44871 100644 --- a/fastjar/aclocal.m4 +++ b/fastjar/aclocal.m4 @@ -1082,5 +1082,4 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([../config/accross.m4]) m4_include([acinclude.m4]) diff --git a/fastjar/config.h.in b/fastjar/config.h.in index 84efea0e5fc..330488a5cff 100644 --- a/fastjar/config.h.in +++ b/fastjar/config.h.in @@ -1,8 +1,5 @@ /* config.h.in. Generated from configure.ac by autoheader. */ -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#undef BYTEORDER - /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -63,10 +60,6 @@ /* Define to 1 if you have the `_chsize' function. */ #undef HAVE__CHSIZE -/* Define if the host machine stores words of multi-word integers in - big-endian order. */ -#undef HOST_WORDS_BIG_ENDIAN - /* Define if host mkdir takes a single argument. */ #undef MKDIR_TAKES_ONE_ARG @@ -88,19 +81,19 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The number of bytes in type char */ +/* The size of a `char', as computed by sizeof. */ #undef SIZEOF_CHAR -/* The number of bytes in type int */ +/* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT -/* The number of bytes in type long */ +/* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The number of bytes in type long long */ +/* The size of a `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG -/* The number of bytes in type short */ +/* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* Define to 1 if you have the ANSI C header files. */ @@ -112,7 +105,8 @@ /* Version number of package */ #undef VERSION -/* whether byteorder is bigendian */ +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Define to `long' if does not define. */ diff --git a/fastjar/configure b/fastjar/configure index 9ab4cf0184c..6d0f5b57f8f 100755 --- a/fastjar/configure +++ b/fastjar/configure @@ -4469,26 +4469,129 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for char" >&5 +echo $ECHO_N "checking for char... $ECHO_C" >&6 +if test "${ac_cv_type_char+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +if ((char *) 0) + return 0; +if (sizeof (char)) + return 0; + ; + return 0; +} +_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_cv_type_char=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_char=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 +echo "${ECHO_T}$ac_cv_type_char" >&6 + echo "$as_me:$LINENO: checking size of char" >&5 echo $ECHO_N "checking size of char... $ECHO_C" >&6 if test "${ac_cv_sizeof_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF + if test "$ac_cv_type_char" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "confdefs.h" -#include - +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; +test_array [0] = 0 + ; + return 0; +} +_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_lo=0 ac_mid=0 + while :; do + 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 int main () { -switch (0) case 0: case (sizeof (char) == $ac_size):; +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -4515,51 +4618,1698 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_char=$ac_size + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_char != x ; then break; fi -done + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -fi +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; +test_array [0] = 0 -if test x$ac_cv_sizeof_char = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for char" >&5 -echo "$as_me: error: cannot determine a size for char" >&2;} - { (exit 1); exit 1; }; } + ; + return 0; +} +_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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 -echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR $ac_cv_sizeof_char +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; +test_array [0] = 0 + ; + return 0; +} +_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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6 -if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_char=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "confdefs.h" -#include - - +$ac_includes_default +long longval () { return (long) (sizeof (char)); } +unsigned long ulongval () { return (long) (sizeof (char)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (char))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (char)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_char=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (char), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_char=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 +echo "${ECHO_T}$ac_cv_sizeof_char" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_CHAR $ac_cv_sizeof_char +_ACEOF + + +echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6 +if test "${ac_cv_type_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +if ((short *) 0) + return 0; +if (sizeof (short)) + return 0; + ; + return 0; +} +_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_cv_type_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_short=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6 + +echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6 +if test "${ac_cv_sizeof_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_short" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_short=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + 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 +long longval () { return (long) (sizeof (short)); } +unsigned long ulongval () { return (long) (sizeof (short)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (short))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (short)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_short=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (short), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_short=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_SHORT $ac_cv_sizeof_short +_ACEOF + + +echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6 +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +if ((int *) 0) + return 0; +if (sizeof (int)) + return 0; + ; + return 0; +} +_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_cv_type_int=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6 + +echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6 +if test "${ac_cv_sizeof_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_int" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_int=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + 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 +long longval () { return (long) (sizeof (int)); } +unsigned long ulongval () { return (long) (sizeof (int)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (int))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (int)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_int=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (int), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_int=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_INT $ac_cv_sizeof_int +_ACEOF + + +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + return 0; + ; + return 0; +} +_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_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 + +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=0 ac_mid=0 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=-1 ac_mid=-1 + while :; do + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + 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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_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_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr '(' $ac_mid ')' + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + 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 +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_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_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 +if test $ac_cv_type_long_long = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_LONG_LONG 1 +_ACEOF + +echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6 +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +if ((long long *) 0) + return 0; +if (sizeof (long long)) + return 0; + ; + return 0; +} +_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_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6 + +echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$ac_cv_type_long_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +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 +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_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_lo=0 ac_mid=0 + while :; do + 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 int main () { -switch (0) case 0: case (sizeof (short) == $ac_size):; +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -4586,51 +6336,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_short=$ac_size + ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_short != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_short = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for short" >&5 -echo "$as_me: error: cannot determine a size for short" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF - - -echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6 -if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + done else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "confdefs.h" -#include - - +$ac_includes_default int main () { -switch (0) case 0: case (sizeof (int) == $ac_size):; +static int test_array [1 - 2 * !(((long) (sizeof (long long))) < 0)]; +test_array [0] = 0 + ; return 0; } @@ -4657,51 +6393,21 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_int=$ac_size -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_int != x ; then break; fi -done - -fi - -if test x$ac_cv_sizeof_int = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for int" >&5 -echo "$as_me: error: cannot determine a size for int" >&2;} - { (exit 1); exit 1; }; } -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat >conftest.$ac_ext <<_ACEOF + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "confdefs.h" -#include - - +$ac_includes_default int main () { -switch (0) case 0: case (sizeof (long) == $ac_size):; +static int test_array [1 - 2 * !(((long) (sizeof (long long))) >= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -4728,36 +6434,32 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_long=$ac_size + ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_long != x ; then break; fi -done + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo= ac_hi= fi - -if test x$ac_cv_sizeof_long = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for long" >&5 -echo "$as_me: error: cannot determine a size for long" >&2;} - { (exit 1); exit 1; }; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6 -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4768,10 +6470,9 @@ $ac_includes_default int main () { -if ((long long *) 0) - return 0; -if (sizeof (long long)) - return 0; +static int test_array [1 - 2 * !(((long) (sizeof (long long))) <= $ac_mid)]; +test_array [0] = 0 + ; return 0; } @@ -4798,89 +6499,103 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_long_long=yes + ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long_long=no +ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6 -if test $ac_cv_type_long_long = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_LONG_LONG 1 -_ACEOF - -echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +done +case $ac_lo in +?*) ac_cv_sizeof_long_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include "confdefs.h" -#include - - +$ac_includes_default +long longval () { return (long) (sizeof (long long)); } +unsigned long ulongval () { return (long) (sizeof (long long)); } +#include +#include int main () { -switch (0) case 0: case (sizeof (long long) == $ac_size):; + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + ; return 0; } _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 +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_sizeof_long_long=$ac_size + ac_cv_sizeof_long_long=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - if test x$ac_cv_sizeof_long_long != x ; then break; fi -done - +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long_long=0 fi - -if test x$ac_cv_sizeof_long_long = x ; then - { { echo "$as_me:$LINENO: error: cannot determine a size for long long" >&5 -echo "$as_me: error: cannot determine a size for long long" >&2;} - { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6 - cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF @@ -4894,8 +6609,7 @@ echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. + # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4904,13 +6618,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + int main () { - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif + ; return 0; } @@ -4946,13 +6661,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + int main () { - #if BYTE_ORDER != BIG_ENDIAN not big endian #endif + ; return 0; } @@ -4991,11 +6707,69 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_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 + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - echo $ac_n "cross-compiling... " 2>&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5003,7 +6777,9 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main () { +int +main () +{ /* Are we little or big endian? From Harbison&Steele. */ union { @@ -5037,67 +6813,26 @@ fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -if test $ac_cv_c_bigendian = unknown; then -echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 -echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 - -cat >conftest.c <&6 - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&6 - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&6 - fi - fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -fi -if test $ac_cv_c_bigendian = yes; then +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HOST_WORDS_BIG_ENDIAN 1 -_ACEOF - - BYTEORDER=4321 -else - BYTEORDER=1234 -fi - -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF - -if test $ac_cv_c_bigendian = unknown; then - { { echo "$as_me:$LINENO: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&5 -echo "$as_me: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&2;} - { (exit 1); exit 1; }; } -fi + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac diff --git a/fastjar/configure.ac b/fastjar/configure.ac index bdb556d40cb..92bbf54de4a 100644 --- a/fastjar/configure.ac +++ b/fastjar/configure.ac @@ -37,14 +37,14 @@ AC_STRUCT_TM gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG dnl Check for type-widths -AC_COMPILE_CHECK_SIZEOF(char) -AC_COMPILE_CHECK_SIZEOF(short) -AC_COMPILE_CHECK_SIZEOF(int) -AC_COMPILE_CHECK_SIZEOF(long) -AC_CHECK_TYPES([long long],[AC_COMPILE_CHECK_SIZEOF(long long)]) +AC_CHECK_SIZEOF(char) +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_TYPES([long long],[AC_CHECK_SIZEOF(long long)]) dnl Check byte order -AC_C_BIGENDIAN_CROSS +AC_C_BIGENDIAN AC_ARG_WITH(system-zlib, [ --with-system-zlib use installed libz]) diff --git a/fastjar/jartool.c b/fastjar/jartool.c index 9431bb5e0a2..09f5dbcb787 100644 --- a/fastjar/jartool.c +++ b/fastjar/jartool.c @@ -1,6 +1,6 @@ /* jartool.c - main functions for fastjar utility - Copyright (C) 2002, 2004 Free Software Foundation + Copyright (C) 2002, 2004, 2005 Free Software Foundation Copyright (C) 1999, 2000, 2001 Bryan Burns This program is free software; you can redistribute it and/or @@ -335,7 +335,8 @@ static const struct option options[] = { NULL, no_argument, NULL, 0 } }; -int main(int argc, char **argv){ +int main(int argc, char **argv) +{ char *mfile = NULL; @@ -602,9 +603,7 @@ static int args_current_g; static char **args_g; static void -init_args(args, current) - char **args; - int current; +init_args(char **args, int current) { if(!read_names_from_stdin) { @@ -614,7 +613,7 @@ init_args(args, current) } static char * -get_next_arg () +get_next_arg (void) { static int reached_end = 0; @@ -674,7 +673,8 @@ get_next_arg () } } -void init_headers(){ +void init_headers(void) +{ /* packing file header */ /* magic number */ file_header[0] = 0x50; @@ -725,7 +725,8 @@ void init_headers(){ } -void add_entry(struct zipentry *ze){ +void add_entry(struct zipentry *ze) +{ if(ziplist == NULL){ ziplist = ze; @@ -906,7 +907,8 @@ int read_entries (int fd) return 0; } -int make_manifest(int jfd, const char *mf_name, int updating){ +int make_manifest(int jfd, const char *mf_name, int updating) +{ time_t current_time; int nlen; /* length of file name */ int mod_time; /* file modification time */ @@ -2212,7 +2214,7 @@ void usage(const char *filename){ exit (1); } -void version () +void version (void) { printf("jar (%s) %s\n\n", PACKAGE, VERSION); printf("Copyright 1999, 2000, 2001 Bryan Burns\n"); @@ -2264,8 +2266,7 @@ Example 2: use an existing manifest file 'mymanifest' and archive all the\n\ } static char * -jt_strdup(s) - char *s; +jt_strdup(char *s) { char *result = (char*)malloc(strlen(s) + 1); if (result == (char*)0) diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index cde72ca6e85..de13766fa73 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,74 @@ +2005-05-19 Eric Botcazou + Joseph S. Myers + + PR target/19933 + PR target/21315 + * inclhack.def: New fixes solaris_math_[1-9]. + * fixincl.x: Regenerate. + * tests/base/iso/math_c99.h: New. + +2005-05-19 Kelley Cook + + * aclocal.m4: Remove superfluous reference to accross.m4. + +2005-05-15 Gabriel Dos Reis + + * fixlib.c (load_file_data): Use XRESIZVEC in lieu of xrealloc. + * server.c (load_data): Likewise. + (run_shell): Use XCNEW (char) in lieu of xcalloc (1, 1). + * fixincl.c: #include + (run_compiles): Use XCNEWVEC instead of xcalloc. + (fix_with_system, start_fixer): Use XNEWVEC instead of xmalloc. + * fixfixes.c (FIX_PROC_HEAD, main): Likewise. + +2005-05-10 Joseph S. Myers + + * inclhack.def (stdio_stdarg_h, stdio_va_list): Bypass on + *-*-solaris2.1[0-9]*, not just *-*-solaris2.1[0-9]. + * fixincl.x: Regenerate. + +2005-05-06 Bruce Korb + Joseph S. Myers + + * fixinc/inclhack.def: Correct backslashes + * fixinc/fixincl.x: regen + +2005-04-19 Kaveh R. Ghazi + + * system.h (fopen, fdopen, freopen): Define these to the unlocked + libiberty functions. + +2005-04-11 Kaveh R. Ghazi + + * configure.ac (fixincludes_UNLOCKED_FUNCS): New. + (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS. + * system.h (putchar, getc, getchar, clearerr, feof, fileno, + fflush, fgetc, fgets, ferror, fread): Redefine to the associated + _unlocked function. + (fwrite_unlocked): Fix prototype. + + * configure, config.h.in: Regenerate. + +2005-03-21 Zack Weinberg + + * Makefile.in: Set gcc_version directly, not via substitution. + (libsubdir): Use $(gcc_version), not $(version). + (mkheaders.almost): New rule. + (mkheaders): Generate from mkheaders.almost. + (clean): Also delete mkheaders.almost. + * aclocal.m4: Do not include ../config/gcc-version.m4. + * configure.ac: Do not invoke TL_AC_GCC_VERSION. Generate + mkheaders.almost from mkheaders.in. + * configure: Regenerate. + +2005-03-21 Richard Guenther + + PR target/20166 + * inclhack.def: Add fix for array of incomplete structures + in function prototype in pthread.h. + * fixincl.x: Regenerate. + * tests/base/pthread.h: Adjust. + 2005-03-15 Joseph S. Myers * inclhack.def (hpux_htonl): New fix. @@ -115,7 +186,7 @@ * inclhack.def (stdio_va_list): Break out clients from here... (stdio_va_list_clients): ...to here. Also, don't fix if stdarg.h is - included or ifdef va_start. + included or ifdef va_start. * fixincl.x: Regenerate. 2004-10-28 Mike Stump diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in index 1383ef61b61..54382cc8021 100644 --- a/fixincludes/Makefile.in +++ b/fixincludes/Makefile.in @@ -49,10 +49,10 @@ target = @target@ target_noncanonical:=@target_noncanonical@ # The version of GCC in this tree -gcc_version=@gcc_version@ +gcc_version := $(shell cat $(srcdir)/../gcc/BASE-VER) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version) +libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version) # Directory in which the compiler finds executables libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version) # Where our executable files go @@ -130,7 +130,7 @@ mostlyclean : rm -f *.o *-stamp $(AF) $(FI) *~ fixinc.sh clean: mostlyclean - rm -f mkheaders + rm -f mkheaders mkheaders.almost distclean: clean rm -f Makefile config.h config.log config.status stamp-h @@ -143,8 +143,13 @@ distclean : clean Makefile: $(srcdir)/Makefile.in config.status $(SHELL) ./config.status Makefile -mkheaders: $(srcdir)/mkheaders.in config.status - CONFIG_FILES=mkheaders CONFIG_HEADERS= ./config.status +mkheaders.almost: $(srcdir)/mkheaders.in config.status + CONFIG_FILES=mkheaders.almost:mkheaders.in \ + CONFIG_HEADERS= ./config.status + +mkheaders: mkheaders.almost $(srcdir)/../gcc/BASE-VER + sed -e 's/@gcc_version@/$(gcc_version)/' < $< > $@T + mv -f $@T $@ config.h: stamp-h stamp-h: $(srcdir)/config.h.in config.status diff --git a/fixincludes/aclocal.m4 b/fixincludes/aclocal.m4 index bf22e31974d..490df22641d 100644 --- a/fixincludes/aclocal.m4 +++ b/fixincludes/aclocal.m4 @@ -1,6 +1,4 @@ sinclude(../config/acx.m4) -sinclude(../config/accross.m4) -sinclude(../config/gcc-version.m4) sinclude(../config/gettext.m4) sinclude(../config/progtest.m4) diff --git a/fixincludes/config.h.in b/fixincludes/config.h.in index 47d5173c4a2..a067b8dbdfa 100644 --- a/fixincludes/config.h.in +++ b/fixincludes/config.h.in @@ -3,14 +3,45 @@ /* Defined to the executable file extension on the host system */ #undef EXE_EXT +/* Define to 1 if you have the `clearerr_unlocked' function. */ +#undef HAVE_CLEARERR_UNLOCKED + /* Define to 1 if you have the declaration of `abort', and to 0 if you don't. */ #undef HAVE_DECL_ABORT +/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_CLEARERR_UNLOCKED + /* Define to 1 if you have the declaration of `errno', and to 0 if you don't. */ #undef HAVE_DECL_ERRNO +/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_FEOF_UNLOCKED + +/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FERROR_UNLOCKED + +/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FFLUSH_UNLOCKED + +/* Define to 1 if you have the declaration of `fgetc_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETC_UNLOCKED + +/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FGETS_UNLOCKED + +/* Define to 1 if you have the declaration of `fileno_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FILENO_UNLOCKED + /* Define to 1 if you have the declaration of `fprintf_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FPRINTF_UNLOCKED @@ -23,10 +54,26 @@ you don't. */ #undef HAVE_DECL_FPUTS_UNLOCKED +/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_FREAD_UNLOCKED + /* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FWRITE_UNLOCKED +/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_GETCHAR_UNLOCKED + +/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you + don't. */ +#undef HAVE_DECL_GETC_UNLOCKED + +/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if + you don't. */ +#undef HAVE_DECL_PUTCHAR_UNLOCKED + /* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_PUTC_UNLOCKED @@ -34,6 +81,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H +/* Define to 1 if you have the `feof_unlocked' function. */ +#undef HAVE_FEOF_UNLOCKED + +/* Define to 1 if you have the `ferror_unlocked' function. */ +#undef HAVE_FERROR_UNLOCKED + +/* Define to 1 if you have the `fflush_unlocked' function. */ +#undef HAVE_FFLUSH_UNLOCKED + +/* Define to 1 if you have the `fgetc_unlocked' function. */ +#undef HAVE_FGETC_UNLOCKED + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#undef HAVE_FGETS_UNLOCKED + +/* Define to 1 if you have the `fileno_unlocked' function. */ +#undef HAVE_FILENO_UNLOCKED + /* Define to 1 if you have the `fprintf_unlocked' function. */ #undef HAVE_FPRINTF_UNLOCKED @@ -43,9 +108,18 @@ /* Define to 1 if you have the `fputs_unlocked' function. */ #undef HAVE_FPUTS_UNLOCKED +/* Define to 1 if you have the `fread_unlocked' function. */ +#undef HAVE_FREAD_UNLOCKED + /* Define to 1 if you have the `fwrite_unlocked' function. */ #undef HAVE_FWRITE_UNLOCKED +/* Define to 1 if you have the `getchar_unlocked' function. */ +#undef HAVE_GETCHAR_UNLOCKED + +/* Define to 1 if you have the `getc_unlocked' function. */ +#undef HAVE_GETC_UNLOCKED + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -61,6 +135,9 @@ /* Define if read-only mmap of a plain file works. */ #undef HAVE_MMAP_FILE +/* Define to 1 if you have the `putchar_unlocked' function. */ +#undef HAVE_PUTCHAR_UNLOCKED + /* Define to 1 if you have the `putc_unlocked' function. */ #undef HAVE_PUTC_UNLOCKED diff --git a/fixincludes/configure b/fixincludes/configure index 64e7963a994..c4b2494f43b 100755 --- a/fixincludes/configure +++ b/fixincludes/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT target_noncanonical TARGET gcc_version_trigger gcc_version_full gcc_version CPP EGREP MAINT LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT target_noncanonical TARGET CPP EGREP MAINT LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -2425,23 +2425,6 @@ _ACEOF fi - -if test "${with_gcc_version_trigger+set}" = set; then - gcc_version_trigger=$with_gcc_version_trigger -else - gcc_version_trigger=$srcdir/../gcc/version.c -fi -if test -f "${gcc_version_trigger}"; then - gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'` -else - gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'` -fi -gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` - - - - - case $host in vax-dec-bsd* ) @@ -3115,8 +3098,19 @@ done -for ac_func in putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked + + + + + + + + + + + + +for ac_func in clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -3357,9 +3351,9 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then +echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 +echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3372,8 +3366,8 @@ $ac_includes_default int main () { -#ifndef putc_unlocked - char *p = (char *) putc_unlocked; +#ifndef clearerr_unlocked + char *p = (char *) clearerr_unlocked; #endif ; @@ -3402,34 +3396,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_putc_unlocked=yes + ac_cv_have_decl_clearerr_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_putc_unlocked=no +ac_cv_have_decl_clearerr_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 -if test $ac_cv_have_decl_putc_unlocked = yes; then +echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6 +if test $ac_cv_have_decl_clearerr_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 +#define HAVE_DECL_CLEARERR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 0 +#define HAVE_DECL_CLEARERR_UNLOCKED 0 _ACEOF fi -echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then +echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 +echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3442,8 +3436,8 @@ $ac_includes_default int main () { -#ifndef fputc_unlocked - char *p = (char *) fputc_unlocked; +#ifndef feof_unlocked + char *p = (char *) feof_unlocked; #endif ; @@ -3472,34 +3466,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_fputc_unlocked=yes + ac_cv_have_decl_feof_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fputc_unlocked=no +ac_cv_have_decl_feof_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 -if test $ac_cv_have_decl_fputc_unlocked = yes; then +echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 +if test $ac_cv_have_decl_feof_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 1 +#define HAVE_DECL_FEOF_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED 0 +#define HAVE_DECL_FEOF_UNLOCKED 0 _ACEOF fi -echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 -echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then +echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 +echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3512,8 +3506,8 @@ $ac_includes_default int main () { -#ifndef fputs_unlocked - char *p = (char *) fputs_unlocked; +#ifndef ferror_unlocked + char *p = (char *) ferror_unlocked; #endif ; @@ -3542,34 +3536,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_fputs_unlocked=yes + ac_cv_have_decl_ferror_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fputs_unlocked=no +ac_cv_have_decl_ferror_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 -if test $ac_cv_have_decl_fputs_unlocked = yes; then +echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6 +if test $ac_cv_have_decl_ferror_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 1 +#define HAVE_DECL_FERROR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED 0 +#define HAVE_DECL_FERROR_UNLOCKED 0 _ACEOF fi -echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 -echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then +echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 +echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3582,8 +3576,8 @@ $ac_includes_default int main () { -#ifndef fwrite_unlocked - char *p = (char *) fwrite_unlocked; +#ifndef fflush_unlocked + char *p = (char *) fflush_unlocked; #endif ; @@ -3612,27 +3606,237 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_fwrite_unlocked=yes + ac_cv_have_decl_fflush_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fwrite_unlocked=no +ac_cv_have_decl_fflush_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 -if test $ac_cv_have_decl_fwrite_unlocked = yes; then +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6 +if test $ac_cv_have_decl_fflush_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 1 +#define HAVE_DECL_FFLUSH_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED 0 +#define HAVE_DECL_FFLUSH_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fgetc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgetc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fgetc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fgetc_unlocked + char *p = (char *) fgetc_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fgetc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fgetc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgetc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgetc_unlocked" >&6 +if test $ac_cv_have_decl_fgetc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fgets_unlocked + char *p = (char *) fgets_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fgets_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fgets_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 +if test $ac_cv_have_decl_fgets_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fileno_unlocked is declared" >&5 +echo $ECHO_N "checking whether fileno_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fileno_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fileno_unlocked + char *p = (char *) fileno_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fileno_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fileno_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fileno_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fileno_unlocked" >&6 +if test $ac_cv_have_decl_fileno_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FILENO_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FILENO_UNLOCKED 0 _ACEOF @@ -3707,6 +3911,566 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether fputc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fputc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fputc_unlocked + char *p = (char *) fputc_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fputc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fputc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6 +if test $ac_cv_have_decl_fputc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fputs_unlocked is declared" >&5 +echo $ECHO_N "checking whether fputs_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fputs_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fputs_unlocked + char *p = (char *) fputs_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fputs_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fputs_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6 +if test $ac_cv_have_decl_fputs_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 +echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fread_unlocked + char *p = (char *) fread_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fread_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fread_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6 +if test $ac_cv_have_decl_fread_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 +echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef fwrite_unlocked + char *p = (char *) fwrite_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_fwrite_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fwrite_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6 +if test $ac_cv_have_decl_fwrite_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef getchar_unlocked + char *p = (char *) getchar_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_getchar_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getchar_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6 +if test $ac_cv_have_decl_getchar_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef getc_unlocked + char *p = (char *) getc_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_getc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 +if test $ac_cv_have_decl_getc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef putchar_unlocked + char *p = (char *) putchar_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_putchar_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_putchar_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6 +if test $ac_cv_have_decl_putchar_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 +echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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 +int +main () +{ +#ifndef putc_unlocked + char *p = (char *) putc_unlocked; +#endif + + ; + return 0; +} +_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_cv_have_decl_putc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_putc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 +if test $ac_cv_have_decl_putc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 0 +_ACEOF + + +fi @@ -4241,7 +5005,7 @@ fi ac_config_headers="$ac_config_headers config.h" - ac_config_files="$ac_config_files Makefile mkheaders" + ac_config_files="$ac_config_files Makefile mkheaders.almost:mkheaders.in" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -4768,7 +5532,7 @@ do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "mkheaders" ) CONFIG_FILES="$CONFIG_FILES mkheaders" ;; + "mkheaders.almost" ) CONFIG_FILES="$CONFIG_FILES mkheaders.almost:mkheaders.in" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -4875,9 +5639,6 @@ s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@target_noncanonical@,$target_noncanonical,;t t s,@TARGET@,$TARGET,;t t -s,@gcc_version_trigger@,$gcc_version_trigger,;t t -s,@gcc_version_full@,$gcc_version_full,;t t -s,@gcc_version@,$gcc_version,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@MAINT@,$MAINT,;t t diff --git a/fixincludes/configure.ac b/fixincludes/configure.ac index a58b1051d16..46296049f31 100644 --- a/fixincludes/configure.ac +++ b/fixincludes/configure.ac @@ -52,8 +52,6 @@ if test $TARGET = twoprocess; then [Define if testing and fixing are done by separate process]) fi -TL_AC_GCC_VERSION([$srcdir/..]) - case $host in vax-dec-bsd* ) AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit]) @@ -68,10 +66,13 @@ AC_DEFINE_UNQUOTED([EXE_EXT], "$ac_exeext", AC_HEADER_STDC AC_CHECK_HEADERS([stddef.h stdlib.h strings.h unistd.h fcntl.h sys/file.h \ sys/stat.h]) -AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked) -AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked, - fputs_unlocked, fwrite_unlocked, fprintf_unlocked]) +define(fixincludes_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl + ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl + fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl + fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl + putchar_unlocked putc_unlocked) +AC_CHECK_FUNCS(fixincludes_UNLOCKED_FUNCS) +AC_CHECK_DECLS(m4_split(m4_normalize(abort errno fixincludes_UNLOCKED_FUNCS))) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST @@ -94,5 +95,5 @@ fi AC_SUBST(MAINT) AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h]) -AC_CONFIG_FILES(Makefile mkheaders) +AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in) AC_OUTPUT diff --git a/fixincludes/fixfixes.c b/fixincludes/fixfixes.c index 732092061a0..c883253123d 100644 --- a/fixincludes/fixfixes.c +++ b/fixincludes/fixfixes.c @@ -605,7 +605,7 @@ FIX_PROC_HEAD( wrap_fix ) * *both* the fix name and the file name. */ size_t ln = strlen( filname ) + strlen( p_fixd->fix_name ) + 14; - char* pz = xmalloc( ln ); + char* pz = XNEWVEC (char, ln); pz_name = pz; sprintf( pz, "FIXINC_WRAP_%s-%s", filname, p_fixd->fix_name ); @@ -770,7 +770,7 @@ main( int argc, char** argv ) return EXIT_FAILURE; } - pz_tmptmp = xmalloc (strlen (argv[4]) + 5); + pz_tmptmp = XNEWVEC (char, strlen (argv[4]) + 5); strcpy( pz_tmptmp, argv[4] ); /* Don't lose because "12345678" and "12345678X" map to the same diff --git a/fixincludes/fixincl.c b/fixincludes/fixincl.c index 8bd43dcb748..5f07afa408f 100644 --- a/fixincludes/fixincl.c +++ b/fixincludes/fixincl.c @@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */ #include "fixlib.h" #include +#include #if defined( HAVE_MMAP_FILE ) #include @@ -451,7 +452,7 @@ run_compiles (void) { tFixDesc *p_fixd = fixDescList; int fix_ct = FIX_COUNT; - regex_t *p_re = xcalloc (REGEX_COUNT, sizeof (regex_t)); + regex_t *p_re = XCNEWVEC (regex_t, REGEX_COUNT); /* Make sure compile_re does not stumble across invalid data */ @@ -866,7 +867,7 @@ fix_with_system (tFixDesc* p_fixd, + strlen (pz_temp_file); /* Allocate something sure to be big enough for our purposes */ - pz_cmd = xmalloc (argsize); + pz_cmd = XNEWVEC (char, argsize); strcpy (pz_cmd, pz_orig_dir); pz_scan = pz_cmd + strlen (pz_orig_dir); @@ -933,7 +934,7 @@ fix_with_system (tFixDesc* p_fixd, } /* Estimated buffer size we will need. */ - pz_scan = pz_cmd = xmalloc (argsize); + pz_scan = pz_cmd = XNEWVEC (char, argsize); /* How much of it do we allot to the program name and its arguments. */ parg_size = argsize - parg_size; @@ -1020,7 +1021,7 @@ start_fixer (int read_fd, tFixDesc* p_fixd, char* pz_fix_file) else { tSCC z_cmd_fmt[] = "file='%s'\n%s"; - pz_cmd = xmalloc (strlen (p_fixd->patch_args[2]) + pz_cmd = XNEWVEC (char, strlen (p_fixd->patch_args[2]) + sizeof (z_cmd_fmt) + strlen (pz_fix_file)); sprintf (pz_cmd, z_cmd_fmt, pz_fix_file, p_fixd->patch_args[2]); pz_cmd_save = p_fixd->patch_args[2]; diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 4c790e7059e..9b39019fe6f 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 Monday March 14, 2005 at 09:43:34 PM UTC + * It has been AutoGen-ed Thursday May 19, 2005 at 08:56:10 AM CEST * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Mar 14 21:43:34 UTC 2005 +/* DO NOT CVS-MERGE THIS FILE, EITHER Thu May 19 08:56:10 CEST 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 178 fixup descriptions. + * This file contains 188 fixup descriptions. * * See README for more information. * @@ -124,13 +124,13 @@ static const char* apzAab_Fd_Zero_Gnu_Types_HPatch[] = { #include_next \n\n\ #if defined(__FD_ZERO) && !defined(__GLIBC__)\n\ #undef __FD_ZERO\n\ -# define __FD_ZERO(fdsetp) \\\\\n\ - do { \\\\\n\ - int __d0, __d1; \\\\\n\ -__asm__ __volatile__(\"cld ; rep ; stosl\" \\\\\n\ - \t: \"=&c\" (__d0), \"=&D\" (__d1) \\\\\n\ - \t: \"a\" (0), \"0\" (__FDSET_LONGS), \\\\\n\ - \"1\" ((__fd_set *) (fdsetp)) :\"memory\"); \\\\\n\ +# define __FD_ZERO(fdsetp) \\\n\ + do { \\\n\ + int __d0, __d1; \\\n\ + __asm__ __volatile__(\"cld ; rep ; stosl\" \\\n\ + : \"=&c\" (__d0), \"=&D\" (__d1) \\\n\ + : \"a\" (0), \"0\" (__FDSET_LONGS), \\\n\ + \"1\" ((__fd_set *) (fdsetp)) :\"memory\"); \\\n\ } while (0)\n\ #endif\n\n\ #define _TYPES_H_WRAPPER\n\ @@ -4183,6 +4183,42 @@ static const char* apzPthread_Page_SizePatch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Pthread_Incomplete_Struct_Argument fix + */ +tSCC zPthread_Incomplete_Struct_ArgumentName[] = + "pthread_incomplete_struct_argument"; + +/* + * File name selection pattern + */ +tSCC zPthread_Incomplete_Struct_ArgumentList[] = + "|pthread.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzPthread_Incomplete_Struct_ArgumentMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zPthread_Incomplete_Struct_ArgumentSelect0[] = + "struct __jmp_buf_tag"; + +#define PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_TEST_CT 1 +static tTestDesc aPthread_Incomplete_Struct_ArgumentTests[] = { + { TT_EGREP, zPthread_Incomplete_Struct_ArgumentSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Pthread_Incomplete_Struct_Argument + */ +static const char* apzPthread_Incomplete_Struct_ArgumentPatch[] = { + "format", + "%1 *%2%3", + "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) (__env)\\[1\\](.*)$", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Read_Ret_Type fix */ tSCC zRead_Ret_TypeName[] = @@ -4571,6 +4607,419 @@ static const char* apzSco_UtimePatch[] = { /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Math_1 fix + */ +tSCC zSolaris_Math_1Name[] = + "solaris_math_1"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_1List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_1Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_1Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_1Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_1_TEST_CT 2 +static tTestDesc aSolaris_Math_1Tests[] = { + { TT_NEGREP, zSolaris_Math_1Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_1Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_1 + */ +static const char* apzSolaris_Math_1Patch[] = { + "format", + "#define\tHUGE_VA%1\t(__builtin_huge_va%2())", + "^#define[ \t]+HUGE_VA([LF]+)[ \t]+__builtin_huge_va([lf]+)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_2 fix + */ +tSCC zSolaris_Math_2Name[] = + "solaris_math_2"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_2List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_2Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_2Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_2Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_2_TEST_CT 2 +static tTestDesc aSolaris_Math_2Tests[] = { + { TT_NEGREP, zSolaris_Math_2Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_2Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_2 + */ +static const char* apzSolaris_Math_2Patch[] = { + "format", + "#define\tINFINITY\t(__builtin_inff())", + "^#define[ \t]+INFINITY[ \t]+__builtin_infinity", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_3 fix + */ +tSCC zSolaris_Math_3Name[] = + "solaris_math_3"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_3List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_3Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_3Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_3Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_3_TEST_CT 2 +static tTestDesc aSolaris_Math_3Tests[] = { + { TT_NEGREP, zSolaris_Math_3Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_3Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_3 + */ +static const char* apzSolaris_Math_3Patch[] = { + "format", + "#define\tNAN\t\t(__builtin_nanf(\"\"))", + "^#define[ \t]+NAN[ \t]+__builtin_nan", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_4 fix + */ +tSCC zSolaris_Math_4Name[] = + "solaris_math_4"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_4List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_4Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_4Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_4Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_4_TEST_CT 2 +static tTestDesc aSolaris_Math_4Tests[] = { + { TT_NEGREP, zSolaris_Math_4Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_4Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_4 + */ +static const char* apzSolaris_Math_4Patch[] = { + "format", + "#define\tfpclassify(x) \\\n\ + __extension__ ({ __typeof(x) __x_fp = (x); \\\n\ +\t\t isnan(__x_fp) \\\n\ +\t\t ? FP_NAN \\\n\ +\t\t : isinf(__x_fp) \\\n\ +\t\t ? FP_INFINITE \\\n\ +\t\t : isnormal(__x_fp) \\\n\ +\t\t\t ? FP_NORMAL \\\n\ +\t\t\t : __x_fp == 0.0 \\\n\ +\t\t\t ? FP_ZERO \\\n\ +\t\t\t : FP_SUBNORMAL; })", + "^#define[ \t]+fpclassify\\(x\\)[ \t]+__builtin_fpclassify\\(x\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_5 fix + */ +tSCC zSolaris_Math_5Name[] = + "solaris_math_5"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_5List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_5Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_5Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_5Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_5_TEST_CT 2 +static tTestDesc aSolaris_Math_5Tests[] = { + { TT_NEGREP, zSolaris_Math_5Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_5Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_5 + */ +static const char* apzSolaris_Math_5Patch[] = { + "format", + "#define\tisfinite(x) \\\n\ + __extension__ ({ __typeof (x) __x_f = (x); \\\n\ +\t\t __builtin_expect(!isnan(__x_f - __x_f), 1); })", + "^#define[ \t]+isfinite\\(x\\)[ \t]+__builtin_isfinite\\(x\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_6 fix + */ +tSCC zSolaris_Math_6Name[] = + "solaris_math_6"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_6List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_6Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_6Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_6Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_6_TEST_CT 2 +static tTestDesc aSolaris_Math_6Tests[] = { + { TT_NEGREP, zSolaris_Math_6Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_6Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_6 + */ +static const char* apzSolaris_Math_6Patch[] = { + "format", + "#define\tisinf(x) \\\n\ + __extension__ ({ __typeof (x) __x_i = (x); \\\n\ +\t\t __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })", + "^#define[ \t]+isinf\\(x\\)[ \t]+__builtin_isinf\\(x\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_7 fix + */ +tSCC zSolaris_Math_7Name[] = + "solaris_math_7"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_7List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_7Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_7Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_7Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_7_TEST_CT 2 +static tTestDesc aSolaris_Math_7Tests[] = { + { TT_NEGREP, zSolaris_Math_7Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_7Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_7 + */ +static const char* apzSolaris_Math_7Patch[] = { + "format", + "#define\tisnormal(x) \\\n\ + __extension__ ({ __typeof(x) __x_n = (x); \\\n\ +\t\t if (__x_n < 0.0) __x_n = -__x_n; \\\n\ +\t\t __builtin_expect(isfinite(__x_n) \\\n\ +\t\t\t\t && (sizeof(__x_n) == sizeof(float) \\\n\ +\t\t\t\t\t ? __x_n >= __FLT_MIN__ \\\n\ +\t\t\t\t\t : sizeof(__x_n) == sizeof(long double) \\\n\ +\t\t\t\t\t ? __x_n >= __LDBL_MIN__ \\\n\ +\t\t\t\t\t : __x_n >= __DBL_MIN__), 1); })", + "^#define[ \t]+isnormal\\(x\\)[ \t]+__builtin_isnormal\\(x\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_8 fix + */ +tSCC zSolaris_Math_8Name[] = + "solaris_math_8"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_8List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_8Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_8Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_8Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_8_TEST_CT 2 +static tTestDesc aSolaris_Math_8Tests[] = { + { TT_NEGREP, zSolaris_Math_8Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_8Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_8 + */ +static const char* apzSolaris_Math_8Patch[] = { + "format", + "#define\tsignbit(x)\t(sizeof(x) == sizeof(float) \\\n\ +\t\t\t ? __builtin_signbitf(x) \\\n\ +\t\t\t : sizeof(x) == sizeof(long double) \\\n\ +\t\t\t ? __builtin_signbitl(x) \\\n\ +\t\t\t : __builtin_signbit(x))", + "^#define[ \t]+signbit\\(x\\)[ \t]+__builtin_signbit\\(x\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Solaris_Math_9 fix + */ +tSCC zSolaris_Math_9Name[] = + "solaris_math_9"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_9List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_9Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_9Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zSolaris_Math_9Bypass0[] = + "__GNUC__"; + +#define SOLARIS_MATH_9_TEST_CT 2 +static tTestDesc aSolaris_Math_9Tests[] = { + { TT_NEGREP, zSolaris_Math_9Bypass0, (regex_t*)NULL }, + { TT_EGREP, zSolaris_Math_9Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_9 + */ +static const char* apzSolaris_Math_9Patch[] = { + "format", + "#define\t%1(x, y)%2__builtin_%1(x, y)", + "^#define[ \t]+([a-z]+)\\(x, y\\)([ \t]+)\\(\\(x\\) __builtin_[a-z]+\\(y\\)\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Mutex_Init_1 fix */ tSCC zSolaris_Mutex_Init_1Name[] = @@ -4862,7 +5311,7 @@ tSCC zStdio_Stdarg_HList[] = * Machine/OS name selection pattern */ tSCC* apzStdio_Stdarg_HMachs[] = { - "*-*-solaris2.1[0-9]", + "*-*-solaris2.1[0-9]*", (const char*)NULL }; /* @@ -4900,7 +5349,7 @@ tSCC zStdio_Va_ListList[] = * Machine/OS name selection pattern */ tSCC* apzStdio_Va_ListMachs[] = { - "*-*-solaris2.1[0-9]", + "*-*-solaris2.1[0-9]*", (const char*)NULL }; /* @@ -7125,9 +7574,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 208 +#define REGEX_COUNT 227 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 178 +#define FIX_COUNT 188 /* * Enumerate the fixes @@ -7236,6 +7685,7 @@ typedef enum { OSF_NAMESPACE_A_FIXIDX, OSF_NAMESPACE_C_FIXIDX, PTHREAD_PAGE_SIZE_FIXIDX, + PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_FIXIDX, READ_RET_TYPE_FIXIDX, RPC_XDR_LVALUE_CAST_A_FIXIDX, RPC_XDR_LVALUE_CAST_B_FIXIDX, @@ -7246,6 +7696,15 @@ typedef enum { SCO_REGSET_FIXIDX, SCO_STATIC_FUNC_FIXIDX, SCO_UTIME_FIXIDX, + SOLARIS_MATH_1_FIXIDX, + SOLARIS_MATH_2_FIXIDX, + SOLARIS_MATH_3_FIXIDX, + SOLARIS_MATH_4_FIXIDX, + SOLARIS_MATH_5_FIXIDX, + SOLARIS_MATH_6_FIXIDX, + SOLARIS_MATH_7_FIXIDX, + SOLARIS_MATH_8_FIXIDX, + SOLARIS_MATH_9_FIXIDX, SOLARIS_MUTEX_INIT_1_FIXIDX, SOLARIS_MUTEX_INIT_2_FIXIDX, SOLARIS_SOCKET_FIXIDX, @@ -7829,6 +8288,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { PTHREAD_PAGE_SIZE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aPthread_Page_SizeTests, apzPthread_Page_SizePatch, 0 }, + { zPthread_Incomplete_Struct_ArgumentName, zPthread_Incomplete_Struct_ArgumentList, + apzPthread_Incomplete_Struct_ArgumentMachs, + PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aPthread_Incomplete_Struct_ArgumentTests, apzPthread_Incomplete_Struct_ArgumentPatch, 0 }, + { zRead_Ret_TypeName, zRead_Ret_TypeList, apzRead_Ret_TypeMachs, READ_RET_TYPE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, @@ -7879,6 +8343,51 @@ tFixDesc fixDescList[ FIX_COUNT ] = { SCO_UTIME_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSco_UtimeTests, apzSco_UtimePatch, 0 }, + { zSolaris_Math_1Name, zSolaris_Math_1List, + apzSolaris_Math_1Machs, + SOLARIS_MATH_1_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_1Tests, apzSolaris_Math_1Patch, 0 }, + + { zSolaris_Math_2Name, zSolaris_Math_2List, + apzSolaris_Math_2Machs, + SOLARIS_MATH_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_2Tests, apzSolaris_Math_2Patch, 0 }, + + { zSolaris_Math_3Name, zSolaris_Math_3List, + apzSolaris_Math_3Machs, + SOLARIS_MATH_3_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_3Tests, apzSolaris_Math_3Patch, 0 }, + + { zSolaris_Math_4Name, zSolaris_Math_4List, + apzSolaris_Math_4Machs, + SOLARIS_MATH_4_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_4Tests, apzSolaris_Math_4Patch, 0 }, + + { zSolaris_Math_5Name, zSolaris_Math_5List, + apzSolaris_Math_5Machs, + SOLARIS_MATH_5_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_5Tests, apzSolaris_Math_5Patch, 0 }, + + { zSolaris_Math_6Name, zSolaris_Math_6List, + apzSolaris_Math_6Machs, + SOLARIS_MATH_6_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_6Tests, apzSolaris_Math_6Patch, 0 }, + + { zSolaris_Math_7Name, zSolaris_Math_7List, + apzSolaris_Math_7Machs, + SOLARIS_MATH_7_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_7Tests, apzSolaris_Math_7Patch, 0 }, + + { zSolaris_Math_8Name, zSolaris_Math_8List, + apzSolaris_Math_8Machs, + SOLARIS_MATH_8_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_8Tests, apzSolaris_Math_8Patch, 0 }, + + { zSolaris_Math_9Name, zSolaris_Math_9List, + apzSolaris_Math_9Machs, + SOLARIS_MATH_9_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_9Tests, apzSolaris_Math_9Patch, 0 }, + { zSolaris_Mutex_Init_1Name, zSolaris_Mutex_Init_1List, apzSolaris_Mutex_Init_1Machs, SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY, diff --git a/fixincludes/fixlib.c b/fixincludes/fixlib.c index e56328b1621..7ab45c51497 100644 --- a/fixincludes/fixlib.c +++ b/fixincludes/fixlib.c @@ -48,7 +48,7 @@ load_file_data (FILE* fp) if (space_left < 1024) { space_left += 4096; - pz_data = xrealloc (pz_data, space_left + space_used + 1 ); + pz_data = XRESIZEVEC (char, pz_data, space_left + space_used + 1 ); } size_read = fread (pz_data + space_used, 1, space_left, fp); @@ -72,7 +72,7 @@ load_file_data (FILE* fp) space_used += size_read; } while (! feof (fp)); - pz_data = xrealloc (pz_data, space_used+1 ); + pz_data = XRESIZEVEC (char, pz_data, space_used+1 ); pz_data[ space_used ] = NUL; return pz_data; diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 7bd48dba1ba..447997b14fb 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -82,13 +82,13 @@ fix = { #if defined(__FD_ZERO) && !defined(__GLIBC__) #undef __FD_ZERO - # define __FD_ZERO(fdsetp) \\ - do { \\ - int __d0, __d1; \\ - __asm__ __volatile__("cld ; rep ; stosl" \\ - : "=&c" (__d0), "=&D" (__d1) \\ - : "a" (0), "0" (__FDSET_LONGS), \\ - "1" ((__fd_set *) (fdsetp)) :"memory"); \\ + # define __FD_ZERO(fdsetp) \ + do { \ + int __d0, __d1; \ + __asm__ __volatile__("cld ; rep ; stosl" \ + : "=&c" (__d0), "=&D" (__d1) \ + : "a" (0), "0" (__FDSET_LONGS), \ + "1" ((__fd_set *) (fdsetp)) :"memory"); \ } while (0) #endif @@ -2315,6 +2315,19 @@ fix = { test_text = "int __page_size;"; }; +/* + * On broken glibc-2.3.3 systems an array of incomplete structures is + * passed to __sigsetjmp. Fix that to take a pointer instead. + */ +fix = { + hackname = pthread_incomplete_struct_argument; + files = pthread.h; + select = "struct __jmp_buf_tag"; + c_fix = format; + c_fix_arg = "%1 *%2%3"; + c_fix_arg = "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) (__env)\\[1\\](.*)$"; + test_text = "extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask);"; +}; /* * On DYNIX/ptx, sys/mc_param.h has an embedded asm for the cpuid instruction @@ -2551,6 +2564,176 @@ fix = { test_text = "extern int utime(const char *, struct utimbuf *);"; }; +/* + * Sun Solaris 10 defines several C99 math macros in terms of + * builtins specific to the Studio compiler, in particular not + * compatible with the GNU compiler. + */ +fix = { + hackname = solaris_math_1; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tHUGE_VA%1\t(__builtin_huge_va%2())"; + c_fix_arg = "^#define[ \t]+HUGE_VA([LF]+)[ \t]+__builtin_huge_va([lf]+)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef HUGE_VAL\n" + "#define HUGE_VAL __builtin_huge_val\n" + "#undef HUGE_VALF\n" + "#define HUGE_VALF __builtin_huge_valf\n" + "#undef HUGE_VALL\n" + "#define HUGE_VALL __builtin_huge_vall"; +}; + +fix = { + hackname = solaris_math_2; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tINFINITY\t(__builtin_inff())"; + c_fix_arg = "^#define[ \t]+INFINITY[ \t]+__builtin_infinity"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef INFINITY\n" + "#define INFINITY __builtin_infinity"; +}; + +fix = { + hackname = solaris_math_3; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tNAN\t\t(__builtin_nanf(\"\"))"; + c_fix_arg = "^#define[ \t]+NAN[ \t]+__builtin_nan"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef NAN\n" + "#define NAN __builtin_nan"; +}; + +fix = { + hackname = solaris_math_4; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tfpclassify(x) \\\n" + " __extension__ ({ __typeof(x) __x_fp = (x); \\\n" + "\t\t isnan(__x_fp) \\\n" + "\t\t ? FP_NAN \\\n" + "\t\t : isinf(__x_fp) \\\n" + "\t\t ? FP_INFINITE \\\n" + "\t\t : isnormal(__x_fp) \\\n" + "\t\t\t ? FP_NORMAL \\\n" + "\t\t\t : __x_fp == 0.0 \\\n" + "\t\t\t ? FP_ZERO \\\n" + "\t\t\t : FP_SUBNORMAL; })"; + c_fix_arg = "^#define[ \t]+fpclassify\\(x\\)[ \t]+__builtin_fpclassify\\(x\\)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef fpclassify\n" + "#define fpclassify(x) __builtin_fpclassify(x)"; +}; + +fix = { + hackname = solaris_math_5; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tisfinite(x) \\\n" + " __extension__ ({ __typeof (x) __x_f = (x); \\\n" + "\t\t __builtin_expect(!isnan(__x_f - __x_f), 1); })"; + c_fix_arg = "^#define[ \t]+isfinite\\(x\\)[ \t]+__builtin_isfinite\\(x\\)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef isfinite\n" + "#define isfinite(x) __builtin_isfinite(x)"; +}; + +fix = { + hackname = solaris_math_6; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tisinf(x) \\\n" + " __extension__ ({ __typeof (x) __x_i = (x); \\\n" + "\t\t __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })"; + c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__builtin_isinf\\(x\\)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef isinf\n" + "#define isinf(x) __builtin_isinf(x)"; +}; + +fix = { + hackname = solaris_math_7; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tisnormal(x) \\\n" + " __extension__ ({ __typeof(x) __x_n = (x); \\\n" + "\t\t if (__x_n < 0.0) __x_n = -__x_n; \\\n" + "\t\t __builtin_expect(isfinite(__x_n) \\\n" + "\t\t\t\t && (sizeof(__x_n) == sizeof(float) \\\n" + "\t\t\t\t\t ? __x_n >= __FLT_MIN__ \\\n" + "\t\t\t\t\t : sizeof(__x_n) == sizeof(long double) \\\n" + "\t\t\t\t\t ? __x_n >= __LDBL_MIN__ \\\n" + "\t\t\t\t\t : __x_n >= __DBL_MIN__), 1); })"; + c_fix_arg = "^#define[ \t]+isnormal\\(x\\)[ \t]+__builtin_isnormal\\(x\\)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef isnormal\n" + "#define isnormal(x) __builtin_isnormal(x)"; +}; + +fix = { + hackname = solaris_math_8; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\tsignbit(x)\t(sizeof(x) == sizeof(float) \\\n" + "\t\t\t ? __builtin_signbitf(x) \\\n" + "\t\t\t : sizeof(x) == sizeof(long double) \\\n" + "\t\t\t ? __builtin_signbitl(x) \\\n" + "\t\t\t : __builtin_signbit(x))"; + c_fix_arg = "^#define[ \t]+signbit\\(x\\)[ \t]+__builtin_signbit\\(x\\)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef signbit\n" + "#define signbit(x) __builtin_signbit(x)"; +}; + +fix = { + hackname = solaris_math_9; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + bypass = "__GNUC__"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define\t%1(x, y)%2__builtin_%1(x, y)"; + c_fix_arg = "^#define[ \t]+([a-z]+)\\(x, y\\)([ \t]+)\\(\\(x\\) __builtin_[a-z]+\\(y\\)\\)"; + test_text = + '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" + "#undef isgreater\n" + "#define isgreater(x, y) ((x) __builtin_isgreater(y))\n" + "#undef isgreaterequal\n" + "#define isgreaterequal(x, y) ((x) __builtin_isgreaterequal(y))\n" + "#undef isless\n" + "#define isless(x, y) ((x) __builtin_isless(y))\n" + "#undef islessequal\n" + "#define islessequal(x, y) ((x) __builtin_islessequal(y))\n" + "#undef islessgreater\n" + "#define islessgreater(x, y) ((x) __builtin_islessgreater(y))\n" + "#undef isunordered\n" + "#define isunordered(x, y) ((x) __builtin_isunordered(y))"; +}; /* * Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER @@ -2702,7 +2885,7 @@ fix = { * On Solaris 10, this fix is unncessary; includes * , which includes . */ - mach = '*-*-solaris2.1[0-9]'; + mach = '*-*-solaris2.1[0-9]*'; not_machine = true; c_fix = wrap; @@ -2734,7 +2917,7 @@ fix = { * is guarded appropriately by the _XPG4 feature macro; * there is therefore no need for this fix there. */ - mach = '*-*-solaris2.1[0-9]'; + mach = '*-*-solaris2.1[0-9]*'; not_machine = true; /* diff --git a/fixincludes/server.c b/fixincludes/server.c index 902fda15072..73db78b2e79 100644 --- a/fixincludes/server.c +++ b/fixincludes/server.c @@ -83,7 +83,7 @@ load_data (FILE* fp) t_bool got_done = BOOL_FALSE; text_size = sizeof (z_line) * 2; - pz_scan = pz_text = xmalloc (text_size); + pz_scan = pz_text = XNEWVEC (char, text_size); for (;;) { @@ -109,7 +109,7 @@ load_data (FILE* fp) size_t off = (size_t) (pz_scan - pz_text); text_size += 4096; - pz_text = xrealloc (pz_text, text_size); + pz_text = XRESIZEVEC (char, pz_text, text_size); pz_scan = pz_text + off; } } @@ -124,7 +124,7 @@ load_data (FILE* fp) while ((pz_scan > pz_text) && ISSPACE (pz_scan[-1])) pz_scan--; *pz_scan = NUL; - return xrealloc (pz_text, strlen (pz_text) + 1); + return XRESIZEVEC (char, pz_text, strlen (pz_text) + 1); } @@ -260,7 +260,7 @@ run_shell (const char* pz_cmd) if (server_id <= 0) { fprintf (stderr, zNoServer, pz_cmd); - return xcalloc (1, 1); + return XCNEW (char); } /* Make sure the process will pay attention to us, send the @@ -275,7 +275,7 @@ run_shell (const char* pz_cmd) if (server_id == NULLPROCESS) { fprintf (stderr, zNoServer, pz_cmd); - return xcalloc (1, 1); + return XCNEW (char); } /* Now try to read back all the data. If we fail due to either a @@ -295,7 +295,7 @@ run_shell (const char* pz_cmd) fprintf (stderr, "CLOSING SHELL SERVER - command failure:\n\t%s\n", pz_cmd); - pz = xcalloc (1, 1); + pz = XCNEW (char); } #ifdef DEBUG fprintf( stderr, "run_shell command success: %s\n", pz ); diff --git a/fixincludes/system.h b/fixincludes/system.h index a518e0a08f9..602654e6b30 100644 --- a/fixincludes/system.h +++ b/fixincludes/system.h @@ -38,6 +38,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define NULL 0 #endif +/* Use the unlocked open routines from libiberty. */ +#define fopen(PATH,MODE) fopen_unlocked(PATH,MODE) +#define fdopen(FILDES,MODE) fdopen_unlocked(FILDES,MODE) +#define freopen(PATH,MODE,STREAM) freopen_unlocked(PATH,MODE,STREAM) + /* fixincludes is not a multi-threaded application and therefore we do not have to use the locking functions. In fact, using the locking functions can cause the compiler to be significantly slower under @@ -57,11 +62,65 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA # undef putc # define putc(C, Stream) putc_unlocked (C, Stream) # endif +# ifdef HAVE_PUTCHAR_UNLOCKED +# undef putchar +# define putchar(C) putchar_unlocked (C) +# endif +# ifdef HAVE_GETC_UNLOCKED +# undef getc +# define getc(Stream) getc_unlocked (Stream) +# endif +# ifdef HAVE_GETCHAR_UNLOCKED +# undef getchar +# define getchar() getchar_unlocked () +# endif # ifdef HAVE_FPUTC_UNLOCKED # undef fputc # define fputc(C, Stream) fputc_unlocked (C, Stream) # endif +# ifdef HAVE_CLEARERR_UNLOCKED +# undef clearerr +# define clearerr(Stream) clearerr_unlocked (Stream) +# if defined (HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED +extern void clearerr_unlocked (FILE *); +# endif +# endif +# ifdef HAVE_FEOF_UNLOCKED +# undef feof +# define feof(Stream) feof_unlocked (Stream) +# if defined (HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED +extern int feof_unlocked (FILE *); +# endif +# endif +# ifdef HAVE_FILENO_UNLOCKED +# undef fileno +# define fileno(Stream) fileno_unlocked (Stream) +# if defined (HAVE_DECL_FILENO_UNLOCKED) && !HAVE_DECL_FILENO_UNLOCKED +extern int fileno_unlocked (FILE *); +# endif +# endif +# ifdef HAVE_FFLUSH_UNLOCKED +# undef fflush +# define fflush(Stream) fflush_unlocked (Stream) +# if defined (HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED +extern int fflush_unlocked (FILE *); +# endif +# endif +# ifdef HAVE_FGETC_UNLOCKED +# undef fgetc +# define fgetc(Stream) fgetc_unlocked (Stream) +# if defined (HAVE_DECL_FGETC_UNLOCKED) && !HAVE_DECL_FGETC_UNLOCKED +extern int fgetc_unlocked (FILE *); +# endif +# endif +# ifdef HAVE_FGETS_UNLOCKED +# undef fgets +# define fgets(S, n, Stream) fgets_unlocked (S, n, Stream) +# if defined (HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED +extern char *fgets_unlocked (char *, int, FILE *); +# endif +# endif # ifdef HAVE_FPUTS_UNLOCKED # undef fputs # define fputs(String, Stream) fputs_unlocked (String, Stream) @@ -69,11 +128,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA extern int fputs_unlocked (const char *, FILE *); # endif # endif +# ifdef HAVE_FERROR_UNLOCKED +# undef ferror +# define ferror(Stream) ferror_unlocked (Stream) +# if defined (HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED +extern int ferror_unlocked (FILE *); +# endif +# endif +# ifdef HAVE_FREAD_UNLOCKED +# undef fread +# define fread(Ptr, Size, N, Stream) fread_unlocked (Ptr, Size, N, Stream) +# if defined (HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED +extern size_t fread_unlocked (void *, size_t, size_t, FILE *); +# endif +# endif # ifdef HAVE_FWRITE_UNLOCKED # undef fwrite # define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream) # if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED -extern int fwrite_unlocked (const void *, size_t, size_t, FILE *); +extern size_t fwrite_unlocked (const void *, size_t, size_t, FILE *); # endif # endif # ifdef HAVE_FPRINTF_UNLOCKED diff --git a/fixincludes/tests/base/iso/math_c99.h b/fixincludes/tests/base/iso/math_c99.h new file mode 100644 index 00000000000..86b6c20504f --- /dev/null +++ b/fixincludes/tests/base/iso/math_c99.h @@ -0,0 +1,112 @@ +/* DO NOT EDIT THIS FILE. + + It has been auto-edited by fixincludes from: + + "fixinc/tests/inc/iso/math_c99.h" + + This had to be done to correct non-standard usages in the + original, manufacturer supplied header file. */ + + + +#if defined( SOLARIS_MATH_1_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef HUGE_VAL +#define HUGE_VAL (__builtin_huge_val()) +#undef HUGE_VALF +#define HUGE_VALF (__builtin_huge_valf()) +#undef HUGE_VALL +#define HUGE_VALL (__builtin_huge_vall()) +#endif /* SOLARIS_MATH_1_CHECK */ + + +#if defined( SOLARIS_MATH_2_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef INFINITY +#define INFINITY (__builtin_inff()) +#endif /* SOLARIS_MATH_2_CHECK */ + + +#if defined( SOLARIS_MATH_3_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef NAN +#define NAN (__builtin_nanf("")) +#endif /* SOLARIS_MATH_3_CHECK */ + + +#if defined( SOLARIS_MATH_4_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef fpclassify +#define fpclassify(x) \ + __extension__ ({ __typeof(x) __x_fp = (x); \ + isnan(__x_fp) \ + ? FP_NAN \ + : isinf(__x_fp) \ + ? FP_INFINITE \ + : isnormal(__x_fp) \ + ? FP_NORMAL \ + : __x_fp == 0.0 \ + ? FP_ZERO \ + : FP_SUBNORMAL; }) +#endif /* SOLARIS_MATH_4_CHECK */ + + +#if defined( SOLARIS_MATH_5_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef isfinite +#define isfinite(x) \ + __extension__ ({ __typeof (x) __x_f = (x); \ + __builtin_expect(!isnan(__x_f - __x_f), 1); }) +#endif /* SOLARIS_MATH_5_CHECK */ + + +#if defined( SOLARIS_MATH_6_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef isinf +#define isinf(x) \ + __extension__ ({ __typeof (x) __x_i = (x); \ + __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); }) +#endif /* SOLARIS_MATH_6_CHECK */ + + +#if defined( SOLARIS_MATH_7_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef isnormal +#define isnormal(x) \ + __extension__ ({ __typeof(x) __x_n = (x); \ + if (__x_n < 0.0) __x_n = -__x_n; \ + __builtin_expect(isfinite(__x_n) \ + && (sizeof(__x_n) == sizeof(float) \ + ? __x_n >= __FLT_MIN__ \ + : sizeof(__x_n) == sizeof(long double) \ + ? __x_n >= __LDBL_MIN__ \ + : __x_n >= __DBL_MIN__), 1); }) +#endif /* SOLARIS_MATH_7_CHECK */ + + +#if defined( SOLARIS_MATH_8_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef signbit +#define signbit(x) (sizeof(x) == sizeof(float) \ + ? __builtin_signbitf(x) \ + : sizeof(x) == sizeof(long double) \ + ? __builtin_signbitl(x) \ + : __builtin_signbit(x)) +#endif /* SOLARIS_MATH_8_CHECK */ + + +#if defined( SOLARIS_MATH_9_CHECK ) +#ident "@(#)math_c99.h 1.9 04/11/01 SMI" +#undef isgreater +#define isgreater(x, y) __builtin_isgreater(x, y) +#undef isgreaterequal +#define isgreaterequal(x, y) __builtin_isgreaterequal(x, y) +#undef isless +#define isless(x, y) __builtin_isless(x, y) +#undef islessequal +#define islessequal(x, y) __builtin_islessequal(x, y) +#undef islessgreater +#define islessgreater(x, y) __builtin_islessgreater(x, y) +#undef isunordered +#define isunordered(x, y) __builtin_isunordered(x, y) +#endif /* SOLARIS_MATH_9_CHECK */ diff --git a/fixincludes/tests/base/pthread.h b/fixincludes/tests/base/pthread.h index 767c6e2774b..9998f660c7c 100644 --- a/fixincludes/tests/base/pthread.h +++ b/fixincludes/tests/base/pthread.h @@ -61,6 +61,11 @@ extern int __page_size; #endif /* PTHREAD_PAGE_SIZE_CHECK */ +#if defined( PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK ) +extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask); +#endif /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */ + + #if defined( SOLARIS_MUTEX_INIT_1_CHECK ) #ident "@(#)pthread.h 1.16 97/05/05 SMI" #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b701b67ae69..8ae7f780dbf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10426 @@ +2005-05-19 Richard Henderson + + * config/i386/sse.md (mulv4si3): Use all register inputs. + (mulv2di3): Likewise. + +2005-05-19 Richard Guenther + + * tree-ssa-loop-ivopts.c (determine_base_object): Use + build_fold_addr_expr to generate trees of correct type. + Use fold_buildN if possible. + +2005-05-19 Jan Hubicka + + * basic-block.h (REG_BR_PROB_BASE): Define. + * cgraph.c (cgraph_create_edge): Initialize loop_nest and count. + (dump_cgraph_node): Dump count. + (cgraph_clone_edge): Rescale counts. + (cgraph_clone_node): Likewise. + * cgraph.h: Include basic-block.h + (cgraph_node): Add count. + (cgraph_edge): Add count and loop_nest. + (cgraph_node, cgraph_edge, cgraph_clone_edge, cgraph_clone_node): + Update prototypes. + * cgraphunit.c: Kill now redundant inlining comment. + (cgraph_create_edges): Make static, maintain current basic block; + fix pasto. + (record_call_1): Fill in new fields. + * ipa-inline.c (cgraph_clone_inlined_nodes): Update call of + cgraph_clone_node. + (cgraph_decide_recursive_inlining): Likewise. + * rtl.h (REG_BR_PROB_BASE): Kill. + * tree-inline.c (copy_body_r): Update call of cgraph_clone_edge. + (expand_call_inline): Update call of cgraph_create_edge. + * tree-optimize.c (tree_rest_of_compilation): Likewise. + +2005-05-19 Nick Clifton + + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Use the + new rs6000_explicit_options structure. + +2005-05-19 Richard Henderson + + PR target/21390 + * config/alpha/alpha.c (alpha_emit_conditional_branch): Move + TFmode code swapping ... + (alpha_emit_xfloating_compare): ... here. + (alpha_emit_setcc): Update to match. + (alpha_lookup_xfloating_lib_func): Assert TARGET_HAS_XFLOATING_LIBS. + +2005-05-19 Richard Henderson + + PR target/21657 + * config/ia64/ia64.c (ia64_expand_tls_address): Remove extra + memory indirection in local-dynamic case. + +2005-05-18 Jie Zhang + Bernd Schmidt + + * config/bfin/bfin.c (branch_dest): Add comment why it's + necessary. + * config/bfin/bfin.md (attr "length" default): Change the offset of + forward conditional branch of length 4 from 4096 to 4092. + +2005-05-19 Jan Beulich + + * unwind-compat.c: Include tconfig.h and tsystem.h. + * unwind-dw2-fde-compat.c: Likewise. + +2005-05-18 Richard Henderson + + PR 21541 + * ifcvt.c (noce_process_if_block): Avoid conversion when the + memory destination is readonly. + +2005-05-18 Richard Henderson + + PR 21541 + * tree-ssa-operands.c (opf_non_specific): New. + (get_asm_expr_operands): Set it. + (add_call_clobber_ops, add_call_read_ops): Likewise. + (add_stmt_operand): Test it instead of opf_kill_def when + considering unmodifiable variables. + + * tree-ssa-operands.c (get_expr_operands): Fix exact test. + +2005-05-19 Kazu Hirata + + * cfgexpand.c, tree-cfg.c, tree-inline.c, tree-optimize.c, + tree-ssa-forwprop.c: Fix comment typos. + * doc/invoke.texi: Fix a typo. + +2005-05-18 Richard Henderson + + * config.gcc (powerpc-*-linux*): Include linux64.opt when + including linux64.h. + +2005-05-18 Richard Henderson + + * tree-cfg.c (pass_remove_useless): Revert last change. + * tree-optimize.c (init_tree_optimization_passes): Initialize + all_lowering_passes with PROP_gimple_any. + +2005-05-18 Devang Patel + + * config/rs6000/rs6000.md (insvsi_internal1): Subtract shift from + the mask end. + +2005-05-18 Richard Henderson + + * tree-ssa-forwprop.c (cfg_changed): New. + (tidy_after_forward_propagate_addr): New. + (forward_propagate_addr_expr): Use it, and fold_stmt_inplace. + (forward_propagate_addr_into_variable_array_index): Likewise. + (tree_ssa_forward_propagate_single_use_vars): Cleanup cfg if + edges were removed. + +2005-05-18 Geoffrey Keating + + * dummy-checksum.c: New. + * genchecksum.c: New. + * c.opt (print_pch_checksum): New flag. + * c-pch.c (struct c_pch_validity): Make much shorter. + (no_checksum): New. + (host_machine): Remove. + (target_machine): Remove. + (get_ident): Change PCH version number. + (pch_init): When -fverbose-asm, print out the compiler fingerprint. + Don't put triplets or version string in PCH validity data. + Do put the compiler checksum in the validity data. + (c_common_valid_pch): Don't check triplets or version string. Do + check checksum. + (c_common_print_pch_checksum): New. + * c-opts.c (c_common_handle_option): Add OPT_print_pch_checksum. + Print fingerprint with -v. + * c-common.h (c_common_print_pch_checksum): New. + (executable_checksum): New. + * Makefile.in (STAGEMOVESTUFF): Add cc1*-dummy, *-checksum.c. + (cc1-dummy): New rule. + (cc1-checksum.c): New rule. + (cc1-checksum.o): New rule. + (cc1): Add checksum support. + (build/genchecksum): New. + (build/genchecksum.o): New. + (dummy-checksum.o): New. + (genobjnames): Add genchecksum.o. + (mostlyclean): Remove *-checksum.c. + (gnucompare): Add libgcc to list of directories checked. + Make comparison problems in libgcc/ and with checksum files only + be warnings. + * doc/invoke.texi (Precompiled Headers): Remove caution. + Document that it must be the exact same binary. Add a few + known-safe flags to the list. + + * rs6000/predicates.md (fix_trunc_dest_operand): New. + * rs6000/rs6000.md (fix_truncdfsi2): Use fix_trunc_dest_operand. + Check that a memory operand is valid before trying to use it. + + * tree-cfg.c (pass_remove_useless): This pass works on trees. + +2005-05-18 Richard Guenther + + * tree.c (build1_stat): Don't try to handle two-operand + tree codes. + +2005-05-18 Richard Sandiford + + * config.gcc (sh*-*-*): Define SUPPORT_* macros to 1. + * config/sh/sh.h: Update mask names throughout. + (target_flags, ISIZE_BIT, DALIGN_BIT, SH1_BIT, SH2_BIT, SH3_BIT) + (SH_E_BIT, HARD_SH4_BIT, FPU_SINGLE_BIT, SH4_BIT, SH4A_BIT, FMOVD_BIT) + (SH5_BIT, SPACE_BIT, BIGTABLE_BIT, RELAX_BIT, USERMODE_BIT) + (HITACHI_BIT, NOMACSAVE_BIT, PREFERGOT_BIT, PADSTRUCT_BIT) + (LITTLE_ENDIAN_BIT, IEEE_BIT, SAVE_ALL_TR_BIT, HARD_SH2A_BIT) + (HARD_SH2A_DOUBLE_BIT, INDEXED_ADDRESS_BIT, PT_FIXED_BIT) + (INVALID_SYMBOLS_BIT, ADJUST_UNROLL_BIT, TARGET_DUMPISIZE) + (TARGET_ALIGN_DOUBLE, TARGET_SH1, TARGET_SH2, TARGET_SH3) + (TARGET_HARD_SH4, TARGET_FPU_SINGLE, TARGET_SH5, TARGET_FMOVD) + (TARGET_IEEE, TARGET_SMALLCODE, TARGET_BIGTABLE, TARGET_RELAX) + (TARGET_HITACHI, TARGET_NOMACSAVE, TARGET_PADSTRUCT) + (TARGET_LITTLE_ENDIAN, TARGET_USERMODE, TARGET_PREFERGOT) + (TARGET_SAVE_ALL_TARGET_REGS, TARGET_ALLOW_INDEXED_ADDRESS) + (TARGET_PT_FIXED, TARGET_INVALID_SYMBOLS, TARGET_ADJUST_UNROLL) + (TARGET_SWITCH_SH1, TARGET_SWITCH_SH2, TARGET_SWITCH_SH2E) + (TARGET_SWITCH_SH2A, TARGET_SWITCH_SH2A_SINGLE_ONLY) + (TARGET_SWITCH_SH2A_SINGLE, TARGET_SWITCH_SH2A_NOFPU) + (TARGET_SWITCH_SH3, TARGET_SWITCH_SH3E, TARGET_SWITCH_SH4_SINGLE_ONLY) + (TARGET_SWITCH_SH4_SINGLE, TARGET_SWITCH_SH4_NOFPU, TARGET_SWITCH_SH4) + (TARGET_SWITCH_SH4A, TARGET_SWITCH_SH4A_SINGLE_ONLY) + (TARGET_SWITCH_SH4A_SINGLE, TARGET_SWITCH_SH4A_NOFPU) + (TARGET_SWITCH_SH4AL, TARGET_SWITCH_SH5_64MEDIA) + (TARGET_SWITCH_SH5_64MEDIA_NOFPU, TARGET_SWITCHES_SH5_32MEDIA) + (TARGET_SWITCHES_SH5_32MEDIA_NOFPU, TARGET_SWITCH_SH5_32_ANY_EXTRA) + (TARGET_SWITCH_SH5_MEDIA_ANY_EXTRA, TARGET_SWITCHES) + (SUBTARGET_SWITCHES): Delete. + (TARGET_SH2E, TARGET_SH2A, TARGET_SH2A_SINGLE, TARGET_SH2A_DOUBLE) + (TARGET_SH3E, TARGET_CACHE32, TARGET_SUPERSCALAR, TARGET_HARVARD) + (TARGET_FPU_DOUBLE, TARGET_SH4A_ARCH, TARGET_SHMEDIA32) + (TARGET_SHMEDIA64): Redefine using other TARGET_* macros. + (TARGET_SH4): Undefine options.h definition and check MASK_SH1 as well. + (SUPPORT_SH1, SUPPORT_SH2E, SUPPORT_SH4, SUPPORT_SH4_SINGLE) + (SUPPORT_SH2A, SUPPORT_SH2A_SINGLE): Make numeric. + (SUPPORT_SH2): Define to 1 if SUPPORT_SH1. + (SUPPORT_SH3): Likewise SUPPORT_SH2. + (SUPPORT_SH4_NOFPU): Likewise SUPPORT_SH3. + (SUPPORT_SH4A_NOFPU, SUPPORT_SH4AL, SUPPORT_SH2A_NOFPU): Likewise + SUPPORT_SH4_NOFPU. + (SUPPORT_SH3E): Likewise SUPPORT_SH2E. + (SUPPORT_SH4_SINGLE_ONLY, SUPPORT_SH4A_SINGLE_ONLY) + (SUPPORT_SH2A_SINGLE_ONLY): Likewise SUPPORT_SH3E. + (SUPPORT_SH4A): Likewise SUPPORT_SH4. + (SUPPORT_SH4A_SINGLE): Likewise SUPPORT_SH4_SINGLE. + (SUPPORT_SH5_32MEDIA): Likewise SUPPORT_SH5_COMPACT. + (SUPPORT_SH5_32MEDIA_NOFPU): Likewise SUPPORT_SH5_COMPACT_NOFPU. + (SUPPORT_ANY_SH5_32MEDIA, SUPPORT_ANY_SH5_64MEDIA) + (SUPPORT_ANY_SH5): New macros. + (TARGET_NONE): Replace with... + (MASK_ARCH): ...this new macro. + * config/sh/elf.h: Update mask names + * config/sh/linux.h: Likewise. + * config/sh/little.h: Likewise. + * config/sh/netbsd-elf.h: Likewise. + * config/sh/symbian-pre.h: Likewise. + * config/sh/sh.c (sh_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (calc_live_regs): Use MASK_FPU_SINGLE instead of FPU_SINGLE_BIT. + (sh_target_switches, target_switches): Delete. + (sh_pch_valid_p): Check for specific differences in the target_flags + settings. + (sh_init_cumulative_args): Use MASK_HITACHI instead of HITACHI_BIT. + * config/sh/sh.opt: New file. + +2005-05-18 Richard Henderson + + PR target/21632 + * config/ia64/ia64.c (ia64_extra_constraint) <'T'>: Use + small_addr_symbolic_operand. + +2005-05-18 Jeff Law + + * tree-ssa-forwprop.c (forward_propagate_addr_expr): Do not + propagate an ADDR_EXPR if the definition and use sites are + in different EH regions. + +2005-05-18 Ian Lance Taylor + + * read-rtl.c (mode_attr_index): Use obstack_grow0, not + obstack_grow. + +2005-05-18 Daniel Berlin + + * cfgrtl.c (purge_dead_edges): Don't remove fake edges. + +2005-05-18 Daniel Berlin + + Fix PR tree-optimization/21407 + + * tree-ssa-operands.c (note_addressable): Change + COMPONENT_REF handling in response to aliasing + discussion. + +2005-05-18 Eric Botcazou + + * config/sparc/sol2.h (TARGET_DEFAULT): Add back MASK_APP_REGS. + * config/sparc/sol2-64.h (TARGET_DEFAULT): Likewise. + * config/sparc/sp-elf.h (TARGET_DEFAULT): Delete. + * doc/invoke.texi (SPARC options): Document that -mapp-regs is + the default on Solaris too. + +2005-05-17 Daniel Berlin + + * tree-ssa-pre.c (find_or_generate_expression): CALL_EXPR + is okay too. + +2005-05-17 Zdenek Dvorak + + * timevar.def (TV_SCEV_CONST): New timevar. + * tree-optimize.c (init_tree_optimization_passes): Add + pass_scev_cprop. + * tree-pass.h (pass_scev_cprop): Declare. + * tree-scalar-evolution.c (scev_const_prop): New function. + * tree-scalar-evolution.h (scev_const_prop): Declare. + * tree-ssa-loop.c (gate_scev_const_prop, pass_scev_cprop): + New. + * tree-cfg.c (replace_uses_by): Export. + * tree-flow.h (replace_uses_by): Declare. + +2005-05-17 Mike Stump + + Yet more Objective-C++... + + * c-common.h (objc_finish_try_stmt): Add. + (objc_build_synchronized): Add. + (objc_generate_write_barrier): Add. + * stub-objc.c (objc_build_synchronized): Add return value. + (objc_finish_try_stmt): Likewise. + (objc_generate_write_barrier): Add. + + * c-common.h (objc_rewrite_function_call): Add. + * c-typeck.c (build_function_call): Allow objc to rewrite + FUNCTION_DECLs. + (build_modify_expr): Allow objc to generate write barriers. + * c.opt (Wassign-intercept): Add. + (Wstrict-selector-match): Add. + (fobjc-call-cxx-cdtors): Add. + (fobjc-direct-dispatch): Add. + (fobjc-gc): Add. + * dbxout.c (get_lang_number): Add Objective-C++ support. + * doc/invoke.texi (-fobjc-call-cxx-cdtors): Likewise. + (-Wstrict-selector-match): Likewise. + (-fobjc-direct-dispatch): Likewise. + (-Wassign-intercept): Likewise. + (Overall Options): Likewise. + * gengtype.c (get_output_file_with_visibility): Likewise. + * stub-objc.c (objc_rewrite_function_call): Add. + * config/darwin.h (ASM_OUTPUT_LABELREF): Improved quoting support. + + * c-common.c (flag_objc_exceptions): Remove. + (flag_objc_sjlj_exceptions): Remove. + * c-decl.c (objc_mark_locals_volatile): Don't change decls + that are already ok. + * c-opts.c (c_common_handle_option, case + OPT_fobjc_exceptions): Remove. + (case OPT_fobjc_sjlj_exceptions): Remove + * c.opt (fobjc-call-cxx-cdtors): Have opt create the flag. + (fobjc-exceptions): Likewise. + (fobjc-sjlj-exceptions): Likewise. + * config/rs6000/darwin.h (OFFS_MSGSEND_FAST): Add. + (OFFS_ASSIGNIVAR_FAST): Add. + +2005-05-17 Eric Botcazou + + * config/sparc/sparc.md (movhi): Do not test constness + of operand #1 twice. + (movsi): Likewise. + (movdi): Unconditionally accept zero as second operand + when the first is memory. + (movdi_insn_sp32): Handle above case. + (DImode splitter): Use predicates. + (DImode splitter): Use const_zero_operand predicate. + (movsf_insn): Swap 2 alternatives. + +2005-05-17 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (find_bivs, find_givs_in_stmt_scev): Apply + expand_simple_operations to bases of the ivs. + (tree_int_cst_sign_bit): Export. + * tree-flow.h (expand_simple_operations): Declare. + * tree-ssa-loop-niter.c (number_of_iterations_cond): Use + tree_int_cst_sign_bit. + (expand_simple_operations): Export. + * tree.h (tree_int_cst_sign_bit): Declare. + +2005-05-17 Zdenek Dvorak + + * tree-cfg.c (tree_can_merge_blocks_p): Allow phi nodes in the + merged block. + (replace_uses_by): New function. + (tree_merge_blocks): Eliminate the phi nodes in the merged block. + * tree-flow.h (fold_stmt_inplace): Declare. + * tree-ssa-ccp.c (fold_stmt_inplace): New function. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Update dominance + info after cfg cleanup. + +2005-05-17 Zdenek Dvorak + + * cfgloop.h (just_once_each_iteration_p): Declaration changed. + * cfgloopanal.c (just_once_each_iteration_p): Make the loop argument + const. + +2005-05-17 Zdenek Dvorak + + * ggc-page.c (ggc_alloc_stat): Record amount of memory allocated. + * ggc-zone.c (ggc_alloc_zone_1): Ditto. + * timevar.c (timevar_ggc_mem_total): New variable. + (GGC_MEM_BOUND): New constant. + (get_time): Record ggc memory status. + (timevar_accumulate): Accumulate amount of ggc memory. + (timevar_print): Print consumption of ggc memory. + * timevar.def (TV_FIND_REFERENCED_VARS, TV_TREE_REDPHI, + TV_TREE_LOOP_BOUNDS, TV_TREE_LOOP_IVCANON, TV_TREE_VECTORIZATION, + TV_TREE_LINEAR_TRANSFORM): Shorten strings to fit in 22 characters. + * timevar.h (struct timevar_time_def): Add ggc_mem field. + (timevar_ggc_mem_total): Declare. + +2005-05-17 Kazu Hirata + + * tree-into-ssa.c (update_ssa): Clean up by shortening the + live range of DFS. + +2005-05-17 Hans-Peter Nilsson + + * config/cris/cris.md (ncond, ocode, rcond): Remove separate + define_code_attr. + ("b", "b", "b") + ("*b_reversed", "*b_reversed") + ("*b_reversed", "s", "s") + ("s"): Rename from respectively "b", + "b", "b", ("*b_reversed", + "*b_reversed", "*b_reversed", "s", + "s" and "s". + ("b", "*b_reversed") + ("*b_reversed"): Remove extraneous backslashes in + output statement section. + +2005-05-17 Roger Sayle + + * c-typeck.c (common_type): Also handle BOOLEAN_TYPEs. + +2005-05-17 Steven Bosscher + Stuart Hastings + Jan Hubicka + Dale Johannesen + + * cgraph.h (cgraph_node): Add 'lowered' state. + (cgraph_lower_function): Declare. + * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. + (cgraph_lower_function): New function. + (cgraph_create_edges): Deal with lowered function bodies. + (verify_cgraph_node): Likewise. + (cgraph_analyze_function): Do lowering job. + (cgraph_build_static_cdtor): Likewise. + * function.h (struct function): Add saved_eh and saved_cfg. + * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. + * tree-cfg.c (fold_cond_expr_cond): Export. + * tree-flow.h (fold_cond_expr_cond): Declare. + * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and + pointer-set. + (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, + in_target_cleanup_p, tree_pruner, tsi; add callee, caller and + callee_cfun, block, eh_region, eh_region_offset. + (inlining_p): New predicate. + (remap_decl): Update for new inline_data; declare newly created inline + vars in low gimple way. + (copy_body_r): Update for new datastructure, simplify some of handling + when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; + deal with RESX_EXPRs. + (copy_bb): New. + (copy_edges_for_bb): Likewise. + (remap_decl_1): New. + (copy_cfg_body): New. + (copy_generic_body): Rewrite to work on low gimple. + (copy_body): Turn into simple wrapper around copy_cfg_body. + (setup_one_parameter): Insert new statements into given basic block. + (initialize_initialized_parameters): Likewise, reorganize way things are + gimplified. + (declare_return_variable): Update for new inline data datastructure. + (inline_forbidden_p): Work on low gimple. + (estimate_num_insns): Likewise. + (expand_call_inline): Work on CFG. + (push_cfun, pop_cfun): New functions. + (cfun_stack): New stack. + (add_lexical_block): New function. + (gimple_expand_calls_inline): Work on basic block. + (optimize_inline_calls): Likewise. + (clone_body, save_body, unsave_ewpr_now): Update for new + datastructures. + (declare_inline_vars): Work on block instead of bind_expr. + (inlining_p): New predicate. + * tree-inline.h (push_cfun, pop_cfun): Declare. + * tree-optimize.c: Include except.h + (all_lowering_passes): New variable. + (execute_fixup_cfg, pass_fixup_cfg): New pass. + (init_tree_optimization_passes): Move some to all_lowering_passes. + (tree_lowering_passes): New function. + (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. + * tree-pass.h (tree_lowering_passes): Declare + +2005-05-17 Nathan Sidwell + + * unwind-dw2-fde-darwin.c: Include tsystem.h. + +2005-05-17 Jeff Law + + * Makefile.in (tree-ssa-forwprop.o): Depend on langhooks.h. + * tree-ssa-forwprop.c: Include langhooks.h. + (forward_propagate_addr_expr_into_variable_array_index): New. + (forward_propagate_addr_expr): New. + (tree_ssa_forward_propagate_single_use_vars): Loop over all + the statements in the block instead of just the last statement. + Call forward_propagate_addr_expr as needed. + (pass_forwprop): Update the SSA graph after forward propagation is + complete. + +2005-05-17 Nathan Sidwell + + * unwind-dw2-fde-glibc.c (base_from_cb_data, + _Unwind_IteratePhdrCallback): Use gcc_assert and gcc_unreachable as + appropriate. + * unwind-dw2-fde.c (__deregister_frame_info_bases, + base_from_object, fde_split, end_fde_sort): Likewise. + * unwind-dw2.c (_Unwind_GetGR, _Unwind_SetGR, execute_stack_op, + execute_cfa_program, _Unwind_SetSpColumn, uw_update_context_1, + uw_init_context_1): Likewise. + * unwind.inc (_Unwind_RaiseException_Phase2, _Unwind_Resume, + _Unwind_Resume_or_Rethrow): Likewise. + * unwind-pe.h (__gxx_abort): Do not define. + (size_of_encoded_value, base_of_encoded_value, + read_encoded_value_with_base): Use gcc_unreachable. + * unwind.h (_Unwind_GetTextRelBase): Likewise. + +2005-05-17 Daniel Jacobowitz + + * config/arm/lib1funcs.asm (cfi_pop, cfi_push, cfi_start) + (cfi_end): New macros. + (RETLDM): Use cfi_pop. Expect an eight byte stack frame. + (ARM_LDIV0, THUMB_LDIV0, DIV_FUNC_END): Use CFI macros. Create + an eight byte stack frame. + (__NR_tkill): Define. + (__div0): Use gettid tkill on GNU/Linux. + (_arm_return): Add CFI. + (Lchange_\register, .Lchange_lr): Create an eight byte stack frame. + +2005-05-17 Daniel Jacobowitz + + * configure.ac: Remove spaces around assignment to + gcc_cv_ld_sysroot. + * configure: Regenerated. + +2005-05-17 David Edelsohn + + * config/rs6000/aix.h (TARGET_ALTIVEC_VRSAVE): Delete. + * config/rs6000/rs6000.c (rs6000_explicit_options): Add + aix_struct_ret. + (rs6000_override_options): Do not protect TARGET_ALTIVEC_VRSAVE. + Modify aix_struct_return variable, not target_flags. + (rs6000_handle_option): Do not protect TARGET_ALTIVEC_VRSAVE. + (rs6000_return_in_memory): Test aix_struct_return. + * config/rs6000/rs6000.opt (maix-struct-return): Convert to + independent variable. Report mxl-compat. + +2005-05-17 Bernd Schmidt + + * config/bfin/bfin.md (eh_return): Add missing DONE. + +2005-05-17 Ian Lance Taylor + + * read-rtl.c (struct macro_traverse_data): Add unknown_mode_attr + field. + (mode_attr_index): Remove check for defined attribute. Remove + infile parameter. Change all callers. + (apply_mode_maps): Add unknown parameter. Change caller. Always + return after finding attribute. + (apply_macro_to_rtx): Add unknown_mode_attr parameter. Change + callers. + (apply_macro_traverse): Set mtd->unknown_mode_attr. + (read_rtx): Use mtd.unknown_mode_attr to check for an undefined + attribute used for a mode. + +2005-05-17 Paolo Bonzini + + * tree-ssa-math-opts.c: New file. + +2005-05-17 Paolo Bonzini + + * Makefile.in: Add tree-ssa-math-opts.c. + * expr.c (expand_expr_real_1) : Never emit as a*(1/b). + * fold-const.c (distribute_real_division): New. + (fold_binary) : Use it. + * tree-pass.h (pass_cse_reciprocals): New. + * tree-optimize.c (init_tree_optimization_passes): Run it. + * doc/passes.texi: Document the new pass. + +2005-05-17 Richard Guenther + + PR middle-end/21595 + * builtins.c (fold_builtin_constant_p): Handle + &"string cst"[0] as constant. + +2005-05-17 Richard Henderson + + * config/i386/sse.md (mulv16qi3, mulv2di3): New. + +2005-05-17 Jakub Jelinek + + PR middle-end/21492 + * cfgcleanup.c (try_crossjump_to_edge): update_forwarder_flag for + src2 if src2 has been split. + + PR tree-optimization/21610 + * c-typeck.c (decl_constant_value_for_broken_optimization): If not + returning DECL, call unshare_expr. + +2005-05-17 Hans-Peter Nilsson + + * config/cris/cris.md: Unquote preparation and output statements. + (BWD, WD, BW): New, mode-macros. + (S, s, m, mm, nbitsm1): New, mode-attrs. + (szext, shift, shiftrt, ncond, ocond, rcond): New, code-macros. + (u, su, shlr, slr, ncond, ocond, rcond, rCC, oCC, roCC): New, + code-attrs. + ("tst"): Replace "tstqi", "tsthi" and "tstsi". + ("*cmp_ext"): Replace "*cmp_extsi" and "*cmp_exthi". + ("*cmp_swapext"): Replace "*cmp_swapextqi" and + "*cmp_swapexthi". + ("cmp"): Replace "cmphi" and "cmpqi". + ("movdi"): Move misplaced head comment regarding necessity of + movdi from movsi to here. + ("*mov_side_biap"): Replace "*mov_sideqi_biap" and + "*mov_sidehi_biap". + ("*mov_side"): Replace "*mov_sideqi" and "*mov_sidehi". + ("*mov_side_biap_mem", "*mov_sidehi_biap_mem"): Replace + "*mov_sideqi_biap_mem". + ("*mov_side_mem"): Replace "*mov_sideqi_mem" and + "*mov_sidehi_mem". + ("*clear_side_biap"): Replace "*clear_sidesi_biap", + "*clear_sidehi_biap" and "*clear_sideqi_biap". + ("*clear_side"): Replace "*clear_sidesi", "*clear_sidehi" + and "*clear_sideqi". + ("*ext_sidesi_biap"): Replace "*ext_sideqisi_biap" and + "*ext_sidehisi_biap". + ("*ext_sidesi"): Replace "*ext_sideqisi" and + "*ext_sidehisi". + ("reload_in"): Replace "reload_inhi" and "reload_inqi". + ("reload_out"): Replace "reload_outhi" and "reload_outqi". + ("extenddi2"): Replace "extendhidi2" and "extendqidi2". + ("extendsi2"): Replace "extendhisi2" and "extendqisi2". + ("zero_extendsi2"): Replace "zero_extendhisi2" and + "zero_extendqisi2". + ("*op_side_biap"): Replace "*op_sideqi_biap", + "*op_sidehi_biap" and "*op_sidesi_biap". + ("*op_side"): Replace "*op_sideqi", "*op_sidehi" and + "*op_sidesi". + ("*op_swap_side_biap"): Replace "*op_swap_sideqi_biap", + "*op_swap_sidehi_biap" and "*op_swap_sidesi_biap". + ("*op_swap_side"): Replace "*op_swap_sideqi", + "*op_swap_sidehi" and "*op_swap_sidesi". + ("sub3"): Replace "subhi3" and "subqi3", correcting a typo + in the N alternative of "subqi3". + ("*extopsi_side_biap"): Replace "*extopqisi_side_biap" and + "*extophisi_side_biap". + ("*extopsi_side"): Replace "*extopqisi_side" and + "*extophisi_side". + ("*extopsi_swap_side_biap"): Replace + "*extopqisi_swap_side_biap" and "*extophisi_swap_side_biap". + ("*extopsi_swap_side"): Replace "*extopqisi_swap_side" and + "*extophisi_swap_side". + ("*extopsi"): Replace "*extopqisi" and "*extophisi". + ("*extopsi_swap"): Replace "*extopqisi_swap" and + "*extophisi_swap". + ("mul3"): Replace "umulhisi3", "umulqihi3", + "mulqihi3", "mulhisi3" and "mulhisi3". + ("mulsidi3"): Replace "mulsidi3" and "umulsidi3". + ("mulsi3_highpart"): Replace "smulsi3_highpart" and + "umulsi3_highpart". + ("xor3"): Replace "xorhi3" and "xorqi3". + ("neg2"): Replace "negsi2", "neghi2" and "negqi2". + ("one_cmpl2"): Replace "one_cmplhi2" and "one_cmplqi2". + ("si3"): Replace "ashrsi3", "lshrsi3" and "ashlsi3". + ("ashr3"): Replace "ashrhi3" and "ashrqi3". + ("*expanded_"): Replace "*expanded_ashrhi", + "*expanded_ashrqi", "*expanded_lshrhi" and "*expanded_lshrqi". + ("*_lowpart"): Replace "*ashrhi_lowpart", + "*ashrqi_lowpart", "*lshrhi_lowpart" and "*lshrqi_lowpart". + ("lshr3"): Replace "lshrhi3" and "lshrqi3". + ("ashl3"): Replace "ashlhi3" and "ashlqi3". + ("*ashl_lowpart"): Replace "*ashlqi_lowpart" and + "*ashlhi_lowpart". + ("abs2"): Replace "abshi2" and "absqi2". + ("b"): Replace "beq", "bne", "bgtu", "bltu", "bgeu" and + "bleu". + ("b"): Replace "bgt" and "ble". + ("b"): Replace "blt" and "bge". + ("*b_reversed"): Replace "*beq_reversed", "*bne_reversed", + "*bgtu_reversed", "*bltu_reversed", "*bgeu_reversed" and + "*bleu_reversed". + ("*b_reversed"): Replace "*bgt_reversed" and + "*ble_reversed". + ("*b_reversed"): Replace "*blt_reversed" and + "*blt_reversed". + ("s"): Replace "sgeu", "sltu", "seq", "sgtu", "sleu" and + "sne". + ("s"): Replace "sge" and "slt". + ("s"): Replace "sgt" and "sle". + ("clear.[bwd] [rx=rx+rz.S2]"): Replace split clear.d + [rx=rx+rz.S2], clear.w [rx=rx+rz.S2] and clear.b [rx=rx+rz.S2]. + ("clear.[bwd] [rx=rx+i]"): Replace splits clear.d [rx=rx+i], + clear.w [rx=rx+i] and clear.b [rx=rx+i]. + +2005-05-17 Jakub Jelinek + + * varasm.c (struct constant_descriptor_tree): Add hash field. + (const_desc_hash): Just return hash field. + (const_desc_eq): If hash values are different, return 0 immediately. + (output_constant_def): Compute hash field of temporary key, use + htab_find_slot_with_hash instead of htab_find_slot. Set hash in + newly built constant descriptor. + (lookup_constant_def): Compute hash field of temporary key, use + htab_find_with_hash instead of htab_find. + +2005-05-16 Richard Henderson + + * config/i386/sse.md (mulv4si3): New. + +2005-05-17 Hans-Peter Nilsson + + * config/cris/cris.h (EXTRA_CONSTRAINT_T): Remove FIXME and + tests for noncanonical versions of reg+constant and + reg+reg*{1,2,4}. + +2005-05-16 Richard Henderson + Steven Bosscher + + PR tree-opt/21399 + * tree-eh.c (maybe_clean_or_replace_eh_stmt): Rename from + maybe_clean_eh_stmt; take old stmt parameter. Update EH + region data structure to match replacement. + * tree-flow.h: Update to match. + * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. + * tree-ssa-dom.c (optimize_stmt): Likewise. + * tree-ssa-pre.c (eliminate): Likewise. + * tree-ssa-propagate.c (substitute_and_fold): Likewise. + +2005-05-16 Caroline Tice + + * bb-reorder.c (verify_hot_cold_block_grouping): Replace + internal_error with gcc_assert. + * dwarf2out.c (dwarf2out_switch_text_section): Likewise. + * function.h (struct function): Remove space between "*" and + struct field names. + * varasm.c (initialize_cold_section_name): Add gcc_assert; + modify to use alloca. + (unlikely_text_section): Add check for flag_function_sections. + (assemble_start_function): Move call to resolve_section, so it + comes before first call to unlikely_text_section. + (assemble_end_function): Add test and call to function_section + if appropriate. + +2005-05-16 Roger Sayle + + * c-common.c (c_common_truthvalue_conversion): Use fold_build2 + instead of build_binary_op when performing code transformations + to avoid error messages about constructs not it the user's code. + +2005-05-16 Kazu Hirata + + * tree-ssa-pre.c: Fix a comment typo. + +2005-05-16 Richard Henderson + + PR target/21556 + * config/ia64/ia64.md (load_dtpmod, load_ltoff_dtpmod, load_dtprel, + load_dtprel64, load_dtprel22, load_dtprel_gd, load_ltoff_dtprel, + add_dtprel, add_dtprel14, add_dtprel22, load_tprel, load_tprel64, + load_tprel22, load_tprel_ie, load_ltoff_tprel, add_tprel, add_tprel14, + add_tprel22): Remove mode from symbolic operand. + +2005-05-16 Richard Sandiford + + * optc-gen.awk: Include intl.h after the externally-provided files. + +2005-05-16 Kazu Hirata + + * tree-ssa-copy.c (copy_prop_visit_assignment): Clean up by + folding a COND_EXPR_COND in a nondestructive manner. + +2005-05-16 Fariborz Jahanian + + * config/rs6000/altivec.md (altivec_vmrghb, altivec_vmrghh, + altivec_vmrghw, altivec_vmrglb, altivec_vmrglh, altivec_vmrglw): + New values for vec_select definitions and bitmask for element + selection. + +2005-05-16 Kazu Hirata + + * dwarf2out.c (used_rtx_varray): Rename to used_rtx_array. + Change the type to VEC(rtx,gc)*. + (mem_loc_descriptor, add_const_value_attributes, + dwarf2out_init): Adjust uses of used_rtx_varray. + + * tree-data-ref.c (compute_all_dependences): Change the type + of dependence_relations to VEC(ddr_p,heap)**. + (compute_data_dependences_for_loop): Change the type of + allrelations to VEC(ddr_p,heap)*. + +2005-05-16 Richard Sandiford + + * Makefile.in (options.c): Tell optc-gen.awk to include config.h, + system.h, coretypes.h and tm.h. + (options.o): Update dependencies accordingly. + * optc-gen.awk: Allow header_name to be a list of filenames. + Handle the "Condition" flag. + * opts.h (CL_DISABLED): New flag. + * opts.c (handle_option): Print an error for CL_DISABLED options. + * doc/options.texi: Document the "Condition" option flag. + +2005-05-16 Paolo Bonzini + + * tree-inline.c (estimate_num_insns_1): Handle VEC_COND_EXPR. + +2005-05-15 Roger Sayle + + * tree-scalar-evolution.c (set_nb_iterations_in_loop): Only + check for TREE_OVERFLOW on INTEGER_CST trees. + * tree-chrec.c (chrec_convert): Only clear TREE_OVERFLOW on + CONSTANT_CLASS_P tree nodes. + +2005-05-15 H.J. Lu + + PR target/21551 + * config/ia64/ia64.c (ia64_expand_move): Don't add addend twice. + +2005-05-15 Daniel Berlin + + Fix PR tree-optimization/21576 + + * tree-ssa-pre.c (expression_node_pool): New pool. + (comparison_node_pool): Ditto. + (list_node_pool): Ditto. + (pool_copy_list): New function. + (phi_translate): Handle CALL_EXPR. + (valid_in_set): Ditto. + (create_expression_by_pieces): Ditto. + (insert_into_preds_of_block): Ditto. + (insert_aux): Ditto. + (compute_avail): Ditto. + (create_value_expr_from): Handle TREE_LIST and CALL_EXPR. + (can_value_number_call): New function. + (find_leader): Update comment. + (init_pre): Create new pools. + (fini_pre): Free new pools. + (pass_pre): Add TODO_update_ssa for the future when we are going + to need vops. + * tree-vn.c (expressions_equal_p): Handle TREE_LIST. + (set_value_handle): Ditto. + (get_value_handle): Ditto. + +2005-05-15 Richard Earnshaw + + * arm.c (thumb_unexpanded_epilogue): Delete unused variable 'mode'. + +2005-05-15 Andreas Jaeger + + * gcc.c (pfatal_pexecute): Remove unused local function. + +2005-05-15 Richard Sandiford + + * optc-gen.awk: Remove excess indentation. + * opth-gen.awk: Likewise. + +2005-05-14 Kaz Kojima + + * config/sh/sh.c (sh_output_mi_thunk): Check cfun->cfg instead + of basic_block_info. Call init_flow and find_basic_blocks + before dbr_schedule if needed. + +2005-05-14 Kazu Hirata + + * tree-optimize.c (init_tree_optimization_passes): Move + pass_cd_dce in place of the last pass_dce. + + PR tree-optimization/21563 + * tree-vrp.c (compare_value): Return boolean_false_node when + SSA_NAME in "if (SSA_NAME == CST)" is strictly smaller than or + strictly larger than CST. + +2005-05-14 Nathan Sidwell + Jan-Benedict Glaw + + * config/vax/vax.c: (print_operand_address) Use gcc_unreachable() and + gcc_assert(). + (rev_cond_name) Likewise. + (vax_float_literal) Likewise. + * config/vax/vax.md: Likewise. + +2005-05-14 Jan-Benedict Glaw + + * config/vax/vax.md: define_constant VAXens AP, FP, SP and PC + registers and use them (specifically the stack pointer). + * config/vax/vax.h: Use above defines right here. + + * config/vax/vax.c: (override_options) Remove 'register' keyword. + (split_quadword_operands) Likewise. (rev_cond_name) Likewise. + (vax_float_literal) Likewise. (vax_rtx_costs) Remove trailing + whitespace. + * config/vax/vax.h: Remove 'register' keyword. Misc. whitespace fixes, + mostly removal of trailing spaces... + * config/vax/vax-modes.def: Remove trailing whitespace. + + * config/vax/elf.h: Update whitespace. + +2005-05-14 Richard Guenther + + Revert + 2005-05-11 Richard Guenther + * fold-const.c (fold_indirect_ref_1): Avoid removing + NOP_EXPRs with type qualifiers like const. + +2005-05-14 Jan Hubicka + + Patch by Richard Henderson: + * tree-eh.c (tree_can_throw_internal, tree_can_throw_external): + Handle RESX expressions properly. + + * tree-eh.c (record_stmt_eh_region): Use add_stmt_to_eh_region. + (add_stmt_to_eh_region_fn): Nest into CALL_EXPR. + (remove_stmt_from_eh_region_fn): Likewise. + + * tree-cfg.c (execute_warn_function_return): Break out noreturn + warning too.. + (execute_warn_function_noreturn): ... here. + (pass_warn_function_noreturn): New pass. + * tree-pass.h (pass_warn_function_noreturn): Declare + * tree-optimize.c (init_tree_optimization_passes): Move return + warnings early and add noreturn warnings at place of previous + return warnings. + +2005-05-14 Kazu Hirata + + * tree-ssa-live.c (tpa_init, tpa_delete, tpa_compact, + root_var_init, type_var_init): Use VEC instead of VARRAY. + * tree-ssa-live.h (tree_partition_associator_d): Change the + type of trees to VEC(tree,heap)*. + (tpa_tree): Use VEC instead of VARRAY. + +2005-05-14 Richard Guenther + + * fold-const.c (div_if_zero_remainder): New function. + (try_move_mult_to_index): Use it. + +2005-05-14 Kazu Hirata + + * tree-eh.c (leh_tf_state): Change the type of dest_array to + VEC(tree,heap)*. + (maybe_record_in_goto_queue, lower_try_finally_onedest, + lower_try_finally_copy, lower_try_finally_switch, + lower_try_finally): Use VEC instead of VARRAY. + +2005-05-14 Hans-Peter Nilsson + + * config/cris/cris.h (Node: Register Classes): Remove obsoleted + comment regarding defined register classes. + (LEGITIMIZE_RELOAD_ADDRESS): Do not define. + +2005-05-14 Kazu Hirata + + * tree-optimize.c (init_tree_optimization_passes): Move + pass_merge_phi before the first pass_dominator. + +2005-05-13 Richard Earnshaw + + * arm.h (INITIALIZE_TRAMPOLINE): Make the call to __clear_cache + unconditional. + +2005-05-13 Josh Conner + + * config/arm/arm.c (arm_size_return_regs): New. + (thumb_unexpanded_epilogue): replace in-line calculation + of return registers with call to arm_size_return_regs. + (use_return_insn): Include test of which registers are + being used to hold return values, to accommodate + vector return values. + +2005-05-11 Aldy Hernandez + + * config/rs6000/sysv4.opt (mlittle): Handle. + + * config/rs6000/rs6000.c (rs6000_handle_option): Set + target_flags_explicit when appropriate. + +2005-05-13 J"orn Rennecke + + PR middle-end/20714: + * optabs.c (no_conflict_data): New struct. + (no_conflict_move_test): New function. + (emit_no_conflict_block): Use it. + +2005-05-13 Adam Nemet + + * doc/invoke.texi (Debugging Options): Option + -fdump-translation-unit only works with C++ now. + +2005-05-13 Hans-Peter Nilsson + + Replace calls to abort in CRIS port. + * config/cris/cris.h (CRIS_ASSERT): New macro. + * config/cris/cris.md ("*movsi_internal"): Use CRIS_ASSERT and + internal_error instead of abort. + ("movsi"): Ditto. Unquote preparation statement section. + ("call", "call_value"): Ditto, but use gcc_assert where + appropriate. Tweak comments. + * config/cris/cris.c (ASSERT_PLT_UNSPEC): Define in terms of + CRIS_ASSERT. + (cris_op_str): Call internal_error, not abort. + (cris_print_operand): Tweak "abort" reference to "die" in comment. + (cris_initial_elimination_offset): Call gcc_unreachable, not abort. + (cris_notice_update_cc): Call internal_error, not abort. + (cris_expand_return, cris_expand_prologue, cris_gen_movem_load) + (cris_emit_movem_store, cris_asm_output_symbol_ref) + (cris_output_addr_const_extra): Use CRIS_ASSERT, don't call abort. + (cris_symbol, cris_got_symbol): Use CRIS_ASSERT instead of + ENABLE_CHECKING-guarded abort call. + (cris_split_movdx): Use CRIS_ASSERT instead of abort with test. + Use internal_error at end of test-chain. + +2005-05-13 J"orn Rennecke + + PR rtl-optimization/20769: + * bt-load.c (compute_defs_uses_and_gen): Check for the blockage + pattern emitted by expand_nl_goto_receiver. + + PR middle-end/20793: + * integrate.c (allocate_initial_values): Update register liveness + information. + +2005-05-13 Josh Conner + + * arm.c (arm_return_in_memory): Add handling for vector return types. + +2005-05-13 David Ung + + * config/mips/mips.h (processor_type): Add new PROCESSOR_4KP + name. + * config/mips/mips.c: Add 4km alias. + * config/mips/mips.md: Add 4kp to cpu attrib and include 4k.md. + * config/mips/4k.md: New file, add 4Kc/4Kp DFA pipeline + description. + +2005-05-13 Jan Hubicka + + * c-decl.c (finish_function): Suppress "control reaches end of + non-void function" when "no return statement in function + returning non-void" is issued. + + * tree-inline.c (copy_body_r): Simplify substituted ADDR_EXPRs. + * tree-optimize.c (pass_gimple): Kill. + (init_tree_optimization_passes): Kill pass_gimple. + * tree-cfg.c (build_tree_cfg): Do verify_stmts to check that we are gimple. + * tree-dump.c (dump_files): Rename .generic to .gimple.* + +2005-05-13 J"orn Rennecke + + PR rtl-optimization/20756: + * basic-block.h (PROP_DEAD_INSN): Define. + * flow.c (propagate_one_insn): Set during mark_set_regs call + for a dead insn. + (mark_set_1): Emit a clobber when we are about to delete a dead insn + that kills a live register. + +2005-05-13 Adrian Straetling + + * config/s390/s390.md: ("DBL"): New mode attribute. + ("*movmem_long_64", "*movmem_long_31"): Merge to "*movmem_long". + ("*clrmem_long_64", "*clrmem_long_31"): Merge to "*clrmem_long". + ("*cmpmem_long_64", "*cmpmem_long_31"): Merge to "*cmpmem_long". + +2005-05-13 Richard Guenther + + * c-format.c (check_format_arg): Handle string literals of + the form &"string"[offset]. + + * g++.dg/warn/format4.C: New testcase. + +2005-05-13 Kazu Hirata + + * config/mips/3000.md, config/mips/4000.md, + config/mips/4100.md, config/mips/4300.md, config/mips/4600.md, + config/mips/5000.md, config/mips/7000.md, config/mips/9000.md, + config/mips/generic.md, config/pdp11/pdp11.md, + config/sh/crt1.asm, config/sh/lib1funcs.asm, + config/sh/sh-modes.def, config/sh/sh-protos.h, + config/sh/shmedia.md, config/sh/ushmedia.h: Update copyright. + +2005-05-13 Richard Henderson + + * function.c (instantiate_virtual_regs_in_insn): Do not simplify + addition to move unless dest is a register. Do not skip + instantiation in dest on addition simplification. + +2005-05-13 Hans-Peter Nilsson + + * config/cris/cris.c (cris_print_operand) : Use operand_subword and HOST_WIDE_INT_PRINT_DEC for + output; don't have special case for HOST_BITS_PER_WIDE_INT == 32. + +2005-05-13 Jan Hubicka + + * basic-block.h (FOR_ALL_BB_FN): New macro. + (init_flow): Initialize cfg structure. + * function.c (allocate_struct_function): Do not initialize cfg structure. + * tree-cfg.c (init_empty_tree_cfg): Break out from ... + (build_tree_cfg): ... here. + * tree-flow.h (init_empty_tree_cfg): Declare. + +2005-05-12 Steven Bosscher + + Fix PR tree-optimization/21520 + * tree-ssa-pre.c (phi_translate): Use fully_constant_expression + to attempt to fold constants. + +2005-05-12 Kaz Kojima + + * config/sh/sh.c: Declare the prototype of sh_adjust_unroll_max + only when TARGET_ADJUST_UNROLL_MAX is defined. + (general_movsrc_operand): Use the C style comment. + (ua_offset): Use prototype. + +2005-05-12 Zdenek Dvorak + + * tree-ssa-loop-im.c (struct mem_ref): Add field "next". + (struct hmr_data, hoist_memory_reference, memref_del, + struct fmrv_data): Removed. + (hoist_memory_references, free_mem_ref, free_mem_refs): New functions. + (gather_mem_refs, gather_mem_refs_stmt): Add new references to the + list. + (find_more_ref_vops): Traverse the list of memory references. + (determine_lsm_loop): Work with the list of memory references instead + of traversing the hashtable. + +2005-05-12 Steven Bosscher + Stuart Hastings + Jan Hubicka + + * except.c (duplicate_eh_region_1, duplicate_eh_region_2, + duplicate_eh_regions): New functions, based on old + implementation removed with RTL inliner. + (reachable_next_level): Modify behaviour pre-inline. + * except.h (duplicate_eh_regions_map, duplicate_eh_regions): + Declare. + * function.h (struct function): Add after_inlining flag. + * tree-optimize.c (tree_rest_of_compilation): Set it. + * tree-eh.c (add_stmt_to_eh_region_fn): Initialize hashtable + when needed. + * tree-cfg.c (label_to_block_fn): Deal with cases where + label was never insterted into code. + +2005-05-12 Zack Weinberg + + * doc/cpp.texi: Document that #sccs is a synonym for #ident. + +2005-05-12 Daniel Berlin + + Fix PR tree-optimization/21532 + * tree-ssa-pre.c (create_expression_by_pieces): stmt + needs to go onto the inserted_exprs list. + +2005-05-12 Ian Lance Taylor + + * c-common.h (statement_code_p): Don't declare. + (STATEMENT_CODE_P): Don't define. + (INIT_STATEMENT_CODES): Don't define. + * c-common.c (statement_code_p): Don't define. + +2005-05-12 Eric Botcazou + + * config/sparc/sparc.h: Remove dead code. + * config/sparc/sparc.c (sparc_compute_frame_size): Use + FIRST_PARM_OFFSET for the size of the register window area. + (emit_save_regs): Rename into emit_save_or_restore_regs. + Add 'action' parameter. Use 4095 as upper bound for the offset. + Pass 'action' to save_or_restore_regs. + (emit_restore_regs): Delete. + (sparc_expand_prologue): Call emit_save_or_restore_regs. + (sparc_expand_epilogue): Likewise. + * config/sparc/sparc.md (mode macro P): Move. + (movdi_insn_sp32_v9, movdi_insn_sp32): Swap. + (mov expander): Move to the top of the V32 section. + (movdf_insn_sp32_v9_no_fpu, movdf_insn_sp32_v9): Swap. + (movtf_insn_sp64_hq, movtf_insn_sp64): Swap. + (sibcall_epilogue): Move. + +2005-05-12 Richard Earnshaw + + PR target/21501 + * arm.c (arm_gen_constant): Sign-extend intermediate values when + synthesizing a constant of the difference of two immediates. + +2005-05-12 Richard Earnshaw + + * arm/vfp.md (negsf2_vfp): Add alternative using integer registers. + (negdf2_vfp): Likewise. Convert to define_insn_and_split and split + the alternatives using integer registers into the appropriate + primitives. + +2005-05-11 Kenneth Zadeck + + * bitmap.c (bitmap_elmt_to_freelist, bitmap_element_allocate, + bitmap_elt_clear_from, bitmap_clear): Changed freelist structure. + * bitmap.h: Fixed comments. + +2005-05-11 Richard Henderson + + PR target/21412 + * config/ia64/ia64.c (TARGET_CANNOT_FORCE_CONST_MEM): New. + (ia64_cannot_force_const_mem): New. + (tls_symbolic_operand_type): New. + (ia64_legitimate_constant_p): New. + (ia64_expand_load_address): Return true on success. Improve + checks for when we should not split. + (ia64_expand_tls_address): New addend operand. Distribute it + as appropriate to the tls_kind. Delay referencing gp. + (ia64_expand_move): Split symbolic addend as necessary. Handle + tls symbols with addends. + * config/ia64/ia64-protos.h: Update. + * config/ia64/ia64.h (CALL_REALLY_USED_REGISTERS): False for r0, + p0, f0, f1, and r13. + (LEGITIMATE_CONSTANT_P): Move to ia64_legitimate_constant_p. + * config/ia64/ia64.md (UNSPEC_DTPMOD): New. + (symbolic_operand splitter): Pass everything through + ia64_expand_load_address and FAIL or DONE as appropriate. + (load_fptr): Only accept after reload. + (load_fptr_internal1, gprel64_offset, load_gprel64, load_symptr_high, + load_symptr_low, load_ltoff_dtpmod, + (load_dtpmod): New. + (load_dtprel): Only accept tls symbols. + (load_dtprel64, load_dtprel22): Likewise. + (load_tprel, load_tprel64, load_tprel22): Likewise. + (load_dtprel_gd, load_ltoff_dtprel, load_tprel_ie): New. + (add_dtprel): Only accept tls symbols. Canonicalize PLUS. + (add_dtprel14, add_dtprel22): Likewise. + (add_tprel, add_tprel14, add_tprel22): Likewise. + * config/ia64/predicates.md (small_addr_symbolic_operand): New. + (any_offset_symbol_operand, aligned_offset_symbol_operand): New. + (got_symbolic_operand): Check CONST offsets. + (tls_symbolic_operand, ld_tls_symbolic_operand): New. + (ie_tls_symbolic_operand, le_tls_symbolic_operand): New. + (move_operand): Don't handle tls here. Check CONST offsets. + +2005-05-11 Richard Sandiford + + * config/mips/7000.md (rm7_impy_si_mult): Just match imul and imadd. + Remove hilo_operand check. + (rm7_impy_si_mul): Just match imul3. Remove hilo_operand check. + * config/mips/predicates.md (hilo_operand): Delete. + +2005-05-11 Richard Sandiford + + * config/mips/sr71k.md, config/mips/7000.md: Reformat. + +2005-05-11 Kazu Hirata + + PR tree-optimizer/18472 + * tree-if-conv.c (tree_if_convert_stmt, + if_convertible_modify_expr_p): Don't handle GOTO_EXPR. + +2005-05-11 Jan Hubicka + + * Makefile.in (tree-eh.o: Kill gt-tree-eh.h dependency. + (GTFILES): add except.h. + * except.c (eh_status): Add throw_stmt_table. + (set_eh_throw_stmt_table, get_eh_throw_stmt_table): New functions. + * except.h (add_stmt_to_eh_region_fn, remove_stmt_from_eh_region_fn, + lookup_stmt_eh_region_fn): Declare. + (throw_stmt_node): New structure. + (set_eh_throw_stmt_table, get_eh_throw_stmt_table): New. + * gengtype.c (open_base_files): Add except.h to inlines. + * tree-eh.c (throw_stmt_node): Kill. + (record_stmt_eh_region): Update. + (add_stmt_to_eh_region_fn): Break out from ... + (add_stmt_to_eh_region): ... here. + (remove_stmt_from_eh_region_fn): Break out from ... + (remove_stmt_from_eh_region): ... here. + (lookup_stmt_eh_region_fn): Break out from ... + (lookup_stmt_eh_region): ... here. + (honor_protect_cleanup_actions): Use build_resx. + (lower_try_finally_onedest): Likewise. + (lower_try_finally_copy): Likewise. + (lower_try_finally_switch): Likewise. + (lower_eh_constructs): Update eh table construction. + * tree.c (build_resx): New. + * tree.h (build_resx): Declare. + +2005-05-11 H.J. Lu + + * libgcov.c (gcov_exit): Set prefix_length to 0 if no relocation + is needed. + +2005-05-11 Kazu Hirata + + * fold-const.c, libgcov.c: Fix comment typos. + + * tree-ssa-forwprop.c (forward_propagate_into_cond_1): Remove + redundant code. + +2005-05-11 Daniel Jacobowitz + + * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Define. + * config/arm/arm.h (SUBTARGET_FRAME_POINTER_REQUIRED): Provide + default definition. + (FRAME_POINTER_REQUIRED): Use SUBTARGET_FRAME_POINTER_REQUIRED. + +2005-05-11 Nathan Sidwell + + PR bootstrap/21481 + * crtstuff.c: Include auto-host.h again, for now. + +2005-05-11 Richard Sandiford + + * config/mips/24k.md: Remove trailing whitespace. + +2005-05-11 David Ung + + * config/mips/mips.md (type): Add imul3. + (length, hazard, may_clobber_hilo): Check for imul3. + (mulsi3_mult3, muldi3_mult3, *muls, mulsi3_highpart_mulhi_internal) + (*mulsi3_highpart_neg_mulhi_internal): Set attr to imul3. + * config/mips/24k.md (r24k_int_mul3): Enable this reservation + for a 3 operand mul and its bypasses. + * config/mips/3000.md (r3k_imul): Add imul3 to reservations. + * config/mips/4000.md (r4k_imul): Likewise. + * config/mips/4100.md (r4100_imul_si, r4100_imul_di): Likewise. + * config/mips/4130.md (vr4130_class, vr4130_mulsi) + (vr4130_muldi): Likewise. + * config/mips/4300.md (r4300_imul_si, r4300_imul_di): Likewise. + * config/mips/4600.md (r4600_imul, r4650_imul): Likewise. + * config/mips/5000.md (r5k_imul_si, r5k_imul_di): Likewise. + * config/mips/5400.md (ir_vr54_imul_si, ir_vr54_imul_di) + (ir_vr54_imadd_si): Likewise. + * config/mips/5500.md (ir_vr55_imul_si, ir_vr55_imul_di): Likewise. + * config/mips/7000.md (rm7_impy_si_mult, rm7_impy_si_mul) + (rm7_impy_di): Likewise. + * config/mips/9000.md (rm9k_mulsi, rm9k_muldi): Likewise. + * config/mips/generic.md (generic_imul): Likewise. + * config/mips/sb1.md (ir_sb1_mulsi, ir_sb1_muldi): Likewise. + * config/mips/sr71k.md (ir_sr70_imul_si, ir_sr70_imul_di): Likewise. + +2005-05-11 J"orn Rennecke + + PR middle-end/20371: + * tree.h (record_layout_info_s): New member prev_packed. + * stor-layout.c (update_alignment_for_field): Fix comment about + KNOWN_ALIGN. For MS bitfields, if we start a new run, make sure + we start it properly aligned. + (place_field): At the beginning of a record, pass 0 as KNOWN_ALIGN + to update_alignment_for_field, and recompute it afterwards using + the alignment of the record. + When a packed bitfield precedes an MS bitfield, don't add padding + at the end of the packed bitfield on behalf of the base type of + the packed bit field. + Don't adjust rli->bitpos at the end + of an MS bitfield run if we already adjusted bitpos/offset for an + alignment as large or larger than the bitfield type size. + Take possible record alignment > BIGGEST_ALIGNMENT into account + when calculating actual_align. + Only put packed buit fields into rli->prev_field if they end up + suitably aligned. + Also set rli->remaining_in_alignment when we re-set rli->prev_field. + Update rli->remaining_in_alignment when we have already started a + run of bit fields and we process a packed bit field. + +2005-05-11 Sebastian Pop + + * tree-data-ref.c (find_data_references_in_loop): Give up when + the body of the loop contains a CALL_EXPR or an ASM_EXPR: they + may embed arbitrary side effects. + Remove the assumption that GIMPLE form contains a single array + access per statement. + When the statement contains virtual operands, fail if it is not + a MODIFY_EXPR or a CALL_EXPR. + Return after the dont know node is inserted. + +2005-05-11 Richard Earnshaw + + * arm.md (negsf2, negdf2): Permit these expands when compiling for VFP. + +2005-05-11 Richard Guenther + + PR middle-end/19807 + PR tree-optimization/19639 + * fold-const.c (try_move_mult_to_index): Handle INTEGER_CST + and generic summands for char* as s * delta, too, folding &a[i] + CODE x to &a[i CODE x/s]. Use tree_int_cst_equal + for comparison of steps. Convert types for index addition. + (fold_binary): Adjust the callers to always dispatch to + try_move_mult_to_index. + * tree-ssa-propagate.c (set_rhs): Avoid setting rhs to + expr with non-gimple ARRAY_REF offset. + +2005-05-11 Richard Guenther + + * fold-const.c (fold_indirect_ref_1): Avoid removing + NOP_EXPRs with type qualifiers like const. + +2005-05-11 Richard Henderson + + PR c/21502 + * c-decl.c (finish_decl): Propagate the completed array type of + a global variable into the binding. + +2005-05-10 Matt Kraai + + * Makefile.in (gtype-desc.o, build/genautomata.o) + (build/varray.o): Depend on $(VARRAY_H). + +2005-05-10 Diego Novillo + + * tree-optimize.c (init_tree_optimization_passes): Re-organize + optimization passes to do an initial batch of scalar cleanups. + +2005-05-10 Ian Lance Taylor + + * read-rtl.c (struct macro_traverse_data): Define. + (map_attr_string): New static function, broken out of + apply_macro_to_string. + (mode_attr_index, apply_mode_maps): New static functions. + (apply_macro_to_string): Call map_attr_string. + (apply_macro_to_rtx): Add mode_maps and infile parameters. Change + all callers. + (apply_macro_traverse): Expect data to point to a struct + macro_traverse_data. + (read_rtx): Add mode_maps local variable. Use mode_traverse_data + to pass data through htab_traverse. + (read_rtx_1): Add mode_maps parameter. Change all callers. + Handle mode names which are attribute strings. + * doc/md.texi (Substitutions): Rename from String Substitutions. + Change references. Document using attributes as modes. + +2005-05-10 Zdenek Dvorak + + * tree-cfg.c (tree_duplicate_sese_region): Update profile. + * tree-optimize.c (init_tree_optimization_passes) Swap + pass_ch and pass_profile. + * tree-ssa-loop-ch.c (copy_loop_headers): Do not update profile + here. Remove rewrite_into_loop_closed_ssa call. + +2005-05-10 Adrian Straetling + + * config/s390/s390.c: (s390_const_double_ok_for_constraint_p): New + function. + (legitimate_reload_constant_p): Add check for const double zero. + * config/s390/s390.md: Add comment for constraint letter 'G'. + ("*movdf_64", "*movdf_31", "movsf"): Add constraint and proper + attributes for new case. + * config/s390/s390.h: (CONST_DOUBLE_OK_FOR_CONSTRAINT_P): Define it as + s390_const_double_ok_for_constraint_p. + * config/s390/s390-protos.h (s390_const_double_ok_for_constraint_p): + Add prototype. + +2005-05-10 Kazu Hirata + + PR tree-optimization/21170 + * tree-ssa-dom.c, tree-ssa-threadupdate.c: Replace + rewrite_ssa_into_ssa in comments with update_ssa. + +2005-05-10 Zdenek Dvorak + + * tree-ssa-loop-im.c: Include hashtab.h. + (struct mem_ref_loc): New. + (struct mem_ref): Describe the set of references with the same + shape. + (max_stmt_uid, get_stmt_uid, record_mem_ref, free_mem_refs, + maybe_queue_var, fem_single_reachable_address, + for_each_memref, single_reachable_address, + is_call_clobbered_ref, determine_lsm_reg): Removed. + (record_mem_ref_loc, free_mem_ref_locs, determine_lsm_ref, + hoist_memory_reference, memref_hash, memref_eq, memref_del, + gather_mem_refs_stmt, gather_mem_refs, find_more_ref_vops): + New functions. + (rewrite_mem_refs, schedule_sm): Use mem_ref_loc list. + (determine_lsm_loop): Rewritten. + (determine_lsm): Do not set stmt uids. + +2005-05-10 Adrian Straetling + + * config/s390/s390.md: Add comment lines for 'f' and 't' constraint + letters. + +2005-05-10 Adrian Straetling + + * config/s390/s390.md: ("anddi3","andsi3","andhi3","andqi3"): Merge. + ("iordi3", "iorsi3", "iorhi3", "iorqi3"): Merge. + ("xordi3", "xorsi3", "xorhi3", "xorqi3"): Merge. + +2005-05-10 Jeff Law + + * tree-ssa-dom.c (dom_opt_finalize_block): Do not call + thread_across_edge for any abnormal edges. + +2005-05-10 Richard Henderson + + * config/ia64/ia64.c (ia64_expand_atomic_op): New. + * config/ia64/ia64-protos.h: Declare it. + * config/ia64/sync.md (I124MODE, FETCHOP, fetchop_name): New. + (sync_add, sync_old_add): Remove. + (sync_, sync_nand): New. + (sync_old_, sync_old_nand): New. + (sync_new_, sync_new_nand): New. + (cmpxchg_rel_): Split from cmpxchg_acq_. Zero + extend result; use release semantics. + (cmpxchg_rel_di): Rename from cmpxchg_acq_; use release. + (sync_val_compare_and_swap_): Update to match. + +2005-05-10 Richard Henderson + + * optabs.c (expand_compare_and_swap_loop): Don't clobber old value + before comparing it for success. + +2005-05-10 Richard Henderson + + * config/ia64/sync.md (sync_add): Fix arguments for + no return value pattern. + +2005-05-10 Grigory Zagorodnev + H.J. Lu + + * libgcov.c (create_file_directory): New function. Create + directory for the given file name. + (gcov_max_filename): New static var. Keeps size of the longest + file name. + (gcov_exit): Always try to create directory for output + file. Relocate each filename basing on environment vars. + (__gcov_init): Remember the longest file name. + * tsystem.h: include filenames.h to get IS_DIR_SEPARATOR + * doc/gcov.texi (Cross-profiling): New node documenting + cross-profiling management. + * doc/invoke.texi (-fprofile-arcs): Add xref to cross-profiling. + +2005-05-10 Eric Botcazou + + * config/sparc/sparc.c (mem_min_alignment): Do not rely + on MEM_ALIGN if TARGET_UNALIGNED_DOUBLES. + +2005-05-10 Bob Wilson + + * config/xtensa/lib1funcs.asm (__udivsi3, __divsi3): Rearrange special + case code to avoid one move instruction. + (__umodsi3, __modsi3): Merge duplicated code sequences. + +2005-05-10 Kazu Hirata + + * config/mips/24k.md, config/sh/divtab.c, config/sh/sh.c, + config/sh/sh.md, config/sh/superh.h: Fix comment typos. + * doc/invoke.texi: Fix typos. + + * tree-data-ref.c (analyze_array_indexes, analyze_array, + init_data_ref, access_functions_are_affine_or_constant_p, + free_data_refs): Use VEC instead of VARRAY. + * tree-data-ref.h (data_reference): Change the type of + access_fns to VEC(tree,gc)*. + (DR_ACCESS_FN, DR_NUM_DIMENSIONS): Use VEC instead of VARRAY. + +2005-05-10 Gabor Loki + + PR c/17913 + * c-typeck.c (build_conditional_expr): Remove reducing cond_expr. + * fold-const.c (fold): Expand the condition of reducing cond_expr. + (contains_label_1, contains_label_p): New functions for checking + labels in a sub-tree. + +2005-05-10 Joseph S. Myers + + PR c/21342 + * c-decl.c (pushdecl): When there is a declaration in the current + scope and the declarations are external linkage, check for + compatibility with the type in the external scope and update the + type in the external scope with the composite type information. + Do not form a composite type of the new type and the visible type + if they are incompatible. + +2005-05-10 Nathan Sidwell + + * crtstuff.c: Revert part of 2005-05-08 Change. + (IN_LIBGCC2): Define. + +2005-05-10 Eric Botcazou + + * config/sparc/sparc.c (fp_sethi_p): Test !SPARC_SIMM13_P and + remove redundant test. + (fp_mov_p): Accept 0. + (fp_high_losum_p): Remove redundant test. + * config/sparc/predicates.md (const_high_operand): Explicitly test + (not small_int_operand). + (fp_const_high_losum_operand): New. + * config/sparc/sparc.md (movsi_insn): Do not emit 'clr'. Reorder. + (movdi_insn_sp32_v9): Use canonical predicates. + (movdi_insn_sp32): Test !TARGET_V9 instead of !TARGET_ARCH64. + (movdi_insn_sp64_novis): Delete. + (movdi_insn_sp64_vis): Rename into movdi_insn_sp64. + (movsf_insn_novis): Delete. + (movsf_insn_vis): Rename into movsf_insn. + (movsf_no_f_insn): Rename into movsf_insn_no_fpu. + (movsf_lo_sum): Use fp_const_high_losum_operand. + (movsf_high): Likewise. + (movsf_high_losum splitter): Likewise. + (mov expander): Use register_or_zero_operand. + (mov expander): Likewise. + (movdf_insn_sp32): Use register_or_zero_operand. + (movdf_no_e_insn_sp32): Use register_or_zero_operand. + Rename into movdf_insn_sp32_no_fpu. + (movdf_no_e_insn_v9_sp32): Use register_or_zero_operand. + Rename into movdf_insn_sp32_v9_no_fpu. + (movdf_insn_v9only_novis): Delete. + (movdf_insn_v9only_vis): Rename into movdf_insn_sp32_v9. + (movdf_insn_sp64_novis): Delete. + (movdf_insn_sp64_vis): Rename into movdf_insn_sp64. + (movdf_no_e_insn_sp64): Use register_or_zero_operand. + Rename into movdf_insn_sp64_no_fpu. + (movtf expander): Use register_or_zero_operand. + (movtf_insn_sp32): Delete. + (movtf_insn_vis_sp32): Use register_or_zero_operand. + Rename into movtf_insn_sp32. + (movtf_no_e_insn_sp32): Use register_or_zero_operand. + Rename into movtf_insn_sp32_no_fpu. + (movtf_insn_hq_sp64): Delete. + (movtf_insn_hq_vis_sp64): Use register_or_zero_operand. + Rename into movtf_insn_sp64_hq. + (movtf_insn_sp64): Delete. + (movtf_insn_vis_sp64): Use register_or_zero_operand. + Rename into movtf_insn_sp64. + (movtf_no_e_insn_sp64): Use register_or_zero_operand. + Rename into movtf_insn_sp64_no_fpu. + +2005-05-10 Nathan Sidwell + + * config/stormy16/stormy16.c (xstormy16_emit_cbranch): Use + gcc_assert and gcc_unreachable as appropriate. + (xstormy16_split_cbranch, xstormy16_output_cbranch_hi, + xstormy16_output_cbranch_si, xstormy16_split_move, + xstormy16_initial_elimination_offset, + xstormy16_encode_section_info, xstormy16_print_operand_address, + xstormy16_expand_call, xstormy16_expand_arith, + xstormy16_output_shift, xstormy16_init_builtins): Likewise. + +2005-05-10 Kazu Hirata + + * tree-outof-ssa.c (_elim_graph): Change the type of nodes and + const_copies to VEC(tree,heap)*. + (new_elim_graph, delete_elim_graph, elim_graph_size, + elim_graph_add_node, eliminate_build, eliminate_phi): Use VEC + instead of VARRAY. + +2005-05-10 Joseph S. Myers + + PR other/21052 + * doc/extend.texi (Type Attributes): Correct example syntax. + +2005-05-09 Joseph S. Myers + + PR c/21160 + * doc/invoke.texi (-Wuninitialized): Update documentation. + +2005-05-09 Richard Earnshaw + + * arm.c (const_ok_for_arm): Use a faster algorithm. + +2005-05-09 David Edelsohn + + PR target/21477 + * config/rs6000/rs6000.md (add_op2): New. + (add3): Use it. + +2005-05-09 Richard Earnshaw + + * arm.c (arm_gen_constant): Add new heuristic for generating + constant integers that can be expressed as the difference of two + valid immediates. + +2005-05-09 Roger Sayle + + * c-tree.h (parser_build_unary_op): New prototype. + * c-typeck.c (parser_build_unary_op): New function to construct + a unary operation in the C parser. + * c-parser.c (c_parser_unary_expression): Use the new function + parser_build_unary_op when appropriate. + +2005-05-09 Mark Mitchell + + PR 18655 + * dwarf2out.c (output_call_frame_info): Use DWARF2_FRAME_REG_OUT + before outputting DWARF_FRAME_RETURN_COLUMN. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_branch_condition_mask, + s390_branch_condition_mnemonic, s390_extra_constraint_str, + s390_const_ok_for_constraint_p, s390_expand_plus_operand, + legitimize_pic_address, s390_emit_tls_call_insn, + legitimize_tls_address, legitimize_tls_address, + s390_expand_addcc, print_shift_count_operand, print_operand, + addr_generation_dependency_p, annotate_constant_pool_refs, + s390_split_branches, find_constant_pool_ref, + replace_constant_pool_ref, s390_add_constant, s390_find_constant, + s390_find_execute, s390_mainpool_start, s390_chunkify_start, + s390_output_pool_entry, s390_function_value, + s390_call_saved_register_used, s390_emit_call): Replace + conditional aborts by gcc_assert and unconditional by gcc_unreachable. + (s390_select_ccmode, s390_match_ccmode_set, s390_extract_part, + s390_cannot_force_const_mem, s390_output_dwarf_dtprel, + get_some_local_dynamic_name, s390_function_arg_size, + s390_function_arg_advance, s390_function_arg, + s390_expand_builtin, s390_gen_rtx_const_DI): Replace abort in + default case by gcc_unreachable. + * config/s390/s390.md: ("*cjump_31", "*icjump_31", "*jump31"): Replace + conditional abort by gcc_assert. + ("doloop_si31"): Replace abort in last else by gcc_unreachable. + ("main_pool", "pool"): Replace unconditional abort by gcc_unreachable. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_decompose_address, + tls_symbolic_operand, legitimate_pic_operand_p, + legitimate_constant_p, legitimate_reload_constant_p, + s390_expand_plus_operand, legitimate_address_p, + legitimate_la_operand_p, ): Remove 'register' from signature. + (symbolic_reference_mentioned_p, + tls_symbolic_reference_mentioned_p): Remove 'register' from local + variable declarations. + (legitimize_address): Remove 'register' from + signature and local variable declarations. + +2005-05-09 Adrian Straetling + + * config/s390/s390-protos.h: (s390_match_ccmode, + s390_match_ccmode_set, reg_used_in_mem_p, + symbolic_reference_mentioned_p, tls_symbolic_reference_mentioned_p, + legitimate_la_operand_p, preferred_la_operand_p, + s390_short_displacement, addr_generation_dependency_p, + legitimate_reload_constant_p, legitimate_address_p): Change return type + into 'bool'. + (s390_tm_ccmode): Change type of parameter "mixed" into 'bool'. + * config/s390/s390.c: (s390_match_ccmode, + symbolic_reference_mentioned_p, tls_symbolic_reference_mentioned_p, + legitimate_reload_constant_p): Change return type into 'bool'. + (preferred_la_operand_p,legitimate_la_operand_p, legitimate_address_p): + Likewise. Additionally adapted comment. + (s390_extra_constraint_p): Change Comment to reflect 'int' return type. + (s390_tm_ccmode): Change type of parameter "mixed" into 'bool'. + (s390_decompose_address): Change the type of the internal flags + "pointer", "base_ptr", "indx_ptr", and the return value into 'bool'. + (struct s390_address): Change type of "pointer" into bool. + * config/s390/s390.md: ("*tmdi_reg", "*tmsi_reg", "tm_full"): + Adapt calls for 's390_tm_ccmode' to the new signature. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_match_ccmode_set, + s390_branch_condition_mnemonic, s390_short_displacement, + s390_decompose_address, get_thread_pointer, legitimize_tls_address, + print_shift_count_operand, get_some_local_dynamic_name, + get_some_local_dynamic_name_1, reg_used_in_mem_p, + addr_generation_dependency_p, s390_split_branches, + annotate_constant_pool_refs, find_constant_pool_ref, + replace_constant_pool_ref, find_ltrel_base, replace_ltrel_base, + s390_optimize_prologue, find_unused_clobbered_reg, s390_frame_area, + s390_register_info, s390_frame_info, s390_init_frame_layout, + s390_update_frame_layout, save_fpr, restore_fpr, save_gprs, + restore_gprs, s390_function_arg_size, s390_function_arg_float, + s390_init_machine_status, s390_assemble_integer, s390_handle_option, + s390_encode_section_info, s390_cannot_force_const_mem, + s390_delegitimize_address, s390_return_in_memory, s390_init_builtins, + s390_expand_builtin, s390_output_mi_thunk, s390_safe_attr_type, + s390_adjust_priority, s390_issue_rate, + s390_first_cycle_multipass_dfa_lookahead, s390_cannot_copy_insn_p, + s390_rtx_costs, s390_address_cost, s390_reorg, s390_valid_pointer_mode, + s390_build_builtin_va_list, s390_gimplify_va_arg, + s390_function_ok_for_sibcall, s390_call_saved_register_used, + s390_pass_by_reference, s390_fixed_condition_code_regs, + s390_cc_modes_compatible s390_mainpool_start,, s390_mainpool_finish, + s390_mainpool_cancel, s390_chunkify_start, s390_chunkify_finish, + s390_chunkify_cancel, s390_start_pool, s390_end_pool, + s390_add_pool_insn, s390_find_pool, s390_add_constant, + s390_find_constant, s390_add_execute, s390_find_execute, + s390_execute_label, s390_execute_target, s390_dump_pool, + s390_dump_execute, s390_alloc_pool, s390_free_pool): Remove prototypes. + Move target macro definitions to the end of the file. Move several + functions within the file to assure correct compiling. + +2005-05-09 Steven Bosscher + + * calls.c (purge_reg_equiv_notes): Remove, fold into... + (fixup_tail_calls): ...here. Only look at insns between the + start of the function and the FUNCTION_BEG insn note. + + * gcse.c (one_cprop_pass): Fix typos in dumps. + + * tree-ssa-operands.h (FOR_EACH_PHI_ARG): Fix typos. + +2005-05-09 Adrian Straetling + + * config/s390/s390.h: Move xxx_REGNUM definitions to s390.md. + * config/s390/s390.md: ("SIBCALL_REGNUM", "BASE_REGNUM", + "RETURN_REGNUM", "CC_REGNUM", "TP_REGNUM"): New constants. + Replace every occurrence of '(reg: 33)' by '(reg: + CC_REGNUM)'. + ("get_tp_64", "get_tp_31", "set_tp_64", "set_tp_31"): Replace + '(reg: 36)' by '(reg: TP_REGNUM)'. + ("*sibcall_br", "*sibcall_value_br"): Replace '(reg:DI 1)' by '(reg:DI + REG_SC)'. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("gf") New mode attribute. + ("fixuns_truncdfdi2", "fixuns_truncdfsi2", "fixuns_truncsfdi2", + "fixuns_truncsfsi2"): Merge. + ("fix_truncdfdi2", "fix_truncsfdi2"): Merge. + ("fix_truncdfdi2_ieee", "fix_truncdfsi2_ieee", "fix_truncsfdi2_ieee", + "fix_truncsfsi2_ieee"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("FPR") New mode macro. + ("de", "dee"): New mode attributes. + ("cmpdf", "cmpsf"): Merge. + ("*cmpdf_ccs_0", "*cmpsf_ccs_0"): Merge. + ("*cmpdf_ccs_0_ibm", "*cmpdf_ccs_0_ibm"): Merge. + ("*cmpdf_ccs", "*cmpsf_ccs"): Merge. + ("*cmpdf_ccs_ibm", "*cmpsf_ccs_ibm"): Merge. + ("floatdidf2", "floatdisf2"): Merge. + ("adddf3", "addsf3"): Merge. + ("*adddf3", "*addsf3"): Merge. + ("*adddf3_cc", "*addsf3_cc"): Merge. + ("*adddf3_cconly", "*addsf3_cconly"): Merge. + ("*adddf3_ibm", "*addsf3_ibm"): Merge. + ("subdf3", "subsf3"): Merge. + ("*subdf3", "*subsf3"): Merge. + ("*subdf3_cc", "*subsf3_cc"): Merge. + ("*subdf3_cconly", "*subsf3_cconly"): Merge. + ("*subdf3_ibm", "*subsf3_ibm"): Merge. + ("muldf3", "mulsf3"): Merge. + ("*muldf3", "*mulsf3" "): Merge. + ("*muldf3_ibm", "*mulsf3_ibm"): Merge. + ("*fmadddf", "*fmaddsf"): Merge. + ("*fmsubdf", "*fmsubsf"): Merge. + ("divdf3", "divsf3"): Merge. + ("*divdf3", "*divsf3"): Merge. + ("*divdf3_ibm", "*divsf3_ibm"): Merge. + ("negdf2", "negsf2"): Merge. + ("*negdf2_cc", "*negsf2_cc"): Merge. + ("*negdf2_cconly", "*negsf2_cconly"): Merge. + ("*negdf2", "*negsf2"): Merge. + ("*negdf2_ibm", "*negsf2_ibm"): Merge. + ("absdf2", "abssf2"): Merge. + ("*absdf2_cc", "*abssf2_cc"): Merge. + ("*absdf2_cconly", "*abssf2_cconly"): Merge. + ("*absdf2", "*abssf2"): Merge. + ("*absdf2_ibm", "*abssf2_ibm"): Merge. + ("*negabsdf2_cc", "*negabssf2_cc"): Merge. + ("*negabsdf2_cconly", "*negabssf2_cconly"): Merge. + ("*negabsdf2", "*negabssf2"): Merge. + ("sqrtdf2", "sqrtsf2"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.c: (s390_adjust_priority): Adapt to changed + attribute names. + * config/s390/2084.md: ("x_fsimpd", "x_fsimps", "x_fdivd", "x_fdivs", + "x_floadd", "x_floads", "x_fstored", "x_fstores"): Rename to + ("x_fsimpdf", "x_fsimpsf", "x_fdivdf", "x_fdivsf", "x_floaddf", + "x_floadsf", "x_fstoredf", "x_fstoresf") and replace 'type' + attribute names. + * config/s390/s390.md: ("type"): Rename "fsimpd, fsimps, floadd, floads, + fstored, fstores, fmuld, fmuls, fdivd, fdivs, fsqrtd, fsqrts" to + "fsimpdf, fsimpsf, floaddf, floadsf, fstoredf, fstoresf, fmuldf, + fmulsf, fdivdf, fdivsf, fsqrtdf, fsqrtsf". + ("*cmpdf_ccs_0", "*cmpdf_css_0_ibm", "*cmpdf_ccs", + "*cmpdf_ccs_ibm", "*cmpsf_ccs_0", "*cmpsf_css_0_ibm", + "*cmpsf_ccs", "*cmpsf_ccs_ibm", "*movdi_64", "*movdi_31", + "*movsi_zarch", "*movsi_esa", "*movdf_64", "*movdf_31", "movsf", + "*muldf3", "*muldf3_ibm", "*fmadddf", "*fmsubdf", "*mulsf3", + "mulsf3_ibm", "*fmaddsf", "fmsubsf", "*divdf3", "*divdf3_ibm", + "*negdf2_cc", "*negdf2_cconly", "*negdf2", "*negdf2_ibm", + "*negsf2_cc", "*negsf2_cconly", "*negsf2", "*absdf2_cc", + "*absdf2_cconly", "*absdf2", "*absdf2_ibm", "*abssf2_cc", + "*abssf2_cconly", "*abssf2", "*abssf2_ibm", "*negabsdf2_cc", + "*negabsdf2_cconly", "*negabsdf2", "*negabssf2_cc", + "*negabssf2_cconly", "*negabssf2", "sqrtdf2", "sqrtsf2"): Rename + 'type' value. + ("*divsf3"): Additionally rename second pattern to + "*divsf3_ibm". + ("truncdfsf2_ibm", "extendsfdf2_ieee", "extendsfdf2_ibm", + "*adddf3", "*adddf3_cc", "*adddf3_cconly", "*adddf3_ibm", + "*addsf3", "*addsf3_cc", "*addsf3_cconly", "*subdf3", + "subdf3_cc", "*subdf3_cconly", "*subdf3_ibm", "*subsf3", + "subsf3_cc", "*subsf3_cconly", "*subsf3_ibm"): Merge identical + 'type values' and rename 'type' value. + ("*addsf3"): Additionally rename second pattern to + "*addsf3_ibm". + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("SHIFT"): New mode macro. + ("lr", "shift"): New mode attributes. + ("ashldi3", "lshrdi3"): Merge. + ("*ashldi3_31", "*lshrdi3"_31): Merge. + ("*ashldi3_64", "*lshrdi3"_64): Merge. + ("ashlsi3", "lshrsi3"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("DSI", "SCOND"): New mode + macros. + ("E", "g"): New mode attributes. + ("*adddi3_alc_cc", "*addsi3_alc_cc"): Merge. + ("*adddi3_alc", "*addsi3_alc"): Merge. + ("*subdi3_slb_cc", "*subsi3_slb_cc"): Merge. + ("*subdi3_slb", "*subsi3_slb"): Merge. + ("adddicc", "addsicc"): Merge. + ("*sconddi", "*scondsi"): Merge. + ("*sconddi_neg", "*scondsi_neg"): Merge. + ("sltu", "sgtu", "sleu", "sgeu"): Merge. + ("negdi2", "negsi2"): Extract expander pattern from + "negsi2" and merge with "negdi2". + ("*negdi2"): Merge with instruction pattern of "negsi2". + ("*negdi2_cc", "*negsi2_cc"): Merge. + ("*negdi2_cconly", "*negsi2_cconly"): Merge. + ("rotldi3", "rotlsi3"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("hc"): New mode attribute. + ("extendhidi2", "extendqidi2"): Merge. + ("*extendhidi2", "*extendqidi2"): Merge. + ("extendhisi2", "extendqisi2"): Merge. + ("zero_extendhidi2", "zero_extendqidi2"): Merge. + ("*zero_extendhidi2", "*zero_extendqidi2"): Merge. + Merged 2 define_split. + ("*zero_extendhisi2", "*zero_extendqisi2"): Merge. + ("*zero_extendhisi2_64", "*zero_extendqisi2_64"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("COMPARE"): New mode macro. + ("beq", "bne", "bgt", "bgtu", "blt", "bltu", "bge", "bgeu", + "ble", "bleu", "bunordered", "bordered", "buneq", "bunlt", + "bungt", "bunle", "bunge", "bltgt"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("INT"): New mode macro. + ("one_cmpldi2", "one_cmplsi2", "one_cmplhi2", "one_cmplqi2"): + Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("GPR", "P"): New mode macros. + ("cmpdi", "cmpsi"): Merge. + ("strlendi", "strlensi"): Merge. + ("*strlendi", "*strlensi"): Merge. + ("movmemdi", "movmemsi"): Merge. + ("clrmemdi", "clrmemsi"): Merge. + +2005-05-09 Adrian Straetling + + * config/s390/s390.md: ("HQI"): New mode macro. + ("icm_lo", "icm_hi", "max_uint"): New mode attributes. + ("*tmhi_full", "*tmqi_full"): Merge. + ("*tsthiCCT", "*tstqiCCT"): Merge. + ("*tsthi", "*tstqi"): Merge. + ("*tsthi_cconly", "tstqi_cconly"): Merge. + ("*sethighhisi", "*sethighqisi"): Merge. + +2005-05-09 Kazu Hirata + + * crtstuff.c, integrate.h, tree-scalar-evolution.h, + config/alpha/unicosmk.h, config/arc/arc.md, + config/arm/bpabi.h, config/arm/coff.h, config/arm/elf.h, + config/arm/ieee754-df.S, config/arm/ieee754-sf.S, + config/arm/netbsd.h, config/arm/pe.c, config/arm/pe.h, + config/arm/semi.h, config/arm/uclinux-elf.h, + config/arm/wince-pe.h, config/fr30/fr30.c, + config/rs6000/altivec.h: Update copyright. + +2005-05-09 Nathan Sidwell + + * config/pdp11/pdp11.c (pdp11_output_function_prologue): Use + gcc_assert and gcc_unreachable as appropriate. + (pdp11_output_function_epilogue, output_move_double, + output_move_quad, print_operand_address, output_jump, + output_addr_const_pdp11): Likewise. + * config/pdp11/pdp11.h (FUNCTION_PROFILER, + ASM_OUTPUT_ALIGN): Likewise. + * config/pdp11/pdp11.md: Likewise. + (extendhisi2, subhi3, subqi3): Likewise. + +2005-05-09 David Edelsohn + + PR middle-end/21237 + * dojump.c (do_jump, MINUS_EXPR): Build NE_EXPR and fall through + to NE_EXPR case. + +2005-05-09 Kazu Hirata + + * config/ia64/ia64.c: Fix a comment typo. + +2005-05-09 Richard Earnshaw + + PR target/21397 + * arm.c (ARM_OPT_SET_CPU, ARM_OPT_SET_ARCH, ARM_OPT_SET_TUNE): Define. + (arm_override_options): Use them instead of manifest constants. Don't + allow -march to override the -mtune setting. + +2005-05-09 Nathan Sidwell + + * config/iq2000/iq2000.c (abort_with_insn): Use fancy_abort. + (gen_int_relational): Use gcc_unreachable and gcc_assert as necessary. + (function_arg_advance, function_arg, save_restore_insns, + iq2000_expand_prologue, iq2000_output_conditional_branch, + expand_one_builtin, print_operand): + * config/iq2000/iq2000.md (tablejump): Likewise. + +2005-05-09 David Ung + + * config/mips/mips.h (processor_type): Add names for the 24K. + * config/mips/mips.c (mips_cpu_info_table): Add names for the 24K + processor family. + * config/mips/mips.md (cnv_mode): New attribute for recording the + conversion types of float convert insns. + (cpu): Add 24k and 24kx. + (include): Include 24k.md file. + (truncdfsf2, extendsfdf2, fix_truncdfsi2_insn, fix_truncdfsi2_macro) + (fix_truncdfdi2, fix_truncsfdi2, floatsidf2, floatdidf2, floatsisf2) + (floatdisf2): Setup cnv_mode. + (fix_truncsfsi2_insn, fix_truncsfsi2_macro): Changed mode to SF and + setup cnv_mode. + * config/mips/24k.md: New file, contains 24k DFA pipeline + description. + +2005-05-09 Nathan Sidwell + + * config/sh/sh.c (print_operand_address): Use gcc_assert and + gcc_unreachable as appropriate. + (print_operand, prepare_move_operands, prepare_scc_operands, + output_movedouble, output_branch, shift_insns_rtx, gen_shifty_op, + gen_shl_and, shl_sext_kind, gen_datalabel_ref, dump_table, + fixup_mova, gen_far_branch, sh_reorg, split_branches, + final_prescan_insn, output_stack_adjust, sh_expand_epilogue, + sh_set_return_address, sh_setup_incoming_varargs, + initial_elimination_offset, sh_pch_valid_p, get_free_reg, + sh_expand_builtin, sh_output_mi_thunk, extract_sfunc_addr, + check_use_sfunc_addr): Likewise. + * config/sh/netbsd-elf.h (FUNCTION_PROFILER): Likewise. + * config/sh/sh.h (ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): Likewise. + * config/sh/symbian.c (sh_symbian_mark_dllexport, + sh_symbian_mark_dllimport): Likewise. + * config/sh/sh.md: Likewise. + (movdicc, call_pop, call_value_pop, casesi_worker_1, + casesi_worker_2, casesi_shift_media, casesi_load_media, + return_media): Likewise. + +2005-05-08 Roger Sayle + + PR inline-asm/8788 + * stmt.c (expand_asm_operands): Avoid calling force_reg on BLKmode + operands. + +2005-05-08 Richard Henderson + + * config/alpha/alpha.c (adjust_address): Fix typo last change. + +2005-05-08 Stephane Carrez + + * config/m68hc11/m68hc11.h (REG_VALID_P): A regno must be >= 0 + and -1 can happen in reg_renumber when no hard register is assigned. + +2005-05-08 Steven Bosscher + Kazu Hirata + + PR tree-optimization/14841, tree-optimization/15838 + * tree-ssa-ccp.c (fold_const_aggregate_ref): New. + (evaluate_stmt): Call it. + +2005-05-08 Jakub Jelinek + + * config/ia64/ia64.c (ia64_override_options): Don't set + ia64_flag_var_tracking and clear flag_var_tracking here... + (ia64_file_start): ... but here. + +2005-05-08 Nathan Sidwell + + * config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Use gcc_assert + and gcc_unreachable as appropriate. + (expand_prologue, expand_epilogue, m68hc11_gen_lowpart, + m68hc11_gen_highpart, print_operand, print_operand_address, + m68hc11_expand_compare, m68hc11_expand_compare_and_branch, + m68hc11_gen_movhi): Likewise. + * config/m68hc11/m68hc11.h (HARD_X_REGNUM): Reword comment. + * config/m68hc11/m68hc11.md: Reword comment. + +2005-05-08 Stephane Carrez + + PR target/21281 + * config/m68hc11/predicates.md (splitable_operand): An immediate is + allowed. + +2005-05-08 Stephane Carrez + + * config/m68hc11/predicates.md (reg_or_some_mem_operand): Do not allow + the 68HC12 address indirect addressing mode as it is not supported by + bset and bclr. + * config/m68hc11/m68hc11-protos.h + (m68hc11_valid_addressing_p): Declare. + (m68hc11_add_mode): Declare. + * config/m68hc11/m68hc11.c (m68hc11_valid_addressing_p): Rename from + register_indirect_p and export it. + (m68hc11_z_replacement): Use emit_insn_after when adding the save Z + instruction so that it is part of the good BB. + (m68hc11_gen_movhi): Fix invalid generation of indexed indirect + addressing with movw. + (m68hc11_gen_movqi): Use pula and pulb instead of lda and ldb for + 68HC12. + * config/m68hc11/m68hc11.h (ADDR_STRICT, ADDR_INCDEC, ADDR_INDEXED, + ADDR_OFFSET, ADDR_INDIRECT, ADDR__CONST): Moved from m68hc11.c. + * config/m68hc11/m68hc11.md ("movhi_const0"): Use this pattern only + for 68HC11. + ("*movhi_68hc12"): Handle movhi_const0. + ("*subhi3", "subqi3"): Use general_operand for operand 1. + ("*subhi3_zext"): Likewise. + +2005-05-08 Stephane Carrez + + PR target/19051 + * config/m68hc11/m68hc11.md ("mulqi3"): Use general_operand for + operand 1 and fix constraints. + ("mulqihi3"): Use general_operand for operand 2. + +2005-05-08 Julian Brown + H.J. Lu + Paul Brook + + * configure.ac: Set ld_vers_major, ld_vers_minor and ld_vers_patch for + GNU linker. Support linker version x.x.x.x.x. Require GNU linker + 20050308/2.16.0 or newer for comdat group. + * configure: Regenerated. + * config.in: Regenerated. + * varasm.c (default_function_rodata_section): Put .rodata section in + COMDAT group when necessary. + (default_elf_asm_named_section): Rename HAVE_GAS_COMDAT_GROUP to + HAVE_COMDAT_GROUP. + (default_unique_section_1): Don't use .gnu.linkonce when COMDAT is + available. + +2005-05-08 Kazu Hirata + + * tree-dfa.c (referenced_vars, add_referenced_var): Use VEC + instead of VARRAY. + * tree-flow.h (num_referenced_var, referenced_var): Likewise. + * tree-into-ssa.c (mark_def_site_blocks): Likewise. + * tree-ssa.c (init_tree_ssa, delete_tree_ssa): Likewise. + * tree-tailcall.c (suitable_for_tail_opt_p): Likewise. + +2005-05-08 Stephane Carrez + + PR target/16925 + * config/m68hc11/m68hc11.c (m68hc11_gen_highpart): Handle split of + 64-bit constants on 64-bit hosts. + (m68hc11_split_logical): Simplify. + (m68hc11_split_move): Likewise. + +2005-05-08 Nathan Sidwell + Paolo Bonzini + + * Makefile.in (cs-tconfig.h): Pass USED_FOR_TARGET to mkconfig.sh + * aclocal.m4 (GCC_TARGET_TEMPLATE, AH_TEMPLATE): New. + * configure.ac (enable_checking): Fix typos in runtime_checking. + (ENABLE_RUNTIME_CHECKING): Mark as target template. + (xm_file): Prepend auto-host.h + (HAVE_GAS_HIDDEN, HAVE_LD_EH_FRAME_HDR): Mark as target template. + * mkconfig.sh: Do not automatically define USED_FOR_TARGET in + tconfig.h. + * crtstuff.c: Do not include auto-host.h. + (IN_LIBGCC2): Do not define. + * gcov-io.h: Include tconfig.h, not auto-host.h. + * libgcc2.c: Do not include auto-host.h. + (abort): Do not undefine. + * libgcov.c: Remove unneeded comment about config.h. + * unwind-dw2-fde-glibc.c: Do not inlude auto-host.h. + * config.in, configure: Regenerated. + +2005-05-08 Nathan Sidwell + Falk Hueffner + + * config/alpha/alpha.c (tls_symbolic_operand_1): Use gcc_assert + and gcc_unreachable as appropriate. + (get_aligned_mem, get_unaligned_address, + alpha_emit_set_long_const, alpha_emit_conditional_branch, + alpha_emit_setcc, alpha_emit_conditional_move, + alpha_lookup_xfloating_lib_func, alpha_compute_xfloating_mode_arg, + alpha_emit_xfloating_libcall, alpha_split_tfmode_pair, + alpha_expand_unaligned_load, alpha_expand_block_move, + alpha_expand_zap_mask, get_trap_mode_suffix, + get_round_mode_suffix, get_some_local_dynamic_name, + print_operand_address, function_arg, alpha_return_in_memory, + function_value, alpha_expand_builtin, + alpha_initial_elimination_offset, alpha_expand_epilogue, + summarize_insn, alpha_handle_trap_shadows, alphaev5_insn_pipe, + alphaev5_next_group, alpha_align_insns, + unicosmk_initial_elimination_offset, unicosmk_unique_section, + unicosmk_ssib_name): Likewise. + * config/alpha/alpha.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * config/alpha/unicosmk.h (TRAMPOLINE_TEMPLATE, + ASM_OUTPUT_ADDR_DIFF_ELT, ASM_OUTPUT_ADDR_DIFF_VEC): Likewise. + * config/alpha/vms.h (INITIAL_ELIMINATION_OFFSET, + ASM_OUTPUT_ADDR_DIFF_ELT): Likewise. + * config/alpha/alpha.md (*divmodsi_internal_er, + *divmoddi_internal_er, ashldi3, *insxl, sibcall, call_osf, + call_nt, call_umk, call_vms, call_value, sibcall_value, + call_value_osf, call_value_nt, call_value_vms, call_value_umk, + *call_vms_1, *movmemdi_1, *clrmemdi_1, *call_value_vms_1): Likewise. + * config/alpha/predicates.md (input_operand): Likewise. + +2005-05-08 Nathan Sidwell + + * config/frv/frv.c (frv_default_flags_for_cpu): Use gcc_assert and + gcc_unreachable, as appropriate. + (frv_function_prologue, frv_alloc_temp_reg, + frv_initial_elimination_offset, frv_expand_block_move, + frv_expand_block_clear, frv_print_operand_jump_hint, + frv_legitimize_tls_address, unspec_got_name, frv_emit_move, + frv_emit_movsi, frv_split_cond_move, frv_split_minmax, + frv_ifcvt_modify_insn, frv_ifcvt_modify_final, + frv_adjust_field_align, frv_insn_unit, frv_cond_flags, + frv_sort_insn_group, frv_reorder_packet, frv_matching_accg_mode, + frv_in_small_data_p, frv_asm_out_constructor, + frv_asm_out_destructor, frv_output_dwarf_dtprel): Likewise. + * config/frv/frv.md (reload_incc_fp, *cond_exec_si_binary1, + *cond_exec_si_binary2, *cond_exec_si_divide, *cond_exec_si_unary1, + *cond_exec_sf_conv, *cond_exec_sf_add, call, sibcall, call_value, + sibcall_value, casesi): Likewise. + + * config/mn10300/mn10300.c (print_operand): Use gcc_assert and + gcc_unreachable as appropriate. + (print_operand_address, mn10300_print_reg_list, expand_prologue, + expand_epilogue, notice_update_cc, initial_offset, + mn10300_address_cost_1): Likewise. + * config/mn10300/mn10300.md: Likewise. + (absdf2, abssf2, negdf2, negsf2): Likewise. + +2005-05-08 Richard Sandiford + + PR target/21416 + * config/mips/mips.c (mips_emit_compare): Don't reverse UNGE and UNGT + comparisons. + * config/mips/mips.md (swapped_fcond): New code macro and attribute. + (sgt_, sge_): Generalize to all members of swapped_fcond, + including sunge_ and sungt_. + +2005-05-08 Richard Sandiford + + * integrate.h (get_hard_reg_initial_val): Change type of register + parameter from int to unsigned int. + (has_hard_reg_initial_val): Likewise. + * integrate.c (get_hard_reg_initial_val): Likewise. + (has_hard_reg_initial_val): Likewise. Remove cast to unsigned int. + +2005-05-08 Kazu Hirata + + * except.c (eh_status): Change the type of ttype_data to + VEC(tree,gc)*. + (add_ttypes_entry, assign_filter_values, + output_function_exception_table): Use VEC instead of VARRAY. + +2005-05-07 David Edelsohn + + * config/rs6000/rs6000.md (popcount2): Fix non-C90 constant. + +2005-05-07 Paul Brook + + * Makefile.in: Fix dependencies. + (GCOV_IO_H, VARRAY_H): Set. + +2005-05-07 Anthony Green + + PR bootstrap/21403 + * configure.ac (STMP_FIXPROTO): Fix [ ] consumption problem in + x$STMP_FIXPROTO test. + * configure: Rebuilt. + +2005-05-07 Joseph S. Myers + + * config/pa/pa-hpux11.h (TARGET_OS_CPP_BUILTINS): Do not define + inappropriate feature test macros if flag_iso. + +2005-05-07 Joseph S. Myers + + * config/ia64/hpux.h (NO_IMPLICIT_EXTERN_C): Define. + +2005-05-07 Hans-Peter Nilsson + + PR target/21441 + * config/cris/cris.md ("*movdi_insn", "*mov_sidesisf_biap") + ("*mov_sidesisf", "*mov_sidesisf_biap_mem", "*mov_sidesisf_mem"): + Handle moved operand being in special register. + ("smulsi3_highpart", "umulsi3_highpart"): Change .error into + presumed working insn. + (mover2side): Add FIXME. + +2005-05-07 Richard Sandiford + + * integrate.c (get_func_hard_reg_initial_val): Delete. + (has_func_hard_reg_initial_val): Delete. + (get_hard_reg_initial_val): Inline the old implementation of + get_func_hard_reg_initial_val. Use has_hard_reg_initial_val + instead of has_func_hard_reg_initial_val to test for an existing + pseudo. Only create an rtx if a new initial value entry is needed. + (has_hard_reg_initial_val): Scan the initial value list directly. + Don't create an rtx. + +2005-05-07 David Edelsohn + + * config.gcc ({powerpc,rs6000}-ibm-aix*): Remove rs6000/aix.opt + from extra_options. + * config.in (HAVE_AS_POPCNTB): New. + * configure.ac (HAVE_AS_MFCRF): Add .machine "pwr5" to AIX test. + (HAVE_AS_POPCNTB): New. + * configure: Regenerated. + * config/rs6000/aix.h (TARGET_XL_COMPAT): Delete. + * config/rs6000/rs6000.c (rs6000_override_options, power5): Add + MASK_POPCNTB. Uncomment rs6000_sched_restricted_insns_priority + and rs6000_sched_costly_dep. + * config/rs6000/rs6000.h (TARGET_POPCNTB): New. + (TARGET_XL_COMPAT): Delete. + * config/rs6000/rs6000.md (UNSPEC_POPCNTB): New. + (popcount2): New. + (popcntb2): New. + * config/rs6000/rs6000.opt (mpopcntb): New. + + * opt-functions.awk (var_set): Emit OPTION_MASK_ for InverseMask + if variable name exists. + +2005-05-07 Matt Kraai + + * Makefile.in (c-gimplify.o): Depend on $(RTL_H) instead of rtl.h. + +2005-05-07 Richard Henderson + + PR target/21412 + * config/rs6000/rs6000.c (rs6000_emit_move): Look for tls addresses + with constant offsets. + +2005-05-07 Nathan Sidwell + + * config/v850/v850.c (print_operand): Use gcc_assert and + gcc_unreachable, as appropriate. + (print_operand_address, v850_handle_data_area_attribute, + v850_encode_data_area, construct_restore_jr, construct_save_jarl, + v850_insert_attributes, construct_prepare_instruction): Likewise. + * config/v850/v850.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * config/v850/v850.md (movsicc, *sasf_1): Likewise. + +2005-05-07 Kazu Hirata + + * tree-ssa-loop-ivcanon.c, config/i386/i386.c, + config/rs6000/rs6000.h: Fix comment typos. + +2005-05-07 Richard Sandiford + + * doc/invoke.texi: Remove documentation for MIPS' -mint64 option. + * config/mips/mips.c (TARGET_SCALAR_MODE_SUPPORTED_P): Delete. + (mips_scalar_mode_supported_p): Delete. + +2005-05-06 Eric Christopher + + * config/mips/mips.opt: Remove -mint64 option. + * config/mips/mips.c (override_options): Remove -mint64 + handling. + * config/mips/mips.h (INT_TYPE_SIZE): Define to 32. + * config/mips/linux.h (TARGET_OS_CPP_BUILTINS): Remove + 64-bit integer handling. + * doc/invoke.texi (Option Summary): Remove -mint64 for + mips. + +2005-05-06 Zdenek Dvorak + + PR tree-optimization/19401 + * tree-flow.h (tree_unroll_loops_completely): Declaration changed. + * tree-ssa-loop-ivcanon.c (enum unroll_level): New. + (estimated_unrolled_size): New function. + (try_unroll_loop_completely, canonicalize_loop_induction_variables, + tree_unroll_loops_completely): Always unroll loops if the code size + does not increase. + * tree-ssa-loop.c (tree_complete_unroll): Indicate whether all + loops should be unrolled completely. + (gate_tree_complete_unroll): Run complete unrolling unconditionally. + +2005-05-06 Zdenek Dvorak + + PR rtl-optimization/21254 + * loop-iv.c (iv_number_of_iterations): Simplify infiniteness + assumptions for loops that otherwise do not roll. + (find_simple_exit): Prefer # of iterations that is guaranteed + not to be infinite. + * loop-unroll.c (decide_peel_once_rolling, + decide_peel_completely): Check whether the loop is infinite. + +2005-05-06 Pat Haugen + + * config/rs6000/sysv4.opt: Fix typo. + +2005-05-06 Denis Vlasenko + Jakub Jelinek + + PR target/21329 + * config/i386/i386.c (ix86_expand_movmem): Don't use rep; movsb + for -Os if (movsl;)*(movsw;)?(movsb;)? sequence is shorter. + Don't use rep; movs{l,q} if the repetition count is really small, + instead use a sequence of movs{l,q} instructions. + +2005-05-06 Jeff Law + + PR tree-optimization/21380 + * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not + thread through a block with no preds. + +2005-05-06 Kazu Hirata + + * tree-ssa-operands.c (clobbered_v_may_defs, clobbered_vuses, + ro_call_vuse, fini_ssa_operands, add_call_clobber_ops, + add_call_read_ops): Use VEC instead of VARRAY. + +2005-05-06 Nathan Sidwell + + * config/mcore/mcore.c (mcore_print_operand_address): Use + gcc_assert and gcc_unreachable as appropriate. + (mcore_print_operand, mcore_gen_compare_reg, mcore_output_call, + mcore_output_andn, output_inline_const, mcore_output_move, + mcore_output_movedouble, mcore_expand_block_move, + layout_mcore_frame, mcore_initial_elimination_offset, + mcore_expand_prolog, mcore_mark_dllexport, + mcore_mark_dllimport): Likewise. + * config/mcore/mcore.h (switch_to_section): Likewise. + * config/mcore/mcore.md: Likewise. + +2005-05-06 Aldy Hernandez + + * config/rs6000/linux64.h: Remove MASK_PROFILE_KERNEL, and + TARGET_PROFILE_KERNEL. + + * config/rs6000/rs6000.c (output_profile_hook): Add comment to + TARGET_PROFILE_KERNEL use. + +2005-05-06 Nathan Sidwell + + * config/m32r/m32r.c (m32r_encode_section_info): Use gcc_assert + and gcc_unreachable, as appropriate. + (gen_compare, gen_split_move_double, m32r_setup_incoming_varargs, + m32r_expand_prologue, m32r_output_function_epilogue, + m32r_legitimize_pic_address, m32r_print_operand_address, + emit_cond_move, m32r_function_symbol, + m32r_output_block_move): Likewise. + * config/m32r/m32r.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * config/m32r/m32r.md ( *movsi_insn, *zero_branch_insn, + *rev_zero_branch_insn): Likewise. + +2005-05-06 Jakub Jelinek + + PR c++/20961 + * varasm.c (merge_weak): Remove NEWDECL from WEAK_DECLS chain + if both NEWDECL and OLDDECL are already weak. + +2005-05-06 Richard Sandiford + + * config/rs6000/sysv4.h (EXTRA_SUBTARGET_SWITCHES): Delete. + +2005-05-05 J"orn Rennecke + Kaz Kojima + + * config/sh/sh.c (sh_builtin_saveregs): Use copy_to_mode_reg + and plus_constant. + +2005-05-05 Aldy Hernandez + David Edelsohn + + * config.gcc: Add .opt magic for the rs6000 ports. + + * doc/invoke.texi: Document -mabi= option properly. Document + -misel and -mno-sel. Document -mspe and -mno-spe. Document + -mvrsave and -mno-vrsave. Document deprecation of -mspe= and + -misel=. + + * config/rs6000/aix.h: Remove XL_COMPAT stuff. Remove + SUBTARGET_SWITCHES and SUBSUBTARGET_SWITCHES. Define + TARGET_XL_COMPAT. + + * config/rs6000/aix.opt: New. + * config/rs6000/aix41.opt: New. + * config/rs6000/aix64.opt: New. + * config/rs6000/darwin.opt: New. + * config/rs6000/linux64.opt: New. + * config/rs6000/rs6000.opt: New. + * config/rs6000/sysv4.opt: New. + + * config/rs6000/sysv4.h: Delete definitions of MASK_* and + associated TARGET_*. Remove SUBTARGET_OPTIONS, + SUBTARGET_SWITCHES. + Define TARGET_USES_SYSV4_OPT. + * config/rs6000/aix41.h: Remove SUBSUBTARGET_SWITCHES. + * config/rs6000/aix43.h: Remove SUBSUBTARGET_SWITCHES. Define + TARGET_USES_AIX64_OPT. + * config/rs6000/aix51.h: Same. + * config/rs6000/aix52.h: Same. + * config/rs6000/darwin.h: Remove SUBTARGET_SWITCHES, + MASK_MACHO_DYNAMIC_NO_PIC, TARGET_MACHO_DYNAMIC_NO_PIC. + Use TARGET_ALTIVEC_VRSAVE instead of rs6000_altivec_vrsave. + Define TARGET_DYNAMIC_NO_PIC as TARGET_MACHO_DYNAMIC_NO_PIC. + * config/rs6000/linux64.h: Use + rs6000_explicit_options. Remove EXTRA_SUBTARGET_SWITCHES. + + * config/rs6000/rs6000.c: Remove definitions of + rs6000_sched_restricted_insns_priority, + rs6000_long_double_size_string, rs6000_altivec_vrsave, + rs6000_altivec_vrsave_string, rs6000_isel, rs6000_spe, + rs6000_float_gprs_string, rs6000_isel_string, rs6000_spe_string, + rs6000_abi_string, rs6000_warn_altivec_long, rs6000_longcall, + rs6000_alignment_string. Define rs6000_explicit_options. + (rs6000_parse_abi_options): Remove. + (rs6000_parse_alignment_option): Remove. + (rs6000_parse_float_gprs_option): Remove. + (rs6000_handle_option): New. Define TARGET_HANDLE_OPTION. Define + TARGET_DEFAULT_TARGET_FLAGS. + (rs6000_override_options): Revamp to use new .opt machinery. + + * config/rs6000/rs6000.h: Remove old MASK_* and TARGET_* in favor + of new .opt machinery. Remove target_flags. Redefine + TARGET_MFCRF and TARGET_POWERPC64. Remove TARGET_SWITCHES, + SUBTARGET_SWITCHES, TARGET_OPTIONS, SUBTARGET_OPTIONS, + rs6000_float_gprs_string, rs6000_isel_string, rs6000_spe_string, + rs6000_altivec_vrsave_string, rs6000_altivec_vrsave, + rs6000_longcall_switch, rs6000_default_long_calls, + rs6000_sched_costly_dep_str, rs6000_sched_costly_dep, + rs6000_warn_altivec_long, rs6000_warn_altivec_long_switch, and + TARGET_ALTIVEC_VRSAVE. + +2005-05-05 Ralf Corsepius + + * config.gcc (hppa1.1-*-rtems*): Remove. + * config/pa/rtems.h: Remove. + +2005-05-05 Ralf Corsepius + + * config/rs6000/t-rtems (MULTILIB_NEW_EXCEPTIONS_ONLY): + Exclude roe/603e multilib variants. + +2005-05-04 Denis Chertykov + + PR target/21284 + * config/avr/avr.c (avr_output_addr_vec_elt): Use special section + for output. + +2005-05-05 Richard Sandiford + + * config.gcc (arm*-wince-pe*, arm-*-pe*, strongarm-*-pe): Add + arm/pe.opt to $extra_options. + * config/arm/arm.h (target_flags, target_fpu_name, target_fpe_name) + (target_float_abi_name, target_float_switch, target_abi_name) + (ARM_FLAG_APCS_FRAME, ARM_FLAG_POKE, ARM_FLAG_FPE, ARM_FLAG_APCS_STACK) + (ARM_FLAG_APCS_FLOAT, ARM_FLAG_APCS_REENT, ARM_FLAG_BIG_END) + (ARM_FLAG_INTERWORK, ARM_FLAG_LITTLE_WORDS, ARM_FLAG_NO_SCHED_PRO) + (ARM_FLAG_ABORT_NORETURN, ARM_FLAG_SINGLE_PIC_BASE) + (ARM_FLAG_LONG_CALLS, ARM_FLAG_THUMB, THUMB_FLAG_BACKTRACE) + (THUMB_FLAG_LEAF_BACKTRACE, THUMB_FLAG_CALLEE_SUPER_INTERWORKING) + (THUMB_FLAG_CALLER_SUPER_INTERWORKING, CIRRUS_FIX_INVALID_INSNS) + (TARGET_APCS_FRAME, TARGET_POKE_FUNCTION_NAME, TARGET_FPE) + (TARGET_APCS_STACK, TARGET_APCS_FLOAT, TARGET_APCS_REENT) + (TARGET_BIG_END, TARGET_INTERWORK, TARGET_LITTLE_WORDS) + (TARGET_NO_SCHED_PRO, TARGET_ABORT_NORETURN, TARGET_SINGLE_PIC_BASE) + (TARGET_LONG_CALLS, TARGET_THUMB, TARGET_CALLER_INTERWORKING) + (TARGET_CIRRUS_FIX_INVALID_INSNS, SUBTARGET_SWITCHES, TARGET_SWITCHES) + (TARGET_OPTIONS, arm_cpu_select, arm_select, structure_size_string) + (arm_pic_register_string): Delete. + (TARGET_BACKTRACE): Redefine using TARGET_TPCS_LEAF_FRAME and + TARGET_TPCS_FRAME. + (TARGET_DEFAULT, CONDITIONAL_REGISTER_USAGE): Update mask names. + * config/arm/coff.h (TARGET_DEFAULT): Likewise. + * config/arm/elf.h (TARGET_DEFAULT): Likewise. + * config/arm/netbsd-elf.h (TARGET_DEFAULT): Likewise. + * config/arm/netbsd.h (TARGET_DEFAULT): Likewise. + * config/arm/semi.h (TARGET_DEFAULT): Likewise. + * config/arm/uclinux-elf.h (TARGET_DEFAULT): Likewise. + * config/arm/wince-pe.h (TARGET_DEFAULT): Likewise. + * config/arm/pe.h (TARGET_DEFAULT): Likewise. + (TARGET_FLAG_NOP_FUN, TARGET_NOP_FUN_DLLIMPORT): Delete. + (SUBTARGET_SWITCHES): Delete. + * config/arm/arm.c (target_float_switch): Delete. + (arm_cpu_select): Moved from config/arm/arm.h. + (target_fpu_name, target_fpe_name, target_float_abi_name) + (target_abi_name, structure_size_string, arm_pic_register_string) + (arm_select): Make static. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (arm_handle_option): New function. + (arm_override_options): Update target_flags checks for new mask names. + Remove target_float_switch code. + (arm_expand_prologue, thumb_expand_prologue): Check + !TARGET_SCHED_PROLOG instead of TARGET_NO_SCHED_PRO. + * config/arm/arm.opt, config/arm/pe.opt: New files. + +2005-05-05 Nathan Sidwell + + * config/arc/arc.c (get_arc_condition_code): Use gcc_assert & + gcc_unreachable as appropriate. + (arc_double_limm_p, arc_setup_incoming_varargs, + arc_compute_function_type, arc_output_function_prologue, + arc_output_function_epilogue, arc_eligible_for_epilogue_delay, + output_shift, arc_print_operand, arc_print_operand_address, + arc_final_prescan_insn): Likewise. + * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. + +2005-05-04 Geoffrey Keating + + * config/rs6000/rs6000.md (P): Use TARGET_*BIT rather than + comparing Pmode. + (SDI): New. + (cmp): Delete. + (wd): New. + (add3, add3_internal1, add3_internal2, + add3_internal3, one_cmpl2, sub3, neg2, + clz2, ctz2, ffs2): New. + (addsi3, addsi3_internal1, addsi3_internal2, addsi3_internal3, + (one_cmplsi2, subsi3, negsi2, clzsi2, ctzsi2, ffssi2): Remove. + (adddi3, adddi3_internal1, adddi3_internal2, adddi3_internal3, + (one_cmpldi2, subdi3, negdi2, clzdi2, ctzdi2, ffsdi2): Remove. + (sync_compare_and_swap): Use rather than . + +2005-05-05 Paul Brook + + * Makefile.in: Replace dependencies on basic-block.h, c-pragma.h, + cfgloop.h, diagnostic.h, insn-attr.h, langhooks-def.h, params.h, + regs.h, system.h, tree-dump.h, tree-gimple.h, tree-scalar-evolution.h + and tree-data-ref.h with *_H variables. + +2005-05-05 Kelley Cook + + * config/m32r/xm-m32r.h, config/m32r/xm-linux.h: Delete files. + +2005-05-05 Kelley Cook + + * system.h: Poison BYTEORDER and HOST_WORDS_BIG_ENDIAN. + +2005-05-04 Gerald Pfeifer + + * doc/contrib.texi (Contributors): Add Mostafa Hagog and Ayal Zaks. + +2005-05-04 Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Emit + setting of vrsave register for current function after + call to save_world is emitted. + +2005-05-05 Hans-Peter Nilsson + + * config/mmix/predicates.md: New file. + * config/mmix/mmix.c (mmix_symbolic_or_address_operand) + (mmix_reg_or_constant_operand, mmix_reg_cc_operand) + (mmix_foldable_comparison_operator, mmix_comparison_operator) + (mmix_reg_or_0_operand, mmix_reg_or_8bit_operand): Remove. + * config/mmix/mmix.h (PREDICATE_CODES, SPECIAL_MODE_PREDICATES): + Don't define. + * config/mmix/mmix.md: Include predicates.md. + ("call", "call_value"): Force address to register if it isn't a + mmix_symbolic_or_address_operand. + +2005-05-04 Andrew MacLeod + + * tree-flow-inline.h (op_iter_init_use, op_iter_init_def): Assert that + the flags are of appropriate types. + (num_ssa_operands): Generalize using the generic interface. + * tree-ssa-dce.c (remove_dead_stmt): Don't ask for kills on a DEF + iterator. + +2005-05-04 Richard Sandiford + + * protoize.c (version_flag, quiet_flag, nochange_flag, nosave_flag) + (keep_flag, local_flag, global_flag, cplusplus_flag): Make extern. + +2005-05-04 Kazu Hirata + + * tree-outof-ssa.c (edge_leader, stmt_list, + analyze_edges_for_bb): Use VEC instead of VARRAY. + (init_analayze_edges_for_bb, fini_analayze_edges_for_bb): New. + (perform_edge_inserts): Call init_analayze_edges_for_bb and + fini_analayze_edges_for_bb. + +2005-05-04 James E Wilson + + PR driver/21112 + * gcc.c (process_command): In the second argv scan loop, ignore + Xassembler and Xpreprocessor, along with their argument. + +2005-05-04 Kazu Hirata + + * tree-flow-inline.h, tree-ssa-operands.c, + tree-ssa-operands.h, tree-ssa-opfinalize.h: + Likewise. tree-vn.c: Fix comment typos. + * doc/passes.texi, doc/tree-ssa.texi: Fix typos. + +2005-05-04 Paolo Bonzini + + * doc/tm.texi (Target Hooks): Document + TARGET_RESOLVE_OVERLOADED_BUILTIN. + +2005-05-04 Paul Brook + + * Makefile.in: Change dependencies on target.h to $(TARGET_H). + +2005-05-04 Kazu Hirata + + * dwarf2out.c (incomplete_types, retry_incomplete_types, + gen_struct_or_union_type_die, dwarf2out_init): Use VEC instead + of VARRAY. + + * loop-unroll.c (var_to_expand, analyze_insn_to_expand_var, + get_expansion, expand_var_during_unrolling, + insert_var_expansion_initialization, + combine_var_copies_in_loop_exit, release_var_copies): Use VEC + instead of VARRAY. + + * tree-ssa-loop-ivopts.c (rewrite_address_base): Don't call + update_stmt. + +2004-05-03 Andrew Pinski + + PR middle-end/15618 + * fold-const.c (fold_widened_comparison): Treat BOOLEAN_TYPE + the same as INTEGER_TYPE. + (fold_binary): Fold "bool_var != 0" to bool_var. + Fold "bool_var == 1" to bool_var. + +2004-05-03 Richard Henderson + + PR middle-end/21318 + * function.c (instantiate_virtual_regs_in_insn): Use the mode + from recog_data instead of insn_data. + +2005-05-03 DJ Delorie + + * common.opt (fdiagnostics-show-option): No variable is needed. + * diagnostic.h (diagnostic_context): Add show_option_requested flag. + * diagnostic.c (diagnostic_initialize): Initialize show_option_requested. + (diagnostic_report_diagnostic): Test for enabled diagnostics here. + Save and restore original message format. Use flag in context + instead of global. + (warning): Don't test for enabled warnings here. + * opts.c (common_handle_option): Handle -fdiagnostics-show-option + here. + +2005-05-04 Kelley Cook + + * config/m32r/xm-m32r.h: Don't define HOST_WORDS_BIG_ENDIAN. + * config/m32r/xm-linux.h: Don't undefine HOST_WORDS_BIG_ENDIAN. + * mips-tfile.c: Use WORDS_BIG_ENDIAN instead of HOST_WORDS_BIG_ENDIAN. + * aclocal.m4: Don't include accross.m4. + * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. + Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. + * configure, config.in: Regenerate. + +2005-05-04 Jakub Jelinek + + PR middle-end/21265 + * expr.h (enum block_op_methods): Add BLOCK_OP_TAILCALL. + (clear_storage): Add argument. + * expr.c (emit_block_move_via_libcall, clear_storage_via_libcall): + Add tailcall argument, set CALL_EXPR_TAILCALL of the CALL_EXPR to + tailcall. + (emit_block_move): Handle BLOCK_OP_TAILCALL method. + (clear_storage): Add method argument, handle BLOCK_OP_TAILCALL. + (store_expr, store_constructor): Adjust callers. + * builtins.c (expand_builtin_memcpy): Pass BLOCK_OP_TAILCALL + to emit_block_move if CALL_EXPR_TAILCALL (exp). + (expand_builtin_memmove): Add ORIG_EXP argument, copy + CALL_EXPR_TAILCALL from ORIG_EXP to the new CALL_EXPR. + (expand_builtin_bcopy): Replace ARGLIST and TYPE arguments + with EXP. Pass EXP to expand_builtin_memmove. + (expand_builtin_memset): Add ORIG_EXP argument, pass + BLOCK_OP_TAILCALL to clear_storage if CALL_EXPR_TAILCALL (orig_exp). + (expand_builtin_bzero): Replace ARGLIST argument with EXP. + Pass EXP to expand_builtin_memset. + (expand_builtin_strcmp): Copy CALL_EXPR_TAILCALL from EXP to + the new CALL_EXPR. + (expand_builtin_strncmp): Likewise. + (expand_builtin_printf): Replace ARGLIST argument with EXP. + Copy CALL_EXPR_TAILCALL from EXP to the new CALL_EXPR. + (expand_builtin_fprintf): Likewise. + (expand_builtin): Adjust calls to + expand_builtin_{memmove,bcopy,memset,bzero,{,f}printf}. + + * config/i386/i386.c (ix86_expand_vector_set): Fix setting 3rd and 4th + item in V4SF mode. + + PR rtl-optimization/21239 + * combine.c (combine_simplify_rtx) : Fix a typo. + +2005-05-03 Kazu Hirata + + * tree-flow.h (tree_ann_common_d): Move aux to ... + (stmt_ann_d): ... here. + * tree-ssa-loop-im.c (LIM_DATA, determine_invariantness_stmt, + move_computations_stmt, schedule_sm): Update references to + aux. + * tree-vectorizer.h (set_stmt_info, vinfo_for_stmt): Likewise. + + * tree-cfg.c (remove_bb): Remove a redundant call to + set_bb_for_stmt. + * tree-if-conv.c (replace_phi_with_cond_modify_expr): + Likewise. + +2005-05-03 Richard Henderson + + * config/rs6000/rs6000.c: Remove conflict markers. + + * cfg.c (dump_flow_info): Use max_reg_num, not max_regno. + +2005-05-03 James E Wilson + + * dwarf2out.c (lookup_filename): Call maybe_emit_file. + +2005-05-03 DJ Delorie + + * c-decl.c (store_parm_decls_oldstyle): Let diagnostic machinery + decide if the warning will be printed. + * calls.c (expand_call): Likewise. + * function.c (init-function_start): Likewise. + + * common.opt (-fdiagnostics-show-option): New. + * opts.c (option_enabled): Accept the option index instead of a + pointer to the option descriptor. + * opts.h (option_enabled): Likewise. + * toplev.c (print_switch_values): Pass option index, not option + descriptor. + * diagnostic.h (diagnostic_info): Add option_index. + * diagnostic.c: Include opts.h. + (diagnostic_set_info): Initialize option_index. + (diagnostic_report_diagnostic): Amend option name if appropriate. + (warning): Check to see if the specified warning is enabled. + Store option index. + * doc/invoke.texi (-fdiagnostics-show-options): Document. + +2005-05-03 Richard Henderson + + * config/rs6000/rs6000.h (REG_CLASS_CONTENTS): Fix ALL_REGS and + SPEC_OR_GEN_REGS definitions. + +2005-05-03 Alexandre Oliva + + PR target/16888 + * config/i386/i386.h (CONDITIONAL_REGISTER_USAGE): Clear reg names + for unavailable registers. + +2005-05-03 Kazu Hirata + + * tree-cfg.c (tree_forwarder_block_p): Fix a typo. + + * cfglayout.c (block_locators_blocks, + insn_locators_initialize, insn_scope): Use VEC instead of + VARRAY. + + * tree-mudflap.c (deferred_static_decls, mudflap_enqueue_decl, + mudflap_finish_file, mudflap_finish_file): Use VEC instead of + VARRAY. + +2005-05-03 Eric Botcazou + + * config/sparc/predicates.md (const_compl_high_operand): New. + * config/sparc/sparc.c (sparc_emit_set_safe_HIGH64): Rename into + gen_safe_HIGH64. + (sparc_emit_set_const64_quick1): Adjust for above change. + (sparc_emit_set_const64_quick2): Likewise. + (sparc_emit_set_const64_longway): Likewise. + (sparc_emit_set_const64): Likewise. + * config/sparc/sparc.md (movhi_const64_special, movsi_const64_special, + movdi_const64_special): Delete. + (logical constant splitters): Use const_compl_high_operand. + +2005-05-03 Richard Guenther + + * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Use STRIP_TYPE_NOPS + rather than STRIP_NOPS. + +2005-05-03 Jakub Jelinek + + PR rtl-optimization/21330 + * loop-unswitch.c (may_unswitch_on): Set *cinsn only when + returning non-NULL. + (unswitch_single_loop): Clear cinsn when retrying. + + PR target/21297 + * config/i386/i386.c (legitimize_address): When canonicalizing + ASHIFT into MULT, multiply by 1 << shift_count instead of + 1 << log2 (shift_count). + +2005-05-03 Andrew MacLeod + + * lambda-code.c (gcc_loop_to_lambda_loop, + lambda_loopnest_to_gcc_loopnest, phi_loop_edge_uses_def, + stmt_is_bumper_for_loop, perfect_nest_p, replace_uses_of_x_with_y): Use + generic operand interface. + * tree-data-ref.c (find_data_references_in_loop): Use generic interface. + * tree-dfa.c (collect_dfa_stats_r, mark_new_vars_to_rename): Use + generic operand interface. + * tree-flow-inline.h (delink_imm_use, link_imm_use_to_list, + link_imm_use, link_imm_use_stmt, relink_imm_use, relink_imm_use_stmt, + next_safe_imm_use, has_zero_uses, has_single_use, single_imm_use, + num_imm_uses): Use ssa_use_operand_t. + (get_def_ops, get_use_ops, get_v_may_def_ops, get_vuse_ops, + get_v_must_def_ops): Delete. + (get_def_from_ptr, get_phi_result_ptr): Get def directly now. + (get_use_op_ptr, get_def_op_ptr, get_v_may_def_result_ptr, + get_v_may_def_op_ptr, get_vuse_op_ptr, get_v_must_def_result_ptr, + get_v_must_def_kill_ptr): Delete. + (delink_stmt_imm_use): Move and use new operand interface. + (op_iter_next_use, op_iter_next_def, op_iter_next_tree, op_iter_init, + op_iter_next_tree): Use new operand implementation. + (clear_and_done_ssa_iter): New. Initialize a blank operand iterator. + (op_iter_init_use, op_iter_init_def, op_iter_init_tree): Add iterator + type check. + (op_iter_next_mustdef, op_iter_next_maydef, + op_iter_next_must_and_may_def): Delete. Replace with... + (op_iter_next_maymustdef): New. Combine must and may next operations. + (op_iter_init_maydef, op_iter_init_mustdef, + op_iter_init_must_and_may_def): Use new interface. + (single_ssa_tree_operand ): New. Process single operands only as trees. + (single_ssa_use_operand): New. Process single operands only as uses. + (single_ssa_def_operand): New. Process single operands only as defs. + (zero_ssa_operands): New. Return TRUE if there are zero operands of the + specified types. + (num_ssa_operands): New. Count the number of specified operands. + (compare_ssa_operands_equal): New. Compare two statements' operands. + (single_phi_def): New. Return true if PHI has one def of the specified + operand type. + (op_iter_init_phiuse): New. Initialize the iterator for PHI arguments. + (op_iter_init_phidef): New. Initialize the iterator for the PHI def. + * tree-flow.h (struct immediate_use_iterator_d): Use ssa_use_operand_t. + (struct stmt_ann_d): Operands field no longer require GTY(). + (vn_compute, vn_lookup_or_add, vn_add, vn_lookup): Change prototype. + * tree-into-ssa.c (mark_def_sites): Use SSA_OP_VMUSTKILL. + * tree-outof-ssa.c (check_replaceable, find_replaceable_in_bb, + dump_replaceable_exprs, rewrite_trees): Use generic interface. + * tree-phinodes.c (make_phi_node, release_phi_node, resize_phi_node): + Use use_operand_p instead of ssa_imm_use_t *. + * tree-pretty-print.c (dump_vops): check if operands are active before + dumping virtual operands. + * tree-sra.c (sra_walk_function): Use ZERO_SSA_OPERANDS. + * tree-ssa-ccp.c (likely_value): Use ZERO_SSA_OPERANDS. + (ccp_fold): Use new interface. + (ccp_visit_stmt): Remove unused variables and code. + (convert_to_gimple_builtin): Insert statements before calling + mark_new_vars_to_rename. + * tree-ssa-copy.c (stmt_may_generate_copy): Use ZERO_SSA_OPERANDS. + (copy_prop_visit_cond_stmt): Use generic interface. + * tree-ssa-dom.c (struct expr_hash_elt): Use stmt pointer, not the + annotation in table. + (thread_across_edge): Use generic interface. + (initialize_hash_element): Initialzie with stmt, not annotation. + (eliminate_redundant_computations): Use generic interface. + (record_equivalences_from_stmt): Pass stmt, not annotation. + (avail_expr_hash, real_avail_expr_hash, avail_expr_eq): Use generic + interface. + * tree-ssa-dse.c (dse_optimize_stmt): Use ZERO_SSA_OPERANDS. + * tree-ssa-loop-ivopts.c (find_invariants_stmt, + find_interesting_uses_stmt, protect_loop_closed_ssa_form_use): Use + generic operand interface. + * tree-ssa-loop-niter.c (chain_of_csts_start, get_val_for): Use generic + interface. + * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Use Generic operand + Interface. + * tree-ssa-operands.c (struct opbuild_list_d): New. Operand build type. + (build_defs, build_uses, build_v_may_defs, build_vuses, + build_v_must_defs): Change type to struct opbuild_list_d. + (ops_active): New. Operands active boolean. + (operand_memory, operand_memory_index): New. Operand memory managers. + (allocate_def_optype, allocate_use_optype, allocate_v_may_def_optype, + allocate_vuse_optype, allocate_v_must_def_optype): Delete. + (free_uses, free_defs, free_vuses, free_v_may_defs, free_v_must_defs): + Change from functions to static variable list heads. + (opbuild_initialize_virtual): New. Initialize a virtual build list. + (opbuild_initialize_real): New. Initialize a virtual build list. + (opbuild_free): New. Free a build list. + (opbuild_num_elems): New. Number of items in a list. + (opbuild_append_real): New. Add a real (tree *) operand. + (opbuild_append_virtual): New. Add and sort a virtual (tree) operand. + (opbuild_first): New. Return first element index in a list. + (opbuild_next): New. Return next element in a list. + (opbuild_elem_real): New. Return real element. + (opbuild_elem_virtual): New. Return virtual element. + (opbuild_elem_uid): New. Return UID of virtual element. + (opbuild_clear): New. Reset an operand list. + (opbuild_remove_elem): New. Remove an element form a list. + (ssa_operands_active): New. Return true if operand cache is active. + (init_ssa_operands, fini_ssa_operands): Initialize new implementation. + (ssa_operand_alloc): New. Allocate memory from an operand chunk. + (correct_use_link): Use use_operand_p. + (finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_defs, + finalize_ssa_vuses, finalize_ssa_v_must_defs): New implmentation. + (cleanup_v_may_defs): Use new implmentation. + (finalize_ssa_stmt_operands, start_ssa_stmt_operands): New + implementation. + (append_def, append_use, append_v_may_def, append_vuse, + append_v_must_def): Call opbuild_append routine instead of using varray. + (build_ssa_operands): Simplify to simply use stmt, don't maintain a + global parse_old_ops variable. + (free_ssa_operands): New implementation. + (update_stmt_operands): Move. Change argument to build_ssa_operands. + (copy_virtual_operands): Move. New generic implementation. + (create_ssa_artficial_load_stmt): Move. New implementation. + (swap_tree_operands): Update for new implementation. + (get_expr_operands): Add stmt parameter to calls to swap_tree_operands. + (add_call_clobber_ops, add_call_read_ops): Initialize opbuild list + rather than a varray. + (verify_imm_links): Use use_operand_p. + (dump_immediate_uses_for): If the immediate use variable is a virtual + variable, show the virtual ops in the stmt. + * tree-ssa-operands.h (def_operand_p): No longer a structure. + (NULL_DEF_OPERAND_P): Now a #define. + (def_optype_d, use_optype_d, v_def_use_operand_type, v_may_def_optype_d, + vuse_operand_type, vuse_optype_d, v_must_def_optype_d): Delete. + (def_optype_d, use_optype_d, maydef_optype_d, vuse_optype_d, + mustdef_optype_d): New. Use Linked list representation. + (SSA_OPERAND_MEMORY_SIZE): New. Size of operand memory chunk. + (struct ssa_operand_memory_d): New. Allocated Chunk node. + (struct stmt_operands_d): Change to new pointers that are not GTY. + (STMT_USE_OPS, NUM_USES, SET_USE_OP, STMT_DEF_OPS, NUM_DEFS, SET_DEF_OP, + STMT_V_MAY_DEF_OPS, NUM_V_MAY_DEFS, SET_V_MAY_DEF_RESULT, + SET_V_MAY_DEF_OP, STMT_VUSE_OPS, NUM_VUSES, SET_VUSE_OP, + STMT_V_MUST_DEF_OPS, NUM_V_MUST_DEFS, SET_V_MUST_DEF_RESULT, + SET_V_MUST_DEF_KILL): Delete. + (V_MAY_DEF_OPS, V_MAY_DEF_RESULT_PTR, V_MAY_DEF_RESULT, + V_MAY_DEF_OP_PTR, V_MAY_DEF_OP): Rename to MAYDEF_*. + (V_MUST_DEF_OPS, V_MUST_DEF_RESULT_PTR, V_MUST_DEF_RESULT, + V_MUST_DEF_KILL_PTR, V_MUST_DEF_KILL): Rename to MUSTDEF_*. + (enum ssa_op_iter_type): Operand iterator typechecking values. + (struct ssa_operand_iterator_d): Use linked lists of operands. + (SSA_OP_VMUSTDEFKILL): Rename to SSA_OP_VMUSTKILL. + (FOR_EACH_SSA_MAYDEF_OPERAND, FOR_EACH_SSA_MUSTDEF_OPERAND, + FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): Use op_iter_next_maymustdef. + (FOR_EACH_PHI_ARG): New. Iterate over PHI arguments. + (FOR_EACH_PHI_OR_STMT_USE): New. Iterate over PHI or stmt uses. + (FOR_EACH_PHI_OR_STMT_DEF): New. Iterate over PHI or stmt defs. + (SINGLE_SSA_TREE_OPERAND, SINGLE_SSA_USE_OPERAND, + SINGLE_SSA_DEF_OPERAND, ZERO_SSA_OPERANDS, NUM_SSA_OPERANDS): New. + * tree-ssa-opfinalize.h: New. Function templates for expansion. + (FINALIZE_ALLOC): Expands into alloc_def, alloc_use, alloc_maydef, + alloc_vuse, and alloc_mustdef. + (FINALIZE_FUNC): Expands into finalize_ssa_def_ops, + finalize_ssa_use_ops, finalize_ssa_v_may_def_ops, finalize_ssa_vuse_ops, + and finalize_ssa_v_must_def_ops. + * tree-ssa-pre.c (add_to_sets): Pass tree to vn_add. + (create_value_expr_from): Use stmt not vuse_optype as a parameter. Pass + stmt around. + (compute_avail): Use generic iterator interface. + * tree-ssa-propagate.c (first_vdef): Use generic operand interface. + (stmt_makes_single_load, stmt_makes_single_store): Use + ZERO_SSA_OPERANDS. + * tree-ssa-sink.c (is_hidden_global_store): Use ZERO_SSA_OPERANDS. + (statement_sink_location): Use generic interface. + * tree-ssa.c (verify_ssa): Use %p in fprintf. Use generic interface. + (delete_tree_ssa): Don't call release_defs. Call release_ssa_name and + reset the immediate use link nodes. + (stmt_references_memory_p): Use ZERO_SSA_OPERANDS. + * tree-ssanames.c (make_ssa_name): Use use_operand_p. + * tree-tailcall.c (find_tail_calls): Use ZERO_SSA_OPERANDS. + (eliminate_tail_call): Use generic operand interface. + * tree-vect-analyze.c (vect_analyze_data_refs): Use ZERO_SSA_OPERANDS. + (vect_mark_relevant, vect_mark_stmts_to_be_vectorized): Use generic + interface. + * tree-vect-transform.c (update_vuses_to_preheader): Use generic + interface. + * tree-vectorizer.c (rename_variables_in_bb): Use generic interface. + * tree-vn.c (struct val_expr_pair_d): Cache statment pointer instead of + vuse_optype. + (vn_compute, val_expr_pair_hash, vn_add, vn_lookup, vn_lookup_or_add): + Use statement pointer instead of vuse_optype. Use generic interface. + * tree-vrp.c (maybe_add_assert_expr): Use generic interface. + (stmt_interesting_for_vrp, vrp_visit_stmt): Use ZERO_SSA_OPERANDS. + * tree.h (struct ssa_imm_use_d): Renamed to ssa_use_operand_d. + (tree_ssa_name, phi_arg_d): Use ssa_use_operand_d. + * doc/tree-ssa.texi: Update documentation for operand interface. + +2005-05-03 Nathan Sidwell + + * config/darwin.c (machopic_define_symbol): Use gcc_assert or + gcc_unreachable as appropriate. + (machopic_function_base_name, machopic_indirect_data_reference, + machopic_legitimize_pic_address, darwin_non_lazy_pcrel): Likewise. + * config/host-darwin.c (darwin_gt_pch_use_address): Likewise + * config/rs6000/altivec.md (*mov_internal, + build_vector_mask_for_load): Likewise. + * config/rs6000/darwin.md (movdf_low_si, movdf_low_di, + *call_nonlocal_darwin64, *call_value_nonlocal_darwin64, + *sibcall_symbolic_64, *sibcall_value_symbolic_64): Likewise. + * config/rs6000/predicates.md (easy_fp_constant, + logical_operand): Likewise. + * config/rs6000/rs6000.c (spe_expand_predicate_builtin, + compute_save_world_info, rs6000_emit_prologue, + rs6000_output_mi_thunk): Reword comments to avoid 'abort'. + * config/rs6000/host-darwin.c (segv_handler): Use fancy_abort + directly. + +2005-05-03 Uros Bizjak + + PR middle-end/21282 + * convert.c (convert_to_integer): Convert ceil and floor in + c99 mode only. + +2005-04-29 Geoffrey Keating + + PR target/20813 + * config/rs6000/rs6000.md (floatsidf2_internal): Merge to create + define_insn_and_split. Split only when memory operand is + offsettable. Use adjust_address rather than plus_constant. + (floatunssidf2_internal): Likewise. + (fix_truncdfsi2_internal): Split only when memory operand is + offsettable. Use adjust_address rather than plus_constant. + (fix_trunctfsi2_internal): Likewise. + (floatsidf2_internal): Likewise. + +2005-05-02 Diego Novillo + + * tree-vrp.c (set_value_range_to_nonnull): Declare inline. + (set_value_range_to_null): Likewise. + (set_value_range_to_varying): New function. Use it in all + call sites that used to call set_value_range (vr, VR_VARYING, ...). + (extract_range_from_assert): If the integral type has a + super-type, and LIMIT is not within MIN and MAX values of that + type, set the resulting range to VR_VARYING. + +2005-05-02 Hans-Peter Nilsson + + * config/mmix/mmix.opt: New file. + * config/mmix/mmix.h: Move options-related comments to mmix.opt. + (mmix_cc1_ignored_option): Don't declare. + (TARGET_OPTIONS, TARGET_MASK_LIBFUNCS, TARGET_MASK_ABI_GNU) + (TARGET_MASK_FCMP_EPSILON, TARGET_MASK_ZERO_EXTEND) + (TARGET_MASK_KNUTH_DIVISION, TARGET_MASK_TOPLEVEL_SYMBOLS) + (TARGET_MASK_BRANCH_PREDICT, TARGET_MASK_USE_RETURN_INSN) + (TARGET_MASK_BASE_ADDRESSES, TARGET_LIBFUNC, TARGET_ABI_GNU, + (TARGET_FCMP_EPSILON, TARGET_ZERO_EXTEND, TARGET_KNUTH_DIVISION) + (TARGET_TOPLEVEL_SYMBOLS, TARGET_BRANCH_PREDICT) + (TARGET_BASE_ADDRESSES, TARGET_USE_RETURN_INSN, TARGET_SWITCHES): + Don't define. + (TARGET_DEFAULT): Change TARGET_MASK_... to MASK_... + * config/mmix/mmix.c (mmix_cc1_ignored_option): Remove. + (TARGET_DEFAULT_TARGET_FLAGS): Override default. + +2005-05-02 Joseph S. Myers + + PR c/15698 + * c-tree.h (C_DECL_BUILTIN_PROTOTYPE): New. + * c-decl.c (current_function_prototype_built_in, + current_function_prototype_arg_types): New. + (merge_decls): Keep source location of prototype followed by + nonprototype declaration. Update C_DECL_BUILTIN_PROTOTYPE. + (builtin_function): Set C_DECL_BUILTIN_PROTOTYPE. + (start_function): Always set current_function_prototype_locus, + current_function_prototype_built_in and + current_function_prototype_arg_types. Check for external + prototype whether or not visible for external function and set + current_function_prototype_arg_types accordingly. + (store_parm_decls_oldstyle): Use + current_function_prototype_arg_types for checking old-style + definition against prototype. Give warnings only if + current_function_prototype_built_in). + +2005-05-02 Daniel Jacobowitz + + * ggc.h (ggc_alloc_zone_pass_stat): New macro. + (ggc_alloc_zone_stat): Don't define. + * ggc-zone.c (ggc_alloc_typed_stat, ggc_alloc_stat): Use + ggc_alloc_zone_pass_stat. + * rtl.c (rtx_alloc_stat, shallow_copy_rtx_stat): Likewise. + * tree.c (make_node_stat, copy_node_stat, make_tree_binfo_stat) + (make_tree_vec_stat, tree_cons_stat, build1_stat): Likewise. + +2005-05-02 Daniel Jacobowitz + + * calls.c (expand_call): Handle current_function_pretend_args_size + when checking for sibcalls. + +2005-05-02 Kazu Hirata + + PR tree-optimization/21294 + * tree-vrp.c (vrp_expr_computes_nonzero): New. + (extract_range_from_expr): Call vrp_expr_computes_nonzero. + +2005-05-02 Janis Johnson + + PR 19985 + * gcov-io.h: Declare gcov external functions hidden. + +2005-05-02 Kazu Hirata + + * tree-ssa-uncprop.c (equiv_hash_elt, remove_equivalence, + record_equiv, tree_ssa_uncprop, uncprop_into_successor_phis): + Use VEC instead of VARRAY. + (equiv_free): New. + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Factor + out common code. + +2005-05-02 Paolo Bonzini + + * c-common.c (resolve_overloaded_builtin): Forward to target + hook for BUILT_IN_MD built-ins. + * c-typeck.c (finish_call_expr): Call resolve_overloaded_builtin + for all types of built-in. + * target-def.h (TARGET_RESOLVE_OVERLOADED_BUILTIN): New. Use it + in the definition of the target hooks struct. + * target.h (struct gcc_target): Add resolve_overloaded_builtin. + * config/rs6000/altivec.h: Rewritten. + * config/rs6000/rs6000-c.c (struct altivec_builtin_types, + altivec_resolve_overloaded_builtin, altivec_build_resolved_builtin, + rs6000_builtin_type, rs6000_builtin_type_compatible, + altivec_overloaded_builtins, rs6000_builtin_type, + rs6000_builtin_type_compatible): New. + * config/rs6000/rs6000.c (rs6000_builtin_types, rs6000_builtin_decls): + New. + (def_builtin): Turn into a function. Check for duplicates and store + the builtin into rs6000_builtin_decls. + (bdesc_3arg, bdesc_dst, bdesc_altivec_preds, bdesc_2arg, + bdesc_1arg): Add overloaded builtins. + (altivec_expand_builtin): Check for unresolved overloaded builtins, + do not support ALTIVEC_COMPILETIME_ERROR. + (rs6000_init_builtins): Add opaque 128-bit vector, and internal + nodes to represent front-end types. + (altivec_init_builtins, rs6000_common_init_builtins): Create builtins + with opaque arguments and/or return values. + * config/rs6000/rs6000.h (enum rs6000_builtins): Remove + ALTIVEC_COMPILETIME_ERROR and add Altivec overloaded builtins. + (rs6000_builtin_type_index): New. + (is_ev64_opaque_type): Rename to... + (rs6000_is_opaque_type): ... this. + (rs6000_cpu_cpp_builtins): Install the resolve_overloaded_builtin + target hook. + +2005-05-02 Kazu Hirata + + * function.c (reorder_blocks, reorder_blocks_1): Use VEC + instead of VARRAY. + +2005-05-02 Nathan Sidwell + Bernd Schmidt + + * config/bfin/bfin.c (emit_link_insn, effective_address_32bit_p, + print_address_operand, print_operand, legitimize_pic_address, + asm_conditional_branch, bfin_gen_compare, output_push_multiple, + output_pop_multiple): Use gcc_assert or gcc_unreachable as + appropriate. + * config/bfin/bfin.md (movsf splitter, beq, bne): Likewise. + +2005-05-02 Dorit Naishlos + + * doc/passes.texi: Document vectorization pass. + +2005-05-02 Kazu Hirata + + * tree-scalar-evolution.c (get_exit_conditions_rec, + select_loops_exit_conditions, + number_of_iterations_for_all_loops, + analyze_scalar_evolution_for_all_loop_phi_nodes, + scev_analysis): Use VEC instead of VARRAY. + +2005-05-02 Michael Matz + + PR c++/19542 + * c-common.c (c_common_nodes_and_builtins): Create global null_node. + (warn_strict_null_sentinel): Define. + (check_function_sentinel): Check for null_node as valid sentinel too. + * c-common.h (c_tree_index): Added CTI_NULL. + (null_node) Define global_tree[CTI_NULL]. + (warn_strict_null_sentinel): Declare. + * c-opts.c: (c_common_handle_option): Handle -Wstrict-null-sentinel. + * c.opt: (Wstrict-null-sentinel): New C++ option. + * doc/invoke.texi (C++ Options): Document -Wstrict-null-sentinel. + +2005-05-01 Kazu Hirata + + * gimplify.c (gimplify_compound_lval): Use VEC instead of + VARRAY. + + * global.c (calculate_reg_pav): Use VEC instead of VARRAY. + + * dwarf2out.c (decl_scope_table, push_decl_scope, + pop_decl_scope, scope_die_for, dwarf2out_init): Use VEC + instead of VARRAY. + +2005-05-01 Mark Mitchell + + PR C++/14391 + * c-cppbuiltin.c (c_cpp_builtins): Do not define __GXX_WEAK__ to 1 + if !flag_weak. + * doc/cpp.texi (__DEPRECATED): Document. + (__EXCEPTIONS): Likewise. + (__GXX_WEAK__): Likewise. + + * function.c (INVOKE__main): Do not define. + (expand_main_function): Check HAS_INIT_SECTION when determining + whether or not to call __main. + +2005-05-01 Kazu Hirata + + * tree-ssa-loop-ivopts.c: Fix a comment typo. + +2005-01-05 Paul Brook + + * config/arm/arm.h (ARM_EMIT_TRAMPOLINE_CACHE_CLEAR): Define. + (INITIALIZE_TRAMPOLINE): Use it. + * config/arm/linux-gas.h (INITIALIZE_TRAMPOLINE): Remove. + * config/arm/netbsd.h (INITIALIZE_TRAMPOLINE): Remove. + * config/arm/netbsd-elf.h (INITIALIZE_TRAMPOLINE): Remove. + +2005-05-01 Gerald Pfeifer + + * doc/install.texi (Specific): Omit dots in the @anchors names + for i?86-*-sco3.2v5*, i?86-*-solaris2.10, and sparc-sun-solaris2.7. + Omit underscores for x86_64-*-* and the "all ELF targets" entry. + +2005-05-01 Zdenek Dvorak + + PR tree-optimization/18316 + PR tree-optimization/19126 + * tree.c (build_int_cst_type): Avoid shift by size of type. + * tree-scalar-evolution.c (simple_iv): Add allow_nonconstant_step + argument. + * tree-scalar-evolution.h (simple_iv): Declaration changed. + * tree-ssa-loop-ivopts.c (struct iv_cand): Add depends_on + field. + (dump_cand): Dump depends_on information. + (determine_biv_step): Add argument to simple_iv call. + (contains_abnormal_ssa_name_p): Handle case expr == NULL. + (find_bivs, find_givs_in_stmt_scev): Do not require step to be a + constant. + (add_candidate_1): Record depends_on for candidates. + (tree_int_cst_sign_bit, constant_multiple_of): New functions. + (get_computation_at, get_computation_cost_at, may_eliminate_iv): + Handle ivs with nonconstant step. + (iv_ca_set_remove_invariants, iv_ca_set_add_invariants): New functions. + (iv_ca_set_no_cp, iv_ca_set_cp): Handle cand->depends_on. + (create_new_iv): Unshare the step before passing it to create_iv. + (free_loop_data): Free cand->depends_on. + (build_addr_strip_iref): New function. + (find_interesting_uses_address): Use build_addr_strip_iref. + (strip_offset_1): Split the recursive part from strip_offset. + Strip constant offset component_refs and array_refs. + (strip_offset): Split the recursive part to strip_offset_1. + (add_address_candidates): Removed. + (add_derived_ivs_candidates): Do not use add_address_candidates. + (add_iv_value_candidates): Add candidates with stripped constant + offset. Consider all candidates with initial value 0 important. + (struct affine_tree_combination): New. + (aff_combination_const, aff_combination_elt, aff_combination_scale, + aff_combination_add_elt, aff_combination_add, + tree_to_aff_combination, add_elt_to_tree, aff_combination_to_tree, + fold_affine_sum): New functions. + (get_computation_at): Use fold_affine_sum. + * tree-ssa-loop-manip.c (create_iv): Handle ivs with nonconstant step. + * tree-ssa-loop-niter.c (number_of_iterations_exit): Add argument + to simple_iv call. + +2005-04-30 Michael Matz + + * config/i386/i386.md (movmemsi): Also active when + TARGET_INLINE_ALL_STRINGOPS. + +2005-04-30 Eric Botcazou + + PR bootstrap/20633 + * config/freebsd-spec.h (FBSD_CPP_SPEC): Add %(cpp_arch). + +2005-04-30 Paul Brook + + * config/arm/bpabi.h (RENAME_LIBRARY_SET): Always use .thumb_set in + thumb mode. + * config/arm/ieee754-df.S: Use __INTERWORKING_STUBS__. + * config/arm/ieee754-sf.S: Ditto. + * config/arm/lib1funcs.asm: Define and use __INTERWORKING_STUBS__. + (FUNC_ALIAS): Use .thumb_set for thumb routines. + +2005-04-30 Kazu Hirata + + * tree-ssanames.c: Fix a comment typo. + * doc/options.texi: Fix a typo. + +2005-04-30 Nathan Sidwell + + * config/h8300/h8300.c (byte_reg): Use gcc_assert and + gcc_unreachable as appropriate. + (split_adds_subs, cond_string, print_operand, + h8300_initial_elimination_offset, h8300_classify_operand, + h8300_unary_length, h8300_short_immediate_length, + h8300_bitfield_length, h8300_binary_length, + h8300_insn_length_from_table, compute_mov_length, output_plussi, + compute_plussi_length, compute_plussi_cc, output_logical_op, + compute_logical_op_length, compute_logical_op_cc, + output_h8sx_shift, get_shift_alg, h8300_shift_needs_scratch_p, + output_a_shift, compute_a_shift_length, compute_a_shift_cc, + output_a_rotate, compute_a_rotate_length, fix_bit_operand, + h8300_regs_ok_for_stm): Likewise. + * config/h8300/h8300.md (*movsi_h8300, *movsf_h8300, + monitor_prologue): Likewise. + +2005-04-30 Kazu Hirata + + * loop-invariant.c (invariants, create_new_invariant, + get_inv_cost, best_gain_for_invariant, + find_invariants_to_move, move_invariants, + init_inv_motion_data, free_inv_motion_data): Use VEC instead + of VARRAY. + +2005-04-29 Richard Henderson + + * function.c (instantiate_decls): Remove valid_only argument. + (instantiate_decls_1, instantiate_decl): Likewise. + (instantiate_virtual_regs_1): Delete. + (instantiate_virtual_regs_lossage): Delete. + (instantiate_virtual_regs_in_rtx): New. + (safe_insn_predicate): New. + (instantiate_virtual_regs_in_insn): New. + (instantiate_virtual_regs): Update to match all that. Only run + instantiate_decls once. + +2005-04-29 Richard Henderson + Daniel Jacobowitz + + * gengtype.c (write_func_for_structure): Split out ... + (output_type_enum): ... new function. Fix thinko accessing + TYPE_PARAM_STRUCT data. + +2005-04-29 Tom Tromey + + * tree.c (build_block): Removed unused 'tags' argument. + * tree.h (build_block): Removed argument. + +2005-04-29 Michael Matz + + PR rtl-optimization/21144 + * postreload.c (reload_cse_move2add): Check for VOIDmode. + +2005-04-29 Bob Wilson + + * config/xtensa/xtensa.h (OPTIMIZATION_OPTIONS): Define to disable + flag_reorder_blocks. + +2005-04-28 Kazu Hirata + + PR tree-optimization/21030 + * tree-vrp.c (adjust_range_with_scev): Do not create invalid + ranges where VR->MAX is smaller than VR->MIN. + +2005-04-29 Devang Patel + + PR tree-optimization/21272 + PR tree-optimization/21266 + * tree-if-conv.c (find_phi_replacement_condition): Fix think-o. + +2005-04-29 Kazu Hirata + + * tree-flow-inline.h: Fix a comment typo. + * doc/tree-ssa.texi: Fix a typo. + + * tree-flow-inline.h, tree-ssa-operands.c: Fix comment typos. + +2005-04-29 Nathan Sidwell + + * config/fr30/fr30.c (fr30_expand_prologue): Use gcc_assert and + gcc_unreachable as appropriate. + (fr30_expand_epilogue, fr30_setup_incoming_varargs, + fr30_print_operand, fr30_move_double): Likewise. + * config/fr30/fr30.md (*movsi_internal, *movsf_internal): Likewise. + +2005-04-29 Mark Mitchell + + * config/arm/arm.h (ARM_EABI_CTORS_SECTION_OP): Do not define if a + definition has already been provided. + (ARM_EABI_DTORS_SECTION_OP): Likewise. + * config/arm/symbian.h (ARM_EABI_CTORS_SECTION_OP): Define. + (ARM_EABI_DTORS_SECTION_OP): Likewise. + +2005-04-29 Jim Tison + + * config/s390/s390.md ("prologue_tpf", "epilogue_tpf"): Alter + trace hooks calls to improve performance. + +2005-04-29 Julian Brown + Mark Mitchell + Paul Brook + + * crtstuff.c: Handle targets that use .init_array. + * function.c (HAS_INIT_SECTION): Do not define. Instead, make sure + that INVOKE__main is set correctly. + (expand_main_function): Test INVOKE__main. + * libgcc2.c: Do not define __main when using .init_array. + * config/arm/arm.c (arm_elf_asm_constructor): New function. + * config/arm/arm.h (CTORS_SECTION_ASM_OP): Define, with specialized + libgcc version. + (DTORS_SECTION_ASM_OP): Likewise. + (CTOR_LIST_BEGIN): Define specially when in libgcc. + (CTOR_LIST_END): Likewise. + (DTOR_LIST_BEGIN): Likewise. + (DTOR_LIST_END): Likewise. + * config/arm/bpapi.h (INIT_SECTION_ASM_OP): Do not define it. + (FINI_SECTION_ASM_OP): Likewise. + (INIT_ARRAY_SECTION_ASM_OP): Define. + (FINI_ARRAY_SECTION_ASM_OP): Likewise. + * config/arm/elf.h (TARGET_ASM_CONSTRUCTOR): Define. + (SUPPORTS_INIT_PRIORITY): Evaluate to false for EABI based targets. + * doc/tm.texi (INIT_ARRAY_SECTION_ASM_OP): Document. + (FINI_ARRAY_SECTION_ASM_OP): Likewise. + +2005-04-29 Nathan Sidwell + + * config/m68k/m68k.c (m68k_initial_elimination_offset): Use + gcc_assert and gcc_unreachable as appropriate. + (output_dbcc_and_branch, output_scc_di, legitimize_pic_address, + const_int_cost, output_move_const_into_data_reg, + output_move_qimode, output_move_double, find_addr_reg, + print_operand, print_operand_address): Likewise. + * config/m68k/m68k.md (adddi3, subdi3, negsf2, negdf2, abssf2, + absdf2, sordered, sunordered, suneq, sunge, sungt, sunle, sunlt, + sltgt, bordered, bunordered, buneq, bunge, bungt, bunle, bunlt, + bltgt, *bordered_rev, *bunordered_rev, *buneq_rev, *bunge_rev, + *bunle_rev, *bunlt_rev, *bltgt_rev, negxf2, absxf2, + conditional_trap): Likewise. + * config/m68k/m68kelf.h (ASM_OUTPUT_ALIGN): Remove unreachable code. + +2005-04-29 Nathan Sidwell + + * config/xtensa/xtensa.c (gen_int_relational): Use gcc_assert and + gcc_unreachable as appropriate. + (gen_conditional_move, xtensa_split_operand_pair, + xtensa_split_operand_pair, xtensa_copy_incoming_a7, + xtensa_copy_incoming_a7, xtensa_copy_incoming_a7, + xtensa_copy_incoming_a7, xtensa_output_literal, + xtensa_output_literal, xtensa_output_literal): Likewise. + * config/xtensa/xtensa.h (INITIAL_ELIMINATION_OFFSET): Likewise. + * config/xtensa/xtensa.md (*btrue, *bfalse, *ubtrue, *ubfalse, + *bittrue, *bitfalse, *masktrue, *maskfalse, movsicc_internal0, + movsicc_internal1, movsfcc_internal0, + movsfcc_internal1): Likewise. + +2005-04-28 James E Wilson + + * config/i386/i386.h (HI_REGISTER_NAMES): Fix typos in comment. + (ADDITIONAL_REGISTER_NAMES): Delete obsolete mmx register entries. + +2005-04-28 DJ Delorie + + * opt-functions.awk (var_set): Emit proper initializer for + non-target bitfields. + +2005-04-28 Devang Patel + + * dbxout.c (have_used_extensions): Remove. + (dbxout_type_fileds, dbxout_type, dbxout_symbol): Remove use of + have_used_extensions. + +2005-04-28 James E Wilson + + * doc/install.texi: Update -enable-languages info. Correct path to + html docs. + +2005-04-28 DJ Delorie + + * optc-gen.awk (END): Make sure no variable is defined more + than once. + * opth-gen.awk (END): Allocate bits on a per-variable basis. + Allow for bitfield variables other than target_flags. + * doc/options.text (Mask): Document that you may specify a + variable other than target_flags. + +2005-04-28 Martin Koegler + + PR rtl-optimization/18877 + * reload.c (decompose) : Handle pseudo reg + number in val.start. + +2005-04-28 David Edelsohn + + PR target/20813 + * config/rs6000/aix43.h (SUBSUBTARGET_SWITCHES, aix64): Add + MASK_PPC_GFXOPT. + * config/rs6000/aix51.h (SUBSUBTARGET_SWITCHES, aix64): Same. + * config/rs6000/aix52.h (SUBSUBTARGET_SWITCHES, aix64): Same. + * config/rs6000/sysv4.h (SUBTARGET_SWITCHES, 64): Same. + +2005-04-28 Richard Earnshaw + + * arm.c (legitimize_pic_address): Fix sense of assertion test for + creating pseudos when the base offset is too large. + +2005-04-28 Kazu Hirata + + * global.c (earlyclobber_regclass): Change the type to + VEC(int,heap). + (check_earlyclobber): Update uses of earlyclobber_regclass. + (mark_reg_use_for_earlyclobber): Likewise. + (calculate_local_reg_bb_info): Allocate and free + earlyclobber_regclass using the VEC API. + +2005-04-28 Nathan Sidwell + + * tree-ssa-alias.c (push_fields_onto_fieldstack): Remove bogus + assert. + +2005-04-28 Kazu Hirata + + * modulo-sched.c, tree-stdarg.c: Use targetm.foo instead of + (*targetm.foo). + + * config.gcc: Obsolete c4x-* and tic4x-*. + + * tree.h (edge_def): Remove. + + * bt-load.c, cfgexpand.c, dwarf2out.c, emit-rtl.c, expr.c, + function.c, global.c, lcm.c, loop-invariant.c, optabs.c, + reorg.c, resource.c, tree-ssa-loop-ivopts.c, value-prof.c: Use + JUMP_P, LABEL_P, REG_P, MEM_P, NONJUMP_INSN_P, and INSN_P + where appropriate. + + * attribs.c, c-pragma.c, caller-save.c, cfghooks.h, + coverage.c, cselib.h, domwalk.c, domwalk.h, errors.c, + errors.h, gcov-dump.c, gcov-io.c, gcov-io.h, gen-protos.c, + genattrtab.h, genextract.c, gthr-win32.h, insn-notes.def, + integrate.c, lambda-mat.c, lambda.h, libgcov.c, local-alloc.c, + machmode.def, mips-tfile.c, params.c, pretty-print.c, + print-rtl.c, protoize.c, regmove.c, sched-vis.c, tree-chrec.h, + tree-data-ref.h, vec.h, config/darwin-c.c, config/sol2-c.c, + config/sol2.c, config/arm/arm-cores.def, config/arm/cirrus.md, + config/arm/symbian.h, config/c4x/c4x.c, config/c4x/c4x.h, + config/i386/cygming.h, config/i386/djgpp.h, + config/i386/lynx.h, config/i386/netware.c, + config/i386/winnt.c, config/ia64/ia64-c.c, + config/iq2000/iq2000.c, config/m32r/little.h, + config/m68k/m68k-protos.h, config/m68k/m68k.h, + config/m68k/m68k.md, config/mcore/mcore.c, + config/mcore/mcore.h, config/mmix/mmix.c, config/mmix/mmix.md, + config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, + config/mn10300/mn10300.h, config/ns32k/netbsd.h, + config/ns32k/ns32k.c, config/ns32k/ns32k.h, + config/pa/pa-hpux11.h, config/pdp11/pdp11.c, + config/pdp11/pdp11.h, config/rs6000/darwin.h, + config/rs6000/default64.h, config/rs6000/rs6000-c.c, + config/s390/2064.md, config/s390/2084.md, + config/s390/s390-modes.def, config/s390/s390-protos.h, + config/s390/tpf.h, config/sh/sh.h, config/sh/symbian.c, + config/stormy16/stormy16.c, config/vax/vax-protos.h, + config/vax/vax.c, config/vax/vax.h, + config/xtensa/lib1funcs.asm, config/xtensa/xtensa.md: Update + copyright. + +2005-04-28 Joseph S. Myers + + * c-typeck.c (build_compound_expr): Correct logic in last change. + +2005-04-27 James E. Wilson + + * config/ia64/ia64.c (update_set_flags): Delete ppred and pcond + parameters. Replace conditional move code with assert checking for + ar.lc. Delete obsolete comments. + (set_src_needs_barrier): Delete cond parameter, and code using it. + (rtx_needs_barrier): Delete initialization of cond. Fix typo in + assert checking for PR_REGS. Fix calls to update_set_flags and + set_src_needs_barrier. + (group_barrier_needed): Renamed from group_barrier_needed_p. Fix all + callers. Rewrite explanatory comment before the function. + (safe_group_barrier_needed): Renamed from safe_group_barrier_needed_p. + Fix all callers. + +2005-04-27 Mike Stump + + * doc/cpp.texi: gcc now implements universal character names. + +2005-04-27 Joseph S. Myers + + PR c/21159 + * c-typeck.c (build_compound_expr): Don't warn for left-hand side + being a compound expression whose right-hand side is cast to void. + +2005-04-27 Caroline Tice + + * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): + Remove targetm.have_named_sections test. + (fix_edges_for_rarely_executed_code): Likewise. + (insert_section_boundary_note): Likewise. + (reorder_basic_blocks): Check partitioning flag before calling + verify_hot_cold_block_grouping. + * dbxout.c (dbxout_function_end): Get hot/cold section labels from + the function struct rather than global variables. + * dwarf2out.c (COLD_TEXT_SECTION_LABEL): New macro. + (COLD_END_LABEL): Likewise + (cold_text_section_label): New static global variable. + (cold_end_label): Likewise. + (dwarf2out_switch_text_section): Get hot/cold section labels from + the function struct rather than global variables; test to make sure + cfun is defined. + (output_aranges): Use cold_text_section_label and cold_end_label; + check partitioning flag before putting out delta. + (output_ranges): Remove incorrect code attempting to use + hot/cold labels. + (output_line_info): Get cold section label from function struct; test + to make sure cfun is defined. + (add_location_or_const_value_attribute): Likewise. + (dwarf2out_var_location): Likewise. + (dwarf2out_init): Generate cold_text_section_label and cold_end_label; + write out cold_text_section_label if partition flag is set. + (dwarf2out_finish): Write out cold_end_label if partition flag is set; + * function.h (struct function): Add new fields to point to hot/cold + section labels: hot_section_label, cold_section_label, + hot_section_end_label and cold_section_end_label; also add new field + for cold text section name, unlikely_text_section_name. + * opts.c (decode_options): Turn off partitioning flag if + !targetm.have_named_sections. + * output.h (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_section_label): Remove. + (unlikely_text_section_name): Remove. + * passes.c (rest_of_handle_final): Remove extra blank line. + * varasm.c (unlikely_section_label): Remove. + (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_text_section_name): Remove. + (initialize_cold_section_name): Modify to call + targetm.strip_name_encoding; to store cold section name in current + function struct, if it exists; and to only use the decl_section_name + if flag_named_sections is true. + (unlikely_text_section): Modify to get section name out of current + function struct, if there is one; otherwise build it from + UNLIKELY_EXECUTED_TEXT_SECTION_NAME. + (in_unlikely_text_section): Likewise. + (named_section): Modify to get/put cold section name in current function + struct, if there is one. + (function_section): Change 'bool unlikely' to 'int reloc'; check + targetm.have_named_sections before calling named_section. + (current_function_section): Likewise. + (assemble_start_function): Modify to get/put unlikely_text_section_name + in current function struct; modify to get hot/cold section labels + from function struct; initialize labels using + ASM_GENERATE_INTERNAL_LABEL; + test partitioning flag before writing out hot section label. + (assemble_end_function): Test partitioning flag before writing out + hot/cold section labels. + (default_section_type_flags_1): Get cold text section name from + function struct if there is one; Set flags correctly for + cold text section if there is not a current function struct. + +2005-04-27 Richard Guenther + + * tree-ssa-propagate.c (set_rhs): Revert last change. + +2005-04-27 Steve Ellcey + + * explow.c (convert_memory_address): Add gcc_assert. + +2005-04-27 Mark Mitchell + + * configure.ac: Check for ld --sysroot support. + * gcc.c: Document %R specifier for specs. + (SYSROOT_SPEC): New macro. + (sysroot_spec): New variable. + (static_specs): Add sysroot_spec. + (main): Pass the sysroot spec to the linker if appropriate. + * configure: Regenerated. + * config.in: Likewise. + +2005-04-27 Richard Guenther + + * fold-const.c (fold_binary): Use build_fold_addr_expr + for address calculation and INDIRECT_REF handling. + +2005-04-27 Andrew Haley + + * postreload-gcse.c (hash_scan_set): Remove bogus assertion. + +2005-04-27 Nathan Sidwell + + * config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Reserve arm frame + pointer when thumb backtracing is on. + + * config/fp-bit.c (abort): Revert change. + +2005-04-27 Ian Lance Taylor + + * c-semantics.c (add_stmt): Don't test STATEMENT_CODE_P. + +2005-04-27 Kazu Hirata + + * tree-ssa-dce.c: Fix a comment typo. + +2005-04-27 David S. Miller + + * explow.c (allocate_dynamic_stack_space SETJMP_VIA_SAVE_AREA): + Kill setjmpless_size. current_function_calls_setjmp is completely + computed when we are called, so just use the optimized size value + instead of using REG_SAVE_AREA notes. + (optimize_save_area_alloca): Delete.... + * rtl.h (optimize_save_area_alloca): Likewise... + * passes.c (rest_of_compilation): and don't call it any more. + * reg-notes.def (SAVE_AREA): Delete. + +2005-04-27 Nathan Sidwell + + * config/fp-bit.c (abort): Add noreturn attribute. + + * config/avr/avr.c (avr_naked_function_p): Use gcc_assert and + gcc_unreachable as appropriate. + (ptrreg_to_str, cond_string, avr_normalize_condition): Likewise. + * config/avr/avr.h (ASM_OUTPUT_REG_PUSH, + ASM_OUTPUT_REG_POP): Likewise. + +2005-04-27 Paolo Bonzini + + * tree-complex.c (expand_vector_operations_1): Do not build + VIEW_CONVERT_EXPR's for the lhs. + +2005-04-27 Nathan Sidwell + + * config/pa/pa.h (PRINT_OPERAND_ADDRESS): Use gcc_assert, remove + unnecessary noncanonical RTL handling. + * config/pa/pa64-linux.h (INITIAL_ELIMINATION_OFFSET): Use + gcc_assert and gcc_unreachable. + + * config/arm/arm.h (ARM_PRINT_OPERAND_ADDRESS): Use gcc_assert and + gcc_unreachable as appropriate. + (THUMB_PRINT_OPERAND_ADDRESS): Likewise. + * config/arm/arm.c (arm_override_options, arm_compute_func_type, + use_return_insn, const_ok_for_op, arm_gen_constant, + arm_canonicalize_comparison, legitimize_pic_address, + thumb_find_work_register, arm_load_pic_register, arm_rtx_costs_1, + arm_cirrus_insn_p, cirrus_reorg, minmax_code, + load_multiple_sequence, emit_ldm_seq, store_multiple_sequence, + emit_stm_seq, arm_gen_movmemqi, arm_select_dominance_cc_mode, + arm_select_cc_mode, arm_reload_in_hi, arm_reload_out_hi, + move_minipool_fix_forward_ref, move_minipool_fix_backward_ref, + dump_minipool, create_fix_barrier, push_minipool_fix, arm_reorg, + fp_immediate_constant, fp_const_from_val, vfp_output_fstmx, + output_call, output_mov_long_double_fpa_from_arm, + output_mov_long_double_arm_from_fpa, + output_mov_double_fpa_from_arm, output_mov_double_arm_from_fpa, + output_move_double, arithmetic_instr, shift_op, int_log2, + output_return_instruction, arm_output_function_prologue, + arm_output_epilogue, arm_output_function_epilogue, + emit_multi_reg_push, arm_get_frame_offsets, + arm_compute_initial_elimination_offset, arm_expand_prologue, + arm_print_operand, arm_assemble_integer, get_arm_condition_code, + arm_final_prescan_insn, arm_init_iwmmxt_builtins, + arm_expand_binop_builtin, thumb_pushpop, thumb_far_jump_used_p, + thumb_compute_initial_elimination_offset, + thumb_output_function_prologue, thumb_load_double_from_address, + thumb_output_move_mem_multiple, thumb_reload_out_hi, + arm_emit_vector_const, arm_dbx_register_number): Likewise. + * config/arm/pe.c (arm_mark_dllexport, arm_mark_dllimport): Likewise. + * config/arm/arm.md (thumb_extendhisi2, + *thumb_extendhisi2_insn_v6, *thumb_extendqisi2, + *thumb_extendqisi2_v6, movhi, *thumb_movhi_insn, + thumb_movhi_clobber, movqi, *arm_buneq, *arm_bltgt, + *arm_buneq_reversed, *arm_bltgt_reversed, suneq, sltgt): Likewise. + * config/arm/cirrus.md (*cirrus_arm_movdi, + *cirrus_movdf_hard_insn): Likewise. + * config/arm/vfp.md (*arm_movdi_vfp, *movdf_vfp): Likewise. + +2005-04-27 Kazu Hirata + + * tree-flow.h (ssa_names): Change the type to VEC(tree,gc). + (num_ssa_names): Use VEC_length. + (ssa_names): Use VEC_index. + * tree-ssanames.c (ssa_names): Change the type to + VEC(tree,gc). + (init_ssanames, fini_ssa_names, make_ssanames, + release_ssa_name): Update uses of ssa_names. + + * dojump.c, emit-rtl.c, expmed.c, expr.c, stmt.c, stor-layout.c: + Use fold_buildN instead of fold (buildN (...)). + +2005-04-27 Devang Patel + + * dbxout.c (dbxout_type): Check use_gnu_debug_info_extensions. + +2005-04-27 Matt Thomas + Jan-Benedict Glaw + + * config/vax/vax.c (vax_rtx_costs): Whitespace cleanup. + (vax_output_mi_thunk): Ditto. + (vax_notice_cc_update): Ditto. + (INDEX_REGISTER_P): Add trailing \. + (BASE_REGISTER_P): Add trailing \. + (legitimate_address_p): Whitespace cleanup. Remove trailing \. + +2005-04-27 Richard Guenther + + * tree-ssa-propagate.c (set_rhs): Check operand of + ADDR_EXPR for gimpliness, too. + +2005-04-27 Kazu Hirata + + * tree-ssa-pre.c: Fix a comment typo. + +2005-04-27 Zdenek Dvorak + + PR tree-optimization/21171 + * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Do not + record address uses if the reference is volatile. + +2004-04-27 Paolo Bonzini + + * tree-complex.c (expand_vector_operation): New, extracted from + expand_vector_operations_1. + (tree_vec_extract): Build a NOP_EXPR. + (expand_vec_parallel): Do not care about returning the correct type. + (expand_vector_operations_1): Call expand_vector_operation. + Build the VIEW_CONVERT_EXPR on the left side of MODIFY_EXPRs. + + * tree-complex.c (gate_expand_vector_operations): New. + (pass_lower_vector_ssa): Use it. + * tree-optimize.c (init_tree_optimization_passes): Include + pass_lower_vector_ssa. + * tree-vect-transform.c (vect_min_worthwhile_factor): New. + (vectorizable_operation): Use it. + * tree-vectorizer.c (get_vectype_for_scalar_type): Accept + integer modes for the vector type. + + * defaults.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD. + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): + Do not cope with UNITS_PER_SIMD_WORD == 0. + * tree-vectorizer.c (get_vectype_for_scalar_type): Check + if the scalar type is not bigger than UNITS_PER_SIMD_WORD. + (vectorize_loops): Do not check that UNITS_PER_SIMD_WORD > 0. + * config/i386/i386.h (UNITS_PER_SIMD_WORD): Default to UNITS_PER_WORD. + * config/mips/mips.h (UNITS_PER_SIMD_WORD): Likewise. + * config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Likewise. + * config/sparc/sparc.h (UNITS_PER_SIMD_WORD): Likewise. + + * config/alpha/alpha.h (UNITS_PER_SIMD_WORD): Remove. + * config/bfin/bfin.h (UNITS_PER_SIMD_WORD): Remove. + * config/ia64/ia64.h (UNITS_PER_SIMD_WORD): Remove. + + * doc/tm.texi (UNITS_PER_WORD): Rephrase more accurately. + (UNITS_PER_SIMD_WORD): New. + +2005-04-27 Nathan Sidwell + + * config/ia64/ia64.c (ia64_encode_addr_area): Use gcc_assert and + gcc_unreachable as appropriate. + (ia64_expand_load_address, ia64_expand_tls_address, + ia64_split_tmode, ia64_split_tmode_move, ia64_expand_compare, + ia64_expand_vecint_compare, ia64_expand_vecint_minmax, + next_scratch_gr_reg, ia64_initial_elimination_offset, + ia64_expand_prologue, ia64_expand_epilogue, + ia64_output_dwarf_dtprel, ia64_print_operand, + ia64_register_move_cost, first_instruction, rws_access_regno, + update_set_flags, rtx_needs_barrier, group_barrier_needed_p, + ia64_sched_init, ia64_variable_issue, + ia64_first_cycle_multipass_dfs_lookahead_guard, + ia64_dfa_new_cycle, issue_nops_and_insn, get_template, bundling, + ia64_st_address_bypass_p, ia64_ld_address_bypass_p, process_set, + process_for_unwind_directive, ia64_hpux_file_end): Likewise. + * config/ia64/ia64.h (ASM_OUTPUT_ADDR_VEC_ELT): Likewise. + * config/ia64/ia64.md (*arm_movdi_vfp, *movdf_vfp): Likewise. + * config/ia64/predicates.md (got_symbolic_operand, + sdata_symbolic_operand): Likewise. + * config/ia64/vect.md (vcondv2sf): Likewise. + +2005-04-27 Matt Thomas + + * config/vax/vax.c (legitimate_constant_address_p): New. Formerly + CONSTANT_ADDRESS_P in config/vax/vax.h + (legitimate_constant_p): Added. Formerly CONSTANT_P in vax.h. + (INDEX_REGISTER_P): New. + (BASE_REGISTER_P): New. + (indirectable_constant_address_p): New. Adapted from + INDIRECTABLE_CONSTANT_ADDRESS_P in vax.h. Use SYMBOL_REF_LOCAL_P. + (indirectable_address_p): New. Adapted from + INDIRECTABLE_ADDRESS_P in vax.h. + (nonindexed_address_p): New. Adapted from + GO_IF_NONINDEXED_ADDRESS in vax.h. + (index_temp_p): New. Adapted from INDEX_TERM_P in vax.h. + (reg_plus_index_p): New. Adapted from GO_IF_REG_PLUS_INDEX in vax.h. + (legitimate_address_p): New. Adapted from + GO_IF_LEGITIMATE_ADDRESS in vax.h. + (vax_mode_dependent_address_p): New. Adapted from + GO_IF_MODE_DEPENDENT_ADDRESS in vax.h. + * config/vax/vax.h (CONSTANT_ADDRESS_P): Use + legitimate_constant_address_p. + (CONSTANT_P): Use legitimate_constant_p. + (INDIRECTABLE_CONSTANT_ADDRESS_P): Removed. + (INDIRECTABLE_ADDRESS_P): Removed. + (GO_IF_NONINDEXED_ADDRESS): Removed. + (INDEX_TEMP_P): Removed. + (GO_IF_REG_PLUS_INDEX): Removed. + (GO_IF_LEGITIMATE_ADDRESS): Use legitimate_address_p. Two + definitions, depending on whether REG_OK_STRICT is defined. + (GO_IF_MODE_DEPENDENT_ADDRESS): Use vax_mode_dependent_address_p. + Two definitions, depending on whether REG_OK_STRICT is defined. + * config/vax/vax-protos.h (legitimate_constant_address_p): Prototype + added. + (legitimate_constant_p): Prototype added. + (legitimate_address_p): Prototype added. + (vax_mode_dependent_address_p): Prototype added. + +2005-04-27 Kazu Hirata + + * tree.h (phi_arg_d): Expand a comment in phi_arg_d. + +2005-04-27 Joseph S. Myers + + PR c/21213 + * c-decl.c (finish_struct): Don't dereference NULL TYPE_FIELDS of + transparent union. + +2005-04-27 Joseph S. Myers + + PR c/20740 + * c-format.c (init_dynamic_asm_fprintf_info): Give errors, not + assertion failures, if __gcc_host_wide_int__ is not properly + defined. + (init_dynamic_diag_info): Give errors, not assertion failures, if + location_t, tree or __gcc_host_wide_int__ are not properly + defined. + +2005-04-26 Kazu Hirata + + * tree-ssa-loop-ivopts.c (ivopts_data, decl_rtl_to_reset, + n_iv_uses, iv_use, n_iv_cands, iv_cand, + tree_ssa_iv_optimize_init, record_use, add_candidate_1, + prepare_decl_rtl, free_loop_data, + tree_ssa_iv_optimize_finalize): Use the VEC API instead of + VARRAY. + + * tree.h (tree_phi_node): Add a comment about the order of PHI + arguments. + +2005-04-26 Paul Brook + + * config/arm/arm.md (thumb_mulsi3): Use two-operand assembly form. + +2005-04-26 Nathan Sidwell + + * config/mips.mips.c (mips_legitimize_tls_address): Use + gcc_unreachable. + + * config/mmix/mmix.c (mmix_assemble_integer): Use gcc_assert. + * config/mmix/crti.asm (_init): Reword comment to avoid 'abort'. + * config/mmix/mmix.md (nonlocal_goto_receiver): Likewise. + + * config/sparc/sparc.h (enum reg_class): Reword comment to avoid + 'abort'. + +2005-04-26 Jeff Law + + * tree-flow-inline.h (op_iter_next_must_and_may_def): New. + (op_iter_init_must_and_may_def): Likewise. + (unmodifiable_var_p): Move to a later point in the file. + * tree-ssa-operands.h (FOR_EACH_SSA_MUST_AND_MAY_DEF_OPERAND): New. + * tree-ssa-dse.c (need_imm_uses_for): Remove, no longer needed. + (dse_record_phis): Directly check for virtual operands rather than + using need_imm_uses_for. + (dse_optimize_stmt): Handle V_MUST_DEF operands. Handle case where + store has multiple V_{MAY,MUST}_DEF operands. + +2005-04-26 Andrew MacLeod + + * tree-cfg.c (bsi_replace): Delink immediate uses for the original + stmt. + +2005-04-26 Kazu Hirata + + * tree-cfg.c (lv_adjust_loop_header_phi): Speed up moving a + call to find_edge outside a loop to go through a PHI chain. + +2004-04-26 Richard Guenther + + PR tree-optimization/17598 + * fold-const.c (fold_binary): Fold comparisons of addresses + of COMPONENT_REFs which reference the same field to + comparisons of the addresses of the base objects. + +2005-04-26 Julian Brown + + * config/arm/arm.c (arm_return_in_msb): New function. + (arm_must_pass_in_stack): New function. + (TARGET_RETURN_IN_MSB): Define target hook. + (TARGET_MUST_PASS_IN_STACK): Define target hook. + (arm_function_value): Pad small aggregate return. + (arm_pad_arg_upward): New function. + (arm_pad_reg_upward): New function. + * config/arm/arm.h (PROMOTE_FUNCTION_MODE): Include complex values. + (FUNCTION_ARG_PADDING): Define macro. + (BLOCK_REG_PADDING): Define macro. + (PAD_VARARGS_DOWN): Correct padding for AAPCS. + * config/arm/arm-protos.h (arm_pad_arg_upward): Declare function. + (arm_pad_reg_upward): Declare function. + +2005-04-26 Kazu Hirata + + * basic-block.h (ei_cond): New. + (FOR_EACH_EDGE): Call ei_cond. + + PR tree-optimization/21047 + * fold-const.c (fold_binary): Abort on ASSERT_EXPR. + (fold): Don't handle ASSERT_EXPR. + +2005-04-25 Roger Sayle + + * sched-deps.c (sched_analyze_1): On STACK_REGS targets, x87, treat + all writes to any stack register as a read/write dependency on + FIRST_STACK_REG. + (sched_analyze_2): Likewise, for reads from any stack register. + +2005-04-25 Richard Henderson + + * final.c (output_addr_const): Revert 2005-04-09 change. + +2005-04-25 Mike Stump + + * config/darwin.c (darwin_encode_section_info): Always set + MACHO_SYMBOL_STATIC for all ! TREE_PUBLIC symbols. + +2005-04-25 Kaveh R. Ghazi + + * collect2.c, gcc.c, gcov-dump.c, gcov.c, gen-protos.c, + gensupport.c, protoize.c, toplev.c: Replace calls to + `unlock_stream' with `unlock_std_streams'. + +2005-04-25 Devang Patel + + * dbxout.c (dbxout_type): Emit attribute vector. + +2005-04-05 Paul Brook + + * target-def.h (TARGET_CXX_USE_AEABI_ATEXIT): Define. + * target.h (struct gcc_target): Add cxx.use_aeabi_atexit. + * config/arm/arm.c (arm_cxx_atexit_name): New function. + (TARGET_CXX_USE_AEABI_ATEXIT): New macro. + * cp/decl.c (get_atexit_node): Reorder arguments for __aeabi_atexit. + (register_dtor_fn): Likewise. + * doc/tm.texi: Document TARGET_CXX_USE_AEABI_ATEXIT. + +2005-04-25 Ian Lance Taylor + + * c-common.def (EXPR_STMT): Remove, moved to C++ frontend. + * c-common.h (EXPR_STMT_EXPR): Don't define. + (c_common_stmt_codes): Don't define. + * c-dump.c (c_dump_tree): Remove EXPR_STMT case. + * c-gimplify.c (gimplify_expr_stmt): Remove. + (c_gimplify_expr): Remove EXPR_STMT case. + * c-objc-common.c (c_objc_common_init): Remove stmt_codes and call + to INIT_STATEMENT_CODES. + * c-pretty-print.c (pp_c_statement): Just call dump_generic_node. + +2005-04-25 Jan Hubicka + + * tree-cfg.c (tree_duplicate_bb): Duplicate EH region too. + + * except.c: Include diagnostic.h + (dump_eh_tree, verify_eh_tree): New functions. + * except.h (verify_eh_tree, dump_eh_tree, verify_eh_edges): Declare. + * tree-cfg.c (tree_verify_flow_info): verify eh edges. + (dump_function_to_file): dump eh tree. + * tree-eh.c (mark_eh_edge): New function. + (mark_eh_edge_found_error): New static variable. + (verify_eh_edges): New function. + +2005-04-25 Nathan Sidwell + + * tree-ssa-alias.c (fieldoff_t): Remove. + (fieldoff_s): typedef the structure itself. Create a vector of + objects. + (push_fields_onto_fieldstack): Return count of fields pushed. + Remove peeling of first field. Adjust. + (fieldoff_compare): Adjust. + (create_overlap_variables_for): Adjust. + +2005-04-25 Joseph S. Myers + + * doc/invoke.texi (Blackfin Options): Avoid empty @opindex line. + +2005-04-25 Joseph S. Myers + + PR bootstrap/21215 + * doc/install.texi: Document correct assembler and linker to use + on i?86-*-solaris2.10. + +2005-04-25 Steven Bosscher + + Fix PR tree-optimization/21173 + + * tree-ssa-pre.c (create_expression_by_pieces): Simplify code. + Unshare expression we pass to force_gimple_operand. + +2005-04-25 J"orn Rennecke + Stephen Clarke + Roger Sayle + + PR rtl-optimization/20413 + * cfgrtl.c (redirect_edge_and_branch): Use Pmode instead of + VOIDmode for LABEL_REF. + * final.c (shorten_branches): Likewise. + * jump.c (mark_all_labels, redirect_exp_1): Likewise. + * loop.c (reg_dead_after_loop): Likewise. + * varasm.c (decode_addr_const): Likewise. + * doc/rtl.texi: Document mode requirement for LABEL_REF. + +2005-04-25 Ralf Corsepius + + * config.gcc (avr-*-*): Remove redundant "case". + +2005-04-25 Kazu Hirata + + * tree-vect-analyze.c (vect_mark_relevant): Take + VEC(tree,heap) instead of varray_type as an argument. + (vect_mark_stmts_to_be_vectorized): Change the type of + worklist to VEC(tree,heap). Adjust uses of worklist. + +2005-04-24 Devang Patel + + * config/rs6000/darwin.h (ASM_OUTPUT_MAX_SKIP_ALIGN): New. + +2005-04-24 Ian Lance Taylor + + * c-semantics.c (build_stmt): Remove test of specific tree codes + for TREE_SIDE_EFFECTS handling. + +2005-04-24 Per Bothner + + * c-opts.c (finish_options): Make the line-number of the + location 0, as assumed elsewhere, rather than 1. + +2005-04-24 Kazu Hirata + + * tree-ssa-uncprop.c (equiv_stack): Change the type o + VEC(tree,heap). + (tree_ssa_uncprop, uncprop_finalize_block, + uncprop_initialize_block): Update uses of equiv_stack. + +2005-04-24 Richard Henderson + + PR rtl-opt/21163 + * simplify-rtx.c (simplify_binary_operation) : Check + for SCALAR_INT_MODE_P instead of not MODE_CC before returning + constm1_rtx. + : Use CONST0_RTX. + : Use CONST0_RTX and CONST1_RTX. + : Likewise. + +2005-04-24 Kaveh R. Ghazi + + * collect2.c (main): Unlock the stdio streams. + * gcc.c (main): Likewise. + * gcov-dump.c (main): Likewise. + * gcov.c (main): Likewise. + * gen-protos.c (main): Likewise. + * gensupport.c (init_md_reader_args_cb): Likewise. + * protoize.c (main): Likewise. + * toplev.c (general_init): Likewise. + +2005-04-24 Jakub Jelinek + + PR middle-end/20991 + * cgraph.h (cgraph_local_info): Add vtable_method field. + * varasm.c (mark_decl_referenced): If cgraph_global_info_ready + and node is vtable_method, finalized and not reachable, don't do + anything. + +2005-04-24 Kazu Hirata + + * tree-ssa-copy.c (copy_prop_visit_cond_stmt): Use + COMPARISON_CLASS_P. + * tree-ssa-pre.c (create_value_expr_from): Use + CONSTANT_CLASS_P and REFERENCE_CLASS_P. + * tree-ssa-propagate.c (stmt_makes_single_load, + stmt_makes_single_store): Use REFERENCE_CLASS_P. + * tree-vect-transform.c (vect_is_simple_cond): Use + COMPARISON_CLASS_P. + * tree-vrp.c (extract_range_from_assert, + build_assert_expr_for, fp_predicate, has_assert_expr): Use + COMPARISON_CLASS_P. + + * tree-ssa-live.c (build_tree_conflict_graph): Change the type + of tpa_to_clear to VEC(int,heap). Update uses of + tpa_to_clear. Free tpa_to_clear at the end. + +2005-04-24 Andrew Pinski + + * tree.h (TREE_THIS_VOLATILE): Document the effect on a + function decl. + +2005-04-24 Nathan Sidwell + + * config/rs6000/rs6000.c (rs6000_override_options): Use gcc_assert + and gcc_unreachable as appropriate. + (num_insns_constant, output_vec_const_move, + build_mask64_2_operands, rs6000_output_dwarf_dtprel, + rs6000_emit_set_const, rs6000_emit_move, + spe_build_register_parallel, function_arg, + rs6000_move_block_from_reg, altivec_expand_predicate_builtin, + spe_expand_predicate_builtin, spe_expand_evsel_builtin, + rs6000_expand_builtin, spe_init_builtins, altivec_init_builtins, + rs6000_common_init_builtins, expand_block_clear, + expand_block_move, validate_condition_mode, ccr_bit, extract_MB, + extract_ME, rs6000_get_some_local_dynamic_name, + rs6000_output_function_entry, print_operand, + print_operand_address, rs6000_generate_compare, rs6000_emit_sCOND, + output_cbranch, output_e500_flip_gt_bit, + rs6000_emit_vector_compare, rs6000_emit_vector_compare, + rs6000_emit_cmove, rs6000_emit_minmax, rs6000_split_multireg_move, + compute_save_world_info, rs6000_stack_info, + rs6000_emit_load_toc_table, rs6000_frame_related, + spe_synthesize_frame_save, rs6000_emit_epilogue, + rs6000_output_function_epilogue, rs6000_hash_constant, output_toc, + output_function_profiler, rs6000_trampoline_size, + rs6000_initialize_trampoline, find_addr_reg, + rs6000_machopic_legitimize_pic_address, + rs6000_initial_elimination_offset, + rs6000_dbx_register_number): Likewise. + * config/rs6000/rs6000.md (*fix_truncdfsi2_internal, + *movdf_hardfloat32, *movdf_softfloat32, *fix_trunctfsi2_internal, + *movti_power, *movti_string, call, call_value, sibcall, + sibcall_value): Likewise. + * config/rs6000/spe.md (*movdf_e500_double, + *movv2si_internal): Likewise. + * config/rs6000/rs6000.h (PREFERRED_RELOAD_CLASS): Remove 'abort' + from comment. + +2005-04-24 Richard Henderson + + PR target/21101 + * config/i386/i386.h (CANNOT_CHANGE_MODE_CLASS): Move guts to ... + * config/i386/i386.c (ix86_cannot_change_mode_class): ... here. + Deny modes smaller than 4 bytes. + * config/i386/i386-protos.h: Update. + +2005-04-24 Ralf Corsepius + + * config.gcc (h8300-*-rtems*): Add h8300-*-rtemscoff*. + Switch h8300-*-rtems* to ELF. + +2005-04-24 Kazu Hirata + + * vec.h (VEC_safe_grow): Replace grow with safe_grow. + +2005-04-23 Kazu Hirata + + * ipa-inline.c, tree-ssa-operands.h: Fix comment typos. + +2005-04-23 Richard Guenther + + PR middle-end/21082 + * fold-const.c: Fold &a[i]-&a[j] to i-j. + +2005-04-23 Zdenek Dvorak + + * tree-ssa-loop-niter.c (tree_simplify_using_condition): Expand simple + definitions of ssa names in condition. Split recusive part to ... + (tree_simplify_using_condition_1): New function. + (expand_simple_operations): New function. + +2005-04-23 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (struct cost_pair): Add value field. + (find_interesting_uses_cond): Do not use integer_zerop and + integer_nonzerop to check for integer constants. + (set_use_iv_cost): Record the value field. + (determine_use_iv_cost_generic, determine_use_iv_cost_address, + determine_use_iv_cost_outer): Set the value field of the cost pair. + (may_eliminate_iv): Do not return the comparison code. + (iv_elimination_compare): New function. + (determine_use_iv_cost_condition): Set the value field. Record + noneliminable invariants correctly. + (rewrite_use_compare, rewrite_use_outer): Use the value field. + +2005-04-23 DJ Delorie + + * diagnostic.c (warning): Accept parameter to classify warning option. + (warning0): New, for when a pointer to an error() like function is needed. + * errors.c (warning): Likewise. + * errors.h (warning, warning0): Adjust prototypes. + * toplev.h (warning, warning0): Likewise. + + * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, + c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, + c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, + fold-const.c, fortran/trans-decl.c, function.c, gcse.c, + genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, + reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, + tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, + tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. + + * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, + config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, + config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, + config/darwin.c, config/darwin.h, config/h8300/h8300.c, + config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, + config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, + config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, + config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, + config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, + config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, + config/rs6000/aix52.h, config/rs6000/darwin.h, + config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, + config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, + config/sh/symbian.c, config/sol2-c.c, config/sol2.c, + config/stormy16/stormy16.c, config/v850/v850-c.c, + config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() + callers. + +2005-04-23 Richard Henderson + + PR rtl-opt/21102 + * simplify-rtx.c (simplify_binary_operation): Fix mode check before + performing some integral scalar simplifications. + +2005-04-23 Richard Henderson + + PR target/21099 + * config/i386/i386.c (ix86_split_to_parts): Use proper mode when + simplifying CONST_VECTOR. + +2005-04-23 Kazu Hirata + + * tree-ssa-live.c (live_worklist): Take a stack allocated on + heap as an argument. Update uses of stack. + (calculate_live_on_entry): Allocate stack on heap. + + * tree-ssa-live.c (build_tree_conflict_graph): Allocate + partition_link and tpa_nodes on heap. + + * tree-ssa-dce.c (worklist): Change to VEC(tree,heap). + (mark_stmt_necessary, propagate_necessity, + mark_really_necessary_kill_operand_phis): Update uses of + worklist. + (tree_dce_init): Allocate worklist using VEC_alloc. + (tree_dce_done): Free worklist using VEC_free. + +2005-04-23 Mike Stump + + * config/darwin.c (machopic_indirection_name): Don't use + quotes needlessly. + (darwin_emit_unwind_label): Use user_label_prefix instead of + "_". + +2005-04-23 Kazu Hirata + + * final.c, ipa-inline.c, varasm.c: Fix comment typos. + +2005-04-23 Hans-Peter Nilsson + + * config.gcc : Specify .opt files. + * config/cris/cris.opt, config/cris/elf.opt, config/cris/aout.opt, + config/cris/linux.opt: New files. + * config/cris/aout.h (CRIS_SUBTARGET_SWITCHES) + (CRIS_SUBTARGET_LONG_OPTIONS): Don't define. + (TARGET_ELF): Override to 0. + (CRIS_SUBTARGET_HANDLE_OPTION): Override to handle -melinux and + -melinux-stacksize=N. + * config/cris/cris.c: (cris_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS): Override. + (TARGET_HANDLE_OPTION): Override to cris_handle_option. + (cris_override_options): Use MASK_*, not TARGET_MASK_*. + * config/cris/cris.h (TARGET_MASK_SVINTO, TARGET_SVINTO, + (TARGET_MASK_CCINIT, TARGET_CCINIT, TARGET_MASK_PDEBUG) + (TARGET_PDEBUG, TARGET_MASK_SIDE_EFFECT_PREFIXES) + (TARGET_SIDE_EFFECT_PREFIXES, TARGET_MASK_EXPAND_MUL) + (TARGET_EXPAND_MUL, TARGET_MASK_STACK_ALIGN, TARGET_STACK_ALIGN) + (TARGET_MASK_CONST_ALIGN, TARGET_CONST_ALIGN) + (TARGET_MASK_DATA_ALIGN, TARGET_DATA_ALIGN) + (TARGET_MASK_PROLOGUE_EPILOGUE, TARGET_PROLOGUE_EPILOGUE) + (TARGET_MASK_ETRAX4_ADD, TARGET_ETRAX4_ADD) + (TARGET_MASK_ALIGN_BY_32, TARGET_ALIGN_BY_32, TARGET_MASK_ELF) + (TARGET_ELF, TARGET_MASK_LINUX, TARGET_LINUX) + (TARGET_MASK_AVOID_GOTPLT, TARGET_AVOID_GOTPLT) + (TARGET_MASK_MUL_BUG, TARGET_MUL_BUG, TARGET_SWITCHES) + (CRIS_SUBTARGET_SWITCHES, TARGET_OPTIONS) + (CRIS_SUBTARGET_LONG_OPTIONS): Don't define. + (TARGET_LINUX): Define 0. + (TARGET_DEFAULT): Use MASK_*, not TARGET_MASK_*. + (CRIS_SUBTARGET_DEFAULT): Define to 0, not TARGET_MASK_ELF. + (CRIS_SUBTARGET_DEFAULT): New empty default macro. + * config/cris/linux.h (CRIS_SUBTARGET_SWITCHES): Don't define. + (TARGET_LINUX): Override to 1. + (CRIS_SUBTARGET_DEFAULT): Use MASK_*, not TARGET_MASK_*. + +2005-04-23 Nathan Sidwell + + * haifa-sched.c (schedule_block): Fix thinko in previous + assertification patch. + +2005-04-23 Richard Sandiford + + * config.gcc (hppa[12]*-*-hpux10*): Add pa/pa-hpux.opt to + $extra_options. Also add pa/pa-hpux1010.opt for hpux10.[1-9]*. + (hppa*64*-*-hpux11*): Add pa/pa-hpux1010.h to $tm_file. Add + pa/pa-hpux.opt, pa/pa-hpux1010.opt and pa/pa64-hpux.opt to + $extra_options. Also add pa/pa-hpux1111.opt for hpux11.[1-9]*. + (hppa[12]*-*-hpux11*): Add pa/pa-hpux1010.h to $tm_file. Add + pa/pa-hpux.opt to $extra_options. Also add pa/pa-hpux1111.opt + for hpux11.[1-9]*. + * config/pa/pa.h (architecture_type, rtx_def, pa_arch_string, pa_arch) + (pa_fixed_range_string, pa_cpu_string, pa_unix_string, target_flags) + (MASK_PA_11, MASK_DISABLE_FPREGS, TARGET_DISABLE_FPREGS) + (MASK_NO_SPACE_REGS, TARGET_NO_SPACE_REGS, MASK_JUMP_IN_DELAY) + (TARGET_JUMP_IN_DELAY, MASK_DISABLE_INDEXING, TARGET_DISABLE_INDEXING) + (MASK_PORTABLE_RUNTIME, TARGET_PORTABLE_RUNTIME, MASK_GAS, TARGET_GAS) + (MASK_SOFT_FLOAT, TARGET_SOFT_FLOAT, MASK_LONG_LOAD_STORE) + (TARGET_LONG_LOAD_STORE, MASK_FAST_INDIRECT_CALLS) + (TARGET_FAST_INDIRECT_CALLS, MASK_BIG_SWITCH, TARGET_BIG_SWITCH) + (MASK_PA_20, MASK_SIO, TARGET_SIO, MASK_GNU_LD, TARGET_GNU_LD) + (MASK_LONG_CALLS, TARGET_LONG_CALLS, TARGET_PA_11, TARGET_PA_20) + (TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS) + (SUBTARGET_OPTIONS): Delete. + (TARGET_PA_10): Redefine in terms of TARGET_PA_11 and TARGET_PA_20. + (TARGET_SCHED_DEFAULT): Define to a PROCESSOR_* enum (PROCESSOR_8000) + instead of a string. + * config/pa/pa.c (pa_arch, pa_arch_string, pa_fixed_range_string) + (pa_cpu_string, pa_unix_string): Delete. + (pa_cpu): Initialize to TARGET_SCHED_DEFAULT. + (flag_pa_unix): Initialize based on TARGET_HPUX_11_11 and + TARGET_HPUX_10_10. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (pa_handle_option): New function. + (override_options): Remove handling of -march=, -mfixed-range=, + -mschedule= and -munix=. + * config/pa/pa-hpux.h (SUBTARGET_SWITCHES): Delete. + * config/pa/pa-hpux1010.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa-hpux10.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa-hpux1111.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa-hpux11.h (SUBTARGET_OPTIONS): Delete. + * config/pa/pa64-hpux.h (SUBTARGET_SWITCHES): Delete. + * config/pa/pa64-start.h (TARGET_PA_11, TARGET_PA_20): #undef before + redefining. + * config/pa/pa.opt: New file. + * config/pa/pa-hpux.opt: New file. + * config/pa/pa-hpux1010.opt: New file. + * config/pa/pa-hpux1111.opt: New file. + * config/pa/pa64-hpux.opt: New file. + +2005-04-22 David S. Miller + + * rtl.h (CONST_DOUBLE): Fix comment, a CONST_DOUBLE holds an + integer when it's mode is VOIDmode not DImode. + +2005-04-22 Geoffrey Keating + + * config/rs6000/rs6000.md (sync_add_internal, + sync_addshort_internal, sync_sub_internal, sync_andsi_internal, + sync_anddi_internal, sync_boolsi_internal, sync_booldi_internal, + sync_boolc_internal, sync_boolc_internal2, + sync_boolcc_internal, sync_lock_test_and_set): Use + "bne- $-xxx" rather than local labels. + (sync_lock_release): Add second operand. + (lwsync): Use .long rather than a more meaningful opcode. + * doc/md.texi (Standard Names): Add description of second + parameter to sync_lock_test_and_set. + +2005-04-23 Kazu Hirata + + PR tree-optimization/21088 + * fold-const.c (fold_unary, fold_binary, fold_ternary): + Export. + * tree-vrp.c (compare_values): Use fold_binary to compare + pointers. Use boolean_type_node as the type of a comparison + expression being folded. + * tree.h: Add prototypes for fold_unary, fold_binary, + fold_ternary. + + * tree-ssa-dom.c: Fix formatting. + +2005-04-22 Diego Novillo + + * Makefile.in (tree-into-ssa.o): Add dependency on PARAMS_H. + * lambda-code.c (perfect_nestify): Mark virtual operands in + the moved statement for renaming. + * params.def (PARAM_MIN_VIRTUAL_MAPPINGS): Define. + (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define. + * params.h (MIN_VIRTUAL_MAPPINGS): Define. + (VIRTUAL_MAPPINGS_TO_SYMS_RATIO): Define. + * tree-flow.h (struct var_ann_d): Update comments. + (rewrite_to_new_ssa_names_bb, rewrite_to_new_ssa_names, + allocate_ssa_names, find_phi_node_for, dump_tree_ssa, + debug_tree_ssa, debug_def_blocks, dump_tree_ssa_stats, + debug_tree_ssa_stats, rewrite_ssa_into_ssa, + dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by, + debug_names_replaced_by): Remove declarations. + (delete_update_ssa, get_current_def, set_current_def): Declare. + (rewrite_into_loop_closed_ssa): Add new argument. Update + all callers. + * tree-into-ssa.c: Include params.h. + (old_virtual_ssa_names): Remove. Update all users. + (need_to_replace_names_p): Remove. Update all users. + (struct update_ssa_stats_d): Declare. + (update_ssa_stats): New local. + (dump_tree_ssa, debug_tree_ssa, debug_def_blocks, + dump_tree_ssa_stats, debug_tree_ssa_stats, + dump_update_ssa, debug_update_ssa, + dump_names_replaced_by, debug_names_replaced_by): Declare. + (get_current_def, set current_def): Make extern. + (is_old_name, is_new_name): Protect against references + past the end of the sets. + (add_new_name_mapping): Assert that OLD and NEW are + different SSA names for the same symbol. + When adding a virtual mapping, update stats for virtual + mapping heuristic. + (insert_phi_nodes_for): If UPDATE_P is true, create the + LHS of the new PHI by duplicating SSA name VAR. + (insert_phi_nodes_1): Remove. Update all users. + (insert_phi_nodes): Remove second argument. Update all + users. + (maybe_replace_use, maybe_replace_def): New. + (rewrite_update_stmt): Call them. + (mark_def_interesting): Remove calls to is_gimple_reg. + (prepare_phi_args_for_update): Remove. Update all users. + (prepare_block_for_update): Only process virtual operands + and GIMPLE registers in normal form. + (prepare_use_sites_for): New. + (prepare_names_to_update): Rename from prepare_def_sites. + Call prepare_use_sites_for. + (dump_update_ssa): Rename from dump_repl_tbl. + Update all users. + Show statistics for virtual mapping heuristic. + (debug_update_ssa): Rename from debug_debug_repl_tbl. + (init_update_ssa): Initialize UPDATE_SSA_STATS. + (delete_update_ssa): Make extern. + (mark_set_for_renaming): If the set is empty, do nothing. + (release_ssa_name_after_update_ssa): Update comment. + (insert_updated_phi_nodes_for): Do not remove existing + PHI nodes for symbols. + (switch_virtuals_to_full_rewrite_p): New. + (switch_virtuals_to_full_rewrite): New. + (update_ssa): Call them. + Clear REWRITE_THIS_STMT and REGISTER_DEFS_IN_THIS_STMT + for every statement before updating. + If all the names in NEW_SSA_NAMES have been marked for + removal, do nothing. + Only start at the top of the CFG if there are symbols in + SYMS_TO_RENAME. + (ssa_rewrite_finalize_block): Remove. + (ssa_register_new_def): Remove. + (ssa_rewrite_stmt): Remove. + (ssa_rewrite_phi_arguments): Remove. + (ssa_rewrite_initialize_block): Remove. + (ssa_mark_def_sites): Remove. + (ssa_mark_def_sites_initialize_block): Remove. + (ssa_mark_phi_uses): Remove. + (rewrite_ssa_into_ssa): Remove. + * tree-phinodes.c (find_phi_node_for): Remove. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): + Call update_ssa. + * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): + Remove calls to verify_dominators and + verify_loop_structure. + (tree_unswitch_single_loop): Call update_ssa. + * tree-ssa.c (verify_ssa): Assert that need_ssa_update_p + returns false. + Call verify_stmts. + (delete_tree_ssa): Assert that need_ssa_update_p returns + false. + * tree-vect-transform.c (vect_transform_loop): Call update_ssa. + * tree-vectorizer.c (allocate_new_names, rename_def_op, + free_new_names): Remove. Update all users. + (rename_use_op): Call get_current_def. + (rename_variables_in_bb): Do not handle any real or + virtual definition. + (slpeel_update_phis_for_duplicate_loop): Call + get_current_def and set_current_def instead of using + SSA_NAME_AUX. + (slpeel_update_phi_nodes_for_guard2): Reformat comments. + (slpeel_can_duplicate_loop_p): Call need_ssa_update_p, + ssa_names_to_replace and delete_update_ssa. + * doc/invoke.texi: Document --param min-virtual-mappings + and --param virtual-mappings-ratio. + +2005-04-22 Diego Novillo + + * tree-cfg.c (tree_duplicate_bb): Call create_new_def_for + for newly created PHI nodes. + Call create_new_def_for for every new V_MAY_DEF and + V_MUST_DEF on the copied statement. + (struct ssa_name_map_entry): Remove. + (ssa_name_map_entry_hash): Remove. + (ssa_name_map_entry_eq): Remove. + (allocate_ssa_names): Remove. + (rewrite_to_new_ssa_names_def): Remove. + (rewrite_to_new_ssa_names_use): Remove. + (rewrite_to_new_ssa_names_bb): Remove. + (rewrite_to_new_ssa_names): Remove. + (tree_duplicate_sese_region): Remove variables ver, + definitions, phi, ssa_name_map and bi. + Call need_ssa_update_p instead of any_marked_for_rewrite_p. + Call update_ssa. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Call + update_ssa instead of rewrite_ssa_into_ssa. + * tree-ssa-loop-manip.c (add_exit_phis_edge): Call + create_new_def_for. + (find_uses_to_rename_use): Add argument 'need_phis'. + (find_uses_to_rename_stmt): Do not scan virtual operands. + (find_uses_to_rename): Only scan PHI nodes for + non-virtual names. + (rewrite_into_loop_closed_ssa): Call update_ssa. + (check_loop_closed_ssa_use): Ignore virtual operands. + (check_loop_closed_ssa_stmt): Likewise. + (verify_loop_closed_ssa): Do nothing if CURRENT_LOOPS is + NULL. + (rename_variables, set_phi_def_stmts): Remove. + (tree_duplicate_loop_to_header_edge): Reformat comment. + Remove variables BB, I and DEFINITIONS. + Call need_ssa_update_p. + Call update_ssa. + (lv_adjust_loop_header_phi): Reformat comment. + * tree-ssanames.c (ssa_names_to_rewrite): Remove. + (marked_for_rewrite_p, any_marked_for_rewrite_p, + mark_for_rewrite, unmark_all_for_rewrite, + marked_ssa_names): Remove. Update all users. + (release_ssa_name): If VAR has been registered for SSA + updating, do nothing. + * tree-vrp.c (new_ssa_names, old_ssa_names): Remove. + (build_assert_expr_for): Call register_new_name_mapping. + (insert_range_assertions): Update call to update_ssa. + * tree.h (mark_for_rewrite, unmark_all_for_rewrite, + marked_for_rewrite_p, any_marked_for_rewrite_p, + marked_ssa_names): Remove. + +2005-04-22 Jeff Law + + * tree-ssa-dom.c (block_defs_stack): Remove, no longer needed. + (restore_currdefs_to_original_value): Likewise. + (register_definitions_for_stmt): Likewise. + (tree_ssa_dominator_optimize): No longer initialize CURRENT_DEF + for each variable. Do not allocate/free block_defs_stack either. + Do not iterate if we just thread jumps. Only iterate if the + tree_cleanup_cfg does useful work (temporary). + (dom_opt_initialize_block): No longer push a marker on + BLOCK_DEFS_STACK. + (dom_opt_finalize_block): Removal call to restore currdefs. + Relax restrictions for recording edge equivalences. + (record_equivalences_from_phis): No longer need to track + CURRENT_DEF. + (optimize_stmt): Similarly. + (thread_across_edge): Simplify by removing the requirement that + statements in the block we are threading through must be nops. + (initialize_hash_element): Handle GOTO_EXPR. + +2005-04-22 David S. Miller + + * sched-vis.c (print_value): Use CONST_DOUBLE_LOW and + CONST_DOUBLE_HIGH. + * config/sparc/sparc.c (sparc_rtx_costs): Likewise, and + fix check on CONST_DOUBLE mode. It should be VOIDmode + when it is representing an integer. + +2005-04-22 Nathan Sidwell + + * builtins.c (gimplify_va_arg_expr): Reword comments to avoid + 'abort'. Use gcc_assert and gcc_unreachable as appropriate. + * c-format.c (get_constant, decode_format_attr, get_flag_spec, + find_char_info_specifier_index, + find_length_info_modifier_index): Likewise. + * c-typeck.c (composite_type, pop_init_level): Likewise. + * combine.c (cant_combine_insn_p, try_combine): Likewise. + * cse.c (cse_insn): Likewise + * dominance.c (calc_dfs_tree): Likewise + dwarf2out.c (loc_descriptor_from_tree_1, + add_abstract_origin_attribute, force_decl_die, + force_type_die): Likewise + emit-rtl.c (operand_subword_force): Likewise + explow.c (hard_function_value): Likewise + expmed.c (store_bit_field, expand_divmod, + emit_store_flag_force): Likewise + expr.c (emit_move_multi_word, store_expr, + expand_expr_real_1): Likewise + final.c (this_is_asm_operands, shorten_branches, final_scan_insn, + output_operand): Likewise + flow.c (recompute_reg_usage): Likewise + * function.c (assign_stack_temp_for_type, assign_temp, + handle_epilogue_set): Likewise + * genextract.c (main): Likewise + * gimplify.c (mostly_copy_tree_r, gimplify_return_expr, + gimplify_modify_expr_rhs, gimplify_expr): Likewise + * haifa-sched.c (ready_lastpos, ready_remove_first, ready_element, + ready_remove, rm_line_notes, rm_other_notes, + schedule_block): Likewise + mips-tfile.c (copy_object, out_of_bounds): Likewise + +2005-04-22 David Edelsohn + + PR target/20813 + * config/rs6000/default64.h (TARGET_DEFAULT): Add MASK_PPC_GFXOPT. + * config/rs6000/rs6000.c (processor_target_table): Rename rs64a to + rs64. Add MASK_PPC_GFXOPT to powerpc64 and rs64. + (rs6000_init_libfuncs): Set TFmode optabs to xlq names if + TARGET_XL_COMPAT. + * doc/invoke.texi (PowerPC options): Change rs64a to rs64. + +2005-04-22 Nathan Sidwell + + * lambda-code.c: Define VEC(int,heap), VEC(lambda_loop,heap). + (gcc_tree_to_linear_expression): Convert to heap allocated + vectors. + (gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest, + lbv_to_gcc_expression, lle_to_gcc_expression, + lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest, + perfect_nestify): Likewise. + lambda.h (gcc_loopnest_to_lambda_loopnest, + lambda_loopnest_to_gcc_loopnest): Likewise. + tree-loop-linear.c (linear_transform_loops): Likewise. + +2005-04-22 Eric Botcazou + + * config/sparc/predicates.md (arith_double_operand): Use + trunc_int_for_mode if HOST_BITS_PER_WIDE_INT >=64. + * config/sparc/sparc.md (movqi, movhi, movsi, movqi): Use gen_int_mode. + (DImode, DFmode constant splitters): Likewise. Remove code for + TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT < 64. + (logical constant splitters): Use const_int_operand predicate. + (lshrsi3_extend): Remove code for TARGET_ARCH64 && + HOST_BITS_PER_WIDE_INT < 64. + +2005-04-22 Nathan Sidwell + + * config/pa/pa.c (legitimize_pic_address): Use gcc_assert and + gcc_unreachable as appropriate. + (force_mode, emit_move_sequence, singlemove_string, + output_move_double, output_fp_move_double, find_addr_reg, + output_block_move, output_block_clear, output_and, + output_64bit_and, output_ior, output_64bit_ior, store_reg_modify, + pa_adjust_cost, pa_issue_rate, print_operand, + output_global_address, output_arg_descriptor, output_cbranch, + output_lbranch, output_bb, output_bvb, output_dbra, output_movb, + output_call): Likewise. + * config/pa/pa.md (call, call_value, sibcall, sibcall_value, + prefetch, prefetch_cc, prefetch_nocc): Likewise. + +2005-04-22 Zdenek Dvorak + + * Makefile.in (LIBGCOV): Add _gcov_interval_profiler, + _gcov_pow2_profiler and _gcov_one_value_profiler. + (tree-profile.o): Add GGC_H and gt-tree-profile.h dependency. + (GTFILES): Add $(srcdir)/tree-profile.c. + * gcov-io.h (__gcov_interval_profiler, __gcov_pow2_profiler, + __gcov_one_value_profiler): Declare. + * gimplify.c (force_gimple_operand): Check whether the statements + should be produced in ssa form. + (force_gimple_operand_bsi): New function. + * libgcov.c (__gcov_interval_profiler, __gcov_pow2_profiler, + __gcov_one_value_profiler): New functions. + * rtl-profile.c (rtl_gen_pow2_profiler): Only measure whether + the profiled value is a power of two or not. + * tree-cfg.c (tree_block_ends_with_condjump_p): Handle empty blocks. + * tree-flow.h (in_ssa_p): Declare. + (force_gimple_operand_bsi): Declare. + * tree-into-ssa.c (in_ssa_p): New variable. + (rewrite_into_ssa): Set in_ssa_p. + * tree-outof-ssa.c (rewrite_out_of_ssa): Set in_ssa_p. + * tree-profile.c: Include ggc.h and gt-tree-profile.h. + (gcov_type_node, tree_interval_profiler_fn, tree_pow2_profiler_fn, + tree_one_value_profiler_fn): New variables. + (tree_init_edge_profiler): Initialize the profiler function decls. + (tree_gen_edge_profiler): Use global gcov_type_node. + (prepare_instrumented_value): New function. + (tree_gen_interval_profiler, tree_gen_interval_profiler, + tree_gen_one_value_profiler): Call the library functions instead of + creating instrumentation code. + * tree.c (build_fn_decl): New function. + * tree.h (build_fn_decl): Declare. + * value-prof.c (rtl_divmod_values_to_profile, + rtl_find_values_to_profile, rtl_mod_pow2_value_transform, + tree_mod_pow2_value_transform, tree_find_values_to_profile): + Do not handle may_be_other and precise values of exponents at pow2 + profiler. + (tree_mod_subtract_transform): Reflect that value field of + histogram has changed meaning. + (tree_divmod_values_to_profile): Record the values correctly. + (tree_values_to_profile): Update comment. + * value-prof.h (struct histogram_value_t): Remove pow2 data. + +2005-04-22 Joseph S. Myers + + * varasm.c (do_assemble_alias): Return early if TREE_ASM_WRITTEN + (decl). + +2005-04-22 Nathan Sidwell + + * config/i386/i386.md (length_immediate): Use gcc_assert or + gcc_unreachable, as appropriate. + (*movsi_1, *movqi_1, reload_outqi, *movdi_1_rex64, *pushsf, + *pushsf_rex64, *truncxfsf2_mixed, *truncxfsf2_i387, + *truncxfdf2_mixed, *truncxfdf2_i387, *adddi_1_rex64, + *adddi_2_rex64, *adddi_3_rex64, *adddi_4_rex64, *adddi_5_rex64, + *addsi_1, addsi_1_zext, *addsi_2, *addsi_2_zext, *addsi_3, + *addsi_3_zext, *addsi_4, *addsi_5, *addhi_1_lea, *addhi_1, + *addhi_2, *addhi_3, *addhi_4, *addhi_5, *addqi_1_lea, *addqi_1, + *addqi_1_slp, *addqi_2, *addqi_3, *addqi_4, *addqi_5, addqi_ext_1, + *addqi_ext_1_rex64, *anddi_1_rex64, *andsi_1, *andhi_1, + *ashldi3_1_rex64, *ashldi3_cmp_rex64, *ashlsi3_1, *ashlsi3_1_zext, + *ashlsi3_cmp, *ashlsi3_cmp_zext, *ashlhi3_1_lea, *ashlhi3_1, + *ashlhi3_cmp, *ashlqi3_1_lea, *ashlqi3_1, *ashlqi3_cmp, + pro_epilogue_adjust_stack_1, pro_epilogue_adjust_stack_rex64, + pro_epilogue_adjust_stack_rex64_2, prefetch, *prefetch_sse, + *prefetch_sse_rex): Likewise. + * config/i386/predicates.md (x86_64_immediate_operand, + x86_64_zext_immediate_operand, symbolic_operand, + no_seg_address_operand, aligned_operand, + memory_displacement_operand): Likewise. + * config/i386/sse.md (*mov_internal, + *movv2df_internal): Likewise. + +2005-04-22 Jan Hubicka + + * Makefile.in (ipa.o, ipa-inline.o): New files. + * cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder, + cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes, + cgraph_mark_inline_edge, cgraph_default_inline_p): Declare. + * cgraphunit.c (cgraph_default_inline_p, + cgraph_decide_inlining_incrementally, ncalls_inlined, + nfunctions_inlined, initial_insns, overall_insns, + cgraph_estimate_size_after_inlining, cgraph_estimate_growth, + cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, + cgraph_mark_inline, cgraph_check_inline_limits, + cgraph_default_inline_p, cgraph_recursive_inlining_p, + update_callee_keys, lookup_recursive_calls, + cgraph_decide_recursive_inlining, cgraph_set_inline_failed, + cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining, + cgraph_decide_inlining_incrementally, cgraph_gate_inlining, + pass_ipa_inline): Move to ipa-inline.c + (cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c + * ipa.c: New file. + * ipa-inline.c: New file. + +2005-04-22 Eric Botcazou + + * doc/invoke.texi (SPARC options): Document that -mapp-regs + is turned off by default on Solaris. + +2005-04-21 Roger Sayle + + * c-common.h (objc_build_method_signature): Update prototype. + * stub-objc.c (objc_build_method_signature): Update the stub + implementation to accept and ignore additional parameter. + * c-parser.c (c_parser_objc_method_decl): Reorgnize to pass + the value of ellipsis to objc_build_method_signature instead + of setting TREE_OVERFLOW on the parms TREE_LIST node. + +2005-04-21 Geoffrey Keating + + * config/rs6000/rs6000-protos.h (rs6000_emit_sync): New. + * config/rs6000/rs6000.c (rs6000_emit_vector_compare): Use + gen_rtx_* not gen_rtx_fmt_*. + (rs6000_emit_vector_select): Likewise. + (rs6000_emit_sync): New. + * config/rs6000/rs6000.md (GPR, INT, INT1): New mode macros. + (larx, stcx, cmp): New mode substitutions. + (UNSPEC_SYNC, UNSPEC_SYNC_OP, UNSPEC_SYNC_SWAP, UNSPEC_LWSYNC, + UNSPEC_ISYNC): New constants. + (rlwinm): Give name. + (memory_barrier, isync, lwsync): New insns. + (sync_compare_and_swap, sync_lock_test_and_set): New insn. + (sync_lock_release): New expander. + (sync_add, sync_sub, sync_ior, sync_and, + sync_xor, sync_nand, sync_old_add, + sync_old_sub, sync_old_ior, sync_old_and, + sync_old_xor, sync_old_nand, sync_new_add, + sync_new_sub, sync_new_ior, sync_new_and, + sync_new_xor, sync_new_nand): New expanders. + (sync_add_internal, sync_addshort_internal, + sync_sub_internal, sync_andsi_internal, sync_anddi_internal, + sync_boolsi_internal, sync_booldi_internal, sync_boolc_internal, + sync_boolc_internal2, sync_boolcc_internal): New insns. + + * doc/md.texi (Standard Names): sync_compare_and_swap's operand 0 + is the memory before, not after, the operation. Clarify + barrier requirements. + +2005-04-21 Nathan Sidwell + + * cfghooks.h (struct cfg_hooks): Reword comments to avoid 'abort'. + * lambda.h (lambda_vector_min_nz): Likewise. + * langhooks.h (struct lang_hooks_for_types, + struct lang_hooks): Likewise. + * output.h (assemble_integer, this_is_asm_operands): Likewise. + * tree.h: Likewise. + * vec.h: Likewise. + * tree-flow-inline.h (relink_imm_use): Use gcc_assert. + + * optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword + comments to avoid 'abort'. Use gcc_assert as necessary. + * opts.c (common_handle_option): Likewise. + * pretty-print.c (pp_base_format_text): Likewise. + * print-rtl.c (print_rtx): Likewise. + * read-rtl.c (read_rtx_filename, read_rtx_1): Likewise. + * regmove.c (try_auto_increment): Likewise. + * reload.c (find_valid_class, find_reloads_toplev, + find_equiv_reg): Likewise. + * reload1.c (reload, forget_old_reloads_1, function_invariant_p, + merge_assigned_reloads): Likewise. + * tree-inline.c (inline_forbidden_p_1, + estimate_num_insns_1): Likewise. + * tree-optimize.c (execute_todo): Likewise. + * tree-outof-ssa.c (eliminate_phi): Likewise. + * tree-ssa-alias.c (add_pointed_to_expr): Likewise. + * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise. + * tree-ssa-operands.c (parse_ssa_operands, + get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise. + * tree-ssa-pre.c (find_or_generate_expression): Likewise. + * tree-ssanames.c (release_ssa_name): Likewise. + * tree.c (int_bit_position, int_byte_position, tree_low_cst, + walk_tree): Likewise. + + * tree-ssa-operands.c (verify_abort): Fold into .. + (verify_imm_links): ... here. + +2005-04-21 Richard Henderson + + * config/alpha/sync.md (sync_new_nand): Fix constraints + on non-memory operand for previous inversion. + +2005-04-21 Devang Patel + + PR optimization/20994 + * tree-if-conv.c (find_phi_replacement_condition): Avoid generating + x = !(a == b) : p , q;. + (pass_if_conversion): Verify stmts and flow. + +2005-04-21 Nathan Sidwell + + * optabs.c (gen_conditional_trap): Restore #define. + + * alias.c (true_dependence): Remove 'abort' from comments. Use + gcc_assert and gcc_unreachable as appropriate. + (canon_true_dependence): Likewise. + * bb-reorder.c (connect_traces): Likewise. + * c-common.c (c_add_case_label): Likewise. + * c-decl.c (finish_function): Likewise. + * caller-save.c (insert_restore, insert_save): Likewise. + * cfg.c (update_bb_profile_for_threading): Likewise. + * cfganal.c (flow_active_insn_p): Likewise. + * cfgexpand.c (add_reg_br_prob_note): Likewise. + * cfgrtl.c (rtl_redirect_edge_and_branch_force, rtl_split_edge, + cfg_layout_merge_blocks): Likewise. + * ifcvt.c (cond_exec_process_insns, merge_if_block, + find_if_block): Likewise. + * integrate.c (allocate_initial_values): Likewise. + * jump.c (reverse_condition, reverse_condition_maybe_unordered, + swap_condition, unsigned_condition, signed_condition, + mark_jump_label, invert_jump_1, rtx_renumbered_equal_p, + reg_or_subregno): Likewise. + * lambda-code.c (lambda_compute_auxillary_space, + lambda_transform_legal_p): Likewise. + * lambda-mat.c (lambda_matrix_inverse_hard): Likewise. + * langhooks.c (lhd_set_decl_assembler_name, lhd_type_promotes_to, + lhd_incomplete_type_error, lhd_expand_expr, + lhd_types_compatible_p, lhd_tree_size): Likewise. + * lcm.c (create_pre_exit, optimize_mode_switching): Likewise. + * local-alloc.c (update_equiv_regs): Likewise. + * loop-unroll.c (peel_loop_completely + unroll_loop_constant_iterations, unroll_loop_runtime_iterations, + peel_loop_simple, unroll_loop_stupid, + analyze_iv_to_split_insn): Likewise. + * loop.c (gen_prefetch, find_and_verify_loops, + basic_induction_var): Likewise. + * modulo-sched.c (normalize_sched_times, check_nodes_order): Likewise. + * value-prof.c (tree_find_values_to_profile): Likewise. + * varasm.c (named_section, default_assemble_integer, + decode_addr_const): Likewise. + +2005-04-21 Alan Modra + Fariborz Jahanian + + * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Fix size of + portion of argument passed in fpr. + * expr.c (emit_push_insn): Fix computation of 'offset' used to + decide on partial argument save on stack. + +2005-04-21 Kazu Hirata + + * config/sparc/predicates.md, config/sparc/sparc.md: Fix + comment typos. + +2005-04-21 Jan Hubicka + + * cgraphunit.c: Include tree-pass.h + (cgraph_decide_recursive_inlining, + cgraph_decide_inlining_of_small_function, cgraph_set_inline_failed, + cgraph_decide_inlining): Dump goes to dump_file. + (cgraph_optimize): Call ipa passes instead of inliner. + (cgraph_gate_inlining, pass_ipa_inline): New. + * tree-optimize.c (all_ipa_passes): New static variable. + (register_one_dump_file): Dead with IPA passes. + (register_dump_files): Likewise. + (init_tree_optimization_passes): Initialize IPA passes. + (execute_todo): Do cgraph dump when asked to, do not dump function body + for IPA pass. + * tree-pass.h (TODO_dump_cgraph): New macro. + (ipa_passes): Declare. + * Makefile.in (cgraphunit.o): Add dependency on cgraphunit.h + +2005-04-21 Nathan Sidwell + + * config/i386/i386.c (type_natural_mode): Use gcc_unreachable and + gcc_assert instead of abort. + (classify_argument, examine_argument, construct_container, + contains_128bit_aligned_vector_p, ix86_check_movabs, + standard_80387_constant_opcode, standard_80387_constant_rtx, + ix86_initial_elimination_offset, ix86_compute_frame_layout, + pro_epilogue_adjust_stack, ix86_expand_epilogue, + ix86_address_cost, legitimate_address_p, legitimize_pic_address, + legitimize_tls_address, output_pic_addr_const, + i386_output_dwarf_dtprel, put_condition_code, print_reg, + get_some_local_dynamic_name, print_operand, print_operand_address, + output_387_binary_op, emit_i387_cw_initialization, + output_fix_trunc, output_fp_compare, ix86_output_addr_vec_elt, + ix86_expand_clear, ix86_expand_binary_operator, + ix86_expand_unary_operator, ix86_match_ccmode, ix86_cc_mode, + ix86_cc_modes_compatible, ix86_fp_comparison_codes, + ix86_fp_comparison_arithmetics_cost, ix86_expand_fp_compare, + ix86_expand_branch, ix86_expand_setcc, + ix86_expand_carry_flag_compare, ix86_expand_fp_movcc, + ix86_expand_int_addcc, ix86_split_to_parts, ix86_split_long_move, + ix86_expand_movmem, ix86_expand_call, assign_386_stack_local, + memory_address_length, ix86_attr_length_immediate_default, + ix86_attr_length_address_default, ix86_agi_dependant, + x86_initialize_trampoline, ix86_init_mmx_sse_builtins, + ix86_expand_binop_builtin, ix86_force_to_memory, + ix86_secondary_memory_needed, ix86_avoid_jump_misspredicts, + x86_emit_floatuns): Likewise. + * config/i386/netware.c (gen_regparm_prefix, + i386_nlm_strip_name_encoding): Likewise. + * config/i386/winnt.c (i386_pe_mark_dllexport): Likewise. + +2005-04-21 Nathan Sidwell + + * optabs.c (gen_condiational_trap): Remove #define. + (add_equal_note): Assertify. Remove explicit indirection from + call via function pointer. + (expand_ternary_op, expand_simple_binop, expand_binop, + expand_twoval_unop, expand_twoval_binop, + expand_twoval_binop_libfunc, expand_simple_unop expand_unop, + emit_unop_insn, emit_no_conflict_block, prepare_cmp_insn, + prepare_operand emit_cmp_and_jump_insn_1, emit_cmp_and_jump_insns, + prepare_float_lib_cmp, emit_conditional_move, + emit_conditional_add, gen_add2_insn, gen_add3_insn, + have_add2_insn, gen_sub2_insn, gen_sub3_insn, have_sub2_insn, + expand_float, expand_fix, debug_optab_libfuncs, gen_cond_trap, + vector_compare_rtx, expand_vec_cond_expr): Likewise. + +2005-04-21 Nathan Sidwell + + * vec.h: Update API to separate allocation mechanism from type. + (VEC_safe_grow): New. + * vec.c (calculate_allocation): New. + (vec_gc_o_reserve, vec_heap_o_reserve): Adjust. + (vec_gc_free, vec_heap_free): Remove. + * gengtype-lex.l (DEF_VEC_): Process mult-argument macros. Adjust. + (VEC): Likewise. + (mangle_macro_name): New. + (struct macro_def): New. + (struct macro): Add multiple argument values. + (macro_expans_end): New. + (push_macro_expansion): Chain on new macro. Process multiple + args, create follow on expansion. Return follow on argument. + (macro_input): Deal with multiple arguments. + + * tree.h: Define VEC(tree,heap) and VEC(tree,gc). + (struct tree_binfo): Adjust. + * basic-block.h: Define VEC(edge,gc). + (struct edge_def): Adjust. + (struct basic_block_def, struct edge_iterator): Likewise. + (ei_container, ei_start_1, ei_last_1): Likewise. + * cfg.c (connect_src, connect_dest): Likewise. + * cfgrtl.c (force_nonfallthru_and_redirect) + * dbxout.c (dbxout_type) + * dwarf2out.c (gen_member_die) + * lambda-code.c: Define VEC(int,gc), VEC(lambda_loop,gc). + (gcc_tree_to_linear_expression): Adjust. + (gcc_loop_to_lambda_loop, gcc_loopnest_to_lambda_loopnest, + lbv_to_gcc_expression, lle_to_gcc_expression, + lambda_loopnest_to_gcc_loopnest, can_convert_to_perfect_nest, + perfect_nestify): Likewise. + * lambda.h (gcc_loopnest_to_lambda_loopnest, + lambda_loopnest_to_gcc_loopnest): Adjust prototypes. + * profile.c (instrument_values): Adjust. + * tree-cfg.c (modified_noreturn_calls): Adjust. + (remove_fallthru_edge): Likewise. + * tree-dump.c (dequeue_and_dump): Adjust. + * tree-flow-inline.h (mark_stmt_modified): Adjust. + * tree-flow.h (modified_noreturn_calls): Adjust. + (tree_on_heap): Remove. (yay!) + (register_new_def): Adjust. + * tree-into-ssa.c: Define VEC(int,heap). + (block_defs_stack): Adjust. + (find_idf, insert_phi_nodes, register_new_def, + rewrite_initialize_block, rewrite_finalize_block, + register_new_update_single, rewrite_update_init_block, + rewrite_update_fini_block, rewrite_blocks, + ssa_rewrite_finalize_block, ssa_register_new_def, + ssa_rewrite_initialize_block, rewrite_ssa_into_ssa): Likewise. + * tree-loop-linear.c (linear_transform_loops): Adjust. + * tree-ssa-alias.c: Define VEC(fieldoff_t,heap). + (push_fields_onto_fieldstack, create_overlap_variables_for): Adjust. + * tree-ssa-dom.c (avail_exprs_stack, block_defs_stack, + stmts_to_rescan, const_and_copies_stack, nonzero_vars_stack, + vrp_variables_stack): Adjust declarations. + (tree_ssa_dominator_optimize): Adjust. + (dom_opt_initialize_block, remove_local_expressions_from_table, + restore_nonzero_vars_to_original_value, + restore_vars_to_original_value, + restore_currdefs_to_original_value, dom_opt_finalize_block, + record_var_is_nonzero, record_cond, record_const_or_copy_1, + optimize_stmt, update_rhs_and_lookup_avail_expr, + lookup_avail_expr, record_range): Likewise. + * tree-ssa-pre.c: Define VEC(basic_block,heap). + (compute_antic_aux): Adjust. + (inserted_exprs, create_expression_by_pieces, + insert_into_preds_of_block, eliminate, mark_operand_necessary, + remove_dead_inserted_code, fini_pre): Likewise. + * tree-ssa-propagate.c (interesting_ssa_edges): Adjust. + (varying_ssa_edges, add_ssa_edge, process_ssa_edge_worklist. + ssa_prop_init): Likewise. + * tree-ssa.c: Define VEC(bitmap,heap). + (verify_name_tags): Adjust. + * value-prof.c (rtl_divmod_values_to_profile): Adjust. + (insn_prefetch_values_to_profile, rtl_find_values_to_profile, + tree_divmod_values_to_profile, tree_find_values_to_profile, + value_profile_transformations): Likewise. + * value-prof.h: Define VEC(histogram_value,heap). + * varasm.c: Remove alias_pair pointer typedef, define + VEC(alias_pair,gc). + (finish_aliases_1, finish_aliases_2, assemble_alias): Adjust. + + * config/pa/pa.c (typedef extern_symbol): Typedef the structure, + not a pointer to it. Create an object vector. + (extern_symbols): Turn into an object vector. + (pa_hpux_asm_output_external, pa_hpux_file_end): Adjust. + +2005-04-21 Sebastian Pop + + PR/20742 + * Makefile.in (tree-chrec.o): Depend on params.h. + * params.def (PARAM_SCEV_MAX_EXPR_SIZE): New parameter with + default value 20. + * tree-chrec.c: Depend on params.h. Replace build with buildN, + and fold build with fold_buildN. + (chrec_fold_plus_1): Fail with a chrec_don_know when the size of + the expression exceeds PARAM_SCEV_MAX_EXPR_SIZE. + (tree_contains_chrecs): Compute an estimation of the size of the + given expression. + * tree-chrec.h (tree_contains_chrecs): Modify its declaration. + (tree_does_not_contain_chrecs): Update the use of tree_contains_chrecs. + * tree-scalar-evolution.c (simple_iv): Ditto. + * doc/invoke.texi (scev-max-expr-size): Documented. + +2005-04-21 Richard Sandiford + + * config.gcc (*-*-darwin*): Add darwin.opt to $extra_options. + (i[34567]86-pc-msdosdjgpp*): Likewise i386/djgpp.opt. + (i[34567]86-*-lynxos*, powerpc-*-lynxos*): Likewise lynx.opt. + (i[34567]86-*-sco3.2v5*): Likewise i386/sco5.opt. + (i[34567]86-*-pe, i[34567]86-*-cygwin*, i[34567]86-*-mingw32*) + (i[34567]86-*-uwin*): Likewise i386/cygming.opt. + * config/darwin.h (darwin_one_byte_bool, darwin_fix_and_continue) + (darwin_fix_and_continue_switch, SUBTARGET_OPTIONS): Delete. + * config/darwin.c (darwin_one_byte_bool, darwin_fix_and_continue) + (darwin_fix_and_continue_switch): Delete. + * config/lynx.h (SUBTARGET_OS_LYNX_SWITCHES): Delete. + (SUBTARGET_SWITCHES): Delete. + * config/i386/i386.h (target_flags, MASK_80387, MASK_RTD) + (MASK_ALIGN_DOUBLE, MASK_SVR3_SHLIB, MASK_IEEE_FP, MASK_FLOAT_RETURNS) + (MASK_NO_FANCY_MATH_387, MASK_OMIT_LEAF_FRAME_POINTER) + (MASK_STACK_PROBE, MASK_NO_ALIGN_STROPS, MASK_INLINE_ALL_STROPS) + (MASK_NO_PUSH_ARGS, MASK_ACCUMULATE_OUTGOING_ARGS, MASK_MMX) + (MASK_SSE, MASK_SSE2, MASK_SSE3, MASK_3DNOW, MASK_3DNOW_A) + (MASK_128BIT_LONG_DOUBLE, MASK_64BIT, MASK_MS_BITFIELD_LAYOUT) + (MASK_TLS_DIRECT_SEG_REFS, MASK_NO_RED_ZONE, TARGET_80387) + (TARGET_RTD, TARGET_ALIGN_DOUBLE, TARGET_PUSH_ARGS) + (TARGET_ACCUMULATE_OUTGOING_ARGS, TARGET_SVR3_SHLIB, TARGET_IEEE_FP) + (TARGET_128BIT_LONG_DOUBLE, TARGET_NO_FANCY_MATH_387) + (TARGET_USE_FANCY_MATH_387, TARGET_OMIT_LEAF_FRAME_POINTER) + (TARGET_DEBUG_ADDR, TARGET_DEBUG_ARG): Delete. + (TARGET_FLOAT_RETURNS_IN_80387): Make an alias of TARGET_FLOAT_RETURNS. + (TARGET_64BIT): Undef before redefining. + (TARGET_TLS_DIRECT_SEG_REFS, TARGET_STACK_PROBE) + (TARGET_ALIGN_STRINGOPS, TARGET_INLINE_ALL_STRINGOPS, TARGET_SSE) + (TARGET_SSE2, TARGET_SSE3, TARGET_MMX, TARGET_3DNOW, TARGET_3DNOW_A) + (TARGET_RED_ZONE, TARGET_USE_MS_BITFIELD_LAYOUT, TARGET_SWITCHES) + (TARGET_OPTIONS, SUBTARGET_SWITCHES, SUBTARGET_OPTIONS) + (ix86_fpmath_string, ix86_tls_dialect_string, ix86_cmodel_string) + (ix86_asm_string, ix86_regparm, ix86_regparm_string) + (ix86_preferred_stack_boundary_string, ix86_branch_cost_string) + (ix86_debug_arg_string, ix86_debug_addr_string) + (ix86_align_loops_string, ix86_align_jumps_string) + (ix86_align_funcs_string): Delete. + * config/i386/cygming.h (MASK_NOP_FUN_DLLIMPORT) + (TARGET_NOP_FUN_DLLIMPORT, SUBTARGET_SWITCHES): Delete. + * config/i386/djgpp.h (MASK_BNU210, SUBTARGET_SWITCHES): Delete. + (SUBTARGET_OVERRIDE_OPTIONS): Check TARGET_BNU210. + * config/i386/lynx.h (SUBTARGET_SWITCHES): Delete. + * config/i386/sco5.h (MASK_COFF, TARGET_ELF) + (SUBTARGET_SWITCHES): Delete. + * config/i386/i386.c (ix86_debug_arg_string): Delete. + (ix86_debug_addr_string): Delete. + (ix86_cmodel_string, ix86_asm_string, ix86_tls_dialect_string) + (ix86_fpmath_string, ix86_regparm_string, ix86_regparm) + (ix86_align_loops_string, ix86_align_jumps_string) + (ix86_preferred_stack_boundary_string, ix86_branch_cost_string) + (ix86_align_funcs_string): Make static. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (ix86_handle_option): New function. + (TARGET_USE_MS_BITFIELD_LAYOUT): Delete. + (ix86_ms_bitfield_layout_p): Check TARGET_MS_BITFIELD_LAYOUT. + * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Remove handling + of darwin_fix_and_continue_switch. + (darwin_one_byte_bool): Delete. + * config/rs6000/lynx.h (EXTRA_SUBTARGET_SWITCHES): Delete. + * config/rs6000/rs6000.c (rs6000_override_options): Update assignment + to darwin_one_byte_bool. + * config/darwin.opt, config/lynx.opt, config/i386/cygming.opt, + * config/i386/djgpp.opt, config/i386/i386.opt, + * config/i386/sco5.opt: New files. + +2005-04-21 Eric Botcazou + + * config/sparc/sparc.c (reg_or_0_operand, const1_operand, + fp_zero_operand, fp_register_operand, intreg_operand, + fcc_reg_operand, fcc0_reg_operand, icc_or_fcc_reg_operand, + call_operand, call_operand_address, tgd_symbolic_operand, + tld_symbolic_operand, tie_symbolic_operand, tle_symbolic_operand, + symbolic_operand, symbolic_memory_operand, label_ref_operand, + sp64_medium_pic_operand, data_segment_operand, + text_segment_operand, splittable_symbolic_memory_operand, + reg_or_nonsymb_mem_operand, splittable_immediate_memory_operand, + eq_or_neq, normal_comp_operator, noov_compare_op, + noov_compare64_op, v9_regcmp_op, extend_op, cc_arithop, + cc_arithopn, arith_operand, arith_4096_operand, arith_add_operand, + const64_operand, const64_high_operand, arith11_operand, + arith10_operand, arith_double_operand, arith_double_4096_operand, + arith_double_add_operand, arith11_double_operand, + arith10_double_operand, small_int, small_int_or_double, + uns_small_int, uns_arith_operand, clobbered_register, + input_operand, compare_operand): Delete. + (sparc_emit_set_const32): Use predicates in assertion. Remove special + code for TARGET_ARCH64 && HOST_BITS_PER_WIDE_INT != 64. + (sparc_emit_set_const64): Call gcc_unreachable if H_B_P_W_I == 32. + (GEN_HIGHINT64, GEN_INT64): Delete. + (sparc_emit_set_safe_HIGH64, gen_safe_SET64, gen_safe_OR64, + gen_safe_XOR64): Adjust for above deletion. + (sparc_emit_set_const64): Support only H_B_P_W_I == 64 and CONST_INTs. + Use 'unsigned HOST_WIDE_INT' instead of 'long' for bitmask. + (legitimate_constant_p): Use const_zero_operand instead. + (sparc_extra_constraint_check): Likewise. + * config/sparc/sparc.h (CONST_DOUBLE_OK_FOR_LETTER_P): Remove 'O'. + (PREFERRED_RELOAD_CLASS): Use const_zero_operand. + (PREDICATE_CODES): Delete. + * config/sparc/sparc.md: Include predicates.md. + (All patterns): Adjust for new predicate names. + (cmpdi, cmpdi_sp64): Use arith_operand predicate. + (movhi_const64_special, movsi_const64_special): Add 'K' constraint. + (movdi): Use general_operand predicate. + (movdi_sp64_dbl): Delete. + (movdi_const64_special): Add 'N' constraint. + (movdicc): Use arith10_operand predicate. + (movdi_cc_sp64, movdi_cc_sp64_trunc): Use arith11_operand predicate. + (movdi_cc_reg_sp64): Use arith10_operand predicate. + (movdi_cc_reg_sp64_trunc): Delete. + (cmp_zero_extract, cmp_zero_extract_sp64): Use small_int_operand. + (adddi3_sp64, cmp_ccx_plus, cmp_ccx_plus_set): Use arith_operand. + (subdi3_sp32): Delete. + (subdi3_insn_sp32): Change to define_insn_and_split. + (subdi3_sp64, cmp_minus_ccx, cmp_minus_ccx_set): Use arith_operand. + (muldi3, muldi3_sp64, muldi3_v8plus): Likewise. + (smulsi3_highpart_v8plus, const_smulsi3_highpart_v8plus, + umulsi3_highpart_v8plus, const_umulsi3_highpart_v8plus): Use + small_int_operand predicate. + (divdi3, udivdi3): Use arith_operand predicate. + (udivsi3, udivsi3_sp32, udivsi3_sp64): Use nonimmediate_operand. + (and3_sp64, ior3_sp64, xor3_sp64, + xor_not__sp64) : Use arith_operand predicate. + (xordi3_sp64_dbl): Delete. + (cmp_ccx_arith_op, cmp_ccx_arith_op_set, cmp_ccx_xor_not, + cmp_ccx_xor_not_set, cmp_ccx_arith_op_not, cmp_ccx_arith_op_not_set, + cmp_ccx_neg, cmp_ccx_set_neg, one_cmpl2_sp64, cmp_ccx_not, + cmp_ccx_set_not): Use arith_operand predicate. + (ashrsi3_extend2, lshrsi3_extend2 et al.): Use small_int_operand. + * config/sparc/predicates.md: New file. + +2005-04-21 Kazu Hirata + + PR tree-optimization/14846 + * fold-const.c (fold_single_bit_test_into_sign_test): New, + split out from ... + (fold_single_bit_test): ... here. + (fold_binary): Call fold_single_bit_test_into_sign_test + instead of fold_single_bit_test. + +2005-04-20 James E Wilson + + PR c++/20805 + * dwarf2out.c (gen_variable_die): Don't emit a specification if this + is another declaration. + +2005-04-21 Hans-Peter Nilsson + + * config/cris/predicates.md: New file. + * config/cris/cris-protos.h (cris_store_multiple_op_p) + (cris_movem_load_rest_p): Declare. + * config/cris/cris.c (cris_store_multiple_op): Return bool, not int. + (cris_movem_load_rest_p): Ditto. Globalize. + (cris_bdap_operand, cris_bdap_biap_operand, + cris_orthogonal_operator, cris_commutative_orth_op, + cris_operand_extend_operator, + cris_additive_operand_extend_operator, cris_extend_operator, + cris_plus_or_bound_operator, cris_mem_op, + cris_general_operand_or_symbol, + cris_general_operand_or_gotless_symbol, + cris_general_operand_or_plt_symbol, cris_mem_call_operand, + cris_load_multiple_op): Remove predicate functions. + (cris_symbol, cris_gotless_symbol) : Return 0, don't + abort, for UNSPECs other than CRIS_UNSPEC_PLT. + * config/cris/cris.h (PREDICATE_CODES): Don't define. + * config/cris/cris.md: Include predicates.md. + ("call", "call_value"): Generate CONSTs of Pmode, not VOIDmode. + +2005-04-20 Ian Lance Taylor + + * c-common.def: Remove STMT_EXPR (moved to cp/cp-tree.def). + * c-common.h (STMT_EXPR_STMT): Don't define. + (STMT_EXPR_NO_SCOPE): Don't define. + * c-dump.c (c_dump_tree): Don't handle STMT_EXPR. + * c-pretty-print.c (pp_c_primary_expression): Likewise. + (pp_c_expression): Likewise. + +2005-04-20 Richard Henderson + + PR target/21100 + * config/i386/mmx.md (push1): Fix predicate thinko. + +2005-04-20 Jeff Law + + * reload1.c (reload): Ignore equivalences between pseudos and + read only memory. + +2005-04-20 Joseph S. Myers + + PR c/12913 + * c-tree.h (struct c_label_list): Update comment. + (struct c_label_context): Rename to struct c_label_context_se. + (label_context_stack): Rename to label_context_stack_se. + (C_DECL_UNJUMPABLE_VM, C_DECL_UNDEFINABLE_VM, struct + c_label_context_vm, label_context_stack_vm, c_begin_vm_scope, + c_end_vm_scope): New. + (C_DECL_DECLARED_BUILTIN, C_DECL_USED): Use FUNCTION_DECL_CHECK. + * c-decl.c (pop_scope): Call c_end_vm_scope. + (pushdecl): Call c_begin_vm_scope for variably modified + declarations. + (define_label): Check for jumping into scope of identifier with + variably modified type. Push label on stack for those defined at + current context of identifiers with variably modified type. + (start_function): Create stack level for context of identifiers + with variably modified type. + (finish_function): Pop stack level for context of identifiers with + variably modified type. + * c-typeck.c (label_context_stack): Rename to + label_context_stack_se. + (label_context_stack_vm, c_begin_vm_scope, c_end_vm_scope): New. + (c_finish_goto_label): Check for jumping into scope of identifier + with variably modified type. Push label on stack for those jumped + to from current context of identifiers with variably modified + type. + (struct c_switch): Add blocked_vm. + (c_start_case): Initialize blocked_vm. + (do_case): Check blocked_vm. + (c_finish_case): Add comment. + (c_begin_stmt_expr, c_finish_stmt_expr): Update for renamed + variable label_context_stack. + +2005-04-20 Kazu Hirata + + * tree-ssa-phiopt.c (tree_ssa_phi_opt): Update calls to + conditional_replacement, value_replacement, abs_replacement, + minmax_replacement. + (replace_phi_edge_with_variable): Remove argument BB. + (conditional_replacement, value_replacement, + minmax_replacement, abs_replacement): Remove argument PHI_BB. + Update a call to replace_phi_edge_with_variable. + + * tree-ssa-phiopt.c: Fix comments. + +2005-04-20 Michael Matz + + PR20973 + * reload.c (push_reload, find_dummy_reload): Check for uninitialized + pseudos. + +2005-04-20 Kazu Hirata + + * tree-ssa-phiopt.c: Fix comment typos. + + PR tree-optimization/21116 + * tree-ssa-phiopt.c: Fix a typo. + +2005-04-19 Richard Henderson + + * builtins.c (expand_builtin_sync_operation): Revert last change. + * optabs.c (expand_bool_compare_and_swap): Compare vs old value, + not vs new value. + (expand_compare_and_swap_loop): Likewise. + (expand_sync_operation): Remove fallback from NAND to AND; invert + memory operand when expanding from cmpxchg. + (expand_sync_fetch_operation): Likewise. + * doc/extend.texi (Atomic Builtins): Fix docs for nand and + compare-and-swap. + + * config/alpha/alpha.c (alpha_split_atomic_op): Invert memory operand + when implementing NAND. Fix double-add for AFTER. + * config/alpha/sync.md (sync_nand): Invert memory operand. + (sync_old_nand, sync_new_nand): Likewise. + (sync_compare_and_swap): Fix compare vs zero. Return old + memory value. + (sync_lock_test_and_set): Remove extra label and last + memory barrier. + + * config/i386/sync.md (sync_compare_and_swap): Fix pattern + to return old memory value. + (sync_compare_and_swap_cc): Likewise. + + * config/ia64/ia64.c (ia64_dependencies_evaluation_hook): Early + return pre-reload. Don't consider output or anti dependencies. + * config/ia64/sync.md (IMODE): New. + (modesuffix): Add QI and HI. + (memory_barrier): Simplify expansion. + (sync_compare_and_swap): Use IMODE, not I48MODE. + (cmpxchg_acq_): Likewise. + (sync_lock_test_and_set): Likewise. + (sync_lock_release): Likewise. + +2005-04-19 James A. Morrison + + * fold-const.c (fold_binary): Fold ~(X ^ Y) to ~X ^ Y or X ^ ~Y if + ~X or ~Y simplify. + +2005-04-19 James A. Morrison + + * fold-const (fold_binary): Fold ~X ^ ~ Y to X ^ Y. + +2005-04-20 Michael Pogue + Joseph S. Myers + + * c.opt (Wint-to-pointer-cast, Wpointer-to-int-cast): New options. + * c-typeck.c (build_c_cast): Check these options. + * doc/invoke.texi: Document these options. + +2005-04-20 Kazu Hirata + + * tree-ssa-phiopt.c: Update a comment about the pass. + +2005-04-19 Kazu Hirata + + * tree-ssa-phiopt.c, config/arm/arm.c, config/fr30/fr30.md, + config/mcore/mcore.c: Fix comment typos. + +2005-04-19 Daniel Jacobowitz + + * Makefile.in (libgcc.mk): Pass GCC_FOR_TARGET. + * mklibgcc.in: Use $GCC_FOR_TARGET instead of ./xgcc. + +2005-04-19 Paul Brook + + * config/arm/arm.c (arm_init_libfuncs): Clear mod optabs. + +2005-04-19 Andrew Haley + + PR java/21022 + * dbxout.c (dbxout_type_fields): Check DECL_IGNORED_P before + looking at a field's bitpos. + +2005-04-19 Kaveh R. Ghazi + + * system.h (fopen, fdopen, freopen): Define these to the unlocked + libiberty functions. + +2005-04-19 Kazu Hirata + + PR tree-optimization/21096 + * tree-ssa-copy.c (fini_copy_prop): Free cached_last_copy_of. + +2005-04-19 Alan Modra + + PR target/21098 + * config/rs6000/rs6000.c (rs6000_elf_end_indicate_exec_stack): New. + * config/rs6000/linux64.h (TARGET_ASM_FILE_END): Use the above. + +2005-04-19 Alexandre Oliva + + * tree-cfg.c (dump_function_to_file): Use cfun info only if it + refers to the function being dumped. + +2005-04-18 Daniel Jacobowitz + + * varasm.c (assemble_start_function): Remove reset of in_section. + +2005-04-18 James A. Morrison + + PR tree-optimization/21085 + * fold-const (fold_binary): Don't change X % -C to X % C if C has + overflowed. + +2005-04-19 Ben Elliston + + * doc/invoke.texi (Optimize Options): Refer to the correct + optimisation flag -ftree-dominator-opts, not -ftree-dom. + +2005-04-18 Christopher Jaillet + + * config/rs6000/rs6000.c (machopic_output_stub): Increase + alloca argument to be big enough. + +2005-04-18 Alexandre Oliva + + PR middle-end/21049 + * tree-cfg.c (dump_function_to_file): Do not crash if cfun or + cfun->cfg are NULL. + +2005-04-18 Tom Tromey + + * cgraphunit.c (cgraph_finalize_compilation_unit): Fix a comment + typo. + +2005-04-18 Richard Henderson + + * config/alpha/alpha.c (alpha_split_atomic_op): New. + (alphaev5_insn_pipe): Add LD_L, ST_C, MB types. + (alphaev4_insn_pipe): Likewise. Correct IST and LDSYM pipes. + * config/alpha/alpha-protos.h: Update. + * config/alpha/alpha.md (UNSPECV_MB, UNSPECV_LL, UNSPECV_SC): New. + (UNSPECV_ATOMIC, UNSPECV_CMPXCHG, UNSPECV_XCHG): New. + (attr type): Add ld_l, st_c, mb. + (andsi_internal, andnotsi3, iorsi_internal, one_cmplsi_internal, + iornotsi3, xorsi_internal, xornotsi3): New. + * config/alpha/ev4.md (ev4_ld): Add ld_l. + (ev4_ist_c, ev4_mb): New. + * config/alpha/ev5.md (ev5_st): Add st_c, mb. + (ev5_ld_l): New. + * config/alpha/ev6.md (ev6_ild): Add ld_l. + (ev6_ist): Add st_c. + (ev6_mb): New. + * config/alpha/sync.md: New file. + +2005-04-18 Richard Henderson + + * builtins.c (expand_builtin_sync_operation): Fold nand to and + for constants. + + * optabs.c (expand_sync_operation): Fix typo expanding nand to and. + +2005-04-18 Devang Patel + + * config/rs6000/atlivec.md (mulv4si3): New pattern. + +2005-04-18 James A. Morrison + + PR tree-optimization/20922 + * fold-const.c (fold_binary): Fold X - c > X and X + c < X to false. + Fold X + c >= X and fold X - c <= X to true. + +2005-04-18 James A. Morrison + + * config/ia64/unwind-ia64.c (emergency_reg_state_free): Make an + unsigned int. + (emergency_labeled_state_free): Likewise. + +2005-04-18 Nick Clifton + + * config/h8300/h8300.md (jump): Remove prescan parameter from + calls to final_scan_insn. + + * config/arc/arc.c (arc_output_function_epilogue): Remove prescan + parameter from calls to final_scan_insn. + + * config.gcc (m68hc12): Use the m68hc11.opt file for target + specific options. + (v850e, v850e1): Use the v850.opt file for target specific + options. + +2005-04-18 Kazu Hirata + + PR tree-optimization/21001 + * tree-optimize.c (init_tree_optimization_passes): Move the + first pass_forwprop immediately before pass_vrp. + +2005-04-17 Ian Lance Taylor + + * c-common.def (SIZEOF_EXPR, ARROW_EXPR, ALIGNOF_EXPR): Remove. + * c-common.c (c_sizeof_or_alignof_type): Change second parameter + from enum tree_code op to bool is_sizeof. + * c-common.h (c_sizeof_or_alignof_type): Update declaration. + (c_sizeof, c_alignof): Update calls to c_sizeof_or_alignof_type. + * c-pretty-print.c (pp_c_postfix_expression): Remove ARROW_EXPR + case. + (pp_c_unary_expression): Remove SIZEOF_EXPR and ALIGNOF_EXPR + cases. + (pp_c_expression): Remove ARROW_EXPR, SIZEOF_EXPR, and + ALIGNOF_EXPR cases. + +2005-04-17 Ian Lance Taylor + + * system.h: Poison DONT_ACCESS_GBLS_AFTER_EPILOGUE. + +2005-04-17 Richard Henderson + + * config/alpha/alpha.c (va_list_skip_additions): Only define if + TARGET_ABI_OSF. + (TARGET_STDARG_OPTIMIZE_HOOK): Likewise. + (alpha_stdarg_optimize_hook): Likewise. Allow for one more round + of indirection through ssa names while looking for the gpr counter + field. + (alpha_setup_incoming_varargs) : Make use of the + saved va_list_gpr_size and va_list_fpr_size. + +2005-04-17 Kazu Hirata + + * tree-vrp.c (compare_values): Check that VAL1 and VAL2 are + both pointers or both integers. + + * tree-vrp.c (maybe_add_assert_expr): Don't assert + ASSERT_EXPRs for single-use variable. + + * tree-into-ssa.c: Fix a comment typo. + +2005-04-17 Richard Sandiford + + * config/mips/iris6.h (DRIVER_SELF_SPECS): Check -march as well as + -mipsN before forcing a default of -mips2. + +2005-04-17 Kazu Hirata + + * predict.h (IS_TAKEN): Remove. + * rtl.h (NOTE_PREDICTION): Likewise. + + * modulo-sched.c (CFG_HOOKS): Remove. + + * c-parser.c (N_C_TTYPES): Remove. + + * tree-flow-inline.h (get_stmt_operands): Remove. + * lambda-code.c, tree-ssa-loop-unswitch.c, + tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-propagate.c, + tree-ssa-sink.c, tree-ssa.c, tree-tailcall.c, + tree-vect-transform.c, tree-vectorizer.c, tree-vrp.c): Remove + calls to get_stmt_operands. + * doc/tree-ssa.texi: Don't mention get_stmt_operands. + +2005-04-17 Richard Henderson + + PR target/20375 + * config/alpha/alpha.c (alpha_setup_incoming_varargs): Advance a copy + of CUMULATIVE_ARGS past the last named argument. + (alpha_va_start): Expect pretend_args_size only if strictly less than + 6 named arguments. + +2005-04-17 Kazu Hirata + + PR middle-end/21024 + * builtins.c (expand_builtin_strcat): Convert the result of + strlen to the right type. + * fold-const.c (fold_binary) : Use fold_convert to + avoid creating type mismatches. + : Pass op0 and op1 to fold_build2 to avoid creating + type mismatches. + + * c-lex.c (WCHAR_TYPE_SIZE, WCHAR_BYTES): Remove. + +2005-04-16 Richard Henderson + + PR target/21051 + * builtins.c (expand_builtin) : + Use the mode of boolean_type_node when the user doesn't provide one. + * config/ia64/sync.md (sync_lock_release): Use operand 1. + +2005-04-16 Alexandre Oliva + + PR target/20126 + * loop.c (loop_givs_rescan): Handle non-replaceable (plus (reg) + (const)). + + * tree-scalar-evolution.c (interpret_rhs_modify_expr): Fix typo in + comment. + +2005-04-16 Roger Sayle + Steven Bosscher + + * fold-const.c (fold_binary_to_constant): Delete obsolete comment. + (fold_unary_to_constant): Likewise. + +2005-04-16 Kazu Hirata + + * basic-block.h: Adjust the value of PROP_SCAN_DEAD_STORES, + PROP_ASM_SCAN. + +2005-04-16 Gerald Pfeifer + + * doc/install.texi (Specific): Avoid using asterisks in @anchor + names related to target triplets. + Remove i?86-*-esix from platform directory. + Remove powerpc-*-eabiaix from platform directory. + +2005-04-16 Joseph S. Myers + + PR middle-end/20491 + * config/ia64/ia64.c (rtx_needs_barrier): Recurse instead of + falling through from SUBREG case to REG. + +2005-04-15 Roger Sayle + + * fold-const.c (fold_relational_hi_lo): Delete function and prototype. + (fold_binary): Update comment mentioning fold_relational_hi_lo. + (fold_binary_to_constant): Simplify using fold_binary. + (fold_unary_to_constant): Likewise, simplify using fold_unary. + +2005-04-15 Rainer Orth + + * gthr-posix.c (pthread_cancel): Define. + (pthread_mutexattr_init): Likewise. + (pthread_mutexattr_settype): Likewise. + (pthread_mutexattr_destroy): Likewise. + +2005-04-15 David S. Miller + + PR target/20673 + * config/sparc/sparc.h (sparc_hard_reg_printed): Mark as GTY(()). + +2005-04-15 Kazu Hirata + + PR tree-optimization/21031 + * tree-ssa-forwprop.c (ssa_name_defined_by_comparison_p): New. + (forward_propagate_into_cond_1): Call it. Forward propagate + integer-integer casts into COND_EXPRs. + +2005-04-15 Dave Korn + + * gcc.c (default_compilers): Clarify obscure error message when + reading from standard input. + +2005-04-15 Kazu Hirata + + * basic-block.h (PROP_EQUAL_NOTES): Remove. + * flow.c (propagate_one_insn): Don't use PROP_EQUAL_NOTES. + + * tree-ssa-alias.c (init_alias_info): Remove a call to + get_stmt_operands. + +2005-04-15 Andrew MacLeod + + * tree-vect-analyze.c (vect_stmt_relevant_p): Process immediate uses + of non-virtual PHI nodes like we use to. + +2005-05-15 Paolo Bonzini + + * genattrtab.c (ATTR_EQ_ATTR_P): Remove. + (attr_copy_rtx): Do not use it. + +2005-04-15 Andrew Macleod + + * doc/tree-ssa.texi: Grammer/abbreviation updates. + +2005-04-15 Diego Novillo + + * tree-vect-transform.c (vectorizable_store): Mark necessary + objects in the vectorized store needing renaming. Update the + SSA graph for V_MAY_DEF operands in the original store. + +2005-04-14 Daniel Berlin + + * tree-ssa-pre.c (compute_avail): It's okay to have + TREE_INVARIANT's here, and value number the resulting expressions. + (create_expression_by_pieces): Make sure operands that were + min_invariant when we started, stay that way. + +2005-04-15 David Edelsohn + + * doc/install.texi (*-ibm-aix*): Add comment about system limits. + +2005-04-15 Kazu Hirata + + PR tree-optimization/20936. + * tree-ssa-ccp.c (visit_assignment): Fix a typo. + +2005-04-15 Volker Reichelt + + * doc/invoke.texi: Fix typos. + * doc/md.texi: Likewise. + * doc/rtl.texi: Likewise. + * doc/sourcebuild.texi: Likewise. + * doc/tm.texi: Likewise. + +2005-04-15 Uros Bizjak + + PR tree-optimization/21004 + * convert.c (convert_to_integer): Convert ceilf, ceill, floorf + and floorl in c99 mode only. + * builtins.c (expand_builtin_int_roundingfn): Assert that + fallback_fndecl is not NULL_TREE. + +2005-04-15 Kazu Hirata + + * cfgrtl.c (purge_all_dead_edge): Remove an unused argument. + * basic-block.h: Update the prototype for + purge_all_dead_edges. + * cfgexpand.c (tree_expand_cfg): Update a call to + purge_all_dead_edges. + * combine.c (combine_instructions): Likewise. + * passes.c (rest_of_handle_old_regalloc, rest_of_handle_cse, + rest_of_handle_cse2, rest_of_handle_gcse, + rest_of_handle_postreload): likewise. + +2005-04-15 Alexandre Oliva + + PR middle-end/20739 + * gimplify.c (gimplify_addr_expr): Compensate for removal of + e.g. cv-qualification conversions. + +2005-04-14 Mike Stump + + * config/darwin-c.c (framework_construct_pathname): We must + find all headers of a framework in the first instance of it + found in the seach path. + +2005-04-14 Kazu Hirata + + PR tree-optimization/21021 + * tree-vrp.c (compare_values): Work around a bug in the front + end that produces a comparison of mismatched types. + +2004-04-14 Richard Henderson + + * config/ia64/ia64.h (enum fetchop_code): Remove. + (enum ia64_builtins): Move ... + * config/ia64/ia64.c (enum ia64_builtins): ... here. Remove all + members except BSP and FLUSHRS. + (ia64_init_builtins): Remove __sync builtins. + (ia64_expand_builtin): Likewise. + (ia64_expand_fetch_and_op, ia64_expand_op_and_fetch): Remove. + (ia64_expand_compare_and_swap, ia64_expand_lock_test_and_set): Remove. + (ia64_expand_lock_release): Remove. + * config/ia64/ia64.md (mf): Move to sync.md. + (mf_internal, fetchadd_acq_si, fetchadd_acq_di, cmpxchg_acq_si, + cmpxchg_acq_di, xchgsi, xchgdi): Likewise. + * config/ia64/sync.md: New file. + (memory_barrier): Rename from mf. + (fetchadd_acq_): Macroize from _si/_di patterns. + (cmpxchg_acq_): Likewise. + (sync_lock_test_and_set): Likewise. + + * config/ia64/ia64intrin.h: Define nothing for C; limit #defines + to c++. Remove __sync* declarations. s/_si/_4/. s/_di/_8/. + +2004-04-14 Richard Henderson + + * config/i386/i386.c (x86_cmpxchg, x86_xadd): New. + (ix86_compare_emitted): New. + (ix86_expand_compare): Use ix86_compare_emitted if set. + (ix86_expand_setcc): Only emit REG_EQUAL if both ix86_compare_op0 + and ix86_compare_op0 are set. + * config/i386/i386.h (x86_cmpxchg, x86_xadd): Declare. + (TARGET_CMPXCHG, TARGET_XADD): New. + (ix86_compare_emitted): Declare. + * config/i386/i386.md: Include sync.md + (UNSPECV_CMPXCHG_1, UNSPECV_CMPXCHG_2): New. + (UNSPECV_XCHG, UNSPECV_LOCK): New. + * config/i386/sync.md: New file. + +2004-04-14 Richard Henderson + + PR middle-end/14311 + * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, + BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, + BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, + BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, + BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, + BT_FN_I8_VPTR_I8_I8): New. + * builtins.def (DEF_SYNC_BUILTIN): New. + (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, + BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, + BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, + BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, + BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, + BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, + BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, + BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, + BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, + BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, + BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, + BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, + BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, + BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, + BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, + BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, + BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, + BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, + BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, + BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, + BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, + BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, + BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, + BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, + BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, + BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, + BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, + BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, + BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, + BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, + BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, + BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, + BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, + BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, + BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, + BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, + BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, + BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, + BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, + BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, + BUILT_IN_SYNCHRONIZE: New. + * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN + as a function. Accept __sync_ as a prefix as well. + (expand_builtin_sync_operation, expand_builtin_compare_and_swap, + expand_builtin_lock_test_and_set, expand_builtin_synchronize, + expand_builtin_lock_release): New. + (expand_builtin): Call them. + * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if + neither BOTH_P nor FALLBACK_P are defined. + (builtin_type_for_size): New. + (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. + (resolve_overloaded_builtin): New. + * c-common.h (resolve_overloaded_builtin): Declare. + (builtin_type_for_size): Declare. + * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. + * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, + sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, + sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, + sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, + sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, + sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, + sync_compare_and_swap_cc, sync_lock_test_and_set, + sync_lock_release): New. + * optabs.h: Declare them. + * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, + expand_sync_operation, expand_sync_fetch_operation, + expand_sync_lock_test_and_set): Declare. + * genopinit.c (optabs): Add sync optabs. + * optabs.c (init_optabs): Initialize sync optabs. + (expand_val_compare_and_swap_1, expand_val_compare_and_swap, + expand_bool_compare_and_swap, expand_compare_and_swap_loop, + expand_sync_operation, expand_sync_fetch_operation, + expand_sync_lock_test_and_set): New. + * doc/extend.texi (Atomic Builtins): New section + * doc/md.texi (Standard Names): Add sync patterns. + +2005-04-14 Alexandre Oliva + + * tree-eh.c (lower_try_finally_copy): Generate new code in + response to goto_queue entries as if the queue was sorted by + index, not pointers. + (lower_try_finally_switch): Likewise. + +2005-04-14 Richard Henderson + + * config/i386/i386.c (ix86_expand_sse_cmp): Split out from ... + (ix86_expand_sse_movcc): ... here. Take cmp as a pre-computed + register. + (ix86_expand_fp_movcc): Update to match. + (ix86_expand_fp_vcond, ix86_expand_int_vcond): New. + * config/i386/i386-protos.h: Update. + * config/i386/sse.md (vcondv4sf, vcondv2df): New. + (vcond, vcondu): New. + +2005-04-14 Joseph S. Myers + + * doc/cpp.texi, doc/install.texi: Change references to GCC 3.5 to + refer to 4.0. + +2005-04-14 Julian Brown + + * Revert elfos.h part of my patch from 2005-04-13 for causing libstdc++ + link failures on ppc64 Linux. + +2005-04-14 Andreas Krebbel + + * config.gcc: Set cpu_type for s390. + +2005-04-14 Daniel Berlin + + Fix PR tree-optimization/20963 + * tree-ssa-pre.c (compute_avail): Remove special case for + TREE_INVARIANT. + (create_expression_by_pieces): Add value numbers for forced out + statements. + +2005-04-14 Hans-Peter Nilsson + + * config/cris/cris.md: Replace references to (reg:SI 16) with + (reg:SI CRIS_SRP_REGNUM). + +2005-04-14 Kazu Hirata + + PR tree-optimization/20657 + * tree-vrp.c (extract_range_from_expr): Notice INTEGER_CST to + create an appropriate range from it. + +2005-04-14 Uros Bizjak + + * reg-stack.c (subst_stack_regs_pat): Handle and + case. + + * config/i386/i386.md (UNSPEC_FIST_FLOOR, UNSPEC_FIST_CEIL): New. + (*fist2_floor_1, fistdi2_floor, fistdi2_floor_with_temp) + (fist2_floor, fist2_floor_with_temp): New isns patterns + to implement lfloor and llfloor built-ins as x87 intrinsic function. + (fistdi2_floor, fist2_floor splitters): New splitters. + (lfloor2): New expanders. + (*fist2_ceil_1, fistdi2_ceil, fistdi2_ceil_with_temp) + (fist2_ceil, fist2_ceil_with_temp): New isns patterns + to implement lceil and llceil built-ins as x87 intrinsic function. + (fistdi2_ceil, fist2_ceil splitters): New splitters. + (lceil2): New expanders. + +2005-04-14 Uros Bizjak + + * convert.c (convert_to_integer): Convert (long int)trunc{,f,l}, + and (long long int)ceil{,f,l} into FIX_TRUNC_EXPR. + +2005-04-14 Ulrich Weigand + + PR target/20927 + * config/s390/s390-modes.def: Define TFmode. + +2005-04-13 Richard Sandiford + + * config/mips/mips.h (ASM_OUTPUT_CASE_LABEL): Delete. + (JUMP_TABLES_IN_TEXT_SECTION): Define. + * config/mips/mips.c (mips16_insn_length): Remove reference to + JUMP_TABLES_IN_TEXT_SECTION. + +2005-04-13 Fariborz Jahanian + + * simplify-rtx.c (simplify_binary_operation_1): Return + scalar or vector of constant 0, depending on the xor's + mode. + +2005-04-13 Dale Johannesen + + * objc/Make-lang.in (objc-lang.o): Depend on tree-gimple.h. + (objc-act.o): Ditto. + * objc/objc-act.c (objc_gimplify_expr): New. + (objc_get_callee_fndecl): New. + * objc/objc-act.h: Include tree-gimple.h. Declare new functions. + * objc/objc-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Define. + (LANG_HOOKS_GET_CALLEE_FNDECL): Define. + +2005-04-13 Devang Patel + + * tree-if-conv.c (tree_if_convert_cond_expr): Do not create extra + temp variables. + +2005-04-13 Hans-Peter Nilsson + + CRIS prologue as RTL. + * config/cris/cris-protos.h (cris_emit_movem_store) + (cris_expand_prologue): Prototype. + * config/cris/cris.c (struct machine_function): New member + stdarg_regs. + (cfa_label_num, cris_target_asm_function_prologue): Remove. + (TARGET_ASM_FUNCTION_PROLOGUE): Don't override. + (cris_general_operand_or_gotless_symbol): Accept CRIS_UNSPEC_GOT. + (cris_load_multiple_op, cris_return_address_on_stack) + (cris_return_address_on_stack_for_return): ISO-Cify. + (cris_store_multiple_op): New predicate function. + (cris_expand_prologue, cris_emit_movem_store): New functions. + (cris_print_operand) : Handle modifications other than + post-increment. + (cris_symbol, cris_got_symbol): Return 0 for CRIS_UNSPEC_GOT. + (cris_gotless_symbol): Return 1 for CRIS_UNSPEC_GOT. + (cris_gen_movem_load): Rearrange slightly to make local variable + src a parameter, removing osrc. + (cris_setup_incoming_varargs): Set machine_function member + stdarg_regs to correspond to the number of registers that need to + be saved. + * config/cris/cris.h (EXTRA_CONSTRAINT_S): Accept + CRIS_UNSPEC_GOT. + (PREDICATE_CODES): Add cris_store_multiple_op. Make + cris_general_operand_or_gotless_symbol accept UNSPEC. + * config/cris/cris.md (CRIS_UNSPEC_GOT): New constant. + ("*movsi_internal") : Handle CRIS_UNSPEC_GOT. + ("*cris_store_multiple"): New pattern. Tweak common comment above + this and "*cris_load_multiple". + ("prologue"): New define_expand. + + * config/cris/cris.md ("epilogue"): Conditionalize on + TARGET_PROLOGUE_EPILOGUE. + +2005-04-13 Steve Ellcey + + PR target/20924 + * config/ia64/ia64.md (divsf3_internal_lat): Generate frcpa with + fpsr 0 instead of fpsr 1. + (divsf3_internal_thr): Ditto. + (divdf3_internal_lat): Ditto. + (divdf3_internal_thr): Ditto. + (divxf3_internal_lat): Ditto. + (divxf3_internal_thr): Ditto. + +2005-04-13 Kazu Hirata + + PR tree-optimization/20913 + * tree-ssa-copy.c (copy_prop_visit_cond_stmt): Fold COND_EXPR. + + PR tree-optimization/20702 + * tree-vrp.c (maybe_add_assert_expr): Recurse into + dominator children that haven't been walked into. + +2005-04-13 Julian Brown + + * config/elfos.h (MAKE_DECL_ONE_ONLY): Redefined to stop DECL_WEAK from + being used for symbols with vague linkage when HAVE_GAS_COMDAT_GROUP + is true. + +2005-04-13 Kazu Hirata + + * basic-block.h, tree-ssa-uncprop.c, varasm.c, + config/i386/sse.md: Fix comment typos. + + * genattrtab.c (NULL_ATTR): Remove. + * ifcvt.c (NULL_EDGE): Likewise. + + * rtl.h (RTX_EXPR_FIRST, RTX_EXPR_LAST): Remove. + + * rtl.h (NOTE_PREDICTION_ALG, NOTE_PREDICTION_FLAGS, + NOTE_PREDICT): Remove. + +2005-04-13 Eric Botcazou + + * configure.ac (gcc_AC_CHECK_DECLS): Add vsnprintf. + * configure: Regenerate. + * config.in: Likewise. + * system.h: Declare vsnprintf if not already declared. + +2005-04-13 Eric Botcazou + + * optc-gen.awk: Handle stand-alone Mask records. + * opth-gen.awk: Likewise. + * doc/options.texi (Option file format): Document them. + * config.gcc (sparc-*-netbsdelf*, sparc-*-linux*, sparc64-*-freebsd*, + sparc64-*-linux*, sparc64-*-netbsd*): Add long-double-switch.opt. + (sparc64-*-openbsd*, sparc64-*-elf*): Add little-endian.opt. + * config/sparc/sparc.h (MASK_FPU, MASK_UNALIGNED_DOUBLES, + MASK_V8, MASK_SPARCLITE, MASK_SPARCLET, MASK_V9, + MASK_DEPRECATED_V8_INSNS, MASK_IMPURE_TEXT, MASK_APP_REGS, + MASK_HARD_QUAD, MASK_LITTLE_ENDIAN, MASK_PTR64, MASK_64BIT, + MASK_STACK_BIAS, MASK_FPU_SET, MASK_VIS, MASK_V8PLUS, + MASK_FASTER_STRUCTS, MASK_LONG_DOUBLE_128): Delete. + (TARGET_FPU, TARGET_UNALIGNED_DOUBLES, TARGET_V8, TARGET_SPARCLITE, + TARGET_SPARCLET, TARGET_V9, TARGET_DEPRECATED_V8_INSNS, + TARGET_IMPURE_TEXT, TARGET_APP_REGS, MASK_HARD_QUAD, + TARGET_LITTLE_ENDIAN, TARGET_PTR64, TARGET_64BIT, MASK_STACK_BIAS, + TARGET_FPU_SET, TARGET_VIS, TARGET_V8PLUS, TARGET_FASTER_STRUCTS, + TARGET_LONG_DOUBLE_128): Likewise. + (TARGET_SWITCHES, SUBTARGET_SWITCHES): Likewise. + (TARGET_OPTIONS, SUBTARGET_OPTIONS): Likewise. + * config/sparc/freebsd.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/linux.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/linux64.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/netbsd-elf.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/sp64-elf.h (SUBTARGET_SWITCHES): Likewise. + * config/sparc/sparc.c (fpu_option_set): New global. + (sparc_handle_option): New function. + (sparc_override_options): Test fpu_option_set. + (TARGET_DEFAULT_TARGET_FLAGS): Set to TARGET_DEFAULT. + (TARGET_HANDLE_OPTION): Set to sparc_handle_option. + * config/sparc/sparc.opt: New file. + * config/sparc/little-endian.opt: Likewise. + * config/sparc/long-double-switch.opt: Likewise. + +2005-04-13 Bernd Schmidt + + * config/bfin/bfin.c (bfin_lib_id_given): New static variable. + (bfin_handle_options): Set it if -mshared-library-id= is seen. + * config/bfin/bfin.opt (mshared-library-id=): Lose + Var(bfin_lib_id_given). + +2005-04-13 Matt Thomas + + * config/rs6000/sysv4.h (NO_IMPLICIT_EXTERN_C): undefine before + defining. + +2005-04-13 Kazu Hirata + + * rtl.h (CLEAR_RTX_FLAGS): Remove. + + * cgraphunit.c (INSNS_PER_CALL): Remove. + + * tree-ssa-forwprop.c (vars, + record_single_argument_cond_exprs, + substitute_single_use_vars): Remove. + (forward_propagate_into_cond_1, forward_propagate_into_cond): + New. + (tree_ssa_forward_propagate_single_use_vars): Call + forward_propagate_into_cond for each COND_EXPR. + + * tree-inline.c (INSNS_PER_STMT): Remove. + +2005-04-12 Richard Henderson + + * config/i386/i386.c (ix86_prepare_sse_fp_compare_args): Split ... + (ix86_expand_sse_fp_minmax): ... from ... + (ix86_expand_fp_movcc): ... here. + (ix86_expand_sse_movcc): Rewrite from ix86_split_sse_movcc. + * config/i386/i386-protos.h: Update. + * config/i386/i386.md (UNSPEC_IEEE_MIN, UNSPEC_IEEE_MAX): New. + (sse_setccsf, sse_setccdf): Allow before reload. + (movsfcc_1_sse_min, movsfcc_1_sse_max, movsfcc_1_sse): Remove. + (movdfcc_1_sse_min, movdfcc_1_sse_max, movdfcc_1_sse): Remove. + (ieee_sminsf3, ieee_smaxsf3, ieee_smindf3, ieee_smaxdf3): New. + * config/i386/sse.md (andsf3, nandsf3, iorsf3, xorsf3): New. + (anddf3, nanddf3, iordf3, xordf3): New. + +2005-04-12 Jeff Law + + * Makefile.in (OBJS-common): Add tree-ssa-uncprop.o. + (tree-ssa-uncprop.o): Add dependencies. + * tree-cfg.c (remove_useless_stmts_bb, remove_useless_stmts): Remove. + * tree-flow.h (remove_useless_stmts): Remove prototype. + * tree-outof-ssa.c (rewrite_out_of_ssa): Remove call to + remove_useless_stmts. + * timevar.def (TV_TREE_SSA_UNCPROP): New timevar. + * tree-optimize.c (init_tree_optimization_passes): Add uncprop pass. + * tree-pass.h (pass_uncprop): Declare. + * tree-ssa-uncprop.c: New file. + +2005-04-12 James E. Wilson + + PR target/20670 + * unwind-ia64.c (uw_intall_context): Add missing load of r27. + +2005-04-12 Caroline Tice + + Temporary fix for partitioning problems. + * passes.c (rest_of_handle_final): Remove code that + frees unlikely_text_section_name, + * varasm.c (assemble_start_function): Test for partitioning + flag before writing out section labels. + (assemble_end_function): Test for partitioning flag before + writing out section labels. + +2005-04-12 Steven Bosscher + Stuart Hastings + Jan Hubicka + + * Makefile.in: Add function.h to BASIC_BLOCK_H. Remove all + references to gt-tree-cfg.h. + * basic-block.h (struct basic_block_def): Don't skip rbi + for garbage collection. + (struct reorder_block_def): Make GTY-able. + (struct control_flow_graph): New structure. + (n_edges, n_basic_blocks, last_basic_block, basic_block_info, + BASIC_BLOCK, EXIT_BLOCK_PTR, ENTRY_BLOCK_PTR): No longer vars, + but instead defines to the control_flow_graph for cfun. + (label_to_block_map): New define, points to the label map of + the control_flow_graph for cfun. + (n_edges_for_function, n_basic_blocks_for_function, + last_basic_block_for_function, basic_block_info_for_function, + EXIT_BLOCK_PTR_FOR_FUNCTION, ENTRY_BLOCK_PTR_FOR_FUNCTION, + basic_block_info_for_function, label_to_block_map_for_function): + Counterparts for the above, taking a struct function as an extra + argument. + (alloc_rbi_pool, free_rbi_pool): Remove prototypes. + * cfg.c: (n_edges, n_basic_blocks, last_basic_block, + basic_block_info, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR): Remove. + (alloc_rbi_pool, free_rbi_pool): Remove. + (initialize_bb_rbi): Use ggc_alloc_cleared instead of pool_alloc. + * cfglayout.c: (cfg_layout_initialize): Don't allocate the rbi pool + here... + (cfg_layout_finalize) ... and don't free it here. + * cfgrtl.c (cfg_layout_delete_block): Zero out rbi so it gets + garbage collected. + * flow.c (free_basic_block_vars): Set label_to_block_map and + n_edges to zero too. + * function.h (struct function): Add cfg field. + * function.c (allocate_struct_function): Allocate the cfg. + * tree-cfg.c (label_to_block_map): Remove. + (build_tree_cfg): Don't allocate the rbi pool here... + (delete_tree_cfg_annotations): ...and don't free it here. + Also don't nullify label_to_block_map for cfun. + +2005-04-12 Caroline Tice + + * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): + Revert my patch from April 9. + (fix_edges_for_rarely_executed_code): Revert my patch from April 9. + (reorder_basic_blocks): Revert my patch from April 9. + (insert_section_boundary_note): Revert my patch from April 9. + * dbxout.c (dbxout_function_end): Revert my patch from April 9. + * dwarf2out.c (COLD_TEXT_SECTION_LABEL): Revert my patch from April 9. + (COLD_END_LABEL): Revert my patch from April 9. + (cold_text_section_label): Revert my patch from April 9. + (cold_end_label): Revert my patch from April 9. + (dwarf2out_switch_text_section): Revert my patch from April 9. + (output_aranges): Revert my patch from April 9. + (output_ranges): Revert my patch from April 9. + (output_line_info): Revert my patch from April 9. + (add_location_or_const_value_attribute): Revert my patch from April 9. + (dwarf2out_var_location): Revert my patch from April 9. + (dwarf2out_init): Revert my patch from April 9. + (dwarf2out_finish): Revert my patch from April 9. + * function.h (struct function): Revert my patch from April 9. + * opts.c (decode_options): Revert my patch from April 9. + * output.h (unlikely_section_label, hot_section_label, + hot_section_end_label, cold_section_end_label, + unlikely_text_section_name): Revert my patch from April 9. + * passes.c (rest_of_handle_final): Revert my patch from April 9. + * varasm.c (unlikely_section_label, hot_section_label, + hot_section_end_label, cold_section_end_label, + unlikely_text_section_name): Revert my patch from April 9. + (initialize_cold_section_name): Revert my patch from April 9. + (unlikely_text_section): Revert my patch from April 9. + (in_unlikely_text_section): Revert my patch from April 9. + (named_section): Revert my patch from April 9. + (function_section): Revert my patch from April 9. + (current_function_section): Revert my patch from April 9. + (assemble_start_function): Revert my patch from April 9. + (assemble_end_function): Revert my patch from April 9. + (default_section_type_flags_1): Revert my patch from April 9. + +2005-04-12 Eric Botcazou + + * config/sparc/sparc.h (APPLY_RESULT_SIZE): Set to 24 in 64-bit mode. + * config/sparc/sparc.md (untyped_call): Save the registers manually. + + * config/sparc/sparc.c (legitimate_address_p): Use TARGET_ARCH32. + +2005-04-12 Ulrich Weigand + + PR middle-end/20917 + * config/s390/s390.md ("*set_tp"): Use SET in pattern. + ("set_tp_64", "set_tp_31"): Adapt expanded pattern. + +2004-04-12 Richard Henderson + + * config/i386/i386.md (UNSPEC_FIX, UNSPEC_MOVA, UNSPEC_SHUFFLE, + UNSPEC_PSHUFLW, UNSPEC_PSHUFHW, UNSPEC_ADDSUB, UNSPEC_HADD, + UNSPEC_HSUB, UNSPEC_MOVSHDUP, UNSPEC_MOVSLDUP, UNSPEC_MOVDDUP): Remove. + (UNSPEC_*, UNSPECV_*): Renumber. + +2005-04-12 Frank Ch. Eigler + + PR mudflap/19266 + From Richard Henderson : + * tree-mudflap.c (mf_build_check_statement_for): Correct block + splitting logic. + +2005-04-12 Dorit Naishlos + + * tree-cfg.c (tree_verify_flow_info): Use LABEL_EXPR_LABEL. + +2005-04-12 Bernd Schmidt + + * config/bfin/bfin.c (bfin_library_id_string): Remove. + (bfin_library_id): New variable. + (bfin_expand_prologue): Use bfin_library_id and bfin_lib_id_given + instead of bfin_library_id_string. + (bfin_handle_option): New function. + (override_options): Remove most code to deal with shared library IDs, + just check they aren't used without -mid-shared-library. + (TARGET_HANDLE_OPTION): Define. + * config/bfin/bfin.h (TARGET_OPTIONS): Delete macro. + * config/bfin/bfin.opt (mshared-library-id=): New. + +2005-04-12 Kazu Hirata + + * tree-vect-transform.c: Fix comment typos. + +2005-04-12 Mostafa Hagog + + * postreload-gcse.c (eliminate_partially_redundant_load): Don't + split critical edges when not possible/profitable. + +2005-04-12 Richard Sandiford + + * config/ns32k/ns32k.h (target_flags, MASK_32081, MASK_RTD) + (MASK_REGPARM, MASK_32532, MASK_32332, MASK_NO_SB, MASK_NO_BITFIELD) + (MASK_HIMEM, MASK_32381, MASK_MULT_ADD, MASK_SRC, MASK_IEEE_COMPARE) + (TARGET_32081, TARGET_32381, TARGET_MULT_ADD, TARGET_RTD) + (TARGET_REGPARM, TARGET_32532, TARGET_32332, TARGET_SB, TARGET_HIMEM) + (TARGET_BITFIELD, TARGET_IEEE_COMPARE, TARGET_SWITCHES): Delete. + (OVERRIDE_OPTIONS): Clear MASK_SB instead of setting MASK_NO_SB. + * config/ns32k/netbsd.h (TARGET_DEFAULT): Remove MASK_NO_SB and + MASK_NO_BITFIELD. + * config/ns32k/ns32k.c (ns32k_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + * config/ns32k/ns32k.opt: New file. + +2005-04-12 Richard Sandiford + + * config.gcc (m68k-*-linux*): Add m68k/ieee.opt to $extra_options. + * config/m68k/m68k.h (target_flags, MASK_68020, TARGET_68020) + (MASK_68030, TARGET_68030, MASK_68040, TARGET_68040, MASK_68040_ONLY) + (TARGET_68040_ONLY, MASK_68060, TARGET_68060, MASK_5200, TARGET_5200) + (MASK_CFV3, TARGET_CFV3, MASK_CFV4, TARGET_CFV4, MASK_528x) + (TARGET_528x, MASK_CF_HWDIV, TARGET_CF_HWDIV, MASK_68881, TARGET_68881) + (MASK_BITFIELD, TARGET_BITFIELD, MASK_SHORT, TARGET_SHORT) + (MASK_ALIGN_INT, TARGET_ALIGN_INT, MASK_PCREL, TARGET_PCREL) + (MASK_NO_STRICT_ALIGNMENT, TARGET_STRICT_ALIGNMENT, MASK_RTD) + (TARGET_RTD, MASK_SEP_DATA, TARGET_SEP_DATA, MASK_ID_SHARED_LIBRARY) + (TARGET_ID_SHARED_LIBRARY, MASK_ALL_CF_BITS, TARGET_SWITCHES) + (TARGET_OPTIONS, SUBTARGET_SWITCHES, SUBTARGET_OPTIONS): Delete. + (MASK_COLDFIRE): Formatting fixes. + (TARGET_COLDFIRE): Turn into a boolean value for consistency. + * config/m68k/linux.h (SUBTARGET_SWITCHES): Delete. + * config/m68k/m68k.c (m68k_library_id_string): Initialize to + "_current_shared_library_a5_offset_". + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (MASK_ALL_CPU_BITS): New macro. + (m68k_handle_option): New function. + (override_options): Remove handling of m68k_library_id_string. + * config/m68k/m68k.opt: New file. + * config/m68k/ieee.opt: New file. + +2005-04-11 Mark Mitchell + + * target-def.h (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_VISIBILITY): New macro. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + (TARGET_CXX): Adjust accordingly. + * target.h (struct gcc_target): Remove epxort_class_data. Add + determine_class_data_visibility and class_data_always_comdat. + * doc/tm.texi (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Document. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.c (arm_cxx_export_class_data): Remove. + (arm_cxx_determine_class_data_visibility): New. + (arm_cxx_class_data_always_comdat): Likewise. + (TARGET_CXX_EXPORT_CLASS_DATA): Remove. + (TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY): Define. + (TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT): Likewise. + * config/arm/arm.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): Define. + * config/arm/symbian.h (TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P): + Define. + +2005-04-11 Devang Patel + + * tree-data-ref.c (build_classic_dist_vector, + compute_subscript_distance): Make externally visible. + * tree-data-ref.h (build_classic_dist_vector, + compute_subscript_distance): Same. + * tree-vect-analyze.c (vect_analyze_data_ref_dependence): + Check distance vector against vectorization factor. + (vect_analyze_loop): Determine vectorizaion factor before + analyzing data dependences. + * tree-vectorizer.c (loops_num): Make it externally visible and + rename ... + * tree-vectorizer.c (vect_loops_num): ... new name. + * tree-vectorizer.h (vect_loops_num): New. + +2005-04-11 Devang Patel + + * tree-vect-analyze.c (vect_analyze_operations): Check + vectorizable codition. + * tree-vect-transform.c (vect_is_simple_cond): New function. + (vectorizable_condition): New function. + (vect_transform_stmt): Handle condition_vec_info_type. + * tree-vectorizer.h (enum stmt_vec_info_type): Add + condition_vec_info_type. + (vectorizable_condition): New. + +2005-04-11 Geoffrey Keating + + * config/i386/i386.h (TARGET_FPMATH_DEFAULT): New. + * config/i386/darwin.h (TARGET_FPMATH_DEFAULT): New. + * config/i386/i386.c (override_options): Use TARGET_FPMATH_DEFAULT. + + * config/i386/darwin.h (ASM_SPEC): Use -arch i386 not -arch i686. + (SUBTARGET_EXTRA_SPECS): Always 'i386'. + + * dwarf2out.c (output_line_info): Don't try to dereference + a NULL current_function_decl. + + * config/t-slibgcc-darwin: Don't put shared libraries in + directories other than $(slibdir). + * config/rs6000/darwin.h: Find -m64 libgcc under the name the + OS uses for it. + +2005-04-11 Diego Novillo + + PR tree-optimization/20933 + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Move + logic to reject aliases between read-only and writable + variables ... + (may_alias_p): ... here. + (get_tmt_for): Do not associate read-only tags to pointers + whose pointed-to type is not read-only. + * tree-ssa.c (verify_ssa): Check that memory stores have at + least one V_MAY_DEF or V_MUST_DEF. + +2005-04-11 Kaveh R. Ghazi + + PR/17092 + * configure.ac (gcc_UNLOCKED_FUNCS): New. + (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS. + * system.h (putchar, getc, getchar, clearerr, feof, fileno, + fflush, fgetc, fgets, ferror, fread): Redefine to the associated + _unlocked function. + (fwrite_unlocked): Fix prototype. + + * configure, config.in: Regenerate. + +2005-04-11 David Edelsohn + + * tree-ssa-loop-im.c: Include real.h. + (determine_invariantness_stmt): If real division divisor is + invariant and flag_unsafe_math_optimizations enabled, generate + invariant reciprocal for hoisting. + * Makefile.in (tree-ssa-loop-im.o): Add real.h dependency. + +2005-04-11 Daniel Berlin + + Fix PR tree-optimization/20926 + + * tree-ssa-alias.c (add_type_alias): Handle subvars. + +2005-04-11 Devang Patel + + * config/rs6000.c (rs6000_emit_vector_select): Fix vector select + operand ordering. + +2005-04-11 Andrew Pinski + + * fold-const.c (fold_binary_op_with_conditional_arg): + use fold_buildN instead of "fold (buildN" in some + non obvious places. + (fold_unary): Likewise. + (fold_binary): Likewise. + +2005-04-11 Daniel Berlin + + Fix PR tree-optimization/20612 + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Fix increment + handling + (perfect_nestify): preheaderbb is *not* part of loop of the + old destination. + +2005-04-11 Andrew Pinski + + * tree-ssa-alias.c (may_alias_p): If the variable + is a global variable and the pointer is parameter + and -fargument-noalias-global is used, then + the pointer cannot alias the variable. + +2005-04-11 James A. Morrison + + * config/sparc/sparc.c: Use gcc_assert and gcc_unreachable. + * config/sparc/sparc.h: Likewise. + * config/sparc/sparc.md: Likewise. + +2005-04-11 Kazu Hirata + + * tree-vrp.c (maybe_add_assert_expr): Move a comment. + + * tree-vrp.c: Fix a comment typo. + +2005-04-11 Diego Novillo + + PR tree-optimization/20920 + * tree-pretty-print.c (dump_generic_node): Show '(ab)' if an + SSA_NAME flows through an abnormal edge. + * tree-vrp.c (infer_value_range): Ignore SSA names that flow + through abnormal edges. + (maybe_add_assert_expr): Likewise. + +2005-04-11 Richard Sandiford + + * config/s390/s390.h (s390_tune_string, s390_arch_string) + (s390_warn_framesize_string, s390_warn_dynamicstack_string) + (s390_stack_size_string, s390_stack_guard_string, target_flags) + (MASK_HARD_FLOAT, MASK_SMALL_EXEC, MASK_DEBUG_ARG, MASK_64BIT) + (MASK_ZARCH, MASK_MVCLE, MASK_TPF_PROFILING, MASK_NO_FUSED_MADD) + (MASK_BACKCHAIN, MASK_PACKED_STACK, TARGET_HARD_FLOAT) + (TARGET_SOFT_FLOAT, TARGET_SMALL_EXEC, TARGET_DEBUG_ARG) + (TARGET_64BIT, TARGET_ZARCH, TARGET_MVCLE, TARGET_TPF_PROFILING) + (TARGET_NO_FUSED_MADD, TARGET_FUSED_MADD, TARGET_BACKCHAIN) + (TARGET_PACKED_STACK, TARGET_SWITCHES, TARGET_OPTIONS): Delete. + * config/s390/s390.c (TARGET_DEFAULT_TARGET_FLAGS): Override default. + (TARGET_HANDLE_OPTION): Likewise. + (s390_tune): Initialize to PROCESSOR_max. + (s390_arch_string): Make static. + (s390_tune_string, s390_warn_framesize_string): Delete. + (s390_warn_dynamicstack_string, s390_stack_size_string): Delete. + (s390_stack_guard_string, s390_warn_dynamicstack_p): Delete. + (s390_handle_arch_option, s390_handle_option): New functions. + (override_options): Remove parsing of option strings. + * config/s390/s390.opt: New file. + +2005-04-11 Paolo Bonzini + + * tree-complex.c (expand_vector_operations): Call + update_stmt_if_modified. + +2005-04-11 Paolo Bonzini + + * tree-vect-analyze (vect_determine_vectorization_factor): + Do not use GET_MODE_NUNITS. + * tree-vect-transform.c (vect_get_vec_def_for_operand, + (vectorizable_load, vect_transform_loop): Likewise. + +2005-04-11 Uros Bizjak + + * builtins.def (BUILT_IN_LCEIL, BUILT_IN_LCEILF, BUILT_IN_LCEILL) + (BUILT_IN_LLCEIL, BUILT_IN_LLCEILF, BUILT_IN_LLCEILL): New. + * optabs.h (enum optab_index): Add new OTI_lceil. + (lceil_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize lceil_optab. + * genopinit.c (optabs): Implement lceil_optab using lceilsi2 + and lceildi2 patterns. + * builtins.c (expand_builtin_int_roundingfn): Handle + BUILT_IN_LCEIL{,F,L} and BUILT_IN_LLCEIL{,F,L}. + (fold_builtin_int_roundingfn): Handle BUILT_IN_LCEIL{,F,L} and + BUILT_IN_LLCEIL{,F,L}. + (fold_builtin_1): Fold BUILT_IN_LCEIL{,F,L} and + BUILT_IN_LLCEIL{,F,L} using fold_builtin_int_roundingfn. + (mathfn_built_in): Handle BUILT_IN LCEIL and BUILT_IN_LLCEIL. + (expand_builtin): Expand BUILT_IN_LCEIL{,F,L} and + BUILT_IN_LLCEIL{,F,L} using expand_builtin_int_roundingfn. + * convert.c (convert_to_integer): Convert (long int)ceil{,f,l}, + into lceil built-in function and (long long int)ceil{,f,l} into + llceil built-in function. + * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LCEIL and + BUILT_IN_LLCEIL. + +2005-04-10 John David Anglin + + * pa/quadlib.c (_U_Qfneg): Toggle sign bit instead of subtracting from + zero. + +2005-04-10 Kazu Hirata + + * config/arm/arm.c: Fix a comment typo. + * doc/tree-ssa.texi: Fix a typo. + +2005-04-10 Steven Bosscher + + * cselib.c (clear_table): Rename to cselib_clear_table. + * cselib.h (cselib_clear_table): Add prototype. + * gcse.c (gcse_main): Make 'f' argument unused. + (alloc_gcse_mem): Do not walk the insn chain, walk the contents + of each basic block instead. + (compute_sets, compute_hash_table_work): Likewise. + (constprop_register): Change int 'alter_jumps' argument to bool. + (do_local_cprop): Likewise. + (local_cprop_pass): Likewise. Also walk basic blocks instead of + the insn chain. Explicitly clear the cselib tables after finishing + one basic block. Make sure there are no unterminated libcall blocks. + Update compute_sets call. + (cprop): Walk basic blocks instead of the insn chain. + (one_cprop_pass, compute_ld_motion_mems, compute_store_table): + Likewise. + (bypass_jumps): Update alloc_gcse_mem, compute_sets, and + one_cprop_pass calls. + +2005-04-10 Richard Sandiford + + * combine.c (combine_simplify_rtx): Remove a transformation that + relies on an invalid assumption about rtl sign-extension semantics. + +2005-04-10 Richard Sandiford + + * value-prof.c (tree_divmod_fixed_value_transform): Fix arguments + to build_int_cst_wide. + +2005-04-09 Alexandre Oliva + + PR target/20126 + * loop.c (loop_givs_rescan): If replacement of DEST_ADDR failed, + set the original address pseudo to the correct value before the + original insn, if possible, and leave the insn alone, otherwise + create a new pseudo, set it and replace it in the insn. + * recog.c (validate_change_maybe_volatile): New. + * recog.h (validate_change_maybe_volatile): Declare. + +2005-04-09 Caroline Tice + + * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges): + Remove targetm.have_named_sections test. + (fix_edges_for_rarely_executed_code): Likewise. + (insert_section_boundary_note): Likewise. + (reorder_basic_blocks): Check partitioning flag before calling + verify_hot_cold_block_grouping. + * dbxout.c (dbxout_function_end): Get hot/cold section labels from + the function struct rather than global variables. + * dwarf2out.c (COLD_TEXT_SECTION_LABEL): New macro. + (COLD_END_LABEL): Likewise + (cold_text_section_label): New static global variable. + (cold_end_label): Likewise. + (dwarf2out_switch_text_section): Get hot/cold section labels from + the function struct rather than global variables. + (output_aranges): Use cold_text_section_label and cold_end_label; + check partitioning flag before putting out delta. + (output_ranges): Remove incorrect code attempting to use + hot/cold labels. + (output_line_info): Get cold section label from function struct. + (add_location_or_const_value_attribute): Likewise. + (get_subprogram_die): Get hot/cold section labels from function struct. + (dwarf2out_var_location): Likewise. + (dwarf2out_init): Generate cold_text_section_label and cold_end_label; + write out cold_text_section_label if partition flag is set. + (dwarf2out_finish): Write out cold_end_label if partition flag is set; + * function.h (struct function): Add new fields to point to hot/cold + section labels: hot_section_label, cold_section_label, + hot_section_end_label and cold_section_end_label; also add new field + for cold text section name, unlikely_text_section_name. + * opts.c (decode_options): Turn off partitioning flag if + !targetm.have_named_sections. + * output.h (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_section_label): Remove. + (unlikely_text_section_name): Remove. + * passes.c (rest_of_handle_final): Remove code that frees + unlikely_text_section_name. + * varasm.c (unlikely_section_label): Remove. + (hot_section_label): Remove. + (hot_section_end_label): Remove. + (cold_section_end_label): Remove. + (unlikely_text_section_name): Remove. + (initialize_cold_section_name): Modify to call + targetm.strip_name_encoding; to store cold section name in current + function struct, if it exists; and to only use the decl_section_name + if flag_named_sections is true. + (unlikely_text_section): Modify to get section name out of current + function struct, if there is one; otherwise build it from + UNLIKELY_EXECUTED_TEXT_SECTION_NAME. + (in_unlikely_text_section): Likewise. + (named_section): Modify to get/put cold section name in current function + struct, if there is one. + (function_section): Change 'bool unlikely' to 'int reloc'; check + targetm.have_named_sections before calling named_section. + (current_function_section): Likewise. + (assemble_start_function): Modify to get/put unlikely_text_section_name + in current function struct; modify to get hot/cold section labels + from function struct; initialize labels using + ASM_GENERATE_INTERNAL_LABEL; + test partitioning flag before writing out hot section label. + (assemble_end_function): Test partitioning flag before writing out + hot/cold section labels. + (default_section_type_flags_1): Modify to use array instead of + char* for unlikely_text_section_name; set flags correctly for + cold text section if there is not a current function decl. + +2005-04-09 Jakub Jelinek + + * tree.h (enum tree_index): Add TI_VA_LIST_GPR_COUNTER_FIELD + and TI_VA_LIST_FPR_COUNTER_FIELD. + (va_list_gpr_counter_field, va_list_fpr_counter_field): Define. + * tree-pass.h (pass_stdarg): Add. + * tree-optimize.c (init_tree_optimization_passes): Add pass_stdarg. + * tree-stdarg.c: New file. + * tree-stdarg.h: New file. + * Makefile.in (OBJS-common): Add tree-stdarg.o. + (tree-stdarg.o): Add dependencies. + * function.h (struct function): Add va_list_gpr_size and + va_list_fpr_size fields. + * function.c (allocate_struct_function): Initialize them. + * target.h (struct gcc_target): Add stdarg_optimize_hook. + * target-def.h (TARGET_STDARG_OPTIMIZE_HOOK): Define. + (TARGET_INITIALIZER): Add it. + + * config/i386/i386.c (ix86_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (ix86_setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (ix86_va_start): Don't set up fields that won't be used. + + * config/rs6000/rs6000.c (rs6000_build_builtin_va_list): Initialize + va_list_{g,f}pr_counter_field. + (setup_incoming_varargs): Don't do anything if reg_save + area will not be used. Only save registers that tree-stdarg.c + detected they need saving. + (rs6000_va_start): Don't set up fields that won't be used. + + * config/alpha/alpha.c: Include tree-flow.h and tree-stdarg.h. + (alpha_build_builtin_va_list): Initialize va_list_gpr_counter_field. + (va_list_skip_additions, alpha_stdarg_optimize_hook): New functions. + (TARGET_STDARG_OPTIMIZE_HOOK): Define. + +2005-04-09 Jakub Jelinek + + PR target/20795 + * config/i386/i386.c (construct_container): Pass empty aligned + struct, union or class in memory. + +2005-04-09 Kazu Hirata + + * dominance.c, gthr-win32.h, reg-stack.c, tree-ssa-copy.c, + tree-ssa-operands.c, tree-ssa.c, tree-vrp.c, varasm.c, + config/alpha/alpha.c, config/arm/arm.c, config/m32r/m32r.h, + config/rs6000/predicates.md: Fix comment typos. + + * sched-int.h (haifa_insn_data): Remove blockage and units. + (INSN_UNIT, INSN_BLOCKAGE, UNIT_BITS, BLOCKAGE_MASK, + ENCODE_BLOCKAGE, UNIT_BLOCKED, BLOCKAGE_RANGE, + MIN_BLOCKAGE_COST, MAX_BLOCKAGE_COST): Remove. + +2005-04-09 Jan Hubicka + Steven Bosscher + + * cfglayout.c (copy_bbs): Rename n_edges to num_edges. + * cfgloop.c (get_loop_exit_edges): Likewise. + * cfgloopmanip.c (fix_irreducible_loops): Likewise. + (unloop): Likewise. + * loop-unroll.c (analyze_insns_in_loop): Likewise. + * tree-cfg.c (dump_cfg_status): Likewise. + +2005-04-09 David Edelsohn + + * config/rs6000/predicates.md (altivec_register_operand): Remove + redundant match_code test. + (gpc_reg_operand): Same. + (cc_reg_operand): Same. + (cc_reg_not_cr0_operand): Same. + +2005-04-09 Jan Hubicka + + Forgotten hunk from my last merge patch: + * final.c (output_addr_const): Do not call mark_referenced. + +2005-04-09 Andrew MacLeod + + * doc/tree-ssa.texi: Add immediate use documentation. + +2005-04-09 Richard Earnshaw + + * arm.c (FL_WBUF): Define. + (arm_tune_strongarm): Renamed from arm_is_strong. All uses changed. + (arm_is_6_or_7): Delete. + (arm_tune_wbuf): New. + (arm_override_options): Set arm_tune_wbuf. + * arm.h (arm_tune_strongarm): Renamed from arm_is_strong. + (arm_is_6_or_7): Delete declaration. + (arm_tune_wbuf): New declartion. + * arm.md (is_strongarm): Derive from arm_tune_strongarm. + (model_wbuf): Derive from arm_tune_wbuf. + * arm-cores.def (arm600, arm610, arm620, arm700, arm700i, arm710) + (arm720, arm710c, arm7100, arm7500, arm7500fe, arm710t, arm720t) + (arm740t): Mark CPUs as having a write buffer. + +2005-04-09 Uros Bizjak + + * config/i386/i386.md (*fp_jcc_7_387): Use 'const0_operand' instead + of 'const_double_operand' in operand 2 constraints. Update enable + condition. + +2005-04-09 Uros Bizjak + + * builtins.def (BUILT_IN_LFLOOR, BUILT_IN_LFLOORF, BUILT_IN_LFLOORL) + (BUILT_IN_LLFLOOR, BUILT_IN_LLFLOORF, BUILT_IN_LLFLOORL): New. + * optabs.h (enum optab_index): Add new OTI_lfloor. + (lfloor_optab): Define corresponding macro. + * optabs.c (init_optabs): Initialize lfloor_optab. + * genopinit.c (optabs): Implement lfloor_optab using lfloorsi2 + and lfloordi2 patterns. + * builtins.c (expand_builtin_int_roundingfn): New prototype. + (expand_builtin_int_roundingfn): New function. + (fold_builtin_int_roundingfn): New prototype. + (fold_builtin_int_roundingfn): New function, renamed from + fold_builtin_lround. + Handle BUILT_IN_LROUND{,F,L}, BUILT_IN_LLROUND{,F,L} and + BUILT_IN_LFLOOR{,F,L}, BUILT_IN_LLFLOOR{,F,L}. + (fold_builtin_1): Fold BUILT_IN_LFLOOR{,F,L} and + BUILT_IN_LLFLOOR{,F,L} using fold_builtin_int_roundingfn. + (mathfn_built_in): Handle BUILT_IN LFLOOR and BUILT_IN_LLFLOOR. + (expand_builtin): Expand BUILT_IN_LFLOOR{,F,L} and + BUILT_IN_LLFLOOR{,F,L} using expand_builtin_int_roundingfn. + * convert.c (convert_to_integer): Convert (long int)floor{,f,l}, + into lfloor built-in function and (long long int)floor{,f,l} into + llfloor built-in function. + * fold-const.c (tree_expr_nonnegative_p): Add BUILT_IN_LFLOOR and + BUILT_IN_LLFLOOR. + +2005-04-08 Ian Lance Taylor + + * c-common.def: Move FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, + CONTINUE_STMT, and SWITCH_STMT to cp/cp-tree.def. + * c-common.h (WHILE_COND, WHILE_BODY): Move to cp/cp-tree.h. + (DO_COND, DO_BODY): Likewise. + (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Likewise. + (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Likewise. + (c_common_stmt_codes): Remove FOR_STMT, WHILE_STMT, DO_STMT, + BREAK_STMT, CONTINUE_STMT, and SWITCH_STMT. + (build_continue_stmt, build_break_stmt): Don't declare. + (c_do_switch_warnings): Update declaration. + * c-gimplify.c (enum bc_t): Remove. + (struct c_gimplify_ctx, ctxp): Remove. + (push_context, pop_context): Remove static functions. + (c_genericize): Don't call push_context or pop_context. + (begin_bc_block, finish_bc_block): Remove static functions. + (build_bc_goto): Likewise. + (gimplify_c_loop): Likewise. + (gimplify_for_stmt, gimplify_while_stmt): Likewise. + (gimplify_do_stmt, gimplify_switch_stmt): Likewise. + (c_gimplify_expr): Remove handling of FOR_STMT, WHILE_STMT, + DO_STMT, SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. + * c-common.c (c_do_switch_warnings): Rename from + c_do_switch_warnings_1. + (c_do_switch_warnings) [old version]: Remove. + (c_do_switch_expr_warnings): Remove. + * c-typeck.c (c_finish_case): Call new c_do_switch_warnings + function instead of c_do_switch_expr_warnings. + * c-dump.c (c_dump_tree): Remove handling of BREAK_STMT, + CONTINUE_STMT, DO_STMT, FOR_STMT, SWITCH_STMT, and WHILE_STMT. + * c-pretty-print.c (pp_c_statement): Likewise. + * c-semantics.c (build_break_stmt, build_continue_stmt): Remove. + +2005-04-08 Devang Patel + + * tree-if-conv.c (find_phi_replacement_condition): New parameter, loop. + While selecting replacement condition pay attention to loop header. + +2005-04-08 Diego Novillo + + Merge from tree-cleanup-branch: VRP, store CCP, store + copy-prop, incremental SSA updating of FUD chains and + newly exposed symbols. + + * Makefile.in (tree-ssa-copy.o): Depend on tree-ssa-propagate.h. + (OBJS-common): Add tree-vrp.o. + (tree-vrp.o): New rule. + * basic-block.h (nearest_common_dominator_for_set): Declare. + * common.opt (ftree-store-ccp): New flag. + (ftree-copy-prop): New flag. + (ftree-vrp): New flag. + (ftree-store-copy-prop): New flag. + * dominance.c (nearest_common_dominator_for_set): New. + * domwalk.c (walk_dominator_tree): Only traverse + statements in blocks marked in walk_data->interesting_blocks. + * domwalk.h (struct dom_walk_data): Add field interesting_blocks. + * fold-const.c (fold): Handle ASSERT_EXPR. + * opts.c (decode_options): Set flag_tree_copy_prop at -O1. + Set flag_tree_store_ccp, flag_tree_store_copy_prop and + flag_tree_vrp at -O2. + * timevar.def (TV_TREE_VRP): Define. + (TV_TREE_COPY_PROP): Define. + (TV_TREE_STORE_COPY_PROP): Define. + (TV_TREE_SSA_INCREMENTAL): Define. + (TV_TREE_STORE_CCP): Define. + * tree-cfg.c (tree_can_merge_blocks_p): Remove reference + to kill_redundant_phi_nodes from comment. + (verify_expr): Handle ASSERT_EXPR. + * tree-dfa.c (mark_new_vars_to_rename): Remove second + argument. Update all users. + (mark_call_clobbered_vars_to_rename): Remove. Update all + users. + * tree-flow-inline.h (unmodifiable_var_p): New. + * tree-flow.h (enum value_range_type): Declare. + (struct value_range_def): Declare. + (value_range): Declare. + (remove_all_phi_nodes_for): Remove. Update all users. + (find_phi_node_for): Declare. + (add_type_alias): Declare. + (count_uses_and_derefs): Declare. + (kill_redundant_phi_nodes): Remove. + (rewrite_into_ssa): Remove. + (rewrite_def_def_chains): Remove. + (update_ssa, register_new_name_mapping, create_new_def_for, + need_ssa_update_p, name_registered_for_update_p, + release_ssa_name_after_update_ssa, dump_repl_tbl, + debug_repl_tbl, dump_names_replaced_by, + debug_names_replaced_by, mark_sym_for_renaming, + mark_set_for_renaming, get_current_def, set_current_def, + get_value_range, dump_value_range, debug_value_range, + dump_all_value_ranges, debug_all_value_ranges, + expr_computes_nonzero, loop_depth_of_name, + unmodifiable_var_p): Declare. + * tree-gimple.c (is_gimple_formal_tmp_rhs): Handle + ASSERT_EXPR. + * tree-into-ssa.c (block_defs_stack): Update comment. + (old_ssa_names, new_ssa_names, old_virtual_ssa_names, + syms_to_rename, names_to_release, repl_tbl, + need_to_initialize_update_ssa_p, need_to_update_vops_p, + need_to_replace_names_p): New locals. + (NAME_SETS_GROWTH_FACTOR): Define. + (struct repl_map_d): Declare. + (struct mark_def_sites_global_data): Add field + interesting_blocks. + (enum rewrite_mode): Declare. + (REGISTER_DEFS_IN_THIS_STMT): Define. + (compute_global_livein): Use last_basic_block instead of + n_basic_blocks. + (set_def_block): Remove last argument. Update all callers. + (prepare_use_operand_for_rename): Remove. Update all callers. + (prepare_def_operand_for_rename): Remove. Update all callers. + (symbol_marked_for_renaming): New. + (is_old_name): New. + (is_new_name): New. + (repl_map_hash): New. + (repl_map_eq): New. + (repl_map_free): New. + (names_replaced_by): New. + (add_to_repl_tbl): New. + (add_new_name_mapping): New. + (mark_def_sites): Assume that all the operands in the + statement are in normal form. + (find_idf): Assert that the block in the stack is valid. + (get_default_def_for): New. + (insert_phi_nodes_for): Add new argument 'update_p'. + Add documentation. + If update_p is true, add a new mapping between the LHS of + each new PHI and the name that it replaces. + (insert_phi_nodes_1): Only call find_idf if needed. + (get_reaching_def): Call get_default_def_for. + (rewrite_operand): Remove. + (rewrite_stmt): Do nothing if REGISTER_DEFS_IN_THIS_STMT + and REWRITE_THIS_STMT are false. + Assume that all the operands in the statement are in + normal form. + (rewrite_add_phi_arguments): Don't use PHI_REWRITTEN. + (rewrite_virtual_phi_arguments): Remove. + (invalidate_name_tags): Remove. + (register_new_update_single, register_new_update_set, + rewrite_update_init_block, replace_use, + rewrite_update_fini_block, rewrite_update_stmt, + rewrite_update_phi_arguments): New. + rewrite_blocks): Remove argument 'fix_virtual_phis'. + Add arguments 'entry', 'what' and 'blocks'. + Initialize the dominator walker according to 'what' and + 'blocks'. + Start the dominator walk at 'entry'. + (mark_def_site_blocks): Add argument 'interesting_blocks'. + Use it to configure the dominator walker. + (rewrite_into_ssa): Remove argument 'all'. + Make internal. + (rewrite_all_into_ssa): Remove. + (rewrite_def_def_chains): Remove. + (mark_def_interesting, mark_use_interesting, + prepare_phi_args_for_update, prepare_block_for_update, + prepare_def_site_for, prepare_def_sites, + dump_names_replaced_by, debug_names_replaced_by, + dump_repl_tbl, debug_repl_tbl, init_update_ssa, + delete_update_ssa, create_new_def_for, + register_new_name_mapping, mark_sym_for_renaming, + mark_set_for_renaming, need_ssa_update_p, + name_registered_for_update_p, ssa_names_to_replace, + release_ssa_name_after_update_ssa, + insert_updated_phi_nodes_for, update_ssa): New. + * tree-loop-linear.c (linear_transform_loops): Call + update_ssa instead of rewrite_into_ssa. + * tree-optimize.c (vars_to_rename): Remove. + Update all users. + (init_tree_optimization_passes): Replace + pass_redundant_phi with pass_copy_prop. + Add pass_vrp. + Replace pass_ccp with pass_store_ccp. + Add pass_store_copy_prop after pass_store_ccp. + (execute_todo): If the TODO_ flags don't include updating + the SSA form, assert that it does not need to be updated. + Call update_ssa instead of rewrite_into_ssa and + rewrite_def_def_chains. + If TODO_verify_loops is set, call verify_loop_closed_ssa. + (tree_rest_of_compilation): + * tree-pass.h (TODO_dump_func, TODO_ggc_collect, + TODO_verify_ssa, TODO_verify_flow, TODO_verify_stmts, + TODO_cleanup_cfg): Renumber. + (TODO_verify_loops, TODO_update_ssa, + TODO_update_ssa_no_phi, TODO_update_ssa_full_phi, + TODO_update_ssa_only_virtuals): Define. + (pass_copy_prop, pass_store_ccp, pass_store_copy_prop, pass_vrp): + Declare. + * tree-phinodes.c (make_phi_node): Update documentation. + (remove_all_phi_nodes_for): Remove. + (find_phi_node_for): New. + * tree-pretty-print.c (dump_generic_node): Handle ASSERT_EXPR. + * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise. + (interpret_rhs_modify_expr): Likewise. + * tree-sra.c (decide_instantiations): Mark all symbols in + SRA_CANDIDATES for renaming. + (mark_all_v_defs_1): Rename from mark_all_v_defs. + (mark_all_v_defs): New function. Update all users to call it + with the whole list of scalarized statements, not just the + first one. + * tree-ssa-alias.c (count_ptr_derefs): Make extern. + (compute_flow_insensitive_aliasing): If the tag is + unmodifiable and the variable isn't or vice-versa, don't + make them alias of each other. + (setup_pointers_and_addressables): If the type tag for + VAR is about to change, mark the old one for renaming. + (add_type_alias): New. + * tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP. + (ccp_lattice_t): Rename from latticevalue. + (value): Remove. Update all users. + (const_val): New local variable. + (do_store_ccp): New local variable. + (dump_lattice_value): Handle UNINITIALIZED. + (debug_lattice_value): New. + (get_default_value): Re-write. + (set_lattice_value): Re-write. + (def_to_varying): Remove. Update all users. + (likely_value): Return VARYING for statements that make + stores when STORE_CCP is false. + Return VARYING for any statement other than MODIFY_EXPR, + COND_EXPR and SWITCH_EXPR. + (ccp_initialize): Re-write. + (replace_uses_in, replace_vuse_in, substitute_and_fold): + Move to tree-ssa-propagate.c. + (ccp_lattice_meet): Handle memory stores when + DO_STORE_CCP is true. + (ccp_visit_phi_node): Likewise. + (ccp_fold): Likewise. + (evaluate_stmt): Likewise. + (visit_assignment): Likewise. + (ccp_visit_stmt): Likewise. + (execute_ssa_ccp): Add argument 'store_ccp'. Copy it + into DO_STORE_CCP. + (do_ssa_ccp): New. + (pass_ccp): Use it. + (do_ssa_store_ccp): New. + (gate_store_ccp): New. + (pass_store_ccp): Declare. + * tree-ssa-copy.c: Include tree-ssa-propagate.h. + (may_propagate_copy): Reformat. + Don't abort if ORIG is a virtual and DEST isn't. + If NEW does not have alias information but DEST does, + copy it. + (copy_of, cached_last_copy_of, do_store_copy_prop, enum + copy_prop_kind, which_copy_prop): Declare. + (stmt_may_generate_copy, get_copy_of_val, + get_last_copy_of, set_copy_of_val, dump_copy_of, + copy_prop_visit_assignment, copy_prop_visit_cond_stmt, + copy_prop_visit_stmt, copy_prop_visit_phi_node, + init_copy_prop, fini_copy_prop, execute_copy_prop, + gate_copy_prop, do_copy_prop, gate_store_copy_prop, + store_copy_prop): New. + (pass_copy_prop, pass_store_copy_prop): Declare. + * tree-ssa-dom.c (struct opt_stats_d): Add fields + 'num_const_prop' and 'num_copy_prop'. + (cprop_operand): Update them. + (dump_dominator_optimization_stats): Dump them. + (tree_ssa_dominator_optimize): Call update_ssa instead of + rewrite_into_ssa. + (loop_depth_of_name): Declare extern. + (simplify_cond_and_lookup_avail_expr): Guard against NULL + values for LOW or HIGH. + (cprop_into_successor_phis): Only propagate if NEW != ORIG. + (record_equivalences_from_stmt): Call expr_computes_nonzero. + (cprop_operand): Only propagate if VAL != OP. + * tree-ssa-dse.c (dse_optimize_stmt): Mark symbols in removed + statement for renaming. + * tree-ssa-loop-im.c (move_computations): Call update_ssa. + * tree-ssa-loop-ivopts.c (rewrite_address_base): Call + add_type_alias if necessary. + Call mark_new_vars_to_rename. + (tree_ssa_iv_optimize): If new symbols need to be renamed, + mark every statement updated, call update_ssa and + rewrite_into_loop_closed_ssa. + * tree-ssa-loop-manip.c (add_exit_phis): Do not remove DEF_BB + from LIVEIN if VAR is a virtual. + * tree-ssa-loop.c (tree_loop_optimizer_init): Call update_ssa. + * tree-ssa-operands.c (get_expr_operands): Handle ASSERT_EXPR. + (get_call_expr_operands): Reformat statement. + (add_stmt_operand): Don't create V_MAY_DEFs for read-only + symbols. + * tree-ssa-propagate.c (ssa_prop_init): Initialize + SSA_NAME_VALUE for every name. + (first_vdef, stmt_makes_single_load, stmt_makes_single_store, + get_value_loaded_by): New. + (replace_uses_in, replace_vuses_in, replace_phi_args_in, + substitute_and_fold): Move from tree-ssa-ccp.c. + * tree-ssa-propagate.h (struct prop_value_d, prop_value_t, + first_vdef, stmt_makes_single_load, stmt_makes_single_store, + get_value_loaded_by, replace_uses_in, substitute_and_fold): + Declare. + * tree-ssa.c (verify_use): Fix error message. + (propagate_into_addr, replace_immediate_uses, get_eq_name, + check_phi_redundancy, kill_redundant_phi_nodes, + pass_redundant_phi): Remove. Update all users. + * tree-vect-transform.c (vect_create_data_ref_ptr): Call + add_type_alias, if necessary. + * tree-vectorizer.h (struct _stmt_vect_info): Update + documentation for field 'memtag'. + * tree-vrp.c: New file. + * tree.def (ASSERT_EXPR): Define. + * tree.h (ASSERT_EXPR_VAR): Define. + (ASSERT_EXPR_COND): Define. + (SSA_NAME_VALUE_RANGE): Define. + (struct tree_ssa_name): Add field 'value_range'. + (PHI_REWRITTEN): Remove. + (struct tree_phi_node): Remove field 'rewritten'. + * doc/invoke.texi (-fdump-tree-storeccp, -ftree-copy-prop, + -ftree-store-copy-prop): Document. + * doc/tree-ssa.texi: Remove broken link to McCAT's compiler. + Document usage of update_ssa. + +2005-04-08 David Edelsohn + + PR target/20814 + * config/rs6000/predicates.md (altivec_register_operand): Accept + SUBREG. + (and64_operand): Do not limit CONST_INT to mask64_operand. + (and64_2_operand): Do not limit CONST_INT to mask64_1or2_operand. + (and_operand): Do not limit CONST_INT to mask_operand. + +2005-04-09 Hans-Peter Nilsson + + PR rtl-optimization/20466 + * flow.c (invalidate_mems_from_set): Handle a MEM by checking it + for overlap of the address of each list member. + (mark_set_1): Call invalidate_mems_from_set for MEMs too. + +2005-04-08 Mike Stump + + * config/darwin.c (indirect_data): Fix typo in strncmp logic. + + * config/rs6000/rs6000.c (rs6000_emit_prologue): Use 5 nops, + instead of 4. + +2005-04-08 Kazu Hirata + + * c-tree.h (C_LANG_TREE_NODE_CHAIN_NEXT): Remove. + + * function.c (push_function_context_to): Don't set + contains_functions. + * function.h (function): Remove contains_functions. + (current_function_contains_functions): Remove. + + * function.h (function): Remove instrument_entry_exit. + (current_function_instrument_entry_exit): Remove. + + * function.h (nonlocal_labels): Remove. + + * tree.h (STRIP_MAIN_TYPE_NOPS): Remove. + + * genattrtab.c (attr_desc): Remove negative_ok and unsigned_p. + (check_attr_value, write_attr_get, write_expr_attr_cache, + find_attr, make_internal_attr): Don't reference negative_ok or + unsigned_p. + * genattrtab.h (ATTR_NEGATIVE_OK, ATTR_UNSIGNED, + ATTR_FUNC_UNITS, ATTR_BLOCKAGE): Remove. + (ATTR_STATIC): Adjust the value. + + * c-common.h (C_ARTIFICIAL_STRING_P): Remove. + +2005-04-08 Ulrich Weigand + + * config/s390/tpf.h (ASM_SPEC): Define. + +2005-04-08 Kazu Hirata + + * tree-flow.h: Remove the prototype for + redirect_immediate_uses. + (TDFA_USE_OPS, TDFA_USE_VOPS): Remove. + +2005-04-08 Richard Earnshaw + + * arm.c (arm_const_double_by_parts): New function. + * arm-protos.h (arm_const_double_by_parts): Add prototype. + * arm.md (define_split for 64-bit constants): Add another one. + +2005-04-08 Andrew MacLeod + + * tree-ssa-operands.c (correct_use_link): Remove linear scan. + +2005-04-08 Kaveh R. Ghazi + + * system.h: Revert last change. + +2005-04-08 Richard Sandiford + + * config/xtensa/xtensa.h (target_flags, MASK_NO_FUSED_MADD) + (MASK_CONST16, TARGET_NO_FUSED_MADD, TARGET_CONST16) + (TARGET_SWITCHES): Delete. + * config/xtensa/xtensa.c (TARGET_DEFAULT_TARGET_FLAGS): Define. + * config/xtensa/xtensa.md (muladdsf3, mulsubsf3): Check + TARGET_FUSED_MADD instead of !TARGET_NO_FUSED_MADD. + * config/xtensa/xtensa.opt: New file. + +2005-04-08 Ben Elliston + + * config/fp-bit.c: Include L_mul_tf in #endif comment. + * config/fp-bit.h: Tidy comments. + +2005-04-07 Kaveh R. Ghazi + + * system.h: Poison PARAMS. + +2005-04-07 Richard Sandiford + + * config/vax/vax.h (target_flags, MASK_UNIX_ASM, MASK_VAXC_ALIGNMENT) + (MASK_G_FLOAT, TARGET_UNIX_ASM, TARGET_VAXC_ALIGNMENT, TARGET_G_FLOAT) + (TARGET_SWITCHES): Delete. + * config/vax/vax.c (TARGET_DEFAULT_TARGET_FLAGS): Override default. + * config/vax/vax.opt: New file. + +2005-04-07 Daniel Berlin + + * tree-ssa-dse.c (dse_optimize_stmt): Fix incorrect comment. + +2005-04-07 Ian Lance Taylor + + * config/iq2000/iq2000.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Don't + define. + * config/mips/mips.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): Likewise. + * config/sparc/sparc.h (DONT_ACCESS_GBLS_AFTER_EPILOGUE): + Likewise. + +2005-04-07 Kazu Hirata + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Consider + all immediate uses in PHI nodes. + +2005-04-07 Richard Earnshaw + + * arm.c (arm_const_double_inline_cost): Handle any constant by + using gen_lowpart and gen_highpart_mode. + (note_invalid_constants): All constants in an RTX with a constraint + that permits memory are now pushed to the constant pool. + (output_move_double): Delete code to handle reg to reg and + constant to reg moves. + (const_double_needs_minipool, output_mov_immediate): Delete. + * arm.h (EXTRA_CONSTRAINT_STR_ARM): All 'D' variants now handle + CONST_INT and CONST_VECTOR. + * arm.md (ANY64): New mode macro. + (arm_movdi): Split reg-reg and const-reg moves. Simplify constraints. + (movdf_soft_insn): Split reg-reg and const-reg moves. + (split patterns for 64-bit constant and register moves): New. + * cirrus.md (cirrus_arm_movdi): Split reg-reg and const-reg moves. + (cirrus_movdf_hard_insn): Likewise. + * fpa.md (movdf_fpa): Likewise. + * iwmmxt.md (iwmmxt_arm_movdi): Likewise. + (movv8qi_internal, movv4hi_internal, movv2si_internal): Fix + constraints. + (movv2si_internal_2): Likewise. + * vfp.md (arm_movdi_vfp): Split reg-reg and const-reg moves. + (movdf_vfp): Likewise. + * arm-protos.h (output_mov_immediate): Delete prototype. + +2005-04-07 Joseph S. Myers + + PR target/20093 + * simplify-rtx.c (simplify_unary_operation_1): Check + SUBREG_PROMOTED_UNSIGNED_P (op) > 0 for zero-extension. + +2005-04-06 James E Wilson + + PR target/20717 + * cgraphunit.c (record_call_1, case FDESC_EXPR): Handle same as + ADDR_EXPR. + +2004-04-06 Richard Sandiford + + * coverage.h (GCOV_TYPE_NODE): Delete. + * coverage.c (coverage_counter_alloc, tree_coverage_counter_ref) + (build_ctr_info_type): Use get_gcov_type () instead of GCOV_TYPE_NODE. + * tree-profile.c (tree_gen_edge_profiler, tree_gen_interval_profiler) + (tree_gen_pow2_profiler, tree_gen_one_value_profiler): Likewise. + * value-prof.c (tree_divmod_fixed_value_transform): Delete. + +2004-04-06 Richard Sandiford + + PR other/20792 + * Makefile.in (gcc.pot): Remove options.c dependency. + * optc-gen.awk: Don't quote help strings with N_(). + +2005-04-06 James A. Morrison + + * c-common.c (handle_malloc_atttribute): Only set DECL_IS_MALLOC if + the function returns a pointer type. + +2005-04-06 Daniel Berlin + + * params.def (PARAM_SALIAS_MAX_IMPLICIT_FIELDS): New + * params.h (SALIAS_MAX_IMPLICIT_FIELDS): New + * doc/invoke.texi: Documnet salias-max-implicit-fields. + * tree-ssa-alias.c (struct used_part): Add implicit_uses and + explicit_uses members. + (get_or_create_used_part_for): Initialize new fields. + (fieldoff_compare): New function. + (create_overlap_variables_for): Count number of fields, use + heuristic to determine whether to create subvars for vars with + only implicit uses. + Sort the field list by offset and avoid creating duplicate SFT's. + +2005-04-06 Richard Sandiford + + * c.opt (-F): Remove trailing whitespace from help string. + (-finput-charset): Use a tab to separate the switch name and help + string. + * common.opt (-fsched-stalled-insns, -fsched-stalled-insns-dep) + (-ftree-vectorizer-verbose): Likewise. + +2005-04-06 Kazu Hirata + + * tree-ssa-sink.c (nearest_common_dominator_of_uses): Look at + a PHI argument where a use occurs instead of all PHI arguments. + +2005-04-06 Joseph S. Myers + + * c-decl.c (finish_decl): Apply pending #pragma weak regardless of + scope. + +2005-04-06 Kazu Hirata + + * cse.c, tree-flow-inline.h, tree-flow.h, tree-ssa-operands.c, + tree-ssa-sink.c, tree.h, config/bfin/bfin.c, + config/bfin/bfin.h: Fix comment typos. + +2005-04-06 Ranjit Mathew + + * doc/install.texi: Update the URL for Jacks. + * doc/sourcebuild.texi: Likewise. + +2005-04-06 Eric Botcazou + + PR target/17245 + * config/sparc/sparc.c (legitimate_address_p): Remove 'imm2'. + Revert 2004-10-08 patch. Reject TFmode LO_SUM in 32-bit mode. + +2005-04-06 Kelley Cook + + * Makefile.in (LIBGCC2_CFLAGS): Revert -pipe change. + +2005-04-06 Richard Sandiford + + * config/v850/v850-protos.h (override_options): Delete. + * config/v850/v850.h (target_flags, MASK_GHS, MASK_LONG_CALLS, MASK_EP) + (MASK_PROLOG_FUNCTION, MASK_DEBUG, MASK_V850, MASK_V850E) + (MASK_SMALL_SLD, MASK_BIG_SWITCH, MASK_NO_APP_REGS, MASK_DISABLE_CALLT) + (MASK_STRICT_ALIGN, MASK_US_BIT_SET, MASK_US_MASK_SET, TARGET_GHS) + (TARGET_LONG_CALLS, TARGET_EP, TARGET_PROLOG_FUNCTION, TARGET_V850) + (TARGET_BIG_SWITCH, TARGET_DEBUG, TARGET_V850E, TARGET_US_BIT_SET) + (TARGET_SMALL_SLD, TARGET_DISABLE_CALLT, TARGET_NO_APP_REGS) + (TARGET_STRICT_ALIGN, TARGET_SWITCHES, TARGET_OPTIONS) + (OVERRIDE_OPTIONS): Delete. + (MASK_CPU): Redefine as MASK_V850 | MASK_V850E. + (small_memory_info): Remove the value field. + (CONDITIONAL_REGISTER_USAGE): Check !TARGET_APP_REGS rather than + TARGET_NO_APP_REGS. + * config/v850/v850.c (small_memory): Remove the value field. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (override_options): Delete. + (v850_handle_memory_option, v850_handle_option): New functions. + * config/v850/v850.opt: New file. + +2005-04-06 Geoffrey Keating + + * config.host: Add a section for generic hosts, and a subsection + for Darwin. Add a case for x86-darwin. Update ppc-darwin case. + * config/host-darwin.c: New, split out of config/rs6000/host-darwin.c. + * config/host-darwin.h: New. + * config/x-darwin: New. + * config/i386/host-i386-darwin.c: New. + * config/i386/x-darwin: New. + * config/rs6000/host-darwin.c: Include host-darwin.h. + (darwin_rs6000_gt_pch_get_address): Move to config/host-darwin.c. + (darwin_rs6000_gt_pch_use_address): Likewise. + * config/rs6000/x-darwin: Change name of .o built, update + dependencies for changes to rs6000/host-darwin.c. + +2005-04-06 Ralf Corsepius + + PR target/17824 + * config/c4x/c4x.h (ASM_PROG, LD_PROG): Remove. + +2005-04-06 Dorit Naishlos + + * tree-vect-analyze.c (vect_analyze_loop_form): Call + split_loop_exit_edge instead of loop_split_edge_with. + +2005-04-06 Paolo Bonzini + + * config/rs6000/altivec.md (UNSPEC_VSLW, UNSPEC_SUBS, + UNSPEC_SET_VSCR): New constants, used throughout. + (*andc3_v4sf): New. + (altivec_vspltisb, altivec_vsplitish, altivec_vsplitisw): + Replace with... + (altivec_vspltis): ... this pattern, using + a QImode const_int_operand for the immediate. + (abs2, absv4sf2, altivec_abss_): Rewrite as + define_expands. + +2005-04-06 Ralf Corsepius + + PR target/17822 + * config/avr/t-avr (AR_FOR_TARGET,RANLIB_FOR_TARGET): Remove. + +2005-04-06 Kelley Cook + + * Makefile.in (LIBGCC2_CFLAGS): Compile with -pipe. + +2005-04-06 Ben Elliston + + * gcc.c: Correct comment about DEFAULT_SWITCH_TAKES_ARG and + DEFAULT_WORD_SWITCH_TAKES_ARG which incorrectly reported these + macros as living in "this file" and not gcc.h. + +2005-04-06 Ben Elliston + + * doc/invoke.texi (Optimize Options): Mention -ftree-lrs, not + -ftree-live_range_split. Perhaps renamed at some point? + +2005-04-06 Zdenek Dvorak + + PR target/20625 + * tree-ssa-loop-ivopts.c (generic_type_for): New function. + (add_candidate_1): Use generic_type_for instead of unsigned_type_for. + +2005-04-06 Zdenek Dvorak + + * tree-flow.h (number_of_iterations_cond): Declaration removed. + * tree-ssa-loop-niter.c (number_of_iterations_cond): Made static. + (number_of_iterations_special): New function. + (number_of_iterations_exit): Use number_of_iterations_special. + Use simplify_using_outer_evolutions only at -O3. + (number_of_iterations_cond, tree_simplify_using_condition, + simplify_using_initial_conditions, loop_niter_by_eval, + compare_trees, can_count_iv_in_wider_type_bound, + simplify_using_outer_evolutions): Use fold_build. + +2005-04-05 Thomas Fitzsimmons + + * doc/install.texi (Configuration): Document --with-java-home. + +2005-04-05 Richard Henderson + + PR target/20342 + PR target/20447 + * config/i386/i386.c (print_operand): Handle vector zeros. + (ix86_split_to_parts): Handle CONST_VECTOR. + (ix86_hard_regno_mode_ok): Allow MMX modes in general regs. + (ix86_modes_tieable_p): Use ix86_hard_regno_mode_ok to decide + what modes to tie for MMX and SSE registers. + * config/i386/i386.h (MMX_REG_MODE_P): Remove. + * config/i386/i386.md: Extend move 0 -> xor peephole to apply + to vector modes as well. + * config/i386/predicates.md (const0_operand): Handle VOIDmode + properly as an input mode. + +2005-04-05 Andrew MacLeod + + * tree-ssa-operands.c (verify_abort): Use %p for pointers. + +2005-04-05 Andrew MacLeod + + * tree-pretty-print.c (dump_generic_node): Use %p for pointer. + +2005-04-05 Jakub Jelinek + + * config/i386/i386.c (init_cumulative_args): For -m32 -mfpmath=sse + and local functions, set sse_nregs to 8 and float_in_sse. + (function_arg_advance, function_arg): If float_in_sse, pass + SFmode and DFmode arguments in SSE registers. + * config/i386/i386.h (CUMULATIVE_ARGS): Add float_in_sse field. + + * config/i386/i386.c (ix86_value_regno): Only optimize local functions + of -funit-at-a-time. + +2005-04-05 Paolo Bonzini + + * config/i386/i386-protos.h (ix86_function_value): Accept two + arguments, like the target macro. + * config/i386/i386.h (FUNCTION_VALUE): Pass both arguments. + * config/i386/i386.c (ix86_function_value): Accept the second + argument of the target macro. + (ix86_function_ok_for_sibcall): Pass a function pointer to + ix86_function_value. + (ix86_function_value, ix86_libcall_value) [!TARGET_64BIT]: Adjust + call to ix86_value_regno). + (ix86_value_regno): Add support for returning floating point values + in SSE registers. + +2005-04-05 Jakub Jelinek + + PR tree-optimization/20076 + * tree-inline.c (inline_forbidden_p_1): Prevent inlining functions + that call __builtin_return or __builtin_apply_args. + +2005-04-05 Andrew MacLeod + + * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Use update_stmt. + Use immediate use iterator. + (stmt_is_bumper_for_loop): Use immediate use iterator. + * predict.c (strip_builtin_expect): Use update_stmt. + * tree-cfg.c (update_modified_stmts): New. Call update_stmt_if_modified + on all elements of a STATEMENT_LIST. + (bsi_insert_before, bsi_insert_after): Call update_modified_stmts. + (bsi_remove): Remove imm_use links and mark the stmt as modified. + (bsi_replace): Mark stmt as modified and the update it. + * tree-complex.c (update_complex_assignment): Call mark_stmt_modified. + (expand_complex_libcal): Call update_stmt. + (expand_complex_comparison): Call mark_stmt_modified. + (expand_complex_operations_1): Call update_stmt_if_modified. + (expand_vector_operations_1): Call mark_stmt_modified. + * tree-dfa.c (compute_immediate_uses, free_df_for_stmt, free_df, + compute_immediate_uses_for_phi, compute_immediate_uses_for_stmt, + add_immediate_use, redirect_immediate_use, + redirect_immediate_uses, dump_immediate_uses, debug_immediate_uses, + dump_immediate_uses_for, debug_immediate_uses_for): Delete. + (mark_new_vars_to_rename): Call update_stmt. + * tree-dump.c (dump_option_value_in): Add "stmtaddr". + * tree-flow-inline.h (modify_stmt): Rename to mark_stmt_modified. + Ignore PHI nodes. + (unmodify_stmt): Delete. + (update_stmt): New. Force an update of a stmt. + (update_stmt_if_modified): update a stmt if it is out of date. + (get_stmt_operands): Verify stmt is NOT modified. + (stmt_modified_p): Update comment. + (delink_imm_use): Remove a use node from its immuse list. + (link_imm_use_to_list): Link a use node to a specific list. + (link_imm_use): Link a node to the correct list. + (set_ssa_use_from_ptr): Set a use node to a specific value, and insert + it in the correct list, if appropriate. + (link_imm_use_stmt): Link a use node, and set the stmt pointer. + (relink_imm_use): Link a use node in place of another node in a list. + (relink_imm_use_stmt): LInk a node in place of another node, and set + the stmt pointer. + (end_safe_imm_use_traverse): New. Terminate a safe immuse iterator. + (end_safe_imm_use_p): New. Check for the end of a safe immuse iterator. + (first_safe_imm_use): New. Initialize a safe immuse iterator. + (next_safe_imm_use): New. Proceed to next safe immuse iterator value. + (end_readonly_imm_use_p): New. Check for end of a fast immuse iterator. + (first_readonly_imm_use): New. Initialize a fast immuse iterator. + (next_readonly_imm_use): New. Get the next fast immuse iterator value. + (has_zero_uses): New. Return true if there are no uses of a var. + (has_single_use): New. Return true if there is only a single use of a + variable. + (single_imm_use): New. Return the simgle immediate use. + (num_imm_uses): New. Return the number of immediate uses. + (get_v_must_def_ops): Use is now a pointer. + (use_operand_p, get_v_may_def_op_ptr, get_vuse_op_ptr, + get_v_must_def_kill_ptr, get_phi_arg_def_ptr): Return the address of + the use node. + (get_immediate_uses, num_immediate_uses, immediate_use): Delete. + (delink_stmt_imm_use): Delink all immuses from a stmt. + (phi_arg_index_from_use): New. Return a phi arg index for a use. + * tree-flow.h (struct dataflow_d): Delete. + (immediate_use_iterator_d): New. Immediate use iterator struct. + (FOR_EACH_IMM_USE_FAST): New. Macro for read only immuse iteration. + (FOR_EACH_IMM_USE_SAFE): New. Macro for write-safe immuse iteration. + (BREAK_FROM_SAFE_IMM_USE): New. Macro for earlyu exit from write-safe + iteration. + (struct stmt_ann_d): Remove dataflow_t from struct. + * tree-if-conv.c (tree_if_conversion). Don't call free_df. + (if_convertible_phi_p): Use FAST immuse iterator. + (if_convertible_loop_p): Don't call compute_immediate_uses. + (replace_phi_with_cond_modify_expr): Call update_stmt. + * tree-into-ssa.c (mark_def_sites, ssa_mark_def_sites): Call + update_stmt_if_modified. + (rewrite_all_into_ssa): Initialize ssa operands. + * tree-loop-linear.c (linear_transform_loops): Don't call free_df or + compute_immediate_uses. + * tree-optimize.c (execute_todo): Call verify_ssa whenever the + ssa_property is available. + (execute_one_pass): Change parameters passed to execute_todo. + * tree-outof-ssa.c (rewrite_trees): Don't call modify_stmt. + (remove_ssa_form): Call fini_ssa_operands. + (insert_backedge_copies): Delete call to modify_stmt. + * tree-phinodes.c (make_phi_node): Initialize use nodes. + (release_phi_node): Delink any use nodes before releasing. + (resize_phi_node): Relink any use nodes. + (remove_phi_arg_num): Delink the use node. + (remove_phi_node): Release the ssa_name AFTER releasing the phi node. + (remove_all_phi_nodes_for): Release phi node first. + * tree-pretty-print.c (dump_generic_node): Print stmt address. + * tree-sra.c (mark_all_v_defs): Call update_stmt_if_modified. + (scalarize_use, scalarize_copy): Call update_stmt. + * tree-ssa-alias.c (compute_may_aliases): Update all modified stmts. + (compute_points_to_and_addr_escape): Call mark_stmt_modified. + * tree-ssa-cpp.c (need_imm_uses_for): Delete. + (ccp_initialize): Remove call to compute_immediate_uses. + (substitute_and_fold, execute_fold_all_builtins): Call update_stmt. + * tree-ssa-dom.c (tree_ssa_dominator_optimize): Update all modified + stmts. + (simplify_cond_and_lookup_avail_expr): Call mark_stmt_modified. + (simplify_switch_and_lookup_avail_expr): Call mark_stmt_modified. + (eliminate_redundant_computations): Call mark_stmt_modified. + (cprop_operand): Call mark_stmt_modified. + (optimize_stmt): Call update_stmt_if_modified and mark_stmt_modified. + * tree-ssa-dse.c (fix_phi_uses, fix_stmt_v_may_defs): Delete. + (dse_optimize_stmt): Use new immuse interface. + (tree_ssa_dse): Remove calls to compute_immediate_uses and free_df. + * tree-ssa-forwprop.c (need_imm_uses_for): Delete. + (substitute_single_use_vars): Use new immuse interface. + (tree_ssa_forward_propagate_single_use_vars): Remove calls to free_df + and compute_immediate_uses. + * tree-ssa-loop-im.c (single_reachable_address): Use new immuse + interface. + (rewrite_mem_refs): Call update_stmt. + (determine_lsm): Remove call to compute_imm_uses and free_df. + * tree-ssa-loop-ivcanon.c (create_canonical_iv): Call update_stmt. + (try_unroll_loop_completely): Call update_stmt. + * tree-ssa-loop-ivopts.c (rewrite_address_base): Call update_stmt. + (rewrite_use_compare): Call update_stmt. + (compute_phi_arg_on_exit): Insert each stmt before trying to process. + (rewrite_use) : Call update_stmt. + * tree-ssa-loop-manip.c (verify_loop_closed_ssa): Add arg to call. + * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Call + update_stmt. + * tree-ssa-operands.c (NULL_USE_OPERAND_P): Remove declaration. + (allocate_use_optype, allocate_vuse_optype): Adjust allocation size. + (free_uses, free_vuses, free_v_may_defs, free_v_must_defs): Delink + use nodes. + (initialize_vuse_operand): New. Initialize a vuse operand. + (initialize_v_may_def_operand): New. Initialize a maydef operand. + (initialize_v_must_def_operand): New. Initialize a mustdef operand. + (finalize_ssa_defs): Use stmt parameter. + (correct_use_link): Ensure a use node is in the correct list, and has + the correct stmt pointer. + (finalize_ssa_uses, finalize_ssa_v_may_defs, finalize_ssa_vuses, + finalize_ssa_v_must_defs): Also initialize use nodes. + (finalize_ssa_stmt_operands): Pass extra stmt operands. + (build_ssa_operands): Seperate parsing from final operand construction. + (parse_ssa_operands): New. Parse entry point for operand building. + (swap_tree_operands): New. Swap 2 tree operands. + (update_stmt_operands): Ranamed from get_stmt_operands. Always builds + operands. + (get_expr_operands): Call swap_tree_operands when needed. + (copy_virtual_operands): Use initialize routines for virtual use ops. + (create_ssa_artficial_load_stmt): Add extra stmt parameter. + (verify_abort): New. Issue imm_use error. + (verify_imm_links): New Verify imm_use links for a var. + (dump_immediate_uses_for): New. Dump imm_uses for a var to file. + (dump_immediate_uses): New. Dump imm_uses for all vars to file. + (debug_immediate_uses): New. Dump imm_uses for all vars to stderr. + (debug_immediate_uses_for): New. Dump imm_uses for a var to stderr. + * tree-ssa-operands.h (struct use_operand_ptr): Delete. + (NULL_USE_OPERAND_P) Define. + (use_optype_d, v_def_use_operand_type, vuse_optype_d): Add immediate + use node. + (struct vuse_operand_type): New struct. + (SET_USE): Call set_ssa_use_from_ptr. + (USE_STMT): Define. + (PHI_ARG_INDEX_FROM_USE): Define. + * tree-ssa-phiopt.c (replace_phi_edge_with_variable): Set the phi + argument via SET_USE, not PHI_ARG_DEF_TREE. + * tree-ssa-pre.c (eliminate): Call update_stmt. + * tree-ssa-propagate.c (cfg_blocks_get): Use imm_use iterators. Don't + call free_df. + * tree-ssa-sink.c (all_immediate_uses_same_place): Use imm_use iterator. + (nearest_common_dominator_of_uses): Use imm_use iterator. + (statement_sink_location): Use imm_use iterator and interface. + (execute_sink_code): Don't call compute_immediate_uses or free-df. + * tree-ssa-threadupdate.c (create_edge_and_update_destination_phis): Use + PHI_ARG_DEF, not PHI_ARG_DEF_TREE. + * tree-ssa.c (verify_use, verify_phi_args): Verify some imm_use info. + (verify_ssa): Ensure no stmt is marked modify after optimization pass + if new parameter is true. + (init_tree_ssa): Don't initialize operand cache here. + (delete_tree_ssa): Don't destroy operand cache here. + (propagate_into_addr): Pass in a use pointer, return true if anything + was changed. + (replace_immediate_uses): Use imm_use iterator, call update_stmt. + (check_phi_redundancy): Use imm_use iterator. + (kill_redundant_phi_nodes): Don't call compute_immediate_uses or + free_df. + * tree-ssanames.c (make_ssa_name): Initialize imm_use node. + (release_ssa_name): Delink node and all elements in its imm_use list. + * tree-tailcall.c (adjust_return_value): Call update_stmt. + * tree-vect-analyze.c (vect_stmt_relevant_p): Use imm_use iterator. + * tree-vectorizer.c (need_imm_uses_for): Delete. + (vectorize_loops): Dont call compute_immediate_uses or free_df. + * tree.h (struct ssa_imm_use_d): Define. + (SSA_NAME_IMM_USE_NODE): Define. + (struct tree_ssa_name): Add imm_use node. + (PHI_DF): Delete. + (PHI_ARG_IMM_USE_NODE): Define. + (struct phi_arg_d): Add imm_use node. + (struct tree_phi_node): Remove struct dataflow_d element. + (TDF_STMTADDR): Define. + +2005-04-05 Dale Johannesen + + * doc/invoke.texi (Optimization Options): Remove + duplicate -fcse-follow-jumps. Add -fweb. + (-ftree-lim): Fix spelling (-ftree-loop-im, invariants). + (-fivcanon): Fix spelling (-ftree-loop-ivcanon). + +2005-04-05 Per Bothner + + * tree-ssa.c (execute_early_warn_uninitialized): Pass context node + to talk_tree as 'data' parameter, rather than EXPR_LOCUS. + (warn_uninit): Get EXPR_LOCUS from context now instead. + This fixes a USE_MAPPED_LOCATION testsuite failure. + + * tree-ssa.c (warn_uninitialized_var): Remove useless local. + +2005-04-05 Per Bothner + + * c-decl.c (finish_function): If USE_MAPPED_LOCATION set the location + of the artification 'return 0' in main() to BUILTINS_LOCATION. + * tree-cfg.c (remove_bb): Check that location isn't BUILTINS_LOCATION + before warning. + +2004-04-05 Devang Patel + + * config/rs600/altivec.md (altivec_vsr): Rename to .. + (lhsr3): ... new name. + (altivec_vsra): Rename to .. + (ashr3): ... new name. + * config/rs6000/rs6000.c (builtin_description): Rename shift + operations. + +2004-04-05 Paolo Bonzini + + * combine.c (RTL_HOOKS_GEN_LOWPART_NO_EMIT): Use + gen_lowpart_for_combine. + * cse.c (gen_lowpart_if_possible): Move... + * rtlhooks.c (gen_lowpart_if_possible): ... here. Also try + gen_lowpart_SUBREG. + (gen_lowpart_no_emit_general): Use it. + +2005-04-05 Eric Botcazou + + * config/sparc/sparc.c (TARGET_ASM_FILE_END): Undefine before + overriding. + +2005-04-05 Paolo Bonzini + + * system.h: Fix typo. + +2005-04-05 Bernd Schmidt + + * config/bfin/bfin-modes.def: New file. + * config/bfin/bfin-protos.h: New file. + * config/bfin/bfin.c: New file. + * config/bfin/bfin.h: New file. + * config/bfin/bfin.md: New file. + * config/bfin/bfin.opt: New file. + * config/bfin/crti.s: New file. + * config/bfin/crtn.s: New file. + * config/bfin/elf.h: New file. + * config/bfin/lib1funcs.asm: New file. + * config/bfin/predicates.md: New file. + * config/bfin/t-bfin: New file. + * config/bfin/t-bfin-elf: New file. + * doc/extend.texi (exception_handler, kspisusp, nesting, nmi_handler): + Document new attributes. + (interrupt, interrupt_handler, saveall): Update documentation for + these attributes. + * doc/install.texi (Specific): Add entry for the Blackfin. + * doc/invoke.texi (Blackfin Options): New section. + * doc/md.texi (Blackfin family): New section to document constraints. + * config.gcc: Add bfin*-* and bfin*-elf configurations. + +2005-04-05 Olivier Hainque + + * config/mips/iris6.h (DWARF_FRAME_RETURN_COLUMN): Redefine to + match what the system unwinder expects. + * config/mips/mips.c (mips_frame_set): If we're saving the return + address register and the dwarf return address column number differs + from the hard register number, adjust the note reg to refer to the + former. + +2004-04-05 Richard Sandiford + + * config/mn10300/mn10300-protos.h (mn10300_override_options): Declare. + * config/mn10300/mn10300.h (target_flags, TARGET_MULT_BUG) + (TARGET_SWITCHES, TARGET_DEFAULT): Delete. + (processor_type): New enum. + (mn10300_processor): New variable. + (TARGET_AM33, TARGET_AM33_2): Redefine in terms of mn10300_processor. + (PROCESSOR_DEFAULT, OVERRIDE_OPTIONS): New macros. + * config/mn10300/linux.h (TARGET_SWITCHES, TARGET_DEFAULT): Delete. + (PROCESSOR_DEFAULT): New macro. + * config/mn10300/mn10300.c (mn10300_processor): New variable. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (mn10300_handle_option, mn10300_override_options): New functions. + * config/mn10300/mn10300.opt: New file. + +2005-04-05 Eric Botcazou + Sebastian Pop + + PR tree-optimization/19903 + * tree-chrec.c (chrec_convert): Return chrec_dont_know for constants + that don't fit in their type after conversion. + +2005-04-05 Uros Bizjak + + PR target/20421 + * config/i386/i386.md (frndintxf2_floor, frndintxf2_ceil) + (frndintxf2_trunc, frndintxf2_mask_pm): Add FLAGS_REG clobber. + Allocate local stack slots here. Set ix86_optimize_mode_switching. + flag here. Implement using define_insn_and_split. + (frndintxf2_floor_i387, frndintxf2_ceil_i387, frndintxf2_trunc_i387) + (frndintxf2_mask_pm_i387): New insn patterns. + (floorsf2, floordf2, floorxf2): Remove local stack slot allocations. + Do not set ix86_optimize_mode_switching flag. + (ceilsf2, ceildf2, ceilxf2): Same. + (btruncsf2, btruncdf2, btruncxf2): Same. + (nearbyintsf2, nearbyintdf2, nearbyintxf2): Same. + +2005-04-05 Ian Lance Taylor + + PR debug/9963 + * config/i386/cygming.h (ASM_OUTPUT_EXTERNAL): Pass DECL to + i386_pe_record_external_function. + (i386_pe_record_external_function): Update declaration. + * config/i386/winnt.c (struct extern_list): Add decl field. + (i386_pe_record_external_function): Add decl parameter. + (i386_pe_file_end): Check TREE_ASM_WRITTEN on decl, not + identifier. + * config/i386/i386-protos.h (i386_pe_record_external_function): + Update declaration. + +2005-04-05 Kazu Hirata + + * config/m68k/m68k-protos.h: Add a prototype for + valid_dbcc_comparison_p_2. + * config/m68k/m68k.c (not_sp_operand, symbolic_operand, + extend_operator, const_uint32_operand, const_sint32_operand, + general_src_operand, nonimmediate_src_operand, + memory_src_operand, post_inc_operand, pre_dec_operand, + pcrel_address): Move to predicates to predicates.md. + * config/m68k/m68k.h (PREDICATE_CODES): Remove. + * config/m68k/m68k.md: Include predicates.md. + * config/m68k/predicates.md: New. + +2005-04-04 Roger Sayle + + * config/i386/i386.md (*truncdfsf2_i387_1): New pattern. + + * fold-const.c (maybe_lvalue_p): Delete orphaned comment. + +2005-04-04 Ian Lance Taylor + + * c-typeck.c (struct c_switch): Rename switch_stmt field to + switch_expr. + (c_start_case): Build SWITCH_EXPR, not SWITCH_STMT. + (do_case): Use SWITCH_COND rather than SWITCH_STMT_COND. + (c_finish_case): Use SWITCH_BODY rather than SWITCH_STMT_BODY. + Call c_do_switch_expr_warnings rather than c_do_switch_warnings. + * c-common.c (c_do_switch_warnings_1): New static function broken + out of c_do_switch_warnings. + (c_do_switch_warnings): Call c_do_switch_warnings_1. + (c_do_switch_expr_warnings): New function. + * c-common.h (c_do_switch_expr_warnings): Declare. + +2005-04-04 David Edelsohn + Daniel Jacobowitz + + * tree-eh.c (tree_could_trap_p): Allow non-constant floating point + trapping divide. + * rtlanal.c (may_trap_p): Same. + +2005-04-04 Dale Johannesen + + * ChangeLog: remove reference to ChangeLog.12. + +2005-04-05 Hans-Peter Nilsson + + CRIS epilogue as RTL. + * config/cris/cris.md: Change all 0 in unspec 0 to + CRIS_UNSPEC_PLT. + (CRIS_UNSPEC_PLT, CRIS_UNSPEC_FRAME_DEALLOC): New constants. + ("*cris_load_multiple", "cris_frame_deallocated_barrier"): New + patterns. + ("return"): Change to define_expand. Call cris_expand_return for + actual expansion. + ("*return_expanded"): New pattern. + ("epilogue"): New define_expand. + * config/cris/cris.h (PREDICATE_CODES): Add + cris_load_multiple_op. + * config/cris/cris.c (ASSERT_PLT_UNSPEC): Correct test for unspec + type. + (enum cris_retinsn_type): New. + (struct machine_function): New member return_type. + (TARGET_ASM_FUNCTION_EPILOGUE): Don't override. + (cris_target_asm_function_epilogue): Remove, moving RTLified + contents to... + (cris_expand_epilogue): New function. + (cris_reg_saved_in_regsave_area, cris_movem_load_rest_p, + (cris_gen_movem_load, cris_load_multiple_op) + (cris_return_address_on_stack_for_return, cris_expand_return): New + functions. + (cris_target_asm_function_prologue) + (cris_initial_frame_pointer_offset): Call + cris_reg_saved_in_regsave_area instead of complicated expression. + Call cris_return_address_on_stack instead of an expression. + (cris_print_operand) : New cases. + (cris_return_address_on_stack): Change return-type to bool. + (cris_simple_epilogue): Ditto. Return false if registers are + saved. + * config/cris/cris-protos.h (cris_simple_epilogue) + (cris_return_address_on_stack): Adjust prototype return type. + (cris_gen_movem_load, cris_expand_epilogue, cris_expand_return) + (cris_return_address_on_stack_for_return): New prototypes. + +2005-04-04 Kazu Hirata + + * config/frv/frv.h (PREDICATE_CODES): Add CONST to + gpr_or_int12_operand. + + * config/frv/frv-protos.h: Add a prototype to + frv_legitimate_memory_operand and frv_const_unspec_p. + (frv_unspec): Move from frv.c. + * config/frv/frv.c (frv_unspec): Move to frv-protos.h. + (frv_const_unspec_p, frv_legitimate_memory_operand_): Export. + (ldd_address_operand, fdpic_fptr_operand, frv_load_operand, + gpr_or_fpr_operand, gpr_or_int12_operand, + gpr_fpr_or_int12_operand, fpr_or_int6_operand, + gpr_or_int10_operand, gpr_or_int_operand, int12_operand, + int6_operand, int5_operand, uint5_operand, uint4_operand, + uint1_operand, int_2word_operand, uint16_operand, + upper_int16_operand, integer_register_operand, + gpr_no_subreg_operand, fpr_operand, even_reg_operand, + odd_reg_operand, even_gpr_operand, odd_gpr_operand, + quad_fpr_operand, even_fpr_operand, odd_fpr_operand, + dbl_memory_one_insn_operand, dbl_memory_two_insn_operand, + move_destination_operand, movcc_fp_destination_operand, + frv_function_symbol_referenced_p, move_source_operand, + condexec_dest_operand, condexec_source_operand, + reg_or_0_operand, lr_operand, fdpic_operand, got12_operand, + const_unspec_operand, gpr_or_memory_operand, + gpr_or_memory_operand_with_scratch, fpr_or_memory_operand, + icc_operand, fcc_operand, cc_operand, icr_operand, + fcr_operand, cr_operand, call_operand, sibcall_operand, + symbolic_operand, relational_operator, + integer_relational_operator, float_relational_operator, + ccr_eqne_operator, minmax_operator, + condexec_si_binary_operator, condexec_si_media_operator, + condexec_si_divide_operator, condexec_si_unary_operator, + condexec_sf_conv_operator, condexec_sf_add_operator, + condexec_memory_operand, intop_compare_operator, acc_operand, + even_acc_operand, quad_acc_operand, accg_operand: Move to + predicates.md. + * config/frv/frv.h (PREDICATE_CODES): Remove. + * config/frv/frv.md: Include predicates.md. + * config/frv/predicates.md: New. + +2004-04-04 Richard Sandiford + + PR target/19537 + * Makefile.in (tree-ssa-loop-ivopts.o): Depend on langhooks.h. + * tree-ssa-loop-ivopts.c: Include langhooks.h. + (add_standard_iv_candidates_for_size): New function, extracting code + from add_standard_iv_candidates and parameterizing it by type size. + (add_standard_iv_candidates): Use add_standard_iv_candidates_for_size. + +2004-04-04 Richard Sandiford + + * system.h (GCOV_SIZE_TYPE): Unposion. + * gcov-io.h (GCOV_TYPE_NODE): Delete, replacing with... + (GCOV_TYPE_SIZE): ...this new macro. + * coverage.h (get_gcov_type, GCOV_TYPE_NODE): Declare. + * coverage.c (get_gcov_type, get_gcov_unsigned_t): New functions. + (rtl_coverage_counter_ref): Use GCOV_TYPE_SIZE. + (build_fn_info_type, build_fn_info_value, build_ctr_info_type) + (build_ctr_info_value, build_gcov_info): Use get_gcov_unsigned_t + instead of unsigned_intSI_type_node. + * rtl-profile.c (rtl_gen_interval_profiler, rtl_gen_pow2_profiler) + (rtl_gen_one_value_profiler_no_edge_manipulation) + (rtl_gen_const_delta_profiler): Use GCOV_TYPE_SIZE. + * value-prof.c: Include coverage.h. + +2005-04-02 Daniel Berlin + Diego Novillo + + Fix PR tree-optimization/20703 + Fix PR tree-optimization/20725 + + * tree-ssa-pre.c (phi_translate): Handle tcc_comparison. + (create_expression_by_pieces): Ditto. + (valid_in_set): Ditto. Also handle tcc_declaration. + (find_or_generate_expression): Handle comparison class. + (insert_into_preds_of_block): Ditto. + (insert_aux): Ditto. + (create_value_expr_from): Handle comparison class, recursively + handle reference nodes. + (compute_avail): Handle comparison classes, rewrite a little cleaner. + (execute_pre): Fix spacing. + (do_fre): Renamed to execute_fre. + +2005-04-04 Eric Botcazou + + * doc/invoke.texi (SPARC options): Document that + -mlittle-endian is not supported on Linux either. + +2005-04-04 Eric Botcazou + + PR target/4198 + PR target/12027 + * config.gcc (Obsolete configurations): Remove + sparclite-*-coff*, sparclite-*-elf* and sparc86x-*-elf*. + (sparclite-*-coff*): Delete. + (sparclite-*-elf*): Likewise. + (sparc86x-*-elf*): Likewise. + (target_cpu_default) : Remove sparc86x. + * config/sparc/lite.h: Delete. + * config/sparc/litecoff.h: Likewise. + * config/sparc/liteelf.h: Likewise. + * config/sparc/sp86x-elf.h: Likewise. + * config/sparc/t-sparclite: Likewise. + * config/sparc/t-sp86x: Likewise. + +2005-04-04 Adrian Straetling + + * config/s390/s390-protos.h: (s390_comparison, + s390_alc_comparison, s390_slb_comparison, const0_operand, + consttable_operand, larl_operand, s_operand, + shift_count_operand, bras_sym_operand, load_multiple_operation, + store_multiple_operation, s390_plus_operand): Remove prototypes. + (s390_legitimate_address_without_index_p): New prototype. + * config/s390/s390.c: (SYMBOL_FLAG_ALIGN1, DISP_IN_RANGE): Move + to s390.h. + (s390_comparison, s390_alc_comparison, s390_slb_comparison, + const0_operand, consttable_operand, larl_operand, s_operand, + shift_count_operand, bras_sym_operand, load_multiple_operation, + store_multiple_operation, s390_plus_operand): Move to + predicates.md. + (check_mode): Remove. + (s390_branch_condition_mask): Remove 'static'. Move prototype to + s390-protos.h. + (s390_legitimate_address_without_index_p): New. + * config/s390/s390.h (PREDICATE_CODES): Remove. + * config/s390/s390.md: Include predicates.md. + * config/s390/predicates.md: New. + +2005-04-04 Eric Botcazou + + PR target/20446 + * config/sparc/sparc.h (NEED_INDICATE_EXEC_STACK): Define to 0. + * config/sparc/linux.h (TARGET_ASM_FILE_END): Delete. + (NEED_INDICATE_EXEC_STACK): Define to 1. + * config/sparc/linux64.h (TARGET_ASM_FILE_END): Delete. + (NEED_INDICATE_EXEC_STACK): Define to 1. + * config/sparc/sparc.c (TARGET_ASM_FILE_END): Set to sparc_file_end. + (add_pc_to_pic_symbol): Rename into pic_helper_symbol. + (add_pc_to_pic_symbol_name): Rename into pic_helper_symbol_name. + (pic_helper_emitted_p): New global. + (emit_pic_helper): New function extracted from... + (load_pic_register): ...here. Add 'delay_pic_helper' parameter. + Do not call emit_pic_helper if delay_pic_helper is true. + (sparc_expand_prologue): Pass 'false' to load_pic_register. + (sparc_output_mi_thunk): Pass 'true' to load_pic_register. + (sparc_file_end): New function. + +2005-04-04 Kazu Hirata + + * config/mcore/mcore-protos.h: Remove the prototypes for + mcore_arith_reg_operand, mcore_general_movsrc_operand, + mcore_general_movdst_operand, mcore_reload_operand, + mcore_arith_J_operand, mcore_arith_K_operand, + mcore_arith_K_operand_not_0, mcore_arith_M_operand, + mcore_arith_K_S_operand, mcore_arith_imm_operand, + mcore_arith_any_imm_operand, mcore_arith_O_operand, + mcore_literal_K_operand, mcore_addsub_operand, + mcore_compare_operand, mcore_load_multiple_operation, + mcore_store_multiple_operation, mcore_call_address_operand. + Add a prototype for const_ok_for_mcore. + * config/mcore/mcore.c (mcore_call_address_operand, + mcore_general_movsrc_operand, mcore_general_movdst_operand, + mcore_arith_reg_operand, mcore_reload_operand, + mcore_arith_J_operand, mcore_arith_K_operand, + mcore_arith_K_operand_not_0, mcore_arith_K_S_operand, + mcore_arith_M_operand, mcore_arith_imm_operand, + mcore_arith_any_imm_operand, mcore_arith_O_operand, + mcore_literal_K_operand, mcore_addsub_operand, + mcore_compare_operand, mcore_load_multiple_operation, + mcore_store_multiple_operation): Move to predicates.md. + (const_ok_for_mcore): Export. + * config/mcore/mcore.h (PREDICATE_CODES): Remove. + * config/mcore/mcore.md: Include predicates.md. + * config/mcore/predicates.md: New. + + * config/mcore/predicates.md: Fix a comment typo. + +2005-04-04 Andreas Krebbel + Adrian Straetling + + * config/s390/2064.md ("z_mul", "z_inf"): New insn reservations. + * config/s390/2084.md ("x_mul_hi", "x_mul_sidi", "x_div"): Likewise. + * config/s390/s390.md ("imulhi", "imulsi", "imuldi"): Added to "type" + attribute. + ("imul"): Removed from "type" attribute. + ("*muldi3_sign", "muldi3"): Changed type to imuldi. + ("mulsi3/1", "mulsi3/3", "mulsi/4", "mulsidi3", "umulsidi3"): + Changed type to imulsi. + ("*mulsi3_sign", "mulsi3/2"): Changed type to imulhi. + +2005-04-04 Richard Sandiford + + * config/mcore/mcore.h (target_flags, HARDLIT_BIT, ALIGN8_BIT, DIV_BIT) + (RELAX_IMM_BIT, W_FIELD_BIT, OVERALIGN_FUNC_BIT, CGDATA_BIT) + (SLOW_BYTES_BIT, LITTLE_END_BIT, M340_BIT, TARGET_HARDLIT) + (TARGET_DIV, TARGET_RELAX_IMM, TARGET_W_FIELD, TARGET_OVERALIGN_FUNC) + (TARGET_CG_DATA, TARGET_SLOW_BYTES, TARGET_LITTLE_END, TARGET_M340) + (TARGET_SWITCHES, mcore_stack_increment_string) + (TARGET_OPTIONS): Delete. + (TARGET_DEFAULT, OPTIMIZATION_OPTIONS): Use MASK_* constants rather + than *_BIT constants. + (TARGET_8ALIGN): #undef old definition before redefining to 1. + * config/mcore/mcore.c (mcore_stack_increment_string): Delete. + (TARGET_DEFAULT_TARGET_FLAGS): Override default to TARGET_DEFAULT. + (mcore_override_options): Delete mcore_stack_increment code. + Change use of M340_BIT to MASK_M340. + * config/mcore/mcore.opt: New file. + +2005-04-04 Ian Lance Taylor + + * config/arm/arm.c (replace_symbols_in_block): Remove static + function. + +2005-04-04 Kazu Hirata + + * config/fr30/fr30-protos.h: Remove the prototypes for + stack_add_operand, add_immediate_operand, + high_register_operand, low_register_operand, call_operand, + di_operand, and nonimmediate_di_operand. + * config/fr30/fr30.c (stack_add_operand, + add_immediate_operand, high_register_operand, + low_register_operand, call_operand, di_operand, + nonimmediate_di_operand): Move to predicates.md. + * config/fr30/fr30.h (PREDICATE_CODES): Remove. + * config/fr30/fr30.md: Include predicates.md. + * config/fr30/predicates.md: New. + + * config/mcore/mcore.h (PREDICATE_CODES): Add SYMBOL_REF and + LABEL_REF to mcore_general_movsrc_operand. Add SYMBOL_REF to + mcore_call_address_operand. + + * config/sh/sh.h (PREDICATE_CODES): Add CONST to + general_movsrc_operand. + +2005-04-04 Alan Modra + + * passes.c (rest_of_handle_final): NULL unlikely_text_section_name + after freeing. + +2005-04-04 Richard Earnshaw + + PR target/14812 + * arm.c (arm_select_cc_mode): Return CC_Zmode when comparing against + a negated value. + +2005-04-04 Richard Henderson + Jakub Jelinek + + PR rtl-optimization/16104 + * fold-const.c (fold_unary): Fix folding of vector conversions. + +2005-04-04 Richard Sandiford + + * config.gcc (xstormy16-*-elf): Set extra_options. + * config/stormy16/stormy16.h (target_flags, TARGET_SWITCHES): Delete. + * config/stormy16/stormy16.opt: New file. + +2005-04-04 Richard Sandiford + + * config/pdp11/pdp11.h (target_flags, TARGET_SWITCHES, TARGET_DEFAULT) + (TARGET_FPU, TARGET_SOFT_FLOAT, TARGET_AC0, TARGET_NO_AC0, TARGET_45) + (TARGET_BCOPY_BUILTIN, TARGET_INT16, TARGET_INT32, TARGET_FLOAT32) + (TARGET_FLOAT64, TARGET_ABSHI_BUILTIN, TARGET_BRANCH_EXPENSIVE) + (TARGET_BRANCH_CHEAP, TARGET_SPLIT, TARGET_NOSPLIT) + (TARGET_UNIX_ASM): Delete. + (TARGET_40_PLUS): Redefine in terms of TARGET_40 and TARGET_45. + * config/pdp11/2bsd.h (TARGET_UNIX_ASM_DEFAULT): Use MASK_UNIX_ASM. + * config/pdp11/pdp11.c (pdp11_handle_option): New function. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + * config/pdp11/pdp11.opt: New file. + +2005-04-03 Roger Sayle + Alexandre Oliva + + PR c++/19199 + * fold-const.c (non_lvalue): Split tests into... + (maybe_lvalue_p): New function. + (fold_cond_expr_with_comparison): Preserve lvalue-ness for the + C++ front-end prior to lowering into gimple form. + +2005-04-03 Kaveh R. Ghazi + + * builtins.def (BUILT_IN_STPNCPY, BUILT_IN_STRCASECMP, + BUILT_IN_STRNCASECMP): New. + * doc/extend.texi: Document stpncpy, strcasecmp, strncasecmp + and strndup. + +2005-04-03 Richard Earnshaw + + PR target/14812 + * arm.md (addsi3_compare0_for_combiner): Delete. + (addsi3_compare0_scratch_for_combiner): Delete. + (cmpsi_neg_shiftsi): Delete. + (compare_negsi_si): New pattern. + (cmpsi_negshiftsi_si): New pattern. + (negated_cbranchsi4): Restrict to equality_operator. + + * arm.md (movhi_insn_arch4): delete trailing white space from assembler + template. + +2005-04-03 Kazu Hirata + + * cfghooks.c, cfgrtl.c, modulo-sched.c, config/i386/winnt.c: + Fix comment typos. + + * doc/install.texi: Fix a typo. + +2005-04-03 Steven Bosscher + + PR middle-end/20648 + * bb-reorder.c (duplicate_computed_gotos): Do not unfactor + a computed goto if the edge to the computed goto block has + incoming abnormal edges. Clarify how the function works. + +2005-04-03 Nathan Sidwell + + * params.c (set_param_value): Use gcc_assert & gcc_unreachable. + * passes.c (open_dump_file, rest_of_handle_final): Likewise. + * postreload-gcse.c (expr_equiv_p, oprs_unchanged_p, + hash_scan_set, reg_set_between_after_reload_p, + reg_used_between_after_reload_p, get_avail_load_store_reg, + eliminate_partially_redundant_load): Likewise. + * postreload.c (reload_cse_simplify_set, + reload_combine_note_use): Likewise. + * predict.c (predict_insn, expected_value_to_br_prob, + propagate_freq, expensive_function_p): Likewise. + * print-rtl.c (print_rtx): Likewise. + * profile.c (instrument_edges, instrument_values, + compute_branch_probabilities, branch_prob, union_groups, + tree_register_profile_hooks, rtl_register_profile_hooks): Likewise. + * protoize.c (in_system_include_dir, file_could_be_converted, + file_normally_convertible, gen_aux_info_file, seek_to_line, + do_cleaning): Likewise. + * tree-ssa-alias.c (collect_points_to_info_r): Likewise. + * tree-ssa-ccp.c (execute_fold_all_builtins): Likewise. + * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. + +2005-04-03 Mostafa Hagog + + * cfg.c (clear_bb_flags): Don't clear BB_DISABLE_SCHEDULE. + * modulo-sched.c (undo_replace_buff_elem): New structure. + (kernel_number_of_cycles, ps_unschedule_node, + undo_generate_reg_moves,free_undo_replace_buff, + undo_permute_partial_schedule, loop_single_full_bb_p, + SIMPLE_SMS_LOOP_P, loop_canon_p, canon_loop, + build_loops_structure, get_sched_window): New. + (generate_reg_moves): Return undo_replace_buff_elem and other + fixes. + (generate_prolog_epilog): Remove old loop versioning. + (sms_schedule): Use loop information and loop_version. + (sms_schedule_by_order): Split part of it to get_sched_window. + * passes.c (rest_of_handle_sms): call cfg_layout_initialize + cfg_layout_finalize and free_dominance_info before/after SMS. + +2005-04-03 Mostafa Hagog + + * cfghooks.c (lv_flush_pending_stmts, + cfg_hook_duplicate_loop_to_header_edge, extract_cond_bb_edges, + lv_adjust_loop_header_phi, lv_add_condition_to_bb): New. + * cfghooks.h (cfg_hook_duplicate_loop_to_header_edge, + lv_add_condition_to_bb, + lv_adjust_loop_header_phi, extract_cond_bb_edges, + flush_pending_stmts): New in cfg_hooks structure. + (cfg_hook_duplicate_loop_to_header_edge, lv_flush_pending_stmts, + extract_cond_bb_edges, lv_adjust_loop_header_phi, + lv_add_condition_to_bb): New declarations. + * cfgloop.h (duplicate_loop_to_header_edge): Change return type to + bool. + (loop_version): Declare. + * cfgloopmanip.c (cfghooks.h): Include. + (duplicate_loop_to_header_edge): Change return type to bool. + (loop_version, lv_adjust_loop_entry_edge): Move here. + * cfgrtl.c (cfgloop.h): Include. + (rtl_verify_flow_info_1): Fix. + (rtl_lv_add_condition_to_bb, rtl_extract_cond_bb_edges): New. + (rtl_cfg_hooks, cfg_layout_rtl_cfg_hook): Add hooks to + initialization. + * tree-cfg.c (tree_lv_adjust_loop_header_phi, + tree_lv_add_condition_to_bb): New. + (tree_cfg_hooks): Add new hooks to initialization. + * tree-ssa-loop-manip.c (lv_adjust_loop_header_phi, + lv_adjust_loop_entry_edge, tree_ssa_loop_version): Remove. + +2005-04-03 Kazu Hirata + + * config/stormy16/stormy16.h (PREDICATE_CODES): Add SUBREG to + xstormy16_below100_or_register, + xstormy16_splittable_below100_or_register, and + nonimmediate_nonstack_operand. + + * config/stormy16/stormy16-protos.h: Remove the prototypes for + xstormy16_ineqsi_operator, equality_operator, + inequality_operator, shift_operator, + xstormy16_below100_operand, xstormy16_below100_or_register, + xstormy16_splittable_below100_or_register, + xstormy16_onebit_set_operand, xstormy16_onebit_clr_operand. + * config/stormy16/stormy16.c (xstormy16_ineqsi_operator, + equality_operator, inequality_operator, + xstormy16_below100_operand, xstormy16_below100_or_register, + xstormy16_splittable_below100_or_register, + xstormy16_onebit_set_operand, xstormy16_onebit_clr_operand, + nonimmediate_nonstack_operand, shift_operator): Move to + predicates.md. + * config/stormy16/stormy16.h (PREDICATE_CODES): Remove. + * config/stormy16/stormy16.md: Include predicates.md. + * config/stormy16/predicates.md: New. + +2005-04-02 Kazu Hirata + + * config/iq2000/iq2000.c (uns_arith_operand, arith_operand, + small_int, large_int, reg_or_0_operand, simple_memory_operand, + equality_op, cmp_op, pc_or_label_operand, call_insn_operand, + move_operand, power_of_2_operand): Move to predicates.md. + * config/iq2000/iq2000.h (SPECIAL_MODE_PREDICATES, + PREDICATE_CODE): Remove. + * config/iq2000/iq2000.md: Include predicates.md. + * config/iq2000/predicates.md: New. + +2005-04-02 Richard Sandiford + + * config/m68hc11/m68hc11.h (target_flags, MASK_SHORT) + (MASK_AUTO_INC_DEC, MASK_M6811, MASK_M6812, MASK_M68S12) + (MASK_NO_DIRECT_MODE, MASK_MIN_MAX, MASK_LONG_CALLS) + (TARGET_SHORT, TARGET_M6811, TARGET_M6812, TARGET_M68S12) + (TARGET_AUTO_INC_DEC, TARGET_MIN_MAX, TARGET_NO_DIRECT_MODE) + (TARGET_LONG_CALLS, TARGET_SWITCHES, TARGET_OPTIONS) + (SUBTARGET_SWITCHES, SUBTARGET_OPTIONS, m68hc11_regparm_string) + (m68hc11_reg_alloc_order, m68hc11_soft_reg_count) + (TARGET_M68HC11): Delete. + (TARGET_DEFAULT): Change the default setting from MASK_M6811 to 0. + * config/m68hc11/m68hc12.h (TARGET_M68HC12): Delete. + * config/m68hc11/m68hc11.c (m68hc11_regparm_string) + (m68hc11_reg_alloc_order, m68hc11_soft_reg_count) + (nb_soft_regs): Delete. + (TARGET_DEFAULT_TARGET_FLAGS): Override default with TARGET_DEFAULT. + (m68hc11_override_options): Remove the code that caters for MASK_M6811 + and MASK_M6812 being set simultaneously. Change the code that sets + the default m68hc11_soft_reg_count to use integers instead of strings. + (m68hc11_conditional_register_usage, hard_regno_mode_ok): Use + m68hc11_soft_reg_count (which now has an int type) as the number + of soft registers. + * config/m68hc11/m68hc11.opt: New file. + +2005-04-02 Kazu Hirata + + * config/fr30/fr30.h (PREDICATE_CODES): Remove + fp_displacement_operand, sp_displacement_operand. + + * config/m68hc11/m68hc11-protos.h: Add a prototype for + m68hcc_auto_inc_p. + Remove the prototypes for tst_operand, cmp_operand, + stack_register_operand, d_register_operand, + hard_addr_reg_operand, splitable_operand, + m68hc11_logical_operator, m68hc11_arith_operator, + m68hc11_non_shift_operator, m68hc11_shift_operator, + m68hc11_unary_operator, m68hc11_eq_compare_operator, + non_push_operand, hard_reg_operand, and + reg_or_some_mem_operand. + * config/m68hc11/m68hc11.c (m68hcc_auto_inc_p): Make it + extern. + (tst_operand, cmp_operand, non_push_operand, + splitable_operand, reg_or_some_mem_operand, + stack_register_operand, d_register_operand, + hard_addr_reg_operand, hard_reg_operand, + m68hc11_eq_compare_operator, m68hc11_logical_operator, + m68hc11_arith_operator, m68hc11_non_shift_operator, + m68hc11_shift_operator, m68hc11_unary_operator): Move to + predicates.md. + * config/m68hc11/m68hc11.h (PREDICATE_CODES): Remove. + * config/m68hc11/m68hc11.md: Include predicates.md. + * config/m68hc11/predicates.md: New. + +2005-04-02 Alexandre Oliva + + PR debug/19345 + * dwarf2out.c (add_abstract_origin_attribute): Revert accidental + change checked in along with 2005-03-03's patch for debug/20253. + * tree-inline.c (remap_type): Remap TYPE_STUB_DECL. + (remap_decl): Insert type decl in map earlier. + +2005-04-02 Alexandre Oliva + + PR tree-optimization/20640 + * tree-ssa-dce.c (remove_dead_stmt): Don't redirect edge to + post-dominator if it has phi nodes. + (eliminate_unnecessary_stmts): Remove dead phis in all blocks + before dead statements. + +2005-04-02 Alexandre Oliva + + PR middle-end/20491 + * final.c (alter_subreg): Don't call subreg_regno for a non-REG. + +2005-04-02 Alexandre Oliva + + PR rtl-optimization/20290 + * loop.c (for_each_insn_in_loop): Don't assume the loop body runs + in every iteration if the entry point is the exit test. + +2005-04-02 Hans-Peter Nilsson + + * config/cris/cris.md (attribute "length"): Define. + +2005-04-02 Geoffrey Keating + + * config/rs6000/predicates.md (indexed_or_indirect_operand): New. + (word_offset_memref_operand): New. + * config/rs6000/rs6000-protos.h (word_offset_memref_operand): Delete. + (indexed_or_indirect_operand): Delete. + * config/rs6000/rs6000.c (word_offset_memref_operand): Delete. + (indexed_or_indirect_operand): Delete. + + * config/rs6000/t-darwin8: Comment out ppc64 multilib. + + PR 20650 + * config/rs6000/rs6000.md (fix_truncdfsi2): Make destination + a register. + + * config/rs6000/t-darwin (TARGET_LIBGCC2_CFLAGS): Add -pipe. + * config/t-darwin (TARGET_LIBGCC2_CFLAGS): Likewise. + +2005-04-01 Jan-Benedict Glaw + + * gcc/config/vax/vax.md: Spellcheck, fix whitespace. + +2005-04-01 Ian Lance Taylor + + * gcc.c: Don't include or declare getrusage. + (rus, prus): Remove static variables. + (execute): Use pex_run/pex_get_status rather than pexecute/pwait. + (process_command): Permit report_times and use_pipes together. + +2005-04-01 Joseph S. Myers + + * c-decl.c (validate_proto_after_old_defn): Look at + TYPE_MAIN_VARIANT of argument types. + +2005-04-01 Paul Brook + + * config/arm/arm.c (thumb_call_via_label): Include space for SP. + (arm_output_function_epilogue): Allow call_via_SP. + (thumb_call_via_reg, arm_file_end): Ditto. + * config/arm/arm.h (struct machine_function): Include space for SP. + (thumb_call_via_label): Update declaration. + +2005-04-01 Ian Lance Taylor + + * final.c (final_scan_insn): Revert part of 2005-03-30 patch: when + doing a peephole optimization, once again put any notes in the + proper position. + +2005-04-01 Kazu Hirata + + * bb-reorder.c, fold-const.c, varasm.c: Fix comment typos. + +2005-04-01 Nathan Sidwell + + * local-alloc.c (update_equiv_regs): Use gcc_assert, gcc_unreachable. + (block_alloc, find_free_reg): Likewise. + * loop-doloop.c (doloop_modify): Likewise. + * loop-invariant.c (record_use): Likewise. + * loop-iv.c (get_biv_step_1, get_biv_step, iv_analyze, + get_iv_value, canon_condition, eliminate_implied_condition, + eliminate_implied_condition, simplify_using_initial_values, + shorten_into_mode, canonicalize_iv_subregs, + iv_number_of_iterations): Likewise. + * loop-unroll.c (expand_var_during_unrolling): Likewise. + * loop-unswitch.c (compare_and_jump_seq, unswitch_single_loop, + unswitch_loop): Likewise. + * loop.c (INSN_LUID, loop_optimize, rtx_equal_for_loop_p, + move_movables, replace_call_address, find_and_verify_loops, + rtx_equal_for_prefetch_p, fold_rtx_mult_add, loop_iterations, + record_giv, final_giv_value, general_induction_var, + simplify_giv_expr, extension_within_bounds_p, try_copy_prop, + loop_giv_dump): Likewise. + + * gcov-io.h (GCOV_CHECK, GCOV_CHECK_READING, + GCOV_CHECK_WRITING): Remove. + (gcov_position, gcov_rewrite): Use gcc_assert. + * gcov-io.c (gcov_open, gcov_write_words, gcov_write_length, + gcov_read_words, gcov_sync, gcov_seek): Use gcc_assert. + * libgcov.c (__gcov_merge_single, __gcov_merge_delta): Use + gcc_assert. + +2005-04-01 Kazu Hirata + + * tree-inline.c: Fix a typo. + +2005-04-01 Nathan Sidwell + + * configure.ac (enable-checking): Explicitly set all variables for + collective switch values. Alphabetize variables. Rename + ac_checking_valgrind to ac_valgrind_checking. Allow 'none' as + synonym for 'no'. + * doc/install.texi (enable-checking): Update documentation. + * configure: Rebuilt. + +2005-04-01 Kazu Hirata + + * tree-inline.c (copy_body_r): Use CONSTANT_CLASS_P where + possible. + +2005-04-01 Richard Earnshaw + + * arm.c (adjacent_mem_locations): Reject volatile memory refs. + Also reject cases where this pattern will cause load delay stalls + unless optimizing for size and it will produce a shorter sequence. + * arm.md (arith_adjacent_mem): Make better use of ldm addressing + variants to avoid pre-adjusting the base when possible. + +2005-04-01 Richard Earnshaw + + * arm.md (minmax_arithsi): Reject all eliminable registers, not just + the frame and argument pointers. + (strqi_preinc, strqi_predec, loadqi_preinc, loadqi_predec): Likewise. + (loadqisi_preinc, loadqisi_predec, strsi_preinc): Likewise. + (strsi_predec, loadsi_preinc, loadsi_predec): Likewise. + (strqi_shiftpreinc, strqi_shiftpredec, loadqi_shiftpreinc): Likewise. + (loadqi_shiftpredec, strsi_shiftpreinc, strsi_shiftpredec): Likewise. + (loadsi_shiftpreinc, loadsi_shiftpredec): Likewise. + +2005-04-01 Danny Smith + + * config/i386/cygming.h (SUBTARGET_ATTRIBUTE_TABLE): Define, + with entry for selectany attribute. + * config/i386/i386-protos.h (ix86_handle_selectany_attribute): + Declare. + * config/i386/winnt.c (ix86_handle_selectany_attribute): Define. + (i386_pe_asm_named_section): Handle sections generated by + selectany attribute. + * doc/extend.texi (selectany): Document attribute. + +2005-04-01 Paolo Bonzini + Jan Hubicka + + * config/i386/i386.c (ix86_decompose_address): Look inside SUBREGs + to fix addresses involving EBP and ESP. + (aligned_operand, legitimate_address_p, ix86_address_cost): Be prepared + for SUBREGed registers. + (legitimate_address_p): Accept SUBREGed registers. + +2005-04-01 Jakub Jelinek + + PR c++/19406 + * dwarf2out.c (gen_type_die_for_member): Handle FIELD_DECL. + (dwarf2out_imported_module_or_decl): Use gen_type_die_for_member + for FIELD_DECLs. + +2005-04-01 Kazu Hirata + + * doc/contrib.texi, doc/invoke.texi, doc/tm.texi: Fix typos. + +2005-04-01 James E Wilson + + PR c++/20505 + * dwarf2out.c (rtl_for_decl_init): New function. + (rtl_for_decl_location): Extracted from here. + (tree_add_const_value_attribute): Call rtl_for_decl_init and + add_const_value_attribute. Delete initializer_constant_valid_p call. + +2005-04-01 Kazu Hirata + + * cgraphunit.c, dbxout.c, flow.c, gcse.c, gimplify.c, + lambda-code.c, loop.c, machmode.def, mips-tfile.c, + modulo-sched.c, passes.c, postreload-gcse.c, tree-eh.c, + tree-ssa-ccp.c, varasm.c, config/frv/frv.c, config/frv/frv.h, + config/frv/frv.md, config/i386/i386.c, config/i386/i386.h, + config/i386/i386.md, config/rs6000/predicates.md, + config/rs6000/rs6000.c, config/s390/fixdfdi.h, + config/s390/s390.c, config/stormy16/stormy16.c, + config/stormy16/stormy16.md, config/vax/vax.md: Fix comment + typos. + +2005-04-01 Joseph S. Myers + + PR c/17855 + * gimplify.c (gimplify_expr): Create a temporary for lvalue + COND_EXPR and CALL_EXPR. + +2005-03-31 Vladimir Makarov + + PR target/20632 + * genautomata.c (first_cycle_unit_presence): Check all alternative + states for unit presence. + + * doc/md.texi: Remove remark about impossibility to query unit + presence in non nondeterministic automaton state. + + * config/ia64/ia64.c (get_template): Change order of unit querying. + +2005-03-31 Kazu Hirata + + * tree-ssa-dom.c (cprop_into_successor_phis): Remove an + obsolete comment. + +2005-03-31 Zdenek Dvorak + + * cfgloopanal.c (mark_loop_exit_edges): Clean EDGE_LOOP_EXIT + flag for edges outside any loops. + +2005-03-31 Janis Johnson + + * doc/sourcebuild.texi (Test Directives): Describe cleanup-* procs. + +2005-03-31 Kazu Hirata + + * tree-ssa-alias.c: Follow spelling conventions. + * doc/tree-ssa.texi: Fix a typo. + +2005-03-31 J"orn Rennecke + + * postreload-gcse.c: Include target.h. + (gcse_after_reload_main): Return early if we cannot modify jumps. + * Makefile.in (postreload-gcse.o): Depend on $(TARGET_H). + +2005-03-31 David Edelsohn + + * tree-ssa-loop-im.c (stmt_cost): Add RDIV_EXPR to list of + expensive operations. + +2005-03-31 Ian Lance Taylor + + * collect2.c (lderrout): New variable. + (collect_exit): Dump ldout to stdout. Dump and unlink lderrout, + if it is set, to stderr. + (handler): Unlink lderrout if it is set. + (dump_file): Add "to" parameter. Change all callers. + (main): Initialize lderrout. + (collect_execute): Add errname parameter. Change all callers. + Rename redir parameter to outname. Never pass + PEX_STDERR_TO_STDOUT to pex_run. + * collect2.h (collect_execute, dump_file): Update declarations. + * tlink.c (tlink_execute): Add errname parameter. Change all + callers. + (do_tlink): Check lderrout as well as ldout. + +2005-03-31 Caroline Tice + + * Makefile.in (varasm.o): Add basic-block.h to list of requirements. + (bb-reorder.o): Add errors.h to list of requirements. + (STAGEFEEDBACK_FLAGS_TO_PASS): Add -freorder-blocks-and-partition to + profiledbootstrap flags. + * bb-reorder.c (errors.h): Add new include. + (struct bbro_basic_block_data_def): Add new field, in_trace. + (add_unlikely_executed_notes): Remove function. + (mark_bb_for_unlikely_executed_section): Remove function. + (insert_section_boundary_note): New function. + (verify_hot_cold_block_grouping): New function. + (push_to_next_round_p): Remove variables and tests that push all + cold blocks to last round. + (find_traces): Remove code that added extra round of trace finding + when doing partitioning. + (find_traces_1_round) : Remove variable last_round; add code to + update new struct field, in_trace; correct trace_length where it was + incorrect before (after call to copy_bb); change code that pushed all + cold blocks to last round. Instead verify that all blocks going into + a trace belong in the same partition. + (connect_traces): Modify to connect the traces in two passes, if the + function contains both hot and cold blocks. The first pass connects + all the traces for blocks in the partition that the first block in + the function belongs to; the second pass connnects all the traces + containing blocks that belong in the other partition. + (find_rarely_executed_basic_blocks_and_crossing_edges): Remove + code that automatically put the first block in a function into the + hot partition if the function had any hot blocks. + (fix_crossing_unconditional_branches): Check number of succ edges + before attempting to get one. + (fix_edges_for_rarely_executed_code): Update comment describing + function. + (reorder_basic_blocks): Add code to initialize new field (in_trace); + remove call to add_unlikely_executed_notes; add call to + verify_hot_cold_block_grouping. + (duplicate_computed_gotos): Don't change computed goto if it's a + crossing edge. + (partition_hot_cold_basic_blocks): Update function comment. + * cfgcleanup.c (try_simplify_condjump): Remove redundacy from + condition. + (try_forward_edges): Likewise. + (merge_blocks_move_predecessor_nojumps): Likewise. + (merge_blocks_move_successor_nojumps): Likewise. + (merge_blocks_move): Likewise. + (try_crossjump_bb): Likewise. + * cfglayout.c (update_unlikely_executed_notes): Remove function. + (fixup_reorder_chain): Remove code for adding UNLIKELY_EXECUTED_CODE + notes to cold bb's; remove call to update_unlikely_executed_notes. + (duplicate_insn_chain): change NOTE_INSN_UNLIKELY_EXECUTED_CODE to + NOTE_INSN_SWITCH_TEXT_SECTIONS. + * cfglayout.h (scan_ahead_for_unlikely_executed_note): Remove + function declaration. + * cfgrtl.c (can_delete_note_p): Remove UNLIKELY_EXECUTED_CODE note + from consideration. + (rtl_can_merge_blocks): Remove redundancy from condition. + (try_redirect_by_replacing_jump): Likewise. + (force_nonfallthru_and_redirect): Remove code for adding + UNLIKELY_EXECUTED_CODE notes to cold bb's. + (commit_one_edge_insertion): Likewise. + (cfg_layout_can_merge_blocks_p): Remove redundancy from condition. + * dbxout.c (FORCE_TEXT): Replace function_section with + current_function_section. + (struct dbx_debug_h): Add do_nothing function for new debug_hooks + function, switch_text_section. + (struct xcoff_debug): Likewise. + (dbxout_function_end): Add code to put out label diffs for both + hot and cold sections. + * debug.c (struct do_nothing_debug_hooks): Add do_nothing function + for new debug_hooks funciton, switch_text_section.. + * debug.h (struct gcc_debug_hooks): Add new function to debug_hooks, + switch_text_section. + * dwarf2out.c (struct dw_fde_struct): Add five new fields: + dw_fde_hot_section_label, dw_fde_hot_section_end_label, + dw_fde_unlikely_section_label, dw_fde_unlikely_section_end_label and + dw_fde_switched_sections. + (output_call_frame_info): Add test to see if function switches text + sections in the middle; if so, use appropriate extra hot and cold + section labels to compute size deltas for the hot and cold sections. + (dwarf2out_begin_prologue): Add code to initialize new fields in + dw_fde_struct. + (dwarf2out_switch_text_section): New function (invoked through + debug_hook); updates new fields in dw_fde_struct appropriately and + increments separate_line_info_table_in_use. + (dwarf2_debug_hooks): Initialize switch_text_section function to be + dwarf2out_switch_text_section. + (struct var_loc_node): Add new field, section_label. + (output_aranges): Add code to check whether in hot or cold section and + use the appropriate label in calculating deltas. + (output_ranges): Likewise. + (output_line_info): Add code to check which section we're in and + use appropriate hot/cold label. + (add_location_or_constant_value_attribute): Likewise. + (gen_subprogam_die): Modify arange attributes to use correct labels. + (dwarf2out_begin_block): Change call to function_section into call to + current_function_section. + (dwarf2out_end_block): Likewise. + (dwarf2out_source_line): Likewise. + (dwarf2out_var_location): Add code to check whether in hot or cold + section and use the appropriate label. + * except.c (output_function_exception_table): Change call to + function_section into call to current_function_section. + * final.c (profile_function): Likewise. + (scan_ahead_for_unlikely_executed_note): Remove function. + (final_scan_insn): Remove calls to + scan_ahead_for_unlikely_executed_note, and related code for switching + to cold section, except for the single time + NOTE_INSN_SWITCH_TEXT_SECTIONS may be encountered; add calls to + debug_hooks->switch_text_sections; replace appropriate calls to + function_section with calls to current_function_section. + * ifcvt.c (find_if_case_1): Remove redundancy from condition, add + test_bb to condition. + (find_if_case_2): Likewise. + * insn-notes.def: Change NOTE_INSN_UNLIKELY_EXECUTED_CODE to + NOTE_INSN_SWITCH_TEXT_SECTIONS. Update comment appropriately. + * opts.c (decode_options): Change warning about hot/cold partitioning + with exceptionss to inform (so as not to cause bootstrap failures); + remove warning about partitioning with DWARF debug info. + * output.h (current_function_section): Add new function decl. + (insert_section_boundary_note): Likewise. + (enum in_section): Move this declaration here from varasm.c. + (unlikely_section_label): Likewise. + (unlikely_text_section_name): Likewise. + (last_text_section_name): New global variable. + (last_text_section): Likewise. + (hot_section_label): Likewise. + (hot_section_end_label): Likewise. + (cold_section_end_label): Likewise. + * passes.c (rest_of_handle_final): Free unlikely_text_section_name. + * print-rtl.c (print_rtx): Change NOTE_INSN_UNLIKELY_EXECUTED_CODE + to NOTE_INSN_SWITCH_TEXT_SECTIONS. + * reg-stack.c (emit_swap_insn): Remove UNLIKELY_EXECUTED_CODE note + insn from consideration. + * sdbout.c (sdb_debug_hooks): Add do_nothing for new function, + switch_text_section. + * varasm.c (basic-block.h): Add new include. + (unlikely_section_label_printed): Remove global variable. + (unlikely_section_label): Make global variable not be static any more. + (unlikely_text_section_name): Likewise. + (hot_section_end_label): New global variable (not static) + (first_function_block_is_cold): Likewise. + (hot_section_label): Likewise. + (cold_section_end_label): Likewise.. + (last_text_section): New global variable, not static. + (last_text_section_name): New global variable, not static. + (initialize_cold_section_name): New function. + (enum in_section): Move declaration to output.h. + (text_section): Update last_text_section. + (unlikely_text_section): Replace code to determine cold section name + with call to initialize_cold_section_name; Add code to update + last_text_section; remove code for printing out label. + (named_section_real): Add code to update last_text_section and + last_text_section_name as appropriate. + (function_section): Change test for 'unlikely' to depend on + first_function_block_is_cold (moved old test to + current_function_section). + (current_function_section): New function. + (assemble_start_function): Move code that frees + unlikely_text_section_name; initialize hot_section_end_label; + print hot and cold section labels at the start of the function; + set first_function_block_is_cold, if appropriate; initialize l + ast_text_section; add call to insert_section_boundary_note. + (assemble_end_function): Add code to write out hot and cold section + end labels. + *vmsdbgout.c (vmsdbg_debug_hooks): Add do_nothing for new function, + switch_text_section. + * config/darwin.c (machopic_select_section): Replace incorrect + function in base_funs; update reloc for cold sections if necessary. + * config/darwin.h (SECTION_FUNCTION): Add code to update + last_text_section if appropriate. + (text_unlikely_section): Remove. + * config/sparc/sparc.c (sparc_output_deferred_case_vectors): Likewise. + * config/stormy16/stormy16.c (stormy_16_output_addr_vec): Likewise. + * config/xtensa/xtensa.c (override_options): Turn off hot/cold + partitioning for this architecture. + +2005-03-31 Olivier Hainque + + * dwarf2out.c (dwarf2out_frame_finish): Honor DWARF2_FRAME_INFO + defined and non-zero. + +2005-03-31 Gabriel Dos Reis + + PR c++/18644 + * doc/invoke.texi (-Wsynth): Don't document, as it now is void of + semantics. + +2005-03-31 Alan Modra + + PR target/20611 + * config/rs6000/rs6000.md (load_toc_v4_PIC_1b): Remove inline + label operand. Remove (use (unspec..)). Don't emit a label on + the offset word. + * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Don't + generate inline label for load_toc_v4_PIC_1b. + (rs6000_emit_load_toc_table): Likewise. + +2005-03-31 Kazu Hirata + + * config.gcc: Obsolete i860-*-sysv4*, ip2k-*-elf, + ns32k-*-netbsdelf*, and ns32k-*-netbsd*. + +2005-03-29 Devang Patel + + * tree-sra.c (decide_block_copy): Disable scalarization of + sub-elements. + +2005-03-30 Stuart Hastings + Dale Johannesen + + * Makefile.in (print-tree.o): Depend on tree-iterator.h. + * print-tree.c (print_node): Add case STATEMENT_LIST. + +2005-03-31 Alan Modra + + * config.gcc (cpu_is_64bit): Set for 64-bit powerpc cpus. + (powerpc64-*-linux*): Use it. Rearrange tm_file assignment. + (powerpc-*-linux*): Build a biarch compiler when --enable-targets + is given with "powerpc64*" or "all", or when --with-cpu chooses + a 64-bit cpu. + +2005-03-30 James E. Wilson + + PR debug/20268 + * dwarf2out.c (add_high_low_attributes): New function, extracted from + gen_lexical_block_die. + (gen_lexical_block_die, gen_inlined_subroutine_die): Call it. + +2005-03-31 Jan Hubicka + + 2004-11-02 Jan Hubicka + + * cgraph.c (cgraph_varpool_node_name): New function. + (dump_cgraph_varpool_node): New function. + (dump_varpool): New function. + * cgraphunit.c (cgraph_optimize): Dump varpool. + + 2004-10-16 Jan Hubicka + + * cgraph.c (decide_is_variable_needed): New function. + (cgraph_varpool_finalize_decl): Use it. + * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing + unit-at-a-time. + * final.c (output_addr_const): Do not call mark_referenced. + * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; + always go via cgraph. + * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. + (check_global_declarations): Ifdef out code clearing DECL_RTL. + * tree-optimize.c (execute_inline): Mark functions called. + * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. + + 2004-10-11 Jan Hubicka + + * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable + (cgraph_varpool_last_needed_node): New static variable. + (enqueue_needed_varpool_node): Break out from ...; add items to the + end of queue; update first pointers. + (cgraph_varpool_mark_needed_node): ... here. + (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. + (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c + * cgraph.h (cgraph_varpool_node): Add analyzed field. + (cgraph_varpool_first_unanalyzed_node): Declare. + * cgraphunit.c: Include output.h. + (cgraph_varpool_analyze_pending_decls): New function. + (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out + for errors, analyze pending decls. + (cgraph_finalize_compilation_unit): Only analyze decls. + (cgraph_optimize): Assemble the decls after expanding. + +2005-03-30 Daniel Berlin + + * tree-ssa-alias.c (compute_flow_insensitive_aliasing): Make sure + subvars get marked properly in tags for grouping. + (add_pointed_to_var): Mark only actual pointed to + variables/subvars in addresses needed. + (create_overlap_variables_for): Clear call clobbered on original + variable. + * tree-ssa-operands.c (get_asm_expr_operands): Don't let regular + addresable vars with subvars into list. + * tree-ssa.c (verify_ssa_name): Verify original is not used where + subvar should be. + +2005-03-30 Richard Henderson + + * cgraph.h (struct cgraph_node): Add alias. + * varasm.c (assemble_alias): Set it. + * cgraphunit.c (cgraph_assemble_pending_functions): Check it and + avoid calling cgraph_expand_function. + +2005-03-30 Tom Tromey + + * tree.def (FILE_TYPE): Removed. + * typeclass.h (enum type_class): Removed file_type_class. + * dwarf2out.c (is_base_type): Updated. + (gen_type_die): Likewise. + * dbxout.c (dbxout_type): Updated. + * builtins.c (type_to_class): Updated. + * tree.c (type_contains_placeholder_1): Updated. + * config/sparc/sparc.c (sparc_type_code): Updated. + * config/ia64/ia64.c (hfa_element_mode): Updated. + * expr.c (count_type_elements): Updated. + * stor-layout.c (layout_type): Updated. + * tree-inline.c (remap_type): Updated. + * tree-pretty-print.c (dump_generic_node): Updated. + +2005-03-30 Fariborz Jahanian + + * builtins.c (expand_builtin_powi): Fix mode of + 2nd argument to match int. + * libgcc2.h (__powisf2, __powidf2, __powixf2, __powitf2): Change + 2nd argument type to int. + * libgcc2.c: Change prototype of __powi* functions to use + int. + +2005-03-30 Dale Johannesen + + PR middle-end/19225 + * calls.c (expand_call): Flush pending deferrals before + throwing call. + +2005-03-30 Joseph S. Myers + + PR c/772 + PR c/17913 + * c-tree.h (C_DECL_UNJUMPABLE_STMT_EXPR, + C_DECL_UNDEFINABLE_STMT_EXPR, struct c_label_list, struct + c_label_context, label_context_stack): New. + * c-decl.c (define_label): Check for jumps into statement + expressions. Add label to list of defined labels. + (start_function): Push context on label_context_stack. + (finish_function): Pop context from label_context_stack. + * c-typeck.c (label_context_stack): New. + (c_finish_goto_label): Check for jumps into statement + expressions. Add label to list of jumped to labels. + (struct c_switch): Add blocked_stmt_expr. + (c_start_case): Initialize it. + (do_case): Check it. + (c_finish_case): Verify !blocked_stmt_expr. + (c_begin_stmt_expr): Push context on label_context_stack. + Increment blocked_stmt_expr. Mark labels jumped to from outside + as undefinable. + (c_finish_stmt_expr): December blocked_stmt_expr. Mark labels + defined in the statement expression and no longer jumpable to. + Mark labels jumped to from just outside the statement expression + as again definable. Pop context from label_context_stack. + * doc/extend.texi (Statement Exprs): Update. + +2005-03-30 Joseph S. Myers + + PR c/20368 + * c-decl.c (start_function): Check for old_decl being + error_mark_node. + +2005-03-30 Ian Lance Taylor + + * final.c (final): Remove prescan parameter. Change all callers. + (final_scan_insn): Remove prescan parameter. Change all callers. + +2005-03-30 Kazu Hirata + + * tree-vectorizer.c: Fix comment typos. + +2005-03-30 Sebastian Pop + + * tree-scalar-evolution.c (instantiate_parameters_1): Return + as soon as a chrec_dont_know is detected. + +2005-03-31 Danny Smith + + Merge from csl-arm-branch. + 2004-02-12 Mark Mitchell + + * tlink.c (recompile_files): Do not assume that "rename" can + overwrite an existing file. + +2005-03-31 Paolo Bonzini + + * gcc/configure.ac (TL_AC_GNU_MAKE_GCC_LIB_PATH): Remove. + * gcc/configure: Regenerate. + +2005-03-30 Alan Modra + + * doc/install.texi: Update binutils requirement for powerpc*-linux. + + * config/rs6000/rs6000.c (rs6000_arg_partial_bytes): Update comments. + + * calls.c (struct arg_data): Update "partial" comment. + (load_register_parameters): Update "nregs" comment. + +2005-03-30 Richard Sandiford + + * config/iq2000/iq2000.h (target_flags, MASK_GPOPT, MASK_EMBEDDED_DATA) + (MASK_UNINIT_CONST_IN_RODATA, TARGET_EMBEDDED_DATA, TARGET_SWITCHES) + (TARGET_DEFAULT, TARGET_CPU_DEFAULT, SUBTARGET_TARGET_OPTIONS) + (TARGET_OPTIONS, iq2000_cpu_string, iq2000_arch_string): Delete. + (TARGET_DEBUG_MODE, TARGET_DEBUG_A_MODE, TARGET_DEBUG_B_MODE) + (TARGET_DEBUG_C_MODE, TARGET_DEBUG_D_MODE): Define to 0 rather + than target_flags & 0. + * config/iq2000/iq2000.c (iq2000_cpu_string, iq2000_arch_string) + (iq2000_arch, iq2000_parse_cpu): Delete. + (TARGET_HANDLE_OPTION): Override default. + (iq2000_handle_option): New function. + (override_options): Remove -march= and -mcpu= handling. + * config/iq2000/iq2000.opt: New file. + +2005-03-30 Richard Sandiford + + * config/c4x/c4x-protos.h (c4x_rpts_cycles, c4x_cpu_version): Delete. + * config/c4x/c4x.h (SMALL_MEMORY_FLAG, MPYI_FLAG, FAST_FIX_FLAG) + (RPTS_FLAG, C3X_FLAG, TI_FLAG, PARANOID_FLAG, MEMPARM_FLAG, DEVEL_FLAG) + (RPTB_FLAG, BK_FLAG, DB_FLAG, DEBUG_FLAG, HOIST_FLAG) + (LOOP_UNSIGNED_FLAG, FORCE_FLAG, PRESERVE_FLOAT_FLAG) + (PARALLEL_INSN_FLAG, PARALLEL_MPY_FLAG, ALIASES_FLAG, C30_FLAG) + (C31_FLAG, C32_FLAG, C33_FLAG, C40_FLAG, C44_FLAG, TARGET_SWITCHES) + (TARGET_DEFAULT, TARGET_SMALL, TARGET_MPYI, TARGET_FAST_FIX) + (TARGET_RPTS, TARGET_TI, TARGET_PARANOID, TARGET_MEMPARM, TARGET_DEVEL) + (TARGET_RPTB, TARGET_BK, TARGET_DB, TARGET_DEBUG, TARGET_HOIST) + (TARGET_LOOP_UNSIGNED, TARGET_FORCE, TARGET_PRESERVE_FLOAT) + (TARGET_PARALLEL, TARGET_PARALLEL_MPY, TARGET_ALIASES) + (c4x_rpts_cycles_string, c4x_cpu_version_string) + (TARGET_OPTIONS): Delete. + (c4x_rpts_cycles, c4x_cpu_version): Declare. + (TARGET_C3X, TARGET_C30, TARGET_C31, TARGET_C32, TARGET_C33) + (TARGET_C40, TARGET_C44): Redefine in terms of c4x_cpu_version. + * config/c4x/c4x.c (c4x_rpts_cycles_string): Delete. + (c4x_cpu_version_string): Delete. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (c4x_handle_option): New function. Map -m3x and -m4x options to the + equivalent -mcpu= option. + (c4x_override_options): Remove -mrpts= and -mcpu= handling from here. + Deal with the extra conditions in the old TARGET_MPYI, TARGET_RPTB, + TARGET_DB, TARGET_PARALLEL and TARGET_PARALLEL_MPY macros by setting + or clearing the appropriate MASK_* bit. + (c4x_file_start): Use c4x_cpu_version. + * config/c4x/c4x.opt: New file. + +2005-03-30 Richard Sandiford + + * doc/options.texi: Document the new MaskExists flag. + * opth-gen.awk: Don't output MASK and TARGET macros for Mask(...) + if the option has the MaskExists flag. + +2005-03-30 Richard Sandiford + + * opt-functions.awk (flag_set_p, test_flag): New functions. + (switch_flags): Use them. + * opth-gen.awk: Use flag_set_p to check for flags. + * optc-gen.awk: Likewise. Use opt_args to check for Init(...) flags. + +2005-03-30 Ian Lance Taylor + + * config.host (i[34567]86-*-mingw32*): Don't set + host_can_use_collect2 to no. + +2005-03-30 Alan Modra + + PR target/20203 + * builtins.c (get_memory_rtx): Expand address exp using EXPAND_NORMAL. + Remove convert_memory_address call duplicating that in memory_address. + +2005-03-29 Richard Henderson + + PR c/20519 + * c-decl.c (c_finish_incomplete_decl): Update complete_array_type call. + (build_compound_literal): Likewise. Propagate decl type into the + initializer. + (finish_decl): Likewise. Use new return value from complete_array_type + for zero sized arrays. + (complete_array_type): Move ... + * c-common.c (complete_array_type): ... here. Change first argument + to pointer-to-type-node. Consistently use sizetype for the index + except for zero sized arrays. Detect zero sized arrays for pedantic + mode diagnostics. Create a new type node instead of modifying the + old node in place. + * c-tree.h (complete_array_type): Move decl ... + * c-common.h (complete_array_type): ... here. + +2005-03-29 Richard Henderson + + PR tree-opt/19108 + * tree-sra.c (generate_element_init_1): Handle RANGE_EXPR. + +2005-03-29 Kazu Hirata + + * builtin-types.def, c-convert.c, c-format.c, ddg.c, debug.c, + debug.h, et-forest.c, et-forest.h, gcov.c, rtl-profile.c, + rtlhooks-def.h, rtlhooks.c, sdbout.c, tree-inline.h, + tree-profile.c, tsystem.h, value-prof.h: Update copyright. + +2005-03-29 Eric Christopher + + * config/mips/mips.c (mips_gimplify_va_arg_expr): Update for + truthvalue conversion removal. + +2005-03-29 Ian Lance Taylor + + PR bootstrap/14316 + * collect2.c: Never include . + (VFORK_STRING, vfork): Don't define. + (pid): Remove global variable. + (handler): Call raise instead of kill (getpid(), ...). + (collect_wait): Add pex parameter. Change all callers. Use + pex_get_status rather than pwait. + (do_wait): Add pex parameter. Change all callers. + (collect_execute): Return struct pex_obj * rather than void. Use + pex routines rather than pexecute. + (fork_execute): Get pex_obj from collect_execute, and pass it to + do_wait. + (scan_prog_file): Use pex routines rather than pipe/vfork/exec. + Only declare quit_handler if SIGQUIT is defined. + (scan_libraries): Likewise. + * collect2.h (collect_execute): Update declaration. + (collect_wait): Update declaration. + * tlink.c (tlink_execute): Get pex_obj from collect_execute, and + pass it to collect_wait. + +2005-03-29 Joseph S. Myers + + PR c/20672 + * c-parser.c (c_parser_compound_statement_nostart): Give error + message for EOF instead of just setting parser->error. + +2005-03-29 Dorit Naishlos + + * tree-vectorizer.c (slpeel_update_phi_nodes_for_guard): Removed. + (slpeel_update_phi_nodes_for_guard1): New function. + (slpeel_update_phi_nodes_for_guard2): New function. + (slpeel_tree_peel_loop_to_edge): Call above new functions instead + of slpeel_update_phi_nodes_for_guard. + (vectorize_loops): Remove call to loop_closed_rewrite. + * tree-vect-transform.c (vect_update_ivs_after_vectorizer): Remove + assertion. + +2005-03-29 Richard Sandiford + + * config/m32r/little.h (TARGET_ENDIAN_DEFAULT): Delete. + (TARGET_LITTLE_ENDIAN): New macro. + * config/m32r/m32r.h (SUBTARGET_SWITCHES, target_flags) + (TARGET_RELAX_MASK, TARGET_DEBUG_MASK, TARGET_DEBUG) + (TARGET_ALIGN_LOOPS_MASK, TARGET_ALIGN_LOOPS) + (TARGET_LOW_ISSUE_RATE_MASK, TARGET_LOW_ISSUE_RATE) + (TARGET_BRANCH_COST_MASK, TARGET_BRANCH_COST, TARGET_M32RX_MASK) + (TARGET_M32RX, TARGET_M32R2_MASK, TARGET_M32R2, LITTLE_ENDIAN_BIT) + (TARGET_ENDIAN_DEFAULT, SUBTARGET_SWITCHES, TARGET_DEFAULT) + (TARGET_SWITCHES, m32r_model_string, m32r_sdata_string) + (m32r_cache_flush_trap_string, SUBTARGET_OPTIONS) + (TARGET_OPTIONS): Delete. + (M32R_MODEL_DEFAULT, M32R_SDATA_DEFAULT): Turn into enums. + (CACHE_FLUSH_TRAP): Turn into an integer. + (TARGET_LITTLE_ENDIAN): Define to 0 by default. + (INITIALIZE_TRAMPOLINE): Check m32r_cache_trap >= 0 to see if + -mflush-trap is in use. + * config/m32r/m32r.c (m32r_model_string, m32r_sdata_string) + (m32r_cache_flush_trap_string): Delete. + (m32r_model) Initialize to M32R_MODEL_DEFAULT. + (m32r_sdata): Likewise M32R_SDATA_DEFAULT. + (m32r_cache_trap): Likewise CACHE_FLUSH_TRAP. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (m32r_handle_option): New function. Move -mflush-trap=, -mflush-func=, + -mmodel= and -msdata= handling from... + (m32r_init): ...here. + * config/m32r/m32r.opt: New file. + +2005-03-29 Keith Besaw + + * tree-ssanames.c (duplicate_ssa_name_ptr_info): New function. + (duplicate_ssa_name): Call duplicate_ssa_name_ptr_info. + * tree-vect-analyze.c (vect_object_analysis): additional parm + pass back a "struct ptr_info_def *" with the points-to info. + (vect_analyze_data_refs): set the STMT_VINFO_PTR_INFO for the + statement using info returned from vect_object_analysis. + * tree-vect-transform.c (update_vuses_to_preheader): New function. + (vect_create_data_ref_ptr): Remove updates to vars_to_rename + for virtual uses and defs when creating a replacement vector + reference. Call duplicate_ssa_name_ptr_info to define points-to + info for vector pointer replacement using STMT_VINFO_PTR_INFO. + (vectorizable_store): copy_virtual_operands and update + definition statements. + (vectorizable_load): copy_virtual_operands. Remove call to + mark_call_clobbered_vars_to_rename for call to "const" builtin. + * tree-vectorizer.c (vectorize_loops): Remove calls to + rewrite_into_ssa and bitmap_clear (vars_to_rename). + (new_stmt_vec_info): initialize STMT_VINFO_PTR_INFO for stmt. + * tree-vectorizer.h (_stmt_vec_info): add field ptr_info and + define macro STMT_VINFO_PTR_INFO for use in accessing. + * tree.h add export of duplicate_ssa_name_ptr_info. + * rs6000.c (altivec_init_builtins): Declare builtin function + __builtin_altivec_mask_for_load to be "const". + +2005-03-29 Jakub Jelinek + + PR middle-end/20622 + * cgraph.h (struct cgraph_varpool_node): Add alias field. + * cgraph.c (cgraph_varpool_assemble_pending_decls): Don't call + assemble_variable on aliases. + * varasm.c (assemble_alias): Set node->alias. + * toplev.c (wrapup_global_declarations): Don't call + rest_of_decl_compilation on aliases again. + +2005-03-29 Paul Brook + + * config/arm/arm-protos.h (arm_dbx_register_number): Add prototype. + * config/arm/arm.c (arm_dbx_register_number): New function. + * config/arm/arm.h (IS_FPA_REGNUM, DBX_REGISTER_NUMBER): Define. + +2005-03-29 Eric Botcazou + + PR middle-end/20263 + * varasm.c (make_decl_rtl) [ASM_DECLARE_REGISTER_GLOBAL]: Use + the DECL_NAME, not the DECL_ASSEMBLER_NAME. + +2005-03-29 Dale Johannesen + + * Makefile.in (value-prof.o): New dependencies on $(DIAGNOSTIC_H) + $(TREE_H) and $(COVERAGE_H). + * coverage.c (compute_checksum): Use DECL_NAME not DECL_ASSEMBLER_NAME. + * opts.c (common_handle_option): Enable tree-based value transforms. + * toplev.c (process_options): Ditto. + * value-prof.h (struct histogram_value_t): Redefine. "Adjust" below + refers to references to this type. + * tree-flow.h: (struct stmt_ann_d): Add histograms field. + * rtl-profile.c (rtl_gen_interval_profiler): Adjust. Remove checks + for may_be_more, may_be_less. + (rtl_gen_pow2_profiler): Adjust. + (rtl_gen_one_value_profiler_no_edge_manip): Adjust. + (rtl_gen_one_value_profiler): Adjust. + (rtl_gen_const_delta_profiler): Adjust. + * tree-profile.c (tree_gen_interval_profiler): Implement. + (tree_gen_pow2_profiler): Ditto. + (tree_gen_one_value_profiler): Ditto. + (tree_profiling): New. + (pass_tree_profile): Reference it. + * value-prof.c: Include tree-flow.h, tree-flow-inline.h, diagnostic.h, + tree.h, gcov-io.h. + (insn_divmod_values_to_profile): Rename to + rtl_divmod_values_to_profile. Adjust. + (insn_values_to_profile): Rename to rtl_values_to_profile. Adjust. + (insn_prefetch_values_to_profile): Adjust. + (rtl_value_profile_transformations): Adjust. + (gen_divmod_fixed_value): Rename to rtl_divmod_fixed_value. + (gen_mod_pow2): Rename to rtl_mod_pow2. + (gen_mod_subtract): Rename to rtl_mod_subtract. + (divmod_fixed_value_transform): Rename to + rtl_divmod_fixed_value_transform. + (mod_pow2_value_transform): Rename to rtl_mod_pow2_value_transform. + (mod_subtract_transform): Rename to rtl_mod_subtract_transform. + (rtl_find_values_to_profile): Adjust. + (tree_value_profile_transformations): Implement. + (tree_divmod_values_to_profile): New. + (tree_values_to_profile): New. + (tree_divmod_fixed_value): New. + (tree_mod_pow2): New. + (tree_mod_subtract): New. + (tree_divmod_fixed_value_transform): New. + (tree_mod_pow2_value_transform): New. + (tree_mod_subtract_transform): New. + (tree_find_values_to_profile): Implement. + * profile.c (instrument_values): Free histograms. + (compute_value_histograms): Adjust. Implement tree version. + +2005-03-29 Uros Bizjak + + * reg-stack.c (subst_stack_regs_pat): Handle case. + * config/i386/i386.c (output_fix_trunc): Add new round_mode + variable. Output "fldcw" depending on round_mode. + * config/i386/i386.md (UNSPEC_FIST): New. + (fistdi2, fistdi2_with_temp, fist2, fist2_with_temp): + New isns patterns to implement lrint and llrint built-ins as x87 + intrinsic function. + (fistdi2, fist2 splitters): New splitters. + (lrint2): New expanders. + +2005-03-28 Ian Lance Taylor + + * config/arc/arc.c (arc_output_function_epilogue): Pass prescan as + 0 when calling final_scan_insn. + +2005-03-28 Jan Hubicka + + PR middle-end/20635 + * varasm.c (mark_decl_referenced): Do not mark extern inline functions + as needed. + + * tree-inline.c (estimate_num_insns_1): Use declaration to discover argument + types where possible. + +2005-03-26 Per Bothner + + Make -f[no-]show-column also control non-cpp diagnostics. + * c.opt (fshow-column): Move option from here ... + * common.opt (fshow-column): ... to here. + * diagnostic.c (diagnostic_build_prefix): Only print column number + if flag_show_column. + +2005-03-27 Steven Bosscher + + * vax-protos.h (vax_output_int_move, vax_output_int_add, + vax_output_conditional_branch): New prototypes. + * vax.c (vax_output_int_move, vax_output_int_add): New functions, + extracted from vax.md mov and add patterns. + (vax_output_conditional_branch): New function to output conditional + branch instructions. + * vax.md: Use mode macros for arithmetic and mov patterns. + Use code macros for the jump patterns. + +2005-03-26 Andrew Pinski + + * Makefile.in (libbackend.o): Depend on version files; + add custom generation command. + +2005-03-26 Andrew Pinski + + PR target/20636 + * config/rs6000/rs6000.md (extendsfdf2_fpr): Check to make + sure that we have a REG before getting its REGNO. + +2005-03-25 Kaveh R. Ghazi + + * builtin-types.def (BT_FN_STRING_CONST_STRING_SIZE): New. + * builtins.def (BUILT_IN_STRNDUP): New. + +2005-03-25 Pat Haugen + + PR tree-optimization/20470 + * fold-const.c (fold_cond_expr_with_comparison): Recognize/fold + ABS(x-y). + +2005-03-25 Mike Stump + + * config/darwin.h (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Don't allow 0 + sized objects. + +2005-03-25 Geoffrey Keating + + * config/rs6000/darwin-fallback.c: Don't include . + Use our own structure definitions. + + * config/rs6000/rs6000.md (UNSPEC constants): Add UNSPEC_STFIWX. + (fix_truncdfsi2): Allow registers or memory as destination. + When TARGET_PPC_GFXOPT, generate simplified pattern. + (fix_truncdfsi2_internal): Use define_insn_and_split. + (fix_truncdfsi2_internal_gfxopt): New. + (fctiwz): Don't confuse register allocation by giving it no choices. + (stfiwx): New. + * config/rs6000/rs6000.h (EXTRA_CONSTRAINT): Add 'Z'. + (EXTRA_MEMORY_CONSTRAINT): Likewise. + * config/rs6000/rs6000.c (indexed_or_indirect_operand): New. + * config/rs6000/rs6000-protos.h (indexed_or_indirect_operand): New. + +2005-03-25 Kazu Hirata + + * dominance.c (free_dominance_info): Speed up by freeing et + data structures without maintaining other nodes. + * et-forest.c (et_free_tree_force): New. + * et-forest.h: Add a prototype for et_free_tree_force. + + * tree.c (get_set_constructor_bits, + get_set_constructor_bytes): Remove. + * tree.h: Remove the corresponding prototypes. + +2005-03-25 John David Anglin + + PR target/15491 + * vax.c (vax_rtx_costs_1): Merge with vax_rtx_costs. + (vax_rtx_costs): Return false when passed unsupported rtx's. Handle + FLOAT_EXTEND, FLOAT_TRUNCATE and TRUNCATE. Fix costs for POST_INC, + PRE_DEC, NEG and NOT. + +2005-03-25 Kazu Hirata + + * fold-const.c: Convert uses of fold (build (...)) to + fold_buildN. + +2005-03-25 Zdenek Dvorak + + PR rtl-optimization/20249 + * cse.c (insert_regs): Do not record equivalence of registers in + different modes. + +2005-03-24 Kazu Hirata + + * emit-rtl.c (reverse_comparison): Remove. + * rtl.h: Remove the corresponding prototype. + +2005-03-24 James E Wilson + + * doc/install.texi (--enable-altivec): Delete docs. + +2005-03-24 David Edelsohn + + * config/rs6000/predicates.md (easy_fp_constant): Return 0 for + SFmode and DFmode before reload when + flag_unsafe_math_optimizations not enabled. + +2005-03-24 Geoffrey Keating + + * c.opt (fvisibility-inlines-hidden): Allow for ObjC++. + + * config/i386/darwin.h (TARGET_SUBTARGET_DEFAULT): Add + MASK_128BIT_LONG_DOUBLE, MASK_ALIGN_DOUBLE. + +2005-03-24 Nathan Sidwell + + * configure.ac (enable-checking): Add 'runtime' option. + * doc/install.texi (enable-checking): Document 'runtime' checking. + * tsystem.h (gcc_assert, gcc_unreachable): Define. + * config.in: Regenerated. + * configure: Regenerated. + +2005-03-23 Uros Bizjak + + * optabs.h (enum optab_index): Remove OTI_llrint. + (llrint_optab): Remove macro. + * optabs.c (init_optabs): Remove llrint_optab initialization. + * genopinit.c (optabs): Remove llrint_optab implementation. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LLRINT{,F,L} + using lrint_optab. + +2005-03-24 Alexandre Oliva + + PR rtl-optimization/20532 + * simplify-rtx.c (simplify_binary_operation_1): Protect from + overflow when adding coefficients for PLUS or MINUS. + (simplify_binary_operation_1): Handle CONST_DOUBLE exact power of + two as multiplier. + +2005-03-23 Joseph S. Myers + + * langhooks.h (truthvalue_conversion): Remove. + * langhooks-def.h (LANG_HOOKS_INITIALIZER): Remove + LANG_HOOKS_TRUTHVALUE_CONVERSION. + * system.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Poison. + * gimplify.c (gimple_boolify): Don't use truthvalue_conversion. + * c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-23 Kazu Hirata + + * params.def: Fix a typo. + * config/mips/mips.c: Follow the spelling convensions. + * doc/invoke.texi: Fix typos. + +2005-03-23 Daniel Berlin + + Fix PR tree-optimization/20601 + + * tree-ssa-pre.c (insert_aux): Add missing condition to + constification. + +2005-03-23 Ian Lance Taylor + + * final.c (final_scan_insn): Don't remove no-op instructions. + * reload1.c (reload): Remove simple no-op instructions even when + not optimizing. + +2005-03-23 Dorit Naishlos + + PR tree-optimization/20501 + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Debug print + reporting that peeling for alignment is applied moved to... + * (vect_analyze_data_refs_alignment): Here. + +2005-03-23 Ian Lance Taylor + + * reorg.c (dbr_schedule): Remove #if 0 code to call final. + +2005-03-23 Rainer Orth + + * config.gcc (alpha*-dec-osf[45]*): Remove target_cpu_default. + Define TARGET_SUPPORT_ARCH except on Tru64 UNIX V4.0A. + +2005-03-23 Hans-Peter Nilsson + + * doc/tm.texi (TARGET_MD_ASM_CLOBBERS): Adjust wording to not + imply that this is called once, independent of asms in code. + Adjust to now being pased output and input lists. Mention helper + function decl_overlaps_hard_reg_set_p. + * hooks.c (hook_tree_tree_tree_tree_3rd_identity): Rename from + hook_tree_tree_identity and to take three trees, returning third. + * hooks.h (hook_tree_tree_tree_tree_3rd_identity): Adjust the + prototype. + * stmt.c: include hard-reg-set.h before tree.h. + (decl_overlaps_hard_reg_set_p): New function, broken out from... + (decl_conflicts_with_clobbers_p): Call + decl_overlaps_hard_reg_set_p. + (expand_asm_operands): Pass output and input lists in call to + targetm.md_asm_clobbers. + * target-def.h (TARGET_MD_ASM_CLOBBERS): Define as + hook_tree_tree_tree_tree_3rd_identity. + * target.h (struct gcc_target.md_asm_clobbers): Take three tree + parameters. + * tree.h [HARD_CONST] (decl_overlaps_hard_reg_set_p): Prototype. + * config/i386/i386.c (ix86_md_asm_clobbers): Adjust to three + parameters, first two unused. + * config/cris/cris.c (cris_md_asm_clobbers): Adjust to added + parameters. Only add MOF to clobbers if there's no 'h' mentioned + in constraint letters and MOF is not mentioned as a asm-declared + register in neither of the input and output lists. + +2005-03-23 DJ Delorie + + * optabs.c (expand_binop): Make sure the first subword's result + gets stored. + +2005-03-23 Joseph S. Myers + + * c-common.c (c_common_truthvalue_conversion): Adjust comment. + Call c_common_truthvalue_conversion rather than + lang_hooks.truthvalue_conversion. + * c-convert.c (convert): Call c_objc_common_truthvalue_conversion. + * c-objc-common.c (c_objc_common_truthvalue_conversion): Move to + c-typeck.c. + * c-objc-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Change to + c_common_truthvalue_conversion. + * c-parser.c (c_parser_paren_condition, c_parser_for_statement, + c_parser_conditional_expression, c_parser_binary_expression): Call + c_objc_common_truthvalue_conversion. + * c-typeck.c (build_unary_op): Call + c_objc_common_truthvalue_conversion. + (build_conditional_expr): Do not call + lang_hooks.truthvalue_conversion. + (build_binary_op): Call c_common_truthvalue_conversion. + (c_objc_common_truthvalue_conversion): Moved from + c-objc-common.c. Call default_function_array_conversion instead + of default_conversion. + +2005-03-23 Joseph S. Myers + + * c-common.h (default_conversion): Remove. + (perform_integral_promotions): Add. + * c-tree.h (default_conversion): Add. + * c-typeck.c (perform_integral_promotions): New, split out from + default_conversion. + * c-common.c (check_case_value): Use perform_integral_promotions, + not default_conversion. + (c_add_case_label): Don't continue processing case label after + found to be pointer. + +2005-03-23 Mark Mitchell + + * gcc.c (do_spec_1): Do not add a -L path for a directory in + the prefix list if we have already added a multilib directory + based on that path. + (main): Do not add MD_EXEC_PREFIX to the list of directories to + search with -L. + +2005-03-22 Kazu Hirata + + * reload1.c (indirect_symref_ok, reload_obstack): Make them + static. + * reload.h: Remove the prototype for indirect_symref_ok. + + * reload1.c (indirect_symref_ok): Make it global. + * reload.h: Add a prototype for indirect_symref_ok. + +2005-03-22 Kaz Kojima + + * config/sh/sh.md (ashlhi3): Rename to *ashlhi3_n and add a new + ashlhi3 expander. + +2005-03-22 Tobias Schl"uter + + * tree.h (DECL_IGNORED_P, DECL_IN_SYSTEM_HEADER): Clarify comments. + +2005-03-22 Daniel Berlin + + * c-opts.c (c_common_parse_file): Only start/end main source file + if debug hooks says the writer wants it. + * dbxout.c (dbx_debug_hooks): Add start_end_main_source_file + member. + (xcoff_debug_hooks): Ditto. + * debug.c (do_nothing_hooks): Ditto. + * debug.h (gcc_debug_hooks): Ditto. + * dwarf2out.c (dwarf2_debug_hooks): Ditto. + * sdbout.c (sdb_debug_hooks): Ditto. + * vmsdbgout.c (vmsdbg_debug_hooks): Ditto. + +2005-03-22 Mark Mitchell + + * doc/extend.texi: Deprecate C++ min/max operators. + +2005-03-22 Zdenek Dvorak + + * tree-ssa-loop-ivopts.c (determine_iv_cost): Do not try to preserve + artificial original candidates. + +2005-03-22 Richard Guenther + Jan Hubicka + Steven Bosscher + + * cgraphunit.c (cgraph_estimate_size_after_inlining): Compute + call cost based on argument sizes. + (cgraph_mark_inline_edge): Avoid inline unit from shrinking by + inlining. + * params.def: (max-inline-inssn-single): Set to 450. + (max-inline-insns-auto): Set to 90. + (max-inline-insns-recursive): Set to 450 + (max-inline-insns-recursive-auto): Set to 450. + (large-function-insns): Set to 2700. + (inline-call-cost): New parameter. + * tree-inline.c (estimate_move_cost): New function. + (estimate_num_insns_1): Compute move sizes costs by estimate_move_cost + for non-gimple-regs, set cost to 0 for gimple-regs. Compute call size + based on arguments. + * tree-inline.h (estimate_move_cost): Declare. + * invoke.texi: (max-inline-inssn-single): Change default to 450. + (max-inline-insns-auto): Change default to 90. + (max-inline-insns-recursive): Change default to 450 + (max-inline-insns-recursive-auto): Change default to 450. + (large-function-insns): Change default to 2700. + (inline-call-cost): Document new parameter. + +2005-03-22 Richard Sandiford + + * config/i860/i860.h (target_flags, TARGET_XP, TARGET_SWITCHES) + (TARGET_DEFAULT): Delete. + * config/i860/i860.opt: New file. + +2005-03-22 Richard Sandiford + + * config/frv/frv-protos.h (frv_branch_cost_string, frv_branch_cost_int) + (frv_cpu_string, frv_condexec_insns_str, frv_condexec_insns) + (frv_condexec_temps_str, frv_condexec_temps, frv_sched_lookahead_str) + (frv_sched_lookahead): Delete. + * config/frv/frv.h (MASK_DEFAULT_ALLOC_CC): Move to frv.c. + (target_flags, MASK_GPR_32, MASK_FPR_32, MASK_SOFT_FLOAT) + (MASK_ALLOC_CC, MASK_DWORD, MASK_DOUBLE, MASK_MEDIA, MASK_MULADD) + (MASK_LIBPIC, MASK_ACC_4, MASK_PACK, MASK_LONG_CALLS) + (MASK_ALIGN_LABELS, MASK_LINKED_FP, MASK_BIG_TLS, MASK_DEBUG_ARG) + (MASK_DEBUG_ADDR, MASK_DEBUG_STACK, MASK_DEBUG, MASK_DEBUG_LOC) + (MASK_DEBUG_COND_EXEC, MASK_NO_COND_MOVE, MASK_NO_SCC) + (MASK_NO_COND_EXEC, MASK_NO_VLIW_BRANCH, MASK_NO_MULTI_CE) + (MASK_FDPIC, MASK_INLINE_PLT, MASK_GPREL_RO, MASK_DEFAULT) + (TARGET_GPR_32, TARGET_FPR_32, TARGET_SOFT_FLOAT, TARGET_ALLOC_CC) + (TARGET_DWORD, TARGET_DOUBLE, TARGET_MEDIA, TARGET_MULADD) + (TARGET_LIBPIC, TARGET_ACC_4, TARGET_DEBUG_ARG, TARGET_DEBUG_ADDR) + (TARGET_DEBUG_STACK, TARGET_DEBUG, TARGET_DEBUG_LOC) + (TARGET_DEBUG_COND_EXEC, TARGET_NO_COND_MOVE, TARGET_NO_SCC) + (TARGET_NO_COND_EXEC, TARGET_NO_VLIW_BRANCH, TARGET_NO_MULTI_CE) + (TARGET_NO_NESTED_CE, TARGET_FDPIC, TARGET_INLINE_PLT, TARGET_BIG_TLS) + (TARGET_GPREL_RO, TARGET_PACK, TARGET_LONG_CALLS, TARGET_ALIGN_LABELS) + (TARGET_LINKED_FP, TARGET_GPR_64, TARGET_FPR_64, TARGET_HARD_FLOAT) + (TARGET_FIXED_CC, TARGET_COND_MOVE, TARGET_SCC, TARGET_COND_EXEC) + (TARGET_VLIW_BRANCH, TARGET_MULTI_CE, TARGET_NESTED_CE, TARGET_ACC_8) + (TARGET_SWITCHES, TARGET_OPTIONS, DEFAULT_CONDEXEC_TEMPS) + (DEFAULT_BRANCH_COST, DEFAULT_CONDEXEC_INSNS): Delete. + * config/frv/frv.c (frv_branch_cost_string, frv_branch_cost_int) + (frv_cpu_string, frv_condexec_insns_str, frv_condexec_insns) + (frv_condexec_temps_str, frv_condexec_temps, frv_sched_lookahead_str) + (frv_sched_lookahead): Delete. + (MASK_DEFAULT_ALLOC_CC): Moved from frv.h. + (TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults. + (frv_handle_option): New function. Move -mcpu= handling from... + (frv_override_options): ...here. Remove handling of other + TARGET_OPTIONS. + (frv_ifcvt_modify_tests): Check !TARGET_COND_EXEC instead of + TARGET_NO_COND_EXEC and !TARGET_NESTED_CE to TARGET_NO_NESTED_CE. + (frv_ifcvt_modify_multiple_tests): Likewise !TARGET_MULTI_CE + and TARGET_NO_MULTI_CE. + (frv_for_each_packet): Likewise TARGET_NO_VLIW_BRANCH and + !TARGET_VLIW_BRANCH. + * config/frv/frv.opt: New file. + +2005-03-22 Kazu Hirata + + * fold-const.c (fold_ternary): Take decomposed arguments of + CALL_EXPR. + (fold): Update a call to fold_ternary. + + * fold-const.c (fold_build1, fold_build2, fold_build3): New. + * tree.h: Add corresponding prototypes. + +2005-03-22 Jakub Jelinek + + PR target/20561 + * cfglayout.c (reemit_insn_block_notes): Don't put block notes in + between jump table and its label. + * final.c (shorten_branches): Handle notes in between ADDR_VEC + resp. ADDR_DIFF_VEC and the label preceeding it. + (final_scan_insn): Likewise. Ensure ADDR_VEC resp. ADDR_DIFF_VEC + is emitted in the right section. + +2005-03-22 Kazu Hirata + + * fold-const.c (fold_unary, fold_binary): Update comments + about arguments. + +2005-03-22 Hans-Peter Nilsson + + PR rtl-optimization/20527 + * combine.c (can_combine_p) [AUTO_INC_DEC]: When INSN has an + REG_INC note, test that the register also isn't mentioned in PRED + or SUCC. + +2005-03-22 Ben Elliston + + * dwarf2out.c (dwarf_type_encoding_name): Remove unused prototype + and definition. + +2005-03-21 Mike Stump + + * varasm.c (default_assemble_visibility): Remove extra (). + +2005-03-21 Roger Sayle + + PR middle-end/20557 + * bb-reorder.c (duplicate_computed_gotos): Use can_duplicate_block_p + to determine whether a block can be duplicated, rather than test + whether the block contains noncopyable insns ourselves. + +2005-03-21 Kazu Hirata + + * config/i860/i860.h (PREDICATE_CODES): Remove nonexistent + predicates. + +2005-03-21 Richard Sandiford + + * config/ip2k/ip2k.h (target_flags, TARGET_SWITCHES): Delete. + +2005-03-21 Richard Sandiford + + * config/fr30/fr30.h (TARGET_SMALL_MODEL_MASK, TARGET_SMALL_MODEL) + (TARGET_DEFAULT, target_flags, TARGET_SWITCHES): Delete. + * config/fr30/fr30.opt: New file. + +2005-03-18 Daniel Berlin + + Fix PR tree-optimization/20542 + + * tree-flow-inline.h (overlap_subvar): Move to here. + * tree-ssa-operands.c: From here. + * tree-flow.h (overlap_subvar): Declare. + * tree-ssa-alias.c (add_pointed_to_var): Use overlap_subvar here. + * tree-ssa-loop-im.c (is_call_clobbered_ref): Return proper answer + for variables with subvars. + +2005-03-21 Mostafa Hagog + + PR middle-end/20177 + * ddg.c (create_ddg_dependence): Ignore reg-anti dependency. + * modulo-sched.c (const_iteration_count): Return on NULL + pre-header. + (print_node_sched_params): Return on NULL dump_file. + (generate_reg_moves): Handle reg-anti dependencies and disregard + closing branch when generating register moves. + (sms_schedule): Mark the SMSed block dirty. + * passes.c (rest_of_handle_sms): Call update_life_info for all + basic-blocks. + * testsuite/gcc.dg/20050321-1.c: New test. + +2005-03-21 Bob Wilson + + * config/xtensa/lib1funcs.asm (__mulsi3): Use symbolic name for ACCLO. + * config/xtensa/xtensa.md (movsi_internal, movhi_internal, + movqi_internal): Likewise. + +2005-03-21 Bob Wilson + + * config/xtensa/xtensa-protos.h: (xtensa_simm7, xtensa_uimm8, + xtensa_uimm8x2, xtensa_uimm8x4, xtensa_ai4const, xtensa_lsi4x4, + xtensa_b4const): Delete prototypes. + (xtensa_simm8, xtensa_simm8x256, xtensa_simm12b, xtensa_b4constu, + xtensa_mask_immediate, xtensa_mem_offset): Update prototypes. + (xtensa_b4const_or_zero, xtensa_const_ok_for_letter_p, + xtensa_extra_constraint): New prototypes. + (add_operand, arith_operand, nonimmed_operand, mem_operand, + mask_operand, extui_fldsz_operand, sext_operand, sext_fldsz_operand, + lsbitnum_operand, branch_operand, ubranch_operand, call_insn_operand, + move_operand, const_float_1_operand, fpmem_offset_operand, + branch_operator, ubranch_operator, boolean_operator): Delete prototypes. + * config/xtensa/xtensa.c (b4const_or_zero): Rename to ... + (xtensa_b4const_or_zero): ...this. Change return type to bool and + argument type to HOST_WIDE_INT. + (xtensa_simm8, xtensa_simm8x256, xtensa_simm12b, + xtensa_mask_immediate): Likewise. + (xtensa_uimm8, xtensa_uimm8x2, xtensa_uimm8x4, xtensa_b4const): + Likewise. Also make these functions static. + (xtensa_simm7, xtensa_ai4const, xtensa_lsi4x4): Delete. + (xtensa_const_ok_for_letter_p): New. + (add_operand, arith_operand, nonimmed_operand, mem_operand, + mask_operand, extui_fldsz_operand, sext_operand, sext_fldsz_operand, + lsbitnum_operand, branch_operand, ubranch_operand, call_insn_operand, + move_operand, const_float_1_operand, fpmem_offset_operand, + branch_operator, ubranch_operator, boolean_operator): Move to + predicates.md. + (smalloffset_mem_p): Inline code from xtensa_lsi4x4. + (xtensa_mem_offset): Change return type to bool. + (xtensa_extra_constraint): New. + (gen_int_relational): Update type of const_range_p function pointer. + Use xtensa_b4const_or_zero. + * config/xtensa/xtensa.h (CONST_OK_FOR_LETTER_P): Define to + xtensa_const_ok_for_letter_p. Update comments. + (EXTRA_CONSTRAINT): Define to xtensa_extra_constraint. + (PREDICATE_CODES): Delete. + * config/xtensa/xtensa.md: Include predicates.md. + * config/xtensa/predicates.md: New file. + +2005-03-21 Kazu Hirata + + * config/v850/v850-protos.h: Remove the prototypes for + reg_or_int9_operand, reg_or_const_operand, + pattern_is_ok_for_prepare, pattern_is_ok_for_dispose, + reg_or_0_operand, reg_or_int5_operand, call_address_operand, + movsi_source_operand, power_of_two_operand, + not_power_of_two_operand, special_symbolref_operand, + pattern_is_ok_for_prologue, pattern_is_ok_for_epilogue, and + register_is_ok_for_epilogue. + * config/v850/v850.c (reg_or_0_operand, reg_or_int5_operand, + reg_or_int9_operand, reg_or_const_operand, + call_address_operand, special_symbolref_operand, + movsi_source_operand, power_of_two_operand, + not_power_of_two_operand, register_is_ok_for_epilogue, + pattern_is_ok_for_epilogue, pattern_is_ok_for_prologue, + pattern_is_ok_for_dispose, pattern_is_ok_for_prepare): Move to + predicates.md. + * config/v850/v850.h (PREDICATE_CODES): Remove. + * config/v850/v850.md: Include predicates.md. + * config/v850/predicates.md: New. + +2005-03-21 Zack Weinberg + + * Makefile.in (BASEVER, DEVPHASE, DATESTAMP) + (BASEVER_c, DEVPHASE_c, DATESTAMP_c) + (BASEVER_s, DEVPHASE_s, DATESTAMP_s, version): Set with :=. + (itoolsdir, itoolsdatadir): Move definition above new first use. + (install-itoolsdirs): New rule. + (install-mkheaders): Depend on install-itoolsdirs, not + install-include-dir. + +2005-03-21 Kazu Hirata + + * tree-into-ssa.c: Remove obsolete comments. + +2005-03-21 Richard Guenther + + * tree-ssa-loop.c (gate_tree_complete_unroll): Run complete + unrolling if -fpeel-loops is specified, too. + * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely): + Remove superfluous check for flag_unroll_loops. + +2005-03-21 Uros Bizjak + + * optabs.h (enum optab_index): Add new OTI_lrint and OTI_llrint. + (lrint_optab, llrint_optab): Define corresponding macros. + * optabs.c (init_optabs): Initialize lrint_optab and llrint_optab. + * genopinit.c (optabs): Implement lrint_optab using lrintsi2 + pattern and llrint_optab using llrintdi2 patterns. + * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LRINT{,F,L} + using lrint_optab and BUILT_IN_LLRINT{,F,L} using llrint_optab. + (expand_builtin): Expand BUILT_IN_LRINT{,F,L} and + BUILT_IN_LLRINT{,F,L} using expand_builtin_mathfn if + flag_unsafe_math_optimizations is set. + +2005-03-21 Paolo Bonzini + + * combine.c (combine_simplify_rtx, simplify_if_then_else, + simplify_logical, if_then_else_cond, known_cond, + simplify_comparison): Adjust calls to reverse_comparison. + Don't use combine_reversed_comparison_code). + (combine_reversed_comparison_code): Remove. + (reversed_comparison): Using reversed_comparison_code, move it... + * jump.c (reversed_comparison): ... here. + * rtl.h (reversed_comparison): Add prototype. + +2005-03-21 Kazu Hirata + + * builtins.c (fold_builtin): Take decomposed arguments of + CALL_EXPR. + * fold-const.c (fold_ternary): Update a call to fold_builtin. + * gimplify.c (gimplify_call_expr): Likewise. + * tree-ssa-ccp.c (ccp_fold, ccp_fold_builtin): Likewise. + * tree.h: Update the prototype of fold_builtin. + +2005-03-21 Paolo Bonzini + + * rtl.h (struct rtx_hooks): Add gen_lowpart_no_emit. + * rtlhooks.c (gen_lowpart_no_emit_general): New. + * rtlhooks-def.h (gen_lowpart_no_emit_general): Declare. + (RTL_HOOKS_GEN_LOWPART_NO_EMIT): New. + * simplify-rtx.c (simplify_binary_operation_1): Use it. + +2005-03-21 Kazu Hirata + + * builtins.c (fold_builtin_1): Take decomposed arguments of + CALL_EXPR. + (fold_builtin): Update a call to fold_builtin_1. + +2005-03-21 Nathan Sidwell + + PR other/20564 + * gcov.c (output_lines): Only output function block summary when + outputting branch information. + * doc/gcov.texi: Document format of preamble and additional block + information lines. + +2005-03-21 Richard Sandiford + + * libgcc2.h (LIBGCC2_HAS_SF_MODE): New macro. + (LIBGCC2_HAS_DF_MODE, LIBGCC2_HAS_TF_MODE, LIBGCC2_HAS_XF_MODE): Make + the defaults false if BITS_PER_UNIT != 8. + (SFtype, SCtype, __fixsfdi, __floatdisf, __fixunssfSI, __fixunssfDI) + (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE rather + than BITS_PER_UNIT != 8. + (L_fixdfdi, L_fixsfdi, L_fixtfdi, L_fixunsdfdi, L_fixunsdfsi) + (L_fixunssfdi, L_fixunssfsi, L_fixunstfdi, L_fixunsxfdi, L_fixunsxfsi) + (L_fixxfdi, L_floatdidf, L_floatdisf, L_floatditf, L_floatdixf): Remove + #undefs. + * libgcc2.c (__fixunssfDI, __fixsfdi, __floatdisf, __fixunssfSI) + (__powisf2, __divsc3, __mulsc3): Guard with LIBGCC2_HAS_SF_MODE. + +2005-03-20 Roger Sayle + + PR middle-end/20539 + * fold-const.c (fold_binary): Fix type mismatch between + TRUTH_{AND,OR,XOR}_EXPR nodes an their operands' types. + (fold_binary) : Avoid calling invert_truthvalue + for non-truth-valued expressions. + + * c-common.c (c_common_truthvalue_conversion): Handle ERROR_MARK + and FUNCTION_DECL in the main switch. + : When changing the result type of these tree nodes, + we also need to convert their operands to match. + : Likewise. + +2005-03-21 Joseph S. Myers + + * c-common.c (lvalue_or_else): Replace by lvalue_error; only give + diagnostic without checking whether an lvalue. + * c-common.h (lvalue_p): Remove. + (enum lvalue_use): Update comment. + (lvalue_or_else): Replace by lvalue_error. + * c-typeck.c (lvalue_p): Make static. + (lvalue_or_else): New. Call lvalue_error. + +2005-03-21 Alan Modra + + * config/rs6000/rs6000.c (rs6000_parm_start): New function. + (function_arg_advance): Use rs6000_parm_start. + (function_arg, rs6000_arg_partial_bytes): Likewise. + +2005-03-20 Joseph S. Myers + + * c-common.c (check_case_value): Adjust comment about stripping + NOPs. + (handle_vector_size_attribute): Don't strip NON_LVALUE_EXPR. + * c-typeck.c (default_conversion, convert_arguments, + build_modify_expr, convert_for_assignment, store_init_value, + digest_init): Use STRIP_TYPE_NOPS instead of stripping nops + manually. Remove inaccurate comments. + +2005-03-20 Roger Sayle + Joseph S. Myers + + * varasm.c (do_assemble_alias): Restore comment describing function. + Annotate the target parameter as potentially unused. + +2005-03-20 Marek Michalkiewicz + + PR target/18551 + * config/avr/avr.c (avr_output_function_prologue): Do not use + current_function_name() in a label, use a local label instead. + +2005-03-20 David Edelsohn + + * config/rs6000/rs6000.c (rs6000_generate_compare): Test + flag_finite_math_only, not flag_unsafe_math_optimizations. + +2005-03-20 Kazu Hirata + + * builtins.c (fold_builtin_1): Update a call to + targetm.fold_builtin. + * hooks.c (hook_tree_tree_bool_null): Rename to + hook_tree_tree_tree_bool_null. Take one more argument of type + tree. + * hooks.h: Update the prototype of hook_tree_tree_bool_null. + * target-def.h (TARGET_FOLD_BUILTIN): Define it as + hook_tree_tree_tree_bool_null. + * target.h (gcc_target): Update the prototype of fold_builtin. + * config/alpha/alpha.c (alpha_fold_builtin): Take decomposed + arguments of CALL_EXPR. + * doc/tm.texi (TARGET_FOLD_BUILTIN): Update. Mention the + new prototype. + +2005-03-20 Jan Hubicka + + * cgraph.h (cgraph_node): Add prev_clone pointer. + * cgraph.c (cgraph_remove_node): Remove from doubly linked chain. + (cgraph_clone_node): Produce doubly linked chain. + +2005-03-20 Joseph S. Myers + + * c-common.c (handle_aligned_attribute, check_function_sentinel, + get_nonnull_operand, handle_sentinel_attribute, + check_function_arguments_recurse): Do not strip NOPS from + INTEGER_CSTs. + * c-decl.c (check_bitfield_type_and_width, build_enumerator): + Likewise. + * c-format.c (get_constant): Likewise. + * c-parser.c (c_parser_postfix_expression): Likewise. + * c-typeck.c (set_init_index): Likewise. + (convert_arguments): Don't check for NOP_EXPR containing integer + constant. + +2005-03-20 Kazu Hirata + + * builtins.c (fold_fixed_mathfn, fold_builtin_trunc, + fold_builtin_floor, fold_builtin_ceil, fold_builtin_lround): + Take decomposed arguments of CALL_EXPR. + (fold_builtin_1): Update calls to the functions mentioned + above. + +2005-03-20 Joseph S. Myers + + * c-decl.c (check_bitfield_type_and_width): Require bit-field + width to have integer type. + (build_enumerator): Require enumerator value to have integer type. + +2005-03-19 Joseph S. Myers + + * doc/extend.texi (__builtin_inf): Move statement about INFINITY + to __builtin_inff. + +2005-03-19 Joseph S. Myers + + * c.opt (ansi, std=iso9899:1990, std=iso9899:1999, + std=iso9899:199x): Correct descriptions. + +2005-03-19 Joseph S. Myers + + * config.gcc: Consistently use solaris2.1[0-9]* instead of + solaris2.1[0-9]. + +2005-03-19 Kazu Hirata + + * builtins.c (fold_builtin_memcpy): Take decomposed arguments + of CALL_EXPR. + (expand_builtin_memcpy, fold_builtin_1): Update calls to + fold_builtin_memcpy. + + * builtins.c (fold_trunc_transparent_mathfn): Take decomposed + arguments of CALL_EXPR. + (fold_builtin_trunc, fold_builtin_floor, fold_builtin_ceil, + fold_builtin_found, fold_builtin_1): Update calls to + fold_trunc_transparent_mathfn. + +2005-03-19 John David Anglin + + PR middle-end/20493 + * fold-const.c (fold_widened_comparison): Don't optimize casts of + function pointers on targets that require function pointer + canonicalization. + (fold_sign_changed_comparison): Likewise. + +2005-03-19 Bernd Schmidt + + * combine.c (try_combine): When changing the mode of a hard reg, make + sure that doing so is valid. + +2005-03-19 Richard Sandiford + + * config/avr/avr.c (avr_init_stack, avr_mcu_name): Make static. + (TARGET_HANDLE_OPTION): Override default. + (avr_handle_option): New function. + * config/avr/avr.h (MASK_ALL_DEBUG, MASK_ORDER_1, MASK_INSN_SIZE_DUMP) + (MASK_ORDER_2, MASK_NO_TABLEJUMP, MASK_INT8, MASK_NO_INTERRUPTS) + (MASK_CALL_PROLOGUES, MASK_TINY_STACK, MASK_SHORT_CALLS) + (TARGET_ORDER_1, TARGET_ORDER_2, TARGET_INT8, TARGET_NO_INTERRUPTS) + (TARGET_INSN_SIZE_DUMP, TARGET_CALL_PROLOGUES, TARGET_TINY_STACK) + (TARGET_NO_TABLEJUMP, TARGET_SHORT_CALLS, TARGET_ALL_DEBUG) + (TARGET_SWITCHES, avr_init_stack, avr_mcu_name) + (TARGET_OPTIONS): Delete. + * config/avr/avr.opt: New file. + +2005-03-18 2005-03-18 Kazu Hirata + + * config/m32r/m32r-protos.h: Remove the prototypes for + call_address_operand, symbolic_operand, seth_add3_operand, + cmp_int16_operand, uint16_operand, reg_or_int16_operand, + reg_or_uint16_operand, reg_or_cmp_int16_operand, + two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + large_insn_p, conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand, extend_operand, + reg_or_eq_int16_operand, int8_operand, and + reg_or_zero_operand. + * config/m32r/m32r.c (call_address_operand, symbolic_operand, + seth_add3_operand, int8_operand, cmp_int16_operand, + uint16_operand, reg_or_int16_operand, reg_or_uint16_operand, + reg_or_eq_int16_operand, reg_or_cmp_int16_operand, + reg_or_zero_operand, two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + extend_operand, small_insn_p, large_insn_p, + conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand): Move to predicates.md. + (MAX_MOVE_BYTES): Move to m32r.h. + * config/m32r/m32r.h (PREDICATE_CODES): Remove. + * config/m32r/m32r.md: Include predicates.md. + * config/m32r/predicates.md: New. + +2005-03-18 James E Wilson + + PR c++/19769 + * dwarf2out.c (declare_in_namespace): Ignore decls with an abstract + origin. + +2005-03-18 Kazu Hirata + + * config/mn10300/mn10300-protos.h: Remove the prototypes for + call_address_operand, const_8bit_operand. + * config/mn10300/mn10300.c (call_address_operand, + const_8bit_operand, const_1f_operand): Move to predicates.md. + * config/mn10300/mn10300.h (PREDICATE_CODES): Remove. + * config/mn10300/mn10300.md: Include predicates.md. + * config/mn10300/predicates.md: New. + +2005-03-18 Joseph S. Myers + + * c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for + declarations in diagnostics and %E for identifiers, not %s. + +2005-03-18 Jan Hubicka + Dale Johannesen + + * basic-block.h (scale_bbs_frequencies_int, + scale_bbs_frequencies_gcov_type): Declare. + * cfg.c (RDIV): New macro. + (update_bb_frequency_for_threading): Fix. + * basic-block.h (scale_bbs_frequencies_int, + scale_bbs_frequencies_gcov_type): New. + * cfgloopmanip.c (scale_bbs_frequencies): Kill. + (scale_loop_frequencies, duplicate_loop_to_header_edge): Use + scale_bbs_frequencies_int. + * tree-ssa-loop-ch.c (copy_loop_headers): Fix profiling info. + +2005-03-18 Kazu Hirata + + * config/m32r/m32r-protos.h: Remove the prototypes for + call_address_operand, symbolic_operand, seth_add3_operand, + cmp_int16_operand, uint16_operand, reg_or_int16_operand, + reg_or_uint16_operand, reg_or_cmp_int16_operand, + two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + large_insn_p, conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand, extend_operand, + reg_or_eq_int16_operand, int8_operand, and + reg_or_zero_operand. + * config/m32r/m32r.c (call_address_operand, symbolic_operand, + seth_add3_operand, int8_operand, cmp_int16_operand, + uint16_operand, reg_or_int16_operand, reg_or_uint16_operand, + reg_or_eq_int16_operand, reg_or_cmp_int16_operand, + reg_or_zero_operand, two_insn_const_operand, move_src_operand, + move_double_src_operand, move_dest_operand, + eqne_comparison_operator, signed_comparison_operator, + extend_operand, small_insn_p, large_insn_p, + conditional_move_operand, carry_compare_operand, + m32r_block_immediate_operand): Move to predicates.md. + (MAX_MOVE_BYTES): Move to m32r.h. + * config/m32r/m32r.h (PREDICATE_CODES): Remove. + * config/m32r/m32r.md: Include predicates.md. + * config/m32r/predicates.md: New. + + * config/pa/pa-protos.h: Add prototypes for magic_milli and + shadd_constant_p. + * config/pa/pa.c (reg_or_0_operand, call_operand_address, + symbolic_operand, symbolic_memory_operand, + reg_or_0_or_nonsymb_mem_operand, reg_before_reload_operand, + indexed_memory_operand, move_dest_operand, move_src_operand, + prefetch_cc_operand, prefetch_nocc_operand, + reg_or_cint_move_operand, pic_label_operand, fp_reg_operand, + arith_operand, arith11_operand, pre_cint_operand, + post_cint_operan, arith_double_operand, ireg_or_int5_operand, + ireg_operand, int5_operand, uint5_operand, int11_operand, + uint32_operand, arith5_operand, and_operand, ior_operand, + lhs_lshift_operand, lhs_lshift_cint_operand, arith32_operand, + pc_or_label_operand, div_operand, plus_xor_ior_operator, + shadd_operand, movb_comparison_operator, + cmpib_comparison_operator): Move to predicates.md. + (magic_milli, shadd_constant_p): Make it extern. + * config/pa/pa.h (PREDICATE_CODES): Remove. + * config/pa/pa.md: Include predicates.md. + * config/pa/predicates.md: New. + + * config/v850/v850.h (PREDICATE_CODES): Remove a nonexistent + predicate. + +2005-03-18 Kazu Hirata + + * hooks.c, hooks.h, intl.c, opts.h, prefix.c, tree-gimple.c, + config/alpha/ev4.md, config/alpha/ev5.md, config/alpha/ev6.md, + config/alpha/freebsd.h, config/alpha/linux.h, + config/alpha/netbsd.h, config/alpha/osf5.h, + config/alpha/vms.h, config/arc/arc.c, config/arc/arc.h, + config/h8300/h8300-protos.h, config/h8300/h8300.c, + config/h8300/h8300.h, config/ia64/unwind-ia64.c, + doc/cppopts.texi: Update copyright. + +2005-03-18 Jan Hubicka + + PR middle-end/20225 + * cgraph.c (cgraph_mark_reachable_node): Assert that it is not called + too late. + * varasm.c (find_decl_and_mark_needed): Mark needed only when not + called too late. + +2005-03-18 Kazu Hirata + + * tree-into-ssa.c (find_idf): Use VEC_quick_push instead of + VEC_safe_push. + +2005-03-18 Paolo Bonzini + + * combine.c (gen_binary): Remove. + (known_cond, simplify_shift_const, find_split_point, + combine_simplify_rtx, simplify_if_then_else, simplify_set, + simplify_logical, expand_field_assignment, extract_left_shift, + force_to_mode, if_then_else_cond, apply_distributive_law, + simplify_and_const_int, simplify_shift_const, gen_lowpart_for_combine, + simplify_comparison, reversed_comparison): Replace with + simplify_gen_binary, simplify_gen_relational or + distribute_and_simplify_rtx. + (distribute_and_simplify_rtx): New function. + 2005-03-18 Alexey Neyman Paolo Bonzini @@ -8,7 +10431,7 @@ * tree-cfg.c (fold_cond_expr_cond): Use boolean types for condition. - * cgraph.c (cgraph_remove_node): Avoid loop in code deciding whether + * cgraph.c (cgraph_remove_node): Avoid loop in code deciding whether function body should be released; do not proactively release function bodies in non-unit-at-a-time mode. @@ -37,7 +10460,7 @@ 2005-03-17 Dorit Naishlos PR tree-optimization/20474 - * tree-vect-analyze.c (vect_analyze_pointer_ref_access): Check the + * tree-vect-analyze.c (vect_analyze_pointer_ref_access): Check the size_type of the relevant pointer. Check for COMPLETE_TYPE_P. 2005-03-17 Kazu Hirata @@ -90,12 +10513,12 @@ (ia64_override_options): Move options parsing ... (ia64_handle_option): ... here. New. * config/ia64/ia64.h (target_flags, MASK_BIG_ENDIAN, MASK_GNU_AS, - MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, + MASK_GNU_LD, MASK_NO_PIC, MASK_VOL_ASM_STOP, MASK_ILP32, MASK_REG_NAMES, MASK_NO_SDATA, MASK_CONST_GP, MASK_AUTO_PIC, MASK_INLINE_FLOAT_DIV_LAT, MASK_INLINE_FLOAT_DIV_THR, MASK_INLINE_INT_DIV_LAT, MASK_INLINE_INT_DIV_THR, - MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, - MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, + MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR, MASK_DWARF2_ASM, + MASK_EARLY_STOP_BITS, TARGET_BIG_ENDIAN, TARGET_GNU_AS, TARGET_GNU_LD, TARGET_NO_PIC, TARGET_VOL_ASM_STOP, TARGET_ILP32, TARGET_REG_NAMES, TARGET_NO_SDATA, TARGET_CONST_GP, TARGET_AUTO_PIC, TARGET_INLINE_FLOAT_DIV_LAT, TARGET_INLINE_FLOAT_DIV_THR, @@ -167,7 +10590,7 @@ * config/alpha/alpha.opt: New file. * config/alpha/alpha.c (alpha_tune): New. Rename all existing uses of alpha_cpu. - (alpha_cpu_string, alpha_tune_string, alpha_tp_string, + (alpha_cpu_string, alpha_tune_string, alpha_tp_string, alpha_fprm_string, alpha_fptm_string): Make static. (alpha_tls_size_string): Remove. (alpha_handle_option): New. @@ -176,7 +10599,7 @@ (TARGET_DEFAULT_TARGET_FLAGS): New. (TARGET_HANDLE_OPTION): New. * config/alpha/alpha.h (alpha_tune): Declare. - (MASK_FP, MASK_FPREGS, TARGET_FPREGS, MASK_GAS, TARGET_GAS, + (MASK_FP, MASK_FPREGS, TARGET_FPREGS, MASK_GAS, TARGET_GAS, MASK_IEEE_CONFORMANT, TARGET_IEEE_CONFORMANT, MASK_IEEE, TARGET_IEEE, MASK_IEEE_WITH_INEXACT, TARGET_IEEE_WITH_INEXACT, MASK_BUILD_CONSTANTS, TARGET_BUILD_CONSTANTS, MASK_FLOAT_VAX, TARGET_FLOAT_VAX, MASK_BWX, @@ -215,7 +10638,7 @@ * tree-vectorizer.c (new_vec_stmt_info): Initialize STMT_VINFO_SUBVARS to NULL. * tree-vect-analyze.c (vect_analyze_data_refs): Ditto. - + 2005-03-16 Dale Johannesen * rtlanal.c (find_first_parameter_load): Rewrite to @@ -248,7 +10671,7 @@ (process_pending_assemble_output_defs): Remove. 2005-03-16 Daniel Berlin - + Fix PR tree-optimization/20489 * tree-ssa-alias.c (push_fields_onto_fieldstack): DTRT @@ -257,7 +10680,7 @@ 2005-03-16 Daniel Berlin Fix PR tree-optimization/20490 - + * tree-ssa-pre.c (create_expression_by_pieces): Use force_gimple_operand on result of fold. @@ -281,10 +10704,10 @@ fold_builtin_strncpy. 2005-03-16 Steven Bosscher - Dorit Naishlos + Dorit Naishlos - * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Copy - UNITS_PER_SIMD_WORD to a local variable to avoid a "division by zero" + * tree-vect-analyze.c (vect_enhance_data_refs_alignment): Copy + UNITS_PER_SIMD_WORD to a local variable to avoid a "division by zero" error. 2005-03-16 Steven Bosscher @@ -2496,7 +12919,7 @@ not including (reg). Do not check for reg being CRIS_PC_REGNUM. (EXTRA_MEMORY_CONSTRAINT): Define as 'Q'. * config/cris/cris.md: Tweak comments referring to Q. - ("cmpsi", "cmphi", "cmpqi", "*movsi_internal", "movhi") + ("cmpsi", "cmphi", "cmpqi", "*movsi_internal", "movhi") ("movstricthi", "movqi", "movstrictqi", "movsf", "addsi3") ("addhi3", "addqi3", "subsi3", "subhi3", "subqi3") ("*expanded_andsi", "*expanded_andhi", "*andhi_lowpart", "andqi3") @@ -7668,5 +18091,3 @@ * tree-cfg.c (remove_useless_stmts_warn_notreached): Only warn if the source line is greater than 0. (remove_bb): Likewise. - -See ChangeLog.12 for earlier changes. diff --git a/gcc/DATESTAMP b/gcc/DATESTAMP index 62c253f311e..dbecfd42d81 100644 --- a/gcc/DATESTAMP +++ b/gcc/DATESTAMP @@ -1 +1 @@ -20050318 +20050520 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index a0dae225162..b53e593446c 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -521,7 +521,9 @@ 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@ +LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) \ + $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) \ + -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@ # Additional options to use when compiling libgcc2.a. # Some targets override this to -isystem include @@ -685,24 +687,24 @@ GTM_H = tm.h $(tm_file_list) TM_H = $(GTM_H) insn-constants.h insn-flags.h # Variables for version information. -BASEVER = $(srcdir)/BASE-VER # 4.x.y -DEVPHASE = $(srcdir)/DEV-PHASE # experimental, prerelease, "" -DATESTAMP = $(srcdir)/DATESTAMP # YYYYMMDD or empty +BASEVER := $(srcdir)/BASE-VER # 4.x.y +DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, "" +DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty -BASEVER_c = $(shell cat $(BASEVER)) -DEVPHASE_c = $(shell cat $(DEVPHASE)) -DATESTAMP_c = $(shell cat $(DATESTAMP)) +BASEVER_c := $(shell cat $(BASEVER)) +DEVPHASE_c := $(shell cat $(DEVPHASE)) +DATESTAMP_c := $(shell cat $(DATESTAMP)) -version = $(BASEVER_c) +version := $(BASEVER_c) # For use in version.c - double quoted strings, with appropriate # surrounding punctuation and spaces, and with the datestamp and # development phase collapsed to the empty string in release mode # (i.e. if DEVPHASE_c is empty). The space immediately after the # comma in the $(if ...) constructs is significant - do not remove it. -BASEVER_s = "\"$(BASEVER_c)\"" -DEVPHASE_s = "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" -DATESTAMP_s = "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" +BASEVER_s := "\"$(BASEVER_c)\"" +DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" +DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" # Shorthand variables for dependency lists. TARGET_H = $(TM_H) target.h insn-modes.h @@ -719,7 +721,8 @@ TREE_H = tree.h tree.def $(MACHMODE_H) tree-check.h builtins.def \ input.h statistics.h vec.h BASIC_BLOCK_H = basic-block.h bitmap.h sbitmap.h varray.h $(PARTITION_H) \ hard-reg-set.h cfghooks.h $(OBSTACK_H) -COVERAGE_H = coverage.h gcov-io.h gcov-iov.h +GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h +COVERAGE_H = coverage.h $(GCOV_IO_H) DEMANGLE_H = $(srcdir)/../include/demangle.h RECOG_H = recog.h ALIAS_H = alias.h @@ -727,7 +730,7 @@ EMIT_RTL_H = emit-rtl.h FLAGS_H = flags.h options.h EXPR_H = expr.h insn-config.h function.h $(RTL_H) $(FLAGS_H) $(TREE_H) $(MACHMODE_H) $(EMIT_RTL_H) OPTABS_H = optabs.h insn-codes.h -REGS_H = regs.h varray.h $(MACHMODE_H) $(OBSTACK_H) $(BASIC_BLOCK_H) +REGS_H = regs.h varray.h $(MACHMODE_H) $(OBSTACK_H) $(BASIC_BLOCK_H) $(FUNCTION_H) RESOURCE_H = resource.h hard-reg-set.h SCHED_INT_H = sched-int.h $(INSN_ATTR_H) $(BASIC_BLOCK_H) $(RTL_H) INTEGRATE_H = integrate.h varray.h @@ -740,7 +743,7 @@ GCC_H = gcc.h version.h GGC_H = ggc.h gtype-desc.h TIMEVAR_H = timevar.h timevar.def INSN_ATTR_H = insn-attr.h $(srcdir)/insn-addr.h $(srcdir)/varray.h -C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) +C_COMMON_H = c-common.h $(SPLAY_TREE_H) $(CPPLIB_H) $(GGC_H) C_PRAGMA_H = c-pragma.h $(CPPLIB_H) C_TREE_H = c-tree.h $(C_COMMON_H) SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h @@ -762,6 +765,7 @@ C_PRETTY_PRINT_H = c-pretty-print.h $(PRETTY_PRINT_H) $(C_COMMON_H) $(TREE_H) SCEV_H = tree-scalar-evolution.h $(GGC_H) tree-chrec.h LAMBDA_H = lambda.h tree.h vec.h $(GGC_H) TREE_DATA_REF_H = tree-data-ref.h $(LAMBDA_H) +VARRAY_H = varray.h $(MACHMODE_H) $(SYSTEM_H) coretypes.h $(TM_H) # # Now figure out from those variables how to compile and link. @@ -922,7 +926,7 @@ 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 \ gimplify.o tree-pretty-print.o tree-into-ssa.o \ - tree-outof-ssa.o tree-ssa-ccp.o tree-vn.o \ + tree-outof-ssa.o tree-ssa-ccp.o tree-vn.o tree-ssa-uncprop.o \ tree-ssa-dce.o tree-ssa-copy.o tree-nrv.o tree-ssa-copyrename.o \ tree-ssa-pre.o tree-ssa-live.o tree-ssa-operands.o tree-ssa-alias.o \ tree-ssa-phiopt.o tree-ssa-forwprop.o tree-nested.o tree-ssa-dse.o \ @@ -930,7 +934,7 @@ OBJS-common = \ tree-phinodes.o tree-ssanames.o tree-sra.o tree-complex.o tree-ssa-loop.o \ tree-ssa-loop-niter.o tree-ssa-loop-manip.o tree-ssa-threadupdate.o \ tree-vectorizer.o tree-vect-analyze.o tree-vect-transform.o \ - tree-ssa-loop-ivcanon.o tree-ssa-propagate.o \ + tree-ssa-loop-ivcanon.o tree-ssa-propagate.o tree-ssa-math-opts.o \ tree-ssa-loop-ivopts.o tree-if-conv.o tree-ssa-loop-unswitch.o \ alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \ cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \ @@ -956,11 +960,12 @@ OBJS-common = \ varasm.o varray.o vec.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \ 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 tree-ssa-sink.o + lambda-trans.o lambda-code.o tree-loop-linear.o tree-ssa-sink.o \ + tree-vrp.o tree-stdarg.o OBJS-md = $(out_object_file) OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o \ - cgraph.o cgraphunit.o tree-nomudflap.o + cgraph.o cgraphunit.o tree-nomudflap.o ipa.o ipa-inline.o OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive) @@ -978,12 +983,12 @@ STAGECOPYSTUFF = insn-flags.h insn-config.h insn-codes.h \ # Files to be moved away after each stage in building. STAGEMOVESTUFF = *$(objext) s-* \ - xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \ + xgcc$(exeext) cpp$(exeext) cc1$(exeext) cc1*-dummy$(exeext) $(EXTRA_PASSES) \ $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \ protoize$(exeext) unprotoize$(exeext) \ $(SPECS) collect2$(exeext) \ gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \ - *.[0-9][0-9].* *.[si] libbackend.a libgcc.mk \ + *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk \ $(LANG_STAGESTUFF) # Defined in libgcc2.c, included only in the static library. @@ -992,7 +997,8 @@ LIB2FUNCS_ST = _eprintf __gcc_bcmp # Defined in libgcov.c, included only in gcov library LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ _gcov_fork _gcov_execl _gcov_execlp _gcov_execle \ - _gcov_execv _gcov_execvp _gcov_execve + _gcov_execv _gcov_execvp _gcov_execve \ + _gcov_interval_profiler _gcov_pow2_profiler _gcov_one_value_profiler FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \ _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \ @@ -1032,9 +1038,6 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 # language hooks, generated by configure @language_hooks@ -# Set up library path if needed. -@set_gcc_lib_path@ - # per-language makefile fragments ifneq ($(LANG_MAKEFRAGS),) include $(LANG_MAKEFRAGS) @@ -1083,7 +1086,7 @@ cs-bconfig.h: Makefile cs-tconfig.h: Makefile TARGET_CPU_DEFAULT="" \ - HEADERS="$(xm_include_list)" DEFINES="$(xm_defines)" \ + HEADERS="$(xm_include_list)" DEFINES="USED_FOR_TARGET $(xm_defines)" \ $(SHELL) $(srcdir)/mkconfig.sh tconfig.h cs-tm.h: Makefile @@ -1210,9 +1213,18 @@ $(SPECS): xgcc$(exeext) gcc-cross: xgcc$(exeext) cp xgcc$(exeext) gcc-cross$(exeext) -cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS) - $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \ - $(C_OBJS) $(BACKEND) $(LIBS) +cc1-dummy$(exeext): $(C_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) dummy-checksum.o \ + $(BACKEND) $(LIBS) + +cc1-checksum.c : cc1-dummy$(exeext) build/genchecksum$(exeext) + build/genchecksum$(exeext) cc1-dummy$(exeext) > $@ + +cc1-checksum.o : cc1-checksum.c + +cc1$(exeext): $(C_OBJS) cc1-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) cc1-checksum.o \ + $(BACKEND) $(LIBS) # Build the version of limits.h that we will install. xlimits.h: glimits.h limitx.h limity.h @@ -1262,6 +1274,7 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext SHLIB_NM_FLAGS='$(SHLIB_NM_FLAGS)' \ MULTILIB_OSDIRNAMES='$(MULTILIB_OSDIRNAMES)' \ ASM_HIDDEN_OP='$(ASM_HIDDEN_OP)' \ + GCC_FOR_TARGET='$(GCC_FOR_TARGET)' \ mkinstalldirs='$(mkinstalldirs)' \ $(SHELL) mklibgcc > tmp-libgcc.mk mv tmp-libgcc.mk libgcc.mk @@ -1375,8 +1388,8 @@ s-crt0: $(CRT0_S) $(MCRT0_S) $(GCC_PASSES) $(CONFIG_H) c-errors.o: c-errors.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(C_TREE_H) $(FLAGS_H) $(DIAGNOSTIC_H) $(TM_P_H) c-parser.o : c-parser.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(GGC_H) intl.h $(C_TREE_H) input.h $(FLAGS_H) toplev.h output.h \ - $(CPPLIB_H) varray.h gt-c-parser.h langhooks.h $(C_COMMON_H) $(C_PRAGMA_H) + $(GGC_H) $(TIMEVAR_H) $(C_TREE_H) input.h $(FLAGS_H) toplev.h output.h \ + $(CPPLIB_H) gt-c-parser.h langhooks.h $(C_COMMON_H) $(C_PRAGMA_H) srcextra: gcc.srcextra lang.srcextra @@ -1390,38 +1403,43 @@ c-incpath.o: c-incpath.c c-incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \ c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(RTL_H) $(C_TREE_H) $(GGC_H) $(TARGET_H) $(FLAGS_H) function.h output.h \ $(EXPR_H) debug.h toplev.h intl.h $(TM_P_H) tree-inline.h $(TIMEVAR_H) \ - opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h except.h \ - $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) -c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \ - $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H) \ - langhooks.h + opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \ + except.h $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \ + $(DIAGNOSTIC_H) input.h langhooks.h $(TREE_GIMPLE_H) tree-mudflap.h +c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(C_TREE_H) $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) \ + $(RTL_H) toplev.h $(TM_P_H) langhooks.h $(GGC_H) $(TREE_FLOW_H) \ + $(TREE_GIMPLE_H) tree-iterator.h c-lang.o : c-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-c.h \ - c-objc-common.h c-pragma.h + c-objc-common.h $(C_PRAGMA_H) c-common.def tree-inline.h stub-objc.o : stub-objc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ - $(GGC_H) $(C_COMMON_H) + $(C_COMMON_H) c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) real.h c-incpath.h cppdefault.h \ + $(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) real.h $(SPLAY_TREE_H) \ $(C_PRAGMA_H) input.h intl.h $(FLAGS_H) toplev.h output.h \ - $(CPPLIB_H) $(EXPR_H) $(TM_P_H) + $(CPPLIB_H) $(TIMEVAR_H) $(TM_P_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) \ - $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) $(EXPR_H) \ - $(FLAGS_H) toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \ - langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(C_PRETTY_PRINT_H) c-objc-common.h + $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) $(srcdir)/../libcpp/internal.h \ + $(C_PRAGMA_H) +c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(TREE_H) $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \ + function.h $(FLAGS_H) toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \ + langhooks.h $(GGC_H) $(TARGET_H) $(C_PRETTY_PRINT_H) c-objc-common.h \ + tree-mudflap.h c-aux-info.o : c-aux-info.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(C_TREE_H) $(FLAGS_H) toplev.h -c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(FLAGS_H) toplev.h $(C_COMMON_H) real.h +c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FLAGS_H) toplev.h $(C_COMMON_H) convert.h $(C_TREE_H) \ + langhooks.h c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) function.h $(C_PRAGMA_H) toplev.h output.h $(GGC_H) $(TM_P_H) \ - $(C_COMMON_H) $(TARGET_H) gt-c-pragma.h -graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(FLAGS_H) output.h \ - $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h -sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) + $(C_COMMON_H) $(TARGET_H) gt-c-pragma.h $(CPPLIB_H) $(FLAGS_H) +graph.o: graph.c $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(FLAGS_H) output.h \ + $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(OBSTACK_H) +sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(OBSTACK_H) COLLECT2_OBJS = collect2.o tlink.o intl.o version.o COLLECT2_LIBS = @COLLECT2_LIBS@ @@ -1431,7 +1449,7 @@ collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS) $(COLLECT2_OBJS) $(LIBS) $(COLLECT2_LIBS) mv -f T$@ $@ -collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) gstab.h intl.h \ +collect2.o : collect2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h \ $(OBSTACK_H) $(DEMANGLE_H) collect2.h version.h $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -DTARGET_MACHINE=\"$(target_noncanonical)\" \ @@ -1445,38 +1463,40 @@ tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(OBSTACK_H) $(C_COMMON_H) $(FLAGS_H) toplev.h output.h $(C_PRAGMA_H) \ $(GGC_H) $(EXPR_H) $(TM_P_H) builtin-types.def builtin-attrs.def \ - $(DIAGNOSTIC_H) gt-c-common.h langhooks.h varray.h $(RTL_H) \ + $(DIAGNOSTIC_H) gt-c-common.h langhooks.h $(VARRAY_H) $(RTL_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 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 \ - $(DIAGNOSTIC_H) + $(C_TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) real.h \ + $(DIAGNOSTIC_H) tree-iterator.h c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h langhooks.h \ tree-inline.h $(DIAGNOSTIC_H) intl.h debug.h $(C_COMMON_H) \ - opts.h options.h $(PARAMS_H) $(MKDEPS_H) + opts.h options.h $(MKDEPS_H) c-incpath.h cppdefault.h $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@ 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) + output.h except.h real.h $(TARGET_H) $(TM_P_H) # A file used by all variants of C and some other languages. -attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLAGS_H) \ - toplev.h output.h $(C_PRAGMA_H) $(RTL_H) $(GGC_H) $(EXPR_H) $(TM_P_H) \ - builtin-types.def $(TARGET_H) langhooks.h +attribs.o : attribs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) $(TM_P_H) \ + $(TARGET_H) langhooks.h $(CPPLIB_H) c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) langhooks.h \ $(C_COMMON_H) $(FLAGS_H) toplev.h intl.h $(DIAGNOSTIC_H) c-format.h -c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(FLAGS_H) toplev.h output.h $(C_PRAGMA_H) $(RTL_H) $(GGC_H) \ - $(EXPR_H) $(PREDICT_H) tree-inline.h +c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(FLAGS_H) toplev.h output.h $(RTL_H) $(GGC_H) \ + $(PREDICT_H) tree-inline.h $(C_COMMON_H) except.h function.h \ + langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(TREE_GIMPLE_H) \ + $(VARRAY_H) c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(C_TREE_H) $(TREE_DUMP_H) @@ -1504,7 +1524,8 @@ DRIVER_DEFINES = \ `test "X$${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` gcc.o: gcc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) intl.h multilib.h \ - Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) + Makefile $(lang_specs_files) specs.h prefix.h $(GCC_H) $(FLAGS_H) \ + configargs.h $(OBSTACK_H) (SHLIB_LINK='$(SHLIB_LINK)' \ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ @@ -1520,6 +1541,14 @@ gccspec.o: gccspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) cppspec.o: cppspec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) +build/genchecksum$(build_exeext) : build/genchecksum.o $(BUILD_LIBDEPS) + $(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ \ + build/genchecksum.o $(BUILD_LIBS) + +build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H) + +dummy-checksum.o : dummy-checksum.c + tree-check.h: s-check ; @true s-check : build/gencheck$(build_exeext) $(RUN_GEN) build/gencheck$(build_exeext) > tmp-check.h @@ -1557,7 +1586,7 @@ s-options: $(ALL_OPT_FILES) Makefile $(srcdir)/opt-gather.awk options.c: optionlist $(srcdir)/opt-functions.awk $(srcdir)/optc-gen.awk $(AWK) -f $(srcdir)/opt-functions.awk -f $(srcdir)/optc-gen.awk \ - -v header_name="options.h" < $< > $@ + -v header_name="config.h system.h coretypes.h tm.h" < $< > $@ options.h: s-options-h ; @true s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk @@ -1566,7 +1595,7 @@ s-options-h: optionlist $(srcdir)/opt-functions.awk $(srcdir)/opth-gen.awk $(SHELL) $(srcdir)/../move-if-change tmp-options.h options.h $(STAMP) $@ -options.o: options.c options.h opts.h intl.h +options.o: options.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) opts.h intl.h dumpvers: dumpvers.c @@ -1576,7 +1605,7 @@ version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - varray.h $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \ + $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \ function.h insn-config.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ cselib.h insn-addr.h $(OPTABS_H) libfuncs.h debug.h $(GGC_H) \ $(CGRAPH_H) $(TREE_FLOW_H) reload.h $(CPP_ID_DATA_H) @@ -1587,13 +1616,15 @@ ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ ggc-page.o: ggc-page.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) $(TREE_FLOW_H) -ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) $(PARAMS_H) +ggc-zone.o: ggc-zone.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) toplev.h $(GGC_H) $(TIMEVAR_H) $(TM_P_H) \ + $(PARAMS_H) bitmap.h $(VARRAY_H) -ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) +ggc-none.o: ggc-none.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \ + $(BCONFIG_H) stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(GGC_H) gt-stringpool.h + $(TREE_H) $(GGC_H) gt-stringpool.h $(CPPLIB_H) $(SYMTAB_H) prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \ Makefile $(BASEVER) @@ -1601,248 +1632,298 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \ -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) \ -c $(srcdir)/prefix.c $(OUTPUT_OPTION) -convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLAGS_H) \ - convert.h toplev.h langhooks.h +convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(FLAGS_H) convert.h toplev.h langhooks.h real.h -langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \ - tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \ - $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) diagnostic.h intl.h +langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) toplev.h tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) \ + langhooks.h $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) intl.h \ + $(TREE_GIMPLE_H) tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ $(FLAGS_H) function.h $(PARAMS_H) \ toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \ - real.h gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) -tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(C_TREE_H) $(FLAGS_H) langhooks.h toplev.h output.h $(C_PRAGMA_H) $(RTL_H) \ - $(GGC_H) $(EXPR_H) $(SPLAY_TREE_H) $(TREE_DUMP_H) tree-iterator.h tree-pass.h + real.h gt-tree.h tree-iterator.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ + $(OBSTACK_H) pointer-set.h +tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) langhooks.h toplev.h $(SPLAY_TREE_H) $(TREE_DUMP_H) \ + tree-iterator.h tree-pass.h $(DIAGNOSTIC_H) tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) input.h insn-config.h \ $(INTEGRATE_H) $(VARRAY_H) $(HASHTAB_H) $(SPLAY_TREE_H) toplev.h \ - langhooks.h $(C_COMMON_H) tree-inline.h $(CGRAPH_H) intl.h function.h \ - pointer-set.h $(TREE_GIMPLE_H) debug.h + langhooks.h tree-inline.h $(CGRAPH_H) intl.h function.h $(TREE_GIMPLE_H) \ + debug.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - $(GGC_H) langhooks.h real.h + $(GGC_H) langhooks.h real.h tree-iterator.h stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(PARAMS_H) $(FLAGS_H) function.h $(EXPR_H) $(RTL_H) toplev.h \ - $(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h + $(TREE_H) $(PARAMS_H) $(FLAGS_H) function.h $(EXPR_H) $(RTL_H) \ + $(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \ + toplev.h tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h diagnostic.h \ - errors.h toplev.h function.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) langhooks.h $(CFGLOOP_H) \ - tree-pass.h + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + errors.h toplev.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) langhooks.h tree-pass.h $(BASIC_BLOCK_H) bitmap.h \ + $(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) pointer-set.h \ + $(TREE_GIMPLE_H) tree-inline.h $(VARRAY_H) tree-into-ssa.o : tree-into-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h diagnostic.h \ - errors.h toplev.h function.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) langhooks.h domwalk.h tree-pass.h \ - $(GGC_H) + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + langhooks.h domwalk.h tree-pass.h $(GGC_H) $(PARAMS_H) $(BASIC_BLOCK_H) \ + bitmap.h $(CFGLOOP_H) $(FLAGS_H) hard-reg-set.h $(HASHTAB_H) \ + $(TREE_GIMPLE_H) tree-inline.h $(VARRAY_H) tree-outof-ssa.o : tree-outof-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h diagnostic.h \ - errors.h toplev.h function.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) langhooks.h domwalk.h \ - tree-pass.h $(TREE_SSA_LIVE_H) + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \ + errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + langhooks.h tree-pass.h $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) bitmap.h \ + $(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) $(TREE_GIMPLE_H) \ + tree-inline.h $(VARRAY_H) tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) domwalk.h $(FLAGS_H) + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) domwalk.h $(FLAGS_H) \ + $(DIAGNOSTIC_H) $(TIMEVAR_H) tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \ + langhooks.h tree-ssa-phiopt.o : tree-ssa-phiopt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \ - $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) langhooks.h $(FLAGS_H) + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) langhooks.h $(FLAGS_H) \ + $(DIAGNOSTIC_H) $(TIMEVAR_H) tree-nrv.o : tree-nrv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(TM_H) $(TREE_H) $(RTL_H) function.h $(BASIC_BLOCK_H) $(EXPR_H) \ - diagnostic.h $(TREE_FLOW_H) $(TIMEVAR_H) $(TREE_DUMP_H) tree-pass.h \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TREE_DUMP_H) tree-pass.h \ langhooks.h tree-ssa-copy.o : tree-ssa-copy.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ - $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h diagnostic.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) tree-pass.h langhooks.h + $(BASIC_BLOCK_H) tree-pass.h langhooks.h tree-ssa-propagate.h $(FLAGS_H) tree-ssa-propagate.o : tree-ssa-propagate.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 \ + $(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 + tree-ssa-propagate.h vec.h gt-tree-ssa-propagate.h $(FLAGS_H) $(VARRAY_H) 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 \ + $(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 cfgloop.h + tree-ssa-propagate.h $(CFGLOOP_H) +tree-ssa-uncprop.o : tree-ssa-uncprop.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-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) \ - $(BASIC_BLOCK_H) $(FLAGS_H) tree-pass.h cfgloop.h + $(DIAGNOSTIC_H) errors.h function.h $(TM_H) coretypes.h $(TREE_DUMP_H) \ + $(BASIC_BLOCK_H) $(FLAGS_H) tree-pass.h $(CFGLOOP_H) tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) varray.h $(GGC_H) gt-tree-ssanames.h $(TREE_FLOW_H) + $(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) gt-tree-ssanames.h $(TREE_FLOW_H) tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(TREE_H) varray.h $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ - gt-tree-phinodes.h $(RTL_H) + $(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ + gt-tree-phinodes.h $(RTL_H) toplev.h domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) domwalk.h $(GGC_H) tree-ssa-live.o : tree-ssa-live.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 toplev.h function.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) + $(TREE_H) $(DIAGNOSTIC_H) errors.h function.h $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \ + bitmap.h $(FLAGS_H) $(HASHTAB_H) $(TREE_GIMPLE_H) tree-inline.h \ + $(VARRAY_H) tree-ssa-copyrename.o : tree-ssa-copyrename.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 toplev.h function.h $(TIMEVAR_H) tree-pass.h \ - $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) + $(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) function.h $(TIMEVAR_H) tree-pass.h \ + $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \ + bitmap.h $(FLAGS_H) $(HASHTAB_H) langhooks.h $(TREE_GIMPLE_H) \ + tree-inline.h tree-ssa-pre.o : tree-ssa-pre.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(EXPR_H) \ - $(GGC_H) output.h diagnostic.h errors.h toplev.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \ + alloc-pool.h $(BASIC_BLOCK_H) bitmap.h $(FIBHEAP_H) $(HASHTAB_H) \ + langhooks.h real.h $(TREE_GIMPLE_H) tree-inline.h tree-iterator.h tree-vn.o : tree-vn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \ $(TREE_H) $(TREE_FLOW_H) $(HASHTAB_H) langhooks.h tree-pass.h \ - $(TREE_DUMP_H) diagnostic.h + $(TREE_DUMP_H) $(DIAGNOSTIC_H) +tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(GGC_H) \ + $(BASIC_BLOCK_H) tree-ssa-propagate.h $(FLAGS_H) $(TREE_DUMP_H) \ + $(CFGLOOP_H) $(SCEV_H) tree-chrec.h $(TIMEVAR_H) tree-cfg.o : tree-cfg.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(FLAGS_H) output.h \ - diagnostic.h errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h \ - $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) gt-tree-cfg.h tree-pass.h \ - $(CFGLAYOUT_H) + $(DIAGNOSTIC_H) errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h \ + $(TREE_DUMP_H) except.h langhooks.h $(CFGLOOP_H) tree-pass.h \ + $(CFGLAYOUT_H) $(BASIC_BLOCK_H) hard-reg-set.h $(HASHTAB_H) toplev.h tree-tailcall.o : tree-tailcall.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) function.h $(TM_H) coretypes.h \ - $(TREE_DUMP_H) diagnostic.h except.h tree-pass.h $(FLAGS_H) langhooks.h + $(TREE_DUMP_H) $(DIAGNOSTIC_H) except.h tree-pass.h $(FLAGS_H) langhooks.h \ + $(BASIC_BLOCK_H) hard-reg-set.h tree-ssa-sink.o : tree-ssa-sink.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(EXPR_H) \ - $(GGC_H) output.h diagnostic.h errors.h toplev.h $(TIMEVAR_H) \ - $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TIMEVAR_H) \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) alloc-pool.h \ + $(BASIC_BLOCK_H) bitmap.h $(CFGLOOP_H) $(FIBHEAP_H) $(HASHTAB_H) \ + langhooks.h real.h $(TREE_GIMPLE_H) tree-inline.h tree-iterator.h tree-nested.o: tree-nested.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \ - $(RTL_H) $(TM_P_H) function.h tree-dump.h tree-inline.h tree-iterator.h \ - tree-gimple.h $(CGRAPH_H) $(EXPR_H) langhooks.h $(GGC_H) gt-tree-nested.h + $(RTL_H) $(TM_P_H) function.h $(TREE_DUMP_H) tree-inline.h \ + tree-iterator.h $(TREE_GIMPLE_H) $(CGRAPH_H) $(EXPR_H) langhooks.h \ + $(GGC_H) gt-tree-nested.h coretypes.h $(TREE_FLOW_H) tree-if-conv.o: tree-if-conv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FLAGS_H) $(TIMEVAR_H) varray.h $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ - cfgloop.h $(RTL_H) c-common.h tree-chrec.h tree-data-ref.h \ - tree-scalar-evolution.h tree-pass.h + $(TREE_H) $(FLAGS_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \ + $(CFGLOOP_H) $(RTL_H) $(C_COMMON_H) tree-chrec.h $(TREE_DATA_REF_H) \ + $(SCEV_H) tree-pass.h $(DIAGNOSTIC_H) errors.h $(TARGET_H) $(TREE_DUMP_H) \ + $(VARRAY_H) tree-iterator.o : tree-iterator.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ - coretypes.h $(GGC_H) tree-iterator.h tree-gimple.h gt-tree-iterator.h + coretypes.h $(GGC_H) tree-iterator.h $(TREE_GIMPLE_H) gt-tree-iterator.h tree-dfa.o : tree-dfa.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 tree-inline.h $(HASHTAB_H) pointer-set.h $(FLAGS_H) function.h $(TIMEVAR_H) \ - convert.h $(TM_H) coretypes.h langhooks.h \ - $(TREE_DUMP_H) tree-pass.h params.h $(CGRAPH_H) + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ + errors.h tree-inline.h $(HASHTAB_H) pointer-set.h $(FLAGS_H) function.h \ + $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h $(TREE_DUMP_H) \ + tree-pass.h $(PARAMS_H) $(CGRAPH_H) $(BASIC_BLOCK_H) hard-reg-set.h \ + $(TREE_GIMPLE_H) tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \ - $(SYSTEM_H) $(TREE_H) $(TM_P_H) $(GGC_H) $(CGRAPH_H) diagnostic.h \ - errors.h tree-inline.h $(FLAGS_H) function.h $(TM_H) $(TIMEVAR_H) \ - tree-pass.h gt-tree-ssa-operands.h + $(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h tree-inline.h \ + $(FLAGS_H) function.h $(TM_H) $(TIMEVAR_H) tree-pass.h \ + gt-tree-ssa-operands.h coretypes.h langhooks.h tree-ssa-opfinalize.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 + $(GGC_H) tree-pass.h coretypes.h $(TIMEVAR_H) $(TM_P_H) \ + $(TREE_DUMP_H) tree-inline.h tree-iterator.h 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-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 + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(FLAGS_H) tree-inline.h $(SCEV_H) $(BASIC_BLOCK_H) \ + hard-reg-set.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 $(BASIC_BLOCK_H) hard-reg-set.h 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) \ - tree-pass.h $(SCEV_H) tree-data-ref.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) $(TREE_DATA_REF_H) $(BASIC_BLOCK_H) \ + $(GGC_H) hard-reg-set.h tree-chrec.h 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) + $(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) $(BASIC_BLOCK_H) $(GGC_H) hard-reg-set.h \ + tree-chrec.h 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) \ - tree-pass.h $(FLAGS_H) + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) hard-reg-set.h tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.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) \ + $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_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) \ - cfgloop.h $(PARAMS_H) sbitmap.h + $(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \ + tree-chrec.h $(VARRAY_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) + output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \ + tree-pass.h $(CFGLAYOUT_H) $(SCEV_H) $(BASIC_BLOCK_H) hard-reg-set.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) \ - tree-pass.h $(FLAGS_H) $(HASHTAB_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 $(FLAGS_H) real.h $(BASIC_BLOCK_H) \ + hard-reg-set.h +tree-ssa-math-opts.o : tree-ssa-math-opts.c $(TREE_FLOW_H) $(CONFIG_H) \ + $(SYSTEM_H) $(TREE_H) $(TIMEVAR_H) tree-pass.h $(TM_H) $(FLAGS_H) tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) tree-inline.h $(FLAGS_H) \ - function.h $(TIMEVAR_H) convert.h $(TM_H) coretypes.h \ - langhooks.h $(TREE_DUMP_H) tree-pass.h params.h -tree-optimize.o : tree-optimize.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 $(FLAGS_H) \ - $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h function.h \ - langhooks.h $(FLAGS_H) $(CGRAPH_H) tree-inline.h tree-mudflap.h $(GGC_H) \ - $(CGRAPH_H) tree-pass.h $(CFGLOOP_H) + function.h $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \ + $(TREE_DUMP_H) tree-pass.h $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ + hard-reg-set.h $(TREE_GIMPLE_H) vec.h +tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ + $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \ + $(FLAGS_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) toplev.h \ + function.h langhooks.h $(FLAGS_H) $(CGRAPH_H) tree-inline.h \ + tree-mudflap.h $(GGC_H) $(CGRAPH_H) tree-pass.h $(CFGLOOP_H) \ + $(BASIC_BLOCK_H) graph.h hard-reg-set.h c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) errors.h \ - $(C_TREE_H) $(C_COMMON_H) diagnostic.h $(TREE_GIMPLE_H) varray.h $(FLAGS_H) \ - langhooks.h toplev.h rtl.h $(TREE_FLOW_H) langhooks-def.h \ - $(TM_H) coretypes.h $(C_PRETTY_PRINT_H) $(CGRAPH_H) + $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \ + $(FLAGS_H) langhooks.h toplev.h $(RTL_H) $(TREE_FLOW_H) $(LANGHOOKS_DEF_H) \ + $(TM_H) coretypes.h $(C_PRETTY_PRINT_H) $(CGRAPH_H) $(BASIC_BLOCK_H) \ + hard-reg-set.h $(TREE_DUMP_H) tree-inline.h gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) errors.h \ - diagnostic.h $(TREE_GIMPLE_H) tree-inline.h varray.h langhooks.h \ - langhooks-def.h $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ - except.h $(FLAGS_H) $(RTL_H) function.h $(EXPR_H) output.h $(GGC_H) \ - gt-gimplify.h + $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) tree-inline.h $(VARRAY_H) langhooks.h \ + $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \ + coretypes.h except.h $(FLAGS_H) $(RTL_H) function.h $(EXPR_H) output.h \ + $(GGC_H) gt-gimplify.h $(HASHTAB_H) real.h $(TARGET_H) gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) errors.h \ - diagnostic.h $(TREE_GIMPLE_H) tree-inline.h varray.h langhooks.h \ - langhooks-def.h $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h except.h \ - $(FLAGS_H) $(RTL_H) function.h $(EXPR_H) tree-pass.h + $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) tree-inline.h $(VARRAY_H) langhooks.h \ + $(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \ + except.h $(FLAGS_H) $(RTL_H) function.h $(EXPR_H) tree-pass.h \ + $(HASHTAB_H) toplev.h tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \ - $(TREE_H) errors.h tree-inline.h diagnostic.h $(HASHTAB_H) \ + $(TREE_H) errors.h tree-inline.h $(DIAGNOSTIC_H) $(HASHTAB_H) \ $(TM_H) coretypes.h tree-chrec.o: tree-chrec.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(TREE_H) tree-chrec.h tree-pass.h + errors.h $(GGC_H) $(TREE_H) tree-chrec.h tree-pass.h $(PARAMS_H) \ + $(DIAGNOSTIC_H) $(VARRAY_H) tree-scalar-evolution.o: tree-scalar-evolution.c $(CONFIG_H) $(SYSTEM_H) \ coretypes.h $(TM_H) errors.h $(GGC_H) $(TREE_H) $(RTL_H) \ - $(BASIC_BLOCK_H) diagnostic.h $(TREE_FLOW_H) $(TREE_DUMP_H) \ - $(TIMEVAR_H) cfgloop.h $(SCEV_H) tree-pass.h $(FLAGS_H) + $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ + $(TIMEVAR_H) $(CFGLOOP_H) $(SCEV_H) tree-pass.h $(FLAGS_H) tree-chrec.h tree-data-ref.o: tree-data-ref.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) diagnostic.h \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) cfgloop.h \ - tree-data-ref.h $(SCEV_H) tree-pass.h $(LAMBDA_H) -tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) diagnostic.h \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) cfgloop.h \ - tree-vectorizer.h tree-data-ref.h $(SCEV_H) $(EXPR_H) -tree-vect-transform.o: tree-vect-transform.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) diagnostic.h \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) cfgloop.h target.h tree-pass.h $(EXPR_H) \ - tree-vectorizer.h tree-data-ref.h $(SCEV_H) langhooks.h toplev.h -tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) diagnostic.h \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) cfgloop.h tree-pass.h $(EXPR_H) \ - tree-vectorizer.h tree-data-ref.h $(SCEV_H) input.h target.h cfglayout.h -tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) diagnostic.h \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) cfgloop.h tree-pass.h \ - $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) + errors.h $(GGC_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \ + $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + $(TREE_DATA_REF_H) $(SCEV_H) tree-pass.h tree-chrec.h +tree-vect-analyze.o: tree-vect-analyze.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) tree-chrec.h +tree-vect-transform.o: tree-vect-transform.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TM_H) errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) \ + $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) \ + $(TIMEVAR_H) $(CFGLOOP_H) $(TARGET_H) tree-pass.h $(EXPR_H) \ + tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) langhooks.h toplev.h \ + tree-chrec.h +tree-vectorizer.o: tree-vectorizer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-pass.h $(EXPR_H) tree-vectorizer.h $(TREE_DATA_REF_H) $(SCEV_H) \ + input.h $(TARGET_H) $(CFGLAYOUT_H) toplev.h tree-chrec.h +tree-loop-linear.o: tree-loop-linear.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) errors.h $(GGC_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + tree-pass.h $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) $(LAMBDA_H) \ + $(TARGET_H) tree-chrec.h $(VARRAY_H) +tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) function.h $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \ + tree-stdarg.h $(TARGET_H) langhooks.h tree-gimple.o : tree-gimple.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(EXPR_H) \ - $(RTL_H) $(TREE_GIMPLE_H) $(TM_H) coretypes.h bitmap.h $(GGC_H) + $(RTL_H) $(TREE_GIMPLE_H) $(TM_H) coretypes.h bitmap.h $(GGC_H) \ + output.h $(TREE_FLOW_H) tree-mudflap.o : $(CONFIG_H) errors.h $(SYSTEM_H) $(TREE_H) tree-inline.h \ - $(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) diagnostic.h $(HASHTAB_H) \ - output.h varray.h langhooks.h tree-mudflap.h $(TM_H) coretypes.h \ - $(TREE_DUMP_H) tree-pass.h $(CGRAPH_H) $(GGC_H) gt-tree-mudflap.h + $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \ + $(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(CGRAPH_H) $(GGC_H) \ + gt-tree-mudflap.h $(BASIC_BLOCK_H) $(FLAGS_H) function.h hard-reg-set.h \ + $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) tree-nomudflap.o : $(CONFIG_H) errors.h $(SYSTEM_H) $(TREE_H) tree-inline.h \ - $(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) diagnostic.h $(HASHTAB_H) \ - output.h varray.h langhooks.h tree-mudflap.h $(TM_H) coretypes.h + $(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \ + output.h $(VARRAY_H) langhooks.h tree-mudflap.h $(TM_H) coretypes.h \ + $(GGC_H) gt-tree-mudflap.h tree-pass.h tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \ - errors.h $(TREE_H) diagnostic.h real.h $(HASHTAB_H) $(TREE_FLOW_H) \ - $(TM_H) coretypes.h tree-iterator.h tree-chrec.h + errors.h $(TREE_H) $(DIAGNOSTIC_H) real.h $(HASHTAB_H) $(TREE_FLOW_H) \ + $(TM_H) coretypes.h tree-iterator.h tree-chrec.h langhooks.h fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) $(FLAGS_H) real.h toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) $(GGC_H) \ - $(TM_P_H) langhooks.h $(MD5_H) + $(TREE_H) $(FLAGS_H) real.h toplev.h $(HASHTAB_H) $(EXPR_H) $(RTL_H) \ + $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) diagnostic.o : diagnostic.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) version.h $(TM_P_H) $(FLAGS_H) input.h toplev.h intl.h \ - $(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) + $(DIAGNOSTIC_H) langhooks.h $(LANGHOOKS_DEF_H) diagnostic.def opts.h opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \ - output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h target.h -targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TREE_H) $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \ - output.h toplev.h - -toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h $(RTL_H) \ - function.h $(FLAGS_H) xcoffout.h input.h $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) \ - debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \ - dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \ - graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ - $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ - langhooks.h insn-flags.h $(CFGLAYOUT_H) real.h $(CFGLOOP_H) \ - hosthooks.h $(LANGHOOKS_DEF_H) $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h + coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \ + output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h $(TARGET_H) \ + $(FLAGS_H) $(PARAMS_H) +targhooks.o : targhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \ + $(EXPR_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h output.h toplev.h \ + $(MACHMODE_H) $(TARGET_DEF_H) $(TARGET_H) + +toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + version.h $(RTL_H) function.h $(FLAGS_H) xcoffout.h input.h \ + $(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) debug.h insn-config.h intl.h \ + $(RECOG_H) Makefile toplev.h dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \ + hard-reg-set.h $(BASIC_BLOCK_H) graph.h except.h $(REGS_H) $(TIMEVAR_H) \ + value-prof.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ + langhooks.h insn-flags.h $(CFGLAYOUT_H) real.h $(CFGLOOP_H) hosthooks.h \ + $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \ + $(CPPLIB_H) opts.h params.def tree-mudflap.h $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -DTARGET_NAME=\"$(target_noncanonical)\" \ -c $(srcdir)/toplev.c $(OUTPUT_OPTION) @@ -1854,158 +1935,183 @@ passes.o : passes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ graph.h except.h $(REGS_H) $(TIMEVAR_H) value-prof.h \ $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \ langhooks.h insn-flags.h $(CFGLAYOUT_H) real.h $(CFGLOOP_H) \ - hosthooks.h $(LANGHOOKS_DEF_H) $(CGRAPH_H) $(COVERAGE_H) alloc-pool.h \ - tree-pass.h tree-dump.h + hosthooks.h $(CGRAPH_H) $(COVERAGE_H) tree-pass.h $(TREE_DUMP_H) \ + $(GGC_H) $(INTEGRATE_H) $(CPPLIB_H) opts.h main.o : main.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h -host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) $(HOOKS_H) coretypes.h \ - hosthooks.h $(HOSTHOOKS_DEF_H) +host-default.o : host-default.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + hosthooks.h $(HOSTHOOKS_DEF_H) -rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(INSN_ATTR_H) \ - insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) $(CONFIG_H) +rtl-error.o: rtl-error.c $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(INSN_ATTR_H) insn-config.h input.h toplev.h intl.h $(DIAGNOSTIC_H) \ + $(CONFIG_H) rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h \ - $(GGC_H) errors.h + $(GGC_H) errors.h $(BCONFIG_H) insn-notes.def reg-notes.def print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) real.h $(FLAGS_H) + $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) real.h $(FLAGS_H) \ + $(BCONFIG_H) rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ - $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h $(FLAGS_H) \ - $(BASIC_BLOCK_H) $(REGS_H) output.h target.h function.h + $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h \ + $(FLAGS_H) $(REGS_H) output.h $(TARGET_H) function.h -varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - $(FLAGS_H) function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \ +varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + $(RTL_H) $(FLAGS_H) function.h $(EXPR_H) hard-reg-set.h $(REGS_H) \ output.h $(C_PRAGMA_H) toplev.h xcoffout.h debug.h $(GGC_H) $(TM_P_H) \ - $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h real.h + $(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h real.h $(BASIC_BLOCK_H) \ + $(CFGLAYOUT_H) $(CGRAPH_H) tree-mudflap.h function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(CFGLAYOUT_H) $(TREE_GIMPLE_H) \ - $(FLAGS_H) function.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h \ - insn-config.h $(RECOG_H) output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) \ - $(TM_P_H) langhooks.h gt-function.h $(TARGET_H) basic-block.h -stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) \ - function.h insn-config.h hard-reg-set.h $(EXPR_H) libfuncs.h except.h \ - $(RECOG_H) toplev.h output.h varray.h $(GGC_H) $(TM_P_H) \ - langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) + $(TREE_H) $(CFGLAYOUT_H) $(TREE_GIMPLE_H) $(FLAGS_H) function.h $(EXPR_H) \ + $(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ + output.h toplev.h except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \ + gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) +stmt.o : stmt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) function.h insn-config.h hard-reg-set.h $(EXPR_H) \ + libfuncs.h except.h $(RECOG_H) toplev.h output.h $(GGC_H) $(TM_P_H) \ + langhooks.h $(PREDICT_H) $(OPTABS_H) $(TARGET_H) $(MACHMODE_H) \ + $(REGS_H) except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(TREE_H) $(FLAGS_H) except.h function.h $(EXPR_H) libfuncs.h $(INTEGRATE_H) \ + $(TREE_H) $(FLAGS_H) except.h function.h $(EXPR_H) libfuncs.h \ langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \ dwarf2asm.h dwarf2out.h toplev.h $(HASHTAB_H) intl.h $(GGC_H) \ - gt-except.h $(CGRAPH_H) + gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \ + $(TARGET_H) $(TM_P_H) expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) \ libfuncs.h $(INSN_ATTR_H) insn-config.h $(RECOG_H) output.h \ typeclass.h hard-reg-set.h toplev.h hard-reg-set.h except.h reload.h \ $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h $(TARGET_H) \ - tree-iterator.h gt-expr.h + tree-iterator.h gt-expr.h $(MACHMODE_H) $(TIMEVAR_H) $(TREE_FLOW_H) \ + tree-pass.h dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) function.h $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \ langhooks.h $(GGC_H) gt-dojump.h -builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H)\ - $(TREE_GIMPLE_H) $(FLAGS_H) $(TARGET_H) function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) \ - insn-config.h $(RECOG_H) output.h typeclass.h hard-reg-set.h toplev.h hard-reg-set.h \ - except.h $(TM_P_H) $(PREDICT_H) libfuncs.h real.h langhooks.h basic-block.h \ - tree-mudflap.h -calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) \ - $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ - libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H) $(CGRAPH_H) except.h +builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(TARGET_H) function.h $(REGS_H) \ + $(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \ + hard-reg-set.h toplev.h hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \ + libfuncs.h real.h langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h \ + builtins.def $(MACHMODE_H) +calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \ + libfuncs.h $(REGS_H) toplev.h output.h function.h $(TIMEVAR_H) $(TM_P_H) \ + $(CGRAPH_H) except.h sbitmap.h expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) real.h \ toplev.h $(TM_P_H) langhooks.h explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ $(FLAGS_H) hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \ toplev.h function.h $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h -optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \ - toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H) \ - $(TARGET_H) +optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h \ + $(RECOG_H) reload.h toplev.h $(GGC_H) real.h $(TM_P_H) except.h \ + gt-optabs.h $(BASIC_BLOCK_H) $(TARGET_H) function.h dbxout.o : dbxout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ $(FLAGS_H) $(REGS_H) debug.h $(TM_P_H) $(TARGET_H) function.h langhooks.h \ insn-config.h reload.h gstab.h xcoffout.h output.h dbxout.h toplev.h \ $(GGC_H) $(OBSTACK_H) gt-dbxout.h debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \ - $(TREE_H) $(GGC_H) varray.h $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \ + $(TREE_H) $(GGC_H) $(RTL_H) $(REGS_H) $(FLAGS_H) insn-config.h \ output.h toplev.h $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \ - gt-sdbout.h + gt-sdbout.h reload.h $(VARRAY_H) dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h reload.h \ + $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \ output.h $(DIAGNOSTIC_H) real.h hard-reg-set.h $(REGS_H) $(EXPR_H) \ - libfuncs.h toplev.h dwarf2out.h varray.h $(GGC_H) except.h dwarf2asm.h \ + libfuncs.h toplev.h dwarf2out.h reload.h $(GGC_H) except.h dwarf2asm.h \ $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \ - $(MD5_H) input.h -dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(FLAGS_H) $(RTL_H) \ - $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) gt-dwarf2asm.h + $(MD5_H) input.h function.h $(VARRAY_H) +dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \ + gt-dwarf2asm.h dwarf2.h $(SPLAY_TREE_H) $(TARGET_H) vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \ $(RTL_H) $(FLAGS_H) output.h vmsdbg.h debug.h langhooks.h function.h $(TARGET_H) -xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) \ - xcoffout.h $(FLAGS_H) toplev.h output.h dbxout.h $(GGC_H) $(TARGET_H) -emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \ - $(EXPR_H) $(OBSTACK_H) hard-reg-set.h bitmap.h toplev.h \ +xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) $(RTL_H) xcoffout.h $(FLAGS_H) toplev.h output.h dbxout.h \ + $(GGC_H) $(TARGET_H) gstab.h xcoff.h +emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) function.h $(REGS_H) insn-config.h $(RECOG_H) real.h \ + $(GGC_H) $(EXPR_H) hard-reg-set.h bitmap.h toplev.h $(BASIC_BLOCK_H) \ $(HASHTAB_H) $(TM_P_H) debug.h langhooks.h gt-emit-rtl.h -real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h $(TM_P_H) -integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \ - intl.h function.h output.h $(RECOG_H) except.h toplev.h \ - $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h gt-integrate.h +real.o : real.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ + toplev.h $(TM_P_H) real.h +integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) $(FLAGS_H) debug.h $(INTEGRATE_H) insn-config.h \ + $(EXPR_H) real.h $(REGS_H) intl.h function.h output.h $(RECOG_H) \ + except.h toplev.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) langhooks.h \ + gt-integrate.h $(GGC_H) jump.o : jump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ hard-reg-set.h $(REGS_H) insn-config.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \ toplev.h $(INSN_ATTR_H) $(TM_P_H) reload.h $(PREDICT_H) $(TIMEVAR_H) \ $(DIAGNOSTIC_H) -simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ - output.h function.h $(GGC_H) $(OBSTACK_H) $(TM_P_H) $(TREE_H) $(TARGET_H) +simplify-rtx.o : simplify-rtx.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) real.h insn-config.h \ + $(RECOG_H) $(EXPR_H) toplev.h output.h function.h $(GGC_H) $(TM_P_H) \ + $(TREE_H) $(TARGET_H) cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) gt-cgraph.h \ - output.h intl.h -cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ - langhooks.h tree-inline.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) intl.h \ - pointer-set.h function.h $(TREE_GIMPLE_H) $(TREE_FLOW_H) -coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) function.h \ - toplev.h $(GGC_H) $(TARGET_H) langhooks.h $(COVERAGE_H) libfuncs.h \ - gt-coverage.h $(HASHTAB_H) -cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(RECOG_H) $(EMIT_RTL_H) toplev.h \ - output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h $(PARAMS_H) \ - alloc-pool.h + langhooks.h toplev.h $(FLAGS_H) $(GGC_H) $(TARGET_H) $(CGRAPH_H) \ + gt-cgraph.h output.h intl.h $(BASIC_BLOCK_H) debug.h $(HASHTAB_H) \ + tree-inline.h $(VARRAY_H) +cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) langhooks.h tree-inline.h toplev.h $(FLAGS_H) $(GGC_H) \ + $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h function.h $(TREE_GIMPLE_H) \ + $(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \ + $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) +ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) +ipa-inline.o : ipa-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TREE_H) langhooks.h tree-inline.h $(FLAGS_H) $(CGRAPH_H) intl.h \ + $(DIAGNOSTIC_H) $(FIBHEAP_H) $(PARAMS_H) $(TIMEVAR_H) tree-pass.h +coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ + function.h toplev.h $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \ + $(HASHTAB_H) $(CGRAPH_H) tree-iterator.h +cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(REGS_H) hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(RECOG_H) \ + $(EMIT_RTL_H) toplev.h output.h function.h cselib.h $(GGC_H) $(TM_P_H) \ + gt-cselib.h $(PARAMS_H) alloc-pool.h $(HASHTAB_H) cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \ output.h function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \ except.h $(TARGET_H) $(PARAMS_H) rtlhooks-def.h -web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) function.h output.h toplev.h $(DF_H) -gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(GGC_H) $(RECOG_H) $(EXPR_H) \ - $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) \ - except.h gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) -resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretypes.h \ - $(TM_H) $(BASIC_BLOCK_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) function.h toplev.h \ - $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H) +web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) function.h output.h toplev.h \ + $(DF_H) $(OBSTACK_H) +gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(REGS_H) hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(GGC_H) \ + $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) function.h output.h toplev.h \ + $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h $(TREE_H) cselib.h $(TIMEVAR_H) \ + intl.h $(OBSTACK_H) +resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) \ + coretypes.h $(TM_H) $(REGS_H) $(FLAGS_H) output.h $(RESOURCE_H) \ + function.h toplev.h $(INSN_ATTR_H) except.h $(PARAMS_H) $(TM_P_H) lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \ - hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) $(EXPR_H) \ - $(BASIC_BLOCK_H) $(TM_P_H) $(DF_H) function.h -tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) system.h errors.h $(TREE_H) \ - $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) diagnostic.h $(TIMEVAR_H) $(TM_H) \ - coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) + hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(INSN_ATTR_H) $(RECOG_H) \ + $(BASIC_BLOCK_H) $(TM_P_H) function.h output.h +tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) errors.h $(TREE_H) \ + $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \ + coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \ + $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H) tree-ssa-ccp.o : tree-ssa-ccp.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 \ + $(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 -tree-sra.o : tree-sra.c $(CONFIG_H) system.h errors.h $(TREE_H) $(RTL_H) \ - $(TM_P_H) $(TREE_FLOW_H) diagnostic.h tree-inline.h \ + tree-ssa-propagate.h $(FLAGS_H) $(TARGET_H) +tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) errors.h $(TREE_H) $(RTL_H) \ + $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) tree-inline.h \ $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_GIMPLE_H) \ - langhooks.h tree-pass.h $(FLAGS_H) $(EXPR_H) -tree-complex.o : tree-complex.c $(CONFIG_H) system.h $(TREE_H) \ + langhooks.h tree-pass.h $(FLAGS_H) $(EXPR_H) $(BASIC_BLOCK_H) \ + bitmap.h $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(PARAMS_H) $(TARGET_H) +tree-complex.o : tree-complex.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \ $(TM_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) tree-iterator.h tree-pass.h \ $(FLAGS_H) $(OPTABS_H) $(RTL_H) $(MACHMODE_H) $(EXPR_H) \ - langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) gt-tree-complex.h $(GGC_H) + langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) gt-tree-complex.h $(GGC_H) \ + coretypes.h insn-codes.h df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \ - $(BASIC_BLOCK_H) $(DF_H) + $(BASIC_BLOCK_H) $(DF_H) bitmap.h sbitmap.h $(TM_P_H) var-tracking.o : var-tracking.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) hard-reg-set.h insn-config.h reload.h $(FLAGS_H) \ $(BASIC_BLOCK_H) output.h sbitmap.h alloc-pool.h $(FIBHEAP_H) $(HASHTAB_H) @@ -2013,197 +2119,229 @@ conflict.o : conflict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(OBSTACK_H) $(HASHTAB_H) $(RTL_H) hard-reg-set.h $(BASIC_BLOCK_H) profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) function.h \ - toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h + toplev.h $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h cfghooks.h tree-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) function.h \ - toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H) $(TREE_H) value-prof.h \ - tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) + $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ + function.h toplev.h $(COVERAGE_H) $(TREE_H) value-prof.h $(TREE_DUMP_H) \ + tree-pass.h $(TREE_FLOW_H) $(TIMEVAR_H) $(GGC_H) gt-tree-profile.h rtl-profile.o : tree-profile.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ - $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) function.h \ - toplev.h $(BASIC_BLOCK_H) $(COVERAGE_H) $(TREE_FLOW_H) value-prof.h $(GGC_H) -value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \ + function.h toplev.h $(COVERAGE_H) value-prof.h $(GGC_H) +value-prof.o : value-prof.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(BASIC_BLOCK_H) hard-reg-set.h value-prof.h $(EXPR_H) output.h $(FLAGS_H) \ - $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) -loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \ + $(RECOG_H) insn-config.h $(OPTABS_H) $(REGS_H) $(GGC_H) $(DIAGNOSTIC_H) \ + $(TREE_H) $(COVERAGE_H) $(RTL_H) $(GCOV_IO_H) $(TREE_FLOW_H) \ + tree-flow-inline.h +loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \ real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h $(CFGLOOP_H) \ - toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H) $(GGC_H) + toplev.h except.h cselib.h $(OPTABS_H) $(TM_P_H) $(GGC_H) insn-flags.h loop-doloop.o : loop-doloop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(FLAGS_H) $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) \ toplev.h $(CFGLOOP_H) output.h $(PARAMS_H) alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h $(HASHTAB_H) -flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ - $(RECOG_H) function.h except.h $(EXPR_H) $(GGC_H) $(TM_P_H) -cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) insn-config.h \ - $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ - function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h $(TIMEVAR_H) -cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(BASIC_BLOCK_H) $(CFGLAYOUT_H) $(TREE_FLOW_H) $(TIMEVAR_H) toplev.h +flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \ + hard-reg-set.h output.h toplev.h $(RECOG_H) function.h except.h \ + $(EXPR_H) $(TM_P_H) $(OBSTACK_H) $(SPLAY_TREE_H) $(TIMEVAR_H) +cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ + $(REGS_H) hard-reg-set.h output.h toplev.h function.h except.h $(GGC_H) \ + $(TM_P_H) $(TIMEVAR_H) $(OBSTACK_H) $(TREE_H) +cfghooks.o: cfghooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) $(TIMEVAR_H) toplev.h cfgexpand.o : cfgexpand.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \ $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) function.h $(TIMEVAR_H) $(TM_H) \ - coretypes.h $(TREE_DUMP_H) except.h langhooks.h cfgloop.h tree-pass.h \ - $(RTL_H) $(DIAGNOSTIC_H) toplev.h -cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ - function.h except.h $(GGC_H) $(TM_P_H) insn-config.h $(EXPR_H) + coretypes.h $(TREE_DUMP_H) except.h langhooks.h tree-pass.h $(RTL_H) \ + $(DIAGNOSTIC_H) toplev.h $(BASIC_BLOCK_H) $(FLAGS_H) +cfgrtl.o : cfgrtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ + output.h toplev.h function.h except.h $(TM_P_H) insn-config.h $(EXPR_H) \ + $(CFGLAYOUT_H) $(CFGLOOP_H) $(OBSTACK_H) $(TARGET_H) $(TREE_H) cfganal.o : cfganal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(GGC_H) $(TM_P_H) \ - $(TIMEVAR_H) -cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \ - function.h except.h $(GGC_H) + $(BASIC_BLOCK_H) hard-reg-set.h insn-config.h $(RECOG_H) $(TM_P_H) \ + $(TIMEVAR_H) $(OBSTACK_H) toplev.h +cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ + function.h except.h $(TIMEVAR_H) $(TREE_H) cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(FLAGS_H) \ - $(RECOG_H) toplev.h $(GGC_H) insn-config.h cselib.h $(TARGET_H) $(TM_P_H) \ - $(PARAMS_H) $(REGS_H) $(EMIT_RTL_H) + $(RTL_H) $(TIMEVAR_H) hard-reg-set.h output.h $(FLAGS_H) $(RECOG_H) \ + toplev.h insn-config.h cselib.h $(TARGET_H) $(TM_P_H) $(PARAMS_H) \ + $(REGS_H) $(EMIT_RTL_H) $(CFGLAYOUT_H) cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(FLAGS_H) function.h \ + $(OBSTACK_H) toplev.h $(TREE_FLOW_H) $(TREE_H) cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) -loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) -loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h cfgloop.h $(EXPR_H) coretypes.h $(TM_H) \ - function.h $(FLAGS_H) df.h + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \ + $(OBSTACK_H) output.h +loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \ + hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) \ + output.h +loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h \ + $(TM_H) function.h $(FLAGS_H) $(DF_H) $(OBSTACK_H) output.h cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h coretypes.h $(TM_H) + $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \ + coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \ - coretypes.h $(TM_H) + coretypes.h $(TM_H) $(OBSTACK_H) loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ - output.h $(EXPR_H) coretypes.h $(TM_H) + output.h $(EXPR_H) coretypes.h $(TM_H) $(OBSTACK_H) loop-unroll.o: loop-unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TM_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) $(PARAMS_H) \ - output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) $(VARRAY_H) + output.h $(EXPR_H) coretypes.h $(TM_H) $(HASHTAB_H) $(RECOG_H) $(VARRAY_H) \ + $(OBSTACK_H) dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h -et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) et-forest.h alloc-pool.h + hard-reg-set.h $(BASIC_BLOCK_H) et-forest.h errors.h $(OBSTACK_H) +et-forest.o : et-forest.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + et-forest.h alloc-pool.h $(BASIC_BLOCK_H) combine.o : combine.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(FLAGS_H) function.h insn-config.h $(INSN_ATTR_H) $(REGS_H) $(EXPR_H) \ rtlhooks-def.h $(BASIC_BLOCK_H) $(RECOG_H) real.h hard-reg-set.h \ - toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) + toplev.h $(TM_P_H) $(TREE_H) $(TARGET_H) output.h $(PARAMS_H) $(OPTABS_H) \ + insn-codes.h regclass.o : regclass.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ hard-reg-set.h $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ $(RECOG_H) reload.h real.h toplev.h function.h output.h $(GGC_H) \ - $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) gt-regclass.h -local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ - output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H) + $(TM_P_H) $(EXPR_H) $(TIMEVAR_H) gt-regclass.h $(HASHTAB_H) +local-alloc.o : local-alloc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \ + output.h function.h $(INSN_ATTR_H) toplev.h except.h $(TM_P_H) \ + $(INTEGRATE_H) bitmap.o : bitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(FLAGS_H) $(BASIC_BLOCK_H) $(REGS_H) $(GGC_H) gt-bitmap.h -global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - reload.h function.h $(RECOG_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h\ - insn-config.h output.h toplev.h $(TM_P_H) -varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h $(GGC_H) errors.h \ - $(HASHTAB_H) -vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) coretypes.h vec.h $(GGC_H) errors.h -reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) output.h \ - $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \ - $(REGS_H) function.h real.h toplev.h $(TM_P_H) $(PARAMS_H) -reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h $(FLAGS_H) \ + $(FLAGS_H) $(GGC_H) gt-bitmap.h bitmap.h $(OBSTACK_H) +global.o : global.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) reload.h function.h $(RECOG_H) $(REGS_H) hard-reg-set.h \ + insn-config.h output.h toplev.h $(TM_P_H) $(MACHMODE_H) +varray.o : varray.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) \ + errors.h $(HASHTAB_H) $(BCONFIG_H) $(VARRAY_H) +vec.o : vec.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) coretypes.h vec.h $(GGC_H) \ + errors.h +reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) output.h $(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) \ + hard-reg-set.h insn-config.h $(REGS_H) function.h real.h toplev.h \ + $(TM_P_H) $(PARAMS_H) $(TARGET_H) +reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h $(TM_P_H) \ - except.h $(TREE_H) + except.h $(TREE_H) real.h $(FLAGS_H) $(MACHMODE_H) $(OBSTACK_H) rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - rtlhooks-def.h $(EXPR_H) -postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h $(FLAGS_H) \ - $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \ - $(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h cselib.h $(TM_P_H) \ - except.h $(TREE_H) -postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) real.h insn-config.h $(GGC_H) \ - $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) \ - except.h $(TREE_H) + rtlhooks-def.h $(EXPR_H) $(RECOG_H) +postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) real.h $(FLAGS_H) $(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) \ + hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(RECOG_H) output.h \ + function.h toplev.h cselib.h $(TM_P_H) except.h $(TREE_H) $(MACHMODE_H) \ + $(OBSTACK_H) +postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) real.h insn-config.h \ + $(RECOG_H) $(EXPR_H) $(BASIC_BLOCK_H) function.h output.h toplev.h \ + $(TM_P_H) except.h $(TREE_H) $(TARGET_H) $(HASHTAB_H) intl.h $(OBSTACK_H) \ + $(PARAMS_H) caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ $(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) function.h \ $(RECOG_H) reload.h $(EXPR_H) toplev.h $(TM_P_H) bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) except.h \ - $(BASIC_BLOCK_H) $(RTL_H) hard-reg-set.h $(REGS_H) $(OBSTACK_H) $(TM_P_H) \ - $(FIBHEAP_H) output.h $(TARGET_H) $(EXPR_H) $(FLAGS_H) $(INSN_ATTR_H) -reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) conditions.h \ - hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h $(INSN_ATTR_H) except.h \ - $(RECOG_H) function.h $(FLAGS_H) output.h $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H) -alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(FLAGS_H) \ - hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h $(ALIAS_H) $(EMIT_RTL_H) \ - $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) langhooks.h $(TARGET_H) \ - gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) + $(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h \ + $(TARGET_H) $(EXPR_H) $(FLAGS_H) $(INSN_ATTR_H) function.h +reorg.o : reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + conditions.h hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) insn-config.h \ + $(INSN_ATTR_H) except.h $(RECOG_H) function.h $(FLAGS_H) output.h \ + $(EXPR_H) toplev.h $(PARAMS_H) $(TM_P_H) $(OBSTACK_H) $(RESOURCE_H) +alias.o : alias.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(FLAGS_H) hard-reg-set.h $(BASIC_BLOCK_H) $(REGS_H) toplev.h output.h \ + $(ALIAS_H) $(EMIT_RTL_H) $(GGC_H) function.h cselib.h $(TREE_H) $(TM_P_H) \ + langhooks.h $(TARGET_H) gt-alias.h $(TIMEVAR_H) $(CGRAPH_H) \ + $(SPLAY_TREE_H) $(VARRAY_H) regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-config.h \ $(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) function.h \ $(EXPR_H) $(BASIC_BLOCK_H) toplev.h $(TM_P_H) except.h reload.h ddg.o : ddg.c $(DDG_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \ - toplev.h $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) regs.h function.h $(FLAGS_H) \ - insn-config.h insn-attr.h except.h $(RECOG_H) $(SCHED_INT_H) \ - $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) -modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) \ - $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TARGET_H) \ - toplev.h $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) regs.h function.h $(FLAGS_H) \ - insn-config.h insn-attr.h except.h $(RECOG_H) $(SCHED_INT_H) \ - $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) params.h $(COVERAGE_H) + toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) function.h \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ + $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) bitmap.h $(DF_H) \ + hard-reg-set.h sbitmap.h $(TM_H) +modulo-sched.o : modulo-sched.c $(DDG_H) $(CONFIG_H) $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h $(TARGET_H) toplev.h $(RTL_H) $(TM_P_H) $(REGS_H) function.h \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) except.h $(RECOG_H) \ + $(SCHED_INT_H) $(CFGLAYOUT_H) $(CFGLOOP_H) $(EXPR_H) $(PARAMS_H) \ + cfghooks.h $(DF_H) $(GCOV_IO_H) hard-reg-set.h $(TM_H) haifa-sched.o : haifa-sched.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(SCHED_INT_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h function.h \ + $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h function.h \ $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(TARGET_H) -sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(SCHED_INT_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h $(PARAMS_H) $(TM_P_H) -sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(SCHED_INT_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) $(TM_P_H) $(TARGET_H) -sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(SCHED_INT_H) $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h function.h \ - $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) $(PARAMS_H) -sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) $(REGS_H) $(TM_P_H) \ - $(TARGET_H) real.h -final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) \ - function.h real.h output.h hard-reg-set.h except.h debug.h xcoffout.h \ - toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) \ - $(EXPR_H) -recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) function.h \ - $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ - $(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H) -reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h toplev.h reload.h \ - varray.h function.h $(TM_P_H) $(GGC_H) gt-reg-stack.h basic-block.h +sched-deps.o : sched-deps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + function.h $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h cselib.h \ + $(PARAMS_H) $(TM_P_H) $(DF_H) +sched-rgn.o : sched-rgn.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + function.h $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(PARAMS_H) \ + $(TM_P_H) $(TARGET_H) $(CFGLAYOUT_H) +sched-ebb.o : sched-ebb.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) insn-config.h \ + function.h $(INSN_ATTR_H) toplev.h $(RECOG_H) except.h $(TM_P_H) \ + $(PARAMS_H) $(CFGLAYOUT_H) $(TARGET_H) +sched-vis.o : sched-vis.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(SCHED_INT_H) hard-reg-set.h $(BASIC_BLOCK_H) $(INSN_ATTR_H) \ + $(REGS_H) $(TM_P_H) $(TARGET_H) real.h toplev.h +final.o : final.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) intl.h $(REGS_H) $(RECOG_H) conditions.h \ + insn-config.h $(INSN_ATTR_H) function.h real.h output.h hard-reg-set.h \ + except.h debug.h xcoffout.h toplev.h reload.h dwarf2out.h \ + $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H) $(EXPR_H) $(CFGLAYOUT_H) dbxout.h +recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + function.h $(BASIC_BLOCK_H) $(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h \ + $(FLAGS_H) insn-config.h $(INSN_ATTR_H) real.h toplev.h output.h reload.h \ + $(TM_P_H) +reg-stack.o : reg-stack.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) $(RECOG_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \ + insn-config.h toplev.h reload.h function.h $(TM_P_H) $(GGC_H) \ + gt-reg-stack.h $(BASIC_BLOCK_H) output.h $(VARRAY_H) sreal.o: sreal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) sreal.h -predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h \ - $(RECOG_H) function.h except.h $(EXPR_H) $(TM_P_H) $(PREDICT_H) sreal.h \ - $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) $(COVERAGE_H) tree-scalar-evolution.h +predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(FLAGS_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) \ + hard-reg-set.h output.h toplev.h $(RECOG_H) function.h except.h $(EXPR_H) \ + $(TM_P_H) $(PREDICT_H) sreal.h $(PARAMS_H) $(TARGET_H) $(CFGLOOP_H) \ + $(COVERAGE_H) $(SCEV_H) $(GGC_H) predict.def $(TIMEVAR_H) $(TREE_DUMP_H) \ + $(TREE_FLOW_H) tree-pass.h lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \ $(RTL_H) $(GGC_H) gt-lists.h bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(BASIC_BLOCK_H) $(FLAGS_H) $(TIMEVAR_H) output.h $(CFGLAYOUT_H) $(FIBHEAP_H) \ - $(TARGET_H) function.h $(TM_P_H) $(OBSTACK_H) $(EXPR_H) $(REGS_H) -tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \ - $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) $(FLAGS_H) $(TIMEVAR_H) \ - $(PARAMS_H) $(COVERAGE_H) + $(RTL_H) $(FLAGS_H) $(TIMEVAR_H) output.h $(CFGLAYOUT_H) $(FIBHEAP_H) \ + $(TARGET_H) function.h $(TM_P_H) $(OBSTACK_H) $(EXPR_H) $(REGS_H) \ + errors.h $(PARAMS_H) +tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ + $(TREE_H) $(BASIC_BLOCK_H) hard-reg-set.h output.h $(CFGLAYOUT_H) \ + $(FLAGS_H) $(TIMEVAR_H) $(PARAMS_H) $(COVERAGE_H) $(FIBHEAP_H) cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \ - function.h $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h $(GGC_H) -timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TIMEVAR_H) $(FLAGS_H) \ - intl.h toplev.h -regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h $(RECOG_H) function.h \ - $(RESOURCE_H) $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) + function.h $(CFGLAYOUT_H) $(CFGLOOP_H) $(TARGET_H) gt-cfglayout.h \ + $(GGC_H) alloc-pool.h $(FLAGS_H) $(OBSTACK_H) +timevar.o : timevar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(TIMEVAR_H) $(FLAGS_H) intl.h toplev.h $(RTL_H) timevar.def +regrename.o : regrename.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) insn-config.h $(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h \ + output.h $(RECOG_H) function.h $(OBSTACK_H) $(FLAGS_H) $(TM_P_H) \ + reload.h toplev.h ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \ - $(REGS_H) toplev.h $(FLAGS_H) insn-config.h function.h $(RECOG_H) $(TARGET_H) \ - $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) real.h $(OPTABS_H) \ - $(CFGLOOP_H) -lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) $(TM_H) -lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) $(TM_H) + $(REGS_H) toplev.h $(FLAGS_H) insn-config.h function.h $(RECOG_H) \ + $(TARGET_H) $(BASIC_BLOCK_H) $(EXPR_H) output.h except.h $(TM_P_H) \ + real.h $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h +lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ + $(TM_H) coretypes.h $(TREE_H) $(VARRAY_H) +lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ + $(TM_H) coretypes.h errors.h $(TARGET_H) $(TREE_H) $(VARRAY_H) lambda-code.o: lambda-code.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \ - errors.h $(TM_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) diagnostic.h \ - $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) cfgloop.h \ - $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) + errors.h $(TM_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \ + $(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \ + $(TREE_DATA_REF_H) $(SCEV_H) $(EXPR_H) coretypes.h $(TARGET_H) \ + tree-chrec.h tree-pass.h vec.h params.o : params.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(PARAMS_H) toplev.h pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H) hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H) pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H) \ $(TREE_H) -errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h +errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(BCONFIG_H) $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_H) \ $(RTL_H) $(REGS_H) hard-reg-set.h real.h insn-config.h conditions.h \ @@ -2217,21 +2355,25 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) $(GGC_ mips-tfile: mips-tfile.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tfile.o version.o $(LIBS) -mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h +mips-tfile.o : mips-tfile.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) version.h getopt.h gstab.h intl.h mips-tdump: mips-tdump.o version.o $(LIBDEPS) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mips-tdump.o version.o $(LIBS) -mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h $(TM_H) version.h +mips-tdump.o : mips-tdump.c $(CONFIG_H) $(RTL_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) version.h getopt.h stab.def # FIXME: writing proper dependencies for this is a *LOT* of work. libbackend.o : $(OBJS-common:.o=.c) $(out_file) \ insn-config.h insn-flags.h insn-codes.h insn-constants.h \ - insn-attr.h + insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ -DTARGET_NAME=\"$(target_noncanonical)\" \ -DLOCALEDIR=\"$(localedir)\" \ - -c $(filter %.c,$^) -o $@ -combine + -c $(filter %.c,$^) -o $@ \ + -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DDEVPHASE=$(DEVPHASE_s) -combine # # Generate header and source files from the machine description, @@ -2448,7 +2590,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \ $(srcdir)/dbxout.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \ $(srcdir)/dojump.c $(srcdir)/reload1.c \ $(srcdir)/emit-rtl.c $(srcdir)/except.c $(srcdir)/explow.c $(srcdir)/expr.c \ - $(srcdir)/function.c \ + $(srcdir)/function.c $(srcdir)/except.h \ $(srcdir)/gcse.c $(srcdir)/integrate.c $(srcdir)/lists.c $(srcdir)/optabs.c \ $(srcdir)/profile.c $(srcdir)/regclass.c \ $(srcdir)/reg-stack.c $(srcdir)/cfglayout.c \ @@ -2480,9 +2622,9 @@ gt-dwarf2out.h gt-reg-stack.h gt-dwarf2asm.h \ gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parser.h \ gt-c-pragma.h gtype-c.h gt-cfglayout.h \ gt-tree-mudflap.h gt-tree-complex.h \ -gt-tree-eh.h \ +gt-tree-profile.h \ gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \ -gt-tree-phinodes.h gt-tree-cfg.h gt-tree-nested.h \ +gt-tree-phinodes.h gt-tree-nested.h \ gt-tree-ssa-operands.h gt-tree-ssa-propagate.h \ gt-stringpool.h : s-gtype ; @true @@ -2543,7 +2685,8 @@ genobjnames=$(genprognames:%=%.o) read-rtl.o gensupport.o genattrtab.o \ genconstants.o gen-protos.o scan.o fix-header.o scan-decls.o \ gencheck.o dummy-conditions.o genconditions.o errors.o ggc-none.o \ min-insn-modes.o rtl.o print-rtl.o varray.o gcov-iov.o \ - insn-conditions.o gengtype-lex.o gengtype-yacc.o genmddeps.o + insn-conditions.o gengtype-lex.o gengtype-yacc.o genmddeps.o \ + genchecksum.o genobjs=$(genobjnames:%=build/%) @@ -2621,7 +2764,8 @@ build/genattrtab.o : genattrtab.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(GGC_H) gensupport.h genattrtab.h build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) $(BCONFIG_H) \ - $(SYSTEM_H) coretypes.h $(GTM_H) errors.h varray.h genattrtab.h $(HASHTAB_H) + $(SYSTEM_H) coretypes.h $(GTM_H) errors.h $(VARRAY_H) genattrtab.h \ + $(HASHTAB_H) build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) \ $(SYSTEM_H) coretypes.h $(GTM_H) errors.h gensupport.h @@ -2682,13 +2826,14 @@ build/genconditions.o : genconditions.c $(RTL_BASE_H) $(BCONFIG_H) \ build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h build/ggc-none.o : ggc-none.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) -build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) system.h $(MACHMODE_H) +build/min-insn-modes.o : min-insn-modes.c $(BCONFIG_H) $(SYSTEM_H) \ + $(MACHMODE_H) build/rtl.o: rtl.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) $(RTL_H) \ real.h $(GGC_H) errors.h build/print-rtl.o: print-rtl.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) \ $(RTL_BASE_H) build/varray.o: varray.c $(BCONFIG_H) coretypes.h $(GTM_H) $(SYSTEM_H) \ - varray.h $(RTL_BASE_H) $(GGC_H) $(TREE_H) bitmap.h errors.h + $(VARRAY_H) $(RTL_BASE_H) $(GGC_H) $(TREE_H) bitmap.h errors.h # # Remake internationalization support. @@ -2730,7 +2875,7 @@ unprotoize$(exeext): unprotoize.o $(PROTO_OBJS) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ unprotoize.o $(PROTO_OBJS) $(LIBS) protoize.o: protoize.c $(srcdir)/../include/getopt.h $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h $(TM_H) Makefile version.h + coretypes.h $(TM_H) Makefile version.h cppdefault.h intl.h (SHLIB_LINK='$(SHLIB_LINK)' \ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ @@ -2799,8 +2944,10 @@ s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE) $(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h $(STAMP) s-iov -gcov.o: gcov.c gcov-io.h gcov-io.c gcov-iov.h intl.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) -gcov-dump.o: gcov-dump.c gcov-io.h gcov-io.c gcov-iov.h $(SYSTEM_H) coretypes.h $(TM_H) $(CONFIG_H) +gcov.o: gcov.c gcov-io.c $(GCOV_IO_H) intl.h $(SYSTEM_H) coretypes.h $(TM_H) \ + $(CONFIG_H) version.h +gcov-dump.o: gcov-dump.c gcov-io.c $(GCOV_IO_H) $(SYSTEM_H) coretypes.h \ + $(TM_H) $(CONFIG_H) GCOV_OBJS = gcov.o intl.o version.o errors.o gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS) @@ -3171,6 +3318,8 @@ mostlyclean: lang.mostlyclean # Delete files generated by gengtype.c -rm -f gtype-* -rm -f gt-* +# Delete genchecksum outputs + -rm -f *-checksum.c # Delete all files made by compilation # that don't exist in the distribution. @@ -3424,6 +3573,13 @@ install-include-dir: installdirs mkdir $(DESTDIR)$(libsubdir)/include -chmod a+rx $(DESTDIR)$(libsubdir)/include +# Create or recreate the install-tools include file directory. +itoolsdir = $(libexecsubdir)/install-tools +itoolsdatadir = $(libsubdir)/install-tools +install-itoolsdirs: installdirs + $(mkinstalldirs) $(DESTDIR)$(itoolsdatadir)/include + $(mkinstalldirs) $(DESTDIR)$(itoolsdir) + # Install the include directory using tar. install-headers-tar: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir # We use `pwd`/include instead of just include to problems with CDPATH @@ -3446,10 +3602,8 @@ install-headers-cpio: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir install-headers-cp: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir cp -p -r include $(DESTDIR)$(libsubdir) -itoolsdir = $(libexecsubdir)/install-tools -itoolsdatadir = $(libsubdir)/install-tools # Install supporting files for fixincludes to be run later. -install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-include-dir \ +install-mkheaders: stmp-int-hdrs $(STMP_FIXPROTO) install-itoolsdirs \ macro_list xlimits.h for file in $(USER_H); do \ realfile=`echo $$file | sed -e 's|.*/\([^/]*\)$$|\1|'`; \ @@ -3726,7 +3880,7 @@ STAGEPROFILE_FLAGS_TO_PASS = \ # Files never linked into the final executable produces warnings about missing # profile. STAGEFEEDBACK_FLAGS_TO_PASS = \ - CFLAGS="$(BOOT_CFLAGS) -fprofile-use" + CFLAGS="$(BOOT_CFLAGS) -fprofile-use -freorder-blocks-and-partition" # Only build the C compiler for stage1, because that is the only one that # we can guarantee will build with the native compiler, and also it is the @@ -3934,23 +4088,32 @@ fastcompare fastcompare3 fastcompare4 fastcompare-lean fastcompare3-lean fastcom gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force -rm -f .bad_compare case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \ - for dir in . $(SUBDIRS); do \ + for dir in . $(SUBDIRS) libgcc; do \ if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \ for file in $$dir/*$(objext); do \ - case "$@" in \ - slowcompare* ) \ - tail +16c ./$$file > tmp-foo1; \ - tail +16c stage$$stage/$$file > tmp-foo2 \ - && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \ - ;; \ - fastcompare* ) \ - cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \ - test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ - ;; \ - gnucompare* ) \ - cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \ - test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ + case $$file in \ + ./cc*-checksum$(objext) | libgcc/* ) \ + tail +16c ./$$file > tmp-foo1 \ + && tail +16c stage$$stage/$$file > tmp-foo2 \ + && ( cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 \ + || echo warning: $$file differs || true ) \ ;; \ + *) case "$@" in \ + slowcompare* ) \ + tail +16c ./$$file > tmp-foo1; \ + tail +16c stage$$stage/$$file > tmp-foo2 \ + && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 \ + || echo $$file differs >> .bad_compare) || true; \ + ;; \ + fastcompare* ) \ + cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \ + test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ + ;; \ + gnucompare* ) \ + cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \ + test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \ + ;; \ + esac ; \ esac ; \ done; \ else true; fi; \ @@ -4278,7 +4441,7 @@ install-po: # fairly modern (POSIX-compliant) awk. # The .pot file is left in the build directory. gcc.pot: po/gcc.pot -po/gcc.pot: force options.c +po/gcc.pot: force -test -d po || mkdir po $(MAKE) srcextra AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \ diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index dfcc20be148..98c56a47af0 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -1,7 +1,5 @@ -m4_include([../config/accross.m4]) m4_include([../config/acx.m4]) m4_include([../config/gettext-sister.m4]) -m4_include([../config/gcc-lib-path.m4]) m4_include([../config/iconv.m4]) m4_include([../config/lcmessage.m4]) m4_include([../config/lib-ld.m4]) @@ -656,3 +654,25 @@ AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) + + +dnl GCC_TARGET_TEMPLATE(KEY) +dnl ------------------------ +dnl Define KEY as a valid configure key on the target machine. + +m4_define([GCC_TARGET_TEMPLATE], +[m4_define([GCC_TARGET_TEMPLATE($1)],[])]) + +dnl AH_TEMPLATE(KEY, DESCRIPTION) +dnl ----------------------------- +dnl Issue an autoheader template for KEY, i.e., a comment composed of +dnl DESCRIPTION (properly wrapped), and then #undef KEY. Redefinition +dnl of the macro in autoheader.m4, to support definition of only a few +dnl keys while compiling target libraries. + +m4_define([AH_TEMPLATE], +[AH_VERBATIM([$1],m4_text_wrap([$2 */], [ ], [/* ]) +m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[#ifndef USED_FOR_TARGET +])[#undef $1]m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[ +#endif +]))]) diff --git a/gcc/ada/5xcrtl.ads b/gcc/ada/5xcrtl.ads deleted file mode 100644 index dd3292e384a..00000000000 --- a/gcc/ada/5xcrtl.ads +++ /dev/null @@ -1,159 +0,0 @@ ------------------------------------------------------------------------------- --- -- --- GNAT RUN-TIME COMPONENTS -- --- -- --- S Y S T E M . C R T L -- --- -- --- S p e c -- --- -- --- Copyright (C) 2004 Free Software Foundation, Inc. -- --- -- --- GNAT is free software; you can redistribute it and/or modify it under -- --- terms of the GNU General Public License as published by the Free Soft- -- --- ware Foundation; either version 2, or (at your option) any later ver- -- --- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- --- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- --- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- --- for more details. You should have received a copy of the GNU General -- --- Public License distributed with GNAT; see file COPYING. If not, write -- --- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- --- MA 02111-1307, USA. -- --- -- --- As a special exception, if other files instantiate generics from this -- --- unit, or you link this unit with other files to produce an executable, -- --- this unit does not by itself cause the resulting executable to be -- --- covered by the GNU General Public License. This exception does not -- --- however invalidate any other reasons why the executable file might be -- --- covered by the GNU Public License. -- --- -- --- GNAT was originally developed by the GNAT team at New York University. -- --- Extensive contributions were provided by Ada Core Technologies Inc. -- --- -- ------------------------------------------------------------------------------- - --- This package provides the low level interface to the C Run Time Library --- on 64 bit VMS - -with System.Parameters; -package System.CRTL is -pragma Preelaborate (CRTL); - - subtype chars is System.Address; - -- Pointer to null-terminated array of characters - - subtype FILEs is System.Address; - -- Corresponds to the C type FILE* - - subtype int is Integer; - - type long is range -(2 ** (System.Parameters.long_bits - 1)) - .. +(2 ** (System.Parameters.long_bits - 1)) - 1; - - subtype off_t is Integer; - - type size_t is mod 2 ** Standard'Address_Size; - - function atoi (A : System.Address) return Integer; - pragma Import (C, atoi, "decc$atoi"); - - procedure clearerr (stream : FILEs); - pragma Import (C, clearerr, "decc$clearerr"); - - function fclose (stream : FILEs) return int; - pragma Import (C, fclose, "decc$fclose"); - - function fdopen (handle : int; mode : chars) return FILEs; - pragma Import (C, fdopen, "decc$fdopen"); - - function fflush (stream : FILEs) return int; - pragma Import (C, fflush, "decc$fflush"); - - function fgetc (stream : FILEs) return int; - pragma Import (C, fgetc, "decc$fgetc"); - - function fgets (strng : chars; n : int; stream : FILEs) return chars; - pragma Import (C, fgets, "decc$fgets"); - - function fopen (filename : chars; Mode : chars) return FILEs; - pragma Import (C, fopen, "decc$fopen"); - - function fputc (C : int; stream : FILEs) return int; - pragma Import (C, fputc, "decc$fputc"); - - function fputs (Strng : chars; Stream : FILEs) return int; - pragma Import (C, fputs, "decc$fputs"); - - procedure free (Ptr : System.Address); - pragma Import (C, free, "decc$free"); - - function freopen - (filename : chars; - mode : chars; - stream : FILEs) - return FILEs; - pragma Import (C, freopen, "decc$freopen"); - - function fseek - (stream : FILEs; - offset : long; - origin : int) - return int; - pragma Import (C, fseek, "decc$fseek"); - - function ftell (stream : FILEs) return long; - pragma Import (C, ftell, "decc$ftell"); - - function getenv (S : String) return System.Address; - pragma Import (C, getenv, "decc$getenv"); - - function isatty (handle : int) return int; - pragma Import (C, isatty, "decc$isatty"); - - function lseek (fd : int; offset : off_t; direction : int) return off_t; - pragma Import (C, lseek, "decc$lseek"); - - function malloc (Size : size_t) return System.Address; - pragma Import (C, malloc, "decc$_malloc64"); - - procedure memcpy (S1 : System.Address; S2 : System.Address; N : size_t); - pragma Import (C, memcpy, "decc$_memcpy64"); - - procedure memmove (S1 : System.Address; S2 : System.Address; N : size_t); - pragma Import (C, memmove, "decc$_memmove64"); - - procedure mktemp (template : chars); - pragma Import (C, mktemp, "decc$_mktemp64"); - - function read (fd : int; buffer : chars; nbytes : int) return int; - pragma Import (C, read, "decc$read"); - - function realloc - (Ptr : System.Address; Size : size_t) return System.Address; - pragma Import (C, realloc, "decc$_realloc64"); - - procedure rewind (stream : FILEs); - pragma Import (C, rewind, "decc$rewind"); - - function setvbuf - (stream : FILEs; - buffer : chars; - mode : int; - size : size_t) - return int; - pragma Import (C, setvbuf, "decc$setvbuf"); - - procedure tmpnam (string : chars); - pragma Import (C, tmpnam, "decc$_tmpnam64"); - - function tmpfile return FILEs; - pragma Import (C, tmpfile, "decc$tmpfile"); - - function ungetc (c : int; stream : FILEs) return int; - pragma Import (C, ungetc, "decc$ungetc"); - - function unlink (filename : chars) return int; - pragma Import (C, unlink, "decc$unlink"); - - function write (fd : int; buffer : chars; nbytes : int) return int; - pragma Import (C, write, "decc$write"); -end System.CRTL; diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 98901bd5562..a08251e21b0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,597 @@ +2005-05-16 Nathanael Nerode + + PR ada/20270 + * Makefile.in: Make TGT_LIB behave correctly. + +2005-04-23 DJ Delorie + + * misc.c: Adjust warning() callers. + +2005-04-16 Laurent GUERBY + + PR ada/18847 + * a-nudira.adb (Value): Check for valid string. + * a-nuflra.adb (Value): Likewise. + +2005-04-11 Richard Sandiford + + * lang.opt: Refer to the GCC internals documentation instead of c.opt. + +2005-04-10 Kazu Hirata + + * adaint.c, init.c, tracebak.c: Fix comment typos. + * gnat-style.texi, gnat_rm.texi, gnat_ugn.texi: Fix typos. + +2005-04-07 Laurent GUERBY + John David Anglin + + * Makefile.in: Add make ifeq define for hppa linux tasking support. + * system-hpux.ads: Define Signed_Zeros to be True. + * system-linux-hppa.ads, s-osinte-linux-hppa.ads: New files. + +2005-04-01 Kazu Hirata + + * adaint.c, cal.c, decl.c, gigi.h, gmem.c, init.c, link.c, + raise.c, tracebak.c, trans.c, utils2.c, utils.c: Fix comment + typos. + +2005-03-30 Tom Tromey + + * decl.c (gnat_substitute_in_type): Don't handle FILE_TYPE. + +2005-03-30 Aaron W. LaFramboise + + * adaint.c (_gnat_set_close_on_exec): Mark parameters unused. + +2005-03-29 Robert Dewar + + * sem_res.adb (Resolve_Real_Literal): Generate warning if static + fixed-point expression has value that is not a multiple of the Small + value. + + * opt.ads (Warn_On_Bad_Fixed_Value): New flag + + * s-taprop-tru64.adb (RT_Resolution): Return an integer number of + nanoseconds. + + * ug_words: Add entry for [NO_]BAD_FIXED_VALUES for -gnatwb/-gnatwB + +2005-03-29 Vincent Celier + + * mlib-tgt-vms-ia64.adb, mlib-tgt-vms-alpha.adb + (Build_Dynamic_Library.Version_String): Return the empty string when + Lib_Version is empty or when the symbol policy is not Autonomous. + + * symbols-vms-alpha.adb (Finalize): For symbol policy Compliant, when + a symbol is not in the reference symbol file, increase the Major ID + and set the Minor ID to 0. + Use gsmatch=lequal instead of gsmatch=equal + +2005-03-29 Doug Rupp + + * adaint.c (__gnat_to_canonical_file_spec [VMS]): Check for logical + name and translate. + +2005-03-29 Javier Miranda + + * a-tags.ads, a-tags.adb (Get_TSD): Subprogram removed. + (Inherit_DT): The first formal has been redefined as a Tag. + This allows us the removal of the subprogram Get_TSD. + (TSD): Replace the call to Get_TSD by the actual code. + + * exp_disp.ads, exp_disp.adb: Remove support to call Get_TSD. + (Make_DT): Upgrade the call to Inherit_TSD according to the + new interface: the first formal is now a Tag. + + * i-cpp.ads, i-cpp.adb (CPP_Inherit_DT): The first formal has been + redefined as a Tag. + This change allows us to remove the subprogram Get_TSD. + (CPP_Get_TSD): Subprogram removed. + (TSD): Replace the call to CPP_Get_TSD by the actual code. + + * rtsfind.ads: Remove support to call the run-time + subprogram Get_TSD + +2005-03-29 Robert Dewar + + * errutil.adb, errout.adb: + Minor comment updates on Line_Terminator references + + * par-ch10.adb: Add ??? comment about line terminator + + * styleg.adb (Check_Line_Terminator): Add check for new switch -gnatyd + (check dos line terminator). + (Check_Line_Max_Length): New procedure, split off from the existing + Check_Line_Terminator routine. Separating this out allows -gnatyf to + be properly recognized. + + * styleg.adb: Add ??? comment for line terminator reference + + * scng.adb (Check_End_Of_Line): Fix bug of -gnatyf being ignored + (Check_End_Of_Line): Add -gnatyd handling (check dos line terminators) + + * styleg.ads (Check_Line_Terminator): Add check for new switch -gnatyd + (check dos line terminator). + (Check_Line_Max_Length): New procedure, split off from the existing + Check_Line_Terminator routine. Separating this out allows -gnatyf to + be properly recognized. + + * stylesw.ads, stylesw.adb: + Add handling for new -gnatyd switch (check dos line terminator) + + * switch-c.adb: Recognize new -gnatyd switch (check dos line terminator) + Recognize -gnatwb/-gnatwB switches + Include Warn_On_Bad_Fixed_Value for -gnatg + + * usage.adb: + Add line for new -gnatyd switch (check dos line terminator) + + * usage.adb: Add lines for -gnatwb/-gnatwB + + * vms_data.ads: Add entry for NOCRLF (-gnatyd) + + * vms_data.ads: [NO_]BAD_FIXED_VALUES synonym for -gnatwb/-gnatwB + + * gnat_ugn.texi: Fix overlong lines + Document new -gnatyd switch + Document new -gnatwb/-gnatwB switches + +2005-03-29 Ed Schonberg + + * exp_ch4.adb (Has_Unconstrained_UU_Component): Use the base type in + order to retrieve the component list of the type, before examining + individual components. + + * sem_type.adb (Covers): Types are compatible if one is the base type + of the other, even though their base types might differ when private + views are involved. + +2005-03-29 Thomas Quinot + + * exp_dist.adb (Add_RAST_Features, PolyORB version): Set the From_Any, + To_Any and TypeCode TSSs on RAS types directly using Set_TSS, instead + of using Set_Renaming_TSS. This ensures that the TSS bodies are not + analyzed if expansion is disabled (which could otherwise cause spurious + error messages if expansion has been disabled due to previous + (unrelated) errors). + + * sem_prag.adb (Analyze_Pragma, case Asynchronous): If RAS expansion + is disabled, the entity denoted by the argument is the access type + itself, not an underlying record type, so there is no need to go back + to the Corresponding_Remote_Type. + +2005-03-29 Gary Dismukes + Robert Dewar + + * exp_intr.adb (Expand_Dispatching_Constructor_Call): New procedure to + expand a call to an instance of + Ada.Tags.Generic_Dispatching_Constructor into a dispatching call to the + Constructor actual of the instance. A class-wide membership + check is also generated, to ensure that the tag passed to the instance + denotes a type in the class. + (Expand_Intrinsic_Call): Call Expand_Dispatching_Constructor in the case + of Name_Generic_Dispatching_Constructor. + + * Makefile.rtl: Add a-tgdico.ads to the list of library units (new Ada + 05 unit for AI-260-02). + + * a-tgdico.ads: New file. + + * impunit.adb (Non_Imp_File_Names_05): Add entry "a-tgdico" for new + predefined Ada 05 generic unit Ada.Tags.Generic_Dispatching_Constructor. + + * snames.ads, snames.adb (Preset_Names): Add entry for + Generic_Dispatching_Constructor. + + PR ada/20300 + + * sem_ch8.adb (Find_Direct_Name): Go to root type for check of + character type cases. + (Analyze_Subprogram_Renaming): Add special handling for + the case of renaming of stream attributes when the renaming denotes a + generic formal subprogram association for an abstract formal subprogram. + Check that the attribute is a primitive stream attribute (and not + a class-wide stream attribute) and then rewrite the attribute name + as the name of the appropriate compiler-generated stream primitive. + +2005-03-29 Robert Dewar + + * exp_util.adb (Remove_Side_Effects): Properly propagate arguments to + recursive calls. + (Is_Possibly_Unaligned_Object): Correct typo that + resulted in inaccurate result for unaligned scalars within records. + +2005-03-29 Ed Schonberg + + * freeze.adb (Freeze_Record_Type): If the type of the component is an + itype whose parent is controlled and not yet frozen, do not create a + freeze node for the itype if expansion is disabled. + +2005-03-29 Vincent Celier + + * make.adb (Gnatmake): Don't fail if the main project file is declared + as having no Ada sources. Do not display message "no sources to + compile" in quiet output. + +2005-03-29 Doug Rupp + + * Makefile.in [VMS] (EXTRA_GNATTOOLS): Add vms_help and gnat.hlp as + extra tools. + +2005-03-29 Robert Dewar + + * par-ch12.adb (P_Generic): Give better msg for illegal private generic + child. + +2005-03-29 Robert Dewar + + * par-ch3.adb (P_Type_Declaration): Fix bad error recovery after + missing TYPE Improve the error message generated when compiling a + limited interface in Ada83 or Ada95 mode. + +2005-03-29 Robert Dewar + + * par-ch4.adb (P_Name): When a bad attribute is returned, return error, + rather than proceed ahead using a junk attribute name. + +2005-03-29 Vincent Celier + + * prj.ads, prj.adb: (Project_Data): Add new component Display_Name + + * prj-part.adb (Parse_Single_Project): Set the location of a project + on its defining identifier, rather than on the reserved word "project". + + * prj-proc.adb (Expression): Adapt to the fact that default of external + references may be string expressions, not always literal strings. + (Recursive_Process): Set Display_Name equal to Name + when Location is No_Location, that is when there is no actual file. + Get the Display_Name of the project from the source, when it is not a + virtual project. + (Process): Use the Display_Name in error messages + + * prj-strt.adb (External_Reference): Allow default to be string + expressions, not only literal strings. + +2005-03-29 Vincent Celier + + * prj-nmsc.adb (Check_Stand_Alone_Library): Do not forbid the symbol + file and the reference symbol file to be the same file. + +2005-03-29 Thomas Quinot + + * sem_cat.adb (Validate_Remote_Types_Type_Conversion): Perform check to + forbid conversion of a local access-to-subprogram type to a remote one. + + * sem_util.adb (Wrong_Type): For a record type that is the expanded + equivalent type for a remote access-to-subprogram type, go back to the + original RAS entity when displaying an error message, so the casing is + the original source casing. + +2005-03-29 Robert Dewar + + * sem_ch11.adb (Analyze_Raise_Statement): Change message for warning + on param update. + +2005-03-29 Ed Schonberg + + * sem_ch4.adb (Analyze_Selected_Component): Do not generate an actual + subtype if code is being pre-analyzed, to prevent un-expanded + references to protected formals, among others. + (Analyze_Explicit_Dereference): If the overloaded prefix includes some + interpretation that can be a call, include the result of the call as a + possible interpretation of the dereference. + + * sem_ch5.adb (Process_Bounds): Determine type of range by + pre-analyzing a copy of the original range, and then analyze the range + with the expected type. + + * sem_res.adb (Check_Parameterless_Call): For an explicit dereference + with an overloaded prefix where not all interpretations yield an + access to subprogram, do not rewrite node as a call. + (Resolve_Explicit_Dereference): Recognize the previous case and rewrite + the node as a call once the context identifies the interpretation of + the prefix whose call yields the context type. + (Valid_Conversion): For the case of a conversion between + local access-to-subprogram types, check subtype conformance using + Check_Subtype_Conformant instead of Subtype_Conformant, to have a more + detailed error message. + +2005-03-29 Ed Schonberg + + * sem_ch6.adb (Set_Formal_Mode): If the subtype has a non_null + indicator, indicate that the formal can never be null. + (Process_Formals): If a formal has a non_null indicator, insert the + resulting subtype immediately before the enclosing subprogram decl, + and not at the beginning of the corresponding declarative part, to + prevent access before elaboration (Ada2005). + +2005-03-29 Richard Kenner + + PR ada/19956 + * utils.c (finish_record_type): Use variable_size when setting sizes. + +2005-03-29 Robert Dewar + + * xtreeprs.adb, xnmake.adb: Use Stream_IO instead of Text_IO to + guarantee Unix style line terminators for the output files, even when + running on windows. + +2005-03-29 Robert Dewar + + * a-direct.ads, a-direct.adb (Start_Search): Free allocated search + buffer if an exception is raised. + +2005-03-29 Ed Falis + + * cio.c: Undefine putchar and getchar for VTHREADS: incompatible with + VxWorks 653 1.4 + +2005-03-29 Robert Dewar + + * sem_util.ads: Minor reformatting + * gnat_rm.texi: Minor editing. + +2005-03-29 Eric Botcazou + + * decl.c (gnat_to_gnu_entity) : Rework comment. + * trans.c (tree_transform) : Use correct predicates. + +2005-03-24 Aaron W. LaFramboise + + * adaint.c (__gnat_portable_spawn): Adjust cast. + +2005-03-23 Joseph S. Myers + + * misc.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-17 Pascal Obry + + * adaint.h, adaint.c (__gnat_waitpid): Moved to expect.c where it is + used. + + * expect.c (__gnat_waitpid): Moved here from adaint.c. + Reimplement under Win32 using Win32 API. + + (__gnat_kill) [Win32]: Properly close the process handle before leaving + this routine. + +2005-03-17 Eric Botcazou + + * ada-tree.h: (DECL_RENAMING_GLOBAL_P): New predicate. + (DECL_RENAMED_OBJECT): New accessor macro. + (SET_DECL_RENAMED_OBJECT): New setter macro. + + * decl.c (gnat_to_gnu_entity) : Stabilize the renamed + object in all cases. Attach the renamed object to the VAR_DECL. + (gnat_to_gnu_field): Do not lift the record wrapper if the size of the + field is not prescribed. + + * misc.c (gnat_handle_option): Handle -gnatO separately. + (gnat_print_decl) : New case. + Print the DECL_RENAMED_OBJECT node. + + * lang.opt: Declare separate -gnatO option. + + * trans.c (tree_transform) : If the object is a renaming + pointer, replace it with the renamed object. + : Warn for a conversion to a fat + pointer type if the source is not a fat pointer type whose underlying + array has the same non-zero alias set as that of the destination array. + +2005-03-17 Javier Miranda + + * a-tags.ads, a-tags.adb (Get_Expanded_Name): Removed. + (Get_Inheritance_Depth): Removed. + (Set_Inheritance_Depth): Removed. + + * rtsfind.ads, exp_disp.ads, exp_disp.adb: Remove support to call the + subprogram Get_Expanded_Name because it is not referenced by the + frontend. + + * i-cpp.ads, i-cpp.adb (CPP_Get_Expanded_Name): Removed. + (CPP_Get_Inheritance_Depth): Removed. + (CPP_Set_Inheritance_Depth): Removed. + + * tbuild.ads, tbuild.adb (Make_DT_Component): Removed. + +2005-03-17 Robert Dewar + + * checks.adb (Apply_Array_Size_Check): Completely remove this for GCC + 3, since we now expect GCC 3 to do all the work. + +2005-03-17 Javier Miranda + + * einfo.adb (First_Private_Entity, Set_First_Private_Entity): Addition + of one barrier to avoid wrong usage of this attribute. + + * sem_ch12.adb (Formal_Entity): Fix erroneous usage of the attribute + First_Private_Entity. + + * sem_ch7.adb (Install_Visible_Declarations): Add a barrier to protect + the subprogram against wrong usage. + Adapt the code to traverse the entities in the + scope of a record_type because in addition to its usage regarding + packages, this subprogram is also called by Expand_N_Freeze_Entity + to install the visible declarations of the enclosing scope of a + record_type_with_private to establish the proper visibility before + freezing the entity and related subprograms. + +2005-03-17 Ed Schonberg + + * exp_ch2.adb (In_Assignment_Context): Recognize slice assignments to + entry formals. + +2005-03-17 Thomas Quinot + + * exp_ch3.adb (Check_Attr): New subprogram. + (Check_Stream_Attribute): Move the code for 13.13.2(9/1) enforcement + into a new Check_Attr subprogram, in order to provide a more + explanatory error message (including the name of the missing attribute). + (Stream_Operation_OK): Renamed from Stream_Operations_OK. This + subprogram determines whether a default implementation exists for a + given stream attribute. + (Make_Predefined_Primitive_Specs, Predefined_Primitive_Bodies): + Determine whether to generate a default implementation for each stream + attribute separately, as this depends on the specific attribute. + + * exp_strm.adb (Make_Field_Attribute): For the case of an illegal + limited extension where a stream attribute is missing for a limited + component (which will have been flagged in Exp_Ch3.Sem_Attr), do not + generate a bogus reference to the missing attribute to prevent + cascaded errors. Instead, generate a null statement. + + * sem_attr.adb (Check_Stream_Attribute): A stream attribute is + available for a limited type if it has been specified for an ancestor + of the type. + +2005-03-17 Ed Schonberg + + * exp_ch6.adb (Expand_Inlined_Call): handle the case when the renamed + entity is an operator. + +2005-03-17 Thomas Quinot + + * exp_dist.adb (Get_PCS_Name): Move from Exp_Dist body to Sem_Dist + spec, to make this predicate available to other units. + + * rtsfind.adb (Check_RPC): Use Sem_Dist.Get_PCS_Name instead of + reimplementing it. + + * sem_ch8.adb: Disable expansion of remote access-to-subprogram types + when no distribution runtime library is available. + + * sem_res.adb, sem_dist.adb: Disable expansion of remote + access-to-subprogram types when no distribution runtime library is + available. + (Get_PCS_Name): Move from Exp_Dist body to Sem_Dist spec, to make this + predicate available to other units. + + * sem_dist.ads (Get_PCS_Name): Move from Exp_Dist body to Sem_Dist + spec, to make this predicate available to other units. + +2005-03-17 Vincent Celier + + * make.adb (Insert_Project_Sources): Make sure the Q is always + initialized. + + * prj-nmsc.adb (Check_Ada_Naming_Scheme_Validity): Check Naming against + the default for the tree, not the global default naming. + + * prj-proc.adb (Recursive_Process): No need to put the default naming + in the project data, it's already there. + +2005-03-17 Doug Rupp + + * Makefile.in: (ia64-hp-*vms*): Use s-crtl-vms64.ads. + + * 5xcrtl.ads: Renamed to... + * s-crtl-vms64.ads: ...this new file + +2005-03-17 Robert Dewar + + PR ada/19519 + + * namet.adb (Copy_One_Character): Set proper wide character encoding + for upper half character if we have upper half encoding. + +2005-03-17 Robert Dewar + + * par.adb (Par): Improved msg for attempt to recompile predefined unit + +2005-03-17 Thomas Quinot + + * sem_ch13.adb (New_Stream_Function, New_Stream_Procedure): For a + tagged limited type, the TSS is a newly built renaming declaration: + insert it using Set_TSS, not Copy_TSS. + +2005-03-17 Javier Miranda + + * sem_ch4.adb (Try_Primitive_Operation, Class_Wide_Operation and + Try_Object_Operation): Analyze the object that is accessible + through the prefix of the subprogram call before we apply + the transformation of the object-operation notation. + +2005-03-17 Jose Ruiz + + * s-taprob.adb (Initialize_Protection): Initialize the protected + object's owner to Null_Task. + (Lock): If pragma Detect_Blocking is in effect and the caller of this + procedure is already the protected object's owner then Program_Error + is raised. In addition the protected object's owner is updated. + (Lock_Read_Only): If pragma Detect_Blocking is in effect and the caller + of this procedure is already the protected object's owner then + Program_Error is raised. + In addition the protected object's owner is updated. + (Unlock): Remove the ownership of the protected object. + + * s-taprob.ads (Protection): Add the field Owner, used to store the + protected object's owner. + This component is needed for detecting one type of potentially blocking + operations (external calls on a protected subprogram with the same + target object as that of the protected action). Document the rest of + the components. + + * s-tposen.adb, s-tpoben.adb (Initialize_Protection_Entries): + Initialize the protected object's owner to Null_Task. + (Lock_Read_Only_Entries): If pragma Detect_Blocking is in effect and the + caller of this procedure is already the protected object's owner then + Program_Error is raised. + Do not raise Program_Error when this procedure is called from a + protected action. + (Unlock_Entries): Remove the ownership of the protected object. + (Lock_Entries): If pragma Detect_Blocking is in effect and the caller + of this procedure is already the protected object's owner then + Program_Error is raised. + Do not raise Program_Error when this procedure is called from + a protected action. + + * s-tposen.ads, s-tpoben.ads (Protection_Entries): Add the field Owner, + used to store the protected object's owner. + + * s-tpobop.adb (Protected_Entry_Call): If pragma Detect_Blocking is in + effect and this procedure (a potentially blocking operation) is called + from whithin a protected action, Program_Error is raised. + (Timed_Protected_Entry_Call): If pragma Detect_Blocking is in effect + and this procedure (a potentially blocking operation) is called from + whithin a protected action, Program_Error is raised. + +2005-03-17 Vincent Celier + Nicolas Setton + + * mlib-tgt-darwin.adb (Build_Dynamic_Library): Remove the "-fini" + switch, not supported by the linker on Darwin. Add '_' before + init, as this character is added unconditionally by the + compiler. + (Is_Archive_Ext): Replace the wrong library extension ".dyld" by the + correct one ".dylib". This fixes detection of the archive files when + building library projects. + +2005-03-17 Vincent Celier + + * switch-m.adb (Normalize_Compiler_Switches): Recognize switches + -gnat83, -gnat95 and -gnat05. + +2005-03-17 Vasiliy Fofanov + + * gnat_ugn.texi: Document gnatmem restriction + +2005-03-17 Thomas Quinot + + * snames.adb: Document new TSS names introduced by exp_dist/exp_tss + cleanup + +2005-03-17 Robert Dewar + + * s-interr.ads, s-interr.adb, sem_ch3.adb, prj.ads, prj.adb, + a-interr.adb, a-interr.ads, s-interr-sigaction.adb, s-interr-dummy.adb, + s-interr-vms.adb, s-interr-vxworks.adb: Minor reformatting + + * casing.adb: Comment improvements + +2005-03-17 Pascal Obry + + * g-expect.adb: Minor reformatting. + 2005-03-15 Zack Weinberg * Make-lang.in (doc/gnat_ugn_unw.info, doc/gnat_rm.info) diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in index 59b6021fa46..4b9e58c2024 100644 --- a/gcc/ada/Makefile.in +++ b/gcc/ada/Makefile.in @@ -245,7 +245,9 @@ LIBIBERTY = ../../libiberty/libiberty.a # and the system's installed libraries. LIBS = $(LIBINTL) $(LIBIBERTY) $(SYSLIBS) LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY) -TOOLS_LIBS = $(LIBGNAT) $(EXTRA_GNATTOOLS_OBJS) link.o ../../../libiberty/libiberty.a $(SYSLIBS) +# Default is no TGT_LIB; one might be passed down or something +TGT_LIB = +TOOLS_LIBS = $(LIBGNAT) $(EXTRA_GNATTOOLS_OBJS) link.o ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB) # Specify the directories to be searched for header files. # Both . and srcdir are used, in that order, @@ -1190,7 +1192,7 @@ ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),) LIBGNAT_TARGET_PAIRS_AUX1 = \ g-enblsp.adb + Free (Search.Value); raise Name_Error; end; diff --git a/gcc/ada/a-direct.ads b/gcc/ada/a-direct.ads index 4cd2340a79c..5047cc76bd5 100644 --- a/gcc/ada/a-direct.ads +++ b/gcc/ada/a-direct.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004 Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2005 Free Software Foundation, Inc. -- -- -- -- This specification is derived for use with GNAT from AI-00248, which is -- -- expected to be a part of a future expected revised Ada Reference Manual. -- @@ -304,10 +304,10 @@ package Ada.Directories is -- Starts a search in the directory entry in the directory named by -- Directory for entries matching Pattern. Pattern represents a file name -- matching pattern. If Pattern is null, all items in the directory are - -- matched; otherwise, the interpretation of Pattern is - -- implementation-defined. Only items which match Filter will be returned. - -- After a successful call on Start_Search, the object Search may have - -- entries available, but it may have no entries available if no files or + -- matched; otherwise, the interpretation of Pattern is implementation- + -- defined. Only items which match Filter will be returned. After a + -- successful call on Start_Search, the object Search may have entries + -- available, but it may have no entries available if no files or -- directories match Pattern and Filter. The exception Name_Error is -- propagated if the string given by Directory does not identify an -- existing directory, or if Pattern does not allow the identification of @@ -317,7 +317,10 @@ package Ada.Directories is procedure End_Search (Search : in out Search_Type); -- Ends the search represented by Search. After a successful call on - -- End_Search, the object Search will have no entries available. + -- End_Search, the object Search will have no entries available. Note + -- that is is not necessary to call End_Search if the call to Start_Search + -- was unsuccessful and raised an exception (but it is harmless to make + -- the call in this case)> function More_Entries (Search : Search_Type) return Boolean; -- Returns True if more entries are available to be returned by a call diff --git a/gcc/ada/a-interr.adb b/gcc/ada/a-interr.adb index 72e42a8f8a7..a603a57cfde 100644 --- a/gcc/ada/a-interr.adb +++ b/gcc/ada/a-interr.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2003, Ada Core Technologies -- +-- Copyright (C) 1995-2005 AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -73,8 +73,7 @@ package body Ada.Interrupts is --------------------- function Current_Handler - (Interrupt : Interrupt_ID) - return Parameterless_Handler + (Interrupt : Interrupt_ID) return Parameterless_Handler is begin return To_Ada (SI.Current_Handler (SI.Interrupt_ID (Interrupt))); @@ -84,7 +83,7 @@ package body Ada.Interrupts is -- Detach_Handler -- -------------------- - procedure Detach_Handler (Interrupt : in Interrupt_ID) is + procedure Detach_Handler (Interrupt : Interrupt_ID) is begin SI.Detach_Handler (SI.Interrupt_ID (Interrupt), False); end Detach_Handler; diff --git a/gcc/ada/a-interr.ads b/gcc/ada/a-interr.ads index 0475deec568..e857069b9e3 100644 --- a/gcc/ada/a-interr.ads +++ b/gcc/ada/a-interr.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -49,8 +49,7 @@ package Ada.Interrupts is function Is_Attached (Interrupt : Interrupt_ID) return Boolean; function Current_Handler - (Interrupt : Interrupt_ID) - return Parameterless_Handler; + (Interrupt : Interrupt_ID) return Parameterless_Handler; procedure Attach_Handler (New_Handler : Parameterless_Handler; diff --git a/gcc/ada/a-nudira.adb b/gcc/ada/a-nudira.adb index f3ef91afdf6..1b91d890b9a 100644 --- a/gcc/ada/a-nudira.adb +++ b/gcc/ada/a-nudira.adb @@ -229,25 +229,34 @@ package body Ada.Numerics.Discrete_Random is ----------- function Value (Coded_State : String) return State is + Last : constant Natural := Coded_State'Last; Start : Positive := Coded_State'First; Stop : Positive := Coded_State'First; Outs : State; begin - while Coded_State (Stop) /= ',' loop + while Stop <= Last and then Coded_State (Stop) /= ',' loop Stop := Stop + 1; end loop; + if Stop > Last then + raise Constraint_Error; + end if; + Outs.X1 := Int'Value (Coded_State (Start .. Stop - 1)); Start := Stop + 1; loop Stop := Stop + 1; - exit when Coded_State (Stop) = ','; + exit when Stop > Last or else Coded_State (Stop) = ','; end loop; + if Stop > Last then + raise Constraint_Error; + end if; + Outs.X2 := Int'Value (Coded_State (Start .. Stop - 1)); - Outs.Q := Int'Value (Coded_State (Stop + 1 .. Coded_State'Last)); + Outs.Q := Int'Value (Coded_State (Stop + 1 .. Last)); Outs.P := Outs.Q * 2 + 1; Outs.FP := Flt (Outs.P); Outs.Scl := (RstL - RstF + 1.0) / (Flt (Outs.P) * Flt (Outs.Q)); diff --git a/gcc/ada/a-nuflra.adb b/gcc/ada/a-nuflra.adb index 14d74593af0..70b90b89bb0 100644 --- a/gcc/ada/a-nuflra.adb +++ b/gcc/ada/a-nuflra.adb @@ -256,33 +256,46 @@ package body Ada.Numerics.Float_Random is ----------- function Value (Coded_State : String) return State is + Last : constant Natural := Coded_State'Last; Start : Positive := Coded_State'First; Stop : Positive := Coded_State'First; Outs : State; begin - while Coded_State (Stop) /= ',' loop + while Stop <= Last and then Coded_State (Stop) /= ',' loop Stop := Stop + 1; end loop; + if Stop > Last then + raise Constraint_Error; + end if; + Outs.X1 := Int'Value (Coded_State (Start .. Stop - 1)); Start := Stop + 1; loop Stop := Stop + 1; - exit when Coded_State (Stop) = ','; + exit when Stop > Last or else Coded_State (Stop) = ','; end loop; + if Stop > Last then + raise Constraint_Error; + end if; + Outs.X2 := Int'Value (Coded_State (Start .. Stop - 1)); Start := Stop + 1; loop Stop := Stop + 1; - exit when Coded_State (Stop) = ','; + exit when Stop > Last or else Coded_State (Stop) = ','; end loop; + if Stop > Last then + raise Constraint_Error; + end if; + Outs.P := Int'Value (Coded_State (Start .. Stop - 1)); - Outs.Q := Int'Value (Coded_State (Stop + 1 .. Coded_State'Last)); + Outs.Q := Int'Value (Coded_State (Stop + 1 .. Last)); Outs.X := Euclid (Outs.P, Outs.Q); Outs.Scl := 1.0 / (Flt (Outs.P) * Flt (Outs.Q)); diff --git a/gcc/ada/a-tags.adb b/gcc/ada/a-tags.adb index 03221948d34..df4e58e81f6 100644 --- a/gcc/ada/a-tags.adb +++ b/gcc/ada/a-tags.adb @@ -303,15 +303,6 @@ package body Ada.Tags is return Result (1 .. Length (Result)); end External_Tag; - ----------------------- - -- Get_Expanded_Name -- - ----------------------- - - function Get_Expanded_Name (T : Tag) return System.Address is - begin - return To_Address (TSD (T).Expanded_Name); - end Get_Expanded_Name; - ---------------------- -- Get_External_Tag -- ---------------------- @@ -321,15 +312,6 @@ package body Ada.Tags is return To_Address (TSD (T).External_Tag); end Get_External_Tag; - --------------------------- - -- Get_Inheritance_Depth -- - --------------------------- - - function Get_Inheritance_Depth (T : Tag) return Natural is - begin - return TSD (T).Idepth; - end Get_Inheritance_Depth; - ------------------------- -- Get_Prim_Op_Address -- ------------------------- @@ -360,18 +342,6 @@ package body Ada.Tags is return TSD (T).Remotely_Callable = True; end Get_Remotely_Callable; - ------------- - -- Get_TSD -- - ------------- - - function Get_TSD (T : Tag) return System.Address is - use type System.Storage_Elements.Storage_Offset; - TSD_Ptr : constant Addr_Ptr := - To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size); - begin - return TSD_Ptr.all; - end Get_TSD; - ---------------- -- Inherit_DT -- ---------------- @@ -392,14 +362,13 @@ package body Ada.Tags is -- Inherit_TSD -- ----------------- - procedure Inherit_TSD (Old_TSD : System.Address; New_Tag : Tag) is - Old_TSD_Ptr : constant Type_Specific_Data_Ptr := - To_Type_Specific_Data_Ptr (Old_TSD); - New_TSD_Ptr : constant Type_Specific_Data_Ptr := - TSD (New_Tag); + procedure Inherit_TSD (Old_Tag : Tag; New_Tag : Tag) is + New_TSD_Ptr : constant Type_Specific_Data_Ptr := TSD (New_Tag); + Old_TSD_Ptr : Type_Specific_Data_Ptr; begin - if Old_TSD_Ptr /= null then + if Old_Tag /= null then + Old_TSD_Ptr := TSD (Old_Tag); New_TSD_Ptr.Idepth := Old_TSD_Ptr.Idepth + 1; New_TSD_Ptr.Ancestor_Tags (1 .. New_TSD_Ptr.Idepth) := Old_TSD_Ptr.Ancestor_Tags (0 .. Old_TSD_Ptr.Idepth); @@ -519,18 +488,6 @@ package body Ada.Tags is TSD (T).External_Tag := To_Cstring_Ptr (Value); end Set_External_Tag; - --------------------------- - -- Set_Inheritance_Depth -- - --------------------------- - - procedure Set_Inheritance_Depth - (T : Tag; - Value : Natural) - is - begin - TSD (T).Idepth := Value; - end Set_Inheritance_Depth; - ------------------------- -- Set_Prim_Op_Address -- ------------------------- @@ -607,8 +564,11 @@ package body Ada.Tags is --------- function TSD (T : Tag) return Type_Specific_Data_Ptr is + use type System.Storage_Elements.Storage_Offset; + TSD_Ptr : constant Addr_Ptr := + To_Addr_Ptr (To_Address (T) - DT_Typeinfo_Ptr_Size); begin - return To_Type_Specific_Data_Ptr (Get_TSD (T)); + return To_Type_Specific_Data_Ptr (TSD_Ptr.all); end TSD; end Ada.Tags; diff --git a/gcc/ada/a-tags.ads b/gcc/ada/a-tags.ads index 92715a85b14..0d517a0ac07 100644 --- a/gcc/ada/a-tags.ads +++ b/gcc/ada/a-tags.ads @@ -91,10 +91,6 @@ private -- Given the tag of an object and the tag associated to a type, return -- true if Obj is in Typ'Class. - function Get_Expanded_Name (T : Tag) return System.Address; - -- Retrieve the address of a null terminated string containing - -- the expanded name - function Get_External_Tag (T : Tag) return System.Address; -- Retrieve the address of a null terminated string containing -- the external name @@ -106,10 +102,6 @@ private -- this function returns the address of the virtual function stored -- in it (used for dispatching calls) - function Get_Inheritance_Depth (T : Tag) return Natural; - -- Given a pointer to a dispatch Table, retrieves the value representing - -- the depth in the inheritance tree (used for membership). - function Get_RC_Offset (T : Tag) return SSE.Storage_Offset; -- Return the Offset of the implicit record controller when the object -- has controlled components. O otherwise. @@ -122,10 +114,6 @@ private function Get_Remotely_Callable (T : Tag) return Boolean; -- Return the value previously set by Set_Remotely_Callable - function Get_TSD (T : Tag) return System.Address; - -- Given a pointer T to a dispatch Table, retreives the address of the - -- record containing the Type Specific Data generated by GNAT - procedure Inherit_DT (Old_T : Tag; New_T : Tag; @@ -134,9 +122,8 @@ private -- of the direct ancestor and the number of primitive ops that are -- inherited (Entry_Count). - procedure Inherit_TSD (Old_TSD : System.Address; New_Tag : Tag); - -- Entry point used to initialize the TSD of a type knowing the - -- TSD of the direct ancestor. + procedure Inherit_TSD (Old_Tag : Tag; New_Tag : Tag); + -- Initialize the TSD of a type knowing the tag of the direct ancestor function Parent_Size (Obj : System.Address; @@ -161,13 +148,6 @@ private -- Insert the Tag and its associated external_tag in a table for the -- sake of Internal_Tag - procedure Set_Inheritance_Depth - (T : Tag; - Value : Natural); - -- Given a pointer to a dispatch Table, stores the value representing - -- the depth in the inheritance tree (the second parameter). Used during - -- elaboration of the tagged type. - procedure Set_Prim_Op_Address (T : Tag; Position : Positive; @@ -197,9 +177,8 @@ private -- in E.4 (18). function TSD (T : Tag) return Type_Specific_Data_Ptr; - -- This function is conceptually equivalent to Get_TSD, but - -- returning a Type_Specific_Data_Ptr type (rather than an Address) - -- simplifies the implementation of the other subprograms. + -- Given a pointer T to a dispatch Table, retreives the address of the + -- record containing the Type Specific Data generated by GNAT DT_Prologue_Size : constant SSE.Storage_Count := SSE.Storage_Count @@ -249,18 +228,14 @@ private -- use in a minimal/no run-time environment for high integrity use. pragma Inline_Always (CW_Membership); - pragma Inline_Always (Get_Expanded_Name); - pragma Inline_Always (Get_Inheritance_Depth); pragma Inline_Always (Get_Prim_Op_Address); pragma Inline_Always (Get_RC_Offset); pragma Inline_Always (Get_Remotely_Callable); - pragma Inline_Always (Get_TSD); pragma Inline_Always (Inherit_DT); pragma Inline_Always (Inherit_TSD); pragma Inline_Always (Register_Tag); pragma Inline_Always (Set_Expanded_Name); pragma Inline_Always (Set_External_Tag); - pragma Inline_Always (Set_Inheritance_Depth); pragma Inline_Always (Set_Prim_Op_Address); pragma Inline_Always (Set_RC_Offset); pragma Inline_Always (Set_Remotely_Callable); diff --git a/gcc/ada/a-tgdico.ads b/gcc/ada/a-tgdico.ads new file mode 100644 index 00000000000..8534d9f2957 --- /dev/null +++ b/gcc/ada/a-tgdico.ads @@ -0,0 +1,29 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT COMPILER COMPONENTS -- +-- -- +-- ADA.TAGS.GENERIC_DISPATCHING_CONSTRUCTOR -- +-- -- +-- S p e c -- +-- -- +-- This specification is adapted from the Ada Reference Manual for use with -- +-- GNAT. In accordance with the copyright of that document, you can freely -- +-- copy and modify this specification, provided that if you redistribute a -- +-- modified version, any changes that you have made are clearly indicated. -- +-- -- +------------------------------------------------------------------------------ + +generic + type T (<>) is abstract tagged limited private; + type Parameters (<>) is limited private; + with function Constructor (Params : access Parameters) return T is abstract; + +function Ada.Tags.Generic_Dispatching_Constructor + (The_Tag : Tag; Params : access Parameters) return T'Class; + +-- pragma Preelaborate (Generic_Dispatching_Constructor); +-- Commented out temporarily because various other predefined units do not +-- yet have proper categorization as specified by AI-362 (such as Ada.Tags, +-- Ada.Exceptions, etc.). + +pragma Import (Intrinsic, Generic_Dispatching_Constructor); diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h index fad1513ab8f..4ea4b27a914 100644 --- a/gcc/ada/ada-tree.h +++ b/gcc/ada/ada-tree.h @@ -260,6 +260,9 @@ struct lang_type GTY(()) {tree t; }; /* Nonzero in a PARM_DECL if we are to pass by descriptor. */ #define DECL_BY_DESCRIPTOR_P(NODE) DECL_LANG_FLAG_5 (PARM_DECL_CHECK (NODE)) +/* Nonzero in a VAR_DECL if it is a pointer renaming a global object. */ +#define DECL_RENAMING_GLOBAL_P(NODE) DECL_LANG_FLAG_5 (VAR_DECL_CHECK (NODE)) + /* In a CONST_DECL, points to a VAR_DECL that is allocatable to memory. Used when a scalar constant is aliased or has its address taken. */ @@ -275,6 +278,14 @@ struct lang_type GTY(()) {tree t; }; #define SET_DECL_ORIGINAL_FIELD(NODE, X) \ SET_DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE), X) +/* In a VAR_DECL, points to the object being renamed if the VAR_DECL is a + renaming pointer, otherwise 0. Note that this object is guaranteed to + be protected against multiple evaluations. */ +#define DECL_RENAMED_OBJECT(NODE) \ + GET_DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE)) +#define SET_DECL_RENAMED_OBJECT(NODE, X) \ + SET_DECL_LANG_SPECIFIC (VAR_DECL_CHECK (NODE), X) + /* In a FIELD_DECL corresponding to a discriminant, contains the discriminant number. */ #define DECL_DISCRIMINANT_NUMBER(NODE) DECL_INITIAL (FIELD_DECL_CHECK (NODE)) diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c index 73be5e1a8cb..b98b52c11df 100644 --- a/gcc/ada/adaint.c +++ b/gcc/ada/adaint.c @@ -1308,7 +1308,7 @@ __gnat_set_env_value (char *name, char *value) *next = 0; ile_array[i].len = strlen (curr); - /* Code 2 from lnmdef.h means its a string. */ + /* Code 2 from lnmdef.h means it's a string. */ ile_array[i].code = 2; ile_array[i].adr = curr; @@ -1579,7 +1579,7 @@ __gnat_portable_spawn (char *args[]) strcat (args[0], args_0); strcat (args[0], "\""); - status = spawnvp (P_WAIT, args_0, (char* const*)args); + status = spawnvp (P_WAIT, args_0, (const char* const*)args); /* restore previous value */ free (args[0]); @@ -1643,7 +1643,7 @@ __gnat_dup (int oldfd) } /* Make newfd be the copy of oldfd, closing newfd first if necessary. - Return -1 if an error occured. */ + Return -1 if an error occurred. */ int __gnat_dup2 (int oldfd, int newfd) @@ -1927,23 +1927,6 @@ __gnat_portable_wait (int *process_status) return pid; } -int -__gnat_waitpid (int pid) -{ - int status = 0; - -#if defined (_WIN32) - cwait (&status, pid, _WAIT_CHILD); -#elif defined (__EMX__) || defined (MSDOS) || defined (__vxworks) - /* Status is already zero, so nothing to do. */ -#else - waitpid (pid, &status, 0); - status = WEXITSTATUS (status); -#endif - - return status; -} - void __gnat_os_exit (int status) { @@ -2221,18 +2204,29 @@ __gnat_to_canonical_dir_spec (char *dirspec, int prefixflag) } /* Translate a VMS syntax file specification into Unix syntax. - If no indicators of VMS syntax found, return input string. */ + If no indicators of VMS syntax found, check if it's an uppercase + alphanumeric_ name and if so try it out as an environment + variable (logical name). If all else fails return the + input string. */ char * __gnat_to_canonical_file_spec (char *filespec) { + char *filespec1; + strncpy (new_canonical_filespec, "", MAXPATH); if (strchr (filespec, ']') || strchr (filespec, ':')) { strncpy (new_canonical_filespec, - (char *) decc$translate_vms (filespec), - MAXPATH); + (char *) decc$translate_vms (filespec), MAXPATH); + } + else if ((strlen (filespec) == strspn (filespec, + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_")) + && (filespec1 = getenv (filespec))) + { + strncpy (new_canonical_filespec, + (char *) decc$translate_vms (filespec1), MAXPATH); } else { @@ -2618,7 +2612,8 @@ get_gcc_version (void) } int -__gnat_set_close_on_exec (int fd, int close_on_exec_p) +__gnat_set_close_on_exec (int fd ATTRIBUTE_UNUSED, + int close_on_exec_p ATTRIBUTE_UNUSED) { #if defined (F_GETFD) && defined (FD_CLOEXEC) && ! defined (__vxworks) int flags = fcntl (fd, F_GETFD, 0); diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h index cf7e4032f4a..97d913bf996 100644 --- a/gcc/ada/adaint.h +++ b/gcc/ada/adaint.h @@ -93,7 +93,6 @@ extern int __gnat_is_symbolic_link (char *name); extern int __gnat_portable_spawn (char *[]); extern int __gnat_portable_no_block_spawn (char *[]); extern int __gnat_portable_wait (int *); -extern int __gnat_waitpid (int); extern char *__gnat_locate_exec (char *, char *); extern char *__gnat_locate_exec_on_path (char *); extern char *__gnat_locate_regular_file (char *, char *); diff --git a/gcc/ada/cal.c b/gcc/ada/cal.c index 8f8930e24eb..20a631634bb 100644 --- a/gcc/ada/cal.c +++ b/gcc/ada/cal.c @@ -31,7 +31,7 @@ ****************************************************************************/ /* This file contains those routines named by Import pragmas in package */ -/* GNAT.Calendar. It is used to to Duration to timeval convertion. */ +/* GNAT.Calendar. It is used to do Duration to timeval conversion. */ /* These are simple wrappers function to abstarct the fact that the C */ /* struct timeval fields type are not normalized (they are generaly */ /* defined as int or long values). */ @@ -75,7 +75,7 @@ __gnat_timeval_to_duration (struct timeval *t, long *sec, long *usec) void __gnat_duration_to_timeval (long sec, long usec, struct timeval *t) { - /* here we are doing implicit convertion from a long to the struct timeval + /* here we are doing implicit conversion from a long to the struct timeval fields types. */ t->tv_sec = sec; diff --git a/gcc/ada/casing.adb b/gcc/ada/casing.adb index e2f9a485e5f..33ed33889f5 100644 --- a/gcc/ada/casing.adb +++ b/gcc/ada/casing.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -140,6 +140,17 @@ package body Casing is Ptr := 1; while Ptr <= Name_Len loop + + -- Wide character. Note that we do nothing with casing in this case. + -- In Ada 2005 mode, required folding of lower case letters happened + -- as the identifier was scanned, and we do not attempt any further + -- messing with case (note that in any case we do not know how to + -- fold upper case to lower case in wide character mode). We also + -- do not bother with recognizing punctuation as equivalent to an + -- underscore. There is nothing functional at this stage in doing + -- the requested casing operation, beyond folding to upper case + -- when it is mandatory, which does not involve underscores. + if Name_Buffer (Ptr) = ASCII.ESC or else Name_Buffer (Ptr) = '[' or else (Upper_Half_Encoding @@ -148,12 +159,16 @@ package body Casing is Skip_Wide (Name_Buffer, Ptr); After_Und := False; + -- Underscore, or non-identifer character (error case) + elsif Name_Buffer (Ptr) = '_' or else not Identifier_Char (Name_Buffer (Ptr)) then After_Und := True; Ptr := Ptr + 1; + -- Lower case letter + elsif Is_Lower_Case_Letter (Name_Buffer (Ptr)) then if Actual_Casing = All_Upper_Case or else (After_Und and then Actual_Casing = Mixed_Case) @@ -164,6 +179,8 @@ package body Casing is After_Und := False; Ptr := Ptr + 1; + -- Upper case letter + elsif Is_Upper_Case_Letter (Name_Buffer (Ptr)) then if Actual_Casing = All_Lower_Case or else (not After_Und and then Actual_Casing = Mixed_Case) @@ -174,7 +191,9 @@ package body Casing is After_Und := False; Ptr := Ptr + 1; - else -- all other characters + -- Other identifier character (must be digit) + + else After_Und := False; Ptr := Ptr + 1; end if; diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 1f66e3c43f4..5255e214f53 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -714,10 +714,6 @@ package body Checks is -- Apply_Array_Size_Check -- ---------------------------- - -- Note: Really of course this entre check should be in the backend, - -- and perhaps this is not quite the right value, but it is good - -- enough to catch the normal cases (and the relevant ACVC tests!) - -- The situation is as follows. In GNAT 3 (GCC 2.x), the size in bits -- is computed in 32 bits without an overflow check. That's a real -- problem for Ada. So what we do in GNAT 3 is to approximate the @@ -726,8 +722,8 @@ package body Checks is -- In GNAT 5, the size in byte is still computed in 32 bits without -- an overflow check in the dynamic case, but the size in bits is - -- computed in 64 bits. We assume that's good enough, so we use the - -- size in bits for the test. + -- computed in 64 bits. We assume that's good enough, and we do not + -- bother to generate any front end test. procedure Apply_Array_Size_Check (N : Node_Id; Typ : Entity_Id) is Loc : constant Source_Ptr := Sloc (N); @@ -808,6 +804,14 @@ package body Checks is -- Start of processing for Apply_Array_Size_Check begin + -- Do size check on local arrays. We only need this in the GCC 2 + -- case, since in GCC 3, we expect the back end to properly handle + -- things. This routine can be removed when we baseline GNAT 3. + + if Opt.GCC_Version >= 3 then + return; + end if; + -- No need for a check if not expanding if not Expander_Active then @@ -843,144 +847,113 @@ package body Checks is end if; end loop; - -- GCC 3 case + -- First step is to calculate the maximum number of elements. For + -- this calculation, we use the actual size of the subtype if it is + -- static, and if a bound of a subtype is non-static, we go to the + -- bound of the base type. - if Opt.GCC_Version = 3 then + Siz := Uint_1; + Indx := First_Index (Typ); + while Present (Indx) loop + Xtyp := Etype (Indx); + Lo := Type_Low_Bound (Xtyp); + Hi := Type_High_Bound (Xtyp); - -- No problem if size is known at compile time (even if the front - -- end does not know it) because the back end does do overflow - -- checking on the size in bytes if it is compile time known. + -- If any bound raises constraint error, we will never get this + -- far, so there is no need to generate any kind of check. - if Size_Known_At_Compile_Time (Typ) then + if Raises_Constraint_Error (Lo) + or else + Raises_Constraint_Error (Hi) + then + Uintp.Release (Umark); return; end if; - end if; - - -- Following code is temporarily deleted, since GCC 3 is returning - -- zero for size in bits of large dynamic arrays. ??? - --- -- Otherwise we check for the size in bits exceeding 2**31-1 * 8. --- -- This is the case in which we could end up with problems from --- -- an unnoticed overflow in computing the size in bytes --- --- Check_Siz := (Uint_2 ** 31 - Uint_1) * Uint_8; --- --- Sizx := --- Make_Attribute_Reference (Loc, --- Prefix => New_Occurrence_Of (Typ, Loc), --- Attribute_Name => Name_Size); - -- GCC 2 case (for now this is for GCC 3 dynamic case as well) + -- Otherwise get bounds values - begin - -- First step is to calculate the maximum number of elements. For - -- this calculation, we use the actual size of the subtype if it is - -- static, and if a bound of a subtype is non-static, we go to the - -- bound of the base type. - - Siz := Uint_1; - Indx := First_Index (Typ); - while Present (Indx) loop - Xtyp := Etype (Indx); - Lo := Type_Low_Bound (Xtyp); - Hi := Type_High_Bound (Xtyp); - - -- If any bound raises constraint error, we will never get this - -- far, so there is no need to generate any kind of check. - - if Raises_Constraint_Error (Lo) - or else - Raises_Constraint_Error (Hi) - then - Uintp.Release (Umark); - return; - end if; + if Is_Static_Expression (Lo) then + Lob := Expr_Value (Lo); + else + Lob := Expr_Value (Type_Low_Bound (Base_Type (Xtyp))); + Static := False; + end if; - -- Otherwise get bounds values + if Is_Static_Expression (Hi) then + Hib := Expr_Value (Hi); + else + Hib := Expr_Value (Type_High_Bound (Base_Type (Xtyp))); + Static := False; + end if; - if Is_Static_Expression (Lo) then - Lob := Expr_Value (Lo); - else - Lob := Expr_Value (Type_Low_Bound (Base_Type (Xtyp))); - Static := False; - end if; + Siz := Siz * UI_Max (Hib - Lob + 1, Uint_0); + Next_Index (Indx); + end loop; - if Is_Static_Expression (Hi) then - Hib := Expr_Value (Hi); - else - Hib := Expr_Value (Type_High_Bound (Base_Type (Xtyp))); - Static := False; - end if; + -- Compute the limit against which we want to check. For subprograms, + -- where the array will go on the stack, we use 8*2**24, which (in + -- bits) is the size of a 16 megabyte array. - Siz := Siz * UI_Max (Hib - Lob + 1, Uint_0); - Next_Index (Indx); - end loop; + if Is_Subprogram (Scope (Ent)) then + Check_Siz := Uint_2 ** 27; + else + Check_Siz := Uint_2 ** 31; + end if; - -- Compute the limit against which we want to check. For subprograms, - -- where the array will go on the stack, we use 8*2**24, which (in - -- bits) is the size of a 16 megabyte array. + -- If we have all static bounds and Siz is too large, then we know + -- we know we have a storage error right now, so generate message - if Is_Subprogram (Scope (Ent)) then - Check_Siz := Uint_2 ** 27; - else - Check_Siz := Uint_2 ** 31; - end if; + if Static and then Siz >= Check_Siz then + Insert_Action (N, + Make_Raise_Storage_Error (Loc, + Reason => SE_Object_Too_Large)); + Error_Msg_N ("?Storage_Error will be raised at run-time", N); + Uintp.Release (Umark); + return; + end if; - -- If we have all static bounds and Siz is too large, then we know - -- we know we have a storage error right now, so generate message + -- Case of component size known at compile time. If the array + -- size is definitely in range, then we do not need a check. - if Static and then Siz >= Check_Siz then - Insert_Action (N, - Make_Raise_Storage_Error (Loc, - Reason => SE_Object_Too_Large)); - Error_Msg_N ("?Storage_Error will be raised at run-time", N); - Uintp.Release (Umark); - return; - end if; + if Known_Esize (Ctyp) + and then Siz * Esize (Ctyp) < Check_Siz + then + Uintp.Release (Umark); + return; + end if; - -- Case of component size known at compile time. If the array - -- size is definitely in range, then we do not need a check. + -- Here if a dynamic check is required - if Known_Esize (Ctyp) - and then Siz * Esize (Ctyp) < Check_Siz - then - Uintp.Release (Umark); - return; - end if; + -- What we do is to build an expression for the size of the array, + -- which is computed as the 'Size of the array component, times + -- the size of each dimension. - -- Here if a dynamic check is required + Uintp.Release (Umark); - -- What we do is to build an expression for the size of the array, - -- which is computed as the 'Size of the array component, times - -- the size of each dimension. + Sizx := + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Ctyp, Loc), + Attribute_Name => Name_Size); - Uintp.Release (Umark); + Indx := First_Index (Typ); + for J in 1 .. Number_Dimensions (Typ) loop + if Sloc (Etype (Indx)) = Sloc (N) then + Ensure_Defined (Etype (Indx), N); + end if; Sizx := - Make_Attribute_Reference (Loc, - Prefix => New_Occurrence_Of (Ctyp, Loc), - Attribute_Name => Name_Size); - - Indx := First_Index (Typ); - for J in 1 .. Number_Dimensions (Typ) loop - if Sloc (Etype (Indx)) = Sloc (N) then - Ensure_Defined (Etype (Indx), N); - end if; + Make_Op_Multiply (Loc, + Left_Opnd => Sizx, + Right_Opnd => + Make_Attribute_Reference (Loc, + Prefix => New_Occurrence_Of (Typ, Loc), + Attribute_Name => Name_Length, + Expressions => New_List ( + Make_Integer_Literal (Loc, J)))); + Next_Index (Indx); + end loop; - Sizx := - Make_Op_Multiply (Loc, - Left_Opnd => Sizx, - Right_Opnd => - Make_Attribute_Reference (Loc, - Prefix => New_Occurrence_Of (Typ, Loc), - Attribute_Name => Name_Length, - Expressions => New_List ( - Make_Integer_Literal (Loc, J)))); - Next_Index (Indx); - end loop; - end; - - -- Common code to actually emit the check + -- Emit the check Code := Make_Raise_Storage_Error (Loc, @@ -990,7 +963,7 @@ package body Checks is Right_Opnd => Make_Integer_Literal (Loc, Intval => Check_Siz)), - Reason => SE_Object_Too_Large); + Reason => SE_Object_Too_Large); Set_Size_Check_Code (Defining_Identifier (N), Code); Insert_Action (N, Code, Suppress => All_Checks); diff --git a/gcc/ada/cio.c b/gcc/ada/cio.c index 8e4c7cba596..4b4a8070282 100644 --- a/gcc/ada/cio.c +++ b/gcc/ada/cio.c @@ -6,7 +6,7 @@ * * * C Implementation File * * * - * Copyright (C) 1992-2003 Free Software Foundation, Inc. * + * Copyright (C) 1992-2005 Free Software Foundation, Inc. * * * * GNAT is free software; you can redistribute it and/or modify it under * * terms of the GNU General Public License as published by the Free Soft- * @@ -51,6 +51,11 @@ #undef stdout #endif +#ifdef VTHREADS +#undef putchar +#undef getchar +#endif + int get_char (void) { diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 098d485af83..c881d55b41f 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -498,6 +498,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) bool inner_const_flag = const_flag; bool static_p = Is_Statically_Allocated (gnat_entity); tree gnu_ext_name = NULL_TREE; + tree renamed_obj = NULL_TREE; if (Present (Renamed_Object (gnat_entity)) && !definition) { @@ -775,32 +776,23 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) } /* Otherwise, make this into a constant pointer to the object we - are to rename. - - Stabilize it if we are not at the global level since in this - case the renaming evaluation may directly dereference the - initial value we make here instead of the pointer we will - assign it to. We don't want variables in the expression to be - evaluated every time the renaming is used, since the value of - these variables may change in between. - - If we are at the global level and the value is not constant, - create_var_decl generates a mere elaboration assignment and - does not attach the initial expression to the declaration. - There is no possible direct initial-value dereference then. */ + are to rename and attach the object to the pointer. We need + to stabilize too since the renaming evaluation may directly + reference the renamed object instead of the pointer we will + attach it to. We don't want variables in the expression to + be evaluated every time the renaming is used, since their + value may change in between. */ else { + bool has_side_effects = TREE_SIDE_EFFECTS (gnu_expr); inner_const_flag = TREE_READONLY (gnu_expr); const_flag = true; gnu_type = build_reference_type (gnu_type); - gnu_expr = build_unary_op (ADDR_EXPR, gnu_type, gnu_expr); + renamed_obj = gnat_stabilize_reference (gnu_expr, true); + gnu_expr = build_unary_op (ADDR_EXPR, gnu_type, renamed_obj); if (!global_bindings_p ()) { - bool has_side_effects = TREE_SIDE_EFFECTS (gnu_expr); - - gnu_expr = gnat_stabilize_reference (gnu_expr, true); - /* If the original expression had side effects, put a SAVE_EXPR around this whole thing. */ if (has_side_effects) @@ -1047,7 +1039,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_ext_name = create_concat_name (gnat_entity, 0); /* If this is constant initialized to a static constant and the - object has an aggregrate type, force it to be statically + object has an aggregate type, force it to be statically allocated. */ if (const_flag && gnu_expr && TREE_CONSTANT (gnu_expr) && host_integerp (TYPE_SIZE_UNIT (gnu_type), 1) @@ -1063,6 +1055,11 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) static_p, attr_list, gnat_entity); DECL_BY_REF_P (gnu_decl) = used_by_ref; DECL_POINTS_TO_READONLY_P (gnu_decl) = used_by_ref && inner_const_flag; + if (TREE_CODE (gnu_decl) == VAR_DECL && renamed_obj) + { + SET_DECL_RENAMED_OBJECT (gnu_decl, renamed_obj); + DECL_RENAMING_GLOBAL_P (gnu_decl) = global_bindings_p (); + } /* If we have an address clause and we've made this indirect, it's not enough to merely mark the type as volatile since volatile @@ -2887,7 +2884,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) /* If we are pointing to an incomplete type whose completion is an unconstrained array, make a fat pointer type instead of a pointer to VOID. The two types in our fields will be pointers to VOID and - will be replaced in update_pointer_to. Similiarly, if the type + will be replaced in update_pointer_to. Similarly, if the type itself is a dummy type or an unconstrained array. Also make a dummy TYPE_OBJECT_RECORD_TYPE in case we have any thin pointers to it. */ @@ -3424,7 +3421,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) post_error ("unsupported mechanism for&", gnat_param); /* If this is either a foreign function or if the - underlying type won't be passed by refererence, strip off + underlying type won't be passed by reference, strip off possible padding type. */ if (TREE_CODE (gnu_param_type) == RECORD_TYPE && TYPE_IS_PADDING_P (gnu_param_type) @@ -4351,7 +4348,7 @@ copy_alias_set (tree gnu_new_type, tree gnu_old_type) /* Return a TREE_LIST describing the substitutions needed to reflect discriminant substitutions from GNAT_SUBTYPE to GNAT_TYPE and add them to GNU_LIST. If GNAT_TYPE is not specified, use the base type - of GNAT_SUBTYPE. The substitions can be in any order. TREE_PURPOSE + of GNAT_SUBTYPE. The substitutions can be in any order. TREE_PURPOSE gives the tree for the discriminant and TREE_VALUES is the replacement value. They are in the form of operands to substitute_in_expr. DEFINITION is as in gnat_to_gnu_entity. */ @@ -4620,7 +4617,7 @@ elaborate_expression (Node_Id gnat_expr, Entity_Id gnat_entity, && Ekind (Entity (gnat_expr)) == E_Discriminant))) return 0; - /* Otherwise, convert this tree to its GCC equivalant. */ + /* Otherwise, convert this tree to its GCC equivalent. */ gnu_expr = elaborate_expression_1 (gnat_expr, gnat_entity, gnat_to_gnu (gnat_expr), gnu_name, definition, need_debug); @@ -5140,17 +5137,6 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, gnu_size = validate_size (Esize (gnat_field), gnu_field_type, gnat_field, FIELD_DECL, false, true); - /* If the field's type is justified modular and the size of the packed - array it wraps is the same as that of the field, we can make the field - the type of the inner object. Note that we may need to do so if the - record is packed or the field has a component clause, but these cases - are handled later. */ - if (TREE_CODE (gnu_field_type) == RECORD_TYPE - && TYPE_JUSTIFIED_MODULAR_P (gnu_field_type) - && tree_int_cst_equal (TYPE_SIZE (gnu_field_type), - TYPE_ADA_SIZE (gnu_field_type))) - gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type)); - /* If we are packing this record, have a specified size that's smaller than that of the field type, or a position is specified, and the field type is also a record that's BLKmode and with a small constant size, see if @@ -5225,7 +5211,7 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, } /* If Aliased, the size must match exactly the rounded size. We - used to be more accomodating here and accept greater sizes, but + used to be more accommodating here and accept greater sizes, but fully supporting this case on big-endian platforms would require switching to a more involved layout for the field. */ else if (Is_Aliased (gnat_field) @@ -5717,7 +5703,7 @@ annotate_value (tree gnu_size) /* For negative values, use NEGATE_EXPR of the supplied value. */ if (tree_int_cst_sgn (gnu_size) < 0) { - /* The rediculous code below is to handle the case of the largest + /* The ridiculous code below is to handle the case of the largest negative integer. */ tree negative_size = size_diffop (bitsize_zero_node, gnu_size); bool adjust = false; @@ -6416,7 +6402,6 @@ gnat_substitute_in_type (tree t, tree f, tree r) case OFFSET_TYPE: case METHOD_TYPE: - case FILE_TYPE: case FUNCTION_TYPE: case LANG_TYPE: /* Don't know how to do these yet. */ diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 900b69a7e2b..20327cb6d4b 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -1003,6 +1003,12 @@ package body Einfo is function First_Private_Entity (Id : E) return E is begin + pragma Assert (Ekind (Id) = E_Package + or else Ekind (Id) = E_Generic_Package + or else Ekind (Id) = E_Protected_Type + or else Ekind (Id) = E_Protected_Subtype + or else Ekind (Id) = E_Task_Type + or else Ekind (Id) = E_Task_Subtype); return Node16 (Id); end First_Private_Entity; @@ -2981,7 +2987,12 @@ package body Einfo is procedure Set_First_Private_Entity (Id : E; V : E) is begin - pragma Assert (Nkind (Id) in N_Entity); + pragma Assert (Ekind (Id) = E_Package + or else Ekind (Id) = E_Generic_Package + or else Ekind (Id) = E_Protected_Type + or else Ekind (Id) = E_Protected_Subtype + or else Ekind (Id) = E_Task_Type + or else Ekind (Id) = E_Task_Subtype); Set_Node16 (Id, V); end Set_First_Private_Entity; diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 6ddda3f0d45..eb12d2d5a03 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -493,6 +493,9 @@ package body Errout is -- since there may be white space inside the literal and we don't want -- to stop on that white space. + -- Note: since this is an error recovery issue anyway, it is not worth + -- worrying about special UTF_32 line terminator characters here. + if Prev_Token = Tok_String_Literal then loop S1 := S1 + 1; @@ -512,7 +515,10 @@ package body Errout is -- Otherwise we search forward for the end of the current token, marked -- by a line terminator, white space, a comment symbol or if we bump - -- into the following token (i.e. the current token) + -- into the following token (i.e. the current token). + + -- Again, it is not worth worrying about UTF_32 special line terminator + -- characters in this context, since this is only for error recovery. else while Source (S1) not in Line_Terminator @@ -528,7 +534,6 @@ package body Errout is -- S1 is now set to the location for the flag Error_Msg (Msg, S1); - end Error_Msg_AP; ------------------ diff --git a/gcc/ada/errutil.adb b/gcc/ada/errutil.adb index 855d464add9..ef30c7d4838 100644 --- a/gcc/ada/errutil.adb +++ b/gcc/ada/errutil.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1991-2003 Free Software Foundation, Inc. -- +-- Copyright (C) 1991-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -100,6 +100,10 @@ package body Errutil is -- since there may be white space inside the literal and we don't want -- to stop on that white space. + -- Note that it is not worth worrying about special UTF_32 line + -- terminator characters in this context, since this is only about + -- error recovery anyway. + if Prev_Token = Tok_String_Literal then loop S1 := S1 + 1; @@ -121,6 +125,10 @@ package body Errutil is -- by a line terminator, white space, a comment symbol or if we bump -- into the following token (i.e. the current token) + -- Note that it is not worth worrying about special UTF_32 line + -- terminator characters in this context, since this is only about + -- error recovery anyway. + else while Source (S1) not in Line_Terminator and then Source (S1) /= ' ' diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index e68e9a67a6e..bb855415fd7 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -475,7 +475,8 @@ package body Exp_Ch2 is return In_Assignment_Context (Parent (N)); elsif (Nkind (Parent (N)) = N_Selected_Component - or else Nkind (Parent (N)) = N_Indexed_Component) + or else Nkind (Parent (N)) = N_Indexed_Component + or else Nkind (Parent (N)) = N_Slice) and then In_Assignment_Context (Parent (N)) then return True; diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb index b3517bf18ba..9aa83aa51dd 100644 --- a/gcc/ada/exp_ch3.adb +++ b/gcc/ada/exp_ch3.adb @@ -285,10 +285,14 @@ package body Exp_Ch3 is -- Freeze entities of all predefined primitive operations. This is needed -- because the bodies of these operations do not normally do any freezeing. - function Stream_Operations_OK (Typ : Entity_Id) return Boolean; - -- Check whether stream operations must be emitted for a given type. - -- Various restrictions prevent the generation of these operations, as - -- a useful optimization or for certification purposes. + function Stream_Operation_OK + (Typ : Entity_Id; + Operation : TSS_Name_Type) return Boolean; + -- Check whether the named stream operation must be emitted for a given + -- type. The rules for inheritance of stream attributes by type extensions + -- are enforced by this function. Furthermore, various restrictions prevent + -- the generation of these operations, as a useful optimization or for + -- certification purposes. -------------------------- -- Adjust_Discriminants -- @@ -3012,23 +3016,32 @@ package body Exp_Ch3 is Par_Read : constant Boolean := Present (TSS (Par, TSS_Stream_Read)); Par_Write : constant Boolean := Present (TSS (Par, TSS_Stream_Write)); + procedure Check_Attr (Nam : Name_Id; TSS_Nam : TSS_Name_Type); + -- Check that Comp has a user-specified Nam stream attribute + + procedure Check_Attr (Nam : Name_Id; TSS_Nam : TSS_Name_Type) is + begin + if No (TSS (Base_Type (Etype (Comp)), TSS_Nam)) then + Error_Msg_Name_1 := Nam; + Error_Msg_N + ("|component& in limited extension must have% attribute", Comp); + end if; + end Check_Attr; + begin if Par_Read or else Par_Write then Comp := First_Component (Typ); while Present (Comp) loop if Comes_From_Source (Comp) - and then Original_Record_Component (Comp) = Comp + and then Original_Record_Component (Comp) = Comp and then Is_Limited_Type (Etype (Comp)) then - if (Par_Read and then - No (TSS (Base_Type (Etype (Comp)), TSS_Stream_Read))) - or else - (Par_Write and then - No (TSS (Base_Type (Etype (Comp)), TSS_Stream_Write))) - then - Error_Msg_N - ("|component must have Stream attribute", - Parent (Comp)); + if Par_Read then + Check_Attr (Name_Read, TSS_Stream_Read); + end if; + + if Par_Write then + Check_Attr (Name_Write, TSS_Stream_Write); end if; end if; @@ -5543,22 +5556,24 @@ package body Exp_Ch3 is Ret_Type => Standard_Integer)); - -- Specs for dispatching stream attributes. We skip these for limited - -- types, since there is no question of dispatching in the limited case. - - -- We also skip these operations if dispatching is not available - -- or if streams are not available (since what's the point?) - - if Stream_Operations_OK (Tag_Typ) then - Append_To (Res, - Predef_Stream_Attr_Spec (Loc, Tag_Typ, TSS_Stream_Read)); - Append_To (Res, - Predef_Stream_Attr_Spec (Loc, Tag_Typ, TSS_Stream_Write)); - Append_To (Res, - Predef_Stream_Attr_Spec (Loc, Tag_Typ, TSS_Stream_Input)); - Append_To (Res, - Predef_Stream_Attr_Spec (Loc, Tag_Typ, TSS_Stream_Output)); - end if; + -- Specs for dispatching stream attributes. + + declare + Stream_Op_TSS_Names : + constant array (Integer range <>) of TSS_Name_Type := + (TSS_Stream_Read, + TSS_Stream_Write, + TSS_Stream_Input, + TSS_Stream_Output); + begin + for Op in Stream_Op_TSS_Names'Range loop + if Stream_Operation_OK (Tag_Typ, Stream_Op_TSS_Names (Op)) then + Append_To (Res, + Predef_Stream_Attr_Spec (Loc, Tag_Typ, + Stream_Op_TSS_Names (Op))); + end if; + end loop; + end; -- Spec of "=" if expanded if the type is not limited and if a -- user defined "=" was not already declared for the non-full @@ -6004,32 +6019,38 @@ package body Exp_Ch3 is -- non-limited types (in the limited case there is no dispatching). -- We also skip them if dispatching or finalization are not available. - if Stream_Operations_OK (Tag_Typ) then - if No (TSS (Tag_Typ, TSS_Stream_Read)) then - Build_Record_Read_Procedure (Loc, Tag_Typ, Decl, Ent); - Append_To (Res, Decl); - end if; + if Stream_Operation_OK (Tag_Typ, TSS_Stream_Read) + and then No (TSS (Tag_Typ, TSS_Stream_Read)) + then + Build_Record_Read_Procedure (Loc, Tag_Typ, Decl, Ent); + Append_To (Res, Decl); + end if; - if No (TSS (Tag_Typ, TSS_Stream_Write)) then - Build_Record_Write_Procedure (Loc, Tag_Typ, Decl, Ent); - Append_To (Res, Decl); - end if; + if Stream_Operation_OK (Tag_Typ, TSS_Stream_Write) + and then No (TSS (Tag_Typ, TSS_Stream_Write)) + then + Build_Record_Write_Procedure (Loc, Tag_Typ, Decl, Ent); + Append_To (Res, Decl); + end if; - -- Skip bodies of _Input and _Output for the abstract case, since - -- the corresponding specs are abstract (see Predef_Spec_Or_Body) + -- Skip bodies of _Input and _Output for the abstract case, since + -- the corresponding specs are abstract (see Predef_Spec_Or_Body) - if not Is_Abstract (Tag_Typ) then - if No (TSS (Tag_Typ, TSS_Stream_Input)) then - Build_Record_Or_Elementary_Input_Function - (Loc, Tag_Typ, Decl, Ent); - Append_To (Res, Decl); - end if; + if not Is_Abstract (Tag_Typ) then + if Stream_Operation_OK (Tag_Typ, TSS_Stream_Input) + and then No (TSS (Tag_Typ, TSS_Stream_Input)) + then + Build_Record_Or_Elementary_Input_Function + (Loc, Tag_Typ, Decl, Ent); + Append_To (Res, Decl); + end if; - if No (TSS (Tag_Typ, TSS_Stream_Output)) then - Build_Record_Or_Elementary_Output_Procedure - (Loc, Tag_Typ, Decl, Ent); - Append_To (Res, Decl); - end if; + if Stream_Operation_OK (Tag_Typ, TSS_Stream_Output) + and then No (TSS (Tag_Typ, TSS_Stream_Output)) + then + Build_Record_Or_Elementary_Output_Procedure + (Loc, Tag_Typ, Decl, Ent); + Append_To (Res, Decl); end if; end if; @@ -6216,17 +6237,35 @@ package body Exp_Ch3 is return Res; end Predefined_Primitive_Freeze; - -------------------------- - -- Stream_Operations_OK -- - -------------------------- + ------------------------- + -- Stream_Operation_OK -- + ------------------------- + + function Stream_Operation_OK + (Typ : Entity_Id; + Operation : TSS_Name_Type) return Boolean + is + Has_Inheritable_Stream_Attribute : Boolean := False; - function Stream_Operations_OK (Typ : Entity_Id) return Boolean is begin + if Is_Limited_Type (Typ) + and then Is_Tagged_Type (Typ) + and then Is_Derived_Type (Typ) + then + -- Special case of a limited type extension: a default implementation + -- of the stream attributes Read and Write exists if the attribute + -- has been specified for an ancestor type. + + Has_Inheritable_Stream_Attribute := + Present (Find_Inherited_TSS (Base_Type (Etype (Typ)), Operation)); + end if; + return - not Is_Limited_Type (Typ) + not (Is_Limited_Type (Typ) + and then not Has_Inheritable_Stream_Attribute) and then RTE_Available (RE_Tag) and then RTE_Available (RE_Root_Stream_Type) and then not Restriction_Active (No_Dispatch) and then not Restriction_Active (No_Streams); - end Stream_Operations_OK; + end Stream_Operation_OK; end Exp_Ch3; diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 525bf67c2c3..e817156267c 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -4077,7 +4077,7 @@ package body Exp_Ch4 is (Typ : Node_Id) return Boolean is Tdef : constant Node_Id := - Type_Definition (Declaration_Node (Typ)); + Type_Definition (Declaration_Node (Base_Type (Typ))); Clist : Node_Id; Vpart : Node_Id; diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index d0ccfb28cdc..c4fc454ab1c 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -553,7 +553,6 @@ package body Exp_Ch6 is Indic := New_Occurrence_Of (Etype (Formal), Loc); end if; - if Nkind (Actual) = N_Type_Conversion then V_Typ := Etype (Expression (Actual)); @@ -2683,8 +2682,9 @@ package body Exp_Ch6 is return; end if; - if Nkind (Orig_Bod) = N_Defining_Identifier then - + if Nkind (Orig_Bod) = N_Defining_Identifier + or else Nkind (Orig_Bod) = N_Defining_Operator_Symbol + then -- Subprogram is a renaming_as_body. Calls appearing after the -- renaming can be replaced with calls to the renamed entity -- directly, because the subprograms are subtype conformant. If diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb index 03001dc867e..8bb0cac38db 100644 --- a/gcc/ada/exp_disp.adb +++ b/gcc/ada/exp_disp.adb @@ -54,12 +54,10 @@ package body Exp_Disp is (CW_Membership => RE_CW_Membership, DT_Entry_Size => RE_DT_Entry_Size, DT_Prologue_Size => RE_DT_Prologue_Size, - Get_Expanded_Name => RE_Get_Expanded_Name, Get_External_Tag => RE_Get_External_Tag, Get_Prim_Op_Address => RE_Get_Prim_Op_Address, Get_RC_Offset => RE_Get_RC_Offset, Get_Remotely_Callable => RE_Get_Remotely_Callable, - Get_TSD => RE_Get_TSD, Inherit_DT => RE_Inherit_DT, Inherit_TSD => RE_Inherit_TSD, Register_Tag => RE_Register_Tag, @@ -76,12 +74,10 @@ package body Exp_Disp is (CW_Membership => RE_CPP_CW_Membership, DT_Entry_Size => RE_CPP_DT_Entry_Size, DT_Prologue_Size => RE_CPP_DT_Prologue_Size, - Get_Expanded_Name => RE_CPP_Get_Expanded_Name, Get_External_Tag => RE_CPP_Get_External_Tag, Get_Prim_Op_Address => RE_CPP_Get_Prim_Op_Address, Get_RC_Offset => RE_CPP_Get_RC_Offset, Get_Remotely_Callable => RE_CPP_Get_Remotely_Callable, - Get_TSD => RE_CPP_Get_TSD, Inherit_DT => RE_CPP_Inherit_DT, Inherit_TSD => RE_CPP_Inherit_TSD, Register_Tag => RE_CPP_Register_Tag, @@ -98,12 +94,10 @@ package body Exp_Disp is (CW_Membership => False, DT_Entry_Size => False, DT_Prologue_Size => False, - Get_Expanded_Name => False, Get_External_Tag => False, Get_Prim_Op_Address => False, Get_Remotely_Callable => False, Get_RC_Offset => False, - Get_TSD => False, Inherit_DT => True, Inherit_TSD => True, Register_Tag => True, @@ -120,12 +114,10 @@ package body Exp_Disp is (CW_Membership => 2, DT_Entry_Size => 0, DT_Prologue_Size => 0, - Get_Expanded_Name => 1, Get_External_Tag => 1, Get_Prim_Op_Address => 2, Get_RC_Offset => 1, Get_Remotely_Callable => 1, - Get_TSD => 1, Inherit_DT => 3, Inherit_TSD => 2, Register_Tag => 1, @@ -644,8 +636,8 @@ package body Exp_Disp is I_Depth : Int; Generalized_Tag : Entity_Id; Size_Expr_Node : Node_Id; - Old_Tag : Node_Id; - Old_TSD : Node_Id; + Old_Tag1 : Node_Id; + Old_Tag2 : Node_Id; begin if not RTE_Available (RE_Tag) then @@ -838,24 +830,20 @@ package body Exp_Disp is if Typ = Etype (Typ) or else Is_CPP_Class (Etype (Typ)) then - Old_Tag := + Old_Tag1 := Unchecked_Convert_To (Generalized_Tag, Make_Integer_Literal (Loc, 0)); - - Old_TSD := - Unchecked_Convert_To (RTE (RE_Address), + Old_Tag2 := + Unchecked_Convert_To (Generalized_Tag, Make_Integer_Literal (Loc, 0)); else - Old_Tag := + Old_Tag1 := + New_Reference_To + (Node (First_Elmt (Access_Disp_Table (Etype (Typ)))), Loc); + Old_Tag2 := New_Reference_To (Node (First_Elmt (Access_Disp_Table (Etype (Typ)))), Loc); - Old_TSD := - Make_DT_Access_Action (Typ, - Action => Get_TSD, - Args => New_List ( - New_Reference_To - (Node (First_Elmt (Access_Disp_Table (Etype (Typ)))), Loc))); end if; -- Generate: Inherit_DT (parent'tag, DT_Ptr, nb_prim of parent); @@ -864,18 +852,18 @@ package body Exp_Disp is Make_DT_Access_Action (Typ, Action => Inherit_DT, Args => New_List ( - Node1 => Old_Tag, + Node1 => Old_Tag1, Node2 => New_Reference_To (DT_Ptr, Loc), Node3 => Make_Integer_Literal (Loc, DT_Entry_Count (First_Tag_Component (Etype (Typ))))))); - -- Generate: Inherit_TSD (Get_TSD (parent), DT_Ptr); + -- Generate: Inherit_TSD (parent'tag, DT_Ptr); Append_To (Elab_Code, Make_DT_Access_Action (Typ, Action => Inherit_TSD, Args => New_List ( - Node1 => Old_TSD, + Node1 => Old_Tag2, Node2 => New_Reference_To (DT_Ptr, Loc)))); -- Generate: Exname : constant String := full_qualified_name (typ); diff --git a/gcc/ada/exp_disp.ads b/gcc/ada/exp_disp.ads index 34bcffc5c59..d942c3f514b 100644 --- a/gcc/ada/exp_disp.ads +++ b/gcc/ada/exp_disp.ads @@ -34,12 +34,10 @@ package Exp_Disp is (CW_Membership, DT_Entry_Size, DT_Prologue_Size, - Get_Expanded_Name, Get_External_Tag, Get_Prim_Op_Address, Get_RC_Offset, Get_Remotely_Callable, - Get_TSD, Inherit_DT, Inherit_TSD, Register_Tag, diff --git a/gcc/ada/exp_dist.adb b/gcc/ada/exp_dist.adb index e1c69b7a8f1..60fdf4f09fd 100644 --- a/gcc/ada/exp_dist.adb +++ b/gcc/ada/exp_dist.adb @@ -152,11 +152,6 @@ package body Exp_Dist is pragma Warnings (Off, Get_Subprogram_Id); -- One homonym only is unreferenced (specific to the GARLIC version) - function Get_PCS_Name return PCS_Names; - -- Return the name of a literal of type - -- System.Partition_Interface.DSA_Implementation_Type - -- indicating what PCS is currently in use. - procedure Add_RAS_Dereference_TSS (N : Node_Id); -- Add a subprogram body for RAS Dereference TSS @@ -439,11 +434,8 @@ package body Exp_Dist is procedure Specific_Add_RAST_Features (Vis_Decl : Node_Id; - RAS_Type : Entity_Id; - Decls : List_Id); - -- Add declaration for TSSs for a given RAS type. The declarations are - -- added just after the declaration of the RAS type itself, while the - -- bodies are inserted at the end of Decls. PCS-specific ancillary + RAS_Type : Entity_Id); + -- Add declaration for TSSs for a given RAS type. PCS-specific ancillary -- subprogram for Add_RAST_Features. -- An RPC_Target record is used during construction of calling stubs @@ -581,8 +573,7 @@ package body Exp_Dist is procedure Add_RAST_Features (Vis_Decl : Node_Id; - RAS_Type : Entity_Id; - Decls : List_Id); + RAS_Type : Entity_Id); procedure Build_General_Calling_Stubs (Decls : List_Id; @@ -657,8 +648,7 @@ package body Exp_Dist is procedure Add_RAST_Features (Vis_Decl : Node_Id; - RAS_Type : Entity_Id; - Decls : List_Id); + RAS_Type : Entity_Id); procedure Build_General_Calling_Stubs (Decls : List_Id; @@ -1716,20 +1706,10 @@ package body Exp_Dist is procedure Add_RAST_Features (Vis_Decl : Node_Id) is RAS_Type : constant Entity_Id := Equivalent_Type (Defining_Identifier (Vis_Decl)); - - Spec : constant Node_Id := - Specification (Unit (Enclosing_Lib_Unit_Node (Vis_Decl))); - Decls : List_Id := Private_Declarations (Spec); - begin pragma Assert (No (TSS (RAS_Type, TSS_RAS_Access))); - - if No (Decls) then - Decls := Visible_Declarations (Spec); - end if; - Add_RAS_Dereference_TSS (Vis_Decl); - Specific_Add_RAST_Features (Vis_Decl, RAS_Type, Decls); + Specific_Add_RAST_Features (Vis_Decl, RAS_Type); end Add_RAST_Features; ------------------- @@ -3271,11 +3251,10 @@ package body Exp_Dist is procedure Add_RAST_Features (Vis_Decl : Node_Id; - RAS_Type : Entity_Id; - Decls : List_Id) + RAS_Type : Entity_Id) is pragma Warnings (Off); - pragma Unreferenced (RAS_Type, Decls); + pragma Unreferenced (RAS_Type); pragma Warnings (On); begin Add_RAS_Access_TSS (Vis_Decl); @@ -4785,18 +4764,6 @@ package body Exp_Dist is Selector_Name => Make_Identifier (Loc, Selector_Name)); end Make_Selected_Component; - ------------------ - -- Get_PCS_Name -- - ------------------ - - function Get_PCS_Name return PCS_Names is - PCS_Name : constant PCS_Names := - Chars (Entity (Expression - (Parent (RTE (RE_DSA_Implementation))))); - begin - return PCS_Name; - end Get_PCS_Name; - ----------------------- -- Get_Subprogram_Id -- ----------------------- @@ -5111,19 +5078,13 @@ package body Exp_Dist is Declarations : List_Id); -- Add the TypeCode TSS for this RACW type - procedure Add_RAS_From_Any - (RAS_Type : Entity_Id; - Declarations : List_Id); + procedure Add_RAS_From_Any (RAS_Type : Entity_Id); -- Add the From_Any TSS for this RAS type - procedure Add_RAS_To_Any - (RAS_Type : Entity_Id; - Declarations : List_Id); + procedure Add_RAS_To_Any (RAS_Type : Entity_Id); -- Add the To_Any TSS for this RAS type - procedure Add_RAS_TypeCode - (RAS_Type : Entity_Id; - Declarations : List_Id); + procedure Add_RAS_TypeCode (RAS_Type : Entity_Id); -- Add the TypeCode TSS for this RAS type procedure Add_RAS_Access_TSS (N : Node_Id); @@ -5957,18 +5918,17 @@ package body Exp_Dist is procedure Add_RAST_Features (Vis_Decl : Node_Id; - RAS_Type : Entity_Id; - Decls : List_Id) + RAS_Type : Entity_Id) is begin Add_RAS_Access_TSS (Vis_Decl); - Add_RAS_From_Any (RAS_Type, Decls); - Add_RAS_TypeCode (RAS_Type, Decls); + Add_RAS_From_Any (RAS_Type); + Add_RAS_TypeCode (RAS_Type); -- To_Any uses TypeCode, and therefore needs to be generated last - Add_RAS_To_Any (RAS_Type, Decls); + Add_RAS_To_Any (RAS_Type); end Add_RAST_Features; ------------------------ @@ -6306,18 +6266,13 @@ package body Exp_Dist is -- Add_RAS_From_Any -- ---------------------- - procedure Add_RAS_From_Any - (RAS_Type : Entity_Id; - Declarations : List_Id) - is + procedure Add_RAS_From_Any (RAS_Type : Entity_Id) is Loc : constant Source_Ptr := Sloc (RAS_Type); - Fnam : constant Entity_Id := - Make_Defining_Identifier (Loc, New_Internal_Name ('F')); + Fnam : constant Entity_Id := Make_Defining_Identifier (Loc, + Make_TSS_Name (RAS_Type, TSS_From_Any)); Func_Spec : Node_Id; - Func_Decl : Node_Id; - Func_Body : Node_Id; Statements : List_Id; @@ -6351,45 +6306,30 @@ package body Exp_Dist is New_Occurrence_Of (RTE (RE_Any), Loc))), Subtype_Mark => New_Occurrence_Of (RAS_Type, Loc)); - -- NOTE: The usage occurrences of RACW_Parameter must - -- refer to the entity in the declaration spec, not those - -- of the body spec. - - Func_Decl := Make_Subprogram_Declaration (Loc, Func_Spec); - - Func_Body := + Discard_Node ( Make_Subprogram_Body (Loc, - Specification => - Copy_Specification (Loc, Func_Spec), + Specification => Func_Spec, Declarations => No_List, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, - Statements => Statements)); - - Insert_After (Declaration_Node (RAS_Type), Func_Decl); - Append_To (Declarations, Func_Body); - - Set_Renaming_TSS (RAS_Type, Fnam, TSS_From_Any); + Statements => Statements))); + Set_TSS (RAS_Type, Fnam); end Add_RAS_From_Any; -------------------- -- Add_RAS_To_Any -- -------------------- - procedure Add_RAS_To_Any - (RAS_Type : Entity_Id; - Declarations : List_Id) - is + procedure Add_RAS_To_Any (RAS_Type : Entity_Id) is Loc : constant Source_Ptr := Sloc (RAS_Type); - Fnam : Entity_Id; + Fnam : constant Entity_Id := Make_Defining_Identifier (Loc, + Make_TSS_Name (RAS_Type, TSS_To_Any)); - Decls : List_Id; + Decls : List_Id; Statements : List_Id; Func_Spec : Node_Id; - Func_Decl : Node_Id; - Func_Body : Node_Id; Any : constant Entity_Id := Make_Defining_Identifier (Loc, @@ -6428,9 +6368,6 @@ package body Exp_Dist is Expression => New_Occurrence_Of (Any, Loc))); - Fnam := Make_Defining_Identifier ( - Loc, New_Internal_Name ('T')); - Func_Spec := Make_Function_Specification (Loc, Defining_Unit_Name => @@ -6443,42 +6380,27 @@ package body Exp_Dist is New_Occurrence_Of (RAS_Type, Loc))), Subtype_Mark => New_Occurrence_Of (RTE (RE_Any), Loc)); - -- NOTE: The usage occurrences of RAS_Parameter must - -- refer to the entity in the declaration spec, not in - -- the body spec. - - Func_Decl := Make_Subprogram_Declaration (Loc, Func_Spec); - - Func_Body := + Discard_Node ( Make_Subprogram_Body (Loc, - Specification => - Copy_Specification (Loc, Func_Spec), + Specification => Func_Spec, Declarations => Decls, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, - Statements => Statements)); - - Insert_After (Declaration_Node (RAS_Type), Func_Decl); - Append_To (Declarations, Func_Body); - - Set_Renaming_TSS (RAS_Type, Fnam, TSS_To_Any); + Statements => Statements))); + Set_TSS (RAS_Type, Fnam); end Add_RAS_To_Any; ---------------------- -- Add_RAS_TypeCode -- ---------------------- - procedure Add_RAS_TypeCode - (RAS_Type : Entity_Id; - Declarations : List_Id) - is + procedure Add_RAS_TypeCode (RAS_Type : Entity_Id) is Loc : constant Source_Ptr := Sloc (RAS_Type); - Fnam : Entity_Id; + Fnam : constant Entity_Id := Make_Defining_Identifier (Loc, + Make_TSS_Name (RAS_Type, TSS_TypeCode)); Func_Spec : Node_Id; - Func_Decl : Node_Id; - Func_Body : Node_Id; Decls : constant List_Id := New_List; Name_String, Repo_Id_String : String_Id; @@ -6487,11 +6409,6 @@ package body Exp_Dist is Make_Defining_Identifier (Loc, Name_R); begin - - Fnam := - Make_Defining_Identifier (Loc, - Chars => New_Internal_Name ('T')); - -- The spec for this subprogram has a dummy 'access RAS' -- argument, which serves only for overloading purposes. @@ -6508,19 +6425,12 @@ package body Exp_Dist is Subtype_Mark => New_Occurrence_Of (RAS_Type, Loc)))), Subtype_Mark => New_Occurrence_Of (RTE (RE_TypeCode), Loc)); - -- NOTE: The usage occurrences of RAS_Parameter must - -- refer to the entity in the declaration spec, not those - -- of the body spec. - - Func_Decl := Make_Subprogram_Declaration (Loc, Func_Spec); - PolyORB_Support.Helpers.Build_Name_And_Repository_Id (RAS_Type, Name_Str => Name_String, Repo_Id_Str => Repo_Id_String); - Func_Body := + Discard_Node ( Make_Subprogram_Body (Loc, - Specification => - Copy_Specification (Loc, Func_Spec), + Specification => Func_Spec, Declarations => Decls, Handled_Statement_Sequence => Make_Handled_Sequence_Of_Statements (Loc, @@ -6545,12 +6455,8 @@ package body Exp_Dist is RTE (RE_TA_String), Loc), Parameter_Associations => New_List ( Make_String_Literal (Loc, - Repo_Id_String))))))))))); - - Insert_After (Declaration_Node (RAS_Type), Func_Decl); - Append_To (Declarations, Func_Body); - - Set_Renaming_TSS (RAS_Type, Fnam, TSS_TypeCode); + Repo_Id_String)))))))))))); + Set_TSS (RAS_Type, Fnam); end Add_RAS_TypeCode; ----------------------------------------- @@ -10800,17 +10706,13 @@ package body Exp_Dist is procedure Specific_Add_RAST_Features (Vis_Decl : Node_Id; - RAS_Type : Entity_Id; - Decls : List_Id) - is + RAS_Type : Entity_Id) is begin case Get_PCS_Name is when Name_PolyORB_DSA => - PolyORB_Support.Add_RAST_Features ( - Vis_Decl, RAS_Type, Decls); + PolyORB_Support.Add_RAST_Features (Vis_Decl, RAS_Type); when others => - GARLIC_Support.Add_RAST_Features ( - Vis_Decl, RAS_Type, Decls); + GARLIC_Support.Add_RAST_Features (Vis_Decl, RAS_Type); end case; end Specific_Add_RAST_Features; diff --git a/gcc/ada/exp_intr.adb b/gcc/ada/exp_intr.adb index 1efd42bb6b3..b46b8f09c7d 100644 --- a/gcc/ada/exp_intr.adb +++ b/gcc/ada/exp_intr.adb @@ -26,11 +26,13 @@ with Atree; use Atree; with Einfo; use Einfo; +with Elists; use Elists; with Errout; use Errout; with Exp_Ch4; use Exp_Ch4; with Exp_Ch7; use Exp_Ch7; with Exp_Ch11; use Exp_Ch11; with Exp_Code; use Exp_Code; +with Exp_Disp; use Exp_Disp; with Exp_Fixd; use Exp_Fixd; with Exp_Util; use Exp_Util; with Itypes; use Itypes; @@ -61,6 +63,13 @@ package body Exp_Intr is procedure Expand_Is_Negative (N : Node_Id); -- Expand a call to the intrinsic Is_Negative function + procedure Expand_Dispatching_Constructor_Call (N : Node_Id); + -- Expand a call to an instantiation of Generic_Dispatching_Constructor + -- into a dispatching call to the actual subprogram associated with the + -- Constructor formal subprogram, passing it the Parameters actual of + -- the call to the instantiation and dispatching based on call's Tag + -- parameter. + procedure Expand_Exception_Call (N : Node_Id; Ent : RE_Id); -- Expand a call to Exception_Information/Message/Name. The first -- parameter, N, is the node for the function call, and Ent is the @@ -96,6 +105,77 @@ package body Exp_Intr is -- Name_Source_Location - expand string of form file:line -- Name_Enclosing_Entity - expand string with name of enclosing entity + ----------------------------------------- + -- Expand_Dispatching_Constructor_Call -- + ----------------------------------------- + + -- Transform a call to an instantiation of Generic_Dispatching_Constructor + -- of the form: + + -- GDC_Instance (The_Tag, Parameters'Access) + + -- to a class-wide conversion of a dispatching call to the actual + -- associated with the formal subprogram Construct, designating + -- The_Tag as the controlling tag of the call: + + -- T'Class (Construct'Actual (Params)) -- Controlling tag is The_Tag + + -- which will eventually be expanded to the following: + + -- T'Class (The_Tag.all (Construct'Actual'Index).all (Params)) + + -- A class-wide membership test is also generated, preceding the call, + -- to ensure that the controlling tag denotes a type in T'Class. + + procedure Expand_Dispatching_Constructor_Call (N : Node_Id) is + Loc : constant Source_Ptr := Sloc (N); + Tag_Arg : constant Node_Id := First_Actual (N); + Param_Arg : constant Node_Id := Next_Actual (Tag_Arg); + Subp_Decl : constant Node_Id := Parent (Parent (Entity (Name (N)))); + Inst_Pkg : constant Node_Id := Parent (Subp_Decl); + Act_Rename : constant Node_Id := + Next (Next (First (Visible_Declarations (Inst_Pkg)))); + Act_Constr : constant Entity_Id := Entity (Name (Act_Rename)); + Result_Typ : constant Entity_Id := Class_Wide_Type (Etype (Act_Constr)); + Cnstr_Call : Node_Id; + + begin + -- Create the call to the actual Constructor function + + Cnstr_Call := + Make_Function_Call (Loc, + Name => New_Occurrence_Of (Act_Constr, Loc), + Parameter_Associations => New_List (Relocate_Node (Param_Arg))); + + -- Establish its controlling tag from the tag passed to the instance + + Set_Controlling_Argument (Cnstr_Call, Relocate_Node (Tag_Arg)); + + -- Rewrite and analyze the call to the instance as a class-wide + -- conversion of the call to the actual constructor. + + Rewrite (N, Convert_To (Result_Typ, Cnstr_Call)); + Analyze_And_Resolve (N, Etype (Act_Constr)); + + -- Generate a class-wide membership test to ensure that the call's tag + -- argument denotes a type within the class. + + Insert_Action (N, + Make_Implicit_If_Statement (N, + Condition => + Make_Op_Not (Loc, + Make_DT_Access_Action (Result_Typ, + Action => CW_Membership, + Args => New_List ( + Duplicate_Subexpr (Tag_Arg), + New_Reference_To ( + Node (First_Elmt (Access_Disp_Table ( + Root_Type (Result_Typ)))), Loc)))), + Then_Statements => + New_List (Make_Raise_Statement (Loc, + New_Occurrence_Of (RTE (RE_Tag_Error), Loc))))); + end Expand_Dispatching_Constructor_Call; + --------------------------- -- Expand_Exception_Call -- --------------------------- @@ -236,6 +316,9 @@ package body Exp_Intr is elsif Nam = Name_Exception_Name then Expand_Exception_Call (N, RE_Exception_Name_Simple); + elsif Nam = Name_Generic_Dispatching_Constructor then + Expand_Dispatching_Constructor_Call (N); + elsif Nam = Name_Import_Address or else Nam = Name_Import_Largest_Value diff --git a/gcc/ada/exp_strm.adb b/gcc/ada/exp_strm.adb index a38ce46007a..c5875348494 100644 --- a/gcc/ada/exp_strm.adb +++ b/gcc/ada/exp_strm.adb @@ -26,6 +26,7 @@ with Atree; use Atree; with Einfo; use Einfo; +with Exp_Tss; use Exp_Tss; with Namet; use Namet; with Nlists; use Nlists; with Nmake; use Nmake; @@ -36,7 +37,6 @@ with Snames; use Snames; with Stand; use Stand; with Tbuild; use Tbuild; with Ttypes; use Ttypes; -with Exp_Tss; use Exp_Tss; with Uintp; use Uintp; package body Exp_Strm is @@ -1173,6 +1173,11 @@ package body Exp_Strm is Stms : List_Id; Typt : Entity_Id; + In_Limited_Extension : Boolean := False; + -- Set to True while processing the record extension definition + -- for an extension of a limited type (for which an ancestor type + -- has an explicit Nam attribute definition). + function Make_Component_List_Attributes (CL : Node_Id) return List_Id; -- Returns a sequence of attributes to process the components that -- are referenced in the given component list. @@ -1254,7 +1259,29 @@ package body Exp_Strm is -------------------------- function Make_Field_Attribute (C : Entity_Id) return Node_Id is + Field_Typ : constant Entity_Id := Stream_Base_Type (Etype (C)); + + TSS_Names : constant array (Name_Input .. Name_Write) of + TSS_Name_Type := + (Name_Read => TSS_Stream_Read, + Name_Write => TSS_Stream_Write, + Name_Input => TSS_Stream_Input, + Name_Output => TSS_Stream_Output, + others => TSS_Null); + pragma Assert (TSS_Names (Nam) /= TSS_Null); + begin + if In_Limited_Extension + and then Is_Limited_Type (Field_Typ) + and then No (Find_Inherited_TSS (Field_Typ, TSS_Names (Nam))) + then + -- The declaration is illegal per 13.13.2(9/1), and this is + -- enforced in Exp_Ch3.Check_Stream_Attributes. Keep the + -- caller happy by returning a null statement. + + return Make_Null_Statement (Loc); + end if; + return Make_Attribute_Reference (Loc, Prefix => @@ -1331,6 +1358,10 @@ package body Exp_Strm is if Nkind (Rdef) = N_Derived_Type_Definition then Rdef := Record_Extension_Part (Rdef); + + if Is_Limited_Type (Typt) then + In_Limited_Extension := True; + end if; end if; if Present (Component_List (Rdef)) then diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb index 5ef5bae5138..4868dc1286e 100644 --- a/gcc/ada/exp_util.adb +++ b/gcc/ada/exp_util.adb @@ -2386,8 +2386,8 @@ package body Exp_Util is -- component of the record, then the component may be unaligned. if Is_Packed (Etype (P)) - and then Represented_As_Scalar (Etype (P)) - and then First_Entity (Etype (Entity (P))) /= C + and then Represented_As_Scalar (Etype (C)) + and then First_Entity (Scope (C)) /= C then return True; end if; @@ -3212,7 +3212,7 @@ package body Exp_Util is -- At the current time, the only types that we return False for (i.e. -- where we decide we know they cannot generate large temps) are ones - -- where we know the size is 128 bits or less at compile time, and we + -- where we know the size is 256 bits or less at compile time, and we -- are still not doing a thorough job on arrays and records ??? function May_Generate_Large_Temp (Typ : Entity_Id) return Boolean is @@ -3295,7 +3295,7 @@ package body Exp_Util is E : Node_Id; function Side_Effect_Free (N : Node_Id) return Boolean; - -- Determines if the tree N represents an expession that is known + -- Determines if the tree N represents an expression that is known -- not to have side effects, and for which no processing is required. function Side_Effect_Free (L : List_Id) return Boolean; @@ -3639,7 +3639,7 @@ package body Exp_Util is elsif Nkind (Exp) = N_Unchecked_Type_Conversion and then Nkind (Expression (Exp)) = N_Explicit_Dereference then - Remove_Side_Effects (Expression (Exp), Variable_Ref); + Remove_Side_Effects (Expression (Exp), Name_Req, Variable_Ref); Scope_Suppress := Svg_Suppress; return; @@ -3647,7 +3647,7 @@ package body Exp_Util is -- the side effects in the expression. This is important in several -- circumstances: for change of representations, and also when this -- is a view conversion to a smaller object, where gigi can end up - -- its own temporary of the wrong size. + -- creating its own temporary of the wrong size. -- ??? this transformation is inhibited for elementary types that are -- not involved in a change of representation because it causes @@ -3657,7 +3657,7 @@ package body Exp_Util is and then (not Is_Elementary_Type (Underlying_Type (Exp_Type)) or else Nkind (Parent (Exp)) = N_Assignment_Statement) then - Remove_Side_Effects (Expression (Exp), Variable_Ref); + Remove_Side_Effects (Expression (Exp), Name_Req, Variable_Ref); Scope_Suppress := Svg_Suppress; return; diff --git a/gcc/ada/expect.c b/gcc/ada/expect.c index f0b4bfb9db7..dcb6776842e 100644 --- a/gcc/ada/expect.c +++ b/gcc/ada/expect.c @@ -43,6 +43,16 @@ #include "system.h" #endif +#include + +#ifdef __MINGW32__ +#if OLD_MINGW +#include +#endif +#else +#include +#endif + /* This file provides the low level functionalities needed to implement Expect capabilities in GNAT.Expect. Implementations for unix and windows systems is provided. @@ -72,11 +82,33 @@ __gnat_kill (int pid, int sig) { process_handle = OpenProcess (PROCESS_TERMINATE, FALSE, pid); if (process_handle != NULL) - TerminateProcess (process_handle, 0); + { + TerminateProcess (process_handle, 0); + CloseHandle (process_handle); + } } } int +__gnat_waitpid (int pid) +{ + HANDLE process_handle; + DWORD exitcode = 1; + DWORD res; + + process_handle = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE, pid); + + if (process_handle != NULL) + { + res = WaitForSingleObject (process_handle, INFINITE); + GetExitCodeProcess (process_handle, &exitcode); + CloseHandle (process_handle); + } + + return (int) exitcode; +} + +int __gnat_expect_fork (void) { return 0; @@ -158,6 +190,17 @@ __gnat_expect_poll (int *fd, int num_fd, int timeout, int *is_set) #include int +__gnat_waitpid (int pid) +{ + int status = 0; + + waitpid (pid, &status, 0); + status = WEXITSTATUS (status); + + return status; +} + +int __gnat_pipe (int *fd) { return pipe (fd); @@ -298,6 +341,17 @@ __gnat_kill (int pid, int sig) } int +__gnat_waitpid (int pid) +{ + int status = 0; + + waitpid (pid, &status, 0); + status = WEXITSTATUS (status); + + return status; +} + +int __gnat_pipe (int *fd) { return pipe (fd); @@ -405,6 +459,12 @@ __gnat_kill (int pid, int sig) } int +__gnat_waitpid (int pid, int sig) +{ + return 0; +} + +int __gnat_pipe (int *fd) { return -1; diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 0fe2173a093..8ba5fe8a1f8 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -78,7 +78,7 @@ package body Freeze is (Decl : Node_Id; New_S : Entity_Id; After : in out Node_Id); - -- Build body for a renaming declaration, insert in tree and analyze. + -- Build body for a renaming declaration, insert in tree and analyze procedure Check_Address_Clause (E : Entity_Id); -- Apply legality checks to address clauses for object declarations, @@ -393,7 +393,7 @@ package body Freeze is Parameter_Associations => Actuals); end if; - -- Create entities for subprogram body and formals. + -- Create entities for subprogram body and formals Set_Defining_Unit_Name (Spec, Make_Defining_Identifier (Loc, Chars => Chars (New_S))); @@ -1422,7 +1422,7 @@ package body Freeze is procedure Check_Current_Instance (Comp_Decl : Node_Id) is function Process (N : Node_Id) return Traverse_Result; - -- Process routine to apply check to given node. + -- Process routine to apply check to given node ------------- -- Process -- @@ -1530,29 +1530,35 @@ package body Freeze is then Set_First_Entity (Rec, First_Entity (Base_Type (Rec))); - -- If this is an internal type without a declaration, as for a + -- If this is an internal type without a declaration, as for -- record component, the base type may not yet be frozen, and its -- controller has not been created. Add an explicit freeze node - -- for the itype, so it will be frozen after the base type. + -- for the itype, so it will be frozen after the base type. This + -- freeze node is used to communicate with the expander, in order + -- to create the controller for the enclosing record, and it is + -- deleted afterwards (see exp_ch3). It must not be created when + -- expansion is off, because it might appear in the wrong context + -- for the back end. elsif Is_Itype (Rec) and then Has_Delayed_Freeze (Base_Type (Rec)) and then Nkind (Associated_Node_For_Itype (Rec)) = - N_Component_Declaration + N_Component_Declaration + and then Expander_Active then Ensure_Freeze_Node (Rec); end if; end if; - -- Freeze components and embedded subtypes. + -- Freeze components and embedded subtypes Comp := First_Entity (Rec); Prev := Empty; while Present (Comp) loop - -- First handle the (real) component case. + -- First handle the (real) component case if Ekind (Comp) = E_Component or else Ekind (Comp) = E_Discriminant @@ -3388,7 +3394,7 @@ package body Freeze is Nam := Empty; end if; - -- For an allocator freeze designated type if not frozen already. + -- For an allocator freeze designated type if not frozen already -- For an aggregate whose component type is an access type, freeze -- the designated type now, so that its freeze does not appear within @@ -4834,7 +4840,7 @@ package body Freeze is Nam : Entity_Id) is Ent : constant Entity_Id := Entity (Nam); - -- The object to which the address clause applies. + -- The object to which the address clause applies Init : Node_Id; Old : Entity_Id := Empty; diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb index 2571a440d65..2eed9164b20 100644 --- a/gcc/ada/g-expect.adb +++ b/gcc/ada/g-expect.adb @@ -31,12 +31,12 @@ -- -- ------------------------------------------------------------------------------ -with System; use System; -with Ada.Calendar; use Ada.Calendar; +with System; use System; +with Ada.Calendar; use Ada.Calendar; with GNAT.IO; -with GNAT.OS_Lib; use GNAT.OS_Lib; -with GNAT.Regpat; use GNAT.Regpat; +with GNAT.OS_Lib; use GNAT.OS_Lib; +with GNAT.Regpat; use GNAT.Regpat; with Unchecked_Deallocation; @@ -762,9 +762,7 @@ package body GNAT.Expect is ------------------ function Get_Error_Fd - (Descriptor : Process_Descriptor) - return GNAT.OS_Lib.File_Descriptor - is + (Descriptor : Process_Descriptor) return GNAT.OS_Lib.File_Descriptor is begin return Descriptor.Error_Fd; end Get_Error_Fd; @@ -774,9 +772,7 @@ package body GNAT.Expect is ------------------ function Get_Input_Fd - (Descriptor : Process_Descriptor) - return GNAT.OS_Lib.File_Descriptor - is + (Descriptor : Process_Descriptor) return GNAT.OS_Lib.File_Descriptor is begin return Descriptor.Input_Fd; end Get_Input_Fd; @@ -786,9 +782,7 @@ package body GNAT.Expect is ------------------- function Get_Output_Fd - (Descriptor : Process_Descriptor) - return GNAT.OS_Lib.File_Descriptor - is + (Descriptor : Process_Descriptor) return GNAT.OS_Lib.File_Descriptor is begin return Descriptor.Output_Fd; end Get_Output_Fd; @@ -798,9 +792,7 @@ package body GNAT.Expect is ------------- function Get_Pid - (Descriptor : Process_Descriptor) - return Process_Id - is + (Descriptor : Process_Descriptor) return Process_Id is begin return Descriptor.Pid; end Get_Pid; @@ -847,7 +839,7 @@ package body GNAT.Expect is Arg : String_Access; Arg_List : String_List (1 .. Args'Length + 2); - C_Arg_List : aliased array (1 .. Args'Length + 2) of System.Address; + C_Arg_List : aliased array (1 .. Args'Length + 2) of System.Address; Command_With_Path : String_Access; @@ -1004,9 +996,9 @@ package body GNAT.Expect is ---------- procedure Send - (Descriptor : in out Process_Descriptor; - Str : String; - Add_LF : Boolean := True; + (Descriptor : in out Process_Descriptor; + Str : String; + Add_LF : Boolean := True; Empty_Buffer : Boolean := False) is Full_Str : constant String := Str & ASCII.LF; diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h index cdf2c225bcf..79fdf51250e 100644 --- a/gcc/ada/gigi.h +++ b/gcc/ada/gigi.h @@ -200,7 +200,7 @@ extern int gnat_gimplify_expr (tree *expr_p, tree *pre_p, /* Do the processing for the declaration of a GNAT_ENTITY, a type. If a separate Freeze node exists, delay the bulk of the processing. Otherwise - make a GCC type for GNAT_ENTITY and set up the correspondance. */ + make a GCC type for GNAT_ENTITY and set up the correspondence. */ extern void process_type (Entity_Id gnat_entity); /* Convert Sloc into *LOCUS (a location_t). Return true if this Sloc @@ -623,7 +623,7 @@ extern tree remove_conversions (tree exp, bool true_address); likewise return an expression pointing to the underlying array. */ extern tree maybe_unconstrained_array (tree exp); -/* Return an expression that does an unchecked converstion of EXPR to TYPE. +/* Return an expression that does an unchecked conversion of EXPR to TYPE. If NOTRUNC_P is true, truncation operations should be suppressed. */ extern tree unchecked_convert (tree type, tree expr, bool notrunc_p); diff --git a/gcc/ada/gmem.c b/gcc/ada/gmem.c index 002f78f77be..cb7e0a27205 100644 --- a/gcc/ada/gmem.c +++ b/gcc/ada/gmem.c @@ -83,7 +83,7 @@ gmem_read_backtrace (void) } /* initialize gmem feature from the dumpname file. It returns 1 if the - dumpname has beed generated by GMEM (instrumented malloc/free) and 0 if not + dumpname has been generated by GMEM (instrumented malloc/free) and 0 if not (i.e. probably a GDB generated file). */ diff --git a/gcc/ada/gnat-style.texi b/gcc/ada/gnat-style.texi index a3adc652ecd..ca875659652 100644 --- a/gcc/ada/gnat-style.texi +++ b/gcc/ada/gnat-style.texi @@ -332,7 +332,7 @@ sufficient, as comments. @node Declarations and Types, Expressions and Names, Lexical Elements,Top @section Declarations and Types @c ------------------------------------------------------------------------- -@cindex Declarationa and Types +@cindex Declarations and Types @itemize @bullet @item diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 6ba0fd94e77..6471f36a7a1 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -8,7 +8,7 @@ @c o @c G N A T _ RM o @c o -@c Copyright (C) 1995-2004 Free Software Foundation o +@c Copyright (C) 1995-2005 Free Software Foundation o @c o @c o @c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o @@ -521,7 +521,7 @@ of project files. @ref{Obsolescent Features} documents implementation dependent features, including pragmas and attributes, which are considered obsolescent, since there are other preferred ways of achieving the same results. These -obsolescent forms are retained for backwards compatibilty. +obsolescent forms are retained for backwards compatibility. @end itemize @@ -5156,24 +5156,18 @@ representation item for a given entity if each non-static expression in the representation item is a name that statically denotes a constant declared before the entity. @end cartouche -Followed. GNAT does not support non-static expressions in representation -clauses unless they are constants declared before the entity. For -example: +Followed. In fact, GNAT goes beyond the recommended level of support +by allowing nonstatic expressions in some representation clauses even +without the need to declare constants initialized with the values of +such expressions. +For example: @smallexample @c ada -X : Some_Type; -for X'Address use To_address (16#2000#); + X : Integer; + Y : Float; + for Y'Address use X'Address;>> @end smallexample -@noindent -will be rejected, since the To_Address expression is non-static. Instead -write: - -@smallexample @c ada -X_Address : constant Address : = To_Address (16#2000#); -X : Some_Type; -for X'Address use X_Address; -@end smallexample @sp 1 @cartouche @@ -12945,7 +12939,7 @@ example see the body of @code{GNAT.Tables}). @node System.Partition_Interface (s-parint.ads) @section @code{System.Partition_Interface} (@file{s-parint.ads}) @cindex @code{System.Partition_Interface} (@file{s-parint.ads}) -@cindex Partition intefacing functions +@cindex Partition interfacing functions @noindent This package provides facilities for partition interfacing. It @@ -14609,7 +14603,7 @@ of the @command{gnatls} utility to be used to retrieve information about the predefined path; e.g., @code{"gnatls"}, @code{"powerpc-wrs-vxworks-gnatls"}. @item VCS_Kind -This is a simple atribute. Is value is a string used to specify the +This is a simple attribute. Is value is a string used to specify the Version Control System (VCS) to be used for this project, e.g CVS, RCS ClearCase or Perforce. diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index d04028b3c09..7f4e0671f87 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -2962,7 +2962,7 @@ in section B.3 of the Ada 95 Reference Manual. @findex C varargs function @cindex Intefacing to C varargs function -@cindex varargs function intefacs +@cindex varargs function interfaces @item C varargs function In C, @code{varargs} allows a function to take a variable number of arguments. There is no direct equivalent in this to Ada. One @@ -4567,6 +4567,26 @@ This switch suppresses all optional warning messages, see remaining list in this section for details on optional warning messages that can be individually controlled. +@item -gnatwb +@emph{Activate warnings on bad fixed values.} +@cindex @option{-gnatwb} (@command{gcc}) +@cindex Bad fixed values +@cindex Fixed-point Small value +@cindex Small value +This switch activates warnings for static fixed-point expressions whose +value is not an exact multiple of Small. Such values are implementation +dependent, since an implementation is free to choose either of the multiples +that surround the value. GNAT always chooses the closer one, but this is not +required behavior, and it is better to specify a value that is an exact +multiple, ensuring predictable execution. The default is that such warnings +are not generated. + +@item -gnatwB +@emph{Suppress warnings on bad fixed values.} +@cindex @option{-gnatwB} (@command{gcc}) +This switch suppresses warnings for static fixed-point expressions whose +value is not an exact multiple of Small. + @item -gnatwc @emph{Activate warnings on conditionals.} @cindex @option{-gnatwc} (@command{gcc}) @@ -4701,7 +4721,7 @@ such warnings are not generated. In addition to the above cases, warnings are also generated for GNAT features that have been provided in past versions but which -have been superceded (typically by features in the new Ada standard). +have been superseded (typically by features in the new Ada standard). For example, @code{pragma Ravenscar} will be flagged since its function is replaced by @code{pragma Profile(Ravenscar)}. @@ -5341,6 +5361,12 @@ example: @end smallexample @end itemize +@item ^d^DOS_LINE_ENDINGS^ +@emph{Check no DOS line terminators present.} +If the ^letter d^word NOCRLF^ appears in the string after @option{-gnaty} +then all lines must be terminated by a single ASCII.LF character (in +particular the DOS line terminator sequence CR/LF is not allowed). + @item ^e^END^ @emph{Check end/exit labels.} If the ^letter e^word END^ appears in the string after @option{-gnaty} then @@ -9269,7 +9295,7 @@ the compiler optimizer can "know" that the value @code{Int1V.all} is constant for all iterations of the loop and avoid the extra memory reference required to dereference it each time through the loop. -This kind of optimziation, called strict aliasing analysis, is +This kind of optimization, called strict aliasing analysis, is triggered by specifying an optimization level of @option{-O2} or higher and allows @code{GNAT} to generate more efficient code when access values are involved. @@ -12557,7 +12583,7 @@ Additionally, you may define the library-related attributes The @code{Library_Name} attribute has a string value. There is no restriction on the name of a library. It is the responsability of the developer to -choose a name that will be accepted by the platform. It is recommanded to +choose a name that will be accepted by the platform. It is recommended to choose names that could be Ada identifiers; such names are almost guaranteed to be acceptable on all platforms. @@ -14646,7 +14672,8 @@ Align @code{:=} in assignment statements Align @code{=>} in associations @item ^-A5^/ALIGN=COMPONENT_CLAUSES^ -Align @code{at} keywords in the component clauses in record representation clauses +Align @code{at} keywords in the component clauses in record +representation clauses @end table @noindent @@ -15420,12 +15447,13 @@ the casing defined by the dictionary; no subwords are checked for this word @item for every subword @command{gnatpp} checks if the dictionary contains the -corresponding string of the form @code{*@var{simple_identifier}*}, and if it does, the -casing of this @var{simple_identifier} is used for this subword +corresponding string of the form @code{*@var{simple_identifier}*}, +and if it does, the casing of this @var{simple_identifier} is used +for this subword @item if the whole name does not contain any ``_'' inside, and if for this name -the dictionaty contains two entries - one of the form @var{identifier}, +the dictionary contains two entries - one of the form @var{identifier}, and another - of the form *@var{simple_identifier}*, then the first one is applied to define the casing of this name @@ -15972,7 +16000,7 @@ an explicit list of files. @cindex @option{^-v^/VERBOSE^} (@code{gnatmetric}) Verbose mode; @command{gnatmetric} generates version information and then -a trace of sources being procesed. +a trace of sources being processed. @item ^-dv^/DEBUG_OUTPUT^ @cindex @option{^-dv^/DEBUG_OUTPUT^} (@code{gnatmetric}) @@ -18140,7 +18168,7 @@ allocation and deallocation routines that record call information. This allows to obtain accurate dynamic memory usage history at a minimal cost to the execution speed. Note however, that @code{gnatmem} is not supported on all platforms (currently, it is supported on AIX, HP-UX, GNU/Linux x86, -Solaris (sparc and x86) and Windows NT/2000/XP (x86). +32-bit Solaris (sparc and x86) and Windows NT/2000/XP (x86). @noindent The @code{gnatmem} command has the form diff --git a/gcc/ada/i-cpp.adb b/gcc/ada/i-cpp.adb index 7eaa2197b9f..ca872c2544d 100644 --- a/gcc/ada/i-cpp.adb +++ b/gcc/ada/i-cpp.adb @@ -146,15 +146,6 @@ package body Interfaces.CPP is return Pos >= 0 and then TSD (Obj_Tag).Ancestor_Tags (Pos) = Typ_Tag; end CPP_CW_Membership; - --------------------------- - -- CPP_Get_Expanded_Name -- - --------------------------- - - function CPP_Get_Expanded_Name (T : Vtable_Ptr) return Address is - begin - return To_Address (TSD (T).Expanded_Name); - end CPP_Get_Expanded_Name; - -------------------------- -- CPP_Get_External_Tag -- -------------------------- @@ -164,15 +155,6 @@ package body Interfaces.CPP is return To_Address (TSD (T).External_Tag); end CPP_Get_External_Tag; - ------------------------------- - -- CPP_Get_Inheritance_Depth -- - ------------------------------- - - function CPP_Get_Inheritance_Depth (T : Vtable_Ptr) return Natural is - begin - return TSD (T).Idepth; - end CPP_Get_Inheritance_Depth; - ------------------------- -- CPP_Get_Prim_Op_Address -- ------------------------- @@ -205,18 +187,6 @@ package body Interfaces.CPP is return True; end CPP_Get_Remotely_Callable; - ----------------- - -- CPP_Get_TSD -- - ----------------- - - function CPP_Get_TSD (T : Vtable_Ptr) return Address is - use type System.Storage_Elements.Storage_Offset; - TSD_Ptr : constant Addr_Ptr := - To_Addr_Ptr (To_Address (T) - CPP_DT_Typeinfo_Ptr_Size); - begin - return TSD_Ptr.all; - end CPP_Get_TSD; - -------------------- -- CPP_Inherit_DT -- -------------------- @@ -238,17 +208,15 @@ package body Interfaces.CPP is --------------------- procedure CPP_Inherit_TSD - (Old_TSD : Address; + (Old_Tag : Vtable_Ptr; New_Tag : Vtable_Ptr) is - Old_TSD_Ptr : constant Type_Specific_Data_Ptr := - To_Type_Specific_Data_Ptr (Old_TSD); - - New_TSD_Ptr : constant Type_Specific_Data_Ptr := - TSD (New_Tag); + New_TSD_Ptr : constant Type_Specific_Data_Ptr := TSD (New_Tag); + Old_TSD_Ptr : Type_Specific_Data_Ptr; begin - if Old_TSD_Ptr /= null then + if Old_Tag /= null then + Old_TSD_Ptr := TSD (Old_Tag); New_TSD_Ptr.Idepth := Old_TSD_Ptr.Idepth + 1; New_TSD_Ptr.Ancestor_Tags (1 .. New_TSD_Ptr.Idepth) := Old_TSD_Ptr.Ancestor_Tags (0 .. Old_TSD_Ptr.Idepth); @@ -277,18 +245,6 @@ package body Interfaces.CPP is TSD (T).External_Tag := To_Cstring_Ptr (Value); end CPP_Set_External_Tag; - ------------------------------- - -- CPP_Set_Inheritance_Depth -- - ------------------------------- - - procedure CPP_Set_Inheritance_Depth - (T : Vtable_Ptr; - Value : Natural) - is - begin - TSD (T).Idepth := Value; - end CPP_Set_Inheritance_Depth; - ----------------------------- -- CPP_Set_Prim_Op_Address -- ----------------------------- @@ -421,8 +377,11 @@ package body Interfaces.CPP is --------- function TSD (T : Vtable_Ptr) return Type_Specific_Data_Ptr is + use type System.Storage_Elements.Storage_Offset; + TSD_Ptr : constant Addr_Ptr := + To_Addr_Ptr (To_Address (T) - CPP_DT_Typeinfo_Ptr_Size); begin - return To_Type_Specific_Data_Ptr (CPP_Get_TSD (T)); + return To_Type_Specific_Data_Ptr (TSD_Ptr.all); end TSD; end Interfaces.CPP; diff --git a/gcc/ada/i-cpp.ads b/gcc/ada/i-cpp.ads index df39bdb4df0..99922cf56ee 100644 --- a/gcc/ada/i-cpp.ads +++ b/gcc/ada/i-cpp.ads @@ -84,25 +84,10 @@ private -- this function returns the address of the virtual function stored -- in it (used for dispatching calls) - procedure CPP_Set_Inheritance_Depth - (T : Vtable_Ptr; - Value : Natural); - -- Given a pointer to a dispatch Table, stores the value representing - -- the depth in the inheritance tree. Used during elaboration of the - -- tagged type. - - function CPP_Get_Inheritance_Depth (T : Vtable_Ptr) return Natural; - -- Given a pointer to a dispatch Table, retreives the value representing - -- the depth in the inheritance tree. Used for membership. - procedure CPP_Set_TSD (T : Vtable_Ptr; Value : S.Address); -- Given a pointer T to a dispatch Table, stores the address of the -- record containing the Type Specific Data generated by GNAT - function CPP_Get_TSD (T : Vtable_Ptr) return S.Address; - -- Given a pointer T to a dispatch Table, retreives the address of the - -- record containing the Type Specific Data generated by GNAT - CPP_DT_Prologue_Size : constant SSE.Storage_Count := SSE.Storage_Count (2 * (Standard'Address_Size / S.Storage_Unit)); @@ -137,7 +122,7 @@ private -- inherited (Entry_Count). procedure CPP_Inherit_TSD - (Old_TSD : S.Address; + (Old_Tag : Vtable_Ptr; New_Tag : Vtable_Ptr); -- Entry point used to initialize the TSD of a type knowing the -- TSD of the direct ancestor. @@ -158,10 +143,6 @@ private -- Set the address of the string containing the expanded name -- in the Dispatch table - function CPP_Get_Expanded_Name (T : Vtable_Ptr) return S.Address; - -- Retrieve the address of a null terminated string containing - -- the expanded name - procedure CPP_Set_Remotely_Callable (T : Vtable_Ptr; Value : Boolean); -- Since the notions of spec/body distinction and categorized packages -- do not exist in C, this procedure will do nothing @@ -187,9 +168,8 @@ private -- (used for virtual function calls) function TSD (T : Vtable_Ptr) return Type_Specific_Data_Ptr; - -- This function is conceptually equivalent to Get_TSD, but - -- returning a Type_Specific_Data_Ptr type (rather than an Address) - -- simplifies the implementation of the other subprograms. + -- Given a pointer T to a dispatch Table, retreives the address of the + -- record containing the Type Specific Data generated by GNAT type Addr_Ptr is access System.Address; @@ -204,16 +184,12 @@ private pragma Inline (CPP_Set_Prim_Op_Address); pragma Inline (CPP_Get_Prim_Op_Address); - pragma Inline (CPP_Set_Inheritance_Depth); - pragma Inline (CPP_Get_Inheritance_Depth); pragma Inline (CPP_Set_TSD); - pragma Inline (CPP_Get_TSD); pragma Inline (CPP_Inherit_DT); pragma Inline (CPP_CW_Membership); pragma Inline (CPP_Set_External_Tag); pragma Inline (CPP_Get_External_Tag); pragma Inline (CPP_Set_Expanded_Name); - pragma Inline (CPP_Get_Expanded_Name); pragma Inline (CPP_Set_Remotely_Callable); pragma Inline (CPP_Get_Remotely_Callable); pragma Inline (Displaced_This); diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb index 9aae8522193..f1303a2eb0a 100644 --- a/gcc/ada/impunit.adb +++ b/gcc/ada/impunit.adb @@ -363,6 +363,7 @@ package body Impunit is "a-swunha", -- Ada.Strings.Wide_Unbounded.Hash "a-szmzco", -- Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants; "a-szunha", -- Ada.Strings.Wide_Wide_Unbounded.Hash + "a-tgdico", -- Ada.Tags.Generic_Dispatching_Constructor; "a-tiunio", -- Ada.Text_IO.Unbounded_IO; "a-wwunio", -- Ada.Wide_Text_IO.Wide_Unbounded_IO; "a-zttest", -- Ada.Wide_Wide_Text_IO.Text_Streams diff --git a/gcc/ada/init.c b/gcc/ada/init.c index e2b6ec44af7..12a9badafc2 100644 --- a/gcc/ada/init.c +++ b/gcc/ada/init.c @@ -291,7 +291,7 @@ __gnat_set_globals (int main_priority, as the faulting instruction address in the corresponding signal context pushed by the kernel. Leaving this address untouched may loose, because if the triggering instruction happens to be the very first of a region, the - later adjustements performed by the unwinder would yield an address outside + later adjustments performed by the unwinder would yield an address outside that region. We need to compensate for those adjustments at some point, which we currently do in the GCC unwinding fallback macro. @@ -1291,7 +1291,7 @@ extern Exception_Code Base_Code_In (Exception_Code); /* Define macro symbols for the VMS conditions that become Ada exceptions. Most of these are also defined in the header file ssdef.h which has not - yet been converted to be recoginized by Gnu C. Some, which couldn't be + yet been converted to be recognized by Gnu C. Some, which couldn't be located, are assigned names based on the DEC test suite tests which raise them. */ @@ -1318,7 +1318,7 @@ long __gnat_error_handler (int *, void *); still need to be handled by such handlers, however, in which case __gnat_error_handler needs to return SS$_RESIGNAL. Consider for instance the use of a third party library compiled with DECAda and - performing it's own exception handling internally. + performing its own exception handling internally. To allow some user-level flexibility, which conditions should be resignaled is controlled by a predicate function, provided with the @@ -1337,7 +1337,7 @@ long __gnat_error_handler (int *, void *); ??? This is not a perfect solution to deal with the possible interactions between the GNAT and the DECAda exception handling models and better (more general) schemes are studied. This is so - just provided as a conveniency workaround in the meantime, and + just provided as a convenient workaround in the meantime, and should be use with caution since the implementation has been kept very simple. */ @@ -1761,7 +1761,7 @@ __gnat_init_float (void) asm ("mtfsb0 26"); #endif - /* Similarily for sparc64. Achieved by masking bits in the Trap Enable Mask + /* Similarly for sparc64. Achieved by masking bits in the Trap Enable Mask field of the Floating-point Status Register (see the Sparc Architecture Manual Version 9, p 48). */ #if defined (sparc64) diff --git a/gcc/ada/lang.opt b/gcc/ada/lang.opt index 584220c2ea8..2d0172cbe82 100644 --- a/gcc/ada/lang.opt +++ b/gcc/ada/lang.opt @@ -18,7 +18,7 @@ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA ; 02111-1307, USA. -; See c.opt for a description of this file's format. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -65,6 +65,10 @@ gant Ada Joined Undocumented ; Catches typos +gnatO +Ada Separate +; Sets name of output ALI file (internal switch) + gnat Ada Joined -gnat Specify options to GNAT diff --git a/gcc/ada/link.c b/gcc/ada/link.c index cc415ad0f0d..97ff11468c7 100644 --- a/gcc/ada/link.c +++ b/gcc/ada/link.c @@ -30,7 +30,7 @@ * * ****************************************************************************/ -/* This file contains host-specific parameters describing the behaviour */ +/* This file contains host-specific parameters describing the behavior */ /* of the linker. It is used by gnatlink as well as all tools that use */ /* Mlib. */ diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 71f95c495ca..563b7725519 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -3931,10 +3931,20 @@ package body Make is All_Projects => Unique_Compile_All_Projects, Into_Q => False); - -- If there are no sources to compile, we fail + -- If no sources to compile, then there is nothing to do if Osint.Number_Of_Files = 0 then - Make_Failed ("no sources to compile"); + if not Debug.Debug_Flag_N then + Delete_Mapping_Files; + Prj.Env.Delete_All_Path_Files (Project_Tree); + end if; + + if not Quiet_Output then + Osint.Write_Program_Name; + Write_Line (": no sources to compile"); + end if; + + Exit_Program (E_Success); end if; end if; @@ -6127,6 +6137,13 @@ package body Make is Osint.Add_File (Get_Name_String (Sfile)); Put_In_Q := True; + + -- As we may look into the Q later, ensure the Q has been + -- initialized to avoid errors. + + if First_Q_Initialization then + Init_Q; + end if; end if; end loop; end Insert_Project_Sources; diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index 4646c863e8a..b8a3299ef49 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -137,8 +137,6 @@ static tree gnat_type_max_size (tree); #define LANG_HOOKS_EXPAND_EXPR gnat_expand_expr #undef LANG_HOOKS_MARK_ADDRESSABLE #define LANG_HOOKS_MARK_ADDRESSABLE gnat_mark_addressable -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION gnat_truthvalue_conversion #undef LANG_HOOKS_PRINT_DECL #define LANG_HOOKS_PRINT_DECL gnat_print_decl #undef LANG_HOOKS_PRINT_TYPE @@ -259,7 +257,6 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) const struct cl_option *option = &cl_options[scode]; enum opt_code code = (enum opt_code) scode; char *q; - unsigned int i; if (arg == NULL && (option->flags & (CL_JOINED | CL_SEPARATE))) { @@ -304,7 +301,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) break; case OPT_gant: - warning ("%<-gnat%> misspelled as %<-gant%>"); + warning (0, "%<-gnat%> misspelled as %<-gant%>"); /* ... fall through ... */ @@ -314,17 +311,13 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED) gnat_argv[gnat_argc][0] = '-'; strcpy (gnat_argv[gnat_argc] + 1, arg); gnat_argc++; + break; - if (arg[0] == 'O') - for (i = 1; i < save_argc - 1; i++) - if (!strncmp (save_argv[i], "-gnatO", 6)) - if (save_argv[++i][0] != '-') - { - /* Preserve output filename as GCC doesn't save it for GNAT. */ - gnat_argv[gnat_argc] = xstrdup (save_argv[i]); - gnat_argc++; - break; - } + case OPT_gnatO: + gnat_argv[gnat_argc] = xstrdup ("-O"); + gnat_argc++; + gnat_argv[gnat_argc] = xstrdup (arg); + gnat_argc++; break; } @@ -506,7 +499,12 @@ gnat_print_decl (FILE *file, tree node, int indent) break; case FIELD_DECL: - print_node (file, "original field", DECL_ORIGINAL_FIELD (node), + print_node (file, "original_field", DECL_ORIGINAL_FIELD (node), + indent + 4); + break; + + case VAR_DECL: + print_node (file, "renamed_object", DECL_RENAMED_OBJECT (node), indent + 4); break; diff --git a/gcc/ada/mlib-tgt-darwin.adb b/gcc/ada/mlib-tgt-darwin.adb index 1b168a9d7b8..0468fbd5dbd 100644 --- a/gcc/ada/mlib-tgt-darwin.adb +++ b/gcc/ada/mlib-tgt-darwin.adb @@ -7,7 +7,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -48,15 +48,13 @@ package body MLib.Tgt is Wl_Init_String : aliased String := "-Wl,-init"; Wl_Init : constant String_Access := Wl_Init_String'Access; - Wl_Fini_String : aliased String := "-Wl,-fini"; - Wl_Fini : constant String_Access := Wl_Fini_String'Access; Init_Fini_List : constant Argument_List_Access := new Argument_List'(1 => Wl_Init, - 2 => null, - 3 => Wl_Fini, - 4 => null); - -- Used to put switches for automatic elaboration/finalization + 2 => null); + -- Used to put switches for automatic elaboration. Note that there is no + -- linking option on Darwin for automatic finalization of a shared + -- library. --------------------- -- Archive_Builder -- @@ -145,8 +143,7 @@ package body MLib.Tgt is if Auto_Init then Init_Fini := Init_Fini_List; - Init_Fini (2) := new String'("-Wl," & Lib_Filename & "init"); - Init_Fini (4) := new String'("-Wl," & Lib_Filename & "final"); + Init_Fini (2) := new String'("-Wl,_" & Lib_Filename & "init"); end if; if Lib_Version = "" then @@ -158,7 +155,11 @@ package body MLib.Tgt is Options_2 => Options_2); else - Version_Arg := new String'("-Wl,-flat_namespace"); -- ??? + -- Instruct the linker to build the shared library as a flat + -- namespace image, which is not the default. The default is a two + -- level namespace image. + + Version_Arg := new String'("-Wl,-flat_namespace"); if Is_Absolute_Path (Lib_Version) then Utl.Gcc @@ -250,7 +251,7 @@ package body MLib.Tgt is function Is_Archive_Ext (Ext : String) return Boolean is begin - return Ext = ".a" or else Ext = ".dyld"; + return Ext = ".dylib" or else Ext = ".a"; end Is_Archive_Ext; ------------- diff --git a/gcc/ada/mlib-tgt-vms-alpha.adb b/gcc/ada/mlib-tgt-vms-alpha.adb index ca7596b22f9..ed713ca3984 100644 --- a/gcc/ada/mlib-tgt-vms-alpha.adb +++ b/gcc/ada/mlib-tgt-vms-alpha.adb @@ -160,8 +160,10 @@ package body MLib.Tgt is -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt" function Version_String return String; - -- Returns Lib_Version if not empty, otherwise returns "1". - -- Fails gnatmake if Lib_Version is not the image of a positive number. + -- Returns Lib_Version if not empty and if Symbol_Data.Symbol_Policy is + -- not Autonomous, otherwise returns "". + -- When Symbol_Data.Symbol_Policy is Autonomous, fails gnatmake if + -- Lib_Version is not the image of a positive number. ------------------ -- Is_Interface -- @@ -215,8 +217,10 @@ package body MLib.Tgt is function Version_String return String is Version : Integer := 0; begin - if Lib_Version = "" then - return "1"; + if Lib_Version = "" + or else Symbol_Data.Symbol_Policy /= Autonomous + then + return ""; else begin diff --git a/gcc/ada/mlib-tgt-vms-ia64.adb b/gcc/ada/mlib-tgt-vms-ia64.adb index d3fba7e708f..8dfbcc2ed80 100644 --- a/gcc/ada/mlib-tgt-vms-ia64.adb +++ b/gcc/ada/mlib-tgt-vms-ia64.adb @@ -160,8 +160,10 @@ package body MLib.Tgt is -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt" function Version_String return String; - -- Returns Lib_Version if not empty, otherwise returns "1". - -- Fails gnatmake if Lib_Version is not the image of a positive number. + -- Returns Lib_Version if not empty and if Symbol_Data.Symbol_Policy is + -- not Autonomous, otherwise returns "". + -- When Symbol_Data.Symbol_Policy is Autonomous, fails gnatmake if + -- Lib_Version is not the image of a positive number. ------------------ -- Is_Interface -- @@ -215,8 +217,10 @@ package body MLib.Tgt is function Version_String return String is Version : Integer := 0; begin - if Lib_Version = "" then - return "1"; + if Lib_Version = "" + or else Symbol_Data.Symbol_Policy /= Autonomous + then + return ""; else begin diff --git a/gcc/ada/namet.adb b/gcc/ada/namet.adb index d462d1152e5..b10696dc863 100644 --- a/gcc/ada/namet.adb +++ b/gcc/ada/namet.adb @@ -36,6 +36,7 @@ -- which is created manually from namet.ads and namet.adb. with Debug; use Debug; +with Opt; use Opt; with Output; use Output; with Tree_IO; use Tree_IO; with Widechar; use Widechar; @@ -299,7 +300,20 @@ package body Namet is and then Name_Buffer (Old + 1) /= '_' then Old := Old + 1; - Insert_Character (Character'Val (Hex (2))); + + -- If we have upper half encoding, then we have to set an + -- appropriate wide character sequence for this character. + + if Upper_Half_Encoding then + Widechar.Set_Wide (Char_Code (Hex (2)), New_Buf, New_Len); + + -- For other encoding methods, upper half characters can + -- simply use their normal representation. + + else + Insert_Character (Character'Val (Hex (2))); + end if; + -- WW (wide wide character insertion) diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads index 52f152203f3..29acc92567d 100644 --- a/gcc/ada/opt.ads +++ b/gcc/ada/opt.ads @@ -1025,6 +1025,11 @@ package Opt is -- Set to True to get verbose mode (full error message text and location -- information sent to standard output, also header, copyright and summary) + Warn_On_Bad_Fixed_Value : Boolean := False; + -- GNAT + -- Set to True to generate warnings for static fixed-point expression + -- values that are not an exact multiple of the small value of the type. + Warn_On_Constant : Boolean := False; -- GNAT -- Set to True to generate warnings for variables that could be declared diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb index 50fa7e50cb4..bf76e4704b4 100644 --- a/gcc/ada/par-ch10.adb +++ b/gcc/ada/par-ch10.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1090,6 +1090,8 @@ package body Ch10 is loop exit when Loc = Token_Ptr; + -- Should we worry about UTF_32 line terminators here + if Source (Loc) in Line_Terminator then Skip_Line_Terminators (Loc, Physical); exit when Physical; diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb index 56ec4a15f39..ae6b6cd48d5 100644 --- a/gcc/ada/par-ch12.adb +++ b/gcc/ada/par-ch12.adb @@ -153,7 +153,11 @@ package body Ch12 is Decl_Loop : loop P_Pragmas_Opt (Decls); - Ignore (Tok_Private); + + if Token = Tok_Private then + Error_Msg_S ("generic private child packages not permitted"); + Scan; -- past PRIVATE + end if; if Token = Tok_Use then Append (P_Use_Clause, Decls); diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index d28f1a9a07d..0c02ff7d035 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -279,8 +279,29 @@ package body Ch3 is begin Type_Loc := Token_Ptr; Type_Start_Col := Start_Column; - T_Type; - Ident_Node := P_Defining_Identifier (C_Is); + + -- If we have TYPE, then proceed ahead and scan identifier + + if Token = Tok_Type then + Scan; -- past TYPE + Ident_Node := P_Defining_Identifier (C_Is); + + -- Otherwise this is an error case, and we may already have converted + -- the current token to a defining identifier, so don't do it again! + + else + T_Type; + + if Token = Tok_Identifier + and then Nkind (Token_Node) = N_Defining_Identifier + then + Ident_Node := Token_Node; + Scan; -- past defining identifier + else + Ident_Node := P_Defining_Identifier (C_Is); + end if; + end if; + Discr_Sloc := Token_Ptr; if P_Unknown_Discriminant_Part_Opt then @@ -586,7 +607,14 @@ package body Ch3 is -- Ada 2005 (AI-251): LIMITED INTERFACE - elsif Token = Tok_Interface then + -- If we are compiling in Ada 83 or Ada 95 mode, "interface" + -- is not a reserved word but we force its analysis to + -- generate the corresponding usage error. + + elsif Token = Tok_Interface + or else (Token = Tok_Identifier + and then Chars (Token_Node) = Name_Interface) + then Typedef_Node := P_Interface_Type_Definition (Is_Synchronized => False); Abstract_Present := True; diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index 5826606352e..a013c23ae2a 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -402,8 +402,25 @@ package body Ch4 is if Apostrophe_Should_Be_Semicolon then Expr_Form := EF_Name; return Name_Node; + + -- Here for a bad attribute name + else Signal_Bad_Attribute; + Scan; -- past bad identifier + + if Token = Tok_Left_Paren then + Scan; -- past left paren + + loop + Discard_Junk_Node (P_Expression); + exit when not Comma_Present; + end loop; + + T_Right_Paren; + end if; + + return Error; end if; end if; diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb index 8b4e69081b7..290ad0b74da 100644 --- a/gcc/ada/par.adb +++ b/gcc/ada/par.adb @@ -1318,9 +1318,9 @@ begin end if; end; - -- Here if we are not skipping a file in multiple unit per file - -- mode. Parse the unit that we are interested in. Note that in - -- check syntax mode we are interested in all units in the file. + -- Here if we are not skipping a file in multiple unit per file + -- mode. Parse the unit that we are interested in. Note that in + -- check syntax mode we are interested in all units in the file. else declare @@ -1355,25 +1355,38 @@ begin Name := Uname (Uname'First .. Uname'Last - 2); - if (Name = "ada" or else - Name = "calendar" or else - Name = "interfaces" or else - Name = "system" or else - Name = "machine_code" or else - Name = "unchecked_conversion" or else - Name = "unchecked_deallocation" - or else (Name'Length > 4 - and then - Name (Name'First .. Name'First + 3) = - "ada.") - or else (Name'Length > 11 - and then - Name (Name'First .. Name'First + 10) = - "interfaces.") - or else (Name'Length > 7 - and then - Name (Name'First .. Name'First + 6) = - "system.")) + if Name = "ada" or else + Name = "calendar" or else + Name = "interfaces" or else + Name = "system" or else + Name = "machine_code" or else + Name = "unchecked_conversion" or else + Name = "unchecked_deallocation" + then + Error_Msg + ("language defined units may not be recompiled", + Sloc (Unit (Comp_Unit_Node))); + + elsif Name'Length > 4 + and then + Name (Name'First .. Name'First + 3) = "ada." + then + Error_Msg + ("descendents of package Ada " & + "may not be compiled", + Sloc (Unit (Comp_Unit_Node))); + + elsif Name'Length > 11 + and then + Name (Name'First .. Name'First + 10) = "interfaces." + then + Error_Msg + ("descendents of package Interfaces " & + "may not be compiled", + Sloc (Unit (Comp_Unit_Node))); + + elsif Name'Length > 7 + and then Name (Name'First .. Name'First + 6) = "system." and then Name /= "system.rpc" and then (Name'Length < 11 @@ -1381,7 +1394,8 @@ begin "system.rpc.") then Error_Msg - ("language defined units may not be recompiled", + ("descendents of package System " & + "may not be compiled", Sloc (Unit (Comp_Unit_Node))); end if; end; diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb index c51fbd5efab..fcdaf67c251 100644 --- a/gcc/ada/prj-nmsc.adb +++ b/gcc/ada/prj-nmsc.adb @@ -606,9 +606,9 @@ package body Prj.Nmsc is Naming : Naming_Data) is begin - -- Only check if we are not using the standard naming scheme + -- Only check if we are not using the Default naming scheme - if Naming /= Standard_Naming_Data then + if Naming /= In_Tree.Private_Part.Default_Naming then declare Dot_Replacement : constant String := Get_Name_String @@ -2466,32 +2466,6 @@ package body Prj.Nmsc is Lib_Ref_Symbol_File.Location); end if; - -- Check that the reference symbol file and the symbol file - -- are not the same file. - - if Data.Symbol_Data.Symbol_File /= No_Name then - declare - Symbol : String := - Get_Name_String - (Data.Symbol_Data.Symbol_File); - - Reference : String := - Get_Name_String - (Data.Symbol_Data.Reference); - - begin - Canonical_Case_File_Name (Symbol); - Canonical_Case_File_Name (Reference); - - if Symbol = Reference then - Error_Msg - (Project, In_Tree, - "reference symbol file and symbol file " & - "cannot be the same file", - Lib_Ref_Symbol_File.Location); - end if; - end; - end if; end if; end if; end if; diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb index 54d2812d7a6..1b100843b42 100644 --- a/gcc/ada/prj-part.adb +++ b/gcc/ada/prj-part.adb @@ -1068,8 +1068,8 @@ package body Prj.Part is -- Mark location of PROJECT token if present if Token = Tok_Project then + Scan (In_Tree); -- scan past PROJECT Set_Location_Of (Project, In_Tree, Token_Ptr); - Scan (In_Tree); -- scan past project end if; -- Clear the Buffer diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb index c67f2a3305f..7ccd5750cf3 100644 --- a/gcc/ada/prj-proc.adb +++ b/gcc/ada/prj-proc.adb @@ -33,6 +33,7 @@ with Prj.Attr; use Prj.Attr; with Prj.Err; use Prj.Err; with Prj.Ext; use Prj.Ext; with Prj.Nmsc; use Prj.Nmsc; +with Sinput; use Sinput; with Snames; with GNAT.Case_Util; use GNAT.Case_Util; @@ -781,14 +782,31 @@ package body Prj.Proc is Default : Name_Id := No_Name; Value : Name_Id := No_Name; + Def_Var : Variable_Value; + Default_Node : constant Project_Node_Id := External_Default_Of (The_Current_Term, From_Project_Node_Tree); begin + -- If there is a default value for the external reference, + -- get its value. + if Default_Node /= Empty_Node then - Default := - String_Value_Of (Default_Node, From_Project_Node_Tree); + Def_Var := Expression + (Project => Project, + In_Tree => In_Tree, + From_Project_Node => Default_Node, + From_Project_Node_Tree => From_Project_Node_Tree, + Pkg => Pkg, + First_Term => + Tree.First_Term + (Default_Node, From_Project_Node_Tree), + Kind => Single); + + if Def_Var /= Nil_Variable_Value then + Default := Def_Var.Value; + end if; end if; Value := Prj.Ext.Value_Of (Name, Default); @@ -1057,11 +1075,12 @@ package body Prj.Proc is Obj_Dir then if In_Tree.Projects.Table (Extending2).Virtual then - Error_Msg_Name_1 := In_Tree.Projects.Table (Proj).Name; + Error_Msg_Name_1 := + In_Tree.Projects.Table (Proj).Display_Name; if Error_Report = null then Error_Msg - ("project % cannot be extended by a virtual " & + ("project { cannot be extended by a virtual " & "project with the same object directory", In_Tree.Projects.Table (Proj).Location); else @@ -1075,13 +1094,13 @@ package body Prj.Proc is else Error_Msg_Name_1 := - In_Tree.Projects.Table (Extending2).Name; + In_Tree.Projects.Table (Extending2).Display_Name; Error_Msg_Name_2 := - In_Tree.Projects.Table (Proj).Name; + In_Tree.Projects.Table (Proj).Display_Name; if Error_Report = null then Error_Msg - ("project % cannot extend project %", + ("project { cannot extend project {", In_Tree.Projects.Table (Extending2).Location); Error_Msg ("\they share the same object directory", @@ -2158,8 +2177,14 @@ package body Prj.Proc is Processed_Data : Project_Data := Empty_Project (In_Tree); Imported : Project_List := Empty_Project_List; Declaration_Node : Project_Node_Id := Empty_Node; + Tref : Source_Buffer_Ptr; Name : constant Name_Id := - Name_Of (From_Project_Node, From_Project_Node_Tree); + Name_Of + (From_Project_Node, From_Project_Node_Tree); + Location : Source_Ptr := + Location_Of + (From_Project_Node, From_Project_Node_Tree); + begin Project := Processed_Projects.Get (Name); @@ -2184,6 +2209,26 @@ package body Prj.Proc is Virtual_Prefix then Processed_Data.Virtual := True; + Processed_Data.Display_Name := Name; + + -- If there is no file, for example when the project node tree is + -- built in memory by GPS, the Display_Name cannot be found in + -- the source, so its value is the same as Name. + + elsif Location = No_Location then + Processed_Data.Display_Name := Name; + + -- Get the spelling of the project name from the project file + + else + Tref := Source_Text (Get_Source_File_Index (Location)); + + for J in 1 .. Name_Len loop + Name_Buffer (J) := Tref (Location); + Location := Location + 1; + end loop; + + Processed_Data.Display_Name := Name_Find; end if; Processed_Data.Display_Path_Name := @@ -2202,7 +2247,6 @@ package body Prj.Proc is Processed_Data.Directory := Name_Find; Processed_Data.Extended_By := Extended_By; - Processed_Data.Naming := Standard_Naming_Data; Add_Attributes (Project, In_Tree, Processed_Data.Decl, Attribute_First); diff --git a/gcc/ada/prj-strt.adb b/gcc/ada/prj-strt.adb index ae7941c203b..91539e94083 100644 --- a/gcc/ada/prj-strt.adb +++ b/gcc/ada/prj-strt.adb @@ -106,8 +106,10 @@ package body Prj.Strt is -- Add one single names to table Names procedure External_Reference - (In_Tree : Project_Node_Tree_Ref; - External_Value : out Project_Node_Id); + (In_Tree : Project_Node_Tree_Ref; + Current_Project : Project_Node_Id; + Current_Package : Project_Node_Id; + External_Value : out Project_Node_Id); -- Parse an external reference. Current token is "external". procedure Attribute_Reference @@ -341,8 +343,10 @@ package body Prj.Strt is ------------------------ procedure External_Reference - (In_Tree : Project_Node_Tree_Ref; - External_Value : out Project_Node_Id) + (In_Tree : Project_Node_Tree_Ref; + Current_Project : Project_Node_Id; + Current_Package : Project_Node_Id; + External_Value : out Project_Node_Id) is Field_Id : Project_Node_Id := Empty_Node; @@ -397,24 +401,31 @@ package body Prj.Strt is Scan (In_Tree); - Expect (Tok_String_Literal, "literal string"); + -- Get the string expression for the default - -- Get the default + declare + Loc : constant Source_Ptr := Token_Ptr; - if Token = Tok_String_Literal then - Field_Id := - Default_Project_Node - (Of_Kind => N_Literal_String, - In_Tree => In_Tree, - And_Expr_Kind => Single); - Set_String_Value_Of (Field_Id, In_Tree, To => Token_Name); - Set_External_Default_Of - (External_Value, In_Tree, To => Field_Id); - Scan (In_Tree); - Expect (Tok_Right_Paren, "`)`"); - end if; + begin + Parse_Expression + (In_Tree => In_Tree, + Expression => Field_Id, + Current_Project => Current_Project, + Current_Package => Current_Package, + Optional_Index => False); + + if Expression_Kind_Of (Field_Id, In_Tree) = List then + Error_Msg ("expression must be a single string", Loc); + else + Set_External_Default_Of + (External_Value, In_Tree, To => Field_Id); + end if; + end; + + Expect (Tok_Right_Paren, "`)`"); -- Scan past the right parenthesis + if Token = Tok_Right_Paren then Scan (In_Tree); end if; @@ -1417,7 +1428,10 @@ package body Prj.Strt is end if; External_Reference - (In_Tree => In_Tree, External_Value => Reference); + (In_Tree => In_Tree, + Current_Project => Current_Project, + Current_Package => Current_Package, + External_Value => Reference); Set_Current_Term (Term, In_Tree, To => Reference); when others => diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb index 8158de78dc5..83dab6944b9 100644 --- a/gcc/ada/prj.adb +++ b/gcc/ada/prj.adb @@ -90,6 +90,7 @@ package body Prj is Supp_Languages => No_Supp_Language_Index, First_Referred_By => No_Project, Name => No_Name, + Display_Name => No_Name, Path_Name => No_Name, Display_Path_Name => No_Name, Virtual => False, @@ -227,9 +228,10 @@ package body Prj is ------------------- function Empty_Project (Tree : Project_Tree_Ref) return Project_Data is - Value : Project_Data := Project_Empty; + Value : Project_Data; begin Prj.Initialize (Tree => No_Project_Tree); + Value := Project_Empty; Value.Naming := Tree.Private_Part.Default_Naming; return Value; end Empty_Project; @@ -650,7 +652,7 @@ package body Prj is end Set; procedure Set - (Language_Processing : in Language_Processing_Data; + (Language_Processing : Language_Processing_Data; For_Language : Language_Index; In_Project : in out Project_Data; In_Tree : Project_Tree_Ref) @@ -672,8 +674,7 @@ package body Prj is begin while Supp_Index /= No_Supp_Language_Index loop - Supp := In_Tree.Supp_Languages.Table - (Supp_Index); + Supp := In_Tree.Supp_Languages.Table (Supp_Index); if Supp.Index = For_Language then In_Tree.Supp_Languages.Table @@ -755,8 +756,8 @@ package body Prj is -- Standard_Naming_Data -- -------------------------- - function Standard_Naming_Data (Tree : Project_Tree_Ref := No_Project_Tree) - return Naming_Data + function Standard_Naming_Data + (Tree : Project_Tree_Ref := No_Project_Tree) return Naming_Data is begin if Tree = No_Project_Tree then @@ -793,8 +794,7 @@ package body Prj is begin while Supp_Index /= No_Supp_Language_Index loop - Supp := In_Tree.Supp_Suffixes.Table - (Supp_Index); + Supp := In_Tree.Supp_Suffixes.Table (Supp_Index); if Supp.Index = Language then return Supp.Suffix; diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads index a1b685e153d..cfe0da08f75 100644 --- a/gcc/ada/prj.ads +++ b/gcc/ada/prj.ads @@ -422,7 +422,7 @@ package Prj is Attributes => No_Variable, Arrays => No_Array, Packages => No_Package); - -- Default value of Declarations: indicates that there is no declarations. + -- Default value of Declarations: indicates that there is no declarations type Package_Element is record Name : Name_Id := No_Name; @@ -430,7 +430,7 @@ package Prj is Parent : Package_Id := No_Package; Next : Package_Id := No_Package; end record; - -- A package. Includes declarations that may include other packages. + -- A package. Includes declarations that may include other packages package Package_Table is new GNAT.Dynamic_Tables (Table_Component_Type => Package_Element, @@ -438,7 +438,7 @@ package Prj is Table_Low_Bound => 1, Table_Initial => 100, Table_Increment => 100); - -- The table that contains all packages. + -- The table that contains all packages function Image (Casing : Casing_Type) return String; -- Similar to 'Image (but avoid use of this attribute in compiler) @@ -452,14 +452,14 @@ package Prj is type Naming_Data is record Dot_Replacement : Name_Id := No_Name; - -- The string to replace '.' in the source file name (for Ada). + -- The string to replace '.' in the source file name (for Ada) Dot_Repl_Loc : Source_Ptr := No_Location; - -- The position in the project file source where - -- Dot_Replacement is defined. + -- The position in the project file source where Dot_Replacement is + -- defined. Casing : Casing_Type := All_Lower_Case; - -- The casing of the source file name (for Ada). + -- The casing of the source file name (for Ada) Spec_Suffix : Array_Element_Id := No_Array_Element; -- The string to append to the unit name for the @@ -490,17 +490,17 @@ package Prj is -- Ada_Body_Suffix is defined. Separate_Suffix : Name_Id := No_Name; - -- String to append to unit name for source file name of an Ada subunit. + -- String to append to unit name for source file name of an Ada subunit Sep_Suffix_Loc : Source_Ptr := No_Location; - -- Position in the project file source where Separate_Suffix is defined. + -- Position in the project file source where Separate_Suffix is defined Specs : Array_Element_Id := No_Array_Element; - -- An associative array mapping individual specs to source file names. + -- An associative array mapping individual specs to source file names -- This is specific to Ada. Bodies : Array_Element_Id := No_Array_Element; - -- An associative array mapping individual bodies to source file names. + -- An associative array mapping individual bodies to source file names -- This is specific to Ada. Specification_Exceptions : Array_Element_Id := No_Array_Element; @@ -513,8 +513,8 @@ package Prj is end record; - function Standard_Naming_Data (Tree : Project_Tree_Ref := No_Project_Tree) - return Naming_Data; + function Standard_Naming_Data + (Tree : Project_Tree_Ref := No_Project_Tree) return Naming_Data; pragma Inline (Standard_Naming_Data); -- The standard GNAT naming scheme when Tree is No_Project_Tree. -- Otherwise, return the default naming scheme for the project tree Tree, @@ -554,15 +554,18 @@ package Prj is -- Indicate the different languages of the source of this project First_Referred_By : Project_Id := No_Project; - -- The project, if any, that was the first to be known - -- as importing or extending this project. - -- Set by Prj.Proc.Process. + -- The project, if any, that was the first to be known as importing or + -- extending this project. Set by Prj.Proc.Process. Name : Name_Id := No_Name; - -- The name of the project. Set by Prj.Proc.Process. + -- The name of the project. Set by Prj.Proc.Process + + Display_Name : Name_Id := No_Name; + -- The name of the project with the spelling of its declaration. + -- Set by Prj.Proc.Process. Path_Name : Name_Id := No_Name; - -- The path name of the project file. Set by Prj.Proc.Process. + -- The path name of the project file. Set by Prj.Proc.Process Display_Path_Name : Name_Id := No_Name; -- The path name used for display purposes. May be different from @@ -576,36 +579,36 @@ package Prj is -- project. Set by Prj.Proc.Process. Mains : String_List_Id := Nil_String; - -- List of mains specified by attribute Main. Set by Prj.Nmsc.Check. + -- List of mains specified by attribute Main. Set by Prj.Nmsc.Check Directory : Name_Id := No_Name; - -- Directory where the project file resides. Set by Prj.Proc.Process. + -- Directory where the project file resides. Set by Prj.Proc.Process Display_Directory : Name_Id := No_Name; Dir_Path : String_Access; - -- Same as Directory, but as an access to String. - -- Set by Make.Compile_Sources.Collect_Arguments_And_Compile. + -- Same as Directory, but as an access to String. Set by + -- Make.Compile_Sources.Collect_Arguments_And_Compile. Library : Boolean := False; - -- True if this is a library project. - -- Set by Prj.Nmsc.Language_Independent_Check. + -- True if this is a library project. Set by + -- Prj.Nmsc.Language_Independent_Check. Library_Dir : Name_Id := No_Name; - -- If a library project, directory where resides the library - -- Set by Prj.Nmsc.Language_Independent_Check. + -- If a library project, directory where resides the library Set by + -- Prj.Nmsc.Language_Independent_Check. Display_Library_Dir : Name_Id := No_Name; - -- The name of the library directory, for display purposes. - -- May be different from Library_Dir for platforms where the file names - -- are case-insensitive. + -- The name of the library directory, for display purposes. May be + -- different from Library_Dir for platforms where the file names are + -- case-insensitive. Library_Src_Dir : Name_Id := No_Name; -- If a library project, directory where the sources and the ALI files -- of the library are copied. By default, if attribute Library_Src_Dir -- is not specified, sources are not copied anywhere and ALI files are - -- copied in the Library Directory. - -- Set by Prj.Nmsc.Language_Independent_Check. + -- copied in the Library Directory. Set by + -- Prj.Nmsc.Language_Independent_Check. Display_Library_Src_Dir : Name_Id := No_Name; -- The name of the library source directory, for display purposes. @@ -621,16 +624,16 @@ package Prj is -- Set by Prj.Nmsc.Language_Independent_Check. Lib_Internal_Name : Name_Id := No_Name; - -- If a library project, internal name store inside the library - -- Set by Prj.Nmsc.Language_Independent_Check. + -- If a library project, internal name store inside the library Set by + -- Prj.Nmsc.Language_Independent_Check. Standalone_Library : Boolean := False; - -- Indicate that this is a Standalone Library Project File. - -- Set by Prj.Nmsc.Check. + -- Indicate that this is a Standalone Library Project File. Set by + -- Prj.Nmsc.Check. Lib_Interface_ALIs : String_List_Id := Nil_String; - -- For Standalone Library Project Files, indicate the list - -- of Interface ALI files. Set by Prj.Nmsc.Check. + -- For Standalone Library Project Files, indicate the list of Interface + -- ALI files. Set by Prj.Nmsc.Check. Lib_Auto_Init : Boolean := False; -- For non static Standalone Library Project Files, indicate if @@ -691,17 +694,17 @@ package Prj is -- Object_Directory. Set by Prj.Nmsc.Language_Independent_Check. Display_Exec_Dir : Name_Id := No_Name; - -- The name of the exec directory, for display purposes. - -- May be different from Exec_Directory for platforms where the file - -- names are case-insensitive. + -- The name of the exec directory, for display purposes. May be + -- different from Exec_Directory for platforms where the file names are + -- case-insensitive. Extends : Project_Id := No_Project; - -- The reference of the project file, if any, that this - -- project file extends. Set by Prj.Proc.Process. + -- The reference of the project file, if any, that this project file + -- extends. Set by Prj.Proc.Process. Extended_By : Project_Id := No_Project; - -- The reference of the project file, if any, that - -- extends this project file. Set by Prj.Proc.Process. + -- The reference of the project file, if any, that extends this project + -- file. Set by Prj.Proc.Process. Naming : Naming_Data := Standard_Naming_Data; -- The naming scheme of this project file. @@ -721,17 +724,17 @@ package Prj is -- project file. Set by Prj.Proc.Process. Imported_Projects : Project_List := Empty_Project_List; - -- The list of all directly imported projects, if any. - -- Set by Prj.Proc.Process. + -- The list of all directly imported projects, if any. Set by + -- Prj.Proc.Process. Ada_Include_Path : String_Access := null; - -- The cached value of ADA_INCLUDE_PATH for this project file. - -- Do not use this field directly outside of the compiler, use + -- The cached value of ADA_INCLUDE_PATH for this project file. Do not + -- use this field directly outside of the compiler, use -- Prj.Env.Ada_Include_Path instead. Set by Prj.Env.Ada_Include_Path. Ada_Objects_Path : String_Access := null; - -- The cached value of ADA_OBJECTS_PATH for this project file. - -- Do not use this field directly outside of the compiler, use + -- The cached value of ADA_OBJECTS_PATH for this project file. Do not + -- use this field directly outside of the compiler, use -- Prj.Env.Ada_Objects_Path instead. Set by Prj.Env.Ada_Objects_Path Include_Path_File : Name_Id := No_Name; @@ -791,7 +794,7 @@ package Prj is -- The project tree Tree must have been Initialized and/or Reset. Project_Error : exception; - -- Raised by some subprograms in Prj.Attr. + -- Raised by some subprograms in Prj.Attr package Project_Table is new GNAT.Dynamic_Tables ( Table_Component_Type => Project_Data, @@ -813,7 +816,7 @@ package Prj is Project : Project_Id := No_Project; Needs_Pragma : Boolean := False; end record; - -- File and Path name of a spec or body. + -- File and Path name of a spec or body type File_Names_Data is array (Spec_Or_Body) of File_Name_Data; diff --git a/gcc/ada/raise.c b/gcc/ada/raise.c index 7de1f7754b7..d0abc8a79c0 100644 --- a/gcc/ada/raise.c +++ b/gcc/ada/raise.c @@ -469,7 +469,7 @@ db_phases (int phases) /* This is an incomplete "proxy" of the structure of exception objects as built by the GNAT runtime library. Accesses to other fields than the common - header are performed through subprogram calls to aleviate the need of an + header are performed through subprogram calls to alleviate the need of an exact counterpart here and potential alignment/size issues for the common header. See a-exexpr.adb. */ @@ -854,7 +854,7 @@ is_handled_by (_Unwind_Ptr choice, _GNAT_Exception * propagated_exception) /* Base matching rules: An exception data (id) matches itself, "when all_others" matches anything and "when others" matches anything unless - explicitely stated otherwise in the propagated occurrence. */ + explicitly stated otherwise in the propagated occurrence. */ bool is_handled = choice == E @@ -970,7 +970,7 @@ get_action_description_for (_Unwind_Context *uw_context, /* Setup in UW_CONTEXT the eh return target IP and data registers, which will be restored with the others and retrieved by the landing pad once the jump - occured. */ + occurred. */ static void setup_to_install (_Unwind_Context *uw_context, diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb index 15a2fd1c86d..cfe0850b768 100644 --- a/gcc/ada/rtsfind.adb +++ b/gcc/ada/rtsfind.adb @@ -43,6 +43,7 @@ with Opt; use Opt; with Restrict; use Restrict; with Sem; use Sem; with Sem_Ch7; use Sem_Ch7; +with Sem_Dist; use Sem_Dist; with Sem_Util; use Sem_Util; with Sinfo; use Sinfo; with Stand; use Stand; @@ -838,20 +839,12 @@ package body Rtsfind is E = RE_Params_Stream_Type or else E = RE_Request_Access) + and then Get_PCS_Name = Name_No_DSA then - declare - DSA_Implementation : constant Entity_Id := - RTE (RE_DSA_Implementation); - begin - if Chars (Entity (Expression - (Parent (DSA_Implementation)))) = Name_No_DSA - then - Set_Standard_Error; - Write_Str ("distribution feature not supported"); - Write_Eol; - raise Unrecoverable_Error; - end if; - end; + Set_Standard_Error; + Write_Str ("distribution feature not supported"); + Write_Eol; + raise Unrecoverable_Error; end if; end Check_RPC; diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads index ac1e94a7164..1697b359640 100644 --- a/gcc/ada/rtsfind.ads +++ b/gcc/ada/rtsfind.ads @@ -488,12 +488,10 @@ package Rtsfind is RE_DT_Entry_Size, -- Ada.Tags RE_DT_Prologue_Size, -- Ada.Tags RE_External_Tag, -- Ada.Tags - RE_Get_Expanded_Name, -- Ada.Tags RE_Get_External_Tag, -- Ada.Tags RE_Get_Prim_Op_Address, -- Ada.Tags RE_Get_RC_Offset, -- Ada.Tags RE_Get_Remotely_Callable, -- Ada.Tags - RE_Get_TSD, -- Ada.Tags RE_Inherit_DT, -- Ada.Tags RE_Inherit_TSD, -- Ada.Tags RE_Internal_Tag, -- Ada.Tags @@ -536,12 +534,10 @@ package Rtsfind is RE_CPP_CW_Membership, -- Interfaces.CPP RE_CPP_DT_Entry_Size, -- Interfaces.CPP RE_CPP_DT_Prologue_Size, -- Interfaces.CPP - RE_CPP_Get_Expanded_Name, -- Interfaces.CPP RE_CPP_Get_External_Tag, -- Interfaces.CPP RE_CPP_Get_Prim_Op_Address, -- Interfaces.CPP RE_CPP_Get_RC_Offset, -- Interfaces.CPP RE_CPP_Get_Remotely_Callable, -- Interfaces.CPP - RE_CPP_Get_TSD, -- Interfaces.CPP RE_CPP_Inherit_DT, -- Interfaces.CPP RE_CPP_Inherit_TSD, -- Interfaces.CPP RE_CPP_Register_Tag, -- Interfaces.CPP @@ -1590,12 +1586,10 @@ package Rtsfind is RE_DT_Entry_Size => Ada_Tags, RE_DT_Prologue_Size => Ada_Tags, RE_External_Tag => Ada_Tags, - RE_Get_Expanded_Name => Ada_Tags, RE_Get_External_Tag => Ada_Tags, RE_Get_Prim_Op_Address => Ada_Tags, RE_Get_RC_Offset => Ada_Tags, RE_Get_Remotely_Callable => Ada_Tags, - RE_Get_TSD => Ada_Tags, RE_Inherit_DT => Ada_Tags, RE_Inherit_TSD => Ada_Tags, RE_Internal_Tag => Ada_Tags, @@ -1636,12 +1630,10 @@ package Rtsfind is RE_CPP_CW_Membership => Interfaces_CPP, RE_CPP_DT_Entry_Size => Interfaces_CPP, RE_CPP_DT_Prologue_Size => Interfaces_CPP, - RE_CPP_Get_Expanded_Name => Interfaces_CPP, RE_CPP_Get_External_Tag => Interfaces_CPP, RE_CPP_Get_Prim_Op_Address => Interfaces_CPP, RE_CPP_Get_RC_Offset => Interfaces_CPP, RE_CPP_Get_Remotely_Callable => Interfaces_CPP, - RE_CPP_Get_TSD => Interfaces_CPP, RE_CPP_Inherit_DT => Interfaces_CPP, RE_CPP_Inherit_TSD => Interfaces_CPP, RE_CPP_Register_Tag => Interfaces_CPP, diff --git a/gcc/ada/s-crtl-vms64.ads b/gcc/ada/s-crtl-vms64.ads new file mode 100644 index 00000000000..a26b272f629 --- /dev/null +++ b/gcc/ada/s-crtl-vms64.ads @@ -0,0 +1,183 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M . C R T L -- +-- -- +-- S p e c -- +-- -- +-- Copyright (C) 2004,2005 Free Software Foundation, Inc. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This package provides the low level interface to the C Run Time Library +-- on 64 bit VMS. Note that routines that allocate memory remain 32bit. + +with System.Parameters; +package System.CRTL is +pragma Preelaborate (CRTL); + + subtype chars is System.Address; + -- Pointer to null-terminated array of characters + + subtype DIRs is System.Address; + -- Corresponds to the C type DIR* + + subtype FILEs is System.Address; + -- Corresponds to the C type FILE* + + subtype int is Integer; + + type long is range -(2 ** (System.Parameters.long_bits - 1)) + .. +(2 ** (System.Parameters.long_bits - 1)) - 1; + + subtype off_t is Integer; + + type size_t is mod 2 ** Standard'Address_Size; + + function atoi (A : System.Address) return Integer; + pragma Import (C, atoi, "decc$atoi"); + + procedure clearerr (stream : FILEs); + pragma Import (C, clearerr, "decc$clearerr"); + + function closedir (directory : DIRs) return Integer; + pragma Import (C, closedir, "decc$closedir"); + + function dup (handle : int) return int; + pragma Import (C, dup, "decc$dup"); + + function dup2 (from, to : int) return int; + pragma Import (C, dup2, "decc$dup2"); + + function fclose (stream : FILEs) return int; + pragma Import (C, fclose, "decc$fclose"); + + function fdopen (handle : int; mode : chars) return FILEs; + pragma Import (C, fdopen, "decc$fdopen"); + + function fflush (stream : FILEs) return int; + pragma Import (C, fflush, "decc$fflush"); + + function fgetc (stream : FILEs) return int; + pragma Import (C, fgetc, "decc$fgetc"); + + function fgets (strng : chars; n : int; stream : FILEs) return chars; + pragma Import (C, fgets, "decc$_fgets64"); + + function fopen (filename : chars; Mode : chars) return FILEs; + pragma Import (C, fopen, "decc$fopen"); + + function fputc (C : int; stream : FILEs) return int; + pragma Import (C, fputc, "decc$fputc"); + + function fputs (Strng : chars; Stream : FILEs) return int; + pragma Import (C, fputs, "decc$fputs"); + + procedure free (Ptr : System.Address); + pragma Import (C, free, "decc$free"); + + function freopen + (filename : chars; + mode : chars; + stream : FILEs) + return FILEs; + pragma Import (C, freopen, "decc$freopen"); + + function fseek + (stream : FILEs; + offset : long; + origin : int) + return int; + pragma Import (C, fseek, "decc$fseek"); + + function ftell (stream : FILEs) return long; + pragma Import (C, ftell, "decc$ftell"); + + function getenv (S : String) return System.Address; + pragma Import (C, getenv, "decc$getenv"); + + function isatty (handle : int) return int; + pragma Import (C, isatty, "decc$isatty"); + + function lseek (fd : int; offset : off_t; direction : int) return off_t; + pragma Import (C, lseek, "decc$lseek"); + + function malloc (Size : size_t) return System.Address; + pragma Import (C, malloc, "decc$malloc"); + + procedure memcpy (S1 : System.Address; S2 : System.Address; N : size_t); + pragma Import (C, memcpy, "decc$_memcpy64"); + + procedure memmove (S1 : System.Address; S2 : System.Address; N : size_t); + pragma Import (C, memmove, "decc$_memmove64"); + + procedure mktemp (template : chars); + pragma Import (C, mktemp, "decc$_mktemp64"); + + function opendir (file_name : String) return DIRs; + pragma Import (C, opendir, "decc$opendir"); + + function pclose (stream : System.Address) return int; + pragma Import (C, pclose, "decc$pclose"); + + function popen (command, mode : System.Address) return System.Address; + pragma Import (C, popen, "decc$popen"); + + function read (fd : int; buffer : chars; nbytes : int) return int; + pragma Import (C, read, "decc$read"); + + function realloc + (Ptr : System.Address; Size : size_t) return System.Address; + pragma Import (C, realloc, "decc$realloc"); + + procedure rewind (stream : FILEs); + pragma Import (C, rewind, "decc$rewind"); + + procedure rmdir (dir_name : String); + pragma Import (C, rmdir, "decc$rmdir"); + + function setvbuf + (stream : FILEs; + buffer : chars; + mode : int; + size : size_t) + return int; + pragma Import (C, setvbuf, "decc$setvbuf"); + + procedure tmpnam (string : chars); + pragma Import (C, tmpnam, "decc$_tmpnam64"); + + function tmpfile return FILEs; + pragma Import (C, tmpfile, "decc$tmpfile"); + + function ungetc (c : int; stream : FILEs) return int; + pragma Import (C, ungetc, "decc$ungetc"); + + function unlink (filename : chars) return int; + pragma Import (C, unlink, "decc$unlink"); + + function write (fd : int; buffer : chars; nbytes : int) return int; + pragma Import (C, write, "decc$write"); +end System.CRTL; diff --git a/gcc/ada/s-interr-dummy.adb b/gcc/ada/s-interr-dummy.adb index 0702981ade3..01c3ba19b0f 100644 --- a/gcc/ada/s-interr-dummy.adb +++ b/gcc/ada/s-interr-dummy.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2004, Ada Core Technologies -- +-- Copyright (C) 1995-2005 AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -32,10 +32,7 @@ -- -- ------------------------------------------------------------------------------ --- This is an OS/2 version of this package. - --- This version is a stub, for systems that --- do not support interrupts (or signals). +-- This version is for systems that do not support interrupts (or signals) with Ada.Exceptions; @@ -93,8 +90,7 @@ package body System.Interrupts is --------------------- function Current_Handler - (Interrupt : Interrupt_ID) - return Parameterless_Handler + (Interrupt : Interrupt_ID) return Parameterless_Handler is begin Unimplemented; @@ -155,7 +151,6 @@ package body System.Interrupts is return Boolean is pragma Warnings (Off, Object); - begin Unimplemented; return True; @@ -166,7 +161,6 @@ package body System.Interrupts is return Boolean is pragma Warnings (Off, Object); - begin Unimplemented; return True; diff --git a/gcc/ada/s-interr-sigaction.adb b/gcc/ada/s-interr-sigaction.adb index 4a7610c8018..d8e7f9ef3bf 100644 --- a/gcc/ada/s-interr-sigaction.adb +++ b/gcc/ada/s-interr-sigaction.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2004 Free Software Fundation -- +-- Copyright (C) 1998-2005 Free Software Fundation -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,7 +31,7 @@ -- -- ------------------------------------------------------------------------------ --- This is the IRIX & NT version of this package. +-- This is the IRIX & NT version of this package with Ada.Task_Identification; -- used for Task_Id @@ -120,15 +120,15 @@ package body System.Interrupts is -- that contain interrupt handlers. procedure Signal_Handler (Sig : Interrupt_ID); - -- This procedure is used to handle all the signals. + -- This procedure is used to handle all the signals -- Type and Head, Tail of the list containing Registered Interrupt -- Handlers. These definitions are used to register the handlers -- specified by the pragma Interrupt_Handler. - -- - -- Handler Registration: - -- + -------------------------- + -- Handler Registration -- + -------------------------- type Registered_Handler; type R_Link is access all Registered_Handler; @@ -362,15 +362,14 @@ package body System.Interrupts is if not Restoration and then not Static - -- Tries to overwrite a static Interrupt Handler with a - -- dynamic Handler + -- Tries to overwrite a static Interrupt Handler with dynamic handle - and then (Descriptors (Interrupt).Static + and then + (Descriptors (Interrupt).Static - -- The new handler is not specified as an - -- Interrupt Handler by a pragma. + -- New handler not specified as an Interrupt Handler by a pragma - or else not Is_Registered (New_Handler)) + or else not Is_Registered (New_Handler)) then Raise_Exception (Program_Error'Identity, "Trying to overwrite a static Interrupt Handler with a " & @@ -569,10 +568,10 @@ package body System.Interrupts is Descriptors (Interrupt).T := T; Descriptors (Interrupt).E := E; - -- Indicate the attachment of Interrupt Entry in ATCB. - -- This is need so that when an Interrupt Entry task terminates - -- the binding can be cleaned. The call to unbinding must be - -- make by the task before it terminates. + -- Indicate the attachment of Interrupt Entry in ATCB. This is needed so + -- that when an Interrupt Entry task terminates the binding can be + -- cleaned up. The call to unbinding must be make by the task before it + -- terminates. T.Interrupt_Entry := True; end Bind_Interrupt_To_Entry; @@ -597,7 +596,7 @@ package body System.Interrupts is end if; end loop; - -- Indicate in ATCB that no Interrupt Entries are attached. + -- Indicate in ATCB that no Interrupt Entries are attached T.Interrupt_Entry := True; end Detach_Interrupt_Entries; @@ -674,8 +673,8 @@ package body System.Interrupts is Initialization.Undefer_Abort (Self_Id); - -- Undefer abort here to allow a window for this task - -- to be aborted at the time of system shutdown. + -- Undefer abort here to allow a window for this task to be aborted + -- at the time of system shutdown. end loop; end Server_Task; diff --git a/gcc/ada/s-interr-vms.adb b/gcc/ada/s-interr-vms.adb index 3d4b7fc2e9d..01b42b69717 100644 --- a/gcc/ada/s-interr-vms.adb +++ b/gcc/ada/s-interr-vms.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -31,7 +31,7 @@ -- -- ------------------------------------------------------------------------------ --- This is an OpenVMS/Alpha version of this package. +-- This is an OpenVMS/Alpha version of this package -- Invariants: @@ -140,9 +140,8 @@ package body System.Interrupts is -- Local Tasks -- ----------------- - -- WARNING: System.Tasking.Stages performs calls to this task - -- with low-level constructs. Do not change this spec without synchro- - -- nizing it. + -- WARNING: System.Tasking.Stages performs calls to this task with + -- low-level constructs. Do not change this spec without synchronizing it. task Interrupt_Manager is entry Detach_Interrupt_Entries (T : Task_Id); @@ -183,10 +182,10 @@ package body System.Interrupts is task type Server_Task (Interrupt : Interrupt_ID) is pragma Priority (System.Interrupt_Priority'Last); - -- Note: the above pragma Priority is strictly speaking improper - -- since it is outside the range of allowed priorities, but the - -- compiler treats system units specially and does not apply - -- this range checking rule to system units. + -- Note: the above pragma Priority is strictly speaking improper since + -- it is outside the range of allowed priorities, but the compiler + -- treats system units specially and does not apply this range checking + -- rule to system units. end Server_Task; @@ -210,9 +209,9 @@ package body System.Interrupts is (others => (null, Static => False)); pragma Volatile_Components (User_Handler); -- Holds the protected procedure handler (if any) and its Static - -- information for each interrupt. A handler is a Static one if - -- it is specified through the pragma Attach_Handler. - -- Attach_Handler. Otherwise, not static) + -- information for each interrupt. A handler is a Static one if it is + -- specified through the pragma Attach_Handler. Attach_Handler. Otherwise, + -- not static) User_Entry : array (Interrupt_ID'Range) of Entry_Assoc := (others => (T => Null_Task, E => Null_Task_Entry)); @@ -221,7 +220,7 @@ package body System.Interrupts is Blocked : constant array (Interrupt_ID'Range) of Boolean := (others => False); --- ??? pragma Volatile_Components (Blocked); + -- ??? pragma Volatile_Components (Blocked); -- True iff the corresponding interrupt is blocked in the process level Ignored : array (Interrupt_ID'Range) of Boolean := (others => False); @@ -238,13 +237,13 @@ package body System.Interrupts is Server_ID : array (Interrupt_ID'Range) of Task_Id := (others => Null_Task); pragma Atomic_Components (Server_ID); - -- Holds the Task_Id of the Server_Task for each interrupt. - -- Task_Id is needed to accomplish locking per Interrupt base. Also - -- is needed to decide whether to create a new Server_Task. + -- Holds the Task_Id of the Server_Task for each interrupt. Task_Id is + -- needed to accomplish locking per Interrupt base. Also is needed to + -- decide whether to create a new Server_Task. -- Type and Head, Tail of the list containing Registered Interrupt - -- Handlers. These definitions are used to register the handlers - -- specified by the pragma Interrupt_Handler. + -- Handlers. These definitions are used to register the handlers specified + -- by the pragma Interrupt_Handler. type Registered_Handler; type R_Link is access all Registered_Handler; @@ -334,7 +333,6 @@ package body System.Interrupts is end loop; return False; - end Is_Registered; ----------------- @@ -415,9 +413,9 @@ package body System.Interrupts is Interrupt_ID'Image (Interrupt) & " is reserved"); end if; - -- ??? Since Parameterless_Handler is not Atomic, the - -- current implementation is wrong. We need a new service in - -- Interrupt_Manager to ensure atomicity. + -- ??? Since Parameterless_Handler is not Atomic, the current + -- implementation is wrong. We need a new service in Interrupt_Manager + -- to ensure atomicity. return User_Handler (Interrupt).H; end Current_Handler; @@ -452,19 +450,20 @@ package body System.Interrupts is -- Exchange_Handler -- ---------------------- - -- Calling this procedure with New_Handler = null and Static = True - -- means we want to detach the current handler regardless of the - -- previous handler's binding status (ie. do not care if it is a - -- dynamic or static handler). + -- Calling this procedure with New_Handler = null and Static = True means + -- we want to detach the current handler regardless of the previous + -- handler's binding status (ie. do not care if it is dynamic or static + -- handler). - -- This option is needed so that during the finalization of a PO, we - -- can detach handlers attached through pragma Attach_Handler. + -- This option is needed so that during the finalization of a PO, we can + -- detach handlers attached through pragma Attach_Handler. procedure Exchange_Handler (Old_Handler : out Parameterless_Handler; New_Handler : Parameterless_Handler; Interrupt : Interrupt_ID; - Static : Boolean := False) is + Static : Boolean := False) + is begin if Is_Reserved (Interrupt) then Raise_Exception (Program_Error'Identity, "Interrupt" & @@ -1152,25 +1151,24 @@ package body System.Interrupts is end Install_Handlers; -- Elaboration code for package System.Interrupts + begin -- Get Interrupt_Manager's ID so that Abort_Interrupt can be sent. Interrupt_Manager_ID := To_System (Interrupt_Manager'Identity); - -- During the elaboration of this package body we want RTS to - -- inherit the interrupt mask from the Environment Task. + -- During the elaboration of this package body we want RTS to inherit the + -- interrupt mask from the Environment Task. - -- The Environment Task should have gotten its mask from - -- the enclosing process during the RTS start up. (See - -- in s-inmaop.adb). Pass the Interrupt_Mask of the Environment - -- task to the Interrupt_Manager. + -- The Environment Task should have gotten its mask from the enclosing + -- process during the RTS start up. (See in s-inmaop.adb). Pass the + -- Interrupt_Mask of the Environment task to the Interrupt_Manager. - -- Note : At this point we know that all tasks (including - -- RTS internal servers) are masked for non-reserved signals - -- (see s-taprop.adb). Only the Interrupt_Manager will have - -- masks set up differently inheriting the original Environment - -- Task's mask. + -- Note : At this point we know that all tasks (including RTS internal + -- servers) are masked for non-reserved signals (see s-taprop.adb). Only + -- the Interrupt_Manager will have masks set up differently inheriting the + -- original Environment Task's mask. Interrupt_Manager.Initialize (IMOP.Environment_Mask); end System.Interrupts; diff --git a/gcc/ada/s-interr-vxworks.adb b/gcc/ada/s-interr-vxworks.adb index d0eee62dda3..c9f993b376d 100644 --- a/gcc/ada/s-interr-vxworks.adb +++ b/gcc/ada/s-interr-vxworks.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -33,27 +33,27 @@ -- Invariants: --- All user-handleable signals are masked at all times in all --- tasks/threads except possibly for the Interrupt_Manager task. +-- All user-handleable signals are masked at all times in all tasks/threads +-- except possibly for the Interrupt_Manager task. --- When a user task wants to have the effect of masking/unmasking an --- signal, it must call Block_Interrupt/Unblock_Interrupt, which --- will have the effect of unmasking/masking the signal in the --- Interrupt_Manager task. These comments do not apply to vectored --- hardware interrupts, which may be masked or unmasked using routined --- interfaced to the relevant VxWorks system calls. +-- When a user task wants to have the effect of masking/unmasking an signal, +-- it must call Block_Interrupt/Unblock_Interrupt, which will have the effect +-- of unmasking/masking the signal in the Interrupt_Manager task. These +-- comments do not apply to vectored hardware interrupts, which may be masked +-- or unmasked using routined interfaced to the relevant VxWorks system +-- calls. --- Once we associate a Signal_Server_Task with an signal, the task never --- goes away, and we never remove the association. On the other hand, it --- is more convenient to terminate an associated Interrupt_Server_Task --- for a vectored hardware interrupt (since we use a binary semaphore --- for synchronization with the umbrella handler). +-- Once we associate a Signal_Server_Task with an signal, the task never goes +-- away, and we never remove the association. On the other hand, it is more +-- convenient to terminate an associated Interrupt_Server_Task for a vectored +-- hardware interrupt (since we use a binary semaphore for synchronization +-- with the umbrella handler). -- There is no more than one signal per Signal_Server_Task and no more than --- one Signal_Server_Task per signal. The same relation holds for hardware --- interrupts and Interrupt_Server_Task's at any given time. That is, --- only one non-terminated Interrupt_Server_Task exists for a give --- interrupt at any time. +-- one Signal_Server_Task per signal. The same relation holds for hardware +-- interrupts and Interrupt_Server_Task's at any given time. That is, only +-- one non-terminated Interrupt_Server_Task exists for a give interrupt at +-- any time. -- Within this package, the lock L is used to protect the various status -- tables. If there is a Server_Task associated with a signal or interrupt, @@ -124,9 +124,8 @@ package body System.Interrupts is -- Local Tasks -- ----------------- - -- WARNING: System.Tasking.Stages performs calls to this task - -- with low-level constructs. Do not change this spec without synchro- - -- nizing it. + -- WARNING: System.Tasking.Stages performs calls to this task with + -- low-level constructs. Do not change this spec without synchronizing it. task Interrupt_Manager is entry Detach_Interrupt_Entries (T : Task_Id); @@ -331,7 +330,8 @@ package body System.Interrupts is --------------------- function Current_Handler - (Interrupt : Interrupt_ID) return Parameterless_Handler is + (Interrupt : Interrupt_ID) return Parameterless_Handler + is begin Check_Reserved_Interrupt (Interrupt); @@ -386,7 +386,8 @@ package body System.Interrupts is (Old_Handler : out Parameterless_Handler; New_Handler : Parameterless_Handler; Interrupt : Interrupt_ID; - Static : Boolean := False) is + Static : Boolean := False) + is begin Check_Reserved_Interrupt (Interrupt); Interrupt_Manager.Exchange_Handler @@ -421,7 +422,7 @@ package body System.Interrupts is -- Finalize_Interrupt_Servers -- -------------------------------- - -- Restore default handlers for interrupt servers. + -- Restore default handlers for interrupt servers -- This is called by the Interrupt_Manager task when it receives the abort -- signal during program finalization. @@ -456,7 +457,6 @@ package body System.Interrupts is return Boolean is pragma Unreferenced (Object); - begin return True; end Has_Interrupt_Or_Attach_Handler; @@ -466,7 +466,6 @@ package body System.Interrupts is return Boolean is pragma Unreferenced (Object); - begin return True; end Has_Interrupt_Or_Attach_Handler; @@ -500,9 +499,11 @@ package body System.Interrupts is procedure Install_Handlers (Object : access Static_Interrupt_Protection; - New_Handlers : New_Handler_Array) is + New_Handlers : New_Handler_Array) + is begin for N in New_Handlers'Range loop + -- We need a lock around this ??? Object.Previous_Handlers (N).Interrupt := New_Handlers (N).Interrupt; @@ -687,6 +688,7 @@ package body System.Interrupts is procedure Register_Interrupt_Handler (Handler_Addr : System.Address) is New_Node_Ptr : R_Link; + begin -- This routine registers a handler as usable for dynamic -- interrupt handler association. Routines attaching and detaching @@ -727,7 +729,8 @@ package body System.Interrupts is ------------------ function Unblocked_By - (Interrupt : Interrupt_ID) return System.Tasking.Task_Id is + (Interrupt : Interrupt_ID) return System.Tasking.Task_Id + is begin Unimplemented ("Unblocked_By"); return Null_Task; @@ -836,8 +839,9 @@ package body System.Interrupts is -- status of the Current_Handler. if not Static and then User_Handler (Interrupt).Static then - -- Trying to detach a static Interrupt Handler. - -- raise Program_Error. + + -- Trying to detach a static Interrupt Handler. raise + -- Program_Error. Raise_Exception (Program_Error'Identity, "Trying to detach a static Interrupt Handler"); @@ -864,9 +868,11 @@ package body System.Interrupts is New_Handler : Parameterless_Handler; Interrupt : Interrupt_ID; Static : Boolean; - Restoration : Boolean := False) is + Restoration : Boolean := False) + is begin if User_Entry (Interrupt).T /= Null_Task then + -- If an interrupt entry is already installed, raise -- Program_Error. (propagate it to the caller). @@ -909,7 +915,7 @@ package body System.Interrupts is if New_Handler = null then - -- The null handler means we are detaching the handler. + -- The null handler means we are detaching the handler User_Handler (Interrupt).Static := False; @@ -935,11 +941,13 @@ package body System.Interrupts is end if; if (New_Handler = null) and then Old_Handler /= null then + -- Restore default handler Unbind_Handler (Interrupt); elsif Old_Handler = null then + -- Save default handler Bind_Handler (Interrupt); @@ -1046,7 +1054,7 @@ package body System.Interrupts is end if; end loop; - -- Indicate in ATCB that no interrupt entries are attached. + -- Indicate in ATCB that no interrupt entries are attached T.Interrupt_Entry := False; end Detach_Interrupt_Entries; @@ -1140,7 +1148,7 @@ package body System.Interrupts is end Interrupt_Server_Task; begin - -- Get Interrupt_Manager's ID so that Abort_Interrupt can be sent. + -- Get Interrupt_Manager's ID so that Abort_Interrupt can be sent Interrupt_Manager_ID := To_System (Interrupt_Manager'Identity); end System.Interrupts; diff --git a/gcc/ada/s-interr.adb b/gcc/ada/s-interr.adb index 6844e883a52..de93ca1ecc8 100644 --- a/gcc/ada/s-interr.adb +++ b/gcc/ada/s-interr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -157,20 +157,20 @@ package body System.Interrupts is entry Initialize (Mask : IMNG.Interrupt_Mask); entry Attach_Handler - (New_Handler : in Parameterless_Handler; - Interrupt : in Interrupt_ID; - Static : in Boolean; - Restoration : in Boolean := False); + (New_Handler : Parameterless_Handler; + Interrupt : Interrupt_ID; + Static : Boolean; + Restoration : Boolean := False); entry Exchange_Handler (Old_Handler : out Parameterless_Handler; - New_Handler : in Parameterless_Handler; - Interrupt : in Interrupt_ID; - Static : in Boolean); + New_Handler : Parameterless_Handler; + Interrupt : Interrupt_ID; + Static : Boolean); entry Detach_Handler - (Interrupt : in Interrupt_ID; - Static : in Boolean); + (Interrupt : Interrupt_ID; + Static : Boolean); entry Bind_Interrupt_To_Entry (T : Task_Id; @@ -256,7 +256,7 @@ package body System.Interrupts is type R_Link is access all Registered_Handler; type Registered_Handler is record - H : System.Address := System.Null_Address; + H : System.Address := System.Null_Address; Next : R_Link := null; end record; @@ -287,9 +287,9 @@ package body System.Interrupts is -- can detach handlers attached through pragma Attach_Handler. procedure Attach_Handler - (New_Handler : in Parameterless_Handler; - Interrupt : in Interrupt_ID; - Static : in Boolean := False) + (New_Handler : Parameterless_Handler; + Interrupt : Interrupt_ID; + Static : Boolean := False) is begin if Is_Reserved (Interrupt) then @@ -352,9 +352,9 @@ package body System.Interrupts is Interrupt_ID'Image (Interrupt) & " is reserved"); end if; - -- ??? Since Parameterless_Handler is not Atomic, the - -- current implementation is wrong. We need a new service in - -- Interrupt_Manager to ensure atomicity. + -- ??? Since Parameterless_Handler is not Atomic, the current + -- implementation is wrong. We need a new service in Interrupt_Manager + -- to ensure atomicity. return User_Handler (Interrupt).H; end Current_Handler; @@ -632,15 +632,15 @@ package body System.Interrupts is New_Node_Ptr : R_Link; begin - -- This routine registers the Handler as usable for Dynamic - -- Interrupt Handler. Routines attaching and detaching Handler - -- dynamically should first consult if the Handler is rgistered. - -- A Program Error should be raised if it is not registered. + -- This routine registers the Handler as usable for Dynamic Interrupt + -- Handler. Routines attaching and detaching Handler dynamically should + -- first consult if the Handler is registered. A Program Error should + -- be raised if it is not registered. - -- The pragma Interrupt_Handler can only appear in the library - -- level PO definition and instantiation. Therefore, we do not need - -- to implement Unregistering operation. Neither we need to - -- protect the queue structure using a Lock. + -- The pragma Interrupt_Handler can only appear in the library level PO + -- definition and instantiation. Therefore, we do not need to implement + -- Unregistering operation. Neither we need to protect the queue + -- structure using a Lock. pragma Assert (Handler_Addr /= System.Null_Address); @@ -1014,10 +1014,10 @@ package body System.Interrupts is begin select accept Attach_Handler - (New_Handler : in Parameterless_Handler; - Interrupt : in Interrupt_ID; - Static : in Boolean; - Restoration : in Boolean := False) + (New_Handler : Parameterless_Handler; + Interrupt : Interrupt_ID; + Static : Boolean; + Restoration : Boolean := False) do Unprotected_Exchange_Handler (Old_Handler, New_Handler, Interrupt, Static, Restoration); @@ -1026,9 +1026,9 @@ package body System.Interrupts is or accept Exchange_Handler (Old_Handler : out Parameterless_Handler; - New_Handler : in Parameterless_Handler; - Interrupt : in Interrupt_ID; - Static : in Boolean) + New_Handler : Parameterless_Handler; + Interrupt : Interrupt_ID; + Static : Boolean) do Unprotected_Exchange_Handler (Old_Handler, New_Handler, Interrupt, Static); @@ -1036,8 +1036,8 @@ package body System.Interrupts is or accept Detach_Handler - (Interrupt : in Interrupt_ID; - Static : in Boolean) + (Interrupt : Interrupt_ID; + Static : Boolean) do Unprotected_Detach_Handler (Interrupt, Static); end Detach_Handler; diff --git a/gcc/ada/s-interr.ads b/gcc/ada/s-interr.ads index 2377249203a..94f6dd3e533 100644 --- a/gcc/ada/s-interr.ads +++ b/gcc/ada/s-interr.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -39,7 +39,7 @@ -- It is made a child of System to allow visibility of various -- runtime system internal data and operations. --- See System.Interrupt_Management for core interrupt/signal interfaces. +-- See System.Interrupt_Management for core interrupt/signal interfaces -- These two packages are separated in order to allow -- System.Interrupt_Management to be used without requiring the whole @@ -95,8 +95,7 @@ package System.Interrupts is function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean; function Current_Handler - (Interrupt : Interrupt_ID) - return Parameterless_Handler; + (Interrupt : Interrupt_ID) return Parameterless_Handler; -- Calling the following procedures with New_Handler = null -- and Static = true means that we want to modify the current handler @@ -119,8 +118,7 @@ package System.Interrupts is Static : Boolean := False); function Reference - (Interrupt : Interrupt_ID) - return System.Address; + (Interrupt : Interrupt_ID) return System.Address; -------------------------------- -- Interrupt Entries Services -- @@ -150,8 +148,7 @@ package System.Interrupts is procedure Unblock_Interrupt (Interrupt : Interrupt_ID); function Unblocked_By - (Interrupt : Interrupt_ID) - return System.Tasking.Task_Id; + (Interrupt : Interrupt_ID) return System.Tasking.Task_Id; -- It returns the ID of the last Task which Unblocked this Interrupt. -- It returns Null_Task if no tasks have ever requested the -- Unblocking operation or the Interrupt is currently Blocked. @@ -185,38 +182,36 @@ package System.Interrupts is -- There are two kinds of protected objects that deal with interrupts: - -- (1) Only Interrupt_Handler pragmas are used. We need to be able to - -- tell if an Interrupt_Handler applies to a given procedure, so + -- (1) Only Interrupt_Handler pragmas are used. We need to be able to tell + -- if an Interrupt_Handler applies to a given procedure, so -- Register_Interrupt_Handler has to be called for all the potential - -- handlers, it should be done by calling Register_Interrupt_Handler - -- with the handler code address. On finalization, which can happen only - -- has part of library level finalization since PO with - -- Interrupt_Handler pragmas can only be declared at library level, - -- nothing special needs to be done since the default handlers have been - -- restored as part of task completion which is done just before global - -- finalization. Dynamic_Interrupt_Protection should be used in this - -- case. + -- handlers, it should be done by calling Register_Interrupt_Handler with + -- the handler code address. On finalization, which can happen only has + -- part of library level finalization since PO with Interrupt_Handler + -- pragmas can only be declared at library level, nothing special needs to + -- be done since the default handlers have been restored as part of task + -- completion which is done just before global finalization. + -- Dynamic_Interrupt_Protection should be used in this case. -- (2) Attach_Handler pragmas are used, and possibly Interrupt_Handler - -- pragma. We need to attach the handlers to the given interrupts when - -- the objet is elaborated. This should be done by constructing an array - -- of pairs (interrupt, handler) from the pragmas and calling - -- Install_Handlers with it (types to be used are New_Handler_Item and - -- New_Handler_Array). On finalization, we need to restore the handlers - -- that were installed before the elaboration of the PO, so we need to - -- store these previous handlers. This is also done by Install_Handlers, - -- the room for these informations is provided by adding a discriminant - -- which is the number of Attach_Handler pragmas and an array of this - -- size in the protection type, Static_Interrupt_Protection. + -- pragma. We need to attach the handlers to the given interrupts when the + -- objet is elaborated. This should be done by constructing an array of + -- pairs (interrupt, handler) from the pragmas and calling Install_Handlers + -- with it (types to be used are New_Handler_Item and New_Handler_Array). + -- On finalization, we need to restore the handlers that were installed + -- before the elaboration of the PO, so we need to store these previous + -- handlers. This is also done by Install_Handlers, the room for these + -- informations is provided by adding a discriminant which is the number + -- of Attach_Handler pragmas and an array of this size in the protection + -- type, Static_Interrupt_Protection. procedure Register_Interrupt_Handler (Handler_Addr : System.Address); - -- This routine should be called by the compiler to allow the - -- handler be used as an Interrupt Handler. That means call this - -- procedure for each pragma Interrup_Handler providing the - -- address of the handler (not including the pointer to the - -- actual PO, this way this routine is called only once for - -- each type definition of PO). + -- This routine should be called by the compiler to allow the handler be + -- used as an Interrupt Handler. That means call this procedure for each + -- pragma Interrup_Handler providing the address of the handler (not + -- including the pointer to the actual PO, this way this routine is called + -- only once for each type definition of PO). type Static_Handler_Index is range 0 .. Integer'Last; subtype Positive_Static_Handler_Index is @@ -228,7 +223,7 @@ package System.Interrupts is Handler : Parameterless_Handler; Static : Boolean; end record; - -- Contains all the information needed to restore a previous handler. + -- Contains all the information needed to restore a previous handler type Previous_Handler_Array is array (Positive_Static_Handler_Index range <>) of Previous_Handler_Item; @@ -237,7 +232,7 @@ package System.Interrupts is Interrupt : Interrupt_ID; Handler : Parameterless_Handler; end record; - -- Contains all the information from an Attach_Handler pragma. + -- Contains all the information from an Attach_Handler pragma type New_Handler_Array is array (Positive_Static_Handler_Index range <>) of New_Handler_Item; @@ -253,7 +248,7 @@ package System.Interrupts is function Has_Interrupt_Or_Attach_Handler (Object : access Dynamic_Interrupt_Protection) return Boolean; - -- Returns True. + -- Returns True -- Case (2) @@ -267,9 +262,8 @@ package System.Interrupts is end record; function Has_Interrupt_Or_Attach_Handler - (Object : access Static_Interrupt_Protection) - return Boolean; - -- Returns True. + (Object : access Static_Interrupt_Protection) return Boolean; + -- Returns True procedure Finalize (Object : in out Static_Interrupt_Protection); -- Restore previous handlers as required by C.3.1(12) then call @@ -277,7 +271,7 @@ package System.Interrupts is procedure Install_Handlers (Object : access Static_Interrupt_Protection; - New_Handlers : in New_Handler_Array); + New_Handlers : New_Handler_Array); -- Store the old handlers in Object.Previous_Handlers and install -- the new static handlers. diff --git a/gcc/ada/s-osinte-linux-hppa.ads b/gcc/ada/s-osinte-linux-hppa.ads new file mode 100644 index 00000000000..327fd5bd990 --- /dev/null +++ b/gcc/ada/s-osinte-linux-hppa.ads @@ -0,0 +1,533 @@ +------------------------------------------------------------------------------ +-- -- +-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS -- +-- -- +-- S Y S T E M . O S _ I N T E R F A C E -- +-- -- +-- S p e c -- +-- (GNU/Linux-HPPA Version) -- +-- -- +-- Copyright (C) 1991-1994, Florida State University -- +-- Copyright (C) 1995-2005, Free Software Foundation, Inc. -- +-- -- +-- GNARL is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNARL is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNARL; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNARL was developed by the GNARL team at Florida State University. -- +-- Extensive contributions were provided by Ada Core Technologies, Inc. -- +-- -- +------------------------------------------------------------------------------ + +-- This is a GNU/Linux (GNU/LinuxThreads) version of this package + +-- This package encapsulates all direct interfaces to OS services +-- that are needed by children of System. + +-- PLEASE DO NOT add any with-clauses to this package or remove the pragma +-- Preelaborate. This package is designed to be a bottom-level (leaf) package. + +with Interfaces.C; +with Unchecked_Conversion; + +package System.OS_Interface is + pragma Preelaborate; + + pragma Linker_Options ("-lpthread"); + + subtype int is Interfaces.C.int; + subtype char is Interfaces.C.char; + subtype short is Interfaces.C.short; + subtype long is Interfaces.C.long; + subtype unsigned is Interfaces.C.unsigned; + subtype unsigned_short is Interfaces.C.unsigned_short; + subtype unsigned_long is Interfaces.C.unsigned_long; + subtype unsigned_char is Interfaces.C.unsigned_char; + subtype plain_char is Interfaces.C.plain_char; + subtype size_t is Interfaces.C.size_t; + + ----------- + -- Errno -- + ----------- + + function errno return int; + pragma Import (C, errno, "__get_errno"); + + EAGAIN : constant := 11; + EINTR : constant := 4; + EINVAL : constant := 22; + ENOMEM : constant := 12; + EPERM : constant := 1; + ETIMEDOUT : constant := 238; + + ------------- + -- Signals -- + ------------- + + Max_Interrupt : constant := 63; + type Signal is new int range 0 .. Max_Interrupt; + for Signal'Size use int'Size; + + SIGHUP : constant := 1; -- hangup + SIGINT : constant := 2; -- interrupt (rubout) + SIGQUIT : constant := 3; -- quit (ASCD FS) + SIGILL : constant := 4; -- illegal instruction (not reset) + SIGTRAP : constant := 5; -- trace trap (not reset) + SIGIOT : constant := 6; -- IOT instruction + SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future + SIGEMT : constant := 7; -- EMT + SIGFPE : constant := 8; -- floating point exception + SIGKILL : constant := 9; -- kill (cannot be caught or ignored) + SIGBUS : constant := 10; -- bus error + SIGSEGV : constant := 11; -- segmentation violation + SIGSYS : constant := 12; -- bad system call + SIGPIPE : constant := 13; -- write on a pipe with no one to read it + SIGALRM : constant := 14; -- alarm clock + SIGTERM : constant := 15; -- software termination signal from kill + SIGUSR1 : constant := 16; -- user defined signal 1 + SIGUSR2 : constant := 17; -- user defined signal 2 + SIGCLD : constant := 18; -- alias for SIGCHLD + SIGCHLD : constant := 18; -- child status change + SIGPWR : constant := 19; -- power-fail restart + SIGVTALRM : constant := 20; -- virtual timer expired + SIGPROF : constant := 21; -- profiling timer expired + SIGPOLL : constant := 22; -- pollable event occurred + SIGIO : constant := 22; -- I/O now possible (4.2 BSD) + SIGWINCH : constant := 23; -- window size change + SIGSTOP : constant := 24; -- stop (cannot be caught or ignored) + SIGTSTP : constant := 25; -- user stop requested from tty + SIGCONT : constant := 26; -- stopped process has been continued + SIGTTIN : constant := 27; -- background tty read attempted + SIGTTOU : constant := 28; -- background tty write attempted + SIGURG : constant := 29; -- urgent condition on IO channel + SIGLOST : constant := 30; -- File lock lost + SIGUNUSED : constant := 31; -- unused signal (GNU/Linux) + SIGXCPU : constant := 33; -- CPU time limit exceeded + SIGXFSZ : constant := 34; -- filesize limit exceeded + SIGSTKFLT : constant := 36; -- coprocessor stack fault (Linux) + SIGLTHRRES : constant := 37; -- GNU/LinuxThreads restart signal + SIGLTHRCAN : constant := 38; -- GNU/LinuxThreads cancel signal + SIGLTHRDBG : constant := 39; -- GNU/LinuxThreads debugger signal + + SIGADAABORT : constant := SIGABRT; + -- Change this if you want to use another signal for task abort. + -- SIGTERM might be a good one. + + type Signal_Set is array (Natural range <>) of Signal; + + Unmasked : constant Signal_Set := ( + SIGTRAP, + -- To enable debugging on multithreaded applications, mark SIGTRAP to + -- be kept unmasked. + + SIGBUS, + + SIGTTIN, SIGTTOU, SIGTSTP, + -- Keep these three signals unmasked so that background processes + -- and IO behaves as normal "C" applications + + SIGPROF, + -- To avoid confusing the profiler + + SIGKILL, SIGSTOP, + -- These two signals actually cannot be masked; + -- POSIX simply won't allow it. + + SIGLTHRRES, SIGLTHRCAN, SIGLTHRDBG); + -- These three signals are used by GNU/LinuxThreads starting from + -- glibc 2.1 (future 2.2). + + Reserved : constant Signal_Set := + -- I am not sure why the following two signals are reserved. + -- I guess they are not supported by this version of GNU/Linux. + (SIGVTALRM, SIGUNUSED); + + type sigset_t is private; + + function sigaddset (set : access sigset_t; sig : Signal) return int; + pragma Import (C, sigaddset, "sigaddset"); + + function sigdelset (set : access sigset_t; sig : Signal) return int; + pragma Import (C, sigdelset, "sigdelset"); + + function sigfillset (set : access sigset_t) return int; + pragma Import (C, sigfillset, "sigfillset"); + + function sigismember (set : access sigset_t; sig : Signal) return int; + pragma Import (C, sigismember, "sigismember"); + + function sigemptyset (set : access sigset_t) return int; + pragma Import (C, sigemptyset, "sigemptyset"); + + type union_type_3 is new String (1 .. 116); + type siginfo_t is record + si_signo : int; + si_code : int; + si_errno : int; + X_data : union_type_3; + end record; + pragma Convention (C, siginfo_t); + + type struct_sigaction is record + sa_handler : System.Address; + sa_flags : unsigned_long; + sa_mask : sigset_t; + end record; + pragma Convention (C, struct_sigaction); + type struct_sigaction_ptr is access all struct_sigaction; + + type Machine_State is record + eip : unsigned_long; + ebx : unsigned_long; + esp : unsigned_long; + ebp : unsigned_long; + esi : unsigned_long; + edi : unsigned_long; + end record; + type Machine_State_Ptr is access all Machine_State; + + SA_SIGINFO : constant := 16; + + SIG_BLOCK : constant := 0; + SIG_UNBLOCK : constant := 1; + SIG_SETMASK : constant := 2; + + SIG_DFL : constant := 0; + SIG_IGN : constant := 1; + + function sigaction + (sig : Signal; + act : struct_sigaction_ptr; + oact : struct_sigaction_ptr) return int; + pragma Import (C, sigaction, "sigaction"); + + ---------- + -- Time -- + ---------- + + type timespec is private; + + function To_Duration (TS : timespec) return Duration; + pragma Inline (To_Duration); + + function To_Timespec (D : Duration) return timespec; + pragma Inline (To_Timespec); + + type struct_timeval is private; + + function To_Duration (TV : struct_timeval) return Duration; + pragma Inline (To_Duration); + + function To_Timeval (D : Duration) return struct_timeval; + pragma Inline (To_Timeval); + + function gettimeofday + (tv : access struct_timeval; + tz : System.Address := System.Null_Address) return int; + pragma Import (C, gettimeofday, "gettimeofday"); + + function sysconf (name : int) return long; + pragma Import (C, sysconf); + + SC_CLK_TCK : constant := 2; + + ------------------------- + -- Priority Scheduling -- + ------------------------- + + SCHED_OTHER : constant := 0; + SCHED_FIFO : constant := 1; + SCHED_RR : constant := 2; + + ------------- + -- Process -- + ------------- + + type pid_t is private; + + function kill (pid : pid_t; sig : Signal) return int; + pragma Import (C, kill, "kill"); + + function getpid return pid_t; + pragma Import (C, getpid, "getpid"); + + ------------- + -- Threads -- + ------------- + + type Thread_Body is access + function (arg : System.Address) return System.Address; + + function Thread_Body_Access is new + Unchecked_Conversion (System.Address, Thread_Body); + + type pthread_t is new unsigned_long; + subtype Thread_Id is pthread_t; + + function To_pthread_t is new Unchecked_Conversion + (unsigned_long, pthread_t); + + type pthread_mutex_t is limited private; + type pthread_cond_t is limited private; + type pthread_attr_t is limited private; + type pthread_mutexattr_t is limited private; + type pthread_condattr_t is limited private; + type pthread_key_t is private; + + PTHREAD_CREATE_DETACHED : constant := 1; + + ----------- + -- Stack -- + ----------- + + function Get_Stack_Base (thread : pthread_t) return Address; + pragma Inline (Get_Stack_Base); + -- This is a dummy procedure to share some GNULLI files + + --------------------------------------- + -- Nonstandard Thread Initialization -- + --------------------------------------- + + procedure pthread_init; + pragma Inline (pthread_init); + -- This is a dummy procedure to share some GNULLI files + + ------------------------- + -- POSIX.1c Section 3 -- + ------------------------- + + function sigwait (set : access sigset_t; sig : access Signal) return int; + pragma Import (C, sigwait, "sigwait"); + + function pthread_kill (thread : pthread_t; sig : Signal) return int; + pragma Import (C, pthread_kill, "pthread_kill"); + + type sigset_t_ptr is access all sigset_t; + + function pthread_sigmask + (how : int; + set : sigset_t_ptr; + oset : sigset_t_ptr) return int; + pragma Import (C, pthread_sigmask, "pthread_sigmask"); + + -------------------------- + -- POSIX.1c Section 11 -- + -------------------------- + + function pthread_mutexattr_init + (attr : access pthread_mutexattr_t) return int; + pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init"); + + function pthread_mutexattr_destroy + (attr : access pthread_mutexattr_t) return int; + pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy"); + + function pthread_mutex_init + (mutex : access pthread_mutex_t; + attr : access pthread_mutexattr_t) return int; + pragma Import (C, pthread_mutex_init, "pthread_mutex_init"); + + function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy"); + + function pthread_mutex_lock (mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock"); + + function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock"); + + function pthread_condattr_init + (attr : access pthread_condattr_t) return int; + pragma Import (C, pthread_condattr_init, "pthread_condattr_init"); + + function pthread_condattr_destroy + (attr : access pthread_condattr_t) return int; + pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy"); + + function pthread_cond_init + (cond : access pthread_cond_t; + attr : access pthread_condattr_t) return int; + pragma Import (C, pthread_cond_init, "pthread_cond_init"); + + function pthread_cond_destroy (cond : access pthread_cond_t) return int; + pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy"); + + function pthread_cond_signal (cond : access pthread_cond_t) return int; + pragma Import (C, pthread_cond_signal, "pthread_cond_signal"); + + function pthread_cond_wait + (cond : access pthread_cond_t; + mutex : access pthread_mutex_t) return int; + pragma Import (C, pthread_cond_wait, "pthread_cond_wait"); + + function pthread_cond_timedwait + (cond : access pthread_cond_t; + mutex : access pthread_mutex_t; + abstime : access timespec) return int; + pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait"); + + -------------------------- + -- POSIX.1c Section 13 -- + -------------------------- + + type struct_sched_param is record + sched_priority : int; -- scheduling priority + end record; + pragma Convention (C, struct_sched_param); + + function pthread_setschedparam + (thread : pthread_t; + policy : int; + param : access struct_sched_param) return int; + pragma Import (C, pthread_setschedparam, "pthread_setschedparam"); + + function pthread_attr_setschedpolicy + (attr : access pthread_attr_t; + policy : int) return int; + pragma Import + (C, pthread_attr_setschedpolicy, "pthread_attr_setschedpolicy"); + + function sched_yield return int; + pragma Import (C, sched_yield, "sched_yield"); + + --------------------------- + -- P1003.1c - Section 16 -- + --------------------------- + + function pthread_attr_init + (attributes : access pthread_attr_t) return int; + pragma Import (C, pthread_attr_init, "pthread_attr_init"); + + function pthread_attr_destroy + (attributes : access pthread_attr_t) return int; + pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy"); + + function pthread_attr_setdetachstate + (attr : access pthread_attr_t; + detachstate : int) return int; + pragma Import + (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate"); + + function pthread_attr_setstacksize + (attr : access pthread_attr_t; + stacksize : size_t) return int; + pragma Import (C, pthread_attr_setstacksize, "pthread_attr_setstacksize"); + + function pthread_create + (thread : access pthread_t; + attributes : access pthread_attr_t; + start_routine : Thread_Body; + arg : System.Address) return int; + pragma Import (C, pthread_create, "pthread_create"); + + procedure pthread_exit (status : System.Address); + pragma Import (C, pthread_exit, "pthread_exit"); + + function pthread_self return pthread_t; + pragma Import (C, pthread_self, "pthread_self"); + + -------------------------- + -- POSIX.1c Section 17 -- + -------------------------- + + function pthread_setspecific + (key : pthread_key_t; + value : System.Address) return int; + pragma Import (C, pthread_setspecific, "pthread_setspecific"); + + function pthread_getspecific (key : pthread_key_t) return System.Address; + pragma Import (C, pthread_getspecific, "pthread_getspecific"); + + type destructor_pointer is access procedure (arg : System.Address); + + function pthread_key_create + (key : access pthread_key_t; + destructor : destructor_pointer) return int; + pragma Import (C, pthread_key_create, "pthread_key_create"); + +private + + type sigset_t is array (0 .. 31) of unsigned_long; + pragma Convention (C, sigset_t); + + type pid_t is new int; + + type time_t is new long; + + type timespec is record + tv_sec : time_t; + tv_nsec : long; + end record; + pragma Convention (C, timespec); + + type struct_timeval is record + tv_sec : time_t; + tv_usec : time_t; + end record; + pragma Convention (C, struct_timeval); + + type pthread_attr_t is record + detachstate : int; + schedpolicy : int; + schedparam : struct_sched_param; + inheritsched : int; + scope : int; + guardsize : size_t; + stackaddr_set : int; + stackaddr : System.Address; + stacksize : size_t; + end record; + pragma Convention (C, pthread_attr_t); + + type pthread_condattr_t is record + dummy : int; + end record; + pragma Convention (C, pthread_condattr_t); + + type pthread_mutexattr_t is record + mutexkind : int; + end record; + pragma Convention (C, pthread_mutexattr_t); + + type lock_array is array (1 .. 4) of int; + type atomic_lock_t is record + lock : lock_array; + end record; + pragma Convention (C, atomic_lock_t); + for atomic_lock_t'Alignment use 8 * 16; + + type struct_pthread_fast_lock is record + spinlock : atomic_lock_t; + status : long; + end record; + pragma Convention (C, struct_pthread_fast_lock); + + type pthread_mutex_t is record + m_reserved : int; + m_count : int; + m_owner : System.Address; + m_kind : int; + m_lock : struct_pthread_fast_lock; + end record; + pragma Convention (C, pthread_mutex_t); + + type pthread_cond_t is array (0 .. 47) of unsigned_char; + pragma Convention (C, pthread_cond_t); + + type pthread_key_t is new unsigned; + +end System.OS_Interface; diff --git a/gcc/ada/s-taprob.adb b/gcc/ada/s-taprob.adb index ab6852dbcb6..eeee8366a64 100644 --- a/gcc/ada/s-taprob.adb +++ b/gcc/ada/s-taprob.adb @@ -7,7 +7,7 @@ -- B o d y -- -- -- -- Copyright (C) 1991-1994, Florida State University -- --- Copyright (C) 1995-2005, Ada Core Technologies -- +-- Copyright (C) 1995-2005, AdaCore -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -73,6 +73,7 @@ package body System.Tasking.Protected_Objects is Ceiling_Priority : Integer) is Init_Priority : Integer := Ceiling_Priority; + begin if Init_Priority = Unspecified_Priority then Init_Priority := System.Priority'Last; @@ -80,6 +81,7 @@ package body System.Tasking.Protected_Objects is Initialize_Lock (Init_Priority, Object.L'Access); Object.Ceiling := System.Any_Priority (Init_Priority); + Object.Owner := Null_Task; end Initialize_Protection; ---------- @@ -100,6 +102,17 @@ package body System.Tasking.Protected_Objects is -- generated calls must be protected with cleanup handlers to ensure -- that abort is undeferred in all cases. + -- If pragma Detect_Blocking is active then, as described in the ARM + -- 9.5.1, par. 15, we must check whether this is an external call on a + -- protected subprogram with the same target object as that of the + -- protected action that is currently in progress (i.e., if the caller + -- is already the protected object's owner). If this is the case hence + -- Program_Error must be raised. + + if Detect_Blocking and then Object.Owner = Self then + raise Program_Error; + end if; + Write_Lock (Object.L'Access, Ceiling_Violation); if Parameters.Runtime_Traces then @@ -112,12 +125,18 @@ package body System.Tasking.Protected_Objects is -- We are entering in a protected action, so that we increase the -- protected object nesting level (if pragma Detect_Blocking is - -- active). + -- active), and update the protected object's owner. if Detect_Blocking then declare Self_Id : constant Task_Id := Self; begin + -- Update the protected object's owner + + Object.Owner := Self_Id; + + -- Increase protected object nesting level + Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting + 1; end; @@ -132,6 +151,25 @@ package body System.Tasking.Protected_Objects is Ceiling_Violation : Boolean; begin + -- If pragma Detect_Blocking is active then, as described in the ARM + -- 9.5.1, par. 15, we must check whether this is an external call on + -- protected subprogram with the same target object as that of the + -- protected action that is currently in progress (i.e., if the caller + -- is already the protected object's owner). If this is the case hence + -- Program_Error must be raised. + -- + -- Note that in this case (getting read access), several tasks may have + -- read ownership of the protected object, so that this method of + -- storing the (single) protected object's owner does not work reliably + -- for read locks. However, this is the approach taken for two major + -- reasosn: first, this function is not currently being used (it is + -- provided for possible future use), and second, it largely simplifies + -- the implementation. + + if Detect_Blocking and then Object.Owner = Self then + raise Program_Error; + end if; + Read_Lock (Object.L'Access, Ceiling_Violation); if Parameters.Runtime_Traces then @@ -142,14 +180,19 @@ package body System.Tasking.Protected_Objects is raise Program_Error; end if; - -- We are entering in a protected action, so that we increase the - -- protected object nesting level (if pragma Detect_Blocking is - -- active). + -- We are entering in a protected action, so we increase the protected + -- object nesting level (if pragma Detect_Blocking is active). if Detect_Blocking then declare Self_Id : constant Task_Id := Self; begin + -- Update the protected object's owner + + Object.Owner := Self_Id; + + -- Increase protected object nesting level + Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting + 1; end; @@ -164,17 +207,26 @@ package body System.Tasking.Protected_Objects is begin -- We are exiting from a protected action, so that we decrease the -- protected object nesting level (if pragma Detect_Blocking is - -- active). + -- active), and remove ownership of the protected object. if Detect_Blocking then declare Self_Id : constant Task_Id := Self; begin - -- Cannot call this procedure without being within a protected - -- action. + -- Calls to this procedure can only take place when being within + -- a protected action and when the caller is the protected + -- object's owner. + + pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0 + and then Object.Owner = Self_Id); + + -- Remove ownership of the protected object + + Object.Owner := Null_Task; - pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0); + -- We are exiting from a protected action, so we decrease the + -- protected object nesting level. Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting - 1; diff --git a/gcc/ada/s-taprob.ads b/gcc/ada/s-taprob.ads index 2419759131e..c28fa60ddd0 100644 --- a/gcc/ada/s-taprob.ads +++ b/gcc/ada/s-taprob.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2003, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -206,13 +206,24 @@ package System.Tasking.Protected_Objects is private type Protection is record - L : aliased Task_Primitives.Lock; + L : aliased Task_Primitives.Lock; + -- Lock used to ensure mutual exclusive access to the protected object + Ceiling : System.Any_Priority; + -- Ceiling priority associated to the protected object + + Owner : Task_Id; + -- This field contains the protected object's owner. Null_Task + -- indicates that the protected object is not currently being used. + -- This information is used for detecting the type of potentially + -- blocking operations described in the ARM 9.5.1, par. 15 (external + -- calls on a protected subprogram with the same target object as that + -- of the protected action). end record; procedure Finalize_Protection (Object : in out Protection); - -- Clean up a Protection object; in particular, finalize the associated - -- Lock object. The compiler generates automatically calls to this + -- Clean up a Protection object (in particular, finalize the associated + -- Lock object). The compiler generates calls automatically to this -- procedure end System.Tasking.Protected_Objects; diff --git a/gcc/ada/s-taprop-tru64.adb b/gcc/ada/s-taprop-tru64.adb index 6667899fed9..9a0bba98c9c 100644 --- a/gcc/ada/s-taprop-tru64.adb +++ b/gcc/ada/s-taprop-tru64.adb @@ -612,7 +612,11 @@ package body System.Task_Primitives.Operations is function RT_Resolution return Duration is begin - return 1.0 / 1024.0; -- Clock on DEC Alpha ticks at 1024 Hz + -- Returned value must be an integral multiple of Duration'Small (1 ns) + -- The following is the best approximation of 1/1024. The clock on the + -- DEC Alpha ticks at 1024 Hz. + + return 0.000_976_563; end RT_Resolution; ------------ diff --git a/gcc/ada/s-tpoben.adb b/gcc/ada/s-tpoben.adb index 650f756ff78..aba5666e5d7 100644 --- a/gcc/ada/s-tpoben.adb +++ b/gcc/ada/s-tpoben.adb @@ -206,6 +206,7 @@ package body System.Tasking.Protected_Objects.Entries is Initialize_Lock (Init_Priority, Object.L'Access); Initialization.Undefer_Abort (Self_ID); Object.Ceiling := System.Any_Priority (Init_Priority); + Object.Owner := Null_Task; Object.Compiler_Info := Compiler_Info; Object.Pending_Action := False; Object.Call_In_Progress := null; @@ -231,26 +232,15 @@ package body System.Tasking.Protected_Objects.Entries is (Program_Error'Identity, "Protected Object is finalized"); end if; - -- If pragma Detect_Blocking is active then Program_Error must be - -- raised if this potentially blocking operation is called from a - -- protected action, and the protected object nesting level must be - -- increased. + -- If pragma Detect_Blocking is active then, as described in the ARM + -- 9.5.1, par. 15, we must check whether this is an external call on a + -- protected subprogram with the same target object as that of the + -- protected action that is currently in progress (i.e., if the caller + -- is already the protected object's owner). If this is the case hence + -- Program_Error must be raised. - if Detect_Blocking then - declare - Self_Id : constant Task_Id := STPO.Self; - begin - if Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); - else - -- We are entering in a protected action, so that we increase - -- the protected object nesting level. - - Self_Id.Common.Protected_Action_Nesting := - Self_Id.Common.Protected_Action_Nesting + 1; - end if; - end; + if Detect_Blocking and then Object.Owner = Self then + raise Program_Error; end if; -- The lock is made without defering abort @@ -265,6 +255,27 @@ package body System.Tasking.Protected_Objects.Entries is pragma Assert (STPO.Self.Deferral_Level > 0); Write_Lock (Object.L'Access, Ceiling_Violation); + + -- We are entering in a protected action, so that we increase the + -- protected object nesting level (if pragma Detect_Blocking is + -- active), and update the protected object's owner. + + if Detect_Blocking then + declare + Self_Id : constant Task_Id := Self; + + begin + -- Update the protected object's owner + + Object.Owner := Self_Id; + + -- Increase protected object nesting level + + Self_Id.Common.Protected_Action_Nesting := + Self_Id.Common.Protected_Action_Nesting + 1; + end; + end if; + end Lock_Entries; procedure Lock_Entries (Object : Protection_Entries_Access) is @@ -291,26 +302,23 @@ package body System.Tasking.Protected_Objects.Entries is (Program_Error'Identity, "Protected Object is finalized"); end if; - -- If pragma Detect_Blocking is active then Program_Error must be - -- raised if this potentially blocking operation is called from a - -- protected action, and the protected object nesting level must - -- be increased. - - if Detect_Blocking then - declare - Self_Id : constant Task_Id := STPO.Self; - begin - if Self_Id.Common.Protected_Action_Nesting > 0 then - Ada.Exceptions.Raise_Exception - (Program_Error'Identity, "potentially blocking operation"); - else - -- We are entering in a protected action, so that we increase - -- the protected object nesting level. - - Self_Id.Common.Protected_Action_Nesting := - Self_Id.Common.Protected_Action_Nesting + 1; - end if; - end; + -- If pragma Detect_Blocking is active then, as described in the ARM + -- 9.5.1, par. 15, we must check whether this is an external call on a + -- protected subprogram with the same target object as that of the + -- protected action that is currently in progress (i.e., if the caller + -- is already the protected object's owner). If this is the case hence + -- Program_Error must be raised. + + -- Note that in this case (getting read access), several tasks may + -- have read ownership of the protected object, so that this method of + -- storing the (single) protected object's owner does not work + -- reliably for read locks. However, this is the approach taken for two + -- major reasosn: first, this function is not currently being used (it + -- is provided for possible future use), and second, it largely + -- simplifies the implementation. + + if Detect_Blocking and then Object.Owner = Self then + raise Program_Error; end if; Read_Lock (Object.L'Access, Ceiling_Violation); @@ -318,6 +326,26 @@ package body System.Tasking.Protected_Objects.Entries is if Ceiling_Violation then Raise_Exception (Program_Error'Identity, "Ceiling Violation"); end if; + + -- We are entering in a protected action, so that we increase the + -- protected object nesting level (if pragma Detect_Blocking is + -- active), and update the protected object's owner. + + if Detect_Blocking then + declare + Self_Id : constant Task_Id := Self; + + begin + -- Update the protected object's owner + + Object.Owner := Self_Id; + + -- Increase protected object nesting level + + Self_Id.Common.Protected_Action_Nesting := + Self_Id.Common.Protected_Action_Nesting + 1; + end; + end if; end Lock_Read_Only_Entries; -------------------- @@ -328,16 +356,23 @@ package body System.Tasking.Protected_Objects.Entries is begin -- We are exiting from a protected action, so that we decrease the -- protected object nesting level (if pragma Detect_Blocking is - -- active). + -- active), and remove ownership of the protected object. if Detect_Blocking then declare Self_Id : constant Task_Id := Self; + begin - -- Cannot call this procedure without being within a protected - -- action. + -- Calls to this procedure can only take place when being within + -- a protected action and when the caller is the protected + -- object's owner. + + pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0 + and then Object.Owner = Self_Id); + + -- Remove ownership of the protected object - pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0); + Object.Owner := Null_Task; Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting - 1; diff --git a/gcc/ada/s-tpoben.ads b/gcc/ada/s-tpoben.ads index 5bef440590d..027b9c9709e 100644 --- a/gcc/ada/s-tpoben.ads +++ b/gcc/ada/s-tpoben.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -83,31 +83,49 @@ package System.Tasking.Protected_Objects.Entries is -- Note that you should never (un)lock Object.L directly, but instead -- use Lock_Entries/Unlock_Entries. - Compiler_Info : System.Address; - Call_In_Progress : Entry_Call_Link; - Ceiling : System.Any_Priority; + Compiler_Info : System.Address; + -- Pointer to compiler-generated record representing protected object + + Call_In_Progress : Entry_Call_Link; + -- Pointer to the entry call being executed (if any) + + Ceiling : System.Any_Priority; + -- Ceiling priority associated with the protected object + + Owner : Task_Id; + -- This field contains the protected object's owner. Null_Task + -- indicates that the protected object is not currently being used. + -- This information is used for detecting the type of potentially + -- blocking operations described in the ARM 9.5.1, par. 15 (external + -- calls on a protected subprogram with the same target object as that + -- of the protected action). + Old_Base_Priority : System.Any_Priority; - Pending_Action : Boolean; - -- Flag indicating that priority has been dipped temporarily - -- in order to avoid violating the priority ceiling of the lock - -- associated with this protected object, in Lock_Server. - -- The flag tells Unlock_Server or Unlock_And_Update_Server to - -- restore the old priority to Old_Base_Priority. This is needed - -- because of situations (bad language design?) where one - -- needs to lock a PO but to do so would violate the priority - -- ceiling. For example, this can happen when an entry call - -- has been requeued to a lower-priority object, and the caller - -- then tries to cancel the call while its own priority is higher - -- than the ceiling of the new PO. - Finalized : Boolean := False; - -- Set to True by Finalize to make this routine idempotent. - - Entry_Bodies : Protected_Entry_Body_Access; + -- Task's base priority when the protected operation was called + + Pending_Action : Boolean; + -- Flag indicating that priority has been dipped temporarily in order + -- to avoid violating the priority ceiling of the lock associated with + -- this protected object, in Lock_Server. The flag tells Unlock_Server + -- or Unlock_And_Update_Server to restore the old priority to + -- Old_Base_Priority. This is needed because of situations (bad + -- language design?) where one needs to lock a PO but to do so would + -- violate the priority ceiling. For example, this can happen when an + -- entry call has been requeued to a lower-priority object, and the + -- caller then tries to cancel the call while its own priority is + -- higher than the ceiling of the new PO. + + Finalized : Boolean := False; + -- Set to True by Finalize to make this routine idempotent + + Entry_Bodies : Protected_Entry_Body_Access; + -- Pointer to an array containing the executable code for all entry + -- bodies of a protected type. -- The following function maps the entry index in a call (which denotes -- the queue to the proper entry) into the body of the entry. - Find_Body_Index : Find_Body_Index_Access; + Find_Body_Index : Find_Body_Index_Access; Entry_Queues : Protected_Entry_Queue_Array (1 .. Num_Entries); end record; @@ -141,11 +159,11 @@ package System.Tasking.Protected_Objects.Entries is -- to keep track of the runtime state of a protected object. procedure Lock_Entries (Object : Protection_Entries_Access); - -- Lock a protected object for write access. Upon return, the caller - -- owns the lock to this object, and no other call to Lock or - -- Lock_Read_Only with the same argument will return until the - -- corresponding call to Unlock has been made by the caller. - -- Program_Error is raised in case of ceiling violation. + -- Lock a protected object for write access. Upon return, the caller owns + -- the lock to this object, and no other call to Lock or Lock_Read_Only + -- with the same argument will return until the corresponding call to + -- Unlock has been made by the caller. Program_Error is raised in case of + -- ceiling violation. procedure Lock_Entries (Object : Protection_Entries_Access; Ceiling_Violation : out Boolean); @@ -153,24 +171,24 @@ package System.Tasking.Protected_Objects.Entries is -- raising Program_Error. procedure Lock_Read_Only_Entries (Object : Protection_Entries_Access); - -- Lock a protected object for read access. Upon return, the caller - -- owns the lock for read access, and no other calls to Lock with the - -- same argument will return until the corresponding call to Unlock - -- has been made by the caller. Other calls to Lock_Read_Only may (but - -- need not) return before the call to Unlock, and the corresponding - -- callers will also own the lock for read access. + -- Lock a protected object for read access. Upon return, the caller owns + -- the lock for read access, and no other calls to Lock with the same + -- argument will return until the corresponding call to Unlock has been + -- made by the caller. Other calls to Lock_Read_Only may (but need not) + -- return before the call to Unlock, and the corresponding callers will + -- also own the lock for read access. -- - -- Note: we are not currently using this interface, it is provided - -- for possible future use. At the current time, everyone uses Lock - -- for both read and write locks. + -- Note: we are not currently using this interface, it is provided for + -- possible future use. At the current time, everyone uses Lock for both + -- read and write locks. procedure Unlock_Entries (Object : Protection_Entries_Access); - -- Relinquish ownership of the lock for the object represented by - -- the Object parameter. If this ownership was for write access, or - -- if it was for read access where there are no other read access - -- locks outstanding, one (or more, in the case of Lock_Read_Only) - -- of the tasks waiting on this lock (if any) will be given the - -- lock and allowed to return from the Lock or Lock_Read_Only call. + -- Relinquish ownership of the lock for the object represented by the + -- Object parameter. If this ownership was for write access, or if it was + -- for read access where there are no other read access locks outstanding, + -- one (or more, in the case of Lock_Read_Only) of the tasks waiting on + -- this lock (if any) will be given the lock and allowed to return from + -- the Lock or Lock_Read_Only call. private diff --git a/gcc/ada/s-tpobop.adb b/gcc/ada/s-tpobop.adb index 3535a79ef74..3ab51b542c8 100644 --- a/gcc/ada/s-tpobop.adb +++ b/gcc/ada/s-tpobop.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -537,6 +537,17 @@ package body System.Tasking.Protected_Objects.Operations is (Storage_Error'Identity, "not enough ATC nesting levels"); end if; + -- If pragma Detect_Blocking is active then Program_Error must be + -- raised if this potentially blocking operation is called from a + -- protected action. + + if Detect_Blocking + and then Self_ID.Common.Protected_Action_Nesting > 0 + then + Ada.Exceptions.Raise_Exception + (Program_Error'Identity, "potentially blocking operation"); + end if; + Initialization.Defer_Abort (Self_ID); Lock_Entries (Object, Ceiling_Violation); @@ -889,6 +900,17 @@ package body System.Tasking.Protected_Objects.Operations is "not enough ATC nesting levels"); end if; + -- If pragma Detect_Blocking is active then Program_Error must be + -- raised if this potentially blocking operation is called from a + -- protected action. + + if Detect_Blocking + and then Self_Id.Common.Protected_Action_Nesting > 0 + then + Ada.Exceptions.Raise_Exception + (Program_Error'Identity, "potentially blocking operation"); + end if; + if Runtime_Traces then Send_Trace_Info (POT_Call, Entry_Index (E), Timeout); end if; diff --git a/gcc/ada/s-tposen.adb b/gcc/ada/s-tposen.adb index 7cbf84e6ded..ded8d8401b9 100644 --- a/gcc/ada/s-tposen.adb +++ b/gcc/ada/s-tposen.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2005, Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -333,6 +333,7 @@ package body System.Tasking.Protected_Objects.Single_Entry is STPO.Initialize_Lock (Init_Priority, Object.L'Access); Object.Ceiling := System.Any_Priority (Init_Priority); + Object.Owner := Null_Task; Object.Compiler_Info := Compiler_Info; Object.Call_In_Progress := null; Object.Entry_Body := Entry_Body; @@ -350,59 +351,100 @@ package body System.Tasking.Protected_Objects.Single_Entry is Ceiling_Violation : Boolean; begin - -- If pragma Detect_Blocking is active then the protected object - -- nesting level must be increased. + -- If pragma Detect_Blocking is active then, as described in the ARM + -- 9.5.1, par. 15, we must check whether this is an external call on a + -- protected subprogram with the same target object as that of the + -- protected action that is currently in progress (i.e., if the caller + -- is already the protected object's owner). If this is the case hence + -- Program_Error must be raised. + + if Detect_Blocking and then Object.Owner = Self then + raise Program_Error; + end if; + + STPO.Write_Lock (Object.L'Access, Ceiling_Violation); + + if Ceiling_Violation then + raise Program_Error; + end if; + + -- We are entering in a protected action, so that we increase the + -- protected object nesting level (if pragma Detect_Blocking is + -- active), and update the protected object's owner. if Detect_Blocking then declare - Self_Id : constant Task_Id := STPO.Self; + Self_Id : constant Task_Id := Self; + begin - -- We are entering in a protected action, so that we - -- increase the protected object nesting level. + -- Update the protected object's owner + + Object.Owner := Self_Id; + + -- Increase protected object nesting level Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting + 1; end; end if; - - STPO.Write_Lock (Object.L'Access, Ceiling_Violation); - - if Ceiling_Violation then - raise Program_Error; - end if; end Lock_Entry; -------------------------- -- Lock_Read_Only_Entry -- -------------------------- - -- Compiler interface only. - -- Do not call this procedure from within the runtime system. + -- Compiler interface only + + -- Do not call this procedure from within the runtime system procedure Lock_Read_Only_Entry (Object : Protection_Entry_Access) is Ceiling_Violation : Boolean; begin - -- If pragma Detect_Blocking is active then the protected object - -- nesting level must be increased. + -- If pragma Detect_Blocking is active then, as described in the ARM + -- 9.5.1, par. 15, we must check whether this is an external call on a + -- protected subprogram with the same target object as that of the + -- protected action that is currently in progress (i.e., if the caller + -- is already the protected object's owner). If this is the case hence + -- Program_Error must be raised. + + -- Note that in this case (getting read access), several tasks may + -- have read ownership of the protected object, so that this method of + -- storing the (single) protected object's owner does not work + -- reliably for read locks. However, this is the approach taken for two + -- major reasosn: first, this function is not currently being used (it + -- is provided for possible future use), and second, it largely + -- simplifies the implementation. + + if Detect_Blocking and then Object.Owner = Self then + raise Program_Error; + end if; + + STPO.Read_Lock (Object.L'Access, Ceiling_Violation); + + if Ceiling_Violation then + raise Program_Error; + end if; + + -- We are entering in a protected action, so that we increase the + -- protected object nesting level (if pragma Detect_Blocking is + -- active), and update the protected object's owner. if Detect_Blocking then declare - Self_Id : constant Task_Id := STPO.Self; + Self_Id : constant Task_Id := Self; + begin - -- We are entering in a protected action, so that we - -- increase the protected object nesting level. + -- Update the protected object's owner + + Object.Owner := Self_Id; + + -- Increase protected object nesting level Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting + 1; end; end if; - - STPO.Read_Lock (Object.L'Access, Ceiling_Violation); - - if Ceiling_Violation then - raise Program_Error; - end if; end Lock_Read_Only_Entry; -------------------- @@ -415,6 +457,7 @@ package body System.Tasking.Protected_Objects.Single_Entry is Entry_Call : Entry_Call_Link) is Barrier_Value : Boolean; + begin -- When the Action procedure for an entry body returns, it must be -- completed (having called [Exceptional_]Complete_Entry_Body). @@ -423,6 +466,7 @@ package body System.Tasking.Protected_Objects.Single_Entry is if Barrier_Value then if Object.Call_In_Progress /= null then + -- This violates the No_Entry_Queue restriction, send -- Program_Error to the caller. @@ -692,16 +736,25 @@ package body System.Tasking.Protected_Objects.Single_Entry is procedure Unlock_Entry (Object : Protection_Entry_Access) is begin -- We are exiting from a protected action, so that we decrease the - -- protected object nesting level (if pragma Detect_Blocking is active). + -- protected object nesting level (if pragma Detect_Blocking is + -- active), and remove ownership of the protected object. if Detect_Blocking then declare Self_Id : constant Task_Id := Self; begin - -- Cannot call Unlock_Entry without being within protected action + -- Calls to this procedure can only take place when being within + -- a protected action and when the caller is the protected + -- object's owner. + + pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0 + and then Object.Owner = Self_Id); + + -- Remove ownership of the protected object + + Object.Owner := Null_Task; - pragma Assert (Self_Id.Common.Protected_Action_Nesting > 0); Self_Id.Common.Protected_Action_Nesting := Self_Id.Common.Protected_Action_Nesting - 1; diff --git a/gcc/ada/s-tposen.ads b/gcc/ada/s-tposen.ads index 148098f4cae..8ad0cb43085 100644 --- a/gcc/ada/s-tposen.ads +++ b/gcc/ada/s-tposen.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNARL is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -277,12 +277,33 @@ package System.Tasking.Protected_Objects.Single_Entry is private type Protection_Entry is record - L : aliased Task_Primitives.Lock; - Compiler_Info : System.Address; - Call_In_Progress : Entry_Call_Link; - Ceiling : System.Any_Priority; - Entry_Body : Entry_Body_Access; - Entry_Queue : Entry_Call_Link; + L : aliased Task_Primitives.Lock; + -- The underlying lock associated with a Protection_Entries. Note that + -- you should never (un)lock Object.L directly, but instead use + -- Lock_Entry/Unlock_Entry. + + Compiler_Info : System.Address; + -- Pointer to compiler-generated record representing protected object + + Call_In_Progress : Entry_Call_Link; + -- Pointer to the entry call being executed (if any) + + Ceiling : System.Any_Priority; + -- Ceiling priority associated to the protected object + + Owner : Task_Id; + -- This field contains the protected object's owner. Null_Task + -- indicates that the protected object is not currently being used. + -- This information is used for detecting the type of potentially + -- blocking operations described in the ARM 9.5.1, par. 15 (external + -- calls on a protected subprogram with the same target object as that + -- of the protected action). + + Entry_Body : Entry_Body_Access; + -- Pointer to executable code for the entry body of the protected type + + Entry_Queue : Entry_Call_Link; + -- Place to store the waiting entry call (if any) end record; end System.Tasking.Protected_Objects.Single_Entry; diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 5621ff602ba..13ef75c88ee 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -342,8 +342,14 @@ package body Scng is Len : constant Int := Int (Scan_Ptr) - Int (Current_Line_Start); begin - if Style_Check and Style_Check_Max_Line_Length then + if Style_Check then Style.Check_Line_Terminator (Len); + end if; + + -- Deal with checking maximum line length + + if Style_Check and Style_Check_Max_Line_Length then + Style.Check_Line_Max_Length (Len); -- If style checking is inactive, check maximum line length against -- standard value. Note that we take this from Opt.Max_Line_Length diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index a3911138a0b..f10ec25c707 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -1244,12 +1244,14 @@ package body Sem_Attr is Btyp := Implementation_Base_Type (P_Type); -- Stream attributes not allowed on limited types unless the - -- stream attribute was generated by the expander (in which - -- case the underlying type will be used, as described in Sinfo). + -- attribute reference was generated by the expander (in which + -- case the underlying type will be used, as described in Sinfo), + -- or the attribute was specified explicitly for the type itself + -- or one of its ancestors. if Is_Limited_Type (P_Type) and then Comes_From_Source (N) - and then not Present (TSS (Btyp, Nam)) + and then not Present (Find_Inherited_TSS (Btyp, Nam)) and then not Has_Rep_Pragma (Btyp, Name_Stream_Convert) then Error_Msg_Name_1 := Aname; diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb index 44d5f597467..a17521cad9d 100644 --- a/gcc/ada/sem_cat.adb +++ b/gcc/ada/sem_cat.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1529,13 +1529,22 @@ package body Sem_Cat is if Is_Remote_Access_To_Subprogram_Type (E) and then not Is_Remote_Access_To_Subprogram_Type (S) then - Error_Msg_N ("incorrect conversion of remote operand", N); + Error_Msg_N + ("incorrect conversion of remote operand to local type", N); + return; + + elsif not Is_Remote_Access_To_Subprogram_Type (E) + and then Is_Remote_Access_To_Subprogram_Type (S) + then + Error_Msg_N + ("incorrect conversion of local operand to remote type", N); return; elsif Is_Remote_Access_To_Class_Wide_Type (E) and then not Is_Remote_Access_To_Class_Wide_Type (S) then - Error_Msg_N ("incorrect conversion of remote operand", N); + Error_Msg_N + ("incorrect conversion of remote operand to local type", N); return; end if; diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb index 79dab061c25..afd72c13bd6 100644 --- a/gcc/ada/sem_ch11.adb +++ b/gcc/ada/sem_ch11.adb @@ -401,7 +401,7 @@ package body Sem_Ch11 is ("?assignment to pass-by-copy formal may have no effect", P); Error_Msg_N - ("\?RAISE statement is abnormal return" & + ("\?RAISE statement may result in abnormal return" & " ('R'M 6.4.1(17))", P); end if; end if; diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index 53bb2579796..661ac7651bc 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -6518,7 +6518,7 @@ package body Sem_Ch12 is while Present (Actual_Ent) and then Present (Formal_Node) - and then Actual_Ent /= First_Private_Entity (Act_Ent) + and then Actual_Ent /= First_Private_Entity (Act_Pkg) loop -- ??? Are the following calls also needed here: -- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index dbd1c7eef06..9eeec66e3c0 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -3373,7 +3373,7 @@ package body Sem_Ch13 is Specification => Build_Spec, Name => New_Reference_To (Subp, Loc)); - if Is_Tagged_Type (Ent) and then not Is_Limited_Type (Ent) then + if Is_Tagged_Type (Ent) then Set_TSS (Base_Type (Ent), Subp_Id); else Insert_Action (N, Subp_Decl); @@ -3451,7 +3451,7 @@ package body Sem_Ch13 is Specification => Build_Spec, Name => New_Reference_To (Subp, Loc)); - if Is_Tagged_Type (Ent) and then not Is_Limited_Type (Ent) then + if Is_Tagged_Type (Ent) then Set_TSS (Base_Type (Ent), Subp_Id); else Insert_Action (N, Subp_Decl); diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e1bd1e8bd96..609871aa1c8 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -9603,13 +9603,15 @@ package body Sem_Ch3 is end if; end Comes_From_Generic; + -- Start of processing for Derived_Type_Declaration + begin Parent_Type := Find_Type_Of_Subtype_Indic (Indic); if Parent_Type = Any_Type or else Etype (Parent_Type) = Any_Type or else (Is_Class_Wide_Type (Parent_Type) - and then Etype (Parent_Type) = T) + and then Etype (Parent_Type) = T) then -- If Parent_Type is undefined or illegal, make new type into a -- subtype of Any_Type, and set a few attributes to prevent cascaded diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 21b962cc3fa..88035b8a1f4 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -1197,7 +1197,7 @@ package body Sem_Ch4 is end if; end Is_Function_Type; - -- Start of processing for Analyze_Explicit_Deference + -- Start of processing for Analyze_Explicit_Dereference begin Analyze (P); @@ -1251,8 +1251,6 @@ package body Sem_Ch4 is Get_Next_Interp (I, It); end loop; - End_Interp_List; - -- Error if no interpretation of the prefix has an access type if Etype (N) = Any_Type then @@ -1281,10 +1279,11 @@ package body Sem_Ch4 is then -- Name is a function call with no actuals, in a context that -- requires deproceduring (including as an actual in an enclosing - -- function or procedure call). We can conceive of pathological cases + -- function or procedure call). There are some pathological cases -- where the prefix might include functions that return access to -- subprograms and others that return a regular type. Disambiguation - -- of those will have to take place in Resolve. See e.g. 7117-014. + -- of those has to take place in Resolve. + -- See e.g. 7117-014 and E317-001. New_N := Make_Function_Call (Loc, @@ -1311,6 +1310,25 @@ package body Sem_Ch4 is Rewrite (N, New_N); Analyze (N); + + elsif not Is_Function_Type + and then Is_Overloaded (N) + then + -- The prefix may include access to subprograms and other access + -- types. If the context selects the interpretation that is a call, + -- we cannot rewrite the node yet, but we include the result of + -- the call interpretation. + + Get_First_Interp (N, I, It); + while Present (It.Nam) loop + if Ekind (Base_Type (It.Typ)) = E_Subprogram_Type + and then Etype (Base_Type (It.Typ)) /= Standard_Void_Type + then + Add_One_Interp (N, Etype (It.Typ), Etype (It.Typ)); + end if; + + Get_Next_Interp (I, It); + end loop; end if; -- A value of remote access-to-class-wide must not be dereferenced @@ -2652,14 +2670,20 @@ package body Sem_Ch4 is then Set_Etype (N, Etype (Comp)); - -- In all other cases, we currently build an actual subtype. It - -- seems likely that many of these cases can be avoided, but - -- right now, the front end makes direct references to the + -- If full analysis is not enabled, we do not generate an + -- actual subtype, because in the absence of expansion + -- reference to a formal of a protected type, for example, + -- will not be properly transformed, and will lead to + -- out-of-scope references in gigi. + + -- In all other cases, we currently build an actual subtype. + -- It seems likely that many of these cases can be avoided, + -- but right now, the front end makes direct references to the -- bounds (e.g. in generating a length check), and if we do -- not make an actual subtype, we end up getting a direct - -- reference to a discriminant which will not do. + -- reference to a discriminant, which will not do. - else + elsif Full_Analysis then Act_Decl := Build_Actual_Subtype_Of_Component (Etype (Comp), N); Insert_Action (N, Act_Decl); @@ -2681,6 +2705,11 @@ package body Sem_Ch4 is Set_Etype (N, Subt); end; end if; + + -- If Full_Analysis not enabled, just set the Etype + + else + Set_Etype (N, Etype (Comp)); end if; return; @@ -2697,17 +2726,17 @@ package body Sem_Ch4 is then return; - -- If the transformation fails, it will be necessary - -- to redo the analysis with all errors enabled, to indicate - -- candidate interpretations and reasons for each failure ??? + -- If the transformation fails, it will be necessary to redo the + -- analysis with all errors enabled, to indicate candidate + -- interpretations and reasons for each failure ??? end if; elsif Is_Private_Type (Prefix_Type) then - -- Allow access only to discriminants of the type. If the - -- type has no full view, gigi uses the parent type for - -- the components, so we do the same here. + -- Allow access only to discriminants of the type. If the type has + -- no full view, gigi uses the parent type for the components, so we + -- do the same here. if No (Full_View (Prefix_Type)) then Entity_List := Root_Type (Base_Type (Prefix_Type)); @@ -2747,11 +2776,11 @@ package body Sem_Ch4 is elsif Is_Concurrent_Type (Prefix_Type) then -- Prefix is concurrent type. Find visible operation with given name - -- For a task, this can only include entries or discriminants if - -- the task type is not an enclosing scope. If it is an enclosing - -- scope (e.g. in an inner task) then all entities are visible, but - -- the prefix must denote the enclosing scope, i.e. can only be - -- a direct name or an expanded name. + -- For a task, this can only include entries or discriminants if the + -- task type is not an enclosing scope. If it is an enclosing scope + -- (e.g. in an inner task) then all entities are visible, but the + -- prefix must denote the enclosing scope, i.e. can only be a direct + -- name or an expanded name. Set_Etype (Sel, Any_Type); In_Scope := In_Open_Scopes (Prefix_Type); @@ -2780,8 +2809,8 @@ package body Sem_Ch4 is Set_Original_Discriminant (Sel, Comp); end if; - -- For access type case, introduce explicit deference for - -- more uniform treatment of entry calls. + -- For access type case, introduce explicit deference for more + -- uniform treatment of entry calls. if Is_Access_Type (Etype (Name)) then Insert_Explicit_Dereference (Name); @@ -2809,8 +2838,8 @@ package body Sem_Ch4 is if Etype (N) = Any_Type then - -- If the prefix is a single concurrent object, use its name in - -- the error message, rather than that of its anonymous type. + -- If the prefix is a single concurrent object, use its name in the + -- error message, rather than that of its anonymous type. if Is_Concurrent_Type (Prefix_Type) and then Is_Internal_Name (Chars (Prefix_Type)) @@ -2828,7 +2857,7 @@ package body Sem_Ch4 is and then Prefix_Type /= Etype (Prefix_Type) and then Is_Record_Type (Etype (Prefix_Type)) then - -- If this is a derived formal type, the parent may have a + -- If this is a derived formal type, the parent may have -- different visibility at this point. Try for an inherited -- component before reporting an error. @@ -4805,7 +4834,6 @@ package body Sem_Ch4 is Set_Analyzed (Call_Node, False); Rewrite (Node_To_Replace, Call_Node); Analyze (Node_To_Replace); - end Complete_Object_Operation; -------------------------------- @@ -4920,6 +4948,9 @@ package body Sem_Ch4 is -- Allocate the node only once if not Present (Call_Node_Case) then + Analyze_Expression (Obj); + Set_Analyzed (Obj); + Transform_Object_Operation ( Call_Node => Call_Node_Case, First_Actual => Obj, @@ -5018,6 +5049,9 @@ package body Sem_Ch4 is -- Allocate the node only once if not Present (Call_Node_Case) then + Analyze_Expression (Obj); + Set_Analyzed (Obj); + Transform_Object_Operation ( Call_Node => Call_Node_Case, First_Actual => Obj, @@ -5093,8 +5127,7 @@ package body Sem_Ch4 is if Is_Subprg_Call and then N = Name (Parent (N)) then Actual := First (Parameter_Associations (Parent (N))); while Present (Actual) loop - Analyze (Actual); - Check_Parameterless_Call (Actual); + Analyze_Expression (Actual); Next (Actual); end loop; end if; @@ -5110,6 +5143,9 @@ package body Sem_Ch4 is First_Actual := Obj; end if; + Analyze_Expression (First_Actual); + Set_Analyzed (First_Actual); + -- Build a subprogram call node Transform_Object_Operation ( diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 3f16dca9396..163365fc46a 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -1112,7 +1112,9 @@ package body Sem_Ch5 is -- If the iteration is given by a range, create temporaries and -- assignment statements block to capture the bounds and perform -- required finalization actions in case a bound includes a function - -- call that uses the temporary stack. + -- call that uses the temporary stack. We first pre-analyze a copy of + -- the range in order to determine the expected type, and analyze + -- and resolve the original bounds. procedure Check_Controlled_Array_Attribute (DS : Node_Id); -- If the bounds are given by a 'Range reference on a function call @@ -1126,13 +1128,16 @@ package body Sem_Ch5 is procedure Process_Bounds (R : Node_Id) is Loc : constant Source_Ptr := Sloc (N); + R_Copy : constant Node_Id := New_Copy_Tree (R); Lo : constant Node_Id := Low_Bound (R); Hi : constant Node_Id := High_Bound (R); New_Lo_Bound : Node_Id := Empty; New_Hi_Bound : Node_Id := Empty; - Typ : constant Entity_Id := Etype (R); + Typ : Entity_Id; - function One_Bound (Bound : Node_Id) return Node_Id; + function One_Bound + (Original_Bound : Node_Id; + Analyzed_Bound : Node_Id) return Node_Id; -- Create one declaration followed by one assignment statement -- to capture the value of bound. We create a separate assignment -- in order to force the creation of a block in case the bound @@ -1142,7 +1147,10 @@ package body Sem_Ch5 is -- One_Bound -- --------------- - function One_Bound (Bound : Node_Id) return Node_Id is + function One_Bound + (Original_Bound : Node_Id; + Analyzed_Bound : Node_Id) return Node_Id + is Assign : Node_Id; Id : Entity_Id; Decl : Node_Id; @@ -1156,11 +1164,17 @@ package body Sem_Ch5 is -- part of the call to Make_Index (literal bounds may need to -- be resolved to type Integer). - if Nkind (Bound) = N_Integer_Literal - or else Is_Entity_Name (Bound) - or else Analyzed (Bound) + if Analyzed (Original_Bound) then + return Original_Bound; + + elsif Nkind (Analyzed_Bound) = N_Integer_Literal + or else Is_Entity_Name (Analyzed_Bound) then - return Bound; + Analyze_And_Resolve (Original_Bound, Typ); + return Original_Bound; + + else + Analyze_And_Resolve (Original_Bound, Typ); end if; Id := @@ -1188,26 +1202,32 @@ package body Sem_Ch5 is Assign := Make_Assignment_Statement (Loc, Name => New_Occurrence_Of (Id, Loc), - Expression => Relocate_Node (Bound)); + Expression => Relocate_Node (Original_Bound)); - Save_Interps (Bound, Expression (Assign)); Insert_Before (Parent (N), Assign); Analyze (Assign); - Rewrite (Bound, New_Occurrence_Of (Id, Loc)); + Rewrite (Original_Bound, New_Occurrence_Of (Id, Loc)); if Nkind (Assign) = N_Assignment_Statement then return Expression (Assign); else - return Bound; + return Original_Bound; end if; end One_Bound; -- Start of processing for Process_Bounds begin - New_Lo_Bound := One_Bound (Lo); - New_Hi_Bound := One_Bound (Hi); + -- Determine expected type of range by analyzing separate copy. + + Set_Parent (R_Copy, Parent (R)); + Pre_Analyze_And_Resolve (R_Copy); + Typ := Etype (R_Copy); + Set_Etype (R, Typ); + + New_Lo_Bound := One_Bound (Lo, Low_Bound (R_Copy)); + New_Hi_Bound := One_Bound (Hi, High_Bound (R_Copy)); -- Propagate staticness to loop range itself, in case the -- corresponding subtype is static. @@ -1332,7 +1352,6 @@ package body Sem_Ch5 is if Nkind (DS) = N_Range and then Expander_Active then - Pre_Analyze_And_Resolve (DS); Process_Bounds (DS); else Analyze (DS); diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 27da2a72ece..024a6cb1c24 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -5089,8 +5089,8 @@ package body Sem_Ch6 is -- Ada 2005 (AI-231): Create and decorate an internal subtype -- declaration corresponding to the null-excluding type of the - -- formal in the enclosing scope. In addition, replace the - -- parameter type of the formal to this internal subtype. + -- formal in the enclosing scope. Finally, replace the + -- parameter type of the formal with the internal subtype. if Null_Exclusion_Present (Param_Spec) then declare @@ -5105,7 +5105,7 @@ package body Sem_Ch6 is Ptype : constant Node_Id := Parameter_Type (Param_Spec); Decl : Node_Id; - P : Node_Id := Parent (Parent (Related_Nod)); + P : Node_Id := Parent (Related_Nod); begin Set_Is_Internal (Anon); @@ -5127,12 +5127,13 @@ package body Sem_Ch6 is Mark_Rewrite_Insertion (Decl); -- Insert the new declaration in the nearest enclosing scope + -- in front of the subprogram or entry declaration. - while not Has_Declarations (P) loop + while not Is_List_Member (P) loop P := Parent (P); end loop; - Prepend (Decl, Declarations (P)); + Insert_Before (P, Decl); Rewrite (Ptype, New_Occurrence_Of (Anon, Loc)); Mark_Rewrite_Insertion (Ptype); @@ -5456,15 +5457,24 @@ package body Sem_Ch6 is if Nkind (Parameter_Type (Spec)) = N_Access_Definition then - -- Ada 2005 (AI-231): This behaviour has been modified in Ada 2005. - -- It is only forced if the null_exclusion appears. + -- Ada 2005 (AI-231): In Ada95, access parameters are always non- + -- null; In Ada 2005, only if then null_exclusion is explicit. if Ada_Version < Ada_05 or else Null_Exclusion_Present (Spec) + or else Can_Never_Be_Null (Etype (Formal_Id)) then Set_Is_Known_Non_Null (Formal_Id); Set_Can_Never_Be_Null (Formal_Id); end if; + + elsif Is_Access_Type (Etype (Formal_Id)) + and then Can_Never_Be_Null (Etype (Formal_Id)) + then + -- Ada 2005: The access subtype may be declared with null-exclusion + + Set_Is_Known_Non_Null (Formal_Id); + Set_Can_Never_Be_Null (Formal_Id); end if; Set_Mechanism (Formal_Id, Default_Mechanism); diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index cf1cc2f5025..5660b1555a4 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -1506,12 +1506,21 @@ package body Sem_Ch7 is ---------------------------------- procedure Install_Visible_Declarations (P : Entity_Id) is - Id : Entity_Id; + Id : Entity_Id; + Last_Entity : Entity_Id; begin + pragma Assert (Is_Package (P) or else Is_Record_Type (P)); + + if Is_Package (P) then + Last_Entity := First_Private_Entity (P); + else + Last_Entity := Empty; + end if; + Id := First_Entity (P); - while Present (Id) and then Id /= First_Private_Entity (P) loop + while Present (Id) and then Id /= Last_Entity loop Install_Package_Entity (Id); Next_Entity (Id); end loop; diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index d8900263ba5..394f6dbb8e9 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -29,6 +29,7 @@ with Debug; use Debug; with Einfo; use Einfo; with Elists; use Elists; with Errout; use Errout; +with Exp_Tss; use Exp_Tss; with Exp_Util; use Exp_Util; with Fname; use Fname; with Freeze; use Freeze; @@ -50,6 +51,7 @@ with Sem_Ch4; use Sem_Ch4; with Sem_Ch6; use Sem_Ch6; with Sem_Ch12; use Sem_Ch12; with Sem_Disp; use Sem_Disp; +with Sem_Dist; use Sem_Dist; with Sem_Res; use Sem_Res; with Sem_Util; use Sem_Util; with Sem_Type; use Sem_Type; @@ -1101,10 +1103,11 @@ package body Sem_Ch8 is Save_AV : constant Ada_Version_Type := Ada_Version; Nam : constant Node_Id := Name (N); New_S : Entity_Id; - Old_S : Entity_Id := Empty; + Old_S : Entity_Id := Empty; Rename_Spec : Entity_Id; - Is_Actual : Boolean := False; - Inst_Node : Node_Id := Empty; + Formal_Spec : constant Node_Id := Corresponding_Formal_Spec (N); + Is_Actual : constant Boolean := Present (Formal_Spec); + Inst_Node : Node_Id := Empty; function Original_Subprogram (Subp : Entity_Id) return Entity_Id; -- Find renamed entity when the declaration is a renaming_as_body @@ -1166,8 +1169,75 @@ package body Sem_Ch8 is -- is missing an argument when it is analyzed. if Nkind (Nam) = N_Attribute_Reference then - Attribute_Renaming (N); - return; + + -- In the case of an abstract formal subprogram association, + -- rewrite an actual given by a stream attribute as the name + -- of the corresponding stream primitive of the type. + + if Is_Actual and then Is_Abstract (Formal_Spec) then + declare + Stream_Prim : Entity_Id; + Prefix_Type : constant Entity_Id := Entity (Prefix (Nam)); + + begin + -- The class-wide forms of the stream attributes are not + -- primitive dispatching operations (even though they + -- internally dispatch to a stream attribute). + + if Is_Class_Wide_Type (Prefix_Type) then + Error_Msg_N + ("attribute must be a primitive dispatching operation", + Nam); + return; + end if; + + -- Retrieve the primitive subprogram associated with the + -- attribute. This can only be a stream attribute, since + -- those are the only ones that are dispatching (and the + -- actual for an abstract formal subprogram must be a + -- dispatching operation). + + case Attribute_Name (Nam) is + when Name_Input => + Stream_Prim := + Find_Prim_Op (Prefix_Type, TSS_Stream_Input); + when Name_Output => + Stream_Prim := + Find_Prim_Op (Prefix_Type, TSS_Stream_Output); + when Name_Read => + Stream_Prim := + Find_Prim_Op (Prefix_Type, TSS_Stream_Read); + when Name_Write => + Stream_Prim := + Find_Prim_Op (Prefix_Type, TSS_Stream_Write); + when others => + Error_Msg_N + ("attribute must be a primitive dispatching operation", + Nam); + return; + end case; + + -- Rewrite the attribute into the name of its corresponding + -- primitive dispatching subprogram. We can then proceed with + -- the usual processing for subprogram renamings. + + declare + Prim_Name : constant Node_Id := + Make_Identifier (Sloc (Nam), + Chars => Chars (Stream_Prim)); + begin + Set_Entity (Prim_Name, Stream_Prim); + Rewrite (Nam, Prim_Name); + Analyze (Nam); + end; + end; + + -- Normal processing for a renaming of an attribute + + else + Attribute_Renaming (N); + return; + end if; end if; -- Check whether this declaration corresponds to the instantiation @@ -1182,9 +1252,8 @@ package body Sem_Ch8 is -- is determined in Find_Renamed_Entity. If the entity is an operator, -- Find_Renamed_Entity applies additional visibility checks. - if Present (Corresponding_Formal_Spec (N)) then - Is_Actual := True; - Inst_Node := Unit_Declaration_Node (Corresponding_Formal_Spec (N)); + if Is_Actual then + Inst_Node := Unit_Declaration_Node (Formal_Spec); if Is_Entity_Name (Nam) and then Present (Entity (Nam)) @@ -1476,9 +1545,7 @@ package body Sem_Ch8 is -- indicate that the renaming is an abstract dispatching operation -- with a controlling type. - if Is_Actual - and then Is_Abstract (Corresponding_Formal_Spec (N)) - then + if Is_Actual and then Is_Abstract (Formal_Spec) then -- Mark the renaming as abstract here, so Find_Dispatching_Type -- see it as corresponding to a generic association for a -- formal abstract subprogram @@ -1546,7 +1613,7 @@ package body Sem_Ch8 is if (Ekind (Old_S) = E_Procedure or else Ekind (Old_S) = E_Function) and then Is_Abstract (Old_S) - and then not Is_Abstract (Corresponding_Formal_Spec (N)) + and then not Is_Abstract (Formal_Spec) then Error_Msg_N ("abstract subprogram not allowed as generic actual", Nam); @@ -2800,14 +2867,15 @@ package body Sem_Ch8 is Case_Str : constant String := Name_Buffer (1 .. Name_Len); Case_Stm : constant Node_Id := Parent (Parent (N)); Case_Typ : constant Entity_Id := Etype (Expression (Case_Stm)); + Case_Rtp : constant Entity_Id := Root_Type (Case_Typ); Lit : Node_Id; begin if Is_Enumeration_Type (Case_Typ) - and then Case_Typ /= Standard_Character - and then Case_Typ /= Standard_Wide_Character - and then Case_Typ /= Standard_Wide_Wide_Character + and then Case_Rtp /= Standard_Character + and then Case_Rtp /= Standard_Wide_Character + and then Case_Rtp /= Standard_Wide_Wide_Character then Lit := First_Literal (Case_Typ); Get_Name_String (Chars (Lit)); @@ -3235,6 +3303,7 @@ package body Sem_Ch8 is if Comes_From_Source (N) and then Is_Remote_Access_To_Subprogram_Type (E) and then Expander_Active + and then Get_PCS_Name /= Name_No_DSA then Rewrite (N, New_Occurrence_Of (Equivalent_Type (E), Sloc (N))); @@ -3540,7 +3609,7 @@ package body Sem_Ch8 is and then Chars (P) = Chars (Selector) then Id := S; - goto found; + goto Found; end if; end if; @@ -3610,10 +3679,16 @@ package body Sem_Ch8 is end if; end if; - <> + <> if Comes_From_Source (N) and then Is_Remote_Access_To_Subprogram_Type (Id) + and then Present (Equivalent_Type (Id)) then + -- If we are not actually generating distribution code (i.e. + -- the current PCS is the dummy non-distributed version), then + -- the Equivalent_Type will be missing, and Id should be treated + -- as a regular access-to-subprogram type. + Id := Equivalent_Type (Id); Set_Chars (Selector, Chars (Id)); end if; diff --git a/gcc/ada/sem_dist.adb b/gcc/ada/sem_dist.adb index c0fccfdc92a..188190f05af 100644 --- a/gcc/ada/sem_dist.adb +++ b/gcc/ada/sem_dist.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -199,6 +199,18 @@ package body Sem_Dist is return End_String; end Full_Qualified_Name; + ------------------ + -- Get_PCS_Name -- + ------------------ + + function Get_PCS_Name return PCS_Names is + PCS_Name : constant PCS_Names := + Chars (Entity (Expression + (Parent (RTE (RE_DSA_Implementation))))); + begin + return PCS_Name; + end Get_PCS_Name; + ------------------------ -- Is_All_Remote_Call -- ------------------------ @@ -341,7 +353,7 @@ package body Sem_Dist is Remote_Subp := Entity (Prefix (N)); - if not Expander_Active then + if not Expander_Active or else Get_PCS_Name = Name_No_DSA then return; end if; @@ -429,6 +441,33 @@ package body Sem_Dist is Fat_Type_Decl : Node_Id; begin + Is_Degenerate := False; + Parameter := First (Parameter_Specifications (Type_Def)); + while Present (Parameter) loop + if Nkind (Parameter_Type (Parameter)) = N_Access_Definition then + Error_Msg_N ("formal parameter& has anonymous access type?", + Defining_Identifier (Parameter)); + Is_Degenerate := True; + exit; + end if; + + Next (Parameter); + end loop; + + if Is_Degenerate then + Error_Msg_NE ( + "remote access-to-subprogram type& can only be null?", + Defining_Identifier (Parameter), User_Type); + -- The only legal value for a RAS with a formal parameter of an + -- anonymous access type is null, because it cannot be + -- subtype-Conformant with any legal remote subprogram declaration. + -- In this case, we cannot generate a corresponding primitive + -- operation. + end if; + + if Get_PCS_Name = Name_No_DSA then + return; + end if; -- The tagged private type, primitive operation and RACW -- type associated with a RAS need to all be declared in @@ -457,29 +496,7 @@ package body Sem_Dist is Null_Present => True, Component_List => Empty))); - Is_Degenerate := False; - Parameter := First (Parameter_Specifications (Type_Def)); - Parameters : while Present (Parameter) loop - if Nkind (Parameter_Type (Parameter)) = N_Access_Definition then - Error_Msg_N ("formal parameter& has anonymous access type?", - Defining_Identifier (Parameter)); - Is_Degenerate := True; - exit Parameters; - end if; - Next (Parameter); - end loop Parameters; - - if Is_Degenerate then - Error_Msg_NE ( - "remote access-to-subprogram type& can only be null?", - Defining_Identifier (Parameter), User_Type); - -- The only legal value for a RAS with a formal parameter of an - -- anonymous access type is null, because it cannot be - -- subtype-Conformant with any legal remote subprogram declaration. - -- In this case, we cannot generate a corresponding primitive - -- operation. - - else + if not Is_Degenerate then Append_To (Vis_Decls, Make_Abstract_Subprogram_Declaration (Loc, Specification => Build_RAS_Primitive_Specification ( @@ -595,7 +612,7 @@ package body Sem_Dist is return; end if; - if not Expander_Active then + if not Expander_Active or else Get_PCS_Name = Name_No_DSA then return; end if; @@ -685,7 +702,7 @@ package body Sem_Dist is Target_Type : Entity_Id; begin - if not Expander_Active then + if not Expander_Active or else Get_PCS_Name = Name_No_DSA then return False; elsif Ekind (Typ) = E_Access_Subprogram_Type diff --git a/gcc/ada/sem_dist.ads b/gcc/ada/sem_dist.ads index 4acf872baf4..f6f59084730 100644 --- a/gcc/ada/sem_dist.ads +++ b/gcc/ada/sem_dist.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -26,15 +26,20 @@ -- Semantic processing for distribution annex facilities -with Types; use Types; +with Snames; use Snames; +with Types; use Types; package Sem_Dist is + function Get_PCS_Name return PCS_Names; + -- Return the name of a literal of type System.Partition_Interface. + -- DSA_Implementation_Type indicating what PCS is currently in use. + procedure Add_Stub_Constructs (N : Node_Id); -- Create the stubs constructs for a remote call interface package - -- specification or body or for a shared passive specification. For - -- caller stubs, expansion takes place directly in the specification and - -- no additional compilation unit is created. + -- specification or body or for a shared passive specification. For caller + -- stubs, expansion takes place directly in the specification and no + -- additional compilation unit is created. function Build_RAS_Primitive_Specification (Subp_Spec : Node_Id; @@ -59,35 +64,33 @@ package Sem_Dist is -- whose return type is New_Type. procedure Process_Remote_AST_Declaration (N : Node_Id); - -- Given N, an access to subprogram type declaration node in RCI or - -- remote types unit, build a new record (fat pointer) type declaration - -- using the old Defining_Identifier of N and a link to the old - -- declaration node N whose Defining_Identifier is changed. - -- We also construct declarations of two subprograms in the unit - -- specification which handle remote access to subprogram type - -- (fat pointer) dereference and the unit receiver that handles - -- remote calls (from remote access to subprogram type values.) + -- Given N, an access to subprogram type declaration node in RCI or remote + -- types unit, build a new record (fat pointer) type declaration using the + -- old Defining_Identifier of N and a link to the old declaration node N + -- whose Defining_Identifier is changed. We also construct declarations of + -- two subprograms in the unit specification which handle remote access to + -- subprogram type (fat pointer) dereference and the unit receiver that + -- handles remote calls (from remote access to subprogram type values.) function Remote_AST_E_Dereference (P : Node_Id) return Boolean; -- If the prefix of an explicit dereference is a record type that - -- represent the fat pointer for an Remote access to subprogram, in - -- the context of a call, rewrite the enclosing call node into a - -- remote call, the first actual of which is the fat pointer. Return - -- true if the context is correct and the transformation took place. + -- represent the fat pointer for an Remote access to subprogram, in the + -- context of a call, rewrite the enclosing call node into remote call, + -- the first actual of which is the fat pointer. Return true if the + -- context is correct and the transformation took place. function Remote_AST_I_Dereference (P : Node_Id) return Boolean; -- If P is a record type that represents the fat pointer for a remote - -- access to subprogram, and P is the prefix of a call, insert an - -- explicit dereference and perform the transformation described for - -- the previous function. + -- access to subprogram, and P is the prefix of a call, insert an explicit + -- dereference and perform the transformation described for the previous + -- function. function Remote_AST_Null_Value (N : Node_Id; Typ : Entity_Id) return Boolean; - -- If N is a null value and Typ a remote access to subprogram type, - -- this function will check if null needs to be replaced with an - -- aggregate and will return True in this case. Otherwise, it will - -- return False. + -- If N is a null value and Typ a remote access to subprogram type, this + -- function will check if null needs to be replaced with an aggregate and + -- will return True in this case. Otherwise, it will return False. function Package_Specification_Of_Scope (E : Entity_Id) return Node_Id; -- Return the N_Package_Specification corresponding to a scope E diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b3019294715..a65c9ca7002 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -55,6 +55,7 @@ with Sem_Ch3; use Sem_Ch3; with Sem_Ch8; use Sem_Ch8; with Sem_Ch13; use Sem_Ch13; with Sem_Disp; use Sem_Disp; +with Sem_Dist; use Sem_Dist; with Sem_Elim; use Sem_Elim; with Sem_Eval; use Sem_Eval; with Sem_Intr; use Sem_Intr; @@ -4605,13 +4606,20 @@ package body Sem_Prag is Error_Pragma_Arg ("pragma% cannot be applied to function", Arg1); - elsif Ekind (Nm) = E_Record_Type - and then Present (Corresponding_Remote_Type (Nm)) - then - -- A record type that is the Equivalent_Type for - -- a remote access-to-subprogram type. + elsif Is_Remote_Access_To_Subprogram_Type (Nm) then + + if Is_Record_Type (Nm) then + -- A record type that is the Equivalent_Type for + -- a remote access-to-subprogram type. + + N := Declaration_Node (Corresponding_Remote_Type (Nm)); - N := Declaration_Node (Corresponding_Remote_Type (Nm)); + else + -- A non-expanded RAS type (case where distribution is + -- not enabled). + + N := Declaration_Node (Nm); + end if; if Nkind (N) = N_Full_Type_Declaration and then Nkind (Type_Definition (N)) = @@ -4622,9 +4630,9 @@ package body Sem_Prag is if Is_Asynchronous (Nm) and then Expander_Active + and then Get_PCS_Name /= Name_No_DSA then - RACW_Type_Is_Asynchronous ( - Underlying_RACW_Type (Nm)); + RACW_Type_Is_Asynchronous (Underlying_RACW_Type (Nm)); end if; else diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index af752663422..cc55d26d2d5 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -169,6 +169,8 @@ package body Sem_Res is procedure Resolve_Actuals (N : Node_Id; Nam : Entity_Id); -- Resolve actuals of call, and add default expressions for missing ones. + -- N is the Node_Id for the subprogram call, and Nam is the entity of the + -- called subprogram. procedure Resolve_Entry_Call (N : Node_Id; Typ : Entity_Id); -- Called from Resolve_Call, when the prefix denotes an entry or element @@ -182,7 +184,7 @@ package body Sem_Res is -- to the corresponding predefined operator, with suitable conversions. procedure Resolve_Intrinsic_Unary_Operator (N : Node_Id; Typ : Entity_Id); - -- Ditto, for unary operators (only arithmetic ones). + -- Ditto, for unary operators (only arithmetic ones) procedure Rewrite_Operator_As_Call (N : Node_Id; Nam : Entity_Id); -- If an operator node resolves to a call to a user-defined operator, @@ -371,14 +373,14 @@ package body Sem_Res is D : Node_Id; begin - -- Any use in a default expression is legal. + -- Any use in a default expression is legal if In_Default_Expression then null; elsif Nkind (PN) = N_Range then - -- Discriminant cannot be used to constrain a scalar type. + -- Discriminant cannot be used to constrain a scalar type P := Parent (PN); @@ -626,7 +628,6 @@ package body Sem_Res is F := First_Formal (Subp); A := First_Actual (N); - while Present (F) and then Present (A) loop if not Is_Entity_Name (A) or else Entity (A) /= F @@ -787,6 +788,42 @@ package body Sem_Res is procedure Check_Parameterless_Call (N : Node_Id) is Nam : Node_Id; + function Prefix_Is_Access_Subp return Boolean; + -- If the prefix is of an access_to_subprogram type, the node must be + -- rewritten as a call. Ditto if the prefix is overloaded and all its + -- interpretations are access to subprograms. + + --------------------------- + -- Prefix_Is_Access_Subp -- + --------------------------- + + function Prefix_Is_Access_Subp return Boolean is + I : Interp_Index; + It : Interp; + + begin + if not Is_Overloaded (N) then + return + Ekind (Etype (N)) = E_Subprogram_Type + and then Base_Type (Etype (Etype (N))) /= Standard_Void_Type; + else + Get_First_Interp (N, I, It); + while Present (It.Typ) loop + if Ekind (It.Typ) /= E_Subprogram_Type + or else Base_Type (Etype (It.Typ)) = Standard_Void_Type + then + return False; + end if; + + Get_Next_Interp (I, It); + end loop; + + return True; + end if; + end Prefix_Is_Access_Subp; + + -- Start of processing for Check_Parameterless_Call + begin -- Defend against junk stuff if errors already detected @@ -832,9 +869,7 @@ package body Sem_Res is -- procedure or entry. or else - (Nkind (N) = N_Explicit_Dereference - and then Ekind (Etype (N)) = E_Subprogram_Type - and then Base_Type (Etype (Etype (N))) /= Standard_Void_Type) + (Nkind (N) = N_Explicit_Dereference and then Prefix_Is_Access_Subp) -- Rewrite as call if it is a selected component which is a function, -- this is the case of a call to a protected function (which may be @@ -858,7 +893,7 @@ package body Sem_Res is then Nam := New_Copy (N); - -- If overloaded, overload set belongs to new copy. + -- If overloaded, overload set belongs to new copy Save_Interps (N, Nam); @@ -1320,7 +1355,7 @@ package body Sem_Res is Full_Analysis := Save_Full_Analysis; end Pre_Analyze_And_Resolve; - -- Version without context type. + -- Version without context type procedure Pre_Analyze_And_Resolve (N : Node_Id) is Save_Full_Analysis : constant Boolean := Full_Analysis; @@ -1534,17 +1569,9 @@ package body Sem_Res is Is_Remote : Boolean := True; begin - -- Check that Typ is a fat pointer with a reference to a RAS as - -- original access type. - - if - (Ekind (Typ) = E_Access_Subprogram_Type - and then Present (Equivalent_Type (Typ))) - or else - (Ekind (Typ) = E_Record_Type - and then Present (Corresponding_Remote_Type (Typ))) + -- Check that Typ is a remote access-to-subprogram type - then + if Is_Remote_Access_To_Subprogram_Type (Typ) then -- Prefix (N) must statically denote a remote subprogram -- declared in a package specification. @@ -1581,6 +1608,7 @@ package body Sem_Res is or else Attr = Attribute_Unchecked_Access or else Attr = Attribute_Unrestricted_Access) and then Expander_Active + and then Get_PCS_Name /= Name_No_DSA then Check_Subtype_Conformant (New_Id => Entity (Prefix (N)), @@ -2020,7 +2048,7 @@ package body Sem_Res is elsif Nkind (Name (N)) = N_Selected_Component then - -- Protected operation: retrieve operation name. + -- Protected operation: retrieve operation name Subp_Name := Selector_Name (Name (N)); else @@ -2411,7 +2439,7 @@ package body Sem_Res is else Set_Parent (Actval, N); - -- See note above concerning aggregates. + -- See note above concerning aggregates if Nkind (Actval) = N_Aggregate and then Has_Discriminants (Etype (Actval)) @@ -2522,7 +2550,6 @@ package body Sem_Res is begin A := First_Actual (N); F := First_Formal (Nam); - while Present (F) loop if No (A) and then Needs_No_Actuals (Nam) then null; @@ -3131,13 +3158,13 @@ package body Sem_Res is elsif Etype (N) = T and then B_Typ /= Universal_Fixed then - -- Not a mixed-mode operation. Resolve with context. + -- Not a mixed-mode operation, resolve with context Resolve (N, B_Typ); elsif Etype (N) = Any_Fixed then - -- N may itself be a mixed-mode operation, so use context type. + -- N may itself be a mixed-mode operation, so use context type Resolve (N, B_Typ); @@ -4512,7 +4539,7 @@ package body Sem_Res is if Nkind (Entry_Name) = N_Selected_Component then - -- Simple entry call. + -- Simple entry call Nam := Entity (Selector_Name (Entry_Name)); Obj := Prefix (Entry_Name); @@ -4520,7 +4547,7 @@ package body Sem_Res is else pragma Assert (Nkind (Entry_Name) = N_Indexed_Component); - -- Call to member of entry family. + -- Call to member of entry family Nam := Entity (Selector_Name (Prefix (Entry_Name))); Obj := Prefix (Prefix (Entry_Name)); @@ -4803,9 +4830,11 @@ package body Sem_Res is ---------------------------------- procedure Resolve_Explicit_Dereference (N : Node_Id; Typ : Entity_Id) is - P : constant Node_Id := Prefix (N); - I : Interp_Index; - It : Interp; + Loc : constant Source_Ptr := Sloc (N); + New_N : Node_Id; + P : constant Node_Id := Prefix (N); + I : Interp_Index; + It : Interp; begin -- Now that we know the type, check that this is not a @@ -4831,7 +4860,39 @@ package body Sem_Res is Get_Next_Interp (I, It); end loop; - Resolve (P, It.Typ); + if Present (It.Typ) then + Resolve (P, It.Typ); + else + -- If no interpretation covers the designated type of the + -- prefix, this is the pathological case where not all + -- implementations of the prefix allow the interpretation + -- of the node as a call. Now that the expected type is known, + -- Remove other interpretations from prefix, rewrite it as + -- a call, and resolve again, so that the proper call node + -- is generated. + + Get_First_Interp (P, I, It); + while Present (It.Typ) loop + if Ekind (It.Typ) /= E_Access_Subprogram_Type then + Remove_Interp (I); + end if; + + Get_Next_Interp (I, It); + end loop; + + New_N := + Make_Function_Call (Loc, + Name => + Make_Explicit_Dereference (Loc, + Prefix => P), + Parameter_Associations => New_List); + + Save_Interps (N, New_N); + Rewrite (N, New_N); + Analyze_And_Resolve (N, Typ); + return; + end if; + Set_Etype (N, Designated_Type (It.Typ)); else @@ -4941,7 +5002,7 @@ package body Sem_Res is Array_Type := Designated_Type (Array_Type); end if; - -- If name was overloaded, set component type correctly now. + -- If name was overloaded, set component type correctly now Set_Etype (N, Component_Type (Array_Type)); @@ -5247,7 +5308,7 @@ package body Sem_Res is return; end if; - -- The null literal takes its type from the context. + -- The null literal takes its type from the context Set_Etype (N, Typ); end Resolve_Null; @@ -5674,6 +5735,16 @@ package body Sem_Res is Error_Msg_N ("value has extraneous low order digits", N); end if; + -- Generate a warning if literal from source + + if Is_Static_Expression (N) + and then Warn_On_Bad_Fixed_Value + then + Error_Msg_N + ("static fixed-point value is not a multiple of Small?", + N); + end if; + -- Replace literal by a value that is the exact representation -- of a value of the type, i.e. a multiple of the small value, -- by truncation, since Machine_Rounds is false for all GNAT @@ -5685,6 +5756,8 @@ package body Sem_Res is Realval => Small_Value (Typ) * Cint)); Set_Is_Static_Expression (N, Stat); + + end if; -- In all cases, set the corresponding integer field @@ -6347,16 +6420,18 @@ package body Sem_Res is and then (Etype (Right_Opnd (Operand)) = Universal_Real or else Etype (Left_Opnd (Operand)) = Universal_Real) then + -- Return if expression is ambiguous + if Unique_Fixed_Point_Type (N) = Any_Type then - return; -- expression is ambiguous. - else - -- If nothing else, the available fixed type is Duration. + return; + + -- If nothing else, the available fixed type is Duration + else Set_Etype (Operand, Standard_Duration); end if; - -- Resolve the real operand with largest available precision. - + -- Resolve the real operand with largest available precision if Etype (Right_Opnd (Operand)) = Universal_Real then Rop := New_Copy_Tree (Right_Opnd (Operand)); else @@ -6548,7 +6623,7 @@ package body Sem_Res is Opnd_Type : constant Entity_Id := Etype (Operand); begin - -- Resolve operand using its own type. + -- Resolve operand using its own type Resolve (Operand, Opnd_Type); Eval_Unchecked_Conversion (N); @@ -6770,7 +6845,11 @@ package body Sem_Res is Scop : Entity_Id; procedure Fixed_Point_Error; - -- If true ambiguity, give details. + -- If true ambiguity, give details + + ----------------------- + -- Fixed_Point_Error -- + ----------------------- procedure Fixed_Point_Error is begin @@ -6779,13 +6858,15 @@ package body Sem_Res is Error_Msg_NE ("\possible interpretation as}", N, T2); end Fixed_Point_Error; + -- Start of processing for Unique_Fixed_Point_Type + begin -- The operations on Duration are visible, so Duration is always a -- possible interpretation. T1 := Standard_Duration; - -- Look for fixed-point types in enclosing scopes. + -- Look for fixed-point types in enclosing scopes Scop := Current_Scope; while Scop /= Standard_Standard loop @@ -6810,7 +6891,7 @@ package body Sem_Res is Scop := Scope (Scop); end loop; - -- Look for visible fixed type declarations in the context. + -- Look for visible fixed type declarations in the context Item := First (Context_Items (Cunit (Current_Sem_Unit))); while Present (Item) loop @@ -6896,15 +6977,15 @@ package body Sem_Res is Opnd_Type : Entity_Id) return Boolean is begin - -- Upward conversions are allowed (RM 4.6(22)). + -- Upward conversions are allowed (RM 4.6(22)) if Covers (Target_Type, Opnd_Type) or else Is_Ancestor (Target_Type, Opnd_Type) then return True; - -- Downward conversion are allowed if the operand is - -- is class-wide (RM 4.6(23)). + -- Downward conversion are allowed if the operand is class-wide + -- (RM 4.6(23)). elsif Is_Class_Wide_Type (Opnd_Type) and then Covers (Opnd_Type, Target_Type) @@ -7217,19 +7298,16 @@ package body Sem_Res is elsif (Ekind (Target_Type) = E_Access_Subprogram_Type or else Ekind (Target_Type) = E_Anonymous_Access_Subprogram_Type) + and then No (Corresponding_Remote_Type (Opnd_Type)) and then Conversion_Check (Ekind (Base_Type (Opnd_Type)) = E_Access_Subprogram_Type, "illegal operand for access subprogram conversion") then -- Check that the designated types are subtype conformant - if not Subtype_Conformant (Designated_Type (Opnd_Type), - Designated_Type (Target_Type)) - then - Error_Msg_N - ("operand type is not subtype conformant with target type", - Operand); - end if; + Check_Subtype_Conformant (New_Id => Designated_Type (Target_Type), + Old_Id => Designated_Type (Opnd_Type), + Err_Loc => N); -- Check the static accessibility rule of 4.6(20) @@ -7285,7 +7363,7 @@ package body Sem_Res is elsif Is_Tagged_Type (Target_Type) then return Valid_Tagged_Conversion (Target_Type, Opnd_Type); - -- Types derived from the same root type are convertible. + -- Types derived from the same root type are convertible elsif Root_Type (Target_Type) = Root_Type (Opnd_Type) then return True; diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index 8d0cf7577e0..3411194aa18 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -585,6 +585,9 @@ package body Sem_Type is function Covers (T1, T2 : Entity_Id) return Boolean is + BT1 : Entity_Id; + BT2 : Entity_Id; + function Full_View_Covers (Typ1, Typ2 : Entity_Id) return Boolean; -- In an instance the proper view may not always be correct for -- private types, but private and full view are compatible. This @@ -619,6 +622,10 @@ package body Sem_Type is else raise Program_Error; end if; + + else + BT1 := Base_Type (T1); + BT2 := Base_Type (T2); end if; -- Simplest case: same types are compatible, and types that have the @@ -639,7 +646,10 @@ package body Sem_Type is if T1 = T2 then return True; - elsif Base_Type (T1) = Base_Type (T2) then + elsif BT1 = BT2 + or else BT1 = T2 + or else BT2 = T1 + then if not Is_Generic_Actual_Type (T1) then return True; else @@ -712,9 +722,9 @@ package body Sem_Type is -- An Access_To_Subprogram is compatible with itself, or with an -- anonymous type created for an attribute reference Access. - elsif (Ekind (Base_Type (T1)) = E_Access_Subprogram_Type + elsif (Ekind (BT1) = E_Access_Subprogram_Type or else - Ekind (Base_Type (T1)) = E_Access_Protected_Subprogram_Type) + Ekind (BT1) = E_Access_Protected_Subprogram_Type) and then Is_Access_Type (T2) and then (not Comes_From_Source (T1) or else not Comes_From_Source (T2)) @@ -732,9 +742,9 @@ package body Sem_Type is -- with itself, or with an anonymous type created for an attribute -- reference Access. - elsif (Ekind (Base_Type (T1)) = E_Anonymous_Access_Subprogram_Type + elsif (Ekind (BT1) = E_Anonymous_Access_Subprogram_Type or else - Ekind (Base_Type (T1)) + Ekind (BT1) = E_Anonymous_Access_Protected_Subprogram_Type) and then Is_Access_Type (T2) and then (not Comes_From_Source (T1) @@ -768,14 +778,14 @@ package body Sem_Type is return Covers (Corresponding_Remote_Type (T2), T1); elsif Ekind (T2) = E_Access_Attribute_Type - and then (Ekind (Base_Type (T1)) = E_General_Access_Type - or else Ekind (Base_Type (T1)) = E_Access_Type) + and then (Ekind (BT1) = E_General_Access_Type + or else Ekind (BT1) = E_Access_Type) and then Covers (Designated_Type (T1), Designated_Type (T2)) then -- If the target type is a RACW type while the source is an access -- attribute type, we are building a RACW that may be exported. - if Is_Remote_Access_To_Class_Wide_Type (Base_Type (T1)) then + if Is_Remote_Access_To_Class_Wide_Type (BT1) then Set_Has_RACW (Current_Sem_Unit); end if; diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 00fc1a19a59..fe354349b2c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6770,16 +6770,20 @@ package body Sem_Util is Found_Scope := Scope (Found_Scope); exit when Expec_Scope = Standard_Standard - or else - Found_Scope = Standard_Standard - or else - not Comes_From_Source (Expec_Scope) - or else - not Comes_From_Source (Found_Scope); + or else Found_Scope = Standard_Standard + or else not Comes_From_Source (Expec_Scope) + or else not Comes_From_Source (Found_Scope); end loop; end; - Error_Msg_NE ("expected}!", Expr, Expec_Type); + if Is_Record_Type (Expec_Type) + and then Present (Corresponding_Remote_Type (Expec_Type)) + then + Error_Msg_NE ("expected}!", Expr, + Corresponding_Remote_Type (Expec_Type)); + else + Error_Msg_NE ("expected}!", Expr, Expec_Type); + end if; if Is_Entity_Name (Expr) and then Is_Package (Entity (Expr)) diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index 9ee56372e4d..05df20c68d3 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -391,7 +391,7 @@ package Sem_Util is -- to check if '=' has to be expanded into a bunch component comparaisons. function In_Instance return Boolean; - -- Returns True if the current scope is within a generic instance. + -- Returns True if the current scope is within a generic instance function In_Instance_Body return Boolean; -- Returns True if current scope is within the body of an instance, where @@ -436,7 +436,7 @@ package Sem_Util is -- synthesized attribute. function Is_Actual_Parameter (N : Node_Id) return Boolean; - -- Determines if N is an actual parameter in a subprogram call. + -- Determines if N is an actual parameter in a subprogram call function Is_Aliased_View (Obj : Node_Id) return Boolean; -- Determine if Obj is an aliased view, i.e. the name of an @@ -542,7 +542,7 @@ package Sem_Util is -- Return True if E is a remote access-to-class-wide-limited_private type function Is_Remote_Access_To_Subprogram_Type (E : Entity_Id) return Boolean; - -- Return True if E is a remote access to subprogram type. + -- Return True if E is a remote access to subprogram type function Is_Remote_Call (N : Node_Id) return Boolean; -- Return True if N denotes a potentially remote call @@ -642,7 +642,7 @@ package Sem_Util is -- the call order, so this does not correspond to simply taking the -- next entry of the Parameter_Associations list. The argument is an -- actual previously returned by a call to First_Actual or Next_Actual. - -- Note tha the result produced is always an expression, not a parameter + -- Note that the result produced is always an expression, not a parameter -- assciation node, even if named notation was used. procedure Normalize_Actuals @@ -783,15 +783,14 @@ package Sem_Util is -- Set the flag Is_Transient of the current scope procedure Set_Size_Info (T1, T2 : Entity_Id); - -- Copies the Esize field and Has_Biased_Representation flag from - -- (sub)type entity T2 to (sub)type entity T1. Also copies the - -- Is_Unsigned_Type flag in the fixed-point and discrete cases, - -- and also copies the alignment value from T2 to T1. It does NOT - -- copy the RM_Size field, which must be separately set if this - -- is required to be copied also. + -- Copies the Esize field and Has_Biased_Representation flag from sub(type) + -- entity T2 to (sub)type entity T1. Also copies the Is_Unsigned_Type flag + -- in the fixed-point and discrete cases, and also copies the alignment + -- value from T2 to T1. It does NOT copy the RM_Size field, which must be + -- separately set if this is required to be copied also. function Scope_Is_Transient return Boolean; - -- True if the current scope is transient. + -- True if the current scope is transient function Static_Integer (N : Node_Id) return Uint; -- This function analyzes the given expression node and then resolves it @@ -804,10 +803,10 @@ package Sem_Util is -- E1 and E2 refer to different objects function Subprogram_Access_Level (Subp : Entity_Id) return Uint; - -- Return the accessibility level of the view denoted by Subp. + -- Return the accessibility level of the view denoted by Subp procedure Trace_Scope (N : Node_Id; E : Entity_Id; Msg : String); - -- Print debugging information on entry to each unit being analyzed. + -- Print debugging information on entry to each unit being analyzed procedure Transfer_Entities (From : Entity_Id; To : Entity_Id); -- Move a list of entities from one scope to another, and recompute @@ -817,14 +816,14 @@ package Sem_Util is -- Return the accessibility level of Typ function Unit_Declaration_Node (Unit_Id : Entity_Id) return Node_Id; - -- Unit_Id is the simple name of a program unit, this function returns - -- the corresponding xxx_Declaration node for the entity. Also applies - -- to the body entities for subprograms, tasks and protected units, in - -- which case it returns the subprogram, task or protected body node - -- for it. The unit may be a child unit with any number of ancestors. + -- Unit_Id is the simple name of a program unit, this function returns the + -- corresponding xxx_Declaration node for the entity. Also applies to the + -- body entities for subprograms, tasks and protected units, in which case + -- it returns the subprogram, task or protected body node for it. The unit + -- may be a child unit with any number of ancestors. function Universal_Interpretation (Opnd : Node_Id) return Entity_Id; - -- Yields universal_Integer or Universal_Real if this is a candidate. + -- Yields universal_Integer or Universal_Real if this is a candidate function Within_Init_Proc return Boolean; -- Determines if Current_Scope is within an init proc diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb index ee6e8bb5151..237984600d7 100644 --- a/gcc/ada/snames.adb +++ b/gcc/ada/snames.adb @@ -607,6 +607,7 @@ package body Snames is "exception_message#" & "exception_name#" & "file#" & + "generic_dispatching_constructor#" & "import_address#" & "import_largest_value#" & "import_value#" & @@ -735,15 +736,18 @@ package body Snames is -- xxxDF deep finalize routine for type xxx (Exp_TSS) -- xxxDI deep initialize routine for type xxx (Exp_TSS) -- xxxEQ composite equality routine for record type xxx (Exp_TSS) + -- xxxFA PolyORB/DSA From_Any converter for type xxx (Exp_TSS) -- xxxIP initialization procedure for type xxx (Exp_TSS) - -- xxxRA RAs type access routine for type xxx (Exp_TSS) - -- xxxRD RAs type dereference routine for type xxx (Exp_TSS) + -- xxxRA RAS type access routine for type xxx (Exp_TSS) + -- xxxRD RAS type dereference routine for type xxx (Exp_TSS) -- xxxRP Rep to Pos conversion for enumeration type xxx (Exp_TSS) -- xxxSA array/slice assignment for controlled comp. arrays (Exp_TSS) -- xxxSI stream input attribute subprogram for type xxx (Exp_TSS) -- xxxSO stream output attribute subprogram for type xxx (Exp_TSS) -- xxxSR stream read attribute subprogram for type xxx (Exp_TSS) -- xxxSW stream write attribute subprogram for type xxx (Exp_TSS) + -- xxxTA PolyORB/DSA To_Any converter for type xxx (Exp_TSS) + -- xxxTC PolyORB/DSA Typecode for type xxx (Exp_TSS) -- Implicit type names diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads index 9b79ae448dc..4c8d2547ef0 100644 --- a/gcc/ada/snames.ads +++ b/gcc/ada/snames.ads @@ -880,126 +880,127 @@ package Snames is -- Note: Asm is missing from this list, since Asm is a legitimate -- convention name. So is To_Adress, which is a GNAT attribute. - First_Intrinsic_Name : constant Name_Id := N + 544; - Name_Divide : constant Name_Id := N + 544; - Name_Enclosing_Entity : constant Name_Id := N + 545; - Name_Exception_Information : constant Name_Id := N + 546; - Name_Exception_Message : constant Name_Id := N + 547; - Name_Exception_Name : constant Name_Id := N + 548; - Name_File : constant Name_Id := N + 549; - Name_Import_Address : constant Name_Id := N + 550; - Name_Import_Largest_Value : constant Name_Id := N + 551; - Name_Import_Value : constant Name_Id := N + 552; - Name_Is_Negative : constant Name_Id := N + 553; - Name_Line : constant Name_Id := N + 554; - Name_Rotate_Left : constant Name_Id := N + 555; - Name_Rotate_Right : constant Name_Id := N + 556; - Name_Shift_Left : constant Name_Id := N + 557; - Name_Shift_Right : constant Name_Id := N + 558; - Name_Shift_Right_Arithmetic : constant Name_Id := N + 559; - Name_Source_Location : constant Name_Id := N + 560; - Name_Unchecked_Conversion : constant Name_Id := N + 561; - Name_Unchecked_Deallocation : constant Name_Id := N + 562; - Name_To_Pointer : constant Name_Id := N + 563; - Last_Intrinsic_Name : constant Name_Id := N + 563; + First_Intrinsic_Name : constant Name_Id := N + 544; + Name_Divide : constant Name_Id := N + 544; + Name_Enclosing_Entity : constant Name_Id := N + 545; + Name_Exception_Information : constant Name_Id := N + 546; + Name_Exception_Message : constant Name_Id := N + 547; + Name_Exception_Name : constant Name_Id := N + 548; + Name_File : constant Name_Id := N + 549; + Name_Generic_Dispatching_Constructor : constant Name_Id := N + 550; + Name_Import_Address : constant Name_Id := N + 551; + Name_Import_Largest_Value : constant Name_Id := N + 552; + Name_Import_Value : constant Name_Id := N + 553; + Name_Is_Negative : constant Name_Id := N + 554; + Name_Line : constant Name_Id := N + 555; + Name_Rotate_Left : constant Name_Id := N + 556; + Name_Rotate_Right : constant Name_Id := N + 557; + Name_Shift_Left : constant Name_Id := N + 558; + Name_Shift_Right : constant Name_Id := N + 559; + Name_Shift_Right_Arithmetic : constant Name_Id := N + 560; + Name_Source_Location : constant Name_Id := N + 561; + Name_Unchecked_Conversion : constant Name_Id := N + 562; + Name_Unchecked_Deallocation : constant Name_Id := N + 563; + Name_To_Pointer : constant Name_Id := N + 564; + Last_Intrinsic_Name : constant Name_Id := N + 564; -- Reserved words used only in Ada 95 - First_95_Reserved_Word : constant Name_Id := N + 564; - Name_Abstract : constant Name_Id := N + 564; - Name_Aliased : constant Name_Id := N + 565; - Name_Protected : constant Name_Id := N + 566; - Name_Until : constant Name_Id := N + 567; - Name_Requeue : constant Name_Id := N + 568; - Name_Tagged : constant Name_Id := N + 569; - Last_95_Reserved_Word : constant Name_Id := N + 569; + First_95_Reserved_Word : constant Name_Id := N + 565; + Name_Abstract : constant Name_Id := N + 565; + Name_Aliased : constant Name_Id := N + 566; + Name_Protected : constant Name_Id := N + 567; + Name_Until : constant Name_Id := N + 568; + Name_Requeue : constant Name_Id := N + 569; + Name_Tagged : constant Name_Id := N + 570; + Last_95_Reserved_Word : constant Name_Id := N + 570; subtype Ada_95_Reserved_Words is Name_Id range First_95_Reserved_Word .. Last_95_Reserved_Word; -- Miscellaneous names used in semantic checking - Name_Raise_Exception : constant Name_Id := N + 570; + Name_Raise_Exception : constant Name_Id := N + 571; -- Additional reserved words and identifiers used in GNAT Project Files -- Note that Name_External is already previously declared - Name_Ada_Roots : constant Name_Id := N + 571; - Name_Binder : constant Name_Id := N + 572; - Name_Binder_Driver : constant Name_Id := N + 573; - Name_Body_Suffix : constant Name_Id := N + 574; - Name_Builder : constant Name_Id := N + 575; - Name_Compiler : constant Name_Id := N + 576; - Name_Compiler_Driver : constant Name_Id := N + 577; - Name_Compiler_Kind : constant Name_Id := N + 578; - Name_Compute_Dependency : constant Name_Id := N + 579; - Name_Cross_Reference : constant Name_Id := N + 580; - Name_Default_Linker : constant Name_Id := N + 581; - Name_Default_Switches : constant Name_Id := N + 582; - Name_Dependency_Option : constant Name_Id := N + 583; - Name_Exec_Dir : constant Name_Id := N + 584; - Name_Executable : constant Name_Id := N + 585; - Name_Executable_Suffix : constant Name_Id := N + 586; - Name_Extends : constant Name_Id := N + 587; - Name_Externally_Built : constant Name_Id := N + 588; - Name_Finder : constant Name_Id := N + 589; - Name_Global_Configuration_Pragmas : constant Name_Id := N + 590; - Name_Gnatls : constant Name_Id := N + 591; - Name_Gnatstub : constant Name_Id := N + 592; - Name_Implementation : constant Name_Id := N + 593; - Name_Implementation_Exceptions : constant Name_Id := N + 594; - Name_Implementation_Suffix : constant Name_Id := N + 595; - Name_Include_Option : constant Name_Id := N + 596; - Name_Language_Processing : constant Name_Id := N + 597; - Name_Languages : constant Name_Id := N + 598; - Name_Library_Dir : constant Name_Id := N + 599; - Name_Library_Auto_Init : constant Name_Id := N + 600; - Name_Library_GCC : constant Name_Id := N + 601; - Name_Library_Interface : constant Name_Id := N + 602; - Name_Library_Kind : constant Name_Id := N + 603; - Name_Library_Name : constant Name_Id := N + 604; - Name_Library_Options : constant Name_Id := N + 605; - Name_Library_Reference_Symbol_File : constant Name_Id := N + 606; - Name_Library_Src_Dir : constant Name_Id := N + 607; - Name_Library_Symbol_File : constant Name_Id := N + 608; - Name_Library_Symbol_Policy : constant Name_Id := N + 609; - Name_Library_Version : constant Name_Id := N + 610; - Name_Linker : constant Name_Id := N + 611; - Name_Local_Configuration_Pragmas : constant Name_Id := N + 612; - Name_Locally_Removed_Files : constant Name_Id := N + 613; - Name_Metrics : constant Name_Id := N + 614; - Name_Naming : constant Name_Id := N + 615; - Name_Object_Dir : constant Name_Id := N + 616; - Name_Pretty_Printer : constant Name_Id := N + 617; - Name_Project : constant Name_Id := N + 618; - Name_Separate_Suffix : constant Name_Id := N + 619; - Name_Source_Dirs : constant Name_Id := N + 620; - Name_Source_Files : constant Name_Id := N + 621; - Name_Source_List_File : constant Name_Id := N + 622; - Name_Spec : constant Name_Id := N + 623; - Name_Spec_Suffix : constant Name_Id := N + 624; - Name_Specification : constant Name_Id := N + 625; - Name_Specification_Exceptions : constant Name_Id := N + 626; - Name_Specification_Suffix : constant Name_Id := N + 627; - Name_Switches : constant Name_Id := N + 628; + Name_Ada_Roots : constant Name_Id := N + 572; + Name_Binder : constant Name_Id := N + 573; + Name_Binder_Driver : constant Name_Id := N + 574; + Name_Body_Suffix : constant Name_Id := N + 575; + Name_Builder : constant Name_Id := N + 576; + Name_Compiler : constant Name_Id := N + 577; + Name_Compiler_Driver : constant Name_Id := N + 578; + Name_Compiler_Kind : constant Name_Id := N + 579; + Name_Compute_Dependency : constant Name_Id := N + 580; + Name_Cross_Reference : constant Name_Id := N + 581; + Name_Default_Linker : constant Name_Id := N + 582; + Name_Default_Switches : constant Name_Id := N + 583; + Name_Dependency_Option : constant Name_Id := N + 584; + Name_Exec_Dir : constant Name_Id := N + 585; + Name_Executable : constant Name_Id := N + 586; + Name_Executable_Suffix : constant Name_Id := N + 587; + Name_Extends : constant Name_Id := N + 588; + Name_Externally_Built : constant Name_Id := N + 589; + Name_Finder : constant Name_Id := N + 590; + Name_Global_Configuration_Pragmas : constant Name_Id := N + 591; + Name_Gnatls : constant Name_Id := N + 592; + Name_Gnatstub : constant Name_Id := N + 593; + Name_Implementation : constant Name_Id := N + 594; + Name_Implementation_Exceptions : constant Name_Id := N + 595; + Name_Implementation_Suffix : constant Name_Id := N + 596; + Name_Include_Option : constant Name_Id := N + 597; + Name_Language_Processing : constant Name_Id := N + 598; + Name_Languages : constant Name_Id := N + 599; + Name_Library_Dir : constant Name_Id := N + 600; + Name_Library_Auto_Init : constant Name_Id := N + 601; + Name_Library_GCC : constant Name_Id := N + 602; + Name_Library_Interface : constant Name_Id := N + 603; + Name_Library_Kind : constant Name_Id := N + 604; + Name_Library_Name : constant Name_Id := N + 605; + Name_Library_Options : constant Name_Id := N + 606; + Name_Library_Reference_Symbol_File : constant Name_Id := N + 607; + Name_Library_Src_Dir : constant Name_Id := N + 608; + Name_Library_Symbol_File : constant Name_Id := N + 609; + Name_Library_Symbol_Policy : constant Name_Id := N + 610; + Name_Library_Version : constant Name_Id := N + 611; + Name_Linker : constant Name_Id := N + 612; + Name_Local_Configuration_Pragmas : constant Name_Id := N + 613; + Name_Locally_Removed_Files : constant Name_Id := N + 614; + Name_Metrics : constant Name_Id := N + 615; + Name_Naming : constant Name_Id := N + 616; + Name_Object_Dir : constant Name_Id := N + 617; + Name_Pretty_Printer : constant Name_Id := N + 618; + Name_Project : constant Name_Id := N + 619; + Name_Separate_Suffix : constant Name_Id := N + 620; + Name_Source_Dirs : constant Name_Id := N + 621; + Name_Source_Files : constant Name_Id := N + 622; + Name_Source_List_File : constant Name_Id := N + 623; + Name_Spec : constant Name_Id := N + 624; + Name_Spec_Suffix : constant Name_Id := N + 625; + Name_Specification : constant Name_Id := N + 626; + Name_Specification_Exceptions : constant Name_Id := N + 627; + Name_Specification_Suffix : constant Name_Id := N + 628; + Name_Switches : constant Name_Id := N + 629; -- Other miscellaneous names used in front end - Name_Unaligned_Valid : constant Name_Id := N + 629; + Name_Unaligned_Valid : constant Name_Id := N + 630; -- ---------------------------------------------------------------- - First_2005_Reserved_Word : constant Name_Id := N + 630; - Name_Interface : constant Name_Id := N + 630; - Name_Overriding : constant Name_Id := N + 631; - Name_Synchronized : constant Name_Id := N + 632; - Last_2005_Reserved_Word : constant Name_Id := N + 632; + First_2005_Reserved_Word : constant Name_Id := N + 631; + Name_Interface : constant Name_Id := N + 631; + Name_Overriding : constant Name_Id := N + 632; + Name_Synchronized : constant Name_Id := N + 633; + Last_2005_Reserved_Word : constant Name_Id := N + 633; subtype Ada_2005_Reserved_Words is Name_Id range First_2005_Reserved_Word .. Last_2005_Reserved_Word; -- Mark last defined name for consistency check in Snames body - Last_Predefined_Name : constant Name_Id := N + 632; + Last_Predefined_Name : constant Name_Id := N + 633; subtype Any_Operator_Name is Name_Id range First_Operator_Name .. Last_Operator_Name; diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb index 91c807b1a07..aec09dd028e 100644 --- a/gcc/ada/styleg.adb +++ b/gcc/ada/styleg.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -265,6 +265,8 @@ package body Styleg is S : Source_Ptr; begin + -- Do we need to worry about UTF_32 line terminators here ??? + S := Scan_Ptr + 3; while Source (S) not in Line_Terminator loop S := S + 1; @@ -462,18 +464,36 @@ package body Styleg is end Check_Left_Paren; --------------------------- + -- Check_Line_Max_Length -- + --------------------------- + + -- In check max line length mode (-gnatym), the line length must + -- not exceed the permitted maximum value. + + procedure Check_Line_Max_Length (Len : Int) is + begin + if Style_Check_Max_Line_Length then + if Len > Style_Max_Line_Length then + Error_Msg + ("(style) this line is too long", + Current_Line_Start + Source_Ptr (Style_Max_Line_Length)); + end if; + end if; + end Check_Line_Max_Length; + + --------------------------- -- Check_Line_Terminator -- --------------------------- -- In check blanks at end mode (-gnatyb), lines may not end with a -- trailing space. - -- In check max line length mode (-gnatym), the line length must - -- not exceed the permitted maximum value. - -- In check form feeds mode (-gnatyf), the line terminator may not -- be either of the characters FF or VT. + -- In check DOS line terminators node (-gnatyd), the line terminator + -- must be a single LF, without a following CR. + procedure Check_Line_Terminator (Len : Int) is S : Source_Ptr; @@ -483,18 +503,30 @@ package body Styleg is if Style_Check_Form_Feeds then if Source (Scan_Ptr) = ASCII.FF then Error_Msg_S ("(style) form feed not allowed"); - elsif Source (Scan_Ptr) = ASCII.VT then Error_Msg_S ("(style) vertical tab not allowed"); end if; end if; - -- We are now possibly going to check for trailing spaces and maximum - -- line length. There is no point in doing this if the current line is - -- empty. It is actually wrong in the case of trailing spaces, because - -- we scan backwards for this purpose, so we would end up looking at a - -- different line, or even at invalid buffer locations if we have the - -- first source line at hand. + -- Check DOS line terminator (ignore EOF, since we only get called + -- with an EOF if it is the last character in the buffer, and was + -- therefore not present in the sources + + if Style_Check_DOS_Line_Terminator then + if Source (Scan_Ptr) = EOF then + null; + elsif Source (Scan_Ptr) /= LF + or else Source (Scan_Ptr + 1) = CR + then + Error_Msg_S ("(style) incorrect line terminator"); + end if; + end if; + + -- We are now possibly going to check for trailing spaces. There is no + -- point in doing this if the current line is empty. It is actually + -- wrong to do so, because we scan backwards for this purpose, so we + -- would end up looking at different line, or even at invalid buffer + -- locations if we have the first source line at hand. if Len = 0 then return; @@ -515,17 +547,6 @@ package body Styleg is end if; end if; end if; - - -- Check max line length - - if Style_Check_Max_Line_Length then - if Len > Style_Max_Line_Length then - Error_Msg - ("(style) this line is too long", - Current_Line_Start + Source_Ptr (Style_Max_Line_Length)); - end if; - end if; - end Check_Line_Terminator; -------------------------- diff --git a/gcc/ada/styleg.ads b/gcc/ada/styleg.ads index bf5b1e144cd..3bd0712efa5 100644 --- a/gcc/ada/styleg.ads +++ b/gcc/ada/styleg.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -104,11 +104,15 @@ package Styleg is procedure Check_Left_Paren; -- Called after scanning out a left parenthesis to check spacing. + procedure Check_Line_Max_Length (Len : Int); + -- Called with Scan_Ptr pointing to the first line terminator character + -- terminating the current line. Used to check for appropriate line length. + -- The parameter Len is the length of the current line. + procedure Check_Line_Terminator (Len : Int); -- Called with Scan_Ptr pointing to the first line terminator terminating - -- the current line, used to check for appropriate line terminator and - -- to check the line length (Len is the length of the current line). - -- Note that the terminator may be the EOF character. + -- the current line, used to check for appropriate line terminator usage. + -- The parameter Len is the length of the current line. procedure Check_Pragma_Name; -- The current token is a pragma identifier. Check that it is spelled diff --git a/gcc/ada/stylesw.adb b/gcc/ada/stylesw.adb index 1b3ea5ff40c..3979f74e984 100644 --- a/gcc/ada/stylesw.adb +++ b/gcc/ada/stylesw.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -34,25 +34,26 @@ package body Stylesw is procedure Reset_Style_Check_Options is begin - Style_Check_Indentation := 0; - Style_Check_Attribute_Casing := False; - Style_Check_Blanks_At_End := False; - Style_Check_Comments := False; - Style_Check_End_Labels := False; - Style_Check_Form_Feeds := False; - Style_Check_Horizontal_Tabs := False; - Style_Check_If_Then_Layout := False; - Style_Check_Keyword_Casing := False; - Style_Check_Layout := False; - Style_Check_Max_Line_Length := False; - Style_Check_Max_Nesting_Level := False; - Style_Check_Order_Subprograms := False; - Style_Check_Pragma_Casing := False; - Style_Check_References := False; - Style_Check_Specs := False; - Style_Check_Standard := False; - Style_Check_Tokens := False; - Style_Check_Xtra_Parens := False; + Style_Check_Indentation := 0; + Style_Check_Attribute_Casing := False; + Style_Check_Blanks_At_End := False; + Style_Check_Comments := False; + Style_Check_DOS_Line_Terminator := False; + Style_Check_End_Labels := False; + Style_Check_Form_Feeds := False; + Style_Check_Horizontal_Tabs := False; + Style_Check_If_Then_Layout := False; + Style_Check_Keyword_Casing := False; + Style_Check_Layout := False; + Style_Check_Max_Line_Length := False; + Style_Check_Max_Nesting_Level := False; + Style_Check_Order_Subprograms := False; + Style_Check_Pragma_Casing := False; + Style_Check_References := False; + Style_Check_Specs := False; + Style_Check_Standard := False; + Style_Check_Tokens := False; + Style_Check_Xtra_Parens := False; end Reset_Style_Check_Options; ------------------------------ @@ -107,6 +108,7 @@ package body Stylesw is Add ('a', Style_Check_Attribute_Casing); Add ('b', Style_Check_Blanks_At_End); Add ('c', Style_Check_Comments); + Add ('d', Style_Check_DOS_Line_Terminator); Add ('e', Style_Check_End_Labels); Add ('f', Style_Check_Form_Feeds); Add ('h', Style_Check_Horizontal_Tabs); @@ -186,31 +188,34 @@ package body Stylesw is := Character'Pos (C) - Character'Pos ('0'); when 'a' => - Style_Check_Attribute_Casing := True; + Style_Check_Attribute_Casing := True; when 'b' => - Style_Check_Blanks_At_End := True; + Style_Check_Blanks_At_End := True; when 'c' => - Style_Check_Comments := True; + Style_Check_Comments := True; + + when 'd' => + Style_Check_DOS_Line_Terminator := True; when 'e' => - Style_Check_End_Labels := True; + Style_Check_End_Labels := True; when 'f' => - Style_Check_Form_Feeds := True; + Style_Check_Form_Feeds := True; when 'h' => - Style_Check_Horizontal_Tabs := True; + Style_Check_Horizontal_Tabs := True; when 'i' => - Style_Check_If_Then_Layout := True; + Style_Check_If_Then_Layout := True; when 'k' => - Style_Check_Keyword_Casing := True; + Style_Check_Keyword_Casing := True; when 'l' => - Style_Check_Layout := True; + Style_Check_Layout := True; when 'L' => Style_Max_Nesting_Level := 0; @@ -242,11 +247,11 @@ package body Stylesw is Style_Check_Max_Nesting_Level := Style_Max_Nesting_Level /= 0; when 'm' => - Style_Check_Max_Line_Length := True; - Style_Max_Line_Length := 79; + Style_Check_Max_Line_Length := True; + Style_Max_Line_Length := 79; when 'n' => - Style_Check_Standard := True; + Style_Check_Standard := True; when 'N' => Reset_Style_Check_Options; @@ -281,22 +286,22 @@ package body Stylesw is Style_Check_Max_Line_Length := Style_Max_Line_Length /= 0; when 'o' => - Style_Check_Order_Subprograms := True; + Style_Check_Order_Subprograms := True; when 'p' => - Style_Check_Pragma_Casing := True; + Style_Check_Pragma_Casing := True; when 'r' => - Style_Check_References := True; + Style_Check_References := True; when 's' => - Style_Check_Specs := True; + Style_Check_Specs := True; when 't' => - Style_Check_Tokens := True; + Style_Check_Tokens := True; when 'x' => - Style_Check_Xtra_Parens := True; + Style_Check_Xtra_Parens := True; when ' ' => null; diff --git a/gcc/ada/stylesw.ads b/gcc/ada/stylesw.ads index d3c46def539..bd9d1a866b3 100644 --- a/gcc/ada/stylesw.ads +++ b/gcc/ada/stylesw.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -84,6 +84,11 @@ package Stylesw is -- Note: the reason for the last two conditions is to allow "boxed" -- comments where only a single space separates the comment characters. + Style_Check_DOS_Line_Terminator : Boolean := False; + -- This can be set true by using the -gnatg or -gnatyd switches. If + -- it is True, then the line terminator must be a single LF, without an + -- associated CR (e.g. DOS line terminator sequence CR/LF not allowed). + Style_Check_End_Labels : Boolean := False; -- This can be set True by using the -gnatg or -gnatye switches. If -- it is True, then optional END labels must always be present. @@ -242,7 +247,7 @@ package Stylesw is procedure Set_Default_Style_Check_Options; -- This procedure is called to set the default style checking options - -- in response to a -gnatg switch or -gnaty with no suboptions. + -- in response to a -gnaty switch with no suboptions. procedure Set_Style_Check_Options (Options : String; diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index 391347a0c22..a91f9ea464e 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -485,7 +485,7 @@ package body Switch.C is System_Extend_Unit := Empty; Warning_Mode := Treat_As_Error; - -- Set default warnings (basically -gnatwa) + -- Set default warnings for -gnatg (same set as -gnatwa) Check_Unreferenced := True; Check_Unreferenced_Formals := True; @@ -493,6 +493,7 @@ package body Switch.C is Constant_Condition_Warnings := True; Implementation_Unit_Warnings := True; Ineffective_Inline_Warnings := True; + Warn_On_Bad_Fixed_Value := True; Warn_On_Constant := True; Warn_On_Export_Import := True; Warn_On_Modified_Unread := True; @@ -502,7 +503,7 @@ package body Switch.C is Warn_On_Unchecked_Conversion := True; Warn_On_Unrecognized_Pragma := True; - Set_Default_Style_Check_Options; + Set_Style_Check_Options ("3abcdefhiklmnprst"); -- Processing for G switch @@ -762,6 +763,7 @@ package body Switch.C is Constant_Condition_Warnings := True; Implementation_Unit_Warnings := True; Ineffective_Inline_Warnings := True; + Warn_On_Bad_Fixed_Value := True; Warn_On_Constant := True; Warn_On_Export_Import := True; Warn_On_Modified_Unread := True; @@ -779,6 +781,7 @@ package body Switch.C is Elab_Warnings := False; Implementation_Unit_Warnings := False; Ineffective_Inline_Warnings := False; + Warn_On_Bad_Fixed_Value := False; Warn_On_Constant := False; Warn_On_Dereference := False; Warn_On_Export_Import := False; @@ -790,6 +793,12 @@ package body Switch.C is Warn_On_Unchecked_Conversion := False; Warn_On_Unrecognized_Pragma := False; + when 'b' => + Warn_On_Bad_Fixed_Value := True; + + when 'B' => + Warn_On_Bad_Fixed_Value := False; + when 'c' => Constant_Condition_Warnings := True; diff --git a/gcc/ada/switch-m.adb b/gcc/ada/switch-m.adb index 5215fe15029..aeb33e7cfb4 100644 --- a/gcc/ada/switch-m.adb +++ b/gcc/ada/switch-m.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -404,6 +404,50 @@ package body Switch.M is end if; end loop; + -- -gnat95 -gnat05 + + when '0' | '9' => + Last_Stored := First_Stored; + Storing (Last_Stored) := C; + Ptr := Ptr + 1; + + if Ptr /= Max or else Switch_Chars (Ptr) /= '5' then + + -- Invalid switch + + Last := 0; + return; + + else + Last_Stored := Last_Stored + 1; + Storing (Last_Stored) := '5'; + Add_Switch_Component + (Storing (Storing'First .. Last_Stored)); + Ptr := Ptr + 1; + end if; + + -- -gnat83 + + when '8' => + Last_Stored := First_Stored; + Storing (Last_Stored) := '8'; + Ptr := Ptr + 1; + + if Ptr /= Max or else Switch_Chars (Ptr) /= '3' then + + -- Invalid switch + + Last := 0; + return; + + else + Last_Stored := Last_Stored + 1; + Storing (Last_Stored) := '3'; + Add_Switch_Component + (Storing (Storing'First .. Last_Stored)); + Ptr := Ptr + 1; + end if; + -- Not a valid switch when others => diff --git a/gcc/ada/symbols-vms-alpha.adb b/gcc/ada/symbols-vms-alpha.adb index 2151706bc43..4fb68318f99 100644 --- a/gcc/ada/symbols-vms-alpha.adb +++ b/gcc/ada/symbols-vms-alpha.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2003-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 2003-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -36,7 +36,7 @@ package body Symbols is Symbol_Vector : constant String := "SYMBOL_VECTOR=("; Equal_Data : constant String := "=DATA)"; Equal_Procedure : constant String := "=PROCEDURE)"; - Gsmatch : constant String := "gsmatch=equal,"; + Gsmatch : constant String := "gsmatch=lequal,"; Symbol_File_Name : String_Access := null; -- Name of the symbol file @@ -668,18 +668,15 @@ package body Symbols is Success := False; return; - elsif Soft_Minor_ID then - Minor_ID := Minor_ID + 1; + elsif Soft_Major_ID then + Major_ID := Major_ID + 1; + Minor_ID := 0; + Soft_Major_ID := False; Soft_Minor_ID := False; end if; Original_Symbols.Table (Index_1).Present := False; Free (Original_Symbols.Table (Index_1).Name); - - if Soft_Minor_ID then - Minor_ID := Minor_ID + 1; - Soft_Minor_ID := False; - end if; end if; end loop; diff --git a/gcc/ada/system-hpux.ads b/gcc/ada/system-hpux.ads index 5252fc5c393..0ac0bb7408e 100644 --- a/gcc/ada/system-hpux.ads +++ b/gcc/ada/system-hpux.ads @@ -130,7 +130,7 @@ private Machine_Rounds : constant Boolean := True; OpenVMS : constant Boolean := False; Preallocated_Stacks : constant Boolean := False; - Signed_Zeros : constant Boolean := False; + Signed_Zeros : constant Boolean := True; Stack_Check_Default : constant Boolean := False; Stack_Check_Probes : constant Boolean := False; Support_64_Bit_Divides : constant Boolean := True; diff --git a/gcc/ada/system-linux-hppa.ads b/gcc/ada/system-linux-hppa.ads new file mode 100644 index 00000000000..fde1129b7b5 --- /dev/null +++ b/gcc/ada/system-linux-hppa.ads @@ -0,0 +1,151 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT RUN-TIME COMPONENTS -- +-- -- +-- S Y S T E M -- +-- -- +-- S p e c -- +-- (GNU/Linux-HPPA Version) -- +-- -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- +-- -- +-- This specification is derived from the Ada Reference Manual for use with -- +-- GNAT. The copyright notice above, and the license provisions that follow -- +-- apply solely to the contents of the part following the private keyword. -- +-- -- +-- GNAT is free software; you can redistribute it and/or modify it under -- +-- terms of the GNU General Public License as published by the Free Soft- -- +-- ware Foundation; either version 2, or (at your option) any later ver- -- +-- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- +-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- +-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- +-- for more details. You should have received a copy of the GNU General -- +-- Public License distributed with GNAT; see file COPYING. If not, write -- +-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- +-- MA 02111-1307, USA. -- +-- -- +-- As a special exception, if other files instantiate generics from this -- +-- unit, or you link this unit with other files to produce an executable, -- +-- this unit does not by itself cause the resulting executable to be -- +-- covered by the GNU General Public License. This exception does not -- +-- however invalidate any other reasons why the executable file might be -- +-- covered by the GNU Public License. -- +-- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- +------------------------------------------------------------------------------ + +package System is +pragma Pure (System); +-- Note that we take advantage of the implementation permission to +-- make this unit Pure instead of Preelaborable, see RM 13.7(36) + + type Name is (SYSTEM_NAME_GNAT); + System_Name : constant Name := SYSTEM_NAME_GNAT; + + -- System-Dependent Named Numbers + + Min_Int : constant := Long_Long_Integer'First; + Max_Int : constant := Long_Long_Integer'Last; + + Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size; + Max_Nonbinary_Modulus : constant := Integer'Last; + + Max_Base_Digits : constant := Long_Long_Float'Digits; + Max_Digits : constant := Long_Long_Float'Digits; + + Max_Mantissa : constant := 63; + Fine_Delta : constant := 2.0 ** (-Max_Mantissa); + + Tick : constant := 0.000_001; + + -- Storage-related Declarations + + type Address is private; + Null_Address : constant Address; + + Storage_Unit : constant := 8; + Word_Size : constant := 32; + Memory_Size : constant := 2 ** 32; + + -- Address comparison + + function "<" (Left, Right : Address) return Boolean; + function "<=" (Left, Right : Address) return Boolean; + function ">" (Left, Right : Address) return Boolean; + function ">=" (Left, Right : Address) return Boolean; + function "=" (Left, Right : Address) return Boolean; + + pragma Import (Intrinsic, "<"); + pragma Import (Intrinsic, "<="); + pragma Import (Intrinsic, ">"); + pragma Import (Intrinsic, ">="); + pragma Import (Intrinsic, "="); + + -- Other System-Dependent Declarations + + type Bit_Order is (High_Order_First, Low_Order_First); + Default_Bit_Order : constant Bit_Order := High_Order_First; + + -- Priority-related Declarations (RM D.1) + + Max_Priority : constant Positive := 30; + Max_Interrupt_Priority : constant Positive := 31; + + subtype Any_Priority is Integer range 0 .. 31; + subtype Priority is Any_Priority range 0 .. 30; + subtype Interrupt_Priority is Any_Priority range 31 .. 31; + + Default_Priority : constant Priority := 15; + +private + + type Address is mod Memory_Size; + Null_Address : constant Address := 0; + + -------------------------------------- + -- System Implementation Parameters -- + -------------------------------------- + + -- These parameters provide information about the target that is used + -- by the compiler. They are in the private part of System, where they + -- can be accessed using the special circuitry in the Targparm unit + -- whose source should be consulted for more detailed descriptions + -- of the individual switch values. + + AAMP : constant Boolean := False; + Backend_Divide_Checks : constant Boolean := False; + Backend_Overflow_Checks : constant Boolean := False; + Command_Line_Args : constant Boolean := True; + Configurable_Run_Time : constant Boolean := False; + Denorm : constant Boolean := True; + Duration_32_Bits : constant Boolean := False; + Exit_Status_Supported : constant Boolean := True; + Fractional_Fixed_Ops : constant Boolean := False; + Frontend_Layout : constant Boolean := False; + Functions_Return_By_DSP : constant Boolean := False; + Machine_Overflows : constant Boolean := False; + Machine_Rounds : constant Boolean := True; + OpenVMS : constant Boolean := False; + Preallocated_Stacks : constant Boolean := False; + Signed_Zeros : constant Boolean := True; + Stack_Check_Default : constant Boolean := False; + Stack_Check_Probes : constant Boolean := False; + Support_64_Bit_Divides : constant Boolean := True; + Support_Aggregates : constant Boolean := True; + Support_Composite_Assign : constant Boolean := True; + Support_Composite_Compare : constant Boolean := True; + Support_Long_Shifts : constant Boolean := True; + Suppress_Standard_Library : constant Boolean := False; + Use_Ada_Main_Program_Name : constant Boolean := False; + ZCX_By_Default : constant Boolean := True; + GCC_ZCX_Support : constant Boolean := True; + Front_End_ZCX_Support : constant Boolean := False; + + -- Obsolete entries, to be removed eventually (bootstrap issues!) + + High_Integrity_Mode : constant Boolean := False; + Long_Shifts_Inlined : constant Boolean := False; + +end System; diff --git a/gcc/ada/tbuild.adb b/gcc/ada/tbuild.adb index 6dedcabeca4..eed8e99ce97 100644 --- a/gcc/ada/tbuild.adb +++ b/gcc/ada/tbuild.adb @@ -178,35 +178,6 @@ package body Tbuild is New_Reference_To (First_Tag_Component (Full_Type), Loc))); end Make_DT_Access; - ----------------------- - -- Make_DT_Component -- - ----------------------- - - function Make_DT_Component - (Loc : Source_Ptr; - Typ : Entity_Id; - N : Positive) return Node_Id - is - X : Node_Id; - Full_Type : Entity_Id := Typ; - - begin - if Is_Private_Type (Typ) then - Full_Type := Underlying_Type (Typ); - end if; - - X := - First_Component - (Designated_Type - (Etype (Node (First_Elmt (Access_Disp_Table (Full_Type)))))); - - for J in 2 .. N loop - X := Next_Component (X); - end loop; - - return New_Reference_To (X, Loc); - end Make_DT_Component; - -------------------------------- -- Make_Implicit_If_Statement -- -------------------------------- diff --git a/gcc/ada/tbuild.ads b/gcc/ada/tbuild.ads index 740ad785aa2..3cd0fcc7111 100644 --- a/gcc/ada/tbuild.ads +++ b/gcc/ada/tbuild.ads @@ -69,20 +69,6 @@ package Tbuild is -- Must_Be_Byte_Aligned is set in the attribute reference node. The -- Attribute_Name must be Name_Address or Name_Unrestricted_Access. - function Make_DT_Component - (Loc : Source_Ptr; - Typ : Entity_Id; - N : Positive) return Node_Id; - -- Gives a reference to the Nth component of the Dispatch Table of - -- a given Tagged Type. - -- - -- N = 1 --> Inheritance_Depth - -- N = 2 --> Tags (array of ancestors) - -- N = 3, 4 --> predefined primitive - -- function _Size (X : Typ) return Long_Long_Integer; - -- function _Equality (X : Typ; Y : Typ'Class) return Boolean; - -- N >= 5 --> User-Defined Primitive Operations - function Make_DT_Access (Loc : Source_Ptr; Rec : Node_Id; Typ : Entity_Id) return Node_Id; -- Create an access to the Dispatch Table by using the Tag field diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c index 1cd4a0f2588..773db24186a 100644 --- a/gcc/ada/tracebak.c +++ b/gcc/ada/tracebak.c @@ -212,7 +212,7 @@ struct layout function is located in it's caller's frame, and the save operation only takes place if the function performs a call. - To have __gnat_backtrace retrieve it's own return address, we then + To have __gnat_backtrace retrieve its own return address, we then define ... */ #define FORCE_CALL @@ -344,7 +344,7 @@ struct layout libgcc, and the stage1 compiler is unlikely to be linked against a post 3.3 library. It actually disables the support for backtraces in this compiler for targets defining USE_GCC_UNWINDER, which is OK since we don't use the - traceback capablity in the compiler anyway. + traceback capability in the compiler anyway. The condition is expressed the way above because we cannot reliably rely on any other macro from the base compiler when compiling stage1. */ diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c index 7e6485557a4..869ce3f5603 100644 --- a/gcc/ada/trans.c +++ b/gcc/ada/trans.c @@ -348,7 +348,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) } else { - /* Expand the type of this identitier first, in case it is an enumeral + /* Expand the type of this identifier first, in case it is an enumeral literal, which only get made when the type is expanded. There is no order-of-elaboration issue here. We want to use the Actual_Subtype if it has already been elaborated, otherwise the Etype. Avoid using @@ -393,7 +393,7 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) && DECL_BY_COMPONENT_PTR_P (gnu_result)))) { bool ro = DECL_POINTS_TO_READONLY_P (gnu_result); - tree initial; + tree renamed_obj; if (TREE_CODE (gnu_result) == PARM_DECL && DECL_BY_COMPONENT_PTR_P (gnu_result)) @@ -402,34 +402,16 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p) convert (build_pointer_type (gnu_result_type), gnu_result)); - /* If the object is constant, we try to do the dereference directly - through the DECL_INITIAL. This is actually required in order to get - correct aliasing information for renamed objects that are components - of non-aliased aggregates, because the type of the renamed object and - that of the aggregate don't alias. - - Note that we expect the initial value to have been stabilized. - If it contains e.g. a variable reference, we certainly don't want - to re-evaluate the variable each time the renaming is used. - - Stabilization is currently not performed at the global level but - create_var_decl avoids setting DECL_INITIAL if the value is not - constant then, and we get to the pointer dereference below. - - ??? Couldn't the aliasing issue show up again in this case ? - There is no obvious reason why not. */ - else if (TREE_READONLY (gnu_result) - && DECL_INITIAL (gnu_result) - /* Strip possible conversion to reference type. */ - && ((initial = TREE_CODE (DECL_INITIAL (gnu_result)) - == NOP_EXPR - ? TREE_OPERAND (DECL_INITIAL (gnu_result), 0) - : DECL_INITIAL (gnu_result), 1)) - && TREE_CODE (initial) == ADDR_EXPR - && (TREE_CODE (TREE_OPERAND (initial, 0)) == ARRAY_REF - || (TREE_CODE (TREE_OPERAND (initial, 0)) - == COMPONENT_REF))) - gnu_result = TREE_OPERAND (initial, 0); + /* If it's a renaming pointer and we are at the right binding level, + we can reference the renamed object directly, since the renamed + expression has been protected against multiple evaluations. */ + else if (TREE_CODE (gnu_result) == VAR_DECL + && (renamed_obj = DECL_RENAMED_OBJECT (gnu_result)) != 0 + && (! DECL_RENAMING_GLOBAL_P (gnu_result) + || global_bindings_p ()) + /* Make sure it's an lvalue like INDIRECT_REF. */ + && (DECL_P (renamed_obj) || REFERENCE_CLASS_P (renamed_obj))) + gnu_result = renamed_obj; else gnu_result = build_unary_op (INDIRECT_REF, NULL_TREE, fold (gnu_result)); @@ -746,8 +728,7 @@ Attribute_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, int attribute) if (CONTAINS_PLACEHOLDER_P (gnu_result)) { if (TREE_CODE (gnu_prefix) != TYPE_DECL) - gnu_result = substitute_placeholder_in_expr (gnu_result, - gnu_expr); + gnu_result = substitute_placeholder_in_expr (gnu_result, gnu_expr); else gnu_result = max_size (gnu_result, true); } @@ -1354,7 +1335,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node) /* Save debug output mode in case it is reset. */ enum debug_info_type save_write_symbols = write_symbols; const struct gcc_debug_hooks *const save_debug_hooks = debug_hooks; - /* Definining identifier of a parameter to the subprogram. */ + /* Defining identifier of a parameter to the subprogram. */ Entity_Id gnat_param; /* The defining identifier for the subprogram body. Note that if a specification has appeared before for this body, then the identifier @@ -3660,7 +3641,7 @@ gnat_to_gnu (Node_Id gnat_node) case N_Defining_Program_Unit_Name: /* For a child unit identifier go up a level to get the - specificaton. We get this when we try to find the spec of + specification. We get this when we try to find the spec of a child unit package that is the compilation unit being compiled. */ gnu_result = gnat_to_gnu (Parent (gnat_node)); break; @@ -3988,7 +3969,7 @@ gnat_to_gnu (Node_Id gnat_node) /* If the result is a pointer type, see if we are either converting from a non-pointer or from a pointer to a type with a different alias set and warn if so. If the result defined in the same unit as - this unchecked convertion, we can allow this because we can know to + this unchecked conversion, we can allow this because we can know to make that type have alias set 0. */ { tree gnu_source_type = gnat_to_gnu_type (Source_Type (gnat_node)); @@ -4012,6 +3993,27 @@ gnat_to_gnu (Node_Id gnat_node) ("\\?or use `pragma No_Strict_Aliasing (&);`", gnat_node, Target_Type (gnat_node)); } + + /* The No_Strict_Aliasing flag is not propagated to the back-end for + fat pointers so unconditionally warn in problematic cases. */ + else if (TYPE_FAT_POINTER_P (gnu_target_type)) + { + tree array_type + = TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_target_type))); + + if (get_alias_set (array_type) != 0 + && (!TYPE_FAT_POINTER_P (gnu_source_type) + || (get_alias_set (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (gnu_source_type)))) + != get_alias_set (array_type)))) + { + post_error_ne + ("?possible aliasing problem for type&", + gnat_node, Target_Type (gnat_node)); + post_error + ("\\?use -fno-strict-aliasing switch for references", + gnat_node); + } + } } gnu_result = alloc_stmt_list (); break; @@ -5349,7 +5351,7 @@ addressable_p (tree gnu_expr) /* Do the processing for the declaration of a GNAT_ENTITY, a type. If a separate Freeze node exists, delay the bulk of the processing. Otherwise - make a GCC type for GNAT_ENTITY and set up the correspondance. */ + make a GCC type for GNAT_ENTITY and set up the correspondence. */ void process_type (Entity_Id gnat_entity) diff --git a/gcc/ada/ug_words b/gcc/ada/ug_words index 21ccc3f911c..03e43251eee 100644 --- a/gcc/ada/ug_words +++ b/gcc/ada/ug_words @@ -105,6 +105,8 @@ gcc -c ^ GNAT COMPILE -gnatw ^ /WARNINGS -gnatwa ^ /WARNINGS=OPTIONAL -gnatwA ^ /WARNINGS=NOOPTIONAL +-gnatwb ^ /WARNINGS=BAD_FIXED_VALUES +-gnatwB ^ /WARNINGS=NO_BAD_FIXED_VALUES -gnatwc ^ /WARNINGS=CONDITIONALS -gnatwC ^ /WARNINGS=NOCONDITIONALS -gnatwd ^ /WARNINGS=IMPLICIT_DEREFERENCE diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb index 64bb0b1c892..e57f9ed5b72 100644 --- a/gcc/ada/usage.adb +++ b/gcc/ada/usage.adb @@ -346,6 +346,10 @@ begin Write_Line ("Enable selected warning modes, xx = list of parameters:"); Write_Line (" a turn on all optional warnings (except d,h,l)"); Write_Line (" A turn off all optional warnings"); + Write_Line (" b turn on warnings for bad fixed value " & + "(not multiple of small)"); + Write_Line (" B* turn off warnings for bad fixed value " & + "(not multiple of small)"); Write_Line (" c turn on warnings for constant conditional"); Write_Line (" C* turn off warnings for constant conditional"); Write_Line (" d turn on warnings for implicit dereference"); @@ -430,6 +434,7 @@ begin Write_Line (" a check attribute casing"); Write_Line (" b check no blanks at end of lines"); Write_Line (" c check comment format"); + Write_Line (" d check no DOS line terminators"); Write_Line (" e check end/exit labels present"); Write_Line (" f check no form feeds/vertical tabs in source"); Write_Line (" h check no horizontal tabs in source"); diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 762ec307ff6..f6ea29bb288 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -668,10 +668,10 @@ finish_record_type (tree record_type, tree fieldlist, bool has_rep, TYPE_MODE (record_type) = BLKmode; if (!had_size_unit) - TYPE_SIZE_UNIT (record_type) = size_zero_node; - + TYPE_SIZE_UNIT (record_type) = size_zero_node; if (!had_size) TYPE_SIZE (record_type) = bitsize_zero_node; + /* For all-repped records with a size specified, lay the QUAL_UNION_TYPE out just like a UNION_TYPE, since the size will be fixed. */ else if (code == QUAL_UNION_TYPE) @@ -796,9 +796,11 @@ finish_record_type (tree record_type, tree fieldlist, bool has_rep, : convert (sizetype, size_binop (CEIL_DIV_EXPR, size, bitsize_unit_node))); - TYPE_SIZE (record_type) = round_up (size, TYPE_ALIGN (record_type)); + TYPE_SIZE (record_type) + = variable_size (round_up (size, TYPE_ALIGN (record_type))); TYPE_SIZE_UNIT (record_type) - = round_up (size_unit, TYPE_ALIGN (record_type) / BITS_PER_UNIT); + = variable_size (round_up (size_unit, + TYPE_ALIGN (record_type) / BITS_PER_UNIT)); compute_record_mode (record_type); } @@ -1552,7 +1554,7 @@ value_factor_p (tree value, HOST_WIDE_INT factor) /* Given 2 consecutive field decls PREV_FIELD and CURR_FIELD, return true unless we can prove these 2 fields are laid out in such a way that no gap - exist between the end of PREV_FIELD and the begining of CURR_FIELD. OFFSET + exist between the end of PREV_FIELD and the beginning of CURR_FIELD. OFFSET is the distance in bits between the end of PREV_FIELD and the starting position of CURR_FIELD. It is ignored if null. */ @@ -1571,7 +1573,7 @@ potential_alignment_gap (tree prev_field, tree curr_field, tree offset) if (TREE_CODE (TREE_TYPE (prev_field)) == QUAL_UNION_TYPE) return false; - /* If the distance between the end of prev_field and the begining of + /* If the distance between the end of prev_field and the beginning of curr_field is constant, then there is a gap if the value of this constant is not null. */ if (offset && host_integerp (offset, 1)) @@ -2703,7 +2705,7 @@ convert (tree type, tree expr) /* If the result type is a padded type with a self-referentially-sized field and the expression type is a record, do this as an - unchecked converstion. */ + unchecked conversion. */ else if (TREE_CODE (etype) == RECORD_TYPE && CONTAINS_PLACEHOLDER_P (DECL_SIZE (TYPE_FIELDS (type)))) return unchecked_convert (type, expr, false); @@ -3073,7 +3075,7 @@ maybe_unconstrained_array (tree exp) return exp; } -/* Return an expression that does an unchecked converstion of EXPR to TYPE. +/* Return an expression that does an unchecked conversion of EXPR to TYPE. If NOTRUNC_P is true, truncation operations should be suppressed. */ tree diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c index 787d01e284a..6ca8b99e50a 100644 --- a/gcc/ada/utils2.c +++ b/gcc/ada/utils2.c @@ -504,7 +504,7 @@ nonbinary_modular_operation (enum tree_code op_code, tree type, tree lhs, rhs = fold (build2 (MINUS_EXPR, type, modulus, rhs)), op_code = MINUS_EXPR; /* For the logical operations, we only need PRECISION bits. For - addition and subraction, we need one more and for multiplication we + addition and subtraction, we need one more and for multiplication we need twice as many. But we never want to make a size smaller than our size. */ if (op_code == PLUS_EXPR || op_code == MINUS_EXPR) diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads index 2b028bbe2a5..40a262f684d 100644 --- a/gcc/ada/vms_data.ads +++ b/gcc/ada/vms_data.ads @@ -1800,6 +1800,8 @@ package VMS_Data is "-gnatyb " & "COMMENTS " & "-gnatyc " & + "NOCRLF" & + "-gnatyd " & "END " & "-gnatye " & "VTABS " & @@ -2357,6 +2359,10 @@ package VMS_Data is "-gnatwA " & "ALL_GCC " & "-Wall " & + "BAD_FIXED_VALUES " & + "-gnatwb " & + "NO_BAD_FIXED_VALUES " & + "-gnatwB " & "CONDITIONALS " & "-gnatwc " & "NOCONDITIONALS " & diff --git a/gcc/ada/xnmake.adb b/gcc/ada/xnmake.adb index fc26a0bfd67..e4802f2b2f3 100644 --- a/gcc/ada/xnmake.adb +++ b/gcc/ada/xnmake.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -53,6 +53,7 @@ with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Unbounded.Text_IO; use Ada.Strings.Unbounded.Text_IO; with Ada.Strings.Maps; use Ada.Strings.Maps; with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants; +with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Spitbol; use GNAT.Spitbol; @@ -76,7 +77,6 @@ procedure XNmake is Synonym : VString := Nul; X : VString := Nul; - Lineno : Natural; NWidth : Natural; FileS : VString := V ("nmake.ads"); @@ -86,10 +86,12 @@ procedure XNmake is Given_File : VString := Nul; -- File name given by command line argument - InS, InT : File_Type; - OutS, OutB : File_Type; + subtype Sfile is Ada.Streams.Stream_IO.File_Type; - wsp : Pattern := Span (' ' & ASCII.HT); + InS, InT : Ada.Text_IO.File_Type; + OutS, OutB : Sfile; + + wsp : Pattern := Span (' ' & ASCII.HT); Body_Only : Pattern := BreakX (' ') * X & Span (' ') & "-- body only"; Spec_Only : Pattern := BreakX (' ') * X & Span (' ') & "-- spec only"; @@ -130,6 +132,10 @@ procedure XNmake is V_Elist_Id : constant VString := V ("Elist_Id"); V_Boolean : constant VString := V ("Boolean"); + procedure Put_Line (F : Sfile; S : String); + procedure Put_Line (F : Sfile; S : VString); + -- Local version of Put_Line ensures Unix style line endings + procedure WriteS (S : String); procedure WriteB (S : String); procedure WriteBS (S : String); @@ -188,10 +194,20 @@ procedure XNmake is end if; end WriteS; + procedure Put_Line (F : Sfile; S : String) is + begin + String'Write (Stream (F), S); + Character'Write (Stream (F), ASCII.LF); + end Put_Line; + + procedure Put_Line (F : Sfile; S : VString) is + begin + Put_Line (F, To_String (S)); + end Put_Line; + -- Start of processing for XNmake begin - Lineno := 0; NWidth := 28; Anchored_Mode := True; diff --git a/gcc/ada/xtreeprs.adb b/gcc/ada/xtreeprs.adb index 2e026d10163..55bfa96f681 100644 --- a/gcc/ada/xtreeprs.adb +++ b/gcc/ada/xtreeprs.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -45,6 +45,7 @@ with Ada.Command_Line; use Ada.Command_Line; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Unbounded.Text_IO; use Ada.Strings.Unbounded.Text_IO; with Ada.Text_IO; use Ada.Text_IO; +with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO; with GNAT.Spitbol; use GNAT.Spitbol; with GNAT.Spitbol.Patterns; use GNAT.Spitbol.Patterns; @@ -75,13 +76,15 @@ procedure XTreeprs is Synonym : VString := Nul; Term : VString := Nul; - OutS : File_Type; + subtype Sfile is Ada.Streams.Stream_IO.File_Type; + + OutS : Sfile; -- Output file - InS : File_Type; + InS : Ada.Text_IO.File_Type; -- Read sinfo.ads - InT : File_Type; + InT : Ada.Text_IO.File_Type; -- Read treeprs.adt Special : TB.Table (20); @@ -137,6 +140,23 @@ procedure XTreeprs is M : Match_Result; + procedure Put_Line (F : Sfile; S : String); + procedure Put_Line (F : Sfile; S : VString); + -- Local version of Put_Line ensures Unix style line endings + + procedure Put_Line (F : Sfile; S : String) is + begin + String'Write (Stream (F), S); + Character'Write (Stream (F), ASCII.LF); + end Put_Line; + + procedure Put_Line (F : Sfile; S : VString) is + begin + Put_Line (F, To_String (S)); + end Put_Line; + +-- Start of processing for XTreeprs + begin Anchored_Mode := True; diff --git a/gcc/alias.c b/gcc/alias.c index a0f77d559a1..a36e1d57028 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2141,7 +2141,7 @@ true_dependence (rtx mem, enum machine_mode mem_mode, rtx x, /* Read-only memory is by definition never modified, and therefore can't conflict with anything. We don't expect to find read-only set on MEM, - but stupid user tricks can produce them, so don't abort. */ + but stupid user tricks can produce them, so don't die. */ if (MEM_READONLY_P (x)) return 0; @@ -2214,7 +2214,7 @@ canon_true_dependence (rtx mem, enum machine_mode mem_mode, rtx mem_addr, /* Read-only memory is by definition never modified, and therefore can't conflict with anything. We don't expect to find read-only set on MEM, - but stupid user tricks can produce them, so don't abort. */ + but stupid user tricks can produce them, so don't die. */ if (MEM_READONLY_P (x)) return 0; diff --git a/gcc/attribs.c b/gcc/attribs.c index fd11a96700f..f04dfb97f60 100644 --- a/gcc/attribs.c +++ b/gcc/attribs.c @@ -1,6 +1,6 @@ /* Functions dealing with attribute handling, used by most front ends. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -172,7 +172,7 @@ decl_attributes (tree *node, tree attributes, int flags) if (spec == NULL) { - warning ("%qs attribute directive ignored", + warning (0, "%qs attribute directive ignored", IDENTIFIER_POINTER (name)); continue; } @@ -197,7 +197,7 @@ decl_attributes (tree *node, tree attributes, int flags) } else { - warning ("%qs attribute does not apply to types", + warning (0, "%qs attribute does not apply to types", IDENTIFIER_POINTER (name)); continue; } @@ -243,7 +243,7 @@ decl_attributes (tree *node, tree attributes, int flags) if (TREE_CODE (*anode) != FUNCTION_TYPE && TREE_CODE (*anode) != METHOD_TYPE) { - warning ("%qs attribute only applies to function types", + warning (0, "%qs attribute only applies to function types", IDENTIFIER_POINTER (name)); continue; } diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 45c511a1975..4deeb899755 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -30,6 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "predict.h" #include "vec.h" #include "errors.h" +#include "function.h" /* Head of register set linked list. */ typedef bitmap_head regset_head; @@ -144,7 +145,8 @@ struct edge_def GTY(()) }; typedef struct edge_def *edge; -DEF_VEC_GC_P(edge); +DEF_VEC_P(edge); +DEF_VEC_ALLOC_P(edge,gc); #define EDGE_FALLTHRU 1 /* 'Straight line' flow */ #define EDGE_ABNORMAL 2 /* Strange flow, like computed @@ -219,8 +221,8 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb") tree stmt_list; /* The edges into and out of the block. */ - VEC(edge) *preds; - VEC(edge) *succs; + VEC(edge,gc) *preds; + VEC(edge,gc) *succs; /* The registers that are live on entry to this block. */ bitmap GTY ((skip (""))) global_live_at_start; @@ -242,7 +244,7 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb") struct basic_block_def *next_bb; /* The data used by basic block copying and reordering functions. */ - struct reorder_block_def * GTY ((skip (""))) rbi; + struct reorder_block_def * rbi; /* Annotations used at the tree level. */ struct bb_ann_d *tree_annotations; @@ -261,27 +263,38 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb") /* Various flags. See BB_* below. */ int flags; + + /* Which section block belongs in, when partitioning basic blocks. */ + int partition; }; typedef struct basic_block_def *basic_block; /* Structure to hold information about the blocks during reordering and - copying. */ + copying. Needs to be put on a diet. */ -typedef struct reorder_block_def +struct reorder_block_def GTY(()) { rtx header; rtx footer; + basic_block next; - basic_block original; - /* Used by loop copying. */ - basic_block copy; + + /* These pointers may be unreliable as the first is only used for + debugging (and should probably be removed, and the second is only + used by copying. The basic blocks pointed to may be removed and + that leaves these pointers pointing to garbage. */ + basic_block GTY ((skip (""))) original; + basic_block GTY ((skip (""))) copy; + int duplicated; int copy_number; - /* These fields are used by bb-reorder pass. */ + /* This field is used by the bb-reorder and tracer passes. */ int visited; -} *reorder_block_def_p; +}; + +typedef struct reorder_block_def *reorder_block_def; #define BB_FREQ_MAX 10000 @@ -338,45 +351,81 @@ enum #define BB_COPY_PARTITION(dstbb, srcbb) \ BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb)) -/* Number of basic blocks in the current function. */ +/* A structure to group all the per-function control flow graph data. + The x_* prefixing is necessary because otherwise references to the + fields of this struct are interpreted as the defines for backward + source compatibility following the definition of this struct. */ +struct control_flow_graph GTY(()) +{ + /* Block pointers for the exit and entry of a function. + These are always the head and tail of the basic block list. */ + basic_block x_entry_block_ptr; + basic_block x_exit_block_ptr; -extern int n_basic_blocks; + /* Index by basic block number, get basic block struct info. */ + varray_type x_basic_block_info; -/* First free basic block number. */ + /* Number of basic blocks in this flow graph. */ + int x_n_basic_blocks; -extern int last_basic_block; + /* Number of edges in this flow graph. */ + int x_n_edges; -/* Number of edges in the current function. */ + /* The first free basic block number. */ + int x_last_basic_block; -extern int n_edges; + /* Mapping of labels to their associated blocks. At present + only used for the tree CFG. */ + varray_type x_label_to_block_map; + + enum profile_status { + PROFILE_ABSENT, + PROFILE_GUESSED, + PROFILE_READ + } x_profile_status; +}; + +/* Defines for accessing the fields of the CFG structure for function FN. */ +#define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr) +#define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr) +#define basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info) +#define n_basic_blocks_for_function(FN) ((FN)->cfg->x_n_basic_blocks) +#define n_edges_for_function(FN) ((FN)->cfg->x_n_edges) +#define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block) +#define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map) + +#define BASIC_BLOCK_FOR_FUNCTION(FN,N) \ + (VARRAY_BB (basic_block_info_for_function(FN), (N))) + +/* Defines for textual backward source compatibility. */ +#define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr) +#define EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr) +#define basic_block_info (cfun->cfg->x_basic_block_info) +#define n_basic_blocks (cfun->cfg->x_n_basic_blocks) +#define n_edges (cfun->cfg->x_n_edges) +#define last_basic_block (cfun->cfg->x_last_basic_block) +#define label_to_block_map (cfun->cfg->x_label_to_block_map) +#define profile_status (cfun->cfg->x_profile_status) + +#define BASIC_BLOCK(N) (VARRAY_BB (basic_block_info, (N))) /* TRUE if we should re-run loop discovery after threading jumps, FALSE otherwise. */ extern bool rediscover_loops_after_threading; -/* Signalize the status of profile information in the CFG. */ -extern enum profile_status -{ - PROFILE_ABSENT, - PROFILE_GUESSED, - PROFILE_READ -} profile_status; - -/* Index by basic block number, get basic block struct info. */ - -extern GTY(()) varray_type basic_block_info; - -#define BASIC_BLOCK(N) (VARRAY_BB (basic_block_info, (N))) - /* For iterating over basic blocks. */ #define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \ for (BB = FROM; BB != TO; BB = BB->DIR) -#define FOR_EACH_BB(BB) \ - FOR_BB_BETWEEN (BB, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR, next_bb) +#define FOR_EACH_BB_FN(BB, FN) \ + FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb) + +#define FOR_EACH_BB(BB) FOR_EACH_BB_FN (BB, cfun) -#define FOR_EACH_BB_REVERSE(BB) \ - FOR_BB_BETWEEN (BB, EXIT_BLOCK_PTR->prev_bb, ENTRY_BLOCK_PTR, prev_bb) +#define FOR_EACH_BB_REVERSE_FN(BB, FN) \ + FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb) + +#define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN(BB, cfun) /* For iterating over insns in basic block. */ #define FOR_BB_INSNS(BB, INSN) \ @@ -395,6 +444,9 @@ extern GTY(()) varray_type basic_block_info; #define FOR_ALL_BB(BB) \ for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb) +#define FOR_ALL_BB_FN(BB, FN) \ + for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb) + /* Special labels found during CFG build. */ extern GTY(()) rtx label_value_list; @@ -425,10 +477,6 @@ extern bitmap_obstack reg_obstack; /* Special block number not valid for any block. */ #define INVALID_BLOCK (-3) -/* Similarly, block pointers for the edge list. */ -extern GTY(()) basic_block ENTRY_BLOCK_PTR; -extern GTY(()) basic_block EXIT_BLOCK_PTR; - #define BLOCK_NUM(INSN) (BLOCK_FOR_INSN (INSN)->index + 0) #define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB) @@ -468,6 +516,9 @@ extern void dump_edge_info (FILE *, edge, int); extern void brief_dump_cfg (FILE *); extern void clear_edges (void); extern rtx first_insn_after_basic_block_note (basic_block); +extern void scale_bbs_frequencies_int (basic_block *, int, int, int); +extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type, + gcov_type); /* Structure to group all of the information to process IF-THEN and IF-THEN-ELSE blocks for the conditional execution support. This @@ -504,6 +555,9 @@ struct edge_list edge *index_to_edge; }; +/* The base value for branch probability notes and edge probabilities. */ +#define REG_BR_PROB_BASE 10000 + /* This is the value which indicates no edge is present. */ #define EDGE_INDEX_NO_EDGE -1 @@ -603,10 +657,10 @@ single_pred (basic_block bb) typedef struct { unsigned index; - VEC(edge) **container; + VEC(edge,gc) **container; } edge_iterator; -static inline VEC(edge) * +static inline VEC(edge,gc) * ei_container (edge_iterator i) { gcc_assert (i.container); @@ -618,7 +672,7 @@ ei_container (edge_iterator i) /* Return an iterator pointing to the start of an edge vector. */ static inline edge_iterator -ei_start_1 (VEC(edge) **ev) +ei_start_1 (VEC(edge,gc) **ev) { edge_iterator i; @@ -631,7 +685,7 @@ ei_start_1 (VEC(edge) **ev) /* Return an iterator pointing to the last element of an edge vector. */ static inline edge_iterator -ei_last_1 (VEC(edge) **ev) +ei_last_1 (VEC(edge,gc) **ev) { edge_iterator i; @@ -688,6 +742,25 @@ ei_safe_edge (edge_iterator i) return !ei_end_p (i) ? ei_edge (i) : NULL; } +/* Return 1 if we should continue to iterate. Return 0 otherwise. + *Edge P is set to the next edge if we are to continue to iterate + and NULL otherwise. */ + +static inline bool +ei_cond (edge_iterator ei, edge *p) +{ + if (!ei_end_p (ei)) + { + *p = ei_edge (ei); + return 1; + } + else + { + *p = NULL; + return 0; + } +} + /* This macro serves as a convenient way to iterate each edge in a vector of predecessor or successor edges. It must not be used when an element might be removed during the traversal, otherwise @@ -703,9 +776,9 @@ ei_safe_edge (edge_iterator i) } */ -#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \ - for ((EDGE) = NULL, (ITER) = ei_start ((EDGE_VEC)); \ - ((EDGE) = ei_safe_edge ((ITER))); \ +#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \ + for ((ITER) = ei_start ((EDGE_VEC)); \ + ei_cond ((ITER), &(EDGE)); \ ei_next (&(ITER))) struct edge_list * create_edge_list (void); @@ -733,10 +806,11 @@ enum update_life_extent #define PROP_ALLOW_CFG_CHANGES 32 /* Allow the CFG to be changed by dead code removal. */ #define PROP_AUTOINC 64 /* Create autoinc mem references. */ -#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */ -#define PROP_SCAN_DEAD_STORES 256 /* Scan for dead code. */ -#define PROP_ASM_SCAN 512 /* Internal flag used within flow.c +#define PROP_SCAN_DEAD_STORES 128 /* Scan for dead code. */ +#define PROP_ASM_SCAN 256 /* Internal flag used within flow.c to flag analysis of asms. */ +#define PROP_DEAD_INSN 1024 /* Internal flag used within flow.c + to flag analysis of dead insn. */ #define PROP_FINAL (PROP_DEATH_NOTES | PROP_LOG_LINKS \ | PROP_REG_INFO | PROP_KILL_DEAD_CODE \ | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \ @@ -814,7 +888,7 @@ extern int delete_noop_moves (void); extern basic_block force_nonfallthru (edge); extern rtx block_label (basic_block); extern bool forwarder_block_p (basic_block); -extern bool purge_all_dead_edges (int); +extern bool purge_all_dead_edges (void); extern bool purge_dead_edges (basic_block); extern void find_many_sub_basic_blocks (sbitmap); extern void rtl_make_eh_edge (sbitmap, basic_block, rtx); @@ -867,9 +941,7 @@ extern void duplicate_computed_gotos (void); extern void partition_hot_cold_basic_blocks (void); /* In cfg.c */ -extern void alloc_rbi_pool (void); extern void initialize_bb_rbi (basic_block bb); -extern void free_rbi_pool (void); /* In dominance.c */ @@ -893,6 +965,8 @@ extern void calculate_dominance_info (enum cdi_direction); extern void free_dominance_info (enum cdi_direction); extern basic_block nearest_common_dominator (enum cdi_direction, basic_block, basic_block); +extern basic_block nearest_common_dominator_for_set (enum cdi_direction, + bitmap); extern void set_immediate_dominator (enum cdi_direction, basic_block, basic_block); extern basic_block get_immediate_dominator (enum cdi_direction, basic_block); diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index a94c9e4e468..547296714ce 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -81,6 +81,7 @@ #include "tm_p.h" #include "obstack.h" #include "expr.h" +#include "errors.h" #include "params.h" /* The number of rounds. In most cases there will only be 4 rounds, but @@ -119,6 +120,9 @@ typedef struct bbro_basic_block_data_def /* Which trace is the bb end of (-1 means it is not an end of a trace). */ int end_of_trace; + /* Which trace is the bb in? */ + int in_trace; + /* Which heap is BB in (if any)? */ fibheap_t heap; @@ -169,11 +173,9 @@ static void connect_traces (int, struct trace *); static bool copy_bb_p (basic_block, int); static int get_uncond_jump_length (void); static bool push_to_next_round_p (basic_block, int, int, int, gcov_type); -static void add_unlikely_executed_notes (void); static void find_rarely_executed_basic_blocks_and_crossing_edges (edge *, int *, int *); -static void mark_bb_for_unlikely_executed_section (basic_block); static void add_labels_and_missing_jumps (edge *, int); static void add_reg_crossing_jump_notes (void); static void fix_up_fall_thru_edges (void); @@ -194,26 +196,16 @@ push_to_next_round_p (basic_block bb, int round, int number_of_rounds, int exec_th, gcov_type count_th) { bool there_exists_another_round; - bool cold_block; bool block_not_hot_enough; - bool next_round_is_last; there_exists_another_round = round < number_of_rounds - 1; - next_round_is_last = round + 1 == number_of_rounds - 1; - - cold_block = (flag_reorder_blocks_and_partition - && BB_PARTITION (bb) == BB_COLD_PARTITION); block_not_hot_enough = (bb->frequency < exec_th || bb->count < count_th || probably_never_executed_bb_p (bb)); - if (flag_reorder_blocks_and_partition - && next_round_is_last - && BB_PARTITION (bb) != BB_COLD_PARTITION) - return false; - else if (there_exists_another_round - && (cold_block || block_not_hot_enough)) + if (there_exists_another_round + && block_not_hot_enough) return true; else return false; @@ -237,8 +229,6 @@ find_traces (int *n_traces, struct trace *traces) cold blocks (and ONLY the cold blocks). */ number_of_rounds = N_ROUNDS - 1; - if (flag_reorder_blocks_and_partition) - number_of_rounds = N_ROUNDS; /* Insert entry points of function into heap. */ heap = fibheap_new (); @@ -434,11 +424,6 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, struct trace *traces, int *n_traces, int round, fibheap_t *heap, int number_of_rounds) { - /* The following variable refers to the last round in which non-"cold" - blocks may be collected into a trace. */ - - int last_round = N_ROUNDS - 1; - /* Heap for discarded basic blocks which are possible starting points for the next round. */ fibheap_t new_heap = fibheap_new (); @@ -481,6 +466,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, trace->first = bb; trace->round = round; trace->length = 0; + bbd[bb->index].in_trace = *n_traces; (*n_traces)++; do @@ -514,8 +500,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, && e->dest->rbi->visited != *n_traces) continue; - if (BB_PARTITION (e->dest) == BB_COLD_PARTITION - && round < last_round) + if (BB_PARTITION (e->dest) != BB_PARTITION (bb)) continue; prob = e->probability; @@ -646,6 +631,8 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, best_edge->dest->index, bb->index); } bb->rbi->next = best_edge->dest; + bbd[best_edge->dest->index].in_trace = + (*n_traces) - 1; bb = rotate_loop (best_edge, trace, *n_traces); } } @@ -658,6 +645,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, { bb = copy_bb (best_edge->dest, best_edge, bb, *n_traces); + trace->length++; } } } @@ -695,7 +683,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, && !e->dest->rbi->visited && single_pred_p (e->dest) && !(e->flags & EDGE_CROSSING) - && single_succ_p (e->dest) == 1 + && single_succ_p (e->dest) && (single_succ_edge (e->dest)->flags & EDGE_CAN_FALLTHRU) && !(single_succ_edge (e->dest)->flags & EDGE_COMPLEX) @@ -710,6 +698,7 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th, } bb->rbi->next = best_edge->dest; + bbd[best_edge->dest->index].in_trace = (*n_traces) - 1; bb = best_edge->dest; } } @@ -788,6 +777,7 @@ copy_bb (basic_block old_bb, edge e, basic_block bb, int trace) for (i = array_size; i < new_size; i++) { bbd[i].start_of_trace = -1; + bbd[i].in_trace = -1; bbd[i].end_of_trace = -1; bbd[i].heap = NULL; bbd[i].node = NULL; @@ -802,6 +792,8 @@ copy_bb (basic_block old_bb, edge e, basic_block bb, int trace) } } + bbd[new_bb->index].in_trace = trace; + return new_bb; } @@ -899,11 +891,11 @@ static void connect_traces (int n_traces, struct trace *traces) { int i; - int unconnected_hot_trace_count = 0; - bool cold_connected = true; bool *connected; - bool *cold_traces; + bool two_passes; int last_trace; + int current_pass; + int current_partition; int freq_threshold; gcov_type count_threshold; @@ -915,66 +907,43 @@ connect_traces (int n_traces, struct trace *traces) connected = xcalloc (n_traces, sizeof (bool)); last_trace = -1; - - /* If we are partitioning hot/cold basic blocks, mark the cold - traces as already connected, to remove them from consideration - for connection to the hot traces. After the hot traces have all - been connected (determined by "unconnected_hot_trace_count"), we - will go back and connect the cold traces. */ - - cold_traces = xcalloc (n_traces, sizeof (bool)); + current_pass = 1; + current_partition = BB_PARTITION (traces[0].first); + two_passes = false; if (flag_reorder_blocks_and_partition) - for (i = 0; i < n_traces; i++) - { - if (BB_PARTITION (traces[i].first) == BB_COLD_PARTITION) - { - connected[i] = true; - cold_traces[i] = true; - cold_connected = false; - } - else - unconnected_hot_trace_count++; - } - - for (i = 0; i < n_traces || !cold_connected ; i++) + for (i = 0; i < n_traces && !two_passes; i++) + if (BB_PARTITION (traces[0].first) + != BB_PARTITION (traces[i].first)) + two_passes = true; + + for (i = 0; i < n_traces || (two_passes && current_pass == 1) ; i++) { int t = i; int t2; edge e, best; int best_len; - /* If we are partitioning hot/cold basic blocks, check to see - if all the hot traces have been connected. If so, go back - and mark the cold traces as unconnected so we can connect - them up too. Re-set "i" to the first (unconnected) cold - trace. Use flag "cold_connected" to make sure we don't do - this step more than once. */ - - if (flag_reorder_blocks_and_partition - && (i >= n_traces || unconnected_hot_trace_count <= 0) - && !cold_connected) + if (i >= n_traces) { - int j; - int first_cold_trace = -1; - - for (j = 0; j < n_traces; j++) - if (cold_traces[j]) - { - connected[j] = false; - if (first_cold_trace == -1) - first_cold_trace = j; - } - i = t = first_cold_trace; - cold_connected = true; + gcc_assert (two_passes && current_pass == 1); + i = 0; + t = i; + current_pass = 2; + if (current_partition == BB_HOT_PARTITION) + current_partition = BB_COLD_PARTITION; + else + current_partition = BB_HOT_PARTITION; } - + if (connected[t]) continue; + if (two_passes + && BB_PARTITION (traces[t].first) != current_partition) + continue; + connected[t] = true; - if (unconnected_hot_trace_count > 0) - unconnected_hot_trace_count--; /* Find the predecessor traces. */ for (t2 = t; t2 > 0;) @@ -991,6 +960,7 @@ connect_traces (int n_traces, struct trace *traces) && !(e->flags & EDGE_COMPLEX) && bbd[si].end_of_trace >= 0 && !connected[bbd[si].end_of_trace] + && (BB_PARTITION (e->src) == current_partition) && (!best || e->probability > best->probability || (e->probability == best->probability @@ -1006,9 +976,6 @@ connect_traces (int n_traces, struct trace *traces) t2 = bbd[best->src->index].end_of_trace; connected[t2] = true; - if (unconnected_hot_trace_count > 0) - unconnected_hot_trace_count--; - if (dump_file) { fprintf (dump_file, "Connection: %d %d\n", @@ -1039,6 +1006,7 @@ connect_traces (int n_traces, struct trace *traces) && !(e->flags & EDGE_COMPLEX) && bbd[di].start_of_trace >= 0 && !connected[bbd[di].start_of_trace] + && (BB_PARTITION (e->dest) == current_partition) && (!best || e->probability > best->probability || (e->probability == best->probability @@ -1059,8 +1027,6 @@ connect_traces (int n_traces, struct trace *traces) t = bbd[best->dest->index].start_of_trace; traces[last_trace].last->rbi->next = traces[t].first; connected[t] = true; - if (unconnected_hot_trace_count > 0) - unconnected_hot_trace_count--; last_trace = t; } else @@ -1101,6 +1067,7 @@ connect_traces (int n_traces, struct trace *traces) && !(e2->flags & EDGE_COMPLEX) && bbd[di].start_of_trace >= 0 && !connected[bbd[di].start_of_trace] + && (BB_PARTITION (e2->dest) == current_partition) && (EDGE_FREQUENCY (e2) >= freq_threshold) && (e2->count >= count_threshold) && (!best2 @@ -1153,8 +1120,6 @@ connect_traces (int n_traces, struct trace *traces) t = bbd[next_bb->index].start_of_trace; traces[last_trace].last->rbi->next = traces[t].first; connected[t] = true; - if (unconnected_hot_trace_count > 0) - unconnected_hot_trace_count--; last_trace = t; } else @@ -1178,7 +1143,6 @@ connect_traces (int n_traces, struct trace *traces) } FREE (connected); - FREE (cold_traces); } /* Return true when BB can and should be copied. CODE_MAY_GROW is true @@ -1242,18 +1206,6 @@ get_uncond_jump_length (void) return length; } -static void -add_unlikely_executed_notes (void) -{ - basic_block bb; - - /* Add the UNLIKELY_EXECUTED_NOTES to each cold basic block. */ - - FOR_EACH_BB (bb) - if (BB_PARTITION (bb) == BB_COLD_PARTITION) - mark_bb_for_unlikely_executed_section (bb); -} - /* Find the basic blocks that are rarely executed and need to be moved to a separate section of the .o file (to cut down on paging and improve cache locality). */ @@ -1282,79 +1234,31 @@ find_rarely_executed_basic_blocks_and_crossing_edges (edge *crossing_edges, } } - /* Since all "hot" basic blocks will eventually be scheduled before all - cold basic blocks, make *sure* the real function entry block is in - the hot partition (if there is one). */ - - if (has_hot_blocks) - FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs) - if (e->dest->index >= 0) - { - BB_SET_PARTITION (e->dest, BB_HOT_PARTITION); - break; - } - /* Mark every edge that crosses between sections. */ i = 0; - if (targetm.have_named_sections) + FOR_EACH_BB (bb) + FOR_EACH_EDGE (e, ei, bb->succs) { - FOR_EACH_BB (bb) - FOR_EACH_EDGE (e, ei, bb->succs) - { - if (e->src != ENTRY_BLOCK_PTR - && e->dest != EXIT_BLOCK_PTR - && BB_PARTITION (e->src) != BB_PARTITION (e->dest)) - { - e->flags |= EDGE_CROSSING; - if (i == *max_idx) - { - *max_idx *= 2; - crossing_edges = xrealloc (crossing_edges, - (*max_idx) * sizeof (edge)); - } - crossing_edges[i++] = e; - } - else - e->flags &= ~EDGE_CROSSING; - } + if (e->src != ENTRY_BLOCK_PTR + && e->dest != EXIT_BLOCK_PTR + && BB_PARTITION (e->src) != BB_PARTITION (e->dest)) + { + e->flags |= EDGE_CROSSING; + if (i == *max_idx) + { + *max_idx *= 2; + crossing_edges = xrealloc (crossing_edges, + (*max_idx) * sizeof (edge)); + } + crossing_edges[i++] = e; + } + else + e->flags &= ~EDGE_CROSSING; } *n_crossing_edges = i; } -/* Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to top of basic block. This note - is later used to mark the basic block to be put in the - unlikely-to-be-executed section of the .o file. */ - -static void -mark_bb_for_unlikely_executed_section (basic_block bb) -{ - rtx cur_insn; - rtx insert_insn = NULL; - rtx new_note; - - /* Insert new NOTE immediately after BASIC_BLOCK note. */ - - for (cur_insn = BB_HEAD (bb); cur_insn != NEXT_INSN (BB_END (bb)); - cur_insn = NEXT_INSN (cur_insn)) - if (GET_CODE (cur_insn) == NOTE - && NOTE_LINE_NUMBER (cur_insn) == NOTE_INSN_BASIC_BLOCK) - { - insert_insn = cur_insn; - break; - } - - /* If basic block does not contain a NOTE_INSN_BASIC_BLOCK, there is - a major problem. */ - gcc_assert (insert_insn); - - /* Insert note and assign basic block number to it. */ - - new_note = emit_note_after (NOTE_INSN_UNLIKELY_EXECUTED_CODE, - insert_insn); - NOTE_BASIC_BLOCK (new_note) = bb; -} - /* If any destination of a crossing edge does not have a label, add label; Convert any fall-through crossing edges (for blocks that do not contain a jump) to unconditional jumps. */ @@ -1782,6 +1686,10 @@ fix_crossing_unconditional_branches (void) FOR_EACH_BB (cur_bb) { last_insn = BB_END (cur_bb); + + if (EDGE_COUNT (cur_bb->succs) < 1) + continue; + succ = EDGE_SUCC (cur_bb, 0); /* Check to see if bb ends in a crossing (unconditional) jump. At @@ -1864,19 +1772,19 @@ add_reg_crossing_jump_notes (void) (e->src))); } -/* Basic blocks containing NOTE_INSN_UNLIKELY_EXECUTED_CODE will be - put in a separate section of the .o file, to reduce paging and - improve cache performance (hopefully). This can result in bits of - code from the same function being widely separated in the .o file. - However this is not obvious to the current bb structure. Therefore - we must take care to ensure that: 1). There are no fall_thru edges - that cross between sections; 2). For those architectures which - have "short" conditional branches, all conditional branches that - attempt to cross between sections are converted to unconditional - branches; and, 3). For those architectures which have "short" - unconditional branches, all unconditional branches that attempt - to cross between sections are converted to indirect jumps. - +/* Hot and cold basic blocks are partitioned and put in separate + sections of the .o file, to reduce paging and improve cache + performance (hopefully). This can result in bits of code from the + same function being widely separated in the .o file. However this + is not obvious to the current bb structure. Therefore we must take + care to ensure that: 1). There are no fall_thru edges that cross + between sections; 2). For those architectures which have "short" + conditional branches, all conditional branches that attempt to + cross between sections are converted to unconditional branches; + and, 3). For those architectures which have "short" unconditional + branches, all unconditional branches that attempt to cross between + sections are converted to indirect jumps. + The code for fixing up fall_thru edges that cross between hot and cold basic blocks does so by creating new basic blocks containing unconditional branches to the appropriate label in the "other" @@ -1910,36 +1818,63 @@ fix_edges_for_rarely_executed_code (edge *crossing_edges, fix_up_fall_thru_edges (); - /* Only do the parts necessary for writing separate sections if - the target architecture has the ability to write separate sections - (i.e. it has named sections). Otherwise, the hot/cold partitioning - information will be used when reordering blocks to try to put all - the hot blocks together, then all the cold blocks, but no actual - section partitioning will be done. */ - - if (targetm.have_named_sections) + /* If the architecture does not have conditional branches that can + span all of memory, convert crossing conditional branches into + crossing unconditional branches. */ + + if (!HAS_LONG_COND_BRANCH) + fix_crossing_conditional_branches (); + + /* If the architecture does not have unconditional branches that + can span all of memory, convert crossing unconditional branches + into indirect jumps. Since adding an indirect jump also adds + a new register usage, update the register usage information as + well. */ + + if (!HAS_LONG_UNCOND_BRANCH) { - /* If the architecture does not have conditional branches that can - span all of memory, convert crossing conditional branches into - crossing unconditional branches. */ + fix_crossing_unconditional_branches (); + reg_scan (get_insns(), max_reg_num ()); + } - if (!HAS_LONG_COND_BRANCH) - fix_crossing_conditional_branches (); + add_reg_crossing_jump_notes (); +} + +/* Verify, in the basic block chain, that there is at most one switch + between hot/cold partitions. This is modelled on + rtl_verify_flow_info_1, but it cannot go inside that function + because this condition will not be true until after + reorder_basic_blocks is called. */ + +static void +verify_hot_cold_block_grouping (void) +{ + basic_block bb; + int err = 0; + bool switched_sections = false; + int current_partition = 0; - /* If the architecture does not have unconditional branches that - can span all of memory, convert crossing unconditional branches - into indirect jumps. Since adding an indirect jump also adds - a new register usage, update the register usage information as - well. */ - - if (!HAS_LONG_UNCOND_BRANCH) + FOR_EACH_BB (bb) + { + if (!current_partition) + current_partition = BB_PARTITION (bb); + if (BB_PARTITION (bb) != current_partition) { - fix_crossing_unconditional_branches (); - reg_scan (get_insns(), max_reg_num ()); + if (switched_sections) + { + error ("Multiple hot/cold transitions found (bb %i)", + bb->index); + err = 1; + } + else + { + switched_sections = true; + current_partition = BB_PARTITION (bb); + } } - - add_reg_crossing_jump_notes (); } + + gcc_assert(!err); } /* Reorder basic blocks. The main entry point to this file. FLAGS is @@ -1976,6 +1911,7 @@ reorder_basic_blocks (unsigned int flags) for (i = 0; i < array_size; i++) { bbd[i].start_of_trace = -1; + bbd[i].in_trace = -1; bbd[i].end_of_trace = -1; bbd[i].heap = NULL; bbd[i].node = NULL; @@ -1991,15 +1927,42 @@ reorder_basic_blocks (unsigned int flags) if (dump_file) dump_flow_info (dump_file); - if (flag_reorder_blocks_and_partition - && targetm.have_named_sections) - add_unlikely_executed_notes (); - cfg_layout_finalize (); + if (flag_reorder_blocks_and_partition) + verify_hot_cold_block_grouping (); timevar_pop (TV_REORDER_BLOCKS); } +/* Determine which partition the first basic block in the function + belongs to, then find the first basic block in the current function + that belongs to a different section, and insert a + NOTE_INSN_SWITCH_TEXT_SECTIONS note immediately before it in the + instruction stream. When writing out the assembly code, + encountering this note will make the compiler switch between the + hot and cold text sections. */ + +void +insert_section_boundary_note (void) +{ + basic_block bb; + rtx new_note; + int first_partition = 0; + + if (flag_reorder_blocks_and_partition) + FOR_EACH_BB (bb) + { + if (!first_partition) + first_partition = BB_PARTITION (bb); + if (BB_PARTITION (bb) != first_partition) + { + new_note = emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS, + BB_HEAD (bb)); + break; + } + } +} + /* Duplicate the blocks containing computed gotos. This basically unfactors computed gotos that were factored early on in the compilation process to speed up edge based data flow. We used to not unfactoring them again, @@ -2032,41 +1995,49 @@ duplicate_computed_gotos (void) max_size = uncond_jump_length * PARAM_VALUE (PARAM_MAX_GOTO_DUPLICATION_INSNS); candidates = BITMAP_ALLOC (NULL); - /* Build the reorder chain for the original order of blocks. - Look for a computed jump while we are at it. */ + /* Look for blocks that end in a computed jump, and see if such blocks + are suitable for unfactoring. If a block is a candidate for unfactoring, + mark it in the candidates. */ FOR_EACH_BB (bb) { + rtx insn; + edge e; + edge_iterator ei; + int size, all_flags; + + /* Build the reorder chain for the original order of blocks. */ if (bb->next_bb != EXIT_BLOCK_PTR) bb->rbi->next = bb->next_bb; - /* If the block ends in a computed jump and it is small enough, - make it a candidate for duplication. */ - if (computed_jump_p (BB_END (bb))) - { - rtx insn; - int size = 0; + /* Obviously the block has to end in a computed jump. */ + if (!computed_jump_p (BB_END (bb))) + continue; - FOR_BB_INSNS (bb, insn) - { - if (INSN_P (insn)) - { - /* If the insn isn't copyable, don't duplicate - the block. */ - if (targetm.cannot_copy_insn_p - && targetm.cannot_copy_insn_p (insn)) - { - size = max_size + 1; - break; - } - size += get_attr_length (insn); - } - if (size > max_size) - break; - } + /* Only consider blocks that can be duplicated. */ + if (find_reg_note (BB_END (bb), REG_CROSSING_JUMP, NULL_RTX) + || !can_duplicate_block_p (bb)) + continue; - if (size <= max_size) - bitmap_set_bit (candidates, bb->index); - } + /* Make sure that the block is small enough. */ + size = 0; + FOR_BB_INSNS (bb, insn) + if (INSN_P (insn)) + { + size += get_attr_length (insn); + if (size > max_size) + break; + } + if (size > max_size) + continue; + + /* Final check: there must not be any incoming abnormal edges. */ + all_flags = 0; + FOR_EACH_EDGE (e, ei, bb->preds) + all_flags |= e->flags; + if (all_flags & EDGE_COMPLEX) + continue; + + bitmap_set_bit (candidates, bb->index); } /* Nothing to do if there is no computed jump here. */ @@ -2119,15 +2090,14 @@ done: function above). This optimization checks the feedback information to determine - which basic blocks are hot/cold and causes reorder_basic_blocks to - add NOTE_INSN_UNLIKELY_EXECUTED_CODE to non-hot basic blocks. The - presence or absence of this note is later used for writing out - sections in the .o file. Because hot and cold sections can be - arbitrarily large (within the bounds of memory), far beyond the - size of a single function, it is necessary to fix up all edges that - cross section boundaries, to make sure the instructions used can - actually span the required distance. The fixes are described - below. + which basic blocks are hot/cold, updates flags on the basic blocks + to indicate which section they belong in. This information is + later used for writing out sections in the .o file. Because hot + and cold sections can be arbitrarily large (within the bounds of + memory), far beyond the size of a single function, it is necessary + to fix up all edges that cross section boundaries, to make sure the + instructions used can actually span the required distance. The + fixes are described below. Fall-through edges must be changed into jumps; it is not safe or legal to fall through across a section boundary. Whenever a diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 2cf4c8cf5d6..dd56bba0877 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -51,14 +51,15 @@ bitmap_elem_to_freelist (bitmap head, bitmap_element *elt) { bitmap_obstack *bit_obstack = head->obstack; + elt->next = NULL; if (bit_obstack) { - elt->next = bit_obstack->elements; + elt->prev = bit_obstack->elements; bit_obstack->elements = elt; } else { - elt->next = bitmap_ggc_free; + elt->prev = bitmap_ggc_free; bitmap_ggc_free = elt; } } @@ -105,7 +106,16 @@ bitmap_element_allocate (bitmap head) element = bit_obstack->elements; if (element) - bit_obstack->elements = element->next; + /* Use up the inner list first before looking at the next + element of the outer list. */ + if (element->next) + { + bit_obstack->elements = element->next; + bit_obstack->elements->prev = element->prev; + } + else + /* Inner list was just a singleton. */ + bit_obstack->elements = element->prev; else element = XOBNEW (&bit_obstack->obstack, bitmap_element); } @@ -113,7 +123,16 @@ bitmap_element_allocate (bitmap head) { element = bitmap_ggc_free; if (element) - bitmap_ggc_free = element->next; + /* Use up the inner list first before looking at the next + element of the outer list. */ + if (element->next) + { + bitmap_ggc_free = element->next; + bitmap_ggc_free->prev = element->prev; + } + else + /* Inner list was just a singleton. */ + bitmap_ggc_free = element->prev; else element = GGC_NEW (bitmap_element); } @@ -128,13 +147,38 @@ bitmap_element_allocate (bitmap head) void bitmap_elt_clear_from (bitmap head, bitmap_element *elt) { - bitmap_element *next; + bitmap_element *prev; + bitmap_obstack *bit_obstack = head->obstack; + + if (!elt) return; - while (elt) + prev = elt->prev; + if (prev) { - next = elt->next; - bitmap_element_free (head, elt); - elt = next; + prev->next = NULL; + if (head->current->indx > prev->indx) + { + head->current = prev; + head->indx = prev->indx; + } + } + else + { + head->first = NULL; + head->current = NULL; + head->indx = 0; + } + + /* Put the entire list onto the free list in one operation. */ + if (bit_obstack) + { + elt->prev = bit_obstack->elements; + bit_obstack->elements = elt; + } + else + { + elt->prev = bitmap_ggc_free; + bitmap_ggc_free = elt; } } @@ -143,15 +187,8 @@ bitmap_elt_clear_from (bitmap head, bitmap_element *elt) inline void bitmap_clear (bitmap head) { - bitmap_element *element, *next; - - for (element = head->first; element != 0; element = next) - { - next = element->next; - bitmap_elem_to_freelist (head, element); - } - - head->first = head->current = 0; + if (head->first) + bitmap_elt_clear_from (head, head->first); } /* Initialize a bitmap obstack. If BIT_OBSTACK is NULL, initialize diff --git a/gcc/bitmap.h b/gcc/bitmap.h index 2915623fa41..3c3b3c13f7a 100644 --- a/gcc/bitmap.h +++ b/gcc/bitmap.h @@ -49,8 +49,15 @@ typedef struct bitmap_obstack GTY (()) /* Bitmap set element. We use a linked list to hold only the bits that are set. This allows for use to grow the bitset dynamically without - having to realloc and copy a giant bit array. The `prev' field is - undefined for an element on the free list. */ + having to realloc and copy a giant bit array. + + The free list is implemented as a list of lists. There is one + outer list connected together by prev fields. Each element of that + outer is an inner list (that may consist only of the outer list + element) that are connected by the next fields. The prev pointer + is undefined for interior elements. This allows + bitmap_elt_clear_from to be implemented in unit time rather than + linear in the number of elements to be freed. */ typedef struct bitmap_element_def GTY(()) { @@ -129,7 +136,7 @@ extern void debug_bitmap_file (FILE *, bitmap); /* Print a bitmap. */ extern void bitmap_print (FILE *, bitmap, const char *, const char *); -/* Initialize and releas a bitmap obstack. */ +/* Initialize and release a bitmap obstack. */ extern void bitmap_obstack_initialize (bitmap_obstack *); extern void bitmap_obstack_release (bitmap_obstack *); diff --git a/gcc/bt-load.c b/gcc/bt-load.c index 0fc47a0c88b..47ac16a82fb 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -506,6 +506,22 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, SET_BIT (btr_defset[regno - first_btr], insn_uid); note_other_use_this_block (regno, info.users_this_bb); } + /* Check for the blockage emitted by expand_nl_goto_receiver. */ + else if (current_function_has_nonlocal_label + && GET_CODE (PATTERN (insn)) == ASM_INPUT) + { + btr_user user; + + /* Do the equivalent of calling note_other_use_this_block + for every target register. */ + for (user = info.users_this_bb; user != NULL; + user = user->next) + if (user->use) + user->other_use_this_block = 1; + IOR_HARD_REG_SET (info.btrs_written_in_block, all_btrs); + IOR_HARD_REG_SET (info.btrs_live_in_block, all_btrs); + sbitmap_zero (info.bb_gen); + } else { if (btr_referenced_p (PATTERN (insn), NULL)) @@ -1008,7 +1024,7 @@ btr_def_live_range (btr_def def, HARD_REG_SET *btrs_live_in_range) def->bb, user->bb, (flag_btr_bb_exclusive || user->insn != BB_END (def->bb) - || GET_CODE (user->insn) != JUMP_INSN)); + || !JUMP_P (user->insn))); } else { @@ -1072,7 +1088,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range) def->bb, user->bb, (flag_btr_bb_exclusive || user->insn != BB_END (def->bb) - || GET_CODE (user->insn) != JUMP_INSN)); + || !JUMP_P (user->insn))); btr = choose_btr (combined_btrs_live); if (btr != -1) diff --git a/gcc/builtin-types.def b/gcc/builtin-types.def index 845863108b0..4b5f35351e4 100644 --- a/gcc/builtin-types.def +++ b/gcc/builtin-types.def @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -60,6 +60,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA the type pointed to. */ DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node) +DEF_PRIMITIVE_TYPE (BT_BOOL, boolean_type_node) DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node) DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node) DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node) @@ -79,6 +80,10 @@ DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node) DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node) DEF_PRIMITIVE_TYPE (BT_FILEPTR, fileptr_type_node) DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node) +DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR, + build_pointer_type + (build_qualified_type (void_type_node, + TYPE_QUAL_VOLATILE))) DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0)) DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node) DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node) @@ -94,6 +99,11 @@ DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node) DEF_PRIMITIVE_TYPE (BT_VALIST_REF, va_list_ref_type_node) DEF_PRIMITIVE_TYPE (BT_VALIST_ARG, va_list_arg_type_node) +DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1)) +DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1)) +DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1)) +DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1)) + DEF_POINTER_TYPE (BT_PTR_CONST_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID) @@ -160,6 +170,7 @@ DEF_FUNCTION_TYPE_1 (BT_FN_STRING_CONST_STRING, BT_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_1 (BT_FN_WORD_PTR, BT_WORD, BT_PTR) DEF_FUNCTION_TYPE_1 (BT_FN_INT_WINT, BT_INT, BT_WINT) DEF_FUNCTION_TYPE_1 (BT_FN_WINT_WINT, BT_WINT, BT_WINT) +DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR) DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_INT, BT_VOID, BT_PTR, BT_INT) DEF_FUNCTION_TYPE_2 (BT_FN_STRING_STRING_CONST_STRING, @@ -172,6 +183,8 @@ DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_STRING_CONST_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_STRING) DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_INT, BT_STRING, BT_CONST_STRING, BT_INT) +DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_SIZE, + BT_STRING, BT_CONST_STRING, BT_SIZE) DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_FILEPTR, BT_INT, BT_CONST_STRING, BT_FILEPTR) DEF_FUNCTION_TYPE_2 (BT_FN_INT_INT_FILEPTR, @@ -239,6 +252,10 @@ DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOU DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTR, BT_VOID, BT_PTR, BT_PTR) DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_PTR_CONST_STRING, BT_INT, BT_CONST_STRING, BT_PTR_CONST_STRING) +DEF_FUNCTION_TYPE_2 (BT_FN_I1_VPTR_I1, BT_I1, BT_VOLATILE_PTR, BT_I1) +DEF_FUNCTION_TYPE_2 (BT_FN_I2_VPTR_I2, BT_I2, BT_VOLATILE_PTR, BT_I2) +DEF_FUNCTION_TYPE_2 (BT_FN_I4_VPTR_I4, BT_I4, BT_VOLATILE_PTR, BT_I4) +DEF_FUNCTION_TYPE_2 (BT_FN_I8_VPTR_I8, BT_I8, BT_VOLATILE_PTR, BT_I8) DEF_FUNCTION_TYPE_3 (BT_FN_STRING_STRING_CONST_STRING_SIZE, BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE) @@ -283,6 +300,18 @@ DEF_FUNCTION_TYPE_3 (BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR, DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_PTR_PTR, BT_VOID, BT_PTR, BT_PTR, BT_PTR) DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING, BT_INT, BT_CONST_STRING, BT_PTR_CONST_STRING, BT_PTR_CONST_STRING) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I1_I1, BT_BOOL, BT_VOLATILE_PTR, + BT_I1, BT_I1) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I2_I2, BT_BOOL, BT_VOLATILE_PTR, + BT_I2, BT_I2) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I4_I4, BT_BOOL, BT_VOLATILE_PTR, + BT_I4, BT_I4) +DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I8_I8, BT_BOOL, BT_VOLATILE_PTR, + BT_I8, BT_I8) +DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_I1, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_I1) +DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_I2, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_I2) +DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_I4, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_I4) +DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_I8, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_I8) DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR) diff --git a/gcc/builtins.c b/gcc/builtins.c index 20423fb12fe..cdc5cebcbc6 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -48,9 +48,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "basic-block.h" #include "tree-mudflap.h" -#define CALLED_AS_BUILT_IN(NODE) \ - (!strncmp (IDENTIFIER_POINTER (DECL_NAME (NODE)), "__builtin_", 10)) - #ifndef PAD_VARARGS_DOWN #define PAD_VARARGS_DOWN BYTES_BIG_ENDIAN #endif @@ -98,6 +95,7 @@ static void expand_errno_check (tree, rtx); static rtx expand_builtin_mathfn (tree, rtx, rtx); static rtx expand_builtin_mathfn_2 (tree, rtx, rtx); static rtx expand_builtin_mathfn_3 (tree, rtx, rtx); +static rtx expand_builtin_int_roundingfn (tree, rtx, rtx); static rtx expand_builtin_args_info (tree); static rtx expand_builtin_next_arg (void); static rtx expand_builtin_va_start (tree); @@ -113,15 +111,15 @@ static rtx expand_builtin_strspn (tree, rtx, enum machine_mode); static rtx expand_builtin_strcspn (tree, rtx, enum machine_mode); static rtx expand_builtin_memcpy (tree, rtx, enum machine_mode); static rtx expand_builtin_mempcpy (tree, tree, rtx, enum machine_mode, int); -static rtx expand_builtin_memmove (tree, tree, rtx, enum machine_mode); -static rtx expand_builtin_bcopy (tree, tree); +static rtx expand_builtin_memmove (tree, tree, rtx, enum machine_mode, tree); +static rtx expand_builtin_bcopy (tree); static rtx expand_builtin_strcpy (tree, rtx, enum machine_mode); static rtx expand_builtin_stpcpy (tree, rtx, enum machine_mode); static rtx builtin_strncpy_read_str (void *, HOST_WIDE_INT, enum machine_mode); static rtx expand_builtin_strncpy (tree, rtx, enum machine_mode); static rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode); static rtx builtin_memset_gen_str (void *, HOST_WIDE_INT, enum machine_mode); -static rtx expand_builtin_memset (tree, rtx, enum machine_mode); +static rtx expand_builtin_memset (tree, rtx, enum machine_mode, tree); static rtx expand_builtin_bzero (tree); static rtx expand_builtin_strlen (tree, rtx, enum machine_mode); static rtx expand_builtin_strstr (tree, tree, rtx, enum machine_mode); @@ -144,7 +142,7 @@ static tree fold_builtin_inf (tree, int); static tree fold_builtin_nan (tree, tree, int); static int validate_arglist (tree, ...); static bool integer_valued_real_p (tree); -static tree fold_trunc_transparent_mathfn (tree); +static tree fold_trunc_transparent_mathfn (tree, tree); static bool readonly_data_expr (tree); static rtx expand_builtin_fabs (tree, rtx, rtx); static rtx expand_builtin_signbit (tree, rtx); @@ -157,12 +155,13 @@ static tree fold_builtin_sin (tree); static tree fold_builtin_cos (tree, tree, tree); static tree fold_builtin_tan (tree); static tree fold_builtin_atan (tree, tree); -static tree fold_builtin_trunc (tree); -static tree fold_builtin_floor (tree); -static tree fold_builtin_ceil (tree); -static tree fold_builtin_round (tree); +static tree fold_builtin_trunc (tree, tree); +static tree fold_builtin_floor (tree, tree); +static tree fold_builtin_ceil (tree, tree); +static tree fold_builtin_round (tree, tree); +static tree fold_builtin_int_roundingfn (tree, tree); static tree fold_builtin_bitop (tree, tree); -static tree fold_builtin_memcpy (tree); +static tree fold_builtin_memcpy (tree, tree); static tree fold_builtin_mempcpy (tree, tree, int); static tree fold_builtin_memmove (tree, tree); static tree fold_builtin_strchr (tree, tree); @@ -178,7 +177,7 @@ static tree fold_builtin_fabs (tree, tree); static tree fold_builtin_abs (tree, tree); static tree fold_builtin_unordered_cmp (tree, tree, enum tree_code, enum tree_code); -static tree fold_builtin_1 (tree, bool); +static tree fold_builtin_1 (tree, tree, bool); static tree fold_builtin_strpbrk (tree, tree); static tree fold_builtin_strstr (tree, tree); @@ -189,6 +188,19 @@ static tree fold_builtin_strspn (tree); static tree fold_builtin_strcspn (tree); static tree fold_builtin_sprintf (tree, int); +/* Return true if NODE should be considered for inline expansion regardless + of the optimization level. This means whenever a function is invoked with + its "internal" name, which normally contains the prefix "__builtin". */ + +static bool called_as_built_in (tree node) +{ + const char *name = IDENTIFIER_POINTER (DECL_NAME (node)); + if (strncmp (name, "__builtin_", 10) == 0) + return true; + if (strncmp (name, "__sync_", 7) == 0) + return true; + return false; +} /* Return the alignment in bits of EXP, a pointer valued expression. But don't return more than MAX_ALIGN no matter what. @@ -339,7 +351,7 @@ c_strlen (tree src, int only_value) runtime. */ if (offset < 0 || offset > max) { - warning ("offset outside bounds of constant string"); + warning (0, "offset outside bounds of constant string"); return 0; } @@ -933,7 +945,7 @@ expand_builtin_prefetch (tree arglist) /* Argument 1 must be either zero or one. */ if (INTVAL (op1) != 0 && INTVAL (op1) != 1) { - warning ("invalid second argument to %<__builtin_prefetch%>;" + warning (0, "invalid second argument to %<__builtin_prefetch%>;" " using zero"); op1 = const0_rtx; } @@ -948,7 +960,7 @@ expand_builtin_prefetch (tree arglist) /* Argument 2 must be 0, 1, 2, or 3. */ if (INTVAL (op2) < 0 || INTVAL (op2) > 3) { - warning ("invalid third argument to %<__builtin_prefetch%>; using zero"); + warning (0, "invalid third argument to %<__builtin_prefetch%>; using zero"); op2 = const0_rtx; } @@ -979,12 +991,8 @@ expand_builtin_prefetch (tree arglist) static rtx get_memory_rtx (tree exp) { - rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_SUM); - rtx mem; - - addr = convert_memory_address (Pmode, addr); - - mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr)); + rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_NORMAL); + rtx mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr)); /* Get an expression we can use to find the attributes to assign to MEM. If it is an ADDR_EXPR, use the operand. Otherwise, dereference it if @@ -1482,7 +1490,6 @@ type_to_class (tree type) case QUAL_UNION_TYPE: return union_type_class; case ARRAY_TYPE: return (TYPE_STRING_FLAG (type) ? string_type_class : array_type_class); - case FILE_TYPE: return file_type_class; case LANG_TYPE: return lang_type_class; default: return no_type_class; } @@ -1552,8 +1559,12 @@ mathfn_built_in (tree type, enum built_in_function fn) CASE_MATHFN (BUILT_IN_J0) CASE_MATHFN (BUILT_IN_J1) CASE_MATHFN (BUILT_IN_JN) + CASE_MATHFN (BUILT_IN_LCEIL) CASE_MATHFN (BUILT_IN_LDEXP) + CASE_MATHFN (BUILT_IN_LFLOOR) CASE_MATHFN (BUILT_IN_LGAMMA) + CASE_MATHFN (BUILT_IN_LLCEIL) + CASE_MATHFN (BUILT_IN_LLFLOOR) CASE_MATHFN (BUILT_IN_LLRINT) CASE_MATHFN (BUILT_IN_LLROUND) CASE_MATHFN (BUILT_IN_LOG) @@ -1758,6 +1769,13 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget) case BUILT_IN_RINTF: case BUILT_IN_RINTL: builtin_optab = rint_optab; break; + case BUILT_IN_LRINT: + case BUILT_IN_LRINTF: + case BUILT_IN_LRINTL: + case BUILT_IN_LLRINT: + case BUILT_IN_LLRINTF: + case BUILT_IN_LLRINTL: + builtin_optab = lrint_optab; break; default: gcc_unreachable (); } @@ -2110,6 +2128,113 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget) return target; } +/* Expand a call to one of the builtin rounding functions (lfloor). + If expanding via optab fails, lower expression to (int)(floor(x)). + EXP is the expression that is a call to the builtin function; + if convenient, the result should be placed in TARGET. SUBTARGET may + be used as the target for computing one of EXP's operands. */ + +static rtx +expand_builtin_int_roundingfn (tree exp, rtx target, rtx subtarget) +{ + optab builtin_optab; + rtx op0, insns, tmp; + tree fndecl = get_callee_fndecl (exp); + tree arglist = TREE_OPERAND (exp, 1); + enum built_in_function fallback_fn; + tree fallback_fndecl; + enum machine_mode mode; + tree arg, narg; + + if (!validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) + gcc_unreachable (); + + arg = TREE_VALUE (arglist); + + switch (DECL_FUNCTION_CODE (fndecl)) + { + case BUILT_IN_LCEIL: + case BUILT_IN_LCEILF: + case BUILT_IN_LCEILL: + case BUILT_IN_LLCEIL: + case BUILT_IN_LLCEILF: + case BUILT_IN_LLCEILL: + builtin_optab = lceil_optab; + fallback_fn = BUILT_IN_CEIL; + break; + + case BUILT_IN_LFLOOR: + case BUILT_IN_LFLOORF: + case BUILT_IN_LFLOORL: + case BUILT_IN_LLFLOOR: + case BUILT_IN_LLFLOORF: + case BUILT_IN_LLFLOORL: + builtin_optab = lfloor_optab; + fallback_fn = BUILT_IN_FLOOR; + break; + + default: + gcc_unreachable (); + } + + /* Make a suitable register to place result in. */ + mode = TYPE_MODE (TREE_TYPE (exp)); + + /* Before working hard, check whether the instruction is available. */ + if (builtin_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing) + { + target = gen_reg_rtx (mode); + + /* Wrap the computation of the argument in a SAVE_EXPR, as we may + need to expand the argument again. This way, we will not perform + side-effects more the once. */ + narg = builtin_save_expr (arg); + if (narg != arg) + { + arg = narg; + arglist = build_tree_list (NULL_TREE, arg); + exp = build_function_call_expr (fndecl, arglist); + } + + op0 = expand_expr (arg, subtarget, VOIDmode, 0); + + start_sequence (); + + /* Compute into TARGET. + Set TARGET to wherever the result comes back. */ + target = expand_unop (mode, builtin_optab, op0, target, 0); + + if (target != 0) + { + /* Output the entire sequence. */ + insns = get_insns (); + end_sequence (); + emit_insn (insns); + return target; + } + + /* If we were unable to expand via the builtin, stop the sequence + (without outputting the insns). */ + end_sequence (); + } + + /* Fall back to floating point rounding optab. */ + fallback_fndecl = mathfn_built_in (TREE_TYPE (arg), fallback_fn); + /* We shouldn't get here on targets without TARGET_C99_FUNCTIONS. + ??? Perhaps convert (int)floorf(x) into (int)floor((double)x). */ + gcc_assert (fallback_fndecl != NULL_TREE); + exp = build_function_call_expr (fallback_fndecl, arglist); + + tmp = expand_builtin_mathfn (exp, NULL_RTX, NULL_RTX); + + /* Truncate the result of floating point optab to integer + via expand_fix (). */ + target = gen_reg_rtx (mode); + expand_fix (target, tmp, 0); + + return target; +} + /* To evaluate powi(x,n), the floating point value x raised to the constant integer exponent n, we use a hybrid algorithm that combines the "window method" with look-up tables. For an @@ -2377,6 +2502,7 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget) tree arg0, arg1; rtx op0, op1; enum machine_mode mode; + enum machine_mode mode2; if (! validate_arglist (arglist, REAL_TYPE, INTEGER_TYPE, VOID_TYPE)) return 0; @@ -2408,19 +2534,22 @@ expand_builtin_powi (tree exp, rtx target, rtx subtarget) /* Emit a libcall to libgcc. */ + /* Mode of the 2nd argument must match that of an int. */ + mode2 = mode_for_size (INT_TYPE_SIZE, MODE_INT, 0); + if (target == NULL_RTX) target = gen_reg_rtx (mode); op0 = expand_expr (arg0, subtarget, mode, 0); if (GET_MODE (op0) != mode) op0 = convert_to_mode (mode, op0, 0); - op1 = expand_expr (arg1, 0, word_mode, 0); - if (GET_MODE (op1) != word_mode) - op1 = convert_to_mode (word_mode, op1, 0); + op1 = expand_expr (arg1, 0, mode2, 0); + if (GET_MODE (op1) != mode2) + op1 = convert_to_mode (mode2, op1, 0); target = emit_library_call_value (powi_optab->handlers[(int) mode].libfunc, target, LCT_CONST_MAKE_BLOCK, mode, 2, - op0, mode, op1, word_mode); + op0, mode, op1, mode2); return target; } @@ -2623,6 +2752,7 @@ builtin_memcpy_read_str (void *data, HOST_WIDE_INT offset, static rtx expand_builtin_memcpy (tree exp, rtx target, enum machine_mode mode) { + tree fndecl = get_callee_fndecl (exp); tree arglist = TREE_OPERAND (exp, 1); if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -2637,7 +2767,7 @@ expand_builtin_memcpy (tree exp, rtx target, enum machine_mode mode) unsigned int dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT); rtx dest_mem, src_mem, dest_addr, len_rtx; - tree result = fold_builtin_memcpy (exp); + tree result = fold_builtin_memcpy (fndecl, arglist); if (result) return expand_expr (result, target, mode, EXPAND_NORMAL); @@ -2678,7 +2808,8 @@ expand_builtin_memcpy (tree exp, rtx target, enum machine_mode mode) /* Copy word part most expediently. */ dest_addr = emit_block_move (dest_mem, src_mem, len_rtx, - BLOCK_OP_NORMAL); + CALL_EXPR_TAILCALL (exp) + ? BLOCK_OP_TAILCALL : BLOCK_OP_NORMAL); if (dest_addr == 0) { @@ -2785,7 +2916,7 @@ expand_builtin_mempcpy (tree arglist, tree type, rtx target, enum machine_mode m static rtx expand_builtin_memmove (tree arglist, tree type, rtx target, - enum machine_mode mode) + enum machine_mode mode, tree orig_exp) { if (!validate_arglist (arglist, POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -2817,11 +2948,13 @@ expand_builtin_memmove (tree arglist, tree type, rtx target, normal memcpy. */ if (readonly_data_expr (src)) { - tree const fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; + tree fn = implicit_built_in_decls[BUILT_IN_MEMCPY]; if (!fn) return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (orig_exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); } /* If length is 1 and we can expand memcpy call inline, @@ -2843,8 +2976,10 @@ expand_builtin_memmove (tree arglist, tree type, rtx target, if we failed the caller should emit a normal call. */ static rtx -expand_builtin_bcopy (tree arglist, tree type) +expand_builtin_bcopy (tree exp) { + tree arglist = TREE_OPERAND (exp, 1); + tree type = TREE_TYPE (exp); tree src, dest, size, newarglist; if (!validate_arglist (arglist, @@ -2864,7 +2999,7 @@ expand_builtin_bcopy (tree arglist, tree type) newarglist = tree_cons (NULL_TREE, src, newarglist); newarglist = tree_cons (NULL_TREE, dest, newarglist); - return expand_builtin_memmove (newarglist, type, const0_rtx, VOIDmode); + return expand_builtin_memmove (newarglist, type, const0_rtx, VOIDmode, exp); } #ifndef HAVE_movstr @@ -3158,7 +3293,8 @@ builtin_memset_gen_str (void *data, HOST_WIDE_INT offset ATTRIBUTE_UNUSED, convenient). */ static rtx -expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) +expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode, + tree orig_exp) { if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -3244,7 +3380,9 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) dest_mem = get_memory_rtx (dest); set_mem_align (dest_mem, dest_align); - dest_addr = clear_storage (dest_mem, len_rtx); + dest_addr = clear_storage (dest_mem, len_rtx, + CALL_EXPR_TAILCALL (orig_exp) + ? BLOCK_OP_TAILCALL : BLOCK_OP_NORMAL); if (dest_addr == 0) { @@ -3260,8 +3398,9 @@ expand_builtin_memset (tree arglist, rtx target, enum machine_mode mode) if we failed the caller should emit a normal call. */ static rtx -expand_builtin_bzero (tree arglist) +expand_builtin_bzero (tree exp) { + tree arglist = TREE_OPERAND (exp, 1); tree dest, size, newarglist; if (!validate_arglist (arglist, POINTER_TYPE, INTEGER_TYPE, VOID_TYPE)) @@ -3279,7 +3418,7 @@ expand_builtin_bzero (tree arglist) newarglist = tree_cons (NULL_TREE, integer_zero_node, newarglist); newarglist = tree_cons (NULL_TREE, dest, newarglist); - return expand_builtin_memset (newarglist, const0_rtx, VOIDmode); + return expand_builtin_memset (newarglist, const0_rtx, VOIDmode, exp); } /* Expand expression EXP, which is a call to the memcmp built-in function. @@ -3418,7 +3557,7 @@ expand_builtin_strcmp (tree exp, rtx target, enum machine_mode mode) tree len, len1, len2; rtx arg1_rtx, arg2_rtx, arg3_rtx; rtx result, insn; - tree fndecl; + tree fndecl, fn; int arg1_align = get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; @@ -3502,8 +3641,10 @@ expand_builtin_strcmp (tree exp, rtx target, enum machine_mode mode) arglist = build_tree_list (NULL_TREE, arg2); arglist = tree_cons (NULL_TREE, arg1, arglist); fndecl = get_callee_fndecl (exp); - exp = build_function_call_expr (fndecl, arglist); - return expand_call (exp, target, target == const0_rtx); + fn = build_function_call_expr (fndecl, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_call (fn, target, target == const0_rtx); } #endif return 0; @@ -3540,7 +3681,7 @@ expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) tree len, len1, len2; rtx arg1_rtx, arg2_rtx, arg3_rtx; rtx result, insn; - tree fndecl; + tree fndecl, fn; int arg1_align = get_pointer_alignment (arg1, BIGGEST_ALIGNMENT) / BITS_PER_UNIT; @@ -3630,8 +3771,10 @@ expand_builtin_strncmp (tree exp, rtx target, enum machine_mode mode) arglist = tree_cons (NULL_TREE, arg2, arglist); arglist = tree_cons (NULL_TREE, arg1, arglist); fndecl = get_callee_fndecl (exp); - exp = build_function_call_expr (fndecl, arglist); - return expand_call (exp, target, target == const0_rtx); + fn = build_function_call_expr (fndecl, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_call (fn, target, target == const0_rtx); } #endif return 0; @@ -3680,7 +3823,8 @@ expand_builtin_strcat (tree arglist, tree type, rtx target, enum machine_mode mo fold (build_function_call_expr (strlen_fn, build_tree_list (NULL_TREE, dst))); - /* Create (dst + strlen (dst)). */ + /* Create (dst + (cast) strlen (dst)). */ + newdst = fold_convert (TREE_TYPE (dst), newdst); newdst = fold (build2 (PLUS_EXPR, TREE_TYPE (dst), dst, newdst)); /* Prepend the new dst argument. */ @@ -4089,12 +4233,12 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p) /* Unfortunately, this is merely undefined, rather than a constraint violation, so we cannot make this an error. If this call is never executed, the program is still strictly conforming. */ - warning ("%qT is promoted to %qT when passed through %<...%>", + warning (0, "%qT is promoted to %qT when passed through %<...%>", type, promoted_type); if (! gave_help) { gave_help = true; - warning ("(so you should pass %qT not %qT to %)", + warning (0, "(so you should pass %qT not %qT to %)", promoted_type, type); } @@ -4131,7 +4275,8 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p) gimplify_expr (&valist, pre_p, post_p, is_gimple_min_lval, fb_lvalue); if (!targetm.gimplify_va_arg_expr) - /* Once most targets are converted this should abort. */ + /* FIXME:Once most targets are converted we should merely + assert this is non-null. */ return GS_ALL_DONE; *expr_p = targetm.gimplify_va_arg_expr (valist, type, pre_p, post_p); @@ -4233,9 +4378,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist) if (tem == NULL) { if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) - warning ("unsupported argument to %<__builtin_frame_address%>"); + warning (0, "unsupported argument to %<__builtin_frame_address%>"); else - warning ("unsupported argument to %<__builtin_return_address%>"); + warning (0, "unsupported argument to %<__builtin_return_address%>"); return const0_rtx; } @@ -4561,15 +4706,16 @@ build_string_literal (int len, const char *str) return t; } -/* Expand a call to printf or printf_unlocked with argument list ARGLIST. +/* Expand EXP, a call to printf or printf_unlocked. Return 0 if a normal call should be emitted rather than transforming the function inline. If convenient, the result should be placed in TARGET with mode MODE. UNLOCKED indicates this is a printf_unlocked call. */ static rtx -expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, +expand_builtin_printf (tree exp, rtx target, enum machine_mode mode, bool unlocked) { + tree arglist = TREE_OPERAND (exp, 1); tree fn_putchar = unlocked ? implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] : implicit_built_in_decls[BUILT_IN_PUTCHAR]; @@ -4660,19 +4806,22 @@ expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, if (!fn) return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); } -/* Expand a call to fprintf or fprintf_unlocked with argument list ARGLIST. +/* Expand EXP, a call to fprintf or fprintf_unlocked. Return 0 if a normal call should be emitted rather than transforming the function inline. If convenient, the result should be placed in TARGET with mode MODE. UNLOCKED indicates this is a fprintf_unlocked call. */ static rtx -expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, +expand_builtin_fprintf (tree exp, rtx target, enum machine_mode mode, bool unlocked) { + tree arglist = TREE_OPERAND (exp, 1); tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FPUTC]; tree fn_fputs = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED] @@ -4754,8 +4903,10 @@ expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, if (!fn) return 0; - return expand_expr (build_function_call_expr (fn, arglist), - target, mode, EXPAND_NORMAL); + fn = build_function_call_expr (fn, arglist); + if (TREE_CODE (fn) == CALL_EXPR) + CALL_EXPR_TAILCALL (fn) = CALL_EXPR_TAILCALL (exp); + return expand_expr (fn, target, mode, EXPAND_NORMAL); } /* Expand a call to sprintf with argument list ARGLIST. Return 0 if @@ -5108,6 +5259,166 @@ expand_builtin_fork_or_exec (tree fn, tree arglist, rtx target, int ignore) return expand_call (call, target, ignore); } + + +/* Expand the __sync_xxx_and_fetch and __sync_fetch_and_xxx intrinsics. + ARGLIST is the operands list to the function. CODE is the rtx code + that corresponds to the arithmetic or logical operation from the name; + an exception here is that NOT actually means NAND. TARGET is an optional + place for us to store the results; AFTER is true if this is the + fetch_and_xxx form. IGNORE is true if we don't actually care about + the result of the operation at all. */ + +static rtx +expand_builtin_sync_operation (tree arglist, enum rtx_code code, bool after, + rtx target, bool ignore) +{ + enum machine_mode mode; + rtx addr, val, mem; + + /* Expand the operands. */ + addr = expand_expr (TREE_VALUE (arglist), NULL, Pmode, EXPAND_SUM); + mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (TREE_VALUE (arglist)))); + + arglist = TREE_CHAIN (arglist); + val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + + /* Note that we explicitly do not want any alias information for this + memory, so that we kill all other live memories. Otherwise we don't + satisfy the full barrier semantics of the intrinsic. */ + mem = validize_mem (gen_rtx_MEM (mode, addr)); + MEM_VOLATILE_P (mem) = 1; + + if (ignore) + return expand_sync_operation (mem, val, code); + else + return expand_sync_fetch_operation (mem, val, code, after, target); +} + +/* Expand the __sync_val_compare_and_swap and __sync_bool_compare_and_swap + intrinsics. ARGLIST is the operands list to the function. IS_BOOL is + true if this is the boolean form. TARGET is a place for us to store the + results; this is NOT optional if IS_BOOL is true. */ + +static rtx +expand_builtin_compare_and_swap (tree arglist, bool is_bool, rtx target) +{ + enum machine_mode mode; + rtx addr, old_val, new_val, mem; + + /* Expand the operands. */ + addr = expand_expr (TREE_VALUE (arglist), NULL, Pmode, EXPAND_SUM); + mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (TREE_VALUE (arglist)))); + + arglist = TREE_CHAIN (arglist); + old_val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + + arglist = TREE_CHAIN (arglist); + new_val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + + /* Note that we explicitly do not want any alias information for this + memory, so that we kill all other live memories. Otherwise we don't + satisfy the full barrier semantics of the intrinsic. */ + mem = validize_mem (gen_rtx_MEM (mode, addr)); + MEM_VOLATILE_P (mem) = 1; + + if (is_bool) + return expand_bool_compare_and_swap (mem, old_val, new_val, target); + else + return expand_val_compare_and_swap (mem, old_val, new_val, target); +} + +/* Expand the __sync_lock_test_and_set intrinsic. Note that the most + general form is actually an atomic exchange, and some targets only + support a reduced form with the second argument being a constant 1. + ARGLIST is the operands list to the function; TARGET is an optional + place for us to store the results. */ + +static rtx +expand_builtin_lock_test_and_set (tree arglist, rtx target) +{ + enum machine_mode mode; + rtx addr, val, mem; + + /* Expand the operands. */ + addr = expand_expr (TREE_VALUE (arglist), NULL, Pmode, EXPAND_NORMAL); + mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (TREE_VALUE (arglist)))); + + arglist = TREE_CHAIN (arglist); + val = expand_expr (TREE_VALUE (arglist), NULL, mode, EXPAND_NORMAL); + + /* Note that we explicitly do not want any alias information for this + memory, so that we kill all other live memories. Otherwise we don't + satisfy the barrier semantics of the intrinsic. */ + mem = validize_mem (gen_rtx_MEM (mode, addr)); + MEM_VOLATILE_P (mem) = 1; + + return expand_sync_lock_test_and_set (mem, val, target); +} + +/* Expand the __sync_synchronize intrinsic. */ + +static void +expand_builtin_synchronize (void) +{ + rtx body; + +#ifdef HAVE_memory_barrier + if (HAVE_memory_barrier) + { + emit_insn (gen_memory_barrier ()); + return; + } +#endif + + /* If no explicit memory barrier instruction is available, create an empty + asm stmt that will prevent compiler movement across the barrier. */ + body = gen_rtx_ASM_INPUT (VOIDmode, ""); + MEM_VOLATILE_P (body) = 1; + emit_insn (body); +} + +/* Expand the __sync_lock_release intrinsic. ARGLIST is the operands list + to the function. */ + +static void +expand_builtin_lock_release (tree arglist) +{ + enum machine_mode mode; + enum insn_code icode; + rtx addr, val, mem, insn; + + /* Expand the operands. */ + addr = expand_expr (TREE_VALUE (arglist), NULL, Pmode, EXPAND_NORMAL); + mode = TYPE_MODE (TREE_TYPE (TREE_TYPE (TREE_VALUE (arglist)))); + val = const0_rtx; + + /* Note that we explicitly do not want any alias information for this + memory, so that we kill all other live memories. Otherwise we don't + satisfy the barrier semantics of the intrinsic. */ + mem = validize_mem (gen_rtx_MEM (mode, addr)); + MEM_VOLATILE_P (mem) = 1; + + /* If there is an explicit operation in the md file, use it. */ + icode = sync_lock_release[mode]; + if (icode != CODE_FOR_nothing) + { + if (!insn_data[icode].operand[1].predicate (val, mode)) + val = force_reg (mode, val); + + insn = GEN_FCN (icode) (mem, val); + if (insn) + { + emit_insn (insn); + return; + } + } + + /* Otherwise we can implement this operation by emitting a barrier + followed by a store of zero. */ + expand_builtin_synchronize (); + emit_move_insn (mem, val); +} /* Expand an expression EXP that calls a built-in function, with result going to TARGET if that's convenient @@ -5130,7 +5441,7 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, /* When not optimizing, generate calls to library functions for a certain set of builtins. */ if (!optimize - && !CALLED_AS_BUILT_IN (fndecl) + && !called_as_built_in (fndecl) && DECL_ASSEMBLER_NAME_SET_P (fndecl) && fcode != BUILT_IN_ALLOCA) return expand_call (exp, target, ignore); @@ -5260,11 +5571,34 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, case BUILT_IN_RINT: case BUILT_IN_RINTF: case BUILT_IN_RINTL: + case BUILT_IN_LRINT: + case BUILT_IN_LRINTF: + case BUILT_IN_LRINTL: + case BUILT_IN_LLRINT: + case BUILT_IN_LLRINTF: + case BUILT_IN_LLRINTL: target = expand_builtin_mathfn (exp, target, subtarget); if (target) return target; break; + case BUILT_IN_LCEIL: + case BUILT_IN_LCEILF: + case BUILT_IN_LCEILL: + case BUILT_IN_LLCEIL: + case BUILT_IN_LLCEILF: + case BUILT_IN_LLCEILL: + case BUILT_IN_LFLOOR: + case BUILT_IN_LFLOORF: + case BUILT_IN_LFLOORL: + case BUILT_IN_LLFLOOR: + case BUILT_IN_LLFLOORF: + case BUILT_IN_LLFLOORL: + target = expand_builtin_int_roundingfn (exp, target, subtarget); + if (target) + return target; + break; + case BUILT_IN_POW: case BUILT_IN_POWF: case BUILT_IN_POWL: @@ -5535,25 +5869,26 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; case BUILT_IN_MEMMOVE: - target = expand_builtin_memmove (arglist, TREE_TYPE (exp), target, mode); + target = expand_builtin_memmove (arglist, TREE_TYPE (exp), target, + mode, exp); if (target) return target; break; case BUILT_IN_BCOPY: - target = expand_builtin_bcopy (arglist, TREE_TYPE (exp)); + target = expand_builtin_bcopy (exp); if (target) return target; break; case BUILT_IN_MEMSET: - target = expand_builtin_memset (arglist, target, mode); + target = expand_builtin_memset (arglist, target, mode, exp); if (target) return target; break; case BUILT_IN_BZERO: - target = expand_builtin_bzero (arglist); + target = expand_builtin_bzero (exp); if (target) return target; break; @@ -5630,13 +5965,13 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, return const0_rtx; case BUILT_IN_PRINTF: - target = expand_builtin_printf (arglist, target, mode, false); + target = expand_builtin_printf (exp, target, mode, false); if (target) return target; break; case BUILT_IN_PRINTF_UNLOCKED: - target = expand_builtin_printf (arglist, target, mode, true); + target = expand_builtin_printf (exp, target, mode, true); if (target) return target; break; @@ -5653,13 +5988,13 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, break; case BUILT_IN_FPRINTF: - target = expand_builtin_fprintf (arglist, target, mode, false); + target = expand_builtin_fprintf (exp, target, mode, false); if (target) return target; break; case BUILT_IN_FPRINTF_UNLOCKED: - target = expand_builtin_fprintf (arglist, target, mode, true); + target = expand_builtin_fprintf (exp, target, mode, true); if (target) return target; break; @@ -5741,6 +6076,168 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode, return target; break; + case BUILT_IN_FETCH_AND_ADD_1: + case BUILT_IN_FETCH_AND_ADD_2: + case BUILT_IN_FETCH_AND_ADD_4: + case BUILT_IN_FETCH_AND_ADD_8: + target = expand_builtin_sync_operation (arglist, PLUS, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_SUB_1: + case BUILT_IN_FETCH_AND_SUB_2: + case BUILT_IN_FETCH_AND_SUB_4: + case BUILT_IN_FETCH_AND_SUB_8: + target = expand_builtin_sync_operation (arglist, MINUS, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_OR_1: + case BUILT_IN_FETCH_AND_OR_2: + case BUILT_IN_FETCH_AND_OR_4: + case BUILT_IN_FETCH_AND_OR_8: + target = expand_builtin_sync_operation (arglist, IOR, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_AND_1: + case BUILT_IN_FETCH_AND_AND_2: + case BUILT_IN_FETCH_AND_AND_4: + case BUILT_IN_FETCH_AND_AND_8: + target = expand_builtin_sync_operation (arglist, AND, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_XOR_1: + case BUILT_IN_FETCH_AND_XOR_2: + case BUILT_IN_FETCH_AND_XOR_4: + case BUILT_IN_FETCH_AND_XOR_8: + target = expand_builtin_sync_operation (arglist, XOR, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_FETCH_AND_NAND_1: + case BUILT_IN_FETCH_AND_NAND_2: + case BUILT_IN_FETCH_AND_NAND_4: + case BUILT_IN_FETCH_AND_NAND_8: + target = expand_builtin_sync_operation (arglist, NOT, + false, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_ADD_AND_FETCH_1: + case BUILT_IN_ADD_AND_FETCH_2: + case BUILT_IN_ADD_AND_FETCH_4: + case BUILT_IN_ADD_AND_FETCH_8: + target = expand_builtin_sync_operation (arglist, PLUS, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_SUB_AND_FETCH_1: + case BUILT_IN_SUB_AND_FETCH_2: + case BUILT_IN_SUB_AND_FETCH_4: + case BUILT_IN_SUB_AND_FETCH_8: + target = expand_builtin_sync_operation (arglist, MINUS, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_OR_AND_FETCH_1: + case BUILT_IN_OR_AND_FETCH_2: + case BUILT_IN_OR_AND_FETCH_4: + case BUILT_IN_OR_AND_FETCH_8: + target = expand_builtin_sync_operation (arglist, IOR, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_AND_AND_FETCH_1: + case BUILT_IN_AND_AND_FETCH_2: + case BUILT_IN_AND_AND_FETCH_4: + case BUILT_IN_AND_AND_FETCH_8: + target = expand_builtin_sync_operation (arglist, AND, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_XOR_AND_FETCH_1: + case BUILT_IN_XOR_AND_FETCH_2: + case BUILT_IN_XOR_AND_FETCH_4: + case BUILT_IN_XOR_AND_FETCH_8: + target = expand_builtin_sync_operation (arglist, XOR, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_NAND_AND_FETCH_1: + case BUILT_IN_NAND_AND_FETCH_2: + case BUILT_IN_NAND_AND_FETCH_4: + case BUILT_IN_NAND_AND_FETCH_8: + target = expand_builtin_sync_operation (arglist, NOT, + true, target, ignore); + if (target) + return target; + break; + + case BUILT_IN_BOOL_COMPARE_AND_SWAP_1: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_2: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_4: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_8: + if (mode == VOIDmode) + mode = TYPE_MODE (boolean_type_node); + if (!target || !register_operand (target, mode)) + target = gen_reg_rtx (mode); + target = expand_builtin_compare_and_swap (arglist, true, target); + if (target) + return target; + break; + + case BUILT_IN_VAL_COMPARE_AND_SWAP_1: + case BUILT_IN_VAL_COMPARE_AND_SWAP_2: + case BUILT_IN_VAL_COMPARE_AND_SWAP_4: + case BUILT_IN_VAL_COMPARE_AND_SWAP_8: + target = expand_builtin_compare_and_swap (arglist, false, target); + if (target) + return target; + break; + + case BUILT_IN_LOCK_TEST_AND_SET_1: + case BUILT_IN_LOCK_TEST_AND_SET_2: + case BUILT_IN_LOCK_TEST_AND_SET_4: + case BUILT_IN_LOCK_TEST_AND_SET_8: + target = expand_builtin_lock_test_and_set (arglist, target); + if (target) + return target; + break; + + case BUILT_IN_LOCK_RELEASE_1: + case BUILT_IN_LOCK_RELEASE_2: + case BUILT_IN_LOCK_RELEASE_4: + case BUILT_IN_LOCK_RELEASE_8: + expand_builtin_lock_release (arglist); + return const0_rtx; + + case BUILT_IN_SYNCHRONIZE: + expand_builtin_synchronize (); + return const0_rtx; + default: /* just do library call, if unknown builtin */ break; } @@ -5841,10 +6338,17 @@ fold_builtin_constant_p (tree arglist) /* If we know this is a constant, emit the constant of one. */ if (CONSTANT_CLASS_P (arglist) || (TREE_CODE (arglist) == CONSTRUCTOR - && TREE_CONSTANT (arglist)) - || (TREE_CODE (arglist) == ADDR_EXPR - && TREE_CODE (TREE_OPERAND (arglist, 0)) == STRING_CST)) + && TREE_CONSTANT (arglist))) return integer_one_node; + if (TREE_CODE (arglist) == ADDR_EXPR) + { + tree op = TREE_OPERAND (arglist, 0); + if (TREE_CODE (op) == STRING_CST + || (TREE_CODE (op) == ARRAY_REF + && integer_zerop (TREE_OPERAND (op, 1)) + && TREE_CODE (TREE_OPERAND (op, 0)) == STRING_CST)) + return integer_one_node; + } /* If this expression has side effects, show we don't know it to be a constant. Likewise if it's a pointer or aggregate type since in @@ -6068,10 +6572,8 @@ integer_valued_real_p (tree t) Do the transformation. */ static tree -fold_trunc_transparent_mathfn (tree exp) +fold_trunc_transparent_mathfn (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); tree arg; @@ -6111,10 +6613,8 @@ fold_trunc_transparent_mathfn (tree exp) the argument, for instance lround((double)f) -> lroundf (f). */ static tree -fold_fixed_mathfn (tree exp) +fold_fixed_mathfn (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl); tree arg; @@ -6502,10 +7002,8 @@ fold_builtin_atan (tree arglist, tree type) NULL_TREE if no simplification can be made. */ static tree -fold_builtin_trunc (tree exp) +fold_builtin_trunc (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -6523,17 +7021,15 @@ fold_builtin_trunc (tree exp) return build_real (type, r); } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); } /* Fold function call to builtin floor, floorf or floorl. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_floor (tree exp) +fold_builtin_floor (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -6556,17 +7052,15 @@ fold_builtin_floor (tree exp) } } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); } /* Fold function call to builtin ceil, ceilf or ceill. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_ceil (tree exp) +fold_builtin_ceil (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -6589,17 +7083,15 @@ fold_builtin_ceil (tree exp) } } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); } /* Fold function call to builtin round, roundf or roundl. Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_round (tree exp) +fold_builtin_round (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -6622,18 +7114,16 @@ fold_builtin_round (tree exp) } } - return fold_trunc_transparent_mathfn (exp); + return fold_trunc_transparent_mathfn (fndecl, arglist); } /* Fold function call to builtin lround, lroundf or lroundl (or the - corresponding long long versions). Return NULL_TREE if no - simplification can be made. */ + corresponding long long versions) and other rounding functions. + Return NULL_TREE if no simplification can be made. */ static tree -fold_builtin_lround (tree exp) +fold_builtin_int_roundingfn (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree arg; if (! validate_arglist (arglist, REAL_TYPE, VOID_TYPE)) @@ -6652,7 +7142,39 @@ fold_builtin_lround (tree exp) HOST_WIDE_INT hi, lo; REAL_VALUE_TYPE r; - real_round (&r, TYPE_MODE (ftype), &x); + switch (DECL_FUNCTION_CODE (fndecl)) + { + case BUILT_IN_LFLOOR: + case BUILT_IN_LFLOORF: + case BUILT_IN_LFLOORL: + case BUILT_IN_LLFLOOR: + case BUILT_IN_LLFLOORF: + case BUILT_IN_LLFLOORL: + real_floor (&r, TYPE_MODE (ftype), &x); + break; + + case BUILT_IN_LCEIL: + case BUILT_IN_LCEILF: + case BUILT_IN_LCEILL: + case BUILT_IN_LLCEIL: + case BUILT_IN_LLCEILF: + case BUILT_IN_LLCEILL: + real_ceil (&r, TYPE_MODE (ftype), &x); + break; + + case BUILT_IN_LROUND: + case BUILT_IN_LROUNDF: + case BUILT_IN_LROUNDL: + case BUILT_IN_LLROUND: + case BUILT_IN_LLROUNDF: + case BUILT_IN_LLROUNDL: + real_round (&r, TYPE_MODE (ftype), &x); + break; + + default: + gcc_unreachable (); + } + REAL_VALUE_TO_INT (&lo, &hi, r); result = build_int_cst_wide (NULL_TREE, lo, hi); if (int_fits_type_p (result, itype)) @@ -6660,7 +7182,7 @@ fold_builtin_lround (tree exp) } } - return fold_fixed_mathfn (exp); + return fold_fixed_mathfn (fndecl, arglist); } /* Fold function call to builtin ffs, clz, ctz, popcount and parity @@ -7162,10 +7684,8 @@ fold_builtin_exponent (tree fndecl, tree arglist, NULL_TREE if no simplification can be made. */ static tree -fold_builtin_memcpy (tree exp) +fold_builtin_memcpy (tree fndecl, tree arglist) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree dest, src, len; if (!validate_arglist (arglist, @@ -7954,15 +8474,13 @@ fold_builtin_complex_div (tree type, tree arglist) if no simplification was possible. */ static tree -fold_builtin_1 (tree exp, bool ignore) +fold_builtin_1 (tree fndecl, tree arglist, bool ignore) { - tree fndecl = get_callee_fndecl (exp); - tree arglist = TREE_OPERAND (exp, 1); tree type = TREE_TYPE (TREE_TYPE (fndecl)); enum built_in_function fcode; if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD) - return targetm.fold_builtin (exp, ignore); + return targetm.fold_builtin (fndecl, arglist, ignore); fcode = DECL_FUNCTION_CODE (fndecl); switch (fcode) @@ -8176,22 +8694,22 @@ fold_builtin_1 (tree exp, bool ignore) case BUILT_IN_FLOOR: case BUILT_IN_FLOORF: case BUILT_IN_FLOORL: - return fold_builtin_floor (exp); + return fold_builtin_floor (fndecl, arglist); case BUILT_IN_CEIL: case BUILT_IN_CEILF: case BUILT_IN_CEILL: - return fold_builtin_ceil (exp); + return fold_builtin_ceil (fndecl, arglist); case BUILT_IN_TRUNC: case BUILT_IN_TRUNCF: case BUILT_IN_TRUNCL: - return fold_builtin_trunc (exp); + return fold_builtin_trunc (fndecl, arglist); case BUILT_IN_ROUND: case BUILT_IN_ROUNDF: case BUILT_IN_ROUNDL: - return fold_builtin_round (exp); + return fold_builtin_round (fndecl, arglist); case BUILT_IN_NEARBYINT: case BUILT_IN_NEARBYINTF: @@ -8199,15 +8717,27 @@ fold_builtin_1 (tree exp, bool ignore) case BUILT_IN_RINT: case BUILT_IN_RINTF: case BUILT_IN_RINTL: - return fold_trunc_transparent_mathfn (exp); - + return fold_trunc_transparent_mathfn (fndecl, arglist); + + case BUILT_IN_LCEIL: + case BUILT_IN_LCEILF: + case BUILT_IN_LCEILL: + case BUILT_IN_LLCEIL: + case BUILT_IN_LLCEILF: + case BUILT_IN_LLCEILL: + case BUILT_IN_LFLOOR: + case BUILT_IN_LFLOORF: + case BUILT_IN_LFLOORL: + case BUILT_IN_LLFLOOR: + case BUILT_IN_LLFLOORF: + case BUILT_IN_LLFLOORL: case BUILT_IN_LROUND: case BUILT_IN_LROUNDF: case BUILT_IN_LROUNDL: case BUILT_IN_LLROUND: case BUILT_IN_LLROUNDF: case BUILT_IN_LLROUNDL: - return fold_builtin_lround (exp); + return fold_builtin_int_roundingfn (fndecl, arglist); case BUILT_IN_LRINT: case BUILT_IN_LRINTF: @@ -8215,7 +8745,7 @@ fold_builtin_1 (tree exp, bool ignore) case BUILT_IN_LLRINT: case BUILT_IN_LLRINTF: case BUILT_IN_LLRINTL: - return fold_fixed_mathfn (exp); + return fold_fixed_mathfn (fndecl, arglist); case BUILT_IN_FFS: case BUILT_IN_FFSL: @@ -8235,7 +8765,7 @@ fold_builtin_1 (tree exp, bool ignore) return fold_builtin_bitop (fndecl, arglist); case BUILT_IN_MEMCPY: - return fold_builtin_memcpy (exp); + return fold_builtin_memcpy (fndecl, arglist); case BUILT_IN_MEMPCPY: return fold_builtin_mempcpy (arglist, type, /*endp=*/1); @@ -8313,9 +8843,9 @@ fold_builtin_1 (tree exp, bool ignore) call node earlier than the warning is generated. */ tree -fold_builtin (tree exp, bool ignore) +fold_builtin (tree fndecl, tree arglist, bool ignore) { - exp = fold_builtin_1 (exp, ignore); + tree exp = fold_builtin_1 (fndecl, arglist, ignore); if (exp) { /* ??? Don't clobber shared nodes such as integer_zero_node. */ @@ -8983,7 +9513,7 @@ fold_builtin_next_arg (tree arglist) { /* Evidently an out of date version of ; can't validate va_start's second argument, but can still work as intended. */ - warning ("%<__builtin_next_arg%> called without an argument"); + warning (0, "%<__builtin_next_arg%> called without an argument"); return true; } /* We use __builtin_va_start (ap, 0, 0) or __builtin_next_arg (0, 0) @@ -9018,7 +9548,7 @@ fold_builtin_next_arg (tree arglist) argument. We just warn and set the arg to be the last argument so that we will get wrong-code because of it. */ - warning ("second parameter of % not last named argument"); + warning (0, "second parameter of % not last named argument"); } /* We want to verify the second parameter just once before the tree optimizers are run and then avoid keeping it in the tree, diff --git a/gcc/builtins.def b/gcc/builtins.def index d324e01a584..134bf98a129 100644 --- a/gcc/builtins.def +++ b/gcc/builtins.def @@ -71,6 +71,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \ false, false, false, ATTRS, true, true) +/* Like DEF_GCC_BUILTIN, except we don't prepend "__builtin_". */ +#undef DEF_SYNC_BUILTIN +#define DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ + DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \ + false, false, false, ATTRS, true, true) + /* A library builtin (like __builtin_strchr) is a builtin equivalent of an ANSI/ISO standard library function. In addition to the `__builtin' version, we will create an ordinary version (e.g, @@ -257,12 +263,24 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_J1L, "j1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_M DEF_EXT_LIB_BUILTIN (BUILT_IN_JN, "jn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_JNF, "jnf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_EXT_LIB_BUILTIN (BUILT_IN_JNL, "jnl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_GCC_BUILTIN (BUILT_IN_LCEIL, "lceil", BT_FN_LONG_DOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LCEILF, "lceilf", BT_FN_LONG_FLOAT, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LCEILL, "lceill", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) DEF_LIB_BUILTIN (BUILT_IN_LDEXP, "ldexp", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPF, "ldexpf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPL, "ldexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_GCC_BUILTIN (BUILT_IN_LFLOOR, "lfloor", BT_FN_LONG_DOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LFLOORF, "lfloorf", BT_FN_LONG_FLOAT, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LFLOORL, "lfloorl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) +DEF_GCC_BUILTIN (BUILT_IN_LLCEIL, "llceil", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LLCEILF, "llceilf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LLCEILL, "llceill", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LLFLOOR, "llfloor", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LLFLOORF, "llfloorf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING) +DEF_GCC_BUILTIN (BUILT_IN_LLFLOORL, "llfloorl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING) DEF_C99_BUILTIN (BUILT_IN_LLRINT, "llrint", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LLRINTF, "llrintf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO) DEF_C99_BUILTIN (BUILT_IN_LLRINTL, "llrintl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO) @@ -462,13 +480,17 @@ DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZ DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_NOTHROW_NONNULL) DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL) DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL) +DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL) DEF_LIB_BUILTIN (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL) @@ -641,3 +663,196 @@ DEF_BUILTIN_STUB (BUILT_IN_STACK_RESTORE, "__builtin_stack_restore") /* Profiling hooks. */ DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter") DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit") + +/* Synchronization Primitives. The "_N" version is the one that the user + is supposed to be using. It's overloaded, and is resolved to one of the + "_1" through "_8" versions, plus some extra casts. */ + +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_N, "__sync_fetch_and_add", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_1, "__sync_fetch_and_add_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_2, "__sync_fetch_and_add_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_4, "__sync_fetch_and_add_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_8, "__sync_fetch_and_add_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_N, "__sync_fetch_and_sub", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_N, "__sync_fetch_and_or", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_1, "__sync_fetch_and_or_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_2, "__sync_fetch_and_or_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_4, "__sync_fetch_and_or_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_8, "__sync_fetch_and_or_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_N, "__sync_fetch_and_and", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_1, "__sync_fetch_and_and_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_2, "__sync_fetch_and_and_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_4, "__sync_fetch_and_and_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_8, "__sync_fetch_and_and_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_N, "__sync_fetch_and_xor", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_N, "__sync_fetch_and_nand", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_N, "__sync_add_and_fetch", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_1, "__sync_add_and_fetch_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_2, "__sync_add_and_fetch_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_4, "__sync_add_and_fetch_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_8, "__sync_add_and_fetch_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_N, "__sync_sub_and_fetch", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_1, "__sync_sub_and_fetch_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_2, "__sync_sub_and_fetch_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_4, "__sync_sub_and_fetch_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_8, "__sync_sub_and_fetch_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_N, "__sync_or_and_fetch", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_1, "__sync_or_and_fetch_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_2, "__sync_or_and_fetch_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_4, "__sync_or_and_fetch_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_8, "__sync_or_and_fetch_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_N, "__sync_and_and_fetch", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_1, "__sync_and_and_fetch_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_2, "__sync_and_and_fetch_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_4, "__sync_and_and_fetch_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_8, "__sync_and_and_fetch_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_N, "__sync_xor_and_fetch", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_1, "__sync_xor_and_fetch_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_2, "__sync_xor_and_fetch_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_4, "__sync_xor_and_fetch_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_8, "__sync_xor_and_fetch_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_N, "__sync_nand_and_fetch", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_1, "__sync_nand_and_fetch_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_2, "__sync_nand_and_fetch_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_4, "__sync_nand_and_fetch_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_8, "__sync_nand_and_fetch_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_N, + "__sync_bool_compare_and_swap", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_1, + "__sync_bool_compare_and_swap_1", + BT_FN_BOOL_VPTR_I1_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_2, + "__sync_bool_compare_and_swap_2", + BT_FN_BOOL_VPTR_I2_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_4, + "__sync_bool_compare_and_swap_4", + BT_FN_BOOL_VPTR_I4_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_8, + "__sync_bool_compare_and_swap_8", + BT_FN_BOOL_VPTR_I8_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_N, + "__sync_val_compare_and_swap", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_1, + "__sync_val_compare_and_swap_1", + BT_FN_I1_VPTR_I1_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_2, + "__sync_val_compare_and_swap_2", + BT_FN_I2_VPTR_I2_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_4, + "__sync_val_compare_and_swap_4", + BT_FN_I4_VPTR_I4_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_8, + "__sync_val_compare_and_swap_8", + BT_FN_I8_VPTR_I8_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_N, "__sync_lock_test_and_set", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1", + BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2", + BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4", + BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8", + BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_N, "__sync_lock_release", + BT_FN_VOID_VAR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_1, "__sync_lock_release_1", + BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_2, "__sync_lock_release_2", + BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_4, "__sync_lock_release_4", + BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST) +DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_8, "__sync_lock_release_8", + BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST) + +DEF_SYNC_BUILTIN (BUILT_IN_SYNCHRONIZE, "__sync_synchronize", + BT_FN_VOID, ATTR_NOTHROW_LIST) diff --git a/gcc/c-common.c b/gcc/c-common.c index 313b554249d..c9027463795 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -191,11 +191,6 @@ cpp_reader *parse_in; /* Declared in c-pragma.h. */ */ tree c_global_trees[CTI_MAX]; - -/* TRUE if a code represents a statement. The front end init - langhook should take care of initialization of this array. */ - -bool statement_code_p[MAX_TREE_CODES]; /* Switches common to the C front ends. */ @@ -284,18 +279,17 @@ int warn_unknown_pragmas; /* Tri state variable. */ int warn_format; +/* Warn about using __null (as NULL in C++) as sentinel. For code compiled + with GCC this doesn't matter as __null is guaranteed to have the right + size. */ + +int warn_strict_null_sentinel; + /* Zero means that faster, ...NonNil variants of objc_msgSend... calls will be used in ObjC; passing nil receivers to such calls will most likely result in crashes. */ int flag_nil_receivers = 1; -/* Nonzero means that we will allow new ObjC exception syntax (@throw, - @try, etc.) in source code. */ -int flag_objc_exceptions = 0; - -/* Nonzero means that we generate NeXT setjmp based exceptions. */ -int flag_objc_sjlj_exceptions = -1; - /* Nonzero means that code generation will be altered to support "zero-link" execution. This currently affects ObjC only, but may affect other languages in the future. */ @@ -913,7 +907,7 @@ overflow_warning (tree value) { TREE_OVERFLOW (value) = 0; if (skip_evaluation == 0) - warning ("integer overflow in expression"); + warning (0, "integer overflow in expression"); } else if ((TREE_CODE (value) == REAL_CST || (TREE_CODE (value) == COMPLEX_CST @@ -922,13 +916,13 @@ overflow_warning (tree value) { TREE_OVERFLOW (value) = 0; if (skip_evaluation == 0) - warning ("floating point overflow in expression"); + warning (0, "floating point overflow in expression"); } else if (TREE_CODE (value) == VECTOR_CST && TREE_OVERFLOW (value)) { TREE_OVERFLOW (value) = 0; if (skip_evaluation == 0) - warning ("vector overflow in expression"); + warning (0, "vector overflow in expression"); } } @@ -950,9 +944,9 @@ unsigned_conversion_warning (tree result, tree operand) { if (!int_fits_type_p (operand, c_common_signed_type (type))) /* This detects cases like converting -129 or 256 to unsigned char. */ - warning ("large integer implicitly truncated to unsigned type"); + warning (0, "large integer implicitly truncated to unsigned type"); else if (warn_conversion) - warning ("negative integer implicitly converted to unsigned type"); + warning (0, "negative integer implicitly converted to unsigned type"); } } @@ -1010,7 +1004,7 @@ convert_and_check (tree type, tree expr) || !constant_fits_type_p (expr, c_common_unsigned_type (type))) && skip_evaluation == 0) - warning ("overflow in implicit constant conversion"); + warning (0, "overflow in implicit constant conversion"); } else unsigned_conversion_warning (t, expr); @@ -1146,8 +1140,7 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list, && DECL_NAME (list->expr)) { warned_ids = new_tlist (warned_ids, written, NULL_TREE); - warning ("operation on %qs may be undefined", - IDENTIFIER_POINTER (DECL_NAME (list->expr))); + warning (0, "operation on %qE may be undefined", list->expr); } list = list->next; } @@ -1412,7 +1405,8 @@ check_case_value (tree value) if (value == NULL_TREE) return value; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ + /* ??? Can we ever get nops here for a valid case value? We + shouldn't for C. */ STRIP_TYPE_NOPS (value); /* In C++, the following is allowed: @@ -1427,15 +1421,14 @@ check_case_value (tree value) value = fold (value); } - if (TREE_CODE (value) != INTEGER_CST - && value != error_mark_node) + if (TREE_CODE (value) == INTEGER_CST) + /* Promote char or short to int. */ + value = perform_integral_promotions (value); + else if (value != error_mark_node) { error ("case label does not reduce to an integer constant"); value = error_mark_node; } - else - /* Promote char or short to int. */ - value = default_conversion (value); constant_expression_warning (value); @@ -1473,7 +1466,7 @@ check_case_bounds (tree type, tree orig_type, if (tree_int_cst_compare (case_low, min_value) < 0 && tree_int_cst_compare (case_high, min_value) < 0) { - warning ("case label value is less than minimum value for type"); + warning (0, "case label value is less than minimum value for type"); return false; } @@ -1481,7 +1474,7 @@ check_case_bounds (tree type, tree orig_type, if (tree_int_cst_compare (case_low, max_value) > 0 && tree_int_cst_compare (case_high, max_value) > 0) { - warning ("case label value exceeds maximum value for type"); + warning (0, "case label value exceeds maximum value for type"); return false; } @@ -1489,7 +1482,7 @@ check_case_bounds (tree type, tree orig_type, if (tree_int_cst_compare (case_high, min_value) >= 0 && tree_int_cst_compare (case_low, min_value) < 0) { - warning ("lower value in case label range" + warning (0, "lower value in case label range" " less than minimum value for type"); case_low = min_value; } @@ -1498,7 +1491,7 @@ check_case_bounds (tree type, tree orig_type, if (tree_int_cst_compare (case_low, max_value) <= 0 && tree_int_cst_compare (case_high, max_value) > 0) { - warning ("upper value in case label range" + warning (0, "upper value in case label range" " exceeds maximum value for type"); case_high = max_value; } @@ -2121,9 +2114,9 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, if (TREE_CODE (primop0) != INTEGER_CST) { if (val == truthvalue_false_node) - warning ("comparison is always false due to limited range of data type"); + warning (0, "comparison is always false due to limited range of data type"); if (val == truthvalue_true_node) - warning ("comparison is always true due to limited range of data type"); + warning (0, "comparison is always true due to limited range of data type"); } if (val != 0) @@ -2193,7 +2186,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, && !(TREE_CODE (primop0) == INTEGER_CST && !TREE_OVERFLOW (convert (c_common_signed_type (type), primop0)))) - warning ("comparison of unsigned expression >= 0 is always true"); + warning (0, "comparison of unsigned expression >= 0 is always true"); value = truthvalue_true_node; break; @@ -2202,7 +2195,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr, && !(TREE_CODE (primop0) == INTEGER_CST && !TREE_OVERFLOW (convert (c_common_signed_type (type), primop0)))) - warning ("comparison of unsigned expression < 0 is always false"); + warning (0, "comparison of unsigned expression < 0 is always false"); value = truthvalue_false_node; break; @@ -2314,7 +2307,9 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) } /* Prepare expr to be an argument of a TRUTH_NOT_EXPR, - or validate its data type for an `if' or `while' statement or ?..: exp. + or for an `if' or `while' statement or ?..: exp. It should already + have been validated to be of suitable type; otherwise, a bad + diagnostic may result. This preparation consists of taking the ordinary representation of an expression expr and producing a valid tree @@ -2327,33 +2322,33 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop) tree c_common_truthvalue_conversion (tree expr) { - if (TREE_CODE (expr) == ERROR_MARK) - return expr; - - if (TREE_CODE (expr) == FUNCTION_DECL) - expr = build_unary_op (ADDR_EXPR, expr, 0); - switch (TREE_CODE (expr)) { case EQ_EXPR: case NE_EXPR: case UNEQ_EXPR: case LTGT_EXPR: case LE_EXPR: case GE_EXPR: case LT_EXPR: case GT_EXPR: case UNLE_EXPR: case UNGE_EXPR: case UNLT_EXPR: case UNGT_EXPR: case ORDERED_EXPR: case UNORDERED_EXPR: + if (TREE_TYPE (expr) == truthvalue_type_node) + return expr; + return build2 (TREE_CODE (expr), truthvalue_type_node, + TREE_OPERAND (expr, 0), TREE_OPERAND (expr, 1)); + case TRUTH_ANDIF_EXPR: case TRUTH_ORIF_EXPR: case TRUTH_AND_EXPR: case TRUTH_OR_EXPR: case TRUTH_XOR_EXPR: - if (TREE_TYPE (expr) != truthvalue_type_node) - return build2 (TREE_CODE (expr), truthvalue_type_node, - TREE_OPERAND (expr, 0), TREE_OPERAND (expr, 1)); - return expr; + if (TREE_TYPE (expr) == truthvalue_type_node) + return expr; + return build2 (TREE_CODE (expr), truthvalue_type_node, + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)), + c_common_truthvalue_conversion (TREE_OPERAND (expr, 1))); case TRUTH_NOT_EXPR: - if (TREE_TYPE (expr) != truthvalue_type_node) - return build1 (TREE_CODE (expr), truthvalue_type_node, - TREE_OPERAND (expr, 0)); - return expr; + if (TREE_TYPE (expr) == truthvalue_type_node) + return expr; + return build1 (TREE_CODE (expr), truthvalue_type_node, + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0))); case ERROR_MARK: return expr; @@ -2369,6 +2364,10 @@ c_common_truthvalue_conversion (tree expr) ? truthvalue_true_node : truthvalue_false_node; + case FUNCTION_DECL: + expr = build_unary_op (ADDR_EXPR, expr, 0); + /* Fall through. */ + case ADDR_EXPR: { if (TREE_CODE (TREE_OPERAND (expr, 0)) == FUNCTION_DECL @@ -2376,7 +2375,7 @@ c_common_truthvalue_conversion (tree expr) { /* Common Ada/Pascal programmer's mistake. We always warn about this since it is so bad. */ - warning ("the address of %qD, will always evaluate as %", + warning (0, "the address of %qD, will always evaluate as %", TREE_OPERAND (expr, 0)); return truthvalue_true_node; } @@ -2397,15 +2396,15 @@ c_common_truthvalue_conversion (tree expr) case COMPLEX_EXPR: return build_binary_op ((TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)) ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR), - lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)), - lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 1)), + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)), + c_common_truthvalue_conversion (TREE_OPERAND (expr, 1)), 0); case NEGATE_EXPR: case ABS_EXPR: case FLOAT_EXPR: /* These don't change whether an object is nonzero or zero. */ - return lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)); + return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)); case LROTATE_EXPR: case RROTATE_EXPR: @@ -2414,16 +2413,16 @@ c_common_truthvalue_conversion (tree expr) if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1))) return build2 (COMPOUND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 1), - lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0))); + c_common_truthvalue_conversion (TREE_OPERAND (expr, 0))); else - return lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)); + return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)); case COND_EXPR: /* Distribute the conversion into the arms of a COND_EXPR. */ return fold (build3 (COND_EXPR, truthvalue_type_node, TREE_OPERAND (expr, 0), - lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 1)), - lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 2)))); + c_common_truthvalue_conversion (TREE_OPERAND (expr, 1)), + c_common_truthvalue_conversion (TREE_OPERAND (expr, 2)))); case CONVERT_EXPR: /* Don't cancel the effect of a CONVERT_EXPR from a REFERENCE_TYPE, @@ -2436,7 +2435,7 @@ c_common_truthvalue_conversion (tree expr) /* If this is widening the argument, we can ignore it. */ if (TYPE_PRECISION (TREE_TYPE (expr)) >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (expr, 0)))) - return lang_hooks.truthvalue_conversion (TREE_OPERAND (expr, 0)); + return c_common_truthvalue_conversion (TREE_OPERAND (expr, 0)); break; case MINUS_EXPR: @@ -2456,12 +2455,12 @@ c_common_truthvalue_conversion (tree expr) two objects. */ if (TREE_TYPE (TREE_OPERAND (expr, 0)) == TREE_TYPE (TREE_OPERAND (expr, 1))) - return build_binary_op (NE_EXPR, TREE_OPERAND (expr, 0), - TREE_OPERAND (expr, 1), 1); - return build_binary_op (NE_EXPR, TREE_OPERAND (expr, 0), - fold (build1 (NOP_EXPR, - TREE_TYPE (TREE_OPERAND (expr, 0)), - TREE_OPERAND (expr, 1))), 1); + return fold_build2 (NE_EXPR, truthvalue_type_node, + TREE_OPERAND (expr, 0), TREE_OPERAND (expr, 1)); + return fold_build2 (NE_EXPR, truthvalue_type_node, + TREE_OPERAND (expr, 0), + fold_convert (TREE_TYPE (TREE_OPERAND (expr, 0)), + TREE_OPERAND (expr, 1))); case BIT_AND_EXPR: if (integer_onep (TREE_OPERAND (expr, 1)) @@ -2472,7 +2471,7 @@ c_common_truthvalue_conversion (tree expr) case MODIFY_EXPR: if (warn_parentheses && !TREE_NO_WARNING (expr)) - warning ("suggest parentheses around assignment used as truth value"); + warning (0, "suggest parentheses around assignment used as truth value"); break; default: @@ -2485,8 +2484,8 @@ c_common_truthvalue_conversion (tree expr) return (build_binary_op ((TREE_SIDE_EFFECTS (expr) ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR), - lang_hooks.truthvalue_conversion (build_unary_op (REALPART_EXPR, t, 0)), - lang_hooks.truthvalue_conversion (build_unary_op (IMAGPART_EXPR, t, 0)), + c_common_truthvalue_conversion (build_unary_op (REALPART_EXPR, t, 0)), + c_common_truthvalue_conversion (build_unary_op (IMAGPART_EXPR, t, 0)), 0)); } @@ -2781,19 +2780,19 @@ c_common_get_alias_set (tree t) second parameter indicates which OPERATOR is being applied. The COMPLAIN flag controls whether we should diagnose possibly ill-formed constructs or not. */ + tree -c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain) +c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain) { const char *op_name; tree value = NULL; enum tree_code type_code = TREE_CODE (type); - gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR); - op_name = op == SIZEOF_EXPR ? "sizeof" : "__alignof__"; + op_name = is_sizeof ? "sizeof" : "__alignof__"; if (type_code == FUNCTION_TYPE) { - if (op == SIZEOF_EXPR) + if (is_sizeof) { if (complain && (pedantic || warn_pointer_arith)) pedwarn ("invalid application of % to a function type"); @@ -2818,7 +2817,7 @@ c_sizeof_or_alignof_type (tree type, enum tree_code op, int complain) } else { - if (op == (enum tree_code) SIZEOF_EXPR) + if (is_sizeof) /* Convert in case a char is more than one unit. */ value = size_binop (CEIL_DIV_EXPR, TYPE_SIZE_UNIT (type), size_int (TYPE_PRECISION (char_type_node) @@ -3237,8 +3236,9 @@ c_common_nodes_and_builtins (void) { \ tree decl; \ \ - gcc_assert (!strncmp (NAME, "__builtin_", \ - strlen ("__builtin_"))); \ + gcc_assert ((!BOTH_P && !FALLBACK_P) \ + || !strncmp (NAME, "__builtin_", \ + strlen ("__builtin_"))); \ \ if (!BOTH_P) \ decl = lang_hooks.builtin_function (NAME, builtin_types[TYPE], \ @@ -3273,6 +3273,11 @@ c_common_nodes_and_builtins (void) mudflap_init (); main_identifier_node = get_identifier ("main"); + + /* Create the built-in __null node. It is important that this is + not shared. */ + null_node = make_node (INTEGER_CST); + TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0); } /* Look up the function in built_in_decls that corresponds to DECL @@ -3510,7 +3515,10 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type, && POINTER_TYPE_P (TREE_TYPE (low_value))) || (high_value && TREE_TYPE (high_value) && POINTER_TYPE_P (TREE_TYPE (high_value)))) - error ("pointers are not permitted as case values"); + { + error ("pointers are not permitted as case values"); + goto error_out; + } /* Case ranges are a GNU extension. */ if (high_value && pedantic) @@ -3539,7 +3547,7 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type, high_value = NULL_TREE; if (low_value && high_value && !tree_int_cst_lt (low_value, high_value)) - warning ("empty range specified"); + warning (0, "empty range specified"); /* See if the case is in range of the type of the original testing expression. If both low_value and high_value are out of range, @@ -3626,7 +3634,7 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type, error_out: /* Add a label so that the back-end doesn't think that the beginning of the switch is unreachable. Note that we do not add a case label, as - that just leads to duplicates and thence to aborts later on. */ + that just leads to duplicates and thence to failure later on. */ if (!cases->root) { tree t = create_artificial_label (); @@ -3658,10 +3666,10 @@ match_case_to_enum_1 (tree key, tree type, tree label) TREE_INT_CST_HIGH (key), TREE_INT_CST_LOW (key)); if (TYPE_NAME (type) == 0) - warning ("%Jcase value %qs not in enumerated type", + warning (0, "%Jcase value %qs not in enumerated type", CASE_LABEL (label), buf); else - warning ("%Jcase value %qs not in enumerated type %qT", + warning (0, "%Jcase value %qs not in enumerated type %qT", CASE_LABEL (label), buf, type); } @@ -3700,35 +3708,25 @@ match_case_to_enum (splay_tree_node node, void *data) return 0; } -/* Handle -Wswitch*. Called from the front end after parsing the switch - construct. */ -/* ??? Should probably be somewhere generic, since other languages besides - C and C++ would want this. We'd want to agree on the data structure, - however, which is a problem. Alternately, we operate on gimplified - switch_exprs, which I don't especially like. At the moment, however, - C/C++ are the only tree-ssa languages that support enumerations at all, +/* Handle -Wswitch*. Called from the front end after parsing the + switch construct. */ +/* ??? Should probably be somewhere generic, since other languages + besides C and C++ would want this. At the moment, however, C/C++ + are the only tree-ssa languages that support enumerations at all, so the point is moot. */ void -c_do_switch_warnings (splay_tree cases, tree switch_stmt) +c_do_switch_warnings (splay_tree cases, location_t switch_location, + tree type, tree cond) { splay_tree_node default_node; - location_t switch_location; - tree type; if (!warn_switch && !warn_switch_enum && !warn_switch_default) return; - if (EXPR_HAS_LOCATION (switch_stmt)) - switch_location = EXPR_LOCATION (switch_stmt); - else - switch_location = input_location; - - type = SWITCH_STMT_TYPE (switch_stmt); - default_node = splay_tree_lookup (cases, (splay_tree_key) NULL); if (warn_switch_default && !default_node) - warning ("%Hswitch missing default case", &switch_location); + warning (0, "%Hswitch missing default case", &switch_location); /* If the switch expression was an enumerated type, check that exactly all enumeration literals are covered by the cases. @@ -3736,7 +3734,7 @@ c_do_switch_warnings (splay_tree cases, tree switch_stmt) default case, or when -Wswitch-enum was specified. */ if (((warn_switch && !default_node) || warn_switch_enum) && type && TREE_CODE (type) == ENUMERAL_TYPE - && TREE_CODE (SWITCH_STMT_COND (switch_stmt)) != INTEGER_CST) + && TREE_CODE (cond) != INTEGER_CST) { tree chain; @@ -3762,7 +3760,7 @@ c_do_switch_warnings (splay_tree cases, tree switch_stmt) { /* Warn if there are enumerators that don't correspond to case expressions. */ - warning ("%Henumeration value %qE not handled in switch", + warning (0, "%Henumeration value %qE not handled in switch", &switch_location, TREE_PURPOSE (chain)); } } @@ -3958,7 +3956,7 @@ handle_packed_attribute (tree *node, tree name, tree ARG_UNUSED (args), that changes what the typedef is typing. */ else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -3977,7 +3975,7 @@ handle_nocommon_attribute (tree *node, tree name, DECL_COMMON (*node) = 0; else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -3995,7 +3993,7 @@ handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args), DECL_COMMON (*node) = 1; else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4022,7 +4020,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args), TYPE_READONLY (TREE_TYPE (type)), 1)); else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4041,7 +4039,7 @@ handle_noinline_attribute (tree *node, tree name, DECL_UNINLINABLE (*node) = 1; else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4064,7 +4062,7 @@ handle_always_inline_attribute (tree *node, tree name, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4088,7 +4086,7 @@ handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args), } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4114,7 +4112,7 @@ handle_unused_attribute (tree *node, tree name, tree ARG_UNUSED (args), TREE_USED (decl) = 1; else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } } @@ -4148,7 +4146,7 @@ handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args), TREE_THIS_VOLATILE (TREE_TYPE (type)))); else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4192,7 +4190,7 @@ handle_transparent_union_attribute (tree *node, tree name, DECL_TRANSPARENT_UNION (decl) = 1; else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4220,7 +4218,7 @@ handle_constructor_attribute (tree *node, tree name, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4248,7 +4246,7 @@ handle_destructor_attribute (tree *node, tree name, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4267,7 +4265,7 @@ handle_mode_attribute (tree *node, tree name, tree args, *no_add_attrs = true; if (TREE_CODE (TREE_VALUE (args)) != IDENTIFIER_NODE) - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); else { int j; @@ -4325,9 +4323,9 @@ handle_mode_attribute (tree *node, tree name, tree args, case MODE_VECTOR_INT: case MODE_VECTOR_FLOAT: - warning ("specifying vector types with __attribute__ ((mode)) " + warning (0, "specifying vector types with __attribute__ ((mode)) " "is deprecated"); - warning ("use __attribute__ ((vector_size)) instead"); + warning (0, "use __attribute__ ((vector_size)) instead"); valid_mode = vector_mode_valid_p (mode); break; @@ -4482,12 +4480,6 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args, else if (TYPE_P (*node)) type = node, is_type = 1; - /* Strip any NOPs of any kind. */ - while (TREE_CODE (align_expr) == NOP_EXPR - || TREE_CODE (align_expr) == CONVERT_EXPR - || TREE_CODE (align_expr) == NON_LVALUE_EXPR) - align_expr = TREE_OPERAND (align_expr, 0); - if (TREE_CODE (align_expr) != INTEGER_CST) { error ("requested alignment is not a constant"); @@ -4598,7 +4590,7 @@ handle_alias_attribute (tree *node, tree name, tree args, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4622,14 +4614,13 @@ handle_visibility_attribute (tree *node, tree name, tree args, { if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE) { - warning ("%qs attribute ignored on non-class types", - IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored on non-class types", name); return NULL_TREE; } } else if (decl_function_context (decl) != 0 || !TREE_PUBLIC (decl)) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); return NULL_TREE; } @@ -4647,7 +4638,7 @@ handle_visibility_attribute (tree *node, tree name, tree args, return NULL_TREE; if (TREE_CODE (decl) == IDENTIFIER_NODE) { - warning ("%qE attribute ignored on types", + warning (0, "%qE attribute ignored on types", name); return NULL_TREE; } @@ -4721,7 +4712,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args, if (!DECL_THREAD_LOCAL (decl)) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } else @@ -4783,12 +4774,12 @@ static tree handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args), int ARG_UNUSED (flags), bool *no_add_attrs) { - if (TREE_CODE (*node) == FUNCTION_DECL) + if (TREE_CODE (*node) == FUNCTION_DECL + && POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (*node)))) DECL_IS_MALLOC (*node) = 1; - /* ??? TODO: Support types. */ else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4806,7 +4797,7 @@ handle_returns_twice_attribute (tree *node, tree name, tree ARG_UNUSED (args), DECL_IS_RETURNS_TWICE (*node) = 1; else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4852,7 +4843,7 @@ handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args), /* ??? TODO: Support types. */ else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -4882,7 +4873,7 @@ handle_deprecated_attribute (tree *node, tree name, { tree type = NULL_TREE; int warn = 0; - const char *what = NULL; + tree what = NULL_TREE; if (DECL_P (*node)) { @@ -4914,17 +4905,15 @@ handle_deprecated_attribute (tree *node, tree name, if (type && TYPE_NAME (type)) { if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - what = IDENTIFIER_POINTER (TYPE_NAME (*node)); + what = 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))); + what = DECL_NAME (TYPE_NAME (type)); } if (what) - warning ("%qs attribute ignored for %qs", - IDENTIFIER_POINTER (name), what); + warning (0, "%qE attribute ignored for %qE", name, what); else - warning ("%qs attribute ignored", - IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); } return NULL_TREE; @@ -4944,15 +4933,11 @@ handle_vector_size_attribute (tree *node, tree name, tree args, *no_add_attrs = true; - /* Stripping NON_LVALUE_EXPR allows declarations such as - typedef short v4si __attribute__((vector_size (4 * sizeof(short)))). */ size = TREE_VALUE (args); - if (TREE_CODE (size) == NON_LVALUE_EXPR) - size = TREE_OPERAND (size, 0); if (!host_integerp (size, 1)) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); return NULL_TREE; } @@ -4981,8 +4966,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, && GET_MODE_CLASS (orig_mode) != MODE_INT) || !host_integerp (TYPE_SIZE_UNIT (type), 1)) { - error ("invalid vector type for attribute %qs", - IDENTIFIER_POINTER (name)); + error ("invalid vector type for attribute %qE", name); return NULL_TREE; } @@ -5115,7 +5099,7 @@ check_function_sentinel (tree attrs, tree params) if (attr) { if (!params) - warning ("missing sentinel in function call"); + warning (0, "missing sentinel in function call"); else { tree sentinel, end; @@ -5124,7 +5108,6 @@ check_function_sentinel (tree attrs, tree params) if (TREE_VALUE (attr)) { tree p = TREE_VALUE (TREE_VALUE (attr)); - STRIP_NOPS (p); pos = TREE_INT_CST_LOW (p); } @@ -5138,7 +5121,7 @@ check_function_sentinel (tree attrs, tree params) } if (pos > 0) { - warning ("not enough arguments to fit a sentinel"); + warning (0, "not enough arguments to fit a sentinel"); return; } @@ -5150,9 +5133,16 @@ check_function_sentinel (tree attrs, tree params) } /* Validate the sentinel. */ - if (!POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (sentinel))) - || !integer_zerop (TREE_VALUE (sentinel))) - warning ("missing sentinel in function call"); + if ((!POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (sentinel))) + || !integer_zerop (TREE_VALUE (sentinel))) + /* Although __null (in C++) is only an integer we allow it + nevertheless, as we are guaranteed that it's exactly + as wide as a pointer, and we don't want to force + users to cast the NULL they have written there. + We warn with -Wstrict-null-sentinel, though. */ + && (warn_strict_null_sentinel + || null_node != TREE_VALUE (sentinel))) + warning (0, "missing sentinel in function call"); } } } @@ -5194,7 +5184,7 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param, return; if (integer_zerop (param)) - warning ("null argument where non-null required (argument %lu)", + warning (0, "null argument where non-null required (argument %lu)", (unsigned long) param_num); } @@ -5204,13 +5194,7 @@ check_nonnull_arg (void * ARG_UNUSED (ctx), tree param, static bool get_nonnull_operand (tree arg_num_expr, unsigned HOST_WIDE_INT *valp) { - /* Strip any conversions from the arg number and verify they - are constants. */ - while (TREE_CODE (arg_num_expr) == NOP_EXPR - || TREE_CODE (arg_num_expr) == CONVERT_EXPR - || TREE_CODE (arg_num_expr) == NON_LVALUE_EXPR) - arg_num_expr = TREE_OPERAND (arg_num_expr, 0); - + /* Verify the arg number is a constant. */ if (TREE_CODE (arg_num_expr) != INTEGER_CST || TREE_INT_CST_HIGH (arg_num_expr) != 0) return false; @@ -5231,7 +5215,7 @@ handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args), /* ??? TODO: Support types. */ else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -5254,7 +5238,7 @@ handle_cleanup_attribute (tree *node, tree name, tree args, we'd be missing too much, since we do have attribute constructor. */ if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl)) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; return NULL_TREE; } @@ -5293,7 +5277,7 @@ handle_warn_unused_result_attribute (tree *node, tree name, /* Ignore the attribute for functions not returning any value. */ if (VOID_TYPE_P (TREE_TYPE (*node))) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute ignored", name); *no_add_attrs = true; } @@ -5310,8 +5294,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, if (!params) { - warning ("%qs attribute requires prototypes with named arguments", - IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute requires prototypes with named arguments", name); *no_add_attrs = true; } else @@ -5321,8 +5304,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, if (VOID_TYPE_P (TREE_VALUE (params))) { - warning ("%qs attribute only applies to variadic functions", - IDENTIFIER_POINTER (name)); + warning (0, "%qE attribute only applies to variadic functions", name); *no_add_attrs = true; } } @@ -5331,17 +5313,16 @@ handle_sentinel_attribute (tree *node, tree name, tree args, { tree position = TREE_VALUE (args); - STRIP_NOPS (position); if (TREE_CODE (position) != INTEGER_CST) { - warning ("requested position is not an integer constant"); + warning (0, "requested position is not an integer constant"); *no_add_attrs = true; } else { if (tree_int_cst_lt (position, integer_zero_node)) { - warning ("requested position is less than zero"); + warning (0, "requested position is less than zero"); *no_add_attrs = true; } } @@ -5409,10 +5390,6 @@ check_function_arguments_recurse (void (*callback) /* Extract the argument number, which was previously checked to be valid. */ format_num_expr = TREE_VALUE (TREE_VALUE (attrs)); - while (TREE_CODE (format_num_expr) == NOP_EXPR - || TREE_CODE (format_num_expr) == CONVERT_EXPR - || TREE_CODE (format_num_expr) == NON_LVALUE_EXPR) - format_num_expr = TREE_OPERAND (format_num_expr, 0); gcc_assert (TREE_CODE (format_num_expr) == INTEGER_CST && !TREE_INT_CST_HIGH (format_num_expr)); @@ -5567,8 +5544,8 @@ c_parse_error (const char *msgid, enum cpp_ttype token, tree value) message = catenate_messages (msgid, " before numeric constant"); else if (token == CPP_NAME) { - message = catenate_messages (msgid, " before %qs"); - error (message, IDENTIFIER_POINTER (value)); + message = catenate_messages (msgid, " before %qE"); + error (message, value); free (message); message = NULL; } @@ -5647,11 +5624,11 @@ c_warn_unused_result (tree *top_p) if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype))) { if (fdecl) - warning ("%Hignoring return value of %qD, " + warning (0, "%Hignoring return value of %qD, " "declared with attribute warn_unused_result", EXPR_LOCUS (t), fdecl); else - warning ("%Hignoring return value of function " + warning (0, "%Hignoring return value of function " "declared with attribute warn_unused_result", EXPR_LOCUS (t)); } @@ -5712,7 +5689,7 @@ fold_offsetof_1 (tree expr) if (DECL_C_BIT_FIELD (t)) { error ("attempt to take address of bit-field structure " - "member %qs", IDENTIFIER_POINTER (DECL_NAME (t))); + "member %qD", t); return error_mark_node; } off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), @@ -5749,40 +5726,301 @@ 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 +/* Print an error message for an invalid lvalue. USE says how the lvalue is being used and so selects the error message. */ +void +lvalue_error (enum lvalue_use use) +{ + switch (use) + { + case lv_assign: + error ("invalid lvalue in assignment"); + break; + case lv_increment: + error ("invalid lvalue in increment"); + break; + case lv_decrement: + error ("invalid lvalue in decrement"); + break; + case lv_addressof: + error ("invalid lvalue in unary %<&%>"); + break; + case lv_asm: + error ("invalid lvalue in asm statement"); + break; + default: + gcc_unreachable (); + } +} + +/* *PTYPE is an incomplete array. Complete it with a domain based on + INITIAL_VALUE. If INITIAL_VALUE is not present, use 1 if DO_DEFAULT + is true. Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, + 2 if INITIAL_VALUE was NULL, and 3 if INITIAL_VALUE was empty. */ + int -lvalue_or_else (tree ref, enum lvalue_use use) +complete_array_type (tree *ptype, tree initial_value, bool do_default) { - int win = lvalue_p (ref); + tree maxindex, type, main_type, elt, unqual_elt; + int failure = 0, quals; - if (!win) + maxindex = size_zero_node; + if (initial_value) { - switch (use) + if (TREE_CODE (initial_value) == STRING_CST) { - case lv_assign: - error ("invalid lvalue in assignment"); - break; - case lv_increment: - error ("invalid lvalue in increment"); - break; - case lv_decrement: - error ("invalid lvalue in decrement"); - break; - case lv_addressof: - error ("invalid lvalue in unary %<&%>"); - break; - case lv_asm: - error ("invalid lvalue in asm statement"); - break; - default: - gcc_unreachable (); + int eltsize + = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value))); + maxindex = size_int (TREE_STRING_LENGTH (initial_value)/eltsize - 1); } + else if (TREE_CODE (initial_value) == CONSTRUCTOR) + { + tree elts = CONSTRUCTOR_ELTS (initial_value); + + if (elts == NULL) + { + if (pedantic) + failure = 3; + maxindex = integer_minus_one_node; + } + else + { + tree curindex; + + if (TREE_PURPOSE (elts)) + maxindex = fold_convert (sizetype, TREE_PURPOSE (elts)); + curindex = maxindex; + + for (elts = TREE_CHAIN (elts); elts; elts = TREE_CHAIN (elts)) + { + if (TREE_PURPOSE (elts)) + curindex = fold_convert (sizetype, TREE_PURPOSE (elts)); + else + curindex = size_binop (PLUS_EXPR, curindex, size_one_node); + + if (tree_int_cst_lt (maxindex, curindex)) + maxindex = curindex; + } + } + } + else + { + /* Make an error message unless that happened already. */ + if (initial_value != error_mark_node) + failure = 1; + } + } + else + { + failure = 2; + if (!do_default) + return failure; } - return win; + type = *ptype; + elt = TREE_TYPE (type); + quals = TYPE_QUALS (strip_array_types (elt)); + if (quals == 0) + unqual_elt = elt; + else + unqual_elt = c_build_qualified_type (elt, TYPE_UNQUALIFIED); + + /* Using build_distinct_type_copy and modifying things afterward instead + of using build_array_type to create a new type preserves all of the + TYPE_LANG_FLAG_? bits that the front end may have set. */ + main_type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); + TREE_TYPE (main_type) = unqual_elt; + TYPE_DOMAIN (main_type) = build_index_type (maxindex); + layout_type (main_type); + + if (quals == 0) + type = main_type; + else + type = c_build_qualified_type (main_type, quals); + + *ptype = type; + return failure; +} + + +/* Used to help initialize the builtin-types.def table. When a type of + the correct size doesn't exist, use error_mark_node instead of NULL. + The later results in segfaults even when a decl using the type doesn't + get invoked. */ + +tree +builtin_type_for_size (int size, bool unsignedp) +{ + tree type = lang_hooks.types.type_for_size (size, unsignedp); + return type ? type : error_mark_node; +} + +/* A helper function for resolve_overloaded_builtin in resolving the + overloaded __sync_ builtins. Returns a positive power of 2 if the + first operand of PARAMS is a pointer to a supported data type. + Returns 0 if an error is encountered. */ + +static int +sync_resolve_size (tree function, tree params) +{ + tree type; + int size; + + if (params == NULL) + { + error ("too few arguments to function %qE", function); + return 0; + } + + type = TREE_TYPE (TREE_VALUE (params)); + if (TREE_CODE (type) != POINTER_TYPE) + goto incompatible; + + type = TREE_TYPE (type); + if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type)) + goto incompatible; + + size = tree_low_cst (TYPE_SIZE_UNIT (type), 1); + if (size == 1 || size == 2 || size == 4 || size == 8) + return size; + + incompatible: + error ("incompatible type for argument %d of %qE", 1, function); + return 0; +} + +/* A helper function for resolve_overloaded_builtin. Adds casts to + PARAMS to make arguments match up with those of FUNCTION. Drops + the variadic arguments at the end. Returns false if some error + was encountered; true on success. */ + +static bool +sync_resolve_params (tree orig_function, tree function, tree params) +{ + tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (function)); + tree ptype; + int number; + + /* We've declared the implementation functions to use "volatile void *" + as the pointer parameter, so we shouldn't get any complaints from the + call to check_function_arguments what ever type the user used. */ + arg_types = TREE_CHAIN (arg_types); + ptype = TREE_TYPE (TREE_TYPE (TREE_VALUE (params))); + number = 2; + + /* For the rest of the values, we need to cast these to FTYPE, so that we + don't get warnings for passing pointer types, etc. */ + while (arg_types != void_list_node) + { + tree val; + + params = TREE_CHAIN (params); + if (params == NULL) + { + error ("too few arguments to function %qE", orig_function); + return false; + } + + /* ??? Ideally for the first conversion we'd use convert_for_assignment + so that we get warnings for anything that doesn't match the pointer + type. This isn't portable across the C and C++ front ends atm. */ + val = TREE_VALUE (params); + val = convert (ptype, val); + val = convert (TREE_VALUE (arg_types), val); + TREE_VALUE (params) = val; + + arg_types = TREE_CHAIN (arg_types); + number++; + } + + /* The definition of these primitives is variadic, with the remaining + being "an optional list of variables protected by the memory barrier". + No clue what that's supposed to mean, precisely, but we consider all + call-clobbered variables to be protected so we're safe. */ + TREE_CHAIN (params) = NULL; + + return true; +} + +/* A helper function for resolve_overloaded_builtin. Adds a cast to + RESULT to make it match the type of the first pointer argument in + PARAMS. */ + +static tree +sync_resolve_return (tree params, tree result) +{ + tree ptype = TREE_TYPE (TREE_TYPE (TREE_VALUE (params))); + return convert (ptype, result); +} + +/* Some builtin functions are placeholders for other expressions. This + function should be called immediately after parsing the call expression + before surrounding code has committed to the type of the expression. + + FUNCTION is the DECL that has been invoked; it is known to be a builtin. + PARAMS is the argument list for the call. The return value is non-null + when expansion is complete, and null if normal processing should + continue. */ + +tree +resolve_overloaded_builtin (tree function, tree params) +{ + enum built_in_function orig_code = DECL_FUNCTION_CODE (function); + switch (DECL_BUILT_IN_CLASS (function)) + { + case BUILT_IN_NORMAL: + break; + case BUILT_IN_MD: + if (targetm.resolve_overloaded_builtin) + return targetm.resolve_overloaded_builtin (function, params); + else + return NULL_TREE; + default: + return NULL_TREE; + } + + /* Handle BUILT_IN_NORMAL here. */ + switch (orig_code) + { + case BUILT_IN_FETCH_AND_ADD_N: + case BUILT_IN_FETCH_AND_SUB_N: + case BUILT_IN_FETCH_AND_OR_N: + case BUILT_IN_FETCH_AND_AND_N: + case BUILT_IN_FETCH_AND_XOR_N: + case BUILT_IN_FETCH_AND_NAND_N: + case BUILT_IN_ADD_AND_FETCH_N: + case BUILT_IN_SUB_AND_FETCH_N: + case BUILT_IN_OR_AND_FETCH_N: + case BUILT_IN_AND_AND_FETCH_N: + case BUILT_IN_XOR_AND_FETCH_N: + case BUILT_IN_NAND_AND_FETCH_N: + case BUILT_IN_BOOL_COMPARE_AND_SWAP_N: + case BUILT_IN_VAL_COMPARE_AND_SWAP_N: + case BUILT_IN_LOCK_TEST_AND_SET_N: + case BUILT_IN_LOCK_RELEASE_N: + { + int n = sync_resolve_size (function, params); + tree new_function, result; + + if (n == 0) + return error_mark_node; + + new_function = built_in_decls[orig_code + exact_log2 (n) + 1]; + if (!sync_resolve_params (function, new_function, params)) + return error_mark_node; + + result = build_function_call (new_function, params); + if (orig_code != BUILT_IN_BOOL_COMPARE_AND_SWAP_N + && orig_code != BUILT_IN_LOCK_RELEASE_N) + result = sync_resolve_return (params, result); + + return result; + } + + default: + return NULL_TREE; + } } #include "gt-c-common.h" diff --git a/gcc/c-common.def b/gcc/c-common.def index 8851aa3eaee..bd6269409d2 100644 --- a/gcc/c-common.def +++ b/gcc/c-common.def @@ -1,5 +1,5 @@ /* This file contains the definitions and documentation for the - additional tree codes used in the GNU C++ compiler (see tree.def + additional tree codes used in the GNU C compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. @@ -22,42 +22,8 @@ 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. */ -/* Tree nodes relevant to both C and C++. These were originally in -cp-tree.def in the cp subdir. */ - -DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_unary, 1) -DEFTREECODE (ARROW_EXPR, "arrow_expr", tcc_expression, 1) -DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_unary, 1) - -/* Used to represent an expression statement. Use `EXPR_STMT_EXPR' to - obtain the expression. */ -DEFTREECODE (EXPR_STMT, "expr_stmt", tcc_expression, 1) - -/* Used to represent a `for' statement. The operands are - FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ -DEFTREECODE (FOR_STMT, "for_stmt", tcc_expression, 4) - -/* Used to represent a 'while' statement. The operands are WHILE_COND - and WHILE_BODY, respectively. */ -DEFTREECODE (WHILE_STMT, "while_stmt", tcc_expression, 2) - -/* Used to represent a 'do' statement. The operands are DO_BODY and - DO_COND, respectively. */ -DEFTREECODE (DO_STMT, "do_stmt", tcc_expression, 2) - -/* Used to represent a 'break' statement. */ -DEFTREECODE (BREAK_STMT, "break_stmt", tcc_expression, 0) - -/* Used to represent a 'continue' statement. */ -DEFTREECODE (CONTINUE_STMT, "continue_stmt", tcc_expression, 0) - -/* Used to represent a 'switch' statement. The operands are - SWITCH_STMT_COND, SWITCH_STMT_BODY and SWITCH_STMT_TYPE, respectively. */ -DEFTREECODE (SWITCH_STMT, "switch_stmt", tcc_expression, 3) - -/* A STMT_EXPR represents a statement-expression. The - STMT_EXPR_STMT is the statement given by the expression. */ -DEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1) +/* Tree nodes used in the C frontend. These are also shared with the + C++ and Objective C frontends. */ /* A COMPOUND_LITERAL_EXPR represents a C99 compound literal. The COMPOUND_LITERAL_EXPR_DECL_STMT is the a DECL_STMT containing the decl diff --git a/gcc/c-common.h b/gcc/c-common.h index 91be602066b..962f157539e 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -30,7 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 0: TREE_NEGATED_INT (in INTEGER_CST). IDENTIFIER_MARKED (used by search routines). DECL_PRETTY_FUNCTION_P (in VAR_DECL) - STMT_EXPR_NO_SCOPE (in STMT_EXPR) 1: C_DECLARED_LABEL_FLAG (in LABEL_DECL) STMT_IS_FULL_EXPR_P (in _STMT) STATEMENT_LIST_STMT_EXPR (in STATEMENT_LIST) @@ -160,6 +159,8 @@ enum c_tree_index CTI_VOID_ZERO, + CTI_NULL, + CTI_MAX }; @@ -204,6 +205,9 @@ struct c_common_identifier GTY(()) /* A node for `((void) 0)'. */ #define void_zero_node c_global_trees[CTI_VOID_ZERO] +/* The node for C++ `__null'. */ +#define null_node c_global_trees[CTI_NULL] + extern GTY(()) tree c_global_trees[CTI_MAX]; /* In a RECORD_TYPE, a sorted array of the fields of the type, not a @@ -218,10 +222,6 @@ struct sorted_fields_type GTY(()) These may be shadowed, and may be referenced from nested functions. */ #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) -/* Flag strings given by __FUNCTION__ and __PRETTY_FUNCTION__ for a - warning if they undergo concatenation. */ -#define C_ARTIFICIAL_STRING_P(NODE) TREE_LANG_FLAG_0 (NODE) - typedef enum c_language_kind { clk_c = 0, /* C90, C94 or C99 */ @@ -575,6 +575,12 @@ extern int flag_threadsafe_statics; extern int warn_implicit; +/* Warn about using __null (as NULL in C++) as sentinel. For code compiled + with GCC this doesn't matter as __null is guaranteed to have the right + size. */ + +extern int warn_strict_null_sentinel; + /* Maximum template instantiation depth. This limit is rather arbitrary, but it exists to limit the time it takes to notice infinite template instantiations. */ @@ -640,7 +646,7 @@ extern tree c_common_signed_type (tree); extern tree c_common_signed_or_unsigned_type (int, tree); extern tree c_common_truthvalue_conversion (tree); extern void c_apply_type_quals_to_decl (int, tree); -extern tree c_sizeof_or_alignof_type (tree, enum tree_code, int); +extern tree c_sizeof_or_alignof_type (tree, bool, int); extern tree c_alignof_expr (tree); /* Print an error message for invalid operands to arith operation CODE. NOP_EXPR is used as a special case (see truthvalue_conversion). */ @@ -653,8 +659,8 @@ extern void overflow_warning (tree); extern void unsigned_conversion_warning (tree, tree); extern bool c_determine_visibility (tree); -#define c_sizeof(T) c_sizeof_or_alignof_type (T, SIZEOF_EXPR, 1) -#define c_alignof(T) c_sizeof_or_alignof_type (T, ALIGNOF_EXPR, 1) +#define c_sizeof(T) c_sizeof_or_alignof_type (T, true, 1) +#define c_alignof(T) c_sizeof_or_alignof_type (T, false, 1) /* Subroutine of build_binary_op, used for comparison operations. See if the operands have both been converted from subword integer types @@ -713,39 +719,6 @@ extern void finish_file (void); #define STATEMENT_LIST_HAS_LABEL(NODE) \ TREE_LANG_FLAG_3 (STATEMENT_LIST_CHECK (NODE)) -/* WHILE_STMT accessors. These give access to the condition of the - while statement and the body of the while statement, respectively. */ -#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) -#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) - -/* DO_STMT accessors. These give access to the condition of the do - statement and the body of the do statement, respectively. */ -#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) -#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) - -/* EXPR_STMT accessor. This gives the expression associated with an - expression statement. */ -#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0) - -/* FOR_STMT accessors. These give access to the init statement, - condition, update expression, and body of the for statement, - respectively. */ -#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0) -#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) -#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) -#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) - -#define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) -#define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) -#define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) - -/* STMT_EXPR accessor. */ -#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) - -/* Nonzero if this statement-expression does not have an associated scope. */ -#define STMT_EXPR_NO_SCOPE(NODE) \ - TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE)) - /* COMPOUND_LITERAL_EXPR accessors. */ #define COMPOUND_LITERAL_EXPR_DECL_STMT(NODE) \ TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0) @@ -762,25 +735,6 @@ enum c_tree_code { #undef DEFTREECODE -#define c_common_stmt_codes \ - EXPR_STMT, FOR_STMT, \ - WHILE_STMT, DO_STMT, \ - BREAK_STMT, CONTINUE_STMT, SWITCH_STMT - -/* TRUE if a code represents a statement. The front end init - langhook should take care of initialization of this array. */ -extern bool statement_code_p[MAX_TREE_CODES]; - -#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)] - -#define INIT_STATEMENT_CODES(STMT_CODES) \ - do { \ - unsigned int i; \ - memset (&statement_code_p, 0, sizeof (statement_code_p)); \ - for (i = 0; i < ARRAY_SIZE (STMT_CODES); i++) \ - statement_code_p[STMT_CODES[i]] = true; \ - } while (0) - extern int stmts_are_full_exprs_p (void); extern int anon_aggr_type_p (tree); @@ -800,16 +754,13 @@ extern void emit_local_var (tree); extern tree do_case (tree, tree); extern tree build_stmt (enum tree_code, ...); extern tree build_case_label (tree, tree, tree); -extern tree build_continue_stmt (void); -extern tree build_break_stmt (void); /* These functions must be defined by each front-end which implements a variant of the C language. They are used in c-common.c. */ extern tree build_unary_op (enum tree_code, tree, int); extern tree build_binary_op (enum tree_code, tree, tree, int); -extern int lvalue_p (tree); -extern tree default_conversion (tree); +extern tree perform_integral_promotions (tree); /* Given two integer or real types, return the type for their sum. Given two compatible ANSI C types, returns the merged type. */ @@ -825,10 +776,12 @@ extern int case_compare (splay_tree_key, splay_tree_key); extern tree c_add_case_label (splay_tree, tree, tree, tree, tree); -extern void c_do_switch_warnings (splay_tree, tree); +extern void c_do_switch_warnings (splay_tree, location_t, tree, tree); extern tree build_function_call (tree, tree); +extern tree resolve_overloaded_builtin (tree, tree); + extern tree finish_label_address_expr (tree); /* Same function prototype, but the C and C++ front ends have @@ -877,7 +830,7 @@ extern void verify_sequence_points (tree); extern tree fold_offsetof (tree); /* Places where an lvalue, or modifiable lvalue, may be required. - Used to select diagnostic messages in lvalue_or_else and + Used to select diagnostic messages in lvalue_error and readonly_error. */ enum lvalue_use { lv_assign, @@ -887,7 +840,11 @@ enum lvalue_use { lv_asm }; -extern int lvalue_or_else (tree, enum lvalue_use); +extern void lvalue_error (enum lvalue_use); + +extern int complete_array_type (tree *, tree, bool); + +extern tree builtin_type_for_size (int, bool); /* In c-gimplify.c */ extern void c_genericize (tree); @@ -902,6 +859,10 @@ extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd, extern void c_common_write_pch (void); extern void c_common_no_more_pch (void); extern void c_common_pch_pragma (cpp_reader *pfile); +extern void c_common_print_pch_checksum (FILE *f); + +/* In *-checksum.c */ +extern const unsigned char executable_checksum[16]; extern void builtin_define_with_value (const char *, const char *, int); extern void c_stddef_cpp_builtins (void); @@ -917,6 +878,7 @@ extern tree objc_is_object_ptr (tree); extern void objc_check_decl (tree); extern int objc_is_reserved_word (tree); extern int objc_comptypes (tree, tree, int); +extern tree objc_rewrite_function_call (tree, tree); extern tree objc_message_selector (void); extern tree objc_lookup_ivar (tree, tree); extern void objc_clear_super_receiver (void); @@ -945,7 +907,7 @@ extern void objc_continue_implementation (void); extern void objc_finish_implementation (void); extern void objc_set_visibility (int); extern void objc_set_method_type (enum tree_code); -extern tree objc_build_method_signature (tree, tree, tree); +extern tree objc_build_method_signature (tree, tree, tree, bool); extern void objc_add_method_declaration (tree); extern void objc_start_method_definition (tree); extern void objc_finish_method_definition (tree); @@ -953,13 +915,14 @@ 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); +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); +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); +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++. */ diff --git a/gcc/c-convert.c b/gcc/c-convert.c index 3067137c372..70e226806ca 100644 --- a/gcc/c-convert.c +++ b/gcc/c-convert.c @@ -1,5 +1,5 @@ /* Language-level data type conversion for GNU C. - Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003, 2004 + Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -33,6 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "flags.h" #include "convert.h" #include "c-common.h" +#include "c-tree.h" #include "langhooks.h" #include "toplev.h" @@ -95,7 +96,7 @@ convert (tree type, tree expr) return fold (convert_to_integer (type, e)); if (code == BOOLEAN_TYPE) { - tree t = lang_hooks.truthvalue_conversion (expr); + tree t = c_objc_common_truthvalue_conversion (expr); if (TREE_CODE (t) == ERROR_MARK) return t; diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index 06904dbb5e5..bb656f46b05 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -328,7 +328,7 @@ c_cpp_builtins (cpp_reader *pfile) if (c_dialect_cxx ()) { - if (SUPPORTS_ONE_ONLY) + if (flag_weak && SUPPORTS_ONE_ONLY) cpp_define (pfile, "__GXX_WEAK__=1"); else cpp_define (pfile, "__GXX_WEAK__=0"); diff --git a/gcc/c-decl.c b/gcc/c-decl.c index eee7b66a7b5..b71838755f8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -98,6 +98,14 @@ static int enum_overflow; static location_t current_function_prototype_locus; +/* Whether this prototype was built-in. */ + +static bool current_function_prototype_built_in; + +/* The argument type information of this prototype. */ + +static tree current_function_prototype_arg_types; + /* The argument information structure for the function currently being defined. */ @@ -527,9 +535,9 @@ c_finish_incomplete_decl (tree decl) && !DECL_EXTERNAL (decl) && TYPE_DOMAIN (type) == 0) { - warning ("%Jarray %qD assumed to have one element", decl, decl); + warning (0, "%Jarray %qD assumed to have one element", decl, decl); - complete_array_type (type, NULL_TREE, 1); + complete_array_type (&TREE_TYPE (decl), NULL_TREE, true); layout_decl (decl, 0); } @@ -559,12 +567,22 @@ objc_mark_locals_volatile (void *enclosing_blk) { for (b = scope->bindings; b; b = b->prev) { - if (TREE_CODE (b->decl) == VAR_DECL - || TREE_CODE (b->decl) == PARM_DECL) + tree decl = b->decl; + + /* Do not mess with variables that are 'static' or (already) + 'volatile'. */ + if (!TREE_THIS_VOLATILE (decl) && !TREE_STATIC (decl) + && (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL)) { - C_DECL_REGISTER (b->decl) = 0; - DECL_REGISTER (b->decl) = 0; - TREE_THIS_VOLATILE (b->decl) = 1; + TREE_TYPE (decl) + = build_qualified_type (TREE_TYPE (decl), + (TYPE_QUALS (TREE_TYPE (decl)) + | TYPE_QUAL_VOLATILE)); + TREE_THIS_VOLATILE (decl) = 1; + TREE_SIDE_EFFECTS (decl) = 1; + DECL_REGISTER (decl) = 0; + C_DECL_REGISTER (decl) = 0; } } @@ -673,6 +691,8 @@ pop_scope (void) bool functionbody = scope->function_body; bool keep = functionbody || scope->keep || scope->bindings; + c_end_vm_scope (scope->depth); + /* If appropriate, create a BLOCK to record the decls for the life of this function. */ block = 0; @@ -730,9 +750,9 @@ pop_scope (void) else if (!TREE_USED (p) && warn_unused_label) { if (DECL_INITIAL (p)) - warning ("%Jlabel %qD defined but not used", p, p); + warning (0, "%Jlabel %qD defined but not used", p, p); else - warning ("%Jlabel %qD declared but not defined", p, p); + warning (0, "%Jlabel %qD declared but not defined", p, p); } /* Labels go in BLOCK_VARS. */ TREE_CHAIN (p) = BLOCK_VARS (block); @@ -781,7 +801,7 @@ pop_scope (void) && !DECL_ARTIFICIAL (p) && scope != file_scope && scope != external_scope) - warning ("%Junused variable %qD", p, p); + warning (0, "%Junused variable %qD", p, p); if (b->inner_comp) { @@ -1043,8 +1063,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) tree newargs, oldargs; int i; - /* ??? Elsewhere TYPE_MAIN_VARIANT is not used in this context. */ -#define END_OF_ARGLIST(t) (TYPE_MAIN_VARIANT (t) == void_type_node) +#define END_OF_ARGLIST(t) ((t) == void_type_node) oldargs = TYPE_ACTUAL_ARG_TYPES (oldtype); newargs = TYPE_ARG_TYPES (newtype); @@ -1052,8 +1071,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) for (;;) { - tree oldargtype = TREE_VALUE (oldargs); - tree newargtype = TREE_VALUE (newargs); + tree oldargtype = TYPE_MAIN_VARIANT (TREE_VALUE (oldargs)); + tree newargtype = TYPE_MAIN_VARIANT (TREE_VALUE (newargs)); if (END_OF_ARGLIST (oldargtype) && END_OF_ARGLIST (newargtype)) break; @@ -1090,7 +1109,7 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype) /* If we get here, no errors were found, but do issue a warning for this poor-style construct. */ - warning ("%Jprototype for %qD follows non-prototype definition", + warning (0, "%Jprototype for %qD follows non-prototype definition", newdecl, newdecl); return true; #undef END_OF_ARGLIST @@ -1151,10 +1170,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, locate_old_decl (olddecl, error); } else if (TREE_PUBLIC (newdecl)) - warning ("%Jbuilt-in function %qD declared as non-function", + warning (0, "%Jbuilt-in function %qD declared as non-function", newdecl, newdecl); else if (warn_shadow) - warning ("%Jdeclaration of %qD shadows a built-in function", + warning (0, "%Jdeclaration of %qD shadows a built-in function", newdecl, newdecl); return false; } @@ -1184,7 +1203,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, /* If types don't match for a built-in, throw away the built-in. No point in calling locate_old_decl here, it won't print anything. */ - warning ("%Jconflicting types for built-in function %qD", + warning (0, "%Jconflicting types for built-in function %qD", newdecl, newdecl); return false; } @@ -1270,7 +1289,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, && !TYPE_ARG_TYPES (TREE_TYPE (newdecl))))) { if (warn_shadow) - warning ("%Jdeclaration of %qD shadows a built-in function", + warning (0, "%Jdeclaration of %qD shadows a built-in function", newdecl, newdecl); /* Discard the old built-in function. */ return false; @@ -1367,7 +1386,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } else if (warn_traditional) { - warning ("%Jnon-static declaration of %qD follows " + warning (0, "%Jnon-static declaration of %qD follows " "static declaration", newdecl, newdecl); warned = true; } @@ -1420,7 +1439,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } else if (warn_traditional) { - warning ("%Jnon-static declaration of %qD follows " + warning (0, "%Jnon-static declaration of %qD follows " "static declaration", newdecl, newdecl); warned = true; } @@ -1469,7 +1488,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, if (DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY_SPECIFIED (olddecl) && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) { - warning ("%Jredeclaration of %qD with different visibility " + warning (0, "%Jredeclaration of %qD with different visibility " "(old visibility preserved)", newdecl, newdecl); warned = true; } @@ -1480,14 +1499,14 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, if (DECL_DECLARED_INLINE_P (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warning ("%Jinline declaration of %qD follows " + warning (0, "%Jinline declaration of %qD follows " "declaration with attribute noinline", newdecl, newdecl); warned = true; } else if (DECL_DECLARED_INLINE_P (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warning ("%Jdeclaration of %qD with attribute noinline follows " + warning (0, "%Jdeclaration of %qD with attribute noinline follows " "inline declaration ", newdecl, newdecl); warned = true; } @@ -1502,13 +1521,13 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, { if (TREE_USED (olddecl)) { - warning ("%J%qD declared inline after being called", + warning (0, "%J%qD declared inline after being called", olddecl, olddecl); warned = true; } else if (DECL_INITIAL (olddecl)) { - warning ("%J%qD declared inline after its definition", + warning (0, "%J%qD declared inline after its definition", olddecl, olddecl); warned = true; } @@ -1552,13 +1571,13 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, && !(TREE_CODE (newdecl) == PARM_DECL && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) { - warning ("%Jredundant redeclaration of %qD", newdecl, newdecl); + warning (0, "%Jredundant redeclaration of %qD", newdecl, newdecl); warned = true; } /* Report location of previous decl/defn in a consistent manner. */ if (warned || pedwarned) - locate_old_decl (olddecl, pedwarned ? pedwarn : warning); + locate_old_decl (olddecl, pedwarned ? pedwarn : warning0); return retval; } @@ -1573,6 +1592,10 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) { int new_is_definition = (TREE_CODE (newdecl) == FUNCTION_DECL && DECL_INITIAL (newdecl) != 0); + int new_is_prototype = (TREE_CODE (newdecl) == FUNCTION_DECL + && TYPE_ARG_TYPES (TREE_TYPE (newdecl)) != 0); + int old_is_prototype = (TREE_CODE (olddecl) == FUNCTION_DECL + && TYPE_ARG_TYPES (TREE_TYPE (olddecl)) != 0); /* For real parm decl following a forward decl, rechain the old decl in its new location and clear TREE_ASM_WRITTEN (it's not a @@ -1646,8 +1669,12 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) if (TREE_DEPRECATED (newdecl)) TREE_DEPRECATED (olddecl) = 1; - /* Keep source location of definition rather than declaration. */ - if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) + /* Keep source location of definition rather than declaration and of + prototype rather than non-prototype unless that prototype is + built-in. */ + if ((DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0) + || (old_is_prototype && !new_is_prototype + && !C_DECL_BUILTIN_PROTOTYPE (olddecl))) DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl); /* Merge the unused-warning information. */ @@ -1763,6 +1790,11 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype) DECL_BUILT_IN_CLASS (newdecl) = DECL_BUILT_IN_CLASS (olddecl); DECL_FUNCTION_CODE (newdecl) = DECL_FUNCTION_CODE (olddecl); C_DECL_DECLARED_BUILTIN (newdecl) = 1; + if (new_is_prototype) + C_DECL_BUILTIN_PROTOTYPE (newdecl) = 0; + else + C_DECL_BUILTIN_PROTOTYPE (newdecl) + = C_DECL_BUILTIN_PROTOTYPE (olddecl); } /* Also preserve various other info from the definition. */ @@ -1864,28 +1896,28 @@ warn_if_shadowing (tree new_decl) if (old_decl == error_mark_node) { - warning ("%Jdeclaration of %qD shadows previous non-variable", + warning (0, "%Jdeclaration of %qD shadows previous non-variable", new_decl, new_decl); break; } else if (TREE_CODE (old_decl) == PARM_DECL) - warning ("%Jdeclaration of %qD shadows a parameter", + warning (0, "%Jdeclaration of %qD shadows a parameter", new_decl, new_decl); else if (DECL_FILE_SCOPE_P (old_decl)) - warning ("%Jdeclaration of %qD shadows a global declaration", + warning (0, "%Jdeclaration of %qD shadows a global declaration", new_decl, new_decl); else if (TREE_CODE (old_decl) == FUNCTION_DECL && DECL_BUILT_IN (old_decl)) { - warning ("%Jdeclaration of %qD shadows a built-in function", + warning (0, "%Jdeclaration of %qD shadows a built-in function", new_decl, new_decl); break; } else - warning ("%Jdeclaration of %qD shadows a previous local", + warning (0, "%Jdeclaration of %qD shadows a previous local", new_decl, new_decl); - warning ("%Jshadowed declaration is here", old_decl); + warning (0, "%Jshadowed declaration is here", old_decl); break; } @@ -1984,6 +2016,12 @@ pushdecl (tree x) || DECL_INITIAL (x) || !DECL_EXTERNAL (x))) DECL_CONTEXT (x) = current_function_decl; + /* If this is of variably modified type, prevent jumping into its + scope. */ + if ((TREE_CODE (x) == VAR_DECL || TREE_CODE (x) == TYPE_DECL) + && variably_modified_type_p (TREE_TYPE (x), NULL_TREE)) + c_begin_vm_scope (scope->depth); + /* Anonymous decls are just inserted in the scope. */ if (!name) { @@ -2001,11 +2039,52 @@ pushdecl (tree x) b = I_SYMBOL_BINDING (name); if (b && B_IN_SCOPE (b, scope)) { + struct c_binding *b_ext, *b_use; + tree type = TREE_TYPE (x); + tree visdecl = b->decl; + tree vistype = TREE_TYPE (visdecl); if (TREE_CODE (TREE_TYPE (x)) == ARRAY_TYPE && COMPLETE_TYPE_P (TREE_TYPE (x))) b->inner_comp = false; - if (duplicate_decls (x, b->decl)) - return b->decl; + b_use = b; + b_ext = b; + /* If this is an external linkage declaration, we should check + for compatibility with the type in the external scope before + setting the type at this scope based on the visible + information only. */ + if (TREE_PUBLIC (x) && TREE_PUBLIC (visdecl)) + { + while (b_ext && !B_IN_EXTERNAL_SCOPE (b_ext)) + b_ext = b_ext->shadowed; + if (b_ext) + { + b_use = b_ext; + if (b_use->type) + TREE_TYPE (b_use->decl) = b_use->type; + } + } + if (duplicate_decls (x, b_use->decl)) + { + if (b_use != b) + { + /* Save the updated type in the external scope and + restore the proper type for this scope. */ + tree thistype; + if (comptypes (vistype, type)) + thistype = composite_type (vistype, type); + else + thistype = TREE_TYPE (b_use->decl); + b_use->type = TREE_TYPE (b_use->decl); + if (TREE_CODE (b_use->decl) == FUNCTION_DECL + && DECL_BUILT_IN (b_use->decl)) + thistype + = build_type_attribute_variant (thistype, + TYPE_ATTRIBUTES + (b_use->type)); + TREE_TYPE (b_use->decl) = thistype; + } + return b_use->decl; + } else goto skip_external_and_shadow_checks; } @@ -2039,7 +2118,7 @@ pushdecl (tree x) if (warn_nested_externs && scope != file_scope && !DECL_IN_SYSTEM_HEADER (x)) - warning ("nested extern declaration of %qD", x); + warning (0, "nested extern declaration of %qD", x); while (b && !B_IN_EXTERNAL_SCOPE (b)) { @@ -2092,7 +2171,15 @@ pushdecl (tree x) && duplicate_decls (x, b->decl)) { tree thistype; - thistype = (vistype ? composite_type (vistype, type) : type); + if (vistype) + { + if (comptypes (vistype, type)) + thistype = composite_type (vistype, type); + else + thistype = TREE_TYPE (b->decl); + } + else + thistype = type; b->type = TREE_TYPE (b->decl); if (TREE_CODE (b->decl) == FUNCTION_DECL && DECL_BUILT_IN (b->decl)) thistype @@ -2194,7 +2281,7 @@ implicit_decl_warning (tree id, tree olddecl) switch (mesg_implicit_function_declaration) { case 0: return; - case 1: diag = warning; break; + case 1: diag = warning0; break; case 2: diag = error; break; default: gcc_unreachable (); } @@ -2260,7 +2347,7 @@ implicitly_declare (tree functionid) (TREE_TYPE (decl))); if (!comptypes (newtype, TREE_TYPE (decl))) { - warning ("incompatible implicit declaration of built-in" + warning (0, "incompatible implicit declaration of built-in" " function %qD", decl); newtype = TREE_TYPE (decl); } @@ -2370,8 +2457,7 @@ lookup_label (tree name) if (current_function_decl == 0) { - error ("label %qs referenced outside of any function", - IDENTIFIER_POINTER (name)); + error ("label %qE referenced outside of any function", name); return 0; } @@ -2413,7 +2499,7 @@ declare_label (tree name) at this scope */ if (b && B_IN_CURRENT_SCOPE (b)) { - error ("duplicate label declaration %qs", IDENTIFIER_POINTER (name)); + error ("duplicate label declaration %qE", name); locate_old_decl (b->decl, error); /* Just use the previous declaration. */ @@ -2441,6 +2527,7 @@ define_label (location_t location, tree name) if there is a containing function with a declared label with the same name. */ tree label = I_LABEL_DECL (name); + struct c_label_list *nlist_se, *nlist_vm; if (label && ((DECL_CONTEXT (label) == current_function_decl @@ -2457,6 +2544,11 @@ define_label (location_t location, tree name) /* The label has been used or declared already in this function, but not defined. Update its location to point to this definition. */ + if (C_DECL_UNDEFINABLE_STMT_EXPR (label)) + error ("%Jjump into statement expression", label); + if (C_DECL_UNDEFINABLE_VM (label)) + error ("%Jjump into scope of identifier with variably modified type", + label); DECL_SOURCE_LOCATION (label) = location; } else @@ -2470,9 +2562,18 @@ define_label (location_t location, tree name) } if (warn_traditional && !in_system_header && lookup_name (name)) - warning ("%Htraditional C lacks a separate namespace for labels, " - "identifier %qs conflicts", &location, - IDENTIFIER_POINTER (name)); + warning (0, "%Htraditional C lacks a separate namespace for labels, " + "identifier %qE conflicts", &location, name); + + nlist_se = XOBNEW (&parser_obstack, struct c_label_list); + nlist_se->next = label_context_stack_se->labels_def; + nlist_se->label = label; + label_context_stack_se->labels_def = nlist_se; + + nlist_vm = XOBNEW (&parser_obstack, struct c_label_list); + nlist_vm->next = label_context_stack_vm->labels_def; + nlist_vm->label = label; + label_context_stack_vm->labels_def = nlist_vm; /* Mark label as having been defined. */ DECL_INITIAL (label) = error_mark_node; @@ -2536,9 +2637,8 @@ void pending_xref_error (void) { if (pending_invalid_xref != 0) - error ("%H%qs defined as wrong kind of tag", - &pending_invalid_xref_location, - IDENTIFIER_POINTER (pending_invalid_xref)); + error ("%H%qE defined as wrong kind of tag", + &pending_invalid_xref_location, pending_invalid_xref); pending_invalid_xref = 0; } @@ -2686,6 +2786,7 @@ builtin_function (const char *name, tree type, int function_code, DECL_LANG_SPECIFIC (decl) = GGC_CNEW (struct lang_decl); DECL_BUILT_IN_CLASS (decl) = cl; DECL_FUNCTION_CODE (decl) = function_code; + C_DECL_BUILTIN_PROTOTYPE (decl) = (TYPE_ARG_TYPES (type) != 0); if (library_name) SET_DECL_ASSEMBLER_NAME (decl, get_identifier (library_name)); @@ -2824,13 +2925,13 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned) if (!warned && !in_system_header && declspecs->storage_class != csc_none) { - warning ("useless storage class specifier in empty declaration"); + warning (0, "useless storage class specifier in empty declaration"); warned = 2; } if (!warned && !in_system_header && declspecs->thread_p) { - warning ("useless %<__thread%> in empty declaration"); + warning (0, "useless %<__thread%> in empty declaration"); warned = 2; } @@ -2838,7 +2939,7 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned) || declspecs->volatile_p || declspecs->restrict_p)) { - warning ("useless type qualifier in empty declaration"); + warning (0, "useless type qualifier in empty declaration"); warned = 2; } @@ -2917,7 +3018,7 @@ build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p, pedwarn ("ISO C90 does not support %<[*]%> array declarators"); } if (vla_unspec_p) - warning ("GCC does not yet properly implement %<[*]%> array declarators"); + warning (0, "GCC does not yet properly implement %<[*]%> array declarators"); return declarator; } @@ -2995,7 +3096,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs, if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL && MAIN_NAME_P (DECL_NAME (decl))) - warning ("%J%qD is usually a function", decl, decl); + warning (0, "%J%qD is usually a function", decl, decl); if (initialized) /* Is it valid for this decl to have an initializer at all? @@ -3116,7 +3217,7 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs, && DECL_DECLARED_INLINE_P (decl) && DECL_UNINLINABLE (decl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl))) - warning ("%Jinline function %qD given attribute noinline", decl, decl); + warning (0, "%Jinline function %qD given attribute noinline", decl, decl); /* Add this decl to the current scope. TEM may equal DECL or it may be a previous decl of the same name. */ @@ -3171,23 +3272,26 @@ finish_decl (tree decl, tree init, tree asmspec_tree) && TYPE_DOMAIN (type) == 0 && TREE_CODE (decl) != TYPE_DECL) { - int do_default + bool do_default = (TREE_STATIC (decl) /* Even if pedantic, an external linkage array may have incomplete type at first. */ ? pedantic && !TREE_PUBLIC (decl) : !DECL_EXTERNAL (decl)); int failure - = complete_array_type (type, DECL_INITIAL (decl), do_default); + = complete_array_type (&TREE_TYPE (decl), DECL_INITIAL (decl), + do_default); /* Get the completed type made by complete_array_type. */ type = TREE_TYPE (decl); - if (failure == 1) - error ("%Jinitializer fails to determine size of %qD", decl, decl); - - else if (failure == 2) + switch (failure) { + case 1: + error ("%Jinitializer fails to determine size of %qD", decl, decl); + break; + + case 2: if (do_default) error ("%Jarray size missing in %qD", decl, decl); /* If a `static' var's size isn't known, @@ -3198,14 +3302,36 @@ finish_decl (tree decl, tree init, tree asmspec_tree) and it will get allocated. */ else if (!pedantic && TREE_STATIC (decl) && !TREE_PUBLIC (decl)) DECL_EXTERNAL (decl) = 1; + break; + + case 3: + error ("%Jzero or negative size array %qD", decl, decl); + break; + + case 0: + /* For global variables, update the copy of the type that + exists in the binding. */ + if (TREE_PUBLIC (decl)) + { + struct c_binding *b_ext = I_SYMBOL_BINDING (DECL_NAME (decl)); + while (b_ext && !B_IN_EXTERNAL_SCOPE (b_ext)) + b_ext = b_ext->shadowed; + if (b_ext) + { + if (b_ext->type) + b_ext->type = composite_type (b_ext->type, type); + else + b_ext->type = type; + } + } + break; + + default: + gcc_unreachable (); } - /* TYPE_MAX_VALUE is always one less than the number of elements - in the array, because we start counting at zero. Therefore, - warn only if the value is less than zero. */ - else if (pedantic && TYPE_DOMAIN (type) != 0 - && tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) < 0) - error ("%Jzero or negative size array %qD", decl, decl); + if (DECL_INITIAL (decl)) + TREE_TYPE (DECL_INITIAL (decl)) = type; layout_decl (decl, 0); } @@ -3259,8 +3385,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) } /* If #pragma weak was used, mark the decl weak now. */ - if (current_scope == file_scope) - maybe_apply_pragma_weak (decl); + maybe_apply_pragma_weak (decl); /* If this is a variable definition, determine its ELF visibility. */ if (TREE_CODE (decl) == VAR_DECL @@ -3289,7 +3414,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree) && TREE_CODE (decl) == VAR_DECL && !C_DECL_REGISTER (decl) && !TREE_STATIC (decl)) - warning ("%Jignoring asm-specifier for non-static local " + warning (0, "%Jignoring asm-specifier for non-static local " "variable %qD", decl, decl); else if (C_DECL_REGISTER (decl)) change_decl_assembler_name (decl, get_identifier (asmspec)); @@ -3494,17 +3619,19 @@ build_compound_literal (tree type, tree init) if (TREE_CODE (type) == ARRAY_TYPE && !COMPLETE_TYPE_P (type)) { - int failure = complete_array_type (type, DECL_INITIAL (decl), 1); - + int failure = complete_array_type (&TREE_TYPE (decl), + DECL_INITIAL (decl), true); gcc_assert (!failure); + + type = TREE_TYPE (decl); + TREE_TYPE (DECL_INITIAL (decl)) = type; } - type = TREE_TYPE (decl); if (type == error_mark_node || !COMPLETE_TYPE_P (type)) return error_mark_node; stmt = build_stmt (DECL_EXPR, decl); - complit = build1 (COMPOUND_LITERAL_EXPR, TREE_TYPE (decl), stmt); + complit = build1 (COMPOUND_LITERAL_EXPR, type, stmt); TREE_SIDE_EFFECTS (complit) = 1; layout_decl (decl, 0); @@ -3530,73 +3657,6 @@ build_compound_literal (tree type, tree init) return complit; } -/* Make TYPE a complete type based on INITIAL_VALUE. - Return 0 if successful, 1 if INITIAL_VALUE can't be deciphered, - 2 if there was no information (in which case assume 1 if DO_DEFAULT). */ - -int -complete_array_type (tree type, tree initial_value, int do_default) -{ - tree maxindex = NULL_TREE; - int value = 0; - - if (initial_value) - { - /* Note MAXINDEX is really the maximum index, - one less than the size. */ - if (TREE_CODE (initial_value) == STRING_CST) - { - int eltsize - = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value))); - maxindex = build_int_cst (NULL_TREE, - (TREE_STRING_LENGTH (initial_value) - / eltsize) - 1); - } - else if (TREE_CODE (initial_value) == CONSTRUCTOR) - { - tree elts = CONSTRUCTOR_ELTS (initial_value); - maxindex = build_int_cst (NULL_TREE, -1); - for (; elts; elts = TREE_CHAIN (elts)) - { - if (TREE_PURPOSE (elts)) - maxindex = TREE_PURPOSE (elts); - else - maxindex = fold (build2 (PLUS_EXPR, integer_type_node, - maxindex, integer_one_node)); - } - } - else - { - /* Make an error message unless that happened already. */ - if (initial_value != error_mark_node) - value = 1; - - /* Prevent further error messages. */ - maxindex = build_int_cst (NULL_TREE, 0); - } - } - - if (!maxindex) - { - if (do_default) - maxindex = build_int_cst (NULL_TREE, 0); - value = 2; - } - - if (maxindex) - { - TYPE_DOMAIN (type) = build_index_type (maxindex); - - gcc_assert (TREE_TYPE (maxindex)); - } - - /* Lay out the type now that we can get the real answer. */ - - layout_type (type); - - return value; -} - /* Determine whether TYPE is a structure with a flexible array member, or a union containing such a structure (possibly recursively). */ @@ -3640,12 +3700,10 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) unsigned HOST_WIDE_INT w; const char *name = orig_name ? orig_name: _(""); - /* Necessary? */ - STRIP_NOPS (*width); - /* Detect and ignore out of range field width and process valid field widths. */ - if (TREE_CODE (*width) != INTEGER_CST) + if (!INTEGRAL_TYPE_P (TREE_TYPE (*width)) + || TREE_CODE (*width) != INTEGER_CST) { error ("bit-field %qs width not an integer constant", name); *width = integer_one_node; @@ -3701,7 +3759,7 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name) if (!lt || w < min_precision (lt->enum_min, TYPE_UNSIGNED (*type)) || w < min_precision (lt->enum_max, TYPE_UNSIGNED (*type))) - warning ("%qs is narrower than values of its type", name); + warning (0, "%qs is narrower than values of its type", name); } } @@ -3919,7 +3977,7 @@ grokdeclarator (const struct c_declarator *declarator, { /* 'extern' with initialization is invalid if not at file scope. */ if (current_scope == file_scope) - warning ("%qs initialized and declared %", name); + warning (0, "%qs initialized and declared %", name); else error ("%qs has both % and initializer", name); } @@ -4232,7 +4290,7 @@ grokdeclarator (const struct c_declarator *declarator, if (VOID_TYPE_P (type) && really_funcdef) pedwarn ("function definition has qualified void return type"); else if (warn_return_type) - warning ("type qualifiers ignored on function return type"); + warning (0, "type qualifiers ignored on function return type"); type = c_build_qualified_type (type, type_quals); } @@ -4393,7 +4451,7 @@ grokdeclarator (const struct c_declarator *declarator, /* We don't yet implement attributes in this context. */ if (array_ptr_attrs != NULL_TREE) - warning ("attributes in parameter array declarator ignored"); + warning (0, "attributes in parameter array declarator ignored"); size_varies = 0; } @@ -4497,7 +4555,7 @@ grokdeclarator (const struct c_declarator *declarator, that the function does not return. */ if ((type_quals & TYPE_QUAL_VOLATILE) && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (decl)))) - warning ("% function returns non-void value"); + warning (0, "% function returns non-void value"); /* Every function declaration is an external reference (DECL_EXTERNAL) except for those which are not at file @@ -4675,7 +4733,7 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag) if (warn_strict_prototypes && arg_types == 0 && !funcdef_flag && !in_system_header) - warning ("function declaration isn%'t a prototype"); + warning (0, "function declaration isn%'t a prototype"); if (arg_types == error_mark_node) return 0; /* don't set TYPE_ARG_TYPES in this case */ @@ -4728,10 +4786,10 @@ grokparms (struct c_arg_info *arg_info, bool funcdef_flag) else if (VOID_TYPE_P (type)) { if (DECL_NAME (parm)) - warning ("%Jparameter %u (%qD) has void type", + warning (0, "%Jparameter %u (%qD) has void type", parm, parmno, parm); else - warning ("%Jparameter %u has void type", + warning (0, "%Jparameter %u has void type", parm, parmno); } } @@ -4866,16 +4924,16 @@ get_parm_info (bool ellipsis) { if (b->id) /* The %s will be one of 'struct', 'union', or 'enum'. */ - warning ("%<%s %E%> declared inside parameter list", + warning (0, "%<%s %E%> declared inside parameter list", keyword, b->id); else /* The %s will be one of 'struct', 'union', or 'enum'. */ - warning ("anonymous %s declared inside parameter list", + warning (0, "anonymous %s declared inside parameter list", keyword); if (!explained_incomplete_types) { - warning ("its scope is only this definition or declaration," + warning (0, "its scope is only this definition or declaration," " which is probably not what you want"); explained_incomplete_types = true; } @@ -5008,18 +5066,16 @@ start_struct (enum tree_code code, tree name) if (TYPE_SIZE (ref)) { if (code == UNION_TYPE) - error ("redefinition of %", IDENTIFIER_POINTER (name)); + error ("redefinition of %", name); else - error ("redefinition of %", IDENTIFIER_POINTER (name)); + error ("redefinition of %", name); } else if (C_TYPE_BEING_DEFINED (ref)) { if (code == UNION_TYPE) - error ("nested redefinition of %", - IDENTIFIER_POINTER (name)); + error ("nested redefinition of %", name); else - error ("nested redefinition of %", - IDENTIFIER_POINTER (name)); + error ("nested redefinition of %", name); } } else @@ -5380,10 +5436,10 @@ finish_struct (tree t, tree fieldlist, tree attributes) make it one, warn and turn off the flag. */ if (TREE_CODE (t) == UNION_TYPE && TYPE_TRANSPARENT_UNION (t) - && TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t))) + && (!TYPE_FIELDS (t) || TYPE_MODE (t) != DECL_MODE (TYPE_FIELDS (t)))) { TYPE_TRANSPARENT_UNION (t) = 0; - warning ("union cannot be made transparent"); + warning (0, "union cannot be made transparent"); } /* If this structure or union completes the type of any previous @@ -5454,14 +5510,14 @@ start_enum (tree name) } if (C_TYPE_BEING_DEFINED (enumtype)) - error ("nested redefinition of %", IDENTIFIER_POINTER (name)); + error ("nested redefinition of %", name); C_TYPE_BEING_DEFINED (enumtype) = 1; if (TYPE_VALUES (enumtype) != 0) { /* This enum is a named one that has been declared already. */ - error ("redeclaration of %", IDENTIFIER_POINTER (name)); + error ("redeclaration of %", name); /* Completely replace its old definition. The old enumerators remain defined, however. */ @@ -5524,7 +5580,7 @@ finish_enum (tree enumtype, tree values, tree attributes) tem = c_common_type_for_size (precision, unsign); if (tem == NULL) { - warning ("enumeration values exceed range of largest integer"); + warning (0, "enumeration values exceed range of largest integer"); tem = long_long_integer_type_node; } } @@ -5628,17 +5684,14 @@ build_enumerator (tree name, tree value) /* Validate and default VALUE. */ - /* Remove no-op casts from the value. */ - if (value) - STRIP_TYPE_NOPS (value); - if (value != 0) { /* Don't issue more errors for error_mark_node (i.e. an undeclared identifier) - just ignore the value expression. */ if (value == error_mark_node) value = 0; - else if (TREE_CODE (value) != INTEGER_CST) + else if (!INTEGRAL_TYPE_P (TREE_TYPE (value)) + || TREE_CODE (value) != INTEGER_CST) { error ("enumerator value for %qE is not an integer constant", name); value = 0; @@ -5707,6 +5760,8 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, { tree decl1, old_decl; tree restype, resdecl; + struct c_label_context_se *nstack_se; + struct c_label_context_vm *nstack_vm; current_function_returns_value = 0; /* Assume, until we see it does. */ current_function_returns_null = 0; @@ -5715,6 +5770,19 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, current_extern_inline = 0; c_switch_stack = NULL; + nstack_se = XOBNEW (&parser_obstack, struct c_label_context_se); + nstack_se->labels_def = NULL; + nstack_se->labels_used = NULL; + nstack_se->next = label_context_stack_se; + label_context_stack_se = nstack_se; + + nstack_vm = XOBNEW (&parser_obstack, struct c_label_context_vm); + nstack_vm->labels_def = NULL; + nstack_vm->labels_used = NULL; + nstack_vm->scope = 0; + nstack_vm->next = label_context_stack_vm; + label_context_stack_vm = nstack_vm; + /* Indicate no valid break/continue context by setting these variables to some non-null, non-label value. We'll notice and emit the proper error message in c_finish_bc_stmt. */ @@ -5732,7 +5800,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, if (DECL_DECLARED_INLINE_P (decl1) && DECL_UNINLINABLE (decl1) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl1))) - warning ("%Jinline function %qD given attribute noinline", decl1, decl1); + warning (0, "%Jinline function %qD given attribute noinline", decl1, decl1); announce_function (decl1); @@ -5755,46 +5823,91 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, /* If this definition isn't a prototype and we had a prototype declaration before, copy the arg type info from that prototype. */ old_decl = lookup_name_in_scope (DECL_NAME (decl1), current_scope); - if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE - && comptypes (TREE_TYPE (TREE_TYPE (decl1)), - TREE_TYPE (TREE_TYPE (old_decl))) - && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0) - { - TREE_TYPE (decl1) = composite_type (TREE_TYPE (old_decl), - TREE_TYPE (decl1)); - current_function_prototype_locus = DECL_SOURCE_LOCATION (old_decl); + current_function_prototype_locus = UNKNOWN_LOCATION; + current_function_prototype_built_in = false; + current_function_prototype_arg_types = NULL_TREE; + if (TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0) + { + if (old_decl != 0 && TREE_CODE (TREE_TYPE (old_decl)) == FUNCTION_TYPE + && comptypes (TREE_TYPE (TREE_TYPE (decl1)), + TREE_TYPE (TREE_TYPE (old_decl)))) + { + TREE_TYPE (decl1) = composite_type (TREE_TYPE (old_decl), + TREE_TYPE (decl1)); + current_function_prototype_locus = DECL_SOURCE_LOCATION (old_decl); + current_function_prototype_built_in + = C_DECL_BUILTIN_PROTOTYPE (old_decl); + current_function_prototype_arg_types + = TYPE_ARG_TYPES (TREE_TYPE (decl1)); + } + if (TREE_PUBLIC (decl1)) + { + /* If there is an external prototype declaration of this + function, record its location but do not copy information + to this decl. This may be an invisible declaration + (built-in or in a scope which has finished) or simply + have more refined argument types than any declaration + found above. */ + struct c_binding *b; + for (b = I_SYMBOL_BINDING (DECL_NAME (decl1)); b; b = b->shadowed) + if (B_IN_SCOPE (b, external_scope)) + break; + if (b) + { + tree ext_decl, ext_type; + ext_decl = b->decl; + ext_type = b->type ? b->type : TREE_TYPE (ext_decl); + if (TREE_CODE (ext_type) == FUNCTION_TYPE + && comptypes (TREE_TYPE (TREE_TYPE (decl1)), + TREE_TYPE (ext_type))) + { + current_function_prototype_locus + = DECL_SOURCE_LOCATION (ext_decl); + current_function_prototype_built_in + = C_DECL_BUILTIN_PROTOTYPE (ext_decl); + current_function_prototype_arg_types + = TYPE_ARG_TYPES (ext_type); + } + } + } } /* Optionally warn of old-fashioned def with no previous prototype. */ if (warn_strict_prototypes + && old_decl != error_mark_node && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0 && C_DECL_ISNT_PROTOTYPE (old_decl)) - warning ("function declaration isn%'t a prototype"); + warning (0, "function declaration isn%'t a prototype"); /* Optionally warn of any global def with no previous prototype. */ else if (warn_missing_prototypes + && old_decl != error_mark_node && TREE_PUBLIC (decl1) && !MAIN_NAME_P (DECL_NAME (decl1)) && C_DECL_ISNT_PROTOTYPE (old_decl)) - warning ("%Jno previous prototype for %qD", decl1, decl1); + warning (0, "%Jno previous prototype for %qD", decl1, decl1); /* Optionally warn of any def with no previous prototype if the function has already been used. */ else if (warn_missing_prototypes - && old_decl != 0 && TREE_USED (old_decl) + && old_decl != 0 + && old_decl != error_mark_node + && TREE_USED (old_decl) && TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0) - warning ("%J%qD was used with no prototype before its definition", + warning (0, "%J%qD was used with no prototype before its definition", decl1, decl1); /* Optionally warn of any global def with no previous declaration. */ else if (warn_missing_declarations && TREE_PUBLIC (decl1) && old_decl == 0 && !MAIN_NAME_P (DECL_NAME (decl1))) - warning ("%Jno previous declaration for %qD", decl1, decl1); + warning (0, "%Jno previous declaration for %qD", decl1, decl1); /* Optionally warn of any def with no previous declaration if the function has already been used. */ else if (warn_missing_declarations - && old_decl != 0 && TREE_USED (old_decl) + && old_decl != 0 + && old_decl != error_mark_node + && TREE_USED (old_decl) && C_DECL_IMPLICIT (old_decl)) - warning ("%J%qD was used with no declaration before its definition", + warning (0, "%J%qD was used with no declaration before its definition", decl1, decl1); /* This is a definition, not a reference. @@ -5932,7 +6045,7 @@ store_parm_decls_newstyle (tree fndecl, const struct c_arg_info *arg_info) its parameter list). */ else if (warn_traditional && !in_system_header && !current_function_scope && arg_info->types != error_mark_node) - warning ("%Jtraditional C rejects ISO C style function definitions", + warning (0, "%Jtraditional C rejects ISO C style function definitions", fndecl); /* Now make all the parameter declarations visible in the function body. @@ -5983,8 +6096,8 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) gcc_assert (TREE_CODE (b->decl) != PARM_DECL || !DECL_WEAK (b->decl)); #endif - if (warn_old_style_definition && !in_system_header) - warning ("%Jold-style function definition", fndecl); + if (!in_system_header) + warning (OPT_Wold_style_definition, "%Jold-style function definition", fndecl); /* Match each formal parameter name with its declaration. Save each decl in the appropriate TREE_PURPOSE slot of the parmids chain. */ @@ -6033,7 +6146,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) if (flag_isoc99) pedwarn ("%Jtype of %qD defaults to %", decl, decl); else if (extra_warnings) - warning ("%Jtype of %qD defaults to %", decl, decl); + warning (0, "%Jtype of %qD defaults to %", decl, decl); } TREE_PURPOSE (parm) = decl; @@ -6096,11 +6209,11 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) set the DECL_ARG_TYPE of each argument according to the type previously specified, and report any mismatches. */ - if (TYPE_ARG_TYPES (TREE_TYPE (fndecl))) + if (current_function_prototype_arg_types) { tree type; for (parm = DECL_ARGUMENTS (fndecl), - type = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); + type = current_function_prototype_arg_types; parm || (type && (TYPE_MAIN_VARIANT (TREE_VALUE (type)) != void_type_node)); parm = TREE_CHAIN (parm), type = TREE_CHAIN (type)) @@ -6108,9 +6221,15 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) if (parm == 0 || type == 0 || TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node) { - error ("number of arguments doesn%'t match prototype"); - error ("%Hprototype declaration", - ¤t_function_prototype_locus); + if (current_function_prototype_built_in) + warning (0, "number of arguments doesn%'t match " + "built-in prototype"); + else + { + error ("number of arguments doesn%'t match prototype"); + error ("%Hprototype declaration", + ¤t_function_prototype_locus); + } break; } /* Type for passing arg must be consistent with that @@ -6137,17 +6256,33 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) if (pedantic) { - pedwarn ("promoted argument %qD " - "doesn%'t match prototype", parm); - pedwarn ("%Hprototype declaration", - ¤t_function_prototype_locus); + /* ??? Is it possible to get here with a + built-in prototype or will it always have + been diagnosed as conflicting with an + old-style definition and discarded? */ + if (current_function_prototype_built_in) + warning (0, "promoted argument %qD " + "doesn%'t match built-in prototype", parm); + else + { + pedwarn ("promoted argument %qD " + "doesn%'t match prototype", parm); + pedwarn ("%Hprototype declaration", + ¤t_function_prototype_locus); + } } } else { - error ("argument %qD doesn%'t match prototype", parm); - error ("%Hprototype declaration", - ¤t_function_prototype_locus); + if (current_function_prototype_built_in) + warning (0, "argument %qD doesn%'t match " + "built-in prototype", parm); + else + { + error ("argument %qD doesn%'t match prototype", parm); + error ("%Hprototype declaration", + ¤t_function_prototype_locus); + } } } } @@ -6290,6 +6425,9 @@ finish_function (void) { tree fndecl = current_function_decl; + label_context_stack_se = label_context_stack_se->next; + label_context_stack_vm = label_context_stack_vm->next; + if (TREE_CODE (fndecl) == FUNCTION_DECL && targetm.calls.promote_prototypes (TREE_TYPE (fndecl))) { @@ -6326,12 +6464,18 @@ finish_function (void) if (flag_isoc99) { tree stmt = c_finish_return (integer_zero_node); +#ifdef USE_MAPPED_LOCATION + /* Hack. We don't want the middle-end to warn that this return + is unreachable, so we mark its location as special. Using + UNKNOWN_LOCATION has the problem that it gets clobbered in + annotate_one_with_locus. A cleaner solution might be to + ensure ! should_carry_locus_p (stmt), but that needs a flag. + */ + SET_EXPR_LOCATION (stmt, BUILTINS_LOCATION); +#else /* Hack. We don't want the middle-end to warn that this return is unreachable, so put the statement on the special line 0. */ -#ifdef USE_MAPPED_LOCATION - SET_EXPR_LOCATION (stmt, UNKNOWN_LOCATION); -#else annotate_with_file_line (stmt, input_filename, 0); #endif } @@ -6347,7 +6491,7 @@ finish_function (void) if (warn_return_type && TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) != VOID_TYPE && !current_function_returns_value && !current_function_returns_null - /* Don't complain if we abort. */ + /* Don't complain if we are no-return. */ && !current_function_returns_abnormally /* Don't warn for main(). */ && !MAIN_NAME_P (DECL_NAME (fndecl)) @@ -6356,14 +6500,17 @@ finish_function (void) /* Normally, with -Wreturn-type, flow will complain. Unless we're an inline function, as we might never be compiled separately. */ && DECL_INLINE (fndecl)) - warning ("no return statement in function returning non-void"); + { + warning (0, "no return statement in function returning non-void"); + TREE_NO_WARNING (fndecl) = 1; + } /* With just -Wextra, complain only if function returns both with and without a value. */ if (extra_warnings && current_function_returns_value && current_function_returns_null) - warning ("this function may return with or without a value"); + warning (0, "this function may return with or without a value"); /* Store the end of the function, so that we get good line number info for the epilogue. */ @@ -6799,7 +6946,7 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual) gcc_unreachable (); } if (dupe && pedantic && !flag_isoc99) - pedwarn ("duplicate %qs", IDENTIFIER_POINTER (qual)); + pedwarn ("duplicate %qE", qual); return specs; } @@ -6950,7 +7097,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec) } if (dupe) - error ("duplicate %qs", IDENTIFIER_POINTER (type)); + error ("duplicate %qE", type); return specs; } @@ -7079,8 +7226,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec) { tree t = lookup_name (type); if (!t || TREE_CODE (t) != TYPE_DECL) - error ("%qs fails to be a typedef or built in type", - IDENTIFIER_POINTER (type)); + error ("%qE fails to be a typedef or built in type", type); else if (TREE_TYPE (t) == error_mark_node) ; else @@ -7112,8 +7258,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) && C_IS_RESERVED_WORD (scspec)); i = C_RID_CODE (scspec); if (extra_warnings && specs->non_sc_seen_p) - warning ("%qs is not at beginning of declaration", - IDENTIFIER_POINTER (scspec)); + warning (0, "%qE is not at beginning of declaration", scspec); switch (i) { case RID_INLINE: @@ -7162,7 +7307,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) if (n != csc_none && n == specs->storage_class) dupe = true; if (dupe) - error ("duplicate %qs", IDENTIFIER_POINTER (scspec)); + error ("duplicate %qE", scspec); if (n != csc_none) { if (specs->storage_class != csc_none && n != specs->storage_class) @@ -7174,8 +7319,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) specs->storage_class = n; if (n != csc_extern && n != csc_static && specs->thread_p) { - error ("%<__thread%> used with %qs", - IDENTIFIER_POINTER (scspec)); + error ("%<__thread%> used with %qE", scspec); specs->thread_p = false; } } diff --git a/gcc/c-dump.c b/gcc/c-dump.c index 6e0d5024644..a308ec98fb1 100644 --- a/gcc/c-dump.c +++ b/gcc/c-dump.c @@ -54,46 +54,6 @@ c_dump_tree (void *dump_info, tree t) dump_string (di, "bitfield"); break; - case BREAK_STMT: - case CONTINUE_STMT: - dump_stmt (di, t); - break; - - case DO_STMT: - dump_stmt (di, t); - dump_child ("body", DO_BODY (t)); - dump_child ("cond", DO_COND (t)); - break; - - case EXPR_STMT: - dump_stmt (di, t); - dump_child ("expr", EXPR_STMT_EXPR (t)); - break; - - case FOR_STMT: - dump_stmt (di, t); - dump_child ("init", FOR_INIT_STMT (t)); - dump_child ("cond", FOR_COND (t)); - dump_child ("expr", FOR_EXPR (t)); - dump_child ("body", FOR_BODY (t)); - break; - - case SWITCH_STMT: - dump_stmt (di, t); - dump_child ("cond", SWITCH_STMT_COND (t)); - dump_child ("body", SWITCH_STMT_BODY (t)); - break; - - case WHILE_STMT: - dump_stmt (di, t); - dump_child ("cond", WHILE_COND (t)); - dump_child ("body", WHILE_BODY (t)); - break; - - case STMT_EXPR: - dump_child ("stmt", STMT_EXPR_STMT (t)); - break; - default: break; } diff --git a/gcc/c-format.c b/gcc/c-format.c index a0ae154ab4f..daa071e61ab 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -1,6 +1,6 @@ /* Check calls to formatted I/O functions (-Wformat). Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -147,17 +147,12 @@ check_format_string (tree argument, unsigned HOST_WIDE_INT format_num, return true; } -/* Strip any conversions from the expression, verify it is a constant, - and store its value. If validated_p is true, abort on errors. +/* Verify EXPR is a constant, and store its value. + If validated_p is true there should be no errors. Returns true on success, false otherwise. */ static bool get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p) { - while (TREE_CODE (expr) == NOP_EXPR - || TREE_CODE (expr) == CONVERT_EXPR - || TREE_CODE (expr) == NON_LVALUE_EXPR) - expr = TREE_OPERAND (expr, 0); - if (TREE_CODE (expr) != INTEGER_CST || TREE_INT_CST_HIGH (expr) != 0) { gcc_assert (!validated_p); @@ -169,12 +164,12 @@ get_constant (tree expr, unsigned HOST_WIDE_INT *value, int validated_p) return true; } -/* Decode the arguments to a "format" attribute into a function_format_info - structure. It is already known that the list is of the right length. - If VALIDATED_P is true, then these attributes have already been validated - and this function will abort if they are erroneous; if false, it - will give an error message. Returns true if the attributes are - successfully decoded, false otherwise. */ +/* Decode the arguments to a "format" attribute into a + function_format_info structure. It is already known that the list + is of the right length. If VALIDATED_P is true, then these + attributes have already been validated and must not be erroneous; + if false, it will give an error message. Returns true if the + attributes are successfully decoded, false otherwise. */ static bool decode_format_attr (tree args, function_format_info *info, int validated_p) @@ -199,7 +194,8 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) if (info->format_type == format_type_error) { gcc_assert (!validated_p); - warning ("%qs is an unrecognized format function type", p); + warning (0, "%qE is an unrecognized format function type", + format_type_id); return false; } } @@ -837,7 +833,7 @@ check_function_format (tree attrs, tree params) break; } if (args != 0) - warning ("function might be possible candidate for %qs format attribute", + warning (0, "function might be possible candidate for %qs format attribute", format_types[info.format_type].name); } } @@ -928,7 +924,7 @@ maybe_read_dollar_number (const char **format, { if (dollar_needed) { - warning ("missing $ operand number in format"); + warning (0, "missing $ operand number in format"); return -1; } else @@ -949,7 +945,7 @@ maybe_read_dollar_number (const char **format, { if (dollar_needed) { - warning ("missing $ operand number in format"); + warning (0, "missing $ operand number in format"); return -1; } else @@ -958,14 +954,14 @@ maybe_read_dollar_number (const char **format, *format = fcp + 1; if (pedantic && !dollar_format_warned) { - warning ("%s does not support %%n$ operand number formats", + warning (0, "%s does not support %%n$ operand number formats", C_STD_NAME (STD_EXT)); dollar_format_warned = 1; } if (overflow_flag || argnum == 0 || (dollar_first_arg_num && argnum > dollar_arguments_count)) { - warning ("operand number out of range in format"); + warning (0, "operand number out of range in format"); return -1; } if (argnum > dollar_max_arg_used) @@ -988,7 +984,7 @@ maybe_read_dollar_number (const char **format, && dollar_arguments_used[argnum - 1] == 1) { dollar_arguments_used[argnum - 1] = 2; - warning ("format argument %d used more than once in %s format", + warning (0, "format argument %d used more than once in %s format", argnum, fki->name); } else @@ -1020,7 +1016,7 @@ avoid_dollar_number (const char *format) format++; if (*format == '$') { - warning ("$ operand number used after format without operand number"); + warning (0, "$ operand number used after format without operand number"); return true; } return false; @@ -1050,7 +1046,7 @@ finish_dollar_format_checking (format_check_results *res, int pointer_gap_ok) || dollar_arguments_pointer_p[i])) found_pointer_gap = true; else - warning ("format argument %d unused before used argument %d in $-style format", + warning (0, "format argument %d unused before used argument %d in $-style format", i + 1, dollar_max_arg_used); } } @@ -1067,10 +1063,10 @@ finish_dollar_format_checking (format_check_results *res, int pointer_gap_ok) /* Retrieve the specification for a format flag. SPEC contains the specifications for format flags for the applicable kind of format. FLAG is the flag in question. If PREDICATES is NULL, the basic - spec for that flag must be retrieved and this function aborts if - it cannot be found. If PREDICATES is not NULL, it is a string listing - possible predicates for the spec entry; if an entry predicated on any - of these is found, it is returned, otherwise NULL is returned. */ + spec for that flag must be retrieved and must exist. If + PREDICATES is not NULL, it is a string listing possible predicates + for the spec entry; if an entry predicated on any of these is + found, it is returned, otherwise NULL is returned. */ static const format_flag_spec * get_flag_spec (const format_flag_spec *spec, int flag, const char *predicates) @@ -1145,7 +1141,7 @@ check_format_info (function_format_info *info, tree params) /* For strftime-like formats, warn for not checking the format string; but there are no arguments to check. */ if (warn_format_nonliteral) - warning ("format not a string literal, format string not checked"); + warning (0, "format not a string literal, format string not checked"); } else if (info->first_arg_num != 0) { @@ -1159,9 +1155,9 @@ check_format_info (function_format_info *info, tree params) ++arg_num; } if (params == 0 && (warn_format_nonliteral || warn_format_security)) - warning ("format not a string literal and no format arguments"); + warning (0, "format not a string literal and no format arguments"); else if (warn_format_nonliteral) - warning ("format not a string literal, argument types not checked"); + warning (0, "format not a string literal, argument types not checked"); } } @@ -1174,20 +1170,20 @@ check_format_info (function_format_info *info, tree params) case of extra format arguments. */ if (res.number_extra_args > 0 && res.number_non_literal == 0 && res.number_other == 0 && warn_format_extra_args) - warning ("too many arguments for format"); + warning (0, "too many arguments for format"); if (res.number_dollar_extra_args > 0 && res.number_non_literal == 0 && res.number_other == 0 && warn_format_extra_args) - warning ("unused arguments in $-style format"); + warning (0, "unused arguments in $-style format"); if (res.number_empty > 0 && res.number_non_literal == 0 && res.number_other == 0 && warn_format_zero_length) - warning ("zero-length %s format string", + warning (0, "zero-length %s format string", format_types[info->format_type].name); if (res.number_wide > 0) - warning ("format is a wide character string"); + warning (0, "format is a wide character string"); if (res.number_unterminated > 0) - warning ("unterminated format string"); + warning (0, "unterminated format string"); } /* Callback from check_function_arguments_recurse to check a @@ -1264,6 +1260,10 @@ check_format_arg (void *ctx, tree format_tree, return; } format_tree = TREE_OPERAND (format_tree, 0); + if (TREE_CODE (format_tree) == ARRAY_REF + && host_integerp (TREE_OPERAND (format_tree, 1), 0) + && (offset += tree_low_cst (TREE_OPERAND (format_tree, 1), 0)) >= 0) + format_tree = TREE_OPERAND (format_tree, 0); if (TREE_CODE (format_tree) == VAR_DECL && TREE_CODE (TREE_TYPE (format_tree)) == ARRAY_TYPE && (array_init = decl_constant_value (format_tree)) != format_tree @@ -1397,7 +1397,7 @@ check_format_info_main (format_check_results *res, if (*format_chars == 0) { if (format_chars - orig_format_chars != format_length) - warning ("embedded %<\\0%> in format"); + warning (0, "embedded %<\\0%> in format"); if (info->first_arg_num != 0 && params != 0 && has_operand_number <= 0) { @@ -1412,7 +1412,7 @@ check_format_info_main (format_check_results *res, continue; if (*format_chars == 0) { - warning ("spurious trailing %<%%%> in format"); + warning (0, "spurious trailing %<%%%> in format"); continue; } if (*format_chars == '%') @@ -1456,7 +1456,7 @@ check_format_info_main (format_check_results *res, *format_chars, NULL); if (strchr (flag_chars, *format_chars) != 0) { - warning ("repeated %s in format", _(s->name)); + warning (0, "repeated %s in format", _(s->name)); } else { @@ -1469,7 +1469,7 @@ check_format_info_main (format_check_results *res, ++format_chars; if (*format_chars == 0) { - warning ("missing fill character at end of strfmon format"); + warning (0, "missing fill character at end of strfmon format"); return; } } @@ -1513,7 +1513,7 @@ check_format_info_main (format_check_results *res, { if (params == 0) { - warning ("too few arguments for format"); + warning (0, "too few arguments for format"); return; } cur_param = TREE_VALUE (params); @@ -1554,7 +1554,7 @@ check_format_info_main (format_check_results *res, } if (found_width && !non_zero_width_char && (fki->flags & (int) FMT_FLAG_ZERO_WIDTH_BAD)) - warning ("zero width in %s format", fki->name); + warning (0, "zero width in %s format", fki->name); if (found_width) { i = strlen (flag_chars); @@ -1572,7 +1572,7 @@ check_format_info_main (format_check_results *res, flag_chars[i++] = fki->left_precision_char; flag_chars[i] = 0; if (!ISDIGIT (*format_chars)) - warning ("empty left precision in %s format", fki->name); + warning (0, "empty left precision in %s format", fki->name); while (ISDIGIT (*format_chars)) ++format_chars; } @@ -1615,7 +1615,7 @@ check_format_info_main (format_check_results *res, { if (params == 0) { - warning ("too few arguments for format"); + warning (0, "too few arguments for format"); return; } cur_param = TREE_VALUE (params); @@ -1645,7 +1645,7 @@ check_format_info_main (format_check_results *res, { if (!(fki->flags & (int) FMT_FLAG_EMPTY_PREC_OK) && !ISDIGIT (*format_chars)) - warning ("empty precision in %s format", fki->name); + warning (0, "empty precision in %s format", fki->name); while (ISDIGIT (*format_chars)) ++format_chars; } @@ -1684,7 +1684,7 @@ check_format_info_main (format_check_results *res, { /* Warn if the length modifier is non-standard. */ if (ADJ_STD (length_chars_std) > C_STD_VER) - warning ("%s does not support the %qs %s length modifier", + warning (0, "%s does not support the %qs %s length modifier", C_STD_NAME (length_chars_std), length_chars, fki->name); } @@ -1700,7 +1700,7 @@ check_format_info_main (format_check_results *res, { const format_flag_spec *s = get_flag_spec (flag_specs, *format_chars, NULL); - warning ("repeated %s in format", _(s->name)); + warning (0, "repeated %s in format", _(s->name)); } else { @@ -1734,7 +1734,7 @@ check_format_info_main (format_check_results *res, || (!(fki->flags & (int) FMT_FLAG_FANCY_PERCENT_OK) && format_char == '%')) { - warning ("conversion lacks type at end of format"); + warning (0, "conversion lacks type at end of format"); continue; } format_chars++; @@ -1745,17 +1745,17 @@ check_format_info_main (format_check_results *res, if (fci->format_chars == 0) { if (ISGRAPH (format_char)) - warning ("unknown conversion type character %qc in format", + warning (0, "unknown conversion type character %qc in format", format_char); else - warning ("unknown conversion type character 0x%x in format", + warning (0, "unknown conversion type character 0x%x in format", format_char); continue; } if (pedantic) { if (ADJ_STD (fci->std) > C_STD_VER) - warning ("%s does not support the %<%%%c%> %s format", + warning (0, "%s does not support the %<%%%c%> %s format", C_STD_NAME (fci->std), format_char, fki->name); } @@ -1771,7 +1771,7 @@ check_format_info_main (format_check_results *res, continue; if (strchr (fci->flag_chars, flag_chars[i]) == 0) { - warning ("%s used with %<%%%c%> %s format", + warning (0, "%s used with %<%%%c%> %s format", _(s->name), format_char, fki->name); d++; continue; @@ -1780,7 +1780,7 @@ check_format_info_main (format_check_results *res, { const format_flag_spec *t; if (ADJ_STD (s->std) > C_STD_VER) - warning ("%s does not support %s", + warning (0, "%s does not support %s", C_STD_NAME (s->std), _(s->long_name)); t = get_flag_spec (flag_specs, flag_chars[i], fci->flags2); if (t != NULL && ADJ_STD (t->std) > ADJ_STD (s->std)) @@ -1789,7 +1789,7 @@ check_format_info_main (format_check_results *res, ? t->long_name : s->long_name); if (ADJ_STD (t->std) > C_STD_VER) - warning ("%s does not support %s with the %<%%%c%> %s format", + warning (0, "%s does not support %s with the %<%%%c%> %s format", C_STD_NAME (t->std), _(long_name), format_char, fki->name); } @@ -1822,21 +1822,21 @@ check_format_info_main (format_check_results *res, if (bad_flag_pairs[i].ignored) { if (bad_flag_pairs[i].predicate != 0) - warning ("%s ignored with %s and %<%%%c%> %s format", + warning (0, "%s ignored with %s and %<%%%c%> %s format", _(s->name), _(t->name), format_char, fki->name); else - warning ("%s ignored with %s in %s format", + warning (0, "%s ignored with %s in %s format", _(s->name), _(t->name), fki->name); } else { if (bad_flag_pairs[i].predicate != 0) - warning ("use of %s and %s together with %<%%%c%> %s format", + warning (0, "use of %s and %s together with %<%%%c%> %s format", _(s->name), _(t->name), format_char, fki->name); else - warning ("use of %s and %s together in %s format", + warning (0, "use of %s and %s together in %s format", _(s->name), _(t->name), fki->name); } } @@ -1855,10 +1855,10 @@ check_format_info_main (format_check_results *res, else if (strchr (fci->flags2, '2') != 0) y2k_level = 2; if (y2k_level == 3) - warning ("%<%%%c%> yields only last 2 digits of year in some locales", + warning (0, "%<%%%c%> yields only last 2 digits of year in some locales", format_char); else if (y2k_level == 2) - warning ("%<%%%c%> yields only last 2 digits of year", format_char); + warning (0, "%<%%%c%> yields only last 2 digits of year", format_char); } if (strchr (fci->flags2, '[') != 0) @@ -1874,7 +1874,7 @@ check_format_info_main (format_check_results *res, ++format_chars; if (*format_chars != ']') /* The end of the format string was reached. */ - warning ("no closing %<]%> for %<%%[%> format"); + warning (0, "no closing %<]%> for %<%%[%> format"); } wanted_type = 0; @@ -1887,14 +1887,14 @@ check_format_info_main (format_check_results *res, wanted_type_std = fci->types[length_chars_val].std; if (wanted_type == 0) { - warning ("use of %qs length modifier with %qc type character", + warning (0, "use of %qs length modifier with %qc type character", length_chars, format_char); /* Heuristic: skip one argument when an invalid length/type combination is encountered. */ arg_num++; if (params == 0) { - warning ("too few arguments for format"); + warning (0, "too few arguments for format"); return; } params = TREE_CHAIN (params); @@ -1908,7 +1908,7 @@ check_format_info_main (format_check_results *res, && ADJ_STD (wanted_type_std) > ADJ_STD (fci->std)) { if (ADJ_STD (wanted_type_std) > C_STD_VER) - warning ("%s does not support the %<%%%s%c%> %s format", + warning (0, "%s does not support the %<%%%s%c%> %s format", C_STD_NAME (wanted_type_std), length_chars, format_char, fki->name); } @@ -1925,9 +1925,9 @@ check_format_info_main (format_check_results *res, if (main_arg_num != 0) { if (suppressed) - warning ("operand number specified with suppressed assignment"); + warning (0, "operand number specified with suppressed assignment"); else - warning ("operand number specified for format taking no argument"); + warning (0, "operand number specified for format taking no argument"); } } else @@ -1944,7 +1944,7 @@ check_format_info_main (format_check_results *res, ++arg_num; if (has_operand_number > 0) { - warning ("missing $ operand number in format"); + warning (0, "missing $ operand number in format"); return; } else @@ -1956,7 +1956,7 @@ check_format_info_main (format_check_results *res, { if (params == 0) { - warning ("too few arguments for format"); + warning (0, "too few arguments for format"); return; } @@ -2069,7 +2069,7 @@ check_format_types (format_wanted_type *types, const char *format_start, && i == 0 && cur_param != 0 && integer_zerop (cur_param)) - warning ("writing through null pointer (argument %d)", + warning (0, "writing through null pointer (argument %d)", arg_num); /* Check for reading through a NULL pointer. */ @@ -2077,7 +2077,7 @@ check_format_types (format_wanted_type *types, const char *format_start, && i == 0 && cur_param != 0 && integer_zerop (cur_param)) - warning ("reading through null pointer (argument %d)", + warning (0, "reading through null pointer (argument %d)", arg_num); if (cur_param != 0 && TREE_CODE (cur_param) == ADDR_EXPR) @@ -2097,7 +2097,7 @@ check_format_types (format_wanted_type *types, const char *format_start, && (CONSTANT_CLASS_P (cur_param) || (DECL_P (cur_param) && TREE_READONLY (cur_param)))))) - warning ("writing into constant object (argument %d)", + warning (0, "writing into constant object (argument %d)", arg_num); /* If there are extra type qualifiers beyond the first @@ -2108,7 +2108,7 @@ check_format_types (format_wanted_type *types, const char *format_start, && (TYPE_READONLY (cur_type) || TYPE_VOLATILE (cur_type) || TYPE_RESTRICT (cur_type))) - warning ("extra type qualifiers in format argument " + warning (0, "extra type qualifiers in format argument " "(argument %d)", arg_num); @@ -2219,20 +2219,20 @@ format_type_warning (const char *descr, const char *format_start, if (wanted_type_name) { if (descr) - warning ("%s should have type %<%s%s%>, but argument %d has type %qT", + warning (0, "%s should have type %<%s%s%>, but argument %d has type %qT", descr, wanted_type_name, p, arg_num, arg_type); else - warning ("format %q.*s expects type %<%s%s%>, but argument %d has type %qT", + warning (0, "format %q.*s expects type %<%s%s%>, but argument %d has type %qT", format_length, format_start, wanted_type_name, p, arg_num, arg_type); } else { if (descr) - warning ("%s should have type %<%T%s%>, but argument %d has type %qT", + warning (0, "%s should have type %<%T%s%>, but argument %d has type %qT", descr, wanted_type, p, arg_num, arg_type); else - warning ("format %q.*s expects type %<%T%s%>, but argument %d has type %qT", + warning (0, "format %q.*s expects type %<%T%s%>, but argument %d has type %qT", format_length, format_start, wanted_type, p, arg_num, arg_type); } } @@ -2240,7 +2240,7 @@ format_type_warning (const char *descr, const char *format_start, /* Given a format_char_info array FCI, and a character C, this function returns the index into the conversion_specs where that specifier's - data is located. If the character isn't found it aborts. */ + data is located. The character must exist. */ static unsigned int find_char_info_specifier_index (const format_char_info *fci, int c) { @@ -2256,8 +2256,7 @@ find_char_info_specifier_index (const format_char_info *fci, int c) /* Given a format_length_info array FLI, and a character C, this function returns the index into the conversion_specs where that - modifier's data is located. If the character isn't found it - aborts. */ + modifier's data is located. The character must exist. */ static unsigned int find_length_info_modifier_index (const format_length_info *fli, int c) { @@ -2289,9 +2288,25 @@ init_dynamic_asm_fprintf_info (void) HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code prior to using that modifier. */ hwi = maybe_get_identifier ("__gcc_host_wide_int__"); + if (!hwi) + { + error ("%<__gcc_host_wide_int__%> is not defined as a type"); + return; + } + hwi = identifier_global_value (hwi); + if (!hwi || TREE_CODE (hwi) != TYPE_DECL) + { + error ("%<__gcc_host_wide_int__%> is not defined as a type"); + return; + } + hwi = DECL_ORIGINAL_TYPE (hwi); gcc_assert (hwi); - hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi)); - gcc_assert (hwi); + if (hwi != long_integer_type_node && hwi != long_long_integer_type_node) + { + error ("%<__gcc_host_wide_int__%> is not defined as %" + " or %"); + return; + } /* Create a new (writable) copy of asm_fprintf_length_specs. */ new_asm_fprintf_length_specs = (format_length_info *) @@ -2335,19 +2350,70 @@ init_dynamic_diag_info (void) However we don't force a hard ICE because we may see only one or the other type. */ if ((loc = maybe_get_identifier ("location_t"))) - loc = TREE_TYPE (identifier_global_value (loc)); + { + loc = identifier_global_value (loc); + if (loc) + { + if (TREE_CODE (loc) != TYPE_DECL) + { + error ("% is not defined as a type"); + loc = 0; + } + else + loc = TREE_TYPE (loc); + } + } /* We need to grab the underlying 'union tree_node' so peek into an extra type level. */ if ((t = maybe_get_identifier ("tree"))) - t = TREE_TYPE (TREE_TYPE (identifier_global_value (t))); + { + t = identifier_global_value (t); + if (t) + { + if (TREE_CODE (t) != TYPE_DECL) + { + error ("% is not defined as a type"); + t = 0; + } + else if (TREE_CODE (TREE_TYPE (t)) != POINTER_TYPE) + { + error ("% is not defined as a pointer type"); + t = 0; + } + else + t = TREE_TYPE (TREE_TYPE (t)); + } + } /* Find the underlying type for HOST_WIDE_INT. For the %w length modifier to work, one must have issued: "typedef HOST_WIDE_INT __gcc_host_wide_int__;" in one's source code prior to using that modifier. */ if ((hwi = maybe_get_identifier ("__gcc_host_wide_int__"))) - hwi = DECL_ORIGINAL_TYPE (identifier_global_value (hwi)); + { + hwi = identifier_global_value (hwi); + if (hwi) + { + if (TREE_CODE (hwi) != TYPE_DECL) + { + error ("%<__gcc_host_wide_int__%> is not defined as a type"); + hwi = 0; + } + else + { + hwi = DECL_ORIGINAL_TYPE (hwi); + gcc_assert (hwi); + if (hwi != long_integer_type_node + && hwi != long_long_integer_type_node) + { + error ("%<__gcc_host_wide_int__%> is not defined" + " as % or %"); + hwi = 0; + } + } + } + } /* Assign the new data for use. */ diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c index fd4ac4ed560..a82c4a6562b 100644 --- a/gcc/c-gimplify.c +++ b/gcc/c-gimplify.c @@ -70,34 +70,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA walk back up, we check that they fit our constraints, and copy them into temporaries if not. */ -/* Local declarations. */ - -enum bc_t { bc_break = 0, bc_continue = 1 }; - -static struct c_gimplify_ctx -{ - /* For handling break and continue. */ - tree current_bc_label; - tree bc_id[2]; -} *ctxp; - -static void -push_context (void) -{ - gcc_assert (!ctxp); - ctxp = (struct c_gimplify_ctx *) xcalloc (1, sizeof (struct c_gimplify_ctx)); - ctxp->bc_id[bc_continue] = get_identifier ("continue"); - ctxp->bc_id[bc_break] = get_identifier ("break"); -} - -static void -pop_context (void) -{ - gcc_assert (ctxp && !ctxp->current_bc_label); - free (ctxp); - ctxp = NULL; -} - /* Gimplification of statement trees. */ /* Convert the tree representation of FNDECL from C frontend trees to @@ -132,9 +104,7 @@ c_genericize (tree fndecl) } /* Go ahead and gimplify for now. */ - push_context (); gimplify_function_tree (fndecl); - pop_context (); /* Dump the genericized tree IR. */ dump_function (TDI_generic, fndecl); @@ -203,275 +173,11 @@ c_build_bind_expr (tree block, tree body) return bind; } -/* Gimplify an EXPR_STMT node. - - STMT is the statement node. - - PRE_P points to the list where side effects that must happen before - STMT should be stored. - - POST_P points to the list where side effects that must happen after - STMT should be stored. */ - -static enum gimplify_status -gimplify_expr_stmt (tree *stmt_p) -{ - tree stmt = EXPR_STMT_EXPR (*stmt_p); - - if (stmt == error_mark_node) - stmt = NULL; - - /* Gimplification of a statement expression will nullify the - statement if all its side effects are moved to *PRE_P and *POST_P. - - In this case we will not want to emit the gimplified statement. - However, we may still want to emit a warning, so we do that before - gimplification. */ - if (stmt && (extra_warnings || warn_unused_value)) - { - if (!TREE_SIDE_EFFECTS (stmt)) - { - if (!IS_EMPTY_STMT (stmt) - && !VOID_TYPE_P (TREE_TYPE (stmt)) - && !TREE_NO_WARNING (stmt)) - warning ("statement with no effect"); - } - else if (warn_unused_value) - warn_if_unused_value (stmt, input_location); - } - - if (stmt == NULL_TREE) - stmt = alloc_stmt_list (); - - *stmt_p = stmt; - - return GS_OK; -} - -/* Begin a scope which can be exited by a break or continue statement. BC - indicates which. - - Just creates a label and pushes it into the current context. */ - -static tree -begin_bc_block (enum bc_t bc) -{ - tree label = create_artificial_label (); - DECL_NAME (label) = ctxp->bc_id[bc]; - TREE_CHAIN (label) = ctxp->current_bc_label; - ctxp->current_bc_label = label; - return label; -} - -/* Finish a scope which can be exited by a break or continue statement. - LABEL was returned from the most recent call to begin_bc_block. BODY is - an expression for the contents of the scope. - - If we saw a break (or continue) in the scope, append a LABEL_EXPR to - body. Otherwise, just forget the label. */ - -static tree -finish_bc_block (tree label, tree body) -{ - gcc_assert (label == ctxp->current_bc_label); - - if (TREE_USED (label)) - { - tree t, sl = NULL; - - /* Clear the name so flow can delete the label. */ - DECL_NAME (label) = NULL_TREE; - t = build1 (LABEL_EXPR, void_type_node, label); - - append_to_statement_list (body, &sl); - append_to_statement_list (t, &sl); - body = sl; - } - - ctxp->current_bc_label = TREE_CHAIN (label); - TREE_CHAIN (label) = NULL_TREE; - return body; -} - -/* Build a GOTO_EXPR to represent a break or continue statement. BC - indicates which. */ - -static tree -build_bc_goto (enum bc_t bc) -{ - tree label; - tree target_name = ctxp->bc_id[bc]; - - /* Look for the appropriate type of label. */ - for (label = ctxp->current_bc_label; - label; - label = TREE_CHAIN (label)) - if (DECL_NAME (label) == target_name) - break; - - if (label == NULL_TREE) - { - if (bc == bc_break) - error ("break statement not within loop or switch"); - else - error ("continue statement not within loop or switch"); - - return NULL_TREE; - } - - /* Mark the label used for finish_bc_block. */ - TREE_USED (label) = 1; - return build1 (GOTO_EXPR, void_type_node, label); -} - -/* Build a generic representation of one of the C loop forms. COND is the - loop condition or NULL_TREE. BODY is the (possibly compound) statement - controlled by the loop. INCR is the increment expression of a for-loop, - or NULL_TREE. COND_IS_FIRST indicates whether the condition is - evaluated before the loop body as in while and for loops, or after the - loop body as in do-while loops. */ - -static tree -gimplify_c_loop (tree cond, tree body, tree incr, bool cond_is_first) -{ - tree top, entry, exit, cont_block, break_block, stmt_list, t; - location_t stmt_locus; - - stmt_locus = input_location; - stmt_list = NULL_TREE; - entry = NULL_TREE; - - break_block = begin_bc_block (bc_break); - cont_block = begin_bc_block (bc_continue); - - /* If condition is zero don't generate a loop construct. */ - if (cond && integer_zerop (cond)) - { - top = NULL_TREE; - exit = NULL_TREE; - if (cond_is_first) - { - t = build_bc_goto (bc_break); - append_to_statement_list (t, &stmt_list); - } - } - else - { - /* If we use a LOOP_EXPR here, we have to feed the whole thing - back through the main gimplifier to lower it. Given that we - have to gimplify the loop body NOW so that we can resolve - break/continue stmts, seems easier to just expand to gotos. */ - top = build1 (LABEL_EXPR, void_type_node, NULL_TREE); - - /* If we have an exit condition, then we build an IF with gotos either - out of the loop, or to the top of it. If there's no exit condition, - then we just build a jump back to the top. */ - exit = build_and_jump (&LABEL_EXPR_LABEL (top)); - if (cond && !integer_nonzerop (cond)) - { - t = build_bc_goto (bc_break); - exit = build3 (COND_EXPR, void_type_node, cond, exit, t); - exit = fold (exit); - gimplify_stmt (&exit); - - if (cond_is_first) - { - if (incr) - { - entry = build1 (LABEL_EXPR, void_type_node, NULL_TREE); - t = build_and_jump (&LABEL_EXPR_LABEL (entry)); - } - else - t = build_bc_goto (bc_continue); - append_to_statement_list (t, &stmt_list); - } - } - } - - gimplify_stmt (&body); - gimplify_stmt (&incr); - - body = finish_bc_block (cont_block, body); - - append_to_statement_list (top, &stmt_list); - append_to_statement_list (body, &stmt_list); - append_to_statement_list (incr, &stmt_list); - append_to_statement_list (entry, &stmt_list); - append_to_statement_list (exit, &stmt_list); - - annotate_all_with_locus (&stmt_list, stmt_locus); - - return finish_bc_block (break_block, stmt_list); -} - -/* Gimplify a FOR_STMT node. Move the stuff in the for-init-stmt into the - prequeue and hand off to gimplify_c_loop. */ - -static enum gimplify_status -gimplify_for_stmt (tree *stmt_p, tree *pre_p) -{ - tree stmt = *stmt_p; - - if (FOR_INIT_STMT (stmt)) - gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); - - *stmt_p = gimplify_c_loop (FOR_COND (stmt), FOR_BODY (stmt), - FOR_EXPR (stmt), 1); - - return GS_ALL_DONE; -} - -/* Gimplify a WHILE_STMT node. */ - -static enum gimplify_status -gimplify_while_stmt (tree *stmt_p) -{ - tree stmt = *stmt_p; - *stmt_p = gimplify_c_loop (WHILE_COND (stmt), WHILE_BODY (stmt), - NULL_TREE, 1); - return GS_ALL_DONE; -} - -/* Gimplify a DO_STMT node. */ - -static enum gimplify_status -gimplify_do_stmt (tree *stmt_p) -{ - tree stmt = *stmt_p; - *stmt_p = gimplify_c_loop (DO_COND (stmt), DO_BODY (stmt), - NULL_TREE, 0); - return GS_ALL_DONE; -} - -/* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ - -static enum gimplify_status -gimplify_switch_stmt (tree *stmt_p) -{ - tree stmt = *stmt_p; - tree break_block, body; - location_t stmt_locus = input_location; - - break_block = begin_bc_block (bc_break); - - body = SWITCH_STMT_BODY (stmt); - if (!body) - body = build_empty_stmt (); - - *stmt_p = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt), - SWITCH_STMT_COND (stmt), body, NULL_TREE); - SET_EXPR_LOCATION (*stmt_p, stmt_locus); - gimplify_stmt (stmt_p); - - *stmt_p = finish_bc_block (break_block, *stmt_p); - return GS_ALL_DONE; -} - /* Gimplification of expression trees. */ -/* Gimplify a C99 compound literal expression. This just means adding the - DECL_EXPR before the current EXPR_STMT and using its anonymous decl - instead. */ +/* Gimplify a C99 compound literal expression. This just means adding + the DECL_EXPR before the current statement and using its anonymous + decl instead. */ static enum gimplify_status gimplify_compound_literal_expr (tree *expr_p, tree *pre_p) @@ -515,29 +221,6 @@ c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED) case COMPOUND_LITERAL_EXPR: return gimplify_compound_literal_expr (expr_p, pre_p); - case FOR_STMT: - return gimplify_for_stmt (expr_p, pre_p); - - case WHILE_STMT: - return gimplify_while_stmt (expr_p); - - case DO_STMT: - return gimplify_do_stmt (expr_p); - - case SWITCH_STMT: - return gimplify_switch_stmt (expr_p); - - case EXPR_STMT: - return gimplify_expr_stmt (expr_p); - - case CONTINUE_STMT: - *expr_p = build_bc_goto (bc_continue); - return GS_ALL_DONE; - - case BREAK_STMT: - *expr_p = build_bc_goto (bc_break); - return GS_ALL_DONE; - default: return GS_UNHANDLED; } diff --git a/gcc/c-lex.c b/gcc/c-lex.c index d7d52a0edda..990d2bee455 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -46,12 +46,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static int header_time, body_time; static splay_tree file_info_tree; -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE TYPE_PRECISION (wchar_type_node) - -/* Number of bytes in a wide character. */ -#define WCHAR_BYTES (WCHAR_TYPE_SIZE / BITS_PER_UNIT) - int pending_lang_change; /* If we need to switch languages - C++ only */ int c_header_level; /* depth in C headers - C++ only */ @@ -257,7 +251,7 @@ fe_file_change (const struct line_map *new_map) if (c_header_level && --c_header_level == 0) { if (new_map->sysp == 2) - warning ("badly nested C headers from preprocessor"); + warning (0, "badly nested C headers from preprocessor"); --pending_lang_change; } #endif @@ -305,7 +299,7 @@ cb_def_pragma (cpp_reader *pfile, source_location loc) name = cpp_token_as_text (pfile, s); } - warning ("%Hignoring #pragma %s %s", &fe_loc, space, name); + warning (0, "%Hignoring #pragma %s %s", &fe_loc, space, name); } } @@ -603,10 +597,10 @@ interpret_integer (const cpp_token *token, unsigned int flags) if (itk_u < itk_unsigned_long) itk_u = itk_unsigned_long; itk = itk_u; - warning ("this decimal constant is unsigned only in ISO C90"); + warning (0, "this decimal constant is unsigned only in ISO C90"); } else if (warn_traditional) - warning ("this decimal constant would be unsigned in ISO C90"); + warning (0, "this decimal constant would be unsigned in ISO C90"); } } } @@ -770,7 +764,7 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string) strs = (cpp_string *) obstack_finish (&str_ob); if (concats && !objc_string && warn_traditional && !in_system_header) - warning ("traditional C rejects string constant concatenation"); + warning (0, "traditional C rejects string constant concatenation"); if ((c_lex_string_translate ? cpp_interpret_string : cpp_interpret_string_notranslate) diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c index 89fb409878e..0dc8f55ddfc 100644 --- a/gcc/c-objc-common.c +++ b/gcc/c-objc-common.c @@ -77,7 +77,7 @@ c_cannot_inline_tree_fn (tree *fnp) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) { if (do_warning) - warning ("%Jfunction %qF can never be inlined because it " + warning (0, "%Jfunction %qF can never be inlined because it " "is suppressed using -fno-inline", fn, fn); goto cannot_inline; } @@ -87,7 +87,7 @@ c_cannot_inline_tree_fn (tree *fnp) if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn)) { if (do_warning) - warning ("%Jfunction %qF can never be inlined because it might not " + warning (0, "%Jfunction %qF can never be inlined because it might not " "be bound within this unit of translation", fn, fn); goto cannot_inline; } @@ -95,7 +95,7 @@ c_cannot_inline_tree_fn (tree *fnp) if (!function_attribute_inlinable_p (fn)) { if (do_warning) - warning ("%Jfunction %qF can never be inlined because it uses " + warning (0, "%Jfunction %qF can never be inlined because it uses " "attributes conflicting with inlining", fn, fn); goto cannot_inline; } @@ -124,12 +124,6 @@ c_warn_unused_global_decl (tree decl) bool c_objc_common_init (void) { - static const enum tree_code stmt_codes[] = { - c_common_stmt_codes - }; - - INIT_STATEMENT_CODES (stmt_codes); - c_init_decl_processing (); if (c_common_init () == false) @@ -230,34 +224,6 @@ c_tree_printer (pretty_printer *pp, text_info *text) return true; } -tree -c_objc_common_truthvalue_conversion (tree expr) -{ - retry: - switch (TREE_CODE (TREE_TYPE (expr))) - { - case ARRAY_TYPE: - expr = default_conversion (expr); - if (TREE_CODE (TREE_TYPE (expr)) != ARRAY_TYPE) - goto retry; - - error ("used array that cannot be converted to pointer where scalar is required"); - return error_mark_node; - - case RECORD_TYPE: - error ("used struct type value where scalar is required"); - return error_mark_node; - - case UNION_TYPE: - error ("used union type value where scalar is required"); - return error_mark_node; - default: - break; - } - - return c_common_truthvalue_conversion (expr); -} - /* In C and ObjC, all decls have "C" linkage. */ bool has_c_linkage (tree decl ATTRIBUTE_UNUSED) diff --git a/gcc/c-objc-common.h b/gcc/c-objc-common.h index 5107dce068d..de8c175c5c2 100644 --- a/gcc/c-objc-common.h +++ b/gcc/c-objc-common.h @@ -52,8 +52,6 @@ extern void c_initialize_diagnostics (diagnostic_context *); #define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable #undef LANG_HOOKS_PARSE_FILE #define LANG_HOOKS_PARSE_FILE c_common_parse_file -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_objc_common_truthvalue_conversion #undef LANG_HOOKS_FINISH_INCOMPLETE_DECL #define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl #undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 731511ab6ee..62fec1a124a 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -477,6 +477,10 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_return_type = value; break; + case OPT_Wstrict_null_sentinel: + warn_strict_null_sentinel = value; + break; + case OPT_Wsystem_headers: cpp_opts->warn_system_headers = value; break; @@ -550,7 +554,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) case OPT_fvtable_thunks: case OPT_fxref: case OPT_fvtable_gc: - warning ("switch %qs is no longer supported", option->opt_text); + warning (0, "switch %qs is no longer supported", option->opt_text); break; case OPT_faccess_control: @@ -663,7 +667,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) break; case OPT_fhandle_exceptions: - warning ("-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"); + warning (0, "-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"); flag_exceptions = value; break; @@ -695,14 +699,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_no_nonansi_builtin = !value; break; - case OPT_fobjc_exceptions: - flag_objc_exceptions = value; - break; - - case OPT_fobjc_sjlj_exceptions: - flag_objc_sjlj_exceptions = value; - break; - case OPT_foperator_names: cpp_opts->operator_names = value; break; @@ -867,6 +863,11 @@ c_common_handle_option (size_t scode, const char *arg, int value) print_struct_values = 1; break; + case OPT_print_pch_checksum: + c_common_print_pch_checksum (stdout); + exit_after_options = true; + break; + case OPT_remap: cpp_opts->remap = 1; break; @@ -979,17 +980,17 @@ c_common_post_options (const char **pfilename) /* Special format checking options don't work without -Wformat; warn if they are used. */ if (warn_format_y2k && !warn_format) - warning ("-Wformat-y2k ignored without -Wformat"); + warning (0, "-Wformat-y2k ignored without -Wformat"); if (warn_format_extra_args && !warn_format) - warning ("-Wformat-extra-args ignored without -Wformat"); + warning (0, "-Wformat-extra-args ignored without -Wformat"); if (warn_format_zero_length && !warn_format) - warning ("-Wformat-zero-length ignored without -Wformat"); + warning (0, "-Wformat-zero-length ignored without -Wformat"); if (warn_format_nonliteral && !warn_format) - warning ("-Wformat-nonliteral ignored without -Wformat"); + warning (0, "-Wformat-nonliteral ignored without -Wformat"); if (warn_format_security && !warn_format) - warning ("-Wformat-security ignored without -Wformat"); + warning (0, "-Wformat-security ignored without -Wformat"); if (warn_missing_format_attribute && !warn_format) - warning ("-Wmissing-format-attribute ignored without -Wformat"); + warning (0, "-Wmissing-format-attribute ignored without -Wformat"); /* C99 requires special handling of complex multiplication and division; -ffast-math and -fcx-limited-range are handled in process_options. */ @@ -1070,6 +1071,9 @@ c_common_init (void) are known. */ cpp_init_iconv (parse_in); + if (version_flag) + c_common_print_pch_checksum (stderr); + if (flag_preprocess_only) { finish_options (); @@ -1096,22 +1100,24 @@ c_common_parse_file (int set_yydebug) yydebug = set_yydebug; #else if (set_yydebug) - warning ("YYDEBUG was not defined at build time, -dy ignored"); + warning (0, "YYDEBUG was not defined at build time, -dy ignored"); #endif i = 0; for (;;) { - /* Start the main input file */ - (*debug_hooks->start_source_file) (0, this_input_filename); + /* Start the main input file, if the debug writer wants it. */ + if (debug_hooks->start_end_main_source_file) + (*debug_hooks->start_source_file) (0, this_input_filename); finish_options (); pch_init (); push_file_scope (); c_parse_file (); finish_file (); pop_file_scope (); - /* And end the main input file. */ - (*debug_hooks->end_source_file) (0); + /* And end the main input file, if the debug writer wants it */ + if (debug_hooks->start_end_main_source_file) + (*debug_hooks->end_source_file) (0); if (++i >= num_in_fnames) break; cpp_undef_all (parse_in); @@ -1300,7 +1306,10 @@ finish_options (void) { size_t i; - cpp_change_file (parse_in, LC_RENAME, _("")); + cb_file_change (parse_in, + linemap_add (&line_table, LC_RENAME, 0, + _(""), 0)); + cpp_init_builtins (parse_in, flag_hosted); c_cpp_builtins (parse_in); @@ -1398,7 +1407,7 @@ void cb_dir_change (cpp_reader * ARG_UNUSED (pfile), const char *dir) { if (!set_src_pwd (dir)) - warning ("too late for # directive to set debug directory"); + warning (0, "too late for # directive to set debug directory"); } /* Set the C 89 standard (with 1994 amendments if C94, without GNU diff --git a/gcc/c-parser.c b/gcc/c-parser.c index fa62475e943..96bab469f41 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -239,9 +239,6 @@ c_parse_init (void) /* A keyword. */ #define CPP_KEYWORD ((enum cpp_ttype) (N_TTYPES + 1)) -/* The number of token types, including C-specific ones. */ -#define N_C_TTYPES ((int) (CPP_KEYWORD + 1)) - /* More information about the type of a CPP_NAME token. */ typedef enum c_id_kind { /* An ordinary identifier. */ @@ -3238,7 +3235,7 @@ c_parser_compound_statement_nostart (c_parser *parser) location_t loc = c_parser_peek_token (parser)->location; if (c_parser_next_token_is (parser, CPP_EOF)) { - parser->error = true; + c_parser_error (parser, "expected declaration or statement"); return; } if (c_parser_next_token_is_keyword (parser, RID_CASE) @@ -3580,7 +3577,8 @@ c_parser_paren_condition (c_parser *parser) if (!c_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) return error_mark_node; loc = c_parser_peek_token (parser)->location; - cond = lang_hooks.truthvalue_conversion (c_parser_expression (parser).value); + cond = c_objc_common_truthvalue_conversion + (c_parser_expression (parser).value); if (EXPR_P (cond)) SET_EXPR_LOCATION (cond, loc); c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, "expected %<)%>"); @@ -3816,7 +3814,7 @@ c_parser_for_statement (c_parser *parser) else { tree ocond = c_parser_expression (parser).value; - cond = lang_hooks.truthvalue_conversion (ocond); + cond = c_objc_common_truthvalue_conversion (ocond); if (EXPR_P (cond)) SET_EXPR_LOCATION (cond, loc); c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>"); @@ -3875,7 +3873,7 @@ c_parser_asm_statement (c_parser *parser) else if (c_parser_next_token_is_keyword (parser, RID_CONST) || c_parser_next_token_is_keyword (parser, RID_RESTRICT)) { - warning ("%E qualifier ignored on asm", + warning (0, "%E qualifier ignored on asm", c_parser_peek_token (parser)->value); quals = NULL_TREE; c_parser_consume_token (parser); @@ -4151,13 +4149,14 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after) pedwarn ("ISO C forbids omitting the middle term of a ?: expression"); /* Make sure first operand is calculated only once. */ exp1.value = save_expr (default_conversion (cond.value)); - cond.value = lang_hooks.truthvalue_conversion (exp1.value); + cond.value = c_objc_common_truthvalue_conversion (exp1.value); skip_evaluation += cond.value == truthvalue_true_node; } else { cond.value - = lang_hooks.truthvalue_conversion (default_conversion (cond.value)); + = c_objc_common_truthvalue_conversion + (default_conversion (cond.value)); skip_evaluation += cond.value == truthvalue_false_node; exp1 = c_parser_expression (parser); skip_evaluation += ((cond.value == truthvalue_true_node) @@ -4394,12 +4393,12 @@ c_parser_binary_expression (c_parser *parser, struct c_expr *after) switch (ocode) { case TRUTH_ANDIF_EXPR: - stack[sp].expr.value = lang_hooks.truthvalue_conversion + stack[sp].expr.value = c_objc_common_truthvalue_conversion (default_conversion (stack[sp].expr.value)); skip_evaluation += stack[sp].expr.value == truthvalue_false_node; break; case TRUTH_ORIF_EXPR: - stack[sp].expr.value = lang_hooks.truthvalue_conversion + stack[sp].expr.value = c_objc_common_truthvalue_conversion (default_conversion (stack[sp].expr.value)); skip_evaluation += stack[sp].expr.value == truthvalue_true_node; break; @@ -4496,66 +4495,45 @@ c_parser_unary_expression (c_parser *parser) { int ext; struct c_expr ret; - ret.original_code = ERROR_MARK; switch (c_parser_peek_token (parser)->type) { case CPP_PLUS_PLUS: c_parser_consume_token (parser); - ret.value - = build_unary_op (PREINCREMENT_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + return parser_build_unary_op (PREINCREMENT_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_MINUS_MINUS: c_parser_consume_token (parser); - ret.value - = build_unary_op (PREDECREMENT_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + return parser_build_unary_op (PREDECREMENT_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_AND: c_parser_consume_token (parser); - ret.value - = build_unary_op (ADDR_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + return parser_build_unary_op (ADDR_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_MULT: c_parser_consume_token (parser); ret.value = build_indirect_ref (c_parser_cast_expression (parser, NULL).value, "unary *"); + ret.original_code = ERROR_MARK; return ret; case CPP_PLUS: c_parser_consume_token (parser); if (!c_dialect_objc () && warn_traditional && !in_system_header) - warning ("traditional C rejects the unary plus operator"); - ret.value - = build_unary_op (CONVERT_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + warning (0, "traditional C rejects the unary plus operator"); + return parser_build_unary_op (CONVERT_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_MINUS: c_parser_consume_token (parser); - ret.value - = build_unary_op (NEGATE_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + return parser_build_unary_op (NEGATE_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_COMPL: c_parser_consume_token (parser); - ret.value - = build_unary_op (BIT_NOT_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + return parser_build_unary_op (BIT_NOT_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_NOT: c_parser_consume_token (parser); - ret.value - = build_unary_op (TRUTH_NOT_EXPR, - c_parser_cast_expression (parser, NULL).value, 0); - overflow_warning (ret.value); - return ret; + return parser_build_unary_op (TRUTH_NOT_EXPR, + c_parser_cast_expression (parser, NULL)); case CPP_AND_AND: /* Refer to the address of a label as a pointer. */ c_parser_consume_token (parser); @@ -4564,14 +4542,14 @@ c_parser_unary_expression (c_parser *parser) ret.value = finish_label_address_expr (c_parser_peek_token (parser)->value); c_parser_consume_token (parser); - return ret; } else { c_parser_error (parser, "expected identifier"); ret.value = error_mark_node; - return ret; } + ret.original_code = ERROR_MARK; + return ret; case CPP_KEYWORD: switch (c_parser_peek_token (parser)->keyword) { @@ -4587,18 +4565,14 @@ c_parser_unary_expression (c_parser *parser) return ret; case RID_REALPART: c_parser_consume_token (parser); - ret.value - = build_unary_op (REALPART_EXPR, - c_parser_cast_expression (parser, NULL).value, - 0); - return ret; + return parser_build_unary_op (REALPART_EXPR, + c_parser_cast_expression (parser, + NULL)); case RID_IMAGPART: c_parser_consume_token (parser); - ret.value - = build_unary_op (IMAGPART_EXPR, - c_parser_cast_expression (parser, NULL).value, - 0); - return ret; + return parser_build_unary_op (IMAGPART_EXPR, + c_parser_cast_expression (parser, + NULL)); default: return c_parser_postfix_expression (parser); } @@ -5019,7 +4993,6 @@ c_parser_postfix_expression (c_parser *parser) tree c; c = fold (e1.value); - STRIP_NOPS (c); if (TREE_CODE (c) != INTEGER_CST) error ("first argument to %<__builtin_choose_expr%> not" " a constant"); @@ -5792,6 +5765,8 @@ c_parser_objc_method_decl (c_parser *parser) tree type = NULL_TREE; tree sel; tree parms = NULL_TREE; + bool ellipsis = false; + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN)) { c_parser_consume_token (parser); @@ -5806,7 +5781,6 @@ c_parser_objc_method_decl (c_parser *parser) { tree tsel = sel; tree list = NULL_TREE; - bool ellipsis; while (true) { tree atype = NULL_TREE, id, keyworddecl; @@ -5836,7 +5810,6 @@ c_parser_objc_method_decl (c_parser *parser) method parameters follow the C syntax, and may include '...' to denote a variable number of arguments. */ parms = make_node (TREE_LIST); - ellipsis = false; while (c_parser_next_token_is (parser, CPP_COMMA)) { struct c_parm *parm; @@ -5853,10 +5826,9 @@ c_parser_objc_method_decl (c_parser *parser) parms = chainon (parms, build_tree_list (NULL_TREE, grokparm (parm))); } - TREE_OVERFLOW (parms) = ellipsis; sel = list; } - return objc_build_method_signature (type, sel, parms); + return objc_build_method_signature (type, sel, parms, ellipsis); } /* Parse an objc-type-name. diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 5c71ad107b3..a1513418578 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -52,22 +52,17 @@ enum { MATCH_SIZE = ARRAY_SIZE (pch_matching) }; -/* This structure is read very early when validating the PCH, and - might be read for a PCH which is for a completely different compiler - for a different operating system. Thus, it should really only contain - 'unsigned char' entries, at least in the initial entries. +/* The value of the checksum in the dummy compiler that is actually + checksummed. That compiler should never be run. */ +static const char no_checksum[16] = { 0 }; - If you add or change entries before version_length, you should increase - the version number in get_ident(). +/* Information about flags and suchlike that affect PCH validity. - There are a bunch of fields named *_length; those are lengths of data that - follows this structure in the same order as the fields in the structure. */ + Before this structure is read, both an initial 8-character identification + string, and a 16-byte checksum, have been read and validated. */ struct c_pch_validity { - unsigned char host_machine_length; - unsigned char target_machine_length; - unsigned char version_length; unsigned char debug_info_type; signed char match[MATCH_SIZE]; void (*pch_init) (void); @@ -87,10 +82,6 @@ static FILE *pch_outfile; /* The position in the assembler output file when pch_init was called. */ static long asm_file_startpos; -/* The host and target machines. */ -static const char host_machine[] = HOST_MACHINE; -static const char target_machine[] = TARGET_MACHINE; - static const char *get_ident (void); /* Compute an appropriate 8-byte magic number for the PCH file, so that @@ -102,7 +93,7 @@ static const char * get_ident (void) { static char result[IDENT_LENGTH]; - static const char template[IDENT_LENGTH] = "gpch.012"; + static const char template[IDENT_LENGTH] = "gpch.013"; static const char c_language_chars[] = "Co+O"; memcpy (result, template, IDENT_LENGTH); @@ -111,8 +102,10 @@ get_ident (void) return result; } -/* Prepare to write a PCH file. This is called at the start of - compilation. */ +/* Prepare to write a PCH file, if one is being written. This is + called at the start of compilation. + + Also, print out the executable checksum if -fverbose-asm is in effect. */ void pch_init (void) @@ -122,6 +115,15 @@ pch_init (void) void *target_validity; static const char partial_pch[IDENT_LENGTH] = "gpcWrite"; +#ifdef ASM_COMMENT_START + if (flag_verbose_asm) + { + fprintf (asm_out_file, "%s ", ASM_COMMENT_START); + c_common_print_pch_checksum (asm_out_file); + fputc ('\n', asm_out_file); + } +#endif + if (!pch_file) return; @@ -130,13 +132,8 @@ pch_init (void) fatal_error ("can%'t create precompiled header %s: %m", pch_file); pch_outfile = f; - gcc_assert (strlen (host_machine) < 256 - && strlen (target_machine) < 256 - && strlen (version_string) < 256); + gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0); - v.host_machine_length = strlen (host_machine); - v.target_machine_length = strlen (target_machine); - v.version_length = strlen (version_string); v.debug_info_type = write_symbols; { size_t i; @@ -150,10 +147,8 @@ pch_init (void) target_validity = targetm.get_pch_validity (&v.target_data_length); if (fwrite (partial_pch, IDENT_LENGTH, 1, f) != 1 + || fwrite (executable_checksum, 16, 1, f) != 1 || fwrite (&v, sizeof (v), 1, f) != 1 - || fwrite (host_machine, v.host_machine_length, 1, f) != 1 - || fwrite (target_machine, v.target_machine_length, 1, f) != 1 - || fwrite (version_string, v.version_length, 1, f) != 1 || fwrite (target_validity, v.target_data_length, 1, f) != 1) fatal_error ("can%'t write to %s: %m", pch_file); @@ -234,20 +229,24 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) { int sizeread; int result; - char ident[IDENT_LENGTH]; - char short_strings[256 * 3]; - int strings_length; + char ident[IDENT_LENGTH + 16]; const char *pch_ident; struct c_pch_validity v; /* Perform a quick test of whether this is a valid precompiled header for the current language. */ - sizeread = read (fd, ident, IDENT_LENGTH); + gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0); + + sizeread = read (fd, ident, IDENT_LENGTH + 16); if (sizeread == -1) fatal_error ("can%'t read %s: %m", name); - else if (sizeread != IDENT_LENGTH) - return 2; + else if (sizeread != IDENT_LENGTH + 16) + { + cpp_error (pfile, CPP_DL_WARNING, "%s: too short to be a PCH file", + name); + return 2; + } pch_ident = get_ident(); if (memcmp (ident, pch_ident, IDENT_LENGTH) != 0) @@ -269,52 +268,20 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) } return 2; } - - /* At this point, we know it's a PCH file, so it ought to be long enough - that we can read a c_pch_validity structure. */ - if (read (fd, &v, sizeof (v)) != sizeof (v)) - fatal_error ("can%'t read %s: %m", name); - - strings_length = (v.host_machine_length + v.target_machine_length - + v.version_length); - if (read (fd, short_strings, strings_length) != strings_length) - fatal_error ("can%'t read %s: %m", name); - if (v.host_machine_length != strlen (host_machine) - || memcmp (host_machine, short_strings, strlen (host_machine)) != 0) - { - if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, - "%s: created on host '%.*s', but used on host '%s'", name, - v.host_machine_length, short_strings, host_machine); - return 2; - } - if (v.target_machine_length != strlen (target_machine) - || memcmp (target_machine, short_strings + v.host_machine_length, - strlen (target_machine)) != 0) - { - if (cpp_get_options (pfile)->warn_invalid_pch) - cpp_error (pfile, CPP_DL_WARNING, - "%s: created for target '%.*s', but used for target '%s'", - name, v.target_machine_length, - short_strings + v.host_machine_length, target_machine); - return 2; - } - if (v.version_length != strlen (version_string) - || memcmp (version_string, - (short_strings + v.host_machine_length - + v.target_machine_length), - v.version_length) != 0) + if (memcmp (ident + IDENT_LENGTH, executable_checksum, 16) != 0) { if (cpp_get_options (pfile)->warn_invalid_pch) cpp_error (pfile, CPP_DL_WARNING, - "%s: created by version '%.*s', but this is version '%s'", - name, v.version_length, - (short_strings + v.host_machine_length - + v.target_machine_length), - version_string); + "%s: created by a different GCC executable", name); return 2; } + /* At this point, we know it's a PCH file created by this + executable, so it ought to be long enough that we can read a + c_pch_validity structure. */ + if (read (fd, &v, sizeof (v)) != sizeof (v)) + fatal_error ("can%'t read %s: %m", name); + /* The allowable debug info combinations are that either the PCH file was built with the same as is being used now, or the PCH file was built for some kind of debug info but now none is in use. */ @@ -346,7 +313,9 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) /* If the text segment was not loaded at the same address as it was when the PCH file was created, function pointers loaded from the PCH will not be valid. We could in theory remap all the function - pointers, but no support for that exists at present. */ + pointers, but no support for that exists at present. + Since we have the same executable, it should only be necessary to + check one function. */ if (v.pch_init != &pch_init) { if (cpp_get_options (pfile)->warn_invalid_pch) @@ -508,3 +477,15 @@ c_common_pch_pragma (cpp_reader *pfile) close (fd); } + +/* Print out executable_checksum[]. */ + +void +c_common_print_pch_checksum (FILE *f) +{ + int i; + fputs ("Compiler executable checksum: ", f); + for (i = 0; i < 16; i++) + fprintf (f, "%02x", executable_checksum[i]); + putc ('\n', f); +} diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c index cc1dd280359..be50856a442 100644 --- a/gcc/c-pragma.c +++ b/gcc/c-pragma.c @@ -1,5 +1,5 @@ /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack. - Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -36,8 +36,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tm_p.h" #include "target.h" -#define GCC_BAD(msgid) do { warning (msgid); return; } while (0) -#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0) +#define GCC_BAD(msgid) do { warning (0, msgid); return; } while (0) +#define GCC_BAD2(msgid, arg) do { warning (0, msgid, arg); return; } while (0) typedef struct align_stack GTY(()) { @@ -108,7 +108,7 @@ pop_alignment (tree id) break; } if (entry == NULL) - warning ("\ + warning (0, "\ #pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)" , IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id)); } @@ -201,7 +201,7 @@ handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy)) GCC_BAD ("malformed %<#pragma pack%> - ignored"); if (c_lex (&x) != CPP_EOF) - warning ("junk at end of %<#pragma pack%>"); + warning (0, "junk at end of %<#pragma pack%>"); if (flag_pack_struct) GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored"); @@ -257,7 +257,7 @@ apply_pragma_weak (tree decl, tree value) if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl) && !DECL_WEAK (decl) /* Don't complain about a redundant #pragma. */ && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) - warning ("%Japplying #pragma weak %qD after first use results " + warning (0, "%Japplying #pragma weak %qD after first use results " "in unspecified behavior", decl, decl); declare_weak (decl); @@ -340,7 +340,7 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy)) t = c_lex (&x); } if (t != CPP_EOF) - warning ("junk at end of #pragma weak"); + warning (0, "junk at end of #pragma weak"); decl = identifier_global_value (name); if (decl && DECL_P (decl)) @@ -413,12 +413,12 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy)) GCC_BAD ("malformed #pragma redefine_extname, ignored"); t = c_lex (&x); if (t != CPP_EOF) - warning ("junk at end of #pragma redefine_extname"); + warning (0, "junk at end of #pragma redefine_extname"); if (!flag_mudflap && !targetm.handle_pragma_redefine_extname) { if (warn_unknown_pragmas > in_system_header) - warning ("#pragma redefine_extname not supported on this target"); + warning (0, "#pragma redefine_extname not supported on this target"); return; } @@ -435,7 +435,7 @@ handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy)) name = targetm.strip_name_encoding (name); if (strcmp (name, IDENTIFIER_POINTER (newname))) - warning ("#pragma redefine_extname ignored due to conflict with " + warning (0, "#pragma redefine_extname ignored due to conflict with " "previous rename"); } else @@ -458,7 +458,7 @@ add_to_renaming_pragma_list (tree oldname, tree newname) if (previous) { if (TREE_VALUE (previous) != newname) - warning ("#pragma redefine_extname ignored due to conflict with " + warning (0, "#pragma redefine_extname ignored due to conflict with " "previous #pragma redefine_extname"); return; } @@ -480,13 +480,13 @@ handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy)) GCC_BAD ("malformed #pragma extern_prefix, ignored"); t = c_lex (&x); if (t != CPP_EOF) - warning ("junk at end of #pragma extern_prefix"); + warning (0, "junk at end of #pragma extern_prefix"); if (targetm.handle_pragma_extern_prefix) /* Note that the length includes the null terminator. */ pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL); else if (warn_unknown_pragmas > in_system_header) - warning ("#pragma extern_prefix not supported on this target"); + warning (0, "#pragma extern_prefix not supported on this target"); } /* Hook from the front ends to apply the results of one of the preceding @@ -512,7 +512,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname) oldname = targetm.strip_name_encoding (oldname); if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname)) - warning ("asm declaration ignored due to " + warning (0, "asm declaration ignored due to " "conflict with previous rename"); /* Take any pending redefine_extname off the list. */ @@ -521,7 +521,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname) { /* Only warn if there is a conflict. */ if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname)) - warning ("#pragma redefine_extname ignored due to " + warning (0, "#pragma redefine_extname ignored due to " "conflict with previous rename"); *p = TREE_CHAIN (t); @@ -543,7 +543,7 @@ maybe_apply_renaming_pragma (tree decl, tree asmname) { if (strcmp (TREE_STRING_POINTER (asmname), IDENTIFIER_POINTER (newname)) != 0) - warning ("#pragma redefine_extname ignored due to " + warning (0, "#pragma redefine_extname ignored due to " "conflict with __asm__ declaration"); return asmname; } @@ -654,7 +654,7 @@ handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED) } } if (c_lex (&x) != CPP_EOF) - warning ("junk at end of %<#pragma GCC visibility%>"); + warning (0, "junk at end of %<#pragma GCC visibility%>"); } #endif diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c index 2176e34850b..699977a08c3 100644 --- a/gcc/c-pretty-print.c +++ b/gcc/c-pretty-print.c @@ -1013,12 +1013,6 @@ pp_c_primary_expression (c_pretty_printer *pp, tree e) pp_c_right_paren (pp); break; - case STMT_EXPR: - pp_c_left_paren (pp); - pp_statement (pp, STMT_EXPR_STMT (e)); - pp_c_right_paren (pp); - break; - default: /* FIXME: Make sure we won't get into an infinie loop. */ pp_c_left_paren (pp); @@ -1223,11 +1217,6 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e) pp_identifier (pp, code == POSTINCREMENT_EXPR ? "++" : "--"); break; - case ARROW_EXPR: - pp_postfix_expression (pp, TREE_OPERAND (e, 0)); - pp_c_arrow (pp); - break; - case ARRAY_REF: pp_postfix_expression (pp, TREE_OPERAND (e, 0)); pp_c_left_bracket (pp); @@ -1430,16 +1419,6 @@ pp_c_unary_expression (c_pretty_printer *pp, tree e) pp_c_cast_expression (pp, TREE_OPERAND (e, 0)); break; - case SIZEOF_EXPR: - case ALIGNOF_EXPR: - pp_c_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__"); - pp_c_whitespace (pp); - if (TYPE_P (TREE_OPERAND (e, 0))) - pp_c_type_cast (pp, TREE_OPERAND (e, 0)); - else - pp_unary_expression (pp, TREE_OPERAND (e, 0)); - break; - case REALPART_EXPR: case IMAGPART_EXPR: pp_c_identifier (pp, code == REALPART_EXPR ? "__real__" : "__imag__"); @@ -1801,13 +1780,11 @@ pp_c_expression (c_pretty_printer *pp, tree e) case FIELD_DECL: case LABEL_DECL: case ERROR_MARK: - case STMT_EXPR: pp_primary_expression (pp, e); break; case POSTINCREMENT_EXPR: case POSTDECREMENT_EXPR: - case ARROW_EXPR: case ARRAY_REF: case CALL_EXPR: case COMPONENT_REF: @@ -1837,8 +1814,6 @@ pp_c_expression (c_pretty_printer *pp, tree e) case TRUTH_NOT_EXPR: case PREINCREMENT_EXPR: case PREDECREMENT_EXPR: - case SIZEOF_EXPR: - case ALIGNOF_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: pp_c_unary_expression (pp, e); @@ -1935,118 +1910,16 @@ pp_c_expression (c_pretty_printer *pp, tree e) /* Statements. */ -/* statement: - labeled-statement - compound-statement - expression-statement - selection-statement - iteration-statement - jump-statement */ - void pp_c_statement (c_pretty_printer *pp, tree stmt) { - enum tree_code code; - if (stmt == NULL) return; if (pp_needs_newline (pp)) pp_newline_and_indent (pp, 0); - code = TREE_CODE (stmt); - switch (code) - { - /* expression-statement: - expression(opt) ; */ - case EXPR_STMT: - pp_expression (pp, EXPR_STMT_EXPR (stmt)); - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - case SWITCH_STMT: - pp_c_identifier (pp, "switch"); - pp_space (pp); - pp_c_left_paren (pp); - pp_expression (pp, SWITCH_COND (stmt)); - pp_c_right_paren (pp); - pp_indentation (pp) += 3; - pp_needs_newline (pp) = true; - pp_statement (pp, SWITCH_BODY (stmt)); - pp_newline_and_indent (pp, -3); - break; - - /* iteration-statement: - while ( expression ) statement - do statement while ( expression ) ; - for ( expression(opt) ; expression(opt) ; expression(opt) ) statement - for ( declaration expression(opt) ; expression(opt) ) statement */ - case WHILE_STMT: - pp_c_identifier (pp, "while"); - pp_space (pp); - pp_c_left_paren (pp); - pp_expression (pp, WHILE_COND (stmt)); - pp_c_right_paren (pp); - pp_newline_and_indent (pp, 3); - pp_statement (pp, WHILE_BODY (stmt)); - pp_indentation (pp) -= 3; - pp_needs_newline (pp) = true; - break; - - case DO_STMT: - pp_c_identifier (pp, "do"); - pp_newline_and_indent (pp, 3); - pp_statement (pp, DO_BODY (stmt)); - pp_newline_and_indent (pp, -3); - pp_c_identifier (pp, "while"); - pp_space (pp); - pp_c_left_paren (pp); - pp_expression (pp, DO_COND (stmt)); - pp_c_right_paren (pp); - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - case FOR_STMT: - pp_c_identifier (pp, "for"); - pp_space (pp); - pp_c_left_paren (pp); - if (FOR_INIT_STMT (stmt)) - pp_statement (pp, FOR_INIT_STMT (stmt)); - else - pp_c_semicolon (pp); - pp_needs_newline (pp) = false; - pp_c_whitespace (pp); - if (FOR_COND (stmt)) - pp_expression (pp, FOR_COND (stmt)); - pp_c_semicolon (pp); - pp_needs_newline (pp) = false; - pp_c_whitespace (pp); - if (FOR_EXPR (stmt)) - pp_expression (pp, FOR_EXPR (stmt)); - pp_c_right_paren (pp); - pp_newline_and_indent (pp, 3); - pp_statement (pp, FOR_BODY (stmt)); - pp_indentation (pp) -= 3; - pp_needs_newline (pp) = true; - break; - - /* jump-statement: - goto identifier; - continue ; - return expression(opt) ; */ - case BREAK_STMT: - case CONTINUE_STMT: - pp_identifier (pp, code == BREAK_STMT ? "break" : "continue"); - pp_c_semicolon (pp); - pp_needs_newline (pp) = true; - break; - - default: - dump_generic_node (pp_base (pp), stmt, pp_indentation (pp), 0, true); - break; - } + dump_generic_node (pp_base (pp), stmt, pp_indentation (pp), 0, true); } diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c index 1acf6e89956..f7757c6ff82 100644 --- a/gcc/c-semantics.c +++ b/gcc/c-semantics.c @@ -108,7 +108,7 @@ add_stmt (tree t) { enum tree_code code = TREE_CODE (t); - if ((EXPR_P (t) || STATEMENT_CODE_P (code)) && code != LABEL_EXPR) + if (EXPR_P (t) && code != LABEL_EXPR) { if (!EXPR_HAS_LOCATION (t)) SET_EXPR_LOCATION (t, input_location); @@ -149,19 +149,12 @@ build_stmt (enum tree_code code, ...) length = TREE_CODE_LENGTH (code); SET_EXPR_LOCATION (ret, input_location); - /* Most statements have implicit side effects all on their own, - such as control transfer. For those that do, we'll compute - the real value of TREE_SIDE_EFFECTS from its arguments. */ - switch (code) - { - case EXPR_STMT: - side_effects = false; - break; - default: - side_effects = true; - break; - } + /* TREE_SIDE_EFFECTS will already be set for statements with + implicit side effects. Here we make sure it is set for other + expressions by checking whether the parameters have side + effects. */ + side_effects = false; for (i = 0; i < length; i++) { tree t = va_arg (p, tree); @@ -170,7 +163,7 @@ build_stmt (enum tree_code code, ...) TREE_OPERAND (ret, i) = t; } - TREE_SIDE_EFFECTS (ret) = side_effects; + TREE_SIDE_EFFECTS (ret) |= side_effects; va_end (p); return ret; @@ -193,22 +186,6 @@ emit_local_var (tree decl) } } -/* Build a break statement node and return it. */ - -tree -build_break_stmt (void) -{ - return (build_stmt (BREAK_STMT)); -} - -/* Build a continue statement node and return it. */ - -tree -build_continue_stmt (void) -{ - return (build_stmt (CONTINUE_STMT)); -} - /* Create a CASE_LABEL_EXPR tree node and return it. */ tree diff --git a/gcc/c-tree.h b/gcc/c-tree.h index adace275c38..7af8130a426 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -30,13 +30,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define C_SIZEOF_STRUCT_LANG_IDENTIFIER \ (sizeof (struct c_common_identifier) + 3 * sizeof (void *)) -/* For gc purposes, return the most likely link for the longest chain. */ -#define C_LANG_TREE_NODE_CHAIN_NEXT(T) \ - ((union lang_tree_node *) \ - (TREE_CODE (T) == INTEGER_TYPE ? TYPE_NEXT_VARIANT (T) \ - : TREE_CODE (T) == COMPOUND_EXPR ? TREE_OPERAND (T, 1) \ - : TREE_CHAIN (T))) - /* Language-specific declaration information. */ struct lang_decl GTY(()) @@ -93,7 +86,13 @@ struct lang_type GTY(()) /* For FUNCTION_DECLs, evaluates true if the decl is built-in but has been declared. */ -#define C_DECL_DECLARED_BUILTIN(EXP) DECL_LANG_FLAG_3 (EXP) +#define C_DECL_DECLARED_BUILTIN(EXP) \ + DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (EXP)) + +/* For FUNCTION_DECLs, evaluates true if the decl is built-in, has a + built-in prototype and does not have a non-built-in prototype. */ +#define C_DECL_BUILTIN_PROTOTYPE(EXP) \ + DECL_LANG_FLAG_6 (FUNCTION_DECL_CHECK (EXP)) /* Record whether a decl was declared register. This is strictly a front-end flag, whereas DECL_REGISTER is used for code generation; @@ -104,7 +103,30 @@ struct lang_type GTY(()) unevaluated operand of sizeof / typeof / alignof. This is only used for functions declared static but not defined, though outside sizeof and typeof it is set for other function decls as well. */ -#define C_DECL_USED(EXP) DECL_LANG_FLAG_5 (EXP) +#define C_DECL_USED(EXP) DECL_LANG_FLAG_5 (FUNCTION_DECL_CHECK (EXP)) + +/* Record whether a label was defined in a statement expression which + has finished and so can no longer be jumped to. */ +#define C_DECL_UNJUMPABLE_STMT_EXPR(EXP) \ + DECL_LANG_FLAG_6 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a label was the subject of a goto from outside the + current level of statement expression nesting and so cannot be + defined right now. */ +#define C_DECL_UNDEFINABLE_STMT_EXPR(EXP) \ + DECL_LANG_FLAG_7 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a label was defined in the scope of an identifier + with variably modified type which has finished and so can no longer + be jumped to. */ +#define C_DECL_UNJUMPABLE_VM(EXP) \ + DECL_LANG_FLAG_3 (LABEL_DECL_CHECK (EXP)) + +/* Record whether a label was the subject of a goto from outside the + current level of scopes of identifiers with variably modified type + and so cannot be defined right now. */ +#define C_DECL_UNDEFINABLE_VM(EXP) \ + DECL_LANG_FLAG_5 (LABEL_DECL_CHECK (EXP)) /* Nonzero for a decl which either doesn't exist or isn't a prototype. N.B. Could be simplified if all built-in decls had complete prototypes @@ -350,6 +372,45 @@ struct language_function GTY(()) int extern_inline; }; +/* Save lists of labels used or defined in particular contexts. + Allocated on the parser obstack. */ + +struct c_label_list +{ + /* The label at the head of the list. */ + tree label; + /* The rest of the list. */ + struct c_label_list *next; +}; + +/* Statement expression context. */ + +struct c_label_context_se +{ + /* The labels defined at this level of nesting. */ + struct c_label_list *labels_def; + /* The labels used at this level of nesting. */ + struct c_label_list *labels_used; + /* The next outermost context. */ + struct c_label_context_se *next; +}; + +/* Context of variably modified declarations. */ + +struct c_label_context_vm +{ + /* The labels defined at this level of nesting. */ + struct c_label_list *labels_def; + /* The labels used at this level of nesting. */ + struct c_label_list *labels_used; + /* The scope of this context. Multiple contexts may be at the same + numbered scope, since each variably modified declaration starts a + new context. */ + unsigned scope; + /* The next outermost context. */ + struct c_label_context_vm *next; +}; + /* in c-parser.c */ extern void c_parse_init (void); @@ -378,7 +439,6 @@ extern struct c_declarator *build_array_declarator (tree, struct c_declspecs *, extern tree build_enumerator (tree, tree); extern void check_for_loop_decls (void); extern void mark_forward_parm_decls (void); -extern int complete_array_type (tree, tree, int); extern void declare_parm_level (void); extern void undeclared_variable (tree, location_t); extern tree declare_label (tree); @@ -453,6 +513,8 @@ extern int in_sizeof; extern int in_typeof; extern struct c_switch *c_switch_stack; +extern struct c_label_context_se *label_context_stack_se; +extern struct c_label_context_vm *label_context_stack_vm; extern tree require_complete_type (tree); extern int same_translation_unit_p (tree, tree); @@ -460,6 +522,7 @@ extern int comptypes (tree, tree); extern bool c_mark_addressable (tree); extern void c_incomplete_type_error (tree, tree); extern tree c_type_promotes_to (tree); +extern tree default_conversion (tree); extern tree composite_type (tree, tree); extern tree build_component_ref (tree, tree); extern tree build_indirect_ref (tree, const char *); @@ -468,6 +531,7 @@ extern tree build_external_ref (tree, int, location_t); extern void pop_maybe_used (bool); extern struct c_expr c_expr_sizeof_expr (struct c_expr); extern struct c_expr c_expr_sizeof_type (struct c_type_name *); +extern struct c_expr parser_build_unary_op (enum tree_code, struct c_expr); extern struct c_expr parser_build_binary_op (enum tree_code, struct c_expr, struct c_expr); extern tree build_conditional_expr (tree, tree, tree); @@ -506,6 +570,8 @@ extern tree c_finish_return (tree); extern tree c_finish_bc_stmt (tree *, bool); extern tree c_finish_goto_label (tree); extern tree c_finish_goto_ptr (tree); +extern void c_begin_vm_scope (unsigned int); +extern void c_end_vm_scope (unsigned int); /* Set to 0 at beginning of a function definition, set to 1 if a return statement that specifies a return value is seen. */ diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 9c94b034b6a..e8b2b372e1d 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -64,6 +64,9 @@ int in_sizeof; /* The level of nesting inside "typeof". */ int in_typeof; +struct c_label_context_se *label_context_stack_se; +struct c_label_context_vm *label_context_stack_vm; + /* Nonzero if we've already printed a "missing braces around initializer" message within this initializer. */ static int missing_braces_mentioned; @@ -100,6 +103,8 @@ static void set_nonincremental_init (void); static void set_nonincremental_init_from_string (tree); static tree find_init_member (tree); static void readonly_error (tree, enum lvalue_use); +static int lvalue_or_else (tree, enum lvalue_use); +static int lvalue_p (tree); static void record_maybe_used_decl (tree); /* Do `exp = require_complete_type (exp);' to make sure exp @@ -136,8 +141,7 @@ c_incomplete_type_error (tree value, tree type) if (value != 0 && (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == PARM_DECL)) - error ("%qs has an incomplete type", - IDENTIFIER_POINTER (DECL_NAME (value))); + error ("%qD has an incomplete type", value); else { retry: @@ -180,12 +184,11 @@ c_incomplete_type_error (tree value, tree type) } if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) - error ("invalid use of undefined type %<%s %s%>", - type_code_string, IDENTIFIER_POINTER (TYPE_NAME (type))); + error ("invalid use of undefined type %<%s %E%>", + type_code_string, TYPE_NAME (type)); else /* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */ - error ("invalid use of incomplete typedef %qs", - IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); + error ("invalid use of incomplete typedef %qD", TYPE_NAME (type)); } } @@ -341,7 +344,7 @@ composite_type (tree t1, tree t2) /* If both args specify argument types, we must merge the two lists, argument by argument. */ /* Tell global_bindings_p to return false so that variable_size - doesn't abort on VLAs in parameter types. */ + doesn't die on VLAs in parameter types. */ c_override_global_bindings_to_false = true; len = list_length (p1); @@ -615,7 +618,9 @@ c_common_type (tree t1, tree t2) } /* Wrapper around c_common_type that is used by c-common.c. ENUMERAL_TYPEs - are allowed here and are converted to their compatible integer types. */ + are allowed here and are converted to their compatible integer types. + BOOLEAN_TYPEs are allowed here and return either boolean_type_node or + preferably a non-Boolean type as the common type. */ tree common_type (tree t1, tree t2) { @@ -623,6 +628,18 @@ common_type (tree t1, tree t2) t1 = c_common_type_for_size (TYPE_PRECISION (t1), 1); if (TREE_CODE (t2) == ENUMERAL_TYPE) t2 = c_common_type_for_size (TYPE_PRECISION (t2), 1); + + /* If both types are BOOLEAN_TYPE, then return boolean_type_node. */ + if (TREE_CODE (t1) == BOOLEAN_TYPE + && TREE_CODE (t2) == BOOLEAN_TYPE) + return boolean_type_node; + + /* If either type is BOOLEAN_TYPE, then return the other. */ + if (TREE_CODE (t1) == BOOLEAN_TYPE) + return t2; + if (TREE_CODE (t2) == BOOLEAN_TYPE) + return t1; + return c_common_type (t1, t2); } @@ -1065,7 +1082,7 @@ function_types_compatible_p (tree f1, tree f2) return 0; /* If one of these types comes from a non-prototype fn definition, compare that with the other type's arglist. - If they don't match, ask for a warning (but no error). */ + If they don't match, ask for a warning (0, but no error). */ if (TYPE_ACTUAL_ARG_TYPES (f1) && 1 != type_lists_compatible_p (args2, TYPE_ACTUAL_ARG_TYPES (f1))) val = 2; @@ -1246,10 +1263,18 @@ decl_constant_value (tree decl) static tree decl_constant_value_for_broken_optimization (tree decl) { + tree ret; + if (pedantic || DECL_MODE (decl) == BLKmode) return decl; - else - return decl_constant_value (decl); + + ret = decl_constant_value (decl); + /* Avoid unwanted tree sharing between the initializer and current + function's body where the tree can be modified e.g. by the + gimplifier. */ + if (ret != decl && TREE_STATIC (decl)) + ret = unshare_expr (ret); + return ret; } @@ -1352,47 +1377,17 @@ default_function_array_conversion (tree exp) return exp; } -/* Perform default promotions for C data used in expressions. - Arrays and functions are converted to pointers; - enumeral types or short or char, to int. - In addition, manifest constants symbols are replaced by their values. */ + +/* EXP is an expression of integer type. Apply the integer promotions + to it and return the promoted value. */ tree -default_conversion (tree exp) +perform_integral_promotions (tree exp) { - tree orig_exp; tree type = TREE_TYPE (exp); enum tree_code code = TREE_CODE (type); - if (code == FUNCTION_TYPE || code == ARRAY_TYPE) - return default_function_array_conversion (exp); - - /* Constants can be used directly unless they're not loadable. */ - if (TREE_CODE (exp) == CONST_DECL) - exp = DECL_INITIAL (exp); - - /* Replace a nonvolatile const static variable with its value unless - it is an array, in which case we must be sure that taking the - address of the array produces consistent results. */ - else if (optimize && TREE_CODE (exp) == VAR_DECL && code != ARRAY_TYPE) - { - exp = decl_constant_value_for_broken_optimization (exp); - type = TREE_TYPE (exp); - } - - /* 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. */ - orig_exp = exp; - 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 (TREE_NO_WARNING (orig_exp)) - TREE_NO_WARNING (exp) = 1; + gcc_assert (INTEGRAL_TYPE_P (type)); /* Normally convert enums to int, but convert wide enums to something wider. */ @@ -1407,6 +1402,8 @@ default_conversion (tree exp) return convert (type, exp); } + /* ??? This should no longer be needed now bit-fields have their + proper types. */ if (TREE_CODE (exp) == COMPONENT_REF && DECL_C_BIT_FIELD (TREE_OPERAND (exp, 1)) /* If it's thinner than an int, promote it like a @@ -1425,6 +1422,48 @@ default_conversion (tree exp) return convert (integer_type_node, exp); } + return exp; +} + + +/* Perform default promotions for C data used in expressions. + Arrays and functions are converted to pointers; + enumeral types or short or char, to int. + In addition, manifest constants symbols are replaced by their values. */ + +tree +default_conversion (tree exp) +{ + tree orig_exp; + tree type = TREE_TYPE (exp); + enum tree_code code = TREE_CODE (type); + + if (code == FUNCTION_TYPE || code == ARRAY_TYPE) + return default_function_array_conversion (exp); + + /* Constants can be used directly unless they're not loadable. */ + if (TREE_CODE (exp) == CONST_DECL) + exp = DECL_INITIAL (exp); + + /* Replace a nonvolatile const static variable with its value unless + it is an array, in which case we must be sure that taking the + address of the array produces consistent results. */ + else if (optimize && TREE_CODE (exp) == VAR_DECL && code != ARRAY_TYPE) + { + exp = decl_constant_value_for_broken_optimization (exp); + type = TREE_TYPE (exp); + } + + /* Strip no-op conversions. */ + orig_exp = exp; + STRIP_TYPE_NOPS (exp); + + if (TREE_NO_WARNING (orig_exp)) + TREE_NO_WARNING (exp) = 1; + + if (INTEGRAL_TYPE_P (type)) + return perform_integral_promotions (exp); + if (code == VOID_TYPE) { error ("void value not ignored as it ought to be"); @@ -1556,8 +1595,7 @@ build_component_ref (tree datum, tree component) if (!field) { - error ("%qT has no member named %qs", type, - IDENTIFIER_POINTER (component)); + error ("%qT has no member named %qE", type, component); return error_mark_node; } @@ -1592,8 +1630,8 @@ build_component_ref (tree datum, tree component) return ref; } else if (code != ERROR_MARK) - error ("request for member %qs in something not a structure or union", - IDENTIFIER_POINTER (component)); + error ("request for member %qE in something not a structure or union", + component); return error_mark_node; } @@ -1630,7 +1668,7 @@ build_indirect_ref (tree ptr, const char *errorstring) return error_mark_node; } if (VOID_TYPE_P (t) && skip_evaluation == 0) - warning ("dereferencing % pointer"); + warning (0, "dereferencing % pointer"); /* We *must* set TREE_READONLY when dereferencing a pointer to const, so that we get the proper error message if the result is used @@ -1705,7 +1743,7 @@ build_array_ref (tree array, tree index) char[array]. */ if (warn_char_subscripts && !swapped && TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node) - warning ("array subscript has type %"); + warning (0, "array subscript has type %"); /* Apply default promotions *after* noticing character types. */ index = default_conversion (index); @@ -1963,6 +2001,14 @@ build_function_call (tree function, tree params) /* Convert anything with function type to a pointer-to-function. */ if (TREE_CODE (function) == FUNCTION_DECL) { + /* Implement type-directed function overloading for builtins. + resolve_overloaded_builtin and targetm.resolve_overloaded_builtin + handle all the type checking. The result is a complete expression + that implements this function call. */ + tem = resolve_overloaded_builtin (function, params); + if (tem) + return tem; + name = DECL_NAME (function); /* Differs from default_conversion by not setting TREE_ADDRESSABLE @@ -1977,6 +2023,10 @@ build_function_call (tree function, tree params) else function = default_conversion (function); + /* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF + expressions, like those used for ObjC messenger dispatches. */ + function = objc_rewrite_function_call (function, params); + fntype = TREE_TYPE (function); if (TREE_CODE (fntype) == ERROR_MARK) @@ -2017,7 +2067,7 @@ build_function_call (tree function, tree params) /* This situation leads to run-time undefined behavior. We can't, therefore, simply error unless we can prove that all possible executions of the program must execute the code. */ - warning ("function called through a non-compatible type"); + warning (0, "function called through a non-compatible type"); /* We can, however, treat "undefined" any way we please. Call abort to encourage the user to fix the program. */ @@ -2136,11 +2186,7 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) argnum -= 2; } - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here! We do not want an enumerator with value 0 - to convert automatically to a pointer. */ - if (TREE_CODE (val) == NON_LVALUE_EXPR) - val = TREE_OPERAND (val, 0); + STRIP_TYPE_NOPS (val); val = default_function_array_conversion (val); @@ -2166,32 +2212,32 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) if (INTEGRAL_TYPE_P (type) && TREE_CODE (TREE_TYPE (val)) == REAL_TYPE) - warning ("passing argument %d of %qE as integer " + warning (0, "passing argument %d of %qE as integer " "rather than floating due to prototype", argnum, rname); if (INTEGRAL_TYPE_P (type) && TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE) - warning ("passing argument %d of %qE as integer " + warning (0, "passing argument %d of %qE as integer " "rather than complex due to prototype", argnum, rname); else if (TREE_CODE (type) == COMPLEX_TYPE && TREE_CODE (TREE_TYPE (val)) == REAL_TYPE) - warning ("passing argument %d of %qE as complex " + warning (0, "passing argument %d of %qE as complex " "rather than floating due to prototype", argnum, rname); else if (TREE_CODE (type) == REAL_TYPE && INTEGRAL_TYPE_P (TREE_TYPE (val))) - warning ("passing argument %d of %qE as floating " + warning (0, "passing argument %d of %qE as floating " "rather than integer due to prototype", argnum, rname); else if (TREE_CODE (type) == COMPLEX_TYPE && INTEGRAL_TYPE_P (TREE_TYPE (val))) - warning ("passing argument %d of %qE as complex " + warning (0, "passing argument %d of %qE as complex " "rather than integer due to prototype", argnum, rname); else if (TREE_CODE (type) == REAL_TYPE && TREE_CODE (TREE_TYPE (val)) == COMPLEX_TYPE) - warning ("passing argument %d of %qE as floating " + warning (0, "passing argument %d of %qE as floating " "rather than complex due to prototype", argnum, rname); /* ??? At some point, messages should be written about @@ -2203,7 +2249,7 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) /* Warn if any argument is passed as `float', since without a prototype it would be `double'. */ if (formal_prec == TYPE_PRECISION (float_type_node)) - warning ("passing argument %d of %qE as % " + warning (0, "passing argument %d of %qE as % " "rather than % due to prototype", argnum, rname); } @@ -2223,7 +2269,7 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) and the actual arg is that enum type. */ ; else if (formal_prec != TYPE_PRECISION (type1)) - warning ("passing argument %d of %qE with different " + warning (0, "passing argument %d of %qE with different " "width due to prototype", argnum, rname); else if (TYPE_UNSIGNED (type) == TYPE_UNSIGNED (type1)) ; @@ -2237,11 +2283,6 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) /* Change in signedness doesn't matter if a constant value is unaffected. */ ; - /* Likewise for a constant in a NOP_EXPR. */ - else if (TREE_CODE (val) == NOP_EXPR - && TREE_CODE (TREE_OPERAND (val, 0)) == INTEGER_CST - && int_fits_type_p (TREE_OPERAND (val, 0), type)) - ; /* If the value is extended from a narrower unsigned type, it doesn't matter whether we pass it as signed or unsigned; the value @@ -2250,10 +2291,10 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) && TYPE_UNSIGNED (TREE_TYPE (val))) ; else if (TYPE_UNSIGNED (type)) - warning ("passing argument %d of %qE as unsigned " + warning (0, "passing argument %d of %qE as unsigned " "due to prototype", argnum, rname); else - warning ("passing argument %d of %qE as signed " + warning (0, "passing argument %d of %qE as signed " "due to prototype", argnum, rname); } } @@ -2297,11 +2338,27 @@ convert_arguments (tree typelist, tree values, tree function, tree fundecl) return nreverse (result); } -/* This is the entry point used by the parser - for binary operators in the input. - In addition to constructing the expression, - we check for operands that were written with other binary operators - in a way that is likely to confuse the user. */ +/* This is the entry point used by the parser to build unary operators + in the input. CODE, a tree_code, specifies the unary operator, and + ARG is the operand. For unary plus, the C parser currently uses + CONVERT_EXPR for code. */ + +struct c_expr +parser_build_unary_op (enum tree_code code, struct c_expr arg) +{ + struct c_expr result; + + result.original_code = ERROR_MARK; + result.value = build_unary_op (code, arg.value, 0); + overflow_warning (result.value); + return result; +} + +/* This is the entry point used by the parser to build binary operators + in the input. CODE, a tree_code, specifies the binary operator, and + ARG1 and ARG2 are the operands. In addition to constructing the + expression, we check for operands that were written with other binary + operators in a way that is likely to confuse the user. */ struct c_expr parser_build_binary_op (enum tree_code code, struct c_expr arg1, @@ -2326,14 +2383,14 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1, { if (code1 == PLUS_EXPR || code1 == MINUS_EXPR || code2 == PLUS_EXPR || code2 == MINUS_EXPR) - warning ("suggest parentheses around + or - inside shift"); + warning (0, "suggest parentheses around + or - inside shift"); } if (code == TRUTH_ORIF_EXPR) { if (code1 == TRUTH_ANDIF_EXPR || code2 == TRUTH_ANDIF_EXPR) - warning ("suggest parentheses around && within ||"); + warning (0, "suggest parentheses around && within ||"); } if (code == BIT_IOR_EXPR) @@ -2342,11 +2399,11 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1, || code1 == PLUS_EXPR || code1 == MINUS_EXPR || code2 == BIT_AND_EXPR || code2 == BIT_XOR_EXPR || code2 == PLUS_EXPR || code2 == MINUS_EXPR) - warning ("suggest parentheses around arithmetic in operand of |"); + warning (0, "suggest parentheses around arithmetic in operand of |"); /* Check cases like x|y==z */ if (TREE_CODE_CLASS (code1) == tcc_comparison || TREE_CODE_CLASS (code2) == tcc_comparison) - warning ("suggest parentheses around comparison in operand of |"); + warning (0, "suggest parentheses around comparison in operand of |"); } if (code == BIT_XOR_EXPR) @@ -2355,28 +2412,28 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1, || code1 == PLUS_EXPR || code1 == MINUS_EXPR || code2 == BIT_AND_EXPR || code2 == PLUS_EXPR || code2 == MINUS_EXPR) - warning ("suggest parentheses around arithmetic in operand of ^"); + warning (0, "suggest parentheses around arithmetic in operand of ^"); /* Check cases like x^y==z */ if (TREE_CODE_CLASS (code1) == tcc_comparison || TREE_CODE_CLASS (code2) == tcc_comparison) - warning ("suggest parentheses around comparison in operand of ^"); + warning (0, "suggest parentheses around comparison in operand of ^"); } if (code == BIT_AND_EXPR) { if (code1 == PLUS_EXPR || code1 == MINUS_EXPR || code2 == PLUS_EXPR || code2 == MINUS_EXPR) - warning ("suggest parentheses around + or - in operand of &"); + warning (0, "suggest parentheses around + or - in operand of &"); /* Check cases like x&y==z */ if (TREE_CODE_CLASS (code1) == tcc_comparison || TREE_CODE_CLASS (code2) == tcc_comparison) - warning ("suggest parentheses around comparison in operand of &"); + warning (0, "suggest parentheses around comparison in operand of &"); } /* Similarly, check for cases like 1<=i<=10 that are probably errors. */ if (TREE_CODE_CLASS (code) == tcc_comparison && (TREE_CODE_CLASS (code1) == tcc_comparison || TREE_CODE_CLASS (code2) == tcc_comparison)) - warning ("comparisons like X<=Y<=Z do not have their mathematical meaning"); + warning (0, "comparisons like X<=Y<=Z do not have their mathematical meaning"); } @@ -2557,6 +2614,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag) break; case TRUTH_NOT_EXPR: + /* ??? Why do most validation here but that for non-lvalue arrays + in c_objc_common_truthvalue_conversion? */ if (typecode != INTEGER_TYPE && typecode != REAL_TYPE && typecode != POINTER_TYPE && typecode != COMPLEX_TYPE @@ -2566,7 +2625,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag) error ("wrong type argument to unary exclamation mark"); return error_mark_node; } - arg = lang_hooks.truthvalue_conversion (arg); + arg = c_objc_common_truthvalue_conversion (arg); return invert_truthvalue (arg); case NOP_EXPR: @@ -2761,7 +2820,7 @@ build_unary_op (enum tree_code code, tree xarg, int flag) Lvalues can be assigned, unless their type has TYPE_READONLY. Lvalues can have their address taken, unless they have C_DECL_REGISTER. */ -int +static int lvalue_p (tree ref) { enum tree_code code = TREE_CODE (ref); @@ -2811,21 +2870,37 @@ readonly_error (tree arg, enum lvalue_use use) if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0)))) readonly_error (TREE_OPERAND (arg, 0), use); else - error (READONLY_MSG (N_("assignment of read-only member %qs"), - N_("increment of read-only member %qs"), - N_("decrement of read-only member %qs")), - IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1)))); + error (READONLY_MSG (N_("assignment of read-only member %qD"), + N_("increment of read-only member %qD"), + N_("decrement of read-only member %qD")), + TREE_OPERAND (arg, 1)); } else if (TREE_CODE (arg) == VAR_DECL) - error (READONLY_MSG (N_("assignment of read-only variable %qs"), - N_("increment of read-only variable %qs"), - N_("decrement of read-only variable %qs")), - IDENTIFIER_POINTER (DECL_NAME (arg))); + error (READONLY_MSG (N_("assignment of read-only variable %qD"), + N_("increment of read-only variable %qD"), + N_("decrement of read-only variable %qD")), + arg); else error (READONLY_MSG (N_("assignment of read-only location"), N_("increment of read-only location"), N_("decrement of read-only location"))); } + + +/* 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. */ + +static int +lvalue_or_else (tree ref, enum lvalue_use use) +{ + int win = lvalue_p (ref); + + if (!win) + lvalue_error (use); + + return win; +} /* Mark EXP saying that we need to be able to take the address of it; it should not be allocated in a register. @@ -2906,8 +2981,6 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) tree result_type = NULL; tree orig_op1 = op1, orig_op2 = op2; - ifexp = lang_hooks.truthvalue_conversion (default_conversion (ifexp)); - /* Promote both alternatives. */ if (TREE_CODE (TREE_TYPE (op1)) != VOID_TYPE) @@ -2973,7 +3046,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) || (unsigned_op1 && tree_expr_nonnegative_p (op2))) /* OK */; else - warning ("signed and unsigned type in conditional expression"); + warning (0, "signed and unsigned type in conditional expression"); } } } @@ -3058,10 +3131,7 @@ build_conditional_expr (tree ifexp, tree op1, tree op2) if (result_type != TREE_TYPE (op2)) op2 = convert_and_check (result_type, op2); - if (TREE_CODE (ifexp) == INTEGER_CST) - return non_lvalue (integer_zerop (ifexp) ? op2 : op1); - - return fold (build3 (COND_EXPR, result_type, ifexp, op1, op2)); + return fold_build3 (COND_EXPR, result_type, ifexp, op1, op2); } /* Return a compound expression that performs two expressions and @@ -3078,10 +3148,18 @@ build_compound_expr (tree expr1, tree expr2) /* The left-hand operand of a comma expression is like an expression statement: with -Wextra or -Wunused, we should warn if it doesn't have any side-effects, unless it was explicitly cast to (void). */ - if (warn_unused_value - && !(TREE_CODE (expr1) == CONVERT_EXPR - && VOID_TYPE_P (TREE_TYPE (expr1)))) - warning ("left-hand operand of comma expression has no effect"); + if (warn_unused_value) + { + if (VOID_TYPE_P (TREE_TYPE (expr1)) + && TREE_CODE (expr1) == CONVERT_EXPR) + ; /* (void) a, b */ + else if (VOID_TYPE_P (TREE_TYPE (expr1)) + && TREE_CODE (expr1) == COMPOUND_EXPR + && TREE_CODE (TREE_OPERAND (expr1, 1)) == CONVERT_EXPR) + ; /* (void) a, (void) b, c */ + else + warning (0, "left-hand operand of comma expression has no effect"); + } } /* With -Wunused, we should also warn if the left-hand operand does have @@ -3208,12 +3286,12 @@ build_c_cast (tree type, tree expr) && TREE_CODE (in_otype) == POINTER_TYPE); if (added) - warning ("cast adds new qualifiers to function type"); + warning (0, "cast adds new qualifiers to function type"); if (discarded) /* There are qualifiers present in IN_OTYPE that are not present in IN_TYPE. */ - warning ("cast discards qualifiers from pointer target type"); + warning (0, "cast discards qualifiers from pointer target type"); } /* Warn about possible alignment problems. */ @@ -3228,26 +3306,28 @@ build_c_cast (tree type, tree expr) || TREE_CODE (TREE_TYPE (otype)) == RECORD_TYPE) && TYPE_MODE (TREE_TYPE (otype)) == VOIDmode) && TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (otype))) - warning ("cast increases required alignment of target type"); + warning (0, "cast increases required alignment of target type"); - if (TREE_CODE (type) == INTEGER_TYPE + if (warn_pointer_to_int_cast + && TREE_CODE (type) == INTEGER_TYPE && TREE_CODE (otype) == POINTER_TYPE && TYPE_PRECISION (type) != TYPE_PRECISION (otype) && !TREE_CONSTANT (value)) - warning ("cast from pointer to integer of different size"); + warning (0, "cast from pointer to integer of different size"); if (warn_bad_function_cast && TREE_CODE (value) == CALL_EXPR && TREE_CODE (type) != TREE_CODE (otype)) - warning ("cast from function call of type %qT to non-matching " + warning (0, "cast from function call of type %qT to non-matching " "type %qT", otype, type); - if (TREE_CODE (type) == POINTER_TYPE + if (warn_int_to_pointer_cast + && TREE_CODE (type) == POINTER_TYPE && TREE_CODE (otype) == INTEGER_TYPE && TYPE_PRECISION (type) != TYPE_PRECISION (otype) /* Don't warn about converting any constant. */ && !TREE_CONSTANT (value)) - warning ("cast to pointer from integer of different size"); + warning (0, "cast to pointer from integer of different size"); if (TREE_CODE (type) == POINTER_TYPE && TREE_CODE (otype) == POINTER_TYPE @@ -3259,17 +3339,17 @@ build_c_cast (tree type, tree expr) /* Casting the address of a decl to non void pointer. Warn if the cast breaks type based aliasing. */ if (!COMPLETE_TYPE_P (TREE_TYPE (type))) - warning ("type-punning to incomplete type might break strict-aliasing rules"); + warning (0, "type-punning to incomplete type might break strict-aliasing rules"); else { HOST_WIDE_INT set1 = get_alias_set (TREE_TYPE (TREE_OPERAND (expr, 0))); HOST_WIDE_INT set2 = get_alias_set (TREE_TYPE (type)); if (!alias_sets_conflict_p (set1, set2)) - warning ("dereferencing type-punned pointer will break strict-aliasing rules"); + warning (0, "dereferencing type-punned pointer will break strict-aliasing rules"); else if (warn_strict_aliasing > 1 && !alias_sets_might_conflict_p (set1, set2)) - warning ("dereferencing type-punned pointer might break strict-aliasing rules"); + warning (0, "dereferencing type-punned pointer might break strict-aliasing rules"); } } @@ -3357,11 +3437,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (TREE_CODE (lhs) == ERROR_MARK || TREE_CODE (rhs) == ERROR_MARK) return error_mark_node; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here. We do not want an enumerator - whose value is 0 to count as a null pointer constant. */ - if (TREE_CODE (rhs) == NON_LVALUE_EXPR) - rhs = TREE_OPERAND (rhs, 0); + STRIP_TYPE_NOPS (rhs); newrhs = rhs; @@ -3413,6 +3489,14 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (TREE_CODE (newrhs) == ERROR_MARK) return error_mark_node; + /* 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; + } + /* Scan operands. */ result = build2 (MODIFY_EXPR, lhstype, lhs, newrhs); @@ -3479,7 +3563,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, pedwarn (AR, parmnum, rname); \ break; \ case ic_argpass_nonproto: \ - warning (AR, parmnum, rname); \ + warning (0, AR, parmnum, rname); \ break; \ case ic_assign: \ pedwarn (AS); \ @@ -3495,11 +3579,7 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype, } \ } while (0) - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here. We do not want an enumerator - whose value is 0 to count as a null pointer constant. */ - if (TREE_CODE (rhs) == NON_LVALUE_EXPR) - rhs = TREE_OPERAND (rhs, 0); + STRIP_TYPE_NOPS (rhs); if (TREE_CODE (TREE_TYPE (rhs)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (rhs)) == FUNCTION_TYPE) @@ -3926,7 +4006,7 @@ store_init_value (tree decl, tree init) if (warn_traditional && !in_system_header && AGGREGATE_TYPE_P (TREE_TYPE (decl)) && !TREE_STATIC (decl)) - warning ("traditional C rejects automatic aggregate initialization"); + warning (0, "traditional C rejects automatic aggregate initialization"); DECL_INITIAL (decl) = value; @@ -3941,8 +4021,7 @@ store_init_value (tree decl, tree init) { tree inside_init = init; - if (TREE_CODE (init) == NON_LVALUE_EXPR) - inside_init = TREE_OPERAND (init, 0); + STRIP_TYPE_NOPS (inside_init); inside_init = fold (inside_init); if (TREE_CODE (inside_init) == COMPOUND_LITERAL_EXPR) @@ -4121,10 +4200,10 @@ warning_init (const char *msgid) { char *ofwhat; - warning ("%s", _(msgid)); + warning (0, "%s", _(msgid)); ofwhat = print_spelling ((char *) alloca (spelling_length () + 1)); if (*ofwhat) - warning ("(near initialization for %qs)", ofwhat); + warning (0, "(near initialization for %qs)", ofwhat); } /* If TYPE is an array type and EXPR is a parenthesized string @@ -4162,11 +4241,7 @@ digest_init (tree type, tree init, bool strict_string, int require_constant) || TREE_TYPE (init) == error_mark_node) return error_mark_node; - /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ - /* Do not use STRIP_NOPS here. We do not want an enumerator - whose value is 0 to count as a null pointer constant. */ - if (TREE_CODE (init) == NON_LVALUE_EXPR) - inside_init = TREE_OPERAND (init, 0); + STRIP_TYPE_NOPS (inside_init); inside_init = fold (inside_init); @@ -4999,7 +5074,7 @@ pop_init_level (int implicit) /* We have already issued an error message for the existence of a flexible array member not at the end of the structure. - Discard the initializer so that we do not abort later. */ + Discard the initializer so that we do not die later. */ if (TREE_CHAIN (constructor_fields) != NULL_TREE) constructor_type = NULL_TREE; } @@ -5208,21 +5283,6 @@ set_init_index (tree first, tree last) return; } - while ((TREE_CODE (first) == NOP_EXPR - || TREE_CODE (first) == CONVERT_EXPR - || TREE_CODE (first) == NON_LVALUE_EXPR) - && (TYPE_MODE (TREE_TYPE (first)) - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (first, 0))))) - first = TREE_OPERAND (first, 0); - - if (last) - while ((TREE_CODE (last) == NOP_EXPR - || TREE_CODE (last) == CONVERT_EXPR - || TREE_CODE (last) == NON_LVALUE_EXPR) - && (TYPE_MODE (TREE_TYPE (last)) - == TYPE_MODE (TREE_TYPE (TREE_OPERAND (last, 0))))) - last = TREE_OPERAND (last, 0); - if (TREE_CODE (first) != INTEGER_CST) error_init ("nonconstant array index in initializer"); else if (last != 0 && TREE_CODE (last) != INTEGER_CST) @@ -5293,8 +5353,7 @@ set_init_label (tree fieldname) } if (tail == 0) - error ("unknown field %qs specified in initializer", - IDENTIFIER_POINTER (fieldname)); + error ("unknown field %qE specified in initializer", fieldname); else { constructor_fields = tail; @@ -6183,7 +6242,7 @@ process_init_element (struct c_expr value) if (warn_traditional && !in_system_header && !constructor_designated && !(value.value && (integer_zerop (value.value) || real_zerop (value.value)))) - warning ("traditional C rejects initialization of unions"); + warning (0, "traditional C rejects initialization of unions"); /* Accept a string constant to initialize a subarray. */ if (value.value != 0 @@ -6487,6 +6546,41 @@ c_finish_goto_label (tree label) if (!decl) return NULL_TREE; + if (C_DECL_UNJUMPABLE_STMT_EXPR (decl)) + { + error ("jump into statement expression"); + return NULL_TREE; + } + + if (C_DECL_UNJUMPABLE_VM (decl)) + { + error ("jump into scope of identifier with variably modified type"); + return NULL_TREE; + } + + if (!C_DECL_UNDEFINABLE_STMT_EXPR (decl)) + { + /* No jump from outside this statement expression context, so + record that there is a jump from within this context. */ + struct c_label_list *nlist; + nlist = XOBNEW (&parser_obstack, struct c_label_list); + nlist->next = label_context_stack_se->labels_used; + nlist->label = decl; + label_context_stack_se->labels_used = nlist; + } + + if (!C_DECL_UNDEFINABLE_VM (decl)) + { + /* No jump from outside this context context of identifiers with + variably modified type, so record that there is a jump from + within this context. */ + struct c_label_list *nlist; + nlist = XOBNEW (&parser_obstack, struct c_label_list); + nlist->next = label_context_stack_vm->labels_used; + nlist->label = decl; + label_context_stack_vm->labels_used = nlist; + } + TREE_USED (decl) = 1; return add_stmt (build1 (GOTO_EXPR, void_type_node, decl)); } @@ -6511,7 +6605,7 @@ c_finish_return (tree retval) tree valtype = TREE_TYPE (TREE_TYPE (current_function_decl)); if (TREE_THIS_VOLATILE (current_function_decl)) - warning ("function declared % has a % statement"); + warning (0, "function declared % has a % statement"); if (!retval) { @@ -6582,7 +6676,7 @@ c_finish_return (tree retval) && !DECL_EXTERNAL (inner) && !TREE_STATIC (inner) && DECL_CONTEXT (inner) == current_function_decl) - warning ("function returns address of local variable"); + warning (0, "function returns address of local variable"); break; default: @@ -6599,8 +6693,8 @@ c_finish_return (tree retval) } struct c_switch { - /* The SWITCH_STMT being built. */ - tree switch_stmt; + /* The SWITCH_EXPR being built. */ + tree switch_expr; /* The original type of the testing expression, i.e. before the default conversion is applied. */ @@ -6613,6 +6707,16 @@ struct c_switch { of the GNU case range extension. */ splay_tree cases; + /* Number of nested statement expressions within this switch + statement; if nonzero, case and default labels may not + appear. */ + unsigned int blocked_stmt_expr; + + /* Scope of outermost declarations of identifiers with variably + modified type within this switch statement; if nonzero, case and + default labels may not appear. */ + unsigned int blocked_vm; + /* The next node on the stack. */ struct c_switch *next; }; @@ -6626,7 +6730,7 @@ struct c_switch { struct c_switch *c_switch_stack; /* Start a C switch statement, testing expression EXP. Return the new - SWITCH_STMT. */ + SWITCH_EXPR. */ tree c_start_case (tree exp) @@ -6654,7 +6758,7 @@ c_start_case (tree exp) if (warn_traditional && !in_system_header && (type == long_integer_type_node || type == long_unsigned_type_node)) - warning ("% switch expression not converted to " + warning (0, "% switch expression not converted to " "% in ISO C"); exp = default_conversion (exp); @@ -6662,15 +6766,17 @@ c_start_case (tree exp) } } - /* Add this new SWITCH_STMT to the stack. */ + /* Add this new SWITCH_EXPR to the stack. */ cs = XNEW (struct c_switch); - cs->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type); + cs->switch_expr = build3 (SWITCH_EXPR, orig_type, exp, NULL_TREE, NULL_TREE); cs->orig_type = orig_type; cs->cases = splay_tree_new (case_compare, NULL, NULL); + cs->blocked_stmt_expr = 0; + cs->blocked_vm = 0; cs->next = c_switch_stack; c_switch_stack = cs; - return add_stmt (cs->switch_stmt); + return add_stmt (cs->switch_expr); } /* Process a case label. */ @@ -6680,15 +6786,34 @@ do_case (tree low_value, tree high_value) { tree label = NULL_TREE; - if (c_switch_stack) + if (c_switch_stack && !c_switch_stack->blocked_stmt_expr + && !c_switch_stack->blocked_vm) { label = c_add_case_label (c_switch_stack->cases, - SWITCH_STMT_COND (c_switch_stack->switch_stmt), + SWITCH_COND (c_switch_stack->switch_expr), c_switch_stack->orig_type, low_value, high_value); if (label == error_mark_node) label = NULL_TREE; } + else if (c_switch_stack && c_switch_stack->blocked_stmt_expr) + { + if (low_value) + error ("case label in statement expression not containing " + "enclosing switch statement"); + else + error ("% label in statement expression not containing " + "enclosing switch statement"); + } + else if (c_switch_stack && c_switch_stack->blocked_vm) + { + if (low_value) + error ("case label in scope of identifier with variably modified " + "type not containing enclosing switch statement"); + else + error ("% label in scope of identifier with variably " + "modified type not containing enclosing switch statement"); + } else if (low_value) error ("case label not within a switch statement"); else @@ -6703,11 +6828,23 @@ void c_finish_case (tree body) { struct c_switch *cs = c_switch_stack; + location_t switch_location; + + SWITCH_BODY (cs->switch_expr) = body; - SWITCH_STMT_BODY (cs->switch_stmt) = body; + /* We must not be within a statement expression nested in the switch + at this point; we might, however, be within the scope of an + identifier with variably modified type nested in the switch. */ + gcc_assert (!cs->blocked_stmt_expr); /* Emit warnings as needed. */ - c_do_switch_warnings (cs->cases, cs->switch_stmt); + if (EXPR_HAS_LOCATION (cs->switch_expr)) + switch_location = EXPR_LOCATION (cs->switch_expr); + else + switch_location = input_location; + c_do_switch_warnings (cs->cases, switch_location, + TREE_TYPE (cs->switch_expr), + SWITCH_COND (cs->switch_expr)); /* Pop the stack. */ c_switch_stack = cs->next; @@ -6756,7 +6893,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block, found: if (COND_EXPR_ELSE (inner_if)) - warning ("%Hsuggest explicit braces to avoid ambiguous %", + warning (0, "%Hsuggest explicit braces to avoid ambiguous %", &if_locus); } @@ -6766,7 +6903,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block, if (TREE_CODE (then_block) == NOP_EXPR && !TREE_TYPE (then_block)) { if (!else_block) - warning ("%Hempty body in an if-statement", + warning (0, "%Hempty body in an if-statement", EXPR_LOCUS (then_block)); then_block = alloc_stmt_list (); } @@ -6774,7 +6911,7 @@ c_finish_if_stmt (location_t if_locus, tree cond, tree then_block, && TREE_CODE (else_block) == NOP_EXPR && !TREE_TYPE (else_block)) { - warning ("%Hempty body in an else-statement", + warning (0, "%Hempty body in an else-statement", EXPR_LOCUS (else_block)); else_block = alloc_stmt_list (); } @@ -6905,7 +7042,7 @@ emit_side_effect_warnings (tree expr) else if (!TREE_SIDE_EFFECTS (expr)) { if (!VOID_TYPE_P (TREE_TYPE (expr)) && !TREE_NO_WARNING (expr)) - warning ("%Hstatement with no effect", + warning (0, "%Hstatement with no effect", EXPR_HAS_LOCATION (expr) ? EXPR_LOCUS (expr) : &input_location); } else if (warn_unused_value) @@ -6972,12 +7109,30 @@ tree c_begin_stmt_expr (void) { tree ret; + struct c_label_context_se *nstack; + struct c_label_list *glist; /* We must force a BLOCK for this level so that, if it is not expanded later, there is a way to turn off the entire subtree of blocks that are contained in it. */ keep_next_level (); ret = c_begin_compound_stmt (true); + if (c_switch_stack) + { + c_switch_stack->blocked_stmt_expr++; + gcc_assert (c_switch_stack->blocked_stmt_expr != 0); + } + for (glist = label_context_stack_se->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_STMT_EXPR (glist->label) = 1; + } + nstack = XOBNEW (&parser_obstack, struct c_label_context_se); + nstack->labels_def = NULL; + nstack->labels_used = NULL; + nstack->next = label_context_stack_se; + label_context_stack_se = nstack; /* Mark the current statement list as belonging to a statement list. */ STATEMENT_LIST_STMT_EXPR (ret) = 1; @@ -6990,8 +7145,37 @@ c_finish_stmt_expr (tree body) { tree last, type, tmp, val; tree *last_p; + struct c_label_list *dlist, *glist, *glist_prev = NULL; body = c_end_compound_stmt (body, true); + if (c_switch_stack) + { + gcc_assert (c_switch_stack->blocked_stmt_expr != 0); + c_switch_stack->blocked_stmt_expr--; + } + /* It is no longer possible to jump to labels defined within this + statement expression. */ + for (dlist = label_context_stack_se->labels_def; + dlist != NULL; + dlist = dlist->next) + { + C_DECL_UNJUMPABLE_STMT_EXPR (dlist->label) = 1; + } + /* It is again possible to define labels with a goto just outside + this statement expression. */ + for (glist = label_context_stack_se->next->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_STMT_EXPR (glist->label) = 0; + glist_prev = glist; + } + if (glist_prev != NULL) + glist_prev->next = label_context_stack_se->labels_used; + else + label_context_stack_se->next->labels_used + = label_context_stack_se->labels_used; + label_context_stack_se = label_context_stack_se->next; /* Locate the last statement in BODY. See c_end_compound_stmt about always returning a BIND_EXPR. */ @@ -7062,6 +7246,75 @@ c_finish_stmt_expr (tree body) return build4 (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE); } + +/* Begin the scope of an identifier of variably modified type, scope + number SCOPE. Jumping from outside this scope to inside it is not + permitted. */ + +void +c_begin_vm_scope (unsigned int scope) +{ + struct c_label_context_vm *nstack; + struct c_label_list *glist; + + gcc_assert (scope > 0); + if (c_switch_stack && !c_switch_stack->blocked_vm) + c_switch_stack->blocked_vm = scope; + for (glist = label_context_stack_vm->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_VM (glist->label) = 1; + } + nstack = XOBNEW (&parser_obstack, struct c_label_context_vm); + nstack->labels_def = NULL; + nstack->labels_used = NULL; + nstack->scope = scope; + nstack->next = label_context_stack_vm; + label_context_stack_vm = nstack; +} + +/* End a scope which may contain identifiers of variably modified + type, scope number SCOPE. */ + +void +c_end_vm_scope (unsigned int scope) +{ + if (label_context_stack_vm == NULL) + return; + if (c_switch_stack && c_switch_stack->blocked_vm == scope) + c_switch_stack->blocked_vm = 0; + /* We may have a number of nested scopes of identifiers with + variably modified type, all at this depth. Pop each in turn. */ + while (label_context_stack_vm->scope == scope) + { + struct c_label_list *dlist, *glist, *glist_prev = NULL; + + /* It is no longer possible to jump to labels defined within this + scope. */ + for (dlist = label_context_stack_vm->labels_def; + dlist != NULL; + dlist = dlist->next) + { + C_DECL_UNJUMPABLE_VM (dlist->label) = 1; + } + /* It is again possible to define labels with a goto just outside + this scope. */ + for (glist = label_context_stack_vm->next->labels_used; + glist != NULL; + glist = glist->next) + { + C_DECL_UNDEFINABLE_VM (glist->label) = 0; + glist_prev = glist; + } + if (glist_prev != NULL) + glist_prev->next = label_context_stack_vm->labels_used; + else + label_context_stack_vm->next->labels_used + = label_context_stack_vm->labels_used; + label_context_stack_vm = label_context_stack_vm->next; + } +} /* Begin and end compound statements. This is as simple as pushing and popping new statement lists from the tree. */ @@ -7257,7 +7510,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, /* Floating point division by zero is a legitimate way to obtain infinities and NaNs. */ if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1)) - warning ("division by zero"); + warning (0, "division by zero"); if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE || code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE) @@ -7296,7 +7549,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case TRUNC_MOD_EXPR: case FLOOR_MOD_EXPR: if (warn_div_by_zero && skip_evaluation == 0 && integer_zerop (op1)) - warning ("division by zero"); + warning (0, "division by zero"); if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) { @@ -7325,8 +7578,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, but that does not mean the operands should be converted to ints! */ result_type = integer_type_node; - op0 = lang_hooks.truthvalue_conversion (op0); - op1 = lang_hooks.truthvalue_conversion (op1); + op0 = c_common_truthvalue_conversion (op0); + op1 = c_common_truthvalue_conversion (op1); converted = 1; } break; @@ -7341,14 +7594,14 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0) { if (tree_int_cst_sgn (op1) < 0) - warning ("right shift count is negative"); + warning (0, "right shift count is negative"); else { if (!integer_zerop (op1)) short_shift = 1; if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("right shift count >= width of type"); + warning (0, "right shift count >= width of type"); } } @@ -7369,10 +7622,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST && skip_evaluation == 0) { if (tree_int_cst_sgn (op1) < 0) - warning ("left shift count is negative"); + warning (0, "left shift count is negative"); else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("left shift count >= width of type"); + warning (0, "left shift count >= width of type"); } /* Use the type of the value to be shifted. */ @@ -7389,7 +7642,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case EQ_EXPR: case NE_EXPR: if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE)) - warning ("comparing floating point with == or != is unsafe"); + warning (0, "comparing floating point with == or != is unsafe"); /* Result of comparison is always int, but don't convert the args to int! */ build_type = integer_type_node; @@ -7706,7 +7959,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, c_common_signed_type (result_type))) /* OK */; else - warning ("comparison between signed and unsigned"); + warning (0, "comparison between signed and unsigned"); } /* Warn if two unsigned values are being compared in a size @@ -7752,7 +8005,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, { mask = (~(HOST_WIDE_INT) 0) << bits; if ((mask & constant) != mask) - warning ("comparison of promoted ~unsigned with constant"); + warning (0, "comparison of promoted ~unsigned with constant"); } } else if (unsignedp0 && unsignedp1 @@ -7760,7 +8013,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, < TYPE_PRECISION (result_type)) && (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (result_type))) - warning ("comparison of promoted ~unsigned with unsigned"); + warning (0, "comparison of promoted ~unsigned with unsigned"); } } } @@ -7806,3 +8059,34 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, return result; } } + + +/* Convert EXPR to be a truth-value, validating its type for this + purpose. Passes EXPR to default_function_array_conversion. */ + +tree +c_objc_common_truthvalue_conversion (tree expr) +{ + expr = default_function_array_conversion (expr); + switch (TREE_CODE (TREE_TYPE (expr))) + { + case ARRAY_TYPE: + error ("used array that cannot be converted to pointer where scalar is required"); + return error_mark_node; + + case RECORD_TYPE: + error ("used struct type value where scalar is required"); + return error_mark_node; + + case UNION_TYPE: + error ("used union type value where scalar is required"); + return error_mark_node; + + default: + break; + } + + /* ??? Should we also give an error for void and vectors rather than + leaving those to give errors later? */ + return c_common_truthvalue_conversion (expr); +} diff --git a/gcc/c.opt b/gcc/c.opt index e5260f1671c..d06ac94772e 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -18,6 +18,7 @@ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA ; 02111-1307, USA. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -57,7 +58,7 @@ C ObjC C++ ObjC++ Undocumented F C ObjC C++ ObjC++ Joined Separate --F Add to the end of the main framework include path +-F Add to the end of the main framework include path H C ObjC C++ ObjC++ @@ -119,6 +120,10 @@ Wall C ObjC C++ ObjC++ Enable most warning messages +Wassign-intercept +ObjC ObjC++ Var(warn_assign_intercept) +Warn whenever an Objective-C assignment is being intercepted by the garbage collector + Wbad-function-cast C ObjC Var(warn_bad_function_cast) Warn about casting functions to incompatible types @@ -225,6 +230,10 @@ Wimport C ObjC C++ ObjC++ Deprecated. This switch has no effect. +Wint-to-pointer-cast +C ObjC Var(warn_int_to_pointer_cast) Init(1) +Warn when there is a cast to a pointer from an integer of a different size + Winvalid-offsetof C++ ObjC++ Var(warn_invalid_offsetof) Init(1) Warn about invalid uses of the \"offsetof\" macro @@ -313,6 +322,10 @@ Wpointer-arith C ObjC C++ ObjC++ Var(warn_pointer_arith) Warn about function pointer arithmetic +Wpointer-to-int-cast +C ObjC Var(warn_pointer_to_int_cast) Init(1) +Warn when a pointer is cast to an integer of a different size + Wprotocol ObjC ObjC++ Var(warn_protocol) Init(1) Warn if inherited methods are unimplemented @@ -345,10 +358,18 @@ Wsign-promo C++ ObjC++ Var(warn_sign_promo) Warn when overload promotes from unsigned to signed +Wstrict-null-sentinel +C++ ObjC++ +Warn about uncasted NULL used as sentinel + Wstrict-prototypes C ObjC Var(warn_strict_prototypes) Warn about unprototyped function declarations +Wstrict-selector-match +ObjC ObjC++ Var(warn_strict_selector_match) +Warn if type signatures of candidate methods do not match exactly + Wsynth C++ ObjC++ Var(warn_synth) Warn when synthesis behavior differs from Cfront @@ -395,7 +416,7 @@ Warn when a pointer differs in signedness in an assignment. ansi C ObjC C++ ObjC++ -A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead +A synonym for -std=c89 (for C) or -std=c++98 (for C++). d C ObjC C++ ObjC++ Joined @@ -467,7 +488,7 @@ C ObjC C++ ObjC++ Joined RejectNegative finput-charset= C ObjC C++ ObjC++ Joined RejectNegative --finput-charset= Specify the default character set for source files. +-finput-charset= Specify the default character set for source files. fexternal-templates @@ -551,12 +572,29 @@ C++ ObjC++ fnonnull-objects C++ ObjC++ +; Generate special '- .cxx_construct' and '- .cxx_destruct' methods +; to initialize any non-POD ivars in Objective-C++ classes. +fobjc-call-cxx-cdtors +ObjC++ Var(flag_objc_call_cxx_cdtors) +Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed + +fobjc-direct-dispatch +ObjC ObjC++ Var(flag_objc_direct_dispatch) +Allow fast jumps to the message dispatcher + +; Nonzero means that we will allow new ObjC exception syntax (@throw, +; @try, etc.) in source code. fobjc-exceptions -ObjC ObjC++ +ObjC ObjC++ Var(flag_objc_exceptions) Enable Objective-C exception and synchronization syntax +fobjc-gc +ObjC ObjC++ Var(flag_objc_gc) +Enable garbage collection (GC) in Objective-C/Objective-C++ programs + +; Nonzero means that we generate NeXT setjmp based exceptions. fobjc-sjlj-exceptions -ObjC ObjC++ +ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1) Enable Objective-C setjmp exception handling runtime foperator-names @@ -606,9 +644,6 @@ fshort-wchar C ObjC C++ ObjC++ Force the underlying type for \"wchar_t\" to be \"unsigned short\" -fshow-column -C ObjC C++ ObjC++ - fsigned-bitfields C ObjC C++ ObjC++ When \"signed\" or \"unsigned\" is not given make the bitfield signed @@ -655,7 +690,7 @@ C++ ObjC++ Use __cxa_atexit to register destructors fvisibility-inlines-hidden -C++ +C++ ObjC++ Marks all inlined methods as having hidden visibility fvtable-gc @@ -756,6 +791,10 @@ print-objc-runtime-info ObjC ObjC++ Generate C header of platform-specific features +print-pch-checksum +C ObjC C++ ObjC++ +Print a checksum of the executable for PCH validity checking, and stop. + remap C ObjC C++ ObjC++ Remap file names when including files @@ -794,7 +833,7 @@ Deprecated in favor of -std=gnu99 std=iso9899:1990 C ObjC -Deprecated in favor of -std=c89 +Conform to the ISO 1990 C standard std=iso9899:199409 C ObjC @@ -802,11 +841,11 @@ Conform to the ISO 1990 C standard as amended in 1994 std=iso9899:1999 C ObjC -Deprecated in favor of -std=c99 +Conform to the ISO 1999 C standard std=iso9899:199x C ObjC -Deprecated in favor of -std=c99 +Deprecated in favor of -std=iso9899:1999 traditional-cpp C ObjC C++ ObjC++ diff --git a/gcc/caller-save.c b/gcc/caller-save.c index 834463f3ef8..101ec518841 100644 --- a/gcc/caller-save.c +++ b/gcc/caller-save.c @@ -1,6 +1,6 @@ /* Save and restore call-clobbered registers which are live across a call. Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -642,12 +642,12 @@ insert_restore (struct insn_chain *chain, int before_p, int regno, unsigned int numregs = 0; rtx mem; - /* A common failure mode if register status is not correct in the RTL - is for this routine to be called with a REGNO we didn't expect to - save. That will cause us to write an insn with a (nil) SET_DEST - or SET_SRC. Instead of doing so and causing a crash later, check - for this common case and abort here instead. This will remove one - step in debugging such problems. */ + /* A common failure mode if register status is not correct in the + RTL is for this routine to be called with a REGNO we didn't + expect to save. That will cause us to write an insn with a (nil) + SET_DEST or SET_SRC. Instead of doing so and causing a crash + later, check for this common case here instead. This will remove + one step in debugging such problems. */ gcc_assert (regno_save_mem[regno][1]); /* Get the pattern to emit and update our status. @@ -713,11 +713,11 @@ insert_save (struct insn_chain *chain, int before_p, int regno, unsigned int numregs = 0; rtx mem; - /* A common failure mode if register status is not correct in the RTL - is for this routine to be called with a REGNO we didn't expect to - save. That will cause us to write an insn with a (nil) SET_DEST - or SET_SRC. Instead of doing so and causing a crash later, check - for this common case and abort here instead. This will remove one + /* A common failure mode if register status is not correct in the + RTL is for this routine to be called with a REGNO we didn't + expect to save. That will cause us to write an insn with a (nil) + SET_DEST or SET_SRC. Instead of doing so and causing a crash + later, check for this common case here. This will remove one step in debugging such problems. */ gcc_assert (regno_save_mem[regno][1]); diff --git a/gcc/calls.c b/gcc/calls.c index a6a071a09f8..3c4cbf8949a 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -71,8 +71,8 @@ struct arg_data /* If REG was promoted from the actual mode of the argument expression, indicates whether the promotion is sign- or zero-extended. */ int unsignedp; - /* Number of registers to use. 0 means put the whole arg in registers. - Also 0 if not passed in registers. */ + /* Number of bytes to put in registers. 0 means put the whole arg + in registers. Also 0 if not passed in registers. */ int partial; /* Nonzero if argument must be passed on stack. Note that some arguments may be passed on the stack @@ -1473,10 +1473,10 @@ load_register_parameters (struct arg_data *args, int num_actuals, int nregs; int size = 0; rtx before_arg = get_last_insn (); - /* Set to non-negative if must move a word at a time, even if just - one word (e.g, partial == 1 && mode == DFmode). Set to -1 if - we just use a normal move insn. This value can be zero if the - argument is a zero size structure with no fields. */ + /* Set non-negative if we must move a word at a time, even if + just one word (e.g, partial == 4 && mode == DFmode). Set + to -1 if we just use a normal move insn. This value can be + zero if the argument is a zero size structure. */ nregs = -1; if (GET_CODE (reg) == PARALLEL) ; @@ -1766,30 +1766,6 @@ shift_return_value (enum machine_mode mode, bool left_p, rtx value) return true; } -/* Remove all REG_EQUIV notes found in the insn chain. */ - -static void -purge_reg_equiv_notes (void) -{ - rtx insn; - - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - { - while (1) - { - rtx note = find_reg_note (insn, REG_EQUIV, 0); - if (note) - { - /* Remove the note and keep looking at the notes for - this insn. */ - remove_note (insn, note); - continue; - } - break; - } - } -} - /* Generate all the code for a function call and return an rtx for its value. Store the value in TARGET (specified as an rtx) if convenient. @@ -1934,8 +1910,8 @@ expand_call (tree exp, rtx target, int ignore) /* Warn if this value is an aggregate type, regardless of which calling convention we are using for it. */ - if (warn_aggregate_return && AGGREGATE_TYPE_P (TREE_TYPE (exp))) - warning ("function call has aggregate value"); + if (AGGREGATE_TYPE_P (TREE_TYPE (exp))) + warning (OPT_Waggregate_return, "function call has aggregate value"); /* If the result of a pure or const function call is ignored (or void), and none of its arguments are volatile, we can avoid expanding the @@ -2197,8 +2173,11 @@ expand_call (tree exp, rtx target, int ignore) the argument areas are shared. */ || (fndecl && decl_function_context (fndecl) == current_function_decl) /* If this function requires more stack slots than the current - function, we cannot change it into a sibling call. */ - || args_size.constant > current_function_args_size + function, we cannot change it into a sibling call. + current_function_pretend_args_size is not part of the + stack allocated by our caller. */ + || args_size.constant > (current_function_args_size + - current_function_pretend_args_size) /* If the callee pops its own arguments, then it must pop exactly the same number of arguments as the current function. */ || (RETURN_POPS_ARGS (fndecl, funtype, args_size.constant) @@ -2261,10 +2240,14 @@ expand_call (tree exp, rtx target, int ignore) Also, do all pending adjustments now if there is any chance this might be a call to alloca or if we are expanding a sibling call sequence or if we are calling a function that is to return - with stack pointer depressed. */ + with stack pointer depressed. + Also do the adjustments before a throwing call, otherwise + exception handling can fail; PR 19225. */ if (pending_stack_adjust >= 32 || (pending_stack_adjust > 0 && (flags & (ECF_MAY_BE_ALLOCA | ECF_SP_DEPRESSED))) + || (pending_stack_adjust > 0 + && flag_exceptions && !(flags & ECF_NOTHROW)) || pass == 0) do_pending_stack_adjust (); @@ -3043,16 +3026,40 @@ expand_call (tree exp, rtx target, int ignore) this function's incoming arguments. At the start of RTL generation we know the only REG_EQUIV notes - in the rtl chain are those for incoming arguments, so we can safely - flush any REG_EQUIV note. + in the rtl chain are those for incoming arguments, so we can look + for REG_EQUIV notes between the start of the function and the + NOTE_INSN_FUNCTION_BEG. This is (slight) overkill. We could keep track of the highest argument we clobber and be more selective in removing notes, but it does not seem to be worth the effort. */ + void fixup_tail_calls (void) { - purge_reg_equiv_notes (); + rtx insn; + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + /* There are never REG_EQUIV notes for the incoming arguments + after the NOTE_INSN_FUNCTION_BEG note, so stop if we see it. */ + if (NOTE_P (insn) + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG) + break; + + while (1) + { + rtx note = find_reg_note (insn, REG_EQUIV, 0); + if (note) + { + /* Remove the note and keep looking at the notes for + this insn. */ + remove_note (insn, note); + continue; + } + break; + } + } } /* Traverse an argument list in VALUES and expand all complex diff --git a/gcc/cfg.c b/gcc/cfg.c index 03f1ee1f9d2..c1cf389e69f 100644 --- a/gcc/cfg.c +++ b/gcc/cfg.c @@ -60,7 +60,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "except.h" #include "toplev.h" #include "tm_p.h" -#include "alloc-pool.h" +#include "obstack.h" #include "timevar.h" #include "ggc.h" @@ -68,44 +68,22 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA struct bitmap_obstack reg_obstack; -/* Number of basic blocks in the current function. */ - -int n_basic_blocks; - -/* First free basic block number. */ - -int last_basic_block; - -/* Number of edges in the current function. */ - -int n_edges; - -/* The basic block array. */ - -varray_type basic_block_info; - -/* The special entry and exit blocks. */ -basic_block ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR; - -/* Memory alloc pool for bb member rbi. */ -static alloc_pool rbi_pool; - void debug_flow_info (void); static void free_edge (edge); - -/* Indicate the presence of the profile. */ -enum profile_status profile_status; +#define RDIV(X,Y) (((X) + (Y) / 2) / (Y)) + /* Called once at initialization time. */ void init_flow (void) { + if (!cfun->cfg) + cfun->cfg = ggc_alloc_cleared (sizeof (struct control_flow_graph)); n_edges = 0; - - ENTRY_BLOCK_PTR = ggc_alloc_cleared (sizeof (*ENTRY_BLOCK_PTR)); + ENTRY_BLOCK_PTR = ggc_alloc_cleared (sizeof (struct basic_block_def)); ENTRY_BLOCK_PTR->index = ENTRY_BLOCK; - EXIT_BLOCK_PTR = ggc_alloc_cleared (sizeof (*EXIT_BLOCK_PTR)); + EXIT_BLOCK_PTR = ggc_alloc_cleared (sizeof (struct basic_block_def)); EXIT_BLOCK_PTR->index = EXIT_BLOCK; ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR; EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR; @@ -156,24 +134,6 @@ alloc_block (void) return bb; } -/* Create memory pool for rbi_pool. */ - -void -alloc_rbi_pool (void) -{ - rbi_pool = create_alloc_pool ("rbi pool", - sizeof (struct reorder_block_def), - n_basic_blocks + 2); -} - -/* Free rbi_pool. */ - -void -free_rbi_pool (void) -{ - free_alloc_pool (rbi_pool); -} - /* Initialize rbi (the structure containing data used by basic block duplication and reordering) for the given basic block. */ @@ -181,8 +141,7 @@ void initialize_bb_rbi (basic_block bb) { gcc_assert (!bb->rbi); - bb->rbi = pool_alloc (rbi_pool); - memset (bb->rbi, 0, sizeof (struct reorder_block_def)); + bb->rbi = ggc_alloc_cleared (sizeof (struct reorder_block_def)); } /* Link block B to chain after AFTER. */ @@ -248,7 +207,7 @@ expunge_block (basic_block b) static inline void connect_src (edge e) { - VEC_safe_push (edge, e->src->succs, e); + VEC_safe_push (edge, gc, e->src->succs, e); } /* Connect E to E->dest. */ @@ -257,7 +216,7 @@ static inline void connect_dest (edge e) { basic_block dest = e->dest; - VEC_safe_push (edge, dest->preds, e); + VEC_safe_push (edge, gc, dest->preds, e); e->dest_idx = EDGE_COUNT (dest->preds) - 1; } @@ -459,7 +418,7 @@ clear_bb_flags (void) basic_block bb; FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) - bb->flags = BB_PARTITION (bb); + bb->flags = BB_PARTITION (bb) | (bb->flags & BB_DISABLE_SCHEDULE); } /* Check the consistency of profile information. We can't do that @@ -514,15 +473,14 @@ check_bb_profile (basic_block bb, FILE * file) void dump_flow_info (FILE *file) { - int i; basic_block bb; /* There are no pseudo registers after reload. Don't dump them. */ if (reg_n_info && !reload_completed) { - int max_regno = max_reg_num (); - fprintf (file, "%d registers.\n", max_regno); - for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + unsigned int i, max = max_reg_num (); + fprintf (file, "%d registers.\n", max); + for (i = FIRST_PSEUDO_REGISTER; i < max; i++) if (REG_N_REFS (i)) { enum reg_class class, altclass; @@ -933,15 +891,51 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency, } else if (prob != REG_BR_PROB_BASE) { - int scale = REG_BR_PROB_BASE / prob; + int scale = 65536 * REG_BR_PROB_BASE / prob; FOR_EACH_EDGE (c, ei, bb->succs) - c->probability *= scale; + c->probability *= scale / 65536; } - if (bb != taken_edge->src) - abort (); + gcc_assert (bb == taken_edge->src); taken_edge->count -= count; if (taken_edge->count < 0) taken_edge->count = 0; } + +/* Multiply all frequencies of basic blocks in array BBS of length NBBS + by NUM/DEN, in int arithmetic. May lose some accuracy. */ +void +scale_bbs_frequencies_int (basic_block *bbs, int nbbs, int num, int den) +{ + int i; + edge e; + for (i = 0; i < nbbs; i++) + { + edge_iterator ei; + bbs[i]->frequency = (bbs[i]->frequency * num) / den; + bbs[i]->count = RDIV (bbs[i]->count * num, den); + FOR_EACH_EDGE (e, ei, bbs[i]->succs) + e->count = (e->count * num) /den; + } +} + +/* Multiply all frequencies of basic blocks in array BBS of length NBBS + by NUM/DEN, in gcov_type arithmetic. More accurate than previous + function but considerably slower. */ +void +scale_bbs_frequencies_gcov_type (basic_block *bbs, int nbbs, gcov_type num, + gcov_type den) +{ + int i; + edge e; + + for (i = 0; i < nbbs; i++) + { + edge_iterator ei; + bbs[i]->frequency = (bbs[i]->frequency * num) / den; + bbs[i]->count = RDIV (bbs[i]->count * num, den); + FOR_EACH_EDGE (e, ei, bbs[i]->succs) + e->count = (e->count * num) /den; + } +} diff --git a/gcc/cfganal.c b/gcc/cfganal.c index 5afbabc19e0..6c707729b70 100644 --- a/gcc/cfganal.c +++ b/gcc/cfganal.c @@ -69,7 +69,7 @@ flow_active_insn_p (rtx insn) programs that fail to return a value. Its effect is to keep the return value from being live across the entire function. If we allow it to be skipped, we introduce the - possibility for register livetime aborts. */ + possibility for register lifetime confusion. */ if (GET_CODE (PATTERN (insn)) == CLOBBER && REG_P (XEXP (PATTERN (insn), 0)) && REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0))) diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 49cbb44a9f2..10e6f101eed 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -155,9 +155,8 @@ try_simplify_condjump (basic_block cbranch_block) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (BB_PARTITION (jump_block) != BB_PARTITION (jump_dest_block) - || (cbranch_jump_edge->flags & EDGE_CROSSING))) + if (BB_PARTITION (jump_block) != BB_PARTITION (jump_dest_block) + || (cbranch_jump_edge->flags & EDGE_CROSSING)) return false; /* The conditional branch must target the block after the @@ -435,8 +434,7 @@ try_forward_edges (int mode, basic_block b) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)) + if (find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX)) return false; for (ei = ei_start (b->succs); (e = ei_safe_edge (ei)); ) @@ -471,8 +469,7 @@ try_forward_edges (int mode, basic_block b) bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && first != EXIT_BLOCK_PTR + if (first != EXIT_BLOCK_PTR && find_reg_note (BB_END (first), REG_CROSSING_JUMP, NULL_RTX)) return false; @@ -539,7 +536,7 @@ try_forward_edges (int mode, basic_block b) For fallthru forwarders, the LOOP_BEG note must appear between the header of block and CODE_LABEL of the loop, for non forwarders it must appear before the JUMP_INSN. */ - if ((mode & CLEANUP_PRE_LOOP) && optimize) + if ((mode & CLEANUP_PRE_LOOP) && optimize && flag_loop_optimize) { rtx insn = (EDGE_SUCC (target, 0)->flags & EDGE_FALLTHRU ? BB_HEAD (target) : prev_nonnote_insn (BB_END (target))); @@ -684,9 +681,7 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (BB_PARTITION (a) != BB_PARTITION (b) - || find_reg_note (BB_END (a), REG_CROSSING_JUMP, NULL_RTX))) + if (BB_PARTITION (a) != BB_PARTITION (b)) return; barrier = next_nonnote_insn (BB_END (a)); @@ -742,9 +737,7 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (find_reg_note (BB_END (a), REG_CROSSING_JUMP, NULL_RTX) - || BB_PARTITION (a) != BB_PARTITION (b))) + if (BB_PARTITION (a) != BB_PARTITION (b)) return; real_b_end = BB_END (b); @@ -814,10 +807,7 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX) - || find_reg_note (BB_END (c), REG_CROSSING_JUMP, NULL_RTX) - || BB_PARTITION (b) != BB_PARTITION (c))) + if (BB_PARTITION (b) != BB_PARTITION (c)) return NULL; @@ -1687,6 +1677,8 @@ try_crossjump_to_edge (int mode, edge e1, edge e2) delete_basic_block (to_remove); update_forwarder_flag (redirect_from); + if (redirect_to != src2) + update_forwarder_flag (src2); return true; } @@ -1725,9 +1717,9 @@ try_crossjump_bb (int mode, basic_block bb) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (BB_PARTITION (EDGE_PRED (bb, 0)->src) != BB_PARTITION (EDGE_PRED (bb, 1)->src) - || (EDGE_PRED (bb, 0)->flags & EDGE_CROSSING))) + if (BB_PARTITION (EDGE_PRED (bb, 0)->src) != + BB_PARTITION (EDGE_PRED (bb, 1)->src) + || (EDGE_PRED (bb, 0)->flags & EDGE_CROSSING)) return false; /* It is always cheapest to redirect a block that ends in a branch to diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index e339505596f..cd9829e60de 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -49,29 +49,27 @@ add_reg_br_prob_note (FILE *dump_file, rtx last, int probability) if (profile_status == PROFILE_ABSENT) return; for (last = NEXT_INSN (last); last && NEXT_INSN (last); last = NEXT_INSN (last)) - if (GET_CODE (last) == JUMP_INSN) + if (JUMP_P (last)) { /* It is common to emit condjump-around-jump sequence when we don't know how to reverse the conditional. Special case this. */ if (!any_condjump_p (last) - || GET_CODE (NEXT_INSN (last)) != JUMP_INSN + || !JUMP_P (NEXT_INSN (last)) || !simplejump_p (NEXT_INSN (last)) - || GET_CODE (NEXT_INSN (NEXT_INSN (last))) != BARRIER - || GET_CODE (NEXT_INSN (NEXT_INSN (NEXT_INSN (last)))) != CODE_LABEL + || !BARRIER_P (NEXT_INSN (NEXT_INSN (last))) + || !LABEL_P (NEXT_INSN (NEXT_INSN (NEXT_INSN (last)))) || NEXT_INSN (NEXT_INSN (NEXT_INSN (NEXT_INSN (last))))) goto failed; - if (find_reg_note (last, REG_BR_PROB, 0)) - abort (); + gcc_assert (!find_reg_note (last, REG_BR_PROB, 0)); REG_NOTES (last) = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (REG_BR_PROB_BASE - probability), REG_NOTES (last)); return; } - if (!last || GET_CODE (last) != JUMP_INSN || !any_condjump_p (last)) - goto failed; - if (find_reg_note (last, REG_BR_PROB, 0)) - abort (); + if (!last || !JUMP_P (last) || !any_condjump_p (last)) + goto failed; + gcc_assert (!find_reg_note (last, REG_BR_PROB, 0)); REG_NOTES (last) = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (probability), REG_NOTES (last)); @@ -599,7 +597,7 @@ expand_one_register_var (tree var) } /* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL that - has some associated error, e.g. it's type is error-mark. We just need + has some associated error, e.g. its type is error-mark. We just need to pick something that won't crash the rest of the compiler. */ static void @@ -1320,7 +1318,7 @@ tree_expand_cfg (void) blocks = sbitmap_alloc (last_basic_block); sbitmap_ones (blocks); find_many_sub_basic_blocks (blocks); - purge_all_dead_edges (0); + purge_all_dead_edges (); sbitmap_free (blocks); compact_blocks (); diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c index 4f8f18a97c6..bf7921806b2 100644 --- a/gcc/cfghooks.c +++ b/gcc/cfghooks.c @@ -823,3 +823,66 @@ execute_on_shrinking_pred (edge e) if (cfg_hooks->execute_on_shrinking_pred) cfg_hooks->execute_on_shrinking_pred (e); } + +/* This is used inside loop versioning when we want to insert + stmts/insns on the edges, which have a different behaviour + in tree's and in RTL, so we made a CFG hook. */ +void +lv_flush_pending_stmts (edge e) +{ + if (cfg_hooks->flush_pending_stmts) + cfg_hooks->flush_pending_stmts (e); +} + +/* Loop versioning uses the duplicate_loop_to_header_edge to create + a new version of the loop basic-blocks, the parameters here are + exactly the same as in duplicate_loop_to_header_edge or + tree_duplicate_loop_to_header_edge; while in tree-ssa there is + additional work to maintain ssa information that's why there is + a need to call the tree_duplicate_loop_to_header_edge rather + than duplicate_loop_to_header_edge when we are in tree mode. */ +bool +cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e, + struct loops *loops, unsigned int ndupl, + sbitmap wont_exit, edge orig, + edge *to_remove, + unsigned int *n_to_remove, int flags) +{ + gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge); + return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e, loops, + ndupl, wont_exit, + orig, to_remove, + n_to_remove, flags); +} + +/* Conditional jumps are represented differently in trees and RTL, + this hook takes a basic block that is known to have a cond jump + at its end and extracts the taken and not taken eges out of it + and store it in E1 and E2 respectively. */ +void +extract_cond_bb_edges (basic_block b, edge *e1, edge *e2) +{ + gcc_assert (cfg_hooks->extract_cond_bb_edges); + cfg_hooks->extract_cond_bb_edges (b, e1, e2); +} + +/* Responsible for updating the ssa info (PHI nodes) on the + new condition basic block that guards the versioned loop. */ +void +lv_adjust_loop_header_phi (basic_block first, basic_block second, + basic_block new, edge e) +{ + if (cfg_hooks->lv_adjust_loop_header_phi) + cfg_hooks->lv_adjust_loop_header_phi (first, second, new, e); +} + +/* Conditions in trees and RTL are different so we need + a different handling when we add the condition to the + versioning code. */ +void +lv_add_condition_to_bb (basic_block first, basic_block second, + basic_block new, void *cond) +{ + gcc_assert (cfg_hooks->lv_add_condition_to_bb); + cfg_hooks->lv_add_condition_to_bb (first, second, new, cond); +} diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h index 92a458ed4aa..480c197b597 100644 --- a/gcc/cfghooks.h +++ b/gcc/cfghooks.h @@ -1,5 +1,5 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Sebastian Pop This file is part of GCC. @@ -43,8 +43,8 @@ struct cfg_hooks edge (*redirect_edge_and_branch) (edge e, basic_block b); /* Same as the above but allows redirecting of fallthru edges. In that case - newly created forwarder basic block is returned. It aborts when called - on abnormal edge. */ + newly created forwarder basic block is returned. The edge must + not be abnormal. */ basic_block (*redirect_edge_and_branch_force) (edge, basic_block); /* Remove statements corresponding to a given basic block. */ @@ -108,6 +108,33 @@ struct cfg_hooks /* This function is called immediately before edge E is removed from the edge vector E->dest->preds. */ void (*execute_on_shrinking_pred) (edge); + + /* A hook for duplicating loop in CFG, currently this is used + in loop versioning. */ + bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *loop, edge e, + struct loops *loops, + unsigned int ndupl, + sbitmap wont_exit, + edge orig, edge *to_remove, + unsigned int *n_to_remove, + int flags); + + /* Add conition to new basic block and update CFG used in loop + versioning. */ + void (*lv_add_condition_to_bb) (basic_block, basic_block, basic_block, + void *); + /* Update the PHI nodes in case of loop versioning. */ + void (*lv_adjust_loop_header_phi) (basic_block, basic_block, + basic_block, edge); + + /* Given a condition BB extract the true/false taken/not taken edges + (depending if we are on tree's or RTL). */ + void (*extract_cond_bb_edges) (basic_block, edge *, edge *); + + + /* Add PHI arguments queued in PENDINT_STMT list on edge E to edge + E->dest (only in tree-ssa loop versioning. */ + void (*flush_pending_stmts) (edge); }; extern void verify_flow_info (void); @@ -136,6 +163,20 @@ extern bool block_ends_with_condjump_p (basic_block bb); extern int flow_call_edges_add (sbitmap); extern void execute_on_growing_pred (edge); extern void execute_on_shrinking_pred (edge); +extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge, + struct loops *loops, + unsigned int ndupl, + sbitmap wont_exit, + edge orig, edge *to_remove, + unsigned int *n_to_remove, + int flags); + +extern void lv_flush_pending_stmts (edge); +extern void extract_cond_bb_edges (basic_block, edge *, edge*); +extern void lv_adjust_loop_header_phi (basic_block, basic_block, basic_block, + edge); +extern void lv_add_condition_to_bb (basic_block, basic_block, basic_block, + void *); /* Hooks containers. */ extern struct cfg_hooks tree_cfg_hooks; diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c index 981bcd9e74b..3a701001b8c 100644 --- a/gcc/cfglayout.c +++ b/gcc/cfglayout.c @@ -51,7 +51,6 @@ static void change_scope (rtx, tree, tree); void verify_insn_chain (void); static void fixup_fallthru_exit_predecessor (void); static tree insn_scope (rtx); -static void update_unlikely_executed_notes (basic_block); rtx unlink_insn_chain (rtx first, rtx last) @@ -231,7 +230,7 @@ record_effective_endpoints (void) locator greater than corresponding block_locators_locs value and smaller than the following one. Similarly for the other properties. */ static GTY(()) varray_type block_locators_locs; -static GTY(()) varray_type block_locators_blocks; +static GTY(()) VEC(tree,gc) *block_locators_blocks; static GTY(()) varray_type line_locators_locs; static GTY(()) varray_type line_locators_lines; static GTY(()) varray_type file_locators_locs; @@ -256,7 +255,7 @@ insn_locators_initialize (void) prologue_locator = epilogue_locator = 0; VARRAY_INT_INIT (block_locators_locs, 32, "block_locators_locs"); - VARRAY_TREE_INIT (block_locators_blocks, 32, "block_locators_blocks"); + block_locators_blocks = VEC_alloc (tree, gc, 32); VARRAY_INT_INIT (line_locators_locs, 32, "line_locators_locs"); VARRAY_INT_INIT (line_locators_lines, 32, "line_locators_lines"); VARRAY_INT_INIT (file_locators_locs, 32, "file_locators_locs"); @@ -295,7 +294,7 @@ insn_locators_initialize (void) { loc++; VARRAY_PUSH_INT (block_locators_locs, loc); - VARRAY_PUSH_TREE (block_locators_blocks, block); + VEC_safe_push (tree, gc, block_locators_blocks, block); last_block = block; } if (last_line_number != line_number) @@ -436,7 +435,7 @@ insn_scope (rtx insn) break; } } - return VARRAY_TREE (block_locators_blocks, min); + return VEC_index (tree, block_locators_blocks, min); } /* Return line number of the statement specified by the locator. */ @@ -523,6 +522,12 @@ reemit_insn_block_notes (void) { tree this_block; + /* Avoid putting scope notes between jump table and its label. */ + if (JUMP_P (insn) + && (GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)) + continue; + this_block = insn_scope (insn); /* For sequences compute scope resulting from merging all scopes of instructions nested inside. */ @@ -778,28 +783,12 @@ fixup_reorder_chain (void) section boundaries). */ BB_COPY_PARTITION (e_fall->src, single_pred (bb)); if (flag_reorder_blocks_and_partition - && targetm.have_named_sections) - { - if (BB_PARTITION (single_pred (bb)) == BB_COLD_PARTITION) - { - rtx new_note; - rtx note = BB_HEAD (e_fall->src); - - while (!INSN_P (note) - && note != BB_END (e_fall->src)) - note = NEXT_INSN (note); - - new_note = emit_note_before - (NOTE_INSN_UNLIKELY_EXECUTED_CODE, - note); - NOTE_BASIC_BLOCK (new_note) = bb; - } - if (JUMP_P (BB_END (bb)) - && !any_condjump_p (BB_END (bb)) - && (single_succ_edge (bb)->flags & EDGE_CROSSING)) - REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST - (REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb))); - } + && targetm.have_named_sections + && JUMP_P (BB_END (bb)) + && !any_condjump_p (BB_END (bb)) + && (EDGE_SUCC (bb, 0)->flags & EDGE_CROSSING)) + REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST + (REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb))); } } @@ -834,8 +823,6 @@ fixup_reorder_chain (void) bb->index = index; BASIC_BLOCK (index) = bb; - update_unlikely_executed_notes (bb); - bb->prev_bb = prev_bb; prev_bb->next_bb = bb; } @@ -857,21 +844,6 @@ fixup_reorder_chain (void) } } -/* Update the basic block number information in any - NOTE_INSN_UNLIKELY_EXECUTED_CODE notes within the basic block. */ - -static void -update_unlikely_executed_notes (basic_block bb) -{ - rtx cur_insn; - - for (cur_insn = BB_HEAD (bb); cur_insn != BB_END (bb); - cur_insn = NEXT_INSN (cur_insn)) - if (NOTE_P (cur_insn) - && NOTE_LINE_NUMBER (cur_insn) == NOTE_INSN_UNLIKELY_EXECUTED_CODE) - NOTE_BASIC_BLOCK (cur_insn) = bb; -} - /* Perform sanity checks on the insn chain. 1. Check that next/prev pointers are consistent in both the forward and reverse direction. @@ -1040,7 +1012,7 @@ duplicate_insn_chain (rtx from, rtx to) break; case NOTE_INSN_REPEATED_LINE_NUMBER: - case NOTE_INSN_UNLIKELY_EXECUTED_CODE: + case NOTE_INSN_SWITCH_TEXT_SECTIONS: emit_note_copy (insn); break; @@ -1125,10 +1097,6 @@ cfg_layout_initialize (unsigned int flags) { basic_block bb; - /* Our algorithm depends on fact that there are no dead jumptables - around the code. */ - alloc_rbi_pool (); - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) initialize_bb_rbi (bb); @@ -1190,8 +1158,6 @@ cfg_layout_finalize (void) #ifdef ENABLE_CHECKING verify_insn_chain (); #endif - - free_rbi_pool (); FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb) bb->rbi = NULL; @@ -1256,7 +1222,7 @@ end: void copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, - edge *edges, unsigned n_edges, edge *new_edges, + edge *edges, unsigned num_edges, edge *new_edges, struct loop *base) { unsigned i, j; @@ -1295,7 +1261,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, } /* Redirect edges. */ - for (j = 0; j < n_edges; j++) + for (j = 0; j < num_edges; j++) new_edges[j] = NULL; for (i = 0; i < n; i++) { @@ -1305,7 +1271,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs, FOR_EACH_EDGE (e, ei, new_bb->succs) { - for (j = 0; j < n_edges; j++) + for (j = 0; j < num_edges; j++) if (edges[j] && edges[j]->src == bb && edges[j]->dest == e->dest) new_edges[j] = e; diff --git a/gcc/cfglayout.h b/gcc/cfglayout.h index 69c9d562e2c..14105099054 100644 --- a/gcc/cfglayout.h +++ b/gcc/cfglayout.h @@ -32,7 +32,6 @@ extern void reemit_insn_block_notes (void); extern bool can_copy_bbs_p (basic_block *, unsigned); extern void copy_bbs (basic_block *, unsigned, basic_block *, edge *, unsigned, edge *, struct loop *); -extern bool scan_ahead_for_unlikely_executed_note (rtx); extern rtx duplicate_insn_chain (rtx, rtx); #endif /* GCC_CFGLAYOUT_H */ diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 0e258c64a34..553fd981faa 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -926,7 +926,7 @@ get_loop_body_in_bfs_order (const struct loop *loop) /* Gets exit edges of a LOOP, returning their number in N_EDGES. */ edge * -get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges) +get_loop_exit_edges (const struct loop *loop, unsigned int *num_edges) { edge *edges, e; unsigned i, n; @@ -942,7 +942,7 @@ get_loop_exit_edges (const struct loop *loop, unsigned int *n_edges) if (!flow_bb_inside_loop_p (loop, e->dest)) n++; edges = xmalloc (n * sizeof (edge)); - *n_edges = n; + *num_edges = n; n = 0; for (i = 0; i < loop->num_nodes; i++) FOR_EACH_EDGE (e, ei, body[i]->succs) diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index e0dad37ec10..f96bf81c9eb 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -287,7 +287,7 @@ extern void force_single_succ_latches (struct loops *); extern void verify_loop_structure (struct loops *); /* Loop analysis. */ -extern bool just_once_each_iteration_p (struct loop *, basic_block); +extern bool just_once_each_iteration_p (const struct loop *, basic_block); extern unsigned expected_loop_iterations (const struct loop *); /* Loop manipulation. */ @@ -298,11 +298,13 @@ extern bool can_duplicate_loop_p (struct loop *loop); extern struct loop * duplicate_loop (struct loops *, struct loop *, struct loop *); -extern int duplicate_loop_to_header_edge (struct loop *, edge, struct loops *, - unsigned, sbitmap, edge, edge *, - unsigned *, int); +extern bool duplicate_loop_to_header_edge (struct loop *, edge, struct loops *, + unsigned, sbitmap, edge, edge *, + unsigned *, int); extern struct loop *loopify (struct loops *, edge, edge, basic_block, edge, edge, bool); +struct loop * loop_version (struct loops *, struct loop *, void *, + basic_block *); extern bool remove_path (struct loops *, edge); extern edge split_loop_bb (basic_block, void *); diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c index 055375d741f..db46c906251 100644 --- a/gcc/cfgloopanal.c +++ b/gcc/cfgloopanal.c @@ -33,7 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Checks whether BB is executed exactly once in each LOOP iteration. */ bool -just_once_each_iteration_p (struct loop *loop, basic_block bb) +just_once_each_iteration_p (const struct loop *loop, basic_block bb) { /* It must be executed at least once each iteration. */ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb)) @@ -419,7 +419,7 @@ expected_loop_iterations (const struct loop *loop) edge e; edge_iterator ei; - if (loop->header->count) + if (loop->latch->count || loop->header->count) { gcov_type count_in, count_latch, expected; @@ -580,13 +580,10 @@ mark_loop_exit_edges (struct loops *loops) { edge_iterator ei; - /* Do not mark exits from the fake outermost loop. */ - if (!bb->loop_father->outer) - continue; - FOR_EACH_EDGE (e, ei, bb->succs) { - if (loop_exit_edge_p (bb->loop_father, e)) + if (bb->loop_father->outer + && loop_exit_edge_p (bb->loop_father, e)) e->flags |= EDGE_LOOP_EXIT; else e->flags &= ~EDGE_LOOP_EXIT; diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index bd55788483d..0a369787ebf 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -28,6 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "basic-block.h" #include "cfgloop.h" #include "cfglayout.h" +#include "cfghooks.h" #include "output.h" static void duplicate_subloops (struct loops *, struct loop *, struct loop *); @@ -45,7 +46,6 @@ static bool fix_bb_placement (struct loops *, basic_block); static void fix_bb_placements (struct loops *, basic_block); static void place_new_loop (struct loops *, struct loop *); static void scale_loop_frequencies (struct loop *, int, int); -static void scale_bbs_frequencies (basic_block *, int, int, int); static basic_block create_preheader (struct loop *, int); static void fix_irreducible_loops (basic_block); static void unloop (struct loops *, struct loop *); @@ -252,7 +252,7 @@ fix_irreducible_loops (basic_block from) int stack_top; sbitmap on_stack; edge *edges, e; - unsigned n_edges, i; + unsigned num_edges, i; if (!(from->flags & BB_IRREDUCIBLE_LOOP)) return; @@ -278,16 +278,16 @@ fix_irreducible_loops (basic_block from) bb->flags &= ~BB_IRREDUCIBLE_LOOP; if (bb->loop_father->header == bb) - edges = get_loop_exit_edges (bb->loop_father, &n_edges); + edges = get_loop_exit_edges (bb->loop_father, &num_edges); else { - n_edges = EDGE_COUNT (bb->succs); - edges = xmalloc (n_edges * sizeof (edge)); + num_edges = EDGE_COUNT (bb->succs); + edges = xmalloc (num_edges * sizeof (edge)); FOR_EACH_EDGE (e, ei, bb->succs) edges[ei.index] = e; } - for (i = 0; i < n_edges; i++) + for (i = 0; i < num_edges; i++) { e = edges[i]; @@ -450,24 +450,6 @@ add_loop (struct loops *loops, struct loop *loop) free (bbs); } -/* Multiply all frequencies of basic blocks in array BBS of length NBBS - by NUM/DEN. */ -static void -scale_bbs_frequencies (basic_block *bbs, int nbbs, int num, int den) -{ - int i; - edge e; - - for (i = 0; i < nbbs; i++) - { - edge_iterator ei; - bbs[i]->frequency = (bbs[i]->frequency * num) / den; - bbs[i]->count = RDIV (bbs[i]->count * num, den); - FOR_EACH_EDGE (e, ei, bbs[i]->succs) - e->count = (e->count * num) /den; - } -} - /* Multiply all frequencies in LOOP by NUM/DEN. */ static void scale_loop_frequencies (struct loop *loop, int num, int den) @@ -475,7 +457,7 @@ scale_loop_frequencies (struct loop *loop, int num, int den) basic_block *bbs; bbs = get_loop_body (loop); - scale_bbs_frequencies (bbs, loop->num_nodes, num, den); + scale_bbs_frequencies_int (bbs, loop->num_nodes, num, den); free (bbs); } @@ -592,7 +574,7 @@ unloop (struct loops *loops, struct loop *loop) unsigned i, n; basic_block latch = loop->latch; edge *edges; - unsigned n_edges; + unsigned num_edges; /* This is relatively straightforward. The dominators are unchanged, as loop header dominates loop latch, so the only thing we have to care of @@ -601,7 +583,7 @@ unloop (struct loops *loops, struct loop *loop) its work. */ body = get_loop_body (loop); - edges = get_loop_exit_edges (loop, &n_edges); + edges = get_loop_exit_edges (loop, &num_edges); n = loop->num_nodes; for (i = 0; i < n; i++) if (body[i]->loop_father == loop) @@ -630,10 +612,10 @@ unloop (struct loops *loops, struct loop *loop) update the irreducible marks inside its body. While it is certainly possible to do, it is a bit complicated and this situation should be very rare, so we just remark all loops in this case. */ - for (i = 0; i < n_edges; i++) + for (i = 0; i < num_edges; i++) if (edges[i]->flags & EDGE_IRREDUCIBLE_LOOP) break; - if (i != n_edges) + if (i != num_edges) mark_irreducible_loops (loops); free (edges); } @@ -856,7 +838,7 @@ update_single_exits_after_duplication (basic_block *bbs, unsigned nbbs, original LOOP body, the other copies are numbered in order given by control flow through them) into TO_REMOVE array. Returns false if duplication is impossible. */ -int +bool duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, unsigned int ndupl, sbitmap wont_exit, edge orig, edge *to_remove, @@ -1059,7 +1041,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, /* Set counts and frequencies. */ if (flags & DLTHE_FLAG_UPDATE_FREQ) { - scale_bbs_frequencies (new_bbs, n, scale_act, REG_BR_PROB_BASE); + scale_bbs_frequencies_int (new_bbs, n, scale_act, REG_BR_PROB_BASE); scale_act = RDIV (scale_act * scale_step[j], REG_BR_PROB_BASE); } } @@ -1071,7 +1053,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops, set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src); if (flags & DLTHE_FLAG_UPDATE_FREQ) { - scale_bbs_frequencies (bbs, n, scale_main, REG_BR_PROB_BASE); + scale_bbs_frequencies_int (bbs, n, scale_main, REG_BR_PROB_BASE); free (scale_step); } @@ -1373,6 +1355,135 @@ create_loop_notes (void) flow_loops_free (&loops); } +/* This function is called from loop_version. It splits the entry edge + of the loop we want to version, adds the versioning condition, and + adjust the edges to the two versions of the loop appropriately. + e is an incoming edge. Returns the basic block containing the + condition. + + --- edge e ---- > [second_head] + + Split it and insert new conditional expression and adjust edges. + + --- edge e ---> [cond expr] ---> [first_head] + | + +---------> [second_head] +*/ + +static basic_block +lv_adjust_loop_entry_edge (basic_block first_head, + basic_block second_head, + edge e, + tree cond_expr) +{ + basic_block new_head = NULL; + edge e1; + + gcc_assert (e->dest == second_head); + + /* Split edge 'e'. This will create a new basic block, where we can + insert conditional expr. */ + new_head = split_edge (e); + + + lv_add_condition_to_bb (first_head, second_head, new_head, + cond_expr); + + e1 = make_edge (new_head, first_head, EDGE_TRUE_VALUE); + set_immediate_dominator (CDI_DOMINATORS, first_head, new_head); + set_immediate_dominator (CDI_DOMINATORS, second_head, new_head); + + /* Adjust loop header phi nodes. */ + lv_adjust_loop_header_phi (first_head, second_head, new_head, e1); + + return new_head; +} + +/* Main entry point for Loop Versioning transformation. + +This transformation given a condition and a loop, creates +-if (condition) { loop_copy1 } else { loop_copy2 }, +where loop_copy1 is the loop transformed in one way, and loop_copy2 +is the loop transformed in another way (or unchanged). 'condition' +may be a run time test for things that were not resolved by static +analysis (overlapping ranges (anti-aliasing), alignment, etc.). */ + +struct loop * +loop_version (struct loops *loops, struct loop * loop, + void *cond_expr, basic_block *condition_bb) +{ + basic_block first_head, second_head; + edge entry, latch_edge, exit, true_edge, false_edge; + int irred_flag; + struct loop *nloop; + + /* CHECKME: Loop versioning does not handle nested loop at this point. */ + if (loop->inner) + return NULL; + + /* Record entry and latch edges for the loop */ + entry = loop_preheader_edge (loop); + irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP; + entry->flags &= ~EDGE_IRREDUCIBLE_LOOP; + + /* Note down head of loop as first_head. */ + first_head = entry->dest; + + /* Duplicate loop. */ + if (!cfg_hook_duplicate_loop_to_header_edge (loop, entry, loops, 1, + NULL, NULL, NULL, NULL, 0)) + return NULL; + + /* After duplication entry edge now points to new loop head block. + Note down new head as second_head. */ + second_head = entry->dest; + + /* Split loop entry edge and insert new block with cond expr. */ + *condition_bb = lv_adjust_loop_entry_edge (first_head, second_head, + entry, cond_expr); + if (!*condition_bb) + { + entry->flags |= irred_flag; + return NULL; + } + + latch_edge = single_succ_edge (loop->latch->rbi->copy); + + extract_cond_bb_edges (*condition_bb, &true_edge, &false_edge); + nloop = loopify (loops, + latch_edge, + single_pred_edge (loop->header->rbi->copy), + *condition_bb, true_edge, false_edge, + false /* Do not redirect all edges. */); + + exit = loop->single_exit; + if (exit) + nloop->single_exit = find_edge (exit->src->rbi->copy, exit->dest); + + /* loopify redirected latch_edge. Update its PENDING_STMTS. */ + lv_flush_pending_stmts (latch_edge); + + /* loopify redirected condition_bb's succ edge. Update its PENDING_STMTS. */ + extract_cond_bb_edges (*condition_bb, &true_edge, &false_edge); + lv_flush_pending_stmts (false_edge); + /* Adjust irreducible flag. */ + if (irred_flag) + { + (*condition_bb)->flags |= BB_IRREDUCIBLE_LOOP; + loop_preheader_edge (loop)->flags |= EDGE_IRREDUCIBLE_LOOP; + loop_preheader_edge (nloop)->flags |= EDGE_IRREDUCIBLE_LOOP; + single_pred_edge ((*condition_bb))->flags |= EDGE_IRREDUCIBLE_LOOP; + } + + /* At this point condition_bb is loop predheader with two successors, + first_head and second_head. Make sure that loop predheader has only + one successor. */ + loop_split_edge_with (loop_preheader_edge (loop), NULL); + loop_split_edge_with (loop_preheader_edge (nloop), NULL); + + return nloop; +} + /* The structure of LOOPS might have changed. Some loops might get removed (and their headers and latches were set to NULL), loop exists might get removed (thus the loop nesting may be wrong), and some blocks and edges diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 92399068dca..42761cad745 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -57,7 +57,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "cfglayout.h" #include "expr.h" #include "target.h" - +#include "cfgloop.h" /* The labels mentioned in non-jump rtl. Valid during find_basic_blocks. */ /* ??? Should probably be using LABEL_NUSES instead. It would take a @@ -92,8 +92,7 @@ static int can_delete_note_p (rtx note) { return (NOTE_LINE_NUMBER (note) == NOTE_INSN_DELETED - || NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK - || NOTE_LINE_NUMBER (note) == NOTE_INSN_UNLIKELY_EXECUTED_CODE); + || NOTE_LINE_NUMBER (note) == NOTE_INSN_BASIC_BLOCK); } /* True if a given label can be deleted. */ @@ -616,10 +615,7 @@ rtl_can_merge_blocks (basic_block a,basic_block b) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (find_reg_note (BB_END (a), REG_CROSSING_JUMP, NULL_RTX) - || find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX) - || BB_PARTITION (a) != BB_PARTITION (b))) + if (BB_PARTITION (a) != BB_PARTITION (b)) return false; /* There must be exactly one edge in between the blocks. */ @@ -678,9 +674,8 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX) - || BB_PARTITION (src) != BB_PARTITION (target))) + if (find_reg_note (insn, REG_CROSSING_JUMP, NULL_RTX) + || BB_PARTITION (src) != BB_PARTITION (target)) return NULL; /* We can replace or remove a complex jump only when we have exactly @@ -909,7 +904,7 @@ redirect_branch_edge (edge e, basic_block target) && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF && XEXP (XEXP (SET_SRC (tmp), 2), 0) == old_label) { - XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (VOIDmode, + XEXP (SET_SRC (tmp), 2) = gen_rtx_LABEL_REF (Pmode, new_label); --LABEL_NUSES (old_label); ++LABEL_NUSES (new_label); @@ -1070,7 +1065,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target) gcc_assert (found); - VEC_safe_push (edge, bb->succs, e); + VEC_safe_push (edge, gc, bb->succs, e); make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU); } } @@ -1108,29 +1103,16 @@ force_nonfallthru_and_redirect (edge e, basic_block target) BB_COPY_PARTITION (jump_block, e->src); if (flag_reorder_blocks_and_partition - && targetm.have_named_sections) - { - if (BB_PARTITION (jump_block) == BB_COLD_PARTITION) - { - rtx bb_note, new_note; - for (bb_note = BB_HEAD (jump_block); - bb_note && bb_note != NEXT_INSN (BB_END (jump_block)); - bb_note = NEXT_INSN (bb_note)) - if (NOTE_P (bb_note) - && NOTE_LINE_NUMBER (bb_note) == NOTE_INSN_BASIC_BLOCK) - break; - new_note = emit_note_after (NOTE_INSN_UNLIKELY_EXECUTED_CODE, - bb_note); - NOTE_BASIC_BLOCK (new_note) = jump_block; - } - if (JUMP_P (BB_END (jump_block)) - && !any_condjump_p (BB_END (jump_block)) - && (single_succ_edge (jump_block)->flags & EDGE_CROSSING)) - REG_NOTES (BB_END (jump_block)) = gen_rtx_EXPR_LIST - (REG_CROSSING_JUMP, NULL_RTX, - REG_NOTES (BB_END (jump_block))); - } - + && targetm.have_named_sections + && JUMP_P (BB_END (jump_block)) + && !any_condjump_p (BB_END (jump_block)) + && (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING)) + REG_NOTES (BB_END (jump_block)) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP, + NULL_RTX, + REG_NOTES + (BB_END + (jump_block))); + /* Wire edge in. */ new_edge = make_edge (e->src, jump_block, EDGE_FALLTHRU); new_edge->probability = e->probability; @@ -1183,7 +1165,7 @@ force_nonfallthru (edge e) /* Redirect edge even at the expense of creating new jump insn or basic block. Return new basic block if created, NULL otherwise. - Abort if conversion is impossible. */ + Conversion must be possible. */ static basic_block rtl_redirect_edge_and_branch_force (edge e, basic_block target) @@ -1295,7 +1277,7 @@ rtl_move_block_after (basic_block bb ATTRIBUTE_UNUSED, } /* Split a (typically critical) edge. Return the new block. - Abort on abnormal edges. + The edge must not be abnormal. ??? The code generally expects to be called on critical edges. The case of a block ending in an unconditional jump to a @@ -1576,10 +1558,6 @@ commit_one_edge_insertion (edge e, int watch_calls) tmp = NEXT_INSN (tmp); if (NOTE_INSN_BASIC_BLOCK_P (tmp)) tmp = NEXT_INSN (tmp); - if (tmp - && NOTE_P (tmp) - && NOTE_LINE_NUMBER (tmp) == NOTE_INSN_UNLIKELY_EXECUTED_CODE) - tmp = NEXT_INSN (tmp); if (tmp == BB_HEAD (bb)) before = tmp; else if (tmp) @@ -1629,7 +1607,7 @@ commit_one_edge_insertion (edge e, int watch_calls) && BB_PARTITION (e->src) == BB_COLD_PARTITION && !(e->flags & EDGE_CROSSING)) { - rtx bb_note, new_note, cur_insn; + rtx bb_note, cur_insn; bb_note = NULL_RTX; for (cur_insn = BB_HEAD (bb); cur_insn != NEXT_INSN (BB_END (bb)); @@ -1641,16 +1619,11 @@ commit_one_edge_insertion (edge e, int watch_calls) break; } - new_note = emit_note_after (NOTE_INSN_UNLIKELY_EXECUTED_CODE, - bb_note); - NOTE_BASIC_BLOCK (new_note) = bb; if (JUMP_P (BB_END (bb)) && !any_condjump_p (BB_END (bb)) && (single_succ_edge (bb)->flags & EDGE_CROSSING)) REG_NOTES (BB_END (bb)) = gen_rtx_EXPR_LIST (REG_CROSSING_JUMP, NULL_RTX, REG_NOTES (BB_END (bb))); - if (after == bb_note) - after = new_note; } } } @@ -2055,7 +2028,7 @@ rtl_verify_flow_info_1 (void) err = 1; } if (n_branch != 1 && any_condjump_p (BB_END (bb)) - && JUMP_LABEL (BB_END (bb)) != BB_HEAD (fallthru->dest)) + && JUMP_LABEL (BB_END (bb)) == BB_HEAD (fallthru->dest)) { error ("Wrong amount of branch edges after conditional jump %i", bb->index); err = 1; @@ -2455,9 +2428,12 @@ purge_dead_edges (basic_block bb) if (!found) return purged; + /* Remove all but the fake and fallthru edges. The fake edge may be + the only successor for this block in the case of noreturn + calls. */ for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); ) { - if (!(e->flags & EDGE_FALLTHRU)) + if (!(e->flags & (EDGE_FALLTHRU | EDGE_FAKE))) { bb->flags |= BB_DIRTY; remove_edge (e); @@ -2482,34 +2458,18 @@ purge_dead_edges (basic_block bb) true if some edge has been eliminated. */ bool -purge_all_dead_edges (int update_life_p) +purge_all_dead_edges (void) { int purged = false; - sbitmap blocks = 0; basic_block bb; - if (update_life_p) - { - blocks = sbitmap_alloc (last_basic_block); - sbitmap_zero (blocks); - } - FOR_EACH_BB (bb) { bool purged_here = purge_dead_edges (bb); purged |= purged_here; - if (purged_here && update_life_p) - SET_BIT (blocks, bb->index); } - if (update_life_p && purged) - update_life_info (blocks, UPDATE_LIFE_GLOBAL, - PROP_DEATH_NOTES | PROP_SCAN_DEAD_CODE - | PROP_KILL_DEAD_CODE); - - if (update_life_p) - sbitmap_free (blocks); return purged; } @@ -2679,6 +2639,9 @@ cfg_layout_delete_block (basic_block bb) to = &bb->next_bb->rbi->header; else to = &cfg_layout_function_footer; + + bb->rbi = NULL; + rtl_delete_block (bb); if (prev) @@ -2717,10 +2680,7 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && (find_reg_note (BB_END (a), REG_CROSSING_JUMP, NULL_RTX) - || find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX) - || BB_PARTITION (a) != BB_PARTITION (b))) + if (BB_PARTITION (a) != BB_PARTITION (b)) return false; /* There must be exactly one edge in between the blocks. */ @@ -2738,7 +2698,8 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b) ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a))))); } -/* Merge block A and B, abort when it is not possible. */ +/* Merge block A and B. The blocks must be mergeable. */ + static void cfg_layout_merge_blocks (basic_block a, basic_block b) { @@ -3027,6 +2988,66 @@ rtl_flow_call_edges_add (sbitmap blocks) return blocks_split; } +/* Add COMP_RTX as a condition at end of COND_BB. FIRST_HEAD is + the conditional branch target, SECOND_HEAD should be the fall-thru + there is no need to handle this here the loop versioning code handles + this. the reason for SECON_HEAD is that it is needed for condition + in trees, and this should be of the same type since it is a hook. */ +static void +rtl_lv_add_condition_to_bb (basic_block first_head , + basic_block second_head ATTRIBUTE_UNUSED, + basic_block cond_bb, void *comp_rtx) +{ + rtx label, seq, jump; + rtx op0 = XEXP ((rtx)comp_rtx, 0); + rtx op1 = XEXP ((rtx)comp_rtx, 1); + enum rtx_code comp = GET_CODE ((rtx)comp_rtx); + enum machine_mode mode; + + + label = block_label (first_head); + mode = GET_MODE (op0); + if (mode == VOIDmode) + mode = GET_MODE (op1); + + start_sequence (); + op0 = force_operand (op0, NULL_RTX); + op1 = force_operand (op1, NULL_RTX); + do_compare_rtx_and_jump (op0, op1, comp, 0, + mode, NULL_RTX, NULL_RTX, label); + jump = get_last_insn (); + JUMP_LABEL (jump) = label; + LABEL_NUSES (label)++; + seq = get_insns (); + end_sequence (); + + /* Add the new cond , in the new head. */ + emit_insn_after(seq, BB_END(cond_bb)); +} + + +/* Given a block B with unconditional branch at its end, get the + store the return the branch edge and the fall-thru edge in + BRANCH_EDGE and FALLTHRU_EDGE respectively. */ +static void +rtl_extract_cond_bb_edges (basic_block b, edge *branch_edge, + edge *fallthru_edge) +{ + edge e = EDGE_SUCC (b, 0); + + if (e->flags & EDGE_FALLTHRU) + { + *fallthru_edge = e; + *branch_edge = EDGE_SUCC (b, 1); + } + else + { + *branch_edge = e; + *fallthru_edge = EDGE_SUCC (b, 1); + } +} + + /* Implementation of CFG manipulation for linearized RTL. */ struct cfg_hooks rtl_cfg_hooks = { "rtl", @@ -3051,7 +3072,12 @@ struct cfg_hooks rtl_cfg_hooks = { rtl_block_ends_with_condjump_p, rtl_flow_call_edges_add, NULL, /* execute_on_growing_pred */ - NULL /* execute_on_shrinking_pred */ + NULL, /* execute_on_shrinking_pred */ + NULL, /* duplicate loop for trees */ + NULL, /* lv_add_condition_to_bb */ + NULL, /* lv_adjust_loop_header_phi*/ + NULL, /* extract_cond_bb_edges */ + NULL /* flush_pending_stmts */ }; /* Implementation of CFG manipulation for cfg layout RTL, where @@ -3089,6 +3115,11 @@ struct cfg_hooks cfg_layout_rtl_cfg_hooks = { rtl_block_ends_with_condjump_p, rtl_flow_call_edges_add, NULL, /* execute_on_growing_pred */ - NULL /* execute_on_shrinking_pred */ + NULL, /* execute_on_shrinking_pred */ + duplicate_loop_to_header_edge, /* duplicate loop for trees */ + rtl_lv_add_condition_to_bb, /* lv_add_condition_to_bb */ + NULL, /* lv_adjust_loop_header_phi*/ + rtl_extract_cond_bb_edges, /* extract_cond_bb_edges */ + NULL /* flush_pending_stmts */ }; diff --git a/gcc/cgraph.c b/gcc/cgraph.c index dacc70dfb30..c2509ffc033 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -84,6 +84,7 @@ The varpool data structure: #include "coretypes.h" #include "tm.h" #include "tree.h" +#include "tree-inline.h" #include "langhooks.h" #include "hashtab.h" #include "toplev.h" @@ -91,6 +92,7 @@ The varpool data structure: #include "ggc.h" #include "debug.h" #include "target.h" +#include "basic-block.h" #include "cgraph.h" #include "varray.h" #include "output.h" @@ -118,14 +120,21 @@ int cgraph_max_uid; /* Set when whole unit has been analyzed so we can access global info. */ bool cgraph_global_info_ready = false; +/* Set when the cgraph is fully build and the basic flags are computed. */ +bool cgraph_function_flags_ready = false; + /* Hash table used to convert declarations into nodes. */ static GTY((param_is (struct cgraph_varpool_node))) htab_t cgraph_varpool_hash; /* Queue of cgraph nodes scheduled to be lowered and output. */ -struct cgraph_varpool_node *cgraph_varpool_nodes_queue; +struct cgraph_varpool_node *cgraph_varpool_nodes_queue, *cgraph_varpool_first_unanalyzed_node; + /* The linked list of cgraph varpool nodes. */ -static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes; +static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes; + +/* End of the varpool queue. Needs to be QTYed to work with PCH. */ +static GTY(()) struct cgraph_varpool_node *cgraph_varpool_last_needed_node; static hashval_t hash_node (const void *); static int eq_node (const void *, const void *); @@ -266,7 +275,7 @@ cgraph_edge (struct cgraph_node *node, tree call_expr) struct cgraph_edge * cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee, - tree call_expr) + tree call_expr, gcov_type count, int nest) { struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge)); #ifdef ENABLE_CHECKING @@ -303,6 +312,8 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee, caller->callees->prev_callee = edge; caller->callees = edge; callee->callers = edge; + edge->count = count; + edge->loop_nest = nest; return edge; } @@ -422,7 +433,10 @@ cgraph_remove_node (struct cgraph_node *node) if (*slot == node) { if (node->next_clone) + { *slot = node->next_clone; + node->next_clone->prev_clone = NULL; + } else { htab_clear_slot (cgraph_hash, slot); @@ -431,11 +445,9 @@ cgraph_remove_node (struct cgraph_node *node) } else { - struct cgraph_node *n; - - for (n = *slot; n->next_clone != node; n = n->next_clone) - continue; - n->next_clone = node->next_clone; + node->prev_clone->next_clone = node->next_clone; + if (node->next_clone) + node->next_clone->prev_clone = node->prev_clone; } /* While all the clones are removed after being proceeded, the function @@ -469,6 +481,7 @@ cgraph_mark_reachable_node (struct cgraph_node *node) { notice_global_symbol (node->decl); node->reachable = 1; + gcc_assert (!cgraph_global_info_ready); node->next_needed = cgraph_nodes_queue; cgraph_nodes_queue = node; @@ -531,6 +544,13 @@ cgraph_node_name (struct cgraph_node *node) return lang_hooks.decl_printable_name (node->decl, 2); } +/* Return name of the node used in debug output. */ +static const char * +cgraph_varpool_node_name (struct cgraph_varpool_node *node) +{ + return lang_hooks.decl_printable_name (node->decl, 2); +} + /* Dump given cgraph node. */ void dump_cgraph_node (FILE *f, struct cgraph_node *node) @@ -541,6 +561,9 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) fprintf (f, " (inline copy in %s/%i)", cgraph_node_name (node->global.inlined_to), node->global.inlined_to->uid); + if (node->count) + fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x", + (HOST_WIDEST_INT)node->count); if (node->local.self_insns) fprintf (f, " %i insns", node->local.self_insns); if (node->global.insns && node->global.insns != node->local.self_insns) @@ -569,6 +592,9 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node) { fprintf (f, "%s/%i ", cgraph_node_name (edge->caller), edge->caller->uid); + if (edge->count) + fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ", + (HOST_WIDEST_INT)edge->count); if (!edge->inline_failed) fprintf(f, "(inlined) "); } @@ -596,6 +622,36 @@ dump_cgraph (FILE *f) dump_cgraph_node (f, node); } +/* Dump given cgraph node. */ +void +dump_cgraph_varpool_node (FILE *f, struct cgraph_varpool_node *node) +{ + fprintf (f, "%s:", cgraph_varpool_node_name (node)); + if (DECL_INITIAL (node->decl)) + fprintf (f, " initialized"); + if (node->needed) + fprintf (f, " needed"); + if (node->analyzed) + fprintf (f, " analyzed"); + if (node->finalized) + fprintf (f, " finalized"); + if (node->output) + fprintf (f, " output"); + fprintf (f, "\n"); +} + +/* Dump the callgraph. */ + +void +dump_varpool (FILE *f) +{ + struct cgraph_varpool_node *node; + + fprintf (f, "variable pool:\n\n"); + for (node = cgraph_varpool_nodes; node; node = node->next_needed) + dump_cgraph_varpool_node (f, node); +} + /* Returns a hash code for P. */ static hashval_t @@ -664,25 +720,87 @@ change_decl_assembler_name (tree decl, tree name) if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)) && DECL_RTL_SET_P (decl)) - warning ("%D renamed after being referenced in assembly", decl); + warning (0, "%D renamed after being referenced in assembly", decl); SET_DECL_ASSEMBLER_NAME (decl, name); } +/* Helper function for finalization code - add node into lists so it will + be analyzed and compiled. */ +void +cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *node) +{ + if (cgraph_varpool_last_needed_node) + cgraph_varpool_last_needed_node->next_needed = node; + cgraph_varpool_last_needed_node = node; + node->next_needed = NULL; + if (!cgraph_varpool_nodes_queue) + cgraph_varpool_nodes_queue = node; + if (!cgraph_varpool_first_unanalyzed_node) + cgraph_varpool_first_unanalyzed_node = node; + notice_global_symbol (node->decl); +} + +/* Reset the queue of needed nodes. */ +void +cgraph_varpool_reset_queue (void) +{ + cgraph_varpool_last_needed_node = NULL; + cgraph_varpool_nodes_queue = NULL; + cgraph_varpool_first_unanalyzed_node = NULL; +} + /* Notify finalize_compilation_unit that given node is reachable or needed. */ void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *node) { if (!node->needed && node->finalized) - { - node->next_needed = cgraph_varpool_nodes_queue; - cgraph_varpool_nodes_queue = node; - notice_global_symbol (node->decl); - } + cgraph_varpool_enqueue_needed_node (node); node->needed = 1; } +/* Determine if variable DECL is needed. That is, visible to something + either outside this translation unit, something magic in the system + configury, or (if not doing unit-at-a-time) to something we haven't + seen yet. */ + +bool +decide_is_variable_needed (struct cgraph_varpool_node *node, tree decl) +{ + /* If the user told us it is used, then it must be so. */ + if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + return true; + + /* ??? If the assembler name is set by hand, it is possible to assemble + the name later after finalizing the function and the fact is noticed + in assemble_name then. This is arguably a bug. */ + if (DECL_ASSEMBLER_NAME_SET_P (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) + return true; + + /* If we decided it was needed before, but at the time we didn't have + the definition available, then it's still needed. */ + if (node->needed) + return true; + + /* Externally visible functions must be output. The exception is + COMDAT functions that must be output only when they are needed. */ + if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) + return true; + + if (flag_unit_at_a_time) + return false; + + /* If not doing unit at a time, then we'll only defer this function + if its marked for inlining. Otherwise we want to emit it now. */ + + /* We want to emit COMDAT variables only when absolutely necessary. */ + if (DECL_COMDAT (decl)) + return false; + return true; +} + void cgraph_varpool_finalize_decl (tree decl) { @@ -693,47 +811,19 @@ cgraph_varpool_finalize_decl (tree decl) or local (in C, has internal linkage). So do nothing more if this function has already run. */ if (node->finalized) - return; - if (node->needed) { - node->next_needed = cgraph_varpool_nodes_queue; - cgraph_varpool_nodes_queue = node; - notice_global_symbol (decl); + if (cgraph_global_info_ready || !flag_unit_at_a_time) + cgraph_varpool_assemble_pending_decls (); + return; } + if (node->needed) + cgraph_varpool_enqueue_needed_node (node); node->finalized = true; - if (/* Externally visible variables must be output. The exception are - COMDAT functions that must be output only when they are needed. */ - (TREE_PUBLIC (decl) && !DECL_COMDAT (decl)) - /* Function whose name is output to the assembler file must be produced. - It is possible to assemble the name later after finalizing the function - and the fact is noticed in assemble_name then. */ - || (DECL_ASSEMBLER_NAME_SET_P (decl) - && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) - { - cgraph_varpool_mark_needed_node (node); - } -} - -bool -cgraph_varpool_assemble_pending_decls (void) -{ - bool changed = false; - - while (cgraph_varpool_nodes_queue) - { - tree decl = cgraph_varpool_nodes_queue->decl; - struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue; - - cgraph_varpool_nodes_queue = cgraph_varpool_nodes_queue->next_needed; - if (!TREE_ASM_WRITTEN (decl)) - { - assemble_variable (decl, 0, 1, 0); - changed = true; - } - node->next_needed = NULL; - } - return changed; + if (decide_is_variable_needed (node, decl)) + cgraph_varpool_mark_needed_node (node); + if (cgraph_global_info_ready || !flag_unit_at_a_time) + cgraph_varpool_assemble_pending_decls (); } /* Return true when the DECL can possibly be inlined. */ @@ -747,20 +837,28 @@ cgraph_function_possibly_inlined_p (tree decl) /* Create clone of E in the node N represented by CALL_EXPR the callgraph. */ struct cgraph_edge * -cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n, tree call_expr) +cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n, + tree call_expr, int count_scale, int loop_nest) { - struct cgraph_edge *new = cgraph_create_edge (n, e->callee, call_expr); + struct cgraph_edge *new; + + new = cgraph_create_edge (n, e->callee, call_expr, + e->count * count_scale / REG_BR_PROB_BASE, + e->loop_nest + loop_nest); new->inline_failed = e->inline_failed; + e->count -= new->count; return new; } -/* Create node representing clone of N. */ +/* Create node representing clone of N executed COUNT times. Decrease + the execution counts from original node too. */ struct cgraph_node * -cgraph_clone_node (struct cgraph_node *n) +cgraph_clone_node (struct cgraph_node *n, gcov_type count, int loop_nest) { struct cgraph_node *new = cgraph_create_node (); struct cgraph_edge *e; + int count_scale; new->decl = n->decl; new->origin = n->origin; @@ -773,12 +871,21 @@ cgraph_clone_node (struct cgraph_node *n) new->local = n->local; new->global = n->global; new->rtl = n->rtl; + new->count = count; + if (n->count) + count_scale = new->count * REG_BR_PROB_BASE / n->count; + else + count_scale = 0; + n->count -= count; for (e = n->callees;e; e=e->next_callee) - cgraph_clone_edge (e, new, e->call_expr); + cgraph_clone_edge (e, new, e->call_expr, count_scale, loop_nest); new->next_clone = n->next_clone; + new->prev_clone = n; n->next_clone = new; + if (new->next_clone) + new->next_clone->prev_clone = new; return new; } diff --git a/gcc/cgraph.h b/gcc/cgraph.h index b596a36a223..294b690787b 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef GCC_CGRAPH_H #define GCC_CGRAPH_H #include "tree.h" +#include "basic-block.h" /* Information about the function collected locally. Available after function is analyzed. */ @@ -51,6 +52,10 @@ struct cgraph_local_info GTY(()) /* True if statics_read_for_function and statics_written_for_function contain valid data. */ bool for_functions_valid; + + /* True if the function is going to be emitted in some other translation + unit, referenced from vtable. */ + bool vtable_method; }; /* Information about the function that needs to be computed globally @@ -98,12 +103,15 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) struct cgraph_node *next_needed; /* Pointer to the next clone. */ struct cgraph_node *next_clone; + struct cgraph_node *prev_clone; PTR GTY ((skip)) aux; struct cgraph_local_info local; struct cgraph_global_info global; struct cgraph_rtl_info rtl; + /* Expected number of executions: calculated in profile.c. */ + gcov_type count; /* Unique id of the node. */ int uid; /* Set when function must be output - it is externally visible @@ -112,11 +120,15 @@ struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous"))) /* Set when function is reachable by call from other function that is either reachable or needed. */ bool reachable; + /* Set once the function is lowered (ie it's CFG is built). */ + bool lowered; /* Set once the function has been instantiated and its callee lists created. */ bool analyzed; /* Set when function is scheduled to be assembled. */ bool output; + /* Set for aliases once they got through assemble_alias. */ + bool alias; }; struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_caller"))) @@ -132,6 +144,10 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call /* When NULL, inline this call. When non-NULL, points to the explanation why function was not inlined. */ const char *inline_failed; + /* Expected number of executions: calculated in profile.c. */ + gcov_type count; + /* Depth of loop nest, 1 means no loop nest. */ + int loop_nest; }; /* The cgraph_varpool data structure. @@ -148,10 +164,18 @@ struct cgraph_varpool_node GTY(()) /* Set when function must be output - it is externally visible or its address is taken. */ bool needed; + /* Needed variables might become dead by optimization. This flag + forces the variable to be output even if it appears dead otherwise. */ + bool force_output; + /* Set once the variable has been instantiated and its callee + lists created. */ + bool analyzed; /* Set once it has been finalized so we consider it to be output. */ bool finalized; /* Set when function is scheduled to be assembled. */ bool output; + /* Set for aliases once they got through assemble_alias. */ + bool alias; }; extern GTY(()) struct cgraph_node *cgraph_nodes; @@ -160,42 +184,48 @@ extern GTY(()) int cgraph_max_uid; extern bool cgraph_global_info_ready; extern GTY(()) struct cgraph_node *cgraph_nodes_queue; +extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_first_unanalyzed_node; extern GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes_queue; /* In cgraph.c */ void dump_cgraph (FILE *); void dump_cgraph_node (FILE *, struct cgraph_node *); +void dump_varpool (FILE *); +void dump_cgraph_varpool_node (FILE *, struct cgraph_varpool_node *); void cgraph_remove_edge (struct cgraph_edge *); void cgraph_remove_node (struct cgraph_node *); void cgraph_node_remove_callees (struct cgraph_node *node); struct cgraph_edge *cgraph_create_edge (struct cgraph_node *, struct cgraph_node *, - tree); -struct cgraph_node *cgraph_node (tree decl); + tree, gcov_type, int); +struct cgraph_node *cgraph_node (tree); struct cgraph_node *cgraph_node_for_asm (tree asmname); -struct cgraph_edge *cgraph_edge (struct cgraph_node *, tree call_expr); +struct cgraph_edge *cgraph_edge (struct cgraph_node *, tree); struct cgraph_local_info *cgraph_local_info (tree); struct cgraph_global_info *cgraph_global_info (tree); struct cgraph_rtl_info *cgraph_rtl_info (tree); const char * cgraph_node_name (struct cgraph_node *); -struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *, struct cgraph_node *, tree); -struct cgraph_node * cgraph_clone_node (struct cgraph_node *); +struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *, struct cgraph_node *, tree, int, int); +struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, int); -struct cgraph_varpool_node *cgraph_varpool_node (tree decl); +struct cgraph_varpool_node *cgraph_varpool_node (tree); struct cgraph_varpool_node *cgraph_varpool_node_for_asm (tree asmname); void cgraph_varpool_mark_needed_node (struct cgraph_varpool_node *); void cgraph_varpool_finalize_decl (tree); -bool cgraph_varpool_assemble_pending_decls (void); void cgraph_redirect_edge_callee (struct cgraph_edge *, struct cgraph_node *); bool cgraph_function_possibly_inlined_p (tree); -void cgraph_unnest_node (struct cgraph_node *node); +void cgraph_unnest_node (struct cgraph_node *); +void cgraph_varpool_enqueue_needed_node (struct cgraph_varpool_node *); +void cgraph_varpool_reset_queue (void); +bool decide_is_variable_needed (struct cgraph_varpool_node *, tree); /* In cgraphunit.c */ bool cgraph_assemble_pending_functions (void); +bool cgraph_varpool_assemble_pending_decls (void); void cgraph_finalize_function (tree, bool); +void cgraph_lower_function (struct cgraph_node *); void cgraph_finalize_compilation_unit (void); -void cgraph_create_edges (struct cgraph_node *, tree); void cgraph_optimize (void); void cgraph_mark_needed_node (struct cgraph_node *); void cgraph_mark_reachable_node (struct cgraph_node *); @@ -209,4 +239,13 @@ void cgraph_build_static_cdtor (char which, tree body, int priority); void cgraph_reset_static_var_maps (void); void init_cgraph (void); +/* In ipa.c */ +bool cgraph_remove_unreachable_nodes (bool, FILE *); +int cgraph_postorder (struct cgraph_node **); + +/* In ipa-inline.c */ +void cgraph_decide_inlining_incrementally (struct cgraph_node *); +void cgraph_clone_inlined_nodes (struct cgraph_edge *, bool); +void cgraph_mark_inline_edge (struct cgraph_edge *); +bool cgraph_default_inline_p (struct cgraph_node *); #endif /* GCC_CGRAPH_H */ diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index db0aaaf2ada..14eb46b22c0 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -136,33 +136,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA decision on whether function is needed is made more conservative so uninlininable static functions are needed too. During the call-graph construction the edge destinations are not marked as reachable and it - is completely relied upn assemble_variable to mark them. - - Inlining decision heuristics - ??? Move this to separate file after tree-ssa merge. - - We separate inlining decisions from the inliner itself and store it - inside callgraph as so called inline plan. Refer to cgraph.c - documentation about particular representation of inline plans in the - callgraph - - The implementation of particular heuristics is separated from - the rest of code to make it easier to replace it with more complicated - implementation in the future. The rest of inlining code acts as a - library aimed to modify the callgraph and verify that the parameters - on code size growth fits. - - To mark given call inline, use cgraph_mark_inline function, the - verification is performed by cgraph_default_inline_p and - cgraph_check_inline_limits. - - The heuristics implements simple knapsack style algorithm ordering - all functions by their "profitability" (estimated by code size growth) - and inlining them in priority order. - - cgraph_decide_inlining implements heuristics taking whole callgraph - into account, while cgraph_decide_inlining_incrementally considers - only one function at a time and is used in non-unit-at-a-time mode. */ + is completely relied upn assemble_variable to mark them. */ #include "config.h" @@ -189,23 +163,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "intl.h" #include "function.h" #include "tree-gimple.h" - -#define INSNS_PER_CALL 10 +#include "tree-pass.h" +#include "output.h" static void cgraph_expand_all_functions (void); static void cgraph_mark_functions_to_output (void); static void cgraph_expand_function (struct cgraph_node *); static tree record_call_1 (tree *, int *, void *); 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 *); - -/* Statistics we collect about inlining algorithm. */ -static int ncalls_inlined; -static int nfunctions_inlined; -static int initial_insns; -static int overall_insns; +static void cgraph_create_edges (struct cgraph_node *node, tree body); /* Records tree nodes seen in cgraph_create_edges. Simply using walk_tree_without_duplicates doesn't guarantee each node is visited @@ -281,6 +248,64 @@ decide_is_function_needed (struct cgraph_node *node, tree decl) return false; } +/* Walk the decls we marked as necessary and see if they reference new + variables or functions and add them into the worklists. */ +static bool +cgraph_varpool_analyze_pending_decls (void) +{ + bool changed = false; + timevar_push (TV_CGRAPH); + + while (cgraph_varpool_first_unanalyzed_node) + { + tree decl = cgraph_varpool_first_unanalyzed_node->decl; + + cgraph_varpool_first_unanalyzed_node->analyzed = true; + + cgraph_varpool_first_unanalyzed_node = cgraph_varpool_first_unanalyzed_node->next_needed; + + if (DECL_INITIAL (decl)) + cgraph_create_edges (NULL, DECL_INITIAL (decl)); + changed = true; + } + timevar_pop (TV_CGRAPH); + return changed; +} + +/* Optimization of function bodies might've rendered some variables as + unnecessary so we want to avoid these from being compiled. + + This is done by prunning the queue and keeping only the variables that + really appear needed (ie they are either externally visible or referenced + by compiled function). Re-doing the reachability analysis on variables + brings back the remaining variables referenced by these. */ +static void +cgraph_varpool_remove_unreferenced_decls (void) +{ + struct cgraph_varpool_node *next, *node = cgraph_varpool_nodes_queue; + + cgraph_varpool_reset_queue (); + + if (errorcount || sorrycount) + return; + + while (node) + { + tree decl = node->decl; + next = node->next_needed; + node->needed = 0; + + if (node->finalized + && ((DECL_ASSEMBLER_NAME_SET_P (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) + || node->force_output + || decide_is_variable_needed (node, decl))) + cgraph_varpool_mark_needed_node (node); + + node = next; + } + cgraph_varpool_analyze_pending_decls (); +} /* When not doing unit-at-a-time, output all functions enqueued. @@ -300,7 +325,9 @@ cgraph_assemble_pending_functions (void) cgraph_nodes_queue = cgraph_nodes_queue->next_needed; n->next_needed = NULL; - if (!n->global.inlined_to && !DECL_EXTERNAL (n->decl)) + if (!n->global.inlined_to + && !n->alias + && !DECL_EXTERNAL (n->decl)) { cgraph_expand_function (n); output = true; @@ -375,6 +402,7 @@ cgraph_finalize_function (tree decl, bool nested) notice_global_symbol (decl); node->decl = decl; node->local.finalized = true; + node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL; if (node->nested) lower_nested_functions (decl); gcc_assert (!node->nested); @@ -407,6 +435,18 @@ cgraph_finalize_function (tree decl, bool nested) do_warn_unused_parameter (decl); } +/* Used only while constructing the callgraph. */ +static basic_block current_basic_block; + +void +cgraph_lower_function (struct cgraph_node *node) +{ + if (node->lowered) + return; + tree_lowering_passes (node->decl); + node->lowered = true; +} + /* Walk tree and record all calls. Called via walk_tree. */ static tree record_call_1 (tree *tp, int *walk_subtrees, void *data) @@ -419,7 +459,7 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data) /* ??? 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. */ - if (TREE_STATIC (t)) + if (TREE_STATIC (t) || DECL_EXTERNAL (t)) { cgraph_varpool_mark_needed_node (cgraph_varpool_node (t)); if (lang_hooks.callgraph.analyze_expr) @@ -428,6 +468,7 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data) } break; + case FDESC_EXPR: case ADDR_EXPR: if (flag_unit_at_a_time) { @@ -444,7 +485,9 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data) tree decl = get_callee_fndecl (*tp); if (decl && TREE_CODE (decl) == FUNCTION_DECL) { - cgraph_create_edge (data, cgraph_node (decl), *tp); + cgraph_create_edge (data, cgraph_node (decl), *tp, + current_basic_block->count, + current_basic_block->loop_depth); /* When we see a function call, we don't want to look at the function reference in the ADDR_EXPR that is hanging from @@ -479,13 +522,50 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data) /* Create cgraph edges for function calls inside BODY from NODE. */ -void +static void cgraph_create_edges (struct cgraph_node *node, tree body) { /* The nodes we're interested in are never shared, so walk the tree ignoring duplicates. */ visited_nodes = pointer_set_create (); - walk_tree (&body, record_call_1, node, visited_nodes); + gcc_assert (current_basic_block == NULL); + if (TREE_CODE (body) == FUNCTION_DECL) + { + struct function *this_cfun = DECL_STRUCT_FUNCTION (body); + block_stmt_iterator bsi; + tree step; + + /* Reach the trees by walking over the CFG, and note the + enclosing basic-blocks in the call edges. */ + FOR_EACH_BB_FN (current_basic_block, this_cfun) + for (bsi = bsi_start (current_basic_block); !bsi_end_p (bsi); bsi_next (&bsi)) + walk_tree (bsi_stmt_ptr (bsi), record_call_1, node, visited_nodes); + current_basic_block = NULL; + + /* Walk over any private statics that may take addresses of functions. */ + if (TREE_CODE (DECL_INITIAL (body)) == BLOCK) + { + for (step = BLOCK_VARS (DECL_INITIAL (body)); + step; + step = TREE_CHAIN (step)) + if (DECL_INITIAL (step)) + walk_tree (&DECL_INITIAL (step), record_call_1, node, visited_nodes); + } + + /* Also look here for private statics. */ + if (DECL_STRUCT_FUNCTION (body)) + for (step = DECL_STRUCT_FUNCTION (body)->unexpanded_var_list; + step; + step = TREE_CHAIN (step)) + { + tree decl = TREE_VALUE (step); + if (DECL_INITIAL (decl) && TREE_STATIC (decl)) + walk_tree (&DECL_INITIAL (decl), record_call_1, node, visited_nodes); + } + } + else + walk_tree (&body, record_call_1, node, visited_nodes); + pointer_set_destroy (visited_nodes); visited_nodes = NULL; } @@ -543,6 +623,9 @@ verify_cgraph_node (struct cgraph_node *node) { struct cgraph_edge *e; struct cgraph_node *main_clone; + struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl); + basic_block this_block; + block_stmt_iterator bsi; timevar_push (TV_CGRAPH_VERIFY); error_found = false; @@ -602,8 +685,23 @@ verify_cgraph_node (struct cgraph_node *node) && DECL_SAVED_TREE (node->decl) && !TREE_ASM_WRITTEN (node->decl) && (!DECL_EXTERNAL (node->decl) || node->global.inlined_to)) { - walk_tree_without_duplicates (&DECL_SAVED_TREE (node->decl), - verify_cgraph_node_1, node); + if (this_cfun->cfg) + { + /* The nodes we're interested in are never shared, so walk + the tree ignoring duplicates. */ + visited_nodes = pointer_set_create (); + /* Reach the trees by walking over the CFG, and note the + enclosing basic-blocks in the call edges. */ + FOR_EACH_BB_FN (this_block, this_cfun) + for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi)) + walk_tree (bsi_stmt_ptr (bsi), verify_cgraph_node_1, node, visited_nodes); + pointer_set_destroy (visited_nodes); + visited_nodes = NULL; + } + else + /* No CFG available?! */ + gcc_unreachable (); + for (e = node->callees; e; e = e->next_callee) { if (!e->aux) @@ -637,6 +735,37 @@ verify_cgraph (void) verify_cgraph_node (node); } + +/* Output all variables enqueued to be assembled. */ +bool +cgraph_varpool_assemble_pending_decls (void) +{ + bool changed = false; + + if (errorcount || sorrycount) + return false; + + /* EH might mark decls as needed during expansion. This should be safe since + we don't create references to new function, but it should not be used + elsewhere. */ + cgraph_varpool_analyze_pending_decls (); + + while (cgraph_varpool_nodes_queue) + { + tree decl = cgraph_varpool_nodes_queue->decl; + struct cgraph_varpool_node *node = cgraph_varpool_nodes_queue; + + cgraph_varpool_nodes_queue = cgraph_varpool_nodes_queue->next_needed; + if (!TREE_ASM_WRITTEN (decl) && !node->alias && !DECL_EXTERNAL (decl)) + { + assemble_variable (decl, 0, 1, 0); + changed = true; + } + node->next_needed = NULL; + } + return changed; +} + /* Analyze the function scheduled to be output. */ static void cgraph_analyze_function (struct cgraph_node *node) @@ -645,12 +774,14 @@ cgraph_analyze_function (struct cgraph_node *node) struct cgraph_edge *e; current_function_decl = decl; + push_cfun (DECL_STRUCT_FUNCTION (decl)); + cgraph_lower_function (node); /* First kill forward declaration so reverse inlining works properly. */ - cgraph_create_edges (node, DECL_SAVED_TREE (decl)); + cgraph_create_edges (node, decl); node->local.inlinable = tree_inlinable_function_p (decl); - node->local.self_insns = estimate_num_insns (DECL_SAVED_TREE (decl)); + node->local.self_insns = estimate_num_insns (decl); if (node->local.inlinable) node->local.disregard_inline_limits = lang_hooks.tree_inlining.disregard_inline_limits (decl); @@ -670,6 +801,7 @@ cgraph_analyze_function (struct cgraph_node *node) node->global.insns = node->local.self_insns; node->analyzed = true; + pop_cfun (); current_function_decl = NULL; } @@ -679,6 +811,9 @@ void cgraph_finalize_compilation_unit (void) { struct cgraph_node *node; + /* Keep track of already processed nodes when called multiple times for + intermodule optimization. */ + static struct cgraph_node *first_analyzed; finish_aliases_1 (); @@ -688,15 +823,18 @@ cgraph_finalize_compilation_unit (void) return; } - cgraph_varpool_assemble_pending_decls (); if (!quiet_flag) - fprintf (stderr, "\nAnalyzing compilation unit\n"); + { + fprintf (stderr, "\nAnalyzing compilation unit"); + fflush (stderr); + } timevar_push (TV_CGRAPH); + cgraph_varpool_analyze_pending_decls (); if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Initial entry points:"); - for (node = cgraph_nodes; node; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = node->next) if (node->needed && DECL_SAVED_TREE (node->decl)) fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); fprintf (cgraph_dump_file, "\n"); @@ -716,7 +854,7 @@ cgraph_finalize_compilation_unit (void) node->next_needed = NULL; /* ??? It is possible to create extern inline function and later using - weak alas attribute to kill its body. See + weak alias attribute to kill its body. See gcc.c-torture/compile/20011119-1.c */ if (!DECL_SAVED_TREE (decl)) continue; @@ -730,7 +868,7 @@ cgraph_finalize_compilation_unit (void) if (!edge->callee->reachable) cgraph_mark_reachable_node (edge->callee); - cgraph_varpool_assemble_pending_decls (); + cgraph_varpool_analyze_pending_decls (); } /* Collect entry points to the unit. */ @@ -738,7 +876,7 @@ cgraph_finalize_compilation_unit (void) if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Unit entry points:"); - for (node = cgraph_nodes; node; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = node->next) if (node->needed && DECL_SAVED_TREE (node->decl)) fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); fprintf (cgraph_dump_file, "\n\nInitial "); @@ -748,7 +886,7 @@ cgraph_finalize_compilation_unit (void) if (cgraph_dump_file) fprintf (cgraph_dump_file, "\nReclaiming functions:"); - for (node = cgraph_nodes; node; node = node->next) + for (node = cgraph_nodes; node != first_analyzed; node = node->next) { tree decl = node->decl; @@ -766,6 +904,7 @@ cgraph_finalize_compilation_unit (void) fprintf (cgraph_dump_file, "\n\nReclaimed "); dump_cgraph (cgraph_dump_file); } + first_analyzed = cgraph_nodes; ggc_collect (); timevar_pop (TV_CGRAPH); } @@ -848,807 +987,6 @@ cgraph_expand_function (struct cgraph_node *node) } } -/* Fill array order with all nodes with output flag set in the reverse - topological order. */ - -static int -cgraph_postorder (struct cgraph_node **order) -{ - struct cgraph_node *node, *node2; - int stack_size = 0; - int order_pos = 0; - struct cgraph_edge *edge, last; - - struct cgraph_node **stack = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - - /* We have to deal with cycles nicely, so use a depth first traversal - output algorithm. Ignore the fact that some functions won't need - to be output and put them into order as well, so we get dependencies - right through intline functions. */ - for (node = cgraph_nodes; node; node = node->next) - node->aux = NULL; - for (node = cgraph_nodes; node; node = node->next) - if (!node->aux) - { - node2 = node; - if (!node->callers) - node->aux = &last; - else - node->aux = node->callers; - while (node2) - { - while (node2->aux != &last) - { - edge = node2->aux; - if (edge->next_caller) - node2->aux = edge->next_caller; - else - node2->aux = &last; - if (!edge->caller->aux) - { - if (!edge->caller->callers) - edge->caller->aux = &last; - else - edge->caller->aux = edge->caller->callers; - stack[stack_size++] = node2; - node2 = edge->caller; - break; - } - } - if (node2->aux == &last) - { - order[order_pos++] = node2; - if (stack_size) - node2 = stack[--stack_size]; - else - node2 = NULL; - } - } - } - free (stack); - return order_pos; -} - - -/* Perform reachability analysis and reclaim all unreachable nodes. - This function also remove unneeded bodies of extern inline functions - and thus needs to be done only after inlining decisions has been made. */ -static bool -cgraph_remove_unreachable_nodes (void) -{ - struct cgraph_node *first = (void *) 1; - struct cgraph_node *node; - bool changed = false; - int insns = 0; - -#ifdef ENABLE_CHECKING - verify_cgraph (); -#endif - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nReclaiming functions:"); -#ifdef ENABLE_CHECKING - for (node = cgraph_nodes; node; node = node->next) - gcc_assert (!node->aux); -#endif - for (node = cgraph_nodes; node; node = node->next) - if (node->needed && !node->global.inlined_to - && (!DECL_EXTERNAL (node->decl) || !node->analyzed)) - { - node->aux = first; - first = node; - } - else - gcc_assert (!node->aux); - - /* Perform reachability analysis. As a special case do not consider - extern inline functions not inlined as live because we won't output - them at all. */ - while (first != (void *) 1) - { - struct cgraph_edge *e; - node = first; - first = first->aux; - - for (e = node->callees; e; e = e->next_callee) - if (!e->callee->aux - && node->analyzed - && (!e->inline_failed || !e->callee->analyzed - || !DECL_EXTERNAL (e->callee->decl))) - { - e->callee->aux = first; - first = e->callee; - } - } - - /* Remove unreachable nodes. Extern inline functions need special care; - Unreachable extern inline functions shall be removed. - Reachable extern inline functions we never inlined shall get their bodies - eliminated. - Reachable extern inline functions we sometimes inlined will be turned into - unanalyzed nodes so they look like for true extern functions to the rest - of code. Body of such functions is released via remove_node once the - inline clones are eliminated. */ - for (node = cgraph_nodes; node; node = node->next) - { - if (!node->aux) - { - int local_insns; - tree decl = node->decl; - - node->global.inlined_to = NULL; - if (DECL_STRUCT_FUNCTION (decl)) - local_insns = node->local.self_insns; - else - local_insns = 0; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, " %s", cgraph_node_name (node)); - if (!node->analyzed || !DECL_EXTERNAL (node->decl)) - cgraph_remove_node (node); - else - { - struct cgraph_edge *e; - - for (e = node->callers; e; e = e->next_caller) - if (e->caller->aux) - break; - if (e || node->needed) - { - struct cgraph_node *clone; - - for (clone = node->next_clone; clone; - clone = clone->next_clone) - if (clone->aux) - break; - if (!clone) - { - DECL_SAVED_TREE (node->decl) = NULL; - DECL_STRUCT_FUNCTION (node->decl) = NULL; - DECL_INITIAL (node->decl) = error_mark_node; - } - cgraph_node_remove_callees (node); - node->analyzed = false; - } - else - cgraph_remove_node (node); - } - if (!DECL_SAVED_TREE (decl)) - insns += local_insns; - changed = true; - } - } - for (node = cgraph_nodes; node; node = node->next) - node->aux = NULL; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nReclaimed %i insns", insns); - return changed; -} - -/* Estimate size of the function after inlining WHAT into TO. */ - -static int -cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to, - struct cgraph_node *what) -{ - return (what->global.insns - INSNS_PER_CALL) * times + to->global.insns; -} - -/* Estimate the growth caused by inlining NODE into all callees. */ - -static int -cgraph_estimate_growth (struct cgraph_node *node) -{ - int growth = 0; - struct cgraph_edge *e; - - for (e = node->callers; e; e = e->next_caller) - if (e->inline_failed) - growth += (cgraph_estimate_size_after_inlining (1, e->caller, node) - - e->caller->global.insns); - - /* ??? Wrong for self recursive functions or cases where we decide to not - inline for different reasons, but it is not big deal as in that case - we will keep the body around, but we will also avoid some inlining. */ - if (!node->needed && !DECL_EXTERNAL (node->decl)) - growth -= node->global.insns; - - return growth; -} - -/* E is expected to be an edge being inlined. Clone destination node of - the edge and redirect it to the new clone. - DUPLICATE is used for bookkeeping on whether we are actually creating new - clones or re-using node originally representing out-of-line function call. - */ -void -cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate) -{ - struct cgraph_node *n; - - /* We may eliminate the need for out-of-line copy to be output. In that - case just go ahead and re-use it. */ - if (!e->callee->callers->next_caller - && (!e->callee->needed || DECL_EXTERNAL (e->callee->decl)) - && duplicate - && flag_unit_at_a_time) - { - gcc_assert (!e->callee->global.inlined_to); - if (!DECL_EXTERNAL (e->callee->decl)) - overall_insns -= e->callee->global.insns, nfunctions_inlined++; - duplicate = 0; - } - else if (duplicate) - { - n = cgraph_clone_node (e->callee); - cgraph_redirect_edge_callee (e, n); - } - - if (e->caller->global.inlined_to) - e->callee->global.inlined_to = e->caller->global.inlined_to; - else - e->callee->global.inlined_to = e->caller; - - /* Recursively clone all bodies. */ - for (e = e->callee->callees; e; e = e->next_callee) - if (!e->inline_failed) - cgraph_clone_inlined_nodes (e, duplicate); -} - -/* Mark edge E as inlined and update callgraph accordingly. */ - -void -cgraph_mark_inline_edge (struct cgraph_edge *e) -{ - int old_insns = 0, new_insns = 0; - struct cgraph_node *to = NULL, *what; - - gcc_assert (e->inline_failed); - e->inline_failed = NULL; - - if (!e->callee->global.inlined && flag_unit_at_a_time) - DECL_POSSIBLY_INLINED (e->callee->decl) = true; - e->callee->global.inlined = true; - - cgraph_clone_inlined_nodes (e, true); - - what = e->callee; - - /* Now update size of caller and all functions caller is inlined into. */ - for (;e && !e->inline_failed; e = e->caller->callers) - { - old_insns = e->caller->global.insns; - new_insns = cgraph_estimate_size_after_inlining (1, e->caller, - what); - gcc_assert (new_insns >= 0); - to = e->caller; - to->global.insns = new_insns; - } - gcc_assert (what->global.inlined_to == to); - overall_insns += new_insns - old_insns; - ncalls_inlined++; -} - -/* Mark all calls of EDGE->CALLEE inlined into EDGE->CALLER. - Return following unredirected edge in the list of callers - of EDGE->CALLEE */ - -static struct cgraph_edge * -cgraph_mark_inline (struct cgraph_edge *edge) -{ - struct cgraph_node *to = edge->caller; - struct cgraph_node *what = edge->callee; - struct cgraph_edge *e, *next; - int times = 0; - - /* Look for all calls, mark them inline and clone recursively - all inlined functions. */ - for (e = what->callers; e; e = next) - { - next = e->next_caller; - if (e->caller == to && e->inline_failed) - { - cgraph_mark_inline_edge (e); - if (e == edge) - edge = next; - times++; - } - } - gcc_assert (times); - return edge; -} - -/* Return false when inlining WHAT into TO is not good idea - as it would cause too large growth of function bodies. */ - -static bool -cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what, - const char **reason) -{ - int times = 0; - struct cgraph_edge *e; - int newsize; - int limit; - - if (to->global.inlined_to) - to = to->global.inlined_to; - - for (e = to->callees; e; e = e->next_callee) - if (e->callee == what) - times++; - - /* When inlining large function body called once into small function, - take the inlined function as base for limiting the growth. */ - if (to->local.self_insns > what->local.self_insns) - limit = to->local.self_insns; - else - limit = what->local.self_insns; - - limit += limit * PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH) / 100; - - newsize = cgraph_estimate_size_after_inlining (times, to, what); - if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS) - && newsize > limit) - { - if (reason) - *reason = N_("--param large-function-growth limit reached"); - return false; - } - return true; -} - -/* Return true when function N is small enough to be inlined. */ - -static bool -cgraph_default_inline_p (struct cgraph_node *n) -{ - if (!DECL_INLINE (n->decl) || !DECL_SAVED_TREE (n->decl)) - return false; - if (DECL_DECLARED_INLINE_P (n->decl)) - return n->global.insns < MAX_INLINE_INSNS_SINGLE; - else - return n->global.insns < MAX_INLINE_INSNS_AUTO; -} - -/* Return true when inlining WHAT would create recursive inlining. - We call recursive inlining all cases where same function appears more than - once in the single recursion nest path in the inline graph. */ - -static bool -cgraph_recursive_inlining_p (struct cgraph_node *to, - struct cgraph_node *what, - const char **reason) -{ - bool recursive; - if (to->global.inlined_to) - recursive = what->decl == to->global.inlined_to->decl; - else - recursive = what->decl == to->decl; - /* Marking recursive function inline has sane semantic and thus we should - not warn on it. */ - if (recursive && reason) - *reason = (what->local.disregard_inline_limits - ? N_("recursive inlining") : ""); - return recursive; -} - -/* Recompute heap nodes for each of callees. */ -static void -update_callee_keys (fibheap_t heap, struct fibnode **heap_node, - struct cgraph_node *node) -{ - struct cgraph_edge *e; - - for (e = node->callees; e; e = e->next_callee) - if (e->inline_failed && heap_node[e->callee->uid]) - fibheap_replace_key (heap, heap_node[e->callee->uid], - cgraph_estimate_growth (e->callee)); - else if (!e->inline_failed) - update_callee_keys (heap, heap_node, e->callee); -} - -/* Enqueue all recursive calls from NODE into queue linked via aux pointers - in between FIRST and LAST. WHERE is used for bookkeeping while looking - int calls inlined within NODE. */ -static void -lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where, - struct cgraph_edge **first, struct cgraph_edge **last) -{ - struct cgraph_edge *e; - for (e = where->callees; e; e = e->next_callee) - if (e->callee == node) - { - if (!*first) - *first = e; - else - (*last)->aux = e; - *last = e; - } - for (e = where->callees; e; e = e->next_callee) - if (!e->inline_failed) - lookup_recursive_calls (node, e->callee, first, last); -} - -/* Decide on recursive inlining: in the case function has recursive calls, - inline until body size reaches given argument. */ -static void -cgraph_decide_recursive_inlining (struct cgraph_node *node) -{ - int limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO); - int max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO); - struct cgraph_edge *first_call = NULL, *last_call = NULL; - struct cgraph_edge *last_in_current_depth; - struct cgraph_edge *e; - struct cgraph_node *master_clone; - int depth = 0; - int n = 0; - - if (DECL_DECLARED_INLINE_P (node->decl)) - { - limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE); - max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH); - } - - /* Make sure that function is small enough to be considered for inlining. */ - if (!max_depth - || cgraph_estimate_size_after_inlining (1, node, node) >= limit) - return; - lookup_recursive_calls (node, node, &first_call, &last_call); - if (!first_call) - return; - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nPerforming recursive inlining on %s\n", - cgraph_node_name (node)); - - /* We need original clone to copy around. */ - master_clone = cgraph_clone_node (node); - master_clone->needed = true; - for (e = master_clone->callees; e; e = e->next_callee) - if (!e->inline_failed) - cgraph_clone_inlined_nodes (e, true); - - /* Do the inlining and update list of recursive call during process. */ - last_in_current_depth = last_call; - while (first_call - && cgraph_estimate_size_after_inlining (1, node, master_clone) <= limit) - { - struct cgraph_edge *curr = first_call; - - first_call = first_call->aux; - curr->aux = NULL; - - cgraph_redirect_edge_callee (curr, master_clone); - cgraph_mark_inline_edge (curr); - lookup_recursive_calls (node, curr->callee, &first_call, &last_call); - - if (last_in_current_depth - && ++depth >= max_depth) - break; - n++; - } - - /* Cleanup queue pointers. */ - while (first_call) - { - struct cgraph_edge *next = first_call->aux; - first_call->aux = NULL; - first_call = next; - } - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\n Inlined %i times, body grown from %i to %i insns\n", n, - master_clone->global.insns, node->global.insns); - - /* Remove master clone we used for inlining. We rely that clones inlined - into master clone gets queued just before master clone so we don't - need recursion. */ - for (node = cgraph_nodes; node != master_clone; - node = node->next) - if (node->global.inlined_to == master_clone) - cgraph_remove_node (node); - cgraph_remove_node (master_clone); -} - -/* Set inline_failed for all callers of given function to REASON. */ - -static void -cgraph_set_inline_failed (struct cgraph_node *node, const char *reason) -{ - struct cgraph_edge *e; - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "Inlining failed: %s\n", reason); - for (e = node->callers; e; e = e->next_caller) - if (e->inline_failed) - e->inline_failed = reason; -} - -/* We use greedy algorithm for inlining of small functions: - All inline candidates are put into prioritized heap based on estimated - growth of the overall number of instructions and then update the estimates. - - INLINED and INLINED_CALEES are just pointers to arrays large enough - to be passed to cgraph_inlined_into and cgraph_inlined_callees. */ - -static void -cgraph_decide_inlining_of_small_functions (void) -{ - struct cgraph_node *node; - fibheap_t heap = fibheap_new (); - struct fibnode **heap_node = - xcalloc (cgraph_max_uid, sizeof (struct fibnode *)); - int max_insns = ((HOST_WIDEST_INT) initial_insns - * (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100); - - /* Put all inline candidates into the heap. */ - - for (node = cgraph_nodes; node; node = node->next) - { - if (!node->local.inlinable || !node->callers - || node->local.disregard_inline_limits) - continue; - - if (!cgraph_default_inline_p (node)) - { - cgraph_set_inline_failed (node, - N_("--param max-inline-insns-single limit reached")); - continue; - } - heap_node[node->uid] = - fibheap_insert (heap, cgraph_estimate_growth (node), node); - } - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nDeciding on smaller functions:\n"); - while (overall_insns <= max_insns && (node = fibheap_extract_min (heap))) - { - struct cgraph_edge *e, *next; - int old_insns = overall_insns; - - heap_node[node->uid] = NULL; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nConsidering %s with %i insns\n" - " Estimated growth is %+i insns.\n", - cgraph_node_name (node), node->global.insns, - cgraph_estimate_growth (node)); - if (!cgraph_default_inline_p (node)) - { - cgraph_set_inline_failed (node, - N_("--param max-inline-insns-single limit reached after inlining into the callee")); - continue; - } - for (e = node->callers; e; e = next) - { - next = e->next_caller; - if (e->inline_failed) - { - struct cgraph_node *where; - - if (cgraph_recursive_inlining_p (e->caller, e->callee, - &e->inline_failed) - || !cgraph_check_inline_limits (e->caller, e->callee, - &e->inline_failed)) - { - if (cgraph_dump_file) - fprintf (cgraph_dump_file, " Not inlining into %s:%s.\n", - cgraph_node_name (e->caller), e->inline_failed); - continue; - } - next = cgraph_mark_inline (e); - where = e->caller; - if (where->global.inlined_to) - where = where->global.inlined_to; - - if (heap_node[where->uid]) - fibheap_replace_key (heap, heap_node[where->uid], - cgraph_estimate_growth (where)); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined into %s which now has %i insns.\n", - cgraph_node_name (e->caller), - e->caller->global.insns); - } - } - - cgraph_decide_recursive_inlining (node); - - /* Similarly all functions called by the function we just inlined - are now called more times; update keys. */ - update_callee_keys (heap, heap_node, node); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined for a net change of %+i insns.\n", - overall_insns - old_insns); - } - while ((node = fibheap_extract_min (heap)) != NULL) - if (!node->local.disregard_inline_limits) - cgraph_set_inline_failed (node, N_("--param inline-unit-growth limit reached")); - fibheap_delete (heap); - free (heap_node); -} - -/* Decide on the inlining. We do so in the topological order to avoid - expenses on updating data structures. */ - -static void -cgraph_decide_inlining (void) -{ - struct cgraph_node *node; - int nnodes; - struct cgraph_node **order = - xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); - int old_insns = 0; - int i; - - for (node = cgraph_nodes; node; node = node->next) - initial_insns += node->local.self_insns; - overall_insns = initial_insns; - - nnodes = cgraph_postorder (order); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nDeciding on inlining. Starting with %i insns.\n", - initial_insns); - - for (node = cgraph_nodes; node; node = node->next) - node->aux = 0; - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nInlining always_inline functions:\n"); - - /* In the first pass mark all always_inline edges. Do this with a priority - so none of our later choices will make this impossible. */ - for (i = nnodes - 1; i >= 0; i--) - { - struct cgraph_edge *e, *next; - - node = order[i]; - - if (!node->local.disregard_inline_limits) - continue; - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nConsidering %s %i insns (always inline)\n", - cgraph_node_name (node), node->global.insns); - old_insns = overall_insns; - for (e = node->callers; e; e = next) - { - next = e->next_caller; - if (!e->inline_failed) - continue; - if (cgraph_recursive_inlining_p (e->caller, e->callee, - &e->inline_failed)) - continue; - cgraph_mark_inline_edge (e); - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined into %s which now has %i insns.\n", - cgraph_node_name (e->caller), - e->caller->global.insns); - } - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined for a net change of %+i insns.\n", - overall_insns - old_insns); - } - - if (!flag_really_no_inline) - { - cgraph_decide_inlining_of_small_functions (); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, "\nDeciding on functions called once:\n"); - - /* And finally decide what functions are called once. */ - - for (i = nnodes - 1; i >= 0; i--) - { - node = order[i]; - - if (node->callers && !node->callers->next_caller && !node->needed - && node->local.inlinable && node->callers->inline_failed - && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl)) - { - bool ok = true; - struct cgraph_node *node1; - - /* Verify that we won't duplicate the caller. */ - for (node1 = node->callers->caller; - node1->callers && !node1->callers->inline_failed - && ok; node1 = node1->callers->caller) - if (node1->callers->next_caller || node1->needed) - ok = false; - if (ok) - { - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nConsidering %s %i insns.\n" - " Called once from %s %i insns.\n", - cgraph_node_name (node), node->global.insns, - cgraph_node_name (node->callers->caller), - node->callers->caller->global.insns); - - old_insns = overall_insns; - - if (cgraph_check_inline_limits (node->callers->caller, node, - NULL)) - { - cgraph_mark_inline (node->callers); - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inlined into %s which now has %i insns" - " for a net change of %+i insns.\n", - cgraph_node_name (node->callers->caller), - node->callers->caller->global.insns, - overall_insns - old_insns); - } - else - { - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - " Inline limit reached, not inlined.\n"); - } - } - } - } - } - - /* We will never output extern functions we didn't inline. - ??? Perhaps we can prevent accounting of growth of external - inline functions. */ - cgraph_remove_unreachable_nodes (); - - if (cgraph_dump_file) - fprintf (cgraph_dump_file, - "\nInlined %i calls, eliminated %i functions, " - "%i insns turned to %i insns.\n\n", - ncalls_inlined, nfunctions_inlined, initial_insns, - overall_insns); - free (order); -} - -/* Decide on the inlining. We do so in the topological order to avoid - expenses on updating data structures. */ - -static void -cgraph_decide_inlining_incrementally (struct cgraph_node *node) -{ - struct cgraph_edge *e; - - /* First of all look for always inline functions. */ - for (e = node->callees; e; e = e->next_callee) - if (e->callee->local.disregard_inline_limits - && e->inline_failed - && !cgraph_recursive_inlining_p (node, e->callee, &e->inline_failed) - /* ??? It is possible that renaming variable removed the function body - in duplicate_decls. See gcc.c-torture/compile/20011119-2.c */ - && DECL_SAVED_TREE (e->callee->decl)) - cgraph_mark_inline (e); - - /* Now do the automatic inlining. */ - if (!flag_really_no_inline) - for (e = node->callees; e; e = e->next_callee) - if (e->callee->local.inlinable - && e->inline_failed - && !e->callee->local.disregard_inline_limits - && !cgraph_recursive_inlining_p (node, e->callee, &e->inline_failed) - && cgraph_check_inline_limits (node, e->callee, &e->inline_failed) - && DECL_SAVED_TREE (e->callee->decl)) - { - if (cgraph_default_inline_p (e->callee)) - cgraph_mark_inline (e); - else - e->inline_failed - = N_("--param max-inline-insns-single limit reached"); - } -} - - /* Return true when CALLER_DECL should be inlined into CALLEE_DECL. */ bool @@ -1758,9 +1096,16 @@ cgraph_optimize (void) verify_cgraph (); #endif if (!flag_unit_at_a_time) - return; + { + cgraph_varpool_assemble_pending_decls (); + return; + } process_pending_assemble_externals (); + + /* Frontend may output common variables after the unit has been finalized. + It is safe to deal with them here as they are always zero initialized. */ + cgraph_varpool_analyze_pending_decls (); timevar_push (TV_CGRAPHOPT); if (!quiet_flag) @@ -1772,14 +1117,13 @@ cgraph_optimize (void) fprintf (cgraph_dump_file, "Marked "); dump_cgraph (cgraph_dump_file); } - - if (flag_inline_trees) - cgraph_decide_inlining (); + ipa_passes (); cgraph_global_info_ready = true; if (cgraph_dump_file) { fprintf (cgraph_dump_file, "Optimized "); dump_cgraph (cgraph_dump_file); + dump_varpool (cgraph_dump_file); } timevar_pop (TV_CGRAPHOPT); @@ -1791,8 +1135,11 @@ cgraph_optimize (void) #endif cgraph_mark_functions_to_output (); - cgraph_expand_all_functions (); + cgraph_varpool_remove_unreferenced_decls (); + + cgraph_varpool_assemble_pending_decls (); + if (cgraph_dump_file) { fprintf (cgraph_dump_file, "\nFinal "); @@ -1879,7 +1226,10 @@ cgraph_build_static_cdtor (char which, tree body, int priority) /* ??? We will get called LATE in the compilation process. */ if (cgraph_global_info_ready) - tree_rest_of_compilation (decl); + { + tree_lowering_passes (decl); + tree_rest_of_compilation (decl); + } else cgraph_finalize_function (decl, 0); diff --git a/gcc/collect2.c b/gcc/collect2.c index 90ad456b5fa..7c8fde6a4c0 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -35,19 +35,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA # define SIGCHLD SIGCLD #endif -#ifdef vfork /* Autoconf may define this to fork for us. */ -# define VFORK_STRING "fork" -#else -# define VFORK_STRING "vfork" -#endif -#ifdef HAVE_VFORK_H -#include -#endif -#ifdef VMS -#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \ - lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1) -#endif /* VMS */ - #ifndef LIBRARY_PATH_ENV #define LIBRARY_PATH_ENV "LIBRARY_PATH" #endif @@ -197,7 +184,8 @@ static const char *o_file; /* .o for constructor/destructor list. */ #ifdef COLLECT_EXPORT_LIST static const char *export_file; /* .x for AIX export list. */ #endif -const char *ldout; /* File for ld errors. */ +const char *ldout; /* File for ld stdout. */ +const char *lderrout; /* File for ld stderr. */ static const char *output_file; /* Output file for ld. */ static const char *nm_file_name; /* pathname of nm */ #ifdef LDD_SUFFIX @@ -217,9 +205,6 @@ static struct head frame_tables; /* list of frame unwind info tables */ struct obstack temporary_obstack; char * temporary_firstobj; -/* Holds the return value of pexecute and fork. */ -int pid; - /* Structure to hold all the directories in which to search for files to execute. */ @@ -251,7 +236,7 @@ static char *find_a_file (struct path_prefix *, const char *); static void add_prefix (struct path_prefix *, const char *); static void prefix_from_env (const char *, struct path_prefix *); static void prefix_from_string (const char *, struct path_prefix *); -static void do_wait (const char *); +static void do_wait (const char *, struct pex_obj *); static void fork_execute (const char *, char **); static void maybe_unlink (const char *); static void add_to_list (struct head *, const char *); @@ -324,10 +309,16 @@ collect_exit (int status) if (ldout != 0 && ldout[0]) { - dump_file (ldout); + dump_file (ldout, stdout); maybe_unlink (ldout); } + if (lderrout != 0 && lderrout[0]) + { + dump_file (lderrout, stderr); + maybe_unlink (lderrout); + } + if (status != 0 && output_file != 0 && output_file[0]) maybe_unlink (output_file); @@ -414,13 +405,16 @@ handler (int signo) if (ldout != 0 && ldout[0]) maybe_unlink (ldout); + if (lderrout != 0 && lderrout[0]) + maybe_unlink (lderrout); + #ifdef COLLECT_EXPORT_LIST if (export_file != 0 && export_file[0]) maybe_unlink (export_file); #endif signal (signo, SIG_DFL); - kill (getpid (), signo); + raise (signo); } @@ -463,7 +457,7 @@ extract_string (const char **pp) } void -dump_file (const char *name) +dump_file (const char *name, FILE *to) { FILE *stream = fopen (name, "r"); @@ -483,7 +477,7 @@ dump_file (const char *name) word = obstack_finish (&temporary_obstack); if (*word == '.') - ++word, putc ('.', stderr); + ++word, putc ('.', to); p = word; if (!strncmp (p, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX))) p += strlen (USER_LABEL_PREFIX); @@ -500,25 +494,25 @@ dump_file (const char *name) if (result) { int diff; - fputs (result, stderr); + fputs (result, to); diff = strlen (word) - strlen (result); while (diff > 0 && c == ' ') - --diff, putc (' ', stderr); + --diff, putc (' ', to); while (diff < 0 && c == ' ') ++diff, c = getc (stream); free (result); } else - fputs (word, stderr); + fputs (word, to); - fflush (stderr); + fflush (to); obstack_free (&temporary_obstack, temporary_firstobj); } if (c == EOF) break; - putc (c, stderr); + putc (c, to); } fclose (stream); } @@ -837,6 +831,9 @@ main (int argc, char **argv) signal (SIGCHLD, SIG_DFL); #endif + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); /* Do not invoke xcalloc before this point, since locale needs to be @@ -1006,6 +1003,7 @@ main (int argc, char **argv) export_file = make_temp_file (".x"); #endif ldout = make_temp_file (".ld"); + lderrout = make_temp_file (".le"); *c_ptr++ = c_file_name; *c_ptr++ = "-x"; *c_ptr++ = "c"; @@ -1501,11 +1499,14 @@ main (int argc, char **argv) /* Wait for a process to finish, and exit if a nonzero status is found. */ int -collect_wait (const char *prog) +collect_wait (const char *prog, struct pex_obj *pex) { int status; - pwait (pid, &status, 0); + if (!pex_get_status (pex, 1, &status)) + fatal_perror ("can't get program status"); + pex_free (pex); + if (status) { if (WIFSIGNALED (status)) @@ -1524,9 +1525,9 @@ collect_wait (const char *prog) } static void -do_wait (const char *prog) +do_wait (const char *prog, struct pex_obj *pex) { - int ret = collect_wait (prog); + int ret = collect_wait (prog, pex); if (ret != 0) { error ("%s returned %d exit status", prog, ret); @@ -1537,14 +1538,13 @@ do_wait (const char *prog) /* Execute a program, and wait for the reply. */ -void -collect_execute (const char *prog, char **argv, const char *redir) +struct pex_obj * +collect_execute (const char *prog, char **argv, const char *outname, + const char *errname) { - char *errmsg_fmt; - char *errmsg_arg; - int redir_handle = -1; - int stdout_save = -1; - int stderr_save = -1; + struct pex_obj *pex; + const char *errmsg; + int err; if (vflag || debug) { @@ -1571,47 +1571,33 @@ collect_execute (const char *prog, char **argv, const char *redir) if (argv[0] == 0) fatal ("cannot find '%s'", prog); - if (redir) - { - /* Open response file. */ - redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT); - - /* Duplicate the stdout and stderr file handles - so they can be restored later. */ - stdout_save = dup (STDOUT_FILENO); - if (stdout_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - stderr_save = dup (STDERR_FILENO); - if (stderr_save == -1) - fatal_perror ("redirecting stdout: %s", redir); - - /* Redirect stdout & stderr to our response file. */ - dup2 (redir_handle, STDOUT_FILENO); - dup2 (redir_handle, STDERR_FILENO); - } + pex = pex_init (0, "collect2", NULL); + if (pex == NULL) + fatal_perror ("pex_init failed"); - pid = pexecute (argv[0], argv, argv[0], NULL, &errmsg_fmt, &errmsg_arg, - (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH)); - - if (redir) + errmsg = pex_run (pex, PEX_LAST | PEX_SEARCH, argv[0], argv, outname, + errname, &err); + if (errmsg != NULL) { - /* Restore stdout and stderr to their previous settings. */ - dup2 (stdout_save, STDOUT_FILENO); - dup2 (stderr_save, STDERR_FILENO); - - /* Close response file. */ - close (redir_handle); + if (err != 0) + { + errno = err; + fatal_perror (errmsg); + } + else + fatal (errmsg); } - if (pid == -1) - fatal_perror (errmsg_fmt, errmsg_arg); + return pex; } static void fork_execute (const char *prog, char **argv) { - collect_execute (prog, argv, NULL); - do_wait (prog); + struct pex_obj *pex; + + pex = collect_execute (prog, argv, NULL, NULL); + do_wait (prog, pex); } /* Unlink a file unless we are debugging. */ @@ -2033,11 +2019,15 @@ static void scan_prog_file (const char *prog_name, enum pass which_pass) { void (*int_handler) (int); +#ifdef SIGQUIT void (*quit_handler) (int); +#endif char *real_nm_argv[4]; const char **nm_argv = (const char **) real_nm_argv; int argc = 0; - int pipe_fd[2]; + struct pex_obj *pex; + const char *errmsg; + int err; char *p, buf[1024]; FILE *inf; @@ -2055,13 +2045,6 @@ scan_prog_file (const char *prog_name, enum pass which_pass) nm_argv[argc++] = prog_name; nm_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) - fatal_perror ("pipe"); - - inf = fdopen (pipe_fd[0], "r"); - if (inf == (FILE *) 0) - fatal_perror ("fdopen"); - /* Trace if needed. */ if (vflag) { @@ -2077,35 +2060,30 @@ scan_prog_file (const char *prog_name, enum pass which_pass) fflush (stdout); fflush (stderr); - /* Spawn child nm on pipe. */ - pid = vfork (); - if (pid == -1) - fatal_perror (VFORK_STRING); + pex = pex_init (PEX_USE_PIPES, "collect2", NULL); + if (pex == NULL) + fatal_perror ("pex_init failed"); - if (pid == 0) /* child context */ + errmsg = pex_run (pex, 0, nm_file_name, real_nm_argv, NULL, NULL, &err); + if (errmsg != NULL) { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (nm_file_name, real_nm_argv); - fatal_perror ("execv %s", nm_file_name); + if (err != 0) + { + errno = err; + fatal_perror (errmsg); + } + else + fatal (errmsg); } - /* Parent context from here on. */ int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); #ifdef SIGQUIT quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); #endif - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + inf = pex_read_output (pex, 0); + if (inf == NULL) + fatal_perror ("can't open nm output"); if (debug) fprintf (stderr, "\nnm output with constructors/destructors.\n"); @@ -2179,10 +2157,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass) if (debug) fprintf (stderr, "\n"); - if (fclose (inf) != 0) - fatal_perror ("fclose"); - - do_wait (nm_file_name); + do_wait (nm_file_name, pex); signal (SIGINT, int_handler); #ifdef SIGQUIT @@ -2202,11 +2177,15 @@ scan_libraries (const char *prog_name) static struct head libraries; /* list of shared libraries found */ struct id *list; void (*int_handler) (int); +#ifdef SIGQUIT void (*quit_handler) (int); +#endif char *real_ldd_argv[4]; const char **ldd_argv = (const char **) real_ldd_argv; int argc = 0; - int pipe_fd[2]; + struct pex_obj *pex; + const char *errmsg; + int err; char buf[1024]; FILE *inf; @@ -2221,13 +2200,6 @@ scan_libraries (const char *prog_name) ldd_argv[argc++] = prog_name; ldd_argv[argc++] = (char *) 0; - if (pipe (pipe_fd) < 0) - fatal_perror ("pipe"); - - inf = fdopen (pipe_fd[0], "r"); - if (inf == (FILE *) 0) - fatal_perror ("fdopen"); - /* Trace if needed. */ if (vflag) { @@ -2243,35 +2215,30 @@ scan_libraries (const char *prog_name) fflush (stdout); fflush (stderr); - /* Spawn child ldd on pipe. */ - pid = vfork (); - if (pid == -1) - fatal_perror (VFORK_STRING); + pex = pex_init (PEX_USE_PIPES, "collect2", NULL); + if (pex == NULL) + fatal_perror ("pex_init failed"); - if (pid == 0) /* child context */ + errmsg = pex_run (pex, 0, ldd_file_name, real_ldd_argv, NULL, NULL, &err); + if (errmsg != NULL) { - /* setup stdout */ - if (dup2 (pipe_fd[1], 1) < 0) - fatal_perror ("dup2 %d 1", pipe_fd[1]); - - if (close (pipe_fd[0]) < 0) - fatal_perror ("close %d", pipe_fd[0]); - - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); - - execv (ldd_file_name, real_ldd_argv); - fatal_perror ("execv %s", ldd_file_name); + if (err != 0) + { + errno = err; + fatal_perror (errmsg); + } + else + fatal (errmsg); } - /* Parent context from here on. */ int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN); #ifdef SIGQUIT quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN); #endif - if (close (pipe_fd[1]) < 0) - fatal_perror ("close %d", pipe_fd[1]); + inf = pex_read_output (pex, 0); + if (inf == NULL) + fatal_perror ("can't open ldd output"); if (debug) notice ("\nldd output with constructors/destructors.\n"); @@ -2309,10 +2276,7 @@ scan_libraries (const char *prog_name) if (debug) fprintf (stderr, "\n"); - if (fclose (inf) != 0) - fatal_perror ("fclose"); - - do_wait (ldd_file_name); + do_wait (ldd_file_name, pex); signal (SIGINT, int_handler); #ifdef SIGQUIT diff --git a/gcc/collect2.h b/gcc/collect2.h index d25009bccaa..7a8f51cacb3 100644 --- a/gcc/collect2.h +++ b/gcc/collect2.h @@ -1,5 +1,5 @@ /* Header file for collect/tlink routines. - Copyright (C) 1998, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -23,17 +23,19 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA extern void do_tlink (char **, char **); -extern void collect_execute (const char *, char **, const char *); +extern struct pex_obj *collect_execute (const char *, char **, const char *, + const char *); extern void collect_exit (int) ATTRIBUTE_NORETURN; -extern int collect_wait (const char *); +extern int collect_wait (const char *, struct pex_obj *); -extern void dump_file (const char *); +extern void dump_file (const char *, FILE *); extern int file_exists (const char *); extern const char *ldout; +extern const char *lderrout; extern const char *c_file_name; extern struct obstack temporary_obstack; extern char *temporary_firstobj; diff --git a/gcc/combine.c b/gcc/combine.c index f97d6c04a4a..251c1eeafb8 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -386,6 +386,7 @@ static rtx known_cond (rtx, enum rtx_code, rtx, rtx); static int rtx_equal_for_field_assignment_p (rtx, rtx); static rtx make_field_assignment (rtx); static rtx apply_distributive_law (rtx); +static rtx distribute_and_simplify_rtx (rtx, int); static rtx simplify_and_const_int (rtx, enum machine_mode, rtx, unsigned HOST_WIDE_INT); static int merge_outer_ops (enum rtx_code *, HOST_WIDE_INT *, enum rtx_code, @@ -394,7 +395,6 @@ static rtx simplify_shift_const (rtx, enum rtx_code, enum machine_mode, rtx, int); static int recog_for_combine (rtx *, rtx, rtx *); static rtx gen_lowpart_for_combine (enum machine_mode, rtx); -static rtx gen_binary (enum rtx_code, enum machine_mode, rtx, rtx); static enum rtx_code simplify_comparison (enum rtx_code, rtx *, rtx *); static void update_table_tick (rtx); static void record_value_for_reg (rtx, rtx, rtx); @@ -413,8 +413,6 @@ static void distribute_links (rtx); static void mark_used_regs_combine (rtx); static int insn_cuid (rtx); static void record_promoted_value (rtx, rtx); -static rtx reversed_comparison (rtx, enum machine_mode, rtx, rtx); -static enum rtx_code combine_reversed_comparison_code (rtx); static int unmentioned_reg_p_1 (rtx *, void *); static bool unmentioned_reg_p (rtx, rtx); @@ -424,6 +422,10 @@ static bool unmentioned_reg_p (rtx, rtx); #undef RTL_HOOKS_GEN_LOWPART #define RTL_HOOKS_GEN_LOWPART gen_lowpart_for_combine +/* Our implementation of gen_lowpart never emits a new pseudo. */ +#undef RTL_HOOKS_GEN_LOWPART_NO_EMIT +#define RTL_HOOKS_GEN_LOWPART_NO_EMIT gen_lowpart_for_combine + #undef RTL_HOOKS_REG_NONZERO_REG_BITS #define RTL_HOOKS_REG_NONZERO_REG_BITS reg_nonzero_bits_for_combine @@ -884,7 +886,7 @@ combine_instructions (rtx f, unsigned int nregs) EXECUTE_IF_SET_IN_SBITMAP (refresh_blocks, 0, i, BASIC_BLOCK (i)->flags |= BB_DIRTY); - new_direct_jump_p |= purge_all_dead_edges (0); + new_direct_jump_p |= purge_all_dead_edges (); delete_noop_moves (); update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES, @@ -1316,9 +1318,9 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, if (INSN_P (p) && p != succ && volatile_insn_p (PATTERN (p))) return 0; - /* If INSN or I2 contains an autoincrement or autodecrement, - make sure that register is not used between there and I3, - and not already used in I3 either. + /* If INSN contains an autoincrement or autodecrement, make sure that + register is not used between there and I3, and not already used in + I3 either. Neither must it be used in PRED or SUCC, if they exist. Also insist that I3 not be a jump; if it were one and the incremented register were spilled, we would lose. */ @@ -1327,6 +1329,10 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ, if (REG_NOTE_KIND (link) == REG_INC && (JUMP_P (i3) || reg_used_between_p (XEXP (link, 0), insn, i3) + || (pred != NULL_RTX + && reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (pred))) + || (succ != NULL_RTX + && reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (succ))) || reg_overlap_mentioned_p (XEXP (link, 0), PATTERN (i3)))) return 0; #endif @@ -1521,7 +1527,7 @@ cant_combine_insn_p (rtx insn) /* Never combine loads and stores involving hard regs that are likely to be spilled. The register allocator can usually handle such reg-reg moves by tying. If we allow the combiner to make - substitutions of likely-spilled regs, we may abort in reload. + substitutions of likely-spilled regs, reload might die. As an exception, we allow combinations involving fixed regs; these are not available to the register allocator so there's no risk involved. */ @@ -2090,8 +2096,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) || (i1 != 0 && FIND_REG_INC_NOTE (i1, NULL_RTX) != 0 && (n_occurrences + added_sets_1 + (added_sets_2 && ! i1_feeds_i3) > 1)) - /* Fail if we tried to make a new register (we used to abort, but there's - really no reason to). */ + /* Fail if we tried to make a new register. */ || max_reg_num () != maxreg /* Fail if we couldn't do something and have a CLOBBER. */ || GET_CODE (newpat) == CLOBBER @@ -2373,11 +2378,17 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p) && REG_P (i2dest) #endif /* We need I2DEST in the proper mode. If it is a hard register - or the only use of a pseudo, we can change its mode. */ + or the only use of a pseudo, we can change its mode. + Make sure we don't change a hard register to have a mode that + isn't valid for it, or change the number of registers. */ && (GET_MODE (*split) == GET_MODE (i2dest) || GET_MODE (*split) == VOIDmode - || REGNO (i2dest) < FIRST_PSEUDO_REGISTER - || (REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2 + || (REGNO (i2dest) < FIRST_PSEUDO_REGISTER + && HARD_REGNO_MODE_OK (REGNO (i2dest), GET_MODE (*split)) + && (HARD_REGNO_NREGS (REGNO (i2dest), GET_MODE (i2dest)) + == HARD_REGNO_NREGS (REGNO (i2dest), GET_MODE (*split)))) + || (REGNO (i2dest) >= FIRST_PSEUDO_REGISTER + && REG_N_SETS (REGNO (i2dest)) == 1 && ! added_sets_2 && ! REG_USERVAR_P (i2dest))) && (next_real_insn (i2) == i3 || ! use_crosses_set_p (*split, INSN_CUID (i2))) @@ -3211,14 +3222,16 @@ find_split_point (rtx *loc, rtx insn) if (src == mask) SUBST (SET_SRC (x), - gen_binary (IOR, mode, dest, GEN_INT (src << pos))); + simplify_gen_binary (IOR, mode, dest, GEN_INT (src << pos))); else - SUBST (SET_SRC (x), - gen_binary (IOR, mode, - gen_binary (AND, mode, dest, - gen_int_mode (~(mask << pos), - mode)), - GEN_INT (src << pos))); + { + rtx negmask = gen_int_mode (~(mask << pos), mode); + SUBST (SET_SRC (x), + simplify_gen_binary (IOR, mode, + simplify_gen_binary (AND, mode, + dest, negmask), + GEN_INT (src << pos))); + } SUBST (SET_DEST (x), dest); @@ -3754,47 +3767,6 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) SUBST (XEXP (x, 1), temp); } - /* If this is a PLUS, MINUS, or MULT, and the first operand is the - sign extension of a PLUS with a constant, reverse the order of the sign - extension and the addition. Note that this not the same as the original - code, but overflow is undefined for signed values. Also note that the - PLUS will have been partially moved "inside" the sign-extension, so that - the first operand of X will really look like: - (ashiftrt (plus (ashift A C4) C5) C4). - We convert this to - (plus (ashiftrt (ashift A C4) C2) C4) - and replace the first operand of X with that expression. Later parts - of this function may simplify the expression further. - - For example, if we start with (mult (sign_extend (plus A C1)) C2), - we swap the SIGN_EXTEND and PLUS. Later code will apply the - distributive law to produce (plus (mult (sign_extend X) C1) C3). - - We do this to simplify address expressions. */ - - if ((code == PLUS || code == MINUS || code == MULT) - && GET_CODE (XEXP (x, 0)) == ASHIFTRT - && GET_CODE (XEXP (XEXP (x, 0), 0)) == PLUS - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0)) == ASHIFT - && GET_CODE (XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 1)) == CONST_INT - && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT - && XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 1) == XEXP (XEXP (x, 0), 1) - && GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 1)) == CONST_INT - && (temp = simplify_binary_operation (ASHIFTRT, mode, - XEXP (XEXP (XEXP (x, 0), 0), 1), - XEXP (XEXP (x, 0), 1))) != 0) - { - rtx new - = simplify_shift_const (NULL_RTX, ASHIFT, mode, - XEXP (XEXP (XEXP (XEXP (x, 0), 0), 0), 0), - INTVAL (XEXP (XEXP (x, 0), 1))); - - new = simplify_shift_const (NULL_RTX, ASHIFTRT, mode, new, - INTVAL (XEXP (XEXP (x, 0), 1))); - - SUBST (XEXP (x, 0), gen_binary (PLUS, mode, new, temp)); - } - /* If this is a simple operation applied to an IF_THEN_ELSE, try applying it to the arms of the IF_THEN_ELSE. This often simplifies things. Check for cases where both arms are testing the same @@ -3849,12 +3821,14 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) /* If the result values are STORE_FLAG_VALUE and zero, we can just make the comparison operation. */ if (true_rtx == const_true_rtx && false_rtx == const0_rtx) - x = gen_binary (cond_code, mode, cond, cop1); + x = simplify_gen_relational (cond_code, mode, VOIDmode, + cond, cop1); else if (true_rtx == const0_rtx && false_rtx == const_true_rtx && ((reversed = reversed_comparison_code_parts (cond_code, cond, cop1, NULL)) != UNKNOWN)) - x = gen_binary (reversed, mode, cond, cop1); + x = simplify_gen_relational (reversed, mode, VOIDmode, + cond, cop1); /* Likewise, we can make the negate of a comparison operation if the result values are - STORE_FLAG_VALUE and zero. */ @@ -3862,8 +3836,9 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) && INTVAL (true_rtx) == - STORE_FLAG_VALUE && false_rtx == const0_rtx) x = simplify_gen_unary (NEG, mode, - gen_binary (cond_code, mode, cond, - cop1), + simplify_gen_relational (cond_code, + mode, VOIDmode, + cond, cop1), mode); else if (GET_CODE (false_rtx) == CONST_INT && INTVAL (false_rtx) == - STORE_FLAG_VALUE @@ -3872,13 +3847,17 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) (cond_code, cond, cop1, NULL)) != UNKNOWN)) x = simplify_gen_unary (NEG, mode, - gen_binary (reversed, mode, - cond, cop1), + simplify_gen_relational (reversed, + mode, VOIDmode, + cond, cop1), mode); else return gen_rtx_IF_THEN_ELSE (mode, - gen_binary (cond_code, VOIDmode, - cond, cop1), + simplify_gen_relational (cond_code, + mode, + VOIDmode, + cond, + cop1), true_rtx, false_rtx); code = GET_CODE (x); @@ -3981,7 +3960,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) } if (inner) - return gen_binary (code, mode, other, inner); + return simplify_gen_binary (code, mode, other, inner); } } @@ -4083,7 +4062,8 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) if (GET_CODE (XEXP (x, 0)) == XOR && XEXP (XEXP (x, 0), 1) == const1_rtx && nonzero_bits (XEXP (XEXP (x, 0), 0), mode) == 1) - return gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), constm1_rtx); + return simplify_gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), + constm1_rtx); temp = expand_compound_operation (XEXP (x, 0)); @@ -4311,8 +4291,9 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) in1 = XEXP (XEXP (XEXP (x, 0), 0), 0); in2 = XEXP (XEXP (x, 0), 1); - return gen_binary (MINUS, mode, XEXP (x, 1), - gen_binary (MULT, mode, in1, in2)); + return simplify_gen_binary (MINUS, mode, XEXP (x, 1), + simplify_gen_binary (MULT, mode, + in1, in2)); } /* If we have (plus (plus (A const) B)), associate it so that CONST is @@ -4321,10 +4302,11 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) they are now checked elsewhere. */ if (GET_CODE (XEXP (x, 0)) == PLUS && CONSTANT_ADDRESS_P (XEXP (XEXP (x, 0), 1))) - return gen_binary (PLUS, mode, - gen_binary (PLUS, mode, XEXP (XEXP (x, 0), 0), - XEXP (x, 1)), - XEXP (XEXP (x, 0), 1)); + return simplify_gen_binary (PLUS, mode, + simplify_gen_binary (PLUS, mode, + XEXP (XEXP (x, 0), 0), + XEXP (x, 1)), + XEXP (XEXP (x, 0), 1)); /* (plus (xor (and (const_int pow2 - 1)) ) <-c>) when c is (const_int (pow2 + 1) / 2) is a sign extension of a @@ -4359,9 +4341,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) if (COMPARISON_P (XEXP (x, 0)) && ((STORE_FLAG_VALUE == -1 && XEXP (x, 1) == const1_rtx) || (STORE_FLAG_VALUE == 1 && XEXP (x, 1) == constm1_rtx)) - && (reversed = reversed_comparison (XEXP (x, 0), mode, - XEXP (XEXP (x, 0), 0), - XEXP (XEXP (x, 0), 1)))) + && (reversed = reversed_comparison (XEXP (x, 0), mode))) return simplify_gen_unary (NEG, mode, reversed, mode); @@ -4390,7 +4370,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) & nonzero_bits (XEXP (x, 1), mode)) == 0) { /* Try to simplify the expression further. */ - rtx tor = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); + rtx tor = simplify_gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); temp = combine_simplify_rtx (tor, mode, in_dest); /* If we could, great. If not, do not go ahead with the IOR @@ -4407,9 +4387,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) if (STORE_FLAG_VALUE == 1 && XEXP (x, 0) == const1_rtx && COMPARISON_P (XEXP (x, 1)) - && (reversed = reversed_comparison (XEXP (x, 1), mode, - XEXP (XEXP (x, 1), 0), - XEXP (XEXP (x, 1), 1)))) + && (reversed = reversed_comparison (XEXP (x, 1), mode))) return reversed; /* (minus (and (const_int -pow2))) becomes @@ -4430,8 +4408,10 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) in1 = XEXP (XEXP (XEXP (x, 1), 0), 0); in2 = XEXP (XEXP (x, 1), 1); - return gen_binary (PLUS, mode, gen_binary (MULT, mode, in1, in2), - XEXP (x, 0)); + return simplify_gen_binary (PLUS, mode, + simplify_gen_binary (MULT, mode, + in1, in2), + XEXP (x, 0)); } /* Canonicalize (minus (neg A) (mult B C)) to @@ -4443,17 +4423,20 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) in1 = simplify_gen_unary (NEG, mode, XEXP (XEXP (x, 1), 0), mode); in2 = XEXP (XEXP (x, 1), 1); - return gen_binary (MINUS, mode, gen_binary (MULT, mode, in1, in2), - XEXP (XEXP (x, 0), 0)); + return simplify_gen_binary (MINUS, mode, + simplify_gen_binary (MULT, mode, + in1, in2), + XEXP (XEXP (x, 0), 0)); } /* Canonicalize (minus A (plus B C)) to (minus (minus A B) C) for integers. */ if (GET_CODE (XEXP (x, 1)) == PLUS && INTEGRAL_MODE_P (mode)) - return gen_binary (MINUS, mode, - gen_binary (MINUS, mode, XEXP (x, 0), - XEXP (XEXP (x, 1), 0)), - XEXP (XEXP (x, 1), 1)); + return simplify_gen_binary (MINUS, mode, + simplify_gen_binary (MINUS, mode, + XEXP (x, 0), + XEXP (XEXP (x, 1), 0)), + XEXP (XEXP (x, 1), 1)); break; case MULT: @@ -4463,17 +4446,11 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) if (GET_CODE (XEXP (x, 0)) == PLUS) { - x = apply_distributive_law - (gen_binary (PLUS, mode, - gen_binary (MULT, mode, - XEXP (XEXP (x, 0), 0), XEXP (x, 1)), - gen_binary (MULT, mode, - XEXP (XEXP (x, 0), 1), - copy_rtx (XEXP (x, 1))))); - - if (GET_CODE (x) != MULT) - return x; + rtx result = distribute_and_simplify_rtx (x, 0); + if (result) + return result; } + /* Try simplify a*(b/c) as (a*b)/c. */ if (FLOAT_MODE_P (mode) && flag_unsafe_math_optimizations && GET_CODE (XEXP (x, 0)) == DIV) @@ -4482,7 +4459,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) XEXP (XEXP (x, 0), 0), XEXP (x, 1)); if (tem) - return gen_binary (DIV, mode, tem, XEXP (XEXP (x, 0), 1)); + return simplify_gen_binary (DIV, mode, tem, XEXP (XEXP (x, 0), 1)); } break; @@ -4562,9 +4539,9 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) && nonzero_bits (op0, mode) == 1) { op0 = expand_compound_operation (op0); - return gen_binary (XOR, mode, - gen_lowpart (mode, op0), - const1_rtx); + return simplify_gen_binary (XOR, mode, + gen_lowpart (mode, op0), + const1_rtx); } else if (STORE_FLAG_VALUE == 1 @@ -4765,7 +4742,7 @@ combine_simplify_rtx (rtx x, enum machine_mode op0_mode, int in_dest) if (GET_CODE (op0) == VEC_CONCAT) { HOST_WIDE_INT op0_size = GET_MODE_SIZE (GET_MODE (XEXP (op0, 0))); - if (op0_size < offset) + if (offset < op0_size) op0 = XEXP (op0, 0); else { @@ -4806,13 +4783,13 @@ simplify_if_then_else (rtx x) /* Simplify storing of the truth value. */ if (comparison_p && true_rtx == const_true_rtx && false_rtx == const0_rtx) - return gen_binary (true_code, mode, XEXP (cond, 0), XEXP (cond, 1)); + return simplify_gen_relational (true_code, mode, VOIDmode, + XEXP (cond, 0), XEXP (cond, 1)); /* Also when the truth value has to be reversed. */ if (comparison_p && true_rtx == const0_rtx && false_rtx == const_true_rtx - && (reversed = reversed_comparison (cond, mode, XEXP (cond, 0), - XEXP (cond, 1)))) + && (reversed = reversed_comparison (cond, mode))) return reversed; /* Sometimes we can simplify the arm of an IF_THEN_ELSE if a register used @@ -4820,7 +4797,7 @@ simplify_if_then_else (rtx x) comparisons and see if that says anything about the value of each arm. */ if (comparison_p - && ((false_code = combine_reversed_comparison_code (cond)) + && ((false_code = reversed_comparison_code (cond, NULL)) != UNKNOWN) && REG_P (XEXP (cond, 0))) { @@ -4878,7 +4855,7 @@ simplify_if_then_else (rtx x) the false arm is more complicated than the true arm. */ if (comparison_p - && combine_reversed_comparison_code (cond) != UNKNOWN + && reversed_comparison_code (cond, NULL) != UNKNOWN && (true_rtx == pc_rtx || (CONSTANT_P (true_rtx) && GET_CODE (false_rtx) != CONST_INT && false_rtx != pc_rtx) @@ -4890,10 +4867,7 @@ simplify_if_then_else (rtx x) || rtx_equal_p (false_rtx, XEXP (cond, 0)))) { true_code = reversed_comparison_code (cond, NULL); - SUBST (XEXP (x, 0), - reversed_comparison (cond, GET_MODE (cond), XEXP (cond, 0), - XEXP (cond, 1))); - + SUBST (XEXP (x, 0), reversed_comparison (cond, GET_MODE (cond))); SUBST (XEXP (x, 1), false_rtx); SUBST (XEXP (x, 2), true_rtx); @@ -4956,16 +4930,16 @@ simplify_if_then_else (rtx x) { case GE: case GT: - return gen_binary (SMAX, mode, true_rtx, false_rtx); + return simplify_gen_binary (SMAX, mode, true_rtx, false_rtx); case LE: case LT: - return gen_binary (SMIN, mode, true_rtx, false_rtx); + return simplify_gen_binary (SMIN, mode, true_rtx, false_rtx); case GEU: case GTU: - return gen_binary (UMAX, mode, true_rtx, false_rtx); + return simplify_gen_binary (UMAX, mode, true_rtx, false_rtx); case LEU: case LTU: - return gen_binary (UMIN, mode, true_rtx, false_rtx); + return simplify_gen_binary (UMIN, mode, true_rtx, false_rtx); default: break; } @@ -5078,12 +5052,14 @@ simplify_if_then_else (rtx x) if (z) { - temp = subst (gen_binary (true_code, m, cond_op0, cond_op1), + temp = subst (simplify_gen_relational (true_code, m, VOIDmode, + cond_op0, cond_op1), pc_rtx, pc_rtx, 0, 0); - temp = gen_binary (MULT, m, temp, - gen_binary (MULT, m, c1, const_true_rtx)); + temp = simplify_gen_binary (MULT, m, temp, + simplify_gen_binary (MULT, m, c1, + const_true_rtx)); temp = subst (temp, pc_rtx, pc_rtx, 0, 0); - temp = gen_binary (op, m, gen_lowpart (m, z), temp); + temp = simplify_gen_binary (op, m, gen_lowpart (m, z), temp); if (extend_op != UNKNOWN) temp = simplify_gen_unary (extend_op, mode, temp, m); @@ -5268,7 +5244,8 @@ simplify_set (rtx x) PUT_CODE (*cc_use, old_code); other_changed = 0; - op0 = gen_binary (XOR, GET_MODE (op0), op0, GEN_INT (mask)); + op0 = simplify_gen_binary (XOR, GET_MODE (op0), + op0, GEN_INT (mask)); } } } @@ -5432,18 +5409,19 @@ simplify_set (rtx x) && rtx_equal_p (XEXP (false_rtx, 1), true_rtx)) term1 = true_rtx, false_rtx = XEXP (false_rtx, 0), true_rtx = const0_rtx; - term2 = gen_binary (AND, GET_MODE (src), - XEXP (XEXP (src, 0), 0), true_rtx); - term3 = gen_binary (AND, GET_MODE (src), - simplify_gen_unary (NOT, GET_MODE (src), - XEXP (XEXP (src, 0), 0), - GET_MODE (src)), - false_rtx); + term2 = simplify_gen_binary (AND, GET_MODE (src), + XEXP (XEXP (src, 0), 0), true_rtx); + term3 = simplify_gen_binary (AND, GET_MODE (src), + simplify_gen_unary (NOT, GET_MODE (src), + XEXP (XEXP (src, 0), 0), + GET_MODE (src)), + false_rtx); SUBST (SET_SRC (x), - gen_binary (IOR, GET_MODE (src), - gen_binary (IOR, GET_MODE (src), term1, term2), - term3)); + simplify_gen_binary (IOR, GET_MODE (src), + simplify_gen_binary (IOR, GET_MODE (src), + term1, term2), + term3)); src = SET_SRC (x); } @@ -5478,29 +5456,31 @@ simplify_logical (rtx x) if (GET_CODE (op0) == XOR && rtx_equal_p (XEXP (op0, 0), op1) && ! side_effects_p (op1)) - x = gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 1), mode), - op1); + x = simplify_gen_binary (AND, mode, + simplify_gen_unary (NOT, mode, + XEXP (op0, 1), mode), + op1); if (GET_CODE (op0) == XOR && rtx_equal_p (XEXP (op0, 1), op1) && ! side_effects_p (op1)) - x = gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 0), mode), - op1); + x = simplify_gen_binary (AND, mode, + simplify_gen_unary (NOT, mode, + XEXP (op0, 0), mode), + op1); /* Similarly for (~(A ^ B)) & A. */ if (GET_CODE (op0) == NOT && GET_CODE (XEXP (op0, 0)) == XOR && rtx_equal_p (XEXP (XEXP (op0, 0), 0), op1) && ! side_effects_p (op1)) - x = gen_binary (AND, mode, XEXP (XEXP (op0, 0), 1), op1); + x = simplify_gen_binary (AND, mode, XEXP (XEXP (op0, 0), 1), op1); if (GET_CODE (op0) == NOT && GET_CODE (XEXP (op0, 0)) == XOR && rtx_equal_p (XEXP (XEXP (op0, 0), 1), op1) && ! side_effects_p (op1)) - x = gen_binary (AND, mode, XEXP (XEXP (op0, 0), 0), op1); + x = simplify_gen_binary (AND, mode, XEXP (XEXP (op0, 0), 0), op1); /* We can call simplify_and_const_int only if we don't lose any (sign) bits when converting INTVAL (op1) to @@ -5520,8 +5500,9 @@ simplify_logical (rtx x) && GET_CODE (XEXP (op0, 1)) == CONST_INT && GET_CODE (op1) == CONST_INT && (INTVAL (XEXP (op0, 1)) & INTVAL (op1)) != 0) - return gen_binary (IOR, mode, - gen_binary (AND, mode, XEXP (op0, 0), + return simplify_gen_binary (IOR, mode, + simplify_gen_binary + (AND, mode, XEXP (op0, 0), GEN_INT (INTVAL (XEXP (op0, 1)) & ~INTVAL (op1))), op1); @@ -5540,54 +5521,21 @@ simplify_logical (rtx x) && ! side_effects_p (XEXP (op0, 1))) return op1; - /* In the following group of tests (and those in case IOR below), - we start with some combination of logical operations and apply - the distributive law followed by the inverse distributive law. - Most of the time, this results in no change. However, if some of - the operands are the same or inverses of each other, simplifications - will result. - - For example, (and (ior A B) (not B)) can occur as the result of - expanding a bit field assignment. When we apply the distributive - law to this, we get (ior (and (A (not B))) (and (B (not B)))), - which then simplifies to (and (A (not B))). - - If we have (and (ior A B) C), apply the distributive law and then - the inverse distributive law to see if things simplify. */ - + /* If we have any of (and (ior A B) C) or (and (xor A B) C), + apply the distributive law and then the inverse distributive + law to see if things simplify. */ if (GET_CODE (op0) == IOR || GET_CODE (op0) == XOR) { - x = apply_distributive_law - (gen_binary (GET_CODE (op0), mode, - gen_binary (AND, mode, XEXP (op0, 0), op1), - gen_binary (AND, mode, XEXP (op0, 1), - copy_rtx (op1)))); - if (GET_CODE (x) != AND) - return x; + rtx result = distribute_and_simplify_rtx (x, 0); + if (result) + return result; } - if (GET_CODE (op1) == IOR || GET_CODE (op1) == XOR) - return apply_distributive_law - (gen_binary (GET_CODE (op1), mode, - gen_binary (AND, mode, XEXP (op1, 0), op0), - gen_binary (AND, mode, XEXP (op1, 1), - copy_rtx (op0)))); - - /* Similarly, taking advantage of the fact that - (and (not A) (xor B C)) == (xor (ior A B) (ior A C)) */ - - if (GET_CODE (op0) == NOT && GET_CODE (op1) == XOR) - return apply_distributive_law - (gen_binary (XOR, mode, - gen_binary (IOR, mode, XEXP (op0, 0), XEXP (op1, 0)), - gen_binary (IOR, mode, copy_rtx (XEXP (op0, 0)), - XEXP (op1, 1)))); - - else if (GET_CODE (op1) == NOT && GET_CODE (op0) == XOR) - return apply_distributive_law - (gen_binary (XOR, mode, - gen_binary (IOR, mode, XEXP (op1, 0), XEXP (op0, 0)), - gen_binary (IOR, mode, copy_rtx (XEXP (op1, 0)), XEXP (op0, 1)))); + { + rtx result = distribute_and_simplify_rtx (x, 1); + if (result) + return result; + } break; case IOR: @@ -5610,28 +5558,16 @@ simplify_logical (rtx x) if (GET_CODE (op0) == AND) { - rtx tmp = apply_distributive_law - (gen_binary (AND, mode, - gen_binary (IOR, mode, XEXP (op0, 0), op1), - gen_binary (IOR, mode, XEXP (op0, 1), - copy_rtx (op1)))); - - if (GET_CODE (tmp) != IOR - && rtx_cost (tmp, SET) < rtx_cost (x, SET)) - return tmp; + rtx result = distribute_and_simplify_rtx (x, 0); + if (result) + return result; } if (GET_CODE (op1) == AND) { - rtx tmp = apply_distributive_law - (gen_binary (AND, mode, - gen_binary (IOR, mode, XEXP (op1, 0), op0), - gen_binary (IOR, mode, XEXP (op1, 1), - copy_rtx (op0)))); - - if (GET_CODE (tmp) != IOR - && rtx_cost (tmp, SET) < rtx_cost (x, SET)) - return tmp; + rtx result = distribute_and_simplify_rtx (x, 1); + if (result) + return result; } /* Convert (ior (ashift A CX) (lshiftrt A CY)) where CX+CY equals the @@ -5680,7 +5616,7 @@ simplify_logical (rtx x) if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && (nonzero_bits (op0, mode) & nonzero_bits (op1, mode)) == 0) - return (gen_binary (IOR, mode, op0, op1)); + return (simplify_gen_binary (IOR, mode, op0, op1)); /* Convert (XOR (NOT x) (NOT y)) to (XOR x y). Also convert (XOR (NOT x) y) to (NOT (XOR x y)), similarly for @@ -5700,7 +5636,8 @@ simplify_logical (rtx x) } else if (num_negated == 1) return - simplify_gen_unary (NOT, mode, gen_binary (XOR, mode, op0, op1), + simplify_gen_unary (NOT, mode, + simplify_gen_binary (XOR, mode, op0, op1), mode); } @@ -5711,24 +5648,25 @@ simplify_logical (rtx x) if (GET_CODE (op0) == AND && rtx_equal_p (XEXP (op0, 1), op1) && ! side_effects_p (op1)) - return gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 0), mode), - op1); + return simplify_gen_binary (AND, mode, + simplify_gen_unary (NOT, mode, + XEXP (op0, 0), mode), + op1); else if (GET_CODE (op0) == AND && rtx_equal_p (XEXP (op0, 0), op1) && ! side_effects_p (op1)) - return gen_binary (AND, mode, - simplify_gen_unary (NOT, mode, XEXP (op0, 1), mode), - op1); + return simplify_gen_binary (AND, mode, + simplify_gen_unary (NOT, mode, + XEXP (op0, 1), mode), + op1); /* (xor (comparison foo bar) (const_int 1)) can become the reversed comparison if STORE_FLAG_VALUE is 1. */ if (STORE_FLAG_VALUE == 1 && op1 == const1_rtx && COMPARISON_P (op0) - && (reversed = reversed_comparison (op0, mode, XEXP (op0, 0), - XEXP (op0, 1)))) + && (reversed = reversed_comparison (op0, mode))) return reversed; /* (lshiftrt foo C) where C is the number of bits in FOO minus 1 @@ -5749,8 +5687,7 @@ simplify_logical (rtx x) == (unsigned HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (mode) - 1)) && op1 == const_true_rtx && COMPARISON_P (op0) - && (reversed = reversed_comparison (op0, mode, XEXP (op0, 0), - XEXP (op0, 1)))) + && (reversed = reversed_comparison (op0, mode))) return reversed; break; @@ -5992,7 +5929,7 @@ expand_field_assignment (rtx x) rtx inner; rtx pos; /* Always counts from low bit. */ int len; - rtx mask; + rtx mask, cleared, masked; enum machine_mode compute_mode; /* Loop until we find something we can't simplify. */ @@ -6030,10 +5967,11 @@ expand_field_assignment (rtx x) /* If position is ADJUST - X, new position is X. */ pos = XEXP (pos, 0); else - pos = gen_binary (MINUS, GET_MODE (pos), - GEN_INT (GET_MODE_BITSIZE (GET_MODE (inner)) - - len), - pos); + pos = simplify_gen_binary (MINUS, GET_MODE (pos), + GEN_INT (GET_MODE_BITSIZE ( + GET_MODE (inner)) + - len), + pos); } } @@ -6080,30 +6018,30 @@ expand_field_assignment (rtx x) } /* Compute a mask of LEN bits, if we can do this on the host machine. */ - if (len < HOST_BITS_PER_WIDE_INT) - mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1); - else + if (len >= HOST_BITS_PER_WIDE_INT) break; /* Now compute the equivalent expression. Make a copy of INNER for the SET_DEST in case it is a MEM into which we will substitute; we don't want shared RTL in that case. */ - x = gen_rtx_SET - (VOIDmode, copy_rtx (inner), - gen_binary (IOR, compute_mode, - gen_binary (AND, compute_mode, - simplify_gen_unary (NOT, compute_mode, - gen_binary (ASHIFT, - compute_mode, - mask, pos), - compute_mode), - inner), - gen_binary (ASHIFT, compute_mode, - gen_binary (AND, compute_mode, - gen_lowpart - (compute_mode, SET_SRC (x)), - mask), - pos))); + mask = GEN_INT (((HOST_WIDE_INT) 1 << len) - 1); + cleared = simplify_gen_binary (AND, compute_mode, + simplify_gen_unary (NOT, compute_mode, + simplify_gen_binary (ASHIFT, + compute_mode, + mask, pos), + compute_mode), + inner); + masked = simplify_gen_binary (ASHIFT, compute_mode, + simplify_gen_binary ( + AND, compute_mode, + gen_lowpart (compute_mode, SET_SRC (x)), + mask), + pos); + + x = gen_rtx_SET (VOIDmode, copy_rtx (inner), + simplify_gen_binary (IOR, compute_mode, + cleared, masked)); } return x; @@ -6559,8 +6497,8 @@ extract_left_shift (rtx x, int count) if (GET_CODE (XEXP (x, 1)) == CONST_INT && (INTVAL (XEXP (x, 1)) & ((((HOST_WIDE_INT) 1 << count)) - 1)) == 0 && (tem = extract_left_shift (XEXP (x, 0), count)) != 0) - return gen_binary (code, mode, tem, - GEN_INT (INTVAL (XEXP (x, 1)) >> count)); + return simplify_gen_binary (code, mode, tem, + GEN_INT (INTVAL (XEXP (x, 1)) >> count)); break; @@ -7046,7 +6984,8 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, && (cval & ((HOST_WIDE_INT) 1 << (width - 1))) != 0) cval |= (HOST_WIDE_INT) -1 << width; - y = gen_binary (AND, GET_MODE (x), XEXP (x, 0), GEN_INT (cval)); + y = simplify_gen_binary (AND, GET_MODE (x), + XEXP (x, 0), GEN_INT (cval)); if (rtx_cost (y, SET) < rtx_cost (x, SET)) x = y; } @@ -7138,10 +7077,10 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, { temp = GEN_INT ((INTVAL (XEXP (x, 1)) & mask) << INTVAL (XEXP (XEXP (x, 0), 1))); - temp = gen_binary (GET_CODE (x), GET_MODE (x), - XEXP (XEXP (x, 0), 0), temp); - x = gen_binary (LSHIFTRT, GET_MODE (x), temp, - XEXP (XEXP (x, 0), 1)); + temp = simplify_gen_binary (GET_CODE (x), GET_MODE (x), + XEXP (XEXP (x, 0), 0), temp); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), temp, + XEXP (XEXP (x, 0), 1)); return force_to_mode (x, mode, mask, reg, next_select); } @@ -7157,7 +7096,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, reg, next_select)); if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0) || op1 != XEXP (x, 1)) - x = gen_binary (code, op_mode, op0, op1); + x = simplify_gen_binary (code, op_mode, op0, op1); break; case ASHIFT: @@ -7191,7 +7130,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, mask, reg, next_select)); if (op_mode != GET_MODE (x) || op0 != XEXP (x, 0)) - x = gen_binary (code, op_mode, op0, XEXP (x, 1)); + x = simplify_gen_binary (code, op_mode, op0, XEXP (x, 1)); break; case LSHIFTRT: @@ -7218,7 +7157,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, inner = force_to_mode (inner, op_mode, inner_mask, reg, next_select); if (GET_MODE (x) != op_mode || inner != XEXP (x, 0)) - x = gen_binary (LSHIFTRT, op_mode, inner, XEXP (x, 1)); + x = simplify_gen_binary (LSHIFTRT, op_mode, inner, XEXP (x, 1)); } /* If we have (and (lshiftrt FOO C1) C2) where the combination of the @@ -7240,9 +7179,9 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, /* Must be more sign bit copies than the mask needs. */ && ((int) num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0))) >= exact_log2 (mask + 1))) - x = gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), - GEN_INT (GET_MODE_BITSIZE (GET_MODE (x)) - - exact_log2 (mask + 1))); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), + GEN_INT (GET_MODE_BITSIZE (GET_MODE (x)) + - exact_log2 (mask + 1))); goto shiftrt; @@ -7307,7 +7246,8 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, /* If MASK is 1, convert this to an LSHIFTRT. This can be done even if the shift count isn't a constant. */ if (mask == 1) - x = gen_binary (LSHIFTRT, GET_MODE (x), XEXP (x, 0), XEXP (x, 1)); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), + XEXP (x, 0), XEXP (x, 1)); shiftrt: @@ -7372,8 +7312,10 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, { temp = gen_int_mode (mask << INTVAL (XEXP (XEXP (x, 0), 1)), GET_MODE (x)); - temp = gen_binary (XOR, GET_MODE (x), XEXP (XEXP (x, 0), 0), temp); - x = gen_binary (LSHIFTRT, GET_MODE (x), temp, XEXP (XEXP (x, 0), 1)); + temp = simplify_gen_binary (XOR, GET_MODE (x), + XEXP (XEXP (x, 0), 0), temp); + x = simplify_gen_binary (LSHIFTRT, GET_MODE (x), + temp, XEXP (XEXP (x, 0), 1)); return force_to_mode (x, mode, mask, reg, next_select); } @@ -7484,8 +7426,19 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) else if (cond1 == 0) true1 = copy_rtx (true1); - *ptrue = gen_binary (code, mode, true0, true1); - *pfalse = gen_binary (code, mode, false0, false1); + if (COMPARISON_P (x)) + { + *ptrue = simplify_gen_relational (code, mode, VOIDmode, + true0, true1); + *pfalse = simplify_gen_relational (code, mode, VOIDmode, + false0, false1); + } + else + { + *ptrue = simplify_gen_binary (code, mode, true0, true1); + *pfalse = simplify_gen_binary (code, mode, false0, false1); + } + return cond0 ? cond0 : cond1; } @@ -7506,22 +7459,22 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) if (COMPARISON_P (cond0) && COMPARISON_P (cond1) - && ((GET_CODE (cond0) == combine_reversed_comparison_code (cond1) + && ((GET_CODE (cond0) == reversed_comparison_code (cond1, NULL) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1))) || ((swap_condition (GET_CODE (cond0)) - == combine_reversed_comparison_code (cond1)) + == reversed_comparison_code (cond1, NULL)) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 1)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 0)))) && ! side_effects_p (x)) { - *ptrue = gen_binary (MULT, mode, op0, const_true_rtx); - *pfalse = gen_binary (MULT, mode, - (code == MINUS - ? simplify_gen_unary (NEG, mode, op1, - mode) - : op1), - const_true_rtx); + *ptrue = simplify_gen_binary (MULT, mode, op0, const_true_rtx); + *pfalse = simplify_gen_binary (MULT, mode, + (code == MINUS + ? simplify_gen_unary (NEG, mode, + op1, mode) + : op1), + const_true_rtx); return cond0; } } @@ -7537,11 +7490,11 @@ if_then_else_cond (rtx x, rtx *ptrue, rtx *pfalse) if (COMPARISON_P (cond0) && COMPARISON_P (cond1) - && ((GET_CODE (cond0) == combine_reversed_comparison_code (cond1) + && ((GET_CODE (cond0) == reversed_comparison_code (cond1, NULL) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 0)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 1))) || ((swap_condition (GET_CODE (cond0)) - == combine_reversed_comparison_code (cond1)) + == reversed_comparison_code (cond1, NULL)) && rtx_equal_p (XEXP (cond0, 0), XEXP (cond1, 1)) && rtx_equal_p (XEXP (cond0, 1), XEXP (cond1, 0)))) && ! side_effects_p (x)) @@ -7686,7 +7639,7 @@ known_cond (rtx x, enum rtx_code cond, rtx reg, rtx val) if (comparison_dominates_p (cond, code)) return const_true_rtx; - code = combine_reversed_comparison_code (x); + code = reversed_comparison_code (x, NULL); if (code != UNKNOWN && comparison_dominates_p (cond, code)) return const0_rtx; @@ -8056,8 +8009,8 @@ apply_distributive_law (rtx x) || GET_MODE_SIZE (GET_MODE (SUBREG_REG (lhs))) > UNITS_PER_WORD) return x; - tem = gen_binary (code, GET_MODE (SUBREG_REG (lhs)), - SUBREG_REG (lhs), SUBREG_REG (rhs)); + tem = simplify_gen_binary (code, GET_MODE (SUBREG_REG (lhs)), + SUBREG_REG (lhs), SUBREG_REG (rhs)); return gen_lowpart (GET_MODE (x), tem); default: @@ -8083,7 +8036,7 @@ apply_distributive_law (rtx x) return x; /* Form the new inner operation, seeing if it simplifies first. */ - tem = gen_binary (code, GET_MODE (x), lhs, rhs); + tem = simplify_gen_binary (code, GET_MODE (x), lhs, rhs); /* There is one exception to the general way of distributing: (a | c) ^ (b | c) -> (a ^ b) & ~c */ @@ -8096,8 +8049,76 @@ apply_distributive_law (rtx x) /* We may be able to continuing distributing the result, so call ourselves recursively on the inner operation before forming the outer operation, which we return. */ - return gen_binary (inner_code, GET_MODE (x), - apply_distributive_law (tem), other); + return simplify_gen_binary (inner_code, GET_MODE (x), + apply_distributive_law (tem), other); +} + +/* See if X is of the form (* (+ A B) C), and if so convert to + (+ (* A C) (* B C)) and try to simplify. + + Most of the time, this results in no change. However, if some of + the operands are the same or inverses of each other, simplifications + will result. + + For example, (and (ior A B) (not B)) can occur as the result of + expanding a bit field assignment. When we apply the distributive + law to this, we get (ior (and (A (not B))) (and (B (not B)))), + which then simplifies to (and (A (not B))). + + Note that no checks happen on the validity of applying the inverse + distributive law. This is pointless since we can do it in the + few places where this routine is called. + + N is the index of the term that is decomposed (the arithmetic operation, + i.e. (+ A B) in the first example above). !N is the index of the term that + is distributed, i.e. of C in the first example above. */ +static rtx +distribute_and_simplify_rtx (rtx x, int n) +{ + enum machine_mode mode; + enum rtx_code outer_code, inner_code; + rtx decomposed, distributed, inner_op0, inner_op1, new_op0, new_op1, tmp; + + decomposed = XEXP (x, n); + if (!ARITHMETIC_P (decomposed)) + return NULL_RTX; + + mode = GET_MODE (x); + outer_code = GET_CODE (x); + distributed = XEXP (x, !n); + + inner_code = GET_CODE (decomposed); + inner_op0 = XEXP (decomposed, 0); + inner_op1 = XEXP (decomposed, 1); + + /* Special case (and (xor B C) (not A)), which is equivalent to + (xor (ior A B) (ior A C)) */ + if (outer_code == AND && inner_code == XOR && GET_CODE (distributed) == NOT) + { + distributed = XEXP (distributed, 0); + outer_code = IOR; + } + + if (n == 0) + { + /* Distribute the second term. */ + new_op0 = simplify_gen_binary (outer_code, mode, inner_op0, distributed); + new_op1 = simplify_gen_binary (outer_code, mode, inner_op1, distributed); + } + else + { + /* Distribute the first term. */ + new_op0 = simplify_gen_binary (outer_code, mode, distributed, inner_op0); + new_op1 = simplify_gen_binary (outer_code, mode, distributed, inner_op1); + } + + tmp = apply_distributive_law (simplify_gen_binary (inner_code, mode, + new_op0, new_op1)); + if (GET_CODE (tmp) != outer_code + && rtx_cost (tmp, SET) < rtx_cost (x, SET)) + return tmp; + + return NULL_RTX; } /* We have X, a logical `and' of VAROP with the constant CONSTOP, to be done @@ -8164,11 +8185,15 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, gen_lowpart (mode, apply_distributive_law - (gen_binary (GET_CODE (varop), GET_MODE (varop), - simplify_and_const_int (NULL_RTX, GET_MODE (varop), - XEXP (varop, 0), constop), - simplify_and_const_int (NULL_RTX, GET_MODE (varop), - XEXP (varop, 1), constop)))); + (simplify_gen_binary (GET_CODE (varop), GET_MODE (varop), + simplify_and_const_int (NULL_RTX, + GET_MODE (varop), + XEXP (varop, 0), + constop), + simplify_and_const_int (NULL_RTX, + GET_MODE (varop), + XEXP (varop, 1), + constop)))); /* If VAROP is PLUS, and the constant is a mask of low bite, distribute the AND and see if one of the operands simplifies to zero. If so, we @@ -8209,7 +8234,7 @@ simplify_and_const_int (rtx x, enum machine_mode mode, rtx varop, constop = trunc_int_for_mode (constop, mode); /* See how much, if any, of X we can use. */ if (x == 0 || GET_CODE (x) != AND || GET_MODE (x) != mode) - x = gen_binary (AND, mode, varop, GEN_INT (constop)); + x = simplify_gen_binary (AND, mode, varop, GEN_INT (constop)); else { @@ -8728,8 +8753,10 @@ simplify_shift_const (rtx x, enum rtx_code code, && exact_log2 (INTVAL (XEXP (varop, 1))) >= 0) { varop - = gen_binary (ASHIFT, GET_MODE (varop), XEXP (varop, 0), - GEN_INT (exact_log2 (INTVAL (XEXP (varop, 1))))); + = simplify_gen_binary (ASHIFT, GET_MODE (varop), + XEXP (varop, 0), + GEN_INT (exact_log2 ( + INTVAL (XEXP (varop, 1))))); continue; } break; @@ -8740,8 +8767,10 @@ simplify_shift_const (rtx x, enum rtx_code code, && exact_log2 (INTVAL (XEXP (varop, 1))) >= 0) { varop - = gen_binary (LSHIFTRT, GET_MODE (varop), XEXP (varop, 0), - GEN_INT (exact_log2 (INTVAL (XEXP (varop, 1))))); + = simplify_gen_binary (LSHIFTRT, GET_MODE (varop), + XEXP (varop, 0), + GEN_INT (exact_log2 ( + INTVAL (XEXP (varop, 1))))); continue; } break; @@ -8996,7 +9025,8 @@ simplify_shift_const (rtx x, enum rtx_code code, rtx rhs = simplify_shift_const (NULL_RTX, code, shift_mode, XEXP (varop, 1), count); - varop = gen_binary (GET_CODE (varop), shift_mode, lhs, rhs); + varop = simplify_gen_binary (GET_CODE (varop), shift_mode, + lhs, rhs); varop = apply_distributive_law (varop); count = 0; @@ -9271,7 +9301,8 @@ simplify_shift_const (rtx x, enum rtx_code code, else if (GET_RTX_CLASS (outer_op) == RTX_UNARY) x = simplify_gen_unary (outer_op, result_mode, x, result_mode); else - x = gen_binary (outer_op, result_mode, x, GEN_INT (outer_const)); + x = simplify_gen_binary (outer_op, result_mode, x, + GEN_INT (outer_const)); } return x; @@ -9506,63 +9537,6 @@ gen_lowpart_for_combine (enum machine_mode omode, rtx x) return gen_rtx_CLOBBER (imode, const0_rtx); } -/* These routines make binary and unary operations by first seeing if they - fold; if not, a new expression is allocated. */ - -static rtx -gen_binary (enum rtx_code code, enum machine_mode mode, rtx op0, rtx op1) -{ - rtx result; - rtx tem; - - if (GET_CODE (op0) == CLOBBER) - return op0; - else if (GET_CODE (op1) == CLOBBER) - return op1; - - if (GET_RTX_CLASS (code) == RTX_COMM_ARITH - && swap_commutative_operands_p (op0, op1)) - tem = op0, op0 = op1, op1 = tem; - - if (GET_RTX_CLASS (code) == RTX_COMPARE - || GET_RTX_CLASS (code) == RTX_COMM_COMPARE) - { - enum machine_mode op_mode = GET_MODE (op0); - - /* Strip the COMPARE from (REL_OP (compare X Y) 0) to get - just (REL_OP X Y). */ - if (GET_CODE (op0) == COMPARE && op1 == const0_rtx) - { - op1 = XEXP (op0, 1); - op0 = XEXP (op0, 0); - op_mode = GET_MODE (op0); - } - - if (op_mode == VOIDmode) - op_mode = GET_MODE (op1); - result = simplify_relational_operation (code, mode, op_mode, op0, op1); - } - else - result = simplify_binary_operation (code, mode, op0, op1); - - if (result) - return result; - - /* Put complex operands first and constants second. */ - if (GET_RTX_CLASS (code) == RTX_COMM_ARITH - && swap_commutative_operands_p (op0, op1)) - return gen_rtx_fmt_ee (code, mode, op1, op0); - - /* If we are turning off bits already known off in OP0, we need not do - an AND. */ - else if (code == AND && GET_CODE (op1) == CONST_INT - && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT - && (nonzero_bits (op0, mode) & ~INTVAL (op1)) == 0) - return op0; - - return gen_rtx_fmt_ee (code, mode, op0, op1); -} - /* Simplify a comparison between *POP0 and *POP1 where CODE is the comparison code that will be tested. @@ -10304,7 +10278,7 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) if (code == LT || code == NE) new_code = GET_CODE (op0); else - new_code = combine_reversed_comparison_code (op0); + new_code = reversed_comparison_code (op0, NULL); if (new_code != UNKNOWN) { @@ -10431,9 +10405,9 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) && c1 != mask && c1 != GET_MODE_MASK (tmode)) { - op0 = gen_binary (AND, tmode, - SUBREG_REG (XEXP (op0, 0)), - gen_int_mode (c1, tmode)); + op0 = simplify_gen_binary (AND, tmode, + SUBREG_REG (XEXP (op0, 0)), + gen_int_mode (c1, tmode)); op0 = gen_lowpart (mode, op0); continue; } @@ -10577,12 +10551,12 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) { rtx inner = XEXP (XEXP (XEXP (op0, 0), 0), 0); rtx add_const = XEXP (XEXP (op0, 0), 1); - rtx new_const = gen_binary (ASHIFTRT, GET_MODE (op0), add_const, - XEXP (op0, 1)); + rtx new_const = simplify_gen_binary (ASHIFTRT, GET_MODE (op0), + add_const, XEXP (op0, 1)); - op0 = gen_binary (PLUS, tmode, - gen_lowpart (tmode, inner), - new_const); + op0 = simplify_gen_binary (PLUS, tmode, + gen_lowpart (tmode, inner), + new_const); continue; } @@ -10735,11 +10709,11 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) make a new AND in the proper mode. */ if (GET_CODE (op0) == AND && !have_insn_for (AND, mode)) - op0 = gen_binary (AND, tmode, - gen_lowpart (tmode, - XEXP (op0, 0)), - gen_lowpart (tmode, - XEXP (op0, 1))); + op0 = simplify_gen_binary (AND, tmode, + gen_lowpart (tmode, + XEXP (op0, 0)), + gen_lowpart (tmode, + XEXP (op0, 1))); op0 = gen_lowpart (tmode, op0); if (zero_extended && GET_CODE (op1) == CONST_INT) @@ -10754,10 +10728,11 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) if (op1 == const0_rtx && (code == LT || code == GE) && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) { - op0 = gen_binary (AND, tmode, - gen_lowpart (tmode, op0), - GEN_INT ((HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (mode) - 1))); + op0 = simplify_gen_binary (AND, tmode, + gen_lowpart (tmode, op0), + GEN_INT ((HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (mode) + - 1))); code = (code == LT) ? NE : EQ; break; } @@ -10775,38 +10750,6 @@ simplify_comparison (enum rtx_code code, rtx *pop0, rtx *pop1) return code; } -/* Like jump.c' reversed_comparison_code, but use combine infrastructure for - searching backward. */ -static enum rtx_code -combine_reversed_comparison_code (rtx exp) -{ - enum rtx_code code1 = reversed_comparison_code (exp, NULL); - rtx x; - - if (code1 != UNKNOWN - || GET_MODE_CLASS (GET_MODE (XEXP (exp, 0))) != MODE_CC) - return code1; - /* Otherwise try and find where the condition codes were last set and - use that. */ - x = get_last_value (XEXP (exp, 0)); - if (!x || GET_CODE (x) != COMPARE) - return UNKNOWN; - return reversed_comparison_code_parts (GET_CODE (exp), - XEXP (x, 0), XEXP (x, 1), NULL); -} - -/* Return comparison with reversed code of EXP and operands OP0 and OP1. - Return NULL_RTX in case we fail to do the reversal. */ -static rtx -reversed_comparison (rtx exp, enum machine_mode mode, rtx op0, rtx op1) -{ - enum rtx_code reversed_code = combine_reversed_comparison_code (exp); - if (reversed_code == UNKNOWN) - return NULL_RTX; - else - return gen_binary (reversed_code, mode, op0, op1); -} - /* Utility function for record_value_for_reg. Count number of rtxs in X. */ static int diff --git a/gcc/common.opt b/gcc/common.opt index d4cd60cd12d..ab0129fb328 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -19,7 +19,7 @@ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA ; 02111-1307, USA. -; See c.opt for a description of this file's format. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -336,6 +336,10 @@ fdiagnostics-show-location= Common Joined RejectNegative -fdiagnostics-show-location=[once|every-line] How often to emit source location at the beginning of line-wrapped diagnostics +fdiagnostics-show-option +Common +Amend appropriate diagnostic messages with the command line option that controls them. + fdump- Common Joined RejectNegative -fdump- Dump various compiler internals to a file @@ -714,7 +718,7 @@ Allow premature scheduling of queued insns fsched-stalled-insns= Common RejectNegative Joined UInteger --fsched-stalled-insns= Set number of queued insns that can be prematurely scheduled +-fsched-stalled-insns= Set number of queued insns that can be prematurely scheduled ; sched_stalled_insns_dep controls how many recently scheduled cycles will ; be examined for a dependency on a stalled insn that is candidate for @@ -726,12 +730,16 @@ Set dependence distance checking in premature scheduling of queued insns fsched-stalled-insns-dep= Common RejectNegative Joined UInteger --fsched-stalled-insns-dep= Set dependence distance checking in premature scheduling of queued insns +-fsched-stalled-insns-dep= Set dependence distance checking in premature scheduling of queued insns fshared-data Common Report Var(flag_shared_data) Mark data as shared rather than private +fshow-column +Common C ObjC C++ ObjC++ Report Var(flag_show_column) Init(1) +Show column numbers in diagnostics, when available. Default on. + fsignaling-nans Common Report Var(flag_signaling_nans) Disable optimizations observable by IEEE signaling NaNs @@ -824,6 +832,10 @@ ftree-ccp Common Report Var(flag_tree_ccp) Enable SSA-CCP optimization on trees +ftree-store-ccp +Common Report Var(flag_tree_store_ccp) +Enable SSA-CCP optimization for stores and loads + ftree-ch Common Report Var(flag_tree_ch) Enable loop header copying on trees @@ -836,6 +848,14 @@ ftree-copyrename Common Report Var(flag_tree_copyrename) Replace SSA temporaries with better names in copies. +ftree-copy-prop +Common Report Var(flag_tree_copy_prop) +Enable copy propagation on trees + +ftree-store-copy-prop +Common Report Var(flag_tree_store_copy_prop) +Enable copy propagation for stores and loads + ftree-dce Common Report Var(flag_tree_dce) Enable SSA dead code elimination optimization on trees @@ -892,6 +912,10 @@ ftree-lrs Common Report Var(flag_tree_live_range_split) Perform live range splitting during the SSA->normal pass. +ftree-vrp +Common Report Var(flag_tree_vrp) Init(0) +Perform Value Range Propagation on trees + funit-at-a-time Common Report Var(flag_unit_at_a_time) Compile whole compilation unit at a time @@ -930,7 +954,7 @@ Enable loop vectorization on trees ftree-vectorizer-verbose= Common RejectNegative Joined --ftree-vectorizer-verbose= Set the verbosity level of the vectorizer +-ftree-vectorizer-verbose= Set the verbosity level of the vectorizer ; -fverbose-asm causes extra commentary information to be produced in ; the generated assembly code (to make it more readable). This option diff --git a/gcc/config.gcc b/gcc/config.gcc index 575ced2706f..ea3a49c871c 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -184,10 +184,13 @@ md_file= # Obsolete configurations. case ${target} in - sparclite-*-coff* \ - | sparclite-*-elf* \ - | sparc86x-*-elf* \ - | sparc-*-openbsd* \ + sparc-*-openbsd* \ + | i860-*-sysv4* \ + | ip2k-*-elf \ + | ns32k-*-netbsdelf* \ + | ns32k-*-netbsd* \ + | c4x-* \ + | tic4x-* \ ) if test "x$enable_obsolete" != xyes; then echo "*** Configuration ${target} is obsolete." >&2 @@ -231,6 +234,7 @@ esac # machines. tm_p_file= cpu_type=`echo ${target} | sed 's/-.*$//'` +cpu_is_64bit= case ${target} in alpha*-*-*) cpu_type=alpha @@ -246,6 +250,9 @@ arm*-*-*) cpu_type=arm extra_headers="mmintrin.h" ;; +bfin*-*) + cpu_type=bfin + ;; ep9312*-*-*) cpu_type=arm ;; @@ -287,6 +294,11 @@ powerpc*-*-*) cpu_type=rs6000 extra_headers="ppc-asm.h altivec.h spe.h" need_64bit_hwint=yes + case x$with_cpu in + xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345]|xrs64a) + cpu_is_64bit=yes + ;; + esac ;; rs6000*-*-*) need_64bit_hwint=yes @@ -299,6 +311,7 @@ sparc*-*-*) cpu_type=sparc ;; s390*-*-*) + cpu_type=s390 need_64bit_hwint=yes ;; # Note the 'l'; we need to be able to match e.g. "shle" or "shl". @@ -352,6 +365,7 @@ case ${target} in tm_p_file="${tm_p_file} darwin-protos.h" tmake_file="t-darwin t-slibgcc-darwin" target_gtfiles="\$(srcdir)/config/darwin.c" + extra_options="${extra_options} darwin.opt" c_target_objs="darwin-c.o" cxx_target_objs="darwin-c.o" extra_parts="crt2.o" @@ -592,15 +606,15 @@ alpha*-dec-osf[45]*) extra_headers=va_list.h case ${target} in *-*-osf4*) - # Set target_cpu_default except on 4.0a. + # Define TARGET_SUPPORT_ARCH except on 4.0a. case ${target} in *-*-osf4.0a) ;; - *) target_cpu_default=MASK_SUPPORT_ARCH + *) tm_defines="TARGET_SUPPORT_ARCH=1" esac ;; *-*-osf5*) tm_file="${tm_file} alpha/osf5.h" - target_cpu_default=MASK_SUPPORT_ARCH + tm_defines="TARGET_SUPPORT_ARCH=1" ;; esac case ${enable_threads} in @@ -701,11 +715,13 @@ arm*-*-elf | ep9312-*-elf) arm*-wince-pe*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h arm/wince-pe.h" tmake_file="arm/t-arm arm/t-wince-pe" + extra_options="${extra_options} arm/pe.opt" extra_objs="pe.o" ;; arm-*-pe*) tm_file="arm/semi.h arm/aout.h arm/arm.h arm/coff.h dbxcoff.h arm/pe.h" tmake_file="arm/t-arm arm/t-pe" + extra_options="${extra_options} arm/pe.opt" extra_objs="pe.o" ;; arm*-*-kaos*) @@ -720,6 +736,16 @@ avr-*-*) tm_file="avr/avr.h dbxelf.h" use_fixproto=yes ;; +bfin*-elf*) + tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h" + tmake_file=bfin/t-bfin-elf + use_collect2=no + ;; +bfin*-*) + tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h" + tmake_file=bfin/t-bfin + use_collect2=no + ;; c4x-*-rtems* | tic4x-*-rtems*) tmake_file="c4x/t-c4x t-rtems c4x/t-rtems" tm_file="c4x/c4x.h c4x/rtems.h rtems.h" @@ -735,16 +761,19 @@ cris-*-aout) tm_file="dbxelf.h ${tm_file} cris/aout.h" gas=yes tmake_file="cris/t-cris cris/t-aout" + extra_options="${extra_options} cris/aout.opt" ;; cris-*-elf | cris-*-none) tm_file="dbxelf.h elfos.h ${tm_file}" tmake_file="cris/t-cris cris/t-elfmulti" gas=yes + extra_options="${extra_options} cris/elf.opt" ;; cris-*-linux*) tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h" # We need to avoid using t-linux, so override default tmake_file tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux" + extra_options="${extra_options} cris/linux.opt" ;; fr30-*-elf) tm_file="dbxelf.h elfos.h svr4.h ${tm_file}" @@ -762,10 +791,14 @@ frv-*-*linux*) linux.h frv/linux.h frv/frv-abi.h" tmake_file="${tmake_file} frv/t-frv frv/t-linux" ;; -h8300-*-rtems*) +h8300-*-rtemscoff*) tmake_file="h8300/t-h8300 t-rtems h8300/t-rtems" tm_file="h8300/h8300.h dbxcoff.h h8300/coff.h h8300/rtems.h rtems.h" ;; +h8300-*-rtems*) + tmake_file="h8300/t-h8300 h8300/t-elf t-rtems h8300/t-rtems" + tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h" + ;; h8300-*-elf*) tmake_file="h8300/t-h8300 h8300/t-elf" tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h" @@ -810,12 +843,6 @@ hppa1.1-*-osf*) tmake_file="pa/t-pa" use_collect2=yes ;; -hppa1.1-*-rtems*) - target_cpu_default="MASK_PORTABLE_RUNTIME|MASK_NO_SPACE_REGS|MASK_SOFT_FLOAT" - tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h \ - pa/pa-pro-end.h libgloss.h pa/rtems.h rtems.h" - tmake_file="pa/t-pro t-rtems" - ;; hppa1.1-*-bsd*) target_cpu_default="MASK_PA_11" tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h" @@ -830,9 +857,11 @@ hppa[12]*-*-hpux10*) esac tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \ pa/pa-hpux.h pa/pa-hpux10.h" + extra_options="${extra_options} pa/pa-hpux.opt" case ${target} in *-*-hpux10.[1-9]*) tm_file="${tm_file} pa/pa-hpux1010.h" + extra_options="${extra_options} pa/pa-hpux1010.opt" ;; esac tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib" @@ -858,19 +887,24 @@ hppa*64*-*-hpux11*) if test x$gas = xyes then tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \ - pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux11.h" + pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \ + pa/pa-hpux11.h" else tm_file="pa/pa64-start.h ${tm_file} dbxelf.h pa/elf.h \ - pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux11.h" + pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \ + pa/pa-hpux11.h" fi case ${target} in *-*-hpux11.[1-9]*) tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h" + extra_options="${extra_options} pa/pa-hpux1111.opt" ;; *) tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h" ;; esac + extra_options="${extra_options} pa/pa-hpux.opt \ + pa/pa-hpux1010.opt pa/pa64-hpux.opt" need_64bit_hwint=yes tmake_file="pa/t-pa64 pa/t-pa-hpux pa/t-hpux-shlib" extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" @@ -887,10 +921,12 @@ hppa[12]*-*-hpux11*) ;; esac tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \ - pa/pa-hpux.h pa/pa-hpux11.h" + pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h" + extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt" case ${target} in *-*-hpux11.[1-9]*) tm_file="${tm_file} pa/pa-hpux1111.h" + extra_options="${extra_options} pa/pa-hpux1111.opt" ;; esac tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib" @@ -989,6 +1025,7 @@ i[34567]86-pc-msdosdjgpp*) xm_file=i386/xm-djgpp.h tm_file="dbxcoff.h ${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/djgpp.h" tmake_file=i386/t-djgpp + extra_options="${extra_options} i386/djgpp.opt" gnu_ld=yes gas=yes ;; @@ -997,6 +1034,7 @@ i[34567]86-*-lynxos*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h" tmake_file="i386/t-crtstuff t-lynx" extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + extra_options="${extra_options} lynx.opt" thread_file=lynx gnu_ld=yes gas=yes @@ -1039,6 +1077,7 @@ i[34567]86-*-sco3.2v5*) # 80386 running SCO Open Server 5 fi tmake_file=i386/t-sco5 extra_parts="crtbegin.o crtend.o" + extra_options="${extra_options} i386/sco5.opt" use_fixproto=yes ;; i[34567]86-*-solaris2*) @@ -1061,12 +1100,12 @@ i[34567]86-*-solaris2*) tmake_file="$tmake_file t-slibgcc-sld" fi case ${target} in - *-*-solaris2.[789] | *-*-solaris2.1[0-9]) + *-*-solaris2.[789] | *-*-solaris2.1[0-9]*) tm_file="$tm_file tm-dwarf2.h" ;; esac case ${target} in - *-*-solaris2.1[0-9]) + *-*-solaris2.1[0-9]*) tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h" tm_defines="${tm_defines} TARGET_BI_ARCH=1" tmake_file="$tmake_file i386/t-sol2-10" @@ -1128,6 +1167,7 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*) xm_file=i386/xm-cygwin.h tmake_file="i386/t-cygwin i386/t-cygming" target_gtfiles="\$(srcdir)/config/i386/winnt.c" + extra_options="${extra_options} i386/cygming.opt" extra_objs=winnt.o c_target_objs=cygwin2.o cxx_target_objs=cygwin2.o @@ -1141,6 +1181,7 @@ i[34567]86-*-mingw32*) xm_file=i386/xm-mingw32.h tmake_file="i386/t-cygming i386/t-mingw32" target_gtfiles="\$(srcdir)/config/i386/winnt.c" + extra_options="${extra_options} i386/cygming.opt" extra_objs=winnt.o case ${enable_threads} in "" | yes | win32) thread_file='win32' ;; @@ -1157,6 +1198,7 @@ i[34567]86-*-uwin*) tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygwin.h i386/uwin.h" tmake_file="i386/t-cygwin i386/t-uwin" extra_objs=winnt.o + extra_options="${extra_options} i386/cygming.opt" target_gtfiles="\$(srcdir)/config/i386/winnt.c" if test x$enable_threads = xyes; then thread_file='win32' @@ -1290,6 +1332,7 @@ m68hc12-*-*|m6812-*-*) md_file="m68hc11/m68hc11.md" out_file="m68hc11/m68hc11.c" tmake_file="m68hc11/t-m68hc11-gas" + extra_options="${extra_options} m68hc11/m68hc11.opt" use_fixproto=yes ;; m68k-*-aout*) @@ -1339,6 +1382,7 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux # with ELF format using glibc 2 # aka the GNU/Linux C library 6. tm_file="m68k/m68k.h dbxelf.h elfos.h svr4.h linux.h m68k/linux.h" + extra_options="${extra_options} m68k/ieee.opt" tm_defines="MOTOROLA USE_GAS" # if not configured with --enable-sjlj-exceptions, bump the # libgcc version number @@ -1527,25 +1571,22 @@ pdp11-*-bsd) pdp11-*-*) use_fixproto=yes ;; -avr-*-*) - use_fixproto=yes - ;; # port not yet contributed #powerpc-*-openbsd*) # tmake_file="${tmake_file} rs6000/t-fprules " # extra_headers= # ;; powerpc64-*-linux*) - tm_file="rs6000/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" - case x$with_cpu in - x|xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345]|xrs64a) - tm_file="${tm_file} rs6000/default64.h";; - esac - tm_file="${tm_file} rs6000/linux64.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" + test x$with_cpu != x || cpu_is_64bit=yes + test x$cpu_is_64bit != xyes || tm_file="${tm_file} rs6000/default64.h" + tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h" + extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" tmake_file="rs6000/t-fprules ${tmake_file} rs6000/t-ppccomm rs6000/t-linux64" ;; powerpc64-*-gnu*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux64.h rs6000/gnu.h" + extra_options="${extra_options} rs6000/sysv4.opt rs6000/linux64.opt" tmake_file="rs6000/t-fprules t-slibgcc-elf-ver t-gnu rs6000/t-linux64" ;; powerpc-*-beos*) @@ -1557,6 +1598,7 @@ powerpc-*-beos*) powerpc-*-darwin*) tm_file="${tm_file} rs6000/darwin.h" tmake_file="${tmake_file} rs6000/t-darwin" + extra_options="${extra_options} rs6000/darwin.opt" case ${target} in *-darwin1[0-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;; *-darwin[0-7]*) ;; @@ -1567,14 +1609,17 @@ powerpc-*-darwin*) powerpc*-*-freebsd*) tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h" tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpc-*-netbsd*) tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h" tmake_file="${tmake_file} rs6000/t-netbsd" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpc-*-chorusos*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h chorus.h" tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" case ${enable_threads} in yes | posix) thread_file='posix' @@ -1584,47 +1629,71 @@ powerpc-*-chorusos*) ;; powerpc-*-eabispe*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabispe.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-spe rs6000/t-ppccomm" ;; powerpc-*-eabisimaltivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h rs6000/eabialtivec.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm" ;; powerpc-*-eabisim*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" ;; powerpc-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" use_fixproto=yes ;; powerpc-*-eabialtivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabialtivec.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcendian rs6000/t-ppccomm" ;; powerpc-*-eabi*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" ;; powerpc-*-rtems*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/rtems.h rtems.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm" ;; powerpc-*-linux*altivec*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" ;; powerpc-*-linux*spe*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxspe.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" ;; powerpc-*-linux*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm" + case ${enable_targets}:${cpu_is_64bit} in + *powerpc64* | all:* | *:yes) + if test x$cpu_is_64bit = xyes; then + tm_file="${tm_file} rs6000/default64.h" + fi + tm_file="rs6000/biarch64.h ${tm_file} rs6000/linux64.h" + tmake_file="$tmake_file rs6000/t-linux64" + extra_options="${extra_options} rs6000/linux64.opt" + ;; + *) + tm_file="${tm_file} rs6000/linux.h" + ;; + esac ;; powerpc-*-gnu-gnualtivec*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/linuxaltivec.h rs6000/gnu.h" + extra_options="${extra_options} rs6000/sysv4.opt" tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" if test x$enable_threads = xyes; then thread_file='posix' @@ -1633,6 +1702,7 @@ powerpc-*-gnu-gnualtivec*) powerpc-*-gnu*) tm_file="${cpu_type}/${cpu_type}.h elfos.h svr4.h freebsd-spec.h gnu.h rs6000/sysv4.h rs6000/linux.h rs6000/gnu.h" tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-gnu rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" if test x$enable_threads = xyes; then thread_file='posix' fi @@ -1643,11 +1713,13 @@ powerpc-wrs-vxworks*) tm_file="rs6000/rs6000.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h" tm_file="${tm_file} vxworks.h rs6000/vxworks.h" tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm rs6000/t-vxworks" + extra_options="${extra_options} rs6000/sysv4.opt" extra_headers=ppc-asm.h ;; powerpc-wrs-windiss*) # Instruction-level simulator for VxWorks. tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/windiss.h" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" thread_file="" use_fixproto=yes ;; @@ -1655,7 +1727,9 @@ powerpc-*-lynxos*) xm_defines=POSIX tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h" tmake_file="t-lynx rs6000/t-lynx" + extra_options="${extra_options} rs6000/sysv4.opt lynx.opt" extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + extra_options="${extra_options} lynx.opt" thread_file=lynx gnu_ld=yes gas=yes @@ -1663,32 +1737,39 @@ powerpc-*-lynxos*) powerpcle-*-sysv*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h" tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" use_fixproto=yes ;; powerpcle-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" use_fixproto=yes ;; powerpcle-*-eabisim*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpcle-*-eabi*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpc-*-kaos*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h kaos.h rs6000/kaos-ppc.h" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; powerpcle-*-kaos*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h kaos.h rs6000/kaos-ppc.h" tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm" + extra_options="${extra_options} rs6000/sysv4.opt" ;; rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*) tm_file="${tm_file} rs6000/aix.h rs6000/aix41.h rs6000/xcoff.h" tmake_file="rs6000/t-fprules rs6000/t-newas" + extra_options="${extra_options} rs6000/aix41.opt" use_collect2=yes extra_headers= use_fixproto=yes @@ -1696,12 +1777,14 @@ rs6000-ibm-aix4.[12]* | powerpc-ibm-aix4.[12]*) rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*) tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix43.h rs6000/xcoff.h" tmake_file=rs6000/t-aix43 + extra_options="${extra_options} rs6000/aix64.opt" use_collect2=yes thread_file='aix' extra_headers= ;; rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*) tm_file="rs6000/biarch64.h ${tm_file} rs6000/aix.h rs6000/aix51.h rs6000/xcoff.h" + extra_options="${extra_options} rs6000/aix64.opt" tmake_file=rs6000/t-aix43 use_collect2=yes thread_file='aix' @@ -1710,6 +1793,7 @@ rs6000-ibm-aix5.1.* | powerpc-ibm-aix5.1.*) rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*) tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h" tmake_file=rs6000/t-aix52 + extra_options="${extra_options} rs6000/aix64.opt" use_collect2=yes thread_file='aix' extra_headers= @@ -1862,7 +1946,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ sh5-32media | sh5-32media-nofpu | \ sh5-compact | sh5-compact-nofpu) tmake_file="${tmake_file} sh/t-mlib-${sh_multilib}" - tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr a-z- A-Z_`" + tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr a-z- A-Z_`=1" ;; *) echo "with_multilib_list=${sh_multilib} not supported." @@ -1871,7 +1955,7 @@ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ esac done if test x${enable_incomplete_targets} == xyes ; then - tm_defines="$tm_defines SUPPORT_SH1 SUPPORT_SH2E SUPPORT_SH4 SUPPORT_SH4_SINGLE SUPPORT_SH2A SUPPORT_SH2A_SINGLE SUPPORT_SH5_32MEDIA SUPPORT_SH5_32MEDIA_NOFPU SUPPORT_SH5_64MEDIA SUPPORT_SH5_64MEDIA_NOFPU" + tm_defines="$tm_defines SUPPORT_SH1=1 SUPPORT_SH2E=1 SUPPORT_SH4=1 SUPPORT_SH4_SINGLE=1 SUPPORT_SH2A=1 SUPPORT_SH2A_SINGLE=1 SUPPORT_SH5_32MEDIA=1 SUPPORT_SH5_32MEDIA_NOFPU=1 SUPPORT_SH5_64MEDIA=1 SUPPORT_SH5_64MEDIA_NOFPU=1" fi use_fixproto=yes ;; @@ -1893,6 +1977,7 @@ sh-*-*) ;; sparc-*-netbsdelf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h" + extra_options="${extra_options} sparc/long-double-switch.opt" ;; sparc-*-openbsd*) tm_defines=OBSD_OLD_GAS @@ -1904,6 +1989,7 @@ sparc-*-openbsd*) ;; sparc64-*-openbsd*) tm_file="sparc/openbsd1-64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h openbsd.h sparc/openbsd64.h" + extra_options="${extra_options} sparc/little-endian.opt" gas=yes gnu_ld=yes with_cpu=ultrasparc ;; @@ -1915,6 +2001,7 @@ sparc-*-elf*) ;; sparc-*-linux*) # SPARC's running GNU/Linux, libc6 tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux.h" + extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-crtfm" ;; sparc-*-rtems*) @@ -1972,7 +2059,7 @@ sparc-*-solaris2*) tm_file="${tm_file} sparc/sol26-sld.h" fi ;; - *-*-solaris2.[789] | *-*-solaris2.1[0-9]) + *-*-solaris2.[789] | *-*-solaris2.1[0-9]*) tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h tm-dwarf2.h" if test x$gnu_ld = xyes; then tm_file="${tm_file} sparc/sol2-gld-bi.h" @@ -2011,30 +2098,16 @@ sparc-*-sysv4*) extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; -sparclite-*-coff*) - tm_file="${tm_file} sparc/lite.h svr3.h sparc/litecoff.h dbxcoff.h libgloss.h" - tmake_file=sparc/t-sparclite - ;; -sparclite-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/liteelf.h" - tmake_file="sparc/t-sparclite sparc/t-crtfm" - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; -sparc86x-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/sp86x-elf.h" - tmake_file="sparc/t-sp86x sparc/t-crtfm" - extra_parts="crtbegin.o crtend.o" - use_fixproto=yes - ;; sparc64-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h" + extra_options="${extra_options} sparc/little-endian.opt" tmake_file="${tmake_file} sparc/t-crtfm" extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; sparc64-*-freebsd*|ultrasparc-*-freebsd*) tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h" + extra_options="${extra_options} sparc/long-double-switch.opt" tmake_file="${tmake_file} sparc/t-crtfm" case "x$with_cpu" in xultrasparc) ;; @@ -2044,13 +2117,15 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*) need_64bit_hwint=yes ;; sparc64-*-linux*) # 64-bit SPARC's running GNU/Linux - tmake_file="${tmake_file} sparc/t-linux64 sparc/t-crtfm" tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/linux64.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-linux64 sparc/t-crtfm" ;; sparc64-*-netbsd*) - tmake_file="${tmake_file} sparc/t-netbsd64" tm_file="sparc/biarch64.h ${tm_file}" tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h" + extra_options="${extra_options} sparc/long-double-switch.opt" + tmake_file="${tmake_file} sparc/t-netbsd64" ;; strongarm-*-elf*) tm_file="arm/strongarm-elf.h dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h" @@ -2066,6 +2141,7 @@ strongarm-*-pe) out_file=arm/arm.c md_file=arm/arm.md extra_modes=arm/arm-modes.def + extra_options="${extra_options} arm/pe.opt" extra_objs=pe.o use_fixproto=yes ;; @@ -2083,6 +2159,7 @@ v850e1-*-*) tmake_file=v850/t-v850e md_file=v850/v850.md out_file=v850/v850.c + extra_options="${extra_options} v850/v850.opt" if test x$stabs = xyes then tm_file="${tm_file} dbx.h" @@ -2099,6 +2176,7 @@ v850e-*-*) tmake_file=v850/t-v850e md_file=v850/v850.md out_file=v850/v850.c + extra_options="${extra_options} v850/v850.opt" if test x$stabs = xyes then tm_file="${tm_file} dbx.h" @@ -2172,6 +2250,7 @@ xstormy16-*-elf) tm_p_file=stormy16/stormy16-protos.h md_file=stormy16/stormy16.md out_file=stormy16/stormy16.c + extra_options=stormy16/stormy16.opt tmake_file="stormy16/t-stormy16" extra_parts="crtbegin.o crtend.o" use_fixproto=yes @@ -2753,9 +2832,6 @@ case ${target} in xsparc) with_cpu=v7 ;; - xsparc86x) - with_cpu=sparclite86x - ;; xsparcv9 | xsparc64) with_cpu=v9 ;; diff --git a/gcc/config.host b/gcc/config.host index cb1e9a6058b..dbbf5b129e0 100644 --- a/gcc/config.host +++ b/gcc/config.host @@ -85,6 +85,15 @@ case ${host} in ;; esac +# Common parts for widely ported systems. +case ${target} in + *-darwin*) + # Generic darwin host support. + out_host_hook_obj=host-darwin.o + host_xmake_file=x-darwin + ;; +esac + # Machine-specific settings. case ${host} in alpha*-dec-*vms*) @@ -154,7 +163,6 @@ case ${host} in host_xm_file=i386/xm-mingw32.h host_xmake_file=i386/x-mingw32 host_exeext=.exe - host_can_use_collect2=no out_host_hook_obj=host-mingw32.o ;; i[34567]86-*-uwin*) @@ -165,6 +173,10 @@ case ${host} in i[34567]86-*-interix3*) host_xmake_file="x-interix" ;; + i[34567]86-*-darwin*) + out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o" + host_xmake_file="${host_xmake_file} i386/x-darwin" + ;; i860-*-sysv4*) host_xmake_file=i860/x-sysv4 ;; @@ -172,9 +184,8 @@ case ${host} in host_can_use_collect2=no ;; powerpc-*-darwin*) - # powerpc-darwin host support. - out_host_hook_obj=host-darwin.o - host_xmake_file=rs6000/x-darwin + out_host_hook_obj="${out_host_hook_obj} host-ppc-darwin.o" + host_xmake_file="${host_xmake_file} rs6000/x-darwin" ;; *-*-solaris2*) out_host_hook_obj=host-solaris.o diff --git a/gcc/config.in b/gcc/config.in index 34fb521f4da..8fdf6802377 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1,608 +1,1308 @@ /* config.in. Generated from configure.ac by autoheader. */ -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#undef BYTEORDER - /* Define as the number of bits in a byte, if \`limits.h' doesn't. */ +#ifndef USED_FOR_TARGET #undef CHAR_BIT +#endif + /* Define 0/1 to force the choice for exception handling model. */ +#ifndef USED_FOR_TARGET #undef CONFIG_SJLJ_EXCEPTIONS +#endif + /* Define to enable the use of a default assembler. */ +#ifndef USED_FOR_TARGET #undef DEFAULT_ASSEMBLER +#endif + /* Define to enable the use of a default linker. */ +#ifndef USED_FOR_TARGET #undef DEFAULT_LINKER +#endif + /* Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. This is essential for fully standards-compliant handling of destructors, but requires __cxa_atexit in libc. */ +#ifndef USED_FOR_TARGET #undef DEFAULT_USE_CXA_ATEXIT +#endif + /* Define if you want assertions enabled. This is a cheap check. */ +#ifndef USED_FOR_TARGET #undef ENABLE_ASSERT_CHECKING +#endif + /* Define if you want more run-time sanity checks. This one gets a grab bag of miscellaneous but relatively cheap checks. */ +#ifndef USED_FOR_TARGET #undef ENABLE_CHECKING +#endif + /* Define if you want fold checked that it never destructs its argument. This is quite expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_FOLD_CHECKING +#endif + /* Define if you want the garbage collector to operate in maximally paranoid mode, validating the entire heap and collecting garbage at every opportunity. This is extremely expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_GC_ALWAYS_COLLECT +#endif + /* Define if you want the garbage collector to do object poisoning and other memory allocation checks. This is quite expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_GC_CHECKING +#endif + /* Define to 1 if translation of program messages to the user's native language is requested. */ +#ifndef USED_FOR_TARGET #undef ENABLE_NLS +#endif + /* Define if you want all operations on RTL (the basic data structure of the optimizer and back end) to be checked for dynamic type safety at runtime. This is quite expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_RTL_CHECKING +#endif + /* Define if you want RTL flag accesses to be checked against the RTL codes that are supported for each access macro. This is relatively cheap. */ +#ifndef USED_FOR_TARGET #undef ENABLE_RTL_FLAG_CHECKING +#endif + + +/* Define if you want runtime assertions enabled. This is a cheap check. */ +#undef ENABLE_RUNTIME_CHECKING /* Define if you want all operations on trees (the basic data structure of the front ends) to be checked for dynamic type safety at runtime. This is moderately expensive. The tree browser debugging routines will also be enabled by this option. */ +#ifndef USED_FOR_TARGET #undef ENABLE_TREE_CHECKING +#endif + /* Define if you want to run subprograms and generated programs through valgrind (a memory checker). This is extremely expensive. */ +#ifndef USED_FOR_TARGET #undef ENABLE_VALGRIND_CHECKING +#endif + /* Define to 1 if installation paths should be looked up in the Windows Registry. Ignored on non-Windows hosts. */ +#ifndef USED_FOR_TARGET #undef ENABLE_WIN32_REGISTRY +#endif + /* Define to the name of a file containing a list of extra machine modes for this architecture. */ +#ifndef USED_FOR_TARGET #undef EXTRA_MODES_FILE +#endif + /* Define to enable detailed memory allocation stats gathering. */ +#ifndef USED_FOR_TARGET #undef GATHER_STATISTICS +#endif + /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ +#ifndef USED_FOR_TARGET #undef GETGROUPS_T +#endif + /* Define if the zone collector is in use */ +#ifndef USED_FOR_TARGET #undef GGC_ZONE +#endif + /* Define to 1 if you have the `alphasort' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ALPHASORT +#endif + /* Define if your assembler supports dwarf2 .file/.loc directives, and preserves file table indices exactly as given. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_DWARF2_DEBUG_LINE +#endif + /* Define if your assembler supports explicit relocations. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_EXPLICIT_RELOCS +#endif + /* Define if your assembler supports the --gdwarf2 option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_GDWARF2_DEBUG_FLAG +#endif + /* Define true if the assembler supports '.long foo@GOTOFF'. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_GOTOFF_IN_DATA +#endif + /* Define if your assembler supports the --gstabs option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_GSTABS_DEBUG_FLAG +#endif + /* Define if your assembler supports the Sun syntax for cmov. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_IX86_CMOV_SUN_SYNTAX +#endif + /* Define if your assembler supports .sleb128 and .uleb128. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_LEB128 +#endif + /* Define if your assembler supports ltoffx and ldxmov relocations. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_LTOFFX_LDXMOV_RELOCS +#endif + /* Define if your assembler supports mfcr field. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_MFCRF +#endif + /* Define if your assembler supports the -no-mul-bug-abort option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_NO_MUL_BUG_ABORT_OPTION +#endif + /* Define if your assembler supports offsetable %lo(). */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_OFFSETABLE_LO10 +#endif + + +/* Define if your assembler supports popcntb field. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_POPCNTB +#endif + /* Define if your assembler supports .register. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_REGISTER_PSEUDO_OP +#endif + /* Define if your assembler supports -relax option. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_RELAX_OPTION +#endif + /* Define if your assembler and linker support unaligned PC relative relocs. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_SPARC_UA_PCREL +#endif + /* Define if your assembler and linker support unaligned PC relative relocs against hidden symbols. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_SPARC_UA_PCREL_HIDDEN +#endif + /* Define if your assembler supports thread-local storage. */ +#ifndef USED_FOR_TARGET #undef HAVE_AS_TLS +#endif + /* Define to 1 if you have the `atoll' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ATOLL +#endif + /* Define to 1 if you have the `atoq' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ATOQ +#endif + + +/* Define to 1 if you have the `clearerr_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_CLEARERR_UNLOCKED +#endif + /* Define to 1 if you have the `clock' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_CLOCK +#endif + /* Define if defines clock_t. */ +#ifndef USED_FOR_TARGET #undef HAVE_CLOCK_T +#endif + + +/* Define 0/1 if your assembler and linker support COMDAT groups. */ +#ifndef USED_FOR_TARGET +#undef HAVE_COMDAT_GROUP +#endif + /* Define to 1 if we found a declaration for 'abort', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ABORT +#endif + /* Define to 1 if we found a declaration for 'atof', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ATOF +#endif + /* Define to 1 if we found a declaration for 'atol', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ATOL +#endif + /* Define to 1 if we found a declaration for 'basename', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_BASENAME +#endif + /* Define to 1 if we found a declaration for 'calloc', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_CALLOC +#endif + + +/* Define to 1 if we found a declaration for 'clearerr_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_CLEARERR_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'clock', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_CLOCK +#endif + /* Define to 1 if we found a declaration for 'errno', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_ERRNO +#endif + + +/* Define to 1 if we found a declaration for 'feof_unlocked', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FEOF_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'ferror_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FERROR_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fflush_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FFLUSH_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fgetc_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FGETC_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fgets_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FGETS_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fileno_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FILENO_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'fprintf_unlocked', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FPRINTF_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fputc_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FPUTC_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'fputs_unlocked', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FPUTS_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'fread_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FREAD_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'free', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FREE +#endif + /* Define to 1 if we found a declaration for 'fwrite_unlocked', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_FWRITE_UNLOCKED +#endif + + +/* Define to 1 if we found a declaration for 'getchar_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_GETCHAR_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'getcwd', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETCWD +#endif + + +/* Define to 1 if we found a declaration for 'getc_unlocked', otherwise define + to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_GETC_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'getenv', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETENV +#endif + /* Define to 1 if we found a declaration for 'getopt', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETOPT +#endif + /* Define to 1 if we found a declaration for 'getpagesize', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETPAGESIZE +#endif + /* Define to 1 if we found a declaration for 'getrlimit', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETRLIMIT +#endif + /* Define to 1 if we found a declaration for 'getrusage', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETRUSAGE +#endif + /* Define to 1 if we found a declaration for 'getwd', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_GETWD +#endif + /* Define to 1 if we found a declaration for 'ldgetname', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_LDGETNAME +#endif + /* Define to 1 if we found a declaration for 'malloc', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_MALLOC +#endif + + +/* Define to 1 if we found a declaration for 'putchar_unlocked', otherwise + define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_PUTCHAR_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'putc_unlocked', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_PUTC_UNLOCKED +#endif + /* Define to 1 if we found a declaration for 'realloc', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_REALLOC +#endif + /* Define to 1 if we found a declaration for 'sbrk', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_SBRK +#endif + /* Define to 1 if we found a declaration for 'setrlimit', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_SETRLIMIT +#endif + /* Define to 1 if we found a declaration for 'snprintf', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_SNPRINTF +#endif + /* Define to 1 if we found a declaration for 'strsignal', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_STRSIGNAL +#endif + /* Define to 1 if we found a declaration for 'strstr', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_STRSTR +#endif + /* Define to 1 if we found a declaration for 'times', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_TIMES +#endif + /* Define to 1 if we found a declaration for 'vasprintf', otherwise define to 0. */ +#ifndef USED_FOR_TARGET #undef HAVE_DECL_VASPRINTF +#endif + + +/* Define to 1 if we found a declaration for 'vsnprintf', otherwise define to + 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_VSNPRINTF +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_DIRECT_H +#endif + /* Define to 1 if you have the `dup2' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_DUP2 +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_FCNTL_H +#endif + + +/* Define to 1 if you have the `feof_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FEOF_UNLOCKED +#endif + + +/* Define to 1 if you have the `ferror_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FERROR_UNLOCKED +#endif + + +/* Define to 1 if you have the `fflush_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FFLUSH_UNLOCKED +#endif + + +/* Define to 1 if you have the `fgetc_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FGETC_UNLOCKED +#endif + + +/* Define to 1 if you have the `fgets_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FGETS_UNLOCKED +#endif + + +/* Define to 1 if you have the `fileno_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FILENO_UNLOCKED +#endif + /* Define to 1 if you have the `fork' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FORK +#endif + /* Define to 1 if you have the `fprintf_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FPRINTF_UNLOCKED +#endif + /* Define to 1 if you have the `fputc_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FPUTC_UNLOCKED +#endif + /* Define to 1 if you have the `fputs_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FPUTS_UNLOCKED +#endif + + +/* Define to 1 if you have the `fread_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_FREAD_UNLOCKED +#endif + /* Define to 1 if you have the `fwrite_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_FWRITE_UNLOCKED +#endif + /* Define if your assembler supports .balign and .p2align. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_BALIGN_AND_P2ALIGN +#endif -/* Define 0/1 if your assembler supports COMDAT group. */ -#undef HAVE_GAS_COMDAT_GROUP /* Define if your assembler uses the new HImode fild and fist notation. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_FILDS_FISTS +#endif + /* Define if your assembler and linker support .hidden. */ #undef HAVE_GAS_HIDDEN /* Define if your assembler supports specifying the maximum number of bytes to skip when using the GAS .p2align command. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_MAX_SKIP_P2ALIGN +#endif + /* Define if your assembler supports .nsubspa comdat option. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_NSUBSPA_COMDAT +#endif + /* Define if your assembler and linker support 32-bit section relative relocs via '.secrel32 label'. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_PE_SECREL32_RELOC +#endif + /* Define 0/1 if your assembler supports marking sections with SHF_MERGE flag. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_SHF_MERGE +#endif + /* Define if your assembler supports .subsection and .subsection -1 starts emitting at the beginning of your section. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_SUBSECTION_ORDERING +#endif + /* Define if your assembler supports .weak. */ +#ifndef USED_FOR_TARGET #undef HAVE_GAS_WEAK +#endif + + +/* Define to 1 if you have the `getchar_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GETCHAR_UNLOCKED +#endif + + +/* Define to 1 if you have the `getc_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_GETC_UNLOCKED +#endif + /* Define to 1 if you have the `getrlimit' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_GETRLIMIT +#endif + /* Define to 1 if you have the `getrusage' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_GETRUSAGE +#endif + /* Define to 1 if you have the `gettimeofday' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_GETTIMEOFDAY +#endif + /* Define if you have the iconv() function. */ +#ifndef USED_FOR_TARGET #undef HAVE_ICONV +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_ICONV_H +#endif + /* Define .init_array/.fini_array sections are available and working. */ +#ifndef USED_FOR_TARGET #undef HAVE_INITFINI_ARRAY +#endif + /* Define if you have a working header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_INTTYPES_H +#endif + /* Define to 1 if you have the `kill' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_KILL +#endif + /* Define if you have and nl_langinfo(CODESET). */ +#ifndef USED_FOR_TARGET #undef HAVE_LANGINFO_CODESET +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LANGINFO_H +#endif + /* Define if your file defines LC_MESSAGES. */ +#ifndef USED_FOR_TARGET #undef HAVE_LC_MESSAGES +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LDFCN_H +#endif + /* Define if your linker supports --as-needed and --no-as-needed options. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_AS_NEEDED +#endif + /* Define if your linker supports --demangle option. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_DEMANGLE +#endif + /* Define if your linker supports --eh-frame-hdr option. */ #undef HAVE_LD_EH_FRAME_HDR /* Define if your PowerPC64 linker only needs function descriptor syms. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_NO_DOT_SYMS +#endif + /* Define if your linker supports -pie option. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_PIE +#endif + /* Define if your linker links a mix of read-only and read-write sections into a read-write section. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_RO_RW_SECTION_MIXING +#endif + /* Define if your linker supports -Bstatic/-Bdynamic option. */ +#ifndef USED_FOR_TARGET #undef HAVE_LD_STATIC_DYNAMIC +#endif + + +/* Define if your linker supports --sysroot. */ +#ifndef USED_FOR_TARGET +#undef HAVE_LD_SYSROOT +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LIMITS_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_LOCALE_H +#endif + /* Define if your compiler supports the \`long long' type. */ +#ifndef USED_FOR_TARGET #undef HAVE_LONG_LONG +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_MALLOC_H +#endif + /* Define to 1 if you have the `mbstowcs' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_MBSTOWCS +#endif + /* Define if valgrind's memcheck.h header is installed. */ +#ifndef USED_FOR_TARGET #undef HAVE_MEMCHECK_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_MEMORY_H +#endif + /* Define to 1 if you have the `mincore' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_MINCORE +#endif + /* Define to 1 if you have the `mmap' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP +#endif + /* Define if mmap with MAP_ANON(YMOUS) works. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP_ANON +#endif + /* Define if mmap of /dev/zero works. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP_DEV_ZERO +#endif + /* Define if read-only mmap of a plain file works. */ +#ifndef USED_FOR_TARGET #undef HAVE_MMAP_FILE +#endif + /* Define to 1 if you have the `nl_langinfo' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_NL_LANGINFO +#endif + /* Define if printf supports "%p". */ +#ifndef USED_FOR_TARGET #undef HAVE_PRINTF_PTR +#endif + + +/* Define to 1 if you have the `putchar_unlocked' function. */ +#ifndef USED_FOR_TARGET +#undef HAVE_PUTCHAR_UNLOCKED +#endif + /* Define to 1 if you have the `putc_unlocked' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_PUTC_UNLOCKED +#endif + /* Define to 1 if you have the `scandir' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SCANDIR +#endif + /* Define to 1 if you have the `setlocale' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SETLOCALE +#endif + /* Define to 1 if you have the `setrlimit' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SETRLIMIT +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STDDEF_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STDINT_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STDLIB_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRINGS_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRING_H +#endif + /* Define to 1 if you have the `strsignal' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRSIGNAL +#endif + /* Define if defines struct tms. */ +#ifndef USED_FOR_TARGET #undef HAVE_STRUCT_TMS +#endif + /* Define to 1 if you have the `sysconf' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYSCONF +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_FILE_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_MMAN_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_PARAM_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_RESOURCE_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_STAT_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_TIMES_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_TIME_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_TYPES_H +#endif + /* Define to 1 if you have that is POSIX.1 compatible. */ +#ifndef USED_FOR_TARGET #undef HAVE_SYS_WAIT_H +#endif + /* Define to 1 if you have the `times' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_TIMES +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_TIME_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_UNISTD_H +#endif + /* Define if valgrind's valgrind/memcheck.h header is installed. */ +#ifndef USED_FOR_TARGET #undef HAVE_VALGRIND_MEMCHECK_H +#endif + /* Define to 1 if you have the `vfork' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_VFORK +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_VFORK_H +#endif + /* Define to 1 if you have the header file. */ +#ifndef USED_FOR_TARGET #undef HAVE_WCHAR_H +#endif + /* Define to 1 if you have the `wcswidth' function. */ +#ifndef USED_FOR_TARGET #undef HAVE_WCSWIDTH +#endif + /* Define to 1 if `fork' works. */ +#ifndef USED_FOR_TARGET #undef HAVE_WORKING_FORK +#endif + /* Define this macro if mbstowcs does not crash when its first argument is NULL. */ +#ifndef USED_FOR_TARGET #undef HAVE_WORKING_MBSTOWCS +#endif + /* Define to 1 if `vfork' works. */ +#ifndef USED_FOR_TARGET #undef HAVE_WORKING_VFORK +#endif + /* Define if your compiler supports the \`__int64' type. */ +#ifndef USED_FOR_TARGET #undef HAVE___INT64 +#endif -/* Define if the host machine stores words of multi-word integers in - big-endian order. */ -#undef HOST_WORDS_BIG_ENDIAN /* Define as const if the declaration of iconv() needs const. */ +#ifndef USED_FOR_TARGET #undef ICONV_CONST +#endif + /* Define if host mkdir takes a single argument. */ +#ifndef USED_FOR_TARGET #undef MKDIR_TAKES_ONE_ARG +#endif + /* Define to 1 if HOST_WIDE_INT must be 64 bits wide (see hwint.h). */ +#ifndef USED_FOR_TARGET #undef NEED_64BIT_HOST_WIDE_INT +#endif + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#ifndef USED_FOR_TARGET #undef NO_MINUS_C_MINUS_O +#endif + /* Define to the address where bug reports for this package should be sent. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_BUGREPORT +#endif + /* Define to the full name of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_NAME +#endif + /* Define to the full name and version of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_STRING +#endif + /* Define to the one symbol short name of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_TARNAME +#endif + /* Define to the version of this package. */ +#ifndef USED_FOR_TARGET #undef PACKAGE_VERSION +#endif + /* Define to PREFIX/include if cpp should also search that directory. */ +#ifndef USED_FOR_TARGET #undef PREFIX_INCLUDE_DIR +#endif + /* The size of a `int', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_INT +#endif + /* The size of a `long', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_LONG +#endif + /* The size of a `long long', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_LONG_LONG +#endif + /* The size of a `short', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_SHORT +#endif + /* The size of a `void *', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF_VOID_P +#endif + /* The size of a `__int64', as computed by sizeof. */ +#ifndef USED_FOR_TARGET #undef SIZEOF___INT64 +#endif + /* Define to 1 if you have the ANSI C header files. */ +#ifndef USED_FOR_TARGET #undef STDC_HEADERS +#endif + /* Define if you can safely include both and . */ +#ifndef USED_FOR_TARGET #undef STRING_WITH_STRINGS +#endif + /* Define to 1 if you can safely include both and . */ +#ifndef USED_FOR_TARGET #undef TIME_WITH_SYS_TIME +#endif + /* Define if your assembler mis-optimizes .eh_frame data. */ +#ifndef USED_FOR_TARGET #undef USE_AS_TRADITIONAL_FORMAT +#endif + /* Define to 1 if the 'long long' (or '__int64') is wider than 'long' but still efficiently supported by the host hardware. */ +#ifndef USED_FOR_TARGET #undef USE_LONG_LONG_FOR_WIDEST_FAST_INT +#endif + /* Define if location_t is fileline integer cookie. */ +#ifndef USED_FOR_TARGET #undef USE_MAPPED_LOCATION +#endif + /* Define to be the last component of the Windows registry key under which to look for installation paths. The full key used will be HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}. The default is the GCC version number. */ +#ifndef USED_FOR_TARGET #undef WIN32_REGISTRY_KEY +#endif -/* whether byteorder is bigendian */ + +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#ifndef USED_FOR_TARGET #undef WORDS_BIGENDIAN +#endif + /* Always define this when using the GNU C Library */ +#ifndef USED_FOR_TARGET #undef _GNU_SOURCE +#endif + /* Define to `int' if doesn't define. */ +#ifndef USED_FOR_TARGET #undef gid_t +#endif + /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ @@ -611,16 +1311,31 @@ #endif /* Define to `int' if does not define. */ +#ifndef USED_FOR_TARGET #undef pid_t +#endif + /* Define to \`long' if doesn't define. */ +#ifndef USED_FOR_TARGET #undef rlim_t +#endif + /* Define to `int' if does not define. */ +#ifndef USED_FOR_TARGET #undef ssize_t +#endif + /* Define to `int' if doesn't define. */ +#ifndef USED_FOR_TARGET #undef uid_t +#endif + /* Define as `fork' if `vfork' does not work. */ +#ifndef USED_FOR_TARGET #undef vfork +#endif + diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h index 6c2be06c02f..dc2b027108b 100644 --- a/gcc/config/alpha/alpha-protos.h +++ b/gcc/config/alpha/alpha-protos.h @@ -101,6 +101,7 @@ extern rtx alpha_emit_setcc (enum rtx_code); extern int alpha_split_conditional_move (enum rtx_code, rtx, rtx, rtx, rtx); extern void alpha_emit_xfloating_arith (enum rtx_code, rtx[]); extern void alpha_emit_xfloating_cvt (enum rtx_code, rtx[]); +extern void alpha_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx); #endif extern rtx alpha_need_linkage (const char *, int); diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 102f568e2a4..66f9f48ea94 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -53,6 +53,8 @@ Boston, MA 02111-1307, USA. */ #include #include "cfglayout.h" #include "tree-gimple.h" +#include "tree-flow.h" +#include "tree-stdarg.h" /* Specify which cpu to schedule for. */ enum processor_type alpha_tune; @@ -209,7 +211,7 @@ static struct alpha_rtx_cost_data const alpha_rtx_cost_size = /* Declarations of static functions. */ static struct machine_function *alpha_init_machine_status (void); -static rtx alpha_emit_xfloating_compare (enum rtx_code, rtx, rtx); +static rtx alpha_emit_xfloating_compare (enum rtx_code *, rtx, rtx); #if TARGET_ABI_OPEN_VMS static void alpha_write_linkage (FILE *, const char *, tree); @@ -308,7 +310,7 @@ override_options (void) /* Unicos/Mk doesn't have shared libraries. */ if (TARGET_ABI_UNICOSMK && flag_pic) { - warning ("-f%s ignored for Unicos/Mk (not supported)", + warning (0, "-f%s ignored for Unicos/Mk (not supported)", (flag_pic > 1) ? "PIC" : "pic"); flag_pic = 0; } @@ -332,7 +334,7 @@ override_options (void) if (TARGET_IEEE) { if (TARGET_ABI_UNICOSMK) - warning ("-mieee not supported on Unicos/Mk"); + warning (0, "-mieee not supported on Unicos/Mk"); else { alpha_tp = ALPHA_TP_INSN; @@ -343,7 +345,7 @@ override_options (void) if (TARGET_IEEE_WITH_INEXACT) { if (TARGET_ABI_UNICOSMK) - warning ("-mieee-with-inexact not supported on Unicos/Mk"); + warning (0, "-mieee-with-inexact not supported on Unicos/Mk"); else { alpha_tp = ALPHA_TP_INSN; @@ -422,14 +424,14 @@ override_options (void) if (TARGET_ABI_UNICOSMK && alpha_fptm != ALPHA_FPTM_N) { - warning ("trap mode not supported on Unicos/Mk"); + warning (0, "trap mode not supported on Unicos/Mk"); alpha_fptm = ALPHA_FPTM_N; } if ((alpha_fptm == ALPHA_FPTM_SU || alpha_fptm == ALPHA_FPTM_SUI) && alpha_tp != ALPHA_TP_INSN && alpha_cpu != PROCESSOR_EV6) { - warning ("fp software completion requires -mtrap-precision=i"); + warning (0, "fp software completion requires -mtrap-precision=i"); alpha_tp = ALPHA_TP_INSN; } @@ -445,16 +447,16 @@ override_options (void) { if (alpha_fprm == ALPHA_FPRM_MINF || alpha_fprm == ALPHA_FPRM_DYN) { - warning ("rounding mode not supported for VAX floats"); + warning (0, "rounding mode not supported for VAX floats"); alpha_fprm = ALPHA_FPRM_NORM; } if (alpha_fptm == ALPHA_FPTM_SUI) { - warning ("trap mode not supported for VAX floats"); + warning (0, "trap mode not supported for VAX floats"); alpha_fptm = ALPHA_FPTM_SU; } if (target_flags_explicit & MASK_LONG_DOUBLE_128) - warning ("128-bit long double not supported for VAX floats"); + warning (0, "128-bit long double not supported for VAX floats"); target_flags &= ~MASK_LONG_DOUBLE_128; } @@ -482,7 +484,7 @@ override_options (void) lat = alpha_mlat_string[1] - '0'; if (lat <= 0 || lat > 3 || cache_latency[alpha_tune][lat-1] == -1) { - warning ("L%d cache latency unknown for %s", + warning (0, "L%d cache latency unknown for %s", lat, alpha_cpu_name[alpha_tune]); lat = 3; } @@ -497,7 +499,7 @@ override_options (void) } else { - warning ("bad value %qs for -mmemory-latency", alpha_mlat_string); + warning (0, "bad value %qs for -mmemory-latency", alpha_mlat_string); lat = 3; } @@ -594,7 +596,7 @@ tls_symbolic_operand_1 (rtx op, int size, int unspec) case TLS_MODEL_LOCAL_EXEC: return unspec == UNSPEC_TPREL; default: - abort (); + gcc_unreachable (); } } @@ -1529,21 +1531,17 @@ get_aligned_mem (rtx ref, rtx *paligned_mem, rtx *pbitnum) rtx base; HOST_WIDE_INT offset = 0; - if (GET_CODE (ref) != MEM) - abort (); + gcc_assert (GET_CODE (ref) == MEM); if (reload_in_progress && ! memory_address_p (GET_MODE (ref), XEXP (ref, 0))) { base = find_replacement (&XEXP (ref, 0)); - if (! memory_address_p (GET_MODE (ref), base)) - abort (); + gcc_assert (memory_address_p (GET_MODE (ref), base)); } else - { - base = XEXP (ref, 0); - } + base = XEXP (ref, 0); if (GET_CODE (base) == PLUS) offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0); @@ -1567,21 +1565,17 @@ get_unaligned_address (rtx ref, int extra_offset) rtx base; HOST_WIDE_INT offset = 0; - if (GET_CODE (ref) != MEM) - abort (); + gcc_assert (GET_CODE (ref) == MEM); if (reload_in_progress && ! memory_address_p (GET_MODE (ref), XEXP (ref, 0))) { base = find_replacement (&XEXP (ref, 0)); - if (! memory_address_p (GET_MODE (ref), base)) - abort (); + gcc_assert (memory_address_p (GET_MODE (ref), base)); } else - { - base = XEXP (ref, 0); - } + base = XEXP (ref, 0); if (GET_CODE (base) == PLUS) offset += INTVAL (XEXP (base, 1)), base = XEXP (base, 0); @@ -2051,8 +2045,7 @@ alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1, HOST_WIDE_INT c2) /* Decompose the entire word */ #if HOST_BITS_PER_WIDE_INT >= 64 - if (c2 != -(c1 < 0)) - abort (); + gcc_assert (c2 == -(c1 < 0)); d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000; c1 -= d1; d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000; @@ -2060,20 +2053,17 @@ alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1, HOST_WIDE_INT c2) d3 = ((c1 & 0xffff) ^ 0x8000) - 0x8000; c1 -= d3; d4 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000; - if (c1 != d4) - abort (); + gcc_assert (c1 == d4); #else d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000; c1 -= d1; d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000; - if (c1 != d2) - abort (); + gcc_assert (c1 == d2); c2 += (d2 < 0); d3 = ((c2 & 0xffff) ^ 0x8000) - 0x8000; c2 -= d3; d4 = ((c2 & 0xffffffff) ^ 0x80000000) - 0x80000000; - if (c2 != d4) - abort (); + gcc_assert (c2 == d4); #endif /* Construct the high word */ @@ -2511,36 +2501,7 @@ alpha_emit_conditional_branch (enum rtx_code code) if (alpha_compare.fp_p && GET_MODE (op0) == TFmode) { - if (! TARGET_HAS_XFLOATING_LIBS) - abort (); - - /* X_floating library comparison functions return - -1 unordered - 0 false - 1 true - Convert the compare against the raw return value. */ - - switch (code) - { - case UNORDERED: - cmp_code = EQ; - code = LT; - break; - case ORDERED: - cmp_code = EQ; - code = GE; - break; - case NE: - cmp_code = NE; - code = NE; - break; - default: - cmp_code = code; - code = GT; - break; - } - - op0 = alpha_emit_xfloating_compare (cmp_code, op0, op1); + op0 = alpha_emit_xfloating_compare (&code, op0, op1); op1 = const0_rtx; alpha_compare.fp_p = 0; } @@ -2577,7 +2538,7 @@ alpha_emit_conditional_branch (enum rtx_code code) break; default: - abort (); + gcc_unreachable (); } if (alpha_compare.fp_p) @@ -2676,30 +2637,9 @@ alpha_emit_setcc (enum rtx_code code) if (fp_p && GET_MODE (op0) == TFmode) { - if (! TARGET_HAS_XFLOATING_LIBS) - abort (); - - /* X_floating library comparison functions return - -1 unordered - 0 false - 1 true - Convert the compare against the raw return value. */ - - if (code == UNORDERED || code == ORDERED) - cmp_code = EQ; - else - cmp_code = code; - - op0 = alpha_emit_xfloating_compare (cmp_code, op0, op1); + op0 = alpha_emit_xfloating_compare (&code, op0, op1); op1 = const0_rtx; fp_p = 0; - - if (code == UNORDERED) - code = LT; - else if (code == ORDERED) - code = GE; - else - code = GT; } if (fp_p && !TARGET_FIX) @@ -2740,7 +2680,7 @@ alpha_emit_setcc (enum rtx_code code) break; default: - abort (); + gcc_unreachable (); } if (!fp_p) @@ -2832,7 +2772,7 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } tem = gen_reg_rtx (cmp_op_mode); @@ -2884,7 +2824,7 @@ alpha_emit_conditional_move (rtx cmp, enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } if (!fp_p) @@ -3037,6 +2977,8 @@ alpha_lookup_xfloating_lib_func (enum rtx_code code) long n = ARRAY_SIZE (xfloating_ops); long i; + gcc_assert (TARGET_HAS_XFLOATING_LIBS); + /* How irritating. Nothing to key off for the main table. */ if (TARGET_FLOAT_VAX && (code == FLOAT_EXTEND || code == FLOAT_TRUNCATE)) { @@ -3057,7 +2999,7 @@ alpha_lookup_xfloating_lib_func (enum rtx_code code) return func; } - abort(); + gcc_unreachable (); } /* Most X_floating operations take the rounding mode as an argument. @@ -3084,7 +3026,7 @@ alpha_compute_xfloating_mode_arg (enum rtx_code code, mode = 4; break; default: - abort (); + gcc_unreachable (); /* XXX For reference, round to +inf is mode = 3. */ } @@ -3132,8 +3074,7 @@ alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[], break; case VOIDmode: - if (GET_CODE (operands[i]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[i]) == CONST_INT); /* FALLTHRU */ case DImode: reg = gen_rtx_REG (DImode, regno); @@ -3141,7 +3082,7 @@ alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[], break; default: - abort (); + gcc_unreachable (); } emit_move_insn (reg, operands[i]); @@ -3160,7 +3101,7 @@ alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[], reg = gen_rtx_REG (DImode, 0); break; default: - abort (); + gcc_unreachable (); } tmp = gen_rtx_MEM (QImode, func); @@ -3198,12 +3139,44 @@ alpha_emit_xfloating_arith (enum rtx_code code, rtx operands[]) /* Emit an X_floating library function call for a comparison. */ static rtx -alpha_emit_xfloating_compare (enum rtx_code code, rtx op0, rtx op1) +alpha_emit_xfloating_compare (enum rtx_code *pcode, rtx op0, rtx op1) { - rtx func; - rtx out, operands[2]; + enum rtx_code cmp_code, res_code; + rtx func, out, operands[2]; - func = alpha_lookup_xfloating_lib_func (code); + /* X_floating library comparison functions return + -1 unordered + 0 false + 1 true + Convert the compare against the raw return value. */ + + cmp_code = *pcode; + switch (cmp_code) + { + case UNORDERED: + cmp_code = EQ; + res_code = LT; + break; + case ORDERED: + cmp_code = EQ; + res_code = GE; + break; + case NE: + res_code = NE; + break; + case EQ: + case LT: + case GT: + case LE: + case GE: + res_code = GT; + break; + default: + gcc_unreachable (); + } + *pcode = res_code; + + func = alpha_lookup_xfloating_lib_func (cmp_code); operands[0] = op0; operands[1] = op1; @@ -3212,7 +3185,7 @@ alpha_emit_xfloating_compare (enum rtx_code code, rtx op0, rtx op1) /* ??? Strange mode for equiv because what's actually returned is -1,0,1, not a proper boolean value. */ alpha_emit_xfloating_libcall (func, out, operands, 2, - gen_rtx_fmt_ee (code, CCmode, op0, op1)); + gen_rtx_fmt_ee (cmp_code, CCmode, op0, op1)); return out; } @@ -3263,33 +3236,42 @@ alpha_emit_xfloating_cvt (enum rtx_code orig_code, rtx operands[]) void alpha_split_tfmode_pair (rtx operands[4]) { - if (GET_CODE (operands[1]) == REG) + switch (GET_CODE (operands[1])) { + case REG: operands[3] = gen_rtx_REG (DImode, REGNO (operands[1]) + 1); operands[2] = gen_rtx_REG (DImode, REGNO (operands[1])); - } - else if (GET_CODE (operands[1]) == MEM) - { + break; + + case MEM: operands[3] = adjust_address (operands[1], DImode, 8); operands[2] = adjust_address (operands[1], DImode, 0); + break; + + case CONST_DOUBLE: + gcc_assert (operands[1] == CONST0_RTX (TFmode)); + operands[2] = operands[3] = const0_rtx; + break; + + default: + gcc_unreachable (); } - else if (operands[1] == CONST0_RTX (TFmode)) - operands[2] = operands[3] = const0_rtx; - else - abort (); - if (GET_CODE (operands[0]) == REG) + switch (GET_CODE (operands[0])) { + case REG: operands[1] = gen_rtx_REG (DImode, REGNO (operands[0]) + 1); operands[0] = gen_rtx_REG (DImode, REGNO (operands[0])); - } - else if (GET_CODE (operands[0]) == MEM) - { + break; + + case MEM: operands[1] = adjust_address (operands[0], DImode, 8); operands[0] = adjust_address (operands[0], DImode, 0); + break; + + default: + gcc_unreachable (); } - else - abort (); } /* Implement negtf2 or abstf2. Op0 is destination, op1 is source, @@ -3475,7 +3457,7 @@ alpha_expand_unaligned_load (rtx tgt, rtx mem, HOST_WIDE_INT size, break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_extxl_be (exth, memh, GEN_INT (size*8), addr)); } @@ -3501,7 +3483,7 @@ alpha_expand_unaligned_load (rtx tgt, rtx mem, HOST_WIDE_INT size, break; default: - abort(); + gcc_unreachable (); } } @@ -4027,8 +4009,7 @@ alpha_expand_block_move (rtx operands[]) ofs += 1; } - if (nregs > ARRAY_SIZE (data_regs)) - abort (); + gcc_assert (nregs <= ARRAY_SIZE (data_regs)); /* Now save it back out again. */ @@ -4115,16 +4096,15 @@ alpha_expand_block_move (rtx operands[]) ofs += 2; } - while (i < nregs && GET_MODE (data_regs[i]) == QImode) + /* The remainder must be byte copies. */ + while (i < nregs) { + gcc_assert (GET_MODE (data_regs[i]) == QImode); emit_move_insn (adjust_address (orig_dst, QImode, ofs), data_regs[i]); i++; ofs += 1; } - if (i != nregs) - abort (); - return 1; } @@ -4422,10 +4402,12 @@ alpha_expand_zap_mask (HOST_WIDE_INT value) result = gen_int_mode (mask, DImode); } - else if (HOST_BITS_PER_WIDE_INT == 32) + else { HOST_WIDE_INT mask_lo = 0, mask_hi = 0; + gcc_assert (HOST_BITS_PER_WIDE_INT == 32); + for (i = 7; i >= 4; --i) { mask_hi <<= 8; @@ -4442,8 +4424,6 @@ alpha_expand_zap_mask (HOST_WIDE_INT value) result = immed_double_const (mask_lo, mask_hi, DImode); } - else - abort (); return result; } @@ -4467,6 +4447,64 @@ alpha_expand_builtin_vector_binop (rtx (*gen) (rtx, rtx, rtx), emit_insn ((*gen) (op0, op1, op2)); } + +/* Expand an an atomic fetch-and-operate pattern. CODE is the binary operation + to perform. MEM is the memory on which to operate. VAL is the second + operand of the binary operator. BEFORE and AFTER are optional locations to + return the value of MEM either before of after the operation. SCRATCH is + a scratch register. */ + +void +alpha_split_atomic_op (enum rtx_code code, rtx mem, rtx val, + rtx before, rtx after, rtx scratch) +{ + enum machine_mode mode = GET_MODE (mem); + rtx label, cond, x; + rtx very_unlikely = GEN_INT (REG_BR_PROB_BASE / 100 - 1); + + emit_insn (gen_memory_barrier ()); + + label = gen_label_rtx (); + emit_label (label); + label = gen_rtx_LABEL_REF (DImode, label); + + if (before == NULL) + before = scratch; + + if (mode == SImode) + emit_insn (gen_load_locked_si (before, mem)); + else if (mode == DImode) + emit_insn (gen_load_locked_di (before, mem)); + else + gcc_unreachable (); + + if (code == NOT) + { + x = gen_rtx_NOT (mode, before); + x = gen_rtx_AND (mode, x, val); + } + else + x = gen_rtx_fmt_ee (code, mode, before, val); + + if (after) + emit_insn (gen_rtx_SET (VOIDmode, after, copy_rtx (x))); + emit_insn (gen_rtx_SET (VOIDmode, scratch, x)); + + cond = gen_rtx_REG (DImode, REGNO (scratch)); + if (mode == SImode) + emit_insn (gen_store_conditional_si (cond, mem, scratch)); + else if (mode == DImode) + emit_insn (gen_store_conditional_di (cond, mem, scratch)); + else + gcc_unreachable (); + + x = gen_rtx_EQ (DImode, cond, const0_rtx); + x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label, pc_rtx); + x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); + REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); + + emit_insn (gen_memory_barrier ()); +} /* Adjust the cost of a scheduling dependency. Return the new cost of a dependency LINK or INSN on DEP_INSN. COST is the current cost. */ @@ -4639,8 +4677,9 @@ get_trap_mode_suffix (void) case ALPHA_FPTM_SU: case ALPHA_FPTM_SUI: return "sv"; + default: + gcc_unreachable (); } - break; case TRAP_SUFFIX_V_SV_SVI: switch (alpha_fptm) @@ -4653,6 +4692,8 @@ get_trap_mode_suffix (void) return "sv"; case ALPHA_FPTM_SUI: return "svi"; + default: + gcc_unreachable (); } break; @@ -4667,10 +4708,15 @@ get_trap_mode_suffix (void) return "su"; case ALPHA_FPTM_SUI: return "sui"; + default: + gcc_unreachable (); } break; + + default: + gcc_unreachable (); } - abort (); + gcc_unreachable (); } /* Return the rounding mode suffix applicable to the current @@ -4696,13 +4742,18 @@ get_round_mode_suffix (void) return "c"; case ALPHA_FPRM_DYN: return "d"; + default: + gcc_unreachable (); } break; case ROUND_SUFFIX_C: return "c"; + + default: + gcc_unreachable (); } - abort (); + gcc_unreachable (); } /* Locate some local-dynamic symbol still in use by this function @@ -4736,7 +4787,7 @@ get_some_local_dynamic_name (void) && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } /* Print an operand. Recognize special options, documented below. */ @@ -5145,46 +5196,56 @@ print_operand_address (FILE *file, rtx addr) fprintf (file, "+" HOST_WIDE_INT_PRINT_DEC, offset); addr = XEXP (addr, 0); - if (GET_CODE (addr) == REG) - basereg = REGNO (addr); - else if (GET_CODE (addr) == SUBREG - && GET_CODE (SUBREG_REG (addr)) == REG) - basereg = subreg_regno (addr); - else - abort (); + switch (GET_CODE (addr)) + { + case REG: + basereg = REGNO (addr); + break; + + case SUBREG: + basereg = subreg_regno (addr); + break; + + default: + gcc_unreachable (); + } fprintf (file, "($%d)\t\t!%s", basereg, (basereg == 29 ? reloc16 : reloclo)); return; } - if (GET_CODE (addr) == REG) - basereg = REGNO (addr); - else if (GET_CODE (addr) == SUBREG - && GET_CODE (SUBREG_REG (addr)) == REG) - basereg = subreg_regno (addr); - else if (GET_CODE (addr) == CONST_INT) - offset = INTVAL (addr); + switch (GET_CODE (addr)) + { + case REG: + basereg = REGNO (addr); + break; + + case SUBREG: + basereg = subreg_regno (addr); + break; + + case CONST_INT: + offset = INTVAL (addr); + break; #if TARGET_ABI_OPEN_VMS - else if (GET_CODE (addr) == SYMBOL_REF) - { + case SYMBOL_REF: fprintf (file, "%s", XSTR (addr, 0)); return; - } - else if (GET_CODE (addr) == CONST - && GET_CODE (XEXP (addr, 0)) == PLUS - && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF) - { + + case CONST: + gcc_assert (GET_CODE (XEXP (addr, 0)) == PLUS + && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF); fprintf (file, "%s+" HOST_WIDE_INT_PRINT_DEC, XSTR (XEXP (XEXP (addr, 0), 0), 0), INTVAL (XEXP (XEXP (addr, 0), 1))); return; - } + #endif - - else - abort (); + default: + gcc_unreachable (); + } fprintf (file, HOST_WIDE_INT_PRINT_DEC "($%d)", offset, basereg); } @@ -5283,8 +5344,7 @@ function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode, tree type, #ifdef ENABLE_CHECKING /* With alpha_split_complex_arg, we shouldn't see any raw complex values here. */ - if (COMPLEX_MODE_P (mode)) - abort (); + gcc_assert (!COMPLEX_MODE_P (mode)); #endif /* Set up defaults for FP operands passed in FP registers, and @@ -5454,8 +5514,9 @@ alpha_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED) default: /* ??? We get called on all sorts of random stuff from - aggregate_value_p. We can't abort, but it's not clear - what's safe to return. Pretend it's a struct I guess. */ + aggregate_value_p. We must return something, but it's not + clear what's safe to return. Pretend it's a struct I + guess. */ return true; } @@ -5489,10 +5550,7 @@ function_value (tree valtype, tree func ATTRIBUTE_UNUSED, unsigned int regnum, dummy; enum mode_class class; -#ifdef ENABLE_CHECKING - if (valtype && alpha_return_in_memory (valtype, func)) - abort (); -#endif + gcc_assert (!valtype || !alpha_return_in_memory (valtype, func)); if (valtype) mode = TYPE_MODE (valtype); @@ -5527,7 +5585,7 @@ function_value (tree valtype, tree func ATTRIBUTE_UNUSED, } default: - abort (); + gcc_unreachable (); } return gen_rtx_REG (mode, regnum); @@ -5576,29 +5634,184 @@ alpha_build_builtin_va_list (void) TYPE_FIELDS (record) = base; layout_type (record); + va_list_gpr_counter_field = ofs; return record; } +#if TARGET_ABI_OSF +/* Helper function for alpha_stdarg_optimize_hook. Skip over casts + and constant additions. */ + +static tree +va_list_skip_additions (tree lhs) +{ + tree rhs, stmt; + + if (TREE_CODE (lhs) != SSA_NAME) + return lhs; + + for (;;) + { + stmt = SSA_NAME_DEF_STMT (lhs); + + if (TREE_CODE (stmt) == PHI_NODE) + return stmt; + + if (TREE_CODE (stmt) != MODIFY_EXPR + || TREE_OPERAND (stmt, 0) != lhs) + return lhs; + + rhs = TREE_OPERAND (stmt, 1); + if (TREE_CODE (rhs) == WITH_SIZE_EXPR) + rhs = TREE_OPERAND (rhs, 0); + + if ((TREE_CODE (rhs) != NOP_EXPR + && TREE_CODE (rhs) != CONVERT_EXPR + && (TREE_CODE (rhs) != PLUS_EXPR + || TREE_CODE (TREE_OPERAND (rhs, 1)) != INTEGER_CST + || !host_integerp (TREE_OPERAND (rhs, 1), 1))) + || TREE_CODE (TREE_OPERAND (rhs, 0)) != SSA_NAME) + return rhs; + + lhs = TREE_OPERAND (rhs, 0); + } +} + +/* Check if LHS = RHS statement is + LHS = *(ap.__base + ap.__offset + cst) + or + LHS = *(ap.__base + + ((ap.__offset + cst <= 47) + ? ap.__offset + cst - 48 : ap.__offset + cst) + cst2). + If the former, indicate that GPR registers are needed, + if the latter, indicate that FPR registers are needed. + On alpha, cfun->va_list_gpr_size is used as size of the needed + regs and cfun->va_list_fpr_size is a bitmask, bit 0 set if + GPR registers are needed and bit 1 set if FPR registers are needed. + Return true if va_list references should not be scanned for the current + statement. */ + +static bool +alpha_stdarg_optimize_hook (struct stdarg_info *si, tree lhs, tree rhs) +{ + tree base, offset, arg1, arg2; + int offset_arg = 1; + + if (TREE_CODE (rhs) != INDIRECT_REF + || TREE_CODE (TREE_OPERAND (rhs, 0)) != SSA_NAME) + return false; + + lhs = va_list_skip_additions (TREE_OPERAND (rhs, 0)); + if (lhs == NULL_TREE + || TREE_CODE (lhs) != PLUS_EXPR) + return false; + + base = TREE_OPERAND (lhs, 0); + if (TREE_CODE (base) == SSA_NAME) + base = va_list_skip_additions (base); + + if (TREE_CODE (base) != COMPONENT_REF + || TREE_OPERAND (base, 1) != TYPE_FIELDS (va_list_type_node)) + { + base = TREE_OPERAND (lhs, 0); + if (TREE_CODE (base) == SSA_NAME) + base = va_list_skip_additions (base); + + if (TREE_CODE (base) != COMPONENT_REF + || TREE_OPERAND (base, 1) != TYPE_FIELDS (va_list_type_node)) + return false; + + offset_arg = 0; + } + + base = get_base_address (base); + if (TREE_CODE (base) != VAR_DECL + || !bitmap_bit_p (si->va_list_vars, var_ann (base)->uid)) + return false; + + offset = TREE_OPERAND (lhs, offset_arg); + if (TREE_CODE (offset) == SSA_NAME) + offset = va_list_skip_additions (offset); + + if (TREE_CODE (offset) == PHI_NODE) + { + HOST_WIDE_INT sub; + + if (PHI_NUM_ARGS (offset) != 2) + goto escapes; + + arg1 = va_list_skip_additions (PHI_ARG_DEF (offset, 0)); + arg2 = va_list_skip_additions (PHI_ARG_DEF (offset, 1)); + if (TREE_CODE (arg2) != MINUS_EXPR && TREE_CODE (arg2) != PLUS_EXPR) + { + tree tem = arg1; + arg1 = arg2; + arg2 = tem; + + if (TREE_CODE (arg2) != MINUS_EXPR && TREE_CODE (arg2) != PLUS_EXPR) + goto escapes; + } + if (!host_integerp (TREE_OPERAND (arg2, 1), 0)) + goto escapes; + + sub = tree_low_cst (TREE_OPERAND (arg2, 1), 0); + if (TREE_CODE (arg2) == MINUS_EXPR) + sub = -sub; + if (sub < -48 || sub > -32) + goto escapes; + + arg2 = va_list_skip_additions (TREE_OPERAND (arg2, 0)); + if (arg1 != arg2) + goto escapes; + + if (TREE_CODE (arg1) == SSA_NAME) + arg1 = va_list_skip_additions (arg1); + + if (TREE_CODE (arg1) != COMPONENT_REF + || TREE_OPERAND (arg1, 1) != va_list_gpr_counter_field + || get_base_address (arg1) != base) + goto escapes; + + /* Need floating point regs. */ + cfun->va_list_fpr_size |= 2; + } + else if (TREE_CODE (offset) != COMPONENT_REF + || TREE_OPERAND (offset, 1) != va_list_gpr_counter_field + || get_base_address (offset) != base) + goto escapes; + else + /* Need general regs. */ + cfun->va_list_fpr_size |= 1; + return false; + +escapes: + si->va_list_escapes = true; + return false; +} +#endif + /* Perform any needed actions needed for a function that is receiving a variable number of arguments. */ static void -alpha_setup_incoming_varargs (CUMULATIVE_ARGS *pcum, - enum machine_mode mode ATTRIBUTE_UNUSED, - tree type ATTRIBUTE_UNUSED, - int *pretend_size, int no_rtl) +alpha_setup_incoming_varargs (CUMULATIVE_ARGS *pcum, enum machine_mode mode, + tree type, int *pretend_size, int no_rtl) { + CUMULATIVE_ARGS cum = *pcum; + + /* Skip the current argument. */ + FUNCTION_ARG_ADVANCE (cum, mode, type, 1); + #if TARGET_ABI_UNICOSMK /* On Unicos/Mk, the standard subroutine __T3E_MISMATCH stores all register arguments on the stack. Unfortunately, it doesn't always store the first one (i.e. the one that arrives in $16 or $f16). This is not a problem with stdargs as we always have at least one named argument there. */ - int num_reg_words = pcum->num_reg_words; - if (num_reg_words < 6) + if (cum.num_reg_words < 6) { if (!no_rtl) { - emit_insn (gen_umk_mismatch_args (GEN_INT (num_reg_words + 1))); + emit_insn (gen_umk_mismatch_args (GEN_INT (cum.num_reg_words))); emit_insn (gen_arg_home_umk ()); } *pretend_size = 0; @@ -5610,7 +5823,7 @@ alpha_setup_incoming_varargs (CUMULATIVE_ARGS *pcum, This is not only because we won't need the space, but because AP includes the current_pretend_args_size and we don't want to mess up any ap-relative addresses already made. */ - if (pcum->num_args < 6) + if (cum.num_args < 6) { if (!no_rtl) { @@ -5631,28 +5844,42 @@ alpha_setup_incoming_varargs (CUMULATIVE_ARGS *pcum, not the most efficient way to implement varargs with just one register class, but it isn't worth doing anything more efficient in this rare case. */ - CUMULATIVE_ARGS cum = *pcum; - if (cum >= 6) return; if (!no_rtl) { - int set = get_varargs_alias_set (); + int count, set = get_varargs_alias_set (); rtx tmp; - tmp = gen_rtx_MEM (BLKmode, - plus_constant (virtual_incoming_args_rtx, - (cum + 6) * UNITS_PER_WORD)); - set_mem_alias_set (tmp, set); - move_block_from_reg (16 + cum, tmp, 6 - cum); - - tmp = gen_rtx_MEM (BLKmode, - plus_constant (virtual_incoming_args_rtx, - cum * UNITS_PER_WORD)); - set_mem_alias_set (tmp, set); - move_block_from_reg (16 + (TARGET_FPREGS ? 32 : 0) + cum, tmp, - 6 - cum); + count = cfun->va_list_gpr_size / UNITS_PER_WORD; + if (count > 6 - cum) + count = 6 - cum; + + /* Detect whether integer registers or floating-point registers + are needed by the detected va_arg statements. See above for + how these values are computed. Note that the "escape" value + is VA_LIST_MAX_FPR_SIZE, which is 255, which has both of + these bits set. */ + gcc_assert ((VA_LIST_MAX_FPR_SIZE & 3) == 3); + + if (cfun->va_list_fpr_size & 1) + { + tmp = gen_rtx_MEM (BLKmode, + plus_constant (virtual_incoming_args_rtx, + (cum + 6) * UNITS_PER_WORD)); + set_mem_alias_set (tmp, set); + move_block_from_reg (16 + cum, tmp, count); + } + + if (cfun->va_list_fpr_size & 2) + { + tmp = gen_rtx_MEM (BLKmode, + plus_constant (virtual_incoming_args_rtx, + cum * UNITS_PER_WORD)); + set_mem_alias_set (tmp, set); + move_block_from_reg (16 + cum + TARGET_FPREGS*32, tmp, count); + } } *pretend_size = 12 * UNITS_PER_WORD; #endif @@ -5682,7 +5909,7 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) integer argument register; that futzes with pretend_args_size, which changes the meaning of AP. */ - if (NUM_ARGS <= 6) + if (NUM_ARGS < 6) offset = TARGET_ABI_OPEN_VMS ? UNITS_PER_WORD : 6 * UNITS_PER_WORD; else offset = -6 * UNITS_PER_WORD + current_function_pretend_args_size; @@ -6139,7 +6366,7 @@ alpha_expand_builtin (tree exp, rtx target, pat = GEN_FCN (icode) (target, op[0], op[1]); break; default: - abort (); + gcc_unreachable (); } if (!pat) return NULL_RTX; @@ -6499,14 +6726,13 @@ alpha_fold_builtin_ctpop (unsigned HOST_WIDE_INT opint[], long op_const) /* Fold one of our builtin functions. */ static tree -alpha_fold_builtin (tree exp, bool ignore ATTRIBUTE_UNUSED) +alpha_fold_builtin (tree fndecl, tree arglist, bool ignore ATTRIBUTE_UNUSED) { - tree fndecl = get_callee_fndecl (exp); tree op[MAX_ARGS], t; unsigned HOST_WIDE_INT opint[MAX_ARGS]; long op_const = 0, arity = 0; - for (t = TREE_OPERAND (exp, 1); t ; t = TREE_CHAIN (t), ++arity) + for (t = arglist; t ; t = TREE_CHAIN (t), ++arity) { tree arg = TREE_VALUE (t); if (arg == error_mark_node) @@ -6824,14 +7050,20 @@ alpha_initial_elimination_offset (unsigned int from, ret = alpha_sa_size (); ret += ALPHA_ROUND (current_function_outgoing_args_size); - if (from == FRAME_POINTER_REGNUM) - ; - else if (from == ARG_POINTER_REGNUM) - ret += (ALPHA_ROUND (get_frame_size () - + current_function_pretend_args_size) - - current_function_pretend_args_size); - else - abort (); + switch (from) + { + case FRAME_POINTER_REGNUM: + break; + + case ARG_POINTER_REGNUM: + ret += (ALPHA_ROUND (get_frame_size () + + current_function_pretend_args_size) + - current_function_pretend_args_size); + break; + + default: + gcc_unreachable (); + } return ret; } @@ -7729,8 +7961,7 @@ alpha_expand_epilogue (void) so build it up by pieces. */ FRP (sp_adj2 = alpha_emit_set_long_const (tmp, frame_size, -(frame_size < 0))); - if (!sp_adj2) - abort (); + gcc_assert (sp_adj2); } } @@ -7912,7 +8143,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, insn_locators_initialize (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); } #endif /* TARGET_ABI_OSF */ @@ -8106,7 +8337,7 @@ summarize_insn (rtx x, struct shadow_summary *sum, int set) break; default: - abort (); + gcc_unreachable (); } } } @@ -8204,7 +8435,7 @@ alpha_handle_trap_shadows (void) switch (GET_CODE (i)) { case INSN: - /* Annoyingly, get_attr_trap will abort on these. */ + /* Annoyingly, get_attr_trap will die on these. */ if (GET_CODE (PATTERN (i)) == USE || GET_CODE (PATTERN (i)) == CLOBBER) break; @@ -8231,10 +8462,9 @@ alpha_handle_trap_shadows (void) || (sum.defd.mem & shadow.used.mem)) { /* (a) would be violated (also takes care of (b)) */ - if (get_attr_trap (i) == TRAP_YES - && ((sum.defd.i & sum.used.i) - || (sum.defd.fp & sum.used.fp))) - abort (); + gcc_assert (get_attr_trap (i) != TRAP_YES + || (!(sum.defd.i & sum.used.i) + && !(sum.defd.fp & sum.used.fp))); goto close_shadow; } @@ -8246,7 +8476,7 @@ alpha_handle_trap_shadows (void) goto close_shadow; default: - abort (); + gcc_unreachable (); } } else @@ -8309,21 +8539,22 @@ alphaev4_insn_pipe (rtx insn) switch (get_attr_type (insn)) { case TYPE_ILD: + case TYPE_LDSYM: case TYPE_FLD: + case TYPE_LD_L: return EV4_IBX; - case TYPE_LDSYM: case TYPE_IADD: case TYPE_ILOG: case TYPE_ICMOV: case TYPE_ICMP: - case TYPE_IST: case TYPE_FST: case TYPE_SHIFT: case TYPE_IMUL: case TYPE_FBR: return EV4_IB0; + case TYPE_IST: case TYPE_MISC: case TYPE_IBR: case TYPE_JSR: @@ -8333,10 +8564,12 @@ alphaev4_insn_pipe (rtx insn) case TYPE_FADD: case TYPE_FDIV: case TYPE_FMUL: + case TYPE_ST_C: + case TYPE_MB: return EV4_IB1; default: - abort (); + gcc_unreachable (); } } @@ -8365,6 +8598,9 @@ alphaev5_insn_pipe (rtx insn) case TYPE_IMUL: case TYPE_MISC: case TYPE_MVI: + case TYPE_LD_L: + case TYPE_ST_C: + case TYPE_MB: return EV5_E0; case TYPE_IBR: @@ -8385,7 +8621,7 @@ alphaev5_insn_pipe (rtx insn) return EV5_FM; default: - abort(); + gcc_unreachable (); } } @@ -8419,7 +8655,7 @@ alphaev4_next_group (rtx insn, int *pin_use, int *plen) if (in_use) goto done; - /* If this is a completely unrecognized insn, its an asm. + /* If this is a completely unrecognized insn, it's an asm. We don't know how long it is, so record length as -1 to signal a needed realignment. */ if (recog_memoized (insn) < 0) @@ -8456,7 +8692,7 @@ alphaev4_next_group (rtx insn, int *pin_use, int *plen) break; default: - abort(); + gcc_unreachable (); } len += 4; @@ -8517,7 +8753,7 @@ alphaev5_next_group (rtx insn, int *pin_use, int *plen) if (in_use) goto done; - /* If this is a completely unrecognized insn, its an asm. + /* If this is a completely unrecognized insn, it's an asm. We don't know how long it is, so record length as -1 to signal a needed realignment. */ if (recog_memoized (insn) < 0) @@ -8526,11 +8762,11 @@ alphaev5_next_group (rtx insn, int *pin_use, int *plen) len = get_attr_length (insn); goto next_and_done; - /* ??? Most of the places below, we would like to abort, as - it would indicate an error either in Haifa, or in the - scheduling description. Unfortunately, Haifa never - schedules the last instruction of the BB, so we don't - have an accurate TI bit to go off. */ + /* ??? Most of the places below, we would like to assert never + happen, as it would indicate an error either in Haifa, or + in the scheduling description. Unfortunately, Haifa never + schedules the last instruction of the BB, so we don't have + an accurate TI bit to go off. */ case EV5_E01: if (in_use & EV5_E0) { @@ -8585,7 +8821,7 @@ alphaev5_next_group (rtx insn, int *pin_use, int *plen) break; default: - abort(); + gcc_unreachable (); } len += 4; @@ -8720,8 +8956,7 @@ alpha_align_insns (unsigned int max_align, else if (ofs & (new_align-1)) ofs = (ofs | (new_align-1)) + 1; - if (len != 0) - abort(); + gcc_assert (!len); } /* Handle complex instructions special. */ @@ -9308,7 +9543,7 @@ unicosmk_initial_elimination_offset (int from, int to) + ALPHA_ROUND (get_frame_size() + current_function_outgoing_args_size)); else - abort (); + gcc_unreachable (); } /* Output the module name for .ident and .end directives. We have to strip @@ -9392,8 +9627,7 @@ unicosmk_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED) const char *name; int len; - if (!decl) - abort (); + gcc_assert (decl); name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); name = default_strip_name_encoding (name); @@ -9543,11 +9777,9 @@ unicosmk_ssib_name (void) int len; x = DECL_RTL (cfun->decl); - if (GET_CODE (x) != MEM) - abort (); + gcc_assert (GET_CODE (x) == MEM); x = XEXP (x, 0); - if (GET_CODE (x) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (x) == SYMBOL_REF); fnname = XSTR (x, 0); len = strlen (fnname); @@ -10153,6 +10385,8 @@ alpha_init_libfuncs (void) #define TARGET_ASM_OUTPUT_MI_THUNK alpha_output_mi_thunk_osf #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true +#undef TARGET_STDARG_OPTIMIZE_HOOK +#define TARGET_STDARG_OPTIMIZE_HOOK alpha_stdarg_optimize_hook #endif #undef TARGET_RTX_COSTS diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h index 780cf4af20d..8d2974574a1 100644 --- a/gcc/config/alpha/alpha.h +++ b/gcc/config/alpha/alpha.h @@ -394,9 +394,6 @@ extern int alpha_tls_size; #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1 -/* Our SIMD is all done on single integer registers. */ -#define UNITS_PER_SIMD_WORD UNITS_PER_WORD - /* Standard register usage. */ /* Number of actual hardware registers. @@ -1372,7 +1369,7 @@ do { \ /* This is how to output an element of a case-vector that is absolute. (Alpha does not use such vectors, but we must define this macro anyway.) */ -#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) abort () +#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) gcc_unreachable () /* This is how to output an element of a case-vector that is relative. */ diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md index 208161ba9b7..def77b4efee 100644 --- a/gcc/config/alpha/alpha.md +++ b/gcc/config/alpha/alpha.md @@ -76,6 +76,12 @@ (UNSPECV_SET_TP 12) (UNSPECV_RPCC 13) (UNSPECV_SETJMPR_ER 14) ; builtin_setjmp_receiver fragment + (UNSPECV_MB 15) + (UNSPECV_LL 16) ; load-locked + (UNSPECV_SC 17) ; store-conditional + (UNSPECV_ATOMIC 18) + (UNSPECV_CMPXCHG 19) + (UNSPECV_XCHG 20) ]) ;; Where necessary, the suffixes _le and _be are used to distinguish between @@ -97,7 +103,8 @@ (define_attr "type" "ild,fld,ldsym,ist,fst,ibr,callpal,fbr,jsr,iadd,ilog,shift,icmov,fcmov, - icmp,imul,fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none" + icmp,imul,fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,mb,ld_l,st_c, + multi,none" (const_string "iadd")) ;; Describe a user's asm statement. @@ -996,7 +1003,7 @@ str = "__remlu"; break; default: - abort (); + gcc_unreachable (); } operands[4] = GEN_INT (alpha_next_sequence_number++); emit_insn (gen_movdi_er_high_g (operands[0], pic_offset_table_rtx, @@ -1064,7 +1071,7 @@ str = "__remqu"; break; default: - abort (); + gcc_unreachable (); } operands[4] = GEN_INT (alpha_next_sequence_number++); emit_insn (gen_movdi_er_high_g (operands[0], pic_offset_table_rtx, @@ -1100,7 +1107,20 @@ [(set_attr "type" "jsr") (set_attr "length" "8")]) -;; Next are the basic logical operations. These only exist in DImode. +;; Next are the basic logical operations. We only expose the DImode operations +;; to the rtl expanders, but SImode versions exist for combine as well as for +;; the atomic operation splitters. + +(define_insn "*andsi_internal" + [(set (match_operand:SI 0 "register_operand" "=r,r,r") + (and:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ,rJ") + (match_operand:SI 2 "and_operand" "rI,N,MH")))] + "" + "@ + and %r1,%2,%0 + bic %r1,%N2,%0 + zapnot %r1,%m2,%0" + [(set_attr "type" "ilog,ilog,shift")]) (define_insn "anddi3" [(set (match_operand:DI 0 "register_operand" "=r,r,r") @@ -1275,6 +1295,14 @@ "zapnot %1,15,%0" [(set_attr "type" "shift")]) +(define_insn "*andnotsi3" + [(set (match_operand:SI 0 "register_operand" "=r") + (and:SI (not:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")) + (match_operand:SI 2 "reg_or_0_operand" "rJ")))] + "" + "bic %r2,%1,%0" + [(set_attr "type" "ilog")]) + (define_insn "andnotdi3" [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")) @@ -1283,6 +1311,16 @@ "bic %r2,%1,%0" [(set_attr "type" "ilog")]) +(define_insn "*iorsi_internal" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (ior:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ") + (match_operand:SI 2 "or_operand" "rI,N")))] + "" + "@ + bis %r1,%2,%0 + ornot %r1,%N2,%0" + [(set_attr "type" "ilog")]) + (define_insn "iordi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (ior:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") @@ -1293,6 +1331,13 @@ ornot %r1,%N2,%0" [(set_attr "type" "ilog")]) +(define_insn "*one_cmplsi_internal" + [(set (match_operand:SI 0 "register_operand" "=r") + (not:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")))] + "" + "ornot $31,%1,%0" + [(set_attr "type" "ilog")]) + (define_insn "one_cmpldi2" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")))] @@ -1300,7 +1345,15 @@ "ornot $31,%1,%0" [(set_attr "type" "ilog")]) -(define_insn "*iornot" +(define_insn "*iornotsi3" + [(set (match_operand:SI 0 "register_operand" "=r") + (ior:SI (not:SI (match_operand:SI 1 "reg_or_8bit_operand" "rI")) + (match_operand:SI 2 "reg_or_0_operand" "rJ")))] + "" + "ornot %r2,%1,%0" + [(set_attr "type" "ilog")]) + +(define_insn "*iornotdi3" [(set (match_operand:DI 0 "register_operand" "=r") (ior:DI (not:DI (match_operand:DI 1 "reg_or_8bit_operand" "rI")) (match_operand:DI 2 "reg_or_0_operand" "rJ")))] @@ -1308,6 +1361,16 @@ "ornot %r2,%1,%0" [(set_attr "type" "ilog")]) +(define_insn "*xorsi_internal" + [(set (match_operand:SI 0 "register_operand" "=r,r") + (xor:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ,rJ") + (match_operand:SI 2 "or_operand" "rI,N")))] + "" + "@ + xor %r1,%2,%0 + eqv %r1,%N2,%0" + [(set_attr "type" "ilog")]) + (define_insn "xordi3" [(set (match_operand:DI 0 "register_operand" "=r,r") (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ,rJ") @@ -1318,7 +1381,15 @@ eqv %r1,%N2,%0" [(set_attr "type" "ilog")]) -(define_insn "*xornot" +(define_insn "*xornotsi3" + [(set (match_operand:SI 0 "register_operand" "=r") + (not:SI (xor:SI (match_operand:SI 1 "register_operand" "%rJ") + (match_operand:SI 2 "register_operand" "rI"))))] + "" + "eqv %r1,%2,%0" + [(set_attr "type" "ilog")]) + +(define_insn "*xornotdi3" [(set (match_operand:DI 0 "register_operand" "=r") (not:DI (xor:DI (match_operand:DI 1 "register_operand" "%rJ") (match_operand:DI 2 "register_operand" "rI"))))] @@ -1381,7 +1452,7 @@ case 1: return "sll %r1,%2,%0"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "iadd,shift")]) @@ -2053,7 +2124,7 @@ == (unsigned HOST_WIDE_INT) INTVAL (operands[3])) return "insll %1,%s2,%0"; #endif - abort(); + gcc_unreachable (); } [(set_attr "type" "shift")]) @@ -4426,8 +4497,7 @@ (unspec [(reg:DI 29)] UNSPEC_SIBCALL)])] "TARGET_ABI_OSF" { - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); operands[0] = XEXP (operands[0], 0); }) @@ -4438,8 +4508,7 @@ (clobber (reg:DI 26))])] "" { - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); operands[0] = XEXP (operands[0], 0); if (! call_operand (operands[0], Pmode)) @@ -4452,8 +4521,7 @@ (clobber (reg:DI 26))])] "" { - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); operands[0] = XEXP (operands[0], 0); if (GET_CODE (operands[0]) != SYMBOL_REF && GET_CODE (operands[0]) != REG) @@ -4471,8 +4539,7 @@ (clobber (reg:DI 26))])] "" { - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); /* Always load the address of the called function into a register; load the CIW in $25. */ @@ -4498,8 +4565,7 @@ (clobber (reg:DI 27))])] "" { - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); operands[0] = XEXP (operands[0], 0); @@ -4552,8 +4618,7 @@ (unspec [(reg:DI 29)] UNSPEC_SIBCALL)])] "TARGET_ABI_OSF" { - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); operands[1] = XEXP (operands[1], 0); }) @@ -4565,8 +4630,7 @@ (clobber (reg:DI 26))])] "" { - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); operands[1] = XEXP (operands[1], 0); if (! call_operand (operands[1], Pmode)) @@ -4580,8 +4644,7 @@ (clobber (reg:DI 26))])] "" { - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); operands[1] = XEXP (operands[1], 0); if (GET_CODE (operands[1]) != SYMBOL_REF && GET_CODE (operands[1]) != REG) @@ -4598,8 +4661,7 @@ (clobber (reg:DI 27))])] "" { - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); operands[1] = XEXP (operands[1], 0); @@ -4630,8 +4692,7 @@ (clobber (reg:DI 26))])] "" { - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); operands[1] = XEXP (operands[1], 0); if (GET_CODE (operands[1]) != REG) @@ -4831,7 +4892,7 @@ operands [3] = alpha_use_linkage (operands [0], cfun->decl, 0, 0); return "ldq $26,%3\;ldq $27,%2\;jsr $26,%0\;ldq $27,0($29)"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "jsr") @@ -5568,7 +5629,7 @@ ;; VMS needs to set up "vms_base_regno" for unwinding. This move ;; often appears dead to the life analysis code, at which point we -;; abort for emitting dead prologue instructions. Force this live. +;; die for emitting dead prologue instructions. Force this live. (define_insn "force_movdi" [(set (match_operand:DI 0 "register_operand" "=r") @@ -6485,7 +6546,7 @@ case 1: return "lda $16,%0\;lda $17,%2($31)\;lda $18,%1\;ldq $26,%5\;lda $25,3($31)\;jsr $26,%4\;ldq $27,0($29)"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "multi") @@ -6542,7 +6603,7 @@ case 1: return "lda $16,%0\;lda $17,%1($31)\;ldq $26,%4\;lda $25,2($31)\;jsr $26,%3\;ldq $27,0($29)"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "multi") @@ -7705,6 +7766,8 @@ "unpkbw %r1,%0" [(set_attr "type" "mvi")]) +(include "sync.md") + ;; The call patterns are at the end of the file because their ;; wildcard operand0 interferes with nice recognition. @@ -7963,7 +8026,7 @@ operands [4] = alpha_use_linkage (operands [1], cfun->decl, 0, 0); return "ldq $26,%4\;ldq $27,%3\;jsr $26,%1\;ldq $27,0($29)"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "jsr") diff --git a/gcc/config/alpha/ev4.md b/gcc/config/alpha/ev4.md index 08fb9cda31a..52f25561c56 100644 --- a/gcc/config/alpha/ev4.md +++ b/gcc/config/alpha/ev4.md @@ -1,5 +1,5 @@ ;; Scheduling description for Alpha EV4. -;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -39,7 +39,7 @@ ; in user-specified memory latency, so return 1 here. (define_insn_reservation "ev4_ld" 1 (and (eq_attr "tune" "ev4") - (eq_attr "type" "ild,fld,ldsym")) + (eq_attr "type" "ild,fld,ldsym,ld_l")) "ev4_ib01+ev4_abox") ; Stores can issue before the data (but not address) is ready. @@ -48,11 +48,26 @@ (eq_attr "type" "ist")) "ev4_ib1+ev4_abox") +; ??? Separate from ev4_ist because store_data_bypass_p can't handle +; the patterns with multiple sets, like store-conditional. +(define_insn_reservation "ev4_ist_c" 1 + (and (eq_attr "tune" "ev4") + (eq_attr "type" "st_c")) + "ev4_ib1+ev4_abox") + (define_insn_reservation "ev4_fst" 1 (and (eq_attr "tune" "ev4") (eq_attr "type" "fst")) "ev4_ib0+ev4_abox") +; Memory barrier blocks ABOX insns until it's acknowledged by the external +; memory bus. This may be *quite* slow. Setting this to 4 cycles gets +; about all the benefit without making the DFA too large. +(define_insn_reservation "ev4_mb" 4 + (and (eq_attr "tune" "ev4") + (eq_attr "type" "mb")) + "ev4_ib1+ev4_abox,ev4_abox*3") + ; Branches have no delay cost, but do tie up the unit for two cycles. (define_insn_reservation "ev4_ibr" 2 (and (eq_attr "tune" "ev4") diff --git a/gcc/config/alpha/ev5.md b/gcc/config/alpha/ev5.md index ec7bf4b9ca1..b61cfe8e8f0 100644 --- a/gcc/config/alpha/ev5.md +++ b/gcc/config/alpha/ev5.md @@ -1,5 +1,5 @@ ;; Scheduling description for Alpha EV5. -;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -43,7 +43,7 @@ (define_insn_reservation "ev5_st" 1 (and (eq_attr "tune" "ev5") - (eq_attr "type" "ist,fst")) + (eq_attr "type" "ist,fst,st_c,mb")) "ev5_e0+ev5_st") ; Loads from L0 complete in two cycles. adjust_cost still factors @@ -53,6 +53,11 @@ (eq_attr "type" "ild,fld,ldsym")) "ev5_e01+ev5_ld") +(define_insn_reservation "ev5_ld_l" 1 + (and (eq_attr "tune" "ev5") + (eq_attr "type" "ld_l")) + "ev5_e0+ev5_ld") + ; Integer branches slot only to E1. (define_insn_reservation "ev5_ibr" 1 (and (eq_attr "tune" "ev5") @@ -129,7 +134,7 @@ ; Model this instead with increased latency on the input instruction. (define_bypass 3 - "ev5_ld,ev5_shift,ev5_mvi,ev5_cmov,ev5_iadd,ev5_ilogcmp" + "ev5_ld,ev5_ld_l,ev5_shift,ev5_mvi,ev5_cmov,ev5_iadd,ev5_ilogcmp" "ev5_imull,ev5_imulq,ev5_imulh") (define_bypass 9 "ev5_imull" "ev5_imull,ev5_imulq,ev5_imulh") diff --git a/gcc/config/alpha/ev6.md b/gcc/config/alpha/ev6.md index 9b63dd46f51..6ddadca54f2 100644 --- a/gcc/config/alpha/ev6.md +++ b/gcc/config/alpha/ev6.md @@ -1,5 +1,5 @@ ;; Scheduling description for Alpha EV6. -;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; @@ -53,14 +53,19 @@ ; adjust_cost still factors in user-specified memory latency, so return 1 here. (define_insn_reservation "ev6_ild" 1 (and (eq_attr "tune" "ev6") - (eq_attr "type" "ild,ldsym")) + (eq_attr "type" "ild,ldsym,ld_l")) "ev6_l") (define_insn_reservation "ev6_ist" 1 (and (eq_attr "tune" "ev6") - (eq_attr "type" "ist")) + (eq_attr "type" "ist,st_c")) "ev6_l") +(define_insn_reservation "ev6_mb" 1 + (and (eq_attr "tune" "ev6") + (eq_attr "type" "mb")) + "ev6_l1") + ; FP loads take at least 4 clocks. adjust_cost still factors ; in user-specified memory latency, so return 2 here. (define_insn_reservation "ev6_fld" 2 diff --git a/gcc/config/alpha/freebsd.h b/gcc/config/alpha/freebsd.h index 86aec3648fa..d36bf3318cd 100644 --- a/gcc/config/alpha/freebsd.h +++ b/gcc/config/alpha/freebsd.h @@ -1,5 +1,5 @@ /* Definitions for DEC Alpha/AXP running FreeBSD using the ELF format - Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by David E. O'Brien and BSDi. This file is part of GCC. diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h index 401406728ba..f9779430787 100644 --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for Alpha Linux-based GNU systems. - Copyright (C) 1996, 1997, 1998, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Richard Henderson. diff --git a/gcc/config/alpha/netbsd.h b/gcc/config/alpha/netbsd.h index 338f818b332..1ebe99ba102 100644 --- a/gcc/config/alpha/netbsd.h +++ b/gcc/config/alpha/netbsd.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for Alpha NetBSD systems. - Copyright (C) 1998, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/config/alpha/osf5.h b/gcc/config/alpha/osf5.h index 5da75988af0..e50521798e4 100644 --- a/gcc/config/alpha/osf5.h +++ b/gcc/config/alpha/osf5.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for DEC Alpha on Tru64 5. - Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/config/alpha/predicates.md b/gcc/config/alpha/predicates.md index 9ee22c299cc..fe7b0a38b1e 100644 --- a/gcc/config/alpha/predicates.md +++ b/gcc/config/alpha/predicates.md @@ -231,7 +231,7 @@ return add_operand (op, mode); default: - abort (); + gcc_unreachable (); } return 0; }) @@ -506,7 +506,7 @@ ;; Returns 1 if OP is not an eliminable register. ;; -;; This exists to cure a pathological abort in the s8addq (et al) patterns, +;; This exists to cure a pathological failure in the s8addq (et al) patterns, ;; ;; long foo () { long t; bar(); return (long) &t * 26107; } ;; diff --git a/gcc/config/alpha/sync.md b/gcc/config/alpha/sync.md new file mode 100644 index 00000000000..8f67a4e255d --- /dev/null +++ b/gcc/config/alpha/sync.md @@ -0,0 +1,312 @@ +;; GCC machine description for Alpha synchronization instructions. +;; Copyright (C) 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. + +(define_mode_macro I48MODE [SI DI]) +(define_mode_attr modesuffix [(SI "l") (DI "q")]) + +(define_code_macro FETCHOP [plus minus ior xor and]) +(define_code_attr fetchop_name + [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")]) +(define_code_attr fetchop_pred + [(plus "add_operand") (minus "reg_or_8bit_operand") + (ior "or_operand") (xor "or_operand") (and "and_operand")]) +(define_code_attr fetchop_constr + [(plus "rKL") (minus "rI") (ior "rIN") (xor "rIN") (and "riNHM")]) + + +(define_expand "memory_barrier" + [(set (mem:BLK (match_dup 0)) + (unspec_volatile:BLK [(mem:BLK (match_dup 0))] UNSPECV_MB))] + "" +{ + operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); + MEM_VOLATILE_P (operands[0]) = 1; +}) + +(define_insn "*mb_internal" + [(set (match_operand:BLK 0 "" "") + (unspec_volatile:BLK [(match_operand:BLK 1 "" "")] UNSPECV_MB))] + "" + "mb" + [(set_attr "type" "mb")]) + +(define_insn "load_locked_" + [(set (match_operand:I48MODE 0 "register_operand" "=r") + (unspec_volatile:I48MODE + [(match_operand:I48MODE 1 "memory_operand" "m")] + UNSPECV_LL))] + "" + "ld_l %0,%1" + [(set_attr "type" "ld_l")]) + +(define_insn "store_conditional_" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec_volatile:DI [(const_int 0)] UNSPECV_SC)) + (set (match_operand:I48MODE 1 "memory_operand" "=m") + (match_operand:I48MODE 2 "reg_or_0_operand" "0"))] + "" + "st_c %0,%1" + [(set_attr "type" "st_c")]) + +;; The Alpha Architecture Handbook says that it is UNPREDICTABLE whether +;; the lock is cleared by a TAKEN branch. If we were to honor that, it +;; would mean that we could not expand a ll/sc sequence until after the +;; final basic-block reordering pass. Fortunately, it appears that no +;; Alpha implementation ever built actually clears the lock on branches, +;; taken or not. + +(define_insn_and_split "sync_" + [(set (match_operand:I48MODE 0 "memory_operand" "+m") + (unspec_volatile:I48MODE + [(FETCHOP:I48MODE (match_dup 0) + (match_operand:I48MODE 1 "" ""))] + UNSPECV_ATOMIC)) + (clobber (match_scratch:I48MODE 2 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + alpha_split_atomic_op (, operands[0], operands[1], + NULL, NULL, operands[2]); + DONE; +} + [(set_attr "type" "multi")]) + +(define_insn_and_split "sync_nand" + [(set (match_operand:I48MODE 0 "memory_operand" "+m") + (unspec_volatile:I48MODE + [(and:I48MODE (not:I48MODE (match_dup 0)) + (match_operand:I48MODE 1 "register_operand" "r"))] + UNSPECV_ATOMIC)) + (clobber (match_scratch:I48MODE 2 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + alpha_split_atomic_op (NOT, operands[0], operands[1], + NULL, NULL, operands[2]); + DONE; +} + [(set_attr "type" "multi")]) + +(define_insn_and_split "sync_old_" + [(set (match_operand:I48MODE 0 "register_operand" "=&r") + (match_operand:I48MODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(FETCHOP:I48MODE (match_dup 1) + (match_operand:I48MODE 2 "" ""))] + UNSPECV_ATOMIC)) + (clobber (match_scratch:I48MODE 3 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + alpha_split_atomic_op (, operands[1], operands[2], + operands[0], NULL, operands[3]); + DONE; +} + [(set_attr "type" "multi")]) + +(define_insn_and_split "sync_old_nand" + [(set (match_operand:I48MODE 0 "register_operand" "=&r") + (match_operand:I48MODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(and:I48MODE (not:I48MODE (match_dup 1)) + (match_operand:I48MODE 2 "register_operand" "r"))] + UNSPECV_ATOMIC)) + (clobber (match_scratch:I48MODE 3 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + alpha_split_atomic_op (NOT, operands[1], operands[2], + operands[0], NULL, operands[3]); + DONE; +} + [(set_attr "type" "multi")]) + +(define_insn_and_split "sync_new_" + [(set (match_operand:I48MODE 0 "register_operand" "=&r") + (FETCHOP:I48MODE + (match_operand:I48MODE 1 "memory_operand" "+m") + (match_operand:I48MODE 2 "" ""))) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(FETCHOP:I48MODE (match_dup 1) (match_dup 2))] + UNSPECV_ATOMIC)) + (clobber (match_scratch:I48MODE 3 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + alpha_split_atomic_op (, operands[1], operands[2], + NULL, operands[0], operands[3]); + DONE; +} + [(set_attr "type" "multi")]) + +(define_insn_and_split "sync_new_nand" + [(set (match_operand:I48MODE 0 "register_operand" "=&r") + (and:I48MODE + (not:I48MODE (match_operand:I48MODE 1 "memory_operand" "+m")) + (match_operand:I48MODE 2 "register_operand" "r"))) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(and:I48MODE (not:I48MODE (match_dup 1)) (match_dup 2))] + UNSPECV_ATOMIC)) + (clobber (match_scratch:I48MODE 3 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + alpha_split_atomic_op (NOT, operands[1], operands[2], + NULL, operands[0], operands[3]); + DONE; +} + [(set_attr "type" "multi")]) + +(define_expand "sync_compare_and_swap" + [(parallel + [(set (match_operand:I48MODE 0 "register_operand" "") + (match_operand:I48MODE 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(match_operand:I48MODE 2 "reg_or_8bit_operand" "") + (match_operand:I48MODE 3 "add_operand" "rKL")] + UNSPECV_CMPXCHG)) + (clobber (match_scratch:I48MODE 4 "=&r"))])] + "" +{ + if (mode == SImode) + operands[2] = convert_modes (DImode, SImode, operands[2], 0); +}) + +(define_insn_and_split "*sync_compare_and_swap" + [(set (match_operand:I48MODE 0 "register_operand" "=&r") + (match_operand:I48MODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(match_operand:DI 2 "reg_or_8bit_operand" "rI") + (match_operand:I48MODE 3 "add_operand" "rKL")] + UNSPECV_CMPXCHG)) + (clobber (match_scratch:I48MODE 4 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + rtx retval, mem, oldval, newval, scratch; + rtx cond, label1, label2, x; + rtx very_unlikely = GEN_INT (REG_BR_PROB_BASE / 100 - 1); + + retval = operands[0]; + mem = operands[1]; + oldval = operands[2]; + newval = operands[3]; + scratch = operands[4]; + cond = gen_lowpart (DImode, scratch); + + emit_insn (gen_memory_barrier ()); + + label1 = gen_rtx_LABEL_REF (DImode, gen_label_rtx ()); + label2 = gen_rtx_LABEL_REF (DImode, gen_label_rtx ()); + emit_label (XEXP (label1, 0)); + + emit_insn (gen_load_locked_ (retval, mem)); + + x = gen_lowpart (DImode, retval); + if (oldval == const0_rtx) + x = gen_rtx_NE (DImode, x, const0_rtx); + else + { + x = gen_rtx_EQ (DImode, x, oldval); + emit_insn (gen_rtx_SET (VOIDmode, cond, x)); + x = gen_rtx_EQ (DImode, cond, const0_rtx); + } + x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label2, pc_rtx); + x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); + REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); + + emit_move_insn (scratch, newval); + + emit_insn (gen_store_conditional_ (cond, mem, scratch)); + + x = gen_rtx_EQ (DImode, cond, const0_rtx); + x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label1, pc_rtx); + x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); + REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); + + emit_insn (gen_memory_barrier ()); + emit_label (XEXP (label2, 0)); + DONE; +} + [(set_attr "type" "multi")]) + +(define_insn_and_split "sync_lock_test_and_set" + [(set (match_operand:I48MODE 0 "register_operand" "=&r") + (match_operand:I48MODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:I48MODE + [(match_operand:I48MODE 2 "add_operand" "rKL")] + UNSPECV_XCHG)) + (clobber (match_scratch:I48MODE 3 "=&r"))] + "" + "#" + "reload_completed" + [(const_int 0)] +{ + rtx retval, mem, val, scratch; + rtx cond, label1, x; + rtx very_unlikely = GEN_INT (REG_BR_PROB_BASE / 100 - 1); + + retval = operands[0]; + mem = operands[1]; + val = operands[2]; + scratch = operands[3]; + cond = gen_lowpart (DImode, scratch); + + emit_insn (gen_memory_barrier ()); + + label1 = gen_rtx_LABEL_REF (DImode, gen_label_rtx ()); + emit_label (XEXP (label1, 0)); + + emit_insn (gen_load_locked_ (retval, mem)); + + emit_move_insn (scratch, val); + + emit_insn (gen_store_conditional_ (cond, mem, scratch)); + + x = gen_rtx_EQ (DImode, cond, const0_rtx); + x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, label1, pc_rtx); + x = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, x)); + REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_BR_PROB, very_unlikely, NULL_RTX); + + DONE; +} + [(set_attr "type" "multi")]) diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h index 02b3dde3db5..9a4b4124475 100644 --- a/gcc/config/alpha/unicosmk.h +++ b/gcc/config/alpha/unicosmk.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for DEC Alpha on Cray T3E running Unicos/Mk. - Copyright (C) 2001, 2002, 2004 + Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Roman Lechtchinsky (rl@cs.tu-berlin.de) @@ -230,7 +230,7 @@ do { fprintf (FILE, "\tbr $1,0\n"); \ /* We don't support nested functions (yet). */ #undef TRAMPOLINE_TEMPLATE -#define TRAMPOLINE_TEMPLATE(FILE) abort () +#define TRAMPOLINE_TEMPLATE(FILE) gcc_unreachable () /* Specify the machine mode that this machine uses for the index in the tablejump instruction. On Unicos/Mk, we don't support relative case @@ -374,7 +374,7 @@ ssib_section (void) \ (Unicos/Mk does not use such vectors yet). */ #undef ASM_OUTPUT_ADDR_DIFF_ELT -#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort () +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) gcc_unreachable () /* We can't output case vectors in the same section as the function code because CAM doesn't allow data definitions in code sections. Thus, we @@ -384,7 +384,7 @@ ssib_section (void) \ #define ASM_OUTPUT_ADDR_VEC(LAB,VEC) \ unicosmk_defer_case_vector ((LAB),(VEC)) -#define ASM_OUTPUT_ADDR_DIFF_VEC(LAB,VEC) abort () +#define ASM_OUTPUT_ADDR_DIFF_VEC(LAB,VEC) gcc_unreachable () /* This is how to output an assembler line that says to advance the location counter to a multiple of 2**LOG bytes. Annoyingly, CAM always uses zeroes diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h index 0e9a6987da3..5bc899abc95 100644 --- a/gcc/config/alpha/vms.h +++ b/gcc/config/alpha/vms.h @@ -1,5 +1,5 @@ /* Output variables, constants and external declarations, for GNU compiler. - Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2004 + Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -136,15 +136,20 @@ Boston, MA 02111-1307, USA. */ #undef INITIAL_ELIMINATION_OFFSET #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ -{ if ((FROM) == FRAME_POINTER_REGNUM) \ - (OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \ - else if ((FROM) == ARG_POINTER_REGNUM) \ - (OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \ - + get_frame_size () \ - + current_function_pretend_args_size) \ - - current_function_pretend_args_size); \ - else \ - abort(); \ +{ switch (FROM) \ + { \ + case FRAME_POINTER_REGNUM: \ + (OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \ + break; \ + case ARG_POINTER_REGNUM: \ + (OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \ + + get_frame_size () \ + + current_function_pretend_args_size) \ + - current_function_pretend_args_size); \ + break; \ + default: \ + gcc_unreachable (); \ + } \ if ((TO) == STACK_POINTER_REGNUM) \ (OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \ } @@ -227,7 +232,7 @@ extern void link_section (void); extern void literals_section (void); #undef ASM_OUTPUT_ADDR_DIFF_ELT -#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort () +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) gcc_unreachable () #undef ASM_OUTPUT_ADDR_VEC_ELT #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index ba8a256acbd..52eca9f0f0e 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -1,5 +1,6 @@ /* Subroutines used for code generation on the Argonaut ARC cpu. - Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -240,7 +241,7 @@ get_arc_condition_code (rtx comparison) case LEU : return 15; case LTU : return 6; case GEU : return 7; - default : abort (); + default : gcc_unreachable (); } /*NOTREACHED*/ return (42); @@ -409,14 +410,14 @@ arc_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED, if (TREE_CODE (value) != STRING_CST) { - warning ("argument of %qs attribute is not a string constant", + warning (0, "argument of %qs attribute is not a string constant", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (strcmp (TREE_STRING_POINTER (value), "ilink1") && strcmp (TREE_STRING_POINTER (value), "ilink2")) { - warning ("argument of %qs attribute is not \"ilink1\" or \"ilink2\"", + warning (0, "argument of %qs attribute is not \"ilink1\" or \"ilink2\"", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -773,8 +774,7 @@ arc_double_limm_p (rtx value) { HOST_WIDE_INT low, high; - if (GET_CODE (value) != CONST_DOUBLE) - abort (); + gcc_assert (GET_CODE (value) == CONST_DOUBLE); low = CONST_DOUBLE_LOW (value); high = CONST_DOUBLE_HIGH (value); @@ -814,8 +814,7 @@ arc_setup_incoming_varargs (CUMULATIVE_ARGS *cum, int first_anon_arg; /* All BLKmode values are passed by reference. */ - if (mode == BLKmode) - abort (); + gcc_assert (mode != BLKmode); first_anon_arg = *cum + ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD); @@ -1060,7 +1059,7 @@ arc_compute_function_type (tree decl) else if (!strcmp (TREE_STRING_POINTER (value), "ilink2")) fn_type = ARC_FUNCTION_ILINK2; else - abort (); + gcc_unreachable (); break; } } @@ -1228,8 +1227,7 @@ arc_output_function_prologue (FILE *file, HOST_WIDE_INT size) : current_frame_info.total_size); /* These cases shouldn't happen. Catch them now. */ - if (size == 0 && gmask) - abort (); + gcc_assert (size || !gmask); /* Allocate space for register arguments if this is a variadic function. */ if (current_frame_info.pretend_size != 0) @@ -1316,8 +1314,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) if (!can_trust_sp_p) { - if (!frame_pointer_needed) - abort (); + gcc_assert (frame_pointer_needed); fprintf (file,"\tsub %s,%s,%d\t\t%s sp not trusted here\n", sp_str, fp_str, frame_size, ASM_COMMENT_START); } @@ -1346,7 +1343,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) /* ??? If stack intactness is important, always emit now. */ if (MUST_SAVE_RETURN_ADDR && epilogue_delay != NULL_RTX) { - final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1, NULL); + final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 1, NULL); epilogue_delay = NULL_RTX; } @@ -1378,8 +1375,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) { if (epilogue_delay) { - final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1, - NULL); + final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 1, NULL); } } @@ -1400,23 +1396,19 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) fprintf (file, "\tadd %s,%s,16\n", sp_str, sp_str); else if (epilogue_delay != NULL_RTX) { - if (frame_pointer_needed && !fp_restored_p) - abort (); - if (restored < size) - abort (); - final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1, NULL); + gcc_assert (!frame_pointer_needed || fp_restored_p); + gcc_assert (restored >= size); + final_scan_insn (XEXP (epilogue_delay, 0), file, 1, 1, NULL); } else if (frame_pointer_needed && !fp_restored_p) { - if (!SMALL_INT (frame_size)) - abort (); + gcc_assert (SMALL_INT (frame_size)); /* Note that we restore fp and sp here! */ fprintf (file, "\tld.a %s,[%s,%d]\n", fp_str, sp_str, frame_size); } else if (restored < size) { - if (!SMALL_INT (size - restored)) - abort (); + gcc_assert (SMALL_INT (size - restored)); fprintf (file, "\tadd %s,%s," HOST_WIDE_INT_PRINT_DEC "\n", sp_str, sp_str, size - restored); } @@ -1456,8 +1448,7 @@ arc_delay_slots_for_epilogue (void) int arc_eligible_for_epilogue_delay (rtx trial, int slot) { - if (slot != 0) - abort (); + gcc_assert (!slot); if (get_attr_length (trial) == 1 /* If registers where saved, presumably there's more than enough @@ -1522,15 +1513,14 @@ output_shift (rtx *operands) enum rtx_code code = GET_CODE (shift); const char *shift_one; - if (mode != SImode) - abort (); + gcc_assert (mode == SImode); switch (code) { case ASHIFT: shift_one = "asl %0,%0"; break; case ASHIFTRT: shift_one = "asr %0,%0"; break; case LSHIFTRT: shift_one = "lsr %0,%0"; break; - default: abort (); + default: gcc_unreachable (); } if (GET_CODE (operands[2]) != CONST_INT) @@ -1792,9 +1782,8 @@ arc_print_operand (FILE *file, rtx x, int code) { char str[30]; - if (GET_CODE (x) != CONST_DOUBLE - || GET_MODE_CLASS (GET_MODE (x)) != MODE_FLOAT) - abort (); + gcc_assert (GET_CODE (x) == CONST_DOUBLE + && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT); real_to_decimal (str, CONST_DOUBLE_REAL_VALUE (x), sizeof (str), 0, 1); fprintf (file, "%s", str); @@ -1896,26 +1885,33 @@ arc_print_operand_address (FILE *file, rtx addr) offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0); else base = XEXP (addr, 0), index = XEXP (addr, 1); - if (GET_CODE (base) != REG) - abort (); + gcc_assert (GET_CODE (base) == REG); fputs (reg_names[REGNO (base)], file); if (index == 0) { if (offset != 0) fprintf (file, ",%d", offset); } - else if (GET_CODE (index) == REG) - fprintf (file, ",%s", reg_names[REGNO (index)]); - else if (GET_CODE (index) == SYMBOL_REF) - fputc (',', file), output_addr_const (file, index); else - abort (); + { + switch (GET_CODE (index)) + { + case REG: + fprintf (file, ",%s", reg_names[REGNO (index)]); + break; + case SYMBOL_REF: + fputc (',', file), output_addr_const (file, index); + break; + default: + gcc_unreachable (); + } + } break; case PRE_INC : case PRE_DEC : /* We shouldn't get here as we've lost the mode of the memory object (which says how much to inc/dec by. */ - abort (); + gcc_unreachable (); break; default : output_addr_const (file, addr); @@ -2102,7 +2098,7 @@ arc_final_prescan_insn (rtx insn, then_not_else = FALSE; } else - abort (); + gcc_unreachable (); /* See how many insns this branch skips, and what kind of insns. If all insns are okay, and the label or unconditional branch to the same @@ -2221,14 +2217,15 @@ arc_final_prescan_insn (rtx insn, { if ((!seeking_return) && (arc_ccfsm_state == 1 || reverse)) arc_ccfsm_target_label = CODE_LABEL_NUMBER (label); - else if (seeking_return || arc_ccfsm_state == 2) + else { + gcc_assert (seeking_return || arc_ccfsm_state == 2); while (this_insn && GET_CODE (PATTERN (this_insn)) == USE) { this_insn = next_nonnote_insn (this_insn); - if (this_insn && (GET_CODE (this_insn) == BARRIER - || GET_CODE (this_insn) == CODE_LABEL)) - abort (); + gcc_assert (!this_insn + || (GET_CODE (this_insn) != BARRIER + && GET_CODE (this_insn) != CODE_LABEL)); } if (!this_insn) { @@ -2240,8 +2237,6 @@ arc_final_prescan_insn (rtx insn, } arc_ccfsm_target_insn = this_insn; } - else - abort (); /* If REVERSE is true, ARM_CURRENT_CC needs to be inverted from what it was. */ diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index dfc88fe8c1b..b358f84c9fb 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, Argonaut ARC cpu. - Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 54f252e0353..97e25f38385 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -1,5 +1,5 @@ ;; Machine description of the Argonaut ARC cpu for GNU C compiler -;; Copyright (C) 1994, 1997, 1998, 1999, 2000, 2004 +;; Copyright (C) 1994, 1997, 1998, 1999, 2000, 2004, 2005 ;; Free Software Foundation, Inc. ;; This file is part of GCC. @@ -299,7 +299,7 @@ case 3 : return \"st%V0 %1,%0\;st%V0 %R1,%R0\"; default: - abort(); + gcc_unreachable (); } }" [(set_attr "type" "move,move,load,store") @@ -392,7 +392,7 @@ case 3 : return \"st%V0 %1,%0\;st%V0 %R1,%R0\"; default: - abort(); + gcc_unreachable (); } }" [(set_attr "type" "move,move,load,store") diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def index abc52303ef0..848f7fb641c 100644 --- a/gcc/config/arm/arm-cores.def +++ b/gcc/config/arm/arm-cores.def @@ -1,5 +1,5 @@ /* ARM CPU Cores - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. Written by CodeSourcery, LLC This file is part of GCC. @@ -43,22 +43,22 @@ ARM_CORE("arm3", arm3, 2, FL_CO_PROC | FL_MODE26, slowmul) /* V3 Architecture Processors */ ARM_CORE("arm6", arm6, 3, FL_CO_PROC | FL_MODE26, slowmul) ARM_CORE("arm60", arm60, 3, FL_CO_PROC | FL_MODE26, slowmul) -ARM_CORE("arm600", arm600, 3, FL_CO_PROC | FL_MODE26, slowmul) -ARM_CORE("arm610", arm610, 3, FL_MODE26, slowmul) -ARM_CORE("arm620", arm620, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm600", arm600, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm610", arm610, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm620", arm620, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) ARM_CORE("arm7", arm7, 3, FL_CO_PROC | FL_MODE26, slowmul) ARM_CORE("arm7d", arm7d, 3, FL_CO_PROC | FL_MODE26, slowmul) ARM_CORE("arm7di", arm7di, 3, FL_CO_PROC | FL_MODE26, slowmul) ARM_CORE("arm70", arm70, 3, FL_CO_PROC | FL_MODE26, slowmul) -ARM_CORE("arm700", arm700, 3, FL_CO_PROC | FL_MODE26, slowmul) -ARM_CORE("arm700i", arm700i, 3, FL_CO_PROC | FL_MODE26, slowmul) -ARM_CORE("arm710", arm710, 3, FL_MODE26, slowmul) -ARM_CORE("arm720", arm720, 3, FL_MODE26, slowmul) -ARM_CORE("arm710c", arm710c, 3, FL_MODE26, slowmul) -ARM_CORE("arm7100", arm7100, 3, FL_MODE26, slowmul) -ARM_CORE("arm7500", arm7500, 3, FL_MODE26, slowmul) +ARM_CORE("arm700", arm700, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm700i", arm700i, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm710", arm710, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm720", arm720, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm710c", arm710c, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm7100", arm7100, 3, FL_MODE26 | FL_WBUF, slowmul) +ARM_CORE("arm7500", arm7500, 3, FL_MODE26 | FL_WBUF, slowmul) /* Doesn't have an external co-proc, but does have embedded fpa. */ -ARM_CORE("arm7500fe", arm7500fe, 3, FL_CO_PROC | FL_MODE26, slowmul) +ARM_CORE("arm7500fe", arm7500fe, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul) /* V3M Architecture Processors */ /* arm7m doesn't exist on its own, but only with D, ("and", and I), but @@ -76,11 +76,11 @@ ARM_CORE("strongarm1100", strongarm1100, 4, FL_MODE26 | FL_LDSCHED ARM_CORE("strongarm1110", strongarm1110, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, fastmul) /* V4T Architecture Processors */ -ARM_CORE("arm7tdmi", arm7tdmi, 4T, FL_CO_PROC , fastmul) -ARM_CORE("arm7tdmi-s", arm7tdmis, 4T, FL_CO_PROC , fastmul) -ARM_CORE("arm710t", arm710t, 4T, 0 , fastmul) -ARM_CORE("arm720t", arm720t, 4T, 0 , fastmul) -ARM_CORE("arm740t", arm740t, 4T, 0 , fastmul) +ARM_CORE("arm7tdmi", arm7tdmi, 4T, FL_CO_PROC , fastmul) +ARM_CORE("arm7tdmi-s", arm7tdmis, 4T, FL_CO_PROC , fastmul) +ARM_CORE("arm710t", arm710t, 4T, FL_WBUF, fastmul) +ARM_CORE("arm720t", arm720t, 4T, FL_WBUF, fastmul) +ARM_CORE("arm740t", arm740t, 4T, FL_WBUF, fastmul) ARM_CORE("arm9", arm9, 4T, FL_LDSCHED, fastmul) ARM_CORE("arm9tdmi", arm9tdmi, 4T, FL_LDSCHED, fastmul) ARM_CORE("arm920", arm920, 4T, FL_LDSCHED, fastmul) diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h index e7811ca8c8e..0d20eb8fd44 100644 --- a/gcc/config/arm/arm-protos.h +++ b/gcc/config/arm/arm-protos.h @@ -38,6 +38,7 @@ extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int, unsigned int); extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int, unsigned int); +extern unsigned int arm_dbx_register_number (unsigned int); #ifdef TREE_CODE extern int arm_return_in_memory (tree); @@ -90,6 +91,7 @@ extern rtx arm_gen_return_addr_mask (void); extern void arm_reload_in_hi (rtx *); extern void arm_reload_out_hi (rtx *); extern int arm_const_double_inline_cost (rtx); +extern bool arm_const_double_by_parts (rtx); extern const char *fp_immediate_constant (rtx); extern const char *output_call (rtx *); extern const char *output_call_mem (rtx *); @@ -99,7 +101,6 @@ extern const char *output_mov_long_double_arm_from_arm (rtx *); extern const char *output_mov_double_fpa_from_arm (rtx *); extern const char *output_mov_double_arm_from_fpa (rtx *); extern const char *output_move_double (rtx *); -extern const char *output_mov_immediate (rtx *); extern const char *output_add_immediate (rtx *); extern const char *arithmetic_instr (rtx, int); extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int); @@ -120,6 +121,8 @@ extern int arm_eliminable_register (rtx); #if defined TREE_CODE extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); +extern bool arm_pad_arg_upward (enum machine_mode, tree); +extern bool arm_pad_reg_upward (enum machine_mode, tree, int); extern bool arm_needs_doubleword_align (enum machine_mode, tree); extern rtx arm_function_value(tree, tree); #endif diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index b307983892c..26fb38cb779 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -73,6 +73,7 @@ static int thumb_far_jump_used_p (void); static bool thumb_force_lr_save (void); static int const_ok_for_op (HOST_WIDE_INT, enum rtx_code); static rtx emit_sfm (int, int); +static int arm_size_return_regs (void); #ifndef AOF_ASSEMBLER static bool arm_assemble_integer (rtx, unsigned int, int); #endif @@ -84,7 +85,6 @@ static const char *output_multi_immediate (rtx *, const char *, const char *, int, HOST_WIDE_INT); static const char *shift_op (rtx, HOST_WIDE_INT *); static struct machine_function *arm_init_machine_status (void); -static void replace_symbols_in_block (tree, rtx, rtx); static void thumb_exit (FILE *, int); static rtx is_jump_table (rtx); static HOST_WIDE_INT get_jump_table_size (rtx); @@ -145,6 +145,9 @@ static void emit_constant_insn (rtx cond, rtx pattern); static int arm_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +#ifdef OBJECT_FORMAT_ELF +static void arm_elf_asm_constructor (rtx, int); +#endif #ifndef ARM_PE static void arm_encode_section_info (tree, rtx, int); #endif @@ -166,6 +169,8 @@ static bool arm_pass_by_reference (CUMULATIVE_ARGS *, static bool arm_promote_prototypes (tree); static bool arm_default_short_enums (void); static bool arm_align_anon_bitfield (void); +static bool arm_return_in_msb (tree); +static bool arm_must_pass_in_stack (enum machine_mode, tree); static tree arm_cxx_guard_type (void); static bool arm_cxx_guard_mask_bit (void); @@ -173,8 +178,11 @@ static tree arm_get_cookie_size (tree); static bool arm_cookie_has_size (void); static bool arm_cxx_cdtor_returns_this (void); static bool arm_cxx_key_method_may_be_inline (void); -static bool arm_cxx_export_class_data (void); +static void arm_cxx_determine_class_data_visibility (tree); +static bool arm_cxx_class_data_always_comdat (void); +static bool arm_cxx_use_aeabi_atexit (void); static void arm_init_libfuncs (void); +static bool arm_handle_option (size_t, const char *, int); static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); /* Initialize the GCC target structure. */ @@ -215,6 +223,11 @@ static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE arm_output_function_epilogue +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_SCHED_PROLOG) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION arm_handle_option + #undef TARGET_COMP_TYPE_ATTRIBUTES #define TARGET_COMP_TYPE_ATTRIBUTES arm_comp_type_attributes @@ -308,8 +321,21 @@ static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); #undef TARGET_CXX_KEY_METHOD_MAY_BE_INLINE #define TARGET_CXX_KEY_METHOD_MAY_BE_INLINE arm_cxx_key_method_may_be_inline -#undef TARGET_CXX_EXPORT_CLASS_DATA -#define TARGET_CXX_EXPORT_CLASS_DATA arm_cxx_export_class_data +#undef TARGET_CXX_USE_AEABI_ATEXIT +#define TARGET_CXX_USE_AEABI_ATEXIT arm_cxx_use_aeabi_atexit + +#undef TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY +#define TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY \ + arm_cxx_determine_class_data_visibility + +#undef TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT +#define TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT arm_cxx_class_data_always_comdat + +#undef TARGET_RETURN_IN_MSB +#define TARGET_RETURN_IN_MSB arm_return_in_msb + +#undef TARGET_MUST_PASS_IN_STACK +#define TARGET_MUST_PASS_IN_STACK arm_must_pass_in_stack struct gcc_target targetm = TARGET_INITIALIZER; @@ -349,26 +375,23 @@ enum float_abi_type arm_float_abi; enum arm_abi_type arm_abi; /* Set by the -mfpu=... option. */ -const char * target_fpu_name = NULL; +static const char * target_fpu_name = NULL; /* Set by the -mfpe=... option. */ -const char * target_fpe_name = NULL; +static const char * target_fpe_name = NULL; /* Set by the -mfloat-abi=... option. */ -const char * target_float_abi_name = NULL; - -/* Set by the legacy -mhard-float and -msoft-float options. */ -const char * target_float_switch = NULL; +static const char * target_float_abi_name = NULL; /* Set by the -mabi=... option. */ -const char * target_abi_name = NULL; +static const char * target_abi_name = NULL; /* Used to parse -mstructure_size_boundary command line option. */ -const char * structure_size_string = NULL; +static const char * structure_size_string = NULL; int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY; /* Used for Thumb call_via trampolines. */ -rtx thumb_call_via_label[13]; +rtx thumb_call_via_label[14]; static int thumb_call_reg_needed; /* Bit values used to identify processor capabilities. */ @@ -387,6 +410,8 @@ static int thumb_call_reg_needed; #define FL_ARCH6 (1 << 12) /* Architecture rel 6. Adds media instructions. */ #define FL_VFPV2 (1 << 13) /* Vector Floating Point V2. */ +#define FL_WBUF (1 << 14) /* Schedule for write buffer ops. + Note: ARM6 & 7 derivatives only. */ #define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */ @@ -439,7 +464,7 @@ int arm_arch6 = 0; int arm_ld_sched = 0; /* Nonzero if this chip is a StrongARM. */ -int arm_is_strong = 0; +int arm_tune_strongarm = 0; /* Nonzero if this chip is a Cirrus variant. */ int arm_arch_cirrus = 0; @@ -453,8 +478,9 @@ int arm_arch_xscale = 0; /* Nonzero if tuning for XScale */ int arm_tune_xscale = 0; -/* Nonzero if this chip is an ARM6 or an ARM7. */ -int arm_is_6_or_7 = 0; +/* Nonzero if we want to tune for stores that access the write-buffer. + This typically means an ARM6 or ARM7 with MMU or MPU. */ +int arm_tune_wbuf = 0; /* Nonzero if generating Thumb instructions. */ int thumb_code = 0; @@ -472,7 +498,7 @@ int arm_cpp_interwork = 0; enum machine_mode output_memory_reference_mode; /* The register number to be used for the PIC offset register. */ -const char * arm_pic_register_string = NULL; +static const char * arm_pic_register_string = NULL; int arm_pic_register = INVALID_REGNUM; /* Set to 1 when a return insn is output, this means that the epilogue @@ -552,11 +578,18 @@ static const struct processors all_architectures[] = {NULL, arm_none, NULL, 0 , NULL} }; +struct arm_cpu_select +{ + const char * string; + const char * name; + const struct processors * processors; +}; + /* This is a magic structure. The 'string' field is magically filled in with a pointer to the value specified by the user on the command line assuming that the user has specified such a value. */ -struct arm_cpu_select arm_select[] = +static struct arm_cpu_select arm_select[] = { /* string name processors */ { NULL, "-mcpu=", all_cores }, @@ -564,6 +597,10 @@ struct arm_cpu_select arm_select[] = { NULL, "-mtune=", all_cores } }; +/* Defines representing the indexes into the above table. */ +#define ARM_OPT_SET_CPU 0 +#define ARM_OPT_SET_ARCH 1 +#define ARM_OPT_SET_TUNE 2 /* The name of the proprocessor macro to define for this architecture. */ @@ -748,6 +785,70 @@ arm_init_libfuncs (void) set_optab_libfunc (udiv_optab, DImode, "__aeabi_uldivmod"); set_optab_libfunc (sdiv_optab, SImode, "__aeabi_idivmod"); set_optab_libfunc (udiv_optab, SImode, "__aeabi_uidivmod"); + + /* We don't have mod libcalls. Fortunately gcc knows how to use the + divmod libcalls instead. */ + set_optab_libfunc (smod_optab, DImode, NULL); + set_optab_libfunc (umod_optab, DImode, NULL); + set_optab_libfunc (smod_optab, SImode, NULL); + set_optab_libfunc (umod_optab, SImode, NULL); +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +arm_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_mabi_: + target_abi_name = arg; + return true; + + case OPT_march_: + arm_select[1].string = arg; + return true; + + case OPT_mcpu_: + arm_select[0].string = arg; + return true; + + case OPT_mfloat_abi_: + target_float_abi_name = arg; + return true; + + case OPT_mfp_: + case OPT_mfpe_: + target_fpe_name = arg; + return true; + + case OPT_mfpu_: + target_fpu_name = arg; + return true; + + case OPT_mhard_float: + target_float_abi_name = "hard"; + return true; + + case OPT_mpic_register_: + arm_pic_register_string = arg; + return true; + + case OPT_msoft_float: + target_float_abi_name = "soft"; + return true; + + case OPT_mstructure_size_boundary_: + structure_size_string = arg; + return true; + + case OPT_mtune_: + arm_select[2].string = arg; + return true; + + default: + return true; + } } /* Fix up any incompatible options that the user has specified. @@ -756,6 +857,7 @@ void arm_override_options (void) { unsigned i; + enum processor_type target_arch_cpu = arm_none; /* Set up the flags based on the cpu/architecture selected by the user. */ for (i = ARRAY_SIZE (arm_select); i--;) @@ -770,29 +872,32 @@ arm_override_options (void) if (streq (ptr->string, sel->name)) { /* Set the architecture define. */ - if (i != 2) + if (i != ARM_OPT_SET_TUNE) sprintf (arm_arch_name, "__ARM_ARCH_%s__", sel->arch); /* Determine the processor core for which we should tune code-generation. */ if (/* -mcpu= is a sensible default. */ - i == 0 - /* If -march= is used, and -mcpu= has not been used, - assume that we should tune for a representative - CPU from that architecture. */ - || i == 1 + i == ARM_OPT_SET_CPU /* -mtune= overrides -mcpu= and -march=. */ - || i == 2) + || i == ARM_OPT_SET_TUNE) arm_tune = (enum processor_type) (sel - ptr->processors); - if (i != 2) + /* Remember the CPU associated with this architecture. + If no other option is used to set the CPU type, + we'll use this to guess the most suitable tuning + options. */ + if (i == ARM_OPT_SET_ARCH) + target_arch_cpu = sel->core; + + if (i != ARM_OPT_SET_TUNE) { /* If we have been given an architecture and a processor make sure that they are compatible. We only generate a warning though, and we prefer the CPU over the architecture. */ if (insn_flags != 0 && (insn_flags ^ sel->flags)) - warning ("switch -mcpu=%s conflicts with -march= switch", + warning (0, "switch -mcpu=%s conflicts with -march= switch", ptr->string); insn_flags = sel->flags; @@ -806,6 +911,10 @@ arm_override_options (void) } } + /* Guess the tuning options from the architecture if necessary. */ + if (arm_tune == arm_none) + arm_tune = target_arch_cpu; + /* If the user did not specify a processor, choose one for them. */ if (insn_flags == 0) { @@ -883,10 +992,8 @@ arm_override_options (void) } } - if (best_fit == NULL) - abort (); - else - sel = best_fit; + gcc_assert (best_fit); + sel = best_fit; } insn_flags = sel->flags; @@ -898,8 +1005,7 @@ arm_override_options (void) /* The processor for which we should tune should now have been chosen. */ - if (arm_tune == arm_none) - abort (); + gcc_assert (arm_tune != arm_none); tune_flags = all_cores[(int)arm_tune].flags; if (optimize_size) @@ -911,56 +1017,55 @@ arm_override_options (void) other command line choices. */ if (TARGET_INTERWORK && !(insn_flags & FL_THUMB)) { - warning ("target CPU does not support interworking" ); - target_flags &= ~ARM_FLAG_INTERWORK; + warning (0, "target CPU does not support interworking" ); + target_flags &= ~MASK_INTERWORK; } if (TARGET_THUMB && !(insn_flags & FL_THUMB)) { - warning ("target CPU does not support THUMB instructions"); - target_flags &= ~ARM_FLAG_THUMB; + warning (0, "target CPU does not support THUMB instructions"); + target_flags &= ~MASK_THUMB; } if (TARGET_APCS_FRAME && TARGET_THUMB) { - /* warning ("ignoring -mapcs-frame because -mthumb was used"); */ - target_flags &= ~ARM_FLAG_APCS_FRAME; + /* warning (0, "ignoring -mapcs-frame because -mthumb was used"); */ + target_flags &= ~MASK_APCS_FRAME; } /* TARGET_BACKTRACE calls leaf_function_p, which causes a crash if done from here where no function is being compiled currently. */ - if ((target_flags & (THUMB_FLAG_LEAF_BACKTRACE | THUMB_FLAG_BACKTRACE)) - && TARGET_ARM) - warning ("enabling backtrace support is only meaningful when compiling for the Thumb"); + if ((TARGET_TPCS_FRAME || TARGET_TPCS_LEAF_FRAME) && TARGET_ARM) + warning (0, "enabling backtrace support is only meaningful when compiling for the Thumb"); if (TARGET_ARM && TARGET_CALLEE_INTERWORKING) - warning ("enabling callee interworking support is only meaningful when compiling for the Thumb"); + warning (0, "enabling callee interworking support is only meaningful when compiling for the Thumb"); if (TARGET_ARM && TARGET_CALLER_INTERWORKING) - warning ("enabling caller interworking support is only meaningful when compiling for the Thumb"); + warning (0, "enabling caller interworking support is only meaningful when compiling for the Thumb"); if (TARGET_APCS_STACK && !TARGET_APCS_FRAME) { - warning ("-mapcs-stack-check incompatible with -mno-apcs-frame"); - target_flags |= ARM_FLAG_APCS_FRAME; + warning (0, "-mapcs-stack-check incompatible with -mno-apcs-frame"); + target_flags |= MASK_APCS_FRAME; } if (TARGET_POKE_FUNCTION_NAME) - target_flags |= ARM_FLAG_APCS_FRAME; + target_flags |= MASK_APCS_FRAME; if (TARGET_APCS_REENT && flag_pic) error ("-fpic and -mapcs-reent are incompatible"); if (TARGET_APCS_REENT) - warning ("APCS reentrant code not supported. Ignored"); + warning (0, "APCS reentrant code not supported. Ignored"); /* If this target is normally configured to use APCS frames, warn if they are turned off and debugging is turned on. */ if (TARGET_ARM && write_symbols != NO_DEBUG && !TARGET_APCS_FRAME - && (TARGET_DEFAULT & ARM_FLAG_APCS_FRAME)) - warning ("-g with -mno-apcs-frame may not give sensible debugging"); + && (TARGET_DEFAULT & MASK_APCS_FRAME)) + warning (0, "-g with -mno-apcs-frame may not give sensible debugging"); /* If stack checking is disabled, we can use r10 as the PIC register, which keeps r9 available. */ @@ -968,7 +1073,7 @@ arm_override_options (void) arm_pic_register = TARGET_APCS_STACK ? 9 : 10; if (TARGET_APCS_FLOAT) - warning ("passing floating point arguments in fp regs not yet supported"); + warning (0, "passing floating point arguments in fp regs not yet supported"); /* Initialize boolean versions of the flags, for use in the arm.md file. */ arm_arch3m = (insn_flags & FL_ARCH3M) != 0; @@ -981,10 +1086,9 @@ arm_override_options (void) arm_arch_cirrus = (insn_flags & FL_CIRRUS) != 0; arm_ld_sched = (tune_flags & FL_LDSCHED) != 0; - arm_is_strong = (tune_flags & FL_STRONG) != 0; + arm_tune_strongarm = (tune_flags & FL_STRONG) != 0; thumb_code = (TARGET_ARM == 0); - arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32)) - && !(tune_flags & FL_ARCH4))) != 0; + arm_tune_wbuf = (tune_flags & FL_WBUF) != 0; arm_tune_xscale = (tune_flags & FL_XSCALE) != 0; arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0; @@ -997,7 +1101,7 @@ arm_override_options (void) arm_cpp_interwork = 1; if (arm_arch5) - target_flags &= ~ARM_FLAG_INTERWORK; + target_flags &= ~MASK_INTERWORK; if (target_abi_name) { @@ -1071,8 +1175,7 @@ arm_override_options (void) else arm_fpu_tune = arm_fpu_arch; arm_fp_model = fp_model_for_fpu[arm_fpu_arch]; - if (arm_fp_model == ARM_FP_MODEL_UNKNOWN) - abort (); + gcc_assert (arm_fp_model != ARM_FP_MODEL_UNKNOWN); } if (target_float_abi_name != NULL) @@ -1090,14 +1193,6 @@ arm_override_options (void) error ("invalid floating point abi: -mfloat-abi=%s", target_float_abi_name); } - else if (target_float_switch) - { - /* This is a bit of a hack to avoid needing target flags for these. */ - if (target_float_switch[0] == 'h') - arm_float_abi = ARM_FLOAT_ABI_HARD; - else - arm_float_abi = ARM_FLOAT_ABI_SOFT; - } else arm_float_abi = TARGET_DEFAULT_FLOAT_ABI; @@ -1128,7 +1223,7 @@ arm_override_options (void) || (ARM_DOUBLEWORD_ALIGN && size == 64)) arm_structure_size_boundary = size; else - warning ("structure size boundary can only be set to %s", + warning (0, "structure size boundary can only be set to %s", ARM_DOUBLEWORD_ALIGN ? "8, 32 or 64": "8 or 32"); } @@ -1137,7 +1232,7 @@ arm_override_options (void) int pic_register = decode_reg_name (arm_pic_register_string); if (!flag_pic) - warning ("-mpic-register= is useless without -fpic"); + warning (0, "-mpic-register= is useless without -fpic"); /* Prevent the user from choosing an obviously stupid PIC register. */ else if (pic_register < 0 || call_used_regs[pic_register] @@ -1183,7 +1278,7 @@ arm_override_options (void) /* StrongARM has early execution of branches, so a sequence that is worth skipping is shorter. */ - if (arm_is_strong) + if (arm_tune_strongarm) max_insns_skipped = 3; } @@ -1263,8 +1358,7 @@ arm_compute_func_type (void) tree a; tree attr; - if (TREE_CODE (current_function_decl) != FUNCTION_DECL) - abort (); + gcc_assert (TREE_CODE (current_function_decl) == FUNCTION_DECL); /* Decide if the current function is volatile. Such functions never return, and many memory cycles can be saved by not storing @@ -1372,13 +1466,14 @@ use_return_insn (int iscond, rtx sibling) if (!call_used_regs[3]) return 0; - /* ... that it isn't being used for a return value (always true - until we implement return-in-regs), or for a tail-call - argument ... */ + /* ... that it isn't being used for a return value ... */ + if (arm_size_return_regs () >= (4 * UNITS_PER_WORD)) + return 0; + + /* ... or for a tail-call argument ... */ if (sibling) { - if (GET_CODE (sibling) != CALL_INSN) - abort (); + gcc_assert (GET_CODE (sibling) == CALL_INSN); if (find_regno_fusage (sibling, USE, 3)) return 0; @@ -1397,7 +1492,7 @@ use_return_insn (int iscond, rtx sibling) /* On StrongARM, conditional returns are expensive if they aren't taken and multiple registers have been stacked. */ - if (iscond && arm_is_strong) + if (iscond && arm_tune_strongarm) { /* Conditional return when just the LR is stored is a simple conditional-load instruction, that's not expensive. */ @@ -1439,8 +1534,8 @@ use_return_insn (int iscond, rtx sibling) int const_ok_for_arm (HOST_WIDE_INT i) { - unsigned HOST_WIDE_INT mask = ~(unsigned HOST_WIDE_INT)0xFF; - + int lowbit; + /* For machines with >32 bit HOST_WIDE_INT, the bits above bit 31 must be all zero, or all one. */ if ((i & ~(unsigned HOST_WIDE_INT) 0xffffffff) != 0 @@ -1449,19 +1544,24 @@ const_ok_for_arm (HOST_WIDE_INT i) & ~(unsigned HOST_WIDE_INT) 0xffffffff))) return FALSE; - /* Fast return for 0 and powers of 2 */ - if ((i & (i - 1)) == 0) + i &= (unsigned HOST_WIDE_INT) 0xffffffff; + + /* Fast return for 0 and small values. We must do this for zero, since + the code below can't handle that one case. */ + if ((i & ~(unsigned HOST_WIDE_INT) 0xff) == 0) return TRUE; - do - { - if ((i & mask & (unsigned HOST_WIDE_INT) 0xffffffff) == 0) - return TRUE; - mask = - (mask << 2) | ((mask & (unsigned HOST_WIDE_INT) 0xffffffff) - >> (32 - 2)) | ~(unsigned HOST_WIDE_INT) 0xffffffff; - } - while (mask != ~(unsigned HOST_WIDE_INT) 0xFF); + /* Get the number of trailing zeros, rounded down to the nearest even + number. */ + lowbit = (ffs ((int) i) - 1) & ~1; + + if ((i & ~(((unsigned HOST_WIDE_INT) 0xff) << lowbit)) == 0) + return TRUE; + else if (lowbit <= 4 + && ((i & ~0xc000003f) == 0 + || (i & ~0xf000000f) == 0 + || (i & ~0xfc000003) == 0)) + return TRUE; return FALSE; } @@ -1487,7 +1587,7 @@ const_ok_for_op (HOST_WIDE_INT i, enum rtx_code code) return const_ok_for_arm (ARM_SIGN_EXTEND (~i)); default: - abort (); + gcc_unreachable (); } } @@ -1687,17 +1787,15 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond, gen_rtx_SET (VOIDmode, target, source)); return 1; } - if (remainder == 0xffffffff) - { - if (generate) - emit_constant_insn (cond, - gen_rtx_SET (VOIDmode, target, - gen_rtx_NOT (mode, source))); - return 1; - } - - /* We don't know how to handle this yet below. */ - abort (); + + /* We don't know how to handle other cases yet. */ + gcc_assert (remainder == 0xffffffff); + + if (generate) + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, target, + gen_rtx_NOT (mode, source))); + return 1; case MINUS: /* We treat MINUS as (val - source), since (source - val) is always @@ -1724,7 +1822,7 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond, break; default: - abort (); + gcc_unreachable (); } /* If we can do it in one insn get out quickly. */ @@ -1819,6 +1917,41 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond, } } + /* See if we can calculate the value as the difference between two + valid immediates. */ + if (clear_sign_bit_copies + clear_zero_bit_copies <= 16) + { + int topshift = clear_sign_bit_copies & ~1; + + temp1 = ARM_SIGN_EXTEND ((remainder + (0x00800000 >> topshift)) + & (0xff000000 >> topshift)); + + /* If temp1 is zero, then that means the 9 most significant + bits of remainder were 1 and we've caused it to overflow. + When topshift is 0 we don't need to do anything since we + can borrow from 'bit 32'. */ + if (temp1 == 0 && topshift != 0) + temp1 = 0x80000000 >> (topshift - 1); + + temp2 = ARM_SIGN_EXTEND (temp1 - remainder); + + if (const_ok_for_arm (temp2)) + { + if (generate) + { + rtx new_src = subtargets ? gen_reg_rtx (mode) : target; + emit_constant_insn (cond, + gen_rtx_SET (VOIDmode, new_src, + GEN_INT (temp1))); + emit_constant_insn (cond, + gen_addsi3 (target, new_src, + GEN_INT (-temp2))); + } + + return 2; + } + } + /* See if we can generate this by setting the bottom (or the top) 16 bits, and then shifting these into the other half of the word. We only look for the simplest cases, to do more would cost @@ -2269,7 +2402,7 @@ arm_canonicalize_comparison (enum rtx_code code, rtx * op1) break; default: - abort (); + gcc_unreachable (); } return code; @@ -2285,11 +2418,23 @@ arm_function_value(tree type, tree func ATTRIBUTE_UNUSED) int unsignedp ATTRIBUTE_UNUSED; rtx r ATTRIBUTE_UNUSED; - mode = TYPE_MODE (type); /* Promote integer types. */ if (INTEGRAL_TYPE_P (type)) PROMOTE_FUNCTION_MODE (mode, unsignedp, type); + + /* Promotes small structs returned in a register to full-word size + for big-endian AAPCS. */ + if (arm_return_in_msb (type)) + { + HOST_WIDE_INT size = int_size_in_bytes (type); + if (size % UNITS_PER_WORD != 0) + { + size += UNITS_PER_WORD - size % UNITS_PER_WORD; + mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0); + } + } + return LIBCALL_VALUE(mode); } @@ -2325,6 +2470,7 @@ arm_return_in_memory (tree type) HOST_WIDE_INT size; if (!AGGREGATE_TYPE_P (type) && + (TREE_CODE (type) != VECTOR_TYPE) && !(TARGET_AAPCS_BASED && TREE_CODE (type) == COMPLEX_TYPE)) /* All simple types are returned in registers. For AAPCS, complex types are treated the same as aggregates. */ @@ -2339,6 +2485,11 @@ arm_return_in_memory (tree type) return (size < 0 || size > UNITS_PER_WORD); } + /* To maximize backwards compatibility with previous versions of gcc, + return vectors up to 4 words in registers. */ + if (TREE_CODE (type) == VECTOR_TYPE) + return (size < 0 || size > (4 * UNITS_PER_WORD)); + /* For the arm-wince targets we choose to be compatible with Microsoft's ARM and Thumb compilers, which always return aggregates in memory. */ #ifndef ARM_WINCE @@ -2661,7 +2812,7 @@ arm_handle_fndecl_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2679,7 +2830,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2693,7 +2844,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, { if (arm_isr_value (args) == ARM_FT_UNKNOWN) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -2720,7 +2871,7 @@ arm_handle_isr_attribute (tree *node, tree name, tree args, int flags, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); } } } @@ -2997,10 +3148,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) if (reg == 0) { - if (no_new_pseudos) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!no_new_pseudos); + reg = gen_reg_rtx (Pmode); subregs = 1; } @@ -3051,20 +3200,15 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) if (reg == 0) { - if (no_new_pseudos) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!no_new_pseudos); + reg = gen_reg_rtx (Pmode); } - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); - } - else - abort (); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, + base == reg ? 0 : reg); if (GET_CODE (offset) == CONST_INT) { @@ -3072,10 +3216,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) test the index for the appropriate mode. */ if (!arm_legitimate_index_p (mode, offset, SET, 0)) { - if (!no_new_pseudos) - offset = force_reg (Pmode, offset); - else - abort (); + gcc_assert (!no_new_pseudos); + offset = force_reg (Pmode, offset); } if (GET_CODE (offset) == CONST_INT) @@ -3148,7 +3290,7 @@ thumb_find_work_register (unsigned long pushed_regs_mask) /* Something went wrong - thumb_compute_save_reg_mask() should have arranged for a suitable register to be pushed. */ - abort (); + gcc_unreachable (); } @@ -3165,8 +3307,7 @@ arm_load_pic_register (unsigned int scratch) if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE) return; - if (!flag_pic) - abort (); + gcc_assert (flag_pic); l1 = gen_label_rtx (); @@ -3980,7 +4121,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) case MULT: /* This should have been handled by the CPU specific routines. */ - abort (); + gcc_unreachable (); case TRUNCATE: if (arm_arch3m && mode == SImode @@ -4041,9 +4182,9 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer) return 1; default: - break; + gcc_unreachable (); } - abort (); + gcc_unreachable (); case CONST_INT: if (const_ok_for_arm (INTVAL (x))) @@ -4888,6 +5029,17 @@ vfp_secondary_reload_class (enum machine_mode mode, rtx x) return GENERAL_REGS; } +/* Values which must be returned in the most-significant end of the return + register. */ + +static bool +arm_return_in_msb (tree valtype) +{ + return (TARGET_AAPCS_BASED + && BYTES_BIG_ENDIAN + && (AGGREGATE_TYPE_P (valtype) + || TREE_CODE (valtype) == COMPLEX_TYPE)); +} /* Returns TRUE if INSN is an "LDR REG, ADDR" instruction. Use by the Cirrus Maverick code which has to workaround @@ -4930,7 +5082,7 @@ arm_cirrus_insn_p (rtx insn) { enum attr_cirrus attr; - /* get_attr aborts on USE and CLOBBER. */ + /* get_attr cannot accept USE or CLOBBER. */ if (!insn || GET_CODE (insn) != INSN || GET_CODE (PATTERN (insn)) == USE @@ -5002,10 +5154,11 @@ cirrus_reorg (rtx first) /* Get Arm register number for ldr insn. */ if (GET_CODE (lhs) == REG) arm_regno = REGNO (lhs); - else if (GET_CODE (rhs) == REG) - arm_regno = REGNO (rhs); else - abort (); + { + gcc_assert (GET_CODE (rhs) == REG); + arm_regno = REGNO (rhs); + } /* Next insn. */ first = next_nonnote_insn (first); @@ -5031,7 +5184,7 @@ cirrus_reorg (rtx first) } } - /* get_attr aborts on USE and CLOBBER. */ + /* get_attr cannot accept USE or CLOBBER. */ if (!first || GET_CODE (first) != INSN || GET_CODE (PATTERN (first)) == USE @@ -5123,22 +5276,29 @@ minmax_code (rtx x) { enum rtx_code code = GET_CODE (x); - if (code == SMAX) - return GE; - else if (code == SMIN) - return LE; - else if (code == UMIN) - return LEU; - else if (code == UMAX) - return GEU; - - abort (); + switch (code) + { + case SMAX: + return GE; + case SMIN: + return LE; + case UMIN: + return LEU; + case UMAX: + return GEU; + default: + gcc_unreachable (); + } } /* Return 1 if memory locations are adjacent. */ int adjacent_mem_locations (rtx a, rtx b) { + /* We don't guarantee to preserve the order of these memory refs. */ + if (volatile_refs_p (a) || volatile_refs_p (b)) + return 0; + if ((GET_CODE (XEXP (a, 0)) == REG || (GET_CODE (XEXP (a, 0)) == PLUS && GET_CODE (XEXP (XEXP (a, 0), 1)) == CONST_INT)) @@ -5178,6 +5338,17 @@ adjacent_mem_locations (rtx a, rtx b) return 0; val_diff = val1 - val0; + + if (arm_ld_sched) + { + /* If the target has load delay slots, then there's no benefit + to using an ldm instruction unless the offset is zero and + we are optimizing for size. */ + return (optimize_size && (REGNO (reg0) == REGNO (reg1)) + && (val0 == 0 || val1 == 0 || val0 == 4 || val1 == 4) + && (val_diff == 4 || val_diff == -4)); + } + return ((REGNO (reg0) == REGNO (reg1)) && (val_diff == 4 || val_diff == -4)); } @@ -5197,8 +5368,7 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, /* Can only handle 2, 3, or 4 insns at present, though could be easily extended if required. */ - if (nops < 2 || nops > 4) - abort (); + gcc_assert (nops >= 2 && nops <= 4); /* Loop over the operands and check that the memory references are suitable (i.e. immediate offsets from the same base register). At @@ -5213,8 +5383,7 @@ load_multiple_sequence (rtx *operands, int nops, int *regs, int *base, if (GET_CODE (operands[nops + i]) == SUBREG) operands[nops + i] = alter_subreg (operands + (nops + i)); - if (GET_CODE (operands[nops + i]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[nops + i]) == MEM); /* Don't reorder volatile memory references; it doesn't seem worth looking for the case where the order is ok anyway. */ @@ -5398,7 +5567,7 @@ emit_ldm_seq (rtx *operands, int nops) break; default: - abort (); + gcc_unreachable (); } sprintf (buf + strlen (buf), "%s%s, {%s%s", REGISTER_PREFIX, @@ -5426,8 +5595,7 @@ store_multiple_sequence (rtx *operands, int nops, int *regs, int *base, /* Can only handle 2, 3, or 4 insns at present, though could be easily extended if required. */ - if (nops < 2 || nops > 4) - abort (); + gcc_assert (nops >= 2 && nops <= 4); /* Loop over the operands and check that the memory references are suitable (i.e. immediate offsets from the same base register). At @@ -5442,8 +5610,7 @@ store_multiple_sequence (rtx *operands, int nops, int *regs, int *base, if (GET_CODE (operands[nops + i]) == SUBREG) operands[nops + i] = alter_subreg (operands + (nops + i)); - if (GET_CODE (operands[nops + i]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[nops + i]) == MEM); /* Don't reorder volatile memory references; it doesn't seem worth looking for the case where the order is ok anyway. */ @@ -5575,7 +5742,7 @@ emit_stm_seq (rtx *operands, int nops) break; default: - abort (); + gcc_unreachable (); } sprintf (buf + strlen (buf), "%s%s, {%s%s", REGISTER_PREFIX, @@ -5826,21 +5993,18 @@ arm_gen_movmemqi (rtx *operands) emit_move_insn (mem, sreg); in_words_to_go--; - if (in_words_to_go) /* Sanity check */ - abort (); + gcc_assert (!in_words_to_go); /* Sanity check */ } if (in_words_to_go) { - if (in_words_to_go < 0) - abort (); + gcc_assert (in_words_to_go > 0); mem = adjust_automodify_address (srcbase, SImode, src, srcoffset); part_bytes_reg = copy_to_mode_reg (SImode, mem); } - if (last_bytes && part_bytes_reg == NULL) - abort (); + gcc_assert (!last_bytes || part_bytes_reg); if (BYTES_BIG_ENDIAN && last_bytes) { @@ -5969,78 +6133,108 @@ arm_select_dominance_cc_mode (rtx x, rtx y, HOST_WIDE_INT cond_or) switch (cond1) { case EQ: - if (cond2 == EQ || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DEQmode; switch (cond2) { + case EQ: return CC_DEQmode; case LE: return CC_DLEmode; case LEU: return CC_DLEUmode; case GE: return CC_DGEmode; case GEU: return CC_DGEUmode; - default: break; + default: gcc_unreachable (); } - break; - case LT: - if (cond2 == LT || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DLTmode; - if (cond2 == LE) - return CC_DLEmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case LT: + return CC_DLTmode; + case LE: + return CC_DLEmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } case GT: - if (cond2 == GT || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DGTmode; - if (cond2 == GE) - return CC_DGEmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case GT: + return CC_DGTmode; + case GE: + return CC_DGEmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } case LTU: - if (cond2 == LTU || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DLTUmode; - if (cond2 == LEU) - return CC_DLEUmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case LTU: + return CC_DLTUmode; + case LEU: + return CC_DLEUmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } case GTU: - if (cond2 == GTU || cond_or == DOM_CC_X_AND_Y) + if (cond_or == DOM_CC_X_AND_Y) return CC_DGTUmode; - if (cond2 == GEU) - return CC_DGEUmode; - if (cond2 == NE) - return CC_DNEmode; - break; + + switch (cond2) + { + case GTU: + return CC_DGTUmode; + case GEU: + return CC_DGEUmode; + case NE: + return CC_DNEmode; + default: + gcc_unreachable (); + } /* The remaining cases only occur when both comparisons are the same. */ case NE: + gcc_assert (cond1 == cond2); return CC_DNEmode; case LE: + gcc_assert (cond1 == cond2); return CC_DLEmode; case GE: + gcc_assert (cond1 == cond2); return CC_DGEmode; case LEU: + gcc_assert (cond1 == cond2); return CC_DLEUmode; case GEU: + gcc_assert (cond1 == cond2); return CC_DGEUmode; default: - break; + gcc_unreachable (); } - - abort (); } enum machine_mode @@ -6073,7 +6267,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) return CCFPEmode; default: - abort (); + gcc_unreachable (); } } @@ -6085,6 +6279,13 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y) || GET_CODE (x) == ROTATERT)) return CC_SWPmode; + /* This operation is performed swapped, but since we only rely on the Z + flag we don't need an additional mode. */ + if (GET_MODE (y) == SImode && REG_P (y) + && GET_CODE (x) == NEG + && (op == EQ || op == NE)) + return CC_Zmode; + /* This is a special case that is used by combine to allow a comparison of a shifted byte load to be split into a zero-extend followed by a comparison of the shifted integer (only valid for @@ -6253,8 +6454,7 @@ arm_reload_in_hi (rtx *operands) ^ (HOST_WIDE_INT) 0x80000000) - (HOST_WIDE_INT) 0x80000000); - if (hi + lo != offset) - abort (); + gcc_assert (hi + lo == offset); if (hi != 0) { @@ -6400,8 +6600,7 @@ arm_reload_out_hi (rtx *operands) ^ (HOST_WIDE_INT) 0x80000000) - (HOST_WIDE_INT) 0x80000000); - if (hi + lo != offset) - abort (); + gcc_assert (hi + lo == offset); if (hi != 0) { @@ -6464,6 +6663,59 @@ arm_reload_out_hi (rtx *operands) gen_lowpart (QImode, scratch))); } } + +/* Return true if a type must be passed in memory. For AAPCS, small aggregates + (padded to the size of a word) should be passed in a register. */ + +static bool +arm_must_pass_in_stack (enum machine_mode mode, tree type) +{ + if (TARGET_AAPCS_BASED) + return must_pass_in_stack_var_size (mode, type); + else + return must_pass_in_stack_var_size_or_pad (mode, type); +} + + +/* For use by FUNCTION_ARG_PADDING (MODE, TYPE). + Return true if an argument passed on the stack should be padded upwards, + i.e. if the least-significant byte has useful data. */ + +bool +arm_pad_arg_upward (enum machine_mode mode, tree type) +{ + if (!TARGET_AAPCS_BASED) + return DEFAULT_FUNCTION_ARG_PADDING(mode, type); + + if (type && BYTES_BIG_ENDIAN && INTEGRAL_TYPE_P (type)) + return false; + + return true; +} + + +/* Similarly, for use by BLOCK_REG_PADDING (MODE, TYPE, FIRST). + For non-AAPCS, return !BYTES_BIG_ENDIAN if the least significant + byte of the register has useful data, and return the opposite if the + most significant byte does. + For AAPCS, small aggregates and small complex types are always padded + upwards. */ + +bool +arm_pad_reg_upward (enum machine_mode mode ATTRIBUTE_UNUSED, + tree type, int first ATTRIBUTE_UNUSED) +{ + if (TARGET_AAPCS_BASED + && BYTES_BIG_ENDIAN + && (AGGREGATE_TYPE_P (type) || TREE_CODE (type) == COMPLEX_TYPE) + && int_size_in_bytes (type) <= 4) + return true; + + /* Otherwise, use default padding. */ + return !BYTES_BIG_ENDIAN; +} + + /* Print a symbolic form of X to the debug file, F. */ static void @@ -6698,10 +6950,8 @@ static Mnode * move_minipool_fix_forward_ref (Mnode *mp, Mnode *max_mp, HOST_WIDE_INT max_address) { - /* This should never be true and the code below assumes these are - different. */ - if (mp == max_mp) - abort (); + /* The code below assumes these are different. */ + gcc_assert (mp != max_mp); if (max_mp == NULL) { @@ -6873,10 +7123,8 @@ move_minipool_fix_backward_ref (Mnode *mp, Mnode *min_mp, { HOST_WIDE_INT offset; - /* This should never be true, and the code below assumes these are - different. */ - if (mp == min_mp) - abort (); + /* The code below assumes these are different. */ + gcc_assert (mp != min_mp); if (min_mp == NULL) { @@ -7156,8 +7404,7 @@ dump_minipool (rtx scan) #endif default: - abort (); - break; + gcc_unreachable (); } } @@ -7229,8 +7476,7 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address) /* This code shouldn't have been called if there was a natural barrier within range. */ - if (GET_CODE (from) == BARRIER) - abort (); + gcc_assert (GET_CODE (from) != BARRIER); /* Count the length of this insn. */ count += get_attr_length (from); @@ -7335,10 +7581,9 @@ push_minipool_fix (rtx insn, HOST_WIDE_INT address, rtx *loc, fix->minipool = NULL; /* If an insn doesn't have a range defined for it, then it isn't - expecting to be reworked by this code. Better to abort now than + expecting to be reworked by this code. Better to stop now than to generate duff assembly code. */ - if (fix->forwards == 0 && fix->backwards == 0) - abort (); + gcc_assert (fix->forwards || fix->backwards); /* With AAPCS/iWMMXt enabled, the pool is aligned to an 8-byte boundary. So there might be an empty word before the start of the pool. @@ -7369,57 +7614,72 @@ push_minipool_fix (rtx insn, HOST_WIDE_INT address, rtx *loc, minipool_fix_tail = fix; } -/* Return the cost of synthesizing the const_double VAL inline. +/* Return the cost of synthesizing a 64-bit constant VAL inline. Returns the number of insns needed, or 99 if we don't know how to do it. */ int arm_const_double_inline_cost (rtx val) { - long parts[2]; + rtx lowpart, highpart; + enum machine_mode mode; - if (GET_MODE (val) == DFmode) - { - REAL_VALUE_TYPE r; - if (!TARGET_SOFT_FLOAT) - return 99; - REAL_VALUE_FROM_CONST_DOUBLE (r, val); - REAL_VALUE_TO_TARGET_DOUBLE (r, parts); - } - else if (GET_MODE (val) != VOIDmode) - return 99; - else - { - parts[0] = CONST_DOUBLE_LOW (val); - parts[1] = CONST_DOUBLE_HIGH (val); - } + mode = GET_MODE (val); + + if (mode == VOIDmode) + mode = DImode; + + gcc_assert (GET_MODE_SIZE (mode) == 8); + + lowpart = gen_lowpart (SImode, val); + highpart = gen_highpart_mode (SImode, mode, val); + + gcc_assert (GET_CODE (lowpart) == CONST_INT); + gcc_assert (GET_CODE (highpart) == CONST_INT); - return (arm_gen_constant (SET, SImode, NULL_RTX, parts[0], + return (arm_gen_constant (SET, SImode, NULL_RTX, INTVAL (lowpart), NULL_RTX, NULL_RTX, 0, 0) - + arm_gen_constant (SET, SImode, NULL_RTX, parts[1], + + arm_gen_constant (SET, SImode, NULL_RTX, INTVAL (highpart), NULL_RTX, NULL_RTX, 0, 0)); } -/* Determine if a CONST_DOUBLE should be pushed to the minipool */ -static bool -const_double_needs_minipool (rtx val) +/* Return true if it is worthwhile to split a 64-bit constant into two + 32-bit operations. This is the case if optimizing for size, or + if we have load delay slots, or if one 32-bit part can be done with + a single data operation. */ +bool +arm_const_double_by_parts (rtx val) { - /* thumb only knows to load a CONST_DOUBLE from memory at the moment */ - if (TARGET_THUMB) + enum machine_mode mode = GET_MODE (val); + rtx part; + + if (optimize_size || arm_ld_sched) return true; - /* Don't push anything to the minipool if a CONST_DOUBLE can be built with - a few ALU insns directly. On balance, the optimum is likely to be around - 3 insns, except when there are no load delay slots where it should be 4. - When optimizing for size, a limit of 3 allows saving at least one word - except for cases where a single minipool entry could be shared more than - 2 times which is rather unlikely to outweight the overall savings. */ - return (arm_const_double_inline_cost (val) - > ((optimize_size || arm_ld_sched) ? 3 : 4)); + if (mode == VOIDmode) + mode = DImode; + + part = gen_highpart_mode (SImode, mode, val); + + gcc_assert (GET_CODE (part) == CONST_INT); + + if (const_ok_for_arm (INTVAL (part)) + || const_ok_for_arm (~INTVAL (part))) + return true; + + part = gen_lowpart (SImode, val); + + gcc_assert (GET_CODE (part) == CONST_INT); + + if (const_ok_for_arm (INTVAL (part)) + || const_ok_for_arm (~INTVAL (part))) + return true; + + return false; } /* Scan INSN and note any of its operands that need fixing. If DO_PUSHES is false we do not actually push any of the fixups - needed. The function returns TRUE is any fixups were needed/pushed. + needed. The function returns TRUE if any fixups were needed/pushed. This is used by arm_memory_load_p() which needs to know about loads of constants that will be converted into minipool loads. */ static bool @@ -7436,7 +7696,8 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes) if (recog_data.n_alternatives == 0) return false; - /* Fill in recog_op_alt with information about the constraints of this insn. */ + /* Fill in recog_op_alt with information about the constraints of + this insn. */ preprocess_constraints (); for (opno = 0; opno < recog_data.n_operands; opno++) @@ -7453,9 +7714,7 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes) { rtx op = recog_data.operand[opno]; - if (CONSTANT_P (op) - && (GET_CODE (op) != CONST_DOUBLE - || const_double_needs_minipool (op))) + if (CONSTANT_P (op)) { if (do_pushes) push_minipool_fix (insn, address, recog_data.operand_loc[opno], @@ -7507,8 +7766,7 @@ arm_reorg (void) /* The first insn must always be a note, or the code below won't scan it properly. */ insn = get_insns (); - if (GET_CODE (insn) != NOTE) - abort (); + gcc_assert (GET_CODE (insn) == NOTE); /* Scan all the insns and record the operands that will need fixing. */ for (insn = next_nonnote_insn (insn); insn; insn = next_nonnote_insn (insn)) @@ -7602,8 +7860,7 @@ arm_reorg (void) /* The last item on the list of fixes must be a barrier, so we can never run off the end of the list of fixes without last_barrier being set. */ - if (ftmp == NULL) - abort (); + gcc_assert (ftmp); max_address = minipool_vector_head->max_address; /* Check that there isn't another fix that is in range that @@ -7673,7 +7930,7 @@ fp_immediate_constant (rtx x) if (REAL_VALUES_EQUAL (r, values_fp[i])) return strings_fp[i]; - abort (); + gcc_unreachable (); } /* As for fp_immediate_constant, but value is passed directly, not in rtx. */ @@ -7689,7 +7946,7 @@ fp_const_from_val (REAL_VALUE_TYPE *r) if (REAL_VALUES_EQUAL (*r, values_fp[i])) return strings_fp[i]; - abort (); + gcc_unreachable (); } /* Output the operands of a LDM/STM instruction to STREAM. @@ -7767,8 +8024,7 @@ vfp_output_fstmx (rtx * operands) strcpy (pattern, "fstmfdx\t%m0!, {%P1"); p = strlen (pattern); - if (GET_CODE (operands[1]) != REG) - abort (); + gcc_assert (GET_CODE (operands[1]) == REG); base = (REGNO (operands[1]) - FIRST_VFP_REGNUM) / 2; for (i = 1; i < XVECLEN (operands[2], 0); i++) @@ -7862,8 +8118,7 @@ vfp_emit_fstmx (int base_reg, int count) const char * output_call (rtx *operands) { - if (arm_arch5) - abort (); /* Patterns should call blx directly. */ + gcc_assert (!arm_arch5); /* Patterns should call blx directly. */ /* Handle calls to lr using ip (which may be clobbered in subr anyway). */ if (REGNO (operands[0]) == LR_REGNUM) @@ -7928,8 +8183,7 @@ output_mov_long_double_fpa_from_arm (rtx *operands) int arm_reg0 = REGNO (operands[1]); rtx ops[3]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); @@ -7950,8 +8204,7 @@ output_mov_long_double_arm_from_fpa (rtx *operands) int arm_reg0 = REGNO (operands[0]); rtx ops[3]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); @@ -8006,8 +8259,7 @@ output_mov_double_fpa_from_arm (rtx *operands) int arm_reg0 = REGNO (operands[1]); rtx ops[2]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); @@ -8025,8 +8277,7 @@ output_mov_double_arm_from_fpa (rtx *operands) int arm_reg0 = REGNO (operands[0]); rtx ops[2]; - if (arm_reg0 == IP_REGNUM) - abort (); + gcc_assert (arm_reg0 != IP_REGNUM); ops[0] = gen_rtx_REG (SImode, arm_reg0); ops[1] = gen_rtx_REG (SImode, 1 + arm_reg0); @@ -8051,328 +8302,152 @@ output_move_double (rtx *operands) otherops[0] = gen_rtx_REG (SImode, 1 + reg0); - if (code1 == REG) - { - int reg1 = REGNO (operands[1]); - if (reg1 == IP_REGNUM) - abort (); + gcc_assert (code1 == MEM); /* Constraints should ensure this. */ - /* Ensure the second source is not overwritten. */ - if (reg1 == reg0 + (WORDS_BIG_ENDIAN ? -1 : 1)) - output_asm_insn ("mov%?\t%Q0, %Q1\n\tmov%?\t%R0, %R1", operands); - else - output_asm_insn ("mov%?\t%R0, %R1\n\tmov%?\t%Q0, %Q1", operands); - } - else if (code1 == CONST_VECTOR) + switch (GET_CODE (XEXP (operands[1], 0))) { - HOST_WIDE_INT hint = 0; - - switch (GET_MODE (operands[1])) + case REG: + output_asm_insn ("ldm%?ia\t%m1, %M0", operands); + break; + + case PRE_INC: + gcc_assert (TARGET_LDRD); + output_asm_insn ("ldr%?d\t%0, [%m1, #8]!", operands); + break; + + case PRE_DEC: + output_asm_insn ("ldm%?db\t%m1!, %M0", operands); + break; + + case POST_INC: + output_asm_insn ("ldm%?ia\t%m1!, %M0", operands); + break; + + case POST_DEC: + gcc_assert (TARGET_LDRD); + output_asm_insn ("ldr%?d\t%0, [%m1], #-8", operands); + break; + + case PRE_MODIFY: + case POST_MODIFY: + otherops[0] = operands[0]; + otherops[1] = XEXP (XEXP (XEXP (operands[1], 0), 1), 0); + otherops[2] = XEXP (XEXP (XEXP (operands[1], 0), 1), 1); + + if (GET_CODE (XEXP (operands[1], 0)) == PRE_MODIFY) { - case V2SImode: - otherops[1] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 1))); - operands[1] = GEN_INT (INTVAL (CONST_VECTOR_ELT (operands[1], 0))); - break; - - case V4HImode: - if (BYTES_BIG_ENDIAN) + if (reg_overlap_mentioned_p (otherops[0], otherops[2])) { - hint = INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3)); + /* Registers overlap so split out the increment. */ + output_asm_insn ("add%?\t%1, %1, %2", otherops); + output_asm_insn ("ldr%?d\t%0, [%1] @split", otherops); } else - { - hint = INTVAL (CONST_VECTOR_ELT (operands[1], 3)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - } - - otherops[1] = GEN_INT (hint); - hint = 0; - - if (BYTES_BIG_ENDIAN) - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - } - else - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - hint <<= 16; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - } - - operands[1] = GEN_INT (hint); - break; - - case V8QImode: - if (BYTES_BIG_ENDIAN) - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 4)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 5)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 6)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 7)); - } - else - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 7)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 6)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 5)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 4)); - } - - otherops[1] = GEN_INT (hint); - hint = 0; - - if (BYTES_BIG_ENDIAN) - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3)); - } - else - { - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 3)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 2)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 1)); - hint <<= 8; - hint |= INTVAL (CONST_VECTOR_ELT (operands[1], 0)); - } - - operands[1] = GEN_INT (hint); - break; - - default: - abort (); - } - output_mov_immediate (operands); - output_mov_immediate (otherops); - } - else if (code1 == CONST_DOUBLE) - { - if (GET_MODE (operands[1]) == DFmode) - { - REAL_VALUE_TYPE r; - long l[2]; - - REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]); - REAL_VALUE_TO_TARGET_DOUBLE (r, l); - otherops[1] = GEN_INT (l[1]); - operands[1] = GEN_INT (l[0]); - } - else if (GET_MODE (operands[1]) != VOIDmode) - abort (); - else if (WORDS_BIG_ENDIAN) - { - otherops[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - operands[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); - } - else - { - otherops[1] = GEN_INT (CONST_DOUBLE_HIGH (operands[1])); - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); - } - - output_mov_immediate (operands); - output_mov_immediate (otherops); - } - else if (code1 == CONST_INT) - { -#if HOST_BITS_PER_WIDE_INT > 32 - /* If HOST_WIDE_INT is more than 32 bits, the intval tells us - what the upper word is. */ - if (WORDS_BIG_ENDIAN) - { - otherops[1] = GEN_INT (ARM_SIGN_EXTEND (INTVAL (operands[1]))); - operands[1] = GEN_INT (INTVAL (operands[1]) >> 32); + output_asm_insn ("ldr%?d\t%0, [%1, %2]!", otherops); } else { - otherops[1] = GEN_INT (INTVAL (operands[1]) >> 32); - operands[1] = GEN_INT (ARM_SIGN_EXTEND (INTVAL (operands[1]))); - } -#else - /* Sign extend the intval into the high-order word. */ - if (WORDS_BIG_ENDIAN) - { - otherops[1] = operands[1]; - operands[1] = (INTVAL (operands[1]) < 0 - ? constm1_rtx : const0_rtx); + /* We only allow constant increments, so this is safe. */ + output_asm_insn ("ldr%?d\t%0, [%1], %2", otherops); } - else - otherops[1] = INTVAL (operands[1]) < 0 ? constm1_rtx : const0_rtx; -#endif - output_mov_immediate (otherops); - output_mov_immediate (operands); - } - else if (code1 == MEM) - { - switch (GET_CODE (XEXP (operands[1], 0))) + break; + + case LABEL_REF: + case CONST: + output_asm_insn ("adr%?\t%0, %1", operands); + output_asm_insn ("ldm%?ia\t%0, %M0", operands); + break; + + default: + if (arm_add_operand (XEXP (XEXP (operands[1], 0), 1), + GET_MODE (XEXP (XEXP (operands[1], 0), 1)))) { - case REG: - output_asm_insn ("ldm%?ia\t%m1, %M0", operands); - break; - - case PRE_INC: - if (!TARGET_LDRD) - abort (); /* Should never happen now. */ - output_asm_insn ("ldr%?d\t%0, [%m1, #8]!", operands); - break; - - case PRE_DEC: - output_asm_insn ("ldm%?db\t%m1!, %M0", operands); - break; - - case POST_INC: - output_asm_insn ("ldm%?ia\t%m1!, %M0", operands); - break; - - case POST_DEC: - if (!TARGET_LDRD) - abort (); /* Should never happen now. */ - output_asm_insn ("ldr%?d\t%0, [%m1], #-8", operands); - break; - - case PRE_MODIFY: - case POST_MODIFY: otherops[0] = operands[0]; - otherops[1] = XEXP (XEXP (XEXP (operands[1], 0), 1), 0); - otherops[2] = XEXP (XEXP (XEXP (operands[1], 0), 1), 1); - - if (GET_CODE (XEXP (operands[1], 0)) == PRE_MODIFY) - { - if (reg_overlap_mentioned_p (otherops[0], otherops[2])) - { - /* Registers overlap so split out the increment. */ - output_asm_insn ("add%?\t%1, %1, %2", otherops); - output_asm_insn ("ldr%?d\t%0, [%1] @split", otherops); - } - else - output_asm_insn ("ldr%?d\t%0, [%1, %2]!", otherops); - } - else - { - /* We only allow constant increments, so this is safe. */ - output_asm_insn ("ldr%?d\t%0, [%1], %2", otherops); - } - break; - - case LABEL_REF: - case CONST: - output_asm_insn ("adr%?\t%0, %1", operands); - output_asm_insn ("ldm%?ia\t%0, %M0", operands); - break; - - default: - if (arm_add_operand (XEXP (XEXP (operands[1], 0), 1), - GET_MODE (XEXP (XEXP (operands[1], 0), 1)))) + otherops[1] = XEXP (XEXP (operands[1], 0), 0); + otherops[2] = XEXP (XEXP (operands[1], 0), 1); + + if (GET_CODE (XEXP (operands[1], 0)) == PLUS) { - otherops[0] = operands[0]; - otherops[1] = XEXP (XEXP (operands[1], 0), 0); - otherops[2] = XEXP (XEXP (operands[1], 0), 1); - - if (GET_CODE (XEXP (operands[1], 0)) == PLUS) + if (GET_CODE (otherops[2]) == CONST_INT) { - if (GET_CODE (otherops[2]) == CONST_INT) + switch ((int) INTVAL (otherops[2])) { - switch ((int) INTVAL (otherops[2])) - { - case -8: - output_asm_insn ("ldm%?db\t%1, %M0", otherops); - return ""; - case -4: - output_asm_insn ("ldm%?da\t%1, %M0", otherops); - return ""; - case 4: - output_asm_insn ("ldm%?ib\t%1, %M0", otherops); - return ""; - } + case -8: + output_asm_insn ("ldm%?db\t%1, %M0", otherops); + return ""; + case -4: + output_asm_insn ("ldm%?da\t%1, %M0", otherops); + return ""; + case 4: + output_asm_insn ("ldm%?ib\t%1, %M0", otherops); + return ""; } - if (TARGET_LDRD - && (GET_CODE (otherops[2]) == REG - || (GET_CODE (otherops[2]) == CONST_INT - && INTVAL (otherops[2]) > -256 - && INTVAL (otherops[2]) < 256))) + } + if (TARGET_LDRD + && (GET_CODE (otherops[2]) == REG + || (GET_CODE (otherops[2]) == CONST_INT + && INTVAL (otherops[2]) > -256 + && INTVAL (otherops[2]) < 256))) + { + if (reg_overlap_mentioned_p (otherops[0], + otherops[2])) { - if (reg_overlap_mentioned_p (otherops[0], - otherops[2])) - { - /* Swap base and index registers over to - avoid a conflict. */ - otherops[1] = XEXP (XEXP (operands[1], 0), 1); - otherops[2] = XEXP (XEXP (operands[1], 0), 0); - - } - /* If both registers conflict, it will usually - have been fixed by a splitter. */ - if (reg_overlap_mentioned_p (otherops[0], - otherops[2])) - { - output_asm_insn ("add%?\t%1, %1, %2", otherops); - output_asm_insn ("ldr%?d\t%0, [%1]", - otherops); - return ""; - } - else - { - output_asm_insn ("ldr%?d\t%0, [%1, %2]", - otherops); - return ""; - } + /* Swap base and index registers over to + avoid a conflict. */ + otherops[1] = XEXP (XEXP (operands[1], 0), 1); + otherops[2] = XEXP (XEXP (operands[1], 0), 0); + } - if (GET_CODE (otherops[2]) == CONST_INT) + /* If both registers conflict, it will usually + have been fixed by a splitter. */ + if (reg_overlap_mentioned_p (otherops[0], otherops[2])) { - if (!(const_ok_for_arm (INTVAL (otherops[2])))) - output_asm_insn ("sub%?\t%0, %1, #%n2", otherops); - else - output_asm_insn ("add%?\t%0, %1, %2", otherops); + output_asm_insn ("add%?\t%1, %1, %2", otherops); + output_asm_insn ("ldr%?d\t%0, [%1]", + otherops); } else - output_asm_insn ("add%?\t%0, %1, %2", otherops); + output_asm_insn ("ldr%?d\t%0, [%1, %2]", otherops); + return ""; } - else - output_asm_insn ("sub%?\t%0, %1, %2", otherops); - - return "ldm%?ia\t%0, %M0"; - } - else - { - otherops[1] = adjust_address (operands[1], SImode, 4); - /* Take care of overlapping base/data reg. */ - if (reg_mentioned_p (operands[0], operands[1])) + + if (GET_CODE (otherops[2]) == CONST_INT) { - output_asm_insn ("ldr%?\t%0, %1", otherops); - output_asm_insn ("ldr%?\t%0, %1", operands); + if (!(const_ok_for_arm (INTVAL (otherops[2])))) + output_asm_insn ("sub%?\t%0, %1, #%n2", otherops); + else + output_asm_insn ("add%?\t%0, %1, %2", otherops); } else - { - output_asm_insn ("ldr%?\t%0, %1", operands); - output_asm_insn ("ldr%?\t%0, %1", otherops); - } + output_asm_insn ("add%?\t%0, %1, %2", otherops); + } + else + output_asm_insn ("sub%?\t%0, %1, %2", otherops); + + return "ldm%?ia\t%0, %M0"; + } + else + { + otherops[1] = adjust_address (operands[1], SImode, 4); + /* Take care of overlapping base/data reg. */ + if (reg_mentioned_p (operands[0], operands[1])) + { + output_asm_insn ("ldr%?\t%0, %1", otherops); + output_asm_insn ("ldr%?\t%0, %1", operands); + } + else + { + output_asm_insn ("ldr%?\t%0, %1", operands); + output_asm_insn ("ldr%?\t%0, %1", otherops); } } } - else - abort (); /* Constraints should prevent this. */ } - else if (code0 == MEM && code1 == REG) + else { - if (REGNO (operands[1]) == IP_REGNUM) - abort (); + /* Constraints should ensure this. */ + gcc_assert (code0 == MEM && code1 == REG); + gcc_assert (REGNO (operands[1]) != IP_REGNUM); switch (GET_CODE (XEXP (operands[0], 0))) { @@ -8381,8 +8456,7 @@ output_move_double (rtx *operands) break; case PRE_INC: - if (!TARGET_LDRD) - abort (); /* Should never happen now. */ + gcc_assert (TARGET_LDRD); output_asm_insn ("str%?d\t%1, [%m0, #8]!", operands); break; @@ -8395,8 +8469,7 @@ output_move_double (rtx *operands) break; case POST_DEC: - if (!TARGET_LDRD) - abort (); /* Should never happen now. */ + gcc_assert (TARGET_LDRD); output_asm_insn ("str%?d\t%1, [%m0], #-8", operands); break; @@ -8451,46 +8524,6 @@ output_move_double (rtx *operands) output_asm_insn ("str%?\t%1, %0", otherops); } } - else - /* Constraints should prevent this. */ - abort (); - - return ""; -} - - -/* Output an arbitrary MOV reg, #n. - OPERANDS[0] is a register. OPERANDS[1] is a const_int. */ -const char * -output_mov_immediate (rtx *operands) -{ - HOST_WIDE_INT n = INTVAL (operands[1]); - - /* Try to use one MOV. */ - if (const_ok_for_arm (n)) - output_asm_insn ("mov%?\t%0, %1", operands); - - /* Try to use one MVN. */ - else if (const_ok_for_arm (~n)) - { - operands[1] = GEN_INT (~n); - output_asm_insn ("mvn%?\t%0, %1", operands); - } - else - { - int n_ones = 0; - int i; - - /* If all else fails, make it out of ORRs or BICs as appropriate. */ - for (i = 0; i < 32; i++) - if (n & 1 << i) - n_ones++; - - if (n_ones > 16) /* Shorter to use MVN with BIC in this case. */ - output_multi_immediate (operands, "mvn%?\t%0, %1", "bic%?\t%0, %0, %1", 1, ~ n); - else - output_multi_immediate (operands, "mov%?\t%0, %1", "orr%?\t%0, %0, %1", 1, n); - } return ""; } @@ -8583,7 +8616,7 @@ arithmetic_instr (rtx op, int shift_first_arg) return "and"; default: - abort (); + gcc_unreachable (); } } @@ -8598,12 +8631,20 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) const char * mnem; enum rtx_code code = GET_CODE (op); - if (GET_CODE (XEXP (op, 1)) == REG || GET_CODE (XEXP (op, 1)) == SUBREG) - *amountp = -1; - else if (GET_CODE (XEXP (op, 1)) == CONST_INT) - *amountp = INTVAL (XEXP (op, 1)); - else - abort (); + switch (GET_CODE (XEXP (op, 1))) + { + case REG: + case SUBREG: + *amountp = -1; + break; + + case CONST_INT: + *amountp = INTVAL (XEXP (op, 1)); + break; + + default: + gcc_unreachable (); + } switch (code) { @@ -8620,8 +8661,7 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) break; case ROTATE: - if (*amountp == -1) - abort (); + gcc_assert (*amountp != -1); *amountp = 32 - *amountp; /* Fall through. */ @@ -8633,14 +8673,12 @@ shift_op (rtx op, HOST_WIDE_INT *amountp) case MULT: /* We never have to worry about the amount being other than a power of 2, since this case can never be reloaded from a reg. */ - if (*amountp != -1) - *amountp = int_log2 (*amountp); - else - abort (); + gcc_assert (*amountp != -1); + *amountp = int_log2 (*amountp); return "asl"; default: - abort (); + gcc_unreachable (); } if (*amountp != -1) @@ -8679,8 +8717,7 @@ int_log2 (HOST_WIDE_INT power) while ((((HOST_WIDE_INT) 1 << shift) & power) == 0) { - if (shift > 31) - abort (); + gcc_assert (shift <= 31); shift++; } @@ -9023,8 +9060,7 @@ output_return_instruction (rtx operand, int really_return, int reverse) return ""; } - if (current_function_calls_alloca && !really_return) - abort (); + gcc_assert (!current_function_calls_alloca || really_return); sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd'); @@ -9059,11 +9095,7 @@ output_return_instruction (rtx operand, int really_return, int reverse) live_regs_mask |= (1 << SP_REGNUM); } else - { - if (! IS_INTERRUPT (func_type) - && ! TARGET_REALLY_IWMMXT) - abort (); - } + gcc_assert (IS_INTERRUPT (func_type) || TARGET_REALLY_IWMMXT); } /* On some ARM architectures it is faster to use LDR rather than @@ -9098,8 +9130,7 @@ output_return_instruction (rtx operand, int really_return, int reverse) offsets = arm_get_frame_offsets (); stack_adjust = offsets->outgoing_args - offsets->saved_regs; - if (stack_adjust != 0 && stack_adjust != 4) - abort (); + gcc_assert (stack_adjust == 0 || stack_adjust == 4); if (stack_adjust && arm_arch5) sprintf (instr, "ldm%sib\t%%|sp, {", conditional); @@ -9248,8 +9279,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) } /* Sanity check. */ - if (arm_ccfsm_state || arm_target_insn) - abort (); + gcc_assert (!arm_ccfsm_state && !arm_target_insn); func_type = arm_current_func_type (); @@ -9342,11 +9372,9 @@ arm_output_epilogue (rtx sibling) return ""; } - if (current_function_calls_eh_return - && ! really_return) - /* If we are throwing an exception, then we really must - be doing a return, so we can't tail-call. */ - abort (); + /* If we are throwing an exception, then we really must be doing a + return, so we can't tail-call. */ + gcc_assert (!current_function_calls_eh_return || really_return); offsets = arm_get_frame_offsets (); saved_regs_mask = arm_compute_save_reg_mask (); @@ -9467,8 +9495,7 @@ arm_output_epilogue (rtx sibling) frame generation actually contains the old stack pointer. So a quick way to unwind the stack is just pop the IP register directly into the stack pointer. */ - if ((saved_regs_mask & (1 << IP_REGNUM)) == 0) - abort (); + gcc_assert (saved_regs_mask & (1 << IP_REGNUM)); saved_regs_mask &= ~ (1 << IP_REGNUM); saved_regs_mask |= (1 << SP_REGNUM); @@ -9665,7 +9692,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, /* Emit any call-via-reg trampolines that are needed for v4t support of call_reg and call_value_reg type insns. */ - for (regno = 0; regno < SP_REGNUM; regno++) + for (regno = 0; regno < LR_REGNUM; regno++) { rtx label = cfun->machine->call_via[regno]; @@ -9688,11 +9715,10 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, /* We need to take into account any stack-frame rounding. */ offsets = arm_get_frame_offsets (); - if (use_return_insn (FALSE, NULL) - && return_used_this_function - && offsets->saved_regs != offsets->outgoing_args - && !frame_pointer_needed) - abort (); + gcc_assert (!use_return_insn (FALSE, NULL) + || !return_used_this_function + || offsets->saved_regs == offsets->outgoing_args + || frame_pointer_needed); /* Reset the ARM-specific per-function variables. */ after_arm_reorg = 0; @@ -9718,8 +9744,7 @@ emit_multi_reg_push (unsigned long mask) if (mask & (1 << i)) num_regs++; - if (num_regs == 0 || num_regs > 16) - abort (); + gcc_assert (num_regs && num_regs <= 16); /* We don't record the PC in the dwarf frame information. */ num_dwarf_regs = num_regs; @@ -9829,6 +9854,20 @@ emit_multi_reg_push (unsigned long mask) return par; } +/* Calculate the size of the return value that is passed in registers. */ +static int +arm_size_return_regs (void) +{ + enum machine_mode mode; + + if (current_function_return_rtx != 0) + mode = GET_MODE (current_function_return_rtx); + else + mode = DECL_MODE (DECL_RESULT (current_function_decl)); + + return GET_MODE_SIZE (mode); +} + static rtx emit_sfm (int base_reg, int count) { @@ -10046,8 +10085,7 @@ arm_get_frame_offsets (void) /* Ensure SP remains doubleword aligned. */ if (offsets->outgoing_args & 7) offsets->outgoing_args += 4; - if (offsets->outgoing_args & 7) - abort (); + gcc_assert (!(offsets->outgoing_args & 7)); } return offsets; @@ -10097,9 +10135,9 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) return offsets->outgoing_args - (offsets->saved_args + 4); default: - abort (); + gcc_unreachable (); } - break; + gcc_unreachable (); case FRAME_POINTER_REGNUM: switch (to) @@ -10119,9 +10157,9 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) return offsets->outgoing_args - offsets->soft_frame; default: - abort (); + gcc_unreachable (); } - break; + gcc_unreachable (); default: /* You cannot eliminate from the stack pointer. @@ -10129,7 +10167,7 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to) pointer to the stack pointer, but this will never happen, since if a stack frame is not needed the hard frame pointer will never be used. */ - abort (); + gcc_unreachable (); } } @@ -10178,7 +10216,7 @@ arm_expand_prologue (void) stack decrement per function, and this is not it. If this instruction is labeled as being part of the frame creation sequence then dwarf2out_frame_debug_expr will - abort when it encounters the assignment of IP to FP + die when it encounters the assignment of IP to FP later on, since the use of SP here establishes SP as the CFA register and not IP. @@ -10445,7 +10483,7 @@ arm_expand_prologue (void) /* If we are profiling, make sure no instructions are scheduled before the call to mcount. Similarly if the user has requested no scheduling in the prolog. */ - if (current_function_profile || TARGET_NO_SCHED_PRO) + if (current_function_profile || !TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); /* If the link register is being kept alive, with the return address in it, @@ -10688,8 +10726,8 @@ arm_print_operand (FILE *stream, rtx x, int code) case 'X': /* Cirrus register in D mode. */ case 'Y': /* Cirrus register in FX mode. */ case 'Z': /* Cirrus register in DX mode. */ - if (GET_CODE (x) != REG || REGNO_REG_CLASS (REGNO (x)) != CIRRUS_REGS) - abort (); + gcc_assert (GET_CODE (x) == REG + && REGNO_REG_CLASS (REGNO (x)) == CIRRUS_REGS); fprintf (stream, "mv%s%s", code == 'W' ? "f" @@ -10794,21 +10832,26 @@ arm_print_operand (FILE *stream, rtx x, int code) return; } - if (GET_CODE (x) == REG) - asm_fprintf (stream, "%r", REGNO (x)); - else if (GET_CODE (x) == MEM) + switch (GET_CODE (x)) { + case REG: + asm_fprintf (stream, "%r", REGNO (x)); + break; + + case MEM: output_memory_reference_mode = GET_MODE (x); output_address (XEXP (x, 0)); - } - else if (GET_CODE (x) == CONST_DOUBLE) - fprintf (stream, "#%s", fp_immediate_constant (x)); - else if (GET_CODE (x) == NEG) - abort (); /* This should never happen now. */ - else - { + break; + + case CONST_DOUBLE: + fprintf (stream, "#%s", fp_immediate_constant (x)); + break; + + default: + gcc_assert (GET_CODE (x) != NEG); fputc ('#', stream); output_addr_const (stream, x); + break; } } } @@ -10846,8 +10889,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) { int i, units; - if (GET_CODE (x) != CONST_VECTOR) - abort (); + gcc_assert (GET_CODE (x) == CONST_VECTOR); units = CONST_VECTOR_NUNITS (x); @@ -10857,7 +10899,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) case V4HImode: size = 2; break; case V8QImode: size = 1; break; default: - abort (); + gcc_unreachable (); } for (i = 0; i < units; i++) @@ -10874,6 +10916,26 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p) return default_assemble_integer (x, size, aligned_p); } + + +/* Add a function to the list of static constructors. */ + +static void +arm_elf_asm_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) +{ + if (!TARGET_AAPCS_BASED) + { + default_named_section_asm_out_constructor (symbol, priority); + return; + } + + /* Put these in the .init_array section, using a special relocation. */ + ctors_section (); + assemble_align (POINTER_SIZE); + fputs ("\t.word\t", asm_out_file); + output_addr_const (asm_out_file, symbol); + fputs ("(target1)\n", asm_out_file); +} #endif /* A finite state machine takes care of noticing whether or not instructions @@ -10935,8 +10997,7 @@ get_arm_condition_code (rtx comparison) case CC_DLTUmode: code = ARM_CC; dominance: - if (comp_code != EQ && comp_code != NE) - abort (); + gcc_assert (comp_code == EQ || comp_code == NE); if (comp_code == EQ) return ARM_INVERSE_CONDITION_CODE (code); @@ -10949,7 +11010,7 @@ get_arm_condition_code (rtx comparison) case EQ: return ARM_EQ; case GE: return ARM_PL; case LT: return ARM_MI; - default: abort (); + default: gcc_unreachable (); } case CC_Zmode: @@ -10957,7 +11018,7 @@ get_arm_condition_code (rtx comparison) { case NE: return ARM_NE; case EQ: return ARM_EQ; - default: abort (); + default: gcc_unreachable (); } case CC_Nmode: @@ -10965,7 +11026,7 @@ get_arm_condition_code (rtx comparison) { case NE: return ARM_MI; case EQ: return ARM_PL; - default: abort (); + default: gcc_unreachable (); } case CCFPEmode: @@ -10990,7 +11051,7 @@ get_arm_condition_code (rtx comparison) /* UNEQ and LTGT do not have a representation. */ case UNEQ: /* Fall through. */ case LTGT: /* Fall through. */ - default: abort (); + default: gcc_unreachable (); } case CC_SWPmode: @@ -11006,7 +11067,7 @@ get_arm_condition_code (rtx comparison) case GTU: return ARM_CC; case LEU: return ARM_CS; case LTU: return ARM_HI; - default: abort (); + default: gcc_unreachable (); } case CC_Cmode: @@ -11014,7 +11075,7 @@ get_arm_condition_code (rtx comparison) { case LTU: return ARM_CS; case GEU: return ARM_CC; - default: abort (); + default: gcc_unreachable (); } case CCmode: @@ -11030,13 +11091,11 @@ get_arm_condition_code (rtx comparison) case GTU: return ARM_HI; case LEU: return ARM_LS; case LTU: return ARM_CC; - default: abort (); + default: gcc_unreachable (); } - default: abort (); + default: gcc_unreachable (); } - - abort (); } void @@ -11114,8 +11173,7 @@ arm_final_prescan_insn (rtx insn) return; } - if (arm_ccfsm_state != 0 && !reverse) - abort (); + gcc_assert (!arm_ccfsm_state || reverse); if (GET_CODE (insn) != JUMP_INSN) return; @@ -11163,7 +11221,7 @@ arm_final_prescan_insn (rtx insn) then_not_else = FALSE; } else - abort (); + gcc_unreachable (); /* See how many insns this branch skips, and what kind of insns. If all insns are okay, and the label or unconditional branch to the same @@ -11330,14 +11388,16 @@ arm_final_prescan_insn (rtx insn) { if ((!seeking_return) && (arm_ccfsm_state == 1 || reverse)) arm_target_label = CODE_LABEL_NUMBER (label); - else if (seeking_return || arm_ccfsm_state == 2) + else { + gcc_assert (seeking_return || arm_ccfsm_state == 2); + while (this_insn && GET_CODE (PATTERN (this_insn)) == USE) { this_insn = next_nonnote_insn (this_insn); - if (this_insn && (GET_CODE (this_insn) == BARRIER - || GET_CODE (this_insn) == CODE_LABEL)) - abort (); + gcc_assert (!this_insn + || (GET_CODE (this_insn) != BARRIER + && GET_CODE (this_insn) != CODE_LABEL)); } if (!this_insn) { @@ -11349,12 +11409,9 @@ arm_final_prescan_insn (rtx insn) } arm_target_insn = this_insn; } - else - abort (); if (jump_clobbers) { - if (reverse) - abort (); + gcc_assert (!reverse); arm_current_cc = get_arm_condition_code (XEXP (XEXP (XEXP (SET_SRC (body), 0), 0), 1)); @@ -11556,7 +11613,7 @@ arm_debugger_arg_offset (int value, rtx addr) if (value == 0) { debug_rtx (addr); - warning ("unable to compute real location of stacked parameter"); + warning (0, "unable to compute real location of stacked parameter"); value = 8; /* XXX magic hack */ } @@ -11934,7 +11991,7 @@ arm_init_iwmmxt_builtins (void) break; default: - abort (); + gcc_unreachable (); } def_mbuiltin (d->mask, d->name, type, d->code); @@ -12080,10 +12137,7 @@ arm_expand_binop_builtin (enum insn_code icode, || ! (*insn_data[icode].operand[0].predicate) (target, tmode)) target = gen_reg_rtx (tmode); - /* In case the insn wants input operands in modes different from - the result, abort. */ - if (GET_MODE (op0) != mode0 || GET_MODE (op1) != mode1) - abort (); + gcc_assert (GET_MODE (op0) == mode0 && GET_MODE (op1) == mode1); if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); @@ -12358,37 +12412,6 @@ arm_expand_builtin (tree exp, return NULL_RTX; } -/* Recursively search through all of the blocks in a function - checking to see if any of the variables created in that - function match the RTX called 'orig'. If they do then - replace them with the RTX called 'new'. */ -static void -replace_symbols_in_block (tree block, rtx orig, rtx new) -{ - for (; block; block = BLOCK_CHAIN (block)) - { - tree sym; - - if (!TREE_USED (block)) - continue; - - for (sym = BLOCK_VARS (block); sym; sym = TREE_CHAIN (sym)) - { - if ( (DECL_NAME (sym) == 0 && TREE_CODE (sym) != TYPE_DECL) - || DECL_IGNORED_P (sym) - || TREE_CODE (sym) != VAR_DECL - || DECL_EXTERNAL (sym) - || !rtx_equal_p (DECL_RTL (sym), orig) - ) - continue; - - SET_DECL_RTL (sym, new); - } - - replace_symbols_in_block (BLOCK_SUBBLOCKS (block), orig, new); - } -} - /* Return the number (counting from 0) of the least significant set bit in MASK. */ @@ -12421,8 +12444,7 @@ thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset, int lo_mask = mask & 0xFF; int pushed_words = 0; - if (mask == 0) - abort (); + gcc_assert (mask); if (lo_mask == 0 && !push && (mask & (1 << PC_REGNUM))) { @@ -12878,10 +12900,9 @@ thumb_far_jump_used_p (void) int is_called_in_ARM_mode (tree func) { - if (TREE_CODE (func) != FUNCTION_DECL) - abort (); + gcc_assert (TREE_CODE (func) == FUNCTION_DECL); - /* Ignore the problem about functions whoes address is taken. */ + /* Ignore the problem about functions whose address is taken. */ if (TARGET_CALLEE_INTERWORKING && TREE_PUBLIC (func)) return TRUE; @@ -12901,7 +12922,6 @@ thumb_unexpanded_epilogue (void) int high_regs_pushed = 0; int had_to_push_lr; int size; - int mode; if (return_used_this_function) return ""; @@ -12916,13 +12936,7 @@ thumb_unexpanded_epilogue (void) This is more reliable that examining regs_ever_live[] because that will be set if the register is ever used in the function, not just if the register is used to hold a return value. */ - - if (current_function_return_rtx != 0) - mode = GET_MODE (current_function_return_rtx); - else - mode = DECL_MODE (DECL_RESULT (current_function_decl)); - - size = GET_MODE_SIZE (mode); + size = arm_size_return_regs (); /* The prolog may have pushed some high registers to use as work registers. e.g. the testsuite file: @@ -13123,7 +13137,7 @@ thumb_compute_initial_elimination_offset (unsigned int from, unsigned int to) return offsets->saved_regs - offsets->saved_args; default: - abort(); + gcc_unreachable (); } break; @@ -13138,12 +13152,12 @@ thumb_compute_initial_elimination_offset (unsigned int from, unsigned int to) return offsets->saved_regs - offsets->soft_frame; default: - abort(); + gcc_unreachable (); } break; default: - abort (); + gcc_unreachable (); } } @@ -13283,7 +13297,7 @@ thumb_expand_prologue (void) hard_frame_pointer_rtx)); } - if (current_function_profile || TARGET_NO_SCHED_PRO) + if (current_function_profile || !TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); cfun->machine->lr_save_eliminated = !thumb_force_lr_save (); @@ -13332,7 +13346,7 @@ thumb_expand_epilogue (void) the stack adjustment will not be deleted. */ emit_insn (gen_prologue_use (stack_pointer_rtx)); - if (current_function_profile || TARGET_NO_SCHED_PRO) + if (current_function_profile || !TARGET_SCHED_PROLOG) emit_insn (gen_blockage ()); /* Emit a clobber for each insn that will be restored in the epilogue, @@ -13361,10 +13375,9 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { const char * name; - if (GET_CODE (DECL_RTL (current_function_decl)) != MEM) - abort (); - if (GET_CODE (XEXP (DECL_RTL (current_function_decl), 0)) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (DECL_RTL (current_function_decl)) == MEM); + gcc_assert (GET_CODE (XEXP (DECL_RTL (current_function_decl), 0)) + == SYMBOL_REF); name = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); /* Generate code sequence to switch us into Thumb mode. */ @@ -13593,11 +13606,8 @@ thumb_load_double_from_address (rtx *operands) rtx arg1; rtx arg2; - if (GET_CODE (operands[0]) != REG) - abort (); - - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); + gcc_assert (GET_CODE (operands[1]) == MEM); /* Get the memory address. */ addr = XEXP (operands[1], 0); @@ -13639,8 +13649,7 @@ thumb_load_double_from_address (rtx *operands) else base = arg1, offset = arg2; - if (GET_CODE (base) != REG) - abort (); + gcc_assert (GET_CODE (base) == REG); /* Catch the case of
= + */ if (GET_CODE (offset) == REG) @@ -13697,8 +13706,7 @@ thumb_load_double_from_address (rtx *operands) break; default: - abort (); - break; + gcc_unreachable (); } return ""; @@ -13747,7 +13755,7 @@ thumb_output_move_mem_multiple (int n, rtx *operands) break; default: - abort (); + gcc_unreachable (); } return ""; @@ -13760,7 +13768,7 @@ thumb_call_via_reg (rtx reg) int regno = REGNO (reg); rtx *labelp; - gcc_assert (regno < SP_REGNUM); + gcc_assert (regno < LR_REGNUM); /* If we are in the normal text section we can use a single instance per compilation unit. If we are doing function sections, then we need @@ -13845,7 +13853,7 @@ thumb_reload_out_hi (rtx *operands) void thumb_reload_in_hi (rtx *operands ATTRIBUTE_UNUSED) { - abort (); + gcc_unreachable (); } /* Return the length of a function name prefix @@ -13906,7 +13914,7 @@ arm_file_end (void) asm_fprintf (asm_out_file, "\t.code 16\n"); ASM_OUTPUT_ALIGN (asm_out_file, 1); - for (regno = 0; regno < SP_REGNUM; regno++) + for (regno = 0; regno < LR_REGNUM; regno++) { rtx label = thumb_call_via_label[regno]; @@ -14225,15 +14233,14 @@ arm_emit_vector_const (FILE *file, rtx x) int i; const char * pattern; - if (GET_CODE (x) != CONST_VECTOR) - abort (); + gcc_assert (GET_CODE (x) == CONST_VECTOR); switch (GET_MODE (x)) { case V2SImode: pattern = "%08x"; break; case V4HImode: pattern = "%04x"; break; case V8QImode: pattern = "%02x"; break; - default: abort (); + default: gcc_unreachable (); } fprintf (file, "0x"); @@ -14517,17 +14524,41 @@ arm_cxx_key_method_may_be_inline (void) return !TARGET_AAPCS_BASED; } -/* The EABI says that the virtual table, etc., for a class must be - exported if it has a key method. The EABI does not specific the - behavior if there is no key method, but there is no harm in - exporting the class data in that case too. */ +static void +arm_cxx_determine_class_data_visibility (tree decl) +{ + if (!TARGET_AAPCS_BASED) + return; + + /* In general, \S 3.2.5.5 of the ARM EABI requires that class data + is exported. However, on systems without dynamic vague linkage, + \S 3.2.5.6 says that COMDAT class data has hidden linkage. */ + if (!TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P && DECL_COMDAT (decl)) + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + else + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + DECL_VISIBILITY_SPECIFIED (decl) = 1; +} + +static bool +arm_cxx_class_data_always_comdat (void) +{ + /* \S 3.2.5.4 of the ARM C++ ABI says that class data only have + vague linkage if the class has no key function. */ + return !TARGET_AAPCS_BASED; +} + + +/* The EABI says __aeabi_atexit should be used to register static + destructors. */ static bool -arm_cxx_export_class_data (void) +arm_cxx_use_aeabi_atexit (void) { return TARGET_AAPCS_BASED; } + void arm_set_return_address (rtx source, rtx scratch) { @@ -14641,3 +14672,30 @@ arm_shift_truncation_mask (enum machine_mode mode) { return mode == SImode ? 255 : 0; } + + +/* Map internal gcc register numbers to DWARF2 register numbers. */ + +unsigned int +arm_dbx_register_number (unsigned int regno) +{ + if (regno < 16) + return regno; + + /* TODO: Legacy targets output FPA regs as registers 16-23 for backwards + compatibility. The EABI defines them as registers 96-103. */ + if (IS_FPA_REGNUM (regno)) + return (TARGET_AAPCS_BASED ? 96 : 16) + regno - FIRST_FPA_REGNUM; + + if (IS_VFP_REGNUM (regno)) + return 64 + regno - FIRST_VFP_REGNUM; + + if (IS_IWMMXT_GR_REGNUM (regno)) + return 104 + regno - FIRST_IWMMXT_GR_REGNUM; + + if (IS_IWMMXT_REGNUM (regno)) + return 112 + regno - FIRST_IWMMXT_REGNUM; + + gcc_unreachable (); +} + diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 69958779746..7b563469ab3 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -117,18 +117,6 @@ extern arm_cc arm_current_cc; extern int arm_target_label; extern int arm_ccfsm_state; extern GTY(()) rtx arm_target_insn; -/* Run-time compilation parameters selecting different hardware subsets. */ -extern int target_flags; -/* The floating point mode. */ -extern const char *target_fpu_name; -/* For backwards compatibility. */ -extern const char *target_fpe_name; -/* Whether to use floating point hardware. */ -extern const char *target_float_abi_name; -/* For -m{soft,hard}-float. */ -extern const char *target_float_switch; -/* Which ABI to use. */ -extern const char *target_abi_name; /* Define the information needed to generate branch insns. This is stored from the compare operation. */ extern GTY(()) rtx arm_compare_op0; @@ -184,89 +172,6 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_VERSION fputs (" (ARM/generic)", stderr); #endif -/* Nonzero if the function prologue (and epilogue) should obey - the ARM Procedure Call Standard. */ -#define ARM_FLAG_APCS_FRAME (1 << 0) - -/* Nonzero if the function prologue should output the function name to enable - the post mortem debugger to print a backtrace (very useful on RISCOS, - unused on RISCiX). Specifying this flag also enables - -fno-omit-frame-pointer. - XXX Must still be implemented in the prologue. */ -#define ARM_FLAG_POKE (1 << 1) - -/* Nonzero if floating point instructions are emulated by the FPE, in which - case instruction scheduling becomes very uninteresting. */ -#define ARM_FLAG_FPE (1 << 2) - -/* FLAG 0x0008 now spare (used to be apcs-32 selection). */ - -/* Nonzero if stack checking should be performed on entry to each function - which allocates temporary variables on the stack. */ -#define ARM_FLAG_APCS_STACK (1 << 4) - -/* Nonzero if floating point parameters should be passed to functions in - floating point registers. */ -#define ARM_FLAG_APCS_FLOAT (1 << 5) - -/* Nonzero if re-entrant, position independent code should be generated. - This is equivalent to -fpic. */ -#define ARM_FLAG_APCS_REENT (1 << 6) - - /* FLAG 0x0080 now spare (used to be alignment traps). */ - /* FLAG (1 << 8) is now spare (used to be soft-float). */ - -/* Nonzero if we should compile with BYTES_BIG_ENDIAN set to 1. */ -#define ARM_FLAG_BIG_END (1 << 9) - -/* Nonzero if we should compile for Thumb interworking. */ -#define ARM_FLAG_INTERWORK (1 << 10) - -/* Nonzero if we should have little-endian words even when compiling for - big-endian (for backwards compatibility with older versions of GCC). */ -#define ARM_FLAG_LITTLE_WORDS (1 << 11) - -/* Nonzero if we need to protect the prolog from scheduling */ -#define ARM_FLAG_NO_SCHED_PRO (1 << 12) - -/* Nonzero if a call to abort should be generated if a noreturn - function tries to return. */ -#define ARM_FLAG_ABORT_NORETURN (1 << 13) - -/* Nonzero if function prologues should not load the PIC register. */ -#define ARM_FLAG_SINGLE_PIC_BASE (1 << 14) - -/* Nonzero if all call instructions should be indirect. */ -#define ARM_FLAG_LONG_CALLS (1 << 15) - -/* Nonzero means that the target ISA is the THUMB, not the ARM. */ -#define ARM_FLAG_THUMB (1 << 16) - -/* Set if a TPCS style stack frame should be generated, for non-leaf - functions, even if they do not need one. */ -#define THUMB_FLAG_BACKTRACE (1 << 17) - -/* Set if a TPCS style stack frame should be generated, for leaf - functions, even if they do not need one. */ -#define THUMB_FLAG_LEAF_BACKTRACE (1 << 18) - -/* Set if externally visible functions should assume that they - might be called in ARM mode, from a non-thumb aware code. */ -#define THUMB_FLAG_CALLEE_SUPER_INTERWORKING (1 << 19) - -/* Set if calls via function pointers should assume that their - destination is non-Thumb aware. */ -#define THUMB_FLAG_CALLER_SUPER_INTERWORKING (1 << 20) - -/* Fix invalid Cirrus instruction combinations by inserting NOPs. */ -#define CIRRUS_FIX_INVALID_INSNS (1 << 21) - -#define TARGET_APCS_FRAME (target_flags & ARM_FLAG_APCS_FRAME) -#define TARGET_POKE_FUNCTION_NAME (target_flags & ARM_FLAG_POKE) -#define TARGET_FPE (target_flags & ARM_FLAG_FPE) -#define TARGET_APCS_STACK (target_flags & ARM_FLAG_APCS_STACK) -#define TARGET_APCS_FLOAT (target_flags & ARM_FLAG_APCS_FLOAT) -#define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT) #define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT) /* Use hardware floating point instructions. */ #define TARGET_HARD_FLOAT (arm_float_abi != ARM_FLOAT_ABI_SOFT) @@ -278,22 +183,11 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_IWMMXT (arm_arch_iwmmxt) #define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM) #define TARGET_IWMMXT_ABI (TARGET_ARM && arm_abi == ARM_ABI_IWMMXT) -#define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END) -#define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK) -#define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS) -#define TARGET_NO_SCHED_PRO (target_flags & ARM_FLAG_NO_SCHED_PRO) -#define TARGET_ABORT_NORETURN (target_flags & ARM_FLAG_ABORT_NORETURN) -#define TARGET_SINGLE_PIC_BASE (target_flags & ARM_FLAG_SINGLE_PIC_BASE) -#define TARGET_LONG_CALLS (target_flags & ARM_FLAG_LONG_CALLS) -#define TARGET_THUMB (target_flags & ARM_FLAG_THUMB) #define TARGET_ARM (! TARGET_THUMB) #define TARGET_EITHER 1 /* (TARGET_ARM | TARGET_THUMB) */ -#define TARGET_CALLEE_INTERWORKING (target_flags & THUMB_FLAG_CALLEE_SUPER_INTERWORKING) -#define TARGET_CALLER_INTERWORKING (target_flags & THUMB_FLAG_CALLER_SUPER_INTERWORKING) -#define TARGET_BACKTRACE (leaf_function_p () \ - ? (target_flags & THUMB_FLAG_LEAF_BACKTRACE) \ - : (target_flags & THUMB_FLAG_BACKTRACE)) -#define TARGET_CIRRUS_FIX_INVALID_INSNS (target_flags & CIRRUS_FIX_INVALID_INSNS) +#define TARGET_BACKTRACE (leaf_function_p () \ + ? TARGET_TPCS_LEAF_FRAME \ + : TARGET_TPCS_FRAME) #define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN) #define TARGET_AAPCS_BASED \ (arm_abi != ARM_ABI_APCS && arm_abi != ARM_ABI_ATPCS) @@ -306,100 +200,6 @@ extern GTY(()) rtx aof_pic_label; #define TARGET_BPABI false #endif -/* SUBTARGET_SWITCHES is used to add flags on a per-config basis. */ -#ifndef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES -#endif - -#define TARGET_SWITCHES \ -{ \ - {"apcs", ARM_FLAG_APCS_FRAME, "" }, \ - {"apcs-frame", ARM_FLAG_APCS_FRAME, \ - N_("Generate APCS conformant stack frames") }, \ - {"no-apcs-frame", -ARM_FLAG_APCS_FRAME, "" }, \ - {"poke-function-name", ARM_FLAG_POKE, \ - N_("Store function names in object code") }, \ - {"no-poke-function-name", -ARM_FLAG_POKE, "" }, \ - {"fpe", ARM_FLAG_FPE, "" }, \ - {"apcs-stack-check", ARM_FLAG_APCS_STACK, "" }, \ - {"no-apcs-stack-check", -ARM_FLAG_APCS_STACK, "" }, \ - {"apcs-float", ARM_FLAG_APCS_FLOAT, \ - N_("Pass FP arguments in FP registers") }, \ - {"no-apcs-float", -ARM_FLAG_APCS_FLOAT, "" }, \ - {"apcs-reentrant", ARM_FLAG_APCS_REENT, \ - N_("Generate re-entrant, PIC code") }, \ - {"no-apcs-reentrant", -ARM_FLAG_APCS_REENT, "" }, \ - {"big-endian", ARM_FLAG_BIG_END, \ - N_("Assume target CPU is configured as big endian") }, \ - {"little-endian", -ARM_FLAG_BIG_END, \ - N_("Assume target CPU is configured as little endian") }, \ - {"words-little-endian", ARM_FLAG_LITTLE_WORDS, \ - N_("Assume big endian bytes, little endian words") }, \ - {"thumb-interwork", ARM_FLAG_INTERWORK, \ - N_("Support calls between Thumb and ARM instruction sets") }, \ - {"no-thumb-interwork", -ARM_FLAG_INTERWORK, "" }, \ - {"abort-on-noreturn", ARM_FLAG_ABORT_NORETURN, \ - N_("Generate a call to abort if a noreturn function returns")}, \ - {"no-abort-on-noreturn", -ARM_FLAG_ABORT_NORETURN, "" }, \ - {"no-sched-prolog", ARM_FLAG_NO_SCHED_PRO, \ - N_("Do not move instructions into a function's prologue") }, \ - {"sched-prolog", -ARM_FLAG_NO_SCHED_PRO, "" }, \ - {"single-pic-base", ARM_FLAG_SINGLE_PIC_BASE, \ - N_("Do not load the PIC register in function prologues") }, \ - {"no-single-pic-base", -ARM_FLAG_SINGLE_PIC_BASE, "" }, \ - {"long-calls", ARM_FLAG_LONG_CALLS, \ - N_("Generate call insns as indirect calls, if necessary") }, \ - {"no-long-calls", -ARM_FLAG_LONG_CALLS, "" }, \ - {"thumb", ARM_FLAG_THUMB, \ - N_("Compile for the Thumb not the ARM") }, \ - {"no-thumb", -ARM_FLAG_THUMB, "" }, \ - {"arm", -ARM_FLAG_THUMB, "" }, \ - {"tpcs-frame", THUMB_FLAG_BACKTRACE, \ - N_("Thumb: Generate (non-leaf) stack frames even if not needed") }, \ - {"no-tpcs-frame", -THUMB_FLAG_BACKTRACE, "" }, \ - {"tpcs-leaf-frame", THUMB_FLAG_LEAF_BACKTRACE, \ - N_("Thumb: Generate (leaf) stack frames even if not needed") }, \ - {"no-tpcs-leaf-frame", -THUMB_FLAG_LEAF_BACKTRACE, "" }, \ - {"callee-super-interworking", THUMB_FLAG_CALLEE_SUPER_INTERWORKING, \ - N_("Thumb: Assume non-static functions may be called from ARM code") }, \ - {"no-callee-super-interworking", -THUMB_FLAG_CALLEE_SUPER_INTERWORKING, \ - "" }, \ - {"caller-super-interworking", THUMB_FLAG_CALLER_SUPER_INTERWORKING, \ - N_("Thumb: Assume function pointers may go to non-Thumb aware code") }, \ - {"no-caller-super-interworking", -THUMB_FLAG_CALLER_SUPER_INTERWORKING, \ - "" }, \ - {"cirrus-fix-invalid-insns", CIRRUS_FIX_INVALID_INSNS, \ - N_("Cirrus: Place NOPs to avoid invalid instruction combinations") }, \ - {"no-cirrus-fix-invalid-insns", -CIRRUS_FIX_INVALID_INSNS, \ - N_("Cirrus: Do not break up invalid instruction combinations with NOPs") },\ - SUBTARGET_SWITCHES \ - {"", TARGET_DEFAULT, "" } \ -} - -#define TARGET_OPTIONS \ -{ \ - {"cpu=", & arm_select[0].string, \ - N_("Specify the name of the target CPU"), 0}, \ - {"arch=", & arm_select[1].string, \ - N_("Specify the name of the target architecture"), 0}, \ - {"tune=", & arm_select[2].string, "", 0}, \ - {"fpe=", & target_fpe_name, "", 0}, \ - {"fp=", & target_fpe_name, "", 0}, \ - {"fpu=", & target_fpu_name, \ - N_("Specify the name of the target floating point hardware/format"), 0}, \ - {"float-abi=", & target_float_abi_name, \ - N_("Specify if floating point hardware should be used"), 0}, \ - {"structure-size-boundary=", & structure_size_string, \ - N_("Specify the minimum bit alignment of structures"), 0}, \ - {"pic-register=", & arm_pic_register_string, \ - N_("Specify the register to be used for PIC addressing"), 0}, \ - {"abi=", &target_abi_name, N_("Specify an ABI"), 0}, \ - {"soft-float", &target_float_switch, \ - N_("Alias for -mfloat-abi=soft"), "s"}, \ - {"hard-float", &target_float_switch, \ - N_("Alias for -mfloat-abi=hard"), "h"} \ -} - /* Support for a compile-time default CPU, et cetera. The rules are: --with-arch is ignored if -march or -mcpu are specified. --with-cpu is ignored if -march or -mcpu are specified, and is overridden @@ -419,18 +219,6 @@ extern GTY(()) rtx aof_pic_label; {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"}, \ {"abi", "%{!mabi=*:-mabi=%(VALUE)}"}, -struct arm_cpu_select -{ - const char * string; - const char * name; - const struct processors * processors; -}; - -/* This is a magic array. If the user specifies a command line switch - which matches one of the entries in TARGET_OPTIONS then the corresponding - string pointer will be set to the value specified by the user. */ -extern struct arm_cpu_select arm_select[]; - /* Which floating point model to use. */ enum arm_fp_model { @@ -525,7 +313,7 @@ extern int arm_ld_sched; extern int thumb_code; /* Nonzero if this chip is a StrongARM. */ -extern int arm_is_strong; +extern int arm_tune_strongarm; /* Nonzero if this chip is a Cirrus variant. */ extern int arm_arch_cirrus; @@ -536,11 +324,11 @@ extern int arm_arch_iwmmxt; /* Nonzero if this chip is an XScale. */ extern int arm_arch_xscale; -/* Nonzero if tuning for XScale */ +/* Nonzero if tuning for XScale. */ extern int arm_tune_xscale; -/* Nonzero if this chip is an ARM6 or an ARM7. */ -extern int arm_is_6_or_7; +/* Nonzero if tuning for stores via the write buffer. */ +extern int arm_tune_wbuf; /* Nonzero if we should define __THUMB_INTERWORK__ in the preprocessor. @@ -550,7 +338,7 @@ extern int arm_is_6_or_7; extern int arm_cpp_interwork; #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #endif /* The frame pointer register used in gcc has nothing to do with debugging; @@ -607,9 +395,10 @@ extern int arm_cpp_interwork; } #define PROMOTE_FUNCTION_MODE(MODE, UNSIGNEDP, TYPE) \ - if (GET_MODE_CLASS (MODE) == MODE_INT \ - && GET_MODE_SIZE (MODE) < 4) \ - (MODE) = SImode; \ + if ((GET_MODE_CLASS (MODE) == MODE_INT \ + || GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT) \ + && GET_MODE_SIZE (MODE) < 4) \ + (MODE) = SImode; \ /* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. */ @@ -697,9 +486,6 @@ extern int arm_structure_size_boundary; #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 32 #endif -/* Used when parsing command line option -mstructure_size_boundary. */ -extern const char * structure_size_string; - /* Nonzero if move instructions will actually fail to work when given unaligned data. */ #define STRICT_ALIGNMENT 1 @@ -925,7 +711,8 @@ extern const char * structure_size_string; _interwork_r11_call_via_rN(). Making the register global \ is an easy way of ensuring that it remains valid for all \ calls. */ \ - if (TARGET_APCS_FRAME || TARGET_CALLER_INTERWORKING) \ + if (TARGET_APCS_FRAME || TARGET_CALLER_INTERWORKING \ + || TARGET_TPCS_FRAME || TARGET_TPCS_LEAF_FRAME) \ { \ fixed_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \ call_used_regs[ARM_HARD_FRAME_POINTER_REGNUM] = 1; \ @@ -1032,6 +819,8 @@ extern const char * structure_size_string; /* ARM floating pointer registers. */ #define FIRST_FPA_REGNUM 16 #define LAST_FPA_REGNUM 23 +#define IS_FPA_REGNUM(REGNUM) \ + (((REGNUM) >= FIRST_FPA_REGNUM) && ((REGNUM) <= LAST_FPA_REGNUM)) #define FIRST_IWMMXT_GR_REGNUM 43 #define LAST_IWMMXT_GR_REGNUM 46 @@ -1064,14 +853,22 @@ extern const char * structure_size_string; /* VFP adds 32 + 1 more. */ #define FIRST_PSEUDO_REGISTER 96 +#define DBX_REGISTER_NUMBER(REGNO) arm_dbx_register_number (REGNO) + /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms may be accessed via the stack pointer) in functions that seem suitable. If we have to have a frame pointer we might as well make use of it. APCS says that the frame pointer does not need to be pushed in leaf functions, or simple tail call functions. */ + +#ifndef SUBTARGET_FRAME_POINTER_REQUIRED +#define SUBTARGET_FRAME_POINTER_REQUIRED 0 +#endif + #define FRAME_POINTER_REQUIRED \ (current_function_has_nonlocal_label \ + || SUBTARGET_FRAME_POINTER_REQUIRED \ || (TARGET_ARM && TARGET_APCS_FRAME && ! leaf_function_p ())) /* Return number of consecutive hard regs needed starting at reg REGNO @@ -1319,7 +1116,9 @@ enum reg_class 'Uq' is an address valid for ldrsb. */ #define EXTRA_CONSTRAINT_STR_ARM(OP, C, STR) \ - (((C) == 'D') ? (GET_CODE (OP) == CONST_DOUBLE \ + (((C) == 'D') ? ((GET_CODE (OP) == CONST_DOUBLE \ + || GET_CODE (OP) == CONST_INT \ + || GET_CODE (OP) == CONST_VECTOR) \ && (((STR)[1] == 'a' \ && arm_const_double_inline_cost (OP) == 2) \ || ((STR)[1] == 'b' \ @@ -1708,14 +1507,15 @@ typedef struct machine_function GTY(()) register is needed to preserve stack alignment. */ int sibcall_blocked; /* Labels for per-function Thumb call-via stubs. One per potential calling - register. We can never call via SP, LR or PC. */ - rtx call_via[13]; + register. We can never call via LR or PC. We can call via SP if a + trampoline happens to be on the top of the stack. */ + rtx call_via[14]; } machine_function; /* As in the machine_function, a global set of call-via labels, for code that is in text_section(). */ -extern GTY(()) rtx thumb_call_via_label[13]; +extern GTY(()) rtx thumb_call_via_label[14]; /* A C type for declaring a variable that is used as the first argument of `FUNCTION_ARG' and other related values. For some target machines, the @@ -1754,6 +1554,17 @@ typedef struct #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED)) +#define FUNCTION_ARG_PADDING(MODE, TYPE) \ + (arm_pad_arg_upward (MODE, TYPE) ? upward : downward) + +#define BLOCK_REG_PADDING(MODE, TYPE, FIRST) \ + (arm_pad_reg_upward (MODE, TYPE, FIRST) ? upward : downward) + +/* For AAPCS, padding should never be below the argument. For other ABIs, + * mimic the default. */ +#define PAD_VARARGS_DOWN \ + ((TARGET_AAPCS_BASED) ? 0 : BYTES_BIG_ENDIAN) + /* Initialize a variable CUM of type CUMULATIVE_ARGS for a call to a function whose data type is FNTYPE. For a library call, FNTYPE is 0. @@ -1965,6 +1776,7 @@ typedef struct /* Alignment required for a trampoline in bits. */ #define TRAMPOLINE_ALIGNMENT 32 + /* Emit RTL insns to initialize the variable parts of a trampoline. FNADDR is an RTX for the address of the function's pure code. CXT is an RTX for the static chain value for the function. */ @@ -1979,6 +1791,9 @@ typedef struct plus_constant (TRAMP, \ TARGET_ARM ? 12 : 20)), \ FNADDR); \ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ + 0, VOIDmode, 2, TRAMP, Pmode, \ + plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ } #endif @@ -2101,6 +1916,58 @@ typedef struct #define ASM_OUTPUT_LABELREF(FILE, NAME) \ arm_asm_output_labelref (FILE, NAME) +/* The EABI specifies that constructors should go in .init_array. + Other targets use .ctors for compatibility. */ +#ifndef ARM_EABI_CTORS_SECTION_OP +#define ARM_EABI_CTORS_SECTION_OP \ + "\t.section\t.init_array,\"aw\",%init_array" +#endif +#ifndef ARM_EABI_DTORS_SECTION_OP +#define ARM_EABI_DTORS_SECTION_OP \ + "\t.section\t.fini_array,\"aw\",%fini_array" +#endif +#define ARM_CTORS_SECTION_OP \ + "\t.section\t.ctors,\"aw\",%progbits" +#define ARM_DTORS_SECTION_OP \ + "\t.section\t.dtors,\"aw\",%progbits" + +/* Define CTORS_SECTION_ASM_OP. */ +#undef CTORS_SECTION_ASM_OP +#undef DTORS_SECTION_ASM_OP +#ifndef IN_LIBGCC2 +# define CTORS_SECTION_ASM_OP \ + (TARGET_AAPCS_BASED ? ARM_EABI_CTORS_SECTION_OP : ARM_CTORS_SECTION_OP) +# define DTORS_SECTION_ASM_OP \ + (TARGET_AAPCS_BASED ? ARM_EABI_DTORS_SECTION_OP : ARM_DTORS_SECTION_OP) +#else /* !defined (IN_LIBGCC2) */ +/* In libgcc, CTORS_SECTION_ASM_OP must be a compile-time constant, + so we cannot use the definition above. */ +# ifdef __ARM_EABI__ +/* The .ctors section is not part of the EABI, so we do not define + CTORS_SECTION_ASM_OP when in libgcc; that prevents crtstuff + from trying to use it. We do define it when doing normal + compilation, as .init_array can be used instead of .ctors. */ +/* There is no need to emit begin or end markers when using + init_array; the dynamic linker will compute the size of the + array itself based on special symbols created by the static + linker. However, we do need to arrange to set up + exception-handling here. */ +# define CTOR_LIST_BEGIN asm (ARM_EABI_CTORS_SECTION_OP) +# define CTOR_LIST_END /* empty */ +# define DTOR_LIST_BEGIN asm (ARM_EABI_DTORS_SECTION_OP) +# define DTOR_LIST_END /* empty */ +# else /* !defined (__ARM_EABI__) */ +# define CTORS_SECTION_ASM_OP ARM_CTORS_SECTION_OP +# define DTORS_SECTION_ASM_OP ARM_DTORS_SECTION_OP +# endif /* !defined (__ARM_EABI__) */ +#endif /* !defined (IN_LIBCC2) */ + +/* True if the operating system can merge entities with vague linkage + (e.g., symbols in COMDAT group) during dynamic linking. */ +#ifndef TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P +#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P true +#endif + /* Set the short-call flag for any function compiled in the current compilation unit. We skip this for functions with the section attribute when long-calls are in effect as this tells the compiler @@ -2317,9 +2184,6 @@ do { \ using sb (r9) all the time. */ extern int arm_pic_register; -/* Used when parsing command line option -mpic-register=. */ -extern const char * arm_pic_register_string; - /* The register number of the register used to address a table of static data addresses in memory. */ #define PIC_OFFSET_TABLE_REGNUM arm_pic_register @@ -2540,7 +2404,7 @@ extern int making_const_table; } \ \ default: \ - abort(); \ + gcc_unreachable (); \ } \ } \ else if (GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC \ @@ -2548,8 +2412,7 @@ extern int making_const_table; { \ extern enum machine_mode output_memory_reference_mode; \ \ - if (GET_CODE (XEXP (X, 0)) != REG) \ - abort (); \ + gcc_assert (GET_CODE (XEXP (X, 0)) == REG); \ \ if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC) \ asm_fprintf (STREAM, "[%r, #%s%d]!", \ @@ -2593,8 +2456,7 @@ extern int making_const_table; asm_fprintf (STREAM, "%r!", REGNO (XEXP (X, 0))); \ else if (GET_CODE (X) == PLUS) \ { \ - if (GET_CODE (XEXP (X, 0)) != REG) \ - abort (); \ + gcc_assert (GET_CODE (XEXP (X, 0)) == REG); \ if (GET_CODE (XEXP (X, 1)) == CONST_INT) \ asm_fprintf (STREAM, "[%r, #%wd]", \ REGNO (XEXP (X, 0)), \ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index f25846675ee..5c7da904a88 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -135,7 +135,7 @@ ; IS_STRONGARM is set to 'yes' when compiling for StrongARM, it affects ; scheduling decisions for the load unit and the multiplier. -(define_attr "is_strongarm" "no,yes" (const (symbol_ref "arm_is_strong"))) +(define_attr "is_strongarm" "no,yes" (const (symbol_ref "arm_tune_strongarm"))) ; IS_XSCALE is set to 'yes' when compiling for XScale. (define_attr "is_xscale" "no,yes" (const (symbol_ref "arm_tune_xscale"))) @@ -267,7 +267,7 @@ ; have one. Later ones, such as StrongARM, have write-back caches, so don't ; suffer blockages enough to warrant modelling this (and it can adversely ; affect the schedule). -(define_attr "model_wbuf" "no,yes" (const (symbol_ref "arm_is_6_or_7"))) +(define_attr "model_wbuf" "no,yes" (const (symbol_ref "arm_tune_wbuf"))) ; WRITE_CONFLICT implies that a read following an unrelated write is likely ; to stall the processor. Used with model_wbuf above. @@ -289,6 +289,18 @@ ;; distant label. Only applicable to Thumb code. (define_attr "far_jump" "yes,no" (const_string "no")) + +;;--------------------------------------------------------------------------- +;; Mode macros + +; A list of modes that are exactly 64 bits in size. We use this to expand +; some splits that are the same for all modes when operating on ARM +; registers. +(define_mode_macro ANY64 [DI DF V8QI V4HI V2SI V2SF]) + +;;--------------------------------------------------------------------------- +;; Predicates + (include "predicates.md") ;;--------------------------------------------------------------------------- @@ -571,32 +583,13 @@ [(set_attr "conds" "set")] ) -;; These patterns are the same ones as the two regular addsi3_compare0 -;; patterns, except we write them slightly different - the combiner -;; tends to generate them this way. -(define_insn "*addsi3_compare0_for_combiner" - [(set (reg:CC CC_REGNUM) - (compare:CC - (match_operand:SI 1 "s_register_operand" "r,r") - (neg:SI (match_operand:SI 2 "arm_add_operand" "rI,L")))) - (set (match_operand:SI 0 "s_register_operand" "=r,r") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_ARM" - "@ - add%?s\\t%0, %1, %2 - sub%?s\\t%0, %1, #%n2" - [(set_attr "conds" "set")] -) - -(define_insn "*addsi3_compare0_scratch_for_combiner" - [(set (reg:CC CC_REGNUM) - (compare:CC - (match_operand:SI 0 "s_register_operand" "r,r") - (neg:SI (match_operand:SI 1 "arm_add_operand" "rI,L"))))] +(define_insn "*compare_negsi_si" + [(set (reg:CC_Z CC_REGNUM) + (compare:CC_Z + (neg:SI (match_operand:SI 0 "s_register_operand" "r")) + (match_operand:SI 1 "s_register_operand" "r")))] "TARGET_ARM" - "@ - cmn%?\\t%0, %1 - cmp%?\\t%0, #%n1" + "cmn%?\\t%1, %0" [(set_attr "conds" "set")] ) @@ -1084,9 +1077,9 @@ "TARGET_THUMB" "* if (which_alternative < 2) - return \"mov\\t%0, %1\;mul\\t%0, %0, %2\"; + return \"mov\\t%0, %1\;mul\\t%0, %2\"; else - return \"mul\\t%0, %0, %2\"; + return \"mul\\t%0, %2\"; " [(set_attr "length" "4,4,2") (set_attr "insn" "mul")] @@ -2550,10 +2543,7 @@ (match_operand:SI 3 "arm_rhs_operand" "rI,rI")]) (match_operand:SI 1 "s_register_operand" "0,?r")])) (clobber (reg:CC CC_REGNUM))] - "TARGET_ARM - && (GET_CODE (operands[1]) != REG - || (REGNO(operands[1]) != FRAME_POINTER_REGNUM - && REGNO(operands[1]) != ARG_POINTER_REGNUM))" + "TARGET_ARM && !arm_eliminable_register (operands[1])" "* { enum rtx_code code = GET_CODE (operands[4]); @@ -2979,14 +2969,14 @@ (define_expand "negsf2" [(set (match_operand:SF 0 "s_register_operand" "") (neg:SF (match_operand:SF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "" ) (define_expand "negdf2" [(set (match_operand:DF 0 "s_register_operand" "") (neg:DF (match_operand:DF 1 "s_register_operand" "")))] - "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" + "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)" "") ;; abssi2 doesn't really clobber the condition codes if a different register @@ -3624,12 +3614,8 @@ ops[1] = mem; ops[2] = const0_rtx; } - - if (GET_CODE (ops[1]) != REG) - { - debug_rtx (ops[1]); - abort (); - } + + gcc_assert (GET_CODE (ops[1]) == REG); ops[0] = operands[0]; ops[3] = operands[2]; @@ -3644,7 +3630,7 @@ ;; We used to have an early-clobber on the scratch register here. ;; However, there's a bug somewhere in reload which means that this ;; can be partially ignored during spill allocation if the memory -;; address also needs reloading; this causes an abort later on when +;; address also needs reloading; this causes us to die later on when ;; we try to verify the operands. Fortunately, we don't really need ;; the early-clobber: we can always use operand 0 if operand 2 ;; overlaps the address. @@ -3695,11 +3681,7 @@ ops[2] = const0_rtx; } - if (GET_CODE (ops[1]) != REG) - { - debug_rtx (ops[1]); - abort (); - } + gcc_assert (GET_CODE (ops[1]) == REG); ops[0] = operands[0]; if (reg_mentioned_p (operands[2], ops[1])) @@ -3959,10 +3941,9 @@ else output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); } - else if (GET_CODE (b) != REG) - abort (); else { + gcc_assert (GET_CODE (b) == REG); if (REGNO (b) == REGNO (ops[0])) { output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops); @@ -4042,10 +4023,9 @@ else output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops); } - else if (GET_CODE (b) != REG) - abort (); else { + gcc_assert (GET_CODE (b) == REG); if (REGNO (b) == REGNO (ops[0])) { output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops); @@ -4159,13 +4139,21 @@ ) (define_insn "*arm_movdi" - [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m") - (match_operand:DI 1 "di_operand" "rIKDa,Db,Dc,mi,r"))] + [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, r, r, m") + (match_operand:DI 1 "di_operand" "rDa,Db,Dc,mi,r"))] "TARGET_ARM && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP)) && !TARGET_IWMMXT" "* - return (output_move_double (operands)); + switch (which_alternative) + { + case 0: + case 1: + case 2: + return \"#\"; + default: + return output_move_double (operands); + } " [(set_attr "length" "8,12,16,8,8") (set_attr "type" "*,*,*,load2,store2") @@ -4173,6 +4161,77 @@ (set_attr "neg_pool_range" "*,*,*,1008,*")] ) +(define_split + [(set (match_operand:ANY64 0 "arm_general_register_operand" "") + (match_operand:ANY64 1 "const_double_operand" ""))] + "TARGET_ARM + && reload_completed + && (arm_const_double_inline_cost (operands[1]) + <= ((optimize_size || arm_ld_sched) ? 3 : 4))" + [(const_int 0)] + " + arm_split_constant (SET, SImode, curr_insn, + INTVAL (gen_lowpart (SImode, operands[1])), + gen_lowpart (SImode, operands[0]), NULL_RTX, 0); + arm_split_constant (SET, SImode, curr_insn, + INTVAL (gen_highpart_mode (SImode, + GET_MODE (operands[0]), + operands[1])), + gen_highpart (SImode, operands[0]), NULL_RTX, 0); + DONE; + " +) + +; If optimizing for size, or if we have load delay slots, then +; we want to split the constant into two separate operations. +; In both cases this may split a trivial part into a single data op +; leaving a single complex constant to load. We can also get longer +; offsets in a LDR which means we get better chances of sharing the pool +; entries. Finally, we can normally do a better job of scheduling +; LDR instructions than we can with LDM. +; This pattern will only match if the one above did not. +(define_split + [(set (match_operand:ANY64 0 "arm_general_register_operand" "") + (match_operand:ANY64 1 "const_double_operand" ""))] + "TARGET_ARM && reload_completed + && arm_const_double_by_parts (operands[1])" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 2) (match_dup 3))] + " + operands[2] = gen_highpart (SImode, operands[0]); + operands[3] = gen_highpart_mode (SImode, GET_MODE (operands[0]), + operands[1]); + operands[0] = gen_lowpart (SImode, operands[0]); + operands[1] = gen_lowpart (SImode, operands[1]); + " +) + +(define_split + [(set (match_operand:ANY64 0 "arm_general_register_operand" "") + (match_operand:ANY64 1 "arm_general_register_operand" ""))] + "TARGET_EITHER && reload_completed" + [(set (match_dup 0) (match_dup 1)) + (set (match_dup 2) (match_dup 3))] + " + operands[2] = gen_highpart (SImode, operands[0]); + operands[3] = gen_highpart (SImode, operands[1]); + operands[0] = gen_lowpart (SImode, operands[0]); + operands[1] = gen_lowpart (SImode, operands[1]); + + /* Handle a partial overlap. */ + if (rtx_equal_p (operands[0], operands[3])) + { + rtx tmp0 = operands[0]; + rtx tmp1 = operands[1]; + + operands[0] = operands[2]; + operands[1] = operands[3]; + operands[2] = tmp0; + operands[3] = tmp1; + } + " +) + ;; We can't actually do base+index doubleword loads if the index and ;; destination overlap. Split here so that we at least have chance to ;; schedule. @@ -4709,8 +4768,7 @@ { /* Writing a constant to memory needs a scratch, which should be handled with SECONDARY_RELOADs. */ - if (GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); emit_insn (gen_movsi (operands[0], operands[1])); @@ -4752,8 +4810,7 @@ { /* Writing a constant to memory needs a scratch, which should be handled with SECONDARY_RELOADs. */ - if (GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); emit_insn (gen_movsi (operands[0], operands[1])); @@ -4777,7 +4834,7 @@ case 3: return \"mov %0, %1\"; case 4: return \"mov %0, %1\"; case 5: return \"mov %0, %1\"; - default: abort (); + default: gcc_unreachable (); case 1: /* The stack pointer can end up being taken as an index register. Catch this case here and deal with it. */ @@ -4864,7 +4921,7 @@ "@ mov%?\\t%0, %1\\t%@ movhi mvn%?\\t%0, #%B1\\t%@ movhi - str%?h\\t%1, %0\\t%@ movhi + str%?h\\t%1, %0\\t%@ movhi ldr%?h\\t%0, %1\\t%@ movhi" [(set_attr "type" "*,*,store1,load1") (set_attr "predicable" "yes") @@ -4888,7 +4945,7 @@ (clobber (match_operand:SI 2 "register_operand" "=&l"))] "TARGET_THUMB" "* - abort ();" + gcc_unreachable ();" ) ;; We use a DImode scratch because we may occasionally need an additional @@ -4983,8 +5040,7 @@ { /* Writing a constant to memory needs a scratch, which should be handled with SECONDARY_RELOADs. */ - if (GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); emit_insn (gen_movsi (operands[0], operands[1])); @@ -5172,7 +5228,17 @@ (match_operand:DF 1 "soft_df_operand" "rDa,Db,Dc,mF,r"))] "TARGET_ARM && TARGET_SOFT_FLOAT " - "* return output_move_double (operands);" + "* + switch (which_alternative) + { + case 0: + case 1: + case 2: + return \"#\"; + default: + return output_move_double (operands); + } + " [(set_attr "length" "8,12,16,8,8") (set_attr "type" "*,*,*,load2,store2") (set_attr "pool_range" "1020") @@ -5780,7 +5846,7 @@ (define_insn "*negated_cbranchsi4" [(set (pc) (if_then_else - (match_operator 0 "arm_comparison_operator" + (match_operator 0 "equality_operator" [(match_operand:SI 1 "s_register_operand" "l") (neg:SI (match_operand:SI 2 "s_register_operand" "l"))]) (label_ref (match_operand 3 "" "")) @@ -6727,19 +6793,19 @@ (const_string "alu_shift_reg")))] ) -(define_insn "*cmpsi_neg_shiftsi" - [(set (reg:CC CC_REGNUM) - (compare:CC (match_operand:SI 0 "s_register_operand" "r") - (neg:SI (match_operator:SI 3 "shift_operator" - [(match_operand:SI 1 "s_register_operand" "r") - (match_operand:SI 2 "arm_rhs_operand" "rM")]))))] +(define_insn "*cmpsi_negshiftsi_si" + [(set (reg:CC_Z CC_REGNUM) + (compare:CC_Z + (neg:SI (match_operator:SI 1 "shift_operator" + [(match_operand:SI 2 "s_register_operand" "r") + (match_operand:SI 3 "reg_or_int_operand" "rM")])) + (match_operand:SI 0 "s_register_operand" "r")))] "TARGET_ARM" - "cmn%?\\t%0, %1%S3" + "cmn%?\\t%0, %2%S1" [(set_attr "conds" "set") - (set_attr "shift" "1") - (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "") - (const_string "alu_shift") - (const_string "alu_shift_reg")))] + (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "") + (const_string "alu_shift") + (const_string "alu_shift_reg")))] ) ;; Cirrus SF compare instruction @@ -6980,8 +7046,7 @@ (pc)))] "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bvs\\t%l0\;beq\\t%l0\"; " @@ -6997,8 +7062,7 @@ (pc)))] "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bmi\\t%l0\;bgt\\t%l0\"; " @@ -7033,8 +7097,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bmi\\t%l0\;bgt\\t%l0\"; " @@ -7050,8 +7113,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" "* - if (arm_ccfsm_state != 0) - abort (); + gcc_assert (!arm_ccfsm_state); return \"bvs\\t%l0\;beq\\t%l0\"; " @@ -7207,14 +7269,14 @@ ; [(set (match_operand:SI 0 "s_register_operand" "") ; (uneq:SI (match_dup 1) (const_int 0)))] ; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" -; "abort ();" +; "gcc_unreachable ();" ; ) ; ; (define_expand "sltgt" ; [(set (match_operand:SI 0 "s_register_operand" "") ; (ltgt:SI (match_dup 1) (const_int 0)))] ; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA" -; "abort ();" +; "gcc_unreachable ();" ; ) (define_insn "*mov_scc" @@ -9249,7 +9311,8 @@ { rtx ldm[3]; rtx arith[4]; - int val1 = 0, val2 = 0; + rtx base_reg; + HOST_WIDE_INT val1 = 0, val2 = 0; if (REGNO (operands[0]) > REGNO (operands[4])) { @@ -9261,12 +9324,21 @@ ldm[1] = operands[0]; ldm[2] = operands[4]; } - if (GET_CODE (XEXP (operands[2], 0)) != REG) - val1 = INTVAL (XEXP (XEXP (operands[2], 0), 1)); - if (GET_CODE (XEXP (operands[3], 0)) != REG) + + base_reg = XEXP (operands[2], 0); + + if (!REG_P (base_reg)) + { + val1 = INTVAL (XEXP (base_reg, 1)); + base_reg = XEXP (base_reg, 0); + } + + if (!REG_P (XEXP (operands[3], 0))) val2 = INTVAL (XEXP (XEXP (operands[3], 0), 1)); + arith[0] = operands[0]; arith[3] = operands[1]; + if (val1 < val2) { arith[1] = ldm[1]; @@ -9277,21 +9349,30 @@ arith[1] = ldm[2]; arith[2] = ldm[1]; } - if (val1 && val2) + + ldm[0] = base_reg; + if (val1 !=0 && val2 != 0) { - rtx ops[3]; - ldm[0] = ops[0] = operands[4]; - ops[1] = XEXP (XEXP (operands[2], 0), 0); - ops[2] = XEXP (XEXP (operands[2], 0), 1); - output_add_immediate (ops); - if (val1 < val2) - output_asm_insn (\"ldm%?ia\\t%0, {%1, %2}\", ldm); + if (val1 == 4 || val2 == 4) + /* Other val must be 8, since we know they are adjacent and neither + is zero. */ + output_asm_insn (\"ldm%?ib\\t%0, {%1, %2}\", ldm); else - output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); + { + rtx ops[3]; + + ldm[0] = ops[0] = operands[4]; + ops[1] = base_reg; + ops[2] = GEN_INT (val1); + output_add_immediate (ops); + if (val1 < val2) + output_asm_insn (\"ldm%?ia\\t%0, {%1, %2}\", ldm); + else + output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); + } } - else if (val1) + else if (val1 != 0) { - ldm[0] = XEXP (operands[3], 0); if (val1 < val2) output_asm_insn (\"ldm%?da\\t%0, {%1, %2}\", ldm); else @@ -9299,7 +9380,6 @@ } else { - ldm[0] = XEXP (operands[2], 0); if (val1 < val2) output_asm_insn (\"ldm%?ia\\t%0, {%1, %2}\", ldm); else @@ -9330,10 +9410,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "str%?b\\t%3, [%0, %2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9346,10 +9425,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (minus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "str%?b\\t%3, [%0, -%2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9362,10 +9440,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "ldr%?b\\t%3, [%0, %2]!" [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] @@ -9378,10 +9455,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (minus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "ldr%?b\\t%3, [%0, -%2]!" [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] @@ -9395,10 +9471,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "ldr%?b\\t%3, [%0, %2]!\\t%@ z_extendqisi" [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] @@ -9412,10 +9487,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (minus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "ldr%?b\\t%3, [%0, -%2]!\\t%@ z_extendqisi" [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] @@ -9428,10 +9502,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "str%?\\t%3, [%0, %2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9444,10 +9517,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (minus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "str%?\\t%3, [%0, -%2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9460,10 +9532,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (plus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "ldr%?\\t%3, [%0, %2]!" [(set_attr "type" "load1") (set_attr "predicable" "yes")] @@ -9476,10 +9547,9 @@ (set (match_operand:SI 0 "s_register_operand" "=r") (minus:SI (match_dup 1) (match_dup 2)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && (GET_CODE (operands[2]) != REG - || REGNO (operands[2]) != FRAME_POINTER_REGNUM)" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[2])" "ldr%?\\t%3, [%0, -%2]!" [(set_attr "type" "load1") (set_attr "predicable" "yes")] @@ -9495,9 +9565,9 @@ (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) (match_dup 1)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "str%?b\\t%5, [%0, %3%S2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9513,9 +9583,9 @@ (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) (match_dup 4)])))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "str%?b\\t%5, [%0, -%3%S2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9531,9 +9601,9 @@ (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) (match_dup 1)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "ldr%?b\\t%5, [%0, %3%S2]!" [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] @@ -9549,9 +9619,9 @@ (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) (match_dup 4)])))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "ldr%?b\\t%5, [%0, -%3%S2]!" [(set_attr "type" "load_byte") (set_attr "predicable" "yes")] @@ -9567,9 +9637,9 @@ (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) (match_dup 1)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "str%?\\t%5, [%0, %3%S2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9585,9 +9655,9 @@ (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) (match_dup 4)])))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "str%?\\t%5, [%0, -%3%S2]!" [(set_attr "type" "store1") (set_attr "predicable" "yes")] @@ -9603,9 +9673,9 @@ (plus:SI (match_op_dup 2 [(match_dup 3) (match_dup 4)]) (match_dup 1)))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "ldr%?\\t%5, [%0, %3%S2]!" [(set_attr "type" "load1") (set_attr "predicable" "yes")] @@ -9621,9 +9691,9 @@ (minus:SI (match_dup 1) (match_op_dup 2 [(match_dup 3) (match_dup 4)])))] "TARGET_ARM - && REGNO (operands[0]) != FRAME_POINTER_REGNUM - && REGNO (operands[1]) != FRAME_POINTER_REGNUM - && REGNO (operands[3]) != FRAME_POINTER_REGNUM" + && !arm_eliminable_register (operands[0]) + && !arm_eliminable_register (operands[1]) + && !arm_eliminable_register (operands[3])" "ldr%?\\t%5, [%0, -%3%S2]!" [(set_attr "type" "load1") (set_attr "predicable" "yes")]) diff --git a/gcc/config/arm/arm.opt b/gcc/config/arm/arm.opt new file mode 100644 index 00000000000..28bec490e38 --- /dev/null +++ b/gcc/config/arm/arm.opt @@ -0,0 +1,151 @@ +; Options for the ARM port of the compiler. + +; Copyright (C) 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. + +mabi= +Target RejectNegative Joined +Specify an ABI + +mabort-on-noreturn +Target Report Mask(ABORT_NORETURN) +Generate a call to abort if a noreturn function returns + +mapcs +Target RejectNegative Mask(APCS_FRAME) MaskExists Undocumented + +mapcs-float +Target Report Mask(APCS_FLOAT) +Pass FP arguments in FP registers + +mapcs-frame +Target Report Mask(APCS_FRAME) +Generate APCS conformant stack frames + +mapcs-reentrant +Target Report Mask(APCS_REENT) +Generate re-entrant, PIC code + +mapcs-stack-check +Target Report Mask(APCS_STACK) Undocumented + +march= +Target RejectNegative Joined +Specify the name of the target architecture + +marm +Target RejectNegative InverseMask(THUMB) Undocumented + +mbig-endian +Target Report RejectNegative Mask(BIG_END) +Assume target CPU is configured as big endian + +mcallee-super-interworking +Target Report Mask(CALLEE_INTERWORKING) +Thumb: Assume non-static functions may be called from ARM code + +mcaller-super-interworking +Target Report Mask(CALLER_INTERWORKING) +Thumb: Assume function pointers may go to non-Thumb aware code + +mcirrus-fix-invalid-insns +Target Report Mask(CIRRUS_FIX_INVALID_INSNS) +Cirrus: Place NOPs to avoid invalid instruction combinations + +mcpu= +Target RejectNegative Joined +Specify the name of the target CPU + +mfloat-abi= +Target RejectNegative Joined +Specify if floating point hardware should be used + +mfp= +Target RejectNegative Joined Undocumented + +;; Now ignored. +mfpe +Target RejectNegative Mask(FPE) Undocumented + +mfpe= +Target RejectNegative Joined Undocumented + +mfpu= +Target RejectNegative Joined +Specify the name of the target floating point hardware/format + +mhard-float +Target RejectNegative +Alias for -mfloat-abi=hard + +mlittle-endian +Target Report RejectNegative InverseMask(BIG_END) +Assume target CPU is configured as little endian + +mlong-calls +Target Report Mask(LONG_CALLS) +Generate call insns as indirect calls, if necessary + +mpic-register= +Target RejectNegative Joined +Specify the register to be used for PIC addressing + +mpoke-function-name +Target Report Mask(POKE_FUNCTION_NAME) +Store function names in object code + +msched-prolog +Target Report Mask(SCHED_PROLOG) +Permit scheduling of a function's prologue sequence + +msingle-pic-base +Target Report Mask(SINGLE_PIC_BASE) +Do not load the PIC register in function prologues + +msoft-float +Target RejectNegative +Alias for -mfloat-abi=soft + +mstructure-size-boundary= +Target RejectNegative Joined +Specify the minimum bit alignment of structures + +mthumb +Target Report Mask(THUMB) +Compile for the Thumb not the ARM + +mthumb-interwork +Target Report Mask(INTERWORK) +Support calls between Thumb and ARM instruction sets + +mtpcs-frame +Target Report Mask(TPCS_FRAME) +Thumb: Generate (non-leaf) stack frames even if not needed + +mtpcs-leaf-frame +Target Report Mask(TPCS_LEAF_FRAME) +Thumb: Generate (leaf) stack frames even if not needed + +mtune= +Target RejectNegative Joined +Tune code for the given processor + +mwords-little-endian +Target Report RejectNegative Mask(LITTLE_WORDS) +Assume big endian bytes, little endian words diff --git a/gcc/config/arm/bpabi.h b/gcc/config/arm/bpabi.h index 6fb11b9838c..86aca9b304b 100644 --- a/gcc/config/arm/bpabi.h +++ b/gcc/config/arm/bpabi.h @@ -1,5 +1,5 @@ /* Configuration file for ARM BPABI targets. - Copyright (C) 2004 + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC @@ -46,7 +46,7 @@ "%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \ "-X" -#if defined (__thumb__) && !defined (__THUMB_INTERWORK__) +#if defined (__thumb__) #define RENAME_LIBRARY_SET ".thumb_set" #else #define RENAME_LIBRARY_SET ".set" @@ -100,3 +100,10 @@ #define TARGET_OS_CPP_BUILTINS() \ TARGET_BPABI_CPP_BUILTINS() + +/* The BPABI specifies the use of .{init,fini}_array. Therefore, we + do not want GCC to put anything into the .{init,fini} sections. */ +#undef INIT_SECTION_ASM_OP +#undef FINI_SECTION_ASM_OP +#define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP +#define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP diff --git a/gcc/config/arm/cirrus.md b/gcc/config/arm/cirrus.md index 5a30eb5fa71..cbeeb8ab3fa 100644 --- a/gcc/config/arm/cirrus.md +++ b/gcc/config/arm/cirrus.md @@ -1,5 +1,5 @@ ;; Cirrus EP9312 "Maverick" ARM floating point co-processor description. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Red Hat. ;; Written by Aldy Hernandez (aldyh@redhat.com) @@ -377,9 +377,10 @@ switch (which_alternative) { case 0: + return \"#\"; case 1: case 2: - return (output_move_double (operands)); + return output_move_double (operands); case 3: return \"cfmv64lr%?\\t%V0, %Q1\;cfmv64hr%?\\t%V0, %R1\"; case 4: return \"cfmvr64l%?\\t%Q0, %V1\;cfmvr64h%?\\t%R0, %V1\"; @@ -390,7 +391,7 @@ /* Shifting by 0 will just copy %1 into %0. */ case 7: return \"cfsh64%?\\t%V0, %V1, #0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" " 8, 8, 8, 8, 8, 4, 4, 4") @@ -460,13 +461,14 @@ { case 0: return \"ldm%?ia\\t%m1, %M0\\t%@ double\"; case 1: return \"stm%?ia\\t%m0, %M1\\t%@ double\"; - case 2: case 3: case 4: return output_move_double (operands); + case 2: return \"#\"; + case 3: case 4: return output_move_double (operands); case 5: return \"cfcpyd%?\\t%V0, %V1\"; case 6: return \"cfldrd%?\\t%V0, %1\"; case 7: return \"cfmvdlr\\t%V0, %Q1\;cfmvdhr%?\\t%V0, %R1\"; case 8: return \"cfmvrdl%?\\t%Q0, %V1\;cfmvrdh%?\\t%R0, %V1\"; case 9: return \"cfstrd%?\\t%V1, %0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "type" "load1,store2, *,store2,load1, *, load1, *, *,store2") diff --git a/gcc/config/arm/coff.h b/gcc/config/arm/coff.h index 5ad7fb68e2f..7f6e084bf60 100644 --- a/gcc/config/arm/coff.h +++ b/gcc/config/arm/coff.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. For ARM with COFF object format. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Doug Evans (devans@cygnus.com). @@ -34,7 +34,7 @@ #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #ifndef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h index a6c6102d088..273dfe1b473 100644 --- a/gcc/config/arm/elf.h +++ b/gcc/config/arm/elf.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. For ARM with ELF obj format. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. Contributed by Philip Blundell and Catherine Moore @@ -108,7 +108,7 @@ #endif #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #endif #ifndef MULTILIB_DEFAULTS @@ -120,6 +120,10 @@ #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +/* Output an element in the static constructor array. */ +#undef TARGET_ASM_CONSTRUCTOR +#define TARGET_ASM_CONSTRUCTOR arm_elf_asm_constructor + /* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */ #define NEED_PLT_RELOC flag_pic #define NEED_GOT_RELOC flag_pic @@ -143,4 +147,5 @@ } \ while (0) -#define SUPPORTS_INIT_PRIORITY 1 +/* The EABI doesn't provide a way of implementing init_priority. */ +#define SUPPORTS_INIT_PRIORITY (!TARGET_AAPCS_BASED) diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md index 02d0804b5f0..cbcfc13cd8a 100644 --- a/gcc/config/arm/fpa.md +++ b/gcc/config/arm/fpa.md @@ -563,7 +563,8 @@ default: case 0: return \"ldm%?ia\\t%m1, %M0\\t%@ double\"; case 1: return \"stm%?ia\\t%m0, %M1\\t%@ double\"; - case 2: case 3: case 4: return output_move_double (operands); + case 2: return \"#\"; + case 3: case 4: return output_move_double (operands); case 5: return \"mvf%?d\\t%0, %1\"; case 6: return \"mnf%?d\\t%0, #%N1\"; case 7: return \"ldf%?d\\t%0, %1\"; diff --git a/gcc/config/arm/ieee754-df.S b/gcc/config/arm/ieee754-df.S index bce74e53b96..44dab20edc4 100644 --- a/gcc/config/arm/ieee754-df.S +++ b/gcc/config/arm/ieee754-df.S @@ -1,6 +1,6 @@ /* ieee754-df.S double-precision floating point support for ARM - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nicolas Pitre (nico@cam.org) This file is free software; you can redistribute it and/or modify it @@ -81,7 +81,7 @@ ARM_FUNC_START subdf3 ARM_FUNC_ALIAS aeabi_dsub subdf3 eor yh, yh, #0x80000000 @ flip sign bit of second arg -#if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +#if defined(__INTERWORKING_STUBS__) b 1f @ Skip Thumb-code prologue #endif diff --git a/gcc/config/arm/ieee754-sf.S b/gcc/config/arm/ieee754-sf.S index 101a70bf511..2d48ff67336 100644 --- a/gcc/config/arm/ieee754-sf.S +++ b/gcc/config/arm/ieee754-sf.S @@ -1,6 +1,6 @@ /* ieee754-sf.S single-precision floating point support for ARM - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nicolas Pitre (nico@cam.org) This file is free software; you can redistribute it and/or modify it @@ -62,7 +62,7 @@ ARM_FUNC_START subsf3 ARM_FUNC_ALIAS aeabi_fsub subsf3 eor r1, r1, #0x80000000 @ flip sign bit of second arg -#if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +#if defined(__INTERWORKING_STUBS__) b 1f @ Skip Thumb-code prologue #endif diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md index c2adfce07c6..a87d78ffce4 100644 --- a/gcc/config/arm/iwmmxt.md +++ b/gcc/config/arm/iwmmxt.md @@ -73,6 +73,8 @@ { default: return output_move_double (operands); + case 0: + return \"#\"; case 3: return \"wmov%?\\t%0,%1\"; case 4: @@ -155,7 +157,7 @@ (define_insn "movv8qi_internal" [(set (match_operand:V8QI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") - (match_operand:V8QI 1 "general_operand" "y,y,m,y,r,i"))] + (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,mi"))] "TARGET_REALLY_IWMMXT" "* switch (which_alternative) @@ -175,7 +177,7 @@ (define_insn "movv4hi_internal" [(set (match_operand:V4HI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") - (match_operand:V4HI 1 "general_operand" "y,y,m,y,r,i"))] + (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,mi"))] "TARGET_REALLY_IWMMXT" "* switch (which_alternative) @@ -195,7 +197,7 @@ (define_insn "movv2si_internal" [(set (match_operand:V2SI 0 "nonimmediate_operand" "=y,m,y,?r,?y,?r") - (match_operand:V2SI 1 "general_operand" "y,y,m,y,r,i"))] + (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,mi"))] "TARGET_REALLY_IWMMXT" "* switch (which_alternative) @@ -220,7 +222,7 @@ ;; deliberately omitted. (define_insn "movv2si_internal_2" [(set (match_operand:V2SI 0 "nonimmediate_operand" "=?r") - (match_operand 1 "immediate_operand" "i"))] + (match_operand 1 "immediate_operand" "mi"))] "TARGET_REALLY_IWMMXT" "* return output_move_double (operands);" [(set_attr "predicable" "yes") diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm index b8df889d600..fb28ad5d5d4 100644 --- a/gcc/config/arm/lib1funcs.asm +++ b/gcc/config/arm/lib1funcs.asm @@ -94,10 +94,20 @@ Boston, MA 02111-1307, USA. */ # define RET bx lr # define RETc(x) bx##x lr -# if (__ARM_ARCH__ == 4) \ - && (defined(__thumb__) || defined(__THUMB_INTERWORK__)) -# define __INTERWORKING__ -# endif +/* Special precautions for interworking on armv4t. */ +# if (__ARM_ARCH__ == 4) + +/* Always use bx, not ldr pc. */ +# if (defined(__thumb__) || defined(__THUMB_INTERWORK__)) +# define __INTERWORKING__ +# endif /* __THUMB__ || __THUMB_INTERWORK__ */ + +/* Include thumb stub before arm mode code. */ +# if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +# define __INTERWORKING_STUBS__ +# endif /* __thumb__ && !__THUMB_INTERWORK__ */ + +#endif /* __ARM_ARCH == 4 */ #else @@ -106,19 +116,82 @@ Boston, MA 02111-1307, USA. */ #endif +.macro cfi_pop advance, reg, cfa_offset +#ifdef __ELF__ + .pushsection .debug_frame + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte \advance + .byte (0xc0 | \reg) /* DW_CFA_restore */ + .byte 0xe /* DW_CFA_def_cfa_offset */ + .uleb128 \cfa_offset + .popsection +#endif +.endm +.macro cfi_push advance, reg, offset, cfa_offset +#ifdef __ELF__ + .pushsection .debug_frame + .byte 0x4 /* DW_CFA_advance_loc4 */ + .4byte \advance + .byte (0x80 | \reg) /* DW_CFA_offset */ + .uleb128 (\offset / -4) + .byte 0xe /* DW_CFA_def_cfa_offset */ + .uleb128 \cfa_offset + .popsection +#endif +.endm +.macro cfi_start start_label, end_label +#ifdef __ELF__ + .pushsection .debug_frame +LSYM(Lstart_frame): + .4byte LSYM(Lend_cie) - LSYM(Lstart_cie) @ Length of CIE +LSYM(Lstart_cie): + .4byte 0xffffffff @ CIE Identifier Tag + .byte 0x1 @ CIE Version + .ascii "\0" @ CIE Augmentation + .uleb128 0x1 @ CIE Code Alignment Factor + .sleb128 -4 @ CIE Data Alignment Factor + .byte 0xe @ CIE RA Column + .byte 0xc @ DW_CFA_def_cfa + .uleb128 0xd + .uleb128 0x0 + + .align 2 +LSYM(Lend_cie): + .4byte LSYM(Lend_fde)-LSYM(Lstart_fde) @ FDE Length +LSYM(Lstart_fde): + .4byte LSYM(Lstart_frame) @ FDE CIE offset + .4byte \start_label @ FDE initial location + .4byte \end_label-\start_label @ FDE address range + .popsection +#endif +.endm +.macro cfi_end end_label +#ifdef __ELF__ + .pushsection .debug_frame + .align 2 +LSYM(Lend_fde): + .popsection +\end_label: +#endif +.endm + /* Don't pass dirn, it's there just to get token pasting right. */ -.macro RETLDM regs=, cond=, dirn=ia +.macro RETLDM regs=, cond=, unwind=, dirn=ia #if defined (__INTERWORKING__) .ifc "\regs","" - ldr\cond lr, [sp], #4 + ldr\cond lr, [sp], #8 .else ldm\cond\dirn sp!, {\regs, lr} .endif + .ifnc "\unwind", "" + /* Mark LR as restored. */ +97: cfi_pop 97b - \unwind, 0xe, 0x0 + .endif bx\cond lr #else .ifc "\regs","" - ldr\cond pc, [sp], #4 + ldr\cond pc, [sp], #8 .else ldm\cond\dirn sp!, {\regs, pc} .endif @@ -126,25 +199,25 @@ Boston, MA 02111-1307, USA. */ .endm -.macro ARM_LDIV0 -LSYM(Ldiv0): - str lr, [sp, #-4]! +.macro ARM_LDIV0 name + str lr, [sp, #-8]! +98: cfi_push 98b - __\name, 0xe, -0x8, 0x8 bl SYM (__div0) __PLT__ mov r0, #0 @ About as wrong as it could be. - RETLDM + RETLDM unwind=98b .endm -.macro THUMB_LDIV0 -LSYM(Ldiv0): - push { lr } +.macro THUMB_LDIV0 name + push { r1, lr } +98: cfi_push 98b - __\name, 0xe, -0x4, 0x8 bl SYM (__div0) mov r0, #0 @ About as wrong as it could be. #if defined (__INTERWORKING__) - pop { r1 } - bx r1 + pop { r1, r2 } + bx r2 #else - pop { pc } + pop { r1, pc } #endif .endm @@ -153,12 +226,14 @@ LSYM(Ldiv0): .endm .macro DIV_FUNC_END name + cfi_start __\name, LSYM(Lend_div0) LSYM(Ldiv0): #ifdef __thumb__ - THUMB_LDIV0 + THUMB_LDIV0 \name #else - ARM_LDIV0 + ARM_LDIV0 \name #endif + cfi_end LSYM(Lend_div0) FUNC_END \name .endm @@ -192,7 +267,7 @@ SYM (__\name): /* Special function that will always be coded in ARM assembly, even if in Thumb-only compilation. */ -#if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +#if defined(__INTERWORKING_STUBS__) .macro ARM_FUNC_START name FUNC_START \name bx pc @@ -225,13 +300,17 @@ SYM (__\name): .macro FUNC_ALIAS new old .globl SYM (__\new) - EQUIV SYM (__\new), SYM (__\old) +#if defined (__thumb__) + .thumb_set SYM (__\new), SYM (__\old) +#else + .set SYM (__\new), SYM (__\old) +#endif .endm .macro ARM_FUNC_ALIAS new old .globl SYM (__\new) EQUIV SYM (__\new), SYM (__\old) -#ifdef __thumb__ +#if defined(__INTERWORKING_STUBS__) .set SYM (_L__\new), SYM (_L__\old) #endif .endm @@ -909,16 +988,24 @@ LSYM(Lover12): #define __NR_SYSCALL_BASE 0x900000 #define __NR_getpid (__NR_SYSCALL_BASE+ 20) #define __NR_kill (__NR_SYSCALL_BASE+ 37) +#define __NR_gettid (__NR_SYSCALL_BASE+ 224) +#define __NR_tkill (__NR_SYSCALL_BASE+ 238) .code 32 FUNC_START div0 stmfd sp!, {r1, lr} - swi __NR_getpid + swi __NR_gettid cmn r0, #1000 + swihs __NR_getpid + cmnhs r0, #1000 RETLDM r1 hs + mov ip, r0 mov r1, #SIGFPE - swi __NR_kill + swi __NR_tkill + movs r0, r0 + movne r0, ip + swine __NR_kill RETLDM r1 FUNC_END div0 @@ -1123,8 +1210,14 @@ LSYM(Lover12): .code 32 .globl _arm_return +LSYM(Lstart_arm_return): + cfi_start LSYM(Lstart_arm_return) LSYM(Lend_arm_return) + cfi_push 0, 0xe, -0x8, 0x8 + nop @ This nop is for the benefit of debuggers, so that + @ backtraces will use the correct unwind information. _arm_return: - RETLDM + RETLDM unwind=LSYM(Lstart_arm_return) + cfi_end LSYM(Lend_arm_return) .globl _arm_return_r7 _arm_return_r7: @@ -1165,7 +1258,7 @@ _arm_return_r11: .globl LSYM(Lchange_\register) LSYM(Lchange_\register): tst \register, #1 - streq lr, [sp, #-4]! + streq lr, [sp, #-8]! adreq lr, _arm_return bx \register @@ -1202,7 +1295,7 @@ LSYM(Lchange_\register): .globl .Lchange_lr .Lchange_lr: tst lr, #1 - stmeqdb r13!, {lr} + stmeqdb r13!, {lr, pc} mov ip, lr adreq lr, _arm_return bx ip diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index 48b0f016401..b609a813a7c 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -128,11 +128,14 @@ (TARGET_ARM && NEED_PLT_RELOC) ? "(PLT)" : ""); \ } -/* The linux profiler clobbers the link register. Make sure the +/* The GNU/Linux profiler clobbers the link register. Make sure the prologue knows to save it. */ #define PROFILE_HOOK(X) \ emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM))) +/* The GNU/Linux profiler needs a frame pointer. */ +#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile + #undef CC1_SPEC #define CC1_SPEC "%{profile:-p}" diff --git a/gcc/config/arm/linux-gas.h b/gcc/config/arm/linux-gas.h index 85ae98a5eff..45afa6e185b 100644 --- a/gcc/config/arm/linux-gas.h +++ b/gcc/config/arm/linux-gas.h @@ -42,19 +42,6 @@ #undef WCHAR_TYPE_SIZE #define WCHAR_TYPE_SIZE BITS_PER_WORD -/* Emit code to set up a trampoline and synchronize the caches. */ -#undef INITIALIZE_TRAMPOLINE -#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -{ \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 8)), \ - (CXT)); \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 12)), \ - (FNADDR)); \ - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ -} - /* Clear the instruction cache from `beg' to `end'. This makes an inline system call to SYS_cacheflush. */ #define CLEAR_INSN_CACHE(BEG, END) \ diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h index 9cf47c76188..a33079b64f5 100644 --- a/gcc/config/arm/netbsd-elf.h +++ b/gcc/config/arm/netbsd-elf.h @@ -35,7 +35,7 @@ /* Default it to use ATPCS with soft-VFP. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (ARM_FLAG_APCS_FRAME \ + (MASK_APCS_FRAME \ | TARGET_ENDIAN_DEFAULT) #undef ARM_DEFAULT_ABI @@ -136,21 +136,6 @@ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 -/* Emit code to set up a trampoline and synchronize the caches. */ -#undef INITIALIZE_TRAMPOLINE -#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -do \ - { \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 8)), \ - (CXT)); \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 12)), \ - (FNADDR)); \ - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ - } \ -while (0) - /* Clear the instruction cache from `BEG' to `END'. This makes a call to the ARM_SYNC_ICACHE architecture specific syscall. */ #define CLEAR_INSN_CACHE(BEG, END) \ diff --git a/gcc/config/arm/netbsd.h b/gcc/config/arm/netbsd.h index 8b9e437a66b..75a3024c7ea 100644 --- a/gcc/config/arm/netbsd.h +++ b/gcc/config/arm/netbsd.h @@ -1,5 +1,5 @@ /* NetBSD/arm a.out version. - Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004 + Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Mark Brinicombe (amb@physig.ph.kcl.ac.uk) @@ -36,7 +36,7 @@ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME) +#define TARGET_DEFAULT (MASK_APCS_FRAME) /* Some defines for CPP. arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */ @@ -58,7 +58,7 @@ %(cpp_cpu_arch) %(cpp_float) %(cpp_endian) %(netbsd_cpp_spec) \ " -/* Because TARGET_DEFAULT sets ARM_FLAG_SOFT_FLOAT */ +/* Because TARGET_DEFAULT sets MASK_SOFT_FLOAT */ #undef CPP_FLOAT_DEFAULT_SPEC #define CPP_FLOAT_DEFAULT_SPEC "-D__SOFTFP__" @@ -138,19 +138,6 @@ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 -/* Emit code to set up a trampoline and synchronize the caches. */ -#undef INITIALIZE_TRAMPOLINE -#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ -{ \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 8)), \ - (CXT)); \ - emit_move_insn (gen_rtx_MEM (SImode, plus_constant ((TRAMP), 12)), \ - (FNADDR)); \ - emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ - 0, VOIDmode, 2, TRAMP, Pmode, \ - plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ -} - /* Clear the instruction cache from `BEG' to `END'. This makes a call to the ARM32_SYNC_ICACHE architecture specific syscall. */ #define CLEAR_INSN_CACHE(BEG, END) \ diff --git a/gcc/config/arm/pe.c b/gcc/config/arm/pe.c index 622f7d29bd8..c80ad0054e4 100644 --- a/gcc/config/arm/pe.c +++ b/gcc/config/arm/pe.c @@ -1,5 +1,5 @@ /* Routines for GCC for ARM/pe. - Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004 + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -108,13 +108,11 @@ arm_mark_dllexport (decl) tree idp; rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); + if (arm_dllimport_name_p (oldname)) oldname += 9; else if (arm_dllexport_name_p (oldname)) @@ -147,17 +145,13 @@ arm_mark_dllimport (decl) rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); - if (arm_dllexport_name_p (oldname)) - abort (); /* this shouldn't happen */ - else if (arm_dllimport_name_p (oldname)) + gcc_assert (!arm_dllexport_name_p (oldname)); + if (arm_dllimport_name_p (oldname)) return; /* already done */ /* ??? One can well ask why we're making these checks here, diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h index d47489574a1..485fd3b598b 100644 --- a/gcc/config/arm/pe.h +++ b/gcc/config/arm/pe.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with PE obj format. - Copyright (C) 1995, 1996, 1999, 2000, 2002, 2003, 2004 + Copyright (C) 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -45,22 +45,8 @@ #undef SUBTARGET_CPP_SPEC #define SUBTARGET_CPP_SPEC "-D__pe__" - -/* Experimental addition for pr 7885. - Ignore dllimport for functions. */ -#define TARGET_FLAG_NOP_FUN (1 << 24) - -#undef TARGET_NOP_FUN_DLLIMPORT -#define TARGET_NOP_FUN_DLLIMPORT (target_flags & TARGET_FLAG_NOP_FUN) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{ "nop-fun-dllimport", TARGET_FLAG_NOP_FUN, \ - N_("Ignore dllimport attribute for functions") }, \ -{ "no-nop-fun-dllimport", - TARGET_FLAG_NOP_FUN, "" }, - #undef TARGET_DEFAULT -#define TARGET_DEFAULT (TARGET_FLAG_NOP_FUN) +#define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT) #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ diff --git a/gcc/config/arm/pe.opt b/gcc/config/arm/pe.opt new file mode 100644 index 00000000000..05ec5941e3b --- /dev/null +++ b/gcc/config/arm/pe.opt @@ -0,0 +1,24 @@ +; PE-specific options for the ARM port + +; Copyright (C) 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. + +mnop-fun-dllimport +Target Report Mask(NOP_FUN_DLLIMPORT) +Ignore dllimport attribute for functions diff --git a/gcc/config/arm/semi.h b/gcc/config/arm/semi.h index d12ef4bacc1..8a3587c91dd 100644 --- a/gcc/config/arm/semi.h +++ b/gcc/config/arm/semi.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. ARM on semi-hosted platform - Copyright (C) 1994, 1995, 1996, 1997, 2001, 2004 + Copyright (C) 1994, 1995, 1996, 1997, 2001, 2004, 2005 Free Software Foundation, Inc. Contributed by Richard Earnshaw (richard.earnshaw@arm.com) @@ -43,7 +43,7 @@ #endif #ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_APCS_FRAME) +#define TARGET_DEFAULT (MASK_APCS_FRAME) #endif #ifndef SUBTARGET_EXTRA_SPECS diff --git a/gcc/config/arm/symbian.h b/gcc/config/arm/symbian.h index 2a588ed780a..4f5ac375500 100644 --- a/gcc/config/arm/symbian.h +++ b/gcc/config/arm/symbian.h @@ -1,5 +1,5 @@ /* Configuration file for Symbian OS on ARM processors. - Copyright (C) 2004 + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC @@ -87,3 +87,15 @@ builtin_define ("__symbian__"); \ } \ while (false) + +/* On SymbianOS, these sections are not writable, so we use "a", + rather than "aw", for the section attributes. */ +#undef ARM_EABI_CTORS_SECTION_OP +#define ARM_EABI_CTORS_SECTION_OP \ + "\t.section\t.init_array,\"a\",%init_array" +#undef ARM_EABI_DTORS_SECTION_OP +#define ARM_EABI_DTORS_SECTION_OP \ + "\t.section\t.fini_array,\"a\",%fini_array" + +/* SymbianOS cannot merge entities with vague linkage at runtime. */ +#define TARGET_ARM_DYNAMIC_VAGUE_LINKAGE_P false diff --git a/gcc/config/arm/uclinux-elf.h b/gcc/config/arm/uclinux-elf.h index 4bfb64b8678..cc40840f2b2 100644 --- a/gcc/config/arm/uclinux-elf.h +++ b/gcc/config/arm/uclinux-elf.h @@ -1,5 +1,5 @@ /* Definitions for ARM running ucLinux using ELF - Copyright (C) 1999, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2004, 2005 Free Software Foundation, Inc. Contributed by Philip Blundell This file is part of GCC. @@ -27,4 +27,4 @@ #define TARGET_VERSION fputs (" (ARM/ELF ucLinux)", stderr); #undef TARGET_DEFAULT -#define TARGET_DEFAULT (ARM_FLAG_SINGLE_PIC_BASE) +#define TARGET_DEFAULT (MASK_SINGLE_PIC_BASE) diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md index fb20dd19760..c6ace731e66 100644 --- a/gcc/config/arm/vfp.md +++ b/gcc/config/arm/vfp.md @@ -142,8 +142,11 @@ "* switch (which_alternative) { - case 0: case 1: case 2: - return (output_move_double (operands)); + case 0: + return \"#\"; + case 1: + case 2: + return output_move_double (operands); case 3: return \"fmdrr%?\\t%P0, %1\\t%@ int\"; case 4: @@ -155,7 +158,7 @@ case 7: return \"fstd%?\\t%P1, %0\\t%@ int\"; default: - abort (); + gcc_unreachable (); } " [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_load,f_store") @@ -203,7 +206,7 @@ return \"fmdrr%?\\t%P0, %Q1, %R1\"; case 1: return \"fmrrd%?\\t%Q0, %R0, %P1\"; - case 2: case 3: case 7: + case 2: case 3: return output_move_double (operands); case 4: return \"fldd%?\\t%P0, %1\"; @@ -211,8 +214,10 @@ return \"fstd%?\\t%P1, %0\"; case 6: return \"fcpyd%?\\t%P0, %P1\"; + case 7: + return \"#\"; default: - abort (); + gcc_unreachable (); } } " @@ -293,20 +298,59 @@ ) (define_insn "*negsf2_vfp" - [(set (match_operand:SF 0 "s_register_operand" "+w") - (neg:SF (match_operand:SF 1 "s_register_operand" "w")))] + [(set (match_operand:SF 0 "s_register_operand" "=w,?r") + (neg:SF (match_operand:SF 1 "s_register_operand" "w,r")))] "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" - "fnegs%?\\t%0, %1" + "@ + fnegs%?\\t%0, %1 + eor%?\\t%0, %1, #-2147483648" [(set_attr "predicable" "yes") (set_attr "type" "ffarith")] ) -(define_insn "*negdf2_vfp" - [(set (match_operand:DF 0 "s_register_operand" "+w") - (neg:DF (match_operand:DF 1 "s_register_operand" "w")))] +(define_insn_and_split "*negdf2_vfp" + [(set (match_operand:DF 0 "s_register_operand" "=w,?r,?r") + (neg:DF (match_operand:DF 1 "s_register_operand" "w,0,r")))] "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP" - "fnegd%?\\t%P0, %P1" + "@ + fnegd%?\\t%P0, %P1 + # + #" + "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP && reload_completed + && arm_general_register_operand (operands[0], DFmode)" + [(set (match_dup 0) (match_dup 1))] + " + if (REGNO (operands[0]) == REGNO (operands[1])) + { + operands[0] = gen_highpart (SImode, operands[0]); + operands[1] = gen_rtx_XOR (SImode, operands[0], GEN_INT (0x80000000)); + } + else + { + rtx in_hi, in_lo, out_hi, out_lo; + + in_hi = gen_rtx_XOR (SImode, gen_highpart (SImode, operands[1]), + GEN_INT (0x80000000)); + in_lo = gen_lowpart (SImode, operands[1]); + out_hi = gen_highpart (SImode, operands[0]); + out_lo = gen_lowpart (SImode, operands[0]); + + if (REGNO (in_lo) == REGNO (out_hi)) + { + emit_insn (gen_rtx_SET (SImode, out_lo, in_lo)); + operands[0] = out_hi; + operands[1] = in_hi; + } + else + { + emit_insn (gen_rtx_SET (SImode, out_hi, in_hi)); + operands[0] = out_lo; + operands[1] = in_lo; + } + } + " [(set_attr "predicable" "yes") + (set_attr "length" "4,4,8") (set_attr "type" "ffarith")] ) diff --git a/gcc/config/arm/wince-pe.h b/gcc/config/arm/wince-pe.h index 121848b44c9..7da1d70c350 100644 --- a/gcc/config/arm/wince-pe.h +++ b/gcc/config/arm/wince-pe.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with WINCE-PE obj format. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nick Clifton This file is part of GCC. @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (TARGET_FLAG_NOP_FUN) +#define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT) #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index e7a453ee63c..0be2f1c32f5 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -48,6 +48,7 @@ /* Maximal allowed offset for an address in the LD command */ #define MAX_LD_OFFSET(MODE) (64 - (signed)GET_MODE_SIZE (MODE)) +static bool avr_handle_option (size_t, const char *, int); static int avr_naked_function_p (tree); static int interrupt_function_p (tree); static int signal_function_p (tree); @@ -111,10 +112,10 @@ static int epilogue_size; static int jump_tables_size; /* Initial stack value specified by the `-minit-stack=' option */ -const char *avr_init_stack = "__stack"; +static const char *avr_init_stack = "__stack"; /* Default MCU name */ -const char *avr_mcu_name = "avr2"; +static const char *avr_mcu_name = "avr2"; /* Preprocessor macros to define depending on MCU type. */ const char *avr_base_arch_macro; @@ -244,6 +245,8 @@ int avr_case_values_threshold = 30000; #define TARGET_ATTRIBUTE_TABLE avr_attribute_table #undef TARGET_ASM_FUNCTION_RODATA_SECTION #define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION avr_handle_option #undef TARGET_INSERT_ATTRIBUTES #define TARGET_INSERT_ATTRIBUTES avr_insert_attributes #undef TARGET_SECTION_TYPE_FLAGS @@ -263,6 +266,26 @@ int avr_case_values_threshold = 30000; struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +avr_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_minit_stack_: + avr_init_stack = arg; + return true; + + case OPT_mmcu_: + avr_mcu_name = arg; + return true; + + default: + return true; + } +} + void avr_override_options (void) { @@ -357,8 +380,7 @@ avr_naked_function_p (tree func) { tree a; - if (TREE_CODE (func) != FUNCTION_DECL) - abort (); + gcc_assert (TREE_CODE (func) == FUNCTION_DECL); a = lookup_attribute ("naked", DECL_ATTRIBUTES (func)); return a != NULL_TREE; @@ -529,7 +551,7 @@ out_adj_frame_ptr (FILE *file, int adj) if (TARGET_TINY_STACK) { if (adj < -63 || adj > 63) - warning ("large frame pointer change (%d) with -mtiny-stack", adj); + warning (0, "large frame pointer change (%d) with -mtiny-stack", adj); /* The high byte (r29) doesn't change - prefer "subi" (1 cycle) over "sbiw" (2 cycles, same size). */ @@ -681,14 +703,12 @@ avr_output_function_prologue (FILE *file, HOST_WIDE_INT size) } else if (minimize && (frame_pointer_needed || live_seq > 6)) { - const char *cfun_name = current_function_name (); fprintf (file, ("\t" AS1 (ldi, r26) ",lo8(" HOST_WIDE_INT_PRINT_DEC ")" CR_TAB AS1 (ldi, r27) ",hi8(" HOST_WIDE_INT_PRINT_DEC ")" CR_TAB), size, size); - fprintf (file, (AS2 (ldi, r30, pm_lo8(.L_%s_body)) CR_TAB - AS2 (ldi, r31, pm_hi8(.L_%s_body)) CR_TAB), - cfun_name, cfun_name); + fputs ((AS2 (ldi,r30,pm_lo8(1f)) CR_TAB + AS2 (ldi,r31,pm_hi8(1f)) CR_TAB), file); prologue_size += 4; @@ -704,7 +724,7 @@ avr_output_function_prologue (FILE *file, HOST_WIDE_INT size) (18 - live_seq) * 2); ++prologue_size; } - fprintf (file, ".L_%s_body:\n", cfun_name); + fputs ("1:\n", file); } else { @@ -1009,7 +1029,7 @@ ptrreg_to_str (int regno) case REG_Y: return "Y"; case REG_Z: return "Z"; default: - abort (); + gcc_unreachable (); } return NULL; } @@ -1041,7 +1061,7 @@ cond_string (enum rtx_code code) case LTU: return "lo"; default: - abort (); + gcc_unreachable (); } } @@ -4649,14 +4669,14 @@ avr_handle_progmem_attribute (tree *node, tree name, { if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node)) { - warning ("only initialized variables can be placed into " + warning (0, "only initialized variables can be placed into " "program memory area"); *no_add_attrs = true; } } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -4675,7 +4695,7 @@ avr_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -4692,7 +4712,7 @@ avr_handle_fndecl_attribute (tree *node, tree name, { if (strncmp (func_name, "__vector", strlen ("__vector")) != 0) { - warning ("`%s' appears to be a misspelled interrupt handler", + warning (0, "`%s' appears to be a misspelled interrupt handler", func_name); } } @@ -4700,7 +4720,7 @@ avr_handle_fndecl_attribute (tree *node, tree name, { if (strncmp (func_name, "__vector", strlen ("__vector")) != 0) { - warning ("`%s' appears to be a misspelled signal handler", + warning (0, "`%s' appears to be a misspelled signal handler", func_name); } } @@ -4769,7 +4789,7 @@ avr_section_type_flags (tree decl, const char *name, int reloc) && DECL_INITIAL (decl) == NULL_TREE) flags |= SECTION_BSS; /* @nobits */ else - warning ("only uninitialized variables can be placed in the " + warning (0, "only uninitialized variables can be placed in the " ".noinit section"); } @@ -5513,7 +5533,7 @@ avr_normalize_condition (RTX_CODE condition) case LEU: return LTU; default: - abort (); + gcc_unreachable (); } } @@ -5849,6 +5869,7 @@ avr_output_bld (rtx operands[], int bit_nr) void avr_output_addr_vec_elt (FILE *stream, int value) { + progmem_section (); if (AVR_MEGA) fprintf (stream, "\t.word pm(.L%d)\n", value); else diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 6b54c37626b..5b7c73dfac6 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -42,53 +42,6 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -/* This declaration should be present. */ -extern int target_flags; - -#define MASK_ALL_DEBUG 0x00000FE0 -#define MASK_ORDER_1 0x00001000 -#define MASK_INSN_SIZE_DUMP 0x00002000 -#define MASK_ORDER_2 0x00004000 -#define MASK_NO_TABLEJUMP 0x00008000 -#define MASK_INT8 0x00010000 -#define MASK_NO_INTERRUPTS 0x00020000 -#define MASK_CALL_PROLOGUES 0x00040000 -#define MASK_TINY_STACK 0x00080000 -#define MASK_SHORT_CALLS 0x00100000 - -#define TARGET_ORDER_1 (target_flags & MASK_ORDER_1) -#define TARGET_ORDER_2 (target_flags & MASK_ORDER_2) -#define TARGET_INT8 (target_flags & MASK_INT8) -#define TARGET_NO_INTERRUPTS (target_flags & MASK_NO_INTERRUPTS) -#define TARGET_INSN_SIZE_DUMP (target_flags & MASK_INSN_SIZE_DUMP) -#define TARGET_CALL_PROLOGUES (target_flags & MASK_CALL_PROLOGUES) -#define TARGET_TINY_STACK (target_flags & MASK_TINY_STACK) -#define TARGET_NO_TABLEJUMP (target_flags & MASK_NO_TABLEJUMP) -#define TARGET_SHORT_CALLS (target_flags & MASK_SHORT_CALLS) -#define TARGET_ALL_DEBUG (target_flags & MASK_ALL_DEBUG) - -#define TARGET_SWITCHES { \ - { "order1", MASK_ORDER_1, NULL }, \ - { "order2", MASK_ORDER_2, NULL }, \ - { "int8", MASK_INT8, N_("Assume int to be 8 bit integer") }, \ - { "no-interrupts", MASK_NO_INTERRUPTS, \ - N_("Change the stack pointer without disabling interrupts") }, \ - { "call-prologues", MASK_CALL_PROLOGUES, \ - N_("Use subroutines for function prologue/epilogue") }, \ - { "tiny-stack", MASK_TINY_STACK, \ - N_("Change only the low 8 bits of the stack pointer") }, \ - { "no-tablejump", MASK_NO_TABLEJUMP, \ - N_("Do not generate tablejump insns") }, \ - { "short-calls", MASK_SHORT_CALLS, \ - N_("Use rjmp/rcall (limited range) on >8K devices") }, \ - { "size", MASK_INSN_SIZE_DUMP, \ - N_("Output instruction sizes to the asm file") }, \ - { "deb", MASK_ALL_DEBUG, NULL }, \ - { "", 0, NULL } } - -extern const char *avr_init_stack; -extern const char *avr_mcu_name; - extern const char *avr_base_arch_macro; extern const char *avr_extra_arch_macro; extern int avr_mega_p; @@ -98,10 +51,6 @@ extern int avr_asm_only_p; #define AVR_MEGA (avr_mega_p && !TARGET_SHORT_CALLS) #define AVR_ENHANCED (avr_enhanced_p) -#define TARGET_OPTIONS { \ - { "init-stack=", &avr_init_stack, N_("Specify the initial stack address"), 0}, \ - { "mcu=", &avr_mcu_name, N_("Specify the MCU name"), 0} } - #define TARGET_VERSION fprintf (stderr, " (GNU assembler syntax)"); #define OVERRIDE_OPTIONS avr_override_options () @@ -719,15 +668,13 @@ sprintf (STRING, "*.%s%lu", PREFIX, (unsigned long)(NUM)) #define ASM_OUTPUT_REG_PUSH(STREAM, REGNO) \ { \ - if (REGNO > 31) \ - abort (); \ + gcc_assert (REGNO < 32); \ fprintf (STREAM, "\tpush\tr%d", REGNO); \ } #define ASM_OUTPUT_REG_POP(STREAM, REGNO) \ { \ - if (REGNO > 31) \ - abort (); \ + gcc_assert (REGNO < 32); \ fprintf (STREAM, "\tpop\tr%d", REGNO); \ } diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt new file mode 100644 index 00000000000..8d40f926907 --- /dev/null +++ b/gcc/config/avr/avr.opt @@ -0,0 +1,65 @@ +; Options for the ATMEL AVR port of the compiler. + +; Copyright (C) 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. + +mcall-prologues +Target Report Mask(CALL_PROLOGUES) +Use subroutines for function prologues and epilogues + +mmcu= +Target RejectNegative Joined +-mmcu=MCU Select the target MCU + +mdeb +Target Report Undocumented Mask(ALL_DEBUG) + +minit-stack= +Target RejectNegative Joined +-minit-stack=STACK Use STACK as the initial value of the stack pointer + +mint8 +Target Report Mask(INT8) +Use an 8-bit 'int' type + +mno-interrupts +Target Report RejectNegative Mask(NO_INTERRUPTS) +Change the stack pointer without disabling interrupts + +mno-tablejump +Target Report RejectNegative Mask(NO_TABLEJUMP) +Do not generate tablejump insns + +morder1 +Target Report Undocumented Mask(ORDER_1) + +morder2 +Target Report Undocumented Mask(ORDER_2) + +mshort-calls +Target Report Mask(SHORT_CALLS) +Use rjmp/rcall (limited range) on >8K devices + +msize +Target Report Mask(INSN_SIZE_DUMP) +Output instruction sizes to the asm file + +mtiny-stack +Target Report Mask(TINY_STACK) +Change only the low 8 bits of the stack pointer diff --git a/gcc/config/avr/t-avr b/gcc/config/avr/t-avr index fd2134359d7..4209e9c55e2 100644 --- a/gcc/config/avr/t-avr +++ b/gcc/config/avr/t-avr @@ -1,7 +1,3 @@ -# Specific names for AVR tools -AR_FOR_TARGET = avr-ar -RANLIB_FOR_TARGET = avr-ranlib - LIB1ASMSRC = avr/libgcc.S LIB1ASMFUNCS = \ _mulqi3 \ diff --git a/gcc/config/bfin/bfin-modes.def b/gcc/config/bfin/bfin-modes.def new file mode 100644 index 00000000000..18ed3156941 --- /dev/null +++ b/gcc/config/bfin/bfin-modes.def @@ -0,0 +1,25 @@ +/* Definitions of target machine for GNU compiler, for Blackfin. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Analog Devices. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ + +/* PDImode for the 40 bit accumulators. */ +PARTIAL_INT_MODE (DI); + +VECTOR_MODE (INT, HI, 2); /* V2HI */ diff --git a/gcc/config/bfin/bfin-protos.h b/gcc/config/bfin/bfin-protos.h new file mode 100644 index 00000000000..e75046aeb19 --- /dev/null +++ b/gcc/config/bfin/bfin-protos.h @@ -0,0 +1,88 @@ +/* Prototypes for Blackfin functions used in the md file & elsewhere. + Copyright (C) 2005 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. */ + +/* Function prototypes that cannot exist in bfin.h due to dependency + complications. */ +#ifndef GCC_BFIN_PROTOS_H +#define GCC_BFIN_PROTOS_H + +#define Mmode enum machine_mode + +extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int); +extern void function_arg_advance (CUMULATIVE_ARGS *, Mmode, tree, int); +extern bool function_arg_regno_p (int); + +extern const char *output_load_immediate (rtx *); +extern const char *output_casesi_internal (rtx *); +extern char *bfin_asm_long (void); +extern char *bfin_asm_short (void); +extern int log2constp (unsigned HOST_WIDE_INT); + +extern rtx legitimize_address (rtx, rtx, Mmode); +extern int hard_regno_mode_ok (int, Mmode); +extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx); +extern int bfin_frame_pointer_required (void); +extern HOST_WIDE_INT bfin_initial_elimination_offset (int, int); + +extern int effective_address_32bit_p (rtx, Mmode); +extern int symbolic_reference_mentioned_p (rtx); +extern rtx bfin_gen_compare (rtx, Mmode); +extern void expand_move (rtx *, Mmode); +extern void bfin_expand_call (rtx, rtx, rtx, int); +extern bool bfin_expand_strmov (rtx, rtx, rtx, rtx); + +extern void conditional_register_usage (void); +extern int bfin_register_move_cost (enum machine_mode, enum reg_class, + enum reg_class); +extern int bfin_memory_move_cost (enum machine_mode, enum reg_class, int in); +extern enum reg_class secondary_input_reload_class (enum reg_class, Mmode, + rtx); +extern enum reg_class secondary_output_reload_class (enum reg_class, Mmode, + rtx); +extern char *section_asm_op_1 (SECT_ENUM_T); +extern char *section_asm_op (SECT_ENUM_T); +extern void override_options (void); +extern void print_operand (FILE *, rtx, char); +extern void print_address_operand (FILE *, rtx); +extern void split_di (rtx [], int, rtx [], rtx []); +extern int split_load_immediate (rtx []); +extern rtx legitimize_pic_address (rtx, rtx); +extern void emit_pic_move (rtx *, Mmode); +extern void override_options (void); +extern void asm_conditional_branch (rtx, rtx *, int, int); +extern rtx bfin_gen_compare (rtx, Mmode); + +extern int bfin_return_in_memory (tree); +extern void initialize_trampoline (rtx, rtx, rtx); +extern bool bfin_legitimate_address_p (Mmode, rtx, int); +extern rtx bfin_va_arg (tree, tree); + +extern void bfin_expand_prologue (void); +extern void bfin_expand_epilogue (int, int); +extern int push_multiple_operation (rtx, Mmode); +extern int pop_multiple_operation (rtx, Mmode); +extern void output_push_multiple (rtx, rtx *); +extern void output_pop_multiple (rtx, rtx *); +extern int bfin_hard_regno_rename_ok (unsigned int, unsigned int); +extern rtx bfin_return_addr_rtx (int); +#undef Mmode + +#endif + diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c new file mode 100644 index 00000000000..653c2003104 --- /dev/null +++ b/gcc/config/bfin/bfin.c @@ -0,0 +1,2748 @@ +/* The Blackfin code generation auxiliary output file. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Analog Devices. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "real.h" +#include "insn-config.h" +#include "conditions.h" +#include "insn-flags.h" +#include "output.h" +#include "insn-attr.h" +#include "tree.h" +#include "flags.h" +#include "except.h" +#include "function.h" +#include "input.h" +#include "target.h" +#include "target-def.h" +#include "expr.h" +#include "toplev.h" +#include "recog.h" +#include "ggc.h" +#include "integrate.h" +#include "bfin-protos.h" +#include "tm-preds.h" +#include "gt-bfin.h" + +/* Test and compare insns in bfin.md store the information needed to + generate branch and scc insns here. */ +rtx bfin_compare_op0, bfin_compare_op1; + +/* RTX for condition code flag register and RETS register */ +extern GTY(()) rtx bfin_cc_rtx; +extern GTY(()) rtx bfin_rets_rtx; +rtx bfin_cc_rtx, bfin_rets_rtx; + +int max_arg_registers = 0; + +/* Arrays used when emitting register names. */ +const char *short_reg_names[] = SHORT_REGISTER_NAMES; +const char *high_reg_names[] = HIGH_REGISTER_NAMES; +const char *dregs_pair_names[] = DREGS_PAIR_NAMES; +const char *byte_reg_names[] = BYTE_REGISTER_NAMES; + +static int arg_regs[] = FUNCTION_ARG_REGISTERS; + +/* The value passed to -mshared-library-id=. */ +static int bfin_library_id; +/* Nonzero if -mshared-library-id was given. */ +static int bfin_lib_id_given; + +static void +bfin_globalize_label (FILE *stream, const char *name) +{ + fputs (".global ", stream); + assemble_name (stream, name); + fputc (';',stream); + fputc ('\n',stream); +} + +static void +output_file_start (void) +{ + FILE *file = asm_out_file; + int i; + + fprintf (file, ".file \"%s\";\n", input_filename); + + for (i = 0; arg_regs[i] >= 0; i++) + ; + max_arg_registers = i; /* how many arg reg used */ +} + +/* Called early in the compilation to conditionally modify + fixed_regs/call_used_regs. */ + +void +conditional_register_usage (void) +{ + /* initialize condition code flag register rtx */ + bfin_cc_rtx = gen_rtx_REG (BImode, REG_CC); + bfin_rets_rtx = gen_rtx_REG (Pmode, REG_RETS); +} + +/* Examine machine-dependent attributes of function type FUNTYPE and return its + type. See the definition of E_FUNKIND. */ + +static e_funkind funkind (tree funtype) +{ + tree attrs = TYPE_ATTRIBUTES (funtype); + if (lookup_attribute ("interrupt_handler", attrs)) + return INTERRUPT_HANDLER; + else if (lookup_attribute ("exception_handler", attrs)) + return EXCPT_HANDLER; + else if (lookup_attribute ("nmi_handler", attrs)) + return NMI_HANDLER; + else + return SUBROUTINE; +} + +/* Stack frame layout. */ + +/* Compute the number of DREGS to save with a push_multiple operation. + This could include registers that aren't modified in the function, + since push_multiple only takes a range of registers. */ + +static int +n_dregs_to_save (void) +{ + unsigned i; + + for (i = REG_R0; i <= REG_R7; i++) + { + if (regs_ever_live[i] && ! call_used_regs[i]) + return REG_R7 - i + 1; + + if (current_function_calls_eh_return) + { + unsigned j; + for (j = 0; ; j++) + { + unsigned test = EH_RETURN_DATA_REGNO (j); + if (test == INVALID_REGNUM) + break; + if (test == i) + return REG_R7 - i + 1; + } + } + + } + return 0; +} + +/* Like n_dregs_to_save, but compute number of PREGS to save. */ + +static int +n_pregs_to_save (void) +{ + unsigned i; + + for (i = REG_P0; i <= REG_P5; i++) + if ((regs_ever_live[i] && ! call_used_regs[i]) + || (i == PIC_OFFSET_TABLE_REGNUM + && (current_function_uses_pic_offset_table + || (TARGET_ID_SHARED_LIBRARY && ! current_function_is_leaf)))) + return REG_P5 - i + 1; + return 0; +} + +/* Determine if we are going to save the frame pointer in the prologue. */ + +static bool +must_save_fp_p (void) +{ + return (frame_pointer_needed || regs_ever_live[REG_FP]); +} + +static bool +stack_frame_needed_p (void) +{ + /* EH return puts a new return address into the frame using an + address relative to the frame pointer. */ + if (current_function_calls_eh_return) + return true; + return frame_pointer_needed; +} + +/* Emit code to save registers in the prologue. SAVEALL is nonzero if we + must save all registers; this is used for interrupt handlers. + SPREG contains (reg:SI REG_SP). */ + +static void +expand_prologue_reg_save (rtx spreg, int saveall) +{ + int ndregs = saveall ? 8 : n_dregs_to_save (); + int npregs = saveall ? 6 : n_pregs_to_save (); + int dregno = REG_R7 + 1 - ndregs; + int pregno = REG_P5 + 1 - npregs; + int total = ndregs + npregs; + int i; + rtx pat, insn, val; + + if (total == 0) + return; + + val = GEN_INT (-total * 4); + pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total + 2)); + XVECEXP (pat, 0, 0) = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, val), + UNSPEC_PUSH_MULTIPLE); + XVECEXP (pat, 0, total + 1) = gen_rtx_SET (VOIDmode, spreg, + gen_rtx_PLUS (Pmode, spreg, + val)); + RTX_FRAME_RELATED_P (XVECEXP (pat, 0, total + 1)) = 1; + for (i = 0; i < total; i++) + { + rtx memref = gen_rtx_MEM (word_mode, + gen_rtx_PLUS (Pmode, spreg, + GEN_INT (- i * 4 - 4))); + rtx subpat; + if (ndregs > 0) + { + subpat = gen_rtx_SET (VOIDmode, memref, gen_rtx_REG (word_mode, + dregno++)); + ndregs--; + } + else + { + subpat = gen_rtx_SET (VOIDmode, memref, gen_rtx_REG (word_mode, + pregno++)); + npregs++; + } + XVECEXP (pat, 0, i + 1) = subpat; + RTX_FRAME_RELATED_P (subpat) = 1; + } + insn = emit_insn (pat); + RTX_FRAME_RELATED_P (insn) = 1; +} + +/* Emit code to restore registers in the epilogue. SAVEALL is nonzero if we + must save all registers; this is used for interrupt handlers. + SPREG contains (reg:SI REG_SP). */ + +static void +expand_epilogue_reg_restore (rtx spreg, int saveall) +{ + int ndregs = saveall ? 8 : n_dregs_to_save (); + int npregs = saveall ? 6 : n_pregs_to_save (); + int total = ndregs + npregs; + int i, regno; + rtx pat, insn; + + if (total == 0) + return; + + pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (total + 1)); + XVECEXP (pat, 0, 0) = gen_rtx_SET (VOIDmode, spreg, + gen_rtx_PLUS (Pmode, spreg, + GEN_INT (total * 4))); + + if (npregs > 0) + regno = REG_P5 + 1; + else + regno = REG_R7 + 1; + + for (i = 0; i < total; i++) + { + rtx addr = (i > 0 + ? gen_rtx_PLUS (Pmode, spreg, GEN_INT (i * 4)) + : spreg); + rtx memref = gen_rtx_MEM (word_mode, addr); + + regno--; + XVECEXP (pat, 0, i + 1) + = gen_rtx_SET (VOIDmode, gen_rtx_REG (word_mode, regno), memref); + + if (npregs > 0) + { + if (--npregs == 0) + regno = REG_R7 + 1; + } + } + + insn = emit_insn (pat); + RTX_FRAME_RELATED_P (insn) = 1; +} + +/* Perform any needed actions needed for a function that is receiving a + variable number of arguments. + + CUM is as above. + + MODE and TYPE are the mode and type of the current parameter. + + PRETEND_SIZE is a variable that should be set to the amount of stack + that must be pushed by the prolog to pretend that our caller pushed + it. + + Normally, this macro will push all remaining incoming registers on the + stack and set PRETEND_SIZE to the length of the registers pushed. + + Blackfin specific : + - VDSP C compiler manual (our ABI) says that a variable args function + should save the R0, R1 and R2 registers in the stack. + - The caller will always leave space on the stack for the + arguments that are passed in registers, so we dont have + to leave any extra space. + - now, the vastart pointer can access all arguments from the stack. */ + +static void +setup_incoming_varargs (CUMULATIVE_ARGS *cum, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type ATTRIBUTE_UNUSED, int *pretend_size, + int no_rtl) +{ + rtx mem; + int i; + + if (no_rtl) + return; + + /* The move for named arguments will be generated automatically by the + compiler. We need to generate the move rtx for the unnamed arguments + if they are in the first 3 words. We assume at least 1 named argument + exists, so we never generate [ARGP] = R0 here. */ + + for (i = cum->words + 1; i < max_arg_registers; i++) + { + mem = gen_rtx_MEM (Pmode, + plus_constant (arg_pointer_rtx, (i * UNITS_PER_WORD))); + emit_move_insn (mem, gen_rtx_REG (Pmode, i)); + } + + *pretend_size = 0; +} + +/* Value should be nonzero if functions must have frame pointers. + Zero means the frame pointer need not be set up (and parms may + be accessed via the stack pointer) in functions that seem suitable. */ + +int +bfin_frame_pointer_required (void) +{ + e_funkind fkind = funkind (TREE_TYPE (current_function_decl)); + + if (fkind != SUBROUTINE) + return 1; + + /* We turn on on -fomit-frame-pointer if -momit-leaf-frame-pointer is used, + so we have to override it for non-leaf functions. */ + if (TARGET_OMIT_LEAF_FRAME_POINTER && ! current_function_is_leaf) + return 1; + + return 0; +} + +/* Return the number of registers pushed during the prologue. */ + +static int +n_regs_saved_by_prologue (void) +{ + e_funkind fkind = funkind (TREE_TYPE (current_function_decl)); + int n = n_dregs_to_save () + n_pregs_to_save (); + + if (stack_frame_needed_p ()) + /* We use a LINK instruction in this case. */ + n += 2; + else + { + if (must_save_fp_p ()) + n++; + if (! current_function_is_leaf) + n++; + } + + if (fkind != SUBROUTINE) + { + tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)); + tree all = lookup_attribute ("saveall", attrs); + int i; + + /* Increment once for ASTAT. */ + n++; + + /* RETE/X/N. */ + if (lookup_attribute ("nesting", attrs)) + n++; + + for (i = REG_P7 + 1; i < REG_CC; i++) + if (all + || regs_ever_live[i] + || (!leaf_function_p () && call_used_regs[i])) + n += i == REG_A0 || i == REG_A1 ? 2 : 1; + } + return n; +} + +/* Return the offset between two registers, one to be eliminated, and the other + its replacement, at the start of a routine. */ + +HOST_WIDE_INT +bfin_initial_elimination_offset (int from, int to) +{ + HOST_WIDE_INT offset = 0; + + if (from == ARG_POINTER_REGNUM) + offset = n_regs_saved_by_prologue () * 4; + + if (to == STACK_POINTER_REGNUM) + { + if (current_function_outgoing_args_size >= FIXED_STACK_AREA) + offset += current_function_outgoing_args_size; + else if (current_function_outgoing_args_size) + offset += FIXED_STACK_AREA; + + offset += get_frame_size (); + } + + return offset; +} + +/* Emit code to load a constant CONSTANT into register REG; setting + RTX_FRAME_RELATED_P on all insns we generate. Make sure that the insns + we generate need not be split. */ + +static void +frame_related_constant_load (rtx reg, HOST_WIDE_INT constant) +{ + rtx insn; + rtx cst = GEN_INT (constant); + + if (constant >= -32768 && constant < 65536) + insn = emit_move_insn (reg, cst); + else + { + /* We don't call split_load_immediate here, since dwarf2out.c can get + confused about some of the more clever sequences it can generate. */ + insn = emit_insn (gen_movsi_high (reg, cst)); + RTX_FRAME_RELATED_P (insn) = 1; + insn = emit_insn (gen_movsi_low (reg, reg, cst)); + } + RTX_FRAME_RELATED_P (insn) = 1; +} + +/* Generate efficient code to add a value to the frame pointer. We + can use P1 as a scratch register. Set RTX_FRAME_RELATED_P on the + generated insns if FRAME is nonzero. */ + +static void +add_to_sp (rtx spreg, HOST_WIDE_INT value, int frame) +{ + if (value == 0) + return; + + /* Choose whether to use a sequence using a temporary register, or + a sequence with multiple adds. We can add a signed 7 bit value + in one instruction. */ + if (value > 120 || value < -120) + { + rtx tmpreg = gen_rtx_REG (SImode, REG_P1); + rtx insn; + + if (frame) + frame_related_constant_load (tmpreg, value); + else + { + insn = emit_move_insn (tmpreg, GEN_INT (value)); + if (frame) + RTX_FRAME_RELATED_P (insn) = 1; + } + + insn = emit_insn (gen_addsi3 (spreg, spreg, tmpreg)); + if (frame) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + do + { + int size = value; + rtx insn; + + if (size > 60) + size = 60; + else if (size < -60) + /* We could use -62, but that would leave the stack unaligned, so + it's no good. */ + size = -60; + + insn = emit_insn (gen_addsi3 (spreg, spreg, GEN_INT (size))); + if (frame) + RTX_FRAME_RELATED_P (insn) = 1; + value -= size; + } + while (value != 0); +} + +/* Generate a LINK insn for a frame sized FRAME_SIZE. If this constant + is too large, generate a sequence of insns that has the same effect. + SPREG contains (reg:SI REG_SP). */ + +static void +emit_link_insn (rtx spreg, HOST_WIDE_INT frame_size) +{ + HOST_WIDE_INT link_size = frame_size; + rtx insn; + int i; + + if (link_size > 262140) + link_size = 262140; + + /* Use a LINK insn with as big a constant as possible, then subtract + any remaining size from the SP. */ + insn = emit_insn (gen_link (GEN_INT (-8 - link_size))); + RTX_FRAME_RELATED_P (insn) = 1; + + for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) + { + rtx set = XVECEXP (PATTERN (insn), 0, i); + gcc_assert (GET_CODE (set) == SET); + RTX_FRAME_RELATED_P (set) = 1; + } + + frame_size -= link_size; + + if (frame_size > 0) + { + /* Must use a call-clobbered PREG that isn't the static chain. */ + rtx tmpreg = gen_rtx_REG (Pmode, REG_P1); + + frame_related_constant_load (tmpreg, -frame_size); + insn = emit_insn (gen_addsi3 (spreg, spreg, tmpreg)); + RTX_FRAME_RELATED_P (insn) = 1; + } +} + +/* Return the number of bytes we must reserve for outgoing arguments + in the current function's stack frame. */ + +static HOST_WIDE_INT +arg_area_size (void) +{ + if (current_function_outgoing_args_size) + { + if (current_function_outgoing_args_size >= FIXED_STACK_AREA) + return current_function_outgoing_args_size; + else + return FIXED_STACK_AREA; + } + return 0; +} + +/* Save RETS and FP, and allocate a stack frame. */ + +static void +do_link (rtx spreg, HOST_WIDE_INT frame_size) +{ + frame_size += arg_area_size (); + + if (stack_frame_needed_p () + || (must_save_fp_p () && ! current_function_is_leaf)) + emit_link_insn (spreg, frame_size); + else + { + if (! current_function_is_leaf) + { + rtx pat = gen_movsi (gen_rtx_MEM (Pmode, + gen_rtx_PRE_DEC (Pmode, spreg)), + bfin_rets_rtx); + rtx insn = emit_insn (pat); + RTX_FRAME_RELATED_P (insn) = 1; + } + if (must_save_fp_p ()) + { + rtx pat = gen_movsi (gen_rtx_MEM (Pmode, + gen_rtx_PRE_DEC (Pmode, spreg)), + gen_rtx_REG (Pmode, REG_FP)); + rtx insn = emit_insn (pat); + RTX_FRAME_RELATED_P (insn) = 1; + } + add_to_sp (spreg, -frame_size, 1); + } +} + +/* Like do_link, but used for epilogues to deallocate the stack frame. */ + +static void +do_unlink (rtx spreg, HOST_WIDE_INT frame_size) +{ + frame_size += arg_area_size (); + + if (stack_frame_needed_p ()) + emit_insn (gen_unlink ()); + else + { + rtx postinc = gen_rtx_MEM (Pmode, gen_rtx_POST_INC (Pmode, spreg)); + + add_to_sp (spreg, frame_size, 0); + if (must_save_fp_p ()) + { + rtx fpreg = gen_rtx_REG (Pmode, REG_FP); + emit_move_insn (fpreg, postinc); + emit_insn (gen_rtx_USE (VOIDmode, fpreg)); + } + if (! current_function_is_leaf) + { + emit_move_insn (bfin_rets_rtx, postinc); + emit_insn (gen_rtx_USE (VOIDmode, bfin_rets_rtx)); + } + } +} + +/* Generate a prologue suitable for a function of kind FKIND. This is + called for interrupt and exception handler prologues. + SPREG contains (reg:SI REG_SP). */ + +static void +expand_interrupt_handler_prologue (rtx spreg, e_funkind fkind) +{ + int i; + HOST_WIDE_INT frame_size = get_frame_size (); + rtx predec1 = gen_rtx_PRE_DEC (SImode, spreg); + rtx predec = gen_rtx_MEM (SImode, predec1); + rtx insn; + tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)); + tree all = lookup_attribute ("saveall", attrs); + tree kspisusp = lookup_attribute ("kspisusp", attrs); + + if (kspisusp) + { + insn = emit_move_insn (spreg, gen_rtx_REG (Pmode, REG_USP)); + RTX_FRAME_RELATED_P (insn) = 1; + } + + /* We need space on the stack in case we need to save the argument + registers. */ + if (fkind == EXCPT_HANDLER) + { + insn = emit_insn (gen_addsi3 (spreg, spreg, GEN_INT (-12))); + RTX_FRAME_RELATED_P (insn) = 1; + } + + insn = emit_move_insn (predec, gen_rtx_REG (SImode, REG_ASTAT)); + RTX_FRAME_RELATED_P (insn) = 1; + + expand_prologue_reg_save (spreg, all != NULL_TREE); + + for (i = REG_P7 + 1; i < REG_CC; i++) + if (all + || regs_ever_live[i] + || (!leaf_function_p () && call_used_regs[i])) + { + if (i == REG_A0 || i == REG_A1) + insn = emit_move_insn (gen_rtx_MEM (PDImode, predec1), + gen_rtx_REG (PDImode, i)); + else + insn = emit_move_insn (predec, gen_rtx_REG (SImode, i)); + RTX_FRAME_RELATED_P (insn) = 1; + } + + if (lookup_attribute ("nesting", attrs)) + { + rtx srcreg = gen_rtx_REG (Pmode, (fkind == EXCPT_HANDLER ? REG_RETX + : fkind == NMI_HANDLER ? REG_RETN + : REG_RETI)); + insn = emit_move_insn (predec, srcreg); + RTX_FRAME_RELATED_P (insn) = 1; + } + + do_link (spreg, frame_size); + + if (fkind == EXCPT_HANDLER) + { + rtx r0reg = gen_rtx_REG (SImode, REG_R0); + rtx r1reg = gen_rtx_REG (SImode, REG_R1); + rtx r2reg = gen_rtx_REG (SImode, REG_R2); + rtx insn; + + insn = emit_move_insn (r0reg, gen_rtx_REG (SImode, REG_SEQSTAT)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, + NULL_RTX); + insn = emit_insn (gen_ashrsi3 (r0reg, r0reg, GEN_INT (26))); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, + NULL_RTX); + insn = emit_insn (gen_ashlsi3 (r0reg, r0reg, GEN_INT (26))); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, + NULL_RTX); + insn = emit_move_insn (r1reg, spreg); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, + NULL_RTX); + insn = emit_move_insn (r2reg, gen_rtx_REG (Pmode, REG_FP)); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, + NULL_RTX); + insn = emit_insn (gen_addsi3 (r2reg, r2reg, GEN_INT (8))); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, + NULL_RTX); + } +} + +/* Generate an epilogue suitable for a function of kind FKIND. This is + called for interrupt and exception handler epilogues. + SPREG contains (reg:SI REG_SP). */ + +static void +expand_interrupt_handler_epilogue (rtx spreg, e_funkind fkind) +{ + int i; + rtx postinc1 = gen_rtx_POST_INC (SImode, spreg); + rtx postinc = gen_rtx_MEM (SImode, postinc1); + tree attrs = TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)); + tree all = lookup_attribute ("saveall", attrs); + + /* A slightly crude technique to stop flow from trying to delete "dead" + insns. */ + MEM_VOLATILE_P (postinc) = 1; + + do_unlink (spreg, get_frame_size ()); + + if (lookup_attribute ("nesting", attrs)) + { + rtx srcreg = gen_rtx_REG (Pmode, (fkind == EXCPT_HANDLER ? REG_RETX + : fkind == NMI_HANDLER ? REG_RETN + : REG_RETI)); + emit_move_insn (srcreg, postinc); + } + + for (i = REG_CC - 1; i > REG_P7; i--) + if (all + || regs_ever_live[i] + || (!leaf_function_p () && call_used_regs[i])) + { + if (i == REG_A0 || i == REG_A1) + { + rtx mem = gen_rtx_MEM (PDImode, postinc1); + MEM_VOLATILE_P (mem) = 1; + emit_move_insn (gen_rtx_REG (PDImode, i), mem); + } + else + emit_move_insn (gen_rtx_REG (SImode, i), postinc); + } + + expand_epilogue_reg_restore (spreg, all != NULL_TREE); + + emit_move_insn (gen_rtx_REG (SImode, REG_ASTAT), postinc); + + /* Deallocate any space we left on the stack in case we needed to save the + argument registers. */ + if (fkind == EXCPT_HANDLER) + emit_insn (gen_addsi3 (spreg, spreg, GEN_INT (12))); + + emit_jump_insn (gen_return_internal (GEN_INT (fkind))); +} + +/* Generate RTL for the prologue of the current function. */ + +void +bfin_expand_prologue (void) +{ + rtx insn; + HOST_WIDE_INT frame_size = get_frame_size (); + rtx spreg = gen_rtx_REG (Pmode, REG_SP); + e_funkind fkind = funkind (TREE_TYPE (current_function_decl)); + + if (fkind != SUBROUTINE) + { + expand_interrupt_handler_prologue (spreg, fkind); + return; + } + + expand_prologue_reg_save (spreg, 0); + + do_link (spreg, frame_size); + + if (TARGET_ID_SHARED_LIBRARY + && (current_function_uses_pic_offset_table + || !current_function_is_leaf)) + { + rtx addr; + + if (bfin_lib_id_given) + addr = plus_constant (pic_offset_table_rtx, -4 - bfin_library_id * 4); + else + addr = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, + gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx), + UNSPEC_LIBRARY_OFFSET)); + insn = emit_insn (gen_movsi (pic_offset_table_rtx, + gen_rtx_MEM (Pmode, addr))); + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx, NULL); + } +} + +/* Generate RTL for the epilogue of the current function. NEED_RETURN is zero + if this is for a sibcall. EH_RETURN is nonzero if we're expanding an + eh_return pattern. */ + +void +bfin_expand_epilogue (int need_return, int eh_return) +{ + rtx spreg = gen_rtx_REG (Pmode, REG_SP); + e_funkind fkind = funkind (TREE_TYPE (current_function_decl)); + + if (fkind != SUBROUTINE) + { + expand_interrupt_handler_epilogue (spreg, fkind); + return; + } + + do_unlink (spreg, get_frame_size ()); + + expand_epilogue_reg_restore (spreg, 0); + + /* Omit the return insn if this is for a sibcall. */ + if (! need_return) + return; + + if (eh_return) + emit_insn (gen_addsi3 (spreg, spreg, gen_rtx_REG (Pmode, REG_P2))); + + emit_jump_insn (gen_return_internal (GEN_INT (SUBROUTINE))); +} + +/* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */ + +int +bfin_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED, + unsigned int new_reg) +{ + /* Interrupt functions can only use registers that have already been + saved by the prologue, even if they would normally be + call-clobbered. */ + + if (funkind (TREE_TYPE (current_function_decl)) != SUBROUTINE + && !regs_ever_live[new_reg]) + return 0; + + return 1; +} + +/* Return the value of the return address for the frame COUNT steps up + from the current frame, after the prologue. + We punt for everything but the current frame by returning const0_rtx. */ + +rtx +bfin_return_addr_rtx (int count) +{ + if (count != 0) + return const0_rtx; + + return get_hard_reg_initial_val (Pmode, REG_RETS); +} + +/* Try machine-dependent ways of modifying an illegitimate address X + to be legitimate. If we find one, return the new, valid address, + otherwise return NULL_RTX. + + OLDX is the address as it was before break_out_memory_refs was called. + In some cases it is useful to look at this to decide what needs to be done. + + MODE is the mode of the memory reference. */ + +rtx +legitimize_address (rtx x ATTRIBUTE_UNUSED, rtx oldx ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return NULL_RTX; +} + +/* This predicate is used to compute the length of a load/store insn. + OP is a MEM rtx, we return nonzero if its addressing mode requires a + 32 bit instruction. */ + +int +effective_address_32bit_p (rtx op, enum machine_mode mode) +{ + HOST_WIDE_INT offset; + + mode = GET_MODE (op); + op = XEXP (op, 0); + + if (GET_CODE (op) != PLUS) + { + gcc_assert (REG_P (op) || GET_CODE (op) == POST_INC + || GET_CODE (op) == PRE_DEC || GET_CODE (op) == POST_DEC); + return 0; + } + + offset = INTVAL (XEXP (op, 1)); + + /* All byte loads use a 16 bit offset. */ + if (GET_MODE_SIZE (mode) == 1) + return 1; + + if (GET_MODE_SIZE (mode) == 4) + { + /* Frame pointer relative loads can use a negative offset, all others + are restricted to a small positive one. */ + if (XEXP (op, 0) == frame_pointer_rtx) + return offset < -128 || offset > 60; + return offset < 0 || offset > 60; + } + + /* Must be HImode now. */ + return offset < 0 || offset > 30; +} + +/* Return cost of the memory address ADDR. + All addressing modes are equally cheap on the Blackfin. */ + +static int +bfin_address_cost (rtx addr ATTRIBUTE_UNUSED) +{ + return 1; +} + +/* Subroutine of print_operand; used to print a memory reference X to FILE. */ + +void +print_address_operand (FILE *file, rtx x) +{ + switch (GET_CODE (x)) + { + case PLUS: + output_address (XEXP (x, 0)); + fprintf (file, "+"); + output_address (XEXP (x, 1)); + break; + + case PRE_DEC: + fprintf (file, "--"); + output_address (XEXP (x, 0)); + break; + case POST_INC: + output_address (XEXP (x, 0)); + fprintf (file, "++"); + break; + case POST_DEC: + output_address (XEXP (x, 0)); + fprintf (file, "--"); + break; + + default: + gcc_assert (GET_CODE (x) != MEM); + print_operand (file, x, 0); + break; + } +} + +/* Adding intp DImode support by Tony + * -- Q: (low word) + * -- R: (high word) + */ + +void +print_operand (FILE *file, rtx x, char code) +{ + enum machine_mode mode = GET_MODE (x); + + switch (code) + { + case 'j': + switch (GET_CODE (x)) + { + case EQ: + fprintf (file, "e"); + break; + case NE: + fprintf (file, "ne"); + break; + case GT: + fprintf (file, "g"); + break; + case LT: + fprintf (file, "l"); + break; + case GE: + fprintf (file, "ge"); + break; + case LE: + fprintf (file, "le"); + break; + case GTU: + fprintf (file, "g"); + break; + case LTU: + fprintf (file, "l"); + break; + case GEU: + fprintf (file, "ge"); + break; + case LEU: + fprintf (file, "le"); + break; + default: + output_operand_lossage ("invalid %%j value"); + } + break; + + case 'J': /* reverse logic */ + switch (GET_CODE(x)) + { + case EQ: + fprintf (file, "ne"); + break; + case NE: + fprintf (file, "e"); + break; + case GT: + fprintf (file, "le"); + break; + case LT: + fprintf (file, "ge"); + break; + case GE: + fprintf (file, "l"); + break; + case LE: + fprintf (file, "g"); + break; + case GTU: + fprintf (file, "le"); + break; + case LTU: + fprintf (file, "ge"); + break; + case GEU: + fprintf (file, "l"); + break; + case LEU: + fprintf (file, "g"); + break; + default: + output_operand_lossage ("invalid %%J value"); + } + break; + + default: + switch (GET_CODE (x)) + { + case REG: + if (code == 'h') + { + gcc_assert (REGNO (x) < 32); + fprintf (file, "%s", short_reg_names[REGNO (x)]); + /*fprintf (file, "\n%d\n ", REGNO (x));*/ + break; + } + else if (code == 'd') + { + gcc_assert (REGNO (x) < 32); + fprintf (file, "%s", high_reg_names[REGNO (x)]); + break; + } + else if (code == 'w') + { + gcc_assert (REGNO (x) == REG_A0 || REGNO (x) == REG_A1); + fprintf (file, "%s.w", reg_names[REGNO (x)]); + } + else if (code == 'x') + { + gcc_assert (REGNO (x) == REG_A0 || REGNO (x) == REG_A1); + fprintf (file, "%s.x", reg_names[REGNO (x)]); + } + else if (code == 'D') + { + fprintf (file, "%s", dregs_pair_names[REGNO (x)]); + } + else if (code == 'H') + { + gcc_assert (mode == DImode || mode == DFmode); + gcc_assert (REG_P (x)); + fprintf (file, "%s", reg_names[REGNO (x) + 1]); + } + else if (code == 'T') + { + gcc_assert (D_REGNO_P (REGNO (x))); + fprintf (file, "%s", byte_reg_names[REGNO (x)]); + } + else + fprintf (file, "%s", reg_names[REGNO (x)]); + break; + + case MEM: + fputc ('[', file); + x = XEXP (x,0); + print_address_operand (file, x); + fputc (']', file); + break; + + case CONST_INT: + /* Moves to half registers with d or h modifiers always use unsigned + constants. */ + if (code == 'd') + x = GEN_INT ((INTVAL (x) >> 16) & 0xffff); + else if (code == 'h') + x = GEN_INT (INTVAL (x) & 0xffff); + else if (code == 'X') + x = GEN_INT (exact_log2 (0xffffffff & INTVAL (x))); + else if (code == 'Y') + x = GEN_INT (exact_log2 (0xffffffff & ~INTVAL (x))); + else if (code == 'Z') + /* Used for LINK insns. */ + x = GEN_INT (-8 - INTVAL (x)); + + /* fall through */ + + case SYMBOL_REF: + output_addr_const (file, x); + if (code == 'G' && flag_pic) + fprintf (file, "@GOT"); + break; + + case CONST_DOUBLE: + output_operand_lossage ("invalid const_double operand"); + break; + + case UNSPEC: + switch (XINT (x, 1)) + { + case UNSPEC_MOVE_PIC: + output_addr_const (file, XVECEXP (x, 0, 0)); + fprintf (file, "@GOT"); + break; + + case UNSPEC_LIBRARY_OFFSET: + fprintf (file, "_current_shared_library_p5_offset_"); + break; + + default: + gcc_unreachable (); + } + break; + + default: + output_addr_const (file, x); + } + } +} + +/* Argument support functions. */ + +/* Initialize a variable CUM of type CUMULATIVE_ARGS + for a call to a function whose data type is FNTYPE. + For a library call, FNTYPE is 0. + VDSP C Compiler manual, our ABI says that + first 3 words of arguments will use R0, R1 and R2. +*/ + +void +init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype ATTRIBUTE_UNUSED, + rtx libname ATTRIBUTE_UNUSED) +{ + static CUMULATIVE_ARGS zero_cum; + + *cum = zero_cum; + + /* Set up the number of registers to use for passing arguments. */ + + cum->nregs = max_arg_registers; + cum->arg_regs = arg_regs; + + return; +} + +/* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. + (TYPE is null for libcalls where that information may not be available.) */ + +void +function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, + int named ATTRIBUTE_UNUSED) +{ + int count, bytes, words; + + bytes = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + + cum->words += words; + cum->nregs -= words; + + if (cum->nregs <= 0) + { + cum->nregs = 0; + cum->arg_regs = NULL; + } + else + { + for (count = 1; count <= words; count++) + cum->arg_regs++; + } + + return; +} + +/* Define where to put the arguments to a function. + Value is zero to push the argument on the stack, + or a hard register in which to store the argument. + + MODE is the argument's machine mode. + TYPE is the data type of the argument (as a tree). + This is null for libcalls where that information may + not be available. + CUM is a variable of type CUMULATIVE_ARGS which gives info about + the preceding args and about the function being called. + NAMED is nonzero if this argument is a named parameter + (otherwise it is an extra parameter matching an ellipsis). */ + +struct rtx_def * +function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, + int named ATTRIBUTE_UNUSED) +{ + int bytes + = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + + if (bytes == -1) + return NULL_RTX; + + if (cum->nregs) + return gen_rtx_REG (mode, *(cum->arg_regs)); + + return NULL_RTX; +} + +/* For an arg passed partly in registers and partly in memory, + this is the number of bytes passed in registers. + For args passed entirely in registers or entirely in memory, zero. + + Refer VDSP C Compiler manual, our ABI. + First 3 words are in registers. So, if a an argument is larger + than the registers available, it will span the register and + stack. */ + +static int +bfin_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type ATTRIBUTE_UNUSED, + bool named ATTRIBUTE_UNUSED) +{ + int bytes + = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode); + int bytes_left = cum->nregs * UNITS_PER_WORD; + + if (bytes == -1) + return 0; + + if (bytes_left == 0) + return 0; + if (bytes > bytes_left) + return bytes_left; + return 0; +} + +/* Variable sized types are passed by reference. */ + +static bool +bfin_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, + enum machine_mode mode ATTRIBUTE_UNUSED, + tree type, bool named ATTRIBUTE_UNUSED) +{ + return type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST; +} + +/* Decide whether a type should be returned in memory (true) + or in a register (false). This is called by the macro + RETURN_IN_MEMORY. */ + +int +bfin_return_in_memory (tree type) +{ + int size; + enum machine_mode mode = TYPE_MODE (type); + + if (mode == BLKmode) + return 1; + size = int_size_in_bytes (type); + if (VECTOR_MODE_P (mode) || mode == TImode) + { + /* User-created vectors small enough to fit in REG. */ + if (size < 8) + return 0; + if (size == 8 || size == 16) + return 1; + } + + if (size > 12) + return 1; + return 0; +} + +/* Register in which address to store a structure value + is passed to a function. */ +static rtx +bfin_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, + int incoming ATTRIBUTE_UNUSED) +{ + return gen_rtx_REG (Pmode, REG_P0); +} + +/* Return true when register may be used to pass function parameters. */ + +bool +function_arg_regno_p (int n) +{ + int i; + for (i = 0; arg_regs[i] != -1; i++) + if (n == arg_regs[i]) + return true; + return false; +} + +/* Returns 1 if OP contains a symbol reference */ + +int +symbolic_reference_mentioned_p (rtx op) +{ + register const char *fmt; + register int i; + + if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) + return 1; + + fmt = GET_RTX_FORMAT (GET_CODE (op)); + for (i = GET_RTX_LENGTH (GET_CODE (op)) - 1; i >= 0; i--) + { + if (fmt[i] == 'E') + { + register int j; + + for (j = XVECLEN (op, i) - 1; j >= 0; j--) + if (symbolic_reference_mentioned_p (XVECEXP (op, i, j))) + return 1; + } + + else if (fmt[i] == 'e' && symbolic_reference_mentioned_p (XEXP (op, i))) + return 1; + } + + return 0; +} + +/* Decide whether we can make a sibling call to a function. DECL is the + declaration of the function being targeted by the call and EXP is the + CALL_EXPR representing the call. */ + +static bool +bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED, + tree exp ATTRIBUTE_UNUSED) +{ + return true; +} + +/* Emit RTL insns to initialize the variable parts of a trampoline at + TRAMP. FNADDR is an RTX for the address of the function's pure + code. CXT is an RTX for the static chain value for the function. */ + +void +initialize_trampoline (tramp, fnaddr, cxt) + rtx tramp, fnaddr, cxt; +{ + rtx t1 = copy_to_reg (fnaddr); + rtx t2 = copy_to_reg (cxt); + rtx addr; + + addr = memory_address (Pmode, plus_constant (tramp, 2)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t1)); + emit_insn (gen_ashrsi3 (t1, t1, GEN_INT (16))); + addr = memory_address (Pmode, plus_constant (tramp, 6)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t1)); + + addr = memory_address (Pmode, plus_constant (tramp, 10)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t2)); + emit_insn (gen_ashrsi3 (t2, t2, GEN_INT (16))); + addr = memory_address (Pmode, plus_constant (tramp, 14)); + emit_move_insn (gen_rtx_MEM (HImode, addr), gen_lowpart (HImode, t2)); +} + +/* Legitimize PIC addresses. If the address is already position-independent, + we return ORIG. Newly generated position-independent addresses go into a + reg. This is REG if nonzero, otherwise we allocate register(s) as + necessary. */ + +rtx +legitimize_pic_address (rtx orig, rtx reg) +{ + rtx addr = orig; + rtx new = orig; + + if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF) + { + if (GET_CODE (addr) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (addr)) + reg = new = orig; + else + { + if (reg == 0) + { + gcc_assert (!no_new_pseudos); + reg = gen_reg_rtx (Pmode); + } + + if (flag_pic == 2) + { + emit_insn (gen_movsi_high_pic (reg, addr)); + emit_insn (gen_movsi_low_pic (reg, reg, addr)); + emit_insn (gen_addsi3 (reg, reg, pic_offset_table_rtx)); + new = gen_rtx_MEM (Pmode, reg); + } + else + { + rtx tmp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), + UNSPEC_MOVE_PIC); + new = gen_rtx_MEM (Pmode, + gen_rtx_PLUS (Pmode, pic_offset_table_rtx, + tmp)); + } + emit_move_insn (reg, new); + } + current_function_uses_pic_offset_table = 1; + return reg; + } + + else if (GET_CODE (addr) == CONST || GET_CODE (addr) == PLUS) + { + rtx base; + + if (GET_CODE (addr) == CONST) + { + addr = XEXP (addr, 0); + gcc_assert (GET_CODE (addr) == PLUS); + } + + if (XEXP (addr, 0) == pic_offset_table_rtx) + return orig; + + if (reg == 0) + { + gcc_assert (!no_new_pseudos); + reg = gen_reg_rtx (Pmode); + } + + base = legitimize_pic_address (XEXP (addr, 0), reg); + addr = legitimize_pic_address (XEXP (addr, 1), + base == reg ? NULL_RTX : reg); + + if (GET_CODE (addr) == CONST_INT) + { + gcc_assert (! reload_in_progress && ! reload_completed); + addr = force_reg (Pmode, addr); + } + + if (GET_CODE (addr) == PLUS && CONSTANT_P (XEXP (addr, 1))) + { + base = gen_rtx_PLUS (Pmode, base, XEXP (addr, 0)); + addr = XEXP (addr, 1); + } + + return gen_rtx_PLUS (Pmode, base, addr); + } + + return new; +} + +/* Emit insns to move operands[1] into operands[0]. */ + +void +emit_pic_move (rtx *operands, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode); + + if (GET_CODE (operands[0]) == MEM && SYMBOLIC_CONST (operands[1])) + operands[1] = force_reg (SImode, operands[1]); + else + operands[1] = legitimize_pic_address (operands[1], temp); +} + +/* Expand a move operation in mode MODE. The operands are in OPERANDS. */ + +void +expand_move (rtx *operands, enum machine_mode mode) +{ + if (flag_pic && SYMBOLIC_CONST (operands[1])) + emit_pic_move (operands, mode); + + /* Don't generate memory->memory or constant->memory moves, go through a + register */ + else if ((reload_in_progress | reload_completed) == 0 + && GET_CODE (operands[0]) == MEM + && GET_CODE (operands[1]) != REG) + operands[1] = force_reg (mode, operands[1]); +} + +/* Split one or more DImode RTL references into pairs of SImode + references. The RTL can be REG, offsettable MEM, integer constant, or + CONST_DOUBLE. "operands" is a pointer to an array of DImode RTL to + split and "num" is its length. lo_half and hi_half are output arrays + that parallel "operands". */ + +void +split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[]) +{ + while (num--) + { + rtx op = operands[num]; + + /* simplify_subreg refuse to split volatile memory addresses, + but we still have to handle it. */ + if (GET_CODE (op) == MEM) + { + lo_half[num] = adjust_address (op, SImode, 0); + hi_half[num] = adjust_address (op, SImode, 4); + } + else + { + lo_half[num] = simplify_gen_subreg (SImode, op, + GET_MODE (op) == VOIDmode + ? DImode : GET_MODE (op), 0); + hi_half[num] = simplify_gen_subreg (SImode, op, + GET_MODE (op) == VOIDmode + ? DImode : GET_MODE (op), 4); + } + } +} + +/* Expand a call instruction. FNADDR is the call target, RETVAL the return value. + SIBCALL is nonzero if this is a sibling call. */ + +void +bfin_expand_call (rtx retval, rtx fnaddr, rtx callarg1, int sibcall) +{ + rtx use = NULL, call; + + /* Static functions and indirect calls don't need the pic register. */ + if (flag_pic + && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF + && ! SYMBOL_REF_LOCAL_P (XEXP (fnaddr, 0))) + use_reg (&use, pic_offset_table_rtx); + + if (! call_insn_operand (XEXP (fnaddr, 0), Pmode)) + { + fnaddr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0)); + fnaddr = gen_rtx_MEM (Pmode, fnaddr); + } + call = gen_rtx_CALL (VOIDmode, fnaddr, callarg1); + + if (retval) + call = gen_rtx_SET (VOIDmode, retval, call); + if (sibcall) + { + rtx pat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (2)); + XVECEXP (pat, 0, 0) = call; + XVECEXP (pat, 0, 1) = gen_rtx_RETURN (VOIDmode); + call = pat; + } + call = emit_call_insn (call); + if (use) + CALL_INSN_FUNCTION_USAGE (call) = use; +} + +/* Return 1 if hard register REGNO can hold a value of machine-mode MODE. */ + +int +hard_regno_mode_ok (int regno, enum machine_mode mode) +{ + /* Allow only dregs to store value of mode HI or QI */ + enum reg_class class = REGNO_REG_CLASS (regno); + + if (mode == CCmode) + return 0; + + if (mode == V2HImode) + return D_REGNO_P (regno); + if (class == CCREGS) + return mode == BImode; + if (mode == PDImode) + return regno == REG_A0 || regno == REG_A1; + if (mode == SImode + && TEST_HARD_REG_BIT (reg_class_contents[PROLOGUE_REGS], regno)) + return 1; + + return TEST_HARD_REG_BIT (reg_class_contents[MOST_REGS], regno); +} + +/* Implements target hook vector_mode_supported_p. */ + +static bool +bfin_vector_mode_supported_p (enum machine_mode mode) +{ + return mode == V2HImode; +} + +/* Return the cost of moving data from a register in class CLASS1 to + one in class CLASS2. A cost of 2 is the default. */ + +int +bfin_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class class1, enum reg_class class2) +{ + /* If optimizing for size, always prefer reg-reg over reg-memory moves. */ + if (optimize_size) + return 2; + + /* There are some stalls involved when moving from a DREG to a different + class reg, and using the value in one of the following instructions. + Attempt to model this by slightly discouraging such moves. */ + if (class1 == DREGS && class2 != DREGS) + return 2 * 2; + + return 2; +} + +/* Return the cost of moving data of mode M between a + register and memory. A value of 2 is the default; this cost is + relative to those in `REGISTER_MOVE_COST'. + + ??? In theory L1 memory has single-cycle latency. We should add a switch + that tells the compiler whether we expect to use only L1 memory for the + program; it'll make the costs more accurate. */ + +int +bfin_memory_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class class, + int in ATTRIBUTE_UNUSED) +{ + /* Make memory accesses slightly more expensive than any register-register + move. Also, penalize non-DP registers, since they need secondary + reloads to load and store. */ + if (! reg_class_subset_p (class, DPREGS)) + return 10; + + return 8; +} + +/* Inform reload about cases where moving X with a mode MODE to a register in + CLASS requires an extra scratch register. Return the class needed for the + scratch register. */ + +enum reg_class +secondary_input_reload_class (enum reg_class class, enum machine_mode mode, + rtx x) +{ + /* If we have HImode or QImode, we can only use DREGS as secondary registers; + in most other cases we can also use PREGS. */ + enum reg_class default_class = GET_MODE_SIZE (mode) >= 4 ? DPREGS : DREGS; + enum reg_class x_class = NO_REGS; + enum rtx_code code = GET_CODE (x); + + if (code == SUBREG) + x = SUBREG_REG (x), code = GET_CODE (x); + if (REG_P (x)) + { + int regno = REGNO (x); + if (regno >= FIRST_PSEUDO_REGISTER) + regno = reg_renumber[regno]; + + if (regno == -1) + code = MEM; + else + x_class = REGNO_REG_CLASS (regno); + } + + /* We can be asked to reload (plus (FP) (large_constant)) into a DREG. + This happens as a side effect of register elimination, and we need + a scratch register to do it. */ + if (fp_plus_const_operand (x, mode)) + { + rtx op2 = XEXP (x, 1); + int large_constant_p = ! CONST_7BIT_IMM_P (INTVAL (op2)); + + if (class == PREGS || class == PREGS_CLOBBERED) + return NO_REGS; + /* If destination is a DREG, we can do this without a scratch register + if the constant is valid for an add instruction. */ + if (class == DREGS || class == DPREGS) + return large_constant_p ? PREGS : NO_REGS; + /* Reloading to anything other than a DREG? Use a PREG scratch + register. */ + return PREGS; + } + + /* Data can usually be moved freely between registers of most classes. + AREGS are an exception; they can only move to or from another register + in AREGS or one in DREGS. They can also be assigned the constant 0. */ + if (x_class == AREGS) + return class == DREGS || class == AREGS ? NO_REGS : DREGS; + + if (class == AREGS) + { + if (x != const0_rtx && x_class != DREGS) + return DREGS; + else + return NO_REGS; + } + + /* CCREGS can only be moved from/to DREGS. */ + if (class == CCREGS && x_class != DREGS) + return DREGS; + if (x_class == CCREGS && class != DREGS) + return DREGS; + /* All registers other than AREGS can load arbitrary constants. The only + case that remains is MEM. */ + if (code == MEM) + if (! reg_class_subset_p (class, default_class)) + return default_class; + return NO_REGS; +} + +/* Like secondary_input_reload_class; and all we do is call that function. */ + +enum reg_class +secondary_output_reload_class (enum reg_class class, enum machine_mode mode, + rtx x) +{ + return secondary_input_reload_class (class, mode, x); +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +bfin_handle_option (size_t code, const char *arg, int value) +{ + switch (code) + { + case OPT_mshared_library_id_: + if (value > MAX_LIBRARY_ID) + error ("-mshared-library-id=%s is not between 0 and %d", + arg, MAX_LIBRARY_ID); + else + bfin_library_id = value; + bfin_lib_id_given = 1; + return true; + + default: + return true; + } +} + +/* Implement the macro OVERRIDE_OPTIONS. */ + +void +override_options (void) +{ + if (TARGET_OMIT_LEAF_FRAME_POINTER) + flag_omit_frame_pointer = 1; + + /* Library identification */ + if (bfin_lib_id_given && ! TARGET_ID_SHARED_LIBRARY) + error ("-mshared-library-id= specified without -mid-shared-library"); + + if (TARGET_ID_SHARED_LIBRARY) + /* ??? Provide a way to use a bigger GOT. */ + flag_pic = 1; + + flag_schedule_insns = 0; +} + +/* Return the destination address of BRANCH. + We need to use this instead of get_attr_length, because the + cbranch_with_nops pattern conservatively sets its length to 6, and + we still prefer to use shorter sequences. */ + +static int +branch_dest (rtx branch) +{ + rtx dest; + int dest_uid; + rtx pat = PATTERN (branch); + if (GET_CODE (pat) == PARALLEL) + pat = XVECEXP (pat, 0, 0); + dest = SET_SRC (pat); + if (GET_CODE (dest) == IF_THEN_ELSE) + dest = XEXP (dest, 1); + dest = XEXP (dest, 0); + dest_uid = INSN_UID (dest); + return INSN_ADDRESSES (dest_uid); +} + +/* Return nonzero if INSN is annotated with a REG_BR_PROB note that indicates + it's a branch that's predicted taken. */ + +static int +cbranch_predicted_taken_p (rtx insn) +{ + rtx x = find_reg_note (insn, REG_BR_PROB, 0); + + if (x) + { + int pred_val = INTVAL (XEXP (x, 0)); + + return pred_val >= REG_BR_PROB_BASE / 2; + } + + return 0; +} + +/* Templates for use by asm_conditional_branch. */ + +static const char *ccbranch_templates[][3] = { + { "if !cc jump %3;", "if cc jump 4 (bp); jump.s %3;", "if cc jump 6 (bp); jump.l %3;" }, + { "if cc jump %3;", "if !cc jump 4 (bp); jump.s %3;", "if !cc jump 6 (bp); jump.l %3;" }, + { "if !cc jump %3 (bp);", "if cc jump 4; jump.s %3;", "if cc jump 6; jump.l %3;" }, + { "if cc jump %3 (bp);", "if !cc jump 4; jump.s %3;", "if !cc jump 6; jump.l %3;" }, +}; + +/* Output INSN, which is a conditional branch instruction with operands + OPERANDS. + + We deal with the various forms of conditional branches that can be generated + by bfin_reorg to prevent the hardware from doing speculative loads, by + - emitting a sufficient number of nops, if N_NOPS is nonzero, or + - always emitting the branch as predicted taken, if PREDICT_TAKEN is true. + Either of these is only necessary if the branch is short, otherwise the + template we use ends in an unconditional jump which flushes the pipeline + anyway. */ + +void +asm_conditional_branch (rtx insn, rtx *operands, int n_nops, int predict_taken) +{ + int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn)); + /* Note : offset for instructions like if cc jmp; jump.[sl] offset + is to be taken from start of if cc rather than jump. + Range for jump.s is (-4094, 4096) instead of (-4096, 4094) + */ + int len = (offset >= -1024 && offset <= 1022 ? 0 + : offset >= -4094 && offset <= 4096 ? 1 + : 2); + int bp = predict_taken && len == 0 ? 1 : cbranch_predicted_taken_p (insn); + int idx = (bp << 1) | (GET_CODE (operands[0]) == EQ ? BRF : BRT); + output_asm_insn (ccbranch_templates[idx][len], operands); + gcc_assert (n_nops == 0 || !bp); + if (len == 0) + while (n_nops-- > 0) + output_asm_insn ("nop;", NULL); +} + +/* Emit rtl for a comparison operation CMP in mode MODE. Operands have been + stored in bfin_compare_op0 and bfin_compare_op1 already. */ + +rtx +bfin_gen_compare (rtx cmp, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + enum rtx_code code1, code2; + rtx op0 = bfin_compare_op0, op1 = bfin_compare_op1; + rtx tem = bfin_cc_rtx; + enum rtx_code code = GET_CODE (cmp); + + /* If we have a BImode input, then we already have a compare result, and + do not need to emit another comparison. */ + if (GET_MODE (op0) == BImode) + { + gcc_assert ((code == NE || code == EQ) && op1 == const0_rtx); + tem = op0, code2 = code; + } + else + { + switch (code) { + /* bfin has these conditions */ + case EQ: + case LT: + case LE: + case LEU: + case LTU: + code1 = code; + code2 = NE; + break; + default: + code1 = reverse_condition (code); + code2 = EQ; + break; + } + emit_insn (gen_rtx_SET (BImode, tem, + gen_rtx_fmt_ee (code1, BImode, op0, op1))); + } + + return gen_rtx_fmt_ee (code2, BImode, tem, CONST0_RTX (BImode)); +} + +/* Return nonzero iff C has exactly one bit set if it is interpreted + as a 32 bit constant. */ + +int +log2constp (unsigned HOST_WIDE_INT c) +{ + c &= 0xFFFFFFFF; + return c != 0 && (c & (c-1)) == 0; +} + +/* Returns the number of consecutive least significant zeros in the binary + representation of *V. + We modify *V to contain the original value arithmetically shifted right by + the number of zeroes. */ + +static int +shiftr_zero (HOST_WIDE_INT *v) +{ + unsigned HOST_WIDE_INT tmp = *v; + unsigned HOST_WIDE_INT sgn; + int n = 0; + + if (tmp == 0) + return 0; + + sgn = tmp & ((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)); + while ((tmp & 0x1) == 0 && n <= 32) + { + tmp = (tmp >> 1) | sgn; + n++; + } + *v = tmp; + return n; +} + +/* After reload, split the load of an immediate constant. OPERANDS are the + operands of the movsi_insn pattern which we are splitting. We return + nonzero if we emitted a sequence to load the constant, zero if we emitted + nothing because we want to use the splitter's default sequence. */ + +int +split_load_immediate (rtx operands[]) +{ + HOST_WIDE_INT val = INTVAL (operands[1]); + HOST_WIDE_INT tmp; + HOST_WIDE_INT shifted = val; + HOST_WIDE_INT shifted_compl = ~val; + int num_zero = shiftr_zero (&shifted); + int num_compl_zero = shiftr_zero (&shifted_compl); + unsigned int regno = REGNO (operands[0]); + enum reg_class class1 = REGNO_REG_CLASS (regno); + + /* This case takes care of single-bit set/clear constants, which we could + also implement with BITSET/BITCLR. */ + if (num_zero + && shifted >= -32768 && shifted < 65536 + && (D_REGNO_P (regno) + || (regno >= REG_P0 && regno <= REG_P7 && num_zero <= 2))) + { + emit_insn (gen_movsi (operands[0], GEN_INT (shifted))); + emit_insn (gen_ashlsi3 (operands[0], operands[0], GEN_INT (num_zero))); + return 1; + } + + tmp = val & 0xFFFF; + tmp |= -(tmp & 0x8000); + + /* If high word has one bit set or clear, try to use a bit operation. */ + if (D_REGNO_P (regno)) + { + if (log2constp (val & 0xFFFF0000)) + { + emit_insn (gen_movsi (operands[0], GEN_INT (val & 0xFFFF))); + emit_insn (gen_iorsi3 (operands[0], operands[0], GEN_INT (val & 0xFFFF0000))); + return 1; + } + else if (log2constp (val | 0xFFFF) && (val & 0x8000) != 0) + { + emit_insn (gen_movsi (operands[0], GEN_INT (tmp))); + emit_insn (gen_andsi3 (operands[0], operands[0], GEN_INT (val | 0xFFFF))); + } + } + + if (D_REGNO_P (regno)) + { + if (CONST_7BIT_IMM_P (tmp)) + { + emit_insn (gen_movsi (operands[0], GEN_INT (tmp))); + emit_insn (gen_movstricthi_high (operands[0], GEN_INT (val & -65536))); + return 1; + } + + if ((val & 0xFFFF0000) == 0) + { + emit_insn (gen_movsi (operands[0], const0_rtx)); + emit_insn (gen_movsi_low (operands[0], operands[0], operands[1])); + return 1; + } + + if ((val & 0xFFFF0000) == 0xFFFF0000) + { + emit_insn (gen_movsi (operands[0], constm1_rtx)); + emit_insn (gen_movsi_low (operands[0], operands[0], operands[1])); + return 1; + } + } + + /* Need DREGs for the remaining case. */ + if (regno > REG_R7) + return 0; + + if (optimize_size + && num_compl_zero && CONST_7BIT_IMM_P (shifted_compl)) + { + /* If optimizing for size, generate a sequence that has more instructions + but is shorter. */ + emit_insn (gen_movsi (operands[0], GEN_INT (shifted_compl))); + emit_insn (gen_ashlsi3 (operands[0], operands[0], + GEN_INT (num_compl_zero))); + emit_insn (gen_one_cmplsi2 (operands[0], operands[0])); + return 1; + } + return 0; +} + +/* Return true if the legitimate memory address for a memory operand of mode + MODE. Return false if not. */ + +static bool +bfin_valid_add (enum machine_mode mode, HOST_WIDE_INT value) +{ + unsigned HOST_WIDE_INT v = value > 0 ? value : -value; + int sz = GET_MODE_SIZE (mode); + int shift = sz == 1 ? 0 : sz == 2 ? 1 : 2; + /* The usual offsettable_memref machinery doesn't work so well for this + port, so we deal with the problem here. */ + unsigned HOST_WIDE_INT mask = sz == 8 ? 0x7ffe : 0x7fff; + return (v & ~(mask << shift)) == 0; +} + +static bool +bfin_valid_reg_p (unsigned int regno, int strict) +{ + return ((strict && REGNO_OK_FOR_BASE_STRICT_P (regno)) + || (!strict && REGNO_OK_FOR_BASE_NONSTRICT_P (regno))); +} + +bool +bfin_legitimate_address_p (enum machine_mode mode, rtx x, int strict) +{ + switch (GET_CODE (x)) { + case REG: + if (bfin_valid_reg_p (REGNO (x), strict)) + return true; + break; + case PLUS: + if (REG_P (XEXP (x, 0)) + && bfin_valid_reg_p (REGNO (XEXP (x, 0)), strict) + && (GET_CODE (XEXP (x, 1)) == UNSPEC + || (GET_CODE (XEXP (x, 1)) == CONST_INT + && bfin_valid_add (mode, INTVAL (XEXP (x, 1)))))) + return true; + break; + case POST_INC: + case POST_DEC: + if (LEGITIMATE_MODE_FOR_AUTOINC_P (mode) + && REG_P (XEXP (x, 0)) + && bfin_valid_reg_p (REGNO (XEXP (x, 0)), strict)) + return true; + case PRE_DEC: + if (LEGITIMATE_MODE_FOR_AUTOINC_P (mode) + && XEXP (x, 0) == stack_pointer_rtx + && REG_P (XEXP (x, 0)) + && bfin_valid_reg_p (REGNO (XEXP (x, 0)), strict)) + return true; + break; + default: + break; + } + return false; +} + +static bool +bfin_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + int cost2 = COSTS_N_INSNS (1); + + switch (code) + { + case CONST_INT: + if (outer_code == SET || outer_code == PLUS) + *total = CONST_7BIT_IMM_P (INTVAL (x)) ? 0 : cost2; + else if (outer_code == AND) + *total = log2constp (~INTVAL (x)) ? 0 : cost2; + else if (outer_code == LE || outer_code == LT || outer_code == EQ) + *total = (INTVAL (x) >= -4 && INTVAL (x) <= 3) ? 0 : cost2; + else if (outer_code == LEU || outer_code == LTU) + *total = (INTVAL (x) >= 0 && INTVAL (x) <= 7) ? 0 : cost2; + else if (outer_code == MULT) + *total = (INTVAL (x) == 2 || INTVAL (x) == 4) ? 0 : cost2; + else if (outer_code == ASHIFT && (INTVAL (x) == 1 || INTVAL (x) == 2)) + *total = 0; + else if (outer_code == ASHIFT || outer_code == ASHIFTRT + || outer_code == LSHIFTRT) + *total = (INTVAL (x) >= 0 && INTVAL (x) <= 31) ? 0 : cost2; + else if (outer_code == IOR || outer_code == XOR) + *total = (INTVAL (x) & (INTVAL (x) - 1)) == 0 ? 0 : cost2; + else + *total = cost2; + return true; + + case CONST: + case LABEL_REF: + case SYMBOL_REF: + case CONST_DOUBLE: + *total = COSTS_N_INSNS (2); + return true; + + case PLUS: + if (GET_MODE (x) == Pmode) + { + if (GET_CODE (XEXP (x, 0)) == MULT + && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) + { + HOST_WIDE_INT val = INTVAL (XEXP (XEXP (x, 0), 1)); + if (val == 2 || val == 4) + { + *total = cost2; + *total += rtx_cost (XEXP (XEXP (x, 0), 0), outer_code); + *total += rtx_cost (XEXP (x, 1), outer_code); + return true; + } + } + } + + /* fall through */ + + case MINUS: + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + if (GET_MODE (x) == DImode) + *total = 6 * cost2; + return false; + + case AND: + case IOR: + case XOR: + if (GET_MODE (x) == DImode) + *total = 2 * cost2; + return false; + + case MULT: + if (GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD) + *total = COSTS_N_INSNS (3); + return false; + + default: + return false; + } +} + +static void +bfin_internal_label (FILE *stream, const char *prefix, unsigned long num) +{ + fprintf (stream, "%s%s$%ld:\n", LOCAL_LABEL_PREFIX, prefix, num); +} + +/* Used for communication between {push,pop}_multiple_operation (which + we use not only as a predicate) and the corresponding output functions. */ +static int first_preg_to_save, first_dreg_to_save; + +int +push_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + int lastdreg = 8, lastpreg = 6; + int i, group; + + first_preg_to_save = lastpreg; + first_dreg_to_save = lastdreg; + for (i = 1, group = 0; i < XVECLEN (op, 0) - 1; i++) + { + rtx t = XVECEXP (op, 0, i); + rtx src, dest; + int regno; + + if (GET_CODE (t) != SET) + return 0; + + src = SET_SRC (t); + dest = SET_DEST (t); + if (GET_CODE (dest) != MEM || ! REG_P (src)) + return 0; + dest = XEXP (dest, 0); + if (GET_CODE (dest) != PLUS + || ! REG_P (XEXP (dest, 0)) + || REGNO (XEXP (dest, 0)) != REG_SP + || GET_CODE (XEXP (dest, 1)) != CONST_INT + || INTVAL (XEXP (dest, 1)) != -i * 4) + return 0; + + regno = REGNO (src); + if (group == 0) + { + if (D_REGNO_P (regno)) + { + group = 1; + first_dreg_to_save = lastdreg = regno - REG_R0; + } + else if (regno >= REG_P0 && regno <= REG_P7) + { + group = 2; + first_preg_to_save = lastpreg = regno - REG_P0; + } + else + return 0; + + continue; + } + + if (group == 1) + { + if (regno >= REG_P0 && regno <= REG_P7) + { + group = 2; + first_preg_to_save = lastpreg = regno - REG_P0; + } + else if (regno != REG_R0 + lastdreg + 1) + return 0; + else + lastdreg++; + } + else if (group == 2) + { + if (regno != REG_P0 + lastpreg + 1) + return 0; + lastpreg++; + } + } + return 1; +} + +int +pop_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + int lastdreg = 8, lastpreg = 6; + int i, group; + + for (i = 1, group = 0; i < XVECLEN (op, 0); i++) + { + rtx t = XVECEXP (op, 0, i); + rtx src, dest; + int regno; + + if (GET_CODE (t) != SET) + return 0; + + src = SET_SRC (t); + dest = SET_DEST (t); + if (GET_CODE (src) != MEM || ! REG_P (dest)) + return 0; + src = XEXP (src, 0); + + if (i == 1) + { + if (! REG_P (src) || REGNO (src) != REG_SP) + return 0; + } + else if (GET_CODE (src) != PLUS + || ! REG_P (XEXP (src, 0)) + || REGNO (XEXP (src, 0)) != REG_SP + || GET_CODE (XEXP (src, 1)) != CONST_INT + || INTVAL (XEXP (src, 1)) != (i - 1) * 4) + return 0; + + regno = REGNO (dest); + if (group == 0) + { + if (regno == REG_R7) + { + group = 1; + lastdreg = 7; + } + else if (regno != REG_P0 + lastpreg - 1) + return 0; + else + lastpreg--; + } + else if (group == 1) + { + if (regno != REG_R0 + lastdreg - 1) + return 0; + else + lastdreg--; + } + } + first_dreg_to_save = lastdreg; + first_preg_to_save = lastpreg; + return 1; +} + +/* Emit assembly code for one multi-register push described by INSN, with + operands in OPERANDS. */ + +void +output_push_multiple (rtx insn, rtx *operands) +{ + char buf[80]; + int ok; + + /* Validate the insn again, and compute first_[dp]reg_to_save. */ + ok = push_multiple_operation (PATTERN (insn), VOIDmode); + gcc_assert (ok); + + if (first_dreg_to_save == 8) + sprintf (buf, "[--sp] = ( p5:%d );\n", first_preg_to_save); + else if (first_preg_to_save == 6) + sprintf (buf, "[--sp] = ( r7:%d );\n", first_dreg_to_save); + else + sprintf (buf, "[--sp] = ( r7:%d, p5:%d );\n", + first_dreg_to_save, first_preg_to_save); + + output_asm_insn (buf, operands); +} + +/* Emit assembly code for one multi-register pop described by INSN, with + operands in OPERANDS. */ + +void +output_pop_multiple (rtx insn, rtx *operands) +{ + char buf[80]; + int ok; + + /* Validate the insn again, and compute first_[dp]reg_to_save. */ + ok = pop_multiple_operation (PATTERN (insn), VOIDmode); + gcc_assert (ok); + + if (first_dreg_to_save == 8) + sprintf (buf, "( p5:%d ) = [sp++];\n", first_preg_to_save); + else if (first_preg_to_save == 6) + sprintf (buf, "( r7:%d ) = [sp++];\n", first_dreg_to_save); + else + sprintf (buf, "( r7:%d, p5:%d ) = [sp++];\n", + first_dreg_to_save, first_preg_to_save); + + output_asm_insn (buf, operands); +} + +/* Adjust DST and SRC by OFFSET bytes, and generate one move in mode MODE. */ + +static void +single_move_for_strmov (rtx dst, rtx src, enum machine_mode mode, HOST_WIDE_INT offset) +{ + rtx scratch = gen_reg_rtx (mode); + rtx srcmem, dstmem; + + srcmem = adjust_address_nv (src, mode, offset); + dstmem = adjust_address_nv (dst, mode, offset); + emit_move_insn (scratch, srcmem); + emit_move_insn (dstmem, scratch); +} + +/* Expand a string move operation of COUNT_EXP bytes from SRC to DST, with + alignment ALIGN_EXP. Return true if successful, false if we should fall + back on a different method. */ + +bool +bfin_expand_strmov (rtx dst, rtx src, rtx count_exp, rtx align_exp) +{ + rtx srcreg, destreg, countreg; + HOST_WIDE_INT align = 0; + unsigned HOST_WIDE_INT count = 0; + + if (GET_CODE (align_exp) == CONST_INT) + align = INTVAL (align_exp); + if (GET_CODE (count_exp) == CONST_INT) + { + count = INTVAL (count_exp); +#if 0 + if (!TARGET_INLINE_ALL_STRINGOPS && count > 64) + return false; +#endif + } + + /* If optimizing for size, only do single copies inline. */ + if (optimize_size) + { + if (count == 2 && align < 2) + return false; + if (count == 4 && align < 4) + return false; + if (count != 1 && count != 2 && count != 4) + return false; + } + if (align < 2 && count != 1) + return false; + + destreg = copy_to_mode_reg (Pmode, XEXP (dst, 0)); + if (destreg != XEXP (dst, 0)) + dst = replace_equiv_address_nv (dst, destreg); + srcreg = copy_to_mode_reg (Pmode, XEXP (src, 0)); + if (srcreg != XEXP (src, 0)) + src = replace_equiv_address_nv (src, srcreg); + + if (count != 0 && align >= 2) + { + unsigned HOST_WIDE_INT offset = 0; + + if (align >= 4) + { + if ((count & ~3) == 4) + { + single_move_for_strmov (dst, src, SImode, offset); + offset = 4; + } + else if (count & ~3) + { + HOST_WIDE_INT new_count = ((count >> 2) & 0x3fffffff) - 1; + countreg = copy_to_mode_reg (Pmode, GEN_INT (new_count)); + + emit_insn (gen_rep_movsi (destreg, srcreg, countreg, destreg, srcreg)); + } + } + else + { + if ((count & ~1) == 2) + { + single_move_for_strmov (dst, src, HImode, offset); + offset = 2; + } + else if (count & ~1) + { + HOST_WIDE_INT new_count = ((count >> 1) & 0x7fffffff) - 1; + countreg = copy_to_mode_reg (Pmode, GEN_INT (new_count)); + + emit_insn (gen_rep_movhi (destreg, srcreg, countreg, destreg, srcreg)); + } + } + if (count & 2) + { + single_move_for_strmov (dst, src, HImode, offset); + offset += 2; + } + if (count & 1) + { + single_move_for_strmov (dst, src, QImode, offset); + } + return true; + } + return false; +} + + +static int +bfin_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) +{ + enum attr_type insn_type, dep_insn_type; + int dep_insn_code_number; + + /* Anti and output dependencies have zero cost. */ + if (REG_NOTE_KIND (link) != 0) + return 0; + + dep_insn_code_number = recog_memoized (dep_insn); + + /* If we can't recognize the insns, we can't really do anything. */ + if (dep_insn_code_number < 0 || recog_memoized (insn) < 0) + return cost; + + insn_type = get_attr_type (insn); + dep_insn_type = get_attr_type (dep_insn); + + if (dep_insn_type == TYPE_MOVE || dep_insn_type == TYPE_MCLD) + { + rtx pat = PATTERN (dep_insn); + rtx dest = SET_DEST (pat); + rtx src = SET_SRC (pat); + if (! ADDRESS_REGNO_P (REGNO (dest)) || ! D_REGNO_P (REGNO (src))) + return cost; + return cost + (dep_insn_type == TYPE_MOVE ? 4 : 3); + } + + return cost; +} + +/* We use the machine specific reorg pass for emitting CSYNC instructions + after conditional branches as needed. + + The Blackfin is unusual in that a code sequence like + if cc jump label + r0 = (p0) + may speculatively perform the load even if the condition isn't true. This + happens for a branch that is predicted not taken, because the pipeline + isn't flushed or stalled, so the early stages of the following instructions, + which perform the memory reference, are allowed to execute before the + jump condition is evaluated. + Therefore, we must insert additional instructions in all places where this + could lead to incorrect behaviour. The manual recommends CSYNC, while + VDSP seems to use NOPs (even though its corresponding compiler option is + named CSYNC). + + When optimizing for speed, we emit NOPs, which seems faster than a CSYNC. + When optimizing for size, we turn the branch into a predicted taken one. + This may be slower due to mispredicts, but saves code size. */ + +static void +bfin_reorg (void) +{ + rtx insn, last_condjump = NULL_RTX; + int cycles_since_jump = INT_MAX; + + if (! TARGET_CSYNC) + return; + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + rtx pat; + + if (NOTE_P (insn) || BARRIER_P (insn) || LABEL_P (insn)) + continue; + + pat = PATTERN (insn); + if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER + || GET_CODE (pat) == ASM_INPUT || GET_CODE (pat) == ADDR_VEC + || GET_CODE (pat) == ADDR_DIFF_VEC || asm_noperands (pat) >= 0) + continue; + + if (JUMP_P (insn)) + { + if (any_condjump_p (insn) + && ! cbranch_predicted_taken_p (insn)) + { + last_condjump = insn; + cycles_since_jump = 0; + } + else + cycles_since_jump = INT_MAX; + } + else if (INSN_P (insn)) + { + enum attr_type type = get_attr_type (insn); + if (cycles_since_jump < INT_MAX) + cycles_since_jump++; + + if (type == TYPE_MCLD && cycles_since_jump < 3) + { + rtx pat; + + pat = single_set (insn); + if (may_trap_p (SET_SRC (pat))) + { + int num_clobbers; + rtx *op = recog_data.operand; + + extract_insn (last_condjump); + if (optimize_size) + pat = gen_cbranch_predicted_taken (op[0], op[1], op[2], + op[3]); + else + pat = gen_cbranch_with_nops (op[0], op[1], op[2], op[3], + GEN_INT (3 - cycles_since_jump)); + PATTERN (last_condjump) = pat; + INSN_CODE (last_condjump) = recog (pat, insn, &num_clobbers); + cycles_since_jump = INT_MAX; + } + } + } + } +} + +/* Handle interrupt_handler, exception_handler and nmi_handler function + attributes; arguments as in struct attribute_spec.handler. */ + +static tree +handle_int_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + tree x = *node; + if (TREE_CODE (x) == FUNCTION_DECL) + x = TREE_TYPE (x); + + if (TREE_CODE (x) != FUNCTION_TYPE) + { + warning (0, "%qs attribute only applies to functions", + IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + else if (funkind (x) != SUBROUTINE) + error ("multiple function type attributes specified"); + + return NULL_TREE; +} + +/* Return 0 if the attributes for two types are incompatible, 1 if they + are compatible, and 2 if they are nearly compatible (which causes a + warning to be generated). */ + +static int +bfin_comp_type_attributes (tree type1, tree type2) +{ + e_funkind kind1, kind2; + + if (TREE_CODE (type1) != FUNCTION_TYPE) + return 1; + + kind1 = funkind (type1); + kind2 = funkind (type2); + + if (kind1 != kind2) + return 0; + + /* Check for mismatched modifiers */ + if (!lookup_attribute ("nesting", TYPE_ATTRIBUTES (type1)) + != !lookup_attribute ("nesting", TYPE_ATTRIBUTES (type2))) + return 0; + + if (!lookup_attribute ("saveall", TYPE_ATTRIBUTES (type1)) + != !lookup_attribute ("saveall", TYPE_ATTRIBUTES (type2))) + return 0; + + if (!lookup_attribute ("kspisusp", TYPE_ATTRIBUTES (type1)) + != !lookup_attribute ("kspisusp", TYPE_ATTRIBUTES (type2))) + return 0; + + return 1; +} + +/* Table of valid machine attributes. */ +const struct attribute_spec bfin_attribute_table[] = +{ + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ + { "interrupt_handler", 0, 0, false, true, true, handle_int_attribute }, + { "exception_handler", 0, 0, false, true, true, handle_int_attribute }, + { "nmi_handler", 0, 0, false, true, true, handle_int_attribute }, + { "nesting", 0, 0, false, true, true, NULL }, + { "kspisusp", 0, 0, false, true, true, NULL }, + { "saveall", 0, 0, false, true, true, NULL }, + { NULL, 0, 0, false, false, false, NULL } +}; + +/* Output the assembler code for a thunk function. THUNK_DECL is the + declaration for the thunk function itself, FUNCTION is the decl for + the target function. DELTA is an immediate constant offset to be + added to THIS. If VCALL_OFFSET is nonzero, the word at + *(*this + vcall_offset) should be added to THIS. */ + +static void +bfin_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED, + tree thunk ATTRIBUTE_UNUSED, HOST_WIDE_INT delta, + HOST_WIDE_INT vcall_offset, tree function) +{ + rtx xops[3]; + /* The this parameter is passed as the first argument. */ + rtx this = gen_rtx_REG (Pmode, REG_R0); + + /* Adjust the this parameter by a fixed constant. */ + if (delta) + { + xops[1] = this; + if (delta >= -64 && delta <= 63) + { + xops[0] = GEN_INT (delta); + output_asm_insn ("%1 += %0;", xops); + } + else if (delta >= -128 && delta < -64) + { + xops[0] = GEN_INT (delta + 64); + output_asm_insn ("%1 += -64; %1 += %0;", xops); + } + else if (delta > 63 && delta <= 126) + { + xops[0] = GEN_INT (delta - 63); + output_asm_insn ("%1 += 63; %1 += %0;", xops); + } + else + { + xops[0] = GEN_INT (delta); + output_asm_insn ("r3.l = %h0; r3.h = %d0; %1 = %1 + r3;", xops); + } + } + + /* Adjust the this parameter by a value stored in the vtable. */ + if (vcall_offset) + { + rtx p2tmp = gen_rtx_REG (Pmode, REG_P2); + rtx tmp = gen_rtx_REG (Pmode, REG_R2); + + xops[1] = tmp; + xops[2] = p2tmp; + output_asm_insn ("%2 = r0; %2 = [%2];", xops); + + /* Adjust the this parameter. */ + xops[0] = gen_rtx_MEM (Pmode, plus_constant (p2tmp, vcall_offset)); + if (!memory_operand (xops[0], Pmode)) + { + rtx tmp2 = gen_rtx_REG (Pmode, REG_P1); + xops[0] = GEN_INT (vcall_offset); + xops[1] = tmp2; + output_asm_insn ("%h1 = %h0; %d1 = %d0; %2 = %2 + %1", xops); + xops[0] = gen_rtx_MEM (Pmode, p2tmp); + } + xops[2] = this; + output_asm_insn ("%1 = %0; %2 = %2 + %1;", xops); + } + + xops[0] = XEXP (DECL_RTL (function), 0); + if (1 || !flag_pic || (*targetm.binds_local_p) (function)) + output_asm_insn ("jump.l\t%P0", xops); +} + +#undef TARGET_ASM_GLOBALIZE_LABEL +#define TARGET_ASM_GLOBALIZE_LABEL bfin_globalize_label + +#undef TARGET_ASM_FILE_START +#define TARGET_ASM_FILE_START output_file_start + +#undef TARGET_ATTRIBUTE_TABLE +#define TARGET_ATTRIBUTE_TABLE bfin_attribute_table + +#undef TARGET_COMP_TYPE_ATTRIBUTES +#define TARGET_COMP_TYPE_ATTRIBUTES bfin_comp_type_attributes + +#undef TARGET_RTX_COSTS +#define TARGET_RTX_COSTS bfin_rtx_costs + +#undef TARGET_ADDRESS_COST +#define TARGET_ADDRESS_COST bfin_address_cost + +#undef TARGET_ASM_INTERNAL_LABEL +#define TARGET_ASM_INTERNAL_LABEL bfin_internal_label + +#undef TARGET_MACHINE_DEPENDENT_REORG +#define TARGET_MACHINE_DEPENDENT_REORG bfin_reorg + +#undef TARGET_FUNCTION_OK_FOR_SIBCALL +#define TARGET_FUNCTION_OK_FOR_SIBCALL bfin_function_ok_for_sibcall + +#undef TARGET_ASM_OUTPUT_MI_THUNK +#define TARGET_ASM_OUTPUT_MI_THUNK bfin_output_mi_thunk +#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK +#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true + +#undef TARGET_SCHED_ADJUST_COST +#define TARGET_SCHED_ADJUST_COST bfin_adjust_cost + +#undef TARGET_PROMOTE_PROTOTYPES +#define TARGET_PROMOTE_PROTOTYPES hook_bool_tree_true +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true + +#undef TARGET_ARG_PARTIAL_BYTES +#define TARGET_ARG_PARTIAL_BYTES bfin_arg_partial_bytes + +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE bfin_pass_by_reference + +#undef TARGET_SETUP_INCOMING_VARARGS +#define TARGET_SETUP_INCOMING_VARARGS setup_incoming_varargs + +#undef TARGET_STRUCT_VALUE_RTX +#define TARGET_STRUCT_VALUE_RTX bfin_struct_value_rtx + +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P bfin_vector_mode_supported_p + +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION bfin_handle_option + +struct gcc_target targetm = TARGET_INITIALIZER; diff --git a/gcc/config/bfin/bfin.h b/gcc/config/bfin/bfin.h new file mode 100644 index 00000000000..608188ae882 --- /dev/null +++ b/gcc/config/bfin/bfin.h @@ -0,0 +1,1151 @@ +/* Definitions for the Blackfin port. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Analog Devices. + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BFIN_CONFIG +#define _BFIN_CONFIG + +#define OBJECT_FORMAT_ELF + +#define BRT 1 +#define BRF 0 + +/* Print subsidiary information on the compiler version in use. */ +#define TARGET_VERSION fprintf (stderr, " (BlackFin bfin)") + +/* Run-time compilation parameters selecting different hardware subsets. */ + +extern int target_flags; + +/* Predefinition in the preprocessor for this target machine */ +#ifndef TARGET_CPU_CPP_BUILTINS +#define TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("bfin"); \ + builtin_define ("BFIN"); \ + } \ + while (0) +#endif + +/* Generate DSP instructions, like DSP halfword loads */ +#define TARGET_DSP (1) + +#define TARGET_DEFAULT MASK_CSYNC + +/* Maximum number of library ids we permit */ +#define MAX_LIBRARY_ID 255 + +extern const char *bfin_library_id_string; + +/* Sometimes certain combinations of command options do not make + sense on a particular target machine. You can define a macro + `OVERRIDE_OPTIONS' to take account of this. This macro, if + defined, is executed once just after all the command options have + been parsed. + + Don't use this macro to turn on various extra optimizations for + `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ + +#define OVERRIDE_OPTIONS override_options () + +#define FUNCTION_MODE SImode +#define Pmode SImode + +/* store-condition-codes instructions store 0 for false + This is the value stored for true. */ +#define STORE_FLAG_VALUE 1 + +/* Define this if pushing a word on the stack + makes the stack pointer a smaller address. */ +#define STACK_GROWS_DOWNWARD + +#define STACK_PUSH_CODE PRE_DEC + +/* Define this if the nominal address of the stack frame + is at the high-address end of the local variables; + that is, each additional local variable allocated + goes at a more negative offset in the frame. */ +#define FRAME_GROWS_DOWNWARD + +/* We define a dummy ARGP register; the parameters start at offset 0 from + it. */ +#define FIRST_PARM_OFFSET(DECL) 0 + +/* Offset within stack frame to start allocating local variables at. + If FRAME_GROWS_DOWNWARD, this is the offset to the END of the + first local allocated. Otherwise, it is the offset to the BEGINNING + of the first local allocated. */ +#define STARTING_FRAME_OFFSET 0 + +/* Register to use for pushing function arguments. */ +#define STACK_POINTER_REGNUM REG_P6 + +/* Base register for access to local variables of the function. */ +#define FRAME_POINTER_REGNUM REG_P7 + +/* A dummy register that will be eliminated to either FP or SP. */ +#define ARG_POINTER_REGNUM REG_ARGP + +/* `PIC_OFFSET_TABLE_REGNUM' + The register number of the register used to address a table of + static data addresses in memory. In some cases this register is + defined by a processor's "application binary interface" (ABI). + When this macro is defined, RTL is generated for this register + once, as with the stack pointer and frame pointer registers. If + this macro is not defined, it is up to the machine-dependent files + to allocate such a register (if necessary). */ +#define PIC_OFFSET_TABLE_REGNUM (REG_P5) + +/* A static chain register for nested functions. We need to use a + call-clobbered register for this. */ +#define STATIC_CHAIN_REGNUM REG_P2 + +/* Define this if functions should assume that stack space has been + allocated for arguments even when their values are passed in + registers. + + The value of this macro is the size, in bytes, of the area reserved for + arguments passed in registers. + + This space can either be allocated by the caller or be a part of the + machine-dependent stack frame: `OUTGOING_REG_PARM_STACK_SPACE' + says which. */ +#define FIXED_STACK_AREA 12 +#define REG_PARM_STACK_SPACE(FNDECL) FIXED_STACK_AREA + +/* Define this if the above stack space is to be considered part of the + * space allocated by the caller. */ +#define OUTGOING_REG_PARM_STACK_SPACE + +/* Define this if the maximum size of all the outgoing args is to be + accumulated and pushed during the prologue. The amount can be + found in the variable current_function_outgoing_args_size. */ +#define ACCUMULATE_OUTGOING_ARGS 1 + +/* Value should be nonzero if functions must have frame pointers. + Zero means the frame pointer need not be set up (and parms + may be accessed via the stack pointer) in functions that seem suitable. + This is computed in `reload', in reload1.c. +*/ +#define FRAME_POINTER_REQUIRED (bfin_frame_pointer_required ()) + +#define PARM_BOUNDRY 32 + +#define STACK_BOUNDRY 32 + +/*#define DATA_ALIGNMENT(TYPE, BASIC-ALIGN) for arrays.. */ + +/* Make strings word-aligned so strcpy from constants will be faster. */ +#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ + (TREE_CODE (EXP) == STRING_CST \ + && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) + +#define TRAMPOLINE_SIZE 18 +#define TRAMPOLINE_TEMPLATE(FILE) \ + fprintf(FILE, "\t.dd\t0x0000e109\n"); /* p1.l = fn low */ \ + fprintf(FILE, "\t.dd\t0x0000e149\n"); /* p1.h = fn high */; \ + fprintf(FILE, "\t.dd\t0x0000e10a\n"); /* p2.l = sc low */; \ + fprintf(FILE, "\t.dd\t0x0000e14a\n"); /* p2.h = sc high */; \ + fprintf(FILE, "\t.dw\t0x0051\n"); /* jump (p1)*/ + +#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ + initialize_trampoline (TRAMP, FNADDR, CXT) + +/* Definitions for register eliminations. + + This is an array of structures. Each structure initializes one pair + of eliminable registers. The "from" register number is given first, + followed by "to". Eliminations of the same "from" register are listed + in order of preference. + + There are two registers that can always be eliminated on the i386. + The frame pointer and the arg pointer can be replaced by either the + hard frame pointer or to the stack pointer, depending upon the + circumstances. The hard frame pointer is not used before reload and + so it is not eligible for elimination. */ + +#define ELIMINABLE_REGS \ +{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ + { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ + { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}} \ + +/* Given FROM and TO register numbers, say whether this elimination is + allowed. Frame pointer elimination is automatically handled. + + All other eliminations are valid. */ + +#define CAN_ELIMINATE(FROM, TO) \ + ((TO) == STACK_POINTER_REGNUM ? ! frame_pointer_needed : 1) + +/* Define the offset between two registers, one to be eliminated, and the other + its replacement, at the start of a routine. */ + +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + ((OFFSET) = bfin_initial_elimination_offset ((FROM), (TO))) + +/* This processor has + 8 data register for doing arithmetic + 8 pointer register for doing addressing, including + 1 stack pointer P6 + 1 frame pointer P7 + 4 sets of indexing registers (I0-3, B0-3, L0-3, M0-3) + 1 condition code flag register CC + 5 return address registers RETS/I/X/N/E + 1 arithmetic status register (ASTAT). */ + +#define FIRST_PSEUDO_REGISTER 44 + +#define PREG_P(X) (REG_P (X) && REGNO (X) >= REG_P0 && REGNO (X) <= REG_P7) +#define ADDRESS_REGNO_P(X) ((X) >= REG_P0 && (X) <= REG_M3) +#define D_REGNO_P(X) ((X) <= REG_R7) + +#define REGISTER_NAMES { \ + "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", \ + "P0", "P1", "P2", "P3", "P4", "P5", "SP", "FP", \ + "I0", "B0", "L0", "I1", "B1", "L1", "I2", "B2", \ + "L2", "I3", "B3", "L3", "M0", "M1", "M2", "M3", \ + "A0", "A1", \ + "CC", \ + "RETS", "RETI", "RETX", "RETN", "RETE", "ASTAT", "SEQSTAT", "USP", \ + "ARGP" \ +} + +#define SHORT_REGISTER_NAMES { \ + "R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L", \ + "P0.L", "P1.L", "P2.L", "P3.L", "P4.L", "P5.L", "SP.L", "FP.L", \ + "I0.L", "B0.L", "L0.L", "I1.L", "B1.L", "L1.L", "I2.L", "B2.L", \ + "L2.L", "I3.L", "B3.L", "L3.L", "M0.L", "M1.L", "M2.L", "M3.L", } + +#define HIGH_REGISTER_NAMES { \ + "R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H", \ + "P0.H", "P1.H", "P2.H", "P3.H", "P4.H", "P5.H", "SP.H", "FP.H", \ + "I0.H", "B0.H", "L0.H", "I1.H", "B1.H", "L1.H", "I2.H", "B2.H", \ + "L2.H", "I3.H", "B3.H", "L3.H", "M0.H", "M1.H", "M2.H", "M3.H", } + +#define DREGS_PAIR_NAMES { \ + "R1:0.p", 0, "R3:2.p", 0, "R5:4.p", 0, "R7:6.p", 0, } + +#define BYTE_REGISTER_NAMES { \ + "R0.B", "R1.B", "R2.B", "R3.B", "R4.B", "R5.B", "R6.B", "R7.B", } + + +/* 1 for registers that have pervasive standard uses + and are not available for the register allocator. */ + +#define FIXED_REGISTERS \ +/*r0 r1 r2 r3 r4 r5 r6 r7 p0 p1 p2 p3 p4 p5 p6 p7 */ \ +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, \ +/*i0 b0 l0 i1 b1 l1 i2 b2 l2 i3 b3 l3 m0 m1 m2 m3 */ \ + 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, \ +/*a0 a1 cc rets/i/x/n/e astat seqstat usp argp */ \ + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \ +} + +/* 1 for registers not available across function calls. + These must include the FIXED_REGISTERS and also any + registers that can be used without being saved. + The latter must include the registers where values are returned + and the register where structure-value addresses are passed. + Aside from that, you can include as many other registers as you like. */ + +#define CALL_USED_REGISTERS \ +/*r0 r1 r2 r3 r4 r5 r6 r7 p0 p1 p2 p3 p4 p5 p6 p7 */ \ +{ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, \ +/*i0 b0 l0 i1 b1 l1 i2 b2 l2 i3 b3 l3 m0 m1 m2 m3 */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ +/*a0 a1 cc rets/i/x/n/e astat seqstat usp argp */ \ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \ +} + +/* Order in which to allocate registers. Each register must be + listed once, even those in FIXED_REGISTERS. List frame pointer + late and fixed registers last. Note that, in general, we prefer + registers listed in CALL_USED_REGISTERS, keeping the others + available for storage of persistent values. */ + +#define REG_ALLOC_ORDER \ +{ REG_R0, REG_R1, REG_R2, REG_R3, REG_R7, REG_R6, REG_R5, REG_R4, \ + REG_P2, REG_P1, REG_P0, REG_P5, REG_P4, REG_P3, REG_P6, REG_P7, \ + REG_A0, REG_A1, \ + REG_I0, REG_B0, REG_L0, REG_I1, REG_B1, REG_L1, REG_I2, REG_B2, \ + REG_L2, REG_I3, REG_B3, REG_L3, REG_M0, REG_M1, REG_M2, REG_M3, \ + REG_RETS, REG_RETI, REG_RETX, REG_RETN, REG_RETE, \ + REG_ASTAT, REG_SEQSTAT, REG_USP, \ + REG_CC, REG_ARGP \ +} + +/* Macro to conditionally modify fixed_regs/call_used_regs. */ +#define CONDITIONAL_REGISTER_USAGE \ + { \ + conditional_register_usage(); \ + if (flag_pic) \ + { \ + fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ + call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ + } \ + } + +/* Define the classes of registers for register constraints in the + machine description. Also define ranges of constants. + + One of the classes must always be named ALL_REGS and include all hard regs. + If there is more than one class, another class must be named NO_REGS + and contain no registers. + + The name GENERAL_REGS must be the name of a class (or an alias for + another name such as ALL_REGS). This is the class of registers + that is allowed by "g" or "r" in a register constraint. + Also, registers outside this class are allocated only when + instructions express preferences for them. + + The classes must be numbered in nondecreasing order; that is, + a larger-numbered class must never be contained completely + in a smaller-numbered class. + + For any two classes, it is very desirable that there be another + class that represents their union. */ + + +enum reg_class +{ + NO_REGS, + IREGS, + BREGS, + LREGS, + MREGS, + CIRCREGS, /* Circular buffering registers, Ix, Bx, Lx together form. See Automatic Circular Buffering. */ + DAGREGS, + EVEN_AREGS, + ODD_AREGS, + AREGS, + CCREGS, + EVEN_DREGS, + ODD_DREGS, + DREGS, + PREGS_CLOBBERED, + PREGS, + DPREGS, + MOST_REGS, + PROLOGUE_REGS, + NON_A_CC_REGS, + ALL_REGS, LIM_REG_CLASSES +}; + +#define N_REG_CLASSES ((int)LIM_REG_CLASSES) + +#define GENERAL_REGS DPREGS + +/* Give names of register classes as strings for dump file. */ + +#define REG_CLASS_NAMES \ +{ "NO_REGS", \ + "IREGS", \ + "BREGS", \ + "LREGS", \ + "MREGS", \ + "CIRCREGS", \ + "DAGREGS", \ + "EVEN_AREGS", \ + "ODD_AREGS", \ + "AREGS", \ + "CCREGS", \ + "EVEN_DREGS", \ + "ODD_DREGS", \ + "DREGS", \ + "PREGS_CLOBBERED", \ + "PREGS", \ + "DPREGS", \ + "MOST_REGS", \ + "PROLOGUE_REGS", \ + "NON_A_CC_REGS", \ + "ALL_REGS" } + +/* An initializer containing the contents of the register classes, as integers + which are bit masks. The Nth integer specifies the contents of class N. + The way the integer MASK is interpreted is that register R is in the class + if `MASK & (1 << R)' is 1. + + When the machine has more than 32 registers, an integer does not suffice. + Then the integers are replaced by sub-initializers, braced groupings + containing several integers. Each sub-initializer must be suitable as an + initializer for the type `HARD_REG_SET' which is defined in + `hard-reg-set.h'. */ + +/* NOTE: DSP registers, IREGS - AREGS, are not GENERAL_REGS. We use + MOST_REGS as the union of DPREGS and DAGREGS. */ + +#define REG_CLASS_CONTENTS \ + /* 31 - 0 63-32 */ \ +{ { 0x00000000, 0 }, /* NO_REGS */ \ + { 0x02490000, 0 }, /* IREGS */ \ + { 0x04920000, 0 }, /* BREGS */ \ + { 0x09240000, 0 }, /* LREGS */ \ + { 0xf0000000, 0 }, /* MREGS */ \ + { 0x0fff0000, 0 }, /* CIRCREGS */ \ + { 0xffff0000, 0 }, /* DAGREGS */ \ + { 0x00000000, 0x1 }, /* EVEN_AREGS */ \ + { 0x00000000, 0x2 }, /* ODD_AREGS */ \ + { 0x00000000, 0x3 }, /* AREGS */ \ + { 0x00000000, 0x4 }, /* CCREGS */ \ + { 0x00000055, 0 }, /* EVEN_DREGS */ \ + { 0x000000aa, 0 }, /* ODD_DREGS */ \ + { 0x000000ff, 0 }, /* DREGS */ \ + { 0x00004700, 0x800 }, /* PREGS_CLOBBERED */ \ + { 0x0000ff00, 0x800 }, /* PREGS */ \ + { 0x0000ffff, 0x800 }, /* DPREGS */ \ + { 0xffffffff, 0x800 }, /* MOST_REGS */\ + { 0x00000000, 0x7f8 }, /* PROLOGUE_REGS */\ + { 0xffffffff, 0xff8 }, /* NON_A_CC_REGS */\ + { 0xffffffff, 0xfff }} /* ALL_REGS */ + +#define BASE_REG_CLASS PREGS +#define INDEX_REG_CLASS PREGS + +#define REGNO_OK_FOR_BASE_STRICT_P(X) (REGNO_REG_CLASS (X) == BASE_REG_CLASS) +#define REGNO_OK_FOR_BASE_NONSTRICT_P(X) \ + (((X) >= FIRST_PSEUDO_REGISTER) || REGNO_REG_CLASS (X) == BASE_REG_CLASS) + +#ifdef REG_OK_STRICT +#define REGNO_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_STRICT_P (X) +#else +#define REGNO_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_NONSTRICT_P (X) +#endif + +#define REG_OK_FOR_BASE_P(X) (REG_P (X) && REGNO_OK_FOR_BASE_P (REGNO (X))) +#define REG_OK_FOR_INDEX_P(X) 0 +#define REGNO_OK_FOR_INDEX_P(X) 0 + +/* Get reg_class from a letter such as appears in the machine description. */ + +#define REG_CLASS_FROM_LETTER(LETTER) \ + ((LETTER) == 'a' ? PREGS : \ + (LETTER) == 'd' ? DREGS : \ + (LETTER) == 'z' ? PREGS_CLOBBERED : \ + (LETTER) == 'D' ? EVEN_DREGS : \ + (LETTER) == 'W' ? ODD_DREGS : \ + (LETTER) == 'e' ? AREGS : \ + (LETTER) == 'A' ? EVEN_AREGS : \ + (LETTER) == 'B' ? ODD_AREGS : \ + (LETTER) == 'b' ? IREGS : \ + (LETTER) == 'B' ? BREGS : \ + (LETTER) == 'f' ? MREGS : \ + (LETTER) == 'c' ? CIRCREGS : \ + (LETTER) == 'C' ? CCREGS : \ + (LETTER) == 'x' ? MOST_REGS : \ + (LETTER) == 'y' ? PROLOGUE_REGS : \ + (LETTER) == 'w' ? NON_A_CC_REGS : \ + NO_REGS) + +/* The same information, inverted: + Return the class number of the smallest class containing + reg number REGNO. This could be a conditional expression + or could index an array. */ + +#define REGNO_REG_CLASS(REGNO) \ + ((REGNO) < REG_P0 ? DREGS \ + : (REGNO) < REG_I0 ? PREGS \ + : (REGNO) == REG_ARGP ? BASE_REG_CLASS \ + : (REGNO) >= REG_I0 && (REGNO) <= REG_I3 ? IREGS \ + : (REGNO) >= REG_L0 && (REGNO) <= REG_L3 ? LREGS \ + : (REGNO) >= REG_B0 && (REGNO) <= REG_B3 ? BREGS \ + : (REGNO) >= REG_M0 && (REGNO) <= REG_M3 ? MREGS \ + : (REGNO) == REG_A0 || (REGNO) == REG_A1 ? AREGS \ + : (REGNO) == REG_CC ? CCREGS \ + : (REGNO) >= REG_RETS ? PROLOGUE_REGS \ + : NO_REGS) + +/* When defined, the compiler allows registers explicitly used in the + rtl to be used as spill registers but prevents the compiler from + extending the lifetime of these registers. */ +#define SMALL_REGISTER_CLASSES 1 + +#define CLASS_LIKELY_SPILLED_P(CLASS) \ + ((CLASS) == PREGS_CLOBBERED \ + || (CLASS) == PROLOGUE_REGS \ + || (CLASS) == CCREGS) + +/* Do not allow to store a value in REG_CC for any mode */ +/* Do not allow to store value in pregs if mode is not SI*/ +#define HARD_REGNO_MODE_OK(REGNO, MODE) hard_regno_mode_ok((REGNO), (MODE)) + +/* Return the maximum number of consecutive registers + needed to represent mode MODE in a register of class CLASS. */ +#define CLASS_MAX_NREGS(CLASS, MODE) \ + ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) + +#define HARD_REGNO_NREGS(REGNO, MODE) \ +((MODE) == PDImode && ((REGNO) == REG_A0 || (REGNO) == REG_A1) \ + ? 1 : CLASS_MAX_NREGS (GENERAL_REGS, MODE)) + +/* A C expression that is nonzero if hard register TO can be + considered for use as a rename register for FROM register */ +#define HARD_REGNO_RENAME_OK(FROM, TO) bfin_hard_regno_rename_ok (FROM, TO) + +/* A C expression that is nonzero if it is desirable to choose + register allocation so as to avoid move instructions between a + value of mode MODE1 and a value of mode MODE2. + + If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, + MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, + MODE2)' must be zero. */ +#define MODES_TIEABLE_P(MODE1, MODE2) ((MODE1) == (MODE2)) + +/* `PREFERRED_RELOAD_CLASS (X, CLASS)' + A C expression that places additional restrictions on the register + class to use when it is necessary to copy value X into a register + in class CLASS. The value is a register class; perhaps CLASS, or + perhaps another, smaller class. */ +#define PREFERRED_RELOAD_CLASS(X, CLASS) (CLASS) + +#define SECONDARY_OUTPUT_RELOAD_CLASS(class,mode,x) \ + secondary_output_reload_class(class,mode,x) +#define SECONDARY_INPUT_RELOAD_CLASS(class,mode,x) \ + secondary_input_reload_class(class,mode,x) + +/* Function Calling Conventions. */ + +/* The type of the current function; normal functions are of type + SUBROUTINE. */ +typedef enum { + SUBROUTINE, INTERRUPT_HANDLER, EXCPT_HANDLER, NMI_HANDLER +} e_funkind; + +#define FUNCTION_ARG_REGISTERS { REG_R0, REG_R1, REG_R2, -1 } + +typedef struct { + int words; /* # words passed so far */ + int nregs; /* # registers available for passing */ + int *arg_regs; /* array of register -1 terminated */ +} CUMULATIVE_ARGS; + +/* Define where to put the arguments to a function. + Value is zero to push the argument on the stack, + or a hard register in which to store the argument. + + MODE is the argument's machine mode. + TYPE is the data type of the argument (as a tree). + This is null for libcalls where that information may + not be available. + CUM is a variable of type CUMULATIVE_ARGS which gives info about + the preceding args and about the function being called. + NAMED is nonzero if this argument is a named parameter + (otherwise it is an extra parameter matching an ellipsis). */ + +#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ + (function_arg (&CUM, MODE, TYPE, NAMED)) + +#define FUNCTION_ARG_REGNO_P(REGNO) function_arg_regno_p (REGNO) + + +/* Initialize a variable CUM of type CUMULATIVE_ARGS + for a call to a function whose data type is FNTYPE. + For a library call, FNTYPE is 0. */ +#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT, N_NAMED_ARGS) \ + (init_cumulative_args (&CUM, FNTYPE, LIBNAME)) + +/* Update the data in CUM to advance over an argument + of mode MODE and data type TYPE. + (TYPE is null for libcalls where that information may not be available.) */ +#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ + (function_arg_advance (&CUM, MODE, TYPE, NAMED)) + +#define RETURN_POPS_ARGS(FDECL, FUNTYPE, STKSIZE) 0 + +/* Define how to find the value returned by a function. + VALTYPE is the data type of the value (as a tree). + If the precise function being called is known, FUNC is its FUNCTION_DECL; + otherwise, FUNC is 0. +*/ + +#define VALUE_REGNO(MODE) (REG_R0) + +#define FUNCTION_VALUE(VALTYPE, FUNC) \ + gen_rtx_REG (TYPE_MODE (VALTYPE), \ + VALUE_REGNO(TYPE_MODE(VALTYPE))) + +/* Define how to find the value returned by a library function + assuming the value has mode MODE. */ + +#define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, VALUE_REGNO(MODE)) + +#define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_R0) + +#define DEFAULT_PCC_STRUCT_RETURN 0 +#define RETURN_IN_MEMORY(TYPE) bfin_return_in_memory(TYPE) + +/* Before the prologue, the return address is in the RETS register. */ +#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, REG_RETS) + +#define RETURN_ADDR_RTX(COUNT, FRAME) bfin_return_addr_rtx (COUNT) + +#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (REG_RETS) + +/* Call instructions don't modify the stack pointer on the Blackfin. */ +#define INCOMING_FRAME_SP_OFFSET 0 + +/* Describe how we implement __builtin_eh_return. */ +#define EH_RETURN_DATA_REGNO(N) ((N) < 2 ? (N) : INVALID_REGNUM) +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, REG_P2) +#define EH_RETURN_HANDLER_RTX \ + gen_rtx_MEM (Pmode, plus_constant (frame_pointer_rtx, UNITS_PER_WORD)) + +/* Addressing Modes */ + +/* Recognize any constant value that is a valid address. */ +#define CONSTANT_ADDRESS_P(X) (CONSTANT_P (X)) + +/* Nonzero if the constant value X is a legitimate general operand. + symbol_ref are not legitimate and will be put into constant pool. + See force_const_mem(). + If -mno-pool, all constants are legitimate. + */ +#define LEGITIMATE_CONSTANT_P(x) 1 + +/* A number, the maximum number of registers that can appear in a + valid memory address. Note that it is up to you to specify a + value equal to the maximum number that `GO_IF_LEGITIMATE_ADDRESS' + would ever accept. */ +#define MAX_REGS_PER_ADDRESS 1 + +/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression + that is a valid memory address for an instruction. + The MODE argument is the machine mode for the MEM expression + that wants to use this address. + + Blackfin addressing modes are as follows: + + [preg] + [preg + imm16] + + B [ Preg + uimm15 ] + W [ Preg + uimm16m2 ] + [ Preg + uimm17m4 ] + + [preg++] + [preg--] + [--sp] +*/ + +#define LEGITIMATE_MODE_FOR_AUTOINC_P(MODE) \ + (GET_MODE_SIZE (MODE) <= 4 || (MODE) == PDImode) + +#ifdef REG_OK_STRICT +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \ + do { \ + if (bfin_legitimate_address_p (MODE, X, 1)) \ + goto WIN; \ + } while (0); +#else +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, WIN) \ + do { \ + if (bfin_legitimate_address_p (MODE, X, 0)) \ + goto WIN; \ + } while (0); +#endif + +/* Try machine-dependent ways of modifying an illegitimate address + to be legitimate. If we find one, return the new, valid address. + This macro is used in only one place: `memory_address' in explow.c. + + OLDX is the address as it was before break_out_memory_refs was called. + In some cases it is useful to look at this to decide what needs to be done. + + MODE and WIN are passed so that this macro can use + GO_IF_LEGITIMATE_ADDRESS. + + It is always safe for this macro to do nothing. It exists to recognize + opportunities to optimize the output. + */ +#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ +do { \ + rtx _q = legitimize_address(X, OLDX, MODE); \ + if (_q) { X = _q; goto WIN; } \ +} while (0) + +#define HAVE_POST_INCREMENT 1 +#define HAVE_POST_DECREMENT 1 +#define HAVE_PRE_DECREMENT 1 + +/* `LEGITIMATE_PIC_OPERAND_P (X)' + A C expression that is nonzero if X is a legitimate immediate + operand on the target machine when generating position independent + code. You can assume that X satisfies `CONSTANT_P', so you need + not check this. You can also assume FLAG_PIC is true, so you need + not check it either. You need not define this macro if all + constants (including `SYMBOL_REF') can be immediate operands when + generating position independent code. */ +#define LEGITIMATE_PIC_OPERAND_P(X) ! SYMBOLIC_CONST (X) + +#define SYMBOLIC_CONST(X) \ +(GET_CODE (X) == SYMBOL_REF \ + || GET_CODE (X) == LABEL_REF \ + || (GET_CODE (X) == CONST && symbolic_reference_mentioned_p (X))) + +/* + A C statement or compound statement with a conditional `goto + LABEL;' executed if memory address X (an RTX) can have different + meanings depending on the machine mode of the memory reference it + is used for or if the address is valid for some modes but not + others. + + Autoincrement and autodecrement addresses typically have + mode-dependent effects because the amount of the increment or + decrement is the size of the operand being addressed. Some + machines have other mode-dependent addresses. Many RISC machines + have no mode-dependent addresses. + + You may assume that ADDR is a valid address for the machine. +*/ +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ +do { \ + if (GET_CODE (ADDR) == POST_INC \ + || GET_CODE (ADDR) == POST_DEC \ + || GET_CODE (ADDR) == PRE_DEC) \ + goto LABEL; \ +} while (0) + +#define NOTICE_UPDATE_CC(EXPR, INSN) 0 + +/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits + is done just by pretending it is already truncated. */ +#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 + +/* Max number of bytes we can move from memory to memory + in one reasonably fast instruction. */ +#define MOVE_MAX UNITS_PER_WORD + + +/* STORAGE LAYOUT: target machine storage layout + Define this macro as a C expression which is nonzero if accessing + less than a word of memory (i.e. a `char' or a `short') is no + faster than accessing a word of memory, i.e., if such access + require more than one instruction or if there is no difference in + cost between byte and (aligned) word loads. + + When this macro is not defined, the compiler will access a field by + finding the smallest containing object; when it is defined, a + fullword load will be used if alignment permits. Unless bytes + accesses are faster than word accesses, using word accesses is + preferable since it may eliminate subsequent memory access if + subsequent accesses occur to other fields in the same word of the + structure, but to different bytes. */ +#define SLOW_BYTE_ACCESS 0 +#define SLOW_SHORT_ACCESS 0 + +/* Define this if most significant bit is lowest numbered + in instructions that operate on numbered bit-fields. */ +#define BITS_BIG_ENDIAN 0 + +/* Define this if most significant byte of a word is the lowest numbered. + We can't access bytes but if we could we would in the Big Endian order. */ +#define BYTES_BIG_ENDIAN 0 + +/* Define this if most significant word of a multiword number is numbered. */ +#define WORDS_BIG_ENDIAN 0 + +/* number of bits in an addressable storage unit */ +#define BITS_PER_UNIT 8 + +/* Width in bits of a "word", which is the contents of a machine register. + Note that this is not necessarily the width of data type `int'; + if using 16-bit ints on a 68000, this would still be 32. + But on a machine with 16-bit registers, this would be 16. */ +#define BITS_PER_WORD 32 + +/* Width of a word, in units (bytes). */ +#define UNITS_PER_WORD 4 + +/* Width in bits of a pointer. + See also the macro `Pmode1' defined below. */ +#define POINTER_SIZE 32 + +/* Allocation boundary (in *bits*) for storing pointers in memory. */ +#define POINTER_BOUNDARY 32 + +/* Allocation boundary (in *bits*) for storing arguments in argument list. */ +#define PARM_BOUNDARY 32 + +/* Boundary (in *bits*) on which stack pointer should be aligned. */ +#define STACK_BOUNDARY 32 + +/* Allocation boundary (in *bits*) for the code of a function. */ +#define FUNCTION_BOUNDARY 32 + +/* Alignment of field after `int : 0' in a structure. */ +#define EMPTY_FIELD_BOUNDARY BITS_PER_WORD + +/* No data type wants to be aligned rounder than this. */ +#define BIGGEST_ALIGNMENT 32 + +/* Define this if move instructions will actually fail to work + when given unaligned data. */ +#define STRICT_ALIGNMENT 1 + +/* (shell-command "rm c-decl.o stor-layout.o") + * never define PCC_BITFIELD_TYPE_MATTERS + * really cause some alignment problem + */ + +#define UNITS_PER_FLOAT ((FLOAT_TYPE_SIZE + BITS_PER_UNIT - 1) / \ + BITS_PER_UNIT) + +#define UNITS_PER_DOUBLE ((DOUBLE_TYPE_SIZE + BITS_PER_UNIT - 1) / \ + BITS_PER_UNIT) + + +/* what is the 'type' of size_t */ +#define SIZE_TYPE "long unsigned int" + +/* Define this as 1 if `char' should by default be signed; else as 0. */ +#define DEFAULT_SIGNED_CHAR 1 +#define FLOAT_TYPE_SIZE BITS_PER_WORD +#define SHORT_TYPE_SIZE 16 +#define CHAR_TYPE_SIZE 8 +#define INT_TYPE_SIZE 32 +#define LONG_TYPE_SIZE 32 +#define LONG_LONG_TYPE_SIZE 64 + +/* Note: Fix this to depend on target switch. -- lev */ + +/* Note: Try to implement double and force long double. -- tonyko + * #define __DOUBLES_ARE_FLOATS__ + * #define DOUBLE_TYPE_SIZE FLOAT_TYPE_SIZE + * #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE + * #define DOUBLES_ARE_FLOATS 1 + */ + +#define DOUBLE_TYPE_SIZE 64 +#define LONG_DOUBLE_TYPE_SIZE 64 + +/* `PROMOTE_MODE (M, UNSIGNEDP, TYPE)' + A macro to update M and UNSIGNEDP when an object whose type is + TYPE and which has the specified mode and signedness is to be + stored in a register. This macro is only called when TYPE is a + scalar type. + + On most RISC machines, which only have operations that operate on + a full register, define this macro to set M to `word_mode' if M is + an integer mode narrower than `BITS_PER_WORD'. In most cases, + only integer modes should be widened because wider-precision + floating-point operations are usually more expensive than their + narrower counterparts. + + For most machines, the macro definition does not change UNSIGNEDP. + However, some machines, have instructions that preferentially + handle either signed or unsigned quantities of certain modes. For + example, on the DEC Alpha, 32-bit loads from memory and 32-bit add + instructions sign-extend the result to 64 bits. On such machines, + set UNSIGNEDP according to which kind of extension is more + efficient. + + Do not define this macro if it would never modify M.*/ + +#define BFIN_PROMOTE_MODE_P(MODE) \ + (!TARGET_DSP && GET_MODE_CLASS (MODE) == MODE_INT \ + && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) + +#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ + if (BFIN_PROMOTE_MODE_P(MODE)) \ + { \ + if (MODE == QImode) \ + UNSIGNEDP = 1; \ + else if (MODE == HImode) \ + UNSIGNEDP = 0; \ + (MODE) = SImode; \ + } + +/* Describing Relative Costs of Operations */ + +/* Do not put function addr into constant pool */ +#define NO_FUNCTION_CSE 1 + +/* A C expression for the cost of moving data from a register in class FROM to + one in class TO. The classes are expressed using the enumeration values + such as `GENERAL_REGS'. A value of 2 is the default; other values are + interpreted relative to that. + + It is not required that the cost always equal 2 when FROM is the same as TO; + on some machines it is expensive to move between registers if they are not + general registers. */ + +#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ + bfin_register_move_cost ((MODE), (CLASS1), (CLASS2)) + +/* A C expression for the cost of moving data of mode M between a + register and memory. A value of 2 is the default; this cost is + relative to those in `REGISTER_MOVE_COST'. + + If moving between registers and memory is more expensive than + between two registers, you should define this macro to express the + relative cost. */ + +#define MEMORY_MOVE_COST(MODE, CLASS, IN) \ + bfin_memory_move_cost ((MODE), (CLASS), (IN)) + +/* Specify the machine mode that this machine uses + for the index in the tablejump instruction. */ +#define CASE_VECTOR_MODE SImode + +#define JUMP_TABLES_IN_TEXT_SECTION flag_pic + +/* Define if operations between registers always perform the operation + on the full register even if a narrower mode is specified. +#define WORD_REGISTER_OPERATIONS +*/ + +#define CONST_18UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 262140) +#define CONST_16BIT_IMM_P(VALUE) ((VALUE) >= -32768 && (VALUE) <= 32767) +#define CONST_16UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 65535) +#define CONST_7BIT_IMM_P(VALUE) ((VALUE) >= -64 && (VALUE) <= 63) +#define CONST_7NBIT_IMM_P(VALUE) ((VALUE) >= -64 && (VALUE) <= 0) +#define CONST_5UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 31) +#define CONST_4BIT_IMM_P(VALUE) ((VALUE) >= -8 && (VALUE) <= 7) +#define CONST_4UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 15) +#define CONST_3BIT_IMM_P(VALUE) ((VALUE) >= -4 && (VALUE) <= 3) +#define CONST_3UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 7) + +#define CONSTRAINT_LEN(C, STR) \ + ((C) == 'P' || (C) == 'M' || (C) == 'N' ? 2 \ + : (C) == 'K' ? 3 \ + : DEFAULT_CONSTRAINT_LEN ((C), (STR))) + +#define CONST_OK_FOR_P(VALUE, STR) \ + ((STR)[1] == '0' ? (VALUE) == 0 \ + : (STR)[1] == '1' ? (VALUE) == 1 \ + : (STR)[1] == '2' ? (VALUE) == 2 \ + : (STR)[1] == '3' ? (VALUE) == 3 \ + : (STR)[1] == '4' ? (VALUE) == 4 \ + : 0) + +#define CONST_OK_FOR_K(VALUE, STR) \ + ((STR)[1] == 'u' \ + ? ((STR)[2] == '3' ? CONST_3UBIT_IMM_P (VALUE) \ + : (STR)[2] == '4' ? CONST_4UBIT_IMM_P (VALUE) \ + : (STR)[2] == '5' ? CONST_5UBIT_IMM_P (VALUE) \ + : (STR)[2] == 'h' ? CONST_16UBIT_IMM_P (VALUE) \ + : 0) \ + : (STR)[1] == 's' \ + ? ((STR)[2] == '3' ? CONST_3BIT_IMM_P (VALUE) \ + : (STR)[2] == '4' ? CONST_4BIT_IMM_P (VALUE) \ + : (STR)[2] == '7' ? CONST_7BIT_IMM_P (VALUE) \ + : (STR)[2] == 'h' ? CONST_16BIT_IMM_P (VALUE) \ + : 0) \ + : (STR)[1] == 'n' \ + ? ((STR)[2] == '7' ? CONST_7NBIT_IMM_P (VALUE) \ + : 0) \ + : 0) + +#define CONST_OK_FOR_M(VALUE, STR) \ + ((STR)[1] == '1' ? (VALUE) == 255 \ + : (STR)[1] == '2' ? (VALUE) == 65535 \ + : 0) + +/* The letters I, J, K, L and M in a register constraint string + can be used to stand for particular ranges of immediate operands. + This macro defines what the ranges are. + C is the letter, and VALUE is a constant value. + Return 1 if VALUE is in the range specified by C. + + bfin constant operands are as follows + + J 2**N 5bit imm scaled + Ks7 -64 .. 63 signed 7bit imm + Ku5 0..31 unsigned 5bit imm + Ks4 -8 .. 7 signed 4bit imm + Ks3 -4 .. 3 signed 3bit imm + Ku3 0 .. 7 unsigned 3bit imm + Pn 0, 1, 2 constants 0, 1 or 2, corresponding to n +*/ +#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \ + ((C) == 'J' ? (log2constp (VALUE)) \ + : (C) == 'K' ? CONST_OK_FOR_K (VALUE, STR) \ + : (C) == 'L' ? log2constp (~(VALUE)) \ + : (C) == 'M' ? CONST_OK_FOR_M (VALUE, STR) \ + : (C) == 'P' ? CONST_OK_FOR_P (VALUE, STR) \ + : 0) + + /*Constant Output Formats */ +#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ + ((C) == 'H' ? 1 : 0) + +#define EXTRA_CONSTRAINT(VALUE, D) \ + ((D) == 'Q' ? GET_CODE (VALUE) == SYMBOL_REF : 0) + +/* `FINALIZE_PIC' + By generating position-independent code, when two different + programs (A and B) share a common library (libC.a), the text of + the library can be shared whether or not the library is linked at + the same address for both programs. In some of these + environments, position-independent code requires not only the use + of different addressing modes, but also special code to enable the + use of these addressing modes. + + The `FINALIZE_PIC' macro serves as a hook to emit these special + codes once the function is being compiled into assembly code, but + not before. (It is not done before, because in the case of + compiling an inline function, it would lead to multiple PIC + prologues being included in functions which used inline functions + and were compiled to assembly language.) */ +#define FINALIZE_PIC do {} while (0) + +/* Switch into a generic section. */ +#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section + +#define PRINT_OPERAND(FILE, RTX, CODE) print_operand (FILE, RTX, CODE) +#define PRINT_OPERAND_ADDRESS(FILE, RTX) print_address_operand (FILE, RTX) + +typedef enum sections { + CODE_DIR, + DATA_DIR, + LAST_SECT_NM +} SECT_ENUM_T; + +typedef enum directives { + LONG_CONST_DIR, + SHORT_CONST_DIR, + BYTE_CONST_DIR, + SPACE_DIR, + INIT_DIR, + LAST_DIR_NM +} DIR_ENUM_T; + +#define TEXT_SECTION_ASM_OP ".text;" +#define DATA_SECTION_ASM_OP ".data;" + +#define ASM_APP_ON "" +#define ASM_APP_OFF "" + +#define ASM_GLOBALIZE_LABEL1(FILE, NAME) \ + do { fputs (".global ", FILE); \ + assemble_name (FILE, NAME); \ + fputc (';',FILE); \ + fputc ('\n',FILE); \ + } while (0) + +#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ + do { \ + fputs (".type ", FILE); \ + assemble_name (FILE, NAME); \ + fputs (", STT_FUNC", FILE); \ + fputc (';',FILE); \ + fputc ('\n',FILE); \ + ASM_OUTPUT_LABEL(FILE, NAME); \ + } while (0) + +#define ASM_OUTPUT_LABEL(FILE, NAME) \ + do { assemble_name (FILE, NAME); \ + fputs (":\n",FILE); \ + } while (0) + +#define ASM_OUTPUT_LABELREF(FILE,NAME) \ + do { fprintf (FILE, "_%s", NAME); \ + } while (0) + +#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ + do { \ + int len = strlen (NAME); \ + char *temp = (char *) alloca (len + 4); \ + temp[0] = 'L'; \ + temp[1] = '_'; \ + strcpy (&temp[2], (NAME)); \ + temp[len + 2] = '_'; \ + temp[len + 3] = 0; \ + (OUTPUT) = (char *) alloca (strlen (NAME) + 13); \ + sprintf (OUTPUT, "_%s$%d", temp, LABELNO); \ + } while (0) + +#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \ +do { char __buf[256]; \ + fprintf (FILE, "\t.dd\t"); \ + ASM_GENERATE_INTERNAL_LABEL (__buf, "L", VALUE); \ + assemble_name (FILE, __buf); \ + fputc (';', FILE); \ + fputc ('\n', FILE); \ + } while (0) + +#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ + MY_ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) + +#define MY_ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ + do { \ + char __buf[256]; \ + fprintf (FILE, "\t.dd\t"); \ + ASM_GENERATE_INTERNAL_LABEL (__buf, "L", VALUE); \ + assemble_name (FILE, __buf); \ + fputs (" - ", FILE); \ + ASM_GENERATE_INTERNAL_LABEL (__buf, "L", REL); \ + assemble_name (FILE, __buf); \ + fputc (';', FILE); \ + fputc ('\n', FILE); \ + } while (0) + +#define ASM_OUTPUT_ALIGN(FILE,LOG) \ + do { \ + fprintf (FILE, ".align %d\n", LOG); \ + } while (0) + +#define ASM_OUTPUT_SKIP(FILE,SIZE) \ + do { \ + asm_output_skip (FILE, SIZE); \ + } while (0) + +#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ +do { \ + data_section(); \ + if ((SIZE) >= (unsigned int) 4 ) ASM_OUTPUT_ALIGN(FILE,2); \ + ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE); \ + ASM_OUTPUT_LABEL (FILE, NAME); \ + fprintf (FILE, "%s %ld;\n", ASM_SPACE, \ + (ROUNDED) > (unsigned int) 1 ? (ROUNDED) : 1); \ +} while (0) + +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ + do { \ + ASM_GLOBALIZE_LABEL1(FILE,NAME); \ + ASM_OUTPUT_LOCAL (FILE, NAME, SIZE, ROUNDED); } while(0) + +#define ASM_COMMENT_START "//" + +#define FUNCTION_PROFILER(FILE, LABELNO) \ + do {\ + fprintf (FILE, "\tP1.l =LP$%d; P1.h =LP$%d; call mcount;\n", \ + LABELNO, LABELNO);\ + } while(0) + +#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) fprintf (FILE, "[SP--] = %s;\n", reg_names[REGNO]) +#define ASM_OUTPUT_REG_POP(FILE, REGNO) fprintf (FILE, "%s = [SP++];\n", reg_names[REGNO]) + +extern struct rtx_def *bfin_compare_op0, *bfin_compare_op1; +extern struct rtx_def *bfin_cc_rtx, *bfin_rets_rtx; + +/* This works for GAS and some other assemblers. */ +#define SET_ASM_OP ".set " + +/* Don't know how to order these. UNALIGNED_WORD_ASM_OP is in + dwarf2.out. */ +#define UNALIGNED_WORD_ASM_OP ".4byte" + +/* DBX register number for a given compiler register number */ +#define DBX_REGISTER_NUMBER(REGNO) (REGNO) + +#define SIZE_ASM_OP "\t.size\t" + +#endif /* _BFIN_CONFIG */ diff --git a/gcc/config/bfin/bfin.md b/gcc/config/bfin/bfin.md new file mode 100644 index 00000000000..986e649e3ca --- /dev/null +++ b/gcc/config/bfin/bfin.md @@ -0,0 +1,1896 @@ +;;- Machine description for Blackfin for GNU compiler +;; Copyright 2005 Free Software Foundation, Inc. +;; Contributed by Analog Devices. + +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published +;; by the Free Software Foundation; either version 2, or (at your +;; option) any later version. + +;; GCC is distributed in the hope that it will be useful, but WITHOUT +;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +;; License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING. If not, write to +;; the Free Software Foundation, 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +; operand punctuation marks: +; +; X -- integer value printed as log2 +; Y -- integer value printed as log2(~value) - for bitclear +; h -- print half word register, low part +; d -- print half word register, high part +; D -- print operand as dregs pairs +; w -- print operand as accumulator register word (a0w, a1w) +; H -- high part of double mode operand +; T -- byte register representation Oct. 02 2001 + +; constant operand classes +; +; J 2**N 5bit imm scaled +; Ks7 -64 .. 63 signed 7bit imm +; Ku5 0..31 unsigned 5bit imm +; Ks4 -8 .. 7 signed 4bit imm +; Ks3 -4 .. 3 signed 3bit imm +; Ku3 0 .. 7 unsigned 3bit imm +; Pn 0, 1, 2 constants 0, 1 or 2, corresponding to n +; +; register operands +; d (r0..r7) +; a (p0..p5,fp,sp) +; e (a0, a1) +; b (i0..i3) +; f (m0..m3) +; B +; c (i0..i3,m0..m3) CIRCREGS +; C (CC) CCREGS +; + +;; Define constants for hard registers. + +(define_constants + [(REG_R0 0) + (REG_R1 1) + (REG_R2 2) + (REG_R3 3) + (REG_R4 4) + (REG_R5 5) + (REG_R6 6) + (REG_R7 7) + + (REG_P0 8) + (REG_P1 9) + (REG_P2 10) + (REG_P3 11) + (REG_P4 12) + (REG_P5 13) + (REG_P6 14) + (REG_P7 15) + + (REG_SP 14) + (REG_FP 15) + + (REG_I0 16) + (REG_B0 17) + (REG_L0 18) + (REG_I1 19) + (REG_B1 20) + (REG_L1 21) + (REG_I2 22) + (REG_B2 23) + (REG_L2 24) + (REG_I3 25) + (REG_B3 26) + (REG_L3 27) + + (REG_M0 28) + (REG_M1 29) + (REG_M2 30) + (REG_M3 31) + + (REG_A0 32) + (REG_A1 33) + + (REG_CC 34) + (REG_RETS 35) + (REG_RETI 36) + (REG_RETX 37) + (REG_RETN 38) + (REG_RETE 39) + + (REG_ASTAT 40) + (REG_SEQSTAT 41) + (REG_USP 42) + + (REG_ARGP 43)]) + +;; Constants used in UNSPECs and UNSPEC_VOLATILEs. + +(define_constants + [(UNSPEC_CBRANCH_TAKEN 0) + (UNSPEC_CBRANCH_NOPS 1) + (UNSPEC_RETURN 2) + (UNSPEC_MOVE_PIC 3) + (UNSPEC_LIBRARY_OFFSET 4) + (UNSPEC_PUSH_MULTIPLE 5)]) + +(define_constants + [(UNSPEC_VOLATILE_EH_RETURN 0)]) + +(define_attr "type" + "move,mvi,mcld,mcst,dsp32,mult,alu0,shft,brcc,br,call,misc,compare,dummy" + (const_string "misc")) + +;; Scheduling definitions + +(define_automaton "bfin") + +(define_cpu_unit "core" "bfin") + +(define_insn_reservation "alu" 1 + (eq_attr "type" "move,mvi,mcst,dsp32,alu0,shft,brcc,br,call,misc,compare") + "core") + +(define_insn_reservation "imul" 3 + (eq_attr "type" "mult") + "core*3") + +(define_insn_reservation "load" 1 + (eq_attr "type" "mcld") + "core") + +;; Make sure genautomata knows about the maximum latency that can be produced +;; by the adjust_cost function. +(define_insn_reservation "dummy" 5 + (eq_attr "type" "mcld") + "core") + +;; Operand and operator predicates + +(include "predicates.md") + + +;;; FRIO branches have been optimized for code density +;;; this comes at a slight cost of complexity when +;;; a compiler needs to generate branches in the general +;;; case. In order to generate the correct branching +;;; mechanisms the compiler needs keep track of instruction +;;; lengths. The follow table describes how to count instructions +;;; for the FRIO architecture. +;;; +;;; unconditional br are 12-bit imm pcrelative branches *2 +;;; conditional br are 10-bit imm pcrelative branches *2 +;;; brcc 10-bit: +;;; 1024 10-bit imm *2 is 2048 (-1024..1022) +;;; br 12-bit : +;;; 4096 12-bit imm *2 is 8192 (-4096..4094) +;;; NOTE : For brcc we generate instructions such as +;;; if cc jmp; jump.[sl] offset +;;; offset of jump.[sl] is from the jump instruction but +;;; gcc calculates length from the if cc jmp instruction +;;; furthermore gcc takes the end address of the branch instruction +;;; as (pc) for a forward branch +;;; hence our range is (-4094, 4092) instead of (-4096, 4094) for a br +;;; +;;; The way the (pc) rtx works in these calculations is somewhat odd; +;;; for backward branches it's the address of the current instruction, +;;; for forward branches it's the previously known address of the following +;;; instruction - we have to take this into account by reducing the range +;;; for a forward branch. + +;; Lengths for type "mvi" insns are always defined by the instructions +;; themselves. +(define_attr "length" "" + (cond [(eq_attr "type" "mcld") + (if_then_else (match_operand 1 "effective_address_32bit_p" "") + (const_int 4) (const_int 2)) + + (eq_attr "type" "mcst") + (if_then_else (match_operand 0 "effective_address_32bit_p" "") + (const_int 4) (const_int 2)) + + (eq_attr "type" "move") (const_int 2) + + (eq_attr "type" "dsp32") (const_int 4) + (eq_attr "type" "call") (const_int 4) + + (eq_attr "type" "br") + (if_then_else (and + (le (minus (match_dup 0) (pc)) (const_int 4092)) + (ge (minus (match_dup 0) (pc)) (const_int -4096))) + (const_int 2) + (const_int 4)) + + (eq_attr "type" "brcc") + (cond [(and + (le (minus (match_dup 3) (pc)) (const_int 1020)) + (ge (minus (match_dup 3) (pc)) (const_int -1024))) + (const_int 2) + (and + (le (minus (match_dup 3) (pc)) (const_int 4092)) + (ge (minus (match_dup 3) (pc)) (const_int -4094))) + (const_int 4)] + (const_int 6)) + ] + + (const_int 2))) + +;; Conditional moves + +(define_expand "movsicc" + [(set (match_operand:SI 0 "register_operand" "") + (if_then_else:SI (match_operand 1 "comparison_operator" "") + (match_operand:SI 2 "register_operand" "") + (match_operand:SI 3 "register_operand" "")))] + "" +{ + operands[1] = bfin_gen_compare (operands[1], SImode); +}) + +(define_insn "*movsicc_insn1" + [(set (match_operand:SI 0 "register_operand" "=da,da,da") + (if_then_else:SI + (eq:BI (match_operand:BI 3 "cc_operand" "C,C,C") + (const_int 0)) + (match_operand:SI 1 "register_operand" "da,0,da") + (match_operand:SI 2 "register_operand" "0,da,da")))] + "" + "@ + if !cc %0 =%1; /* movsicc-1a */ + if cc %0 =%2; /* movsicc-1b */ + if !cc %0 =%1; if cc %0=%2; /* movsicc-1 */" + [(set_attr "length" "2,2,4") + (set_attr "type" "move")]) + +(define_insn "*movsicc_insn2" + [(set (match_operand:SI 0 "register_operand" "=da,da,da") + (if_then_else:SI + (ne:BI (match_operand:BI 3 "cc_operand" "C,C,C") + (const_int 0)) + (match_operand:SI 1 "register_operand" "0,da,da") + (match_operand:SI 2 "register_operand" "da,0,da")))] + "" + "@ + if !cc %0 =%2; /* movsicc-2b */ + if cc %0 =%1; /* movsicc-2a */ + if cc %0 =%1; if !cc %0=%2; /* movsicc-1 */" + [(set_attr "length" "2,2,4") + (set_attr "type" "move")]) + +;; Insns to load HIGH and LO_SUM + +(define_insn "movsi_high" + [(set (match_operand:SI 0 "register_operand" "=x") + (high:SI (match_operand:SI 1 "immediate_operand" "i")))] + "reload_completed" + "%d0 = %d1;" + [(set_attr "type" "mvi") + (set_attr "length" "4")]) + +(define_insn "movstricthi_high" + [(set (match_operand:SI 0 "register_operand" "+x") + (ior:SI (and:SI (match_dup 0) (const_int 65535)) + (match_operand:SI 1 "immediate_operand" "i")))] + "reload_completed" + "%d0 = %d1;" + [(set_attr "type" "mvi") + (set_attr "length" "4")]) + +(define_insn "movsi_low" + [(set (match_operand:SI 0 "register_operand" "=x") + (lo_sum:SI (match_operand:SI 1 "register_operand" "0") + (match_operand:SI 2 "immediate_operand" "i")))] + "reload_completed" + "%h0 = %h2;" + [(set_attr "type" "mvi") + (set_attr "length" "4")]) + +(define_insn "movsi_high_pic" + [(set (match_operand:SI 0 "register_operand" "=x") + (high:SI (unspec:SI [(match_operand:SI 1 "" "")] + UNSPEC_MOVE_PIC)))] + "" + "%d0 = %1@GOT_LOW;" + [(set_attr "type" "mvi") + (set_attr "length" "4")]) + +(define_insn "movsi_low_pic" + [(set (match_operand:SI 0 "register_operand" "=x") + (lo_sum:SI (match_operand:SI 1 "register_operand" "0") + (unspec:SI [(match_operand:SI 2 "" "")] + UNSPEC_MOVE_PIC)))] + "" + "%h0 = %h2@GOT_HIGH;" + [(set_attr "type" "mvi") + (set_attr "length" "4")]) + +;;; Move instructions + +(define_insn_and_split "movdi_insn" + [(set (match_operand:DI 0 "nonimmediate_operand" "=x,mx,r") + (match_operand:DI 1 "general_operand" "iFx,r,mx"))] + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "#" + "reload_completed" + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 4) (match_dup 5))] +{ + rtx lo_half[2], hi_half[2]; + split_di (operands, 2, lo_half, hi_half); + + if (reg_overlap_mentioned_p (lo_half[0], hi_half[1])) + { + operands[2] = hi_half[0]; + operands[3] = hi_half[1]; + operands[4] = lo_half[0]; + operands[5] = lo_half[1]; + } + else + { + operands[2] = lo_half[0]; + operands[3] = lo_half[1]; + operands[4] = hi_half[0]; + operands[5] = hi_half[1]; + } +}) + +(define_insn "movbi" + [(set (match_operand:BI 0 "nonimmediate_operand" "=x,x,d,mr,C,d") + (match_operand:BI 1 "general_operand" "x,xKs3,mr,d,d,C"))] + + "" + "@ + %0 = %1; + %0 = %1 (X); + %0 = %1; + %0 = %1; + CC = %1; + %0 = CC;" + [(set_attr "type" "move,mvi,mcld,mcst,compare,compare") + (set_attr "length" "2,2,*,*,2,2")]) + +(define_insn "movpdi" + [(set (match_operand:PDI 0 "nonimmediate_operand" "=e,<,e") + (match_operand:PDI 1 "general_operand" " e,e,>"))] + "" + "@ + %0 = %1; + %0 = %x1; %0 = %w1; + %w0 = %1; %x0 = %1;" + [(set_attr "type" "move,mcst,mcld")]) + +(define_insn "*pushsi_insn" + [(set (mem:SI (pre_dec:SI (reg:SI REG_SP))) + (match_operand:SI 0 "register_operand" "xy"))] + "" + "[--SP] = %0;" + [(set_attr "type" "mcst") + (set_attr "length" "2")]) + +(define_insn "*popsi_insn" + [(set (match_operand:SI 0 "register_operand" "=xy") + (mem:SI (post_inc:SI (reg:SI REG_SP))))] + "" + "%0 = [SP++];" + [(set_attr "type" "mcld") + (set_attr "length" "2")]) + +;; The first alternative is used to make reload choose a limited register +;; class when faced with a movsi_insn that had its input operand replaced +;; with a PLUS. We generally require fewer secondary reloads this way. +(define_insn "*movsi_insn" + [(set (match_operand:SI 0 "nonimmediate_operand" "=da,x*y,da,x,x,x,da,mr") + (match_operand:SI 1 "general_operand" "da,x*y,xKs7,xKsh,xKuh,ix,mr,da"))] + + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "@ + %0 = %1; + %0 = %1; + %0 = %1 (X); + %0 = %1 (X); + %0 = %1 (Z); + # + %0 = %1; + %0 = %1;" + [(set_attr "type" "move,move,mvi,mvi,mvi,*,mcld,mcst") + (set_attr "length" "2,2,2,4,4,*,*,*")]) + +(define_insn "*movv2hi_insn" + [(set (match_operand:V2HI 0 "nonimmediate_operand" "=da,d,m") + (match_operand:V2HI 1 "general_operand" "d,m,d"))] + + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "%0 = %1;" + [(set_attr "type" "move,mcld,mcst") + (set_attr "length" "2,*,*")]) + +(define_insn "*movhi_insn" + [(set (match_operand:HI 0 "nonimmediate_operand" "=x,da,x,d,mr") + (match_operand:HI 1 "general_operand" "x,xKs7,xKsh,mr,d"))] + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "@ + %0 = %1; + %0 = %1 (X); + %0 = %1 (X); + %0 = W %1 (X); + W %0 = %1;" + [(set_attr "type" "move,mvi,mvi,mcld,mcst") + (set_attr "length" "2,2,4,*,*")]) + +(define_insn "*movqi_insn" + [(set (match_operand:QI 0 "nonimmediate_operand" "=x,da,x,d,mr") + (match_operand:QI 1 "general_operand" "x,xKs7,xKsh,mr,d"))] + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "@ + %0 = %1; + %0 = %1 (X); + %0 = %1 (X); + %0 = B %1 (X); + B %0 = %1;" + [(set_attr "type" "move,mvi,mvi,mcld,mcst") + (set_attr "length" "2,2,4,*,*")]) + +(define_insn "*movsf_insn" + [(set (match_operand:SF 0 "nonimmediate_operand" "=x,x,da,mr") + (match_operand:SF 1 "general_operand" "x,Fx,mr,da"))] + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "@ + %0 = %1; + # + %0 = %1; + %0 = %1;" + [(set_attr "type" "move,*,mcld,mcst")]) + +(define_insn_and_split "movdf_insn" + [(set (match_operand:DF 0 "nonimmediate_operand" "=x,mx,r") + (match_operand:DF 1 "general_operand" "iFx,r,mx"))] + "GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM" + "#" + "reload_completed" + [(set (match_dup 2) (match_dup 3)) + (set (match_dup 4) (match_dup 5))] +{ + rtx lo_half[2], hi_half[2]; + split_di (operands, 2, lo_half, hi_half); + + if (reg_overlap_mentioned_p (lo_half[0], hi_half[1])) + { + operands[2] = hi_half[0]; + operands[3] = hi_half[1]; + operands[4] = lo_half[0]; + operands[5] = lo_half[1]; + } + else + { + operands[2] = lo_half[0]; + operands[3] = lo_half[1]; + operands[4] = hi_half[0]; + operands[5] = hi_half[1]; + } +}) + +;; This is the main "hook" for PIC code. When generating +;; PIC, movsi is responsible for determining when the source address +;; needs PIC relocation and appropriately calling legitimize_pic_address +;; to perform the actual relocation. + +(define_expand "movsi" + [(set (match_operand:SI 0 "nonimmediate_operand" "") + (match_operand:SI 1 "general_operand" ""))] + "" + "expand_move (operands, SImode);") + +(define_expand "movv2hi" + [(set (match_operand:V2HI 0 "nonimmediate_operand" "") + (match_operand:V2HI 1 "general_operand" ""))] + "" + "expand_move (operands, V2HImode);") + +(define_expand "movdi" + [(set (match_operand:DI 0 "nonimmediate_operand" "") + (match_operand:DI 1 "general_operand" ""))] + "" + "expand_move (operands, DImode);") + +(define_expand "movsf" + [(set (match_operand:SF 0 "nonimmediate_operand" "") + (match_operand:SF 1 "general_operand" ""))] + "" + "expand_move (operands, SFmode);") + +(define_expand "movdf" + [(set (match_operand:DF 0 "nonimmediate_operand" "") + (match_operand:DF 1 "general_operand" ""))] + "" + "expand_move (operands, DFmode);") + +(define_expand "movhi" + [(set (match_operand:HI 0 "nonimmediate_operand" "") + (match_operand:HI 1 "general_operand" ""))] + "" + "expand_move (operands, HImode);") + +(define_expand "movqi" + [(set (match_operand:QI 0 "nonimmediate_operand" "") + (match_operand:QI 1 "general_operand" ""))] + "" + " expand_move (operands, QImode); ") + +;; Some define_splits to break up SI/SFmode loads of immediate constants. + +(define_split + [(set (match_operand:SI 0 "register_operand" "") + (match_operand:SI 1 "symbolic_or_const_operand" ""))] + "reload_completed + /* Always split symbolic operands; split integer constants that are + too large for a single instruction. */ + && (GET_CODE (operands[1]) != CONST_INT + || (INTVAL (operands[1]) < -32768 + || INTVAL (operands[1]) >= 65536 + || (INTVAL (operands[1]) >= 32768 && PREG_P (operands[0]))))" + [(set (match_dup 0) (high:SI (match_dup 1))) + (set (match_dup 0) (lo_sum:SI (match_dup 0) (match_dup 1)))] +{ + if (GET_CODE (operands[1]) == CONST_INT + && split_load_immediate (operands)) + DONE; + /* ??? Do something about TARGET_LOW_64K. */ +}) + +(define_split + [(set (match_operand:SF 0 "register_operand" "") + (match_operand:SF 1 "immediate_operand" ""))] + "reload_completed" + [(set (match_dup 2) (high:SI (match_dup 3))) + (set (match_dup 2) (lo_sum:SI (match_dup 2) (match_dup 3)))] +{ + long values; + REAL_VALUE_TYPE value; + + gcc_assert (GET_CODE (operands[1]) == CONST_DOUBLE); + + REAL_VALUE_FROM_CONST_DOUBLE (value, operands[1]); + REAL_VALUE_TO_TARGET_SINGLE (value, values); + + operands[2] = gen_rtx_REG (SImode, true_regnum (operands[0])); + operands[3] = GEN_INT (trunc_int_for_mode (values, SImode)); + if (values >= -32768 && values < 65536) + { + emit_move_insn (operands[2], operands[3]); + DONE; + } + if (split_load_immediate (operands + 2)) + DONE; +}) + +;; Sadly, this can't be a proper named movstrict pattern, since the compiler +;; expects to be able to use registers for operand 1. +;; Note that the asm instruction is defined by the manual to take an unsigned +;; constant, but it doesn't matter to the assembler, and the compiler only +;; deals with sign-extended constants. Hence "Ksh". +(define_insn "*movstricthi" + [(set (strict_low_part (match_operand:HI 0 "register_operand" "+x")) + (match_operand:HI 1 "immediate_operand" "Ksh"))] + "" + "%h0 = %1;" + [(set_attr "type" "mvi") + (set_attr "length" "4")]) + +;; Sign and zero extensions + +(define_insn "extendhisi2" + [(set (match_operand:SI 0 "register_operand" "=d, d") + (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d, m")))] + "" + "@ + %0 = %h1 (X); + %0 = W %h1 (X);" + [(set_attr "type" "alu0,mcld")]) + +(define_insn "zero_extendhisi2" + [(set (match_operand:SI 0 "register_operand" "=d, d") + (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "d, m")))] + "" + "@ + %0 = %h1 (Z); + %0 = W%h1 (Z);" + [(set_attr "type" "alu0,mcld")]) + +(define_insn "zero_extendbisi2" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extend:SI (match_operand:BI 1 "nonimmediate_operand" "C")))] + "" + "%0 = %1;" + [(set_attr "type" "compare")]) + +(define_insn "extendqihi2" + [(set (match_operand:HI 0 "register_operand" "=d, d") + (sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "m, d")))] + "" + "@ + %0 = B %1 (X); + %0 = %T1 (X);" + [(set_attr "type" "mcld,alu0")]) + +(define_insn "extendqisi2" + [(set (match_operand:SI 0 "register_operand" "=d, d") + (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "m, d")))] + "" + "@ + %0 = B %1 (X); + %0 = %T1 (X);" + [(set_attr "type" "mcld,alu0")]) + + +(define_insn "zero_extendqihi2" + [(set (match_operand:HI 0 "register_operand" "=d, d") + (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "m, d")))] + "" + "@ + %0 = B %1 (Z); + %0 = %T1 (Z);" + [(set_attr "type" "mcld,alu0")]) + + +(define_insn "zero_extendqisi2" + [(set (match_operand:SI 0 "register_operand" "=d, d") + (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "m, d")))] + "" + "@ + %0 = B %1 (Z); + %0 = %T1 (Z);" + [(set_attr "type" "mcld,alu0")]) + +;; DImode logical operations + +(define_code_macro any_logical [and ior xor]) +(define_code_attr optab [(and "and") + (ior "ior") + (xor "xor")]) +(define_code_attr op [(and "&") + (ior "|") + (xor "^")]) +(define_code_attr high_result [(and "0") + (ior "%H1") + (xor "%H1")]) + +(define_insn "di3" + [(set (match_operand:DI 0 "register_operand" "=d") + (any_logical:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "register_operand" "d")))] + "" + "%0 = %1 %2;\\n\\t%H0 = %H1 %H2;" + [(set_attr "length" "4")]) + +(define_insn "*di_zesidi_di" + [(set (match_operand:DI 0 "register_operand" "=d") + (any_logical:DI (zero_extend:DI + (match_operand:SI 2 "register_operand" "d")) + (match_operand:DI 1 "register_operand" "d")))] + "" + "%0 = %1 %2;\\n\\t%H0 = ;" + [(set_attr "length" "4")]) + +(define_insn "*di_sesdi_di" + [(set (match_operand:DI 0 "register_operand" "=d") + (any_logical:DI (sign_extend:DI + (match_operand:SI 2 "register_operand" "d")) + (match_operand:DI 1 "register_operand" "0"))) + (clobber (match_scratch:SI 3 "=&d"))] + "" + "%0 = %1 %2;\\n\\t%3 = %2;\\n\\t%3 >>>= 31;\\n\\t%H0 = %H1 %3;" + [(set_attr "length" "8")]) + +(define_insn "negdi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (neg:DI (match_operand:DI 1 "register_operand" "d"))) + (clobber (match_scratch:SI 2 "=&d")) + (clobber (reg:CC REG_CC))] + "" + "%2 = 0; %2 = %2 - %1; cc = ac0; cc = !cc; %2 = cc;\\n\\t%0 = -%1; %H0 = -%H1; %H0 = %H0 - %2;" + [(set_attr "length" "16")]) + +(define_insn "one_cmpldi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (not:DI (match_operand:DI 1 "register_operand" "d")))] + "" + "%0 = ~%1;\\n\\t%H0 = ~%H1;" + [(set_attr "length" "4")]) + +;; DImode zero and sign extend patterns + +(define_insn_and_split "zero_extendsidi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (zero_extend:DI (match_operand:SI 1 "register_operand" "d")))] + "" + "#" + "reload_completed" + [(set (match_dup 3) (const_int 0))] +{ + split_di (operands, 1, operands + 2, operands + 3); + if (REGNO (operands[0]) != REGNO (operands[1])) + emit_move_insn (operands[2], operands[1]); +}) + +(define_insn "zero_extendqidi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (zero_extend:DI (match_operand:QI 1 "register_operand" "d")))] + "" + "%0 = %T1 (Z);\\n\\t%H0 = 0;" + [(set_attr "length" "4")]) + +(define_insn "zero_extendhidi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (zero_extend:DI (match_operand:HI 1 "register_operand" "d")))] + "" + "%0 = %h1 (Z);\\n\\t%H0 = 0;" + [(set_attr "length" "4")]) + +(define_insn_and_split "extendsidi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))] + "" + "#" + "reload_completed" + [(set (match_dup 3) (match_dup 1)) + (set (match_dup 3) (ashiftrt:SI (match_dup 3) (const_int 31)))] +{ + split_di (operands, 1, operands + 2, operands + 3); + if (REGNO (operands[0]) != REGNO (operands[1])) + emit_move_insn (operands[2], operands[1]); +}) + +(define_insn_and_split "extendqidi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI (match_operand:QI 1 "register_operand" "d")))] + "" + "#" + "reload_completed" + [(set (match_dup 2) (sign_extend:SI (match_dup 1))) + (set (match_dup 3) (sign_extend:SI (match_dup 1))) + (set (match_dup 3) (ashiftrt:SI (match_dup 3) (const_int 31)))] +{ + split_di (operands, 1, operands + 2, operands + 3); +}) + +(define_insn_and_split "extendhidi2" + [(set (match_operand:DI 0 "register_operand" "=d") + (sign_extend:DI (match_operand:HI 1 "register_operand" "d")))] + "" + "#" + "reload_completed" + [(set (match_dup 2) (sign_extend:SI (match_dup 1))) + (set (match_dup 3) (sign_extend:SI (match_dup 1))) + (set (match_dup 3) (ashiftrt:SI (match_dup 3) (const_int 31)))] +{ + split_di (operands, 1, operands + 2, operands + 3); +}) + +;; DImode arithmetic operations + +(define_insn "adddi3" + [(set (match_operand:DI 0 "register_operand" "=&d,&d,&d") + (plus:DI (match_operand:DI 1 "register_operand" "%0,0,0") + (match_operand:DI 2 "nonmemory_operand" "Kn7,Ks7,d"))) + (clobber (match_scratch:SI 3 "=&d,&d,&d")) + (clobber (reg:CC 34))] + "" + "@ + %0 += %2; cc = ac0; %3 = cc; %H0 += -1; %H0 = %H0 + %3; + %0 += %2; cc = ac0; %3 = cc; %H0 = %H0 + %3; + %0 = %0 + %2; cc = ac0; %3 = cc; %H0 = %H0 + %H2; %H0 = %H0 + %3;" + [(set_attr "type" "alu0") + (set_attr "length" "10,8,10")]) + +(define_insn "subdi3" + [(set (match_operand:DI 0 "register_operand" "=&d") + (minus:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:DI 2 "register_operand" "d"))) + (clobber (reg:CC 34))] + "" + "%0 = %1-%2;\\n\\tcc = ac0;\\n\\t%H0 = %H1-%H2;\\n\\tif cc jump 1f;\\n\\t%H0 += -1;\\n\\t1:" + [(set_attr "length" "10")]) + +(define_insn "*subdi_di_zesidi" + [(set (match_operand:DI 0 "register_operand" "=d") + (minus:DI (match_operand:DI 1 "register_operand" "0") + (zero_extend:DI + (match_operand:SI 2 "register_operand" "d")))) + (clobber (match_scratch:SI 3 "=&d")) + (clobber (reg:CC 34))] + "" + "%0 = %1 - %2;\\n\\tcc = ac0;\\n\\tcc = ! cc;\\n\\t%3 = cc;\\n\\t%H0 = %H1 - %3;" + [(set_attr "length" "10")]) + +(define_insn "*subdi_zesidi_di" + [(set (match_operand:DI 0 "register_operand" "=d") + (minus:DI (zero_extend:DI + (match_operand:SI 2 "register_operand" "d")) + (match_operand:DI 1 "register_operand" "0"))) + (clobber (match_scratch:SI 3 "=&d")) + (clobber (reg:CC 34))] + "" + "%0 = %2 - %1;\\n\\tcc = ac0;\\n\\tcc = ! cc;\\n\\t%3 = cc;\\n\\t%3 = -%3;\\n\\t%H0 = %3 - %H1" + [(set_attr "length" "12")]) + +(define_insn "*subdi_di_sesidi" + [(set (match_operand:DI 0 "register_operand" "=d") + (minus:DI (match_operand:DI 1 "register_operand" "0") + (sign_extend:DI + (match_operand:SI 2 "register_operand" "d")))) + (clobber (match_scratch:SI 3 "=&d")) + (clobber (reg:CC 34))] + "" + "%0 = %1 - %2;\\n\\tcc = ac0;\\n\\t%3 = %2;\\n\\t%3 >>>= 31;\\n\\t%H0 = %H1 - %3;\\n\\tif cc jump 1f;\\n\\t%H0 += -1;\\n\\t1:" + [(set_attr "length" "14")]) + +(define_insn "*subdi_sesidi_di" + [(set (match_operand:DI 0 "register_operand" "=d") + (minus:DI (sign_extend:DI + (match_operand:SI 2 "register_operand" "d")) + (match_operand:DI 1 "register_operand" "0"))) + (clobber (match_scratch:SI 3 "=&d")) + (clobber (reg:CC 34))] + "" + "%0 = %2 - %1;\\n\\tcc = ac0;\\n\\t%3 = %2;\\n\\t%3 >>>= 31;\\n\\t%H0 = %3 - %H1;\\n\\tif cc jump 1f;\\n\\t%H0 += -1;\\n\\t1:" + [(set_attr "length" "14")]) + +;; Combined shift/add instructions + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=a,d") + (ashift:SI (plus:SI (match_operand:SI 1 "register_operand" "%0,0") + (match_operand:SI 2 "register_operand" "a,d")) + (match_operand:SI 3 "pos_scale_operand" "P1P2,P1P2")))] + "" + "%0 = (%0 + %2) << %3;" /* "shadd %0,%2,%3;" */ + [(set_attr "type" "alu0")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=a") + (plus:SI (match_operand:SI 1 "register_operand" "a") + (mult:SI (match_operand:SI 2 "register_operand" "a") + (match_operand:SI 3 "scale_by_operand" "i"))))] + "" + "%0 = %1 + (%2 << %X3);" + [(set_attr "type" "alu0")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=a") + (plus:SI (match_operand:SI 1 "register_operand" "a") + (ashift:SI (match_operand:SI 2 "register_operand" "a") + (match_operand:SI 3 "pos_scale_operand" "i"))))] + "" + "%0 = %1 + (%2 << %3);" + [(set_attr "type" "alu0")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=a") + (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "a") + (match_operand:SI 2 "scale_by_operand" "i")) + (match_operand:SI 3 "register_operand" "a")))] + "" + "%0 = %3 + (%1 << %X2);" + [(set_attr "type" "alu0")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=a") + (plus:SI (ashift:SI (match_operand:SI 1 "register_operand" "a") + (match_operand:SI 2 "pos_scale_operand" "i")) + (match_operand:SI 3 "register_operand" "a")))] + "" + "%0 = %3 + (%1 << %2);" + [(set_attr "type" "alu0")]) + +(define_insn "mulhisi3" + [(set (match_operand:SI 0 "register_operand" "=d") + (mult:SI (sign_extend:SI (match_operand:HI 1 "register_operand" "%d")) + (sign_extend:SI (match_operand:HI 2 "register_operand" "d"))))] + "" + "%0 = %h1 * %h2 (IS);" + [(set_attr "type" "dsp32")]) + +(define_insn "umulhisi3" + [(set (match_operand:SI 0 "register_operand" "=d") + (mult:SI (zero_extend:SI (match_operand:HI 1 "register_operand" "%d")) + (zero_extend:SI (match_operand:HI 2 "register_operand" "d"))))] + "" + "%0 = %h1 * %h2 (FU);" + [(set_attr "type" "dsp32")]) + +;; The processor also supports ireg += mreg or ireg -= mreg, but these +;; are unusable if we don't ensure that the corresponding lreg is zero. +;; The same applies to the add/subtract constant versions involving +;; iregs + +(define_insn "addsi3" + [(set (match_operand:SI 0 "register_operand" "=ad,a,d") + (plus:SI (match_operand:SI 1 "register_operand" "%0, a,d") + (match_operand:SI 2 "reg_or_7bit_operand" "Ks7, a,d")))] + "" + "@ + %0 += %2; + %0 = %1 + %2; + %0 = %1 + %2;" + [(set_attr "type" "alu0") + (set_attr "length" "2,2,2")]) + +(define_expand "subsi3" + [(set (match_operand:SI 0 "register_operand" "") + (minus:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "reg_or_7bit_operand" "")))] + "" + "") + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=da,d,a") + (minus:SI (match_operand:SI 1 "register_operand" "0,d,0") + (match_operand:SI 2 "reg_or_7bit_operand" "Ks7,d,a")))] + "GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) != -64" +{ + static const char *const strings_subsi3[] = { + "%0 += -%2;", + "%0 = %1 - %2;", + "%0 -= %2;", + }; + + if (CONSTANT_P (operands[2]) && INTVAL (operands[2]) < 0) { + rtx tmp_op = operands[2]; + operands[2] = GEN_INT (-INTVAL (operands[2])); + output_asm_insn ("%0 += %2;", operands); + operands[2] = tmp_op; + return ""; + } + + return strings_subsi3[which_alternative]; +} + [(set_attr "type" "alu0")]) + +;; Bit test instructions + +(define_insn "*not_bittst" + [(set (match_operand:BI 0 "cc_operand" "=C") + (eq:BI (zero_extract:SI (match_operand:SI 1 "register_operand" "d") + (const_int 1) + (match_operand:SI 2 "immediate_operand" "Ku5")) + (const_int 0)))] + "" + "cc = !BITTST (%1,%2);" + [(set_attr "type" "alu0")]) + +(define_insn "*bittst" + [(set (match_operand:BI 0 "cc_operand" "=C") + (ne:BI (zero_extract:SI (match_operand:SI 1 "register_operand" "d") + (const_int 1) + (match_operand:SI 2 "immediate_operand" "Ku5")) + (const_int 0)))] + "" + "cc = BITTST (%1,%2);" + [(set_attr "type" "alu0")]) + +(define_insn_and_split "*bit_extract" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extract:SI (match_operand:SI 1 "register_operand" "d") + (const_int 1) + (match_operand:SI 2 "immediate_operand" "Ku5"))) + (clobber (reg:BI REG_CC))] + "" + "#" + "" + [(set (reg:BI REG_CC) + (ne:BI (zero_extract:SI (match_dup 1) (const_int 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) + (ne:SI (reg:BI REG_CC) (const_int 0)))]) + +(define_insn_and_split "*not_bit_extract" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extract:SI (not:SI (match_operand:SI 1 "register_operand" "d")) + (const_int 1) + (match_operand:SI 2 "immediate_operand" "Ku5"))) + (clobber (reg:BI REG_CC))] + "" + "#" + "" + [(set (reg:BI REG_CC) + (eq:BI (zero_extract:SI (match_dup 1) (const_int 1) (match_dup 2)) + (const_int 0))) + (set (match_dup 0) + (ne:SI (reg:BI REG_CC) (const_int 0)))]) + +(define_insn "*andsi_insn" + [(set (match_operand:SI 0 "register_operand" "=d,d,d,d") + (and:SI (match_operand:SI 1 "register_operand" "%0,d,d,d") + (match_operand:SI 2 "rhs_andsi3_operand" "L,M1,M2,d")))] + "" + "@ + BITCLR (%0,%Y2); + %0 = %T1 (Z); + %0 = %h1 (Z); + %0 = %1 & %2;" + [(set_attr "type" "alu0")]) + +(define_expand "andsi3" + [(set (match_operand:SI 0 "register_operand" "") + (and:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "general_operand" "")))] + "" +{ + if (highbits_operand (operands[2], SImode)) + { + operands[2] = GEN_INT (exact_log2 (-INTVAL (operands[2]))); + emit_insn (gen_ashrsi3 (operands[0], operands[1], operands[2])); + emit_insn (gen_ashlsi3 (operands[0], operands[0], operands[2])); + DONE; + } + if (! rhs_andsi3_operand (operands[2], SImode)) + operands[2] = force_reg (SImode, operands[2]); +}) + +(define_insn "iorsi3" + [(set (match_operand:SI 0 "register_operand" "=d,d") + (ior:SI (match_operand:SI 1 "register_operand" "%0,d") + (match_operand:SI 2 "regorlog2_operand" "J,d")))] + "" + "@ + BITSET (%0, %X2); + %0 = %1 | %2;" + [(set_attr "type" "alu0")]) + +(define_insn "xorsi3" + [(set (match_operand:SI 0 "register_operand" "=d,d") + (xor:SI (match_operand:SI 1 "register_operand" "%0,d") + (match_operand:SI 2 "regorlog2_operand" "J,d")))] + "" + "@ + BITTGL (%0, %X2); + %0 = %1 ^ %2;" + [(set_attr "type" "alu0")]) + +(define_insn "smaxsi3" + [(set (match_operand:SI 0 "register_operand" "=d") + (smax:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")))] + "" + "%0 =max(%1,%2);" + [(set_attr "type" "dsp32")]) + +(define_insn "sminsi3" + [(set (match_operand:SI 0 "register_operand" "=d") + (smin:SI (match_operand:SI 1 "register_operand" "d") + (match_operand:SI 2 "register_operand" "d")))] + "" + "%0 =min(%1,%2);" + [(set_attr "type" "dsp32")]) + +(define_insn "abssi2" + [(set (match_operand:SI 0 "register_operand" "=d") + (abs:SI (match_operand:SI 1 "register_operand" " d")))] + "" + "%0 =abs %1;" + [(set_attr "type" "dsp32")]) + + +(define_insn "negsi2" + [(set (match_operand:SI 0 "register_operand" "=d") + (neg:SI (match_operand:SI 1 "register_operand" " d")))] + "" + "%0 =-%1;" + [(set_attr "type" "alu0")]) + +(define_insn "one_cmplsi2" + [(set (match_operand:SI 0 "register_operand" "=d") + (not:SI (match_operand:SI 1 "register_operand" " d")))] + "" + "%0 =~%1;" + [(set_attr "type" "alu0")]) + +(define_insn "mulsi3" + [(set (match_operand:SI 0 "register_operand" "=d") + (mult:SI (match_operand:SI 1 "register_operand" "%0") + (match_operand:SI 2 "register_operand" "d")))] + "" + "%0 *=%2;" + [(set_attr "type" "mult")]) + +(define_expand "ashlsi3" + [(set (match_operand:SI 0 "register_operand" "") + (ashift:SI (match_operand:SI 1 "register_operand" "") + (match_operand:SI 2 "nonmemory_operand" "")))] + "" +{ + if (GET_CODE (operands[2]) == CONST_INT + && ((unsigned HOST_WIDE_INT) INTVAL (operands[2])) > 31) + { + emit_insn (gen_movsi (operands[0], const0_rtx)); + DONE; + } +}) + +(define_insn_and_split "*ashlsi3_insn" + [(set (match_operand:SI 0 "register_operand" "=d,a,a,a") + (ashift:SI (match_operand:SI 1 "register_operand" "0,a,a,a") + (match_operand:SI 2 "nonmemory_operand" "dKu5,P1,P2,?P3P4")))] + "" + "@ + %0 <<= %2; + %0 = %1 + %1; + %0 = %1 << %2; + #" + "PREG_P (operands[0]) && INTVAL (operands[2]) > 2" + [(set (match_dup 0) (ashift:SI (match_dup 1) (const_int 2))) + (set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 3)))] + "operands[3] = GEN_INT (INTVAL (operands[2]) - 2);" + [(set_attr "type" "shft")]) + +(define_insn "ashrsi3" + [(set (match_operand:SI 0 "register_operand" "=d") + (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") + (match_operand:SI 2 "nonmemory_operand" "dKu5")))] + "" + "%0 >>>= %2;" + [(set_attr "type" "shft")]) + +(define_insn "lshrsi3" + [(set (match_operand:SI 0 "register_operand" "=d,a") + (lshiftrt:SI (match_operand:SI 1 "register_operand" " 0,a") + (match_operand:SI 2 "nonmemory_operand" "dKu5,P1P2")))] + "" + "@ + %0 >>= %2; + %0 = %1 >> %2;" + [(set_attr "type" "shft")]) + +;; A pattern to reload the equivalent of +;; (set (Dreg) (plus (FP) (large_constant))) +;; or +;; (set (dagreg) (plus (FP) (arbitrary_constant))) +;; using a scratch register +(define_expand "reload_insi" + [(parallel [(set (match_operand:SI 0 "register_operand" "=w") + (match_operand:SI 1 "fp_plus_const_operand" "")) + (clobber (match_operand:SI 2 "register_operand" "=&a"))])] + "" +{ + rtx fp_op = XEXP (operands[1], 0); + rtx const_op = XEXP (operands[1], 1); + rtx primary = operands[0]; + rtx scratch = operands[2]; + + emit_move_insn (scratch, const_op); + emit_insn (gen_addsi3 (scratch, scratch, fp_op)); + emit_move_insn (primary, scratch); + DONE; +}) + +;; Jump instructions + +(define_insn "jump" + [(set (pc) + (label_ref (match_operand 0 "" "")))] + "" +{ + if (get_attr_length (insn) == 2) + return "jump.s %0;"; + else + return "jump.l %0;"; +} + [(set_attr "type" "br")]) + +(define_insn "indirect_jump" + [(set (pc) + (match_operand:SI 0 "register_operand" "a"))] + "" + "jump (%0);" + [(set_attr "type" "misc")]) + +(define_expand "tablejump" + [(parallel [(set (pc) (match_operand:SI 0 "register_operand" "a")) + (use (label_ref (match_operand 1 "" "")))])] + "" +{ + /* In PIC mode, the table entries are stored PC relative. + Convert the relative address to an absolute address. */ + if (flag_pic) + { + rtx op1 = gen_rtx_LABEL_REF (Pmode, operands[1]); + + operands[0] = expand_simple_binop (Pmode, PLUS, operands[0], + op1, NULL_RTX, 0, OPTAB_DIRECT); + } +}) + +(define_insn "*tablejump_internal" + [(set (pc) (match_operand:SI 0 "register_operand" "a")) + (use (label_ref (match_operand 1 "" "")))] + "" + "jump (%0);" + [(set_attr "type" "misc")]) + +;; Call instructions.. + +(define_expand "call" + [(call (match_operand:SI 0 "" "") + (match_operand 1 "" ""))] + "" + "bfin_expand_call (NULL_RTX, operands[0], operands[1], 0); DONE;") + +(define_expand "sibcall" + [(parallel [(call (match_operand:SI 0 "" "") + (match_operand 1 "" "")) + (return)])] + "" + "bfin_expand_call (NULL_RTX, operands[0], operands[1], 1); DONE;") + +(define_expand "call_value" + [(set (match_operand 0 "register_operand" "") + (call (match_operand:SI 1 "" "") + (match_operand 2 "" "")))] + "" + "bfin_expand_call (operands[0], operands[1], operands[2], 0); DONE;") + +(define_expand "sibcall_value" + [(parallel [(set (match_operand 0 "register_operand" "") + (call (match_operand:SI 1 "" "") + (match_operand 2 "" ""))) + (return)])] + "" + "bfin_expand_call (operands[0], operands[1], operands[2], 1); DONE;") + +(define_insn "*call_insn" + [(call (mem:SI (match_operand:SI 0 "call_insn_operand" "a,Q")) + (match_operand 1 "general_operand" "g,g"))] + "! SIBLING_CALL_P (insn) + && (GET_CODE (operands[0]) == SYMBOL_REF || GET_CODE (operands[0]) == REG)" + "@ + call (%0); + call %G0;" + [(set_attr "type" "call") + (set_attr "length" "2,4")]) + +(define_insn "*sibcall_insn" + [(call (mem:SI (match_operand:SI 0 "call_insn_operand" "z,Q")) + (match_operand 1 "general_operand" "g,g")) + (return)] + "SIBLING_CALL_P (insn) + && (GET_CODE (operands[0]) == SYMBOL_REF || GET_CODE (operands[0]) == REG)" + "@ + jump (%0); + jump.l %G0;" + [(set_attr "type" "br") + (set_attr "length" "2,4")]) + +(define_insn "*call_value_insn" + [(set (match_operand 0 "register_operand" "=d,d") + (call (mem:SI (match_operand:SI 1 "call_insn_operand" "a,Q")) + (match_operand 2 "general_operand" "g,g")))] + "! SIBLING_CALL_P (insn) + && (GET_CODE (operands[0]) == SYMBOL_REF || GET_CODE (operands[0]) == REG)" + "@ + call (%1); + call %G1;" + [(set_attr "type" "call") + (set_attr "length" "2,4")]) + +(define_insn "*sibcall_value_insn" + [(set (match_operand 0 "register_operand" "=d,d") + (call (mem:SI (match_operand:SI 1 "call_insn_operand" "z,Q")) + (match_operand 2 "general_operand" "g,g"))) + (return)] + "SIBLING_CALL_P (insn) + && (GET_CODE (operands[0]) == SYMBOL_REF || GET_CODE (operands[0]) == REG)" + "@ + jump (%1); + jump.l %G1;" + [(set_attr "type" "br") + (set_attr "length" "2,4")]) + +;; Block move patterns + +;; We cheat. This copies one more word than operand 2 indicates. + +(define_insn "rep_movsi" + [(set (match_operand:SI 0 "register_operand" "=&a") + (plus:SI (plus:SI (match_operand:SI 3 "register_operand" "0") + (ashift:SI (match_operand:SI 2 "register_operand" "a") + (const_int 2))) + (const_int 4))) + (set (match_operand:SI 1 "register_operand" "=&b") + (plus:SI (plus:SI (match_operand:SI 4 "register_operand" "1") + (ashift:SI (match_dup 2) (const_int 2))) + (const_int 4))) + (set (mem:BLK (match_dup 3)) + (mem:BLK (match_dup 4))) + (use (match_dup 2)) + (clobber (match_scratch:HI 5 "=&d"))] + "" + "lsetup (1f, 1f) LC1 = %2; %5 = [%4++]; 1: MNOP || [%3++] = %5 || %5 = [%4++]; [%3++] = %5;" + [(set_attr "type" "misc") + (set_attr "length" "16")]) + +(define_insn "rep_movhi" + [(set (match_operand:SI 0 "register_operand" "=&a") + (plus:SI (plus:SI (match_operand:SI 3 "register_operand" "0") + (ashift:SI (match_operand:SI 2 "register_operand" "a") + (const_int 1))) + (const_int 2))) + (set (match_operand:SI 1 "register_operand" "=&b") + (plus:SI (plus:SI (match_operand:SI 4 "register_operand" "1") + (ashift:SI (match_dup 2) (const_int 1))) + (const_int 2))) + (set (mem:BLK (match_dup 3)) + (mem:BLK (match_dup 4))) + (use (match_dup 2)) + (clobber (match_scratch:HI 5 "=&d"))] + "" + "lsetup (1f, 1f) LC1 = %2; %h5 = W[%4++]; 1: MNOP || W [%3++] = %5 || %h5 = W [%4++]; W [%3++] = %5;" + [(set_attr "type" "misc") + (set_attr "length" "16")]) + +(define_expand "movstrsi" + [(match_operand:BLK 0 "general_operand" "") + (match_operand:BLK 1 "general_operand" "") + (match_operand:SI 2 "const_int_operand" "") + (match_operand:SI 3 "const_int_operand" "")] + "" +{ + if (bfin_expand_strmov (operands[0], operands[1], operands[2], operands[3])) + DONE; + FAIL; +}) + +;; Conditional branch patterns +;; The Blackfin has only few condition codes: eq, lt, lte, ltu, leu + +;; The only outcome of this pattern is that global variables +;; bfin_compare_op[01] are set for use in bcond patterns. + +(define_expand "cmpbi" + [(set (cc0) (compare (match_operand:BI 0 "register_operand" "") + (match_operand:BI 1 "immediate_operand" "")))] + "" +{ + bfin_compare_op0 = operands[0]; + bfin_compare_op1 = operands[1]; + DONE; +}) + +(define_expand "cmpsi" + [(set (cc0) (compare (match_operand:SI 0 "register_operand" "") + (match_operand:SI 1 "nonmemory_operand" "")))] + "" +{ + bfin_compare_op0 = operands[0]; + bfin_compare_op1 = operands[1]; + DONE; +}) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C,C") + (eq:BI (match_operand:SI 1 "register_operand" "d,a") + (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))] + "" + "cc =%1==%2;" + [(set_attr "type" "compare")]) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C,C") + (ne:BI (match_operand:SI 1 "register_operand" "d,a") + (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))] + "0" + "cc =%1!=%2;" + [(set_attr "type" "compare")]) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C,C") + (lt:BI (match_operand:SI 1 "register_operand" "d,a") + (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))] + "" + "cc =%1<%2;" + [(set_attr "type" "compare")]) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C,C") + (le:BI (match_operand:SI 1 "register_operand" "d,a") + (match_operand:SI 2 "nonmemory_operand" "dKs3,aKs3")))] + "" + "cc =%1<=%2;" + [(set_attr "type" "compare")]) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C,C") + (leu:BI (match_operand:SI 1 "register_operand" "d,a") + (match_operand:SI 2 "nonmemory_operand" "dKu3,aKu3")))] + "" + "cc =%1<=%2 (iu);" + [(set_attr "type" "compare")]) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C,C") + (ltu:BI (match_operand:SI 1 "register_operand" "d,a") + (match_operand:SI 2 "nonmemory_operand" "dKu3,aKu3")))] + "" + "cc =%1<%2 (iu);" + [(set_attr "type" "compare")]) + +(define_expand "beq" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + rtx op0 = bfin_compare_op0, op1 = bfin_compare_op1; + operands[1] = bfin_cc_rtx; /* hard register: CC */ + operands[2] = gen_rtx_EQ (BImode, op0, op1); + /* If we have a BImode input, then we already have a compare result, and + do not need to emit another comparison. */ + if (GET_MODE (bfin_compare_op0) == BImode) + { + gcc_assert (bfin_compare_op1 == const0_rtx); + emit_insn (gen_cbranchbi4 (operands[2], op0, op1, operands[0])); + DONE; + } + + operands[3] = gen_rtx_NE (BImode, operands[1], const0_rtx); +}) + +(define_expand "bne" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + rtx op0 = bfin_compare_op0, op1 = bfin_compare_op1; + /* If we have a BImode input, then we already have a compare result, and + do not need to emit another comparison. */ + if (GET_MODE (bfin_compare_op0) == BImode) + { + rtx cmp = gen_rtx_NE (BImode, op0, op1); + + gcc_assert (bfin_compare_op1 == const0_rtx); + emit_insn (gen_cbranchbi4 (cmp, op0, op1, operands[0])); + DONE; + } + + operands[1] = bfin_cc_rtx; /* hard register: CC */ + operands[2] = gen_rtx_EQ (BImode, op0, op1); + operands[3] = gen_rtx_EQ (BImode, operands[1], const0_rtx); +}) + +(define_expand "bgt" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LE (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_EQ (BImode, operands[1], const0_rtx); +}) + +(define_expand "bgtu" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LEU (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_EQ (BImode, operands[1], const0_rtx); +}) + +(define_expand "blt" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LT (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_NE (BImode, operands[1], const0_rtx); +}) + +(define_expand "bltu" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LTU (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_NE (BImode, operands[1], const0_rtx); +}) + + +(define_expand "bge" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LT (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_EQ (BImode, operands[1], const0_rtx); +}) + +(define_expand "bgeu" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LTU (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_EQ (BImode, operands[1], const0_rtx); +}) + +(define_expand "ble" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc)))] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LE (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_NE (BImode, operands[1], const0_rtx); +}) + +(define_expand "bleu" + [(set (match_dup 1) (match_dup 2)) + (set (pc) + (if_then_else (match_dup 3) + (label_ref (match_operand 0 "" "")) + (pc))) + ] + "" +{ + operands[1] = bfin_cc_rtx; + operands[2] = gen_rtx_LEU (BImode, bfin_compare_op0, bfin_compare_op1); + operands[3] = gen_rtx_NE (BImode, operands[1], const0_rtx); +}) + +(define_insn "cbranchbi4" + [(set (pc) + (if_then_else + (match_operator 0 "bfin_cbranch_operator" + [(match_operand:BI 1 "cc_operand" "C") + (match_operand:BI 2 "immediate_operand" "P0")]) + (label_ref (match_operand 3 "" "")) + (pc)))] + "" +{ + asm_conditional_branch (insn, operands, 0, 0); + return ""; +} + [(set_attr "type" "brcc")]) + +;; Special cbranch patterns to deal with the speculative load problem - see +;; bfin_reorg for details. + +(define_insn "cbranch_predicted_taken" + [(set (pc) + (if_then_else + (match_operator 0 "bfin_cbranch_operator" + [(match_operand:BI 1 "cc_operand" "C") + (match_operand:BI 2 "immediate_operand" "P0")]) + (label_ref (match_operand 3 "" "")) + (pc))) + (unspec [(const_int 0)] UNSPEC_CBRANCH_TAKEN)] + "" +{ + asm_conditional_branch (insn, operands, 0, 1); + return ""; +} + [(set_attr "type" "brcc")]) + +(define_insn "cbranch_with_nops" + [(set (pc) + (if_then_else + (match_operator 0 "bfin_cbranch_operator" + [(match_operand:BI 1 "cc_operand" "C") + (match_operand:BI 2 "immediate_operand" "P0")]) + (label_ref (match_operand 3 "" "")) + (pc))) + (unspec [(match_operand 4 "immediate_operand" "")] UNSPEC_CBRANCH_NOPS)] + "reload_completed" +{ + asm_conditional_branch (insn, operands, INTVAL (operands[4]), 0); + return ""; +} + [(set_attr "type" "brcc") + (set_attr "length" "6")]) + +;; setcc insns. */ +(define_expand "seq" + [(set (match_dup 1) (eq:BI (match_dup 2) (match_dup 3))) + (set (match_operand:SI 0 "register_operand" "") + (ne:SI (match_dup 1) (const_int 0)))] + "" +{ + operands[2] = bfin_compare_op0; + operands[3] = bfin_compare_op1; + operands[1] = bfin_cc_rtx; +}) + +(define_expand "slt" + [(set (match_dup 1) (lt:BI (match_dup 2) (match_dup 3))) + (set (match_operand:SI 0 "register_operand" "") + (ne:SI (match_dup 1) (const_int 0)))] + "" +{ + operands[2] = bfin_compare_op0; + operands[3] = bfin_compare_op1; + operands[1] = bfin_cc_rtx; +}) + +(define_expand "sle" + [(set (match_dup 1) (le:BI (match_dup 2) (match_dup 3))) + (set (match_operand:SI 0 "register_operand" "") + (ne:SI (match_dup 1) (const_int 0)))] + "" +{ + operands[2] = bfin_compare_op0; + operands[3] = bfin_compare_op1; + operands[1] = bfin_cc_rtx; +}) + +(define_expand "sltu" + [(set (match_dup 1) (ltu:BI (match_dup 2) (match_dup 3))) + (set (match_operand:SI 0 "register_operand" "") + (ne:SI (match_dup 1) (const_int 0)))] + "" +{ + operands[2] = bfin_compare_op0; + operands[3] = bfin_compare_op1; + operands[1] = bfin_cc_rtx; +}) + +(define_expand "sleu" + [(set (match_dup 1) (leu:BI (match_dup 2) (match_dup 3))) + (set (match_operand:SI 0 "register_operand" "") + (ne:SI (match_dup 1) (const_int 0)))] + "" +{ + operands[2] = bfin_compare_op0; + operands[3] = bfin_compare_op1; + operands[1] = bfin_cc_rtx; +}) + +(define_insn "nop" + [(const_int 0)] + "" + "nop;") + +;;;;;;;;;;;;;;;;;;;; CC2dreg ;;;;;;;;;;;;;;;;;;;;;;;;; +(define_insn "movsibi" + [(set (match_operand:BI 0 "cc_operand" "=C") + (ne:BI (match_operand:SI 1 "register_operand" "d") + (const_int 0)))] + "" + "CC = %1;" + [(set_attr "length" "2")]) + +(define_insn "movbisi" + [(set (match_operand:SI 0 "register_operand" "=d") + (ne:SI (match_operand:BI 1 "cc_operand" "C") + (const_int 0)))] + "" + "%0 = CC;" + [(set_attr "length" "2")]) + +(define_insn "" + [(set (match_operand:BI 0 "cc_operand" "=C") + (eq:BI (match_operand:BI 1 "cc_operand" " 0") + (const_int 0)))] + "" + "%0 = ! %0;" /* NOT CC;" */ + [(set_attr "type" "compare")]) + +;; Vector and DSP insns + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d") + (const_int 24)) + (lshiftrt:SI (match_operand:SI 2 "register_operand" "d") + (const_int 8))))] + "" + "%0 = ALIGN8(%1, %2);" + [(set_attr "type" "dsp32")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d") + (const_int 16)) + (lshiftrt:SI (match_operand:SI 2 "register_operand" "d") + (const_int 16))))] + "" + "%0 = ALIGN16(%1, %2);" + [(set_attr "type" "dsp32")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (ior:SI (ashift:SI (match_operand:SI 1 "register_operand" "d") + (const_int 8)) + (lshiftrt:SI (match_operand:SI 2 "register_operand" "d") + (const_int 24))))] + "" + "%0 = ALIGN24(%1, %2);" + [(set_attr "type" "dsp32")]) + +;; Prologue and epilogue. + +(define_expand "prologue" + [(const_int 1)] + "" + "bfin_expand_prologue (); DONE;") + +(define_expand "epilogue" + [(const_int 1)] + "" + "bfin_expand_epilogue (1, 0); DONE;") + +(define_expand "sibcall_epilogue" + [(const_int 1)] + "" + "bfin_expand_epilogue (0, 0); DONE;") + +(define_expand "eh_return" + [(unspec_volatile [(match_operand:SI 0 "register_operand" "")] + UNSPEC_VOLATILE_EH_RETURN)] + "" +{ + emit_move_insn (EH_RETURN_HANDLER_RTX, operands[0]); + emit_insn (gen_eh_return_internal ()); + emit_barrier (); + DONE; +}) + +(define_insn_and_split "eh_return_internal" + [(unspec_volatile [(reg:SI REG_P2)] UNSPEC_VOLATILE_EH_RETURN)] + "" + "#" + "reload_completed" + [(const_int 1)] + "bfin_expand_epilogue (1, 1); DONE;") + +(define_insn "link" + [(set (mem:SI (plus:SI (reg:SI REG_SP) (const_int -4))) (reg:SI REG_RETS)) + (set (mem:SI (plus:SI (reg:SI REG_SP) (const_int -8))) (reg:SI REG_FP)) + (set (reg:SI REG_FP) + (plus:SI (reg:SI REG_SP) (const_int -8))) + (set (reg:SI REG_SP) + (plus:SI (reg:SI REG_SP) (match_operand:SI 0 "immediate_operand" "i")))] + "" + "LINK %Z0;" + [(set_attr "length" "4")]) + +(define_insn "unlink" + [(set (reg:SI REG_FP) (mem:SI (reg:SI REG_FP))) + (set (reg:SI REG_RETS) (mem:SI (plus:SI (reg:SI REG_FP) (const_int 4)))) + (set (reg:SI REG_SP) (plus:SI (reg:SI REG_FP) (const_int 8)))] + "" + "UNLINK;" + [(set_attr "length" "4")]) + +;; This pattern is slightly clumsy. The stack adjust must be the final SET in +;; the pattern, otherwise dwarf2out becomes very confused about which reg goes +;; where on the stack, since it goes through all elements of the parallel in +;; sequence. +(define_insn "push_multiple" + [(match_parallel 0 "push_multiple_operation" + [(unspec [(match_operand:SI 1 "immediate_operand" "i")] UNSPEC_PUSH_MULTIPLE)])] + "" +{ + output_push_multiple (insn, operands); + return ""; +}) + +(define_insn "pop_multiple" + [(match_parallel 0 "pop_multiple_operation" + [(set (reg:SI REG_SP) + (plus:SI (reg:SI REG_SP) (match_operand:SI 1 "immediate_operand" "i")))])] + "" +{ + output_pop_multiple (insn, operands); + return ""; +}) + +(define_insn "return_internal" + [(return) + (unspec [(match_operand 0 "immediate_operand" "i")] UNSPEC_RETURN)] + "reload_completed" +{ + switch (INTVAL (operands[0])) + { + case EXCPT_HANDLER: + return "rtx;"; + case NMI_HANDLER: + return "rtn;"; + case INTERRUPT_HANDLER: + return "rti;"; + case SUBROUTINE: + return "rts;"; + } + gcc_unreachable (); +}) + +;;; Vector instructions + +(define_insn "addv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (plus:V2HI (match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")))] + "" + "%0 = %1 +|+ %2;" + [(set_attr "type" "dsp32")]) + +(define_insn "subv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (minus:V2HI (match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")))] + "" + "%0 = %1 -|- %2;" + [(set_attr "type" "dsp32")]) + +(define_insn "sminv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (smin:V2HI (match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")))] + "" + "%0 = MIN (%1, %2) (V);" + [(set_attr "type" "dsp32")]) + +(define_insn "smaxv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (smax:V2HI (match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")))] + "" + "%0 = MAX (%1, %2) (V);" + [(set_attr "type" "dsp32")]) + +(define_insn "mulv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (mult:V2HI (match_operand:V2HI 1 "register_operand" "d") + (match_operand:V2HI 2 "register_operand" "d")))] + "" + "%h0 = %h1 * %h2, %d0 = %d1 * %d2 (IS);" + [(set_attr "type" "dsp32")]) + +(define_insn "negv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (neg:V2HI (match_operand:V2HI 1 "register_operand" "d")))] + "" + "%0 = - %1 (V);" + [(set_attr "type" "dsp32")]) + +(define_insn "absv2hi" + [(set (match_operand:V2HI 0 "register_operand" "=d") + (abs:V2HI (match_operand:V2HI 1 "register_operand" "d")))] + "" + "%0 = ABS %1 (V);" + [(set_attr "type" "dsp32")]) + diff --git a/gcc/config/bfin/bfin.opt b/gcc/config/bfin/bfin.opt new file mode 100644 index 00000000000..827947d5e6a --- /dev/null +++ b/gcc/config/bfin/bfin.opt @@ -0,0 +1,40 @@ +; Options for the Blackfin port of the compiler +; +; Copyright (C) 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. + +momit-leaf-frame-pointer +Target Report Mask(OMIT_LEAF_FRAME_POINTER) +Omit frame pointer for leaf functions + +mlow64k +Target Report Mask(LOW_64K) +Program is entirely located in low 64k of memory. + +mcsync +Target Report Mask(CSYNC) +Avoid speculative loads by inserting CSYNC or equivalent + +mid-shared-library +Target Report Mask(ID_SHARED_LIBRARY) +Enabled ID based shared library + +mshared-library-id= +Target RejectNegative Joined UInteger +ID of shared library to build diff --git a/gcc/config/bfin/crti.s b/gcc/config/bfin/crti.s new file mode 100644 index 00000000000..69e67007091 --- /dev/null +++ b/gcc/config/bfin/crti.s @@ -0,0 +1,47 @@ +/* Specialized code needed to support construction and destruction of + file-scope objects in C++ and Java code, and to support exception handling. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Analog Devices. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* + * This file just supplies function prologues for the .init and .fini + * sections. It is linked in before crtbegin.o. + */ + + .file "crti.o" + .ident "GNU C crti.o" + + .section .init + .globl _init + .type _init,@function +_init: + LINK 0; + + .section .fini + .globl _fini + .type _fini,@function +_fini: + LINK 0; diff --git a/gcc/config/bfin/crtn.s b/gcc/config/bfin/crtn.s new file mode 100644 index 00000000000..fb25b77c5f9 --- /dev/null +++ b/gcc/config/bfin/crtn.s @@ -0,0 +1,43 @@ +/* Specialized code needed to support construction and destruction of + file-scope objects in C++ and Java code, and to support exception handling. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Analog Devices. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +/* + * This file supplies function epilogues for the .init and .fini sections. + * It is linked in after all other files. + */ + + .file "crtn.o" + .ident "GNU C crtn.o" + + .section .init + unlink; + rts; + + .section .fini + unlink; + rts; diff --git a/gcc/config/bfin/elf.h b/gcc/config/bfin/elf.h new file mode 100644 index 00000000000..643d5197a67 --- /dev/null +++ b/gcc/config/bfin/elf.h @@ -0,0 +1,16 @@ +#define OBJECT_FORMAT_ELF + +#define LOCAL_LABEL_PREFIX "L$" + +#undef ASM_GENERATE_INTERNAL_LABEL +#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \ + sprintf (LABEL, "*%s%s$%d", LOCAL_LABEL_PREFIX, PREFIX, (int) NUM) + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crt0%O%s crti%O%s crtbegin%O%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "crtend%O%s crtn%O%s" + +#undef USER_LABEL_PREFIX +#define USER_LABEL_PREFIX "_" diff --git a/gcc/config/bfin/lib1funcs.asm b/gcc/config/bfin/lib1funcs.asm new file mode 100644 index 00000000000..778d056fbf4 --- /dev/null +++ b/gcc/config/bfin/lib1funcs.asm @@ -0,0 +1,120 @@ +/* libgcc functions for Blackfin. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Analog Devices. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GCC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* As a special exception, if you link this library with files + compiled with GCC to produce an executable, this does not cause + the resulting executable to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + + +#ifdef L_divsi3 +.text +.align 2 +.global ___divsi3; +.type ___divsi3, STT_FUNC; + +___divsi3: + [--SP]= RETS; + [--SP] = R7; + + R2 = -R0; + CC = R0 < 0; + IF CC R0 = R2; + R7 = CC; + + R2 = -R1; + CC = R1 < 0; + IF CC R1 = R2; + R2 = CC; + R7 = R7 ^ R2; + + CALL ___udivsi3; + + CC = R7; + R1 = -R0; + IF CC R0 = R1; + + R7 = [SP++]; + RETS = [SP++]; + RTS; +#endif + +#ifdef L_modsi3 +.align 2 +.global ___modsi3; +.type ___modsi3, STT_FUNC; + +___modsi3: + [--SP] = RETS; + /* P1 and P2 are preserved by divsi3 and udivsi3. */ + P1 = R0; + P2 = R1; + CALL ___divsi3; + R1 = P1; + R2 = P2; + R2 *= R0; + R0 = R1 - R2; + RETS = [SP++]; + RTS; +#endif + +#ifdef L_udivsi3 +.align 2 +.global ___udivsi3; +.type ___udivsi3, STT_FUNC; + +___udivsi3: + P0 = 32; + LSETUP (0f, 1f) LC0 = P0; + /* upper half of dividend */ + R3 = 0; +0: + /* The first time round in the loop we shift in garbage, but since we + perform 33 shifts, it doesn't matter. */ + R0 = ROT R0 BY 1; + R3 = ROT R3 BY 1; + R2 = R3 - R1; + CC = R3 < R1 (IU); +1: + /* Last instruction of the loop. */ + IF ! CC R3 = R2; + + /* Shift in the last bit. */ + R0 = ROT R0 BY 1; + /* R0 is the result, R3 contains the remainder. */ + R0 = ~ R0; + RTS; +#endif + +#ifdef L_umodsi3 +.align 2 +.global ___umodsi3; +.type ___umodsi3, STT_FUNC; + +___umodsi3: + P1 = RETS; + CALL ___udivsi3; + R0 = R3; + RETS = P1; + RTS; +#endif + diff --git a/gcc/config/bfin/predicates.md b/gcc/config/bfin/predicates.md new file mode 100644 index 00000000000..53448844dda --- /dev/null +++ b/gcc/config/bfin/predicates.md @@ -0,0 +1,127 @@ +;; Predicate definitions for the Blackfin. +;; +;; 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. + +;; Return nonzero iff OP is one of the integer constants 1 or 2. +(define_predicate "pos_scale_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 1 || INTVAL (op) == 2"))) + +;; Return nonzero iff OP is one of the integer constants 2 or 4. +(define_predicate "scale_by_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 2 || INTVAL (op) == 4"))) + +;; Return nonzero if OP is a constant that consists of two parts; lower +;; bits all zero and upper bits all ones. In this case, we can perform +;; an AND operation with a sequence of two shifts. Don't return nonzero +;; if the constant would be cheap to load. +(define_predicate "highbits_operand" + (and (match_code "const_int") + (match_test "log2constp (-INTVAL (op)) && !CONST_7BIT_IMM_P (INTVAL (op))"))) + +;; Return nonzero if OP is suitable as a right-hand side operand for an +;; andsi3 operation. +(define_predicate "rhs_andsi3_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "log2constp (~INTVAL (op)) || INTVAL (op) == 255 || INTVAL (op) == 65535")))) + +;; Return nonzero if OP is a register or a constant with exactly one bit +;; set. +(define_predicate "regorlog2_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "log2constp (INTVAL (op))")))) + +;; Like register_operand, but make sure that hard regs have a valid mode. +(define_predicate "valid_reg_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + if (REGNO (op) < FIRST_PSEUDO_REGISTER) + return HARD_REGNO_MODE_OK (REGNO (op), mode); + return 1; +}) + +;; Return nonzero if OP is the CC register. +(define_predicate "cc_operand" + (and (match_code "reg") + (match_test "REGNO (op) == REG_CC && GET_MODE (op) == BImode"))) + +;; Return nonzero if OP is a register or a 7 bit signed constant. +(define_predicate "reg_or_7bit_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "CONST_7BIT_IMM_P (INTVAL (op))")))) + +;; Used for secondary reloads, this function returns 1 if OP is of the +;; form (plus (fp) (const_int)). +(define_predicate "fp_plus_const_operand" + (match_code "plus") +{ + rtx op1, op2; + + op1 = XEXP (op, 0); + op2 = XEXP (op, 1); + return (REG_P (op1) + && (REGNO (op1) == FRAME_POINTER_REGNUM + || REGNO (op1) == STACK_POINTER_REGNUM) + && GET_CODE (op2) == CONST_INT); +}) + +;; Returns 1 if OP is a symbolic operand, i.e. a symbol_ref or a label_ref, +;; possibly with an offset. +(define_predicate "symbolic_operand" + (ior (match_code "symbol_ref,label_ref") + (and (match_code "const") + (match_test "GET_CODE (XEXP (op,0)) == PLUS + && (GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF + || GET_CODE (XEXP (XEXP (op, 0), 0)) == LABEL_REF) + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT")))) + +;; Returns 1 if OP is a plain constant or matched by symbolic_operand. +(define_predicate "symbolic_or_const_operand" + (ior (match_code "const_int,const_double") + (match_operand 0 "symbolic_operand"))) + +;; True for any non-virtual or eliminable register. Used in places where +;; instantiation of such a register may cause the pattern to not be recognized. +(define_predicate "register_no_elim_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + return !(op == arg_pointer_rtx + || op == frame_pointer_rtx + || (REGNO (op) >= FIRST_PSEUDO_REGISTER + && REGNO (op) <= LAST_VIRTUAL_REGISTER)); +}) + +;; Test for a valid operand for a call instruction. Don't allow the +;; arg pointer register or virtual regs since they may decay into +;; reg + const, which the patterns can't handle. +;; We only allow SYMBOL_REF if !flag_pic. +(define_predicate "call_insn_operand" + (ior (and (match_test "!flag_pic") (match_code "symbol_ref")) + (match_operand 0 "register_no_elim_operand"))) + +;; Test for an operator valid in a conditional branch +(define_predicate "bfin_cbranch_operator" + (match_code "eq,ne")) diff --git a/gcc/config/bfin/t-bfin b/gcc/config/bfin/t-bfin new file mode 100644 index 00000000000..662dc4c3e60 --- /dev/null +++ b/gcc/config/bfin/t-bfin @@ -0,0 +1,29 @@ +## Target part of the Makefile + +LIB1ASMSRC = bfin/lib1funcs.asm +LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 + +EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o + +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +# This shouldn't be needed here. I added it to the specs file for now, until +# it is fixed in binutils (if it is necessary). +GCC_CFLAGS += -N + +# Assemble startup files. +$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s + +$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s diff --git a/gcc/config/bfin/t-bfin-elf b/gcc/config/bfin/t-bfin-elf new file mode 100644 index 00000000000..662dc4c3e60 --- /dev/null +++ b/gcc/config/bfin/t-bfin-elf @@ -0,0 +1,29 @@ +## Target part of the Makefile + +LIB1ASMSRC = bfin/lib1funcs.asm +LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 + +EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o + +FPBIT = fp-bit.c +DPBIT = dp-bit.c + +dp-bit.c: $(srcdir)/config/fp-bit.c + cat $(srcdir)/config/fp-bit.c > dp-bit.c + +fp-bit.c: $(srcdir)/config/fp-bit.c + echo '#define FLOAT' > fp-bit.c + cat $(srcdir)/config/fp-bit.c >> fp-bit.c + +# This shouldn't be needed here. I added it to the specs file for now, until +# it is fixed in binutils (if it is necessary). +GCC_CFLAGS += -N + +# Assemble startup files. +$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s + +$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES) + $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \ + -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s diff --git a/gcc/config/c4x/c4x-c.c b/gcc/config/c4x/c4x-c.c index 780a12b380f..fa30b439f39 100644 --- a/gcc/config/c4x/c4x-c.c +++ b/gcc/config/c4x/c4x-c.c @@ -57,7 +57,7 @@ static int c4x_parse_pragma (const char *, tree *, tree *); the STRING_CST node of the string. If SECT is null, then this pragma doesn't take a section string. Returns 0 for a good pragma, -1 for a malformed pragma. */ -#define BAD(msgid, arg) do { warning (msgid, arg); return -1; } while (0) +#define BAD(msgid, arg) do { warning (0, msgid, arg); return -1; } while (0) static int c4x_parse_pragma (name, func, sect) @@ -86,7 +86,7 @@ c4x_parse_pragma (name, func, sect) BAD ("missing ')' for '#pragma %s' - ignored", name); if (c_lex (&x) != CPP_EOF) - warning ("junk at end of '#pragma %s'", name); + warning (0, "junk at end of '#pragma %s'", name); *func = f; return 0; diff --git a/gcc/config/c4x/c4x-protos.h b/gcc/config/c4x/c4x-protos.h index 6189f7d201c..536ddb2e707 100644 --- a/gcc/config/c4x/c4x-protos.h +++ b/gcc/config/c4x/c4x-protos.h @@ -274,9 +274,6 @@ extern GTY(()) rtx c4x_compare_op1; /* Operand 1 for comparisons. */ extern enum reg_class c4x_regclass_map[FIRST_PSEUDO_REGISTER]; extern enum machine_mode c4x_caller_save_map[FIRST_PSEUDO_REGISTER]; -extern int c4x_rpts_cycles; /* Max cycles for RPTS. */ -extern int c4x_cpu_version; /* Cpu version C30/31/32/40/44. */ - extern void c4x_pr_CODE_SECTION (struct cpp_reader *); extern void c4x_pr_DATA_SECTION (struct cpp_reader *); extern void c4x_pr_FUNC_IS_PURE (struct cpp_reader *); diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c index 22465fc1873..09985446191 100644 --- a/gcc/config/c4x/c4x.c +++ b/gcc/config/c4x/c4x.c @@ -1,5 +1,6 @@ /* Subroutines for assembler code output on the TMS320C[34]x - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, + 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) @@ -152,9 +153,7 @@ enum machine_mode c4x_caller_save_map[FIRST_PSEUDO_REGISTER] = rtx c4x_compare_op0; rtx c4x_compare_op1; -const char *c4x_rpts_cycles_string; int c4x_rpts_cycles = 0; /* Max. cycles for RPTS. */ -const char *c4x_cpu_version_string; int c4x_cpu_version = 40; /* CPU version C30/31/32/33/40/44. */ /* Pragma definitions. */ @@ -167,6 +166,7 @@ tree interrupt_tree = NULL_TREE; tree naked_tree = NULL_TREE; /* Forward declarations */ +static bool c4x_handle_option (size_t, const char *, int); static int c4x_isr_reg_used_p (unsigned int); static int c4x_leaf_function_p (void); static int c4x_naked_function_p (void); @@ -221,6 +221,13 @@ static tree c4x_gimplify_va_arg_expr (tree, tree, tree *, tree *); #undef TARGET_ASM_EXTERNAL_LIBCALL #define TARGET_ASM_EXTERNAL_LIBCALL c4x_external_libcall +/* Play safe, not the fastest code. */ +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (MASK_ALIASES | MASK_PARALLEL \ + | MASK_PARALLEL_MPY | MASK_RPTB) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION c4x_handle_option + #undef TARGET_ATTRIBUTE_TABLE #define TARGET_ATTRIBUTE_TABLE c4x_attribute_table @@ -258,67 +265,49 @@ static tree c4x_gimplify_va_arg_expr (tree, tree, tree *, tree *); struct gcc_target targetm = TARGET_INITIALIZER; -/* Override command line options. - Called once after all options have been parsed. - Mostly we process the processor - type and sometimes adjust other TARGET_ options. */ +/* Implement TARGET_HANDLE_OPTION. */ -void -c4x_override_options (void) +static bool +c4x_handle_option (size_t code, const char *arg, int value) { - if (c4x_rpts_cycles_string) - c4x_rpts_cycles = atoi (c4x_rpts_cycles_string); - else - c4x_rpts_cycles = 0; - - if (TARGET_C30) - c4x_cpu_version = 30; - else if (TARGET_C31) - c4x_cpu_version = 31; - else if (TARGET_C32) - c4x_cpu_version = 32; - else if (TARGET_C33) - c4x_cpu_version = 33; - else if (TARGET_C40) - c4x_cpu_version = 40; - else if (TARGET_C44) - c4x_cpu_version = 44; - else - c4x_cpu_version = 40; - - /* -mcpu=xx overrides -m40 etc. */ - if (c4x_cpu_version_string) + switch (code) { - const char *p = c4x_cpu_version_string; - - /* Also allow -mcpu=c30 etc. */ - if (*p == 'c' || *p == 'C') - p++; - c4x_cpu_version = atoi (p); - } + case OPT_m30: c4x_cpu_version = 30; return true; + case OPT_m31: c4x_cpu_version = 31; return true; + case OPT_m32: c4x_cpu_version = 32; return true; + case OPT_m33: c4x_cpu_version = 33; return true; + case OPT_m40: c4x_cpu_version = 40; return true; + case OPT_m44: c4x_cpu_version = 44; return true; + + case OPT_mcpu_: + if (arg[0] == 'c' || arg[0] == 'C') + arg++; + value = atoi (arg); + switch (value) + { + case 30: case 31: case 32: case 33: case 40: case 44: + c4x_cpu_version = value; + return true; + } + return false; - target_flags &= ~(C30_FLAG | C31_FLAG | C32_FLAG | C33_FLAG | - C40_FLAG | C44_FLAG); + case OPT_mrpts_: + c4x_rpts_cycles = value; + return true; - switch (c4x_cpu_version) - { - case 30: target_flags |= C30_FLAG; break; - case 31: target_flags |= C31_FLAG; break; - case 32: target_flags |= C32_FLAG; break; - case 33: target_flags |= C33_FLAG; break; - case 40: target_flags |= C40_FLAG; break; - case 44: target_flags |= C44_FLAG; break; default: - warning ("unknown CPU version %d, using 40.\n", c4x_cpu_version); - c4x_cpu_version = 40; - target_flags |= C40_FLAG; + return true; } +} - if (TARGET_C30 || TARGET_C31 || TARGET_C32 || TARGET_C33) - target_flags |= C3X_FLAG; - else - target_flags &= ~C3X_FLAG; +/* Override command line options. + Called once after all options have been parsed. + Mostly we process the processor + type and sometimes adjust other TARGET_ options. */ +void +c4x_override_options (void) +{ /* Convert foo / 8.0 into foo * 0.125, etc. */ set_fast_math_flags (1); @@ -326,6 +315,15 @@ c4x_override_options (void) This provides compatibility with the old -mno-aliases option. */ if (! TARGET_ALIASES && ! flag_argument_noalias) flag_argument_noalias = 1; + + if (!TARGET_C3X) + target_flags |= MASK_MPYI | MASK_DB; + + if (optimize < 2) + target_flags &= ~(MASK_RPTB | MASK_PARALLEL); + + if (!TARGET_PARALLEL) + target_flags &= ~MASK_PARALLEL_MPY; } @@ -4409,16 +4407,8 @@ c4x_external_ref (const char *name) static void c4x_file_start (void) { - int dspversion = 0; - if (TARGET_C30) dspversion = 30; - if (TARGET_C31) dspversion = 31; - if (TARGET_C32) dspversion = 32; - if (TARGET_C33) dspversion = 33; - if (TARGET_C40) dspversion = 40; - if (TARGET_C44) dspversion = 44; - default_file_start (); - fprintf (asm_out_file, "\t.version\t%d\n", dspversion); + fprintf (asm_out_file, "\t.version\t%d\n", c4x_cpu_version); fputs ("\n\t.data\ndata_sec:\n", asm_out_file); } @@ -4496,7 +4486,7 @@ c4x_handle_fntype_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_TYPE) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/c4x/c4x.h b/gcc/config/c4x/c4x.h index 1112ab82736..832ed8e4609 100644 --- a/gcc/config/c4x/c4x.h +++ b/gcc/config/c4x/c4x.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. TMS320C[34]x Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz) and Herman Ten Brugge (Haj.Ten.Brugge@net.HCC.nl). @@ -79,14 +79,6 @@ } \ while (0) -/* Name of the c4x assembler. */ - -#define ASM_PROG "c4x-as" - -/* Name of the c4x linker. */ - -#define LD_PROG "c4x-ld" - /* Define assembler options. */ #define ASM_SPEC "\ @@ -123,186 +115,27 @@ #define ENDFILE_SPEC "" -/* Target compilation option flags. */ - -#define SMALL_MEMORY_FLAG 0x0000001 /* Small memory model. */ -#define MPYI_FLAG 0x0000002 /* Use 24-bit MPYI for C3x. */ -#define FAST_FIX_FLAG 0x0000004 /* Fast fixing of floats. */ -#define RPTS_FLAG 0x0000008 /* Allow use of RPTS. */ -#define C3X_FLAG 0x0000010 /* Emit C3x code. */ -#define TI_FLAG 0x0000020 /* Be compatible with TI assembler. */ -#define PARANOID_FLAG 0x0000040 /* Be paranoid about DP reg. in ISRs. */ -#define MEMPARM_FLAG 0x0000080 /* Pass arguments on stack. */ -#define DEVEL_FLAG 0x0000100 /* Enable features under development. */ -#define RPTB_FLAG 0x0000200 /* Enable repeat block. */ -#define BK_FLAG 0x0000400 /* Use BK as general register. */ -#define DB_FLAG 0x0000800 /* Use decrement and branch for C3x. */ -#define DEBUG_FLAG 0x0001000 /* Enable debugging of GCC. */ -#define HOIST_FLAG 0x0002000 /* Force constants into registers. */ -#define LOOP_UNSIGNED_FLAG 0x0004000 /* Allow unsigned loop counters. */ -#define FORCE_FLAG 0x0008000 /* Force op0 and op1 to be same. */ -#define PRESERVE_FLOAT_FLAG 0x0010000 /* Save all 40 bits for floats. */ -#define PARALLEL_INSN_FLAG 0x0020000 /* Allow parallel insns. */ -#define PARALLEL_MPY_FLAG 0x0040000 /* Allow MPY||ADD, MPY||SUB insns. */ -#define ALIASES_FLAG 0x0080000 /* Assume mem refs possibly aliased. */ - -#define C30_FLAG 0x0100000 /* Emit C30 code. */ -#define C31_FLAG 0x0200000 /* Emit C31 code. */ -#define C32_FLAG 0x0400000 /* Emit C32 code. */ -#define C33_FLAG 0x0800000 /* Emit C33 code. */ -#define C40_FLAG 0x1000000 /* Emit C40 code. */ -#define C44_FLAG 0x2000000 /* Emit C44 code. */ - -/* Run-time compilation parameters selecting different hardware subsets. - - Macro to define tables used to set the flags. - This is a list in braces of triplets in braces, - each pair being { "NAME", VALUE, "DESCRIPTION" } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ -{ { "small", SMALL_MEMORY_FLAG, \ - N_("Small memory model") }, \ - { "big", -SMALL_MEMORY_FLAG, \ - N_("Big memory model") }, \ - { "mpyi", MPYI_FLAG, \ - N_("Use MPYI instruction for C3x") }, \ - { "no-mpyi", -MPYI_FLAG, \ - N_("Do not use MPYI instruction for C3x") }, \ - { "fast-fix", FAST_FIX_FLAG, \ - N_("Use fast but approximate float to integer conversion") }, \ - { "no-fast-fix", -FAST_FIX_FLAG, \ - N_("Use slow but accurate float to integer conversion") }, \ - { "rpts", RPTS_FLAG, \ - N_("Enable use of RTPS instruction") }, \ - { "no-rpts", -RPTS_FLAG, \ - N_("Disable use of RTPS instruction") }, \ - { "rptb", RPTB_FLAG, \ - N_("Enable use of RTPB instruction") }, \ - { "no-rptb", -RPTB_FLAG, \ - N_("Disable use of RTPB instruction") }, \ - { "30", C30_FLAG, \ - N_("Generate code for C30 CPU")}, \ - { "31", C31_FLAG, \ - N_("Generate code for C31 CPU")}, \ - { "32", C32_FLAG, \ - N_("Generate code for C32 CPU")}, \ - { "33", C33_FLAG, \ - N_("Generate code for C33 CPU")}, \ - { "40", C40_FLAG, \ - N_("Generate code for C40 CPU")}, \ - { "44", C44_FLAG, \ - N_("Generate code for C44 CPU")}, \ - { "ti", TI_FLAG, \ - N_("Emit code compatible with TI tools")}, \ - { "no-ti", -TI_FLAG, \ - N_("Emit code to use GAS extensions")}, \ - { "paranoid", PARANOID_FLAG, \ - N_("Save DP across ISR in small memory model") }, \ - { "no-paranoid", -PARANOID_FLAG, \ - N_("Don't save DP across ISR in small memory model") }, \ - { "isr-dp-reload", PARANOID_FLAG, \ - N_("Save DP across ISR in small memory model") }, \ - { "no-isr-dp-reload", -PARANOID_FLAG, \ - N_("Don't save DP across ISR in small memory model") }, \ - { "memparm", MEMPARM_FLAG, \ - N_("Pass arguments on the stack") }, \ - { "regparm", -MEMPARM_FLAG, \ - N_("Pass arguments in registers") }, \ - { "devel", DEVEL_FLAG, \ - N_("Enable new features under development") }, \ - { "no-devel", -DEVEL_FLAG, \ - N_("Disable new features under development") }, \ - { "bk", BK_FLAG, \ - N_("Use the BK register as a general purpose register") }, \ - { "no-bk", -BK_FLAG, \ - N_("Do not allocate BK register") }, \ - { "db", DB_FLAG, \ - N_("Enable use of DB instruction") }, \ - { "no-db", -DB_FLAG, \ - N_("Disable use of DB instruction") }, \ - { "debug", DEBUG_FLAG, \ - N_("Enable debugging") }, \ - { "no-debug", -DEBUG_FLAG, \ - N_("Disable debugging") }, \ - { "hoist", HOIST_FLAG, \ - N_("Force constants into registers to improve hoisting") }, \ - { "no-hoist", -HOIST_FLAG, \ - N_("Don't force constants into registers") }, \ - { "force", FORCE_FLAG, \ - N_("Force RTL generation to emit valid 3 operand insns") }, \ - { "no-force", -FORCE_FLAG, \ - N_("Allow RTL generation to emit invalid 3 operand insns") }, \ - { "loop-unsigned", LOOP_UNSIGNED_FLAG, \ - N_("Allow unsigned iteration counts for RPTB/DB") }, \ - { "no-loop-unsigned", -LOOP_UNSIGNED_FLAG, \ - N_("Disallow unsigned iteration counts for RPTB/DB") }, \ - { "preserve-float", PRESERVE_FLOAT_FLAG, \ - N_("Preserve all 40 bits of FP reg across call") }, \ - { "no-preserve-float", -PRESERVE_FLOAT_FLAG, \ - N_("Only preserve 32 bits of FP reg across call") }, \ - { "parallel-insns", PARALLEL_INSN_FLAG, \ - N_("Enable parallel instructions") }, \ - { "no-parallel-insns", -PARALLEL_INSN_FLAG, \ - N_("Disable parallel instructions") }, \ - { "parallel-mpy", PARALLEL_MPY_FLAG, \ - N_("Enable MPY||ADD and MPY||SUB instructions") }, \ - { "no-parallel-mpy", -PARALLEL_MPY_FLAG, \ - N_("Disable MPY||ADD and MPY||SUB instructions") }, \ - { "aliases", ALIASES_FLAG, \ - N_("Assume that pointers may be aliased") }, \ - { "no-aliases", -ALIASES_FLAG, \ - N_("Assume that pointers not aliased") }, \ - { "", TARGET_DEFAULT, ""} } - -/* Default target switches. */ - -/* Play safe, not the fastest code. */ -#define TARGET_DEFAULT ALIASES_FLAG | PARALLEL_INSN_FLAG \ - | PARALLEL_MPY_FLAG | RPTB_FLAG - /* Caveats: Max iteration count for RPTB/RPTS is 2^31 + 1. Max iteration count for DB is 2^31 + 1 for C40, but 2^23 + 1 for C30. RPTS blocks interrupts. */ -extern int target_flags; +extern int c4x_rpts_cycles; /* Max cycles for RPTS. */ +extern int c4x_cpu_version; /* Cpu version C30/31/32/33/40/44. */ #define TARGET_INLINE (! optimize_size) /* Inline MPYI. */ #define TARGET_SMALL_REG_CLASS 0 -#define TARGET_SMALL (target_flags & SMALL_MEMORY_FLAG) -#define TARGET_MPYI (!TARGET_C3X || (target_flags & MPYI_FLAG)) -#define TARGET_FAST_FIX (target_flags & FAST_FIX_FLAG) -#define TARGET_RPTS (target_flags & RPTS_FLAG) -#define TARGET_TI (target_flags & TI_FLAG) -#define TARGET_PARANOID (target_flags & PARANOID_FLAG) -#define TARGET_MEMPARM (target_flags & MEMPARM_FLAG) -#define TARGET_DEVEL (target_flags & DEVEL_FLAG) -#define TARGET_RPTB (target_flags & RPTB_FLAG \ - && optimize >= 2) -#define TARGET_BK (target_flags & BK_FLAG) -#define TARGET_DB (! TARGET_C3X || (target_flags & DB_FLAG)) -#define TARGET_DEBUG (target_flags & DEBUG_FLAG) -#define TARGET_HOIST (target_flags & HOIST_FLAG) -#define TARGET_LOOP_UNSIGNED (target_flags & LOOP_UNSIGNED_FLAG) -#define TARGET_FORCE (target_flags & FORCE_FLAG) -#define TARGET_PRESERVE_FLOAT (target_flags & PRESERVE_FLOAT_FLAG) -#define TARGET_PARALLEL ((target_flags & PARALLEL_INSN_FLAG) \ - && optimize >= 2) -#define TARGET_PARALLEL_MPY (TARGET_PARALLEL \ - && (target_flags & PARALLEL_MPY_FLAG)) -#define TARGET_ALIASES (target_flags & ALIASES_FLAG) - -#define TARGET_C3X (target_flags & C3X_FLAG) -#define TARGET_C30 (target_flags & C30_FLAG) -#define TARGET_C31 (target_flags & C31_FLAG) -#define TARGET_C32 (target_flags & C32_FLAG) -#define TARGET_C33 (target_flags & C33_FLAG) -#define TARGET_C40 (target_flags & C40_FLAG) -#define TARGET_C44 (target_flags & C44_FLAG) +#define TARGET_C3X (c4x_cpu_version >= 30 \ + && c4x_cpu_version <= 39) + +#define TARGET_C30 (c4x_cpu_version == 30) +#define TARGET_C31 (c4x_cpu_version == 31) +#define TARGET_C32 (c4x_cpu_version == 32) +#define TARGET_C33 (c4x_cpu_version == 33) +#define TARGET_C40 (c4x_cpu_version == 40) +#define TARGET_C44 (c4x_cpu_version == 44) /* Nonzero to use load_immed_addr pattern rather than forcing memory addresses into memory. */ @@ -321,16 +154,6 @@ extern int target_flags; #define TARGET_RPTS_CYCLES(CYCLES) (TARGET_RPTS || (CYCLES) < c4x_rpts_cycles) -/* -mcpu=XX with XX = target DSP version number. */ - -extern const char *c4x_rpts_cycles_string, *c4x_cpu_version_string; - -#define TARGET_OPTIONS \ -{ {"rpts=", &c4x_rpts_cycles_string, \ - N_("Specify maximum number of iterations for RPTS"), 0}, \ - {"cpu=", &c4x_cpu_version_string, \ - N_("Select CPU to generate code for"), 0} } - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if diff --git a/gcc/config/c4x/c4x.opt b/gcc/config/c4x/c4x.opt new file mode 100644 index 00000000000..a135e632fe4 --- /dev/null +++ b/gcc/config/c4x/c4x.opt @@ -0,0 +1,140 @@ +; Options for the TMS320C[34]x port of the compiler. + +; Copyright (C) 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. + +m30 +Target RejectNegative +Generate code for C30 CPU + +m31 +Target RejectNegative +Generate code for C31 CPU + +m32 +Target RejectNegative +Generate code for C32 CPU + +m33 +Target RejectNegative +Generate code for C33 CPU + +m40 +Target RejectNegative +Generate code for C40 CPU + +m44 +Target RejectNegative +Generate code for C44 CPU + +maliases +Target Report Mask(ALIASES) +Assume that pointers may be aliased + +mbig +Target RejectNegative Report InverseMask(SMALL) +Big memory model + +mbk +Target Report Mask(BK) +Use the BK register as a general purpose register + +mcpu= +Target RejectNegative Joined +-mcpu=CPU Generate code for CPU + +mdb +Target Report Mask(DB) +Enable use of DB instruction + +mdebug +Target Report Mask(DEBUG) +Enable debugging + +mdevel +Target Report Mask(DEVEL) +Enable new features under development + +mfast-fix +Target Report Mask(FAST_FIX) +Use fast but approximate float to integer conversion + +mforce +Target Report Mask(FORCE) +Force RTL generation to emit valid 3 operand insns + +mhoist +Target Report Mask(HOIST) +Force constants into registers to improve hoisting + +misr-dp-reload +Target Mask(PARANOID) MaskExists +Save DP across ISR in small memory model + +mloop-unsigned +Target Report Mask(LOOP_UNSIGNED) +Allow unsigned iteration counts for RPTB/DB + +mmemparm +Target RejectNegative Report Mask(MEMPARM) +Pass arguments on the stack + +mmpyi +Target Report Mask(MPYI) +Use MPYI instruction for C3x + +mparallel-insns +Target Report Mask(PARALLEL) +Enable parallel instructions + +mparallel-mpy +Target Report Mask(PARALLEL_MPY) +Enable MPY||ADD and MPY||SUB instructions + +mparanoid +Target Report Mask(PARANOID) +Save DP across ISR in small memory model + +mpreserve-float +Target Report Mask(PRESERVE_FLOAT) +Preserve all 40 bits of FP reg across call + +mregparm +Target RejectNegative Report InverseMask(MEMPARM) +Pass arguments in registers + +mrptb +Target Report Mask(RPTB) +Enable use of RTPB instruction + +mrpts +Target Report Mask(RPTS) +Enable use of RTPS instruction + +mrpts= +Target RejectNegative Joined UInteger +-mrpts=N Set the maximum number of iterations for RPTS to N + +msmall +Target RejectNegative Report Mask(SMALL) +Small memory model + +mti +Target Report Mask(TI) +Emit code compatible with TI tools diff --git a/gcc/config/cris/aout.h b/gcc/config/cris/aout.h index 18e8eb93325..0b6e61e3cf1 100644 --- a/gcc/config/cris/aout.h +++ b/gcc/config/cris/aout.h @@ -74,22 +74,35 @@ Boston, MA 02111-1307, USA. */ %{static:-Bstatic}}\ %{melinux-stacksize=*:-defsym __Stacksize=%*}" -#undef CRIS_SUBTARGET_SWITCHES -#define CRIS_SUBTARGET_SWITCHES \ - {"elinux", (TARGET_MASK_SVINTO \ - + TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN \ - + TARGET_MASK_ETRAX4_ADD \ - + TARGET_MASK_ALIGN_BY_32), \ - N_("Compile for the MMU-less Etrax 100-based elinux system")}, \ - /* Legacy option. */ \ - {"aout", 0, ""}, - -#undef CRIS_SUBTARGET_LONG_OPTIONS -#define CRIS_SUBTARGET_LONG_OPTIONS \ - {"elinux-stacksize=", &cris_elinux_stacksize_str, \ - N_("For elinux, request a specified stack-size for this program"), 0}, \ +/* Previously controlled by target_flags. */ +#undef TARGET_ELF +#define TARGET_ELF 0 + +#undef CRIS_SUBTARGET_HANDLE_OPTION +#define CRIS_SUBTARGET_HANDLE_OPTION(CODE, ARG, VALUE) \ + do \ + { \ + switch (CODE) \ + { \ + case OPT_melinux: \ + target_flags \ + |= (MASK_SVINTO \ + + MASK_STACK_ALIGN \ + + MASK_CONST_ALIGN \ + + MASK_DATA_ALIGN \ + + MASK_ETRAX4_ADD \ + + MASK_ALIGN_BY_32); \ + break; \ + \ + case OPT_melinux_stacksize_: \ + cris_elinux_stacksize_str = (ARG); \ + break; \ + \ + default: \ + break; \ + } \ + } \ + while (0) #undef CRIS_SUBTARGET_VERSION #define CRIS_SUBTARGET_VERSION " - a.out" diff --git a/gcc/config/cris/aout.opt b/gcc/config/cris/aout.opt new file mode 100644 index 00000000000..f51dc2e68fc --- /dev/null +++ b/gcc/config/cris/aout.opt @@ -0,0 +1,32 @@ +; a.out-specific options for the CRIS port of the compiler. + +; Copyright (C) 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. + +; Legacy option. +maout +Target Report RejectNegative Undocumented + +melinux +Target Report RejectNegative +Compile for the MMU-less Etrax 100-based elinux system + +melinux-stacksize= +Target Report RejectNegative Joined +-melinux-stacksize=SIZE For elinux, request a specified stack-size for this program diff --git a/gcc/config/cris/cris-protos.h b/gcc/config/cris/cris-protos.h index e47327ffb1e..23911c0f130 100644 --- a/gcc/config/cris/cris-protos.h +++ b/gcc/config/cris/cris-protos.h @@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */ #endif extern void cris_conditional_register_usage (void); -extern int cris_simple_epilogue (void); +extern bool cris_simple_epilogue (void); #ifdef RTX_CODE extern const char *cris_op_str (rtx); extern void cris_notice_update_cc (rtx, rtx); @@ -41,15 +41,21 @@ extern int cris_legitimate_pic_operand (rtx); extern int cris_gotless_symbol (rtx); extern int cris_got_symbol (rtx); extern int cris_symbol (rtx); +extern bool cris_store_multiple_op_p (rtx); +extern bool cris_movem_load_rest_p (rtx, int); extern void cris_asm_output_symbol_ref (FILE *, rtx); extern bool cris_output_addr_const_extra (FILE *, rtx); extern int cris_cfun_uses_pic_table (void); +extern rtx cris_gen_movem_load (rtx, rtx, int); +extern rtx cris_emit_movem_store (rtx, rtx, int, bool); #endif /* RTX_CODE */ extern void cris_asm_output_label_ref (FILE *, char *); extern void cris_target_asm_named_section (const char *, unsigned int, tree); - -extern int cris_return_address_on_stack (void); - +extern void cris_expand_prologue (void); +extern void cris_expand_epilogue (void); +extern void cris_expand_return (bool); +extern bool cris_return_address_on_stack_for_return (void); +extern bool cris_return_address_on_stack (void); extern void cris_pragma_expand_mul (struct cpp_reader *); /* Need one that returns an int; usable in expressions. */ diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index a4c61b41e61..81e3ce6fb39 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -51,14 +51,10 @@ Boston, MA 02111-1307, USA. */ #define ADDITIVE_SIZE_MODIFIER(size) \ ((size) <= 63 ? "q" : (size) <= 255 ? "u.b" : (size) <= 65535 ? "u.w" : ".d") -#define ASSERT_PLT_UNSPEC(x) \ - do \ - { \ - if (XEXP (x, 1) != NULL_RTX \ - || (GET_CODE (XVECEXP (x, 0, 0)) != SYMBOL_REF \ - && GET_CODE (XVECEXP (x, 0, 0)) != LABEL_REF)) \ - abort (); \ - } while (0) +#define ASSERT_PLT_UNSPEC(x) \ + CRIS_ASSERT (XINT (x, 1) == CRIS_UNSPEC_PLT \ + && ((GET_CODE (XVECEXP (x, 0, 0)) == SYMBOL_REF) \ + || GET_CODE (XVECEXP (x, 0, 0)) == LABEL_REF)) #define LOSE_AND_RETURN(msgid, x) \ do \ @@ -67,10 +63,19 @@ Boston, MA 02111-1307, USA. */ return; \ } while (0) +enum cris_retinsn_type + { CRIS_RETINSN_UNKNOWN = 0, CRIS_RETINSN_RET, CRIS_RETINSN_JUMP }; + /* Per-function machine data. */ struct machine_function GTY(()) { int needs_return_address_on_stack; + + /* This is the number of registers we save in the prologue due to + stdarg. */ + int stdarg_regs; + + enum cris_retinsn_type return_type; }; /* This little fix suppresses the 'u' or 's' when '%e' in assembly @@ -107,12 +112,10 @@ static int cris_initial_frame_pointer_offset (void); static int saved_regs_mentioned (rtx); -static void cris_target_asm_function_prologue (FILE *, HOST_WIDE_INT); - -static void cris_target_asm_function_epilogue (FILE *, HOST_WIDE_INT); - static void cris_operand_lossage (const char *, rtx); +static int cris_reg_saved_in_regsave_area (unsigned int, bool); + static void cris_asm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); @@ -125,7 +128,9 @@ static bool cris_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); static int cris_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); -static tree cris_md_asm_clobbers (tree); +static tree cris_md_asm_clobbers (tree, tree, tree); + +static bool cris_handle_option (size_t, const char *, int); /* This is the argument from the "-max-stack-stackframe=" option. */ const char *cris_max_stackframe_str; @@ -165,12 +170,6 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #undef TARGET_ASM_UNALIGNED_DI_OP #define TARGET_ASM_UNALIGNED_DI_OP TARGET_ASM_ALIGNED_DI_OP -#undef TARGET_ASM_FUNCTION_PROLOGUE -#define TARGET_ASM_FUNCTION_PROLOGUE cris_target_asm_function_prologue - -#undef TARGET_ASM_FUNCTION_EPILOGUE -#define TARGET_ASM_FUNCTION_EPILOGUE cris_target_asm_function_epilogue - #undef TARGET_ASM_OUTPUT_MI_THUNK #define TARGET_ASM_OUTPUT_MI_THUNK cris_asm_output_mi_thunk #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK @@ -199,277 +198,203 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION; #define TARGET_ARG_PARTIAL_BYTES cris_arg_partial_bytes #undef TARGET_MD_ASM_CLOBBERS #define TARGET_MD_ASM_CLOBBERS cris_md_asm_clobbers +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION cris_handle_option struct gcc_target targetm = TARGET_INITIALIZER; -/* Predicate functions. */ +/* Helper for cris_load_multiple_op and cris_ret_movem_op. */ -/* This checks a part of an address, the one that is not a plain register - for an addressing mode using BDAP. - Allowed operands is either: - a) a register - b) a CONST operand (but not a symbol when generating PIC) - c) a [r] or [r+] in SImode, or sign-extend from HI or QI. */ - -int -cris_bdap_operand (rtx op, enum machine_mode mode) +bool +cris_movem_load_rest_p (rtx op, int offs) { - register enum rtx_code code = GET_CODE (op); - - if (mode != SImode && (mode != VOIDmode || GET_MODE (op) != VOIDmode)) - return 0; - - /* Just return whether this is a simple register or constant. */ - if (register_operand (op, mode) - || (CONSTANT_P (op) && !(flag_pic && cris_symbol (op)))) - return 1; - - /* Is it a [r] or possibly a [r+]? */ - if (code == MEM) - { - rtx tem = XEXP (op, 0); - - if (mode == SImode - && (register_operand (tem, SImode) - || (GET_CODE (tem) == POST_INC - && register_operand (XEXP (tem, 0), SImode)))) - return 1; - else - return 0; - } - - /* Perhaps a sign-extended mem: [r].(b|w) or [r+].(b|w)? */ - if (code == SIGN_EXTEND) + unsigned int reg_count = XVECLEN (op, 0) - offs; + rtx src_addr; + int i; + rtx elt; + int setno; + int regno_dir = 1; + unsigned int regno = 0; + + /* Perform a quick check so we don't blow up below. FIXME: Adjust for + other than (MEM reg). */ + if (reg_count <= 1 + || GET_CODE (XVECEXP (op, 0, offs)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, offs))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, offs))) != MEM) + return false; + + /* Check a possible post-inc indicator. */ + if (GET_CODE (SET_SRC (XVECEXP (op, 0, offs + 1))) == PLUS) { - rtx tem = XEXP (op, 0); - - if (GET_CODE (tem) != MEM) - return 0; - - tem = XEXP (tem, 0); - if (mode == SImode - && (register_operand (tem, SImode) - || (GET_CODE (tem) == POST_INC - && register_operand (XEXP (tem, 0), SImode)))) - return 1; - else - return 0; + rtx reg = XEXP (SET_SRC (XVECEXP (op, 0, offs + 1)), 0); + rtx inc = XEXP (SET_SRC (XVECEXP (op, 0, offs + 1)), 1); + + reg_count--; + + if (reg_count == 1 + || !REG_P (reg) + || !REG_P (SET_DEST (XVECEXP (op, 0, offs + 1))) + || REGNO (reg) != REGNO (SET_DEST (XVECEXP (op, 0, offs + 1))) + || GET_CODE (inc) != CONST_INT + || INTVAL (inc) != (HOST_WIDE_INT) reg_count * 4) + return false; + i = offs + 2; } + else + i = offs + 1; - return 0; -} - -/* This is similar to cris_bdap_operand: - It checks a part of an address, the one that is not a plain register - for an addressing mode using BDAP *or* BIAP. - Allowed operands is either: - a) a register - b) a CONST operand (but not a symbol when generating PIC) - c) a mult of (1, 2 or 4) and a register - d) a [r] or [r+] in SImode, or sign-extend from HI or QI. */ - -int -cris_bdap_biap_operand (rtx op, enum machine_mode mode) -{ - register enum rtx_code code = GET_CODE (op); - rtx reg; - rtx val; - - /* Check for bdap operand. */ - if (cris_bdap_operand (op, mode)) - return 1; + /* FIXME: These two only for pre-v32. */ + regno_dir = -1; + regno = reg_count - 1; - if (mode != SImode && (mode != VOIDmode || GET_MODE (op) != VOIDmode)) - return 0; + elt = XVECEXP (op, 0, offs); + src_addr = XEXP (SET_SRC (elt), 0); - /* Check that we're looking at a BIAP operand. */ - if (code != MULT) - return 0; + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != SImode + || REGNO (SET_DEST (elt)) != regno + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != SImode + || !memory_address_p (SImode, src_addr)) + return false; - /* Canonicalize register and multiplicand. */ - if (GET_CODE (XEXP (op, 0)) == CONST_INT) - { - val = XEXP (op, 0); - reg = XEXP (op, 1); - } - else + for (setno = 1; i < XVECLEN (op, 0); setno++, i++) { - val = XEXP (op, 1); - reg = XEXP (op, 0); + rtx elt = XVECEXP (op, 0, i); + regno += regno_dir; + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != SImode + || REGNO (SET_DEST (elt)) != regno + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != SImode + || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) + || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != setno * 4) + return false; } - /* Check that the operands are correct after canonicalization. */ - if (! register_operand (reg, SImode) || GET_CODE (val) != CONST_INT) - return 0; - - /* Check that the multiplicand has a valid value. */ - if ((code == MULT - && (INTVAL (val) == 1 || INTVAL (val) == 2 || INTVAL (val) == 4))) - return 1; - - return 0; -} - -/* Check if MODE is same as mode for X, and X is PLUS, MINUS, IOR or - AND or UMIN. */ - -int -cris_orthogonal_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (mode == VOIDmode) - mode = GET_MODE (x); - - return (GET_MODE (x) == mode - && (code == PLUS || code == MINUS - || code == IOR || code == AND || code == UMIN)); -} - -/* Check if MODE is same as mode for X, and X is PLUS, IOR or AND or - UMIN. */ - -int -cris_commutative_orth_op (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (mode == VOIDmode) - mode = GET_MODE (x); - - return (GET_MODE (x) == mode && - (code == PLUS - || code == IOR || code == AND || code == UMIN)); -} - -/* Check if MODE is same as mode for X, and X is PLUS or MINUS or UMIN. - By the name, you might think we should include MULT. We don't because - it doesn't accept the same addressing modes as the others (ony - registers) and there's also the problem of handling TARGET_MUL_BUG. */ - -int -cris_operand_extend_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (mode == VOIDmode) - mode = GET_MODE (x); - - return (GET_MODE (x) == mode - && (code == PLUS || code == MINUS || code == UMIN)); -} - -/* Check if MODE is same as mode for X, and X is PLUS or MINUS. */ - -int -cris_additive_operand_extend_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (mode == VOIDmode) - mode = GET_MODE (x); - - return (GET_MODE (x) == mode - && (code == PLUS || code == MINUS)); -} - -/* Check to see if MODE is same as mode for X, and X is SIGN_EXTEND or - ZERO_EXTEND. */ - -int -cris_extend_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (mode == VOIDmode) - mode = GET_MODE (x); - - return - (GET_MODE (x) == mode && (code == SIGN_EXTEND || code == ZERO_EXTEND)); -} - -/* Check to see if MODE is same as mode for X, and X is PLUS or BOUND. */ - -int -cris_plus_or_bound_operator (rtx x, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (x); - - if (mode == VOIDmode) - mode = GET_MODE (x); - - return - (GET_MODE (x) == mode && (code == UMIN || code == PLUS)); + return true; } -/* Used as an operator to get a handle on a already-known-valid MEM rtx:es - (no need to validate the address), where some address expression parts - have their own match_operand. */ +/* Worker function for predicate for the parallel contents in a movem + to-memory. */ -int -cris_mem_op (rtx x, enum machine_mode mode) +bool +cris_store_multiple_op_p (rtx op) { - if (mode == VOIDmode) - mode = GET_MODE (x); - - return GET_MODE (x) == mode && GET_CODE (x) == MEM; -} + int reg_count = XVECLEN (op, 0); + rtx dest; + rtx dest_addr; + rtx dest_base; + int i; + rtx elt; + int setno; + int regno_dir = 1; + int regno = 0; + int offset = 0; -/* Since with -fPIC, not all symbols are valid PIC symbols or indeed - general_operands, we have to have a predicate that matches it for the - "movsi" expander. */ + /* Perform a quick check so we don't blow up below. FIXME: Adjust for + other than (MEM reg) and (MEM (PLUS reg const)). */ + if (reg_count <= 1) + return false; -int -cris_general_operand_or_symbol (rtx op, enum machine_mode mode) -{ - return general_operand (op, mode) - || (CONSTANT_P (op) && cris_symbol (op)); -} + elt = XVECEXP (op, 0, 0); -/* Since a PIC symbol without a GOT entry is not a general_operand, we - have to have a predicate that matches it. We use this in the expanded - "movsi" anonymous pattern for PIC symbols. */ + if (GET_CODE (elt) != SET) + return false; -int -cris_general_operand_or_gotless_symbol (rtx op, enum machine_mode mode) -{ - return general_operand (op, mode) - || (CONSTANT_P (op) && cris_gotless_symbol (op)); -} + dest = SET_DEST (elt); -/* Since a PLT symbol is not a general_operand, we have to have a - predicate that matches it when we need it. We use this in the expanded - "call" and "call_value" anonymous patterns. */ + if (GET_CODE (SET_SRC (elt)) != REG + || GET_CODE (dest) != MEM) + return false; -int -cris_general_operand_or_plt_symbol (rtx op, enum machine_mode mode) -{ - return general_operand (op, mode) - || (GET_CODE (op) == CONST - && GET_CODE (XEXP (op, 0)) == UNSPEC - && !TARGET_AVOID_GOTPLT); -} + dest_addr = XEXP (dest, 0); -/* This matches a (MEM (general_operand)) or - (MEM (cris_general_operand_or_symbol)). The second one isn't a valid - memory_operand, so we need this predicate to recognize call - destinations before we change them to a PLT operand (by wrapping in - UNSPEC 0). */ + /* Check a possible post-inc indicator. */ + if (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) == PLUS) + { + rtx reg = XEXP (SET_SRC (XVECEXP (op, 0, 1)), 0); + rtx inc = XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1); + + reg_count--; + + if (reg_count == 1 + || !REG_P (reg) + || !REG_P (SET_DEST (XVECEXP (op, 0, 1))) + || REGNO (reg) != REGNO (SET_DEST (XVECEXP (op, 0, 1))) + || GET_CODE (inc) != CONST_INT + /* Support increment by number of registers, and by the offset + of the destination, if it has the form (MEM (PLUS reg + offset)). */ + || !((REG_P (dest_addr) + && REGNO (dest_addr) == REGNO (reg) + && INTVAL (inc) == (HOST_WIDE_INT) reg_count * 4) + || (GET_CODE (dest_addr) == PLUS + && REG_P (XEXP (dest_addr, 0)) + && REGNO (XEXP (dest_addr, 0)) == REGNO (reg) + && GET_CODE (XEXP (dest_addr, 1)) == CONST_INT + && INTVAL (XEXP (dest_addr, 1)) == INTVAL (inc)))) + return false; + + i = 2; + } + else + i = 1; -int -cris_mem_call_operand (rtx op, enum machine_mode mode) -{ - rtx xmem; + /* FIXME: These two only for pre-v32. */ + regno_dir = -1; + regno = reg_count - 1; - if (GET_CODE (op) != MEM) - return 0; + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != SImode + || REGNO (SET_SRC (elt)) != (unsigned int) regno + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != SImode) + return false; - if (memory_operand (op, mode)) - return 1; + if (REG_P (dest_addr)) + { + dest_base = dest_addr; + offset = 0; + } + else if (GET_CODE (dest_addr) == PLUS + && REG_P (XEXP (dest_addr, 0)) + && GET_CODE (XEXP (dest_addr, 1)) == CONST_INT) + { + dest_base = XEXP (dest_addr, 0); + offset = INTVAL (XEXP (dest_addr, 1)); + } + else + return false; - xmem = XEXP (op, 0); + for (setno = 1; i < XVECLEN (op, 0); setno++, i++) + { + rtx elt = XVECEXP (op, 0, i); + regno += regno_dir; + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != SImode + || REGNO (SET_SRC (elt)) != (unsigned int) regno + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != SImode + || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_base) + || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != setno * 4 + offset) + return false; + } - return cris_general_operand_or_symbol (xmem, GET_MODE (op)); + return true; } /* The CONDITIONAL_REGISTER_USAGE worker. */ @@ -519,7 +444,7 @@ cris_op_str (rtx x) an operator, for immediate output. If that ever happens for MULT, we need to apply TARGET_MUL_BUG in the caller. Make sure we notice. */ - abort (); + internal_error ("MULT case in cris_op_str"); break; case DIV: @@ -657,293 +582,31 @@ cris_fatal (char *arg) return 0; } -/* This variable belongs to cris_target_asm_function_prologue but must - be located outside it for GTY reasons. */ -static GTY(()) unsigned long cfa_label_num = 0; +/* Return nonzero if REGNO is an ordinary register that *needs* to be + saved together with other registers, possibly by a MOVEM instruction, + or is saved for target-independent reasons. There may be + target-dependent reasons to save the register anyway; this is just a + wrapper for a complicated conditional. */ -/* Textual function prologue. */ - -static void -cris_target_asm_function_prologue (FILE *file, HOST_WIDE_INT size) +static int +cris_reg_saved_in_regsave_area (unsigned int regno, bool got_really_used) { - int regno; - - /* Shorten the used name for readability. */ - int cfoa_size = current_function_outgoing_args_size; - int last_movem_reg = -1; - int doing_dwarf = dwarf2out_do_frame (); - int framesize; - int faked_args_size = 0; - int cfa_write_offset = 0; - static char cfa_label[30]; - int return_address_on_stack - = regs_ever_live[CRIS_SRP_REGNUM] - || cfun->machine->needs_return_address_on_stack != 0; - - /* Don't do anything if no prologues or epilogues are wanted. */ - if (!TARGET_PROLOGUE_EPILOGUE) - return; - - if (size < 0) - abort (); - - /* Align the size to what's best for the CPU model. */ - if (TARGET_STACK_ALIGN) - size = TARGET_ALIGN_BY_32 ? (size + 3) & ~3 : (size + 1) & ~1; - - if (current_function_pretend_args_size) - { - int pretend = current_function_pretend_args_size; - for (regno = CRIS_FIRST_ARG_REG + CRIS_MAX_ARGS_IN_REGS - 1; - pretend > 0; - regno--, pretend -= 4) - { - fprintf (file, "\tpush $%s\n", reg_names[regno]); - faked_args_size += 4; - } - } - - framesize = faked_args_size; - - if (doing_dwarf) - { - /* FIXME: Slightly redundant calculation, as we do the same in - pieces below. This offset must be the total adjustment of the - stack-pointer. We can then def_cfa call at the end of this - function with the current implementation of execute_cfa_insn, but - that wouldn't really be clean. */ - - int cfa_offset - = faked_args_size - + (return_address_on_stack ? 4 : 0) - + (frame_pointer_needed ? 4 : 0); - - int cfa_reg; - - if (frame_pointer_needed) - cfa_reg = FRAME_POINTER_REGNUM; - else - { - cfa_reg = STACK_POINTER_REGNUM; - cfa_offset += cris_initial_frame_pointer_offset (); - } - - ASM_GENERATE_INTERNAL_LABEL (cfa_label, "LCFIT", - cfa_label_num++); - dwarf2out_def_cfa (cfa_label, cfa_reg, cfa_offset); - - cfa_write_offset = - faked_args_size - 4; - } - - /* Save SRP if not a leaf function. */ - if (return_address_on_stack) - { - fprintf (file, "\tPush $srp\n"); - framesize += 4; - - if (doing_dwarf) - { - dwarf2out_return_save (cfa_label, cfa_write_offset); - cfa_write_offset -= 4; - } - } - - /* Set up frame pointer if needed. */ - if (frame_pointer_needed) - { - fprintf (file, "\tpush $%s\n\tmove.d $sp,$%s\n", - reg_names[FRAME_POINTER_REGNUM], - reg_names[FRAME_POINTER_REGNUM]); - framesize += 4; - - if (doing_dwarf) - { - dwarf2out_reg_save (cfa_label, FRAME_POINTER_REGNUM, - cfa_write_offset); - cfa_write_offset -= 4; - } - } - - /* Local vars are located above saved regs. */ - cfa_write_offset -= size; - - /* Get a contiguous sequence of registers, starting with r0, that need - to be saved. */ - for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - { - if ((((regs_ever_live[regno] - && !call_used_regs[regno]) - || (regno == (int) PIC_OFFSET_TABLE_REGNUM - && (current_function_uses_pic_offset_table - /* It is saved anyway, if there would be a gap. */ - || (flag_pic - && regs_ever_live[regno + 1] - && !call_used_regs[regno + 1])))) - && (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed) - && regno != CRIS_SRP_REGNUM) - || (current_function_calls_eh_return - && (regno == EH_RETURN_DATA_REGNO (0) - || regno == EH_RETURN_DATA_REGNO (1) - || regno == EH_RETURN_DATA_REGNO (2) - || regno == EH_RETURN_DATA_REGNO (3)))) - { - /* Check if movem may be used for registers so far. */ - if (regno == last_movem_reg + 1) - /* Yes, update next expected register. */ - last_movem_reg++; - else - { - /* We cannot use movem for all registers. We have to flush - any movem:ed registers we got so far. */ - if (last_movem_reg != -1) - { - /* It is a win to use a side-effect assignment for - 64 <= size <= 128. But side-effect on movem was - not usable for CRIS v0..3. Also only do it if - side-effects insns are allowed. */ - if ((last_movem_reg + 1) * 4 + size >= 64 - && (last_movem_reg + 1) * 4 + size <= 128 - && cris_cpu_version >= CRIS_CPU_SVINTO - && TARGET_SIDE_EFFECT_PREFIXES) - fprintf (file, "\tmovem $%s,[$sp=$sp-"HOST_WIDE_INT_PRINT_DEC"]\n", - reg_names[last_movem_reg], - (last_movem_reg + 1) * 4 + size); - else - { - /* Avoid printing multiple subsequent sub:s for sp. */ - fprintf (file, "\tsub%s "HOST_WIDE_INT_PRINT_DEC",$sp\n", - ADDITIVE_SIZE_MODIFIER ((last_movem_reg + 1) - * 4 + size), - (last_movem_reg + 1) * 4 + size); - - fprintf (file, "\tmovem $%s,[$sp]\n", - reg_names[last_movem_reg]); - } - - framesize += (last_movem_reg + 1) * 4 + size; - - if (TARGET_PDEBUG) - fprintf (file, "; frame "HOST_WIDE_INT_PRINT_DEC - ", #regs %d, bytes %d args %d\n", - size, - last_movem_reg + 1, - (last_movem_reg + 1) * 4, - current_function_args_size); - - last_movem_reg = -1; - size = 0; - } - else if (size > 0) - { - /* Local vars on stack, but there are no movem:s. - Just allocate space. */ - fprintf (file, "\tSub%s "HOST_WIDE_INT_PRINT_DEC",$sp\n", - ADDITIVE_SIZE_MODIFIER (size), - size); - framesize += size; - size = 0; - } - - fprintf (file, "\tPush $%s\n", reg_names[regno]); - framesize += 4; - } - - if (doing_dwarf) - { - /* Registers are stored lowest numbered at highest address, - which matches the loop order; we just need to update the - write-offset. */ - dwarf2out_reg_save (cfa_label, regno, cfa_write_offset); - cfa_write_offset -= 4; - } - } - } - - /* Check after, if we can movem all registers. This is the normal - case. */ - if (last_movem_reg != -1) - { - /* Side-effect assignment on movem was not supported for CRIS v0..3, - and don't do it if we're asked not to. - - The movem is already accounted for, for unwind. */ - - if ((last_movem_reg + 1) * 4 + size >= 64 - && (last_movem_reg + 1) * 4 + size <= 128 - && cris_cpu_version >= CRIS_CPU_SVINTO - && TARGET_SIDE_EFFECT_PREFIXES) - fprintf (file, "\tmovem $%s,[$sp=$sp-"HOST_WIDE_INT_PRINT_DEC"]\n", - reg_names[last_movem_reg], - (last_movem_reg+1) * 4 + size); - else - { - /* Avoid printing multiple subsequent sub:s for sp. FIXME: - Clean up the conditional expression. */ - fprintf (file, "\tsub%s "HOST_WIDE_INT_PRINT_DEC",$sp\n", - ADDITIVE_SIZE_MODIFIER ((last_movem_reg + 1) * 4 + size), - (last_movem_reg + 1) * 4 + size); - /* To be compatible with v0..v3 means we do not use an assignment - addressing mode with movem. We normally don't need that - anyway. It would only be slightly more efficient for 64..128 - bytes frame size. */ - fprintf (file, "\tmovem $%s,[$sp]\n", reg_names[last_movem_reg]); - } - - framesize += (last_movem_reg + 1) * 4 + size; - - if (TARGET_PDEBUG) - fprintf (file, "; frame "HOST_WIDE_INT_PRINT_DEC - ", #regs %d, bytes %d args %d\n", - size, - last_movem_reg + 1, - (last_movem_reg + 1) * 4, - current_function_args_size); - - /* We have to put outgoing argument space after regs. */ - if (cfoa_size) - { - /* This does not need to be accounted for, for unwind. */ - - fprintf (file, "\tSub%s %d,$sp\n", - ADDITIVE_SIZE_MODIFIER (cfoa_size), - cfoa_size); - framesize += cfoa_size; - } - } - else if ((size + cfoa_size) > 0) - { - /* This does not need to be accounted for, for unwind. */ - - /* Local vars on stack, and we could not use movem. Add a sub here. */ - fprintf (file, "\tSub%s "HOST_WIDE_INT_PRINT_DEC",$sp\n", - ADDITIVE_SIZE_MODIFIER (size + cfoa_size), - cfoa_size + size); - framesize += size + cfoa_size; - } - - /* Set up the PIC register. */ - if (current_function_uses_pic_offset_table) - fprintf (file, "\tmove.d $pc,$%s\n\tsub.d .:GOTOFF,$%s\n", - reg_names[PIC_OFFSET_TABLE_REGNUM], - reg_names[PIC_OFFSET_TABLE_REGNUM]); - - if (doing_dwarf) - ASM_OUTPUT_LABEL (file, cfa_label); - - if (TARGET_PDEBUG) - fprintf (file, - "; parm #%d @ %d; frame " HOST_WIDE_INT_PRINT_DEC - ", FP-SP is %d; leaf: %s%s; fp %s, outg: %d arg %d\n", - CRIS_MAX_ARGS_IN_REGS + 1, FIRST_PARM_OFFSET (0), - get_frame_size (), - cris_initial_frame_pointer_offset (), - leaf_function_p () ? "yes" : "no", - return_address_on_stack ? "no" :"yes", - frame_pointer_needed ? "yes" : "no", - cfoa_size, current_function_args_size); - - if (cris_max_stackframe && framesize > cris_max_stackframe) - warning ("stackframe too big: %d bytes", framesize); + return + (((regs_ever_live[regno] + && !call_used_regs[regno]) + || (regno == PIC_OFFSET_TABLE_REGNUM + && (got_really_used + /* It is saved anyway, if there would be a gap. */ + || (flag_pic + && regs_ever_live[regno + 1] + && !call_used_regs[regno + 1])))) + && (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed) + && regno != CRIS_SRP_REGNUM) + || (current_function_calls_eh_return + && (regno == EH_RETURN_DATA_REGNO (0) + || regno == EH_RETURN_DATA_REGNO (1) + || regno == EH_RETURN_DATA_REGNO (2) + || regno == EH_RETURN_DATA_REGNO (3))); } /* Return nonzero if there are regs mentioned in the insn that are not all @@ -997,245 +660,12 @@ saved_regs_mentioned (rtx x) return 0; } -/* Textual function epilogue. */ +/* The PRINT_OPERAND worker. */ -static void -cris_target_asm_function_epilogue (FILE *file, HOST_WIDE_INT size) +void +cris_print_operand (FILE *file, rtx x, int code) { - int regno; - int last_movem_reg = -1; - rtx insn = get_last_insn (); - int argspace_offset = current_function_outgoing_args_size; - int pretend = current_function_pretend_args_size; - int return_address_on_stack - = regs_ever_live[CRIS_SRP_REGNUM] - || cfun->machine->needs_return_address_on_stack != 0; - char save_last[80]; - - save_last[0] = 0; - - if (!TARGET_PROLOGUE_EPILOGUE) - return; - - if (TARGET_PDEBUG) - fprintf (file, ";;\n"); - - /* Align byte count of stack frame. */ - if (TARGET_STACK_ALIGN) - size = TARGET_ALIGN_BY_32 ? (size + 3) & ~3 : (size + 1) & ~1; - - /* If the last insn was a BARRIER, we don't have to write any code, - then all returns were covered by "return" insns. */ - if (GET_CODE (insn) == NOTE) - insn = prev_nonnote_insn (insn); - if (insn - && (GET_CODE (insn) == BARRIER - /* We must make sure that the insn really is a "return" and - not a conditional branch. Try to match the return exactly, - and if it doesn't match, assume it is a conditional branch - (and output an epilogue). */ - || (GET_CODE (insn) == JUMP_INSN - && GET_CODE (PATTERN (insn)) == RETURN))) - { - if (TARGET_PDEBUG) - fprintf (file, ";;;;;\n"); - return; - } - - /* Check how many saved regs we can movem. They start at r0 and must - be contiguous. */ - for (regno = 0; - regno < FIRST_PSEUDO_REGISTER; - regno++) - if ((((regs_ever_live[regno] - && !call_used_regs[regno]) - || (regno == (int) PIC_OFFSET_TABLE_REGNUM - && (current_function_uses_pic_offset_table - /* It is saved anyway, if there would be a gap. */ - || (flag_pic - && regs_ever_live[regno + 1] - && !call_used_regs[regno + 1])))) - && (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed) - && regno != CRIS_SRP_REGNUM) - || (current_function_calls_eh_return - && (regno == EH_RETURN_DATA_REGNO (0) - || regno == EH_RETURN_DATA_REGNO (1) - || regno == EH_RETURN_DATA_REGNO (2) - || regno == EH_RETURN_DATA_REGNO (3)))) - - { - if (regno == last_movem_reg + 1) - last_movem_reg++; - else - break; - } - - for (regno = FIRST_PSEUDO_REGISTER - 1; - regno > last_movem_reg; - regno--) - if ((((regs_ever_live[regno] - && !call_used_regs[regno]) - || (regno == (int) PIC_OFFSET_TABLE_REGNUM - && (current_function_uses_pic_offset_table - /* It is saved anyway, if there would be a gap. */ - || (flag_pic - && regs_ever_live[regno + 1] - && !call_used_regs[regno + 1])))) - && (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed) - && regno != CRIS_SRP_REGNUM) - || (current_function_calls_eh_return - && (regno == EH_RETURN_DATA_REGNO (0) - || regno == EH_RETURN_DATA_REGNO (1) - || regno == EH_RETURN_DATA_REGNO (2) - || regno == EH_RETURN_DATA_REGNO (3)))) - { - if (argspace_offset) - { - /* There is an area for outgoing parameters located before - the saved registers. We have to adjust for that. */ - fprintf (file, "\tAdd%s %d,$sp\n", - ADDITIVE_SIZE_MODIFIER (argspace_offset), - argspace_offset); - - /* Make sure we only do this once. */ - argspace_offset = 0; - } - - /* Flush previous non-movem:ed registers. */ - if (*save_last) - fprintf (file, save_last); - sprintf (save_last, "\tPop $%s\n", reg_names[regno]); - } - - if (last_movem_reg != -1) - { - if (argspace_offset) - { - /* Adjust for the outgoing parameters area, if that's not - handled yet. */ - if (*save_last) - { - fprintf (file, save_last); - *save_last = 0; - } - - fprintf (file, "\tAdd%s %d,$sp\n", - ADDITIVE_SIZE_MODIFIER (argspace_offset), - argspace_offset); - argspace_offset = 0; - } - /* Flush previous non-movem:ed registers. */ - else if (*save_last) - fprintf (file, save_last); - sprintf (save_last, "\tmovem [$sp+],$%s\n", reg_names[last_movem_reg]); - } - - /* Restore frame pointer if necessary. */ - if (frame_pointer_needed) - { - if (*save_last) - fprintf (file, save_last); - - fprintf (file, "\tmove.d $%s,$sp\n", - reg_names[FRAME_POINTER_REGNUM]); - sprintf (save_last, "\tPop $%s\n", - reg_names[FRAME_POINTER_REGNUM]); - } - else - { - /* If there was no frame-pointer to restore sp from, we must - explicitly deallocate local variables. */ - - /* Handle space for outgoing parameters that hasn't been handled - yet. */ - size += argspace_offset; - - if (size) - { - if (*save_last) - fprintf (file, save_last); - - sprintf (save_last, "\tadd%s "HOST_WIDE_INT_PRINT_DEC",$sp\n", - ADDITIVE_SIZE_MODIFIER (size), size); - } - - /* If the size was not in the range for a "quick", we must flush - it here. */ - if (size > 63) - { - fprintf (file, save_last); - *save_last = 0; - } - } - - /* If this function has no pushed register parameters - (stdargs/varargs), and if it is not a leaf function, then we can - just jump-return here. */ - if (return_address_on_stack && pretend == 0) - { - if (*save_last) - fprintf (file, save_last); - *save_last = 0; - - if (current_function_calls_eh_return) - { - /* The installed EH-return address is in *this* frame, so we - need to pop it before we return. */ - fprintf (file, "\tpop $srp\n"); - fprintf (file, "\tret\n"); - fprintf (file, "\tadd.d $%s,$sp\n", reg_names[CRIS_STACKADJ_REG]); - } - else - fprintf (file, "\tJump [$sp+]\n"); - - return; - } - - /* Rather than add current_function_calls_eh_return conditions - everywhere in the following code (and not be able to test it - thoroughly), assert the assumption that all usage of - __builtin_eh_return are handled above. */ - if (current_function_calls_eh_return) - internal_error ("unexpected function type needing stack adjustment for\ - __builtin_eh_return"); - - /* If we pushed some register parameters, then adjust the stack for - them. */ - if (pretend) - { - /* Since srp is stored on the way, we need to restore it first. */ - if (return_address_on_stack) - { - if (*save_last) - fprintf (file, save_last); - *save_last = 0; - - fprintf (file, "\tpop $srp\n"); - } - - if (*save_last) - fprintf (file, save_last); - - sprintf (save_last, "\tadd%s %d,$sp\n", - ADDITIVE_SIZE_MODIFIER (pretend), pretend); - } - - fprintf (file, "\tRet\n"); - - /* If the GCC did not do it, we have to use whatever insn we have, or - a nop. */ - if (*save_last) - fprintf (file, save_last); - else - fprintf (file, "\tnOp\n"); -} - -/* The PRINT_OPERAND worker. */ - -void -cris_print_operand (FILE *file, rtx x, int code) -{ - rtx operand = x; + rtx operand = x; /* Size-strings corresponding to MULT expressions. */ static const char *const mults[] = { "BAD:0", ".b", ".w", "BAD:3", ".d" }; @@ -1272,6 +702,62 @@ cris_print_operand (FILE *file, rtx x, int code) cris_pic_sympart_only--; return; + case 'o': + { + /* A movem modifier working on a parallel; output the register + name. */ + int regno; + + if (GET_CODE (x) != PARALLEL) + LOSE_AND_RETURN ("invalid operand for 'o' modifier", x); + + /* The second item can be (set reg (plus reg const)) to denote a + postincrement. */ + regno + = (GET_CODE (SET_SRC (XVECEXP (x, 0, 1))) == PLUS + ? XVECLEN (x, 0) - 2 + : XVECLEN (x, 0) - 1); + + fprintf (file, "$%s", reg_names [regno]); + } + return; + + case 'O': + { + /* A similar movem modifier; output the memory operand. */ + rtx addr; + + if (GET_CODE (x) != PARALLEL) + LOSE_AND_RETURN ("invalid operand for 'O' modifier", x); + + /* The lowest mem operand is in the first item, but perhaps it + needs to be output as postincremented. */ + addr = GET_CODE (SET_SRC (XVECEXP (x, 0, 0))) == MEM + ? XEXP (SET_SRC (XVECEXP (x, 0, 0)), 0) + : XEXP (SET_DEST (XVECEXP (x, 0, 0)), 0); + + /* The second item can be a (set reg (plus reg const)) to denote + a modification. */ + if (GET_CODE (SET_SRC (XVECEXP (x, 0, 1))) == PLUS) + { + /* It's a post-increment, if the address is a naked (reg). */ + if (REG_P (addr)) + addr = gen_rtx_POST_INC (SImode, addr); + else + { + /* Otherwise, it's a side-effect; RN=RN+M. */ + fprintf (file, "[$%s=$%s%s%d]", + reg_names [REGNO (SET_DEST (XVECEXP (x, 0, 1)))], + reg_names [REGNO (XEXP (addr, 0))], + INTVAL (XEXP (addr, 1)) < 0 ? "" : "+", + (int) INTVAL (XEXP (addr, 1))); + return; + } + } + output_address (addr); + } + return; + case 'P': /* Print the PIC register. Applied to a GOT-less PIC symbol for sanity. */ @@ -1319,7 +805,7 @@ cris_print_operand (FILE *file, rtx x, int code) case 'z': /* Const_int: print b for -127 <= x <= 255, - w for -32768 <= x <= 65535, else abort. */ + w for -32768 <= x <= 65535, else die. */ if (GET_CODE (x) != CONST_INT || INTVAL (x) < -32768 || INTVAL (x) > 65535) LOSE_AND_RETURN ("invalid operand for 'z' modifier", x); @@ -1355,11 +841,10 @@ cris_print_operand (FILE *file, rtx x, int code) switch (GET_CODE (operand)) { case CONST_INT: - if (HOST_BITS_PER_WIDE_INT == 32) - /* Sign-extension from a normal int to a long long. */ - fprintf (file, INTVAL (operand) < 0 ? "-1" : "0"); - else - fprintf (file, "0x%x", (unsigned int)(INTVAL (x) >> 31 >> 1)); + /* If we're having 64-bit HOST_WIDE_INTs, the whole (DImode) + value is kept here, and so may be other than 0 or -1. */ + fprintf (file, HOST_WIDE_INT_PRINT_DEC, + INTVAL (operand_subword (operand, 1, 0, DImode))); return; case CONST_DOUBLE: @@ -1647,10 +1132,21 @@ cris_return_addr_rtx (int count, rtx frameaddr ATTRIBUTE_UNUSED) /* Accessor used in cris.md:return because cfun->machine isn't available there. */ -int -cris_return_address_on_stack () +bool +cris_return_address_on_stack (void) +{ + return regs_ever_live[CRIS_SRP_REGNUM] + || cfun->machine->needs_return_address_on_stack; +} + +/* Accessor used in cris.md:return because cfun->machine isn't available + there. */ + +bool +cris_return_address_on_stack_for_return (void) { - return cfun->machine->needs_return_address_on_stack; + return cfun->machine->return_type == CRIS_RETINSN_RET ? false + : cris_return_address_on_stack (); } /* This used to be the INITIAL_FRAME_POINTER_OFFSET worker; now only @@ -1663,24 +1159,11 @@ cris_initial_frame_pointer_offset (void) /* Initial offset is 0 if we don't have a frame pointer. */ int offs = 0; + bool got_really_used = current_function_uses_pic_offset_table; /* And 4 for each register pushed. */ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - if ((((regs_ever_live[regno] - && !call_used_regs[regno]) - || (regno == (int) PIC_OFFSET_TABLE_REGNUM - && (current_function_uses_pic_offset_table - /* It is saved anyway, if there would be a gap. */ - || (flag_pic - && regs_ever_live[regno + 1] - && !call_used_regs[regno + 1])))) - && (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed) - && regno != CRIS_SRP_REGNUM) - || (current_function_calls_eh_return - && (regno == EH_RETURN_DATA_REGNO (0) - || regno == EH_RETURN_DATA_REGNO (1) - || regno == EH_RETURN_DATA_REGNO (2) - || regno == EH_RETURN_DATA_REGNO (3)))) + if (cris_reg_saved_in_regsave_area (regno, got_really_used)) offs += 4; /* And then, last, we add the locals allocated. */ @@ -1709,9 +1192,7 @@ cris_initial_elimination_offset (int fromreg, int toreg) /* We should be able to use regs_ever_live and related prologue information here, or alpha should not as well. */ - int return_address_on_stack - = regs_ever_live[CRIS_SRP_REGNUM] - || cfun->machine->needs_return_address_on_stack != 0; + bool return_address_on_stack = cris_return_address_on_stack (); /* Here we act as if the frame-pointer were needed. */ int ap_fp_offset = 4 + (return_address_on_stack ? 4 : 0); @@ -1731,7 +1212,7 @@ cris_initial_elimination_offset (int fromreg, int toreg) && toreg == STACK_POINTER_REGNUM) return ap_fp_offset + fp_sp_offset - 4; - abort (); + gcc_unreachable (); } /* This function looks into the pattern to see how this insn affects @@ -1995,23 +1476,22 @@ cris_notice_update_cc (rtx exp, rtx insn) break; default: - /* Unknown cc_attr value. */ - abort (); + internal_error ("Unknown cc_attr value"); } CC_STATUS_INIT; } /* Return != 0 if the return sequence for the current function is short, - like "ret" or "jump [sp+]". Prior to reloading, we can't tell how - many registers must be saved, so return 0 then. */ + like "ret" or "jump [sp+]". Prior to reloading, we can't tell if + registers must be saved, so return 0 then. */ -int +bool cris_simple_epilogue (void) { - int regno; - int reglimit = STACK_POINTER_REGNUM; - int lastreg = -1; + unsigned int regno; + unsigned int reglimit = STACK_POINTER_REGNUM; + bool got_really_used = current_function_uses_pic_offset_table; if (! reload_completed || frame_pointer_needed @@ -2024,25 +1504,35 @@ cris_simple_epilogue (void) /* If we're not supposed to emit prologue and epilogue, we must not emit return-type instructions. */ || !TARGET_PROLOGUE_EPILOGUE) - return 0; + return false; - /* We allow a "movem [sp+],rN" to sit in front if the "jump [sp+]" or - in the delay-slot of the "ret". */ + /* No simple epilogue if there are saved registers. */ for (regno = 0; regno < reglimit; regno++) - if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (regno == (int) PIC_OFFSET_TABLE_REGNUM - && (current_function_uses_pic_offset_table - /* It is saved anyway, if there would be a gap. */ - || (flag_pic - && regs_ever_live[regno + 1] - && !call_used_regs[regno + 1])))) - { - if (lastreg != regno - 1) - return 0; - lastreg = regno; - } + if (cris_reg_saved_in_regsave_area (regno, got_really_used)) + return false; - return 1; + return true; +} + +/* Expand a return insn (just one insn) marked as using SRP or stack + slot depending on parameter ON_STACK. */ + +void +cris_expand_return (bool on_stack) +{ + /* FIXME: emit a parallel with a USE for SRP or the stack-slot, to + tell "ret" from "jump [sp+]". Some, but not all, other parts of + GCC expect just (return) to do the right thing when optimizing, so + we do that until they're fixed. Currently, all return insns in a + function must be the same (not really a limiting factor) so we need + to check that it doesn't change half-way through. */ + emit_jump_insn (gen_rtx_RETURN (VOIDmode)); + + CRIS_ASSERT (cfun->machine->return_type != CRIS_RETINSN_RET || !on_stack); + CRIS_ASSERT (cfun->machine->return_type != CRIS_RETINSN_JUMP || on_stack); + + cfun->machine->return_type + = on_stack ? CRIS_RETINSN_JUMP : CRIS_RETINSN_RET; } /* Compute a (partial) cost for rtx X. Return true if the complete @@ -2405,6 +1895,8 @@ cris_symbol (rtx x) return 1; case UNSPEC: + if (XINT (x, 1) == CRIS_UNSPEC_GOT || XINT (x, 1) != CRIS_UNSPEC_PLT) + return 0; /* A PLT reference. */ ASSERT_PLT_UNSPEC (x); return 1; @@ -2435,14 +1927,15 @@ cris_symbol (rtx x) int cris_gotless_symbol (rtx x) { -#ifdef ENABLE_CHECKING - if (!flag_pic) - abort (); -#endif + CRIS_ASSERT (flag_pic); switch (GET_CODE (x)) { case UNSPEC: + if (XINT (x, 1) == CRIS_UNSPEC_GOT) + return 1; + if (XINT (x, 1) != CRIS_UNSPEC_PLT) + return 0; ASSERT_PLT_UNSPEC (x); return 1; @@ -2494,14 +1987,13 @@ cris_gotless_symbol (rtx x) int cris_got_symbol (rtx x) { -#ifdef ENABLE_CHECKING - if (!flag_pic) - abort (); -#endif + CRIS_ASSERT (flag_pic); switch (GET_CODE (x)) { case UNSPEC: + if (XINT (x, 1) == CRIS_UNSPEC_GOT) + return 0; ASSERT_PLT_UNSPEC (x); return 0; @@ -2533,6 +2025,77 @@ cris_got_symbol (rtx x) return 1; } +/* TARGET_HANDLE_OPTION worker. We just store the values into local + variables here. Checks for correct semantics are in + cris_override_options. */ + +static bool +cris_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_metrax100: + target_flags + |= (MASK_SVINTO + + MASK_ETRAX4_ADD + + MASK_ALIGN_BY_32); + break; + + case OPT_mno_etrax100: + target_flags + &= ~(MASK_SVINTO + + MASK_ETRAX4_ADD + + MASK_ALIGN_BY_32); + break; + + case OPT_m32_bit: + case OPT_m32bit: + target_flags + |= (MASK_STACK_ALIGN + + MASK_CONST_ALIGN + + MASK_DATA_ALIGN + + MASK_ALIGN_BY_32); + break; + + case OPT_m16_bit: + case OPT_m16bit: + target_flags + |= (MASK_STACK_ALIGN + + MASK_CONST_ALIGN + + MASK_DATA_ALIGN); + break; + + case OPT_m8_bit: + case OPT_m8bit: + target_flags + &= ~(MASK_STACK_ALIGN + + MASK_CONST_ALIGN + + MASK_DATA_ALIGN); + break; + + case OPT_max_stackframe_: + case OPT_mmax_stackframe_: + cris_max_stackframe_str = arg; + break; + + case OPT_march_: + case OPT_mcpu_: + cris_cpu_str = arg; + break; + + case OPT_mtune_: + cris_tune_str = arg; + break; + + default: + break; + } + + CRIS_SUBTARGET_HANDLE_OPTION(code, arg, value); + + return true; +} + /* The OVERRIDE_OPTIONS worker. As is the norm, this also parses -mfoo=bar type parameters. */ @@ -2578,14 +2141,14 @@ cris_override_options (void) /* Set the target flags. */ if (cris_cpu_version >= CRIS_CPU_ETRAX4) - target_flags |= TARGET_MASK_ETRAX4_ADD; + target_flags |= MASK_ETRAX4_ADD; /* If this is Svinto or higher, align for 32 bit accesses. */ if (cris_cpu_version >= CRIS_CPU_SVINTO) target_flags - |= (TARGET_MASK_SVINTO | TARGET_MASK_ALIGN_BY_32 - | TARGET_MASK_STACK_ALIGN | TARGET_MASK_CONST_ALIGN - | TARGET_MASK_DATA_ALIGN); + |= (MASK_SVINTO | MASK_ALIGN_BY_32 + | MASK_STACK_ALIGN | MASK_CONST_ALIGN + | MASK_DATA_ALIGN); /* Note that we do not add new flags when it can be completely described with a macro that uses -mcpu=X. So @@ -2616,8 +2179,8 @@ cris_override_options (void) /* We have currently nothing more to tune than alignment for memory accesses. */ target_flags - |= (TARGET_MASK_STACK_ALIGN | TARGET_MASK_CONST_ALIGN - | TARGET_MASK_DATA_ALIGN | TARGET_MASK_ALIGN_BY_32); + |= (MASK_STACK_ALIGN | MASK_CONST_ALIGN + | MASK_DATA_ALIGN | MASK_ALIGN_BY_32); } if (flag_pic) @@ -2642,7 +2205,7 @@ cris_override_options (void) if (write_symbols == DWARF2_DEBUG && ! TARGET_ELF) { - warning ("that particular -g option is invalid with -maout and -melinux"); + warning (0, "that particular -g option is invalid with -maout and -melinux"); write_symbols = DBX_DEBUG; } @@ -2745,8 +2308,7 @@ cris_split_movdx (rtx *operands) /* We used to have to handle (SUBREG (MEM)) here, but that should no longer happen; after reload there are no SUBREGs any more, and we're only called after reload. */ - if (GET_CODE (dest) == SUBREG || GET_CODE (src) == SUBREG) - abort (); + CRIS_ASSERT (GET_CODE (dest) != SUBREG && GET_CODE (src) != SUBREG); start_sequence (); if (GET_CODE (dest) == REG) @@ -2837,7 +2399,7 @@ cris_split_movdx (rtx *operands) } } else - abort (); + internal_error ("Unknown src"); } /* Reg-to-mem copy or clear mem. */ else if (GET_CODE (dest) == MEM @@ -2879,13 +2441,644 @@ cris_split_movdx (rtx *operands) } else - abort (); + internal_error ("Unknown dest"); val = get_insns (); end_sequence (); return val; } +/* The expander for the prologue pattern name. */ + +void +cris_expand_prologue (void) +{ + int regno; + int size = get_frame_size (); + /* Shorten the used name for readability. */ + int cfoa_size = current_function_outgoing_args_size; + int last_movem_reg = -1; + int framesize = 0; + rtx mem, insn; + int return_address_on_stack = cris_return_address_on_stack (); + int got_really_used = current_function_uses_pic_offset_table; + int n_movem_regs = 0; + int pretend = current_function_pretend_args_size; + + /* Don't do anything if no prologues or epilogues are wanted. */ + if (!TARGET_PROLOGUE_EPILOGUE) + return; + + CRIS_ASSERT (size >= 0); + + /* Align the size to what's best for the CPU model. */ + if (TARGET_STACK_ALIGN) + size = TARGET_ALIGN_BY_32 ? (size + 3) & ~3 : (size + 1) & ~1; + + if (pretend) + { + /* See also cris_setup_incoming_varargs where + cfun->machine->stdarg_regs is set. There are other setters of + current_function_pretend_args_size than stdarg handling, like + for an argument passed with parts in R13 and stack. We must + not store R13 into the pretend-area for that case, as GCC does + that itself. "Our" store would be marked as redundant and GCC + will attempt to remove it, which will then be flagged as an + internal error; trying to remove a frame-related insn. */ + int stdarg_regs = cfun->machine->stdarg_regs; + + framesize += pretend; + + for (regno = CRIS_FIRST_ARG_REG + CRIS_MAX_ARGS_IN_REGS - 1; + stdarg_regs > 0; + regno--, pretend -= 4, stdarg_regs--) + { + insn = emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -4))); + /* FIXME: When dwarf2 frame output and unless asynchronous + exceptions, make dwarf2 bundle together all stack + adjustments like it does for registers between stack + adjustments. */ + RTX_FRAME_RELATED_P (insn) = 1; + + mem = gen_rtx_MEM (SImode, stack_pointer_rtx); + set_mem_alias_set (mem, get_varargs_alias_set ()); + insn = emit_move_insn (mem, gen_rtx_raw_REG (SImode, regno)); + + /* Note the absence of RTX_FRAME_RELATED_P on the above insn: + the value isn't restored, so we don't want to tell dwarf2 + that it's been stored to stack, else EH handling info would + get confused. */ + } + + /* For other setters of current_function_pretend_args_size, we + just adjust the stack by leaving the remaining size in + "pretend", handled below. */ + } + + /* Save SRP if not a leaf function. */ + if (return_address_on_stack) + { + insn = emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -4 - pretend))); + pretend = 0; + RTX_FRAME_RELATED_P (insn) = 1; + + mem = gen_rtx_MEM (SImode, stack_pointer_rtx); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn = emit_move_insn (mem, gen_rtx_raw_REG (SImode, CRIS_SRP_REGNUM)); + RTX_FRAME_RELATED_P (insn) = 1; + framesize += 4; + } + + /* Set up the frame pointer, if needed. */ + if (frame_pointer_needed) + { + insn = emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -4 - pretend))); + pretend = 0; + RTX_FRAME_RELATED_P (insn) = 1; + + mem = gen_rtx_MEM (SImode, stack_pointer_rtx); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn = emit_move_insn (mem, frame_pointer_rtx); + RTX_FRAME_RELATED_P (insn) = 1; + + insn = emit_move_insn (frame_pointer_rtx, stack_pointer_rtx); + RTX_FRAME_RELATED_P (insn) = 1; + + framesize += 4; + } + + /* Between frame-pointer and saved registers lie the area for local + variables. If we get here with "pretended" size remaining, count + it into the general stack size. */ + size += pretend; + + /* Get a contiguous sequence of registers, starting with R0, that need + to be saved. */ + for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) + { + if (cris_reg_saved_in_regsave_area (regno, got_really_used)) + { + n_movem_regs++; + + /* Check if movem may be used for registers so far. */ + if (regno == last_movem_reg + 1) + /* Yes, update next expected register. */ + last_movem_reg = regno; + else + { + /* We cannot use movem for all registers. We have to flush + any movem:ed registers we got so far. */ + if (last_movem_reg != -1) + { + int n_saved + = (n_movem_regs == 1) ? 1 : last_movem_reg + 1; + + /* It is a win to use a side-effect assignment for + 64 <= size <= 128. But side-effect on movem was + not usable for CRIS v0..3. Also only do it if + side-effects insns are allowed. */ + if ((last_movem_reg + 1) * 4 + size >= 64 + && (last_movem_reg + 1) * 4 + size <= 128 + && (cris_cpu_version >= CRIS_CPU_SVINTO || n_saved == 1) + && TARGET_SIDE_EFFECT_PREFIXES) + { + mem + = gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + -(n_saved * 4 + size))); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn + = cris_emit_movem_store (mem, GEN_INT (n_saved), + -(n_saved * 4 + size), + true); + } + else + { + insn + = gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -(n_saved * 4 + size))); + insn = emit_insn (insn); + RTX_FRAME_RELATED_P (insn) = 1; + + mem = gen_rtx_MEM (SImode, stack_pointer_rtx); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn = cris_emit_movem_store (mem, GEN_INT (n_saved), + 0, true); + } + + framesize += n_saved * 4 + size; + last_movem_reg = -1; + size = 0; + } + + insn = emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -4 - size))); + RTX_FRAME_RELATED_P (insn) = 1; + + mem = gen_rtx_MEM (SImode, stack_pointer_rtx); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn = emit_move_insn (mem, gen_rtx_raw_REG (SImode, regno)); + RTX_FRAME_RELATED_P (insn) = 1; + + framesize += 4 + size; + size = 0; + } + } + } + + /* Check after, if we could movem all registers. This is the normal case. */ + if (last_movem_reg != -1) + { + int n_saved + = (n_movem_regs == 1) ? 1 : last_movem_reg + 1; + + /* Side-effect on movem was not usable for CRIS v0..3. Also only + do it if side-effects insns are allowed. */ + if ((last_movem_reg + 1) * 4 + size >= 64 + && (last_movem_reg + 1) * 4 + size <= 128 + && (cris_cpu_version >= CRIS_CPU_SVINTO || n_saved == 1) + && TARGET_SIDE_EFFECT_PREFIXES) + { + mem + = gen_rtx_MEM (SImode, + plus_constant (stack_pointer_rtx, + -(n_saved * 4 + size))); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn = cris_emit_movem_store (mem, GEN_INT (n_saved), + -(n_saved * 4 + size), true); + } + else + { + insn + = gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -(n_saved * 4 + size))); + insn = emit_insn (insn); + RTX_FRAME_RELATED_P (insn) = 1; + + mem = gen_rtx_MEM (SImode, stack_pointer_rtx); + set_mem_alias_set (mem, get_frame_alias_set ()); + insn = cris_emit_movem_store (mem, GEN_INT (n_saved), 0, true); + } + + framesize += n_saved * 4 + size; + /* We have to put outgoing argument space after regs. */ + if (cfoa_size) + { + insn = emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -cfoa_size))); + RTX_FRAME_RELATED_P (insn) = 1; + framesize += cfoa_size; + } + } + else if ((size + cfoa_size) > 0) + { + insn = emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -(cfoa_size + size)))); + RTX_FRAME_RELATED_P (insn) = 1; + framesize += size + cfoa_size; + } + + /* Set up the PIC register, if it is used. */ + if (got_really_used) + { + rtx got + = gen_rtx_UNSPEC (SImode, gen_rtvec (1, const0_rtx), CRIS_UNSPEC_GOT); + emit_move_insn (pic_offset_table_rtx, got); + + /* FIXME: This is a cover-up for flow2 messing up; it doesn't + follow exceptional paths and tries to delete the GOT load as + unused, if it isn't used on the non-exceptional paths. Other + ports have similar or other cover-ups, or plain bugs marking + the GOT register load as maybe-dead. To see this, remove the + line below and try libsupc++/vec.cc or a trivial + "static void y (); void x () {try {y ();} catch (...) {}}". */ + emit_insn (gen_rtx_USE (VOIDmode, pic_offset_table_rtx)); + } + + if (cris_max_stackframe && framesize > cris_max_stackframe) + warning (0, "stackframe too big: %d bytes", framesize); +} + +/* The expander for the epilogue pattern. */ + +void +cris_expand_epilogue (void) +{ + int regno; + int size = get_frame_size (); + int last_movem_reg = -1; + int argspace_offset = current_function_outgoing_args_size; + int pretend = current_function_pretend_args_size; + rtx mem; + bool return_address_on_stack = cris_return_address_on_stack (); + /* A reference may have been optimized out + (like the abort () in fde_split in unwind-dw2-fde.c, at least 3.2.1) + so check that it's still used. */ + int got_really_used = current_function_uses_pic_offset_table; + int n_movem_regs = 0; + + if (!TARGET_PROLOGUE_EPILOGUE) + return; + + /* Align byte count of stack frame. */ + if (TARGET_STACK_ALIGN) + size = TARGET_ALIGN_BY_32 ? (size + 3) & ~3 : (size + 1) & ~1; + + /* Check how many saved regs we can movem. They start at r0 and must + be contiguous. */ + for (regno = 0; + regno < FIRST_PSEUDO_REGISTER; + regno++) + if (cris_reg_saved_in_regsave_area (regno, got_really_used)) + { + n_movem_regs++; + + if (regno == last_movem_reg + 1) + last_movem_reg = regno; + else + break; + } + + /* If there was only one register that really needed to be saved + through movem, don't use movem. */ + if (n_movem_regs == 1) + last_movem_reg = -1; + + /* Now emit "normal" move insns for all regs higher than the movem + regs. */ + for (regno = FIRST_PSEUDO_REGISTER - 1; + regno > last_movem_reg; + regno--) + if (cris_reg_saved_in_regsave_area (regno, got_really_used)) + { + if (argspace_offset) + { + /* There is an area for outgoing parameters located before + the saved registers. We have to adjust for that. */ + emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + argspace_offset))); + /* Make sure we only do this once. */ + argspace_offset = 0; + } + + mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode, + stack_pointer_rtx)); + set_mem_alias_set (mem, get_frame_alias_set ()); + emit_move_insn (gen_rtx_raw_REG (SImode, regno), mem); + } + + /* If we have any movem-restore, do it now. */ + if (last_movem_reg != -1) + { + if (argspace_offset) + { + emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + argspace_offset))); + argspace_offset = 0; + } + + mem = gen_rtx_MEM (SImode, + gen_rtx_POST_INC (SImode, stack_pointer_rtx)); + set_mem_alias_set (mem, get_frame_alias_set ()); + emit_insn (cris_gen_movem_load (mem, GEN_INT (last_movem_reg + 1), 0)); + } + + /* If we don't clobber all of the allocated stack area (we've already + deallocated saved registers), GCC might want to schedule loads from + the stack to *after* the stack-pointer restore, which introduces an + interrupt race condition. This happened for the initial-value + SRP-restore for g++.dg/eh/registers1.C (noticed by inspection of + other failure for that test). It also happened for the stack slot + for the return value in (one version of) + linux/fs/dcache.c:__d_lookup, at least with "-O2 + -fno-omit-frame-pointer". */ + + /* Restore frame pointer if necessary. */ + if (frame_pointer_needed) + { + emit_insn (gen_cris_frame_deallocated_barrier ()); + + emit_move_insn (stack_pointer_rtx, frame_pointer_rtx); + mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode, + stack_pointer_rtx)); + set_mem_alias_set (mem, get_frame_alias_set ()); + emit_move_insn (frame_pointer_rtx, mem); + } + else if ((size + argspace_offset) != 0) + { + emit_insn (gen_cris_frame_deallocated_barrier ()); + + /* If there was no frame-pointer to restore sp from, we must + explicitly deallocate local variables. */ + + /* Handle space for outgoing parameters that hasn't been handled + yet. */ + size += argspace_offset; + + emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, size))); + } + + /* If this function has no pushed register parameters + (stdargs/varargs), and if it is not a leaf function, then we have + the return address on the stack. */ + if (return_address_on_stack && pretend == 0) + { + if (current_function_calls_eh_return) + { + rtx mem; + rtx srpreg = gen_rtx_raw_REG (SImode, CRIS_SRP_REGNUM); + mem = gen_rtx_MEM (SImode, + gen_rtx_POST_INC (SImode, + stack_pointer_rtx)); + set_mem_alias_set (mem, get_frame_alias_set ()); + emit_move_insn (srpreg, mem); + + emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + gen_rtx_raw_REG (SImode, + CRIS_STACKADJ_REG))); + cris_expand_return (false); + } + else + cris_expand_return (true); + + return; + } + + /* If we pushed some register parameters, then adjust the stack for + them. */ + if (pretend != 0) + { + /* If SRP is stored on the way, we need to restore it first. */ + if (return_address_on_stack) + { + rtx mem; + rtx srpreg = gen_rtx_raw_REG (SImode, CRIS_SRP_REGNUM); + mem = gen_rtx_MEM (SImode, + gen_rtx_POST_INC (SImode, + stack_pointer_rtx)); + set_mem_alias_set (mem, get_frame_alias_set ()); + emit_move_insn (srpreg, mem); + } + + emit_insn (gen_rtx_SET (VOIDmode, + stack_pointer_rtx, + plus_constant (stack_pointer_rtx, pretend))); + } + + /* Perform the "physical" unwinding that the EH machinery calculated. */ + if (current_function_calls_eh_return) + emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + gen_rtx_raw_REG (SImode, + CRIS_STACKADJ_REG))); + cris_expand_return (false); +} + +/* Worker function for generating movem from mem for load_multiple. */ + +rtx +cris_gen_movem_load (rtx src, rtx nregs_rtx, int nprefix) +{ + int nregs = INTVAL (nregs_rtx); + rtvec vec; + int eltno = 1; + int i; + rtx srcreg = XEXP (src, 0); + unsigned int regno = nregs - 1; + int regno_inc = -1; + + if (GET_CODE (srcreg) == POST_INC) + srcreg = XEXP (srcreg, 0); + + CRIS_ASSERT (REG_P (srcreg)); + + /* Don't use movem for just one insn. The insns are equivalent except + for the pipeline hazard (on v32); movem does not forward the loaded + registers so there's a three cycles penalty for their use. */ + if (nregs == 1) + return gen_movsi (gen_rtx_REG (SImode, 0), src); + + vec = rtvec_alloc (nprefix + nregs + + (GET_CODE (XEXP (src, 0)) == POST_INC)); + + if (GET_CODE (XEXP (src, 0)) == POST_INC) + { + RTVEC_ELT (vec, nprefix + 1) + = gen_rtx_SET (VOIDmode, srcreg, plus_constant (srcreg, nregs * 4)); + eltno++; + } + + src = replace_equiv_address (src, srcreg); + RTVEC_ELT (vec, nprefix) + = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno), src); + regno += regno_inc; + + for (i = 1; i < nregs; i++, eltno++) + { + RTVEC_ELT (vec, nprefix + eltno) + = gen_rtx_SET (VOIDmode, gen_rtx_REG (SImode, regno), + adjust_address_nv (src, SImode, i * 4)); + regno += regno_inc; + } + + return gen_rtx_PARALLEL (VOIDmode, vec); +} + +/* Worker function for generating movem to mem. If FRAME_RELATED, notes + are added that the dwarf2 machinery understands. */ + +rtx +cris_emit_movem_store (rtx dest, rtx nregs_rtx, int increment, + bool frame_related) +{ + int nregs = INTVAL (nregs_rtx); + rtvec vec; + int eltno = 1; + int i; + rtx insn; + rtx destreg = XEXP (dest, 0); + unsigned int regno = nregs - 1; + int regno_inc = -1; + + if (GET_CODE (destreg) == POST_INC) + increment += nregs * 4; + + if (GET_CODE (destreg) == POST_INC || GET_CODE (destreg) == PLUS) + destreg = XEXP (destreg, 0); + + CRIS_ASSERT (REG_P (destreg)); + + /* Don't use movem for just one insn. The insns are equivalent except + for the pipeline hazard (on v32); movem does not forward the loaded + registers so there's a three cycles penalty for use. */ + if (nregs == 1) + { + rtx mov = gen_rtx_SET (VOIDmode, dest, gen_rtx_REG (SImode, 0)); + + if (increment == 0) + { + insn = emit_insn (mov); + if (frame_related) + RTX_FRAME_RELATED_P (insn) = 1; + return insn; + } + + /* If there was a request for a side-effect, create the ordinary + parallel. */ + vec = rtvec_alloc (2); + + RTVEC_ELT (vec, 0) = mov; + RTVEC_ELT (vec, 1) = gen_rtx_SET (VOIDmode, destreg, + plus_constant (destreg, increment)); + if (frame_related) + { + RTX_FRAME_RELATED_P (mov) = 1; + RTX_FRAME_RELATED_P (RTVEC_ELT (vec, 1)) = 1; + } + } + else + { + vec = rtvec_alloc (nregs + (increment != 0 ? 1 : 0)); + RTVEC_ELT (vec, 0) + = gen_rtx_SET (VOIDmode, + replace_equiv_address (dest, + plus_constant (destreg, + increment)), + gen_rtx_REG (SImode, regno)); + regno += regno_inc; + + /* The dwarf2 info wants this mark on each component in a parallel + that's part of the prologue (though it's optional on the first + component). */ + if (frame_related) + RTX_FRAME_RELATED_P (RTVEC_ELT (vec, 0)) = 1; + + if (increment != 0) + { + RTVEC_ELT (vec, 1) + = gen_rtx_SET (VOIDmode, destreg, + plus_constant (destreg, + increment != 0 + ? increment : nregs * 4)); + eltno++; + + if (frame_related) + RTX_FRAME_RELATED_P (RTVEC_ELT (vec, 1)) = 1; + + /* Don't call adjust_address_nv on a post-incremented address if + we can help it. */ + if (GET_CODE (XEXP (dest, 0)) == POST_INC) + dest = replace_equiv_address (dest, destreg); + } + + for (i = 1; i < nregs; i++, eltno++) + { + RTVEC_ELT (vec, eltno) + = gen_rtx_SET (VOIDmode, adjust_address_nv (dest, SImode, i * 4), + gen_rtx_REG (SImode, regno)); + if (frame_related) + RTX_FRAME_RELATED_P (RTVEC_ELT (vec, eltno)) = 1; + regno += regno_inc; + } + } + + insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, vec)); + + /* Because dwarf2out.c handles the insns in a parallel as a sequence, + we need to keep the stack adjustment separate, after the + MEM-setters. Else the stack-adjustment in the second component of + the parallel would be mishandled; the offsets for the SETs that + follow it would be wrong. We prepare for this by adding a + REG_FRAME_RELATED_EXPR with the MEM-setting parts in a SEQUENCE + followed by the increment. Note that we have FRAME_RELATED_P on + all the SETs, including the original stack adjustment SET in the + parallel. */ + if (frame_related) + { + if (increment != 0) + { + rtx seq = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (nregs + 1)); + XVECEXP (seq, 0, 0) = XVECEXP (PATTERN (insn), 0, 0); + for (i = 1; i < nregs; i++) + XVECEXP (seq, 0, i) = XVECEXP (PATTERN (insn), 0, i + 1); + XVECEXP (seq, 0, nregs) = XVECEXP (PATTERN (insn), 0, 1); + REG_NOTES (insn) + = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, seq, + REG_NOTES (insn)); + } + + RTX_FRAME_RELATED_P (insn) = 1; + } + + return insn; +} + /* Use from within code, from e.g. PRINT_OPERAND and PRINT_OPERAND_ADDRESS. Macros used in output_addr_const need to emit different things depending on whether code operand or constant is @@ -2920,8 +3113,8 @@ cris_asm_output_symbol_ref (FILE *file, rtx x) } else if (cris_got_symbol (x)) { - if (cris_pic_sympart_only) - abort (); + CRIS_ASSERT (!cris_pic_sympart_only); + fprintf (file, "[$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]); assemble_name (file, XSTR (x, 0)); @@ -2984,9 +3177,7 @@ cris_output_addr_const_extra (FILE *file, rtx x) } else { - if (TARGET_AVOID_GOTPLT) - /* We shouldn't get here. */ - abort (); + CRIS_ASSERT (!TARGET_AVOID_GOTPLT); fprintf (file, "[$%s+", reg_names [PIC_OFFSET_TABLE_REGNUM]); assemble_name (file, XSTR (x, 0)); @@ -3022,13 +3213,16 @@ cris_setup_incoming_varargs (CUMULATIVE_ARGS *ca, int second_time) { if (ca->regs < CRIS_MAX_ARGS_IN_REGS) - *pretend_arg_size = (CRIS_MAX_ARGS_IN_REGS - ca->regs) * 4; - if (TARGET_PDEBUG) { - fprintf (asm_out_file, - "\n; VA:: ANSI: %d args before, anon @ #%d, %dtime\n", - ca->regs, *pretend_arg_size, second_time); + int stdarg_regs = CRIS_MAX_ARGS_IN_REGS - ca->regs; + cfun->machine->stdarg_regs = stdarg_regs; + *pretend_arg_size = stdarg_regs * 4; } + + if (TARGET_PDEBUG) + fprintf (asm_out_file, + "\n; VA:: ANSI: %d args before, anon @ #%d, %dtime\n", + ca->regs, *pretend_arg_size, second_time); } /* Return true if TYPE must be passed by invisible reference. @@ -3060,8 +3254,38 @@ cris_arg_partial_bytes (CUMULATIVE_ARGS *ca, enum machine_mode mode, /* Worker function for TARGET_MD_ASM_CLOBBERS. */ static tree -cris_md_asm_clobbers (tree clobbers) +cris_md_asm_clobbers (tree outputs, tree inputs, tree clobbers) { + HARD_REG_SET mof_set; + tree t; + + CLEAR_HARD_REG_SET (mof_set); + SET_HARD_REG_BIT (mof_set, CRIS_MOF_REGNUM); + + for (t = outputs; t != NULL; t = TREE_CHAIN (t)) + { + tree val = TREE_VALUE (t); + + /* The constraint letter for the singleton register class of MOF + is 'h'. If it's mentioned in the constraints, the asm is + MOF-aware and adding it to the clobbers would cause it to have + impossible constraints. */ + if (strchr (TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t))), + 'h') != NULL + || decl_overlaps_hard_reg_set_p (val, mof_set)) + return clobbers; + } + + for (t = inputs; t != NULL; t = TREE_CHAIN (t)) + { + tree val = TREE_VALUE (t); + + if (strchr (TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t))), + 'h') != NULL + || decl_overlaps_hard_reg_set_p (val, mof_set)) + return clobbers; + } + return tree_cons (NULL_TREE, build_string (strlen (reg_names[CRIS_MOF_REGNUM]), reg_names[CRIS_MOF_REGNUM]), diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h index f1dd5da1d99..bdf48238016 100644 --- a/gcc/config/cris/cris.h +++ b/gcc/config/cris/cris.h @@ -38,6 +38,11 @@ Boston, MA 02111-1307, USA. */ settings not repeated below. This file contains general CRIS definitions and definitions for the cris-*-elf subtarget. */ +/* We don't want to use gcc_assert for everything, as that can be + compiled out. */ +#define CRIS_ASSERT(x) \ + do { if (!(x)) internal_error ("CRIS-port assertion failed: " #x); } while (0) + /* Replacement for REG_P since it does not match SUBREGs. Happens for testcase Axis-20000320 with gcc-2.9x. */ #define REG_S_P(x) \ @@ -257,182 +262,23 @@ extern const char *cris_elinux_stacksize_str; /* This needs to be at least 32 bits. */ extern int target_flags; -/* Currently this just affects alignment. FIXME: Redundant with - TARGET_ALIGN_BY_32, or put machine stuff here? */ -#define TARGET_MASK_SVINTO 1 -#define TARGET_SVINTO (target_flags & TARGET_MASK_SVINTO) - -/* If to use condition-codes generated by insns other than the - immediately preceding compare/test insn. - Used to check for errors in notice_update_cc. */ -#define TARGET_MASK_CCINIT 2 -#define TARGET_CCINIT (target_flags & TARGET_MASK_CCINIT) - -/* Debug option. */ -#define TARGET_MASK_PDEBUG 4 -#define TARGET_PDEBUG (target_flags & TARGET_MASK_PDEBUG) - -/* If to use side-effect patterns. Used to debug the [rx=ry+i] type - patterns. */ -#define TARGET_MASK_SIDE_EFFECT_PREFIXES 8 -#define TARGET_SIDE_EFFECT_PREFIXES \ - (target_flags & TARGET_MASK_SIDE_EFFECT_PREFIXES) - -/* If to expand mul into mstep. Only used when making libc.a. */ -#define TARGET_MASK_EXPAND_MUL 16 -#define TARGET_EXPAND_MUL (target_flags & TARGET_MASK_EXPAND_MUL) - -/* If to *keep* (not force) alignment of stack at 16 bits. */ -#define TARGET_MASK_STACK_ALIGN 32 -#define TARGET_STACK_ALIGN (target_flags & TARGET_MASK_STACK_ALIGN) - -/* If to do alignment on individual non-modifiable objects. */ -#define TARGET_MASK_CONST_ALIGN 64 -#define TARGET_CONST_ALIGN (target_flags & TARGET_MASK_CONST_ALIGN) - -/* If to do alignment on individual modifiable objects. */ -#define TARGET_MASK_DATA_ALIGN 128 -#define TARGET_DATA_ALIGN (target_flags & TARGET_MASK_DATA_ALIGN) - -/* If not to omit function prologue and epilogue. */ -#define TARGET_MASK_PROLOGUE_EPILOGUE 256 -#define TARGET_PROLOGUE_EPILOGUE (target_flags & TARGET_MASK_PROLOGUE_EPILOGUE) - -/* Instructions additions from Etrax 4 and up. - (Just "lz", which we don't really generate from GCC -- yet). */ -#define TARGET_MASK_ETRAX4_ADD 512 -#define TARGET_ETRAX4_ADD (target_flags & TARGET_MASK_ETRAX4_ADD) - -/* Say that all alignment specifications say to prefer 32 rather - than 16 bits. */ -#define TARGET_MASK_ALIGN_BY_32 1024 -#define TARGET_ALIGN_BY_32 (target_flags & TARGET_MASK_ALIGN_BY_32) - -/* This condition is of limited use, as gcc is riddled with #ifdef:s - controlling this, rather than if (...):s. */ -#define TARGET_MASK_ELF 2048 -#define TARGET_ELF (target_flags & TARGET_MASK_ELF) - -/* Currently just used to error-check other options. Note that this is - *not* set for -melinux. */ -#define TARGET_MASK_LINUX 4096 -#define TARGET_LINUX (target_flags & TARGET_MASK_LINUX) - -/* There's a small setup cost with using GOTPLT references, but should - in total be a win both in code-size and execution-time. */ -#define TARGET_MASK_AVOID_GOTPLT 8192 -#define TARGET_AVOID_GOTPLT (target_flags & TARGET_MASK_AVOID_GOTPLT) - -/* Whether or not to work around multiplication instruction hardware bug - when generating code for models where it may be present. From the - trouble report for Etrax 100 LX: "A multiply operation may cause - incorrect cache behaviour under some specific circumstances. The - problem can occur if the instruction following the multiply instruction - causes a cache miss, and multiply operand 1 (source operand) bits - [31:27] matches the logical mapping of the mode register address - (0xb0....), and bits [9:2] of operand 1 matches the TLB register - address (0x258-0x25f). There is such a mapping in kernel mode or when - the MMU is off. Normally there is no such mapping in user mode, and - the problem will therefore probably not occur in Linux user mode - programs." - - We have no sure-fire way to know from within GCC that we're compiling a - user program. For example, -fpic/PIC is used in libgcc which is linked - into the kernel. However, the workaround option -mno-mul-bug can be - safely used per-package when compiling programs. The same goes for - general user-only libraries such as glibc, since there's no user-space - driver-like program that gets a mapping of I/O registers (all on the - same page, including the TLB registers). */ -#define TARGET_MASK_MUL_BUG 16384 -#define TARGET_MUL_BUG (target_flags & TARGET_MASK_MUL_BUG) - -#define TARGET_SWITCHES \ - { \ - {"mul-bug-workaround", TARGET_MASK_MUL_BUG, \ - N_("Work around bug in multiplication instruction")}, \ - {"no-mul-bug-workaround", -TARGET_MASK_MUL_BUG, ""}, \ - /* No "no-etrax" as it does not really imply any model. \ - On the other hand, "etrax" implies the common (and large) \ - subset matching all models. */ \ - {"etrax4", TARGET_MASK_ETRAX4_ADD, \ - N_("Compile for ETRAX 4 (CRIS v3)")}, \ - {"no-etrax4", -TARGET_MASK_ETRAX4_ADD, ""}, \ - {"etrax100", (TARGET_MASK_SVINTO \ - + TARGET_MASK_ETRAX4_ADD \ - + TARGET_MASK_ALIGN_BY_32), \ - N_("Compile for ETRAX 100 (CRIS v8)")}, \ - {"no-etrax100", -(TARGET_MASK_SVINTO \ - + TARGET_MASK_ETRAX4_ADD), ""}, \ - {"pdebug", TARGET_MASK_PDEBUG, \ - N_("Emit verbose debug information in assembly code")}, \ - {"no-pdebug", -TARGET_MASK_PDEBUG, ""}, \ - {"cc-init", TARGET_MASK_CCINIT, \ - N_("Do not use condition codes from normal instructions")}, \ - {"no-cc-init", -TARGET_MASK_CCINIT, ""}, \ - {"side-effects", TARGET_MASK_SIDE_EFFECT_PREFIXES, ""}, \ - {"no-side-effects", -TARGET_MASK_SIDE_EFFECT_PREFIXES, \ - N_("Do not emit addressing modes with side-effect assignment")}, \ - {"stack-align", TARGET_MASK_STACK_ALIGN, ""}, \ - {"no-stack-align", -TARGET_MASK_STACK_ALIGN, \ - N_("Do not tune stack alignment")}, \ - {"data-align", TARGET_MASK_DATA_ALIGN, ""}, \ - {"no-data-align", -TARGET_MASK_DATA_ALIGN, \ - N_("Do not tune writable data alignment")}, \ - {"const-align", TARGET_MASK_CONST_ALIGN, ""}, \ - {"no-const-align", -TARGET_MASK_CONST_ALIGN, \ - N_("Do not tune code and read-only data alignment")}, \ - {"32-bit", (TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN \ - + TARGET_MASK_ALIGN_BY_32), ""}, \ - {"32bit", (TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN \ - + TARGET_MASK_ALIGN_BY_32), \ - N_("Align code and data to 32 bits")}, \ - {"16-bit", (TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN), ""}, \ - {"16bit", (TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN), ""}, \ - {"8-bit", -(TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN), ""}, \ - {"8bit", -(TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN \ - + TARGET_MASK_DATA_ALIGN), \ - N_("Don't align items in code or data")}, \ - {"prologue-epilogue", TARGET_MASK_PROLOGUE_EPILOGUE, ""}, \ - {"no-prologue-epilogue", -TARGET_MASK_PROLOGUE_EPILOGUE, \ - N_("Do not emit function prologue or epilogue")}, \ - /* We have to handle this m-option here since we can't wash it off in \ - both CC1_SPEC and CC1PLUS_SPEC. */ \ - {"best-lib-options", 0, \ - N_("Use the most feature-enabling options allowed by other options")}, \ - \ - /* We must call it "override-" since calling it "no-" will cause \ - gcc.c to forget it, if there's a "later" -mbest-lib-options. \ - Kludgy, but needed for some multilibbed files. */ \ - {"override-best-lib-options", 0, \ - N_("Override -mbest-lib-options")}, \ - CRIS_SUBTARGET_SWITCHES \ - {"", TARGET_DEFAULT | CRIS_SUBTARGET_DEFAULT, ""}} \ +/* Previously controlled by target_flags. */ +#define TARGET_ELF 1 -/* For the cris-*-elf subtarget. */ -#define CRIS_SUBTARGET_SWITCHES \ - {"elf", 0, ""}, +/* Previously controlled by target_flags. Note that this is *not* set + for -melinux. */ +#define TARGET_LINUX 0 /* Default target_flags if no switches specified. */ #ifndef TARGET_DEFAULT # define TARGET_DEFAULT \ - (TARGET_MASK_SIDE_EFFECT_PREFIXES + TARGET_MASK_STACK_ALIGN \ - + TARGET_MASK_CONST_ALIGN + TARGET_MASK_DATA_ALIGN \ - + TARGET_MASK_PROLOGUE_EPILOGUE + TARGET_MASK_MUL_BUG) + (MASK_SIDE_EFFECT_PREFIXES + MASK_STACK_ALIGN \ + + MASK_CONST_ALIGN + MASK_DATA_ALIGN \ + + MASK_PROLOGUE_EPILOGUE + MASK_MUL_BUG) #endif /* For the cris-*-elf subtarget. */ -#define CRIS_SUBTARGET_DEFAULT TARGET_MASK_ELF +#define CRIS_SUBTARGET_DEFAULT 0 #define CRIS_CPU_BASE 0 #define CRIS_CPU_ETRAX4 3 /* Just lz added. */ @@ -444,18 +290,7 @@ extern int target_flags; #define TARGET_HAS_MUL_INSNS (cris_cpu_version >= CRIS_CPU_NG) -#define TARGET_OPTIONS \ - {{"cpu=", &cris_cpu_str, "", 0}, \ - {"arch=", &cris_cpu_str, \ - N_("Generate code for the specified chip or CPU version"), 0}, \ - {"tune=", &cris_tune_str, \ - N_("Tune alignment for the specified chip or CPU version"), 0}, \ - {"max-stackframe=", &cris_max_stackframe_str, \ - N_("Warn when a stackframe is larger than the specified size"), 0}, \ - CRIS_SUBTARGET_LONG_OPTIONS \ - {"ax-stackframe=", &cris_max_stackframe_str, "", 0} } - -#define CRIS_SUBTARGET_LONG_OPTIONS +#define CRIS_SUBTARGET_HANDLE_OPTION(x, y, z) /* Print subsidiary information on the compiler version in use. Do not use VD.D syntax (D=digit), since this will cause confusion @@ -667,11 +502,6 @@ extern int target_flags; /* Node: Register Classes */ -/* CRIS has only one kind of registers, so NO_REGS and ALL_REGS - are the only classes. FIXME: It actually makes sense to have another - class for special registers, and yet another class for the - multiply-overflow register in v10; then a class for the return - register also makes sense. */ enum reg_class { NO_REGS, @@ -837,25 +667,26 @@ enum reg_class /* A BDAP constant: [reg+(8|16|32)bit offset]? */ \ && ((BASE_P (XEXP (XEXP (X, 0), 0)) \ && CONSTANT_INDEX_P (XEXP (XEXP (X, 0), 1))) \ - /* Swap arguments to the above. FIXME: gcc-2.9x? */ \ - || (BASE_P (XEXP (XEXP (X, 0), 1)) \ - && CONSTANT_INDEX_P (XEXP (XEXP (X, 0), 0))) \ /* A BDAP register: [reg+[reg(+)].S]? */ \ || (BASE_P (XEXP (XEXP (X, 0), 0)) \ && BDAP_INDEX_P(XEXP(XEXP(X, 0), 1))) \ - /* Same, but with swapped arguments. */ \ + /* Same, but with swapped arguments (no canonical \ + ordering between e.g. REG and MEM as of LAST_UPDATED \ + "Thu May 12 03:59:11 UTC 2005"). */ \ || (BASE_P (XEXP (XEXP (X, 0), 1)) \ && BDAP_INDEX_P (XEXP (XEXP (X, 0), 0))) \ - /* A BIAP: [reg+reg.S]. */ \ - || (BASE_P (XEXP (XEXP (X, 0), 0)) \ - && BIAP_INDEX_P (XEXP (XEXP (X, 0), 1))) \ - /* Same, but with swapped arguments. */ \ + /* A BIAP: [reg+reg.S] (MULT comes first). */ \ || (BASE_P (XEXP (XEXP (X, 0), 1)) \ && BIAP_INDEX_P (XEXP (XEXP (X, 0), 0)))))) \ ) -#define EXTRA_CONSTRAINT_S(X) \ - (flag_pic && CONSTANT_P (X) && cris_gotless_symbol (X)) +/* We're kind of out of constraints, so we use "S" for both gotless + symbols and the GOT-address load. Both must go in a general register + only: for pre-V32, arithmetic is done on the destination. */ +#define EXTRA_CONSTRAINT_S(X) \ + (flag_pic \ + && ((CONSTANT_P (X) && cris_gotless_symbol (X)) \ + || (GET_CODE (X) == UNSPEC && XINT ((X), 1) == CRIS_UNSPEC_GOT))) #define EXTRA_CONSTRAINT_U(X) \ (flag_pic && CONSTANT_P (X) && cris_got_symbol (X)) @@ -1231,70 +1062,6 @@ struct cum_args {int regs;}; FIXME: Check and adjust for gcc-2.9x. */ #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN) {} -/* Kludge to solve Axis-990219: Work around imperfection in - reload_load_address1: - (plus (sign_extend (mem:qi (reg))) (reg)) - should be reloaded as (plus (reg) (reg)), not - (plus (sign_extend (reg)) (reg)). - There are no checks that reload_load_address_1 "reloads" - addresses correctly, so invalidness is not caught or - corrected. - When the right thing happens in reload, the kludge can - be removed; still not as of 2003-02-27. */ - -#define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN) \ - do \ - { \ - if (GET_CODE (X) == PLUS \ - && REG_P (XEXP (X, 1)) \ - && GET_CODE (XEXP (X, 0)) == SIGN_EXTEND \ - && GET_CODE (XEXP (XEXP (X, 0), 0)) == MEM \ - && (GET_MODE (XEXP (XEXP (X, 0), 0)) == HImode \ - || GET_MODE (XEXP (XEXP (X, 0), 0)) == QImode) \ - && (REG_P (XEXP (XEXP (XEXP (X, 0), 0), 0)) \ - || (GET_CODE (XEXP (XEXP (XEXP (X, 0), 0), 0)) \ - == POST_INC \ - && REG_P (XEXP (XEXP (XEXP (XEXP (X, 0), 0), 0), \ - 0))))) \ - { \ - int something_reloaded = 0; \ - \ - if (REGNO (XEXP (X, 1)) >= FIRST_PSEUDO_REGISTER) \ - { \ - /* Second reg is pseudo, reload it. */ \ - push_reload (XEXP (X, 1), NULL_RTX, &XEXP (X, 1), \ - NULL, \ - GENERAL_REGS, GET_MODE (X), VOIDmode, 0, 0, \ - OPNUM, TYPE); \ - something_reloaded = 1; \ - } \ - \ - if (REG_P (XEXP (XEXP (XEXP (X, 0), 0), 0)) \ - && (REGNO (XEXP (XEXP (XEXP (X, 0), 0), 0)) \ - >= FIRST_PSEUDO_REGISTER)) \ - { \ - /* First one is a pseudo - reload that. */ \ - push_reload (XEXP (XEXP (XEXP (X, 0), 0), 0), NULL_RTX, \ - &XEXP (XEXP (XEXP (X, 0), 0), 0), NULL, \ - GENERAL_REGS, \ - GET_MODE (X), VOIDmode, 0, 0, OPNUM, TYPE); \ - something_reloaded = 1; \ - } \ - \ - if (! something_reloaded \ - || (GET_CODE (XEXP (XEXP (X, 0), 0)) == POST_INC \ - && (REGNO (XEXP (XEXP (XEXP (X, 0), 0), 0)) \ - >= FIRST_PSEUDO_REGISTER))) \ - /* Reload the sign_extend. Happens if neither reg is a \ - pseudo, or the first one was inside post_increment. */ \ - push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \ - GENERAL_REGS, GET_MODE (X), VOIDmode, 0, 0, \ - OPNUM, TYPE); \ - goto WIN; \ - } \ - } \ - while (0) - /* In CRIS, only the postincrement address mode depends thus, since the increment depends on the size of the operand. */ #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ @@ -1611,40 +1378,6 @@ struct cum_args {int regs;}; /* Node: Misc */ -/* FIXME: Check this one more time. */ -#define PREDICATE_CODES \ - {"cris_orthogonal_operator", \ - {PLUS, MINUS, IOR, AND, UMIN}}, \ - {"cris_commutative_orth_op", \ - {PLUS, IOR, AND, UMIN}}, \ - {"cris_operand_extend_operator", \ - {PLUS, MINUS, UMIN}}, \ - {"cris_additive_operand_extend_operator", \ - {PLUS, MINUS}}, \ - {"cris_extend_operator", \ - {ZERO_EXTEND, SIGN_EXTEND}}, \ - {"cris_plus_or_bound_operator", \ - {PLUS, UMIN}}, \ - {"cris_mem_op", \ - {MEM}}, \ - {"cris_bdap_operand", \ - {SUBREG, REG, LABEL_REF, SYMBOL_REF, MEM, CONST_INT, \ - CONST_DOUBLE, CONST, SIGN_EXTEND}}, \ - {"cris_bdap_biap_operand", \ - {SUBREG, REG, LABEL_REF, SYMBOL_REF, MEM, CONST_INT, \ - CONST_DOUBLE, CONST, SIGN_EXTEND, MULT}}, \ - {"cris_general_operand_or_gotless_symbol", \ - {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM}}, \ - {"cris_general_operand_or_symbol", \ - {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM}}, \ - {"cris_general_operand_or_plt_symbol", \ - {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM}}, \ - {"cris_mem_call_operand", \ - {MEM}}, - /* A combination of the bound (umin) insn together with a sign-extended add via the table to PC seems optimal. If the table overflows, the assembler will take care of it. diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index 0a9d41912aa..8878b560e31 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -58,7 +58,13 @@ ;; UNSPEC Usage: ;; 0 PLT reference from call expansion: operand 0 is the address, ;; the mode is VOIDmode. Always wrapped in CONST. +;; 1 Stack frame deallocation barrier. +;; 2 The address of the global offset table as a source operand. +(define_constants + [(CRIS_UNSPEC_PLT 0) + (CRIS_UNSPEC_FRAME_DEALLOC 1) + (CRIS_UNSPEC_GOT 2)]) ;; Register numbers. (define_constants @@ -119,6 +125,11 @@ (define_attr "cc" "none,clobber,normal" (const_string "normal")) +;; At the moment, this attribute is just used to help bb-reorder do its +;; work; the default 0 doesn't help it. Many insns have other lengths, +;; though none are shorter. +(define_attr "length" "" (const_int 2)) + ;; A branch or return has one delay-slot. The instruction in the ;; delay-slot is always executed, independent of whether the branch is ;; taken or not. Note that besides setting "slottable" to "has_slot", @@ -130,6 +141,43 @@ (define_delay (eq_attr "slottable" "has_slot") [(eq_attr "slottable" "yes") (nil) (nil)]) +;; Iterator definitions. + +;; For the "usual" pattern size alternatives. +(define_mode_macro BWD [SI HI QI]) +(define_mode_macro WD [SI HI]) +(define_mode_macro BW [HI QI]) +(define_mode_attr S [(SI "HI") (HI "QI")]) +(define_mode_attr s [(SI "hi") (HI "qi")]) +(define_mode_attr m [(SI ".d") (HI ".w") (QI ".b")]) +(define_mode_attr mm [(SI ".w") (HI ".b")]) +(define_mode_attr nbitsm1 [(SI "31") (HI "15") (QI "7")]) + +;; For the sign_extend+zero_extend variants. +(define_code_macro szext [sign_extend zero_extend]) +(define_code_attr u [(sign_extend "") (zero_extend "u")]) +(define_code_attr su [(sign_extend "s") (zero_extend "u")]) + +;; For the shift variants. +(define_code_macro shift [ashiftrt lshiftrt ashift]) +(define_code_macro shiftrt [ashiftrt lshiftrt]) +(define_code_attr shlr [(ashiftrt "ashr") (lshiftrt "lshr") (ashift "ashl")]) +(define_code_attr slr [(ashiftrt "asr") (lshiftrt "lsr") (ashift "lsl")]) + +(define_code_macro ncond [eq ne gtu ltu geu leu]) +(define_code_macro ocond [gt le]) +(define_code_macro rcond [lt ge]) +(define_code_attr CC [(eq "eq") (ne "ne") (gt "gt") (gtu "hi") (lt "lt") + (ltu "lo") (ge "ge") (geu "hs") (le "le") (leu "ls")]) +(define_code_attr rCC [(eq "ne") (ne "eq") (gt "le") (gtu "ls") (lt "ge") + (ltu "hs") (ge "lt") (geu "lo") (le "gt") (leu "hi")]) +(define_code_attr oCC [(lt "mi") (ge "pl")]) +(define_code_attr roCC [(lt "pl") (ge "mi")]) + +;; Operand and operator predicates. + +(include "predicates.md") + ;; Test insns. ;; DImode @@ -150,25 +198,11 @@ ;; Normal named test patterns from SI on. ;; FIXME: Seems they should change to be in order smallest..largest. -(define_insn "tstsi" - [(set (cc0) - (match_operand:SI 0 "nonimmediate_operand" "r,Q>,m"))] - "" - "test.d %0" - [(set_attr "slottable" "yes,yes,no")]) - -(define_insn "tsthi" - [(set (cc0) - (match_operand:HI 0 "nonimmediate_operand" "r,Q>,m"))] - "" - "test.w %0" - [(set_attr "slottable" "yes,yes,no")]) - -(define_insn "tstqi" +(define_insn "tst" [(set (cc0) - (match_operand:QI 0 "nonimmediate_operand" "r,Q>,m"))] + (match_operand:BWD 0 "nonimmediate_operand" "r,Q>,m"))] "" - "test.b %0" + "test %0" [(set_attr "slottable" "yes,yes,no")]) ;; It seems that the position of the sign-bit and the fact that 0.0 is @@ -218,60 +252,29 @@ ;; These are mostly useful for compares in SImode, using 8 or 16-bit ;; constants, but sometimes gcc will find its way to use it for other ;; (memory) operands. Avoid side-effect patterns, though (see above). -;; -;; FIXME: These could have an anonymous mode for operand 1. - -;; QImode - -(define_insn "*cmp_extsi" - [(set (cc0) - (compare - (match_operand:SI 0 "register_operand" "r,r") - (match_operator:SI 2 "cris_extend_operator" - [(match_operand:QI 1 "memory_operand" "Q>,m")])))] - "" - "cmp%e2.%s1 %1,%0" - [(set_attr "slottable" "yes,no")]) -;; HImode -(define_insn "*cmp_exthi" +(define_insn "*cmp_ext" [(set (cc0) (compare (match_operand:SI 0 "register_operand" "r,r") (match_operator:SI 2 "cris_extend_operator" - [(match_operand:HI 1 "memory_operand" "Q>,m")])))] + [(match_operand:BW 1 "memory_operand" "Q>,m")])))] "" - "cmp%e2.%s1 %1,%0" + "cmp%e2 %1,%0" [(set_attr "slottable" "yes,no")]) ;; Swap operands; it seems the canonical look (if any) is not enforced. ;; ;; FIXME: Investigate that. -;; FIXME: These could have an anonymous mode for operand 1. - -;; QImode - -(define_insn "*cmp_swapextqi" - [(set (cc0) - (compare - (match_operator:SI 2 "cris_extend_operator" - [(match_operand:QI 0 "memory_operand" "Q>,m")]) - (match_operand:SI 1 "register_operand" "r,r")))] - "" - "cmp%e2.%s0 %0,%1" ; The function cris_notice_update_cc knows about - ; swapped operands to compares. - [(set_attr "slottable" "yes,no")]) - -;; HImode -(define_insn "*cmp_swapexthi" +(define_insn "*cmp_swapext" [(set (cc0) (compare (match_operator:SI 2 "cris_extend_operator" - [(match_operand:HI 0 "memory_operand" "Q>,m")]) + [(match_operand:BW 0 "memory_operand" "Q>,m")]) (match_operand:SI 1 "register_operand" "r,r")))] "" - "cmp%e2.%s0 %0,%1" ; The function cris_notice_update_cc knows about + "cmp%e2 %0,%1" ; The function cris_notice_update_cc knows about ; swapped operands to compares. [(set_attr "slottable" "yes,no")]) @@ -296,37 +299,21 @@ cmp.d %0,%1" [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,no,no,no")]) -(define_insn "cmphi" - [(set (cc0) - (compare (match_operand:HI 0 "nonimmediate_operand" "r,r, r,Q>,Q>,r,m,m") - (match_operand:HI 1 "general_operand" "r,Q>,M,M, r, g,M,r")))] - "" - "@ - cmp.w %1,%0 - cmp.w %1,%0 - test.w %0 - test.w %0 - cmp.w %0,%1 - cmp.w %1,%0 - test.w %0 - cmp.w %0,%1" - [(set_attr "slottable" "yes,yes,yes,yes,yes,no,no,no")]) - -(define_insn "cmpqi" +(define_insn "cmp" [(set (cc0) (compare - (match_operand:QI 0 "nonimmediate_operand" "r,r, r,Q>,Q>,r,m,m") - (match_operand:QI 1 "general_operand" "r,Q>,M,M, r, g,M,r")))] + (match_operand:BW 0 "nonimmediate_operand" "r,r, r,Q>,Q>,r,m,m") + (match_operand:BW 1 "general_operand" "r,Q>,M,M, r, g,M,r")))] "" "@ - cmp.b %1,%0 - cmp.b %1,%0 - test.b %0 - test.b %0 - cmp.b %0,%1 - cmp.b %1,%0 - test.b %0 - cmp.b %0,%1" + cmp %1,%0 + cmp %1,%0 + test %0 + test %0 + cmp %0,%1 + cmp %1,%0 + test %0 + cmp %0,%1" [(set_attr "slottable" "yes,yes,yes,yes,yes,no,no,no")]) ;; Pattern matching the BTST insn. @@ -386,11 +373,34 @@ ;; The truth has IMO is not been decided yet, so check from time to ;; time by disabling the movdi patterns. +;; To appease testcase gcc.c-torture/execute/920501-2.c (and others) at +;; -O0, we need a movdi as a temporary measure. Here's how things fail: +;; A cmpdi RTX needs reloading (global): +;; (insn 185 326 186 (set (cc0) +;; (compare (mem/f:DI (reg/v:SI 22) 0) +;; (const_int 1 [0x1]))) 4 {cmpdi} (nil) +;; (nil)) +;; Now, reg 22 is reloaded for input address, and the mem is also moved +;; out of the instruction (into a register), since one of the operands +;; must be a register. Reg 22 is reloaded (into reg 10), and the mem is +;; moved out and synthesized in SImode parts (reg 9, reg 10 - should be ok +;; wrt. overlap). The bad things happen with the synthesis in +;; emit_move_insn_1; the location where to substitute reg 10 is lost into +;; two new RTX:es, both still having reg 22. Later on, the left-over reg +;; 22 is recognized to have an equivalent in memory which is substituted +;; straight in, and we end up with an unrecognizable insn: +;; (insn 325 324 326 (set (reg:SI 9 r9) +;; (mem/f:SI (mem:SI (plus:SI (reg:SI 8 r8) +;; (const_int -84 [0xffffffac])) 0) 0)) -1 (nil) +;; (nil)) +;; which is the first part of the reloaded synthesized "movdi". +;; The right thing would be to add equivalent replacement locations for +;; insn with pseudos that need more reloading. The question is where. + (define_expand "movdi" [(set (match_operand:DI 0 "nonimmediate_operand" "") (match_operand:DI 1 "general_operand" ""))] "" - " { if (GET_CODE (operands[0]) == MEM && operands[1] != const0_rtx) operands[1] = copy_to_mode_reg (DImode, operands[1]); @@ -423,11 +433,11 @@ emit_no_conflict_block (insns, op0, op1, 0, op1); DONE; } -}") +}) (define_insn "*movdi_insn" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,m") - (match_operand:DI 1 "general_operand" "r,g,rM"))] + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,rx,m") + (match_operand:DI 1 "general_operand" "rx,g,rxM"))] "register_operand (operands[0], DImode) || register_operand (operands[1], DImode) || operands[1] == const0_rtx" @@ -447,11 +457,9 @@ ;; move.S1 [rx=ry+rz.S],rw avoiding when rx is ry, or rw is rx ;; FIXME: These could have anonymous mode for operand 0. -;; QImode - -(define_insn "*mov_sideqi_biap" - [(set (match_operand:QI 0 "register_operand" "=r,r") - (mem:QI (plus:SI +(define_insn "*mov_side_biap" + [(set (match_operand:BW 0 "register_operand" "=r,r") + (mem:BW (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r,r") (match_operand:SI 2 "const_int_operand" "n,n")) (match_operand:SI 3 "register_operand" "r,r")))) @@ -462,34 +470,15 @@ "cris_side_effect_mode_ok (MULT, operands, 4, 3, 1, 2, 0)" "@ # - move.%s0 [%4=%3+%1%T2],%0") - -;; HImode - -(define_insn "*mov_sidehi_biap" - [(set (match_operand:HI 0 "register_operand" "=r,r") - (mem:HI (plus:SI - (mult:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "const_int_operand" "n,n")) - (match_operand:SI 3 "register_operand" "r,r")))) - (set (match_operand:SI 4 "register_operand" "=*3,r") - (plus:SI (mult:SI (match_dup 1) - (match_dup 2)) - (match_dup 3)))] - "cris_side_effect_mode_ok (MULT, operands, 4, 3, 1, 2, 0)" - "@ - # - move.%s0 [%4=%3+%1%T2],%0") - -;; SImode + move [%4=%3+%1%T2],%0") (define_insn "*mov_sidesisf_biap" - [(set (match_operand 0 "register_operand" "=r,r") + [(set (match_operand 0 "register_operand" "=r,r,x,x") (mem (plus:SI - (mult:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "const_int_operand" "n,n")) - (match_operand:SI 3 "register_operand" "r,r")))) - (set (match_operand:SI 4 "register_operand" "=*3,r") + (mult:SI (match_operand:SI 1 "register_operand" "r,r,r,r") + (match_operand:SI 2 "const_int_operand" "n,n,n,n")) + (match_operand:SI 3 "register_operand" "r,r,r,r")))) + (set (match_operand:SI 4 "register_operand" "=*3,r,*3,r") (plus:SI (mult:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] @@ -497,49 +486,24 @@ && cris_side_effect_mode_ok (MULT, operands, 4, 3, 1, 2, 0)" "@ # - move.%s0 [%4=%3+%1%T2],%0") + move.%s0 [%4=%3+%1%T2],%0 + # + move [%4=%3+%1%T2],%0") ;; move.S1 [rx=ry+i],rz ;; avoiding move.S1 [ry=ry+i],rz ;; and move.S1 [rz=ry+i],rz ;; Note that "i" is allowed to be a register. -;; FIXME: These could have anonymous mode for operand 0. - -;; QImode - -(define_insn "*mov_sideqi" - [(set (match_operand:QI 0 "register_operand" "=r,r,r") - (mem:QI - (plus:SI (match_operand:SI 1 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn")))) - (set (match_operand:SI 3 "register_operand" "=*1,r,r") - (plus:SI (match_dup 1) - (match_dup 2)))] - "cris_side_effect_mode_ok (PLUS, operands, 3, 1, 2, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[2]) != CONST_INT - || INTVAL (operands[2]) > 127 - || INTVAL (operands[2]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J'))) - return \"#\"; - return \"move.%s0 [%3=%1%S2],%0\"; -}") -;; HImode - -(define_insn "*mov_sidehi" - [(set (match_operand:HI 0 "register_operand" "=r,r,r") - (mem:HI +(define_insn "*mov_side" + [(set (match_operand:BW 0 "register_operand" "=r,r,r") + (mem:BW (plus:SI (match_operand:SI 1 "cris_bdap_operand" "%r,r,r") (match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn")))) (set (match_operand:SI 3 "register_operand" "=*1,r,r") (plus:SI (match_dup 1) (match_dup 2)))] "cris_side_effect_mode_ok (PLUS, operands, 3, 1, 2, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[2]) != CONST_INT @@ -547,33 +511,33 @@ || INTVAL (operands[2]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J'))) - return \"#\"; - return \"move.%s0 [%3=%1%S2],%0\"; -}") - -;; SImode + return "#"; + return "move [%3=%1%S2],%0"; +}) (define_insn "*mov_sidesisf" - [(set (match_operand 0 "register_operand" "=r,r,r") + [(set (match_operand 0 "register_operand" "=r,r,r,x,x,x") (mem - (plus:SI (match_operand:SI 1 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn")))) - (set (match_operand:SI 3 "register_operand" "=*1,r,r") + (plus:SI + (match_operand:SI 1 "cris_bdap_operand" "%r,r,r,r,r,r") + (match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn,r>Rn,r,>Rn")))) + (set (match_operand:SI 3 "register_operand" "=*1,r,r,*1,r,r") (plus:SI (match_dup 1) (match_dup 2)))] "GET_MODE_SIZE (GET_MODE (operands[0])) == UNITS_PER_WORD && cris_side_effect_mode_ok (PLUS, operands, 3, 1, 2, -1, 0)" - "* { - if (which_alternative == 0 + if ((which_alternative == 0 || which_alternative == 3) && (GET_CODE (operands[2]) != CONST_INT || INTVAL (operands[2]) > 127 || INTVAL (operands[2]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J'))) - return \"#\"; - return \"move.%s0 [%3=%1%S2],%0\"; -}") + return "#"; + if (which_alternative < 3) + return "move.%s0 [%3=%1%S2],%0"; + return "move [%3=%1%S2],%0"; +}) ;; Other way around; move to memory. @@ -593,34 +557,13 @@ ;; ;; move.s rz,[ry=rx+rw.S] -;; FIXME: These could have anonymous mode for operand 3. - -;; QImode - -(define_insn "*mov_sideqi_biap_mem" - [(set (mem:QI (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "r,r,r") - (match_operand:SI 1 "const_int_operand" "n,n,n")) - (match_operand:SI 2 "register_operand" "r,r,r"))) - (match_operand:QI 3 "register_operand" "r,r,r")) - (set (match_operand:SI 4 "register_operand" "=*2,!3,r") - (plus:SI (mult:SI (match_dup 0) - (match_dup 1)) - (match_dup 2)))] - "cris_side_effect_mode_ok (MULT, operands, 4, 2, 0, 1, 3)" - "@ - # - # - move.%s3 %3,[%4=%2+%0%T1]") -;; HImode - -(define_insn "*mov_sidehi_biap_mem" - [(set (mem:HI (plus:SI +(define_insn "*mov_side_biap_mem" + [(set (mem:BW (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "r,r,r") (match_operand:SI 1 "const_int_operand" "n,n,n")) (match_operand:SI 2 "register_operand" "r,r,r"))) - (match_operand:HI 3 "register_operand" "r,r,r")) + (match_operand:BW 3 "register_operand" "r,r,r")) (set (match_operand:SI 4 "register_operand" "=*2,!3,r") (plus:SI (mult:SI (match_dup 0) (match_dup 1)) @@ -629,17 +572,15 @@ "@ # # - move.%s3 %3,[%4=%2+%0%T1]") - -;; SImode + move %3,[%4=%2+%0%T1]") (define_insn "*mov_sidesisf_biap_mem" [(set (mem (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "r,r,r") - (match_operand:SI 1 "const_int_operand" "n,n,n")) - (match_operand:SI 2 "register_operand" "r,r,r"))) - (match_operand 3 "register_operand" "r,r,r")) - (set (match_operand:SI 4 "register_operand" "=*2,!3,r") + (mult:SI (match_operand:SI 0 "register_operand" "r,r,r,r,r,r") + (match_operand:SI 1 "const_int_operand" "n,n,n,n,n,n")) + (match_operand:SI 2 "register_operand" "r,r,r,r,r,r"))) + (match_operand 3 "register_operand" "r,r,r,x,x,x")) + (set (match_operand:SI 4 "register_operand" "=*2,!3,r,*2,!3,r") (plus:SI (mult:SI (match_dup 0) (match_dup 1)) (match_dup 2)))] @@ -648,7 +589,10 @@ "@ # # - move.%s3 %3,[%4=%2+%0%T1]") + move.%s3 %3,[%4=%2+%0%T1] + # + # + move %3,[%4=%2+%0%T1]") ;; Split for the case above where we're out of luck with register ;; allocation (again, the condition isn't checked for that), and we end up @@ -688,16 +632,15 @@ ;; QImode -(define_insn "*mov_sideqi_mem" - [(set (mem:QI +(define_insn "*mov_side_mem" + [(set (mem:BW (plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r,r,r,r") (match_operand:SI 1 "cris_bdap_operand" "r>Rn,r>Rn,r,>Rn"))) - (match_operand:QI 2 "register_operand" "r,r,r,r")) + (match_operand:BW 2 "register_operand" "r,r,r,r")) (set (match_operand:SI 3 "register_operand" "=*0,!2,r,r") (plus:SI (match_dup 0) (match_dup 1)))] "cris_side_effect_mode_ok (PLUS, operands, 3, 0, 1, -1, 2)" - "* { if (which_alternative == 0 && (GET_CODE (operands[1]) != CONST_INT @@ -705,62 +648,41 @@ || INTVAL (operands[1]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J'))) - return \"#\"; + return "#"; if (which_alternative == 1) - return \"#\"; - return \"move.%s2 %2,[%3=%0%S1]\"; -}") - -;; HImode - -(define_insn "*mov_sidehi_mem" - [(set (mem:HI - (plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r,r,r,r") - (match_operand:SI 1 "cris_bdap_operand" "r>Rn,r>Rn,r,>Rn"))) - (match_operand:HI 2 "register_operand" "r,r,r,r")) - (set (match_operand:SI 3 "register_operand" "=*0,!2,r,r") - (plus:SI (match_dup 0) - (match_dup 1)))] - "cris_side_effect_mode_ok (PLUS, operands, 3, 0, 1, -1, 2)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[1]) != CONST_INT - || INTVAL (operands[1]) > 127 - || INTVAL (operands[1]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J'))) - return \"#\"; - if (which_alternative == 1) - return \"#\"; - return \"move.%s2 %2,[%3=%0%S1]\"; -}") + return "#"; + return "move %2,[%3=%0%S1]"; +}) ;; SImode (define_insn "*mov_sidesisf_mem" [(set (mem - (plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r,r,r,r") - (match_operand:SI 1 "cris_bdap_operand" "r>Rn,r>Rn,r,>Rn"))) - (match_operand 2 "register_operand" "r,r,r,r")) - (set (match_operand:SI 3 "register_operand" "=*0,!2,r,r") + (plus:SI + (match_operand:SI + 0 "cris_bdap_operand" "%r,r,r,r,r,r,r,r") + (match_operand:SI + 1 "cris_bdap_operand" "r>Rn,r>Rn,r,>Rn,r>Rn,r>Rn,r,>Rn"))) + (match_operand 2 "register_operand" "r,r,r,r,x,x,x,x")) + (set (match_operand:SI 3 "register_operand" "=*0,!2,r,r,*0,!2,r,r") (plus:SI (match_dup 0) (match_dup 1)))] "GET_MODE_SIZE (GET_MODE (operands[2])) == UNITS_PER_WORD && cris_side_effect_mode_ok (PLUS, operands, 3, 0, 1, -1, 2)" - "* { - if (which_alternative == 0 + if ((which_alternative == 0 || which_alternative == 4) && (GET_CODE (operands[1]) != CONST_INT || INTVAL (operands[1]) > 127 || INTVAL (operands[1]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J'))) - return \"#\"; - if (which_alternative == 1) - return \"#\"; - return \"move.%s2 %2,[%3=%0%S1]\"; -}") + return "#"; + if (which_alternative == 1 || which_alternative == 5) + return "#"; + if (which_alternative < 4) + return "move.%s2 %2,[%3=%0%S1]"; + return "move %2,[%3=%0%S1]"; +}) ;; Like the biap case, a split where the set in the side-effect gets the ;; same register as the input register to the main insn, since the @@ -785,93 +707,13 @@ ;; Clear memory side-effect patterns. It is hard to get to the mode if ;; the MEM was anonymous, so there will be one for each mode. -;; clear.d [ry=rx+rw.s2] - -(define_insn "*clear_sidesi_biap" - [(set (mem:SI (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "r,r") - (match_operand:SI 1 "const_int_operand" "n,n")) - (match_operand:SI 2 "register_operand" "r,r"))) - (const_int 0)) - (set (match_operand:SI 3 "register_operand" "=*2,r") - (plus:SI (mult:SI (match_dup 0) - (match_dup 1)) - (match_dup 2)))] - "cris_side_effect_mode_ok (MULT, operands, 3, 2, 0, 1, -1)" - "@ - # - clear.d [%3=%2+%0%T1]") - -;; clear.d [ry=rz+i] - -(define_insn "*clear_sidesi" - [(set (mem:SI - (plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 1 "cris_bdap_operand" "r>Rn,r,>Rn"))) - (const_int 0)) - (set (match_operand:SI 2 "register_operand" "=*0,r,r") - (plus:SI (match_dup 0) - (match_dup 1)))] - "cris_side_effect_mode_ok (PLUS, operands, 2, 0, 1, -1, -1)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[1]) != CONST_INT - || INTVAL (operands[1]) > 127 - || INTVAL (operands[1]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J'))) - return \"#\"; - return \"clear.d [%2=%0%S1]\"; -}") - -;; clear.w [ry=rx+rw.s2] - -(define_insn "*clear_sidehi_biap" - [(set (mem:HI (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "r,r") - (match_operand:SI 1 "const_int_operand" "n,n")) - (match_operand:SI 2 "register_operand" "r,r"))) - (const_int 0)) - (set (match_operand:SI 3 "register_operand" "=*2,r") - (plus:SI (mult:SI (match_dup 0) - (match_dup 1)) - (match_dup 2)))] - "cris_side_effect_mode_ok (MULT, operands, 3, 2, 0, 1, -1)" - "@ - # - clear.w [%3=%2+%0%T1]") - -;; clear.w [ry=rz+i] - -(define_insn "*clear_sidehi" - [(set (mem:HI - (plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 1 "cris_bdap_operand" "r>Rn,r,>Rn"))) - (const_int 0)) - (set (match_operand:SI 2 "register_operand" "=*0,r,r") - (plus:SI (match_dup 0) - (match_dup 1)))] - "cris_side_effect_mode_ok (PLUS, operands, 2, 0, 1, -1, -1)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[1]) != CONST_INT - || INTVAL (operands[1]) > 127 - || INTVAL (operands[1]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J'))) - return \"#\"; - return \"clear.w [%2=%0%S1]\"; -}") - -;; clear.b [ry=rx+rw.s2] +;; clear.[bwd] [ry=rx+rw.s2] -(define_insn "*clear_sideqi_biap" - [(set (mem:QI (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "r,r") - (match_operand:SI 1 "const_int_operand" "n,n")) - (match_operand:SI 2 "register_operand" "r,r"))) +(define_insn "*clear_side_biap" + [(set (mem:BWD (plus:SI + (mult:SI (match_operand:SI 0 "register_operand" "r,r") + (match_operand:SI 1 "const_int_operand" "n,n")) + (match_operand:SI 2 "register_operand" "r,r"))) (const_int 0)) (set (match_operand:SI 3 "register_operand" "=*2,r") (plus:SI (mult:SI (match_dup 0) @@ -880,12 +722,12 @@ "cris_side_effect_mode_ok (MULT, operands, 3, 2, 0, 1, -1)" "@ # - clear.b [%3=%2+%0%T1]") + clear [%3=%2+%0%T1]") -;; clear.b [ry=rz+i] +;; clear.[bwd] [ry=rz+i] -(define_insn "*clear_sideqi" - [(set (mem:QI +(define_insn "*clear_side" + [(set (mem:BWD (plus:SI (match_operand:SI 0 "cris_bdap_operand" "%r,r,r") (match_operand:SI 1 "cris_bdap_operand" "r>Rn,r,>Rn"))) (const_int 0)) @@ -893,7 +735,6 @@ (plus:SI (match_dup 0) (match_dup 1)))] "cris_side_effect_mode_ok (PLUS, operands, 2, 0, 1, -1, -1)" - "* { if (which_alternative == 0 && (GET_CODE (operands[1]) != CONST_INT @@ -901,34 +742,10 @@ || INTVAL (operands[1]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'J'))) - return \"#\"; - return \"clear.b [%2=%0%S1]\"; -}") + return "#"; + return "clear [%2=%0%S1]"; +}) -;; To appease testcase gcc.c-torture/execute/920501-2.c (and others) at -;; -O0, we need a movdi as a temporary measure. Here's how things fail: -;; A cmpdi RTX needs reloading (global): -;; (insn 185 326 186 (set (cc0) -;; (compare (mem/f:DI (reg/v:SI 22) 0) -;; (const_int 1 [0x1]))) 4 {cmpdi} (nil) -;; (nil)) -;; Now, reg 22 is reloaded for input address, and the mem is also moved -;; out of the instruction (into a register), since one of the operands -;; must be a register. Reg 22 is reloaded (into reg 10), and the mem is -;; moved out and synthesized in SImode parts (reg 9, reg 10 - should be ok -;; wrt. overlap). The bad things happen with the synthesis in -;; emit_move_insn_1; the location where to substitute reg 10 is lost into -;; two new RTX:es, both still having reg 22. Later on, the left-over reg -;; 22 is recognized to have an equivalent in memory which is substituted -;; straight in, and we end up with an unrecognizable insn: -;; (insn 325 324 326 (set (reg:SI 9 r9) -;; (mem/f:SI (mem:SI (plus:SI (reg:SI 8 r8) -;; (const_int -84 [0xffffffac])) 0) 0)) -1 (nil) -;; (nil)) -;; which is the first part of the reloaded synthesized "movdi". -;; The right thing would be to add equivalent replacement locations for -;; insn with pseudos that need more reloading. The question is where. - ;; Normal move patterns from SI on. (define_expand "movsi" @@ -936,7 +753,6 @@ (match_operand:SI 0 "nonimmediate_operand" "") (match_operand:SI 1 "cris_general_operand_or_symbol" ""))] "" - " { /* If the output goes to a MEM, make sure we have zero or a register as input. */ @@ -960,8 +776,7 @@ do, and for the patterns we generate. */ if (! REG_S_P (operands[0])) { - if (no_new_pseudos) - abort (); + CRIS_ASSERT (!no_new_pseudos); operands[1] = force_reg (SImode, operands[1]); } else @@ -991,18 +806,18 @@ rtx sym = get_related_value (operands[1]); HOST_WIDE_INT offs = get_integer_term (operands[1]); - if (sym == NULL_RTX || offs == 0) - abort (); + CRIS_ASSERT (sym != NULL_RTX && offs != 0); + emit_move_insn (operands[0], sym); if (expand_binop (SImode, add_optab, operands[0], GEN_INT (offs), operands[0], 0, OPTAB_LIB_WIDEN) != operands[0]) - abort (); + internal_error ("expand_binop failed in movsi"); DONE; } } } -}") +}) (define_insn "*movsi_internal" [(set @@ -1012,7 +827,6 @@ ;; It's a bug: an S is not a general_operand and shouldn't match g. "cris_general_operand_or_gotless_symbol" "r,Q>,M,M, I,r, M,n,!S,g,r,x, rQ>,x,gi"))] "" - "* { /* Better to have c-switch here; it is worth it to optimize the size of move insns. The alternative would be to try to find more constraint @@ -1024,59 +838,70 @@ case 5: case 9: case 10: - return \"move.d %1,%0\"; + return "move.d %1,%0"; case 11: case 12: case 13: case 14: - return \"move %d1,%0\"; + return "move %d1,%0"; case 2: case 3: case 6: - return \"clear.d %0\"; + return "clear.d %0"; /* Constants -32..31 except 0. */ case 4: - return \"moveq %1,%0\"; + return "moveq %1,%0"; /* We can win a little on constants -32768..-33, 32..65535. */ case 7: if (INTVAL (operands[1]) > 0 && INTVAL (operands[1]) < 65536) { if (INTVAL (operands[1]) < 256) - return \"movu.b %1,%0\"; - return \"movu.w %1,%0\"; + return "movu.b %1,%0"; + return "movu.w %1,%0"; } else if (INTVAL (operands[1]) >= -32768 && INTVAL (operands[1]) < 32768) { if (INTVAL (operands[1]) >= -128 && INTVAL (operands[1]) < 128) - return \"movs.b %1,%0\"; - return \"movs.w %1,%0\"; + return "movs.b %1,%0"; + return "movs.w %1,%0"; + } + return "move.d %1,%0"; + + case 8: + /* FIXME: Try and split this into pieces GCC makes better code of, + than this multi-insn pattern. Synopsis: wrap the GOT-relative + symbol into an unspec, and when PIC, recognize the unspec + everywhere a symbol is normally recognized. (The PIC register + should be recognized by GCC as pic_offset_table_rtx when needed + and similar for PC.) Each component can then be optimized with + the rest of the code; it should be possible to have a constant + term added on an unspec. Don't forget to add a REG_EQUAL (or + is it REG_EQUIV) note to the destination. It might not be + worth it. Measure. + + Note that the 'v' modifier makes PLT references be output as + sym:PLT rather than [rPIC+sym:GOTPLT]. */ + if (GET_CODE (operands[1]) == UNSPEC + && XINT (operands[1], 1) == CRIS_UNSPEC_GOT) + { + /* We clobber cc0 rather than set it to GOT. Should not + matter, though. */ + CC_STATUS_INIT; + CRIS_ASSERT (REGNO (operands[0]) == PIC_OFFSET_TABLE_REGNUM); + + return "move.d $pc,%0\;sub.d .:GOTOFF,%0"; } - return \"move.d %1,%0\"; - - case 8: - /* FIXME: Try and split this into pieces GCC makes better code of, - than this multi-insn pattern. Synopsis: wrap the GOT-relative - symbol into an unspec, and when PIC, recognize the unspec - everywhere a symbol is normally recognized. (The PIC register - should be recognized by GCC as pic_offset_table_rtx when needed - and similar for PC.) Each component can then be optimized with - the rest of the code; it should be possible to have a constant - term added on an unspec. Don't forget to add a REG_EQUAL (or - is it REG_EQUIV) note to the destination. It might not be - worth it. Measure. - - Note that the 'v' modifier makes PLT references be output as - sym:PLT rather than [rPIC+sym:GOTPLT]. */ - return \"move.d %v1,%0\;add.d %P1,%0\"; + + return "move.d %v1,%0\;add.d %P1,%0"; default: - return \"BOGUS: %1 to %0\"; + return "BOGUS: %1 to %0"; } -}" +} [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,no,no,no,no,yes,yes,no,no") (set_attr "cc" "*,*,*,*,*,*,*,*,*,*,*,none,none,none,none")]) @@ -1107,32 +932,11 @@ # mov%e5.%m5 [%4=%3+%1%T2],%0") -;; QImode to SImode - -(define_insn "*ext_sideqisi_biap" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (match_operator:SI - 5 "cris_extend_operator" - [(mem:QI (plus:SI - (mult:SI (match_operand:SI 1 "register_operand" "r,r") - (match_operand:SI 2 "const_int_operand" "n,n")) - (match_operand:SI 3 "register_operand" "r,r")))])) - (set (match_operand:SI 4 "register_operand" "=*3,r") - (plus:SI (mult:SI (match_dup 1) - (match_dup 2)) - (match_dup 3)))] - "cris_side_effect_mode_ok (MULT, operands, 4, 3, 1, 2, 0)" - "@ - # - mov%e5.%m5 [%4=%3+%1%T2],%0") - -;; HImode to SImode - -(define_insn "*ext_sidehisi_biap" +(define_insn "*ext_sidesi_biap" [(set (match_operand:SI 0 "register_operand" "=r,r") (match_operator:SI 5 "cris_extend_operator" - [(mem:HI (plus:SI + [(mem:BW (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "r,r") (match_operand:SI 2 "const_int_operand" "n,n")) (match_operand:SI 3 "register_operand" "r,r")))])) @@ -1143,7 +947,7 @@ "cris_side_effect_mode_ok (MULT, operands, 4, 3, 1, 2, 0)" "@ # - mov%e5.%m5 [%4=%3+%1%T2],%0") + mov%e5 [%4=%3+%1%T2],%0") ;; Same but [rx=ry+i] @@ -1160,7 +964,6 @@ (plus:SI (match_dup 1) (match_dup 2)))] "cris_side_effect_mode_ok (PLUS, operands, 3, 1, 2, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[2]) != CONST_INT @@ -1168,49 +971,21 @@ || INTVAL (operands[2]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J'))) - return \"#\"; - return \"mov%e4.%m4 [%3=%1%S2],%0\"; -}") - -;; QImode to SImode - -(define_insn "*ext_sideqisi" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (match_operator:SI - 4 "cris_extend_operator" - [(mem:QI (plus:SI - (match_operand:SI 1 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn")))])) - (set (match_operand:SI 3 "register_operand" "=*1,r,r") - (plus:SI (match_dup 1) - (match_dup 2)))] - "cris_side_effect_mode_ok (PLUS, operands, 3, 1, 2, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[2]) != CONST_INT - || INTVAL (operands[2]) > 127 - || INTVAL (operands[2]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J'))) - return \"#\"; - return \"mov%e4.%m4 [%3=%1%S2],%0\"; -}") - -;; HImode to SImode + return "#"; + return "mov%e4.%m4 [%3=%1%S2],%0"; +}) -(define_insn "*ext_sidehisi" +(define_insn "*ext_sidesi" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (match_operator:SI 4 "cris_extend_operator" - [(mem:HI (plus:SI + [(mem:BW (plus:SI (match_operand:SI 1 "cris_bdap_operand" "%r,r,r") (match_operand:SI 2 "cris_bdap_operand" "r>Rn,r,>Rn")))])) (set (match_operand:SI 3 "register_operand" "=*1,r,r") (plus:SI (match_dup 1) (match_dup 2)))] "cris_side_effect_mode_ok (PLUS, operands, 3, 1, 2, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[2]) != CONST_INT @@ -1218,9 +993,9 @@ || INTVAL (operands[2]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J'))) - return \"#\"; - return \"mov%e4.%m4 [%3=%1%S2],%0\"; -}") + return "#"; + return "mov%e4 [%3=%1%S2],%0"; +}) ;; FIXME: See movsi. @@ -1229,7 +1004,6 @@ (match_operand:HI 0 "nonimmediate_operand" "=r,r, r,Q>,r,Q>,r,r,r,g,g,r,r,x") (match_operand:HI 1 "general_operand" "r,Q>,M,M, I,r, L,O,n,M,r,g,x,r"))] "" - "* { switch (which_alternative) { @@ -1238,31 +1012,31 @@ case 5: case 10: case 11: - return \"move.w %1,%0\"; + return "move.w %1,%0"; case 12: case 13: - return \"move %1,%0\"; + return "move %1,%0"; case 2: case 3: case 9: - return \"clear.w %0\"; + return "clear.w %0"; case 4: - return \"moveq %1,%0\"; + return "moveq %1,%0"; case 6: case 8: if (INTVAL (operands[1]) < 256 && INTVAL (operands[1]) >= -128) { if (INTVAL (operands[1]) > 0) - return \"movu.b %1,%0\"; - return \"movs.b %1,%0\"; + return "movu.b %1,%0"; + return "movs.b %1,%0"; } - return \"move.w %1,%0\"; + return "move.w %1,%0"; case 7: - return \"movEq %b1,%0\"; + return "movEq %b1,%0"; default: - return \"BOGUS: %1 to %0\"; + return "BOGUS: %1 to %0"; } -}" +} [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,yes,no,no,no,no,yes,yes") (set_attr "cc" "*,*,none,none,*,none,*,clobber,*,none,none,*,none,none")]) @@ -1283,18 +1057,18 @@ move.w %1,%0" [(set_attr "slottable" "yes,yes,yes,yes,yes,no,no,no")]) -(define_expand "reload_inhi" - [(set (match_operand:HI 2 "register_operand" "=r") - (match_operand:HI 1 "memory_operand" "m")) - (set (match_operand:HI 0 "register_operand" "=x") +(define_expand "reload_in" + [(set (match_operand:BW 2 "register_operand" "=r") + (match_operand:BW 1 "memory_operand" "m")) + (set (match_operand:BW 0 "register_operand" "=x") (match_dup 2))] "" "") -(define_expand "reload_outhi" - [(set (match_operand:HI 2 "register_operand" "=r") - (match_operand:HI 1 "register_operand" "x")) - (set (match_operand:HI 0 "memory_operand" "=m") +(define_expand "reload_out" + [(set (match_operand:BW 2 "register_operand" "=r") + (match_operand:BW 1 "register_operand" "x")) + (set (match_operand:BW 0 "memory_operand" "=m") (match_dup 2))] "" "") @@ -1335,22 +1109,6 @@ move.b %1,%0" [(set_attr "slottable" "yes,yes,yes,yes,yes,no,no,no")]) -(define_expand "reload_inqi" - [(set (match_operand:QI 2 "register_operand" "=r") - (match_operand:QI 1 "memory_operand" "m")) - (set (match_operand:QI 0 "register_operand" "=x") - (match_dup 2))] - "" - "") - -(define_expand "reload_outqi" - [(set (match_operand:QI 2 "register_operand" "=r") - (match_operand:QI 1 "register_operand" "x")) - (set (match_operand:QI 0 "memory_operand" "=m") - (match_dup 2))] - "" - "") - ;; The valid "quick" bit-patterns are, except for 0.0, denormalized ;; values REALLY close to 0, and some NaN:s (I think; their exponent is ;; all ones); the worthwhile one is "0.0". @@ -1376,6 +1134,33 @@ move %1,%0 move %1,%0" [(set_attr "slottable" "yes,yes,yes,yes,yes,no,no,no,yes,yes,yes,no,yes,no")]) + +;; Note that the memory layout of the registers is the reverse of that +;; of the standard patterns "load_multiple" and "store_multiple". +(define_insn "*cris_load_multiple" + [(match_parallel 0 "cris_load_multiple_op" + [(set (match_operand:SI 1 "register_operand" "=r,r") + (match_operand:SI 2 "memory_operand" "Q,m"))])] + "" + "movem %O0,%o0" + [(set_attr "cc" "none") + (set_attr "slottable" "yes,no") + ;; Not true, but setting the length to 0 causes return sequences (ret + ;; movem) to have the cost they had when (return) included the movem + ;; and reduces the performance penalty taken for needing to emit an + ;; epilogue (in turn copied by bb-reorder) instead of return patterns. + ;; FIXME: temporary change until all insn lengths are correctly + ;; described. FIXME: have better target control over bb-reorder. + (set_attr "length" "0")]) + +(define_insn "*cris_store_multiple" + [(match_parallel 0 "cris_store_multiple_op" + [(set (match_operand:SI 2 "memory_operand" "=Q,m") + (match_operand:SI 1 "register_operand" "r,r"))])] + "" + "movem %o0,%O0" + [(set_attr "cc" "none") + (set_attr "slottable" "yes,no")]) ;; Sign- and zero-extend insns with standard names. @@ -1390,30 +1175,17 @@ "" "move.d %1,%M0\;smi %H0\;neg.d %H0,%H0") -(define_insn "extendhidi2" +(define_insn "extenddi2" [(set (match_operand:DI 0 "register_operand" "=r") - (sign_extend:DI (match_operand:HI 1 "general_operand" "g")))] + (sign_extend:DI (match_operand:BW 1 "general_operand" "g")))] "" - "movs.w %1,%M0\;smi %H0\;neg.d %H0,%H0") + "movs %1,%M0\;smi %H0\;neg.d %H0,%H0") -(define_insn "extendhisi2" +(define_insn "extendsi2" [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (sign_extend:SI (match_operand:HI 1 "general_operand" "r,Q>,g")))] + (sign_extend:SI (match_operand:BW 1 "general_operand" "r,Q>,g")))] "" - "movs.w %1,%0" - [(set_attr "slottable" "yes,yes,no")]) - -(define_insn "extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=r") - (sign_extend:DI (match_operand:QI 1 "general_operand" "g")))] - "" - "movs.b %1,%M0\;smi %H0\;neg.d %H0,%H0") - -(define_insn "extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (sign_extend:SI (match_operand:QI 1 "general_operand" "r,Q>,g")))] - "" - "movs.b %1,%0" + "movs %1,%0" [(set_attr "slottable" "yes,yes,no")]) ;; To do a byte->word extension, extend to dword, exept that the top half @@ -1430,20 +1202,12 @@ ;; Zero-extend. The DImode ones are synthesized by gcc, so we don't ;; specify them here. -(define_insn "zero_extendhisi2" +(define_insn "zero_extendsi2" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (zero_extend:SI - (match_operand:HI 1 "nonimmediate_operand" "r,Q>,m")))] + (match_operand:BW 1 "nonimmediate_operand" "r,Q>,m")))] "" - "movu.w %1,%0" - [(set_attr "slottable" "yes,yes,no")]) - -(define_insn "zero_extendqisi2" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (zero_extend:SI - (match_operand:QI 1 "nonimmediate_operand" "r,Q>,m")))] - "" - "movu.b %1,%0" + "movu %1,%0" [(set_attr "slottable" "yes,yes,no")]) ;; Same comment as sign-extend QImode to HImode above applies. @@ -1464,59 +1228,16 @@ ;; op.S [rx=ry+I],rz; (add, sub, or, and, bound). ;; ;; [rx=ry+rz.S] -;; FIXME: These could have anonymous mode for operand 0. - -;; QImode - -(define_insn "*op_sideqi_biap" - [(set (match_operand:QI 0 "register_operand" "=r,r") - (match_operator:QI - 6 "cris_orthogonal_operator" - [(match_operand:QI 1 "register_operand" "0,0") - (mem:QI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r")))])) - (set (match_operand:SI 5 "register_operand" "=*4,r") - (plus:SI (mult:SI (match_dup 2) - (match_dup 3)) - (match_dup 4)))] - "cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" - "@ - # - %x6.%s0 [%5=%4+%2%T3],%0") - -;; HImode - -(define_insn "*op_sidehi_biap" - [(set (match_operand:HI 0 "register_operand" "=r,r") - (match_operator:HI - 6 "cris_orthogonal_operator" - [(match_operand:HI 1 "register_operand" "0,0") - (mem:HI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r")))])) - (set (match_operand:SI 5 "register_operand" "=*4,r") - (plus:SI (mult:SI (match_dup 2) - (match_dup 3)) - (match_dup 4)))] - "cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" - "@ - # - %x6.%s0 [%5=%4+%2%T3],%0") - -;; SImode -(define_insn "*op_sidesi_biap" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (match_operator:SI +(define_insn "*op_side_biap" + [(set (match_operand:BWD 0 "register_operand" "=r,r") + (match_operator:BWD 6 "cris_orthogonal_operator" - [(match_operand:SI 1 "register_operand" "0,0") - (mem:SI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r")))])) + [(match_operand:BWD 1 "register_operand" "0,0") + (mem:BWD (plus:SI + (mult:SI (match_operand:SI 2 "register_operand" "r,r") + (match_operand:SI 3 "const_int_operand" "n,n")) + (match_operand:SI 4 "register_operand" "r,r")))])) (set (match_operand:SI 5 "register_operand" "=*4,r") (plus:SI (mult:SI (match_dup 2) (match_dup 3)) @@ -1524,78 +1245,22 @@ "cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" "@ # - %x6.%s0 [%5=%4+%2%T3],%0") + %x6 [%5=%4+%2%T3],%0") ;; [rx=ry+i] ([%4=%2+%3]) -;; FIXME: These could have anonymous mode for operand 0. - -;; QImode - -(define_insn "*op_sideqi" - [(set (match_operand:QI 0 "register_operand" "=r,r,r") - (match_operator:QI - 5 "cris_orthogonal_operator" - [(match_operand:QI 1 "register_operand" "0,0,0") - (mem:QI (plus:SI - (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn")))])) - (set (match_operand:SI 4 "register_operand" "=*2,r,r") - (plus:SI (match_dup 2) - (match_dup 3)))] - "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[3]) != CONST_INT - || INTVAL (operands[3]) > 127 - || INTVAL (operands[3]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5.%s0 [%4=%2%S3],%0\"; -}") - -;; HImode - -(define_insn "*op_sidehi" - [(set (match_operand:HI 0 "register_operand" "=r,r,r") - (match_operator:HI - 5 "cris_orthogonal_operator" - [(match_operand:HI 1 "register_operand" "0,0,0") - (mem:HI (plus:SI - (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn")))])) - (set (match_operand:SI 4 "register_operand" "=*2,r,r") - (plus:SI (match_dup 2) - (match_dup 3)))] - "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[3]) != CONST_INT - || INTVAL (operands[3]) > 127 - || INTVAL (operands[3]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5.%s0 [%4=%2%S3],%0\"; -}") -;; SImode - -(define_insn "*op_sidesi" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (match_operator:SI +(define_insn "*op_side" + [(set (match_operand:BWD 0 "register_operand" "=r,r,r") + (match_operator:BWD 5 "cris_orthogonal_operator" - [(match_operand:SI 1 "register_operand" "0,0,0") - (mem:SI (plus:SI + [(match_operand:BWD 1 "register_operand" "0,0,0") + (mem:BWD (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn")))])) (set (match_operand:SI 4 "register_operand" "=*2,r,r") (plus:SI (match_dup 2) (match_dup 3)))] "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[3]) != CONST_INT @@ -1603,9 +1268,9 @@ || INTVAL (operands[3]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5.%s0 [%4=%2%S3],%0\"; -}") + return "#"; + return "%x5 [%4=%2%S3],%0"; +}) ;; To match all cases for commutative operations we may have to have the ;; following pattern for add, or & and. I do not know really, but it does @@ -1616,39 +1281,16 @@ ;; op.S [rx=ry+I],rz; ;; ;; [rx=ry+rz.S] -;; FIXME: These could have anonymous mode for operand 0. - -;; QImode - -(define_insn "*op_swap_sideqi_biap" - [(set (match_operand:QI 0 "register_operand" "=r,r") - (match_operator:QI - 6 "cris_commutative_orth_op" - [(mem:QI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r"))) - (match_operand:QI 1 "register_operand" "0,0")])) - (set (match_operand:SI 5 "register_operand" "=*4,r") - (plus:SI (mult:SI (match_dup 2) - (match_dup 3)) - (match_dup 4)))] - "cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" - "@ - # - %x6.%s0 [%5=%4+%2%T3],%0") - -;; HImode -(define_insn "*op_swap_sidehi_biap" - [(set (match_operand:HI 0 "register_operand" "=r,r") - (match_operator:HI +(define_insn "*op_swap_side_biap" + [(set (match_operand:BWD 0 "register_operand" "=r,r") + (match_operator:BWD 6 "cris_commutative_orth_op" - [(mem:HI (plus:SI + [(mem:BWD (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r,r") (match_operand:SI 3 "const_int_operand" "n,n")) (match_operand:SI 4 "register_operand" "r,r"))) - (match_operand:HI 1 "register_operand" "0,0")])) + (match_operand:BWD 1 "register_operand" "0,0")])) (set (match_operand:SI 5 "register_operand" "=*4,r") (plus:SI (mult:SI (match_dup 2) (match_dup 3)) @@ -1656,98 +1298,25 @@ "cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" "@ # - %x6.%s0 [%5=%4+%2%T3],%0") - -;; SImode - -(define_insn "*op_swap_sidesi_biap" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (match_operator:SI - 6 "cris_commutative_orth_op" - [(mem:SI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r"))) - (match_operand:SI 1 "register_operand" "0,0")])) - (set (match_operand:SI 5 "register_operand" "=*4,r") - (plus:SI (mult:SI (match_dup 2) - (match_dup 3)) - (match_dup 4)))] - "cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" - "@ - # - %x6.%s0 [%5=%4+%2%T3],%0") + %x6 [%5=%4+%2%T3],%0") ;; [rx=ry+i] ([%4=%2+%3]) ;; FIXME: These could have anonymous mode for operand 0. ;; QImode -(define_insn "*op_swap_sideqi" - [(set (match_operand:QI 0 "register_operand" "=r,r,r") - (match_operator:QI - 5 "cris_commutative_orth_op" - [(mem:QI - (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn"))) - (match_operand:QI 1 "register_operand" "0,0,0")])) - (set (match_operand:SI 4 "register_operand" "=*2,r,r") - (plus:SI (match_dup 2) - (match_dup 3)))] - "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[3]) != CONST_INT - || INTVAL (operands[3]) > 127 - || INTVAL (operands[3]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5.%s0 [%4=%2%S3],%0\"; -}") - -;; HImode - -(define_insn "*op_swap_sidehi" - [(set (match_operand:HI 0 "register_operand" "=r,r,r") - (match_operator:HI - 5 "cris_commutative_orth_op" - [(mem:HI - (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn"))) - (match_operand:HI 1 "register_operand" "0,0,0")])) - (set (match_operand:SI 4 "register_operand" "=*2,r,r") - (plus:SI (match_dup 2) - (match_dup 3)))] - "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[3]) != CONST_INT - || INTVAL (operands[3]) > 127 - || INTVAL (operands[3]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5.%s0 [%4=%2%S3],%0\"; -}") - -;; SImode - -(define_insn "*op_swap_sidesi" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (match_operator:SI +(define_insn "*op_swap_side" + [(set (match_operand:BWD 0 "register_operand" "=r,r,r") + (match_operator:BWD 5 "cris_commutative_orth_op" - [(mem:SI + [(mem:BWD (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn"))) - (match_operand:SI 1 "register_operand" "0,0,0")])) + (match_operand:BWD 1 "register_operand" "0,0,0")])) (set (match_operand:SI 4 "register_operand" "=*2,r,r") (plus:SI (match_dup 2) (match_dup 3)))] "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[3]) != CONST_INT @@ -1755,9 +1324,9 @@ || INTVAL (operands[3]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5.%s0 [%4=%2%S3],%0\"; -}") + return "#"; + return "%x5 [%4=%2%S3],%0"; +}) ;; Add operations, standard names. @@ -1788,45 +1357,44 @@ ;; gcc <= 2.7.2. FIXME: Check for gcc-2.9x "" - "* { switch (which_alternative) { case 0: case 1: - return \"add.d %2,%0\"; + return "add.d %2,%0"; case 2: - return \"addq %2,%0\"; + return "addq %2,%0"; case 3: - return \"subq %n2,%0\"; + return "subq %n2,%0"; case 4: /* 'Known value', but not in -63..63. Check if addu/subu may be used. */ if (INTVAL (operands[2]) > 0) { if (INTVAL (operands[2]) < 256) - return \"addu.b %2,%0\"; + return "addu.b %2,%0"; if (INTVAL (operands[2]) < 65536) - return \"addu.w %2,%0\"; + return "addu.w %2,%0"; } else { if (INTVAL (operands[2]) >= -255) - return \"subu.b %n2,%0\"; + return "subu.b %n2,%0"; if (INTVAL (operands[2]) >= -65535) - return \"subu.w %n2,%0\"; + return "subu.w %n2,%0"; } - return \"add.d %2,%0\"; + return "add.d %2,%0"; case 6: - return \"add.d %2,%1,%0\"; + return "add.d %2,%1,%0"; case 5: - return \"add.d %2,%0\"; + return "add.d %2,%0"; case 7: - return \"add.d %1,%0\"; + return "add.d %1,%0"; default: - return \"BOGUS addsi %2+%1 to %0\"; + return "BOGUS addsi %2+%1 to %0"; } -}" +} [(set_attr "slottable" "yes,yes,yes,yes,no,no,no,yes")]) (define_insn "addhi3" @@ -1901,33 +1469,18 @@ sub.d %2,%1,%0" [(set_attr "slottable" "yes,yes,yes,yes,no,no,no,no")]) -(define_insn "subhi3" - [(set (match_operand:HI 0 "register_operand" "=r,r, r,r,r,r") - (minus:HI (match_operand:HI 1 "register_operand" "0,0, 0,0,0,r") - (match_operand:HI 2 "general_operand" "r,Q>,J,N,g,!To")))] +(define_insn "sub3" + [(set (match_operand:BW 0 "register_operand" "=r,r, r,r,r,r") + (minus:BW (match_operand:BW 1 "register_operand" "0,0, 0,0,0,r") + (match_operand:BW 2 "general_operand" "r,Q>,J,N,g,!To")))] "" "@ - sub.w %2,%0 - sub.w %2,%0 + sub %2,%0 + sub %2,%0 subq %2,%0 addq %n2,%0 - sub.w %2,%0 - sub.w %2,%1,%0" - [(set_attr "slottable" "yes,yes,yes,yes,no,no") - (set_attr "cc" "normal,normal,clobber,clobber,normal,normal")]) - -(define_insn "subqi3" - [(set (match_operand:QI 0 "register_operand" "=r,r, r,r,r,r") - (minus:QI (match_operand:QI 1 "register_operand" "0,0, 0,0,0,r") - (match_operand:QI 2 "general_operand" "r,Q>,J,N,g,!To")))] - "" - "@ - sub.b %2,%0 - sub.b %2,%0 - subq %2,%0 - addq %2,%0 - sub.b %2,%0 - sub.b %2,%1,%0" + sub %2,%0 + sub %2,%1,%0" [(set_attr "slottable" "yes,yes,yes,yes,no,no") (set_attr "cc" "normal,normal,clobber,clobber,normal,normal")]) @@ -1943,7 +1496,6 @@ ;; ADDS/SUBS/ADDU/SUBU and BOUND, which needs a check for zero_extend ;; ;; adds/subs/addu/subu bound [rx=ry+rz.S] -;; FIXME: These could have anonymous mode for operand 0. ;; QImode to HImode ;; FIXME: GCC should widen. @@ -1968,16 +1520,14 @@ # %x6%e7.%m7 [%5=%4+%2%T3],%0") -;; QImode to SImode - -(define_insn "*extopqisi_side_biap" +(define_insn "*extopsi_side_biap" [(set (match_operand:SI 0 "register_operand" "=r,r") (match_operator:SI 6 "cris_operand_extend_operator" [(match_operand:SI 1 "register_operand" "0,0") (match_operator:SI 7 "cris_extend_operator" - [(mem:QI (plus:SI + [(mem:BW (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r,r") (match_operand:SI 3 "const_int_operand" "n,n")) (match_operand:SI 4 "register_operand" "r,r")))])])) @@ -1989,34 +1539,10 @@ && cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" "@ # - %x6%e7.%m7 [%5=%4+%2%T3],%0") - -;; HImode to SImode - -(define_insn "*extophisi_side_biap" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (match_operator:SI - 6 "cris_operand_extend_operator" - [(match_operand:SI 1 "register_operand" "0,0") - (match_operator:SI - 7 "cris_extend_operator" - [(mem:HI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r")))])])) - (set (match_operand:SI 5 "register_operand" "=*4,r") - (plus:SI (mult:SI (match_dup 2) - (match_dup 3)) - (match_dup 4)))] - "(GET_CODE (operands[6]) != UMIN || GET_CODE (operands[7]) == ZERO_EXTEND) - && cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" - "@ - # - %x6%e7.%m7 [%5=%4+%2%T3],%0") + %x6%e7 [%5=%4+%2%T3],%0") ;; [rx=ry+i] -;; FIXME: These could have anonymous mode for operand 0. ;; QImode to HImode @@ -2035,38 +1561,6 @@ (plus:SI (match_dup 2) (match_dup 3)))] "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[3]) != CONST_INT - || INTVAL (operands[3]) > 127 - || INTVAL (operands[3]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5%e6.%m6 [%4=%2%S3],%0\"; -}") - -;; QImode to SImode - -(define_insn "*extopqisi_side" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (match_operator:SI - 5 "cris_operand_extend_operator" - [(match_operand:SI 1 "register_operand" "0,0,0") - (match_operator:SI - 6 "cris_extend_operator" - [(mem:QI - (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn") - ))])])) - (set (match_operand:SI 4 "register_operand" "=*2,r,r") - (plus:SI (match_dup 2) - (match_dup 3)))] - - "(GET_CODE (operands[5]) != UMIN || GET_CODE (operands[6]) == ZERO_EXTEND) - && cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[3]) != CONST_INT @@ -2074,20 +1568,18 @@ || INTVAL (operands[3]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5%e6.%m6 [%4=%2%S3],%0\"; -}") - -;; HImode to SImode + return "#"; + return "%x5%e6.%m6 [%4=%2%S3],%0"; +}) -(define_insn "*extophisi_side" +(define_insn "*extopsi_side" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (match_operator:SI 5 "cris_operand_extend_operator" [(match_operand:SI 1 "register_operand" "0,0,0") (match_operator:SI 6 "cris_extend_operator" - [(mem:HI + [(mem:BW (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn") ))])])) @@ -2096,7 +1588,6 @@ (match_dup 3)))] "(GET_CODE (operands[5]) != UMIN || GET_CODE (operands[6]) == ZERO_EXTEND) && cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[3]) != CONST_INT @@ -2104,9 +1595,9 @@ || INTVAL (operands[3]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x5%e6.%m6 [%4=%2%S3],%0\"; -}") + return "#"; + return "%x5%e6 [%4=%2%S3],%0"; +}) ;; As with op.S we may have to add special pattern to match commuted @@ -2136,15 +1627,13 @@ # add%e6.b [%5=%4+%2%T3],%0") -;; QImode to SImode - -(define_insn "*extopqisi_swap_side_biap" +(define_insn "*extopsi_swap_side_biap" [(set (match_operand:SI 0 "register_operand" "=r,r") (match_operator:SI 7 "cris_plus_or_bound_operator" [(match_operator:SI 6 "cris_extend_operator" - [(mem:QI (plus:SI + [(mem:BW (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r,r") (match_operand:SI 3 "const_int_operand" "n,n")) (match_operand:SI 4 "register_operand" "r,r")))]) @@ -2157,32 +1646,9 @@ && cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" "@ # - %x7%e6.%m6 [%5=%4+%2%T3],%0") - -;; HImode to SImode -(define_insn "*extophisi_swap_side_biap" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (match_operator:SI - 7 "cris_plus_or_bound_operator" - [(match_operator:SI - 6 "cris_extend_operator" - [(mem:HI (plus:SI - (mult:SI (match_operand:SI 2 "register_operand" "r,r") - (match_operand:SI 3 "const_int_operand" "n,n")) - (match_operand:SI 4 "register_operand" "r,r")))]) - (match_operand:SI 1 "register_operand" "0,0")])) - (set (match_operand:SI 5 "register_operand" "=*4,r") - (plus:SI (mult:SI (match_dup 2) - (match_dup 3)) - (match_dup 4)))] - "(GET_CODE (operands[7]) != UMIN || GET_CODE (operands[6]) == ZERO_EXTEND) - && cris_side_effect_mode_ok (MULT, operands, 5, 4, 2, 3, 0)" - "@ - # - %x7%e6.%m6 [%5=%4+%2%T3],%0") + %x7%e6 [%5=%4+%2%T3],%0") ;; [rx=ry+i] -;; FIXME: These could have anonymous mode for operand 0. ;; FIXME: GCC should widen. ;; QImode to HImode @@ -2200,36 +1666,6 @@ (plus:SI (match_dup 2) (match_dup 3)))] "cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* -{ - if (which_alternative == 0 - && (GET_CODE (operands[3]) != CONST_INT - || INTVAL (operands[3]) > 127 - || INTVAL (operands[3]) < -128 - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') - || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"add%e5.b [%4=%2%S3],%0\"; -}") - -;; QImode to SImode - -(define_insn "*extopqisi_swap_side" - [(set (match_operand:SI 0 "register_operand" "=r,r,r") - (match_operator:SI - 6 "cris_plus_or_bound_operator" - [(match_operator:SI - 5 "cris_extend_operator" - [(mem:QI (plus:SI - (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") - (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn")))]) - (match_operand:SI 1 "register_operand" "0,0,0")])) - (set (match_operand:SI 4 "register_operand" "=*2,r,r") - (plus:SI (match_dup 2) - (match_dup 3)))] - "(GET_CODE (operands[6]) != UMIN || GET_CODE (operands[5]) == ZERO_EXTEND) - && cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[3]) != CONST_INT @@ -2237,19 +1673,17 @@ || INTVAL (operands[3]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x6%e5.%m5 [%4=%2%S3],%0\"; -}") - -;; HImode to SImode + return "#"; + return "add%e5.b [%4=%2%S3],%0"; +}) -(define_insn "*extophisi_swap_side" +(define_insn "*extopsi_swap_side" [(set (match_operand:SI 0 "register_operand" "=r,r,r") (match_operator:SI 6 "cris_plus_or_bound_operator" [(match_operator:SI 5 "cris_extend_operator" - [(mem:HI (plus:SI + [(mem:BW (plus:SI (match_operand:SI 2 "cris_bdap_operand" "%r,r,r") (match_operand:SI 3 "cris_bdap_operand" "r>Rn,r,>Rn")))]) (match_operand:SI 1 "register_operand" "0,0,0")])) @@ -2258,7 +1692,6 @@ (match_dup 3)))] "(GET_CODE (operands[6]) != UMIN || GET_CODE (operands[5]) == ZERO_EXTEND) && cris_side_effect_mode_ok (PLUS, operands, 4, 2, 3, -1, 0)" - "* { if (which_alternative == 0 && (GET_CODE (operands[3]) != CONST_INT @@ -2266,12 +1699,11 @@ || INTVAL (operands[3]) < -128 || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'N') || CONST_OK_FOR_LETTER_P (INTVAL (operands[3]), 'J'))) - return \"#\"; - return \"%x6%e5.%m5 [%4=%2%S3],%0\"; -}") + return "#"; + return "%x6%e5 [%4=%2%S3],%0"; +}) ;; Extend versions (zero/sign) of normal add/sub (no side-effects). -;; FIXME: These could have anonymous mode for operand 0. ;; QImode to HImode ;; FIXME: GCC should widen. @@ -2296,42 +1728,22 @@ ;; QImode to SImode -(define_insn "*extopqisi" +(define_insn "*extopsi" [(set (match_operand:SI 0 "register_operand" "=r,r,r,r") (match_operator:SI 3 "cris_operand_extend_operator" [(match_operand:SI 1 "register_operand" "0,0,0,r") (match_operator:SI 4 "cris_extend_operator" - [(match_operand:QI 2 "nonimmediate_operand" "r,Q>,m,!To")])]))] + [(match_operand:BW 2 "nonimmediate_operand" "r,Q>,m,!To")])]))] "(GET_CODE (operands[3]) != UMIN || GET_CODE (operands[4]) == ZERO_EXTEND) && GET_MODE_SIZE (GET_MODE (operands[0])) <= UNITS_PER_WORD && (operands[1] != frame_pointer_rtx || GET_CODE (operands[3]) != PLUS)" "@ - %x3%e4.%m4 %2,%0 - %x3%e4.%m4 %2,%0 - %x3%e4.%m4 %2,%0 - %x3%e4.%m4 %2,%1,%0" - [(set_attr "slottable" "yes,yes,no,no")]) - -;; HImode to SImode - -(define_insn "*extophisi" - [(set (match_operand:SI 0 "register_operand" "=r,r,r,r") - (match_operator:SI - 3 "cris_operand_extend_operator" - [(match_operand:SI 1 "register_operand" "0,0,0,r") - (match_operator:SI - 4 "cris_extend_operator" - [(match_operand:HI 2 "nonimmediate_operand" "r,Q>,m,!To")])]))] - "(GET_CODE (operands[3]) != UMIN || GET_CODE (operands[4]) == ZERO_EXTEND) - && GET_MODE_SIZE (GET_MODE (operands[0])) <= UNITS_PER_WORD - && (operands[1] != frame_pointer_rtx || GET_CODE (operands[3]) != PLUS)" - "@ - %x3%e4.%m4 %2,%0 - %x3%e4.%m4 %2,%0 - %x3%e4.%m4 %2,%0 - %x3%e4.%m4 %2,%1,%0" + %x3%e4 %2,%0 + %x3%e4 %2,%0 + %x3%e4 %2,%0 + %x3%e4 %2,%1,%0" [(set_attr "slottable" "yes,yes,no,no")]) @@ -2356,42 +1768,21 @@ [(set_attr "slottable" "yes,yes,no,no") (set_attr "cc" "clobber")]) -;; QImode to SImode - -(define_insn "*extopqisi_swap" +(define_insn "*extopsi_swap" [(set (match_operand:SI 0 "register_operand" "=r,r,r,r") (match_operator:SI 4 "cris_plus_or_bound_operator" [(match_operator:SI 3 "cris_extend_operator" - [(match_operand:QI 2 "nonimmediate_operand" "r,Q>,m,!To")]) + [(match_operand:BW 2 "nonimmediate_operand" "r,Q>,m,!To")]) (match_operand:SI 1 "register_operand" "0,0,0,r")]))] "(GET_CODE (operands[4]) != UMIN || GET_CODE (operands[3]) == ZERO_EXTEND) && operands[1] != frame_pointer_rtx" "@ - %x4%e3.%m3 %2,%0 - %x4%e3.%m3 %2,%0 - %x4%e3.%m3 %2,%0 - %x4%e3.%m3 %2,%1,%0" - [(set_attr "slottable" "yes,yes,no,no")]) - -;; HImode to SImode - -(define_insn "*extophisi_swap" - [(set (match_operand:SI 0 "register_operand" "=r,r,r,r") - (match_operator:SI - 4 "cris_plus_or_bound_operator" - [(match_operator:SI - 3 "cris_extend_operator" - [(match_operand:HI 2 "nonimmediate_operand" "r,Q>,m,!To")]) - (match_operand:SI 1 "register_operand" "0,0,0,r")]))] - "(GET_CODE (operands[4]) != UMIN || GET_CODE (operands[3]) == ZERO_EXTEND) - && operands[1] != frame_pointer_rtx" - "@ - %x4%e3.%m3 %2,%0 - %x4%e3.%m3 %2,%0 - %x4%e3.%m3 %2,%0 - %x4%e3.%m3 %2,%1,%0" + %x4%e3 %2,%0 + %x4%e3 %2,%0 + %x4%e3 %2,%0 + %x4%e3 %2,%1,%0" [(set_attr "slottable" "yes,yes,no,no")]) ;; This is the special case when we use what corresponds to the @@ -2452,18 +1843,17 @@ && (INTVAL (operands[2]) == 2 || INTVAL (operands[2]) == 4 || INTVAL (operands[2]) == 3 || INTVAL (operands[2]) == 5)" - "* { if (INTVAL (operands[2]) == 2) - return \"lslq 1,%0\"; + return "lslq 1,%0"; else if (INTVAL (operands[2]) == 4) - return \"lslq 2,%0\"; + return "lslq 2,%0"; else if (INTVAL (operands[2]) == 3) - return \"addi %0.w,%0\"; + return "addi %0.w,%0"; else if (INTVAL (operands[2]) == 5) - return \"addi %0.d,%0\"; - return \"BAD: adr_mulsi: %0=%1*%2\"; -}" + return "addi %0.d,%0"; + return "BAD: adr_mulsi: %0=%1*%2"; +} [(set_attr "slottable" "yes") ;; No flags are changed if this insn is "addi", but it does not seem ;; worth the trouble to distinguish that to the lslq cases. @@ -2524,34 +1914,22 @@ "mstep %2,%0" [(set_attr "slottable" "yes")]) -(define_insn "umulhisi3" - [(set (match_operand:SI 0 "register_operand" "=r") - (mult:SI - (zero_extend:SI (match_operand:HI 1 "register_operand" "%0")) - (zero_extend:SI (match_operand:HI 2 "register_operand" "r")))) +(define_insn "mul3" + [(set (match_operand:WD 0 "register_operand" "=r") + (mult:WD + (szext:WD (match_operand: 1 "register_operand" "%0")) + (szext:WD (match_operand: 2 "register_operand" "r")))) (clobber (match_scratch:SI 3 "=h"))] "TARGET_HAS_MUL_INSNS" - "%!mulu.w %2,%0" + "%!mul %2,%0" [(set (attr "slottable") (if_then_else (ne (symbol_ref "TARGET_MUL_BUG") (const_int 0)) (const_string "no") (const_string "yes"))) - ;; Just N unusable here, but let's be safe. - (set_attr "cc" "clobber")]) - -(define_insn "umulqihi3" - [(set (match_operand:HI 0 "register_operand" "=r") - (mult:HI - (zero_extend:HI (match_operand:QI 1 "register_operand" "%0")) - (zero_extend:HI (match_operand:QI 2 "register_operand" "r")))) - (clobber (match_scratch:SI 3 "=h"))] - "TARGET_HAS_MUL_INSNS" - "%!mulu.b %2,%0" - [(set (attr "slottable") - (if_then_else (ne (symbol_ref "TARGET_MUL_BUG") (const_int 0)) - (const_string "no") - (const_string "yes"))) - ;; Not exactly sure, but let's be safe. + ;; For umuls.[bwd] it's just N unusable here, but let's be safe. + ;; For muls.b, this really extends to SImode, so cc should be + ;; considered clobbered. + ;; For muls.w, it's just N unusable here, but let's be safe. (set_attr "cc" "clobber")]) ;; Note that gcc does not make use of such a thing as umulqisi3. It gets @@ -2576,60 +1954,20 @@ ;; A few multiply variations. -;; This really extends to SImode, so cc should be considered clobbered. - -(define_insn "mulqihi3" - [(set (match_operand:HI 0 "register_operand" "=r") - (mult:HI - (sign_extend:HI (match_operand:QI 1 "register_operand" "%0")) - (sign_extend:HI (match_operand:QI 2 "register_operand" "r")))) - (clobber (match_scratch:SI 3 "=h"))] - "TARGET_HAS_MUL_INSNS" - "%!muls.b %2,%0" - [(set (attr "slottable") - (if_then_else (ne (symbol_ref "TARGET_MUL_BUG") (const_int 0)) - (const_string "no") - (const_string "yes"))) - (set_attr "cc" "clobber")]) - -(define_insn "mulhisi3" - [(set (match_operand:SI 0 "register_operand" "=r") - (mult:SI - (sign_extend:SI (match_operand:HI 1 "register_operand" "%0")) - (sign_extend:SI (match_operand:HI 2 "register_operand" "r")))) - (clobber (match_scratch:SI 3 "=h"))] - "TARGET_HAS_MUL_INSNS" - "%!muls.w %2,%0" - [(set (attr "slottable") - (if_then_else (ne (symbol_ref "TARGET_MUL_BUG") (const_int 0)) - (const_string "no") - (const_string "yes"))) - ;; Just N unusable here, but let's be safe. - (set_attr "cc" "clobber")]) - ;; When needed, we can get the high 32 bits from the overflow ;; register. We don't care to split and optimize these. ;; ;; Note that cc0 is still valid after the move-from-overflow-register ;; insn; no special precaution need to be taken in cris_notice_update_cc. -(define_insn "mulsidi3" +(define_insn "mulsidi3" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI - (sign_extend:DI (match_operand:SI 1 "register_operand" "%0")) - (sign_extend:DI (match_operand:SI 2 "register_operand" "r")))) + (szext:DI (match_operand:SI 1 "register_operand" "%0")) + (szext:DI (match_operand:SI 2 "register_operand" "r")))) (clobber (match_scratch:SI 3 "=h"))] "TARGET_HAS_MUL_INSNS" - "%!muls.d %2,%M0\;move $mof,%H0") - -(define_insn "umulsidi3" - [(set (match_operand:DI 0 "register_operand" "=r") - (mult:DI - (zero_extend:DI (match_operand:SI 1 "register_operand" "%0")) - (zero_extend:DI (match_operand:SI 2 "register_operand" "r")))) - (clobber (match_scratch:SI 3 "=h"))] - "TARGET_HAS_MUL_INSNS" - "%!mulu.d %2,%M0\;move $mof,%H0") + "%!mul.d %2,%M0\;move $mof,%H0") ;; These two patterns may be expressible by other means, perhaps by making ;; [u]?mulsidi3 a define_expand. @@ -2645,39 +1983,21 @@ ;; punished by force of one "?". Check code from "int d (int a) {return ;; a / 1000;}" and unsigned. FIXME: Comment above was for 3.2, revisit. -(define_insn "smulsi3_highpart" +(define_insn "mulsi3_highpart" [(set (match_operand:SI 0 "nonimmediate_operand" "=h,h,?r,?r") (truncate:SI (lshiftrt:DI (mult:DI - (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r,0,r")) - (sign_extend:DI (match_operand:SI 2 "register_operand" "r,r,r,0"))) + (szext:DI (match_operand:SI 1 "register_operand" "r,r,0,r")) + (szext:DI (match_operand:SI 2 "register_operand" "r,r,r,0"))) (const_int 32)))) (clobber (match_scratch:SI 3 "=1,2,h,h"))] "TARGET_HAS_MUL_INSNS" "@ - %!muls.d %2,%1 - .error 'untested assembly generated by GCC (smulsi3_highpart): muls.d %1,%2' - %!muls.d %2,%1\;move $mof,%0 - %!muls.d %1,%2\;move $mof,%0" - [(set_attr "slottable" "yes,yes,no,no") - (set_attr "cc" "clobber")]) - -(define_insn "umulsi3_highpart" - [(set (match_operand:SI 0 "register_operand" "=h,h,?r,?r") - (truncate:SI - (lshiftrt:DI - (mult:DI - (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r,0,r")) - (zero_extend:DI (match_operand:SI 2 "register_operand" "r,r,r,0"))) - (const_int 32)))) - (clobber (match_scratch:SI 3 "=1,2,h,h"))] - "TARGET_HAS_MUL_INSNS" - "@ - %!mulu.d %2,%1 - .error 'untested assembly generated by GCC (umulsi3_highpart): mulu.d %1,%2' - %!mulu.d %2,%1\;move $mof,%0 - %!mulu.d %1,%2\;move $mof,%0" + %!mul.d %2,%1 + %!mul.d %1,%2 + %!mul.d %2,%1\;move $mof,%0 + %!mul.d %1,%2\;move $mof,%0" [(set_attr "slottable" "yes,yes,no,no") (set_attr "cc" "clobber")]) @@ -2740,7 +2060,6 @@ (and:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "general_operand" "")))] "" - " { if (! (GET_CODE (operands[2]) == CONST_INT && (((INTVAL (operands[2]) == -256 @@ -2777,7 +2096,7 @@ DONE; } -}") +}) ;; Some special cases of andsi3. @@ -2839,7 +2158,6 @@ (and:HI (match_operand:HI 1 "nonimmediate_operand" "") (match_operand:HI 2 "general_operand" "")))] "" - " { if (! (GET_CODE (operands[2]) == CONST_INT && (((INTVAL (operands[2]) == -256 @@ -2867,7 +2185,7 @@ DONE; } -}") +}) ;; Some fast andhi3 special cases. @@ -3016,6 +2334,7 @@ ;; Exclusive-or ;; See comment about "anddi3" for xordi3 - no need for such a pattern. +;; FIXME: Do we really need the shorter variants? (define_insn "xorsi3" [(set (match_operand:SI 0 "register_operand" "=r") @@ -3025,19 +2344,10 @@ "xor %2,%0" [(set_attr "slottable" "yes")]) -(define_insn "xorhi3" - [(set (match_operand:HI 0 "register_operand" "=r") - (xor:HI (match_operand:HI 1 "register_operand" "%0") - (match_operand:HI 2 "register_operand" "r")))] - "" - "xor %2,%0" - [(set_attr "slottable" "yes") - (set_attr "cc" "clobber")]) - -(define_insn "xorqi3" - [(set (match_operand:QI 0 "register_operand" "=r") - (xor:QI (match_operand:QI 1 "register_operand" "%0") - (match_operand:QI 2 "register_operand" "r")))] +(define_insn "xor3" + [(set (match_operand:BW 0 "register_operand" "=r") + (xor:BW (match_operand:BW 1 "register_operand" "%0") + (match_operand:BW 2 "register_operand" "r")))] "" "xor %2,%0" [(set_attr "slottable" "yes") @@ -3056,11 +2366,10 @@ "register_operand" "0"))) (use (match_dup 2))])] "" - " { operands[2] = gen_reg_rtx (SImode); operands[3] = GEN_INT (1 << 31); -}") +}) (define_insn "*expanded_negsf2" [(set (match_operand:SF 0 "register_operand" "=r") @@ -3073,30 +2382,17 @@ ;; No "negdi2" although we could make one up that may be faster than ;; the one in libgcc. -(define_insn "negsi2" - [(set (match_operand:SI 0 "register_operand" "=r") - (neg:SI (match_operand:SI 1 "register_operand" "r")))] - "" - "neg.d %1,%0" - [(set_attr "slottable" "yes")]) - -(define_insn "neghi2" - [(set (match_operand:HI 0 "register_operand" "=r") - (neg:HI (match_operand:HI 1 "register_operand" "r")))] - "" - "neg.w %1,%0" - [(set_attr "slottable" "yes")]) - -(define_insn "negqi2" - [(set (match_operand:QI 0 "register_operand" "=r") - (neg:QI (match_operand:QI 1 "register_operand" "r")))] +(define_insn "neg2" + [(set (match_operand:BWD 0 "register_operand" "=r") + (neg:BWD (match_operand:BWD 1 "register_operand" "r")))] "" - "neg.b %1,%0" + "neg %1,%0" [(set_attr "slottable" "yes")]) ;; One-complements. ;; See comment on anddi3 - no need for a DImode pattern. +;; See also xor comment. (define_insn "one_cmplsi2" [(set (match_operand:SI 0 "register_operand" "=r") @@ -3105,36 +2401,27 @@ "not %0" [(set_attr "slottable" "yes")]) -(define_insn "one_cmplhi2" - [(set (match_operand:HI 0 "register_operand" "=r") - (not:HI (match_operand:HI 1 "register_operand" "0")))] - "" - "not %0" - [(set_attr "slottable" "yes") - (set_attr "cc" "clobber")]) - -(define_insn "one_cmplqi2" - [(set (match_operand:QI 0 "register_operand" "=r") - (not:QI (match_operand:QI 1 "register_operand" "0")))] +(define_insn "one_cmpl2" + [(set (match_operand:BW 0 "register_operand" "=r") + (not:BW (match_operand:BW 1 "register_operand" "0")))] "" "not %0" [(set_attr "slottable" "yes") (set_attr "cc" "clobber")]) -;; Arithmetic shift right. +;; Arithmetic/Logical shift right (and SI left). -(define_insn "ashrsi3" +(define_insn "si3" [(set (match_operand:SI 0 "register_operand" "=r") - (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "Kr")))] + (shift:SI (match_operand:SI 1 "register_operand" "0") + (match_operand:SI 2 "nonmemory_operand" "Kr")))] "" - "* { if (REG_S_P (operands[2])) - return \"asr.d %2,%0\"; + return ".d %2,%0"; - return \"asrq %2,%0\"; -}" + return "q %2,%0"; +} [(set_attr "slottable" "yes")]) ;; Since gcc gets lost, and forgets to zero-extend the source (or mask @@ -3145,237 +2432,86 @@ ;; FIXME: Is this legacy or still true for gcc >= 2.7.2? -(define_expand "ashrhi3" +;; FIXME: Can't parametrize sign_extend and zero_extend (before +;; mentioning "shiftrt"), so we need two patterns. +(define_expand "ashr3" [(set (match_dup 3) - (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "rm"))) + (sign_extend:SI (match_operand:BW 1 "nonimmediate_operand" ""))) (set (match_dup 4) - (zero_extend:SI (match_operand:HI 2 "nonimmediate_operand" "rm"))) + (zero_extend:SI (match_operand:BW 2 "nonimmediate_operand" ""))) (set (match_dup 5) (ashiftrt:SI (match_dup 3) (match_dup 4))) - (set (match_operand:HI 0 "general_operand" "=g") - (subreg:HI (match_dup 5) 0))] - "" - " -{ - int i; - - for (i = 3; i < 6; i++) - operands[i] = gen_reg_rtx (SImode); -}") - -(define_insn "*expanded_ashrhi" - [(set (match_operand:HI 0 "register_operand" "=r") - (ashiftrt:HI (match_operand:HI 1 "register_operand" "0") - (match_operand:HI 2 "register_operand" "r")))] - "" - "asr.w %2,%0" - [(set_attr "slottable" "yes")]) - -(define_insn "*ashrhi_lowpart" - [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r")) - (ashiftrt:HI (match_dup 0) - (match_operand:HI 1 "register_operand" "r")))] - "" - "asr.w %1,%0" - [(set_attr "slottable" "yes")]) - -;; Same comment goes as for "ashrhi3". - -(define_expand "ashrqi3" - [(set (match_dup 3) - (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g"))) - (set (match_dup 4) - (zero_extend:SI (match_operand:QI 2 "nonimmediate_operand" "g"))) - (set (match_dup 5) (ashiftrt:SI (match_dup 3) (match_dup 4))) - (set (match_operand:QI 0 "general_operand" "=g") - (subreg:QI (match_dup 5) 0))] - "" - " -{ - int i; - - for (i = 3; i < 6; i++) - operands[i] = gen_reg_rtx (SImode); -}") - -(define_insn "*expanded_ashrqi" - [(set (match_operand:QI 0 "register_operand" "=r") - (ashiftrt:QI (match_operand:QI 1 "register_operand" "0") - (match_operand:QI 2 "register_operand" "r")))] + (set (match_operand:BW 0 "general_operand" "") + (subreg:BW (match_dup 5) 0))] "" - "asr.b %2,%0" - [(set_attr "slottable" "yes")]) - -;; A strict_low_part matcher. - -(define_insn "*ashrqi_lowpart" - [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r")) - (ashiftrt:QI (match_dup 0) - (match_operand:QI 1 "register_operand" "r")))] - "" - "asr.b %1,%0" - [(set_attr "slottable" "yes")]) - -;; Logical shift right. - -(define_insn "lshrsi3" - [(set (match_operand:SI 0 "register_operand" "=r") - (lshiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "Kr")))] - "" - "* -{ - if (REG_S_P (operands[2])) - return \"lsr.d %2,%0\"; - - return \"lsrq %2,%0\"; -}" - [(set_attr "slottable" "yes")]) - -;; Same comments as for ashrhi3. - -(define_expand "lshrhi3" - [(set (match_dup 3) - (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "g"))) - (set (match_dup 4) - (zero_extend:SI (match_operand:HI 2 "nonimmediate_operand" "g"))) - (set (match_dup 5) (lshiftrt:SI (match_dup 3) (match_dup 4))) - (set (match_operand:HI 0 "general_operand" "=g") - (subreg:HI (match_dup 5) 0))] - "" - " { int i; for (i = 3; i < 6; i++) operands[i] = gen_reg_rtx (SImode); -}") - -(define_insn "*expanded_lshrhi" - [(set (match_operand:HI 0 "register_operand" "=r") - (lshiftrt:HI (match_operand:HI 1 "register_operand" "0") - (match_operand:HI 2 "register_operand" "r")))] - "" - "lsr.w %2,%0" - [(set_attr "slottable" "yes")]) - -;; A strict_low_part matcher. - -(define_insn "*lshrhi_lowpart" - [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r")) - (lshiftrt:HI (match_dup 0) - (match_operand:HI 1 "register_operand" "r")))] - "" - "lsr.w %1,%0" - [(set_attr "slottable" "yes")]) - -;; Same comments as for ashrhi3. +}) -(define_expand "lshrqi3" +(define_expand "lshr3" [(set (match_dup 3) - (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "g"))) + (zero_extend:SI (match_operand:BW 1 "nonimmediate_operand" ""))) (set (match_dup 4) - (zero_extend:SI (match_operand:QI 2 "nonimmediate_operand" "g"))) + (zero_extend:SI (match_operand:BW 2 "nonimmediate_operand" ""))) (set (match_dup 5) (lshiftrt:SI (match_dup 3) (match_dup 4))) - (set (match_operand:QI 0 "general_operand" "=g") - (subreg:QI (match_dup 5) 0))] + (set (match_operand:BW 0 "general_operand" "") + (subreg:BW (match_dup 5) 0))] "" - " { int i; for (i = 3; i < 6; i++) operands[i] = gen_reg_rtx (SImode); -}") +}) -(define_insn "*expanded_lshrqi" - [(set (match_operand:QI 0 "register_operand" "=r") - (lshiftrt:QI (match_operand:QI 1 "register_operand" "0") - (match_operand:QI 2 "register_operand" "r")))] +(define_insn "*expanded_" + [(set (match_operand:BW 0 "register_operand" "=r") + (shiftrt:BW (match_operand:BW 1 "register_operand" "0") + (match_operand:BW 2 "register_operand" "r")))] "" - "lsr.b %2,%0" + " %2,%0" [(set_attr "slottable" "yes")]) -;; A strict_low_part matcher. - -(define_insn "*lshrqi_lowpart" - [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r")) - (lshiftrt:QI (match_dup 0) - (match_operand:QI 1 "register_operand" "r")))] +(define_insn "*_lowpart" + [(set (strict_low_part (match_operand:BW 0 "register_operand" "+r")) + (shiftrt:BW (match_dup 0) + (match_operand:BW 1 "register_operand" "r")))] "" - "lsr.b %1,%0" + " %1,%0" [(set_attr "slottable" "yes")]) ;; Arithmetic/logical shift left. -(define_insn "ashlsi3" - [(set (match_operand:SI 0 "register_operand" "=r") - (ashift:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "nonmemory_operand" "Kr")))] - "" - "* -{ - if (REG_S_P (operands[2])) - return \"lsl.d %2,%0\"; - - return \"lslq %2,%0\"; -}" - [(set_attr "slottable" "yes")]) - ;; For narrower modes than SI, we can use lslq although it makes cc ;; unusable. The win is that we do not have to reload the shift-count ;; into a register. -(define_insn "ashlhi3" - [(set (match_operand:HI 0 "register_operand" "=r,r") - (ashift:HI (match_operand:HI 1 "register_operand" "0,0") - (match_operand:HI 2 "nonmemory_operand" "r,K")))] - "" - "* -{ - return - (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 15) - ? \"moveq 0,%0\" - : (CONSTANT_P (operands[2]) - ? \"lslq %2,%0\" : \"lsl.w %2,%0\"); -}" - [(set_attr "slottable" "yes") - (set_attr "cc" "normal,clobber")]) - -;; A strict_low_part matcher. - -(define_insn "*ashlhi_lowpart" - [(set (strict_low_part (match_operand:HI 0 "register_operand" "+r")) - (ashift:HI (match_dup 0) - (match_operand:HI 1 "register_operand" "r")))] - "" - "lsl.w %1,%0" - [(set_attr "slottable" "yes")]) - -(define_insn "ashlqi3" - [(set (match_operand:QI 0 "register_operand" "=r,r") - (ashift:QI (match_operand:QI 1 "register_operand" "0,0") - (match_operand:QI 2 "nonmemory_operand" "r,K")))] +(define_insn "ashl3" + [(set (match_operand:BW 0 "register_operand" "=r,r") + (ashift:BW (match_operand:BW 1 "register_operand" "0,0") + (match_operand:BW 2 "nonmemory_operand" "r,K")))] "" - "* { return (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) > 7) - ? \"moveq 0,%0\" + && INTVAL (operands[2]) > ) + ? "moveq 0,%0" : (CONSTANT_P (operands[2]) - ? \"lslq %2,%0\" : \"lsl.b %2,%0\"); -}" + ? "lslq %2,%0" : "lsl %2,%0"); +} [(set_attr "slottable" "yes") (set_attr "cc" "normal,clobber")]) ;; A strict_low_part matcher. -(define_insn "*ashlqi_lowpart" - [(set (strict_low_part (match_operand:QI 0 "register_operand" "+r")) - (ashift:QI (match_dup 0) - (match_operand:QI 1 "register_operand" "r")))] +(define_insn "*ashl_lowpart" + [(set (strict_low_part (match_operand:BW 0 "register_operand" "+r")) + (ashift:BW (match_dup 0) + (match_operand:HI 1 "register_operand" "r")))] "" - "lsl.b %1,%0" + "lsl %1,%0" [(set_attr "slottable" "yes")]) ;; Various strange insns that gcc likes. @@ -3398,21 +2534,12 @@ ;; FIXME: GCC should be able to do these expansions itself. -(define_expand "abshi2" - [(set (match_dup 2) - (sign_extend:SI (match_operand:HI 1 "general_operand" "g"))) - (set (match_dup 3) (abs:SI (match_dup 2))) - (set (match_operand:HI 0 "register_operand" "=r") - (subreg:HI (match_dup 3) 0))] - "" - "operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode);") - -(define_expand "absqi2" +(define_expand "abs2" [(set (match_dup 2) - (sign_extend:SI (match_operand:QI 1 "general_operand" "g"))) + (sign_extend:SI (match_operand:BW 1 "general_operand" ""))) (set (match_dup 3) (abs:SI (match_dup 2))) - (set (match_operand:QI 0 "register_operand" "=r") - (subreg:QI (match_dup 3) 0))] + (set (match_operand:BW 0 "register_operand" "") + (subreg:BW (match_dup 3) 0))] "" "operands[2] = gen_reg_rtx (SImode); operands[3] = gen_reg_rtx (SImode);") @@ -3425,21 +2552,20 @@ (umin:SI (match_operand:SI 1 "register_operand" "%0,0, 0,r") (match_operand:SI 2 "general_operand" "r,Q>,g,!STo")))] "" - "* { if (GET_CODE (operands[2]) == CONST_INT) { if (INTVAL (operands[2]) < 256) - return \"bound.b %2,%0\"; + return "bound.b %2,%0"; if (INTVAL (operands[2]) < 65536) - return \"bound.w %2,%0\"; + return "bound.w %2,%0"; } else if (which_alternative == 3) - return \"bound.d %2,%1,%0\"; + return "bound.d %2,%1,%0"; - return \"bound.d %2,%0\"; -}" + return "bound.d %2,%0"; +} [(set_attr "slottable" "yes,yes,no,no")]) ;; Jump and branch insns. @@ -3462,69 +2588,42 @@ "jump %0") ;; Return insn. Used whenever the epilogue is very simple; if it is only -;; a single ret or jump [sp+] or a contiguous sequence of movem:able saved -;; registers. No allocated stack space is allowed. +;; a single ret or jump [sp+]. No allocated stack space or saved +;; registers are allowed. ;; Note that for this pattern, although named, it is ok to check the ;; context of the insn in the test, not only compiler switches. -(define_insn "return" +(define_expand "return" [(return)] "cris_simple_epilogue ()" - "* -{ - int i; - - /* Just needs to hold a 'movem [sp+],rN'. */ - char rd[sizeof (\"movem [$sp+],$r99\")]; - - *rd = 0; - - /* Start from the last call-saved register. We know that we have a - simple epilogue, so we just have to find the last register in the - movem sequence. */ - for (i = 8; i >= 0; i--) - if (regs_ever_live[i] - || (i == PIC_OFFSET_TABLE_REGNUM - && current_function_uses_pic_offset_table)) - break; - - if (i >= 0) - sprintf (rd, \"movem [$sp+],$%s\", reg_names [i]); - - if (regs_ever_live[CRIS_SRP_REGNUM] - || cris_return_address_on_stack ()) - { - if (*rd) - output_asm_insn (rd, operands); - return \"jump [$sp+]\"; - } + "cris_expand_return (cris_return_address_on_stack ()); DONE;") - if (*rd) - { - output_asm_insn (\"reT\", operands); - output_asm_insn (rd, operands); - return \"\"; - } - - return \"ret%#\"; -}" +(define_insn "*return_expanded" + [(return)] + "" +{ + return cris_return_address_on_stack_for_return () + ? "jump [$sp+]" : "ret%#"; +} [(set (attr "slottable") - (if_then_else - (ne (symbol_ref - "(regs_ever_live[CRIS_SRP_REGNUM] - || cris_return_address_on_stack ())") - (const_int 0)) - (const_string "no") ; If jump then not slottable. - (if_then_else - (ne (symbol_ref - "(regs_ever_live[0] - || (flag_pic != 0 && regs_ever_live[1]) - || (PIC_OFFSET_TABLE_REGNUM == 0 - && cris_cfun_uses_pic_table ()))") - (const_int 0)) - (const_string "no") ; ret+movem [sp+],rx: slot already filled. - (const_string "has_slot")))) ; If ret then need to fill a slot. - (set_attr "cc" "none")]) + (if_then_else + (ne (symbol_ref + "(cris_return_address_on_stack_for_return ())") + (const_int 0)) + (const_string "no") + (const_string "has_slot")))]) + +(define_expand "prologue" + [(const_int 0)] + "TARGET_PROLOGUE_EPILOGUE" + "cris_expand_prologue (); DONE;") + +;; Note that the (return) from the expander itself is always the last +;; insn in the epilogue. +(define_expand "epilogue" + [(const_int 0)] + "TARGET_PROLOGUE_EPILOGUE" + "cris_expand_epilogue (); DONE;") ;; Conditional branches. @@ -3532,246 +2631,82 @@ ;; e.g. m68k, so we have to check if overflow bit is set on all "signed" ;; conditions. -(define_insn "beq" - [(set (pc) - (if_then_else (eq (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "beq %l0%#" - [(set_attr "slottable" "has_slot")]) - -(define_insn "bne" - [(set (pc) - (if_then_else (ne (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "bne %l0%#" - [(set_attr "slottable" "has_slot")]) - -(define_insn "bgt" - [(set (pc) - (if_then_else (gt (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "* -{ - return - (cc_prev_status.flags & CC_NO_OVERFLOW) - ? 0 : \"bgt %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "bgtu" - [(set (pc) - (if_then_else (gtu (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "bhi %l0%#" - [(set_attr "slottable" "has_slot")]) - -(define_insn "blt" - [(set (pc) - (if_then_else (lt (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "* -{ - return - (cc_prev_status.flags & CC_NO_OVERFLOW) - ? \"bmi %l0%#\" : \"blt %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "bltu" +(define_insn "b" [(set (pc) - (if_then_else (ltu (cc0) - (const_int 0)) + (if_then_else (ncond (cc0) + (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" - "blo %l0%#" + "b %l0%#" [(set_attr "slottable" "has_slot")]) -(define_insn "bge" +(define_insn "b" [(set (pc) - (if_then_else (ge (cc0) - (const_int 0)) + (if_then_else (ocond (cc0) + (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" - "* { return (cc_prev_status.flags & CC_NO_OVERFLOW) - ? \"bpl %l0%#\" : \"bge %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "bgeu" - [(set (pc) - (if_then_else (geu (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "bhs %l0%#" + ? 0 : "b %l0%#"; +} [(set_attr "slottable" "has_slot")]) -(define_insn "ble" +(define_insn "b" [(set (pc) - (if_then_else (le (cc0) - (const_int 0)) + (if_then_else (rcond (cc0) + (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" - "* { return (cc_prev_status.flags & CC_NO_OVERFLOW) - ? 0 : \"ble %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "bleu" - [(set (pc) - (if_then_else (leu (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "bls %l0%#" + ? "b %l0%#" : "b %l0%#"; +} [(set_attr "slottable" "has_slot")]) ;; Reversed anonymous patterns to the ones above, as mandated. -(define_insn "*beq_reversed" - [(set (pc) - (if_then_else (eq (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "bne %l0%#" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*bne_reversed" - [(set (pc) - (if_then_else (ne (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "beq %l0%#" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*bgt_reversed" - [(set (pc) - (if_then_else (gt (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "* -{ - return - (cc_prev_status.flags & CC_NO_OVERFLOW) - ? 0 : \"ble %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*bgtu_reversed" - [(set (pc) - (if_then_else (gtu (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "bls %l0%#" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*blt_reversed" - [(set (pc) - (if_then_else (lt (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "* -{ - return - (cc_prev_status.flags & CC_NO_OVERFLOW) - ? \"bpl %l0%#\" : \"bge %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*bltu_reversed" +(define_insn "*b_reversed" [(set (pc) - (if_then_else (ltu (cc0) - (const_int 0)) + (if_then_else (ncond (cc0) + (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" - "bhs %l0%#" + "b %l0%#" [(set_attr "slottable" "has_slot")]) -(define_insn "*bge_reversed" +(define_insn "*b_reversed" [(set (pc) - (if_then_else (ge (cc0) - (const_int 0)) + (if_then_else (ocond (cc0) + (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" - "* { return (cc_prev_status.flags & CC_NO_OVERFLOW) - ? \"bmi %l0%#\" : \"blt %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*bgeu_reversed" - [(set (pc) - (if_then_else (geu (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "blo %l0%#" + ? 0 : "b %l0%#"; +} [(set_attr "slottable" "has_slot")]) -(define_insn "*ble_reversed" +(define_insn "*b_reversed" [(set (pc) - (if_then_else (le (cc0) - (const_int 0)) + (if_then_else (rcond (cc0) + (const_int 0)) (pc) (label_ref (match_operand 0 "" ""))))] "" - "* { return (cc_prev_status.flags & CC_NO_OVERFLOW) - ? 0 : \"bgt %l0%#\"; -}" - [(set_attr "slottable" "has_slot")]) - -(define_insn "*bleu_reversed" - [(set (pc) - (if_then_else (leu (cc0) - (const_int 0)) - (pc) - (label_ref (match_operand 0 "" ""))))] - "" - "bhi %l0%#" + ? "b %l0%#" : "b %l0%#"; +} [(set_attr "slottable" "has_slot")]) ;; Set on condition: sCC. @@ -3779,103 +2714,35 @@ ;; Like bCC, we have to check the overflow bit for ;; signed conditions. -(define_insn "sgeu" - [(set (match_operand:SI 0 "register_operand" "=r") - (geu:SI (cc0) (const_int 0)))] - "" - "shs %0" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "sltu" - [(set (match_operand:SI 0 "register_operand" "=r") - (ltu:SI (cc0) (const_int 0)))] - "" - "slo %0" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "seq" - [(set (match_operand:SI 0 "register_operand" "=r") - (eq:SI (cc0) (const_int 0)))] - "" - "seq %0" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "sge" - [(set (match_operand:SI 0 "register_operand" "=r") - (ge:SI (cc0) (const_int 0)))] - "" - "* -{ - return - (cc_prev_status.flags & CC_NO_OVERFLOW) - ? \"spl %0\" : \"sge %0\"; -}" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "sgt" - [(set (match_operand:SI 0 "register_operand" "=r") - (gt:SI (cc0) (const_int 0)))] - "" - "* -{ - return - (cc_prev_status.flags & CC_NO_OVERFLOW) - ? 0 : \"sgt %0\"; -}" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "sgtu" +(define_insn "s" [(set (match_operand:SI 0 "register_operand" "=r") - (gtu:SI (cc0) (const_int 0)))] + (ncond:SI (cc0) (const_int 0)))] "" - "shi %0" + "s %0" [(set_attr "slottable" "yes") (set_attr "cc" "none")]) -(define_insn "sle" +(define_insn "s" [(set (match_operand:SI 0 "register_operand" "=r") - (le:SI (cc0) (const_int 0)))] + (rcond:SI (cc0) (const_int 0)))] "" - "* { return (cc_prev_status.flags & CC_NO_OVERFLOW) - ? 0 : \"sle %0\"; -}" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "sleu" - [(set (match_operand:SI 0 "register_operand" "=r") - (leu:SI (cc0) (const_int 0)))] - "" - "sls %0" + ? "s %0" : "s %0"; +} [(set_attr "slottable" "yes") (set_attr "cc" "none")]) -(define_insn "slt" +(define_insn "s" [(set (match_operand:SI 0 "register_operand" "=r") - (lt:SI (cc0) (const_int 0)))] + (ocond:SI (cc0) (const_int 0)))] "" - "* { return (cc_prev_status.flags & CC_NO_OVERFLOW) - ? \"smi %0\" : \"slt %0\"; -}" - [(set_attr "slottable" "yes") - (set_attr "cc" "none")]) - -(define_insn "sne" - [(set (match_operand:SI 0 "register_operand" "=r") - (ne:SI (cc0) (const_int 0)))] - "" - "sne %0" + ? 0 : "s %0"; +} [(set_attr "slottable" "yes") (set_attr "cc" "none")]) @@ -3891,27 +2758,22 @@ (define_expand "call" [(parallel [(call (match_operand:QI 0 "cris_mem_call_operand" "") (match_operand 1 "general_operand" "")) - ;; 16 is the srp (can't use the symbolic name here) - (clobber (reg:SI 16))])] + (clobber (reg:SI CRIS_SRP_REGNUM))])] "" - " { rtx op0; - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); if (flag_pic) { op0 = XEXP (operands[0], 0); /* It might be that code can be generated that jumps to 0 (or to a - specific address). Don't abort on that. At least there's a - testcase. */ + specific address). Don't die on that. (There is a testcase.) */ if (CONSTANT_ADDRESS_P (op0) && GET_CODE (op0) != CONST_INT) { - if (no_new_pseudos) - abort (); + CRIS_ASSERT (!no_new_pseudos); /* For local symbols (non-PLT), get the plain symbol reference into a register. For symbols that can be PLT, make them PLT. */ @@ -3922,16 +2784,17 @@ for the symbol cause bad recombinatorial effects? */ op0 = force_reg (Pmode, gen_rtx_CONST - (VOIDmode, + (Pmode, gen_rtx_UNSPEC (VOIDmode, - gen_rtvec (1, op0), 0))); + gen_rtvec (1, op0), + CRIS_UNSPEC_PLT))); else - abort (); + internal_error ("Unidentifiable op0"); operands[0] = replace_equiv_address (operands[0], op0); } } -}") +}) ;; Accept *anything* as operand 1. Accept operands for operand 0 in ;; order of preference. @@ -3940,7 +2803,7 @@ [(call (mem:QI (match_operand:SI 0 "cris_general_operand_or_plt_symbol" "r,Q>,g,S")) (match_operand 1 "" "")) - (clobber (reg:SI 16))] ;; 16 is the srp (can't use symbolic name) + (clobber (reg:SI CRIS_SRP_REGNUM))] "! TARGET_AVOID_GOTPLT" "jsr %0") @@ -3950,7 +2813,7 @@ [(call (mem:QI (match_operand:SI 0 "cris_general_operand_or_plt_symbol" "r,Q>,g")) (match_operand 1 "" "")) - (clobber (reg:SI 16))] ;; 16 is the srp (can't use symbolic name) + (clobber (reg:SI CRIS_SRP_REGNUM))] "TARGET_AVOID_GOTPLT" "jsr %0") @@ -3958,27 +2821,22 @@ [(parallel [(set (match_operand 0 "" "") (call (match_operand:QI 1 "cris_mem_call_operand" "") (match_operand 2 "" ""))) - ;; 16 is the srp (can't use symbolic name) - (clobber (reg:SI 16))])] + (clobber (reg:SI CRIS_SRP_REGNUM))])] "" - " { rtx op1; - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); if (flag_pic) { op1 = XEXP (operands[1], 0); /* It might be that code can be generated that jumps to 0 (or to a - specific address). Don't abort on that. At least there's a - testcase. */ + specific address). Don't die on that. (There is a testcase.) */ if (CONSTANT_ADDRESS_P (op1) && GET_CODE (op1) != CONST_INT) { - if (no_new_pseudos) - abort (); + CRIS_ASSERT (!no_new_pseudos); if (cris_gotless_symbol (op1)) op1 = force_reg (Pmode, op1); @@ -3987,16 +2845,17 @@ for the symbol cause bad recombinatorial effects? */ op1 = force_reg (Pmode, gen_rtx_CONST - (VOIDmode, + (Pmode, gen_rtx_UNSPEC (VOIDmode, - gen_rtvec (1, op1), 0))); + gen_rtvec (1, op1), + CRIS_UNSPEC_PLT))); else - abort (); + internal_error ("Unidentifiable op0"); operands[1] = replace_equiv_address (operands[1], op1); } } -}") +}) ;; Accept *anything* as operand 2. The validity other than "general" of ;; operand 0 will be checked elsewhere. Accept operands for operand 1 in @@ -4009,7 +2868,7 @@ (call (mem:QI (match_operand:SI 1 "cris_general_operand_or_plt_symbol" "r,Q>,g,S")) (match_operand 2 "" ""))) - (clobber (reg:SI 16))] + (clobber (reg:SI CRIS_SRP_REGNUM))] "! TARGET_AVOID_GOTPLT" "Jsr %1" [(set_attr "cc" "clobber")]) @@ -4021,7 +2880,7 @@ (call (mem:QI (match_operand:SI 1 "cris_general_operand_or_plt_symbol" "r,Q>,g")) (match_operand 2 "" ""))) - (clobber (reg:SI 16))] + (clobber (reg:SI CRIS_SRP_REGNUM))] "TARGET_AVOID_GOTPLT" "Jsr %1" [(set_attr "cc" "clobber")]) @@ -4035,6 +2894,20 @@ "nop" [(set_attr "cc" "none")]) +;; We need to stop accesses to the stack after the memory is +;; deallocated. Unfortunately, reorg doesn't look at naked clobbers, +;; e.g. (insn ... (clobber (mem:BLK (stack_pointer_rtx)))) and we don't +;; want to use a naked (unspec_volatile) as that would stop any +;; scheduling in the epilogue. Hence we model it as a "real" insn that +;; sets the memory in an unspecified manner. FIXME: Unfortunately it +;; still has the effect of an unspec_volatile. +(define_insn "cris_frame_deallocated_barrier" + [(set (mem:BLK (reg:SI CRIS_SP_REGNUM)) + (unspec:BLK [(const_int 0)] CRIS_UNSPEC_FRAME_DEALLOC))] + "" + "" + [(set_attr "length" "0")]) + ;; We expand on casesi so we can use "bound" and "add offset fetched from ;; a table to pc" (adds.w [pc+%0.w],pc). @@ -4062,13 +2935,12 @@ (label_ref (match_operand 4 "" "")))) (use (label_ref (match_operand 3 "" "")))])] "" - " { operands[2] = plus_constant (operands[2], 1); operands[5] = gen_reg_rtx (SImode); operands[6] = gen_reg_rtx (SImode); operands[7] = gen_reg_rtx (SImode); -}") +}) ;; Split-patterns. Some of them have modes unspecified. This ;; should always be ok; if for no other reason sparc.md has it as @@ -4371,51 +3243,11 @@ (set (match_dup 5) (match_dup 2))] "operands[5] = replace_equiv_address (operands[6], operands[3]);") -;; clear.d [rx=rx+rz.S2] - -(define_split - [(parallel - [(set (mem:SI (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "") - (match_operand:SI 1 "const_int_operand" "")) - (match_operand:SI 2 "register_operand" ""))) - (const_int 0)) - (set (match_operand:SI 3 "register_operand" "") - (plus:SI (mult:SI (match_dup 0) - (match_dup 1)) - (match_dup 2)))])] - "REG_P (operands[2]) && REG_P (operands[3]) - && REGNO (operands[3]) == REGNO (operands[2])" - [(set (match_dup 3) (plus:SI (mult:SI (match_dup 0) (match_dup 1)) - (match_dup 2))) - (set (mem:SI (match_dup 3)) (const_int 0))] - "") - -;; clear.w [rx=rx+rz.S2] - -(define_split - [(parallel - [(set (mem:HI (plus:SI - (mult:SI (match_operand:SI 0 "register_operand" "") - (match_operand:SI 1 "const_int_operand" "")) - (match_operand:SI 2 "register_operand" ""))) - (const_int 0)) - (set (match_operand:SI 3 "register_operand" "") - (plus:SI (mult:SI (match_dup 0) - (match_dup 1)) - (match_dup 2)))])] - "REG_P (operands[2]) && REG_P (operands[3]) - && REGNO (operands[3]) == REGNO (operands[2])" - [(set (match_dup 3) (plus:SI (mult:SI (match_dup 0) (match_dup 1)) - (match_dup 2))) - (set (mem:HI (match_dup 3)) (const_int 0))] - "") - -;; clear.b [rx=rx+rz.S2] +;; clear.[bwd] [rx=rx+rz.S2] (define_split [(parallel - [(set (mem:QI (plus:SI + [(set (mem:BWD (plus:SI (mult:SI (match_operand:SI 0 "register_operand" "") (match_operand:SI 1 "const_int_operand" "")) (match_operand:SI 2 "register_operand" ""))) @@ -4428,48 +3260,14 @@ && REGNO (operands[3]) == REGNO (operands[2])" [(set (match_dup 3) (plus:SI (mult:SI (match_dup 0) (match_dup 1)) (match_dup 2))) - (set (mem:QI (match_dup 3)) (const_int 0))] - "") - -;; clear.d [rx=rx+i] - -(define_split - [(parallel - [(set (mem:SI - (plus:SI (match_operand:SI 0 "cris_bdap_operand" "") - (match_operand:SI 1 "cris_bdap_operand" ""))) - (const_int 0)) - (set (match_operand:SI 2 "register_operand" "") - (plus:SI (match_dup 0) - (match_dup 1)))])] - "(rtx_equal_p (operands[0], operands[2]) - || rtx_equal_p (operands[2], operands[1]))" - [(set (match_dup 2) (plus:SI (match_dup 0) (match_dup 1))) - (set (mem:SI (match_dup 2)) (const_int 0))] - "") - -;; clear.w [rx=rx+i] - -(define_split - [(parallel - [(set (mem:HI - (plus:SI (match_operand:SI 0 "cris_bdap_operand" "") - (match_operand:SI 1 "cris_bdap_operand" ""))) - (const_int 0)) - (set (match_operand:SI 2 "register_operand" "") - (plus:SI (match_dup 0) - (match_dup 1)))])] - "(rtx_equal_p (operands[0], operands[2]) - || rtx_equal_p (operands[2], operands[1]))" - [(set (match_dup 2) (plus:SI (match_dup 0) (match_dup 1))) - (set (mem:HI (match_dup 2)) (const_int 0))] + (set (mem:BWD (match_dup 3)) (const_int 0))] "") -;; clear.b [rx=rx+i] +;; clear.[bwd] [rx=rx+i] (define_split [(parallel - [(set (mem:QI + [(set (mem:BWD (plus:SI (match_operand:SI 0 "cris_bdap_operand" "") (match_operand:SI 1 "cris_bdap_operand" ""))) (const_int 0)) @@ -4479,7 +3277,7 @@ "(rtx_equal_p (operands[0], operands[2]) || rtx_equal_p (operands[2], operands[1]))" [(set (match_dup 2) (plus:SI (match_dup 0) (match_dup 1))) - (set (mem:QI (match_dup 2)) (const_int 0))] + (set (mem:BWD (match_dup 2)) (const_int 0))] "") ;; mov(s|u).S1 [rx=rx+rz.S2],ry @@ -4945,6 +3743,8 @@ [(match_dup 3) (match_operator 5 "cris_mem_op" [(match_dup 0)])]))] + ;; FIXME: What about DFmode? + ;; Change to GET_MODE_SIZE (GET_MODE (operands[3])) <= UNITS_PER_WORD? "GET_MODE (operands[3]) != DImode && REGNO (operands[0]) != REGNO (operands[3]) && ! CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'J') diff --git a/gcc/config/cris/cris.opt b/gcc/config/cris/cris.opt new file mode 100644 index 00000000000..0aad8e7d14c --- /dev/null +++ b/gcc/config/cris/cris.opt @@ -0,0 +1,191 @@ +; Options for the CRIS port of the compiler. + +; Copyright (C) 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. + +; TARGET_MUL_BUG: Whether or not to work around multiplication +; instruction hardware bug when generating code for models where +; it may be present. From the trouble report for Etrax 100 LX: +; "A multiply operation may cause incorrect cache behaviour +; under some specific circumstances. The problem can occur if +; the instruction following the multiply instruction causes a +; cache miss, and multiply operand 1 (source operand) bits +; [31:27] matches the logical mapping of the mode register +; address (0xb0....), and bits [9:2] of operand 1 matches the +; TLB register address (0x258-0x25f). There is such a mapping +; in kernel mode or when the MMU is off. Normally there is no +; such mapping in user mode, and the problem will therefore +; probably not occur in Linux user mode programs." +; +; We have no sure-fire way to know from within GCC that we're +; compiling a user program. For example, -fpic/PIC is used in +; libgcc which is linked into the kernel. However, the +; workaround option -mno-mul-bug can be safely used per-package +; when compiling programs. The same goes for general user-only +; libraries such as glibc, since there's no user-space +; driver-like program that gets a mapping of I/O registers (all +; on the same page, including the TLB registers). +mmul-bug-workaround +Target Report Mask(MUL_BUG) +Work around bug in multiplication instruction + +; TARGET_ETRAX4_ADD: Instruction-set additions from Etrax 4 and up. +; (Just "lz", which we don't really generate from GCC -- yet). +metrax4 +Target Report Mask(ETRAX4_ADD) +Compile for ETRAX 4 (CRIS v3) + +; See cris_handle_option. +metrax100 +Target Report RejectNegative +Compile for ETRAX 100 (CRIS v8) + +; See cris_handle_option. +mno-etrax100 +Target Report RejectNegative Undocumented + +mpdebug +Target Report Mask(PDEBUG) +Emit verbose debug information in assembly code + +; TARGET_CCINIT: Whether to use condition-codes generated by +; insns other than the immediately preceding compare/test insn. +; Used to check for errors in notice_update_cc. +mcc-init +Target Report Mask(CCINIT) +Do not use condition codes from normal instructions + +; TARGET_SIDE_EFFECT_PREFIXES: Whether to use side-effect +; patterns. Used to debug the [rx=ry+i] type patterns. +mside-effects +Target Report RejectNegative Mask(SIDE_EFFECT_PREFIXES) Undocumented + +mno-side-effects +Target Report RejectNegative InverseMask(SIDE_EFFECT_PREFIXES) +Do not emit addressing modes with side-effect assignment + +; TARGET_STACK_ALIGN: Whether to *keep* (not force) alignment of +; stack at 16 (or 32, depending on TARGET_ALIGN_BY_32) bits. +mstack-align +Target Report RejectNegative Mask(STACK_ALIGN) Undocumented + +mno-stack-align +Target Report RejectNegative InverseMask(STACK_ALIGN) +Do not tune stack alignment + +; TARGET_DATA_ALIGN: Whether to do alignment on individual +; modifiable objects. +mdata-align +Target Report RejectNegative Mask(DATA_ALIGN) Undocumented + +mno-data-align +Target Report RejectNegative InverseMask(DATA_ALIGN) +Do not tune writable data alignment + +; TARGET_CONST_ALIGN: Whether to do alignment on individual +; non-modifiable objects. +mconst-align +Target Report RejectNegative Mask(CONST_ALIGN) Undocumented + +mno-const-align +Target Report RejectNegative InverseMask(CONST_ALIGN) +Do not tune code and read-only data alignment + +; See cris_handle_option. +m32-bit +Target Report RejectNegative Undocumented + +; See cris_handle_option. +m32bit +Target Report RejectNegative +Align code and data to 32 bits + +; See cris_handle_option. +m16-bit +Target Report RejectNegative Undocumented + +; See cris_handle_option. +m16bit +Target Report RejectNegative Undocumented + +; See cris_handle_option. +m8-bit +Target Report RejectNegative Undocumented + +; See cris_handle_option. +m8bit +Target Report RejectNegative +Don't align items in code or data + +; TARGET_PROLOGUE_EPILOGUE: Whether or not to omit function +; prologue and epilogue. +mprologue-epilogue +Target Report RejectNegative Mask(PROLOGUE_EPILOGUE) Undocumented + +mno-prologue-epilogue +Target Report RejectNegative InverseMask(PROLOGUE_EPILOGUE) +Do not emit function prologue or epilogue + +; We have to handle this m-option here since we can't wash it +; off in both CC1_SPEC and CC1PLUS_SPEC. + +mbest-lib-options +Target Report RejectNegative +Use the most feature-enabling options allowed by other options + +; FIXME: The following comment relates to gcc before cris.opt. +; Check it it's still valid: +; We must call it "override-" since calling it "no-" will cause +; gcc.c to forget it, if there's a "later" -mbest-lib-options. +; Kludgy, but needed for some multilibbed files. +moverride-best-lib-options +Target Report RejectNegative +Override -mbest-lib-options + +mcpu= +Target Report RejectNegative Joined Undocumented + +march= +Target Report RejectNegative Joined +-march=ARCH Generate code for the specified chip or CPU version + +mtune= +Target Report RejectNegative Joined +-mtune=ARCH Tune alignment for the specified chip or CPU version + +mmax-stackframe= +Target Report RejectNegative Joined +-mmax-stackframe=SIZE Warn when a stackframe is larger than the specified size + +max-stackframe= +Target Report RejectNegative Joined Undocumented + +; TARGET_SVINTO: Currently this just affects alignment. FIXME: +; Redundant with TARGET_ALIGN_BY_32, or put machine stuff here? +; This and the others below could just as well be variables and +; TARGET_* defines in cris.h. +Mask(SVINTO) + +; TARGET_ALIGN_BY_32: Say that all alignment specifications say +; to prefer 32 rather than 16 bits. +Mask(ALIGN_BY_32) + +; TARGET_AVOID_GOTPLT is referred to in the .c and the .md so we +; need to allocate the flag and macros here. +Mask(AVOID_GOTPLT) diff --git a/gcc/config/cris/elf.opt b/gcc/config/cris/elf.opt new file mode 100644 index 00000000000..f861843634c --- /dev/null +++ b/gcc/config/cris/elf.opt @@ -0,0 +1,23 @@ +; ELF-specific options for the CRIS port of the compiler. + +; Copyright (C) 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. + +melf +Target Report RejectNegative Undocumented diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h index f842f949d64..4c7b1d871d7 100644 --- a/gcc/config/cris/linux.h +++ b/gcc/config/cris/linux.h @@ -1,5 +1,5 @@ /* Definitions for GCC. Part of the machine description for CRIS. - Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. Contributed by Axis Communications. Written by Hans-Peter Nilsson. This file is part of GCC. @@ -60,21 +60,15 @@ Boston, MA 02111-1307, USA. */ %{!fleading-underscore:--no-underscore}\ %{fPIC|fpic|fPIE|fpie: --pic}" -/* Provide a legacy -mlinux option. */ -#undef CRIS_SUBTARGET_SWITCHES -#define CRIS_SUBTARGET_SWITCHES \ - {"linux", 0, ""}, \ - {"gotplt", -TARGET_MASK_AVOID_GOTPLT, ""}, \ - {"no-gotplt", TARGET_MASK_AVOID_GOTPLT, \ - N_("Together with -fpic and -fPIC, do not use GOTPLT references")}, +/* Previously controlled by target_flags. */ +#undef TARGET_LINUX +#define TARGET_LINUX 1 #undef CRIS_SUBTARGET_DEFAULT #define CRIS_SUBTARGET_DEFAULT \ - (TARGET_MASK_SVINTO \ - + TARGET_MASK_ETRAX4_ADD \ - + TARGET_MASK_ALIGN_BY_32 \ - + TARGET_MASK_ELF \ - + TARGET_MASK_LINUX) + (MASK_SVINTO \ + + MASK_ETRAX4_ADD \ + + MASK_ALIGN_BY_32) #undef CRIS_DEFAULT_CPU_VERSION #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG diff --git a/gcc/config/cris/linux.opt b/gcc/config/cris/linux.opt new file mode 100644 index 00000000000..559fc6a61f7 --- /dev/null +++ b/gcc/config/cris/linux.opt @@ -0,0 +1,34 @@ +; GNU/Linux-specific options for the CRIS port of the compiler. + +; Copyright (C) 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. + +; Provide a legacy -mlinux option. +mlinux +Target Report RejectNegative Undocumented + +mno-gotplt +Target Report RejectNegative Mask(AVOID_GOTPLT) MaskExists +Together with -fpic and -fPIC, do not use GOTPLT references + +; There's a small added setup cost with using GOTPLT references +; for the first (resolving) call, but should in total be a win +; both in code-size and execution-time. +mgotplt +Target Report RejectNegative InverseMask(AVOID_GOTPLT) Undocumented diff --git a/gcc/config/cris/predicates.md b/gcc/config/cris/predicates.md new file mode 100644 index 00000000000..2d5ef19f02e --- /dev/null +++ b/gcc/config/cris/predicates.md @@ -0,0 +1,170 @@ +;; Operand and operator predicates for the GCC CRIS port. +;; Copyright (C) 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. + + +;; Operator predicates. + +(define_predicate "cris_orthogonal_operator" + (match_code "plus, minus, ior, and, umin")) + +(define_predicate "cris_commutative_orth_op" + (match_code "plus, ior, and, umin")) + +;; By the name, you might think we should include MULT. We don't because +;; it doesn't accept the same addressing modes as the others (only +;; registers) and there's also the problem of handling TARGET_MUL_BUG. + +(define_predicate "cris_operand_extend_operator" + (match_code "plus, minus, umin")) + +(define_predicate "cris_additive_operand_extend_operator" + (match_code "plus, minus")) + +(define_predicate "cris_extend_operator" + (match_code "zero_extend, sign_extend")) + +(define_predicate "cris_plus_or_bound_operator" + (match_code "plus, umin")) + +;; Used as an operator to get a handle on a already-known-valid MEM rtx:es +;; (no need to validate the address), where some address expression parts +;; have their own match_operand. + +(define_predicate "cris_mem_op" + (match_code "mem")) + +(define_predicate "cris_load_multiple_op" + (and (match_code "parallel") + (match_test "cris_movem_load_rest_p (op, 0)"))) + +(define_predicate "cris_store_multiple_op" + (and (match_code "parallel") + (match_test "cris_store_multiple_op_p (op)"))) + + +;; Operand helper predicates. + +(define_predicate "cris_bdap_const_operand" + (and (match_code "label_ref, symbol_ref, const_int, const_double, const") + (not (and (match_test "flag_pic") + (match_test "cris_symbol (op)"))))) + +(define_predicate "cris_simple_address_operand" + (ior (match_operand:SI 0 "register_operand") + (and (match_code "post_inc") + (match_test "register_operand (XEXP (op, 0), Pmode)")))) + +(define_predicate "cris_simple_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "mem") + (match_test "cris_simple_address_operand (XEXP (op, 0), + Pmode)")))) + +;; The caller needs to use :SI. +(define_predicate "cris_bdap_sign_extend_operand" + (and (match_code "sign_extend") + (and (match_test "MEM_P (XEXP (op, 0))") + (match_test "cris_simple_address_operand (XEXP (XEXP (op, 0), 0), + Pmode)")))) + +;; FIXME: Should not have to test for 1. +(define_predicate "cris_scale_int_operand" + (and (match_code "const_int") + (ior (ior (match_test "op == GEN_INT (4)") + (match_test "op == const2_rtx")) + (match_test "op == const1_rtx")))) + +;; FIXME: Should be able to assume (reg int). +(define_predicate "cris_biap_mult_operand" + (and (match_code "mult") + (ior (and (match_test "register_operand (XEXP (op, 0), Pmode)") + (match_test "cris_scale_int_operand (XEXP (op, 1), Pmode)")) + (and (match_test "cris_scale_int_operand (XEXP (op, 0), Pmode)") + (match_test "register_operand (XEXP (op, 1), Pmode)"))))) + + +;; Operand predicates. + +;; This checks a part of an address, the one that is not a plain register +;; for an addressing mode using BDAP. +;; Allowed operands are either: +;; a) a register +;; b) a CONST operand (but not a symbol when generating PIC) +;; c) a [r] or [r+] in SImode, or sign-extend from HI or QI. + +(define_predicate "cris_bdap_operand" + (ior (match_operand 0 "cris_bdap_const_operand") + (ior (match_operand:SI 0 "cris_simple_operand") + (match_operand:SI 0 "cris_bdap_sign_extend_operand")))) + +;; This is similar to cris_bdap_operand: +;; It checks a part of an address, the one that is not a plain register +;; for an addressing mode using BDAP or BIAP. +;; Allowed operands are either: +;; a) a register +;; b) a CONST operand (but not a symbol when generating PIC) +;; c) a mult of (1, 2 or 4) and a register +;; d) a [r] or [r+] in SImode, or sign-extend from HI or QI. */ + +(define_predicate "cris_bdap_biap_operand" + (ior (match_operand 0 "cris_bdap_operand") + (match_operand 0 "cris_biap_mult_operand"))) + +;; Since a PIC symbol without a GOT entry is not a general_operand, we +;; have to have a predicate that matches it. We use this in the expanded +;; "movsi" anonymous pattern. +;; FIXME: Can s/special_// when PR 20413 is fixed. + +(define_special_predicate "cris_general_operand_or_gotless_symbol" + (ior (match_operand 0 "general_operand") + (and (match_code "const, symbol_ref, label_ref, unspec") + (match_test "cris_gotless_symbol (op)")))) + +;; Since with -fPIC, not all symbols are valid PIC symbols or indeed +;; general_operands, we have to have a predicate that matches it for the +;; "movsi" expander. +;; FIXME: Can s/special_// when PR 20413 is fixed. + +(define_special_predicate "cris_general_operand_or_symbol" + (ior (match_operand 0 "general_operand") + (and (match_code "const, symbol_ref, label_ref") + (match_test "cris_symbol (op)")))) + +;; Since a PLT symbol is not a general_operand, we have to have a +;; predicate that matches it when we need it. We use this in the expanded +;; "call" and "call_value" anonymous patterns. + +(define_predicate "cris_general_operand_or_plt_symbol" + (ior (match_operand 0 "general_operand") + (and (match_code "const") + (and (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC") + (not (match_test "TARGET_AVOID_GOTPLT")))))) + +;; This matches a (MEM (general_operand)) or +;; (MEM (cris_general_operand_or_symbol)). The second one isn't a valid +;; memory_operand, so we need this predicate to recognize call +;; destinations before we change them to a PLT operand (by wrapping in +;; UNSPEC CRIS_UNSPEC_PLT). + +(define_predicate "cris_mem_call_operand" + (and (match_code "mem") + (ior (match_operand 0 "memory_operand") + (match_test "cris_general_operand_or_symbol (XEXP (op, 0), + Pmode)")))) diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index feb26f185d2..db0036a0bf5 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -1,5 +1,5 @@ /* Darwin support needed only by C/C++ frontends. - Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. @@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA. */ /* Pragmas. */ -#define BAD(msgid) do { warning (msgid); return; } while (0) +#define BAD(msgid) do { warning (0, msgid); return; } while (0) static bool using_frameworks = false; @@ -111,7 +111,7 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED) BAD ("malformed '#pragma options', ignoring"); if (c_lex (&x) != CPP_EOF) - warning ("junk at end of '#pragma options'"); + warning (0, "junk at end of '#pragma options'"); arg = IDENTIFIER_POINTER (t); if (!strcmp (arg, "mac68k")) @@ -121,7 +121,7 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED) else if (!strcmp (arg, "reset")) pop_field_alignment (); else - warning ("malformed '#pragma options align={mac68k|power|reset}', ignoring"); + warning (0, "malformed '#pragma options align={mac68k|power|reset}', ignoring"); } /* #pragma unused ([var {, var}*]) */ @@ -154,7 +154,7 @@ darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED) BAD ("missing ')' after '#pragma unused', ignoring"); if (c_lex (&x) != CPP_EOF) - warning ("junk at end of '#pragma unused'"); + warning (0, "junk at end of '#pragma unused'"); } static struct { @@ -270,6 +270,26 @@ framework_construct_pathname (const char *fname, cpp_dir *dir) strncpy (&frname[frname_len], ".framework/", strlen (".framework/")); frname_len += strlen (".framework/"); + if (fast_dir == 0) + { + frname[frname_len-1] = 0; + if (stat (frname, &st) == 0) + { + /* As soon as we find the first instance of the framework, + we stop and never use any later instance of that + framework. */ + add_framework (fname, fname_len, dir); + } + else + { + /* If we can't find the parent directory, no point looking + further. */ + free (frname); + return 0; + } + frname[frname_len-1] = '/'; + } + /* Append framework_header_dirs and header file name */ for (i = 0; framework_header_dirs[i].dirName; i++) { @@ -280,11 +300,7 @@ framework_construct_pathname (const char *fname, cpp_dir *dir) &fname[fname_len]); if (stat (frname, &st) == 0) - { - if (fast_dir == 0) - add_framework (fname, fname_len, dir); - return frname; - } + return frname; } free (frname); @@ -364,7 +380,7 @@ find_subframework_file (const char *fname, const char *pname) if (fast_dir != &subframe_dir) { if (fast_dir) - warning ("subframework include %s conflicts with framework include", + warning (0, "subframework include %s conflicts with framework include", fname); else add_framework (fname, fname_len, &subframe_dir); diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 6a547384aae..602df2f7f70 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -55,12 +55,12 @@ Boston, MA 02111-1307, USA. */ running program and replace existing functions and methods of that translation unit with with versions of those functions and methods from the newly compiled translation unit. The new functions access - the existing static data from the old translation unit, if the data - existed in the unit to be replaced, and from the new translation - unit, for new data. + the existing static symbols from the old translation unit, if the + symbol existed in the unit to be replaced, and from the new + translation unit, otherwise. - The changes are to insert 4 nops at the beginning of all functions - and to use indirection to get at static duration data. The 4 nops + The changes are to insert 5 nops at the beginning of all functions + and to use indirection to get at static symbols. The 5 nops are required by consumers of the generated code. Currently, gdb uses this to patch in a jump to the overriding function, this allows all uses of the old name to forward to the replacement, @@ -68,19 +68,15 @@ Boston, MA 02111-1307, USA. */ rs6000_emit_prologue for the code that handles the nop insertions. The added indirection allows gdb to redirect accesses to static - duration data from the newly loaded translation unit to the - existing data, if any. @code{static} data is special and is - handled by setting the second word in the .non_lazy_symbol_pointer - data structure to the address of the data. See indirect_data for - the code that handles the extra indirection, and - machopic_output_indirection and its use of MACHO_SYMBOL_STATIC for - the code that handles @code{static} data indirection. */ + symbols from the newly loaded translation unit to the existing + symbol, if any. @code{static} symbols are special and are handled by + setting the second word in the .non_lazy_symbol_pointer data + structure to symbol. See indirect_data for the code that handles + the extra indirection, and machopic_output_indirection and its use + of MACHO_SYMBOL_STATIC for the code that handles @code{static} + symbol indirection. */ -/* Nonzero if the user passes the -mone-byte-bool switch, which forces - sizeof(bool) to be 1. */ -const char *darwin_one_byte_bool = 0; - int name_needs_quotes (const char *name) { @@ -169,7 +165,7 @@ indirect_data (rtx sym_ref) lprefix = (((name[0] == '*' || name[0] == '&') && (name[1] == 'L' || (name[1] == '"' && name[2] == 'L'))) - || (strncmp (name, "_OBJC_", 6))); + || (strncmp (name, "_OBJC_", 6) == 0)); return ! lprefix; } @@ -195,8 +191,8 @@ void machopic_define_symbol (rtx mem) { rtx sym_ref; - if (GET_CODE (mem) != MEM) - abort (); + + gcc_assert (GET_CODE (mem) == MEM); sym_ref = XEXP (mem, 0); SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED; } @@ -207,8 +203,7 @@ const char * machopic_function_base_name (void) { /* if dynamic-no-pic is on, we should not get here */ - if (MACHO_DYNAMIC_NO_PIC_P) - abort (); + gcc_assert (!MACHO_DYNAMIC_NO_PIC_P); if (function_base == NULL) function_base = @@ -241,8 +236,7 @@ machopic_output_function_base_name (FILE *file) const char *current_name; /* If dynamic-no-pic is on, we should not get here. */ - if (MACHO_DYNAMIC_NO_PIC_P) - abort (); + gcc_assert (!MACHO_DYNAMIC_NO_PIC_P); current_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)); if (function_base_func_name != current_name) @@ -306,44 +300,41 @@ machopic_indirection_name (rtx sym_ref, bool stub_p) size_t namelen = strlen (name); machopic_indirection *p; void ** slot; + bool saw_star = false; + bool needs_quotes; + const char *suffix; + const char *prefix = user_label_prefix; + const char *quote = ""; - /* Construct the name of the non-lazy pointer or stub. */ - if (stub_p) + if (name[0] == '*') { - int needs_quotes = name_needs_quotes (name); - buffer = alloca (strlen ("&L") - + namelen - + strlen (STUB_SUFFIX) - + 2 /* possible quotes */ - + 1 /* '\0' */); - - if (needs_quotes) - { - if (name[0] == '*') - sprintf (buffer, "&\"L%s" STUB_SUFFIX "\"", name + 1); - else - sprintf (buffer, "&\"L%s%s" STUB_SUFFIX "\"", user_label_prefix, - name); - } - else if (name[0] == '*') - sprintf (buffer, "&L%s" STUB_SUFFIX, name + 1); - else - sprintf (buffer, "&L%s%s" STUB_SUFFIX, user_label_prefix, name); + saw_star = true; + prefix = ""; + ++name; + --namelen; } - else + + needs_quotes = name_needs_quotes (name); + if (needs_quotes) { - buffer = alloca (strlen ("&L") - + strlen (user_label_prefix) - + namelen - + strlen (NON_LAZY_POINTER_SUFFIX) - + 1 /* '\0' */); - if (name[0] == '*') - sprintf (buffer, "&L%s" NON_LAZY_POINTER_SUFFIX, name + 1); - else - sprintf (buffer, "&L%s%s" NON_LAZY_POINTER_SUFFIX, - user_label_prefix, name); + quote = "\""; } + if (stub_p) + suffix = STUB_SUFFIX; + else + suffix = NON_LAZY_POINTER_SUFFIX; + + buffer = alloca (strlen ("&L") + + strlen (prefix) + + namelen + + strlen (suffix) + + 2 * strlen (quote) + + 1 /* '\0' */); + + /* Construct the name of the non-lazy pointer or stub. */ + sprintf (buffer, "&%sL%s%s%s%s", quote, prefix, name, suffix, quote); + if (!machopic_indirections) machopic_indirections = htab_create_ggc (37, machopic_indirection_hash, @@ -432,7 +423,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) emit_insn (gen_macho_low (reg, reg, orig)); #else /* some other cpu -- writeme! */ - abort (); + gcc_unreachable (); #endif return reg; } @@ -447,8 +438,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) #if defined (TARGET_TOC) /* i.e., PowerPC */ rtx hi_sum_reg = (no_new_pseudos ? reg : gen_reg_rtx (Pmode)); - if (reg == NULL) - abort (); + gcc_assert (reg); emit_insn (gen_rtx_SET (Pmode, hi_sum_reg, gen_rtx_PLUS (Pmode, pic_offset_table_rtx, @@ -459,7 +449,7 @@ machopic_indirect_data_reference (rtx orig, rtx reg) orig = reg; #else #if defined (HAVE_lo_sum) - if (reg == 0) abort (); + gcc_assert (reg); emit_insn (gen_rtx_SET (VOIDmode, reg, gen_rtx_HIGH (Pmode, offset))); @@ -609,10 +599,8 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) { if (reg == 0) { - if (reload_in_progress) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!reload_in_progress); + reg = gen_reg_rtx (Pmode); } #ifdef HAVE_lo_sum @@ -631,7 +619,7 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) emit_insn (gen_rtx_SET (VOIDmode, reg, mem)); #else /* Some other CPU -- WriteMe! but right now there are no other platform that can use dynamic-no-pic */ - abort (); + gcc_unreachable (); #endif pic_ref = reg; } @@ -724,10 +712,8 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) if (reg == 0) { - if (reload_in_progress) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!reload_in_progress); + reg = gen_reg_rtx (Pmode); } hi_sum_reg = reg; @@ -918,7 +904,7 @@ machopic_output_indirection (void **slot, void *data) the non-lazy symbol pointer data structure when they are defined. This allows the runtime to rebind newer instances of the translation unit with the original instance of the - data. */ + symbol. */ if ((SYMBOL_REF_FLAGS (symbol) & MACHO_SYMBOL_STATIC) && machopic_symbol_defined_p (symbol)) @@ -994,9 +980,7 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) && DECL_INITIAL (decl) != error_mark_node))) SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED; - if (TREE_CODE (decl) == VAR_DECL - && indirect_data (sym_ref) - && ! TREE_PUBLIC (decl)) + if (! TREE_PUBLIC (decl)) SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC; } @@ -1016,12 +1000,17 @@ machopic_select_section (tree exp, int reloc, bool weak_p = DECL_P (exp) && DECL_WEAK (exp); static void (* const base_funs[][2])(void) = { { text_section, text_coal_section }, - { text_unlikely_section, text_unlikely_coal_section }, + { unlikely_text_section, text_unlikely_coal_section }, { readonly_data_section, const_coal_section }, { const_data_section, const_data_coal_section }, { data_section, data_coal_section } }; + if (reloc == 0 + && (last_text_section == in_text_unlikely + || last_text_section == in_text_unlikely_coal)) + reloc = 1; + if (TREE_CODE (exp) == FUNCTION_DECL) base_function = base_funs[reloc][weak_p]; else if (decl_readonly_section_1 (exp, reloc, MACHOPIC_INDIRECT)) @@ -1233,7 +1222,7 @@ darwin_handle_weak_import_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL && TREE_CODE (*node) != VAR_DECL) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else @@ -1260,8 +1249,7 @@ darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty) ? DECL_ASSEMBLER_NAME (decl) : DECL_NAME (decl); - const char *prefix = "_"; - const int prefix_len = 1; + const char *prefix = user_label_prefix; const char *base = IDENTIFIER_POINTER (id); unsigned int base_len = IDENTIFIER_LENGTH (id); @@ -1275,7 +1263,8 @@ darwin_emit_unwind_label (FILE *file, tree decl, int for_eh, int empty) if (! for_eh) suffix = ".eh1"; - lab = xmalloc (prefix_len + base_len + strlen (suffix) + quotes_len + 1); + lab = xmalloc (strlen (prefix) + + base_len + strlen (suffix) + quotes_len + 1); lab[0] = '\0'; if (need_quotes) @@ -1319,8 +1308,7 @@ darwin_non_lazy_pcrel (FILE *file, rtx addr) { const char *nlp_name; - if (GET_CODE (addr) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (addr) == SYMBOL_REF); nlp_name = machopic_indirection_name (addr, /*stub_p=*/false); fputs ("\t.long\t", file); @@ -1347,7 +1335,7 @@ darwin_assemble_visibility (tree decl, int vis) fputs ("\n", asm_out_file); } else - warning ("internal and protected visibility attributes not supported " + warning (0, "internal and protected visibility attributes not supported " "in this configuration; ignored"); } @@ -1392,13 +1380,4 @@ darwin_file_end (void) fprintf (asm_out_file, "\t.subsections_via_symbols\n"); } -/* True, iff we're generating fast turn around debugging code. When - true, we arrange for function prologues to start with 4 nops so - that gdb may insert code to redirect them, and for data to accessed - indirectly. The runtime uses this indirection to forward - references for data to the original instance of that data. */ - -int darwin_fix_and_continue; -const char *darwin_fix_and_continue_switch; - #include "gt-darwin.h" diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index 937b4977fcd..c2a53d0b45e 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -140,24 +140,6 @@ Boston, MA 02111-1307, USA. */ { "-unexported_symbols_list", "-Zunexported_symbols_list" }, \ SUBTARGET_OPTION_TRANSLATE_TABLE -/* 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, - but there are no more bits in rs6000 TARGET_SWITCHES. Note - that this switch has no "no-" variant. */ -extern const char *darwin_one_byte_bool; - -extern int darwin_fix_and_continue; -extern const char *darwin_fix_and_continue_switch; - -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - {"one-byte-bool", &darwin_one_byte_bool, N_("Set sizeof(bool) to 1"), 0 }, \ - {"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} - /* These compiler options take n arguments. */ #undef WORD_SWITCH_TAKES_ARG @@ -392,7 +374,7 @@ extern const char *darwin_fix_and_continue_switch; do { \ if (ALIAS) \ { \ - warning ("alias definitions not supported in Mach-O; ignored"); \ + warning (0, "alias definitions not supported in Mach-O; ignored"); \ break; \ } \ \ @@ -551,7 +533,10 @@ 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); \ + if (xname[1] != '"' && name_needs_quotes (&xname[1])) \ + fprintf (FILE, "\"%s\"", &xname[1]); \ + else \ + fputs (&xname[1], FILE); \ } \ else if (xname[0] == '+' || xname[0] == '-') \ fprintf (FILE, "\"%s\"", xname); \ @@ -559,6 +544,8 @@ 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); \ + else if (xname[0] != '"' && name_needs_quotes (xname)) \ + fprintf (FILE, "\"%s\"", xname); \ else \ asm_fprintf (FILE, "%U%s", xname); \ } while (0) @@ -585,9 +572,11 @@ extern const char *darwin_fix_and_continue_switch; #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ do { \ + unsigned HOST_WIDE_INT _new_size = SIZE; \ fputs (".lcomm ", (FILE)); \ assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", (SIZE), \ + if (_new_size == 0) _new_size = 1; \ + fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", _new_size, \ floor_log2 ((ALIGN) / BITS_PER_UNIT)); \ if ((DECL) && ((TREE_STATIC (DECL) \ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \ @@ -619,6 +608,10 @@ FUNCTION (void) \ if (asm_out_file) \ fputs ("\t" DIRECTIVE "\n", asm_out_file); \ in_section = SECTION; \ + if ((SECTION == in_text_coal) \ + || (SECTION == in_text_unlikely) \ + || (SECTION == in_text_unlikely_coal)) \ + last_text_section = SECTION; \ } \ } \ @@ -658,10 +651,6 @@ SECTION_FUNCTION (text_coal_section, \ in_text_coal, \ ".section __TEXT,__textcoal_nt,coalesced," \ "pure_instructions", 0) \ -SECTION_FUNCTION (text_unlikely_section, \ - in_text_unlikely, \ - ".section __TEXT,__text_unlikely,coalesced," \ - "pure_instructions", 0) \ SECTION_FUNCTION (text_unlikely_coal_section, \ in_text_unlikely_coal, \ ".section __TEXT,__text_unlikely_coal," \ diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt new file mode 100644 index 00000000000..8e4aeecc56a --- /dev/null +++ b/gcc/config/darwin.opt @@ -0,0 +1,28 @@ +; Processor-independent options for Darwin. + +; Copyright (C) 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. + +mone-byte-bool +Target RejectNegative Report Var(darwin_one_byte_bool) +Set sizeof(bool) to 1 + +mfix-and-continue +Target Report Var(darwin_fix_and_continue) +Generate code suitable for fast turn around debugging diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c index 748e24baa2e..795e67ad36a 100644 --- a/gcc/config/fp-bit.c +++ b/gcc/config/fp-bit.c @@ -1,7 +1,7 @@ /* This is a software floating point library which can be used for targets without hardware floating point. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -947,7 +947,7 @@ multiply (FLO_type arg_a, FLO_type arg_b) return pack_d (res); } -#endif /* L_mul_sf || L_mul_df */ +#endif /* L_mul_sf || L_mul_df || L_mul_tf */ #if defined(L_div_sf) || defined(L_div_df) || defined(L_div_tf) static inline __attribute__ ((__always_inline__)) fp_number_type * diff --git a/gcc/config/fp-bit.h b/gcc/config/fp-bit.h index 6221c9ede07..a9ab62b6b2c 100644 --- a/gcc/config/fp-bit.h +++ b/gcc/config/fp-bit.h @@ -1,6 +1,5 @@ /* Header file for fp-bit.c. */ -/* Copyright (C) 2000, 2002, 2003 - Free Software Foundation, Inc. +/* Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/config/fr30/fr30-protos.h b/gcc/config/fr30/fr30-protos.h index cf69a82e9ad..db9895a411f 100644 --- a/gcc/config/fr30/fr30-protos.h +++ b/gcc/config/fr30/fr30-protos.h @@ -32,13 +32,6 @@ extern int fr30_num_arg_regs (enum machine_mode, tree); #endif /* TREE_CODE */ #ifdef HAVE_MACHINE_MODES #define Mmode enum machine_mode -extern int stack_add_operand (rtx, Mmode); -extern int add_immediate_operand (rtx, Mmode); -extern int high_register_operand (rtx, Mmode); -extern int low_register_operand (rtx, Mmode); -extern int call_operand (rtx, Mmode); -extern int di_operand (rtx, Mmode); -extern int nonimmediate_di_operand (rtx, Mmode); extern int fr30_const_double_is_zero (rtx); #undef Mmode #endif /* HAVE_MACHINE_MODES */ diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 31b37e477c5..f2dfa9f99eb 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -1,5 +1,5 @@ /* FR30 specific functions. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Cygnus Solutions. @@ -243,9 +243,7 @@ fr30_expand_prologue (void) fr30_compute_frame_size (0, 0); /* This cases shouldn't happen. Catch it now. */ - if (current_frame_info.total_size == 0 - && current_frame_info.gmask) - abort (); + gcc_assert (current_frame_info.total_size || !current_frame_info.gmask); /* Allocate space for register arguments if this is a variadic function. */ if (current_frame_info.pretend_size) @@ -367,9 +365,8 @@ fr30_expand_epilogue (void) int regno; /* Perform the inversion operations of the prologue. */ - if (! current_frame_info.initialised) - abort (); - + gcc_assert (current_frame_info.initialised); + /* Pop local variables and arguments off the stack. If frame_pointer_needed is TRUE then the frame pointer register has actually been used as a frame pointer, and we can recover @@ -430,8 +427,7 @@ fr30_setup_incoming_varargs (CUMULATIVE_ARGS *arg_regs_used_so_far, int size; /* All BLKmode values are passed by reference. */ - if (mode == BLKmode) - abort (); + gcc_assert (mode != BLKmode); /* ??? This run-time test as well as the code inside the if statement is probably unnecessary. */ @@ -595,8 +591,7 @@ fr30_print_operand (FILE *file, rtx x, int code) switch (GET_CODE (x0)) { case REG: - if ((unsigned) REGNO (x0) >= ARRAY_SIZE (reg_names)) - abort (); + gcc_assert ((unsigned) REGNO (x0) < ARRAY_SIZE (reg_names)); fprintf (file, "@%s", reg_names [REGNO (x0)]); break; @@ -738,104 +733,6 @@ fr30_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, #define Mmode enum machine_mode #endif -/* Returns true if OPERAND is an integer value suitable for use in - an ADDSP instruction. */ -int -stack_add_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) -{ - return - (GET_CODE (operand) == CONST_INT - && INTVAL (operand) >= -512 - && INTVAL (operand) <= 508 - && ((INTVAL (operand) & 3) == 0)); -} - -/* Returns true if OPERAND is an integer value suitable for use in - an ADD por ADD2 instruction, or if it is a register. */ -int -add_immediate_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) -{ - return - (GET_CODE (operand) == REG - || (GET_CODE (operand) == CONST_INT - && INTVAL (operand) >= -16 - && INTVAL (operand) <= 15)); -} - -/* Returns true if OPERAND is hard register in the range 8 - 15. */ -int -high_register_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) -{ - return - (GET_CODE (operand) == REG - && REGNO (operand) <= 15 - && REGNO (operand) >= 8); -} - -/* Returns true if OPERAND is hard register in the range 0 - 7. */ -int -low_register_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) -{ - return - (GET_CODE (operand) == REG - && REGNO (operand) <= 7); -} - -/* Returns true if OPERAND is suitable for use in a CALL insn. */ -int -call_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (operand) == MEM - && (GET_CODE (XEXP (operand, 0)) == SYMBOL_REF - || GET_CODE (XEXP (operand, 0)) == REG)); -} - -/* Returns TRUE if OP is a valid operand of a DImode operation. */ -int -di_operand (rtx op, Mmode mode) -{ - if (register_operand (op, mode)) - return TRUE; - - if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - switch (GET_CODE (op)) - { - case CONST_DOUBLE: - case CONST_INT: - return TRUE; - - case MEM: - return memory_address_p (DImode, XEXP (op, 0)); - - default: - return FALSE; - } -} - -/* Returns TRUE if OP is a DImode register or MEM. */ -int -nonimmediate_di_operand (rtx op, Mmode mode) -{ - if (register_operand (op, mode)) - return TRUE; - - if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) == MEM) - return memory_address_p (DImode, XEXP (op, 0)); - - return FALSE; -} - /* Returns true iff all the registers in the operands array are in descending or ascending order. */ int @@ -939,8 +836,7 @@ fr30_move_double (rtx * operands) must load it last. Otherwise, load it first. */ int reverse = (refers_to_regno_p (dregno, dregno + 1, addr, 0) != 0); - if (GET_CODE (addr) != REG) - abort (); + gcc_assert (GET_CODE (addr) == REG); dest0 = operand_subword (dest, reverse, TRUE, mode); dest1 = operand_subword (dest, !reverse, TRUE, mode); @@ -993,8 +889,7 @@ fr30_move_double (rtx * operands) rtx src0; rtx src1; - if (GET_CODE (addr) != REG) - abort (); + gcc_assert (GET_CODE (addr) == REG); src0 = operand_subword (src, 0, TRUE, mode); src1 = operand_subword (src, 1, TRUE, mode); @@ -1027,7 +922,7 @@ fr30_move_double (rtx * operands) } else /* This should have been prevented by the constraints on movdi_insn. */ - abort (); + gcc_unreachable (); val = get_insns (); end_sequence (); diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h index 7847a7672bd..96596e11e06 100644 --- a/gcc/config/fr30/fr30.h +++ b/gcc/config/fr30/fr30.h @@ -49,24 +49,6 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -/* Use LDI:20 instead of LDI:32 to load addresses. */ -#define TARGET_SMALL_MODEL_MASK (1 << 0) -#define TARGET_SMALL_MODEL (target_flags & TARGET_SMALL_MODEL_MASK) - -#define TARGET_DEFAULT 0 - -/* This declaration should be present. */ -extern int target_flags; - -#define TARGET_SWITCHES \ -{ \ - { "small-model", TARGET_SMALL_MODEL_MASK, \ - N_("Assume small address space") }, \ - { "no-small-model", - TARGET_SMALL_MODEL_MASK, "" }, \ - { "no-lsim", 0, "" }, \ - { "", TARGET_DEFAULT, "" } \ -} - #define TARGET_VERSION fprintf (stderr, " (fr30)"); #define CAN_DEBUG_WITHOUT_FP @@ -1140,20 +1122,6 @@ extern struct rtx_def * fr30_compare_op0; extern struct rtx_def * fr30_compare_op1; /*}}}*/ -/*{{{ PREDICATE_CODES. */ - -#define PREDICATE_CODES \ - { "stack_add_operand", { CONST_INT }}, \ - { "high_register_operand", { REG }}, \ - { "low_register_operand", { REG }}, \ - { "call_operand", { MEM }}, \ - { "fp_displacement_operand", { CONST_INT }}, \ - { "sp_displacement_operand", { CONST_INT }}, \ - { "di_operand", { CONST_INT, CONST_DOUBLE, REG, MEM }}, \ - { "nonimmediate_di_operand", { REG, MEM }}, \ - { "add_immediate_operand", { REG, CONST_INT }}, - -/*}}}*/ /* Local Variables: */ /* folded-file: t */ diff --git a/gcc/config/fr30/fr30.md b/gcc/config/fr30/fr30.md index 8fc5e108eed..c48dad3da32 100644 --- a/gcc/config/fr30/fr30.md +++ b/gcc/config/fr30/fr30.md @@ -1,5 +1,6 @@ ;; FR30 machine description. -;; Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 2002, 2004, 2005 +;; Free Software Foundation, Inc. ;; Contributed by Cygnus Solutions. ;; This file is part of GCC. @@ -37,8 +38,8 @@ ;; An instruction by default is considered to be 'delyabable' ;; that is, it can be placed into a delay slot, but it is not ;; itself a delayed branch type instruction. An instruction -;; whoes type is 'delayed' is one which has a delay slot, and -;; an instruction whoes delay_type is 'other' is one which does +;; whose type is 'delayed' is one which has a delay slot, and +;; an instruction whose delay_type is 'other' is one which does ;; not have a delay slot, nor can it be placed into a delay slot. (define_attr "delay_type" "delayable,delayed,other" (const_string "delayable")) @@ -53,6 +54,8 @@ (nil)] ) +(include "predicates.md") + ;;}}} ;;{{{ Moves @@ -313,7 +316,7 @@ ) ;; If we are loading a large positive constant, one which has bits -;; in the top byte set, but whoes set bits all lie within an 8 bit +;; in the top byte set, but whose set bits all lie within an 8 bit ;; range, then we can save time and space by loading the byte value ;; and shifting it into place. (define_split @@ -353,7 +356,7 @@ case 4: return \"mov \\t%1, %0\"; case 5: return \"st \\t%1, %0\"; case 6: return \"ld \\t%1, %0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set (attr "length") (cond [(eq_attr "alternative" "1") (const_int 4) @@ -551,7 +554,7 @@ case 2: return \"mov \\t%1, %0\"; case 3: return \"st \\t%1, %0\"; case 4: return \"ld \\t%1, %0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set (attr "length") (cond [(eq_attr "alternative" "0") (const_int 6) diff --git a/gcc/config/fr30/fr30.opt b/gcc/config/fr30/fr30.opt new file mode 100644 index 00000000000..bf6f8690beb --- /dev/null +++ b/gcc/config/fr30/fr30.opt @@ -0,0 +1,27 @@ +; Options for the FR30 port of the compiler. + +; Copyright (C) 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. + +msmall-model +Target Report Mask(SMALL_MODEL) +Assume small address space + +mno-lsim +Target RejectNegative Undocumented diff --git a/gcc/config/fr30/predicates.md b/gcc/config/fr30/predicates.md new file mode 100644 index 00000000000..8926a1939b6 --- /dev/null +++ b/gcc/config/fr30/predicates.md @@ -0,0 +1,124 @@ +;; Predicate definitions for FR30. +;; Copyright (C) 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. + +;; Returns true if OP is an integer value suitable for use in an +;; ADDSP instruction. + +(define_predicate "stack_add_operand" + (match_code "const_int") +{ + return + (GET_CODE (op) == CONST_INT + && INTVAL (op) >= -512 + && INTVAL (op) <= 508 + && ((INTVAL (op) & 3) == 0)); +}) + +;; Returns true if OP is hard register in the range 8 - 15. + +(define_predicate "high_register_operand" + (match_code "reg") +{ + return + (GET_CODE (op) == REG + && REGNO (op) <= 15 + && REGNO (op) >= 8); +}) + +;; Returns true if OP is hard register in the range 0 - 7. + +(define_predicate "low_register_operand" + (match_code "reg") +{ + return + (GET_CODE (op) == REG + && REGNO (op) <= 7); +}) + +;; Returns true if OP is suitable for use in a CALL insn. + +(define_predicate "call_operand" + (match_code "mem") +{ + return (GET_CODE (op) == MEM + && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == REG)); +}) + +;; Returns TRUE if OP is a valid operand of a DImode operation. + +(define_predicate "di_operand" + (match_code "const_int,const_double,reg,mem") +{ + if (register_operand (op, mode)) + return TRUE; + + if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + switch (GET_CODE (op)) + { + case CONST_DOUBLE: + case CONST_INT: + return TRUE; + + case MEM: + return memory_address_p (DImode, XEXP (op, 0)); + + default: + return FALSE; + } +}) + +;; Returns TRUE if OP is a DImode register or MEM. + +(define_predicate "nonimmediate_di_operand" + (match_code "reg,mem") +{ + if (register_operand (op, mode)) + return TRUE; + + if (mode != VOIDmode && GET_MODE (op) != VOIDmode && GET_MODE (op) != DImode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) == MEM) + return memory_address_p (DImode, XEXP (op, 0)); + + return FALSE; +}) + +;; Returns true if OP is an integer value suitable for use in an ADD +;; or ADD2 instruction, or if it is a register. + +(define_predicate "add_immediate_operand" + (match_code "reg,const_int") +{ + return + (GET_CODE (op) == REG + || (GET_CODE (op) == CONST_INT + && INTVAL (op) >= -16 + && INTVAL (op) <= 15)); +}) diff --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h index 820a43fb0b3..8c11abfc41f 100644 --- a/gcc/config/freebsd-spec.h +++ b/gcc/config/freebsd-spec.h @@ -78,6 +78,7 @@ Boston, MA 02111-1307, USA. */ #define FBSD_CPP_SPEC " \ %(cpp_cpu) \ + %(cpp_arch) \ %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \ %{posix:-D_POSIX_SOURCE}" diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h index 534188eade1..89107a022ed 100644 --- a/gcc/config/frv/frv-protos.h +++ b/gcc/config/frv/frv-protos.h @@ -20,25 +20,6 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Define the information needed to generate branch and scc insns. This is - stored from the compare operation. Note that we can't use "rtx" here - since it hasn't been defined! */ - -/* Define global data defined in frv.c. */ -extern const char *frv_branch_cost_string; /* -mbranch-cost option */ -extern int frv_branch_cost_int; /* value of -mbranch_cost */ - -extern const char *frv_cpu_string; /* -mcpu= option */ - -extern const char *frv_condexec_insns_str; /* -mcond-exec-insns= option */ -extern int frv_condexec_insns; /* value of -mcond-exec-insns */ - -extern const char *frv_condexec_temps_str; /* -mcond-exec-temps= option */ -extern int frv_condexec_temps; /* value of -mcond-exec-temps */ - -extern const char *frv_sched_lookahead_str; /* -msched-lookahead= option */ -extern int frv_sched_lookahead; /* value -msched-lookahead= */ - /* CPU type. This must be identical to the cpu enumeration in frv.md. */ typedef enum frv_cpu { @@ -224,5 +205,18 @@ extern rtx frv_matching_accg_for_acc (rtx); extern void frv_expand_fdpic_call (rtx *, bool, bool); extern rtx frv_gen_GPsym2reg (rtx, rtx); extern void frv_output_dwarf_dtprel (FILE *, int, rtx); +extern int frv_legitimate_memory_operand (rtx, enum machine_mode, int); + +/* Information about a relocation unspec. SYMBOL is the relocation symbol + (a SYMBOL_REF or LABEL_REF), RELOC is the type of relocation and OFFSET + is the constant addend. */ +struct frv_unspec { + rtx symbol; + int reloc; + HOST_WIDE_INT offset; +}; + +extern bool frv_const_unspec_p (rtx, struct frv_unspec *); + #endif diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 25b2f7610d9..679b0b433c8 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -123,15 +123,6 @@ static unsigned int frv_num_nops; REG < REGNO (X) + HARD_REGNO_NREGS (REGNO (X), GET_MODE (X)); \ REG++) -/* Information about a relocation unspec. SYMBOL is the relocation symbol - (a SYMBOL_REF or LABEL_REF), RELOC is the type of relocation and OFFSET - is the constant addend. */ -struct frv_unspec { - rtx symbol; - int reloc; - HOST_WIDE_INT offset; -}; - /* Temporary register allocation support structure. */ typedef struct frv_tmp_reg_struct { @@ -247,31 +238,15 @@ enum reg_class reg_class_from_letter[256]; /* Cached value of frv_stack_info. */ static frv_stack_t *frv_stack_cache = (frv_stack_t *)0; -/* -mbranch-cost= support */ -const char *frv_branch_cost_string; -int frv_branch_cost_int = DEFAULT_BRANCH_COST; - /* -mcpu= support */ -const char *frv_cpu_string; /* -mcpu= option */ frv_cpu_t frv_cpu_type = CPU_TYPE; /* value of -mcpu= */ -/* -mcond-exec-insns= support */ -const char *frv_condexec_insns_str; /* -mcond-exec-insns= option */ -int frv_condexec_insns = DEFAULT_CONDEXEC_INSNS; /* value of -mcond-exec-insns*/ - -/* -mcond-exec-temps= support */ -const char *frv_condexec_temps_str; /* -mcond-exec-temps= option */ -int frv_condexec_temps = DEFAULT_CONDEXEC_TEMPS; /* value of -mcond-exec-temps*/ - -/* -msched-lookahead=n */ -const char *frv_sched_lookahead_str; /* -msched-lookahead=n */ -int frv_sched_lookahead = 4; /* -msched-lookahead=n */ - /* Forward references */ + +static bool frv_handle_option (size_t, const char *, int); static int frv_default_flags_for_cpu (void); static int frv_string_begins_with (tree, const char *); static FRV_INLINE bool frv_small_data_reloc_p (rtx, int); -static FRV_INLINE bool frv_const_unspec_p (rtx, struct frv_unspec *); static void frv_print_operand_memory_reference_reg (FILE *, rtx); static void frv_print_operand_memory_reference (FILE *, rtx, int); @@ -295,7 +270,6 @@ static void frv_frame_access_multi (frv_frame_accessor_t*, static void frv_frame_access_standard_regs (enum frv_stack_op, frv_stack_t *); static struct machine_function *frv_init_machine_status (void); -static int frv_legitimate_memory_operand (rtx, enum machine_mode, int); static rtx frv_int_to_acc (enum insn_code, int, rtx); static enum machine_mode frv_matching_accg_mode (enum machine_mode); static rtx frv_read_argument (tree *); @@ -380,6 +354,13 @@ static bool frv_must_pass_in_stack (enum machine_mode mode, tree type); static int frv_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +/* Allow us to easily change the default for -malloc-cc. */ +#ifndef DEFAULT_NO_ALLOC_CC +#define MASK_DEFAULT_ALLOC_CC MASK_ALLOC_CC +#else +#define MASK_DEFAULT_ALLOC_CC 0 +#endif + /* Initialize the GCC target structure. */ #undef TARGET_ASM_FUNCTION_PROLOGUE #define TARGET_ASM_FUNCTION_PROLOGUE frv_function_prologue @@ -387,6 +368,17 @@ static int frv_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, #define TARGET_ASM_FUNCTION_EPILOGUE frv_function_epilogue #undef TARGET_ASM_INTEGER #define TARGET_ASM_INTEGER frv_assemble_integer +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (MASK_DEFAULT_ALLOC_CC \ + | MASK_COND_MOVE \ + | MASK_SCC \ + | MASK_COND_EXEC \ + | MASK_VLIW_BRANCH \ + | MASK_MULTI_CE \ + | MASK_NESTED_CE) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION frv_handle_option #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS frv_init_builtins #undef TARGET_EXPAND_BUILTIN @@ -465,7 +457,7 @@ frv_small_data_reloc_p (rtx symbol, int reloc) /* Return true if X is a valid relocation unspec. If it is, fill in UNSPEC appropriately. */ -static FRV_INLINE bool +bool frv_const_unspec_p (rtx x, struct frv_unspec *unspec) { if (GET_CODE (x) == CONST) @@ -519,6 +511,41 @@ frv_cannot_force_const_mem (rtx x ATTRIBUTE_UNUSED) return TARGET_FDPIC; } +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +frv_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_mcpu_: + if (strcmp (arg, "simple") == 0) + frv_cpu_type = FRV_CPU_SIMPLE; + else if (strcmp (arg, "tomcat") == 0) + frv_cpu_type = FRV_CPU_TOMCAT; + else if (strcmp (arg, "fr550") == 0) + frv_cpu_type = FRV_CPU_FR550; + else if (strcmp (arg, "fr500") == 0) + frv_cpu_type = FRV_CPU_FR500; + else if (strcmp (arg, "fr450") == 0) + frv_cpu_type = FRV_CPU_FR450; + else if (strcmp (arg, "fr405") == 0) + frv_cpu_type = FRV_CPU_FR405; + else if (strcmp (arg, "fr400") == 0) + frv_cpu_type = FRV_CPU_FR400; + else if (strcmp (arg, "fr300") == 0) + frv_cpu_type = FRV_CPU_FR300; + else if (strcmp (arg, "frv") == 0) + frv_cpu_type = FRV_CPU_GENERIC; + else + return false; + return true; + + default: + return true; + } +} + static int frv_default_flags_for_cpu (void) { @@ -544,8 +571,10 @@ frv_default_flags_for_cpu (void) case FRV_CPU_FR300: case FRV_CPU_SIMPLE: return MASK_DEFAULT_SIMPLE; + + default: + gcc_unreachable (); } - abort (); } /* Sometimes certain combinations of command options do not make @@ -563,47 +592,6 @@ frv_override_options (void) int regno; unsigned int i; - /* Set the cpu type. */ - if (frv_cpu_string) - { - if (strcmp (frv_cpu_string, "simple") == 0) - frv_cpu_type = FRV_CPU_SIMPLE; - - else if (strcmp (frv_cpu_string, "tomcat") == 0) - frv_cpu_type = FRV_CPU_TOMCAT; - - else if (strncmp (frv_cpu_string, "fr", sizeof ("fr")-1) != 0) - error ("Unknown cpu: -mcpu=%s", frv_cpu_string); - - else - { - const char *p = frv_cpu_string + sizeof ("fr") - 1; - if (strcmp (p, "550") == 0) - frv_cpu_type = FRV_CPU_FR550; - - else if (strcmp (p, "500") == 0) - frv_cpu_type = FRV_CPU_FR500; - - else if (strcmp (p, "450") == 0) - frv_cpu_type = FRV_CPU_FR450; - - else if (strcmp (p, "405") == 0) - frv_cpu_type = FRV_CPU_FR405; - - else if (strcmp (p, "400") == 0) - frv_cpu_type = FRV_CPU_FR400; - - else if (strcmp (p, "300") == 0) - frv_cpu_type = FRV_CPU_FR300; - - else if (strcmp (p, "v") == 0) - frv_cpu_type = FRV_CPU_GENERIC; - - else - error ("Unknown cpu: -mcpu=%s", frv_cpu_string); - } - } - target_flags |= (frv_default_flags_for_cpu () & ~target_flags_explicit); /* -mlibrary-pic sets -fPIC and -G0 and also suppresses warnings from the @@ -620,22 +608,6 @@ frv_override_options (void) } } - /* Change the branch cost value. */ - if (frv_branch_cost_string) - frv_branch_cost_int = atoi (frv_branch_cost_string); - - /* Change the # of insns to be converted to conditional execution. */ - if (frv_condexec_insns_str) - frv_condexec_insns = atoi (frv_condexec_insns_str); - - /* Change # of temporary registers used to hold integer constants. */ - if (frv_condexec_temps_str) - frv_condexec_temps = atoi (frv_condexec_temps_str); - - /* Change scheduling look ahead. */ - if (frv_sched_lookahead_str) - frv_sched_lookahead = atoi (frv_sched_lookahead_str); - /* A C expression whose value is a register class containing hard register REGNO. In general there is more than one such class; choose a class which is "minimal", meaning that no smaller class @@ -800,7 +772,7 @@ frv_override_options (void) You should not use this macro to change options that are not machine-specific. These should uniformly selected by the same optimization - level on all supported machines. Use this macro to enable machbine-specific + level on all supported machines. Use this macro to enable machine-specific optimizations. *Do not examine `write_symbols' in this macro!* The debugging options are @@ -1491,8 +1463,7 @@ frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) rtx insn; /* Just to check that the above comment is true. */ - if (regs_ever_live[GPR_FIRST + 3]) - abort (); + gcc_assert (!regs_ever_live[GPR_FIRST + 3]); /* Generate the instruction that saves the link register. */ fprintf (file, "\tmovsg lr,gr3\n"); @@ -1549,10 +1520,8 @@ frv_alloc_temp_reg ( regno = 0; if (regno == orig_regno) { - if (no_abort) - return NULL_RTX; - else - abort (); + gcc_assert (no_abort); + return NULL_RTX; } } @@ -2139,7 +2108,7 @@ frv_initial_elimination_offset (int from, int to) - info->pretend_size); else - abort (); + gcc_unreachable (); if (TARGET_DEBUG_STACK) fprintf (stderr, "Eliminate %s to %s by adding %d\n", @@ -2253,9 +2222,8 @@ frv_expand_block_move (rtx operands[]) if (! constp) return FALSE; - /* If this is not a fixed size alignment, abort. */ - if (GET_CODE (align_rtx) != CONST_INT) - abort (); + /* This should be a fixed size alignment. */ + gcc_assert (GET_CODE (align_rtx) == CONST_INT); align = INTVAL (align_rtx); @@ -2346,9 +2314,8 @@ frv_expand_block_clear (rtx operands[]) if (! constp) return FALSE; - /* If this is not a fixed size alignment, abort. */ - if (GET_CODE (align_rtx) != CONST_INT) - abort (); + /* This should be a fixed size alignment. */ + gcc_assert (GET_CODE (align_rtx) == CONST_INT); align = INTVAL (align_rtx); @@ -2653,8 +2620,7 @@ frv_print_operand_jump_hint (rtx insn) HOST_WIDE_INT prob = -1; enum { UNKNOWN, BACKWARD, FORWARD } jump_type = UNKNOWN; - if (GET_CODE (insn) != JUMP_INSN) - abort (); + gcc_assert (GET_CODE (insn) == JUMP_INSN); /* Assume any non-conditional jump is likely. */ if (! any_condjump_p (insn)) @@ -3598,7 +3564,7 @@ frv_legitimize_tls_address (rtx addr, enum tls_model model) break; } default: - abort (); + gcc_unreachable (); } return dest; @@ -3700,1637 +3666,176 @@ unspec_got_name (int i) case R_FRV_TLSDESCLO: return "tlsdesclo"; case R_FRV_GOTTLSDESCHI: return "gottlsdeschi"; case R_FRV_GOTTLSDESCLO: return "gottlsdesclo"; - default: abort (); - } -} - -/* Write the assembler syntax for UNSPEC to STREAM. Note that any offset - is added inside the relocation operator. */ - -static void -frv_output_const_unspec (FILE *stream, const struct frv_unspec *unspec) -{ - fprintf (stream, "#%s(", unspec_got_name (unspec->reloc)); - output_addr_const (stream, plus_constant (unspec->symbol, unspec->offset)); - fputs (")", stream); -} - -/* Implement FIND_BASE_TERM. See whether ORIG_X represents #gprel12(foo) - or #gotoff12(foo) for some small data symbol foo. If so, return foo, - otherwise return ORIG_X. */ - -rtx -frv_find_base_term (rtx x) -{ - struct frv_unspec unspec; - - if (frv_const_unspec_p (x, &unspec) - && frv_small_data_reloc_p (unspec.symbol, unspec.reloc)) - return plus_constant (unspec.symbol, unspec.offset); - - return x; -} - -/* Return 1 if operand is a valid FRV address. CONDEXEC_P is true if - the operand is used by a predicated instruction. */ - -static int -frv_legitimate_memory_operand (rtx op, enum machine_mode mode, int condexec_p) -{ - return ((GET_MODE (op) == mode || mode == VOIDmode) - && GET_CODE (op) == MEM - && frv_legitimate_address_p (mode, XEXP (op, 0), - reload_completed, condexec_p, FALSE)); -} - -void -frv_expand_fdpic_call (rtx *operands, bool ret_value, bool sibcall) -{ - rtx lr = gen_rtx_REG (Pmode, LR_REGNO); - rtx picreg = get_hard_reg_initial_val (SImode, FDPIC_REG); - rtx c, rvrtx=0; - rtx addr; - - if (ret_value) - { - rvrtx = operands[0]; - operands ++; - } - - addr = XEXP (operands[0], 0); - - /* Inline PLTs if we're optimizing for speed. We'd like to inline - any calls that would involve a PLT, but can't tell, since we - don't know whether an extern function is going to be provided by - a separate translation unit or imported from a separate module. - When compiling for shared libraries, if the function has default - visibility, we assume it's overridable, so we inline the PLT, but - for executables, we don't really have a way to make a good - decision: a function is as likely to be imported from a shared - library as it is to be defined in the executable itself. We - assume executables will get global functions defined locally, - whereas shared libraries will have them potentially overridden, - so we only inline PLTs when compiling for shared libraries. - - In order to mark a function as local to a shared library, any - non-default visibility attribute suffices. Unfortunately, - there's no simple way to tag a function declaration as ``in a - different module'', which we could then use to trigger PLT - inlining on executables. There's -minline-plt, but it affects - all external functions, so one would have to also mark function - declarations available in the same module with non-default - visibility, which is advantageous in itself. */ - if (GET_CODE (addr) == SYMBOL_REF - && ((!SYMBOL_REF_LOCAL_P (addr) && TARGET_INLINE_PLT) - || sibcall)) - { - rtx x, dest; - dest = gen_reg_rtx (SImode); - if (flag_pic != 1) - x = gen_symGOTOFF2reg_hilo (dest, addr, OUR_FDPIC_REG, - GEN_INT (R_FRV_FUNCDESC_GOTOFF12)); - else - x = gen_symGOTOFF2reg (dest, addr, OUR_FDPIC_REG, - GEN_INT (R_FRV_FUNCDESC_GOTOFF12)); - emit_insn (x); - cfun->uses_pic_offset_table = TRUE; - addr = dest; - } - else if (GET_CODE (addr) == SYMBOL_REF) - { - /* These are always either local, or handled through a local - PLT. */ - if (ret_value) - c = gen_call_value_fdpicsi (rvrtx, addr, operands[1], - operands[2], picreg, lr); - else - c = gen_call_fdpicsi (addr, operands[1], operands[2], picreg, lr); - emit_call_insn (c); - return; - } - else if (! ldd_address_operand (addr, Pmode)) - addr = force_reg (Pmode, addr); - - picreg = gen_reg_rtx (DImode); - emit_insn (gen_movdi_ldd (picreg, addr)); - - if (sibcall && ret_value) - c = gen_sibcall_value_fdpicdi (rvrtx, picreg, const0_rtx); - else if (sibcall) - c = gen_sibcall_fdpicdi (picreg, const0_rtx); - else if (ret_value) - c = gen_call_value_fdpicdi (rvrtx, picreg, const0_rtx, lr); - else - c = gen_call_fdpicdi (picreg, const0_rtx, lr); - emit_call_insn (c); -} - -/* An address operand that may use a pair of registers, an addressing - mode that we reject in general. */ - -int -ldd_address_operand (rtx x, enum machine_mode mode) -{ - if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode) - return FALSE; - - return frv_legitimate_address_p (DImode, x, reload_completed, FALSE, TRUE); -} - -int -fdpic_fptr_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - if (GET_CODE (op) != REG) - return FALSE; - if (REGNO (op) != FDPIC_FPTR_REGNO && REGNO (op) < FIRST_PSEUDO_REGISTER) - return FALSE; - return TRUE; -} - -/* Return 1 is OP is a memory operand, or will be turned into one by - reload. */ - -int -frv_load_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (reload_in_progress) - { - rtx tmp = op; - if (GET_CODE (tmp) == SUBREG) - tmp = SUBREG_REG (tmp); - if (GET_CODE (tmp) == REG - && REGNO (tmp) >= FIRST_PSEUDO_REGISTER) - op = reg_equiv_memory_loc[REGNO (tmp)]; - } - - return op && memory_operand (op, mode); -} - - -/* Return 1 if operand is a GPR register or a FPR register. */ - -int -gpr_or_fpr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (GPR_P (regno) || FPR_P (regno) || regno >= FIRST_PSEUDO_REGISTER) - return TRUE; - - return FALSE; -} - -/* Return 1 if operand is a GPR register or 12 bit signed immediate. */ - -int -gpr_or_int12_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return IN_RANGE_P (INTVAL (op), -2048, 2047); - - if (got12_operand (op, mode)) - return true; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - return GPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return 1 if operand is a GPR register, or a FPR register, or a 12 bit - signed immediate. */ - -int -gpr_fpr_or_int12_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_CODE (op) == CONST_INT) - return IN_RANGE_P (INTVAL (op), -2048, 2047); - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); + default: gcc_unreachable (); } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (GPR_P (regno) || FPR_P (regno) || regno >= FIRST_PSEUDO_REGISTER) - return TRUE; - - return FALSE; -} - -/* Return 1 if operand is a register or 6 bit signed immediate. */ - -int -fpr_or_int6_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return IN_RANGE_P (INTVAL (op), -32, 31); - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - return FPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return 1 if operand is a register or 10 bit signed immediate. */ - -int -gpr_or_int10_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return IN_RANGE_P (INTVAL (op), -512, 511); - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - return GPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return 1 if operand is a register or an integer immediate. */ - -int -gpr_or_int_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return TRUE; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - return GPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return 1 if operand is a 12 bit signed immediate. */ - -int -int12_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return FALSE; - - return IN_RANGE_P (INTVAL (op), -2048, 2047); -} - -/* Return 1 if operand is a 6 bit signed immediate. */ - -int -int6_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return FALSE; - - return IN_RANGE_P (INTVAL (op), -32, 31); -} - -/* Return 1 if operand is a 5 bit signed immediate. */ - -int -int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), -16, 15); -} - -/* Return 1 if operand is a 5 bit unsigned immediate. */ - -int -uint5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 31); -} - -/* Return 1 if operand is a 4 bit unsigned immediate. */ - -int -uint4_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 15); -} - -/* Return 1 if operand is a 1 bit unsigned immediate (0 or 1). */ - -int -uint1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 1); -} - -/* Return 1 if operand is an integer constant that takes 2 instructions - to load up and can be split into sethi/setlo instructions.. */ - -int -int_2word_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT value; - REAL_VALUE_TYPE rv; - long l; - - switch (GET_CODE (op)) - { - default: - break; - - case LABEL_REF: - if (TARGET_FDPIC) - return FALSE; - - return (flag_pic == 0); - - case CONST: - if (flag_pic || TARGET_FDPIC) - return FALSE; - - op = XEXP (op, 0); - if (GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) - op = XEXP (op, 0); - return GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF; - - case SYMBOL_REF: - if (TARGET_FDPIC) - return FALSE; - - /* small data references are already 1 word */ - return (flag_pic == 0) && (! SYMBOL_REF_SMALL_P (op)); - - case CONST_INT: - return ! IN_RANGE_P (INTVAL (op), -32768, 32767); - - case CONST_DOUBLE: - if (GET_MODE (op) == SFmode) - { - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); - value = l; - return ! IN_RANGE_P (value, -32768, 32767); - } - else if (GET_MODE (op) == VOIDmode) - { - value = CONST_DOUBLE_LOW (op); - return ! IN_RANGE_P (value, -32768, 32767); - } - break; - } - - return FALSE; -} - -/* Return 1 if operand is a 16 bit unsigned immediate. */ - -int -uint16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return FALSE; - - return IN_RANGE_P (INTVAL (op), 0, 0xffff); -} - -/* Return 1 if operand is an integer constant with the bottom 16 bits - clear. */ - -int -upper_int16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return FALSE; - - return ((INTVAL (op) & 0xffff) == 0); -} - -/* Return true if operand is a GPR register. */ - -int -integer_register_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - return GPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return true if operand is a GPR register. Do not allow SUBREG's - here, in order to prevent a combine bug. */ - -int -gpr_no_subreg_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - return GPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return true if operand is a FPR register. */ - -int -fpr_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - return FPR_OR_PSEUDO_P (REGNO (op)); -} - -/* Return true if operand is an even GPR or FPR register. */ - -int -even_reg_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (regno >= FIRST_PSEUDO_REGISTER) - return TRUE; - - if (GPR_P (regno)) - return (((regno - GPR_FIRST) & 1) == 0); - - if (FPR_P (regno)) - return (((regno - FPR_FIRST) & 1) == 0); - - return FALSE; -} - -/* Return true if operand is an odd GPR register. */ - -int -odd_reg_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - /* Assume that reload will give us an even register. */ - if (regno >= FIRST_PSEUDO_REGISTER) - return FALSE; - - if (GPR_P (regno)) - return (((regno - GPR_FIRST) & 1) != 0); - - if (FPR_P (regno)) - return (((regno - FPR_FIRST) & 1) != 0); - - return FALSE; -} - -/* Return true if operand is an even GPR register. */ - -int -even_gpr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (regno >= FIRST_PSEUDO_REGISTER) - return TRUE; - - if (! GPR_P (regno)) - return FALSE; - - return (((regno - GPR_FIRST) & 1) == 0); -} - -/* Return true if operand is an odd GPR register. */ - -int -odd_gpr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - /* Assume that reload will give us an even register. */ - if (regno >= FIRST_PSEUDO_REGISTER) - return FALSE; - - if (! GPR_P (regno)) - return FALSE; - - return (((regno - GPR_FIRST) & 1) != 0); -} - -/* Return true if operand is a quad aligned FPR register. */ - -int -quad_fpr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (regno >= FIRST_PSEUDO_REGISTER) - return TRUE; - - if (! FPR_P (regno)) - return FALSE; - - return (((regno - FPR_FIRST) & 3) == 0); -} - -/* Return true if operand is an even FPR register. */ - -int -even_fpr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (regno >= FIRST_PSEUDO_REGISTER) - return TRUE; - - if (! FPR_P (regno)) - return FALSE; - - return (((regno - FPR_FIRST) & 1) == 0); -} - -/* Return true if operand is an odd FPR register. */ - -int -odd_fpr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) == SUBREG) - { - if (GET_CODE (SUBREG_REG (op)) != REG) - return register_operand (op, mode); - - op = SUBREG_REG (op); - } - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - /* Assume that reload will give us an even register. */ - if (regno >= FIRST_PSEUDO_REGISTER) - return FALSE; - - if (! FPR_P (regno)) - return FALSE; - - return (((regno - FPR_FIRST) & 1) != 0); -} - -/* Return true if operand is a 2 word memory address that can be loaded in one - instruction to load or store. We assume the stack and frame pointers are - suitably aligned, and variables in the small data area. FIXME -- at some we - should recognize other globals and statics. We can't assume that any old - pointer is aligned, given that arguments could be passed on an odd word on - the stack and the address taken and passed through to another function. */ - -int -dbl_memory_one_insn_operand (rtx op, enum machine_mode mode) -{ - rtx addr; - rtx addr_reg; - - if (! TARGET_DWORD) - return FALSE; - - if (GET_CODE (op) != MEM) - return FALSE; - - if (mode != VOIDmode && GET_MODE_SIZE (mode) != 2*UNITS_PER_WORD) - return FALSE; - - addr = XEXP (op, 0); - if (GET_CODE (addr) == REG) - addr_reg = addr; - - else if (GET_CODE (addr) == PLUS) - { - rtx addr0 = XEXP (addr, 0); - rtx addr1 = XEXP (addr, 1); - - if (GET_CODE (addr0) != REG) - return FALSE; - - if (got12_operand (addr1, VOIDmode)) - return TRUE; - - if (GET_CODE (addr1) != CONST_INT) - return FALSE; - - if ((INTVAL (addr1) & 7) != 0) - return FALSE; - - addr_reg = addr0; - } - - else - return FALSE; - - if (addr_reg == frame_pointer_rtx || addr_reg == stack_pointer_rtx) - return TRUE; - - return FALSE; -} - -/* Return true if operand is a 2 word memory address that needs to - use two instructions to load or store. */ - -int -dbl_memory_two_insn_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != MEM) - return FALSE; - - if (mode != VOIDmode && GET_MODE_SIZE (mode) != 2*UNITS_PER_WORD) - return FALSE; - - if (! TARGET_DWORD) - return TRUE; - - return ! dbl_memory_one_insn_operand (op, mode); -} - -/* Return true if operand is something that can be an output for a move - operation. */ - -int -move_destination_operand (rtx op, enum machine_mode mode) -{ - rtx subreg; - enum rtx_code code; - - switch (GET_CODE (op)) - { - default: - break; - - case SUBREG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - subreg = SUBREG_REG (op); - code = GET_CODE (subreg); - if (code == MEM) - return frv_legitimate_address_p (mode, XEXP (subreg, 0), - reload_completed, FALSE, FALSE); - - return (code == REG); - - case REG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - return TRUE; - - case MEM: - return frv_legitimate_memory_operand (op, mode, FALSE); - } - - return FALSE; -} - -/* Return true if we the operand is a valid destination for a movcc_fp - instruction. This means rejecting fcc_operands, since we need - scratch registers to write to them. */ - -int -movcc_fp_destination_operand (rtx op, enum machine_mode mode) -{ - if (fcc_operand (op, mode)) - return FALSE; - - return move_destination_operand (op, mode); -} - -/* Look for a SYMBOL_REF of a function in an rtx. We always want to - process these separately from any offsets, such that we add any - offsets to the function descriptor (the actual pointer), not to the - function address. */ - -static bool -frv_function_symbol_referenced_p (rtx x) -{ - const char *format; - int length; - int j; - - if (GET_CODE (x) == SYMBOL_REF) - return SYMBOL_REF_FUNCTION_P (x); - - length = GET_RTX_LENGTH (GET_CODE (x)); - format = GET_RTX_FORMAT (GET_CODE (x)); - - for (j = 0; j < length; ++j) - { - switch (format[j]) - { - case 'e': - if (frv_function_symbol_referenced_p (XEXP (x, j))) - return TRUE; - break; - - case 'V': - case 'E': - if (XVEC (x, j) != 0) - { - int k; - for (k = 0; k < XVECLEN (x, j); ++k) - if (frv_function_symbol_referenced_p (XVECEXP (x, j, k))) - return TRUE; - } - break; - - default: - /* Nothing to do. */ - break; - } - } - - return FALSE; -} - -/* Return true if operand is something that can be an input for a move - operation. */ - -int -move_source_operand (rtx op, enum machine_mode mode) -{ - rtx subreg; - enum rtx_code code; - - switch (GET_CODE (op)) - { - default: - break; - - case CONST_INT: - case CONST_DOUBLE: - return immediate_operand (op, mode); - - case SUBREG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - subreg = SUBREG_REG (op); - code = GET_CODE (subreg); - if (code == MEM) - return frv_legitimate_address_p (mode, XEXP (subreg, 0), - reload_completed, FALSE, FALSE); - - return (code == REG); - - case REG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - return TRUE; - - case MEM: - return frv_legitimate_memory_operand (op, mode, FALSE); - } - - return FALSE; -} - -/* Return true if operand is something that can be an output for a conditional - move operation. */ - -int -condexec_dest_operand (rtx op, enum machine_mode mode) -{ - rtx subreg; - enum rtx_code code; - - switch (GET_CODE (op)) - { - default: - break; - - case SUBREG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - subreg = SUBREG_REG (op); - code = GET_CODE (subreg); - if (code == MEM) - return frv_legitimate_address_p (mode, XEXP (subreg, 0), - reload_completed, TRUE, FALSE); - - return (code == REG); - - case REG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - return TRUE; - - case MEM: - return frv_legitimate_memory_operand (op, mode, TRUE); - } - - return FALSE; -} - -/* Return true if operand is something that can be an input for a conditional - move operation. */ - -int -condexec_source_operand (rtx op, enum machine_mode mode) -{ - rtx subreg; - enum rtx_code code; - - switch (GET_CODE (op)) - { - default: - break; - - case CONST_INT: - case CONST_DOUBLE: - return ZERO_P (op); - - case SUBREG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - subreg = SUBREG_REG (op); - code = GET_CODE (subreg); - if (code == MEM) - return frv_legitimate_address_p (mode, XEXP (subreg, 0), - reload_completed, TRUE, FALSE); - - return (code == REG); - - case REG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - return TRUE; - - case MEM: - return frv_legitimate_memory_operand (op, mode, TRUE); - } - - return FALSE; -} - -/* Return true if operand is a register of any flavor or a 0 of the - appropriate type. */ - -int -reg_or_0_operand (rtx op, enum machine_mode mode) -{ - switch (GET_CODE (op)) - { - default: - break; - - case REG: - case SUBREG: - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - return register_operand (op, mode); - - case CONST_INT: - case CONST_DOUBLE: - return ZERO_P (op); - } - - return FALSE; -} - -/* Return true if operand is the link register. */ - -int -lr_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != REG) - return FALSE; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (REGNO (op) != LR_REGNO && REGNO (op) < FIRST_PSEUDO_REGISTER) - return FALSE; - - return TRUE; -} - -/* Return true if operand is the uClinux PIC register. */ - -int -fdpic_operand (rtx op, enum machine_mode mode) -{ - if (!TARGET_FDPIC) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (REGNO (op) != FDPIC_REGNO && REGNO (op) < FIRST_PSEUDO_REGISTER) - return FALSE; - - return TRUE; -} - -int -got12_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - struct frv_unspec unspec; - - if (frv_const_unspec_p (op, &unspec)) - switch (unspec.reloc) - { - case R_FRV_GOT12: - case R_FRV_GOTOFF12: - case R_FRV_FUNCDESC_GOT12: - case R_FRV_FUNCDESC_GOTOFF12: - case R_FRV_GPREL12: - case R_FRV_TLSMOFF12: - return true; - } - return false; -} - -/* Return true if OP is a valid const-unspec expression. */ - -int -const_unspec_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - struct frv_unspec unspec; - - return frv_const_unspec_p (op, &unspec); -} - -/* Return true if operand is a gpr register or a valid memory operand. */ - -int -gpr_or_memory_operand (rtx op, enum machine_mode mode) -{ - return (integer_register_operand (op, mode) - || frv_legitimate_memory_operand (op, mode, FALSE)); -} - -/* Return true if operand is a gpr register, a valid memory operand, - or a memory operand that can be made valid using an additional gpr - register. */ - -int -gpr_or_memory_operand_with_scratch (rtx op, enum machine_mode mode) -{ - rtx addr; - - if (gpr_or_memory_operand (op, mode)) - return TRUE; - - if (GET_CODE (op) != MEM) - return FALSE; - - if (GET_MODE (op) != mode) - return FALSE; - - addr = XEXP (op, 0); - - if (GET_CODE (addr) != PLUS) - return FALSE; - - if (!integer_register_operand (XEXP (addr, 0), Pmode)) - return FALSE; - - if (GET_CODE (XEXP (addr, 1)) != CONST_INT) - return FALSE; - - return TRUE; -} - -/* Return true if operand is a fpr register or a valid memory operation. */ - -int -fpr_or_memory_operand (rtx op, enum machine_mode mode) -{ - return (fpr_operand (op, mode) - || frv_legitimate_memory_operand (op, mode, FALSE)); -} - -/* Return true if operand is an icc register. */ - -int -icc_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - return ICC_OR_PSEUDO_P (regno); -} - -/* Return true if operand is an fcc register. */ - -int -fcc_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - return FCC_OR_PSEUDO_P (regno); -} - -/* Return true if operand is either an fcc or icc register. */ - -int -cc_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (CC_OR_PSEUDO_P (regno)) - return TRUE; - - return FALSE; -} - -/* Return true if operand is an integer CCR register. */ - -int -icr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - return ICR_OR_PSEUDO_P (regno); -} - -/* Return true if operand is an fcc register. */ - -int -fcr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - return FCR_OR_PSEUDO_P (regno); -} - -/* Return true if operand is either an fcc or icc register. */ - -int -cr_operand (rtx op, enum machine_mode mode) -{ - int regno; - - if (GET_MODE (op) != mode && mode != VOIDmode) - return FALSE; - - if (GET_CODE (op) != REG) - return FALSE; - - regno = REGNO (op); - if (CR_OR_PSEUDO_P (regno)) - return TRUE; - - return FALSE; -} - -/* Return true if operand is a memory reference suitable for a call. */ - -int -call_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode && GET_CODE (op) != CONST_INT) - return FALSE; - - if (GET_CODE (op) == SYMBOL_REF) - return !TARGET_LONG_CALLS || SYMBOL_REF_LOCAL_P (op); - - /* Note this doesn't allow reg+reg or reg+imm12 addressing (which should - never occur anyway), but prevents reload from not handling the case - properly of a call through a pointer on a function that calls - vfork/setjmp, etc. due to the need to flush all of the registers to stack. */ - return gpr_or_int12_operand (op, mode); -} - -/* Return true if operand is a memory reference suitable for a sibcall. */ - -int -sibcall_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode && mode != VOIDmode && GET_CODE (op) != CONST_INT) - return FALSE; - - /* Note this doesn't allow reg+reg or reg+imm12 addressing (which should - never occur anyway), but prevents reload from not handling the case - properly of a call through a pointer on a function that calls - vfork/setjmp, etc. due to the need to flush all of the registers to stack. */ - return gpr_or_int12_operand (op, mode); -} - -/* Returns 1 if OP is either a SYMBOL_REF or a constant. */ -int -symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code c = GET_CODE (op); - - if (c == CONST) - { - /* Allow (const:SI (plus:SI (symbol_ref) (const_int))). */ - return GET_MODE (op) == SImode - && GET_CODE (XEXP (op, 0)) == PLUS - && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF - && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT; - } - - return c == SYMBOL_REF || c == CONST_INT; -} - -/* Return true if operator is a kind of relational operator. */ - -int -relational_operator (rtx op, enum machine_mode mode) -{ - return (integer_relational_operator (op, mode) - || float_relational_operator (op, mode)); -} - -/* Return true if OP is a relational operator suitable for CCmode, - CC_UNSmode or CC_NZmode. */ - -int -integer_relational_operator (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return FALSE; - - /* The allowable relations depend on the mode of the ICC register. */ - switch (GET_CODE (op)) - { - default: - return FALSE; - - case EQ: - case NE: - case LT: - case GE: - return (GET_MODE (XEXP (op, 0)) == CC_NZmode - || GET_MODE (XEXP (op, 0)) == CCmode); - - case LE: - case GT: - return GET_MODE (XEXP (op, 0)) == CCmode; - - case GTU: - case GEU: - case LTU: - case LEU: - return (GET_MODE (XEXP (op, 0)) == CC_NZmode - || GET_MODE (XEXP (op, 0)) == CC_UNSmode); - } -} - -/* Return true if operator is a floating point relational operator. */ - -int -float_relational_operator (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return FALSE; - - switch (GET_CODE (op)) - { - default: - return FALSE; - - case EQ: case NE: - case LE: case LT: - case GE: case GT: -#if 0 - case UEQ: case UNE: - case ULE: case ULT: - case UGE: case UGT: - case ORDERED: - case UNORDERED: -#endif - return GET_MODE (XEXP (op, 0)) == CC_FPmode; - } -} - -/* Return true if operator is EQ/NE of a conditional execution register. */ - -int -ccr_eqne_operator (rtx op, enum machine_mode mode) -{ - enum machine_mode op_mode = GET_MODE (op); - rtx op0; - rtx op1; - int regno; - - if (mode != VOIDmode && op_mode != mode) - return FALSE; - - switch (GET_CODE (op)) - { - default: - return FALSE; - - case EQ: - case NE: - break; - } - - op1 = XEXP (op, 1); - if (op1 != const0_rtx) - return FALSE; - - op0 = XEXP (op, 0); - if (GET_CODE (op0) != REG) - return FALSE; - - regno = REGNO (op0); - if (op_mode == CC_CCRmode && CR_OR_PSEUDO_P (regno)) - return TRUE; - - return FALSE; -} - -/* Return true if operator is a minimum or maximum operator (both signed and - unsigned). */ - -int -minmax_operator (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return FALSE; - - switch (GET_CODE (op)) - { - default: - return FALSE; - - case SMIN: - case SMAX: - case UMIN: - case UMAX: - break; - } - - if (! integer_register_operand (XEXP (op, 0), mode)) - return FALSE; - - if (! gpr_or_int10_operand (XEXP (op, 1), mode)) - return FALSE; - - return TRUE; } -/* Return true if operator is an integer binary operator that can executed - conditionally and takes 1 cycle. */ +/* Write the assembler syntax for UNSPEC to STREAM. Note that any offset + is added inside the relocation operator. */ -int -condexec_si_binary_operator (rtx op, enum machine_mode mode) +static void +frv_output_const_unspec (FILE *stream, const struct frv_unspec *unspec) { - enum machine_mode op_mode = GET_MODE (op); - - if (mode != VOIDmode && op_mode != mode) - return FALSE; - - switch (GET_CODE (op)) - { - default: - return FALSE; - - case PLUS: - case MINUS: - case AND: - case IOR: - case XOR: - case ASHIFT: - case ASHIFTRT: - case LSHIFTRT: - return TRUE; - } + fprintf (stream, "#%s(", unspec_got_name (unspec->reloc)); + output_addr_const (stream, plus_constant (unspec->symbol, unspec->offset)); + fputs (")", stream); } -/* Return true if operator is an integer binary operator that can be - executed conditionally by a media instruction. */ +/* Implement FIND_BASE_TERM. See whether ORIG_X represents #gprel12(foo) + or #gotoff12(foo) for some small data symbol foo. If so, return foo, + otherwise return ORIG_X. */ -int -condexec_si_media_operator (rtx op, enum machine_mode mode) +rtx +frv_find_base_term (rtx x) { - enum machine_mode op_mode = GET_MODE (op); - - if (mode != VOIDmode && op_mode != mode) - return FALSE; + struct frv_unspec unspec; - switch (GET_CODE (op)) - { - default: - return FALSE; + if (frv_const_unspec_p (x, &unspec) + && frv_small_data_reloc_p (unspec.symbol, unspec.reloc)) + return plus_constant (unspec.symbol, unspec.offset); - case AND: - case IOR: - case XOR: - return TRUE; - } + return x; } -/* Return true if operator is an integer division operator that can executed - conditionally. */ +/* Return 1 if operand is a valid FRV address. CONDEXEC_P is true if + the operand is used by a predicated instruction. */ int -condexec_si_divide_operator (rtx op, enum machine_mode mode) +frv_legitimate_memory_operand (rtx op, enum machine_mode mode, int condexec_p) { - enum machine_mode op_mode = GET_MODE (op); - - if (mode != VOIDmode && op_mode != mode) - return FALSE; - - switch (GET_CODE (op)) - { - default: - return FALSE; - - case DIV: - case UDIV: - return TRUE; - } + return ((GET_MODE (op) == mode || mode == VOIDmode) + && GET_CODE (op) == MEM + && frv_legitimate_address_p (mode, XEXP (op, 0), + reload_completed, condexec_p, FALSE)); } -/* Return true if operator is an integer unary operator that can executed - conditionally. */ - -int -condexec_si_unary_operator (rtx op, enum machine_mode mode) +void +frv_expand_fdpic_call (rtx *operands, bool ret_value, bool sibcall) { - enum machine_mode op_mode = GET_MODE (op); - - if (mode != VOIDmode && op_mode != mode) - return FALSE; + rtx lr = gen_rtx_REG (Pmode, LR_REGNO); + rtx picreg = get_hard_reg_initial_val (SImode, FDPIC_REG); + rtx c, rvrtx=0; + rtx addr; - switch (GET_CODE (op)) + if (ret_value) { - default: - return FALSE; - - case NEG: - case NOT: - return TRUE; + rvrtx = operands[0]; + operands ++; } -} -/* Return true if operator is a conversion-type expression that can be - evaluated conditionally by floating-point instructions. */ - -int -condexec_sf_conv_operator (rtx op, enum machine_mode mode) -{ - enum machine_mode op_mode = GET_MODE (op); + addr = XEXP (operands[0], 0); - if (mode != VOIDmode && op_mode != mode) - return FALSE; + /* Inline PLTs if we're optimizing for speed. We'd like to inline + any calls that would involve a PLT, but can't tell, since we + don't know whether an extern function is going to be provided by + a separate translation unit or imported from a separate module. + When compiling for shared libraries, if the function has default + visibility, we assume it's overridable, so we inline the PLT, but + for executables, we don't really have a way to make a good + decision: a function is as likely to be imported from a shared + library as it is to be defined in the executable itself. We + assume executables will get global functions defined locally, + whereas shared libraries will have them potentially overridden, + so we only inline PLTs when compiling for shared libraries. - switch (GET_CODE (op)) + In order to mark a function as local to a shared library, any + non-default visibility attribute suffices. Unfortunately, + there's no simple way to tag a function declaration as ``in a + different module'', which we could then use to trigger PLT + inlining on executables. There's -minline-plt, but it affects + all external functions, so one would have to also mark function + declarations available in the same module with non-default + visibility, which is advantageous in itself. */ + if (GET_CODE (addr) == SYMBOL_REF + && ((!SYMBOL_REF_LOCAL_P (addr) && TARGET_INLINE_PLT) + || sibcall)) { - default: - return FALSE; - - case NEG: - case ABS: - return TRUE; + rtx x, dest; + dest = gen_reg_rtx (SImode); + if (flag_pic != 1) + x = gen_symGOTOFF2reg_hilo (dest, addr, OUR_FDPIC_REG, + GEN_INT (R_FRV_FUNCDESC_GOTOFF12)); + else + x = gen_symGOTOFF2reg (dest, addr, OUR_FDPIC_REG, + GEN_INT (R_FRV_FUNCDESC_GOTOFF12)); + emit_insn (x); + cfun->uses_pic_offset_table = TRUE; + addr = dest; + } + else if (GET_CODE (addr) == SYMBOL_REF) + { + /* These are always either local, or handled through a local + PLT. */ + if (ret_value) + c = gen_call_value_fdpicsi (rvrtx, addr, operands[1], + operands[2], picreg, lr); + else + c = gen_call_fdpicsi (addr, operands[1], operands[2], picreg, lr); + emit_call_insn (c); + return; } -} + else if (! ldd_address_operand (addr, Pmode)) + addr = force_reg (Pmode, addr); -/* Return true if operator is an addition or subtraction expression. - Such expressions can be evaluated conditionally by floating-point - instructions. */ + picreg = gen_reg_rtx (DImode); + emit_insn (gen_movdi_ldd (picreg, addr)); -int -condexec_sf_add_operator (rtx op, enum machine_mode mode) + if (sibcall && ret_value) + c = gen_sibcall_value_fdpicdi (rvrtx, picreg, const0_rtx); + else if (sibcall) + c = gen_sibcall_fdpicdi (picreg, const0_rtx); + else if (ret_value) + c = gen_call_value_fdpicdi (rvrtx, picreg, const0_rtx, lr); + else + c = gen_call_fdpicdi (picreg, const0_rtx, lr); + emit_call_insn (c); +} + +/* Look for a SYMBOL_REF of a function in an rtx. We always want to + process these separately from any offsets, such that we add any + offsets to the function descriptor (the actual pointer), not to the + function address. */ + +static bool +frv_function_symbol_referenced_p (rtx x) { - enum machine_mode op_mode = GET_MODE (op); + const char *format; + int length; + int j; - if (mode != VOIDmode && op_mode != mode) - return FALSE; + if (GET_CODE (x) == SYMBOL_REF) + return SYMBOL_REF_FUNCTION_P (x); + + length = GET_RTX_LENGTH (GET_CODE (x)); + format = GET_RTX_FORMAT (GET_CODE (x)); - switch (GET_CODE (op)) + for (j = 0; j < length; ++j) { - default: - return FALSE; + switch (format[j]) + { + case 'e': + if (frv_function_symbol_referenced_p (XEXP (x, j))) + return TRUE; + break; - case PLUS: - case MINUS: - return TRUE; + case 'V': + case 'E': + if (XVEC (x, j) != 0) + { + int k; + for (k = 0; k < XVECLEN (x, j); ++k) + if (frv_function_symbol_referenced_p (XVECEXP (x, j, k))) + return TRUE; + } + break; + + default: + /* Nothing to do. */ + break; + } } + + return FALSE; } /* Return true if the memory operand is one that can be conditionally @@ -5363,68 +3868,6 @@ condexec_memory_operand (rtx op, enum machine_mode mode) addr = XEXP (op, 0); return frv_legitimate_address_p (mode, addr, reload_completed, TRUE, FALSE); } - -/* Return true if OP is an integer binary operator that can be combined - with a (set ... (compare:CC_NZ ...)) pattern. */ - -int -intop_compare_operator (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE (op) != mode) - return FALSE; - - switch (GET_CODE (op)) - { - default: - return FALSE; - - case PLUS: - case MINUS: - case AND: - case IOR: - case XOR: - case ASHIFTRT: - case LSHIFTRT: - return GET_MODE (op) == SImode; - } -} - -/* Return 1 if operand is a valid ACC register number. */ - -int -acc_operand (rtx op, enum machine_mode mode) -{ - return ((mode == VOIDmode || mode == GET_MODE (op)) - && REG_P (op) && ACC_P (REGNO (op)) - && ((REGNO (op) - ACC_FIRST) & ~ACC_MASK) == 0); -} - -/* Return 1 if operand is a valid even ACC register number. */ - -int -even_acc_operand (rtx op, enum machine_mode mode) -{ - return acc_operand (op, mode) && ((REGNO (op) - ACC_FIRST) & 1) == 0; -} - -/* Return 1 if operand is zero or four. */ - -int -quad_acc_operand (rtx op, enum machine_mode mode) -{ - return acc_operand (op, mode) && ((REGNO (op) - ACC_FIRST) & 3) == 0; -} - -/* Return 1 if operand is a valid ACCG register number. */ - -int -accg_operand (rtx op, enum machine_mode mode) -{ - return ((mode == VOIDmode || mode == GET_MODE (op)) - && REG_P (op) && ACCG_P (REGNO (op)) - && ((REGNO (op) - ACCG_FIRST) & ~ACC_MASK) == 0); -} - /* Return true if the bare return instruction can be used outside of the epilog code. For frv, we only do it if there was no stack allocation. */ @@ -5472,7 +3915,7 @@ frv_emit_move (enum machine_mode mode, rtx dest, rtx src) break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_rtx_SET (VOIDmode, dest, src)); @@ -5687,8 +4130,7 @@ frv_emit_movsi (rtx dest, rtx src) /* Since OUR_FDPIC_REG is a pseudo register, we can't safely introduce new uses of it once reload has begun. */ - if (reload_in_progress || reload_completed) - abort (); + gcc_assert (!reload_in_progress && !reload_completed); switch (unspec) { @@ -6486,7 +4928,7 @@ frv_split_cond_move (rtx operands[]) } else - abort (); + gcc_unreachable (); } else { @@ -6588,7 +5030,7 @@ frv_split_minmax (rtx operands[]) switch (GET_CODE (minmax)) { default: - abort (); + gcc_unreachable (); case SMIN: test_code = LT; break; case SMAX: test_code = GT; break; @@ -6614,8 +5056,7 @@ frv_split_minmax (rtx operands[]) then do a conditional move of the other value. */ if (GET_CODE (src2) == CONST_INT && INTVAL (src2) != 0) { - if (rtx_equal_p (dest, src1)) - abort (); + gcc_assert (!rtx_equal_p (dest, src1)); emit_move_insn (dest, src2); emit_insn (gen_rtx_COND_EXEC (VOIDmode, @@ -6793,8 +5234,8 @@ frv_ifcvt_modify_tests (ce_if_block_t *ce_info, rtx *p_true, rtx *p_false) /* Make sure we are only dealing with hard registers. Also honor the -mno-cond-exec switch, and -mno-nested-cond-exec switches if applicable. */ - if (!reload_completed || TARGET_NO_COND_EXEC - || (TARGET_NO_NESTED_CE && ce_info->pass > 1)) + if (!reload_completed || !TARGET_COND_EXEC + || (!TARGET_NESTED_CE && ce_info->pass > 1)) goto fail; /* Figure out which registers we can allocate for our own purposes. Only @@ -7153,7 +5594,7 @@ frv_ifcvt_modify_multiple_tests (ce_if_block_t *ce_info, debug_rtx (*p_false); } - if (TARGET_NO_MULTI_CE) + if (!TARGET_MULTI_CE) goto fail; if (GET_CODE (cr) != REG) @@ -7423,8 +5864,7 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce_info, rtx op1; rtx test; - if (GET_CODE (pattern) != COND_EXEC) - abort (); + gcc_assert (GET_CODE (pattern) == COND_EXEC); test = COND_EXEC_TEST (pattern); if (GET_CODE (test) == AND) @@ -7690,8 +6130,7 @@ frv_ifcvt_modify_final (ce_if_block_t *ce_info ATTRIBUTE_UNUSED) /* Loop inserting the check insns. The last check insn is the first test, and is the appropriate place to insert constants. */ - if (! p) - abort (); + gcc_assert (p); do { @@ -8039,8 +6478,7 @@ frv_adjust_field_align (tree field, int computed) prev = cur; } - if (!cur) - abort (); + gcc_assert (cur); /* If this isn't a :0 field and if the previous element is a bitfield also, see if the type is different, if so, we will need to align the @@ -8560,8 +6998,7 @@ frv_insn_unit (rtx insn) if (cpu_unit_reservation_p (state, frv_unit_codes[unit])) break; - if (unit == ARRAY_SIZE (frv_unit_codes)) - abort (); + gcc_assert (unit != ARRAY_SIZE (frv_unit_codes)); frv_type_to_unit[type] = unit; } @@ -8629,15 +7066,14 @@ static struct { static int frv_cond_flags (rtx cond) { - if ((GET_CODE (cond) == EQ || GET_CODE (cond) == NE) - && GET_CODE (XEXP (cond, 0)) == REG - && CR_P (REGNO (XEXP (cond, 0))) - && XEXP (cond, 1) == const0_rtx) - return ((REGNO (XEXP (cond, 0)) - CR_FIRST) - | (GET_CODE (cond) == NE - ? REGSTATE_IF_TRUE - : REGSTATE_IF_FALSE)); - abort (); + gcc_assert ((GET_CODE (cond) == EQ || GET_CODE (cond) == NE) + && GET_CODE (XEXP (cond, 0)) == REG + && CR_P (REGNO (XEXP (cond, 0))) + && XEXP (cond, 1) == const0_rtx); + return ((REGNO (XEXP (cond, 0)) - CR_FIRST) + | (GET_CODE (cond) == NE + ? REGSTATE_IF_TRUE + : REGSTATE_IF_FALSE)); } @@ -8920,7 +7356,7 @@ frv_for_each_packet (void (*handle_packet) (void)) /* Early exit if we don't want to pack insns. */ if (!optimize || !flag_schedule_insns_after_reload - || TARGET_NO_VLIW_BRANCH + || !TARGET_VLIW_BRANCH || frv_packet.issue_rate == 1) return false; @@ -9122,7 +7558,7 @@ frv_sort_insn_group (enum frv_insn_group group) return; } } - abort (); + gcc_unreachable (); } /* Sort the current packet into assembly-language order. Set packing @@ -9154,14 +7590,13 @@ frv_reorder_packet (void) if (cursor[group] < packet_group->num_insns) { /* frv_reorg should have added nops for us. */ - if (packet_group->sorted[cursor[group]] == packet_group->nop) - abort (); + gcc_assert (packet_group->sorted[cursor[group]] + != packet_group->nop); insns[to++] = packet_group->sorted[cursor[group]++]; } } - if (to != frv_packet.num_insns) - abort (); + gcc_assert (to == frv_packet.num_insns); /* Clear the last instruction's packing flag, thus marking the end of a packet. Reorder the other instructions relative to it. */ @@ -9811,7 +8246,7 @@ frv_matching_accg_mode (enum machine_mode mode) return QImode; default: - abort (); + gcc_unreachable (); } } @@ -10533,8 +8968,7 @@ frv_in_small_data_p (tree decl) section_name = DECL_SECTION_NAME (decl); if (section_name) { - if (TREE_CODE (section_name) != STRING_CST) - abort (); + gcc_assert (TREE_CODE (section_name) == STRING_CST); if (frv_string_begins_with (section_name, ".sdata")) return true; if (frv_string_begins_with (section_name, ".sbss")) @@ -10630,8 +9064,9 @@ frv_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED) assemble_align (POINTER_SIZE); if (TARGET_FDPIC) { - if (!frv_assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1)) - abort (); + int ok = frv_assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); + + gcc_assert (ok); return; } assemble_integer_with_op ("\t.picptr\t", symbol); @@ -10644,8 +9079,9 @@ frv_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED) assemble_align (POINTER_SIZE); if (TARGET_FDPIC) { - if (!frv_assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1)) - abort (); + int ok = frv_assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, 1); + + gcc_assert (ok); return; } assemble_integer_with_op ("\t.picptr\t", symbol); @@ -10668,8 +9104,7 @@ frv_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED, void frv_output_dwarf_dtprel (FILE *file, int size, rtx x) { - if (size != 4) - abort (); + gcc_assert (size == 4); fputs ("\t.picptr\ttlsmoff(", file); /* We want the unbiased TLS offset, so add the bias to the expression, such that the implicit biasing cancels out. */ diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 148ecae42e6..9961758f611 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -212,13 +212,6 @@ #define CPU_TYPE FRV_CPU_FR500 #endif -/* Allow us to easily change the default for -malloc-cc. */ -#ifndef DEFAULT_NO_ALLOC_CC -#define MASK_DEFAULT_ALLOC_CC MASK_ALLOC_CC -#else -#define MASK_DEFAULT_ALLOC_CC 0 -#endif - /* Run-time target specifications */ #define TARGET_CPU_CPP_BUILTINS() \ @@ -275,104 +268,6 @@ while (0) -/* This declaration should be present. */ -extern int target_flags; - -/* This series of macros is to allow compiler command arguments to enable or - disable the use of optional features of the target machine. For example, - one machine description serves both the 68000 and the 68020; a command - argument tells the compiler whether it should use 68020-only instructions or - not. This command argument works by means of a macro `TARGET_68020' that - tests a bit in `target_flags'. - - Define a macro `TARGET_FEATURENAME' for each such option. Its definition - should test a bit in `target_flags'; for example: - - #define TARGET_68020 (target_flags & 1) - - One place where these macros are used is in the condition-expressions of - instruction patterns. Note how `TARGET_68020' appears frequently in the - 68000 machine description file, `m68k.md'. Another place they are used is - in the definitions of the other macros in the `MACHINE.h' file. */ - -#define MASK_GPR_32 0x00000001 /* Limit gprs to 32 registers */ -#define MASK_FPR_32 0x00000002 /* Limit fprs to 32 registers */ -#define MASK_SOFT_FLOAT 0x00000004 /* Use software floating point */ -#define MASK_ALLOC_CC 0x00000008 /* Dynamically allocate icc/fcc's */ -#define MASK_DWORD 0x00000010 /* Change ABi to allow dbl word insns*/ -#define MASK_DOUBLE 0x00000020 /* Use double precision instructions */ -#define MASK_MEDIA 0x00000040 /* Use media instructions */ -#define MASK_MULADD 0x00000080 /* Use multiply add/subtract insns */ -#define MASK_LIBPIC 0x00000100 /* -fpic that can be linked w/o pic */ -#define MASK_ACC_4 0x00000200 /* Only use four media accumulators */ -#define MASK_PACK 0x00000400 /* Set to enable packed output */ -#define MASK_LONG_CALLS 0x00000800 /* Use indirect calls */ -#define MASK_ALIGN_LABELS 0x00001000 /* Optimize label alignments */ -#define MASK_LINKED_FP 0x00002000 /* Follow ABI linkage requirements. */ -#define MASK_BIG_TLS 0x00008000 /* Assume a big TLS segment */ - - /* put debug masks up high */ -#define MASK_DEBUG_ARG 0x40000000 /* debug argument handling */ -#define MASK_DEBUG_ADDR 0x20000000 /* debug go_if_legitimate_address */ -#define MASK_DEBUG_STACK 0x10000000 /* debug stack frame */ -#define MASK_DEBUG 0x08000000 /* general debugging switch */ -#define MASK_DEBUG_LOC 0x04000000 /* optimize line # table */ -#define MASK_DEBUG_COND_EXEC 0x02000000 /* debug cond exec code */ -#define MASK_NO_COND_MOVE 0x01000000 /* disable conditional moves */ -#define MASK_NO_SCC 0x00800000 /* disable set conditional codes */ -#define MASK_NO_COND_EXEC 0x00400000 /* disable conditional execution */ -#define MASK_NO_VLIW_BRANCH 0x00200000 /* disable repacking branches */ -#define MASK_NO_MULTI_CE 0x00100000 /* disable multi-level cond exec */ -#define MASK_NO_NESTED_CE 0x00080000 /* disable nested cond exec */ -#define MASK_FDPIC 0x00040000 /* Follow the new uClinux ABI. */ -#define MASK_INLINE_PLT 0x00020000 /* Inline FDPIC PLTs. */ -#define MASK_GPREL_RO 0x00010000 /* Use GPREL for read-only data. */ - -#define MASK_DEFAULT MASK_DEFAULT_ALLOC_CC - -#define TARGET_GPR_32 ((target_flags & MASK_GPR_32) != 0) -#define TARGET_FPR_32 ((target_flags & MASK_FPR_32) != 0) -#define TARGET_SOFT_FLOAT ((target_flags & MASK_SOFT_FLOAT) != 0) -#define TARGET_ALLOC_CC ((target_flags & MASK_ALLOC_CC) != 0) -#define TARGET_DWORD ((target_flags & MASK_DWORD) != 0) -#define TARGET_DOUBLE ((target_flags & MASK_DOUBLE) != 0) -#define TARGET_MEDIA ((target_flags & MASK_MEDIA) != 0) -#define TARGET_MULADD ((target_flags & MASK_MULADD) != 0) -#define TARGET_LIBPIC ((target_flags & MASK_LIBPIC) != 0) -#define TARGET_ACC_4 ((target_flags & MASK_ACC_4) != 0) -#define TARGET_DEBUG_ARG ((target_flags & MASK_DEBUG_ARG) != 0) -#define TARGET_DEBUG_ADDR ((target_flags & MASK_DEBUG_ADDR) != 0) -#define TARGET_DEBUG_STACK ((target_flags & MASK_DEBUG_STACK) != 0) -#define TARGET_DEBUG ((target_flags & MASK_DEBUG) != 0) -#define TARGET_DEBUG_LOC ((target_flags & MASK_DEBUG_LOC) != 0) -#define TARGET_DEBUG_COND_EXEC ((target_flags & MASK_DEBUG_COND_EXEC) != 0) -#define TARGET_NO_COND_MOVE ((target_flags & MASK_NO_COND_MOVE) != 0) -#define TARGET_NO_SCC ((target_flags & MASK_NO_SCC) != 0) -#define TARGET_NO_COND_EXEC ((target_flags & MASK_NO_COND_EXEC) != 0) -#define TARGET_NO_VLIW_BRANCH ((target_flags & MASK_NO_VLIW_BRANCH) != 0) -#define TARGET_NO_MULTI_CE ((target_flags & MASK_NO_MULTI_CE) != 0) -#define TARGET_NO_NESTED_CE ((target_flags & MASK_NO_NESTED_CE) != 0) -#define TARGET_FDPIC ((target_flags & MASK_FDPIC) != 0) -#define TARGET_INLINE_PLT ((target_flags & MASK_INLINE_PLT) != 0) -#define TARGET_BIG_TLS ((target_flags & MASK_BIG_TLS) != 0) -#define TARGET_GPREL_RO ((target_flags & MASK_GPREL_RO) != 0) -#define TARGET_PACK ((target_flags & MASK_PACK) != 0) -#define TARGET_LONG_CALLS ((target_flags & MASK_LONG_CALLS) != 0) -#define TARGET_ALIGN_LABELS ((target_flags & MASK_ALIGN_LABELS) != 0) -#define TARGET_LINKED_FP ((target_flags & MASK_LINKED_FP) != 0) - -#define TARGET_GPR_64 (! TARGET_GPR_32) -#define TARGET_FPR_64 (! TARGET_FPR_32) -#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) -#define TARGET_FIXED_CC (! TARGET_ALLOC_CC) -#define TARGET_COND_MOVE (! TARGET_NO_COND_MOVE) -#define TARGET_SCC (! TARGET_NO_SCC) -#define TARGET_COND_EXEC (! TARGET_NO_COND_EXEC) -#define TARGET_VLIW_BRANCH (! TARGET_NO_VLIW_BRANCH) -#define TARGET_MULTI_CE (! TARGET_NO_MULTI_CE) -#define TARGET_NESTED_CE (! TARGET_NO_NESTED_CE) -#define TARGET_ACC_8 (! TARGET_ACC_4) - #define TARGET_HAS_FPRS (TARGET_HARD_FLOAT || TARGET_MEDIA) #define NUM_GPRS (TARGET_GPR_32? 32 : 64) @@ -420,122 +315,6 @@ extern int target_flags; #define HAVE_AS_TLS 0 #endif -/* This macro defines names of command options to set and clear bits in - `target_flags'. Its definition is an initializer with a subgrouping for - each command option. - - Each subgrouping contains a string constant, that defines the option name, - a number, which contains the bits to set in `target_flags', and an optional - second string which is the textual description that will be displayed when - the user passes --help on the command line. If the number entry is negative - then the specified bits will be cleared instead of being set. If the second - string entry is present but empty, then no help information will be displayed - for that option, but it will not count as an undocumented option. The actual - option name, asseen on the command line is made by appending `-m' to the - specified name. - - One of the subgroupings should have a null string. The number in this - grouping is the default value for `target_flags'. Any target options act - starting with that value. - - Here is an example which defines `-m68000' and `-m68020' with opposite - meanings, and picks the latter as the default: - - #define TARGET_SWITCHES \ - { { "68020", 1, ""}, \ - { "68000", -1, "Compile for the m68000"}, \ - { "", 1, }} - - This declaration must be present. */ - -#define TARGET_SWITCHES \ -{{ "gpr-32", MASK_GPR_32, "Only use 32 gprs"}, \ - { "gpr-64", -MASK_GPR_32, "Use 64 gprs"}, \ - { "fpr-32", MASK_FPR_32, "Only use 32 fprs"}, \ - { "fpr-64", -MASK_FPR_32, "Use 64 fprs"}, \ - { "hard-float", -MASK_SOFT_FLOAT, "Use hardware floating point" },\ - { "soft-float", MASK_SOFT_FLOAT, "Use software floating point" },\ - { "alloc-cc", MASK_ALLOC_CC, "Dynamically allocate cc's" }, \ - { "fixed-cc", -MASK_ALLOC_CC, "Just use icc0/fcc0" }, \ - { "dword", MASK_DWORD, "Change ABI to allow double word insns" }, \ - { "no-dword", -MASK_DWORD, "Do not use double word insns" }, \ - { "double", MASK_DOUBLE, "Use fp double instructions" }, \ - { "no-double", -MASK_DOUBLE, "Do not use fp double insns" }, \ - { "media", MASK_MEDIA, "Use media instructions" }, \ - { "no-media", -MASK_MEDIA, "Do not use media insns" }, \ - { "muladd", MASK_MULADD, "Use multiply add/subtract instructions" }, \ - { "no-muladd", -MASK_MULADD, "Do not use multiply add/subtract insns" }, \ - { "ultilib-library-pic", 0, "Link with the library-pic libraries" }, \ - { "library-pic", MASK_LIBPIC, "PIC support for building libraries" }, \ - { "acc-4", MASK_ACC_4, "Use 4 media accumulators" }, \ - { "acc-8", -MASK_ACC_4, "Use 8 media accumulators" }, \ - { "pack", MASK_PACK, "Pack VLIW instructions" }, \ - { "no-pack", -MASK_PACK, "Do not pack VLIW instructions" }, \ - { "no-eflags", 0, "Do not mark ABI switches in e_flags" }, \ - { "debug-arg", MASK_DEBUG_ARG, "Internal debug switch" }, \ - { "debug-addr", MASK_DEBUG_ADDR, "Internal debug switch" }, \ - { "debug-stack", MASK_DEBUG_STACK, "Internal debug switch" }, \ - { "debug", MASK_DEBUG, "Internal debug switch" }, \ - { "debug-cond-exec", MASK_DEBUG_COND_EXEC, "Internal debug switch" }, \ - { "debug-loc", MASK_DEBUG_LOC, "Internal debug switch" }, \ - { "align-labels", MASK_ALIGN_LABELS, "Enable label alignment optimizations" }, \ - { "no-align-labels", -MASK_ALIGN_LABELS, "Disable label alignment optimizations" }, \ - { "cond-move", -MASK_NO_COND_MOVE, "Enable conditional moves" }, \ - { "no-cond-move", MASK_NO_COND_MOVE, "Disable conditional moves" }, \ - { "scc", -MASK_NO_SCC, "Enable setting gprs to the result of comparisons" }, \ - { "no-scc", MASK_NO_SCC, "Disable setting gprs to the result of comparisons" }, \ - { "cond-exec", -MASK_NO_COND_EXEC, "Enable conditional execution other than moves/scc" }, \ - { "no-cond-exec", MASK_NO_COND_EXEC, "Disable conditional execution other than moves/scc" }, \ - { "vliw-branch", -MASK_NO_VLIW_BRANCH, "Run pass to pack branches into VLIW insns" }, \ - { "no-vliw-branch", MASK_NO_VLIW_BRANCH, "Do not run pass to pack branches into VLIW insns" }, \ - { "multi-cond-exec", -MASK_NO_MULTI_CE, "Disable optimizing &&/|| in conditional execution" }, \ - { "no-multi-cond-exec", MASK_NO_MULTI_CE, "Enable optimizing &&/|| in conditional execution" }, \ - { "nested-cond-exec", -MASK_NO_NESTED_CE, "Enable nested conditional execution optimizations" }, \ - { "no-nested-cond-exec" ,MASK_NO_NESTED_CE, "Disable nested conditional execution optimizations" }, \ - { "long-calls", MASK_LONG_CALLS, "Disallow direct calls to global functions" }, \ - { "no-long-calls", -MASK_LONG_CALLS, "Allow direct calls to global functions" }, \ - { "linked-fp", MASK_LINKED_FP, "Follow the EABI linkage requirements" }, \ - { "no-linked-fp", -MASK_LINKED_FP, "Don't follow the EABI linkage requirements" }, \ - { "fdpic", MASK_FDPIC, "Enable file descriptor PIC mode" }, \ - { "no-fdpic", -MASK_FDPIC, "Disable file descriptor PIC mode" }, \ - { "inline-plt", MASK_INLINE_PLT, "Enable inlining of PLT in function calls" }, \ - { "no-inline-plt", -MASK_INLINE_PLT, "Disable inlining of PLT in function calls" }, \ - { "TLS", MASK_BIG_TLS, "Assume a large TLS segment" }, \ - { "tls", -MASK_BIG_TLS, "Do not assume a large TLS segment" }, \ - { "gprel-ro", MASK_GPREL_RO, "Enable use of GPREL for read-only data in FDPIC" }, \ - { "no-gprel-ro", -MASK_GPREL_RO, "Disable use of GPREL for read-only data in FDPIC" }, \ - { "tomcat-stats", 0, "Cause gas to print tomcat statistics" }, \ - { "", MASK_DEFAULT, "" }} \ - -/* This macro is similar to `TARGET_SWITCHES' but defines names of command - options that have values. Its definition is an initializer with a - subgrouping for each command option. - - Each subgrouping contains a string constant, that defines the fixed part of - the option name, the address of a variable, and an optional description string. - The variable, of type `char *', is set to the text following the fixed part of - the option as it is specified on the command line. The actual option name is - made by appending `-m' to the specified name. - - Here is an example which defines `-mshort-data-NUMBER'. If the given option - is `-mshort-data-512', the variable `m88k_short_data' will be set to the - string `"512"'. - - extern char *m88k_short_data; - #define TARGET_OPTIONS \ - { { "short-data-", & m88k_short_data, \ - "Specify the size of the short data section" } } - - This declaration is optional. */ -#define TARGET_OPTIONS \ -{ \ - { "cpu=", &frv_cpu_string, "Set cpu type", 0}, \ - { "branch-cost=", &frv_branch_cost_string, "Internal debug switch", 0}, \ - { "cond-exec-insns=", &frv_condexec_insns_str, "Internal debug switch", 0}, \ - { "cond-exec-temps=", &frv_condexec_temps_str, "Internal debug switch", 0}, \ - { "sched-lookahead=", &frv_sched_lookahead_str,"Internal debug switch", 0}, \ -} - /* This macro is a C statement to print on `stderr' a string describing the particular machine description choice. Every machine description should define `TARGET_VERSION'. For example: @@ -572,7 +351,7 @@ extern int target_flags; You should not use this macro to change options that are not machine-specific. These should uniformly selected by the same optimization - level on all supported machines. Use this macro to enable machbine-specific + level on all supported machines. Use this macro to enable machine-specific optimizations. *Do not examine `write_symbols' in this macro!* The debugging options are @@ -819,7 +598,6 @@ extern int target_flags; #define FPR_FIRST 64 /* First FP reg */ #define FPR_LAST 127 /* Last FP reg */ -#define DEFAULT_CONDEXEC_TEMPS 4 /* reserve 4 regs by default */ #define GPR_TEMP_NUM frv_condexec_temps /* # gprs to reserve for temps */ /* We reserve the last CR and CCR in each category to be used as a reload @@ -2444,18 +2222,6 @@ do { \ /* A C expression for the cost of a branch instruction. A value of 1 is the default; other values are interpreted relative to that. */ - -/* Here are additional macros which do not specify precise relative costs, but - only that certain actions are more expensive than GCC would ordinarily - expect. */ - -/* We used to default the branch cost to 2, but I changed it to 1, to avoid - generating SCC instructions and or/and-ing them together, and then doing the - branch on the result, which collectively generate much worse code. */ -#ifndef DEFAULT_BRANCH_COST -#define DEFAULT_BRANCH_COST 1 -#endif - #define BRANCH_COST frv_branch_cost_int /* Define this macro as a C expression which is nonzero if accessing less than @@ -2992,104 +2758,6 @@ do { \ /* Miscellaneous Parameters. */ -/* Define this if you have defined special-purpose predicates in the file - `MACHINE.c'. This macro is called within an initializer of an array of - structures. The first field in the structure is the name of a predicate and - the second field is an array of rtl codes. For each predicate, list all rtl - codes that can be in expressions matched by the predicate. The list should - have a trailing comma. Here is an example of two entries in the list for a - typical RISC machine: - - #define PREDICATE_CODES \ - {"gen_reg_rtx_operand", {SUBREG, REG}}, \ - {"reg_or_short_cint_operand", {SUBREG, REG, CONST_INT}}, - - Defining this macro does not affect the generated code (however, incorrect - definitions that omit an rtl code that may be matched by the predicate can - cause the compiler to malfunction). Instead, it allows the table built by - `genrecog' to be more compact and efficient, thus speeding up the compiler. - The most important predicates to include in the list specified by this macro - are thoses used in the most insn patterns. */ -#define PREDICATE_CODES \ - { "integer_register_operand", { REG, SUBREG }}, \ - { "frv_load_operand", { REG, SUBREG, MEM }}, \ - { "gpr_no_subreg_operand", { REG }}, \ - { "gpr_or_fpr_operand", { REG, SUBREG }}, \ - { "gpr_or_int12_operand", { REG, SUBREG, CONST_INT }}, \ - { "gpr_fpr_or_int12_operand", { REG, SUBREG, CONST_INT }}, \ - { "gpr_or_int10_operand", { REG, SUBREG, CONST_INT }}, \ - { "gpr_or_int_operand", { REG, SUBREG, CONST_INT }}, \ - { "move_source_operand", { REG, SUBREG, CONST_INT, MEM, \ - CONST_DOUBLE, CONST, \ - SYMBOL_REF, LABEL_REF }}, \ - { "move_destination_operand", { REG, SUBREG, MEM }}, \ - { "movcc_fp_destination_operand", { REG, SUBREG, MEM }}, \ - { "condexec_source_operand", { REG, SUBREG, CONST_INT, MEM, \ - CONST_DOUBLE }}, \ - { "condexec_dest_operand", { REG, SUBREG, MEM }}, \ - { "reg_or_0_operand", { REG, SUBREG, CONST_INT }}, \ - { "lr_operand", { REG }}, \ - { "gpr_or_memory_operand", { REG, SUBREG, MEM }}, \ - { "gpr_or_memory_operand_with_scratch", { REG, SUBREG, MEM }}, \ - { "fpr_or_memory_operand", { REG, SUBREG, MEM }}, \ - { "int12_operand", { CONST_INT }}, \ - { "int_2word_operand", { CONST_INT, CONST_DOUBLE, \ - SYMBOL_REF, LABEL_REF, CONST }}, \ - { "fdpic_operand", { REG }}, \ - { "fdpic_fptr_operand", { REG }}, \ - { "ldd_address_operand", { REG, SUBREG, PLUS }}, \ - { "got12_operand", { CONST }}, \ - { "const_unspec_operand", { CONST }}, \ - { "icc_operand", { REG }}, \ - { "fcc_operand", { REG }}, \ - { "cc_operand", { REG }}, \ - { "icr_operand", { REG }}, \ - { "fcr_operand", { REG }}, \ - { "cr_operand", { REG }}, \ - { "fpr_operand", { REG, SUBREG }}, \ - { "even_reg_operand", { REG, SUBREG }}, \ - { "odd_reg_operand", { REG, SUBREG }}, \ - { "even_gpr_operand", { REG, SUBREG }}, \ - { "odd_gpr_operand", { REG, SUBREG }}, \ - { "quad_fpr_operand", { REG, SUBREG }}, \ - { "even_fpr_operand", { REG, SUBREG }}, \ - { "odd_fpr_operand", { REG, SUBREG }}, \ - { "dbl_memory_one_insn_operand", { MEM }}, \ - { "dbl_memory_two_insn_operand", { MEM }}, \ - { "call_operand", { REG, SUBREG, CONST_INT, \ - CONST, SYMBOL_REF }}, \ - { "sibcall_operand", { REG, SUBREG, CONST_INT, \ - CONST }}, \ - { "upper_int16_operand", { CONST_INT }}, \ - { "uint16_operand", { CONST_INT }}, \ - { "symbolic_operand", { SYMBOL_REF, CONST_INT }}, \ - { "relational_operator", { EQ, NE, LE, LT, GE, GT, \ - LEU, LTU, GEU, GTU }}, \ - { "integer_relational_operator", { EQ, NE, LE, LT, GE, GT, \ - LEU, LTU, GEU, GTU }}, \ - { "float_relational_operator", { EQ, NE, LE, LT, GE, GT }}, \ - { "ccr_eqne_operator", { EQ, NE }}, \ - { "minmax_operator", { SMIN, SMAX, UMIN, UMAX }}, \ - { "condexec_si_binary_operator", { PLUS, MINUS, AND, IOR, XOR, \ - ASHIFT, ASHIFTRT, LSHIFTRT }}, \ - { "condexec_si_media_operator", { AND, IOR, XOR }}, \ - { "condexec_si_divide_operator", { DIV, UDIV }}, \ - { "condexec_si_unary_operator", { NOT, NEG }}, \ - { "condexec_sf_add_operator", { PLUS, MINUS }}, \ - { "condexec_sf_conv_operator", { ABS, NEG }}, \ - { "intop_compare_operator", { PLUS, MINUS, AND, IOR, XOR, \ - ASHIFT, ASHIFTRT, LSHIFTRT }}, \ - { "fpr_or_int6_operand", { REG, SUBREG, CONST_INT }}, \ - { "int6_operand", { CONST_INT }}, \ - { "int5_operand", { CONST_INT }}, \ - { "uint5_operand", { CONST_INT }}, \ - { "uint4_operand", { CONST_INT }}, \ - { "uint1_operand", { CONST_INT }}, \ - { "acc_operand", { REG, SUBREG }}, \ - { "even_acc_operand", { REG, SUBREG }}, \ - { "quad_acc_operand", { REG, SUBREG }}, \ - { "accg_operand", { REG, SUBREG }}, - /* An alias for a machine mode name. This is the machine mode that elements of a jump-table should have. */ #define CASE_VECTOR_MODE SImode @@ -3161,9 +2829,6 @@ do { \ cc0, and 1 if it does use cc0. */ #define MAX_CONDITIONAL_EXECUTE frv_condexec_insns -/* Default value of MAX_CONDITIONAL_EXECUTE if no -mcond-exec-insns= */ -#define DEFAULT_CONDEXEC_INSNS 8 - /* A C expression to modify the code described by the conditional if information CE_INFO, possibly updating the tests in TRUE_EXPR, and FALSE_EXPR for converting if-then and if-then-else code to conditional diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md index 4515c0b44dd..2feb6c6a7b9 100644 --- a/gcc/config/frv/frv.md +++ b/gcc/config/frv/frv.md @@ -1206,7 +1206,7 @@ (eq_attr "type" "sqrt_single")) "(f1|f0) + fr550_float") -;; Synthetic units for enforcing media issue restructions. Certain types +;; Synthetic units for enforcing media issue restrictions. Certain types ;; of insn in M2 conflict with certain types in M0: ;; ;; M2 @@ -1504,6 +1504,7 @@ ;; ) ;; +(include "predicates.md") ;; :::::::::::::::::::: ;; :: @@ -2467,13 +2468,11 @@ rtx addr; rtx temp3 = simplify_gen_subreg (SImode, operands[2], TImode, 12); - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); addr = XEXP (operands[1], 0); - if (GET_CODE (addr) != PLUS) - abort (); + gcc_assert (GET_CODE (addr) == PLUS); emit_move_insn (temp3, XEXP (addr, 1)); @@ -4478,7 +4477,7 @@ case ASHIFT: return \"csll %4, %z5, %2, %1, %e0\"; case ASHIFTRT: return \"csra %4, %z5, %2, %1, %e0\"; case LSHIFTRT: return \"csrl %4, %z5, %2, %1, %e0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" "4") @@ -4501,7 +4500,7 @@ case AND: return \"cmand %4, %5, %2, %1, %e0\"; case IOR: return \"cmor %4, %5, %2, %1, %e0\"; case XOR: return \"cmxor %4, %5, %2, %1, %e0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" "4") @@ -4542,7 +4541,7 @@ { case DIV: return \"csdiv %4, %z5, %2, %1, %e0\"; case UDIV: return \"cudiv %4, %z5, %2, %1, %e0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" "4") @@ -4563,7 +4562,7 @@ { case NOT: return \"cnot %4, %2, %1, %e0\"; case NEG: return \"csub %., %4, %2, %1, %e0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" "4") @@ -4638,7 +4637,7 @@ { case ABS: return \"cfabss %4, %2, %1, %e0\"; case NEG: return \"cfnegs %4, %2, %1, %e0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" "4") @@ -4660,7 +4659,7 @@ { case PLUS: return \"cfadds %4, %5, %2, %1, %e0\"; case MINUS: return \"cfsubs %4, %5, %2, %1, %e0\"; - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "length" "4") @@ -5403,8 +5402,7 @@ rtx lr = gen_rtx_REG (Pmode, LR_REGNO); rtx addr; - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); addr = XEXP (operands[0], 0); if (! call_operand (addr, Pmode)) @@ -5489,8 +5487,7 @@ { rtx addr; - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); addr = XEXP (operands[0], 0); if (! sibcall_operand (addr, Pmode)) @@ -5557,8 +5554,7 @@ rtx lr = gen_rtx_REG (Pmode, LR_REGNO); rtx addr; - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); addr = XEXP (operands[1], 0); if (! call_operand (addr, Pmode)) @@ -5624,8 +5620,7 @@ { rtx addr; - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); addr = XEXP (operands[1], 0); if (! sibcall_operand (addr, Pmode)) @@ -5837,11 +5832,9 @@ rtx reg2; rtx reg3; - if (GET_CODE (operands[1]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[1]) == CONST_INT); - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); /* If we can't generate an immediate instruction, promote to register. */ if (! IN_RANGE_P (INTVAL (range), -2048, 2047)) @@ -5913,7 +5906,7 @@ ;; Called after register allocation to add any instructions needed for the ;; epilogue. Using an epilogue insn is favored compared to putting all of the ;; instructions in the FUNCTION_EPILOGUE macro, since it allows the scheduler -;; to intermix instructions with the restires of the caller saved registers. +;; to intermix instructions with the restores of the caller saved registers. ;; In some cases, it might be necessary to emit a barrier instruction as the ;; first insn to prevent such scheduling. (define_expand "epilogue" diff --git a/gcc/config/frv/frv.opt b/gcc/config/frv/frv.opt new file mode 100644 index 00000000000..c05516c68c2 --- /dev/null +++ b/gcc/config/frv/frv.opt @@ -0,0 +1,196 @@ +; Options for the FR-V port of the compiler. + +; Copyright (C) 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. + +macc-4 +Target Report RejectNegative Mask(ACC_4) +Use 4 media accumulators + +macc-8 +Target Report RejectNegative InverseMask(ACC_4, ACC_8) +Use 8 media accumulators + +malign-labels +Target Report Mask(ALIGN_LABELS) +Enable label alignment optimizations + +malloc-cc +Target Report RejectNegative Mask(ALLOC_CC) +Dynamically allocate cc registers + +; We used to default the branch cost to 2, but it was changed it to 1 to avoid +; generating SCC instructions and or/and-ing them together, and then doing the +; branch on the result, which collectively generate much worse code. +mbranch-cost= +Target RejectNegative Joined UInteger Var(frv_branch_cost_int) Init(1) +Set the cost of branches + +mcond-exec +Target Report Mask(COND_EXEC) +Enable conditional execution other than moves/scc + +mcond-exec-insns= +Target RejectNegative Joined UInteger Var(frv_condexec_insns) Init(8) +Change the maximum length of conditionally-executed sequences + +mcond-exec-temps= +Target RejectNegative Joined UInteger Var(frv_condexec_temps) Init(4) +Change the number of temporary registers that are available to conditionally-executed sequences + +mcond-move +Target Report Mask(COND_MOVE) +Enable conditional moves + +mcpu= +Target RejectNegative Joined +Set the target CPU type + +mdebug +Target Undocumented Var(TARGET_DEBUG) + +mdebug-arg +Target Undocumented Var(TARGET_DEBUG_ARG) + +mdebug-addr +Target Undocumented Var(TARGET_DEBUG_ADDR) + +mdebug-cond-exec +Target Undocumented Var(TARGET_DEBUG_COND_EXEC) + +mdebug-loc +Target Undocumented Var(TARGET_DEBUG_LOC) + +mdebug-stack +Target Undocumented Var(TARGET_DEBUG_STACK) + +mdouble +Target Report Mask(DOUBLE) +Use fp double instructions + +mdword +Target Report Mask(DWORD) +Change the ABI to allow double word insns + +mfdpic +Target Report Mask(FDPIC) +Enable Function Descriptor PIC mode + +mfixed-cc +Target Report RejectNegative InverseMask(ALLOC_CC, FIXED_CC) +Just use icc0/fcc0 + +mfpr-32 +Target Report RejectNegative Mask(FPR_32) +Only use 32 FPRs + +mfpr-64 +Target Report RejectNegative InverseMask(FPR_32, FPR_64) +Use 64 FPRs + +mgpr-32 +Target Report RejectNegative Mask(GPR_32) +Only use 32 GPRs + +mgpr-64 +Target Report RejectNegative InverseMask(GPR_32, GPR_64) +Use 64 GPRs + +mgprel-ro +Target Report Mask(GPREL_RO) +Enable use of GPREL for read-only data in FDPIC + +mhard-float +Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) +Use hardware floating point + +minline-plt +Target Report Mask(INLINE_PLT) +Enable inlining of PLT in function calls + +mlibrary-pic +Target Report Mask(LIBPIC) +Enable PIC support for building libraries + +mlinked-fp +Target Report Mask(LINKED_FP) +Follow the EABI linkage requirements + +mlong-calls +Target Report Mask(LONG_CALLS) +Disallow direct calls to global functions + +mmedia +Target Report Mask(MEDIA) +Use media instructions + +mmuladd +Target Report Mask(MULADD) +Use multiply add/subtract instructions + +mmulti-cond-exec +Target Report Mask(MULTI_CE) +Enable optimizing &&/|| in conditional execution + +mnested-cond-exec +Target Report Mask(NESTED_CE) +Enable nested conditional execution optimizations + +; Not used by the compiler proper. +mno-eflags +Target RejectNegative +Do not mark ABI switches in e_flags + +mpack +Target Report Mask(PACK) +Pack VLIW instructions + +mscc +Target Report Mask(SCC) +Enable setting GPRs to the result of comparisons + +msched-lookahead= +Target RejectNegative Joined UInteger Var(frv_sched_lookahead) Init(4) +Change the amount of scheduler lookahead + +msoft-float +Target Report RejectNegative Mask(SOFT_FLOAT) +Use software floating point + +mTLS +Target Report RejectNegative Mask(BIG_TLS) +Assume a large TLS segment + +mtls +Target Report RejectNegative InverseMask(BIG_TLS) +Do not assume a large TLS segment + +; Not used by the compiler proper. +mtomcat-stats +Target +Cause gas to print tomcat statistics + +; Not used by the compiler proper. +multilib-library-pic +Target RejectNegative +Link with the library-pic libraries + +mvliw-branch +Target Report Mask(VLIW_BRANCH) +Allow branches to be packed with other instructions diff --git a/gcc/config/frv/predicates.md b/gcc/config/frv/predicates.md new file mode 100644 index 00000000000..656b6950170 --- /dev/null +++ b/gcc/config/frv/predicates.md @@ -0,0 +1,1550 @@ +;; Predicate definitions for Frv. +;; Copyright (C) 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. + +;; Return true if operand is a GPR register. + +(define_predicate "integer_register_operand" + (match_code "reg,subreg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + return GPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return 1 is OP is a memory operand, or will be turned into one by +;; reload. + +(define_predicate "frv_load_operand" + (match_code "reg,subreg,mem") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (reload_in_progress) + { + rtx tmp = op; + if (GET_CODE (tmp) == SUBREG) + tmp = SUBREG_REG (tmp); + if (GET_CODE (tmp) == REG + && REGNO (tmp) >= FIRST_PSEUDO_REGISTER) + op = reg_equiv_memory_loc[REGNO (tmp)]; + } + + return op && memory_operand (op, mode); +}) + +;; Return true if operand is a GPR register. Do not allow SUBREG's +;; here, in order to prevent a combine bug. + +(define_predicate "gpr_no_subreg_operand" + (match_code "reg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + return GPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return 1 if operand is a GPR register or a FPR register. + +(define_predicate "gpr_or_fpr_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (GPR_P (regno) || FPR_P (regno) || regno >= FIRST_PSEUDO_REGISTER) + return TRUE; + + return FALSE; +}) + +;; Return 1 if operand is a GPR register or 12 bit signed immediate. + +(define_predicate "gpr_or_int12_operand" + (match_code "reg,subreg,const_int,const") +{ + if (GET_CODE (op) == CONST_INT) + return IN_RANGE_P (INTVAL (op), -2048, 2047); + + if (got12_operand (op, mode)) + return true; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + return GPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return 1 if operand is a GPR register, or a FPR register, or a 12 +;; bit signed immediate. + +(define_predicate "gpr_fpr_or_int12_operand" + (match_code "reg,subreg,const_int") +{ + int regno; + + if (GET_CODE (op) == CONST_INT) + return IN_RANGE_P (INTVAL (op), -2048, 2047); + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (GPR_P (regno) || FPR_P (regno) || regno >= FIRST_PSEUDO_REGISTER) + return TRUE; + + return FALSE; +}) + +;; Return 1 if operand is a register or 10 bit signed immediate. + +(define_predicate "gpr_or_int10_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == CONST_INT) + return IN_RANGE_P (INTVAL (op), -512, 511); + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + return GPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return 1 if operand is a register or an integer immediate. + +(define_predicate "gpr_or_int_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == CONST_INT) + return TRUE; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + return GPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return true if operand is something that can be an input for a move +;; operation. + +(define_predicate "move_source_operand" + (match_code "reg,subreg,const_int,mem,const_double,const,symbol_ref,label_ref") +{ + rtx subreg; + enum rtx_code code; + + switch (GET_CODE (op)) + { + default: + break; + + case CONST_INT: + case CONST_DOUBLE: + return immediate_operand (op, mode); + + case SUBREG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + subreg = SUBREG_REG (op); + code = GET_CODE (subreg); + if (code == MEM) + return frv_legitimate_address_p (mode, XEXP (subreg, 0), + reload_completed, FALSE, FALSE); + + return (code == REG); + + case REG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + return TRUE; + + case MEM: + return frv_legitimate_memory_operand (op, mode, FALSE); + } + + return FALSE; +}) + +;; Return true if operand is something that can be an output for a +;; move operation. + +(define_predicate "move_destination_operand" + (match_code "reg,subreg,mem") +{ + rtx subreg; + enum rtx_code code; + + switch (GET_CODE (op)) + { + default: + break; + + case SUBREG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + subreg = SUBREG_REG (op); + code = GET_CODE (subreg); + if (code == MEM) + return frv_legitimate_address_p (mode, XEXP (subreg, 0), + reload_completed, FALSE, FALSE); + + return (code == REG); + + case REG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + return TRUE; + + case MEM: + return frv_legitimate_memory_operand (op, mode, FALSE); + } + + return FALSE; +}) + +;; Return true if we the operand is a valid destination for a movcc_fp +;; instruction. This means rejecting fcc_operands, since we need +;; scratch registers to write to them. + +(define_predicate "movcc_fp_destination_operand" + (match_code "reg,subreg,mem") +{ + if (fcc_operand (op, mode)) + return FALSE; + + return move_destination_operand (op, mode); +}) + +;; Return true if operand is something that can be an input for a +;; conditional move operation. + +(define_predicate "condexec_source_operand" + (match_code "reg,subreg,const_int,mem,const_double") +{ + rtx subreg; + enum rtx_code code; + + switch (GET_CODE (op)) + { + default: + break; + + case CONST_INT: + case CONST_DOUBLE: + return ZERO_P (op); + + case SUBREG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + subreg = SUBREG_REG (op); + code = GET_CODE (subreg); + if (code == MEM) + return frv_legitimate_address_p (mode, XEXP (subreg, 0), + reload_completed, TRUE, FALSE); + + return (code == REG); + + case REG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + return TRUE; + + case MEM: + return frv_legitimate_memory_operand (op, mode, TRUE); + } + + return FALSE; +}) + +;; Return true if operand is something that can be an output for a +;; conditional move operation. + +(define_predicate "condexec_dest_operand" + (match_code "reg,subreg,mem") +{ + rtx subreg; + enum rtx_code code; + + switch (GET_CODE (op)) + { + default: + break; + + case SUBREG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + subreg = SUBREG_REG (op); + code = GET_CODE (subreg); + if (code == MEM) + return frv_legitimate_address_p (mode, XEXP (subreg, 0), + reload_completed, TRUE, FALSE); + + return (code == REG); + + case REG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + return TRUE; + + case MEM: + return frv_legitimate_memory_operand (op, mode, TRUE); + } + + return FALSE; +}) + +;; Return true if operand is a register of any flavor or a 0 of the +;; appropriate type. + +(define_predicate "reg_or_0_operand" + (match_code "reg,subreg,const_int") +{ + switch (GET_CODE (op)) + { + default: + break; + + case REG: + case SUBREG: + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + return register_operand (op, mode); + + case CONST_INT: + case CONST_DOUBLE: + return ZERO_P (op); + } + + return FALSE; +}) + +;; Return true if operand is the link register. + +(define_predicate "lr_operand" + (match_code "reg") +{ + if (GET_CODE (op) != REG) + return FALSE; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (REGNO (op) != LR_REGNO && REGNO (op) < FIRST_PSEUDO_REGISTER) + return FALSE; + + return TRUE; +}) + +;; Return true if operand is a gpr register or a valid memory operand. + +(define_predicate "gpr_or_memory_operand" + (match_code "reg,subreg,mem") +{ + return (integer_register_operand (op, mode) + || frv_legitimate_memory_operand (op, mode, FALSE)); +}) + +;; Return true if operand is a gpr register, a valid memory operand, +;; or a memory operand that can be made valid using an additional gpr +;; register. + +(define_predicate "gpr_or_memory_operand_with_scratch" + (match_code "reg,subreg,mem") +{ + rtx addr; + + if (gpr_or_memory_operand (op, mode)) + return TRUE; + + if (GET_CODE (op) != MEM) + return FALSE; + + if (GET_MODE (op) != mode) + return FALSE; + + addr = XEXP (op, 0); + + if (GET_CODE (addr) != PLUS) + return FALSE; + + if (!integer_register_operand (XEXP (addr, 0), Pmode)) + return FALSE; + + if (GET_CODE (XEXP (addr, 1)) != CONST_INT) + return FALSE; + + return TRUE; +}) + +;; Return true if operand is a fpr register or a valid memory +;; operation. + +(define_predicate "fpr_or_memory_operand" + (match_code "reg,subreg,mem") +{ + return (fpr_operand (op, mode) + || frv_legitimate_memory_operand (op, mode, FALSE)); +}) + +;; Return 1 if operand is a 12 bit signed immediate. + +(define_predicate "int12_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return FALSE; + + return IN_RANGE_P (INTVAL (op), -2048, 2047); +}) + +;; Return 1 if operand is an integer constant that takes 2 +;; instructions to load up and can be split into sethi/setlo +;; instructions.. + +(define_predicate "int_2word_operand" + (match_code "const_int,const_double,symbol_ref,label_ref,const") +{ + HOST_WIDE_INT value; + REAL_VALUE_TYPE rv; + long l; + + switch (GET_CODE (op)) + { + default: + break; + + case LABEL_REF: + if (TARGET_FDPIC) + return FALSE; + + return (flag_pic == 0); + + case CONST: + if (flag_pic || TARGET_FDPIC) + return FALSE; + + op = XEXP (op, 0); + if (GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) + op = XEXP (op, 0); + return GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF; + + case SYMBOL_REF: + if (TARGET_FDPIC) + return FALSE; + + /* small data references are already 1 word */ + return (flag_pic == 0) && (! SYMBOL_REF_SMALL_P (op)); + + case CONST_INT: + return ! IN_RANGE_P (INTVAL (op), -32768, 32767); + + case CONST_DOUBLE: + if (GET_MODE (op) == SFmode) + { + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_SINGLE (rv, l); + value = l; + return ! IN_RANGE_P (value, -32768, 32767); + } + else if (GET_MODE (op) == VOIDmode) + { + value = CONST_DOUBLE_LOW (op); + return ! IN_RANGE_P (value, -32768, 32767); + } + break; + } + + return FALSE; +}) + +;; Return true if operand is the uClinux PIC register. + +(define_predicate "fdpic_operand" + (match_code "reg") +{ + if (!TARGET_FDPIC) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (REGNO (op) != FDPIC_REGNO && REGNO (op) < FIRST_PSEUDO_REGISTER) + return FALSE; + + return TRUE; +}) + +;; TODO: Add a comment here. + +(define_predicate "fdpic_fptr_operand" + (match_code "reg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + if (GET_CODE (op) != REG) + return FALSE; + if (REGNO (op) != FDPIC_FPTR_REGNO && REGNO (op) < FIRST_PSEUDO_REGISTER) + return FALSE; + return TRUE; +}) + +;; An address operand that may use a pair of registers, an addressing +;; mode that we reject in general. + +(define_predicate "ldd_address_operand" + (match_code "reg,subreg,plus") +{ + if (GET_MODE (op) != mode && GET_MODE (op) != VOIDmode) + return FALSE; + + return frv_legitimate_address_p (DImode, op, reload_completed, FALSE, TRUE); +}) + +;; TODO: Add a comment here. + +(define_predicate "got12_operand" + (match_code "const") +{ + struct frv_unspec unspec; + + if (frv_const_unspec_p (op, &unspec)) + switch (unspec.reloc) + { + case R_FRV_GOT12: + case R_FRV_GOTOFF12: + case R_FRV_FUNCDESC_GOT12: + case R_FRV_FUNCDESC_GOTOFF12: + case R_FRV_GPREL12: + case R_FRV_TLSMOFF12: + return true; + } + return false; +}) + +;; Return true if OP is a valid const-unspec expression. + +(define_predicate "const_unspec_operand" + (match_code "const") +{ + struct frv_unspec unspec; + + return frv_const_unspec_p (op, &unspec); +}) + +;; Return true if operand is an icc register. + +(define_predicate "icc_operand" + (match_code "reg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + return ICC_OR_PSEUDO_P (regno); +}) + +;; Return true if operand is an fcc register. + +(define_predicate "fcc_operand" + (match_code "reg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + return FCC_OR_PSEUDO_P (regno); +}) + +;; Return true if operand is either an fcc or icc register. + +(define_predicate "cc_operand" + (match_code "reg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (CC_OR_PSEUDO_P (regno)) + return TRUE; + + return FALSE; +}) + +;; Return true if operand is an integer CCR register. + +(define_predicate "icr_operand" + (match_code "reg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + return ICR_OR_PSEUDO_P (regno); +}) + +;; Return true if operand is an fcc register. + +(define_predicate "fcr_operand" + (match_code "reg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + return FCR_OR_PSEUDO_P (regno); +}) + +;; Return true if operand is either an fcc or icc register. + +(define_predicate "cr_operand" + (match_code "reg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (CR_OR_PSEUDO_P (regno)) + return TRUE; + + return FALSE; +}) + +;; Return true if operand is a FPR register. + +(define_predicate "fpr_operand" + (match_code "reg,subreg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + return FPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return true if operand is an even GPR or FPR register. + +(define_predicate "even_reg_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (regno >= FIRST_PSEUDO_REGISTER) + return TRUE; + + if (GPR_P (regno)) + return (((regno - GPR_FIRST) & 1) == 0); + + if (FPR_P (regno)) + return (((regno - FPR_FIRST) & 1) == 0); + + return FALSE; +}) + +;; Return true if operand is an odd GPR register. + +(define_predicate "odd_reg_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + /* Assume that reload will give us an even register. */ + if (regno >= FIRST_PSEUDO_REGISTER) + return FALSE; + + if (GPR_P (regno)) + return (((regno - GPR_FIRST) & 1) != 0); + + if (FPR_P (regno)) + return (((regno - FPR_FIRST) & 1) != 0); + + return FALSE; +}) + +;; Return true if operand is an even GPR register. + +(define_predicate "even_gpr_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (regno >= FIRST_PSEUDO_REGISTER) + return TRUE; + + if (! GPR_P (regno)) + return FALSE; + + return (((regno - GPR_FIRST) & 1) == 0); +}) + +;; Return true if operand is an odd GPR register. + +(define_predicate "odd_gpr_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + /* Assume that reload will give us an even register. */ + if (regno >= FIRST_PSEUDO_REGISTER) + return FALSE; + + if (! GPR_P (regno)) + return FALSE; + + return (((regno - GPR_FIRST) & 1) != 0); +}) + +;; Return true if operand is a quad aligned FPR register. + +(define_predicate "quad_fpr_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (regno >= FIRST_PSEUDO_REGISTER) + return TRUE; + + if (! FPR_P (regno)) + return FALSE; + + return (((regno - FPR_FIRST) & 3) == 0); +}) + +;; Return true if operand is an even FPR register. + +(define_predicate "even_fpr_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + if (regno >= FIRST_PSEUDO_REGISTER) + return TRUE; + + if (! FPR_P (regno)) + return FALSE; + + return (((regno - FPR_FIRST) & 1) == 0); +}) + +;; Return true if operand is an odd FPR register. + +(define_predicate "odd_fpr_operand" + (match_code "reg,subreg") +{ + int regno; + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + regno = REGNO (op); + /* Assume that reload will give us an even register. */ + if (regno >= FIRST_PSEUDO_REGISTER) + return FALSE; + + if (! FPR_P (regno)) + return FALSE; + + return (((regno - FPR_FIRST) & 1) != 0); +}) + +;; Return true if operand is a 2 word memory address that can be +;; loaded in one instruction to load or store. We assume the stack +;; and frame pointers are suitably aligned, and variables in the small +;; data area. FIXME -- at some we should recognize other globals and +;; statics. We can't assume that any old pointer is aligned, given +;; that arguments could be passed on an odd word on the stack and the +;; address taken and passed through to another function. + +(define_predicate "dbl_memory_one_insn_operand" + (match_code "mem") +{ + rtx addr; + rtx addr_reg; + + if (! TARGET_DWORD) + return FALSE; + + if (GET_CODE (op) != MEM) + return FALSE; + + if (mode != VOIDmode && GET_MODE_SIZE (mode) != 2*UNITS_PER_WORD) + return FALSE; + + addr = XEXP (op, 0); + if (GET_CODE (addr) == REG) + addr_reg = addr; + + else if (GET_CODE (addr) == PLUS) + { + rtx addr0 = XEXP (addr, 0); + rtx addr1 = XEXP (addr, 1); + + if (GET_CODE (addr0) != REG) + return FALSE; + + if (got12_operand (addr1, VOIDmode)) + return TRUE; + + if (GET_CODE (addr1) != CONST_INT) + return FALSE; + + if ((INTVAL (addr1) & 7) != 0) + return FALSE; + + addr_reg = addr0; + } + + else + return FALSE; + + if (addr_reg == frame_pointer_rtx || addr_reg == stack_pointer_rtx) + return TRUE; + + return FALSE; +}) + +;; Return true if operand is a 2 word memory address that needs to use +;; two instructions to load or store. + +(define_predicate "dbl_memory_two_insn_operand" + (match_code "mem") +{ + if (GET_CODE (op) != MEM) + return FALSE; + + if (mode != VOIDmode && GET_MODE_SIZE (mode) != 2*UNITS_PER_WORD) + return FALSE; + + if (! TARGET_DWORD) + return TRUE; + + return ! dbl_memory_one_insn_operand (op, mode); +}) + +;; Return true if operand is a memory reference suitable for a call. + +(define_predicate "call_operand" + (match_code "reg,subreg,const_int,const,symbol_ref") +{ + if (GET_MODE (op) != mode && mode != VOIDmode && GET_CODE (op) != CONST_INT) + return FALSE; + + if (GET_CODE (op) == SYMBOL_REF) + return !TARGET_LONG_CALLS || SYMBOL_REF_LOCAL_P (op); + + /* Note this doesn't allow reg+reg or reg+imm12 addressing (which should + never occur anyway), but prevents reload from not handling the case + properly of a call through a pointer on a function that calls + vfork/setjmp, etc. due to the need to flush all of the registers to stack. */ + return gpr_or_int12_operand (op, mode); +}) + +;; Return true if operand is a memory reference suitable for a +;; sibcall. + +(define_predicate "sibcall_operand" + (match_code "reg,subreg,const_int,const") +{ + if (GET_MODE (op) != mode && mode != VOIDmode && GET_CODE (op) != CONST_INT) + return FALSE; + + /* Note this doesn't allow reg+reg or reg+imm12 addressing (which should + never occur anyway), but prevents reload from not handling the case + properly of a call through a pointer on a function that calls + vfork/setjmp, etc. due to the need to flush all of the registers to stack. */ + return gpr_or_int12_operand (op, mode); +}) + +;; Return 1 if operand is an integer constant with the bottom 16 bits +;; clear. + +(define_predicate "upper_int16_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return FALSE; + + return ((INTVAL (op) & 0xffff) == 0); +}) + +;; Return 1 if operand is a 16 bit unsigned immediate. + +(define_predicate "uint16_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return FALSE; + + return IN_RANGE_P (INTVAL (op), 0, 0xffff); +}) + +;; Returns 1 if OP is either a SYMBOL_REF or a constant. + +(define_predicate "symbolic_operand" + (match_code "symbol_ref,const_int") +{ + enum rtx_code c = GET_CODE (op); + + if (c == CONST) + { + /* Allow (const:SI (plus:SI (symbol_ref) (const_int))). */ + return GET_MODE (op) == SImode + && GET_CODE (XEXP (op, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT; + } + + return c == SYMBOL_REF || c == CONST_INT; +}) + +;; Return true if operator is a kind of relational operator. + +(define_predicate "relational_operator" + (match_code "eq,ne,le,lt,ge,gt,leu,ltu,geu,gtu") +{ + return (integer_relational_operator (op, mode) + || float_relational_operator (op, mode)); +}) + +;; Return true if OP is a relational operator suitable for CCmode, +;; CC_UNSmode or CC_NZmode. + +(define_predicate "integer_relational_operator" + (match_code "eq,ne,le,lt,ge,gt,leu,ltu,geu,gtu") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return FALSE; + + /* The allowable relations depend on the mode of the ICC register. */ + switch (GET_CODE (op)) + { + default: + return FALSE; + + case EQ: + case NE: + case LT: + case GE: + return (GET_MODE (XEXP (op, 0)) == CC_NZmode + || GET_MODE (XEXP (op, 0)) == CCmode); + + case LE: + case GT: + return GET_MODE (XEXP (op, 0)) == CCmode; + + case GTU: + case GEU: + case LTU: + case LEU: + return (GET_MODE (XEXP (op, 0)) == CC_NZmode + || GET_MODE (XEXP (op, 0)) == CC_UNSmode); + } +}) + +;; Return true if operator is a floating point relational operator. + +(define_predicate "float_relational_operator" + (match_code "eq,ne,le,lt,ge,gt") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case EQ: case NE: + case LE: case LT: + case GE: case GT: +#if 0 + case UEQ: case UNE: + case ULE: case ULT: + case UGE: case UGT: + case ORDERED: + case UNORDERED: +#endif + return GET_MODE (XEXP (op, 0)) == CC_FPmode; + } +}) + +;; Return true if operator is EQ/NE of a conditional execution +;; register. + +(define_predicate "ccr_eqne_operator" + (match_code "eq,ne") +{ + enum machine_mode op_mode = GET_MODE (op); + rtx op0; + rtx op1; + int regno; + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case EQ: + case NE: + break; + } + + op1 = XEXP (op, 1); + if (op1 != const0_rtx) + return FALSE; + + op0 = XEXP (op, 0); + if (GET_CODE (op0) != REG) + return FALSE; + + regno = REGNO (op0); + if (op_mode == CC_CCRmode && CR_OR_PSEUDO_P (regno)) + return TRUE; + + return FALSE; +}) + +;; Return true if operator is a minimum or maximum operator (both +;; signed and unsigned). + +(define_predicate "minmax_operator" + (match_code "smin,smax,umin,umax") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case SMIN: + case SMAX: + case UMIN: + case UMAX: + break; + } + + if (! integer_register_operand (XEXP (op, 0), mode)) + return FALSE; + + if (! gpr_or_int10_operand (XEXP (op, 1), mode)) + return FALSE; + + return TRUE; +}) + +;; Return true if operator is an integer binary operator that can +;; executed conditionally and takes 1 cycle. + +(define_predicate "condexec_si_binary_operator" + (match_code "plus,minus,and,ior,xor,ashift,ashiftrt,lshiftrt") +{ + enum machine_mode op_mode = GET_MODE (op); + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case PLUS: + case MINUS: + case AND: + case IOR: + case XOR: + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + return TRUE; + } +}) + +;; Return true if operator is an integer binary operator that can be +;; executed conditionally by a media instruction. + +(define_predicate "condexec_si_media_operator" + (match_code "and,ior,xor") +{ + enum machine_mode op_mode = GET_MODE (op); + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case AND: + case IOR: + case XOR: + return TRUE; + } +}) + +;; Return true if operator is an integer division operator that can +;; executed conditionally. + +(define_predicate "condexec_si_divide_operator" + (match_code "div,udiv") +{ + enum machine_mode op_mode = GET_MODE (op); + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case DIV: + case UDIV: + return TRUE; + } +}) + +;; Return true if operator is an integer unary operator that can +;; executed conditionally. + +(define_predicate "condexec_si_unary_operator" + (match_code "not,neg") +{ + enum machine_mode op_mode = GET_MODE (op); + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case NEG: + case NOT: + return TRUE; + } +}) + +;; Return true if operator is an addition or subtraction +;; expression. Such expressions can be evaluated conditionally by +;; floating-point instructions. + +(define_predicate "condexec_sf_add_operator" + (match_code "plus,minus") +{ + enum machine_mode op_mode = GET_MODE (op); + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case PLUS: + case MINUS: + return TRUE; + } +}) + +;; Return true if operator is a conversion-type expression that can be +;; evaluated conditionally by floating-point instructions. + +(define_predicate "condexec_sf_conv_operator" + (match_code "abs,neg") +{ + enum machine_mode op_mode = GET_MODE (op); + + if (mode != VOIDmode && op_mode != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case NEG: + case ABS: + return TRUE; + } +}) + +;; Return true if OP is an integer binary operator that can be +;; combined with a (set ... (compare:CC_NZ ...)) pattern. + +(define_predicate "intop_compare_operator" + (match_code "plus,minus,and,ior,xor,ashift,ashiftrt,lshiftrt") +{ + if (mode != VOIDmode && GET_MODE (op) != mode) + return FALSE; + + switch (GET_CODE (op)) + { + default: + return FALSE; + + case PLUS: + case MINUS: + case AND: + case IOR: + case XOR: + case ASHIFTRT: + case LSHIFTRT: + return GET_MODE (op) == SImode; + } +}) + +;; Return 1 if operand is a register or 6 bit signed immediate. + +(define_predicate "fpr_or_int6_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == CONST_INT) + return IN_RANGE_P (INTVAL (op), -32, 31); + + if (GET_MODE (op) != mode && mode != VOIDmode) + return FALSE; + + if (GET_CODE (op) == SUBREG) + { + if (GET_CODE (SUBREG_REG (op)) != REG) + return register_operand (op, mode); + + op = SUBREG_REG (op); + } + + if (GET_CODE (op) != REG) + return FALSE; + + return FPR_OR_PSEUDO_P (REGNO (op)); +}) + +;; Return 1 if operand is a 6 bit signed immediate. + +(define_predicate "int6_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return FALSE; + + return IN_RANGE_P (INTVAL (op), -32, 31); +}) + +;; Return 1 if operand is a 5 bit signed immediate. + +(define_predicate "int5_operand" + (match_code "const_int") +{ + return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), -16, 15); +}) + +;; Return 1 if operand is a 5 bit unsigned immediate. + +(define_predicate "uint5_operand" + (match_code "const_int") +{ + return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 31); +}) + +;; Return 1 if operand is a 4 bit unsigned immediate. + +(define_predicate "uint4_operand" + (match_code "const_int") +{ + return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 15); +}) + +;; Return 1 if operand is a 1 bit unsigned immediate (0 or 1). + +(define_predicate "uint1_operand" + (match_code "const_int") +{ + return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 1); +}) + +;; Return 1 if operand is a valid ACC register number. + +(define_predicate "acc_operand" + (match_code "reg,subreg") +{ + return ((mode == VOIDmode || mode == GET_MODE (op)) + && REG_P (op) && ACC_P (REGNO (op)) + && ((REGNO (op) - ACC_FIRST) & ~ACC_MASK) == 0); +}) + +;; Return 1 if operand is a valid even ACC register number. + +(define_predicate "even_acc_operand" + (match_code "reg,subreg") +{ + return acc_operand (op, mode) && ((REGNO (op) - ACC_FIRST) & 1) == 0; +}) + +;; Return 1 if operand is zero or four. + +(define_predicate "quad_acc_operand" + (match_code "reg,subreg") +{ + return acc_operand (op, mode) && ((REGNO (op) - ACC_FIRST) & 3) == 0; +}) + +;; Return 1 if operand is a valid ACCG register number. + +(define_predicate "accg_operand" + (match_code "reg,subreg") +{ + return ((mode == VOIDmode || mode == GET_MODE (op)) + && REG_P (op) && ACCG_P (REGNO (op)) + && ((REGNO (op) - ACCG_FIRST) & ~ACC_MASK) == 0); +}) diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index 54fe462b93b..7c63c008aac 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Renesas H8/300 version - Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index d4120ff060a..77a776856ff 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for Renesas H8/300. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). @@ -481,8 +481,7 @@ byte_reg (rtx x, int b) "r4l", "r4h", "r5l", "r5h", "r6l", "r6h", "r7l", "r7h" }; - if (!REG_P (x)) - abort (); + gcc_assert (REG_P (x)); return names_small[REGNO (x) * 2 + b]; } @@ -1001,7 +1000,7 @@ split_adds_subs (enum machine_mode mode, rtx *operands) break; default: - abort (); + gcc_unreachable (); } /* Try different amounts in descending order. */ @@ -1366,7 +1365,7 @@ cond_string (enum rtx_code code) case LTU: return "lo"; default: - abort (); + gcc_unreachable (); } } @@ -1391,7 +1390,7 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "#%ld", (-INTVAL (x)) & 0xff); break; default: - abort (); + gcc_unreachable (); } break; case 'F': @@ -1404,12 +1403,11 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "#%ld", ((-INTVAL (x)) & 0xff00) >> 8); break; default: - abort (); + gcc_unreachable (); } break; case 'G': - if (GET_CODE (x) != CONST_INT) - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); fprintf (file, "#%ld", 0xff & (-INTVAL (x))); break; case 'S': @@ -1426,14 +1424,12 @@ print_operand (FILE *file, rtx x, int code) break; case 'V': bitint = exact_log2 (INTVAL (x) & 0xff); - if (bitint == -1) - abort (); + gcc_assert (bitint >= 0); fprintf (file, "#%d", bitint); break; case 'W': bitint = exact_log2 ((~INTVAL (x)) & 0xff); - if (bitint == -1) - abort (); + gcc_assert (bitint >= 0); fprintf (file, "#%d", bitint); break; case 'R': @@ -1444,8 +1440,7 @@ print_operand (FILE *file, rtx x, int code) goto def; break; case 'Y': - if (bitint == -1) - abort (); + gcc_assert (bitint >= 0); if (GET_CODE (x) == REG) fprintf (file, "%s%c", names_big[REGNO (x)], bitint > 7 ? 'h' : 'l'); else @@ -1497,7 +1492,7 @@ print_operand (FILE *file, rtx x, int code) break; } default: - abort (); + gcc_unreachable (); break; } break; @@ -1527,7 +1522,7 @@ print_operand (FILE *file, rtx x, int code) break; } default: - abort (); + gcc_unreachable (); } break; case 'j': @@ -1537,16 +1532,24 @@ print_operand (FILE *file, rtx x, int code) fputs (cond_string (reverse_condition (GET_CODE (x))), file); break; case 'm': - if (GET_CODE (x) != CONST_INT) - abort (); - if (INTVAL (x) == 1) - fputs (".b", file); - else if (INTVAL (x) == 2) - fputs (".w", file); - else if (INTVAL (x) == 4) - fputs (".l", file); - else - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); + switch (INTVAL (x)) + { + case 1: + fputs (".b", file); + break; + + case 2: + fputs (".w", file); + break; + + case 4: + fputs (".l", file); + break; + + default: + gcc_unreachable (); + } break; case 'o': print_operand_address (file, x); @@ -1612,7 +1615,7 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "%s", names_extended[REGNO (x)]); break; default: - abort (); + gcc_unreachable (); } break; @@ -1846,8 +1849,9 @@ h8300_initial_elimination_offset (int from, int to) pointer int account. */ saved_regs_size -= fp_size; - if (to == HARD_FRAME_POINTER_REGNUM) + switch (to) { + case HARD_FRAME_POINTER_REGNUM: switch (from) { case ARG_POINTER_REGNUM: @@ -1857,11 +1861,10 @@ h8300_initial_elimination_offset (int from, int to) case FRAME_POINTER_REGNUM: return -saved_regs_size; default: - abort (); + gcc_unreachable (); } - } - else if (to == STACK_POINTER_REGNUM) - { + break; + case STACK_POINTER_REGNUM: switch (from) { case ARG_POINTER_REGNUM: @@ -1871,11 +1874,13 @@ h8300_initial_elimination_offset (int from, int to) case FRAME_POINTER_REGNUM: return frame_size; default: - abort (); + gcc_unreachable (); } + break; + default: + gcc_unreachable (); } - else - abort (); + gcc_unreachable (); } /* Worker function for RETURN_ADDR_RTX. */ @@ -2196,12 +2201,9 @@ h8300_classify_operand (rtx op, int size, enum h8300_operand_class *class) return 0; } } - else if (register_operand (op, VOIDmode)) - { - *class = H8OP_REGISTER; - return 0; - } - abort (); + gcc_assert (register_operand (op, VOIDmode)); + *class = H8OP_REGISTER; + return 0; } /* Return the length of the instruction described by TABLE given that @@ -2246,7 +2248,7 @@ h8300_unary_length (rtx op) return operand_length + 6; default: - abort (); + gcc_unreachable (); } } @@ -2272,7 +2274,7 @@ h8300_short_immediate_length (rtx op) return 4 + operand_length; default: - abort (); + gcc_unreachable (); } } @@ -2286,8 +2288,7 @@ h8300_bitfield_length (rtx op, rtx op2) if (GET_CODE (op) == REG) op = op2; - if (GET_CODE (op) == REG) - abort (); + gcc_assert (GET_CODE (op) != REG); size = GET_MODE_SIZE (GET_MODE (op)); operand_length = h8300_classify_operand (op, size, &class); @@ -2300,7 +2301,7 @@ h8300_bitfield_length (rtx op, rtx op2) return 4 + operand_length; default: - abort (); + gcc_unreachable (); } } @@ -2312,18 +2313,18 @@ h8300_binary_length (rtx insn, const h8300_length_table *table) rtx set; set = single_set (insn); - if (set == 0) - abort (); + gcc_assert (set); if (BINARY_P (SET_SRC (set))) return h8300_length_from_table (XEXP (SET_SRC (set), 0), XEXP (SET_SRC (set), 1), table); - else if (GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == RTX_TERNARY) - return h8300_length_from_table (XEXP (XEXP (SET_SRC (set), 1), 0), - XEXP (XEXP (SET_SRC (set), 1), 1), - table); else - abort (); + { + gcc_assert (GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == RTX_TERNARY); + return h8300_length_from_table (XEXP (XEXP (SET_SRC (set), 1), 0), + XEXP (XEXP (SET_SRC (set), 1), 1), + table); + } } /* Subroutine of h8300_move_length. Return true if OP is 1- or 2-byte @@ -2401,7 +2402,7 @@ h8300_insn_length_from_table (rtx insn, rtx * operands) switch (get_attr_length_table (insn)) { case LENGTH_TABLE_NONE: - abort (); + gcc_unreachable (); case LENGTH_TABLE_ADDB: return h8300_binary_length (insn, &addb_length_table); @@ -2444,9 +2445,10 @@ h8300_insn_length_from_table (rtx insn, rtx * operands) case LENGTH_TABLE_BITBRANCH: return h8300_bitfield_length (operands[1], operands[2]) - 2; - + + default: + gcc_unreachable (); } - abort (); } /* Return true if LHS and RHS are memory references that can be mapped @@ -2711,7 +2713,7 @@ compute_mov_length (rtx *operands) break; default: - abort (); + gcc_unreachable (); } /* Adjust the length based on the addressing mode used. @@ -2831,7 +2833,7 @@ compute_mov_length (rtx *operands) break; default: - abort (); + gcc_unreachable (); } /* Adjust the length based on the addressing mode used. @@ -2875,8 +2877,7 @@ output_plussi (rtx *operands) { enum machine_mode mode = GET_MODE (operands[0]); - if (mode != SImode) - abort (); + gcc_assert (mode == SImode); if (TARGET_H8300) { @@ -2960,8 +2961,7 @@ compute_plussi_length (rtx *operands) { enum machine_mode mode = GET_MODE (operands[0]); - if (mode != SImode) - abort (); + gcc_assert (mode == SImode); if (TARGET_H8300) { @@ -3040,8 +3040,7 @@ compute_plussi_cc (rtx *operands) { enum machine_mode mode = GET_MODE (operands[0]); - if (mode != SImode) - abort (); + gcc_assert (mode == SImode); if (TARGET_H8300) { @@ -3135,7 +3134,7 @@ output_logical_op (enum machine_mode mode, rtx *operands) opname = "xor"; break; default: - abort (); + gcc_unreachable (); } switch (mode) @@ -3267,7 +3266,7 @@ output_logical_op (enum machine_mode mode, rtx *operands) } break; default: - abort (); + gcc_unreachable (); } return ""; } @@ -3413,7 +3412,7 @@ compute_logical_op_length (enum machine_mode mode, rtx *operands) } break; default: - abort (); + gcc_unreachable (); } return length; } @@ -3495,7 +3494,7 @@ compute_logical_op_cc (enum machine_mode mode, rtx *operands) } break; default: - abort (); + gcc_unreachable (); } return cc; } @@ -3633,7 +3632,7 @@ output_h8sx_shift (rtx *operands, int suffix, int optype) break; default: - abort (); + gcc_unreachable (); } if (operands[2] == const1_rtx) sprintf (buffer, "%s.%c\t%%%c0", stem, suffix, optype); @@ -3914,7 +3913,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, break; default: - abort (); + gcc_unreachable (); } /* Fill in INFO. Return unless we have SHIFT_SPECIAL. */ @@ -3953,12 +3952,9 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, case QIshift: /* For ASHIFTRT by 7 bits, the sign bit is simply replicated through the entire value. */ - if (shift_type == SHIFT_ASHIFTRT && count == 7) - { - info->special = "shll\t%X0\n\tsubx\t%X0,%X0"; - goto end; - } - abort (); + gcc_assert (shift_type == SHIFT_ASHIFTRT && count == 7); + info->special = "shll\t%X0\n\tsubx\t%X0,%X0"; + goto end; case HIshift: if (count == 7) @@ -4040,7 +4036,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, info->cc_special = CC_SET_ZNV; } else /* TARGET_H8300S */ - abort (); + gcc_unreachable (); goto end; } } @@ -4059,7 +4055,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, goto end; } } - abort (); + gcc_unreachable (); case SIshift: if (TARGET_H8300 && 8 <= count && count <= 9) @@ -4100,7 +4096,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, switch (shift_type) { case SHIFT_ASHIFT: - abort (); + gcc_unreachable (); case SHIFT_LSHIFTRT: info->special = "bld\t#7,%z0\n\tmov.w\t%e0,%f0\n\txor\t%y0,%y0\n\txor\t%z0,%z0\n\trotxl\t%w0\n\trotxl\t%x0\n\trotxl\t%y0"; goto end; @@ -4122,7 +4118,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, info->cc_special = CC_SET_ZNV; goto end; case SHIFT_ASHIFTRT: - abort (); + gcc_unreachable (); } } else if ((TARGET_H8300 && 16 <= count && count <= 20) @@ -4227,7 +4223,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\trotl.l\t#2,%S0\n\textu.l\t%S0"; goto end; case SHIFT_ASHIFTRT: - abort (); + gcc_unreachable (); } } else if (!TARGET_H8300 && count == 29) @@ -4253,7 +4249,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, } goto end; case SHIFT_ASHIFTRT: - abort (); + gcc_unreachable (); } } else if (!TARGET_H8300 && count == 30) @@ -4273,7 +4269,7 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, info->special = "sub.w\t%f0,%f0\n\trotl.l\t#2,%S0\n\textu.l\t%S0"; goto end; case SHIFT_ASHIFTRT: - abort (); + gcc_unreachable (); } } else if (count == 31) @@ -4312,10 +4308,10 @@ get_shift_alg (enum shift_type shift_type, enum shift_mode shift_mode, } } } - abort (); + gcc_unreachable (); default: - abort (); + gcc_unreachable (); } end: @@ -4365,7 +4361,7 @@ h8300_shift_needs_scratch_p (int count, enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } /* On H8/300H, count == 8 uses a scratch register. */ @@ -4385,6 +4381,7 @@ output_a_shift (rtx *operands) enum shift_type shift_type; enum shift_mode shift_mode; struct shift_info info; + int n; loopend_lab++; @@ -4400,7 +4397,7 @@ output_a_shift (rtx *operands) shift_mode = SIshift; break; default: - abort (); + gcc_unreachable (); } switch (code) @@ -4415,115 +4412,117 @@ output_a_shift (rtx *operands) shift_type = SHIFT_ASHIFT; break; default: - abort (); + gcc_unreachable (); } - if (GET_CODE (operands[2]) != CONST_INT) - { - /* This case must be taken care of by one of the two splitters - that convert a variable shift into a loop. */ - abort (); - } - else + /* This case must be taken care of by one of the two splitters + that convert a variable shift into a loop. */ + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + + n = INTVAL (operands[2]); + + /* If the count is negative, make it 0. */ + if (n < 0) + n = 0; + /* If the count is too big, truncate it. + ANSI says shifts of GET_MODE_BITSIZE are undefined - we choose to + do the intuitive thing. */ + else if ((unsigned int) n > GET_MODE_BITSIZE (mode)) + n = GET_MODE_BITSIZE (mode); + + get_shift_alg (shift_type, shift_mode, n, &info); + + switch (info.alg) { - int n = INTVAL (operands[2]); - - /* If the count is negative, make it 0. */ - if (n < 0) - n = 0; - /* If the count is too big, truncate it. - ANSI says shifts of GET_MODE_BITSIZE are undefined - we choose to - do the intuitive thing. */ - else if ((unsigned int) n > GET_MODE_BITSIZE (mode)) - n = GET_MODE_BITSIZE (mode); + case SHIFT_SPECIAL: + output_asm_insn (info.special, operands); + /* Fall through. */ - get_shift_alg (shift_type, shift_mode, n, &info); + case SHIFT_INLINE: + n = info.remainder; - switch (info.alg) + /* Emit two bit shifts first. */ + if (info.shift2 != NULL) { - case SHIFT_SPECIAL: - output_asm_insn (info.special, operands); - /* Fall through. */ - - case SHIFT_INLINE: - n = info.remainder; - - /* Emit two bit shifts first. */ - if (info.shift2 != NULL) - { - for (; n > 1; n -= 2) - output_asm_insn (info.shift2, operands); - } - - /* Now emit one bit shifts for any residual. */ - for (; n > 0; n--) - output_asm_insn (info.shift1, operands); - return ""; + for (; n > 1; n -= 2) + output_asm_insn (info.shift2, operands); + } - case SHIFT_ROT_AND: + /* Now emit one bit shifts for any residual. */ + for (; n > 0; n--) + output_asm_insn (info.shift1, operands); + return ""; + + case SHIFT_ROT_AND: + { + int m = GET_MODE_BITSIZE (mode) - n; + const int mask = (shift_type == SHIFT_ASHIFT + ? ((1 << m) - 1) << n + : (1 << m) - 1); + char insn_buf[200]; + + /* Not all possibilities of rotate are supported. They shouldn't + be generated, but let's watch for 'em. */ + gcc_assert (info.shift1); + + /* Emit two bit rotates first. */ + if (info.shift2 != NULL) { - int m = GET_MODE_BITSIZE (mode) - n; - const int mask = (shift_type == SHIFT_ASHIFT - ? ((1 << m) - 1) << n - : (1 << m) - 1); - char insn_buf[200]; - - /* Not all possibilities of rotate are supported. They shouldn't - be generated, but let's watch for 'em. */ - if (info.shift1 == 0) - abort (); - - /* Emit two bit rotates first. */ - if (info.shift2 != NULL) - { - for (; m > 1; m -= 2) - output_asm_insn (info.shift2, operands); - } + for (; m > 1; m -= 2) + output_asm_insn (info.shift2, operands); + } + + /* Now single bit rotates for any residual. */ + for (; m > 0; m--) + output_asm_insn (info.shift1, operands); + + /* Now mask off the high bits. */ + switch (mode) + { + case QImode: + sprintf (insn_buf, "and\t#%d,%%X0", mask); + break; - /* Now single bit rotates for any residual. */ - for (; m > 0; m--) - output_asm_insn (info.shift1, operands); + case HImode: + gcc_assert (TARGET_H8300H || TARGET_H8300S); + sprintf (insn_buf, "and.w\t#%d,%%T0", mask); + break; - /* Now mask off the high bits. */ - if (mode == QImode) - sprintf (insn_buf, "and\t#%d,%%X0", mask); - else if (mode == HImode && (TARGET_H8300H || TARGET_H8300S)) - sprintf (insn_buf, "and.w\t#%d,%%T0", mask); - else - abort (); - - output_asm_insn (insn_buf, operands); - return ""; + default: + gcc_unreachable (); } - case SHIFT_LOOP: - /* A loop to shift by a "large" constant value. - If we have shift-by-2 insns, use them. */ - if (info.shift2 != NULL) - { - fprintf (asm_out_file, "\tmov.b #%d,%sl\n", n / 2, - names_big[REGNO (operands[4])]); - fprintf (asm_out_file, ".Llt%d:\n", loopend_lab); - output_asm_insn (info.shift2, operands); - output_asm_insn ("add #0xff,%X4", operands); - fprintf (asm_out_file, "\tbne .Llt%d\n", loopend_lab); - if (n % 2) - output_asm_insn (info.shift1, operands); - } - else - { - fprintf (asm_out_file, "\tmov.b #%d,%sl\n", n, - names_big[REGNO (operands[4])]); - fprintf (asm_out_file, ".Llt%d:\n", loopend_lab); - output_asm_insn (info.shift1, operands); - output_asm_insn ("add #0xff,%X4", operands); - fprintf (asm_out_file, "\tbne .Llt%d\n", loopend_lab); - } - return ""; + output_asm_insn (insn_buf, operands); + return ""; + } - default: - abort (); + case SHIFT_LOOP: + /* A loop to shift by a "large" constant value. + If we have shift-by-2 insns, use them. */ + if (info.shift2 != NULL) + { + fprintf (asm_out_file, "\tmov.b #%d,%sl\n", n / 2, + names_big[REGNO (operands[4])]); + fprintf (asm_out_file, ".Llt%d:\n", loopend_lab); + output_asm_insn (info.shift2, operands); + output_asm_insn ("add #0xff,%X4", operands); + fprintf (asm_out_file, "\tbne .Llt%d\n", loopend_lab); + if (n % 2) + output_asm_insn (info.shift1, operands); + } + else + { + fprintf (asm_out_file, "\tmov.b #%d,%sl\n", n, + names_big[REGNO (operands[4])]); + fprintf (asm_out_file, ".Llt%d:\n", loopend_lab); + output_asm_insn (info.shift1, operands); + output_asm_insn ("add #0xff,%X4", operands); + fprintf (asm_out_file, "\tbne .Llt%d\n", loopend_lab); } + return ""; + + default: + gcc_unreachable (); } } @@ -4566,7 +4565,7 @@ compute_a_shift_length (rtx insn ATTRIBUTE_UNUSED, rtx *operands) shift_mode = SIshift; break; default: - abort (); + gcc_unreachable (); } switch (code) @@ -4581,7 +4580,7 @@ compute_a_shift_length (rtx insn ATTRIBUTE_UNUSED, rtx *operands) shift_type = SHIFT_ASHIFT; break; default: - abort (); + gcc_unreachable (); } if (GET_CODE (operands[2]) != CONST_INT) @@ -4639,8 +4638,7 @@ compute_a_shift_length (rtx insn ATTRIBUTE_UNUSED, rtx *operands) /* Not all possibilities of rotate are supported. They shouldn't be generated, but let's watch for 'em. */ - if (info.shift1 == 0) - abort (); + gcc_assert (info.shift1); if (info.shift2 != NULL) { @@ -4660,12 +4658,11 @@ compute_a_shift_length (rtx insn ATTRIBUTE_UNUSED, rtx *operands) wlength += 2; break; case SImode: - if (TARGET_H8300) - abort (); + gcc_assert (!TARGET_H8300); wlength += 3; break; default: - abort (); + gcc_unreachable (); } return 2 * wlength; } @@ -4686,7 +4683,7 @@ compute_a_shift_length (rtx insn ATTRIBUTE_UNUSED, rtx *operands) return 2 * wlength; default: - abort (); + gcc_unreachable (); } } } @@ -4702,7 +4699,8 @@ compute_a_shift_cc (rtx insn ATTRIBUTE_UNUSED, rtx *operands) enum shift_type shift_type; enum shift_mode shift_mode; struct shift_info info; - + int n; + switch (mode) { case QImode: @@ -4715,7 +4713,7 @@ compute_a_shift_cc (rtx insn ATTRIBUTE_UNUSED, rtx *operands) shift_mode = SIshift; break; default: - abort (); + gcc_unreachable (); } switch (code) @@ -4730,58 +4728,53 @@ compute_a_shift_cc (rtx insn ATTRIBUTE_UNUSED, rtx *operands) shift_type = SHIFT_ASHIFT; break; default: - abort (); + gcc_unreachable (); } - if (GET_CODE (operands[2]) != CONST_INT) - { - /* This case must be taken care of by one of the two splitters - that convert a variable shift into a loop. */ - abort (); - } - else + /* This case must be taken care of by one of the two splitters + that convert a variable shift into a loop. */ + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + + n = INTVAL (operands[2]); + + /* If the count is negative, make it 0. */ + if (n < 0) + n = 0; + /* If the count is too big, truncate it. + ANSI says shifts of GET_MODE_BITSIZE are undefined - we choose to + do the intuitive thing. */ + else if ((unsigned int) n > GET_MODE_BITSIZE (mode)) + n = GET_MODE_BITSIZE (mode); + + get_shift_alg (shift_type, shift_mode, n, &info); + + switch (info.alg) { - int n = INTVAL (operands[2]); - - /* If the count is negative, make it 0. */ - if (n < 0) - n = 0; - /* If the count is too big, truncate it. - ANSI says shifts of GET_MODE_BITSIZE are undefined - we choose to - do the intuitive thing. */ - else if ((unsigned int) n > GET_MODE_BITSIZE (mode)) - n = GET_MODE_BITSIZE (mode); + case SHIFT_SPECIAL: + if (info.remainder == 0) + return info.cc_special; - get_shift_alg (shift_type, shift_mode, n, &info); + /* Fall through. */ - switch (info.alg) + case SHIFT_INLINE: + return info.cc_inline; + + case SHIFT_ROT_AND: + /* This case always ends with an and instruction. */ + return CC_SET_ZNV; + + case SHIFT_LOOP: + /* A loop to shift by a "large" constant value. + If we have shift-by-2 insns, use them. */ + if (info.shift2 != NULL) { - case SHIFT_SPECIAL: - if (info.remainder == 0) - return info.cc_special; - - /* Fall through. */ - - case SHIFT_INLINE: - return info.cc_inline; - - case SHIFT_ROT_AND: - /* This case always ends with an and instruction. */ - return CC_SET_ZNV; - - case SHIFT_LOOP: - /* A loop to shift by a "large" constant value. - If we have shift-by-2 insns, use them. */ - if (info.shift2 != NULL) - { - if (n % 2) - return info.cc_inline; - } - return CC_CLOBBER; - - default: - abort (); + if (n % 2) + return info.cc_inline; } + return CC_CLOBBER; + + default: + gcc_unreachable (); } } @@ -4833,7 +4826,7 @@ expand_a_rotate (rtx operands[]) emit_insn (gen_rotlsi3_1 (dst, dst, const1_rtx)); break; default: - abort (); + gcc_unreachable (); } /* Decrement the counter by 1. */ @@ -4861,7 +4854,7 @@ expand_a_rotate (rtx operands[]) emit_insn (gen_rotlsi3_1 (dst, dst, rotate_amount)); break; default: - abort (); + gcc_unreachable (); } } @@ -4882,8 +4875,7 @@ output_a_rotate (enum rtx_code code, rtx *operands) int amount; enum machine_mode mode = GET_MODE (dst); - if (GET_CODE (rotate_amount) != CONST_INT) - abort (); + gcc_assert (GET_CODE (rotate_amount) == CONST_INT); switch (mode) { @@ -4897,7 +4889,7 @@ output_a_rotate (enum rtx_code code, rtx *operands) rotate_mode = SIshift; break; default: - abort (); + gcc_unreachable (); } switch (code) @@ -4909,7 +4901,7 @@ output_a_rotate (enum rtx_code code, rtx *operands) rotate_type = SHIFT_LSHIFTRT; break; default: - abort (); + gcc_unreachable (); } amount = INTVAL (rotate_amount); @@ -4953,7 +4945,7 @@ output_a_rotate (enum rtx_code code, rtx *operands) break; default: - abort (); + gcc_unreachable (); } /* Adjust AMOUNT and flip the direction. */ @@ -4988,8 +4980,7 @@ compute_a_rotate_length (rtx *operands) int amount; unsigned int length = 0; - if (GET_CODE (amount_rtx) != CONST_INT) - abort (); + gcc_assert (GET_CODE (amount_rtx) == CONST_INT); amount = INTVAL (amount_rtx); @@ -5083,7 +5074,7 @@ fix_bit_operand (rtx *operands, enum rtx_code code) emit_insn (gen_xorqi3_1 (res, operands[1], operands[2])); break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_movqi (operands[0], res)); } @@ -5264,7 +5255,7 @@ h8300_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -5288,7 +5279,7 @@ h8300_handle_eightbit_data_attribute (tree *node, tree name, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -5311,7 +5302,7 @@ h8300_handle_tiny_data_attribute (tree *node, tree name, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -5598,9 +5589,9 @@ h8300_regs_ok_for_stm (int n, rtx operands[]) && REGNO (operands[1]) == 1 && REGNO (operands[2]) == 2 && REGNO (operands[3]) == 3); + default: + gcc_unreachable (); } - - abort (); } /* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */ diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 5b131bd7641..5f1e838049a 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler. Renesas H8/300 (generic) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com), Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com). diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index cfd6c1b8d1c..0d3cd6e3a46 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -423,7 +423,7 @@ case 5: return \"mov.w %T1,%e0\;mov.w %T1,%f0\"; default: - abort (); + gcc_unreachable (); } }" [(set (attr "length") @@ -844,7 +844,7 @@ case 5: return \"mov.w %T1,%e0\;mov.w %T1,%f0\"; default: - abort (); + gcc_unreachable (); } }" [(set (attr "length") @@ -2347,8 +2347,8 @@ vec = XVEC (final_sequence, 0); final_sequence = 0; - final_scan_insn (RTVEC_ELT (vec, 1), asm_out_file, optimize, 0, 1, & seen); - final_scan_insn (RTVEC_ELT (vec, 0), asm_out_file, optimize, 0, 1, & seen); + final_scan_insn (RTVEC_ELT (vec, 1), asm_out_file, optimize, 1, & seen); + final_scan_insn (RTVEC_ELT (vec, 0), asm_out_file, optimize, 1, & seen); INSN_DELETED_P (RTVEC_ELT (vec, 1)) = 1; return \"\"; } @@ -2604,7 +2604,7 @@ return \"mov.l\\ter0,@-er7\;stc\\tccr,r0l\;mov.b\\tr0l,@(4,er7)\;mov.l\\t@er7+,er0\;orc\\t#128,ccr\"; else if (TARGET_H8300S) return \"stc\texr,@-er7\;mov.l\\ter0,@-er7\;stc\tccr,r0l\;mov.b\tr0l,@(6,er7)\;mov.l\\t@er7+,er0\;orc\t#128,ccr\"; - abort (); + gcc_unreachable (); }" [(set_attr "length" "20")]) diff --git a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c new file mode 100644 index 00000000000..f94120f10bb --- /dev/null +++ b/gcc/config/host-darwin.c @@ -0,0 +1,79 @@ +/* Darwin host-specific hook definitions. + Copyright (C) 2003, 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 "config.h" +#include "system.h" +#include "coretypes.h" +#include +#include "toplev.h" +#include "config/host-darwin.h" + +/* Yes, this is really supposed to work. */ +static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); + +/* Return the address of the PCH address space, if the PCH will fit in it. */ + +void * +darwin_gt_pch_get_address (size_t sz, int fd ATTRIBUTE_UNUSED) +{ + if (sz <= sizeof (pch_address_space)) + return pch_address_space; + else + return NULL; +} + +/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of + pch_address_space beyond SZ. */ + +int +darwin_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off) +{ + const size_t pagesize = getpagesize(); + void *mmap_result; + int ret; + + gcc_assert ((size_t)pch_address_space % pagesize == 0 + && sizeof (pch_address_space) % pagesize == 0); + + ret = (addr == pch_address_space && sz <= sizeof (pch_address_space)); + if (! ret) + sz = 0; + + /* Round the size to a whole page size. Normally this is a no-op. */ + sz = (sz + pagesize - 1) / pagesize * pagesize; + + if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0) + fatal_error ("couldn't unmap pch_address_space: %m\n"); + + if (ret) + { + mmap_result = mmap (addr, sz, + PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, + fd, off); + + /* The file might not be mmap-able. */ + ret = mmap_result != (void *) MAP_FAILED; + + /* Sanity check for broken MAP_FIXED. */ + gcc_assert (!ret || mmap_result == addr); + } + + return ret; +} diff --git a/gcc/config/host-darwin.h b/gcc/config/host-darwin.h new file mode 100644 index 00000000000..74257074512 --- /dev/null +++ b/gcc/config/host-darwin.h @@ -0,0 +1,28 @@ +/* Darwin host-specific hook definitions. + Copyright (C) 2003, 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. */ + +extern void * darwin_gt_pch_get_address (size_t sz, int fd); +extern int darwin_gt_pch_use_address (void *addr, size_t sz, int fd, + size_t off); + +#undef HOST_HOOKS_GT_PCH_GET_ADDRESS +#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_gt_pch_get_address +#undef HOST_HOOKS_GT_PCH_USE_ADDRESS +#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_gt_pch_use_address diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h index a3549941797..6b78909b5e3 100644 --- a/gcc/config/i386/cygming.h +++ b/gcc/config/i386/cygming.h @@ -1,6 +1,7 @@ /* Operating system specific defines to be used when targeting GCC for hosting on Windows32, using a Unix style C library and tools. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -50,26 +51,6 @@ Boston, MA 02111-1307, USA. */ #include -/* Masks for subtarget switches used by other files. */ -#define MASK_NOP_FUN_DLLIMPORT 0x08000000 /* Ignore dllimport for functions */ - -/* Used in winnt.c. */ -#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{ "cygwin", 0, N_("Use the Cygwin interface") }, \ -{ "no-cygwin", 0, N_("Use the Mingw32 interface") }, \ -{ "windows", 0, N_("Create GUI application") }, \ -{ "no-win32", 0, N_("Don't set Windows defines") }, \ -{ "win32", 0, N_("Set Windows defines") }, \ -{ "console", 0, N_("Create console application") },\ -{ "dll", 0, N_("Generate code for a DLL") }, \ -{ "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, \ - N_("Ignore dllimport for functions") }, \ -{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \ -{ "threads", 0, N_("Use Mingw-specific thread support") }, - #define MAYBE_UWIN_CPP_BUILTINS() /* Nothing. */ #define TARGET_OS_CPP_BUILTINS() \ @@ -182,7 +163,7 @@ switch_to_section (enum in_section section, tree decl) \ do { \ if (flag_pic) \ { \ - warning ("-f%s ignored for target (all code is position independent)",\ + warning (0, "-f%s ignored for target (all code is position independent)",\ (flag_pic > 1) ? "PIC" : "pic"); \ flag_pic = 0; \ } \ @@ -297,7 +278,7 @@ extern void i386_pe_unique_section (TREE, int); do \ { \ if (TREE_CODE (DECL) == FUNCTION_DECL) \ - i386_pe_record_external_function (NAME); \ + i386_pe_record_external_function ((DECL), (NAME)); \ } \ while (0) @@ -345,7 +326,7 @@ extern void i386_pe_unique_section (TREE, int); /* External function declarations. */ -extern void i386_pe_record_external_function (const char *); +extern void i386_pe_record_external_function (tree, const char *); extern void i386_pe_declare_function_type (FILE *, const char *, int); extern void i386_pe_record_exported_symbol (const char *, int); extern void i386_pe_file_end (void); @@ -418,6 +399,10 @@ extern int i386_pe_dllimport_name_p (const char *); #undef TARGET_USE_LOCAL_THUNK_ALIAS_P #define TARGET_USE_LOCAL_THUNK_ALIAS_P(DECL) (!DECL_ONE_ONLY (DECL)) +#define SUBTARGET_ATTRIBUTE_TABLE \ + /* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \ + { "selectany", 0, 0, true, false, false, ix86_handle_selectany_attribute } + #undef TREE #ifndef BUFSIZ diff --git a/gcc/config/i386/cygming.opt b/gcc/config/i386/cygming.opt new file mode 100644 index 00000000000..d61df2bb3eb --- /dev/null +++ b/gcc/config/i386/cygming.opt @@ -0,0 +1,48 @@ +; Cygwin- and MinGW-specific options. + +; Copyright (C) 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. + +mconsole +Target RejectNegative +Create console application + +mcygwin +Target +Use the Cygwin interface + +mdll +Target RejectNegative +Generate code for a DLL + +mnop-fun-dllimport +Target Report Var(TARGET_NOP_FUN_DLLIMPORT) +Ignore dllimport for functions + +mthreads +Target RejectNegative +Use Mingw-specific thread support + +mwin32 +Target +Set Windows defines + +mwindows +Target +Create GUI application diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h index ec816259bde..b526e22d8b1 100644 --- a/gcc/config/i386/darwin.h +++ b/gcc/config/i386/darwin.h @@ -1,5 +1,5 @@ /* Target definitions for x86 running Darwin. - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. @@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ #define TARGET_VERSION fprintf (stderr, " (i686 Darwin)"); +#undef TARGET_FPMATH_DEFAULT +#define TARGET_FPMATH_DEFAULT (TARGET_SSE ? FPMATH_SSE : FPMATH_387) + #define TARGET_OS_CPP_BUILTINS() \ do \ { \ @@ -43,13 +46,12 @@ Boston, MA 02111-1307, USA. */ %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}" #undef ASM_SPEC -#define ASM_SPEC "-arch i686 -force_cpusubtype_ALL" +#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}" }, - + { "darwin_arch", "i386" }, \ + { "darwin_subarch", "i386" }, /* Use the following macro for any Darwin/x86-specific command-line option translation. */ @@ -76,7 +78,7 @@ 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) +#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_128BIT_LONG_DOUBLE | MASK_ALIGN_DOUBLE) /* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC. */ diff --git a/gcc/config/i386/djgpp.h b/gcc/config/i386/djgpp.h index cee9480d69c..44ba1b8c3c5 100644 --- a/gcc/config/i386/djgpp.h +++ b/gcc/config/i386/djgpp.h @@ -1,5 +1,5 @@ /* Configuration for an i386 running MS-DOS with DJGPP. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -169,26 +169,16 @@ Boston, MA 02111-1307, USA. */ /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers. */ #define LIBSTDCXX "-lstdcxx" -/* -mbnu210 is now ignored and obsolete. It was used to enable support for - weak symbols, and .gnu.linkonce support. */ -#undef MASK_BNU210 -#define MASK_BNU210 (0x40000000) - #define TARGET_VERSION fprintf (stderr, " (80386, MS-DOS DJGPP)"); -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "no-bnu210", -MASK_BNU210, "Ignored (obsolete)" }, \ - { "bnu210", MASK_BNU210, "Ignored (obsolete)" }, - /* Warn that -mbnu210 is now obsolete. */ #undef SUBTARGET_OVERRIDE_OPTIONS #define SUBTARGET_OVERRIDE_OPTIONS \ do \ { \ - if (target_flags & MASK_BNU210) \ + if (TARGET_BNU210) \ { \ - warning ("-mbnu210 is ignored (option is obsolete)"); \ + warning (0, "-mbnu210 is ignored (option is obsolete)"); \ } \ } \ while (0) diff --git a/gcc/config/i386/djgpp.opt b/gcc/config/i386/djgpp.opt new file mode 100644 index 00000000000..31c26882e3e --- /dev/null +++ b/gcc/config/i386/djgpp.opt @@ -0,0 +1,26 @@ +; DJGPP-specific options. + +; Copyright (C) 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. + +;; -mbnu210 is now ignored and obsolete. It was used to enable support for +;; weak symbols, and .gnu.linkonce support. +mbnu210 +Target Var(TARGET_BNU210) +Ignored (obsolete) diff --git a/gcc/config/i386/host-i386-darwin.c b/gcc/config/i386/host-i386-darwin.c new file mode 100644 index 00000000000..80a9a9a0734 --- /dev/null +++ b/gcc/config/i386/host-i386-darwin.c @@ -0,0 +1,31 @@ +/* i386-darwin host-specific hook definitions. + Copyright (C) 2003, 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 "config.h" +#include "system.h" +#include "coretypes.h" +#include "hosthooks.h" +#include "hosthooks-def.h" +#include "config/host-darwin.h" + +/* Darwin doesn't do anything special for x86 hosts; this file exists just + to include config/host-darwin.h. */ + +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index bf693860da7..d8f15da9e4c 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -150,7 +150,8 @@ extern void ix86_expand_branch (enum rtx_code, rtx); extern int ix86_expand_setcc (enum rtx_code, rtx); extern int ix86_expand_int_movcc (rtx[]); extern int ix86_expand_fp_movcc (rtx[]); -extern void ix86_split_sse_movcc (rtx[]); +extern bool ix86_expand_fp_vcond (rtx[]); +extern bool ix86_expand_int_vcond (rtx[], bool); extern int ix86_expand_int_addcc (rtx[]); extern void ix86_expand_call (rtx, rtx, rtx, rtx, rtx, int); extern void x86_initialize_trampoline (rtx, rtx, rtx); @@ -186,6 +187,8 @@ extern int ix86_register_move_cost (enum machine_mode, enum reg_class, enum reg_class); extern int ix86_secondary_memory_needed (enum reg_class, enum reg_class, enum machine_mode, int); +extern bool ix86_cannot_change_mode_class (enum machine_mode, + enum machine_mode, enum reg_class); extern enum reg_class ix86_preferred_reload_class (rtx, enum reg_class); extern int ix86_memory_move_cost (enum machine_mode, enum reg_class, int); extern void emit_i387_cw_initialization (rtx, rtx, int); @@ -204,7 +207,7 @@ extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree); extern rtx function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern rtx ix86_function_value (tree); +extern rtx ix86_function_value (tree, tree); #endif #endif @@ -216,6 +219,7 @@ extern int ix86_data_alignment (tree, int); extern int ix86_local_alignment (tree, int); extern int ix86_constant_alignment (tree, int); extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *); +extern tree ix86_handle_selectany_attribute (tree *, tree, tree, int, bool *); extern unsigned int i386_pe_section_type_flags (tree, const char *, int); extern void i386_pe_asm_named_section (const char *, unsigned int, tree); @@ -233,7 +237,7 @@ extern int i386_pe_dllexport_name_p (const char *); extern int i386_pe_dllimport_name_p (const char *); extern void i386_pe_unique_section (tree, int); extern void i386_pe_declare_function_type (FILE *, const char *, int); -extern void i386_pe_record_external_function (const char *); +extern void i386_pe_record_external_function (tree, const char *); extern void i386_pe_record_exported_symbol (const char *, int); extern void i386_pe_asm_file_end (FILE *); extern void i386_pe_encode_section_info (tree, rtx, int); diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f76812f335f..2ed8edf7753 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -584,6 +584,10 @@ const int x86_ext_80387_constants = m_K6 | m_ATHLON | m_PENT4 | m_NOCONA | m_PPR const int x86_four_jump_limit = m_PPRO | m_ATHLON_K8 | m_PENT4 | m_NOCONA; const int x86_schedule = m_PPRO | m_ATHLON_K8 | m_K6 | m_PENT; const int x86_use_bt = m_ATHLON_K8; +/* Compare and exchange was added for 80486. */ +const int x86_cmpxchg = ~m_386; +/* Exchange and add was added for 80486. */ +const int x86_xadd = ~m_386; /* In case the average insn count for single function invocation is lower than this constant, emit fast (but longer) prologue and @@ -727,6 +731,7 @@ int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER] = rtx ix86_compare_op0 = NULL_RTX; rtx ix86_compare_op1 = NULL_RTX; +rtx ix86_compare_emitted = NULL_RTX; #define MAX_386_STACK_LOCALS 3 /* Size of the register save area. */ @@ -782,17 +787,15 @@ struct ix86_frame bool save_regs_using_mov; }; -/* Used to enable/disable debugging features. */ -const char *ix86_debug_arg_string, *ix86_debug_addr_string; /* Code model option as passed by user. */ -const char *ix86_cmodel_string; +static const char *ix86_cmodel_string; /* Parsed value. */ enum cmodel ix86_cmodel; /* Asm dialect. */ -const char *ix86_asm_string; +static const char *ix86_asm_string; enum asm_dialect ix86_asm_dialect = ASM_ATT; /* TLS dialext. */ -const char *ix86_tls_dialect_string; +static const char *ix86_tls_dialect_string; enum tls_dialect ix86_tls_dialect = TLS_DIALECT_GNU; /* Which unit we are generating floating point math for. */ @@ -806,42 +809,43 @@ enum processor_type ix86_arch; /* Strings to hold which cpu and instruction set architecture to use. */ const char *ix86_tune_string; /* for -mtune= */ const char *ix86_arch_string; /* for -march= */ -const char *ix86_fpmath_string; /* for -mfpmath= */ +static const char *ix86_fpmath_string; /* for -mfpmath= */ /* # of registers to use to pass arguments. */ -const char *ix86_regparm_string; +static const char *ix86_regparm_string; /* true if sse prefetch instruction is not NOOP. */ int x86_prefetch_sse; /* ix86_regparm_string as a number */ -int ix86_regparm; +static int ix86_regparm; /* Alignment to use for loops and jumps: */ /* Power of two alignment for loops. */ -const char *ix86_align_loops_string; +static const char *ix86_align_loops_string; /* Power of two alignment for non-loop jumps. */ -const char *ix86_align_jumps_string; +static const char *ix86_align_jumps_string; /* Power of two alignment for stack boundary in bytes. */ -const char *ix86_preferred_stack_boundary_string; +static const char *ix86_preferred_stack_boundary_string; /* Preferred alignment for stack boundary in bits. */ unsigned int ix86_preferred_stack_boundary; /* Values 1-5: see jump.c */ int ix86_branch_cost; -const char *ix86_branch_cost_string; +static const char *ix86_branch_cost_string; /* Power of two alignment for functions. */ -const char *ix86_align_funcs_string; +static const char *ix86_align_funcs_string; /* Prefix built by ASM_GENERATE_INTERNAL_LABEL. */ char internal_label_prefix[16]; int internal_label_prefix_len; +static bool ix86_handle_option (size_t, const char *, int); static void output_pic_addr_const (FILE *, rtx, int); static void put_condition_code (enum rtx_code, enum machine_mode, int, int, FILE *); @@ -915,7 +919,7 @@ const struct attribute_spec ix86_attribute_table[]; static bool ix86_function_ok_for_sibcall (tree, tree); static tree ix86_handle_cdecl_attribute (tree *, tree, tree, int, bool *); static tree ix86_handle_regparm_attribute (tree *, tree, tree, int, bool *); -static int ix86_value_regno (enum machine_mode); +static int ix86_value_regno (enum machine_mode, tree); static bool contains_128bit_aligned_vector_p (tree); static rtx ix86_struct_value_rtx (tree, int); static bool ix86_ms_bitfield_layout_p (tree); @@ -923,7 +927,7 @@ static tree ix86_handle_struct_attribute (tree *, tree, tree, int, bool *); static int extended_reg_mentioned_1 (rtx *, void *); static bool ix86_rtx_costs (rtx, int, int, int *); static int min_insn_size (rtx); -static tree ix86_md_asm_clobbers (tree clobbers); +static tree ix86_md_asm_clobbers (tree outputs, tree inputs, tree clobbers); static bool ix86_must_pass_in_stack (enum machine_mode mode, tree type); static bool ix86_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); @@ -1040,6 +1044,16 @@ static void init_ext_80387_constants (void); #undef TARGET_ASM_FILE_START #define TARGET_ASM_FILE_START x86_file_start +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (TARGET_DEFAULT \ + | TARGET_64BIT_DEFAULT \ + | TARGET_SUBTARGET_DEFAULT \ + | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT) + +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION ix86_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS ix86_rtx_costs #undef TARGET_ADDRESS_COST @@ -1090,6 +1104,98 @@ struct gcc_target targetm = TARGET_INITIALIZER; #define DEFAULT_PCC_STRUCT_RETURN 1 #endif +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +ix86_handle_option (size_t code, const char *arg, int value) +{ + switch (code) + { + case OPT_m3dnow: + if (!value) + { + target_flags &= ~MASK_3DNOW_A; + target_flags_explicit |= MASK_3DNOW_A; + } + return true; + + case OPT_malign_functions_: + ix86_align_funcs_string = arg; + return true; + + case OPT_malign_jumps_: + ix86_align_jumps_string = arg; + return true; + + case OPT_malign_loops_: + ix86_align_loops_string = arg; + return true; + + case OPT_march_: + ix86_arch_string = arg; + return true; + + case OPT_masm_: + ix86_asm_string = arg; + return true; + + case OPT_mbranch_cost_: + ix86_branch_cost_string = arg; + return true; + + case OPT_mcmodel_: + ix86_cmodel_string = arg; + return true; + + case OPT_mfpmath_: + ix86_fpmath_string = arg; + return true; + + case OPT_mmmx: + if (!value) + { + target_flags &= ~(MASK_3DNOW | MASK_3DNOW_A); + target_flags_explicit |= MASK_3DNOW | MASK_3DNOW_A; + } + return true; + + case OPT_mpreferred_stack_boundary_: + ix86_preferred_stack_boundary_string = arg; + return true; + + case OPT_mregparm_: + ix86_regparm_string = arg; + return true; + + case OPT_msse: + if (!value) + { + target_flags &= ~(MASK_SSE2 | MASK_SSE3); + target_flags_explicit |= MASK_SSE2 | MASK_SSE3; + } + return true; + + case OPT_msse2: + if (!value) + { + target_flags &= ~MASK_SSE3; + target_flags_explicit |= MASK_SSE3; + } + return true; + + case OPT_mtls_dialect_: + ix86_tls_dialect_string = arg; + return true; + + case OPT_mtune_: + ix86_tune_string = arg; + return true; + + default: + return true; + } +} + /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -1371,7 +1477,7 @@ override_options (void) Remove this code in GCC 3.2 or later. */ if (ix86_align_loops_string) { - warning ("-malign-loops is obsolete, use -falign-loops"); + warning (0, "-malign-loops is obsolete, use -falign-loops"); if (align_loops == 0) { i = atoi (ix86_align_loops_string); @@ -1384,7 +1490,7 @@ override_options (void) if (ix86_align_jumps_string) { - warning ("-malign-jumps is obsolete, use -falign-jumps"); + warning (0, "-malign-jumps is obsolete, use -falign-jumps"); if (align_jumps == 0) { i = atoi (ix86_align_jumps_string); @@ -1397,7 +1503,7 @@ override_options (void) if (ix86_align_funcs_string) { - warning ("-malign-functions is obsolete, use -falign-functions"); + warning (0, "-malign-functions is obsolete, use -falign-functions"); if (align_functions == 0) { i = atoi (ix86_align_funcs_string); @@ -1516,19 +1622,17 @@ override_options (void) target_flags |= ((MASK_SSE2 | MASK_SSE | MASK_MMX | MASK_128BIT_LONG_DOUBLE) & ~target_flags_explicit); - - if (TARGET_SSE) - ix86_fpmath = FPMATH_SSE; } else { - ix86_fpmath = FPMATH_387; /* i386 ABI does not specify red zone. It still makes sense to use it when programmer takes care to stack from being destroyed. */ if (!(target_flags_explicit & MASK_NO_RED_ZONE)) target_flags |= MASK_NO_RED_ZONE; } + ix86_fpmath = TARGET_FPMATH_DEFAULT; + if (ix86_fpmath_string != 0) { if (! strcmp (ix86_fpmath_string, "387")) @@ -1537,7 +1641,7 @@ override_options (void) { if (!TARGET_SSE) { - warning ("SSE instruction set disabled, using 387 arithmetics"); + warning (0, "SSE instruction set disabled, using 387 arithmetics"); ix86_fpmath = FPMATH_387; } else @@ -1548,12 +1652,12 @@ override_options (void) { if (!TARGET_SSE) { - warning ("SSE instruction set disabled, using 387 arithmetics"); + warning (0, "SSE instruction set disabled, using 387 arithmetics"); ix86_fpmath = FPMATH_387; } else if (!TARGET_80387) { - warning ("387 instruction set disabled, using SSE arithmetics"); + warning (0, "387 instruction set disabled, using SSE arithmetics"); ix86_fpmath = FPMATH_SSE; } else @@ -1645,19 +1749,27 @@ const struct attribute_spec ix86_attribute_table[] = static bool ix86_function_ok_for_sibcall (tree decl, tree exp) { + tree func; + /* If we are generating position-independent code, we cannot sibcall optimize any indirect call, or a direct call to a global function, as the PLT requires %ebx be live. */ if (!TARGET_64BIT && flag_pic && (!decl || TREE_PUBLIC (decl))) return false; + if (decl) + func = decl; + else + func = NULL; + /* If we are returning floats on the 80387 register stack, we cannot make a sibcall from a function that doesn't return a float to a function that does or, conversely, from a function that does return a float to a function that doesn't; the necessary stack adjustment would not be executed. */ - if (STACK_REG_P (ix86_function_value (TREE_TYPE (exp))) - != STACK_REG_P (ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl))))) + if (STACK_REG_P (ix86_function_value (TREE_TYPE (exp), func)) + != STACK_REG_P (ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)), + cfun->decl))) return false; /* If this call is indirect, we'll need to be able to use a call-clobbered @@ -1703,7 +1815,7 @@ ix86_handle_cdecl_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1731,7 +1843,7 @@ ix86_handle_cdecl_attribute (tree *node, tree name, if (TARGET_64BIT) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1749,7 +1861,7 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1760,13 +1872,13 @@ ix86_handle_regparm_attribute (tree *node, tree name, tree args, cst = TREE_VALUE (args); if (TREE_CODE (cst) != INTEGER_CST) { - warning ("%qs attribute requires an integer constant argument", + warning (0, "%qs attribute requires an integer constant argument", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (compare_tree_int (cst, REGPARM_MAX) > 0) { - warning ("argument to %qs attribute larger than %d", + warning (0, "argument to %qs attribute larger than %d", IDENTIFIER_POINTER (name), REGPARM_MAX); *no_add_attrs = true; } @@ -2037,7 +2149,22 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ } if ((!fntype && !libname) || (fntype && !TYPE_ARG_TYPES (fntype))) - cum->maybe_vaarg = 1; + cum->maybe_vaarg = true; + + /* For local functions, pass SFmode (and DFmode for SSE2) arguments + in SSE registers even for 32-bit mode and not just 3, but up to + 8 SSE arguments in registers. */ + if (!TARGET_64BIT && !cum->maybe_vaarg && !cum->fastcall + && cum->sse_nregs == SSE_REGPARM_MAX && fndecl + && TARGET_SSE_MATH && flag_unit_at_a_time && !profile_flag) + { + struct cgraph_local_info *i = cgraph_local_info (fndecl); + if (i && i->local) + { + cum->sse_nregs = 8; + cum->float_in_sse = true; + } + } if (TARGET_DEBUG_ARG) fprintf (stderr, ", nregs=%d )\n", cum->nregs); @@ -2080,7 +2207,7 @@ type_natural_mode (tree type) && GET_MODE_INNER (mode) == innermode) return mode; - abort (); + gcc_unreachable (); } } @@ -2207,8 +2334,9 @@ classify_argument (enum machine_mode mode, tree type, } /* Classify each field of record and merge classes. */ - if (TREE_CODE (type) == RECORD_TYPE) + switch (TREE_CODE (type)) { + case RECORD_TYPE: /* For classes first merge in the field of the subclasses. */ if (TYPE_BINFO (type)) { @@ -2273,55 +2401,36 @@ classify_argument (enum machine_mode mode, tree type, } } } - } - /* Arrays are handled as small records. */ - else if (TREE_CODE (type) == ARRAY_TYPE) - { - int num; - num = classify_argument (TYPE_MODE (TREE_TYPE (type)), - TREE_TYPE (type), subclasses, bit_offset); - if (!num) - return 0; - - /* The partial classes are now full classes. */ - if (subclasses[0] == X86_64_SSESF_CLASS && bytes != 4) - subclasses[0] = X86_64_SSE_CLASS; - if (subclasses[0] == X86_64_INTEGERSI_CLASS && bytes != 4) - subclasses[0] = X86_64_INTEGER_CLASS; - - for (i = 0; i < words; i++) - classes[i] = subclasses[i % num]; - } - /* Unions are similar to RECORD_TYPE but offset is always 0. */ - else if (TREE_CODE (type) == UNION_TYPE - || TREE_CODE (type) == QUAL_UNION_TYPE) - { - /* For classes first merge in the field of the subclasses. */ - if (TYPE_BINFO (type)) - { - tree binfo, base_binfo; - int basenum; + break; - for (binfo = TYPE_BINFO (type), basenum = 0; - BINFO_BASE_ITERATE (binfo, basenum, base_binfo); basenum++) - { - int num; - int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8; - tree type = BINFO_TYPE (base_binfo); + case ARRAY_TYPE: + /* Arrays are handled as small records. */ + { + int num; + num = classify_argument (TYPE_MODE (TREE_TYPE (type)), + TREE_TYPE (type), subclasses, bit_offset); + if (!num) + return 0; - num = classify_argument (TYPE_MODE (type), - type, subclasses, - (offset + (bit_offset % 64)) % 256); - if (!num) - return 0; - for (i = 0; i < num; i++) - { - int pos = (offset + (bit_offset % 64)) / 8 / 8; - classes[i + pos] = - merge_classes (subclasses[i], classes[i + pos]); - } - } - } + /* The partial classes are now full classes. */ + if (subclasses[0] == X86_64_SSESF_CLASS && bytes != 4) + subclasses[0] = X86_64_SSE_CLASS; + if (subclasses[0] == X86_64_INTEGERSI_CLASS && bytes != 4) + subclasses[0] = X86_64_INTEGER_CLASS; + + for (i = 0; i < words; i++) + classes[i] = subclasses[i % num]; + + break; + } + case UNION_TYPE: + case QUAL_UNION_TYPE: + /* Unions are similar to RECORD_TYPE but offset is always 0. + */ + + /* Unions are not derived. */ + gcc_assert (!TYPE_BINFO (type) + || !BINFO_N_BASE_BINFOS (TYPE_BINFO (type))); for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) { if (TREE_CODE (field) == FIELD_DECL) @@ -2336,9 +2445,11 @@ classify_argument (enum machine_mode mode, tree type, classes[i] = merge_classes (subclasses[i], classes[i]); } } + break; + + default: + gcc_unreachable (); } - else - abort (); /* Final merger cleanup. */ for (i = 0; i < words; i++) @@ -2454,21 +2565,19 @@ classify_argument (enum machine_mode mode, tree type, case VOIDmode: return 0; default: - if (VECTOR_MODE_P (mode)) - { - if (bytes > 16) - return 0; - if (GET_MODE_CLASS (GET_MODE_INNER (mode)) == MODE_INT) - { - if (bit_offset + GET_MODE_BITSIZE (mode) <= 32) - classes[0] = X86_64_INTEGERSI_CLASS; - else - classes[0] = X86_64_INTEGER_CLASS; - classes[1] = X86_64_INTEGER_CLASS; - return 1 + (bytes > 8); - } - } - abort (); + gcc_assert (VECTOR_MODE_P (mode)); + + if (bytes > 16) + return 0; + + gcc_assert (GET_MODE_CLASS (GET_MODE_INNER (mode)) == MODE_INT); + + if (bit_offset + GET_MODE_BITSIZE (mode) <= 32) + classes[0] = X86_64_INTEGERSI_CLASS; + else + classes[0] = X86_64_INTEGER_CLASS; + classes[1] = X86_64_INTEGER_CLASS; + return 1 + (bytes > 8); } } @@ -2508,7 +2617,7 @@ examine_argument (enum machine_mode mode, tree type, int in_return, case X86_64_COMPLEX_X87_CLASS: return in_return ? 2 : 0; case X86_64_MEMORY_CLASS: - abort (); + gcc_unreachable (); } return 1; } @@ -2590,7 +2699,7 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, /* Zero sized array, struct or class. */ return NULL; default: - abort (); + gcc_unreachable (); } if (n == 2 && class[0] == X86_64_SSE_CLASS && class[1] == X86_64_SSEUP_CLASS && mode != BLKmode) @@ -2656,9 +2765,14 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode, sse_regno++; break; default: - abort (); + gcc_unreachable (); } } + + /* Empty aligned struct, union or class. */ + if (nexps == 0) + return NULL; + ret = gen_rtx_PARALLEL (mode, rtvec_alloc (nexps)); for (i = 0; i < nexps; i++) XVECEXP (ret, 0, i) = exp [i]; @@ -2728,6 +2842,14 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, } break; + case DFmode: + if (!TARGET_SSE2) + break; + case SFmode: + if (!cum->float_in_sse) + break; + /* FALLTHRU */ + case TImode: case V16QImode: case V8HImode: @@ -2849,6 +2971,13 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, ret = gen_rtx_REG (mode, regno); } break; + case DFmode: + if (!TARGET_SSE2) + break; + case SFmode: + if (!cum->float_in_sse) + break; + /* FALLTHRU */ case TImode: case V16QImode: case V8HImode: @@ -2861,7 +2990,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, if (!TARGET_SSE && !warnedsse && cum->warn_sse) { warnedsse = true; - warning ("SSE vector argument without SSE enabled " + warning (0, "SSE vector argument without SSE enabled " "changes the ABI"); } if (cum->sse_nregs) @@ -2878,7 +3007,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode orig_mode, if (!TARGET_MMX && !warnedmmx && cum->warn_mmx) { warnedmmx = true; - warning ("MMX vector argument without MMX enabled " + warning (0, "MMX vector argument without MMX enabled " "changes the ABI"); } if (cum->mmx_nregs) @@ -2944,38 +3073,43 @@ contains_128bit_aligned_vector_p (tree type) if (AGGREGATE_TYPE_P (type)) { /* Walk the aggregates recursively. */ - if (TREE_CODE (type) == RECORD_TYPE - || TREE_CODE (type) == UNION_TYPE - || TREE_CODE (type) == QUAL_UNION_TYPE) + switch (TREE_CODE (type)) { - tree field; - - if (TYPE_BINFO (type)) - { - tree binfo, base_binfo; - int i; - - for (binfo = TYPE_BINFO (type), i = 0; - BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) - if (contains_128bit_aligned_vector_p (BINFO_TYPE (base_binfo))) + case RECORD_TYPE: + case UNION_TYPE: + case QUAL_UNION_TYPE: + { + tree field; + + if (TYPE_BINFO (type)) + { + tree binfo, base_binfo; + int i; + + for (binfo = TYPE_BINFO (type), i = 0; + BINFO_BASE_ITERATE (binfo, i, base_binfo); i++) + if (contains_128bit_aligned_vector_p + (BINFO_TYPE (base_binfo))) + return true; + } + /* And now merge the fields of structure. */ + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + { + if (TREE_CODE (field) == FIELD_DECL + && contains_128bit_aligned_vector_p (TREE_TYPE (field))) return true; - } - /* And now merge the fields of structure. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) - { - if (TREE_CODE (field) == FIELD_DECL - && contains_128bit_aligned_vector_p (TREE_TYPE (field))) - return true; - } - } - /* Just for use if some languages passes arrays by value. */ - else if (TREE_CODE (type) == ARRAY_TYPE) - { + } + break; + } + + case ARRAY_TYPE: + /* Just for use if some languages passes arrays by value. */ if (contains_128bit_aligned_vector_p (TREE_TYPE (type))) return true; + + default: + gcc_unreachable (); } - else - abort (); } return false; } @@ -3040,7 +3174,7 @@ ix86_function_value_regno_p (int regno) If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ rtx -ix86_function_value (tree valtype) +ix86_function_value (tree valtype, tree func) { enum machine_mode natmode = type_natural_mode (valtype); @@ -3056,7 +3190,7 @@ ix86_function_value (tree valtype) return ret; } else - return gen_rtx_REG (TYPE_MODE (valtype), ix86_value_regno (natmode)); + return gen_rtx_REG (TYPE_MODE (valtype), ix86_value_regno (natmode, func)); } /* Return false iff type is returned in memory. */ @@ -3126,7 +3260,7 @@ ix86_struct_value_rtx (tree type, int incoming ATTRIBUTE_UNUSED) || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16)) { warned = true; - warning ("SSE vector return without SSE enabled changes the ABI"); + warning (0, "SSE vector return without SSE enabled changes the ABI"); } } @@ -3158,23 +3292,36 @@ ix86_libcall_value (enum machine_mode mode) } } else - return gen_rtx_REG (mode, ix86_value_regno (mode)); + return gen_rtx_REG (mode, ix86_value_regno (mode, NULL)); } /* Given a mode, return the register to use for a return value. */ static int -ix86_value_regno (enum machine_mode mode) +ix86_value_regno (enum machine_mode mode, tree func) { - /* Floating point return values in %st(0). */ - if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_FLOAT_RETURNS_IN_80387) - return FIRST_FLOAT_REG; + gcc_assert (!TARGET_64BIT); + /* 16-byte vector modes in %xmm0. See ix86_return_in_memory for where we prevent this case when sse is not available. */ if (mode == TImode || (VECTOR_MODE_P (mode) && GET_MODE_SIZE (mode) == 16)) return FIRST_SSE_REG; - /* Everything else in %eax. */ - return 0; + + /* Most things go in %eax, except (unless -mno-fp-ret-in-387) fp values. */ + if (GET_MODE_CLASS (mode) != MODE_FLOAT || !TARGET_FLOAT_RETURNS_IN_80387) + return 0; + + /* Floating point return values in %st(0), except for local functions when + SSE math is enabled. */ + if (func && SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH + && flag_unit_at_a_time) + { + struct cgraph_local_info *i = cgraph_local_info (func); + if (i && i->local) + return FIRST_SSE_REG; + } + + return FIRST_FLOAT_REG; } /* Create the va_list data type. */ @@ -3200,6 +3347,9 @@ ix86_build_builtin_va_list (void) f_sav = build_decl (FIELD_DECL, get_identifier ("reg_save_area"), ptr_type_node); + va_list_gpr_counter_field = f_gpr; + va_list_fpr_counter_field = f_fpr; + DECL_FIELD_CONTEXT (f_gpr) = record; DECL_FIELD_CONTEXT (f_fpr) = record; DECL_FIELD_CONTEXT (f_ovf) = record; @@ -3239,6 +3389,9 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, if (!TARGET_64BIT) return; + if (! cfun->va_list_gpr_size && ! cfun->va_list_fpr_size) + return; + /* Indicate to allocate space on the stack for varargs save area. */ ix86_save_varrargs_registers = 1; @@ -3260,7 +3413,10 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, set = get_varargs_alias_set (); - for (i = next_cum.regno; i < ix86_regparm; i++) + for (i = next_cum.regno; + i < ix86_regparm + && i < next_cum.regno + cfun->va_list_gpr_size / UNITS_PER_WORD; + i++) { mem = gen_rtx_MEM (Pmode, plus_constant (save_area, i * UNITS_PER_WORD)); @@ -3269,7 +3425,7 @@ ix86_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, x86_64_int_parameter_registers[i])); } - if (next_cum.sse_nregs) + if (next_cum.sse_nregs && cfun->va_list_fpr_size) { /* Now emit code to save SSE registers. The AX parameter contains number of SSE parameter registers used to call this function. We use @@ -3352,15 +3508,21 @@ ix86_va_start (tree valist, rtx nextarg) fprintf (stderr, "va_start: words = %d, n_gpr = %d, n_fpr = %d\n", (int) words, (int) n_gpr, (int) n_fpr); - t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, - build_int_cst (NULL_TREE, n_gpr * 8)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size) + { + t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, + build_int_cst (NULL_TREE, n_gpr * 8)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } - t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, - build_int_cst (NULL_TREE, n_fpr * 16 + 8*REGPARM_MAX)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_fpr_size) + { + t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, + build_int_cst (NULL_TREE, n_fpr * 16 + 8*REGPARM_MAX)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } /* Find the overflow area. */ t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); @@ -3371,12 +3533,15 @@ ix86_va_start (tree valist, rtx nextarg) TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); - /* Find the register save area. - Prologue of the function save it right above stack frame. */ - t = make_tree (TREE_TYPE (sav), frame_pointer_rtx); - t = build (MODIFY_EXPR, TREE_TYPE (sav), sav, t); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size || cfun->va_list_fpr_size) + { + /* Find the register save area. + Prologue of the function save it right above stack frame. */ + t = make_tree (TREE_TYPE (sav), frame_pointer_rtx); + t = build (MODIFY_EXPR, TREE_TYPE (sav), sav, t); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } } /* Implement va_arg. */ @@ -3637,13 +3802,11 @@ ix86_check_movabs (rtx insn, int opnum) set = PATTERN (insn); if (GET_CODE (set) == PARALLEL) set = XVECEXP (set, 0, 0); - if (GET_CODE (set) != SET) - abort (); + gcc_assert (GET_CODE (set) == SET); mem = XEXP (set, opnum); while (GET_CODE (mem) == SUBREG) mem = SUBREG_REG (mem); - if (GET_CODE (mem) != MEM) - abort (); + gcc_assert (GET_CODE (mem) == MEM); return (volatile_ok || !MEM_VOLATILE_P (mem)); } @@ -3729,8 +3892,9 @@ standard_80387_constant_opcode (rtx x) return "fldl2t"; case 7: return "fldpi"; + default: + gcc_unreachable (); } - abort (); } /* Return the CONST_DOUBLE representing the 80387 constant that is @@ -3756,7 +3920,7 @@ standard_80387_constant_rtx (int idx) break; default: - abort (); + gcc_unreachable (); } return CONST_DOUBLE_FROM_REAL_VALUE (ext_80387_constants_table[i], @@ -4082,14 +4246,13 @@ ix86_initial_elimination_offset (int from, int to) return frame.hard_frame_pointer_offset - frame.frame_pointer_offset; else { - if (to != STACK_POINTER_REGNUM) - abort (); - else if (from == ARG_POINTER_REGNUM) + gcc_assert (to == STACK_POINTER_REGNUM); + + if (from == ARG_POINTER_REGNUM) return frame.stack_pointer_offset; - else if (from != FRAME_POINTER_REGNUM) - abort (); - else - return frame.stack_pointer_offset - frame.frame_pointer_offset; + + gcc_assert (from == FRAME_POINTER_REGNUM); + return frame.stack_pointer_offset - frame.frame_pointer_offset; } } @@ -4112,7 +4275,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame) /* During reload iteration the amount of registers saved can change. Recompute the value as needed. Do not recompute when amount of registers - didn't change as reload does mutiple calls to the function and does not + didn't change as reload does multiple calls to the function and does not expect the decision to change within single iteration. */ if (!optimize_size && cfun->machine->use_fast_prologue_epilogue_nregs != frame->nregs) @@ -4156,14 +4319,11 @@ ix86_compute_frame_layout (struct ix86_frame *frame) preferred_alignment, since i386 port is the only using those features that may break easily. */ - if (size && !stack_alignment_needed) - abort (); - if (preferred_alignment < STACK_BOUNDARY / BITS_PER_UNIT) - abort (); - if (preferred_alignment > PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT) - abort (); - if (stack_alignment_needed > PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT) - abort (); + gcc_assert (!size || stack_alignment_needed); + gcc_assert (preferred_alignment >= STACK_BOUNDARY / BITS_PER_UNIT); + gcc_assert (preferred_alignment <= PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT); + gcc_assert (stack_alignment_needed + <= PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT); if (stack_alignment_needed < STACK_BOUNDARY / BITS_PER_UNIT) stack_alignment_needed = STACK_BOUNDARY / BITS_PER_UNIT; @@ -4313,8 +4473,7 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, int style) epilogue and used after the epilogue. ATM indirect sibcall shouldn't be used together with huge frame sizes in one function because of the frame_size check in sibcall.c. */ - if (style == 0) - abort (); + gcc_assert (style); r11 = gen_rtx_REG (DImode, FIRST_REX_INT_REG + 3 /* R11 */); insn = emit_insn (gen_rtx_SET (DImode, r11, offset)); if (style < 0) @@ -4376,8 +4535,7 @@ ix86_expand_prologue (void) bool eax_live = ix86_eax_live_at_start_p (); rtx t; - if (TARGET_64BIT) - abort (); + gcc_assert (!TARGET_64BIT); if (eax_live) { @@ -4583,8 +4741,7 @@ ix86_expand_epilogue (int style) pop the registers. */ if (!sp_valid) { - if (!frame_pointer_needed) - abort (); + gcc_assert (frame_pointer_needed); pro_epilogue_adjust_stack (stack_pointer_rtx, hard_frame_pointer_rtx, GEN_INT (offset), style); @@ -4631,8 +4788,7 @@ ix86_expand_epilogue (int style) rtx ecx = gen_rtx_REG (SImode, 2); /* There is no "pascal" calling convention in 64bit ABI. */ - if (TARGET_64BIT) - abort (); + gcc_assert (!TARGET_64BIT); emit_insn (gen_popsi1 (ecx)); emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, popc)); @@ -4663,9 +4819,8 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED, int ix86_decompose_address (rtx addr, struct ix86_address *out) { - rtx base = NULL_RTX; - rtx index = NULL_RTX; - rtx disp = NULL_RTX; + rtx base = NULL_RTX, index = NULL_RTX, disp = NULL_RTX; + rtx base_reg, index_reg; HOST_WIDE_INT scale = 1; rtx scale_rtx = NULL_RTX; int retval = 1; @@ -4767,34 +4922,37 @@ ix86_decompose_address (rtx addr, struct ix86_address *out) scale = INTVAL (scale_rtx); } + base_reg = base && GET_CODE (base) == SUBREG ? SUBREG_REG (base) : base; + index_reg = index && GET_CODE (index) == SUBREG ? SUBREG_REG (index) : index; + /* Allow arg pointer and stack pointer as index if there is not scaling. */ - if (base && index && scale == 1 - && (index == arg_pointer_rtx - || index == frame_pointer_rtx - || (REG_P (index) && REGNO (index) == STACK_POINTER_REGNUM))) + if (base_reg && index_reg && scale == 1 + && (index_reg == arg_pointer_rtx + || index_reg == frame_pointer_rtx + || (REG_P (index_reg) && REGNO (index_reg) == STACK_POINTER_REGNUM))) { - rtx tmp = base; - base = index; - index = tmp; + rtx tmp; + tmp = base, base = index, index = tmp; + tmp = base_reg, base_reg = index_reg, index_reg = tmp; } /* Special case: %ebp cannot be encoded as a base without a displacement. */ - if ((base == hard_frame_pointer_rtx - || base == frame_pointer_rtx - || base == arg_pointer_rtx) && !disp) + if ((base_reg == hard_frame_pointer_rtx + || base_reg == frame_pointer_rtx + || base_reg == arg_pointer_rtx) && !disp) disp = const0_rtx; /* Special case: on K6, [%esi] makes the instruction vector decoded. Avoid this by transforming to [%esi+0]. */ if (ix86_tune == PROCESSOR_K6 && !optimize_size - && base && !index && !disp - && REG_P (base) - && REGNO_REG_CLASS (REGNO (base)) == SIREG) + && base_reg && !index_reg && !disp + && REG_P (base_reg) + && REGNO_REG_CLASS (REGNO (base_reg)) == SIREG) disp = const0_rtx; /* Special case: encode reg+reg instead of reg*2. */ if (!base && index && scale && scale == 2) - base = index, scale = 1; + base = index, base_reg = index_reg, scale = 1; /* Special case: scaling cannot be encoded without base or displacement. */ if (!base && !disp && index && scale != 1) @@ -4819,9 +4977,14 @@ ix86_address_cost (rtx x) { struct ix86_address parts; int cost = 1; + int ok = ix86_decompose_address (x, &parts); - if (!ix86_decompose_address (x, &parts)) - abort (); + gcc_assert (ok); + + if (parts.base && GET_CODE (parts.base) == SUBREG) + parts.base = SUBREG_REG (parts.base); + if (parts.index && GET_CODE (parts.index) == SUBREG) + parts.index = SUBREG_REG (parts.index); /* More complex memory references are better. */ if (parts.disp && parts.disp != const0_rtx) @@ -5172,15 +5335,23 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) /* Validate base register. - Don't allow SUBREG's here, it can lead to spill failures when the base - is one word out of a two word structure, which is represented internally - as a DImode int. */ + Don't allow SUBREG's that span more than a word here. It can lead to spill + failures when the base is one word out of a two word structure, which is + represented internally as a DImode int. */ if (base) { + rtx reg; reason_rtx = base; - - if (GET_CODE (base) != REG) + + if (REG_P (base)) + reg = base; + else if (GET_CODE (base) == SUBREG + && REG_P (SUBREG_REG (base)) + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (base))) + <= UNITS_PER_WORD) + reg = SUBREG_REG (base); + else { reason = "base is not a register"; goto report_error; @@ -5192,8 +5363,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) goto report_error; } - if ((strict && ! REG_OK_FOR_BASE_STRICT_P (base)) - || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (base))) + if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg)) + || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg))) { reason = "base is not valid"; goto report_error; @@ -5202,15 +5373,21 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) /* Validate index register. - Don't allow SUBREG's here, it can lead to spill failures when the index - is one word out of a two word structure, which is represented internally - as a DImode int. */ + Don't allow SUBREG's that span more than a word here -- same as above. */ if (index) { + rtx reg; reason_rtx = index; - if (GET_CODE (index) != REG) + if (REG_P (index)) + reg = index; + else if (GET_CODE (index) == SUBREG + && REG_P (SUBREG_REG (index)) + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (index))) + <= UNITS_PER_WORD) + reg = SUBREG_REG (index); + else { reason = "index is not a register"; goto report_error; @@ -5222,8 +5399,8 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) goto report_error; } - if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (index)) - || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (index))) + if ((strict && ! REG_OK_FOR_INDEX_STRICT_P (reg)) + || (! strict && ! REG_OK_FOR_INDEX_NONSTRICT_P (reg))) { reason = "index is not valid"; goto report_error; @@ -5259,8 +5436,7 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) case UNSPEC_GOT: case UNSPEC_GOTOFF: case UNSPEC_GOTPCREL: - if (!flag_pic) - abort (); + gcc_assert (flag_pic); goto is_legitimate_pic; case UNSPEC_GOTTPOFF: @@ -5475,8 +5651,7 @@ legitimize_pic_address (rtx orig, rtx reg) || (GET_CODE (addr) == PLUS && GET_CODE (XEXP (addr, 0)) == UNSPEC)) return orig; - if (GET_CODE (addr) != PLUS) - abort (); + gcc_assert (GET_CODE (addr) == PLUS); } if (GET_CODE (addr) == PLUS) { @@ -5669,7 +5844,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov) break; default: - abort (); + gcc_unreachable (); } return dest; @@ -5727,9 +5902,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) /* Canonicalize shifts by 0, 1, 2, 3 into multiply */ if (GET_CODE (x) == ASHIFT && GET_CODE (XEXP (x, 1)) == CONST_INT - && (log = (unsigned) exact_log2 (INTVAL (XEXP (x, 1)))) < 4) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (x, 1)) < 4) { changed = 1; + log = INTVAL (XEXP (x, 1)); x = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (x, 0)), GEN_INT (1 << log)); } @@ -5740,9 +5916,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) if (GET_CODE (XEXP (x, 0)) == ASHIFT && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT - && (log = (unsigned) exact_log2 (INTVAL (XEXP (XEXP (x, 0), 1)))) < 4) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (x, 0), 1)) < 4) { changed = 1; + log = INTVAL (XEXP (XEXP (x, 0), 1)); XEXP (x, 0) = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (XEXP (x, 0), 0)), GEN_INT (1 << log)); @@ -5750,9 +5927,10 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) if (GET_CODE (XEXP (x, 1)) == ASHIFT && GET_CODE (XEXP (XEXP (x, 1), 1)) == CONST_INT - && (log = (unsigned) exact_log2 (INTVAL (XEXP (XEXP (x, 1), 1)))) < 4) + && (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (x, 1), 1)) < 4) { changed = 1; + log = INTVAL (XEXP (XEXP (x, 1), 1)); XEXP (x, 1) = gen_rtx_MULT (Pmode, force_reg (Pmode, XEXP (XEXP (x, 1), 0)), GEN_INT (1 << log)); @@ -5882,17 +6060,11 @@ output_pic_addr_const (FILE *file, rtx x, int code) switch (GET_CODE (x)) { case PC: - if (flag_pic) - putc ('.', file); - else - abort (); + gcc_assert (flag_pic); + putc ('.', file); break; case SYMBOL_REF: - /* Mark the decl as referenced so that cgraph will output the function. */ - if (SYMBOL_REF_DECL (x)) - mark_decl_referenced (SYMBOL_REF_DECL (x)); - assemble_name (file, XSTR (x, 0)); if (!TARGET_MACHO && code == 'P' && ! SYMBOL_REF_LOCAL_P (x)) fputs ("@PLT", file); @@ -5941,14 +6113,13 @@ output_pic_addr_const (FILE *file, rtx x, int code) putc ('+', file); output_pic_addr_const (file, XEXP (x, 1), code); } - else if (GET_CODE (XEXP (x, 1)) == CONST_INT) + else { + gcc_assert (GET_CODE (XEXP (x, 1)) == CONST_INT); output_pic_addr_const (file, XEXP (x, 1), code); putc ('+', file); output_pic_addr_const (file, XEXP (x, 0), code); } - else - abort (); break; case MINUS: @@ -5962,8 +6133,7 @@ output_pic_addr_const (FILE *file, rtx x, int code) break; case UNSPEC: - if (XVECLEN (x, 0) != 1) - abort (); + gcc_assert (XVECLEN (x, 0) == 1); output_pic_addr_const (file, XVECEXP (x, 0, 0), code); switch (XINT (x, 1)) { @@ -6029,12 +6199,12 @@ i386_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs (", 0", file); break; default: - abort (); + gcc_unreachable (); } } /* In the name of slightly smaller debug output, and to cater to - general assembler losage, recognize PIC+GOTOFF and turn it back + general assembler lossage, recognize PIC+GOTOFF and turn it back into a direct symbol reference. */ static rtx @@ -6119,8 +6289,7 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, { enum rtx_code second_code, bypass_code; ix86_fp_comparison_codes (code, &bypass_code, &code, &second_code); - if (bypass_code != UNKNOWN || second_code != UNKNOWN) - abort (); + gcc_assert (bypass_code == UNKNOWN && second_code == UNKNOWN); code = ix86_fp_compare_code_to_integer (code); mode = CCmode; } @@ -6136,52 +6305,64 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, suffix = "ne"; break; case GT: - if (mode != CCmode && mode != CCNOmode && mode != CCGCmode) - abort (); + gcc_assert (mode == CCmode || mode == CCNOmode || mode == CCGCmode); suffix = "g"; break; case GTU: - /* ??? Use "nbe" instead of "a" for fcmov losage on some assemblers. - Those same assemblers have the same but opposite losage on cmov. */ - if (mode != CCmode) - abort (); + /* ??? Use "nbe" instead of "a" for fcmov lossage on some assemblers. + Those same assemblers have the same but opposite lossage on cmov. */ + gcc_assert (mode == CCmode); suffix = fp ? "nbe" : "a"; break; case LT: - if (mode == CCNOmode || mode == CCGOCmode) - suffix = "s"; - else if (mode == CCmode || mode == CCGCmode) - suffix = "l"; - else - abort (); + switch (mode) + { + case CCNOmode: + case CCGOCmode: + suffix = "s"; + break; + + case CCmode: + case CCGCmode: + suffix = "l"; + break; + + default: + gcc_unreachable (); + } break; case LTU: - if (mode != CCmode) - abort (); + gcc_assert (mode == CCmode); suffix = "b"; break; case GE: - if (mode == CCNOmode || mode == CCGOCmode) - suffix = "ns"; - else if (mode == CCmode || mode == CCGCmode) - suffix = "ge"; - else - abort (); + switch (mode) + { + case CCNOmode: + case CCGOCmode: + suffix = "ns"; + break; + + case CCmode: + case CCGCmode: + suffix = "ge"; + break; + + default: + gcc_unreachable (); + } break; case GEU: /* ??? As above. */ - if (mode != CCmode) - abort (); + gcc_assert (mode == CCmode); suffix = fp ? "nb" : "ae"; break; case LE: - if (mode != CCmode && mode != CCGCmode && mode != CCNOmode) - abort (); + gcc_assert (mode == CCmode || mode == CCGCmode || mode == CCNOmode); suffix = "le"; break; case LEU: - if (mode != CCmode) - abort (); + gcc_assert (mode == CCmode); suffix = "be"; break; case UNORDERED: @@ -6191,7 +6372,7 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, suffix = fp ? "nu" : "np"; break; default: - abort (); + gcc_unreachable (); } fputs (suffix, file); } @@ -6201,17 +6382,16 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse, If CODE is 'b', pretend the mode is QImode. If CODE is 'k', pretend the mode is SImode. If CODE is 'q', pretend the mode is DImode. - If CODE is 'h', pretend the reg is the `high' byte register. + If CODE is 'h', pretend the reg is the 'high' byte register. If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */ void print_reg (rtx x, int code, FILE *file) { - if (REGNO (x) == ARG_POINTER_REGNUM - || REGNO (x) == FRAME_POINTER_REGNUM - || REGNO (x) == FLAGS_REG - || REGNO (x) == FPSR_REG) - abort (); + gcc_assert (REGNO (x) != ARG_POINTER_REGNUM + && REGNO (x) != FRAME_POINTER_REGNUM + && REGNO (x) != FLAGS_REG + && REGNO (x) != FPSR_REG); if (ASSEMBLER_DIALECT == ASM_ATT || USER_LABEL_PREFIX[0] == 0) putc ('%', file); @@ -6235,8 +6415,7 @@ print_reg (rtx x, int code, FILE *file) from the normal registers. */ if (REX_INT_REG_P (x)) { - if (!TARGET_64BIT) - abort (); + gcc_assert (TARGET_64BIT); switch (code) { case 0: @@ -6291,7 +6470,7 @@ print_reg (rtx x, int code, FILE *file) fputs (qi_high_reg_name[REGNO (x)], file); break; default: - abort (); + gcc_unreachable (); } } @@ -6312,7 +6491,7 @@ get_some_local_dynamic_name (void) && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } static int @@ -6375,10 +6554,13 @@ print_operand (FILE *file, rtx x, int code) return; case 'A': - if (ASSEMBLER_DIALECT == ASM_ATT) - putc ('*', file); - else if (ASSEMBLER_DIALECT == ASM_INTEL) + switch (ASSEMBLER_DIALECT) { + case ASM_ATT: + putc ('*', file); + break; + + case ASM_INTEL: /* Intel syntax. For absolute addresses, registers should not be surrounded by braces. */ if (GET_CODE (x) != REG) @@ -6388,9 +6570,11 @@ print_operand (FILE *file, rtx x, int code) putc (']', file); return; } + break; + + default: + gcc_unreachable (); } - else - abort (); PRINT_OPERAND (file, x, 0); return; @@ -6475,7 +6659,7 @@ print_operand (FILE *file, rtx x, int code) return; default: - abort (); + gcc_unreachable (); } case 'b': @@ -6533,8 +6717,7 @@ print_operand (FILE *file, rtx x, int code) fputs ("ord", file); break; default: - abort (); - break; + gcc_unreachable (); } return; case 'O': @@ -6548,7 +6731,7 @@ print_operand (FILE *file, rtx x, int code) case SFmode: putc ('l', file); break; case DImode: case DFmode: putc ('q', file); break; - default: abort (); + default: gcc_unreachable (); } putc ('.', file); } @@ -6646,7 +6829,7 @@ print_operand (FILE *file, rtx x, int code) case 12: size = "XWORD"; break; case 16: size = "XMMWORD"; break; default: - abort (); + gcc_unreachable (); } /* Check for explicit size override (codes 'b', 'w' and 'k') */ @@ -6705,6 +6888,15 @@ print_operand (FILE *file, rtx x, int code) else { + /* We have patterns that allow zero sets of memory, for instance. + In 64-bit mode, we should probably support all 8-byte vectors, + since we can in fact encode that into an immediate. */ + if (GET_CODE (x) == CONST_VECTOR) + { + gcc_assert (x == CONST0_RTX (GET_MODE (x))); + x = const0_rtx; + } + if (code != 'P') { if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE) @@ -6738,9 +6930,9 @@ print_operand_address (FILE *file, rtx addr) struct ix86_address parts; rtx base, index, disp; int scale; + int ok = ix86_decompose_address (addr, &parts); - if (! ix86_decompose_address (addr, &parts)) - abort (); + gcc_assert (ok); base = parts.base; index = parts.index; @@ -6758,7 +6950,7 @@ print_operand_address (FILE *file, rtx addr) fputs ((parts.seg == SEG_FS ? "fs:" : "gs:"), file); break; default: - abort (); + gcc_unreachable (); } if (!base && !index) @@ -7018,8 +7210,8 @@ output_387_binary_op (rtx insn, rtx *operands) && (STACK_REG_P (operands[1]) || GET_CODE (operands[1]) == MEM))) && (STACK_TOP_P (operands[1]) || STACK_TOP_P (operands[2]))) ; /* ok */ - else if (!is_sse) - abort (); + else + gcc_assert (is_sse); #endif switch (GET_CODE (operands[3])) @@ -7061,7 +7253,7 @@ output_387_binary_op (rtx insn, rtx *operands) break; default: - abort (); + gcc_unreachable (); } if (is_sse) @@ -7196,7 +7388,7 @@ output_387_binary_op (rtx insn, rtx *operands) break; default: - abort (); + gcc_unreachable (); } strcat (buf, p); @@ -7241,7 +7433,7 @@ emit_i387_cw_initialization (rtx current_mode, rtx new_mode, int mode) break; default: - abort(); + gcc_unreachable (); } } else @@ -7271,7 +7463,7 @@ emit_i387_cw_initialization (rtx current_mode, rtx new_mode, int mode) break; default: - abort(); + gcc_unreachable (); } } @@ -7287,6 +7479,7 @@ output_fix_trunc (rtx insn, rtx *operands, int fisttp) { int stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; int dimode_p = GET_MODE (operands[0]) == DImode; + int round_mode = get_attr_i387_cw (insn); /* Jump through a hoop or two for DImode, since the hardware has no non-popping instruction. We used to do this a different way, but @@ -7294,22 +7487,21 @@ output_fix_trunc (rtx insn, rtx *operands, int fisttp) if ((dimode_p || fisttp) && !stack_top_dies) output_asm_insn ("fld\t%y1", operands); - if (!STACK_TOP_P (operands[1])) - abort (); - - if (GET_CODE (operands[0]) != MEM) - abort (); + gcc_assert (STACK_TOP_P (operands[1])); + gcc_assert (GET_CODE (operands[0]) == MEM); if (fisttp) output_asm_insn ("fisttp%z0\t%0", operands); else { - output_asm_insn ("fldcw\t%3", operands); + if (round_mode != I387_CW_ANY) + output_asm_insn ("fldcw\t%3", operands); if (stack_top_dies || dimode_p) output_asm_insn ("fistp%z0\t%0", operands); else output_asm_insn ("fist%z0\t%0", operands); - output_asm_insn ("fldcw\t%2", operands); + if (round_mode != I387_CW_ANY) + output_asm_insn ("fldcw\t%2", operands); } return ""; @@ -7350,8 +7542,7 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) return "comisd\t{%1, %0|%0, %1}"; } - if (! STACK_TOP_P (cmp_op0)) - abort (); + gcc_assert (STACK_TOP_P (cmp_op0)); stack_top_dies = find_regno_note (insn, REG_DEAD, FIRST_STACK_REG) != 0; @@ -7428,11 +7619,9 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p) mask |= unordered_p << 1; mask |= stack_top_dies; - if (mask >= 16) - abort (); + gcc_assert (mask < 16); ret = alt[mask]; - if (ret == NULL) - abort (); + gcc_assert (ret); return ret; } @@ -7443,14 +7632,12 @@ ix86_output_addr_vec_elt (FILE *file, int value) { const char *directive = ASM_LONG; - if (TARGET_64BIT) - { #ifdef ASM_QUAD - directive = ASM_QUAD; + if (TARGET_64BIT) + directive = ASM_QUAD; #else - abort (); + gcc_assert (!TARGET_64BIT); #endif - } fprintf (file, "%s%s%d\n", directive, LPREFIX, value); } @@ -7485,8 +7672,7 @@ ix86_expand_clear (rtx dest) rtx tmp; /* We play register width games, which are only valid after reload. */ - if (!reload_completed) - abort (); + gcc_assert (reload_completed); /* Avoid HImode and its attendant prefix byte. */ if (GET_MODE_SIZE (GET_MODE (dest)) < 4) @@ -7894,8 +8080,7 @@ ix86_expand_binary_operator (enum rtx_code code, enum machine_mode mode, { /* Reload doesn't know about the flags register, and doesn't know that it doesn't want to clobber it. We can only do this with PLUS. */ - if (code != PLUS) - abort (); + gcc_assert (code == PLUS); emit_insn (op); } else @@ -7983,8 +8168,7 @@ ix86_expand_unary_operator (enum rtx_code code, enum machine_mode mode, { /* Reload doesn't know about the flags register, and doesn't know that it doesn't want to clobber it. */ - if (code != NOT) - abort (); + gcc_assert (code == NOT); emit_insn (op); } else @@ -8298,10 +8482,8 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode) set = PATTERN (insn); if (GET_CODE (set) == PARALLEL) set = XVECEXP (set, 0, 0); - if (GET_CODE (set) != SET) - abort (); - if (GET_CODE (SET_SRC (set)) != COMPARE) - abort (); + gcc_assert (GET_CODE (set) == SET); + gcc_assert (GET_CODE (SET_SRC (set)) == COMPARE); set_mode = GET_MODE (SET_DEST (set)); switch (set_mode) @@ -8328,7 +8510,7 @@ ix86_match_ccmode (rtx insn, enum machine_mode req_mode) break; default: - abort (); + gcc_unreachable (); } return (GET_MODE (SET_SRC (set)) == set_mode); @@ -8410,7 +8592,7 @@ ix86_cc_mode (enum rtx_code code, rtx op0, rtx op1) case USE: return CCmode; default: - abort (); + gcc_unreachable (); } } @@ -8444,7 +8626,7 @@ ix86_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2) switch (m1) { default: - abort (); + gcc_unreachable (); case CCmode: case CCGCmode: @@ -8654,7 +8836,7 @@ ix86_fp_comparison_codes (enum rtx_code code, enum rtx_code *bypass_code, *second_code = UNORDERED; break; default: - abort (); + gcc_unreachable (); } if (!TARGET_IEEE_FP) { @@ -8696,7 +8878,7 @@ ix86_fp_comparison_arithmetics_cost (enum rtx_code code) return 6; break; default: - abort (); + gcc_unreachable (); } } @@ -8923,7 +9105,7 @@ ix86_expand_fp_compare (enum rtx_code code, rtx op0, rtx op1, rtx scratch, break; default: - abort (); + gcc_unreachable (); } } @@ -8946,7 +9128,12 @@ ix86_expand_compare (enum rtx_code code, rtx *second_test, rtx *bypass_test) if (bypass_test) *bypass_test = NULL_RTX; - if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) + if (ix86_compare_emitted) + { + ret = gen_rtx_fmt_ee (code, VOIDmode, ix86_compare_emitted, const0_rtx); + ix86_compare_emitted = NULL_RTX; + } + else if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) ret = ix86_expand_fp_compare (code, op0, op1, NULL_RTX, second_test, bypass_test); else @@ -9117,7 +9304,7 @@ ix86_expand_branch (enum rtx_code code, rtx label) case NE: code2 = UNKNOWN; break; default: - abort (); + gcc_unreachable (); } /* @@ -9146,7 +9333,7 @@ ix86_expand_branch (enum rtx_code code, rtx label) } default: - abort (); + gcc_unreachable (); } } @@ -9242,8 +9429,7 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) && !TARGET_64BIT) return 0; /* FAIL */ - if (GET_MODE (dest) != QImode) - abort (); + gcc_assert (GET_MODE (dest) == QImode); ret = ix86_expand_compare (code, &second_test, &bypass_test); PUT_MODE (ret, QImode); @@ -9259,8 +9445,7 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) rtx tmp2 = gen_reg_rtx (QImode); if (bypass_test) { - if (second_test) - abort (); + gcc_assert (!second_test); test = bypass_test; bypass = 1; PUT_CODE (test, reverse_condition_maybe_unordered (GET_CODE (test))); @@ -9275,10 +9460,13 @@ ix86_expand_setcc (enum rtx_code code, rtx dest) } /* Attach a REG_EQUAL note describing the comparison result. */ - equiv = simplify_gen_relational (code, QImode, - GET_MODE (ix86_compare_op0), - ix86_compare_op0, ix86_compare_op1); - set_unique_reg_note (get_last_insn (), REG_EQUAL, equiv); + if (ix86_compare_op0 && ix86_compare_op1) + { + equiv = simplify_gen_relational (code, QImode, + GET_MODE (ix86_compare_op0), + ix86_compare_op0, ix86_compare_op1); + set_unique_reg_note (get_last_insn (), REG_EQUAL, equiv); + } return 1; /* DONE */ } @@ -9405,8 +9593,7 @@ ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop) ix86_compare_op0 = op0; ix86_compare_op1 = op1; *pop = ix86_expand_compare (code, NULL, NULL); - if (GET_CODE (*pop) != LTU && GET_CODE (*pop) != GEU) - abort (); + gcc_assert (GET_CODE (*pop) == LTU || GET_CODE (*pop) == GEU); return true; } @@ -9922,6 +10109,193 @@ ix86_expand_int_movcc (rtx operands[]) return 1; /* DONE */ } +/* Swap, force into registers, or otherwise massage the two operands + to an sse comparison with a mask result. Thus we differ a bit from + ix86_prepare_fp_compare_args which expects to produce a flags result. + + The DEST operand exists to help determine whether to commute commutative + operators. The POP0/POP1 operands are updated in place. The new + comparison code is returned, or UNKNOWN if not implementable. */ + +static enum rtx_code +ix86_prepare_sse_fp_compare_args (rtx dest, enum rtx_code code, + rtx *pop0, rtx *pop1) +{ + rtx tmp; + + switch (code) + { + case LTGT: + case UNEQ: + /* We have no LTGT as an operator. We could implement it with + NE & ORDERED, but this requires an extra temporary. It's + not clear that it's worth it. */ + return UNKNOWN; + + case LT: + case LE: + case UNGT: + case UNGE: + /* These are supported directly. */ + break; + + case EQ: + case NE: + case UNORDERED: + case ORDERED: + /* For commutative operators, try to canonicalize the destination + operand to be first in the comparison - this helps reload to + avoid extra moves. */ + if (!dest || !rtx_equal_p (dest, *pop1)) + break; + /* FALLTHRU */ + + case GE: + case GT: + case UNLE: + case UNLT: + /* These are not supported directly. Swap the comparison operands + to transform into something that is supported. */ + tmp = *pop0; + *pop0 = *pop1; + *pop1 = tmp; + code = swap_condition (code); + break; + + default: + gcc_unreachable (); + } + + return code; +} + +/* Detect conditional moves that exactly match min/max operational + semantics. Note that this is IEEE safe, as long as we don't + interchange the operands. + + Returns FALSE if this conditional move doesn't match a MIN/MAX, + and TRUE if the operation is successful and instructions are emitted. */ + +static bool +ix86_expand_sse_fp_minmax (rtx dest, enum rtx_code code, rtx cmp_op0, + rtx cmp_op1, rtx if_true, rtx if_false) +{ + enum machine_mode mode; + bool is_min; + rtx tmp; + + if (code == LT) + ; + else if (code == UNGE) + { + tmp = if_true; + if_true = if_false; + if_false = tmp; + } + else + return false; + + if (rtx_equal_p (cmp_op0, if_true) && rtx_equal_p (cmp_op1, if_false)) + is_min = true; + else if (rtx_equal_p (cmp_op1, if_true) && rtx_equal_p (cmp_op0, if_false)) + is_min = false; + else + return false; + + mode = GET_MODE (dest); + + /* We want to check HONOR_NANS and HONOR_SIGNED_ZEROS here, + but MODE may be a vector mode and thus not appropriate. */ + if (!flag_finite_math_only || !flag_unsafe_math_optimizations) + { + int u = is_min ? UNSPEC_IEEE_MIN : UNSPEC_IEEE_MAX; + rtvec v; + + if_true = force_reg (mode, if_true); + v = gen_rtvec (2, if_true, if_false); + tmp = gen_rtx_UNSPEC (mode, v, u); + } + else + { + code = is_min ? SMIN : SMAX; + tmp = gen_rtx_fmt_ee (code, mode, if_true, if_false); + } + + emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + return true; +} + +/* Expand an sse vector comparison. Return the register with the result. */ + +static rtx +ix86_expand_sse_cmp (rtx dest, enum rtx_code code, rtx cmp_op0, rtx cmp_op1, + rtx op_true, rtx op_false) +{ + enum machine_mode mode = GET_MODE (dest); + rtx x; + + cmp_op0 = force_reg (mode, cmp_op0); + if (!nonimmediate_operand (cmp_op1, mode)) + cmp_op1 = force_reg (mode, cmp_op1); + + if (optimize + || reg_overlap_mentioned_p (dest, op_true) + || reg_overlap_mentioned_p (dest, op_false)) + dest = gen_reg_rtx (mode); + + x = gen_rtx_fmt_ee (code, mode, cmp_op0, cmp_op1); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + + return dest; +} + +/* Expand DEST = CMP ? OP_TRUE : OP_FALSE into a sequence of logical + operations. This is used for both scalar and vector conditional moves. */ + +static void +ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) +{ + enum machine_mode mode = GET_MODE (dest); + rtx t2, t3, x; + + if (op_false == CONST0_RTX (mode)) + { + op_true = force_reg (mode, op_true); + x = gen_rtx_AND (mode, cmp, op_true); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } + else if (op_true == CONST0_RTX (mode)) + { + op_false = force_reg (mode, op_false); + x = gen_rtx_NOT (mode, cmp); + x = gen_rtx_AND (mode, x, op_false); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } + else + { + op_true = force_reg (mode, op_true); + op_false = force_reg (mode, op_false); + + t2 = gen_reg_rtx (mode); + if (optimize) + t3 = gen_reg_rtx (mode); + else + t3 = dest; + + x = gen_rtx_AND (mode, op_true, cmp); + emit_insn (gen_rtx_SET (VOIDmode, t2, x)); + + x = gen_rtx_NOT (mode, cmp); + x = gen_rtx_AND (mode, x, op_false); + emit_insn (gen_rtx_SET (VOIDmode, t3, x)); + + x = gen_rtx_IOR (mode, t3, t2); + emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + } +} + +/* Expand a floating-point conditional move. Return true if successful. */ + int ix86_expand_fp_movcc (rtx operands[]) { @@ -9931,88 +10305,31 @@ ix86_expand_fp_movcc (rtx operands[]) if (TARGET_SSE_MATH && SSE_FLOAT_MODE_P (mode)) { - rtx cmp_op0, cmp_op1, if_true, if_false; - rtx clob; - enum machine_mode vmode, cmode; - bool is_minmax = false; - - cmp_op0 = ix86_compare_op0; - cmp_op1 = ix86_compare_op1; - if_true = operands[2]; - if_false = operands[3]; + enum machine_mode cmode; /* Since we've no cmove for sse registers, don't force bad register allocation just to gain access to it. Deny movcc when the comparison mode doesn't match the move mode. */ - cmode = GET_MODE (cmp_op0); + cmode = GET_MODE (ix86_compare_op0); if (cmode == VOIDmode) - cmode = GET_MODE (cmp_op1); + cmode = GET_MODE (ix86_compare_op1); if (cmode != mode) return 0; - /* We have no LTGT as an operator. We could implement it with - NE & ORDERED, but this requires an extra temporary. It's - not clear that it's worth it. */ - if (code == LTGT || code == UNEQ) + code = ix86_prepare_sse_fp_compare_args (operands[0], code, + &ix86_compare_op0, + &ix86_compare_op1); + if (code == UNKNOWN) return 0; - /* Massage condition to satisfy sse_comparison_operator. Try - to canonicalize the destination operand to be first in the - comparison - this helps reload to avoid extra moves. */ - if (!sse_comparison_operator (operands[1], VOIDmode) - || (COMMUTATIVE_P (operands[1]) - && rtx_equal_p (operands[0], cmp_op1))) - { - tmp = cmp_op0; - cmp_op0 = cmp_op1; - cmp_op1 = tmp; - code = swap_condition (code); - } - - /* Detect conditional moves that exactly match min/max operational - semantics. Note that this is IEEE safe, as long as we don't - interchange the operands. Which is why we keep this in the form - if an IF_THEN_ELSE instead of reducing to SMIN/SMAX. */ - if ((code == LT || code == UNGE) && REG_P (cmp_op0) && REG_P (cmp_op1)) - { - if (((cmp_op0 == if_true && cmp_op1 == if_false) - || (cmp_op0 == if_false && cmp_op1 == if_true))) - { - is_minmax = true; - if (code == UNGE) - { - code = LT; - tmp = if_true; - if_true = if_false; - if_false = tmp; - } - } - } - - if (mode == SFmode) - vmode = V4SFmode; - else if (mode == DFmode) - vmode = V2DFmode; - else - gcc_unreachable (); - - cmp_op0 = force_reg (mode, cmp_op0); - if (!nonimmediate_operand (cmp_op1, mode)) - cmp_op1 = force_reg (mode, cmp_op1); - - tmp = gen_rtx_fmt_ee (code, mode, cmp_op0, cmp_op1); - gcc_assert (sse_comparison_operator (tmp, VOIDmode)); - - tmp = gen_rtx_IF_THEN_ELSE (mode, tmp, if_true, if_false); - tmp = gen_rtx_SET (VOIDmode, operands[0], tmp); - - if (!is_minmax) - { - clob = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (vmode)); - tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, tmp, clob)); - } + if (ix86_expand_sse_fp_minmax (operands[0], code, ix86_compare_op0, + ix86_compare_op1, operands[2], + operands[3])) + return 1; - emit_insn (tmp); + tmp = ix86_expand_sse_cmp (operands[0], code, ix86_compare_op0, + ix86_compare_op1, operands[2], operands[3]); + ix86_expand_sse_movcc (operands[0], tmp, operands[2], operands[3]); return 1; } @@ -10026,8 +10343,7 @@ ix86_expand_fp_movcc (rtx operands[]) if (!fcmov_comparison_operator (compare_op, VOIDmode)) { - if (second_test != NULL || bypass_test != NULL) - abort (); + gcc_assert (!second_test && !bypass_test); tmp = gen_reg_rtx (QImode); ix86_expand_setcc (code, tmp); code = NE; @@ -10063,98 +10379,122 @@ ix86_expand_fp_movcc (rtx operands[]) return 1; } -void -ix86_split_sse_movcc (rtx operands[]) +/* Expand a floating-point vector conditional move; a vcond operation + rather than a movcc operation. */ + +bool +ix86_expand_fp_vcond (rtx operands[]) { - rtx dest, scratch, cmp, op_true, op_false, x; - enum machine_mode mode, vmode; + enum rtx_code code = GET_CODE (operands[3]); + rtx cmp; - /* Note that the operator CMP has been set up with matching constraints - such that dest is valid for the comparison. Unless one of the true - or false operands are zero, the true operand has already been placed - in SCRATCH. */ - dest = operands[0]; - scratch = operands[1]; - op_true = operands[2]; - op_false = operands[3]; - cmp = operands[4]; + code = ix86_prepare_sse_fp_compare_args (operands[0], code, + &operands[4], &operands[5]); + if (code == UNKNOWN) + return false; - mode = GET_MODE (dest); - vmode = GET_MODE (scratch); - - /* We need to make sure that the TRUE and FALSE operands are out of the - way of the destination. Marking the destination earlyclobber doesn't - work, since we want matching constraints for the actual comparison, so - at some point we always wind up having to do a copy ourselves here. - We very much prefer the TRUE value to be in SCRATCH. If it turns out - that FALSE overlaps DEST, then we invert the comparison so that we - still only have to do one move. */ - if (rtx_equal_p (op_false, dest)) - { - enum rtx_code code; - - if (rtx_equal_p (op_true, dest)) - { - /* ??? Really ought not happen. It means some optimizer managed - to prove the operands were identical, but failed to fold the - conditional move to a straight move. Do so here, because - otherwise we'll generate incorrect code. And since they're - both already in the destination register, nothing to do. */ - return; - } + if (ix86_expand_sse_fp_minmax (operands[0], code, operands[4], + operands[5], operands[1], operands[2])) + return true; - x = gen_rtx_REG (mode, REGNO (scratch)); - emit_move_insn (x, op_false); - op_false = op_true; - op_true = x; + cmp = ix86_expand_sse_cmp (operands[0], code, operands[4], operands[5], + operands[1], operands[2]); + ix86_expand_sse_movcc (operands[0], cmp, operands[1], operands[2]); + return true; +} - code = GET_CODE (cmp); - code = reverse_condition_maybe_unordered (code); - cmp = gen_rtx_fmt_ee (code, mode, XEXP (cmp, 0), XEXP (cmp, 1)); +/* Expand a signed integral vector conditional move. */ + +bool +ix86_expand_int_vcond (rtx operands[], bool unsignedp) +{ + enum machine_mode mode = GET_MODE (operands[0]); + enum rtx_code code = GET_CODE (operands[3]); + rtx cmp, x; + + if (unsignedp) + code = signed_condition (code); + if (code == NE || code == LE || code == GE) + { + /* Inverse of a supported code. */ + x = operands[1]; + operands[1] = operands[2]; + operands[2] = x; + code = reverse_condition (code); } - else if (op_true == CONST0_RTX (mode)) - ; - else if (op_false == CONST0_RTX (mode) && !rtx_equal_p (op_true, dest)) - ; - else + if (code == LT) { - x = gen_rtx_REG (mode, REGNO (scratch)); - emit_move_insn (x, op_true); - op_true = x; + /* Swap of a supported code. */ + x = operands[4]; + operands[4] = operands[5]; + operands[5] = x; + code = swap_condition (code); } + gcc_assert (code == EQ || code == GT); - emit_insn (gen_rtx_SET (VOIDmode, dest, cmp)); - dest = simplify_gen_subreg (vmode, dest, mode, 0); + /* Unlike floating-point, we can rely on the optimizers to have already + converted to MIN/MAX expressions, so we don't have to handle that. */ - if (op_false == CONST0_RTX (mode)) - { - op_true = simplify_gen_subreg (vmode, op_true, mode, 0); - x = gen_rtx_AND (vmode, dest, op_true); - emit_insn (gen_rtx_SET (VOIDmode, dest, x)); - } - else + /* Unsigned GT is not directly supported. We can zero-extend QI and + HImode elements to the next wider element size, use a signed compare, + then repack. For three extra instructions, this is definitely a win. */ + if (code == GT && unsignedp) { - op_false = simplify_gen_subreg (vmode, op_false, mode, 0); + rtx o0l, o0h, o1l, o1h, cl, ch, zero; + enum machine_mode wider; + rtx (*unpackl) (rtx, rtx, rtx); + rtx (*unpackh) (rtx, rtx, rtx); + rtx (*pack) (rtx, rtx, rtx); - if (op_true == CONST0_RTX (mode)) + switch (mode) { - x = gen_rtx_NOT (vmode, dest); - x = gen_rtx_AND (vmode, x, op_false); - emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + case V16QImode: + wider = V8HImode; + unpackl = gen_sse2_punpcklbw; + unpackh = gen_sse2_punpckhbw; + pack = gen_sse2_packsswb; + break; + case V8HImode: + wider = V4SImode; + unpackl = gen_sse2_punpcklwd; + unpackh = gen_sse2_punpckhwd; + pack = gen_sse2_packssdw; + break; + default: + gcc_unreachable (); } - else - { - x = gen_rtx_AND (vmode, scratch, dest); - emit_insn (gen_rtx_SET (VOIDmode, scratch, x)); - x = gen_rtx_NOT (vmode, dest); - x = gen_rtx_AND (vmode, x, op_false); - emit_insn (gen_rtx_SET (VOIDmode, dest, x)); + operands[4] = force_reg (mode, operands[4]); + operands[5] = force_reg (mode, operands[5]); - x = gen_rtx_IOR (vmode, dest, scratch); - emit_insn (gen_rtx_SET (VOIDmode, dest, x)); - } + o0l = gen_reg_rtx (wider); + o0h = gen_reg_rtx (wider); + o1l = gen_reg_rtx (wider); + o1h = gen_reg_rtx (wider); + cl = gen_reg_rtx (wider); + ch = gen_reg_rtx (wider); + cmp = gen_reg_rtx (mode); + zero = force_reg (mode, CONST0_RTX (mode)); + + emit_insn (unpackl (gen_lowpart (mode, o0l), operands[4], zero)); + emit_insn (unpackh (gen_lowpart (mode, o0h), operands[4], zero)); + emit_insn (unpackl (gen_lowpart (mode, o1l), operands[5], zero)); + emit_insn (unpackh (gen_lowpart (mode, o1h), operands[5], zero)); + + x = gen_rtx_GT (wider, o0l, o1l); + emit_insn (gen_rtx_SET (VOIDmode, cl, x)); + + x = gen_rtx_GT (wider, o0h, o1h); + emit_insn (gen_rtx_SET (VOIDmode, ch, x)); + + emit_insn (pack (cmp, cl, ch)); } + else + cmp = ix86_expand_sse_cmp (operands[0], code, operands[4], operands[5], + operands[1], operands[2]); + + ix86_expand_sse_movcc (operands[0], cmp, operands[1], operands[2]); + return true; } /* Expand conditional increment or decrement using adb/sbb instructions. @@ -10214,7 +10554,7 @@ ix86_expand_int_addcc (rtx operands[]) emit_insn (gen_subdi3_carry_rex64 (operands[0], operands[2], val, compare_op)); break; default: - abort (); + gcc_unreachable (); } } else @@ -10234,7 +10574,7 @@ ix86_expand_int_addcc (rtx operands[]) emit_insn (gen_adddi3_carry_rex64 (operands[0], operands[2], val, compare_op)); break; default: - abort (); + gcc_unreachable (); } } return 1; /* DONE */ @@ -10256,10 +10596,8 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) else size = (GET_MODE_SIZE (mode) + 4) / 8; - if (GET_CODE (operand) == REG && MMX_REGNO_P (REGNO (operand))) - abort (); - if (size < 2 || size > 3) - abort (); + gcc_assert (GET_CODE (operand) != REG || !MMX_REGNO_P (REGNO (operand))); + gcc_assert (size >= 2 && size <= 3); /* Optimize constant pool reference to immediates. This is used by fp moves, that force all constants to memory to allow combining. */ @@ -10273,14 +10611,28 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) if (GET_CODE (operand) == MEM && !offsettable_memref_p (operand)) { /* The only non-offsetable memories we handle are pushes. */ - if (! push_operand (operand, VOIDmode)) - abort (); - + int ok = push_operand (operand, VOIDmode); + + gcc_assert (ok); + operand = copy_rtx (operand); PUT_MODE (operand, Pmode); parts[0] = parts[1] = parts[2] = operand; + return size; } - else if (!TARGET_64BIT) + + if (GET_CODE (operand) == CONST_VECTOR) + { + enum machine_mode imode = int_mode_for_mode (mode); + /* Caution: if we looked through a constant pool memory above, + the operand may actually have a different mode now. That's + ok, since we want to pun this all the way back to an integer. */ + operand = simplify_subreg (imode, operand, GET_MODE (operand), 0); + gcc_assert (operand != NULL); + mode = imode; + } + + if (!TARGET_64BIT) { if (mode == DImode) split_di (&operand, 1, &parts[0], &parts[1]); @@ -10288,8 +10640,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) { if (REG_P (operand)) { - if (!reload_completed) - abort (); + gcc_assert (reload_completed); parts[0] = gen_rtx_REG (SImode, REGNO (operand) + 0); parts[1] = gen_rtx_REG (SImode, REGNO (operand) + 1); if (size == 3) @@ -10319,13 +10670,13 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) REAL_VALUE_TO_TARGET_DOUBLE (r, l); break; default: - abort (); + gcc_unreachable (); } parts[1] = gen_int_mode (l[1], SImode); parts[0] = gen_int_mode (l[0], SImode); } else - abort (); + gcc_unreachable (); } } else @@ -10337,8 +10688,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) enum machine_mode upper_mode = mode==XFmode ? SImode : DImode; if (REG_P (operand)) { - if (!reload_completed) - abort (); + gcc_assert (reload_completed); parts[0] = gen_rtx_REG (DImode, REGNO (operand) + 0); parts[1] = gen_rtx_REG (upper_mode, REGNO (operand) + 1); } @@ -10378,7 +10728,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode) parts[1] = immed_double_const (l[2], l[3], DImode); } else - abort (); + gcc_unreachable (); } } @@ -10426,9 +10776,9 @@ ix86_split_long_move (rtx operands[]) /* The only non-offsettable memory we handle is push. */ if (push_operand (operands[0], VOIDmode)) push = 1; - else if (GET_CODE (operands[0]) == MEM - && ! offsettable_memref_p (operands[0])) - abort (); + else + gcc_assert (GET_CODE (operands[0]) != MEM + || offsettable_memref_p (operands[0])); nparts = ix86_split_to_parts (operands[1], part[1], GET_MODE (operands[0])); ix86_split_to_parts (operands[0], part[0], GET_MODE (operands[0])); @@ -10509,12 +10859,20 @@ ix86_split_long_move (rtx operands[]) moving of second half of TFmode value. */ if (GET_MODE (part[1][1]) == SImode) { - if (GET_CODE (part[1][1]) == MEM) - part[1][1] = adjust_address (part[1][1], DImode, 0); - else if (REG_P (part[1][1])) - part[1][1] = gen_rtx_REG (DImode, REGNO (part[1][1])); - else - abort (); + switch (GET_CODE (part[1][1])) + { + case MEM: + part[1][1] = adjust_address (part[1][1], DImode, 0); + break; + + case REG: + part[1][1] = gen_rtx_REG (DImode, REGNO (part[1][1])); + break; + + default: + gcc_unreachable (); + } + if (GET_MODE (part[1][0]) == SImode) part[1][0] = part[1][1]; } @@ -10917,8 +11275,7 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp) else counter_mode = DImode; - if (counter_mode != SImode && counter_mode != DImode) - abort (); + gcc_assert (counter_mode == SImode || counter_mode == DImode); destreg = copy_to_mode_reg (Pmode, XEXP (dst, 0)); if (destreg != XEXP (dst, 0)) @@ -10928,9 +11285,20 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp) src = replace_equiv_address_nv (src, srcreg); /* When optimizing for size emit simple rep ; movsb instruction for - counts not divisible by 4. */ + counts not divisible by 4, except when (movsl;)*(movsw;)?(movsb;)? + sequence is shorter than mov{b,l} $count, %{ecx,cl}; rep; movsb. + Sice of (movsl;)*(movsw;)?(movsb;)? sequence is + count / 4 + (count & 3), the other sequence is either 4 or 7 bytes, + but we don't know whether upper 24 (resp. 56) bits of %ecx will be + known to be zero or not. The rep; movsb sequence causes higher + register pressure though, so take that into account. */ - if ((!optimize || optimize_size) && (count == 0 || (count & 0x03))) + if ((!optimize || optimize_size) + && (count == 0 + || ((count & 0x03) + && (!optimize_size + || count > 5 * 4 + || (count & 3) + count / 4 > 6)))) { emit_insn (gen_cld ()); countreg = ix86_zero_extend_to_Pmode (count_exp); @@ -10956,19 +11324,36 @@ ix86_expand_movmem (rtx dst, rtx src, rtx count_exp, rtx align_exp) emit_insn (gen_cld ()); if (count & ~(size - 1)) { - countreg = copy_to_mode_reg (counter_mode, - GEN_INT ((count >> (size == 4 ? 2 : 3)) - & (TARGET_64BIT ? -1 : 0x3fffffff))); - countreg = ix86_zero_extend_to_Pmode (countreg); + if ((TARGET_SINGLE_STRINGOP || optimize_size) && count < 5 * 4) + { + enum machine_mode movs_mode = size == 4 ? SImode : DImode; - destexp = gen_rtx_ASHIFT (Pmode, countreg, - GEN_INT (size == 4 ? 2 : 3)); - srcexp = gen_rtx_PLUS (Pmode, destexp, srcreg); - destexp = gen_rtx_PLUS (Pmode, destexp, destreg); + while (offset < (count & ~(size - 1))) + { + srcmem = adjust_automodify_address_nv (src, movs_mode, + srcreg, offset); + dstmem = adjust_automodify_address_nv (dst, movs_mode, + destreg, offset); + emit_insn (gen_strmov (destreg, dstmem, srcreg, srcmem)); + offset += size; + } + } + else + { + countreg = GEN_INT ((count >> (size == 4 ? 2 : 3)) + & (TARGET_64BIT ? -1 : 0x3fffffff)); + countreg = copy_to_mode_reg (counter_mode, countreg); + countreg = ix86_zero_extend_to_Pmode (countreg); + + destexp = gen_rtx_ASHIFT (Pmode, countreg, + GEN_INT (size == 4 ? 2 : 3)); + srcexp = gen_rtx_PLUS (Pmode, destexp, srcreg); + destexp = gen_rtx_PLUS (Pmode, destexp, destreg); - emit_insn (gen_rep_mov (destreg, dst, srcreg, src, - countreg, destexp, srcexp)); - offset = count & ~(size - 1); + emit_insn (gen_rep_mov (destreg, dst, srcreg, src, + countreg, destexp, srcexp)); + offset = count & ~(size - 1); + } } if (size == 8 && (count & 0x04)) { @@ -11702,8 +12087,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, if (pop == const0_rtx) pop = NULL; - if (TARGET_64BIT && pop) - abort (); + gcc_assert (!TARGET_64BIT || !pop); #if TARGET_MACHO if (flag_pic && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF) @@ -11780,8 +12164,7 @@ assign_386_stack_local (enum machine_mode mode, int n) { struct stack_local_entry *s; - if (n < 0 || n >= MAX_386_STACK_LOCALS) - abort (); + gcc_assert (n >= 0 && n < MAX_386_STACK_LOCALS); for (s = ix86_stack_locals; s; s = s->next) if (s->mode == mode && s->n == n) @@ -11825,6 +12208,7 @@ memory_address_length (rtx addr) struct ix86_address parts; rtx base, index, disp; int len; + int ok; if (GET_CODE (addr) == PRE_DEC || GET_CODE (addr) == POST_INC @@ -11832,8 +12216,13 @@ memory_address_length (rtx addr) || GET_CODE (addr) == POST_MODIFY) return 0; - if (! ix86_decompose_address (addr, &parts)) - abort (); + ok = ix86_decompose_address (addr, &parts); + gcc_assert (ok); + + if (parts.base && GET_CODE (parts.base) == SUBREG) + parts.base = SUBREG_REG (parts.base); + if (parts.index && GET_CODE (parts.index) == SUBREG) + parts.index = SUBREG_REG (parts.index); base = parts.base; index = parts.index; @@ -11899,8 +12288,7 @@ ix86_attr_length_immediate_default (rtx insn, int shortform) for (i = recog_data.n_operands - 1; i >= 0; --i) if (CONSTANT_P (recog_data.operand[i])) { - if (len) - abort (); + gcc_assert (!len); if (shortform && GET_CODE (recog_data.operand[i]) == CONST_INT && CONST_OK_FOR_LETTER_P (INTVAL (recog_data.operand[i]), 'K')) @@ -11938,18 +12326,11 @@ ix86_attr_length_address_default (rtx insn) if (get_attr_type (insn) == TYPE_LEA) { rtx set = PATTERN (insn); - if (GET_CODE (set) == SET) - ; - else if (GET_CODE (set) == PARALLEL - && GET_CODE (XVECEXP (set, 0, 0)) == SET) + + if (GET_CODE (set) == PARALLEL) set = XVECEXP (set, 0, 0); - else - { -#ifdef ENABLE_CHECKING - abort (); -#endif - return 0; - } + + gcc_assert (GET_CODE (set) == SET); return memory_address_length (SET_SRC (set)); } @@ -12044,13 +12425,12 @@ ix86_agi_dependant (rtx insn, rtx dep_insn, enum attr_type insn_type) && TARGET_PENTIUM) { addr = PATTERN (insn); - if (GET_CODE (addr) == SET) - ; - else if (GET_CODE (addr) == PARALLEL - && GET_CODE (XVECEXP (addr, 0, 0)) == SET) + + if (GET_CODE (addr) == PARALLEL) addr = XVECEXP (addr, 0, 0); - else - abort (); + + gcc_assert (GET_CODE (addr) == SET); + addr = SET_SRC (addr); } else @@ -12422,8 +12802,7 @@ x86_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) emit_move_insn (gen_rtx_MEM (QImode, plus_constant (tramp, offset+2)), gen_int_mode (0xe3, QImode)); offset += 3; - if (offset > TRAMPOLINE_SIZE) - abort (); + gcc_assert (offset <= TRAMPOLINE_SIZE); } #ifdef ENABLE_EXECUTE_STACK @@ -13599,7 +13978,7 @@ ix86_init_mmx_sse_builtins (void) break; default: - abort (); + gcc_unreachable (); } /* Override for comparisons. */ @@ -13927,11 +14306,10 @@ ix86_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target) op1 = gen_lowpart (TImode, x); } - /* In case the insn wants input operands in modes different from - the result, abort. */ - if ((GET_MODE (op0) != mode0 && GET_MODE (op0) != VOIDmode) - || (GET_MODE (op1) != mode1 && GET_MODE (op1) != VOIDmode)) - abort (); + /* The insn must want input operands in the same modes as the + result. */ + gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode) + && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode)); if (!(*insn_data[icode].operand[1].predicate) (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); @@ -14725,8 +15103,8 @@ rtx ix86_force_to_memory (enum machine_mode mode, rtx operand) { rtx result; - if (!reload_completed) - abort (); + + gcc_assert (reload_completed); if (TARGET_RED_ZONE) { result = gen_rtx_MEM (mode, @@ -14752,7 +15130,7 @@ ix86_force_to_memory (enum machine_mode mode, rtx operand) operand)); break; default: - abort (); + gcc_unreachable (); } result = gen_rtx_MEM (mode, stack_pointer_rtx); } @@ -14792,7 +15170,7 @@ ix86_force_to_memory (enum machine_mode mode, rtx operand) operand)); break; default: - abort (); + gcc_unreachable (); } result = gen_rtx_MEM (mode, stack_pointer_rtx); } @@ -14912,8 +15290,7 @@ ix86_secondary_memory_needed (enum reg_class class1, enum reg_class class2, || MAYBE_MMX_CLASS_P (class1) != MMX_CLASS_P (class1) || MAYBE_MMX_CLASS_P (class2) != MMX_CLASS_P (class2)) { - if (strict) - abort (); + gcc_assert (!strict); return true; } @@ -14951,6 +15328,41 @@ ix86_secondary_memory_needed (enum reg_class class1, enum reg_class class2, return false; } +/* Return true if the registers in CLASS cannot represent the change from + modes FROM to TO. */ + +bool +ix86_cannot_change_mode_class (enum machine_mode from, enum machine_mode to, + enum reg_class class) +{ + if (from == to) + return false; + + /* x87 registers can't do subreg at all, as all values are reformated + to extended precision. */ + if (MAYBE_FLOAT_CLASS_P (class)) + return true; + + if (MAYBE_SSE_CLASS_P (class) || MAYBE_MMX_CLASS_P (class)) + { + /* Vector registers do not support QI or HImode loads. If we don't + disallow a change to these modes, reload will assume it's ok to + drop the subreg from (subreg:SI (reg:HI 100) 0). This affects + the vec_dupv4hi pattern. */ + if (GET_MODE_SIZE (from) < 4) + return true; + + /* Vector registers do not support subreg with nonzero offsets, which + are otherwise valid for integer registers. Since we can't see + whether we have a nonzero offset from here, prohibit all + nonparadoxical subregs changing size. */ + if (GET_MODE_SIZE (to) < GET_MODE_SIZE (from)) + return true; + } + + return false; +} + /* Return the cost of moving data from a register in class CLASS1 to one in class CLASS2. @@ -15035,15 +15447,30 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode) return (VALID_MMX_REG_MODE (mode) || VALID_MMX_REG_MODE_3DNOW (mode)); } - /* We handle both integer and floats in the general purpose registers. - In future we should be able to handle vector modes as well. */ - if (!VALID_INT_MODE_P (mode) && !VALID_FP_MODE_P (mode)) - return 0; - /* Take care for QImode values - they can be in non-QI regs, but then - they do cause partial register stalls. */ - if (regno < 4 || mode != QImode || TARGET_64BIT) + + if (mode == QImode) + { + /* Take care for QImode values - they can be in non-QI regs, + but then they do cause partial register stalls. */ + if (regno < 4 || TARGET_64BIT) + return 1; + if (!TARGET_PARTIAL_REG_STALL) + return 1; + return reload_in_progress || reload_completed; + } + /* We handle both integer and floats in the general purpose registers. */ + else if (VALID_INT_MODE_P (mode)) + return 1; + else if (VALID_FP_MODE_P (mode)) return 1; - return reload_in_progress || reload_completed || !TARGET_PARTIAL_REG_STALL; + /* Lots of MMX code casts 8 byte vector modes to DImode. If we then go + on to use that value in smaller contexts, this can easily force a + pseudo to be allocated to GENERAL_REGS. Since this is no worse than + supporting DImode, allow it. */ + else if (VALID_MMX_REG_MODE_3DNOW (mode) || VALID_MMX_REG_MODE (mode)) + return 1; + + return 0; } /* A subroutine of ix86_modes_tieable_p. Return true if MODE is a @@ -15096,12 +15523,14 @@ ix86_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2) /* If MODE2 is only appropriate for an SSE register, then tie with any other mode acceptable to SSE registers. */ - if (SSE_REG_MODE_P (mode2)) + if (GET_MODE_SIZE (mode2) >= 8 + && ix86_hard_regno_mode_ok (FIRST_SSE_REG, mode2)) return ix86_hard_regno_mode_ok (FIRST_SSE_REG, mode1); /* If MODE2 is appropriate for an MMX (or SSE) register, then tie with any other mode acceptable to MMX registers. */ - if (MMX_REG_MODE_P (mode2)) + if (GET_MODE_SIZE (mode2) == 8 + && ix86_hard_regno_mode_ok (FIRST_MMX_REG, mode2)) return ix86_hard_regno_mode_ok (FIRST_MMX_REG, mode1); return false; @@ -15606,10 +16035,6 @@ x86_order_regs_for_local_alloc (void) reg_alloc_order [pos++] = 0; } -#ifndef TARGET_USE_MS_BITFIELD_LAYOUT -#define TARGET_USE_MS_BITFIELD_LAYOUT 0 -#endif - /* Handle a "ms_struct" or "gcc_struct" attribute; arguments as in struct attribute_spec.handler. */ static tree @@ -15629,7 +16054,7 @@ ix86_handle_struct_attribute (tree *node, tree name, if (!(type && (TREE_CODE (*type) == RECORD_TYPE || TREE_CODE (*type) == UNION_TYPE))) { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -15638,7 +16063,7 @@ ix86_handle_struct_attribute (tree *node, tree name, || ((is_attribute_p ("gcc_struct", name) && lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (*type))))) { - warning ("%qs incompatible attribute ignored", + warning (0, "%qs incompatible attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -15649,7 +16074,7 @@ ix86_handle_struct_attribute (tree *node, tree name, static bool ix86_ms_bitfield_layout_p (tree record_type) { - return (TARGET_USE_MS_BITFIELD_LAYOUT && + return (TARGET_MS_BITFIELD_LAYOUT && !lookup_attribute ("gcc_struct", TYPE_ATTRIBUTES (record_type))) || lookup_attribute ("ms_struct", TYPE_ATTRIBUTES (record_type)); } @@ -16020,8 +16445,7 @@ ix86_avoid_jump_misspredicts (void) isjump = 0; nbytes -= min_insn_size (start); } - if (njumps < 0) - abort (); + gcc_assert (njumps >= 0); if (dump_file) fprintf (dump_file, "Interval %i to %i has %i bytes\n", INSN_UID (start), INSN_UID (insn), nbytes); @@ -16146,9 +16570,7 @@ x86_emit_floatuns (rtx operands[2]) enum machine_mode mode, inmode; inmode = GET_MODE (operands[1]); - if (inmode != SImode - && inmode != DImode) - abort (); + gcc_assert (inmode == SImode || inmode == DImode); out = operands[0]; in = force_reg (inmode, operands[1]); @@ -16628,32 +17050,35 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt) break; case 1: - /* tmp = op0 = A B C D */ + /* tmp = target = A B C D */ tmp = copy_to_reg (target); - - /* op0 = C C D D */ + /* target = A A B B */ emit_insn (gen_sse_unpcklps (target, target, target)); - - /* op0 = C C D X */ + /* target = X A B B */ ix86_expand_vector_set (false, target, val, 0); - - /* op0 = A B X D */ + /* target = A X C D */ emit_insn (gen_sse_shufps_1 (target, target, tmp, GEN_INT (1), GEN_INT (0), GEN_INT (2+4), GEN_INT (3+4))); return; case 2: + /* tmp = target = A B C D */ tmp = copy_to_reg (target); - ix86_expand_vector_set (false, target, val, 0); + /* tmp = X B C D */ + ix86_expand_vector_set (false, tmp, val, 0); + /* target = A B X D */ emit_insn (gen_sse_shufps_1 (target, target, tmp, GEN_INT (0), GEN_INT (1), GEN_INT (0+4), GEN_INT (3+4))); return; case 3: + /* tmp = target = A B C D */ tmp = copy_to_reg (target); - ix86_expand_vector_set (false, target, val, 0); + /* tmp = X B C D */ + ix86_expand_vector_set (false, tmp, val, 0); + /* target = A B X D */ emit_insn (gen_sse_shufps_1 (target, target, tmp, GEN_INT (0), GEN_INT (1), GEN_INT (2+4), GEN_INT (0+4))); @@ -16880,7 +17305,9 @@ ix86_vector_mode_supported_p (enum machine_mode mode) with the old cc0-based compiler. */ static tree -ix86_md_asm_clobbers (tree clobbers) +ix86_md_asm_clobbers (tree outputs ATTRIBUTE_UNUSED, + tree inputs ATTRIBUTE_UNUSED, + tree clobbers) { clobbers = tree_cons (NULL_TREE, build_string (5, "flags"), clobbers); diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 765eff8b9fd..d65ce49a4c5 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -88,10 +88,6 @@ struct processor_costs { extern const struct processor_costs *ix86_cost; -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - /* Macros used in the machine description to test the flags. */ /* configure can arrange to make this 2, to force a 486. */ @@ -104,104 +100,25 @@ extern int target_flags; #endif #endif -/* Masks for the -m switches */ -#define MASK_80387 0x00000001 /* Hardware floating point */ -#define MASK_RTD 0x00000002 /* Use ret that pops args */ -#define MASK_ALIGN_DOUBLE 0x00000004 /* align doubles to 2 word boundary */ -#define MASK_SVR3_SHLIB 0x00000008 /* Uninit locals into bss */ -#define MASK_IEEE_FP 0x00000010 /* IEEE fp comparisons */ -#define MASK_FLOAT_RETURNS 0x00000020 /* Return float in st(0) */ -#define MASK_NO_FANCY_MATH_387 0x00000040 /* Disable sin, cos, sqrt */ -#define MASK_OMIT_LEAF_FRAME_POINTER 0x080 /* omit leaf frame pointers */ -#define MASK_STACK_PROBE 0x00000100 /* Enable stack probing */ -#define MASK_NO_ALIGN_STROPS 0x00000200 /* Enable aligning of string ops. */ -#define MASK_INLINE_ALL_STROPS 0x00000400 /* Inline stringops in all cases */ -#define MASK_NO_PUSH_ARGS 0x00000800 /* Use push instructions */ -#define MASK_ACCUMULATE_OUTGOING_ARGS 0x00001000/* Accumulate outgoing args */ -#define MASK_MMX 0x00002000 /* Support MMX regs/builtins */ -#define MASK_SSE 0x00004000 /* Support SSE regs/builtins */ -#define MASK_SSE2 0x00008000 /* Support SSE2 regs/builtins */ -#define MASK_SSE3 0x00010000 /* Support SSE3 regs/builtins */ -#define MASK_3DNOW 0x00020000 /* Support 3Dnow builtins */ -#define MASK_3DNOW_A 0x00040000 /* Support Athlon 3Dnow builtins */ -#define MASK_128BIT_LONG_DOUBLE 0x00080000 /* long double size is 128bit */ -#define MASK_64BIT 0x00100000 /* Produce 64bit code */ -#define MASK_MS_BITFIELD_LAYOUT 0x00200000 /* Use native (MS) bitfield layout */ -#define MASK_TLS_DIRECT_SEG_REFS 0x00400000 /* Avoid adding %gs:0 */ - -/* Unused: 0x03e0000 */ - -/* ... overlap with subtarget options starts by 0x04000000. */ -#define MASK_NO_RED_ZONE 0x04000000 /* Do not use red zone */ - -/* Use the floating point instructions */ -#define TARGET_80387 (target_flags & MASK_80387) - -/* Compile using ret insn that pops args. - This will not work unless you use prototypes at least - for all functions that can take varying numbers of args. */ -#define TARGET_RTD (target_flags & MASK_RTD) - -/* Align doubles to a two word boundary. This breaks compatibility with - the published ABI's for structures containing doubles, but produces - faster code on the pentium. */ -#define TARGET_ALIGN_DOUBLE (target_flags & MASK_ALIGN_DOUBLE) - -/* Use push instructions to save outgoing args. */ -#define TARGET_PUSH_ARGS (!(target_flags & MASK_NO_PUSH_ARGS)) - -/* Accumulate stack adjustments to prologue/epilogue. */ -#define TARGET_ACCUMULATE_OUTGOING_ARGS \ - (target_flags & MASK_ACCUMULATE_OUTGOING_ARGS) - -/* Put uninitialized locals into bss, not data. - Meaningful only on svr3. */ -#define TARGET_SVR3_SHLIB (target_flags & MASK_SVR3_SHLIB) - -/* Use IEEE floating point comparisons. These handle correctly the cases - where the result of a comparison is unordered. Normally SIGFPE is - generated in such cases, in which case this isn't needed. */ -#define TARGET_IEEE_FP (target_flags & MASK_IEEE_FP) - -/* Functions that return a floating point value may return that value - in the 387 FPU or in 386 integer registers. If set, this flag causes - the 387 to be used, which is compatible with most calling conventions. */ -#define TARGET_FLOAT_RETURNS_IN_80387 (target_flags & MASK_FLOAT_RETURNS) - -/* Long double is 128bit instead of 96bit, even when only 80bits are used. - This mode wastes cache, but avoid misaligned data accesses and simplifies - address calculations. */ -#define TARGET_128BIT_LONG_DOUBLE (target_flags & MASK_128BIT_LONG_DOUBLE) - -/* Disable generation of FP sin, cos and sqrt operations for 387. - This is because FreeBSD lacks these in the math-emulator-code */ -#define TARGET_NO_FANCY_MATH_387 (target_flags & MASK_NO_FANCY_MATH_387) - -/* Generate 387 floating point intrinsics for the current target. */ -#define TARGET_USE_FANCY_MATH_387 (! TARGET_NO_FANCY_MATH_387) - -/* Don't create frame pointers for leaf functions */ -#define TARGET_OMIT_LEAF_FRAME_POINTER \ - (target_flags & MASK_OMIT_LEAF_FRAME_POINTER) - -/* Debug GO_IF_LEGITIMATE_ADDRESS */ -#define TARGET_DEBUG_ADDR (ix86_debug_addr_string != 0) - -/* Debug FUNCTION_ARG macros */ -#define TARGET_DEBUG_ARG (ix86_debug_arg_string != 0) +#ifndef TARGET_FPMATH_DEFAULT +#define TARGET_FPMATH_DEFAULT \ + (TARGET_64BIT && TARGET_SSE ? FPMATH_SSE : FPMATH_387) +#endif + +#define TARGET_FLOAT_RETURNS_IN_80387 TARGET_FLOAT_RETURNS /* 64bit Sledgehammer mode. For libgcc2 we make sure this is a compile-time constant. */ #ifdef IN_LIBGCC2 +#undef TARGET_64BIT #ifdef __x86_64__ #define TARGET_64BIT 1 #else #define TARGET_64BIT 0 #endif #else -#ifdef TARGET_BI_ARCH -#define TARGET_64BIT (target_flags & MASK_64BIT) -#else +#ifndef TARGET_BI_ARCH +#undef TARGET_64BIT #if TARGET_64BIT_DEFAULT #define TARGET_64BIT 1 #else @@ -213,9 +130,6 @@ extern int target_flags; #define HAS_LONG_COND_BRANCH 1 #define HAS_LONG_UNCOND_BRANCH 1 -/* Avoid adding %gs:0 in TLS references; use %gs:address directly. */ -#define TARGET_TLS_DIRECT_SEG_REFS (target_flags & MASK_TLS_DIRECT_SEG_REFS) - #define TARGET_386 (ix86_tune == PROCESSOR_I386) #define TARGET_486 (ix86_tune == PROCESSOR_I486) #define TARGET_PENTIUM (ix86_tune == PROCESSOR_PENTIUM) @@ -248,6 +162,7 @@ extern const int x86_sse_typeless_stores, x86_sse_load0_by_pxor; extern const int x86_use_ffreep; extern const int x86_inter_unit_moves, x86_schedule; extern const int x86_use_bt; +extern const int x86_cmpxchg, x86_xadd; extern int x86_prefetch_sse; #define TARGET_USE_LEAVE (x86_use_leave & TUNEMASK) @@ -304,139 +219,17 @@ extern int x86_prefetch_sse; #define TARGET_SCHEDULE (x86_schedule & TUNEMASK) #define TARGET_USE_BT (x86_use_bt & TUNEMASK) -#define TARGET_STACK_PROBE (target_flags & MASK_STACK_PROBE) - -#define TARGET_ALIGN_STRINGOPS (!(target_flags & MASK_NO_ALIGN_STROPS)) -#define TARGET_INLINE_ALL_STRINGOPS (target_flags & MASK_INLINE_ALL_STROPS) - #define ASSEMBLER_DIALECT (ix86_asm_dialect) -#define TARGET_SSE ((target_flags & MASK_SSE) != 0) -#define TARGET_SSE2 ((target_flags & MASK_SSE2) != 0) -#define TARGET_SSE3 ((target_flags & MASK_SSE3) != 0) #define TARGET_SSE_MATH ((ix86_fpmath & FPMATH_SSE) != 0) #define TARGET_MIX_SSE_I387 ((ix86_fpmath & FPMATH_SSE) \ && (ix86_fpmath & FPMATH_387)) -#define TARGET_MMX ((target_flags & MASK_MMX) != 0) -#define TARGET_3DNOW ((target_flags & MASK_3DNOW) != 0) -#define TARGET_3DNOW_A ((target_flags & MASK_3DNOW_A) != 0) - -#define TARGET_RED_ZONE (!(target_flags & MASK_NO_RED_ZONE)) - -#define TARGET_USE_MS_BITFIELD_LAYOUT (target_flags & MASK_MS_BITFIELD_LAYOUT) #define TARGET_GNU_TLS (ix86_tls_dialect == TLS_DIALECT_GNU) #define TARGET_SUN_TLS (ix86_tls_dialect == TLS_DIALECT_SUN) -/* WARNING: Do not mark empty strings for translation, as calling - gettext on an empty string does NOT return an empty - string. */ - - -#define TARGET_SWITCHES \ -{ { "80387", MASK_80387, N_("Use hardware fp") }, \ - { "no-80387", -MASK_80387, N_("Do not use hardware fp") }, \ - { "hard-float", MASK_80387, N_("Use hardware fp") }, \ - { "soft-float", -MASK_80387, N_("Do not use hardware fp") }, \ - { "no-soft-float", MASK_80387, N_("Use hardware fp") }, \ - { "386", 0, "" /*Deprecated.*/}, \ - { "486", 0, "" /*Deprecated.*/}, \ - { "pentium", 0, "" /*Deprecated.*/}, \ - { "pentiumpro", 0, "" /*Deprecated.*/}, \ - { "intel-syntax", 0, "" /*Deprecated.*/}, \ - { "no-intel-syntax", 0, "" /*Deprecated.*/}, \ - { "rtd", MASK_RTD, \ - N_("Alternate calling convention") }, \ - { "no-rtd", -MASK_RTD, \ - N_("Use normal calling convention") }, \ - { "align-double", MASK_ALIGN_DOUBLE, \ - N_("Align some doubles on dword boundary") }, \ - { "no-align-double", -MASK_ALIGN_DOUBLE, \ - N_("Align doubles on word boundary") }, \ - { "svr3-shlib", MASK_SVR3_SHLIB, \ - N_("Uninitialized locals in .bss") }, \ - { "no-svr3-shlib", -MASK_SVR3_SHLIB, \ - N_("Uninitialized locals in .data") }, \ - { "ieee-fp", MASK_IEEE_FP, \ - N_("Use IEEE math for fp comparisons") }, \ - { "no-ieee-fp", -MASK_IEEE_FP, \ - N_("Do not use IEEE math for fp comparisons") }, \ - { "fp-ret-in-387", MASK_FLOAT_RETURNS, \ - N_("Return values of functions in FPU registers") }, \ - { "no-fp-ret-in-387", -MASK_FLOAT_RETURNS , \ - N_("Do not return values of functions in FPU registers")}, \ - { "no-fancy-math-387", MASK_NO_FANCY_MATH_387, \ - N_("Do not generate sin, cos, sqrt for FPU") }, \ - { "fancy-math-387", -MASK_NO_FANCY_MATH_387, \ - N_("Generate sin, cos, sqrt for FPU")}, \ - { "omit-leaf-frame-pointer", MASK_OMIT_LEAF_FRAME_POINTER, \ - N_("Omit the frame pointer in leaf functions") }, \ - { "no-omit-leaf-frame-pointer",-MASK_OMIT_LEAF_FRAME_POINTER, "" }, \ - { "stack-arg-probe", MASK_STACK_PROBE, \ - N_("Enable stack probing") }, \ - { "no-stack-arg-probe", -MASK_STACK_PROBE, "" }, \ - { "windows", 0, 0 /* undocumented */ }, \ - { "dll", 0, 0 /* undocumented */ }, \ - { "align-stringops", -MASK_NO_ALIGN_STROPS, \ - N_("Align destination of the string operations") }, \ - { "no-align-stringops", MASK_NO_ALIGN_STROPS, \ - N_("Do not align destination of the string operations") }, \ - { "inline-all-stringops", MASK_INLINE_ALL_STROPS, \ - N_("Inline all known string operations") }, \ - { "no-inline-all-stringops", -MASK_INLINE_ALL_STROPS, \ - N_("Do not inline all known string operations") }, \ - { "push-args", -MASK_NO_PUSH_ARGS, \ - N_("Use push instructions to save outgoing arguments") }, \ - { "no-push-args", MASK_NO_PUSH_ARGS, \ - N_("Do not use push instructions to save outgoing arguments") }, \ - { "accumulate-outgoing-args", MASK_ACCUMULATE_OUTGOING_ARGS, \ - N_("Use push instructions to save outgoing arguments") }, \ - { "no-accumulate-outgoing-args",-MASK_ACCUMULATE_OUTGOING_ARGS, \ - N_("Do not use push instructions to save outgoing arguments") }, \ - { "mmx", MASK_MMX, \ - N_("Support MMX built-in functions") }, \ - { "no-mmx", -(MASK_MMX|MASK_3DNOW|MASK_3DNOW_A), \ - N_("Do not support MMX built-in functions") }, \ - { "3dnow", MASK_3DNOW, \ - N_("Support 3DNow! built-in functions") }, \ - { "no-3dnow", -(MASK_3DNOW|MASK_3DNOW_A), \ - N_("Do not support 3DNow! built-in functions") }, \ - { "sse", MASK_SSE, \ - N_("Support MMX and SSE built-in functions and code generation") }, \ - { "no-sse", -(MASK_SSE|MASK_SSE2|MASK_SSE3), \ - N_("Do not support MMX and SSE built-in functions and code generation") },\ - { "sse2", MASK_SSE2, \ - N_("Support MMX, SSE and SSE2 built-in functions and code generation") }, \ - { "no-sse2", -(MASK_SSE2|MASK_SSE3), \ - N_("Do not support MMX, SSE and SSE2 built-in functions and code generation") }, \ - { "sse3", MASK_SSE3, \ - N_("Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation") },\ - { "no-sse3", -MASK_SSE3, \ - N_("Do not support MMX, SSE, SSE2 and SSE3 built-in functions and code generation") },\ - { "128bit-long-double", MASK_128BIT_LONG_DOUBLE, \ - N_("sizeof(long double) is 16") }, \ - { "96bit-long-double", -MASK_128BIT_LONG_DOUBLE, \ - N_("sizeof(long double) is 12") }, \ - { "64", MASK_64BIT, \ - N_("Generate 64bit x86-64 code") }, \ - { "32", -MASK_64BIT, \ - N_("Generate 32bit i386 code") }, \ - { "ms-bitfields", MASK_MS_BITFIELD_LAYOUT, \ - N_("Use native (MS) bitfield layout") }, \ - { "no-ms-bitfields", -MASK_MS_BITFIELD_LAYOUT, \ - N_("Use gcc default bitfield layout") }, \ - { "red-zone", -MASK_NO_RED_ZONE, \ - N_("Use red-zone in the x86-64 code") }, \ - { "no-red-zone", MASK_NO_RED_ZONE, \ - N_("Do not use red-zone in the x86-64 code") }, \ - { "tls-direct-seg-refs", MASK_TLS_DIRECT_SEG_REFS, \ - N_("Use direct references against %gs when accessing tls data") }, \ - { "no-tls-direct-seg-refs", -MASK_TLS_DIRECT_SEG_REFS, \ - N_("Do not use direct references against %gs when accessing tls data") }, \ - SUBTARGET_SWITCHES \ - { "", \ - TARGET_DEFAULT | TARGET_64BIT_DEFAULT | TARGET_SUBTARGET_DEFAULT \ - | TARGET_TLS_DIRECT_SEG_REFS_DEFAULT, 0 }} +#define TARGET_CMPXCHG (x86_cmpxchg & (1 << ix86_arch)) +#define TARGET_XADD (x86_xadd & (1 << ix86_arch)) #ifndef TARGET_64BIT_DEFAULT #define TARGET_64BIT_DEFAULT 0 @@ -459,48 +252,6 @@ extern int x86_prefetch_sse; with the rounding mode forced to 53 bits. */ #define TARGET_96_ROUND_53_LONG_DOUBLE 0 -/* This macro is similar to `TARGET_SWITCHES' but defines names of - command options that have values. Its definition is an - initializer with a subgrouping for each command option. - - Each subgrouping contains a string constant, that defines the - fixed part of the option name, and the address of a variable. The - variable, type `char *', is set to the variable part of the given - option if the fixed part matches. The actual option name is made - by appending `-m' to the specified name. */ -#define TARGET_OPTIONS \ -{ { "tune=", &ix86_tune_string, \ - N_("Schedule code for given CPU"), 0}, \ - { "fpmath=", &ix86_fpmath_string, \ - N_("Generate floating point mathematics using given instruction set"), 0},\ - { "arch=", &ix86_arch_string, \ - N_("Generate code for given CPU"), 0}, \ - { "regparm=", &ix86_regparm_string, \ - N_("Number of registers used to pass integer arguments"), 0},\ - { "align-loops=", &ix86_align_loops_string, \ - N_("Loop code aligned to this power of 2"), 0}, \ - { "align-jumps=", &ix86_align_jumps_string, \ - N_("Jump targets are aligned to this power of 2"), 0}, \ - { "align-functions=", &ix86_align_funcs_string, \ - N_("Function starts are aligned to this power of 2"), 0}, \ - { "preferred-stack-boundary=", \ - &ix86_preferred_stack_boundary_string, \ - N_("Attempt to keep stack aligned to this power of 2"), 0}, \ - { "branch-cost=", &ix86_branch_cost_string, \ - N_("Branches are this expensive (1-5, arbitrary units)"), 0},\ - { "cmodel=", &ix86_cmodel_string, \ - N_("Use given x86-64 code model"), 0}, \ - { "debug-arg", &ix86_debug_arg_string, \ - "" /* Undocumented. */, 0}, \ - { "debug-addr", &ix86_debug_addr_string, \ - "" /* Undocumented. */, 0}, \ - { "asm=", &ix86_asm_string, \ - N_("Use given assembler dialect"), 0}, \ - { "tls-dialect=", &ix86_tls_dialect_string, \ - N_("Use given thread-local storage dialect"), 0}, \ - SUBTARGET_OPTIONS \ -} - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -512,10 +263,6 @@ extern int x86_prefetch_sse; #define OVERRIDE_OPTIONS override_options () -/* These are meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES -#define SUBTARGET_OPTIONS - /* Define this to change the optimizations performed by default. */ #define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ optimization_options ((LEVEL), (SIZE)) @@ -1033,14 +780,14 @@ do { \ int i; \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ if (TEST_HARD_REG_BIT (reg_class_contents[(int)MMX_REGS], i)) \ - fixed_regs[i] = call_used_regs[i] = 1; \ + fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; \ } \ if (! TARGET_SSE) \ { \ int i; \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ if (TEST_HARD_REG_BIT (reg_class_contents[(int)SSE_REGS], i)) \ - fixed_regs[i] = call_used_regs[i] = 1; \ + fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; \ } \ if (! TARGET_80387 && ! TARGET_FLOAT_RETURNS_IN_80387) \ { \ @@ -1049,7 +796,15 @@ do { \ COPY_HARD_REG_SET (x, reg_class_contents[(int)FLOAT_REGS]); \ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) \ if (TEST_HARD_REG_BIT (x, i)) \ - fixed_regs[i] = call_used_regs[i] = 1; \ + fixed_regs[i] = call_used_regs[i] = 1, reg_names[i] = ""; \ + } \ + if (! TARGET_64BIT) \ + { \ + int i; \ + for (i = FIRST_REX_INT_REG; i <= LAST_REX_INT_REG; i++) \ + reg_names[i] = ""; \ + for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++) \ + reg_names[i] = ""; \ } \ } while (0) @@ -1089,7 +844,7 @@ do { \ /* ??? No autovectorization into MMX or 3DNOW until we can reliably place emms and femms instructions. */ -#define UNITS_PER_SIMD_WORD (TARGET_SSE ? 16 : 0) +#define UNITS_PER_SIMD_WORD (TARGET_SSE ? 16 : UNITS_PER_WORD) #define VALID_FP_MODE_P(MODE) \ ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \ @@ -1109,11 +864,6 @@ do { \ || (MODE) == V8HImode || (MODE) == V2DFmode || (MODE) == V2DImode \ || (MODE) == V4SFmode || (MODE) == V4SImode) -/* Return true for modes passed in MMX registers. */ -#define MMX_REG_MODE_P(MODE) \ - ((MODE) == V8QImode || (MODE) == V4HImode || (MODE) == V2SImode \ - || (MODE) == V2SFmode) - /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */ #define HARD_REGNO_MODE_OK(REGNO, MODE) \ @@ -1183,7 +933,7 @@ do { \ This is computed in `reload', in reload1.c. */ #define FRAME_POINTER_REQUIRED ix86_frame_pointer_required () -/* Override this in other tm.h files to cope with various OS losage +/* Override this in other tm.h files to cope with various OS lossage requiring a frame pointer. */ #ifndef SUBTARGET_FRAME_POINTER_REQUIRED #define SUBTARGET_FRAME_POINTER_REQUIRED 0 @@ -1596,19 +1346,10 @@ enum reg_class || ((CLASS) == FP_TOP_REG) \ || ((CLASS) == FP_SECOND_REG)) -/* Return a class of registers that cannot change FROM mode to TO mode. +/* Return a class of registers that cannot change FROM mode to TO mode. */ - x87 registers can't do subreg as all values are reformated to extended - precision. XMM registers does not support with nonzero offsets equal - to 4, 8 and 12 otherwise valid for integer registers. Since we can't - determine these, prohibit all nonparadoxical subregs changing size. */ - -#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ - (GET_MODE_SIZE (TO) < GET_MODE_SIZE (FROM) \ - ? reg_classes_intersect_p (FLOAT_SSE_REGS, (CLASS)) \ - || MAYBE_MMX_CLASS_P (CLASS) \ - : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \ - ? reg_classes_intersect_p (FLOAT_REGS, (CLASS)) : 0) +#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \ + ix86_cannot_change_mode_class (FROM, TO, CLASS) /* Stack layout; function entry, exit and calling. */ @@ -1698,7 +1439,7 @@ enum reg_class If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ #define FUNCTION_VALUE(VALTYPE, FUNC) \ - ix86_function_value (VALTYPE) + ix86_function_value (VALTYPE, FUNC) #define FUNCTION_VALUE_REGNO_P(N) \ ix86_function_value_regno_p (N) @@ -1738,6 +1479,8 @@ typedef struct ix86_args { int mmx_nregs; /* # mmx registers available for passing */ int mmx_regno; /* next available mmx register number */ int maybe_vaarg; /* true for calls to possibly vardic fncts. */ + int float_in_sse; /* true if in 32-bit mode SFmode/DFmode should + be passed in SSE registers. */ } CUMULATIVE_ARGS; /* Initialize a variable CUM of type CUMULATIVE_ARGS @@ -2205,7 +1948,7 @@ do { \ /* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */ -/* In order to refer to the first 8 regs as 32 bit regs prefix an "e" +/* In order to refer to the first 8 regs as 32 bit regs, prefix an "e". For non floating point regs, the following are the HImode names. For float regs, the stack top is sometimes referred to as "%st(0)" @@ -2230,9 +1973,7 @@ do { \ { "rax", 0 }, { "rdx", 1 }, { "rcx", 2 }, { "rbx", 3 }, \ { "rsi", 4 }, { "rdi", 5 }, { "rbp", 6 }, { "rsp", 7 }, \ { "al", 0 }, { "dl", 1 }, { "cl", 2 }, { "bl", 3 }, \ - { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 }, \ - { "mm0", 8}, { "mm1", 9}, { "mm2", 10}, { "mm3", 11}, \ - { "mm4", 12}, { "mm5", 13}, { "mm6", 14}, { "mm7", 15} } + { "ah", 0 }, { "dh", 1 }, { "ch", 2 }, { "bh", 3 } } /* Note we are omitting these since currently I don't know how to get gcc to use these, since they want the same but different @@ -2403,7 +2144,6 @@ enum fpmath_unit }; extern enum fpmath_unit ix86_fpmath; -extern const char *ix86_fpmath_string; enum tls_dialect { @@ -2412,7 +2152,6 @@ enum tls_dialect }; extern enum tls_dialect ix86_tls_dialect; -extern const char *ix86_tls_dialect_string; enum cmodel { CM_32, /* The traditional 32-bit ABI. */ @@ -2424,7 +2163,6 @@ enum cmodel { }; extern enum cmodel ix86_cmodel; -extern const char *ix86_cmodel_string; /* Size of the RED_ZONE area. */ #define RED_ZONE_SIZE 128 @@ -2436,31 +2174,16 @@ enum asm_dialect { ASM_INTEL }; -extern const char *ix86_asm_string; extern enum asm_dialect ix86_asm_dialect; - -extern int ix86_regparm; -extern const char *ix86_regparm_string; - extern unsigned int ix86_preferred_stack_boundary; -extern const char *ix86_preferred_stack_boundary_string; - extern int ix86_branch_cost; -extern const char *ix86_branch_cost_string; - -extern const char *ix86_debug_arg_string; -extern const char *ix86_debug_addr_string; - -/* Obsoleted by -f options. Remove before 3.2 ships. */ -extern const char *ix86_align_loops_string; -extern const char *ix86_align_jumps_string; -extern const char *ix86_align_funcs_string; /* Smallest class containing REGNO. */ extern enum reg_class const regclass_map[FIRST_PSEUDO_REGISTER]; extern rtx ix86_compare_op0; /* operand 0 for comparisons */ extern rtx ix86_compare_op1; /* operand 1 for comparisons */ +extern rtx ix86_compare_emitted; /* To properly truncate FP values into integers, we need to set i387 control word. We can't emit proper mode switching code before reload, as spills diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index e168d112933..9ae0ae9925f 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -74,52 +74,56 @@ ; Other random patterns (UNSPEC_SCAS 20) - (UNSPEC_SIN 21) - (UNSPEC_COS 22) - (UNSPEC_FNSTSW 24) - (UNSPEC_SAHF 25) - (UNSPEC_FSTCW 26) - (UNSPEC_ADD_CARRY 27) - (UNSPEC_FLDCW 28) + (UNSPEC_FNSTSW 21) + (UNSPEC_SAHF 22) + (UNSPEC_FSTCW 23) + (UNSPEC_ADD_CARRY 24) + (UNSPEC_FLDCW 25) + (UNSPEC_REP 26) + (UNSPEC_EH_RETURN 27) ; For SSE/MMX support: - (UNSPEC_FIX 30) - (UNSPEC_FIX_NOTRUNC 31) - (UNSPEC_MASKMOV 32) - (UNSPEC_MOVMSK 33) - (UNSPEC_MOVNT 34) - (UNSPEC_MOVA 38) - (UNSPEC_MOVU 39) - (UNSPEC_SHUFFLE 41) - (UNSPEC_RCP 42) - (UNSPEC_RSQRT 43) - (UNSPEC_SFENCE 44) - (UNSPEC_NOP 45) ; prevents combiner cleverness - (UNSPEC_PAVGUSB 49) - (UNSPEC_PFRCP 50) - (UNSPEC_PFRCPIT1 51) - (UNSPEC_PFRCPIT2 52) - (UNSPEC_PFRSQRT 53) - (UNSPEC_PFRSQIT1 54) - (UNSPEC_PSHUFLW 55) - (UNSPEC_PSHUFHW 56) - (UNSPEC_MFENCE 59) - (UNSPEC_LFENCE 60) - (UNSPEC_PSADBW 61) - (UNSPEC_ADDSUB 71) - (UNSPEC_HADD 72) - (UNSPEC_HSUB 73) - (UNSPEC_MOVSHDUP 74) - (UNSPEC_MOVSLDUP 75) - (UNSPEC_LDQQU 76) - (UNSPEC_MOVDDUP 77) + (UNSPEC_FIX_NOTRUNC 30) + (UNSPEC_MASKMOV 31) + (UNSPEC_MOVMSK 32) + (UNSPEC_MOVNT 33) + (UNSPEC_MOVU 34) + (UNSPEC_RCP 35) + (UNSPEC_RSQRT 36) + (UNSPEC_SFENCE 37) + (UNSPEC_NOP 38) ; prevents combiner cleverness + (UNSPEC_PFRCP 39) + (UNSPEC_PFRCPIT1 40) + (UNSPEC_PFRCPIT2 41) + (UNSPEC_PFRSQRT 42) + (UNSPEC_PFRSQIT1 43) + (UNSPEC_MFENCE 44) + (UNSPEC_LFENCE 45) + (UNSPEC_PSADBW 46) + (UNSPEC_LDQQU 47) + + ; Generic math support + (UNSPEC_COPYSIGN 50) + (UNSPEC_IEEE_MIN 51) ; not commutative + (UNSPEC_IEEE_MAX 52) ; not commutative ; x87 Floating point - (UNSPEC_FPATAN 65) - (UNSPEC_FYL2X 66) - (UNSPEC_FYL2XP1 67) - (UNSPEC_FRNDINT 68) - (UNSPEC_F2XM1 69) + (UNSPEC_SIN 60) + (UNSPEC_COS 61) + (UNSPEC_FPATAN 62) + (UNSPEC_FYL2X 63) + (UNSPEC_FYL2XP1 64) + (UNSPEC_FRNDINT 65) + (UNSPEC_FIST 66) + (UNSPEC_F2XM1 67) + + ; x87 Rounding + (UNSPEC_FRNDINT_FLOOR 70) + (UNSPEC_FRNDINT_CEIL 71) + (UNSPEC_FRNDINT_TRUNC 72) + (UNSPEC_FRNDINT_MASK_PM 73) + (UNSPEC_FIST_FLOOR 74) + (UNSPEC_FIST_CEIL 75) ; x87 Double output FP (UNSPEC_SINCOS_COS 80) @@ -134,32 +138,23 @@ (UNSPEC_FPREM_U 89) (UNSPEC_FPREM1_F 90) (UNSPEC_FPREM1_U 91) - - ; x87 Rounding - (UNSPEC_FRNDINT_FLOOR 96) - (UNSPEC_FRNDINT_CEIL 97) - (UNSPEC_FRNDINT_TRUNC 98) - (UNSPEC_FRNDINT_MASK_PM 99) - - ; REP instruction - (UNSPEC_REP 75) - - (UNSPEC_EH_RETURN 76) - - (UNSPEC_COPYSIGN 100) ]) (define_constants [(UNSPECV_BLOCKAGE 0) - (UNSPECV_STACK_PROBE 10) - (UNSPECV_EMMS 31) - (UNSPECV_LDMXCSR 37) - (UNSPECV_STMXCSR 40) - (UNSPECV_FEMMS 46) - (UNSPECV_CLFLUSH 57) - (UNSPECV_ALIGN 68) - (UNSPECV_MONITOR 69) - (UNSPECV_MWAIT 70) + (UNSPECV_STACK_PROBE 1) + (UNSPECV_EMMS 2) + (UNSPECV_LDMXCSR 3) + (UNSPECV_STMXCSR 4) + (UNSPECV_FEMMS 5) + (UNSPECV_CLFLUSH 6) + (UNSPECV_ALIGN 7) + (UNSPECV_MONITOR 8) + (UNSPECV_MWAIT 9) + (UNSPECV_CMPXCHG_1 10) + (UNSPECV_CMPXCHG_2 11) + (UNSPECV_XCHG 12) + (UNSPECV_LOCK 13) ]) ;; Registers by name. @@ -243,7 +238,7 @@ (const_int 1) ] (symbol_ref "/* Update immediate_length and other attributes! */ - abort(),1"))) + gcc_unreachable (),1"))) ;; The (bounding maximum) length of an instruction address. (define_attr "length_address" "" @@ -1183,8 +1178,7 @@ return "lea{l}\t{%1, %0|%0, %1}"; default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort(); + gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); return "mov{l}\t{%1, %0|%0, %1}"; } } @@ -1467,8 +1461,7 @@ switch (get_attr_type (insn)) { case TYPE_IMOVX: - if (!ANY_QI_REG_P (operands[1]) && GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (ANY_QI_REG_P (operands[1]) || GET_CODE (operands[1]) == MEM); return "movz{bl|x}\t{%1, %k0|%k0, %1}"; default: if (get_attr_mode (insn) == MODE_SI) @@ -1526,8 +1519,7 @@ rtx op0, op1, op2; op0 = operands[0]; op1 = operands[1]; op2 = operands[2]; - if (reg_overlap_mentioned_p (op2, op0)) - abort (); + gcc_assert (!reg_overlap_mentioned_p (op2, op0)); if (! q_regs_operand (op1, QImode)) { emit_insn (gen_movqi (op2, op1)); @@ -1984,8 +1976,7 @@ case TYPE_LEA: return "lea{q}\t{%a1, %0|%0, %a1}"; default: - if (flag_pic && !LEGITIMATE_PIC_OPERAND_P (operands[1])) - abort (); + gcc_assert (!flag_pic || LEGITIMATE_PIC_OPERAND_P (operands[1])); if (get_attr_mode (insn) == MODE_SI) return "mov{l}\t{%k1, %k0|%k0, %k1}"; else if (which_alternative == 2) @@ -2126,7 +2117,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "ssemov,ssemov,ssemov") @@ -2171,7 +2162,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "*,*,ssemov,ssemov,ssemov") @@ -2211,15 +2202,9 @@ (match_operand:SF 1 "general_no_elim_operand" "f#rx,rFm#fx,x#rf"))] "!TARGET_64BIT" { - switch (which_alternative) - { - case 1: - return "push{l}\t%1"; - - default: - /* This insn should be already split before reg-stack. */ - abort (); - } + /* Anything else should be already split before reg-stack. */ + gcc_assert (which_alternative == 1); + return "push{l}\t%1"; } [(set_attr "type" "multi,push,multi") (set_attr "mode" "SF,SI,SF")]) @@ -2229,15 +2214,9 @@ (match_operand:SF 1 "nonmemory_no_elim_operand" "f#rx,rF#fx,x#rf"))] "TARGET_64BIT" { - switch (which_alternative) - { - case 1: - return "push{q}\t%q1"; - - default: - /* This insn should be already split before reg-stack. */ - abort (); - } + /* Anything else should be already split before reg-stack. */ + gcc_assert (which_alternative == 1); + return "push{q}\t%q1"; } [(set_attr "type" "multi,push,multi") (set_attr "mode" "SF,DI,SF")]) @@ -2319,7 +2298,7 @@ return "movq\t{%1, %0|%0, %1}"; default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,fmov,imov,imov,ssemov,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov") @@ -2390,7 +2369,7 @@ "!TARGET_64BIT && !TARGET_INTEGER_DFMODE_MOVES" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "DF,SI,SI,DF")]) @@ -2401,7 +2380,7 @@ "TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "DF,SI,DF")]) @@ -2473,7 +2452,7 @@ case MODE_TI: return "pxor\t%0, %0"; default: - abort (); + gcc_unreachable (); } case 6: case 7: @@ -2495,11 +2474,11 @@ case MODE_V2SF: return "movlps\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } default: - abort(); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov") @@ -2594,7 +2573,7 @@ case MODE_TI: return "pxor\t%0, %0"; default: - abort (); + gcc_unreachable (); } case 6: case 7: @@ -2616,11 +2595,11 @@ case MODE_V2SF: return "movlps\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } default: - abort(); + gcc_unreachable(); } } [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov") @@ -2723,7 +2702,7 @@ "optimize_size" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "XF,SI,SI")]) @@ -2734,7 +2713,7 @@ "!optimize_size" { /* This insn should be already split before reg-stack. */ - abort (); + gcc_unreachable (); } [(set_attr "type" "multi") (set_attr "mode" "XF,SI")]) @@ -2793,8 +2772,9 @@ case 3: case 4: return "#"; + default: + gcc_unreachable (); } - abort(); } [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) @@ -2826,8 +2806,10 @@ case 3: case 4: return "#"; + + default: + gcc_unreachable (); } - abort(); } [(set_attr "type" "fmov,fmov,fmov,multi,multi") (set_attr "mode" "XF,XF,XF,SI,SI")]) @@ -2927,7 +2909,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "*,*,ssemov,ssemov,ssemov") @@ -3542,7 +3524,7 @@ return "cvtss2sd\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,ssecvt") @@ -3575,7 +3557,7 @@ return "fst%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3614,7 +3596,7 @@ return "fstp%z0\t%y0\n\tfld%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3653,7 +3635,7 @@ return "fstp%z0\t%y0"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov") @@ -3712,7 +3694,7 @@ case 2: return "cvtsd2ss\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,fmov,ssecvt") @@ -3757,7 +3739,7 @@ case 2: return "cvtsd2ss\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,multi,ssecvt") @@ -3780,12 +3762,28 @@ case 1: return "#"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "fmov,multi") (set_attr "mode" "SF")]) +(define_insn "*truncdfsf2_i387_1" + [(set (match_operand:SF 0 "memory_operand" "=m") + (float_truncate:SF + (match_operand:DF 1 "register_operand" "f")))] + "TARGET_80387 + && !(TARGET_SSE2 && TARGET_SSE_MATH) + && !TARGET_MIX_SSE_I387" +{ + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; +} + [(set_attr "type" "fmov") + (set_attr "mode" "SF")]) + (define_split [(set (match_operand:SF 0 "register_operand" "") (float_truncate:SF @@ -3826,16 +3824,11 @@ (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))] "TARGET_MIX_SSE_I387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi,multi") (set_attr "mode" "SF")]) @@ -3857,16 +3850,11 @@ (clobber (match_operand:SF 2 "memory_operand" "=X,m,m"))] "TARGET_80387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort (); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi") (set_attr "mode" "SF")]) @@ -3932,17 +3920,11 @@ (clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))] "TARGET_SSE2 && TARGET_MIX_SSE_I387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort(); - } - abort (); + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi,multi") (set_attr "mode" "DF")]) @@ -3964,16 +3946,11 @@ (clobber (match_operand:DF 2 "memory_operand" "=X,m,m"))] "TARGET_80387" { - switch (which_alternative) - { - case 0: - if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) - return "fstp%z0\t%y0"; - else - return "fst%z0\t%y0"; - default: - abort (); - } + gcc_assert (!which_alternative); + if (find_regno_note (insn, REG_DEAD, REGNO (operands[1]))) + return "fstp%z0\t%y0"; + else + return "fst%z0\t%y0"; } [(set_attr "type" "fmov,multi,multi") (set_attr "mode" "DF")]) @@ -5039,18 +5016,17 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ @@ -5110,18 +5086,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* ???? We ought to handle there the 32bit case too - do we need new constraint? */ /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5160,18 +5135,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort (); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* ???? We ought to handle there the 32bit case too - do we need new constraint? */ /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5216,14 +5190,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{q}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{q}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5259,18 +5233,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{q}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{q}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{q}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5307,18 +5280,17 @@ return "lea{l}\t{%a2, %0|%0, %a2}"; case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ @@ -5394,10 +5366,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5459,18 +5432,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5510,10 +5482,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5549,18 +5522,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5598,10 +5570,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{l}\t%k0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%k0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%k0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5644,14 +5617,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{l}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5684,18 +5657,17 @@ switch (get_attr_type (insn)) { case TYPE_INCDEC: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (operands[2] == const1_rtx) return "inc{l}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{l}\t%0"; else - abort(); + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{l}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if (GET_CODE (operands[2]) == CONST_INT @@ -5742,9 +5714,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5781,9 +5755,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5821,9 +5797,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5858,9 +5836,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5896,14 +5876,14 @@ case TYPE_INCDEC: if (operands[2] == constm1_rtx) return "inc{w}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{w}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{w}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. Exceptions: -128 encodes smaller than 128, so swap sign and op. */ if ((INTVAL (operands[2]) == -128 @@ -5936,9 +5916,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{w}\t%0"; - else if (operands[2] == constm1_rtx) - return "dec{w}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return "dec{w}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -5985,9 +5967,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return widen ? "inc{l}\t%k0" : "inc{b}\t%0"; - else if (operands[2] == constm1_rtx) - return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6031,9 +6015,11 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return widen ? "inc{l}\t%k0" : "inc{b}\t%0"; - else if (operands[2] == constm1_rtx) - return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx); + return widen ? "dec{l}\t%k0" : "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. @@ -6074,9 +6060,11 @@ case TYPE_INCDEC: if (operands[1] == const1_rtx) return "inc{b}\t%0"; - else if (operands[1] == constm1_rtx) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[1] == constm1_rtx); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subl $4,%eax' rather than `addl $-4, %eax'. */ @@ -6115,11 +6103,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6151,11 +6141,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6190,14 +6182,14 @@ || (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255)) return "inc{b}\t%0"; - else if (operands[2] == const1_rtx) - return "dec{b}\t%0"; else - abort(); + { + gcc_assert (operands[2] == const1_rtx); + return "dec{b}\t%0"; + } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (INTVAL (operands[2]) < 0) { operands[2] = GEN_INT (-INTVAL (operands[2])); @@ -6228,11 +6220,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%0"; + } default: /* Make things pretty and `subb $4,%al' rather than `addb $-4, %al'. */ @@ -6270,11 +6264,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%h0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%h0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%h0"; + } default: return "add{b}\t{%2, %h0|%h0, %2}"; @@ -6304,11 +6300,13 @@ case TYPE_INCDEC: if (operands[2] == const1_rtx) return "inc{b}\t%h0"; - else if (operands[2] == constm1_rtx - || (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) == 255)) - return "dec{b}\t%h0"; - abort(); + else + { + gcc_assert (operands[2] == constm1_rtx + || (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) == 255)); + return "dec{b}\t%h0"; + } default: return "add{b}\t{%2, %h0|%h0, %2}"; @@ -7330,8 +7328,7 @@ } else { - if (true_regnum (operands[1])) - abort(); + gcc_assert (!true_regnum (operands[1])); operands[4] = operands[1]; } }) @@ -7414,8 +7411,7 @@ } else { - if (true_regnum (operands[1])) - abort(); + gcc_assert (!true_regnum (operands[1])); operands[4] = operands[1]; } }) @@ -7909,14 +7905,14 @@ { enum machine_mode mode; - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); if (INTVAL (operands[2]) == 0xff) mode = QImode; - else if (INTVAL (operands[2]) == 0xffff) - mode = HImode; else - abort (); + { + gcc_assert (INTVAL (operands[2]) == 0xffff); + mode = HImode; + } operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) @@ -7926,8 +7922,7 @@ } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); if (get_attr_mode (insn) == MODE_SI) return "and{l}\t{%k2, %k0|%k0, %k2}"; else @@ -7975,14 +7970,14 @@ { enum machine_mode mode; - if (GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); if (INTVAL (operands[2]) == 0xff) mode = QImode; - else if (INTVAL (operands[2]) == 0xffff) - mode = HImode; else - abort (); + { + gcc_assert (INTVAL (operands[2]) == 0xffff); + mode = HImode; + } operands[1] = gen_lowpart (mode, operands[1]); if (mode == QImode) @@ -7992,8 +7987,7 @@ } default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "and{l}\t{%2, %0|%0, %2}"; } } @@ -8095,15 +8089,12 @@ switch (get_attr_type (insn)) { case TYPE_IMOVX: - if (GET_CODE (operands[2]) != CONST_INT) - abort (); - if (INTVAL (operands[2]) == 0xff) - return "movz{bl|x}\t{%b1, %k0|%k0, %b1}"; - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + gcc_assert (INTVAL (operands[2]) == 0xff); + return "movz{bl|x}\t{%b1, %k0|%k0, %b1}"; default: - if (! rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "and{w}\t{%2, %0|%0, %2}"; } @@ -10075,16 +10066,13 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); - if (!rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (operands[2] == const1_rtx); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{q}\t{%0, %0|%0, %0}"; case TYPE_LEA: - if (GET_CODE (operands[2]) != CONST_INT - || (unsigned HOST_WIDE_INT) INTVAL (operands[2]) > 3) - abort (); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); + gcc_assert ((unsigned HOST_WIDE_INT) INTVAL (operands[2]) <= 3); operands[1] = gen_rtx_MULT (DImode, operands[1], GEN_INT (1 << INTVAL (operands[2]))); return "lea{q}\t{%a1, %0|%0, %a1}"; @@ -10141,8 +10129,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{q}\t{%0, %0|%0, %0}"; default: @@ -10276,10 +10263,8 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); - if (!rtx_equal_p (operands[0], operands[1])) - abort (); + gcc_assert (operands[2] == const1_rtx); + gcc_assert (rtx_equal_p (operands[0], operands[1])); return "add{l}\t{%0, %0|%0, %0}"; case TYPE_LEA: @@ -10364,8 +10349,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%k0, %k0|%k0, %k0}"; case TYPE_LEA: @@ -10425,8 +10409,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%0, %0|%0, %0}"; default: @@ -10463,8 +10446,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{l}\t{%k0, %k0|%k0, %k0}"; default: @@ -10507,8 +10489,7 @@ case TYPE_LEA: return "#"; case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: @@ -10544,8 +10525,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: @@ -10585,8 +10565,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{w}\t{%0, %0|%0, %0}"; default: @@ -10632,8 +10611,7 @@ case TYPE_LEA: return "#"; case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) return "add{l}\t{%k0, %k0|%k0, %k0}"; else @@ -10687,8 +10665,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); if (REG_P (operands[1]) && !ANY_QI_REG_P (operands[1])) return "add{l}\t{%k0, %k0|%k0, %k0}"; else @@ -10746,8 +10723,7 @@ switch (get_attr_type (insn)) { case TYPE_ALU: - if (operands[2] != const1_rtx) - abort (); + gcc_assert (operands[2] == const1_rtx); return "add{b}\t{%0, %0|%0, %0}"; default: @@ -12459,17 +12435,14 @@ ;; The SSE store flag instructions saves 0 or 0xffffffff to the result. ;; subsequent logical operations are used to imitate conditional moves. ;; 0xffffffff is NaN, but not in normalized form, so we can't represent -;; it directly. Further holding this value in pseudo register might bring -;; problem in implicit normalization in spill code. -;; So we don't define FLOAT_STORE_FLAG_VALUE and create these -;; instructions after reload by splitting the conditional move patterns. +;; it directly. (define_insn "*sse_setccsf" [(set (match_operand:SF 0 "register_operand" "=x") (match_operator:SF 1 "sse_comparison_operator" [(match_operand:SF 2 "register_operand" "0") (match_operand:SF 3 "nonimmediate_operand" "xm")]))] - "TARGET_SSE && reload_completed" + "TARGET_SSE" "cmp%D1ss\t{%3, %0|%0, %3}" [(set_attr "type" "ssecmp") (set_attr "mode" "SF")]) @@ -12479,7 +12452,7 @@ (match_operator:DF 1 "sse_comparison_operator" [(match_operand:DF 2 "register_operand" "0") (match_operand:DF 3 "nonimmediate_operand" "Ym")]))] - "TARGET_SSE2 && reload_completed" + "TARGET_SSE2" "cmp%D1sd\t{%3, %0|%0, %3}" [(set_attr "type" "ssecmp") (set_attr "mode" "DF")]) @@ -12887,7 +12860,7 @@ [(set (pc) (if_then_else (match_operator 0 "comparison_operator" [(match_operand 1 "register_operand" "f") - (match_operand 2 "const_double_operand" "C")]) + (match_operand 2 "const0_operand" "X")]) (label_ref (match_operand 3 "" "")) (pc))) (clobber (reg:CCFP FPSR_REG)) @@ -12895,7 +12868,7 @@ (clobber (match_scratch:HI 4 "=a"))] "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1])) - && operands[2] == CONST0_RTX (GET_MODE (operands[1])) + && GET_MODE (operands[1]) == GET_MODE (operands[2]) && !ix86_use_fcomi_compare (GET_CODE (operands[0])) && SELECT_CC_MODE (GET_CODE (operands[0]), operands[1], operands[2]) == CCFPmode @@ -16244,90 +16217,162 @@ DONE; }) -(define_insn "frndintxf2_floor" - [(set (match_operand:XF 0 "register_operand" "=f") - (unspec:XF [(match_operand:XF 1 "register_operand" "0")] - UNSPEC_FRNDINT_FLOOR)) - (use (match_operand:HI 2 "memory_operand" "m")) - (use (match_operand:HI 3 "memory_operand" "m"))] +(define_insn "fistdi2" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST)) + (clobber (match_scratch:XF 2 "=&1f"))] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" - "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" - [(set_attr "type" "frndint") - (set_attr "i387_cw" "floor") - (set_attr "mode" "XF")]) + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fpspc") + (set_attr "mode" "DI")]) -(define_expand "floordf2" - [(use (match_operand:DF 0 "register_operand" "")) - (use (match_operand:DF 1 "register_operand" ""))] +(define_insn "fistdi2_with_temp" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST)) + (clobber (match_operand:DI 2 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 3 "=&1f,&1f"))] "TARGET_USE_FANCY_MATH_387 - && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" -{ - rtx op0 = gen_reg_rtx (XFmode); - rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; + "#" + [(set_attr "type" "fpspc") + (set_attr "mode" "DI")]) - emit_insn (gen_extenddfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_floor (op0, op1, op2, op3)); +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:DI 2 "memory_operand" "")) + (clobber (match_scratch 3 ""))] + "reload_completed" + [(parallel [(set (match_dup 2) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) + (clobber (match_dup 3))]) + (set (match_dup 0) (match_dup 2))] + "") - emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); - DONE; -}) +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:DI 2 "memory_operand" "")) + (clobber (match_scratch 3 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST)) + (clobber (match_dup 3))])] + "") -(define_expand "floorsf2" - [(use (match_operand:SF 0 "register_operand" "")) - (use (match_operand:SF 1 "register_operand" ""))] +(define_insn "fist2" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST))] "TARGET_USE_FANCY_MATH_387 - && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" -{ - rtx op0 = gen_reg_rtx (XFmode); - rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fpspc") + (set_attr "mode" "")]) - emit_insn (gen_extendsfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_floor (op0, op1, op2, op3)); +(define_insn "fist2_with_temp" + [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST)) + (clobber (match_operand:X87MODEI12 2 "memory_operand" "=m,m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fpspc") + (set_attr "mode" "")]) - emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); - DONE; -}) +(define_split + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_operand:X87MODEI12 2 "memory_operand" ""))] + "reload_completed" + [(set (match_dup 2) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST)) + (set (match_dup 0) (match_dup 2))] + "") -(define_expand "floorxf2" - [(use (match_operand:XF 0 "register_operand" "")) +(define_split + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST)) + (clobber (match_scratch 2 ""))] + "reload_completed" + [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST))] + "") + +(define_expand "lrint2" + [(use (match_operand:X87MODEI 0 "nonimmediate_operand" "")) (use (match_operand:XF 1 "register_operand" ""))] "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) && flag_unsafe_math_optimizations" { - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; - - emit_insn (gen_frndintxf2_floor (operands[0], operands[1], op2, op3)); + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fist2 (operands[0], operands[1])); + else + { + operands[2] = assign_386_stack_local (mode, 0); + emit_insn (gen_fist2_with_temp (operands[0], operands[1], + operands[2])); + } DONE; }) -(define_insn "frndintxf2_ceil" +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_floor" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] - UNSPEC_FRNDINT_CEIL)) - (use (match_operand:HI 2 "memory_operand" "m")) - (use (match_operand:HI 3 "memory_operand" "m"))] + UNSPEC_FRNDINT_FLOOR)) + (clobber (reg:CC FLAGS_REG))] "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" - "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching = 1; + + operands[2] = assign_386_stack_local (HImode, 1); + operands[3] = assign_386_stack_local (HImode, 2); + + emit_insn (gen_frndintxf2_floor_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} [(set_attr "type" "frndint") - (set_attr "i387_cw" "ceil") + (set_attr "i387_cw" "floor") (set_attr "mode" "XF")]) -(define_expand "ceildf2" +(define_insn "frndintxf2_floor_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" + [(set_attr "type" "frndint") + (set_attr "i387_cw" "floor") + (set_attr "mode" "XF")]) + +(define_expand "floorxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_floor (operands[0], operands[1])); + DONE; +}) + +(define_expand "floordf2" [(use (match_operand:DF 0 "register_operand" "")) (use (match_operand:DF 1 "register_operand" ""))] "TARGET_USE_FANCY_MATH_387 @@ -16336,19 +16381,15 @@ { rtx op0 = gen_reg_rtx (XFmode); rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; emit_insn (gen_extenddfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_ceil (op0, op1, op2, op3)); + emit_insn (gen_frndintxf2_floor (op0, op1)); emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); DONE; }) -(define_expand "ceilsf2" +(define_expand "floorsf2" [(use (match_operand:SF 0 "register_operand" "")) (use (match_operand:SF 1 "register_operand" ""))] "TARGET_USE_FANCY_MATH_387 @@ -16357,34 +16398,438 @@ { rtx op0 = gen_reg_rtx (XFmode); rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; emit_insn (gen_extendsfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_ceil (op0, op1, op2, op3)); + emit_insn (gen_frndintxf2_floor (op0, op1)); emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); DONE; }) +(define_insn_and_split "*fist2_floor_1" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_FLOOR)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching = 1; + operands[2] = assign_386_stack_local (HImode, 1); + operands[3] = assign_386_stack_local (HImode, 2); + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fist2_floor (operands[0], operands[1], + operands[2], operands[3])); + else + { + operands[4] = assign_386_stack_local (mode, 0); + emit_insn (gen_fist2_floor_with_temp (operands[0], operands[1], + operands[2], operands[3], + operands[4])); + } + DONE; +} + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "")]) + +(define_insn "fistdi2_floor" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m")) + (clobber (match_scratch:XF 4 "=&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "DI")]) + +(define_insn "fistdi2_floor_with_temp" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:DI 4 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 5 "=&1f,&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "DI")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:DI [(match_dup 1)] UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))])] + "") + +(define_insn "fist2_floor" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "")]) + +(define_insn "fist2_floor_with_temp" + [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "floor") + (set_attr "mode" "")]) + +(define_split + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_FLOOR)) + (use (match_dup 2)) + (use (match_dup 3))])] + "") + +(define_expand "lfloor2" + [(parallel [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_FLOOR)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "") + +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_ceil" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_CEIL)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching = 1; + + operands[2] = assign_386_stack_local (HImode, 1); + operands[3] = assign_386_stack_local (HImode, 2); + + emit_insn (gen_frndintxf2_ceil_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "XF")]) + +(define_insn "frndintxf2_ceil_i387" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "fldcw\t%3\n\tfrndint\n\tfldcw\t%2" + [(set_attr "type" "frndint") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "XF")]) + (define_expand "ceilxf2" [(use (match_operand:XF 0 "register_operand" "")) (use (match_operand:XF 1 "register_operand" ""))] "TARGET_USE_FANCY_MATH_387 && flag_unsafe_math_optimizations" { - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; + emit_insn (gen_frndintxf2_ceil (operands[0], operands[1])); + DONE; +}) + +(define_expand "ceildf2" + [(use (match_operand:DF 0 "register_operand" "")) + (use (match_operand:DF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!(TARGET_SSE2 && TARGET_SSE_MATH) || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extenddfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_ceil (op0, op1)); - emit_insn (gen_frndintxf2_ceil (operands[0], operands[1], op2, op3)); + emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); DONE; }) -(define_insn "frndintxf2_trunc" +(define_expand "ceilsf2" + [(use (match_operand:SF 0 "register_operand" "")) + (use (match_operand:SF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" +{ + rtx op0 = gen_reg_rtx (XFmode); + rtx op1 = gen_reg_rtx (XFmode); + + emit_insn (gen_extendsfxf2 (op1, operands[1])); + emit_insn (gen_frndintxf2_ceil (op0, op1)); + + emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); + DONE; +}) + +(define_insn_and_split "*fist2_ceil_1" + [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_CEIL)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching = 1; + operands[2] = assign_386_stack_local (HImode, 1); + operands[3] = assign_386_stack_local (HImode, 2); + if (memory_operand (operands[0], VOIDmode)) + emit_insn (gen_fist2_ceil (operands[0], operands[1], + operands[2], operands[3])); + else + { + operands[4] = assign_386_stack_local (mode, 0); + emit_insn (gen_fist2_ceil_with_temp (operands[0], operands[1], + operands[2], operands[3], + operands[4])); + } + DONE; +} + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "")]) + +(define_insn "fistdi2_ceil" + [(set (match_operand:DI 0 "memory_operand" "=m") + (unspec:DI [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m")) + (clobber (match_scratch:XF 4 "=&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "DI")]) + +(define_insn "fistdi2_ceil_with_temp" + [(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r") + (unspec:DI [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:DI 4 "memory_operand" "=m,m")) + (clobber (match_scratch:XF 5 "=&1f,&1f"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "DI")]) + +(define_split + [(set (match_operand:DI 0 "register_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:DI [(match_dup 1)] UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:DI 0 "memory_operand" "") + (unspec:DI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:DI 4 "memory_operand" "")) + (clobber (match_scratch 5 ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3)) + (clobber (match_dup 5))])] + "") + +(define_insn "fist2_ceil" + [(set (match_operand:X87MODEI12 0 "memory_operand" "=m") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m")) + (use (match_operand:HI 3 "memory_operand" "m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "* return output_fix_trunc (insn, operands, 0);" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "")]) + +(define_insn "fist2_ceil_with_temp" + [(set (match_operand:X87MODEI12 0 "nonimmediate_operand" "=m,?r") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "f,f")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "m,m")) + (use (match_operand:HI 3 "memory_operand" "m,m")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" "=m,m"))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" + "#" + [(set_attr "type" "fistp") + (set_attr "i387_cw" "ceil") + (set_attr "mode" "")]) + +(define_split + [(set (match_operand:X87MODEI12 0 "register_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 4) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3))]) + (set (match_dup 0) (match_dup 4))] + "") + +(define_split + [(set (match_operand:X87MODEI12 0 "memory_operand" "") + (unspec:X87MODEI12 [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (use (match_operand:HI 2 "memory_operand" "")) + (use (match_operand:HI 3 "memory_operand" "")) + (clobber (match_operand:X87MODEI12 4 "memory_operand" ""))] + "reload_completed" + [(parallel [(set (match_dup 0) (unspec:X87MODEI12 [(match_dup 1)] + UNSPEC_FIST_CEIL)) + (use (match_dup 2)) + (use (match_dup 3))])] + "") + +(define_expand "lceil2" + [(parallel [(set (match_operand:X87MODEI 0 "nonimmediate_operand" "") + (unspec:X87MODEI [(match_operand:XF 1 "register_operand" "")] + UNSPEC_FIST_CEIL)) + (clobber (reg:CC FLAGS_REG))])] + "TARGET_USE_FANCY_MATH_387 + && (!TARGET_SSE_MATH || TARGET_MIX_SSE_I387) + && flag_unsafe_math_optimizations" + "") + +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_trunc" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_TRUNC)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] +{ + ix86_optimize_mode_switching = 1; + + operands[2] = assign_386_stack_local (HImode, 1); + operands[3] = assign_386_stack_local (HImode, 2); + + emit_insn (gen_frndintxf2_trunc_i387 (operands[0], operands[1], + operands[2], operands[3])); + DONE; +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "trunc") + (set_attr "mode" "XF")]) + +(define_insn "frndintxf2_trunc_i387" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_FRNDINT_TRUNC)) @@ -16397,6 +16842,16 @@ (set_attr "i387_cw" "trunc") (set_attr "mode" "XF")]) +(define_expand "btruncxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_trunc (operands[0], operands[1])); + DONE; +}) + (define_expand "btruncdf2" [(use (match_operand:DF 0 "register_operand" "")) (use (match_operand:DF 1 "register_operand" ""))] @@ -16406,13 +16861,9 @@ { rtx op0 = gen_reg_rtx (XFmode); rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; emit_insn (gen_extenddfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_trunc (op0, op1, op2, op3)); + emit_insn (gen_frndintxf2_trunc (op0, op1)); emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); DONE; @@ -16427,34 +16878,41 @@ { rtx op0 = gen_reg_rtx (XFmode); rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; emit_insn (gen_extendsfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_trunc (op0, op1, op2, op3)); + emit_insn (gen_frndintxf2_trunc (op0, op1)); emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); DONE; }) -(define_expand "btruncxf2" - [(use (match_operand:XF 0 "register_operand" "")) - (use (match_operand:XF 1 "register_operand" ""))] +;; Rounding mode control word calculation could clobber FLAGS_REG. +(define_insn_and_split "frndintxf2_mask_pm" + [(set (match_operand:XF 0 "register_operand" "=f") + (unspec:XF [(match_operand:XF 1 "register_operand" "0")] + UNSPEC_FRNDINT_MASK_PM)) + (clobber (reg:CC FLAGS_REG))] "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" + && flag_unsafe_math_optimizations + && !(reload_completed || reload_in_progress)" + "#" + "&& 1" + [(const_int 0)] { - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - ix86_optimize_mode_switching = 1; - emit_insn (gen_frndintxf2_trunc (operands[0], operands[1], op2, op3)); + operands[2] = assign_386_stack_local (HImode, 1); + operands[3] = assign_386_stack_local (HImode, 2); + + emit_insn (gen_frndintxf2_mask_pm_i387 (operands[0], operands[1], + operands[2], operands[3])); DONE; -}) +} + [(set_attr "type" "frndint") + (set_attr "i387_cw" "mask_pm") + (set_attr "mode" "XF")]) -(define_insn "frndintxf2_mask_pm" +(define_insn "frndintxf2_mask_pm_i387" [(set (match_operand:XF 0 "register_operand" "=f") (unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_FRNDINT_MASK_PM)) @@ -16467,6 +16925,17 @@ (set_attr "i387_cw" "mask_pm") (set_attr "mode" "XF")]) +(define_expand "nearbyintxf2" + [(use (match_operand:XF 0 "register_operand" "")) + (use (match_operand:XF 1 "register_operand" ""))] + "TARGET_USE_FANCY_MATH_387 + && flag_unsafe_math_optimizations" +{ + emit_insn (gen_frndintxf2_mask_pm (operands[0], operands[1])); + + DONE; +}) + (define_expand "nearbyintdf2" [(use (match_operand:DF 0 "register_operand" "")) (use (match_operand:DF 1 "register_operand" ""))] @@ -16476,13 +16945,9 @@ { rtx op0 = gen_reg_rtx (XFmode); rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; emit_insn (gen_extenddfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_mask_pm (op0, op1, op2, op3)); + emit_insn (gen_frndintxf2_mask_pm (op0, op1)); emit_insn (gen_truncxfdf2_i387_noop (operands[0], op0)); DONE; @@ -16497,34 +16962,14 @@ { rtx op0 = gen_reg_rtx (XFmode); rtx op1 = gen_reg_rtx (XFmode); - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; emit_insn (gen_extendsfxf2 (op1, operands[1])); - emit_insn (gen_frndintxf2_mask_pm (op0, op1, op2, op3)); + emit_insn (gen_frndintxf2_mask_pm (op0, op1)); emit_insn (gen_truncxfsf2_i387_noop (operands[0], op0)); DONE; }) -(define_expand "nearbyintxf2" - [(use (match_operand:XF 0 "register_operand" "")) - (use (match_operand:XF 1 "register_operand" ""))] - "TARGET_USE_FANCY_MATH_387 - && flag_unsafe_math_optimizations" -{ - rtx op2 = assign_386_stack_local (HImode, 1); - rtx op3 = assign_386_stack_local (HImode, 2); - - ix86_optimize_mode_switching = 1; - - emit_insn (gen_frndintxf2_mask_pm (operands[0], operands[1], - op2, op3)); - DONE; -}) - ;; Block operation instructions @@ -16539,7 +16984,7 @@ (use (match_operand:BLK 1 "memory_operand" "")) (use (match_operand:SI 2 "nonmemory_operand" "")) (use (match_operand:SI 3 "const_int_operand" ""))] - "! optimize_size" + "! optimize_size || TARGET_INLINE_ALL_STRINGOPS" { if (ix86_expand_movmem (operands[0], operands[1], operands[2], operands[3])) DONE; @@ -17546,51 +17991,6 @@ "(TARGET_80387 && TARGET_CMOVE) || TARGET_SSE_MATH" "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") -;; These versions of min/max are aware of the instruction's behavior -;; wrt -0.0 and NaN inputs. If we don't care about either, then we -;; should have used the smin/smax expanders in the first place. -(define_insn "*movsfcc_1_sse_min" - [(set (match_operand:SF 0 "register_operand" "=x") - (if_then_else:SF - (lt:SF (match_operand:SF 1 "register_operand" "0") - (match_operand:SF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE_MATH" - "minss\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "SF")]) - -(define_insn "*movsfcc_1_sse_max" - [(set (match_operand:SF 0 "register_operand" "=x") - (if_then_else:SF - (lt:SF (match_operand:SF 2 "nonimmediate_operand" "xm") - (match_operand:SF 1 "nonimmediate_operand" "0")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE_MATH" - "maxss\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "SF")]) - -(define_insn_and_split "*movsfcc_1_sse" - [(set (match_operand:SF 0 "register_operand" "=x,x,x") - (if_then_else:SF - (match_operator:SF 4 "sse_comparison_operator" - [(match_operand:SF 5 "register_operand" "0,0,0") - (match_operand:SF 6 "nonimmediate_operand" "xm,xm,xm")]) - (match_operand:SF 2 "reg_or_0_operand" "C,x,x") - (match_operand:SF 3 "reg_or_0_operand" "x,C,x"))) - (clobber (match_scratch:V4SF 1 "=&x,&x,&x"))] - "TARGET_SSE_MATH" - "#" - "&& reload_completed" - [(const_int 0)] -{ - ix86_split_sse_movcc (operands); - DONE; -}) - (define_insn "*movsfcc_1_387" [(set (match_operand:SF 0 "register_operand" "=f#r,f#r,r#f,r#f") (if_then_else:SF (match_operator 1 "fcmov_comparison_operator" @@ -17615,51 +18015,6 @@ "(TARGET_80387 && TARGET_CMOVE) || (TARGET_SSE2 && TARGET_SSE_MATH)" "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;") -;; These versions of min/max are aware of the instruction's behavior -;; wrt -0.0 and NaN inputs. If we don't care about either, then we -;; should have used the smin/smax expanders in the first place. -(define_insn "*movdfcc_1_sse_min" - [(set (match_operand:DF 0 "register_operand" "=x") - (if_then_else:DF - (lt:DF (match_operand:DF 1 "register_operand" "0") - (match_operand:DF 2 "nonimmediate_operand" "xm")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE2 && TARGET_SSE_MATH" - "minsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "DF")]) - -(define_insn "*movdfcc_1_sse_max" - [(set (match_operand:DF 0 "register_operand" "=x") - (if_then_else:DF - (lt:DF (match_operand:DF 2 "nonimmediate_operand" "xm") - (match_operand:DF 1 "nonimmediate_operand" "0")) - (match_dup 1) - (match_dup 2)))] - "TARGET_SSE2 && TARGET_SSE_MATH" - "maxsd\t{%2, %0|%0, %2}" - [(set_attr "type" "sseadd") - (set_attr "mode" "DF")]) - -(define_insn_and_split "*movdfcc_1_sse" - [(set (match_operand:DF 0 "register_operand" "=x,x,x") - (if_then_else:DF - (match_operator:DF 4 "sse_comparison_operator" - [(match_operand:DF 5 "register_operand" "0,0,0") - (match_operand:DF 6 "nonimmediate_operand" "xm,xm,xm")]) - (match_operand:DF 2 "reg_or_0_operand" "C,x,x") - (match_operand:DF 3 "reg_or_0_operand" "x,C,x"))) - (clobber (match_scratch:V2DF 1 "=&x,&x,&x"))] - "TARGET_SSE2 && TARGET_SSE_MATH" - "#" - "&& reload_completed" - [(const_int 0)] -{ - ix86_split_sse_movcc (operands); - DONE; -}) - (define_insn "*movdfcc_1" [(set (match_operand:DF 0 "register_operand" "=f#r,f#r,&r#f,&r#f") (if_then_else:DF (match_operator 1 "fcmov_comparison_operator" @@ -17774,6 +18129,52 @@ [(set_attr "type" "sseadd") (set_attr "mode" "DF")]) +;; These versions of the min/max patterns implement exactly the operations +;; min = (op1 < op2 ? op1 : op2) +;; max = (!(op1 < op2) ? op1 : op2) +;; Their operands are not commutative, and thus they may be used in the +;; presence of -0.0 and NaN. + +(define_insn "*ieee_sminsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (unspec:SF [(match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MIN))] + "TARGET_SSE_MATH" + "minss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) + +(define_insn "*ieee_smaxsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (unspec:SF [(match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MAX))] + "TARGET_SSE_MATH" + "maxss\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "SF")]) + +(define_insn "*ieee_smindf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (unspec:DF [(match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MIN))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "minsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + +(define_insn "*ieee_smaxdf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (unspec:DF [(match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "nonimmediate_operand" "xm")] + UNSPEC_IEEE_MAX))] + "TARGET_SSE2 && TARGET_SSE_MATH" + "maxsd\t{%2, %0|%0, %2}" + [(set_attr "type" "sseadd") + (set_attr "mode" "DF")]) + ;; Conditional addition patterns (define_expand "addqicc" [(match_operand:QI 0 "register_operand" "") @@ -17848,7 +18249,7 @@ return "lea{l}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set (attr "type") @@ -17891,7 +18292,7 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set (attr "type") @@ -17922,7 +18323,7 @@ return "lea{q}\t{%a2, %0|%0, %a2}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "alu,lea") @@ -18484,18 +18885,16 @@ ;; Attempt to always use XOR for zeroing registers. (define_peephole2 [(set (match_operand 0 "register_operand" "") - (const_int 0))] - "(GET_MODE (operands[0]) == QImode - || GET_MODE (operands[0]) == HImode - || GET_MODE (operands[0]) == SImode - || (GET_MODE (operands[0]) == DImode && TARGET_64BIT)) + (match_operand 1 "const0_operand" ""))] + "GET_MODE_SIZE (GET_MODE (operands[0])) <= UNITS_PER_WORD && (! TARGET_USE_MOV0 || optimize_size) && GENERAL_REG_P (operands[0]) && peep2_regno_dead_p (0, FLAGS_REG)" [(parallel [(set (match_dup 0) (const_int 0)) (clobber (reg:CC FLAGS_REG))])] - "operands[0] = gen_lowpart (GET_MODE (operands[0]) == DImode ? DImode : SImode, - operands[0]);") +{ + operands[0] = gen_lowpart (word_mode, operands[0]); +}) (define_peephole2 [(set (strict_low_part (match_operand 0 "register_operand" "")) @@ -19242,15 +19641,13 @@ int rw = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (rw != 0 && rw != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); - if (GET_MODE (operands[0]) != Pmode && GET_MODE (operands[0]) != VOIDmode) - abort (); + gcc_assert (rw == 0 || rw == 1); + gcc_assert (locality >= 0 && locality <= 3); + gcc_assert (GET_MODE (operands[0]) == Pmode + || GET_MODE (operands[0]) == VOIDmode); /* Use 3dNOW prefetch in case we are asking for write prefetch not - suported by SSE counterpart or the SSE prefetch is not available + supported by SSE counterpart or the SSE prefetch is not available (K6 machines). Otherwise use SSE prefetch as it allows specifying of locality. */ if (TARGET_3DNOW && (!TARGET_PREFETCH_SSE || rw)) @@ -19270,8 +19667,7 @@ }; int locality = INTVAL (operands[1]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); return patterns[locality]; } @@ -19289,8 +19685,7 @@ }; int locality = INTVAL (operands[1]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); return patterns[locality]; } @@ -19327,3 +19722,4 @@ (include "sse.md") (include "mmx.md") +(include "sync.md") diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt new file mode 100644 index 00000000000..5571deebe4e --- /dev/null +++ b/gcc/config/i386/i386.opt @@ -0,0 +1,217 @@ +; Options for the IA-32 and AMD64 ports of the compiler. + +; Copyright (C) 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. + +m128bit-long-double +Target RejectNegative Report Mask(128BIT_LONG_DOUBLE) +sizeof(long double) is 16 + +m32 +Target RejectNegative Report InverseMask(64BIT) +Generate 32bit i386 code + +m386 +Target RejectNegative Undocumented +;; Deprecated + +m3dnow +Target Report Mask(3DNOW) +Support 3DNow! built-in functions + +m486 +Target RejectNegative Undocumented +;; Deprecated + +m64 +Target RejectNegative Report Mask(64BIT) +Generate 64bit x86-64 code + +m80387 +Target Report Mask(80387) +Use hardware fp + +m96bit-long-double +Target RejectNegative Report InverseMask(128BIT_LONG_DOUBLE) +sizeof(long double) is 12 + +maccumulate-outgoing-args +Target Report Mask(ACCUMULATE_OUTGOING_ARGS) +Reserve space for outgoing arguments in the function prologue + +malign-double +Target Report Mask(ALIGN_DOUBLE) +Align some doubles on dword boundary + +malign-functions= +Target RejectNegative Joined +Function starts are aligned to this power of 2 + +malign-jumps= +Target RejectNegative Joined +Jump targets are aligned to this power of 2 + +malign-loops= +Target RejectNegative Joined +Loop code aligned to this power of 2 + +malign-stringops +Target RejectNegative Report InverseMask(NO_ALIGN_STRINGOPS, ALIGN_STRINGOPS) +Align destination of the string operations + +march= +Target RejectNegative Joined +Generate code for given CPU + +masm= +Target RejectNegative Joined +Use given assembler dialect + +mbranch-cost= +Target RejectNegative Joined +Branches are this expensive (1-5, arbitrary units) + +mcmodel= +Target RejectNegative Joined +Use given x86-64 code model + +mdebug-addr +Target RejectNegative Var(TARGET_DEBUG_ADDR) Undocumented + +mdebug-arg +Target RejectNegative Var(TARGET_DEBUG_ARG) Undocumented + +mfancy-math-387 +Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) +Generate sin, cos, sqrt for FPU + +mfp-ret-in-387 +Target Report Mask(FLOAT_RETURNS) +Return values of functions in FPU registers + +mfpmath= +Target RejectNegative Joined +Generate floating point mathematics using given instruction set + +mhard-float +Target RejectNegative Mask(80387) MaskExists +Use hardware fp + +mieee-fp +Target Report Mask(IEEE_FP) +Use IEEE math for fp comparisons + +minline-all-stringops +Target Report Mask(INLINE_ALL_STRINGOPS) +Inline all known string operations + +mintel-syntax +Target Undocumented +;; Deprecated + +mmmx +Target Report Mask(MMX) +Support MMX built-in functions + +mms-bitfields +Target Report Mask(MS_BITFIELD_LAYOUT) +Use native (MS) bitfield layout + +mno-align-stringops +Target RejectNegative Report Mask(NO_ALIGN_STRINGOPS) Undocumented + +mno-fancy-math-387 +Target RejectNegative Report Mask(NO_FANCY_MATH_387) Undocumented + +mno-push-args +Target RejectNegative Report Mask(NO_PUSH_ARGS) Undocumented + +mno-red-zone +Target RejectNegative Report Mask(NO_RED_ZONE) Undocumented + +momit-leaf-frame-pointer +Target Report Mask(OMIT_LEAF_FRAME_POINTER) +Omit the frame pointer in leaf functions + +mpentium +Target RejectNegative Undocumented +;; Deprecated + +mpentiumpro +Target RejectNegative Undocumented +;; Deprecated + +mpreferred-stack-boundary= +Target RejectNegative Joined +Attempt to keep stack aligned to this power of 2 + +mpush-args +Target Report InverseMask(NO_PUSH_ARGS, PUSH_ARGS) +Use push instructions to save outgoing arguments + +mred-zone +Target RejectNegative Report InverseMask(NO_RED_ZONE, RED_ZONE) +Use red-zone in the x86-64 code + +mregparm= +Target RejectNegative Joined +Number of registers used to pass integer arguments + +mrtd +Target Report Mask(RTD) +Alternate calling convention + +msoft-float +Target InverseMask(80387) +Do not use hardware fp + +msse +Target Report Mask(SSE) +Support MMX and SSE built-in functions and code generation + +msse2 +Target Report Mask(SSE2) +Support MMX, SSE and SSE2 built-in functions and code generation + +msse3 +Target Report Mask(SSE3) +Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation + +msvr3-shlib +Target Report Mask(SVR3_SHLIB) +Uninitialized locals in .bss + +mstack-arg-probe +Target Report Mask(STACK_PROBE) +Enable stack probing + +mtls-dialect= +Target RejectNegative Joined +Use given thread-local storage dialect + +mtls-direct-seg-refs +Target Report Mask(TLS_DIRECT_SEG_REFS) +Use direct references against %gs when accessing tls data + +mtune= +Target RejectNegative Joined +Schedule code for given CPU + +;; Support Athlon 3Dnow builtins +Mask(3DNOW_A) diff --git a/gcc/config/i386/lynx.h b/gcc/config/i386/lynx.h index 1aad4d6b121..a014bc328b8 100644 --- a/gcc/config/i386/lynx.h +++ b/gcc/config/i386/lynx.h @@ -1,5 +1,5 @@ /* Definitions for LynxOS on i386. - Copyright (C) 1993, 1995, 1996, 2002, 2004 + Copyright (C) 1993, 1995, 1996, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -71,12 +71,6 @@ Boston, MA 02111-1307, USA. */ } while (0) #endif -/* Since i386.h defines an empty SUBTARGET_SWITCHES the definition in - config/lynx.h is omitted. */ - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES - /* Undefine SUBTARGET_EXTRA_SPECS it is empty anyway. We define it in config/lynx.h. */ diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md index 403501bf4dc..ceb520c008f 100644 --- a/gcc/config/i386/mmx.md +++ b/gcc/config/i386/mmx.md @@ -177,7 +177,7 @@ (define_expand "push1" [(match_operand:MMXMODE 0 "register_operand" "")] - "TARGET_SSE" + "TARGET_MMX" { ix86_expand_push (mode, operands[0]); DONE; diff --git a/gcc/config/i386/netware.c b/gcc/config/i386/netware.c index 48985c17183..75d8306ba7c 100644 --- a/gcc/config/i386/netware.c +++ b/gcc/config/i386/netware.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for NetWare. Contributed by Jan Beulich (jbeulich@novell.com) - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -150,7 +150,7 @@ gen_regparm_prefix (tree decl, unsigned nregs) if (nregs > total / BITS_PER_WORD) nregs = total / BITS_PER_WORD; - if (nregs > 9) abort(); + gcc_assert (nregs <= 9); newsym = alloca (2 + strlen (asmname) + 1 + 1); return IDENTIFIER_POINTER (get_identifier_with_length (newsym, sprintf (newsym, "_%u@%s", nregs, asmname))); @@ -201,8 +201,12 @@ i386_nlm_strip_name_encoding (const char *str) ++name; if (ISDIGIT (p[1])) name = ggc_alloc_string (name, p - name); - else if (!ISDIGIT (*name) || ++name != p) - abort(); + else + { + gcc_assert (ISDIGIT (*name)); + name++; + gcc_assert (name == p); + } } } return name; diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 66f25058182..0d1546808c5 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -195,7 +195,7 @@ break; default: - abort (); + gcc_unreachable (); } return 0; @@ -275,7 +275,7 @@ break; default: - abort (); + gcc_unreachable (); } return 0; }) @@ -359,7 +359,7 @@ return 0; default: - abort (); + gcc_unreachable (); } }) @@ -499,8 +499,12 @@ ;; Match exactly zero. (define_predicate "const0_operand" - (and (match_code "const_int,const_double,const_vector") - (match_test "op == CONST0_RTX (mode)"))) + (match_code "const_int,const_double,const_vector") +{ + if (mode == VOIDmode) + mode = GET_MODE (op); + return op == CONST0_RTX (mode); +}) ;; Match exactly one. (define_predicate "const1_operand" @@ -652,8 +656,10 @@ (match_operand 0 "address_operand") { struct ix86_address parts; - if (! ix86_decompose_address (op, &parts)) - abort (); + int ok; + + ok = ix86_decompose_address (op, &parts); + gcc_assert (ok); return parts.seg == SEG_DEFAULT; }) @@ -662,6 +668,7 @@ (match_operand 0 "general_operand") { struct ix86_address parts; + int ok; /* Registers and immediate operands are always "aligned". */ if (GET_CODE (op) != MEM) @@ -678,8 +685,8 @@ return 1; /* Decode the address. */ - if (!ix86_decompose_address (op, &parts)) - abort (); + ok = ix86_decompose_address (op, &parts); + gcc_assert (ok); /* Look for some component that isn't known to be aligned. */ if (parts.index) @@ -708,8 +715,10 @@ (match_operand 0 "memory_operand") { struct ix86_address parts; - if (!ix86_decompose_address (XEXP (op, 0), &parts)) - abort (); + int ok; + + ok = ix86_decompose_address (XEXP (op, 0), &parts); + gcc_assert (ok); return parts.disp != NULL_RTX; }) diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h index 355f49ae7f8..4ce5e8fbbeb 100644 --- a/gcc/config/i386/sco5.h +++ b/gcc/config/i386/sco5.h @@ -281,14 +281,6 @@ Boston, MA 02111-1307, USA. */ #define LIBGCC_SPEC \ "%{!shared:%{!G:-lgcc}}" -/* Here for legacy support only so we still accept -melf flag */ -#define MASK_COFF 010000000000 /* Mask for COFF generation */ -#define TARGET_ELF (1) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "elf", -MASK_COFF, N_("Generate ELF output") }, - /* Handle special EH pointer encodings. Absolute, pc-relative, and indirect are handled automatically. */ #define ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX(FILE, ENCODING, SIZE, ADDR, DONE) \ diff --git a/gcc/config/i386/sco5.opt b/gcc/config/i386/sco5.opt new file mode 100644 index 00000000000..9bafcf56978 --- /dev/null +++ b/gcc/config/i386/sco5.opt @@ -0,0 +1,25 @@ +; SCO Unix-specific options. + +; Copyright (C) 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. + +;; Legacy option +melf +Target RejectNegative +Generate ELF output diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index e147b71028b..4d664cec10b 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -75,7 +75,7 @@ else return "movdqa\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "sselog1,ssemov,ssemov") @@ -161,7 +161,7 @@ else return "movapd\t{%1, %0|%0, %1}"; default: - abort (); + gcc_unreachable (); } } [(set_attr "type" "sselog1,ssemov,ssemov") @@ -710,6 +710,22 @@ [(set_attr "type" "ssecomi") (set_attr "mode" "SF")]) +(define_expand "vcondv4sf" + [(set (match_operand:V4SF 0 "register_operand" "") + (if_then_else:V4SF + (match_operator 3 "" + [(match_operand:V4SF 4 "nonimmediate_operand" "") + (match_operand:V4SF 5 "nonimmediate_operand" "")]) + (match_operand:V4SF 1 "general_operand" "") + (match_operand:V4SF 2 "general_operand" "")))] + "TARGET_SSE" +{ + if (ix86_expand_fp_vcond (operands)) + DONE; + else + FAIL; +}) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Parallel single-precision floating point logical operations @@ -773,6 +789,47 @@ [(set_attr "type" "sselog") (set_attr "mode" "V4SF")]) +;; Also define scalar versions. These are used for abs, neg, and +;; conditional move. Using subregs into vector modes causes register +;; allocation lossage. These patterns do not allow memory operands +;; because the native instructions read the full 128-bits. + +(define_insn "*andsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (and:SF (match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "andps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "*nandsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (and:SF (not:SF (match_operand:SF 1 "register_operand" "0")) + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "andnps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "*iorsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (ior:SF (match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "orps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + +(define_insn "*xorsf3" + [(set (match_operand:SF 0 "register_operand" "=x") + (xor:SF (match_operand:SF 1 "register_operand" "0") + (match_operand:SF 2 "register_operand" "x")))] + "TARGET_SSE" + "xorps\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V4SF")]) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Parallel single-precision floating point conversion operations @@ -1607,6 +1664,22 @@ [(set_attr "type" "ssecomi") (set_attr "mode" "DF")]) +(define_expand "vcondv2df" + [(set (match_operand:V2DF 0 "register_operand" "") + (if_then_else:V2DF + (match_operator 3 "" + [(match_operand:V2DF 4 "nonimmediate_operand" "") + (match_operand:V2DF 5 "nonimmediate_operand" "")]) + (match_operand:V2DF 1 "general_operand" "") + (match_operand:V2DF 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (ix86_expand_fp_vcond (operands)) + DONE; + else + FAIL; +}) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Parallel double-precision floating point logical operations @@ -1624,7 +1697,7 @@ [(set (match_operand:V2DF 0 "register_operand" "=x") (and:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "%0") (match_operand:V2DF 2 "nonimmediate_operand" "xm")))] - "TARGET_SSE2 && ix86_binary_operator_ok (AND, V4SFmode, operands)" + "TARGET_SSE2 && ix86_binary_operator_ok (AND, V2DFmode, operands)" "andpd\t{%2, %0|%0, %2}" [(set_attr "type" "sselog") (set_attr "mode" "V2DF")]) @@ -1670,6 +1743,47 @@ [(set_attr "type" "sselog") (set_attr "mode" "V2DF")]) +;; Also define scalar versions. These are used for abs, neg, and +;; conditional move. Using subregs into vector modes causes regiser +;; allocation lossage. These patterns do not allow memory operands +;; because the native instructions read the full 128-bits. + +(define_insn "*anddf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (and:DF (match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "andpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "*nanddf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (and:DF (not:DF (match_operand:DF 1 "register_operand" "0")) + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "andnpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "*iordf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (ior:DF (match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "orpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + +(define_insn "*xordf3" + [(set (match_operand:DF 0 "register_operand" "=x") + (xor:DF (match_operand:DF 1 "register_operand" "0") + (match_operand:DF 2 "register_operand" "x")))] + "TARGET_SSE2" + "xorpd\t{%2, %0|%0, %2}" + [(set_attr "type" "sselog") + (set_attr "mode" "V2DF")]) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Parallel double-precision floating point conversion operations @@ -2278,6 +2392,50 @@ [(set_attr "type" "sseiadd") (set_attr "mode" "TI")]) +(define_expand "mulv16qi3" + [(set (match_operand:V16QI 0 "register_operand" "") + (mult:V16QI (match_operand:V16QI 1 "register_operand" "") + (match_operand:V16QI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx t[12], op0; + int i; + + for (i = 0; i < 12; ++i) + t[i] = gen_reg_rtx (V16QImode); + + /* Unpack data such that we've got a source byte in each low byte of + each word. We don't care what goes into the high byte of each word. + Rather than trying to get zero in there, most convenient is to let + it be a copy of the low byte. */ + emit_insn (gen_sse2_punpckhbw (t[0], operands[1], operands[1])); + emit_insn (gen_sse2_punpckhbw (t[1], operands[2], operands[2])); + emit_insn (gen_sse2_punpcklbw (t[2], operands[1], operands[1])); + emit_insn (gen_sse2_punpcklbw (t[3], operands[2], operands[2])); + + /* Multiply words. The end-of-line annotations here give a picture of what + the output of that instruction looks like. Dot means don't care; the + letters are the bytes of the result with A being the most significant. */ + emit_insn (gen_mulv8hi3 (gen_lowpart (V8HImode, t[4]), /* .A.B.C.D.E.F.G.H */ + gen_lowpart (V8HImode, t[0]), + gen_lowpart (V8HImode, t[1]))); + emit_insn (gen_mulv8hi3 (gen_lowpart (V8HImode, t[5]), /* .I.J.K.L.M.N.O.P */ + gen_lowpart (V8HImode, t[2]), + gen_lowpart (V8HImode, t[3]))); + + /* Extract the relevant bytes and merge them back together. */ + emit_insn (gen_sse2_punpckhbw (t[6], t[5], t[4])); /* ..AI..BJ..CK..DL */ + emit_insn (gen_sse2_punpcklbw (t[7], t[5], t[4])); /* ..EM..FN..GO..HP */ + emit_insn (gen_sse2_punpckhbw (t[8], t[7], t[6])); /* ....AEIM....BFJN */ + emit_insn (gen_sse2_punpcklbw (t[9], t[7], t[6])); /* ....CGKO....DHLP */ + emit_insn (gen_sse2_punpckhbw (t[10], t[9], t[8])); /* ........ACEGIKMO */ + emit_insn (gen_sse2_punpcklbw (t[11], t[9], t[8])); /* ........BDFHJLNP */ + + op0 = operands[0]; + emit_insn (gen_sse2_punpcklbw (op0, t[11], t[10])); /* ABCDEFGHIJKLMNOP */ + DONE; +}) + (define_expand "mulv8hi3" [(set (match_operand:V8HI 0 "register_operand" "") (mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "") @@ -2376,6 +2534,96 @@ [(set_attr "type" "sseiadd") (set_attr "mode" "TI")]) +(define_expand "mulv4si3" + [(set (match_operand:V4SI 0 "register_operand" "") + (mult:V4SI (match_operand:V4SI 1 "register_operand" "") + (match_operand:V4SI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx t1, t2, t3, t4, t5, t6, thirtytwo; + rtx op0, op1, op2; + + op0 = operands[0]; + op1 = operands[1]; + op2 = operands[2]; + t1 = gen_reg_rtx (V4SImode); + t2 = gen_reg_rtx (V4SImode); + t3 = gen_reg_rtx (V4SImode); + t4 = gen_reg_rtx (V4SImode); + t5 = gen_reg_rtx (V4SImode); + t6 = gen_reg_rtx (V4SImode); + thirtytwo = GEN_INT (32); + + /* Multiply elements 2 and 0. */ + emit_insn (gen_sse2_umulv2siv2di3 (gen_lowpart (V2DImode, t1), op1, op2)); + + /* Shift both input vectors down one element, so that elements 3 and 1 + are now in the slots for elements 2 and 0. For K8, at least, this is + faster than using a shuffle. */ + emit_insn (gen_sse2_lshrti3 (gen_lowpart (TImode, t2), + gen_lowpart (TImode, op1), thirtytwo)); + emit_insn (gen_sse2_lshrti3 (gen_lowpart (TImode, t3), + gen_lowpart (TImode, op2), thirtytwo)); + + /* Multiply elements 3 and 1. */ + emit_insn (gen_sse2_umulv2siv2di3 (gen_lowpart (V2DImode, t4), t2, t3)); + + /* Move the results in element 2 down to element 1; we don't care what + goes in elements 2 and 3. */ + emit_insn (gen_sse2_pshufd_1 (t5, t1, const0_rtx, const2_rtx, + const0_rtx, const0_rtx)); + emit_insn (gen_sse2_pshufd_1 (t6, t4, const0_rtx, const2_rtx, + const0_rtx, const0_rtx)); + + /* Merge the parts back together. */ + emit_insn (gen_sse2_punpckldq (op0, t5, t6)); + DONE; +}) + +(define_expand "mulv2di3" + [(set (match_operand:V2DI 0 "register_operand" "") + (mult:V2DI (match_operand:V2DI 1 "register_operand" "") + (match_operand:V2DI 2 "register_operand" "")))] + "TARGET_SSE2" +{ + rtx t1, t2, t3, t4, t5, t6, thirtytwo; + rtx op0, op1, op2; + + op0 = operands[0]; + op1 = operands[1]; + op2 = operands[2]; + t1 = gen_reg_rtx (V2DImode); + t2 = gen_reg_rtx (V2DImode); + t3 = gen_reg_rtx (V2DImode); + t4 = gen_reg_rtx (V2DImode); + t5 = gen_reg_rtx (V2DImode); + t6 = gen_reg_rtx (V2DImode); + thirtytwo = GEN_INT (32); + + /* Multiply low parts. */ + emit_insn (gen_sse2_umulv2siv2di3 (t1, gen_lowpart (V4SImode, op1), + gen_lowpart (V4SImode, op2))); + + /* Shift input vectors left 32 bits so we can multiply high parts. */ + emit_insn (gen_lshrv2di3 (t2, op1, thirtytwo)); + emit_insn (gen_lshrv2di3 (t3, op2, thirtytwo)); + + /* Multiply high parts by low parts. */ + emit_insn (gen_sse2_umulv2siv2di3 (t4, gen_lowpart (V4SImode, op1), + gen_lowpart (V4SImode, t3))); + emit_insn (gen_sse2_umulv2siv2di3 (t5, gen_lowpart (V4SImode, op2), + gen_lowpart (V4SImode, t2))); + + /* Shift them back. */ + emit_insn (gen_ashlv2di3 (t4, t4, thirtytwo)); + emit_insn (gen_ashlv2di3 (t5, t5, thirtytwo)); + + /* Add the three parts together. */ + emit_insn (gen_addv2di3 (t6, t1, t4)); + emit_insn (gen_addv2di3 (op0, t6, t5)); + DONE; +}) + (define_insn "ashr3" [(set (match_operand:SSEMODE24 0 "register_operand" "=x") (ashiftrt:SSEMODE24 @@ -2520,6 +2768,38 @@ [(set_attr "type" "ssecmp") (set_attr "mode" "TI")]) +(define_expand "vcond" + [(set (match_operand:SSEMODE124 0 "register_operand" "") + (if_then_else:SSEMODE124 + (match_operator 3 "" + [(match_operand:SSEMODE124 4 "nonimmediate_operand" "") + (match_operand:SSEMODE124 5 "nonimmediate_operand" "")]) + (match_operand:SSEMODE124 1 "general_operand" "") + (match_operand:SSEMODE124 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (ix86_expand_int_vcond (operands, false)) + DONE; + else + FAIL; +}) + +(define_expand "vcondu" + [(set (match_operand:SSEMODE12 0 "register_operand" "") + (if_then_else:SSEMODE12 + (match_operator 3 "" + [(match_operand:SSEMODE12 4 "nonimmediate_operand" "") + (match_operand:SSEMODE12 5 "nonimmediate_operand" "")]) + (match_operand:SSEMODE12 1 "general_operand" "") + (match_operand:SSEMODE12 2 "general_operand" "")))] + "TARGET_SSE2" +{ + if (ix86_expand_int_vcond (operands, true)) + DONE; + else + FAIL; +}) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Parallel integral logical operations diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md new file mode 100644 index 00000000000..99d100fd726 --- /dev/null +++ b/gcc/config/i386/sync.md @@ -0,0 +1,155 @@ +;; GCC machine description for i386 synchronization instructions. +;; Copyright (C) 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. + +(define_mode_macro IMODE [QI HI SI (DI "TARGET_64BIT")]) +(define_mode_attr modesuffix [(QI "b") (HI "w") (SI "l") (DI "q")]) +(define_mode_attr modeconstraint [(QI "q") (HI "r") (SI "r") (DI "r")]) +(define_mode_attr immconstraint [(QI "i") (HI "i") (SI "i") (DI "e")]) + +;; ??? It would be possible to use cmpxchg8b on pentium for DImode +;; changes. It's complicated because the insn uses ecx:ebx as the +;; new value; note that the registers are reversed from the order +;; that they'd be in with (reg:DI 2 ecx). Similarly for TImode +;; data in 64-bit mode. + +(define_insn "sync_compare_and_swap" + [(set (match_operand:IMODE 0 "register_operand" "=a") + (match_operand:IMODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:IMODE + [(match_dup 1) + (match_operand:IMODE 2 "register_operand" "a") + (match_operand:IMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (clobber (reg:CC FLAGS_REG))] + "TARGET_CMPXCHG" + "lock\;cmpxchg{}\t{%3, %1|%1, %3}") + +(define_expand "sync_compare_and_swap_cc" + [(parallel + [(set (match_operand:IMODE 0 "register_operand" "") + (match_operand:IMODE 1 "memory_operand" "")) + (set (match_dup 1) + (unspec_volatile:IMODE + [(match_dup 1) + (match_operand:IMODE 2 "register_operand" "") + (match_operand:IMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (set (match_dup 4) + (compare:CCZ + (unspec_volatile:IMODE + [(match_dup 1) (match_dup 2) (match_dup 3)] UNSPECV_CMPXCHG_2) + (match_dup 2)))])] + "TARGET_CMPXCHG" +{ + operands[4] = gen_rtx_REG (CCZmode, FLAGS_REG); + ix86_compare_op0 = operands[3]; + ix86_compare_op1 = NULL; + ix86_compare_emitted = operands[4]; +}) + +(define_insn "*sync_compare_and_swap_cc" + [(set (match_operand:IMODE 0 "register_operand" "=a") + (match_operand:IMODE 1 "memory_operand" "+m")) + (set (match_dup 1) + (unspec_volatile:IMODE + [(match_dup 1) + (match_operand:IMODE 2 "register_operand" "a") + (match_operand:IMODE 3 "register_operand" "")] + UNSPECV_CMPXCHG_1)) + (set (reg:CCZ FLAGS_REG) + (compare:CCZ + (unspec_volatile:IMODE + [(match_dup 1) (match_dup 2) (match_dup 3)] UNSPECV_CMPXCHG_2) + (match_dup 2)))] + "TARGET_CMPXCHG" + "lock\;cmpxchg{}\t{%3, %1|%1, %3}") + +(define_insn "sync_old_add" + [(set (match_operand:IMODE 0 "register_operand" "=") + (unspec_volatile:IMODE + [(match_operand:IMODE 1 "memory_operand" "+m")] UNSPECV_XCHG)) + (set (match_dup 1) + (plus:IMODE (match_dup 1) + (match_operand:IMODE 2 "register_operand" "0"))) + (clobber (reg:CC FLAGS_REG))] + "TARGET_XADD" + "lock\;xadd{}\t{%0, %1|%1, %0}") + +;; Recall that xchg implicitly sets LOCK#, so adding it again wastes space. +(define_insn "sync_lock_test_and_set" + [(set (match_operand:IMODE 0 "register_operand" "=") + (unspec_volatile:IMODE + [(match_operand:IMODE 1 "memory_operand" "+m")] UNSPECV_XCHG)) + (set (match_dup 1) + (match_operand:IMODE 2 "register_operand" "0"))] + "" + "xchg{}\t{%1, %0|%0, %1}") + +(define_insn "sync_add" + [(set (match_operand:IMODE 0 "memory_operand" "=m") + (unspec_volatile:IMODE + [(plus:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" "r"))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;add{}\t{%1, %0|%0, %1}") + +(define_insn "sync_sub" + [(set (match_operand:IMODE 0 "memory_operand" "=m") + (unspec_volatile:IMODE + [(minus:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" "r"))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;sub{}\t{%1, %0|%0, %1}") + +(define_insn "sync_ior" + [(set (match_operand:IMODE 0 "memory_operand" "=m") + (unspec_volatile:IMODE + [(ior:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" "r"))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;or{}\t{%1, %0|%0, %1}") + +(define_insn "sync_and" + [(set (match_operand:IMODE 0 "memory_operand" "=m") + (unspec_volatile:IMODE + [(and:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" "r"))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;and{}\t{%1, %0|%0, %1}") + +(define_insn "sync_xor" + [(set (match_operand:IMODE 0 "memory_operand" "=m") + (unspec_volatile:IMODE + [(xor:IMODE (match_dup 0) + (match_operand:IMODE 1 "nonmemory_operand" "r"))] + UNSPECV_LOCK)) + (clobber (reg:CC FLAGS_REG))] + "" + "lock\;xor{}\t{%1, %0|%0, %1}") diff --git a/gcc/config/i386/winnt.c b/gcc/config/i386/winnt.c index c8a75440f89..74375aa840e 100644 --- a/gcc/config/i386/winnt.c +++ b/gcc/config/i386/winnt.c @@ -1,6 +1,6 @@ /* Subroutines for insn-output.c for Windows NT. Contributed by Douglas Rupp (drupp@cs.washington.edu) - Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -71,13 +71,43 @@ ix86_handle_shared_attribute (tree *node, tree name, { if (TREE_CODE (*node) != VAR_DECL) { - warning ("%qs attribute only applies to variables", + warning (0, "%qs attribute only applies to variables", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } return NULL_TREE; } + +/* Handle a "selectany" attribute; + arguments as in struct attribute_spec.handler. */ +tree +ix86_handle_selectany_attribute (tree *node, tree name, + tree args ATTRIBUTE_UNUSED, + int flags ATTRIBUTE_UNUSED, + bool *no_add_attrs) +{ + /* The attribute applies only to objects that are initialized and have + external linkage, */ + if (TREE_CODE (*node) == VAR_DECL && TREE_PUBLIC (*node) + && (DECL_INITIAL (*node) + /* If an object is initialized with a ctor, the static + initialization and destruction code for it is present in + each unit defining the object. The code that calls the + ctor is protected by a link-once guard variable, so that + the object still has link-once semantics, */ + || TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (*node)))) + make_decl_one_only (*node); + else + { + error ("%qs attribute applies only to initialized variables" + " with external linkage", IDENTIFIER_POINTER (name)); + *no_add_attrs = true; + } + + return NULL_TREE; +} + /* Return the type that we should use to determine if DECL is imported or exported. */ @@ -169,7 +199,7 @@ i386_pe_dllimport_p (tree decl) { /* Don't warn about artificial methods. */ if (!DECL_ARTIFICIAL (decl)) - warning ("%Jfunction '%D' is defined after prior declaration " + warning (0, "%Jfunction '%D' is defined after prior declaration " "as dllimport: attribute ignored", decl, decl); return 0; } @@ -180,7 +210,7 @@ i386_pe_dllimport_p (tree decl) else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) { if (extra_warnings) - warning ("%Jinline function '%D' is declared as dllimport: " + warning (0, "%Jinline function '%D' is declared as dllimport: " "attribute ignored.", decl, decl); return 0; } @@ -243,16 +273,13 @@ i386_pe_mark_dllexport (tree decl) tree idp; rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (i386_pe_dllimport_name_p (oldname)) { - warning ("%Jinconsistent dll linkage for '%D', dllexport assumed.", + warning (0, "%Jinconsistent dll linkage for '%D', dllexport assumed.", decl, decl); /* Remove DLL_IMPORT_PREFIX. */ oldname += strlen (DLL_IMPORT_PREFIX); @@ -287,13 +314,10 @@ i386_pe_mark_dllimport (tree decl) rtx symref; rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (i386_pe_dllexport_name_p (oldname)) { error ("%qs declared as both exported to and imported from a DLL", @@ -302,14 +326,9 @@ i386_pe_mark_dllimport (tree decl) } else if (i386_pe_dllimport_name_p (oldname)) { - /* Already done, but do a sanity check to prevent assembler errors. */ - if (!DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)) - { - error ("%Jfailure in redeclaration of '%D': dllimport'd " - "symbol lacks external linkage.", decl, decl); - abort(); - } - return; + /* Already done, but do a sanity check to prevent assembler + errors. */ + gcc_assert (DECL_EXTERNAL (decl) && TREE_PUBLIC (decl)); } newname = alloca (strlen (DLL_IMPORT_PREFIX) + strlen (oldname) + 1); @@ -444,10 +463,10 @@ i386_pe_encode_section_info (tree decl, rtx rtl, int first) We leave these alone for now. */ if (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl)) - warning ("%J'%D' defined locally after being " + warning (0, "%J'%D' defined locally after being " "referenced with dllimport linkage", decl, decl); else - warning ("%J'%D' redeclared without dllimport attribute " + warning (0, "%J'%D' redeclared without dllimport attribute " "after being referenced with dllimport linkage", decl, decl); } } @@ -622,7 +641,7 @@ i386_pe_section_type_flags (tree decl, const char *name, int reloc) void i386_pe_asm_named_section (const char *name, unsigned int flags, - tree decl ATTRIBUTE_UNUSED) + tree decl) { char flagchars[8], *f = flagchars; @@ -649,10 +668,16 @@ i386_pe_asm_named_section (const char *name, unsigned int flags, if (flags & SECTION_LINKONCE) { /* Functions may have been compiled at various levels of - optimization so we can't use `same_size' here. - Instead, have the linker pick one. */ + optimization so we can't use `same_size' here. + Instead, have the linker pick one, without warning. + If 'selectany' attribute has been specified, MS compiler + sets 'discard' characteristic, rather than telling linker + to warn of size or content mismatch, so do the same. */ + bool discard = (flags & SECTION_CODE) + || lookup_attribute ("selectany", + DECL_ATTRIBUTES (decl)); fprintf (asm_out_file, "\t.linkonce %s\n", - (flags & SECTION_CODE ? "discard" : "same_size")); + (discard ? "discard" : "same_size")); } } @@ -683,6 +708,7 @@ i386_pe_declare_function_type (FILE *file, const char *name, int public) struct extern_list GTY(()) { struct extern_list *next; + tree decl; const char *name; }; @@ -695,12 +721,13 @@ static GTY(()) struct extern_list *extern_head; for it then. */ void -i386_pe_record_external_function (const char *name) +i386_pe_record_external_function (tree decl, const char *name) { struct extern_list *p; p = (struct extern_list *) ggc_alloc (sizeof *p); p->next = extern_head; + p->decl = decl; p->name = name; extern_head = p; } @@ -749,10 +776,11 @@ i386_pe_file_end (void) { tree decl; - decl = get_identifier (p->name); + decl = p->decl; /* Positively ensure only one declaration for any given symbol. */ - if (! TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (decl)) + if (! TREE_ASM_WRITTEN (decl) + && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) { TREE_ASM_WRITTEN (decl) = 1; i386_pe_declare_function_type (asm_out_file, p->name, diff --git a/gcc/config/i386/x-darwin b/gcc/config/i386/x-darwin new file mode 100644 index 00000000000..9a3b0f262ce --- /dev/null +++ b/gcc/config/i386/x-darwin @@ -0,0 +1,4 @@ +host-i386-darwin.o : $(srcdir)/config/i386/host-i386-darwin.c \ + $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) \ + config/host-darwin.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< diff --git a/gcc/config/i860/i860.h b/gcc/config/i860/i860.h index f1c46ec86f5..cf7f18738dd 100644 --- a/gcc/config/i860/i860.h +++ b/gcc/config/i860/i860.h @@ -36,33 +36,6 @@ do { \ /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (i860)"); - -/* Run-time compilation parameters selecting different hardware subsets - or supersets. - - On the i860, we have one: TARGET_XP. This option allows gcc to generate - additional instructions available only on the newer i860 XP (but not on - the older i860 XR). -*/ - -extern int target_flags; - -/* Nonzero if we should generate code to use the fpu. */ -#define TARGET_XP (target_flags & 1) - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - { {"xp", 1, N_("Generate code which uses the FPU")}, \ - {"noxp", -1, N_("Do not generate code which uses the FPU")}, \ - {"xr", -1, N_("Do not generate code which uses the FPU")}, \ - { "", TARGET_DEFAULT, NULL}} - -#define TARGET_DEFAULT 0 /* target machine storage layout */ @@ -1230,8 +1203,6 @@ extern const char *i860_reg_prefix; {"logic_operand", {REG, SUBREG, CONST_INT}}, \ {"shift_operand", {REG, SUBREG, CONST_INT}}, \ {"compare_operand", {REG, SUBREG, CONST_INT}}, \ - {"arith_const_operand", {CONST_INT}}, \ - {"logic_const_operand", {CONST_INT}}, \ {"bte_operand", {REG, SUBREG, CONST_INT}}, \ {"indexed_operand", {MEM}}, \ {"load_operand", {MEM}}, \ diff --git a/gcc/config/i860/i860.opt b/gcc/config/i860/i860.opt new file mode 100644 index 00000000000..247edf6fd30 --- /dev/null +++ b/gcc/config/i860/i860.opt @@ -0,0 +1,32 @@ +; Options for the Intel i860 port of the compiler. + +; Copyright (C) 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. + +mxp +Target Report RejectNegative Mask(XP) +Generate code which uses the FPU + +mnoxp +Target Report RejectNegative InverseMask(XP) +Do not generate code which uses the FPU + +mxr +Target Report RejectNegative InverseMask(XP) +Do not generate code which uses the FPU diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h index 66e3a613e32..396094fc668 100644 --- a/gcc/config/ia64/hpux.h +++ b/gcc/config/ia64/hpux.h @@ -205,3 +205,6 @@ do { \ /* Put all *tf routines in libgcc, regardless of long double size. */ #undef LIBGCC2_HAS_TF_MODE #define LIBGCC2_HAS_TF_MODE 1 + +/* HP-UX headers are C++-compatible. */ +#define NO_IMPLICIT_EXTERN_C diff --git a/gcc/config/ia64/ia64-c.c b/gcc/config/ia64/ia64-c.c index eaa85838744..e620c32c7e6 100644 --- a/gcc/config/ia64/ia64-c.c +++ b/gcc/config/ia64/ia64-c.c @@ -1,5 +1,5 @@ /* Definitions of C specific functions for GNU compiler. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Ellcey This file is part of GCC. @@ -49,7 +49,7 @@ ia64_hpux_handle_builtin_pragma (cpp_reader *pfile ATTRIBUTE_UNUSED) type = c_lex (&x); } if (type != CPP_EOF) - warning ("malformed #pragma builtin"); + warning (0, "malformed #pragma builtin"); } /* List of standard math functions which do not set matherr by default diff --git a/gcc/config/ia64/ia64-protos.h b/gcc/config/ia64/ia64-protos.h index afe8e597905..94fa176f7e7 100644 --- a/gcc/config/ia64/ia64-protos.h +++ b/gcc/config/ia64/ia64-protos.h @@ -37,6 +37,7 @@ extern int ia64_produce_address_p (rtx); extern bool ia64_const_ok_for_letter_p (HOST_WIDE_INT, char); extern bool ia64_const_double_ok_for_letter_p (rtx, char); extern bool ia64_extra_constraint (rtx, char); +extern bool ia64_legitimate_constant_p (rtx); extern rtx ia64_expand_move (rtx, rtx); extern int ia64_move_ok (rtx, rtx); @@ -51,13 +52,14 @@ extern bool ia64_expand_vecint_minmax (enum rtx_code, enum machine_mode, rtx[]); extern void ia64_expand_call (rtx, rtx, rtx, int); extern void ia64_split_call (rtx, rtx, rtx, rtx, rtx, int, int); extern void ia64_reload_gp (void); +extern void ia64_expand_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx); extern HOST_WIDE_INT ia64_initial_elimination_offset (int, int); extern void ia64_expand_prologue (void); extern void ia64_expand_epilogue (int); extern int ia64_direct_return (void); -extern void ia64_expand_load_address (rtx, rtx); +extern bool ia64_expand_load_address (rtx, rtx); extern int ia64_hard_regno_rename_ok (int, int); extern void ia64_initialize_trampoline (rtx, rtx, rtx); diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 0f9645a506d..c8e0ea398b1 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -163,7 +163,6 @@ static int ia64_first_cycle_multipass_dfa_lookahead_guard (rtx); static int ia64_dfa_new_cycle (FILE *, int, rtx, int, int, int *); static rtx gen_tls_get_addr (void); static rtx gen_thread_pointer (void); -static rtx ia64_expand_tls_address (enum tls_model, rtx, rtx); static int find_gr_spill (int); static int next_scratch_gr_reg (void); static void mark_reg_gr_used_mask (rtx, void *); @@ -199,12 +198,6 @@ static bool ia64_in_small_data_p (tree); static void process_epilogue (void); static int process_set (FILE *, rtx); -static rtx ia64_expand_fetch_and_op (optab, enum machine_mode, tree, rtx); -static rtx ia64_expand_op_and_fetch (optab, enum machine_mode, tree, rtx); -static rtx ia64_expand_compare_and_swap (enum machine_mode, enum machine_mode, - int, tree, rtx); -static rtx ia64_expand_lock_test_and_set (enum machine_mode, tree, rtx); -static rtx ia64_expand_lock_release (enum machine_mode, tree, rtx); static bool ia64_assemble_integer (rtx, unsigned int, int); static void ia64_output_function_prologue (FILE *, HOST_WIDE_INT); static void ia64_output_function_epilogue (FILE *, HOST_WIDE_INT); @@ -270,7 +263,7 @@ static rtx ia64_struct_value_rtx (tree, int); static tree ia64_gimplify_va_arg (tree, tree, tree *, tree *); static bool ia64_scalar_mode_supported_p (enum machine_mode mode); static bool ia64_vector_mode_supported_p (enum machine_mode mode); - +static bool ia64_cannot_force_const_mem (rtx); /* Table of valid machine attributes. */ static const struct attribute_spec ia64_attribute_table[] = @@ -430,6 +423,9 @@ static const struct attribute_spec ia64_attribute_table[] = #undef TARGET_HANDLE_OPTION #define TARGET_HANDLE_OPTION ia64_handle_option +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM ia64_cannot_force_const_mem + struct gcc_target targetm = TARGET_INITIALIZER; typedef enum @@ -488,7 +484,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args, } else { - warning ("invalid argument of %qs attribute", + warning (0, "invalid argument of %qs attribute", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -520,7 +516,7 @@ ia64_handle_model_attribute (tree *node, tree name, tree args, break; default: - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; break; } @@ -538,7 +534,7 @@ ia64_encode_addr_area (tree decl, rtx symbol) { case ADDR_AREA_NORMAL: break; case ADDR_AREA_SMALL: flags |= SYMBOL_FLAG_SMALL_ADDR; break; - default: abort (); + default: gcc_unreachable (); } SYMBOL_REF_FLAGS (symbol) = flags; } @@ -622,8 +618,7 @@ ia64_extra_constraint (rtx value, char c) case 'T': /* Symbol ref to small-address-area. */ - return (GET_CODE (value) == SYMBOL_REF - && SYMBOL_REF_SMALL_ADDR_P (value)); + return small_addr_symbolic_operand (value, VOIDmode); case 'U': /* Vector zero. */ @@ -699,72 +694,124 @@ ia64_depz_field_mask (rtx rop, rtx rshift) return exact_log2 (op + 1); } +/* Return the TLS model to use for ADDR. */ + +static enum tls_model +tls_symbolic_operand_type (rtx addr) +{ + enum tls_model tls_kind = 0; + + if (GET_CODE (addr) == CONST) + { + if (GET_CODE (XEXP (addr, 0)) == PLUS + && GET_CODE (XEXP (XEXP (addr, 0), 0)) == SYMBOL_REF) + tls_kind = SYMBOL_REF_TLS_MODEL (XEXP (XEXP (addr, 0), 0)); + } + else if (GET_CODE (addr) == SYMBOL_REF) + tls_kind = SYMBOL_REF_TLS_MODEL (addr); + + return tls_kind; +} + +/* Return true if X is a constant that is valid for some immediate + field in an instruction. */ + +bool +ia64_legitimate_constant_p (rtx x) +{ + switch (GET_CODE (x)) + { + case CONST_INT: + case LABEL_REF: + return true; + + case CONST_DOUBLE: + if (GET_MODE (x) == VOIDmode) + return true; + return CONST_DOUBLE_OK_FOR_G (x); + + case CONST: + case SYMBOL_REF: + return tls_symbolic_operand_type (x) == 0; + + default: + return false; + } +} + +/* Don't allow TLS addresses to get spilled to memory. */ + +static bool +ia64_cannot_force_const_mem (rtx x) +{ + return tls_symbolic_operand_type (x) != 0; +} + /* Expand a symbolic constant load. */ -void +bool ia64_expand_load_address (rtx dest, rtx src) { - if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (src)) - abort (); - if (GET_CODE (dest) != REG) - abort (); + gcc_assert (GET_CODE (dest) == REG); /* ILP32 mode still loads 64-bits of data from the GOT. This avoids having to pointer-extend the value afterward. Other forms of address computation below are also more natural to compute as 64-bit quantities. If we've been given an SImode destination register, change it. */ if (GET_MODE (dest) != Pmode) - dest = gen_rtx_REG (Pmode, REGNO (dest)); + dest = gen_rtx_REG_offset (dest, Pmode, REGNO (dest), 0); - if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_SMALL_ADDR_P (src)) - { - emit_insn (gen_rtx_SET (VOIDmode, dest, src)); - return; - } - else if (TARGET_AUTO_PIC) - { - emit_insn (gen_load_gprel64 (dest, src)); - return; - } + if (TARGET_NO_PIC) + return false; + if (small_addr_symbolic_operand (src, VOIDmode)) + return false; + + if (TARGET_AUTO_PIC) + emit_insn (gen_load_gprel64 (dest, src)); else if (GET_CODE (src) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (src)) - { - emit_insn (gen_load_fptr (dest, src)); - return; - } + emit_insn (gen_load_fptr (dest, src)); else if (sdata_symbolic_operand (src, VOIDmode)) + emit_insn (gen_load_gprel (dest, src)); + else { - emit_insn (gen_load_gprel (dest, src)); - return; - } + HOST_WIDE_INT addend = 0; + rtx tmp; - if (GET_CODE (src) == CONST - && GET_CODE (XEXP (src, 0)) == PLUS - && GET_CODE (XEXP (XEXP (src, 0), 1)) == CONST_INT - && (INTVAL (XEXP (XEXP (src, 0), 1)) & 0x3fff) != 0) - { - rtx sym = XEXP (XEXP (src, 0), 0); - HOST_WIDE_INT ofs, hi, lo; + /* We did split constant offsets in ia64_expand_move, and we did try + to keep them split in move_operand, but we also allowed reload to + rematerialize arbitrary constants rather than spill the value to + the stack and reload it. So we have to be prepared here to split + them apart again. */ + if (GET_CODE (src) == CONST) + { + HOST_WIDE_INT hi, lo; - /* Split the offset into a sign extended 14-bit low part - and a complementary high part. */ - ofs = INTVAL (XEXP (XEXP (src, 0), 1)); - lo = ((ofs & 0x3fff) ^ 0x2000) - 0x2000; - hi = ofs - lo; + hi = INTVAL (XEXP (XEXP (src, 0), 1)); + lo = ((hi & 0x3fff) ^ 0x2000) - 0x2000; + hi = hi - lo; - ia64_expand_load_address (dest, plus_constant (sym, hi)); - emit_insn (gen_adddi3 (dest, dest, GEN_INT (lo))); - } - else - { - rtx tmp; + if (lo != 0) + { + addend = lo; + src = plus_constant (XEXP (XEXP (src, 0), 0), hi); + } + } tmp = gen_rtx_HIGH (Pmode, src); tmp = gen_rtx_PLUS (Pmode, tmp, pic_offset_table_rtx); emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); - tmp = gen_rtx_LO_SUM (GET_MODE (dest), dest, src); + tmp = gen_rtx_LO_SUM (Pmode, dest, src); emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + + if (addend) + { + tmp = gen_rtx_PLUS (Pmode, dest, GEN_INT (addend)); + emit_insn (gen_rtx_SET (VOIDmode, dest, tmp)); + } } + + return true; } static GTY(()) rtx gen_tls_tga; @@ -786,10 +833,15 @@ gen_thread_pointer (void) } static rtx -ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) +ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1, + HOST_WIDE_INT addend) { rtx tga_op1, tga_op2, tga_ret, tga_eqv, tmp, insns; - rtx orig_op0 = op0; + rtx orig_op0 = op0, orig_op1 = op1; + HOST_WIDE_INT addend_lo, addend_hi; + + addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000; + addend_hi = addend - addend_lo; switch (tls_kind) { @@ -797,12 +849,10 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) start_sequence (); tga_op1 = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_dtpmod (tga_op1, op1)); - tga_op1 = gen_const_mem (Pmode, tga_op1); + emit_insn (gen_load_dtpmod (tga_op1, op1)); tga_op2 = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_dtprel (tga_op2, op1)); - tga_op2 = gen_const_mem (Pmode, tga_op2); + emit_insn (gen_load_dtprel (tga_op2, op1)); tga_ret = emit_library_call_value (gen_tls_get_addr (), NULL_RTX, LCT_CONST, Pmode, 2, tga_op1, @@ -824,8 +874,7 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) start_sequence (); tga_op1 = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_dtpmod (tga_op1, op1)); - tga_op1 = gen_const_mem (Pmode, tga_op1); + emit_insn (gen_load_dtpmod (tga_op1, op1)); tga_op2 = const0_rtx; @@ -849,14 +898,15 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) emit_insn (gen_adddi3 (op0, tmp, op0)); } else - emit_insn (gen_add_dtprel (op0, tmp, op1)); + emit_insn (gen_add_dtprel (op0, op1, tmp)); break; case TLS_MODEL_INITIAL_EXEC: + op1 = plus_constant (op1, addend_hi); + addend = addend_lo; + tmp = gen_reg_rtx (Pmode); - emit_insn (gen_load_ltoff_tprel (tmp, op1)); - tmp = gen_const_mem (Pmode, tmp); - tmp = force_reg (Pmode, tmp); + emit_insn (gen_load_tprel (tmp, op1)); if (!register_operand (op0, Pmode)) op0 = gen_reg_rtx (Pmode); @@ -866,19 +916,25 @@ ia64_expand_tls_address (enum tls_model tls_kind, rtx op0, rtx op1) case TLS_MODEL_LOCAL_EXEC: if (!register_operand (op0, Pmode)) op0 = gen_reg_rtx (Pmode); + + op1 = orig_op1; + addend = 0; if (TARGET_TLS64) { emit_insn (gen_load_tprel (op0, op1)); - emit_insn (gen_adddi3 (op0, gen_thread_pointer (), op0)); + emit_insn (gen_adddi3 (op0, op0, gen_thread_pointer ())); } else - emit_insn (gen_add_tprel (op0, gen_thread_pointer (), op1)); + emit_insn (gen_add_tprel (op0, op1, gen_thread_pointer ())); break; default: - abort (); + gcc_unreachable (); } + if (addend) + op0 = expand_simple_binop (Pmode, PLUS, op0, GEN_INT (addend), + orig_op0, 1, OPTAB_DIRECT); if (orig_op0 == op0) return NULL_RTX; if (GET_MODE (orig_op0) == Pmode) @@ -896,15 +952,60 @@ ia64_expand_move (rtx op0, rtx op1) if ((mode == Pmode || mode == ptr_mode) && symbolic_operand (op1, VOIDmode)) { + HOST_WIDE_INT addend = 0; enum tls_model tls_kind; - if (GET_CODE (op1) == SYMBOL_REF - && (tls_kind = SYMBOL_REF_TLS_MODEL (op1))) - return ia64_expand_tls_address (tls_kind, op0, op1); + rtx sym = op1; + + if (GET_CODE (op1) == CONST + && GET_CODE (XEXP (op1, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op1, 0), 1)) == CONST_INT) + { + addend = INTVAL (XEXP (XEXP (op1, 0), 1)); + sym = XEXP (XEXP (op1, 0), 0); + } + + tls_kind = tls_symbolic_operand_type (sym); + if (tls_kind) + return ia64_expand_tls_address (tls_kind, op0, sym, addend); + + if (any_offset_symbol_operand (sym, mode)) + addend = 0; + else if (aligned_offset_symbol_operand (sym, mode)) + { + HOST_WIDE_INT addend_lo, addend_hi; + + addend_lo = ((addend & 0x3fff) ^ 0x2000) - 0x2000; + addend_hi = addend - addend_lo; + + if (addend_lo != 0) + { + op1 = plus_constant (sym, addend_hi); + addend = addend_lo; + } + else + addend = 0; + } + else + op1 = sym; + + if (reload_completed) + { + /* We really should have taken care of this offset earlier. */ + gcc_assert (addend == 0); + if (ia64_expand_load_address (op0, op1)) + return NULL_RTX; + } - if (!TARGET_NO_PIC && reload_completed) + if (addend) { - ia64_expand_load_address (op0, op1); - return NULL_RTX; + rtx subtarget = no_new_pseudos ? op0 : gen_reg_rtx (mode); + + emit_insn (gen_rtx_SET (VOIDmode, subtarget, op1)); + + op1 = expand_simple_binop (mode, PLUS, subtarget, + GEN_INT (addend), op0, 1, OPTAB_DIRECT); + if (op0 == op1) + return NULL_RTX; } } @@ -956,7 +1057,7 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) case CONST_INT: case CONST_DOUBLE: /* Cannot occur reversed. */ - if (reversed) abort (); + gcc_assert (!reversed); if (GET_MODE (in) != TFmode) split_double (in, &out[0], &out[1]); @@ -1013,14 +1114,16 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) break; case POST_INC: - if (reversed || dead) abort (); + gcc_assert (!reversed && !dead); + /* Just do the increment in two steps. */ out[0] = adjust_automodify_address (in, DImode, 0, 0); out[1] = adjust_automodify_address (in, DImode, 0, 8); break; case POST_DEC: - if (reversed || dead) abort (); + gcc_assert (!reversed && !dead); + /* Add 8, subtract 24. */ base = XEXP (base, 0); out[0] = adjust_automodify_address @@ -1032,7 +1135,8 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) break; case POST_MODIFY: - if (reversed || dead) abort (); + gcc_assert (!reversed && !dead); + /* Extract and adjust the modification. This case is trickier than the others, because we might have an index register, or we might have a combined offset that @@ -1051,38 +1155,41 @@ ia64_split_tmode (rtx out[2], rtx in, bool reversed, bool dead) out[1] = adjust_automodify_address (in, DImode, 0, 8); fixup = gen_adddi3 (base, base, GEN_INT (-8)); } - else if (GET_CODE (XEXP (offset, 1)) != CONST_INT) - abort (); - else if (INTVAL (XEXP (offset, 1)) < -256 + 8) - { - /* Again the postmodify cannot be made to match, but - in this case it's more efficient to get rid of the - postmodify entirely and fix up with an add insn. */ - out[1] = adjust_automodify_address (in, DImode, base, 8); - fixup = gen_adddi3 (base, base, - GEN_INT (INTVAL (XEXP (offset, 1)) - 8)); - } else { - /* Combined offset still fits in the displacement field. - (We cannot overflow it at the high end.) */ - out[1] = adjust_automodify_address - (in, DImode, - gen_rtx_POST_MODIFY (Pmode, base, - gen_rtx_PLUS (Pmode, base, - GEN_INT (INTVAL (XEXP (offset, 1)) - 8))), - 8); + gcc_assert (GET_CODE (XEXP (offset, 1)) == CONST_INT); + if (INTVAL (XEXP (offset, 1)) < -256 + 8) + { + /* Again the postmodify cannot be made to match, + but in this case it's more efficient to get rid + of the postmodify entirely and fix up with an + add insn. */ + out[1] = adjust_automodify_address (in, DImode, base, 8); + fixup = gen_adddi3 + (base, base, GEN_INT (INTVAL (XEXP (offset, 1)) - 8)); + } + else + { + /* Combined offset still fits in the displacement field. + (We cannot overflow it at the high end.) */ + out[1] = adjust_automodify_address + (in, DImode, gen_rtx_POST_MODIFY + (Pmode, base, gen_rtx_PLUS + (Pmode, base, + GEN_INT (INTVAL (XEXP (offset, 1)) - 8))), + 8); + } } break; default: - abort (); + gcc_unreachable (); } break; } default: - abort (); + gcc_unreachable (); } return fixup; @@ -1102,7 +1209,7 @@ ia64_split_tmode_move (rtx operands[]) the value it points to. In that case we have to do the loads in the appropriate order so that the pointer is not destroyed too early. Also we must not generate a postmodify for that second - load, or rws_access_regno will abort. */ + load, or rws_access_regno will die. */ if (GET_CODE (operands[1]) == MEM && reg_overlap_mentioned_p (operands[0], operands[1])) { @@ -1195,10 +1302,8 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) do not need to emit another comparison. */ if (GET_MODE (op0) == BImode) { - if ((code == NE || code == EQ) && op1 == const0_rtx) - cmp = op0; - else - abort (); + gcc_assert ((code == NE || code == EQ) && op1 == const0_rtx); + cmp = op0; } /* HPUX TFmode compare requires a library call to _U_Qfcmp, which takes a magic number as its third argument, that indicates what to do. @@ -1214,8 +1319,8 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) } magic; enum rtx_code ncode; rtx ret, insns; - if (!cmptf_libfunc || GET_MODE (op1) != TFmode) - abort (); + + gcc_assert (cmptf_libfunc && GET_MODE (op1) == TFmode); switch (code) { /* 1 = equal, 0 = not equal. Equality operators do @@ -1234,7 +1339,7 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode) /* FUTURE: Implement UNEQ, UNLT, UNLE, UNGT, UNGE, LTGT. Expanders for buneq etc. weuld have to be added to ia64.md for this to be useful. */ - default: abort (); + default: gcc_unreachable (); } start_sequence (); @@ -1315,24 +1420,26 @@ ia64_expand_vecint_compare (enum rtx_code code, enum machine_mode mode, /* We don't have native unsigned comparisons, but we can generate them better than generic code can. */ - if (mode == V2SImode) - abort (); - else if (mode == V8QImode) + gcc_assert (mode != V2SImode); + switch (mode) { + case V8QImode: wmode = V4HImode; pack = gen_pack2_sss; unpack_l = gen_unpack1_l; unpack_h = gen_unpack1_h; - } - else if (mode == V4HImode) - { + break; + + case V4HImode: wmode = V2SImode; pack = gen_pack4_sss; unpack_l = gen_unpack2_l; unpack_h = gen_unpack2_h; + break; + + default: + gcc_unreachable (); } - else - abort (); /* Unpack into wider vectors, zero extending the elements. */ @@ -1360,7 +1467,7 @@ ia64_expand_vecint_compare (enum rtx_code code, enum machine_mode mode, return negate; default: - abort (); + gcc_unreachable (); } x = gen_rtx_fmt_ee (code, mode, op0, op1); @@ -1515,7 +1622,7 @@ ia64_expand_vecint_minmax (enum rtx_code code, enum machine_mode mode, code = GT; break; default: - abort (); + gcc_unreachable (); } xops[3] = gen_rtx_fmt_ee (code, VOIDmode, operands[1], operands[2]); @@ -1664,12 +1771,124 @@ ia64_split_call (rtx retval, rtx addr, rtx retaddr, rtx scratch_r, if ((!TARGET_CONST_GP || is_desc) && !noreturn_p && !sibcall_p) ia64_reload_gp (); } + +/* Expand an atomic operation. We want to perform MEM = VAL atomically. + + This differs from the generic code in that we know about the zero-extending + properties of cmpxchg, and the zero-extending requirements of ar.ccv. We + also know that ld.acq+cmpxchg.rel equals a full barrier. + + The loop we want to generate looks like + + cmp_reg = mem; + label: + old_reg = cmp_reg; + new_reg = cmp_reg op val; + cmp_reg = compare-and-swap(mem, old_reg, new_reg) + if (cmp_reg != old_reg) + goto label; + + Note that we only do the plain load from memory once. Subsequent + iterations use the value loaded by the compare-and-swap pattern. */ + +void +ia64_expand_atomic_op (enum rtx_code code, rtx mem, rtx val, + rtx old_dst, rtx new_dst) +{ + enum machine_mode mode = GET_MODE (mem); + rtx old_reg, new_reg, cmp_reg, ar_ccv, label; + enum insn_code icode; + + /* Special case for using fetchadd. */ + if ((mode == SImode || mode == DImode) && fetchadd_operand (val, mode)) + { + if (!old_dst) + old_dst = gen_reg_rtx (mode); + + emit_insn (gen_memory_barrier ()); + + if (mode == SImode) + icode = CODE_FOR_fetchadd_acq_si; + else + icode = CODE_FOR_fetchadd_acq_di; + emit_insn (GEN_FCN (icode) (old_dst, mem, val)); + + if (new_dst) + { + new_reg = expand_simple_binop (mode, PLUS, old_dst, val, new_dst, + true, OPTAB_WIDEN); + if (new_reg != new_dst) + emit_move_insn (new_dst, new_reg); + } + return; + } + + /* Because of the volatile mem read, we get an ld.acq, which is the + front half of the full barrier. The end half is the cmpxchg.rel. */ + gcc_assert (MEM_VOLATILE_P (mem)); + + old_reg = gen_reg_rtx (DImode); + cmp_reg = gen_reg_rtx (DImode); + label = gen_label_rtx (); + + if (mode != DImode) + { + val = simplify_gen_subreg (DImode, val, mode, 0); + emit_insn (gen_extend_insn (cmp_reg, mem, DImode, mode, 1)); + } + else + emit_move_insn (cmp_reg, mem); + + emit_label (label); + + ar_ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); + emit_move_insn (old_reg, cmp_reg); + emit_move_insn (ar_ccv, cmp_reg); + + if (old_dst) + emit_move_insn (old_dst, gen_lowpart (mode, cmp_reg)); + + new_reg = cmp_reg; + if (code == NOT) + { + new_reg = expand_simple_unop (DImode, NOT, new_reg, NULL_RTX, true); + code = AND; + } + new_reg = expand_simple_binop (DImode, code, new_reg, val, NULL_RTX, + true, OPTAB_DIRECT); + + if (mode != DImode) + new_reg = gen_lowpart (mode, new_reg); + if (new_dst) + emit_move_insn (new_dst, new_reg); + + switch (mode) + { + case QImode: icode = CODE_FOR_cmpxchg_rel_qi; break; + case HImode: icode = CODE_FOR_cmpxchg_rel_hi; break; + case SImode: icode = CODE_FOR_cmpxchg_rel_si; break; + case DImode: icode = CODE_FOR_cmpxchg_rel_di; break; + default: + gcc_unreachable (); + } + + emit_insn (GEN_FCN (icode) (cmp_reg, mem, ar_ccv, new_reg)); + + emit_cmp_and_jump_insns (cmp_reg, old_reg, EQ, NULL, DImode, true, label); +} /* Begin the assembly file. */ static void ia64_file_start (void) { + /* Variable tracking should be run after all optimizations which change order + of insns. It also needs a valid CFG. This can't be done in + ia64_override_options, because flag_var_tracking is finalized after + that. */ + ia64_flag_var_tracking = flag_var_tracking; + flag_var_tracking = 0; + default_file_start (); emit_safe_across_calls (); } @@ -1780,7 +1999,7 @@ next_scratch_gr_reg (void) } /* There must be _something_ available. */ - abort (); + gcc_unreachable (); } /* Helper function for ia64_compute_frame_size, called through @@ -2077,39 +2296,49 @@ ia64_initial_elimination_offset (int from, int to) switch (from) { case FRAME_POINTER_REGNUM: - if (to == HARD_FRAME_POINTER_REGNUM) + switch (to) { + case HARD_FRAME_POINTER_REGNUM: if (current_function_is_leaf) offset = -current_frame_info.total_size; else offset = -(current_frame_info.total_size - current_function_outgoing_args_size - 16); - } - else if (to == STACK_POINTER_REGNUM) - { + break; + + case STACK_POINTER_REGNUM: if (current_function_is_leaf) offset = 0; else offset = 16 + current_function_outgoing_args_size; + break; + + default: + gcc_unreachable (); } - else - abort (); break; case ARG_POINTER_REGNUM: /* Arguments start above the 16 byte save area, unless stdarg in which case we store through the 16 byte save area. */ - if (to == HARD_FRAME_POINTER_REGNUM) - offset = 16 - current_function_pretend_args_size; - else if (to == STACK_POINTER_REGNUM) - offset = (current_frame_info.total_size - + 16 - current_function_pretend_args_size); - else - abort (); + switch (to) + { + case HARD_FRAME_POINTER_REGNUM: + offset = 16 - current_function_pretend_args_size; + break; + + case STACK_POINTER_REGNUM: + offset = (current_frame_info.total_size + + 16 - current_function_pretend_args_size); + break; + + default: + gcc_unreachable (); + } break; default: - abort (); + gcc_unreachable (); } return offset; @@ -2655,9 +2884,8 @@ ia64_expand_prologue (void) } /* We should now be at the base of the gr/br/fr spill area. */ - if (cfa_off != (current_frame_info.spill_cfa_off - + current_frame_info.spill_size)) - abort (); + gcc_assert (cfa_off == (current_frame_info.spill_cfa_off + + current_frame_info.spill_size)); /* Spill all general registers. */ for (regno = GR_REG (1); regno <= GR_REG (31); ++regno) @@ -2710,15 +2938,13 @@ ia64_expand_prologue (void) for (regno = FR_REG (2); regno <= FR_REG (127); ++regno) if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) { - if (cfa_off & 15) - abort (); + gcc_assert (!(cfa_off & 15)); reg = gen_rtx_REG (XFmode, regno); do_spill (gen_fr_spill_x, reg, cfa_off, reg); cfa_off -= 16; } - if (cfa_off != current_frame_info.spill_cfa_off) - abort (); + gcc_assert (cfa_off == current_frame_info.spill_cfa_off); finish_spill_pointers (); } @@ -2830,9 +3056,8 @@ ia64_expand_epilogue (int sibcall_p) } /* We should now be at the base of the gr/br/fr spill area. */ - if (cfa_off != (current_frame_info.spill_cfa_off - + current_frame_info.spill_size)) - abort (); + gcc_assert (cfa_off == (current_frame_info.spill_cfa_off + + current_frame_info.spill_size)); /* The GP may be stored on the stack in the prologue, but it's never restored in the epilogue. Skip the stack slot. */ @@ -2880,8 +3105,7 @@ ia64_expand_epilogue (int sibcall_p) for (regno = FR_REG (2); regno <= FR_REG (127); ++regno) if (TEST_HARD_REG_BIT (current_frame_info.mask, regno)) { - if (cfa_off & 15) - abort (); + gcc_assert (!(cfa_off & 15)); reg = gen_rtx_REG (XFmode, regno); do_restore (gen_fr_restore_x, reg, cfa_off); cfa_off -= 16; @@ -2894,8 +3118,7 @@ ia64_expand_epilogue (int sibcall_p) emit_move_insn (reg, ar_unat_save_reg); } - if (cfa_off != current_frame_info.spill_cfa_off) - abort (); + gcc_assert (cfa_off == current_frame_info.spill_cfa_off); finish_spill_pointers (); @@ -3348,7 +3571,7 @@ hfa_element_mode (tree type, bool nested) case VOID_TYPE: case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: case CHAR_TYPE: case POINTER_TYPE: case OFFSET_TYPE: case REFERENCE_TYPE: case METHOD_TYPE: - case FILE_TYPE: case LANG_TYPE: case FUNCTION_TYPE: + case LANG_TYPE: case FUNCTION_TYPE: return VOIDmode; /* Fortran complex types are supposed to be HFAs, so we need to handle @@ -3937,8 +4160,7 @@ ia64_function_value (tree valtype, tree func ATTRIBUTE_UNUSED) void ia64_output_dwarf_dtprel (FILE *file, int size, rtx x) { - if (size != 8) - abort (); + gcc_assert (size == 8); fputs ("\tdata8.ua\t@dtprel(", file); output_addr_const (file, x); fputs (")", file); @@ -4027,10 +4249,11 @@ ia64_print_operand (FILE * file, rtx x, int code) str = reg_names [FR_REG (0)]; else if (x == CONST1_RTX (GET_MODE (x))) str = reg_names [FR_REG (1)]; - else if (GET_CODE (x) == REG) - str = reg_names [REGNO (x)]; else - abort (); + { + gcc_assert (GET_CODE (x) == REG); + str = reg_names [REGNO (x)]; + } fputs (str, file); return; @@ -4068,13 +4291,12 @@ ia64_print_operand (FILE * file, rtx x, int code) x = XEXP (XEXP (XEXP (x, 0), 1), 1); if (GET_CODE (x) == CONST_INT) value = INTVAL (x); - else if (GET_CODE (x) == REG) + else { + gcc_assert (GET_CODE (x) == REG); fprintf (file, ", %s", reg_names[REGNO (x)]); return; } - else - abort (); break; case POST_INC: @@ -4356,7 +4578,7 @@ ia64_register_move_cost (enum machine_mode mode, enum reg_class from, break; default: - abort (); + gcc_unreachable (); } return 2; @@ -4554,7 +4776,7 @@ fix_range (const char *const_str) dash = strchr (str, '-'); if (!dash) { - warning ("value of -mfixed-range must have form REG1-REG2"); + warning (0, "value of -mfixed-range must have form REG1-REG2"); return; } *dash = '\0'; @@ -4566,14 +4788,14 @@ fix_range (const char *const_str) first = decode_reg_name (str); if (first < 0) { - warning ("unknown register name: %s", str); + warning (0, "unknown register name: %s", str); return; } last = decode_reg_name (dash + 1); if (last < 0) { - warning ("unknown register name: %s", dash + 1); + warning (0, "unknown register name: %s", dash + 1); return; } @@ -4581,7 +4803,7 @@ fix_range (const char *const_str) if (first > last) { - warning ("%s-%s is an empty range", str, dash + 1); + warning (0, "%s-%s is an empty range", str, dash + 1); return; } @@ -4662,18 +4884,13 @@ ia64_override_options (void) if (TARGET_INLINE_SQRT == INL_MIN_LAT) { - warning ("not yet implemented: latency-optimized inline square root"); + warning (0, "not yet implemented: latency-optimized inline square root"); TARGET_INLINE_SQRT = INL_MAX_THR; } ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload; flag_schedule_insns_after_reload = 0; - /* Variable tracking should be run after all optimizations which change order - of insns. It also needs a valid CFG. */ - ia64_flag_var_tracking = flag_var_tracking; - flag_var_tracking = 0; - ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE; init_machine_status = ia64_init_machine_status; @@ -4759,8 +4976,8 @@ struct reg_write_state rws_sum[NUM_REGS]; struct reg_write_state rws_insn[NUM_REGS]; /* Indicates whether this is the first instruction after a stop bit, - in which case we don't need another stop bit. Without this, we hit - the abort in ia64_variable_issue when scheduling an alloc. */ + in which case we don't need another stop bit. Without this, + ia64_variable_issue will die when scheduling an alloc. */ static int first_instruction; /* Misc flags needed to compute RAW/WAW dependencies while we are traversing @@ -4778,12 +4995,12 @@ struct reg_flags static void rws_update (struct reg_write_state *, int, struct reg_flags, int); static int rws_access_regno (int, struct reg_flags, int); static int rws_access_reg (rtx, struct reg_flags, int); -static void update_set_flags (rtx, struct reg_flags *, int *, rtx *); -static int set_src_needs_barrier (rtx, struct reg_flags, int, rtx); +static void update_set_flags (rtx, struct reg_flags *); +static int set_src_needs_barrier (rtx, struct reg_flags, int); static int rtx_needs_barrier (rtx, struct reg_flags, int); static void init_insn_group_barriers (void); -static int group_barrier_needed_p (rtx); -static int safe_group_barrier_needed_p (rtx); +static int group_barrier_needed (rtx); +static int safe_group_barrier_needed (rtx); /* Update *RWS for REGNO, which is being written by the current instruction, with predicate PRED, and associated register flags in FLAGS. */ @@ -4811,8 +5028,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) { int need_barrier = 0; - if (regno >= NUM_REGS) - abort (); + gcc_assert (regno < NUM_REGS); if (! PR_REGNO_P (regno)) flags.is_and = flags.is_or = 0; @@ -4822,8 +5038,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) int write_count; /* One insn writes same reg multiple times? */ - if (rws_insn[regno].write_count > 0) - abort (); + gcc_assert (!rws_insn[regno].write_count); /* Update info for current instruction. */ rws_update (rws_insn, regno, flags, pred); @@ -4864,7 +5079,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } } else @@ -4917,7 +5132,7 @@ rws_access_regno (int regno, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } } @@ -4945,12 +5160,10 @@ rws_access_reg (rtx reg, struct reg_flags flags, int pred) the condition, stored in *PFLAGS, *PPRED and *PCOND. */ static void -update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond) +update_set_flags (rtx x, struct reg_flags *pflags) { rtx src = SET_SRC (x); - *pcond = 0; - switch (GET_CODE (src)) { case CALL: @@ -4962,41 +5175,16 @@ update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond) return; else { - int is_complemented = 0; - /* X is a conditional move. */ rtx cond = XEXP (src, 0); - if (GET_CODE (cond) == EQ) - is_complemented = 1; cond = XEXP (cond, 0); - if (GET_CODE (cond) != REG - && REGNO_REG_CLASS (REGNO (cond)) != PR_REGS) - abort (); - *pcond = cond; - if (XEXP (src, 1) == SET_DEST (x) - || XEXP (src, 2) == SET_DEST (x)) - { - /* X is a conditional move that conditionally writes the - destination. */ - - /* We need another complement in this case. */ - if (XEXP (src, 1) == SET_DEST (x)) - is_complemented = ! is_complemented; - - *ppred = REGNO (cond); - if (is_complemented) - ++*ppred; - } - /* ??? If this is a conditional write to the dest, then this - instruction does not actually read one source. This probably - doesn't matter, because that source is also the dest. */ - /* ??? Multiple writes to predicate registers are allowed - if they are all AND type compares, or if they are all OR - type compares. We do not generate such instructions - currently. */ + /* We always split conditional moves into COND_EXEC patterns, so the + only pattern that can reach here is doloop_end_internal. We don't + need to do anything special for this pattern. */ + gcc_assert (GET_CODE (cond) == REG && REGNO (cond) == AR_LC_REGNUM); + return; } - /* ... fall through ... */ default: if (COMPARISON_P (src) @@ -5024,7 +5212,7 @@ update_set_flags (rtx x, struct reg_flags *pflags, int *ppred, rtx *pcond) for this insn. */ static int -set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond) +set_src_needs_barrier (rtx x, struct reg_flags flags, int pred) { int need_barrier = 0; rtx dst; @@ -5045,10 +5233,6 @@ set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond) need_barrier = rtx_needs_barrier (src, flags, pred); - /* This instruction unconditionally uses a predicate register. */ - if (cond) - need_barrier |= rws_access_reg (cond, flags, 0); - dst = SET_DEST (x); if (GET_CODE (dst) == ZERO_EXTRACT) { @@ -5071,7 +5255,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) int need_barrier = 0; const char *format_ptr; struct reg_flags new_flags; - rtx cond = 0; + rtx cond; if (! x) return 0; @@ -5081,8 +5265,8 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) switch (GET_CODE (x)) { case SET: - update_set_flags (x, &new_flags, &pred, &cond); - need_barrier = set_src_needs_barrier (x, new_flags, pred, cond); + update_set_flags (x, &new_flags); + need_barrier = set_src_needs_barrier (x, new_flags, pred); if (GET_CODE (SET_SRC (x)) != CALL) { new_flags.is_write = 1; @@ -5095,7 +5279,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) need_barrier |= rws_access_regno (AR_EC_REGNUM, new_flags, pred); /* Avoid multiple register writes, in case this is a pattern with - multiple CALL rtx. This avoids an abort in rws_access_reg. */ + multiple CALL rtx. This avoids a failure in rws_access_reg. */ if (! flags.is_sibcall && ! rws_insn[REG_AR_CFM].write_count) { new_flags.is_write = 1; @@ -5109,16 +5293,14 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) /* X is a predicated instruction. */ cond = COND_EXEC_TEST (x); - if (pred) - abort (); + gcc_assert (!pred); need_barrier = rtx_needs_barrier (cond, flags, 0); if (GET_CODE (cond) == EQ) is_complemented = 1; cond = XEXP (cond, 0); - if (GET_CODE (cond) != REG - && REGNO_REG_CLASS (REGNO (cond)) != PR_REGS) - abort (); + gcc_assert (GET_CODE (cond) == REG + && REGNO_REG_CLASS (REGNO (cond)) == PR_REGS); pred = REGNO (cond); if (is_complemented) ++pred; @@ -5139,7 +5321,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) || (MEM_VOLATILE_P (x) && TARGET_VOL_ASM_STOP)) { /* Avoid writing the register multiple times if we have multiple - asm outputs. This avoids an abort in rws_access_reg. */ + asm outputs. This avoids a failure in rws_access_reg. */ if (! rws_insn[REG_VOLATILE].write_count) { new_flags.is_write = 1; @@ -5165,9 +5347,8 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) switch (GET_CODE (pat)) { case SET: - update_set_flags (pat, &new_flags, &pred, &cond); - need_barrier |= set_src_needs_barrier (pat, new_flags, - pred, cond); + update_set_flags (pat, &new_flags); + need_barrier |= set_src_needs_barrier (pat, new_flags, pred); break; case USE: @@ -5202,8 +5383,8 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; case SUBREG: - x = SUBREG_REG (x); - /* FALLTHRU */ + need_barrier |= rtx_needs_barrier (SUBREG_REG (x), flags, pred); + break; case REG: if (REGNO (x) == AR_UNAT_REGNUM) { @@ -5226,8 +5407,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) /* Operators with side-effects. */ case POST_INC: case POST_DEC: - if (GET_CODE (XEXP (x, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (x, 0)) == REG); new_flags.is_write = 0; need_barrier = rws_access_reg (XEXP (x, 0), new_flags, pred); @@ -5236,8 +5416,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; case POST_MODIFY: - if (GET_CODE (XEXP (x, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (x, 0)) == REG); new_flags.is_write = 0; need_barrier = rws_access_reg (XEXP (x, 0), new_flags, pred); @@ -5268,7 +5447,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) /* VEC_SELECT's second argument is a PARALLEL with integers that describe the elements selected. On ia64, those integers are always constants. Avoid walking the PARALLEL so that we don't - get confused with "normal" parallels and abort. */ + get confused with "normal" parallels and then die. */ need_barrier = rtx_needs_barrier (XEXP (x, 0), flags, pred); break; @@ -5324,7 +5503,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } break; @@ -5357,7 +5536,7 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) return 0; default: - abort (); + gcc_unreachable (); } break; @@ -5396,14 +5575,14 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred) break; default: - abort (); + gcc_unreachable (); } break; } return need_barrier; } -/* Clear out the state for group_barrier_needed_p at the start of a +/* Clear out the state for group_barrier_needed at the start of a sequence of insns. */ static void @@ -5413,12 +5592,12 @@ init_insn_group_barriers (void) first_instruction = 1; } -/* Given the current state, recorded by previous calls to this function, - determine whether a group barrier (a stop bit) is necessary before INSN. - Return nonzero if so. */ +/* Given the current state, determine whether a group barrier (a stop bit) is + necessary before INSN. Return nonzero if so. This modifies the state to + include the effects of INSN as a side-effect. */ static int -group_barrier_needed_p (rtx insn) +group_barrier_needed (rtx insn) { rtx pat; int need_barrier = 0; @@ -5511,7 +5690,7 @@ group_barrier_needed_p (rtx insn) break; default: - abort (); + gcc_unreachable (); } if (first_instruction && INSN_P (insn) @@ -5526,10 +5705,10 @@ group_barrier_needed_p (rtx insn) return need_barrier; } -/* Like group_barrier_needed_p, but do not clobber the current state. */ +/* Like group_barrier_needed, but do not clobber the current state. */ static int -safe_group_barrier_needed_p (rtx insn) +safe_group_barrier_needed (rtx insn) { struct reg_write_state rws_saved[NUM_REGS]; int saved_first_instruction; @@ -5538,7 +5717,7 @@ safe_group_barrier_needed_p (rtx insn) memcpy (rws_saved, rws_sum, NUM_REGS * sizeof *rws_saved); saved_first_instruction = first_instruction; - t = group_barrier_needed_p (insn); + t = group_barrier_needed (insn); memcpy (rws_sum, rws_saved, NUM_REGS * sizeof *rws_saved); first_instruction = saved_first_instruction; @@ -5588,7 +5767,7 @@ emit_insn_group_barriers (FILE *dump) { insns_since_last_label = 1; - if (group_barrier_needed_p (insn)) + if (group_barrier_needed (insn)) { if (last_label) { @@ -5636,11 +5815,11 @@ emit_all_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) { if (recog_memoized (insn) == CODE_FOR_insn_group_barrier) init_insn_group_barriers (); - else if (group_barrier_needed_p (insn)) + else if (group_barrier_needed (insn)) { emit_insn_before (gen_insn_group_barrier (GEN_INT (3)), insn); init_insn_group_barriers (); - group_barrier_needed_p (insn); + group_barrier_needed (insn); } } } @@ -5820,6 +5999,12 @@ ia64_dependencies_evaluation_hook (rtx head, rtx tail) { rtx insn, link, next, next_tail; + /* Before reload, which_alternative is not set, which means that + ia64_safe_itanium_class will produce wrong results for (at least) + move instructions. */ + if (!reload_completed) + return; + next_tail = NEXT_INSN (tail); for (insn = head; insn != next_tail; insn = NEXT_INSN (insn)) if (INSN_P (insn)) @@ -5830,6 +6015,8 @@ ia64_dependencies_evaluation_hook (rtx head, rtx tail) { for (link = INSN_DEPEND (insn); link != 0; link = XEXP (link, 1)) { + if (REG_NOTE_KIND (link) != REG_DEP_TRUE) + continue; next = XEXP (link, 0); if ((ia64_safe_itanium_class (next) == ITANIUM_CLASS_ST || ia64_safe_itanium_class (next) == ITANIUM_CLASS_STF) @@ -5859,8 +6046,7 @@ ia64_sched_init (FILE *dump ATTRIBUTE_UNUSED, for (insn = NEXT_INSN (current_sched_info->prev_head); insn != current_sched_info->next_tail; insn = NEXT_INSN (insn)) - if (SCHED_GROUP_P (insn)) - abort (); + gcc_assert (!SCHED_GROUP_P (insn)); #endif last_scheduled_insn = NULL_RTX; init_insn_group_barriers (); @@ -5927,7 +6113,7 @@ ia64_dfa_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, int nr_need_stop = 0; for (insnp = ready; insnp < e_ready; insnp++) - if (safe_group_barrier_needed_p (*insnp)) + if (safe_group_barrier_needed (*insnp)) nr_need_stop++; if (reorder_type == 1 && n_ready == nr_need_stop) @@ -5941,7 +6127,7 @@ ia64_dfa_sched_reorder (FILE *dump, int sched_verbose, rtx *ready, while (insnp >= ready + deleted) { rtx insn = *insnp; - if (! safe_group_barrier_needed_p (insn)) + if (! safe_group_barrier_needed (insn)) break; memmove (ready + 1, ready, (insnp - ready) * sizeof (rtx)); *ready = insn; @@ -5992,8 +6178,9 @@ ia64_variable_issue (FILE *dump ATTRIBUTE_UNUSED, memcpy (prev_cycle_state, curr_state, dfa_state_size); if (reload_completed) { - if (group_barrier_needed_p (insn)) - abort (); + int needed = group_barrier_needed (insn); + + gcc_assert (!needed); if (GET_CODE (insn) == CALL_INSN) init_insn_group_barriers (); stops_p [INSN_UID (insn)] = stop_before_p; @@ -6008,10 +6195,9 @@ ia64_variable_issue (FILE *dump ATTRIBUTE_UNUSED, static int ia64_first_cycle_multipass_dfa_lookahead_guard (rtx insn) { - if (insn == NULL_RTX || !INSN_P (insn)) - abort (); + gcc_assert (insn && INSN_P (insn)); return (!reload_completed - || !safe_group_barrier_needed_p (insn)); + || !safe_group_barrier_needed (insn)); } /* The following variable value is pseudo-insn used by the DFA insn @@ -6030,9 +6216,8 @@ ia64_dfa_new_cycle (FILE *dump, int verbose, rtx insn, int last_clock, { int setup_clocks_p = FALSE; - if (insn == NULL_RTX || !INSN_P (insn)) - abort (); - if ((reload_completed && safe_group_barrier_needed_p (insn)) + gcc_assert (insn && INSN_P (insn)); + if ((reload_completed && safe_group_barrier_needed (insn)) || (last_scheduled_insn && (GET_CODE (last_scheduled_insn) == CALL_INSN || GET_CODE (PATTERN (last_scheduled_insn)) == ASM_INPUT @@ -6359,12 +6544,10 @@ issue_nops_and_insn (struct bundle_state *originator, int before_nops_num, curr_state->accumulated_insns_num = originator->accumulated_insns_num + before_nops_num; curr_state->branch_deviation = originator->branch_deviation; - if (insn == NULL_RTX) - abort (); - else if (INSN_CODE (insn) == CODE_FOR_insn_group_barrier) + gcc_assert (insn); + if (INSN_CODE (insn) == CODE_FOR_insn_group_barrier) { - if (GET_MODE (insn) == TImode) - abort (); + gcc_assert (GET_MODE (insn) != TImode); if (!try_issue_nops (curr_state, before_nops_num)) return; if (!try_issue_insn (curr_state, insn)) @@ -6384,9 +6567,9 @@ issue_nops_and_insn (struct bundle_state *originator, int before_nops_num, if (!try_issue_insn (curr_state, insn)) return; curr_state->accumulated_insns_num++; - if (GET_CODE (PATTERN (insn)) == ASM_INPUT - || asm_noperands (PATTERN (insn)) >= 0) - abort (); + gcc_assert (GET_CODE (PATTERN (insn)) != ASM_INPUT + && asm_noperands (PATTERN (insn)) < 0); + if (ia64_safe_type (insn) == TYPE_L) curr_state->accumulated_insns_num++; } @@ -6481,7 +6664,13 @@ get_max_pos (state_t state) /* The function returns code of a possible template for given position and state. The function should be called only with 2 values of - position equal to 3 or 6. */ + position equal to 3 or 6. We avoid generating F NOPs by putting + templates containing F insns at the end of the template search + because undocumented anomaly in McKinley derived cores which can + cause stalls if an F-unit insn (including a NOP) is issued within a + six-cycle window after reading certain application registers (such + as ar.bsp). Furthermore, power-considerations also argue against + the use of F-unit instructions unless they're really needed. */ static int get_template (state_t state, int pos) @@ -6489,53 +6678,53 @@ get_template (state_t state, int pos) switch (pos) { case 3: - if (cpu_unit_reservation_p (state, _0mii_)) - return 0; - else if (cpu_unit_reservation_p (state, _0mmi_)) + if (cpu_unit_reservation_p (state, _0mmi_)) return 1; - else if (cpu_unit_reservation_p (state, _0mfi_)) - return 2; - else if (cpu_unit_reservation_p (state, _0mmf_)) - return 3; - else if (cpu_unit_reservation_p (state, _0bbb_)) - return 4; - else if (cpu_unit_reservation_p (state, _0mbb_)) - return 5; - else if (cpu_unit_reservation_p (state, _0mib_)) - return 6; + else if (cpu_unit_reservation_p (state, _0mii_)) + return 0; else if (cpu_unit_reservation_p (state, _0mmb_)) return 7; + else if (cpu_unit_reservation_p (state, _0mib_)) + return 6; + else if (cpu_unit_reservation_p (state, _0mbb_)) + return 5; + else if (cpu_unit_reservation_p (state, _0bbb_)) + return 4; + else if (cpu_unit_reservation_p (state, _0mmf_)) + return 3; + else if (cpu_unit_reservation_p (state, _0mfi_)) + return 2; else if (cpu_unit_reservation_p (state, _0mfb_)) return 8; else if (cpu_unit_reservation_p (state, _0mlx_)) return 9; else - abort (); + gcc_unreachable (); case 6: - if (cpu_unit_reservation_p (state, _1mii_)) - return 0; - else if (cpu_unit_reservation_p (state, _1mmi_)) + if (cpu_unit_reservation_p (state, _1mmi_)) return 1; - else if (cpu_unit_reservation_p (state, _1mfi_)) - return 2; - else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_)) - return 3; - else if (cpu_unit_reservation_p (state, _1bbb_)) - return 4; - else if (cpu_unit_reservation_p (state, _1mbb_)) - return 5; - else if (cpu_unit_reservation_p (state, _1mib_)) - return 6; + else if (cpu_unit_reservation_p (state, _1mii_)) + return 0; else if (cpu_unit_reservation_p (state, _1mmb_)) return 7; + else if (cpu_unit_reservation_p (state, _1mib_)) + return 6; + else if (cpu_unit_reservation_p (state, _1mbb_)) + return 5; + else if (cpu_unit_reservation_p (state, _1bbb_)) + return 4; + else if (_1mmf_ >= 0 && cpu_unit_reservation_p (state, _1mmf_)) + return 3; + else if (cpu_unit_reservation_p (state, _1mfi_)) + return 2; else if (cpu_unit_reservation_p (state, _1mfb_)) return 8; else if (cpu_unit_reservation_p (state, _1mlx_)) return 9; else - abort (); + gcc_unreachable (); default: - abort (); + gcc_unreachable (); } } @@ -6661,11 +6850,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) insn != NULL_RTX; insn = next_insn) { - if (!INSN_P (insn) - || ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IGNORE - || GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER) - abort (); + gcc_assert (INSN_P (insn) + && ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER); type = ia64_safe_type (insn); next_insn = get_next_important_insn (NEXT_INSN (insn), tail); insn_num++; @@ -6705,8 +6893,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) issue_nops_and_insn (curr_state, 0, insn, bundle_end_p, only_bundle_end_p); } - if (index_to_bundle_states [insn_num] == NULL) - abort (); + gcc_assert (index_to_bundle_states [insn_num]); for (curr_state = index_to_bundle_states [insn_num]; curr_state != NULL; curr_state = curr_state->next) @@ -6739,10 +6926,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) INSN_UID (insn)); } } - if (index_to_bundle_states [insn_num] == NULL) - /* We should find a solution because the 2nd insn scheduling has - found one. */ - abort (); + + /* We should find a solution because the 2nd insn scheduling has + found one. */ + gcc_assert (index_to_bundle_states [insn_num]); /* Find a state corresponding to the best insn sequence. */ best_state = NULL; for (curr_state = index_to_bundle_states [insn_num]; @@ -6820,8 +7007,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) if (max_pos > 3 && template1 < 0) /* It may happen when we have the stop inside a bundle. */ { - if (pos > 3) - abort (); + gcc_assert (pos <= 3); template1 = get_template (curr_state->dfa_state, 3); pos += 3; } @@ -6832,14 +7018,12 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) nop = gen_nop (); emit_insn_after (nop, insn); pos--; - if (pos < 0) - abort (); + gcc_assert (pos >= 0); if (pos % 3 == 0) { /* We are at the start of a bundle: emit the template (it should be defined). */ - if (template0 < 0) - abort (); + gcc_assert (template0 >= 0); b = gen_bundle_selector (GEN_INT (template0)); ia64_emit_insn_before (b, nop); /* If we have two bundle window, we make one bundle @@ -6858,8 +7042,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) /* Long insn takes 2 slots. */ if (ia64_safe_type (insn) == TYPE_L) pos--; - if (pos < 0) - abort (); + gcc_assert (pos >= 0); if (pos % 3 == 0 && INSN_CODE (insn) != CODE_FOR_insn_group_barrier && GET_CODE (PATTERN (insn)) != ASM_INPUT @@ -6867,8 +7050,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) { /* The current insn is at the bundle start: emit the template. */ - if (template0 < 0) - abort (); + gcc_assert (template0 >= 0); b = gen_bundle_selector (GEN_INT (template0)); ia64_emit_insn_before (b, insn); b = PREV_INSN (insn); @@ -6886,14 +7068,12 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) nop = PREV_INSN (insn); insn = nop; pos--; - if (pos < 0) - abort (); + gcc_assert (pos >= 0); if (pos % 3 == 0) { /* See comment above in analogous place for emitting nops after the insn. */ - if (template0 < 0) - abort (); + gcc_assert (template0 >= 0); b = gen_bundle_selector (GEN_INT (template0)); ia64_emit_insn_before (b, insn); b = PREV_INSN (insn); @@ -6913,11 +7093,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) insn != NULL_RTX; insn = next_insn) { - if (!INSN_P (insn) - || ia64_safe_itanium_class (insn) == ITANIUM_CLASS_IGNORE - || GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER) - abort (); + gcc_assert (INSN_P (insn) + && ia64_safe_itanium_class (insn) != ITANIUM_CLASS_IGNORE + && GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER); next_insn = get_next_important_insn (NEXT_INSN (insn), tail); if (INSN_UID (insn) < clocks_length && add_cycles [INSN_UID (insn)]) /* We found a MM-insn which needs additional cycles. */ @@ -6955,9 +7134,9 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail) bundle start, there are no more 3 insns in the bundle, and the MM-insn is not at the start of bundle with template MLX. */ - if ((pred_stop_p && n == 0) || n > 2 - || (template0 == 9 && n != 0)) - abort (); + gcc_assert ((!pred_stop_p || n) + && n <= 2 + && (template0 != 9 || !n)); /* Put nops after the insn in the bundle. */ for (j = 3 - n; j > 0; j --) ia64_emit_insn_before (gen_nop (), insn); @@ -7071,7 +7250,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) need_barrier_p = 0; prev_insn = NULL_RTX; } - else if (need_barrier_p || group_barrier_needed_p (insn)) + else if (need_barrier_p || group_barrier_needed (insn)) { if (TARGET_EARLY_STOP_BITS) { @@ -7095,7 +7274,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) last != insn; last = NEXT_INSN (last)) if (INSN_P (last)) - group_barrier_needed_p (last); + group_barrier_needed (last); } else { @@ -7103,7 +7282,7 @@ final_emit_insn_group_barriers (FILE *dump ATTRIBUTE_UNUSED) insn); init_insn_group_barriers (); } - group_barrier_needed_p (insn); + group_barrier_needed (insn); prev_insn = NULL_RTX; } else if (recog_memoized (insn) >= 0) @@ -7162,18 +7341,19 @@ ia64_st_address_bypass_p (rtx producer, rtx consumer) { rtx dest, reg, mem; - if (producer == NULL_RTX || consumer == NULL_RTX) - abort (); + gcc_assert (producer && consumer); dest = ia64_single_set (producer); - if (dest == NULL_RTX || (reg = SET_DEST (dest)) == NULL_RTX - || (GET_CODE (reg) != REG && GET_CODE (reg) != SUBREG)) - abort (); + gcc_assert (dest); + reg = SET_DEST (dest); + gcc_assert (reg); if (GET_CODE (reg) == SUBREG) reg = SUBREG_REG (reg); + gcc_assert (GET_CODE (reg) == REG); + dest = ia64_single_set (consumer); - if (dest == NULL_RTX || (mem = SET_DEST (dest)) == NULL_RTX - || GET_CODE (mem) != MEM) - abort (); + gcc_assert (dest); + mem = SET_DEST (dest); + gcc_assert (mem && GET_CODE (mem) == MEM); return reg_mentioned_p (reg, mem); } @@ -7185,25 +7365,26 @@ ia64_ld_address_bypass_p (rtx producer, rtx consumer) { rtx dest, src, reg, mem; - if (producer == NULL_RTX || consumer == NULL_RTX) - abort (); + gcc_assert (producer && consumer); dest = ia64_single_set (producer); - if (dest == NULL_RTX || (reg = SET_DEST (dest)) == NULL_RTX - || (GET_CODE (reg) != REG && GET_CODE (reg) != SUBREG)) - abort (); + gcc_assert (dest); + reg = SET_DEST (dest); + gcc_assert (reg); if (GET_CODE (reg) == SUBREG) reg = SUBREG_REG (reg); + gcc_assert (GET_CODE (reg) == REG); + src = ia64_single_set (consumer); - if (src == NULL_RTX || (mem = SET_SRC (src)) == NULL_RTX) - abort (); + gcc_assert (src); + mem = SET_SRC (src); + gcc_assert (mem); if (GET_CODE (mem) == UNSPEC && XVECLEN (mem, 0) > 0) mem = XVECEXP (mem, 0, 0); while (GET_CODE (mem) == SUBREG || GET_CODE (mem) == ZERO_EXTEND) mem = XEXP (mem, 0); /* Note that LO_SUM is used for GOT loads. */ - if (GET_CODE (mem) != LO_SUM && GET_CODE (mem) != MEM) - abort (); + gcc_assert (GET_CODE (mem) == LO_SUM || GET_CODE (mem) == MEM); return reg_mentioned_p (reg, mem); } @@ -7611,22 +7792,21 @@ process_set (FILE *asm_out_file, rtx pat) { rtx op0 = XEXP (src, 0); rtx op1 = XEXP (src, 1); - if (op0 == dest && GET_CODE (op1) == CONST_INT) - { - if (INTVAL (op1) < 0) - fprintf (asm_out_file, "\t.fframe "HOST_WIDE_INT_PRINT_DEC"\n", - -INTVAL (op1)); - else - process_epilogue (); - } + + gcc_assert (op0 == dest && GET_CODE (op1) == CONST_INT); + + if (INTVAL (op1) < 0) + fprintf (asm_out_file, "\t.fframe "HOST_WIDE_INT_PRINT_DEC"\n", + -INTVAL (op1)); else - abort (); + process_epilogue (); } - else if (GET_CODE (src) == REG - && REGNO (src) == HARD_FRAME_POINTER_REGNUM) - process_epilogue (); else - abort (); + { + gcc_assert (GET_CODE (src) == REG + && REGNO (src) == HARD_FRAME_POINTER_REGNUM); + process_epilogue (); + } return 1; } @@ -7641,44 +7821,39 @@ process_set (FILE *asm_out_file, rtx pat) { case BR_REG (0): /* Saving return address pointer. */ - if (dest_regno != current_frame_info.reg_save_b0) - abort (); + gcc_assert (dest_regno == current_frame_info.reg_save_b0); fprintf (asm_out_file, "\t.save rp, r%d\n", ia64_dbx_register_number (dest_regno)); return 1; case PR_REG (0): - if (dest_regno != current_frame_info.reg_save_pr) - abort (); + gcc_assert (dest_regno == current_frame_info.reg_save_pr); fprintf (asm_out_file, "\t.save pr, r%d\n", ia64_dbx_register_number (dest_regno)); return 1; case AR_UNAT_REGNUM: - if (dest_regno != current_frame_info.reg_save_ar_unat) - abort (); + gcc_assert (dest_regno == current_frame_info.reg_save_ar_unat); fprintf (asm_out_file, "\t.save ar.unat, r%d\n", ia64_dbx_register_number (dest_regno)); return 1; case AR_LC_REGNUM: - if (dest_regno != current_frame_info.reg_save_ar_lc) - abort (); + gcc_assert (dest_regno == current_frame_info.reg_save_ar_lc); fprintf (asm_out_file, "\t.save ar.lc, r%d\n", ia64_dbx_register_number (dest_regno)); return 1; case STACK_POINTER_REGNUM: - if (dest_regno != HARD_FRAME_POINTER_REGNUM - || ! frame_pointer_needed) - abort (); + gcc_assert (dest_regno == HARD_FRAME_POINTER_REGNUM + && frame_pointer_needed); fprintf (asm_out_file, "\t.vframe r%d\n", ia64_dbx_register_number (dest_regno)); return 1; default: /* Everything else should indicate being stored to memory. */ - abort (); + gcc_unreachable (); } } @@ -7694,55 +7869,50 @@ process_set (FILE *asm_out_file, rtx pat) base = XEXP (dest, 0); off = 0; } - else if (GET_CODE (XEXP (dest, 0)) == PLUS - && GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT) + else { + gcc_assert (GET_CODE (XEXP (dest, 0)) == PLUS + && GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT); base = XEXP (XEXP (dest, 0), 0); off = INTVAL (XEXP (XEXP (dest, 0), 1)); } - else - abort (); if (base == hard_frame_pointer_rtx) { saveop = ".savepsp"; off = - off; } - else if (base == stack_pointer_rtx) - saveop = ".savesp"; else - abort (); + { + gcc_assert (base == stack_pointer_rtx); + saveop = ".savesp"; + } src_regno = REGNO (src); switch (src_regno) { case BR_REG (0): - if (current_frame_info.reg_save_b0 != 0) - abort (); + gcc_assert (!current_frame_info.reg_save_b0); fprintf (asm_out_file, "\t%s rp, %ld\n", saveop, off); return 1; case PR_REG (0): - if (current_frame_info.reg_save_pr != 0) - abort (); + gcc_assert (!current_frame_info.reg_save_pr); fprintf (asm_out_file, "\t%s pr, %ld\n", saveop, off); return 1; case AR_LC_REGNUM: - if (current_frame_info.reg_save_ar_lc != 0) - abort (); + gcc_assert (!current_frame_info.reg_save_ar_lc); fprintf (asm_out_file, "\t%s ar.lc, %ld\n", saveop, off); return 1; case AR_PFS_REGNUM: - if (current_frame_info.reg_save_ar_pfs != 0) - abort (); + gcc_assert (!current_frame_info.reg_save_ar_pfs); fprintf (asm_out_file, "\t%s ar.pfs, %ld\n", saveop, off); return 1; case AR_UNAT_REGNUM: - if (current_frame_info.reg_save_ar_unat != 0) - abort (); + gcc_assert (!current_frame_info.reg_save_ar_unat); fprintf (asm_out_file, "\t%s ar.unat, %ld\n", saveop, off); return 1; @@ -7842,57 +8012,21 @@ process_for_unwind_directive (FILE *asm_out_file, rtx insn) } default: - abort (); + gcc_unreachable (); } } } +enum ia64_builtins +{ + IA64_BUILTIN_BSP, + IA64_BUILTIN_FLUSHRS +}; + void ia64_init_builtins (void) { - tree psi_type_node = build_pointer_type (integer_type_node); - tree pdi_type_node = build_pointer_type (long_integer_type_node); - - /* __sync_val_compare_and_swap_si, __sync_bool_compare_and_swap_si */ - tree si_ftype_psi_si_si - = build_function_type_list (integer_type_node, - psi_type_node, integer_type_node, - integer_type_node, NULL_TREE); - - /* __sync_val_compare_and_swap_di */ - tree di_ftype_pdi_di_di - = build_function_type_list (long_integer_type_node, - pdi_type_node, long_integer_type_node, - long_integer_type_node, NULL_TREE); - /* __sync_bool_compare_and_swap_di */ - tree si_ftype_pdi_di_di - = build_function_type_list (integer_type_node, - pdi_type_node, long_integer_type_node, - long_integer_type_node, NULL_TREE); - /* __sync_synchronize */ - tree void_ftype_void - = build_function_type (void_type_node, void_list_node); - - /* __sync_lock_test_and_set_si */ - tree si_ftype_psi_si - = build_function_type_list (integer_type_node, - psi_type_node, integer_type_node, NULL_TREE); - - /* __sync_lock_test_and_set_di */ - tree di_ftype_pdi_di - = build_function_type_list (long_integer_type_node, - pdi_type_node, long_integer_type_node, - NULL_TREE); - - /* __sync_lock_release_si */ - tree void_ftype_psi - = build_function_type_list (void_type_node, psi_type_node, NULL_TREE); - - /* __sync_lock_release_di */ - tree void_ftype_pdi - = build_function_type_list (void_type_node, pdi_type_node, NULL_TREE); - tree fpreg_type; tree float80_type; @@ -7927,27 +8061,6 @@ ia64_init_builtins (void) lang_hooks.builtin_function ((name), (type), (code), BUILT_IN_MD, \ NULL, NULL_TREE) - def_builtin ("__sync_val_compare_and_swap_si", si_ftype_psi_si_si, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI); - def_builtin ("__sync_val_compare_and_swap_di", di_ftype_pdi_di_di, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI); - def_builtin ("__sync_bool_compare_and_swap_si", si_ftype_psi_si_si, - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI); - def_builtin ("__sync_bool_compare_and_swap_di", si_ftype_pdi_di_di, - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI); - - def_builtin ("__sync_synchronize", void_ftype_void, - IA64_BUILTIN_SYNCHRONIZE); - - def_builtin ("__sync_lock_test_and_set_si", si_ftype_psi_si, - IA64_BUILTIN_LOCK_TEST_AND_SET_SI); - def_builtin ("__sync_lock_test_and_set_di", di_ftype_pdi_di, - IA64_BUILTIN_LOCK_TEST_AND_SET_DI); - def_builtin ("__sync_lock_release_si", void_ftype_psi, - IA64_BUILTIN_LOCK_RELEASE_SI); - def_builtin ("__sync_lock_release_di", void_ftype_pdi, - IA64_BUILTIN_LOCK_RELEASE_DI); - def_builtin ("__builtin_ia64_bsp", build_function_type (ptr_type_node, void_list_node), IA64_BUILTIN_BSP); @@ -7956,322 +8069,9 @@ ia64_init_builtins (void) build_function_type (void_type_node, void_list_node), IA64_BUILTIN_FLUSHRS); - def_builtin ("__sync_fetch_and_add_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_ADD_SI); - def_builtin ("__sync_fetch_and_sub_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_SUB_SI); - def_builtin ("__sync_fetch_and_or_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_OR_SI); - def_builtin ("__sync_fetch_and_and_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_AND_SI); - def_builtin ("__sync_fetch_and_xor_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_XOR_SI); - def_builtin ("__sync_fetch_and_nand_si", si_ftype_psi_si, - IA64_BUILTIN_FETCH_AND_NAND_SI); - - def_builtin ("__sync_add_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_ADD_AND_FETCH_SI); - def_builtin ("__sync_sub_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_SUB_AND_FETCH_SI); - def_builtin ("__sync_or_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_OR_AND_FETCH_SI); - def_builtin ("__sync_and_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_AND_AND_FETCH_SI); - def_builtin ("__sync_xor_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_XOR_AND_FETCH_SI); - def_builtin ("__sync_nand_and_fetch_si", si_ftype_psi_si, - IA64_BUILTIN_NAND_AND_FETCH_SI); - - def_builtin ("__sync_fetch_and_add_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_ADD_DI); - def_builtin ("__sync_fetch_and_sub_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_SUB_DI); - def_builtin ("__sync_fetch_and_or_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_OR_DI); - def_builtin ("__sync_fetch_and_and_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_AND_DI); - def_builtin ("__sync_fetch_and_xor_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_XOR_DI); - def_builtin ("__sync_fetch_and_nand_di", di_ftype_pdi_di, - IA64_BUILTIN_FETCH_AND_NAND_DI); - - def_builtin ("__sync_add_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_ADD_AND_FETCH_DI); - def_builtin ("__sync_sub_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_SUB_AND_FETCH_DI); - def_builtin ("__sync_or_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_OR_AND_FETCH_DI); - def_builtin ("__sync_and_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_AND_AND_FETCH_DI); - def_builtin ("__sync_xor_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_XOR_AND_FETCH_DI); - def_builtin ("__sync_nand_and_fetch_di", di_ftype_pdi_di, - IA64_BUILTIN_NAND_AND_FETCH_DI); - #undef def_builtin } -/* Expand fetch_and_op intrinsics. The basic code sequence is: - - mf - tmp = [ptr]; - do { - ret = tmp; - ar.ccv = tmp; - tmp = value; - cmpxchgsz.acq tmp = [ptr], tmp - } while (tmp != ret) -*/ - -static rtx -ia64_expand_fetch_and_op (optab binoptab, enum machine_mode mode, - tree arglist, rtx target) -{ - rtx ret, label, tmp, ccv, insn, mem, value; - tree arg0, arg1; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - mem = expand_expr (arg0, NULL_RTX, Pmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE(mem) != Pmode) - mem = convert_memory_address (Pmode, mem); -#endif - value = expand_expr (arg1, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (Pmode, mem)); - MEM_VOLATILE_P (mem) = 1; - - if (target && register_operand (target, mode)) - ret = target; - else - ret = gen_reg_rtx (mode); - - emit_insn (gen_mf ()); - - /* Special case for fetchadd instructions. */ - if (binoptab == add_optab && fetchadd_operand (value, VOIDmode)) - { - if (mode == SImode) - insn = gen_fetchadd_acq_si (ret, mem, value); - else - insn = gen_fetchadd_acq_di (ret, mem, value); - emit_insn (insn); - return ret; - } - - tmp = gen_reg_rtx (mode); - /* ar.ccv must always be loaded with a zero-extended DImode value. */ - ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); - emit_move_insn (tmp, mem); - - label = gen_label_rtx (); - emit_label (label); - emit_move_insn (ret, tmp); - convert_move (ccv, tmp, /*unsignedp=*/1); - - /* Perform the specific operation. Special case NAND by noticing - one_cmpl_optab instead. */ - if (binoptab == one_cmpl_optab) - { - tmp = expand_unop (mode, binoptab, tmp, NULL, OPTAB_WIDEN); - binoptab = and_optab; - } - tmp = expand_binop (mode, binoptab, tmp, value, tmp, 1, OPTAB_WIDEN); - - if (mode == SImode) - insn = gen_cmpxchg_acq_si (tmp, mem, tmp, ccv); - else - insn = gen_cmpxchg_acq_di (tmp, mem, tmp, ccv); - emit_insn (insn); - - emit_cmp_and_jump_insns (tmp, ret, NE, 0, mode, 1, label); - - return ret; -} - -/* Expand op_and_fetch intrinsics. The basic code sequence is: - - mf - tmp = [ptr]; - do { - old = tmp; - ar.ccv = tmp; - ret = tmp value; - cmpxchgsz.acq tmp = [ptr], ret - } while (tmp != old) -*/ - -static rtx -ia64_expand_op_and_fetch (optab binoptab, enum machine_mode mode, - tree arglist, rtx target) -{ - rtx old, label, tmp, ret, ccv, insn, mem, value; - tree arg0, arg1; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - mem = expand_expr (arg0, NULL_RTX, Pmode, 0); -#ifdef POINTERS_EXTEND_UNSIGNED - if (GET_MODE(mem) != Pmode) - mem = convert_memory_address (Pmode, mem); -#endif - - value = expand_expr (arg1, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (Pmode, mem)); - MEM_VOLATILE_P (mem) = 1; - - if (target && ! register_operand (target, mode)) - target = NULL_RTX; - - emit_insn (gen_mf ()); - tmp = gen_reg_rtx (mode); - old = gen_reg_rtx (mode); - /* ar.ccv must always be loaded with a zero-extended DImode value. */ - ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); - - emit_move_insn (tmp, mem); - - label = gen_label_rtx (); - emit_label (label); - emit_move_insn (old, tmp); - convert_move (ccv, tmp, /*unsignedp=*/1); - - /* Perform the specific operation. Special case NAND by noticing - one_cmpl_optab instead. */ - if (binoptab == one_cmpl_optab) - { - tmp = expand_unop (mode, binoptab, tmp, NULL, OPTAB_WIDEN); - binoptab = and_optab; - } - ret = expand_binop (mode, binoptab, tmp, value, target, 1, OPTAB_WIDEN); - - if (mode == SImode) - insn = gen_cmpxchg_acq_si (tmp, mem, ret, ccv); - else - insn = gen_cmpxchg_acq_di (tmp, mem, ret, ccv); - emit_insn (insn); - - emit_cmp_and_jump_insns (tmp, old, NE, 0, mode, 1, label); - - return ret; -} - -/* Expand val_ and bool_compare_and_swap. For val_ we want: - - ar.ccv = oldval - mf - cmpxchgsz.acq ret = [ptr], newval, ar.ccv - return ret - - For bool_ it's the same except return ret == oldval. -*/ - -static rtx -ia64_expand_compare_and_swap (enum machine_mode rmode, enum machine_mode mode, - int boolp, tree arglist, rtx target) -{ - tree arg0, arg1, arg2; - rtx mem, old, new, ccv, tmp, insn; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - arg2 = TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))); - mem = expand_expr (arg0, NULL_RTX, ptr_mode, 0); - old = expand_expr (arg1, NULL_RTX, mode, 0); - new = expand_expr (arg2, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (ptr_mode, mem)); - MEM_VOLATILE_P (mem) = 1; - - if (GET_MODE (old) != mode) - old = convert_to_mode (mode, old, /*unsignedp=*/1); - if (GET_MODE (new) != mode) - new = convert_to_mode (mode, new, /*unsignedp=*/1); - - if (! register_operand (old, mode)) - old = copy_to_mode_reg (mode, old); - if (! register_operand (new, mode)) - new = copy_to_mode_reg (mode, new); - - if (! boolp && target && register_operand (target, mode)) - tmp = target; - else - tmp = gen_reg_rtx (mode); - - ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); - convert_move (ccv, old, /*unsignedp=*/1); - emit_insn (gen_mf ()); - if (mode == SImode) - insn = gen_cmpxchg_acq_si (tmp, mem, new, ccv); - else - insn = gen_cmpxchg_acq_di (tmp, mem, new, ccv); - emit_insn (insn); - - if (boolp) - { - if (! target) - target = gen_reg_rtx (rmode); - return emit_store_flag_force (target, EQ, tmp, old, mode, 1, 1); - } - else - return tmp; -} - -/* Expand lock_test_and_set. I.e. `xchgsz ret = [ptr], new'. */ - -static rtx -ia64_expand_lock_test_and_set (enum machine_mode mode, tree arglist, - rtx target) -{ - tree arg0, arg1; - rtx mem, new, ret, insn; - - arg0 = TREE_VALUE (arglist); - arg1 = TREE_VALUE (TREE_CHAIN (arglist)); - mem = expand_expr (arg0, NULL_RTX, ptr_mode, 0); - new = expand_expr (arg1, NULL_RTX, mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (ptr_mode, mem)); - MEM_VOLATILE_P (mem) = 1; - if (! register_operand (new, mode)) - new = copy_to_mode_reg (mode, new); - - if (target && register_operand (target, mode)) - ret = target; - else - ret = gen_reg_rtx (mode); - - if (mode == SImode) - insn = gen_xchgsi (ret, mem, new); - else - insn = gen_xchgdi (ret, mem, new); - emit_insn (insn); - - return ret; -} - -/* Expand lock_release. I.e. `stsz.rel [ptr] = r0'. */ - -static rtx -ia64_expand_lock_release (enum machine_mode mode, tree arglist, - rtx target ATTRIBUTE_UNUSED) -{ - tree arg0; - rtx mem; - - arg0 = TREE_VALUE (arglist); - mem = expand_expr (arg0, NULL_RTX, ptr_mode, 0); - - mem = gen_rtx_MEM (mode, force_reg (ptr_mode, mem)); - MEM_VOLATILE_P (mem) = 1; - - emit_move_insn (mem, const0_rtx); - - return const0_rtx; -} - rtx ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED, @@ -8279,89 +8079,9 @@ ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, { tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); unsigned int fcode = DECL_FUNCTION_CODE (fndecl); - tree arglist = TREE_OPERAND (exp, 1); - enum machine_mode rmode = VOIDmode; - - switch (fcode) - { - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: - mode = SImode; - rmode = SImode; - break; - - case IA64_BUILTIN_LOCK_TEST_AND_SET_SI: - case IA64_BUILTIN_LOCK_RELEASE_SI: - case IA64_BUILTIN_FETCH_AND_ADD_SI: - case IA64_BUILTIN_FETCH_AND_SUB_SI: - case IA64_BUILTIN_FETCH_AND_OR_SI: - case IA64_BUILTIN_FETCH_AND_AND_SI: - case IA64_BUILTIN_FETCH_AND_XOR_SI: - case IA64_BUILTIN_FETCH_AND_NAND_SI: - case IA64_BUILTIN_ADD_AND_FETCH_SI: - case IA64_BUILTIN_SUB_AND_FETCH_SI: - case IA64_BUILTIN_OR_AND_FETCH_SI: - case IA64_BUILTIN_AND_AND_FETCH_SI: - case IA64_BUILTIN_XOR_AND_FETCH_SI: - case IA64_BUILTIN_NAND_AND_FETCH_SI: - mode = SImode; - break; - - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: - mode = DImode; - rmode = SImode; - break; - - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: - mode = DImode; - rmode = DImode; - break; - - case IA64_BUILTIN_LOCK_TEST_AND_SET_DI: - case IA64_BUILTIN_LOCK_RELEASE_DI: - case IA64_BUILTIN_FETCH_AND_ADD_DI: - case IA64_BUILTIN_FETCH_AND_SUB_DI: - case IA64_BUILTIN_FETCH_AND_OR_DI: - case IA64_BUILTIN_FETCH_AND_AND_DI: - case IA64_BUILTIN_FETCH_AND_XOR_DI: - case IA64_BUILTIN_FETCH_AND_NAND_DI: - case IA64_BUILTIN_ADD_AND_FETCH_DI: - case IA64_BUILTIN_SUB_AND_FETCH_DI: - case IA64_BUILTIN_OR_AND_FETCH_DI: - case IA64_BUILTIN_AND_AND_FETCH_DI: - case IA64_BUILTIN_XOR_AND_FETCH_DI: - case IA64_BUILTIN_NAND_AND_FETCH_DI: - mode = DImode; - break; - - default: - break; - } switch (fcode) { - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI: - case IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI: - return ia64_expand_compare_and_swap (rmode, mode, 1, arglist, - target); - - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI: - case IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI: - return ia64_expand_compare_and_swap (rmode, mode, 0, arglist, - target); - - case IA64_BUILTIN_SYNCHRONIZE: - emit_insn (gen_mf ()); - return const0_rtx; - - case IA64_BUILTIN_LOCK_TEST_AND_SET_SI: - case IA64_BUILTIN_LOCK_TEST_AND_SET_DI: - return ia64_expand_lock_test_and_set (mode, arglist, target); - - case IA64_BUILTIN_LOCK_RELEASE_SI: - case IA64_BUILTIN_LOCK_RELEASE_DI: - return ia64_expand_lock_release (mode, arglist, target); - case IA64_BUILTIN_BSP: if (! target || ! register_operand (target, DImode)) target = gen_reg_rtx (DImode); @@ -8375,54 +8095,6 @@ ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, emit_insn (gen_flushrs ()); return const0_rtx; - case IA64_BUILTIN_FETCH_AND_ADD_SI: - case IA64_BUILTIN_FETCH_AND_ADD_DI: - return ia64_expand_fetch_and_op (add_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_SUB_SI: - case IA64_BUILTIN_FETCH_AND_SUB_DI: - return ia64_expand_fetch_and_op (sub_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_OR_SI: - case IA64_BUILTIN_FETCH_AND_OR_DI: - return ia64_expand_fetch_and_op (ior_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_AND_SI: - case IA64_BUILTIN_FETCH_AND_AND_DI: - return ia64_expand_fetch_and_op (and_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_XOR_SI: - case IA64_BUILTIN_FETCH_AND_XOR_DI: - return ia64_expand_fetch_and_op (xor_optab, mode, arglist, target); - - case IA64_BUILTIN_FETCH_AND_NAND_SI: - case IA64_BUILTIN_FETCH_AND_NAND_DI: - return ia64_expand_fetch_and_op (one_cmpl_optab, mode, arglist, target); - - case IA64_BUILTIN_ADD_AND_FETCH_SI: - case IA64_BUILTIN_ADD_AND_FETCH_DI: - return ia64_expand_op_and_fetch (add_optab, mode, arglist, target); - - case IA64_BUILTIN_SUB_AND_FETCH_SI: - case IA64_BUILTIN_SUB_AND_FETCH_DI: - return ia64_expand_op_and_fetch (sub_optab, mode, arglist, target); - - case IA64_BUILTIN_OR_AND_FETCH_SI: - case IA64_BUILTIN_OR_AND_FETCH_DI: - return ia64_expand_op_and_fetch (ior_optab, mode, arglist, target); - - case IA64_BUILTIN_AND_AND_FETCH_SI: - case IA64_BUILTIN_AND_AND_FETCH_DI: - return ia64_expand_op_and_fetch (and_optab, mode, arglist, target); - - case IA64_BUILTIN_XOR_AND_FETCH_SI: - case IA64_BUILTIN_XOR_AND_FETCH_DI: - return ia64_expand_op_and_fetch (xor_optab, mode, arglist, target); - - case IA64_BUILTIN_NAND_AND_FETCH_SI: - case IA64_BUILTIN_NAND_AND_FETCH_DI: - return ia64_expand_op_and_fetch (one_cmpl_optab, mode, arglist, target); - default: break; } @@ -8480,8 +8152,7 @@ ia64_hpux_file_end (void) tree decl = p->decl; tree id = DECL_ASSEMBLER_NAME (decl); - if (!id) - abort (); + gcc_assert (id); if (!TREE_ASM_WRITTEN (decl) && TREE_SYMBOL_REFERENCED (id)) { @@ -8818,7 +8489,7 @@ ia64_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, insn = get_insns (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); reload_completed = 0; diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 65b3b5be9f4..bd32069b171 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -168,8 +168,6 @@ extern enum processor_type ia64_tune; #define UNITS_PER_WORD 8 -#define UNITS_PER_SIMD_WORD UNITS_PER_WORD - #define POINTER_SIZE (TARGET_ILP32 ? 32 : 64) /* A C expression whose value is zero if pointers that need to be extended @@ -456,7 +454,7 @@ while (0) #define CALL_REALLY_USED_REGISTERS \ { /* General registers. */ \ - 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, \ + 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ @@ -465,7 +463,7 @@ while (0) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, \ /* Floating-point registers. */ \ - 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ @@ -474,7 +472,7 @@ while (0) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ /* Predicate registers. */ \ - 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ @@ -1412,10 +1410,7 @@ do { \ /* A C expression that is nonzero if X is a legitimate constant for an immediate operand on the target machine. */ -#define LEGITIMATE_CONSTANT_P(X) \ - (GET_CODE (X) != CONST_DOUBLE || GET_MODE (X) == VOIDmode \ - || GET_MODE (X) == DImode || CONST_DOUBLE_OK_FOR_G (X)) \ - +#define LEGITIMATE_CONSTANT_P(X) ia64_legitimate_constant_p (X) /* Condition Code Status */ @@ -1796,7 +1791,7 @@ do { \ /* This is how to output an element of a case-vector that is absolute. (Ia64 does not use such vectors, but we must define this macro anyway.) */ -#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) abort () +#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) gcc_unreachable () /* Jump tables only need 8 byte alignment. */ @@ -2034,66 +2029,6 @@ struct machine_function GTY(()) int state_num; }; - -enum ia64_builtins -{ - IA64_BUILTIN_SYNCHRONIZE, - - IA64_BUILTIN_FETCH_AND_ADD_SI, - IA64_BUILTIN_FETCH_AND_SUB_SI, - IA64_BUILTIN_FETCH_AND_OR_SI, - IA64_BUILTIN_FETCH_AND_AND_SI, - IA64_BUILTIN_FETCH_AND_XOR_SI, - IA64_BUILTIN_FETCH_AND_NAND_SI, - - IA64_BUILTIN_ADD_AND_FETCH_SI, - IA64_BUILTIN_SUB_AND_FETCH_SI, - IA64_BUILTIN_OR_AND_FETCH_SI, - IA64_BUILTIN_AND_AND_FETCH_SI, - IA64_BUILTIN_XOR_AND_FETCH_SI, - IA64_BUILTIN_NAND_AND_FETCH_SI, - - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_SI, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_SI, - - IA64_BUILTIN_SYNCHRONIZE_SI, - - IA64_BUILTIN_LOCK_TEST_AND_SET_SI, - - IA64_BUILTIN_LOCK_RELEASE_SI, - - IA64_BUILTIN_FETCH_AND_ADD_DI, - IA64_BUILTIN_FETCH_AND_SUB_DI, - IA64_BUILTIN_FETCH_AND_OR_DI, - IA64_BUILTIN_FETCH_AND_AND_DI, - IA64_BUILTIN_FETCH_AND_XOR_DI, - IA64_BUILTIN_FETCH_AND_NAND_DI, - - IA64_BUILTIN_ADD_AND_FETCH_DI, - IA64_BUILTIN_SUB_AND_FETCH_DI, - IA64_BUILTIN_OR_AND_FETCH_DI, - IA64_BUILTIN_AND_AND_FETCH_DI, - IA64_BUILTIN_XOR_AND_FETCH_DI, - IA64_BUILTIN_NAND_AND_FETCH_DI, - - IA64_BUILTIN_BOOL_COMPARE_AND_SWAP_DI, - IA64_BUILTIN_VAL_COMPARE_AND_SWAP_DI, - - IA64_BUILTIN_SYNCHRONIZE_DI, - - IA64_BUILTIN_LOCK_TEST_AND_SET_DI, - - IA64_BUILTIN_LOCK_RELEASE_DI, - - IA64_BUILTIN_BSP, - IA64_BUILTIN_FLUSHRS -}; - -/* Codes for expand_compare_and_swap and expand_swap_and_compare. */ -enum fetchop_code { - IA64_ADD_OP, IA64_SUB_OP, IA64_OR_OP, IA64_AND_OP, IA64_XOR_OP, IA64_NAND_OP -}; - #define DONT_USE_BUILTIN_SETJMP /* Output any profiling code before the prologue. */ @@ -2104,7 +2039,6 @@ enum fetchop_code { /* Initialize library function table. */ #undef TARGET_INIT_LIBFUNCS #define TARGET_INIT_LIBFUNCS ia64_init_libfuncs - /* Switch on code for querying unit reservations. */ diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index fc99ce5a91c..7260678504b 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -56,6 +56,7 @@ (UNSPEC_DTPREL 2) (UNSPEC_LTOFF_TPREL 3) (UNSPEC_TPREL 4) + (UNSPEC_DTPMOD 5) (UNSPEC_LD_BASE 9) (UNSPEC_GR_SPILL 10) @@ -363,9 +364,8 @@ "mov pr = %1, -1" }; - if (which_alternative == 2 && ! TARGET_NO_PIC - && symbolic_operand (operands[1], VOIDmode)) - abort (); + gcc_assert (which_alternative != 2 || TARGET_NO_PIC + || !symbolic_operand (operands[1], VOIDmode)); return alt[which_alternative]; } @@ -374,53 +374,54 @@ (define_split [(set (match_operand 0 "register_operand" "") (match_operand 1 "symbolic_operand" ""))] - "reload_completed && ! TARGET_NO_PIC" + "reload_completed" [(const_int 0)] { - ia64_expand_load_address (operands[0], operands[1]); - DONE; + if (ia64_expand_load_address (operands[0], operands[1])) + DONE; + else + FAIL; }) (define_expand "load_fptr" - [(set (match_dup 2) - (plus:DI (reg:DI 1) (match_operand 1 "function_operand" ""))) - (set (match_operand:DI 0 "register_operand" "") (match_dup 3))] - "" + [(set (match_operand:DI 0 "register_operand" "") + (plus:DI (match_dup 2) (match_operand 1 "function_operand" ""))) + (set (match_dup 0) (match_dup 3))] + "reload_completed" { - operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); - operands[3] = gen_const_mem (DImode, operands[2]); + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); }) (define_insn "*load_fptr_internal1" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (reg:DI 1) (match_operand 1 "function_operand" "s")))] - "" + "reload_completed" "addl %0 = @ltoff(@fptr(%1)), gp" [(set_attr "itanium_class" "ialu")]) (define_insn "load_gprel" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (reg:DI 1) (match_operand 1 "sdata_symbolic_operand" "s")))] - "" + "reload_completed" "addl %0 = @gprel(%1), gp" [(set_attr "itanium_class" "ialu")]) -(define_insn "gprel64_offset" +(define_insn "*gprel64_offset" [(set (match_operand:DI 0 "register_operand" "=r") (minus:DI (match_operand:DI 1 "symbolic_operand" "") (reg:DI 1)))] - "" + "reload_completed" "movl %0 = @gprel(%1)" [(set_attr "itanium_class" "long_i")]) (define_expand "load_gprel64" - [(set (match_dup 2) - (minus:DI (match_operand:DI 1 "symbolic_operand" "") (match_dup 3))) - (set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_dup 3) (match_dup 2)))] - "" + [(set (match_operand:DI 0 "register_operand" "") + (minus:DI (match_operand:DI 1 "symbolic_operand" "") (match_dup 2))) + (set (match_dup 0) + (plus:DI (match_dup 2) (match_dup 0)))] + "reload_completed" { - operands[2] = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); - operands[3] = pic_offset_table_rtx; + operands[2] = pic_offset_table_rtx; }) ;; This is used as a placeholder for the return address during early @@ -446,7 +447,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (high:DI (match_operand 1 "got_symbolic_operand" "s")) (match_operand:DI 2 "register_operand" "a")))] - "" + "reload_completed" { if (HAVE_AS_LTOFFX_LDXMOV_RELOCS) return "%,addl %0 = @ltoffx(%1), %2"; @@ -459,7 +460,7 @@ [(set (match_operand:DI 0 "register_operand" "=r") (lo_sum:DI (match_operand:DI 1 "register_operand" "r") (match_operand 2 "got_symbolic_operand" "s")))] - "" + "reload_completed" { if (HAVE_AS_LTOFFX_LDXMOV_RELOCS) return "%,ld8.mov %0 = [%1], %2"; @@ -468,34 +469,41 @@ } [(set_attr "itanium_class" "ld")]) -(define_insn "load_ltoff_dtpmod" +(define_insn_and_split "load_dtpmod" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (reg:DI 1) - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] - UNSPEC_LTOFF_DTPMOD)))] + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_DTPMOD))] "" - "addl %0 = @ltoff(@dtpmod(%1)), gp" - [(set_attr "itanium_class" "ialu")]) + "#" + "reload_completed" + [(set (match_dup 0) + (plus:DI (unspec:DI [(match_dup 1)] UNSPEC_LTOFF_DTPMOD) + (match_dup 2))) + (set (match_dup 0) (match_dup 3))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); +}) -(define_insn "load_ltoff_dtprel" +(define_insn "*load_ltoff_dtpmod" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (reg:DI 1) - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] - UNSPEC_LTOFF_DTPREL)))] - "" - "addl %0 = @ltoff(@dtprel(%1)), gp" + (plus:DI (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_LTOFF_DTPMOD) + (match_operand:DI 2 "register_operand" "a")))] + "reload_completed" + "addl %0 = @ltoff(@dtpmod(%1)), %2" [(set_attr "itanium_class" "ialu")]) (define_expand "load_dtprel" [(set (match_operand:DI 0 "register_operand" "") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] UNSPEC_DTPREL))] "" "") (define_insn "*load_dtprel64" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] UNSPEC_DTPREL))] "TARGET_TLS64" "movl %0 = @dtprel(%1)" @@ -503,57 +511,73 @@ (define_insn "*load_dtprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] UNSPEC_DTPREL))] "" "addl %0 = @dtprel(%1), r0" [(set_attr "itanium_class" "ialu")]) +(define_insn_and_split "*load_dtprel_gd" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_DTPREL))] + "" + "#" + "reload_completed" + [(set (match_dup 0) + (plus:DI (unspec:DI [(match_dup 1)] UNSPEC_LTOFF_DTPREL) + (match_dup 2))) + (set (match_dup 0) (match_dup 3))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); +}) + +(define_insn "*load_ltoff_dtprel" + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + UNSPEC_LTOFF_DTPREL) + (match_operand:DI 2 "register_operand" "a")))] + "" + "addl %0 = @ltoff(@dtprel(%1)), %2" + [(set_attr "itanium_class" "ialu")]) + (define_expand "add_dtprel" [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_operand:DI 1 "register_operand" "") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_DTPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] + UNSPEC_DTPREL) + (match_operand:DI 2 "register_operand" "")))] "!TARGET_TLS64" "") (define_insn "*add_dtprel14" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "r") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_DTPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] + UNSPEC_DTPREL) + (match_operand:DI 2 "register_operand" "r")))] "TARGET_TLS14" - "adds %0 = @dtprel(%2), %1" + "adds %0 = @dtprel(%1), %2" [(set_attr "itanium_class" "ialu")]) (define_insn "*add_dtprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "a") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_DTPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "ld_tls_symbolic_operand" "")] + UNSPEC_DTPREL) + (match_operand:DI 2 "register_operand" "a")))] "TARGET_TLS22" - "addl %0 = @dtprel(%2), %1" - [(set_attr "itanium_class" "ialu")]) - -(define_insn "load_ltoff_tprel" - [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (reg:DI 1) - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] - UNSPEC_LTOFF_TPREL)))] - "" - "addl %0 = @ltoff(@tprel(%1)), gp" + "addl %0 = @dtprel(%1), %2" [(set_attr "itanium_class" "ialu")]) (define_expand "load_tprel" [(set (match_operand:DI 0 "register_operand" "") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] UNSPEC_TPREL))] "" "") (define_insn "*load_tprel64" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] UNSPEC_TPREL))] "TARGET_TLS64" "movl %0 = @tprel(%1)" @@ -561,36 +585,61 @@ (define_insn "*load_tprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (unspec:DI [(match_operand:DI 1 "symbolic_operand" "")] + (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] UNSPEC_TPREL))] "" "addl %0 = @tprel(%1), r0" [(set_attr "itanium_class" "ialu")]) +(define_insn_and_split "*load_tprel_ie" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec:DI [(match_operand 1 "ie_tls_symbolic_operand" "")] + UNSPEC_TPREL))] + "" + "#" + "reload_completed" + [(set (match_dup 0) + (plus:DI (unspec:DI [(match_dup 1)] UNSPEC_LTOFF_TPREL) + (match_dup 2))) + (set (match_dup 0) (match_dup 3))] +{ + operands[2] = pic_offset_table_rtx; + operands[3] = gen_const_mem (DImode, operands[0]); +}) + +(define_insn "*load_ltoff_tprel" + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (unspec:DI [(match_operand 1 "ie_tls_symbolic_operand" "")] + UNSPEC_LTOFF_TPREL) + (match_operand:DI 2 "register_operand" "a")))] + "" + "addl %0 = @ltoff(@tprel(%1)), %2" + [(set_attr "itanium_class" "ialu")]) + (define_expand "add_tprel" [(set (match_operand:DI 0 "register_operand" "") - (plus:DI (match_operand:DI 1 "register_operand" "") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_TPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] + UNSPEC_TPREL) + (match_operand:DI 2 "register_operand" "")))] "!TARGET_TLS64" "") (define_insn "*add_tprel14" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "r") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_TPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] + UNSPEC_TPREL) + (match_operand:DI 2 "register_operand" "r")))] "TARGET_TLS14" - "adds %0 = @tprel(%2), %1" + "adds %0 = @tprel(%1), %2" [(set_attr "itanium_class" "ialu")]) (define_insn "*add_tprel22" [(set (match_operand:DI 0 "register_operand" "=r") - (plus:DI (match_operand:DI 1 "register_operand" "a") - (unspec:DI [(match_operand:DI 2 "symbolic_operand" "")] - UNSPEC_TPREL)))] + (plus:DI (unspec:DI [(match_operand 1 "le_tls_symbolic_operand" "")] + UNSPEC_TPREL) + (match_operand:DI 2 "register_operand" "a")))] "TARGET_TLS22" - "addl %0 = @tprel(%2), %1" + "addl %0 = @tprel(%1), %2" [(set_attr "itanium_class" "ialu")]) ;; With no offsettable memory references, we've got to have a scratch @@ -700,10 +749,11 @@ if (GET_CODE (op0) == REG && GR_REGNO_P (REGNO (op0))) { + rtx out[2]; + /* We're hoping to transform everything that deals with XFmode quantities and GR registers early in the compiler. */ - if (no_new_pseudos) - abort (); + gcc_assert (!no_new_pseudos); /* Struct to register can just use TImode instead. */ if ((GET_CODE (operands[1]) == SUBREG @@ -735,27 +785,21 @@ if (register_operand (operands[1], XFmode)) operands[1] = spill_xfmode_operand (operands[1], 1); - if (GET_CODE (operands[1]) == MEM) - { - rtx out[2]; - - out[WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (op0)); - out[!WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (op0) + 1); + gcc_assert (GET_CODE (operands[1]) == MEM); - emit_move_insn (out[0], adjust_address (operands[1], DImode, 0)); - emit_move_insn (out[1], adjust_address (operands[1], DImode, 8)); - DONE; - } + out[WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (op0)); + out[!WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (op0) + 1); - abort (); + emit_move_insn (out[0], adjust_address (operands[1], DImode, 0)); + emit_move_insn (out[1], adjust_address (operands[1], DImode, 8)); + DONE; } if (GET_CODE (operands[1]) == REG && GR_REGNO_P (REGNO (operands[1]))) { /* We're hoping to transform everything that deals with XFmode quantities and GR registers early in the compiler. */ - if (no_new_pseudos) - abort (); + gcc_assert (!no_new_pseudos); /* Op0 can't be a GR_REG here, as that case is handled above. If op0 is a register, then we spill op1, so that we now have a @@ -768,10 +812,11 @@ operands[1] = spill_xfmode_operand (op1, 0); } - else if (GET_CODE (operands[0]) == MEM) + else { rtx in[2]; + gcc_assert (GET_CODE (operands[0]) == MEM); in[WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (operands[1])); in[!WORDS_BIG_ENDIAN] = gen_rtx_REG (DImode, REGNO (operands[1]) + 1); @@ -779,9 +824,6 @@ emit_move_insn (adjust_address (operands[0], DImode, 8), in[1]); DONE; } - - else - abort (); } if (! reload_in_progress && ! reload_completed) @@ -2699,7 +2741,7 @@ [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8))) (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) (mult:XF (match_dup 7) (match_dup 6))) (use (const_int 1))])) @@ -2756,7 +2798,7 @@ [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8))) (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) (minus:XF (match_dup 10) @@ -2825,14 +2867,14 @@ "TARGET_INLINE_SQRT" { rtx insn; - if (TARGET_INLINE_SQRT == INL_MIN_LAT) #if 0 + if (TARGET_INLINE_SQRT == INL_MIN_LAT) insn = gen_sqrtsf2_internal_lat (operands[0], operands[1]); + else #else - abort (); + gcc_assert (TARGET_INLINE_SQRT != INL_MIN_LAT); #endif - else - insn = gen_sqrtsf2_internal_thr (operands[0], operands[1]); + insn = gen_sqrtsf2_internal_thr (operands[0], operands[1]); emit_insn (insn); DONE; }) @@ -3182,7 +3224,7 @@ [(parallel [(set (match_dup 7) (div:XF (const_int 1) (match_dup 9))) (set (match_dup 6) (unspec:BI [(match_dup 8) (match_dup 9)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 6) (const_int 0)) (parallel [(set (match_dup 3) (mult:XF (match_dup 8) (match_dup 7))) (use (const_int 1))])) @@ -3262,7 +3304,7 @@ [(parallel [(set (match_dup 6) (div:XF (const_int 1) (match_dup 8))) (set (match_dup 5) (unspec:BI [(match_dup 7) (match_dup 8)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) (minus:XF (match_dup 10) @@ -3323,14 +3365,14 @@ "TARGET_INLINE_SQRT" { rtx insn; - if (TARGET_INLINE_SQRT == INL_MIN_LAT) #if 0 + if (TARGET_INLINE_SQRT == INL_MIN_LAT) insn = gen_sqrtdf2_internal_lat (operands[0], operands[1]); + else #else - abort (); + gcc_assert (TARGET_INLINE_SQRT != INL_MIN_LAT); #endif - else - insn = gen_sqrtdf2_internal_thr (operands[0], operands[1]); + insn = gen_sqrtdf2_internal_thr (operands[0], operands[1]); emit_insn (insn); DONE; }) @@ -3847,7 +3889,7 @@ [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2))) (set (match_dup 7) (unspec:BI [(match_dup 1) (match_dup 2)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 7) (const_int 0)) (parallel [(set (match_dup 3) (minus:XF (match_dup 8) @@ -3925,7 +3967,7 @@ [(parallel [(set (match_dup 0) (div:XF (const_int 1) (match_dup 2))) (set (match_dup 5) (unspec:BI [(match_dup 1) (match_dup 2)] UNSPEC_FR_RECIP_APPROX)) - (use (const_int 1))]) + (use (const_int 0))]) (cond_exec (ne (match_dup 5) (const_int 0)) (parallel [(set (match_dup 3) (minus:XF (match_dup 6) @@ -3998,14 +4040,14 @@ "TARGET_INLINE_SQRT" { rtx insn; - if (TARGET_INLINE_SQRT == INL_MIN_LAT) #if 0 + if (TARGET_INLINE_SQRT == INL_MIN_LAT) insn = gen_sqrtxf2_internal_lat (operands[0], operands[1]); + else #else - abort (); + gcc_assert (TARGET_INLINE_SQRT != INL_MIN_LAT); #endif - else - insn = gen_sqrtxf2_internal_thr (operands[0], operands[1]); + insn = gen_sqrtxf2_internal_thr (operands[0], operands[1]); emit_insn (insn); DONE; }) @@ -4351,7 +4393,7 @@ (match_operand:DI 3 "nonmemory_operand" "r")) (match_operand:DI 4 "nonmemory_operand" "rI")))] "reload_in_progress" - "* abort ();" + "* gcc_unreachable ();" "reload_completed" [(set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (match_dup 2)) (match_dup 3))) @@ -5103,7 +5145,7 @@ "rim,rim,rim, rim, *f, *b,*d*e,*f,*b,*d*e,rO,*f,rOQ,rO, rK")))] "ia64_move_ok (operands[0], operands[2]) && ia64_move_ok (operands[0], operands[3])" - { abort (); } + { gcc_unreachable (); } [(set_attr "predicable" "no")]) (define_split @@ -5206,7 +5248,7 @@ "rim*f,rO,rO,0,0,0,rim*f,rO,rO")))] "ia64_move_ok (operands[0], operands[2]) && ia64_move_ok (operands[0], operands[3])" - { abort (); } + { gcc_unreachable (); } [(set_attr "predicable" "no")]) (define_insn "*abssi2_internal" @@ -5605,12 +5647,10 @@ start_sequence (); set = single_set (last); - if (! rtx_equal_p (SET_DEST (set), op0) - || GET_CODE (SET_SRC (set)) != MEM) - abort (); + gcc_assert (rtx_equal_p (SET_DEST (set), op0) + && GET_CODE (SET_SRC (set)) == MEM); addr = XEXP (SET_SRC (set), 0); - if (rtx_equal_p (addr, op0)) - abort (); + gcc_assert (!rtx_equal_p (addr, op0)); } /* Jump table elements are stored pc-relative. That is, a displacement @@ -5958,10 +5998,8 @@ int i = (INTVAL (operands[1])); int j = (INTVAL (operands[2])); - if (i != 0 && i != 1) - abort (); - if (j < 0 || j > 3) - abort (); + gcc_assert (i == 0 || i == 1); + gcc_assert (j >= 0 && j <= 3); return alt[i][j]; } [(set_attr "itanium_class" "lfetch")]) @@ -6048,88 +6086,6 @@ }) -;;; Intrinsics support. - -(define_expand "mf" - [(set (mem:BLK (match_dup 0)) - (unspec:BLK [(mem:BLK (match_dup 0))] UNSPEC_MF))] - "" -{ - operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (DImode)); - MEM_VOLATILE_P (operands[0]) = 1; -}) - -(define_insn "*mf_internal" - [(set (match_operand:BLK 0 "" "") - (unspec:BLK [(match_operand:BLK 1 "" "")] UNSPEC_MF))] - "" - "mf" - [(set_attr "itanium_class" "syst_m")]) - -(define_insn "fetchadd_acq_si" - [(set (match_operand:SI 0 "gr_register_operand" "=r") - (match_operand:SI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:SI [(match_dup 1) - (match_operand:SI 2 "fetchadd_operand" "n")] - UNSPEC_FETCHADD_ACQ))] - "" - "fetchadd4.acq %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - -(define_insn "fetchadd_acq_di" - [(set (match_operand:DI 0 "gr_register_operand" "=r") - (match_operand:DI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:DI [(match_dup 1) - (match_operand:DI 2 "fetchadd_operand" "n")] - UNSPEC_FETCHADD_ACQ))] - "" - "fetchadd8.acq %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - -(define_insn "cmpxchg_acq_si" - [(set (match_operand:SI 0 "gr_register_operand" "=r") - (match_operand:SI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:SI [(match_dup 1) - (match_operand:SI 2 "gr_register_operand" "r") - (match_operand:DI 3 "ar_ccv_reg_operand" "")] - UNSPEC_CMPXCHG_ACQ))] - "" - "cmpxchg4.acq %0 = %1, %2, %3" - [(set_attr "itanium_class" "sem")]) - -(define_insn "cmpxchg_acq_di" - [(set (match_operand:DI 0 "gr_register_operand" "=r") - (match_operand:DI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (unspec:DI [(match_dup 1) - (match_operand:DI 2 "gr_register_operand" "r") - (match_operand:DI 3 "ar_ccv_reg_operand" "")] - UNSPEC_CMPXCHG_ACQ))] - "" - "cmpxchg8.acq %0 = %1, %2, %3" - [(set_attr "itanium_class" "sem")]) - -(define_insn "xchgsi" - [(set (match_operand:SI 0 "gr_register_operand" "=r") - (match_operand:SI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (match_operand:SI 2 "gr_register_operand" "r"))] - "" - "xchg4 %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - -(define_insn "xchgdi" - [(set (match_operand:DI 0 "gr_register_operand" "=r") - (match_operand:DI 1 "not_postinc_memory_operand" "+S")) - (set (match_dup 1) - (match_operand:DI 2 "gr_register_operand" "r"))] - "" - "xchg8 %0 = %1, %2" - [(set_attr "itanium_class" "sem")]) - ;; Predication. (define_cond_exec @@ -6200,3 +6156,5 @@ ;; Vector operations (include "vect.md") +;; Atomic operations +(include "sync.md") diff --git a/gcc/config/ia64/ia64intrin.h b/gcc/config/ia64/ia64intrin.h dissimilarity index 71% index 2397c4ccde8..6054219f48a 100644 --- a/gcc/config/ia64/ia64intrin.h +++ b/gcc/config/ia64/ia64intrin.h @@ -1,130 +1,91 @@ -#ifndef _IA64INTRIN_H_INCLUDED -#define _IA64INTRIN_H_INCLUDED - -/* Actually, everything is a compiler builtin, but just so - there's no confusion... */ -#ifdef __cplusplus -extern "C" { -#endif - -extern void __sync_synchronize (void); - -extern int __sync_val_compare_and_swap_si (int *, int, int); -extern long __sync_val_compare_and_swap_di (long *, long, long); -#define __sync_val_compare_and_swap(PTR, OLD, NEW) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) \ - __sync_val_compare_and_swap_si((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \ - : (__typeof__(*(PTR))) \ - __sync_val_compare_and_swap_di((long *)(void *)(PTR),(long)(OLD),(long)(NEW))) - -extern int __sync_bool_compare_and_swap_si (int *, int, int); -extern int __sync_bool_compare_and_swap_di (long *, long, long); -#define __sync_bool_compare_and_swap(PTR, OLD, NEW) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? __sync_bool_compare_and_swap_si((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \ - : __sync_bool_compare_and_swap_di((long *)(void *)(PTR),(long)(OLD),(long)(NEW))) - -extern void __sync_lock_release_si (int *); -extern void __sync_lock_release_di (long *); -#define __sync_lock_release(PTR) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? __sync_lock_release_si((int *)(void *)(PTR)) \ - : __sync_lock_release_di((long *)(void *)(PTR))) - -extern int __sync_lock_test_and_set_si (int *, int); -extern long __sync_lock_test_and_set_di (long *, long); -#define __sync_lock_test_and_set(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_add_si (int *, int); -extern long __sync_fetch_and_add_di (long *, long); -#define __sync_fetch_and_add(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_sub_si (int *, int); -extern long __sync_fetch_and_sub_di (long *, long); -#define __sync_fetch_and_sub(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_and_si (int *, int); -extern long __sync_fetch_and_and_di (long *, long); -#define __sync_fetch_and_and(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_or_si (int *, int); -extern long __sync_fetch_and_or_di (long *, long); -#define __sync_fetch_and_or(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_xor_si (int *, int); -extern long __sync_fetch_and_xor_di (long *, long); -#define __sync_fetch_and_xor(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_fetch_and_nand_si (int *, int); -extern long __sync_fetch_and_nand_di (long *, long); -#define __sync_fetch_and_nand(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_add_and_fetch_si (int *, int); -extern long __sync_add_and_fetch_di (long *, long); -#define __sync_add_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_sub_and_fetch_si (int *, int); -extern long __sync_sub_and_fetch_di (long *, long); -#define __sync_sub_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_and_and_fetch_si (int *, int); -extern long __sync_and_and_fetch_di (long *, long); -#define __sync_and_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_or_and_fetch_si (int *, int); -extern long __sync_or_and_fetch_di (long *, long); -#define __sync_or_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_xor_and_fetch_si (int *, int); -extern long __sync_xor_and_fetch_di (long *, long); -#define __sync_xor_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) - -extern int __sync_nand_and_fetch_si (int *, int); -extern long __sync_nand_and_fetch_di (long *, long); -#define __sync_nand_and_fetch(PTR,VAL) \ - ((sizeof (*(PTR)) == sizeof(int)) \ - ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(void *)(PTR),(int)(VAL)) \ - : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(void *)(PTR),(long)(VAL))) - -#ifdef __cplusplus -} -#endif - -#endif +#ifndef _IA64INTRIN_H_INCLUDED +#define _IA64INTRIN_H_INCLUDED + +/* ??? Overloaded builtins havn't been ported to C++ yet. */ +#ifdef __cplusplus + +#define __sync_val_compare_and_swap(PTR, OLD, NEW) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) \ + __sync_val_compare_and_swap_4((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \ + : (__typeof__(*(PTR))) \ + __sync_val_compare_and_swap_8((long *)(void *)(PTR),(long)(OLD),(long)(NEW))) + +#define __sync_bool_compare_and_swap(PTR, OLD, NEW) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? __sync_bool_compare_and_swap_4((int *)(void *)(PTR),(int)(OLD),(int)(NEW)) \ + : __sync_bool_compare_and_swap_8((long *)(void *)(PTR),(long)(OLD),(long)(NEW))) + +#define __sync_lock_release(PTR) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? __sync_lock_release_4((int *)(void *)(PTR)) \ + : __sync_lock_release_8((long *)(void *)(PTR))) + +#define __sync_lock_test_and_set(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_lock_test_and_set_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_lock_test_and_set_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_fetch_and_add(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_fetch_and_add_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_add_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_fetch_and_sub(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_fetch_and_sub_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_sub_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_fetch_and_and(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_fetch_and_and_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_and_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_fetch_and_or(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_fetch_and_or_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_or_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_fetch_and_xor(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_fetch_and_xor_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_xor_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_fetch_and_nand(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_fetch_and_nand_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_fetch_and_nand_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_add_and_fetch(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_add_and_fetch_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_add_and_fetch_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_sub_and_fetch(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_sub_and_fetch_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_sub_and_fetch_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_and_and_fetch(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_and_and_fetch_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_and_and_fetch_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_or_and_fetch(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_or_and_fetch_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_or_and_fetch_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_xor_and_fetch(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_xor_and_fetch_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_xor_and_fetch_8((long *)(void *)(PTR),(long)(VAL))) + +#define __sync_nand_and_fetch(PTR,VAL) \ + ((sizeof (*(PTR)) == sizeof(int)) \ + ? (__typeof__(*(PTR))) __sync_nand_and_fetch_4((int *)(void *)(PTR),(int)(VAL)) \ + : (__typeof__(*(PTR))) __sync_nand_and_fetch_8((long *)(void *)(PTR),(long)(VAL))) + +#endif /* __cplusplus */ + +#endif /* _IA64INTRIN_H_INCLUDED */ diff --git a/gcc/config/ia64/predicates.md b/gcc/config/ia64/predicates.md index 4e57338c93d..7ec32090b5d 100644 --- a/gcc/config/ia64/predicates.md +++ b/gcc/config/ia64/predicates.md @@ -34,42 +34,6 @@ (and (match_code "symbol_ref") (match_test "SYMBOL_REF_FUNCTION_P (op)"))) -;; True if OP refers to a symbol, and is appropriate for a GOT load. -(define_predicate "got_symbolic_operand" - (match_operand 0 "symbolic_operand" "") -{ - switch (GET_CODE (op)) - { - case LABEL_REF: - return true; - - case SYMBOL_REF: - /* This sort of load should not be used for things in sdata. */ - return !SYMBOL_REF_SMALL_ADDR_P (op); - - case CONST: - /* Accept only (plus (symbol_ref) (const_int)). */ - op = XEXP (op, 0); - if (GET_CODE (op) != PLUS - || GET_CODE (XEXP (op, 0)) != SYMBOL_REF - || GET_CODE (XEXP (op, 1)) != CONST_INT) - return false; - - /* Ok if we're not using GOT entries at all. */ - if (TARGET_NO_PIC || TARGET_AUTO_PIC) - return true; - - /* The low 14 bits of the constant have been forced to zero - by ia64_expand_load_address, so that we do not use up so - many GOT entries. Prevent cse from undoing this. */ - op = XEXP (op, 1); - return (INTVAL (op) & 0x3fff) == 0; - - default: - abort (); - } -}) - ;; True if OP refers to a symbol in the sdata section. (define_predicate "sdata_symbolic_operand" (match_code "symbol_ref,const") @@ -125,7 +89,188 @@ return (offset >= 0 && offset <= size); default: - abort (); + gcc_unreachable (); + } +}) + +;; True if OP refers to a symbol in the small address area. +(define_predicate "small_addr_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + return SYMBOL_REF_SMALL_ADDR_P (op); + + default: + gcc_unreachable (); + } +}) + +;; True if OP refers to a symbol with which we may use any offset. +(define_predicate "any_offset_symbol_operand" + (match_code "symbol_ref") +{ + if (TARGET_NO_PIC || TARGET_AUTO_PIC) + return true; + if (SYMBOL_REF_SMALL_ADDR_P (op)) + return true; + if (SYMBOL_REF_FUNCTION_P (op)) + return false; + if (sdata_symbolic_operand (op, mode)) + return true; + return false; +}) + +;; True if OP refers to a symbol with which we may use 14-bit aligned offsets. +;; False if OP refers to a symbol with which we may not use any offset at any +;; time. +(define_predicate "aligned_offset_symbol_operand" + (and (match_code "symbol_ref") + (match_test "! SYMBOL_REF_FUNCTION_P (op)"))) + +;; True if OP refers to a symbol, and is appropriate for a GOT load. +(define_predicate "got_symbolic_operand" + (match_operand 0 "symbolic_operand" "") +{ + HOST_WIDE_INT addend = 0; + + switch (GET_CODE (op)) + { + case LABEL_REF: + return true; + + case CONST: + /* Accept only (plus (symbol_ref) (const_int)). */ + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + + addend = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + /* These symbols shouldn't be used with got loads. */ + if (SYMBOL_REF_SMALL_ADDR_P (op)) + return false; + if (SYMBOL_REF_TLS_MODEL (op) != 0) + return false; + + if (any_offset_symbol_operand (op, mode)) + return true; + + /* The low 14 bits of the constant have been forced to zero + so that we do not use up so many GOT entries. Prevent cse + from undoing this. */ + if (aligned_offset_symbol_operand (op, mode)) + return (addend & 0x3fff) == 0; + + return addend == 0; + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a valid thread local storage symbolic operand. +(define_predicate "tls_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + return SYMBOL_REF_TLS_MODEL (op) != 0; + + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + + /* We only allow certain offsets for certain tls models. */ + switch (SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) + { + case TLS_MODEL_GLOBAL_DYNAMIC: + case TLS_MODEL_LOCAL_DYNAMIC: + return false; + + case TLS_MODEL_INITIAL_EXEC: + return (INTVAL (XEXP (op, 1)) & 0x3fff) == 0; + + case TLS_MODEL_LOCAL_EXEC: + return true; + + default: + return false; + } + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a local-dynamic thread local storage symbolic operand. +(define_predicate "ld_tls_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_DYNAMIC"))) + +;; Return true if OP is an initial-exec thread local storage symbolic operand. +(define_predicate "ie_tls_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT + || (INTVAL (XEXP (op, 1)) & 0x3fff) != 0) + return false; + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + return SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_INITIAL_EXEC; + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a local-exec thread local storage symbolic operand. +(define_predicate "le_tls_symbolic_operand" + (match_code "symbol_ref,const") +{ + switch (GET_CODE (op)) + { + case CONST: + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + op = XEXP (op, 0); + /* FALLTHRU */ + + case SYMBOL_REF: + return SYMBOL_REF_TLS_MODEL (op) == TLS_MODEL_LOCAL_EXEC; + + default: + gcc_unreachable (); } }) @@ -142,11 +287,51 @@ (and (match_operand 0 "memory_operand") (match_test "GET_RTX_CLASS (GET_CODE (XEXP (op, 0))) != RTX_AUTOINC"))) -;; True if OP is a general operand, excluding tls symbolic operands. +;; True if OP is a general operand, with some restrictions on symbols. (define_predicate "move_operand" - (and (match_operand 0 "general_operand") - (not (match_test - "GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (op)")))) + (match_operand 0 "general_operand") +{ + switch (GET_CODE (op)) + { + case CONST: + { + HOST_WIDE_INT addend; + + /* Accept only (plus (symbol_ref) (const_int)). */ + op = XEXP (op, 0); + if (GET_CODE (op) != PLUS + || GET_CODE (XEXP (op, 0)) != SYMBOL_REF + || GET_CODE (XEXP (op, 1)) != CONST_INT) + return false; + + addend = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + + /* After reload, we want to allow any offset whatsoever. This + allows reload the opportunity to avoid spilling addresses to + the stack, and instead simply substitute in the value from a + REG_EQUIV. We'll split this up again when splitting the insn. */ + if (reload_in_progress || reload_completed) + return true; + + /* Some symbol types we allow to use with any offset. */ + if (any_offset_symbol_operand (op, mode)) + return true; + + /* Some symbol types we allow offsets with the low 14 bits of the + constant forced to zero so that we do not use up so many GOT + entries. We want to prevent cse from undoing this. */ + if (aligned_offset_symbol_operand (op, mode)) + return (addend & 0x3fff) == 0; + + /* The remaining symbol types may never be used with an offset. */ + return false; + } + + default: + return true; + } +}) ;; True if OP is a register operand that is (or could be) a GR reg. (define_predicate "gr_register_operand" diff --git a/gcc/config/ia64/sync.md b/gcc/config/ia64/sync.md new file mode 100644 index 00000000000..a5fa1ff304c --- /dev/null +++ b/gcc/config/ia64/sync.md @@ -0,0 +1,178 @@ +;; GCC machine description for IA-64 synchronization instructions. +;; Copyright (C) 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. + +(define_mode_macro IMODE [QI HI SI DI]) +(define_mode_macro I124MODE [QI HI SI]) +(define_mode_macro I48MODE [SI DI]) +(define_mode_attr modesuffix [(QI "1") (HI "2") (SI "4") (DI "8")]) + +(define_code_macro FETCHOP [plus minus ior xor and]) +(define_code_attr fetchop_name + [(plus "add") (minus "sub") (ior "ior") (xor "xor") (and "and")]) + +(define_insn "memory_barrier" + [(set (mem:BLK (match_scratch:DI 0 "X")) + (unspec:BLK [(mem:BLK (match_scratch:DI 1 "X"))] UNSPEC_MF))] + "" + "mf" + [(set_attr "itanium_class" "syst_m")]) + +(define_insn "fetchadd_acq_" + [(set (match_operand:I48MODE 0 "gr_register_operand" "=r") + (match_operand:I48MODE 1 "not_postinc_memory_operand" "+S")) + (set (match_dup 1) + (unspec:I48MODE [(match_dup 1) + (match_operand:I48MODE 2 "fetchadd_operand" "n")] + UNSPEC_FETCHADD_ACQ))] + "" + "fetchadd.acq %0 = %1, %2" + [(set_attr "itanium_class" "sem")]) + +(define_expand "sync_" + [(set (match_operand:IMODE 0 "memory_operand" "") + (FETCHOP:IMODE (match_dup 0) + (match_operand:IMODE 1 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (, operands[0], operands[1], NULL, NULL); + DONE; +}) + +(define_expand "sync_nand" + [(set (match_operand:IMODE 0 "memory_operand" "") + (and:IMODE (not:IMODE (match_dup 0)) + (match_operand:IMODE 1 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (NOT, operands[0], operands[1], NULL, NULL); + DONE; +}) + +(define_expand "sync_old_" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (FETCHOP:IMODE + (match_operand:IMODE 1 "memory_operand" "") + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (, operands[1], operands[2], operands[0], NULL); + DONE; +}) + +(define_expand "sync_old_nand" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (and:IMODE + (not:IMODE (match_operand:IMODE 1 "memory_operand" "")) + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (NOT, operands[1], operands[2], operands[0], NULL); + DONE; +}) + +(define_expand "sync_new_" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (FETCHOP:IMODE + (match_operand:IMODE 1 "memory_operand" "") + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (, operands[1], operands[2], NULL, operands[0]); + DONE; +}) + +(define_expand "sync_new_nand" + [(set (match_operand:IMODE 0 "gr_register_operand" "") + (and:IMODE + (not:IMODE (match_operand:IMODE 1 "memory_operand" "")) + (match_operand:IMODE 2 "general_operand" "")))] + "" +{ + ia64_expand_atomic_op (NOT, operands[1], operands[2], NULL, operands[0]); + DONE; +}) + +(define_expand "sync_compare_and_swap" + [(match_operand:IMODE 0 "gr_register_operand" "") + (match_operand:IMODE 1 "memory_operand" "") + (match_operand:IMODE 2 "gr_register_operand" "") + (match_operand:IMODE 3 "gr_register_operand" "")] + "" +{ + rtx ccv = gen_rtx_REG (DImode, AR_CCV_REGNUM); + rtx dst; + + convert_move (ccv, operands[2], 1); + + dst = operands[0]; + if (GET_MODE (dst) != DImode) + dst = gen_reg_rtx (DImode); + + emit_insn (gen_memory_barrier ()); + emit_insn (gen_cmpxchg_rel_ (dst, operands[1], ccv, operands[3])); + + if (dst != operands[0]) + emit_move_insn (operands[0], gen_lowpart (mode, dst)); + DONE; +}) + +(define_insn "cmpxchg_rel_" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (zero_extend:DI + (match_operand:I124MODE 1 "not_postinc_memory_operand" "+S"))) + (set (match_dup 1) + (unspec:I124MODE + [(match_dup 1) + (match_operand:DI 2 "ar_ccv_reg_operand" "") + (match_operand:I124MODE 3 "gr_register_operand" "r")] + UNSPEC_CMPXCHG_ACQ))] + "" + "cmpxchg.rel %0 = %1, %3, %2" + [(set_attr "itanium_class" "sem")]) + +(define_insn "cmpxchg_rel_di" + [(set (match_operand:DI 0 "gr_register_operand" "=r") + (match_operand:DI 1 "not_postinc_memory_operand" "+S")) + (set (match_dup 1) + (unspec:DI [(match_dup 1) + (match_operand:DI 2 "ar_ccv_reg_operand" "") + (match_operand:DI 3 "gr_register_operand" "r")] + UNSPEC_CMPXCHG_ACQ))] + "" + "cmpxchg8.rel %0 = %1, %3, %2" + [(set_attr "itanium_class" "sem")]) + +(define_insn "sync_lock_test_and_set" + [(set (match_operand:IMODE 0 "gr_register_operand" "=r") + (match_operand:IMODE 1 "not_postinc_memory_operand" "+S")) + (set (match_dup 1) + (match_operand:IMODE 2 "gr_register_operand" "r"))] + "" + "xchg %0 = %1, %2" + [(set_attr "itanium_class" "sem")]) + +(define_expand "sync_lock_release" + [(set (match_operand:IMODE 0 "memory_operand" "") + (match_operand:IMODE 1 "gr_reg_or_0_operand" ""))] + "" +{ + gcc_assert (MEM_VOLATILE_P (operands[0])); +}) diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c index 078bc291acf..27aab4e2f35 100644 --- a/gcc/config/ia64/unwind-ia64.c +++ b/gcc/config/ia64/unwind-ia64.c @@ -1,6 +1,6 @@ /* Subroutines needed for unwinding IA-64 standard format stack frame info for exception handling. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Andrew MacLeod Andrew Haley @@ -285,10 +285,10 @@ atomic_free (unsigned int *mask, int bit) #define PTR_IN(X, P) ((P) >= (X) && (P) < (X) + SIZE (X)) static struct unw_reg_state emergency_reg_state[32]; -static int emergency_reg_state_free = MASK_FOR (emergency_reg_state); +static unsigned int emergency_reg_state_free = MASK_FOR (emergency_reg_state); static struct unw_labeled_state emergency_labeled_state[8]; -static int emergency_labeled_state_free = MASK_FOR (emergency_labeled_state); +static unsigned int emergency_labeled_state_free = MASK_FOR (emergency_labeled_state); #ifdef ENABLE_MALLOC_CHECKING static int reg_state_alloced; @@ -2275,6 +2275,8 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)), "(p6) ldf.fill f22 = [r28] \n\t" "cmp.ne p7, p0 = r0, r29 \n\t" ";; \n\t" + "ld8 r27 = [r20], 8 \n\t" + ";; \n\t" "ld8 r28 = [r20], 8 \n\t" "(p7) ldf.fill f23 = [r29] \n\t" "cmp.ne p6, p0 = r0, r22 \n\t" diff --git a/gcc/config/ia64/vect.md b/gcc/config/ia64/vect.md index 12729a90e43..07e86f9f171 100644 --- a/gcc/config/ia64/vect.md +++ b/gcc/config/ia64/vect.md @@ -893,7 +893,7 @@ break; default: - abort (); + gcc_unreachable (); } cmp = gen_reg_rtx (V2SFmode); diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c index 06345c5d2f3..314a2c760f8 100644 --- a/gcc/config/ip2k/ip2k.c +++ b/gcc/config/ip2k/ip2k.c @@ -3154,14 +3154,14 @@ ip2k_handle_progmem_attribute (tree *node, tree name, { if (DECL_INITIAL (*node) == NULL_TREE && !DECL_EXTERNAL (*node)) { - warning ("only initialized variables can be placed into " + warning (0, "only initialized variables can be placed into " "program memory area"); *no_add_attrs = true; } } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } } @@ -3179,7 +3179,7 @@ ip2k_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/ip2k/ip2k.h b/gcc/config/ip2k/ip2k.h index 06381987ac6..42f053e1157 100644 --- a/gcc/config/ip2k/ip2k.h +++ b/gcc/config/ip2k/ip2k.h @@ -34,11 +34,6 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -/* This declaration should be present. */ -extern int target_flags; - -#define TARGET_SWITCHES {{"",0, NULL}} - #define TARGET_VERSION fprintf (stderr, " (ip2k, GNU assembler syntax)") /* Caller-saves is not a win for the IP2K. Pretty much anywhere that diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 80f5a4cd7cb..91bb128f525 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -1,5 +1,5 @@ /* Subroutines used for code generation on Vitesse IQ2000 processors - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -125,11 +125,6 @@ rtx branch_cmp[2]; /* What type of branch to use. */ enum cmp_type branch_type; -/* Strings to hold which cpu and instruction set architecture to use. */ -const char * iq2000_cpu_string; /* For -mcpu=. */ -const char * iq2000_arch_string; /* For -march=. */ - - /* Local variables. */ /* The next branch instruction is a branch likely, not branch normal. */ @@ -152,15 +147,13 @@ static rtx iq2000_load_reg2; static rtx iq2000_load_reg3; static rtx iq2000_load_reg4; -/* The target cpu for code generation. */ -static enum processor_type iq2000_arch; - /* Mode used for saving/restoring general purpose registers. */ static enum machine_mode gpr_mode; /* Initialize the GCC target structure. */ static struct machine_function* iq2000_init_machine_status (void); +static bool iq2000_handle_option (size_t, const char *, int); static void iq2000_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT); static void iq2000_init_builtins (void); static rtx iq2000_expand_builtin (tree, rtx, rtx, enum machine_mode, int); @@ -183,6 +176,8 @@ static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, #define TARGET_EXPAND_BUILTIN iq2000_expand_builtin #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION iq2000_handle_option #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS iq2000_rtx_costs #undef TARGET_ADDRESS_COST @@ -213,217 +208,6 @@ static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, struct gcc_target targetm = TARGET_INITIALIZER; -/* Return 1 if OP can be used as an operand where a register or 16 bit unsigned - integer is needed. */ - -int -uns_arith_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT && SMALL_INT_UNSIGNED (op)) - return 1; - - return register_operand (op, mode); -} - -/* Return 1 if OP can be used as an operand where a 16 bit integer is needed. */ - -int -arith_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT && SMALL_INT (op)) - return 1; - - return register_operand (op, mode); -} - -/* Return 1 if OP is a integer which fits in 16 bits. */ - -int -small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && SMALL_INT (op)); -} - -/* Return 1 if OP is a 32 bit integer which is too big to be loaded with one - instruction. */ - -int -large_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - HOST_WIDE_INT value; - - if (GET_CODE (op) != CONST_INT) - return 0; - - value = INTVAL (op); - - /* IOR reg,$r0,value. */ - if ((value & ~ ((HOST_WIDE_INT) 0x0000ffff)) == 0) - return 0; - - /* SUBU reg,$r0,value. */ - if (((unsigned HOST_WIDE_INT) (value + 32768)) <= 32767) - return 0; - - /* LUI reg,value >> 16. */ - if ((value & 0x0000ffff) == 0) - return 0; - - return 1; -} - -/* Return 1 if OP is a register or the constant 0. */ - -int -reg_or_0_operand (rtx op, enum machine_mode mode) -{ - switch (GET_CODE (op)) - { - case CONST_INT: - return INTVAL (op) == 0; - - case CONST_DOUBLE: - return op == CONST0_RTX (mode); - - case REG: - case SUBREG: - return register_operand (op, mode); - - default: - break; - } - - return 0; -} - -/* Return 1 if OP is a memory operand that fits in a single instruction - (i.e., register + small offset). */ - -int -simple_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - rtx addr, plus0, plus1; - - /* Eliminate non-memory operations. */ - if (GET_CODE (op) != MEM) - return 0; - - /* Dword operations really put out 2 instructions, so eliminate them. */ - if (GET_MODE_SIZE (GET_MODE (op)) > (unsigned) UNITS_PER_WORD) - return 0; - - /* Decode the address now. */ - addr = XEXP (op, 0); - switch (GET_CODE (addr)) - { - case REG: - case LO_SUM: - return 1; - - case CONST_INT: - return SMALL_INT (addr); - - case PLUS: - plus0 = XEXP (addr, 0); - plus1 = XEXP (addr, 1); - if (GET_CODE (plus0) == REG - && GET_CODE (plus1) == CONST_INT && SMALL_INT (plus1) - && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */) - return 1; - - else if (GET_CODE (plus1) == REG - && GET_CODE (plus0) == CONST_INT && SMALL_INT (plus0) - && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */) - return 1; - - else - return 0; - - case SYMBOL_REF: - return 0; - - default: - break; - } - - return 0; -} - -/* Return nonzero if the code of this rtx pattern is EQ or NE. */ - -int -equality_op (rtx op, enum machine_mode mode) -{ - if (mode != GET_MODE (op)) - return 0; - - return GET_CODE (op) == EQ || GET_CODE (op) == NE; -} - -/* Return nonzero if the code is a relational operations (EQ, LE, etc). */ - -int -cmp_op (rtx op, enum machine_mode mode) -{ - if (mode != GET_MODE (op)) - return 0; - - return COMPARISON_P (op); -} - -/* Return nonzero if the operand is either the PC or a label_ref. */ - -int -pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (op == pc_rtx) - return 1; - - if (GET_CODE (op) == LABEL_REF) - return 1; - - return 0; -} - -/* Return nonzero if OP is a valid operand for a call instruction. */ - -int -call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (CONSTANT_ADDRESS_P (op) - || (GET_CODE (op) == REG && op != arg_pointer_rtx - && ! (REGNO (op) >= FIRST_PSEUDO_REGISTER - && REGNO (op) <= LAST_VIRTUAL_REGISTER))); -} - -/* Return nonzero if OP is valid as a source operand for a move instruction. */ - -int -move_operand (rtx op, enum machine_mode mode) -{ - /* Accept any general operand after reload has started; doing so - avoids losing if reload does an in-place replacement of a register - with a SYMBOL_REF or CONST. */ - return (general_operand (op, mode) - && (! (iq2000_check_split (op, mode)) - || reload_in_progress || reload_completed)); -} - -/* Return nonzero if OP is a constant power of 2. */ - -int -power_of_2_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int intval; - - if (GET_CODE (op) != CONST_INT) - return 0; - else - intval = INTVAL (op); - - return ((intval & ((unsigned)(intval) - 1)) == 0); -} - /* Return nonzero if we split the address into high and low parts. */ int @@ -716,7 +500,7 @@ abort_with_insn (rtx insn, const char * reason) { error (reason); debug_rtx (insn); - abort (); + fancy_abort (__FILE__, __LINE__, __FUNCTION__); } /* Return the appropriate instructions to move one operand to another. */ @@ -1088,8 +872,7 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1, rtx reg2; test = map_test_to_internal_test (test_code); - if (test == ITEST_MAX) - abort (); + gcc_assert (test != ITEST_MAX); p_info = &info[(int) test]; eqne_p = (p_info->test_code == XOR); @@ -1352,9 +1135,8 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, break; default: - if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); cum->gp_reg_found = 1; cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) @@ -1434,9 +1216,8 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, break; default: - if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT + || GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT); /* Drops through. */ case BLKmode: @@ -1466,8 +1247,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, } else { - if (regbase == -1) - abort (); + gcc_assert (regbase != -1); if (! type || TREE_CODE (type) != RECORD_TYPE || ! named || ! TYPE_SIZE_UNIT (type) @@ -1606,26 +1386,31 @@ iq2000_init_machine_status (void) return f; } -static enum processor_type -iq2000_parse_cpu (const char * cpu_string) -{ - const char *p = cpu_string; - enum processor_type cpu; +/* Implement TARGET_HANDLE_OPTION. */ - cpu = PROCESSOR_DEFAULT; - switch (p[2]) +static bool +iq2000_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) { - case '1': - if (!strcmp (p, "iq10")) - cpu = PROCESSOR_IQ10; - break; - case '2': - if (!strcmp (p, "iq2000")) - cpu = PROCESSOR_IQ2000; - break; - } + case OPT_mcpu_: + if (strcmp (arg, "iq10") == 0) + iq2000_tune = PROCESSOR_IQ10; + else if (strcmp (arg, "iq2000") == 0) + iq2000_tune = PROCESSOR_IQ2000; + else + return false; + return true; - return cpu; + case OPT_march_: + /* This option has no effect at the moment. */ + return (strcmp (arg, "default") == 0 + || strcmp (arg, "DEFAULT") == 0 + || strcmp (arg, "iq2000") == 0); + + default: + return true; + } } /* Detect any conflicts in the switches. */ @@ -1633,53 +1418,12 @@ iq2000_parse_cpu (const char * cpu_string) void override_options (void) { - enum processor_type iq2000_cpu; - target_flags &= ~MASK_GPOPT; iq2000_isa = IQ2000_ISA_DEFAULT; /* Identify the processor type. */ - if (iq2000_cpu_string != 0) - { - iq2000_cpu = iq2000_parse_cpu (iq2000_cpu_string); - if (iq2000_cpu == PROCESSOR_DEFAULT) - { - error ("bad value (%s) for -mcpu= switch", iq2000_arch_string); - iq2000_cpu_string = "default"; - } - iq2000_arch = iq2000_cpu; - iq2000_tune = iq2000_cpu; - } - - if (iq2000_arch_string == 0 - || ! strcmp (iq2000_arch_string, "default") - || ! strcmp (iq2000_arch_string, "DEFAULT")) - { - switch (iq2000_isa) - { - default: - iq2000_arch_string = "iq2000"; - iq2000_arch = PROCESSOR_IQ2000; - break; - } - } - else - { - iq2000_arch = iq2000_parse_cpu (iq2000_arch_string); - if (iq2000_arch == PROCESSOR_DEFAULT) - { - error ("bad value (%s) for -march= switch", iq2000_arch_string); - iq2000_arch_string = "default"; - } - if (iq2000_arch == PROCESSOR_IQ10) - { - error ("The compiler does not support -march=%s.", iq2000_arch_string); - iq2000_arch_string = "default"; - } - } - iq2000_print_operand_punct['?'] = 1; iq2000_print_operand_punct['#'] = 1; iq2000_print_operand_punct['&'] = 1; @@ -2033,9 +1777,8 @@ save_restore_insns (int store_p) HOST_WIDE_INT gp_offset; HOST_WIDE_INT end_offset; - if (frame_pointer_needed - && ! BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST)) - abort (); + gcc_assert (!frame_pointer_needed + || BITSET_P (mask, HARD_FRAME_POINTER_REGNUM - GP_REG_FIRST)); if (mask == 0) { @@ -2175,8 +1918,7 @@ iq2000_expand_prologue (void) { int words; - if (GET_CODE (entry_parm) != REG) - abort (); + gcc_assert (GET_CODE (entry_parm) == REG); /* Passed in a register, so will get homed automatically. */ if (GET_MODE (entry_parm) == BLKmode) @@ -2682,7 +2424,7 @@ iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p, } default: - abort (); + gcc_unreachable (); } /* NOTREACHED */ @@ -2889,7 +2631,7 @@ expand_one_builtin (enum insn_code icode, rtx target, tree arglist, pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]); break; default: - abort (); + gcc_unreachable (); } if (! pat) @@ -3394,15 +3136,7 @@ print_operand (FILE *file, rtx op, int letter) else if (letter == 'Z') { - int regnum; - - if (code != REG) - abort (); - - regnum = REGNO (op); - abort (); - - fprintf (file, "%s,", reg_names[regnum]); + gcc_unreachable (); } else if (code == REG || code == SUBREG) diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h index 2011f122d84..c705cfef418 100644 --- a/gcc/config/iq2000/iq2000.h +++ b/gcc/config/iq2000/iq2000.h @@ -44,73 +44,20 @@ } \ while (0) -extern int target_flags; - -#define MASK_GPOPT 0x00000008 /* Optimize for global pointer. */ -#define MASK_EMBEDDED_DATA 0x00008000 /* Reduce RAM usage, not fast code. */ -#define MASK_UNINIT_CONST_IN_RODATA \ - 0x00800000 /* Store uninitialized - consts in rodata. */ - /* Macros used in the machine description to test the flags. */ #define TARGET_STATS 0 -/* For embedded systems, optimize for reduced RAM space instead of for - fastest code. */ -#define TARGET_EMBEDDED_DATA (target_flags & MASK_EMBEDDED_DATA) - -#define TARGET_DEBUG_MODE (target_flags & 0) -#define TARGET_DEBUG_A_MODE (target_flags & 0) -#define TARGET_DEBUG_B_MODE (target_flags & 0) -#define TARGET_DEBUG_C_MODE (target_flags & 0) -#define TARGET_DEBUG_D_MODE (target_flags & 0) - -#define TARGET_SWITCHES \ -{ \ - {"no-crt0", 0, \ - N_("No default crt0.o") }, \ - {"gpopt", MASK_GPOPT, \ - N_("Use GP relative sdata/sbss sections")}, \ - {"no-gpopt", -MASK_GPOPT, \ - N_("Don't use GP relative sdata/sbss sections")}, \ - {"embedded-data", MASK_EMBEDDED_DATA, \ - N_("Use ROM instead of RAM")}, \ - {"no-embedded-data", -MASK_EMBEDDED_DATA, \ - N_("Don't use ROM instead of RAM")}, \ - {"uninit-const-in-rodata", MASK_UNINIT_CONST_IN_RODATA, \ - N_("Put uninitialized constants in ROM (needs -membedded-data)")}, \ - {"no-uninit-const-in-rodata", -MASK_UNINIT_CONST_IN_RODATA, \ - N_("Don't put uninitialized constants in ROM")}, \ - {"", (TARGET_DEFAULT \ - | TARGET_CPU_DEFAULT), \ - NULL}, \ -} - -/* Default target_flags if no switches are specified. */ - -#define TARGET_DEFAULT 0 - -#ifndef TARGET_CPU_DEFAULT -#define TARGET_CPU_DEFAULT 0 -#endif +#define TARGET_DEBUG_MODE 0 +#define TARGET_DEBUG_A_MODE 0 +#define TARGET_DEBUG_B_MODE 0 +#define TARGET_DEBUG_C_MODE 0 +#define TARGET_DEBUG_D_MODE 0 #ifndef IQ2000_ISA_DEFAULT #define IQ2000_ISA_DEFAULT 1 #endif -#define TARGET_OPTIONS \ -{ \ - SUBTARGET_TARGET_OPTIONS \ - { "cpu=", & iq2000_cpu_string, \ - N_("Specify CPU for scheduling purposes")}, \ - { "arch=", & iq2000_arch_string, \ - N_("Specify CPU for code generation purposes")}, \ -} - -/* This is meant to be redefined in the host dependent files. */ -#define SUBTARGET_TARGET_OPTIONS - #define IQ2000_VERSION "[1.0]" #ifndef MACHINE_TYPE @@ -832,23 +779,6 @@ while (0) /* Miscellaneous Parameters. */ -#define PREDICATE_CODES \ - {"uns_arith_operand", { REG, CONST_INT, SUBREG }}, \ - {"arith_operand", { REG, CONST_INT, SUBREG }}, \ - {"small_int", { CONST_INT }}, \ - {"large_int", { CONST_INT }}, \ - {"reg_or_0_operand", { REG, CONST_INT, CONST_DOUBLE, SUBREG }}, \ - {"simple_memory_operand", { MEM, SUBREG }}, \ - {"equality_op", { EQ, NE }}, \ - {"cmp_op", { EQ, NE, GT, GE, GTU, GEU, LT, LE, \ - LTU, LEU }}, \ - {"pc_or_label_operand", { PC, LABEL_REF }}, \ - {"call_insn_operand", { CONST_INT, CONST, SYMBOL_REF, REG}}, \ - {"move_operand", { CONST_INT, CONST_DOUBLE, CONST, \ - SYMBOL_REF, LABEL_REF, SUBREG, \ - REG, MEM}}, \ - {"power_of_2_operand", { CONST_INT }}, - #define CASE_VECTOR_MODE SImode #define WORD_REGISTER_OPERATIONS @@ -1115,13 +1045,6 @@ extern void sbss_section (void); ((LENGTH) = iq2000_adjust_insn_length ((INSN), (LENGTH))) -/* A list of predicates that do special things with modes, and so - should not elicit warnings for VOIDmode match_operand. */ - -#define SPECIAL_MODE_PREDICATES \ - "pc_or_label_operand", - - /* How to tell the debugger about changes of source files. */ @@ -1146,11 +1069,6 @@ extern void sbss_section (void); #define SDATA_SECTION_ASM_OP "\t.sdata" /* Small data. */ -/* See iq2000_expand_prologue's use of loadgp for when this should be - true. */ - -#define DONT_ACCESS_GBLS_AFTER_EPILOGUE 0 - /* List of all IQ2000 punctuation characters used by print_operand. */ extern char iq2000_print_operand_punct[256]; @@ -1167,12 +1085,6 @@ extern rtx branch_cmp[2]; /* What type of branch to use. */ extern enum cmp_type branch_type; -/* Strings to hold which cpu and instruction set architecture to use. */ -extern const char * iq2000_cpu_string; /* For -mcpu=. */ -extern const char * iq2000_arch_string; /* For -march=. */ - - - enum iq2000_builtins { IQ2000_BUILTIN_ADO16, diff --git a/gcc/config/iq2000/iq2000.md b/gcc/config/iq2000/iq2000.md index 6e6c0767ba3..0528a12e88d 100644 --- a/gcc/config/iq2000/iq2000.md +++ b/gcc/config/iq2000/iq2000.md @@ -1,5 +1,5 @@ ;; iq2000.md Machine Description for Vitesse IQ2000 processors -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; This file is part of GCC. @@ -194,6 +194,7 @@ (nil) (nil)]) +(include "predicates.md") ;; ......................... @@ -1728,8 +1729,7 @@ { if (operands[0]) /* eliminate unused code warnings */ { - if (GET_MODE (operands[0]) != Pmode) - abort (); + gcc_assert (GET_MODE (operands[0]) == Pmode); if (!(Pmode == DImode)) emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1])); diff --git a/gcc/config/iq2000/iq2000.opt b/gcc/config/iq2000/iq2000.opt new file mode 100644 index 00000000000..3b47f3fa56f --- /dev/null +++ b/gcc/config/iq2000/iq2000.opt @@ -0,0 +1,45 @@ +; Options for the Vitesse IQ2000 port of the compiler. + +; Copyright (C) 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. + +march= +Target RejectNegative Joined +Specify CPU for code generation purposes + +mcpu= +Target RejectNegative Joined +Specify CPU for scheduling purposes + +membedded-data +Target Mask(EMBEDDED_DATA) +Use ROM instead of RAM + +mgpopt +Target Mask(GPOPT) +Use GP relative sdata/sbss sections + +; Not used by the compiler proper. +mno-crt0 +Target RejectNegative +No default crt0.o + +muninit-const-in-rodata +Target Mask(UNINIT_CONST_IN_RODATA) +Put uninitialized constants in ROM (needs -membedded-data) diff --git a/gcc/config/iq2000/predicates.md b/gcc/config/iq2000/predicates.md new file mode 100644 index 00000000000..a8ce5819d74 --- /dev/null +++ b/gcc/config/iq2000/predicates.md @@ -0,0 +1,233 @@ +;; Predicate definitions for Vitesse IQ2000. +;; Copyright (C) 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. + +;; Return 1 if OP can be used as an operand where a register or 16 bit +;; unsigned integer is needed. + +(define_predicate "uns_arith_operand" + (match_code "reg,const_int,subreg") +{ + if (GET_CODE (op) == CONST_INT && SMALL_INT_UNSIGNED (op)) + return 1; + + return register_operand (op, mode); +}) + +;; Return 1 if OP can be used as an operand where a 16 bit integer is +;; needed. + +(define_predicate "arith_operand" + (match_code "reg,const_int,subreg") +{ + if (GET_CODE (op) == CONST_INT && SMALL_INT (op)) + return 1; + + return register_operand (op, mode); +}) + +;; Return 1 if OP is a integer which fits in 16 bits. + +(define_predicate "small_int" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT && SMALL_INT (op)); +}) + +;; Return 1 if OP is a 32 bit integer which is too big to be loaded +;; with one instruction. + +(define_predicate "large_int" + (match_code "const_int") +{ + HOST_WIDE_INT value; + + if (GET_CODE (op) != CONST_INT) + return 0; + + value = INTVAL (op); + + /* IOR reg,$r0,value. */ + if ((value & ~ ((HOST_WIDE_INT) 0x0000ffff)) == 0) + return 0; + + /* SUBU reg,$r0,value. */ + if (((unsigned HOST_WIDE_INT) (value + 32768)) <= 32767) + return 0; + + /* LUI reg,value >> 16. */ + if ((value & 0x0000ffff) == 0) + return 0; + + return 1; +}) + +;; Return 1 if OP is a register or the constant 0. + +(define_predicate "reg_or_0_operand" + (match_code "reg,const_int,const_double,subreg") +{ + switch (GET_CODE (op)) + { + case CONST_INT: + return INTVAL (op) == 0; + + case CONST_DOUBLE: + return op == CONST0_RTX (mode); + + case REG: + case SUBREG: + return register_operand (op, mode); + + default: + break; + } + + return 0; +}) + +;; Return 1 if OP is a memory operand that fits in a single +;; instruction (i.e., register + small offset). + +(define_predicate "simple_memory_operand" + (match_code "mem,subreg") +{ + rtx addr, plus0, plus1; + + /* Eliminate non-memory operations. */ + if (GET_CODE (op) != MEM) + return 0; + + /* Dword operations really put out 2 instructions, so eliminate them. */ + if (GET_MODE_SIZE (GET_MODE (op)) > (unsigned) UNITS_PER_WORD) + return 0; + + /* Decode the address now. */ + addr = XEXP (op, 0); + switch (GET_CODE (addr)) + { + case REG: + case LO_SUM: + return 1; + + case CONST_INT: + return SMALL_INT (addr); + + case PLUS: + plus0 = XEXP (addr, 0); + plus1 = XEXP (addr, 1); + if (GET_CODE (plus0) == REG + && GET_CODE (plus1) == CONST_INT && SMALL_INT (plus1) + && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */) + return 1; + + else if (GET_CODE (plus1) == REG + && GET_CODE (plus0) == CONST_INT && SMALL_INT (plus0) + && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */) + return 1; + + else + return 0; + + case SYMBOL_REF: + return 0; + + default: + break; + } + + return 0; +}) + +;; Return nonzero if the code of this rtx pattern is EQ or NE. + +(define_predicate "equality_op" + (match_code "eq,ne") +{ + if (mode != GET_MODE (op)) + return 0; + + return GET_CODE (op) == EQ || GET_CODE (op) == NE; +}) + +;; Return nonzero if the code is a relational operations (EQ, LE, +;; etc). + +(define_predicate "cmp_op" + (match_code "eq,ne,gt,ge,gtu,geu,lt,le,ltu,leu") +{ + if (mode != GET_MODE (op)) + return 0; + + return COMPARISON_P (op); +}) + +;; Return nonzero if the operand is either the PC or a label_ref. + +(define_special_predicate "pc_or_label_operand" + (match_code "pc,label_ref") +{ + if (op == pc_rtx) + return 1; + + if (GET_CODE (op) == LABEL_REF) + return 1; + + return 0; +}) + +;; Return nonzero if OP is a valid operand for a call instruction. + +(define_predicate "call_insn_operand" + (match_code "const_int,const,symbol_ref,reg") +{ + return (CONSTANT_ADDRESS_P (op) + || (GET_CODE (op) == REG && op != arg_pointer_rtx + && ! (REGNO (op) >= FIRST_PSEUDO_REGISTER + && REGNO (op) <= LAST_VIRTUAL_REGISTER))); +}) + +;; Return nonzero if OP is valid as a source operand for a move +;; instruction. + +(define_predicate "move_operand" + (match_code "const_int,const_double,const,symbol_ref,label_ref,subreg,reg,mem") +{ + /* Accept any general operand after reload has started; doing so + avoids losing if reload does an in-place replacement of a register + with a SYMBOL_REF or CONST. */ + return (general_operand (op, mode) + && (! (iq2000_check_split (op, mode)) + || reload_in_progress || reload_completed)); +}) + +;; Return nonzero if OP is a constant power of 2. + +(define_predicate "power_of_2_operand" + (match_code "const_int") +{ + int intval; + + if (GET_CODE (op) != CONST_INT) + return 0; + else + intval = INTVAL (op); + + return ((intval & ((unsigned)(intval) - 1)) == 0); +}) diff --git a/gcc/config/lynx.h b/gcc/config/lynx.h index 94780c6c747..c06a65d2983 100644 --- a/gcc/config/lynx.h +++ b/gcc/config/lynx.h @@ -129,20 +129,6 @@ Boston, MA 02111-1307, USA. */ %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}" #endif -/* Because of the %{m*} in cc1_options these options get substituted - for cc1. We ignore them here. */ - -#ifndef SUBTARGET_OS_LYNX_SWITCHES -# define SUBTARGET_OS_LYNX_SWITCHES \ - { "shared", 0, N_("Use shared libraries") }, \ - { "threads", 0, N_("Support multi-threading") }, \ - { "legacy-threads", 0, N_("Support legacy multi-threading") }, -#endif - -#ifndef SUBTARGET_SWITCHES -# define SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES -#endif - /* Define the actual types of some ANSI-mandated types. */ #ifndef SIZE_TYPE diff --git a/gcc/config/lynx.opt b/gcc/config/lynx.opt new file mode 100644 index 00000000000..059a3d20b74 --- /dev/null +++ b/gcc/config/lynx.opt @@ -0,0 +1,32 @@ +; Processor-independent options for LynxOS. + +; Copyright (C) 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. + +mlegacy-threads +Target RejectNegative +Support legacy multi-threading + +mshared +Target RejectNegative +Use shared libraries + +mthreads +Target RejectNegative +Support multi-threading diff --git a/gcc/config/m32r/little.h b/gcc/config/m32r/little.h index 9c1b0b5a72c..4b8f11a9c5d 100644 --- a/gcc/config/m32r/little.h +++ b/gcc/config/m32r/little.h @@ -1,5 +1,5 @@ /* Definitions for Renesas little endian M32R cpu. - Copyright (C) 2003, 2004 + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -19,7 +19,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_ENDIAN_DEFAULT LITTLE_ENDIAN_BIT +#define TARGET_LITTLE_ENDIAN 1 #define CPP_ENDIAN_SPEC \ " %{mbe:-D__BIG_ENDIAN__} %{mbig-endian:-D__BIG_ENDIAN__}" \ diff --git a/gcc/config/m32r/m32r-protos.h b/gcc/config/m32r/m32r-protos.h index 2ea6a59ab0d..0f72bd7521f 100644 --- a/gcc/config/m32r/m32r-protos.h +++ b/gcc/config/m32r/m32r-protos.h @@ -1,5 +1,5 @@ /* Prototypes for m32r.c functions used in the md file & elsewhere. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -58,35 +58,13 @@ extern rtx m32r_return_addr (int); extern rtx m32r_function_symbol (const char *); #ifdef HAVE_MACHINE_MODES -extern int call_address_operand (rtx, Mmode); extern int call_operand (rtx, Mmode); -extern int symbolic_operand (rtx, Mmode); extern int small_data_operand (rtx, Mmode); extern int addr24_operand (rtx, Mmode); extern int addr32_operand (rtx, Mmode); extern int call26_operand (rtx, Mmode); -extern int seth_add3_operand (rtx, Mmode); -extern int cmp_int16_operand (rtx, Mmode); -extern int uint16_operand (rtx, Mmode); -extern int reg_or_int16_operand (rtx, Mmode); -extern int reg_or_uint16_operand (rtx, Mmode); -extern int reg_or_cmp_int16_operand (rtx, Mmode); -extern int two_insn_const_operand (rtx, Mmode); -extern int move_src_operand (rtx, Mmode); -extern int move_double_src_operand (rtx, Mmode); -extern int move_dest_operand (rtx, Mmode); -extern int eqne_comparison_operator (rtx, Mmode); -extern int signed_comparison_operator (rtx, Mmode); extern int memreg_operand (rtx, Mmode); extern int small_insn_p (rtx, Mmode); -extern int large_insn_p (rtx, Mmode); -extern int conditional_move_operand (rtx, Mmode); -extern int carry_compare_operand (rtx, Mmode); -extern int m32r_block_immediate_operand (rtx, Mmode); -extern int extend_operand (rtx, Mmode); -extern int reg_or_eq_int16_operand (rtx, Mmode); -extern int int8_operand (rtx, Mmode); -extern int reg_or_zero_operand (rtx, Mmode); #endif /* HAVE_MACHINE_MODES */ diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index 170c4c67b4c..fbe539433f5 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1,6 +1,6 @@ /* Subroutines used for code generation on the Renesas M32R cpu. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -51,12 +51,10 @@ rtx m32r_compare_op0, m32r_compare_op1; char m32r_punct_chars[256]; /* Selected code model. */ -const char * m32r_model_string = M32R_MODEL_DEFAULT; -enum m32r_model m32r_model; +enum m32r_model m32r_model = M32R_MODEL_DEFAULT; /* Selected SDA support. */ -const char * m32r_sdata_string = M32R_SDATA_DEFAULT; -enum m32r_sdata m32r_sdata; +enum m32r_sdata m32r_sdata = M32R_SDATA_DEFAULT; /* Machine-specific symbol_ref flags. */ #define SYMBOL_FLAG_MODEL_SHIFT SYMBOL_FLAG_MACH_DEP_SHIFT @@ -69,17 +67,17 @@ enum m32r_sdata m32r_sdata; /* Cache-flush support. Cache-flush is used at trampoline. Default cache-flush is "trap 12". default cache-flush function is "_flush_cache" (CACHE_FLUSH_FUNC) - default cache-flush trap-interrupt number is "12". (CACHE_FLUSH_TRAP) + default cache-flush trap-interrupt number is 12 (CACHE_FLUSH_TRAP) You can change how to generate code of cache-flush with following options. - -flush-func=FLUSH-FUNC-NAME - -no-flush-func - -fluch-trap=TRAP-NUMBER - -no-flush-trap. */ + -mflush-func=FLUSH-FUNC-NAME + -mno-flush-func (sets m32r_cache_flush_func to NULL) + -mfluch-trap=TRAP-NUMBER + -mno-flush-trap. (sets m32r_cache_flush_trap to -1). */ const char *m32r_cache_flush_func = CACHE_FLUSH_FUNC; -const char *m32r_cache_flush_trap_string = CACHE_FLUSH_TRAP; -int m32r_cache_flush_trap = 12; +int m32r_cache_flush_trap = CACHE_FLUSH_TRAP; /* Forward declaration. */ +static bool m32r_handle_option (size_t, const char *, int); static void init_reg_tables (void); static void block_move_call (rtx, rtx, rtx); static int m32r_is_insn (rtx); @@ -127,6 +125,11 @@ static int m32r_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, #undef TARGET_SCHED_ISSUE_RATE #define TARGET_SCHED_ISSUE_RATE m32r_issue_rate +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_CPU_DEFAULT +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION m32r_handle_option + #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info #undef TARGET_IN_SMALL_DATA_P @@ -152,6 +155,60 @@ static int m32r_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +m32r_handle_option (size_t code, const char *arg, int value) +{ + switch (code) + { + case OPT_m32r: + target_flags &= ~(MASK_M32R2 | MASK_M32RX); + return true; + + case OPT_mmodel_: + if (strcmp (arg, "small") == 0) + m32r_model = M32R_MODEL_SMALL; + else if (strcmp (arg, "medium") == 0) + m32r_model = M32R_MODEL_MEDIUM; + else if (strcmp (arg, "large") == 0) + m32r_model = M32R_MODEL_LARGE; + else + return false; + return true; + + case OPT_msdata_: + if (strcmp (arg, "none") == 0) + m32r_sdata = M32R_SDATA_NONE; + else if (strcmp (arg, "sdata") == 0) + m32r_sdata = M32R_SDATA_SDATA; + else if (strcmp (arg, "use") == 0) + m32r_sdata = M32R_SDATA_USE; + else + return false; + return true; + + case OPT_mflush_func_: + m32r_cache_flush_func = arg; + return true; + + case OPT_mno_flush_func: + m32r_cache_flush_func = NULL; + return true; + + case OPT_mflush_trap_: + m32r_cache_flush_trap = value; + return m32r_cache_flush_trap <= 15; + + case OPT_mno_flush_trap: + m32r_cache_flush_trap = -1; + return true; + + default: + return true; + } +} + /* Called by OVERRIDE_OPTIONS to initialize various things. */ void @@ -167,33 +224,6 @@ m32r_init (void) /* Provide default value if not specified. */ if (!g_switch_set) g_switch_value = SDATA_DEFAULT_SIZE; - - if (strcmp (m32r_model_string, "small") == 0) - m32r_model = M32R_MODEL_SMALL; - else if (strcmp (m32r_model_string, "medium") == 0) - m32r_model = M32R_MODEL_MEDIUM; - else if (strcmp (m32r_model_string, "large") == 0) - m32r_model = M32R_MODEL_LARGE; - else - error ("bad value (%s) for -mmodel switch", m32r_model_string); - - if (strcmp (m32r_sdata_string, "none") == 0) - m32r_sdata = M32R_SDATA_NONE; - else if (strcmp (m32r_sdata_string, "sdata") == 0) - m32r_sdata = M32R_SDATA_SDATA; - else if (strcmp (m32r_sdata_string, "use") == 0) - m32r_sdata = M32R_SDATA_USE; - else - error ("bad value (%s) for -msdata switch", m32r_sdata_string); - - if (m32r_cache_flush_trap_string) - { - /* Change trap-number (12) for cache-flush to the others (0 - 15). */ - m32r_cache_flush_trap = atoi (m32r_cache_flush_trap_string); - if (m32r_cache_flush_trap < 0 || m32r_cache_flush_trap > 15) - error ("bad value (%s) for -flush-trap=n (0= 32) - { - HOST_WIDE_INT rest = INTVAL (op) >> 31; - return (rest == 0 || rest == -1); - } - else - return 1; - case CONST_DOUBLE : - if (mode == SFmode) - return 1; - else if (mode == SImode) - { - /* Large unsigned constants are represented as const_double's. */ - unsigned HOST_WIDE_INT low, high; - - low = CONST_DOUBLE_LOW (op); - high = CONST_DOUBLE_HIGH (op); - return high == 0 && low <= (unsigned) 0xffffffff; - } - else - return 0; - case REG : - return register_operand (op, mode); - case SUBREG : - /* (subreg (mem ...) ...) can occur here if the inner part was once a - pseudo-reg and is now a stack slot. */ - if (GET_CODE (SUBREG_REG (op)) == MEM) - return address_operand (XEXP (SUBREG_REG (op), 0), mode); - else - return register_operand (op, mode); - case MEM : - if (GET_CODE (XEXP (op, 0)) == PRE_INC - || GET_CODE (XEXP (op, 0)) == PRE_DEC) - return 0; /* loads can't do pre-{inc,dec} */ - return address_operand (XEXP (op, 0), mode); - default : - return 0; - } -} - -/* Return true if OP is an acceptable argument for a double word - move source. */ - -int -move_double_src_operand (rtx op, enum machine_mode mode) -{ - switch (GET_CODE (op)) - { - case CONST_INT : - case CONST_DOUBLE : - return 1; - case REG : - return register_operand (op, mode); - case SUBREG : - /* (subreg (mem ...) ...) can occur here if the inner part was once a - pseudo-reg and is now a stack slot. */ - if (GET_CODE (SUBREG_REG (op)) == MEM) - return move_double_src_operand (SUBREG_REG (op), mode); - else - return register_operand (op, mode); - case MEM : - /* Disallow auto inc/dec for now. */ - if (GET_CODE (XEXP (op, 0)) == PRE_DEC - || GET_CODE (XEXP (op, 0)) == PRE_INC) - return 0; - return address_operand (XEXP (op, 0), mode); - default : - return 0; - } -} - -/* Return true if OP is an acceptable argument for a move destination. */ - -int -move_dest_operand (rtx op, enum machine_mode mode) -{ - switch (GET_CODE (op)) - { - case REG : - return register_operand (op, mode); - case SUBREG : - /* (subreg (mem ...) ...) can occur here if the inner part was once a - pseudo-reg and is now a stack slot. */ - if (GET_CODE (SUBREG_REG (op)) == MEM) - return address_operand (XEXP (SUBREG_REG (op), 0), mode); - else - return register_operand (op, mode); - case MEM : - if (GET_CODE (XEXP (op, 0)) == POST_INC) - return 0; /* stores can't do post inc */ - return address_operand (XEXP (op, 0), mode); - default : - return 0; - } -} - /* Return 1 if OP is a DImode const we want to handle inline. This must match the code in the movdi pattern. It is used by the 'G' CONST_DOUBLE_OK_FOR_LETTER. */ @@ -893,28 +645,6 @@ easy_df_const (rtx op) return 0; } -/* Return 1 if OP is an EQ or NE comparison operator. */ - -int -eqne_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - return (code == EQ || code == NE); -} - -/* Return 1 if OP is a signed comparison operator. */ - -int -signed_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - return (COMPARISON_P (op) - && (code == EQ || code == NE - || code == LT || code == LE || code == GT || code == GE)); -} - /* Return 1 if OP is (mem (reg ...)). This is used in insn length calcs. */ @@ -924,58 +654,6 @@ memreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == REG; } -/* Return true if OP is an acceptable input argument for a zero/sign extend - operation. */ - -int -extend_operand (rtx op, enum machine_mode mode) -{ - rtx addr; - - switch (GET_CODE (op)) - { - case REG : - case SUBREG : - return register_operand (op, mode); - - case MEM : - addr = XEXP (op, 0); - if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC) - return 0; /* loads can't do pre inc/pre dec */ - - return address_operand (addr, mode); - - default : - return 0; - } -} - -/* Return nonzero if the operand is an insn that is a small insn. - Allow const_int 0 as well, which is a placeholder for NOP slots. */ - -int -small_insn_p (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0) - return 1; - - if (! INSN_P (op)) - return 0; - - return get_attr_length (op) == 2; -} - -/* Return nonzero if the operand is an insn that is a large insn. */ - -int -large_insn_p (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (! INSN_P (op)) - return 0; - - return get_attr_length (op) != 2; -} - /* Return nonzero if TYPE must be passed by indirect reference. */ static bool @@ -1022,7 +700,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) case GEU: compare_code = LTU; branch_code = EQ; break; default: - abort (); + gcc_unreachable (); } if (need_compare) @@ -1088,7 +766,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) code = NE; break; default: - abort (); + gcc_unreachable (); } return gen_rtx_fmt_ee (code, CCmode, cc_reg, const0_rtx); @@ -1128,7 +806,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) code = NE; break; default: - abort(); + gcc_unreachable (); } return gen_rtx_fmt_ee (code, CCmode, cc_reg, const0_rtx); @@ -1136,7 +814,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) break; default: - abort(); + gcc_unreachable (); } } else @@ -1198,7 +876,7 @@ gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare) break; default: - abort (); + gcc_unreachable (); } return gen_rtx_fmt_ee (branch_code, VOIDmode, cc_reg, CONST0_RTX (CCmode)); @@ -1290,7 +968,7 @@ gen_split_move_double (rtx operands[]) !reverse * UNITS_PER_WORD))); } else - abort (); + gcc_unreachable (); } /* Mem = reg. */ @@ -1317,7 +995,7 @@ gen_split_move_double (rtx operands[]) } else - abort (); + gcc_unreachable (); val = get_insns (); end_sequence (); @@ -1371,8 +1049,7 @@ m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, return; /* All BLKmode values are passed by reference. */ - if (mode == BLKmode) - abort (); + gcc_assert (mode != BLKmode); first_anon_arg = (ROUND_ADVANCE_CUM (*cum, mode, type) + ROUND_ADVANCE_ARG (mode, type)); @@ -1723,8 +1400,7 @@ m32r_expand_prologue (void) gmask = current_frame_info.gmask; /* These cases shouldn't happen. Catch them now. */ - if (current_frame_info.total_size == 0 && gmask) - abort (); + gcc_assert (current_frame_info.total_size || !gmask); /* Allocate space for register arguments if this is a variadic function. */ if (current_frame_info.pretend_size != 0) @@ -1834,8 +1510,7 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) /* This is only for the human reader. */ fprintf (file, "\t%s EPILOGUE\n", ASM_COMMENT_START); - if (!current_frame_info.initialized) - abort (); + gcc_assert (current_frame_info.initialized); total_size = current_frame_info.total_size; if (total_size == 0) @@ -1894,7 +1569,7 @@ m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) sp_str, reg_names[PROLOGUE_TMP_REGNUM]); } else - abort (); + gcc_unreachable (); if (current_frame_info.save_lr) fprintf (file, "\tpop %s\n", reg_names[RETURN_ADDR_REGNUM]); @@ -1976,10 +1651,8 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) if (reg == 0) { - if (reload_in_progress || reload_completed) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!reload_in_progress && !reload_completed); + reg = gen_reg_rtx (Pmode); subregs = 1; } @@ -2022,10 +1695,8 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) if (reg == 0) { - if (reload_in_progress || reload_completed) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (!reload_in_progress && !reload_completed); + reg = gen_reg_rtx (Pmode); } if (GET_CODE (XEXP (orig, 0)) == PLUS) @@ -2043,11 +1714,11 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) { if (INT16_P (INTVAL (offset))) return plus_constant (base, INTVAL (offset)); - else if (! reload_in_progress && ! reload_completed) - offset = force_reg (Pmode, offset); else - /* If we reach here, then something is seriously wrong. */ - abort (); + { + gcc_assert (! reload_in_progress && ! reload_completed); + offset = force_reg (Pmode, offset); + } } return gen_rtx_PLUS (Pmode, base, offset); @@ -2367,9 +2038,7 @@ m32r_print_operand_address (FILE * file, rtx addr) } else if (GET_CODE (base) == LO_SUM) { - if (index != 0 - || GET_CODE (XEXP (base, 0)) != REG) - abort (); + gcc_assert (!index && GET_CODE (XEXP (base, 0)) == REG); if (small_data_operand (XEXP (base, 1), VOIDmode)) fputs ("sda(", file); else @@ -2424,59 +2093,6 @@ zero_and_one (rtx operand1, rtx operand2) ||((INTVAL (operand1) == 1) && (INTVAL (operand2) == 0))); } -/* Return nonzero if the operand is suitable for use in a conditional move sequence. */ - -int -conditional_move_operand (rtx operand, enum machine_mode mode) -{ - /* Only defined for simple integers so far... */ - if (mode != SImode && mode != HImode && mode != QImode) - return FALSE; - - /* At the moment we can handle moving registers and loading constants. */ - /* To be added: Addition/subtraction/bitops/multiplication of registers. */ - - switch (GET_CODE (operand)) - { - case REG: - return 1; - - case CONST_INT: - return INT8_P (INTVAL (operand)); - - default: -#if 0 - fprintf (stderr, "Test for cond move op of type: %s\n", - GET_RTX_NAME (GET_CODE (operand))); -#endif - return 0; - } -} - -/* Return true if the code is a test of the carry bit. */ - -int -carry_compare_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - rtx x; - - if (GET_MODE (op) != CCmode && GET_MODE (op) != VOIDmode) - return FALSE; - - if (GET_CODE (op) != NE && GET_CODE (op) != EQ) - return FALSE; - - x = XEXP (op, 0); - if (GET_CODE (x) != REG || REGNO (x) != CARRY_REGNUM) - return FALSE; - - x = XEXP (op, 1); - if (GET_CODE (x) != CONST_INT || INTVAL (x) != 0) - return FALSE; - - return TRUE; -} - /* Generate the correct assembler code to handle the conditional loading of a value into a register. It is known that the operands satisfy the conditional_move_operand() function above. The destination is operand[0]. @@ -2492,12 +2108,9 @@ emit_cond_move (rtx * operands, rtx insn ATTRIBUTE_UNUSED) buffer [0] = 0; /* Destination must be a register. */ - if (GET_CODE (operands [0]) != REG) - abort(); - if (! conditional_move_operand (operands [2], SImode)) - abort(); - if (! conditional_move_operand (operands [3], SImode)) - abort(); + gcc_assert (GET_CODE (operands [0]) == REG); + gcc_assert (conditional_move_operand (operands [2], SImode)); + gcc_assert (conditional_move_operand (operands [3], SImode)); /* Check to see if the test is reversed. */ if (GET_CODE (operands [1]) == NE) @@ -2556,7 +2169,7 @@ m32r_function_symbol (const char *name) else if (TARGET_MODEL_LARGE) model = M32R_MODEL_LARGE; else - abort (); /* Shouldn't happen. */ + gcc_unreachable (); /* Shouldn't happen. */ extra_flags |= model << SYMBOL_FLAG_MODEL_SHIFT; if (extra_flags) @@ -2583,13 +2196,6 @@ block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx) TYPE_MODE (sizetype)); } -/* The maximum number of bytes to copy using pairs of load/store instructions. - If a block is larger than this then a loop will be generated to copy - MAX_MOVE_BYTES chunks at a time. The value of 32 is a semi-arbitrary choice. - A customer uses Dhrystome as their benchmark, and Dhrystone has a 31 byte - string copy in it. */ -#define MAX_MOVE_BYTES 32 - /* Expand string/block move operations. operands[0] is the pointer to the destination. @@ -2702,8 +2308,7 @@ m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) int first_time; int got_extra = 0; - if (bytes < 1 || bytes > MAX_MOVE_BYTES) - abort (); + gcc_assert (bytes >= 1 && bytes <= MAX_MOVE_BYTES); /* We do not have a post-increment store available, so the first set of stores are done without any increment, then the remaining ones can use @@ -2836,20 +2441,6 @@ m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) } } -/* Return true if op is an integer constant, less than or equal to - MAX_MOVE_BYTES. */ - -int -m32r_block_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT - || INTVAL (op) > MAX_MOVE_BYTES - || INTVAL (op) <= 0) - return 0; - - return 1; -} - /* Return true if using NEW_REG in place of OLD_REG is ok. */ int diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index 2ebda2a6e60..a83886f3cef 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, Renesas M32R cpu. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -36,7 +36,6 @@ #undef LINK_SPEC #undef STARTFILE_SPEC #undef ENDFILE_SPEC -#undef SUBTARGET_SWITCHES #undef ASM_APP_ON #undef ASM_APP_OFF @@ -60,12 +59,6 @@ #define STARTFILE_CPU_SPEC "%{!shared:crt0.o%s} %{m32rx:m32rx/crtinit.o%s} %{!m32rx:crtinit.o%s}" #define ENDFILE_CPU_SPEC "-lgloss %{m32rx:m32rx/crtfini.o%s} %{!m32rx:crtfini.o%s}" -/* Extra machine dependent switches. */ -#define SUBTARGET_SWITCHES \ - { "32rx", TARGET_M32RX_MASK, "Compile for the m32rx" }, \ - { "32r2", TARGET_M32R2_MASK, "Compile for the m32r2" }, \ - { "32r", -(TARGET_M32RX_MASK+TARGET_M32R2_MASK), "" }, - /* Define this macro as a C expression for the initializer of an array of strings to tell the driver program which options are defaults for this target and thus do not need to be handled specially when using @@ -204,125 +197,22 @@ /* Run-time compilation parameters selecting different hardware subsets. */ -extern int target_flags; - -/* If nonzero, tell the linker to do relaxing. - We don't do anything with the option, other than recognize it. - LINK_SPEC handles passing -relax to the linker. - This can cause incorrect debugging information as line numbers may - turn out wrong. This shouldn't be specified unless accompanied with -O2 - [where the user expects debugging information to be less accurate]. */ -#define TARGET_RELAX_MASK (1 << 0) - -/* For miscellaneous debugging purposes. */ -#define TARGET_DEBUG_MASK (1 << 1) -#define TARGET_DEBUG (target_flags & TARGET_DEBUG_MASK) - -/* Align loops to 32 byte boundaries (cache line size). */ -/* ??? This option is experimental and is not documented. */ -#define TARGET_ALIGN_LOOPS_MASK (1 << 2) -#define TARGET_ALIGN_LOOPS (target_flags & TARGET_ALIGN_LOOPS_MASK) - -/* Change issue rate. */ -#define TARGET_LOW_ISSUE_RATE_MASK (1 << 3) -#define TARGET_LOW_ISSUE_RATE (target_flags & TARGET_LOW_ISSUE_RATE_MASK) - -/* Change branch cost */ -#define TARGET_BRANCH_COST_MASK (1 << 4) -#define TARGET_BRANCH_COST (target_flags & TARGET_BRANCH_COST_MASK) - -/* Target machine to compile for. */ -#define TARGET_M32R 1 - -/* Support extended instruction set. */ -#define TARGET_M32RX_MASK (1 << 5) -#define TARGET_M32RX (target_flags & TARGET_M32RX_MASK) -#undef TARGET_M32R -#define TARGET_M32R (! TARGET_M32RX) - -/* Support extended instruction set of m32r2. */ -#define TARGET_M32R2_MASK (1 << 6) -#define TARGET_M32R2 (target_flags & TARGET_M32R2_MASK) -#undef TARGET_M32R #define TARGET_M32R (! TARGET_M32RX && ! TARGET_M32R2) -/* Little Endian Flag. */ -#define LITTLE_ENDIAN_BIT (1 << 7) -#define TARGET_LITTLE_ENDIAN (target_flags & LITTLE_ENDIAN_BIT) -#define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) - -/* This defaults us to big-endian. */ -#ifndef TARGET_ENDIAN_DEFAULT -#define TARGET_ENDIAN_DEFAULT 0 +#ifndef TARGET_LITTLE_ENDIAN +#define TARGET_LITTLE_ENDIAN 0 #endif +#define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) /* This defaults us to m32r. */ #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT 0 #endif -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#ifndef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES -#endif - -#ifndef TARGET_DEFAULT -#define TARGET_DEFAULT (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT) -#endif - -#define TARGET_SWITCHES \ -{ \ -/* { "relax", TARGET_RELAX_MASK, "" }, \ - { "no-relax", -TARGET_RELAX_MASK, "" },*/ \ - { "debug", TARGET_DEBUG_MASK, \ - N_("Display compile time statistics") }, \ - { "align-loops", TARGET_ALIGN_LOOPS_MASK, \ - N_("Align all loops to 32 byte boundary") }, \ - { "no-align-loops", -TARGET_ALIGN_LOOPS_MASK, "" }, \ - { "issue-rate=1", TARGET_LOW_ISSUE_RATE_MASK, \ - N_("Only issue one instruction per cycle") }, \ - { "issue-rate=2", -TARGET_LOW_ISSUE_RATE_MASK, "" }, \ - { "branch-cost=1", TARGET_BRANCH_COST_MASK, \ - N_("Prefer branches over conditional execution") }, \ - { "branch-cost=2", -TARGET_BRANCH_COST_MASK, "" }, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT, "" } \ -} - -extern const char * m32r_model_string; -extern const char * m32r_sdata_string; - /* Cache-flush support. */ extern const char * m32r_cache_flush_func; -extern const char * m32r_cache_flush_trap_string; extern int m32r_cache_flush_trap; -#ifndef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS -#endif - -#define TARGET_OPTIONS \ -{ \ - { "model=", & m32r_model_string, \ - N_("Code size: small, medium or large"), 0}, \ - { "sdata=", & m32r_sdata_string, \ - N_("Small data area: none, sdata, use"), 0}, \ - { "no-flush-func", & m32r_cache_flush_func, \ - N_("Don't call any cache flush functions") }, \ - { "flush-func=", & m32r_cache_flush_func, \ - N_("Specify cache flush function") }, \ - { "no-flush-trap", & m32r_cache_flush_trap_string, \ - N_("Don't call any cache flush trap") }, \ - { "flush-trap=", & m32r_cache_flush_trap_string, \ - N_("Specify cache flush trap number") } \ - SUBTARGET_OPTIONS \ -} - /* Code Models Code models are used to select between two choices of two separate @@ -357,7 +247,7 @@ extern enum m32r_model m32r_model; /* The default is the small model. */ #ifndef M32R_MODEL_DEFAULT -#define M32R_MODEL_DEFAULT "small" +#define M32R_MODEL_DEFAULT M32R_MODEL_SMALL #endif /* Small Data Area @@ -407,7 +297,7 @@ extern enum m32r_sdata m32r_sdata; /* Default is to disable the SDA [for upward compatibility with previous toolchains]. */ #ifndef M32R_SDATA_DEFAULT -#define M32R_SDATA_DEFAULT "none" +#define M32R_SDATA_DEFAULT M32R_SDATA_NONE #endif /* Define this macro as a C expression for the initializer of an array of @@ -1017,7 +907,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ (OFFSET) = size - current_function_pretend_args_size; \ else \ - abort (); \ + gcc_unreachable (); \ } \ while (0) @@ -1191,7 +1081,7 @@ L2: .word STATIC #define CACHE_FLUSH_FUNC "_flush_cache" #endif #ifndef CACHE_FLUSH_TRAP -#define CACHE_FLUSH_TRAP "12" +#define CACHE_FLUSH_TRAP 12 #endif /* Length in bytes of the trampoline for entering a nested function. */ @@ -1219,7 +1109,7 @@ L2: .word STATIC (CXT)); \ emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 20)), \ (FNADDR)); \ - if (m32r_cache_flush_trap_string && m32r_cache_flush_trap_string[0]) \ + if (m32r_cache_flush_trap >= 0) \ emit_insn (gen_flush_icache (validize_mem (gen_rtx_MEM (SImode, TRAMP)),\ GEN_INT (m32r_cache_flush_trap) )); \ else if (m32r_cache_flush_func && m32r_cache_flush_func[0]) \ @@ -1719,7 +1609,7 @@ extern char m32r_punct_chars[256]; After generation of rtl, the compiler makes no further distinction between pointers and any other objects of this machine mode. */ /* ??? The M32R doesn't have full 32 bit pointers, but making this PSImode has - it's own problems (you have to add extendpsisi2 and truncsipsi2). + its own problems (you have to add extendpsisi2 and truncsipsi2). Try to avoid it. */ #define Pmode SImode @@ -1740,38 +1630,9 @@ enum m32r_function_type #define M32R_INTERRUPT_P(TYPE) ((TYPE) == M32R_FUNCTION_INTERRUPT) -/* Define this if you have defined special-purpose predicates in the - file `MACHINE.c'. This macro is called within an initializer of an - array of structures. The first field in the structure is the name - of a predicate and the second field is an array of rtl codes. For - each predicate, list all rtl codes that can be in expressions - matched by the predicate. The list should have a trailing comma. */ - -#define PREDICATE_CODES \ -{ "reg_or_zero_operand", { REG, SUBREG, CONST_INT }}, \ -{ "conditional_move_operand", { REG, SUBREG, CONST_INT }}, \ -{ "carry_compare_operand", { EQ, NE }}, \ -{ "eqne_comparison_operator", { EQ, NE }}, \ -{ "signed_comparison_operator", { EQ, NE, LT, LE, GT, GE }}, \ -{ "move_dest_operand", { REG, SUBREG, MEM }}, \ -{ "move_src_operand", { REG, SUBREG, MEM, CONST_INT, \ - CONST_DOUBLE, LABEL_REF, CONST, \ - SYMBOL_REF }}, \ -{ "move_double_src_operand", { REG, SUBREG, MEM, CONST_INT, \ - CONST_DOUBLE }}, \ -{ "two_insn_const_operand", { CONST_INT }}, \ -{ "symbolic_operand", { SYMBOL_REF, LABEL_REF, CONST }}, \ -{ "int8_operand", { CONST_INT }}, \ -{ "uint16_operand", { CONST_INT }}, \ -{ "reg_or_int16_operand", { REG, SUBREG, CONST_INT }}, \ -{ "reg_or_uint16_operand", { REG, SUBREG, CONST_INT }}, \ -{ "reg_or_cmp_int16_operand", { REG, SUBREG, CONST_INT }}, \ -{ "reg_or_eq_int16_operand", { REG, SUBREG, CONST_INT }}, \ -{ "cmp_int16_operand", { CONST_INT }}, \ -{ "call_address_operand", { SYMBOL_REF, LABEL_REF, CONST }}, \ -{ "extend_operand", { REG, SUBREG, MEM }}, \ -{ "small_insn_p", { INSN, CALL_INSN, JUMP_INSN }}, \ -{ "m32r_block_immediate_operand",{ CONST_INT }}, \ -{ "large_insn_p", { INSN, CALL_INSN, JUMP_INSN }}, \ -{ "seth_add3_operand", { SYMBOL_REF, LABEL_REF, CONST }}, - +/* The maximum number of bytes to copy using pairs of load/store instructions. + If a block is larger than this then a loop will be generated to copy + MAX_MOVE_BYTES chunks at a time. The value of 32 is a semi-arbitrary choice. + A customer uses Dhrystome as their benchmark, and Dhrystone has a 31 byte + string copy in it. */ +#define MAX_MOVE_BYTES 32 diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md index 80c579d395c..20f37d3f36c 100644 --- a/gcc/config/m32r/m32r.md +++ b/gcc/config/m32r/m32r.md @@ -199,6 +199,8 @@ "long_IF,long_E,memory*2") +(include "predicates.md") + ;; Expand prologue as RTL (define_expand "prologue" [(const_int 1)] @@ -408,7 +410,7 @@ return \"st %1,%0\"; } - abort (); + gcc_unreachable (); }" [(set_attr "type" "int2,int2,int4,int4,int4,multi,load2,load2,load4,store2,store2,store4") (set_attr "length" "2,2,4,4,4,8,2,2,4,2,2,4")]) @@ -1513,7 +1515,7 @@ case LT : br = \"lt\"; invbr = \"ge\"; break; case GE : br = \"ge\"; invbr = \"lt\"; break; - default: abort(); + default: gcc_unreachable (); } /* Is branch target reachable with bxxz? */ @@ -1560,7 +1562,7 @@ case LT : br = \"lt\"; invbr = \"ge\"; break; case GE : br = \"ge\"; invbr = \"lt\"; break; - default: abort(); + default: gcc_unreachable (); } /* Is branch target reachable with bxxz? */ diff --git a/gcc/config/m32r/m32r.opt b/gcc/config/m32r/m32r.opt new file mode 100644 index 00000000000..73287852bb5 --- /dev/null +++ b/gcc/config/m32r/m32r.opt @@ -0,0 +1,83 @@ +; Options for the Renesas M32R port of the compiler. + +; Copyright (C) 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. + +m32rx +Target Report RejectNegative Mask(M32RX) +Compile for the m32rx + +m32r2 +Target Report RejectNegative Mask(M32R2) +Compile for the m32r2 + +m32r +Target RejectNegative +Compile for the m32r + +malign-loops +Target Report Mask(ALIGN_LOOPS) +Align all loops to 32 byte boundary + +mbranch-cost=1 +Target Report RejectNegative Mask(BRANCH_COST) +Prefer branches over conditional execution + +mbranch-cost=2 +Target Report RejectNegative InverseMask(BRANCH_COST) +Give branches their default cost + +mdebug +Target Mask(DEBUG) +Display compile time statistics + +mflush-func= +Target RejectNegative Joined +Specify cache flush function + +mflush-trap= +Target RejectNegative Joined UInteger +Specify cache flush trap number + +missue-rate=1 +Target Report RejectNegative Mask(LOW_ISSUE_RATE) +Only issue one instruction per cycle + +missue-rate=2 +Target Report RejectNegative InverseMask(LOW_ISSUE_RATE) +Allow two instructions to be issued per cycle + +mmodel= +Target RejectNegative Joined +Code size: small, medium or large + +mno-flush-func +Target RejectNegative +Don't call any cache flush functions + +mno-flush-trap +Target RejectNegative +Don't call any cache flush trap + +; mrelax +; Target Mask(RELAX) + +msdata= +Target RejectNegative Joined +Small data area: none, sdata, use diff --git a/gcc/config/m32r/predicates.md b/gcc/config/m32r/predicates.md new file mode 100644 index 00000000000..d8561d69e89 --- /dev/null +++ b/gcc/config/m32r/predicates.md @@ -0,0 +1,442 @@ +;; Predicate definitions for Renesas M32R. +;; Copyright (C) 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. + +;; Return true if OP is a register or the constant 0. + +(define_predicate "reg_or_zero_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) + return register_operand (op, mode); + + if (GET_CODE (op) != CONST_INT) + return 0; + + return INTVAL (op) == 0; +}) + +;; Return nonzero if the operand is suitable for use in a conditional +;; move sequence. + +(define_predicate "conditional_move_operand" + (match_code "reg,subreg,const_int") +{ + /* Only defined for simple integers so far... */ + if (mode != SImode && mode != HImode && mode != QImode) + return FALSE; + + /* At the moment we can handle moving registers and loading constants. */ + /* To be added: Addition/subtraction/bitops/multiplication of registers. */ + + switch (GET_CODE (op)) + { + case REG: + return 1; + + case CONST_INT: + return INT8_P (INTVAL (op)); + + default: +#if 0 + fprintf (stderr, "Test for cond move op of type: %s\n", + GET_RTX_NAME (GET_CODE (op))); +#endif + return 0; + } +}) + +;; Return true if the code is a test of the carry bit. + +(define_predicate "carry_compare_operand" + (match_code "eq,ne") +{ + rtx x; + + if (GET_MODE (op) != CCmode && GET_MODE (op) != VOIDmode) + return FALSE; + + if (GET_CODE (op) != NE && GET_CODE (op) != EQ) + return FALSE; + + x = XEXP (op, 0); + if (GET_CODE (x) != REG || REGNO (x) != CARRY_REGNUM) + return FALSE; + + x = XEXP (op, 1); + if (GET_CODE (x) != CONST_INT || INTVAL (x) != 0) + return FALSE; + + return TRUE; +}) + +;; Return 1 if OP is an EQ or NE comparison operator. + +(define_predicate "eqne_comparison_operator" + (match_code "eq,ne") +{ + enum rtx_code code = GET_CODE (op); + + return (code == EQ || code == NE); +}) + +;; Return 1 if OP is a signed comparison operator. + +(define_predicate "signed_comparison_operator" + (match_code "eq,ne,lt,le,gt,ge") +{ + enum rtx_code code = GET_CODE (op); + + return (COMPARISON_P (op) + && (code == EQ || code == NE + || code == LT || code == LE || code == GT || code == GE)); +}) + +;; Return true if OP is an acceptable argument for a move destination. + +(define_predicate "move_dest_operand" + (match_code "reg,subreg,mem") +{ + switch (GET_CODE (op)) + { + case REG : + return register_operand (op, mode); + case SUBREG : + /* (subreg (mem ...) ...) can occur here if the inner part was once a + pseudo-reg and is now a stack slot. */ + if (GET_CODE (SUBREG_REG (op)) == MEM) + return address_operand (XEXP (SUBREG_REG (op), 0), mode); + else + return register_operand (op, mode); + case MEM : + if (GET_CODE (XEXP (op, 0)) == POST_INC) + return 0; /* stores can't do post inc */ + return address_operand (XEXP (op, 0), mode); + default : + return 0; + } +}) + +;; Return true if OP is an acceptable argument for a single word move +;; source. + +(define_predicate "move_src_operand" + (match_code "reg,subreg,mem,const_int,const_double,label_ref,const,symbol_ref") +{ + switch (GET_CODE (op)) + { + case LABEL_REF : + case SYMBOL_REF : + case CONST : + return addr24_operand (op, mode); + case CONST_INT : + /* ??? We allow more cse opportunities if we only allow constants + loadable with one insn, and split the rest into two. The instances + where this would help should be rare and the current way is + simpler. */ + if (HOST_BITS_PER_WIDE_INT > 32) + { + HOST_WIDE_INT rest = INTVAL (op) >> 31; + return (rest == 0 || rest == -1); + } + else + return 1; + case CONST_DOUBLE : + if (mode == SFmode) + return 1; + else if (mode == SImode) + { + /* Large unsigned constants are represented as const_double's. */ + unsigned HOST_WIDE_INT low, high; + + low = CONST_DOUBLE_LOW (op); + high = CONST_DOUBLE_HIGH (op); + return high == 0 && low <= (unsigned) 0xffffffff; + } + else + return 0; + case REG : + return register_operand (op, mode); + case SUBREG : + /* (subreg (mem ...) ...) can occur here if the inner part was once a + pseudo-reg and is now a stack slot. */ + if (GET_CODE (SUBREG_REG (op)) == MEM) + return address_operand (XEXP (SUBREG_REG (op), 0), mode); + else + return register_operand (op, mode); + case MEM : + if (GET_CODE (XEXP (op, 0)) == PRE_INC + || GET_CODE (XEXP (op, 0)) == PRE_DEC) + return 0; /* loads can't do pre-{inc,dec} */ + return address_operand (XEXP (op, 0), mode); + default : + return 0; + } +}) + +;; Return true if OP is an acceptable argument for a double word move +;; source. + +(define_predicate "move_double_src_operand" + (match_code "reg,subreg,mem,const_int,const_double") +{ + switch (GET_CODE (op)) + { + case CONST_INT : + case CONST_DOUBLE : + return 1; + case REG : + return register_operand (op, mode); + case SUBREG : + /* (subreg (mem ...) ...) can occur here if the inner part was once a + pseudo-reg and is now a stack slot. */ + if (GET_CODE (SUBREG_REG (op)) == MEM) + return move_double_src_operand (SUBREG_REG (op), mode); + else + return register_operand (op, mode); + case MEM : + /* Disallow auto inc/dec for now. */ + if (GET_CODE (XEXP (op, 0)) == PRE_DEC + || GET_CODE (XEXP (op, 0)) == PRE_INC) + return 0; + return address_operand (XEXP (op, 0), mode); + default : + return 0; + } +}) + +;; Return true if OP is a const_int requiring two instructions to +;; load. + +(define_predicate "two_insn_const_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return 0; + if (INT16_P (INTVAL (op)) + || UINT24_P (INTVAL (op)) + || UPPER16_P (INTVAL (op))) + return 0; + return 1; +}) + +;; Returns 1 if OP is a symbol reference. + +(define_predicate "symbolic_operand" + (match_code "symbol_ref,label_ref,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + case LABEL_REF: + case CONST : + return 1; + + default: + return 0; + } +}) + +;; Return true if OP is a signed 8 bit immediate value. + +(define_predicate "int8_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return 0; + return INT8_P (INTVAL (op)); +}) + +;; Return true if OP is an unsigned 16 bit immediate value. + +(define_predicate "uint16_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return 0; + return UINT16_P (INTVAL (op)); +}) + +;; Return true if OP is a register or signed 16 bit value. + +(define_predicate "reg_or_int16_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) + return register_operand (op, mode); + if (GET_CODE (op) != CONST_INT) + return 0; + return INT16_P (INTVAL (op)); +}) + +;; Return true if OP is a register or an unsigned 16 bit value. + +(define_predicate "reg_or_uint16_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) + return register_operand (op, mode); + if (GET_CODE (op) != CONST_INT) + return 0; + return UINT16_P (INTVAL (op)); +}) + +;; Return true if OP is a register or signed 16 bit value for +;; compares. + +(define_predicate "reg_or_cmp_int16_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) + return register_operand (op, mode); + if (GET_CODE (op) != CONST_INT) + return 0; + return CMP_INT16_P (INTVAL (op)); +}) + +;; Return true if OP is a register or an integer value that can be +;; used is SEQ/SNE. We can use either XOR of the value or ADD of the +;; negative of the value for the constant. Don't allow 0, because +;; that is special cased. + +(define_predicate "reg_or_eq_int16_operand" + (match_code "reg,subreg,const_int") +{ + HOST_WIDE_INT value; + + if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG) + return register_operand (op, mode); + + if (GET_CODE (op) != CONST_INT) + return 0; + + value = INTVAL (op); + return (value != 0) && (UINT16_P (value) || CMP_INT16_P (-value)); +}) + +;; Return true if OP is a signed 16 bit immediate value useful in +;; comparisons. + +(define_predicate "cmp_int16_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return 0; + return CMP_INT16_P (INTVAL (op)); +}) + +;; Acceptable arguments to the call insn. + +(define_predicate "call_address_operand" + (match_code "symbol_ref,label_ref,const") +{ + return symbolic_operand (op, mode); + +/* Constants and values in registers are not OK, because + the m32r BL instruction can only support PC relative branching. */ +}) + +;; Return true if OP is an acceptable input argument for a zero/sign +;; extend operation. + +(define_predicate "extend_operand" + (match_code "reg,subreg,mem") +{ + rtx addr; + + switch (GET_CODE (op)) + { + case REG : + case SUBREG : + return register_operand (op, mode); + + case MEM : + addr = XEXP (op, 0); + if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC) + return 0; /* loads can't do pre inc/pre dec */ + + return address_operand (addr, mode); + + default : + return 0; + } +}) + +;; Return nonzero if the operand is an insn that is a small +;; insn. Allow const_int 0 as well, which is a placeholder for NOP +;; slots. + +(define_predicate "small_insn_p" + (match_code "insn,call_insn,jump_insn") +{ + if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0) + return 1; + + if (! INSN_P (op)) + return 0; + + return get_attr_length (op) == 2; +}) + +;; Return true if op is an integer constant, less than or equal to +;; MAX_MOVE_BYTES. + +(define_predicate "m32r_block_immediate_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT + || INTVAL (op) > MAX_MOVE_BYTES + || INTVAL (op) <= 0) + return 0; + + return 1; +}) + +;; Return nonzero if the operand is an insn that is a large insn. + +(define_predicate "large_insn_p" + (match_code "insn,call_insn,jump_insn") +{ + if (! INSN_P (op)) + return 0; + + return get_attr_length (op) != 2; +}) + +;; Returns 1 if OP is an acceptable operand for seth/add3. + +(define_predicate "seth_add3_operand" + (match_code "symbol_ref,label_ref,const") +{ + if (flag_pic) + return 0; + + if (GET_CODE (op) == SYMBOL_REF + || GET_CODE (op) == LABEL_REF) + return 1; + + if (GET_CODE (op) == CONST + && GET_CODE (XEXP (op, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op, 0), 0)) == SYMBOL_REF + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT + && INT16_P (INTVAL (XEXP (XEXP (op, 0), 1)))) + return 1; + + return 0; +}) diff --git a/gcc/config/m32r/xm-linux.h b/gcc/config/m32r/xm-linux.h deleted file mode 100644 index 1c6f4629798..00000000000 --- a/gcc/config/m32r/xm-linux.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Configuration for GCC for Renesas M32R running Linux-based GNU systems. - Copyright (C) 2003 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your - option) any later version. - - GCC is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. */ - -#include -#include - -/* Doubles are stored in memory with the high order word first. - This matters when cross-compiling. */ -#undef HOST_WORDS_BIG_ENDIAN diff --git a/gcc/config/m32r/xm-m32r.h b/gcc/config/m32r/xm-m32r.h deleted file mode 100644 index c7b006ae3b5..00000000000 --- a/gcc/config/m32r/xm-m32r.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Configuration for GNU C-compiler for the M32R processor. - Copyright (C) 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. */ - -/* This describes the machine the compiler is hosted on. */ -#define HOST_BITS_PER_CHAR 8 -#define HOST_BITS_PER_SHORT 16 -#define HOST_BITS_PER_INT 32 -#define HOST_BITS_PER_LONG 32 -#define HOST_BITS_PER_LONGLONG 64 - -/* Doubles are stored in memory with the high order word first. - This matters when cross-compiling. */ -#define HOST_WORDS_BIG_ENDIAN 1 - -/* target machine dependencies. - tm.h is a symbolic link to the actual target specific file. */ -#include "tm.h" - -/* Arguments to use with `exit'. */ -#define SUCCESS_EXIT_CODE 0 -#define FATAL_EXIT_CODE 33 - -/* If compiled with Sun CC, the use of alloca requires this #include. */ -#ifndef __GNUC__ -#include "alloca.h" -#endif diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h index af8c35b8a1c..aad6f4ad0b8 100644 --- a/gcc/config/m68hc11/m68hc11-protos.h +++ b/gcc/config/m68hc11/m68hc11-protos.h @@ -1,5 +1,6 @@ /* Prototypes for exported functions defined in m68hc11.c - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) This file is part of GCC. @@ -41,6 +42,8 @@ extern void m68hc11_function_arg_advance (CUMULATIVE_ARGS*, #endif #ifdef RTX_CODE +extern int m68hc11_auto_inc_p (rtx); + extern void m68hc11_initialize_trampoline (rtx, rtx, rtx); extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx); @@ -90,32 +93,18 @@ extern int m68hc11_indirect_p (rtx, enum machine_mode); extern int go_if_legitimate_address2 (rtx, enum machine_mode, int); extern int reg_or_indexed_operand (rtx,enum machine_mode); -extern int tst_operand (rtx,enum machine_mode); -extern int cmp_operand (rtx,enum machine_mode); extern int memory_indexed_operand (rtx, enum machine_mode); extern void m68hc11_split_logical (enum machine_mode, int, rtx*); extern int m68hc11_register_indirect_p (rtx, enum machine_mode); +extern int m68hc11_valid_addressing_p (rtx, enum machine_mode, int); extern int symbolic_memory_operand (rtx, enum machine_mode); extern int memory_reload_operand (rtx, enum machine_mode); -extern int stack_register_operand (rtx, enum machine_mode); -extern int d_register_operand (rtx, enum machine_mode); -extern int hard_addr_reg_operand (rtx, enum machine_mode); -extern int splitable_operand (rtx, enum machine_mode); extern int arith_src_operand (rtx, enum machine_mode); -extern int m68hc11_logical_operator (rtx, enum machine_mode); -extern int m68hc11_arith_operator (rtx, enum machine_mode); -extern int m68hc11_non_shift_operator (rtx, enum machine_mode); -extern int m68hc11_shift_operator (rtx, enum machine_mode); -extern int m68hc11_unary_operator (rtx, enum machine_mode); -extern int m68hc11_eq_compare_operator (rtx, enum machine_mode); -extern int non_push_operand (rtx, enum machine_mode); -extern int hard_reg_operand (rtx, enum machine_mode); extern int soft_reg_operand (rtx, enum machine_mode); -extern int reg_or_some_mem_operand (rtx, enum machine_mode); #if defined TREE_CODE extern void m68hc11_init_cumulative_args (CUMULATIVE_ARGS*, tree, rtx); @@ -135,6 +124,7 @@ extern int m68hc11_page0_symbol_p (rtx x); extern HOST_WIDE_INT m68hc11_min_offset; extern HOST_WIDE_INT m68hc11_max_offset; +extern int m68hc11_addr_mode; #endif /* HAVE_MACHINE_MODES */ #endif /* RTX_CODE */ diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c index f2a44fb8def..6b68d25fdf7 100644 --- a/gcc/config/m68hc11/m68hc11.c +++ b/gcc/config/m68hc11/m68hc11.c @@ -65,14 +65,12 @@ static rtx simplify_logical (enum machine_mode, int, rtx, rtx *); static void m68hc11_emit_logical (enum machine_mode, int, rtx *); static void m68hc11_reorg (void); static int go_if_legitimate_address_internal (rtx, enum machine_mode, int); -static int register_indirect_p (rtx, enum machine_mode, int); static rtx m68hc11_expand_compare (enum rtx_code, rtx, rtx); static int must_parenthesize (rtx); static int m68hc11_address_cost (rtx); static int m68hc11_shift_cost (enum machine_mode, rtx, int); static int m68hc11_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code); static bool m68hc11_rtx_costs (rtx, int, int, int *); -static int m68hc11_auto_inc_p (rtx); static tree m68hc11_handle_fntype_attribute (tree *, tree, tree, int, bool *); const struct attribute_spec m68hc11_attribute_table[]; @@ -141,13 +139,6 @@ unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER]; This is 1 for 68HC11 and 0 for 68HC12. */ int m68hc11_sp_correction; -#define ADDR_STRICT 0x01 /* Accept only registers in class A_REGS */ -#define ADDR_INCDEC 0x02 /* Post/Pre inc/dec */ -#define ADDR_INDEXED 0x04 /* D-reg index */ -#define ADDR_OFFSET 0x08 -#define ADDR_INDIRECT 0x10 /* Accept (mem (mem ...)) for [n,X] */ -#define ADDR_CONST 0x20 /* Accept const and symbol_ref */ - int m68hc11_addr_mode; int m68hc11_mov_addr_mode; @@ -227,14 +218,6 @@ static const struct processor_costs m6812_cost = { /* divSI */ COSTS_N_INSNS (100) }; - -/* Machine specific options */ - -const char *m68hc11_regparm_string; -const char *m68hc11_reg_alloc_order; -const char *m68hc11_soft_reg_count; - -static int nb_soft_regs; /* Initialize the GCC target structure. */ #undef TARGET_ATTRIBUTE_TABLE @@ -251,6 +234,9 @@ static int nb_soft_regs; #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT + #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO m68hc11_encode_section_info @@ -290,7 +276,7 @@ m68hc11_override_options (void) /* Compilation with -fpic generates a wrong code. */ if (flag_pic) { - warning ("-f%s ignored for 68HC11/68HC12 (not supported)", + warning (0, "-f%s ignored for 68HC11/68HC12 (not supported)", (flag_pic > 1) ? "PIC" : "pic"); flag_pic = 0; } @@ -303,13 +289,7 @@ m68hc11_override_options (void) /* Configure for a 68hc11 processor. */ if (TARGET_M6811) { - /* If gcc was built for a 68hc12, invalidate that because - a -m68hc11 option was specified on the command line. */ - if (TARGET_DEFAULT != MASK_M6811) - target_flags &= ~TARGET_DEFAULT; - - if (!TARGET_M6812) - target_flags &= ~(TARGET_AUTO_INC_DEC | TARGET_MIN_MAX); + target_flags &= ~(TARGET_AUTO_INC_DEC | TARGET_MIN_MAX); m68hc11_cost = &m6811_cost; m68hc11_min_offset = 0; m68hc11_max_offset = 256; @@ -322,8 +302,8 @@ m68hc11_override_options (void) m68hc11_tmp_regs_class = D_REGS; m68hc11_addr_mode = ADDR_OFFSET; m68hc11_mov_addr_mode = 0; - if (m68hc11_soft_reg_count == 0 && !TARGET_M6812) - m68hc11_soft_reg_count = "4"; + if (m68hc11_soft_reg_count < 0) + m68hc11_soft_reg_count = 4; } /* Configure for a 68hc12 processor. */ @@ -345,10 +325,9 @@ m68hc11_override_options (void) | (TARGET_AUTO_INC_DEC ? ADDR_INCDEC : 0); m68hc11_mov_addr_mode = ADDR_OFFSET | ADDR_CONST | (TARGET_AUTO_INC_DEC ? ADDR_INCDEC : 0); - target_flags &= ~MASK_M6811; target_flags |= MASK_NO_DIRECT_MODE; - if (m68hc11_soft_reg_count == 0) - m68hc11_soft_reg_count = "0"; + if (m68hc11_soft_reg_count < 0) + m68hc11_soft_reg_count = 0; if (TARGET_LONG_CALLS) current_function_far = 1; @@ -361,15 +340,11 @@ void m68hc11_conditional_register_usage (void) { int i; - int cnt = atoi (m68hc11_soft_reg_count); - if (cnt < 0) - cnt = 0; - if (cnt > SOFT_REG_LAST - SOFT_REG_FIRST) - cnt = SOFT_REG_LAST - SOFT_REG_FIRST; + if (m68hc11_soft_reg_count > SOFT_REG_LAST - SOFT_REG_FIRST) + m68hc11_soft_reg_count = SOFT_REG_LAST - SOFT_REG_FIRST; - nb_soft_regs = cnt; - for (i = SOFT_REG_FIRST + cnt; i < SOFT_REG_LAST; i++) + for (i = SOFT_REG_FIRST + m68hc11_soft_reg_count; i < SOFT_REG_LAST; i++) { fixed_regs[i] = 1; call_used_regs[i] = 1; @@ -420,10 +395,11 @@ hard_regno_mode_ok (int regno, enum machine_mode mode) switch (GET_MODE_SIZE (mode)) { case 8: - return S_REGNO_P (regno) && nb_soft_regs >= 4; + return S_REGNO_P (regno) && m68hc11_soft_reg_count >= 4; case 4: - return X_REGNO_P (regno) || (S_REGNO_P (regno) && nb_soft_regs >= 2); + return (X_REGNO_P (regno) + || (S_REGNO_P (regno) && m68hc11_soft_reg_count >= 2)); case 2: return G_REGNO_P (regno); @@ -576,8 +552,8 @@ preferred_reload_class (rtx operand, enum reg_class class) /* Return 1 if the operand is a valid indexed addressing mode. For 68hc11: n,r with n in [0..255] and r in A_REGS class For 68hc12: n,r no constraint on the constant, r in A_REGS class. */ -static int -register_indirect_p (rtx operand, enum machine_mode mode, int addr_mode) +int +m68hc11_valid_addressing_p (rtx operand, enum machine_mode mode, int addr_mode) { rtx base, offset; @@ -585,8 +561,8 @@ register_indirect_p (rtx operand, enum machine_mode mode, int addr_mode) { case MEM: if ((addr_mode & ADDR_INDIRECT) && GET_MODE_SIZE (mode) <= 2) - return register_indirect_p (XEXP (operand, 0), mode, - addr_mode & (ADDR_STRICT | ADDR_OFFSET)); + return m68hc11_valid_addressing_p (XEXP (operand, 0), mode, + addr_mode & (ADDR_STRICT | ADDR_OFFSET)); return 0; case POST_INC: @@ -594,8 +570,8 @@ register_indirect_p (rtx operand, enum machine_mode mode, int addr_mode) case POST_DEC: case PRE_DEC: if (addr_mode & ADDR_INCDEC) - return register_indirect_p (XEXP (operand, 0), mode, - addr_mode & ADDR_STRICT); + return m68hc11_valid_addressing_p (XEXP (operand, 0), mode, + addr_mode & ADDR_STRICT); return 0; case PLUS: @@ -691,7 +667,7 @@ m68hc11_small_indexed_indirect_p (rtx operand, enum machine_mode mode) return 1; addr_mode = m68hc11_mov_addr_mode | (reload_completed ? ADDR_STRICT : 0); - if (!register_indirect_p (operand, mode, addr_mode)) + if (!m68hc11_valid_addressing_p (operand, mode, addr_mode)) return 0; if (TARGET_M6812 && GET_CODE (operand) == PLUS @@ -746,7 +722,7 @@ m68hc11_register_indirect_p (rtx operand, enum machine_mode mode) operand = XEXP (operand, 0); addr_mode = m68hc11_addr_mode | (reload_completed ? ADDR_STRICT : 0); - return register_indirect_p (operand, mode, addr_mode); + return m68hc11_valid_addressing_p (operand, mode, addr_mode); } static int @@ -765,7 +741,7 @@ go_if_legitimate_address_internal (rtx operand, enum machine_mode mode, return 1; } addr_mode = m68hc11_addr_mode | (strict ? ADDR_STRICT : 0); - if (register_indirect_p (operand, mode, addr_mode)) + if (m68hc11_valid_addressing_p (operand, mode, addr_mode)) { return 1; } @@ -946,7 +922,7 @@ m68hc11_emit_libcall (const char *name, enum rtx_code code, break; default: - abort (); + gcc_unreachable (); } insns = get_insns (); @@ -957,7 +933,7 @@ m68hc11_emit_libcall (const char *name, enum rtx_code code, /* Returns true if X is a PRE/POST increment decrement (same as auto_inc_p() in rtlanal.c but do not take into account the stack). */ -static int +int m68hc11_auto_inc_p (rtx x) { return GET_CODE (x) == PRE_DEC @@ -980,81 +956,6 @@ memory_reload_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED) } int -tst_operand (rtx operand, enum machine_mode mode) -{ - if (GET_CODE (operand) == MEM && reload_completed == 0) - { - rtx addr = XEXP (operand, 0); - if (m68hc11_auto_inc_p (addr)) - return 0; - } - return nonimmediate_operand (operand, mode); -} - -int -cmp_operand (rtx operand, enum machine_mode mode) -{ - if (GET_CODE (operand) == MEM) - { - rtx addr = XEXP (operand, 0); - if (m68hc11_auto_inc_p (addr)) - return 0; - } - return general_operand (operand, mode); -} - -int -non_push_operand (rtx operand, enum machine_mode mode) -{ - if (general_operand (operand, mode) == 0) - return 0; - - if (push_operand (operand, mode) == 1) - return 0; - return 1; -} - -int -splitable_operand (rtx operand, enum machine_mode mode) -{ - if (general_operand (operand, mode) == 0) - return 0; - - if (push_operand (operand, mode) == 1) - return 0; - - /* Reject a (MEM (MEM X)) because the patterns that use non_push_operand - need to split such addresses to access the low and high part but it - is not possible to express a valid address for the low part. */ - if (mode != QImode && GET_CODE (operand) == MEM - && GET_CODE (XEXP (operand, 0)) == MEM) - return 0; - return 1; -} - -int -reg_or_some_mem_operand (rtx operand, enum machine_mode mode) -{ - if (GET_CODE (operand) == MEM) - { - rtx op = XEXP (operand, 0); - - if (symbolic_memory_operand (op, mode)) - return 1; - - if (IS_STACK_PUSH (operand)) - return 1; - - if (m68hc11_register_indirect_p (operand, mode)) - return 1; - - return 0; - } - - return register_operand (operand, mode); -} - -int m68hc11_symbolic_p (rtx operand, enum machine_mode mode) { if (GET_CODE (operand) == MEM) @@ -1086,62 +987,12 @@ m68hc11_indirect_p (rtx operand, enum machine_mode mode) operand = XEXP (operand, 0); addr_mode = m68hc11_addr_mode | (reload_completed ? ADDR_STRICT : 0); - return register_indirect_p (operand, mode, addr_mode); + return m68hc11_valid_addressing_p (operand, mode, addr_mode); } return 0; } int -stack_register_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return SP_REG_P (operand); -} - -int -d_register_operand (rtx operand, enum machine_mode mode) -{ - if (GET_MODE (operand) != mode && mode != VOIDmode) - return 0; - - if (GET_CODE (operand) == SUBREG) - operand = XEXP (operand, 0); - - return GET_CODE (operand) == REG - && (REGNO (operand) >= FIRST_PSEUDO_REGISTER - || REGNO (operand) == HARD_D_REGNUM - || (mode == QImode && REGNO (operand) == HARD_B_REGNUM)); -} - -int -hard_addr_reg_operand (rtx operand, enum machine_mode mode) -{ - if (GET_MODE (operand) != mode && mode != VOIDmode) - return 0; - - if (GET_CODE (operand) == SUBREG) - operand = XEXP (operand, 0); - - return GET_CODE (operand) == REG - && (REGNO (operand) == HARD_X_REGNUM - || REGNO (operand) == HARD_Y_REGNUM - || REGNO (operand) == HARD_Z_REGNUM); -} - -int -hard_reg_operand (rtx operand, enum machine_mode mode) -{ - if (GET_MODE (operand) != mode && mode != VOIDmode) - return 0; - - if (GET_CODE (operand) == SUBREG) - operand = XEXP (operand, 0); - - return GET_CODE (operand) == REG - && (REGNO (operand) >= FIRST_PSEUDO_REGISTER - || H_REGNO_P (REGNO (operand))); -} - -int memory_indexed_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED) { if (GET_CODE (operand) != MEM) @@ -1201,51 +1052,6 @@ symbolic_memory_operand (rtx op, enum machine_mode mode) return 0; } } - -int -m68hc11_eq_compare_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == EQ || GET_CODE (op) == NE; -} - -int -m68hc11_logical_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR; -} - -int -m68hc11_arith_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR - || GET_CODE (op) == PLUS || GET_CODE (op) == MINUS - || GET_CODE (op) == ASHIFT || GET_CODE (op) == ASHIFTRT - || GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ROTATE - || GET_CODE (op) == ROTATERT; -} - -int -m68hc11_non_shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR - || GET_CODE (op) == PLUS || GET_CODE (op) == MINUS; -} - -/* Return true if op is a shift operator. */ -int -m68hc11_shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == ROTATE || GET_CODE (op) == ROTATERT - || GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFT - || GET_CODE (op) == ASHIFTRT; -} - -int -m68hc11_unary_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == NEG || GET_CODE (op) == NOT - || GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND; -} /* Emit the code to build the trampoline used to call a nested function. @@ -1309,7 +1115,7 @@ m68hc11_handle_page0_attribute (tree *node, tree name, } else { - warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); + warning (0, "%qs attribute ignored", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1345,7 +1151,7 @@ m68hc11_handle_fntype_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -1430,13 +1236,13 @@ m68hc11_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) trap_handler = lookup_attribute ("trap", func_attr) != NULL_TREE; if (trap_handler && is_far) { - warning ("% and % attributes are not compatible, ignoring %"); + warning (0, "% and % attributes are not compatible, ignoring %"); trap_handler = 0; } if (trap_handler) { if (trap_handler_symbol != 0) - warning ("% attribute is already used"); + warning (0, "% attribute is already used"); else trap_handler_symbol = XEXP (rtl, 0); } @@ -1765,8 +1571,7 @@ expand_prologue (void) int regno; rtx scratch; - if (reload_completed != 1) - abort (); + gcc_assert (reload_completed == 1); size = get_frame_size (); @@ -1871,8 +1676,7 @@ expand_epilogue (void) int return_size; rtx scratch; - if (reload_completed != 1) - abort (); + gcc_assert (reload_completed == 1); size = get_frame_size (); @@ -2020,12 +1824,16 @@ m68hc11_gen_lowpart (enum machine_mode mode, rtx x) { l[0] = CONST_DOUBLE_LOW (x); } - if (mode == SImode) - return GEN_INT (l[0]); - else if (mode == HImode && GET_MODE (x) == SFmode) - return gen_int_mode (l[0], HImode); - else - abort (); + switch (mode) + { + case SImode: + return GEN_INT (l[0]); + case HImode: + gcc_assert (GET_MODE (x) == SFmode); + return gen_int_mode (l[0], HImode); + default: + gcc_unreachable (); + } } if (mode == QImode && D_REG_P (x)) @@ -2034,12 +1842,15 @@ m68hc11_gen_lowpart (enum machine_mode mode, rtx x) /* gen_lowpart crashes when it is called with a SUBREG. */ if (GET_CODE (x) == SUBREG && SUBREG_BYTE (x) != 0) { - if (mode == SImode) - return gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_BYTE (x) + 4); - else if (mode == HImode) - return gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_BYTE (x) + 2); - else - abort (); + switch (mode) + { + case SImode: + return gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_BYTE (x) + 4); + case HImode: + return gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_BYTE (x) + 2); + default: + gcc_unreachable (); + } } x = gen_lowpart (mode, x); @@ -2096,12 +1907,16 @@ m68hc11_gen_highpart (enum machine_mode mode, rtx x) l[1] = CONST_DOUBLE_HIGH (x); } - if (mode == SImode) - return GEN_INT (l[1]); - else if (mode == HImode && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT) - return gen_int_mode ((l[0] >> 16), HImode); - else - abort (); + switch (mode) + { + case SImode: + return GEN_INT (l[1]); + case HImode: + gcc_assert (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT); + return gen_int_mode ((l[0] >> 16), HImode); + default: + gcc_unreachable (); + } } if (GET_CODE (x) == CONST_INT) { @@ -2115,6 +1930,10 @@ m68hc11_gen_highpart (enum machine_mode mode, rtx x) { return gen_int_mode (val >> 16, HImode); } + else if (mode == SImode) + { + return gen_int_mode (val >> 32, SImode); + } } if (mode == QImode && D_REG_P (x)) return gen_rtx_REG (mode, HARD_A_REGNUM); @@ -2136,20 +1955,16 @@ m68hc11_gen_highpart (enum machine_mode mode, rtx x) } /* gen_highpart crashes when it is called with a SUBREG. */ - if (GET_CODE (x) == SUBREG) + switch (GET_CODE (x)) { + case SUBREG: return gen_rtx_SUBREG (mode, XEXP (x, 0), XEXP (x, 1)); - } - if (GET_CODE (x) == REG) - { + case REG: if (REGNO (x) < FIRST_PSEUDO_REGISTER) return gen_rtx_REG (mode, REGNO (x)); else return gen_rtx_SUBREG (mode, x, 0); - } - - if (GET_CODE (x) == MEM) - { + case MEM: x = change_address (x, mode, 0); /* Return a different rtx to avoid to share it in several insns @@ -2158,8 +1973,10 @@ m68hc11_gen_highpart (enum machine_mode mode, rtx x) if (GET_CODE (x) == MEM) x = copy_rtx (x); return x; + + default: + gcc_unreachable (); } - abort (); } @@ -2360,56 +2177,36 @@ print_operand (FILE *file, rtx op, int letter) switch (GET_CODE (base)) { case PRE_DEC: - if (TARGET_M6812) - { - fprintf (file, "%u,-", GET_MODE_SIZE (GET_MODE (op))); - asm_print_register (file, REGNO (XEXP (base, 0))); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,-", GET_MODE_SIZE (GET_MODE (op))); + asm_print_register (file, REGNO (XEXP (base, 0))); break; case POST_DEC: - if (TARGET_M6812) - { - fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (op))); - asm_print_register (file, REGNO (XEXP (base, 0))); - fprintf (file, "-"); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (op))); + asm_print_register (file, REGNO (XEXP (base, 0))); + fprintf (file, "-"); break; case POST_INC: - if (TARGET_M6812) - { - fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (op))); - asm_print_register (file, REGNO (XEXP (base, 0))); - fprintf (file, "+"); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (op))); + asm_print_register (file, REGNO (XEXP (base, 0))); + fprintf (file, "+"); break; case PRE_INC: - if (TARGET_M6812) - { - fprintf (file, "%u,+", GET_MODE_SIZE (GET_MODE (op))); - asm_print_register (file, REGNO (XEXP (base, 0))); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,+", GET_MODE_SIZE (GET_MODE (op))); + asm_print_register (file, REGNO (XEXP (base, 0))); break; case MEM: - if (TARGET_M6812) - { - fprintf (file, "["); - print_operand_address (file, XEXP (base, 0)); - fprintf (file, "]"); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "["); + print_operand_address (file, XEXP (base, 0)); + fprintf (file, "]"); break; default: @@ -2514,8 +2311,7 @@ print_operand_address (FILE *file, rtx addr) switch (GET_CODE (addr)) { case REG: - if (!REG_P (addr) || !REG_OK_FOR_BASE_STRICT_P (addr)) - abort (); + gcc_assert (REG_P (addr) && REG_OK_FOR_BASE_STRICT_P (addr)); fprintf (file, "0,"); asm_print_register (file, REGNO (addr)); @@ -2526,45 +2322,29 @@ print_operand_address (FILE *file, rtx addr) switch (GET_CODE (base)) { case PRE_DEC: - if (TARGET_M6812) - { - fprintf (file, "%u,-", GET_MODE_SIZE (GET_MODE (addr))); - asm_print_register (file, REGNO (XEXP (base, 0))); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,-", GET_MODE_SIZE (GET_MODE (addr))); + asm_print_register (file, REGNO (XEXP (base, 0))); break; case POST_DEC: - if (TARGET_M6812) - { - fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (addr))); - asm_print_register (file, REGNO (XEXP (base, 0))); - fprintf (file, "-"); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (addr))); + asm_print_register (file, REGNO (XEXP (base, 0))); + fprintf (file, "-"); break; case POST_INC: - if (TARGET_M6812) - { - fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (addr))); - asm_print_register (file, REGNO (XEXP (base, 0))); - fprintf (file, "+"); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,", GET_MODE_SIZE (GET_MODE (addr))); + asm_print_register (file, REGNO (XEXP (base, 0))); + fprintf (file, "+"); break; case PRE_INC: - if (TARGET_M6812) - { - fprintf (file, "%u,+", GET_MODE_SIZE (GET_MODE (addr))); - asm_print_register (file, REGNO (XEXP (base, 0))); - } - else - abort (); + gcc_assert (TARGET_M6812); + fprintf (file, "%u,+", GET_MODE_SIZE (GET_MODE (addr))); + asm_print_register (file, REGNO (XEXP (base, 0))); break; default: @@ -2587,10 +2367,11 @@ print_operand_address (FILE *file, rtx addr) base = XEXP (addr, 1); offset = XEXP (addr, 0); } - if ((CONSTANT_ADDRESS_P (base)) && (CONSTANT_ADDRESS_P (offset))) + if (CONSTANT_ADDRESS_P (base)) { need_parenthesis = must_parenthesize (addr); + gcc_assert (CONSTANT_ADDRESS_P (offset)); if (need_parenthesis) fprintf (file, "("); @@ -2600,18 +2381,15 @@ print_operand_address (FILE *file, rtx addr) if (need_parenthesis) fprintf (file, ")"); } - else if (REG_P (base) && REG_OK_FOR_BASE_STRICT_P (base)) + else { + gcc_assert (REG_P (base) && REG_OK_FOR_BASE_STRICT_P (base)); if (REG_P (offset)) { - if (TARGET_M6812) - { - asm_print_register (file, REGNO (offset)); - fprintf (file, ","); - asm_print_register (file, REGNO (base)); - } - else - abort (); + gcc_assert (TARGET_M6812); + asm_print_register (file, REGNO (offset)); + fprintf (file, ","); + asm_print_register (file, REGNO (base)); } else { @@ -2626,10 +2404,6 @@ print_operand_address (FILE *file, rtx addr) asm_print_register (file, REGNO (base)); } } - else - { - abort (); - } break; default: @@ -2660,14 +2434,10 @@ m68hc11_expand_compare (enum rtx_code code, rtx op0, rtx op1) { rtx ret = 0; - if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_FLOAT) - abort (); - else - { - emit_insn (gen_rtx_SET (VOIDmode, cc0_rtx, - gen_rtx_COMPARE (VOIDmode, op0, op1))); - ret = gen_rtx_fmt_ee (code, VOIDmode, cc0_rtx, const0_rtx); - } + gcc_assert (GET_MODE_CLASS (GET_MODE (op0)) != MODE_FLOAT); + emit_insn (gen_rtx_SET (VOIDmode, cc0_rtx, + gen_rtx_COMPARE (VOIDmode, op0, op1))); + ret = gen_rtx_fmt_ee (code, VOIDmode, cc0_rtx, const0_rtx); return ret; } @@ -2795,7 +2565,7 @@ m68hc11_expand_compare_and_branch (enum rtx_code code, rtx op0, rtx op1, break; default: - abort (); + gcc_unreachable (); } /* @@ -2818,7 +2588,7 @@ m68hc11_expand_compare_and_branch (enum rtx_code code, rtx op0, rtx op1, } default: - abort (); + gcc_unreachable (); } return 0; } @@ -3000,15 +2770,7 @@ m68hc11_split_move (rtx to, rtx from, rtx scratch) high_to = m68hc11_gen_highpart (mode, to); low_from = m68hc11_gen_lowpart (mode, from); - if (mode == SImode && GET_CODE (from) == CONST_INT) - { - if (INTVAL (from) >= 0) - high_from = const0_rtx; - else - high_from = constm1_rtx; - } - else - high_from = m68hc11_gen_highpart (mode, from); + high_from = m68hc11_gen_highpart (mode, from); if (offset) { @@ -3192,26 +2954,8 @@ m68hc11_split_logical (enum machine_mode mode, int code, rtx *operands) low[2] = m68hc11_gen_lowpart (mode, operands[2]); high[0] = m68hc11_gen_highpart (mode, operands[0]); - - if (mode == SImode && GET_CODE (operands[1]) == CONST_INT) - { - if (INTVAL (operands[1]) >= 0) - high[1] = const0_rtx; - else - high[1] = constm1_rtx; - } - else - high[1] = m68hc11_gen_highpart (mode, operands[1]); - - if (mode == SImode && GET_CODE (operands[2]) == CONST_INT) - { - if (INTVAL (operands[2]) >= 0) - high[2] = const0_rtx; - else - high[2] = constm1_rtx; - } - else - high[2] = m68hc11_gen_highpart (mode, operands[2]); + high[1] = m68hc11_gen_highpart (mode, operands[1]); + high[2] = m68hc11_gen_highpart (mode, operands[2]); low[3] = operands[3]; high[3] = operands[3]; @@ -3318,10 +3062,13 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) if (TARGET_M6812) { - if (IS_STACK_PUSH (operands[0]) && H_REG_P (operands[1])) + rtx from = operands[1]; + rtx to = operands[0]; + + if (IS_STACK_PUSH (to) && H_REG_P (from)) { cc_status = cc_prev_status; - switch (REGNO (operands[1])) + switch (REGNO (from)) { case HARD_X_REGNUM: case HARD_Y_REGNUM: @@ -3332,14 +3079,14 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) output_asm_insn ("sts\t2,-sp", operands); break; default: - abort (); + gcc_unreachable (); } return; } - if (IS_STACK_POP (operands[1]) && H_REG_P (operands[0])) + if (IS_STACK_POP (from) && H_REG_P (to)) { cc_status = cc_prev_status; - switch (REGNO (operands[0])) + switch (REGNO (to)) { case HARD_X_REGNUM: case HARD_Y_REGNUM: @@ -3347,7 +3094,7 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) output_asm_insn ("pul%0", operands); break; default: - abort (); + gcc_unreachable (); } return; } @@ -3370,11 +3117,52 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) else output_asm_insn ("st%1\t%0", operands); } + + /* The 68hc12 does not support (MEM:HI (MEM:HI)) with the movw + instruction. We have to use a scratch register as temporary location. + Trying to use a specific pattern or constrain failed. */ + else if (GET_CODE (to) == MEM && GET_CODE (XEXP (to, 0)) == MEM) + { + rtx ops[4]; + + ops[0] = to; + ops[2] = from; + ops[3] = 0; + if (dead_register_here (insn, d_reg)) + ops[1] = d_reg; + else if (dead_register_here (insn, ix_reg)) + ops[1] = ix_reg; + else if (dead_register_here (insn, iy_reg)) + ops[1] = iy_reg; + else + { + ops[1] = d_reg; + ops[3] = d_reg; + output_asm_insn ("psh%3", ops); + } + + ops[0] = to; + ops[2] = from; + output_asm_insn ("ld%1\t%2", ops); + output_asm_insn ("st%1\t%0", ops); + if (ops[3]) + output_asm_insn ("pul%3", ops); + } + + /* Use movw for non-null constants or when we are clearing + a volatile memory reference. However, this is possible + only if the memory reference has a small offset or is an + absolute address. */ + else if (GET_CODE (from) == CONST_INT + && INTVAL (from) == 0 + && (MEM_VOLATILE_P (to) == 0 + || m68hc11_small_indexed_indirect_p (to, HImode) == 0)) + { + output_asm_insn ("clr\t%h0", operands); + output_asm_insn ("clr\t%b0", operands); + } else { - rtx from = operands[1]; - rtx to = operands[0]; - if ((m68hc11_register_indirect_p (from, GET_MODE (from)) && !m68hc11_small_indexed_indirect_p (from, GET_MODE (from))) || (m68hc11_register_indirect_p (to, GET_MODE (to)) @@ -3391,6 +3179,7 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) ops[0] = to; ops[1] = operands[2]; m68hc11_gen_movhi (insn, ops); + return; } else { @@ -3398,19 +3187,11 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) fatal_insn ("move insn not handled", insn); } } - else - { - if (GET_CODE (from) == CONST_INT && INTVAL (from) == 0) - { - output_asm_insn ("clr\t%h0", operands); - output_asm_insn ("clr\t%b0", operands); - } - else - { - m68hc11_notice_keep_cc (operands[0]); - output_asm_insn ("movw\t%1,%0", operands); - } - } + else + { + m68hc11_notice_keep_cc (operands[0]); + output_asm_insn ("movw\t%1,%0", operands); + } } return; } @@ -3429,7 +3210,7 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) output_asm_insn ("pulb", operands); break; default: - abort (); + gcc_unreachable (); } return; } @@ -3653,7 +3434,7 @@ m68hc11_gen_movhi (rtx insn, rtx *operands) output_asm_insn ("psha", operands); break; default: - abort (); + gcc_unreachable (); } return; } @@ -3738,8 +3519,10 @@ m68hc11_gen_movqi (rtx insn, rtx *operands) } else if (H_REG_P (operands[0])) { - if (Q_REG_P (operands[0])) - output_asm_insn ("lda%0\t%b1", operands); + if (IS_STACK_POP (operands[1])) + output_asm_insn ("pul%b0", operands); + else if (Q_REG_P (operands[0])) + output_asm_insn ("lda%0\t%b1", operands); else if (D_REG_P (operands[0])) output_asm_insn ("ldab\t%b1", operands); else diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h index 2bd886326b0..bdbe31ef66f 100644 --- a/gcc/config/m68hc11/m68hc11.h +++ b/gcc/config/m68hc11/m68hc11.h @@ -1,6 +1,7 @@ /* Definitions of target machine for GNU compiler. Motorola 68HC11 and 68HC12. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr) This file is part of GCC. @@ -117,44 +118,14 @@ typedef int enum_machine_mode; /* Run-time compilation parameters selecting different hardware subsets. */ -extern int target_flags; - extern short *reg_renumber; /* def in local_alloc.c */ -/* Macros used in the machine description to test the flags. */ - -/* 6811 specific options - * - * For 68HC12, the auto inc/dec mode is disabled by default. The reason - * is that for most programs, the reload pass will fail because it needs - * more registers to save the value of the indexed register after the - * memory access. For simple programs, you can enable this - * with -mauto-incdec. - */ - -#define MASK_SHORT 0002 /* Compile with 16-bit `int' */ -#define MASK_AUTO_INC_DEC 0004 -#define MASK_M6811 0010 -#define MASK_M6812 0020 -#define MASK_M68S12 0040 -#define MASK_NO_DIRECT_MODE 0100 -#define MASK_MIN_MAX 0200 -#define MASK_LONG_CALLS 0400 - #define TARGET_OP_TIME (optimize && optimize_size == 0) -#define TARGET_SHORT (target_flags & MASK_SHORT) -#define TARGET_M6811 (target_flags & MASK_M6811) -#define TARGET_M6812 (target_flags & MASK_M6812) -#define TARGET_M68S12 (target_flags & MASK_M68S12) -#define TARGET_AUTO_INC_DEC (target_flags & MASK_AUTO_INC_DEC) -#define TARGET_MIN_MAX (target_flags & MASK_MIN_MAX) -#define TARGET_NO_DIRECT_MODE (target_flags & MASK_NO_DIRECT_MODE) #define TARGET_RELAX (TARGET_NO_DIRECT_MODE) -#define TARGET_LONG_CALLS (target_flags & MASK_LONG_CALLS) /* Default target_flags if no switches specified. */ #ifndef TARGET_DEFAULT -# define TARGET_DEFAULT (MASK_M6811) +# define TARGET_DEFAULT 0 #endif /* Define this macro as a C expression for the initializer of an @@ -169,75 +140,6 @@ extern short *reg_renumber; /* def in local_alloc.c */ # endif #endif -/* Macro to define tables used to set the flags. This is a list in braces of - pairs in braces, each pair being { "NAME", VALUE } where VALUE is the bits - to set or minus the bits to clear. An empty string NAME is used to - identify the default VALUE. */ - -#define TARGET_SWITCHES \ -{ { "short", MASK_SHORT, \ - N_("Compile with 16-bit integer mode")}, \ - { "noshort", - MASK_SHORT, \ - N_("Compile with 32-bit integer mode")}, \ - { "auto-incdec", MASK_AUTO_INC_DEC, \ - N_("Auto pre/post decrement increment allowed")}, \ - { "noauto-incdec", - MASK_AUTO_INC_DEC, \ - N_("Auto pre/post decrement increment not allowed")}, \ - { "inmax", MASK_MIN_MAX, \ - N_("Min/max instructions allowed")}, \ - { "nominmax", - MASK_MIN_MAX, \ - N_("Min/max instructions not allowed")}, \ - { "long-calls", MASK_LONG_CALLS, \ - N_("Use call and rtc for function calls and returns")}, \ - { "nolong-calls", - MASK_LONG_CALLS, \ - N_("Use jsr and rts for function calls and returns")}, \ - { "relax", MASK_NO_DIRECT_MODE, \ - N_("Do not use direct addressing mode for soft registers")},\ - { "norelax", -MASK_NO_DIRECT_MODE, \ - N_("Use direct addressing mode for soft registers")}, \ - { "68hc11", MASK_M6811, \ - N_("Compile for a 68HC11")}, \ - { "68hc12", MASK_M6812, \ - N_("Compile for a 68HC12")}, \ - { "68hcs12", MASK_M6812 | MASK_M68S12, \ - N_("Compile for a 68HCS12")}, \ - { "6811", MASK_M6811, \ - N_("Compile for a 68HC11")}, \ - { "6812", MASK_M6812, \ - N_("Compile for a 68HC12")}, \ - { "68S12", MASK_M6812 | MASK_M68S12, \ - N_("Compile for a 68HCS12")}, \ - { "", TARGET_DEFAULT, 0 }} - -/* This macro is similar to `TARGET_SWITCHES' but defines names of - command options that have values. Its definition is an - initializer with a subgrouping for each command option. - - Each subgrouping contains a string constant, that defines the - fixed part of the option name, and the address of a variable. The - variable, type `char *', is set to the variable part of the given - option if the fixed part matches. The actual option name is made - by appending `-m' to the specified name. */ -#define TARGET_OPTIONS \ -{ { "reg-alloc=", &m68hc11_reg_alloc_order, \ - N_("Specify the register allocation order"), 0}, \ - { "soft-reg-count=", &m68hc11_soft_reg_count, \ - N_("Indicate the number of soft registers available"), 0}, \ - SUBTARGET_OPTIONS \ -} - -/* These are meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES -#define SUBTARGET_OPTIONS - -extern const char *m68hc11_regparm_string; -extern const char *m68hc11_reg_alloc_order; -extern const char *m68hc11_soft_reg_count; - -#ifndef TARGET_M68HC12 -# define TARGET_M68HC11 1 -#endif - /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (MC68HC11/MC68HC12/MC68HCS12)") @@ -387,7 +289,7 @@ extern const struct processor_costs *m68hc11_cost; /* The Z register does not really exist in the 68HC11. This a fake register for GCC. It is treated exactly as an index register (X or Y). It is only in the A_REGS class, which is the BASE_REG_CLASS for GCC. Defining this - register helps the reload pass of GCC. Otherwise, the reload often aborts + register helps the reload pass of GCC. Otherwise, the reload often dies with register spill failures. The Z register is replaced by either X or Y during the machine specific @@ -1135,6 +1037,13 @@ typedef struct m68hc11_args /* Addressing modes, and classification of registers for them. */ +#define ADDR_STRICT 0x01 /* Accept only registers in class A_REGS */ +#define ADDR_INCDEC 0x02 /* Post/Pre inc/dec */ +#define ADDR_INDEXED 0x04 /* D-reg index */ +#define ADDR_OFFSET 0x08 +#define ADDR_INDIRECT 0x10 /* Accept (mem (mem ...)) for [n,X] */ +#define ADDR_CONST 0x20 /* Accept const and symbol_ref */ + /* The 68HC12 has all the post/pre increment/decrement modes. */ #define HAVE_POST_INCREMENT (TARGET_M6812 && TARGET_AUTO_INC_DEC) #define HAVE_PRE_INCREMENT (TARGET_M6812 && TARGET_AUTO_INC_DEC) @@ -1160,7 +1069,7 @@ extern enum reg_class m68hc11_index_reg_class; /* Internal macro, return 1 if REGNO is a valid base register. */ -#define REG_VALID_P(REGNO) (1) /* ? */ +#define REG_VALID_P(REGNO) ((REGNO) >= 0) extern unsigned char m68hc11_reg_valid_for_base[FIRST_PSEUDO_REGISTER]; #define REG_VALID_FOR_BASE_P(REGNO) \ @@ -1589,27 +1498,6 @@ do { \ /* Miscellaneous Parameters. */ -/* Define the codes that are matched by predicates in m68hc11.c. */ -#define PREDICATE_CODES \ -{"stack_register_operand", {SUBREG, REG}}, \ -{"d_register_operand", {SUBREG, REG}}, \ -{"hard_addr_reg_operand", {SUBREG, REG}}, \ -{"hard_reg_operand", {SUBREG, REG}}, \ -{"m68hc11_logical_operator", {AND, IOR, XOR}}, \ -{"m68hc11_arith_operator", {AND, IOR, XOR, PLUS, MINUS, \ - ASHIFT, ASHIFTRT, LSHIFTRT, \ - ROTATE, ROTATERT }}, \ -{"m68hc11_non_shift_operator", {AND, IOR, XOR, PLUS, MINUS}}, \ -{"m68hc11_unary_operator", {NEG, NOT, SIGN_EXTEND, ZERO_EXTEND}}, \ -{"m68hc11_shift_operator", {ASHIFT, ASHIFTRT, LSHIFTRT, ROTATE, ROTATERT}},\ -{"m68hc11_eq_compare_operator", {EQ, NE}}, \ -{"non_push_operand", {SUBREG, REG, MEM}}, \ -{"splitable_operand", {SUBREG, REG, MEM}}, \ -{"reg_or_some_mem_operand", {SUBREG, REG, MEM}}, \ -{"tst_operand", {SUBREG, REG, MEM}}, \ -{"cmp_operand", {SUBREG, REG, MEM, SYMBOL_REF, LABEL_REF, \ - CONST_INT, CONST_DOUBLE}}, - /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE Pmode diff --git a/gcc/config/m68hc11/m68hc11.md b/gcc/config/m68hc11/m68hc11.md index 4ef5cd7b5a1..c60dd29198e 100644 --- a/gcc/config/m68hc11/m68hc11.md +++ b/gcc/config/m68hc11/m68hc11.md @@ -1,5 +1,5 @@ ;;- Machine description file for Motorola 68HC11 and 68HC12. -;;- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +;;- Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 ;;- Free Software Foundation, Inc. ;;- Contributed by Stephane Carrez (stcarrez@nerim.fr) @@ -149,6 +149,8 @@ (SOFT_XY_REGNUM 12) ; XY soft register ]) +(include "predicates.md") + ;;-------------------------------------------------------------------- ;;- Test ;;-------------------------------------------------------------------- @@ -687,8 +689,8 @@ DONE;") (define_insn_and_split "movdf_internal" - [(set (match_operand:DF 0 "non_push_operand" "=mu,U,!u,U,m,m,!u") - (match_operand:DF 1 "general_operand" "G,iU,iU,!u,mi,!u,!mu")) + [(set (match_operand:DF 0 "non_push_operand" "=mu,U,m,!u,U,m,!u") + (match_operand:DF 1 "general_operand" "G,iU,mi,iU,!u,!u,!mu")) (clobber (match_scratch:HI 2 "=X,&d,&d,&d,&d,&d,&d"))] "" "#" @@ -884,18 +886,9 @@ } }") -(define_insn "movhi_const0" - [(set (match_operand:HI 0 "splitable_operand" "=d,A,um") - (const_int 0))] - "" - "@ - clra\\n\\tclrb - ld%0\\t#0 - clr\\t%b0\\n\\tclr\\t%h0") - (define_insn "*movhi_68hc12" - [(set (match_operand:HI 0 "nonimmediate_operand" "=U,dAw,dAw,U,U,m,!u") - (match_operand:HI 1 "general_operand" "U,dAwim,!u,dAwi,!u,dAw,riU"))] + [(set (match_operand:HI 0 "nonimmediate_operand" "=U,dAw,dAw,m,U,U,m,!u") + (match_operand:HI 1 "general_operand" "U,dAwim,!u,K,dAwi,!u,dAw,riU"))] "TARGET_M6812" "* { @@ -903,6 +896,15 @@ return \"\"; }") +(define_insn "movhi_const0" + [(set (match_operand:HI 0 "nonimmediate_operand" "=d,A,um") + (const_int 0))] + "TARGET_M6811" + "@ + clra\\n\\tclrb + ld%0\\t#0 + clr\\t%b0\\n\\tclr\\t%h0") + (define_insn "*movhi_m68hc11" [(set (match_operand:HI 0 "nonimmediate_operand" "=dAw,!u,m,m,dAw,!*u") (match_operand:HI 1 "general_operand" "dAwim,dAw,dA,?Aw,!*u,dAw"))] @@ -1235,7 +1237,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,m,!u,!u") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "m,Du,m,Du"))) - (clobber (match_scratch:HI 2 "=d,d,&d,d"))] + (clobber (match_scratch:HI 2 "=d,d,d,d"))] "" "#") @@ -2380,7 +2382,7 @@ [(set (match_operand:HI 0 "hard_reg_operand" "=A,d") (plus:HI (zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "d,um*A")) - (match_operand:HI 2 "hard_reg_operand" "0,0")))] + (match_operand:HI 2 "general_operand" "0,0")))] "" "* { @@ -2714,7 +2716,7 @@ (define_insn "*subhi3" [(set (match_operand:HI 0 "register_operand" "=d,*A,d,*A") - (minus:HI (match_operand:HI 1 "register_operand" "0,0,0,0") + (minus:HI (match_operand:HI 1 "general_operand" "0,0,0,0") (match_operand:HI 2 "general_operand" "im*A*d,im*d*A,u,!u")))] "" "* @@ -2729,7 +2731,7 @@ (define_insn "*subhi3_zext" [(set (match_operand:HI 0 "hard_reg_operand" "=d,d") - (minus:HI (match_operand:HI 1 "hard_reg_operand" "0,0") + (minus:HI (match_operand:HI 1 "general_operand" "0,0") (zero_extend:HI (match_operand:QI 2 "general_operand" "mi*A,!u"))))] "" "* @@ -2749,7 +2751,7 @@ (define_insn "subqi3" [(set (match_operand:QI 0 "hard_reg_operand" "=dq,!*x*y") - (minus:QI (match_operand:QI 1 "hard_reg_operand" "0,0") + (minus:QI (match_operand:QI 1 "general_operand" "0,0") (match_operand:QI 2 "general_operand" "uim*A*d,uim*A*d")))] "" "* @@ -2902,8 +2904,8 @@ (define_insn "mulqi3" [(set (match_operand:QI 0 "register_operand" "=d,*x,*y") - (mult:QI (match_operand:QI 1 "nonimmediate_operand" "%dum,0,0") - (match_operand:QI 2 "general_operand" "dium,*xium,*yium")))] + (mult:QI (match_operand:QI 1 "general_operand" "%di*um,0,0") + (match_operand:QI 2 "general_operand" "di*um,*xium,*yium")))] "" "* { @@ -2958,11 +2960,11 @@ ") (define_insn "mulqihi3" - [(set (match_operand:HI 0 "register_operand" "=d,d") + [(set (match_operand:HI 0 "register_operand" "=d,d,d") (mult:HI (sign_extend:HI - (match_operand:QI 1 "register_operand" "%0,0")) + (match_operand:QI 1 "register_operand" "%0,0,0")) (sign_extend:HI - (match_operand:QI 2 "nonimmediate_operand" "dm,*A"))))] + (match_operand:QI 2 "general_operand" "mi*u,*A,0"))))] "" "* { @@ -3324,8 +3326,8 @@ (define_insn "*andqi3_gen" [(set (match_operand:QI 0 "register_operand" "=d,d,d,?*A,?*A,!*q") - (and:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0") - (match_operand:QI 2 "general_operand" "mi,!u,?*A,!um,?*A*d,!um*A")))] + (and:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0") + (match_operand:QI 2 "general_operand" "mi,!*u,?*A,!*um,?*A*d,!*um*A")))] "" "* { @@ -3542,8 +3544,8 @@ (define_insn "*iorqi3_gen" [(set (match_operand:QI 0 "register_operand" "=d,d,d,?*A,?*A,!*q") - (ior:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0") - (match_operand:QI 2 "general_operand" "mi,!u,!*A,!um,?*A*d,!um*A")))] + (ior:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0") + (match_operand:QI 2 "general_operand" "mi,!*u,!*A,!*um,?*A*d,!*um*A")))] "" "* { @@ -3634,8 +3636,8 @@ (define_insn "xorqi3" [(set (match_operand:QI 0 "register_operand" "=d,d,d,?*A,?*A,!*q") - (xor:QI (match_operand:QI 1 "register_operand" "%0,0,0,0,0,0") - (match_operand:QI 2 "general_operand" "im,!u,!*A,!ium,?*A*d,!ium*A")))] + (xor:QI (match_operand:QI 1 "general_operand" "%0,0,0,0,0,0") + (match_operand:QI 2 "general_operand" "im,!*u,!*A,!i*um,?*A*d,!i*um*A")))] "" "* { @@ -6912,14 +6914,16 @@ ;; ;; Replace "leas 2,sp" with a "pulx" or a "puly". ;; On 68HC12, this is one cycle slower but one byte smaller. -;; pr target/6899: This peephole is not valid because a register CSE -;; pass removes the pulx/puly. +;; pr target/6899: This peephole was not valid because a register CSE +;; pass removes the pulx/puly. The 'use' clause ensure that the pulx is +;; not removed. ;; (define_peephole2 [(set (reg:HI SP_REGNUM) (plus:HI (reg:HI SP_REGNUM) (const_int 2))) (match_scratch:HI 0 "xy")] - "0 && TARGET_M6812 && optimize_size" - [(set (match_dup 0) (match_dup 1))] + "TARGET_M6812 && optimize_size" + [(set (match_dup 0) (match_dup 1)) + (use (match_dup 0))] "operands[1] = gen_rtx_MEM (HImode, gen_rtx_POST_INC (HImode, gen_rtx_REG (HImode, HARD_SP_REGNUM)));") @@ -6927,7 +6931,7 @@ ;; Replace: "pshx; tfr d,x; stx 0,sp" into "pshd; tfr d,x" ;; ;; PR 14542: emit a use to pretend we need the value of initial register. -;; Otherwise verify_local_live_at_start will abort due to a live change +;; Otherwise verify_local_live_at_start will die due to a live change ;; of that register. ;; (define_peephole2 diff --git a/gcc/config/m68hc11/m68hc11.opt b/gcc/config/m68hc11/m68hc11.opt new file mode 100644 index 00000000000..41748f102f3 --- /dev/null +++ b/gcc/config/m68hc11/m68hc11.opt @@ -0,0 +1,95 @@ +; Options for the Motorola 68HC11 and 68HC12 port of the compiler. + +; Copyright (C) 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. + +m6811 +Target RejectNegative InverseMask(M6812, M6811) +Compile for a 68HC11 + +m6812 +Target RejectNegative Mask(M6812) +Compile for a 68HC12 + +m68hc11 +Target RejectNegative InverseMask(M6812) +Compile for a 68HC11 + +m68hc12 +Target RejectNegative Mask(M6812) MaskExists +Compile for a 68HC12 + +; At the moment, there is no difference between the code generated +; for -m68hc12 and -m68hcs12. +m68hcs12 +Target RejectNegative Mask(M6812) MaskExists +Compile for a 68HCS12 + +m68s12 +Target RejectNegative Mask(M6812) MaskExists +Compile for a 68HCS12 + +mauto-incdec +Target RejectNegative Report Mask(AUTO_INC_DEC) +Auto pre/post decrement increment allowed + +minmax +Target RejectNegative Report Mask(MIN_MAX) +Min/max instructions allowed + +mlong-calls +Target RejectNegative Report Mask(LONG_CALLS) +Use call and rtc for function calls and returns + +mnoauto-incdec +Target RejectNegative Report InverseMask(AUTO_INC_DEC) +Auto pre/post decrement increment not allowed + +mnolong-calls +Target RejectNegative Report InverseMask(LONG_CALLS) +Use jsr and rts for function calls and returns + +mnominmax +Target RejectNegative Report InverseMask(MIN_MAX) +Min/max instructions not allowed + +mnorelax +Target RejectNegative Report InverseMask(NO_DIRECT_MODE) +Use direct addressing mode for soft registers + +mnoshort +Target RejectNegative Report InverseMask(SHORT) +Compile with 32-bit integer mode + +; Currently ignored. +mreg-alloc= +Target RejectNegative Joined +Specify the register allocation order + +mrelax +Target RejectNegative Report Mask(NO_DIRECT_MODE) +Do not use direct addressing mode for soft registers + +mshort +Target RejectNegative Report Mask(SHORT) +Compile with 16-bit integer mode + +msoft-reg-count= +Target RejectNegative Joined UInteger Var(m68hc11_soft_reg_count) Init(-1) +Indicate the number of soft registers available diff --git a/gcc/config/m68hc11/m68hc12.h b/gcc/config/m68hc11/m68hc12.h index 20b4be5c322..eddad29eff6 100644 --- a/gcc/config/m68hc11/m68hc12.h +++ b/gcc/config/m68hc11/m68hc12.h @@ -44,5 +44,3 @@ Boston, MA 02111-1307, USA. */ /* Default target_flags if no switches specified. */ #define TARGET_DEFAULT (MASK_M6812) - -#define TARGET_M68HC12 diff --git a/gcc/config/m68hc11/predicates.md b/gcc/config/m68hc11/predicates.md new file mode 100644 index 00000000000..49e3edd4582 --- /dev/null +++ b/gcc/config/m68hc11/predicates.md @@ -0,0 +1,229 @@ +;; Predicate definitions for Motorola 68HC11 and 68HC12. +;; Copyright (C) 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. + +;; TODO: Add a comment here. + +(define_predicate "stack_register_operand" + (match_code "subreg,reg") +{ + return SP_REG_P (op); +}) + +;; TODO: Add a comment here. + +(define_predicate "d_register_operand" + (match_code "subreg,reg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = XEXP (op, 0); + + return GET_CODE (op) == REG + && (REGNO (op) >= FIRST_PSEUDO_REGISTER + || REGNO (op) == HARD_D_REGNUM + || (mode == QImode && REGNO (op) == HARD_B_REGNUM)); +}) + +;; TODO: Add a comment here. + +(define_predicate "hard_addr_reg_operand" + (match_code "subreg,reg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = XEXP (op, 0); + + return GET_CODE (op) == REG + && (REGNO (op) == HARD_X_REGNUM + || REGNO (op) == HARD_Y_REGNUM + || REGNO (op) == HARD_Z_REGNUM); +}) + +;; TODO: Add a comment here. + +(define_predicate "hard_reg_operand" + (match_code "subreg,reg") +{ + if (GET_MODE (op) != mode && mode != VOIDmode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = XEXP (op, 0); + + return GET_CODE (op) == REG + && (REGNO (op) >= FIRST_PSEUDO_REGISTER + || H_REGNO_P (REGNO (op))); +}) + +;; TODO: Add a comment here. + +(define_predicate "m68hc11_logical_operator" + (match_code "and,ior,xor") +{ + return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR; +}) + +;; TODO: Add a comment here. + +(define_predicate "m68hc11_arith_operator" + (match_code "and,ior,xor,plus,minus,ashift,ashiftrt,lshiftrt,rotate,rotatert") +{ + return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR + || GET_CODE (op) == PLUS || GET_CODE (op) == MINUS + || GET_CODE (op) == ASHIFT || GET_CODE (op) == ASHIFTRT + || GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ROTATE + || GET_CODE (op) == ROTATERT; +}) + +;; TODO: Add a comment here. + +(define_predicate "m68hc11_non_shift_operator" + (match_code "and,ior,xor,plus,minus") +{ + return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR + || GET_CODE (op) == PLUS || GET_CODE (op) == MINUS; +}) + +;; TODO: Add a comment here. + +(define_predicate "m68hc11_unary_operator" + (match_code "neg,not,sign_extend,zero_extend") +{ + return GET_CODE (op) == NEG || GET_CODE (op) == NOT + || GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND; +}) + +;; Return true if op is a shift operator. + +(define_predicate "m68hc11_shift_operator" + (match_code "ashift,ashiftrt,lshiftrt,rotate,rotatert") +{ + return GET_CODE (op) == ROTATE || GET_CODE (op) == ROTATERT + || GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFT + || GET_CODE (op) == ASHIFTRT; +}) + +;; TODO: Add a comment here. + +(define_predicate "m68hc11_eq_compare_operator" + (match_code "eq,ne") +{ + return GET_CODE (op) == EQ || GET_CODE (op) == NE; +}) + +;; TODO: Add a comment here. + +(define_predicate "non_push_operand" + (match_code "subreg,reg,mem") +{ + if (general_operand (op, mode) == 0) + return 0; + + if (push_operand (op, mode) == 1) + return 0; + return 1; +}) + +;; TODO: Add a comment here. + +(define_predicate "splitable_operand" + (match_code "subreg,reg,mem,symbol_ref,label_ref,const_int,const_double") +{ + if (general_operand (op, mode) == 0) + return 0; + + if (push_operand (op, mode) == 1) + return 0; + + /* Reject a (MEM (MEM X)) because the patterns that use non_push_operand + need to split such addresses to access the low and high part but it + is not possible to express a valid address for the low part. */ + if (mode != QImode && GET_CODE (op) == MEM + && GET_CODE (XEXP (op, 0)) == MEM) + return 0; + return 1; +}) + +;; TODO: Add a comment here. + +(define_predicate "reg_or_some_mem_operand" + (match_code "subreg,reg,mem") +{ + if (GET_CODE (op) == MEM) + { + rtx op0 = XEXP (op, 0); + int addr_mode; + + if (symbolic_memory_operand (op0, mode)) + return 1; + + if (IS_STACK_PUSH (op)) + return 1; + + if (GET_CODE (op) == REG && reload_in_progress + && REGNO (op) >= FIRST_PSEUDO_REGISTER + && reg_equiv_memory_loc[REGNO (op)]) + { + op = reg_equiv_memory_loc[REGNO (op)]; + op = eliminate_regs (op, 0, NULL_RTX); + } + if (GET_CODE (op) != MEM) + return 0; + + op0 = XEXP (op, 0); + addr_mode = m68hc11_addr_mode | (reload_completed ? ADDR_STRICT : 0); + addr_mode &= ~ADDR_INDIRECT; + return m68hc11_valid_addressing_p (op0, mode, addr_mode); + } + + return register_operand (op, mode); +}) + +;; TODO: Add a comment here. + +(define_predicate "tst_operand" + (match_code "subreg,reg,mem") +{ + if (GET_CODE (op) == MEM && reload_completed == 0) + { + rtx addr = XEXP (op, 0); + if (m68hc11_auto_inc_p (addr)) + return 0; + } + return nonimmediate_operand (op, mode); +}) + +;; TODO: Add a comment here. + +(define_predicate "cmp_operand" + (match_code "subreg,reg,mem,symbol_ref,label_ref,const_int,const_double") +{ + if (GET_CODE (op) == MEM) + { + rtx addr = XEXP (op, 0); + if (m68hc11_auto_inc_p (addr)) + return 0; + } + return general_operand (op, mode); +}) diff --git a/gcc/config/m68k/ieee.opt b/gcc/config/m68k/ieee.opt new file mode 100644 index 00000000000..df774fae7a6 --- /dev/null +++ b/gcc/config/m68k/ieee.opt @@ -0,0 +1,25 @@ +; Extra IEEE options for the Motorola 68000 port of the compiler. + +; Copyright (C) 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. + +; This option is ignored by gcc +mieee-fp +Target RejectNegative +Use IEEE math for fp comparisons diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index a5859a1d672..5c5564cdf2b 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -37,10 +37,6 @@ Boston, MA 02111-1307, USA. */ #undef STRICT_ALIGNMENT #define STRICT_ALIGNMENT 0 -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES {"ieee-fp", 0, \ - N_("Use IEEE math for fp comparisons")}, - /* Here are four prefixes that are used by asm_fprintf to facilitate customization for alternate assembler syntaxes. Machines with no likelihood of an alternate syntax need not diff --git a/gcc/config/m68k/m68k-protos.h b/gcc/config/m68k/m68k-protos.h index 4b66927d239..0fe321fb855 100644 --- a/gcc/config/m68k/m68k-protos.h +++ b/gcc/config/m68k/m68k-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Sun 68000/68020 version. - Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -50,6 +50,7 @@ extern void print_operand_address (FILE *, rtx); extern void print_operand (FILE *, rtx, int); extern void notice_update_cc (rtx, rtx); extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx); +extern int valid_dbcc_comparison_p_2 (rtx, enum machine_mode); #endif /* RTX_CODE */ diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 7e24c2557ee..e456317fb1d 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -103,6 +103,7 @@ struct m68k_frame /* Current frame information calculated by m68k_compute_frame_layout(). */ static struct m68k_frame current_frame; +static bool m68k_handle_option (size_t, const char *, int); static rtx find_addr_reg (rtx); static const char *singlemove_string (rtx *); static void m68k_output_function_prologue (FILE *, HOST_WIDE_INT); @@ -124,7 +125,7 @@ static bool m68k_rtx_costs (rtx, int, int, int *); /* Specify the identification number of the library being built */ -const char *m68k_library_id_string; +const char *m68k_library_id_string = "_current_shared_library_a5_offset_"; /* Nonzero if the last compare/test insn had FP operands. The sCC expanders peek at this to determine what to do for the @@ -174,6 +175,11 @@ int m68k_last_compare_had_fp_operands; #undef TARGET_ASM_FILE_START_APP_OFF #define TARGET_ASM_FILE_START_APP_OFF true +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_STRICT_ALIGNMENT) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION m68k_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS m68k_rtx_costs @@ -195,6 +201,107 @@ static const struct attribute_spec m68k_attribute_table[] = struct gcc_target targetm = TARGET_INITIALIZER; +/* These bits are controlled by all CPU selection options. Many options + also control MASK_68881, but some (notably -m68020) leave it alone. */ + +#define MASK_ALL_CPU_BITS \ + (MASK_COLDFIRE | MASK_CF_HWDIV | MASK_68060 | MASK_68040 \ + | MASK_68040_ONLY | MASK_68030 | MASK_68020 | MASK_BITFIELD) + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +m68k_handle_option (size_t code, const char *arg, int value) +{ + switch (code) + { + case OPT_m5200: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + target_flags |= MASK_5200; + return true; + + case OPT_m5206e: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + target_flags |= MASK_5200 | MASK_CF_HWDIV; + return true; + + case OPT_m528x: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + target_flags |= MASK_528x | MASK_CF_HWDIV; + return true; + + case OPT_m5307: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + target_flags |= MASK_CFV3 | MASK_CF_HWDIV; + return true; + + case OPT_m5407: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + target_flags |= MASK_CFV4 | MASK_CF_HWDIV; + return true; + + case OPT_m68000: + case OPT_mc68000: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + return true; + + case OPT_m68020: + case OPT_mc68020: + target_flags &= ~MASK_ALL_CPU_BITS; + target_flags |= MASK_68020 | MASK_BITFIELD; + return true; + + case OPT_m68020_40: + target_flags &= ~MASK_ALL_CPU_BITS; + target_flags |= MASK_BITFIELD | MASK_68881 | MASK_68020 | MASK_68040; + return true; + + case OPT_m68020_60: + target_flags &= ~MASK_ALL_CPU_BITS; + target_flags |= (MASK_BITFIELD | MASK_68881 | MASK_68020 + | MASK_68040 | MASK_68060); + return true; + + case OPT_m68030: + target_flags &= ~MASK_ALL_CPU_BITS; + target_flags |= MASK_68020 | MASK_68030 | MASK_BITFIELD; + return true; + + case OPT_m68040: + target_flags &= ~MASK_ALL_CPU_BITS; + target_flags |= (MASK_68020 | MASK_68881 | MASK_BITFIELD + | MASK_68040_ONLY | MASK_68040); + return true; + + case OPT_m68060: + target_flags &= ~MASK_ALL_CPU_BITS; + target_flags |= (MASK_68020 | MASK_68881 | MASK_BITFIELD + | MASK_68040_ONLY | MASK_68060); + return true; + + case OPT_m68302: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + return true; + + case OPT_m68332: + case OPT_mcpu32: + target_flags &= ~(MASK_ALL_CPU_BITS | MASK_68881); + target_flags |= MASK_68020; + return true; + + case OPT_mshared_library_id_: + if (value > MAX_LIBRARY_ID) + error ("-mshared-library-id=%s is not between 0 and %d", + arg, MAX_LIBRARY_ID); + else + asprintf ((char **) &m68k_library_id_string, "%d", (value * -4) - 4); + return true; + + default: + return true; + } +} + /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -207,25 +314,6 @@ struct gcc_target targetm = TARGET_INITIALIZER; void override_options (void) { - /* Library identification */ - if (m68k_library_id_string) - { - int id; - - if (! TARGET_ID_SHARED_LIBRARY) - error ("-mshared-library-id= specified without -mid-shared-library"); - id = atoi (m68k_library_id_string); - if (id < 0 || id > MAX_LIBRARY_ID) - error ("-mshared-library-id=%d is not between 0 and %d", id, MAX_LIBRARY_ID); - - /* From now on, m68k_library_id_string will contain the library offset. */ - asprintf ((char **)&m68k_library_id_string, "%d", (id * -4) - 4); - } - else - /* If TARGET_ID_SHARED_LIBRARY is enabled, this will point to the - current library. */ - m68k_library_id_string = "_current_shared_library_a5_offset_"; - /* Sanity check to ensure that msep-data and mid-sahred-library are not * both specified together. Doing so simply doesn't make sense. */ @@ -285,7 +373,7 @@ m68k_handle_fndecl_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -354,12 +442,17 @@ m68k_initial_elimination_offset (int from, int to) m68k_compute_frame_layout (); - if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) - return current_frame.offset + current_frame.size + (frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD); - else if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) - return current_frame.offset + current_frame.size; - - abort(); + gcc_assert (to == STACK_POINTER_REGNUM); + switch (from) + { + case ARG_POINTER_REGNUM: + return current_frame.offset + current_frame.size + + (frame_pointer_needed ? -UNITS_PER_WORD * 2 : -UNITS_PER_WORD); + case FRAME_POINTER_REGNUM: + return current_frame.offset + current_frame.size; + default: + gcc_unreachable (); + } } /* Refer to the array `regs_ever_live' to determine which registers @@ -544,7 +637,7 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED asm_fprintf (stream, "\tcmp" ASM_DOT "l %s,%Rsp\n\ttrapcs\n", M68K_REGNAME(REGNO (stack_limit_rtx))); else if (GET_CODE (stack_limit_rtx) != SYMBOL_REF) - warning ("stack limit expression is not supported"); + warning (0, "stack limit expression is not supported"); } if (current_frame.reg_no <= 2) @@ -912,14 +1005,6 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED fprintf (stream, "\trts\n"); } -/* Similar to general_operand, but exclude stack_pointer_rtx. */ - -int -not_sp_operand (rtx op, enum machine_mode mode) -{ - return op != stack_pointer_rtx && nonimmediate_operand (op, mode); -} - /* Return true if X is a valid comparison operator for the dbcc instruction. @@ -929,7 +1014,7 @@ not_sp_operand (rtx op, enum machine_mode mode) It also rejects some comparisons when CC_NO_OVERFLOW is set. */ int -valid_dbcc_comparison_p (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) +valid_dbcc_comparison_p_2 (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED) { switch (GET_CODE (x)) { @@ -1067,7 +1152,7 @@ output_dbcc_and_branch (rtx *operands) break; default: - abort (); + gcc_unreachable (); } /* If the decrement is to be done in SImode, then we have @@ -1085,12 +1170,12 @@ output_dbcc_and_branch (rtx *operands) break; default: - abort (); + gcc_unreachable (); } } const char * -output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) +output_scc_di (rtx op, rtx operand1, rtx operand2, rtx dest) { rtx loperands[7]; enum rtx_code op_code = GET_CODE (op); @@ -1240,7 +1325,7 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest) break; default: - abort (); + gcc_unreachable (); } return ""; } @@ -1284,53 +1369,6 @@ output_btst (rtx *operands, rtx countop, rtx dataop, rtx insn, int signpos) return "btst %0,%1"; } -/* Returns true if OP is either a symbol reference or a sum of a symbol - reference and a constant. */ - -int -symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF: - case LABEL_REF: - return true; - - case CONST: - op = XEXP (op, 0); - return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF) - && GET_CODE (XEXP (op, 1)) == CONST_INT); - -#if 0 /* Deleted, with corresponding change in m68k.h, - so as to fit the specs. No CONST_DOUBLE is ever symbolic. */ - case CONST_DOUBLE: - return GET_MODE (op) == mode; -#endif - - default: - return false; - } -} - -/* Check for sign_extend or zero_extend. Used for bit-count operands. */ - -int -extend_operator(rtx x, enum machine_mode mode) -{ - if (mode != VOIDmode && GET_MODE(x) != mode) - return 0; - switch (GET_CODE(x)) - { - case SIGN_EXTEND : - case ZERO_EXTEND : - return 1; - default : - return 0; - } -} - - /* Legitimize PIC addresses. If the address is already position-independent, we return ORIG. Newly generated position-independent addresses go to REG. If we need more @@ -1380,8 +1418,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, /* First handle a simple SYMBOL_REF or LABEL_REF */ if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF) { - if (reg == 0) - abort (); + gcc_assert (reg); pic_ref = gen_rtx_MEM (Pmode, gen_rtx_PLUS (Pmode, @@ -1400,17 +1437,14 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) return orig; - if (reg == 0) - abort (); + gcc_assert (reg); /* legitimize both operands of the PLUS */ - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - orig = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); - } - else abort (); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); + orig = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, + base == reg ? 0 : reg); if (GET_CODE (orig) == CONST_INT) return plus_constant (base, INTVAL (orig)); @@ -1490,7 +1524,7 @@ const_int_cost (rtx constant) case MOVL : return 2; default : - abort (); + gcc_unreachable (); } } @@ -1652,7 +1686,7 @@ output_move_const_into_data_reg (rtx *operands) case MOVL : return "move%.l %1,%0"; default : - abort (); + gcc_unreachable (); } } @@ -1786,13 +1820,13 @@ output_move_qimode (rtx *operands) { /* 68k family always modifies the stack pointer by at least 2, even for byte pushes. The 5200 (ColdFire) does not do this. */ - if (GET_CODE (operands[0]) == MEM - && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC - && XEXP (XEXP (operands[0], 0), 0) == stack_pointer_rtx - && ! ADDRESS_REG_P (operands[1]) - && ! TARGET_COLDFIRE) - /* generated by pushqi1 pattern now */ - abort (); + + /* This case is generated by pushqi1 pattern now */ + gcc_assert (!(GET_CODE (operands[0]) == MEM + && GET_CODE (XEXP (operands[0], 0)) == PRE_DEC + && XEXP (XEXP (operands[0], 0), 0) == stack_pointer_rtx + && ! ADDRESS_REG_P (operands[1]) + && ! TARGET_COLDFIRE)); /* clr and st insns on 68000 read before writing. This isn't so on the 68010, but we have no TARGET_68010. */ @@ -1914,12 +1948,10 @@ output_move_double (rtx *operands) else optype1 = RNDOP; - /* Check for the cases that the operand constraints are not - supposed to allow to happen. Abort if we get one, - because generating code for these cases is painful. */ - - if (optype0 == RNDOP || optype1 == RNDOP) - abort (); + /* Check for the cases that the operand constraints are not supposed + to allow to happen. Generating code for these cases is + painful. */ + gcc_assert (optype0 != RNDOP && optype1 != RNDOP); /* If one operand is decrementing and one is incrementing decrement the former register explicitly @@ -2015,15 +2047,11 @@ output_move_double (rtx *operands) middlehalf[1] = GEN_INT (l[1]); latehalf[1] = GEN_INT (l[2]); } - else if (CONSTANT_P (operands[1])) + else { - /* actually, no non-CONST_DOUBLE constant should ever - appear here. */ - abort (); - if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 0) - latehalf[1] = constm1_rtx; - else - latehalf[1] = const0_rtx; + /* No non-CONST_DOUBLE constant should ever appear + here. */ + gcc_assert (!CONSTANT_P (operands[1])); } } else @@ -2076,7 +2104,7 @@ output_move_double (rtx *operands) /* If both halves of dest are used in the src memory address, compute the address into latehalf of dest. Note that this can't happen if the dest is two data regs. */ -compadr: + compadr: xops[0] = latehalf[0]; xops[1] = XEXP (operands[1], 0); output_asm_insn ("lea %a1,%0", xops); @@ -2107,8 +2135,7 @@ compadr: goto compadr; /* JRV says this can't happen: */ - if (addreg0 || addreg1) - abort (); + gcc_assert (!addreg0 && !addreg1); /* Only the middle reg conflicts; simply put it last. */ output_asm_insn (singlemove_string (operands), operands); @@ -2234,11 +2261,10 @@ find_addr_reg (rtx addr) else if (CONSTANT_P (XEXP (addr, 1))) addr = XEXP (addr, 0); else - abort (); + gcc_unreachable (); } - if (GET_CODE (addr) == REG) - return addr; - abort (); + gcc_assert (GET_CODE (addr) == REG); + return addr; } /* Output assembler code to perform a 32-bit 3-operand add. */ @@ -2634,9 +2660,9 @@ print_operand (FILE *file, rtx op, int letter) else if (letter == 'o') { /* This is only for direct addresses with TARGET_PCREL */ - if (GET_CODE (op) != MEM || GET_CODE (XEXP (op, 0)) != SYMBOL_REF - || !TARGET_PCREL) - abort (); + gcc_assert (GET_CODE (op) == MEM + && GET_CODE (XEXP (op, 0)) == SYMBOL_REF + && TARGET_PCREL); output_addr_const (file, XEXP (op, 0)); } else if (GET_CODE (op) == REG) @@ -2823,10 +2849,7 @@ print_operand_address (FILE *file, rtx addr) #endif if (offset != 0) { - if (addr != 0) - { - abort (); - } + gcc_assert (!addr); addr = offset; } if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND @@ -2881,14 +2904,10 @@ print_operand_address (FILE *file, rtx addr) if (ireg != 0 || breg != 0) { int scale = 1; - if (breg == 0) - { - abort (); - } - if (! flag_pic && addr && GET_CODE (addr) == LABEL_REF) - { - abort (); - } + + gcc_assert (breg); + gcc_assert (flag_pic || !addr || GET_CODE (addr) != LABEL_REF); + if (MOTOROLA) { if (addr != 0) @@ -3047,45 +3066,6 @@ strict_low_part_peephole_ok (enum machine_mode mode, rtx first_insn, return false; } -/* Accept integer operands in the range 0..0xffffffff. We have to check the - range carefully since this predicate is used in DImode contexts. Also, we - need some extra crud to make it work when hosted on 64-bit machines. */ - -int -const_uint32_operand (rtx op, enum machine_mode mode) -{ - /* It doesn't make sense to ask this question with a mode that is - not larger than 32 bits. */ - if (GET_MODE_BITSIZE (mode) <= 32) - abort (); - -#if HOST_BITS_PER_WIDE_INT > 32 - /* All allowed constants will fit a CONST_INT. */ - return (GET_CODE (op) == CONST_INT - && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL)); -#else - return (GET_CODE (op) == CONST_INT - || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0)); -#endif -} - -/* Accept integer operands in the range -0x80000000..0x7fffffff. We have - to check the range carefully since this predicate is used in DImode - contexts. */ - -int -const_sint32_operand (rtx op, enum machine_mode mode) -{ - /* It doesn't make sense to ask this question with a mode that is - not larger than 32 bits. */ - if (GET_MODE_BITSIZE (mode) <= 32) - abort (); - - /* All allowed constants will fit a CONST_INT. */ - return (GET_CODE (op) == CONST_INT - && (INTVAL (op) >= (-0x7fffffff - 1) && INTVAL (op) <= 0x7fffffff)); -} - /* Operand predicates for implementing asymmetric pc-relative addressing on m68k. The m68k supports pc-relative addressing (mode 7, register 2) when used as a source operand, but not as a destination operand. @@ -3143,75 +3123,6 @@ const_sint32_operand (rtx op, enum machine_mode mode) ***************************************************************************/ -/* Special case of a general operand that's used as a source operand. - Use this to permit reads from PC-relative memory when -mpcrel - is specified. */ - -int -general_src_operand (rtx op, enum machine_mode mode) -{ - if (TARGET_PCREL - && GET_CODE (op) == MEM - && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF - || GET_CODE (XEXP (op, 0)) == CONST)) - return 1; - return general_operand (op, mode); -} - -/* Special case of a nonimmediate operand that's used as a source. - Use this to permit reads from PC-relative memory when -mpcrel - is specified. */ - -int -nonimmediate_src_operand (rtx op, enum machine_mode mode) -{ - if (TARGET_PCREL && GET_CODE (op) == MEM - && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF - || GET_CODE (XEXP (op, 0)) == CONST)) - return 1; - return nonimmediate_operand (op, mode); -} - -/* Special case of a memory operand that's used as a source. - Use this to permit reads from PC-relative memory when -mpcrel - is specified. */ - -int -memory_src_operand (rtx op, enum machine_mode mode) -{ - if (TARGET_PCREL && GET_CODE (op) == MEM - && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF - || GET_CODE (XEXP (op, 0)) == CONST)) - return 1; - return memory_operand (op, mode); -} - -int -post_inc_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return MEM_P (op) && GET_CODE (XEXP (op, 0)) == POST_INC; -} - -int -pre_dec_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return MEM_P (op) && GET_CODE (XEXP (op, 0)) == PRE_DEC; -} - -/* Predicate that accepts only a pc-relative address. This is needed - because pc-relative addresses don't satisfy the predicate - "general_src_operand". */ - -int -pcrel_address (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF - || GET_CODE (op) == CONST); -} - const char * output_andsi3 (rtx *operands) { diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h index 4a832b4ccda..305072b841f 100644 --- a/gcc/config/m68k/m68k.h +++ b/gcc/config/m68k/m68k.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC for Motorola 680x0/ColdFire. Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -113,243 +113,17 @@ Boston, MA 02111-1307, USA. */ /* Set the default. */ #define INT_OP_GROUP INT_OP_DOT_WORD -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* Macros used in the machine description to test the flags. */ - -/* Compile for a 68020 (not a 68000 or 68010). */ -#define MASK_68020 (1<<0) -#define TARGET_68020 (target_flags & MASK_68020) - -/* Compile for a 68030. This does not really make a difference in GCC, - it just enables the __mc68030__ predefine. */ -#define MASK_68030 (1<<1) -#define TARGET_68030 (target_flags & MASK_68030) - -/* Optimize for 68040, but still allow execution on 68020 - (-m68020-40 or -m68040). - The 68040 will execute all 68030 and 68881/2 instructions, but some - of them must be emulated in software by the OS. When TARGET_68040 is - turned on, these instructions won't be used. This code will still - run on a 68030 and 68881/2. */ -#define MASK_68040 (1<<2) -#define TARGET_68040 (target_flags & MASK_68040) - -/* Use the 68040-only fp instructions (-m68040 or -m68060). */ -#define MASK_68040_ONLY (1<<3) -#define TARGET_68040_ONLY (target_flags & MASK_68040_ONLY) - -/* Optimize for 68060, but still allow execution on 68020 - (-m68020-60 or -m68060). - The 68060 will execute all 68030 and 68881/2 instructions, but some - of them must be emulated in software by the OS. When TARGET_68060 is - turned on, these instructions won't be used. This code will still - run on a 68030 and 68881/2. */ -#define MASK_68060 (1<<4) -#define TARGET_68060 (target_flags & MASK_68060) - -/* Compile for mcf5200 */ -#define MASK_5200 (1<<5) -#define TARGET_5200 (target_flags & MASK_5200) - -/* Build for ColdFire v3 */ -#define MASK_CFV3 (1<<6) -#define TARGET_CFV3 (target_flags & MASK_CFV3) - -/* Build for ColdFire v4 */ -#define MASK_CFV4 (1<<7) -#define TARGET_CFV4 (target_flags & MASK_CFV4) - -/* Compile for ColdFire 528x */ -#define MASK_528x (1<<8) -#define TARGET_528x (target_flags & MASK_528x) - -/* Divide support for ColdFire */ -#define MASK_CF_HWDIV (1<<9) -#define TARGET_CF_HWDIV (target_flags & MASK_CF_HWDIV) - -/* Compile 68881 insns for floating point (not library calls). */ -#define MASK_68881 (1<<10) -#define TARGET_68881 (target_flags & MASK_68881) - -/* Compile using 68020 bit-field insns. */ -#define MASK_BITFIELD (1<<11) -#define TARGET_BITFIELD (target_flags & MASK_BITFIELD) - -/* Compile with 16-bit `int'. */ -#define MASK_SHORT (1<<12) -#define TARGET_SHORT (target_flags & MASK_SHORT) - -/* Align ints to a word boundary. This breaks compatibility with the - published ABI's for structures containing ints, but produces faster - code on cpus with 32-bit busses (020, 030, 040, 060, CPU32+, ColdFire). - It's required for ColdFire cpus without a misalignment module. */ -#define MASK_ALIGN_INT (1<<13) -#define TARGET_ALIGN_INT (target_flags & MASK_ALIGN_INT) - -/* Use PC-relative addressing modes (without using a global offset table). - The m68000 supports 16-bit PC-relative addressing. - The m68020 supports 32-bit PC-relative addressing - (using outer displacements). - - Under this model, all SYMBOL_REFs (and CONSTs) and LABEL_REFs are - treated as all containing an implicit PC-relative component, and hence - cannot be used directly as addresses for memory writes. See the comments - in m68k.c for more information. */ -#define MASK_PCREL (1<<14) -#define TARGET_PCREL (target_flags & MASK_PCREL) - -/* Relax strict alignment. */ -#define MASK_NO_STRICT_ALIGNMENT (1<<15) -#define TARGET_STRICT_ALIGNMENT (~target_flags & MASK_NO_STRICT_ALIGNMENT) - -/* Compile using rtd insn calling sequence. - This will not work unless you use prototypes at least - for all functions that can take varying numbers of args. */ -#define MASK_RTD (1<<16) -#define TARGET_RTD (target_flags & MASK_RTD) - -/* Support A5 relative data separate from text. - * This option implies -fPIC, however it inhibits the generation of the - * A5 save/restore in functions and the loading of a5 with a got pointer. - */ -#define MASK_SEP_DATA (1<<17) -#define TARGET_SEP_DATA (target_flags & MASK_SEP_DATA) - -/* Compile using library ID based shared libraries. - * Set a specific ID using the -mshared-library-id=xxx option. - */ -#define MASK_ID_SHARED_LIBRARY (1<<18) -#define TARGET_ID_SHARED_LIBRARY (target_flags & MASK_ID_SHARED_LIBRARY) - /* Compile for a CPU32. A 68020 without bitfields is a good heuristic for a CPU32. */ #define TARGET_CPU32 (TARGET_68020 && !TARGET_BITFIELD) /* Is the target a ColdFire? */ -#define MASK_COLDFIRE (MASK_5200|MASK_528x|MASK_CFV3|MASK_CFV4) -#define TARGET_COLDFIRE (target_flags & MASK_COLDFIRE) - -/* Which bits can be set by specifying a ColdFire */ -#define MASK_ALL_CF_BITS (MASK_COLDFIRE|MASK_CF_HWDIV) - -#define TARGET_SWITCHES \ - { { "68020", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY), \ - N_("Generate code for a 68020") }, \ - { "c68020", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY), \ - N_("Generate code for a 68020") }, \ - { "68020", (MASK_68020|MASK_BITFIELD), "" }, \ - { "c68020", (MASK_68020|MASK_BITFIELD), "" }, \ - { "68000", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \ - |MASK_68020|MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 68000") }, \ - { "c68000", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \ - |MASK_68020|MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 68000") }, \ - { "bitfield", MASK_BITFIELD, \ - N_("Use the bit-field instructions") }, \ - { "nobitfield", - MASK_BITFIELD, \ - N_("Do not use the bit-field instructions") }, \ - { "short", MASK_SHORT, \ - N_("Consider type 'int' to be 16 bits wide") }, \ - { "noshort", - MASK_SHORT, \ - N_("Consider type 'int' to be 32 bits wide") }, \ - { "68881", MASK_68881, "" }, \ - { "soft-float", - MASK_68881, \ - N_("Generate code with library calls for floating point") }, \ - { "68020-40", -(MASK_ALL_CF_BITS|MASK_68060|MASK_68040_ONLY), \ - N_("Generate code for a 68040, without any new instructions") }, \ - { "68020-40", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040), ""},\ - { "68020-60", -(MASK_ALL_CF_BITS|MASK_68040_ONLY), \ - N_("Generate code for a 68060, without any new instructions") }, \ - { "68020-60", (MASK_BITFIELD|MASK_68881|MASK_68020|MASK_68040 \ - |MASK_68060), "" }, \ - { "68030", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY), \ - N_("Generate code for a 68030") }, \ - { "68030", (MASK_68020|MASK_68030|MASK_BITFIELD), "" }, \ - { "68040", - (MASK_ALL_CF_BITS|MASK_68060), \ - N_("Generate code for a 68040") }, \ - { "68040", (MASK_68020|MASK_68881|MASK_BITFIELD \ - |MASK_68040_ONLY|MASK_68040), "" }, \ - { "68060", - (MASK_ALL_CF_BITS|MASK_68040), \ - N_("Generate code for a 68060") }, \ - { "68060", (MASK_68020|MASK_68881|MASK_BITFIELD \ - |MASK_68040_ONLY|MASK_68060), "" }, \ - { "5200", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 520X") }, \ - { "5200", (MASK_5200), "" }, \ - { "5206e", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 5206e") }, \ - { "5206e", (MASK_5200|MASK_CF_HWDIV), "" }, \ - { "528x", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 528x") }, \ - { "528x", (MASK_528x|MASK_CF_HWDIV), "" }, \ - { "5307", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 5307") }, \ - { "5307", (MASK_CFV3|MASK_CF_HWDIV), "" }, \ - { "5407", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY|MASK_68020 \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 5407") }, \ - { "5407", (MASK_CFV4|MASK_CF_HWDIV), "" }, \ - { "68851", 0, \ - N_("Generate code for a 68851") }, \ - { "no-68851", 0, \ - N_("Do no generate code for a 68851") }, \ - { "68302", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \ - |MASK_68020|MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 68302") }, \ - { "68332", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a 68332") }, \ - { "68332", MASK_68020, "" }, \ - { "cpu32", - (MASK_ALL_CF_BITS|MASK_68060|MASK_68040|MASK_68040_ONLY \ - |MASK_BITFIELD|MASK_68881), \ - N_("Generate code for a cpu32") }, \ - { "cpu32", MASK_68020, "" }, \ - { "align-int", MASK_ALIGN_INT, \ - N_("Align variables on a 32-bit boundary") }, \ - { "no-align-int", -MASK_ALIGN_INT, \ - N_("Align variables on a 16-bit boundary") }, \ - { "sep-data", MASK_SEP_DATA, \ - N_("Enable separate data segment") }, \ - { "no-sep-data", -MASK_SEP_DATA, \ - N_("Disable separate data segment") }, \ - { "id-shared-library", MASK_ID_SHARED_LIBRARY, \ - N_("Enable ID based shared library") }, \ - { "no-id-shared-library", -MASK_ID_SHARED_LIBRARY, \ - N_("Disable ID based shared library") }, \ - { "pcrel", MASK_PCREL, \ - N_("Generate pc-relative code") }, \ - { "strict-align", -MASK_NO_STRICT_ALIGNMENT, \ - N_("Do not use unaligned memory references") }, \ - { "no-strict-align", MASK_NO_STRICT_ALIGNMENT, \ - N_("Use unaligned memory references") }, \ - { "rtd", MASK_RTD, \ - N_("Use different calling convention using 'rtd'") }, \ - { "nortd", - MASK_RTD, \ - N_("Use normal calling convention") }, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT, "" }} -/* TARGET_DEFAULT is defined in m68k-none.h, netbsd.h, etc. */ - -#define TARGET_OPTIONS \ -{ \ - { "shared-library-id=", &m68k_library_id_string, \ - N_("ID of shared library to build"), 0}, \ - SUBTARGET_OPTIONS \ -} +#define MASK_COLDFIRE (MASK_5200 | MASK_528x | MASK_CFV3 | MASK_CFV4) +#define TARGET_COLDFIRE ((target_flags & MASK_COLDFIRE) != 0) #define OVERRIDE_OPTIONS override_options() /* These are meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES -#define SUBTARGET_OPTIONS #define SUBTARGET_OVERRIDE_OPTIONS /* target machine storage layout */ @@ -1260,22 +1034,3 @@ do { if (cc_prev_status.flags & CC_IN_68881) \ /* Variables in m68k.c */ extern const char *m68k_library_id_string; extern int m68k_last_compare_had_fp_operands; - - -/* Define the codes that are matched by predicates in m68k.c. */ - -#define PREDICATE_CODES \ - {"general_src_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ - LABEL_REF, SUBREG, REG, MEM}}, \ - {"nonimmediate_src_operand", {SUBREG, REG, MEM}}, \ - {"memory_src_operand", {SUBREG, MEM}}, \ - {"not_sp_operand", {SUBREG, REG, MEM}}, \ - {"pcrel_address", {SYMBOL_REF, LABEL_REF, CONST}}, \ - {"const_uint32_operand", {CONST_INT, CONST_DOUBLE}}, \ - {"const_sint32_operand", {CONST_INT}}, \ - {"valid_dbcc_comparison_p", {EQ, NE, GTU, LTU, GEU, LEU, \ - GT, LT, GE, LE}}, \ - {"extend_operator", {SIGN_EXTEND, ZERO_EXTEND}}, \ - {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \ - {"post_inc_operand", {MEM}}, \ - {"pre_dec_operand", {MEM}}, diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md index 57ddd4a78f3..19e0d1b84ef 100644 --- a/gcc/config/m68k/m68k.md +++ b/gcc/config/m68k/m68k.md @@ -1,6 +1,6 @@ ;;- Machine description for GNU compiler, Motorola 68000 Version ;; Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, -;; 2002, 2003, 2004 +;; 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; This file is part of GCC. @@ -128,6 +128,8 @@ [(A0_REG 8) (SP_REG 15) ]) + +(include "predicates.md") (define_insn "" [(set (match_operand:DF 0 "push_operand" "=m") @@ -713,7 +715,7 @@ "!TARGET_COLDFIRE" "* return output_move_himode (operands);") - (define_insn "" +(define_insn "" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,g,U") (match_operand:HI 1 "general_operand" "g,r,U"))] "TARGET_COLDFIRE" @@ -1776,8 +1778,9 @@ return "add%.l %1,%R0\;addx%.l %3,%0"; } } - else if (GET_CODE (operands[0]) == MEM) + else { + gcc_assert (GET_CODE (operands[0]) == MEM); if (GET_CODE (operands[2]) == MEM && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC) return "add%.l %2,%0\;addx%.l %2,%0"; @@ -1799,8 +1802,6 @@ return "add%.l %R2,%1\;move%.l %0,%3\;addx%.l %2,%3\;move%.l %3,%0"; } } - else - abort (); }) (define_insn "addsi_lshrsi_31" @@ -2252,8 +2253,9 @@ return "sub%.l %1,%R0\;subx%.l %3,%0"; } } - else if (GET_CODE (operands[0]) == MEM) + else { + gcc_assert (GET_CODE (operands[0]) == MEM); if (GET_CODE (operands[2]) == MEM && GET_CODE (XEXP (operands[2], 0)) == PRE_DEC) return "sub%.l %2,%0\;subx%.l %2,%0"; @@ -2275,8 +2277,6 @@ return "sub%.l %R2,%1\;move%.l %0,%3\;subx%.l %2,%3\;move%.l %3,%0"; } } - else - abort (); }) (define_insn "subsi3" @@ -3575,8 +3575,7 @@ result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, SFmode), GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -3618,8 +3617,7 @@ result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, DFmode), GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -3691,8 +3689,7 @@ result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, SFmode), GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -3729,8 +3726,7 @@ result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, DFmode), GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -5163,8 +5159,7 @@ (ordered:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5182,8 +5177,7 @@ (unordered:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5201,8 +5195,7 @@ (uneq:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5220,8 +5213,7 @@ (unge:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5239,8 +5231,7 @@ (ungt:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5258,8 +5249,7 @@ (unle:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5277,8 +5267,7 @@ (unlt:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5296,8 +5285,7 @@ (ltgt:QI (cc0) (const_int 0)))] "TARGET_68881 && !TARGET_68060" { - if (! m68k_last_compare_had_fp_operands) - abort (); + gcc_assert (m68k_last_compare_had_fp_operands); m68k_last_compare_had_fp_operands = 0; }) @@ -5687,8 +5675,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbor %l0" : "fjor %l0"; }) @@ -5699,8 +5686,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbun %l0" : "fjun %l0"; }) @@ -5711,8 +5697,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbueq %l0" : "fjueq %l0"; }) @@ -5723,8 +5708,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbuge %l0" : "fjuge %l0"; }) @@ -5735,8 +5719,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbugt %l0" : "fjugt %l0"; }) @@ -5747,8 +5730,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbule %l0" : "fjule %l0"; }) @@ -5759,8 +5741,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbult %l0" : "fjult %l0"; }) @@ -5771,8 +5752,7 @@ (pc)))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbogl %l0" : "fjogl %l0"; }) @@ -5913,8 +5893,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbun %l0" : "fjun %l0"; }) @@ -5925,8 +5904,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbor %l0" : "fjor %l0"; }) @@ -5937,8 +5915,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbogl %l0" : "fjogl %l0"; }) @@ -5949,8 +5926,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbolt %l0" : "fjolt %l0"; }) @@ -5961,8 +5937,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbogt %l0" : "fjogt %l0"; }) @@ -5973,8 +5948,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fboge %l0" : "fjoge %l0"; }) @@ -5985,8 +5959,7 @@ (label_ref (match_operand 0 "" ""))))] "TARGET_68881" { - if (!(cc_prev_status.flags & CC_IN_68881)) - abort (); + gcc_assert (cc_prev_status.flags & CC_IN_68881); return MOTOROLA ? "fbueq %l0" : "fjueq %l0"; }) @@ -6945,8 +6918,7 @@ result = expand_binop (SImode, xor_optab, operand_subword_force (operands[1], 0, XFmode), GEN_INT (0x80000000), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -6990,8 +6962,7 @@ result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, XFmode), GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -7104,6 +7075,6 @@ case GEU: return "trapcc"; case LE: return "traple"; case LEU: return "trapls"; - default: abort(); + default: gcc_unreachable (); } }) diff --git a/gcc/config/m68k/m68k.opt b/gcc/config/m68k/m68k.opt new file mode 100644 index 00000000000..fa8770e65fe --- /dev/null +++ b/gcc/config/m68k/m68k.opt @@ -0,0 +1,149 @@ +; Options for the Motorola 68000 port of the compiler. + +; Copyright (C) 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. + +m5200 +Target RejectNegative Mask(5200) +Generate code for a 520X + +m5206e +Target RejectNegative Mask(CF_HWDIV) +Generate code for a 5206e + +m528x +Target RejectNegative Mask(528x) +Generate code for a 528x + +m5307 +Target RejectNegative Mask(CFV3) +Generate code for a 5307 + +m5407 +Target RejectNegative Mask(CFV4) +Generate code for a 5407 + +m68000 +Target RejectNegative +Generate code for a 68000 + +m68020 +Target RejectNegative Mask(68020) +Generate code for a 68020 + +m68020-40 +Target RejectNegative Mask(68040) +Generate code for a 68040, without any new instructions + +m68020-60 +Target RejectNegative Mask(68060) +Generate code for a 68060, without any new instructions + +m68030 +Target RejectNegative Mask(68030) +Generate code for a 68030 + +m68040 +Target RejectNegative Mask(68040_ONLY) +Generate code for a 68040 + +m68060 +Target RejectNegative +Generate code for a 68060 + +m68302 +Target RejectNegative +Generate code for a 68302 + +m68332 +Target RejectNegative +Generate code for a 68332 + +; Has no effect on gcc +m68851 +Target +Generate code for a 68851 + +m68881 +Target RejectNegative Mask(68881) +Generate code that uses 68881 floating-point instructions + +malign-int +Target Report Mask(ALIGN_INT) +Align variables on a 32-bit boundary + +mbitfield +Target Report RejectNegative Mask(BITFIELD) +Use the bit-field instructions + +mc68000 +Target RejectNegative +Generate code for a 68000 + +mc68020 +Target RejectNegative +Generate code for a 68020 + +mcpu32 +Target RejectNegative +Generate code for a cpu32 + +mid-shared-library +Target Report Mask(ID_SHARED_LIBRARY) +Enable ID based shared library + +mnobitfield +Target RejectNegative InverseMask(BITFIELD) +Do not use the bit-field instructions + +mnortd +Target RejectNegative InverseMask(RTD) +Use normal calling convention + +mnoshort +Target RejectNegative InverseMask(SHORT) +Consider type 'int' to be 32 bits wide + +mpcrel +Target Report Mask(PCREL) +Generate pc-relative code + +mrtd +Target Report RejectNegative Mask(RTD) +Use different calling convention using 'rtd' + +msep-data +Target Report Mask(SEP_DATA) +Enable separate data segment + +mshared-library-id= +Target RejectNegative Joined UInteger +ID of shared library to build + +mshort +Target Report RejectNegative Mask(SHORT) +Consider type 'int' to be 16 bits wide + +msoft-float +Target RejectNegative InverseMask(68881) +Generate code with library calls for floating point + +mstrict-align +Target Report Mask(STRICT_ALIGNMENT) +Do not use unaligned memory references diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h index 51d0641501f..0fdd59d02ec 100644 --- a/gcc/config/m68k/m68kelf.h +++ b/gcc/config/m68k/m68kelf.h @@ -86,8 +86,6 @@ Boston, MA 02111-1307, USA. */ do { \ if ((LOG) > 0) \ fprintf ((FILE), "%s%u\n", ALIGN_ASM_OP, 1 << (LOG)); \ - else if ((LOG) > 31) \ - abort (); \ } while (0) /* Use proper assembler syntax for these macros. */ diff --git a/gcc/config/m68k/predicates.md b/gcc/config/m68k/predicates.md new file mode 100644 index 00000000000..183c4e7d5fc --- /dev/null +++ b/gcc/config/m68k/predicates.md @@ -0,0 +1,196 @@ +;; Predicate definitions for Motorola 68000. +;; Copyright (C) 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. + +;; Special case of a general operand that's used as a source +;; operand. Use this to permit reads from PC-relative memory when +;; -mpcrel is specified. + +(define_predicate "general_src_operand" + (match_code "const_int,const_double,const,symbol_ref,label_ref,subreg,reg,mem") +{ + if (TARGET_PCREL + && GET_CODE (op) == MEM + && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == LABEL_REF + || GET_CODE (XEXP (op, 0)) == CONST)) + return 1; + return general_operand (op, mode); +}) + +;; Special case of a nonimmediate operand that's used as a source. Use +;; this to permit reads from PC-relative memory when -mpcrel is +;; specified. + +(define_predicate "nonimmediate_src_operand" + (match_code "subreg,reg,mem") +{ + if (TARGET_PCREL && GET_CODE (op) == MEM + && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == LABEL_REF + || GET_CODE (XEXP (op, 0)) == CONST)) + return 1; + return nonimmediate_operand (op, mode); +}) + +;; Special case of a memory operand that's used as a source. Use this +;; to permit reads from PC-relative memory when -mpcrel is specified. + +(define_predicate "memory_src_operand" + (match_code "subreg,mem") +{ + if (TARGET_PCREL && GET_CODE (op) == MEM + && (GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == LABEL_REF + || GET_CODE (XEXP (op, 0)) == CONST)) + return 1; + return memory_operand (op, mode); +}) + +;; Similar to general_operand, but exclude stack_pointer_rtx. + +(define_predicate "not_sp_operand" + (match_code "subreg,reg,mem") +{ + return op != stack_pointer_rtx && nonimmediate_operand (op, mode); +}) + +;; Predicate that accepts only a pc-relative address. This is needed +;; because pc-relative addresses don't satisfy the predicate +;; "general_src_operand". + +(define_predicate "pcrel_address" + (match_code "symbol_ref,label_ref,const") +{ + return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF + || GET_CODE (op) == CONST); +}) + +;; Accept integer operands in the range 0..0xffffffff. We have to +;; check the range carefully since this predicate is used in DImode +;; contexts. Also, we need some extra crud to make it work when +;; hosted on 64-bit machines. + +(define_predicate "const_uint32_operand" + (match_code "const_int,const_double") +{ + /* It doesn't make sense to ask this question with a mode that is + not larger than 32 bits. */ + if (GET_MODE_BITSIZE (mode) <= 32) + abort (); + +#if HOST_BITS_PER_WIDE_INT > 32 + /* All allowed constants will fit a CONST_INT. */ + return (GET_CODE (op) == CONST_INT + && (INTVAL (op) >= 0 && INTVAL (op) <= 0xffffffffL)); +#else + return (GET_CODE (op) == CONST_INT + || (GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_HIGH (op) == 0)); +#endif +}) + +;; Accept integer operands in the range -0x80000000..0x7fffffff. We +;; have to check the range carefully since this predicate is used in +;; DImode contexts. + +(define_predicate "const_sint32_operand" + (match_code "const_int") +{ + /* It doesn't make sense to ask this question with a mode that is + not larger than 32 bits. */ + if (GET_MODE_BITSIZE (mode) <= 32) + abort (); + + /* All allowed constants will fit a CONST_INT. */ + return (GET_CODE (op) == CONST_INT + && (INTVAL (op) >= (-0x7fffffff - 1) && INTVAL (op) <= 0x7fffffff)); +}) + +;; Return true if X is a valid comparison operator for the dbcc +;; instruction. Note it rejects floating point comparison +;; operators. (In the future we could use Fdbcc). It also rejects +;; some comparisons when CC_NO_OVERFLOW is set. + +(define_predicate "valid_dbcc_comparison_p" + (match_code "eq,ne,gtu,ltu,geu,leu,gt,lt,ge,le") +{ + return valid_dbcc_comparison_p_2 (op, mode); +}) + +;; Check for sign_extend or zero_extend. Used for bit-count operands. + +(define_predicate "extend_operator" + (match_code "sign_extend,zero_extend") +{ + if (mode != VOIDmode && GET_MODE (op) != mode) + return 0; + switch (GET_CODE (op)) + { + case SIGN_EXTEND: + case ZERO_EXTEND: + return 1; + default: + return 0; + } +}) + +;; Returns true if OP is either a symbol reference or a sum of a +;; symbol reference and a constant. + +(define_predicate "symbolic_operand" + (match_code "symbol_ref,label_ref,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + case LABEL_REF: + return true; + + case CONST: + op = XEXP (op, 0); + return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == LABEL_REF) + && GET_CODE (XEXP (op, 1)) == CONST_INT); + +#if 0 /* Deleted, with corresponding change in m68k.h, + so as to fit the specs. No CONST_DOUBLE is ever symbolic. */ + case CONST_DOUBLE: + return GET_MODE (op) == mode; +#endif + + default: + return false; + } +}) + +;; TODO: Add a comment here. + +(define_predicate "post_inc_operand" + (match_code "mem") +{ + return MEM_P (op) && GET_CODE (XEXP (op, 0)) == POST_INC; +}) + +;; TODO: Add a comment here. + +(define_predicate "pre_dec_operand" + (match_code "mem") +{ + return MEM_P (op) && GET_CODE (XEXP (op, 0)) == PRE_DEC; +}) diff --git a/gcc/config/mcore/mcore-protos.h b/gcc/config/mcore/mcore-protos.h index b035e9b7e75..625b80e9dcf 100644 --- a/gcc/config/mcore/mcore-protos.h +++ b/gcc/config/mcore/mcore-protos.h @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in mcore.c - Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nick Clifton (nickc@redhat.com) This file is part of GCC. @@ -71,25 +71,7 @@ extern int mcore_arith_S_operand (rtx); #ifdef HAVE_MACHINE_MODES extern const char * mcore_output_move (rtx, rtx *, enum machine_mode); extern const char * mcore_output_movedouble (rtx *, enum machine_mode); -extern int mcore_arith_reg_operand (rtx, enum machine_mode); -extern int mcore_general_movsrc_operand (rtx, enum machine_mode); -extern int mcore_general_movdst_operand (rtx, enum machine_mode); -extern int mcore_reload_operand (rtx, enum machine_mode); -extern int mcore_arith_J_operand (rtx, enum machine_mode); -extern int mcore_arith_K_operand (rtx, enum machine_mode); -extern int mcore_arith_K_operand_not_0 (rtx, enum machine_mode); -extern int mcore_arith_M_operand (rtx, enum machine_mode); -extern int mcore_arith_K_S_operand (rtx, enum machine_mode); -extern int mcore_arith_imm_operand (rtx, enum machine_mode); -extern int mcore_arith_any_imm_operand (rtx, enum machine_mode); -extern int mcore_arith_O_operand (rtx, enum machine_mode); -extern int mcore_literal_K_operand (rtx, enum machine_mode); -extern int mcore_addsub_operand (rtx, enum machine_mode); -extern int mcore_compare_operand (rtx, enum machine_mode); -extern int mcore_load_multiple_operation (rtx, enum machine_mode); -extern int mcore_store_multiple_operation (rtx, enum machine_mode); -extern int mcore_call_address_operand (rtx, enum machine_mode); - +extern int const_ok_for_mcore (int); #ifdef TREE_CODE extern rtx mcore_function_arg (CUMULATIVE_ARGS, enum machine_mode, tree, int); #endif /* TREE_CODE */ diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index 6b0b4fb8bc6..fff8a3e2896 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -1,5 +1,5 @@ /* Output routines for Motorola MCore processor - Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -49,8 +49,7 @@ /* Maximum size we are allowed to grow the stack in a single operation. If we want more, we must do it in increments of at most this size. If this value is 0, we don't check at all. */ -const char * mcore_stack_increment_string = 0; -int mcore_stack_increment = STACK_UNITS_MAXSTEP; +int mcore_stack_increment = STACK_UNITS_MAXSTEP; /* For dumping information about frame sizes. */ char * mcore_current_function_name = 0; @@ -119,7 +118,6 @@ cond_type; static void output_stack_adjust (int, int); static int calc_live_regs (int *); -static int const_ok_for_mcore (int); static int try_constant_tricks (long, int *, int *); static const char * output_inline_const (enum machine_mode, rtx *); static void layout_mcore_frame (struct mcore_frame *); @@ -176,6 +174,8 @@ static int mcore_arg_partial_bytes (CUMULATIVE_ARGS *, #define TARGET_ASM_UNIQUE_SECTION mcore_unique_section #undef TARGET_ASM_FUNCTION_RODATA_SECTION #define TARGET_ASM_FUNCTION_RODATA_SECTION default_no_function_rodata_section +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO mcore_encode_section_info #undef TARGET_STRIP_NAME_ENCODING @@ -309,9 +309,7 @@ mcore_print_operand_address (FILE * stream, rtx x) break; default: - debug_rtx (x); - - abort (); + gcc_unreachable (); } } @@ -370,7 +368,7 @@ mcore_print_operand (FILE * stream, rtx x, int code) (stream, XEXP (adjust_address (x, SImode, 4), 0)); break; default: - abort (); + gcc_unreachable (); } break; case 'U': @@ -598,18 +596,12 @@ mcore_gen_compare_reg (enum rtx_code code) break; case GTU: /* Use inverted condition, cmple. */ - if (GET_CODE (op1) == CONST_INT && INTVAL (op1) == 0) - { - /* Unsigned > 0 is the same as != 0, but we need - to invert the condition, so we want to set - code = EQ. This cannot be done however, as the - mcore does not support such a test. Instead we - cope with this case in the "bgtu" pattern itself - so we should never reach this point. */ - /* code = EQ; */ - abort (); - break; - } + /* Unsigned > 0 is the same as != 0, but we need to invert the + condition, so we want to set code = EQ. This cannot be done + however, as the mcore does not support such a test. Instead + we cope with this case in the "bgtu" pattern itself so we + should never reach this point. */ + gcc_assert (GET_CODE (op1) != CONST_INT || INTVAL (op1) != 0); code = LEU; /* Drop through. */ @@ -654,12 +646,6 @@ mcore_symbolic_address_p (rtx x) } } -int -mcore_call_address_operand (rtx x, enum machine_mode mode) -{ - return register_operand (x, mode) || CONSTANT_P (x); -} - /* Functions to output assembly code for a function call. */ char * @@ -672,8 +658,7 @@ mcore_output_call (rtx operands[], int index) { if (TARGET_CG_DATA) { - if (mcore_current_function_name == 0) - abort (); + gcc_assert (mcore_current_function_name); ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, "unknown", 1); @@ -685,13 +670,11 @@ mcore_output_call (rtx operands[], int index) { if (TARGET_CG_DATA) { - if (mcore_current_function_name == 0) - abort (); - - if (GET_CODE (addr) != SYMBOL_REF) - abort (); + gcc_assert (mcore_current_function_name); + gcc_assert (GET_CODE (addr) == SYMBOL_REF); - ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, XSTR (addr, 0), 0); + ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, + XSTR (addr, 0), 0); } sprintf (buffer, "jbsr\t%%%d", index); @@ -702,7 +685,7 @@ mcore_output_call (rtx operands[], int index) /* Can we load a constant with a single instruction ? */ -static int +int const_ok_for_mcore (int value) { if (value >= 0 && value <= 127) @@ -1100,9 +1083,10 @@ mcore_output_andn (rtx insn ATTRIBUTE_UNUSED, rtx operands[]) rtx out_operands[3]; const char * load_op; char buf[256]; + int trick_no; - if (try_constant_tricks (INTVAL (operands[1]), &x, &y) != 2) - abort (); + trick_no = try_constant_tricks (INTVAL (operands[1]), &x, &y); + gcc_assert (trick_no == 2); out_operands[0] = operands[0]; out_operands[1] = GEN_INT(x); @@ -1142,15 +1126,13 @@ output_inline_const (enum machine_mode mode, rtx operands[]) int value; value = INTVAL (operands[1]); - - if ((trick_no = try_constant_tricks (value, &x, &y)) == 0) - { - /* lrw's are handled separately: Large inlinable constants - never get turned into lrw's. Our caller uses try_constant_tricks - to back off to an lrw rather than calling this routine. */ - abort (); - } + trick_no = try_constant_tricks (value, &x, &y); + /* lrw's are handled separately: Large inlinable constants never get + turned into lrw's. Our caller uses try_constant_tricks to back + off to an lrw rather than calling this routine. */ + gcc_assert (trick_no != 0); + if (trick_no == 1) x = value; @@ -1258,7 +1240,7 @@ mcore_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[], case QImode: return "ld.b\t%0,%1"; default: - abort (); + gcc_unreachable (); } } else if (GET_CODE (src) == CONST_INT) @@ -1289,10 +1271,10 @@ mcore_output_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[], case QImode: return "st.b\t%1,%0"; default: - abort (); + gcc_unreachable (); } - abort (); + gcc_unreachable (); } /* Return a sequence of instructions to perform DI or DF move. @@ -1335,10 +1317,10 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED else if (GET_CODE (XEXP (memexp, 1)) == REG) basereg = REGNO (XEXP (memexp, 1)); else - abort (); + gcc_unreachable (); } else - abort (); + gcc_unreachable (); /* ??? length attribute is wrong here. */ if (dstreg == basereg) @@ -1365,7 +1347,7 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED else if (CONST_OK_FOR_N (INTVAL (src))) output_asm_insn ("bmaski %0,%N1", operands); else - abort (); + gcc_unreachable (); if (INTVAL (src) < 0) return "bmaski %R0,32"; @@ -1383,7 +1365,7 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED else if (CONST_OK_FOR_N (INTVAL (src))) output_asm_insn ("bmaski %R0,%N1", operands); else - abort (); + gcc_unreachable (); if (INTVAL (src) < 0) return "bmaski %0,32"; @@ -1392,130 +1374,16 @@ mcore_output_movedouble (rtx operands[], enum machine_mode mode ATTRIBUTE_UNUSED } } else - abort (); + gcc_unreachable (); } else if (GET_CODE (dst) == MEM && GET_CODE (src) == REG) return "stw\t%1,%0\n\tstw\t%R1,%R0"; else - abort (); + gcc_unreachable (); } /* Predicates used by the templates. */ -/* Nonzero if OP can be source of a simple move operation. */ - -int -mcore_general_movsrc_operand (rtx op, enum machine_mode mode) -{ - /* Any (MEM LABEL_REF) is OK. That is a pc-relative load. */ - if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == LABEL_REF) - return 1; - - return general_operand (op, mode); -} - -/* Nonzero if OP can be destination of a simple move operation. */ - -int -mcore_general_movdst_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == REG && REGNO (op) == CC_REG) - return 0; - - return general_operand (op, mode); -} - -/* Nonzero if OP is a normal arithmetic register. */ - -int -mcore_arith_reg_operand (rtx op, enum machine_mode mode) -{ - if (! register_operand (op, mode)) - return 0; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) == REG) - return REGNO (op) != CC_REG; - - return 1; -} - -/* Nonzero if OP should be recognized during reload for an ixh/ixw - operand. See the ixh/ixw patterns. */ - -int -mcore_reload_operand (rtx op, enum machine_mode mode) -{ - if (mcore_arith_reg_operand (op, mode)) - return 1; - - if (! reload_in_progress) - return 0; - - return GET_CODE (op) == MEM; -} - -/* Nonzero if OP is a valid source operand for an arithmetic insn. */ - -int -mcore_arith_J_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_J (INTVAL (op))) - return 1; - - return 0; -} - -/* Nonzero if OP is a valid source operand for an arithmetic insn. */ - -int -mcore_arith_K_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))) - return 1; - - return 0; -} - -/* Nonzero if OP is a valid source operand for a shift or rotate insn. */ - -int -mcore_arith_K_operand_not_0 (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if ( GET_CODE (op) == CONST_INT - && CONST_OK_FOR_K (INTVAL (op)) - && INTVAL (op) != 0) - return 1; - - return 0; -} - -int -mcore_arith_K_S_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT) - { - if (CONST_OK_FOR_K (INTVAL (op)) || CONST_OK_FOR_M (~INTVAL (op))) - return 1; - } - - return 0; -} - int mcore_arith_S_operand (rtx op) { @@ -1525,110 +1393,6 @@ mcore_arith_S_operand (rtx op) return 0; } -int -mcore_arith_M_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_M (INTVAL (op))) - return 1; - - return 0; -} - -/* Nonzero if OP is a valid source operand for loading. */ - -int -mcore_arith_imm_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT && const_ok_for_mcore (INTVAL (op))) - return 1; - - return 0; -} - -int -mcore_arith_any_imm_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT) - return 1; - - return 0; -} - -/* Nonzero if OP is a valid source operand for a cmov with two consts +/- 1. */ - -int -mcore_arith_O_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_O (INTVAL (op))) - return 1; - - return 0; -} - -/* Nonzero if OP is a valid source operand for a btsti. */ - -int -mcore_literal_K_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))) - return 1; - - return 0; -} - -/* Nonzero if OP is a valid source operand for an add/sub insn. */ - -int -mcore_addsub_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT) - { - return 1; - - /* The following is removed because it precludes large constants from being - returned as valid source operands for and add/sub insn. While large - constants may not directly be used in an add/sub, they may if first loaded - into a register. Thus, this predicate should indicate that they are valid, - and the constraint in mcore.md should control whether an additional load to - register is needed. (see mcore.md, addsi). -- DAC 4/2/1998 */ - /* - if (CONST_OK_FOR_J(INTVAL(op)) || CONST_OK_FOR_L(INTVAL(op))) - return 1; - */ - } - - return 0; -} - -/* Nonzero if OP is a valid source operand for a compare operation. */ - -int -mcore_compare_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0) - return 1; - - return 0; -} - /* Expand insert bit field. BRC */ int @@ -1728,87 +1492,6 @@ mcore_expand_insv (rtx operands[]) return 1; } - -/* Return 1 if OP is a load multiple operation. It is known to be a - PARALLEL and the first section will be tested. */ - -int -mcore_load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int dest_regno; - rtx src_addr; - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); - src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != SImode - || REGNO (SET_DEST (elt)) != (unsigned) (dest_regno + i) - || GET_CODE (SET_SRC (elt)) != MEM - || GET_MODE (SET_SRC (elt)) != SImode - || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) - || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != i * 4) - return 0; - } - - return 1; -} - -/* Similar, but tests for store multiple. */ - -int -mcore_store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int src_regno; - rtx dest_addr; - int i; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) - return 0; - - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); - dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_SRC (elt)) != REG - || GET_MODE (SET_SRC (elt)) != SImode - || REGNO (SET_SRC (elt)) != (unsigned) (src_regno + i) - || GET_CODE (SET_DEST (elt)) != MEM - || GET_MODE (SET_DEST (elt)) != SImode - || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) - || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != i * 4) - return 0; - } - - return 1; -} /* ??? Block move stuff stolen from m88k. This code has not been verified for correctness. */ @@ -1929,7 +1612,7 @@ mcore_expand_block_move (rtx *operands) max = 4*1; break; default: - abort (); + gcc_unreachable (); } if (bytes <= max) @@ -2164,14 +1847,7 @@ layout_mcore_frame (struct mcore_frame * infp) assert (growths <= MAX_STACK_GROWS); for (i = 0; i < growths; i++) - { - if (infp->growth[i] % STACK_BYTES) - { - fprintf (stderr,"stack growth of %d is not %d aligned\n", - infp->growth[i], STACK_BYTES); - abort (); - } - } + gcc_assert (!(infp->growth[i] % STACK_BYTES)); } /* Define the offset between two registers, one to be eliminated, and @@ -2200,9 +1876,7 @@ mcore_initial_elimination_offset (int from, int to) if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) return below_frame; - abort (); - - return 0; + gcc_unreachable (); } /* Keep track of some information about varargs for the prolog. */ @@ -2251,13 +1925,11 @@ mcore_expand_prolog (void) x = DECL_RTL (current_function_decl); - if (GET_CODE (x) != MEM) - abort (); + gcc_assert (GET_CODE (x) == MEM); x = XEXP (x, 0); - if (GET_CODE (x) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (x) == SYMBOL_REF); if (mcore_current_function_name) free (mcore_current_function_name); @@ -2981,21 +2653,9 @@ mcore_is_same_reg (rtx x, rtx y) void mcore_override_options (void) { - if (mcore_stack_increment_string) - { - mcore_stack_increment = atoi (mcore_stack_increment_string); - - if (mcore_stack_increment < 0 - || (mcore_stack_increment == 0 - && (mcore_stack_increment_string[0] != '0' - || mcore_stack_increment_string[1] != 0))) - error ("invalid option %<-mstack-increment=%s%>", - mcore_stack_increment_string); - } - /* Only the m340 supports little endian code. */ if (TARGET_LITTLE_END && ! TARGET_M340) - target_flags |= M340_BIT; + target_flags |= MASK_M340; } /* Compute the number of word sized registers needed to @@ -3022,7 +2682,7 @@ handle_structs_in_regs (enum machine_mode mode, tree type, int reg) { int size; - /* The MCore ABI defines that a structure whoes size is not a whole multiple + /* The MCore ABI defines that a structure whose size is not a whole multiple of bytes is passed packed into registers (or spilled onto the stack if not enough registers are available) with the last few bytes of the structure being packed, left-justified, into the last register/stack slot. @@ -3183,13 +2843,10 @@ mcore_mark_dllexport (tree decl) rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if ( GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (mcore_dllexport_name_p (oldname)) return; /* Already done. */ @@ -3221,17 +2878,13 @@ mcore_mark_dllimport (tree decl) rtlname = XEXP (DECL_RTL (decl), 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if ( GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); - if (mcore_dllexport_name_p (oldname)) - abort (); /* This shouldn't happen. */ - else if (mcore_dllimport_name_p (oldname)) + gcc_assert (!mcore_dllexport_name_p (oldname)); + if (mcore_dllimport_name_p (oldname)) return; /* Already done. */ /* ??? One can well ask why we're making these checks here, @@ -3376,7 +3029,7 @@ mcore_handle_naked_attribute (tree * node, tree name, tree args ATTRIBUTE_UNUSED } else { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/mcore/mcore.h b/gcc/config/mcore/mcore.h index 4f68c632300..2e2d8656c1f 100644 --- a/gcc/config/mcore/mcore.h +++ b/gcc/config/mcore/mcore.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for Motorola M*CORE Processor. - Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -66,105 +66,26 @@ #undef LINK_SPEC #define LINK_SPEC "%{mbig-endian:-EB} %{m210:-EB} -X" -/* Can only count on 16 bits of availability; change to long would affect - many architecture specific files (other architectures...). */ -extern int target_flags; - -#define HARDLIT_BIT (1 << 0) /* Build in-line literals using 2 insns. */ -#define ALIGN8_BIT (1 << 1) /* Max alignment goes to 8 instead of 4. */ -#define DIV_BIT (1 << 2) /* Generate divide instructions. */ -#define RELAX_IMM_BIT (1 << 3) /* Arbitrary immediates in and, or, tst. */ -#define W_FIELD_BIT (1 << 4) /* Generate bit insv/extv using SImode. */ -#define OVERALIGN_FUNC_BIT (1 << 5) /* Align functions to 4 byte boundary. */ -#define CGDATA_BIT (1 << 6) /* Generate callgraph data. */ -#define SLOW_BYTES_BIT (1 << 7) /* Slow byte access. */ -#define LITTLE_END_BIT (1 << 8) /* Generate little endian code. */ -#define M340_BIT (1 << 9) /* Generate code for the m340. */ - -#define TARGET_DEFAULT \ - (HARDLIT_BIT | ALIGN8_BIT | DIV_BIT | RELAX_IMM_BIT | M340_BIT | LITTLE_END_BIT) +#define TARGET_DEFAULT \ + (MASK_HARDLIT \ + | MASK_8ALIGN \ + | MASK_DIV \ + | MASK_RELAX_IMM \ + | MASK_M340 \ + | MASK_LITTLE_END) #ifndef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS { "mlittle-endian", "m340" } #endif -#define TARGET_HARDLIT (target_flags & HARDLIT_BIT) /* The ability to have 4 byte alignment is being suppressed for now. - If this ability is reenabled, you must enable the definition below + If this ability is reenabled, you must disable the definition below *and* edit t-mcore to enable multilibs for 4 byte alignment code. */ -#if 0 -#define TARGET_8ALIGN (target_flags & ALIGN8_BIT) -#else -#define TARGET_8ALIGN 1 -#endif -#define TARGET_DIV (target_flags & DIV_BIT) -#define TARGET_RELAX_IMM (target_flags & RELAX_IMM_BIT) -#define TARGET_W_FIELD (target_flags & W_FIELD_BIT) -#define TARGET_OVERALIGN_FUNC (target_flags & OVERALIGN_FUNC_BIT) -#define TARGET_CG_DATA (target_flags & CGDATA_BIT) -#define TARGET_CG_DATA (target_flags & CGDATA_BIT) -#define TARGET_SLOW_BYTES (target_flags & SLOW_BYTES_BIT) -#define TARGET_LITTLE_END (target_flags & LITTLE_END_BIT) -#define TARGET_M340 (target_flags & M340_BIT) - - -#define TARGET_SWITCHES \ -{ {"hardlit", HARDLIT_BIT, \ - N_("Inline constants if it can be done in 2 insns or less") }, \ - {"no-hardlit", - HARDLIT_BIT, \ - N_("Inline constants if it only takes 1 instruction") }, \ - {"4align", - ALIGN8_BIT, \ - N_("Set maximum alignment to 4") }, \ - {"8align", ALIGN8_BIT, \ - N_("Set maximum alignment to 8") }, \ - {"div", DIV_BIT, \ - "" }, \ - {"no-div", - DIV_BIT, \ - N_("Do not use the divide instruction") }, \ - {"relax-immediates", RELAX_IMM_BIT, \ - "" }, \ - {"no-relax-immediates", - RELAX_IMM_BIT, \ - N_("Do not arbitrary sized immediates in bit operations") }, \ - {"wide-bitfields", W_FIELD_BIT, \ - N_("Always treat bit-field as int-sized") }, \ - {"no-wide-bitfields", - W_FIELD_BIT, \ - "" }, \ - {"4byte-functions", OVERALIGN_FUNC_BIT, \ - N_("Force functions to be aligned to a 4 byte boundary") }, \ - {"no-4byte-functions", - OVERALIGN_FUNC_BIT, \ - N_("Force functions to be aligned to a 2 byte boundary") }, \ - {"callgraph-data", CGDATA_BIT, \ - N_("Emit call graph information") }, \ - {"no-callgraph-data", - CGDATA_BIT, \ - "" }, \ - {"slow-bytes", SLOW_BYTES_BIT, \ - N_("Prefer word accesses over byte accesses") }, \ - {"no-slow-bytes", - SLOW_BYTES_BIT, \ - "" }, \ - { "no-lsim", 0, "" }, \ - {"little-endian", LITTLE_END_BIT, \ - N_("Generate little endian code") }, \ - {"big-endian", - LITTLE_END_BIT, \ - "" }, \ - {"210", - M340_BIT, \ - "" }, \ - {"340", M340_BIT, \ - N_("Generate code for the M*Core M340") }, \ - {"", TARGET_DEFAULT, \ - "" } \ -} +#undef TARGET_8ALIGN +#define TARGET_8ALIGN 1 extern char * mcore_current_function_name; -/* Target specific options (as opposed to the switches above). */ -extern const char * mcore_stack_increment_string; - -#define TARGET_OPTIONS \ -{ \ - {"stack-increment=", & mcore_stack_increment_string, \ - N_("Maximum amount for a single stack increment operation"), 0} \ -} - /* The MCore ABI says that bitfields are unsigned by default. */ #define CC1_SPEC "-funsigned-bitfields" @@ -189,7 +110,7 @@ extern const char * mcore_stack_increment_string; } \ if (SIZE) \ { \ - target_flags &= ~ HARDLIT_BIT; \ + target_flags &= ~MASK_HARDLIT; \ } \ } @@ -964,7 +885,7 @@ switch_to_section (enum in_section section, tree decl) \ case in_data: data_section (); break; \ case in_named: named_section (decl, NULL, 0); break; \ SUBTARGET_SWITCH_SECTIONS \ - default: abort (); break; \ + default: gcc_unreachable (); \ } \ } @@ -1126,24 +1047,4 @@ extern long mcore_current_compilation_timestamp; #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \ ((CHAR)=='.' || (CHAR) == '#' || (CHAR) == '*' || (CHAR) == '^' || (CHAR) == '!') -#define PREDICATE_CODES \ - { "mcore_arith_reg_operand", { REG, SUBREG }}, \ - { "mcore_general_movsrc_operand", { MEM, CONST_INT, REG, SUBREG }},\ - { "mcore_general_movdst_operand", { MEM, CONST_INT, REG, SUBREG }},\ - { "mcore_reload_operand", { MEM, REG, SUBREG }}, \ - { "mcore_arith_J_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_K_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_K_operand_not_0", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_M_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_K_S_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_O_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_imm_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_arith_any_imm_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_literal_K_operand", { CONST_INT }}, \ - { "mcore_addsub_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_compare_operand", { CONST_INT, REG, SUBREG }}, \ - { "mcore_load_multiple_operation", { PARALLEL }}, \ - { "mcore_store_multiple_operation", { PARALLEL }}, \ - { "mcore_call_address_operand", { REG, SUBREG, CONST_INT }}, \ - #endif /* ! GCC_MCORE_H */ diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md index ab3ce8aff68..e79f80bc94f 100644 --- a/gcc/config/mcore/mcore.md +++ b/gcc/config/mcore/mcore.md @@ -1,5 +1,6 @@ ;; Machine description the Motorola MCore -;; Copyright (C) 1993, 1999, 2000, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1999, 2000, 2004, 2005 +;; Free Software Foundation, Inc. ;; Contributed by Motorola. ;; This file is part of GCC. @@ -53,6 +54,8 @@ (eq_attr "type" "load") "nothing") +(include "predicates.md") + ;; ------------------------------------------------------------------------- ;; Test and bit test ;; ------------------------------------------------------------------------- @@ -381,7 +384,7 @@ case 2: return \"and %0,%1\"; /* case -1: return \"bclri %0,%Q2\"; will not happen */ case 3: return mcore_output_bclri (operands[0], INTVAL (operands[2])); - default: abort (); + default: gcc_unreachable (); } }") @@ -401,7 +404,7 @@ case 1: return \"andi %0,%2\"; case 2: return \"and %0,%1\"; case 3: return mcore_output_bclri (operands[0], INTVAL (operands[2])); - default: abort (); + default: gcc_unreachable (); } }") @@ -436,7 +439,7 @@ case 0: return \"or %0,%2\"; case 1: return \"bseti %0,%P2\"; case 2: return mcore_output_bseti (operands[0], INTVAL (operands[2])); - default: abort (); + default: gcc_unreachable (); } }") @@ -452,7 +455,7 @@ case 0: return \"or %0,%2\"; case 1: return \"bseti %0,%P2\"; case 2: return mcore_output_bseti (operands[0], INTVAL (operands[2])); - default: abort (); + default: gcc_unreachable (); } }") @@ -925,8 +928,7 @@ && INTVAL (operands[2]) > 0 && ! (INTVAL (operands[2]) & 0x80000000)" "* { - if (GET_MODE (operands[2]) != SImode) - abort (); + gcc_assert (GET_MODE (operands[2]) == SImode); if (TARGET_LITTLE_END) return \"addu %0,%2\;cmphs %0,%2\;incf %R0\"; return \"addu %R0,%2\;cmphs %R0,%2\;incf %0\"; @@ -3069,7 +3071,7 @@ else if ((ofs = mcore_halfword_offset (INTVAL (operands[3]))) > -1) mode = HImode; else - abort (); + gcc_unreachable (); if (ofs > 0) operands[4] = gen_rtx_MEM (mode, @@ -3145,15 +3147,14 @@ return \"btsti %1,%2\\n\\tmovt %0,%4\"; } - abort (); + gcc_unreachable (); } else if (GET_CODE (operands[3]) == CONST_INT && INTVAL (operands[3]) == 0 && GET_CODE (operands[4]) == REG) return \"btsti %1,%2\\n\\tclrt %0\"; - abort (); - return \"\"; + gcc_unreachable (); }") ; experimental - do the constant folding ourselves. note that this isn't diff --git a/gcc/config/mcore/mcore.opt b/gcc/config/mcore/mcore.opt new file mode 100644 index 00000000000..75538796e24 --- /dev/null +++ b/gcc/config/mcore/mcore.opt @@ -0,0 +1,80 @@ +; Options for the Motorola MCore port of the compiler. + +; Copyright (C) 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. + +m210 +Target RejectNegative Report InverseMask(M340) +Generate code for the M*Core M210 + +m340 +Target RejectNegative Report Mask(M340) +Generate code for the M*Core M340 + +m4align +Target RejectNegative Report InverseMask(8ALIGN) +Set maximum alignment to 4 + +m4byte-functions +Target Report Mask(OVERALIGN_FUNC) +Force functions to be aligned to a 4 byte boundary + +m8align +Target RejectNegative Report Mask(8ALIGN) +Set maximum alignment to 8 + +mbig-endian +Target RejectNegative Report InverseMask(LITTLE_END) +Generate big-endian code + +mcallgraph-data +Target Report Mask(CG_DATA) +Emit call graph information + +mdiv +Target Report Mask(DIV) +Use the divide instruction + +mhardlit +Target Report Mask(HARDLIT) +Inline constants if it can be done in 2 insns or less + +mlittle-endian +Target RejectNegative Report Mask(LITTLE_END) +Generate little-endian code + +; Not used by the compiler proper. +mno-lsim +Target RejectNegative Undocumented + +mrelax-immediates +Target Report Mask(RELAX_IMM) +Use arbitrary sized immediates in bit operations + +mslow-bytes +Target Report Mask(SLOW_BYTES) +Prefer word accesses over byte accesses + +mstack-increment= +Target RejectNegative Joined UInteger Var(mcore_stack_increment) VarExists +Set the maximum amount for a single stack increment operation + +mwide-bitfields +Target Report Mask(W_FIELD) +Always treat bitfields as int-sized diff --git a/gcc/config/mcore/predicates.md b/gcc/config/mcore/predicates.md new file mode 100644 index 00000000000..59f43c9a452 --- /dev/null +++ b/gcc/config/mcore/predicates.md @@ -0,0 +1,333 @@ +;; Predicate definitions for Motorola MCore. +;; Copyright (C) 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. + +;; Nonzero if OP is a normal arithmetic register. + +(define_predicate "mcore_arith_reg_operand" + (match_code "reg,subreg") +{ + if (! register_operand (op, mode)) + return 0; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) == REG) + return REGNO (op) != CC_REG; + + return 1; +}) + +;; Nonzero if OP can be source of a simple move operation. + +(define_predicate "mcore_general_movsrc_operand" + (match_code "mem,const_int,reg,subreg,symbol_ref,label_ref") +{ + /* Any (MEM LABEL_REF) is OK. That is a pc-relative load. */ + if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == LABEL_REF) + return 1; + + return general_operand (op, mode); +}) + +;; Nonzero if OP can be destination of a simple move operation. + +(define_predicate "mcore_general_movdst_operand" + (match_code "mem,const_int,reg,subreg") +{ + if (GET_CODE (op) == REG && REGNO (op) == CC_REG) + return 0; + + return general_operand (op, mode); +}) + +;; Nonzero if OP should be recognized during reload for an ixh/ixw +;; operand. See the ixh/ixw patterns. + +(define_predicate "mcore_reload_operand" + (match_code "mem,reg,subreg") +{ + if (mcore_arith_reg_operand (op, mode)) + return 1; + + if (! reload_in_progress) + return 0; + + return GET_CODE (op) == MEM; +}) + +;; Nonzero if OP is a valid source operand for an arithmetic insn. + +(define_predicate "mcore_arith_J_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_J (INTVAL (op))) + return 1; + + return 0; +}) + +;; Nonzero if OP is a valid source operand for an arithmetic insn. + +(define_predicate "mcore_arith_K_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))) + return 1; + + return 0; +}) + +;; Nonzero if OP is a valid source operand for a shift or rotate insn. + +(define_predicate "mcore_arith_K_operand_not_0" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if ( GET_CODE (op) == CONST_INT + && CONST_OK_FOR_K (INTVAL (op)) + && INTVAL (op) != 0) + return 1; + + return 0; +}) + +;; TODO: Add a comment here. + +(define_predicate "mcore_arith_M_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_M (INTVAL (op))) + return 1; + + return 0; +}) + +;; TODO: Add a comment here. + +(define_predicate "mcore_arith_K_S_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT) + { + if (CONST_OK_FOR_K (INTVAL (op)) || CONST_OK_FOR_M (~INTVAL (op))) + return 1; + } + + return 0; +}) + +;; Nonzero if OP is a valid source operand for a cmov with two consts +;; +/- 1. + +(define_predicate "mcore_arith_O_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_O (INTVAL (op))) + return 1; + + return 0; +}) + +;; Nonzero if OP is a valid source operand for loading. + +(define_predicate "mcore_arith_imm_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT && const_ok_for_mcore (INTVAL (op))) + return 1; + + return 0; +}) + +;; TODO: Add a comment here. + +(define_predicate "mcore_arith_any_imm_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT) + return 1; + + return 0; +}) + +;; Nonzero if OP is a valid source operand for a btsti. + +(define_predicate "mcore_literal_K_operand" + (match_code "const_int") +{ + if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_K (INTVAL (op))) + return 1; + + return 0; +}) + +;; Nonzero if OP is a valid source operand for an add/sub insn. + +(define_predicate "mcore_addsub_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT) + { + return 1; + + /* The following is removed because it precludes large constants from being + returned as valid source operands for and add/sub insn. While large + constants may not directly be used in an add/sub, they may if first loaded + into a register. Thus, this predicate should indicate that they are valid, + and the constraint in mcore.md should control whether an additional load to + register is needed. (see mcore.md, addsi). -- DAC 4/2/1998 */ + /* + if (CONST_OK_FOR_J(INTVAL(op)) || CONST_OK_FOR_L(INTVAL(op))) + return 1; + */ + } + + return 0; +}) + +;; Nonzero if OP is a valid source operand for a compare operation. + +(define_predicate "mcore_compare_operand" + (match_code "const_int,reg,subreg") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0) + return 1; + + return 0; +}) + +;; Return 1 if OP is a load multiple operation. It is known to be a +;; PARALLEL and the first section will be tested. + +(define_predicate "mcore_load_multiple_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int dest_regno; + rtx src_addr; + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) + return 0; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); + src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != SImode + || REGNO (SET_DEST (elt)) != (unsigned) (dest_regno + i) + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != SImode + || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) + || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) != i * 4) + return 0; + } + + return 1; +}) + +;; Similar, but tests for store multiple. + +(define_predicate "mcore_store_multiple_operation" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int src_regno; + rtx dest_addr; + int i; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) + return 0; + + src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); + dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != SImode + || REGNO (SET_SRC (elt)) != (unsigned) (src_regno + i) + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != SImode + || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) + || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) != i * 4) + return 0; + } + + return 1; +}) + +;; TODO: Add a comment here. + +(define_predicate "mcore_call_address_operand" + (match_code "reg,subreg,const_int,symbol_ref") +{ + return register_operand (op, mode) || CONSTANT_P (op); +}) diff --git a/gcc/config/mips/24k.md b/gcc/config/mips/24k.md new file mode 100644 index 00000000000..c558fa3c7a9 --- /dev/null +++ b/gcc/config/mips/24k.md @@ -0,0 +1,455 @@ +;; DFA-based pipeline descriptions for MIPS Technologies 24K core. +;; Contributed by Chao-ying Fu (fu@mips.com), Nigel Stephens (nigel@mips.com) +;; and David Ung (davidu@mips.com) +;; +;; The 24K is a single-issue processor with a half-clocked fpu. +;; The 24Kx is 24k with 1:1 clocked fpu. +;; +;; References: +;; "MIPS32 24K Processor Core Family Software User's Manual, Rev 3.04." +;; +;; Copyright (C) 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. + +(define_automaton "r24k_cpu, r24k_mdu, r24k_fpu") + +;; Integer execution unit. +(define_cpu_unit "r24k_iss" "r24k_cpu") +(define_cpu_unit "r24k_ixu_arith" "r24k_cpu") +(define_cpu_unit "r24k_mul3a" "r24k_mdu") +(define_cpu_unit "r24k_mul3b" "r24k_mdu") +(define_cpu_unit "r24k_mul3c" "r24k_mdu") + +;; -------------------------------------------------------------- +;; Producers +;; -------------------------------------------------------------- + +;; 1. Loads: lb, lbu, lh, lhu, ll, lw, lwl, lwr, lwpc, lwxs +(define_insn_reservation "r24k_int_load" 2 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "load")) + "r24k_iss+r24k_ixu_arith") + + +;; 2. Arithmetic: add, addi, addiu, addiupc, addu, and, andi, clo, clz, +;; ext, ins, lui, movn, movz, nor, or, ori, rotr, rotrv, seb, seh, sll, +;; sllv, slt, slti, sltiu, sltu, sra, srav, srl, srlv, sub, subu, wsbh, +;; xor, xori +;; (movn/movz is not matched, we'll need to split condmov to +;; differentiate between integer/float moves) +(define_insn_reservation "r24k_int_arith" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "arith,const,nop,shift,slt")) + "r24k_iss+r24k_ixu_arith") + + +;; 3. Links: bgezal, bgezall, bltzal, bltzall, jal, jalr, jalx +;; 3a. jr/jalr consumer +(define_insn_reservation "r24k_int_jump" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "call,jump")) + "r24k_iss+r24k_ixu_arith") + +;; 3b. branch consumer +(define_insn_reservation "r24k_int_branch" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "branch")) + "r24k_iss+r24k_ixu_arith") + + +;; 4. MDU: fully pipelined multiplier +;; mult - delivers result to hi/lo in 1 cycle (pipelined) +(define_insn_reservation "r24k_int_mult" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "imul")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; madd, msub - delivers result to hi/lo in 1 cycle (pipelined) +(define_insn_reservation "r24k_int_madd" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "imadd")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; mul - delivers result to gpr in 5 cycles +(define_insn_reservation "r24k_int_mul3" 5 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "imul3")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)*5") + +;; mfhi, mflo, mflhxu - deliver result to gpr in 5 cycles +(define_insn_reservation "r24k_int_mfhilo" 5 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "mfhilo")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; mthi, mtlo, mtlhx - deliver result to hi/lo, thence madd, handled as bypass +(define_insn_reservation "r24k_int_mthilo" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "mthilo")) + "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)") + +;; div - default to 36 cycles for 32bit operands. Faster for 24bit, 16bit and +;; 8bit, but is tricky to identify. +(define_insn_reservation "r24k_int_div" 36 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "idiv")) + "r24k_iss+(r24k_mul3a+r24k_mul3b+r24k_mul3c)*36") + + +;; 5. Cop: cfc1, di, ei, mfc0, mtc0 +;; (Disabled until we add proper cop0 support) +;;(define_insn_reservation "r24k_int_cop" 3 +;; (and (eq_attr "cpu" "24k,24kx") +;; (eq_attr "type" "cop0")) +;; "r24k_iss+r24k_ixu_arith") + + +;; 6. Store +(define_insn_reservation "r24k_int_store" 1 + (and (eq_attr "cpu" "24k,24kx") + (and (eq_attr "type" "store") + (eq_attr "mode" "!unknown"))) + "r24k_iss+r24k_ixu_arith") + +;; 6.1 Special case - matches the cprestore pattern which don't set the mode +;; attrib. This avoids being set as r24k_int_store and have it checked +;; against store_data_bypass_p, which would then fail because cprestore +;; does not have a normal SET pattern. +(define_insn_reservation "r24k_unknown_store" 1 + (and (eq_attr "cpu" "24k,24kx") + (and (eq_attr "type" "store") + (eq_attr "mode" "unknown"))) + "r24k_iss+r24k_ixu_arith") + + +;; 7. Multiple instructions +(define_insn_reservation "r24k_int_multi" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "multi")) + "r24k_iss+r24k_ixu_arith+r24k_fpu_arith+(r24k_mul3a+r24k_mul3b+r24k_mul3c)") + + +;; 8. Unknowns - Currently these include blockage, consttable and alignment +;; rtls. They do not really affect scheduling latency, (blockage affects +;; scheduling via log links, but not used here). +(define_insn_reservation "r24k_int_unknown" 0 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "unknown")) + "r24k_iss") + + +;; 9. Prefetch +(define_insn_reservation "r24k_int_prefetch" 1 + (and (eq_attr "cpu" "24k,24kx") + (eq_attr "type" "prefetch,prefetchx")) + "r24k_iss+r24k_ixu_arith") + + +;; -------------------------------------------------------------- +;; Bypass to Consumer +;; -------------------------------------------------------------- + +;; load->next use : 2 cycles (Default) +;; load->load base: 3 cycles +;; load->store base: 3 cycles +;; load->prefetch: 3 cycles +(define_bypass 3 "r24k_int_load" "r24k_int_load") +(define_bypass 3 "r24k_int_load" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 3 "r24k_int_load" "r24k_int_prefetch") + +;; arith->next use : 1 cycles (Default) +;; arith->load base: 2 cycles +;; arith->store base: 2 cycles +;; arith->prefetch: 2 cycles +(define_bypass 2 "r24k_int_arith" "r24k_int_load") +(define_bypass 2 "r24k_int_arith" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 2 "r24k_int_arith" "r24k_int_prefetch") + +;; mul3->next use : 5 cycles (default) +;; mul3->l/s base : 6 cycles +;; mul3->prefetch : 6 cycles +(define_bypass 6 "r24k_int_mul3" "r24k_int_load") +(define_bypass 6 "r24k_int_mul3" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 6 "r24k_int_mul3" "r24k_int_prefetch") + +;; mfhilo->next use : 5 cycles (default) +;; mfhilo->l/s base : 6 cycles +;; mfhilo->prefetch : 6 cycles +;; mthilo->madd/msub : 2 cycle (only for mthi/lo not mfhi/lo) +(define_bypass 6 "r24k_int_mfhilo" "r24k_int_load") +(define_bypass 6 "r24k_int_mfhilo" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 6 "r24k_int_mfhilo" "r24k_int_prefetch") +(define_bypass 2 "r24k_int_mthilo" "r24k_int_madd") + +;; cop->next use : 3 cycles (Default) +;; cop->l/s base : 4 cycles +;; (define_bypass 4 "r24k_int_cop" "r24k_int_load") +;; (define_bypass 4 "r24k_int_cop" "r24k_int_store" "!store_data_bypass_p") + +;; multi->next use : 1 cycles (Default) +;; multi->l/s base : 2 cycles +;; multi->prefetch : 2 cycles +(define_bypass 2 "r24k_int_multi" "r24k_int_load") +(define_bypass 2 "r24k_int_multi" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 2 "r24k_int_multi" "r24k_int_prefetch") + + +;; -------------------------------------------------------------- +;; Floating Point Instructions +;; -------------------------------------------------------------- + +(define_cpu_unit "r24k_fpu_arith" "r24k_fpu") + +;; The 24k is a single issue cpu, and the fpu runs at half clock speed, +;; so each fpu instruction ties up the shared instruction scheduler for +;; 1 cycle, and the fpu scheduler for 2 cycles. +;; +;; These timings are therefore twice the values in the 24K manual, +;; which are quoted in fpu clocks. +;; +;; The 24kx is a 24k configured with 1:1 cpu and fpu, so use +;; the unscaled timings + +(define_reservation "r24k_fpu_iss" "r24k_iss+(r24k_fpu_arith*2)") + +;; fadd, fabs, fneg +(define_insn_reservation "r24k_fadd" 8 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fadd,fabs,fneg")) + "r24k_fpu_iss") + +;; fmove, fcmove +(define_insn_reservation "r24k_fmove" 8 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fmove,condmove")) + "r24k_fpu_iss") + +;; fload +(define_insn_reservation "r24k_fload" 6 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fpload,fpidxload")) + "r24k_fpu_iss") + +;; fstore +(define_insn_reservation "r24k_fstore" 2 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fpstore")) + "r24k_fpu_iss") + +;; fmul, fmadd +(define_insn_reservation "r24k_fmul_sf" 8 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "r24k_fpu_iss") + +(define_insn_reservation "r24k_fmul_df" 10 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "r24k_fpu_iss,(r24k_fpu_arith*2)") + + +;; fdiv, fsqrt, frsqrt +(define_insn_reservation "r24k_fdiv_sf" 34 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "r24k_fpu_iss,(r24k_fpu_arith*26)") + +(define_insn_reservation "r24k_fdiv_df" 64 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fdiv,fsqrt") + (eq_attr "mode" "DF"))) + "r24k_fpu_iss,(r24k_fpu_arith*56)") + +;; frsqrt +(define_insn_reservation "r24k_frsqrt_df" 70 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "r24k_fpu_iss,(r24k_fpu_arith*60)") + +;; fcmp +(define_insn_reservation "r24k_fcmp" 4 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "fcmp")) + "r24k_fpu_iss") + +;; fcmp -> movf.fmt & movt.fmt bypass (dependency must be on the condition) +(define_bypass 2 "r24k_fcmp" "r24k_fmove") + +;; fcvt (cvt.d.s, cvt.[sd].[wl]) +(define_insn_reservation "r24k_fcvt_i2f_s2d" 8 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "I2S,I2D,S2D"))) + "r24k_fpu_iss") + +;; fcvt (cvt.s.d) +(define_insn_reservation "r24k_fcvt_s2d" 12 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "D2S"))) + "r24k_fpu_iss") + +;; fcvt (cvt.[wl].[sd], etc) +(define_insn_reservation "r24k_fcvt_f2i" 10 + (and (eq_attr "cpu" "24k") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "S2I,D2I"))) + "r24k_fpu_iss") + +;; fxfer (mfc1, mfhc1, mtc1, mthc1) +(define_insn_reservation "r24k_fxfer" 4 + (and (eq_attr "cpu" "24k") + (eq_attr "type" "xfer")) + "r24k_fpu_iss") + +;; -------------------------------------------------------------- +;; Bypass to Consumer +;; -------------------------------------------------------------- +;; r24k_fcvt_f2i->l/s base : 11 cycles +;; r24k_fcvt_f2i->prefetch : 11 cycles +(define_bypass 11 "r24k_fcvt_f2i" "r24k_int_load") +(define_bypass 11 "r24k_fcvt_f2i" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 11 "r24k_fcvt_f2i" "r24k_int_prefetch") + +;; r24k_fxfer->l/s base : 5 cycles +;; r24k_fxfer->prefetch : 5 cycles +(define_bypass 5 "r24k_fxfer" "r24k_int_load") +(define_bypass 5 "r24k_fxfer" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 5 "r24k_fxfer" "r24k_int_prefetch") + +;; -------------------------------------------------------------- +;; The 24kx is a 24k configured with 1:1 cpu and fpu, so use +;; the unscaled timings +;; -------------------------------------------------------------- + +(define_reservation "r24kx_fpu_iss" "r24k_iss+r24k_fpu_arith") + +;; fadd, fabs, fneg +(define_insn_reservation "r24kx_fadd" 4 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fadd,fabs,fneg")) + "r24kx_fpu_iss") + +;; fmove, fcmove +(define_insn_reservation "r24kx_fmove" 4 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fmove,condmove")) + "r24kx_fpu_iss") + +;; fload +(define_insn_reservation "r24kx_fload" 3 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fpload,fpidxload")) + "r24kx_fpu_iss") + +;; fstore +(define_insn_reservation "r24kx_fstore" 1 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fpstore")) + "r24kx_fpu_iss") + +;; fmul, fmadd +(define_insn_reservation "r24kx_fmul_sf" 4 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "r24kx_fpu_iss") + +(define_insn_reservation "r24kx_fmul_df" 5 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "r24kx_fpu_iss,r24k_fpu_arith") + + +;; fdiv, fsqrt, frsqrt +(define_insn_reservation "r24kx_fdiv_sf" 17 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fdiv,fsqrt,frsqrt") + (eq_attr "mode" "SF"))) + "r24kx_fpu_iss,(r24k_fpu_arith*13)") + +(define_insn_reservation "r24kx_fdiv_df" 32 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fdiv,fsqrt") + (eq_attr "mode" "DF"))) + "r24kx_fpu_iss,(r24k_fpu_arith*28)") + +;; frsqrt +(define_insn_reservation "r24kx_frsqrt_df" 35 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "r24kx_fpu_iss,(r24k_fpu_arith*30)") + +;; fcmp +(define_insn_reservation "r24kx_fcmp" 2 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "fcmp")) + "r24kx_fpu_iss") + +;; fcmp -> movf.fmt & movt.fmt bypass (dependency must be on the condition) +(define_bypass 1 "r24kx_fcmp" "r24kx_fmove") + +;; fcvt (cvt.d.s, cvt.[sd].[wl]) +(define_insn_reservation "r24kx_fcvt_i2f_s2d" 4 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "I2S,I2D,S2D"))) + "r24kx_fpu_iss") + +;; fcvt (cvt.s.d) +(define_insn_reservation "r24kx_fcvt_s2d" 6 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "D2S"))) + "r24kx_fpu_iss") + +;; fcvt (cvt.[wl].[sd], etc) +(define_insn_reservation "r24kx_fcvt_f2i" 5 + (and (eq_attr "cpu" "24kx") + (and (eq_attr "type" "fcvt") + (eq_attr "cnv_mode" "S2I,D2I"))) + "r24kx_fpu_iss") + +;; fxfer (mfc1, mfhc1, mtc1, mthc1) +(define_insn_reservation "r24kx_fxfer" 2 + (and (eq_attr "cpu" "24kx") + (eq_attr "type" "xfer")) + "r24kx_fpu_iss") + +;; -------------------------------------------------------------- +;; Bypass to Consumer +;; -------------------------------------------------------------- +;; r24kx_fcvt_f2i->l/s base : 6 cycles +;; r24kx_fcvt_f2i->prefetch : 6 cycles +(define_bypass 6 "r24kx_fcvt_f2i" "r24k_int_load") +(define_bypass 6 "r24kx_fcvt_f2i" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 6 "r24kx_fcvt_f2i" "r24k_int_prefetch") + +;; r24kx_fxfer->l/s base : 3 cycles +;; r24kx_fxfer->prefetch : 3 cycles +(define_bypass 3 "r24kx_fxfer" "r24k_int_load") +(define_bypass 3 "r24kx_fxfer" "r24k_int_store" "!store_data_bypass_p") +(define_bypass 3 "r24kx_fxfer" "r24k_int_prefetch") + diff --git a/gcc/config/mips/3000.md b/gcc/config/mips/3000.md index f9a829175d4..d1ba72a6f04 100644 --- a/gcc/config/mips/3000.md +++ b/gcc/config/mips/3000.md @@ -1,5 +1,5 @@ ;; R3000 and TX39 pipeline description. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -29,7 +29,7 @@ (define_insn_reservation "r3k_imul" 12 (and (eq_attr "cpu" "r3000,r3900") - (eq_attr "type" "imul,imadd")) + (eq_attr "type" "imul,imul3,imadd")) "imuldiv*12") (define_insn_reservation "r3k_idiv" 35 diff --git a/gcc/config/mips/4000.md b/gcc/config/mips/4000.md index 97149a55fc8..231349ec697 100644 --- a/gcc/config/mips/4000.md +++ b/gcc/config/mips/4000.md @@ -1,5 +1,5 @@ ;; R4000 pipeline description. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -24,7 +24,7 @@ (define_insn_reservation "r4k_imul" 10 (and (eq_attr "cpu" "r4000") - (eq_attr "type" "imul,imadd")) + (eq_attr "type" "imul,imul3,imadd")) "imuldiv*10") (define_insn_reservation "r4k_idiv" 69 diff --git a/gcc/config/mips/4100.md b/gcc/config/mips/4100.md index 2a0dcddaf6a..8e415b41276 100644 --- a/gcc/config/mips/4100.md +++ b/gcc/config/mips/4100.md @@ -1,5 +1,5 @@ ;; VR4100 and VR4120 pipeline description. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -29,13 +29,13 @@ (define_insn_reservation "r4100_imul_si" 1 (and (eq_attr "cpu" "r4100,r4120") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "SI"))) "imuldiv") (define_insn_reservation "r4100_imul_di" 4 (and (eq_attr "cpu" "r4100,r4120") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "DI"))) "imuldiv*4") diff --git a/gcc/config/mips/4130.md b/gcc/config/mips/4130.md index eddc405de34..6feeab38bbf 100644 --- a/gcc/config/mips/4130.md +++ b/gcc/config/mips/4130.md @@ -55,7 +55,7 @@ (cond [(eq_attr "type" "load,store") (const_string "mem") - (eq_attr "type" "mfhilo,mthilo,imul,imadd,idiv") + (eq_attr "type" "mfhilo,mthilo,imul,imul3,imadd,idiv") (const_string "mul")] (const_string "alu"))) @@ -95,7 +95,7 @@ ;; use "mtlo; macc" instead of "mult; mflo". (define_insn_reservation "vr4130_mulsi" 4 (and (eq_attr "cpu" "r4130") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "SI"))) "vr4130_muldiv + (vr4130_mulpre * 2)") @@ -103,7 +103,7 @@ ;; after 3 cycles. (define_insn_reservation "vr4130_muldi" 6 (and (eq_attr "cpu" "r4130") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "DI"))) "(vr4130_muldiv * 3) + (vr4130_mulpre * 4)") diff --git a/gcc/config/mips/4300.md b/gcc/config/mips/4300.md index d663f16d6fb..fc4d30bf490 100644 --- a/gcc/config/mips/4300.md +++ b/gcc/config/mips/4300.md @@ -1,5 +1,5 @@ ;; VR4300 pipeline description. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -29,13 +29,13 @@ (define_insn_reservation "r4300_imul_si" 5 (and (eq_attr "cpu" "r4300") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "SI"))) "imuldiv*5") (define_insn_reservation "r4300_imul_di" 8 (and (eq_attr "cpu" "r4300") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "DI"))) "imuldiv*8") diff --git a/gcc/config/mips/4600.md b/gcc/config/mips/4600.md index 58b309959d7..3644b454741 100644 --- a/gcc/config/mips/4600.md +++ b/gcc/config/mips/4600.md @@ -1,5 +1,5 @@ ;; R4600 and R4650 pipeline description. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -27,7 +27,7 @@ (define_insn_reservation "r4600_imul" 10 (and (eq_attr "cpu" "r4600") - (eq_attr "type" "imul,imadd")) + (eq_attr "type" "imul,imul3,imadd")) "imuldiv*10") (define_insn_reservation "r4600_idiv" 42 @@ -38,7 +38,7 @@ (define_insn_reservation "r4650_imul" 4 (and (eq_attr "cpu" "r4650") - (eq_attr "type" "imul,imadd")) + (eq_attr "type" "imul,imul3,imadd")) "imuldiv*4") (define_insn_reservation "r4650_idiv" 36 diff --git a/gcc/config/mips/4k.md b/gcc/config/mips/4k.md new file mode 100644 index 00000000000..a580c9e778a --- /dev/null +++ b/gcc/config/mips/4k.md @@ -0,0 +1,154 @@ +;; DFA-based pipeline descriptions for MIPS32 4K processor family +;; Contributed by Nigel Stephens (nigel@mips.com) +;; and David Ung (davidu@mips.com) +;; +;; References: +;; "MIPS32 4K Processor Core Family Software User's Manual, +;; Doc no: MD00016, Rev 1.18, Nov 15, 2004." +;; +;; 4Kc - pipelined multiplier and translation lookaside buffer (TLB) +;; 4km - pipelined multiplier and block address translator (BAT) +;; 4kp - non-pipelined multiplier and block address translator (BAT) +;; +;; Copyright (C) 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. + +(define_automaton "r4k_cpu, r4k_mdu") + +;; Integer execution unit. +(define_cpu_unit "r4k_ixu_arith" "r4k_cpu") +(define_cpu_unit "r4k_ixu_mpydiv" "r4k_mdu") + +(define_insn_reservation "r4k_int_load" 2 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "load")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_prefetch" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "prefetch")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_store" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "store")) + "r4k_ixu_arith") + +;; 4Kc/4Km +;; unsigned divide - 8/16/24/32 bit operand have latencies 9/17/25/33 +;; signed divide - 8/16/24/32 bit operand have latencies 10/18/26/34 +(define_insn_reservation "r4k_idiv_4kc" 34 + (and (eq_attr "cpu" "4kc") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "!DI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*34)") + +;; 4Kp +;; unsigned divide - 33 +;; signed divide - 33-35 +(define_insn_reservation "r4k_idiv_4kp" 35 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "!DI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*35)") + +;; 4Kc/4Km fast 32x32 multiply +;; 16x32 is faster, but there's no way to detect this +(define_insn_reservation "r4k_mult_4kc" 2 + (and (eq_attr "cpu" "4kc") + (and (eq_attr "type" "imul,imadd") + (eq_attr "mode" "SI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*2)") + +;; 4Kc/4Km MUL has 2 cycle latency, but has the special property that it will +;; stall the integer unit pipeline. MUL 16x16 or 32x16 forces 1 cycle stall, +;; while MUL 32x32 forces 2 cycle stall. If next insn use the result, an +;; additional stall is forced. +(define_insn_reservation "r4k_mul_4kc" 4 + (and (eq_attr "cpu" "4kc") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "(r4k_ixu_arith+r4k_ixu_mpydiv)*3") + +;; 4Kp slow iterative 2-op MULT +;; Latency of 32 if next insn is MADD/MSUB,MFHI/MFLO. +;; Repeat rate of 33 cycles. +(define_insn_reservation "r4k_mult_4kp" 32 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "imul") + (eq_attr "mode" "SI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*32)") + +;; 4Kp slow iterative 3-op MUL +;; Latency of 32 cycles, but stalls the whole pipeline until complete. +(define_insn_reservation "r4k_mul_4kp" 32 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "(r4k_ixu_arith+r4k_ixu_mpydiv)*32") + +;; 4Kp slow iterative MADD +;; Latency of 34 if next use insn is MADD/MSUB,MFHI/MFLO. +;; Repeat rate of 35 cycles. +(define_insn_reservation "r4k_madd_4kp" 34 + (and (eq_attr "cpu" "4kp") + (and (eq_attr "type" "imadd") + (eq_attr "mode" "SI"))) + "r4k_ixu_arith+(r4k_ixu_mpydiv*34)") + +;; Move to HI/LO -> MADD/MSUB,MFHI/MFLO has a 1 cycle latency. +(define_insn_reservation "r4k_int_mthilo" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "mthilo")) + "r4k_ixu_arith+r4k_ixu_mpydiv") + +;; Move from HI/LO -> integer operation has a 2 cycle latency. +(define_insn_reservation "r4k_int_mfhilo" 2 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "mfhilo")) + "r4k_ixu_arith+r4k_ixu_mpydiv") + +;; All other integer insns. +(define_insn_reservation "r4k_int_alu" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "arith,condmove,shift,const,nop,slt")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_branch" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "branch")) + "r4k_ixu_arith") + +(define_insn_reservation "r4k_int_jump_4k" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "jump,call")) + "r4k_ixu_arith") + +;; mfcx/mtcx - non FPU +;; (Disabled until we add cop0 support) +;; (define_insn_reservation "r4k_int_cop" 2 +;; (and (eq_attr "cpu" "4kc,4kp") +;; (eq_attr "type" "cop0")) +;; "r4k_ixu_arith") + +;; Unknown or multi - single issue +(define_insn_reservation "r4k_unknown" 1 + (and (eq_attr "cpu" "4kc,4kp") + (eq_attr "type" "unknown,multi")) + "r4k_ixu_arith+r4k_ixu_mpydiv") diff --git a/gcc/config/mips/5000.md b/gcc/config/mips/5000.md index 9b02ac32942..a0d4fe179d7 100644 --- a/gcc/config/mips/5000.md +++ b/gcc/config/mips/5000.md @@ -1,5 +1,5 @@ ;; VR5000 pipeline description. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -29,13 +29,13 @@ (define_insn_reservation "r5k_imul_si" 5 (and (eq_attr "cpu" "r5000") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "SI"))) "imuldiv*5") (define_insn_reservation "r5k_imul_di" 9 (and (eq_attr "cpu" "r5000") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "DI"))) "imuldiv*9") diff --git a/gcc/config/mips/5400.md b/gcc/config/mips/5400.md index f39dc884d04..8571308c96e 100644 --- a/gcc/config/mips/5400.md +++ b/gcc/config/mips/5400.md @@ -65,19 +65,19 @@ (define_insn_reservation "ir_vr54_imul_si" 3 (and (eq_attr "cpu" "r5400") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "SI"))) "vr54_dp0|vr54_dp1") (define_insn_reservation "ir_vr54_imul_di" 4 (and (eq_attr "cpu" "r5400") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "DI"))) "vr54_dp0|vr54_dp1") (define_insn_reservation "ir_vr54_imadd_si" 3 (and (eq_attr "cpu" "r5400") - (eq_attr "type" "imul")) + (eq_attr "type" "imul,imul3")) "vr54_mac") (define_insn_reservation "ir_vr54_idiv_si" 42 diff --git a/gcc/config/mips/5500.md b/gcc/config/mips/5500.md index fbcc6f62d6e..881cbcb4cff 100644 --- a/gcc/config/mips/5500.md +++ b/gcc/config/mips/5500.md @@ -78,7 +78,7 @@ ;; latency of {mul,mult}->{mfhi,mflo}. (define_insn_reservation "ir_vr55_imul_si" 5 (and (eq_attr "cpu" "r5500") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "SI"))) "vr55_mac") @@ -91,7 +91,7 @@ ;; between it and the dmult. (define_insn_reservation "ir_vr55_imul_di" 9 (and (eq_attr "cpu" "r5500") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "DI"))) "vr55_mac*4") diff --git a/gcc/config/mips/7000.md b/gcc/config/mips/7000.md index ec75ffc96f8..a68c382c9fd 100644 --- a/gcc/config/mips/7000.md +++ b/gcc/config/mips/7000.md @@ -1,5 +1,5 @@ ;; DFA-based pipeline description for the RM7000. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -42,23 +42,23 @@ (define_cpu_unit "ixum_addsub_agen" "rm7000_other") ;; Integer execution unit (F-Pipe). -(define_cpu_unit "ixuf_addsub" "rm7000_other") -(define_cpu_unit "ixuf_branch" "rm7000_other") -(define_cpu_unit "ixuf_mpydiv" "rm7000_other") +(define_cpu_unit "ixuf_addsub" "rm7000_other") +(define_cpu_unit "ixuf_branch" "rm7000_other") +(define_cpu_unit "ixuf_mpydiv" "rm7000_other") (define_cpu_unit "ixuf_mpydiv_iter" "rm7000_idiv") ;; Floating-point unit (F-Pipe). -(define_cpu_unit "fxuf_add" "rm7000_other") -(define_cpu_unit "fxuf_mpy" "rm7000_other") +(define_cpu_unit "fxuf_add" "rm7000_other") +(define_cpu_unit "fxuf_mpy" "rm7000_other") (define_cpu_unit "fxuf_mpy_iter" "rm7000_fdiv") (define_cpu_unit "fxuf_divsqrt" "rm7000_other") (define_cpu_unit "fxuf_divsqrt_iter" "rm7000_fdiv") (exclusion_set "ixuf_addsub" "ixuf_branch,ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt") -(exclusion_set "ixuf_branch" "ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt") -(exclusion_set "ixuf_mpydiv" "fxuf_add,fxuf_mpy,fxuf_divsqrt") -(exclusion_set "fxuf_add" "fxuf_mpy,fxuf_divsqrt") -(exclusion_set "fxuf_mpy" "fxuf_divsqrt") +(exclusion_set "ixuf_branch" "ixuf_mpydiv,fxuf_add,fxuf_mpy,fxuf_divsqrt") +(exclusion_set "ixuf_mpydiv" "fxuf_add,fxuf_mpy,fxuf_divsqrt") +(exclusion_set "fxuf_add" "fxuf_mpy,fxuf_divsqrt") +(exclusion_set "fxuf_mpy" "fxuf_divsqrt") ;; After branch any insn cannot be issued. (absence_set "rm7_iss0,rm7_iss1" "ixuf_branch") @@ -67,14 +67,14 @@ ;; Define reservations for unit name mnemonics or combinations. ;; -(define_reservation "rm7_iss" "rm7_iss0|rm7_iss1") +(define_reservation "rm7_iss" "rm7_iss0|rm7_iss1") (define_reservation "rm7_single_dispatch" "rm7_iss0+rm7_iss1") (define_reservation "rm7_iaddsub" "rm7_iss+(ixum_addsub_agen|ixuf_addsub)") -(define_reservation "rm7_imem" "rm7_iss+ixum_addsub_agen") -(define_reservation "rm7_impydiv" "rm7_iss+ixuf_mpydiv") -(define_reservation "rm7_impydiv_iter" "ixuf_mpydiv_iter") -(define_reservation "rm7_branch" "rm7_iss+ixuf_branch") +(define_reservation "rm7_imem" "rm7_iss+ixum_addsub_agen") +(define_reservation "rm7_impydiv" "rm7_iss+ixuf_mpydiv") +(define_reservation "rm7_impydiv_iter" "ixuf_mpydiv_iter") +(define_reservation "rm7_branch" "rm7_iss+ixuf_branch") (define_reservation "rm7_fpadd" "rm7_iss+fxuf_add") (define_reservation "rm7_fpmpy" "rm7_iss+fxuf_mpy") @@ -87,123 +87,129 @@ ;; (define_insn_reservation "rm7_int_other" 1 - (and (eq_attr "cpu" "r7000") - (eq_attr "type" "arith,shift,slt,clz,const,condmove,nop,trap")) - "rm7_iaddsub") - -(define_insn_reservation "rm7_ld" 2 (and (eq_attr "cpu" "r7000") - (eq_attr "type" "load,fpload,fpidxload")) - "rm7_imem") - -(define_insn_reservation "rm7_st" 1 (and (eq_attr "cpu" "r7000") - (eq_attr "type" "store,fpstore,fpidxstore")) - "rm7_imem") - -(define_insn_reservation "rm7_idiv_si" 36 (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "idiv") - (eq_attr "mode" "SI"))) - "rm7_impydiv+(rm7_impydiv_iter*36)") - -(define_insn_reservation "rm7_idiv_di" 68 (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "idiv") - (eq_attr "mode" "DI"))) - "rm7_impydiv+(rm7_impydiv_iter*68)") + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "arith,shift,slt,clz,const,condmove,nop,trap")) + "rm7_iaddsub") + +(define_insn_reservation "rm7_ld" 2 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "load,fpload,fpidxload")) + "rm7_imem") + +(define_insn_reservation "rm7_st" 1 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "store,fpstore,fpidxstore")) + "rm7_imem") + +(define_insn_reservation "rm7_idiv_si" 36 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "rm7_impydiv+(rm7_impydiv_iter*36)") + +(define_insn_reservation "rm7_idiv_di" 68 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "rm7_impydiv+(rm7_impydiv_iter*68)") (define_insn_reservation "rm7_impy_si_mult" 5 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "imul,imadd") - (and (eq_attr "mode" "SI") - (match_operand 0 "hilo_operand")))) - "rm7_impydiv+(rm7_impydiv_iter*3)") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "imul,imadd") + (eq_attr "mode" "SI"))) + "rm7_impydiv+(rm7_impydiv_iter*3)") ;; There are an additional 2 stall cycles. (define_insn_reservation "rm7_impy_si_mul" 2 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "imul,imadd") - (and (eq_attr "mode" "SI") - (not (match_operand 0 "hilo_operand"))))) - "rm7_impydiv") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "imul3") + (eq_attr "mode" "SI"))) + "rm7_impydiv") -(define_insn_reservation "rm7_impy_di" 9 (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "imul") - (eq_attr "mode" "DI"))) - "rm7_impydiv+(rm7_impydiv_iter*8)") +(define_insn_reservation "rm7_impy_di" 9 + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "imul,imul3") + (eq_attr "mode" "DI"))) + "rm7_impydiv+(rm7_impydiv_iter*8)") ;; Move to/from HI/LO. (define_insn_reservation "rm7_mthilo" 3 - (and (eq_attr "cpu" "r7000") - (eq_attr "type" "mthilo")) - "rm7_impydiv") + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "mthilo")) + "rm7_impydiv") (define_insn_reservation "rm7_mfhilo" 1 - (and (eq_attr "cpu" "r7000") - (eq_attr "type" "mfhilo")) - "rm7_impydiv") + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "mfhilo")) + "rm7_impydiv") ;; Move to/from fp coprocessor. -(define_insn_reservation "rm7_ixfer" 2 (and (eq_attr "cpu" "r7000") - (eq_attr "type" "xfer")) - "rm7_iaddsub") +(define_insn_reservation "rm7_ixfer" 2 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "xfer")) + "rm7_iaddsub") -(define_insn_reservation "rm7_ibr" 3 (and (eq_attr "cpu" "r7000") - (eq_attr "type" "branch,jump,call")) - "rm7_branch") +(define_insn_reservation "rm7_ibr" 3 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "branch,jump,call")) + "rm7_branch") ;; ;; Describe instruction reservations for the floating-point operations. ;; (define_insn_reservation "rm7_fp_quick" 4 - (and (eq_attr "cpu" "r7000") - (eq_attr "type" "fneg,fcmp,fabs,fmove")) - "rm7_fpadd") + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "fneg,fcmp,fabs,fmove")) + "rm7_fpadd") (define_insn_reservation "rm7_fp_other" 4 - (and (eq_attr "cpu" "r7000") - (eq_attr "type" "fadd")) - "rm7_fpadd") + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "fadd")) + "rm7_fpadd") (define_insn_reservation "rm7_fp_cvt" 4 - (and (eq_attr "cpu" "r7000") - (eq_attr "type" "fcvt")) - "rm7_fpadd") + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "fcvt")) + "rm7_fpadd") (define_insn_reservation "rm7_fp_divsqrt_df" 36 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "fdiv,frdiv,fsqrt") - (eq_attr "mode" "DF"))) - "rm7_fpdivsqr+(rm7_fpdivsqr_iter*36)") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "DF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*36)") (define_insn_reservation "rm7_fp_divsqrt_sf" 21 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "fdiv,frdiv,fsqrt") - (eq_attr "mode" "SF"))) - "rm7_fpdivsqr+(rm7_fpdivsqr_iter*21)") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fdiv,frdiv,fsqrt") + (eq_attr "mode" "SF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*21)") (define_insn_reservation "rm7_fp_rsqrt_df" 68 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "frsqrt") - (eq_attr "mode" "DF"))) - "rm7_fpdivsqr+(rm7_fpdivsqr_iter*68)") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*68)") (define_insn_reservation "rm7_fp_rsqrt_sf" 38 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "frsqrt") - (eq_attr "mode" "SF"))) - "rm7_fpdivsqr+(rm7_fpdivsqr_iter*38)") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "SF"))) + "rm7_fpdivsqr+(rm7_fpdivsqr_iter*38)") (define_insn_reservation "rm7_fp_mpy_sf" 4 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "fmul,fmadd") - (eq_attr "mode" "SF"))) - "rm7_fpmpy+rm7_fpmpy_iter") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "rm7_fpmpy+rm7_fpmpy_iter") (define_insn_reservation "rm7_fp_mpy_df" 5 - (and (eq_attr "cpu" "r7000") - (and (eq_attr "type" "fmul,fmadd") - (eq_attr "mode" "DF"))) - "rm7_fpmpy+(rm7_fpmpy_iter*2)") + (and (eq_attr "cpu" "r7000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "rm7_fpmpy+(rm7_fpmpy_iter*2)") ;; Force single-dispatch for unknown or multi. -(define_insn_reservation "rm7_unknown" 1 (and (eq_attr "cpu" "r7000") - (eq_attr "type" "unknown,multi")) - "rm7_single_dispatch") +(define_insn_reservation "rm7_unknown" 1 + (and (eq_attr "cpu" "r7000") + (eq_attr "type" "unknown,multi")) + "rm7_single_dispatch") diff --git a/gcc/config/mips/9000.md b/gcc/config/mips/9000.md index b5501c3d696..0240b98707e 100644 --- a/gcc/config/mips/9000.md +++ b/gcc/config/mips/9000.md @@ -1,5 +1,5 @@ ;; DFA-based pipeline description for the RM9000. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -64,13 +64,13 @@ ;; This applies to both 'mul' and 'mult'. (define_insn_reservation "rm9k_mulsi" 3 (and (eq_attr "cpu" "r9000") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "!DI"))) "rm9k_f_int") (define_insn_reservation "rm9k_muldi" 7 (and (eq_attr "cpu" "r9000") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "DI"))) "rm9k_f_int + rm9k_imul * 7") diff --git a/gcc/config/mips/generic.md b/gcc/config/mips/generic.md index 237272eb8af..693a8a5351d 100644 --- a/gcc/config/mips/generic.md +++ b/gcc/config/mips/generic.md @@ -1,5 +1,5 @@ ;; Generic DFA-based pipeline description for MIPS targets -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; ;; This file is part of GCC. @@ -48,7 +48,7 @@ "imuldiv*3") (define_insn_reservation "generic_imul" 17 - (eq_attr "type" "imul,imadd") + (eq_attr "type" "imul,imul3,imadd") "imuldiv*17") (define_insn_reservation "generic_idiv" 38 diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h index ff051255c9c..4e91bca1635 100644 --- a/gcc/config/mips/iris6.h +++ b/gcc/config/mips/iris6.h @@ -32,12 +32,17 @@ Boston, MA 02111-1307, USA. */ easier to write. Default to the mips2 ISA for the O32 ABI. */ #define DRIVER_SELF_SPECS \ "%{!mabi=*: -mabi=n32}", \ - "%{mabi=32: %{!mips*: -mips2}}" + "%{mabi=32: %{!mips*: %{!march*: -mips2}}}" /* Force the generation of dwarf .debug_frame sections even if not compiling -g. This guarantees that we can unwind the stack. */ #define DWARF2_FRAME_INFO 1 +/* The system unwinder in libexc requires a specific dwarf return address + column to work. */ +#undef DWARF_FRAME_RETURN_COLUMN +#define DWARF_FRAME_RETURN_COLUMN (FP_REG_LAST + 1) + #undef MACHINE_TYPE #define MACHINE_TYPE "SGI running IRIX 6.x" diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h index 47e24b63148..24e4f0b18d9 100644 --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -54,48 +54,45 @@ Boston, MA 02111-1307, USA. */ #define TARGET_DEFAULT MASK_ABICALLS #define TARGET_OS_CPP_BUILTINS() \ - do { \ - LINUX_TARGET_OS_CPP_BUILTINS(); \ - if (TARGET_ABICALLS) \ - { \ - builtin_define ("__PIC__"); \ - builtin_define ("__pic__"); \ - } \ - /* The GNU C++ standard library requires this. */ \ - if (c_dialect_cxx ()) \ - builtin_define ("_GNU_SOURCE"); \ - \ - if (mips_abi == ABI_N32) \ + do { \ + LINUX_TARGET_OS_CPP_BUILTINS(); \ + if (TARGET_ABICALLS) \ + { \ + builtin_define ("__PIC__"); \ + builtin_define ("__pic__"); \ + } \ + /* The GNU C++ standard library requires this. */ \ + if (c_dialect_cxx ()) \ + builtin_define ("_GNU_SOURCE"); \ + \ + if (mips_abi == ABI_N32) \ { \ builtin_define ("_ABIN32=2"); \ builtin_define ("_MIPS_SIM=_ABIN32"); \ builtin_define ("_MIPS_SZLONG=32"); \ builtin_define ("_MIPS_SZPTR=32"); \ } \ - else if (mips_abi == ABI_64) \ + else if (mips_abi == ABI_64) \ { \ builtin_define ("_ABI64=3"); \ builtin_define ("_MIPS_SIM=_ABI64"); \ builtin_define ("_MIPS_SZLONG=64"); \ builtin_define ("_MIPS_SZPTR=64"); \ } \ - else \ + else \ { \ - builtin_define ("_ABIO32=1"); \ - builtin_define ("_MIPS_SIM=_ABIO32"); \ + builtin_define ("_ABIO32=1"); \ + builtin_define ("_MIPS_SIM=_ABIO32"); \ builtin_define ("_MIPS_SZLONG=32"); \ builtin_define ("_MIPS_SZPTR=32"); \ } \ - if (TARGET_FLOAT64) \ - builtin_define ("_MIPS_FPSET=32"); \ - else \ - builtin_define ("_MIPS_FPSET=16"); \ - \ - if (TARGET_INT64) \ - builtin_define ("_MIPS_SZINT=64"); \ - else \ - builtin_define ("_MIPS_SZINT=32"); \ -} while (0) + if (TARGET_FLOAT64) \ + builtin_define ("_MIPS_FPSET=32"); \ + else \ + builtin_define ("_MIPS_FPSET=16"); \ + \ + builtin_define ("_MIPS_SZINT=32"); \ + } while (0) #undef SUBTARGET_CPP_SPEC #define SUBTARGET_CPP_SPEC "%{pthread:-D_REENTRANT}" diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 2817e6733de..9faddde503d 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -357,7 +357,6 @@ static bool mips_callee_copies (CUMULATIVE_ARGS *, enum machine_mode mode, static int mips_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool); static bool mips_valid_pointer_mode (enum machine_mode); -static bool mips_scalar_mode_supported_p (enum machine_mode); static bool mips_vector_mode_supported_p (enum machine_mode); static rtx mips_prepare_builtin_arg (enum insn_code, unsigned int, tree *); static rtx mips_prepare_builtin_target (enum insn_code, unsigned int, rtx); @@ -696,10 +695,15 @@ const struct mips_cpu_info mips_cpu_info_table[] = { /* MIPS32 */ { "4kc", PROCESSOR_4KC, 32 }, - { "4kp", PROCESSOR_4KC, 32 }, /* = 4kc */ + { "4km", PROCESSOR_4KC, 32 }, /* = 4kc */ + { "4kp", PROCESSOR_4KP, 32 }, /* MIPS32 Release 2 */ { "m4k", PROCESSOR_M4K, 33 }, + { "24k", PROCESSOR_24K, 33 }, + { "24kc", PROCESSOR_24K, 33 }, /* 24K no FPU */ + { "24kf", PROCESSOR_24K, 33 }, /* 24K 1:2 FPU */ + { "24kx", PROCESSOR_24KX, 33 }, /* 24K 1:1 FPU */ /* MIPS64 */ { "5kc", PROCESSOR_5KC, 64 }, @@ -820,9 +824,6 @@ const struct mips_cpu_info mips_cpu_info_table[] = { #undef TARGET_VECTOR_MODE_SUPPORTED_P #define TARGET_VECTOR_MODE_SUPPORTED_P mips_vector_mode_supported_p -#undef TARGET_SCALAR_MODE_SUPPORTED_P -#define TARGET_SCALAR_MODE_SUPPORTED_P mips_scalar_mode_supported_p - #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS mips_init_builtins #undef TARGET_EXPAND_BUILTIN @@ -1698,7 +1699,7 @@ mips_legitimize_tls_address (rtx loc) break; default: - abort (); + gcc_unreachable (); } return dest; @@ -2806,8 +2807,6 @@ mips_emit_compare (enum rtx_code *code, rtx *op0, rtx *op1, bool need_eq_ne_p) switch (*code) { case NE: - case UNGE: - case UNGT: case LTGT: case ORDERED: cmp_code = reverse_condition_maybe_unordered (*code); @@ -3973,7 +3972,8 @@ mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p) } /* [2] Emit code to branch if off == 0. */ - t = lang_hooks.truthvalue_conversion (off); + t = build (NE_EXPR, boolean_type_node, off, + build_int_cst (TREE_TYPE (off), 0)); addr = build (COND_EXPR, ptr_type_node, t, NULL, NULL); /* [5] Emit code for: off -= rsize. We do this as a form of @@ -4335,25 +4335,12 @@ override_options (void) if ((target_flags_explicit & MASK_LONG64) == 0) { - if (TARGET_INT64) - target_flags |= MASK_LONG64; - /* If no type size setting options (-mlong64,-mint64,-mlong32) - were used, then set the type sizes. In the EABI in 64 bit mode, - longs and pointers are 64 bits. Likewise for the SGI Irix6 N64 - ABI. */ - else if ((mips_abi == ABI_EABI && TARGET_64BIT) || mips_abi == ABI_64) + if ((mips_abi == ABI_EABI && TARGET_64BIT) || mips_abi == ABI_64) target_flags |= MASK_LONG64; else target_flags &= ~MASK_LONG64; } - /* Deprecate -mint64. Remove after 4.0 branches. */ - if (TARGET_INT64) - warning ("-mint64 is a deprecated option"); - - if (TARGET_INT64 && !TARGET_LONG64) - error ("unsupported combination: %s", "-mint64 -mlong32"); - if (MIPS_MARCH_CONTROLS_SOFT_FLOAT && (target_flags_explicit & MASK_SOFT_FLOAT) == 0) { @@ -4403,7 +4390,7 @@ override_options (void) target_flags &= ~MASK_BRANCHLIKELY; } if (TARGET_BRANCHLIKELY && !ISA_HAS_BRANCHLIKELY) - warning ("generation of Branch Likely instructions enabled, but not supported by architecture"); + warning (0, "generation of Branch Likely instructions enabled, but not supported by architecture"); /* The effect of -mabicalls isn't defined for the EABI. */ if (mips_abi == ABI_EABI && TARGET_ABICALLS) @@ -4420,7 +4407,7 @@ override_options (void) { flag_pic = 1; if (mips_section_threshold > 0) - warning ("-G is incompatible with PIC code which is the default"); + warning (0, "-G is incompatible with PIC code which is the default"); } /* mips_split_addresses is a half-way house between explicit @@ -6275,8 +6262,18 @@ mips_set_frame_expr (rtx frame_pattern) static rtx mips_frame_set (rtx mem, rtx reg) { - rtx set = gen_rtx_SET (VOIDmode, mem, reg); + rtx set; + + /* If we're saving the return address register and the dwarf return + address column differs from the hard register number, adjust the + note reg to refer to the former. */ + if (REGNO (reg) == GP_REG_FIRST + 31 + && DWARF_FRAME_RETURN_COLUMN != GP_REG_FIRST + 31) + reg = gen_rtx_REG (GET_MODE (reg), DWARF_FRAME_RETURN_COLUMN); + + set = gen_rtx_SET (VOIDmode, mem, reg); RTX_FRAME_RELATED_P (set) = 1; + return set; } @@ -6718,7 +6715,7 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, mips16_lay_out_constants (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); /* Clean up the vars set above. Note that final_end_function resets @@ -7287,44 +7284,8 @@ mips_valid_pointer_mode (enum machine_mode mode) return (mode == SImode || (TARGET_64BIT && mode == DImode)); } -/* Define this so that we can deal with a testcase like: - - char foo __attribute__ ((mode (SI))); - - then compiled with -mabi=64 and -mint64. We have no - 32-bit type at that point and so the default case - always fails. */ - -static bool -mips_scalar_mode_supported_p (enum machine_mode mode) -{ - switch (mode) - { - case QImode: - case HImode: - case SImode: - case DImode: - return true; - - /* Handled via optabs.c. */ - case TImode: - return TARGET_64BIT; - - case SFmode: - case DFmode: - return true; - - /* LONG_DOUBLE_TYPE_SIZE is 128 for TARGET_NEWABI only. */ - case TFmode: - return TARGET_NEWABI; - - default: - return false; - } -} - - /* Target hook for vector_mode_supported_p. */ + static bool mips_vector_mode_supported_p (enum machine_mode mode) { @@ -7977,11 +7938,7 @@ dump_constants (struct mips16_constant *constants, rtx insn) emit_barrier_after (insn); } -/* Return the length of instruction INSN. - - ??? MIPS16 switch tables go in .text, but we don't define - JUMP_TABLES_IN_TEXT_SECTION, so get_attr_length will not - compute their lengths correctly. */ +/* Return the length of instruction INSN. */ static int mips16_insn_length (rtx insn) @@ -8982,7 +8939,7 @@ mips_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p, /* Output delay slot instruction. */ rtx insn = final_sequence; final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, - optimize, 0, 1, NULL); + optimize, 1, NULL); INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1; } else @@ -9001,7 +8958,7 @@ mips_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p, /* Output delay slot instruction. */ rtx insn = final_sequence; final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, - optimize, 0, 1, NULL); + optimize, 1, NULL); INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1; } else @@ -9193,7 +9150,7 @@ mips_matching_cpu_name_p (const char *canonical, const char *given) /* Return the mips_cpu_info entry for the processor or ISA given - by CPU_STRING. Return null if the string isn't recognised. + by CPU_STRING. Return null if the string isn't recognized. A similar function exists in GAS. */ @@ -9208,7 +9165,7 @@ mips_parse_cpu (const char *cpu_string) for (s = cpu_string; *s != 0; s++) if (ISUPPER (*s)) { - warning ("the cpu name must be lower case"); + warning (0, "the cpu name must be lower case"); break; } diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index 9ef7081c637..aeadac30fa8 100644 --- a/gcc/config/mips/mips.h +++ b/gcc/config/mips/mips.h @@ -34,8 +34,11 @@ Boston, MA 02111-1307, USA. */ enum processor_type { PROCESSOR_DEFAULT, PROCESSOR_4KC, + PROCESSOR_4KP, PROCESSOR_5KC, PROCESSOR_20KC, + PROCESSOR_24K, + PROCESSOR_24KX, PROCESSOR_M4K, PROCESSOR_R3000, PROCESSOR_R3900, @@ -966,11 +969,11 @@ extern const struct mips_cpu_info *mips_tune_info; /* The number of bytes in a double. */ #define UNITS_PER_DOUBLE (TYPE_PRECISION (double_type_node) / BITS_PER_UNIT) -#define UNITS_PER_SIMD_WORD (TARGET_PAIRED_SINGLE_FLOAT ? 8 : 0) +#define UNITS_PER_SIMD_WORD (TARGET_PAIRED_SINGLE_FLOAT ? 8 : UNITS_PER_WORD) /* Set the sizes of the core types. */ #define SHORT_TYPE_SIZE 16 -#define INT_TYPE_SIZE (TARGET_INT64 ? 64 : 32) +#define INT_TYPE_SIZE 32 #define LONG_TYPE_SIZE (TARGET_LONG64 ? 64 : 32) #define LONG_LONG_TYPE_SIZE 64 @@ -2576,18 +2579,9 @@ do { \ LOCAL_LABEL_PREFIX, VALUE); \ } while (0) -/* When generating mips16 code we want to put the jump table in the .text - section. In all other cases, we want to put the jump table in the .rdata - section. Unfortunately, we can't use JUMP_TABLES_IN_TEXT_SECTION, because - it is not conditional. Instead, we use ASM_OUTPUT_CASE_LABEL to switch back - to the .text section if appropriate. */ -#undef ASM_OUTPUT_CASE_LABEL -#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, INSN) \ -do { \ - if (TARGET_MIPS16) \ - function_section (current_function_decl); \ - (*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \ -} while (0) +/* When generating MIPS16 code, we want the jump table to be in the text + section so that we can load its address using a PC-relative addition. */ +#define JUMP_TABLES_IN_TEXT_SECTION TARGET_MIPS16 /* This is how to output an assembler line that says to advance the location counter @@ -2677,11 +2671,6 @@ while (0) #undef PTRDIFF_TYPE #define PTRDIFF_TYPE (POINTER_SIZE == 64 ? "long int" : "int") - -/* See mips_expand_prologue's use of loadgp for when this should be - true. */ - -#define DONT_ACCESS_GBLS_AFTER_EPILOGUE (TARGET_ABICALLS && !TARGET_OLDABI) #ifndef __mips16 /* Since the bits of the _init and _fini function is spread across diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 9948e0627cd..5d58b735503 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -126,7 +126,8 @@ ;; slt set less than instructions ;; clz the clz and clo instructions ;; trap trap if instructions -;; imul integer multiply +;; imul integer multiply 2 operands +;; imul3 integer multiply 3 operands ;; imadd integer multiply-add ;; idiv integer divide ;; fmove floating point register move @@ -148,7 +149,7 @@ ;; multi multiword sequence (or user asm statements) ;; nop no operation (define_attr "type" - "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,xfer,mthilo,mfhilo,const,arith,shift,slt,clz,trap,imul,imadd,idiv,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,multi,nop" + "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,xfer,mthilo,mfhilo,const,arith,shift,slt,clz,trap,imul,imul3,imadd,idiv,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,multi,nop" (cond [(eq_attr "jal" "!unset") (const_string "call") (eq_attr "got" "load") (const_string "load")] (const_string "unknown"))) @@ -157,6 +158,17 @@ (define_attr "mode" "unknown,none,QI,HI,SI,DI,SF,DF,FPSW" (const_string "unknown")) +;; Mode for conversion types (fcvt) +;; I2S integer to float single (SI/DI to SF) +;; I2D integer to float double (SI/DI to DF) +;; S2I float to integer (SF to SI/DI) +;; D2I float to integer (DF to SI/DI) +;; D2S double to float single +;; S2D float single to double + +(define_attr "cnv_mode" "unknown,I2S,I2D,S2I,D2I,D2S,S2D" + (const_string "unknown")) + ;; Is this an extended instruction in mips16 mode? (define_attr "extended_mips16" "no,yes" (const_string "no")) @@ -242,7 +254,7 @@ ;; VR4120 errata MD(4): if there are consecutive dmult instructions, ;; the result of the second one is missed. The assembler should work ;; around this by inserting a nop after the first dmult. - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (and (eq_attr "mode" "DI") (ne (symbol_ref "TARGET_FIX_VR4120") (const_int 0)))) (const_int 8) @@ -254,7 +266,7 @@ ;; Attribute describing the processor. This attribute must match exactly ;; with the processor_type enumeration in mips.h. (define_attr "cpu" - "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000" + "default,4kc,4kp,5kc,20kc,24k,24kx,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000" (const (symbol_ref "mips_tune"))) ;; The type of hardware hazard associated with this instruction. @@ -306,7 +318,7 @@ ;; True if an instruction might assign to hi or lo when reloaded. ;; This is used by the TUNE_MACC_CHAINS code. (define_attr "may_clobber_hilo" "no,yes" - (if_then_else (eq_attr "type" "imul,imadd,idiv,mthilo") + (if_then_else (eq_attr "type" "imul,imul3,imadd,idiv,mthilo") (const_string "yes") (const_string "no"))) @@ -413,6 +425,10 @@ ;; generated from the same template. (define_code_macro fcond [unordered uneq unlt unle eq lt le]) +;; This code macro is used for comparisons that can be implemented +;; by swapping the operands. +(define_code_macro swapped_fcond [ge gt unge ungt]) + ;; expands to an empty string when doing a signed operation and ;; "u" when doing an unsigned operation. (define_code_attr u [(sign_extend "") (zero_extend "u")]) @@ -438,6 +454,12 @@ (eq "eq") (lt "lt") (le "le")]) + +;; Similar, but for swapped conditions. +(define_code_attr swapped_fcond [(ge "le") + (gt "lt") + (unge "ule") + (ungt "ult")]) ;; ......................... ;; @@ -478,6 +500,8 @@ (define_cpu_unit "alu" "alu") (define_cpu_unit "imuldiv" "imuldiv") +(include "4k.md") +(include "24k.md") (include "3000.md") (include "4000.md") (include "4100.md") @@ -945,7 +969,7 @@ return "mul\t%0,%1,%2"; return "mult\t%0,%1,%2"; } - [(set_attr "type" "imul") + [(set_attr "type" "imul3,imul") (set_attr "mode" "SI")]) (define_insn "muldi3_mult3" @@ -956,7 +980,7 @@ (clobber (match_scratch:DI 4 "=l"))] "TARGET_64BIT && GENERATE_MULT3_DI" "dmult\t%0,%1,%2" - [(set_attr "type" "imul") + [(set_attr "type" "imul3") (set_attr "mode" "DI")]) ;; If a register gets allocated to LO, and we spill to memory, the reload @@ -1378,7 +1402,7 @@ "@ muls\t$0,%1,%2 muls\t%0,%1,%2" - [(set_attr "type" "imul") + [(set_attr "type" "imul,imul3") (set_attr "mode" "SI")]) ;; ??? We could define a mulditi3 pattern when TARGET_64BIT. @@ -1564,7 +1588,7 @@ "@ mult\t%1,%2 mulhi\t%0,%1,%2" - [(set_attr "type" "imul") + [(set_attr "type" "imul,imul3") (set_attr "mode" "SI")]) (define_insn "*mulsi3_highpart_neg_mulhi_internal" @@ -1582,7 +1606,7 @@ "@ mulshi\t%.,%1,%2 mulshi\t%0,%1,%2" - [(set_attr "type" "imul") + [(set_attr "type" "imul,imul3") (set_attr "mode" "SI")]) ;; Disable unsigned multiplication for -mfix-vr4120. This is for VR4120 @@ -2130,6 +2154,7 @@ beq\t%2,%.,1b\;\ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" "cvt.s.d\t%0,%1" [(set_attr "type" "fcvt") + (set_attr "cnv_mode" "D2S") (set_attr "mode" "SF")]) ;; Integer truncation patterns. Truncating SImode values to smaller @@ -2444,6 +2469,7 @@ beq\t%2,%.,1b\;\ "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT" "cvt.d.s\t%0,%1" [(set_attr "type" "fcvt") + (set_attr "cnv_mode" "S2D") (set_attr "mode" "DF")]) ;; @@ -2472,6 +2498,7 @@ beq\t%2,%.,1b\;\ "trunc.w.d %0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "DF") + (set_attr "cnv_mode" "D2I") (set_attr "length" "4")]) (define_insn "fix_truncdfsi2_macro" @@ -2487,6 +2514,7 @@ beq\t%2,%.,1b\;\ } [(set_attr "type" "fcvt") (set_attr "mode" "DF") + (set_attr "cnv_mode" "D2I") (set_attr "length" "36")]) (define_expand "fix_truncsfsi2" @@ -2507,7 +2535,8 @@ beq\t%2,%.,1b\;\ "TARGET_HARD_FLOAT && ISA_HAS_TRUNC_W" "trunc.w.s %0,%1" [(set_attr "type" "fcvt") - (set_attr "mode" "DF") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "S2I") (set_attr "length" "4")]) (define_insn "fix_truncsfsi2_macro" @@ -2522,7 +2551,8 @@ beq\t%2,%.,1b\;\ return "trunc.w.s %0,%1,%2"; } [(set_attr "type" "fcvt") - (set_attr "mode" "DF") + (set_attr "mode" "SF") + (set_attr "cnv_mode" "S2I") (set_attr "length" "36")]) @@ -2533,6 +2563,7 @@ beq\t%2,%.,1b\;\ "trunc.l.d %0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "DF") + (set_attr "cnv_mode" "D2I") (set_attr "length" "4")]) @@ -2543,6 +2574,7 @@ beq\t%2,%.,1b\;\ "trunc.l.s %0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "SF") + (set_attr "cnv_mode" "S2I") (set_attr "length" "4")]) @@ -2553,6 +2585,7 @@ beq\t%2,%.,1b\;\ "cvt.d.w\t%0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "DF") + (set_attr "cnv_mode" "I2D") (set_attr "length" "4")]) @@ -2563,6 +2596,7 @@ beq\t%2,%.,1b\;\ "cvt.d.l\t%0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "DF") + (set_attr "cnv_mode" "I2D") (set_attr "length" "4")]) @@ -2573,6 +2607,7 @@ beq\t%2,%.,1b\;\ "cvt.s.w\t%0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "SF") + (set_attr "cnv_mode" "I2S") (set_attr "length" "4")]) @@ -2583,6 +2618,7 @@ beq\t%2,%.,1b\;\ "cvt.s.l\t%0,%1" [(set_attr "type" "fcvt") (set_attr "mode" "SF") + (set_attr "cnv_mode" "I2S") (set_attr "length" "4")]) @@ -4576,21 +4612,12 @@ beq\t%2,%.,1b\;\ [(set_attr "type" "fcmp") (set_attr "mode" "FPSW")]) -(define_insn "sgt_" - [(set (match_operand:CC 0 "register_operand" "=z") - (gt:CC (match_operand:SCALARF 1 "register_operand" "f") - (match_operand:SCALARF 2 "register_operand" "f")))] - "" - "c.lt.\t%Z0%2,%1" - [(set_attr "type" "fcmp") - (set_attr "mode" "FPSW")]) - -(define_insn "sge_" +(define_insn "s_" [(set (match_operand:CC 0 "register_operand" "=z") - (ge:CC (match_operand:SCALARF 1 "register_operand" "f") - (match_operand:SCALARF 2 "register_operand" "f")))] + (swapped_fcond:CC (match_operand:SCALARF 1 "register_operand" "f") + (match_operand:SCALARF 2 "register_operand" "f")))] "" - "c.le.\t%Z0%2,%1" + "c..\t%Z0%2,%1" [(set_attr "type" "fcmp") (set_attr "mode" "FPSW")]) diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt index 1db377ed160..cb78b8e7b40 100644 --- a/gcc/config/mips/mips.opt +++ b/gcc/config/mips/mips.opt @@ -133,10 +133,6 @@ mhard-float Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) Allow the use of hardware floating-point instructions -mint64 -Target Report RejectNegative Mask(INT64) -Use a 64-bit int type - mips Target RejectNegative Joined -mipsN Generate code for ISA level N diff --git a/gcc/config/mips/predicates.md b/gcc/config/mips/predicates.md index 9e9acdae9f0..d486cfc10c4 100644 --- a/gcc/config/mips/predicates.md +++ b/gcc/config/mips/predicates.md @@ -69,10 +69,6 @@ (and (match_code "reg") (match_test "FP_REG_P (REGNO (op))"))) -(define_predicate "hilo_operand" - (and (match_code "reg") - (match_test "MD_REG_P (REGNO (op))"))) - (define_predicate "lo_operand" (and (match_code "reg") (match_test "REGNO (op) == LO_REGNUM"))) diff --git a/gcc/config/mips/sb1.md b/gcc/config/mips/sb1.md index 3ab033302fd..b1b085f45ed 100644 --- a/gcc/config/mips/sb1.md +++ b/gcc/config/mips/sb1.md @@ -296,7 +296,7 @@ (define_insn_reservation "ir_sb1_mulsi" 3 (and (eq_attr "cpu" "sb1") - (and (eq_attr "type" "imul,imadd") + (and (eq_attr "type" "imul,imul3,imadd") (eq_attr "mode" "SI"))) "sb1_ex1+sb1_mul") @@ -305,7 +305,7 @@ (define_insn_reservation "ir_sb1_muldi" 4 (and (eq_attr "cpu" "sb1") - (and (eq_attr "type" "imul") + (and (eq_attr "type" "imul,imul3") (eq_attr "mode" "DI"))) "sb1_ex1+sb1_mul, sb1_mul") diff --git a/gcc/config/mips/sr71k.md b/gcc/config/mips/sr71k.md index d40e27e8cda..268bc4854f0 100644 --- a/gcc/config/mips/sr71k.md +++ b/gcc/config/mips/sr71k.md @@ -124,150 +124,131 @@ ;; -(define_insn_reservation "ir_sr70_unknown" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "unknown")) - "serial_dispatch") +(define_insn_reservation "ir_sr70_unknown" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "unknown")) + "serial_dispatch") ;; Assume prediction fails. -(define_insn_reservation "ir_sr70_branch" - 6 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "branch,jump,call")) - "ri_branch") +(define_insn_reservation "ir_sr70_branch" 6 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "branch,jump,call")) + "ri_branch") -(define_insn_reservation "ir_sr70_load" - 2 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "load")) - "ri_mem") +(define_insn_reservation "ir_sr70_load" 2 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "load")) + "ri_mem") -(define_insn_reservation "ir_sr70_store" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "store")) - "ri_mem") +(define_insn_reservation "ir_sr70_store" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "store")) + "ri_mem") ;; ;; float loads/stores flow through both cpu and cp1... ;; -(define_insn_reservation "ir_sr70_fload" - 9 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "fpload,fpidxload")) - "(cpu_iss+cp1_iss),(ri_mem+rf_ldmem)") +(define_insn_reservation "ir_sr70_fload" 9 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fpload,fpidxload")) + "(cpu_iss+cp1_iss),(ri_mem+rf_ldmem)") -(define_insn_reservation "ir_sr70_fstore" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "fpstore,fpidxstore")) - "(cpu_iss+cp1_iss),(fpu_mov+ri_mem)") +(define_insn_reservation "ir_sr70_fstore" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fpstore,fpidxstore")) + "(cpu_iss+cp1_iss),(fpu_mov+ri_mem)") ;; This reservation is for conditional move based on integer ;; or floating point CC. -(define_insn_reservation "ir_sr70_condmove" - 4 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "condmove")) - "ri_insns") +(define_insn_reservation "ir_sr70_condmove" 4 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "condmove")) + "ri_insns") ;; Try to discriminate move-from-cp1 versus move-to-cp1 as latencies ;; are different. Like float load/store, these insns use multiple ;; resources simultaneously -(define_insn_reservation "ir_sr70_xfer_from" - 6 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "xfer") - (eq_attr "mode" "!SF,DF,FPSW"))) - "(cpu_iss+cp1_iss),(fpu_mov+ri_mem)") - -(define_insn_reservation "ir_sr70_xfer_to" - 9 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "xfer") - (eq_attr "mode" "SF,DF"))) - "(cpu_iss+cp1_iss),(ri_mem+rf_ldmem)") - -(define_insn_reservation "ir_sr70_hilo" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "mthilo,mfhilo")) - "ri_insns") - -(define_insn_reservation "ir_sr70_arith" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "arith,shift,slt,clz,const,trap")) - "ri_insns") +(define_insn_reservation "ir_sr70_xfer_from" 6 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "xfer") + (eq_attr "mode" "!SF,DF,FPSW"))) + "(cpu_iss+cp1_iss),(fpu_mov+ri_mem)") + +(define_insn_reservation "ir_sr70_xfer_to" 9 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "xfer") + (eq_attr "mode" "SF,DF"))) + "(cpu_iss+cp1_iss),(ri_mem+rf_ldmem)") + +(define_insn_reservation "ir_sr70_hilo" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "mthilo,mfhilo")) + "ri_insns") + +(define_insn_reservation "ir_sr70_arith" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "arith,shift,slt,clz,const,trap")) + "ri_insns") ;; emulate repeat (dispatch stall) by spending extra cycle(s) in ;; in iter unit -(define_insn_reservation "ir_sr70_imul_si" - 4 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "imul,imadd") - (eq_attr "mode" "SI"))) - "ri_alux,ipu_alux,ipu_macc_iter") - -(define_insn_reservation "ir_sr70_imul_di" - 6 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "imul,imadd") - (eq_attr "mode" "DI"))) - "ri_alux,ipu_alux,(ipu_macc_iter*3)") +(define_insn_reservation "ir_sr70_imul_si" 4 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "SI"))) + "ri_alux,ipu_alux,ipu_macc_iter") + +(define_insn_reservation "ir_sr70_imul_di" 6 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "imul,imul3,imadd") + (eq_attr "mode" "DI"))) + "ri_alux,ipu_alux,(ipu_macc_iter*3)") ;; Divide algorithm is early out with best latency of 7 pcycles. ;; Use worst case for scheduling purposes. -(define_insn_reservation "ir_sr70_idiv_si" - 41 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "idiv") - (eq_attr "mode" "SI"))) - "ri_alux,ipu_alux,(ipu_macc_iter*38)") - -(define_insn_reservation "ir_sr70_idiv_di" - 73 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "idiv") - (eq_attr "mode" "DI"))) - "ri_alux,ipu_alux,(ipu_macc_iter*70)") +(define_insn_reservation "ir_sr70_idiv_si" 41 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "SI"))) + "ri_alux,ipu_alux,(ipu_macc_iter*38)") + +(define_insn_reservation "ir_sr70_idiv_di" 73 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "idiv") + (eq_attr "mode" "DI"))) + "ri_alux,ipu_alux,(ipu_macc_iter*70)") ;; extra reservations of fpu_fpu are for repeat latency -(define_insn_reservation "ir_sr70_fadd_sf" - 8 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fadd") - (eq_attr "mode" "SF"))) - "rf_insn,fpu_fpu") - -(define_insn_reservation "ir_sr70_fadd_df" - 10 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fadd") - (eq_attr "mode" "DF"))) - "rf_insn,fpu_fpu") +(define_insn_reservation "ir_sr70_fadd_sf" 8 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fadd") + (eq_attr "mode" "SF"))) + "rf_insn,fpu_fpu") + +(define_insn_reservation "ir_sr70_fadd_df" 10 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fadd") + (eq_attr "mode" "DF"))) + "rf_insn,fpu_fpu") ;; Latencies for MADD,MSUB, NMADD, NMSUB assume the Multiply is fused ;; with the sub or add. -(define_insn_reservation "ir_sr70_fmul_sf" - 8 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fmul,fmadd") - (eq_attr "mode" "SF"))) - "rf_insn,fpu_fpu") +(define_insn_reservation "ir_sr70_fmul_sf" 8 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "SF"))) + "rf_insn,fpu_fpu") ;; tie up the fpu unit to emulate the balance for the "repeat ;; rate" of 8 (2 are spent in the iss unit) -(define_insn_reservation "ir_sr70_fmul_df" - 16 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fmul,fmadd") - (eq_attr "mode" "DF"))) - "rf_insn,fpu_fpu*6") +(define_insn_reservation "ir_sr70_fmul_df" 16 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fmul,fmadd") + (eq_attr "mode" "DF"))) + "rf_insn,fpu_fpu*6") ;; RECIP insn uses same type attr as div, and for SR3, has same @@ -275,77 +256,66 @@ ;; 28 -- only way to fix this is to introduce new insn attrs. ;; cycles spent in iter unit are designed to satisfy balance ;; of "repeat" latency after insn uses up rf_multi1 reservation -(define_insn_reservation "ir_sr70_fdiv_sf" - 60 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fdiv,frdiv") - (eq_attr "mode" "SF"))) - "rf_multi1+(fpu_iter*51)") - -(define_insn_reservation "ir_sr70_fdiv_df" - 120 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fdiv,frdiv") - (eq_attr "mode" "DF"))) - "rf_multi1+(fpu_iter*109)") - -(define_insn_reservation "ir_sr70_fabs" - 4 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "fabs,fneg,fmove")) - "rf_insn,fpu_fpu") - -(define_insn_reservation "ir_sr70_fcmp" - 10 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "fcmp")) - "rf_insn,fpu_fpu") +(define_insn_reservation "ir_sr70_fdiv_sf" 60 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "SF"))) + "rf_multi1+(fpu_iter*51)") + +(define_insn_reservation "ir_sr70_fdiv_df" 120 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fdiv,frdiv") + (eq_attr "mode" "DF"))) + "rf_multi1+(fpu_iter*109)") + +(define_insn_reservation "ir_sr70_fabs" 4 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fabs,fneg,fmove")) + "rf_insn,fpu_fpu") + +(define_insn_reservation "ir_sr70_fcmp" 10 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fcmp")) + "rf_insn,fpu_fpu") ;; "fcvt" type attribute covers a number of diff insns, most have the same ;; latency descriptions, a few vary. We use the ;; most common timing (which is also worst case). -(define_insn_reservation "ir_sr70_fcvt" - 12 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "fcvt")) - "rf_insn,fpu_fpu*4") - -(define_insn_reservation "ir_sr70_fsqrt_sf" - 62 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fsqrt") - (eq_attr "mode" "SF"))) - "rf_multi1+(fpu_iter*53)") - -(define_insn_reservation "ir_sr70_fsqrt_df" - 122 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "fsqrt") - (eq_attr "mode" "DF"))) - "rf_multi1+(fpu_iter*111)") - -(define_insn_reservation "ir_sr70_frsqrt_sf" - 48 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "frsqrt") - (eq_attr "mode" "SF"))) - "rf_multi1+(fpu_iter*39)") - -(define_insn_reservation "ir_sr70_frsqrt_df" - 240 - (and (eq_attr "cpu" "sr71000") - (and (eq_attr "type" "frsqrt") - (eq_attr "mode" "DF"))) - "rf_multi1+(fpu_iter*229)") - -(define_insn_reservation "ir_sr70_multi" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "multi")) - "serial_dispatch") - -(define_insn_reservation "ir_sr70_nop" - 1 - (and (eq_attr "cpu" "sr71000") - (eq_attr "type" "nop")) - "ri_insns") +(define_insn_reservation "ir_sr70_fcvt" 12 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "fcvt")) + "rf_insn,fpu_fpu*4") + +(define_insn_reservation "ir_sr70_fsqrt_sf" 62 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fsqrt") + (eq_attr "mode" "SF"))) + "rf_multi1+(fpu_iter*53)") + +(define_insn_reservation "ir_sr70_fsqrt_df" 122 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "fsqrt") + (eq_attr "mode" "DF"))) + "rf_multi1+(fpu_iter*111)") + +(define_insn_reservation "ir_sr70_frsqrt_sf" 48 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "SF"))) + "rf_multi1+(fpu_iter*39)") + +(define_insn_reservation "ir_sr70_frsqrt_df" 240 + (and (eq_attr "cpu" "sr71000") + (and (eq_attr "type" "frsqrt") + (eq_attr "mode" "DF"))) + "rf_multi1+(fpu_iter*229)") + +(define_insn_reservation "ir_sr70_multi" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "multi")) + "serial_dispatch") + +(define_insn_reservation "ir_sr70_nop" 1 + (and (eq_attr "cpu" "sr71000") + (eq_attr "type" "nop")) + "ri_insns") diff --git a/gcc/config/mmix/crti.asm b/gcc/config/mmix/crti.asm index 68c5f3f04aa..d00dcd59dae 100644 --- a/gcc/config/mmix/crti.asm +++ b/gcc/config/mmix/crti.asm @@ -91,7 +91,7 @@ Main SETL $255,32 % Provide the first part of _init and _fini. Save the return address on the % register stack. We eventually ignore the return address of these % PUSHJ:s, so it doesn't matter that whether .init and .fini code calls -% functions or where they store rJ. We shouldn't get there, so abort +% functions or where they store rJ. We shouldn't get there, so die % (TRAP Halt) if that happens. .section .init,"ax",@progbits diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 0dd26ed2620..15dc69e043e 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler, for MMIX. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Hans-Peter Nilsson (hp@bitrange.com) This file is part of GCC. @@ -106,11 +107,6 @@ Boston, MA 02111-1307, USA. */ rtx mmix_compare_op0; rtx mmix_compare_op1; -/* We ignore some options with arguments. They are passed to the linker, - but also ends up here because they start with "-m". We tell the driver - to store them in a variable we don't inspect. */ -const char *mmix_cc1_ignored_option; - /* Declarations of locals. */ /* Intermediate for insn output. */ @@ -208,6 +204,8 @@ static bool mmix_pass_by_reference (const CUMULATIVE_ARGS *, #define TARGET_PASS_BY_REFERENCE mmix_pass_by_reference #undef TARGET_CALLEE_COPIES #define TARGET_CALLEE_COPIES hook_bool_CUMULATIVE_ARGS_mode_tree_bool_true +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT struct gcc_target targetm = TARGET_INITIALIZER; @@ -226,7 +224,7 @@ mmix_override_options (void) labels. */ if (flag_pic) { - warning ("-f%s not supported: ignored", (flag_pic > 1) ? "PIC" : "pic"); + warning (0, "-f%s not supported: ignored", (flag_pic > 1) ? "PIC" : "pic"); flag_pic = 0; } } @@ -1302,11 +1300,10 @@ mmix_assemble_integer (rtx x, unsigned int size, int aligned_p) return true; case 8: - if (GET_CODE (x) == CONST_DOUBLE) - /* We don't get here anymore for CONST_DOUBLE, because DImode - isn't expressed as CONST_DOUBLE, and DFmode is handled - elsewhere. */ - abort (); + /* We don't get here anymore for CONST_DOUBLE, because DImode + isn't expressed as CONST_DOUBLE, and DFmode is handled + elsewhere. */ + gcc_assert (GET_CODE (x) != CONST_DOUBLE); assemble_integer_with_op ("\tOCTA\t", x); return true; } @@ -2346,139 +2343,6 @@ mmix_shiftable_wyde_value (unsigned HOST_WIDEST_INT value) return 1; } -/* True if this is an address_operand or a symbolic operand. */ - -int -mmix_symbolic_or_address_operand (rtx op, enum machine_mode mode) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF: - case LABEL_REF: - return 1; - case CONST: - op = XEXP (op, 0); - if ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF) - && (GET_CODE (XEXP (op, 1)) == CONST_INT - || (GET_CODE (XEXP (op, 1)) == CONST_DOUBLE - && GET_MODE (XEXP (op, 1)) == VOIDmode))) - return 1; - /* Fall through. */ - default: - return address_operand (op, mode); - } -} - -/* True if this is a register or CONST_INT (or CONST_DOUBLE for DImode). - We could narrow the value down with a couple of predicated, but that - doesn't seem to be worth it at the moment. */ - -int -mmix_reg_or_constant_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) - || (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == VOIDmode) - || GET_CODE (op) == CONST_INT; -} - -/* True if this is a register with a condition-code mode. */ - -int -mmix_reg_cc_operand (rtx op, enum machine_mode mode) -{ - if (mode == VOIDmode) - mode = GET_MODE (op); - - return register_operand (op, mode) - && (mode == CCmode || mode == CC_UNSmode || mode == CC_FPmode - || mode == CC_FPEQmode || mode == CC_FUNmode); -} - -/* True if this is a foldable comparison operator - - one where a the result of (compare:CC (reg) (const_int 0)) can be - replaced by (reg). */ - -int -mmix_foldable_comparison_operator (rtx op, enum machine_mode mode) -{ - RTX_CODE code = GET_CODE (op); - - if (mode == VOIDmode) - mode = GET_MODE (op); - - if (mode == VOIDmode && COMPARISON_P (op)) - mode = GET_MODE (XEXP (op, 0)); - - return ((mode == CCmode || mode == DImode) - && (code == NE || code == EQ || code == GE || code == GT - || code == LE)) - /* FIXME: This may be a stupid trick. What happens when GCC wants to - reverse the condition? Can it do that by itself? Maybe it can - even reverse the condition to fit a foldable one in the first - place? */ - || (mode == CC_UNSmode && (code == GTU || code == LEU)); -} - -/* Like comparison_operator, but only true if this comparison operator is - applied to a valid mode. Needed to avoid jump.c generating invalid - code with -ffast-math (gcc.dg/20001228-1.c). */ - -int -mmix_comparison_operator (rtx op, enum machine_mode mode) -{ - RTX_CODE code = GET_CODE (op); - - /* Comparison operators usually don't have a mode, but let's try and get - one anyway for the day that changes. */ - if (mode == VOIDmode) - mode = GET_MODE (op); - - /* Get the mode from the first operand if we don't have one. */ - if (mode == VOIDmode && COMPARISON_P (op)) - mode = GET_MODE (XEXP (op, 0)); - - /* FIXME: This needs to be kept in sync with the tables in - mmix_output_condition. */ - return - (mode == VOIDmode && COMPARISON_P (op)) - || (mode == CC_FUNmode - && (code == ORDERED || code == UNORDERED)) - || (mode == CC_FPmode - && (code == GT || code == LT)) - || (mode == CC_FPEQmode - && (code == NE || code == EQ)) - || (mode == CC_UNSmode - && (code == GEU || code == GTU || code == LEU || code == LTU)) - || (mode == CCmode - && (code == NE || code == EQ || code == GE || code == GT - || code == LE || code == LT)) - || (mode == DImode - && (code == NE || code == EQ || code == GE || code == GT - || code == LE || code == LT || code == LEU || code == GTU)); -} - -/* True if this is a register or 0 (int or float). */ - -int -mmix_reg_or_0_operand (rtx op, enum machine_mode mode) -{ - /* FIXME: Is mode calculation necessary and correct? */ - return - op == CONST0_RTX (mode == VOIDmode ? GET_MODE (op) : mode) - || register_operand (op, mode); -} - -/* True if this is a register or an int 0..255. */ - -int -mmix_reg_or_8bit_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) - || (GET_CODE (op) == CONST_INT - && CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')); -} - /* Returns zero if code and mode is not a valid condition from a compare-type insn. Nonzero if it is. The parameter op, if non-NULL, is the comparison of mode is CC-somethingmode. */ diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index 627231747e8..a5feb38fc7a 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -124,15 +124,6 @@ struct machine_function GTY(()) %{!r:--defsym __.MMIX.start..text=0x100}}}\ %{!melf:%{!r:-m mmo}}%{melf|r:-m elf64mmix}" -/* Put unused option values here. */ -extern const char *mmix_cc1_ignored_option; - -#define TARGET_OPTIONS \ - {{"set-program-start=", &mmix_cc1_ignored_option, \ - N_("Set start-address of the program"), 0}, \ - {"set-data-start=", &mmix_cc1_ignored_option, \ - N_("Set start-address of data"), 0} } - /* FIXME: There's no provision for profiling here. */ #define STARTFILE_SPEC \ "crti%O%s crtbegin%O%s" @@ -156,80 +147,8 @@ extern const char *mmix_cc1_ignored_option; extern int target_flags; -#define TARGET_MASK_LIBFUNCS 1 -#define TARGET_MASK_ABI_GNU 2 -#define TARGET_MASK_FCMP_EPSILON 4 -#define TARGET_MASK_ZERO_EXTEND 8 -#define TARGET_MASK_KNUTH_DIVISION 16 -#define TARGET_MASK_TOPLEVEL_SYMBOLS 32 -#define TARGET_MASK_BRANCH_PREDICT 64 -#define TARGET_MASK_USE_RETURN_INSN 128 - -/* We use the term "base address" since that's what Knuth uses. The base - address goes in a global register. When addressing, it's more like - "base address plus offset", with the offset being 0..255 from the base, - which itself can be a symbol plus an offset. The effect is like having - a constant pool in global registers, code offsetting from those - registers (automatically causing a request for a suitable constant base - address register) without having to know the specific register or the - specific offset. The setback is that there's a limited number of - registers, and you'll not find out until link time whether you - should have compiled with -mno-base-addresses. */ -#define TARGET_MASK_BASE_ADDRESSES 128 - -/* FIXME: Get rid of this one. */ -#define TARGET_LIBFUNC (target_flags & TARGET_MASK_LIBFUNCS) -#define TARGET_ABI_GNU (target_flags & TARGET_MASK_ABI_GNU) -#define TARGET_FCMP_EPSILON (target_flags & TARGET_MASK_FCMP_EPSILON) -#define TARGET_ZERO_EXTEND (target_flags & TARGET_MASK_ZERO_EXTEND) -#define TARGET_KNUTH_DIVISION (target_flags & TARGET_MASK_KNUTH_DIVISION) -#define TARGET_TOPLEVEL_SYMBOLS (target_flags & TARGET_MASK_TOPLEVEL_SYMBOLS) -#define TARGET_BRANCH_PREDICT (target_flags & TARGET_MASK_BRANCH_PREDICT) -#define TARGET_BASE_ADDRESSES (target_flags & TARGET_MASK_BASE_ADDRESSES) -#define TARGET_USE_RETURN_INSN (target_flags & TARGET_MASK_USE_RETURN_INSN) - #define TARGET_DEFAULT \ - (TARGET_MASK_BRANCH_PREDICT | TARGET_MASK_BASE_ADDRESSES \ - | TARGET_MASK_USE_RETURN_INSN) - -/* FIXME: Provide a way to *load* the epsilon register. */ -#define TARGET_SWITCHES \ - {{"libfuncs", TARGET_MASK_LIBFUNCS, \ - N_("For intrinsics library: pass all parameters in registers")}, \ - {"no-libfuncs", -TARGET_MASK_LIBFUNCS, ""}, \ - {"abi=mmixware", -TARGET_MASK_ABI_GNU, \ - N_("Use register stack for parameters and return value")}, \ - {"abi=gnu", TARGET_MASK_ABI_GNU, \ - N_("Use call-clobbered registers for parameters and return value")}, \ - {"epsilon", TARGET_MASK_FCMP_EPSILON, \ - N_("Use epsilon-respecting floating point compare instructions")}, \ - {"no-epsilon", -TARGET_MASK_FCMP_EPSILON, ""}, \ - {"zero-extend", TARGET_MASK_ZERO_EXTEND, \ - N_("Use zero-extending memory loads, not sign-extending ones")}, \ - {"no-zero-extend", -TARGET_MASK_ZERO_EXTEND, ""}, \ - {"knuthdiv", TARGET_MASK_KNUTH_DIVISION, \ - N_("Generate divide results with reminder having the same sign as the\ - divisor (not the dividend)")}, \ - {"no-knuthdiv", -TARGET_MASK_KNUTH_DIVISION, ""}, \ - {"toplevel-symbols", TARGET_MASK_TOPLEVEL_SYMBOLS, \ - N_("Prepend global symbols with \":\" (for use with PREFIX)")}, \ - {"no-toplevel-symbols", -TARGET_MASK_TOPLEVEL_SYMBOLS, \ - N_("Do not provide a default start-address 0x100 of the program")}, \ - {"elf", 0, \ - N_("Link to emit program in ELF format (rather than mmo)")}, \ - {"branch-predict", TARGET_MASK_BRANCH_PREDICT, \ - N_("Use P-mnemonics for branches statically predicted as taken")}, \ - {"no-branch-predict", -TARGET_MASK_BRANCH_PREDICT, \ - N_("Don't use P-mnemonics for branches")}, \ - {"base-addresses", TARGET_MASK_BASE_ADDRESSES, \ - N_("Use addresses that allocate global registers")}, \ - {"no-base-addresses", -TARGET_MASK_BASE_ADDRESSES, \ - N_("Do not use addresses that allocate global registers")}, \ - {"single-exit", -TARGET_MASK_USE_RETURN_INSN, \ - N_("Generate a single exit point for each function")}, \ - {"no-single-exit", TARGET_MASK_USE_RETURN_INSN, \ - N_("Do not generate a single exit point for each function")}, \ - {"", TARGET_DEFAULT, ""}} + (MASK_BRANCH_PREDICT | MASK_BASE_ADDRESSES | MASK_USE_RETURN_INSN) /* Unfortunately, this must not reference anything in "mmix.c". */ #define TARGET_VERSION \ @@ -1045,27 +964,6 @@ typedef struct { int regs; int lib; } CUMULATIVE_ARGS; /* Node: Misc */ -#define PREDICATE_CODES \ - {"mmix_reg_cc_operand", {SUBREG, REG}}, \ - {"mmix_foldable_comparison_operator", \ - {NE, EQ, GE, GT, LE, LT}}, \ - /* All '<', actually. */ \ - {"mmix_comparison_operator", \ - {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, \ - LTU, UNORDERED, ORDERED, UNEQ, UNGE, UNLE, \ - UNLT, LTGT}}, \ - {"mmix_symbolic_or_address_operand", \ - {SYMBOL_REF, LABEL_REF, CONST, \ - SUBREG, REG, PLUS}}, \ - {"mmix_reg_or_constant_operand", \ - {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ - {"mmix_reg_or_8bit_operand", \ - {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, \ - {"mmix_reg_or_0_operand", \ - {CONST_INT, CONST_DOUBLE, SUBREG, REG}}, - -#define SPECIAL_MODE_PREDICATES "mmix_symbolic_or_address_operand", - /* There's no way to get a PC-relative offset into tables for SImode, so for the moment we have absolute entries in DImode. When we're going ELF, these should be SImode and 1. */ diff --git a/gcc/config/mmix/mmix.md b/gcc/config/mmix/mmix.md index 827ed4bd946..75e1446b4ab 100644 --- a/gcc/config/mmix/mmix.md +++ b/gcc/config/mmix/mmix.md @@ -1,5 +1,5 @@ ;; GCC machine description for MMIX -;; Copyright (C) 2000, 2001, 2002, 2003, 2004 +;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by Hans-Peter Nilsson (hp@bitrange.com) @@ -40,7 +40,11 @@ (MMIX_rR_REGNUM 260) (MMIX_fp_rO_OFFSET -24)] ) + +;; Operand and operator predicates. +(include "predicates.md") + ;; FIXME: Can we remove the reg-to-reg for smaller modes? Shouldn't they ;; be synthesized ok? (define_insn "movqi" @@ -1078,6 +1082,16 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2") "" " { + /* The caller checks that the operand is generally valid as an + address, but at -O0 nothing makes sure that it's also a valid + call address for a *call*; a mmix_symbolic_or_address_operand. + Force into a register if it isn't. */ + if (!mmix_symbolic_or_address_operand (XEXP (operands[0], 0), + GET_MODE (XEXP (operands[0], 0)))) + operands[0] + = replace_equiv_address (operands[0], + force_reg (Pmode, XEXP (operands[0], 0))); + /* Since the epilogue 'uses' the return address, and it is clobbered in the call, and we set it back after every call (all but one setting will be optimized away), integrity is maintained. */ @@ -1105,6 +1119,16 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2") "" " { + /* The caller checks that the operand is generally valid as an + address, but at -O0 nothing makes sure that it's also a valid + call address for a *call*; a mmix_symbolic_or_address_operand. + Force into a register if it isn't. */ + if (!mmix_symbolic_or_address_operand (XEXP (operands[1], 0), + GET_MODE (XEXP (operands[1], 0)))) + operands[1] + = replace_equiv_address (operands[1], + force_reg (Pmode, XEXP (operands[1], 0))); + /* Since the epilogue 'uses' the return address, and it is clobbered in the call, and we set it back after every call (all but one setting will be optimized away), integrity is maintained. */ @@ -1216,7 +1240,7 @@ DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\;CSNN %0,$255,%2") ;; the frame-pointer would be located). ;; In the nonlocal goto receiver, we unwind the register stack by a series ;; of "pop 0,0" until rO equals the saved value. (If it goes lower, we -;; should call abort.) +;; should die with a trap.) (define_expand "nonlocal_goto_receiver" [(parallel [(unspec_volatile [(const_int 0)] 1) (clobber (scratch:DI)) diff --git a/gcc/config/mmix/mmix.opt b/gcc/config/mmix/mmix.opt new file mode 100644 index 00000000000..5bbad5fcbb1 --- /dev/null +++ b/gcc/config/mmix/mmix.opt @@ -0,0 +1,100 @@ +; Options for the MMIX port of the compiler. + +; Copyright (C) 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. + +; FIXME: Get rid of this one. +mlibfuncs +Target Report Mask(LIBFUNC) +For intrinsics library: pass all parameters in registers + +mabi=mmixware +Target Report RejectNegative InverseMask(ABI_GNU) +Use register stack for parameters and return value + +mabi=gnu +Target Report RejectNegative Mask(ABI_GNU) +Use call-clobbered registers for parameters and return value + +; FIXME: Provide a way to *load* the epsilon register. +mepsilon +Target Report Mask(FCMP_EPSILON) +Use epsilon-respecting floating point compare instructions + +mzero-extend +Target Report Mask(ZERO_EXTEND) +Use zero-extending memory loads, not sign-extending ones + +mknuthdiv +Target Report Mask(KNUTH_DIVISION) +Generate divide results with reminder having the same sign as the divisor (not the dividend) + +mtoplevel-symbols +Target Report Mask(TOPLEVEL_SYMBOLS) +Prepend global symbols with \":\" (for use with PREFIX) + +mno-set-program-start +Target Report RejectNegative +Do not provide a default start-address 0x100 of the program + +melf +Target Report RejectNegative +Link to emit program in ELF format (rather than mmo) + +mbranch-predict +Target Report RejectNegative Mask(BRANCH_PREDICT) +Use P-mnemonics for branches statically predicted as taken + +mno-branch-predict +Target Report RejectNegative InverseMask(BRANCH_PREDICT) +Don't use P-mnemonics for branches + +; We use the term "base address" since that's what Knuth uses. The base +; address goes in a global register. When addressing, it's more like +; "base address plus offset", with the offset being 0..255 from the base, +; which itself can be a symbol plus an offset. The effect is like having +; a constant pool in global registers, code offsetting from those +; registers (automatically causing a request for a suitable constant base +; address register) without having to know the specific register or the +; specific offset. The setback is that there's a limited number of +; registers, and you'll not find out until link time whether you +; should have compiled with -mno-base-addresses. +mbase-addresses +Target Report RejectNegative Mask(BASE_ADDRESSES) +Use addresses that allocate global registers + +mno-base-addresses +Target Report RejectNegative InverseMask(BASE_ADDRESSES) +Do not use addresses that allocate global registers + +msingle-exit +Target Report RejectNegative InverseMask(USE_RETURN_INSN) +Generate a single exit point for each function + +mno-single-exit +Target Report RejectNegative Mask(USE_RETURN_INSN) +Do not generate a single exit point for each function + +mset-program-start= +Target Report RejectNegative Joined +Set start-address of the program + +mset-data-start= +Target Report RejectNegative Joined +Set start-address of data diff --git a/gcc/config/mmix/predicates.md b/gcc/config/mmix/predicates.md new file mode 100644 index 00000000000..c74c561b57d --- /dev/null +++ b/gcc/config/mmix/predicates.md @@ -0,0 +1,151 @@ +;; Operand and operator predicates for the GCC MMIX port. +;; Copyright (C) 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, 51 Franklin Street - Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;; True if this is a foldable comparison operator +;; - one where a the result of (compare:CC (reg) (const_int 0)) can be +;; replaced by (reg). */ + +(define_predicate "mmix_foldable_comparison_operator" + (match_code "ne, eq, ge, gt, le, lt, gtu, leu") +{ + RTX_CODE code = GET_CODE (op); + + if (mode == VOIDmode) + mode = GET_MODE (op); + + /* This little bit is why the body of this predicate is kept as C. */ + if (mode == VOIDmode) + mode = GET_MODE (XEXP (op, 0)); + + return ((mode == CCmode || mode == DImode) + && (code == NE || code == EQ || code == GE || code == GT + || code == LE || code == LT)) + /* FIXME: This may be a stupid trick. What happens when GCC wants to + reverse the condition? Can it do that by itself? Maybe it can + even reverse the condition to fit a foldable one in the first + place? */ + || (mode == CC_UNSmode && (code == GTU || code == LEU)); +}) + +;; Like comparison_operator, but only true if this comparison operator is +;; applied to a valid mode. Needed to avoid jump.c generating invalid +;; code with -ffast-math (gcc.dg/20001228-1.c). + +(define_predicate "mmix_comparison_operator" + (match_operand 0 "comparison_operator") +{ + RTX_CODE code = GET_CODE (op); + + /* Comparison operators usually don't have a mode, but let's try and get + one anyway for the day that changes. */ + if (mode == VOIDmode) + mode = GET_MODE (op); + + /* Get the mode from the first operand if we don't have one. + Also the reason why we do this in C. */ + if (mode == VOIDmode) + mode = GET_MODE (XEXP (op, 0)); + + /* FIXME: This needs to be kept in sync with the tables in + mmix_output_condition. */ + return + mode == VOIDmode + || (mode == CC_FUNmode + && (code == ORDERED || code == UNORDERED)) + || (mode == CC_FPmode + && (code == GT || code == LT)) + || (mode == CC_FPEQmode + && (code == NE || code == EQ)) + || (mode == CC_UNSmode + && (code == GEU || code == GTU || code == LEU || code == LTU)) + || (mode == CCmode + && (code == NE || code == EQ || code == GE || code == GT + || code == LE || code == LT)) + || (mode == DImode + && (code == NE || code == EQ || code == GE || code == GT + || code == LE || code == LT || code == LEU || code == GTU)); +}) + +;; True if this is a register with a condition-code mode. + +(define_predicate "mmix_reg_cc_operand" + (and (match_operand 0 "register_operand") + (ior (match_test "GET_MODE (op) == CCmode") + (ior (match_test "GET_MODE (op) == CC_UNSmode") + (ior (match_test "GET_MODE (op) == CC_FPmode") + (ior (match_test "GET_MODE (op) == CC_FPEQmode") + (match_test "GET_MODE (op) == CC_FUNmode"))))))) + +;; True if this is an address_operand or a symbolic operand. + +(define_predicate "mmix_symbolic_or_address_operand" + (match_code "symbol_ref, label_ref, const, subreg, reg, plus") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + case LABEL_REF: + return 1; + case CONST: + /* The reason why this body still is C. */ + op = XEXP (op, 0); + if ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == LABEL_REF) + && (GET_CODE (XEXP (op, 1)) == CONST_INT + || (GET_CODE (XEXP (op, 1)) == CONST_DOUBLE + && GET_MODE (XEXP (op, 1)) == VOIDmode))) + return 1; + /* Fall through. */ + default: + return address_operand (op, mode); + } +}) + +;; True if this is a register or CONST_INT (or CONST_DOUBLE for DImode). +;; We could narrow the value down with a couple of predicates, but that +;; doesn't seem to be worth it at the moment. + +(define_predicate "mmix_reg_or_constant_operand" + (ior (match_operand 0 "register_operand") + (ior (match_code "const_int") + (and (match_code "const_double") + (match_test "GET_MODE (op) == VOIDmode"))))) + +;; True if this is a register or 0 (int or float). + +(define_predicate "mmix_reg_or_0_operand" + (ior + (match_operand 0 "register_operand") + (ior + (and (match_code "const_int") + (match_test "op == const0_rtx")) + (and + (match_code "const_double") + ;; FIXME: Is mode calculation necessary and correct? + (match_test + "op == CONST0_RTX (mode == VOIDmode ? GET_MODE (op) : mode)"))))) + +;; True if this is a register or an int 0..255. + +(define_predicate "mmix_reg_or_8bit_operand" + (ior + (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "CONST_OK_FOR_LETTER_P (INTVAL (op), 'I')")))) diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h index 4a67179eb7f..ddbaced1578 100644 --- a/gcc/config/mn10300/linux.h +++ b/gcc/config/mn10300/linux.h @@ -40,15 +40,8 @@ %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ %{static:-static}" -#undef TARGET_SWITCHES -#define TARGET_SWITCHES \ - {{ "am33", -0x4, N_("Target the AM33 processor") }, \ - { "am33-2", 6, N_("Target the AM33/2.0 processor") }, \ - { "relax", 0, N_("Enable linker relaxations") }, \ - { "", TARGET_DEFAULT, NULL }} - -#undef TARGET_DEFAULT -#define TARGET_DEFAULT 6 +#undef PROCESSOR_DEFAULT +#define PROCESSOR_DEFAULT PROCESSOR_AM33_2 #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (AM33/2.0 GNU/Linux)"); diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h index 77af9a9b131..19c0f971bd6 100644 --- a/gcc/config/mn10300/mn10300-protos.h +++ b/gcc/config/mn10300/mn10300-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Matsushita MN10300 series - Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). This file is part of GCC. @@ -25,6 +25,7 @@ Boston, MA 02111-1307, USA. */ extern void mn10300_va_start (tree, rtx); #endif /* TREE_CODE */ +extern void mn10300_override_options (void); extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode); extern rtx legitimize_pic_address (rtx, rtx); extern int legitimate_pic_operand_p (rtx); @@ -40,9 +41,7 @@ extern enum reg_class secondary_reload_class (enum reg_class, extern const char *output_tst (rtx, rtx); extern int store_multiple_operation (rtx, enum machine_mode); extern int symbolic_operand (rtx, enum machine_mode); -extern int call_address_operand (rtx, enum machine_mode); extern int impossible_plus_operand (rtx, enum machine_mode); -extern int const_8bit_operand (rtx, enum machine_mode); extern bool mn10300_wide_const_load_uses_clr (rtx operands[2]); #endif /* RTX_CODE */ diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 16832054c0d..2c36223dcfc 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Matsushita MN10300 series - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). @@ -54,6 +54,9 @@ int mn10300_unspec_int_label_counter; symbol names from register names. */ int mn10300_protect_label; +/* The selected processor. */ +enum processor_type mn10300_processor = PROCESSOR_DEFAULT; + /* The size of the callee register save area. Right now we save everything on entry since it costs us nothing in code size. It does cost us from a speed standpoint, so we want to optimize this sooner or later. */ @@ -65,6 +68,7 @@ int mn10300_protect_label; || regs_ever_live[16] || regs_ever_live[17])) +static bool mn10300_handle_option (size_t, const char *, int); static int mn10300_address_cost_1 (rtx, int *); static int mn10300_address_cost (rtx); static bool mn10300_rtx_costs (rtx, int, int, int *); @@ -90,6 +94,11 @@ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS MASK_MULT_BUG +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION mn10300_handle_option + #undef TARGET_ENCODE_SECTION_INFO #define TARGET_ENCODE_SECTION_INFO mn10300_encode_section_info @@ -110,6 +119,37 @@ static int mn10300_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, static void mn10300_encode_section_info (tree, rtx, int); struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +mn10300_handle_option (size_t code, + const char *arg ATTRIBUTE_UNUSED, + int value) +{ + switch (code) + { + case OPT_mam33: + mn10300_processor = value ? PROCESSOR_AM33 : PROCESSOR_MN10300; + return true; + case OPT_mam33_2: + mn10300_processor = (value + ? PROCESSOR_AM33_2 + : MIN (PROCESSOR_AM33, PROCESSOR_DEFAULT)); + return true; + default: + return true; + } +} + +/* Implement OVERRIDE_OPTIONS. */ + +void +mn10300_override_options (void) +{ + if (TARGET_AM33) + target_flags &= ~MASK_MULT_BUG; +} + static void mn10300_file_start (void) { @@ -180,7 +220,7 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "ul"); break; default: - abort (); + gcc_unreachable (); } break; } @@ -218,7 +258,7 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "cs"); break; default: - abort (); + gcc_unreachable (); } break; case 'C': @@ -249,7 +289,7 @@ print_operand (FILE *file, rtx x, int code) break; default: - abort (); + gcc_unreachable (); } break; @@ -308,7 +348,7 @@ print_operand (FILE *file, rtx x, int code) } default: - abort (); + gcc_unreachable (); } break; @@ -344,7 +384,7 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "0x%lx", val[1]); break;; case SFmode: - abort (); + gcc_unreachable (); case VOIDmode: case DImode: print_operand_address (file, @@ -365,7 +405,7 @@ print_operand (FILE *file, rtx x, int code) } default: - abort (); + gcc_unreachable (); } break; @@ -379,14 +419,12 @@ print_operand (FILE *file, rtx x, int code) break; case 'N': - if (INTVAL (x) < -128 || INTVAL (x) > 255) - abort (); + gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255); fprintf (file, "%d", (int)((~INTVAL (x)) & 0xff)); break; case 'U': - if (INTVAL (x) < -128 || INTVAL (x) > 255) - abort (); + gcc_assert (INTVAL (x) >= -128 && INTVAL (x) <= 255); fprintf (file, "%d", (int)(INTVAL (x) & 0xff)); break; @@ -444,7 +482,7 @@ print_operand (FILE *file, rtx x, int code) print_operand_address (file, x); break; default: - abort (); + gcc_unreachable (); } break; } @@ -474,7 +512,7 @@ print_operand_address (FILE *file, rtx addr) && REG_OK_FOR_BASE_P (XEXP (addr, 1))) base = XEXP (addr, 1), index = XEXP (addr, 0); else - abort (); + gcc_unreachable (); print_operand (file, index, 0); fputc (',', file); print_operand (file, base, 0);; @@ -531,8 +569,7 @@ mn10300_print_reg_list (FILE *file, int mask) if ((mask & 0x3c000) != 0) { - if ((mask & 0x3c000) != 0x3c000) - abort(); + gcc_assert ((mask & 0x3c000) == 0x3c000); if (need_comma) fputc (',', file); fputs ("exreg1", file); @@ -843,7 +880,7 @@ expand_prologue (void) break; default: - abort (); + gcc_unreachable (); } /* Now prepare register a0, if we have decided to use it. */ @@ -865,7 +902,7 @@ expand_prologue (void) break; default: - abort (); + gcc_unreachable (); } /* Now actually save the FP registers. */ @@ -1081,7 +1118,7 @@ expand_epilogue (void) break; default: - abort (); + gcc_unreachable (); } } @@ -1212,7 +1249,7 @@ notice_update_cc (rtx body, rtx insn) break; default: - abort (); + gcc_unreachable (); } } @@ -1295,17 +1332,6 @@ store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return mask; } -/* Return true if OP is a valid call operand. */ - -int -call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (flag_pic) - return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG); - - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); -} - /* What (if any) secondary registers are needed to move IN with mode MODE into a register in register class CLASS. @@ -1414,7 +1440,7 @@ initial_offset (int from, int to) + (current_function_outgoing_args_size ? current_function_outgoing_args_size + 4 : 0)); - abort (); + gcc_unreachable (); } /* Worker function for TARGET_RETURN_IN_MEMORY. */ @@ -1675,24 +1701,6 @@ impossible_plus_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return 0; } -/* Return 1 if X is a CONST_INT that is only 8 bits wide. This is used - for the btst insn which may examine memory or a register (the memory - variant only allows an unsigned 8 bit integer). */ -int -const_8bit_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) >= 0 - && INTVAL (op) < 256); -} - -/* Return true if the operand is the 1.0f constant. */ -int -const_1f_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (op == CONST1_RTX (SFmode)); -} - /* Similarly, but when using a zero_extract pattern for a btst where the source operand might end up in memory. */ int @@ -1925,7 +1933,7 @@ mn10300_address_cost_1 (rtx x, int *unsig) return 5; default: - abort (); + gcc_unreachable (); } case PLUS: @@ -1962,7 +1970,7 @@ mn10300_address_cost_1 (rtx x, int *unsig) return 8; default: - abort (); + gcc_unreachable (); } } diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h index 121d087a1e5..c42a6529393 100644 --- a/gcc/config/mn10300/mn10300.h +++ b/gcc/config/mn10300/mn10300.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Matsushita MN10300 series - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). @@ -42,46 +42,25 @@ Boston, MA 02111-1307, USA. */ #define CPP_SPEC "%{mam33:-D__AM33__} %{mam33-2:-D__AM33__=2 -D__AM33_2__}" -/* Run-time compilation parameters selecting different hardware subsets. */ +extern GTY(()) int mn10300_unspec_int_label_counter; -extern int target_flags; +enum processor_type { + PROCESSOR_MN10300, + PROCESSOR_AM33, + PROCESSOR_AM33_2 +}; -extern GTY(()) int mn10300_unspec_int_label_counter; +extern enum processor_type mn10300_processor; -/* Macros used in the machine description to test the flags. */ - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -/* Generate code to work around mul/mulq bugs on the mn10300. */ -#define TARGET_MULT_BUG (target_flags & 0x1) - -/* Generate code for the AM33 processor. */ -#define TARGET_AM33 (target_flags & 0x2) - -/* Generate code for the AM33/2.0 processor. */ -#define TARGET_AM33_2 (target_flags & 0x4) - -#define TARGET_SWITCHES \ - {{ "mult-bug", 0x1, N_("Work around hardware multiply bug")}, \ - { "no-mult-bug", -0x1, N_("Do not work around hardware multiply bug")},\ - { "am33", 0x2, N_("Target the AM33 processor")}, \ - { "am33", -(0x1), ""},\ - { "no-am33", -0x2, ""}, \ - { "no-crt0", 0, N_("No default crt0.o") }, \ - { "am33-2", 0x6, N_("Target the AM33/2.0 processor")}, \ - { "am33-2", -(0x1), ""},\ - { "no-am33-2", -0x4, ""}, \ - { "relax", 0, N_("Enable linker relaxations") }, \ - { "", TARGET_DEFAULT, NULL}} - -#ifndef TARGET_DEFAULT -#define TARGET_DEFAULT 0x1 +#define TARGET_AM33 (mn10300_processor >= PROCESSOR_AM33) +#define TARGET_AM33_2 (mn10300_processor == PROCESSOR_AM33_2) + +#ifndef PROCESSOR_DEFAULT +#define PROCESSOR_DEFAULT PROCESSOR_MN10300 #endif +#define OVERRIDE_OPTIONS mn10300_override_options () + /* Print subsidiary information on the compiler version in use. */ #define TARGET_VERSION fprintf (stderr, " (MN10300)"); @@ -1073,11 +1052,6 @@ while (0) #define FILE_ASM_OP "\t.file\n" -#define PREDICATE_CODES \ - {"const_1f_operand", {CONST_INT, CONST_DOUBLE}}, \ - {"const_8bit_operand", {CONST_INT}}, \ - {"call_address_operand", {SYMBOL_REF, REG, UNSPEC}}, - typedef struct mn10300_cc_status_mdep { int fpCC; diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md index 8b6933b4aa6..7dc94998885 100644 --- a/gcc/config/mn10300/mn10300.md +++ b/gcc/config/mn10300/mn10300.md @@ -1,5 +1,5 @@ ;; GCC machine description for Matsushita MN10300 -;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by Jeff Law (law@cygnus.com). @@ -47,6 +47,8 @@ (UNSPEC_GOTOFF 3) (UNSPEC_PLT 4) ]) + +(include "predicates.md") ;; ---------------------------------------------------------------------- ;; MOVE INSTRUCTIONS @@ -107,7 +109,7 @@ case 6: return \"fmov %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")]) @@ -140,7 +142,7 @@ case 4: return \"movbu %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")]) @@ -200,7 +202,7 @@ case 6: return \"fmov %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")]) @@ -232,7 +234,7 @@ case 4: return \"movhu %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")]) @@ -376,7 +378,7 @@ case 16: return \"fmov %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit,none,none_0hit,none_0hit")]) @@ -426,7 +428,7 @@ } return \"mov %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "none,none,none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")]) @@ -507,8 +509,7 @@ while (GET_CODE (temp) == SUBREG) temp = SUBREG_REG (temp); - if (GET_CODE (temp) != REG) - abort (); + gcc_assert (GET_CODE (temp) == REG); if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)), XEXP (operands[1], 0))) @@ -596,7 +597,7 @@ else return \"fmov %L1, %L0\;fmov %H1, %H0\"; default: - abort (); + gcc_unreachable (); } }" [(set (attr "cc") @@ -719,8 +720,7 @@ while (GET_CODE (temp) == SUBREG) temp = SUBREG_REG (temp); - if (GET_CODE (temp) != REG) - abort (); + gcc_assert (GET_CODE (temp) == REG); if (reg_overlap_mentioned_p (gen_rtx_REG (SImode, REGNO (temp)), XEXP (operands[1], 0))) @@ -788,7 +788,7 @@ return \"\"; } default: - abort (); + gcc_unreachable (); } }" [(set (attr "cc") @@ -969,7 +969,7 @@ return \"mov %2,%0\;add %1,%0\"; } default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "set_zn,none_0hit,set_zn,none_0hit,set_zn,none_0hit,set_zn")]) @@ -1011,7 +1011,7 @@ return \"mov %1,%0\;add %2,%0\"; return \"mov %2,%0\;add %1,%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "cc" "set_zn,none_0hit,none_0hit,set_zn,none_0hit,set_zn")]) @@ -2185,8 +2185,7 @@ operand_subword_force (operands[1], 1, DFmode), GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -2220,8 +2219,7 @@ result = expand_binop (SImode, and_optab, operand_subword_force (operands[1], 0, SFmode), GEN_INT (0x7fffffff), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -2256,8 +2254,7 @@ GEN_INT (trunc_int_for_mode (0x80000000, SImode)), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); @@ -2292,8 +2289,7 @@ operand_subword_force (operands[1], 0, SFmode), GEN_INT (trunc_int_for_mode (0x80000000, SImode)), target, 0, OPTAB_WIDEN); - if (result == 0) - abort (); + gcc_assert (result); if (result != target) emit_move_insn (result, target); diff --git a/gcc/config/mn10300/mn10300.opt b/gcc/config/mn10300/mn10300.opt new file mode 100644 index 00000000000..31161c9ab09 --- /dev/null +++ b/gcc/config/mn10300/mn10300.opt @@ -0,0 +1,37 @@ +; Options for the Matsushita MN10300 port of the compiler. + +; Copyright (C) 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. + +mam33 +Target +Target the AM33 processor + +mam33-2 +Target +Target the AM33/2.0 processor + +mmult-bug +Target Report Mask(MULT_BUG) +Work around hardware multiply bug + +; Ignored by the compiler +mrelax +Target RejectNegative +Enable linker relaxations diff --git a/gcc/config/mn10300/predicates.md b/gcc/config/mn10300/predicates.md new file mode 100644 index 00000000000..752ccd89d4f --- /dev/null +++ b/gcc/config/mn10300/predicates.md @@ -0,0 +1,50 @@ +;; Predicate definitions for Matsushita MN10300. +;; Copyright (C) 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. + +;; Return true if the operand is the 1.0f constant. + +(define_predicate "const_1f_operand" + (match_code "const_int,const_double") +{ + return (op == CONST1_RTX (SFmode)); +}) + +;; Return 1 if X is a CONST_INT that is only 8 bits wide. This is +;; used for the btst insn which may examine memory or a register (the +;; memory variant only allows an unsigned 8 bit integer). + +(define_predicate "const_8bit_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT + && INTVAL (op) >= 0 + && INTVAL (op) < 256); +}) + +;; Return true if OP is a valid call operand. + +(define_predicate "call_address_operand" + (match_code "symbol_ref,reg,unspec") +{ + if (flag_pic) + return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG); + + return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); +}) diff --git a/gcc/config/ns32k/netbsd.h b/gcc/config/ns32k/netbsd.h index e30c496c36b..c829f07c4d8 100644 --- a/gcc/config/ns32k/netbsd.h +++ b/gcc/config/ns32k/netbsd.h @@ -1,5 +1,5 @@ /* Configuration for a ns32532 running NetBSD as the target machine. - Copyright (C) 1988, 1994, 1995, 1996, 1998, 2002, 2004 + Copyright (C) 1988, 1994, 1995, 1996, 1998, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -36,8 +36,7 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (MASK_32532 | MASK_NO_SB | MASK_NO_BITFIELD | \ - MASK_32381 | MASK_IEEE_COMPARE | MASK_MULT_ADD) + (MASK_32532 | MASK_32381 | MASK_IEEE_COMPARE | MASK_MULT_ADD) /* 32-bit alignment for efficiency */ diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c index bad908d49d5..f15e5dcc418 100644 --- a/gcc/config/ns32k/ns32k.c +++ b/gcc/config/ns32k/ns32k.c @@ -1,5 +1,6 @@ /* Subroutines for assembler code output on the NS32000. - Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004 + Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -64,6 +65,7 @@ const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = static const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES; +static bool ns32k_handle_option (size_t, const char *, int); static rtx gen_indexed_expr (rtx, rtx, rtx); static const char *singlemove_string (rtx *); static void move_tail (rtx[], int, int); @@ -94,6 +96,11 @@ static int ns32k_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, #undef TARGET_ASM_FUNCTION_EPILOGUE #define TARGET_ASM_FUNCTION_EPILOGUE ns32k_output_function_epilogue +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION ns32k_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS ns32k_rtx_costs #undef TARGET_ADDRESS_COST @@ -110,6 +117,35 @@ static int ns32k_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +ns32k_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, + int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_m32081: + target_flags &= ~MASK_32381; + return true; + + case OPT_msoft_float: + target_flags &= ~(MASK_32081 | MASK_32381); + return true; + + case OPT_m32332: + target_flags &= ~MASK_32532; + return true; + + case OPT_m32032: + target_flags &= ~(MASK_32332 | MASK_32532); + return true; + + default: + return true; + } +} + /* Generate the assembly code for function entry. FILE is a stdio stream to output the code to. SIZE is an int: how many units of temporary storage to allocate. @@ -1070,7 +1106,7 @@ ns32k_handle_fntype_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h index 414656b6053..65e9bcf558f 100644 --- a/gcc/config/ns32k/ns32k.h +++ b/gcc/config/ns32k/ns32k.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. NS32000 version. Copyright (C) 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2004 Free Software Foundation, Inc. + 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -78,99 +78,6 @@ Boston, MA 02111-1307, USA. */ #define PUT_EXTERNAL_PREFIX(FILE) #endif -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* Masks for target_flags */ -#define MASK_32081 1 -#define MASK_RTD 2 -#define MASK_REGPARM 4 -#define MASK_32532 8 -#define MASK_32332 16 -#define MASK_NO_SB 32 -#define MASK_NO_BITFIELD 64 -#define MASK_HIMEM 128 -#define MASK_32381 256 -#define MASK_MULT_ADD 512 -#define MASK_SRC 1024 -#define MASK_IEEE_COMPARE 2048 - -/* Macros used in the machine description to test the flags. */ - -/* Compile 32081 insns for floating point (not library calls). */ -#define TARGET_32081 (target_flags & MASK_32081) -#define TARGET_32381 (target_flags & MASK_32381) - -/* The use of multiply-add instructions is optional because there may - * be cases where it produces worse code. - */ - -#define TARGET_MULT_ADD (target_flags & MASK_MULT_ADD) - -/* Compile using rtd insn calling sequence. - This will not work unless you use prototypes at least - for all functions that can take varying numbers of args. */ -#define TARGET_RTD (target_flags & MASK_RTD) - -/* Compile passing first two args in regs 0 and 1. */ -#define TARGET_REGPARM (target_flags & MASK_REGPARM) - -/* Options to select type of CPU, for better optimization. - The output is correct for any kind of 32000 regardless of these options. */ -#define TARGET_32532 (target_flags & MASK_32532) -#define TARGET_32332 (target_flags & MASK_32332) - -/* Ok to use the static base register (and presume it's 0) */ -#define TARGET_SB ((target_flags & MASK_NO_SB) == 0) - -#define TARGET_HIMEM (target_flags & MASK_HIMEM) - -/* Compile using bit-field insns. */ -#define TARGET_BITFIELD ((target_flags & MASK_NO_BITFIELD) == 0) - -#define TARGET_IEEE_COMPARE (target_flags & MASK_IEEE_COMPARE) - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ -#define TARGET_SWITCHES \ - { { "32081", MASK_32081, N_("Use hardware fp")}, \ - { "soft-float", -(MASK_32081|MASK_32381), \ - N_("Don't use hardware fp")}, \ - { "rtd", MASK_RTD, N_("Alternative calling convention")}, \ - { "nortd", -MASK_RTD, N_("Use normal calling convention")}, \ - { "regparm", MASK_REGPARM, N_("Pass some arguments in registers")}, \ - { "noregparm", -MASK_REGPARM, N_("Pass all arguments on stack")}, \ - { "32532", MASK_32532|MASK_32332, N_("Optimize for 32532 cpu")}, \ - { "32332", MASK_32332, N_("Optimize for 32332 cpu")}, \ - { "32332", -MASK_32532, 0}, \ - { "32032", -(MASK_32532|MASK_32332), N_("Optimize for 32032")}, \ - { "sb", -MASK_NO_SB, \ - N_("Register sb is zero. Use for absolute addressing")}, \ - { "nosb", MASK_NO_SB, N_("Do not use register sb")}, \ - { "bitfield", -MASK_NO_BITFIELD, \ - N_("Use bit-field instructions")}, \ - { "nobitfield", MASK_NO_BITFIELD, \ - N_("Do not use bit-field instructions")}, \ - { "himem", MASK_HIMEM, N_("Generate code for high memory")}, \ - { "nohimem", -MASK_HIMEM, N_("Generate code for low memory")}, \ - { "32381", MASK_32381, N_("32381 fpu")}, \ - { "mult-add", MASK_MULT_ADD, \ - N_("Use multiply-accumulate fp instructions")}, \ - { "nomult-add", -MASK_MULT_ADD, \ - N_("Do not use multiply-accumulate fp instructions") }, \ - { "src", MASK_SRC, N_("\"Small register classes\" kludge")}, \ - { "nosrc", -MASK_SRC, N_("No \"Small register classes\" kludge")}, \ - { "ieee-compare", MASK_IEEE_COMPARE, N_("Use IEEE math for fp comparisons")}, \ - { "noieee-compare", -MASK_IEEE_COMPARE, \ - N_("Do not use IEEE math for fp comparisons")}, \ - { "", TARGET_DEFAULT, 0}} - -/* TARGET_DEFAULT is defined in encore.h, pc532.h, etc. */ - /* When we are generating PIC, the sb is used as a pointer to the GOT. 32381 is a superset of 32081 */ @@ -179,7 +86,7 @@ extern int target_flags; if (target_flags & MASK_32532) \ target_flags |= MASK_32332; \ if (flag_pic || TARGET_HIMEM) \ - target_flags |= MASK_NO_SB; \ + target_flags &= ~MASK_SB; \ if (TARGET_32381) \ target_flags |= MASK_32081; \ else \ diff --git a/gcc/config/ns32k/ns32k.opt b/gcc/config/ns32k/ns32k.opt new file mode 100644 index 00000000000..d31bdafea9d --- /dev/null +++ b/gcc/config/ns32k/ns32k.opt @@ -0,0 +1,108 @@ +; Options for the NS32000 port of the compiler. + +; Copyright (C) 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. + +m32032 +Target RejectNegative +Optimize for 32032 + +m32081 +Target RejectNegative Report Mask(32081) +Use hardware fp + +m32332 +Target RejectNegative Report Mask(32332) +Optimize for 32332 + +m32381 +Target RejectNegative Report Mask(32381) +Use the 32381 fpu + +m32532 +Target RejectNegative Report Mask(32532) +Optimize for 32532 + +mbitfield +Target RejectNegative Report Mask(BITFIELD) +Use bit-field instructions + +mhimem +Target RejectNegative Report Mask(HIMEM) +Generate code for high memory + +mieee-compare +Target RejectNegative Report Mask(IEEE_COMPARE) +Use IEEE math for fp comparisons + +mmult-add +Target RejectNegative Report Mask(MULT_ADD) +Use multiply-accumulate fp instructions + +mnobitfield +Target RejectNegative Report InverseMask(BITFIELD) +Do not use bit-field instructions + +mnohimem +Target RejectNegative Report InverseMask(HIMEM) +Generate code for low memory + +mnoieee-compare +Target RejectNegative Report InverseMask(IEEE_COMPARE) +Do not use IEEE math for fp comparisons + +mnomult-add +Target RejectNegative Report InverseMask(MULT_ADD) +Do not use multiply-accumulate fp instructions + +mnoregparm +Target RejectNegative Report InverseMask(REGPARM) +Pass all arguments on the stack + +mnortd +Target RejectNegative Report InverseMask(RTD) +Use the normal calling convention + +mnosb +Target RejectNegative Report InverseMask(SB) +Do not use register sb + +mnosrc +Target RejectNegative Report InverseMask(SRC) +Do not use the 'small register classes' kludge + +mregparm +Target RejectNegative Report Mask(REGPARM) +Pass some arguments in registers + +mrtd +Target RejectNegative Report Mask(RTD) +Use an alternative calling convention + +msb +Target RejectNegative Report Mask(SB) +Register sb is zero, use it for absolute addressing + +msoft-float +Target RejectNegative +Do not use hardware fp + +msrc +Target RejectNegative Report Mask(SRC) +Use the 'small register classes' kludge diff --git a/gcc/config/pa/pa-hpux.h b/gcc/config/pa/pa-hpux.h index 958c9efa6ac..e5cde4a7dc1 100644 --- a/gcc/config/pa/pa-hpux.h +++ b/gcc/config/pa/pa-hpux.h @@ -91,11 +91,6 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \ - { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") }, - /* Like the default, except no -lg. */ #undef LIB_SPEC #define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}" diff --git a/gcc/config/pa/pa-hpux.opt b/gcc/config/pa/pa-hpux.opt new file mode 100644 index 00000000000..7485db2ba1f --- /dev/null +++ b/gcc/config/pa/pa-hpux.opt @@ -0,0 +1,32 @@ +; Options for the HP PA-RISC port of the compiler. + +; Copyright (C) 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. + +msio +Target RejectNegative Mask(SIO) MaskExists +Generate cpp defines for server IO + +munix=93 +Target RejectNegative +Specify UNIX standard for predefines and linking + +mwsio +Target RejectNegative InverseMask(SIO) +Generate cpp defines for workstation IO diff --git a/gcc/config/pa/pa-hpux10.h b/gcc/config/pa/pa-hpux10.h index 8c24793265d..7738a250588 100644 --- a/gcc/config/pa/pa-hpux10.h +++ b/gcc/config/pa/pa-hpux10.h @@ -78,12 +78,6 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - { "unix=", &pa_unix_string, \ - N_("Specify UNIX standard for predefines and linking.\n" \ - "Supported value is 93."), 0} - #define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}" /* We can debug dynamically linked executables on hpux9; we also want diff --git a/gcc/config/pa/pa-hpux1010.h b/gcc/config/pa/pa-hpux1010.h index a6bf9b9ddff..d86c7864928 100644 --- a/gcc/config/pa/pa-hpux1010.h +++ b/gcc/config/pa/pa-hpux1010.h @@ -22,12 +22,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_HPUX_10_10 #define TARGET_HPUX_10_10 1 -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - { "unix=", &pa_unix_string, \ - N_("Specify UNIX standard for predefines and linking.\n" \ - "Supported values are 93 and 95."), 0} - #undef STARTFILE_SPEC #define STARTFILE_SPEC \ "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \ diff --git a/gcc/config/pa/pa-hpux1010.opt b/gcc/config/pa/pa-hpux1010.opt new file mode 100644 index 00000000000..4dd6b5f64b4 --- /dev/null +++ b/gcc/config/pa/pa-hpux1010.opt @@ -0,0 +1,24 @@ +; Options for the HP PA-RISC port of the compiler. + +; Copyright (C) 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. + +munix=95 +Target RejectNegative +Specify UNIX standard for predefines and linking diff --git a/gcc/config/pa/pa-hpux11.h b/gcc/config/pa/pa-hpux11.h index 1350591be7e..72e3bfa483e 100644 --- a/gcc/config/pa/pa-hpux11.h +++ b/gcc/config/pa/pa-hpux11.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for HP PA-RISC - Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 + Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -66,7 +66,7 @@ Boston, MA 02111-1307, USA. */ } \ if (!TARGET_64BIT) \ builtin_define ("_ILP32"); \ - if (flag_pa_unix >= 1995) \ + if (flag_pa_unix >= 1995 && !flag_iso) \ { \ builtin_define ("_XOPEN_UNIX"); \ builtin_define ("_XOPEN_SOURCE_EXTENDED"); \ @@ -75,11 +75,14 @@ Boston, MA 02111-1307, USA. */ { \ if (flag_pa_unix >= 1998) \ { \ - builtin_define ("_INCLUDE__STDC_A1_SOURCE"); \ - builtin_define ("_INCLUDE_XOPEN_SOURCE_500"); \ + if (flag_isoc94 || flag_isoc99 || c_dialect_cxx() \ + || !flag_iso) \ + builtin_define ("_INCLUDE__STDC_A1_SOURCE"); \ + if (!flag_iso) \ + builtin_define ("_INCLUDE_XOPEN_SOURCE_500"); \ } \ else if (flag_isoc94 || flag_isoc99 || c_dialect_cxx ()) \ - warning ("-munix=98 option required for C89 " \ + warning (0, "-munix=98 option required for C89 " \ "Amendment 1 features.\n"); \ } \ if (TARGET_SIO) \ @@ -93,12 +96,6 @@ Boston, MA 02111-1307, USA. */ } \ while (0) -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - { "unix=", &pa_unix_string, \ - N_("Specify UNIX standard for predefines and linking.\n" \ - "Supported values are 93 and 95."), 0} - #undef CPP_SPEC #define CPP_SPEC \ "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}" diff --git a/gcc/config/pa/pa-hpux1111.h b/gcc/config/pa/pa-hpux1111.h index 48780783577..ac359ecba1e 100644 --- a/gcc/config/pa/pa-hpux1111.h +++ b/gcc/config/pa/pa-hpux1111.h @@ -22,12 +22,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_HPUX_11_11 #define TARGET_HPUX_11_11 1 -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - { "unix=", &pa_unix_string, \ - N_("Specify UNIX standard for predefines and linking.\n" \ - "Supported values are 93, 95 and 98."), 0} - #undef STARTFILE_SPEC #define STARTFILE_SPEC \ "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \ diff --git a/gcc/config/pa/pa-hpux1111.opt b/gcc/config/pa/pa-hpux1111.opt new file mode 100644 index 00000000000..76464a0c267 --- /dev/null +++ b/gcc/config/pa/pa-hpux1111.opt @@ -0,0 +1,24 @@ +; Options for the HP PA-RISC port of the compiler. + +; Copyright (C) 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. + +munix=98 +Target RejectNegative +Specify UNIX standard for predefines and linking diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index 065433a355b..87bb7f2a0b1 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -176,6 +176,9 @@ extern void pa_asm_output_aligned_local (FILE *, const char *, unsigned int); extern void pa_hpux_asm_output_external (FILE *, tree, const char *); +extern const int magic_milli[]; +extern int shadd_constant_p (int); + /* Functions in varasm.c used by pa.c. */ extern void som_readonly_data_section (void); extern void som_one_only_readonly_data_section (void); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index fce8c8c2d7f..37670f874c5 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -84,6 +84,7 @@ hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn) static void copy_reg_pointer (rtx, rtx); static void fix_range (const char *); +static bool pa_handle_option (size_t, const char *, int); static int hppa_address_cost (rtx); static bool hppa_rtx_costs (rtx, int, int, int *); static inline rtx force_mode (enum machine_mode, rtx); @@ -91,7 +92,6 @@ static void pa_reorg (void); static void pa_combine_instructions (void); static int pa_can_combine_p (rtx, rtx, rtx, int, rtx, rtx, rtx); static int forward_branch_p (rtx); -static int shadd_constant_p (int); static void compute_zdepwi_operands (unsigned HOST_WIDE_INT, unsigned *); static int compute_movmem_length (rtx); static int compute_clrmem_length (rtx); @@ -156,26 +156,11 @@ static struct machine_function * pa_init_machine_status (void); rtx hppa_compare_op0, hppa_compare_op1; enum cmp_type hppa_branch_type; -/* Which architecture we are generating code for. */ -enum architecture_type pa_arch; - -/* String to hold which architecture we are generating code for. */ -const char *pa_arch_string; - -/* String used with the -mfixed-range= option. */ -const char *pa_fixed_range_string; - /* Which cpu we are scheduling for. */ -enum processor_type pa_cpu; - -/* String to hold which cpu we are scheduling for. */ -const char *pa_cpu_string; - -/* String used with the -munix= option. */ -const char *pa_unix_string; +enum processor_type pa_cpu = TARGET_SCHED_DEFAULT; /* The UNIX standard to use for predefines and linking. */ -int flag_pa_unix; +int flag_pa_unix = TARGET_HPUX_11_11 ? 1998 : TARGET_HPUX_10_10 ? 1995 : 1993; /* Counts for the number of callee-saved general and floating point registers which were saved by the current function's prologue. */ @@ -260,6 +245,11 @@ static size_t n_deferred_plabels = 0; #define TARGET_ASM_DESTRUCTOR pa_asm_out_destructor #endif +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION pa_handle_option + #undef TARGET_INIT_BUILTINS #define TARGET_INIT_BUILTINS pa_init_builtins @@ -327,7 +317,7 @@ fix_range (const char *const_str) dash = strchr (str, '-'); if (!dash) { - warning ("value of -mfixed-range must have form REG1-REG2"); + warning (0, "value of -mfixed-range must have form REG1-REG2"); return; } *dash = '\0'; @@ -339,14 +329,14 @@ fix_range (const char *const_str) first = decode_reg_name (str); if (first < 0) { - warning ("unknown register name: %s", str); + warning (0, "unknown register name: %s", str); return; } last = decode_reg_name (dash + 1); if (last < 0) { - warning ("unknown register name: %s", dash + 1); + warning (0, "unknown register name: %s", dash + 1); return; } @@ -354,7 +344,7 @@ fix_range (const char *const_str) if (first > last) { - warning ("%s-%s is an empty range", str, dash + 1); + warning (0, "%s-%s is an empty range", str, dash + 1); return; } @@ -377,105 +367,78 @@ fix_range (const char *const_str) target_flags |= MASK_DISABLE_FPREGS; } -void -override_options (void) -{ - if (pa_cpu_string == NULL) - pa_cpu_string = TARGET_SCHED_DEFAULT; - - if (! strcmp (pa_cpu_string, "8000")) - { - pa_cpu_string = "8000"; - pa_cpu = PROCESSOR_8000; - } - else if (! strcmp (pa_cpu_string, "7100")) - { - pa_cpu_string = "7100"; - pa_cpu = PROCESSOR_7100; - } - else if (! strcmp (pa_cpu_string, "700")) - { - pa_cpu_string = "700"; - pa_cpu = PROCESSOR_700; - } - else if (! strcmp (pa_cpu_string, "7100LC")) - { - pa_cpu_string = "7100LC"; - pa_cpu = PROCESSOR_7100LC; - } - else if (! strcmp (pa_cpu_string, "7200")) - { - pa_cpu_string = "7200"; - pa_cpu = PROCESSOR_7200; - } - else if (! strcmp (pa_cpu_string, "7300")) - { - pa_cpu_string = "7300"; - pa_cpu = PROCESSOR_7300; - } - else - { - warning ("unknown -mschedule= option (%s).\nValid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n", pa_cpu_string); - } +/* Implement TARGET_HANDLE_OPTION. */ - /* Set the instruction architecture. */ - if (pa_arch_string && ! strcmp (pa_arch_string, "1.0")) +static bool +pa_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) { - pa_arch_string = "1.0"; - pa_arch = ARCHITECTURE_10; + case OPT_mnosnake: + case OPT_mpa_risc_1_0: + case OPT_march_1_0: target_flags &= ~(MASK_PA_11 | MASK_PA_20); - } - else if (pa_arch_string && ! strcmp (pa_arch_string, "1.1")) - { - pa_arch_string = "1.1"; - pa_arch = ARCHITECTURE_11; + return true; + + case OPT_msnake: + case OPT_mpa_risc_1_1: + case OPT_march_1_1: target_flags &= ~MASK_PA_20; target_flags |= MASK_PA_11; - } - else if (pa_arch_string && ! strcmp (pa_arch_string, "2.0")) - { - pa_arch_string = "2.0"; - pa_arch = ARCHITECTURE_20; - target_flags |= MASK_PA_11 | MASK_PA_20; - } - else if (pa_arch_string) - { - warning ("unknown -march= option (%s).\nValid options are 1.0, 1.1, and 2.0\n", pa_arch_string); - } + return true; - if (TARGET_HPUX) - { - /* Set the default UNIX standard for HP-UX. This affects the - predefines and startfiles used for the target. */ - if (pa_unix_string == NULL) - pa_unix_string - = TARGET_HPUX_11_11 ? "98" : (TARGET_HPUX_10_10 ? "95" : "93"); + case OPT_mpa_risc_2_0: + case OPT_march_2_0: + target_flags |= MASK_PA_11 | MASK_PA_20; + return true; - if (!strcmp (pa_unix_string, "93")) - flag_pa_unix = 1993; - else if (!strcmp (pa_unix_string, "95")) - flag_pa_unix = 1995; - else if (TARGET_HPUX_11_11) - { - if (!strcmp (pa_unix_string, "98")) - flag_pa_unix = 1998; - else - warning ("unknown -munix= option (%s).\n" - "Valid options are 93, 95 and 98.\n", - pa_unix_string); - } - else if (TARGET_HPUX_10_10) - warning ("unknown -munix= option (%s)." - "\nValid options are 93 and 95.\n", - pa_unix_string); + case OPT_mschedule_: + if (strcmp (arg, "8000") == 0) + pa_cpu = PROCESSOR_8000; + else if (strcmp (arg, "7100") == 0) + pa_cpu = PROCESSOR_7100; + else if (strcmp (arg, "700") == 0) + pa_cpu = PROCESSOR_700; + else if (strcmp (arg, "7100LC") == 0) + pa_cpu = PROCESSOR_7100LC; + else if (strcmp (arg, "7200") == 0) + pa_cpu = PROCESSOR_7200; + else if (strcmp (arg, "7300") == 0) + pa_cpu = PROCESSOR_7300; else - warning ("unknown -munix= option (%s).\nValid option is 93.\n", - pa_unix_string); - } + return false; + return true; + + case OPT_mfixed_range_: + fix_range (arg); + return true; + +#if TARGET_HPUX + case OPT_munix_93: + flag_pa_unix = 1993; + return true; +#endif + +#if TARGET_HPUX_10_10 + case OPT_munix_95: + flag_pa_unix = 1995; + return true; +#endif - if (pa_fixed_range_string) - fix_range (pa_fixed_range_string); +#if TARGET_HPUX_11_11 + case OPT_munix_98: + flag_pa_unix = 1998; + return true; +#endif + default: + return true; + } +} + +void +override_options (void) +{ /* Unconditional branches in the delay slot are not compatible with dwarf2 call frame information. There is no benefit in using this optimization on PA8000 and later processors. */ @@ -486,18 +449,18 @@ override_options (void) if (flag_pic && TARGET_PORTABLE_RUNTIME) { - warning ("PIC code generation is not supported in the portable runtime model\n"); + warning (0, "PIC code generation is not supported in the portable runtime model\n"); } if (flag_pic && TARGET_FAST_INDIRECT_CALLS) { - warning ("PIC code generation is not compatible with fast indirect calls\n"); + warning (0, "PIC code generation is not compatible with fast indirect calls\n"); } if (! TARGET_GAS && write_symbols != NO_DEBUG) { - warning ("-g is only supported when using GAS on this processor,"); - warning ("-g option disabled"); + warning (0, "-g is only supported when using GAS on this processor,"); + warning (0, "-g option disabled"); write_symbols = NO_DEBUG; } @@ -550,26 +513,6 @@ copy_reg_pointer (rtx to, rtx from) mark_reg_pointer (to, REGNO_POINTER_ALIGN (REGNO (from))); } -/* Return nonzero only if OP is a register of mode MODE, - or CONST0_RTX. */ -int -reg_or_0_operand (rtx op, enum machine_mode mode) -{ - return (op == CONST0_RTX (mode) || register_operand (op, mode)); -} - -/* Return nonzero if OP is suitable for use in a call to a named - function. - - For 2.5 try to eliminate either call_operand_address or - function_label_operand, they perform very similar functions. */ -int -call_operand_address (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_MODE (op) == word_mode - && CONSTANT_P (op) && ! TARGET_PORTABLE_RUNTIME); -} - /* Return 1 if X contains a symbolic expression. We know these expressions will have one of a few well defined forms, so we need only check those forms. */ @@ -584,95 +527,6 @@ symbolic_expression_p (rtx x) return (symbolic_operand (x, VOIDmode)); } -int -symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF: - case LABEL_REF: - return 1; - case CONST: - op = XEXP (op, 0); - return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF - || GET_CODE (XEXP (op, 0)) == LABEL_REF) - && GET_CODE (XEXP (op, 1)) == CONST_INT); - default: - return 0; - } -} - -/* Return truth value of statement that OP is a symbolic memory - operand of mode MODE. */ - -int -symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) != MEM) - return 0; - op = XEXP (op, 0); - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST - || GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF); -} - -/* Return 1 if the operand is either a register, zero, or a memory operand - that is not symbolic. */ - -int -reg_or_0_or_nonsymb_mem_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (op == CONST0_RTX (mode)) - return 1; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) != MEM) - return 0; - - /* Until problems with management of the REG_POINTER flag are resolved, - we need to delay creating move insns with unscaled indexed addresses - until CSE is not expected. */ - if (!TARGET_NO_SPACE_REGS - && !cse_not_expected - && GET_CODE (XEXP (op, 0)) == PLUS - && REG_P (XEXP (XEXP (op, 0), 0)) - && REG_P (XEXP (XEXP (op, 0), 1))) - return 0; - - return (!symbolic_memory_operand (op, mode) - && memory_address_p (mode, XEXP (op, 0))); -} - -/* Return 1 if the operand is a register operand or a non-symbolic memory - operand after reload. This predicate is used for branch patterns that - internally handle register reloading. We need to accept non-symbolic - memory operands after reload to ensure that the pattern is still valid - if reload didn't find a hard register for the operand. */ - -int -reg_before_reload_operand (rtx op, enum machine_mode mode) -{ - /* Don't accept a SUBREG since it will need a reload. */ - if (GET_CODE (op) == SUBREG) - return 0; - - if (register_operand (op, mode)) - return 1; - - if (reload_completed - && memory_operand (op, mode) - && !symbolic_memory_operand (op, mode)) - return 1; - - return 0; -} - /* Accept any constant that can be moved in one instruction into a general register. */ int @@ -683,198 +537,7 @@ cint_ok_for_move (HOST_WIDE_INT intval) || CONST_OK_FOR_LETTER_P (intval, 'N') || CONST_OK_FOR_LETTER_P (intval, 'K')); } - -/* Return 1 iff OP is an indexed memory operand. */ -int -indexed_memory_operand (rtx op, enum machine_mode mode) -{ - if (GET_MODE (op) != mode) - return 0; - - /* Before reload, a (SUBREG (MEM...)) forces reloading into a register. */ - if (reload_completed && GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode)) - return 0; - - op = XEXP (op, 0); - - return (memory_address_p (mode, op) && IS_INDEX_ADDR_P (op)); -} - -/* Accept anything that can be used as a destination operand for a - move instruction. We don't accept indexed memory operands since - they are supported only for floating point stores. */ -int -move_dest_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_MODE (op) != mode) - return 0; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode)) - return 0; - - op = XEXP (op, 0); - - return (memory_address_p (mode, op) - && !IS_INDEX_ADDR_P (op) - && !IS_LO_SUM_DLT_ADDR_P (op)); -} - -/* Accept anything that can be used as a source operand for a move - instruction. */ -int -move_src_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (GET_CODE (op) == CONST_INT) - return cint_ok_for_move (INTVAL (op)); - - if (GET_MODE (op) != mode) - return 0; - - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - if (GET_CODE (op) != MEM) - return 0; - - /* Until problems with management of the REG_POINTER flag are resolved, - we need to delay creating move insns with unscaled indexed addresses - until CSE is not expected. */ - if (!TARGET_NO_SPACE_REGS - && !cse_not_expected - && GET_CODE (XEXP (op, 0)) == PLUS - && REG_P (XEXP (XEXP (op, 0), 0)) - && REG_P (XEXP (XEXP (op, 0), 1))) - return 0; - - return memory_address_p (mode, XEXP (op, 0)); -} - -/* Accept anything that can be used as the source operand for a prefetch - instruction with a cache-control completer. */ -int -prefetch_cc_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != MEM) - return 0; - - op = XEXP (op, 0); - - /* We must reject virtual registers as we don't allow REG+D. */ - if (op == virtual_incoming_args_rtx - || op == virtual_stack_vars_rtx - || op == virtual_stack_dynamic_rtx - || op == virtual_outgoing_args_rtx - || op == virtual_cfa_rtx) - return 0; - - if (!REG_P (op) && !IS_INDEX_ADDR_P (op)) - return 0; - - /* Until problems with management of the REG_POINTER flag are resolved, - we need to delay creating prefetch insns with unscaled indexed addresses - until CSE is not expected. */ - if (!TARGET_NO_SPACE_REGS - && !cse_not_expected - && GET_CODE (op) == PLUS - && REG_P (XEXP (op, 0))) - return 0; - - return memory_address_p (mode, op); -} - -/* Accept anything that can be used as the source operand for a prefetch - instruction with no cache-control completer. */ -int -prefetch_nocc_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != MEM) - return 0; - - op = XEXP (op, 0); - - /* Until problems with management of the REG_POINTER flag are resolved, - we need to delay creating prefetch insns with unscaled indexed addresses - until CSE is not expected. */ - if (!TARGET_NO_SPACE_REGS - && !cse_not_expected - && GET_CODE (op) == PLUS - && REG_P (XEXP (op, 0)) - && REG_P (XEXP (op, 1))) - return 0; - - return memory_address_p (mode, op); -} - -/* Accept REG and any CONST_INT that can be moved in one instruction into a - general register. */ -int -reg_or_cint_move_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - return (GET_CODE (op) == CONST_INT && cint_ok_for_move (INTVAL (op))); -} - -int -pic_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (!flag_pic) - return 0; - - switch (GET_CODE (op)) - { - case LABEL_REF: - return 1; - case CONST: - op = XEXP (op, 0); - return (GET_CODE (XEXP (op, 0)) == LABEL_REF - && GET_CODE (XEXP (op, 1)) == CONST_INT); - default: - return 0; - } -} - -int -fp_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return reg_renumber && FP_REG_P (op); -} - - -/* Return truth value of whether OP can be used as an operand in a - three operand arithmetic insn that accepts registers of mode MODE - or 14-bit signed integers. */ -int -arith_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && INT_14_BITS (op))); -} - -/* Return truth value of whether OP can be used as an operand in a - three operand arithmetic insn that accepts registers of mode MODE - or 11-bit signed integers. */ -int -arith11_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && INT_11_BITS (op))); -} - /* Return truth value of whether OP can be used as an operand in a adddi3 insn. */ int @@ -885,94 +548,6 @@ adddi3_operand (rtx op, enum machine_mode mode) && (TARGET_64BIT ? INT_14_BITS (op) : INT_11_BITS (op)))); } -/* A constant integer suitable for use in a PRE_MODIFY memory - reference. */ -int -pre_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) >= -0x2000 && INTVAL (op) < 0x10); -} - -/* A constant integer suitable for use in a POST_MODIFY memory - reference. */ -int -post_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT - && INTVAL (op) < 0x2000 && INTVAL (op) >= -0x10); -} - -int -arith_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_DOUBLE - && GET_MODE (op) == mode - && VAL_14_BITS_P (CONST_DOUBLE_LOW (op)) - && ((CONST_DOUBLE_HIGH (op) >= 0) - == ((CONST_DOUBLE_LOW (op) & 0x1000) == 0)))); -} - -/* Return truth value of whether OP is an integer which fits the - range constraining immediate operands in three-address insns, or - is an integer register. */ - -int -ireg_or_int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT && INT_5_BITS (op)) - || (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32)); -} - -/* Return nonzero if OP is an integer register, else return zero. */ -int -ireg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32); -} - -/* Return truth value of whether OP is an integer which fits the - range constraining immediate operands in three-address insns. */ - -int -int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INT_5_BITS (op)); -} - -int -uint5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INT_U5_BITS (op)); -} - -int -int11_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && INT_11_BITS (op)); -} - -int -uint32_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ -#if HOST_BITS_PER_WIDE_INT > 32 - /* All allowed constants will fit a CONST_INT. */ - return (GET_CODE (op) == CONST_INT - && (INTVAL (op) >= 0 && INTVAL (op) < (HOST_WIDE_INT) 1 << 32)); -#else - return (GET_CODE (op) == CONST_INT - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0)); -#endif -} - -int -arith5_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) || int5_operand (op, mode); -} - /* True iff zdepi can be used to generate this CONST_INT. zdepi first sign extends a 5 bit signed number to a given field length, then places this field anywhere in a zero. */ @@ -1002,14 +577,6 @@ and_mask_p (unsigned HOST_WIDE_INT mask) return (mask & (mask - 1)) == 0; } -/* True iff depi or extru can be used to compute (reg & OP). */ -int -and_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && and_mask_p (INTVAL (op)))); -} - /* True iff depi can be used to compute (reg | MASK). */ int ior_mask_p (unsigned HOST_WIDE_INT mask) @@ -1017,44 +584,6 @@ ior_mask_p (unsigned HOST_WIDE_INT mask) mask += mask & -mask; return (mask & (mask - 1)) == 0; } - -/* True iff depi can be used to compute (reg | OP). */ -int -ior_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op))); -} - -int -lhs_lshift_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) || lhs_lshift_cint_operand (op, mode); -} - -/* True iff OP is a CONST_INT of the forms 0...0xxxx or 0...01...1xxxx. - Such values can be the left hand side x in (x << r), using the zvdepi - instruction. */ -int -lhs_lshift_cint_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - unsigned HOST_WIDE_INT x; - if (GET_CODE (op) != CONST_INT) - return 0; - x = INTVAL (op) >> 4; - return (x & (x + 1)) == 0; -} - -int -arith32_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) || GET_CODE (op) == CONST_INT; -} - -int -pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == PC || GET_CODE (op) == LABEL_REF); -} /* Legitimize PIC addresses. If the address is already position-independent, we return ORIG. Newly generated @@ -1087,8 +616,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) { rtx insn, tmp_reg; - if (reg == 0) - abort (); + gcc_assert (reg); /* Before reload, allocate a temporary register for the intermediate result. This allows the sequence to be deleted when the final @@ -1123,17 +651,12 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) return orig; - if (reg == 0) - abort (); - - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - orig = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); - } - else - abort (); + gcc_assert (reg); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); + orig = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, + base == reg ? 0 : reg); if (GET_CODE (orig) == CONST_INT) { @@ -1662,8 +1185,7 @@ force_mode (enum machine_mode mode, rtx orig) if (mode == GET_MODE (orig)) return orig; - if (REGNO (orig) >= FIRST_PSEUDO_REGISTER) - abort (); + gcc_assert (REGNO (orig) < FIRST_PSEUDO_REGISTER); return gen_rtx_REG (mode, REGNO (orig)); } @@ -1691,8 +1213,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) if (GET_CODE (operand0) == MEM && IS_INDEX_ADDR_P (XEXP (operand0, 0))) { /* This is only safe up to the beginning of life analysis. */ - if (no_new_pseudos) - abort (); + gcc_assert (!no_new_pseudos); tem = copy_to_mode_reg (Pmode, XEXP (operand0, 0)); operand0 = replace_equiv_address (operand0, tem); @@ -2066,8 +1587,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg) { /* Save away the constant part of the expression. */ const_part = XEXP (XEXP (operand1, 0), 1); - if (GET_CODE (const_part) != CONST_INT) - abort (); + gcc_assert (GET_CODE (const_part) == CONST_INT); /* Force the function label into memory. */ temp = force_const_mem (mode, XEXP (XEXP (operand1, 0), 0)); @@ -2409,8 +1929,7 @@ singlemove_string (rtx *operands) long i; REAL_VALUE_TYPE d; - if (GET_MODE (operands[1]) != SFmode) - abort (); + gcc_assert (GET_MODE (operands[1]) == SFmode); /* Translate the CONST_DOUBLE to a CONST_INT with the same target bit pattern. */ @@ -2545,11 +2064,8 @@ output_move_double (rtx *operands) optype1 = RNDOP; /* Check for the cases that the operand constraints are not - supposed to allow to happen. Abort if we get one, - because generating code for these cases is painful. */ - - if (optype0 != REGOP && optype1 != REGOP) - abort (); + supposed to allow to happen. */ + gcc_assert (optype0 == REGOP || optype1 == REGOP); /* Handle auto decrementing and incrementing loads and stores specifically, since the structure of the function doesn't work @@ -2568,40 +2084,33 @@ output_move_double (rtx *operands) rtx high_reg = gen_rtx_SUBREG (SImode, operands[1], 0); operands[0] = XEXP (addr, 0); - if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[1]) == REG + && GET_CODE (operands[0]) == REG); - if (!reg_overlap_mentioned_p (high_reg, addr)) - { - /* No overlap between high target register and address - register. (We do this in a non-obvious way to - save a register file writeback) */ - if (GET_CODE (addr) == POST_INC) - return "{stws|stw},ma %1,8(%0)\n\tstw %R1,-4(%0)"; - return "{stws|stw},ma %1,-8(%0)\n\tstw %R1,12(%0)"; - } - else - abort (); + gcc_assert (!reg_overlap_mentioned_p (high_reg, addr)); + + /* No overlap between high target register and address + register. (We do this in a non-obvious way to + save a register file writeback) */ + if (GET_CODE (addr) == POST_INC) + return "{stws|stw},ma %1,8(%0)\n\tstw %R1,-4(%0)"; + return "{stws|stw},ma %1,-8(%0)\n\tstw %R1,12(%0)"; } else if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC) { rtx high_reg = gen_rtx_SUBREG (SImode, operands[1], 0); operands[0] = XEXP (addr, 0); - if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG) - abort (); - - if (!reg_overlap_mentioned_p (high_reg, addr)) - { - /* No overlap between high target register and address - register. (We do this in a non-obvious way to - save a register file writeback) */ - if (GET_CODE (addr) == PRE_INC) - return "{stws|stw},mb %1,8(%0)\n\tstw %R1,4(%0)"; - return "{stws|stw},mb %1,-8(%0)\n\tstw %R1,4(%0)"; - } - else - abort (); + gcc_assert (GET_CODE (operands[1]) == REG + && GET_CODE (operands[0]) == REG); + + gcc_assert (!reg_overlap_mentioned_p (high_reg, addr)); + /* No overlap between high target register and address + register. (We do this in a non-obvious way to save a + register file writeback) */ + if (GET_CODE (addr) == PRE_INC) + return "{stws|stw},mb %1,8(%0)\n\tstw %R1,4(%0)"; + return "{stws|stw},mb %1,-8(%0)\n\tstw %R1,4(%0)"; } } if (optype1 == MEMOP) @@ -2615,8 +2124,8 @@ output_move_double (rtx *operands) rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0); operands[1] = XEXP (addr, 0); - if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG + && GET_CODE (operands[1]) == REG); if (!reg_overlap_mentioned_p (high_reg, addr)) { @@ -2642,8 +2151,8 @@ output_move_double (rtx *operands) rtx high_reg = gen_rtx_SUBREG (SImode, operands[0], 0); operands[1] = XEXP (addr, 0); - if (GET_CODE (operands[0]) != REG || GET_CODE (operands[1]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG + && GET_CODE (operands[1]) == REG); if (!reg_overlap_mentioned_p (high_reg, addr)) { @@ -2805,23 +2314,22 @@ output_fp_move_double (rtx *operands) { output_asm_insn ("fstd%F0 %1,%0", operands); } - else if (operands[1] == CONST0_RTX (GET_MODE (operands[0]))) + else { - if (GET_CODE (operands[0]) == REG) - { - rtx xoperands[2]; - xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); - xoperands[0] = operands[0]; - output_asm_insn ("copy %%r0,%0\n\tcopy %%r0,%1", xoperands); - } + rtx xoperands[2]; + + gcc_assert (operands[1] == CONST0_RTX (GET_MODE (operands[0]))); + /* This is a pain. You have to be prepared to deal with an arbitrary address here including pre/post increment/decrement. so avoid this in the MD. */ - else - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); + + xoperands[1] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1); + xoperands[0] = operands[0]; + output_asm_insn ("copy %%r0,%0\n\tcopy %%r0,%1", xoperands); } - else abort (); return ""; } @@ -2842,11 +2350,10 @@ find_addr_reg (rtx addr) else if (CONSTANT_P (XEXP (addr, 1))) addr = XEXP (addr, 0); else - abort (); + gcc_unreachable (); } - if (GET_CODE (addr) == REG) - return addr; - abort (); + gcc_assert (GET_CODE (addr) == REG); + return addr; } /* Emit code to perform a block move. @@ -2977,7 +2484,7 @@ output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) return ""; default: - abort (); + gcc_unreachable (); } } @@ -3119,7 +2626,7 @@ output_block_clear (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED) return ""; default: - abort (); + gcc_unreachable (); } } @@ -3179,15 +2686,13 @@ output_and (rtx *operands) if ((mask & (1 << ms0)) == 0) break; - if (ms0 != 32) - abort (); + gcc_assert (ms0 == 32); if (ls1 == 32) { len = ls0; - if (len == 0) - abort (); + gcc_assert (len); operands[2] = GEN_INT (len); return "{extru|extrw,u} %1,31,%2,%0"; @@ -3231,15 +2736,13 @@ output_64bit_and (rtx *operands) if ((mask & ((unsigned HOST_WIDE_INT) 1 << ms0)) == 0) break; - if (ms0 != HOST_BITS_PER_WIDE_INT) - abort (); + gcc_assert (ms0 == HOST_BITS_PER_WIDE_INT); if (ls1 == HOST_BITS_PER_WIDE_INT) { len = ls0; - if (len == 0) - abort (); + gcc_assert (len); operands[2] = GEN_INT (len); return "extrd,u %1,63,%2,%0"; @@ -3278,8 +2781,7 @@ output_ior (rtx *operands) if ((mask & (1 << bs1)) == 0) break; - if (bs1 != 32 && ((unsigned HOST_WIDE_INT) 1 << bs1) <= mask) - abort (); + gcc_assert (bs1 == 32 || ((unsigned HOST_WIDE_INT) 1 << bs1) > mask); p = 31 - bs0; len = bs1 - bs0; @@ -3308,9 +2810,8 @@ output_64bit_ior (rtx *operands) if ((mask & ((unsigned HOST_WIDE_INT) 1 << bs1)) == 0) break; - if (bs1 != HOST_BITS_PER_WIDE_INT - && ((unsigned HOST_WIDE_INT) 1 << bs1) <= mask) - abort (); + gcc_assert (bs1 == HOST_BITS_PER_WIDE_INT + || ((unsigned HOST_WIDE_INT) 1 << bs1) > mask); p = 63 - bs0; len = bs1 - bs0; @@ -3685,8 +3186,7 @@ store_reg_modify (int base, int reg, HOST_WIDE_INT mod) { rtx insn, basereg, srcreg, delta; - if (!VAL_14_BITS_P (mod)) - abort (); + gcc_assert (VAL_14_BITS_P (mod)); basereg = gen_rtx_REG (Pmode, base); srcreg = gen_rtx_REG (word_mode, reg); @@ -4740,8 +4240,9 @@ pa_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) attr_type = get_attr_type (insn); - if (REG_NOTE_KIND (link) == REG_DEP_ANTI) + switch (REG_NOTE_KIND (link)) { + case REG_DEP_ANTI: /* Anti dependency; DEP_INSN reads a register that INSN writes some cycles later. */ @@ -4821,9 +4322,8 @@ pa_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) /* For other anti dependencies, the cost is 0. */ return 0; - } - else if (REG_NOTE_KIND (link) == REG_DEP_OUTPUT) - { + + case REG_DEP_OUTPUT: /* Output dependency; DEP_INSN writes a register that INSN writes some cycles later. */ if (attr_type == TYPE_FPLOAD) @@ -4906,9 +4406,10 @@ pa_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost) /* For other output dependencies, the cost is 0. */ return 0; + + default: + gcc_unreachable (); } - else - abort (); } /* Adjust scheduling priorities. We use this to try and keep addil @@ -4958,7 +4459,7 @@ pa_issue_rate (void) case PROCESSOR_8000: return 4; default: - abort (); + gcc_unreachable (); } } @@ -5121,7 +4622,7 @@ print_operand (FILE *file, rtx x, int code) case LTU: fputs ("<<", file); break; default: - abort (); + gcc_unreachable (); } return; case 'N': /* Condition, (N)egated */ @@ -5148,7 +4649,7 @@ print_operand (FILE *file, rtx x, int code) case LTU: fputs (">>=", file); break; default: - abort (); + gcc_unreachable (); } return; /* For floating point comparisons. Note that the output @@ -5188,7 +4689,7 @@ print_operand (FILE *file, rtx x, int code) case ORDERED: fputs ("?", file); break; default: - abort (); + gcc_unreachable (); } return; case 'S': /* Condition, operands are (S)wapped. */ @@ -5215,7 +4716,7 @@ print_operand (FILE *file, rtx x, int code) case LTU: fputs (">>", file); break; default: - abort (); + gcc_unreachable (); } return; case 'B': /* Condition, (B)oth swapped and negate. */ @@ -5242,51 +4743,33 @@ print_operand (FILE *file, rtx x, int code) case LTU: fputs ("<<=", file); break; default: - abort (); + gcc_unreachable (); } return; case 'k': - if (GET_CODE (x) == CONST_INT) - { - fprintf (file, HOST_WIDE_INT_PRINT_DEC, ~INTVAL (x)); - return; - } - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, ~INTVAL (x)); + return; case 'Q': - if (GET_CODE (x) == CONST_INT) - { - fprintf (file, HOST_WIDE_INT_PRINT_DEC, 64 - (INTVAL (x) & 63)); - return; - } - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, 64 - (INTVAL (x) & 63)); + return; case 'L': - if (GET_CODE (x) == CONST_INT) - { - fprintf (file, HOST_WIDE_INT_PRINT_DEC, 32 - (INTVAL (x) & 31)); - return; - } - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, 32 - (INTVAL (x) & 31)); + return; case 'O': - if (GET_CODE (x) == CONST_INT && exact_log2 (INTVAL (x)) >= 0) - { - fprintf (file, "%d", exact_log2 (INTVAL (x))); - return; - } - abort (); + gcc_assert (GET_CODE (x) == CONST_INT && exact_log2 (INTVAL (x)) >= 0); + fprintf (file, "%d", exact_log2 (INTVAL (x))); + return; case 'p': - if (GET_CODE (x) == CONST_INT) - { - fprintf (file, HOST_WIDE_INT_PRINT_DEC, 63 - (INTVAL (x) & 63)); - return; - } - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, 63 - (INTVAL (x) & 63)); + return; case 'P': - if (GET_CODE (x) == CONST_INT) - { - fprintf (file, HOST_WIDE_INT_PRINT_DEC, 31 - (INTVAL (x) & 31)); - return; - } - abort (); + gcc_assert (GET_CODE (x) == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_DEC, 31 - (INTVAL (x) & 31)); + return; case 'I': if (GET_CODE (x) == CONST_INT) fputs ("i", file); @@ -5361,7 +4844,7 @@ print_operand (FILE *file, rtx x, int code) addresses. */ break; default: - abort (); + gcc_unreachable (); } if (GET_CODE (x) == REG) { @@ -5448,23 +4931,31 @@ output_global_address (FILE *file, rtx x, int round_constant) int offset = 0; /* assembler wants -$global$ at end */ rtx base = NULL_RTX; - if (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF) + switch (GET_CODE (XEXP (XEXP (x, 0), 0))) { + case SYMBOL_REF: base = XEXP (XEXP (x, 0), 0); output_addr_const (file, base); + break; + case CONST_INT: + offset = INTVAL (XEXP (XEXP (x, 0), 0)); + break; + default: + gcc_unreachable (); } - else if (GET_CODE (XEXP (XEXP (x, 0), 0)) == CONST_INT) - offset = INTVAL (XEXP (XEXP (x, 0), 0)); - else abort (); - if (GET_CODE (XEXP (XEXP (x, 0), 1)) == SYMBOL_REF) + switch (GET_CODE (XEXP (XEXP (x, 0), 1))) { + case SYMBOL_REF: base = XEXP (XEXP (x, 0), 1); output_addr_const (file, base); + break; + case CONST_INT: + offset = INTVAL (XEXP (XEXP (x, 0), 1)); + break; + default: + gcc_unreachable (); } - else if (GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT) - offset = INTVAL (XEXP (XEXP (x, 0), 1)); - else abort (); /* How bogus. The compiler is apparently responsible for rounding the constant if it uses an LR field selector. @@ -5478,8 +4969,9 @@ output_global_address (FILE *file, rtx x, int round_constant) if (round_constant) offset = ((offset + 0x1000) & ~0x1fff); - if (GET_CODE (XEXP (x, 0)) == PLUS) + switch (GET_CODE (XEXP (x, 0))) { + case PLUS: if (offset < 0) { offset = -offset; @@ -5487,12 +4979,17 @@ output_global_address (FILE *file, rtx x, int round_constant) } else sep = "+"; - } - else if (GET_CODE (XEXP (x, 0)) == MINUS - && (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)) - sep = "-"; - else abort (); + break; + + case MINUS: + gcc_assert (GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF); + sep = "-"; + break; + default: + gcc_unreachable (); + } + if (!read_only_operand (base, VOIDmode) && !flag_pic) fputs ("-$global$", file); if (offset) @@ -5741,8 +5238,7 @@ output_mul_insn (int unsignedp ATTRIBUTE_UNUSED, rtx insn) /* Emit the rtl for doing a division by a constant. */ /* Do magic division millicodes exist for this value? */ -static const int magic_milli[]= {0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, - 1, 1}; +const int magic_milli[]= {0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1}; /* We'll use an array to keep track of the magic millicodes and whether or not we've used them already. [n][0] is signed, [n][1] is @@ -5751,15 +5247,6 @@ static const int magic_milli[]= {0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, static int div_milli[16][2]; int -div_operand (rtx op, enum machine_mode mode) -{ - return (mode == SImode - && ((GET_CODE (op) == REG && REGNO (op) == 25) - || (GET_CODE (op) == CONST_INT && INTVAL (op) > 0 - && INTVAL (op) < 16 && magic_milli[INTVAL (op)]))); -} - -int emit_hpdiv_const (rtx *operands, int unsignedp) { if (GET_CODE (operands[2]) == CONST_INT @@ -5886,9 +5373,9 @@ output_arg_descriptor (rtx call_insn) return; } - if (GET_CODE (call_insn) != CALL_INSN) - abort (); - for (link = CALL_INSN_FUNCTION_USAGE (call_insn); link; link = XEXP (link, 1)) + gcc_assert (GET_CODE (call_insn) == CALL_INSN); + for (link = CALL_INSN_FUNCTION_USAGE (call_insn); + link; link = XEXP (link, 1)) { rtx use = XEXP (link, 0); @@ -6466,7 +5953,7 @@ output_cbranch (rtx *operands, int nullify, int length, int negated, rtx insn) return output_lbranch (operands[0], insn); default: - abort (); + gcc_unreachable (); } return buf; } @@ -6485,11 +5972,10 @@ output_lbranch (rtx dest, rtx insn) if (dbr_sequence_length () != 0) { /* We can't handle a jump in the delay slot. */ - if (GET_CODE (NEXT_INSN (insn)) == JUMP_INSN) - abort (); + gcc_assert (GET_CODE (NEXT_INSN (insn)) != JUMP_INSN); final_scan_insn (NEXT_INSN (insn), asm_out_file, - optimize, 0, 0, NULL); + optimize, 0, NULL); /* Now delete the delay insn. */ PUT_CODE (NEXT_INSN (insn), NOTE); @@ -6726,7 +6212,7 @@ output_bb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length, break; default: - abort (); + gcc_unreachable (); } return buf; } @@ -6871,7 +6357,7 @@ output_bvb (rtx *operands ATTRIBUTE_UNUSED, int nullify, int length, break; default: - abort (); + gcc_unreachable (); } return buf; } @@ -6920,13 +6406,15 @@ output_dbra (rtx *operands, rtx insn, int which_alternative) if (! nullify && length == 4 && dbr_sequence_length () == 0) nullify = forward_branch_p (insn); - /* Handle short versions first. */ - if (length == 4 && nullify) - return "addib,%C2,n %1,%0,%3"; - else if (length == 4 && ! nullify) - return "addib,%C2 %1,%0,%3"; - else if (length == 8) + switch (length) { + case 4: + if (nullify) + return "addib,%C2,n %1,%0,%3"; + else + return "addib,%C2 %1,%0,%3"; + + case 8: /* Handle weird backwards branch with a fulled delay slot which is nullified. */ if (dbr_sequence_length () != 0 @@ -6948,9 +6436,11 @@ output_dbra (rtx *operands, rtx insn, int which_alternative) return "addi,%N2 %1,%0,%0\n\tb,n %3"; else return "addi,%N2 %1,%0,%0\n\tb %3"; + + default: + gcc_unreachable (); } - else - abort (); + } /* Deal with gross reload from FP register case. */ else if (which_alternative == 1) @@ -7025,13 +6515,15 @@ output_movb (rtx *operands, rtx insn, int which_alternative, if (! nullify && length == 4 && dbr_sequence_length () == 0) nullify = forward_branch_p (insn); - /* Handle short versions first. */ - if (length == 4 && nullify) - return "movb,%C2,n %1,%0,%3"; - else if (length == 4 && ! nullify) - return "movb,%C2 %1,%0,%3"; - else if (length == 8) + switch (length) { + case 4: + if (nullify) + return "movb,%C2,n %1,%0,%3"; + else + return "movb,%C2 %1,%0,%3"; + + case 8: /* Handle weird backwards branch with a filled delay slot which is nullified. */ if (dbr_sequence_length () != 0 @@ -7053,9 +6545,10 @@ output_movb (rtx *operands, rtx insn, int which_alternative, return "or,%N2 %1,%%r0,%0\n\tb,n %3"; else return "or,%N2 %1,%%r0,%0\n\tb %3"; + + default: + gcc_unreachable (); } - else - abort (); } /* Deal with gross reload from FP register case. */ else if (which_alternative == 1) @@ -7493,7 +6986,7 @@ output_call (rtx insn, rtx call_dest, int sibcall) && !sibcall) { final_scan_insn (NEXT_INSN (insn), asm_out_file, - optimize, 0, 0, NULL); + optimize, 0, NULL); /* Now delete the delay insn. */ PUT_CODE (NEXT_INSN (insn), NOTE); @@ -7541,7 +7034,7 @@ output_call (rtx insn, rtx call_dest, int sibcall) /* A non-jump insn in the delay slot. By definition we can emit this insn before the call (and in fact before argument relocating. */ - final_scan_insn (NEXT_INSN (insn), asm_out_file, optimize, 0, 0, + final_scan_insn (NEXT_INSN (insn), asm_out_file, optimize, 0, NULL); /* Now delete the delay insn. */ @@ -7706,8 +7199,7 @@ output_call (rtx insn, rtx call_dest, int sibcall) return ""; /* A sibcall should never have a branch in the delay slot. */ - if (sibcall) - abort (); + gcc_assert (!sibcall); /* This call has an unconditional jump in its delay slot. */ xoperands[0] = XEXP (PATTERN (NEXT_INSN (insn)), 1); @@ -8345,7 +7837,7 @@ pa_asm_output_aligned_common (FILE *stream, max_common_align = TARGET_64BIT ? 128 : (size >= 4096 ? 256 : 64); if (align > max_common_align) { - warning ("alignment (%u) for %s exceeds maximum alignment " + warning (0, "alignment (%u) for %s exceeds maximum alignment " "for global common data. Using %u", align / BITS_PER_UNIT, name, max_common_align / BITS_PER_UNIT); align = max_common_align; @@ -8440,16 +7932,9 @@ fmpysuboperands (rtx *operands) return 1; } -int -plus_xor_ior_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == PLUS || GET_CODE (op) == XOR - || GET_CODE (op) == IOR); -} - /* Return 1 if the given constant is 2, 4, or 8. These are the valid constants for shadd instructions. */ -static int +int shadd_constant_p (int val) { if (val == 2 || val == 4 || val == 8) @@ -8458,14 +7943,6 @@ shadd_constant_p (int val) return 0; } -/* Return 1 if OP is a CONST_INT with the value 2, 4, or 8. These are - the valid constant for shadd instructions. */ -int -shadd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op))); -} - /* Return 1 if OP is valid as a base or index register in a REG+REG address. */ @@ -8528,14 +8005,6 @@ eq_neq_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) return (GET_CODE (op) == EQ || GET_CODE (op) == NE); } -/* Return 1 if OP is an operator suitable for use in a movb instruction. */ -int -movb_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == EQ || GET_CODE (op) == NE - || GET_CODE (op) == LT || GET_CODE (op) == GE); -} - /* Return 1 if INSN is in the delay slot of a call instruction. */ int jump_in_call_delay (rtx insn) @@ -9367,23 +8836,6 @@ pa_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, } -/* Return 1 if this is a comparison operator. This allows the use of - MATCH_OPERATOR to recognize all the branch insns. */ - -int -cmpib_comparison_operator (rtx op, enum machine_mode mode) -{ - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (GET_CODE (op) == EQ - || GET_CODE (op) == NE - || GET_CODE (op) == GT - || GET_CODE (op) == GTU - || GET_CODE (op) == GE - || GET_CODE (op) == LT - || GET_CODE (op) == LE - || GET_CODE (op) == LEU)); -} - /* Return a string to output before text in the current function. This function is only used with SOM. Because we don't support @@ -9507,18 +8959,18 @@ pa_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) at the end of the file if and only if SYMBOL_REF_REFERENCED_P is true. This avoids putting out names that are never really used. */ -struct extern_symbol GTY(()) +typedef struct extern_symbol GTY(()) { tree decl; const char *name; -}; -typedef struct extern_symbol *extern_symbol; +} extern_symbol; /* Define gc'd vector type for extern_symbol. */ -DEF_VEC_GC_P(extern_symbol); +DEF_VEC_O(extern_symbol); +DEF_VEC_ALLOC_O(extern_symbol,gc); /* Vector of extern_symbol pointers. */ -static GTY(()) VEC(extern_symbol) *extern_symbols; +static GTY(()) VEC(extern_symbol,gc) *extern_symbols; #ifdef ASM_OUTPUT_EXTERNAL_REAL /* Mark DECL (name NAME) as an external reference (assembler output @@ -9528,12 +8980,11 @@ static GTY(()) VEC(extern_symbol) *extern_symbols; void pa_hpux_asm_output_external (FILE *file, tree decl, const char *name) { - extern_symbol p = ggc_alloc (sizeof (struct extern_symbol)); + extern_symbol * p = VEC_safe_push (extern_symbol, gc, extern_symbols, NULL); gcc_assert (file == asm_out_file); p->decl = decl; p->name = name; - VEC_safe_push (extern_symbol, extern_symbols, p); } /* Output text required at the end of an assembler file. @@ -9544,7 +8995,7 @@ static void pa_hpux_file_end (void) { unsigned int i; - extern_symbol p; + extern_symbol *p; output_deferred_plabels (); @@ -9557,7 +9008,7 @@ pa_hpux_file_end (void) ASM_OUTPUT_EXTERNAL_REAL (asm_out_file, decl, p->name); } - extern_symbols = NULL; + VEC_free (extern_symbol, gc, extern_symbols); } #endif diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 30b982a0aec..f94d5316475 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -45,30 +45,10 @@ enum processor_type PROCESSOR_8000 }; -/* Which architecture to generate code for. */ - -enum architecture_type -{ - ARCHITECTURE_10, - ARCHITECTURE_11, - ARCHITECTURE_20 -}; - -struct rtx_def; - -/* For -march= option. */ -extern const char *pa_arch_string; -extern enum architecture_type pa_arch; - -/* For -mfixed-range= option. */ -extern const char *pa_fixed_range_string; - /* For -mschedule= option. */ -extern const char *pa_cpu_string; extern enum processor_type pa_cpu; /* For -munix= option. */ -extern const char *pa_unix_string; extern int flag_pa_unix; #define pa_cpu_attr ((enum attr_cpu)pa_cpu) @@ -77,105 +57,7 @@ extern int flag_pa_unix; #define TARGET_VERSION fputs (" (hppa)", stderr); -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* compile code for HP-PA 1.1 ("Snake"). */ - -#define MASK_PA_11 1 - -/* Disable all FP registers (they all become fixed). This may be necessary - for compiling kernels which perform lazy context switching of FP regs. - Note if you use this option and try to perform floating point operations - the compiler will abort! */ - -#define MASK_DISABLE_FPREGS 2 -#define TARGET_DISABLE_FPREGS (target_flags & MASK_DISABLE_FPREGS) - -/* Generate code which assumes that all space register are equivalent. - Triggers aggressive unscaled index addressing and faster - builtin_return_address. */ -#define MASK_NO_SPACE_REGS 4 -#define TARGET_NO_SPACE_REGS (target_flags & MASK_NO_SPACE_REGS) - -/* Allow unconditional jumps in the delay slots of call instructions. */ -#define MASK_JUMP_IN_DELAY 8 -#define TARGET_JUMP_IN_DELAY (target_flags & MASK_JUMP_IN_DELAY) - -/* Disable indexed addressing modes. */ -#define MASK_DISABLE_INDEXING 32 -#define TARGET_DISABLE_INDEXING (target_flags & MASK_DISABLE_INDEXING) - -/* Emit code which follows the new portable runtime calling conventions - HP wants everyone to use for ELF objects. If at all possible you want - to avoid this since it's a performance loss for non-prototyped code. - - Note TARGET_PORTABLE_RUNTIME also forces all calls to use inline - long-call stubs which is quite expensive. */ -#define MASK_PORTABLE_RUNTIME 64 -#define TARGET_PORTABLE_RUNTIME (target_flags & MASK_PORTABLE_RUNTIME) - -/* Emit directives only understood by GAS. This allows parameter - relocations to work for static functions. There is no way - to make them work the HP assembler at this time. */ -#define MASK_GAS 128 -#define TARGET_GAS (target_flags & MASK_GAS) - -/* Emit code for processors which do not have an FPU. */ -#define MASK_SOFT_FLOAT 256 -#define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT) - -/* Use 3-insn load/store sequences for access to large data segments - in shared libraries on hpux10. */ -#define MASK_LONG_LOAD_STORE 512 -#define TARGET_LONG_LOAD_STORE (target_flags & MASK_LONG_LOAD_STORE) - -/* Use a faster sequence for indirect calls. This assumes that calls - through function pointers will never cross a space boundary, and - that the executable is not dynamically linked. Such assumptions - are generally safe for building kernels and statically linked - executables. Code compiled with this option will fail miserably if - the executable is dynamically linked or uses nested functions! */ -#define MASK_FAST_INDIRECT_CALLS 1024 -#define TARGET_FAST_INDIRECT_CALLS (target_flags & MASK_FAST_INDIRECT_CALLS) - -/* Generate code with big switch statements to avoid out of range branches - occurring within the switch table. */ -#define MASK_BIG_SWITCH 2048 -#define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH) - -/* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be - true when this is true. */ -#define MASK_PA_20 4096 - -/* Generate cpp defines for server I/O. */ -#define MASK_SIO 8192 -#define TARGET_SIO (target_flags & MASK_SIO) - -/* Assume GNU linker by default. */ -#define MASK_GNU_LD 16384 -#ifndef TARGET_GNU_LD -#define TARGET_GNU_LD (target_flags & MASK_GNU_LD) -#endif - -/* Force generation of long calls. */ -#define MASK_LONG_CALLS 32768 -#ifndef TARGET_LONG_CALLS -#define TARGET_LONG_CALLS (target_flags & MASK_LONG_CALLS) -#endif - -#ifndef TARGET_PA_10 -#define TARGET_PA_10 (target_flags & (MASK_PA_11 | MASK_PA_20) == 0) -#endif - -#ifndef TARGET_PA_11 -#define TARGET_PA_11 (target_flags & MASK_PA_11) -#endif - -#ifndef TARGET_PA_20 -#define TARGET_PA_20 (target_flags & MASK_PA_20) -#endif +#define TARGET_PA_10 (!TARGET_PA_11 && !TARGET_PA_20) /* Generate code for the HPPA 2.0 architecture in 64bit mode. */ #ifndef TARGET_64BIT @@ -242,74 +124,6 @@ extern int target_flags; need to generate additional code to save SP into the frame marker. */ #define TARGET_HPUX_UNWIND_LIBRARY 0 -/* Macro to define tables used to set the flags. This is a - list in braces of target switches with each switch being - { "NAME", VALUE, "HELP_STRING" }. VALUE is the bits to set, - or minus the bits to clear. An empty string NAME is used to - identify the default VALUE. Do not mark empty strings for - translation. */ - -#define TARGET_SWITCHES \ - {{ "snake", MASK_PA_11, \ - N_("Generate PA1.1 code") }, \ - { "nosnake", -(MASK_PA_11 | MASK_PA_20), \ - N_("Generate PA1.0 code") }, \ - { "pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), \ - N_("Generate PA1.0 code") }, \ - { "pa-risc-1-1", MASK_PA_11, \ - N_("Generate PA1.1 code") }, \ - { "pa-risc-2-0", MASK_PA_20, \ - N_("Generate PA2.0 code (requires binutils 2.10 or later)") }, \ - { "disable-fpregs", MASK_DISABLE_FPREGS, \ - N_("Disable FP regs") }, \ - { "no-disable-fpregs", -MASK_DISABLE_FPREGS, \ - N_("Do not disable FP regs") }, \ - { "no-space-regs", MASK_NO_SPACE_REGS, \ - N_("Disable space regs") }, \ - { "space-regs", -MASK_NO_SPACE_REGS, \ - N_("Do not disable space regs") }, \ - { "jump-in-delay", MASK_JUMP_IN_DELAY, \ - N_("Put jumps in call delay slots") }, \ - { "no-jump-in-delay", -MASK_JUMP_IN_DELAY, \ - N_("Do not put jumps in call delay slots") }, \ - { "disable-indexing", MASK_DISABLE_INDEXING, \ - N_("Disable indexed addressing") }, \ - { "no-disable-indexing", -MASK_DISABLE_INDEXING, \ - N_("Do not disable indexed addressing") }, \ - { "portable-runtime", MASK_PORTABLE_RUNTIME, \ - N_("Use portable calling conventions") }, \ - { "no-portable-runtime", -MASK_PORTABLE_RUNTIME, \ - N_("Do not use portable calling conventions") }, \ - { "gas", MASK_GAS, \ - N_("Assume code will be assembled by GAS") }, \ - { "no-gas", -MASK_GAS, \ - N_("Do not assume code will be assembled by GAS") }, \ - { "soft-float", MASK_SOFT_FLOAT, \ - N_("Use software floating point") }, \ - { "no-soft-float", -MASK_SOFT_FLOAT, \ - N_("Do not use software floating point") }, \ - { "long-load-store", MASK_LONG_LOAD_STORE, \ - N_("Emit long load/store sequences") }, \ - { "no-long-load-store", -MASK_LONG_LOAD_STORE, \ - N_("Do not emit long load/store sequences") }, \ - { "fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, \ - N_("Generate fast indirect calls") }, \ - { "no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, \ - N_("Do not generate fast indirect calls") }, \ - { "big-switch", MASK_BIG_SWITCH, \ - N_("Generate code for huge switch statements") }, \ - { "no-big-switch", -MASK_BIG_SWITCH, \ - N_("Do not generate code for huge switch statements") }, \ - { "long-calls", MASK_LONG_CALLS, \ - N_("Always generate long calls") }, \ - { "no-long-calls", -MASK_LONG_CALLS, \ - N_("Generate long calls only when needed") }, \ - { "linker-opt", 0, \ - N_("Enable linker optimizations") }, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, \ - NULL }} - #ifndef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY | MASK_BIG_SWITCH) #endif @@ -318,28 +132,8 @@ extern int target_flags; #define TARGET_CPU_DEFAULT 0 #endif -#ifndef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES -#endif - #ifndef TARGET_SCHED_DEFAULT -#define TARGET_SCHED_DEFAULT "8000" -#endif - -#define TARGET_OPTIONS \ -{ \ - { "arch=", &pa_arch_string, \ - N_("Specify PA-RISC architecture for code generation.\n" \ - "Values are 1.0, 1.1 and 2.0."), 0}, \ - { "fixed-range=", &pa_fixed_range_string, \ - N_("Specify range of registers to make fixed."), 0}, \ - { "schedule=", &pa_cpu_string, \ - N_("Specify CPU for scheduling purposes."), 0}, \ - SUBTARGET_OPTIONS \ -} - -#ifndef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS +#define TARGET_SCHED_DEFAULT PROCESSOR_8000 #endif /* Support for a compile-time default CPU, et cetera. The rules are: @@ -2076,22 +1870,16 @@ forget_section (void) \ /* Print a memory address as an operand to reference that memory location. */ #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ -{ register rtx addr = ADDR; \ - register rtx base; \ - int offset; \ +{ rtx addr = ADDR; \ switch (GET_CODE (addr)) \ { \ case REG: \ fprintf (FILE, "0(%s)", reg_names [REGNO (addr)]); \ break; \ case PLUS: \ - if (GET_CODE (XEXP (addr, 0)) == CONST_INT) \ - offset = INTVAL (XEXP (addr, 0)), base = XEXP (addr, 1); \ - else if (GET_CODE (XEXP (addr, 1)) == CONST_INT) \ - offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0); \ - else \ - abort (); \ - fprintf (FILE, "%d(%s)", offset, reg_names [REGNO (base)]); \ + gcc_assert (GET_CODE (XEXP (addr, 1)) == CONST_INT); \ + fprintf (FILE, "%d(%s)", (int)INTVAL (XEXP (addr, 1)), \ + reg_names [REGNO (XEXP (addr, 0))]); \ break; \ case LO_SUM: \ if (!symbolic_operand (XEXP (addr, 1), VOIDmode)) \ @@ -2128,49 +1916,6 @@ forget_section (void) \ /* The number of Pmode words for the setjmp buffer. */ #define JMP_BUF_SIZE 50 -#define PREDICATE_CODES \ - {"reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ - {"call_operand_address", {LABEL_REF, SYMBOL_REF, CONST_INT, \ - CONST_DOUBLE, CONST, HIGH}}, \ - {"indexed_memory_operand", {SUBREG, MEM}}, \ - {"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \ - {"symbolic_memory_operand", {SUBREG, MEM}}, \ - {"reg_before_reload_operand", {REG, MEM}}, \ - {"reg_or_0_or_nonsymb_mem_operand", {SUBREG, REG, MEM, CONST_INT, \ - CONST_DOUBLE}}, \ - {"move_dest_operand", {SUBREG, REG, MEM}}, \ - {"move_src_operand", {SUBREG, REG, CONST_INT, MEM}}, \ - {"prefetch_cc_operand", {MEM}}, \ - {"prefetch_nocc_operand", {MEM}}, \ - {"reg_or_cint_move_operand", {SUBREG, REG, CONST_INT}}, \ - {"pic_label_operand", {LABEL_REF, CONST}}, \ - {"fp_reg_operand", {REG}}, \ - {"arith_operand", {SUBREG, REG, CONST_INT}}, \ - {"arith11_operand", {SUBREG, REG, CONST_INT}}, \ - {"pre_cint_operand", {CONST_INT}}, \ - {"post_cint_operand", {CONST_INT}}, \ - {"arith_double_operand", {SUBREG, REG, CONST_DOUBLE}}, \ - {"ireg_or_int5_operand", {CONST_INT, REG}}, \ - {"int5_operand", {CONST_INT}}, \ - {"uint5_operand", {CONST_INT}}, \ - {"int11_operand", {CONST_INT}}, \ - {"uint32_operand", {CONST_INT, \ - HOST_BITS_PER_WIDE_INT > 32 ? 0 : CONST_DOUBLE}}, \ - {"arith5_operand", {SUBREG, REG, CONST_INT}}, \ - {"and_operand", {SUBREG, REG, CONST_INT}}, \ - {"ior_operand", {CONST_INT}}, \ - {"lhs_lshift_cint_operand", {CONST_INT}}, \ - {"lhs_lshift_operand", {SUBREG, REG, CONST_INT}}, \ - {"arith32_operand", {SUBREG, REG, CONST_INT}}, \ - {"pc_or_label_operand", {PC, LABEL_REF}}, \ - {"plus_xor_ior_operator", {PLUS, XOR, IOR}}, \ - {"shadd_operand", {CONST_INT}}, \ - {"div_operand", {REG, CONST_INT}}, \ - {"ireg_operand", {REG}}, \ - {"cmpib_comparison_operator", {EQ, NE, LT, LE, LEU, \ - GT, GTU, GE}}, \ - {"movb_comparison_operator", {EQ, NE, LT, GE}}, - /* We need a libcall to canonicalize function pointers on TARGET_ELF32. */ #define CANONICALIZE_FUNCPTR_FOR_COMPARE_LIBCALL \ "__canonicalize_funcptr_for_compare" diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 6f8f42dd3e7..5e4faadf335 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -561,7 +561,7 @@ (eq_attr "cpu" "8000")) "inm_8000,fdivsqrt_8000*6,rnm_8000") - +(include "predicates.md") ;; Compare instructions. ;; This controls RTL generation and register allocation. @@ -2814,9 +2814,9 @@ "!is_function_label_plus_const (operands[2])" "* { - if (flag_pic && symbolic_operand (operands[2], Pmode)) - abort (); - else if (symbolic_operand (operands[2], Pmode)) + gcc_assert (!flag_pic || !symbolic_operand (operands[2], Pmode)); + + if (symbolic_operand (operands[2], Pmode)) return \"ldo RR'%G2(%1),%0\"; else return \"ldo R'%G2(%1),%0\"; @@ -4070,8 +4070,9 @@ rtx op0 = operands[0]; rtx op1 = operands[1]; - if (GET_CODE (op1) == CONST_INT) + switch (GET_CODE (op1)) { + case CONST_INT: operands[0] = operand_subword (op0, 1, 0, DImode); output_asm_insn (\"ldil L'%1,%0\", operands); @@ -4080,10 +4081,9 @@ output_asm_insn (\"ldi -1,%0\", operands); else output_asm_insn (\"ldi 0,%0\", operands); - return \"\"; - } - else if (GET_CODE (op1) == CONST_DOUBLE) - { + break; + + case CONST_DOUBLE: operands[0] = operand_subword (op0, 1, 0, DImode); operands[1] = GEN_INT (CONST_DOUBLE_LOW (op1)); output_asm_insn (\"ldil L'%1,%0\", operands); @@ -4091,10 +4091,12 @@ operands[0] = operand_subword (op0, 0, 0, DImode); operands[1] = GEN_INT (CONST_DOUBLE_HIGH (op1)); output_asm_insn (singlemove_string (operands), operands); - return \"\"; + break; + + default: + gcc_unreachable (); } - else - abort (); + return \"\"; }" [(set_attr "type" "move") (set_attr "length" "8")]) @@ -7070,8 +7072,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" the only method that we have for doing DImode multiplication is with a libcall. This could be trouble if we haven't allocated enough space for the outgoing arguments. */ - if (INTVAL (nb) > current_function_outgoing_args_size) - abort (); + gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size); emit_move_insn (arg_pointer_rtx, gen_rtx_PLUS (word_mode, stack_pointer_rtx, @@ -7570,8 +7571,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" the only method that we have for doing DImode multiplication is with a libcall. This could be trouble if we haven't allocated enough space for the outgoing arguments. */ - if (INTVAL (nb) > current_function_outgoing_args_size) - abort (); + gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size); emit_move_insn (arg_pointer_rtx, gen_rtx_PLUS (word_mode, stack_pointer_rtx, @@ -8089,8 +8089,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" the only method that we have for doing DImode multiplication is with a libcall. This could be trouble if we haven't allocated enough space for the outgoing arguments. */ - if (INTVAL (nb) > current_function_outgoing_args_size) - abort (); + gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size); emit_move_insn (arg_pointer_rtx, gen_rtx_PLUS (word_mode, stack_pointer_rtx, @@ -8171,8 +8170,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" the only method that we have for doing DImode multiplication is with a libcall. This could be trouble if we haven't allocated enough space for the outgoing arguments. */ - if (INTVAL (nb) > current_function_outgoing_args_size) - abort (); + gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size); emit_move_insn (arg_pointer_rtx, gen_rtx_PLUS (word_mode, stack_pointer_rtx, @@ -9263,8 +9261,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" { int locality = INTVAL (operands[2]); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (locality >= 0 && locality <= 3); /* Change operand[0] to a MEM as we don't have the infrastructure to output all the supported address modes for ldw/ldd when we use @@ -9309,8 +9306,7 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" }; int read_or_write = INTVAL (operands[1]); - if (read_or_write < 0 || read_or_write > 1) - abort (); + gcc_assert (read_or_write >= 0 && read_or_write <= 1); return instr [read_or_write]; } @@ -9338,9 +9334,8 @@ add,l %2,%3,%3\;bv,n %%r0(%3)" }; int read_or_write = INTVAL (operands[1]); - if ((which_alternative != 0 && which_alternative != 1) - || (read_or_write < 0 || read_or_write > 1)) - abort (); + gcc_assert (which_alternative == 0 || which_alternative == 1); + gcc_assert (read_or_write >= 0 && read_or_write <= 1); return instr [which_alternative][read_or_write]; } diff --git a/gcc/config/pa/pa.opt b/gcc/config/pa/pa.opt new file mode 100644 index 00000000000..54a9dfbf505 --- /dev/null +++ b/gcc/config/pa/pa.opt @@ -0,0 +1,119 @@ +; Options for the HP PA-RISC port of the compiler. + +; Copyright (C) 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. + +march=1.0 +Target RejectNegative +Generate PA1.0 code + +march=1.1 +Target RejectNegative +Generate PA1.1 code + +march=2.0 +Target RejectNegative +Generate PA2.0 code (requires binutils 2.10 or later) + +mbig-switch +Target Report Mask(BIG_SWITCH) +Generate code for huge switch statements + +mdisable-fpregs +Target Report Mask(DISABLE_FPREGS) +Disable FP regs + +mdisable-indexing +Target Report Mask(DISABLE_INDEXING) +Disable indexed addressing + +mfast-indirect-calls +Target Report Mask(FAST_INDIRECT_CALLS) +Generate fast indirect calls + +mfixed-range= +Target RejectNegative Joined +Specify range of registers to make fixed. + +mgas +Target Report Mask(GAS) +Assume code will be assembled by GAS + +mjump-in-delay +Target Report Mask(JUMP_IN_DELAY) +Put jumps in call delay slots + +;; Not used by gcc +mlinker-opt +Target RejectNegative +Enable linker optimizations + +mlong-calls +Target Report Mask(LONG_CALLS) +Always generate long calls + +mlong-load-store +Target Report Mask(LONG_LOAD_STORE) +Emit long load/store sequences + +mnosnake +Target RejectNegative +Generate PA1.0 code + +mno-space-regs +Target RejectNegative Report Mask(NO_SPACE_REGS) +Disable space regs + +mpa-risc-1-0 +Target RejectNegative +Generate PA1.0 code + +mpa-risc-1-1 +Target RejectNegative Mask(PA_11) +Generate PA1.1 code + +mpa-risc-2-0 +Target RejectNegative Mask(PA_20) +Generate PA2.0 code (requires binutils 2.10 or later) + +mportable-runtime +Target Report Mask(PORTABLE_RUNTIME) +Use portable calling conventions + +mschedule= +Target RejectNegative Joined +Specify CPU for scheduling purposes. Valid arguments are 700, 7100, 7100LC, 7200, 7300, and 8000. + +msoft-float +Target Report Mask(SOFT_FLOAT) +Use software floating point + +msnake +Target RejectNegative +Generate PA1.1 code + +mspace-regs +Target RejectNegative Report InverseMask(NO_SPACE_REGS) +Do not disable space regs + +Mask(SIO) +;; Generate cpp defines for server I/O. + +Mask(GNU_LD) +;; Assume GNU linker by default diff --git a/gcc/config/pa/pa64-hpux.h b/gcc/config/pa/pa64-hpux.h index f322e7e4b12..50117d3eb1c 100644 --- a/gcc/config/pa/pa64-hpux.h +++ b/gcc/config/pa/pa64-hpux.h @@ -20,17 +20,6 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "sio", MASK_SIO, \ - N_("Generate cpp defines for server IO") }, \ - { "wsio", -MASK_SIO, \ - N_("Generate cpp defines for workstation IO") }, \ - {"gnu-ld", MASK_GNU_LD, \ - N_("Assume code will be linked by GNU ld") }, \ - {"hp-ld", -MASK_GNU_LD, \ - N_("Assume code will be linked by HP ld") }, - /* We can debug dynamically linked executables on hpux11; we also want dereferencing of a NULL pointer to cause a SEGV. Do not move the "+Accept TypeMismatch" switch. We check for it in collect2 diff --git a/gcc/config/pa/pa64-hpux.opt b/gcc/config/pa/pa64-hpux.opt new file mode 100644 index 00000000000..97bf73b759f --- /dev/null +++ b/gcc/config/pa/pa64-hpux.opt @@ -0,0 +1,28 @@ +; Options for the HP PA-RISC port of the compiler. + +; Copyright (C) 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. + +mgnu-ld +Target RejectNegative Mask(GNU_LD) MaskExists +Assume code will be linked by GNU ld + +mhp-ld +Target RejectNegative InverseMask(GNU_LD) +Assume code will be linked by HP ld diff --git a/gcc/config/pa/pa64-linux.h b/gcc/config/pa/pa64-linux.h index 5d7fdbee181..908cb6c19b5 100644 --- a/gcc/config/pa/pa64-linux.h +++ b/gcc/config/pa/pa64-linux.h @@ -52,8 +52,7 @@ Boston, MA 02111-1307, USA. */ break; \ } \ \ - if ((TO) != STACK_POINTER_REGNUM) \ - abort (); \ + gcc_assert ((TO) == STACK_POINTER_REGNUM); \ \ switch (FROM) \ { \ @@ -66,7 +65,7 @@ Boston, MA 02111-1307, USA. */ break; \ \ default: \ - abort (); \ + gcc_unreachable (); \ } \ } while (0) #endif diff --git a/gcc/config/pa/pa64-start.h b/gcc/config/pa/pa64-start.h index e307382ad0c..9d7b19a3710 100644 --- a/gcc/config/pa/pa64-start.h +++ b/gcc/config/pa/pa64-start.h @@ -2,5 +2,7 @@ runtime compiler switch. So we might as well lose the overhead with checking for TARGET_64BIT. */ #define TARGET_64BIT 1 +#undef TARGET_PA_11 #define TARGET_PA_11 1 +#undef TARGET_PA_20 #define TARGET_PA_20 1 diff --git a/gcc/config/pa/predicates.md b/gcc/config/pa/predicates.md new file mode 100644 index 00000000000..23f62e3aacd --- /dev/null +++ b/gcc/config/pa/predicates.md @@ -0,0 +1,550 @@ +;; Predicate definitions for HP PA-RISC. +;; Copyright (C) 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. + +;; Return nonzero only if OP is a register of mode MODE, or +;; CONST0_RTX. + +(define_predicate "reg_or_0_operand" + (match_code "subreg,reg,const_int,const_double") +{ + return (op == CONST0_RTX (mode) || register_operand (op, mode)); +}) + +;; Return nonzero if OP is suitable for use in a call to a named +;; function. +;; +;; For 2.5 try to eliminate either call_operand_address or +;; function_label_operand, they perform very similar functions. + +(define_predicate "call_operand_address" + (match_code "label_ref,symbol_ref,const_int,const_double,const,high") +{ + return (GET_MODE (op) == word_mode + && CONSTANT_P (op) && ! TARGET_PORTABLE_RUNTIME); +}) + +;; Return 1 iff OP is an indexed memory operand. + +(define_predicate "indexed_memory_operand" + (match_code "subreg,mem") +{ + if (GET_MODE (op) != mode) + return 0; + + /* Before reload, a (SUBREG (MEM...)) forces reloading into a register. */ + if (reload_completed && GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode)) + return 0; + + op = XEXP (op, 0); + + return (memory_address_p (mode, op) && IS_INDEX_ADDR_P (op)); +}) + +;; TODO: Add a comment. + +(define_predicate "symbolic_operand" + (match_code "symbol_ref,label_ref,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF: + case LABEL_REF: + return 1; + case CONST: + op = XEXP (op, 0); + return ((GET_CODE (XEXP (op, 0)) == SYMBOL_REF + || GET_CODE (XEXP (op, 0)) == LABEL_REF) + && GET_CODE (XEXP (op, 1)) == CONST_INT); + default: + return 0; + } +}) + +;; Return truth value of statement that OP is a symbolic memory +;; operand of mode MODE. + +(define_predicate "symbolic_memory_operand" + (match_code "subreg,mem") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + if (GET_CODE (op) != MEM) + return 0; + op = XEXP (op, 0); + return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST + || GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF); +}) + +;; Return 1 if the operand is a register operand or a non-symbolic +;; memory operand after reload. This predicate is used for branch +;; patterns that internally handle register reloading. We need to +;; accept non-symbolic memory operands after reload to ensure that the +;; pattern is still valid if reload didn't find a hard register for +;; the operand. + +(define_predicate "reg_before_reload_operand" + (match_code "reg,mem") +{ + /* Don't accept a SUBREG since it will need a reload. */ + if (GET_CODE (op) == SUBREG) + return 0; + + if (register_operand (op, mode)) + return 1; + + if (reload_completed + && memory_operand (op, mode) + && !symbolic_memory_operand (op, mode)) + return 1; + + return 0; +}) + +;; Return 1 if the operand is either a register, zero, or a memory +;; operand that is not symbolic. + +(define_predicate "reg_or_0_or_nonsymb_mem_operand" + (match_code "subreg,reg,mem,const_int,const_double") +{ + if (register_operand (op, mode)) + return 1; + + if (op == CONST0_RTX (mode)) + return 1; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM) + return 0; + + /* Until problems with management of the REG_POINTER flag are resolved, + we need to delay creating move insns with unscaled indexed addresses + until CSE is not expected. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (XEXP (op, 0)) == PLUS + && REG_P (XEXP (XEXP (op, 0), 0)) + && REG_P (XEXP (XEXP (op, 0), 1))) + return 0; + + return (!symbolic_memory_operand (op, mode) + && memory_address_p (mode, XEXP (op, 0))); +}) + +;; Accept anything that can be used as a destination operand for a +;; move instruction. We don't accept indexed memory operands since +;; they are supported only for floating point stores. + +(define_predicate "move_dest_operand" + (match_code "subreg,reg,mem") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_MODE (op) != mode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode)) + return 0; + + op = XEXP (op, 0); + + return (memory_address_p (mode, op) + && !IS_INDEX_ADDR_P (op) + && !IS_LO_SUM_DLT_ADDR_P (op)); +}) + +;; Accept anything that can be used as a source operand for a move +;; instruction. + +(define_predicate "move_src_operand" + (match_code "subreg,reg,const_int,mem") +{ + if (register_operand (op, mode)) + return 1; + + if (GET_CODE (op) == CONST_INT) + return cint_ok_for_move (INTVAL (op)); + + if (GET_MODE (op) != mode) + return 0; + + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM) + return 0; + + /* Until problems with management of the REG_POINTER flag are resolved, + we need to delay creating move insns with unscaled indexed addresses + until CSE is not expected. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (XEXP (op, 0)) == PLUS + && REG_P (XEXP (XEXP (op, 0), 0)) + && REG_P (XEXP (XEXP (op, 0), 1))) + return 0; + + return memory_address_p (mode, XEXP (op, 0)); +}) + +;; Accept anything that can be used as the source operand for a +;; prefetch instruction with a cache-control completer. + +(define_predicate "prefetch_cc_operand" + (match_code "mem") +{ + if (GET_CODE (op) != MEM) + return 0; + + op = XEXP (op, 0); + + /* We must reject virtual registers as we don't allow REG+D. */ + if (op == virtual_incoming_args_rtx + || op == virtual_stack_vars_rtx + || op == virtual_stack_dynamic_rtx + || op == virtual_outgoing_args_rtx + || op == virtual_cfa_rtx) + return 0; + + if (!REG_P (op) && !IS_INDEX_ADDR_P (op)) + return 0; + + /* Until problems with management of the REG_POINTER flag are resolved, + we need to delay creating prefetch insns with unscaled indexed addresses + until CSE is not expected. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (op) == PLUS + && REG_P (XEXP (op, 0))) + return 0; + + return memory_address_p (mode, op); +}) + +;; Accept anything that can be used as the source operand for a +;; prefetch instruction with no cache-control completer. + +(define_predicate "prefetch_nocc_operand" + (match_code "mem") +{ + if (GET_CODE (op) != MEM) + return 0; + + op = XEXP (op, 0); + + /* Until problems with management of the REG_POINTER flag are resolved, + we need to delay creating prefetch insns with unscaled indexed addresses + until CSE is not expected. */ + if (!TARGET_NO_SPACE_REGS + && !cse_not_expected + && GET_CODE (op) == PLUS + && REG_P (XEXP (op, 0)) + && REG_P (XEXP (op, 1))) + return 0; + + return memory_address_p (mode, op); +}) + +;; Accept REG and any CONST_INT that can be moved in one instruction +;; into a general register. + +(define_predicate "reg_or_cint_move_operand" + (match_code "subreg,reg,const_int") +{ + if (register_operand (op, mode)) + return 1; + + return (GET_CODE (op) == CONST_INT && cint_ok_for_move (INTVAL (op))); +}) + +;; TODO: Add a comment here. + +(define_predicate "pic_label_operand" + (match_code "label_ref,const") +{ + if (!flag_pic) + return 0; + + switch (GET_CODE (op)) + { + case LABEL_REF: + return 1; + case CONST: + op = XEXP (op, 0); + return (GET_CODE (XEXP (op, 0)) == LABEL_REF + && GET_CODE (XEXP (op, 1)) == CONST_INT); + default: + return 0; + } +}) + +;; TODO: Add a comment here. + +(define_predicate "fp_reg_operand" + (match_code "reg") +{ + return reg_renumber && FP_REG_P (op); +}) + +;; Return truth value of whether OP can be used as an operand in a +;; three operand arithmetic insn that accepts registers of mode MODE +;; or 14-bit signed integers. + +(define_predicate "arith_operand" + (match_code "subreg,reg,const_int") +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_INT && INT_14_BITS (op))); +}) + +;; Return truth value of whether OP can be used as an operand in a +;; three operand arithmetic insn that accepts registers of mode MODE +;; or 11-bit signed integers. + +(define_predicate "arith11_operand" + (match_code "subreg,reg,const_int") +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_INT && INT_11_BITS (op))); +}) + +;; A constant integer suitable for use in a PRE_MODIFY memory +;; reference. + +(define_predicate "pre_cint_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT + && INTVAL (op) >= -0x2000 && INTVAL (op) < 0x10); +}) + +;; A constant integer suitable for use in a POST_MODIFY memory +;; reference. + +(define_predicate "post_cint_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT + && INTVAL (op) < 0x2000 && INTVAL (op) >= -0x10); +}) + +;; TODO: Add a comment here. + +(define_predicate "arith_double_operand" + (match_code "subreg,reg,const_double") +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_DOUBLE + && GET_MODE (op) == mode + && VAL_14_BITS_P (CONST_DOUBLE_LOW (op)) + && ((CONST_DOUBLE_HIGH (op) >= 0) + == ((CONST_DOUBLE_LOW (op) & 0x1000) == 0)))); +}) + +;; Return truth value of whether OP is an integer which fits the range +;; constraining immediate operands in three-address insns, or is an +;; integer register. + +(define_predicate "ireg_or_int5_operand" + (match_code "const_int,reg") +{ + return ((GET_CODE (op) == CONST_INT && INT_5_BITS (op)) + || (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32)); +}) + +;; Return truth value of whether OP is an integer which fits the range +;; constraining immediate operands in three-address insns. + +(define_predicate "int5_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT && INT_5_BITS (op)); +}) + +;; Return truth value of whether OP is an integer which fits the range +;; constraining immediate operands in three-address insns. + +(define_predicate "uint5_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT && INT_U5_BITS (op)); +}) + +;; Return truth value of whether OP is an integer which fits the range +;; constraining immediate operands in three-address insns. + +(define_predicate "int11_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT && INT_11_BITS (op)); +}) + +;; Return truth value of whether OP is an integer which fits the range +;; constraining immediate operands in three-address insns. + +(define_predicate "uint32_operand" + (match_code "const_int,const_double") +{ +#if HOST_BITS_PER_WIDE_INT > 32 + /* All allowed constants will fit a CONST_INT. */ + return (GET_CODE (op) == CONST_INT + && (INTVAL (op) >= 0 && INTVAL (op) < (HOST_WIDE_INT) 1 << 32)); +#else + return (GET_CODE (op) == CONST_INT + || (GET_CODE (op) == CONST_DOUBLE + && CONST_DOUBLE_HIGH (op) == 0)); +#endif +}) + +;; Return truth value of whether OP is an integer which fits the range +;; constraining immediate operands in three-address insns. + +(define_predicate "arith5_operand" + (match_code "subreg,reg,const_int") +{ + return register_operand (op, mode) || int5_operand (op, mode); +}) + +;; True iff depi or extru can be used to compute (reg & OP). + +(define_predicate "and_operand" + (match_code "subreg,reg,const_int") +{ + return (register_operand (op, mode) + || (GET_CODE (op) == CONST_INT && and_mask_p (INTVAL (op)))); +}) + +;; True iff depi can be used to compute (reg | OP). + +(define_predicate "ior_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT && ior_mask_p (INTVAL (op))); +}) + +;; True iff OP is a CONST_INT of the forms 0...0xxxx or +;; 0...01...1xxxx. Such values can be the left hand side x in (x << +;; r), using the zvdepi instruction. + +(define_predicate "lhs_lshift_cint_operand" + (match_code "const_int") +{ + unsigned HOST_WIDE_INT x; + if (GET_CODE (op) != CONST_INT) + return 0; + x = INTVAL (op) >> 4; + return (x & (x + 1)) == 0; +}) + +;; TODO: Add a comment here. + +(define_predicate "lhs_lshift_operand" + (match_code "subreg,reg,const_int") +{ + return register_operand (op, mode) || lhs_lshift_cint_operand (op, mode); +}) + +;; TODO: Add a comment here. + +(define_predicate "arith32_operand" + (match_code "subreg,reg,const_int") +{ + return register_operand (op, mode) || GET_CODE (op) == CONST_INT; +}) + +;; TODO: Add a comment here. + +(define_predicate "pc_or_label_operand" + (match_code "pc,label_ref") +{ + return (GET_CODE (op) == PC || GET_CODE (op) == LABEL_REF); +}) + +;; TODO: Add a comment here. + +(define_predicate "plus_xor_ior_operator" + (match_code "plus,xor,ior") +{ + return (GET_CODE (op) == PLUS || GET_CODE (op) == XOR + || GET_CODE (op) == IOR); +}) + +;; Return 1 if OP is a CONST_INT with the value 2, 4, or 8. These are +;; the valid constant for shadd instructions. + +(define_predicate "shadd_operand" + (match_code "const_int") +{ + return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op))); +}) + +;; TODO: Add a comment here. + +(define_predicate "div_operand" + (match_code "reg,const_int") +{ + return (mode == SImode + && ((GET_CODE (op) == REG && REGNO (op) == 25) + || (GET_CODE (op) == CONST_INT && INTVAL (op) > 0 + && INTVAL (op) < 16 && magic_milli[INTVAL (op)]))); +}) + +;; Return nonzero if OP is an integer register, else return zero. + +(define_predicate "ireg_operand" + (match_code "reg") +{ + return (GET_CODE (op) == REG && REGNO (op) > 0 && REGNO (op) < 32); +}) + +;; Return 1 if this is a comparison operator. This allows the use of +;; MATCH_OPERATOR to recognize all the branch insns. + +(define_predicate "cmpib_comparison_operator" + (match_code "eq,ne,lt,le,leu,gt,gtu,ge") +{ + return ((mode == VOIDmode || GET_MODE (op) == mode) + && (GET_CODE (op) == EQ + || GET_CODE (op) == NE + || GET_CODE (op) == GT + || GET_CODE (op) == GTU + || GET_CODE (op) == GE + || GET_CODE (op) == LT + || GET_CODE (op) == LE + || GET_CODE (op) == LEU)); +}) + +;; Return 1 if OP is an operator suitable for use in a movb +;; instruction. + +(define_predicate "movb_comparison_operator" + (match_code "eq,ne,lt,ge") +{ + return (GET_CODE (op) == EQ || GET_CODE (op) == NE + || GET_CODE (op) == LT || GET_CODE (op) == GE); +}) diff --git a/gcc/config/pa/quadlib.c b/gcc/config/pa/quadlib.c index 6dbfdcfe9a5..c377417bdcf 100644 --- a/gcc/config/pa/quadlib.c +++ b/gcc/config/pa/quadlib.c @@ -1,5 +1,5 @@ /* Subroutines for long double support. - Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -160,11 +160,19 @@ _U_Qfcomp (long double a, long double b) } -/* This violates the IEEE standard. It is better to multiply by -1.0L. */ +/* Negate long double A. */ long double _U_Qfneg (long double a) { - return (0.0L - a); + union + { + long double ld; + int i[4]; + } u; + + u.ld = a; + u.i[0] ^= 0x80000000; + return u.ld; } #ifdef __LP64__ diff --git a/gcc/config/pa/rtems.h b/gcc/config/pa/rtems.h deleted file mode 100644 index 5450cfb2fb1..00000000000 --- a/gcc/config/pa/rtems.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Definitions of target machine for GNU compiler, for PRO. - Copyright (C) 1997, 2000, 2002, 2003 Free Software Foundation, Inc. - Contributed by Joel Sherrill (joel@OARcorp.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. */ - -/* Specify predefined symbols in preprocessor. */ - -#undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - if (!c_dialect_cxx () && !flag_iso) \ - { \ - builtin_define ("hppa"); \ - builtin_define_std ("PWB"); \ - } \ - builtin_define ("__rtems__"); \ - builtin_assert ("system=rtems"); \ - } \ - while (0) - -#undef LIB_SPEC -#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p: -lc}%{pg: -lc} -N" diff --git a/gcc/config/pdp11/2bsd.h b/gcc/config/pdp11/2bsd.h index 2a92aab5082..4952d9488fd 100644 --- a/gcc/config/pdp11/2bsd.h +++ b/gcc/config/pdp11/2bsd.h @@ -63,4 +63,4 @@ fprintf (STREAM, "~~%s:\n", NAME); \ } while (0) #undef TARGET_UNIX_ASM_DEFAULT -#define TARGET_UNIX_ASM_DEFAULT 2048 +#define TARGET_UNIX_ASM_DEFAULT MASK_UNIX_ASM diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index b0f6e3de391..f9fbfcf6749 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -1,5 +1,5 @@ /* Subroutines for gcc2 for pdp11. - Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004 + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). @@ -138,6 +138,7 @@ decode_pdp11_d (const struct real_format *fmt ATTRIBUTE_UNUSED, /* This is where the condition code register lives. */ /* rtx cc0_reg_rtx; - no longer needed? */ +static bool pdp11_handle_option (size_t, const char *, int); static rtx find_addr_reg (rtx); static const char *singlemove_string (rtx *); static bool pdp11_assemble_integer (rtx, unsigned int, int); @@ -166,6 +167,12 @@ static bool pdp11_return_in_memory (tree, tree); #undef TARGET_ASM_CLOSE_PAREN #define TARGET_ASM_CLOSE_PAREN "]" +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (MASK_FPU | MASK_45 | MASK_ABSHI_BUILTIN | TARGET_UNIX_ASM_DEFAULT) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION pdp11_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS pdp11_rtx_costs @@ -174,6 +181,23 @@ static bool pdp11_return_in_memory (tree, tree); struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +pdp11_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, + int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_m10: + target_flags &= ~(MASK_40 | MASK_45); + return true; + + default: + return true; + } +} + /* Nonzero if OP is a valid second operand for an arithmetic insn. */ int @@ -291,11 +315,10 @@ pdp11_output_function_prologue (FILE *stream, HOST_WIDE_INT size) && regs_ever_live[regno] && ! call_used_regs[regno]) { - if (via_ac == -1) - abort(); - - fprintf (stream, "\tldd %s, %s\n", reg_names[regno], reg_names[via_ac]); - fprintf (stream, "\tstd %s, -(sp)\n", reg_names[via_ac]); + gcc_assert (via_ac != -1); + fprintf (stream, "\tldd %s, %s\n", + reg_names[regno], reg_names[via_ac]); + fprintf (stream, "\tstd %s, -(sp)\n", reg_names[via_ac]); } } @@ -386,8 +409,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size) && regs_ever_live[i] && ! call_used_regs[i]) { - if (! LOAD_FPU_REG_P(via_ac)) - abort(); + gcc_assert (LOAD_FPU_REG_P(via_ac)); fprintf(stream, "\tldd %#o(r5), %s\n", (-fsize-k)&0xffff, reg_names[via_ac]); fprintf(stream, "\tstd %s, %s\n", reg_names[via_ac], reg_names[i]); @@ -418,8 +440,7 @@ pdp11_output_function_epilogue (FILE *stream, HOST_WIDE_INT size) && regs_ever_live[i] && ! call_used_regs[i]) { - if (! LOAD_FPU_REG_P(via_ac)) - abort(); + gcc_assert (LOAD_FPU_REG_P(via_ac)); fprintf(stream, "\tldd (sp)+, %s\n", reg_names[via_ac]); fprintf(stream, "\tstd %s, %s\n", reg_names[via_ac], reg_names[i]); @@ -500,8 +521,7 @@ output_move_double (rtx *operands) supposed to allow to happen. Abort if we get one, because generating code for these cases is painful. */ - if (optype0 == RNDOP || optype1 == RNDOP) - abort (); + gcc_assert (optype0 != RNDOP && optype1 != RNDOP); /* If one operand is decrementing and one is incrementing decrement the former register explicitly @@ -561,11 +581,9 @@ output_move_double (rtx *operands) latehalf[1] = GEN_INT (INTVAL(operands[1]) >> 16); operands[1] = GEN_INT (INTVAL(operands[1]) & 0xff); } - else if (GET_CODE (operands[1]) == CONST_DOUBLE) - { - /* immediate 32 bit values not allowed */ - abort(); - } + else + /* immediate 32 bit values not allowed */ + gcc_assert (GET_CODE (operands[1]) != CONST_DOUBLE); } else latehalf[1] = operands[1]; @@ -675,15 +693,13 @@ output_move_quad (rtx *operands) supposed to allow to happen. Abort if we get one, because generating code for these cases is painful. */ - if (optype0 == RNDOP || optype1 == RNDOP) - abort (); + gcc_assert (optype0 != RNDOP && optype1 != RNDOP); /* check if we move a CPU reg to an FPU reg, or vice versa! */ if (optype0 == REGOP && optype1 == REGOP) /* bogus - 64 bit cannot reside in CPU! */ - if (CPU_REG_P(REGNO(operands[0])) - || CPU_REG_P (REGNO(operands[1]))) - abort(); + gcc_assert (!CPU_REG_P(REGNO(operands[0])) + && !CPU_REG_P (REGNO(operands[1]))); if (optype0 == REGOP || optype1 == REGOP) { @@ -777,7 +793,7 @@ output_move_quad (rtx *operands) latehalf[1] = const0_rtx; } else - abort(); + gcc_unreachable (); } else latehalf[1] = operands[1]; @@ -971,7 +987,7 @@ print_operand_address (FILE *file, register rtx addr) } if (offset != 0) { - if (addr != 0) abort (); + gcc_assert (addr == 0); addr = offset; } if (reg1 != 0 && GET_CODE (reg1) == MULT) @@ -998,17 +1014,15 @@ print_operand_address (FILE *file, register rtx addr) output_address (addr); if (breg != 0) { - if (GET_CODE (breg) != REG) - abort (); + gcc_assert (GET_CODE (breg) == REG); fprintf (file, "(%s)", reg_names[REGNO (breg)]); } if (ireg != 0) { if (GET_CODE (ireg) == MULT) ireg = XEXP (ireg, 0); - if (GET_CODE (ireg) != REG) - abort (); - abort(); + gcc_assert (GET_CODE (ireg) == REG); + gcc_unreachable(); /* ??? */ fprintf (file, "[%s]", reg_names[REGNO (ireg)]); } break; @@ -1179,7 +1193,7 @@ pdp11_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total) } const char * -output_jump(const char *pos, const char *neg, int length) +output_jump (const char *pos, const char *neg, int length) { static int x = 0; @@ -1214,7 +1228,7 @@ output_jump(const char *pos, const char *neg, int length) default: - abort(); + gcc_unreachable (); } } @@ -1643,10 +1657,8 @@ output_addr_const_pdp11 (FILE *file, rtx x) switch (GET_CODE (x)) { case PC: - if (flag_pic) - putc ('.', file); - else - abort (); + gcc_assert (flag_pic); + putc ('.', file); break; case SYMBOL_REF: @@ -1679,10 +1691,8 @@ output_addr_const_pdp11 (FILE *file, rtx x) if (GET_MODE (x) == VOIDmode) { /* We can use %o if the number is one word and positive. */ - if (CONST_DOUBLE_HIGH (x)) - abort (); /* Should we just silently drop the high part? */ - else - fprintf (file, "%#ho", (unsigned short) CONST_DOUBLE_LOW (x)); + gcc_assert (!CONST_DOUBLE_HIGH (x)); + fprintf (file, "%#ho", (unsigned short) CONST_DOUBLE_LOW (x)); } else /* We can't handle floating point constants; diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index 72ca1a57508..1391bbe0016 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for the pdp-11 - Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). @@ -45,91 +45,9 @@ Boston, MA 02111-1307, USA. */ /* #define DBX_DEBUGGING_INFO */ -/* Run-time compilation parameters selecting different hardware subsets. -*/ - -extern int target_flags; - -/* Macro to define tables used to set the flags. - This is a list in braces of triplets in braces, - each triplet being { "NAME", VALUE, DOC } - where VALUE is the bits to set or minus the bits to clear and DOC - is the documentation for --help (NULL if intentionally undocumented). - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ -{ { "fpu", 1, N_("Use hardware floating point") }, \ - { "soft-float", -1, N_("Do not use hardware floating point") }, \ -/* return float result in ac0 */ \ - { "ac0", 2, N_("Return floating point results in ac0") }, \ - { "no-ac0", -2, N_("Return floating point results in memory") }, \ -/* is 11/40 */ \ - { "40", 4, N_("Generate code for an 11/40") }, \ - { "no-40", -4, "" }, \ -/* is 11/45 */ \ - { "45", 8, N_("Generate code for an 11/45") }, \ - { "no-45", -8, "" }, \ -/* is 11/10 */ \ - { "10", -12, N_("Generate code for an 11/10") }, \ -/* use movmemhi for bcopy */ \ - { "bcopy", 16, NULL }, \ - { "bcopy-builtin", -16, NULL }, \ -/* use 32 bit for int */ \ - { "int32", 32, N_("Use 32 bit int") }, \ - { "no-int16", 32, N_("Use 32 bit int") }, \ - { "int16", -32, N_("Use 16 bit int") }, \ - { "no-int32", -32, N_("Use 16 bit int") }, \ -/* use 32 bit for float */ \ - { "float32", 64, N_("Use 32 bit float") }, \ - { "no-float64", 64, N_("Use 32 bit float") }, \ - { "float64", -64, N_("Use 64 bit float") }, \ - { "no-float32", -64, N_("Use 64 bit float") }, \ -/* allow abshi pattern? - can trigger "optimizations" which make code SLOW! */\ - { "abshi", 128, NULL }, \ - { "no-abshi", -128, NULL }, \ -/* is branching expensive - on a PDP, it's actually really cheap */ \ -/* this is just to play around and check what code gcc generates */ \ - { "branch-expensive", 256, NULL }, \ - { "branch-cheap", -256, NULL }, \ -/* split instruction and data memory? */ \ - { "split", 1024, N_("Target has split I&D") }, \ - { "no-split", -1024, N_("Target does not have split I&D") }, \ -/* UNIX assembler syntax? */ \ - { "unix-asm", 2048, N_("Use UNIX assembler syntax") }, \ - { "dec-asm", -2048, N_("Use DEC assembler syntax") }, \ -/* default */ \ - { "", TARGET_DEFAULT, NULL} \ -} - -#define TARGET_DEFAULT (1 | 8 | 128 | TARGET_UNIX_ASM_DEFAULT) - -#define TARGET_FPU (target_flags & 1) -#define TARGET_SOFT_FLOAT (!TARGET_FPU) - -#define TARGET_AC0 ((target_flags & 2) && TARGET_FPU) -#define TARGET_NO_AC0 (! TARGET_AC0) - -#define TARGET_45 (target_flags & 8) -#define TARGET_40_PLUS ((target_flags & 4) || (target_flags & 8)) +#define TARGET_40_PLUS (TARGET_40 || TARGET_45) #define TARGET_10 (! TARGET_40_PLUS) -#define TARGET_BCOPY_BUILTIN (! (target_flags & 16)) - -#define TARGET_INT16 (! TARGET_INT32) -#define TARGET_INT32 (target_flags & 32) - -#define TARGET_FLOAT32 (target_flags & 64) -#define TARGET_FLOAT64 (! TARGET_FLOAT32) - -#define TARGET_ABSHI_BUILTIN (target_flags & 128) - -#define TARGET_BRANCH_EXPENSIVE (target_flags & 256) -#define TARGET_BRANCH_CHEAP (!TARGET_BRANCH_EXPENSIVE) - -#define TARGET_SPLIT (target_flags & 1024) -#define TARGET_NOSPLIT (! TARGET_SPLIT) - -#define TARGET_UNIX_ASM (target_flags & 2048) #define TARGET_UNIX_ASM_DEFAULT 0 #define ASSEMBLER_DIALECT (TARGET_UNIX_ASM ? 1 : 0) @@ -632,7 +550,7 @@ maybe ac0 ? - as option someday! */ for profiling a function entry. */ #define FUNCTION_PROFILER(FILE, LABELNO) \ - abort (); + gcc_unreachable (); /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, the stack pointer does not matter. The value is tested only in @@ -1026,7 +944,7 @@ extern struct rtx_def *cc0_reg_rtx; fprintf (FILE, "\t.even\n"); \ break; \ default: \ - abort (); \ + gcc_unreachable (); \ } #define ASM_OUTPUT_SKIP(FILE,SIZE) \ @@ -1098,8 +1016,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION #define TRAMPOLINE_TEMPLATE(FILE) \ { \ - if (TARGET_SPLIT) \ - abort(); \ + gcc_assert (!TARGET_SPLIT); \ \ assemble_aligned_integer (2, GEN_INT (0x9400+STATIC_CHAIN_REGNUM)); \ assemble_aligned_integer (2, const0_rtx); \ @@ -1116,8 +1033,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION #define INITIALIZE_TRAMPOLINE(TRAMP,FNADDR,CXT) \ { \ - if (TARGET_SPLIT) \ - abort(); \ + gcc_assert (!TARGET_SPLIT); \ \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 2)), CXT); \ emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), FNADDR); \ diff --git a/gcc/config/pdp11/pdp11.md b/gcc/config/pdp11/pdp11.md index 52d3937a39c..18a05c4f3e2 100644 --- a/gcc/config/pdp11/pdp11.md +++ b/gcc/config/pdp11/pdp11.md @@ -1,5 +1,5 @@ ;;- Machine description for the pdp11 for GNU C compiler -;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2004 +;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at). @@ -124,8 +124,7 @@ rtx br_insn = NEXT_INSN (insn); RTX_CODE br_code; - if (GET_CODE (br_insn) != JUMP_INSN) - abort(); + gcc_assert (GET_CODE (br_insn) == JUMP_INSN); br_code = GET_CODE (XEXP (XEXP (PATTERN (br_insn), 1), 0)); switch(br_code) @@ -148,7 +147,7 @@ default: - abort(); + gcc_unreachable (); } }" [(set_attr "length" "4")]) @@ -872,7 +871,7 @@ default: - abort(); + gcc_unreachable (); } }" [(set_attr "length" "5,3,3")]) @@ -1131,8 +1130,7 @@ "" "* { - if (GET_CODE (operands[2]) == CONST_INT) - abort(); + gcc_assert (GET_CODE (operands[2]) != CONST_INT); return \"sub %2, %0\"; }" @@ -1145,8 +1143,7 @@ "" "* { - if (GET_CODE (operands[2]) == CONST_INT) - abort(); + gcc_assert (GET_CODE (operands[2]) != CONST_INT); return \"sub %2, %0\"; }" diff --git a/gcc/config/pdp11/pdp11.opt b/gcc/config/pdp11/pdp11.opt new file mode 100644 index 00000000000..9211098a402 --- /dev/null +++ b/gcc/config/pdp11/pdp11.opt @@ -0,0 +1,92 @@ +; Options for the PDP11 port of the compiler. + +; Copyright (C) 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. + +m10 +Target RejectNegative +Generate code for an 11/10 + +m40 +Target Report Mask(40) +Generate code for an 11/40 + +m45 +Target Report Mask(45) +Generate code for an 11/45 + +mabshi +Target Report Mask(ABSHI_BUILTIN) +Use 16-bit abs patterns + +mac0 +Target Report Mask(AC0) +Return floating-point results in ac0 (fr0 in Unix assembler syntax) + +mbcopy +Target RejectNegative Report Mask(BCOPY) +Do not use inline patterns for copying memory + +mbcopy-builtin +Target RejectNegative Report InverseMask(BCOPY, BCOPY_BUILTIN) +Use inline patterns for copying memory + +mbranch-cheap +Target RejectNegative Report InverseMask(BRANCH_EXPENSIVE, BRANCH_CHEAP) +Do not pretend that branches are expensive + +mbranch-expensive +Target RejectNegative Report Mask(BRANCH_EXPENSIVE) +Pretend that branches are expensive + +mdec-asm +Target RejectNegative Report InverseMask(UNIX_ASM) +Use the DEC assembler syntax + +mfloat32 +Target Report Mask(FLOAT32) +Use 32 bit float + +mfloat64 +Target Report InverseMask(FLOAT32, FLOAT64) +Use 64 bit float + +mfpu +Target RejectNegative Report Mask(FPU) +Use hardware floating point + +mint16 +Target Report InverseMask(INT32, INT16) +Use 16 bit int + +mint32 +Target Report Mask(INT32) +Use 32 bit int + +msoft-float +Target RejectNegative Report InverseMask(FPU, SOFT_FLOAT) +Do not use hardware floating point + +msplit +Target Report Mask(SPLIT) +Target has split I&D + +munix-asm +Target RejectNegative Report Mask(UNIX_ASM) +Use UNIX assembler syntax diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 82d7ec7f375..475f1432e06 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -38,8 +38,6 @@ #define TARGET_ALTIVEC 0 #undef TARGET_ALTIVEC_ABI #define TARGET_ALTIVEC_ABI 0 -#undef TARGET_ALTIVEC_VRSAVE -#define TARGET_ALTIVEC_VRSAVE 0 /* The AIX linker will discard static constructors in object files before collect has a chance to see them, so scan the object files directly. */ @@ -194,19 +192,6 @@ #define JUMP_TABLES_IN_TEXT_SECTION 1 -/* Enable AIX XL compiler calling convention breakage compatibility. */ -#undef TARGET_XL_COMPAT -#define MASK_XL_COMPAT 0x40000000 -#define TARGET_XL_COMPAT (target_flags & MASK_XL_COMPAT) -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"xl-compat", MASK_XL_COMPAT, \ - N_("Conform more closely to IBM XLC semantics") }, \ - {"no-xl-compat", - MASK_XL_COMPAT, \ - N_("Default GCC semantics that differ from IBM XLC") }, \ - SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES - /* Define any extra SPECS that the compiler needs to generate. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ diff --git a/gcc/config/rs6000/aix.opt b/gcc/config/rs6000/aix.opt new file mode 100644 index 00000000000..5b950c9dbdb --- /dev/null +++ b/gcc/config/rs6000/aix.opt @@ -0,0 +1,25 @@ +; AIX options. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +mxl-compat +Target Var(has_xl_compat_option) +Conform more closely to IBM XLC semantics diff --git a/gcc/config/rs6000/aix41.h b/gcc/config/rs6000/aix41.h index 486087fe714..d57e49fc44d 100644 --- a/gcc/config/rs6000/aix41.h +++ b/gcc/config/rs6000/aix41.h @@ -22,11 +22,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, - #undef ASM_SPEC #define ASM_SPEC "-u %(asm_cpu)" diff --git a/gcc/config/rs6000/aix41.opt b/gcc/config/rs6000/aix41.opt new file mode 100644 index 00000000000..8c41445b2fd --- /dev/null +++ b/gcc/config/rs6000/aix41.opt @@ -0,0 +1,25 @@ +; Options for AIX4.1. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +mpe +Target Report RejectNegative Var(internal_nothing_1) +Support message passing with the Parallel Environment diff --git a/gcc/config/rs6000/aix43.h b/gcc/config/rs6000/aix43.h index f5b6e17227f..fbf3d9c4fc5 100644 --- a/gcc/config/rs6000/aix43.h +++ b/gcc/config/rs6000/aix43.h @@ -21,16 +21,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* AIX 4.3 and above support 64-bit executables. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Compile for 64-bit pointers") }, \ - {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Compile for 32-bit pointers") }, \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -46,12 +36,12 @@ do { \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ { \ target_flags &= ~NON_POWERPC_MASKS; \ - warning ("-maix64 and POWER architecture are incompatible"); \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ } \ if (TARGET_POWERPC64 && ! TARGET_64BIT) \ { \ @@ -183,3 +173,6 @@ do { \ .set directives. We handle this by deferring the output of .set directives to the end of the compilation unit. */ #define TARGET_DEFERRED_OUTPUT_DEFS(DECL,TARGET) true + +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 diff --git a/gcc/config/rs6000/aix51.h b/gcc/config/rs6000/aix51.h index 033431be7c3..64b87f18e9d 100644 --- a/gcc/config/rs6000/aix51.h +++ b/gcc/config/rs6000/aix51.h @@ -20,16 +20,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* AIX V5 and above support 64-bit executables. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Compile for 64-bit pointers") }, \ - {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Compile for 32-bit pointers") }, \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -45,12 +35,12 @@ do { \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ { \ target_flags &= ~NON_POWERPC_MASKS; \ - warning ("-maix64 and POWER architecture are incompatible"); \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ } \ if (TARGET_POWERPC64 && ! TARGET_64BIT) \ { \ @@ -192,3 +182,5 @@ do { \ #undef TARGET_C99_FUNCTIONS #define TARGET_C99_FUNCTIONS 1 +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 diff --git a/gcc/config/rs6000/aix52.h b/gcc/config/rs6000/aix52.h index 29646f82bcd..ed2614089f3 100644 --- a/gcc/config/rs6000/aix52.h +++ b/gcc/config/rs6000/aix52.h @@ -20,16 +20,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* AIX V5 and above support 64-bit executables. */ -#undef SUBSUBTARGET_SWITCHES -#define SUBSUBTARGET_SWITCHES \ - {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Compile for 64-bit pointers") }, \ - {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Compile for 32-bit pointers") }, \ - {"pe", 0, \ - N_("Support message passing with the Parallel Environment") }, - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -45,12 +35,12 @@ do { \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ { \ target_flags &= ~NON_POWERPC_MASKS; \ - warning ("-maix64 and POWER architecture are incompatible"); \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ } \ if (TARGET_POWERPC64 && ! TARGET_64BIT) \ { \ @@ -187,3 +177,6 @@ do { \ #ifndef _AIX52 extern long long int atoll(const char *); #endif + +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 diff --git a/gcc/config/rs6000/aix64.opt b/gcc/config/rs6000/aix64.opt new file mode 100644 index 00000000000..8ef8638c135 --- /dev/null +++ b/gcc/config/rs6000/aix64.opt @@ -0,0 +1,33 @@ +; Options for the 64-bit flavor of AIX. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +maix64 +Target Report RejectNegative Mask(64BIT) +Compile for 64-bit pointers + +maix32 +Target Report RejectNegative InverseMask(64BIT) +Compile for 32-bit pointers + +mpe +Target Report RejectNegative Var(internal_nothing_1) +Support message passing with the Parallel Environment diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h dissimilarity index 99% index 0447d9e1fc4..f31a17414f8 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -1,11573 +1,461 @@ -/* PowerPC AltiVec include file. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. - Contributed by Aldy Hernandez (aldyh@redhat.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. */ - -/* 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. */ - -/* Implemented to conform to the specification included in the AltiVec - Technology Programming Interface Manual (ALTIVECPIM/D 6/1999 Rev 0). */ - -#ifndef _ALTIVEC_H -#define _ALTIVEC_H 1 - -#if !defined(__VEC__) || !defined(__ALTIVEC__) -#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. */ - -#if !defined(__APPLE_ALTIVEC__) -/* You are allowed to undef these for C++ compatibility. */ -#define vector __vector -#define pixel __pixel -#define bool __bool -#endif - -/* Condition register codes for AltiVec predicates. */ - -#define __CR6_EQ 0 -#define __CR6_EQ_REV 1 -#define __CR6_LT 2 -#define __CR6_LT_REV 3 - -/* These are easy... Same exact arguments. */ - -#define vec_vaddcuw vec_addc -#define vec_vand vec_and -#define vec_vandc vec_andc -#define vec_vrfip vec_ceil -#define vec_vcmpbfp vec_cmpb -#define vec_vcmpgefp vec_cmpge -#define vec_vctsxs vec_cts -#define vec_vctuxs vec_ctu -#define vec_vexptefp vec_expte -#define vec_vrfim vec_floor -#define vec_lvx vec_ld -#define vec_lvxl vec_ldl -#define vec_vlogefp vec_loge -#define vec_vmaddfp vec_madd -#define vec_vmhaddshs vec_madds -#define vec_vmladduhm vec_mladd -#define vec_vmhraddshs vec_mradds -#define vec_vnmsubfp vec_nmsub -#define vec_vnor vec_nor -#define vec_vor vec_or -#define vec_vpkpx vec_packpx -#define vec_vperm vec_perm -#define vec_vrefp vec_re -#define vec_vrfin vec_round -#define vec_vrsqrtefp vec_rsqrte -#define vec_vsel vec_sel -#define vec_vsldoi vec_sld -#define vec_vsl vec_sll -#define vec_vslo vec_slo -#define vec_vspltisb vec_splat_s8 -#define vec_vspltish vec_splat_s16 -#define vec_vspltisw vec_splat_s32 -#define vec_vsr vec_srl -#define vec_vsro vec_sro -#define vec_stvx vec_st -#define vec_stvxl vec_stl -#define vec_vsubcuw vec_subc -#define vec_vsum2sws vec_sum2s -#define vec_vsumsws vec_sums -#define vec_vrfiz vec_trunc -#define vec_vxor vec_xor - -#ifdef __cplusplus - -extern "C++" { - -/* Prototypes for builtins that take literals and must always be - inlined. */ -inline __vector float vec_ctf (__vector unsigned int, const int) __attribute__ ((always_inline)); -inline __vector float vec_ctf (__vector signed int, const int) __attribute__ ((always_inline)); -inline __vector float vec_vcfsx (__vector signed int a1, const int a2) __attribute__ ((always_inline)); -inline __vector float vec_vcfux (__vector unsigned int a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed int vec_cts (__vector float, const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_ctu (__vector float, const int) __attribute__ ((always_inline)); -inline void vec_dss (const int) __attribute__ ((always_inline)); - -inline void vec_dst (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const float *, int, const int) __attribute__ ((always_inline)); - -inline void vec_dstst (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const float *, int, const int) __attribute__ ((always_inline)); - -inline void vec_dststt (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const float *, int, const int) __attribute__ ((always_inline)); - -inline void vec_dstt (const __vector unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector bool char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector signed short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector bool short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector pixel *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector signed int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector bool int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const __vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const signed char *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const short *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const int *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const unsigned long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const long *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const float *, int, const int) __attribute__ ((always_inline)); - -inline __vector float vec_sld (__vector float, __vector float, const int) __attribute__ ((always_inline)); -inline __vector signed int vec_sld (__vector signed int, __vector signed int, const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_sld (__vector unsigned int, __vector unsigned int, const int) __attribute__ ((always_inline)); -inline __vector bool int vec_sld (__vector bool int, __vector bool int, const int) __attribute__ ((always_inline)); -inline __vector signed short vec_sld (__vector signed short, __vector signed short, const int) __attribute__ ((always_inline)); -inline __vector unsigned short vec_sld (__vector unsigned short, __vector unsigned short, const int) __attribute__ ((always_inline)); -inline __vector bool short vec_sld (__vector bool short, __vector bool short, const int) __attribute__ ((always_inline)); -inline __vector pixel vec_sld (__vector pixel, __vector pixel, const int) __attribute__ ((always_inline)); -inline __vector signed char vec_sld (__vector signed char, __vector signed char, const int) __attribute__ ((always_inline)); -inline __vector unsigned char vec_sld (__vector unsigned char, __vector unsigned char, const int) __attribute__ ((always_inline)); -inline __vector bool char vec_sld (__vector bool char, __vector bool char, const int) __attribute__ ((always_inline)); -inline __vector signed char vec_splat (__vector signed char, const int) __attribute__ ((always_inline)); -inline __vector unsigned char vec_splat (__vector unsigned char, const int) __attribute__ ((always_inline)); -inline __vector bool char vec_splat (__vector bool char, const int) __attribute__ ((always_inline)); -inline __vector signed short vec_splat (__vector signed short, const int) __attribute__ ((always_inline)); -inline __vector unsigned short vec_splat (__vector unsigned short, const int) __attribute__ ((always_inline)); -inline __vector bool short vec_splat (__vector bool short, const int) __attribute__ ((always_inline)); -inline __vector pixel vec_splat (__vector pixel, const int) __attribute__ ((always_inline)); -inline __vector float vec_splat (__vector float, const int) __attribute__ ((always_inline)); -inline __vector signed int vec_splat (__vector signed int, const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_splat (__vector unsigned int, const int) __attribute__ ((always_inline)); -inline __vector bool int vec_splat (__vector bool int, const int) __attribute__ ((always_inline)); -inline __vector signed char vec_splat_s8 (const int) __attribute__ ((always_inline)); -inline __vector signed short vec_splat_s16 (const int) __attribute__ ((always_inline)); -inline __vector signed int vec_splat_s32 (const int) __attribute__ ((always_inline)); -inline __vector unsigned char vec_splat_u8 (const int) __attribute__ ((always_inline)); -inline __vector unsigned short vec_splat_u16 (const int) __attribute__ ((always_inline)); -inline __vector unsigned int vec_splat_u32 (const int) __attribute__ ((always_inline)); -inline __vector float vec_vspltw (__vector float a1, const int a2) __attribute__ ((always_inline)); -inline __vector bool int vec_vspltw (__vector bool int a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed int vec_vspltw (__vector signed int a1, const int a2) __attribute__ ((always_inline)); -inline __vector unsigned int vec_vspltw (__vector unsigned int a1, const int a2) __attribute__ ((always_inline)); -inline __vector bool short vec_vsplth (__vector bool short a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed short vec_vsplth (__vector signed short a1, const int a2) __attribute__ ((always_inline)); -inline __vector unsigned short vec_vsplth (__vector unsigned short a1, const int a2) __attribute__ ((always_inline)); -inline __vector pixel vec_vsplth (__vector pixel a1, const int a2) __attribute__ ((always_inline)); -inline __vector bool char vec_vspltb (__vector bool char a1, const int a2) __attribute__ ((always_inline)); -inline __vector signed char vec_vspltb (__vector signed char a1, const int a2) __attribute__ ((always_inline)); -inline __vector unsigned char vec_vspltb (__vector unsigned char a1, const int a2) __attribute__ ((always_inline)); - -/* vec_step */ - -template -struct __vec_step_help -{ - // All proper __vector types will specialize _S_elem. -}; - -template<> -struct __vec_step_help<__vector signed short> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector unsigned short> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector bool short> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector pixel> -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 8; -}; - -template<> -struct __vec_step_help<__vector signed int> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help<__vector unsigned int> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help<__vector bool int> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help<__vector unsigned char> -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help<__vector signed char> -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help<__vector bool char> -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 16; -}; - -template<> -struct __vec_step_help<__vector float> -{ - static const int _S_elem = 4; -}; - -template<> -struct __vec_step_help -{ - static const int _S_elem = 4; -}; - -#define vec_step(t) __vec_step_help<__typeof__(t)>::_S_elem - -/* vec_abs */ - -inline __vector signed char -vec_abs (__vector signed char a1) -{ - return __builtin_altivec_abs_v16qi (a1); -} - -inline __vector signed short -vec_abs (__vector signed short a1) -{ - return __builtin_altivec_abs_v8hi (a1); -} - -inline __vector signed int -vec_abs (__vector signed int a1) -{ - return __builtin_altivec_abs_v4si (a1); -} - -inline __vector float -vec_abs (__vector float a1) -{ - return __builtin_altivec_abs_v4sf (a1); -} - -/* vec_abss */ - -inline __vector signed char -vec_abss (__vector signed char a1) -{ - return __builtin_altivec_abss_v16qi (a1); -} - -inline __vector signed short -vec_abss (__vector signed short a1) -{ - return __builtin_altivec_abss_v8hi (a1); -} - -inline __vector signed int -vec_abss (__vector signed int a1) -{ - return __builtin_altivec_abss_v4si (a1); -} - -/* vec_add */ - -inline __vector signed char -vec_add (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_add (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_add (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_add (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_add (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_add (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_add (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_add (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_add (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_add (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_add (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_add (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_add (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_add (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_add (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_add (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_add (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_add (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_add (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vaddfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vaddfp */ - -inline __vector float -vec_vaddfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vaddfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vadduwm */ - -inline __vector signed int -vec_vadduwm (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vadduwm (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vadduwm (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduwm (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduwm (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduwm (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vadduhm */ - -inline __vector signed short -vec_vadduhm (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vadduhm (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vadduhm (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhm (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhm (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhm (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vaddubm */ - -inline __vector signed char -vec_vaddubm (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddubm (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddubm (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubm (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubm (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubm (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_addc */ - -inline __vector unsigned int -vec_addc (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vaddcuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_adds */ - -inline __vector unsigned char -vec_adds (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_adds (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_adds (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_adds (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_adds (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_adds (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_adds (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_adds (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_adds (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_adds (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_adds (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_adds (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_adds (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_adds (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_adds (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_adds (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_adds (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_adds (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vaddsws */ - -inline __vector signed int -vec_vaddsws (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vaddsws (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vaddsws (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vadduws */ - -inline __vector unsigned int -vec_vadduws (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduws (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vadduws (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vaddshs */ - -inline __vector signed short -vec_vaddshs (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vaddshs (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vaddshs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vadduhs */ - -inline __vector unsigned short -vec_vadduhs (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhs (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vadduhs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vaddsbs */ - -inline __vector signed char -vec_vaddsbs (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddsbs (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vaddsbs (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vaddubs */ - -inline __vector unsigned char -vec_vaddubs (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubs (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vaddubs (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_and */ - -inline __vector float -vec_and (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_and (__vector float a1, __vector bool int a2) -{ - return (__vector float) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_and (__vector bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_and (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_and (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_and (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_and (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_and (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_and (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_and (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_and (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_and (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_and (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_and (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_and (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_and (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_and (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_and (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_and (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_and (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_and (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_and (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_and (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_and (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vand ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_andc */ - -inline __vector float -vec_andc (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_andc (__vector float a1, __vector bool int a2) -{ - return (__vector float) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_andc (__vector bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_andc (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_andc (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_andc (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_andc (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_andc (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_andc (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_andc (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_andc (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_andc (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_andc (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_andc (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_andc (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_andc (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_andc (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_andc (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_andc (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_andc (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_andc (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_andc (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_andc (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_andc (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_avg */ - -inline __vector unsigned char -vec_avg (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_avg (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_avg (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_avg (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_avg (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_avg (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vavgsw */ - -inline __vector signed int -vec_vavgsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vavguw */ - -inline __vector unsigned int -vec_vavguw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vavgsh */ - -inline __vector signed short -vec_vavgsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vavguh */ - -inline __vector unsigned short -vec_vavguh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vavgsb */ - -inline __vector signed char -vec_vavgsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vavgub */ - -inline __vector unsigned char -vec_vavgub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_ceil */ - -inline __vector float -vec_ceil (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfip ((__vector float) a1); -} - -/* vec_cmpb */ - -inline __vector signed int -vec_cmpb (__vector float a1, __vector float a2) -{ - return (__vector signed int) __builtin_altivec_vcmpbfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_cmpeq */ - -inline __vector bool char -vec_cmpeq (__vector signed char a1, __vector signed char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool char -vec_cmpeq (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool short -vec_cmpeq (__vector signed short a1, __vector signed short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector bool short -vec_cmpeq (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector bool int -vec_cmpeq (__vector signed int a1, __vector signed int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_cmpeq (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_cmpeq (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpeqfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpeqfp */ - -inline __vector bool int -vec_vcmpeqfp (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpeqfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpequw */ - -inline __vector bool int -vec_vcmpequw (__vector signed int a1, __vector signed int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_vcmpequw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpequw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vcmpequh */ - -inline __vector bool short -vec_vcmpequh (__vector signed short a1, __vector signed short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector bool short -vec_vcmpequh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpequh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vcmpequb */ - -inline __vector bool char -vec_vcmpequb (__vector signed char a1, __vector signed char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool char -vec_vcmpequb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpequb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_cmpge */ - -inline __vector bool int -vec_cmpge (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgefp ((__vector float) a1, (__vector float) a2); -} - -/* vec_cmpgt */ - -inline __vector bool char -vec_cmpgt (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpgtub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool char -vec_cmpgt (__vector signed char a1, __vector signed char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool short -vec_cmpgt (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector bool short -vec_cmpgt (__vector signed short a1, __vector signed short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector bool int -vec_cmpgt (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_cmpgt (__vector signed int a1, __vector signed int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_cmpgt (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpgtfp */ - -inline __vector bool int -vec_vcmpgtfp (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vcmpgtsw */ - -inline __vector bool int -vec_vcmpgtsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vcmpgtuw */ - -inline __vector bool int -vec_vcmpgtuw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vcmpgtsh */ - -inline __vector bool short -vec_vcmpgtsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vcmpgtuh */ - -inline __vector bool short -vec_vcmpgtuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vcmpgtsb */ - -inline __vector bool char -vec_vcmpgtsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vcmpgtub */ - -inline __vector bool char -vec_vcmpgtub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpgtub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_cmple */ - -inline __vector bool int -vec_cmple (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgefp ((__vector float) a2, (__vector float) a1); -} - -/* vec_cmplt */ - -inline __vector bool char -vec_cmplt (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpgtub ((__vector signed char) a2, (__vector signed char) a1); -} - -inline __vector bool char -vec_cmplt (__vector signed char a1, __vector signed char a2) -{ - return (__vector bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) a2, (__vector signed char) a1); -} - -inline __vector bool short -vec_cmplt (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) a2, (__vector signed short) a1); -} - -inline __vector bool short -vec_cmplt (__vector signed short a1, __vector signed short a2) -{ - return (__vector bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) a2, (__vector signed short) a1); -} - -inline __vector bool int -vec_cmplt (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) a2, (__vector signed int) a1); -} - -inline __vector bool int -vec_cmplt (__vector signed int a1, __vector signed int a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) a2, (__vector signed int) a1); -} - -inline __vector bool int -vec_cmplt (__vector float a1, __vector float a2) -{ - return (__vector bool int) __builtin_altivec_vcmpgtfp ((__vector float) a2, (__vector float) a1); -} - -/* vec_ctf */ - -inline __vector float -vec_ctf (__vector unsigned int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfux ((__vector signed int) a1, a2); -} - -inline __vector float -vec_ctf (__vector signed int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfsx ((__vector signed int) a1, a2); -} - -/* vec_vcfsx */ - -inline __vector float -vec_vcfsx (__vector signed int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfsx ((__vector signed int) a1, a2); -} - -/* vec_vcfux */ - -inline __vector float -vec_vcfux (__vector unsigned int a1, const int a2) -{ - return (__vector float) __builtin_altivec_vcfux ((__vector signed int) a1, a2); -} - -/* vec_cts */ - -inline __vector signed int -vec_cts (__vector float a1, const int a2) -{ - return (__vector signed int) __builtin_altivec_vctsxs ((__vector float) a1, a2); -} - -/* vec_ctu */ - -inline __vector unsigned int -vec_ctu (__vector float a1, const int a2) -{ - return (__vector unsigned int) __builtin_altivec_vctuxs ((__vector float) a1, a2); -} - -/* vec_dss */ - -inline void -vec_dss (const int a1) -{ - __builtin_altivec_dss (a1); -} - -/* vec_dssall */ - -inline void -vec_dssall (void) -{ - __builtin_altivec_dssall (); -} - -/* vec_dst */ - -inline void -vec_dst (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -inline void -vec_dst (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dst ((void *) a1, a2, a3); -} - -/* vec_dstst */ - -inline void -vec_dstst (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -inline void -vec_dstst (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dstst ((void *) a1, a2, a3); -} - -/* vec_dststt */ - -inline void -vec_dststt (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -inline void -vec_dststt (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dststt ((void *) a1, a2, a3); -} - -/* vec_dstt */ - -inline void -vec_dstt (const __vector unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector bool char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector signed short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector bool short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector pixel *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector signed int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector bool int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const __vector float *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const signed char *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const short *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const int *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const unsigned long *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const long *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -inline void -vec_dstt (const float *a1, int a2, const int a3) -{ - __builtin_altivec_dstt ((void *) a1, a2, a3); -} - -/* vec_expte */ - -inline __vector float -vec_expte (__vector float a1) -{ - return (__vector float) __builtin_altivec_vexptefp ((__vector float) a1); -} - -/* vec_floor */ - -inline __vector float -vec_floor (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfim ((__vector float) a1); -} - -/* vec_ld */ - -inline __vector float -vec_ld (int a1, const __vector float *a2) -{ - return (__vector float) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector float -vec_ld (int a1, const float *a2) -{ - return (__vector float) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector bool int -vec_ld (int a1, const __vector bool int *a2) -{ - return (__vector bool int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed int -vec_ld (int a1, const __vector signed int *a2) -{ - return (__vector signed int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed int -vec_ld (int a1, const int *a2) -{ - return (__vector signed int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed int -vec_ld (int a1, const long *a2) -{ - return (__vector signed int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ld (int a1, const __vector unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ld (int a1, const unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ld (int a1, const unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector bool short -vec_ld (int a1, const __vector bool short *a2) -{ - return (__vector bool short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector pixel -vec_ld (int a1, const __vector pixel *a2) -{ - return (__vector pixel) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed short -vec_ld (int a1, const __vector signed short *a2) -{ - return (__vector signed short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed short -vec_ld (int a1, const short *a2) -{ - return (__vector signed short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ld (int a1, const __vector unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ld (int a1, const unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector bool char -vec_ld (int a1, const __vector bool char *a2) -{ - return (__vector bool char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed char -vec_ld (int a1, const __vector signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector signed char -vec_ld (int a1, const signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ld (int a1, const __vector unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ld (int a1, const unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvx (a1, (void *) a2); -} - -/* vec_lde */ - -inline __vector signed char -vec_lde (int a1, const signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lde (int a1, const unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -inline __vector signed short -vec_lde (int a1, const short *a2) -{ - return (__vector signed short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_lde (int a1, const unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -inline __vector float -vec_lde (int a1, const float *a2) -{ - return (__vector float) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lde (int a1, const int *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lde (int a1, const unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lde (int a1, const long *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lde (int a1, const unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -/* vec_lvewx */ - -inline __vector float -vec_lvewx (int a1, float *a2) -{ - return (__vector float) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lvewx (int a1, int *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lvewx (int a1, unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector signed int -vec_lvewx (int a1, long *a2) -{ - return (__vector signed int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -inline __vector unsigned int -vec_lvewx (int a1, unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvewx (a1, (void *) a2); -} - -/* vec_lvehx */ - -inline __vector signed short -vec_lvehx (int a1, short *a2) -{ - return (__vector signed short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -inline __vector unsigned short -vec_lvehx (int a1, unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvehx (a1, (void *) a2); -} - -/* vec_lvebx */ - -inline __vector signed char -vec_lvebx (int a1, signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvebx (int a1, unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvebx (a1, (void *) a2); -} - -/* vec_ldl */ - -inline __vector float -vec_ldl (int a1, const __vector float *a2) -{ - return (__vector float) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector float -vec_ldl (int a1, const float *a2) -{ - return (__vector float) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector bool int -vec_ldl (int a1, const __vector bool int *a2) -{ - return (__vector bool int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed int -vec_ldl (int a1, const __vector signed int *a2) -{ - return (__vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed int -vec_ldl (int a1, const int *a2) -{ - return (__vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed int -vec_ldl (int a1, const long *a2) -{ - return (__vector signed int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ldl (int a1, const __vector unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ldl (int a1, const unsigned int *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned int -vec_ldl (int a1, const unsigned long *a2) -{ - return (__vector unsigned int) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector bool short -vec_ldl (int a1, const __vector bool short *a2) -{ - return (__vector bool short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector pixel -vec_ldl (int a1, const __vector pixel *a2) -{ - return (__vector pixel) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed short -vec_ldl (int a1, const __vector signed short *a2) -{ - return (__vector signed short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed short -vec_ldl (int a1, const short *a2) -{ - return (__vector signed short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ldl (int a1, const __vector unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned short -vec_ldl (int a1, const unsigned short *a2) -{ - return (__vector unsigned short) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector bool char -vec_ldl (int a1, const __vector bool char *a2) -{ - return (__vector bool char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed char -vec_ldl (int a1, const __vector signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector signed char -vec_ldl (int a1, const signed char *a2) -{ - return (__vector signed char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ldl (int a1, const __vector unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_ldl (int a1, const unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvxl (a1, (void *) a2); -} - -/* vec_loge */ - -inline __vector float -vec_loge (__vector float a1) -{ - return (__vector float) __builtin_altivec_vlogefp ((__vector float) a1); -} - -/* vec_lvsl */ - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile signed char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile unsigned long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsl (int a1, const volatile float *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsl (a1, (void *) a2); -} - -/* vec_lvsr */ - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile signed char *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile short *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile int *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile unsigned long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile long *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -inline __vector unsigned char -vec_lvsr (int a1, const volatile float *a2) -{ - return (__vector unsigned char) __builtin_altivec_lvsr (a1, (void *) a2); -} - -/* vec_madd */ - -inline __vector float -vec_madd (__vector float a1, __vector float a2, __vector float a3) -{ - return (__vector float) __builtin_altivec_vmaddfp ((__vector float) a1, (__vector float) a2, (__vector float) a3); -} - -/* vec_madds */ - -inline __vector signed short -vec_madds (__vector signed short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmhaddshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -/* vec_max */ - -inline __vector unsigned char -vec_max (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_max (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_max (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_max (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_max (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_max (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_max (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_max (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_max (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_max (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_max (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_max (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_max (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_max (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_max (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_max (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_max (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_max (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_max (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmaxfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vmaxfp */ - -inline __vector float -vec_vmaxfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmaxfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vmaxsw */ - -inline __vector signed int -vec_vmaxsw (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmaxsw (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmaxsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmaxuw */ - -inline __vector unsigned int -vec_vmaxuw (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmaxuw (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmaxuw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmaxsh */ - -inline __vector signed short -vec_vmaxsh (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmaxsh (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmaxsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmaxuh */ - -inline __vector unsigned short -vec_vmaxuh (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmaxuh (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmaxuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmaxsb */ - -inline __vector signed char -vec_vmaxsb (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmaxsb (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmaxsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vmaxub */ - -inline __vector unsigned char -vec_vmaxub (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmaxub (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmaxub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mergeh */ - -inline __vector bool char -vec_mergeh (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_mergeh (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_mergeh (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool short -vec_mergeh (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector pixel -vec_mergeh (__vector pixel a1, __vector pixel a2) -{ - return (__vector pixel) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_mergeh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_mergeh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector float -vec_mergeh (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_mergeh (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_mergeh (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_mergeh (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrghw */ - -inline __vector float -vec_vmrghw (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_vmrghw (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmrghw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmrghw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrghh */ - -inline __vector bool short -vec_vmrghh (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmrghh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmrghh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector pixel -vec_vmrghh (__vector pixel a1, __vector pixel a2) -{ - return (__vector pixel) __builtin_altivec_vmrghh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmrghb */ - -inline __vector bool char -vec_vmrghb (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmrghb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmrghb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mergel */ - -inline __vector bool char -vec_mergel (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_mergel (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_mergel (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector bool short -vec_mergel (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector pixel -vec_mergel (__vector pixel a1, __vector pixel a2) -{ - return (__vector pixel) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_mergel (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_mergel (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector float -vec_mergel (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_mergel (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_mergel (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_mergel (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrglw */ - -inline __vector float -vec_vmrglw (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vmrglw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vmrglw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_vmrglw (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vmrglw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vmrglh */ - -inline __vector bool short -vec_vmrglh (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vmrglh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vmrglh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector pixel -vec_vmrglh (__vector pixel a1, __vector pixel a2) -{ - return (__vector pixel) __builtin_altivec_vmrglh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmrglb */ - -inline __vector bool char -vec_vmrglb (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vmrglb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vmrglb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mfvscr */ - -inline __vector unsigned short -vec_mfvscr (void) -{ - return (__vector unsigned short) __builtin_altivec_mfvscr (); -} - -/* vec_min */ - -inline __vector unsigned char -vec_min (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_min (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_min (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_min (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_min (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_min (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_min (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_min (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_min (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_min (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_min (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_min (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_min (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_min (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_min (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_min (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_min (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_min (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_min (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vminfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vminfp */ - -inline __vector float -vec_vminfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vminfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vminsw */ - -inline __vector signed int -vec_vminsw (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vminsw (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vminsw (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vminsw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vminuw */ - -inline __vector unsigned int -vec_vminuw (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vminuw (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vminuw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vminsh */ - -inline __vector signed short -vec_vminsh (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vminsh (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vminsh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vminsh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vminuh */ - -inline __vector unsigned short -vec_vminuh (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vminuh (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vminuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vminsb */ - -inline __vector signed char -vec_vminsb (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vminsb (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vminsb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vminsb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vminub */ - -inline __vector unsigned char -vec_vminub (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vminub (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vminub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mladd */ - -inline __vector signed short -vec_mladd (__vector signed short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -inline __vector signed short -vec_mladd (__vector signed short a1, __vector unsigned short a2, __vector unsigned short a3) -{ - return (__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -inline __vector signed short -vec_mladd (__vector unsigned short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -inline __vector unsigned short -vec_mladd (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned short a3) -{ - return (__vector unsigned short) __builtin_altivec_vmladduhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -/* vec_mradds */ - -inline __vector signed short -vec_mradds (__vector signed short a1, __vector signed short a2, __vector signed short a3) -{ - return (__vector signed short) __builtin_altivec_vmhraddshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed short) a3); -} - -/* vec_msum */ - -inline __vector unsigned int -vec_msum (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_msum (__vector signed char a1, __vector unsigned char a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -inline __vector unsigned int -vec_msum (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_msum (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumshm */ - -inline __vector signed int -vec_vmsumshm (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumuhm */ - -inline __vector unsigned int -vec_vmsumuhm (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsummbm */ - -inline __vector signed int -vec_vmsummbm (__vector signed char a1, __vector unsigned char a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -/* vec_vmsumubm */ - -inline __vector unsigned int -vec_vmsumubm (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) a1, (__vector signed char) a2, (__vector signed int) a3); -} - -/* vec_msums */ - -inline __vector unsigned int -vec_msums (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_msums (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumshs */ - -inline __vector signed int -vec_vmsumshs (__vector signed short a1, __vector signed short a2, __vector signed int a3) -{ - return (__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_vmsumuhs */ - -inline __vector unsigned int -vec_vmsumuhs (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) a1, (__vector signed short) a2, (__vector signed int) a3); -} - -/* vec_mtvscr */ - -inline void -vec_mtvscr (__vector signed int a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector unsigned int a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector bool int a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector signed short a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector unsigned short a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector bool short a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector pixel a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector signed char a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector unsigned char a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -inline void -vec_mtvscr (__vector bool char a1) -{ - __builtin_altivec_mtvscr ((__vector signed int) a1); -} - -/* vec_mule */ - -inline __vector unsigned short -vec_mule (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_mule (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmulesb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned int -vec_mule (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_mule (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulesh */ - -inline __vector signed int -vec_vmulesh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmuleuh */ - -inline __vector unsigned int -vec_vmuleuh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulesb */ - -inline __vector signed short -vec_vmulesb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmuleub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vmuleub */ - -inline __vector unsigned short -vec_vmuleub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_mulo */ - -inline __vector unsigned short -vec_mulo (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_mulo (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned int -vec_mulo (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_mulo (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulosh */ - -inline __vector signed int -vec_vmulosh (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulouh */ - -inline __vector unsigned int -vec_vmulouh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vmulosb */ - -inline __vector signed short -vec_vmulosb (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vmuloub */ - -inline __vector unsigned short -vec_vmuloub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_nmsub */ - -inline __vector float -vec_nmsub (__vector float a1, __vector float a2, __vector float a3) -{ - return (__vector float) __builtin_altivec_vnmsubfp ((__vector float) a1, (__vector float) a2, (__vector float) a3); -} - -/* vec_nor */ - -inline __vector float -vec_nor (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_nor (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_nor (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_nor (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_nor (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_nor (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_nor (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_nor (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_nor (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_nor (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vnor ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_or */ - -inline __vector float -vec_or (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_or (__vector float a1, __vector bool int a2) -{ - return (__vector float) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_or (__vector bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_or (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_or (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_or (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_or (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_or (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_or (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_or (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_or (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_or (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_or (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_or (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_or (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_or (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_or (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_or (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_or (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_or (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_or (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_or (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_or (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_or (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vor ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_pack */ - -inline __vector signed char -vec_pack (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned char -vec_pack (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector bool char -vec_pack (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_pack (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_pack (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_pack (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkuwum */ - -inline __vector bool short -vec_vpkuwum (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_vpkuwum (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_vpkuwum (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkuhum */ - -inline __vector bool char -vec_vpkuhum (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed char -vec_vpkuhum (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned char -vec_vpkuhum (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_packpx */ - -inline __vector pixel -vec_packpx (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector pixel) __builtin_altivec_vpkpx ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_packs */ - -inline __vector unsigned char -vec_packs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed char -vec_packs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_packs (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_packs (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkswss */ - -inline __vector signed short -vec_vpkswss (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkuwus */ - -inline __vector unsigned short -vec_vpkuwus (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkshss */ - -inline __vector signed char -vec_vpkshss (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vpkuhus */ - -inline __vector unsigned char -vec_vpkuhus (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_packsu */ - -inline __vector unsigned char -vec_packsu (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned char -vec_packsu (__vector signed short a1, __vector signed short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_packsu (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_packsu (__vector signed int a1, __vector signed int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkswus */ - -inline __vector unsigned short -vec_vpkswus (__vector signed int a1, __vector signed int a2) -{ - return (__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vpkshus */ - -inline __vector unsigned char -vec_vpkshus (__vector signed short a1, __vector signed short a2) -{ - return (__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_perm */ - -inline __vector float -vec_perm (__vector float a1, __vector float a2, __vector unsigned char a3) -{ - return (__vector float) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector signed int -vec_perm (__vector signed int a1, __vector signed int a2, __vector unsigned char a3) -{ - return (__vector signed int) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector unsigned int -vec_perm (__vector unsigned int a1, __vector unsigned int a2, __vector unsigned char a3) -{ - return (__vector unsigned int) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector bool int -vec_perm (__vector bool int a1, __vector bool int a2, __vector unsigned char a3) -{ - return (__vector bool int) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector signed short -vec_perm (__vector signed short a1, __vector signed short a2, __vector unsigned char a3) -{ - return (__vector signed short) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector unsigned short -vec_perm (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned char a3) -{ - return (__vector unsigned short) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector bool short -vec_perm (__vector bool short a1, __vector bool short a2, __vector unsigned char a3) -{ - return (__vector bool short) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector pixel -vec_perm (__vector pixel a1, __vector pixel a2, __vector unsigned char a3) -{ - return (__vector pixel) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector signed char -vec_perm (__vector signed char a1, __vector signed char a2, __vector unsigned char a3) -{ - return (__vector signed char) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector unsigned char -vec_perm (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned char a3) -{ - return (__vector unsigned char) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -inline __vector bool char -vec_perm (__vector bool char a1, __vector bool char a2, __vector unsigned char a3) -{ - return (__vector bool char) __builtin_altivec_vperm_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed char) a3); -} - -/* vec_re */ - -inline __vector float -vec_re (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrefp ((__vector float) a1); -} - -/* vec_rl */ - -inline __vector signed char -vec_rl (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_rl (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_rl (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_rl (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_rl (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_rl (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vrlw */ - -inline __vector signed int -vec_vrlw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vrlw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vrlh */ - -inline __vector signed short -vec_vrlh (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vrlh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vrlb */ - -inline __vector signed char -vec_vrlb (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vrlb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_round */ - -inline __vector float -vec_round (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfin ((__vector float) a1); -} - -/* vec_rsqrte */ - -inline __vector float -vec_rsqrte (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrsqrtefp ((__vector float) a1); -} - -/* vec_sel */ - -inline __vector float -vec_sel (__vector float a1, __vector float a2, __vector bool int a3) -{ - return (__vector float) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector float -vec_sel (__vector float a1, __vector float a2, __vector unsigned int a3) -{ - return (__vector float) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_sel (__vector signed int a1, __vector signed int a2, __vector bool int a3) -{ - return (__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed int -vec_sel (__vector signed int a1, __vector signed int a2, __vector unsigned int a3) -{ - return (__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned int -vec_sel (__vector unsigned int a1, __vector unsigned int a2, __vector bool int a3) -{ - return (__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned int -vec_sel (__vector unsigned int a1, __vector unsigned int a2, __vector unsigned int a3) -{ - return (__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector bool int -vec_sel (__vector bool int a1, __vector bool int a2, __vector bool int a3) -{ - return (__vector bool int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector bool int -vec_sel (__vector bool int a1, __vector bool int a2, __vector unsigned int a3) -{ - return (__vector bool int) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed short -vec_sel (__vector signed short a1, __vector signed short a2, __vector bool short a3) -{ - return (__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed short -vec_sel (__vector signed short a1, __vector signed short a2, __vector unsigned short a3) -{ - return (__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned short -vec_sel (__vector unsigned short a1, __vector unsigned short a2, __vector bool short a3) -{ - return (__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned short -vec_sel (__vector unsigned short a1, __vector unsigned short a2, __vector unsigned short a3) -{ - return (__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector bool short -vec_sel (__vector bool short a1, __vector bool short a2, __vector bool short a3) -{ - return (__vector bool short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector bool short -vec_sel (__vector bool short a1, __vector bool short a2, __vector unsigned short a3) -{ - return (__vector bool short) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed char -vec_sel (__vector signed char a1, __vector signed char a2, __vector bool char a3) -{ - return (__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector signed char -vec_sel (__vector signed char a1, __vector signed char a2, __vector unsigned char a3) -{ - return (__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned char -vec_sel (__vector unsigned char a1, __vector unsigned char a2, __vector bool char a3) -{ - return (__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector unsigned char -vec_sel (__vector unsigned char a1, __vector unsigned char a2, __vector unsigned char a3) -{ - return (__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector bool char -vec_sel (__vector bool char a1, __vector bool char a2, __vector bool char a3) -{ - return (__vector bool char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -inline __vector bool char -vec_sel (__vector bool char a1, __vector bool char a2, __vector unsigned char a3) -{ - return (__vector bool char) __builtin_altivec_vsel_4si ((__vector signed int) a1, (__vector signed int) a2, (__vector signed int) a3); -} - -/* vec_sl */ - -inline __vector signed char -vec_sl (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sl (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sl (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sl (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sl (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sl (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vslw */ - -inline __vector signed int -vec_vslw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vslw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vslh */ - -inline __vector signed short -vec_vslh (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vslh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vslb */ - -inline __vector signed char -vec_vslb (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vslb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_sld */ - -inline __vector float -vec_sld (__vector float a1, __vector float a2, const int a3) -{ - return (__vector float) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector signed int -vec_sld (__vector signed int a1, __vector signed int a2, const int a3) -{ - return (__vector signed int) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector unsigned int -vec_sld (__vector unsigned int a1, __vector unsigned int a2, const int a3) -{ - return (__vector unsigned int) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector bool int -vec_sld (__vector bool int a1, __vector bool int a2, const int a3) -{ - return (__vector bool int) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector signed short -vec_sld (__vector signed short a1, __vector signed short a2, const int a3) -{ - return (__vector signed short) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector unsigned short -vec_sld (__vector unsigned short a1, __vector unsigned short a2, const int a3) -{ - return (__vector unsigned short) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector bool short -vec_sld (__vector bool short a1, __vector bool short a2, const int a3) -{ - return (__vector bool short) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector pixel -vec_sld (__vector pixel a1, __vector pixel a2, const int a3) -{ - return (__vector pixel) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector signed char -vec_sld (__vector signed char a1, __vector signed char a2, const int a3) -{ - return (__vector signed char) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector unsigned char -vec_sld (__vector unsigned char a1, __vector unsigned char a2, const int a3) -{ - return (__vector unsigned char) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -inline __vector bool char -vec_sld (__vector bool char a1, __vector bool char a2, const int a3) -{ - return (__vector bool char) __builtin_altivec_vsldoi_4si ((__vector signed int) a1, (__vector signed int) a2, a3); -} - -/* vec_sll */ - -inline __vector signed int -vec_sll (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sll (__vector signed int a1, __vector unsigned short a2) -{ - return (__vector signed int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sll (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sll (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sll (__vector unsigned int a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sll (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_sll (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_sll (__vector bool int a1, __vector unsigned short a2) -{ - return (__vector bool int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_sll (__vector bool int a1, __vector unsigned char a2) -{ - return (__vector bool int) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sll (__vector signed short a1, __vector unsigned int a2) -{ - return (__vector signed short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sll (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sll (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sll (__vector unsigned short a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sll (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sll (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_sll (__vector bool short a1, __vector unsigned int a2) -{ - return (__vector bool short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_sll (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_sll (__vector bool short a1, __vector unsigned char a2) -{ - return (__vector bool short) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_sll (__vector pixel a1, __vector unsigned int a2) -{ - return (__vector pixel) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_sll (__vector pixel a1, __vector unsigned short a2) -{ - return (__vector pixel) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_sll (__vector pixel a1, __vector unsigned char a2) -{ - return (__vector pixel) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sll (__vector signed char a1, __vector unsigned int a2) -{ - return (__vector signed char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sll (__vector signed char a1, __vector unsigned short a2) -{ - return (__vector signed char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sll (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sll (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sll (__vector unsigned char a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sll (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_sll (__vector bool char a1, __vector unsigned int a2) -{ - return (__vector bool char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_sll (__vector bool char a1, __vector unsigned short a2) -{ - return (__vector bool char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_sll (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vsl ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_slo */ - -inline __vector float -vec_slo (__vector float a1, __vector signed char a2) -{ - return (__vector float) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_slo (__vector float a1, __vector unsigned char a2) -{ - return (__vector float) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_slo (__vector signed int a1, __vector signed char a2) -{ - return (__vector signed int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_slo (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_slo (__vector unsigned int a1, __vector signed char a2) -{ - return (__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_slo (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_slo (__vector signed short a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_slo (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_slo (__vector unsigned short a1, __vector signed char a2) -{ - return (__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_slo (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_slo (__vector pixel a1, __vector signed char a2) -{ - return (__vector pixel) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_slo (__vector pixel a1, __vector unsigned char a2) -{ - return (__vector pixel) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_slo (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_slo (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_slo (__vector unsigned char a1, __vector signed char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_slo (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_splat */ - -inline __vector signed char -vec_splat (__vector signed char a1, const int a2) -{ - return (__vector signed char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector unsigned char -vec_splat (__vector unsigned char a1, const int a2) -{ - return (__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector bool char -vec_splat (__vector bool char a1, const int a2) -{ - return (__vector bool char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector signed short -vec_splat (__vector signed short a1, const int a2) -{ - return (__vector signed short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector unsigned short -vec_splat (__vector unsigned short a1, const int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector bool short -vec_splat (__vector bool short a1, const int a2) -{ - return (__vector bool short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector pixel -vec_splat (__vector pixel a1, const int a2) -{ - return (__vector pixel) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector float -vec_splat (__vector float a1, const int a2) -{ - return (__vector float) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector signed int -vec_splat (__vector signed int a1, const int a2) -{ - return (__vector signed int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector unsigned int -vec_splat (__vector unsigned int a1, const int a2) -{ - return (__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector bool int -vec_splat (__vector bool int a1, const int a2) -{ - return (__vector bool int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -/* vec_vspltw */ - -inline __vector float -vec_vspltw (__vector float a1, const int a2) -{ - return (__vector float) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector signed int -vec_vspltw (__vector signed int a1, const int a2) -{ - return (__vector signed int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector unsigned int -vec_vspltw (__vector unsigned int a1, const int a2) -{ - return (__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -inline __vector bool int -vec_vspltw (__vector bool int a1, const int a2) -{ - return (__vector bool int) __builtin_altivec_vspltw ((__vector signed int) a1, a2); -} - -/* vec_vsplth */ - -inline __vector bool short -vec_vsplth (__vector bool short a1, const int a2) -{ - return (__vector bool short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector signed short -vec_vsplth (__vector signed short a1, const int a2) -{ - return (__vector signed short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector unsigned short -vec_vsplth (__vector unsigned short a1, const int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -inline __vector pixel -vec_vsplth (__vector pixel a1, const int a2) -{ - return (__vector pixel) __builtin_altivec_vsplth ((__vector signed short) a1, a2); -} - -/* vec_vspltb */ - -inline __vector signed char -vec_vspltb (__vector signed char a1, const int a2) -{ - return (__vector signed char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector unsigned char -vec_vspltb (__vector unsigned char a1, const int a2) -{ - return (__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -inline __vector bool char -vec_vspltb (__vector bool char a1, const int a2) -{ - return (__vector bool char) __builtin_altivec_vspltb ((__vector signed char) a1, a2); -} - -/* vec_splat_s8 */ - -inline __vector signed char -vec_splat_s8 (const int a1) -{ - return (__vector signed char) __builtin_altivec_vspltisb (a1); -} - -/* vec_splat_s16 */ - -inline __vector signed short -vec_splat_s16 (const int a1) -{ - return (__vector signed short) __builtin_altivec_vspltish (a1); -} - -/* vec_splat_s32 */ - -inline __vector signed int -vec_splat_s32 (const int a1) -{ - return (__vector signed int) __builtin_altivec_vspltisw (a1); -} - -/* vec_splat_u8 */ - -inline __vector unsigned char -vec_splat_u8 (const int a1) -{ - return (__vector unsigned char) __builtin_altivec_vspltisb (a1); -} - -/* vec_splat_u16 */ - -inline __vector unsigned short -vec_splat_u16 (const int a1) -{ - return (__vector unsigned short) __builtin_altivec_vspltish (a1); -} - -/* vec_splat_u32 */ - -inline __vector unsigned int -vec_splat_u32 (const int a1) -{ - return (__vector unsigned int) __builtin_altivec_vspltisw (a1); -} - -/* vec_sr */ - -inline __vector signed char -vec_sr (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sr (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sr (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sr (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sr (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sr (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsrw */ - -inline __vector signed int -vec_vsrw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsrw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsrh */ - -inline __vector signed short -vec_vsrh (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsrh (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsrb */ - -inline __vector signed char -vec_vsrb (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsrb (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_sra */ - -inline __vector signed char -vec_sra (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sra (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sra (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sra (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sra (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sra (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsraw */ - -inline __vector signed int -vec_vsraw (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsraw (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsrah */ - -inline __vector signed short -vec_vsrah (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsrah (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsrab */ - -inline __vector signed char -vec_vsrab (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsrab (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_srl */ - -inline __vector signed int -vec_srl (__vector signed int a1, __vector unsigned int a2) -{ - return (__vector signed int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_srl (__vector signed int a1, __vector unsigned short a2) -{ - return (__vector signed int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_srl (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_srl (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_srl (__vector unsigned int a1, __vector unsigned short a2) -{ - return (__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_srl (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_srl (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector bool int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_srl (__vector bool int a1, __vector unsigned short a2) -{ - return (__vector bool int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_srl (__vector bool int a1, __vector unsigned char a2) -{ - return (__vector bool int) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_srl (__vector signed short a1, __vector unsigned int a2) -{ - return (__vector signed short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_srl (__vector signed short a1, __vector unsigned short a2) -{ - return (__vector signed short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_srl (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_srl (__vector unsigned short a1, __vector unsigned int a2) -{ - return (__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_srl (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_srl (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_srl (__vector bool short a1, __vector unsigned int a2) -{ - return (__vector bool short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_srl (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector bool short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_srl (__vector bool short a1, __vector unsigned char a2) -{ - return (__vector bool short) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_srl (__vector pixel a1, __vector unsigned int a2) -{ - return (__vector pixel) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_srl (__vector pixel a1, __vector unsigned short a2) -{ - return (__vector pixel) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_srl (__vector pixel a1, __vector unsigned char a2) -{ - return (__vector pixel) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_srl (__vector signed char a1, __vector unsigned int a2) -{ - return (__vector signed char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_srl (__vector signed char a1, __vector unsigned short a2) -{ - return (__vector signed char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_srl (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_srl (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_srl (__vector unsigned char a1, __vector unsigned short a2) -{ - return (__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_srl (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_srl (__vector bool char a1, __vector unsigned int a2) -{ - return (__vector bool char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_srl (__vector bool char a1, __vector unsigned short a2) -{ - return (__vector bool char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_srl (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector bool char) __builtin_altivec_vsr ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_sro */ - -inline __vector float -vec_sro (__vector float a1, __vector signed char a2) -{ - return (__vector float) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_sro (__vector float a1, __vector unsigned char a2) -{ - return (__vector float) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sro (__vector signed int a1, __vector signed char a2) -{ - return (__vector signed int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sro (__vector signed int a1, __vector unsigned char a2) -{ - return (__vector signed int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sro (__vector unsigned int a1, __vector signed char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sro (__vector unsigned int a1, __vector unsigned char a2) -{ - return (__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sro (__vector signed short a1, __vector signed char a2) -{ - return (__vector signed short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_sro (__vector signed short a1, __vector unsigned char a2) -{ - return (__vector signed short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sro (__vector unsigned short a1, __vector signed char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_sro (__vector unsigned short a1, __vector unsigned char a2) -{ - return (__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_sro (__vector pixel a1, __vector signed char a2) -{ - return (__vector pixel) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector pixel -vec_sro (__vector pixel a1, __vector unsigned char a2) -{ - return (__vector pixel) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sro (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_sro (__vector signed char a1, __vector unsigned char a2) -{ - return (__vector signed char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sro (__vector unsigned char a1, __vector signed char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_sro (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_st */ - -inline void -vec_st (__vector float a1, int a2, __vector float *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed int a1, int a2, __vector signed int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned int a1, int a2, __vector unsigned int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool int a1, int a2, __vector bool int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed short a1, int a2, __vector signed short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned short a1, int a2, __vector unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool short a1, int a2, __vector bool short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector pixel a1, int a2, __vector pixel *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed char a1, int a2, __vector signed char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned char a1, int a2, __vector unsigned char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool char a1, int a2, __vector bool char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_st (__vector bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvx ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_ste */ - -inline void -vec_ste (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_ste (__vector bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_stvewx */ - -inline void -vec_stvewx (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stvewx (__vector bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvewx ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_stvehx */ - -inline void -vec_stvehx (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -inline void -vec_stvehx (__vector pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvehx ((__vector signed short) a1, a2, (void *) a3); -} - -/* vec_stvebx */ - -inline void -vec_stvebx (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_stvebx (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_stvebx (__vector bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -inline void -vec_stvebx (__vector bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvebx ((__vector signed char) a1, a2, (void *) a3); -} - -/* vec_stl */ - -inline void -vec_stl (__vector float a1, int a2, __vector float *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector float a1, int a2, float *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed int a1, int a2, __vector signed int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed int a1, int a2, int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned int a1, int a2, __vector unsigned int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool int a1, int a2, __vector bool int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool int a1, int a2, unsigned int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool int a1, int a2, int *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed short a1, int a2, __vector signed short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed short a1, int a2, short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned short a1, int a2, __vector unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool short a1, int a2, __vector bool short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool short a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool short a1, int a2, short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector pixel a1, int a2, __vector pixel *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector pixel a1, int a2, unsigned short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector pixel a1, int a2, short *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed char a1, int a2, __vector signed char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector signed char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned char a1, int a2, __vector unsigned char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector unsigned char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool char a1, int a2, __vector bool char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool char a1, int a2, unsigned char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -inline void -vec_stl (__vector bool char a1, int a2, signed char *a3) -{ - __builtin_altivec_stvxl ((__vector signed int) a1, a2, (void *) a3); -} - -/* vec_sub */ - -inline __vector signed char -vec_sub (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_sub (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_sub (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sub (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sub (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_sub (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed short -vec_sub (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_sub (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_sub (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sub (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sub (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_sub (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed int -vec_sub (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sub (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sub (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sub (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sub (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_sub (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_sub (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vsubfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vsubfp */ - -inline __vector float -vec_vsubfp (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vsubfp ((__vector float) a1, (__vector float) a2); -} - -/* vec_vsubuwm */ - -inline __vector signed int -vec_vsubuwm (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubuwm (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubuwm (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuwm (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuwm (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuwm (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubuhm */ - -inline __vector signed short -vec_vsubuhm (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubuhm (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubuhm (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhm (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhm (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhm (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsububm */ - -inline __vector signed char -vec_vsububm (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsububm (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsububm (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububm (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububm (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububm (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_subc */ - -inline __vector unsigned int -vec_subc (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubcuw ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_subs */ - -inline __vector unsigned char -vec_subs (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_subs (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_subs (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_subs (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_subs (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_subs (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned short -vec_subs (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_subs (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_subs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_subs (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_subs (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_subs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned int -vec_subs (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_subs (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_subs (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_subs (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_subs (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_subs (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubsws */ - -inline __vector signed int -vec_vsubsws (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubsws (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_vsubsws (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubuws */ - -inline __vector unsigned int -vec_vsubuws (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuws (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_vsubuws (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_vsubshs */ - -inline __vector signed short -vec_vsubshs (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubshs (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector signed short -vec_vsubshs (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsubuhs */ - -inline __vector unsigned short -vec_vsubuhs (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhs (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -inline __vector unsigned short -vec_vsubuhs (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) a1, (__vector signed short) a2); -} - -/* vec_vsubsbs */ - -inline __vector signed char -vec_vsubsbs (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsubsbs (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector signed char -vec_vsubsbs (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_vsububs */ - -inline __vector unsigned char -vec_vsububs (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububs (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -inline __vector unsigned char -vec_vsububs (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) a1, (__vector signed char) a2); -} - -/* vec_sum4s */ - -inline __vector unsigned int -vec_sum4s (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sum4s (__vector signed char a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_sum4s (__vector signed short a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) a1, (__vector signed int) a2); -} - -/* vec_vsum4shs */ - -inline __vector signed int -vec_vsum4shs (__vector signed short a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) a1, (__vector signed int) a2); -} - -/* vec_vsum4sbs */ - -inline __vector signed int -vec_vsum4sbs (__vector signed char a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) a1, (__vector signed int) a2); -} - -/* vec_vsum4ubs */ - -inline __vector unsigned int -vec_vsum4ubs (__vector unsigned char a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) a1, (__vector signed int) a2); -} - -/* vec_sum2s */ - -inline __vector signed int -vec_sum2s (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsum2sws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_sums */ - -inline __vector signed int -vec_sums (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vsumsws ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_trunc */ - -inline __vector float -vec_trunc (__vector float a1) -{ - return (__vector float) __builtin_altivec_vrfiz ((__vector float) a1); -} - -/* vec_unpackh */ - -inline __vector signed short -vec_unpackh (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -inline __vector bool short -vec_unpackh (__vector bool char a1) -{ - return (__vector bool short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -inline __vector signed int -vec_unpackh (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -inline __vector bool int -vec_unpackh (__vector bool short a1) -{ - return (__vector bool int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -inline __vector unsigned int -vec_unpackh (__vector pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) a1); -} - -/* vec_vupkhsh */ - -inline __vector bool int -vec_vupkhsh (__vector bool short a1) -{ - return (__vector bool int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -inline __vector signed int -vec_vupkhsh (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) a1); -} - -/* vec_vupkhpx */ - -inline __vector unsigned int -vec_vupkhpx (__vector pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) a1); -} - -/* vec_vupkhsb */ - -inline __vector bool short -vec_vupkhsb (__vector bool char a1) -{ - return (__vector bool short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -inline __vector signed short -vec_vupkhsb (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) a1); -} - -/* vec_unpackl */ - -inline __vector signed short -vec_unpackl (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -inline __vector bool short -vec_unpackl (__vector bool char a1) -{ - return (__vector bool short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -inline __vector unsigned int -vec_unpackl (__vector pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) a1); -} - -inline __vector signed int -vec_unpackl (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -inline __vector bool int -vec_unpackl (__vector bool short a1) -{ - return (__vector bool int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -/* vec_vupklpx */ - -inline __vector unsigned int -vec_vupklpx (__vector pixel a1) -{ - return (__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) a1); -} - -/* vec_upklsh */ - -inline __vector bool int -vec_vupklsh (__vector bool short a1) -{ - return (__vector bool int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -inline __vector signed int -vec_vupklsh (__vector signed short a1) -{ - return (__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) a1); -} - -/* vec_vupklsb */ - -inline __vector bool short -vec_vupklsb (__vector bool char a1) -{ - return (__vector bool short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -inline __vector signed short -vec_vupklsb (__vector signed char a1) -{ - return (__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) a1); -} - -/* vec_xor */ - -inline __vector float -vec_xor (__vector float a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_xor (__vector float a1, __vector bool int a2) -{ - return (__vector float) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector float -vec_xor (__vector bool int a1, __vector float a2) -{ - return (__vector float) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool int -vec_xor (__vector bool int a1, __vector bool int a2) -{ - return (__vector bool int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_xor (__vector bool int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_xor (__vector signed int a1, __vector bool int a2) -{ - return (__vector signed int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed int -vec_xor (__vector signed int a1, __vector signed int a2) -{ - return (__vector signed int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_xor (__vector bool int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_xor (__vector unsigned int a1, __vector bool int a2) -{ - return (__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned int -vec_xor (__vector unsigned int a1, __vector unsigned int a2) -{ - return (__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool short -vec_xor (__vector bool short a1, __vector bool short a2) -{ - return (__vector bool short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_xor (__vector bool short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_xor (__vector signed short a1, __vector bool short a2) -{ - return (__vector signed short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed short -vec_xor (__vector signed short a1, __vector signed short a2) -{ - return (__vector signed short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_xor (__vector bool short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_xor (__vector unsigned short a1, __vector bool short a2) -{ - return (__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned short -vec_xor (__vector unsigned short a1, __vector unsigned short a2) -{ - return (__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_xor (__vector bool char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector bool char -vec_xor (__vector bool char a1, __vector bool char a2) -{ - return (__vector bool char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_xor (__vector signed char a1, __vector bool char a2) -{ - return (__vector signed char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector signed char -vec_xor (__vector signed char a1, __vector signed char a2) -{ - return (__vector signed char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_xor (__vector bool char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_xor (__vector unsigned char a1, __vector bool char a2) -{ - return (__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -inline __vector unsigned char -vec_xor (__vector unsigned char a1, __vector unsigned char a2) -{ - return (__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) a1, (__vector signed int) a2); -} - -/* vec_all_eq */ - -inline int -vec_all_eq (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, a1, a2); -} - -inline int -vec_all_eq (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector bool char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_eq (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector bool short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector pixel a1, __vector pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_eq (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector bool int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_eq (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a2); -} - -/* vec_all_ge */ - -inline int -vec_all_ge (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_ge (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_ge (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_ge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT, a1, a2); -} - -/* vec_all_gt */ - -inline int -vec_all_gt (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_gt (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_gt (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_gt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a1, a2); -} - -/* vec_all_in */ - -inline int -vec_all_in (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_le */ - -inline int -vec_all_le (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_le (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_le (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_le (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT, a2, a1); -} - -/* vec_all_lt */ - -inline int -vec_all_lt (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_all_lt (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_all_lt (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_all_lt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT, a2, a1); -} - -/* vec_all_nan */ - -inline int -vec_all_nan (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1); -} - -/* vec_all_ne */ - -inline int -vec_all_ne (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector bool char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_all_ne (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector bool short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector pixel a1, __vector pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_all_ne (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector bool int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_all_ne (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_nge */ - -inline int -vec_all_nge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_ngt */ - -inline int -vec_all_ngt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a1, a2); -} - -/* vec_all_nle */ - -inline int -vec_all_nle (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ, a2, a1); -} - -/* vec_all_nlt */ - -inline int -vec_all_nlt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a2, a1); -} - -/* vec_all_numeric */ - -inline int -vec_all_numeric (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1); -} - -/* vec_any_eq */ - -inline int -vec_any_eq (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector bool char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_eq (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector bool short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector pixel a1, __vector pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_eq (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector bool int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_eq (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a2); -} - -/* vec_any_ge */ - -inline int -vec_any_ge (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_ge (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_ge (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_ge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a1, a2); -} - -/* vec_any_gt */ - -inline int -vec_any_gt (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_gt (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_gt (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_gt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a1, a2); -} - -/* vec_any_le */ - -inline int -vec_any_le (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_le (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_le (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_le (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, a2, a1); -} - -/* vec_any_lt */ - -inline int -vec_any_lt (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) a2, (__vector signed char) a1); -} - -inline int -vec_any_lt (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) a2, (__vector signed short) a1); -} - -inline int -vec_any_lt (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) a2, (__vector signed int) a1); -} - -inline int -vec_any_lt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, a2, a1); -} - -/* vec_any_nan */ - -inline int -vec_any_nan (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a1); -} - -/* vec_any_ne */ - -inline int -vec_any_ne (__vector signed char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector signed char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector unsigned char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector unsigned char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector bool char a1, __vector bool char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector bool char a1, __vector unsigned char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector bool char a1, __vector signed char a2) -{ - return __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) a1, (__vector signed char) a2); -} - -inline int -vec_any_ne (__vector signed short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector signed short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector unsigned short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector unsigned short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector bool short a1, __vector bool short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector bool short a1, __vector unsigned short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector bool short a1, __vector signed short a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector pixel a1, __vector pixel a2) -{ - return __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) a1, (__vector signed short) a2); -} - -inline int -vec_any_ne (__vector signed int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector signed int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector unsigned int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector unsigned int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector bool int a1, __vector bool int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector bool int a1, __vector unsigned int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector bool int a1, __vector signed int a2) -{ - return __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) a1, (__vector signed int) a2); -} - -inline int -vec_any_ne (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a2); -} - -/* vec_any_nge */ - -inline int -vec_any_nge (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a1, a2); -} - -/* vec_any_ngt */ - -inline int -vec_any_ngt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a1, a2); -} - -/* vec_any_nle */ - -inline int -vec_any_nle (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1); -} - -/* vec_any_nlt */ - -inline int -vec_any_nlt (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a2, a1); -} - -/* vec_any_numeric */ - -inline int -vec_any_numeric (__vector float a1) -{ - return __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a1); -} - -/* vec_any_out */ - -inline int -vec_any_out (__vector float a1, __vector float a2) -{ - return __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2); -} - -} /* extern "C++" */ - -#else /* not C++ */ - -/* "... and so I think no man in a century will suffer as greatly as - you will." */ - -/* Helper macros. */ - -#define __un_args_eq(xtype, x) \ - __builtin_types_compatible_p (xtype, __typeof__ (x)) - -#define __bin_args_eq(xtype, x, ytype, y) \ - (__builtin_types_compatible_p (xtype, __typeof__ (x)) \ - && __builtin_types_compatible_p (ytype, __typeof__ (y))) - -#define __tern_args_eq(xtype, x, ytype, y, ztype, z) \ - (__builtin_types_compatible_p (xtype, __typeof__ (x)) \ - && __builtin_types_compatible_p (ytype, __typeof__ (y)) \ - && __builtin_types_compatible_p (ztype, __typeof__ (z))) - -#define __ch(x, y, z) __builtin_choose_expr (x, y, z) - -#define vec_step(t) \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector signed int), 4, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector unsigned int), 4, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector __bool int), 4, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector signed short), 8, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector unsigned short), 8, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector __bool short), 8, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector __pixel), 8, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector signed char), 16, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector unsigned char), 16, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector __bool char), 16, \ - __ch (__builtin_types_compatible_p (__typeof__ (t), __vector float), 4, \ - __builtin_altivec_compiletime_error ("vec_step")))))))))))) - -#define vec_abs(a) \ - __ch (__un_args_eq (__vector signed char, (a)), \ - ((__vector signed char) __builtin_altivec_abs_v16qi ((__vector signed char) (a))), \ - __ch (__un_args_eq (__vector signed short, (a)), \ - ((__vector signed short) __builtin_altivec_abs_v8hi ((__vector signed short) (a))), \ - __ch (__un_args_eq (__vector signed int, (a)), \ - ((__vector signed int) __builtin_altivec_abs_v4si ((__vector signed int) (a))), \ - __ch (__un_args_eq (__vector float, (a)), \ - ((__vector float) __builtin_altivec_abs_v4sf ((__vector float) (a))), \ - __builtin_altivec_compiletime_error ("vec_abs"))))) - -#define vec_abss(a) \ - __ch (__un_args_eq (__vector signed char, (a)), \ - ((__vector signed char) __builtin_altivec_abss_v16qi ((__vector signed char) (a))), \ - __ch (__un_args_eq (__vector signed short, (a)), \ - ((__vector signed short) __builtin_altivec_abss_v8hi ((__vector signed short) (a))), \ - __ch (__un_args_eq (__vector signed int, (a)), \ - ((__vector signed int) __builtin_altivec_abss_v4si ((__vector signed int) (a))), \ - __builtin_altivec_compiletime_error ("vec_abss")))) - -#define vec_vaddubm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddubm"))))))) - -#define vec_vadduhm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduhm"))))))) - -#define vec_vadduwm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduwm"))))))) - -#define vec_vaddfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vaddfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddfp")) - -#define vec_add(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vaddfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_add")))))))))))))))))))) - -#define vec_addc(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vaddcuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_addc")) - -#define vec_adds(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_adds"))))))))))))))))))) - -#define vec_vaddsws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vaddsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddsws")))) - -#define vec_vadduws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vadduws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduws")))) - -#define vec_vaddshs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vaddshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddshs")))) - -#define vec_vadduhs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vadduhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vadduhs")))) - -#define vec_vaddsbs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vaddsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddsbs")))) - -#define vec_vaddubs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vaddubs ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vaddubs")))) - -#define vec_and(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vand ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_and"))))))))))))))))))))))))) - -#define vec_andc(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vandc ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_andc"))))))))))))))))))))))))) - -#define vec_avg(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_avg"))))))) - -#define vec_vavgsw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vavgsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgsw")) - -#define vec_vavguw(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vavguw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavguw")) - -#define vec_vavgsh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vavgsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgsh")) - -#define vec_vavguh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vavguh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavguh")) - -#define vec_vavgsb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vavgsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgsb")) - -#define vec_vavgub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vavgub ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vavgub")) - -#define vec_ceil(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfip ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_ceil")) - -#define vec_cmpb(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector signed int) __builtin_altivec_vcmpbfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpb")) - -#define vec_cmpeq(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpeqfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpeq")))))))) - -#define vec_vcmpeqfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpeqfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpeqfp")) - -#define vec_vcmpequw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpequw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpequw"))) - -#define vec_vcmpequh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpequh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpequh"))) - -#define vec_vcmpequb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpequb ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpequb"))) - -#define vec_cmpge(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgefp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpge")) - -#define vec_cmpgt(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmpgt")))))))) - -#define vec_vcmpgtfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtfp")) - -#define vec_vcmpgtsw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtsw")) - -#define vec_vcmpgtuw(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtuw")) - -#define vec_vcmpgtsh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtsh")) - -#define vec_vcmpgtuh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtuh")) - -#define vec_vcmpgtsb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtsb")) - -#define vec_vcmpgtub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) (a1), (__vector signed char) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcmpgtub")) - -#define vec_cmple(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgefp ((__vector float) (a2), (__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_cmple")) - -#define vec_cmplt(a2, a1) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vcmpgtsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vcmpgtsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector __bool int) __builtin_altivec_vcmpgtfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cmplt")))))))) - -#define vec_ctf(a1, a2) \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector float) __builtin_altivec_vcfux ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector float) __builtin_altivec_vcfsx ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_ctf"))) - -#define vec_vcfsx(a1, a2) \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector float) __builtin_altivec_vcfsx ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcfsx")) - -#define vec_vcfux(a1, a2) \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector float) __builtin_altivec_vcfux ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_vcfux")) - -#define vec_cts(a1, a2) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector signed int) __builtin_altivec_vctsxs ((__vector float) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_cts")) - -#define vec_ctu(a1, a2) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vctuxs ((__vector float) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_ctu")) - -#define vec_dss(a1) __builtin_altivec_dss ((const int) (a1)); - -#define vec_dssall() __builtin_altivec_dssall () - -#define vec_dst(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dst ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dst"))))))))))))))))))))) - -#define vec_dstst(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dstst ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dstst"))))))))))))))))))))) - -#define vec_dststt(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dststt ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dststt"))))))))))))))))))))) - -#define vec_dstt(a1, a2, a3) \ -__ch (__un_args_eq (const __vector unsigned char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __pixel, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector unsigned int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector signed int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector __bool int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const __vector float, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const signed char, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const short, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const int, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const unsigned long, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const long, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ -__ch (__un_args_eq (const float, *(a1)), \ - __builtin_altivec_dstt ((void *) (a1), (a2), (a3)), \ - __builtin_altivec_compiletime_error ("vec_dstt"))))))))))))))))))))) - -#define vec_expte(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vexptefp ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_expte")) - -#define vec_floor(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfim ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_floor")) - -#define vec_ld(a, b) \ -__ch (__un_args_eq (const __vector unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool char, *(b)), \ - ((__vector __bool char) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector signed short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool short, *(b)), \ - ((__vector __bool short) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __pixel, *(b)), \ - ((__vector __pixel) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector signed int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool int, *(b)), \ - ((__vector __bool int) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const __vector float, *(b)), \ - ((__vector float) __builtin_altivec_lvx ((a), (b))), \ -__ch (__un_args_eq (const float, *(b)), \ - ((__vector float) __builtin_altivec_lvx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_ld"))))))))))))))))))))) - -#define vec_lde(a, b) \ -__ch (__un_args_eq (const unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (const signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (const unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (const short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (const unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (const float, *(b)), \ - ((__vector float) __builtin_altivec_lvewx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lde")))))))))) - -#define vec_lvewx(a, b) \ -__ch (__un_args_eq (unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (signed long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvewx ((a), (b))), \ -__ch (__un_args_eq (float, *(b)), \ - ((__vector float) __builtin_altivec_lvewx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lvewx")))))) - -#define vec_lvehx(a, b) \ -__ch (__un_args_eq (unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvehx ((a), (b))), \ -__ch (__un_args_eq (signed short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvehx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lvehx"))) - -#define vec_lvebx(a, b) \ -__ch (__un_args_eq (unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvebx ((a), (b))), \ -__ch (__un_args_eq (signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvebx ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_lvebx"))) - -#define vec_ldl(a, b) \ -__ch (__un_args_eq (const __vector unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned char, *(b)), \ - ((__vector unsigned char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const signed char, *(b)), \ - ((__vector signed char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool char, *(b)), \ - ((__vector __bool char) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned short, *(b)), \ - ((__vector unsigned short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector signed short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const short, *(b)), \ - ((__vector signed short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool short, *(b)), \ - ((__vector __bool short) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __pixel, *(b)), \ - ((__vector __pixel) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned int, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const unsigned long, *(b)), \ - ((__vector unsigned int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector signed int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const int, *(b)), \ - ((__vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const long, *(b)), \ - ((__vector signed int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector __bool int, *(b)), \ - ((__vector __bool int) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const __vector float, *(b)), \ - ((__vector float) __builtin_altivec_lvxl ((a), (b))), \ -__ch (__un_args_eq (const float, *(b)), \ - ((__vector float) __builtin_altivec_lvxl ((a), (b))), \ -__builtin_altivec_compiletime_error ("vec_ldl"))))))))))))))))))))) - -#define vec_loge(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vlogefp ((__vector float) (a1))), \ - __builtin_altivec_compiletime_error ("vec_loge")) - -#define vec_lvsl(a1, a2) \ -__ch (__un_args_eq (const volatile unsigned char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile float, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsl ((a1), (void *) (a2))), \ -__builtin_altivec_compiletime_error ("vec_lvsl")))))))))) - -#define vec_lvsr(a1, a2) \ -__ch (__un_args_eq (const volatile unsigned char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed char, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed short, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed int, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile unsigned long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile signed long, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__ch (__un_args_eq (const volatile float, *(a2)), \ - ((__vector unsigned char) __builtin_altivec_lvsr ((a1), (void *) (a2))), \ -__builtin_altivec_compiletime_error ("vec_lvsr")))))))))) - -#define vec_madd(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector float, (a3)), \ - ((__vector float) __builtin_altivec_vmaddfp ((a1), (a2), (a3))), \ -__builtin_altivec_compiletime_error ("vec_madd")) - -#define vec_madds(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmhaddshs ((a1), (a2), (a3))), \ -__builtin_altivec_compiletime_error ("vec_madds")) - -#define vec_max(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmaxfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_max")))))))))))))))))))) - -#define vec_vmaxfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmaxfp ((__vector float) (a1), (__vector float) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxfp")) - -#define vec_vmaxsw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmaxsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxsw")))) - -#define vec_vmaxuw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmaxuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxuw")))) - -#define vec_vmaxsh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmaxsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxsh")))) - -#define vec_vmaxuh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmaxuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxuh")))) - -#define vec_vmaxsb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmaxsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxsb")))) - -#define vec_vmaxub(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmaxub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmaxub")))) - -#define vec_mergeh(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mergeh")))))))))))) - -#define vec_vmrghw(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrghw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrghw"))))) - -#define vec_vmrghh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrghh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrghh"))))) - -#define vec_vmrghb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrghb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrghb")))) - -#define vec_mergel(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mergel")))))))))))) - -#define vec_vmrglw(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vmrglw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrglw"))))) - -#define vec_vmrglh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vmrglh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrglh"))))) - -#define vec_vmrglb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vmrglb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmrglb")))) - -#define vec_mfvscr() (((__vector unsigned short) __builtin_altivec_mfvscr ())) - -#define vec_min(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vminfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_min")))))))))))))))))))) - -#define vec_vminfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vminfp ((__vector float) (a1), (__vector float) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminfp")) - -#define vec_vminsw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vminsw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminsw")))) - -#define vec_vminuw(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vminuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminuw")))) - -#define vec_vminsh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vminsh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminsh")))) - -#define vec_vminuh(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vminuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminuh")))) - -#define vec_vminsb(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vminsb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_minsb")))) - -#define vec_vminub(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vminub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vminub")))) - -#define vec_mladd(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector unsigned short, (a2), __vector unsigned short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned short, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vmladduhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed short) (a3))), \ - __builtin_altivec_compiletime_error ("vec_mladd"))))) - -#define vec_mradds(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed short, (a3)), \ - ((__vector signed short) __builtin_altivec_vmhraddshs ((a1), (a2), (a3))), \ -__builtin_altivec_compiletime_error ("vec_mradds")) - -#define vec_msum(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector unsigned char, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_msum"))))) - -#define vec_vmsumshm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumshm")) - -#define vec_vmsumuhm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhm ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumuhm")) - -#define vec_vmsummbm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector unsigned char, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsummbm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsummbm")) - -#define vec_vmsumubm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumubm ((__vector signed char) (a1), (__vector signed char) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsummbm")) - -#define vec_msums(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_msums"))) - -#define vec_vmsumshs(a1, a2, a3) \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector signed int, (a3)), \ - ((__vector signed int) __builtin_altivec_vmsumshs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumshs")) - -#define vec_vmsumuhs(a1, a2, a3) \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vmsumuhs ((__vector signed short) (a1), (__vector signed short) (a2), (__vector signed int) (a3))), \ -__builtin_altivec_compiletime_error ("vec_vmsumuhs")) - -#define vec_mtvscr(a1) \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __bool int, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector unsigned short, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector unsigned char, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - __builtin_altivec_mtvscr ((__vector signed int) (a1)), \ - __builtin_altivec_compiletime_error ("vec_mtvscr"))))))))))) - -#define vec_mule(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulesb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mule"))))) - -#define vec_vmulesh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulesh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulesh")) - -#define vec_vmuleuh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmuleuh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmuleuh")) - -#define vec_vmulesb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulesb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulesb")) - -#define vec_vmuleub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuleub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmuleub")) - -#define vec_mulo(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) (a1), (__vector signed short) (a2))), \ - __builtin_altivec_compiletime_error ("vec_mulo"))))) - -#define vec_vmulosh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed int) __builtin_altivec_vmulosh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulosh")) - -#define vec_vmulouh(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vmulouh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulouh")) - -#define vec_vmulosb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vmulosb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmulosb")) - -#define vec_vmuloub(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vmuloub ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vmuloub")) - -#define vec_nmsub(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector float, (a3)), \ - ((__vector float) __builtin_altivec_vnmsubfp ((__vector float) (a1), (__vector float) (a2), (__vector float) (a3))), \ - __builtin_altivec_compiletime_error ("vec_nmsub")) - -#define vec_nor(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vnor ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_nor"))))))))))) - -#define vec_or(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vor ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_or"))))))))))))))))))))))))) - -#define vec_pack(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_pack"))))))) - -#define vec_vpkuwum(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwum ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuwum")))) - -#define vec_vpkuhum(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhum ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuhum")))) - -#define vec_packpx(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector __pixel) __builtin_altivec_vpkpx ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_packpx")) - -#define vec_packs(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_packs"))))) - -#define vec_vpkswss(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed short) __builtin_altivec_vpkswss ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkswss")) - -#define vec_vpkuwus(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuwus")) - -#define vec_vpkshss(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed char) __builtin_altivec_vpkshss ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkshss")) - -#define vec_vpkuhus(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkuhus")) - -#define vec_packsu(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkuhus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkuwus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_packsu"))))) - -#define vec_vpkswus(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vpkswus ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkswus")) - -#define vec_vpkshus(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vpkshus ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vpkshus")) - -#define vec_perm(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector unsigned char, (a3)), \ - ((__vector float) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector signed int, (a1), __vector signed int, (a2), __vector unsigned char, (a3)), \ - ((__vector signed int) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __bool int, (a1), __vector __bool int, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool int) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector unsigned char, (a3)), \ - ((__vector signed short) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __bool short, (a1), __vector __bool short, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool short) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __pixel, (a1), __vector __pixel, (a2), __vector unsigned char, (a3)), \ - ((__vector __pixel) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector signed char, (a2), __vector unsigned char, (a3)), \ - ((__vector signed char) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned char) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ -__ch (__tern_args_eq (__vector __bool char, (a1), __vector __bool char, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool char) __builtin_altivec_vperm_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed char) (a3))), \ - __builtin_altivec_compiletime_error ("vec_perm")))))))))))) - -#define vec_re(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrefp ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_re")) - -#define vec_rl(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_rl"))))))) - -#define vec_vrlw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vrlw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vrlw"))) - -#define vec_vrlh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vrlh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vrlh"))) - -#define vec_vrlb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vrlb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vrlb"))) - -#define vec_round(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfin ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_round")) - -#define vec_rsqrte(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrsqrtefp ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_rsqrte")) - -#define vec_sel(a1, a2, a3) \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector __bool int, (a3)), \ - ((__vector float) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector float, (a1), __vector float, (a2), __vector unsigned int, (a3)), \ - ((__vector float) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool int, (a1), __vector __bool int, (a2), __vector __bool int, (a3)), \ - ((__vector __bool int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool int, (a1), __vector __bool int, (a2), __vector unsigned int, (a3)), \ - ((__vector __bool int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed int, (a1), __vector signed int, (a2), __vector __bool int, (a3)), \ - ((__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed int, (a1), __vector signed int, (a2), __vector unsigned int, (a3)), \ - ((__vector signed int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2), __vector __bool int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2), __vector unsigned int, (a3)), \ - ((__vector unsigned int) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool short, (a1), __vector __bool short, (a2), __vector __bool short, (a3)), \ - ((__vector __bool short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool short, (a1), __vector __bool short, (a2), __vector unsigned short, (a3)), \ - ((__vector __bool short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector __bool short, (a3)), \ - ((__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed short, (a1), __vector signed short, (a2), __vector unsigned short, (a3)), \ - ((__vector signed short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector __bool short, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2), __vector unsigned short, (a3)), \ - ((__vector unsigned short) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool char, (a1), __vector __bool char, (a2), __vector __bool char, (a3)), \ - ((__vector __bool char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector __bool char, (a1), __vector __bool char, (a2), __vector unsigned char, (a3)), \ - ((__vector __bool char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector signed char, (a2), __vector __bool char, (a3)), \ - ((__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector signed char, (a1), __vector signed char, (a2), __vector unsigned char, (a3)), \ - ((__vector signed char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector __bool char, (a3)), \ - ((__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ -__ch (__tern_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2), __vector unsigned char, (a3)), \ - ((__vector unsigned char) __builtin_altivec_vsel_4si ((__vector signed int) (a1), (__vector signed int) (a2), (__vector signed int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_sel"))))))))))))))))))))) - -#define vec_sl(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sl"))))))) - -#define vec_vslw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vslw"))) - -#define vec_vslh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vslh"))) - -#define vec_vslb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vslb"))) - -#define vec_sld(a1, a2, a3) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsldoi_4si ((__vector signed int) (a1), (__vector signed int) (a2), (const int) (a3))), \ - __builtin_altivec_compiletime_error ("vec_sld")))))))))))) - -#define vec_sll(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned short, (a2)), \ - ((__vector signed int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned int, (a2)), \ - ((__vector signed short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned int, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned short, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned int, (a2)), \ - ((__vector signed char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned short, (a2)), \ - ((__vector signed char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsl ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sll"))))))))))))))))))))))))))))))) - -#define vec_slo(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector signed char, (a2)), \ - ((__vector float) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector unsigned char, (a2)), \ - ((__vector float) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed char, (a2)), \ - ((__vector signed int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector signed char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector signed char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector signed char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector signed char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vslo ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_slo"))))))))))))))))) - -#define vec_splat(a1, a2) \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned char, (a1)), \ - ((__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned short, (a1)), \ - ((__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector __pixel) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector signed int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool int, (a1)), \ - ((__vector __bool int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_splat")))))))))))) - -#define vec_vspltw(a1, a2) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __bool int, (a1)), \ - ((__vector __bool int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed int, (a1)), \ - ((__vector signed int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned int, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vspltw ((__vector signed int) (a1), (const int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vspltw"))))) - -#define vec_vsplth(a1, a2) \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned short, (a1)), \ - ((__vector unsigned short) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector __pixel) __builtin_altivec_vsplth ((__vector signed short) (a1), (const int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsplth"))))) - -#define vec_vspltb(a1, a2) \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__ch (__un_args_eq (__vector unsigned char, (a1)), \ - ((__vector unsigned char) __builtin_altivec_vspltb ((__vector signed char) (a1), (const int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vspltb")))) - -#define vec_splat_s8(a1) ((__vector signed char) __builtin_altivec_vspltisb (a1)) - -#define vec_splat_s16(a1) ((__vector signed short) __builtin_altivec_vspltish (a1)) - -#define vec_splat_s32(a1) ((__vector signed int) __builtin_altivec_vspltisw (a1)) - -#define vec_splat_u8(a1) ((__vector unsigned char) __builtin_altivec_vspltisb (a1)) - -#define vec_splat_u16(a1) ((__vector unsigned short) __builtin_altivec_vspltish (a1)) - -#define vec_splat_u32(a1) ((__vector unsigned int) __builtin_altivec_vspltisw (a1)) - -#define vec_sr(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sr"))))))) - -#define vec_vsrw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsrw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrw"))) - -#define vec_vsrh(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrh ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrh"))) - -#define vec_vsrb(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrb ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrb"))) - -#define vec_sra(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sra"))))))) - -#define vec_vsraw(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsraw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsraw"))) - -#define vec_vsrah(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsrah ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrah"))) - -#define vec_vsrab(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsrab ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsrab"))) - -#define vec_srl(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned short, (a2)), \ - ((__vector signed int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool int) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned int, (a2)), \ - ((__vector signed short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool short) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned int, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned short, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned int, (a2)), \ - ((__vector signed char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned short, (a2)), \ - ((__vector signed char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned int, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned short, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vsr ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_srl"))))))))))))))))))))))))))))))) - -#define vec_sro(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector signed char, (a2)), \ - ((__vector float) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector unsigned char, (a2)), \ - ((__vector float) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector unsigned char, (a2)), \ - ((__vector signed int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector signed char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector unsigned char, (a2)), \ - ((__vector signed short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector signed char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector unsigned char, (a2)), \ - ((__vector __pixel) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector signed char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector unsigned char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector signed char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsro ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sro"))))))))))))))))) - -#define vec_st(a1, a2, a3) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), short, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), int, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), float, *(a3)), \ - __builtin_altivec_stvx ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__builtin_altivec_compiletime_error ("vec_st"))))))))))))))))))))))))))) - -#define vec_stl(a1, a2, a3) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), unsigned char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), signed char, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed short, (a1), short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), unsigned short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), short, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector signed int, (a1), int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), unsigned int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), int, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__ch (__bin_args_eq (__vector float, (a1), float, *(a3)), \ - __builtin_altivec_stvxl ((__vector signed int) (a1), (a2), (void *) (a3)), \ -__builtin_altivec_compiletime_error ("vec_stl"))))))))))))))))))))))))))) - -#define vec_ste(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector signed char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector unsigned short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector signed short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector unsigned int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector signed int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ -__ch (__bin_args_eq (__vector float, (a), float, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (void *) (c)), \ - __builtin_altivec_compiletime_error ("vec_ste")))))))))))))))) - -#define vec_stvewx(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector signed int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), unsigned int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool int, (a), int, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector float, (a), float, *(c)), \ - __builtin_altivec_stvewx ((__vector signed int) (a), (b), (c)), \ -__builtin_altivec_compiletime_error ("vec_stvewx")))))) - -#define vec_stvehx(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector signed short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool short, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), unsigned short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __pixel, (a), short, *(c)), \ - __builtin_altivec_stvehx ((__vector signed short) (a), (b), (c)), \ -__builtin_altivec_compiletime_error ("vec_stvehx"))))))) - -#define vec_stvebx(a, b, c) \ -__ch (__bin_args_eq (__vector unsigned char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector signed char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), unsigned char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__ch (__bin_args_eq (__vector __bool char, (a), signed char, *(c)), \ - __builtin_altivec_stvebx ((__vector signed char) (a), (b), (c)), \ -__builtin_altivec_compiletime_error ("vec_stvebx"))))) - -#define vec_sub(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vsubfp ((__vector float) (a1), (__vector float) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sub")))))))))))))))))))) - -#define vec_vsubfp(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vsubfp ((__vector float) (a1), (__vector float) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubfp")) - -#define vec_vsubuwm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuwm ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuwm"))))))) - -#define vec_vsubuhm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhm ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuhm"))))))) - -#define vec_vsububm(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububm ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsububm"))))))) - -#define vec_subc(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubcuw ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_subc")) - -#define vec_subs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_subs"))))))))))))))))))) - -#define vec_vsubsws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsubsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubsws")))) - -#define vec_vsubuws(a1, a2) \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsubuws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuws")))) - -#define vec_vsubshs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vsubshs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubshs")))) - -#define vec_vsubuhs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vsubuhs ((__vector signed short) (a1), (__vector signed short) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubuhs")))) - -#define vec_vsubsbs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vsubsbs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsubsbs")))) - -#define vec_vsububs(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vsububs ((__vector signed char) (a1), (__vector signed char) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsububs")))) - -#define vec_sum4s(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_sum4s")))) - -#define vec_vsum4shs(a1, a2) \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4shs ((__vector signed short) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsum4shs")) - -#define vec_vsum4sbs(a1, a2) \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum4sbs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsum4sbs")) - -#define vec_vsum4ubs(a1, a2) \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vsum4ubs ((__vector signed char) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_vsum4ubs")) - -#define vec_sum2s(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsum2sws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_sum2s")) - -#define vec_sums(a1, a2) \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vsumsws ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__builtin_altivec_compiletime_error ("vec_sums")) - -#define vec_trunc(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - ((__vector float) __builtin_altivec_vrfiz ((__vector float) (a1))), \ -__builtin_altivec_compiletime_error ("vec_trunc")) - -#define vec_unpackh(a1) \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ - __builtin_altivec_compiletime_error ("vec_unpackh")))))) - -#define vec_vupkhsh(a1) \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupkhsh ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupkhsh"))) - -#define vec_vupkhpx(a1) \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupkhpx ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupkhpx")) - -#define vec_vupkhsb(a1) \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupkhsb ((__vector signed char) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupkhsb"))) - -#define vec_unpackl(a1) \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ - __builtin_altivec_compiletime_error ("vec_unpackl")))))) - -#define vec_vupklsh(a1) \ -__ch (__un_args_eq (__vector __bool short, (a1)), \ - ((__vector __bool int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ -__ch (__un_args_eq (__vector signed short, (a1)), \ - ((__vector signed int) __builtin_altivec_vupklsh ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupklsh"))) - -#define vec_vupklpx(a1) \ -__ch (__un_args_eq (__vector __pixel, (a1)), \ - ((__vector unsigned int) __builtin_altivec_vupklpx ((__vector signed short) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupklpx")) - -#define vec_vupklsb(a1) \ -__ch (__un_args_eq (__vector __bool char, (a1)), \ - ((__vector __bool short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__ch (__un_args_eq (__vector signed char, (a1)), \ - ((__vector signed short) __builtin_altivec_vupklsb ((__vector signed char) (a1))), \ -__builtin_altivec_compiletime_error ("vec_vupklsb"))) - -#define vec_xor(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector float, (a1), __vector __bool int, (a2)), \ - ((__vector float) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector float, (a2)), \ - ((__vector float) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - ((__vector __bool int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - ((__vector signed int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - ((__vector signed int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - ((__vector unsigned int) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - ((__vector __bool short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - ((__vector signed short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - ((__vector signed short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - ((__vector unsigned short) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - ((__vector __bool char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - ((__vector signed char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - ((__vector signed char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - ((__vector unsigned char) __builtin_altivec_vxor ((__vector signed int) (a1), (__vector signed int) (a2))), \ - __builtin_altivec_compiletime_error ("vec_xor"))))))))))))))))))))))))) - -/* Predicates. */ - -#define vec_all_eq(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_eq")))))))))))))))))))))))) - -#define vec_all_ge(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_ge")))))))))))))))))))) - -#define vec_all_gt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_gt")))))))))))))))))))) - -#define vec_all_in(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_in")) - -#define vec_all_le(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_le")))))))))))))))))))) - -#define vec_all_lt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_lt")))))))))))))))))))) - -#define vec_all_nan(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_nan")) - -#define vec_all_ne(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_ne")))))))))))))))))))))))) - -#define vec_all_nge(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_nge")) - -#define vec_all_ngt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_all_ngt")) - -#define vec_all_nle(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_nle")) - -#define vec_all_nlt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_nlt")) - -#define vec_all_numeric(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_all_numeric")) - -#define vec_any_eq(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_eq")))))))))))))))))))))))) - -#define vec_any_ge(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_ge")))))))))))))))))))) - -#define vec_any_gt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_gt")))))))))))))))))))) - -#define vec_any_le(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_EQ_REV, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_le")))))))))))))))))))) - -#define vec_any_lt(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpgtub_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpgtsb_p (__CR6_EQ_REV, (__vector signed char) (a2), (__vector signed char) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpgtuh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpgtsh_p (__CR6_EQ_REV, (__vector signed short) (a2), (__vector signed short) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpgtuw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpgtsw_p (__CR6_EQ_REV, (__vector signed int) (a2), (__vector signed int) (a1)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_EQ_REV, (__vector float) (a2), (__vector float) (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_lt")))))))))))))))))))) - -#define vec_any_nan(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_nan")) - -#define vec_any_ne(a1, a2) \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector signed char, (a1), __vector signed char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector unsigned char, (a1), __vector unsigned char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool char, (a1), __vector __bool char, (a2)), \ - __builtin_altivec_vcmpequb_p (__CR6_LT_REV, (__vector signed char) (a1), (__vector signed char) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector signed short, (a1), __vector signed short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector unsigned short, (a1), __vector unsigned short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool short, (a1), __vector __bool short, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __pixel, (a1), __vector __pixel, (a2)), \ - __builtin_altivec_vcmpequh_p (__CR6_LT_REV, (__vector signed short) (a1), (__vector signed short) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector signed int, (a1), __vector signed int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector unsigned int, (a1), __vector unsigned int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector __bool int, (a1), __vector __bool int, (a2)), \ - __builtin_altivec_vcmpequw_p (__CR6_LT_REV, (__vector signed int) (a1), (__vector signed int) (a2)), \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (__vector float) (a1), (__vector float) (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_ne")))))))))))))))))))))))) - -#define vec_any_nge(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_nge")) - -#define vec_any_ngt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_ngt")) - -#define vec_any_nle(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_nle")) - -#define vec_any_nlt(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a2), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_nlt")) - -#define vec_any_numeric(a1) \ -__ch (__un_args_eq (__vector float, (a1)), \ - __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (a1), (a1)), \ - __builtin_altivec_compiletime_error ("vec_any_numeric")) - -#define vec_any_out(a1, a2) \ -__ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \ - __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2)), \ - __builtin_altivec_compiletime_error ("vec_any_out")) - - -#endif /* __cplusplus */ - -#endif /* _ALTIVEC_H */ +/* PowerPC AltiVec include file. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Contributed by Aldy Hernandez (aldyh@redhat.com). + Rewritten by Paolo Bonzini (bonzini@gnu.org). + + 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. */ + +/* Implemented to conform to the specification included in the AltiVec + Technology Programming Interface Manual (ALTIVECPIM/D 6/1999 Rev 0). */ + +#ifndef _ALTIVEC_H +#define _ALTIVEC_H 1 + +#if !defined(__VEC__) || !defined(__ALTIVEC__) +#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. */ + +#if !defined(__APPLE_ALTIVEC__) +/* You are allowed to undef these for C++ compatibility. */ +#define vector __vector +#define pixel __pixel +#define bool __bool +#endif + +/* Condition register codes for AltiVec predicates. */ + +#define __CR6_EQ 0 +#define __CR6_EQ_REV 1 +#define __CR6_LT 2 +#define __CR6_LT_REV 3 + +/* Synonyms. */ +#define vec_vaddcuw vec_addc +#define vec_vand vec_and +#define vec_vandc vec_andc +#define vec_vrfip vec_ceil +#define vec_vcmpbfp vec_cmpb +#define vec_vcmpgefp vec_cmpge +#define vec_vctsxs vec_cts +#define vec_vctuxs vec_ctu +#define vec_vexptefp vec_expte +#define vec_vrfim vec_floor +#define vec_lvx vec_ld +#define vec_lvxl vec_ldl +#define vec_vlogefp vec_loge +#define vec_vmaddfp vec_madd +#define vec_vmhaddshs vec_madds +#define vec_vmladduhm vec_mladd +#define vec_vmhraddshs vec_mradds +#define vec_vnmsubfp vec_nmsub +#define vec_vnor vec_nor +#define vec_vor vec_or +#define vec_vpkpx vec_packpx +#define vec_vperm vec_perm +#define vec_vrefp vec_re +#define vec_vrfin vec_round +#define vec_vrsqrtefp vec_rsqrte +#define vec_vsel vec_sel +#define vec_vsldoi vec_sld +#define vec_vsl vec_sll +#define vec_vslo vec_slo +#define vec_vspltisb vec_splat_s8 +#define vec_vspltish vec_splat_s16 +#define vec_vspltisw vec_splat_s32 +#define vec_vsr vec_srl +#define vec_vsro vec_sro +#define vec_stvx vec_st +#define vec_stvxl vec_stl +#define vec_vsubcuw vec_subc +#define vec_vsum2sws vec_sum2s +#define vec_vsumsws vec_sums +#define vec_vrfiz vec_trunc +#define vec_vxor vec_xor + +/* Functions that are resolved by the backend to one of the + typed builtins. */ +#define vec_vaddfp __builtin_vec_vaddfp +#define vec_addc __builtin_vec_addc +#define vec_vaddsws __builtin_vec_vaddsws +#define vec_vaddshs __builtin_vec_vaddshs +#define vec_vaddsbs __builtin_vec_vaddsbs +#define vec_vavgsw __builtin_vec_vavgsw +#define vec_vavguw __builtin_vec_vavguw +#define vec_vavgsh __builtin_vec_vavgsh +#define vec_vavguh __builtin_vec_vavguh +#define vec_vavgsb __builtin_vec_vavgsb +#define vec_vavgub __builtin_vec_vavgub +#define vec_ceil __builtin_vec_ceil +#define vec_cmpb __builtin_vec_cmpb +#define vec_vcmpeqfp __builtin_vec_vcmpeqfp +#define vec_cmpge __builtin_vec_cmpge +#define vec_vcmpgtfp __builtin_vec_vcmpgtfp +#define vec_vcmpgtsw __builtin_vec_vcmpgtsw +#define vec_vcmpgtuw __builtin_vec_vcmpgtuw +#define vec_vcmpgtsh __builtin_vec_vcmpgtsh +#define vec_vcmpgtuh __builtin_vec_vcmpgtuh +#define vec_vcmpgtsb __builtin_vec_vcmpgtsb +#define vec_vcmpgtub __builtin_vec_vcmpgtub +#define vec_vcfsx __builtin_vec_vcfsx +#define vec_vcfux __builtin_vec_vcfux +#define vec_cts __builtin_vec_cts +#define vec_ctu __builtin_vec_ctu +#define vec_expte __builtin_vec_expte +#define vec_floor __builtin_vec_floor +#define vec_loge __builtin_vec_loge +#define vec_madd __builtin_vec_madd +#define vec_madds __builtin_vec_madds +#define vec_mtvscr __builtin_vec_mtvscr +#define vec_vmaxfp __builtin_vec_vmaxfp +#define vec_vmaxsw __builtin_vec_vmaxsw +#define vec_vmaxsh __builtin_vec_vmaxsh +#define vec_vmaxsb __builtin_vec_vmaxsb +#define vec_vminfp __builtin_vec_vminfp +#define vec_vminsw __builtin_vec_vminsw +#define vec_vminsh __builtin_vec_vminsh +#define vec_vminsb __builtin_vec_vminsb +#define vec_mradds __builtin_vec_mradds +#define vec_vmsumshm __builtin_vec_vmsumshm +#define vec_vmsumuhm __builtin_vec_vmsumuhm +#define vec_vmsummbm __builtin_vec_vmsummbm +#define vec_vmsumubm __builtin_vec_vmsumubm +#define vec_vmsumshs __builtin_vec_vmsumshs +#define vec_vmsumuhs __builtin_vec_vmsumuhs +#define vec_vmulesb __builtin_vec_vmulesb +#define vec_vmulesh __builtin_vec_vmulesh +#define vec_vmuleuh __builtin_vec_vmuleuh +#define vec_vmuleub __builtin_vec_vmuleub +#define vec_vmulosh __builtin_vec_vmulosh +#define vec_vmulouh __builtin_vec_vmulouh +#define vec_vmulosb __builtin_vec_vmulosb +#define vec_vmuloub __builtin_vec_vmuloub +#define vec_nmsub __builtin_vec_nmsub +#define vec_packpx __builtin_vec_packpx +#define vec_vpkswss __builtin_vec_vpkswss +#define vec_vpkuwus __builtin_vec_vpkuwus +#define vec_vpkshss __builtin_vec_vpkshss +#define vec_vpkuhus __builtin_vec_vpkuhus +#define vec_vpkswus __builtin_vec_vpkswus +#define vec_vpkshus __builtin_vec_vpkshus +#define vec_re __builtin_vec_re +#define vec_round __builtin_vec_round +#define vec_rsqrte __builtin_vec_rsqrte +#define vec_vsubfp __builtin_vec_vsubfp +#define vec_subc __builtin_vec_subc +#define vec_vsubsws __builtin_vec_vsubsws +#define vec_vsubshs __builtin_vec_vsubshs +#define vec_vsubsbs __builtin_vec_vsubsbs +#define vec_sum4s __builtin_vec_sum4s +#define vec_vsum4shs __builtin_vec_vsum4shs +#define vec_vsum4sbs __builtin_vec_vsum4sbs +#define vec_vsum4ubs __builtin_vec_vsum4ubs +#define vec_sum2s __builtin_vec_sum2s +#define vec_sums __builtin_vec_sums +#define vec_trunc __builtin_vec_trunc +#define vec_vupkhpx __builtin_vec_vupkhpx +#define vec_vupkhsh __builtin_vec_vupkhsh +#define vec_vupkhsb __builtin_vec_vupkhsb +#define vec_vupklpx __builtin_vec_vupklpx +#define vec_vupklsh __builtin_vec_vupklsh +#define vec_vupklsb __builtin_vec_vupklsb +#define vec_abs __builtin_vec_abs +#define vec_abss __builtin_vec_abss +#define vec_add __builtin_vec_add +#define vec_adds __builtin_vec_adds +#define vec_and __builtin_vec_and +#define vec_andc __builtin_vec_andc +#define vec_avg __builtin_vec_avg +#define vec_cmpeq __builtin_vec_cmpeq +#define vec_cmpgt __builtin_vec_cmpgt +#define vec_ctf __builtin_vec_ctf +#define vec_dst __builtin_vec_dst +#define vec_dstst __builtin_vec_dstst +#define vec_dststt __builtin_vec_dststt +#define vec_dstt __builtin_vec_dstt +#define vec_ld __builtin_vec_ld +#define vec_lde __builtin_vec_lde +#define vec_ldl __builtin_vec_ldl +#define vec_lvebx __builtin_vec_lvebx +#define vec_lvehx __builtin_vec_lvehx +#define vec_lvewx __builtin_vec_lvewx +#define vec_lvsl __builtin_vec_lvsl +#define vec_lvsr __builtin_vec_lvsr +#define vec_max __builtin_vec_max +#define vec_mergeh __builtin_vec_mergeh +#define vec_mergel __builtin_vec_mergel +#define vec_min __builtin_vec_min +#define vec_mladd __builtin_vec_mladd +#define vec_msum __builtin_vec_msum +#define vec_msums __builtin_vec_msums +#define vec_mule __builtin_vec_mule +#define vec_mulo __builtin_vec_mulo +#define vec_nor __builtin_vec_nor +#define vec_or __builtin_vec_or +#define vec_pack __builtin_vec_pack +#define vec_packs __builtin_vec_packs +#define vec_packsu __builtin_vec_packsu +#define vec_perm __builtin_vec_perm +#define vec_rl __builtin_vec_rl +#define vec_sel __builtin_vec_sel +#define vec_sl __builtin_vec_sl +#define vec_sld __builtin_vec_sld +#define vec_sll __builtin_vec_sll +#define vec_slo __builtin_vec_slo +#define vec_splat __builtin_vec_splat +#define vec_sr __builtin_vec_sr +#define vec_sra __builtin_vec_sra +#define vec_srl __builtin_vec_srl +#define vec_sro __builtin_vec_sro +#define vec_st __builtin_vec_st +#define vec_ste __builtin_vec_ste +#define vec_stl __builtin_vec_stl +#define vec_stvebx __builtin_vec_stvebx +#define vec_stvehx __builtin_vec_stvehx +#define vec_stvewx __builtin_vec_stvewx +#define vec_sub __builtin_vec_sub +#define vec_subs __builtin_vec_subs +#define vec_sum __builtin_vec_sum +#define vec_unpackh __builtin_vec_unpackh +#define vec_unpackl __builtin_vec_unpackl +#define vec_vaddubm __builtin_vec_vaddubm +#define vec_vaddubs __builtin_vec_vaddubs +#define vec_vadduhm __builtin_vec_vadduhm +#define vec_vadduhs __builtin_vec_vadduhs +#define vec_vadduwm __builtin_vec_vadduwm +#define vec_vadduws __builtin_vec_vadduws +#define vec_vcmpequb __builtin_vec_vcmpequb +#define vec_vcmpequh __builtin_vec_vcmpequh +#define vec_vcmpequw __builtin_vec_vcmpequw +#define vec_vmaxub __builtin_vec_vmaxub +#define vec_vmaxuh __builtin_vec_vmaxuh +#define vec_vmaxuw __builtin_vec_vmaxuw +#define vec_vminub __builtin_vec_vminub +#define vec_vminuh __builtin_vec_vminuh +#define vec_vminuw __builtin_vec_vminuw +#define vec_vmrghb __builtin_vec_vmrghb +#define vec_vmrghh __builtin_vec_vmrghh +#define vec_vmrghw __builtin_vec_vmrghw +#define vec_vmrglb __builtin_vec_vmrglb +#define vec_vmrglh __builtin_vec_vmrglh +#define vec_vmrglw __builtin_vec_vmrglw +#define vec_vpkuhum __builtin_vec_vpkuhum +#define vec_vpkuwum __builtin_vec_vpkuwum +#define vec_vrlb __builtin_vec_vrlb +#define vec_vrlh __builtin_vec_vrlh +#define vec_vrlw __builtin_vec_vrlw +#define vec_vslb __builtin_vec_vslb +#define vec_vslh __builtin_vec_vslh +#define vec_vslw __builtin_vec_vslw +#define vec_vspltb __builtin_vec_vspltb +#define vec_vsplth __builtin_vec_vsplth +#define vec_vspltw __builtin_vec_vspltw +#define vec_vsrab __builtin_vec_vsrab +#define vec_vsrah __builtin_vec_vsrah +#define vec_vsraw __builtin_vec_vsraw +#define vec_vsrb __builtin_vec_vsrb +#define vec_vsrh __builtin_vec_vsrh +#define vec_vsrw __builtin_vec_vsrw +#define vec_vsububs __builtin_vec_vsububs +#define vec_vsububm __builtin_vec_vsububm +#define vec_vsubuhm __builtin_vec_vsubuhm +#define vec_vsubuhs __builtin_vec_vsubuhs +#define vec_vsubuwm __builtin_vec_vsubuwm +#define vec_vsubuws __builtin_vec_vsubuws +#define vec_xor __builtin_vec_xor + +/* Predicates. + For C++, we use templates in order to allow non-parenthesized arguments. + For C, instead, we use macros since non-parenthesized arguments were + not allowed even in older GCC implementation of AltiVec. + + In the future, we may add more magic to the back-end, so that no + one- or two-argument macros are used. */ + +#ifdef __cplusplus__ +#define __altivec_unary_pred(NAME, CALL) \ +template int NAME (T a1) { return CALL; } + +#define __altivec_scalar_pred(NAME, CALL) \ +template int NAME (T a1, U a2) { return CALL; } + +/* Given the vec_step of a type, return the corresponding bool type. */ +template class __altivec_bool_ret { }; +template <> class __altivec_bool_ret <4> { + typedef __vector __bool int __ret; +}; +template <> class __altivec_bool_ret <8> { + typedef __vector __bool short __ret; +}; +template <> class __altivec_bool_ret <16> { + typedef __vector __bool char __ret; +}; + +/* Be very liberal in the pairs we accept. Mistakes such as passing + a `vector char' and `vector short' will be caught by the middle-end, + while any attempt to detect them here would produce hard to understand + error messages involving the implementation details of AltiVec. */ +#define __altivec_binary_pred(NAME, CALL) \ +template \ +typename __altivec_bool_ret ::__ret \ +NAME (T a1, U a2) \ +{ \ + return CALL; \ +} + +__altivec_binary_pred(vec_cmplt, + __builtin_vec_cmpgt (a2, a1)) +__altivec_binary_pred(vec_cmple, + __builtin_altivec_cmpge (a2, a1)) + +__altivec_scalar_pred(vec_all_in, + __builtin_altivec_vcmpbfp_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_any_out, + __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, a1, a2)) + +__altivec_unary_pred(vec_all_nan, + __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1)) +__altivec_unary_pred(vec_any_nan, + __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, a1, a1)) + +__altivec_unary_pred(vec_all_numeric, + __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1)) +__altivec_unary_pred(vec_any_numeric, + __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, a1, a1)) + +__altivec_scalar_pred(vec_all_eq, + __builtin_vec_vcmpeq_p (__CR6_LT, a1, a2)) +__altivec_scalar_pred(vec_all_ne, + __builtin_vec_vcmpeq_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_any_eq, + __builtin_vec_vcmpeq_p (__CR6_EQ_REV, a1, a2)) +__altivec_scalar_pred(vec_any_ne, + __builtin_vec_vcmpeq_p (__CR6_LT_REV, a1, a2)) + +__altivec_scalar_pred(vec_all_gt, + __builtin_vec_vcmpgt_p (__CR6_LT, a1, a2)) +__altivec_scalar_pred(vec_all_lt, + __builtin_vec_vcmpgt_p (__CR6_LT, a2, a1)) +__altivec_scalar_pred(vec_any_gt, + __builtin_vec_vcmpgt_p (__CR6_EQ_REV, a1, a2)) +__altivec_scalar_pred(vec_any_lt, + __builtin_vec_vcmpgt_p (__CR6_EQ_REV, a2, a1)) + +__altivec_scalar_pred(vec_all_ngt, + __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_all_nlt, + __builtin_altivec_vcmpgtfp_p (__CR6_EQ, a2, a1)) +__altivec_scalar_pred(vec_any_ngt, + __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a1, a2)) +__altivec_scalar_pred(vec_any_nlt, + __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, a2, a1)) + +/* __builtin_vec_vcmpge_p is vcmpgefp for floating-point vector types, + while for integer types it is converted to __builtin_vec_vcmpgt_p, + with inverted args and condition code. */ +__altivec_scalar_pred(vec_all_le, + __builtin_vec_vcmpge_p (__CR6_LT, a2, a1)) +__altivec_scalar_pred(vec_all_ge, + __builtin_vec_vcmpge_p (__CR6_LT, a1, a2)) +__altivec_scalar_pred(vec_any_le, + __builtin_vec_vcmpge_p (__CR6_EQ_REV, a2, a1)) +__altivec_scalar_pred(vec_any_ge, + __builtin_vec_vcmpge_p (__CR6_EQ_REV, a1, a2)) + +__altivec_scalar_pred(vec_all_nge, + __builtin_altivec_vcmpgefp_p (__CR6_EQ, a1, a2)) +__altivec_scalar_pred(vec_all_nle, + __builtin_altivec_vcmpgefp_p (__CR6_EQ, a2, a1)) +__altivec_scalar_pred(vec_any_nge, + __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a1, a2)) +__altivec_scalar_pred(vec_any_nle, + __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, a2, a1)) + +#undef __altivec_scalar_pred +#undef __altivec_unary_pred +#undef __altivec_binary_pred +#else +#define vec_cmplt(a1, a2) __builtin_vec_cmpgt ((a2), (a1)) +#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a2), (a1)) + +#define vec_all_in(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ, (a1), (a2)) +#define vec_any_out(a1, a2) __builtin_altivec_vcmpbfp_p (__CR6_EQ_REV, (a1), (a2)) + +#define vec_all_nan(a1) __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1)) +#define vec_any_nan(a1) __builtin_altivec_vcmpeqfp_p (__CR6_LT_REV, (a1), (a1)) + +#define vec_all_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1)) +#define vec_any_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_EQ_REV, (a1), (a1)) + +#define vec_all_eq(a1, a2) __builtin_vec_vcmpeq_p (__CR6_LT, (a1), (a2)) +#define vec_all_ne(a1, a2) __builtin_vec_vcmpeq_p (__CR6_EQ, (a1), (a2)) +#define vec_any_eq(a1, a2) __builtin_vec_vcmpeq_p (__CR6_EQ_REV, (a1), (a2)) +#define vec_any_ne(a1, a2) __builtin_vec_vcmpeq_p (__CR6_LT_REV, (a1), (a2)) + +#define vec_all_gt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_LT, (a1), (a2)) +#define vec_all_lt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_LT, (a2), (a1)) +#define vec_any_gt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_EQ_REV, (a1), (a2)) +#define vec_any_lt(a1, a2) __builtin_vec_vcmpgt_p (__CR6_EQ_REV, (a2), (a1)) + +#define vec_all_ngt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a1), (a2)) +#define vec_all_nlt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1)) +#define vec_any_ngt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a1), (a2)) +#define vec_any_nlt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_LT_REV, (a2), (a1)) + +/* __builtin_vec_vcmpge_p is vcmpgefp for floating-point vector types, + while for integer types it is converted to __builtin_vec_vcmpgt_p, + with inverted args and condition code. */ +#define vec_all_le(a1, a2) __builtin_vec_vcmpge_p (__CR6_LT, (a2), (a1)) +#define vec_all_ge(a1, a2) __builtin_vec_vcmpge_p (__CR6_LT, (a1), (a2)) +#define vec_any_le(a1, a2) __builtin_vec_vcmpge_p (__CR6_EQ_REV, (a2), (a1)) +#define vec_any_ge(a1, a2) __builtin_vec_vcmpge_p (__CR6_EQ_REV, (a1), (a2)) + +#define vec_all_nge(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a1), (a2)) +#define vec_all_nle(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_EQ, (a2), (a1)) +#define vec_any_nge(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a1), (a2)) +#define vec_any_nle(a1, a2) __builtin_altivec_vcmpgefp_p (__CR6_LT_REV, (a2), (a1)) +#endif + +/* These do not accept vectors, so they do not have a __builtin_vec_* + counterpart. */ +#define vec_dss(x) __builtin_altivec_dss((x)) +#define vec_dssall() __builtin_altivec_dssall () +#define vec_mfvscr() ((__vector unsigned short) __builtin_altivec_mfvscr ()) +#define vec_splat_s8(x) __builtin_altivec_vspltisb ((x)) +#define vec_splat_s16(x) __builtin_altivec_vspltish ((x)) +#define vec_splat_s32(x) __builtin_altivec_vspltisw ((x)) +#define vec_splat_u8(x) ((__vector unsigned char) vec_splat_s8 ((x))) +#define vec_splat_u16(x) ((__vector unsigned short) vec_splat_s16 ((x))) +#define vec_splat_u32(x) ((__vector unsigned int) vec_splat_s32 ((x))) + +/* This also accepts a type for its parameter, so it is not enough + to #define vec_step to __builtin_vec_step. */ +#define vec_step(x) __builtin_vec_step (* (__typeof__ (x) *) 0) + +#endif /* _ALTIVEC_H */ diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md index 9e98ffe1a6b..418228d7bb3 100644 --- a/gcc/config/rs6000/altivec.md +++ b/gcc/config/rs6000/altivec.md @@ -33,10 +33,13 @@ (UNSPEC_VCMPGTUW 60) (UNSPEC_VCMPGTSW 61) (UNSPEC_VCMPGTFP 62) + (UNSPEC_VSLW 109) + (UNSPEC_SUBS 126) (UNSPEC_VSEL4SI 159) (UNSPEC_VSEL4SF 160) (UNSPEC_VSEL8HI 161) (UNSPEC_VSEL16QI 162) + (UNSPEC_SET_VSCR 213) (UNSPEC_VCOND_V4SI 301) (UNSPEC_VCOND_V4SF 302) (UNSPEC_VCOND_V8HI 303) @@ -99,7 +102,7 @@ case 4: return "#"; case 5: return "#"; case 6: return output_vec_const_move (operands); - default: abort(); + default: gcc_unreachable (); } } [(set_attr "type" "vecstore,vecload,vecsimple,store,load,*,*")]) @@ -251,7 +254,7 @@ [(set (match_operand:VI 0 "register_operand" "=v") (unspec:VI [(match_operand:VI 1 "register_operand" "v") (match_operand:VI 2 "register_operand" "v")] 36)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vaddus %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -260,7 +263,7 @@ [(set (match_operand:VI 0 "register_operand" "=v") (unspec:VI [(match_operand:VI 1 "register_operand" "v") (match_operand:VI 2 "register_operand" "v")] 37)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vaddss %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -294,7 +297,7 @@ [(set (match_operand:VI 0 "register_operand" "=v") (unspec:VI [(match_operand:VI 1 "register_operand" "v") (match_operand:VI 2 "register_operand" "v")] 125)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsubus %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -302,8 +305,8 @@ (define_insn "altivec_vsubss" [(set (match_operand:VI 0 "register_operand" "=v") (unspec:VI [(match_operand:VI 1 "register_operand" "v") - (match_operand:VI 2 "register_operand" "v")] 126)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (match_operand:VI 2 "register_operand" "v")] UNSPEC_SUBS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsubss %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -474,6 +477,65 @@ DONE; }") +;; 32 bit integer multiplication +;; A_high = Operand_0 & 0xFFFF0000 >> 16 +;; A_low = Operand_0 & 0xFFFF +;; B_high = Operand_1 & 0xFFFF0000 >> 16 +;; B_low = Operand_1 & 0xFFFF +;; result = A_low * B_low + (A_high * B_low + B_high * A_low) << 16 + +;; (define_insn "mulv4si3" +;; [(set (match_operand:V4SI 0 "register_operand" "=v") +;; (mult:V4SI (match_operand:V4SI 1 "register_operand" "v") +;; (match_operand:V4SI 2 "register_operand" "v")))] +(define_expand "mulv4si3" + [(use (match_operand:V4SI 0 "register_operand" "")) + (use (match_operand:V4SI 1 "register_operand" "")) + (use (match_operand:V4SI 2 "register_operand" ""))] + "TARGET_ALTIVEC" + " + { + rtx zero; + rtx swap; + rtx small_swap; + rtx sixteen; + rtx one; + rtx two; + rtx low_product; + rtx high_product; + + zero = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vspltisw (zero, const0_rtx)); + + sixteen = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vspltisw (sixteen, gen_rtx_CONST_INT (V4SImode, -16))); + + swap = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vrlw (swap, operands[2], sixteen)); + + one = gen_reg_rtx (V8HImode); + convert_move (one, operands[1], 0); + + two = gen_reg_rtx (V8HImode); + convert_move (two, operands[2], 0); + + small_swap = gen_reg_rtx (V8HImode); + convert_move (small_swap, swap, 0); + + low_product = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vmulouh (low_product, one, two)); + + high_product = gen_reg_rtx (V4SImode); + emit_insn (gen_altivec_vmsumuhm (high_product, one, small_swap, zero)); + + emit_insn (gen_altivec_vslw (high_product, high_product, sixteen)); + + emit_insn (gen_addv4si3 (operands[0], high_product, low_product)); + + DONE; + }") + + ;; Fused multiply subtract (define_insn "altivec_vnmsubfp" [(set (match_operand:V4SF 0 "register_operand" "=v") @@ -516,7 +578,7 @@ (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") (match_operand:V4SI 3 "register_operand" "v")] 69)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vmsumuhs %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) @@ -526,7 +588,7 @@ (unspec:V4SI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") (match_operand:V4SI 3 "register_operand" "v")] 70)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vmsumshs %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) @@ -586,7 +648,7 @@ (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") (match_operand:V8HI 3 "register_operand" "v")] 71)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vmhaddshs %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) @@ -595,7 +657,7 @@ (unspec:V8HI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v") (match_operand:V8HI 3 "register_operand" "v")] 72)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vmhraddshs %0,%1,%2,%3" [(set_attr "type" "veccomplex")]) @@ -611,24 +673,40 @@ (define_insn "altivec_vmrghb" [(set (match_operand:V16QI 0 "register_operand" "=v") (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v") - (parallel [(const_int 8) + (parallel [(const_int 0) + (const_int 8) + (const_int 1) (const_int 9) + (const_int 2) (const_int 10) - (const_int 11) + (const_int 3) + (const_int 11) + (const_int 4) (const_int 12) + (const_int 5) (const_int 13) - (const_int 14) - (const_int 15) + (const_int 6) + (const_int 14) + (const_int 7) + (const_int 15)])) + (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v") + (parallel [(const_int 8) (const_int 0) + (const_int 9) (const_int 1) + (const_int 10) (const_int 2) - (const_int 3) + (const_int 11) + (const_int 3) + (const_int 12) (const_int 4) + (const_int 13) (const_int 5) + (const_int 14) (const_int 6) + (const_int 15) (const_int 7)])) - (match_operand:V16QI 2 "register_operand" "v") - (const_int 255)))] + (const_int 21845)))] "TARGET_ALTIVEC" "vmrghb %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -636,16 +714,24 @@ (define_insn "altivec_vmrghh" [(set (match_operand:V8HI 0 "register_operand" "=v") (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v") - (parallel [(const_int 4) + (parallel [(const_int 0) + (const_int 4) + (const_int 1) (const_int 5) + (const_int 2) (const_int 6) - (const_int 7) + (const_int 3) + (const_int 7)])) + (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v") + (parallel [(const_int 4) (const_int 0) + (const_int 5) (const_int 1) + (const_int 6) (const_int 2) + (const_int 7) (const_int 3)])) - (match_operand:V8HI 2 "register_operand" "v") - (const_int 15)))] + (const_int 85)))] "TARGET_ALTIVEC" "vmrghh %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -653,67 +739,99 @@ (define_insn "altivec_vmrghw" [(set (match_operand:V4SI 0 "register_operand" "=v") (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v") + (parallel [(const_int 0) + (const_int 2) + (const_int 1) + (const_int 3)])) + (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v") (parallel [(const_int 2) - (const_int 3) - (const_int 0) + (const_int 0) + (const_int 3) (const_int 1)])) - (match_operand:V4SI 2 "register_operand" "v") - (const_int 12)))] + (const_int 5)))] "TARGET_ALTIVEC" "vmrghw %0,%1,%2" [(set_attr "type" "vecperm")]) (define_insn "altivec_vmrglb" [(set (match_operand:V16QI 0 "register_operand" "=v") - (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v") - (parallel [(const_int 0) + (vec_merge:V16QI (vec_select:V16QI (match_operand:V16QI 1 "register_operand" "v") + (parallel [(const_int 8) + (const_int 0) + (const_int 9) (const_int 1) + (const_int 10) (const_int 2) - (const_int 3) + (const_int 11) + (const_int 3) + (const_int 12) (const_int 4) + (const_int 13) (const_int 5) - (const_int 6) - (const_int 7) + (const_int 14) + (const_int 6) + (const_int 15) + (const_int 7)])) + (vec_select:V16QI (match_operand:V16QI 2 "register_operand" "v") + (parallel [(const_int 0) (const_int 8) + (const_int 1) (const_int 9) + (const_int 2) (const_int 10) - (const_int 11) + (const_int 3) + (const_int 11) + (const_int 4) (const_int 12) + (const_int 5) (const_int 13) + (const_int 6) (const_int 14) + (const_int 7) (const_int 15)])) - (match_operand:V16QI 1 "register_operand" "v") - (const_int 255)))] + (const_int 21845)))] "TARGET_ALTIVEC" "vmrglb %0,%1,%2" [(set_attr "type" "vecperm")]) (define_insn "altivec_vmrglh" [(set (match_operand:V8HI 0 "register_operand" "=v") - (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v") - (parallel [(const_int 0) + (vec_merge:V8HI (vec_select:V8HI (match_operand:V8HI 1 "register_operand" "v") + (parallel [(const_int 4) + (const_int 0) + (const_int 5) (const_int 1) + (const_int 6) (const_int 2) - (const_int 3) + (const_int 7) + (const_int 3)])) + (vec_select:V8HI (match_operand:V8HI 2 "register_operand" "v") + (parallel [(const_int 0) (const_int 4) + (const_int 1) (const_int 5) + (const_int 2) (const_int 6) + (const_int 3) (const_int 7)])) - (match_operand:V8HI 1 "register_operand" "v") - (const_int 15)))] + (const_int 85)))] "TARGET_ALTIVEC" "vmrglh %0,%1,%2" [(set_attr "type" "vecperm")]) (define_insn "altivec_vmrglw" [(set (match_operand:V4SI 0 "register_operand" "=v") - (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v") + (vec_merge:V4SI (vec_select:V4SI (match_operand:V4SI 1 "register_operand" "v") + (parallel [(const_int 2) + (const_int 0) + (const_int 3) + (const_int 1)])) + (vec_select:V4SI (match_operand:V4SI 2 "register_operand" "v") (parallel [(const_int 0) - (const_int 1) - (const_int 2) + (const_int 2) + (const_int 1) (const_int 3)])) - (match_operand:V4SI 1 "register_operand" "v") - (const_int 12)))] + (const_int 5)))] "TARGET_ALTIVEC" "vmrglw %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -832,6 +950,14 @@ "vandc %0,%1,%2" [(set_attr "type" "vecsimple")]) +(define_insn "*andc3_v4sf" + [(set (match_operand:V4SF 0 "register_operand" "=v") + (and:V4SF (not:V4SF (match_operand:V4SF 2 "register_operand" "v")) + (match_operand:V4SF 1 "register_operand" "v")))] + "TARGET_ALTIVEC" + "vandc %0,%1,%2" + [(set_attr "type" "vecsimple")]) + (define_insn "altivec_vpkuhum" [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") @@ -860,7 +986,7 @@ [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v")] 96)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkuhss %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -869,7 +995,7 @@ [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v")] 97)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkshss %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -878,7 +1004,7 @@ [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 98)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkuwss %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -887,7 +1013,7 @@ [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 99)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkswss %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -896,7 +1022,7 @@ [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v")] 100)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkuhus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -905,7 +1031,7 @@ [(set (match_operand:V16QI 0 "register_operand" "=v") (unspec:V16QI [(match_operand:V8HI 1 "register_operand" "v") (match_operand:V8HI 2 "register_operand" "v")] 101)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkshus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -914,7 +1040,7 @@ [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 102)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkuwus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -923,7 +1049,7 @@ [(set (match_operand:V8HI 0 "register_operand" "=v") (unspec:V8HI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 103)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vpkswus %0,%1,%2" [(set_attr "type" "vecperm")]) @@ -947,7 +1073,7 @@ (define_insn "altivec_vslw_v4sf" [(set (match_operand:V4SF 0 "register_operand" "=v") (unspec:V4SF [(match_operand:V4SF 1 "register_operand" "v") - (match_operand:V4SF 2 "register_operand" "v")] 109))] + (match_operand:V4SF 2 "register_operand" "v")] UNSPEC_VSLW))] "TARGET_ALTIVEC" "vslw %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -968,18 +1094,18 @@ "vslo %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vsr" +(define_insn "lshr3" [(set (match_operand:VI 0 "register_operand" "=v") - (unspec:VI [(match_operand:VI 1 "register_operand" "v") - (match_operand:VI 2 "register_operand" "v")] 112))] + (lshiftrt:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v") ))] "TARGET_ALTIVEC" "vsr %0,%1,%2" [(set_attr "type" "vecsimple")]) -(define_insn "altivec_vsra" +(define_insn "ashr3" [(set (match_operand:VI 0 "register_operand" "=v") - (unspec:VI [(match_operand:VI 1 "register_operand" "v") - (match_operand:VI 2 "register_operand" "v")] 115))] + (ashiftrt:VI (match_operand:VI 1 "register_operand" "v") + (match_operand:VI 2 "register_operand" "v") ))] "TARGET_ALTIVEC" "vsra %0,%1,%2" [(set_attr "type" "vecsimple")]) @@ -1004,7 +1130,7 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V16QI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 131)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsum4ubs %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -1013,7 +1139,7 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:VIshort 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 132)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsum4ss %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -1022,7 +1148,7 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 134)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsum2sws %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -1031,7 +1157,7 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v") (match_operand:V4SI 2 "register_operand" "v")] 135)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vsumsws %0,%1,%2" [(set_attr "type" "veccomplex")]) @@ -1066,35 +1192,18 @@ "vspltw %0,%1,%2" [(set_attr "type" "vecperm")]) -(define_insn "altivec_vspltisb" - [(set (match_operand:V16QI 0 "register_operand" "=v") - (vec_duplicate:V16QI - (match_operand:QI 1 "immediate_operand" "i")))] - "TARGET_ALTIVEC" - "vspltisb %0,%1" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vspltish" - [(set (match_operand:V8HI 0 "register_operand" "=v") - (vec_duplicate:V8HI - (sign_extend:HI (match_operand:QI 1 "immediate_operand" "i"))))] - "TARGET_ALTIVEC" - "vspltish %0,%1" - [(set_attr "type" "vecperm")]) - -(define_insn "altivec_vspltisw" - [(set (match_operand:V4SI 0 "register_operand" "=v") - (vec_duplicate:V4SI - (sign_extend:SI (match_operand:QI 1 "immediate_operand" "i"))))] +(define_insn "altivec_vspltis" + [(set (match_operand:VI 0 "register_operand" "=v") + (vec_duplicate:VI + (match_operand:QI 1 "const_int_operand" "i")))] "TARGET_ALTIVEC" - "vspltisw %0,%1" + "vspltis %0,%1" [(set_attr "type" "vecperm")]) (define_insn "altivec_vspltisw_v4sf" [(set (match_operand:V4SF 0 "register_operand" "=v") (vec_duplicate:V4SF - (float:SF (sign_extend:SI - (match_operand:QI 1 "immediate_operand" "i")))))] + (float:SF (match_operand:QI 1 "const_int_operand" "i"))))] "TARGET_ALTIVEC" "vspltisw %0,%1" [(set_attr "type" "vecperm")]) @@ -1165,7 +1274,7 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") (match_operand:QI 2 "immediate_operand" "i")] 153)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vctuxs %0,%1,%2" [(set_attr "type" "vecfloat")]) @@ -1174,7 +1283,7 @@ [(set (match_operand:V4SI 0 "register_operand" "=v") (unspec:V4SI [(match_operand:V4SF 1 "register_operand" "v") (match_operand:QI 2 "immediate_operand" "i")] 154)) - (set (reg:SI 110) (unspec:SI [(const_int 0)] 213))] + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))] "TARGET_ALTIVEC" "vctsxs %0,%1,%2" [(set_attr "type" "vecfloat")]) @@ -1596,8 +1705,7 @@ rtx addr; rtx temp; - if (GET_CODE (operands[1]) != MEM) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); addr = XEXP (operands[1], 0); temp = gen_reg_rtx (GET_MODE (addr)); @@ -1624,7 +1732,7 @@ [(parallel [(set (match_operand:V4SI 0 "register_operand" "=v") (match_operand:V4SI 1 "memory_operand" "m")) - (unspec [(const_int 0)] 213)])] + (unspec [(const_int 0)] UNSPEC_SET_VSCR)])] "TARGET_ALTIVEC" "lvxl %0,%y1" [(set_attr "type" "vecload")]) @@ -1663,35 +1771,59 @@ "stvex %1,%y0" [(set_attr "type" "vecstore")]) -(define_insn "abs2" - [(set (match_operand:VI 0 "register_operand" "=v") - (abs:VI (match_operand:VI 1 "register_operand" "v"))) - (clobber (match_scratch:VI 2 "=&v")) - (clobber (match_scratch:VI 3 "=&v"))] +;; Generate +;; vspltis? SCRATCH0,0 +;; vsubu?m SCRATCH2,SCRATCH1,%1 +;; vmaxs? %0,%1,SCRATCH2" +(define_expand "abs2" + [(set (match_dup 2) (vec_duplicate:VI (const_int 0))) + (set (match_dup 3) + (minus:VI (match_dup 2) + (match_operand:VI 1 "register_operand" "v"))) + (set (match_operand:VI 0 "register_operand" "=v") + (smax:VI (match_dup 1) (match_dup 3)))] "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubum %3,%2,%1\;vmaxs %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) +{ + operands[2] = gen_reg_rtx (GET_MODE (operands[0])); + operands[3] = gen_reg_rtx (GET_MODE (operands[0])); +}) -(define_insn "absv4sf2" - [(set (match_operand:V4SF 0 "register_operand" "=v") - (abs:V4SF (match_operand:V4SF 1 "register_operand" "v"))) - (clobber (match_scratch:V4SF 2 "=&v")) - (clobber (match_scratch:V4SF 3 "=&v"))] +;; Generate +;; vspltisw SCRATCH1,-1 +;; vslw SCRATCH2,SCRATCH1,SCRATCH1 +;; vandc %0,%1,SCRATCH2 +(define_expand "absv4sf2" + [(set (match_dup 2) + (vec_duplicate:V4SF (float:SF (const_int -1)))) + (set (match_dup 3) + (unspec:V4SF [(match_dup 2) (match_dup 2)] UNSPEC_VSLW)) + (set (match_operand:V4SF 0 "register_operand" "=v") + (and:V4SF (not:V4SF (match_dup 3)) + (match_operand:V4SF 1 "register_operand" "v")))] "TARGET_ALTIVEC" - "vspltisw %2,-1\;vslw %3,%2,%2\;vandc %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) +{ + operands[2] = gen_reg_rtx (V4SFmode); + operands[3] = gen_reg_rtx (V4SFmode); +}) -(define_insn "altivec_abss_" - [(set (match_operand:VI 0 "register_operand" "=v") - (unspec:VI [(match_operand:VI 1 "register_operand" "v")] 210)) - (clobber (match_scratch:VI 2 "=&v")) - (clobber (match_scratch:VI 3 "=&v"))] +;; Generate +;; vspltis? SCRATCH0,0 +;; vsubs?s SCRATCH2,SCRATCH1,%1 +;; vmaxs? %0,%1,SCRATCH2" +(define_expand "altivec_abss_" + [(set (match_dup 2) (vec_duplicate:VI (const_int 0))) + (parallel [(set (match_dup 3) + (unspec:VI [(match_dup 2) + (match_operand:VI 1 "register_operand" "v")] + UNSPEC_SUBS)) + (set (reg:SI 110) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]) + (set (match_operand:VI 0 "register_operand" "=v") + (smax:VI (match_dup 1) (match_dup 3)))] "TARGET_ALTIVEC" - "vspltisb %2,0\;vsubss %3,%2,%1\;vmaxs %0,%1,%3" - [(set_attr "type" "vecsimple") - (set_attr "length" "12")]) +{ + operands[2] = gen_reg_rtx (GET_MODE (operands[0])); + operands[3] = gen_reg_rtx (GET_MODE (operands[0])); +}) (define_insn "vec_realign_load_v4sf" [(set (match_operand:V4SF 0 "register_operand" "=v") diff --git a/gcc/config/rs6000/darwin-fallback.c b/gcc/config/rs6000/darwin-fallback.c index a9ef4a7985e..3083b1fc50a 100644 --- a/gcc/config/rs6000/darwin-fallback.c +++ b/gcc/config/rs6000/darwin-fallback.c @@ -36,9 +36,8 @@ #include "unwind-dw2.h" #include #include +#include #include -#include -#include typedef unsigned long reg_unit; @@ -225,6 +224,11 @@ interpret_libc (reg_unit gprs[32], struct _Unwind_Context *context) } } +/* We used to include and , + but they change so much between different Darwin system versions + that it's much easier to just write the structures involved here + directly. */ + /* These defines are from the kernel's bsd/dev/ppc/unix_signal.c. */ #define UC_TRAD 1 #define UC_TRAD_VEC 6 @@ -237,6 +241,44 @@ interpret_libc (reg_unit gprs[32], struct _Unwind_Context *context) #define UC_DUAL 50 #define UC_DUAL_VEC 55 +struct gcc_ucontext +{ + int onstack; + sigset_t sigmask; + void * stack_sp; + size_t stack_sz; + int stack_flags; + struct gcc_ucontext *link; + size_t mcsize; + struct gcc_mcontext32 *mcontext; +}; + +struct gcc_float_vector_state +{ + double fpregs[32]; + uint32_t fpscr_pad; + uint32_t fpscr; + uint32_t save_vr[32][4]; + uint32_t save_vscr[4]; +}; + +struct gcc_mcontext32 { + uint32_t dar; + uint32_t dsisr; + uint32_t exception; + uint32_t padding1[5]; + uint32_t srr0; + uint32_t srr1; + uint32_t gpr[32]; + uint32_t cr; + uint32_t xer; + uint32_t lr; + uint32_t ctr; + uint32_t mq; + uint32_t vrsave; + struct gcc_float_vector_state fvs; +}; + /* These are based on /usr/include/ppc/ucontext.h and /usr/include/mach/ppc/thread_status.h, but rewritten to be more convenient, to compile on Jaguar, and to work around Radar 3712064 @@ -256,17 +298,16 @@ struct gcc_mcontext64 { uint32_t lr[2]; uint32_t ctr[2]; uint32_t vrsave; - ppc_float_state_t fs; - ppc_vector_state_t vs; + struct gcc_float_vector_state fvs; }; #define UC_FLAVOR_SIZE \ - (sizeof (struct mcontext) - sizeof (ppc_vector_state_t)) + (sizeof (struct gcc_mcontext32) - 33*16) -#define UC_FLAVOR_VEC_SIZE (sizeof (struct mcontext)) +#define UC_FLAVOR_VEC_SIZE (sizeof (struct gcc_mcontext32)) #define UC_FLAVOR64_SIZE \ - (sizeof (struct gcc_mcontext64) - sizeof (ppc_vector_state_t)) + (sizeof (struct gcc_mcontext64) - 33*16) #define UC_FLAVOR64_VEC_SIZE (sizeof (struct gcc_mcontext64)) @@ -278,10 +319,9 @@ static bool handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], _Unwind_Ptr old_cfa) { - ucontext_t *uctx; + struct gcc_ucontext *uctx; bool is_64, is_vector; - ppc_float_state_t *float_state; - ppc_vector_state_t *vector_state; + struct gcc_float_vector_state * float_vector_state; _Unwind_Ptr new_cfa; int i; static _Unwind_Ptr return_addr; @@ -293,16 +333,16 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], if (gprs[0] == 0x67 /* SYS_SIGRETURN */) { - uctx = (ucontext_t *) gprs[3]; - is_vector = (uctx->uc_mcsize == UC_FLAVOR64_VEC_SIZE - || uctx->uc_mcsize == UC_FLAVOR_VEC_SIZE); - is_64 = (uctx->uc_mcsize == UC_FLAVOR64_VEC_SIZE - || uctx->uc_mcsize == UC_FLAVOR64_SIZE); + uctx = (struct gcc_ucontext *) gprs[3]; + is_vector = (uctx->mcsize == UC_FLAVOR64_VEC_SIZE + || uctx->mcsize == UC_FLAVOR_VEC_SIZE); + is_64 = (uctx->mcsize == UC_FLAVOR64_VEC_SIZE + || uctx->mcsize == UC_FLAVOR64_SIZE); } else if (gprs[0] == 0 && gprs[3] == 184) { int ctxstyle = gprs[5]; - uctx = (ucontext_t *) gprs[4]; + uctx = (struct gcc_ucontext *) gprs[4]; is_vector = (ctxstyle == UC_FLAVOR_VEC || ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD_VEC || ctxstyle == UC_TRAD64_VEC); is_64 = (ctxstyle == UC_FLAVOR64_VEC || ctxstyle == UC_TRAD64_VEC @@ -325,11 +365,10 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], /* The context is 64-bit, but it doesn't carry any extra information for us because only the low 32 bits of the registers are call-saved. */ - struct gcc_mcontext64 *m64 = (struct gcc_mcontext64 *)uctx->uc_mcontext; + struct gcc_mcontext64 *m64 = (struct gcc_mcontext64 *)uctx->mcontext; int i; - float_state = &m64->fs; - vector_state = &m64->vs; + float_vector_state = &m64->fvs; new_cfa = m64->gpr[1][1]; @@ -354,33 +393,32 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], } else { - struct mcontext *m = uctx->uc_mcontext; + struct gcc_mcontext32 *m = uctx->mcontext; int i; - float_state = &m->fs; - vector_state = &m->vs; + float_vector_state = &m->fvs; - new_cfa = m->ss.r1; + new_cfa = m->gpr[1]; - set_offset (CR2_REGNO, &m->ss.cr); + set_offset (CR2_REGNO, &m->cr); for (i = 0; i < 32; i++) - set_offset (i, &m->ss.r0 + i); - set_offset (XER_REGNO, &m->ss.xer); - set_offset (LINK_REGISTER_REGNUM, &m->ss.lr); - set_offset (COUNT_REGISTER_REGNUM, &m->ss.ctr); + set_offset (i, m->gpr + i); + set_offset (XER_REGNO, &m->xer); + set_offset (LINK_REGISTER_REGNUM, &m->lr); + set_offset (COUNT_REGISTER_REGNUM, &m->ctr); if (is_vector) - set_offset (VRSAVE_REGNO, &m->ss.vrsave); + set_offset (VRSAVE_REGNO, &m->vrsave); /* Sometimes, srr0 points to the instruction that caused the exception, and sometimes to the next instruction to be executed; we want the latter. */ - if (m->es.exception == 3 || m->es.exception == 4 - || m->es.exception == 6 - || (m->es.exception == 7 && !(m->ss.srr1 & 0x10000))) - return_addr = m->ss.srr0 + 4; + if (m->exception == 3 || m->exception == 4 + || m->exception == 6 + || (m->exception == 7 && !(m->srr1 & 0x10000))) + return_addr = m->srr0 + 4; else - return_addr = m->ss.srr0; + return_addr = m->srr0; } fs->cfa_how = CFA_REG_OFFSET; @@ -399,14 +437,14 @@ handle_syscall (_Unwind_FrameState *fs, const reg_unit gprs[32], set_offset (ARG_POINTER_REGNUM, &return_addr); for (i = 0; i < 32; i++) - set_offset (32 + i, float_state->fpregs + i); - set_offset (SPEFSCR_REGNO, &float_state->fpscr); + set_offset (32 + i, float_vector_state->fpregs + i); + set_offset (SPEFSCR_REGNO, &float_vector_state->fpscr); if (is_vector) { for (i = 0; i < 32; i++) - set_offset (FIRST_ALTIVEC_REGNO + i, vector_state->save_vr + i); - set_offset (VSCR_REGNO, vector_state->save_vscr); + set_offset (FIRST_ALTIVEC_REGNO + i, float_vector_state->save_vr + i); + set_offset (VSCR_REGNO, float_vector_state->save_vscr); } return true; diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 51a52ef026e..3890dea12d8 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -1,5 +1,6 @@ /* Target definitions for PowerPC running Darwin (Mac OS X). - Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. @@ -39,11 +40,8 @@ #undef PTRDIFF_TYPE #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int") -/* Darwin switches. */ -/* Use dynamic-no-pic codegen (no picbase reg; not suitable for shlibs.) */ -#define MASK_MACHO_DYNAMIC_NO_PIC 0x00800000 - -#define TARGET_DYNAMIC_NO_PIC (target_flags & MASK_MACHO_DYNAMIC_NO_PIC) +/* Translate config/rs6000/darwin.opt to config/darwin.h. */ +#define TARGET_DYNAMIC_NO_PIC (TARGET_MACHO_DYNAMIC_NO_PIC) /* Handle #pragma weak and #pragma pack. */ #define HANDLE_SYSV_PRAGMA 1 @@ -62,55 +60,32 @@ while (0) -/* */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "64", MASK_64BIT | MASK_POWERPC64, \ - N_("Generate 64-bit code") }, \ - { "32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Generate 32-bit code") }, \ - {"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, ""}, - - /* The Darwin ABI always includes AltiVec, can't be (validly) turned off. */ #define SUBTARGET_OVERRIDE_OPTIONS \ do { \ rs6000_altivec_abi = 1; \ - rs6000_altivec_vrsave = 1; \ + TARGET_ALTIVEC_VRSAVE = 1; \ if (DEFAULT_ABI == ABI_DARWIN) \ { \ if (MACHO_DYNAMIC_NO_PIC_P) \ { \ if (flag_pic) \ - warning ("-mdynamic-no-pic overrides -fpic or -fPIC"); \ + warning (0, "-mdynamic-no-pic overrides -fpic or -fPIC"); \ flag_pic = 0; \ } \ else if (flag_pic == 1) \ { \ /* Darwin doesn't support -fpic. */ \ - warning ("-fpic is not supported; -fPIC assumed"); \ + warning (0, "-fpic is not supported; -fPIC assumed"); \ flag_pic = 2; \ } \ - \ - /* Handle -mfix-and-continue. */ \ - if (darwin_fix_and_continue_switch) \ - { \ - const char *base = darwin_fix_and_continue_switch; \ - while (base[-1] != 'm') base--; \ - \ - if (*darwin_fix_and_continue_switch != '\0') \ - error ("invalid option %qs", base); \ - darwin_fix_and_continue = (base[0] != 'n'); \ - } \ } \ if (TARGET_64BIT && ! TARGET_POWERPC64) \ { \ target_flags |= MASK_POWERPC64; \ - warning ("-m64 requires PowerPC64 architecture, enabling"); \ + warning (0, "-m64 requires PowerPC64 architecture, enabling"); \ } \ } while(0) @@ -294,6 +269,19 @@ do { \ /* Generate insns to call the profiler. */ +#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN +/* This is supported in cctools 465 and later. The macro test + above prevents using it in earlier build environments. */ +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ + if ((LOG) != 0) \ + { \ + if ((MAX_SKIP) == 0) \ + fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + else \ + fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ + } +#endif + #define PROFILE_HOOK(LABEL) output_profile_hook (LABEL) /* Function name to call to do profiling. */ @@ -391,12 +379,19 @@ do { \ /* 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. */ -extern const char *darwin_one_byte_bool; #define BOOL_TYPE_SIZE (darwin_one_byte_bool ? CHAR_TYPE_SIZE : INT_TYPE_SIZE) #undef REGISTER_TARGET_PRAGMAS #define REGISTER_TARGET_PRAGMAS DARWIN_REGISTER_TARGET_PRAGMAS +/* Just like config/darwin.h's REAL_LIBGCC_SPEC, but use -lgcc_s_ppc64 for + -m64. */ +#undef REAL_LIBGCC_SPEC +#define REAL_LIBGCC_SPEC \ + "%{static|static-libgcc:-lgcc -lgcc_eh; \ + :%{shared-libgcc|Zdynamiclib:%{m64:-lgcc_s_ppc64;:-lgcc_s} -lgcc; \ + :-lgcc -lgcc_eh}}" + #ifdef IN_LIBGCC2 #include #endif @@ -406,9 +401,15 @@ extern const char *darwin_one_byte_bool; #define HAS_MD_FALLBACK_FRAME_STATE_FOR 1 /* True, iff we're generating fast turn around debugging code. When - true, we arrange for function prologues to start with 4 nops so - that gdb may insert code to redirect them, and for data to accessed - indirectly. The runtime uses this indirection to forward + true, we arrange for function prologues to start with 5 nops so + that gdb may insert code to redirect them, and for data to be + accessed indirectly. The runtime uses this indirection to forward references for data to the original instance of that data. */ #define TARGET_FIX_AND_CONTINUE (darwin_fix_and_continue) + +/* This is the reserved direct dispatch address for Objective-C. */ +#define OFFS_MSGSEND_FAST 0xFFFEFF00 + +/* This is the reserved ivar address Objective-C. */ +#define OFFS_ASSIGNIVAR_FAST 0xFFFEFEC0 diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md index a0499c5c7aa..b27e6e86646 100644 --- a/gcc/config/rs6000/darwin.md +++ b/gcc/config/rs6000/darwin.md @@ -63,7 +63,7 @@ Boston, MA 02111-1307, USA. */ } } default: - abort(); + gcc_unreachable (); } }" [(set_attr "type" "load") @@ -84,7 +84,7 @@ Boston, MA 02111-1307, USA. */ case 1: return \"ld %0,lo16(%2)(%1)\"; default: - abort(); + gcc_unreachable (); } }" [(set_attr "type" "load") @@ -342,7 +342,7 @@ Boston, MA 02111-1307, USA. */ #if TARGET_MACHO return output_call(insn, operands, 0, 2); #else - abort(); + gcc_unreachable (); #endif } [(set_attr "type" "branch,branch") @@ -373,7 +373,7 @@ Boston, MA 02111-1307, USA. */ #if TARGET_MACHO return output_call(insn, operands, 1, 3); #else - abort(); + gcc_unreachable (); #endif } [(set_attr "type" "branch,branch") @@ -423,7 +423,7 @@ Boston, MA 02111-1307, USA. */ { case 0: return \"b %z0\"; case 1: return \"b%T0\"; - default: abort(); + default: gcc_unreachable (); } }" [(set_attr "type" "branch") @@ -443,7 +443,7 @@ Boston, MA 02111-1307, USA. */ { case 0: return \"b %z1\"; case 1: return \"b%T1\"; - default: abort(); + default: gcc_unreachable (); } }" [(set_attr "type" "branch") diff --git a/gcc/config/rs6000/darwin.opt b/gcc/config/rs6000/darwin.opt new file mode 100644 index 00000000000..5eeb609e0d2 --- /dev/null +++ b/gcc/config/rs6000/darwin.opt @@ -0,0 +1,33 @@ +; Darwin options for PPC port. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +m64 +Target RejectNegative Mask(64BIT) +Generate 64-bit code + +m32 +Target RejectNegative InverseMask(64BIT) +Generate 32-bit code + +mdynamic-no-pic +Target Report Mask(MACHO_DYNAMIC_NO_PIC) +Generate code suitable for executables (NOT shared libs) diff --git a/gcc/config/rs6000/default64.h b/gcc/config/rs6000/default64.h index c6ed142d69b..a17d872b59c 100644 --- a/gcc/config/rs6000/default64.h +++ b/gcc/config/rs6000/default64.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for 64 bit powerpc linux defaulting to -m64. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -21,4 +21,5 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (MASK_POWERPC | MASK_POWERPC64 | MASK_64BIT | MASK_NEW_MNEMONICS) + (MASK_POWERPC | MASK_PPC_GFXOPT | \ + MASK_POWERPC64 | MASK_64BIT | MASK_NEW_MNEMONICS) diff --git a/gcc/config/rs6000/eabispe.h b/gcc/config/rs6000/eabispe.h index 3abad991b74..54d8ce4f2c7 100644 --- a/gcc/config/rs6000/eabispe.h +++ b/gcc/config/rs6000/eabispe.h @@ -30,16 +30,16 @@ #define SUBSUBTARGET_OVERRIDE_OPTIONS \ if (rs6000_select[1].string == NULL) \ rs6000_cpu = PROCESSOR_PPC8540; \ - if (rs6000_abi_string == NULL) \ + if (!rs6000_explicit_options.abi) \ rs6000_spe_abi = 1; \ - if (rs6000_float_gprs_string == NULL) \ + if (!rs6000_explicit_options.float_gprs) \ rs6000_float_gprs = 1; \ /* See note below. */ \ - /*if (rs6000_long_double_size_string == NULL)*/ \ + /*if (!rs6000_explicit_options.long_double)*/ \ /* rs6000_long_double_type_size = 128;*/ \ - if (rs6000_spe_string == NULL) \ + if (!rs6000_explicit_options.spe) \ rs6000_spe = 1; \ - if (rs6000_isel_string == NULL) \ + if (!rs6000_explicit_options.isel) \ rs6000_isel = 1; \ if (target_flags & MASK_64BIT) \ error ("-m64 not supported in this configuration") diff --git a/gcc/config/rs6000/host-darwin.c b/gcc/config/rs6000/host-darwin.c index 599e30603d6..ca32cffb465 100644 --- a/gcc/config/rs6000/host-darwin.c +++ b/gcc/config/rs6000/host-darwin.c @@ -1,5 +1,5 @@ /* Darwin/powerpc host-specific hook definitions. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -23,11 +23,11 @@ #include "coretypes.h" #include #include -#include #include "hosthooks.h" #include "hosthooks-def.h" #include "toplev.h" #include "diagnostic.h" +#include "config/host-darwin.h" static void segv_crash_handler (int); static void segv_handler (int, siginfo_t *, void *); @@ -107,7 +107,7 @@ segv_handler (int sig ATTRIBUTE_UNUSED, } if (global_dc->abort_on_error) - abort (); + fancy_abort (__FILE__, __LINE__, __FUNCTION__); exit (FATAL_EXIT_CODE); } @@ -137,65 +137,5 @@ darwin_rs6000_extra_signals (void) fatal_error ("While setting up signal handler: %m"); } -#undef HOST_HOOKS_GT_PCH_GET_ADDRESS -#define HOST_HOOKS_GT_PCH_GET_ADDRESS darwin_rs6000_gt_pch_get_address -#undef HOST_HOOKS_GT_PCH_USE_ADDRESS -#define HOST_HOOKS_GT_PCH_USE_ADDRESS darwin_rs6000_gt_pch_use_address - -/* Yes, this is really supposed to work. */ -static char pch_address_space[1024*1024*1024] __attribute__((aligned (4096))); - -/* Return the address of the PCH address space, if the PCH will fit in it. */ - -static void * -darwin_rs6000_gt_pch_get_address (size_t sz, int fd ATTRIBUTE_UNUSED) -{ - if (sz <= sizeof (pch_address_space)) - return pch_address_space; - else - return NULL; -} - -/* Check ADDR and SZ for validity, and deallocate (using munmap) that part of - pch_address_space beyond SZ. */ - -static int -darwin_rs6000_gt_pch_use_address (void *addr, size_t sz, int fd, size_t off) -{ - const size_t pagesize = getpagesize(); - void *mmap_result; - int ret; - - if ((size_t)pch_address_space % pagesize != 0 - || sizeof (pch_address_space) % pagesize != 0) - abort (); - - ret = (addr == pch_address_space && sz <= sizeof (pch_address_space)); - if (! ret) - sz = 0; - - /* Round the size to a whole page size. Normally this is a no-op. */ - sz = (sz + pagesize - 1) / pagesize * pagesize; - - if (munmap (pch_address_space + sz, sizeof (pch_address_space) - sz) != 0) - fatal_error ("couldn't unmap pch_address_space: %m\n"); - - if (ret) - { - mmap_result = mmap (addr, sz, - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, - fd, off); - - /* The file might not be mmap-able. */ - ret = mmap_result != (void *) MAP_FAILED; - - /* Sanity check for broken MAP_FIXED. */ - if (ret && mmap_result != addr) - abort (); - } - - return ret; -} - const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index 2cfabb636d3..d2ab9bf65ae 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for 64 bit PowerPC linux. - Copyright (C) 2000, 2001, 2002, 2003, 2004 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -78,7 +78,7 @@ extern int dot_symbols; #define SUBSUBTARGET_OVERRIDE_OPTIONS \ do \ { \ - if (rs6000_alignment_string == 0) \ + if (!rs6000_explicit_options.alignment) \ rs6000_alignment_flags = MASK_ALIGN_NATURAL; \ if (TARGET_64BIT) \ { \ @@ -206,22 +206,6 @@ extern int dot_symbols; #endif -#define MASK_PROFILE_KERNEL 0x00100000 - -/* Non-standard profiling for kernels, which just saves LR then calls - _mcount without worrying about arg saves. The idea is to change - the function prologue as little as possible as it isn't easy to - account for arg save/restore code added just for _mcount. */ -#define TARGET_PROFILE_KERNEL (target_flags & MASK_PROFILE_KERNEL) - -/* Override sysv4.h. */ -#undef EXTRA_SUBTARGET_SWITCHES -#define EXTRA_SUBTARGET_SWITCHES \ - {"profile-kernel", MASK_PROFILE_KERNEL, \ - N_("Call mcount for profiling before a function prologue") }, \ - {"no-profile-kernel", -MASK_PROFILE_KERNEL, \ - N_("Call mcount for profiling after a function prologue") }, - /* We use glibc _mcount for profiling. */ #define NO_PROFILE_COUNTERS TARGET_64BIT #define PROFILE_HOOK(LABEL) \ @@ -552,7 +536,7 @@ while (0) #undef DRAFT_V4_STRUCT_RET #define DRAFT_V4_STRUCT_RET (!TARGET_64BIT) -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack +#define TARGET_ASM_FILE_END rs6000_elf_end_indicate_exec_stack #define TARGET_HAS_F_SETLKW diff --git a/gcc/config/rs6000/linux64.opt b/gcc/config/rs6000/linux64.opt new file mode 100644 index 00000000000..6028b325fc7 --- /dev/null +++ b/gcc/config/rs6000/linux64.opt @@ -0,0 +1,25 @@ +; Options for 64-bit PowerPC Linux. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +mprofile-kernel +Target Report Mask(PROFILE_KERNEL) +Call mcount for profiling before a function prologue diff --git a/gcc/config/rs6000/lynx.h b/gcc/config/rs6000/lynx.h index fb02f517d6f..fa4cc773f5c 100644 --- a/gcc/config/rs6000/lynx.h +++ b/gcc/config/rs6000/lynx.h @@ -89,9 +89,6 @@ #undef ASM_APP_OFF #define ASM_APP_OFF "#NO_APP\n" -#undef EXTRA_SUBTARGET_SWITCHES -#define EXTRA_SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES - /* LynxOS does not do anything with .fixup plus let's not create writable section for linkonce.r and linkonce.t. */ diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 110898fcec6..570f59d3f0c 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -34,9 +34,10 @@ ;; Return 1 if op is an Altivec register. (define_predicate "altivec_register_operand" - (and (match_code "reg") - (match_test "ALTIVEC_REGNO_P (REGNO (op)) - || REGNO (op) > LAST_VIRTUAL_REGISTER"))) + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || ALTIVEC_REGNO_P (REGNO (op)) + || REGNO (op) > LAST_VIRTUAL_REGISTER"))) ;; Return 1 if op is XER register. (define_predicate "xer_operand" @@ -72,28 +73,25 @@ ;; Return 1 if op is a register that is not special. (define_predicate "gpc_reg_operand" - (and (match_code "reg,subreg") - (and (match_operand 0 "register_operand") - (match_test "GET_CODE (op) != REG - || (REGNO (op) >= ARG_POINTER_REGNUM - && !XER_REGNO_P (REGNO (op))) - || REGNO (op) < MQ_REGNO")))) + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || (REGNO (op) >= ARG_POINTER_REGNUM + && !XER_REGNO_P (REGNO (op))) + || REGNO (op) < MQ_REGNO"))) ;; Return 1 if op is a register that is a condition register field. (define_predicate "cc_reg_operand" - (and (match_code "reg,subreg") - (and (match_operand 0 "register_operand") - (match_test "GET_CODE (op) != REG - || REGNO (op) > LAST_VIRTUAL_REGISTER - || CR_REGNO_P (REGNO (op))")))) + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || REGNO (op) > LAST_VIRTUAL_REGISTER + || CR_REGNO_P (REGNO (op))"))) ;; Return 1 if op is a register that is a condition register field not cr0. (define_predicate "cc_reg_not_cr0_operand" - (and (match_code "reg,subreg") - (and (match_operand 0 "register_operand") - (match_test "GET_CODE (op) != REG - || REGNO (op) > LAST_VIRTUAL_REGISTER - || CR_REGNO_NOT_CR0_P (REGNO (op))")))) + (and (match_operand 0 "register_operand") + (match_test "GET_CODE (op) != REG + || REGNO (op) > LAST_VIRTUAL_REGISTER + || CR_REGNO_NOT_CR0_P (REGNO (op))"))) ;; Return 1 if op is a constant integer valid for D field ;; or non-special register register. @@ -180,6 +178,9 @@ (define_predicate "easy_fp_constant" (match_code "const_double") { + long k[4]; + REAL_VALUE_TYPE rv; + if (GET_MODE (op) != mode || (GET_MODE_CLASS (mode) != MODE_FLOAT && mode != DImode)) return 0; @@ -200,11 +201,9 @@ return 0; #endif - if (mode == TFmode) + switch (mode) { - long k[4]; - REAL_VALUE_TYPE rv; - + case TFmode: REAL_VALUE_FROM_CONST_DOUBLE (rv, op); REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k); @@ -212,43 +211,50 @@ && num_insns_constant_wide ((HOST_WIDE_INT) k[1]) == 1 && num_insns_constant_wide ((HOST_WIDE_INT) k[2]) == 1 && num_insns_constant_wide ((HOST_WIDE_INT) k[3]) == 1); - } - else if (mode == DFmode) - { - long k[2]; - REAL_VALUE_TYPE rv; - - if (TARGET_E500_DOUBLE) - return 0; + case DFmode: + /* Force constants to memory before reload to utilize + compress_float_constant. + Avoid this when flag_unsafe_math_optimizations is enabled + because RDIV division to reciprocal optimization is not able + to regenerate the division. */ + if (TARGET_E500_DOUBLE + || (!reload_in_progress && !reload_completed + && !flag_unsafe_math_optimizations)) + return 0; REAL_VALUE_FROM_CONST_DOUBLE (rv, op); REAL_VALUE_TO_TARGET_DOUBLE (rv, k); return (num_insns_constant_wide ((HOST_WIDE_INT) k[0]) == 1 && num_insns_constant_wide ((HOST_WIDE_INT) k[1]) == 1); - } - else if (mode == SFmode) - { - long l; - REAL_VALUE_TYPE rv; + case SFmode: + /* Force constants to memory before reload to utilize + compress_float_constant. + Avoid this when flag_unsafe_math_optimizations is enabled + because RDIV division to reciprocal optimization is not able + to regenerate the division. */ + if (!reload_in_progress && !reload_completed + && !flag_unsafe_math_optimizations) + return 0; REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); + REAL_VALUE_TO_TARGET_SINGLE (rv, k[0]); - return num_insns_constant_wide (l) == 1; - } + return num_insns_constant_wide (k[0]) == 1; - else if (mode == DImode) + case DImode: return ((TARGET_POWERPC64 && GET_CODE (op) == CONST_DOUBLE && CONST_DOUBLE_LOW (op) == 0) || (num_insns_constant (op, DImode) <= 2)); - else if (mode == SImode) + case SImode: return 1; - else - abort (); + + default: + gcc_unreachable (); + } }) ;; Return 1 if the operand is a CONST_VECTOR and can be loaded into a @@ -325,7 +331,7 @@ ;; Return 1 if the operand is in volatile memory. Note that during the ;; RTL generation phase, memory_operand does not return TRUE for volatile ;; memory references. So this function allows us to recognize volatile -;; references where its safe. +;; references where it's safe. (define_predicate "volatile_mem_operand" (and (and (match_code "mem") (match_test "MEM_VOLATILE_P (op)")) @@ -342,6 +348,31 @@ || reload_in_progress, mode, XEXP (op, 0))"))) +;; Return 1 if the operand is an indexed or indirect memory operand. +(define_predicate "indexed_or_indirect_operand" + (and (match_operand 0 "memory_operand") + (match_test "REG_P (XEXP (op, 0)) + || (GET_CODE (XEXP (op, 0)) == PLUS + && REG_P (XEXP (XEXP (op, 0), 0)) + && REG_P (XEXP (XEXP (op, 0), 1)))"))) + +;; Return 1 if the operand is a memory operand with an address divisible by 4 +(define_predicate "word_offset_memref_operand" + (and (match_operand 0 "memory_operand") + (match_test "GET_CODE (XEXP (op, 0)) != PLUS + || ! REG_P (XEXP (XEXP (op, 0), 0)) + || GET_CODE (XEXP (XEXP (op, 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (op, 0), 1)) % 4 == 0"))) + +;; Used for the destination of the fix_truncdfsi2 expander. +;; If stfiwx will be used, the result goes to memory; otherwise, +;; we're going to emit a store and a load of a subreg, so the dest is a +;; register. +(define_predicate "fix_trunc_dest_operand" + (if_then_else (match_test "! TARGET_E500_DOUBLE && TARGET_PPC_GFXOPT") + (match_operand 0 "memory_operand") + (match_operand 0 "gpc_reg_operand"))) + ;; Return 1 if the operand is either a non-special register or can be used ;; as the operand of a `mode' add insn. (define_predicate "add_operand" @@ -376,8 +407,7 @@ } else if (GET_CODE (op) == CONST_DOUBLE) { - if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT) - abort (); + gcc_assert (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT); opl = CONST_DOUBLE_LOW (op); oph = CONST_DOUBLE_HIGH (op); @@ -499,29 +529,27 @@ ;; Return 1 if the operand is either a non-special register or a constant ;; that can be used as the operand of a PowerPC64 logical AND insn. (define_predicate "and64_operand" - (if_then_else (match_code "const_int") - (match_operand 0 "mask64_operand") - (if_then_else (match_test "fixed_regs[CR0_REGNO]") - (match_operand 0 "gpc_reg_operand") - (match_operand 0 "logical_operand")))) + (ior (match_operand 0 "mask64_operand") + (if_then_else (match_test "fixed_regs[CR0_REGNO]") + (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_operand")))) ;; Like and64_operand, but also match constants that can be implemented ;; with two rldicl or rldicr insns. (define_predicate "and64_2_operand" - (if_then_else (match_code "const_int") - (match_test "mask64_1or2_operand (op, mode, true)") - (if_then_else (match_test "fixed_regs[CR0_REGNO]") - (match_operand 0 "gpc_reg_operand") - (match_operand 0 "logical_operand")))) + (ior (and (match_code "const_int") + (match_test "mask64_1or2_operand (op, mode, true)")) + (if_then_else (match_test "fixed_regs[CR0_REGNO]") + (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_operand")))) ;; Return 1 if the operand is either a non-special register or a ;; constant that can be used as the operand of a logical AND. (define_predicate "and_operand" - (if_then_else (match_code "const_int") - (match_operand 0 "mask_operand") - (if_then_else (match_test "fixed_regs[CR0_REGNO]") - (match_operand 0 "gpc_reg_operand") - (match_operand 0 "logical_operand")))) + (ior (match_operand 0 "mask_operand") + (if_then_else (match_test "fixed_regs[CR0_REGNO]") + (match_operand 0 "gpc_reg_operand") + (match_operand 0 "logical_operand")))) ;; Return 1 if the operand is a general non-special register or memory operand. (define_predicate "reg_or_mem_operand" @@ -577,7 +605,7 @@ (match_code "symbol_ref,const,label_ref")) ;; Return 1 if op is a simple reference that can be loaded via the GOT, -;; exclusing labels involving addition. +;; excluding labels involving addition. (define_predicate "got_no_const_operand" (match_code "symbol_ref,label_ref")) diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index 5d36d5d28b3..50c994104ee 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -1,8 +1,9 @@ /* Subroutines for the C front end on the POWER and PowerPC architectures. - Copyright (C) 2002, 2003, 2004 + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Zack Weinberg + and Paolo Bonzini This file is part of GCC. @@ -27,9 +28,17 @@ #include "tm.h" #include "cpplib.h" #include "tree.h" +#include "c-common.h" #include "c-pragma.h" +#include "c-tree.h" #include "errors.h" #include "tm_p.h" +#include "target.h" +#include "langhooks.h" + + + +static tree altivec_resolve_overloaded_builtin (tree, tree); /* Handle the machine specific pragma longcall. Its syntax is @@ -42,8 +51,8 @@ attribute by default. */ #define SYNTAX_ERROR(msgid) do { \ - warning (msgid); \ - warning ("ignoring malformed #pragma longcall"); \ + warning (0, msgid); \ + warning (0, "ignoring malformed #pragma longcall"); \ return; \ } while (0) @@ -66,7 +75,7 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED) SYNTAX_ERROR ("number must be 0 or 1"); if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma longcall"); + warning (0, "junk at end of #pragma longcall"); rs6000_default_long_calls = (n == integer_one_node); } @@ -130,4 +139,2428 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile) default: break; } + + targetm.resolve_overloaded_builtin = altivec_resolve_overloaded_builtin; +} + + +struct altivec_builtin_types +{ + enum rs6000_builtins code; + enum rs6000_builtins overloaded_code; + signed char ret_type; + signed char op1; + signed char op2; + signed char op3; +}; + +const struct altivec_builtin_types altivec_overloaded_builtins[] = { + /* Unary AltiVec builtins. */ + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABS, ALTIVEC_BUILTIN_ABS_V4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABSS, ALTIVEC_BUILTIN_ABSS_V16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABSS, ALTIVEC_BUILTIN_ABSS_V8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ABSS, ALTIVEC_BUILTIN_ABSS_V4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_CEIL, ALTIVEC_BUILTIN_VRFIP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_EXPTE, ALTIVEC_BUILTIN_VEXPTEFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_FLOOR, ALTIVEC_BUILTIN_VRFIM, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_LOGE, ALTIVEC_BUILTIN_VLOGEFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_MTVSCR, ALTIVEC_BUILTIN_MTVSCR, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_RE, ALTIVEC_BUILTIN_VREFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_ROUND, ALTIVEC_BUILTIN_VRFIN, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_RSQRTE, ALTIVEC_BUILTIN_VRSQRTEFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_TRUNC, ALTIVEC_BUILTIN_VRFIZ, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKH, ALTIVEC_BUILTIN_VUPKHPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSH, ALTIVEC_BUILTIN_VUPKHSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHPX, ALTIVEC_BUILTIN_VUPKHPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHPX, ALTIVEC_BUILTIN_VUPKHPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSB, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKHSB, ALTIVEC_BUILTIN_VUPKHSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_UNPACKL, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLPX, ALTIVEC_BUILTIN_VUPKLPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLPX, ALTIVEC_BUILTIN_VUPKLPX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_pixel_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSH, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSH, ALTIVEC_BUILTIN_VUPKLSH, + RS6000_BTI_V4SI, RS6000_BTI_bool_V8HI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSB, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0, 0 }, + { ALTIVEC_BUILTIN_VEC_VUPKLSB, ALTIVEC_BUILTIN_VUPKLSB, + RS6000_BTI_V8HI, RS6000_BTI_bool_V16QI, 0, 0 }, + + /* Binary AltiVec builtins. */ + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADD, ALTIVEC_BUILTIN_VADDFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDFP, ALTIVEC_BUILTIN_VADDFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWM, ALTIVEC_BUILTIN_VADDUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHM, ALTIVEC_BUILTIN_VADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBM, ALTIVEC_BUILTIN_VADDUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDC, ALTIVEC_BUILTIN_VADDCUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ADDS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSWS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSWS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSWS, ALTIVEC_BUILTIN_VADDSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUWS, ALTIVEC_BUILTIN_VADDUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSHS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSHS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSHS, ALTIVEC_BUILTIN_VADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUHS, ALTIVEC_BUILTIN_VADDUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSBS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSBS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDSBS, ALTIVEC_BUILTIN_VADDSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VADDUBS, ALTIVEC_BUILTIN_VADDUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AND, ALTIVEC_BUILTIN_VAND, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_ANDC, ALTIVEC_BUILTIN_VANDC, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_AVG, ALTIVEC_BUILTIN_VAVGSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGSW, ALTIVEC_BUILTIN_VAVGSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGUW, ALTIVEC_BUILTIN_VAVGUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGSH, ALTIVEC_BUILTIN_VAVGSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGUH, ALTIVEC_BUILTIN_VAVGUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGSB, ALTIVEC_BUILTIN_VAVGSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VAVGUB, ALTIVEC_BUILTIN_VAVGUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPB, ALTIVEC_BUILTIN_VCMPBFP, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPEQ, ALTIVEC_BUILTIN_VCMPEQFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQFP, ALTIVEC_BUILTIN_VCMPEQFP, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUW, ALTIVEC_BUILTIN_VCMPEQUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUH, ALTIVEC_BUILTIN_VCMPEQUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPEQUB, ALTIVEC_BUILTIN_VCMPEQUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGE, ALTIVEC_BUILTIN_VCMPGEFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPGT, ALTIVEC_BUILTIN_VCMPGTFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTFP, ALTIVEC_BUILTIN_VCMPGTFP, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSW, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSW, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUW, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUW, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSH, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSH, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUH, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUH, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSB, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTSB, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUB, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCMPGTUB, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLE, ALTIVEC_BUILTIN_VCMPGEFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTUB, + RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTSB, + RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTUH, + RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTSH, + RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTUW, + RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTSW, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_CMPLT, ALTIVEC_BUILTIN_VCMPGTFP, + RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_CTF, ALTIVEC_BUILTIN_VCFUX, + RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_CTF, ALTIVEC_BUILTIN_VCFSX, + RS6000_BTI_V4SF, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCFSX, ALTIVEC_BUILTIN_VCFSX, + RS6000_BTI_V4SF, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VCFUX, ALTIVEC_BUILTIN_VCFUX, + RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_CTS, ALTIVEC_BUILTIN_VCTSXS, + RS6000_BTI_V4SI, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_CTU, ALTIVEC_BUILTIN_VCTUXS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LD, ALTIVEC_BUILTIN_LVX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LDE, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEWX, ALTIVEC_BUILTIN_LVEWX, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEHX, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEHX, ALTIVEC_BUILTIN_LVEHX, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEBX, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVEBX, ALTIVEC_BUILTIN_LVEBX, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, + { ALTIVEC_BUILTIN_VEC_LVSR, ALTIVEC_BUILTIN_LVSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MAX, ALTIVEC_BUILTIN_VMAXFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXFP, ALTIVEC_BUILTIN_VMAXFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSW, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSW, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSW, ALTIVEC_BUILTIN_VMAXSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUW, ALTIVEC_BUILTIN_VMAXUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSH, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSH, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSH, ALTIVEC_BUILTIN_VMAXSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUH, ALTIVEC_BUILTIN_VMAXUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSB, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSB, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXSB, ALTIVEC_BUILTIN_VMAXSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMAXUB, ALTIVEC_BUILTIN_VMAXUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEH, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHW, ALTIVEC_BUILTIN_VMRGHW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHH, ALTIVEC_BUILTIN_VMRGHH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHB, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHB, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGHB, ALTIVEC_BUILTIN_VMRGHB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MERGEL, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLW, ALTIVEC_BUILTIN_VMRGLW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLH, ALTIVEC_BUILTIN_VMRGLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLB, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLB, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMRGLB, ALTIVEC_BUILTIN_VMRGLB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_MIN, ALTIVEC_BUILTIN_VMINFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINFP, ALTIVEC_BUILTIN_VMINFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSW, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSW, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSW, ALTIVEC_BUILTIN_VMINSW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUW, ALTIVEC_BUILTIN_VMINUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSH, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSH, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSH, ALTIVEC_BUILTIN_VMINSH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSB, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSB, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINSB, ALTIVEC_BUILTIN_VMINSB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUH, ALTIVEC_BUILTIN_VMINUH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMINUB, ALTIVEC_BUILTIN_VMINUB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULEUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULESB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULEUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULE, ALTIVEC_BUILTIN_VMULESH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULEUB, ALTIVEC_BUILTIN_VMULEUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULESB, ALTIVEC_BUILTIN_VMULESB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULEUH, ALTIVEC_BUILTIN_VMULEUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULESH, ALTIVEC_BUILTIN_VMULESH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_MULO, ALTIVEC_BUILTIN_VMULOSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOSH, ALTIVEC_BUILTIN_VMULOSH, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOUH, ALTIVEC_BUILTIN_VMULOUH, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOSB, ALTIVEC_BUILTIN_VMULOSB, + RS6000_BTI_V8HI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VMULOUB, ALTIVEC_BUILTIN_VMULOUB, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_NOR, ALTIVEC_BUILTIN_VNOR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_OR, ALTIVEC_BUILTIN_VOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACK, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUM, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUM, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUM, ALTIVEC_BUILTIN_VPKUWUM, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUM, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUM, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUM, ALTIVEC_BUILTIN_VPKUHUM, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKPX, ALTIVEC_BUILTIN_VPKPX, + RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKUHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKSHSS, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKUWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKS, ALTIVEC_BUILTIN_VPKSWSS, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSWSS, ALTIVEC_BUILTIN_VPKSWSS, + RS6000_BTI_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUWUS, ALTIVEC_BUILTIN_VPKUWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSHSS, ALTIVEC_BUILTIN_VPKSHSS, + RS6000_BTI_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKUHUS, ALTIVEC_BUILTIN_VPKUHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKUHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKSHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKUWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_PACKSU, ALTIVEC_BUILTIN_VPKSWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSWUS, ALTIVEC_BUILTIN_VPKSWUS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VPKSHUS, ALTIVEC_BUILTIN_VPKSHUS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_RL, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLW, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLW, ALTIVEC_BUILTIN_VRLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLH, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLH, ALTIVEC_BUILTIN_VRLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLB, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VRLB, ALTIVEC_BUILTIN_VRLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SL, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLW, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLW, ALTIVEC_BUILTIN_VSLW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLH, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLH, ALTIVEC_BUILTIN_VSLH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLB, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSLB, ALTIVEC_BUILTIN_VSLB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLL, ALTIVEC_BUILTIN_VSL, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SLO, ALTIVEC_BUILTIN_VSLO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SPLAT, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTW, ALTIVEC_BUILTIN_VSPLTW, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTH, ALTIVEC_BUILTIN_VSPLTH, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTB, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTB, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSPLTB, ALTIVEC_BUILTIN_VSPLTB, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SR, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRW, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRW, ALTIVEC_BUILTIN_VSRW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRH, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRH, ALTIVEC_BUILTIN_VSRH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRB, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRB, ALTIVEC_BUILTIN_VSRB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRA, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAW, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAW, ALTIVEC_BUILTIN_VSRAW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAH, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAH, ALTIVEC_BUILTIN_VSRAH, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAB, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSRAB, ALTIVEC_BUILTIN_VSRAB, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRL, ALTIVEC_BUILTIN_VSR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SRO, ALTIVEC_BUILTIN_VSRO, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUB, ALTIVEC_BUILTIN_VSUBFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBFP, ALTIVEC_BUILTIN_VSUBFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWM, ALTIVEC_BUILTIN_VSUBUWM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHM, ALTIVEC_BUILTIN_VSUBUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBM, ALTIVEC_BUILTIN_VSUBUBM, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBC, ALTIVEC_BUILTIN_VSUBCUW, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUBS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSWS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSWS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSWS, ALTIVEC_BUILTIN_VSUBSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUWS, ALTIVEC_BUILTIN_VSUBUWS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSHS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSHS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSHS, ALTIVEC_BUILTIN_VSUBSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUHS, ALTIVEC_BUILTIN_VSUBUHS, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBSBS, ALTIVEC_BUILTIN_VSUBSBS, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUBUBS, ALTIVEC_BUILTIN_VSUBUBS, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM4S, ALTIVEC_BUILTIN_VSUM4UBS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM4S, ALTIVEC_BUILTIN_VSUM4SBS, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM4S, ALTIVEC_BUILTIN_VSUM4SHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUM4SHS, ALTIVEC_BUILTIN_VSUM4SHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUM4SBS, ALTIVEC_BUILTIN_VSUM4SBS, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_VSUM4UBS, ALTIVEC_BUILTIN_VSUM4UBS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUM2S, ALTIVEC_BUILTIN_VSUM2SWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_SUMS, ALTIVEC_BUILTIN_VSUMSWS, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SF, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI, 0 }, + { ALTIVEC_BUILTIN_VEC_XOR, ALTIVEC_BUILTIN_VXOR, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, 0 }, + + /* Ternary AltiVec builtins. */ + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DST, ALTIVEC_BUILTIN_DST, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTST, ALTIVEC_BUILTIN_DSTST, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTSTT, ALTIVEC_BUILTIN_DSTSTT, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_V4SF, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_INTQI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_INTHI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_UINTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_unsigned_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_long, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_DSTT, ALTIVEC_BUILTIN_DSTT, + RS6000_BTI_void, ~RS6000_BTI_float, RS6000_BTI_INTSI, RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_MADD, ALTIVEC_BUILTIN_VMADDFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_MADDS, ALTIVEC_BUILTIN_VMHADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MLADD, ALTIVEC_BUILTIN_VMLADDUHM, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_MRADDS, ALTIVEC_BUILTIN_VMHRADDSHS, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMUBM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMMBM, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMUHM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUM, ALTIVEC_BUILTIN_VMSUMSHM, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMSHM, ALTIVEC_BUILTIN_VMSUMSHM, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMUHM, ALTIVEC_BUILTIN_VMSUMUHM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMMBM, ALTIVEC_BUILTIN_VMSUMMBM, + RS6000_BTI_V4SI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMUBM, ALTIVEC_BUILTIN_VMSUMUBM, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUMS, ALTIVEC_BUILTIN_VMSUMUHS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_MSUMS, ALTIVEC_BUILTIN_VMSUMSHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMSHS, ALTIVEC_BUILTIN_VMSUMSHS, + RS6000_BTI_V4SI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_VMSUMUHS, ALTIVEC_BUILTIN_VMSUMUHS, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_NMSUB, ALTIVEC_BUILTIN_VNMSUBFP, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_8HI, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_PERM, ALTIVEC_BUILTIN_VPERM_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_SEL, ALTIVEC_BUILTIN_VSEL_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SF, + RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_V4SF, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SI, + RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_V4SI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SI, + RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_4SI, + RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_8HI, + RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI, + RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_V16QI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI, + RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_SLD, ALTIVEC_BUILTIN_VSLDOI_16QI, + RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI, RS6000_BTI_NOT_OPAQUE }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_ST, ALTIVEC_BUILTIN_STVX, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STE, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEWX, ALTIVEC_BUILTIN_STVEWX, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEHX, ALTIVEC_BUILTIN_STVEHX, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STVEBX, ALTIVEC_BUILTIN_STVEBX, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_void }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI }, + { ALTIVEC_BUILTIN_VEC_STL, ALTIVEC_BUILTIN_STVXL, + RS6000_BTI_void, RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI }, + + /* Predicates. */ + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGT_P, ALTIVEC_BUILTIN_VCMPGTFP_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + + + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_pixel_V8HI, RS6000_BTI_pixel_V8HI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPEQ_P, ALTIVEC_BUILTIN_VCMPEQFP_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + + + /* cmpge is the same as cmpgt for all cases except floating point. + There is further code to deal with this special case in + altivec_build_resolved_builtin. */ + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V16QI, RS6000_BTI_unsigned_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_bool_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSB_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V16QI, RS6000_BTI_V16QI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V8HI, RS6000_BTI_unsigned_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V8HI, RS6000_BTI_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSH_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V8HI, RS6000_BTI_bool_V8HI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTUW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_unsigned_V4SI, RS6000_BTI_unsigned_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_bool_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_bool_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGTSW_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SI, RS6000_BTI_V4SI }, + { ALTIVEC_BUILTIN_VCMPGE_P, ALTIVEC_BUILTIN_VCMPGEFP_P, + RS6000_BTI_INTSI, RS6000_BTI_INTSI, RS6000_BTI_V4SF, RS6000_BTI_V4SF }, + + { 0, 0, 0, 0, 0, 0 } +}; + + +/* Convert a type stored into a struct altivec_builtin_types as ID, + into a tree. The types are in rs6000_builtin_types: negative values + create a pointer type for the type associated to ~ID. Note it is + a logical NOT, rather than a negation, otherwise you cannot represent + a pointer type for ID 0. */ + +static inline tree +rs6000_builtin_type (int id) +{ + tree t; + t = rs6000_builtin_types[id < 0 ? ~id : id]; + return id < 0 ? build_pointer_type (t) : t; +} + +/* Check whether the type of an argument, T, is compatible with a + type ID stored into a struct altivec_builtin_types. Integer + types are considered compatible; otherwise, the language hook + lang_hooks.types_compatible_p makes the decision. */ + +static inline bool +rs6000_builtin_type_compatible (tree t, int id) +{ + tree builtin_type; + builtin_type = rs6000_builtin_type (id); + if (INTEGRAL_TYPE_P (t) && INTEGRAL_TYPE_P (builtin_type)) + return true; + else + return lang_hooks.types_compatible_p (t, builtin_type); +} + + +/* Build a tree for a function call to an Altivec non-overloaded builtin. + The overloaded builtin that matched the types and args is described + by DESC. The N arguments are given in ARGS, respectively. + + Actually the only thing it does is calling fold_convert on ARGS, with + a small exception for vec_{all,any}_{ge,le} predicates. */ + +static tree +altivec_build_resolved_builtin (tree *args, int n, + const struct altivec_builtin_types *desc) +{ + tree impl_fndecl = rs6000_builtin_decls[desc->overloaded_code]; + tree ret_type = rs6000_builtin_type (desc->ret_type); + tree argtypes = TYPE_ARG_TYPES (TREE_TYPE (impl_fndecl)); + tree arglist = NULL_TREE, arg_type[3]; + + int i; + for (i = 0; i < n; i++) + arg_type[i] = TREE_VALUE (argtypes), argtypes = TREE_CHAIN (argtypes); + + /* The AltiVec overloading implementation is overall gross, but this + is particularly disgusting. The vec_{all,any}_{ge,le} builtins + are completely different for floating-point vs. integer vector + types, because the former has vcmpgefp, but the latter should use + vcmpgtXX. + + In practice, the second and third arguments are swapped, and the + condition (LT vs. EQ, which is recognizable by bit 1 of the first + argument) is reversed. Patch the arguments here before building + the resolved CALL_EXPR. */ + if (desc->code == ALTIVEC_BUILTIN_VCMPGE_P + && desc->overloaded_code != ALTIVEC_BUILTIN_VCMPGEFP_P) + { + tree t; + t = args[2], args[2] = args[1], args[1] = t; + t = arg_type[2], arg_type[2] = arg_type[1], arg_type[1] = t; + + args[0] = fold_build2 (BIT_XOR_EXPR, TREE_TYPE (args[0]), args[0], + build_int_cst (NULL_TREE, 2)); + } + + while (--n >= 0) + arglist = tree_cons (NULL_TREE, + fold_convert (arg_type[n], args[n]), + arglist); + + return fold_convert (ret_type, + build_function_call_expr (impl_fndecl, arglist)); +} + +/* Implementation of the resolve_overloaded_builtin target hook, to + support Altivec's overloaded builtins. */ + +static tree +altivec_resolve_overloaded_builtin (tree fndecl, tree arglist) +{ + unsigned int fcode = DECL_FUNCTION_CODE (fndecl); + tree fnargs = TYPE_ARG_TYPES (TREE_TYPE (fndecl)); + tree types[3], args[3]; + const struct altivec_builtin_types *desc; + int n; + + if (fcode < ALTIVEC_BUILTIN_OVERLOADED_FIRST + || fcode > ALTIVEC_BUILTIN_OVERLOADED_LAST) + return NULL_TREE; + + for (n = 0; + !VOID_TYPE_P (TREE_VALUE (fnargs)) && arglist; + fnargs = TREE_CHAIN (fnargs), arglist = TREE_CHAIN (arglist), n++) + { + tree decl_type = TREE_VALUE (fnargs); + tree arg = TREE_VALUE (arglist); + tree type; + + if (arg == error_mark_node) + return error_mark_node; + + if (n >= 3) + abort (); + + arg = default_conversion (arg); + + /* The C++ front-end converts float * to const void * using + NOP_EXPR (NOP_EXPR (x)). */ + type = TREE_TYPE (arg); + if (POINTER_TYPE_P (type) + && TREE_CODE (arg) == NOP_EXPR + && lang_hooks.types_compatible_p (TREE_TYPE (arg), + const_ptr_type_node) + && lang_hooks.types_compatible_p (TREE_TYPE (TREE_OPERAND (arg, 0)), + ptr_type_node)) + { + arg = TREE_OPERAND (arg, 0); + type = TREE_TYPE (arg); + } + + /* Remove the const from the pointers to simplify the overload + matching further down. */ + if (POINTER_TYPE_P (decl_type) + && POINTER_TYPE_P (type) + && TYPE_QUALS (TREE_TYPE (type)) != 0) + { + if (TYPE_READONLY (TREE_TYPE (type)) + && !TYPE_READONLY (TREE_TYPE (decl_type))) + warning (0, "passing arg %d of %qE discards qualifiers from" + "pointer target type", n + 1, fndecl); + type = build_pointer_type (build_qualified_type (TREE_TYPE (type), + 0)); + arg = fold_convert (type, arg); + } + + args[n] = arg; + types[n] = type; + } + + /* If the number of arguments did not match the prototype, return NULL + and the generic code will issue the appropriate error message. */ + if (!VOID_TYPE_P (TREE_VALUE (fnargs)) || arglist) + return NULL; + + if (n == 0) + abort (); + + if (fcode == ALTIVEC_BUILTIN_VEC_STEP) + { + if (TREE_CODE (types[0]) != VECTOR_TYPE) + goto bad; + + return build_int_cst (NULL_TREE, TYPE_VECTOR_SUBPARTS (types[0])); + } + + for (desc = altivec_overloaded_builtins; + desc->code && desc->code != fcode; desc++) + continue; + + /* For arguments after the last, we have RS6000_BTI_NOT_OPAQUE in + the opX fields. */ + for (; desc->code == fcode; desc++) + if ((desc->op1 == RS6000_BTI_NOT_OPAQUE + || rs6000_builtin_type_compatible (types[0], desc->op1)) + && (desc->op2 == RS6000_BTI_NOT_OPAQUE + || rs6000_builtin_type_compatible (types[1], desc->op2)) + && (desc->op3 == RS6000_BTI_NOT_OPAQUE + || rs6000_builtin_type_compatible (types[2], desc->op3))) + return altivec_build_resolved_builtin (args, n, desc); + + bad: + error ("invalid parameter combination for AltiVec intrinsic"); + return error_mark_node; } + diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h index 018de14ec2d..63ffe4fb9fc 100644 --- a/gcc/config/rs6000/rs6000-protos.h +++ b/gcc/config/rs6000/rs6000-protos.h @@ -48,7 +48,6 @@ extern bool rs6000_legitimate_offset_address_p (enum machine_mode, rtx, int); extern rtx rs6000_got_register (rtx); extern rtx find_addr_reg (rtx); -extern int word_offset_memref_operand (rtx, enum machine_mode); extern rtx gen_easy_vector_constant_add_self (rtx); extern const char *output_vec_const_move (rtx *); extern void build_mask64_2_operands (rtx, rtx *); @@ -81,6 +80,8 @@ extern rtx rs6000_emit_set_const (rtx, enum machine_mode, rtx, int); extern int rs6000_emit_cmove (rtx, rtx, rtx, rtx); extern int rs6000_emit_vector_cond_expr (rtx, rtx, rtx, rtx, rtx, rtx); extern void rs6000_emit_minmax (rtx, enum rtx_code, rtx, rtx); +extern void rs6000_emit_sync (enum rtx_code, enum machine_mode, + rtx, rtx, rtx, rtx, bool); extern void output_toc (FILE *, rtx, int, enum machine_mode); extern void rs6000_initialize_trampoline (rtx, rtx, rtx); extern rtx rs6000_longcall_ref (rtx); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 602e83aa6af..bcf38e1aa3a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -130,11 +130,6 @@ static GTY(()) bool rs6000_always_hint; /* Schedule instructions for group formation. */ static GTY(()) bool rs6000_sched_groups; -/* Support adjust_priority scheduler hook - and -mprioritize-restricted-insns= option. */ -const char *rs6000_sched_restricted_insns_priority_str; -int rs6000_sched_restricted_insns_priority; - /* Support for -msched-costly-dep option. */ const char *rs6000_sched_costly_dep_str; enum rs6000_dependence_cost rs6000_sched_costly_dep; @@ -147,42 +142,20 @@ enum rs6000_nop_insertion rs6000_sched_insert_nops; static GTY(()) tree altivec_builtin_mask_for_load; /* Size of long double */ -const char *rs6000_long_double_size_string; int rs6000_long_double_type_size; /* Whether -mabi=altivec has appeared */ int rs6000_altivec_abi; -/* Whether VRSAVE instructions should be generated. */ -int rs6000_altivec_vrsave; - -/* String from -mvrsave= option. */ -const char *rs6000_altivec_vrsave_string; - /* Nonzero if we want SPE ABI extensions. */ int rs6000_spe_abi; -/* Whether isel instructions should be generated. */ -int rs6000_isel; - -/* Whether SPE simd instructions should be generated. */ -int rs6000_spe; - /* Nonzero if floating point operations are done in the GPRs. */ int rs6000_float_gprs = 0; /* Nonzero if we want Darwin's struct-by-value-in-regs ABI. */ int rs6000_darwin64_abi; -/* String from -mfloat-gprs=. */ -const char *rs6000_float_gprs_string; - -/* String from -misel=. */ -const char *rs6000_isel_string; - -/* String from -mspe=. */ -const char *rs6000_spe_string; - /* Set to nonzero once AIX common-mode calls have been defined. */ static GTY(()) int common_mode_defined; @@ -216,9 +189,6 @@ const char *rs6000_tls_size_string; /* ABI enumeration available for subtarget to use. */ enum rs6000_abi rs6000_current_abi; -/* ABI string from -mabi= option. */ -const char *rs6000_abi_string; - /* Whether to use variant of AIX ABI for PowerPC64 Linux. */ int dot_symbols; @@ -227,34 +197,13 @@ const char *rs6000_debug_name; int rs6000_debug_stack; /* debug stack applications */ int rs6000_debug_arg; /* debug argument handling */ -/* Value is TRUE if register/mode pair is accepatable. */ +/* Value is TRUE if register/mode pair is acceptable. */ bool rs6000_hard_regno_mode_ok_p[NUM_MACHINE_MODES][FIRST_PSEUDO_REGISTER]; -/* Opaque types. */ -static GTY(()) tree opaque_V2SI_type_node; -static GTY(()) tree opaque_V2SF_type_node; -static GTY(()) tree opaque_p_V2SI_type_node; -static GTY(()) tree V16QI_type_node; -static GTY(()) tree V2SI_type_node; -static GTY(()) tree V2SF_type_node; -static GTY(()) tree V4HI_type_node; -static GTY(()) tree V4SI_type_node; -static GTY(()) tree V4SF_type_node; -static GTY(()) tree V8HI_type_node; -static GTY(()) tree unsigned_V16QI_type_node; -static GTY(()) tree unsigned_V8HI_type_node; -static GTY(()) tree unsigned_V4SI_type_node; -static GTY(()) tree bool_char_type_node; /* __bool char */ -static GTY(()) tree bool_short_type_node; /* __bool short */ -static GTY(()) tree bool_int_type_node; /* __bool int */ -static GTY(()) tree pixel_type_node; /* __pixel */ -static GTY(()) tree bool_V16QI_type_node; /* __vector __bool char */ -static GTY(()) tree bool_V8HI_type_node; /* __vector __bool short */ -static GTY(()) tree bool_V4SI_type_node; /* __vector __bool int */ -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; +/* Built in types. */ + +tree rs6000_builtin_types[RS6000_BTI_MAX]; +tree rs6000_builtin_decls[RS6000_BUILTIN_COUNT]; const char *rs6000_traceback_name; static enum { @@ -271,19 +220,21 @@ char toc_label_name[10]; /* Alias set for saves and restores from the rs6000 stack. */ static GTY(()) int rs6000_sr_alias_set; -/* Call distance, overridden by -mlongcall and #pragma longcall(1). - The only place that looks at this is rs6000_set_default_type_attributes; - everywhere else should rely on the presence or absence of a longcall - attribute on the function declaration. Exception: init_cumulative_args - looks at it too, for libcalls. */ -int rs6000_default_long_calls; -const char *rs6000_longcall_switch; - /* Control alignment for fields within structures. */ /* String from -malign-XXXXX. */ -const char *rs6000_alignment_string; int rs6000_alignment_flags; +/* True for any options that were explicitly set. */ +struct { + bool aix_struct_ret; /* True if -maix-struct-ret was used. */ + bool alignment; /* True if -malign- was used. */ + bool abi; /* True if -mabi= was used. */ + bool spe; /* True if -mspe= was used. */ + bool float_gprs; /* True if -mfloat-gprs= was used. */ + bool isel; /* True if -misel was used. */ + bool long_double; /* True if -mlong-double- was used. */ +} rs6000_explicit_options; + struct builtin_description { /* mask is not const because we're going to alter it below. This @@ -642,6 +593,7 @@ static void rs6000_file_start (void); static unsigned int rs6000_elf_section_type_flags (tree, const char *, int); static void rs6000_elf_asm_out_constructor (rtx, int); static void rs6000_elf_asm_out_destructor (rtx, int); +static void rs6000_elf_end_indicate_exec_stack (void) ATTRIBUTE_UNUSED; static void rs6000_elf_select_section (tree, int, unsigned HOST_WIDE_INT); static void rs6000_elf_unique_section (tree, int); static void rs6000_elf_select_rtx_section (enum machine_mode, rtx, @@ -685,6 +637,7 @@ static void rs6000_sched_finish (FILE *, int); static int rs6000_use_sched_lookahead (void); static tree rs6000_builtin_mask_for_load (void); +static void def_builtin (int, const char *, tree, int); static void rs6000_init_builtins (void); static rtx rs6000_expand_unop_builtin (enum insn_code, tree, rtx); static rtx rs6000_expand_binop_builtin (enum insn_code, tree, rtx); @@ -716,18 +669,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); -static void rs6000_parse_abi_options (void); -static void rs6000_parse_alignment_option (void); +static bool rs6000_handle_option (size_t, const char *, int); static void rs6000_parse_tls_size_option (void); static void rs6000_parse_yes_no_option (const char *, const char *, int *); -static void rs6000_parse_float_gprs_option (void); static int first_altivec_reg_to_save (void); static unsigned int compute_vrsave_mask (void); static void compute_save_world_info (rs6000_stack_t *info_ptr); static void is_altivec_return_reg (rtx, void *); static rtx generate_set_vrsave (rtx, rs6000_stack_t *, int); int easy_vector_constant (rtx, enum machine_mode); -static bool is_ev64_opaque_type (tree); +static bool rs6000_is_opaque_type (tree); static rtx rs6000_dwarf_register_span (rtx); static rtx rs6000_legitimize_tls_address (rtx, enum tls_model); static rtx rs6000_tls_get_addr (void); @@ -961,7 +912,7 @@ static const char alt_reg_names[][8] = #define TARGET_ADDRESS_COST hook_int_rtx_0 #undef TARGET_VECTOR_OPAQUE_P -#define TARGET_VECTOR_OPAQUE_P is_ev64_opaque_type +#define TARGET_VECTOR_OPAQUE_P rs6000_is_opaque_type #undef TARGET_DWARF_REGISTER_SPAN #define TARGET_DWARF_REGISTER_SPAN rs6000_dwarf_register_span @@ -1008,6 +959,13 @@ static const char alt_reg_names[][8] = #undef TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN #define TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN invalid_arg_for_unprototyped_fn +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION rs6000_handle_option + +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS \ + (TARGET_DEFAULT | MASK_SCHED_PROLOG) + /* MPC604EUM 3.5.2 Weak Consistency between Multiple Processors The PowerPC architecture requires only weak consistency among processors--that is, memory accesses between processors need not be @@ -1157,17 +1115,19 @@ rs6000_override_options (const char *default_cpu) {"power4", PROCESSOR_POWER4, POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POWERPC64}, {"power5", PROCESSOR_POWER5, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_MFCRF | MASK_POWERPC64}, + POWERPC_BASE_MASK | MASK_POWERPC64 | MASK_PPC_GFXOPT + | MASK_MFCRF | MASK_POPCNTB}, {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK}, {"powerpc64", PROCESSOR_POWERPC64, - POWERPC_BASE_MASK | MASK_POWERPC64}, + POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64}, {"rios", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, {"rios1", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, {"rios2", PROCESSOR_RIOS2, MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING}, {"rsc", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, {"rsc1", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING}, - {"rs64a", PROCESSOR_RS64A, POWERPC_BASE_MASK | MASK_POWERPC64}, + {"rs64", PROCESSOR_RS64A, + POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_POWERPC64} }; const size_t ptt_size = ARRAY_SIZE (processor_target_table); @@ -1249,14 +1209,14 @@ rs6000_override_options (const char *default_cpu) { target_flags &= ~MASK_MULTIPLE; if ((target_flags_explicit & MASK_MULTIPLE) != 0) - warning ("-mmultiple is not supported on little endian systems"); + warning (0, "-mmultiple is not supported on little endian systems"); } if (TARGET_STRING) { target_flags &= ~MASK_STRING; if ((target_flags_explicit & MASK_STRING) != 0) - warning ("-mstring is not supported on little endian systems"); + warning (0, "-mstring is not supported on little endian systems"); } } @@ -1286,53 +1246,27 @@ rs6000_override_options (const char *default_cpu) rs6000_traceback_name); } - /* Set size of long double */ - rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; - if (rs6000_long_double_size_string) - { - char *tail; - int size = strtol (rs6000_long_double_size_string, &tail, 10); - if (*tail != '\0' || (size != 64 && size != 128)) - error ("Unknown switch -mlong-double-%s", - rs6000_long_double_size_string); - else - rs6000_long_double_type_size = size; - } + if (!rs6000_explicit_options.long_double) + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; /* Set Altivec ABI as default for powerpc64 linux. */ if (TARGET_ELF && TARGET_64BIT) { rs6000_altivec_abi = 1; - rs6000_altivec_vrsave = 1; + TARGET_ALTIVEC_VRSAVE = 1; } /* Set the Darwin64 ABI as default for 64-bit Darwin. */ if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT) { rs6000_darwin64_abi = 1; - /* Setting to empty string is same as "-mone-byte-bool". */ #if TARGET_MACHO - darwin_one_byte_bool = ""; + darwin_one_byte_bool = 1; #endif /* Default to natural alignment, for better performance. */ rs6000_alignment_flags = MASK_ALIGN_NATURAL; } - /* Handle -mabi= options. */ - rs6000_parse_abi_options (); - - /* Handle -malign-XXXXX option. */ - rs6000_parse_alignment_option (); - - rs6000_parse_float_gprs_option (); - - /* Handle generic -mFOO=YES/NO options. */ - rs6000_parse_yes_no_option ("vrsave", rs6000_altivec_vrsave_string, - &rs6000_altivec_vrsave); - rs6000_parse_yes_no_option ("isel", rs6000_isel_string, - &rs6000_isel); - rs6000_parse_yes_no_option ("spe", rs6000_spe_string, &rs6000_spe); - /* Handle -mtls-size option. */ rs6000_parse_tls_size_option (); @@ -1355,26 +1289,21 @@ rs6000_override_options (const char *default_cpu) MASK_STRING above when optimizing for size. */ if ((target_flags & MASK_STRING) != 0) target_flags = target_flags & ~MASK_STRING; - - /* No SPE means 64-bit long doubles, even if an E500. */ - if (rs6000_spe_string != 0 - && !strcmp (rs6000_spe_string, "no")) - rs6000_long_double_type_size = 64; } else if (rs6000_select[1].string != NULL) { /* For the powerpc-eabispe configuration, we set all these by default, so let's unset them if we manually set another CPU that is not the E500. */ - if (rs6000_abi_string == 0) + if (!rs6000_explicit_options.abi) rs6000_spe_abi = 0; - if (rs6000_spe_string == 0) + if (!rs6000_explicit_options.spe) rs6000_spe = 0; - if (rs6000_float_gprs_string == 0) + if (!rs6000_explicit_options.float_gprs) rs6000_float_gprs = 0; - if (rs6000_isel_string == 0) + if (!rs6000_explicit_options.isel) rs6000_isel = 0; - if (rs6000_long_double_size_string == 0) + if (!rs6000_explicit_options.long_double) rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; } @@ -1383,43 +1312,13 @@ rs6000_override_options (const char *default_cpu) rs6000_sched_groups = (rs6000_cpu == PROCESSOR_POWER4 || rs6000_cpu == PROCESSOR_POWER5); - /* Handle -m(no-)longcall option. This is a bit of a cheap hack, - using TARGET_OPTIONS to handle a toggle switch, but we're out of - bits in target_flags so TARGET_SWITCHES cannot be used. - Assumption here is that rs6000_longcall_switch points into the - text of the complete option, rather than being a copy, so we can - scan back for the presence or absence of the no- modifier. */ - if (rs6000_longcall_switch) - { - const char *base = rs6000_longcall_switch; - while (base[-1] != 'm') base--; - - if (*rs6000_longcall_switch != '\0') - error ("invalid option %qs", base); - rs6000_default_long_calls = (base[0] != 'n'); - } - - /* Handle -m(no-)warn-altivec-long similarly. */ - if (rs6000_warn_altivec_long_switch) - { - const char *base = rs6000_warn_altivec_long_switch; - while (base[-1] != 'm') base--; - - if (*rs6000_warn_altivec_long_switch != '\0') - error ("invalid option %qs", base); - rs6000_warn_altivec_long = (base[0] != 'n'); - } - - /* Handle -mprioritize-restricted-insns option. */ rs6000_sched_restricted_insns_priority = (rs6000_sched_groups ? 1 : 0); - if (rs6000_sched_restricted_insns_priority_str) - rs6000_sched_restricted_insns_priority = - atoi (rs6000_sched_restricted_insns_priority_str); /* Handle -msched-costly-dep option. */ rs6000_sched_costly_dep = (rs6000_sched_groups ? store_to_load_dep_costly : no_dep_costly); + if (rs6000_sched_costly_dep_str) { if (! strcmp (rs6000_sched_costly_dep_str, "no")) @@ -1437,6 +1336,7 @@ rs6000_override_options (const char *default_cpu) /* Handle -minsert-sched-nops option. */ rs6000_sched_insert_nops = (rs6000_sched_groups ? sched_finish_regroup_exact : sched_finish_none); + if (rs6000_sched_insert_nops_str) { if (! strcmp (rs6000_sched_insert_nops_str, "no")) @@ -1456,16 +1356,11 @@ rs6000_override_options (const char *default_cpu) memcpy (rs6000_reg_names, alt_reg_names, sizeof (rs6000_reg_names)); #endif - /* Set TARGET_AIX_STRUCT_RET last, after the ABI is determined. + /* Set aix_struct_return last, after the ABI is determined. If -maix-struct-return or -msvr4-struct-return was explicitly used, don't override with the ABI default. */ - if ((target_flags_explicit & MASK_AIX_STRUCT_RET) == 0) - { - if (DEFAULT_ABI == ABI_V4 && !DRAFT_V4_STRUCT_RET) - target_flags = (target_flags & ~MASK_AIX_STRUCT_RET); - else - target_flags |= MASK_AIX_STRUCT_RET; - } + if (!rs6000_explicit_options.aix_struct_ret) + aix_struct_return = (DEFAULT_ABI != ABI_V4 || DRAFT_V4_STRUCT_RET); if (TARGET_LONG_DOUBLE_128 && (DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)) @@ -1588,7 +1483,7 @@ rs6000_override_options (const char *default_cpu) break; default: - abort (); + gcc_unreachable (); } } @@ -1620,87 +1515,6 @@ rs6000_parse_yes_no_option (const char *name, const char *value, int *flag) error ("unknown -m%s= option specified: '%s'", name, value); } -/* Handle -mabi= options. */ -static void -rs6000_parse_abi_options (void) -{ - if (rs6000_abi_string == 0) - return; - else if (! strcmp (rs6000_abi_string, "altivec")) - { - rs6000_altivec_abi = 1; - rs6000_spe_abi = 0; - } - else if (! strcmp (rs6000_abi_string, "no-altivec")) - rs6000_altivec_abi = 0; - else if (! strcmp (rs6000_abi_string, "spe")) - { - rs6000_spe_abi = 1; - rs6000_altivec_abi = 0; - if (!TARGET_SPE_ABI) - error ("not configured for ABI: '%s'", rs6000_abi_string); - } - - /* These are here for testing during development only, do not - document in the manual please. */ - else if (! strcmp (rs6000_abi_string, "d64")) - { - rs6000_darwin64_abi = 1; - warning ("Using darwin64 ABI"); - } - else if (! strcmp (rs6000_abi_string, "d32")) - { - rs6000_darwin64_abi = 0; - warning ("Using old darwin ABI"); - } - - else if (! strcmp (rs6000_abi_string, "no-spe")) - rs6000_spe_abi = 0; - else - error ("unknown ABI specified: '%s'", rs6000_abi_string); -} - -/* Handle -mfloat-gprs= options. */ -static void -rs6000_parse_float_gprs_option (void) -{ - if (rs6000_float_gprs_string == 0) - return; - else if (! strcmp (rs6000_float_gprs_string, "yes") - || ! strcmp (rs6000_float_gprs_string, "single")) - rs6000_float_gprs = 1; - else if (! strcmp (rs6000_float_gprs_string, "double")) - rs6000_float_gprs = 2; - else if (! strcmp (rs6000_float_gprs_string, "no")) - rs6000_float_gprs = 0; - else - error ("invalid option for -mfloat-gprs"); -} - -/* Handle -malign-XXXXXX options. */ -static void -rs6000_parse_alignment_option (void) -{ - if (rs6000_alignment_string == 0) - return; - else if (! strcmp (rs6000_alignment_string, "power")) - { - /* 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; - } - else if (! strcmp (rs6000_alignment_string, "natural")) - rs6000_alignment_flags = MASK_ALIGN_NATURAL; - else - error ("unknown -malign-XXXXX option specified: '%s'", - rs6000_alignment_string); -} - /* Validate and record the size specified with the -mtls-size option. */ static void @@ -1722,6 +1536,273 @@ void optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) { } + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +rs6000_handle_option (size_t code, const char *arg, int value) +{ + switch (code) + { + case OPT_mno_power: + target_flags &= ~(MASK_POWER | MASK_POWER2 + | MASK_MULTIPLE | MASK_STRING); + target_flags_explicit |= (MASK_POWER | MASK_POWER2 + | MASK_MULTIPLE | MASK_STRING); + break; + case OPT_mno_powerpc: + target_flags &= ~(MASK_POWERPC | MASK_PPC_GPOPT + | MASK_PPC_GFXOPT | MASK_POWERPC64); + target_flags_explicit |= (MASK_POWERPC | MASK_PPC_GPOPT + | MASK_PPC_GFXOPT | MASK_POWERPC64); + break; + case OPT_mfull_toc: + target_flags &= ~(MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC + | MASK_NO_SUM_IN_TOC); + target_flags_explicit |= (MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC + | MASK_NO_SUM_IN_TOC); +#ifdef TARGET_USES_SYSV4_OPT + /* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be + just the same as -mminimal-toc. */ + target_flags |= MASK_MINIMAL_TOC; + target_flags_explicit |= MASK_MINIMAL_TOC; +#endif + break; + +#ifdef TARGET_USES_SYSV4_OPT + case OPT_mtoc: + /* Make -mtoc behave like -mminimal-toc. */ + target_flags |= MASK_MINIMAL_TOC; + target_flags_explicit |= MASK_MINIMAL_TOC; + break; +#endif + +#ifdef TARGET_USES_AIX64_OPT + case OPT_maix64: +#else + case OPT_m64: +#endif + target_flags |= MASK_POWERPC64 | MASK_POWERPC | MASK_PPC_GFXOPT; + target_flags_explicit |= MASK_POWERPC64 | MASK_POWERPC + | MASK_PPC_GFXOPT; + break; + +#ifdef TARGET_USES_AIX64_OPT + case OPT_maix32: +#else + case OPT_m32: +#endif + target_flags &= ~MASK_POWERPC64; + target_flags_explicit |= MASK_POWERPC64; + break; + + case OPT_minsert_sched_nops_: + rs6000_sched_insert_nops_str = arg; + break; + + case OPT_mminimal_toc: + if (value == 1) + { + target_flags &= ~(MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC); + target_flags_explicit |= (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC); + } + break; + + case OPT_mpower: + if (value == 1) + { + target_flags |= (MASK_MULTIPLE | MASK_STRING); + target_flags_explicit |= (MASK_MULTIPLE | MASK_STRING); + } + break; + + case OPT_mpower2: + if (value == 1) + { + target_flags |= (MASK_POWER | MASK_MULTIPLE | MASK_STRING); + target_flags_explicit |= (MASK_POWER | MASK_MULTIPLE | MASK_STRING); + } + break; + + case OPT_mpowerpc_gpopt: + case OPT_mpowerpc_gfxopt: + if (value == 1) + { + target_flags |= MASK_POWERPC; + target_flags_explicit |= MASK_POWERPC; + } + break; + + case OPT_maix_struct_return: + case OPT_msvr4_struct_return: + rs6000_explicit_options.aix_struct_ret = true; + break; + + case OPT_mvrsave_: + rs6000_parse_yes_no_option ("vrsave", arg, &(TARGET_ALTIVEC_VRSAVE)); + break; + + case OPT_misel_: + rs6000_explicit_options.isel = true; + rs6000_parse_yes_no_option ("isel", arg, &(rs6000_isel)); + break; + + case OPT_mspe_: + rs6000_explicit_options.spe = true; + rs6000_parse_yes_no_option ("spe", arg, &(rs6000_spe)); + /* No SPE means 64-bit long doubles, even if an E500. */ + if (!rs6000_spe) + rs6000_long_double_type_size = 64; + break; + + case OPT_mdebug_: + rs6000_debug_name = arg; + break; + +#ifdef TARGET_USES_SYSV4_OPT + case OPT_mcall_: + rs6000_abi_name = arg; + break; + + case OPT_msdata_: + rs6000_sdata_name = arg; + break; + + case OPT_mtls_size_: + rs6000_tls_size_string = arg; + break; + + case OPT_mrelocatable: + if (value == 1) + { + target_flags |= MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; + target_flags_explicit |= MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; + } + break; + + case OPT_mrelocatable_lib: + if (value == 1) + { + target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC + | MASK_NO_FP_IN_TOC; + target_flags_explicit |= MASK_RELOCATABLE | MASK_MINIMAL_TOC + | MASK_NO_FP_IN_TOC; + } + else + { + target_flags &= ~MASK_RELOCATABLE; + target_flags_explicit |= MASK_RELOCATABLE; + } + break; +#endif + + case OPT_mabi_: + rs6000_explicit_options.abi = true; + if (!strcmp (arg, "altivec")) + { + rs6000_altivec_abi = 1; + rs6000_spe_abi = 0; + } + else if (! strcmp (arg, "no-altivec")) + rs6000_altivec_abi = 0; + else if (! strcmp (arg, "spe")) + { + rs6000_spe_abi = 1; + rs6000_altivec_abi = 0; + if (!TARGET_SPE_ABI) + error ("not configured for ABI: '%s'", arg); + } + else if (! strcmp (arg, "no-spe")) + rs6000_spe_abi = 0; + + /* These are here for testing during development only, do not + document in the manual please. */ + else if (! strcmp (arg, "d64")) + { + rs6000_darwin64_abi = 1; + warning (0, "Using darwin64 ABI"); + } + else if (! strcmp (arg, "d32")) + { + rs6000_darwin64_abi = 0; + warning (0, "Using old darwin ABI"); + } + + else + { + error ("unknown ABI specified: '%s'", arg); + return false; + } + break; + + case OPT_mcpu_: + rs6000_select[1].string = arg; + break; + + case OPT_mtune_: + rs6000_select[2].string = arg; + break; + + case OPT_mtraceback_: + rs6000_traceback_name = arg; + break; + + case OPT_mfloat_gprs_: + rs6000_explicit_options.float_gprs = true; + if (! strcmp (arg, "yes") || ! strcmp (arg, "single")) + rs6000_float_gprs = 1; + else if (! strcmp (arg, "double")) + rs6000_float_gprs = 2; + else if (! strcmp (arg, "no")) + rs6000_float_gprs = 0; + else + { + error ("invalid option for -mfloat-gprs: '%s'", arg); + return false; + } + break; + + case OPT_mlong_double_: + rs6000_explicit_options.long_double = true; + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; + if (value != 64 && value != 128) + { + error ("Unknown switch -mlong-double-%s", arg); + rs6000_long_double_type_size = RS6000_DEFAULT_LONG_DOUBLE_SIZE; + return false; + } + else + rs6000_long_double_type_size = value; + break; + + case OPT_msched_costly_dep_: + rs6000_sched_costly_dep_str = arg; + break; + + case OPT_malign_: + rs6000_explicit_options.alignment = true; + if (! strcmp (arg, "power")) + { + /* 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 (0, "-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; + } + else if (! strcmp (arg, "natural")) + rs6000_alignment_flags = MASK_ALIGN_NATURAL; + else + { + error ("unknown -malign-XXXXX option specified: '%s'", arg); + return false; + } + break; + } + return true; +} /* Do anything needed at the start of the asm file. */ @@ -1848,8 +1929,11 @@ num_insns_constant_wide (HOST_WIDE_INT value) int num_insns_constant (rtx op, enum machine_mode mode) { - if (GET_CODE (op) == CONST_INT) + HOST_WIDE_INT low, high; + + switch (GET_CODE (op)) { + case CONST_INT: #if HOST_BITS_PER_WIDE_INT == 64 if ((INTVAL (op) >> 31) != 0 && (INTVAL (op) >> 31) != -1 && mask64_operand (op, mode)) @@ -1857,65 +1941,57 @@ num_insns_constant (rtx op, enum machine_mode mode) else #endif return num_insns_constant_wide (INTVAL (op)); - } - - else if (GET_CODE (op) == CONST_DOUBLE && mode == SFmode) - { - long l; - REAL_VALUE_TYPE rv; - - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_SINGLE (rv, l); - return num_insns_constant_wide ((HOST_WIDE_INT) l); - } - - else if (GET_CODE (op) == CONST_DOUBLE) - { - HOST_WIDE_INT low; - HOST_WIDE_INT high; - long l[2]; - REAL_VALUE_TYPE rv; - int endian = (WORDS_BIG_ENDIAN == 0); - if (mode == VOIDmode || mode == DImode) - { - high = CONST_DOUBLE_HIGH (op); - low = CONST_DOUBLE_LOW (op); - } - else - { - REAL_VALUE_FROM_CONST_DOUBLE (rv, op); - REAL_VALUE_TO_TARGET_DOUBLE (rv, l); - high = l[endian]; - low = l[1 - endian]; - } - - if (TARGET_32BIT) - return (num_insns_constant_wide (low) - + num_insns_constant_wide (high)); - - else - { - if (high == 0 && low >= 0) - return num_insns_constant_wide (low); - - else if (high == -1 && low < 0) - return num_insns_constant_wide (low); - - else if (mask64_operand (op, mode)) - return 2; + case CONST_DOUBLE: + if (mode == SFmode) + { + long l; + REAL_VALUE_TYPE rv; + + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_SINGLE (rv, l); + return num_insns_constant_wide ((HOST_WIDE_INT) l); + } - else if (low == 0) - return num_insns_constant_wide (high) + 1; + if (mode == VOIDmode || mode == DImode) + { + high = CONST_DOUBLE_HIGH (op); + low = CONST_DOUBLE_LOW (op); + } + else + { + long l[2]; + REAL_VALUE_TYPE rv; + + REAL_VALUE_FROM_CONST_DOUBLE (rv, op); + REAL_VALUE_TO_TARGET_DOUBLE (rv, l); + high = l[WORDS_BIG_ENDIAN == 0]; + low = l[WORDS_BIG_ENDIAN != 0]; + } - else - return (num_insns_constant_wide (high) - + num_insns_constant_wide (low) + 1); - } + if (TARGET_32BIT) + return (num_insns_constant_wide (low) + + num_insns_constant_wide (high)); + else + { + if ((high == 0 && low >= 0) + || (high == -1 && low < 0)) + return num_insns_constant_wide (low); + + else if (mask64_operand (op, mode)) + return 2; + + else if (low == 0) + return num_insns_constant_wide (high) + 1; + + else + return (num_insns_constant_wide (high) + + num_insns_constant_wide (low) + 1); + } + + default: + gcc_unreachable (); } - - else - abort (); } /* Returns the constant for the splat instruction, if exists. */ @@ -2005,66 +2081,61 @@ output_vec_const_move (rtx *operands) { if (zero_constant (vec, mode)) return "vxor %0,%0,%0"; - else if (easy_vector_constant (vec, mode)) + + gcc_assert (easy_vector_constant (vec, mode)); + + operands[1] = GEN_INT (cst); + switch (mode) { - operands[1] = GEN_INT (cst); - switch (mode) + case V4SImode: + if (EASY_VECTOR_15 (cst)) { - case V4SImode: - if (EASY_VECTOR_15 (cst)) - { - operands[1] = GEN_INT (cst); - return "vspltisw %0,%1"; - } - else if (EASY_VECTOR_15_ADD_SELF (cst)) - return "#"; - cst = cst >> 16; - /* Fall thru */ - - case V8HImode: - if (EASY_VECTOR_15 (cst)) - { - operands[1] = GEN_INT (cst); - return "vspltish %0,%1"; - } - else if (EASY_VECTOR_15_ADD_SELF (cst)) - return "#"; - cst = cst >> 8; - /* Fall thru */ + operands[1] = GEN_INT (cst); + return "vspltisw %0,%1"; + } + else if (EASY_VECTOR_15_ADD_SELF (cst)) + return "#"; + cst = cst >> 16; + /* Fall thru */ - case V16QImode: - if (EASY_VECTOR_15 (cst)) - { - operands[1] = GEN_INT (cst); - return "vspltisb %0,%1"; - } - else if (EASY_VECTOR_15_ADD_SELF (cst)) - return "#"; + case V8HImode: + if (EASY_VECTOR_15 (cst)) + { + operands[1] = GEN_INT (cst); + return "vspltish %0,%1"; + } + else if (EASY_VECTOR_15_ADD_SELF (cst)) + return "#"; + cst = cst >> 8; + /* Fall thru */ - default: - abort (); + case V16QImode: + if (EASY_VECTOR_15 (cst)) + { + operands[1] = GEN_INT (cst); + return "vspltisb %0,%1"; } + else if (EASY_VECTOR_15_ADD_SELF (cst)) + return "#"; + + default: + gcc_unreachable (); } - else - abort (); } - if (TARGET_SPE) - { - /* Vector constant 0 is handled as a splitter of V2SI, and in the - pattern of V1DI, V4HI, and V2SF. - - FIXME: We should probably return # and add post reload - splitters for these, but this way is so easy ;-). */ - operands[1] = GEN_INT (cst); - operands[2] = GEN_INT (cst2); - if (cst == cst2) - return "li %0,%1\n\tevmergelo %0,%0,%0"; - else - return "li %0,%1\n\tevmergelo %0,%0,%0\n\tli %0,%2"; - } + gcc_assert (TARGET_SPE); + + /* Vector constant 0 is handled as a splitter of V2SI, and in the + pattern of V1DI, V4HI, and V2SF. - abort (); + FIXME: We should probably return # and add post reload + splitters for these, but this way is so easy ;-). */ + operands[1] = GEN_INT (cst); + operands[2] = GEN_INT (cst2); + if (cst == cst2) + return "li %0,%1\n\tevmergelo %0,%0,%0"; + else + return "li %0,%1\n\tevmergelo %0,%0,%0\n\tli %0,%2"; } int @@ -2131,8 +2202,7 @@ build_mask64_2_operands (rtx in, rtx *out) unsigned HOST_WIDE_INT c, lsb, m1, m2; int shift; - if (GET_CODE (in) != CONST_INT) - abort (); + gcc_assert (GET_CODE (in) == CONST_INT); c = INTVAL (in); if (c & 1) @@ -2188,7 +2258,7 @@ build_mask64_2_operands (rtx in, rtx *out) #else (void)in; (void)out; - abort (); + gcc_unreachable (); #endif } @@ -2276,27 +2346,6 @@ small_data_operand (rtx op ATTRIBUTE_UNUSED, #endif } -/* Return true, if operand is a memory operand and has a - displacement divisible by 4. */ - -int -word_offset_memref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - rtx addr; - int off = 0; - - if (!memory_operand (op, mode)) - return 0; - - addr = XEXP (op, 0); - if (GET_CODE (addr) == PLUS - && GET_CODE (XEXP (addr, 0)) == REG - && GET_CODE (XEXP (addr, 1)) == CONST_INT) - off = INTVAL (XEXP (addr, 1)); - - return (off % 4) == 0; -} - /* Return true if either operand is a general purpose register. */ bool @@ -2691,7 +2740,7 @@ rs6000_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs (DOUBLE_INT_ASM_OP, file); break; default: - abort (); + gcc_unreachable (); } output_addr_const (file, x); fputs ("@dtprel+0x8000", file); @@ -2790,21 +2839,16 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model) rs6000_emit_move (got, gsym, Pmode); else { - char buf[30]; - static int tls_got_labelno = 0; - rtx tempLR, lab, tmp3, mem; + rtx tempLR, tmp3, mem; rtx first, last; - ASM_GENERATE_INTERNAL_LABEL (buf, "LTLS", tls_got_labelno++); - lab = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); tempLR = gen_reg_rtx (Pmode); tmp1 = gen_reg_rtx (Pmode); tmp2 = gen_reg_rtx (Pmode); tmp3 = gen_reg_rtx (Pmode); mem = gen_const_mem (Pmode, tmp1); - first = emit_insn (gen_load_toc_v4_PIC_1b (tempLR, lab, - gsym)); + first = emit_insn (gen_load_toc_v4_PIC_1b (tempLR, gsym)); emit_move_insn (tmp1, tempLR); emit_move_insn (tmp2, mem); emit_insn (gen_addsi3 (tmp3, tmp1, tmp2)); @@ -3309,17 +3353,18 @@ rs6000_emit_set_const (rtx dest, enum machine_mode mode, rtx result, insn, set; HOST_WIDE_INT c0, c1; - if (mode == QImode || mode == HImode) + switch (mode) { + case QImode: + case HImode: if (dest == NULL) dest = gen_reg_rtx (mode); emit_insn (gen_rtx_SET (VOIDmode, dest, source)); return dest; - } - else if (mode == SImode) - { + + case SImode: result = no_new_pseudos ? dest : gen_reg_rtx (SImode); - + emit_insn (gen_rtx_SET (VOIDmode, result, GEN_INT (INTVAL (source) & (~ (HOST_WIDE_INT) 0xffff)))); @@ -3327,16 +3372,17 @@ rs6000_emit_set_const (rtx dest, enum machine_mode mode, gen_rtx_IOR (SImode, result, GEN_INT (INTVAL (source) & 0xffff)))); result = dest; - } - else if (mode == DImode) - { - if (GET_CODE (source) == CONST_INT) + break; + + case DImode: + switch (GET_CODE (source)) { + case CONST_INT: c0 = INTVAL (source); c1 = -(c0 < 0); - } - else if (GET_CODE (source) == CONST_DOUBLE) - { + break; + + case CONST_DOUBLE: #if HOST_BITS_PER_WIDE_INT >= 64 c0 = CONST_DOUBLE_LOW (source); c1 = -(c0 < 0); @@ -3344,14 +3390,18 @@ rs6000_emit_set_const (rtx dest, enum machine_mode mode, c0 = CONST_DOUBLE_LOW (source); c1 = CONST_DOUBLE_HIGH (source); #endif + break; + + default: + gcc_unreachable (); } - else - abort (); result = rs6000_emit_set_long_const (dest, c0, c1); + break; + + default: + gcc_unreachable (); } - else - abort (); insn = get_last_insn (); set = single_set (insn); @@ -3489,14 +3539,13 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) to a CONST_INT. */ operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), mode); } - if (GET_CODE (operands[1]) == CONST_DOUBLE - && ! FLOAT_MODE_P (mode) - && ((CONST_DOUBLE_HIGH (operands[1]) == 0 - && CONST_DOUBLE_LOW (operands[1]) >= 0) - || (CONST_DOUBLE_HIGH (operands[1]) == -1 - && CONST_DOUBLE_LOW (operands[1]) < 0))) - abort (); - + gcc_assert (GET_CODE (operands[1]) != CONST_DOUBLE + || FLOAT_MODE_P (mode) + || ((CONST_DOUBLE_HIGH (operands[1]) != 0 + || CONST_DOUBLE_LOW (operands[1]) < 0) + && (CONST_DOUBLE_HIGH (operands[1]) != -1 + || CONST_DOUBLE_LOW (operands[1]) >= 0))); + /* Check if GCC is setting up a block move that will end up using FP registers as temporaries. We must make sure this is acceptable. */ if (GET_CODE (operands[0]) == MEM @@ -3550,11 +3599,29 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) /* Recognize the case where operand[1] is a reference to thread-local data and load its address to a register. */ - if (GET_CODE (operands[1]) == SYMBOL_REF) + if (rs6000_tls_referenced_p (operands[1])) { - enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]); - if (model != 0) - operands[1] = rs6000_legitimize_tls_address (operands[1], model); + enum tls_model model; + rtx tmp = operands[1]; + rtx addend = NULL; + + if (GET_CODE (tmp) == CONST && GET_CODE (XEXP (tmp, 0)) == PLUS) + { + addend = XEXP (XEXP (tmp, 0), 1); + tmp = XEXP (XEXP (tmp, 0), 0); + } + + gcc_assert (GET_CODE (tmp) == SYMBOL_REF); + model = SYMBOL_REF_TLS_MODEL (tmp); + gcc_assert (model != 0); + + tmp = rs6000_legitimize_tls_address (tmp, model); + if (addend) + { + tmp = gen_rtx_PLUS (mode, tmp, addend); + tmp = force_operand (tmp, operands[0]); + } + operands[1] = tmp; } /* Handle the case where reload calls us with an invalid address. */ @@ -3794,7 +3861,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } /* Above, we may have called force_const_mem which may have returned @@ -3829,7 +3896,7 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode) returned in memory. The Darwin ABI does the same. The SVR4 ABI specifies that structures <= 8 bytes are returned in r3/r4, but a draft put them in memory, and GCC used to implement the draft - instead of the final standard. Therefore, TARGET_AIX_STRUCT_RET + instead of the final standard. Therefore, aix_struct_return controls this instead of DEFAULT_ABI; V.4 targets needing backward compatibility can change DRAFT_V4_STRUCT_RET to override the default, and -m switches get the final word. See @@ -3865,7 +3932,7 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) } if (AGGREGATE_TYPE_P (type) - && (TARGET_AIX_STRUCT_RET + && (aix_struct_return || (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8)) return true; @@ -3882,7 +3949,7 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED) static bool warned_for_return_big_vectors = false; if (!warned_for_return_big_vectors) { - warning ("GCC vector returned by reference: " + warning (0, "GCC vector returned by reference: " "non-standard ABI extension with no compatibility guarantee"); warned_for_return_big_vectors = true; } @@ -4060,6 +4127,20 @@ function_arg_boundary (enum machine_mode mode, tree type) return PARM_BOUNDARY; } +/* For a function parm of MODE and TYPE, return the starting word in + the parameter area. NWORDS of the parameter area are already used. */ + +static unsigned int +rs6000_parm_start (enum machine_mode mode, tree type, unsigned int nwords) +{ + unsigned int align; + unsigned int parm_offset; + + align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; + parm_offset = DEFAULT_ABI == ABI_V4 ? 2 : 6; + return nwords + (-(parm_offset + nwords) & align); +} + /* Compute the size (in words) of a function argument. */ static unsigned long @@ -4314,15 +4395,10 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, else { int n_words = rs6000_arg_size (mode, type); - int align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; + int start_words = cum->words; + int align_words = rs6000_parm_start (mode, type, start_words); - /* The simple alignment calculation here works because - function_arg_boundary / PARM_BOUNDARY will only be 1 or 2. - If we ever want to handle alignments larger than 8 bytes for - 32-bit or 16 bytes for 64-bit, then we'll need to take into - account the offset to the start of the parm save area. */ - align &= cum->words; - cum->words += align + n_words; + cum->words = align_words + n_words; if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_HARD_FLOAT && TARGET_FPRS) @@ -4335,7 +4411,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, fprintf (stderr, "nargs = %4d, proto = %d, mode = %4s, ", cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode)); fprintf (stderr, "named = %d, align = %d, depth = %d\n", - named, align, depth); + named, align_words - start_words, depth); } } } @@ -4345,22 +4421,23 @@ spe_build_register_parallel (enum machine_mode mode, int gregno) { rtx r1, r3; - if (mode == DFmode) + switch (mode) { + case DFmode: r1 = gen_rtx_REG (DImode, gregno); r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); return gen_rtx_PARALLEL (mode, gen_rtvec (1, r1)); - } - else if (mode == DCmode) - { + + case DCmode: r1 = gen_rtx_REG (DImode, gregno); r1 = gen_rtx_EXPR_LIST (VOIDmode, r1, const0_rtx); r3 = gen_rtx_REG (DImode, gregno + 2); r3 = gen_rtx_EXPR_LIST (VOIDmode, r3, GEN_INT (8)); return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r3)); + + default: + gcc_unreachable (); } - abort (); - return NULL_RTX; } /* Determine where to put a SIMD argument on the SPE. */ @@ -4826,8 +4903,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, } else { - int align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; - int align_words = cum->words + (cum->words & align); + int align_words = rs6000_parm_start (mode, type, cum->words); if (USE_FP_FOR_ARG_P (cum, mode, type)) { @@ -4842,8 +4918,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, { /* Currently, we only ever need one reg here because complex doubles are split. */ - if (cum->fregno != FP_ARG_MAX_REG || fmode != TFmode) - abort (); + gcc_assert (cum->fregno == FP_ARG_MAX_REG && fmode == TFmode); /* Long double split over regs and memory. */ fmode = DFmode; @@ -4930,18 +5005,16 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, } /* For an arg passed partly in registers and partly in memory, this is - the number of registers used. For args passed entirely in registers - or entirely in memory, zero. When an arg is described by a PARALLEL, - perhaps using more than one register type, this function returns the - number of bytes of registers used by the PARALLEL. */ + the number of bytes passed in registers. For args passed entirely in + registers or entirely in memory, zero. When an arg is described by a + PARALLEL, perhaps using more than one register type, this function + returns the number of bytes used by the first element of the PARALLEL. */ static int rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, bool named) { int ret = 0; - int align; - int parm_offset; int align_words; if (DEFAULT_ABI == ABI_V4) @@ -4957,14 +5030,13 @@ rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, && int_size_in_bytes (type) > 0) return 0; - align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1; - parm_offset = TARGET_32BIT ? 2 : 0; - align_words = cum->words + ((parm_offset - cum->words) & align); + align_words = rs6000_parm_start (mode, type, cum->words); if (USE_FP_FOR_ARG_P (cum, mode, type) - /* If we are passing this arg in gprs as well, then this function - should return the number of gprs (or memory) partially passed, - *not* the number of fprs. */ + /* If we are passing this arg in the fixed parameter save area + (gprs or memory) as well as fprs, then this function should + return the number of bytes passed in the parameter save area + rather than bytes passed in fprs. */ && !(type && (cum->nargs_prototype <= 0 || (DEFAULT_ABI == ABI_AIX @@ -4972,16 +5044,14 @@ rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, && align_words >= GP_ARG_NUM_REG)))) { if (cum->fregno + ((GET_MODE_SIZE (mode) + 7) >> 3) > FP_ARG_MAX_REG + 1) - ret = FP_ARG_MAX_REG + 1 - cum->fregno; + ret = (FP_ARG_MAX_REG + 1 - cum->fregno) * 8; else if (cum->nargs_prototype >= 0) return 0; } if (align_words < GP_ARG_NUM_REG && GP_ARG_NUM_REG < align_words + rs6000_arg_size (mode, type)) - ret = GP_ARG_NUM_REG - align_words; - - ret *= (TARGET_32BIT ? 4 : 8); + ret = (GP_ARG_NUM_REG - align_words) * (TARGET_32BIT ? 4 : 8); if (ret != 0 && TARGET_DEBUG_ARG) fprintf (stderr, "rs6000_arg_partial_bytes: %d\n", ret); @@ -5050,7 +5120,7 @@ rs6000_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, fprintf (stderr, "function_arg_pass_by_reference: synthetic vector\n"); if (!warned_for_pass_big_vectors) { - warning ("GCC vector passed by reference: " + warning (0, "GCC vector passed by reference: " "non-standard ABI extension with no compatibility guarantee"); warned_for_pass_big_vectors = true; } @@ -5083,8 +5153,7 @@ rs6000_move_block_from_reg (int regno, rtx x, int nregs) else tem = replace_equiv_address (tem, XEXP (tem, 0)); - if (tem == NULL_RTX) - abort (); + gcc_assert (tem); emit_move_insn (tem, gen_rtx_REG (reg_mode, regno + i)); } @@ -5136,8 +5205,24 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, } set = get_varargs_alias_set (); - if (! no_rtl && first_reg_offset < GP_ARG_NUM_REG) + if (! no_rtl && first_reg_offset < GP_ARG_NUM_REG + && cfun->va_list_gpr_size) { + int nregs = GP_ARG_NUM_REG - first_reg_offset; + + if (va_list_gpr_counter_field) + { + /* V4 va_list_gpr_size counts number of registers needed. */ + if (nregs > cfun->va_list_gpr_size) + nregs = cfun->va_list_gpr_size; + } + else + { + /* char * va_list instead counts number of bytes needed. */ + if (nregs > cfun->va_list_gpr_size / reg_size) + nregs = cfun->va_list_gpr_size / reg_size; + } + mem = gen_rtx_MEM (BLKmode, plus_constant (save_area, first_reg_offset * reg_size)), @@ -5145,16 +5230,17 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, set_mem_align (mem, BITS_PER_WORD); rs6000_move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem, - GP_ARG_NUM_REG - first_reg_offset); + nregs); } /* Save FP registers if needed. */ if (DEFAULT_ABI == ABI_V4 && TARGET_HARD_FLOAT && TARGET_FPRS && ! no_rtl - && next_cum.fregno <= FP_ARG_V4_MAX_REG) + && next_cum.fregno <= FP_ARG_V4_MAX_REG + && cfun->va_list_fpr_size) { - int fregno = next_cum.fregno; + int fregno = next_cum.fregno, nregs; rtx cr1 = gen_rtx_REG (CCmode, CR1_REGNO); rtx lab = gen_label_rtx (); int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG) * 8); @@ -5168,14 +5254,14 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode, gen_rtx_LABEL_REF (VOIDmode, lab), pc_rtx))); - while (fregno <= FP_ARG_V4_MAX_REG) + for (nregs = 0; + fregno <= FP_ARG_V4_MAX_REG && nregs < cfun->va_list_fpr_size; + fregno++, off += 8, nregs++) { mem = gen_rtx_MEM (DFmode, plus_constant (save_area, off)); set_mem_alias_set (mem, set); set_mem_align (mem, GET_MODE_ALIGNMENT (DFmode)); emit_move_insn (mem, gen_rtx_REG (DFmode, fregno)); - fregno++; - off += 8; } emit_label (lab); @@ -5210,6 +5296,9 @@ rs6000_build_builtin_va_list (void) f_sav = build_decl (FIELD_DECL, get_identifier ("reg_save_area"), ptr_type_node); + va_list_gpr_counter_field = f_gpr; + va_list_fpr_counter_field = f_fpr; + DECL_FIELD_CONTEXT (f_gpr) = record; DECL_FIELD_CONTEXT (f_fpr) = record; DECL_FIELD_CONTEXT (f_res) = record; @@ -5270,15 +5359,21 @@ rs6000_va_start (tree valist, rtx nextarg) HOST_WIDE_INT_PRINT_DEC", n_fpr = "HOST_WIDE_INT_PRINT_DEC"\n", words, n_gpr, n_fpr); - t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, - build_int_cst (NULL_TREE, n_gpr)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_gpr_size) + { + t = build (MODIFY_EXPR, TREE_TYPE (gpr), gpr, + build_int_cst (NULL_TREE, n_gpr)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } - t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, - build_int_cst (NULL_TREE, n_fpr)); - TREE_SIDE_EFFECTS (t) = 1; - expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + if (cfun->va_list_fpr_size) + { + t = build (MODIFY_EXPR, TREE_TYPE (fpr), fpr, + build_int_cst (NULL_TREE, n_fpr)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } /* Find the overflow area. */ t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx); @@ -5289,6 +5384,14 @@ rs6000_va_start (tree valist, rtx nextarg) TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + /* If there were no va_arg invocations, don't set up the register + save area. */ + if (!cfun->va_list_gpr_size + && !cfun->va_list_fpr_size + && n_gpr < GP_ARG_NUM_REG + && n_fpr < FP_ARG_V4_MAX_REG) + return; + /* Find the register save area. */ t = make_tree (TREE_TYPE (sav), virtual_stack_vars_rtx); t = build (PLUS_EXPR, TREE_TYPE (sav), t, @@ -5467,19 +5570,26 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p) append_to_statement_list (t, pre_p); } - addr = fold_convert (ptrtype, addr); - return build_va_arg_indirect_ref (addr); + addr = fold_convert (ptrtype, addr); + return build_va_arg_indirect_ref (addr); +} + +/* Builtins. */ + +static void +def_builtin (int mask, const char *name, tree type, int code) +{ + if (mask & target_flags) + { + if (rs6000_builtin_decls[code]) + abort (); + + rs6000_builtin_decls[code] = + lang_hooks.builtin_function (name, type, code, BUILT_IN_MD, + NULL, NULL_TREE); + } } -/* Builtins. */ - -#define def_builtin(MASK, NAME, TYPE, CODE) \ -do { \ - if ((MASK) & target_flags) \ - lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \ - NULL, NULL_TREE); \ -} while (0) - /* Simple ternary operations: VECd = foo (VECa, VECb, VECc). */ static const struct builtin_description bdesc_3arg[] = @@ -5507,6 +5617,22 @@ static const struct builtin_description bdesc_3arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v8hi, "__builtin_altivec_vsldoi_8hi", ALTIVEC_BUILTIN_VSLDOI_8HI }, { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v4si, "__builtin_altivec_vsldoi_4si", ALTIVEC_BUILTIN_VSLDOI_4SI }, { MASK_ALTIVEC, CODE_FOR_altivec_vsldoi_v4sf, "__builtin_altivec_vsldoi_4sf", ALTIVEC_BUILTIN_VSLDOI_4SF }, + + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_madd", ALTIVEC_BUILTIN_VEC_MADD }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_madds", ALTIVEC_BUILTIN_VEC_MADDS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mladd", ALTIVEC_BUILTIN_VEC_MLADD }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mradds", ALTIVEC_BUILTIN_VEC_MRADDS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_msum", ALTIVEC_BUILTIN_VEC_MSUM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumshm", ALTIVEC_BUILTIN_VEC_VMSUMSHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumuhm", ALTIVEC_BUILTIN_VEC_VMSUMUHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsummbm", ALTIVEC_BUILTIN_VEC_VMSUMMBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumubm", ALTIVEC_BUILTIN_VEC_VMSUMUBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_msums", ALTIVEC_BUILTIN_VEC_MSUMS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumshs", ALTIVEC_BUILTIN_VEC_VMSUMSHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmsumuhs", ALTIVEC_BUILTIN_VEC_VMSUMUHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_nmsub", ALTIVEC_BUILTIN_VEC_NMSUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_perm", ALTIVEC_BUILTIN_VEC_PERM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sel", ALTIVEC_BUILTIN_VEC_SEL }, }; /* DST operations: void foo (void *, const int, const char). */ @@ -5516,7 +5642,12 @@ static const struct builtin_description bdesc_dst[] = { MASK_ALTIVEC, CODE_FOR_altivec_dst, "__builtin_altivec_dst", ALTIVEC_BUILTIN_DST }, { MASK_ALTIVEC, CODE_FOR_altivec_dstt, "__builtin_altivec_dstt", ALTIVEC_BUILTIN_DSTT }, { MASK_ALTIVEC, CODE_FOR_altivec_dstst, "__builtin_altivec_dstst", ALTIVEC_BUILTIN_DSTST }, - { MASK_ALTIVEC, CODE_FOR_altivec_dststt, "__builtin_altivec_dststt", ALTIVEC_BUILTIN_DSTSTT } + { MASK_ALTIVEC, CODE_FOR_altivec_dststt, "__builtin_altivec_dststt", ALTIVEC_BUILTIN_DSTSTT }, + + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dst", ALTIVEC_BUILTIN_VEC_DST }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dstt", ALTIVEC_BUILTIN_VEC_DSTT }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dstst", ALTIVEC_BUILTIN_VEC_DSTST }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_dststt", ALTIVEC_BUILTIN_VEC_DSTSTT } }; /* Simple binary operations: VECc = foo (VECa, VECb). */ @@ -5611,12 +5742,12 @@ static struct builtin_description bdesc_2arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vspltb, "__builtin_altivec_vspltb", ALTIVEC_BUILTIN_VSPLTB }, { MASK_ALTIVEC, CODE_FOR_altivec_vsplth, "__builtin_altivec_vsplth", ALTIVEC_BUILTIN_VSPLTH }, { MASK_ALTIVEC, CODE_FOR_altivec_vspltw, "__builtin_altivec_vspltw", ALTIVEC_BUILTIN_VSPLTW }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrb, "__builtin_altivec_vsrb", ALTIVEC_BUILTIN_VSRB }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrh, "__builtin_altivec_vsrh", ALTIVEC_BUILTIN_VSRH }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrw, "__builtin_altivec_vsrw", ALTIVEC_BUILTIN_VSRW }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrab, "__builtin_altivec_vsrab", ALTIVEC_BUILTIN_VSRAB }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsrah, "__builtin_altivec_vsrah", ALTIVEC_BUILTIN_VSRAH }, - { MASK_ALTIVEC, CODE_FOR_altivec_vsraw, "__builtin_altivec_vsraw", ALTIVEC_BUILTIN_VSRAW }, + { MASK_ALTIVEC, CODE_FOR_lshrv16qi3, "__builtin_altivec_vsrb", ALTIVEC_BUILTIN_VSRB }, + { MASK_ALTIVEC, CODE_FOR_lshrv8hi3, "__builtin_altivec_vsrh", ALTIVEC_BUILTIN_VSRH }, + { MASK_ALTIVEC, CODE_FOR_lshrv4si3, "__builtin_altivec_vsrw", ALTIVEC_BUILTIN_VSRW }, + { MASK_ALTIVEC, CODE_FOR_ashrv16qi3, "__builtin_altivec_vsrab", ALTIVEC_BUILTIN_VSRAB }, + { MASK_ALTIVEC, CODE_FOR_ashrv8hi3, "__builtin_altivec_vsrah", ALTIVEC_BUILTIN_VSRAH }, + { MASK_ALTIVEC, CODE_FOR_ashrv4si3, "__builtin_altivec_vsraw", ALTIVEC_BUILTIN_VSRAW }, { MASK_ALTIVEC, CODE_FOR_altivec_vsr, "__builtin_altivec_vsr", ALTIVEC_BUILTIN_VSR }, { MASK_ALTIVEC, CODE_FOR_altivec_vsro, "__builtin_altivec_vsro", ALTIVEC_BUILTIN_VSRO }, { MASK_ALTIVEC, CODE_FOR_subv16qi3, "__builtin_altivec_vsububm", ALTIVEC_BUILTIN_VSUBUBM }, @@ -5637,6 +5768,134 @@ static struct builtin_description bdesc_2arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vsumsws, "__builtin_altivec_vsumsws", ALTIVEC_BUILTIN_VSUMSWS }, { MASK_ALTIVEC, CODE_FOR_xorv4si3, "__builtin_altivec_vxor", ALTIVEC_BUILTIN_VXOR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_add", ALTIVEC_BUILTIN_VEC_ADD }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddfp", ALTIVEC_BUILTIN_VEC_VADDFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduwm", ALTIVEC_BUILTIN_VEC_VADDUWM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduhm", ALTIVEC_BUILTIN_VEC_VADDUHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddubm", ALTIVEC_BUILTIN_VEC_VADDUBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_addc", ALTIVEC_BUILTIN_VEC_ADDC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_adds", ALTIVEC_BUILTIN_VEC_ADDS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddsws", ALTIVEC_BUILTIN_VEC_VADDSWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduws", ALTIVEC_BUILTIN_VEC_VADDUWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddshs", ALTIVEC_BUILTIN_VEC_VADDSHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vadduhs", ALTIVEC_BUILTIN_VEC_VADDUHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddsbs", ALTIVEC_BUILTIN_VEC_VADDSBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vaddubs", ALTIVEC_BUILTIN_VEC_VADDUBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_and", ALTIVEC_BUILTIN_VEC_AND }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_andc", ALTIVEC_BUILTIN_VEC_ANDC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_avg", ALTIVEC_BUILTIN_VEC_AVG }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgsw", ALTIVEC_BUILTIN_VEC_VAVGSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavguw", ALTIVEC_BUILTIN_VEC_VAVGUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgsh", ALTIVEC_BUILTIN_VEC_VAVGSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavguh", ALTIVEC_BUILTIN_VEC_VAVGUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgsb", ALTIVEC_BUILTIN_VEC_VAVGSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vavgub", ALTIVEC_BUILTIN_VEC_VAVGUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpb", ALTIVEC_BUILTIN_VEC_CMPB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpeq", ALTIVEC_BUILTIN_VEC_CMPEQ }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpeqfp", ALTIVEC_BUILTIN_VEC_VCMPEQFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpequw", ALTIVEC_BUILTIN_VEC_VCMPEQUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpequh", ALTIVEC_BUILTIN_VEC_VCMPEQUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpequb", ALTIVEC_BUILTIN_VEC_VCMPEQUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpge", ALTIVEC_BUILTIN_VEC_CMPGE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmpgt", ALTIVEC_BUILTIN_VEC_CMPGT }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtfp", ALTIVEC_BUILTIN_VEC_VCMPGTFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtsw", ALTIVEC_BUILTIN_VEC_VCMPGTSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtuw", ALTIVEC_BUILTIN_VEC_VCMPGTUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtsh", ALTIVEC_BUILTIN_VEC_VCMPGTSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtuh", ALTIVEC_BUILTIN_VEC_VCMPGTUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtsb", ALTIVEC_BUILTIN_VEC_VCMPGTSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vcmpgtub", ALTIVEC_BUILTIN_VEC_VCMPGTUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmple", ALTIVEC_BUILTIN_VEC_CMPLE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_cmplt", ALTIVEC_BUILTIN_VEC_CMPLT }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_max", ALTIVEC_BUILTIN_VEC_MAX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxfp", ALTIVEC_BUILTIN_VEC_VMAXFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxsw", ALTIVEC_BUILTIN_VEC_VMAXSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxuw", ALTIVEC_BUILTIN_VEC_VMAXUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxsh", ALTIVEC_BUILTIN_VEC_VMAXSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxuh", ALTIVEC_BUILTIN_VEC_VMAXUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxsb", ALTIVEC_BUILTIN_VEC_VMAXSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmaxub", ALTIVEC_BUILTIN_VEC_VMAXUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mergeh", ALTIVEC_BUILTIN_VEC_MERGEH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrghw", ALTIVEC_BUILTIN_VEC_VMRGHW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrghh", ALTIVEC_BUILTIN_VEC_VMRGHH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrghb", ALTIVEC_BUILTIN_VEC_VMRGHB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mergel", ALTIVEC_BUILTIN_VEC_MERGEL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrglw", ALTIVEC_BUILTIN_VEC_VMRGLW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrglh", ALTIVEC_BUILTIN_VEC_VMRGLH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmrglb", ALTIVEC_BUILTIN_VEC_VMRGLB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_min", ALTIVEC_BUILTIN_VEC_MIN }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminfp", ALTIVEC_BUILTIN_VEC_VMINFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminsw", ALTIVEC_BUILTIN_VEC_VMINSW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminuw", ALTIVEC_BUILTIN_VEC_VMINUW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminsh", ALTIVEC_BUILTIN_VEC_VMINSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminuh", ALTIVEC_BUILTIN_VEC_VMINUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminsb", ALTIVEC_BUILTIN_VEC_VMINSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vminub", ALTIVEC_BUILTIN_VEC_VMINUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mule", ALTIVEC_BUILTIN_VEC_MULE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmuleub", ALTIVEC_BUILTIN_VEC_VMULEUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulesb", ALTIVEC_BUILTIN_VEC_VMULESB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmuleuh", ALTIVEC_BUILTIN_VEC_VMULEUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulesh", ALTIVEC_BUILTIN_VEC_VMULESH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mulo", ALTIVEC_BUILTIN_VEC_MULO }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulosh", ALTIVEC_BUILTIN_VEC_VMULOSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulouh", ALTIVEC_BUILTIN_VEC_VMULOUH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmulosb", ALTIVEC_BUILTIN_VEC_VMULOSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vmuloub", ALTIVEC_BUILTIN_VEC_VMULOUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_nor", ALTIVEC_BUILTIN_VEC_NOR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_or", ALTIVEC_BUILTIN_VEC_OR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_pack", ALTIVEC_BUILTIN_VEC_PACK }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuwum", ALTIVEC_BUILTIN_VEC_VPKUWUM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuhum", ALTIVEC_BUILTIN_VEC_VPKUHUM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_packpx", ALTIVEC_BUILTIN_VEC_PACKPX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_packs", ALTIVEC_BUILTIN_VEC_PACKS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkswss", ALTIVEC_BUILTIN_VEC_VPKSWSS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuwus", ALTIVEC_BUILTIN_VEC_VPKUWUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkshss", ALTIVEC_BUILTIN_VEC_VPKSHSS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkuhus", ALTIVEC_BUILTIN_VEC_VPKUHUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_packsu", ALTIVEC_BUILTIN_VEC_PACKSU }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkswus", ALTIVEC_BUILTIN_VEC_VPKSWUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vpkshus", ALTIVEC_BUILTIN_VEC_VPKSHUS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_rl", ALTIVEC_BUILTIN_VEC_RL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vrlw", ALTIVEC_BUILTIN_VEC_VRLW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vrlh", ALTIVEC_BUILTIN_VEC_VRLH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vrlb", ALTIVEC_BUILTIN_VEC_VRLB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sl", ALTIVEC_BUILTIN_VEC_SL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vslw", ALTIVEC_BUILTIN_VEC_VSLW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vslh", ALTIVEC_BUILTIN_VEC_VSLH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vslb", ALTIVEC_BUILTIN_VEC_VSLB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sll", ALTIVEC_BUILTIN_VEC_SLL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_slo", ALTIVEC_BUILTIN_VEC_SLO }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sr", ALTIVEC_BUILTIN_VEC_SR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrw", ALTIVEC_BUILTIN_VEC_VSRW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrh", ALTIVEC_BUILTIN_VEC_VSRH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrb", ALTIVEC_BUILTIN_VEC_VSRB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sra", ALTIVEC_BUILTIN_VEC_SRA }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsraw", ALTIVEC_BUILTIN_VEC_VSRAW }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrah", ALTIVEC_BUILTIN_VEC_VSRAH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsrab", ALTIVEC_BUILTIN_VEC_VSRAB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_srl", ALTIVEC_BUILTIN_VEC_SRL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sro", ALTIVEC_BUILTIN_VEC_SRO }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sub", ALTIVEC_BUILTIN_VEC_SUB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubfp", ALTIVEC_BUILTIN_VEC_VSUBFP }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuwm", ALTIVEC_BUILTIN_VEC_VSUBUWM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuhm", ALTIVEC_BUILTIN_VEC_VSUBUHM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsububm", ALTIVEC_BUILTIN_VEC_VSUBUBM }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_subc", ALTIVEC_BUILTIN_VEC_SUBC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_subs", ALTIVEC_BUILTIN_VEC_SUBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubsws", ALTIVEC_BUILTIN_VEC_VSUBSWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuws", ALTIVEC_BUILTIN_VEC_VSUBUWS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubshs", ALTIVEC_BUILTIN_VEC_VSUBSHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubuhs", ALTIVEC_BUILTIN_VEC_VSUBUHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsubsbs", ALTIVEC_BUILTIN_VEC_VSUBSBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsububs", ALTIVEC_BUILTIN_VEC_VSUBUBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sum4s", ALTIVEC_BUILTIN_VEC_SUM4S }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsum4shs", ALTIVEC_BUILTIN_VEC_VSUM4SHS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsum4sbs", ALTIVEC_BUILTIN_VEC_VSUM4SBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vsum4ubs", ALTIVEC_BUILTIN_VEC_VSUM4UBS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sum2s", ALTIVEC_BUILTIN_VEC_SUM2S }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_sums", ALTIVEC_BUILTIN_VEC_SUMS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_xor", ALTIVEC_BUILTIN_VEC_XOR }, + /* Place holder, leave as first spe builtin. */ { 0, CODE_FOR_spe_evaddw, "__builtin_spe_evaddw", SPE_BUILTIN_EVADDW }, { 0, CODE_FOR_spe_evand, "__builtin_spe_evand", SPE_BUILTIN_EVAND }, @@ -5779,7 +6038,7 @@ static struct builtin_description bdesc_2arg[] = { 0, CODE_FOR_spe_brinc, "__builtin_spe_brinc", SPE_BUILTIN_BRINC }, /* Place-holder. Leave as last binary SPE builtin. */ - { 0, CODE_FOR_xorv2si3, "__builtin_spe_evxor", SPE_BUILTIN_EVXOR }, + { 0, CODE_FOR_xorv2si3, "__builtin_spe_evxor", SPE_BUILTIN_EVXOR } }; /* AltiVec predicates. */ @@ -5807,7 +6066,11 @@ static const struct builtin_description_predicates bdesc_altivec_preds[] = { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v8hi, "*vcmpequh.", "__builtin_altivec_vcmpequh_p", ALTIVEC_BUILTIN_VCMPEQUH_P }, { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpequb.", "__builtin_altivec_vcmpequb_p", ALTIVEC_BUILTIN_VCMPEQUB_P }, { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpgtsb.", "__builtin_altivec_vcmpgtsb_p", ALTIVEC_BUILTIN_VCMPGTSB_P }, - { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpgtub.", "__builtin_altivec_vcmpgtub_p", ALTIVEC_BUILTIN_VCMPGTUB_P } + { MASK_ALTIVEC, CODE_FOR_altivec_predicate_v16qi, "*vcmpgtub.", "__builtin_altivec_vcmpgtub_p", ALTIVEC_BUILTIN_VCMPGTUB_P }, + + { MASK_ALTIVEC, 0, NULL, "__builtin_vec_vcmpeq_p", ALTIVEC_BUILTIN_VCMPEQ_P }, + { MASK_ALTIVEC, 0, NULL, "__builtin_vec_vcmpgt_p", ALTIVEC_BUILTIN_VCMPGT_P }, + { MASK_ALTIVEC, 0, NULL, "__builtin_vec_vcmpge_p", ALTIVEC_BUILTIN_VCMPGE_P } }; /* SPE predicates. */ @@ -5882,6 +6145,26 @@ static struct builtin_description bdesc_1arg[] = { MASK_ALTIVEC, CODE_FOR_altivec_vupklpx, "__builtin_altivec_vupklpx", ALTIVEC_BUILTIN_VUPKLPX }, { MASK_ALTIVEC, CODE_FOR_altivec_vupklsh, "__builtin_altivec_vupklsh", ALTIVEC_BUILTIN_VUPKLSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_abs", ALTIVEC_BUILTIN_VEC_ABS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_abss", ALTIVEC_BUILTIN_VEC_ABSS }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_ceil", ALTIVEC_BUILTIN_VEC_CEIL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_expte", ALTIVEC_BUILTIN_VEC_EXPTE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_floor", ALTIVEC_BUILTIN_VEC_FLOOR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_loge", ALTIVEC_BUILTIN_VEC_LOGE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_mtvscr", ALTIVEC_BUILTIN_VEC_MTVSCR }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_re", ALTIVEC_BUILTIN_VEC_RE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_round", ALTIVEC_BUILTIN_VEC_ROUND }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_rsqrte", ALTIVEC_BUILTIN_VEC_RSQRTE }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_trunc", ALTIVEC_BUILTIN_VEC_TRUNC }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_unpackh", ALTIVEC_BUILTIN_VEC_UNPACKH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupkhsh", ALTIVEC_BUILTIN_VEC_VUPKHSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupkhpx", ALTIVEC_BUILTIN_VEC_VUPKHPX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupkhsb", ALTIVEC_BUILTIN_VEC_VUPKHSB }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_unpackl", ALTIVEC_BUILTIN_VEC_UNPACKL }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupklpx", ALTIVEC_BUILTIN_VEC_VUPKLPX }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupklsh", ALTIVEC_BUILTIN_VEC_VUPKLSH }, + { MASK_ALTIVEC, CODE_FOR_nothing, "__builtin_vec_vupklsb", ALTIVEC_BUILTIN_VEC_VUPKLSB }, + /* The SPE unary builtins must start with SPE_BUILTIN_EVABS and end with SPE_BUILTIN_EVSUBFUSIAAW. */ { 0, CODE_FOR_spe_evabs, "__builtin_spe_evabs", SPE_BUILTIN_EVABS }, @@ -5914,7 +6197,7 @@ static struct builtin_description bdesc_1arg[] = { 0, CODE_FOR_spe_evsubfumiaaw, "__builtin_spe_evsubfumiaaw", SPE_BUILTIN_EVSUBFUMIAAW }, /* Place-holder. Leave as last unary SPE builtin. */ - { 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW }, + { 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW } }; static rtx @@ -6094,8 +6377,7 @@ altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode, else cr6_form_int = TREE_INT_CST_LOW (cr6_form); - if (mode0 != mode1) - abort (); + gcc_assert (mode0 == mode1); /* If we have invalid arguments, bail out before generating bad rtl. */ if (arg0 == error_mark_node || arg1 == error_mark_node) @@ -6511,6 +6793,14 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) enum machine_mode tmode, mode0; unsigned int fcode = DECL_FUNCTION_CODE (fndecl); + if (fcode >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && fcode <= ALTIVEC_BUILTIN_OVERLOADED_LAST) + { + *expandedp = true; + error ("unresolved overload for Altivec builtin %qE", fndecl); + return const0_rtx; + } + target = altivec_expand_ld_builtin (exp, target, expandedp); if (*expandedp) return target; @@ -6598,16 +6888,6 @@ altivec_expand_builtin (tree exp, rtx target, bool *expandedp) emit_insn (gen_altivec_dss (op0)); return NULL_RTX; - - case ALTIVEC_BUILTIN_COMPILETIME_ERROR: - arg0 = TREE_VALUE (arglist); - while (TREE_CODE (arg0) == NOP_EXPR || TREE_CODE (arg0) == ADDR_EXPR - || TREE_CODE (arg0) == ARRAY_REF) - arg0 = TREE_OPERAND (arg0, 0); - error ("invalid parameter combination for %qs AltiVec intrinsic", - TREE_STRING_POINTER (arg0)); - - return const0_rtx; } /* Expand abs* operations. */ @@ -6844,8 +7124,7 @@ spe_expand_predicate_builtin (enum insn_code icode, tree arglist, rtx target) else form_int = TREE_INT_CST_LOW (form); - if (mode0 != mode1) - abort (); + gcc_assert (mode0 == mode1); if (arg0 == error_mark_node || arg1 == error_mark_node) return const0_rtx; @@ -6894,7 +7173,7 @@ spe_expand_predicate_builtin (enum insn_code icode, tree arglist, rtx target) case 0: /* We need to get to the OV bit, which is the ORDERED bit. We could generate (ordered:SI (reg:CC xx) (const_int 0)), but - that's ugly and will trigger a validate_condition_mode abort. + that's ugly and will make validate_condition_mode die. So let's just use another pattern. */ emit_insn (gen_move_from_CR_ov_bit (target, scratch)); return target; @@ -6946,8 +7225,7 @@ spe_expand_evsel_builtin (enum insn_code icode, tree arglist, rtx target) enum machine_mode mode0 = insn_data[icode].operand[1].mode; enum machine_mode mode1 = insn_data[icode].operand[2].mode; - if (mode0 != mode1) - abort (); + gcc_assert (mode0 == mode1); if (arg0 == error_mark_node || arg1 == error_mark_node || arg2 == error_mark_node || arg3 == error_mark_node) @@ -7010,12 +7288,10 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, tree arg; rtx op, addr, pat; - if (!TARGET_ALTIVEC) - abort (); + gcc_assert (TARGET_ALTIVEC); arg = TREE_VALUE (arglist); - if (TREE_CODE (TREE_TYPE (arg)) != POINTER_TYPE) - abort (); + gcc_assert (TREE_CODE (TREE_TYPE (arg)) == POINTER_TYPE); op = expand_expr (arg, NULL_RTX, Pmode, EXPAND_NORMAL); addr = memory_address (mode, op); if (fcode == ALTIVEC_BUILTIN_MASK_FOR_STORE) @@ -7058,29 +7334,27 @@ rs6000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, return ret; } - if (TARGET_ALTIVEC || TARGET_SPE) - { - /* Handle simple unary operations. */ - d = (struct builtin_description *) bdesc_1arg; - for (i = 0; i < ARRAY_SIZE (bdesc_1arg); i++, d++) - if (d->code == fcode) - return rs6000_expand_unop_builtin (d->icode, arglist, target); - - /* Handle simple binary operations. */ - d = (struct builtin_description *) bdesc_2arg; - for (i = 0; i < ARRAY_SIZE (bdesc_2arg); i++, d++) - if (d->code == fcode) - return rs6000_expand_binop_builtin (d->icode, arglist, target); - - /* Handle simple ternary operations. */ - d = (struct builtin_description *) bdesc_3arg; - for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) - if (d->code == fcode) - return rs6000_expand_ternop_builtin (d->icode, arglist, target); - } + gcc_assert (TARGET_ALTIVEC || TARGET_SPE); + + /* Handle simple unary operations. */ + d = (struct builtin_description *) bdesc_1arg; + for (i = 0; i < ARRAY_SIZE (bdesc_1arg); i++, d++) + if (d->code == fcode) + return rs6000_expand_unop_builtin (d->icode, arglist, target); + + /* Handle simple binary operations. */ + d = (struct builtin_description *) bdesc_2arg; + for (i = 0; i < ARRAY_SIZE (bdesc_2arg); i++, d++) + if (d->code == fcode) + return rs6000_expand_binop_builtin (d->icode, arglist, target); - abort (); - return NULL_RTX; + /* Handle simple ternary operations. */ + d = (struct builtin_description *) bdesc_3arg; + for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) + if (d->code == fcode) + return rs6000_expand_ternop_builtin (d->icode, arglist, target); + + gcc_unreachable (); } static tree @@ -7109,6 +7383,7 @@ rs6000_init_builtins (void) opaque_V2SF_type_node = build_opaque_vector_type (float_type_node, 2); opaque_V2SI_type_node = build_opaque_vector_type (intSI_type_node, 2); opaque_p_V2SI_type_node = build_pointer_type (opaque_V2SI_type_node); + opaque_V4SI_type_node = copy_node (V4SI_type_node); /* The 'vector bool ...' types must be kept distinct from 'vector unsigned ...' types, especially in C++ land. Similarly, 'vector pixel' is distinct from @@ -7119,6 +7394,17 @@ rs6000_init_builtins (void) bool_int_type_node = build_distinct_type_copy (unsigned_intSI_type_node); pixel_type_node = build_distinct_type_copy (unsigned_intHI_type_node); + long_integer_type_internal_node = long_integer_type_node; + long_unsigned_type_internal_node = long_unsigned_type_node; + intQI_type_internal_node = intQI_type_node; + uintQI_type_internal_node = unsigned_intQI_type_node; + intHI_type_internal_node = intHI_type_node; + uintHI_type_internal_node = unsigned_intHI_type_node; + intSI_type_internal_node = intSI_type_node; + uintSI_type_internal_node = unsigned_intSI_type_node; + float_type_internal_node = float_type_node; + void_type_internal_node = void_type_node; + (*lang_hooks.decls.pushdecl) (build_decl (TYPE_DECL, get_identifier ("__bool char"), bool_char_type_node)); @@ -7401,7 +7687,7 @@ spe_init_builtins (void) type = int_ftype_int_v2sf_v2sf; break; default: - abort (); + gcc_unreachable (); } def_builtin (d->mask, d->name, type, d->code); @@ -7422,7 +7708,7 @@ spe_init_builtins (void) type = v2sf_ftype_4_v2sf; break; default: - abort (); + gcc_unreachable (); } def_builtin (d->mask, d->name, type, d->code); @@ -7449,6 +7735,21 @@ altivec_init_builtins (void) tree pcvoid_type_node = build_pointer_type (build_qualified_type (void_type_node, TYPE_QUAL_CONST)); + tree int_ftype_opaque + = build_function_type_list (integer_type_node, + opaque_V4SI_type_node, NULL_TREE); + + tree opaque_ftype_opaque_int + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_opaque_opaque_int + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, opaque_V4SI_type_node, + integer_type_node, NULL_TREE); + tree int_ftype_int_opaque_opaque + = build_function_type_list (integer_type_node, + integer_type_node, opaque_V4SI_type_node, + opaque_V4SI_type_node, NULL_TREE); tree int_ftype_int_v4si_v4si = build_function_type_list (integer_type_node, integer_type_node, V4SI_type_node, @@ -7482,6 +7783,9 @@ altivec_init_builtins (void) tree void_ftype_int = build_function_type_list (void_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_long_pcvoid + = build_function_type_list (opaque_V4SI_type_node, + long_integer_type_node, pcvoid_type_node, NULL_TREE); tree v16qi_ftype_long_pcvoid = build_function_type_list (V16QI_type_node, long_integer_type_node, pcvoid_type_node, NULL_TREE); @@ -7492,6 +7796,10 @@ altivec_init_builtins (void) = build_function_type_list (V4SI_type_node, long_integer_type_node, pcvoid_type_node, NULL_TREE); + tree void_ftype_opaque_long_pvoid + = build_function_type_list (void_type_node, + opaque_V4SI_type_node, long_integer_type_node, + pvoid_type_node, NULL_TREE); tree void_ftype_v4si_long_pvoid = build_function_type_list (void_type_node, V4SI_type_node, long_integer_type_node, @@ -7528,9 +7836,6 @@ altivec_init_builtins (void) = build_function_type_list (void_type_node, pcvoid_type_node, integer_type_node, integer_type_node, NULL_TREE); - tree int_ftype_pcchar - = build_function_type_list (integer_type_node, - pcchar_type_node, NULL_TREE); def_builtin (MASK_ALTIVEC, "__builtin_altivec_ld_internal_4sf", v4sf_ftype_pcfloat, ALTIVEC_BUILTIN_LD_INTERNAL_4sf); @@ -7564,10 +7869,33 @@ altivec_init_builtins (void) def_builtin (MASK_ALTIVEC, "__builtin_altivec_stvxl", void_ftype_v4si_long_pvoid, ALTIVEC_BUILTIN_STVXL); def_builtin (MASK_ALTIVEC, "__builtin_altivec_stvebx", void_ftype_v16qi_long_pvoid, ALTIVEC_BUILTIN_STVEBX); def_builtin (MASK_ALTIVEC, "__builtin_altivec_stvehx", void_ftype_v8hi_long_pvoid, ALTIVEC_BUILTIN_STVEHX); - - /* See altivec.h for usage of "__builtin_altivec_compiletime_error". */ - def_builtin (MASK_ALTIVEC, "__builtin_altivec_compiletime_error", int_ftype_pcchar, - ALTIVEC_BUILTIN_COMPILETIME_ERROR); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ld", opaque_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LD); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lde", opaque_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LDE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ldl", opaque_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LDL); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvsl", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVSL); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvsr", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVSR); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvebx", v16qi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVEBX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvehx", v8hi_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVEHX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_lvewx", v4si_ftype_long_pcvoid, ALTIVEC_BUILTIN_VEC_LVEWX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_st", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_ST); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ste", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STE); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stl", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STL); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stvewx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEWX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stvebx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEBX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_stvehx", void_ftype_opaque_long_pvoid, ALTIVEC_BUILTIN_VEC_STVEHX); + + def_builtin (MASK_ALTIVEC, "__builtin_vec_step", int_ftype_opaque, ALTIVEC_BUILTIN_VEC_STEP); + + def_builtin (MASK_ALTIVEC, "__builtin_vec_sld", opaque_ftype_opaque_opaque_int, ALTIVEC_BUILTIN_VEC_SLD); + def_builtin (MASK_ALTIVEC, "__builtin_vec_splat", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_SPLAT); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vspltw", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VSPLTW); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vsplth", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VSPLTH); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vspltb", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VSPLTB); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ctf", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_CTF); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vcfsx", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VCFSX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_vcfux", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_VCFUX); + def_builtin (MASK_ALTIVEC, "__builtin_vec_cts", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_CTS); + def_builtin (MASK_ALTIVEC, "__builtin_vec_ctu", opaque_ftype_opaque_int, ALTIVEC_BUILTIN_VEC_CTU); /* Add the DST variants. */ d = (struct builtin_description *) bdesc_dst; @@ -7580,11 +7908,19 @@ altivec_init_builtins (void) { enum machine_mode mode1; tree type; + bool is_overloaded = dp->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && dp->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; - mode1 = insn_data[dp->icode].operand[1].mode; + if (is_overloaded) + mode1 = VOIDmode; + else + mode1 = insn_data[dp->icode].operand[1].mode; switch (mode1) { + case VOIDmode: + type = int_ftype_int_opaque_opaque; + break; case V4SImode: type = int_ftype_int_v4si_v4si; break; @@ -7598,7 +7934,7 @@ altivec_init_builtins (void) type = int_ftype_int_v4sf_v4sf; break; default: - abort (); + gcc_unreachable (); } def_builtin (dp->mask, dp->name, type, dp->code); @@ -7628,7 +7964,7 @@ altivec_init_builtins (void) type = v4sf_ftype_v4sf; break; default: - abort (); + gcc_unreachable (); } def_builtin (d->mask, d->name, type, d->code); @@ -7642,9 +7978,11 @@ altivec_init_builtins (void) targetm.vectorize.builtin_mask_for_load. */ decl = lang_hooks.builtin_function ("__builtin_altivec_mask_for_load", - v16qi_ftype_long_pcvoid, - ALTIVEC_BUILTIN_MASK_FOR_LOAD, - BUILT_IN_MD, NULL, NULL_TREE); + v16qi_ftype_long_pcvoid, + ALTIVEC_BUILTIN_MASK_FOR_LOAD, + BUILT_IN_MD, NULL, + tree_cons (get_identifier ("const"), + NULL_TREE, NULL_TREE)); /* Record the decl. Will be used by rs6000_builtin_mask_for_load. */ altivec_builtin_mask_for_load = decl; } @@ -7698,6 +8036,10 @@ rs6000_common_init_builtins (void) integer_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_opaque + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, NULL_TREE); + tree v2si_ftype_v2si = build_function_type_list (opaque_V2SI_type_node, opaque_V2SI_type_node, NULL_TREE); @@ -7732,6 +8074,9 @@ rs6000_common_init_builtins (void) integer_type_node, integer_type_node, NULL_TREE); + tree opaque_ftype_opaque_opaque + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, opaque_V4SI_type_node, NULL_TREE); tree v4si_ftype_v4si_v4si = build_function_type_list (V4SI_type_node, V4SI_type_node, V4SI_type_node, NULL_TREE); @@ -7769,6 +8114,10 @@ rs6000_common_init_builtins (void) tree v4sf_ftype_v4sf_v4sf = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, NULL_TREE); + tree opaque_ftype_opaque_opaque_opaque + = build_function_type_list (opaque_V4SI_type_node, + opaque_V4SI_type_node, opaque_V4SI_type_node, + opaque_V4SI_type_node, NULL_TREE); tree v4sf_ftype_v4sf_v4sf_v4si = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, @@ -7842,23 +8191,37 @@ rs6000_common_init_builtins (void) d = (struct builtin_description *) bdesc_3arg; for (i = 0; i < ARRAY_SIZE (bdesc_3arg); i++, d++) { - enum machine_mode mode0, mode1, mode2, mode3; tree type; + bool is_overloaded = d->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && d->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; - if (d->name == 0 || d->icode == CODE_FOR_nothing) - continue; - - mode0 = insn_data[d->icode].operand[0].mode; - mode1 = insn_data[d->icode].operand[1].mode; - mode2 = insn_data[d->icode].operand[2].mode; - mode3 = insn_data[d->icode].operand[3].mode; + if (is_overloaded) + { + mode0 = VOIDmode; + mode1 = VOIDmode; + mode2 = VOIDmode; + mode3 = VOIDmode; + } + else + { + if (d->name == 0 || d->icode == CODE_FOR_nothing) + continue; + mode0 = insn_data[d->icode].operand[0].mode; + mode1 = insn_data[d->icode].operand[1].mode; + mode2 = insn_data[d->icode].operand[2].mode; + mode3 = insn_data[d->icode].operand[3].mode; + } + /* When all four are of the same mode. */ if (mode0 == mode1 && mode1 == mode2 && mode2 == mode3) { switch (mode0) { + case VOIDmode: + type = opaque_ftype_opaque_opaque_opaque; + break; case V4SImode: type = v4si_ftype_v4si_v4si_v4si; break; @@ -7872,7 +8235,7 @@ rs6000_common_init_builtins (void) type = v16qi_ftype_v16qi_v16qi_v16qi; break; default: - abort (); + gcc_unreachable (); } } else if (mode0 == mode1 && mode1 == mode2 && mode3 == V16QImode) @@ -7892,7 +8255,7 @@ rs6000_common_init_builtins (void) type = v16qi_ftype_v16qi_v16qi_v16qi; break; default: - abort (); + gcc_unreachable (); } } else if (mode0 == V4SImode && mode1 == V16QImode && mode2 == V16QImode @@ -7926,7 +8289,7 @@ rs6000_common_init_builtins (void) type = v4sf_ftype_v4sf_v4sf_int; else - abort (); + gcc_unreachable (); def_builtin (d->mask, d->name, type, d->code); } @@ -7937,19 +8300,33 @@ rs6000_common_init_builtins (void) { enum machine_mode mode0, mode1, mode2; tree type; + bool is_overloaded = d->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && d->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; - if (d->name == 0 || d->icode == CODE_FOR_nothing) - continue; + if (is_overloaded) + { + mode0 = VOIDmode; + mode1 = VOIDmode; + mode2 = VOIDmode; + } + else + { + if (d->name == 0 || d->icode == CODE_FOR_nothing) + continue; - mode0 = insn_data[d->icode].operand[0].mode; - mode1 = insn_data[d->icode].operand[1].mode; - mode2 = insn_data[d->icode].operand[2].mode; + mode0 = insn_data[d->icode].operand[0].mode; + mode1 = insn_data[d->icode].operand[1].mode; + mode2 = insn_data[d->icode].operand[2].mode; + } /* When all three operands are of the same mode. */ if (mode0 == mode1 && mode1 == mode2) { switch (mode0) { + case VOIDmode: + type = opaque_ftype_opaque_opaque; + break; case V4SFmode: type = v4sf_ftype_v4sf_v4sf; break; @@ -7972,7 +8349,7 @@ rs6000_common_init_builtins (void) type = int_ftype_int_int; break; default: - abort (); + gcc_unreachable (); } } @@ -8039,9 +8416,10 @@ rs6000_common_init_builtins (void) else if (mode0 == V2SImode && mode1 == SImode && mode2 == QImode) type = v2si_ftype_int_char; - /* int, x, x. */ - else if (mode0 == SImode) + else { + /* int, x, x. */ + gcc_assert (mode0 == SImode); switch (mode1) { case V4SImode: @@ -8057,13 +8435,10 @@ rs6000_common_init_builtins (void) type = int_ftype_v8hi_v8hi; break; default: - abort (); + gcc_unreachable (); } } - else - abort (); - def_builtin (d->mask, d->name, type, d->code); } @@ -8073,12 +8448,22 @@ rs6000_common_init_builtins (void) { enum machine_mode mode0, mode1; tree type; - - if (d->name == 0 || d->icode == CODE_FOR_nothing) - continue; - - mode0 = insn_data[d->icode].operand[0].mode; - mode1 = insn_data[d->icode].operand[1].mode; + bool is_overloaded = d->code >= ALTIVEC_BUILTIN_OVERLOADED_FIRST + && d->code <= ALTIVEC_BUILTIN_OVERLOADED_LAST; + + if (is_overloaded) + { + mode0 = VOIDmode; + mode1 = VOIDmode; + } + else + { + if (d->name == 0 || d->icode == CODE_FOR_nothing) + continue; + + mode0 = insn_data[d->icode].operand[0].mode; + mode1 = insn_data[d->icode].operand[1].mode; + } if (mode0 == V4SImode && mode1 == QImode) type = v4si_ftype_int; @@ -8086,6 +8471,8 @@ rs6000_common_init_builtins (void) type = v8hi_ftype_int; else if (mode0 == V16QImode && mode1 == QImode) type = v16qi_ftype_int; + else if (mode0 == VOIDmode && mode1 == VOIDmode) + type = opaque_ftype_opaque; else if (mode0 == V4SFmode && mode1 == V4SFmode) type = v4sf_ftype_v4sf; else if (mode0 == V8HImode && mode1 == V16QImode) @@ -8103,7 +8490,7 @@ rs6000_common_init_builtins (void) else if (mode0 == V2SImode && mode1 == QImode) type = v2si_ftype_char; else - abort (); + gcc_unreachable (); def_builtin (d->mask, d->name, type, d->code); } @@ -8126,11 +8513,21 @@ rs6000_init_libfuncs (void) set_conv_libfunc (ufix_optab, SImode, TFmode, "_quitrunc"); } - /* Standard AIX/Darwin/64-bit SVR4 quad floating point routines. */ - set_optab_libfunc (add_optab, TFmode, "__gcc_qadd"); - set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub"); - set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul"); - set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv"); + /* AIX/Darwin/64-bit Linux quad floating point routines. */ + if (!TARGET_XL_COMPAT) + { + set_optab_libfunc (add_optab, TFmode, "__gcc_qadd"); + set_optab_libfunc (sub_optab, TFmode, "__gcc_qsub"); + set_optab_libfunc (smul_optab, TFmode, "__gcc_qmul"); + set_optab_libfunc (sdiv_optab, TFmode, "__gcc_qdiv"); + } + else + { + set_optab_libfunc (add_optab, TFmode, "_xlqadd"); + set_optab_libfunc (sub_optab, TFmode, "_xlqsub"); + set_optab_libfunc (smul_optab, TFmode, "_xlqmul"); + set_optab_libfunc (sdiv_optab, TFmode, "_xlqdiv"); + } } else { @@ -8186,9 +8583,8 @@ expand_block_clear (rtx operands[]) if (! constp) return 0; - /* If this is not a fixed size alignment, abort */ - if (GET_CODE (align_rtx) != CONST_INT) - abort (); + /* This must be a fixed size alignment */ + gcc_assert (GET_CODE (align_rtx) == CONST_INT); align = INTVAL (align_rtx) * BITS_PER_UNIT; /* Anything to clear? */ @@ -8284,9 +8680,8 @@ expand_block_move (rtx operands[]) if (! constp) return 0; - /* If this is not a fixed size alignment, abort */ - if (GET_CODE (align_rtx) != CONST_INT) - abort (); + /* This must be a fixed size alignment */ + gcc_assert (GET_CODE (align_rtx) == CONST_INT); align = INTVAL (align_rtx) * BITS_PER_UNIT; /* Anything to move? */ @@ -8502,40 +8897,33 @@ rs6000_output_load_multiple (rtx operands[3]) void validate_condition_mode (enum rtx_code code, enum machine_mode mode) { - if ((GET_RTX_CLASS (code) != RTX_COMPARE - && GET_RTX_CLASS (code) != RTX_COMM_COMPARE) - || GET_MODE_CLASS (mode) != MODE_CC) - abort (); + gcc_assert ((GET_RTX_CLASS (code) == RTX_COMPARE + || GET_RTX_CLASS (code) == RTX_COMM_COMPARE) + && GET_MODE_CLASS (mode) == MODE_CC); /* These don't make sense. */ - if ((code == GT || code == LT || code == GE || code == LE) - && mode == CCUNSmode) - abort (); + gcc_assert ((code != GT && code != LT && code != GE && code != LE) + || mode != CCUNSmode); - if ((code == GTU || code == LTU || code == GEU || code == LEU) - && mode != CCUNSmode) - abort (); + gcc_assert ((code != GTU && code != LTU && code != GEU && code != LEU) + || mode == CCUNSmode); - if (mode != CCFPmode - && (code == ORDERED || code == UNORDERED - || code == UNEQ || code == LTGT - || code == UNGT || code == UNLT - || code == UNGE || code == UNLE)) - abort (); + gcc_assert (mode == CCFPmode + || (code != ORDERED && code != UNORDERED + && code != UNEQ && code != LTGT + && code != UNGT && code != UNLT + && code != UNGE && code != UNLE)); /* These should never be generated except for flag_finite_math_only. */ - if (mode == CCFPmode - && ! flag_finite_math_only - && (code == LE || code == GE - || code == UNEQ || code == LTGT - || code == UNGT || code == UNLT)) - abort (); + gcc_assert (mode != CCFPmode + || flag_finite_math_only + || (code != LE && code != GE + && code != UNEQ && code != LTGT + && code != UNGT && code != UNLT)); /* These are invalid; the information is not there. */ - if (mode == CCEQmode - && code != EQ && code != NE) - abort (); + gcc_assert (mode != CCEQmode || code == EQ || code == NE); } @@ -8930,9 +9318,7 @@ ccr_bit (rtx op, int scc_p) reg = XEXP (op, 0); - if (GET_CODE (reg) != REG - || ! CR_REGNO_P (REGNO (reg))) - abort (); + gcc_assert (GET_CODE (reg) == REG && CR_REGNO_P (REGNO (reg))); cc_mode = GET_MODE (reg); cc_regnum = REGNO (reg); @@ -8942,9 +9328,9 @@ ccr_bit (rtx op, int scc_p) /* When generating a sCOND operation, only positive conditions are allowed. */ - if (scc_p && code != EQ && code != GT && code != LT && code != UNORDERED - && code != GTU && code != LTU) - abort (); + gcc_assert (!scc_p + || code == EQ || code == GT || code == LT || code == UNORDERED + || code == GTU || code == LTU); switch (code) { @@ -8969,7 +9355,7 @@ ccr_bit (rtx op, int scc_p) return scc_p ? base_bit + 3 : base_bit + 1; default: - abort (); + gcc_unreachable (); } } @@ -9017,8 +9403,7 @@ extract_MB (rtx op) from the left. */ if ((val & 0x80000000) == 0) { - if ((val & 0xffffffff) == 0) - abort (); + gcc_assert (val & 0xffffffff); i = 1; while (((val <<= 1) & 0x80000000) == 0) @@ -9050,8 +9435,7 @@ extract_ME (rtx op) the right. */ if ((val & 1) == 0) { - if ((val & 0xffffffff) == 0) - abort (); + gcc_assert (val & 0xffffffff); i = 30; while (((val >>= 1) & 1) == 0) @@ -9091,7 +9475,7 @@ rs6000_get_some_local_dynamic_name (void) rs6000_get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } /* Helper function for rs6000_get_some_local_dynamic_name. */ @@ -9124,7 +9508,7 @@ rs6000_output_function_entry (FILE *file, const char *fname) switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); case ABI_AIX: if (DOT_SYMBOLS) @@ -9210,8 +9594,7 @@ print_operand (FILE *file, rtx x, int code) case 'D': /* Like 'J' but get to the EQ bit. */ - if (GET_CODE (x) != REG) - abort (); + gcc_assert (GET_CODE (x) == REG); /* Bit 1 is EQ bit. */ i = 4 * (REGNO (x) - CR0_REGNO) + 2; @@ -9503,15 +9886,13 @@ print_operand (FILE *file, rtx x, int code) } while (uval != 0) --i, uval >>= 1; - if (i < 0) - abort (); + gcc_assert (i >= 0); fprintf (file, "%d", i); return; case 't': /* Like 'J' but get to the OVERFLOW/UNORDERED bit. */ - if (GET_CODE (x) != REG || GET_MODE (x) != CCmode) - abort (); + gcc_assert (GET_CODE (x) == REG && GET_MODE (x) == CCmode); /* Bit 3 is OV bit. */ i = 4 * (REGNO (x) - CR0_REGNO) + 3; @@ -9592,7 +9973,7 @@ print_operand (FILE *file, rtx x, int code) fputs ("lge", file); /* 5 */ break; default: - abort (); + gcc_unreachable (); } break; @@ -9625,9 +10006,8 @@ print_operand (FILE *file, rtx x, int code) { val = CONST_DOUBLE_LOW (x); - if (val == 0) - abort (); - else if (val < 0) + gcc_assert (val); + if (val < 0) --i; else for ( ; i < 64; i++) @@ -9668,8 +10048,7 @@ print_operand (FILE *file, rtx x, int code) names. If we are configured for System V (or the embedded ABI) on the PowerPC, do not emit the period, since those systems do not use TOCs and the like. */ - if (GET_CODE (x) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (x) == SYMBOL_REF); /* Mark the decl as referenced so that cgraph will output the function. */ @@ -9715,8 +10094,7 @@ print_operand (FILE *file, rtx x, int code) { rtx tmp; - if (GET_CODE (x) != MEM) - abort (); + gcc_assert (GET_CODE (x) == MEM); tmp = XEXP (x, 0); @@ -9734,8 +10112,7 @@ print_operand (FILE *file, rtx x, int code) { int x; - if (GET_CODE (XEXP (tmp, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (tmp, 0)) == REG); x = INTVAL (XEXP (tmp, 1)); fprintf (file, "%d(%s)", x, reg_names[REGNO (XEXP (tmp, 0))]); @@ -9751,8 +10128,11 @@ print_operand (FILE *file, rtx x, int code) tmp = XEXP (tmp, 0); if (GET_CODE (tmp) == REG) fprintf (file, "0,%s", reg_names[REGNO (tmp)]); - else if (GET_CODE (tmp) == PLUS && GET_CODE (XEXP (tmp, 1)) == REG) + else { + gcc_assert (GET_CODE (tmp) == PLUS + && GET_CODE (XEXP (tmp, 1)) == REG); + if (REGNO (XEXP (tmp, 0)) == 0) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 1)) ], reg_names[ REGNO (XEXP (tmp, 0)) ]); @@ -9760,8 +10140,6 @@ print_operand (FILE *file, rtx x, int code) fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (tmp, 0)) ], reg_names[ REGNO (XEXP (tmp, 1)) ]); } - else - abort (); break; } @@ -9808,8 +10186,8 @@ print_operand_address (FILE *file, rtx x) if (small_data_operand (x, GET_MODE (x))) fprintf (file, "@%s(%s)", SMALL_DATA_RELOC, reg_names[SMALL_DATA_REG]); - else if (TARGET_TOC) - abort (); + else + gcc_assert (!TARGET_TOC); } else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG) { @@ -9877,7 +10255,7 @@ print_operand_address (FILE *file, rtx x) fprintf (file, "(%s)", reg_names[REGNO (XEXP (x, 0))]); } else - abort (); + gcc_unreachable (); } /* Target hook for assembling integer objects. The PowerPC version has @@ -10033,52 +10411,78 @@ rs6000_generate_compare (enum rtx_code code) switch (code) { case EQ: case UNEQ: case NE: case LTGT: - if (op_mode == SFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstsfeq_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsfeq_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); - else if (op_mode == DFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstdfeq_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpdfeq_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); - else abort (); + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdfeq_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } break; + case GT: case GTU: case UNGT: case UNGE: case GE: case GEU: - if (op_mode == SFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstsfgt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsfgt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); - else if (op_mode == DFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstdfgt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpdfgt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); - else abort (); + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdfgt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } break; + case LT: case LTU: case UNLT: case UNLE: case LE: case LEU: - if (op_mode == SFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstsflt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsflt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); - else if (op_mode == DFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstdflt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpdflt_gpr (compare_result, rs6000_compare_op0, - rs6000_compare_op1); - else abort (); + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdflt_gpr (compare_result, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } break; default: - abort (); + gcc_unreachable (); } /* Synthesize LE and GE from LT/GT || EQ. */ @@ -10092,25 +10496,33 @@ rs6000_generate_compare (enum rtx_code code) case GE: code = GT; break; case LEU: code = LT; break; case GEU: code = GT; break; - default: abort (); + default: gcc_unreachable (); } compare_result2 = gen_reg_rtx (CCFPmode); /* Do the EQ. */ - if (op_mode == SFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstsfeq_gpr (compare_result2, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpsfeq_gpr (compare_result2, rs6000_compare_op0, - rs6000_compare_op1); - else if (op_mode == DFmode) - cmp = flag_unsafe_math_optimizations - ? gen_tstdfeq_gpr (compare_result2, rs6000_compare_op0, - rs6000_compare_op1) - : gen_cmpdfeq_gpr (compare_result2, rs6000_compare_op0, - rs6000_compare_op1); - else abort (); + switch (op_mode) + { + case SFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstsfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpsfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1); + break; + + case DFmode: + cmp = flag_unsafe_math_optimizations + ? gen_tstdfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1) + : gen_cmpdfeq_gpr (compare_result2, rs6000_compare_op0, + rs6000_compare_op1); + break; + + default: + gcc_unreachable (); + } emit_insn (cmp); /* OR them together. */ @@ -10161,10 +10573,10 @@ rs6000_generate_compare (enum rtx_code code) } /* Some kinds of FP comparisons need an OR operation; - under flag_unsafe_math_optimizations we don't bother. */ + under flag_finite_math_only we don't bother. */ if (rs6000_compare_fp_p - && ! flag_unsafe_math_optimizations - && ! (TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS) + && !flag_finite_math_only + && !(TARGET_HARD_FLOAT && TARGET_E500 && !TARGET_FPRS) && (code == LE || code == GE || code == UNEQ || code == LTGT || code == UNGT || code == UNLT)) @@ -10181,7 +10593,7 @@ rs6000_generate_compare (enum rtx_code code) case LTGT: or1 = LT; or2 = GT; break; case UNGT: or1 = UNORDERED; or2 = GT; break; case UNLT: or1 = UNORDERED; or2 = LT; break; - default: abort (); + default: gcc_unreachable (); } validate_condition_mode (or1, comp_mode); validate_condition_mode (or2, comp_mode); @@ -10222,8 +10634,7 @@ rs6000_emit_sCOND (enum rtx_code code, rtx result) PUT_MODE (condition_rtx, SImode); t = XEXP (condition_rtx, 0); - if (cond_code != NE && cond_code != EQ) - abort (); + gcc_assert (cond_code == NE || cond_code == EQ); if (cond_code == NE) emit_insn (gen_e500_flip_gt_bit (t, t)); @@ -10326,13 +10737,20 @@ output_cbranch (rtx op, const char *label, int reversed, rtx insn) { /* The efscmp/tst* instructions twiddle bit 2, which maps nicely to the GT bit. */ - if (code == EQ) - /* Opposite of GT. */ - code = GT; - else if (code == NE) - code = UNLE; - else - abort (); + switch (code) + { + case EQ: + /* Opposite of GT. */ + code = GT; + break; + + case NE: + code = UNLE; + break; + + default: + gcc_unreachable (); + } } switch (code) @@ -10356,7 +10774,7 @@ output_cbranch (rtx op, const char *label, int reversed, rtx insn) case UNGE: ccode = "nl"; break; case UNLE: ccode = "ng"; break; default: - abort (); + gcc_unreachable (); } /* Maybe we have a guess as to how likely the branch is. @@ -10416,9 +10834,8 @@ output_e500_flip_gt_bit (rtx dst, rtx src) static char string[64]; int a, b; - if (GET_CODE (dst) != REG || ! CR_REGNO_P (REGNO (dst)) - || GET_CODE (src) != REG || ! CR_REGNO_P (REGNO (src))) - abort (); + gcc_assert (GET_CODE (dst) == REG && CR_REGNO_P (REGNO (dst)) + && GET_CODE (src) == REG && CR_REGNO_P (REGNO (src))); /* GT bit. */ a = 4 * (REGNO (dst) - CR0_REGNO) + 1; @@ -10492,13 +10909,8 @@ rs6000_emit_vector_compare (enum rtx_code rcode, enum machine_mode dest_mode; enum machine_mode op_mode = GET_MODE (op1); -#ifdef ENABLE_CHECKING - if (!TARGET_ALTIVEC) - abort (); - - if (GET_MODE (op0) != GET_MODE (op1)) - abort (); -#endif + gcc_assert (TARGET_ALTIVEC); + gcc_assert (GET_MODE (op0) == GET_MODE (op1)); /* Floating point vector compare instructions uses destination V4SImode. Move destination to appropriate mode later. */ @@ -10534,8 +10946,7 @@ rs6000_emit_vector_compare (enum rtx_code rcode, dest_mode); nor_code = one_cmpl_optab->handlers[(int)dest_mode].insn_code; - if (nor_code == CODE_FOR_nothing) - abort (); + gcc_assert (nor_code != CODE_FOR_nothing); emit_insn (GEN_FCN (nor_code) (mask, eq_rtx)); if (dmode != dest_mode) @@ -10557,16 +10968,27 @@ rs6000_emit_vector_compare (enum rtx_code rcode, enum insn_code ior_code; enum rtx_code new_code; - if (rcode == GE) - new_code = GT; - else if (rcode == GEU) - new_code = GTU; - else if (rcode == LE) - new_code = LT; - else if (rcode == LEU) - new_code = LTU; - else - abort (); + switch (rcode) + { + case GE: + new_code = GT; + break; + + case GEU: + new_code = GTU; + break; + + case LE: + new_code = LT; + break; + + case LEU: + new_code = LTU; + break; + + default: + gcc_unreachable (); + } c_rtx = rs6000_emit_vector_compare (new_code, op0, op1, dest_mode); @@ -10574,8 +10996,7 @@ rs6000_emit_vector_compare (enum rtx_code rcode, dest_mode); ior_code = ior_optab->handlers[(int)dest_mode].insn_code; - if (ior_code == CODE_FOR_nothing) - abort (); + gcc_assert (ior_code != CODE_FOR_nothing); emit_insn (GEN_FCN (ior_code) (mask, c_rtx, eq_rtx)); if (dmode != dest_mode) { @@ -10587,15 +11008,14 @@ rs6000_emit_vector_compare (enum rtx_code rcode, } break; default: - abort (); + gcc_unreachable (); } if (try_again) { vec_cmp_insn = get_vec_cmp_insn (rcode, dest_mode, op_mode); - if (vec_cmp_insn == INSN_NOT_AVAILABLE) - /* You only get two chances. */ - abort (); + /* You only get two chances. */ + gcc_assert (vec_cmp_insn != INSN_NOT_AVAILABLE); } if (swap_operands) @@ -10607,12 +11027,10 @@ rs6000_emit_vector_compare (enum rtx_code rcode, } } - emit_insn (gen_rtx_fmt_ee (SET, - VOIDmode, - mask, - gen_rtx_fmt_Ei (UNSPEC, dest_mode, - gen_rtvec (2, op0, op1), - vec_cmp_insn))); + emit_insn (gen_rtx_SET (VOIDmode, mask, + gen_rtx_UNSPEC (dest_mode, + gen_rtvec (2, op0, op1), + vec_cmp_insn))); if (dmode != dest_mode) { rtx temp = gen_reg_rtx (dest_mode); @@ -10661,10 +11079,12 @@ rs6000_emit_vector_select (rtx dest, rtx op1, rtx op2, rtx mask) temp = gen_reg_rtx (dest_mode); - t = gen_rtx_fmt_ee (SET, VOIDmode, temp, - gen_rtx_fmt_Ei (UNSPEC, dest_mode, - gen_rtvec (3, op1, op2, mask), - vsel_insn_index)); + /* For each vector element, select op1 when mask is 1 otherwise + select op2. */ + t = gen_rtx_SET (VOIDmode, temp, + gen_rtx_UNSPEC (dest_mode, + gen_rtvec (3, op2, op1, mask), + vsel_insn_index)); emit_insn (t); emit_move_insn (dest, temp); return; @@ -10868,7 +11288,7 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_rtx_SET (VOIDmode, dest, @@ -10939,12 +11359,188 @@ 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); - if (target == NULL_RTX) - abort (); + gcc_assert (target); if (target != dest) emit_move_insn (dest, target); } +/* Emit instructions to perform a load-reserved/store-conditional operation. + The operation performed is an atomic + (set M (CODE:MODE M OP)) + If not NULL, BEFORE is atomically set to M before the operation, and + AFTER is set to M after the operation (that is, (CODE:MODE M OP)). + If SYNC_P then a memory barrier is emitted before the operation. + Either OP or M may be wrapped in a NOT operation. */ + +void +rs6000_emit_sync (enum rtx_code code, enum machine_mode mode, + rtx m, rtx op, rtx before_param, rtx after_param, + bool sync_p) +{ + enum machine_mode used_mode; + rtx the_op, set_before, set_after, set_atomic, cc_scratch, before, after; + rtx used_m; + rtvec vec; + HOST_WIDE_INT imask = GET_MODE_MASK (mode); + rtx shift = NULL_RTX; + + if (sync_p) + emit_insn (gen_memory_barrier ()); + + if (GET_CODE (m) == NOT) + used_m = XEXP (m, 0); + else + used_m = m; + + /* If this is smaller than SImode, we'll have to use SImode with + adjustments. */ + if (mode == QImode || mode == HImode) + { + rtx newop, oldop; + + if (MEM_ALIGN (used_m) >= 32) + { + int ishift = 0; + if (BYTES_BIG_ENDIAN) + ishift = GET_MODE_BITSIZE (SImode) - GET_MODE_BITSIZE (mode); + + shift = GEN_INT (ishift); + } + else + { + rtx addrSI, aligned_addr; + + addrSI = force_reg (SImode, gen_lowpart_common (SImode, + XEXP (used_m, 0))); + shift = gen_reg_rtx (SImode); + + emit_insn (gen_rlwinm (shift, addrSI, GEN_INT (3), + GEN_INT (0x18))); + + aligned_addr = expand_binop (Pmode, and_optab, + XEXP (used_m, 0), + GEN_INT (-4), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + used_m = change_address (used_m, SImode, aligned_addr); + set_mem_align (used_m, 32); + /* It's safe to keep the old alias set of USED_M, because + the operation is atomic and only affects the original + USED_M. */ + if (GET_CODE (m) == NOT) + m = gen_rtx_NOT (SImode, used_m); + else + m = used_m; + } + + if (GET_CODE (op) == NOT) + { + oldop = lowpart_subreg (SImode, XEXP (op, 0), mode); + oldop = gen_rtx_NOT (SImode, oldop); + } + else + oldop = lowpart_subreg (SImode, op, mode); + switch (code) + { + case IOR: + case XOR: + newop = expand_binop (SImode, and_optab, + oldop, GEN_INT (imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (newop, newop, shift)); + break; + + case AND: + newop = expand_binop (SImode, ior_optab, + oldop, GEN_INT (~imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (newop, newop, shift)); + break; + + case PLUS: + { + rtx mask; + + newop = expand_binop (SImode, and_optab, + oldop, GEN_INT (imask), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + emit_insn (gen_ashlsi3 (newop, newop, shift)); + + mask = gen_reg_rtx (SImode); + emit_move_insn (mask, GEN_INT (imask)); + emit_insn (gen_ashlsi3 (mask, mask, shift)); + + newop = gen_rtx_AND (SImode, gen_rtx_PLUS (SImode, m, newop), + mask); + newop = gen_rtx_IOR (SImode, newop, + gen_rtx_AND (SImode, + gen_rtx_NOT (SImode, mask), + m)); + break; + } + + default: + gcc_unreachable (); + } + + op = newop; + used_mode = SImode; + before = gen_reg_rtx (used_mode); + after = gen_reg_rtx (used_mode); + } + else + { + used_mode = mode; + before = before_param; + after = after_param; + + if (before == NULL_RTX) + before = gen_reg_rtx (used_mode); + if (after == NULL_RTX) + after = gen_reg_rtx (used_mode); + } + + if (code == PLUS && used_mode != mode) + the_op = op; /* Computed above. */ + else if (GET_CODE (op) == NOT && GET_CODE (m) != NOT) + the_op = gen_rtx_fmt_ee (code, used_mode, op, m); + else + the_op = gen_rtx_fmt_ee (code, used_mode, m, op); + + set_after = gen_rtx_SET (VOIDmode, after, the_op); + set_before = gen_rtx_SET (VOIDmode, before, used_m); + set_atomic = gen_rtx_SET (VOIDmode, used_m, + gen_rtx_UNSPEC (used_mode, gen_rtvec (1, the_op), + UNSPEC_SYNC_OP)); + cc_scratch = gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (CCmode)); + + if (code == PLUS && used_mode != mode) + vec = gen_rtvec (5, set_after, set_before, set_atomic, cc_scratch, + gen_rtx_CLOBBER (VOIDmode, gen_rtx_SCRATCH (SImode))); + else + vec = gen_rtvec (4, set_after, set_before, set_atomic, cc_scratch); + emit_insn (gen_rtx_PARALLEL (VOIDmode, vec)); + + /* Shift and mask the return values properly. */ + if (used_mode != mode && before_param) + { + emit_insn (gen_lshrsi3 (before, before, shift)); + convert_move (before_param, before, 1); + } + + if (used_mode != mode && after_param) + { + emit_insn (gen_lshrsi3 (after, after, shift)); + convert_move (after_param, after, 1); + } + + /* The previous sequence will end with a branch that's dependent on + the conditional store, so placing an isync will ensure that no + other instructions (especially, no load or store instructions) + can start before the atomic operation completes. */ + if (sync_p) + emit_insn (gen_isync ()); +} + /* Emit instructions to move SRC to DST. Called by splitters for multi-register moves. It will emit at most one instruction for each register that is accessed; that is, it won't emit li/lis pairs @@ -10975,8 +11571,7 @@ rs6000_split_multireg_move (rtx dst, rtx src) reg_mode = word_mode; reg_mode_size = GET_MODE_SIZE (reg_mode); - if (reg_mode_size * nregs != GET_MODE_SIZE (mode)) - abort (); + gcc_assert (reg_mode_size * nregs == GET_MODE_SIZE (mode)); if (REG_P (src) && REG_P (dst) && (REGNO (src) < REGNO (dst))) { @@ -11067,8 +11662,8 @@ rs6000_split_multireg_move (rtx dst, rtx src) : gen_adddi3 (breg, breg, delta_rtx)); dst = gen_rtx_MEM (mode, breg); } - else if (! offsettable_memref_p (dst)) - abort (); + else + gcc_assert (offsettable_memref_p (dst)); } for (i = 0; i < nregs; i++) @@ -11238,10 +11833,10 @@ compute_save_world_info (rs6000_stack_t *info_ptr) /* Because the Darwin register save/restore routines only handle F14 .. F31 and V20 .. V31 as per the ABI, perform a consistency - check and abort if there's something worng. */ - if (info_ptr->first_fp_reg_save < FIRST_SAVED_FP_REGNO - || info_ptr->first_altivec_reg_save < FIRST_SAVED_ALTIVEC_REGNO) - abort (); + check. */ + gcc_assert (info_ptr->first_fp_reg_save >= FIRST_SAVED_FP_REGNO + && (info_ptr->first_altivec_reg_save + >= FIRST_SAVED_ALTIVEC_REGNO)); } return; } @@ -11494,7 +12089,7 @@ rs6000_stack_info (void) { case ABI_NONE: default: - abort (); + gcc_unreachable (); case ABI_AIX: case ABI_DARWIN: @@ -11998,11 +12593,10 @@ rs6000_emit_load_toc_table (int fromprolog) rtx temp0 = (fromprolog ? gen_rtx_REG (Pmode, 0) : gen_reg_rtx (Pmode)); - rtx symF; if (fromprolog) { - rtx symL; + rtx symF, symL; ASM_GENERATE_INTERNAL_LABEL (buf, "LCF", rs6000_pic_labelno); symF = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); @@ -12020,14 +12614,9 @@ rs6000_emit_load_toc_table (int fromprolog) else { rtx tocsym; - static int reload_toc_labelno = 0; tocsym = gen_rtx_SYMBOL_REF (Pmode, toc_label_name); - - ASM_GENERATE_INTERNAL_LABEL (buf, "LCG", reload_toc_labelno++); - symF = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)); - - emit_insn (gen_load_toc_v4_PIC_1b (tempLR, symF, tocsym)); + emit_insn (gen_load_toc_v4_PIC_1b (tempLR, tocsym)); emit_move_insn (dest, tempLR); emit_move_insn (temp0, gen_rtx_MEM (Pmode, dest)); } @@ -12050,8 +12639,10 @@ rs6000_emit_load_toc_table (int fromprolog) if (fromprolog) rs6000_maybe_dead (insn); } - else if (DEFAULT_ABI == ABI_AIX) + else { + gcc_assert (DEFAULT_ABI == ABI_AIX); + if (TARGET_32BIT) insn = emit_insn (gen_load_toc_aix_si (dest)); else @@ -12059,8 +12650,6 @@ rs6000_emit_load_toc_table (int fromprolog) if (fromprolog) rs6000_maybe_dead (insn); } - else - abort (); } /* Emit instructions to restore the link register after determining where @@ -12213,7 +12802,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) if (INTVAL (todec) != -size) { - warning ("stack frame too large"); + warning (0, "stack frame too large"); emit_insn (gen_trap ()); return; } @@ -12250,7 +12839,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) const0_rtx)); } else - warning ("stack limit expression is not supported"); + warning (0, "stack limit expression is not supported"); } if (copy_r12 || ! TARGET_UPDATE) @@ -12343,9 +12932,11 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, XEXP (SET_DEST (set), 0) = temp; } } - else if (GET_CODE (real) == PARALLEL) + else { int i; + + gcc_assert (GET_CODE (real) == PARALLEL); for (i = 0; i < XVECLEN (real, 0); i++) if (GET_CODE (XVECEXP (real, 0, i)) == SET) { @@ -12366,8 +12957,6 @@ rs6000_frame_related (rtx insn, rtx reg, HOST_WIDE_INT val, RTX_FRAME_RELATED_P (set) = 1; } } - else - abort (); if (TARGET_SPE) real = spe_synthesize_frame_save (real); @@ -12396,10 +12985,9 @@ spe_synthesize_frame_save (rtx real) This is so we can differentiate between 64-bit and 32-bit saves. Words cannot describe this nastiness. */ - if (GET_CODE (SET_DEST (real)) != MEM - || GET_CODE (XEXP (SET_DEST (real), 0)) != PLUS - || GET_CODE (SET_SRC (real)) != REG) - abort (); + gcc_assert (GET_CODE (SET_DEST (real)) == MEM + && GET_CODE (XEXP (SET_DEST (real), 0)) == PLUS + && GET_CODE (SET_SRC (real)) == REG); /* Transform: (set (mem (plus (reg x) (const y))) @@ -12590,7 +13178,7 @@ rs6000_emit_prologue (void) if (TARGET_FIX_AND_CONTINUE) { /* gdb on darwin arranges to forward a function from the old - address by modifying the first 4 instructions of the function + address by modifying the first 5 instructions of the function to branch to the overriding function. This is necessary to permit function pointers that point to the old function to actually forward to the new function. */ @@ -12598,6 +13186,7 @@ rs6000_emit_prologue (void) emit_insn (gen_nop ()); emit_insn (gen_nop ()); emit_insn (gen_nop ()); + emit_insn (gen_nop ()); } if (TARGET_SPE_ABI && info->spe_64bit_regs_used != 0) @@ -12652,17 +13241,17 @@ rs6000_emit_prologue (void) /* The SAVE_WORLD and RESTORE_WORLD routines make a number of assumptions about the offsets of various bits of the stack - frame. Abort if things aren't what they should be. */ - if (info->gp_save_offset != -220 - || info->fp_save_offset != -144 - || info->lr_save_offset != 8 - || info->cr_save_offset != 4 - || !info->push_p - || !info->lr_save_p - || (current_function_calls_eh_return && info->ehrd_offset != -432) - || (info->vrsave_save_offset != -224 - || info->altivec_save_offset != (-224 -16 -192))) - abort (); + frame. */ + gcc_assert (info->gp_save_offset == -220 + && info->fp_save_offset == -144 + && info->lr_save_offset == 8 + && info->cr_save_offset == 4 + && info->push_p + && info->lr_save_p + && (!current_function_calls_eh_return + || info->ehrd_offset == -432) + && info->vrsave_save_offset == -224 + && info->altivec_save_offset == (-224 -16 -192)); treg = gen_rtx_REG (SImode, 11); emit_move_insn (treg, GEN_INT (-info->total_size)); @@ -12797,7 +13386,7 @@ rs6000_emit_prologue (void) epilogue. */ if (TARGET_ALTIVEC && TARGET_ALTIVEC_VRSAVE - && !WORLD_SAVE_P (info) && info->vrsave_mask != 0) + && info->vrsave_mask != 0) { rtx reg, mem, vrsave; int offset; @@ -12812,13 +13401,16 @@ rs6000_emit_prologue (void) else emit_insn (gen_rtx_SET (VOIDmode, reg, vrsave)); - /* Save VRSAVE. */ - offset = info->vrsave_save_offset + sp_offset; - mem - = gen_rtx_MEM (SImode, - gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset))); - set_mem_alias_set (mem, rs6000_sr_alias_set); - insn = emit_move_insn (mem, reg); + if (!WORLD_SAVE_P (info)) + { + /* Save VRSAVE. */ + offset = info->vrsave_save_offset + sp_offset; + mem + = gen_rtx_MEM (SImode, + gen_rtx_PLUS (Pmode, frame_reg_rtx, GEN_INT (offset))); + set_mem_alias_set (mem, rs6000_sr_alias_set); + insn = emit_move_insn (mem, reg); + } /* Include the registers in the mask. */ emit_insn (gen_iorsi3 (reg, reg, GEN_INT ((int) info->vrsave_mask))); @@ -13184,7 +13776,7 @@ rs6000_output_function_prologue (FILE *file, if (TARGET_DEBUG_STACK) debug_rtx_list (get_insns (), 100); - final (get_insns (), file, FALSE, FALSE); + final (get_insns (), file, FALSE); end_sequence (); } @@ -13556,8 +14148,7 @@ rs6000_emit_epilogue (int sibcall) for (i = 0; i < 8; i++) if (regs_ever_live[CR0_REGNO+i] && ! call_used_regs[CR0_REGNO+i]) count++; - if (count == 0) - abort (); + gcc_assert (count); } if (using_mfcr_multiple && count > 1) @@ -13580,8 +14171,7 @@ rs6000_emit_epilogue (int sibcall) ndx++; } emit_insn (gen_rtx_PARALLEL (VOIDmode, p)); - if (ndx != count) - abort (); + gcc_assert (ndx == count); } else for (i = 0; i < 8; i++) @@ -13714,7 +14304,7 @@ rs6000_output_function_epilogue (FILE *file, if (TARGET_DEBUG_STACK) debug_rtx_list (get_insns (), 100); - final (get_insns (), file, FALSE, FALSE); + final (get_insns (), file, FALSE); end_sequence (); } } @@ -13816,7 +14406,7 @@ rs6000_output_function_epilogue (FILE *file, else if (! strcmp (language_string, "GNU Objective-C")) i = 14; else - abort (); + gcc_unreachable (); fprintf (file, "%d,", i); /* 8 single bit fields: global linkage (not set for C extern linkage, @@ -13869,12 +14459,20 @@ rs6000_output_function_epilogue (FILE *file, float_parms++; - if (mode == SFmode) - bits = 0x2; - else if (mode == DFmode || mode == TFmode) - bits = 0x3; - else - abort (); + switch (mode) + { + case SFmode: + bits = 0x2; + break; + + case DFmode: + case TFmode: + bits = 0x3; + break; + + default: + gcc_unreachable (); + } /* If only one bit will fit, don't or in this entry. */ if (next_parm_info_bit > 0) @@ -14062,7 +14660,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, #endif /* gen_sibcall expects reload to convert scratch pseudo to LR so we must - generate sibcall RTL explicitly to avoid constraint abort. */ + generate sibcall RTL explicitly. */ insn = emit_call_insn ( gen_rtx_PARALLEL (VOIDmode, gen_rtvec (4, @@ -14084,7 +14682,7 @@ rs6000_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, insn_locators_initialize (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); reload_completed = 0; @@ -14188,7 +14786,7 @@ rs6000_hash_constant (rtx k) case '0': break; default: - abort (); + gcc_unreachable (); } return result; @@ -14260,8 +14858,7 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) rtx base = x; int offset = 0; - if (TARGET_NO_TOC) - abort (); + gcc_assert (!TARGET_NO_TOC); /* When the linker won't eliminate them, don't output duplicate TOC entries (this happens on AIX if there is any kind of TOC, @@ -14440,8 +15037,8 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) For a 32-bit target, CONST_INT values are loaded and shifted entirely within `low' and can be stored in one TOC entry. */ - if (TARGET_64BIT && POINTER_SIZE < GET_MODE_BITSIZE (mode)) - abort ();/* It would be easy to make this work, but it doesn't now. */ + /* It would be easy to make this work, but it doesn't now. */ + gcc_assert (!TARGET_64BIT || POINTER_SIZE >= GET_MODE_BITSIZE (mode)); if (POINTER_SIZE > GET_MODE_BITSIZE (mode)) { @@ -14493,21 +15090,30 @@ output_toc (FILE *file, rtx x, int labelno, enum machine_mode mode) if (GET_CODE (x) == CONST) { - if (GET_CODE (XEXP (x, 0)) != PLUS) - abort (); + gcc_assert (GET_CODE (XEXP (x, 0)) == PLUS); base = XEXP (XEXP (x, 0), 0); offset = INTVAL (XEXP (XEXP (x, 0), 1)); } - if (GET_CODE (base) == SYMBOL_REF) - name = XSTR (base, 0); - else if (GET_CODE (base) == LABEL_REF) - ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (XEXP (base, 0))); - else if (GET_CODE (base) == CODE_LABEL) - ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (base)); - else - abort (); + switch (GET_CODE (base)) + { + case SYMBOL_REF: + name = XSTR (base, 0); + break; + + case LABEL_REF: + ASM_GENERATE_INTERNAL_LABEL (buf, "L", + CODE_LABEL_NUMBER (XEXP (base, 0))); + break; + + case CODE_LABEL: + ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (base)); + break; + + default: + gcc_unreachable (); + } real_name = (*targetm.strip_name_encoding) (name); if (TARGET_MINIMAL_TOC) @@ -14669,6 +15275,10 @@ rs6000_gen_section_name (char **buf, const char *filename, void output_profile_hook (int labelno ATTRIBUTE_UNUSED) { + /* Non-standard profiling for kernels, which just saves LR then calls + _mcount without worrying about arg saves. The idea is to change + the function prologue as little as possible as it isn't easy to + account for arg save/restore code added just for _mcount. */ if (TARGET_PROFILE_KERNEL) return; @@ -14725,13 +15335,13 @@ output_function_profiler (FILE *file, int labelno) switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); case ABI_V4: save_lr = 4; if (!TARGET_32BIT) { - warning ("no profiling of 64-bit code for this ABI"); + warning (0, "no profiling of 64-bit code for this ABI"); return; } ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno); @@ -14785,8 +15395,7 @@ output_function_profiler (FILE *file, int labelno) } else { - if (TARGET_32BIT) - abort (); + gcc_assert (!TARGET_32BIT); asm_fprintf (file, "\tmflr %s\n", reg_names[0]); asm_fprintf (file, "\tstd %s,16(%s)\n", reg_names[0], reg_names[1]); @@ -15234,7 +15843,7 @@ static bool rs6000_is_costly_dependence (rtx insn, rtx next, rtx link, int cost, int distance) { - /* If the flag is not enbled - no dependence is considered costly; + /* If the flag is not enabled - no dependence is considered costly; allow all dependent insns in the same group. This is the most aggressive option. */ if (rs6000_sched_costly_dep == no_dep_costly) @@ -15704,7 +16313,7 @@ rs6000_trampoline_size (void) switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); case ABI_AIX: ret = (TARGET_32BIT) ? 12 : 24; @@ -15733,7 +16342,7 @@ rs6000_initialize_trampoline (rtx addr, rtx fnaddr, rtx cxt) switch (DEFAULT_ABI) { default: - abort (); + gcc_unreachable (); /* Macros to shorten the code expansions below. */ #define MEM_DEREF(addr) gen_rtx_MEM (pmode, memory_address (pmode, addr)) @@ -15823,7 +16432,7 @@ rs6000_handle_altivec_attribute (tree *node, if (TARGET_64BIT) error ("use of % in AltiVec types is invalid for 64-bit code"); else if (rs6000_warn_altivec_long) - warning ("use of % in AltiVec types is deprecated; use %"); + warning (0, "use of % in AltiVec types is deprecated; use %"); } else if (type == long_long_unsigned_type_node || type == long_long_integer_type_node) @@ -15918,7 +16527,7 @@ rs6000_handle_longcall_attribute (tree *node, tree name, && TREE_CODE (*node) != FIELD_DECL && TREE_CODE (*node) != TYPE_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -16113,11 +16722,10 @@ find_addr_reg (rtx addr) else if (CONSTANT_P (XEXP (addr, 1))) addr = XEXP (addr, 0); else - abort (); + gcc_unreachable (); } - if (GET_CODE (addr) == REG && REGNO (addr) != 0) - return addr; - abort (); + gcc_assert (GET_CODE (addr) == REG && REGNO (addr) != 0); + return addr; } void @@ -16335,7 +16943,7 @@ machopic_output_stub (FILE *file, const char *symb, const char *stub) fprintf (file, "\t.indirect_symbol %s\n", symbol_name); label++; - local_label_0 = alloca (sizeof ("\"L0000000000$spb\"")); + local_label_0 = alloca (sizeof ("\"L00000000000$spb\"")); sprintf (local_label_0, "\"L%011d$spb\"", label); fprintf (file, "\tmflr r0\n"); @@ -16390,26 +16998,23 @@ rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, if (GET_CODE (orig) == CONST) { + rtx reg_temp; + if (GET_CODE (XEXP (orig, 0)) == PLUS && XEXP (XEXP (orig, 0), 0) == pic_offset_table_rtx) return orig; - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - /* Use a different reg for the intermediate value, as - it will be marked UNCHANGING. */ - rtx reg_temp = no_new_pseudos ? reg : gen_reg_rtx (Pmode); - - base = - rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 0), - Pmode, reg_temp); - offset = - rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 1), - Pmode, reg); - } - else - abort (); - + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + + /* Use a different reg for the intermediate value, as + it will be marked UNCHANGING. */ + reg_temp = no_new_pseudos ? reg : gen_reg_rtx (Pmode); + base = rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 0), + Pmode, reg_temp); + offset = + rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 1), + Pmode, reg); + if (GET_CODE (offset) == CONST_INT) { if (SMALL_INT (offset)) @@ -16640,6 +17245,13 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) } ASM_OUTPUT_LABEL (file, name); } + +static void +rs6000_elf_end_indicate_exec_stack (void) +{ + if (TARGET_32BIT) + file_end_indicate_exec_stack (); +} #endif #if TARGET_XCOFF @@ -17408,20 +18020,20 @@ rs6000_initial_elimination_offset (int from, int to) else if (from == RS6000_PIC_OFFSET_TABLE_REGNUM) offset = 0; else - abort (); + gcc_unreachable (); return offset; } -/* Return true if TYPE is of type __ev64_opaque__. */ +/* Return true if TYPE is a SPE or AltiVec opaque type. */ static bool -is_ev64_opaque_type (tree type) +rs6000_is_opaque_type (tree type) { - return (TARGET_SPE - && (type == opaque_V2SI_type_node + return (type == opaque_V2SI_type_node || type == opaque_V2SF_type_node - || type == opaque_p_V2SI_type_node)); + || type == opaque_p_V2SI_type_node + || type == opaque_V4SI_type_node); } static rtx @@ -17481,10 +18093,8 @@ rs6000_dbx_register_number (unsigned int regno) return 612; /* SPE high reg number. We get these values of regno from rs6000_dwarf_register_span. */ - if (regno >= 1200 && regno < 1232) - return regno; - - abort (); + gcc_assert (regno >= 1200 && regno < 1232); + return regno; } /* target hook eh_return_filter_mode */ diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 8e7a2543dc1..25e48498f2d 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -128,117 +128,23 @@ /* Architecture type. */ -extern int target_flags; +/* Define TARGET_MFCRF if the target assembler does not support the + optional field operand for mfcr. */ -/* Use POWER architecture instructions and MQ register. */ -#define MASK_POWER 0x00000001 - -/* Use POWER2 extensions to POWER architecture. */ -#define MASK_POWER2 0x00000002 - -/* Use PowerPC architecture instructions. */ -#define MASK_POWERPC 0x00000004 - -/* Use PowerPC General Purpose group optional instructions, e.g. fsqrt. */ -#define MASK_PPC_GPOPT 0x00000008 - -/* Use PowerPC Graphics group optional instructions, e.g. fsel. */ -#define MASK_PPC_GFXOPT 0x00000010 - -/* Use PowerPC-64 architecture instructions. */ -#define MASK_POWERPC64 0x00000020 - -/* Use revised mnemonic names defined for PowerPC architecture. */ -#define MASK_NEW_MNEMONICS 0x00000040 - -/* Disable placing fp constants in the TOC; can be turned on when the - TOC overflows. */ -#define MASK_NO_FP_IN_TOC 0x00000080 - -/* Disable placing symbol+offset constants in the TOC; can be turned on when - the TOC overflows. */ -#define MASK_NO_SUM_IN_TOC 0x00000100 - -/* Output only one TOC entry per module. Normally linking fails if - there are more than 16K unique variables/constants in an executable. With - this option, linking fails only if there are more than 16K modules, or - if there are more than 16K unique variables/constant in a single module. - - This is at the cost of having 2 extra loads and one extra store per - function, and one less allocable register. */ -#define MASK_MINIMAL_TOC 0x00000200 - -/* Nonzero for the 64 bit ABIs: longs and pointers are 64 bits. The - chip is running in "64-bit mode", in which CR0 is set in dot - operations based on all 64 bits of the register, bdnz works on 64-bit - ctr, lr is 64 bits, and so on. Requires MASK_POWERPC64. */ -#define MASK_64BIT 0x00000400 - -/* Disable use of FPRs. */ -#define MASK_SOFT_FLOAT 0x00000800 - -/* Enable load/store multiple, even on PowerPC */ -#define MASK_MULTIPLE 0x00001000 - -/* Use string instructions for block moves */ -#define MASK_STRING 0x00002000 - -/* Disable update form of load/store */ -#define MASK_NO_UPDATE 0x00004000 - -/* Disable fused multiply/add operations */ -#define MASK_NO_FUSED_MADD 0x00008000 - -/* Nonzero if we need to schedule the prolog and epilog. */ -#define MASK_SCHED_PROLOG 0x00010000 - -/* Use AltiVec instructions. */ -#define MASK_ALTIVEC 0x00020000 - -/* Return small structures in memory (as the AIX ABI requires). */ -#define MASK_AIX_STRUCT_RET 0x00040000 - -/* Use single field mfcr instruction. */ -#define MASK_MFCRF 0x00080000 - -/* The only remaining free bits are 0x00600000. linux64.h uses - 0x00100000, and sysv4.h uses 0x00800000 -> 0x40000000. - 0x80000000 is not available because target_flags is signed. */ - -#define TARGET_POWER (target_flags & MASK_POWER) -#define TARGET_POWER2 (target_flags & MASK_POWER2) -#define TARGET_POWERPC (target_flags & MASK_POWERPC) -#define TARGET_PPC_GPOPT (target_flags & MASK_PPC_GPOPT) -#define TARGET_PPC_GFXOPT (target_flags & MASK_PPC_GFXOPT) -#define TARGET_NEW_MNEMONICS (target_flags & MASK_NEW_MNEMONICS) -#define TARGET_NO_FP_IN_TOC (target_flags & MASK_NO_FP_IN_TOC) -#define TARGET_NO_SUM_IN_TOC (target_flags & MASK_NO_SUM_IN_TOC) -#define TARGET_MINIMAL_TOC (target_flags & MASK_MINIMAL_TOC) -#define TARGET_64BIT (target_flags & MASK_64BIT) -#define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT) -#define TARGET_MULTIPLE (target_flags & MASK_MULTIPLE) -#define TARGET_STRING (target_flags & MASK_STRING) -#define TARGET_NO_UPDATE (target_flags & MASK_NO_UPDATE) -#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) -#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) - -/* Define TARGET_MFCRF if the target assembler supports the optional - field operand for mfcr and the target processor supports the - instruction. */ - -#ifdef HAVE_AS_MFCRF -#define TARGET_MFCRF (target_flags & MASK_MFCRF) -#else +#ifndef HAVE_AS_MFCRF +#undef TARGET_MFCRF #define TARGET_MFCRF 0 #endif +/* Define TARGET_POPCNTB if the target assembler does not suppport the + popcount byte instruction. */ + +#ifndef HAVE_AS_POPCNTB +#undef TARGET_POPCNTB +#define TARGET_POPCNTB 0 +#endif #define TARGET_32BIT (! TARGET_64BIT) -#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT) -#define TARGET_UPDATE (! TARGET_NO_UPDATE) -#define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) /* Emit a dtp-relative reference to a TLS variable. */ @@ -258,126 +164,18 @@ extern int target_flags; #ifdef IN_LIBGCC2 /* For libgcc2 we make sure this is a compile time constant */ #if defined (__64BIT__) || defined (__powerpc64__) +#undef TARGET_POWERPC64 #define TARGET_POWERPC64 1 #else +#undef TARGET_POWERPC64 #define TARGET_POWERPC64 0 #endif #else -#define TARGET_POWERPC64 (target_flags & MASK_POWERPC64) + /* The option machinery will define this. */ #endif -#define TARGET_XL_COMPAT 0 - -/* Run-time compilation parameters selecting different hardware subsets. - - Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - {{"power", MASK_POWER | MASK_MULTIPLE | MASK_STRING, \ - N_("Use POWER instruction set")}, \ - {"power2", (MASK_POWER | MASK_MULTIPLE | MASK_STRING \ - | MASK_POWER2), \ - N_("Use POWER2 instruction set")}, \ - {"no-power2", - MASK_POWER2, \ - N_("Do not use POWER2 instruction set")}, \ - {"no-power", - (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE \ - | MASK_STRING), \ - N_("Do not use POWER instruction set")}, \ - {"powerpc", MASK_POWERPC, \ - N_("Use PowerPC instruction set")}, \ - {"no-powerpc", - (MASK_POWERPC | MASK_PPC_GPOPT \ - | MASK_PPC_GFXOPT | MASK_POWERPC64), \ - N_("Do not use PowerPC instruction set")}, \ - {"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \ - N_("Use PowerPC General Purpose group optional instructions")},\ - {"no-powerpc-gpopt", - MASK_PPC_GPOPT, \ - N_("Do not use PowerPC General Purpose group optional instructions")},\ - {"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \ - N_("Use PowerPC Graphics group optional instructions")},\ - {"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \ - N_("Do not use PowerPC Graphics group optional instructions")},\ - {"powerpc64", MASK_POWERPC64, \ - N_("Use PowerPC-64 instruction set")}, \ - {"no-powerpc64", - MASK_POWERPC64, \ - N_("Do not use PowerPC-64 instruction set")}, \ - {"altivec", MASK_ALTIVEC , \ - N_("Use AltiVec instructions")}, \ - {"no-altivec", - MASK_ALTIVEC , \ - N_("Do not use AltiVec instructions")}, \ - {"new-mnemonics", MASK_NEW_MNEMONICS, \ - N_("Use new mnemonics for PowerPC architecture")},\ - {"old-mnemonics", -MASK_NEW_MNEMONICS, \ - N_("Use old mnemonics for PowerPC architecture")},\ - {"full-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC \ - | MASK_MINIMAL_TOC), \ - N_("Put everything in the regular TOC")}, \ - {"fp-in-toc", - MASK_NO_FP_IN_TOC, \ - N_("Place floating point constants in TOC")}, \ - {"no-fp-in-toc", MASK_NO_FP_IN_TOC, \ - N_("Do not place floating point constants in TOC")},\ - {"sum-in-toc", - MASK_NO_SUM_IN_TOC, \ - N_("Place symbol+offset constants in TOC")}, \ - {"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \ - N_("Do not place symbol+offset constants in TOC")},\ - {"minimal-toc", MASK_MINIMAL_TOC, \ - "Use only one TOC entry per procedure"}, \ - {"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \ - ""}, \ - {"no-minimal-toc", - MASK_MINIMAL_TOC, \ - N_("Place variable addresses in the regular TOC")},\ - {"hard-float", - MASK_SOFT_FLOAT, \ - N_("Use hardware floating point")}, \ - {"soft-float", MASK_SOFT_FLOAT, \ - N_("Do not use hardware floating point")}, \ - {"multiple", MASK_MULTIPLE, \ - N_("Generate load/store multiple instructions")}, \ - {"no-multiple", - MASK_MULTIPLE, \ - N_("Do not generate load/store multiple instructions")},\ - {"string", MASK_STRING, \ - N_("Generate string instructions for block moves")},\ - {"no-string", - MASK_STRING, \ - N_("Do not generate string instructions for block moves")},\ - {"update", - MASK_NO_UPDATE, \ - N_("Generate load/store with update instructions")},\ - {"no-update", MASK_NO_UPDATE, \ - N_("Do not generate load/store with update instructions")},\ - {"fused-madd", - MASK_NO_FUSED_MADD, \ - N_("Generate fused multiply/add instructions")},\ - {"no-fused-madd", MASK_NO_FUSED_MADD, \ - N_("Do not generate fused multiply/add instructions")},\ - {"sched-prolog", MASK_SCHED_PROLOG, \ - ""}, \ - {"no-sched-prolog", -MASK_SCHED_PROLOG, \ - N_("Do not schedule the start and end of the procedure")},\ - {"sched-epilog", MASK_SCHED_PROLOG, \ - ""}, \ - {"no-sched-epilog", -MASK_SCHED_PROLOG, \ - ""}, \ - {"aix-struct-return", MASK_AIX_STRUCT_RET, \ - N_("Return all structures in memory (AIX default)")},\ - {"svr4-struct-return", - MASK_AIX_STRUCT_RET, \ - N_("Return small structures in registers (SVR4 default)")},\ - {"no-aix-struct-return", - MASK_AIX_STRUCT_RET, \ - ""}, \ - {"no-svr4-struct-return", MASK_AIX_STRUCT_RET, \ - ""}, \ - {"mfcrf", MASK_MFCRF, \ - N_("Generate single field mfcr instruction")}, \ - {"no-mfcrf", - MASK_MFCRF, \ - N_("Do not generate single field mfcr instruction")},\ - SUBTARGET_SWITCHES \ - {"", TARGET_DEFAULT | MASK_SCHED_PROLOG, \ - ""}} - #define TARGET_DEFAULT (MASK_POWER | MASK_MULTIPLE | MASK_STRING) -/* This is meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES - /* Processor type. Order must match cpu attribute in MD file. */ enum processor_type { @@ -446,46 +244,6 @@ enum group_termination previous_group }; -/* This is meant to be overridden in target specific files. */ -#define SUBTARGET_OPTIONS - -#define TARGET_OPTIONS \ -{ \ - {"cpu=", &rs6000_select[1].string, \ - N_("Use features of and schedule code for given CPU"), 0}, \ - {"tune=", &rs6000_select[2].string, \ - N_("Schedule code for given CPU"), 0}, \ - {"debug=", &rs6000_debug_name, N_("Enable debug output"), 0}, \ - {"traceback=", &rs6000_traceback_name, \ - N_("Select full, part, or no traceback table"), 0}, \ - {"abi=", &rs6000_abi_string, N_("Specify ABI to use"), 0}, \ - {"long-double-", &rs6000_long_double_size_string, \ - N_("Specify size of long double (64 or 128 bits)"), 0}, \ - {"isel=", &rs6000_isel_string, \ - N_("Specify yes/no if isel instructions should be generated"), 0}, \ - {"spe=", &rs6000_spe_string, \ - N_("Specify yes/no if SPE SIMD instructions should be generated"), 0},\ - {"float-gprs=", &rs6000_float_gprs_string, \ - N_("Specify yes/no if using floating point in the GPRs"), 0}, \ - {"vrsave=", &rs6000_altivec_vrsave_string, \ - N_("Specify yes/no if VRSAVE instructions should be generated for AltiVec"), 0}, \ - {"longcall", &rs6000_longcall_switch, \ - N_("Avoid all range limits on call instructions"), 0}, \ - {"no-longcall", &rs6000_longcall_switch, "", 0}, \ - {"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}, \ - {"sched-costly-dep=", &rs6000_sched_costly_dep_str, \ - N_("Determine which dependences between insns are considered costly"), 0}, \ - {"insert-sched-nops=", &rs6000_sched_insert_nops_str, \ - N_("Specify which post scheduling nop insertion scheme to apply"), 0}, \ - {"align-", &rs6000_alignment_string, \ - 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}, \ - SUBTARGET_OPTIONS \ -} - /* Support for a compile-time default CPU, et cetera. The rules are: --with-cpu is ignored if -mcpu is specified. --with-tune is ignored if -mtune is specified. @@ -527,25 +285,13 @@ extern int rs6000_spe_abi; extern int rs6000_isel; extern int rs6000_spe; extern int rs6000_float_gprs; -extern const char *rs6000_float_gprs_string; -extern const char *rs6000_isel_string; -extern const char *rs6000_spe_string; -extern const char *rs6000_altivec_vrsave_string; -extern int rs6000_altivec_vrsave; -extern const char *rs6000_longcall_switch; -extern int rs6000_default_long_calls; extern const char* rs6000_alignment_string; extern int rs6000_alignment_flags; extern const char *rs6000_sched_restricted_insns_priority_str; extern int rs6000_sched_restricted_insns_priority; -extern const char *rs6000_sched_costly_dep_str; -extern enum rs6000_dependence_cost rs6000_sched_costly_dep; extern const char *rs6000_sched_insert_nops_str; extern enum rs6000_nop_insertion rs6000_sched_insert_nops; -extern int rs6000_warn_altivec_long; -extern const char *rs6000_warn_altivec_long_switch; - /* Alignment options for fields in structures for sub-targets following AIX-like ABI. ALIGN_POWER word-aligns FP doubles (default AIX ABI). @@ -565,7 +311,6 @@ extern const char *rs6000_warn_altivec_long_switch; #define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128) #define TARGET_ALTIVEC_ABI rs6000_altivec_abi -#define TARGET_ALTIVEC_VRSAVE rs6000_altivec_vrsave #define TARGET_SPE_ABI 0 #define TARGET_SPE 0 @@ -1043,8 +788,9 @@ extern const char *rs6000_warn_altivec_long_switch; || (MODE) == V1DImode \ || (MODE) == V2SImode) -#define UNITS_PER_SIMD_WORD \ - (TARGET_ALTIVEC ? 16 : (TARGET_SPE ? 8 : 0) ) +#define UNITS_PER_SIMD_WORD \ + (TARGET_ALTIVEC ? UNITS_PER_ALTIVEC_WORD \ + : (TARGET_SPE ? UNITS_PER_SPE_WORD : UNITS_PER_WORD)) /* Value is TRUE if hard register REGNO can hold a value of machine-mode MODE. */ @@ -1257,12 +1003,12 @@ enum reg_class { 0x00000000, 0x00000000, 0x00000004, 0x00000000 }, /* CTR_REGS */ \ { 0x00000000, 0x00000000, 0x00000006, 0x00000000 }, /* LINK_OR_CTR_REGS */ \ { 0x00000000, 0x00000000, 0x00000007, 0x00002000 }, /* SPECIAL_REGS */ \ - { 0xffffffff, 0x00000000, 0x0000000f, 0x00000000 }, /* SPEC_OR_GEN_REGS */ \ + { 0xffffffff, 0x00000000, 0x0000000f, 0x00002000 }, /* SPEC_OR_GEN_REGS */ \ { 0x00000000, 0x00000000, 0x00000010, 0x00000000 }, /* CR0_REGS */ \ { 0x00000000, 0x00000000, 0x00000ff0, 0x00000000 }, /* CR_REGS */ \ { 0xffffffff, 0x00000000, 0x0000efff, 0x00000000 }, /* NON_FLOAT_REGS */ \ { 0x00000000, 0x00000000, 0x00001000, 0x00000000 }, /* XER_REGS */ \ - { 0xffffffff, 0xffffffff, 0xffffffff, 0x00003fff } /* ALL_REGS */ \ + { 0xffffffff, 0xffffffff, 0xffffffff, 0x0001ffff } /* ALL_REGS */ \ } /* The same information, inverted: @@ -1357,6 +1103,7 @@ enum reg_class 'U' is for V.4 small data references. 'W' is a vector constant that can be easily generated (no mem refs). 'Y' is a indexed or word-aligned displacement memory operand. + 'Z' is an indexed or indirect memory operand. 't' is for AND masks that can be performed by two rldic{l,r} insns. */ #define EXTRA_CONSTRAINT(OP, C) \ @@ -1372,6 +1119,7 @@ enum reg_class && !mask64_operand (OP, DImode)) \ : (C) == 'W' ? (easy_vector_constant (OP, GET_MODE (OP))) \ : (C) == 'Y' ? (word_offset_memref_operand (OP, GET_MODE (OP))) \ + : (C) == 'Z' ? (indexed_or_indirect_operand (OP, GET_MODE (OP))) \ : 0) /* Define which constraints are memory constraints. Tell reload @@ -1379,7 +1127,7 @@ enum reg_class memory address into a base register if required. */ #define EXTRA_MEMORY_CONSTRAINT(C, STR) \ - ((C) == 'Q' || (C) == 'Y') + ((C) == 'Q' || (C) == 'Y' || (C) == 'Z') /* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. @@ -1391,7 +1139,7 @@ enum reg_class We also don't want to reload integer values into floating-point registers if we can at all help it. In fact, this can - cause reload to abort, if it tries to generate a reload of CTR + cause reload to die, if it tries to generate a reload of CTR into a FP register and discovers it doesn't have the memory location required. @@ -2762,10 +2510,225 @@ enum rs6000_builtins ALTIVEC_BUILTIN_ABS_V4SF, ALTIVEC_BUILTIN_ABS_V8HI, ALTIVEC_BUILTIN_ABS_V16QI, - ALTIVEC_BUILTIN_COMPILETIME_ERROR, ALTIVEC_BUILTIN_MASK_FOR_LOAD, ALTIVEC_BUILTIN_MASK_FOR_STORE, + /* Altivec overloaded builtins. */ + ALTIVEC_BUILTIN_VCMPEQ_P, + ALTIVEC_BUILTIN_OVERLOADED_FIRST = ALTIVEC_BUILTIN_VCMPEQ_P, + ALTIVEC_BUILTIN_VCMPGT_P, + ALTIVEC_BUILTIN_VCMPGE_P, + ALTIVEC_BUILTIN_VEC_ABS, + ALTIVEC_BUILTIN_VEC_ABSS, + ALTIVEC_BUILTIN_VEC_ADD, + ALTIVEC_BUILTIN_VEC_ADDC, + ALTIVEC_BUILTIN_VEC_ADDS, + ALTIVEC_BUILTIN_VEC_AND, + ALTIVEC_BUILTIN_VEC_ANDC, + ALTIVEC_BUILTIN_VEC_AVG, + ALTIVEC_BUILTIN_VEC_CEIL, + ALTIVEC_BUILTIN_VEC_CMPB, + ALTIVEC_BUILTIN_VEC_CMPEQ, + ALTIVEC_BUILTIN_VEC_CMPEQUB, + ALTIVEC_BUILTIN_VEC_CMPEQUH, + ALTIVEC_BUILTIN_VEC_CMPEQUW, + ALTIVEC_BUILTIN_VEC_CMPGE, + ALTIVEC_BUILTIN_VEC_CMPGT, + ALTIVEC_BUILTIN_VEC_CMPLE, + ALTIVEC_BUILTIN_VEC_CMPLT, + ALTIVEC_BUILTIN_VEC_CTF, + ALTIVEC_BUILTIN_VEC_CTS, + ALTIVEC_BUILTIN_VEC_CTU, + ALTIVEC_BUILTIN_VEC_DST, + ALTIVEC_BUILTIN_VEC_DSTST, + ALTIVEC_BUILTIN_VEC_DSTSTT, + ALTIVEC_BUILTIN_VEC_DSTT, + ALTIVEC_BUILTIN_VEC_EXPTE, + ALTIVEC_BUILTIN_VEC_FLOOR, + ALTIVEC_BUILTIN_VEC_LD, + ALTIVEC_BUILTIN_VEC_LDE, + ALTIVEC_BUILTIN_VEC_LDL, + ALTIVEC_BUILTIN_VEC_LOGE, + ALTIVEC_BUILTIN_VEC_LVEBX, + ALTIVEC_BUILTIN_VEC_LVEHX, + ALTIVEC_BUILTIN_VEC_LVEWX, + ALTIVEC_BUILTIN_VEC_LVSL, + ALTIVEC_BUILTIN_VEC_LVSR, + ALTIVEC_BUILTIN_VEC_MADD, + ALTIVEC_BUILTIN_VEC_MADDS, + ALTIVEC_BUILTIN_VEC_MAX, + ALTIVEC_BUILTIN_VEC_MERGEH, + ALTIVEC_BUILTIN_VEC_MERGEL, + ALTIVEC_BUILTIN_VEC_MIN, + ALTIVEC_BUILTIN_VEC_MLADD, + ALTIVEC_BUILTIN_VEC_MPERM, + ALTIVEC_BUILTIN_VEC_MRADDS, + ALTIVEC_BUILTIN_VEC_MRGHB, + ALTIVEC_BUILTIN_VEC_MRGHH, + ALTIVEC_BUILTIN_VEC_MRGHW, + ALTIVEC_BUILTIN_VEC_MRGLB, + ALTIVEC_BUILTIN_VEC_MRGLH, + ALTIVEC_BUILTIN_VEC_MRGLW, + ALTIVEC_BUILTIN_VEC_MSUM, + ALTIVEC_BUILTIN_VEC_MSUMS, + ALTIVEC_BUILTIN_VEC_MTVSCR, + ALTIVEC_BUILTIN_VEC_MULE, + ALTIVEC_BUILTIN_VEC_MULO, + ALTIVEC_BUILTIN_VEC_NMSUB, + ALTIVEC_BUILTIN_VEC_NOR, + ALTIVEC_BUILTIN_VEC_OR, + ALTIVEC_BUILTIN_VEC_PACK, + ALTIVEC_BUILTIN_VEC_PACKPX, + ALTIVEC_BUILTIN_VEC_PACKS, + ALTIVEC_BUILTIN_VEC_PACKSU, + ALTIVEC_BUILTIN_VEC_PERM, + ALTIVEC_BUILTIN_VEC_RE, + ALTIVEC_BUILTIN_VEC_RL, + ALTIVEC_BUILTIN_VEC_ROUND, + ALTIVEC_BUILTIN_VEC_RSQRTE, + ALTIVEC_BUILTIN_VEC_SEL, + ALTIVEC_BUILTIN_VEC_SL, + ALTIVEC_BUILTIN_VEC_SLD, + ALTIVEC_BUILTIN_VEC_SLL, + ALTIVEC_BUILTIN_VEC_SLO, + ALTIVEC_BUILTIN_VEC_SPLAT, + ALTIVEC_BUILTIN_VEC_SPLAT_S16, + ALTIVEC_BUILTIN_VEC_SPLAT_S32, + ALTIVEC_BUILTIN_VEC_SPLAT_S8, + ALTIVEC_BUILTIN_VEC_SPLAT_U16, + ALTIVEC_BUILTIN_VEC_SPLAT_U32, + ALTIVEC_BUILTIN_VEC_SPLAT_U8, + ALTIVEC_BUILTIN_VEC_SPLTB, + ALTIVEC_BUILTIN_VEC_SPLTH, + ALTIVEC_BUILTIN_VEC_SPLTW, + ALTIVEC_BUILTIN_VEC_SR, + ALTIVEC_BUILTIN_VEC_SRA, + ALTIVEC_BUILTIN_VEC_SRL, + ALTIVEC_BUILTIN_VEC_SRO, + ALTIVEC_BUILTIN_VEC_ST, + ALTIVEC_BUILTIN_VEC_STE, + ALTIVEC_BUILTIN_VEC_STL, + ALTIVEC_BUILTIN_VEC_STVEBX, + ALTIVEC_BUILTIN_VEC_STVEHX, + ALTIVEC_BUILTIN_VEC_STVEWX, + ALTIVEC_BUILTIN_VEC_SUB, + ALTIVEC_BUILTIN_VEC_SUBC, + ALTIVEC_BUILTIN_VEC_SUBS, + ALTIVEC_BUILTIN_VEC_SUM2S, + ALTIVEC_BUILTIN_VEC_SUM4S, + ALTIVEC_BUILTIN_VEC_SUMS, + ALTIVEC_BUILTIN_VEC_TRUNC, + ALTIVEC_BUILTIN_VEC_UNPACKH, + ALTIVEC_BUILTIN_VEC_UNPACKL, + ALTIVEC_BUILTIN_VEC_VADDFP, + ALTIVEC_BUILTIN_VEC_VADDSBS, + ALTIVEC_BUILTIN_VEC_VADDSHS, + ALTIVEC_BUILTIN_VEC_VADDSWS, + ALTIVEC_BUILTIN_VEC_VADDUBM, + ALTIVEC_BUILTIN_VEC_VADDUBS, + ALTIVEC_BUILTIN_VEC_VADDUHM, + ALTIVEC_BUILTIN_VEC_VADDUHS, + ALTIVEC_BUILTIN_VEC_VADDUWM, + ALTIVEC_BUILTIN_VEC_VADDUWS, + ALTIVEC_BUILTIN_VEC_VAVGSB, + ALTIVEC_BUILTIN_VEC_VAVGSH, + ALTIVEC_BUILTIN_VEC_VAVGSW, + ALTIVEC_BUILTIN_VEC_VAVGUB, + ALTIVEC_BUILTIN_VEC_VAVGUH, + ALTIVEC_BUILTIN_VEC_VAVGUW, + ALTIVEC_BUILTIN_VEC_VCFSX, + ALTIVEC_BUILTIN_VEC_VCFUX, + ALTIVEC_BUILTIN_VEC_VCMPEQFP, + ALTIVEC_BUILTIN_VEC_VCMPEQUB, + ALTIVEC_BUILTIN_VEC_VCMPEQUH, + ALTIVEC_BUILTIN_VEC_VCMPEQUW, + ALTIVEC_BUILTIN_VEC_VCMPGTFP, + ALTIVEC_BUILTIN_VEC_VCMPGTSB, + ALTIVEC_BUILTIN_VEC_VCMPGTSH, + ALTIVEC_BUILTIN_VEC_VCMPGTSW, + ALTIVEC_BUILTIN_VEC_VCMPGTUB, + ALTIVEC_BUILTIN_VEC_VCMPGTUH, + ALTIVEC_BUILTIN_VEC_VCMPGTUW, + ALTIVEC_BUILTIN_VEC_VMAXFP, + ALTIVEC_BUILTIN_VEC_VMAXSB, + ALTIVEC_BUILTIN_VEC_VMAXSH, + ALTIVEC_BUILTIN_VEC_VMAXSW, + ALTIVEC_BUILTIN_VEC_VMAXUB, + ALTIVEC_BUILTIN_VEC_VMAXUH, + ALTIVEC_BUILTIN_VEC_VMAXUW, + ALTIVEC_BUILTIN_VEC_VMINFP, + ALTIVEC_BUILTIN_VEC_VMINSB, + ALTIVEC_BUILTIN_VEC_VMINSH, + ALTIVEC_BUILTIN_VEC_VMINSW, + ALTIVEC_BUILTIN_VEC_VMINUB, + ALTIVEC_BUILTIN_VEC_VMINUH, + ALTIVEC_BUILTIN_VEC_VMINUW, + ALTIVEC_BUILTIN_VEC_VMRGHB, + ALTIVEC_BUILTIN_VEC_VMRGHH, + ALTIVEC_BUILTIN_VEC_VMRGHW, + ALTIVEC_BUILTIN_VEC_VMRGLB, + ALTIVEC_BUILTIN_VEC_VMRGLH, + ALTIVEC_BUILTIN_VEC_VMRGLW, + ALTIVEC_BUILTIN_VEC_VMSUMMBM, + ALTIVEC_BUILTIN_VEC_VMSUMSHM, + ALTIVEC_BUILTIN_VEC_VMSUMSHS, + ALTIVEC_BUILTIN_VEC_VMSUMUBM, + ALTIVEC_BUILTIN_VEC_VMSUMUHM, + ALTIVEC_BUILTIN_VEC_VMSUMUHS, + ALTIVEC_BUILTIN_VEC_VMULESB, + ALTIVEC_BUILTIN_VEC_VMULESH, + ALTIVEC_BUILTIN_VEC_VMULEUB, + ALTIVEC_BUILTIN_VEC_VMULEUH, + ALTIVEC_BUILTIN_VEC_VMULOSB, + ALTIVEC_BUILTIN_VEC_VMULOSH, + ALTIVEC_BUILTIN_VEC_VMULOUB, + ALTIVEC_BUILTIN_VEC_VMULOUH, + ALTIVEC_BUILTIN_VEC_VPKSHSS, + ALTIVEC_BUILTIN_VEC_VPKSHUS, + ALTIVEC_BUILTIN_VEC_VPKSWSS, + ALTIVEC_BUILTIN_VEC_VPKSWUS, + ALTIVEC_BUILTIN_VEC_VPKUHUM, + ALTIVEC_BUILTIN_VEC_VPKUHUS, + ALTIVEC_BUILTIN_VEC_VPKUWUM, + ALTIVEC_BUILTIN_VEC_VPKUWUS, + ALTIVEC_BUILTIN_VEC_VRLB, + ALTIVEC_BUILTIN_VEC_VRLH, + ALTIVEC_BUILTIN_VEC_VRLW, + ALTIVEC_BUILTIN_VEC_VSLB, + ALTIVEC_BUILTIN_VEC_VSLH, + ALTIVEC_BUILTIN_VEC_VSLW, + ALTIVEC_BUILTIN_VEC_VSPLTB, + ALTIVEC_BUILTIN_VEC_VSPLTH, + ALTIVEC_BUILTIN_VEC_VSPLTW, + ALTIVEC_BUILTIN_VEC_VSRAB, + ALTIVEC_BUILTIN_VEC_VSRAH, + ALTIVEC_BUILTIN_VEC_VSRAW, + ALTIVEC_BUILTIN_VEC_VSRB, + ALTIVEC_BUILTIN_VEC_VSRH, + ALTIVEC_BUILTIN_VEC_VSRW, + ALTIVEC_BUILTIN_VEC_VSUBFP, + ALTIVEC_BUILTIN_VEC_VSUBSBS, + ALTIVEC_BUILTIN_VEC_VSUBSHS, + ALTIVEC_BUILTIN_VEC_VSUBSWS, + ALTIVEC_BUILTIN_VEC_VSUBUBM, + ALTIVEC_BUILTIN_VEC_VSUBUBS, + ALTIVEC_BUILTIN_VEC_VSUBUHM, + ALTIVEC_BUILTIN_VEC_VSUBUHS, + ALTIVEC_BUILTIN_VEC_VSUBUWM, + ALTIVEC_BUILTIN_VEC_VSUBUWS, + ALTIVEC_BUILTIN_VEC_VSUM4SBS, + ALTIVEC_BUILTIN_VEC_VSUM4SHS, + ALTIVEC_BUILTIN_VEC_VSUM4UBS, + ALTIVEC_BUILTIN_VEC_VUPKHPX, + ALTIVEC_BUILTIN_VEC_VUPKHSB, + ALTIVEC_BUILTIN_VEC_VUPKHSH, + ALTIVEC_BUILTIN_VEC_VUPKLPX, + ALTIVEC_BUILTIN_VEC_VUPKLSB, + ALTIVEC_BUILTIN_VEC_VUPKLSH, + ALTIVEC_BUILTIN_VEC_XOR, + ALTIVEC_BUILTIN_VEC_STEP, + ALTIVEC_BUILTIN_OVERLOADED_LAST = ALTIVEC_BUILTIN_VEC_STEP, + /* SPE builtins. */ SPE_BUILTIN_EVADDW, SPE_BUILTIN_EVAND, @@ -2999,5 +2962,84 @@ enum rs6000_builtins SPE_BUILTIN_EVMWHGUMIAN, SPE_BUILTIN_MTSPEFSCR, SPE_BUILTIN_MFSPEFSCR, - SPE_BUILTIN_BRINC + SPE_BUILTIN_BRINC, + + RS6000_BUILTIN_COUNT +}; + +enum rs6000_builtin_type_index +{ + RS6000_BTI_NOT_OPAQUE, + RS6000_BTI_opaque_V2SI, + RS6000_BTI_opaque_V2SF, + RS6000_BTI_opaque_p_V2SI, + RS6000_BTI_opaque_V4SI, + RS6000_BTI_V16QI, + RS6000_BTI_V2SI, + RS6000_BTI_V2SF, + RS6000_BTI_V4HI, + RS6000_BTI_V4SI, + RS6000_BTI_V4SF, + RS6000_BTI_V8HI, + RS6000_BTI_unsigned_V16QI, + RS6000_BTI_unsigned_V8HI, + RS6000_BTI_unsigned_V4SI, + RS6000_BTI_bool_char, /* __bool char */ + RS6000_BTI_bool_short, /* __bool short */ + RS6000_BTI_bool_int, /* __bool int */ + RS6000_BTI_pixel, /* __pixel */ + RS6000_BTI_bool_V16QI, /* __vector __bool char */ + RS6000_BTI_bool_V8HI, /* __vector __bool short */ + RS6000_BTI_bool_V4SI, /* __vector __bool int */ + RS6000_BTI_pixel_V8HI, /* __vector __pixel */ + RS6000_BTI_long, /* long_integer_type_node */ + RS6000_BTI_unsigned_long, /* long_unsigned_type_node */ + RS6000_BTI_INTQI, /* intQI_type_node */ + RS6000_BTI_UINTQI, /* unsigned_intQI_type_node */ + RS6000_BTI_INTHI, /* intHI_type_node */ + RS6000_BTI_UINTHI, /* unsigned_intHI_type_node */ + RS6000_BTI_INTSI, /* intSI_type_node */ + RS6000_BTI_UINTSI, /* unsigned_intSI_type_node */ + RS6000_BTI_float, /* float_type_node */ + RS6000_BTI_void, /* void_type_node */ + RS6000_BTI_MAX }; + + +#define opaque_V2SI_type_node (rs6000_builtin_types[RS6000_BTI_opaque_V2SI]) +#define opaque_V2SF_type_node (rs6000_builtin_types[RS6000_BTI_opaque_V2SF]) +#define opaque_p_V2SI_type_node (rs6000_builtin_types[RS6000_BTI_opaque_p_V2SI]) +#define opaque_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_opaque_V4SI]) +#define V16QI_type_node (rs6000_builtin_types[RS6000_BTI_V16QI]) +#define V2SI_type_node (rs6000_builtin_types[RS6000_BTI_V2SI]) +#define V2SF_type_node (rs6000_builtin_types[RS6000_BTI_V2SF]) +#define V4HI_type_node (rs6000_builtin_types[RS6000_BTI_V4HI]) +#define V4SI_type_node (rs6000_builtin_types[RS6000_BTI_V4SI]) +#define V4SF_type_node (rs6000_builtin_types[RS6000_BTI_V4SF]) +#define V8HI_type_node (rs6000_builtin_types[RS6000_BTI_V8HI]) +#define unsigned_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_unsigned_V16QI]) +#define unsigned_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_unsigned_V8HI]) +#define unsigned_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_unsigned_V4SI]) +#define bool_char_type_node (rs6000_builtin_types[RS6000_BTI_bool_char]) +#define bool_short_type_node (rs6000_builtin_types[RS6000_BTI_bool_short]) +#define bool_int_type_node (rs6000_builtin_types[RS6000_BTI_bool_int]) +#define pixel_type_node (rs6000_builtin_types[RS6000_BTI_pixel]) +#define bool_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V16QI]) +#define bool_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V8HI]) +#define bool_V4SI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V4SI]) +#define pixel_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_pixel_V8HI]) + +#define long_integer_type_internal_node (rs6000_builtin_types[RS6000_BTI_long]) +#define long_unsigned_type_internal_node (rs6000_builtin_types[RS6000_BTI_unsigned_long]) +#define intQI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTQI]) +#define uintQI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTQI]) +#define intHI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTHI]) +#define uintHI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTHI]) +#define intSI_type_internal_node (rs6000_builtin_types[RS6000_BTI_INTSI]) +#define uintSI_type_internal_node (rs6000_builtin_types[RS6000_BTI_UINTSI]) +#define float_type_internal_node (rs6000_builtin_types[RS6000_BTI_float]) +#define void_type_internal_node (rs6000_builtin_types[RS6000_BTI_void]) + +extern GTY(()) tree rs6000_builtin_types[RS6000_BTI_MAX]; +extern GTY(()) tree rs6000_builtin_decls[RS6000_BUILTIN_COUNT]; + diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index fc4b6f1cfb2..2c0b0491abe 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -51,6 +51,13 @@ (UNSPEC_TLSTLS 29) (UNSPEC_FIX_TRUNC_TF 30) ; fadd, rounding towards zero (UNSPEC_MV_CR_GT 31) ; move_from_CR_eq_bit + (UNSPEC_STFIWX 32) + (UNSPEC_SYNC 33) + (UNSPEC_SYNC_OP 34) + (UNSPEC_SYNC_SWAP 35) + (UNSPEC_LWSYNC 36) + (UNSPEC_ISYNC 37) + (UNSPEC_POPCNTB 38) ]) ;; @@ -107,10 +114,32 @@ (include "darwin.md") -;; This mode macro allows :P to be used for patterns that operate on -;; pointer-sized quantities. Exactly one of the two alternatives will match. -(define_mode_macro P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) +;; Mode macros +; This mode macro allows :GPR to be used to indicate the allowable size +; of whole values in GPRs. +(define_mode_macro GPR [SI (DI "TARGET_POWERPC64")]) + +; Any supported integer mode. +(define_mode_macro INT [QI HI SI DI TI]) + +; Any supported integer mode that fits in one register. +(define_mode_macro INT1 [QI HI SI (DI "TARGET_POWERPC64")]) + +; SImode or DImode, even if DImode doesn't fit in GPRs. +(define_mode_macro SDI [SI DI]) + +; The size of a pointer. Also, the size of the value that a record-condition +; (one with a '.') will compare. +(define_mode_macro P [(SI "TARGET_32BIT") (DI "TARGET_64BIT")]) + +; Various instructions that come in SI and DI forms. +(define_mode_attr larx [(SI "lwarx") (DI "ldarx")]) +(define_mode_attr stcx [(SI "stwcx.") (DI "stdcx.")]) +; A generic w/d attribute, for things like cmpw/cmpd. +(define_mode_attr wd [(SI "w") (DI "d")]) + + ;; Start with fixed-point load and store insns. Here we put only the more ;; complex forms. Basic data transfer is done later. @@ -977,38 +1006,49 @@ ;; Fixed-point arithmetic insns. -;; Discourage ai/addic because of carry but provide it in an alternative -;; allowing register zero as source. -(define_expand "addsi3" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_arith_cint_operand" "")))] +(define_mode_attr add_op2 [(SI "reg_or_arith_cint_operand") + (DI "reg_or_add_cint64_operand")]) + +(define_expand "add3" + [(set (match_operand:SDI 0 "gpc_reg_operand" "") + (plus:SDI (match_operand:SDI 1 "gpc_reg_operand" "") + (match_operand:SDI 2 "" "")))] "" " { - if (GET_CODE (operands[2]) == CONST_INT - && ! add_operand (operands[2], SImode)) + if (mode == DImode && ! TARGET_POWERPC64) + { + if (non_short_cint_operand (operands[2], DImode)) + FAIL; + } + else if (GET_CODE (operands[2]) == CONST_INT + && ! add_operand (operands[2], mode)) { rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1])) - ? operands[0] : gen_reg_rtx (SImode)); + ? operands[0] : gen_reg_rtx (mode)); HOST_WIDE_INT val = INTVAL (operands[2]); HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode); + HOST_WIDE_INT rest = trunc_int_for_mode (val - low, mode); + + if (mode == DImode && !CONST_OK_FOR_LETTER_P (rest, 'L')) + FAIL; /* The ordering here is important for the prolog expander. When space is allocated from the stack, adding 'low' first may produce a temporary deallocation (which would be bad). */ - emit_insn (gen_addsi3 (tmp, operands[1], GEN_INT (rest))); - emit_insn (gen_addsi3 (operands[0], tmp, GEN_INT (low))); + emit_insn (gen_add3 (tmp, operands[1], GEN_INT (rest))); + emit_insn (gen_add3 (operands[0], tmp, GEN_INT (low))); DONE; } }") -(define_insn "*addsi3_internal1" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,?r,r") - (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,b,r,b") - (match_operand:SI 2 "add_operand" "r,I,I,L")))] +;; Discourage ai/addic because of carry but provide it in an alternative +;; allowing register zero as source. +(define_insn "*add3_internal1" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r,?r,r") + (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "%r,b,r,b") + (match_operand:GPR 2 "add_operand" "r,I,I,L")))] "" "@ {cax|add} %0,%1,%2 @@ -1025,13 +1065,13 @@ "{cau|addis} %0,%1,ha16(%2)" [(set_attr "length" "4")]) -(define_insn "*addsi3_internal2" +(define_insn "*add3_internal2" [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I")) + (compare:CC (plus:P (match_operand:P 1 "gpc_reg_operand" "%r,r,r,r") + (match_operand:P 2 "reg_or_short_operand" "r,I,r,I")) (const_int 0))) - (clobber (match_scratch:SI 3 "=r,r,r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 3 "=r,r,r,r"))] + "" "@ {cax.|add.} %3,%1,%2 {ai.|addic.} %3,%1,%2 @@ -1042,28 +1082,28 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) + (compare:CC (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "reg_or_short_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 3 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:GPR 3 ""))] + "reload_completed" [(set (match_dup 3) - (plus:SI (match_dup 1) + (plus:GPR (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) (const_int 0)))] "") -(define_insn "*addsi3_internal3" +(define_insn "*add3_internal3" [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:SI 2 "reg_or_short_operand" "r,I,r,I")) + (compare:CC (plus:P (match_operand:P 1 "gpc_reg_operand" "%r,r,r,r") + (match_operand:P 2 "reg_or_short_operand" "r,I,r,I")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r") - (plus:SI (match_dup 1) - (match_dup 2)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r,r,r") + (plus:P (match_dup 1) + (match_dup 2)))] + "" "@ {cax.|add.} %0,%1,%2 {ai.|addic.} %0,%1,%2 @@ -1074,15 +1114,15 @@ (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "reg_or_short_operand" "")) + (compare:CC (plus:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "reg_or_short_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (plus:P (match_dup 1) (match_dup 2)))] + "reload_completed" [(set (match_dup 0) - (plus:SI (match_dup 1) - (match_dup 2))) + (plus:P (match_dup 1) + (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] @@ -1093,34 +1133,44 @@ ;; add should be last in case the result gets used in an address. (define_split - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (plus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "non_add_cint_operand" "")))] + [(set (match_operand:GPR 0 "gpc_reg_operand" "") + (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "") + (match_operand:GPR 2 "non_add_cint_operand" "")))] "" - [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 3))) - (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 4)))] + [(set (match_dup 0) (plus:GPR (match_dup 1) (match_dup 3))) + (set (match_dup 0) (plus:GPR (match_dup 0) (match_dup 4)))] " { HOST_WIDE_INT val = INTVAL (operands[2]); HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, SImode); + HOST_WIDE_INT rest = trunc_int_for_mode (val - low, mode); - operands[3] = GEN_INT (rest); operands[4] = GEN_INT (low); + if (mode == SImode || CONST_OK_FOR_LETTER_P (rest, 'L')) + operands[3] = GEN_INT (rest); + else if (! no_new_pseudos) + { + operands[3] = gen_reg_rtx (DImode); + emit_move_insn (operands[3], operands[2]); + emit_insn (gen_adddi3 (operands[0], operands[1], operands[3])); + DONE; + } + else + FAIL; }") -(define_insn "one_cmplsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (not:SI (match_operand:SI 1 "gpc_reg_operand" "r")))] +(define_insn "one_cmpl2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" "nor %0,%1,%1") (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:SI 2 "=r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 2 "=r,r"))] + "" "@ nor. %2,%1,%1 #" @@ -1129,12 +1179,12 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 2 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 2 ""))] + "reload_completed" [(set (match_dup 2) - (not:SI (match_dup 1))) + (not:P (match_dup 1))) (set (match_dup 0) (compare:CC (match_dup 2) (const_int 0)))] @@ -1142,11 +1192,11 @@ (define_insn "" [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (not:SI (match_dup 1)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (not:P (match_dup 1)))] + "" "@ nor. %0,%1,%1 #" @@ -1155,13 +1205,13 @@ (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (not:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (not:SI (match_dup 1)))] - "TARGET_32BIT && reload_completed" + (set (match_operand:P 0 "gpc_reg_operand" "") + (not:P (match_dup 1)))] + "reload_completed" [(set (match_dup 0) - (not:SI (match_dup 1))) + (not:P (match_dup 1))) (set (match_dup 2) (compare:CC (match_dup 0) (const_int 0)))] @@ -1175,9 +1225,9 @@ "{sf%I1|subf%I1c} %0,%2,%1") (define_insn "" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (minus:SI (match_operand:SI 1 "reg_or_short_operand" "r,I") - (match_operand:SI 2 "gpc_reg_operand" "r,r")))] + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r") + (minus:GPR (match_operand:GPR 1 "reg_or_short_operand" "r,I") + (match_operand:GPR 2 "gpc_reg_operand" "r,r")))] "TARGET_POWERPC" "@ subf %0,%2,%1 @@ -1198,11 +1248,11 @@ (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "gpc_reg_operand" "r,r")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:SI 3 "=r,r"))] - "TARGET_POWERPC && TARGET_32BIT" + (clobber (match_scratch:P 3 "=r,r"))] + "TARGET_POWERPC" "@ subf. %3,%2,%1 #" @@ -1211,13 +1261,13 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "gpc_reg_operand" "")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "gpc_reg_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 3 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 3 ""))] + "reload_completed" [(set (match_dup 3) - (minus:SI (match_dup 1) + (minus:P (match_dup 1) (match_dup 2))) (set (match_dup 0) (compare:CC (match_dup 3) @@ -1240,13 +1290,13 @@ (define_insn "" [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "r,r") - (match_operand:SI 2 "gpc_reg_operand" "r,r")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "r,r") + (match_operand:P 2 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (minus:SI (match_dup 1) + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (minus:P (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC && TARGET_32BIT" + "TARGET_POWERPC" "@ subf. %0,%2,%1 #" @@ -1255,32 +1305,35 @@ (define_split [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:SI (match_operand:SI 1 "gpc_reg_operand" "") - (match_operand:SI 2 "gpc_reg_operand" "")) + (compare:CC (minus:P (match_operand:P 1 "gpc_reg_operand" "") + (match_operand:P 2 "gpc_reg_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (minus:SI (match_dup 1) + (set (match_operand:P 0 "gpc_reg_operand" "") + (minus:P (match_dup 1) (match_dup 2)))] - "TARGET_32BIT && reload_completed" + "reload_completed" [(set (match_dup 0) - (minus:SI (match_dup 1) + (minus:P (match_dup 1) (match_dup 2))) (set (match_dup 3) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_expand "subsi3" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (minus:SI (match_operand:SI 1 "reg_or_short_operand" "") - (match_operand:SI 2 "reg_or_arith_cint_operand" "")))] +(define_mode_attr sub_op2 [(SI "reg_or_arith_cint_operand") + (DI "reg_or_sub_cint64_operand")]) + +(define_expand "sub3" + [(set (match_operand:SDI 0 "gpc_reg_operand" "") + (minus:SDI (match_operand:SDI 1 "reg_or_short_operand" "") + (match_operand:SDI 2 "" "")))] "" " { if (GET_CODE (operands[2]) == CONST_INT) { - emit_insn (gen_addsi3 (operands[0], operands[1], - negate_rtx (SImode, operands[2]))); + emit_insn (gen_add3 (operands[0], operands[1], + negate_rtx (mode, operands[2]))); DONE; } }") @@ -1563,18 +1616,24 @@ (set (match_dup 0) (minus:SI (match_dup 2) (match_dup 0)))] "") -(define_insn "negsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r")))] +(define_expand "neg2" + [(set (match_operand:SDI 0 "gpc_reg_operand" "") + (neg:SDI (match_operand:SDI 1 "gpc_reg_operand" "")))] + "" + "") + +(define_insn "*neg2_internal" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" "neg %0,%1") (define_insn "" [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (clobber (match_scratch:SI 2 "=r,r"))] - "TARGET_32BIT" + (clobber (match_scratch:P 2 "=r,r"))] + "" "@ neg. %2,%1 #" @@ -1583,12 +1642,12 @@ (define_split [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (clobber (match_scratch:SI 2 ""))] - "TARGET_32BIT && reload_completed" + (clobber (match_scratch:P 2 ""))] + "reload_completed" [(set (match_dup 2) - (neg:SI (match_dup 1))) + (neg:P (match_dup 1))) (set (match_dup 0) (compare:CC (match_dup 2) (const_int 0)))] @@ -1596,11 +1655,11 @@ (define_insn "" [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "r,r")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r,r") - (neg:SI (match_dup 1)))] - "TARGET_32BIT" + (set (match_operand:P 0 "gpc_reg_operand" "=r,r") + (neg:P (match_dup 1)))] + "" "@ neg. %0,%1 #" @@ -1609,56 +1668,85 @@ (define_split [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "")) + (compare:CC (neg:P (match_operand:P 1 "gpc_reg_operand" "")) (const_int 0))) - (set (match_operand:SI 0 "gpc_reg_operand" "") - (neg:SI (match_dup 1)))] + (set (match_operand:P 0 "gpc_reg_operand" "") + (neg:P (match_dup 1)))] "TARGET_32BIT && reload_completed" [(set (match_dup 0) - (neg:SI (match_dup 1))) + (neg:P (match_dup 1))) (set (match_dup 2) (compare:CC (match_dup 0) (const_int 0)))] "") -(define_insn "clzsi2" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (clz:SI (match_operand:SI 1 "gpc_reg_operand" "r")))] +(define_insn "clz2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (clz:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")))] "" - "{cntlz|cntlzw} %0,%1") + "{cntlz|cntlz} %0,%1") -(define_expand "ctzsi2" +(define_expand "ctz2" [(set (match_dup 2) - (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:SI (match_dup 1) - (match_dup 2))) + (neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r"))) + (parallel [(set (match_dup 3) (and:GPR (match_dup 1) + (match_dup 2))) (clobber (scratch:CC))]) - (set (match_dup 4) (clz:SI (match_dup 3))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r") - (minus:SI (const_int 31) (match_dup 4)))] + (set (match_dup 4) (clz:GPR (match_dup 3))) + (set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (minus:GPR (match_dup 5) (match_dup 4)))] "" { - operands[2] = gen_reg_rtx (SImode); - operands[3] = gen_reg_rtx (SImode); - operands[4] = gen_reg_rtx (SImode); + operands[2] = gen_reg_rtx (mode); + operands[3] = gen_reg_rtx (mode); + operands[4] = gen_reg_rtx (mode); + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode) - 1); }) -(define_expand "ffssi2" +(define_expand "ffs2" [(set (match_dup 2) - (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:SI (match_dup 1) - (match_dup 2))) + (neg:GPR (match_operand:GPR 1 "gpc_reg_operand" "r"))) + (parallel [(set (match_dup 3) (and:GPR (match_dup 1) + (match_dup 2))) (clobber (scratch:CC))]) - (set (match_dup 4) (clz:SI (match_dup 3))) - (set (match_operand:SI 0 "gpc_reg_operand" "=r") - (minus:SI (const_int 32) (match_dup 4)))] + (set (match_dup 4) (clz:GPR (match_dup 3))) + (set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (minus:GPR (match_dup 5) (match_dup 4)))] "" { - operands[2] = gen_reg_rtx (SImode); - operands[3] = gen_reg_rtx (SImode); - operands[4] = gen_reg_rtx (SImode); + operands[2] = gen_reg_rtx (mode); + operands[3] = gen_reg_rtx (mode); + operands[4] = gen_reg_rtx (mode); + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode)); + }) + +(define_expand "popcount2" + [(set (match_dup 2) + (unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r")] + UNSPEC_POPCNTB)) + (set (match_dup 3) + (mult:GPR (match_dup 2) (match_dup 4))) + (set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (lshiftrt:GPR (match_dup 3) (match_dup 5)))] + "TARGET_POPCNTB" + { + operands[2] = gen_reg_rtx (mode); + operands[3] = gen_reg_rtx (mode); + operands[4] = force_reg (mode, + mode == SImode + ? GEN_INT (0x01010101) + : GEN_INT ((HOST_WIDE_INT) + 0x01010101 << 32 | 0x01010101)); + operands[5] = GEN_INT (GET_MODE_BITSIZE (mode) - 8); }) +(define_insn "popcntb2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (unspec:GPR [(match_operand:GPR 1 "gpc_reg_operand" "r")] + UNSPEC_POPCNTB))] + "TARGET_POPCNTB" + "popcntb %0,%1") + (define_expand "mulsi3" [(use (match_operand:SI 0 "gpc_reg_operand" "")) (use (match_operand:SI 1 "gpc_reg_operand" "")) @@ -2926,7 +3014,7 @@ int size = INTVAL (operands[1]) & 31; operands[4] = GEN_INT (shift - start - size); - operands[1] = GEN_INT (start + size - 1); + operands[1] = GEN_INT (start + size - 1 - shift); return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\"; }" [(set_attr "type" "insert_word")]) @@ -3741,7 +3829,7 @@ (const_int 0)))] "") -(define_insn "" +(define_insn "rlwinm" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (and:SI (ashift:SI (match_operand:SI 1 "gpc_reg_operand" "r") (match_operand:SI 2 "const_int_operand" "i")) @@ -4422,7 +4510,7 @@ # fmr %0,%1 lfs%U1%X1 %0,%1" - "&& reload_completed && REGNO (operands[0]) == REGNO (operands[1])" + "&& reload_completed && REG_P (operands[1]) && REGNO (operands[0]) == REGNO (operands[1])" [(const_int 0)] { emit_note (NOTE_INSN_DELETED); @@ -5139,7 +5227,7 @@ operands[6] = gen_reg_rtx (SImode); }") -(define_insn "*floatsidf2_internal" +(define_insn_and_split "*floatsidf2_internal" [(set (match_operand:DF 0 "gpc_reg_operand" "=&f") (float:DF (match_operand:SI 1 "gpc_reg_operand" "r"))) (use (match_operand:SI 2 "gpc_reg_operand" "r")) @@ -5149,31 +5237,14 @@ (clobber (match_operand:SI 6 "gpc_reg_operand" "=&r"))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" "#" - [(set_attr "length" "24")]) - -(define_split - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" "")) - (clobber (match_operand:SI 6 "gpc_reg_operand" ""))] - "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" "")) - (clobber (match_operand:SI 6 "gpc_reg_operand" ""))] + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[4]))" + [(pc)] " { rtx lowword, highword; - if (GET_CODE (operands[4]) != MEM) - abort(); - highword = XEXP (operands[4], 0); - lowword = plus_constant (highword, 4); + gcc_assert (MEM_P (operands[4])); + highword = adjust_address (operands[4], SImode, 0); + lowword = adjust_address (operands[4], SImode, 4); if (! WORDS_BIG_ENDIAN) { rtx tmp; @@ -5182,12 +5253,13 @@ emit_insn (gen_xorsi3 (operands[6], operands[1], GEN_INT (~ (HOST_WIDE_INT) 0x7fffffff))); - emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[6]); - emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]); + emit_move_insn (lowword, operands[6]); + emit_move_insn (highword, operands[2]); emit_move_insn (operands[5], operands[4]); emit_insn (gen_subdf3 (operands[0], operands[5], operands[3])); DONE; -}") +}" + [(set_attr "length" "24")]) (define_expand "floatunssisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "") @@ -5226,7 +5298,7 @@ operands[5] = gen_reg_rtx (DFmode); }") -(define_insn "*floatunssidf2_internal" +(define_insn_and_split "*floatunssidf2_internal" [(set (match_operand:DF 0 "gpc_reg_operand" "=&f") (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r"))) (use (match_operand:SI 2 "gpc_reg_operand" "r")) @@ -5235,44 +5307,30 @@ (clobber (match_operand:DF 5 "gpc_reg_operand" "=&f"))] "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" "#" - [(set_attr "length" "20")]) - -(define_split - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" ""))] - "! TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS" - [(set (match_operand:DF 0 "gpc_reg_operand" "") - (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" ""))) - (use (match_operand:SI 2 "gpc_reg_operand" "")) - (use (match_operand:DF 3 "gpc_reg_operand" "")) - (clobber (match_operand:DF 4 "offsettable_mem_operand" "")) - (clobber (match_operand:DF 5 "gpc_reg_operand" ""))] + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[4]))" + [(pc)] " { rtx lowword, highword; - if (GET_CODE (operands[4]) != MEM) - abort(); - highword = XEXP (operands[4], 0); - lowword = plus_constant (highword, 4); + gcc_assert (MEM_P (operands[4])); + highword = adjust_address (operands[4], SImode, 0); + lowword = adjust_address (operands[4], SImode, 4); if (! WORDS_BIG_ENDIAN) { rtx tmp; tmp = highword; highword = lowword; lowword = tmp; } - emit_move_insn (gen_rtx_MEM (SImode, lowword), operands[1]); - emit_move_insn (gen_rtx_MEM (SImode, highword), operands[2]); + emit_move_insn (lowword, operands[1]); + emit_move_insn (highword, operands[2]); emit_move_insn (operands[5], operands[4]); emit_insn (gen_subdf3 (operands[0], operands[5], operands[3])); DONE; -}") +}" + [(set_attr "length" "20")]) (define_expand "fix_truncdfsi2" - [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "") + [(parallel [(set (match_operand:SI 0 "fix_trunc_dest_operand" "") (fix:SI (match_operand:DF 1 "gpc_reg_operand" ""))) (clobber (match_dup 2)) (clobber (match_dup 3))])] @@ -5286,55 +5344,80 @@ DONE; } operands[2] = gen_reg_rtx (DImode); + if (TARGET_PPC_GFXOPT) + { + rtx orig_dest = operands[0]; + if (! memory_operand (orig_dest, GET_MODE (orig_dest))) + operands[0] = assign_stack_temp (SImode, GET_MODE_SIZE (SImode), 0); + emit_insn (gen_fix_truncdfsi2_internal_gfxopt (operands[0], operands[1], + operands[2])); + if (operands[0] != orig_dest) + emit_move_insn (orig_dest, operands[0]); + DONE; + } operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0); }") -(define_insn "*fix_truncdfsi2_internal" +(define_insn_and_split "*fix_truncdfsi2_internal" [(set (match_operand:SI 0 "gpc_reg_operand" "=r") (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))) (clobber (match_operand:DI 2 "gpc_reg_operand" "=f")) (clobber (match_operand:DI 3 "memory_operand" "=o"))] "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" "#" - [(set_attr "length" "16")]) - -(define_split - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (fix:SI (match_operand:DF 1 "gpc_reg_operand" ""))) - (clobber (match_operand:DI 2 "gpc_reg_operand" "")) - (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))] - "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" - [(set (match_operand:SI 0 "gpc_reg_operand" "") - (fix:SI (match_operand:DF 1 "gpc_reg_operand" ""))) - (clobber (match_operand:DI 2 "gpc_reg_operand" "")) - (clobber (match_operand:DI 3 "offsettable_mem_operand" ""))] + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[3]))" + [(pc)] " { rtx lowword; - if (GET_CODE (operands[3]) != MEM) - abort(); - lowword = XEXP (operands[3], 0); - if (WORDS_BIG_ENDIAN) - lowword = plus_constant (lowword, 4); + gcc_assert (MEM_P (operands[3])); + lowword = adjust_address (operands[3], SImode, WORDS_BIG_ENDIAN ? 4 : 0); emit_insn (gen_fctiwz (operands[2], operands[1])); emit_move_insn (operands[3], operands[2]); - emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword)); + emit_move_insn (operands[0], lowword); DONE; -}") +}" + [(set_attr "length" "16")]) + +(define_insn_and_split "fix_truncdfsi2_internal_gfxopt" + [(set (match_operand:SI 0 "memory_operand" "=Z") + (fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))) + (clobber (match_operand:DI 2 "gpc_reg_operand" "=f"))] + "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS + && TARGET_PPC_GFXOPT" + "#" + "&& 1" + [(pc)] + " +{ + emit_insn (gen_fctiwz (operands[2], operands[1])); + emit_insn (gen_stfiwx (operands[0], operands[2])); + DONE; +}" + [(set_attr "length" "16")]) ; Here, we use (set (reg) (unspec:DI [(fix:SI ...)] UNSPEC_FCTIWZ)) ; rather than (set (subreg:SI (reg)) (fix:SI ...)) ; because the first makes it clear that operand 0 is not live ; before the instruction. (define_insn "fctiwz" - [(set (match_operand:DI 0 "gpc_reg_operand" "=*f") + [(set (match_operand:DI 0 "gpc_reg_operand" "=f") (unspec:DI [(fix:SI (match_operand:DF 1 "gpc_reg_operand" "f"))] UNSPEC_FCTIWZ))] "(TARGET_POWER2 || TARGET_POWERPC) && TARGET_HARD_FLOAT && TARGET_FPRS" "{fcirz|fctiwz} %0,%1" [(set_attr "type" "fp")]) +; An UNSPEC is used so we don't have to support SImode in FP registers. +(define_insn "stfiwx" + [(set (match_operand:SI 0 "memory_operand" "=Z") + (unspec:SI [(match_operand:DI 1 "gpc_reg_operand" "f")] + UNSPEC_STFIWX))] + "TARGET_PPC_GFXOPT" + "stfiwx %1,%y0" + [(set_attr "type" "fpstore")]) + (define_expand "floatsisf2" [(set (match_operand:SF 0 "gpc_reg_operand" "") (float:SF (match_operand:SI 1 "gpc_reg_operand" "")))] @@ -5786,306 +5869,28 @@ (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") (match_operand:SI 2 "const_int_operand" "M,i")))] "TARGET_32BIT && !TARGET_POWERPC64 && !TARGET_POWER && WORDS_BIG_ENDIAN" - "@ - {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2 - {sri|srwi} %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;{srai|srawi} %0,%1,%h2" - [(set_attr "type" "two,three") - (set_attr "length" "8,12")]) - -(define_insn "*ashrdisi3_noppc64" - [(set (match_operand:SI 0 "gpc_reg_operand" "=r") - (subreg:SI (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r") - (const_int 32)) 4))] - "TARGET_32BIT && !TARGET_POWERPC64" - "* -{ - if (REGNO (operands[0]) == REGNO (operands[1])) - return \"\"; - else - return \"mr %0,%1\"; -}" - [(set_attr "length" "4")]) - - -;; PowerPC64 DImode operations. - -(define_expand "adddi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_add_cint64_operand" "")))] - "" - " -{ - if (! TARGET_POWERPC64) - { - if (non_short_cint_operand (operands[2], DImode)) - FAIL; - } - else - if (GET_CODE (operands[2]) == CONST_INT - && ! add_operand (operands[2], DImode)) - { - rtx tmp = ((no_new_pseudos || rtx_equal_p (operands[0], operands[1])) - ? operands[0] : gen_reg_rtx (DImode)); - - HOST_WIDE_INT val = INTVAL (operands[2]); - HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode); - - if (!CONST_OK_FOR_LETTER_P (rest, 'L')) - FAIL; - - /* The ordering here is important for the prolog expander. - When space is allocated from the stack, adding 'low' first may - produce a temporary deallocation (which would be bad). */ - emit_insn (gen_adddi3 (tmp, operands[1], GEN_INT (rest))); - emit_insn (gen_adddi3 (operands[0], tmp, GEN_INT (low))); - DONE; - } -}") - -;; Discourage ai/addic because of carry but provide it in an alternative -;; allowing register zero as source. - -(define_insn "*adddi3_internal1" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r,?r,r") - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,b,r,b") - (match_operand:DI 2 "add_operand" "r,I,I,L")))] - "TARGET_POWERPC64" - "@ - add %0,%1,%2 - addi %0,%1,%2 - addic %0,%1,%2 - addis %0,%1,%v2") - -(define_insn "*adddi3_internal2" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")) - (const_int 0))) - (clobber (match_scratch:DI 3 "=r,r,r,r"))] - "TARGET_64BIT" - "@ - add. %3,%1,%2 - addic. %3,%1,%2 - # - #" - [(set_attr "type" "fast_compare,compare,compare,compare") - (set_attr "length" "4,4,8,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 3 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 3) - (plus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 0) - (compare:CC (match_dup 3) - (const_int 0)))] - "") - -(define_insn "*adddi3_internal3" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,x,?y,?y") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "%r,r,r,r") - (match_operand:DI 2 "reg_or_short_operand" "r,I,r,I")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r,r,r") - (plus:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - add. %0,%1,%2 - addic. %0,%1,%2 - # - #" - [(set_attr "type" "fast_compare,compare,compare,compare") - (set_attr "length" "4,4,8,8")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "reg_or_short_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (plus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -;; Split an add that we can't do in one insn into two insns, each of which -;; does one 16-bit part. This is used by combine. Note that the low-order -;; add should be last in case the result gets used in an address. - -(define_split - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (plus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "non_add_cint_operand" "")))] - "TARGET_POWERPC64" - [(set (match_dup 0) (plus:DI (match_dup 1) (match_dup 3))) - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 4)))] -" -{ - HOST_WIDE_INT val = INTVAL (operands[2]); - HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; - HOST_WIDE_INT rest = trunc_int_for_mode (val - low, DImode); - - operands[4] = GEN_INT (low); - if (CONST_OK_FOR_LETTER_P (rest, 'L')) - operands[3] = GEN_INT (rest); - else if (! no_new_pseudos) - { - operands[3] = gen_reg_rtx (DImode); - emit_move_insn (operands[3], operands[2]); - emit_insn (gen_adddi3 (operands[0], operands[1], operands[3])); - DONE; - } - else - FAIL; -}") - -(define_insn "one_cmpldi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (not:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "nor %0,%1,%1") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 2 "=r,r"))] - "TARGET_64BIT" - "@ - nor. %2,%1,%1 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 2 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) - (not:DI (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (not:DI (match_dup 1)))] - "TARGET_64BIT" - "@ - nor. %0,%1,%1 - #" - [(set_attr "type" "compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (not:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (not:DI (match_dup 1)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (not:DI (match_dup 1))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (minus:DI (match_operand:DI 1 "reg_or_short_operand" "r,I") - (match_operand:DI 2 "gpc_reg_operand" "r,r")))] - "TARGET_POWERPC64" - "@ - subf %0,%2,%1 - subfic %0,%2,%1") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 3 "=r,r"))] - "TARGET_64BIT" - "@ - subf. %3,%2,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 3 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 3) - (minus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 0) - (compare:CC (match_dup 3) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "r,r") - (match_operand:DI 2 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (minus:DI (match_dup 1) (match_dup 2)))] - "TARGET_64BIT" - "@ - subf. %0,%2,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 3 "cc_reg_not_cr0_operand" "") - (compare:CC (minus:DI (match_operand:DI 1 "gpc_reg_operand" "") - (match_operand:DI 2 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (minus:DI (match_dup 1) (match_dup 2)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (minus:DI (match_dup 1) (match_dup 2))) - (set (match_dup 3) - (compare:CC (match_dup 0) - (const_int 0)))] - "") + "@ + {srai|srawi} %0,%1,31\;{srai|srawi} %L0,%1,%h2 + {sri|srwi} %L0,%L1,%h2\;insrwi %L0,%1,%h2,0\;{srai|srawi} %0,%1,%h2" + [(set_attr "type" "two,three") + (set_attr "length" "8,12")]) -(define_expand "subdi3" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (minus:DI (match_operand:DI 1 "reg_or_short_operand" "") - (match_operand:DI 2 "reg_or_sub_cint64_operand" "")))] - "" - " +(define_insn "*ashrdisi3_noppc64" + [(set (match_operand:SI 0 "gpc_reg_operand" "=r") + (subreg:SI (ashiftrt:DI (match_operand:DI 1 "gpc_reg_operand" "r") + (const_int 32)) 4))] + "TARGET_32BIT && !TARGET_POWERPC64" + "* { - if (GET_CODE (operands[2]) == CONST_INT) - { - emit_insn (gen_adddi3 (operands[0], operands[1], - negate_rtx (DImode, operands[2]))); - DONE; - } -}") + if (REGNO (operands[0]) == REGNO (operands[1])) + return \"\"; + else + return \"mr %0,%1\"; +}" + [(set_attr "length" "4")]) + + +;; PowerPC64 DImode operations. (define_insn_and_split "absdi2" [(set (match_operand:DI 0 "gpc_reg_operand" "=&r,r") @@ -6111,108 +5916,6 @@ (set (match_dup 0) (minus:DI (match_dup 2) (match_dup 0)))] "") -(define_expand "negdi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "") - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")))] - "" - "") - -(define_insn "" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "neg %0,%1") - -(define_insn "" - [(set (match_operand:CC 0 "cc_reg_operand" "=x,?y") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (clobber (match_scratch:DI 2 "=r,r"))] - "TARGET_64BIT" - "@ - neg. %2,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 0 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (clobber (match_scratch:DI 2 ""))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 2) - (neg:DI (match_dup 1))) - (set (match_dup 0) - (compare:CC (match_dup 2) - (const_int 0)))] - "") - -(define_insn "" - [(set (match_operand:CC 2 "cc_reg_operand" "=x,?y") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r,r") - (neg:DI (match_dup 1)))] - "TARGET_64BIT" - "@ - neg. %0,%1 - #" - [(set_attr "type" "fast_compare") - (set_attr "length" "4,8")]) - -(define_split - [(set (match_operand:CC 2 "cc_reg_not_cr0_operand" "") - (compare:CC (neg:DI (match_operand:DI 1 "gpc_reg_operand" "")) - (const_int 0))) - (set (match_operand:DI 0 "gpc_reg_operand" "") - (neg:DI (match_dup 1)))] - "TARGET_POWERPC64 && reload_completed" - [(set (match_dup 0) - (neg:DI (match_dup 1))) - (set (match_dup 2) - (compare:CC (match_dup 0) - (const_int 0)))] - "") - -(define_insn "clzdi2" - [(set (match_operand:DI 0 "gpc_reg_operand" "=r") - (clz:DI (match_operand:DI 1 "gpc_reg_operand" "r")))] - "TARGET_POWERPC64" - "cntlzd %0,%1") - -(define_expand "ctzdi2" - [(set (match_dup 2) - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:DI (match_dup 1) - (match_dup 2))) - (clobber (scratch:CC))]) - (set (match_dup 4) (clz:DI (match_dup 3))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r") - (minus:DI (const_int 63) (match_dup 4)))] - "TARGET_POWERPC64" - { - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_reg_rtx (DImode); - operands[4] = gen_reg_rtx (DImode); - }) - -(define_expand "ffsdi2" - [(set (match_dup 2) - (neg:DI (match_operand:DI 1 "gpc_reg_operand" "r"))) - (parallel [(set (match_dup 3) (and:DI (match_dup 1) - (match_dup 2))) - (clobber (scratch:CC))]) - (set (match_dup 4) (clz:DI (match_dup 3))) - (set (match_operand:DI 0 "gpc_reg_operand" "=r") - (minus:DI (const_int 64) (match_dup 4)))] - "TARGET_POWERPC64" - { - operands[2] = gen_reg_rtx (DImode); - operands[3] = gen_reg_rtx (DImode); - operands[4] = gen_reg_rtx (DImode); - }) - (define_insn "muldi3" [(set (match_operand:DI 0 "gpc_reg_operand" "=r") (mult:DI (match_operand:DI 1 "gpc_reg_operand" "%r") @@ -8095,7 +7798,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: /* We normally copy the low-numbered register first. However, if the first register operand 0 is the same as the second register @@ -8192,7 +7895,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: /* We normally copy the low-numbered register first. However, if the first register operand 0 is the same as the second register of @@ -8425,21 +8128,18 @@ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128" "#" - "&& reload_completed" + "&& (!no_new_pseudos || offsettable_nonstrict_memref_p (operands[5]))" [(pc)] { rtx lowword; emit_insn (gen_fix_trunc_helper (operands[2], operands[1], operands[3])); - if (GET_CODE (operands[5]) != MEM) - abort(); - lowword = XEXP (operands[5], 0); - if (WORDS_BIG_ENDIAN) - lowword = plus_constant (lowword, 4); + gcc_assert (MEM_P (operands[5])); + lowword = adjust_address (operands[5], SImode, WORDS_BIG_ENDIAN ? 4 : 0); emit_insn (gen_fctiwz (operands[4], operands[2])); emit_move_insn (operands[5], operands[4]); - emit_move_insn (operands[0], gen_rtx_MEM (SImode, lowword)); + emit_move_insn (operands[0], lowword); DONE; }) @@ -8684,7 +8384,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: if (TARGET_STRING) @@ -8716,7 +8416,7 @@ switch (which_alternative) { default: - abort (); + gcc_unreachable (); case 0: if (TARGET_STRING) return \"{stsi|stswi} %1,%P0,16\"; @@ -10117,11 +9817,10 @@ (define_insn "load_toc_v4_PIC_1b" [(set (match_operand:SI 0 "register_operand" "=l") - (match_operand:SI 1 "immediate_operand" "s")) - (use (unspec [(match_dup 1) (match_operand 2 "immediate_operand" "s")] + (unspec:SI [(match_operand:SI 1 "immediate_operand" "s")] UNSPEC_TOCPTR))] "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2" - "bcl 20,31,%1+4\\n%1:\\n\\t.long %2-%1" + "bcl 20,31,$+8\\n\\t.long %1-$" [(set_attr "type" "branch") (set_attr "length" "8")]) @@ -10279,8 +9978,8 @@ operands[0] = machopic_indirect_call_target (operands[0]); #endif - if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); + gcc_assert (GET_CODE (operands[1]) == CONST_INT); operands[0] = XEXP (operands[0], 0); @@ -10291,12 +9990,14 @@ if (INTVAL (operands[2]) & CALL_LONG) operands[0] = rs6000_longcall_ref (operands[0]); - if (DEFAULT_ABI == ABI_V4 - || DEFAULT_ABI == ABI_DARWIN) - operands[0] = force_reg (Pmode, operands[0]); + switch (DEFAULT_ABI) + { + case ABI_V4: + case ABI_DARWIN: + operands[0] = force_reg (Pmode, operands[0]); + break; - else if (DEFAULT_ABI == ABI_AIX) - { + case ABI_AIX: /* AIX function pointers are really pointers to a three word area. */ emit_call_insn (TARGET_32BIT @@ -10307,9 +10008,10 @@ operands[0]), operands[1])); DONE; + + default: + gcc_unreachable (); } - else - abort (); } }") @@ -10327,8 +10029,8 @@ operands[1] = machopic_indirect_call_target (operands[1]); #endif - if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); operands[1] = XEXP (operands[1], 0); @@ -10339,12 +10041,14 @@ if (INTVAL (operands[3]) & CALL_LONG) operands[1] = rs6000_longcall_ref (operands[1]); - if (DEFAULT_ABI == ABI_V4 - || DEFAULT_ABI == ABI_DARWIN) - operands[1] = force_reg (Pmode, operands[1]); + switch (DEFAULT_ABI) + { + case ABI_V4: + case ABI_DARWIN: + operands[1] = force_reg (Pmode, operands[1]); + break; - else if (DEFAULT_ABI == ABI_AIX) - { + case ABI_AIX: /* AIX function pointers are really pointers to a three word area. */ emit_call_insn (TARGET_32BIT @@ -10357,9 +10061,10 @@ operands[1]), operands[2])); DONE; + + default: + gcc_unreachable (); } - else - abort (); } }") @@ -10696,8 +10401,8 @@ operands[0] = machopic_indirect_call_target (operands[0]); #endif - if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[0]) == MEM); + gcc_assert (GET_CODE (operands[1]) == CONST_INT); operands[0] = XEXP (operands[0], 0); operands[3] = gen_reg_rtx (SImode); @@ -10882,8 +10587,8 @@ operands[1] = machopic_indirect_call_target (operands[1]); #endif - if (GET_CODE (operands[1]) != MEM || GET_CODE (operands[2]) != CONST_INT) - abort (); + gcc_assert (GET_CODE (operands[1]) == MEM); + gcc_assert (GET_CODE (operands[2]) == CONST_INT); operands[1] = XEXP (operands[1], 0); operands[4] = gen_reg_rtx (SImode); @@ -14703,6 +14408,435 @@ return INTVAL (operands[1]) ? \"dcbtst %a0\" : \"dcbt %a0\"; }" [(set_attr "type" "load")]) + +; Atomic instructions + +(define_insn "memory_barrier" + [(set (mem:BLK (match_scratch 0 "X")) + (unspec:BLK [(mem:BLK (match_scratch 1 "X"))] UNSPEC_SYNC))] + "" + "{ics|sync}") + +(define_insn "sync_compare_and_swap" + [(set (match_operand:GPR 1 "memory_operand" "+Z") + (unspec:GPR [(match_dup 1) + (match_operand:GPR 2 "reg_or_short_operand" "rI") + (match_operand:GPR 3 "gpc_reg_operand" "r")] + UNSPEC_SYNC_SWAP)) + (set (match_operand:GPR 0 "gpc_reg_operand" "=&r") (match_dup 1)) + (set (mem:BLK (match_scratch 5 "X")) + (unspec:BLK [(mem:BLK (match_scratch 6 "X"))] UNSPEC_SYNC)) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + "sync\n\t %0,%y1\n\tcmp%I2 %0,%2\n\tbne- $+12\n\t %3,%y1\n\tbne- $-16\n\tisync" + [(set_attr "length" "28")]) + +(define_expand "sync_add" + [(use (match_operand:INT1 0 "memory_operand" "")) + (use (match_operand:INT1 1 "add_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (PLUS, mode, operands[0], operands[1], + NULL_RTX, NULL_RTX, true); + DONE; +}") + +(define_expand "sync_sub" + [(use (match_operand:GPR 0 "memory_operand" "")) + (use (match_operand:GPR 1 "gpc_reg_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (MINUS, mode, operands[0], operands[1], + NULL_RTX, NULL_RTX, true); + DONE; +}") + +(define_expand "sync_ior" + [(use (match_operand:INT1 0 "memory_operand" "")) + (use (match_operand:INT1 1 "logical_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (IOR, mode, operands[0], operands[1], + NULL_RTX, NULL_RTX, true); + DONE; +}") + +(define_expand "sync_and" + [(use (match_operand:INT1 0 "memory_operand" "")) + (use (match_operand:INT1 1 "and_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (AND, mode, operands[0], operands[1], + NULL_RTX, NULL_RTX, true); + DONE; +}") + +(define_expand "sync_xor" + [(use (match_operand:INT1 0 "memory_operand" "")) + (use (match_operand:INT1 1 "logical_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (XOR, mode, operands[0], operands[1], + NULL_RTX, NULL_RTX, true); + DONE; +}") + +(define_expand "sync_nand" + [(use (match_operand:INT1 0 "memory_operand" "")) + (use (match_operand:INT1 1 "gpc_reg_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (AND, mode, + gen_rtx_NOT (mode, operands[0]), + operands[1], + NULL_RTX, NULL_RTX, true); + DONE; +}") + +(define_expand "sync_old_add" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "add_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (PLUS, mode, operands[1], operands[2], + operands[0], NULL_RTX, true); + DONE; +}") + +(define_expand "sync_old_sub" + [(use (match_operand:GPR 0 "gpc_reg_operand" "")) + (use (match_operand:GPR 1 "memory_operand" "")) + (use (match_operand:GPR 2 "gpc_reg_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (MINUS, mode, operands[1], operands[2], + operands[0], NULL_RTX, true); + DONE; +}") + +(define_expand "sync_old_ior" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "logical_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (IOR, mode, operands[1], operands[2], + operands[0], NULL_RTX, true); + DONE; +}") + +(define_expand "sync_old_and" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "and_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (AND, mode, operands[1], operands[2], + operands[0], NULL_RTX, true); + DONE; +}") + +(define_expand "sync_old_xor" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "logical_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (XOR, mode, operands[1], operands[2], + operands[0], NULL_RTX, true); + DONE; +}") + +(define_expand "sync_old_nand" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "gpc_reg_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (AND, mode, + gen_rtx_NOT (mode, operands[1]), + operands[2], + operands[0], NULL_RTX, true); + DONE; +}") + +(define_expand "sync_new_add" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "add_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (PLUS, mode, operands[1], operands[2], + NULL_RTX, operands[0], true); + DONE; +}") + +(define_expand "sync_new_sub" + [(use (match_operand:GPR 0 "gpc_reg_operand" "")) + (use (match_operand:GPR 1 "memory_operand" "")) + (use (match_operand:GPR 2 "gpc_reg_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (MINUS, mode, operands[1], operands[2], + NULL_RTX, operands[0], true); + DONE; +}") + +(define_expand "sync_new_ior" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "logical_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (IOR, mode, operands[1], operands[2], + NULL_RTX, operands[0], true); + DONE; +}") + +(define_expand "sync_new_and" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "and_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (AND, mode, operands[1], operands[2], + NULL_RTX, operands[0], true); + DONE; +}") + +(define_expand "sync_new_xor" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "logical_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (XOR, mode, operands[1], operands[2], + NULL_RTX, operands[0], true); + DONE; +}") + +(define_expand "sync_new_nand" + [(use (match_operand:INT1 0 "gpc_reg_operand" "")) + (use (match_operand:INT1 1 "memory_operand" "")) + (use (match_operand:INT1 2 "gpc_reg_operand" ""))] + "TARGET_POWERPC" + " +{ + rs6000_emit_sync (AND, mode, + gen_rtx_NOT (mode, operands[1]), + operands[2], + NULL_RTX, operands[0], true); + DONE; +}") + +; the sync_*_internal patterns all have these operands: +; 0 - memory location +; 1 - operand +; 2 - value in memory after operation +; 3 - value in memory immediately before operation + +(define_insn "*sync_add_internal" + [(set (match_operand:GPR 2 "gpc_reg_operand" "=&r,&r") + (plus:GPR (match_operand:GPR 0 "memory_operand" "+Z,Z") + (match_operand:GPR 1 "add_operand" "rI,L"))) + (set (match_operand:GPR 3 "gpc_reg_operand" "=&b,&b") (match_dup 0)) + (set (match_dup 0) + (unspec:GPR [(plus:GPR (match_dup 0) (match_dup 1))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 4 "=&x,&x"))] + "TARGET_POWERPC" + "@ + %3,%y0\n\tadd%I1 %2,%3,%1\n\t %2,%y0\n\tbne- $-12 + %3,%y0\n\taddis %2,%3,%v1\n\t %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16")]) + +(define_insn "*sync_addshort_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r") + (ior:SI (and:SI (plus:SI (match_operand:SI 0 "memory_operand" "+Z") + (match_operand:SI 1 "add_operand" "rI")) + (match_operand:SI 4 "gpc_reg_operand" "r")) + (and:SI (not:SI (match_dup 4)) (match_dup 0)))) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) + (unspec:SI [(ior:SI (and:SI (plus:SI (match_dup 0) (match_dup 1)) + (match_dup 4)) + (and:SI (not:SI (match_dup 4)) (match_dup 0)))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x")) + (clobber (match_scratch:SI 6 "=&r"))] + "TARGET_POWERPC" + "lwarx %3,%y0\n\tadd%I1 %2,%3,%1\n\tandc %6,%3,%4\n\tand %2,%2,%4\n\tor %2,%2,%6\n\tstwcx. %2,%y0\n\tbne- $-24" + [(set_attr "length" "28")]) + +(define_insn "*sync_sub_internal" + [(set (match_operand:GPR 2 "gpc_reg_operand" "=&r") + (minus:GPR (match_operand:GPR 0 "memory_operand" "+Z") + (match_operand:GPR 1 "gpc_reg_operand" "r"))) + (set (match_operand:GPR 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) + (unspec:GPR [(minus:GPR (match_dup 0) (match_dup 1))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 4 "=&x"))] + "TARGET_POWERPC" + " %3,%y0\n\tsubf %2,%1,%3\n\t %2,%y0\n\tbne- $-12" + [(set_attr "length" "16")]) + +(define_insn "*sync_andsi_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r,&r,&r,&r") + (and:SI (match_operand:SI 0 "memory_operand" "+Z,Z,Z,Z") + (match_operand:SI 1 "and_operand" "r,T,K,L"))) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b,&b,&b,&b") (match_dup 0)) + (set (match_dup 0) + (unspec:SI [(and:SI (match_dup 0) (match_dup 1))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 4 "=&x,&x,&x,&x"))] + "TARGET_POWERPC" + "@ + lwarx %3,%y0\n\tand %2,%3,%1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\trlwinm %2,%3,0,%m1,%M1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\tandi. %2,%3,%b1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\tandis. %2,%3,%u1\n\tstwcx. %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16,16,16")]) + +(define_insn "*sync_anddi_internal" + [(set (match_operand:DI 2 "gpc_reg_operand" "=&r,&r,&r,&r,&r") + (and:DI (match_operand:DI 0 "memory_operand" "+Z,Z,Z,Z,Z") + (match_operand:DI 1 "and_operand" "r,S,T,K,J"))) + (set (match_operand:DI 3 "gpc_reg_operand" "=&b,&b,&b,&b,&b") (match_dup 0)) + (set (match_dup 0) + (unspec:DI [(and:DI (match_dup 0) (match_dup 1))] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 4 "=&x,&x,&x,&x,&x"))] + "TARGET_POWERPC64" + "@ + ldarx %3,%y0\n\tand %2,%3,%1\n\tstdcx. %2,%y0\n\tbne- $-12 + ldarx %3,%y0\n\trldic%B1 %2,%3,0,%S1\n\tstdcx. %2,%y0\n\tbne- $-12 + ldarx %3,%y0\n\trlwinm %2,%3,0,%m1,%M1\n\tstdcx. %2,%y0\n\tbne- $-12 + ldarx %3,%y0\n\tandi. %2,%3,%b1\n\tstdcx. %2,%y0\n\tbne- $-12 + ldarx %3,%y0\n\tandis. %2,%3,%b1\n\tstdcx. %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16,16,16,16")]) + +(define_insn "*sync_boolsi_internal" + [(set (match_operand:SI 2 "gpc_reg_operand" "=&r,&r,&r") + (match_operator:SI 4 "boolean_or_operator" + [(match_operand:SI 0 "memory_operand" "+Z,Z,Z") + (match_operand:SI 1 "logical_operand" "r,K,L")])) + (set (match_operand:SI 3 "gpc_reg_operand" "=&b,&b,&b") (match_dup 0)) + (set (match_dup 0) (unspec:SI [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x,&x,&x"))] + "TARGET_POWERPC" + "@ + lwarx %3,%y0\n\t%q4 %2,%3,%1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\t%q4i %2,%3,%b1\n\tstwcx. %2,%y0\n\tbne- $-12 + lwarx %3,%y0\n\t%q4is %2,%3,%u1\n\tstwcx. %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16,16")]) + +(define_insn "*sync_booldi_internal" + [(set (match_operand:DI 2 "gpc_reg_operand" "=&r,&r,&r") + (match_operator:DI 4 "boolean_or_operator" + [(match_operand:DI 0 "memory_operand" "+Z,Z,Z") + (match_operand:DI 1 "logical_operand" "r,K,JF")])) + (set (match_operand:DI 3 "gpc_reg_operand" "=&b,&b,&b") (match_dup 0)) + (set (match_dup 0) (unspec:DI [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x,&x,&x"))] + "TARGET_POWERPC64" + "@ + ldarx %3,%y0\n\t%q4 %2,%3,%1\n\tstdcx. %2,%y0\n\tbne- $-12 + ldarx %3,%y0\n\t%q4i %2,%3,%b1\n\tstdcx. %2,%y0\n\tbne- $-12 + ldarx %3,%y0\n\t%q4is %2,%3,%u1\n\tstdcx. %2,%y0\n\tbne- $-12" + [(set_attr "length" "16,16,16")]) + +(define_insn "*sync_boolc_internal" + [(set (match_operand:GPR 2 "gpc_reg_operand" "=&r") + (match_operator:GPR 4 "boolean_operator" + [(not:GPR (match_operand:GPR 0 "memory_operand" "+Z")) + (match_operand:GPR 1 "gpc_reg_operand" "r")])) + (set (match_operand:GPR 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) (unspec:GPR [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x"))] + "TARGET_POWERPC" + " %3,%y0\n\t%q4 %2,%1,%3\n\t %2,%y0\n\tbne- $-12" + [(set_attr "length" "16")]) + +(define_insn "*sync_boolc_internal2" + [(set (match_operand:GPR 2 "gpc_reg_operand" "=&r") + (match_operator:GPR 4 "boolean_operator" + [(not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r")) + (match_operand:GPR 0 "memory_operand" "+Z")])) + (set (match_operand:GPR 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) (unspec:GPR [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x"))] + "TARGET_POWERPC" + " %3,%y0\n\t%q4 %2,%3,%1\n\t %2,%y0\n\tbne- $-12" + [(set_attr "length" "16")]) + +(define_insn "*sync_boolcc_internal" + [(set (match_operand:GPR 2 "gpc_reg_operand" "=&r") + (match_operator:GPR 4 "boolean_operator" + [(not:GPR (match_operand:GPR 0 "memory_operand" "+Z")) + (not:GPR (match_operand:GPR 1 "gpc_reg_operand" "r"))])) + (set (match_operand:GPR 3 "gpc_reg_operand" "=&b") (match_dup 0)) + (set (match_dup 0) (unspec:GPR [(match_dup 4)] UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 5 "=&x"))] + "TARGET_POWERPC" + " %3,%y0\n\t%q4 %2,%1,%3\n\t %2,%y0\n\tbne- $-12" + [(set_attr "length" "16")]) + +(define_insn "isync" + [(set (mem:BLK (match_scratch 0 "X")) + (unspec:BLK [(mem:BLK (match_scratch 1 "X"))] UNSPEC_ISYNC))] + "TARGET_POWERPC" + "isync") + +(define_insn "sync_lock_test_and_set" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=&r") + (match_operand:GPR 1 "memory_operand" "+Z")) + (set (match_dup 1) (unspec:GPR [(match_operand:GPR 2 "gpc_reg_operand" "r")] + UNSPEC_SYNC_OP)) + (clobber (match_scratch:CC 3 "=&x")) + (set (mem:BLK (match_scratch 4 "X")) + (unspec:BLK [(mem:BLK (match_scratch 5 "X"))] UNSPEC_ISYNC))] + "TARGET_POWERPC" + " %0,%y1\n\t %2,%y1\n\tbne- $-8\n\tisync" + [(set_attr "length" "16")]) + +(define_expand "sync_lock_release" + [(set (match_operand:INT 0 "memory_operand") + (match_operand:INT 1 "any_operand"))] + "" + " +{ + emit_insn (gen_lwsync ()); + emit_move_insn (operands[0], operands[1]); + DONE; +}") + +; Some AIX assemblers don't accept lwsync, so we use a .long. +(define_insn "lwsync" + [(set (mem:BLK (match_scratch 0 "X")) + (unspec:BLK [(mem:BLK (match_scratch 1 "X"))] UNSPEC_LWSYNC))] + "" + ".long 0x7c2004ac") + + (include "altivec.md") (include "spe.md") diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt new file mode 100644 index 00000000000..84ceba07012 --- /dev/null +++ b/gcc/config/rs6000/rs6000.opt @@ -0,0 +1,231 @@ +; Options for the rs6000 port of the compiler +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +mpower +Target Report RejectNegative Mask(POWER) +Use POWER instruction set + +mno-power +Target Report RejectNegative +Do not use POWER instruction set + +mpower2 +Target Report Mask(POWER2) +Use POWER2 instruction set + +mpowerpc +Target Report RejectNegative Mask(POWERPC) +Use PowerPC instruction set + +mno-powerpc +Target Report RejectNegative +Do not use PowerPC instruction set + +mpowerpc64 +Target Report Mask(POWERPC64) +Use PowerPC-64 instruction set + +mpowerpc-gpopt +Target Report Mask(PPC_GPOPT) +Use PowerPC General Purpose group optional instructions + +mpowerpc-gfxopt +Target Report Mask(PPC_GFXOPT) +Use PowerPC Graphics group optional instructions + +mmfcrf +Target Report Mask(MFCRF) +Generate single field mfcr instruction + +mpopcntb +Target Report Mask(POPCNTB) +Use PowerPC/AS popcntb instruction + +maltivec +Target Report Mask(ALTIVEC) +Use AltiVec instructions + +mmultiple +Target Report Mask(MULTIPLE) +Generate load/store multiple instructions + +mstring +Target Report Mask(STRING) +Generate string instructions for block moves + +mnew-mnemonics +Target Report RejectNegative Mask(NEW_MNEMONICS) +Use new mnemonics for PowerPC architecture + +mold-mnemonics +Target Report RejectNegative InverseMask(NEW_MNEMONICS) +Use old mnemonics for PowerPC architecture + +msoft-float +Target Report RejectNegative Mask(SOFT_FLOAT) +Do not use hardware floating point + +mhard-float +Target Report RejectNegative InverseMask(SOFT_FLOAT, HARD_FLOAT) +Use hardware floating point + +mno-update +Target Report RejectNegative Mask(NO_UPDATE) +Do not generate load/store with update instructions + +mupdate +Target Report RejectNegative InverseMask(NO_UPDATE, UPDATE) +Generate load/store with update instructions + +mno-fused-madd +Target Report RejectNegative Mask(NO_FUSED_MADD) +Do not generate fused multiply/add instructions + +mfused-madd +Target Report RejectNegative InverseMask(NO_FUSED_MADD, FUSED_MADD) +Generate fused multiply/add instructions + +msched-prolog +Target Report Mask(SCHED_PROLOG) +Schedule the start and end of the procedure + +msched-epilog +Target Undocumented Mask(SCHED_PROLOG) MaskExists + +maix-struct-return +Target Report RejectNegative Var(aix_struct_return) +Return all structures in memory (AIX default) + +msvr4-struct-return +Target Report RejectNegative Var(aix_struct_return,0) VarExists +Return small structures in registers (SVR4 default) + +mxl-compat +Target Report Var(TARGET_XL_COMPAT) +Conform more closely to IBM XLC semantics + +mno-fp-in-toc +Target Report RejectNegative Mask(NO_FP_IN_TOC) +Do not place floating point constants in TOC + +mfp-in-toc +Target Report RejectNegative InverseMask(NO_FP_IN_TOC) +Place floating point constants in TOC + +mno-sum-in-toc +Target RejectNegative Mask(NO_SUM_IN_TOC) +Do not place symbol+offset constants in TOC + +msum-in-toc +Target RejectNegative InverseMask(NO_SUM_IN_TOC) +Place symbol+offset constants in TOC + +; Output only one TOC entry per module. Normally linking fails if +; there are more than 16K unique variables/constants in an executable. With +; this option, linking fails only if there are more than 16K modules, or +; if there are more than 16K unique variables/constant in a single module. +; +; This is at the cost of having 2 extra loads and one extra store per +; function, and one less allocable register. +mminimal-toc +Target Report Mask(MINIMAL_TOC) +Use only one TOC entry per procedure + +mfull-toc +Target Report +Put everything in the regular TOC + +mvrsave +Target Report Var(TARGET_ALTIVEC_VRSAVE) +Generate VRSAVE instructions when generating AltiVec code + +mvrsave= +Target RejectNegative Joined +-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead. + +misel +Target Var(rs6000_isel) +Generate isel instructions + +misel= +Target RejectNegative Joined +-misel=yes/no Deprecated option. Use -misel/-mno-isel instead + +mspe +Target Var(rs6000_spe) +Generate SPE SIMD instructions on E500 + +mspe= +Target RejectNegative Joined +-mspe=yes/no Deprecated option. Use -mspe/-mno-spe instead + +mdebug= +Target RejectNegative Joined +-mdebug= Enable debug output + +mabi= +Target RejectNegative Joined +-mabi= Specify ABI to use + +mcpu= +Target RejectNegative Joined +-mcpu= Use features of and schedule code for given CPU + +mtune= +Target RejectNegative Joined +-mtune= Schedule code for given CPU + +mtraceback= +Target RejectNegative Joined +-mtraceback= Select full, part, or no traceback table + +mlongcall +Target Report Var(rs6000_default_long_calls) +Avoid all range limits on call instructions + +mwarn-altivec-long +Target Var(rs6000_warn_altivec_long) Init(1) +Warn about deprecated 'vector long ...' AltiVec type usage + +mfloat-gprs= +Target RejectNegative Joined +-mfloat-gprs= Select GPR floating point method. + +mlong-double- +Target RejectNegative Joined UInteger +-mlong-double- Specify size of long double (64 or 128 bits) + +msched-costly-dep= +Target RejectNegative Joined +Determine which dependences between insns are considered costly + +minsert-sched-nops= +Target RejectNegative Joined +Specify which post scheduling nop insertion scheme to apply + +malign- +Target RejectNegative Joined +Specify alignment of structure fields default/natural + +mprioritize-restricted-insns= +Target RejectNegative Joined Uinteger Var(rs6000_sched_restricted_insns_priority) +Specify scheduling priority for dispatch slot restricted insns diff --git a/gcc/config/rs6000/spe.md b/gcc/config/rs6000/spe.md index 79d03ff623f..32c596548a9 100644 --- a/gcc/config/rs6000/spe.md +++ b/gcc/config/rs6000/spe.md @@ -2247,7 +2247,7 @@ case 2: return \"evstdd%X0 %1,%y0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "type" "*,vecload,vecstore") @@ -2327,7 +2327,7 @@ case 1: return \"evldd%X1 %0,%y1\"; case 2: return \"evor %0,%1,%1\"; case 3: return output_vec_const_move (operands); - default: abort (); + default: gcc_unreachable (); } }" [(set_attr "type" "vecload,vecstore,*,*") diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index db9abeae735..a8b06aedb16 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -21,6 +21,7 @@ MA 02111-1307, USA. */ /* Header files should be C++ aware in general. */ +#undef NO_IMPLICIT_EXTERN_C #define NO_IMPLICIT_EXTERN_C /* Yes! We are ELF. */ @@ -46,24 +47,6 @@ enum rs6000_sdata_type { extern enum rs6000_sdata_type rs6000_sdata; -/* V.4/eabi switches. */ -#define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0. */ -#define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */ -#define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative. */ -#define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec. */ -#define MASK_LITTLE_ENDIAN 0x04000000 /* Target is little endian. */ -#define MASK_REGNAMES 0x02000000 /* Use alternate register names. */ -#define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args. */ -#define MASK_NO_BITFIELD_WORD 0x00800000 /* Bitfields cannot cross word boundaries */ - -#define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE) -#define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN) -#define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE) -#define TARGET_EABI (target_flags & MASK_EABI) -#define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) -#define TARGET_REGNAMES (target_flags & MASK_REGNAMES) -#define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE) -#define TARGET_NO_BITFIELD_WORD (target_flags & MASK_NO_BITFIELD_WORD) #define TARGET_TOC ((target_flags & MASK_64BIT) \ || ((target_flags & (MASK_RELOCATABLE \ | MASK_MINIMAL_TOC)) \ @@ -76,89 +59,12 @@ extern enum rs6000_sdata_type rs6000_sdata; #define TARGET_NO_TOC (! TARGET_TOC) #define TARGET_NO_EABI (! TARGET_EABI) -/* Strings provided by SUBTARGET_OPTIONS */ extern const char *rs6000_abi_name; extern const char *rs6000_sdata_name; extern const char *rs6000_tls_size_string; /* For -mtls-size= */ -/* Override rs6000.h definition. */ -#undef SUBTARGET_OPTIONS -#define SUBTARGET_OPTIONS \ - { "call-", &rs6000_abi_name, N_("Select ABI calling convention"), 0}, \ - { "sdata=", &rs6000_sdata_name, N_("Select method for sdata handling"), 0}, \ - { "tls-size=", &rs6000_tls_size_string, \ - N_("Specify bit size of immediate TLS offsets"), 0 } - #define SDATA_DEFAULT_SIZE 8 -/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just - the same as -mminimal-toc. */ -/* Override rs6000.h definition. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "bit-align", -MASK_NO_BITFIELD_TYPE, \ - N_("Align to the base type of the bit-field") }, \ - { "no-bit-align", MASK_NO_BITFIELD_TYPE, \ - N_("Don't align to the base type of the bit-field") }, \ - { "strict-align", MASK_STRICT_ALIGN, \ - N_("Don't assume that unaligned accesses are handled by the system") }, \ - { "no-strict-align", -MASK_STRICT_ALIGN, \ - N_("Assume that unaligned accesses are handled by the system") }, \ - { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ - N_("Produce code relocatable at runtime") }, \ - { "no-relocatable", -MASK_RELOCATABLE, \ - N_("Don't produce code relocatable at runtime") }, \ - { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC, \ - N_("Produce code relocatable at runtime") }, \ - { "no-relocatable-lib", -MASK_RELOCATABLE, \ - N_("Don't produce code relocatable at runtime") }, \ - { "little-endian", MASK_LITTLE_ENDIAN, \ - N_("Produce little endian code") }, \ - { "little", MASK_LITTLE_ENDIAN, \ - N_("Produce little endian code") }, \ - { "big-endian", -MASK_LITTLE_ENDIAN, \ - N_("Produce big endian code") }, \ - { "big", -MASK_LITTLE_ENDIAN, \ - N_("Produce big endian code") }, \ - { "no-toc", 0, N_("no description yet") }, \ - { "toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ - { "full-toc", MASK_MINIMAL_TOC, N_("no description yet") }, \ - { "prototype", MASK_PROTOTYPE, N_("no description yet") }, \ - { "no-prototype", -MASK_PROTOTYPE, N_("no description yet") }, \ - { "no-traceback", 0, N_("no description yet") }, \ - { "eabi", MASK_EABI, N_("Use EABI") }, \ - { "no-eabi", -MASK_EABI, N_("Don't use EABI") }, \ - { "bit-word", -MASK_NO_BITFIELD_WORD, "" }, \ - { "no-bit-word", MASK_NO_BITFIELD_WORD, \ - N_("Do not allow bit-fields to cross word boundaries") }, \ - { "regnames", MASK_REGNAMES, \ - N_("Use alternate register names") }, \ - { "no-regnames", -MASK_REGNAMES, \ - N_("Don't use alternate register names") }, \ - { "sdata", 0, N_("no description yet") }, \ - { "no-sdata", 0, N_("no description yet") }, \ - { "sim", 0, \ - N_("Link with libsim.a, libc.a and sim-crt0.o") }, \ - { "ads", 0, \ - N_("Link with libads.a, libc.a and crt0.o") }, \ - { "yellowknife", 0, \ - N_("Link with libyk.a, libc.a and crt0.o") }, \ - { "mvme", 0, \ - N_("Link with libmvme.a, libc.a and crt0.o") }, \ - { "emb", 0, \ - N_("Set the PPC_EMB bit in the ELF flags header") }, \ - { "windiss", 0, N_("Use the WindISS simulator") }, \ - { "shlib", 0, N_("no description yet") }, \ - { "64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ - N_("Generate 64-bit code") }, \ - { "32", - (MASK_64BIT | MASK_POWERPC64), \ - N_("Generate 32-bit code") }, \ - EXTRA_SUBTARGET_SWITCHES \ - { "newlib", 0, N_("no description yet") }, - -/* This is meant to be redefined in the host dependent files. */ -#define EXTRA_SUBTARGET_SWITCHES - /* Sometimes certain combinations of command options do not make sense on a particular target machine. You can define a macro `OVERRIDE_OPTIONS' to take account of this. This macro, if @@ -1369,3 +1275,6 @@ ncrtn.o%s" /* Generate entries in .fixup for relocatable addresses. */ #define RELOCATABLE_NEEDS_FIXUP 1 + +/* This target uses the sysv4.opt file. */ +#define TARGET_USES_SYSV4_OPT 1 diff --git a/gcc/config/rs6000/sysv4.opt b/gcc/config/rs6000/sysv4.opt new file mode 100644 index 00000000000..d826c55dd72 --- /dev/null +++ b/gcc/config/rs6000/sysv4.opt @@ -0,0 +1,141 @@ +; SYSV4 options for PPC port. +; +; Copyright (C) 2005 Free Software Foundation, Inc. +; Contributed by Aldy Hernandez . +; +; 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. + +mcall- +Target RejectNegative Joined +Select ABI calling convention + +msdata= +Target RejectNegative Joined +Select method for sdata handling + +mtls-size= +Target RejectNegative Joined +Specify bit size of immediate TLS offsets + +mbit-align +Target Report Mask(NO_BITFIELD_TYPE) +Align to the base type of the bit-field + +mstrict-align +Target Report Mask(STRICT_ALIGN) +Align to the base type of the bit-field +Don't assume that unaligned accesses are handled by the system + +mrelocatable +Target Report Mask(RELOCATABLE) +Produce code relocatable at runtime + +mrelocatable-lib +Target +Produce code relocatable at runtime + +mlittle-endian +Target Report RejectNegative Mask(LITTLE_ENDIAN) +Produce little endian code + +mlittle +Target Report RejectNegative Mask(LITTLE_ENDIAN) MaskExists +Produce little endian code + +mbig-endian +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Produce big endian code + +mbig +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Produce big endian code + +;; FIXME: This does nothing. What should be done? +mno-toc +Target RejectNegative +no description yet + +mtoc +Target RejectNegative +no description yet + +mprototype +Target Mask(PROTOTYPE) +no description yet + +;; FIXME: Does nothing. +mno-traceback +Target RejectNegative +no description yet + +meabi +Target Report Mask(EABI) +Use EABI + +mbit-word +Target Report Mask(NO_BITFIELD_WORD) +Allow bit-fields to cross word boundaries + +mregnames +Target Mask(REGNAMES) +Use alternate register names + +;; FIXME: Does nothing. +msdata +Target +no description yet + +msim +Target RejectNegative +Link with libsim.a, libc.a and sim-crt0.o + +mads +Target RejectNegative +Link with libads.a, libc.a and crt0.o + +myellowknife +Target RejectNegative +Link with libyk.a, libc.a and crt0.o + +mmvme +Target RejectNegative +Link with libmvme.a, libc.a and crt0.o + +memb +Target RejectNegative +Set the PPC_EMB bit in the ELF flags header + +mwindiss +Target RejectNegative +Use the WindISS simulator + +mshlib +Target RejectNegative +no description yet + +m64 +Target Report RejectNegative Mask(64BIT) +Generate 64-bit code + +m32 +Target Report RejectNegative InverseMask(64BIT) +Generate 32-bit code + +mnewlib +Target RejectNegative +no description yet diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin index 467c426f976..74ded0f2793 100644 --- a/gcc/config/rs6000/t-darwin +++ b/gcc/config/rs6000/t-darwin @@ -9,7 +9,12 @@ LIB2FUNCS_STATIC_EXTRA = \ # The .asm files above are designed to run on all processors, # even though they use AltiVec instructions. -Wa is used because # -force_cpusubtype_ALL doesn't work with -dynamiclib. -TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusubtype_ALL +# +# -pipe because there's an assembler bug, 4077127, which causes +# it to not properly process the first # directive, causing temporary +# file names to appear in stabs, causing the bootstrap to fail. Using -pipe +# works around this by not having any temporary file names. +TARGET_LIBGCC2_CFLAGS = -Wa,-force_cpusubtype_ALL -pipe # Export the _xlq* symbols from darwin-ldouble.c. SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-ppc64.ver diff --git a/gcc/config/rs6000/t-darwin8 b/gcc/config/rs6000/t-darwin8 index 2f3bb32f821..873da5deadc 100644 --- a/gcc/config/rs6000/t-darwin8 +++ b/gcc/config/rs6000/t-darwin8 @@ -1,3 +1,5 @@ # 64-bit libraries can only be built in Darwin 8.x or later. -MULTILIB_OPTIONS = m64 -MULTILIB_DIRNAMES = ppc64 +# Unfortunately, though, libjava and libffi haven't been ported to -m64 +# yet. +# MULTILIB_OPTIONS = m64 +# MULTILIB_DIRNAMES = ppc64 diff --git a/gcc/config/rs6000/t-rtems b/gcc/config/rs6000/t-rtems index 3213c82f5c7..fe266272a5e 100644 --- a/gcc/config/rs6000/t-rtems +++ b/gcc/config/rs6000/t-rtems @@ -53,6 +53,8 @@ D_OLD_EXCEPTIONS/mcpu=505 \ D_OLD_EXCEPTIONS/mcpu=505/* \ D_OLD_EXCEPTIONS/mcpu=601 \ D_OLD_EXCEPTIONS/mcpu=601/* \ +D_OLD_EXCEPTIONS/mcpu=603e \ +D_OLD_EXCEPTIONS/mcpu=603e/* \ D_OLD_EXCEPTIONS/mcpu=604 \ D_OLD_EXCEPTIONS/mcpu=604/* \ D_OLD_EXCEPTIONS/mcpu=750 \ diff --git a/gcc/config/rs6000/x-darwin b/gcc/config/rs6000/x-darwin index e133c21f928..bcf1c9ecb1f 100644 --- a/gcc/config/rs6000/x-darwin +++ b/gcc/config/rs6000/x-darwin @@ -1,4 +1,4 @@ -host-darwin.o : $(srcdir)/config/rs6000/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \ - coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h $(HOOKS_H) - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ - $(srcdir)/config/rs6000/host-darwin.c +host-ppc-darwin.o : $(srcdir)/config/rs6000/host-darwin.c \ + $(CONFIG_H) $(SYSTEM_H) coretypes.h hosthooks.h $(HOSTHOOKS_DEF_H) toplev.h \ + diagnostic.h config/host-darwin.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< -o $@ diff --git a/gcc/config/s390/2064.md b/gcc/config/s390/2064.md index 211cd024d01..04564eb86f3 100644 --- a/gcc/config/s390/2064.md +++ b/gcc/config/s390/2064.md @@ -1,5 +1,5 @@ ;; Scheduling description for z900 (cpu 2064). -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ;; Ulrich Weigand (uweigand@de.ibm.com). @@ -72,6 +72,16 @@ (eq_attr "type" "jsr")) "z_e1*5,z_wr") +(define_insn_reservation "z_mul" 5 + (and (eq_attr "cpu" "g5,g6,z900") + (eq_attr "type" "imulsi,imulhi")) + "z_e1*5,z_wr") + +(define_insn_reservation "z_inf" 10 + (and (eq_attr "cpu" "g5,g6,z900") + (eq_attr "type" "idiv,imuldi")) + "z_e1*10,z_wr") + ;; For everything else we check the atype flag. (define_insn_reservation "z_int" 1 diff --git a/gcc/config/s390/2084.md b/gcc/config/s390/2084.md index c07f4cf9ffd..05681c5b9dc 100644 --- a/gcc/config/s390/2084.md +++ b/gcc/config/s390/2084.md @@ -1,5 +1,5 @@ ;; Scheduling description for z990 (cpu 2084). -;; Copyright (C) 2003,2004 Free Software Foundation, Inc. +;; Copyright (C) 2003,2004, 2005 Free Software Foundation, Inc. ;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and ;; Ulrich Weigand (uweigand@de.ibm.com). @@ -106,7 +106,22 @@ (define_insn_reservation "x_call" 5 (and (eq_attr "cpu" "z990") (eq_attr "type" "jsr")) - "x-e1-np*5,x-wr-np") + "x-e1-np*5,x-wr-np") + +(define_insn_reservation "x_mul_hi" 2 + (and (eq_attr "cpu" "z990") + (eq_attr "type" "imulhi")) + "x-e1-np*2,x-wr-np") + +(define_insn_reservation "x_mul_sidi" 4 + (and (eq_attr "cpu" "z990") + (eq_attr "type" "imulsi,imuldi")) + "x-e1-np*4,x-wr-np") + +(define_insn_reservation "x_div" 10 + (and (eq_attr "cpu" "z990") + (eq_attr "type" "idiv")) + "x-e1-np*10,x-wr-np") ;; ;; Multicycle insns @@ -141,44 +156,44 @@ ;; Floating point insns ;; -(define_insn_reservation "x_fsimpd" 6 +(define_insn_reservation "x_fsimpdf" 6 (and (eq_attr "cpu" "z990") - (eq_attr "type" "fsimpd,fmuld")) + (eq_attr "type" "fsimpdf,fmuldf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fsimps" 6 +(define_insn_reservation "x_fsimpsf" 6 (and (eq_attr "cpu" "z990") - (eq_attr "type" "fsimps,fmuls")) + (eq_attr "type" "fsimpsf,fmulsf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fdivd" 36 +(define_insn_reservation "x_fdivdf" 36 (and (eq_attr "cpu" "z990") - (eq_attr "type" "fdivd,fsqrtd")) + (eq_attr "type" "fdivdf,fsqrtdf")) "x_e1_t*30,x-wr-fp") -(define_insn_reservation "x_fdivs" 36 +(define_insn_reservation "x_fdivsf" 36 (and (eq_attr "cpu" "z990") - (eq_attr "type" "fdivs,fsqrts")) + (eq_attr "type" "fdivsf,fsqrtsf")) "x_e1_t*30,x-wr-fp") -(define_insn_reservation "x_floadd" 6 +(define_insn_reservation "x_floaddf" 6 (and (eq_attr "cpu" "z990") - (eq_attr "type" "floadd")) + (eq_attr "type" "floaddf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_floads" 6 +(define_insn_reservation "x_floadsf" 6 (and (eq_attr "cpu" "z990") - (eq_attr "type" "floads")) + (eq_attr "type" "floadsf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fstored" 1 +(define_insn_reservation "x_fstoredf" 1 (and (eq_attr "cpu" "z990") - (eq_attr "type" "fstored")) + (eq_attr "type" "fstoredf")) "x_e1_t,x-wr-fp") -(define_insn_reservation "x_fstores" 1 +(define_insn_reservation "x_fstoresf" 1 (and (eq_attr "cpu" "z990") - (eq_attr "type" "fstores")) + (eq_attr "type" "fstoresf")) "x_e1_t,x-wr-fp") (define_insn_reservation "x_ftoi" 1 @@ -191,13 +206,13 @@ (eq_attr "type" "itof")) "x_e1_t*3,x-wr-fp") -(define_bypass 1 "x_fsimpd" "x_fstored") +(define_bypass 1 "x_fsimpdf" "x_fstoredf") -(define_bypass 1 "x_fsimps" "x_fstores") +(define_bypass 1 "x_fsimpsf" "x_fstoresf") -(define_bypass 1 "x_floadd" "x_fsimpd,x_fstored,x_floadd") +(define_bypass 1 "x_floaddf" "x_fsimpdf,x_fstoredf,x_floaddf") -(define_bypass 1 "x_floads" "x_fsimps,x_fstores,x_floads") +(define_bypass 1 "x_floadsf" "x_fsimpsf,x_fstoresf,x_floadsf") ;; ;; s390_agen_dep_p returns 1, if a register is set in the @@ -214,8 +229,8 @@ "s390_agen_dep_p") (define_bypass 9 "x_int,x_agen,x_lr" - "x_floadd, x_floads, x_fstored, x_fstores,\ - x_fsimpd, x_fsimps, x_fdivd, x_fdivs" + "x_floaddf, x_floadsf, x_fstoredf, x_fstoresf,\ + x_fsimpdf, x_fsimpsf, x_fdivdf, x_fdivsf" "s390_agen_dep_p") ;; ;; A load type instruction uses a bypass to feed the result back @@ -227,8 +242,8 @@ "s390_agen_dep_p") (define_bypass 5 "x_load" - "x_floadd, x_floads, x_fstored, x_fstores,\ - x_fsimpd, x_fsimps, x_fdivd, x_fdivs" + "x_floaddf, x_floadsf, x_fstoredf, x_fstoresf,\ + x_fsimpdf, x_fsimpsf, x_fdivdf, x_fdivsf" "s390_agen_dep_p") ;; @@ -241,8 +256,8 @@ "s390_agen_dep_p") (define_bypass 5 "x_larl, x_la" - "x_floadd, x_floads, x_fstored, x_fstores,\ - x_fsimpd, x_fsimps, x_fdivd, x_fdivs" + "x_floaddf, x_floadsf, x_fstoredf, x_fstoresf,\ + x_fsimpdf, x_fsimpsf, x_fdivdf, x_fdivsf" "s390_agen_dep_p") ;; diff --git a/gcc/config/s390/fixdfdi.h b/gcc/config/s390/fixdfdi.h index a5b9212e793..74c9c68f6b2 100644 --- a/gcc/config/s390/fixdfdi.h +++ b/gcc/config/s390/fixdfdi.h @@ -55,7 +55,7 @@ __fixunsdfdi (double a1) dl1.d = a1; - /* +/- 0, denormalized, negativ */ + /* +/- 0, denormalized, negative */ if (!EXPD (dl1) || SIGND(dl1)) return 0; @@ -199,7 +199,7 @@ __fixunssfdi (float a1) fl1.f = a1; - /* +/- 0, denormalized, negativ */ + /* +/- 0, denormalized, negative */ if (!EXP (fl1) || SIGN(fl1)) return 0; diff --git a/gcc/config/s390/predicates.md b/gcc/config/s390/predicates.md new file mode 100644 index 00000000000..9af62a886b9 --- /dev/null +++ b/gcc/config/s390/predicates.md @@ -0,0 +1,386 @@ +;; Predicate definitions for S/390 and zSeries. +;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Contributed by Hartmut Penner (hpenner@de.ibm.com) and +;; Ulrich Weigand (uweigand@de.ibm.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. + +;; OP is the current operation. +;; MODE is the current operation mode. + +;; operands -------------------------------------------------------------- + +;; Return true if OP a (const_int 0) operand. + +(define_predicate "const0_operand" + (and (match_code "const_int, const_double") + (match_test "op == CONST0_RTX (mode)"))) + +;; Return true if OP is constant. + +(define_special_predicate "consttable_operand" + (and (match_code "symbol_ref, label_ref, const, const_int, const_double") + (match_test "CONSTANT_P (op)"))) + +;; Return true if OP is a valid S-type operand. + +(define_predicate "s_operand" + (and (match_code "subreg, mem") + (match_operand 0 "general_operand")) +{ + /* Just like memory_operand, allow (subreg (mem ...)) + after reload. */ + if (reload_completed + && GET_CODE (op) == SUBREG + && GET_CODE (SUBREG_REG (op)) == MEM) + op = SUBREG_REG (op); + + if (GET_CODE (op) != MEM) + return false; + if (!s390_legitimate_address_without_index_p (op)) + return false; + + return true; +}) + +;; Return true if OP is a valid operand for the BRAS instruction. +;; Allow SYMBOL_REFs and @PLT stubs. + +(define_special_predicate "bras_sym_operand" + (ior (match_code "symbol_ref") + (and (match_code "const") + (and (match_test "GET_CODE (XEXP (op, 0)) == UNSPEC") + (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_PLT"))))) + +;; Return true if OP is a PLUS that is not a legitimate +;; operand for the LA instruction. + +(define_predicate "s390_plus_operand" + (and (match_code "plus") + (and (match_test "mode == Pmode") + (match_test "!legitimate_la_operand_p (op)")))) + +;; Return true if OP is a valid shift count operand. + +(define_predicate "shift_count_operand" + (match_code "reg, subreg, plus, const_int") +{ + HOST_WIDE_INT offset = 0; + + /* We can have an integer constant, an address register, + or a sum of the two. Note that reload already checks + that any register present is an address register, so + we just check for any register here. */ + if (GET_CODE (op) == CONST_INT) + { + offset = INTVAL (op); + op = NULL_RTX; + } + if (op && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) + { + offset = INTVAL (XEXP (op, 1)); + op = XEXP (op, 0); + } + while (op && GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + if (op && GET_CODE (op) != REG) + return false; + + /* Unfortunately we have to reject constants that are invalid + for an address, or else reload will get confused. */ + if (!DISP_IN_RANGE (offset)) + return false; + + return true; +}) + +;; Return true if OP a valid operand for the LARL instruction. + +(define_predicate "larl_operand" + (match_code "label_ref, symbol_ref, const, const_int, const_double") +{ + /* Allow labels and local symbols. */ + if (GET_CODE (op) == LABEL_REF) + return true; + if (GET_CODE (op) == SYMBOL_REF) + return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 + && SYMBOL_REF_TLS_MODEL (op) == 0 + && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); + + /* Everything else must have a CONST, so strip it. */ + if (GET_CODE (op) != CONST) + return false; + op = XEXP (op, 0); + + /* Allow adding *even* in-range constants. */ + if (GET_CODE (op) == PLUS) + { + if (GET_CODE (XEXP (op, 1)) != CONST_INT + || (INTVAL (XEXP (op, 1)) & 1) != 0) + return false; + if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 32 + || INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 32)) + return false; + op = XEXP (op, 0); + } + + /* Labels and local symbols allowed here as well. */ + if (GET_CODE (op) == LABEL_REF) + return true; + if (GET_CODE (op) == SYMBOL_REF) + return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 + && SYMBOL_REF_TLS_MODEL (op) == 0 + && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); + + /* Now we must have a @GOTENT offset or @PLT stub + or an @INDNTPOFF TLS offset. */ + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_GOTENT) + return true; + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_PLT) + return true; + if (GET_CODE (op) == UNSPEC + && XINT (op, 1) == UNSPEC_INDNTPOFF) + return true; + + return false; +}) + +;; operators -------------------------------------------------------------- + +;; Return nonzero if OP is a valid comparison operator +;; for a branch condition. + +(define_predicate "s390_comparison" + (match_code "eq, ne, lt, gt, le, ge, ltu, gtu, leu, geu, + uneq, unlt, ungt, unle, unge, ltgt, + unordered, ordered") +{ + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != CC_REGNUM + || XEXP (op, 1) != const0_rtx) + return false; + + return (s390_branch_condition_mask (op) >= 0); +}) + +;; Return nonzero if OP is a valid comparison operator +;; for an ALC condition. + +(define_predicate "s390_alc_comparison" + (match_code "zero_extend, sign_extend, ltu, gtu, leu, geu") +{ + while (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) + op = XEXP (op, 0); + + if (!COMPARISON_P (op)) + return false; + + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != CC_REGNUM + || XEXP (op, 1) != const0_rtx) + return false; + + switch (GET_MODE (XEXP (op, 0))) + { + case CCL1mode: + return GET_CODE (op) == LTU; + + case CCL2mode: + return GET_CODE (op) == LEU; + + case CCL3mode: + return GET_CODE (op) == GEU; + + case CCUmode: + return GET_CODE (op) == GTU; + + case CCURmode: + return GET_CODE (op) == LTU; + + case CCSmode: + return GET_CODE (op) == UNGT; + + case CCSRmode: + return GET_CODE (op) == UNLT; + + default: + return false; + } +}) + +;; Return nonzero if OP is a valid comparison operator +;; for an SLB condition. + +(define_predicate "s390_slb_comparison" + (match_code "zero_extend, sign_extend, ltu, gtu, leu, geu") +{ + while (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) + op = XEXP (op, 0); + + if (!COMPARISON_P (op)) + return false; + + if (GET_CODE (XEXP (op, 0)) != REG + || REGNO (XEXP (op, 0)) != CC_REGNUM + || XEXP (op, 1) != const0_rtx) + return false; + + switch (GET_MODE (XEXP (op, 0))) + { + case CCL1mode: + return GET_CODE (op) == GEU; + + case CCL2mode: + return GET_CODE (op) == GTU; + + case CCL3mode: + return GET_CODE (op) == LTU; + + case CCUmode: + return GET_CODE (op) == LEU; + + case CCURmode: + return GET_CODE (op) == GEU; + + case CCSmode: + return GET_CODE (op) == LE; + + case CCSRmode: + return GET_CODE (op) == GE; + + default: + return false; + } +}) + +;; Return true if OP is a load multiple operation. It is known to be a +;; PARALLEL and the first section will be tested. + +(define_special_predicate "load_multiple_operation" + (match_code "parallel") +{ + enum machine_mode elt_mode; + int count = XVECLEN (op, 0); + unsigned int dest_regno; + rtx src_addr; + int i, off; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) + return false; + + dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); + src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); + elt_mode = GET_MODE (SET_DEST (XVECEXP (op, 0, 0))); + + /* Check, is base, or base + displacement. */ + + if (GET_CODE (src_addr) == REG) + off = 0; + else if (GET_CODE (src_addr) == PLUS + && GET_CODE (XEXP (src_addr, 0)) == REG + && GET_CODE (XEXP (src_addr, 1)) == CONST_INT) + { + off = INTVAL (XEXP (src_addr, 1)); + src_addr = XEXP (src_addr, 0); + } + else + return false; + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_DEST (elt)) != REG + || GET_MODE (SET_DEST (elt)) != elt_mode + || REGNO (SET_DEST (elt)) != dest_regno + i + || GET_CODE (SET_SRC (elt)) != MEM + || GET_MODE (SET_SRC (elt)) != elt_mode + || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) + || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) + != off + i * GET_MODE_SIZE (elt_mode)) + return false; + } + + return true; +}) + +;; Return true if OP is a store multiple operation. It is known to be a +;; PARALLEL and the first section will be tested. + +(define_special_predicate "store_multiple_operation" + (match_code "parallel") +{ + enum machine_mode elt_mode; + int count = XVECLEN (op, 0); + unsigned int src_regno; + rtx dest_addr; + int i, off; + + /* Perform a quick check so we don't blow up below. */ + if (count <= 1 + || GET_CODE (XVECEXP (op, 0, 0)) != SET + || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM + || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) + return false; + + src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); + dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); + elt_mode = GET_MODE (SET_SRC (XVECEXP (op, 0, 0))); + + /* Check, is base, or base + displacement. */ + + if (GET_CODE (dest_addr) == REG) + off = 0; + else if (GET_CODE (dest_addr) == PLUS + && GET_CODE (XEXP (dest_addr, 0)) == REG + && GET_CODE (XEXP (dest_addr, 1)) == CONST_INT) + { + off = INTVAL (XEXP (dest_addr, 1)); + dest_addr = XEXP (dest_addr, 0); + } + else + return false; + + for (i = 1; i < count; i++) + { + rtx elt = XVECEXP (op, 0, i); + + if (GET_CODE (elt) != SET + || GET_CODE (SET_SRC (elt)) != REG + || GET_MODE (SET_SRC (elt)) != elt_mode + || REGNO (SET_SRC (elt)) != src_regno + i + || GET_CODE (SET_DEST (elt)) != MEM + || GET_MODE (SET_DEST (elt)) != elt_mode + || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS + || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) + || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT + || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) + != off + i * GET_MODE_SIZE (elt_mode)) + return false; + } + return true; +}) diff --git a/gcc/config/s390/s390-modes.def b/gcc/config/s390/s390-modes.def index 1cb0f199032..e7da09ba7fd 100644 --- a/gcc/config/s390/s390-modes.def +++ b/gcc/config/s390/s390-modes.def @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM S/390 - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) and Ulrich Weigand (uweigand@de.ibm.com). @@ -23,6 +23,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* 256-bit integer mode is needed for STACK_SAVEAREA_MODE. */ INT_MODE (OI, 32); +/* Define TFmode to work around reload problem PR 20927. */ +FLOAT_MODE (TF, 16, ieee_quad_format); + /* Add any extra modes needed to represent the condition code. */ /* diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h index 25aeef86991..3d3ca0cc3e5 100644 --- a/gcc/config/s390/s390-protos.h +++ b/gcc/config/s390/s390-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM S/390. - Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Hartmut Penner (hpenner@de.ibm.com) This file is part of GCC. @@ -33,37 +33,27 @@ extern void s390_conditional_register_usage (void); #ifdef RTX_CODE extern int s390_extra_constraint_str (rtx, int, const char *); extern int s390_const_ok_for_constraint_p (HOST_WIDE_INT, int, const char *); -extern int const0_operand (rtx, enum machine_mode); -extern int consttable_operand (rtx, enum machine_mode); -extern int larl_operand (rtx, enum machine_mode); -extern int s_operand (rtx, enum machine_mode); -extern int shift_count_operand (rtx, enum machine_mode); -extern int bras_sym_operand (rtx, enum machine_mode); -extern int load_multiple_operation (rtx, enum machine_mode); -extern int store_multiple_operation (rtx, enum machine_mode); +extern int s390_const_double_ok_for_constraint_p (rtx, int, const char *); extern int s390_single_part (rtx, enum machine_mode, enum machine_mode, int); extern unsigned HOST_WIDE_INT s390_extract_part (rtx, enum machine_mode, int); extern bool s390_split_ok_p (rtx, rtx, enum machine_mode, int); extern bool s390_offset_p (rtx, rtx, rtx); extern int tls_symbolic_operand (rtx); -extern int s390_match_ccmode (rtx, enum machine_mode); -extern enum machine_mode s390_tm_ccmode (rtx, rtx, int); +extern bool s390_match_ccmode (rtx, enum machine_mode); +extern enum machine_mode s390_tm_ccmode (rtx, rtx, bool); extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx); extern void s390_canonicalize_comparison (enum rtx_code *, rtx *, rtx *); -extern int s390_comparison (rtx op, enum machine_mode mode); -extern int s390_alc_comparison (rtx op, enum machine_mode mode); -extern int s390_slb_comparison (rtx op, enum machine_mode mode); extern rtx s390_emit_compare (enum rtx_code, rtx, rtx); extern void s390_emit_jump (rtx, rtx); -extern int symbolic_reference_mentioned_p (rtx); -extern int tls_symbolic_reference_mentioned_p (rtx); -extern int legitimate_la_operand_p (rtx); -extern int preferred_la_operand_p (rtx, rtx); +extern bool symbolic_reference_mentioned_p (rtx); +extern bool tls_symbolic_reference_mentioned_p (rtx); +extern bool legitimate_la_operand_p (rtx); +extern bool preferred_la_operand_p (rtx, rtx); extern int legitimate_pic_operand_p (rtx); extern int legitimate_constant_p (rtx); -extern int legitimate_reload_constant_p (rtx); -extern int legitimate_address_p (enum machine_mode, rtx, int); +extern bool legitimate_reload_constant_p (rtx); +extern bool legitimate_address_p (enum machine_mode, rtx, int); extern rtx legitimize_pic_address (rtx, rtx); extern rtx legitimize_address (rtx, rtx, enum machine_mode); extern rtx legitimize_reload_address (rtx, enum machine_mode, int, int); @@ -74,7 +64,6 @@ extern enum reg_class s390_secondary_input_reload_class (enum reg_class, extern enum reg_class s390_secondary_output_reload_class (enum reg_class, enum machine_mode, rtx); -extern int s390_plus_operand (rtx, enum machine_mode); extern void s390_expand_plus_operand (rtx, rtx, rtx); extern void emit_symbolic_move (rtx *); extern void s390_load_address (rtx, rtx); @@ -103,6 +92,8 @@ extern void s390_output_dwarf_dtprel (FILE*, int, rtx); extern int s390_agen_dep_p (rtx, rtx); extern rtx s390_load_got (void); extern void s390_emit_tpf_eh_return (rtx); +extern bool s390_legitimate_address_without_index_p (rtx); +extern int s390_branch_condition_mask (rtx); #endif /* RTX_CODE */ diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 2514a43a940..7cf56cc13a3 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -52,39 +52,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "optabs.h" #include "tree-gimple.h" -/* Machine-specific symbol_ref flags. */ -#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0) - - -static bool s390_assemble_integer (rtx, unsigned int, int); -static void s390_encode_section_info (tree, rtx, int); -static bool s390_cannot_force_const_mem (rtx); -static rtx s390_delegitimize_address (rtx); -static bool s390_return_in_memory (tree, tree); -static void s390_init_builtins (void); -static rtx s390_expand_builtin (tree, rtx, rtx, enum machine_mode, int); -static void s390_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, - HOST_WIDE_INT, tree); -static enum attr_type s390_safe_attr_type (rtx); - -static int s390_adjust_priority (rtx, int); -static int s390_issue_rate (void); -static int s390_first_cycle_multipass_dfa_lookahead (void); -static bool s390_cannot_copy_insn_p (rtx); -static bool s390_rtx_costs (rtx, int, int, int *); -static int s390_address_cost (rtx); -static void s390_reorg (void); -static bool s390_valid_pointer_mode (enum machine_mode); -static tree s390_build_builtin_va_list (void); -static tree s390_gimplify_va_arg (tree, tree, tree *, tree *); -static bool s390_function_ok_for_sibcall (tree, tree); -static bool s390_call_saved_register_used (tree); -static bool s390_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode mode, - tree, bool); -static bool s390_fixed_condition_code_regs (unsigned int *, unsigned int *); -static enum machine_mode s390_cc_modes_compatible (enum machine_mode, - enum machine_mode); - /* Define the specific costs for a given cpu. */ @@ -187,88 +154,6 @@ struct processor_costs z990_cost = }; -#undef TARGET_ASM_ALIGNED_HI_OP -#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t" -#undef TARGET_ASM_ALIGNED_DI_OP -#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t" -#undef TARGET_ASM_INTEGER -#define TARGET_ASM_INTEGER s390_assemble_integer - -#undef TARGET_ASM_OPEN_PAREN -#define TARGET_ASM_OPEN_PAREN "" - -#undef TARGET_ASM_CLOSE_PAREN -#define TARGET_ASM_CLOSE_PAREN "" - -#undef TARGET_ENCODE_SECTION_INFO -#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info - -#ifdef HAVE_AS_TLS -#undef TARGET_HAVE_TLS -#define TARGET_HAVE_TLS true -#endif -#undef TARGET_CANNOT_FORCE_CONST_MEM -#define TARGET_CANNOT_FORCE_CONST_MEM s390_cannot_force_const_mem - -#undef TARGET_DELEGITIMIZE_ADDRESS -#define TARGET_DELEGITIMIZE_ADDRESS s390_delegitimize_address - -#undef TARGET_RETURN_IN_MEMORY -#define TARGET_RETURN_IN_MEMORY s390_return_in_memory - -#undef TARGET_INIT_BUILTINS -#define TARGET_INIT_BUILTINS s390_init_builtins -#undef TARGET_EXPAND_BUILTIN -#define TARGET_EXPAND_BUILTIN s390_expand_builtin - -#undef TARGET_ASM_OUTPUT_MI_THUNK -#define TARGET_ASM_OUTPUT_MI_THUNK s390_output_mi_thunk -#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK -#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true - -#undef TARGET_SCHED_ADJUST_PRIORITY -#define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority -#undef TARGET_SCHED_ISSUE_RATE -#define TARGET_SCHED_ISSUE_RATE s390_issue_rate -#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD -#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD s390_first_cycle_multipass_dfa_lookahead - -#undef TARGET_CANNOT_COPY_INSN_P -#define TARGET_CANNOT_COPY_INSN_P s390_cannot_copy_insn_p -#undef TARGET_RTX_COSTS -#define TARGET_RTX_COSTS s390_rtx_costs -#undef TARGET_ADDRESS_COST -#define TARGET_ADDRESS_COST s390_address_cost - -#undef TARGET_MACHINE_DEPENDENT_REORG -#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg - -#undef TARGET_VALID_POINTER_MODE -#define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode - -#undef TARGET_BUILD_BUILTIN_VA_LIST -#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list -#undef TARGET_GIMPLIFY_VA_ARG_EXPR -#define TARGET_GIMPLIFY_VA_ARG_EXPR s390_gimplify_va_arg - -#undef TARGET_PROMOTE_FUNCTION_ARGS -#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true -#undef TARGET_PROMOTE_FUNCTION_RETURN -#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true -#undef TARGET_PASS_BY_REFERENCE -#define TARGET_PASS_BY_REFERENCE s390_pass_by_reference - -#undef TARGET_FUNCTION_OK_FOR_SIBCALL -#define TARGET_FUNCTION_OK_FOR_SIBCALL s390_function_ok_for_sibcall - -#undef TARGET_FIXED_CONDITION_CODE_REGS -#define TARGET_FIXED_CONDITION_CODE_REGS s390_fixed_condition_code_regs - -#undef TARGET_CC_MODES_COMPATIBLE -#define TARGET_CC_MODES_COMPATIBLE s390_cc_modes_compatible - -struct gcc_target targetm = TARGET_INITIALIZER; - extern int reload_completed; /* The alias set for prologue/epilogue register save/restore. */ @@ -292,27 +177,18 @@ struct s390_address rtx base; rtx indx; rtx disp; - int pointer; + bool pointer; }; /* Which cpu are we tuning for. */ -enum processor_type s390_tune; +enum processor_type s390_tune = PROCESSOR_max; enum processor_flags s390_tune_flags; /* Which instruction set architecture to use. */ enum processor_type s390_arch; enum processor_flags s390_arch_flags; - -/* Strings to hold which cpu and instruction set architecture to use. */ -const char *s390_tune_string; /* for -mtune= */ -const char *s390_arch_string; /* for -march= */ - -const char *s390_warn_framesize_string; -const char *s390_warn_dynamicstack_string; -const char *s390_stack_size_string; -const char *s390_stack_guard_string; +static const char *s390_arch_string; HOST_WIDE_INT s390_warn_framesize = 0; -bool s390_warn_dynamicstack_p = 0; HOST_WIDE_INT s390_stack_size = 0; HOST_WIDE_INT s390_stack_guard = 0; @@ -379,56 +255,16 @@ struct machine_function GTY(()) #define cfun_fpr_bit_p(BITNUM) (!!(cfun->machine->frame_layout.fpr_bitmap & \ (1 << (BITNUM)))) -static int s390_match_ccmode_set (rtx, enum machine_mode); -static int s390_branch_condition_mask (rtx); -static const char *s390_branch_condition_mnemonic (rtx, int); -static int check_mode (rtx, enum machine_mode *); -static int s390_short_displacement (rtx); -static int s390_decompose_address (rtx, struct s390_address *); -static rtx get_thread_pointer (void); -static rtx legitimize_tls_address (rtx, rtx); -static void print_shift_count_operand (FILE *, rtx); -static const char *get_some_local_dynamic_name (void); -static int get_some_local_dynamic_name_1 (rtx *, void *); -static int reg_used_in_mem_p (int, rtx); -static int addr_generation_dependency_p (rtx, rtx); -static int s390_split_branches (void); -static void annotate_constant_pool_refs (rtx *x); -static void find_constant_pool_ref (rtx, rtx *); -static void replace_constant_pool_ref (rtx *, rtx, rtx); -static rtx find_ltrel_base (rtx); -static void replace_ltrel_base (rtx *); -static void s390_optimize_prologue (void); -static int find_unused_clobbered_reg (void); -static void s390_frame_area (int *, int *); -static void s390_register_info (int []); -static void s390_frame_info (void); -static void s390_init_frame_layout (void); -static void s390_update_frame_layout (void); -static rtx save_fpr (rtx, int, int); -static rtx restore_fpr (rtx, int, int); -static rtx save_gprs (rtx, int, int, int); -static rtx restore_gprs (rtx, int, int, int); -static int s390_function_arg_size (enum machine_mode, tree); -static bool s390_function_arg_float (enum machine_mode, tree); -static struct machine_function * s390_init_machine_status (void); - -/* Check whether integer displacement is in range. */ -#define DISP_IN_RANGE(d) \ - (TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \ - : ((d) >= 0 && (d) <= 4095)) - /* Return true if SET either doesn't set the CC register, or else the source and destination have matching CC modes and that CC mode is at least as constrained as REQ_MODE. */ -static int +static bool s390_match_ccmode_set (rtx set, enum machine_mode req_mode) { enum machine_mode set_mode; - if (GET_CODE (set) != SET) - abort (); + gcc_assert (GET_CODE (set) == SET); if (GET_CODE (SET_DEST (set)) != REG || !CC_REGNO_P (REGNO (SET_DEST (set)))) return 1; @@ -464,7 +300,7 @@ s390_match_ccmode_set (rtx set, enum machine_mode req_mode) break; default: - abort (); + gcc_unreachable (); } return (GET_MODE (SET_SRC (set)) == set_mode); @@ -475,14 +311,14 @@ s390_match_ccmode_set (rtx set, enum machine_mode req_mode) CC mode is at least as constrained as REQ_MODE. If REQ_MODE is VOIDmode, always return false. */ -int +bool s390_match_ccmode (rtx insn, enum machine_mode req_mode) { int i; /* s390_tm_ccmode returns VOIDmode to indicate failure. */ if (req_mode == VOIDmode) - return 0; + return false; if (GET_CODE (PATTERN (insn)) == SET) return s390_match_ccmode_set (PATTERN (insn), req_mode); @@ -493,10 +329,10 @@ s390_match_ccmode (rtx insn, enum machine_mode req_mode) rtx set = XVECEXP (PATTERN (insn), 0, i); if (GET_CODE (set) == SET) if (!s390_match_ccmode_set (set, req_mode)) - return 0; + return false; } - return 1; + return true; } /* If a test-under-mask instruction can be used to implement @@ -507,7 +343,7 @@ s390_match_ccmode (rtx insn, enum machine_mode req_mode) if the instruction cannot (TM). */ enum machine_mode -s390_tm_ccmode (rtx op1, rtx op2, int mixed) +s390_tm_ccmode (rtx op1, rtx op2, bool mixed) { int bit0, bit1; @@ -648,7 +484,7 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1) return CCUmode; default: - abort (); + gcc_unreachable (); } } @@ -791,126 +627,10 @@ s390_emit_jump (rtx target, rtx cond) emit_jump_insn (insn); } -/* Return nonzero if OP is a valid comparison operator - for a branch condition in mode MODE. */ - -int -s390_comparison (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - if (!COMPARISON_P (op)) - return 0; - - if (GET_CODE (XEXP (op, 0)) != REG - || REGNO (XEXP (op, 0)) != CC_REGNUM - || XEXP (op, 1) != const0_rtx) - return 0; - - return s390_branch_condition_mask (op) >= 0; -} - -/* Return nonzero if OP is a valid comparison operator - for an ALC condition in mode MODE. */ - -int -s390_alc_comparison (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - while (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) - op = XEXP (op, 0); - - if (!COMPARISON_P (op)) - return 0; - - if (GET_CODE (XEXP (op, 0)) != REG - || REGNO (XEXP (op, 0)) != CC_REGNUM - || XEXP (op, 1) != const0_rtx) - return 0; - - switch (GET_MODE (XEXP (op, 0))) - { - case CCL1mode: - return GET_CODE (op) == LTU; - - case CCL2mode: - return GET_CODE (op) == LEU; - - case CCL3mode: - return GET_CODE (op) == GEU; - - case CCUmode: - return GET_CODE (op) == GTU; - - case CCURmode: - return GET_CODE (op) == LTU; - - case CCSmode: - return GET_CODE (op) == UNGT; - - case CCSRmode: - return GET_CODE (op) == UNLT; - - default: - return 0; - } -} - -/* Return nonzero if OP is a valid comparison operator - for an SLB condition in mode MODE. */ - -int -s390_slb_comparison (rtx op, enum machine_mode mode) -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - while (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND) - op = XEXP (op, 0); - - if (!COMPARISON_P (op)) - return 0; - - if (GET_CODE (XEXP (op, 0)) != REG - || REGNO (XEXP (op, 0)) != CC_REGNUM - || XEXP (op, 1) != const0_rtx) - return 0; - - switch (GET_MODE (XEXP (op, 0))) - { - case CCL1mode: - return GET_CODE (op) == GEU; - - case CCL2mode: - return GET_CODE (op) == GTU; - - case CCL3mode: - return GET_CODE (op) == LTU; - - case CCUmode: - return GET_CODE (op) == LEU; - - case CCURmode: - return GET_CODE (op) == GEU; - - case CCSmode: - return GET_CODE (op) == LE; - - case CCSRmode: - return GET_CODE (op) == GE; - - default: - return 0; - } -} - /* Return branch condition mask to implement a branch specified by CODE. Return -1 for invalid comparisons. */ -static int +int s390_branch_condition_mask (rtx code) { const int CC0 = 1 << 3; @@ -918,10 +638,9 @@ s390_branch_condition_mask (rtx code) const int CC2 = 1 << 1; const int CC3 = 1 << 0; - if (GET_CODE (XEXP (code, 0)) != REG - || REGNO (XEXP (code, 0)) != CC_REGNUM - || XEXP (code, 1) != const0_rtx) - abort (); + gcc_assert (GET_CODE (XEXP (code, 0)) == REG); + gcc_assert (REGNO (XEXP (code, 0)) == CC_REGNUM); + gcc_assert (XEXP (code, 1) == const0_rtx); switch (GET_MODE (XEXP (code, 0))) { @@ -1120,8 +839,7 @@ s390_branch_condition_mnemonic (rtx code, int inv) if (inv) mask ^= 15; - if (mask < 1 || mask > 14) - abort (); + gcc_assert (mask >= 1 && mask <= 14); return mnemonic[mask]; } @@ -1151,7 +869,7 @@ s390_extract_part (rtx op, enum machine_mode mode, int def) return value & part_mask; } - abort (); + gcc_unreachable (); } /* If OP is an integer constant of mode MODE with exactly one @@ -1336,6 +1054,14 @@ s390_narrow_logical_operator (enum rtx_code code, rtx *memop, rtx *immop) } +/* How to allocate a 'struct machine_function'. */ + +static struct machine_function * +s390_init_machine_status (void) +{ + return ggc_alloc_cleared (sizeof (struct machine_function)); +} + /* Change optimizations to be performed, depending on the optimization level. @@ -1355,10 +1081,14 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED) flag_asynchronous_unwind_tables = 1; } -void -override_options (void) +/* Return true if ARG is the name of a processor. Set *TYPE and *FLAGS + to the associated processor_type and processor_flags if so. */ + +static bool +s390_handle_arch_option (const char *arg, + enum processor_type *type, + enum processor_flags *flags) { - int i; static struct pta { const char *const name; /* processor name or nickname. */ @@ -1373,9 +1103,57 @@ override_options (void) {"z990", PROCESSOR_2084_Z990, PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT}, }; + size_t i; + + for (i = 0; i < ARRAY_SIZE (processor_alias_table); i++) + if (strcmp (arg, processor_alias_table[i].name) == 0) + { + *type = processor_alias_table[i].processor; + *flags = processor_alias_table[i].flags; + return true; + } + return false; +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +s390_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_march_: + s390_arch_string = arg; + return s390_handle_arch_option (arg, &s390_arch, &s390_arch_flags); + + case OPT_mstack_guard_: + if (sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &s390_stack_guard) != 1) + return false; + if (exact_log2 (s390_stack_guard) == -1) + error ("stack guard value must be an exact power of 2"); + return true; + + case OPT_mstack_size_: + if (sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &s390_stack_size) != 1) + return false; + if (exact_log2 (s390_stack_size) == -1) + error ("stack size must be an exact power of 2"); + return true; + + case OPT_mtune_: + return s390_handle_arch_option (arg, &s390_tune, &s390_tune_flags); - int const pta_size = ARRAY_SIZE (processor_alias_table); + case OPT_mwarn_framesize_: + return sscanf (arg, HOST_WIDE_INT_PRINT_DEC, &s390_warn_framesize) == 1; + + default: + return true; + } +} +void +override_options (void) +{ /* Acquire a unique set number for our register saves and restores. */ s390_sr_alias_set = new_alias_set (); @@ -1393,36 +1171,16 @@ override_options (void) /* Determine processor architectural level. */ if (!s390_arch_string) - s390_arch_string = TARGET_ZARCH? "z900" : "g5"; - - for (i = 0; i < pta_size; i++) - if (! strcmp (s390_arch_string, processor_alias_table[i].name)) - { - s390_arch = processor_alias_table[i].processor; - s390_arch_flags = processor_alias_table[i].flags; - break; - } - if (i == pta_size) - error ("Unknown cpu used in -march=%s.", s390_arch_string); + { + s390_arch_string = TARGET_ZARCH? "z900" : "g5"; + s390_handle_arch_option (s390_arch_string, &s390_arch, &s390_arch_flags); + } /* Determine processor to tune for. */ - if (!s390_tune_string) + if (s390_tune == PROCESSOR_max) { s390_tune = s390_arch; s390_tune_flags = s390_arch_flags; - s390_tune_string = s390_arch_string; - } - else - { - for (i = 0; i < pta_size; i++) - if (! strcmp (s390_tune_string, processor_alias_table[i].name)) - { - s390_tune = processor_alias_table[i].processor; - s390_tune_flags = processor_alias_table[i].flags; - break; - } - if (i == pta_size) - error ("Unknown cpu used in -mtune=%s.", s390_tune_string); } /* Sanity checks. */ @@ -1443,42 +1201,14 @@ override_options (void) error ("-mbackchain -mpacked-stack -mhard-float are not supported " "in combination."); - if (s390_warn_framesize_string) - { - if (sscanf (s390_warn_framesize_string, HOST_WIDE_INT_PRINT_DEC, - &s390_warn_framesize) != 1) - error ("invalid value for -mwarn-framesize"); - } - - if (s390_warn_dynamicstack_string) - s390_warn_dynamicstack_p = 1; - - if (s390_stack_size_string) + if (s390_stack_size) { - if (sscanf (s390_stack_size_string, HOST_WIDE_INT_PRINT_DEC, - &s390_stack_size) != 1) - error ("invalid value for -mstack-size"); - - if (exact_log2 (s390_stack_size) == -1) - error ("stack size must be an exact power of 2"); - - if (s390_stack_guard_string) - { - if (sscanf (s390_stack_guard_string, HOST_WIDE_INT_PRINT_DEC, - &s390_stack_guard) != 1) - error ("invalid value for -mstack-guard"); - - if (s390_stack_guard >= s390_stack_size) - error ("stack size must be greater than the stack guard value"); - - if (exact_log2 (s390_stack_guard) == -1) - error ("stack guard value must be an exact power of 2"); - } - else + if (!s390_stack_guard) error ("-mstack-size implies use of -mstack-guard"); + else if (s390_stack_guard >= s390_stack_size) + error ("stack size must be greater than the stack guard value"); } - - if (s390_stack_guard_string && !s390_stack_size_string) + else if (s390_stack_guard) error ("-mstack-guard implies use of -mstack-size"); } @@ -1508,229 +1238,349 @@ s390_safe_attr_type (rtx insn) return TYPE_NONE; } -/* Return true if OP a (const_int 0) operand. - OP is the current operation. - MODE is the current operation mode. */ +/* Return true if DISP is a valid short displacement. */ -int -const0_operand (register rtx op, enum machine_mode mode) +static bool +s390_short_displacement (rtx disp) { - return op == CONST0_RTX (mode); -} + /* No displacement is OK. */ + if (!disp) + return true; -/* Return true if OP is constant. - OP is the current operation. - MODE is the current operation mode. */ + /* Integer displacement in range. */ + if (GET_CODE (disp) == CONST_INT) + return INTVAL (disp) >= 0 && INTVAL (disp) < 4096; -int -consttable_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return CONSTANT_P (op); -} + /* GOT offset is not OK, the GOT can be large. */ + if (GET_CODE (disp) == CONST + && GET_CODE (XEXP (disp, 0)) == UNSPEC + && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT + || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF)) + return false; -/* Return true if the mode of operand OP matches MODE. - If MODE is set to VOIDmode, set it to the mode of OP. */ + /* All other symbolic constants are literal pool references, + which are OK as the literal pool must be small. */ + if (GET_CODE (disp) == CONST) + return true; -static int -check_mode (register rtx op, enum machine_mode *mode) -{ - if (*mode == VOIDmode) - *mode = GET_MODE (op); - else - { - if (GET_MODE (op) != VOIDmode && GET_MODE (op) != *mode) - return 0; - } - return 1; + return false; } -/* Return true if OP a valid operand for the LARL instruction. - OP is the current operation. - MODE is the current operation mode. */ - -int -larl_operand (register rtx op, enum machine_mode mode) -{ - if (! check_mode (op, &mode)) - return 0; - - /* Allow labels and local symbols. */ - if (GET_CODE (op) == LABEL_REF) - return 1; - if (GET_CODE (op) == SYMBOL_REF) - return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 - && SYMBOL_REF_TLS_MODEL (op) == 0 - && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); +/* Decompose a RTL expression ADDR for a memory address into + its components, returned in OUT. - /* Everything else must have a CONST, so strip it. */ - if (GET_CODE (op) != CONST) - return 0; - op = XEXP (op, 0); + Returns false if ADDR is not a valid memory address, true + otherwise. If OUT is NULL, don't return the components, + but check for validity only. - /* Allow adding *even* in-range constants. */ - if (GET_CODE (op) == PLUS) - { - if (GET_CODE (XEXP (op, 1)) != CONST_INT - || (INTVAL (XEXP (op, 1)) & 1) != 0) - return 0; -#if HOST_BITS_PER_WIDE_INT > 32 - if (INTVAL (XEXP (op, 1)) >= (HOST_WIDE_INT)1 << 32 - || INTVAL (XEXP (op, 1)) < -((HOST_WIDE_INT)1 << 32)) - return 0; -#endif - op = XEXP (op, 0); - } + Note: Only addresses in canonical form are recognized. + LEGITIMIZE_ADDRESS should convert non-canonical forms to the + canonical form so that they will be recognized. */ - /* Labels and local symbols allowed here as well. */ - if (GET_CODE (op) == LABEL_REF) - return 1; - if (GET_CODE (op) == SYMBOL_REF) - return ((SYMBOL_REF_FLAGS (op) & SYMBOL_FLAG_ALIGN1) == 0 - && SYMBOL_REF_TLS_MODEL (op) == 0 - && (!flag_pic || SYMBOL_REF_LOCAL_P (op))); - - /* Now we must have a @GOTENT offset or @PLT stub - or an @INDNTPOFF TLS offset. */ - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_GOTENT) - return 1; - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_PLT) - return 1; - if (GET_CODE (op) == UNSPEC - && XINT (op, 1) == UNSPEC_INDNTPOFF) - return 1; +static int +s390_decompose_address (rtx addr, struct s390_address *out) +{ + HOST_WIDE_INT offset = 0; + rtx base = NULL_RTX; + rtx indx = NULL_RTX; + rtx disp = NULL_RTX; + rtx orig_disp; + bool pointer = false; + bool base_ptr = false; + bool indx_ptr = false; - return 0; -} + /* Decompose address into base + index + displacement. */ -/* Return true if OP is a valid S-type operand. - OP is the current operation. - MODE is the current operation mode. */ + if (GET_CODE (addr) == REG || GET_CODE (addr) == UNSPEC) + base = addr; -int -s_operand (rtx op, enum machine_mode mode) -{ - struct s390_address addr; + else if (GET_CODE (addr) == PLUS) + { + rtx op0 = XEXP (addr, 0); + rtx op1 = XEXP (addr, 1); + enum rtx_code code0 = GET_CODE (op0); + enum rtx_code code1 = GET_CODE (op1); - /* Call general_operand first, so that we don't have to - check for many special cases. */ - if (!general_operand (op, mode)) - return 0; + if (code0 == REG || code0 == UNSPEC) + { + if (code1 == REG || code1 == UNSPEC) + { + indx = op0; /* index + base */ + base = op1; + } - /* Just like memory_operand, allow (subreg (mem ...)) - after reload. */ - if (reload_completed - && GET_CODE (op) == SUBREG - && GET_CODE (SUBREG_REG (op)) == MEM) - op = SUBREG_REG (op); + else + { + base = op0; /* base + displacement */ + disp = op1; + } + } - if (GET_CODE (op) != MEM) - return 0; - if (!s390_decompose_address (XEXP (op, 0), &addr)) - return 0; - if (addr.indx) - return 0; + else if (code0 == PLUS) + { + indx = XEXP (op0, 0); /* index + base + disp */ + base = XEXP (op0, 1); + disp = op1; + } - return 1; -} + else + { + return false; + } + } -/* Return true if OP a valid shift count operand. - OP is the current operation. - MODE is the current operation mode. */ + else + disp = addr; /* displacement */ -int -shift_count_operand (rtx op, enum machine_mode mode) -{ - HOST_WIDE_INT offset = 0; + /* Extract integer part of displacement. */ + orig_disp = disp; + if (disp) + { + if (GET_CODE (disp) == CONST_INT) + { + offset = INTVAL (disp); + disp = NULL_RTX; + } + else if (GET_CODE (disp) == CONST + && GET_CODE (XEXP (disp, 0)) == PLUS + && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT) + { + offset = INTVAL (XEXP (XEXP (disp, 0), 1)); + disp = XEXP (XEXP (disp, 0), 0); + } + } - if (! check_mode (op, &mode)) - return 0; + /* Strip off CONST here to avoid special case tests later. */ + if (disp && GET_CODE (disp) == CONST) + disp = XEXP (disp, 0); - /* We can have an integer constant, an address register, - or a sum of the two. Note that reload already checks - that any register present is an address register, so - we just check for any register here. */ - if (GET_CODE (op) == CONST_INT) + /* We can convert literal pool addresses to + displacements by basing them off the base register. */ + if (disp && GET_CODE (disp) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (disp)) { - offset = INTVAL (op); - op = NULL_RTX; + /* Either base or index must be free to hold the base register. */ + if (!base) + base = gen_rtx_REG (Pmode, BASE_REGNUM); + else if (!indx) + indx = gen_rtx_REG (Pmode, BASE_REGNUM); + else + return false; + + /* Mark up the displacement. */ + disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), + UNSPEC_LTREL_OFFSET); } - if (op && GET_CODE (op) == PLUS && GET_CODE (XEXP (op, 1)) == CONST_INT) + + /* Validate base register. */ + if (base) { - offset = INTVAL (XEXP (op, 1)); - op = XEXP (op, 0); - } - while (op && GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (op && GET_CODE (op) != REG) - return 0; + if (GET_CODE (base) == UNSPEC) + switch (XINT (base, 1)) + { + case UNSPEC_LTREF: + if (!disp) + disp = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, XVECEXP (base, 0, 0)), + UNSPEC_LTREL_OFFSET); + else + return false; - /* Unfortunately we have to reject constants that are invalid - for an address, or else reload will get confused. */ - if (!DISP_IN_RANGE (offset)) - return 0; + base = gen_rtx_REG (Pmode, BASE_REGNUM); + break; - return 1; -} + case UNSPEC_LTREL_BASE: + base = gen_rtx_REG (Pmode, BASE_REGNUM); + break; -/* Return true if DISP is a valid short displacement. */ + default: + return false; + } -static int -s390_short_displacement (rtx disp) -{ - /* No displacement is OK. */ - if (!disp) - return 1; + if (GET_CODE (base) != REG || GET_MODE (base) != Pmode) + return false; - /* Integer displacement in range. */ - if (GET_CODE (disp) == CONST_INT) - return INTVAL (disp) >= 0 && INTVAL (disp) < 4096; + if (REGNO (base) == BASE_REGNUM + || REGNO (base) == STACK_POINTER_REGNUM + || REGNO (base) == FRAME_POINTER_REGNUM + || ((reload_completed || reload_in_progress) + && frame_pointer_needed + && REGNO (base) == HARD_FRAME_POINTER_REGNUM) + || REGNO (base) == ARG_POINTER_REGNUM + || (flag_pic + && REGNO (base) == PIC_OFFSET_TABLE_REGNUM)) + pointer = base_ptr = true; + } - /* GOT offset is not OK, the GOT can be large. */ - if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == UNSPEC - && (XINT (XEXP (disp, 0), 1) == UNSPEC_GOT - || XINT (XEXP (disp, 0), 1) == UNSPEC_GOTNTPOFF)) - return 0; + /* Validate index register. */ + if (indx) + { + if (GET_CODE (indx) == UNSPEC) + switch (XINT (indx, 1)) + { + case UNSPEC_LTREF: + if (!disp) + disp = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, XVECEXP (indx, 0, 0)), + UNSPEC_LTREL_OFFSET); + else + return false; - /* All other symbolic constants are literal pool references, - which are OK as the literal pool must be small. */ - if (GET_CODE (disp) == CONST) - return 1; + indx = gen_rtx_REG (Pmode, BASE_REGNUM); + break; - return 0; -} + case UNSPEC_LTREL_BASE: + indx = gen_rtx_REG (Pmode, BASE_REGNUM); + break; -/* Return true if OP is a valid operand for a C constraint. */ + default: + return false; + } -int -s390_extra_constraint_str (rtx op, int c, const char * str) -{ - struct s390_address addr; + if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode) + return false; - if (c != str[0]) - abort (); + if (REGNO (indx) == BASE_REGNUM + || REGNO (indx) == STACK_POINTER_REGNUM + || REGNO (indx) == FRAME_POINTER_REGNUM + || ((reload_completed || reload_in_progress) + && frame_pointer_needed + && REGNO (indx) == HARD_FRAME_POINTER_REGNUM) + || REGNO (indx) == ARG_POINTER_REGNUM + || (flag_pic + && REGNO (indx) == PIC_OFFSET_TABLE_REGNUM)) + pointer = indx_ptr = true; + } - /* Check for offsettable variants of memory constraints. */ - if (c == 'A') + /* Prefer to use pointer as base, not index. */ + if (base && indx && !base_ptr + && (indx_ptr || (!REG_POINTER (base) && REG_POINTER (indx)))) { - /* Only accept non-volatile MEMs. */ - if (!MEM_P (op) || MEM_VOLATILE_P (op)) - return 0; - - if ((reload_completed || reload_in_progress) - ? !offsettable_memref_p (op) - : !offsettable_nonstrict_memref_p (op)) - return 0; - - c = str[1]; + rtx tmp = base; + base = indx; + indx = tmp; } - /* Check for non-literal-pool variants of memory constraints. */ - else if (c == 'B') + /* Validate displacement. */ + if (!disp) { - if (GET_CODE (op) != MEM) + /* If the argument pointer or the return address pointer are involved, + the displacement will change later anyway as the virtual registers get + eliminated. This could make a valid displacement invalid, but it is + more likely to make an invalid displacement valid, because we sometimes + access the register save area via negative offsets to one of those + registers. + Thus we don't check the displacement for validity here. If after + elimination the displacement turns out to be invalid after all, + this is fixed up by reload in any case. */ + if (base != arg_pointer_rtx + && indx != arg_pointer_rtx + && base != return_address_pointer_rtx + && indx != return_address_pointer_rtx) + if (!DISP_IN_RANGE (offset)) + return false; + } + else + { + /* All the special cases are pointers. */ + pointer = true; + + /* In the small-PIC case, the linker converts @GOT + and @GOTNTPOFF offsets to possible displacements. */ + if (GET_CODE (disp) == UNSPEC + && (XINT (disp, 1) == UNSPEC_GOT + || XINT (disp, 1) == UNSPEC_GOTNTPOFF) + && offset == 0 + && flag_pic == 1) + { + ; + } + + /* Accept chunkified literal pool symbol references. */ + else if (GET_CODE (disp) == MINUS + && GET_CODE (XEXP (disp, 0)) == LABEL_REF + && GET_CODE (XEXP (disp, 1)) == LABEL_REF) + { + ; + } + + /* Accept literal pool references. */ + else if (GET_CODE (disp) == UNSPEC + && XINT (disp, 1) == UNSPEC_LTREL_OFFSET) + { + orig_disp = gen_rtx_CONST (Pmode, disp); + if (offset) + { + /* If we have an offset, make sure it does not + exceed the size of the constant pool entry. */ + rtx sym = XVECEXP (disp, 0, 0); + if (offset >= GET_MODE_SIZE (get_pool_mode (sym))) + return false; + + orig_disp = plus_constant (orig_disp, offset); + } + } + + else + return false; + } + + if (!base && !indx) + pointer = true; + + if (out) + { + out->base = base; + out->indx = indx; + out->disp = orig_disp; + out->pointer = pointer; + } + + return true; +} + +/* Return true if CODE is a valid address without index. */ + +bool +s390_legitimate_address_without_index_p (rtx op) +{ + struct s390_address addr; + + if (!s390_decompose_address (XEXP (op, 0), &addr)) + return false; + if (addr.indx) + return false; + + return true; +} + +/* Return 1 if OP is a valid operand for a C constraint, 0 else. */ + +int +s390_extra_constraint_str (rtx op, int c, const char * str) +{ + struct s390_address addr; + + gcc_assert (c == str[0]); + + /* Check for offsettable variants of memory constraints. */ + if (c == 'A') + { + /* Only accept non-volatile MEMs. */ + if (!MEM_P (op) || MEM_VOLATILE_P (op)) + return 0; + + if ((reload_completed || reload_in_progress) + ? !offsettable_memref_p (op) + : !offsettable_nonstrict_memref_p (op)) + return 0; + + c = str[1]; + } + + /* Check for non-literal-pool variants of memory constraints. */ + else if (c == 'B') + { + if (GET_CODE (op) != MEM) return 0; if (!s390_decompose_address (XEXP (op, 0), &addr)) return 0; @@ -1830,6 +1680,27 @@ s390_extra_constraint_str (rtx op, int c, const char * str) /* Return true if VALUE matches the constraint STR. */ int +s390_const_double_ok_for_constraint_p (rtx value, + int c, + const char * str) +{ + gcc_assert (c == str[0]); + + switch (str[0]) + { + case 'G': + /* The floating point zero constant. */ + return (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT + && value == CONST0_RTX (GET_MODE (value))); + + default: + return 0; + } +} + +/* Return true if VALUE matches the constraint STR. */ + +int s390_const_ok_for_constraint_p (HOST_WIDE_INT value, int c, const char * str) @@ -1838,8 +1709,7 @@ s390_const_ok_for_constraint_p (HOST_WIDE_INT value, int def; int part, part_goal; - if (c != str[0]) - abort (); + gcc_assert (c == str[0]); switch (str[0]) { @@ -2112,158 +1982,17 @@ s390_address_cost (rtx addr) return ad.indx? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (1); } -/* Return true if OP is a valid operand for the BRAS instruction. - OP is the current operation. - MODE is the current operation mode. */ - -int -bras_sym_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - register enum rtx_code code = GET_CODE (op); - - /* Allow SYMBOL_REFs. */ - if (code == SYMBOL_REF) - return 1; - - /* Allow @PLT stubs. */ - if (code == CONST - && GET_CODE (XEXP (op, 0)) == UNSPEC - && XINT (XEXP (op, 0), 1) == UNSPEC_PLT) - return 1; - return 0; -} - /* If OP is a SYMBOL_REF of a thread-local symbol, return its TLS mode, otherwise return 0. */ int -tls_symbolic_operand (register rtx op) +tls_symbolic_operand (rtx op) { if (GET_CODE (op) != SYMBOL_REF) return 0; return SYMBOL_REF_TLS_MODEL (op); } -/* Return true if OP is a load multiple operation. It is known to be a - PARALLEL and the first section will be tested. - OP is the current operation. - MODE is the current operation mode. */ - -int -load_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum machine_mode elt_mode; - int count = XVECLEN (op, 0); - unsigned int dest_regno; - rtx src_addr; - int i, off; - - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM) - return 0; - - dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0))); - src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0); - elt_mode = GET_MODE (SET_DEST (XVECEXP (op, 0, 0))); - - /* Check, is base, or base + displacement. */ - - if (GET_CODE (src_addr) == REG) - off = 0; - else if (GET_CODE (src_addr) == PLUS - && GET_CODE (XEXP (src_addr, 0)) == REG - && GET_CODE (XEXP (src_addr, 1)) == CONST_INT) - { - off = INTVAL (XEXP (src_addr, 1)); - src_addr = XEXP (src_addr, 0); - } - else - return 0; - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_DEST (elt)) != REG - || GET_MODE (SET_DEST (elt)) != elt_mode - || REGNO (SET_DEST (elt)) != dest_regno + i - || GET_CODE (SET_SRC (elt)) != MEM - || GET_MODE (SET_SRC (elt)) != elt_mode - || GET_CODE (XEXP (SET_SRC (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_SRC (elt), 0), 0), src_addr) - || GET_CODE (XEXP (XEXP (SET_SRC (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_SRC (elt), 0), 1)) - != off + i * GET_MODE_SIZE (elt_mode)) - return 0; - } - - return 1; -} - -/* Return true if OP is a store multiple operation. It is known to be a - PARALLEL and the first section will be tested. - OP is the current operation. - MODE is the current operation mode. */ - -int -store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum machine_mode elt_mode; - int count = XVECLEN (op, 0); - unsigned int src_regno; - rtx dest_addr; - int i, off; - - /* Perform a quick check so we don't blow up below. */ - if (count <= 1 - || GET_CODE (XVECEXP (op, 0, 0)) != SET - || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM - || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG) - return 0; - - src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0))); - dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0); - elt_mode = GET_MODE (SET_SRC (XVECEXP (op, 0, 0))); - - /* Check, is base, or base + displacement. */ - - if (GET_CODE (dest_addr) == REG) - off = 0; - else if (GET_CODE (dest_addr) == PLUS - && GET_CODE (XEXP (dest_addr, 0)) == REG - && GET_CODE (XEXP (dest_addr, 1)) == CONST_INT) - { - off = INTVAL (XEXP (dest_addr, 1)); - dest_addr = XEXP (dest_addr, 0); - } - else - return 0; - - for (i = 1; i < count; i++) - { - rtx elt = XVECEXP (op, 0, i); - - if (GET_CODE (elt) != SET - || GET_CODE (SET_SRC (elt)) != REG - || GET_MODE (SET_SRC (elt)) != elt_mode - || REGNO (SET_SRC (elt)) != src_regno + i - || GET_CODE (SET_DEST (elt)) != MEM - || GET_MODE (SET_DEST (elt)) != elt_mode - || GET_CODE (XEXP (SET_DEST (elt), 0)) != PLUS - || ! rtx_equal_p (XEXP (XEXP (SET_DEST (elt), 0), 0), dest_addr) - || GET_CODE (XEXP (XEXP (SET_DEST (elt), 0), 1)) != CONST_INT - || INTVAL (XEXP (XEXP (SET_DEST (elt), 0), 1)) - != off + i * GET_MODE_SIZE (elt_mode)) - return 0; - } - return 1; -} - /* Split DImode access register reference REG (on 64-bit) into its constituent low and high parts, and store them into LO and HI. Note that gen_lowpart/ gen_highpart cannot be used as they assume all registers are word-sized, @@ -2283,11 +2012,11 @@ s390_split_access_reg (rtx reg, rtx *lo, rtx *hi) /* Return true if OP contains a symbol reference */ -int +bool symbolic_reference_mentioned_p (rtx op) { - register const char *fmt; - register int i; + const char *fmt; + int i; if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF) return 1; @@ -2297,7 +2026,7 @@ symbolic_reference_mentioned_p (rtx op) { if (fmt[i] == 'E') { - register int j; + int j; for (j = XVECLEN (op, i) - 1; j >= 0; j--) if (symbolic_reference_mentioned_p (XVECEXP (op, i, j))) @@ -2313,11 +2042,11 @@ symbolic_reference_mentioned_p (rtx op) /* Return true if OP contains a reference to a thread-local symbol. */ -int +bool tls_symbolic_reference_mentioned_p (rtx op) { - register const char *fmt; - register int i; + const char *fmt; + int i; if (GET_CODE (op) == SYMBOL_REF) return tls_symbolic_operand (op); @@ -2327,18 +2056,18 @@ tls_symbolic_reference_mentioned_p (rtx op) { if (fmt[i] == 'E') { - register int j; + int j; for (j = XVECLEN (op, i) - 1; j >= 0; j--) if (tls_symbolic_reference_mentioned_p (XVECEXP (op, i, j))) - return 1; + return true; } else if (fmt[i] == 'e' && tls_symbolic_reference_mentioned_p (XEXP (op, i))) - return 1; + return true; } - return 0; + return false; } @@ -2347,7 +2076,7 @@ tls_symbolic_reference_mentioned_p (rtx op) and that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */ int -legitimate_pic_operand_p (register rtx op) +legitimate_pic_operand_p (rtx op) { /* Accept all non-symbolic constants. */ if (!SYMBOLIC_CONST (op)) @@ -2362,7 +2091,7 @@ legitimate_pic_operand_p (register rtx op) It is given that OP satisfies CONSTANT_P or is a CONST_DOUBLE. */ int -legitimate_constant_p (register rtx op) +legitimate_constant_p (rtx op) { /* Accept all non-symbolic constants. */ if (!SYMBOLIC_CONST (op)) @@ -2449,7 +2178,7 @@ s390_cannot_force_const_mem (rtx x) break; default: - abort (); + gcc_unreachable (); } } @@ -2459,31 +2188,36 @@ s390_cannot_force_const_mem (rtx x) a constant that would need to be forced to the literal pool before it can be used as operand. */ -int -legitimate_reload_constant_p (register rtx op) +bool +legitimate_reload_constant_p (rtx op) { /* Accept la(y) operands. */ if (GET_CODE (op) == CONST_INT && DISP_IN_RANGE (INTVAL (op))) - return 1; + return true; /* Accept l(g)hi operands. */ if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', "K")) - return 1; + return true; /* Accept lliXX operands. */ if (TARGET_ZARCH && s390_single_part (op, DImode, HImode, 0) >= 0) - return 1; + return true; /* Accept larl operands. */ if (TARGET_CPU_ZARCH && larl_operand (op, VOIDmode)) - return 1; + return true; + + /* Accept lzXX operands. */ + if (GET_CODE (op) == CONST_DOUBLE + && CONST_DOUBLE_OK_FOR_CONSTRAINT_P (op, 'G', "G")) + return true; /* Everything else cannot be handled without reload. */ - return 0; + return false; } /* Given an rtx OP being reloaded into a reg required to be in class CLASS, @@ -2570,40 +2304,20 @@ s390_secondary_output_reload_class (enum reg_class class, return NO_REGS; } -/* Return true if OP is a PLUS that is not a legitimate - operand for the LA instruction. - OP is the current operation. - MODE is the current operation mode. */ - -int -s390_plus_operand (register rtx op, enum machine_mode mode) -{ - if (!check_mode (op, &mode) || mode != Pmode) - return FALSE; - - if (GET_CODE (op) != PLUS) - return FALSE; - - if (legitimate_la_operand_p (op)) - return FALSE; - - return TRUE; -} - /* Generate code to load SRC, which is PLUS that is not a legitimate operand for the LA instruction, into TARGET. SCRATCH may be used as scratch register. */ void -s390_expand_plus_operand (register rtx target, register rtx src, - register rtx scratch) +s390_expand_plus_operand (rtx target, rtx src, + rtx scratch) { rtx sum1, sum2; struct s390_address ad; /* src must be a PLUS; get its two operands. */ - if (GET_CODE (src) != PLUS || GET_MODE (src) != Pmode) - abort (); + gcc_assert (GET_CODE (src) == PLUS); + gcc_assert (GET_MODE (src) == Pmode); /* Check if any of the two operands is already scheduled for replacement by reload. This can happen e.g. when @@ -2637,7 +2351,7 @@ s390_expand_plus_operand (register rtx target, register rtx src, if (sum1 == scratch && sum2 == scratch) { debug_rtx (src); - abort (); + gcc_unreachable (); } src = gen_rtx_PLUS (Pmode, sum1, sum2); @@ -2650,437 +2364,162 @@ s390_expand_plus_operand (register rtx target, register rtx src, } -/* Decompose a RTL expression ADDR for a memory address into - its components, returned in OUT. +/* Return true if ADDR is a valid memory address. + STRICT specifies whether strict register checking applies. */ - Returns 0 if ADDR is not a valid memory address, nonzero - otherwise. If OUT is NULL, don't return the components, - but check for validity only. +bool +legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, + rtx addr, int strict) +{ + struct s390_address ad; + if (!s390_decompose_address (addr, &ad)) + return false; - Note: Only addresses in canonical form are recognized. - LEGITIMIZE_ADDRESS should convert non-canonical forms to the - canonical form so that they will be recognized. */ + if (strict) + { + if (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) + return false; + if (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx)) + return false; + } + else + { + if (ad.base && !REG_OK_FOR_BASE_NONSTRICT_P (ad.base)) + return false; + if (ad.indx && !REG_OK_FOR_INDEX_NONSTRICT_P (ad.indx)) + return false; + } -static int -s390_decompose_address (register rtx addr, struct s390_address *out) + return true; +} + +/* Return true if OP is a valid operand for the LA instruction. + In 31-bit, we need to prove that the result is used as an + address, as LA performs only a 31-bit addition. */ + +bool +legitimate_la_operand_p (rtx op) { - HOST_WIDE_INT offset = 0; - rtx base = NULL_RTX; - rtx indx = NULL_RTX; - rtx disp = NULL_RTX; - rtx orig_disp; - int pointer = FALSE; - int base_ptr = FALSE; - int indx_ptr = FALSE; + struct s390_address addr; + if (!s390_decompose_address (op, &addr)) + return false; - /* Decompose address into base + index + displacement. */ + return (TARGET_64BIT || addr.pointer); +} - if (GET_CODE (addr) == REG || GET_CODE (addr) == UNSPEC) - base = addr; +/* Return true if it is valid *and* preferable to use LA to + compute the sum of OP1 and OP2. */ - else if (GET_CODE (addr) == PLUS) - { - rtx op0 = XEXP (addr, 0); - rtx op1 = XEXP (addr, 1); - enum rtx_code code0 = GET_CODE (op0); - enum rtx_code code1 = GET_CODE (op1); - - if (code0 == REG || code0 == UNSPEC) - { - if (code1 == REG || code1 == UNSPEC) - { - indx = op0; /* index + base */ - base = op1; - } +bool +preferred_la_operand_p (rtx op1, rtx op2) +{ + struct s390_address addr; - else - { - base = op0; /* base + displacement */ - disp = op1; - } - } + if (op2 != const0_rtx) + op1 = gen_rtx_PLUS (Pmode, op1, op2); - else if (code0 == PLUS) - { - indx = XEXP (op0, 0); /* index + base + disp */ - base = XEXP (op0, 1); - disp = op1; - } + if (!s390_decompose_address (op1, &addr)) + return false; + if (addr.base && !REG_OK_FOR_BASE_STRICT_P (addr.base)) + return false; + if (addr.indx && !REG_OK_FOR_INDEX_STRICT_P (addr.indx)) + return false; - else - { - return FALSE; - } - } + if (!TARGET_64BIT && !addr.pointer) + return false; - else - disp = addr; /* displacement */ + if (addr.pointer) + return true; - /* Extract integer part of displacement. */ - orig_disp = disp; - if (disp) - { - if (GET_CODE (disp) == CONST_INT) - { - offset = INTVAL (disp); - disp = NULL_RTX; - } - else if (GET_CODE (disp) == CONST - && GET_CODE (XEXP (disp, 0)) == PLUS - && GET_CODE (XEXP (XEXP (disp, 0), 1)) == CONST_INT) - { - offset = INTVAL (XEXP (XEXP (disp, 0), 1)); - disp = XEXP (XEXP (disp, 0), 0); - } - } + if ((addr.base && REG_P (addr.base) && REG_POINTER (addr.base)) + || (addr.indx && REG_P (addr.indx) && REG_POINTER (addr.indx))) + return true; - /* Strip off CONST here to avoid special case tests later. */ - if (disp && GET_CODE (disp) == CONST) - disp = XEXP (disp, 0); + return false; +} - /* We can convert literal pool addresses to - displacements by basing them off the base register. */ - if (disp && GET_CODE (disp) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (disp)) - { - /* Either base or index must be free to hold the base register. */ - if (!base) - base = gen_rtx_REG (Pmode, BASE_REGNUM); - else if (!indx) - indx = gen_rtx_REG (Pmode, BASE_REGNUM); - else - return FALSE; +/* Emit a forced load-address operation to load SRC into DST. + This will use the LOAD ADDRESS instruction even in situations + where legitimate_la_operand_p (SRC) returns false. */ - /* Mark up the displacement. */ - disp = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, disp), - UNSPEC_LTREL_OFFSET); - } +void +s390_load_address (rtx dst, rtx src) +{ + if (TARGET_64BIT) + emit_move_insn (dst, src); + else + emit_insn (gen_force_la_31 (dst, src)); +} - /* Validate base register. */ - if (base) - { - if (GET_CODE (base) == UNSPEC) - switch (XINT (base, 1)) - { - case UNSPEC_LTREF: - if (!disp) - disp = gen_rtx_UNSPEC (Pmode, - gen_rtvec (1, XVECEXP (base, 0, 0)), - UNSPEC_LTREL_OFFSET); - else - return FALSE; +/* Return a legitimate reference for ORIG (an address) using the + register REG. If REG is 0, a new pseudo is generated. - base = gen_rtx_REG (Pmode, BASE_REGNUM); - break; + There are two types of references that must be handled: - case UNSPEC_LTREL_BASE: - base = gen_rtx_REG (Pmode, BASE_REGNUM); - break; + 1. Global data references must load the address from the GOT, via + the PIC reg. An insn is emitted to do this load, and the reg is + returned. - default: - return FALSE; - } + 2. Static data references, constant pool addresses, and code labels + compute the address as an offset from the GOT, whose base is in + the PIC reg. Static data objects have SYMBOL_FLAG_LOCAL set to + differentiate them from global data objects. The returned + address is the PIC reg + an unspec constant. - if (GET_CODE (base) != REG || GET_MODE (base) != Pmode) - return FALSE; + GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC + reg also appears in the address. */ - if (REGNO (base) == BASE_REGNUM - || REGNO (base) == STACK_POINTER_REGNUM - || REGNO (base) == FRAME_POINTER_REGNUM - || ((reload_completed || reload_in_progress) - && frame_pointer_needed - && REGNO (base) == HARD_FRAME_POINTER_REGNUM) - || REGNO (base) == ARG_POINTER_REGNUM - || (flag_pic - && REGNO (base) == PIC_OFFSET_TABLE_REGNUM)) - pointer = base_ptr = TRUE; - } +rtx +legitimize_pic_address (rtx orig, rtx reg) +{ + rtx addr = orig; + rtx new = orig; + rtx base; - /* Validate index register. */ - if (indx) + if (GET_CODE (addr) == LABEL_REF + || (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (addr))) { - if (GET_CODE (indx) == UNSPEC) - switch (XINT (indx, 1)) - { - case UNSPEC_LTREF: - if (!disp) - disp = gen_rtx_UNSPEC (Pmode, - gen_rtvec (1, XVECEXP (indx, 0, 0)), - UNSPEC_LTREL_OFFSET); - else - return FALSE; - - indx = gen_rtx_REG (Pmode, BASE_REGNUM); - break; - - case UNSPEC_LTREL_BASE: - indx = gen_rtx_REG (Pmode, BASE_REGNUM); - break; - - default: - return FALSE; - } + /* This is a local symbol. */ + if (TARGET_CPU_ZARCH && larl_operand (addr, VOIDmode)) + { + /* Access local symbols PC-relative via LARL. + This is the same as in the non-PIC case, so it is + handled automatically ... */ + } + else + { + /* Access local symbols relative to the GOT. */ - if (GET_CODE (indx) != REG || GET_MODE (indx) != Pmode) - return FALSE; + rtx temp = reg? reg : gen_reg_rtx (Pmode); - if (REGNO (indx) == BASE_REGNUM - || REGNO (indx) == STACK_POINTER_REGNUM - || REGNO (indx) == FRAME_POINTER_REGNUM - || ((reload_completed || reload_in_progress) - && frame_pointer_needed - && REGNO (indx) == HARD_FRAME_POINTER_REGNUM) - || REGNO (indx) == ARG_POINTER_REGNUM - || (flag_pic - && REGNO (indx) == PIC_OFFSET_TABLE_REGNUM)) - pointer = indx_ptr = TRUE; - } + if (reload_in_progress || reload_completed) + regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; - /* Prefer to use pointer as base, not index. */ - if (base && indx && !base_ptr - && (indx_ptr || (!REG_POINTER (base) && REG_POINTER (indx)))) - { - rtx tmp = base; - base = indx; - indx = tmp; - } + addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF); + addr = gen_rtx_CONST (Pmode, addr); + addr = force_const_mem (Pmode, addr); + emit_move_insn (temp, addr); - /* Validate displacement. */ - if (!disp) - { - /* If the argument pointer or the return address pointer are involved, - the displacement will change later anyway as the virtual registers get - eliminated. This could make a valid displacement invalid, but it is - more likely to make an invalid displacement valid, because we sometimes - access the register save area via negative offsets to one of those - registers. - Thus we don't check the displacement for validity here. If after - elimination the displacement turns out to be invalid after all, - this is fixed up by reload in any case. */ - if (base != arg_pointer_rtx - && indx != arg_pointer_rtx - && base != return_address_pointer_rtx - && indx != return_address_pointer_rtx) - if (!DISP_IN_RANGE (offset)) - return FALSE; + new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); + if (reg != 0) + { + s390_load_address (reg, new); + new = reg; + } + } } - else + else if (GET_CODE (addr) == SYMBOL_REF) { - /* All the special cases are pointers. */ - pointer = TRUE; + if (reg == 0) + reg = gen_reg_rtx (Pmode); - /* In the small-PIC case, the linker converts @GOT - and @GOTNTPOFF offsets to possible displacements. */ - if (GET_CODE (disp) == UNSPEC - && (XINT (disp, 1) == UNSPEC_GOT - || XINT (disp, 1) == UNSPEC_GOTNTPOFF) - && offset == 0 - && flag_pic == 1) + if (flag_pic == 1) { - ; - } + /* Assume GOT offset < 4k. This is handled the same way + in both 31- and 64-bit code (@GOT). */ - /* Accept chunkified literal pool symbol references. */ - else if (GET_CODE (disp) == MINUS - && GET_CODE (XEXP (disp, 0)) == LABEL_REF - && GET_CODE (XEXP (disp, 1)) == LABEL_REF) - { - ; - } - - /* Accept literal pool references. */ - else if (GET_CODE (disp) == UNSPEC - && XINT (disp, 1) == UNSPEC_LTREL_OFFSET) - { - orig_disp = gen_rtx_CONST (Pmode, disp); - if (offset) - { - /* If we have an offset, make sure it does not - exceed the size of the constant pool entry. */ - rtx sym = XVECEXP (disp, 0, 0); - if (offset >= GET_MODE_SIZE (get_pool_mode (sym))) - return FALSE; - - orig_disp = plus_constant (orig_disp, offset); - } - } - - else - return FALSE; - } - - if (!base && !indx) - pointer = TRUE; - - if (out) - { - out->base = base; - out->indx = indx; - out->disp = orig_disp; - out->pointer = pointer; - } - - return TRUE; -} - -/* Return nonzero if ADDR is a valid memory address. - STRICT specifies whether strict register checking applies. */ - -int -legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, - register rtx addr, int strict) -{ - struct s390_address ad; - if (!s390_decompose_address (addr, &ad)) - return FALSE; - - if (strict) - { - if (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - return FALSE; - if (ad.indx && !REG_OK_FOR_INDEX_STRICT_P (ad.indx)) - return FALSE; - } - else - { - if (ad.base && !REG_OK_FOR_BASE_NONSTRICT_P (ad.base)) - return FALSE; - if (ad.indx && !REG_OK_FOR_INDEX_NONSTRICT_P (ad.indx)) - return FALSE; - } - - return TRUE; -} - -/* Return 1 if OP is a valid operand for the LA instruction. - In 31-bit, we need to prove that the result is used as an - address, as LA performs only a 31-bit addition. */ - -int -legitimate_la_operand_p (register rtx op) -{ - struct s390_address addr; - if (!s390_decompose_address (op, &addr)) - return FALSE; - - if (TARGET_64BIT || addr.pointer) - return TRUE; - - return FALSE; -} - -/* Return 1 if it is valid *and* preferable to use LA to - compute the sum of OP1 and OP2. */ - -int -preferred_la_operand_p (rtx op1, rtx op2) -{ - struct s390_address addr; - - if (op2 != const0_rtx) - op1 = gen_rtx_PLUS (Pmode, op1, op2); - - if (!s390_decompose_address (op1, &addr)) - return FALSE; - if (addr.base && !REG_OK_FOR_BASE_STRICT_P (addr.base)) - return FALSE; - if (addr.indx && !REG_OK_FOR_INDEX_STRICT_P (addr.indx)) - return FALSE; - - if (!TARGET_64BIT && !addr.pointer) - return FALSE; - - if (addr.pointer) - return TRUE; - - if ((addr.base && REG_P (addr.base) && REG_POINTER (addr.base)) - || (addr.indx && REG_P (addr.indx) && REG_POINTER (addr.indx))) - return TRUE; - - return FALSE; -} - -/* Emit a forced load-address operation to load SRC into DST. - This will use the LOAD ADDRESS instruction even in situations - where legitimate_la_operand_p (SRC) returns false. */ - -void -s390_load_address (rtx dst, rtx src) -{ - if (TARGET_64BIT) - emit_move_insn (dst, src); - else - emit_insn (gen_force_la_31 (dst, src)); -} - -/* Return a legitimate reference for ORIG (an address) using the - register REG. If REG is 0, a new pseudo is generated. - - There are two types of references that must be handled: - - 1. Global data references must load the address from the GOT, via - the PIC reg. An insn is emitted to do this load, and the reg is - returned. - - 2. Static data references, constant pool addresses, and code labels - compute the address as an offset from the GOT, whose base is in - the PIC reg. Static data objects have SYMBOL_FLAG_LOCAL set to - differentiate them from global data objects. The returned - address is the PIC reg + an unspec constant. - - GO_IF_LEGITIMATE_ADDRESS rejects symbolic references unless the PIC - reg also appears in the address. */ - -rtx -legitimize_pic_address (rtx orig, rtx reg) -{ - rtx addr = orig; - rtx new = orig; - rtx base; - - if (GET_CODE (addr) == LABEL_REF - || (GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (addr))) - { - /* This is a local symbol. */ - if (TARGET_CPU_ZARCH && larl_operand (addr, VOIDmode)) - { - /* Access local symbols PC-relative via LARL. - This is the same as in the non-PIC case, so it is - handled automatically ... */ - } - else - { - /* Access local symbols relative to the GOT. */ - - rtx temp = reg? reg : gen_reg_rtx (Pmode); - - if (reload_in_progress || reload_completed) - regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; - - addr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF); - addr = gen_rtx_CONST (Pmode, addr); - addr = force_const_mem (Pmode, addr); - emit_move_insn (temp, addr); - - new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, temp); - if (reg != 0) - { - s390_load_address (reg, new); - new = reg; - } - } - } - else if (GET_CODE (addr) == SYMBOL_REF) - { - if (reg == 0) - reg = gen_reg_rtx (Pmode); - - if (flag_pic == 1) - { - /* Assume GOT offset < 4k. This is handled the same way - in both 31- and 64-bit code (@GOT). */ - - if (reload_in_progress || reload_completed) - regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; + if (reload_in_progress || reload_completed) + regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 1; new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT); new = gen_rtx_CONST (Pmode, new); @@ -3132,8 +2571,7 @@ legitimize_pic_address (rtx orig, rtx reg) addr = XEXP (addr, 0); if (GET_CODE (addr) == UNSPEC) { - if (XVECLEN (addr, 0) != 1) - abort (); + gcc_assert (XVECLEN (addr, 0) == 1); switch (XINT (addr, 1)) { /* If someone moved a GOT-relative UNSPEC @@ -3181,11 +2619,11 @@ legitimize_pic_address (rtx orig, rtx reg) /* Everything else cannot happen. */ default: - abort (); + gcc_unreachable (); } } - else if (GET_CODE (addr) != PLUS) - abort (); + else + gcc_assert (GET_CODE (addr) == PLUS); } if (GET_CODE (addr) == PLUS) { @@ -3259,8 +2697,7 @@ legitimize_pic_address (rtx orig, rtx reg) && GET_CODE (op1) == CONST_INT && XINT (op0, 1) == UNSPEC_GOTOFF) { - if (XVECLEN (op0, 0) != 1) - abort (); + gcc_assert (XVECLEN (op0, 0) == 1); new = force_const_mem (Pmode, orig); } @@ -3317,8 +2754,7 @@ s390_emit_tls_call_insn (rtx result_reg, rtx tls_call) { rtx insn; - if (!flag_pic) - abort (); + gcc_assert (flag_pic); if (!s390_tls_symbol) s390_tls_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tls_get_offset"); @@ -3490,7 +2926,7 @@ legitimize_tls_address (rtx addr, rtx reg) break; default: - abort (); + gcc_unreachable (); } else if (GET_CODE (addr) == CONST && GET_CODE (XEXP (addr, 0)) == UNSPEC) @@ -3498,14 +2934,12 @@ legitimize_tls_address (rtx addr, rtx reg) switch (XINT (XEXP (addr, 0), 1)) { case UNSPEC_INDNTPOFF: - if (TARGET_CPU_ZARCH) - new = addr; - else - abort (); + gcc_assert (TARGET_CPU_ZARCH); + new = addr; break; default: - abort (); + gcc_unreachable (); } } @@ -3522,7 +2956,7 @@ legitimize_tls_address (rtx addr, rtx reg) } else - abort (); /* for now ... */ + gcc_unreachable (); /* for now ... */ return new; } @@ -3554,7 +2988,7 @@ emit_symbolic_move (rtx *operands) See comments by legitimize_pic_address for details. */ rtx -legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, +legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode ATTRIBUTE_UNUSED) { rtx constant_term = const0_rtx; @@ -3609,8 +3043,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, { if (GET_CODE (XEXP (x, 0)) == REG) { - register rtx temp = gen_reg_rtx (Pmode); - register rtx val = force_operand (XEXP (x, 1), temp); + rtx temp = gen_reg_rtx (Pmode); + rtx val = force_operand (XEXP (x, 1), temp); if (val != temp) emit_move_insn (temp, val); @@ -3619,8 +3053,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED, else if (GET_CODE (XEXP (x, 1)) == REG) { - register rtx temp = gen_reg_rtx (Pmode); - register rtx val = force_operand (XEXP (x, 0), temp); + rtx temp = gen_reg_rtx (Pmode); + rtx val = force_operand (XEXP (x, 0), temp); if (val != temp) emit_move_insn (temp, val); @@ -3955,6 +3389,7 @@ s390_expand_addcc (enum rtx_code cmp_code, rtx cmp_op0, rtx cmp_op1, rtx op_res; rtx insn; rtvec p; + int ret; if ((GET_MODE (cmp_op0) == SImode || GET_MODE (cmp_op0) == VOIDmode) && (GET_MODE (cmp_op1) == SImode || GET_MODE (cmp_op1) == VOIDmode)) @@ -4010,8 +3445,8 @@ s390_expand_addcc (enum rtx_code cmp_code, rtx cmp_op0, rtx cmp_op1, insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM), gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1)); /* We use insn_invalid_p here to add clobbers if required. */ - if (insn_invalid_p (emit_insn (insn))) - abort (); + ret = insn_invalid_p (emit_insn (insn)); + gcc_assert (!ret); /* Emit ALC instruction pattern. */ op_res = gen_rtx_fmt_ee (cmp_code, GET_MODE (dst), @@ -4082,8 +3517,8 @@ s390_expand_addcc (enum rtx_code cmp_code, rtx cmp_op0, rtx cmp_op1, insn = gen_rtx_SET (VOIDmode, gen_rtx_REG (cc_mode, CC_REGNUM), gen_rtx_COMPARE (cc_mode, cmp_op0, cmp_op1)); /* We use insn_invalid_p here to add clobbers if required. */ - if (insn_invalid_p (emit_insn (insn))) - abort (); + ret = insn_invalid_p (emit_insn (insn)); + gcc_assert (!ret); /* Emit SLB instruction pattern. */ if (!register_operand (src, GET_MODE (dst))) @@ -4123,14 +3558,14 @@ s390_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs ("\t.quad\t", file); break; default: - abort (); + gcc_unreachable (); } output_addr_const (file, x); fputs ("@DTPOFF", file); } /* In the name of slightly smaller debug output, and to cater to - general assembler losage, recognize various UNSPEC sequences + general assembler lossage, recognize various UNSPEC sequences and turn them back into a direct symbol reference. */ static rtx @@ -4189,10 +3624,12 @@ print_shift_count_operand (FILE *file, rtx op) op = SUBREG_REG (op); /* Sanity check. */ - if (op && (GET_CODE (op) != REG - || REGNO (op) >= FIRST_PSEUDO_REGISTER - || REGNO_REG_CLASS (REGNO (op)) != ADDR_REGS)) - abort (); + if (op) + { + gcc_assert (GET_CODE (op) == REG); + gcc_assert (REGNO (op) < FIRST_PSEUDO_REGISTER); + gcc_assert (REGNO_REG_CLASS (REGNO (op)) == ADDR_REGS); + } /* Shift counts are truncated to the low six bits anyway. */ fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset & 63); @@ -4200,24 +3637,7 @@ print_shift_count_operand (FILE *file, rtx op) fprintf (file, "(%s)", reg_names[REGNO (op)]); } -/* Locate some local-dynamic symbol still in use by this function - so that we can print its name in local-dynamic base patterns. */ - -static const char * -get_some_local_dynamic_name (void) -{ - rtx insn; - - if (cfun->machine->some_ld_name) - return cfun->machine->some_ld_name; - - for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) - if (INSN_P (insn) - && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) - return cfun->machine->some_ld_name; - - abort (); -} +/* See 'get_some_local_dynamic_name'. */ static int get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) @@ -4240,6 +3660,25 @@ get_some_local_dynamic_name_1 (rtx *px, void *data ATTRIBUTE_UNUSED) return 0; } +/* Locate some local-dynamic symbol still in use by this function + so that we can print its name in local-dynamic base patterns. */ + +static const char * +get_some_local_dynamic_name (void) +{ + rtx insn; + + if (cfun->machine->some_ld_name) + return cfun->machine->some_ld_name; + + for (insn = get_insns (); insn ; insn = NEXT_INSN (insn)) + if (INSN_P (insn) + && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) + return cfun->machine->some_ld_name; + + gcc_unreachable (); +} + /* Output machine-dependent UNSPECs occurring in address constant X in assembler syntax to stdio stream FILE. Returns true if the constant X could be recognized, false otherwise. */ @@ -4374,18 +3813,19 @@ print_operand (FILE *file, rtx x, int code) assemble_name (file, get_some_local_dynamic_name ()); } else - abort (); + gcc_unreachable (); return; case 'O': { struct s390_address ad; + int ret; - if (GET_CODE (x) != MEM - || !s390_decompose_address (XEXP (x, 0), &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || ad.indx) - abort (); + gcc_assert (GET_CODE (x) == MEM); + ret = s390_decompose_address (XEXP (x, 0), &ad); + gcc_assert (ret); + gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base)); + gcc_assert (!ad.indx); if (ad.disp) output_addr_const (file, ad.disp); @@ -4397,12 +3837,13 @@ print_operand (FILE *file, rtx x, int code) case 'R': { struct s390_address ad; + int ret; - if (GET_CODE (x) != MEM - || !s390_decompose_address (XEXP (x, 0), &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || ad.indx) - abort (); + gcc_assert (GET_CODE (x) == MEM); + ret = s390_decompose_address (XEXP (x, 0), &ad); + gcc_assert (ret); + gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base)); + gcc_assert (!ad.indx); if (ad.base) fprintf (file, "%s", reg_names[REGNO (ad.base)]); @@ -4414,12 +3855,13 @@ print_operand (FILE *file, rtx x, int code) case 'S': { struct s390_address ad; + int ret; - if (GET_CODE (x) != MEM - || !s390_decompose_address (XEXP (x, 0), &ad) - || (ad.base && !REG_OK_FOR_BASE_STRICT_P (ad.base)) - || ad.indx) - abort (); + gcc_assert (GET_CODE (x) == MEM); + ret = s390_decompose_address (XEXP (x, 0), &ad); + gcc_assert (ret); + gcc_assert (!ad.base || REG_OK_FOR_BASE_STRICT_P (ad.base)); + gcc_assert (!ad.indx); if (ad.disp) output_addr_const (file, ad.disp); @@ -4437,7 +3879,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_CODE (x) == MEM) x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 4)); else - abort (); + gcc_unreachable (); break; case 'M': @@ -4446,7 +3888,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_CODE (x) == MEM) x = change_address (x, VOIDmode, plus_constant (XEXP (x, 0), 8)); else - abort (); + gcc_unreachable (); break; case 'Y': @@ -4489,8 +3931,7 @@ print_operand (FILE *file, rtx x, int code) break; case CONST_DOUBLE: - if (GET_MODE (x) != VOIDmode) - abort (); + gcc_assert (GET_MODE (x) == VOIDmode); if (code == 'b') fprintf (file, HOST_WIDE_INT_PRINT_DEC, CONST_DOUBLE_LOW (x) & 0xff); else if (code == 'x') @@ -4498,7 +3939,7 @@ print_operand (FILE *file, rtx x, int code) else if (code == 'h') fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((CONST_DOUBLE_LOW (x) & 0xffff) ^ 0x8000) - 0x8000); else - abort (); + gcc_unreachable (); break; default: @@ -4527,7 +3968,7 @@ s390_assemble_integer (rtx x, unsigned int size, int aligned_p) /* Returns true if register REGNO is used for forming a memory address in expression X. */ -static int +static bool reg_used_in_mem_p (int regno, rtx x) { enum rtx_code code = GET_CODE (x); @@ -4538,14 +3979,14 @@ reg_used_in_mem_p (int regno, rtx x) { if (refers_to_regno_p (regno, regno+1, XEXP (x, 0), 0)) - return 1; + return true; } else if (code == SET && GET_CODE (SET_DEST (x)) == PC) { if (refers_to_regno_p (regno, regno+1, SET_SRC (x), 0)) - return 1; + return true; } fmt = GET_RTX_FORMAT (code); @@ -4553,20 +3994,20 @@ reg_used_in_mem_p (int regno, rtx x) { if (fmt[i] == 'e' && reg_used_in_mem_p (regno, XEXP (x, i))) - return 1; + return true; else if (fmt[i] == 'E') for (j = 0; j < XVECLEN (x, i); j++) if (reg_used_in_mem_p (regno, XVECEXP (x, i, j))) - return 1; + return true; } - return 0; + return false; } /* Returns true if expression DEP_RTX sets an address register used by instruction INSN to address memory. */ -static int +static bool addr_generation_dependency_p (rtx dep_rtx, rtx insn) { rtx target, pat; @@ -4591,20 +4032,17 @@ addr_generation_dependency_p (rtx dep_rtx, rtx insn) pat = PATTERN (insn); if (GET_CODE (pat) == PARALLEL) { - if (XVECLEN (pat, 0) != 2) - abort(); + gcc_assert (XVECLEN (pat, 0) == 2); pat = XVECEXP (pat, 0, 0); } - if (GET_CODE (pat) == SET) - return refers_to_regno_p (regno, regno+1, SET_SRC (pat), 0); - else - abort(); + gcc_assert (GET_CODE (pat) == SET); + return refers_to_regno_p (regno, regno+1, SET_SRC (pat), 0); } else if (get_attr_atype (insn) == ATYPE_AGEN) return reg_used_in_mem_p (regno, PATTERN (insn)); } } - return 0; + return false; } /* Return 1, if dep_insn sets register used in insn in the agen unit. */ @@ -4648,8 +4086,8 @@ s390_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority) switch (s390_safe_attr_type (insn)) { - case TYPE_FSTORED: - case TYPE_FSTORES: + case TYPE_FSTOREDF: + case TYPE_FSTORESF: priority = priority << 3; break; case TYPE_STORE: @@ -4679,108 +4117,22 @@ s390_first_cycle_multipass_dfa_lookahead (void) } -/* Split all branches that exceed the maximum distance. - Returns true if this created a new literal pool entry. */ +/* Annotate every literal pool reference in X by an UNSPEC_LTREF expression. + Fix up MEMs as required. */ -static int -s390_split_branches (void) +static void +annotate_constant_pool_refs (rtx *x) { - rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); - int new_literal = 0; - rtx insn, pat, tmp, target; - rtx *label; - - /* We need correct insn addresses. */ - - shorten_branches (get_insns ()); + int i, j; + const char *fmt; - /* Find all branches that exceed 64KB, and split them. */ + gcc_assert (GET_CODE (*x) != SYMBOL_REF + || !CONSTANT_POOL_ADDRESS_P (*x)); - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + /* Literal pool references can only occur inside a MEM ... */ + if (GET_CODE (*x) == MEM) { - if (GET_CODE (insn) != JUMP_INSN) - continue; - - pat = PATTERN (insn); - if (GET_CODE (pat) == PARALLEL && XVECLEN (pat, 0) > 2) - pat = XVECEXP (pat, 0, 0); - if (GET_CODE (pat) != SET || SET_DEST (pat) != pc_rtx) - continue; - - if (GET_CODE (SET_SRC (pat)) == LABEL_REF) - { - label = &SET_SRC (pat); - } - else if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE) - { - if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF) - label = &XEXP (SET_SRC (pat), 1); - else if (GET_CODE (XEXP (SET_SRC (pat), 2)) == LABEL_REF) - label = &XEXP (SET_SRC (pat), 2); - else - continue; - } - else - continue; - - if (get_attr_length (insn) <= 4) - continue; - - /* We are going to use the return register as scratch register, - make sure it will be saved/restored by the prologue/epilogue. */ - cfun_frame_layout.save_return_addr_p = 1; - - if (!flag_pic) - { - new_literal = 1; - tmp = force_const_mem (Pmode, *label); - tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, tmp), insn); - INSN_ADDRESSES_NEW (tmp, -1); - annotate_constant_pool_refs (&PATTERN (tmp)); - - target = temp_reg; - } - else - { - new_literal = 1; - target = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, *label), - UNSPEC_LTREL_OFFSET); - target = gen_rtx_CONST (Pmode, target); - target = force_const_mem (Pmode, target); - tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn); - INSN_ADDRESSES_NEW (tmp, -1); - annotate_constant_pool_refs (&PATTERN (tmp)); - - target = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XEXP (target, 0), - cfun->machine->base_reg), - UNSPEC_LTREL_BASE); - target = gen_rtx_PLUS (Pmode, temp_reg, target); - } - - if (!validate_change (insn, label, target, 0)) - abort (); - } - - return new_literal; -} - -/* Annotate every literal pool reference in X by an UNSPEC_LTREF expression. - Fix up MEMs as required. */ - -static void -annotate_constant_pool_refs (rtx *x) -{ - int i, j; - const char *fmt; - - if (GET_CODE (*x) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (*x)) - abort (); - - /* Literal pool references can only occur inside a MEM ... */ - if (GET_CODE (*x) == MEM) - { - rtx memref = XEXP (*x, 0); + rtx memref = XEXP (*x, 0); if (GET_CODE (memref) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (memref)) @@ -4868,6 +4220,91 @@ annotate_constant_pool_refs (rtx *x) } } +/* Split all branches that exceed the maximum distance. + Returns true if this created a new literal pool entry. */ + +static int +s390_split_branches (void) +{ + rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM); + int new_literal = 0, ret; + rtx insn, pat, tmp, target; + rtx *label; + + /* We need correct insn addresses. */ + + shorten_branches (get_insns ()); + + /* Find all branches that exceed 64KB, and split them. */ + + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + { + if (GET_CODE (insn) != JUMP_INSN) + continue; + + pat = PATTERN (insn); + if (GET_CODE (pat) == PARALLEL && XVECLEN (pat, 0) > 2) + pat = XVECEXP (pat, 0, 0); + if (GET_CODE (pat) != SET || SET_DEST (pat) != pc_rtx) + continue; + + if (GET_CODE (SET_SRC (pat)) == LABEL_REF) + { + label = &SET_SRC (pat); + } + else if (GET_CODE (SET_SRC (pat)) == IF_THEN_ELSE) + { + if (GET_CODE (XEXP (SET_SRC (pat), 1)) == LABEL_REF) + label = &XEXP (SET_SRC (pat), 1); + else if (GET_CODE (XEXP (SET_SRC (pat), 2)) == LABEL_REF) + label = &XEXP (SET_SRC (pat), 2); + else + continue; + } + else + continue; + + if (get_attr_length (insn) <= 4) + continue; + + /* We are going to use the return register as scratch register, + make sure it will be saved/restored by the prologue/epilogue. */ + cfun_frame_layout.save_return_addr_p = 1; + + if (!flag_pic) + { + new_literal = 1; + tmp = force_const_mem (Pmode, *label); + tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, tmp), insn); + INSN_ADDRESSES_NEW (tmp, -1); + annotate_constant_pool_refs (&PATTERN (tmp)); + + target = temp_reg; + } + else + { + new_literal = 1; + target = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, *label), + UNSPEC_LTREL_OFFSET); + target = gen_rtx_CONST (Pmode, target); + target = force_const_mem (Pmode, target); + tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, target), insn); + INSN_ADDRESSES_NEW (tmp, -1); + annotate_constant_pool_refs (&PATTERN (tmp)); + + target = gen_rtx_UNSPEC (Pmode, gen_rtvec (2, XEXP (target, 0), + cfun->machine->base_reg), + UNSPEC_LTREL_BASE); + target = gen_rtx_PLUS (Pmode, temp_reg, target); + } + + ret = validate_change (insn, label, target, 0); + gcc_assert (ret); + } + + return new_literal; +} + /* Find an annotated literal pool symbol referenced in RTX X, and store it at REF. Will abort if X contains references to @@ -4892,21 +4329,19 @@ find_constant_pool_ref (rtx x, rtx *ref) && XINT (x, 1) == UNSPECV_POOL_ENTRY) return; - if (GET_CODE (x) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (x)) - abort (); + gcc_assert (GET_CODE (x) != SYMBOL_REF + || !CONSTANT_POOL_ADDRESS_P (x)); if (GET_CODE (x) == UNSPEC && XINT (x, 1) == UNSPEC_LTREF) { rtx sym = XVECEXP (x, 0, 0); - if (GET_CODE (sym) != SYMBOL_REF - || !CONSTANT_POOL_ADDRESS_P (sym)) - abort (); + gcc_assert (GET_CODE (sym) == SYMBOL_REF + && CONSTANT_POOL_ADDRESS_P (sym)); if (*ref == NULL_RTX) *ref = sym; - else if (*ref != sym) - abort (); + else + gcc_assert (*ref == sym); return; } @@ -4935,8 +4370,7 @@ replace_constant_pool_ref (rtx *x, rtx ref, rtx offset) int i, j; const char *fmt; - if (*x == ref) - abort (); + gcc_assert (*x != ref); if (GET_CODE (*x) == UNSPEC && XINT (*x, 1) == UNSPEC_LTREF @@ -5072,28 +4506,28 @@ struct constant_pool int size; }; -static struct constant_pool * s390_mainpool_start (void); -static void s390_mainpool_finish (struct constant_pool *); -static void s390_mainpool_cancel (struct constant_pool *); - -static struct constant_pool * s390_chunkify_start (void); -static void s390_chunkify_finish (struct constant_pool *); -static void s390_chunkify_cancel (struct constant_pool *); - -static struct constant_pool *s390_start_pool (struct constant_pool **, rtx); -static void s390_end_pool (struct constant_pool *, rtx); -static void s390_add_pool_insn (struct constant_pool *, rtx); -static struct constant_pool *s390_find_pool (struct constant_pool *, rtx); -static void s390_add_constant (struct constant_pool *, rtx, enum machine_mode); -static rtx s390_find_constant (struct constant_pool *, rtx, enum machine_mode); -static void s390_add_execute (struct constant_pool *, rtx); -static rtx s390_find_execute (struct constant_pool *, rtx); -static rtx s390_execute_label (rtx); -static rtx s390_execute_target (rtx); -static void s390_dump_pool (struct constant_pool *, bool); -static void s390_dump_execute (struct constant_pool *); -static struct constant_pool *s390_alloc_pool (void); -static void s390_free_pool (struct constant_pool *); +/* Allocate new constant_pool structure. */ + +static struct constant_pool * +s390_alloc_pool (void) +{ + struct constant_pool *pool; + int i; + + pool = (struct constant_pool *) xmalloc (sizeof *pool); + pool->next = NULL; + for (i = 0; i < NR_C_MODES; i++) + pool->constants[i] = NULL; + + pool->execute = NULL; + pool->label = gen_label_rtx (); + pool->first_insn = NULL_RTX; + pool->pool_insn = NULL_RTX; + pool->insns = BITMAP_ALLOC (NULL); + pool->size = 0; + + return pool; +} /* Create new constant pool covering instructions starting at INSN and chain it to the end of POOL_LIST. */ @@ -5161,8 +4595,7 @@ s390_add_constant (struct constant_pool *pool, rtx val, enum machine_mode mode) for (i = 0; i < NR_C_MODES; i++) if (constant_modes[i] == mode) break; - if (i == NR_C_MODES) - abort (); + gcc_assert (i != NR_C_MODES); for (c = pool->constants[i]; c != NULL; c = c->next) if (rtx_equal_p (val, c->value)) @@ -5194,15 +4627,13 @@ s390_find_constant (struct constant_pool *pool, rtx val, for (i = 0; i < NR_C_MODES; i++) if (constant_modes[i] == mode) break; - if (i == NR_C_MODES) - abort (); + gcc_assert (i != NR_C_MODES); for (c = pool->constants[i]; c != NULL; c = c->next) if (rtx_equal_p (val, c->value)) break; - if (c == NULL) - abort (); + gcc_assert (c); offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label), gen_rtx_LABEL_REF (Pmode, pool->label)); @@ -5210,6 +4641,21 @@ s390_find_constant (struct constant_pool *pool, rtx val, return offset; } +/* Check whether INSN is an execute. Return the label_ref to its + execute target template if so, NULL_RTX otherwise. */ + +static rtx +s390_execute_label (rtx insn) +{ + if (GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == PARALLEL + && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == UNSPEC + && XINT (XVECEXP (PATTERN (insn), 0, 0), 1) == UNSPEC_EXECUTE) + return XVECEXP (XVECEXP (PATTERN (insn), 0, 0), 0, 2); + + return NULL_RTX; +} + /* Add execute target for INSN to the constant pool POOL. */ static void @@ -5249,8 +4695,7 @@ s390_find_execute (struct constant_pool *pool, rtx insn) if (INSN_UID (insn) == INSN_UID (c->value)) break; - if (c == NULL) - abort (); + gcc_assert (c); offset = gen_rtx_MINUS (Pmode, gen_rtx_LABEL_REF (Pmode, c->label), gen_rtx_LABEL_REF (Pmode, pool->label)); @@ -5258,21 +4703,6 @@ s390_find_execute (struct constant_pool *pool, rtx insn) return offset; } -/* Check whether INSN is an execute. Return the label_ref to its - execute target template if so, NULL_RTX otherwise. */ - -static rtx -s390_execute_label (rtx insn) -{ - if (GET_CODE (insn) == INSN - && GET_CODE (PATTERN (insn)) == PARALLEL - && GET_CODE (XVECEXP (PATTERN (insn), 0, 0)) == UNSPEC - && XINT (XVECEXP (PATTERN (insn), 0, 0), 1) == UNSPEC_EXECUTE) - return XVECEXP (XVECEXP (PATTERN (insn), 0, 0), 0, 2); - - return NULL_RTX; -} - /* For an execute INSN, extract the execute target template. */ static rtx @@ -5299,6 +4729,28 @@ s390_execute_target (rtx insn) return pattern; } +/* Dump out the out-of-pool execute template insns in POOL + at the end of the instruction stream. */ + +static void +s390_dump_execute (struct constant_pool *pool) +{ + struct constant *c; + rtx insn; + + for (c = pool->execute; c; c = c->next) + { + if (s390_execute_label (c->value) == const0_rtx) + continue; + + insn = emit_label (c->label); + INSN_ADDRESSES_NEW (insn, -1); + + insn = emit_insn (s390_execute_target (c->value)); + INSN_ADDRESSES_NEW (insn, -1); + } +} + /* Indicate that INSN cannot be duplicated. This is the case for execute insns that carry a unique label. */ @@ -5401,75 +4853,30 @@ s390_dump_pool (struct constant_pool *pool, bool remote_label) s390_dump_execute (pool); } -/* Dump out the out-of-pool execute template insns in POOL - at the end of the instruction stream. */ +/* Free all memory used by POOL. */ static void -s390_dump_execute (struct constant_pool *pool) +s390_free_pool (struct constant_pool *pool) { - struct constant *c; - rtx insn; + struct constant *c, *next; + int i; - for (c = pool->execute; c; c = c->next) + for (i = 0; i < NR_C_MODES; i++) + for (c = pool->constants[i]; c; c = next) + { + next = c->next; + free (c); + } + + for (c = pool->execute; c; c = next) { - if (s390_execute_label (c->value) == const0_rtx) - continue; + next = c->next; + free (c); + } - insn = emit_label (c->label); - INSN_ADDRESSES_NEW (insn, -1); - - insn = emit_insn (s390_execute_target (c->value)); - INSN_ADDRESSES_NEW (insn, -1); - } -} - -/* Allocate new constant_pool structure. */ - -static struct constant_pool * -s390_alloc_pool (void) -{ - struct constant_pool *pool; - int i; - - pool = (struct constant_pool *) xmalloc (sizeof *pool); - pool->next = NULL; - for (i = 0; i < NR_C_MODES; i++) - pool->constants[i] = NULL; - - pool->execute = NULL; - pool->label = gen_label_rtx (); - pool->first_insn = NULL_RTX; - pool->pool_insn = NULL_RTX; - pool->insns = BITMAP_ALLOC (NULL); - pool->size = 0; - - return pool; -} - -/* Free all memory used by POOL. */ - -static void -s390_free_pool (struct constant_pool *pool) -{ - struct constant *c, *next; - int i; - - for (i = 0; i < NR_C_MODES; i++) - for (c = pool->constants[i]; c; c = next) - { - next = c->next; - free (c); - } - - for (c = pool->execute; c; c = next) - { - next = c->next; - free (c); - } - - BITMAP_FREE (pool->insns); - free (pool); -} + BITMAP_FREE (pool->insns); + free (pool); +} /* Collect main literal pool. Return NULL on overflow. */ @@ -5489,8 +4896,7 @@ s390_mainpool_start (void) && GET_CODE (SET_SRC (PATTERN (insn))) == UNSPEC_VOLATILE && XINT (SET_SRC (PATTERN (insn)), 1) == UNSPECV_MAIN_POOL) { - if (pool->pool_insn) - abort (); + gcc_assert (!pool->pool_insn); pool->pool_insn = insn; } @@ -5511,8 +4917,7 @@ s390_mainpool_start (void) } } - if (!pool->pool_insn && pool->size > 0) - abort (); + gcc_assert (pool->pool_insn || pool->size == 0); if (pool->size >= 4096) { @@ -5690,10 +5095,8 @@ s390_chunkify_start (void) rtx ltrel_base = find_ltrel_base (PATTERN (insn)); if (ltrel_base) { - if (ltrel_base == pending_ltrel) - pending_ltrel = NULL_RTX; - else - abort (); + gcc_assert (ltrel_base == pending_ltrel); + pending_ltrel = NULL_RTX; } } @@ -5726,8 +5129,7 @@ s390_chunkify_start (void) && GET_CODE (XEXP (constant, 0)) == UNSPEC && XINT (XEXP (constant, 0), 1) == UNSPEC_LTREL_OFFSET) { - if (pending_ltrel) - abort (); + gcc_assert (!pending_ltrel); pending_ltrel = pool_ref; } } @@ -5738,8 +5140,7 @@ s390_chunkify_start (void) if (curr_pool) s390_add_pool_insn (curr_pool, insn); /* An LTREL_BASE must follow within the same basic block. */ - if (pending_ltrel) - abort (); + gcc_assert (!pending_ltrel); } if (!curr_pool @@ -5817,9 +5218,7 @@ s390_chunkify_start (void) if (curr_pool) s390_end_pool (curr_pool, NULL_RTX); - if (pending_ltrel) - abort (); - + gcc_assert (!pending_ltrel); /* Find all labels that are branched into from an insn belonging to a different chunk. */ @@ -6059,8 +5458,7 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) switch (GET_MODE_CLASS (mode)) { case MODE_FLOAT: - if (GET_CODE (exp) != CONST_DOUBLE) - abort (); + gcc_assert (GET_CODE (exp) == CONST_DOUBLE); REAL_VALUE_FROM_CONST_DOUBLE (r, exp); assemble_real (r, mode, align); @@ -6071,379 +5469,120 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align) break; default: - abort (); + gcc_unreachable (); } } -/* Rework the prologue/epilogue to avoid saving/restoring - registers unnecessarily. */ +/* Return an RTL expression representing the value of the return address + for the frame COUNT steps up from the current frame. FRAME is the + frame pointer of that frame. */ -static void -s390_optimize_prologue (void) +rtx +s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED) { - rtx insn, new_insn, next_insn; + int offset; + rtx addr; - /* Do a final recompute of the frame-related data. */ + /* Without backchain, we fail for all but the current frame. */ - s390_update_frame_layout (); + if (!TARGET_BACKCHAIN && count > 0) + return NULL_RTX; - /* If all special registers are in fact used, there's nothing we - can do, so no point in walking the insn list. */ + /* For the current frame, we need to make sure the initial + value of RETURN_REGNUM is actually saved. */ - if (cfun_frame_layout.first_save_gpr <= BASE_REGNUM - && cfun_frame_layout.last_save_gpr >= BASE_REGNUM - && (TARGET_CPU_ZARCH - || (cfun_frame_layout.first_save_gpr <= RETURN_REGNUM - && cfun_frame_layout.last_save_gpr >= RETURN_REGNUM))) - return; + if (count == 0) + { + cfun_frame_layout.save_return_addr_p = true; + return gen_rtx_MEM (Pmode, return_address_pointer_rtx); + } - /* Search for prologue/epilogue insns and replace them. */ + if (TARGET_PACKED_STACK) + offset = -2 * UNITS_PER_WORD; + else + offset = RETURN_REGNUM * UNITS_PER_WORD; - for (insn = get_insns (); insn; insn = next_insn) - { - int first, last, off; - rtx set, base, offset; + addr = plus_constant (frame, offset); + addr = memory_address (Pmode, addr); + return gen_rtx_MEM (Pmode, addr); +} - next_insn = NEXT_INSN (insn); +/* Return an RTL expression representing the back chain stored in + the current stack frame. */ - if (GET_CODE (insn) != INSN) - continue; +rtx +s390_back_chain_rtx (void) +{ + rtx chain; - if (GET_CODE (PATTERN (insn)) == PARALLEL - && store_multiple_operation (PATTERN (insn), VOIDmode)) - { - set = XVECEXP (PATTERN (insn), 0, 0); - first = REGNO (SET_SRC (set)); - last = first + XVECLEN (PATTERN (insn), 0) - 1; - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); - off = INTVAL (offset); + gcc_assert (TARGET_BACKCHAIN); - if (GET_CODE (base) != REG || off < 0) - continue; - if (REGNO (base) != STACK_POINTER_REGNUM - && REGNO (base) != HARD_FRAME_POINTER_REGNUM) - continue; - if (first > BASE_REGNUM || last < BASE_REGNUM) - continue; + if (TARGET_PACKED_STACK) + chain = plus_constant (stack_pointer_rtx, + STACK_POINTER_OFFSET - UNITS_PER_WORD); + else + chain = stack_pointer_rtx; - if (cfun_frame_layout.first_save_gpr != -1) - { - new_insn = save_gprs (base, - off + (cfun_frame_layout.first_save_gpr - - first) * UNITS_PER_WORD, - cfun_frame_layout.first_save_gpr, - cfun_frame_layout.last_save_gpr); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } + chain = gen_rtx_MEM (Pmode, chain); + return chain; +} - remove_insn (insn); - continue; - } +/* Find first call clobbered register unused in a function. + This could be used as base register in a leaf function + or for holding the return address before epilogue. */ - if (GET_CODE (PATTERN (insn)) == SET - && GET_CODE (SET_SRC (PATTERN (insn))) == REG - && (REGNO (SET_SRC (PATTERN (insn))) == BASE_REGNUM - || (!TARGET_CPU_ZARCH - && REGNO (SET_SRC (PATTERN (insn))) == RETURN_REGNUM)) - && GET_CODE (SET_DEST (PATTERN (insn))) == MEM) - { - set = PATTERN (insn); - first = REGNO (SET_SRC (set)); - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); - off = INTVAL (offset); +static int +find_unused_clobbered_reg (void) +{ + int i; + for (i = 0; i < 6; i++) + if (!regs_ever_live[i]) + return i; + return 0; +} - if (GET_CODE (base) != REG || off < 0) - continue; - if (REGNO (base) != STACK_POINTER_REGNUM - && REGNO (base) != HARD_FRAME_POINTER_REGNUM) - continue; - if (cfun_frame_layout.first_save_gpr != -1) - { - new_insn = save_gprs (base, - off + (cfun_frame_layout.first_save_gpr - - first) * UNITS_PER_WORD, - cfun_frame_layout.first_save_gpr, - cfun_frame_layout.last_save_gpr); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } +/* Determine the frame area which actually has to be accessed + in the function epilogue. The values are stored at the + given pointers AREA_BOTTOM (address of the lowest used stack + address) and AREA_TOP (address of the first item which does + not belong to the stack frame). */ - remove_insn (insn); - continue; - } +static void +s390_frame_area (int *area_bottom, int *area_top) +{ + int b, t; + int i; - if (GET_CODE (PATTERN (insn)) == PARALLEL - && load_multiple_operation (PATTERN (insn), VOIDmode)) - { - set = XVECEXP (PATTERN (insn), 0, 0); - first = REGNO (SET_DEST (set)); - last = first + XVECLEN (PATTERN (insn), 0) - 1; - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); - off = INTVAL (offset); + b = INT_MAX; + t = INT_MIN; - if (GET_CODE (base) != REG || off < 0) - continue; - if (REGNO (base) != STACK_POINTER_REGNUM - && REGNO (base) != HARD_FRAME_POINTER_REGNUM) - continue; - if (first > BASE_REGNUM || last < BASE_REGNUM) - continue; + if (cfun_frame_layout.first_restore_gpr != -1) + { + b = (cfun_frame_layout.gprs_offset + + cfun_frame_layout.first_restore_gpr * UNITS_PER_WORD); + t = b + (cfun_frame_layout.last_restore_gpr + - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_WORD; + } - if (cfun_frame_layout.first_restore_gpr != -1) - { - new_insn = restore_gprs (base, - off + (cfun_frame_layout.first_restore_gpr - - first) * UNITS_PER_WORD, - cfun_frame_layout.first_restore_gpr, - cfun_frame_layout.last_restore_gpr); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } + if (TARGET_64BIT && cfun_save_high_fprs_p) + { + b = MIN (b, cfun_frame_layout.f8_offset); + t = MAX (t, (cfun_frame_layout.f8_offset + + cfun_frame_layout.high_fprs * 8)); + } - remove_insn (insn); - continue; + if (!TARGET_64BIT) + for (i = 2; i < 4; i++) + if (cfun_fpr_bit_p (i)) + { + b = MIN (b, cfun_frame_layout.f4_offset + (i - 2) * 8); + t = MAX (t, cfun_frame_layout.f4_offset + (i - 1) * 8); } - - if (GET_CODE (PATTERN (insn)) == SET - && GET_CODE (SET_DEST (PATTERN (insn))) == REG - && (REGNO (SET_DEST (PATTERN (insn))) == BASE_REGNUM - || (!TARGET_CPU_ZARCH - && REGNO (SET_DEST (PATTERN (insn))) == RETURN_REGNUM)) - && GET_CODE (SET_SRC (PATTERN (insn))) == MEM) - { - set = PATTERN (insn); - first = REGNO (SET_DEST (set)); - offset = const0_rtx; - base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); - off = INTVAL (offset); - - if (GET_CODE (base) != REG || off < 0) - continue; - if (REGNO (base) != STACK_POINTER_REGNUM - && REGNO (base) != HARD_FRAME_POINTER_REGNUM) - continue; - if (cfun_frame_layout.first_restore_gpr != -1) - { - new_insn = restore_gprs (base, - off + (cfun_frame_layout.first_restore_gpr - - first) * UNITS_PER_WORD, - cfun_frame_layout.first_restore_gpr, - cfun_frame_layout.last_restore_gpr); - new_insn = emit_insn_before (new_insn, insn); - INSN_ADDRESSES_NEW (new_insn, -1); - } - - remove_insn (insn); - continue; - } - } -} - -/* Perform machine-dependent processing. */ - -static void -s390_reorg (void) -{ - bool pool_overflow = false; - - /* Make sure all splits have been performed; splits after - machine_dependent_reorg might confuse insn length counts. */ - split_all_insns_noflow (); - - - /* Install the main literal pool and the associated base - register load insns. - - In addition, there are two problematic situations we need - to correct: - - - the literal pool might be > 4096 bytes in size, so that - some of its elements cannot be directly accessed - - - a branch target might be > 64K away from the branch, so that - it is not possible to use a PC-relative instruction. - - To fix those, we split the single literal pool into multiple - pool chunks, reloading the pool base register at various - points throughout the function to ensure it always points to - the pool chunk the following code expects, and / or replace - PC-relative branches by absolute branches. - - However, the two problems are interdependent: splitting the - literal pool can move a branch further away from its target, - causing the 64K limit to overflow, and on the other hand, - replacing a PC-relative branch by an absolute branch means - we need to put the branch target address into the literal - pool, possibly causing it to overflow. - - So, we loop trying to fix up both problems until we manage - to satisfy both conditions at the same time. Note that the - loop is guaranteed to terminate as every pass of the loop - strictly decreases the total number of PC-relative branches - in the function. (This is not completely true as there - might be branch-over-pool insns introduced by chunkify_start. - Those never need to be split however.) */ - - for (;;) - { - struct constant_pool *pool = NULL; - - /* Collect the literal pool. */ - if (!pool_overflow) - { - pool = s390_mainpool_start (); - if (!pool) - pool_overflow = true; - } - - /* If literal pool overflowed, start to chunkify it. */ - if (pool_overflow) - pool = s390_chunkify_start (); - - /* Split out-of-range branches. If this has created new - literal pool entries, cancel current chunk list and - recompute it. zSeries machines have large branch - instructions, so we never need to split a branch. */ - if (!TARGET_CPU_ZARCH && s390_split_branches ()) - { - if (pool_overflow) - s390_chunkify_cancel (pool); - else - s390_mainpool_cancel (pool); - - continue; - } - - /* If we made it up to here, both conditions are satisfied. - Finish up literal pool related changes. */ - if (pool_overflow) - s390_chunkify_finish (pool); - else - s390_mainpool_finish (pool); - - /* We're done splitting branches. */ - cfun->machine->split_branches_pending_p = false; - break; - } - - s390_optimize_prologue (); -} - - -/* Return an RTL expression representing the value of the return address - for the frame COUNT steps up from the current frame. FRAME is the - frame pointer of that frame. */ - -rtx -s390_return_addr_rtx (int count, rtx frame ATTRIBUTE_UNUSED) -{ - int offset; - rtx addr; - - /* Without backchain, we fail for all but the current frame. */ - - if (!TARGET_BACKCHAIN && count > 0) - return NULL_RTX; - - /* For the current frame, we need to make sure the initial - value of RETURN_REGNUM is actually saved. */ - - if (count == 0) - { - cfun_frame_layout.save_return_addr_p = true; - return gen_rtx_MEM (Pmode, return_address_pointer_rtx); - } - - if (TARGET_PACKED_STACK) - offset = -2 * UNITS_PER_WORD; - else - offset = RETURN_REGNUM * UNITS_PER_WORD; - - addr = plus_constant (frame, offset); - addr = memory_address (Pmode, addr); - return gen_rtx_MEM (Pmode, addr); -} - -/* Return an RTL expression representing the back chain stored in - the current stack frame. */ - -rtx -s390_back_chain_rtx (void) -{ - rtx chain; - - gcc_assert (TARGET_BACKCHAIN); - - if (TARGET_PACKED_STACK) - chain = plus_constant (stack_pointer_rtx, - STACK_POINTER_OFFSET - UNITS_PER_WORD); - else - chain = stack_pointer_rtx; - - chain = gen_rtx_MEM (Pmode, chain); - return chain; -} - -/* Find first call clobbered register unused in a function. - This could be used as base register in a leaf function - or for holding the return address before epilogue. */ - -static int -find_unused_clobbered_reg (void) -{ - int i; - for (i = 0; i < 6; i++) - if (!regs_ever_live[i]) - return i; - return 0; -} - -/* Determine the frame area which actually has to be accessed - in the function epilogue. The values are stored at the - given pointers AREA_BOTTOM (address of the lowest used stack - address) and AREA_TOP (address of the first item which does - not belong to the stack frame). */ - -static void -s390_frame_area (int *area_bottom, int *area_top) -{ - int b, t; - int i; - - b = INT_MAX; - t = INT_MIN; - - if (cfun_frame_layout.first_restore_gpr != -1) - { - b = (cfun_frame_layout.gprs_offset - + cfun_frame_layout.first_restore_gpr * UNITS_PER_WORD); - t = b + (cfun_frame_layout.last_restore_gpr - - cfun_frame_layout.first_restore_gpr + 1) * UNITS_PER_WORD; - } - - if (TARGET_64BIT && cfun_save_high_fprs_p) - { - b = MIN (b, cfun_frame_layout.f8_offset); - t = MAX (t, (cfun_frame_layout.f8_offset - + cfun_frame_layout.high_fprs * 8)); - } - - if (!TARGET_64BIT) - for (i = 2; i < 4; i++) - if (cfun_fpr_bit_p (i)) - { - b = MIN (b, cfun_frame_layout.f4_offset + (i - 2) * 8); - t = MAX (t, cfun_frame_layout.f4_offset + (i - 1) * 8); - } - - *area_bottom = b; - *area_top = t; -} + + *area_bottom = b; + *area_top = t; +} /* Fill cfun->machine with info about register usage of current function. Return in LIVE_REGS which GPRs are currently considered live. */ @@ -7085,11 +6224,11 @@ s390_emit_prologue (void) if (s390_warn_framesize > 0 && cfun_frame_layout.frame_size >= s390_warn_framesize) - warning ("frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes", + warning (0, "frame size of %qs is " HOST_WIDE_INT_PRINT_DEC " bytes", current_function_name (), cfun_frame_layout.frame_size); if (s390_warn_dynamicstack_p && cfun->calls_alloca) - warning ("%qs uses dynamic stack allocation", current_function_name ()); + warning (0, "%qs uses dynamic stack allocation", current_function_name ()); /* Save incoming stack pointer into temp reg. */ if (TARGET_BACKCHAIN || next_fpr) @@ -7419,7 +6558,7 @@ s390_function_arg_size (enum machine_mode mode, tree type) return GET_MODE_SIZE (mode); /* If we have neither type nor mode, abort */ - abort (); + gcc_unreachable (); } /* Return true if a function argument of type TYPE and mode MODE @@ -7547,7 +6686,7 @@ s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD); } else - abort (); + gcc_unreachable (); } /* Define where to put the arguments to a function. @@ -7599,7 +6738,7 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, else if (type == void_type_node) return const0_rtx; - abort (); + gcc_unreachable (); } /* Return true if return values of type TYPE should be returned @@ -7642,11 +6781,9 @@ s390_function_value (tree type, enum machine_mode mode) mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1); } - if (GET_MODE_CLASS (mode) != MODE_INT - && GET_MODE_CLASS (mode) != MODE_FLOAT) - abort (); - if (GET_MODE_SIZE (mode) > 8) - abort (); + gcc_assert (GET_MODE_CLASS (mode) == MODE_INT + || GET_MODE_CLASS (mode) == MODE_FLOAT); + gcc_assert (GET_MODE_SIZE (mode) <= 8); if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT) return gen_rtx_REG (mode, 16); @@ -7809,7 +6946,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) ret = **args.overflow_arg_area++; } */ -tree +static tree s390_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED) { @@ -8081,7 +7218,7 @@ s390_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, pat = GEN_FCN (icode) (target, op[0], op[1]); break; default: - abort (); + gcc_unreachable (); } if (!pat) return NULL_RTX; @@ -8155,7 +7292,7 @@ s390_gen_rtx_const_DI (int high, int low) #if HOST_BITS_PER_WIDE_INT >= 32 return immed_double_const ((HOST_WIDE_INT)low, (HOST_WIDE_INT)high, DImode); #else - abort (); + gcc_unreachable (); #endif #endif } @@ -8454,328 +7591,666 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED, output_asm_insn ("l\t%4,0(%4)", op); } - output_asm_insn ("br\t%4", op); + output_asm_insn ("br\t%4", op); + + /* Output literal pool. */ + output_asm_insn (".align\t4", op); + + if (nonlocal && flag_pic == 2) + output_asm_insn (".long\t%0", op); + if (nonlocal) + { + op[0] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); + SYMBOL_REF_FLAGS (op[0]) = SYMBOL_FLAG_LOCAL; + } + + targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[8])); + if (!flag_pic) + output_asm_insn (".long\t%0", op); + else + output_asm_insn (".long\t%0-%5", op); + + if (op[6]) + { + targetm.asm_out.internal_label (file, "L", + CODE_LABEL_NUMBER (op[6])); + output_asm_insn (".long\t%2", op); + } + if (op[7]) + { + targetm.asm_out.internal_label (file, "L", + CODE_LABEL_NUMBER (op[7])); + output_asm_insn (".long\t%3", op); + } + } +} + +static bool +s390_valid_pointer_mode (enum machine_mode mode) +{ + return (mode == SImode || (TARGET_64BIT && mode == DImode)); +} + +/* Checks whether the given ARGUMENT_LIST would use a caller + saved register. This is used to decide whether sibling call + optimization could be performed on the respective function + call. */ + +static bool +s390_call_saved_register_used (tree argument_list) +{ + CUMULATIVE_ARGS cum; + tree parameter; + enum machine_mode mode; + tree type; + rtx parm_rtx; + int reg; + + INIT_CUMULATIVE_ARGS (cum, NULL, NULL, 0, 0); + + while (argument_list) + { + parameter = TREE_VALUE (argument_list); + argument_list = TREE_CHAIN (argument_list); + + gcc_assert (parameter); + + /* For an undeclared variable passed as parameter we will get + an ERROR_MARK node here. */ + if (TREE_CODE (parameter) == ERROR_MARK) + return true; + + type = TREE_TYPE (parameter); + gcc_assert (type); + + mode = TYPE_MODE (type); + gcc_assert (mode); + + if (pass_by_reference (&cum, mode, type, true)) + { + mode = Pmode; + type = build_pointer_type (type); + } + + parm_rtx = s390_function_arg (&cum, mode, type, 0); + + s390_function_arg_advance (&cum, mode, type, 0); + + if (parm_rtx && REG_P (parm_rtx)) + { + for (reg = 0; + reg < HARD_REGNO_NREGS (REGNO (parm_rtx), GET_MODE (parm_rtx)); + reg++) + if (! call_used_regs[reg + REGNO (parm_rtx)]) + return true; + } + } + return false; +} + +/* Return true if the given call expression can be + turned into a sibling call. + DECL holds the declaration of the function to be called whereas + EXP is the call expression itself. */ + +static bool +s390_function_ok_for_sibcall (tree decl, tree exp) +{ + /* The TPF epilogue uses register 1. */ + if (TARGET_TPF_PROFILING) + return false; + + /* The 31 bit PLT code uses register 12 (GOT pointer - caller saved) + which would have to be restored before the sibcall. */ + if (!TARGET_64BIT && flag_pic && decl && TREE_PUBLIC (decl)) + return false; + + /* Register 6 on s390 is available as an argument register but unfortunately + "caller saved". This makes functions needing this register for arguments + not suitable for sibcalls. */ + if (TREE_OPERAND (exp, 1) + && s390_call_saved_register_used (TREE_OPERAND (exp, 1))) + return false; + + return true; +} + +/* Return the fixed registers used for condition codes. */ + +static bool +s390_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) +{ + *p1 = CC_REGNUM; + *p2 = INVALID_REGNUM; + + return true; +} + +/* If two condition code modes are compatible, return a condition code + mode which is compatible with both. Otherwise, return + VOIDmode. */ + +static enum machine_mode +s390_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2) +{ + if (m1 == m2) + return m1; + + switch (m1) + { + case CCZmode: + if (m2 == CCUmode || m2 == CCTmode + || m2 == CCSmode || m2 == CCSRmode || m2 == CCURmode) + return m2; + return VOIDmode; + + case CCSmode: + case CCUmode: + case CCTmode: + case CCSRmode: + case CCURmode: + if (m2 == CCZmode) + return m1; + + return VOIDmode; + + default: + return VOIDmode; + } + return VOIDmode; +} + +/* This function is used by the call expanders of the machine description. + It emits the call insn itself together with the necessary operations + to adjust the target address and returns the emitted insn. + ADDR_LOCATION is the target address rtx + TLS_CALL the location of the thread-local symbol + RESULT_REG the register where the result of the call should be stored + RETADDR_REG the register where the return address should be stored + If this parameter is NULL_RTX the call is considered + to be a sibling call. */ + +rtx +s390_emit_call (rtx addr_location, rtx tls_call, rtx result_reg, + rtx retaddr_reg) +{ + bool plt_call = false; + rtx insn; + rtx call; + rtx clobber; + rtvec vec; + + /* Direct function calls need special treatment. */ + if (GET_CODE (addr_location) == SYMBOL_REF) + { + /* When calling a global routine in PIC mode, we must + replace the symbol itself with the PLT stub. */ + if (flag_pic && !SYMBOL_REF_LOCAL_P (addr_location)) + { + addr_location = gen_rtx_UNSPEC (Pmode, + gen_rtvec (1, addr_location), + UNSPEC_PLT); + addr_location = gen_rtx_CONST (Pmode, addr_location); + plt_call = true; + } + + /* Unless we can use the bras(l) insn, force the + routine address into a register. */ + if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH) + { + if (flag_pic) + addr_location = legitimize_pic_address (addr_location, 0); + else + addr_location = force_reg (Pmode, addr_location); + } + } + + /* If it is already an indirect call or the code above moved the + SYMBOL_REF to somewhere else make sure the address can be found in + register 1. */ + if (retaddr_reg == NULL_RTX + && GET_CODE (addr_location) != SYMBOL_REF + && !plt_call) + { + emit_move_insn (gen_rtx_REG (Pmode, SIBCALL_REGNUM), addr_location); + addr_location = gen_rtx_REG (Pmode, SIBCALL_REGNUM); + } + + addr_location = gen_rtx_MEM (QImode, addr_location); + call = gen_rtx_CALL (VOIDmode, addr_location, const0_rtx); + + if (result_reg != NULL_RTX) + call = gen_rtx_SET (VOIDmode, result_reg, call); + + if (retaddr_reg != NULL_RTX) + { + clobber = gen_rtx_CLOBBER (VOIDmode, retaddr_reg); + + if (tls_call != NULL_RTX) + vec = gen_rtvec (3, call, clobber, + gen_rtx_USE (VOIDmode, tls_call)); + else + vec = gen_rtvec (2, call, clobber); + + call = gen_rtx_PARALLEL (VOIDmode, vec); + } + + insn = emit_call_insn (call); + + /* 31-bit PLT stubs and tls calls use the GOT register implicitly. */ + if ((!TARGET_64BIT && plt_call) || tls_call != NULL_RTX) + { + /* s390_function_ok_for_sibcall should + have denied sibcalls in this case. */ + gcc_assert (retaddr_reg != NULL_RTX); + + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); + } + return insn; +} + +/* Implement CONDITIONAL_REGISTER_USAGE. */ + +void +s390_conditional_register_usage (void) +{ + int i; + + if (flag_pic) + { + fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; + call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; + } + if (TARGET_CPU_ZARCH) + { + fixed_regs[RETURN_REGNUM] = 0; + call_used_regs[RETURN_REGNUM] = 0; + } + if (TARGET_64BIT) + { + for (i = 24; i < 32; i++) + call_used_regs[i] = call_really_used_regs[i] = 0; + } + else + { + for (i = 18; i < 20; i++) + call_used_regs[i] = call_really_used_regs[i] = 0; + } + + if (TARGET_SOFT_FLOAT) + { + for (i = 16; i < 32; i++) + call_used_regs[i] = fixed_regs[i] = 1; + } +} + +/* Corresponding function to eh_return expander. */ + +static GTY(()) rtx s390_tpf_eh_return_symbol; +void +s390_emit_tpf_eh_return (rtx target) +{ + rtx insn, reg; + + if (!s390_tpf_eh_return_symbol) + s390_tpf_eh_return_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tpf_eh_return"); + + reg = gen_rtx_REG (Pmode, 2); + + emit_move_insn (reg, target); + insn = s390_emit_call (s390_tpf_eh_return_symbol, NULL_RTX, reg, + gen_rtx_REG (Pmode, RETURN_REGNUM)); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg); + + emit_move_insn (EH_RETURN_HANDLER_RTX, reg); +} + +/* Rework the prologue/epilogue to avoid saving/restoring + registers unnecessarily. */ + +static void +s390_optimize_prologue (void) +{ + rtx insn, new_insn, next_insn; + + /* Do a final recompute of the frame-related data. */ + + s390_update_frame_layout (); + + /* If all special registers are in fact used, there's nothing we + can do, so no point in walking the insn list. */ + + if (cfun_frame_layout.first_save_gpr <= BASE_REGNUM + && cfun_frame_layout.last_save_gpr >= BASE_REGNUM + && (TARGET_CPU_ZARCH + || (cfun_frame_layout.first_save_gpr <= RETURN_REGNUM + && cfun_frame_layout.last_save_gpr >= RETURN_REGNUM))) + return; + + /* Search for prologue/epilogue insns and replace them. */ + + for (insn = get_insns (); insn; insn = next_insn) + { + int first, last, off; + rtx set, base, offset; + + next_insn = NEXT_INSN (insn); - /* Output literal pool. */ - output_asm_insn (".align\t4", op); + if (GET_CODE (insn) != INSN) + continue; - if (nonlocal && flag_pic == 2) - output_asm_insn (".long\t%0", op); - if (nonlocal) + if (GET_CODE (PATTERN (insn)) == PARALLEL + && store_multiple_operation (PATTERN (insn), VOIDmode)) { - op[0] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); - SYMBOL_REF_FLAGS (op[0]) = SYMBOL_FLAG_LOCAL; - } + set = XVECEXP (PATTERN (insn), 0, 0); + first = REGNO (SET_SRC (set)); + last = first + XVECLEN (PATTERN (insn), 0) - 1; + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); + off = INTVAL (offset); - targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (op[8])); - if (!flag_pic) - output_asm_insn (".long\t%0", op); - else - output_asm_insn (".long\t%0-%5", op); + if (GET_CODE (base) != REG || off < 0) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + if (first > BASE_REGNUM || last < BASE_REGNUM) + continue; - if (op[6]) - { - targetm.asm_out.internal_label (file, "L", - CODE_LABEL_NUMBER (op[6])); - output_asm_insn (".long\t%2", op); + if (cfun_frame_layout.first_save_gpr != -1) + { + new_insn = save_gprs (base, + off + (cfun_frame_layout.first_save_gpr + - first) * UNITS_PER_WORD, + cfun_frame_layout.first_save_gpr, + cfun_frame_layout.last_save_gpr); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } + + remove_insn (insn); + continue; } - if (op[7]) + + if (GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == REG + && (REGNO (SET_SRC (PATTERN (insn))) == BASE_REGNUM + || (!TARGET_CPU_ZARCH + && REGNO (SET_SRC (PATTERN (insn))) == RETURN_REGNUM)) + && GET_CODE (SET_DEST (PATTERN (insn))) == MEM) { - targetm.asm_out.internal_label (file, "L", - CODE_LABEL_NUMBER (op[7])); - output_asm_insn (".long\t%3", op); - } - } -} + set = PATTERN (insn); + first = REGNO (SET_SRC (set)); + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset); + off = INTVAL (offset); -bool -s390_valid_pointer_mode (enum machine_mode mode) -{ - return (mode == SImode || (TARGET_64BIT && mode == DImode)); -} + if (GET_CODE (base) != REG || off < 0) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + if (cfun_frame_layout.first_save_gpr != -1) + { + new_insn = save_gprs (base, + off + (cfun_frame_layout.first_save_gpr + - first) * UNITS_PER_WORD, + cfun_frame_layout.first_save_gpr, + cfun_frame_layout.last_save_gpr); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } -/* How to allocate a 'struct machine_function'. */ + remove_insn (insn); + continue; + } -static struct machine_function * -s390_init_machine_status (void) -{ - return ggc_alloc_cleared (sizeof (struct machine_function)); -} + if (GET_CODE (PATTERN (insn)) == PARALLEL + && load_multiple_operation (PATTERN (insn), VOIDmode)) + { + set = XVECEXP (PATTERN (insn), 0, 0); + first = REGNO (SET_DEST (set)); + last = first + XVECLEN (PATTERN (insn), 0) - 1; + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); + off = INTVAL (offset); -/* Checks whether the given ARGUMENT_LIST would use a caller - saved register. This is used to decide whether sibling call - optimization could be performed on the respective function - call. */ + if (GET_CODE (base) != REG || off < 0) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + if (first > BASE_REGNUM || last < BASE_REGNUM) + continue; -static bool -s390_call_saved_register_used (tree argument_list) -{ - CUMULATIVE_ARGS cum; - tree parameter; - enum machine_mode mode; - tree type; - rtx parm_rtx; - int reg; + if (cfun_frame_layout.first_restore_gpr != -1) + { + new_insn = restore_gprs (base, + off + (cfun_frame_layout.first_restore_gpr + - first) * UNITS_PER_WORD, + cfun_frame_layout.first_restore_gpr, + cfun_frame_layout.last_restore_gpr); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } - INIT_CUMULATIVE_ARGS (cum, NULL, NULL, 0, 0); + remove_insn (insn); + continue; + } - while (argument_list) - { - parameter = TREE_VALUE (argument_list); - argument_list = TREE_CHAIN (argument_list); + if (GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_DEST (PATTERN (insn))) == REG + && (REGNO (SET_DEST (PATTERN (insn))) == BASE_REGNUM + || (!TARGET_CPU_ZARCH + && REGNO (SET_DEST (PATTERN (insn))) == RETURN_REGNUM)) + && GET_CODE (SET_SRC (PATTERN (insn))) == MEM) + { + set = PATTERN (insn); + first = REGNO (SET_DEST (set)); + offset = const0_rtx; + base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset); + off = INTVAL (offset); - if (!parameter) - abort(); + if (GET_CODE (base) != REG || off < 0) + continue; + if (REGNO (base) != STACK_POINTER_REGNUM + && REGNO (base) != HARD_FRAME_POINTER_REGNUM) + continue; + if (cfun_frame_layout.first_restore_gpr != -1) + { + new_insn = restore_gprs (base, + off + (cfun_frame_layout.first_restore_gpr + - first) * UNITS_PER_WORD, + cfun_frame_layout.first_restore_gpr, + cfun_frame_layout.last_restore_gpr); + new_insn = emit_insn_before (new_insn, insn); + INSN_ADDRESSES_NEW (new_insn, -1); + } - /* For an undeclared variable passed as parameter we will get - an ERROR_MARK node here. */ - if (TREE_CODE (parameter) == ERROR_MARK) - return true; + remove_insn (insn); + continue; + } + } +} - if (! (type = TREE_TYPE (parameter))) - abort(); +/* Perform machine-dependent processing. */ - if (! (mode = TYPE_MODE (TREE_TYPE (parameter)))) - abort(); +static void +s390_reorg (void) +{ + bool pool_overflow = false; - if (pass_by_reference (&cum, mode, type, true)) - { - mode = Pmode; - type = build_pointer_type (type); - } + /* Make sure all splits have been performed; splits after + machine_dependent_reorg might confuse insn length counts. */ + split_all_insns_noflow (); - parm_rtx = s390_function_arg (&cum, mode, type, 0); - s390_function_arg_advance (&cum, mode, type, 0); + /* Install the main literal pool and the associated base + register load insns. - if (parm_rtx && REG_P (parm_rtx)) - { - for (reg = 0; - reg < HARD_REGNO_NREGS (REGNO (parm_rtx), GET_MODE (parm_rtx)); - reg++) - if (! call_used_regs[reg + REGNO (parm_rtx)]) - return true; - } - } - return false; -} + In addition, there are two problematic situations we need + to correct: -/* Return true if the given call expression can be - turned into a sibling call. - DECL holds the declaration of the function to be called whereas - EXP is the call expression itself. */ + - the literal pool might be > 4096 bytes in size, so that + some of its elements cannot be directly accessed -static bool -s390_function_ok_for_sibcall (tree decl, tree exp) -{ - /* The TPF epilogue uses register 1. */ - if (TARGET_TPF_PROFILING) - return false; + - a branch target might be > 64K away from the branch, so that + it is not possible to use a PC-relative instruction. - /* The 31 bit PLT code uses register 12 (GOT pointer - caller saved) - which would have to be restored before the sibcall. */ - if (!TARGET_64BIT && flag_pic && decl && TREE_PUBLIC (decl)) - return false; + To fix those, we split the single literal pool into multiple + pool chunks, reloading the pool base register at various + points throughout the function to ensure it always points to + the pool chunk the following code expects, and / or replace + PC-relative branches by absolute branches. - /* Register 6 on s390 is available as an argument register but unfortunately - "caller saved". This makes functions needing this register for arguments - not suitable for sibcalls. */ - if (TREE_OPERAND (exp, 1) - && s390_call_saved_register_used (TREE_OPERAND (exp, 1))) - return false; + However, the two problems are interdependent: splitting the + literal pool can move a branch further away from its target, + causing the 64K limit to overflow, and on the other hand, + replacing a PC-relative branch by an absolute branch means + we need to put the branch target address into the literal + pool, possibly causing it to overflow. - return true; -} + So, we loop trying to fix up both problems until we manage + to satisfy both conditions at the same time. Note that the + loop is guaranteed to terminate as every pass of the loop + strictly decreases the total number of PC-relative branches + in the function. (This is not completely true as there + might be branch-over-pool insns introduced by chunkify_start. + Those never need to be split however.) */ -/* Return the fixed registers used for condition codes. */ + for (;;) + { + struct constant_pool *pool = NULL; -static bool -s390_fixed_condition_code_regs (unsigned int *p1, unsigned int *p2) -{ - *p1 = CC_REGNUM; - *p2 = INVALID_REGNUM; - - return true; -} + /* Collect the literal pool. */ + if (!pool_overflow) + { + pool = s390_mainpool_start (); + if (!pool) + pool_overflow = true; + } -/* If two condition code modes are compatible, return a condition code - mode which is compatible with both. Otherwise, return - VOIDmode. */ + /* If literal pool overflowed, start to chunkify it. */ + if (pool_overflow) + pool = s390_chunkify_start (); -static enum machine_mode -s390_cc_modes_compatible (enum machine_mode m1, enum machine_mode m2) -{ - if (m1 == m2) - return m1; + /* Split out-of-range branches. If this has created new + literal pool entries, cancel current chunk list and + recompute it. zSeries machines have large branch + instructions, so we never need to split a branch. */ + if (!TARGET_CPU_ZARCH && s390_split_branches ()) + { + if (pool_overflow) + s390_chunkify_cancel (pool); + else + s390_mainpool_cancel (pool); - switch (m1) - { - case CCZmode: - if (m2 == CCUmode || m2 == CCTmode - || m2 == CCSmode || m2 == CCSRmode || m2 == CCURmode) - return m2; - return VOIDmode; + continue; + } - case CCSmode: - case CCUmode: - case CCTmode: - case CCSRmode: - case CCURmode: - if (m2 == CCZmode) - return m1; - - return VOIDmode; + /* If we made it up to here, both conditions are satisfied. + Finish up literal pool related changes. */ + if (pool_overflow) + s390_chunkify_finish (pool); + else + s390_mainpool_finish (pool); - default: - return VOIDmode; + /* We're done splitting branches. */ + cfun->machine->split_branches_pending_p = false; + break; } - return VOIDmode; -} -/* This function is used by the call expanders of the machine description. - It emits the call insn itself together with the necessary operations - to adjust the target address and returns the emitted insn. - ADDR_LOCATION is the target address rtx - TLS_CALL the location of the thread-local symbol - RESULT_REG the register where the result of the call should be stored - RETADDR_REG the register where the return address should be stored - If this parameter is NULL_RTX the call is considered - to be a sibling call. */ + s390_optimize_prologue (); +} -rtx -s390_emit_call (rtx addr_location, rtx tls_call, rtx result_reg, - rtx retaddr_reg) -{ - bool plt_call = false; - rtx insn; - rtx call; - rtx clobber; - rtvec vec; - /* Direct function calls need special treatment. */ - if (GET_CODE (addr_location) == SYMBOL_REF) - { - /* When calling a global routine in PIC mode, we must - replace the symbol itself with the PLT stub. */ - if (flag_pic && !SYMBOL_REF_LOCAL_P (addr_location)) - { - addr_location = gen_rtx_UNSPEC (Pmode, - gen_rtvec (1, addr_location), - UNSPEC_PLT); - addr_location = gen_rtx_CONST (Pmode, addr_location); - plt_call = true; - } +/* Initialize GCC target structure. */ - /* Unless we can use the bras(l) insn, force the - routine address into a register. */ - if (!TARGET_SMALL_EXEC && !TARGET_CPU_ZARCH) - { - if (flag_pic) - addr_location = legitimize_pic_address (addr_location, 0); - else - addr_location = force_reg (Pmode, addr_location); - } - } +#undef TARGET_ASM_ALIGNED_HI_OP +#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t" +#undef TARGET_ASM_ALIGNED_DI_OP +#define TARGET_ASM_ALIGNED_DI_OP "\t.quad\t" +#undef TARGET_ASM_INTEGER +#define TARGET_ASM_INTEGER s390_assemble_integer - /* If it is already an indirect call or the code above moved the - SYMBOL_REF to somewhere else make sure the address can be found in - register 1. */ - if (retaddr_reg == NULL_RTX - && GET_CODE (addr_location) != SYMBOL_REF - && !plt_call) - { - emit_move_insn (gen_rtx_REG (Pmode, SIBCALL_REGNUM), addr_location); - addr_location = gen_rtx_REG (Pmode, SIBCALL_REGNUM); - } +#undef TARGET_ASM_OPEN_PAREN +#define TARGET_ASM_OPEN_PAREN "" - addr_location = gen_rtx_MEM (QImode, addr_location); - call = gen_rtx_CALL (VOIDmode, addr_location, const0_rtx); +#undef TARGET_ASM_CLOSE_PAREN +#define TARGET_ASM_CLOSE_PAREN "" - if (result_reg != NULL_RTX) - call = gen_rtx_SET (VOIDmode, result_reg, call); +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION s390_handle_option - if (retaddr_reg != NULL_RTX) - { - clobber = gen_rtx_CLOBBER (VOIDmode, retaddr_reg); +#undef TARGET_ENCODE_SECTION_INFO +#define TARGET_ENCODE_SECTION_INFO s390_encode_section_info - if (tls_call != NULL_RTX) - vec = gen_rtvec (3, call, clobber, - gen_rtx_USE (VOIDmode, tls_call)); - else - vec = gen_rtvec (2, call, clobber); +#ifdef HAVE_AS_TLS +#undef TARGET_HAVE_TLS +#define TARGET_HAVE_TLS true +#endif +#undef TARGET_CANNOT_FORCE_CONST_MEM +#define TARGET_CANNOT_FORCE_CONST_MEM s390_cannot_force_const_mem - call = gen_rtx_PARALLEL (VOIDmode, vec); - } +#undef TARGET_DELEGITIMIZE_ADDRESS +#define TARGET_DELEGITIMIZE_ADDRESS s390_delegitimize_address - insn = emit_call_insn (call); +#undef TARGET_RETURN_IN_MEMORY +#define TARGET_RETURN_IN_MEMORY s390_return_in_memory - /* 31-bit PLT stubs and tls calls use the GOT register implicitly. */ - if ((!TARGET_64BIT && plt_call) || tls_call != NULL_RTX) - { - /* s390_function_ok_for_sibcall should - have denied sibcalls in this case. */ - if (retaddr_reg == NULL_RTX) - abort (); +#undef TARGET_INIT_BUILTINS +#define TARGET_INIT_BUILTINS s390_init_builtins +#undef TARGET_EXPAND_BUILTIN +#define TARGET_EXPAND_BUILTIN s390_expand_builtin - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx); - } - return insn; -} +#undef TARGET_ASM_OUTPUT_MI_THUNK +#define TARGET_ASM_OUTPUT_MI_THUNK s390_output_mi_thunk +#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK +#define TARGET_ASM_CAN_OUTPUT_MI_THUNK hook_bool_tree_hwi_hwi_tree_true -/* Implement CONDITIONAL_REGISTER_USAGE. */ +#undef TARGET_SCHED_ADJUST_PRIORITY +#define TARGET_SCHED_ADJUST_PRIORITY s390_adjust_priority +#undef TARGET_SCHED_ISSUE_RATE +#define TARGET_SCHED_ISSUE_RATE s390_issue_rate +#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD +#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD s390_first_cycle_multipass_dfa_lookahead -void -s390_conditional_register_usage (void) -{ - int i; +#undef TARGET_CANNOT_COPY_INSN_P +#define TARGET_CANNOT_COPY_INSN_P s390_cannot_copy_insn_p +#undef TARGET_RTX_COSTS +#define TARGET_RTX_COSTS s390_rtx_costs +#undef TARGET_ADDRESS_COST +#define TARGET_ADDRESS_COST s390_address_cost - if (flag_pic) - { - fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; - call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; - } - if (TARGET_CPU_ZARCH) - { - fixed_regs[RETURN_REGNUM] = 0; - call_used_regs[RETURN_REGNUM] = 0; - } - if (TARGET_64BIT) - { - for (i = 24; i < 32; i++) - call_used_regs[i] = call_really_used_regs[i] = 0; - } - else - { - for (i = 18; i < 20; i++) - call_used_regs[i] = call_really_used_regs[i] = 0; - } +#undef TARGET_MACHINE_DEPENDENT_REORG +#define TARGET_MACHINE_DEPENDENT_REORG s390_reorg - if (TARGET_SOFT_FLOAT) - { - for (i = 16; i < 32; i++) - call_used_regs[i] = fixed_regs[i] = 1; - } -} +#undef TARGET_VALID_POINTER_MODE +#define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode -/* Corresponding function to eh_return expander. */ +#undef TARGET_BUILD_BUILTIN_VA_LIST +#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list +#undef TARGET_GIMPLIFY_VA_ARG_EXPR +#define TARGET_GIMPLIFY_VA_ARG_EXPR s390_gimplify_va_arg -static GTY(()) rtx s390_tpf_eh_return_symbol; -void -s390_emit_tpf_eh_return (rtx target) -{ - rtx insn, reg; +#undef TARGET_PROMOTE_FUNCTION_ARGS +#define TARGET_PROMOTE_FUNCTION_ARGS hook_bool_tree_true +#undef TARGET_PROMOTE_FUNCTION_RETURN +#define TARGET_PROMOTE_FUNCTION_RETURN hook_bool_tree_true +#undef TARGET_PASS_BY_REFERENCE +#define TARGET_PASS_BY_REFERENCE s390_pass_by_reference - if (!s390_tpf_eh_return_symbol) - s390_tpf_eh_return_symbol = gen_rtx_SYMBOL_REF (Pmode, "__tpf_eh_return"); +#undef TARGET_FUNCTION_OK_FOR_SIBCALL +#define TARGET_FUNCTION_OK_FOR_SIBCALL s390_function_ok_for_sibcall - reg = gen_rtx_REG (Pmode, 2); +#undef TARGET_FIXED_CONDITION_CODE_REGS +#define TARGET_FIXED_CONDITION_CODE_REGS s390_fixed_condition_code_regs - emit_move_insn (reg, target); - insn = s390_emit_call (s390_tpf_eh_return_symbol, NULL_RTX, reg, - gen_rtx_REG (Pmode, RETURN_REGNUM)); - use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg); +#undef TARGET_CC_MODES_COMPATIBLE +#define TARGET_CC_MODES_COMPATIBLE s390_cc_modes_compatible - emit_move_insn (EH_RETURN_HANDLER_RTX, reg); -} +struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-s390.h" diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index a6b7a3afd51..84d035357b7 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -54,16 +54,9 @@ enum processor_flags extern enum processor_type s390_tune; extern enum processor_flags s390_tune_flags; -extern const char *s390_tune_string; extern enum processor_type s390_arch; extern enum processor_flags s390_arch_flags; -extern const char *s390_arch_string; - -extern const char *s390_warn_framesize_string; -extern const char *s390_warn_dynamicstack_string; -extern const char *s390_stack_size_string; -extern const char *s390_stack_guard_string; #define TARGET_CPU_IEEE_FLOAT \ (s390_arch_flags & PF_IEEE_FLOAT) @@ -93,33 +86,6 @@ extern const char *s390_stack_guard_string; } \ while (0) -/* Optional target features. */ -extern int target_flags; - -#define MASK_HARD_FLOAT 0x01 -#define MASK_SMALL_EXEC 0x04 -#define MASK_DEBUG_ARG 0x08 -#define MASK_64BIT 0x10 -#define MASK_ZARCH 0x20 -#define MASK_MVCLE 0x40 -#define MASK_TPF_PROFILING 0x80 -#define MASK_NO_FUSED_MADD 0x100 -#define MASK_BACKCHAIN 0x200 -#define MASK_PACKED_STACK 0x400 - -#define TARGET_HARD_FLOAT (target_flags & MASK_HARD_FLOAT) -#define TARGET_SOFT_FLOAT (!(target_flags & MASK_HARD_FLOAT)) -#define TARGET_SMALL_EXEC (target_flags & MASK_SMALL_EXEC) -#define TARGET_DEBUG_ARG (target_flags & MASK_DEBUG_ARG) -#define TARGET_64BIT (target_flags & MASK_64BIT) -#define TARGET_ZARCH (target_flags & MASK_ZARCH) -#define TARGET_MVCLE (target_flags & MASK_MVCLE) -#define TARGET_TPF_PROFILING (target_flags & MASK_TPF_PROFILING) -#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) -#define TARGET_FUSED_MADD (! TARGET_NO_FUSED_MADD) -#define TARGET_BACKCHAIN (target_flags & MASK_BACKCHAIN) -#define TARGET_PACKED_STACK (target_flags & MASK_PACKED_STACK) - /* ??? Once this actually works, it could be made a runtime option. */ #define TARGET_IBM_FLOAT 0 #define TARGET_IEEE_FLOAT 1 @@ -130,48 +96,6 @@ extern int target_flags; #define TARGET_DEFAULT MASK_HARD_FLOAT #endif -#define TARGET_SWITCHES \ -{ { "hard-float", 1, N_("Use hardware fp")}, \ - { "soft-float", -1, N_("Don't use hardware fp")}, \ - { "small-exec", 4, N_("Use bras for executable < 64k")}, \ - { "no-small-exec", -4, N_("Don't use bras")}, \ - { "debug", 8, N_("Additional debug prints")}, \ - { "no-debug", -8, N_("Don't print additional debug prints")}, \ - { "64", 16, N_("64 bit ABI")}, \ - { "31", -16, N_("31 bit ABI")}, \ - { "zarch", 32, N_("z/Architecture")}, \ - { "esa", -32, N_("ESA/390 architecture")}, \ - { "mvcle", 64, N_("mvcle use")}, \ - { "no-mvcle", -64, N_("mvc&ex")}, \ - { "tpf-trace", 128, N_("Enable tpf OS tracing code")}, \ - { "no-tpf-trace", -128, N_("Disable tpf OS tracing code")}, \ - { "no-fused-madd", 256, N_("Disable fused multiply/add instructions")},\ - { "fused-madd", -256, N_("Enable fused multiply/add instructions")}, \ - { "backchain", 512, N_("Maintain backchain pointer")}, \ - { "no-backchain", -512, N_("Don't maintain backchain pointer")}, \ - { "packed-stack", 1024, N_("Use packed stack layout")}, \ - { "no-packed-stack", -1024, N_("Don't use packed stack layout")}, \ - { "", TARGET_DEFAULT, 0 } } - -#define TARGET_OPTIONS \ -{ { "tune=", &s390_tune_string, \ - N_("Schedule code for given CPU"), 0}, \ - { "arch=", &s390_arch_string, \ - N_("Generate code for given CPU"), 0}, \ - { "warn-framesize=", &s390_warn_framesize_string, \ - N_("Warn if a single function's framesize exceeds the given framesize"), \ - 0}, \ - { "warn-dynamicstack", &s390_warn_dynamicstack_string, \ - N_("Warn if a function uses alloca or creates an array with dynamic size"),\ - 0}, \ - { "stack-size=", &s390_stack_size_string, \ - N_("Emit extra code in the function prologue in order to trap if the stack"\ - "size exceeds the given limit"), 0}, \ - { "stack-guard=", &s390_stack_guard_string, \ - N_("Set the max. number of bytes which has to be left to stack size " \ - "before a trap instruction is triggered"), 0}, \ -} - /* Support for configure-time defaults. */ #define OPTION_DEFAULT_SPECS \ { "mode", "%{!mesa:%{!mzarch:-m%(VALUE)}}" }, \ @@ -329,12 +253,6 @@ if (INTEGRAL_MODE_P (MODE) && \ #define FRAME_REG_P(X) (REG_P (X) && FRAME_REGNO_P (REGNO (X))) #define ACCESS_REG_P(X) (REG_P (X) && ACCESS_REGNO_P (REGNO (X))) -#define SIBCALL_REGNUM 1 -#define BASE_REGNUM 13 -#define RETURN_REGNUM 14 -#define CC_REGNUM 33 -#define TP_REGNUM 36 - /* Set up fixed registers and calling convention: GPRs 0-5 are always call-clobbered, @@ -567,7 +485,8 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER]; #define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \ s390_const_ok_for_constraint_p ((VALUE), (C), (STR)) -#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(VALUE, C, STR) 1 +#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \ + s390_const_double_ok_for_constraint_p ((VALUE), (C), (STR)) #define EXTRA_CONSTRAINT_STR(OP, C, STR) \ s390_extra_constraint_str ((OP), (C), (STR)) @@ -1043,26 +962,6 @@ do { \ /* Miscellaneous parameters. */ -/* Define the codes that are matched by predicates in aux-output.c. */ -#define PREDICATE_CODES \ - {"s_operand", { SUBREG, MEM }}, \ - {"shift_count_operand", { REG, SUBREG, PLUS, CONST_INT }}, \ - {"bras_sym_operand",{ SYMBOL_REF, CONST }}, \ - {"larl_operand", { SYMBOL_REF, CONST, CONST_INT, CONST_DOUBLE }}, \ - {"load_multiple_operation", {PARALLEL}}, \ - {"store_multiple_operation", {PARALLEL}}, \ - {"const0_operand", { CONST_INT, CONST_DOUBLE }}, \ - {"consttable_operand", { SYMBOL_REF, LABEL_REF, CONST, \ - CONST_INT, CONST_DOUBLE }}, \ - {"s390_plus_operand", { PLUS }}, \ - {"s390_comparison", { EQ, NE, LT, GT, LE, GE, LTU, GTU, LEU, GEU, \ - UNEQ, UNLT, UNGT, UNLE, UNGE, LTGT, \ - UNORDERED, ORDERED }}, \ - {"s390_alc_comparison", { ZERO_EXTEND, SIGN_EXTEND, \ - LTU, GTU, LEU, GEU }}, \ - {"s390_slb_comparison", { ZERO_EXTEND, SIGN_EXTEND, \ - LTU, GTU, LEU, GEU }}, - /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ #define CASE_VECTOR_MODE (TARGET_64BIT ? DImode : SImode) @@ -1083,4 +982,12 @@ do { \ indexing purposes) so give the MEM rtx a byte's mode. */ #define FUNCTION_MODE QImode +/* Machine-specific symbol_ref flags. */ +#define SYMBOL_FLAG_ALIGN1 (SYMBOL_FLAG_MACH_DEP << 0) + +/* Check whether integer displacement is in range. */ +#define DISP_IN_RANGE(d) \ + (TARGET_LONG_DISPLACEMENT? ((d) >= -524288 && (d) <= 524287) \ + : ((d) >= 0 && (d) <= 4095)) + #endif diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 5bb9d4c24aa..93f805ed7f9 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -27,6 +27,9 @@ ;; a -- Any address register from 1 to 15. ;; c -- Condition code register 33. ;; d -- Any register from 0 to 15. +;; f -- Floating point registers. +;; t -- Access registers 36 and 37. +;; G -- Const double zero operand ;; I -- An 8-bit constant (0..255). ;; J -- A 12-bit constant (0..4095). ;; K -- A 16-bit constant (-32768..32767). @@ -145,6 +148,24 @@ (UNSPECV_SET_TP 500) ]) +;; +;; Registers +;; + +(define_constants + [ + ; Sibling call register. + (SIBCALL_REGNUM 1) + ; Literal pool base register. + (BASE_REGNUM 13) + ; Return address register. + (RETURN_REGNUM 14) + ; Condition code register. + (CC_REGNUM 33) + ; Thread local storage pointer register. + (TP_REGNUM 36) + ]) + ;; Instruction operand type as used in the Principles of Operation. ;; Used to determine defaults for length and other attribute values. @@ -156,11 +177,12 @@ ;; Instruction type attribute used for scheduling. (define_attr "type" "none,integer,load,lr,la,larl,lm,stm, - cs,vs,store,imul,idiv, - branch,jsr,fsimpd,fsimps, - floadd,floads,fstored, fstores, - fmuld,fmuls,fdivd,fdivs, - ftoi,itof,fsqrtd,fsqrts, + cs,vs,store,idiv, + imulhi,imulsi,imuldi, + branch,jsr,fsimpdf,fsimpsf, + floaddf,floadsf,fstoredf,fstoresf, + fmuldf,fmulsf,fdivdf,fdivsf, + ftoi,itof,fsqrtdf,fsqrtsf, other" (cond [(eq_attr "op_type" "NN") (const_string "other") (eq_attr "op_type" "SS") (const_string "cs")] @@ -228,25 +250,101 @@ ;; Pipeline description for z990. (include "2084.md") +;; Predicates +(include "predicates.md") + + +;; Macros + +;; This mode macro allows DF and SF patterns to be generated from the +;; same template. +(define_mode_macro FPR [DF SF]) + +;; These mode macros allow 31-bit and 64-bit GPR patterns to be generated +;; from the same template. +(define_mode_macro GPR [(DI "TARGET_64BIT") SI]) +(define_mode_macro DSI [DI SI]) + +;; This mode macro allows :P to be used for patterns that operate on +;; pointer-sized quantities. Exactly one of the two alternatives will match. +(define_mode_macro P [(DI "TARGET_64BIT") (SI "!TARGET_64BIT")]) + +;; This mode macro allows the QI and HI patterns to be defined from +;; the same template. +(define_mode_macro HQI [HI QI]) + +;; This mode macro allows the integer patterns to be defined from the +;; same template. +(define_mode_macro INT [(DI "TARGET_64BIT") SI HI QI]) + +;; This macro allows to unify all 'bCOND' expander patterns. +(define_code_macro COMPARE [eq ne gt gtu lt ltu ge geu le leu unordered + ordered uneq unlt ungt unle unge ltgt]) + +;; This macro allows to unify all 'sCOND' patterns. +(define_code_macro SCOND [ltu gtu leu geu]) + +;; This macro allows some 'ashift' and 'lshiftrt' pattern to be defined from +;; the same template. +(define_code_macro SHIFT [ashift lshiftrt]) + + +;; In FPR templates, a string like "ltbr" will expand to "ltdbr" in DFmode +;; and "ltebr" in SFmode. +(define_mode_attr de [(DF "d") (SF "e")]) + +;; In FPR templates, a string like "mbr" will expand to "mdbr" in DFmode +;; and "meebr" in SFmode. This is needed for the 'mul3' pattern. +(define_mode_attr dee [(DF "d") (SF "ee")]) + +;; In SHIFT templates, a string like "sdl" will expand to "sldl" in +;; 'ashift' and "srdl" in 'lshiftrt'. +(define_code_attr lr [(ashift "l") (lshiftrt "r")]) + +;; In SHIFT templates, this attribute holds the correct standard name for the +;; pattern itself and the corresponding function calls. +(define_code_attr shift [(ashift "ashl") (lshiftrt "lshr")]) + +;; This attribute handles differences in the instruction 'type' and will result +;; in "RRE" for DImode and "RR" for SImode. +(define_mode_attr E [(DI "E") (SI "")]) + +;; In GPR templates, a string like "lcr" will expand to "lcgr" in DImode +;; and "lcr" in SImode. +(define_mode_attr g [(DI "g") (SI "")]) + +;; In GPR templates, a string like "cdbr" will expand to "cgdbr" in DImode +;; and "cfdbr" in SImode. +(define_mode_attr gf [(DI "g") (SI "f")]) + +;; ICM mask required to load MODE value into the highest subreg +;; of a SImode register. +(define_mode_attr icm_hi [(HI "12") (QI "8")]) + +;; ICM mask required to load MODE value into the lowest subreg +;; of a SImode register. +(define_mode_attr icm_lo [(HI "3") (QI "1")]) + +;; In HQI templates, a string like "llg" will expand to "llgh" in +;; HImode and "llgc" in QImode. +(define_mode_attr hc [(HI "h") (QI "c")]) + +;; In P templates, the mode will expand to "TI" in DImode and "DI" +;; in SImode. +(define_mode_attr DBL [(DI "TI") (SI "DI")]) + +;; Maximum unsigned integer that fits in MODE. +(define_mode_attr max_uint [(HI "65535") (QI "255")]) + + ;; ;;- Compare instructions. ;; -(define_expand "cmpdi" - [(set (reg:CC 33) - (compare:CC (match_operand:DI 0 "register_operand" "") - (match_operand:DI 1 "general_operand" "")))] - "TARGET_64BIT" -{ - s390_compare_op0 = operands[0]; - s390_compare_op1 = operands[1]; - DONE; -}) - -(define_expand "cmpsi" - [(set (reg:CC 33) - (compare:CC (match_operand:SI 0 "register_operand" "") - (match_operand:SI 1 "general_operand" "")))] +(define_expand "cmp" + [(set (reg:CC CC_REGNUM) + (compare:CC (match_operand:GPR 0 "register_operand" "") + (match_operand:GPR 1 "general_operand" "")))] "" { s390_compare_op0 = operands[0]; @@ -254,21 +352,10 @@ DONE; }) -(define_expand "cmpdf" - [(set (reg:CC 33) - (compare:CC (match_operand:DF 0 "register_operand" "") - (match_operand:DF 1 "general_operand" "")))] - "TARGET_HARD_FLOAT" -{ - s390_compare_op0 = operands[0]; - s390_compare_op1 = operands[1]; - DONE; -}) - -(define_expand "cmpsf" - [(set (reg:CC 33) - (compare:CC (match_operand:SF 0 "register_operand" "") - (match_operand:SF 1 "general_operand" "")))] +(define_expand "cmp" + [(set (reg:CC CC_REGNUM) + (compare:CC (match_operand:FPR 0 "register_operand" "") + (match_operand:FPR 1 "general_operand" "")))] "TARGET_HARD_FLOAT" { s390_compare_op0 = operands[0]; @@ -280,24 +367,24 @@ ; Test-under-Mask instructions (define_insn "*tmqi_mem" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:QI (match_operand:QI 0 "memory_operand" "Q,S") (match_operand:QI 1 "immediate_operand" "n,n")) (match_operand:QI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))" + "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], false))" "@ tm\t%S0,%b1 tmy\t%S0,%b1" [(set_attr "op_type" "SI,SIY")]) (define_insn "*tmdi_reg" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d") (match_operand:DI 1 "immediate_operand" "N0HD0,N1HD0,N2HD0,N3HD0")) (match_operand:DI 2 "immediate_operand" "n,n,n,n")))] "TARGET_64BIT - && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1)) + && s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) && s390_single_part (operands[1], DImode, HImode, 0) >= 0" "@ tmhh\t%0,%i1 @@ -307,38 +394,30 @@ [(set_attr "op_type" "RI")]) (define_insn "*tmsi_reg" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d") (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0")) (match_operand:SI 2 "immediate_operand" "n,n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1)) + "s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], true)) && s390_single_part (operands[1], SImode, HImode, 0) >= 0" "@ tmh\t%0,%i1 tml\t%0,%i1" [(set_attr "op_type" "RI")]) -(define_insn "*tmhi_full" - [(set (reg 33) - (compare (match_operand:HI 0 "register_operand" "d") - (match_operand:HI 1 "immediate_operand" "n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))" - "tml\t%0,65535" - [(set_attr "op_type" "RI")]) - -(define_insn "*tmqi_full" - [(set (reg 33) - (compare (match_operand:QI 0 "register_operand" "d") - (match_operand:QI 1 "immediate_operand" "n")))] - "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], 1))" - "tml\t%0,255" +(define_insn "*tm_full" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "register_operand" "d") + (match_operand:HQI 1 "immediate_operand" "n")))] + "s390_match_ccmode (insn, s390_tm_ccmode (constm1_rtx, operands[1], true))" + "tml\t%0," [(set_attr "op_type" "RI")]) ; Load-and-Test instructions (define_insn "*tstdi_sign" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 0 "register_operand" "d") 0) (const_int 32)) (const_int 32)) (match_operand:DI 1 "const0_operand" ""))) @@ -349,7 +428,7 @@ [(set_attr "op_type" "RRE")]) (define_insn "*tstdi" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d") (match_operand:DI 1 "const0_operand" ""))) (set (match_operand:DI 2 "register_operand" "=d") @@ -359,7 +438,7 @@ [(set_attr "op_type" "RRE")]) (define_insn "*tstdi_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d") (match_operand:DI 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" @@ -367,7 +446,7 @@ [(set_attr "op_type" "RRE")]) (define_insn "*tstdi_cconly_31" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d") (match_operand:DI 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT" @@ -377,7 +456,7 @@ (define_insn "*tstsi" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") (match_operand:SI 1 "const0_operand" ""))) (set (match_operand:SI 2 "register_operand" "=d,d,d") @@ -390,7 +469,7 @@ [(set_attr "op_type" "RR,RS,RSY")]) (define_insn "*tstsi_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S") (match_operand:SI 1 "const0_operand" ""))) (clobber (match_scratch:SI 2 "=X,d,d"))] @@ -402,28 +481,28 @@ [(set_attr "op_type" "RR,RS,RSY")]) (define_insn "*tstsi_cconly2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 0 "register_operand" "d") (match_operand:SI 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode)" "ltr\t%0,%0" [(set_attr "op_type" "RR")]) -(define_insn "*tsthiCCT" - [(set (reg 33) - (compare (match_operand:HI 0 "nonimmediate_operand" "?Q,?S,d") - (match_operand:HI 1 "const0_operand" ""))) - (set (match_operand:HI 2 "register_operand" "=d,d,0") +(define_insn "*tstCCT" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "nonimmediate_operand" "?Q,?S,d") + (match_operand:HQI 1 "const0_operand" ""))) + (set (match_operand:HQI 2 "register_operand" "=d,d,0") (match_dup 0))] "s390_match_ccmode(insn, CCTmode)" "@ - icm\t%2,3,%S0 - icmy\t%2,3,%S0 - tml\t%0,65535" + icm\t%2,,%S0 + icmy\t%2,,%S0 + tml\t%0," [(set_attr "op_type" "RS,RSY,RI")]) (define_insn "*tsthiCCT_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:HI 0 "nonimmediate_operand" "Q,S,d") (match_operand:HI 1 "const0_operand" ""))) (clobber (match_scratch:HI 2 "=d,d,X"))] @@ -434,44 +513,8 @@ tml\t%0,65535" [(set_attr "op_type" "RS,RSY,RI")]) -(define_insn "*tsthi" - [(set (reg 33) - (compare (match_operand:HI 0 "s_operand" "Q,S") - (match_operand:HI 1 "const0_operand" ""))) - (set (match_operand:HI 2 "register_operand" "=d,d") - (match_dup 0))] - "s390_match_ccmode(insn, CCSmode)" - "@ - icm\t%2,3,%S0 - icmy\t%2,3,%S0" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*tsthi_cconly" - [(set (reg 33) - (compare (match_operand:HI 0 "s_operand" "Q,S") - (match_operand:HI 1 "const0_operand" ""))) - (clobber (match_scratch:HI 2 "=d,d"))] - "s390_match_ccmode(insn, CCSmode)" - "@ - icm\t%2,3,%S0 - icmy\t%2,3,%S0" - [(set_attr "op_type" "RS,RSY")]) - -(define_insn "*tstqiCCT" - [(set (reg 33) - (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d") - (match_operand:QI 1 "const0_operand" ""))) - (set (match_operand:QI 2 "register_operand" "=d,d,0") - (match_dup 0))] - "s390_match_ccmode(insn, CCTmode)" - "@ - icm\t%2,1,%S0 - icmy\t%2,1,%S0 - tml\t%0,255" - [(set_attr "op_type" "RS,RSY,RI")]) - (define_insn "*tstqiCCT_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:QI 0 "nonimmediate_operand" "?Q,?S,d") (match_operand:QI 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCTmode)" @@ -481,34 +524,34 @@ tml\t%0,255" [(set_attr "op_type" "SI,SIY,RI")]) -(define_insn "*tstqi" - [(set (reg 33) - (compare (match_operand:QI 0 "s_operand" "Q,S") - (match_operand:QI 1 "const0_operand" ""))) - (set (match_operand:QI 2 "register_operand" "=d,d") +(define_insn "*tst" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "s_operand" "Q,S") + (match_operand:HQI 1 "const0_operand" ""))) + (set (match_operand:HQI 2 "register_operand" "=d,d") (match_dup 0))] "s390_match_ccmode(insn, CCSmode)" "@ - icm\t%2,1,%S0 - icmy\t%2,1,%S0" + icm\t%2,,%S0 + icmy\t%2,,%S0" [(set_attr "op_type" "RS,RSY")]) -(define_insn "*tstqi_cconly" - [(set (reg 33) - (compare (match_operand:QI 0 "s_operand" "Q,S") - (match_operand:QI 1 "const0_operand" ""))) - (clobber (match_scratch:QI 2 "=d,d"))] +(define_insn "*tst_cconly" + [(set (reg CC_REGNUM) + (compare (match_operand:HQI 0 "s_operand" "Q,S") + (match_operand:HQI 1 "const0_operand" ""))) + (clobber (match_scratch:HQI 2 "=d,d"))] "s390_match_ccmode(insn, CCSmode)" "@ - icm\t%2,1,%S0 - icmy\t%2,1,%S0" + icm\t%2,,%S0 + icmy\t%2,,%S0" [(set_attr "op_type" "RS,RSY")]) ; Compare (equality) instructions (define_insn "*cmpdi_cct" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "nonimmediate_operand" "%d,d,d,Q") (match_operand:DI 1 "general_operand" "d,K,m,BQ")))] "s390_match_ccmode (insn, CCTmode) && TARGET_64BIT" @@ -520,7 +563,7 @@ [(set_attr "op_type" "RRE,RI,RXY,SS")]) (define_insn "*cmpsi_cct" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 0 "nonimmediate_operand" "%d,d,d,d,Q") (match_operand:SI 1 "general_operand" "d,K,R,T,BQ")))] "s390_match_ccmode (insn, CCTmode)" @@ -536,7 +579,7 @@ ; Compare (signed) instructions (define_insn "*cmpdi_ccs_sign" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")) (match_operand:DI 0 "register_operand" "d,d")))] "s390_match_ccmode(insn, CCSRmode) && TARGET_64BIT" @@ -546,7 +589,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*cmpdi_ccs" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "register_operand" "d,d,d") (match_operand:DI 1 "general_operand" "d,K,m")))] "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT" @@ -557,7 +600,7 @@ [(set_attr "op_type" "RRE,RI,RXY")]) (define_insn "*cmpsi_ccs_sign" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (sign_extend:SI (match_operand:HI 1 "memory_operand" "R,T")) (match_operand:SI 0 "register_operand" "d,d")))] "s390_match_ccmode(insn, CCSRmode)" @@ -567,7 +610,7 @@ [(set_attr "op_type" "RX,RXY")]) (define_insn "*cmpsi_ccs" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 0 "register_operand" "d,d,d,d") (match_operand:SI 1 "general_operand" "d,K,R,T")))] "s390_match_ccmode(insn, CCSmode)" @@ -582,7 +625,7 @@ ; Compare (unsigned) instructions (define_insn "*cmpdi_ccu_zero" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" "d,m")) (match_operand:DI 0 "register_operand" "d,d")))] "s390_match_ccmode (insn, CCURmode) && TARGET_64BIT" @@ -592,7 +635,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*cmpdi_ccu" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 0 "nonimmediate_operand" "d,d,Q,BQ") (match_operand:DI 1 "general_operand" "d,m,BQ,Q")))] "s390_match_ccmode (insn, CCUmode) && TARGET_64BIT" @@ -604,7 +647,7 @@ [(set_attr "op_type" "RRE,RXY,SS,SS")]) (define_insn "*cmpsi_ccu" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 0 "nonimmediate_operand" "d,d,d,Q,BQ") (match_operand:SI 1 "general_operand" "d,R,T,BQ,Q")))] "s390_match_ccmode (insn, CCUmode)" @@ -617,7 +660,7 @@ [(set_attr "op_type" "RR,RX,RXY,SS,SS")]) (define_insn "*cmphi_ccu" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:HI 0 "nonimmediate_operand" "d,d,Q,BQ") (match_operand:HI 1 "general_operand" "Q,S,BQ,Q")))] "s390_match_ccmode (insn, CCUmode) @@ -630,7 +673,7 @@ [(set_attr "op_type" "RS,RSY,SS,SS")]) (define_insn "*cmpqi_ccu" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:QI 0 "nonimmediate_operand" "d,d,Q,S,Q,BQ") (match_operand:QI 1 "general_operand" "Q,S,n,n,BQ,Q")))] "s390_match_ccmode (insn, CCUmode) @@ -648,7 +691,7 @@ ; Block compare (CLC) instruction patterns. (define_insn "*clc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:BLK 0 "memory_operand" "Q") (match_operand:BLK 1 "memory_operand" "Q"))) (use (match_operand 2 "const_int_operand" "n"))] @@ -658,7 +701,7 @@ [(set_attr "op_type" "SS")]) (define_split - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand 0 "memory_operand" "") (match_operand 1 "memory_operand" "")))] "reload_completed @@ -679,90 +722,47 @@ }) -; DF instructions - -(define_insn "*cmpdf_ccs_0" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f") - (match_operand:DF 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "ltdbr\t%0,%0" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) - -(define_insn "*cmpdf_ccs_0_ibm" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f") - (match_operand:DF 1 "const0_operand" "")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "ltdr\t%0,%0" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimpd")]) - -(define_insn "*cmpdf_ccs" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f,f") - (match_operand:DF 1 "general_operand" "f,R")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - cdbr\t%0,%1 - cdb\t%0,%1" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd")]) - -(define_insn "*cmpdf_ccs_ibm" - [(set (reg 33) - (compare (match_operand:DF 0 "register_operand" "f,f") - (match_operand:DF 1 "general_operand" "f,R")))] - "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - cdr\t%0,%1 - cd\t%0,%1" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimpd")]) - - -; SF instructions +; (DF|SF) instructions -(define_insn "*cmpsf_ccs_0" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f") - (match_operand:SF 1 "const0_operand" "")))] +(define_insn "*cmp_ccs_0" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f") + (match_operand:FPR 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "ltebr\t%0,%0" + "ltbr\t%0,%0" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*cmpsf_ccs_0_ibm" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f") - (match_operand:SF 1 "const0_operand" "")))] +(define_insn "*cmp_ccs_0_ibm" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f") + (match_operand:FPR 1 "const0_operand" "")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lter\t%0,%0" + "ltr\t%0,%0" [(set_attr "op_type" "RR") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*cmpsf_ccs" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f,f") - (match_operand:SF 1 "general_operand" "f,R")))] +(define_insn "*cmp_ccs" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f,f") + (match_operand:FPR 1 "general_operand" "f,R")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - cebr\t%0,%1 - ceb\t%0,%1" + cbr\t%0,%1 + cb\t%0,%1" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*cmpsf_ccs" - [(set (reg 33) - (compare (match_operand:SF 0 "register_operand" "f,f") - (match_operand:SF 1 "general_operand" "f,R")))] +(define_insn "*cmp_ccs_ibm" + [(set (reg CC_REGNUM) + (compare (match_operand:FPR 0 "register_operand" "f,f") + (match_operand:FPR 1 "general_operand" "f,R")))] "s390_match_ccmode(insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - cer\t%0,%1 - ce\t%0,%1" + cr\t%0,%1 + c\t%0,%1" [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) ;; @@ -891,7 +891,7 @@ [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY, RR,RX,RXY,RX,RXY,*,*,RS,RS,SS") (set_attr "type" "*,*,*,*,*,la,lr,load,store, - floadd,floadd,floadd,fstored,fstored,*,*,*,*,*")]) + floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")]) (define_split [(set (match_operand:DI 0 "register_operand" "") @@ -942,7 +942,7 @@ stdy\t%1,%0 #" [(set_attr "op_type" "RS,RS,*,*,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "lm,stm,*,*,floadd,floadd,floadd,fstored,fstored,*")]) + (set_attr "type" "lm,stm,*,*,floaddf,floaddf,floaddf,fstoredf,fstoredf,*")]) (define_split [(set (match_operand:DI 0 "nonimmediate_operand" "") @@ -1024,7 +1024,7 @@ [(parallel [(set (match_operand:DI 0 "register_operand" "") (match_operand:QI 1 "address_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "TARGET_64BIT && preferred_la_operand_p (operands[1], const0_rtx)" [(set (match_dup 0) (match_dup 1))] @@ -1037,7 +1037,7 @@ [(set (match_dup 0) (plus:DI (match_dup 0) (match_operand:DI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "TARGET_64BIT && !reg_overlap_mentioned_p (operands[0], operands[2]) && preferred_la_operand_p (operands[1], operands[2])" @@ -1106,7 +1106,7 @@ [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY, RR,RX,RXY,RX,RXY,RRE,RRE,RS,RS,SS") (set_attr "type" "*,*,*,la,lr,load,load,store,store, - floads,floads,floads,fstores,fstores,*,*,*,*,*")]) + floadsf,floadsf,floadsf,fstoresf,fstoresf,*,*,*,*,*")]) (define_insn "*movsi_esa" [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,d,t,Q,t,?Q") @@ -1126,7 +1126,7 @@ lam\t%0,%0,%S1 #" [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,RRE,RRE,RS,RS,SS") - (set_attr "type" "*,lr,load,store,floads,floads,fstores,*,*,*,*,*")]) + (set_attr "type" "*,lr,load,store,floadsf,floadsf,fstoresf,*,*,*,*,*")]) (define_peephole2 [(set (match_operand:SI 0 "register_operand" "") @@ -1153,7 +1153,7 @@ [(parallel [(set (match_operand:SI 0 "register_operand" "") (match_operand:QI 1 "address_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "!TARGET_64BIT && preferred_la_operand_p (operands[1], const0_rtx)" [(set (match_dup 0) (match_dup 1))] @@ -1166,7 +1166,7 @@ [(set (match_dup 0) (plus:SI (match_dup 0) (match_operand:SI 2 "nonmemory_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "!TARGET_64BIT && !reg_overlap_mentioned_p (operands[0], operands[2]) && preferred_la_operand_p (operands[1], operands[2])" @@ -1188,7 +1188,7 @@ [(set (match_operand:SI 0 "register_operand" "=d") (and:SI (match_operand:QI 1 "address_operand" "p") (const_int 2147483647))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "#" "&& reload_completed" @@ -1335,7 +1335,7 @@ (define_insn "*movstricthi" [(set (strict_low_part (match_operand:HI 0 "register_operand" "+d,d")) (match_operand:HI 1 "memory_operand" "Q,S")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "@ icm\t%0,3,%S1 @@ -1369,10 +1369,11 @@ "") (define_insn "*movdf_64" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,m,?Q") - (match_operand:DF 1 "general_operand" "f,R,T,f,f,d,m,d,?Q"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,m,?Q") + (match_operand:DF 1 "general_operand" "G,f,R,T,f,f,d,m,d,?Q"))] "TARGET_64BIT" "@ + lzdr\t%0 ldr\t%0,%1 ld\t%0,%1 ldy\t%0,%1 @@ -1382,14 +1383,15 @@ lg\t%0,%1 stg\t%1,%0 #" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS") - (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lr,load,store,*")]) + [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RRE,RXY,RXY,SS") + (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,fstoredf,fstoredf,lr,load,store,*")]) (define_insn "*movdf_31" - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,T,d,Q,d,o,Q") - (match_operand:DF 1 "general_operand" "f,R,T,f,f,Q,d,dKm,d,Q"))] + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,Q,d,o,Q") + (match_operand:DF 1 "general_operand" "G,f,R,T,f,f,Q,d,dKm,d,Q"))] "!TARGET_64BIT" "@ + lzdr\t%0 ldr\t%0,%1 ld\t%0,%1 ldy\t%0,%1 @@ -1400,8 +1402,8 @@ # # #" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RS,RS,*,*,SS") - (set_attr "type" "floadd,floadd,floadd,fstored,fstored,lm,stm,*,*,*")]) + [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RS,RS,*,*,SS") + (set_attr "type" "fsimpdf,floaddf,floaddf,floaddf,fstoredf,fstoredf,lm,stm,*,*,*")]) (define_split [(set (match_operand:DF 0 "nonimmediate_operand" "") @@ -1462,10 +1464,11 @@ ; (define_insn "movsf" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,R,T,d,d,d,R,T,?Q") - (match_operand:SF 1 "general_operand" "f,R,T,f,f,d,R,T,d,d,?Q"))] + [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,T,d,d,d,R,T,?Q") + (match_operand:SF 1 "general_operand" "G,f,R,T,f,f,d,R,T,d,d,?Q"))] "" "@ + lzer\t%0 ler\t%0,%1 le\t%0,%1 ley\t%0,%1 @@ -1477,8 +1480,8 @@ st\t%1,%0 sty\t%1,%0 #" - [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") - (set_attr "type" "floads,floads,floads,fstores,fstores, + [(set_attr "op_type" "RRE,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS") + (set_attr "type" "fsimpsf,floadsf,floadsf,floadsf,fstoresf,fstoresf, lr,load,load,store,store,*")]) ; @@ -1751,72 +1754,37 @@ ; strlenM instruction pattern(s). ; -(define_expand "strlendi" - [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" "")) - (parallel - [(set (match_dup 4) - (unspec:DI [(const_int 0) - (match_operand:BLK 1 "memory_operand" "") - (reg:QI 0) - (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (scratch:DI)) - (clobber (reg:CC 33))]) - (parallel - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))])] - "TARGET_64BIT" -{ - operands[4] = gen_reg_rtx (DImode); - operands[5] = gen_reg_rtx (DImode); - emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); - operands[1] = replace_equiv_address (operands[1], operands[5]); -}) - -(define_insn "*strlendi" - [(set (match_operand:DI 0 "register_operand" "=a") - (unspec:DI [(match_operand:DI 2 "general_operand" "0") - (mem:BLK (match_operand:DI 3 "register_operand" "1")) - (reg:QI 0) - (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (match_scratch:DI 1 "=a")) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "srst\t%0,%1\;jo\t.-4" - [(set_attr "length" "8") - (set_attr "type" "vs")]) - -(define_expand "strlensi" +(define_expand "strlen" [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" "")) (parallel [(set (match_dup 4) - (unspec:SI [(const_int 0) + (unspec:P [(const_int 0) (match_operand:BLK 1 "memory_operand" "") (reg:QI 0) (match_operand 3 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (scratch:SI)) - (clobber (reg:CC 33))]) + (clobber (scratch:P)) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (match_operand:SI 0 "register_operand" "") - (minus:SI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))])] - "!TARGET_64BIT" + [(set (match_operand:P 0 "register_operand" "") + (minus:P (match_dup 4) (match_dup 5))) + (clobber (reg:CC CC_REGNUM))])] + "" { - operands[4] = gen_reg_rtx (SImode); - operands[5] = gen_reg_rtx (SImode); + operands[4] = gen_reg_rtx (Pmode); + operands[5] = gen_reg_rtx (Pmode); emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX)); operands[1] = replace_equiv_address (operands[1], operands[5]); }) -(define_insn "*strlensi" - [(set (match_operand:SI 0 "register_operand" "=a") - (unspec:SI [(match_operand:SI 2 "general_operand" "0") - (mem:BLK (match_operand:SI 3 "register_operand" "1")) +(define_insn "*strlen" + [(set (match_operand:P 0 "register_operand" "=a") + (unspec:P [(match_operand:P 2 "general_operand" "0") + (mem:BLK (match_operand:P 3 "register_operand" "1")) (reg:QI 0) (match_operand 4 "immediate_operand" "")] UNSPEC_SRST)) - (clobber (match_scratch:SI 1 "=a")) - (clobber (reg:CC 33))] - "!TARGET_64BIT" + (clobber (match_scratch:P 1 "=a")) + (clobber (reg:CC CC_REGNUM))] + "" "srst\t%0,%1\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) @@ -1825,18 +1793,10 @@ ; movmemM instruction pattern(s). ; -(define_expand "movmemdi" - [(set (match_operand:BLK 0 "memory_operand" "") - (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:DI 2 "general_operand" "")) - (match_operand 3 "" "")] - "TARGET_64BIT" - "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;") - -(define_expand "movmemsi" +(define_expand "movmem" [(set (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" "")) - (use (match_operand:SI 2 "general_operand" "")) + (use (match_operand:GPR 2 "general_operand" "")) (match_operand 3 "" "")] "" "s390_expand_movmem (operands[0], operands[1], operands[2]); DONE;") @@ -1916,7 +1876,7 @@ (match_operand:BLK 1 "memory_operand" "")) (use (match_operand 2 "general_operand" "")) (use (match_dup 3)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" { enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; @@ -1941,28 +1901,15 @@ operands[3] = reg1; }) -(define_insn "*movmem_long_64" - [(clobber (match_operand:TI 0 "register_operand" "=d")) - (clobber (match_operand:TI 1 "register_operand" "=d")) - (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0))) - (use (match_dup 2)) - (use (match_dup 3)) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "mvcle\t%0,%1,0\;jo\t.-4" - [(set_attr "length" "8") - (set_attr "type" "vs")]) - -(define_insn "*movmem_long_31" - [(clobber (match_operand:DI 0 "register_operand" "=d")) - (clobber (match_operand:DI 1 "register_operand" "=d")) - (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0))) +(define_insn "*movmem_long" + [(clobber (match_operand: 0 "register_operand" "=d")) + (clobber (match_operand: 1 "register_operand" "=d")) + (set (mem:BLK (subreg:P (match_operand: 2 "register_operand" "0") 0)) + (mem:BLK (subreg:P (match_operand: 3 "register_operand" "1") 0))) (use (match_dup 2)) (use (match_dup 3)) - (clobber (reg:CC 33))] - "!TARGET_64BIT" + (clobber (reg:CC CC_REGNUM))] + "" "mvcle\t%0,%1,0\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) @@ -1971,18 +1918,10 @@ ; clrmemM instruction pattern(s). ; -(define_expand "clrmemdi" +(define_expand "clrmem" [(set (match_operand:BLK 0 "memory_operand" "") (const_int 0)) - (use (match_operand:DI 1 "general_operand" "")) - (match_operand 2 "" "")] - "TARGET_64BIT" - "s390_expand_clrmem (operands[0], operands[1]); DONE;") - -(define_expand "clrmemsi" - [(set (match_operand:BLK 0 "memory_operand" "") - (const_int 0)) - (use (match_operand:SI 1 "general_operand" "")) + (use (match_operand:GPR 1 "general_operand" "")) (match_operand 2 "" "")] "" "s390_expand_clrmem (operands[0], operands[1]); DONE;") @@ -1997,7 +1936,7 @@ (use (match_operand 1 "nonmemory_operand" "")) (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) (clobber (match_dup 2)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" "operands[2] = gen_rtx_SCRATCH (Pmode);") @@ -2007,7 +1946,7 @@ (use (match_operand 1 "nonmemory_operand" "n,a,a")) (use (match_operand 2 "immediate_operand" "X,R,X")) (clobber (match_scratch 3 "=X,X,&a")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "(GET_MODE (operands[1]) == Pmode || GET_MODE (operands[1]) == VOIDmode) && GET_MODE (operands[3]) == Pmode" "#" @@ -2019,12 +1958,12 @@ (use (match_operand 1 "const_int_operand" "")) (use (match_operand 2 "immediate_operand" "")) (clobber (scratch)) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (const_int 0)) (use (match_dup 1)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[1] = GEN_INT ((INTVAL (operands[1]) & 0xff) + 1);") (define_split @@ -2033,14 +1972,14 @@ (use (match_operand 1 "register_operand" "")) (use (match_operand 2 "memory_operand" "")) (clobber (scratch)) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(unspec [(match_dup 1) (match_dup 2) (const_int 0)] UNSPEC_EXECUTE) (set (match_dup 0) (const_int 0)) (use (const_int 1)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "") (define_split @@ -2049,7 +1988,7 @@ (use (match_operand 1 "register_operand" "")) (use (const:BLK (unspec:BLK [(const_int 0)] UNSPEC_INSN))) (clobber (match_operand 2 "register_operand" "")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed && TARGET_CPU_ZARCH" [(set (match_dup 2) (label_ref (match_dup 3))) (parallel @@ -2057,7 +1996,7 @@ (label_ref (match_dup 3))] UNSPEC_EXECUTE) (set (match_dup 0) (const_int 0)) (use (const_int 1)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[3] = gen_label_rtx ();") ; Clear a block of arbitrary length. @@ -2069,7 +2008,7 @@ (const_int 0)) (use (match_operand 1 "general_operand" "")) (use (match_dup 2)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" { enum machine_mode dword_mode = word_mode == DImode ? TImode : DImode; @@ -2089,26 +2028,14 @@ operands[2] = reg1; }) -(define_insn "*clrmem_long_64" - [(clobber (match_operand:TI 0 "register_operand" "=d")) - (set (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) - (const_int 0)) - (use (match_dup 2)) - (use (match_operand:TI 1 "register_operand" "d")) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "mvcle\t%0,%1,0\;jo\t.-4" - [(set_attr "length" "8") - (set_attr "type" "vs")]) - -(define_insn "*clrmem_long_31" - [(clobber (match_operand:DI 0 "register_operand" "=d")) - (set (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) +(define_insn "*clrmem_long" + [(clobber (match_operand: 0 "register_operand" "=d")) + (set (mem:BLK (subreg:P (match_operand: 2 "register_operand" "0") 0)) (const_int 0)) (use (match_dup 2)) - (use (match_operand:DI 1 "register_operand" "d")) - (clobber (reg:CC 33))] - "!TARGET_64BIT" + (use (match_operand: 1 "register_operand" "d")) + (clobber (reg:CC CC_REGNUM))] + "" "mvcle\t%0,%1,0\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) @@ -2132,7 +2059,7 @@ (define_expand "cmpmem_short" [(parallel - [(set (reg:CCU 33) + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "nonmemory_operand" "")) @@ -2142,7 +2069,7 @@ "operands[3] = gen_rtx_SCRATCH (Pmode);") (define_insn "*cmpmem_short" - [(set (reg:CCU 33) + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 0 "memory_operand" "Q,Q,Q") (match_operand:BLK 1 "memory_operand" "Q,Q,Q"))) (use (match_operand 2 "nonmemory_operand" "n,a,a")) @@ -2154,7 +2081,7 @@ [(set_attr "type" "cs")]) (define_split - [(set (reg:CCU 33) + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "const_int_operand" "")) @@ -2162,12 +2089,12 @@ (clobber (scratch))] "reload_completed" [(parallel - [(set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1))) + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) (use (match_dup 2))])] "operands[2] = GEN_INT ((INTVAL (operands[2]) & 0xff) + 1);") (define_split - [(set (reg:CCU 33) + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "register_operand" "")) @@ -2177,12 +2104,12 @@ [(parallel [(unspec [(match_dup 2) (match_dup 3) (const_int 0)] UNSPEC_EXECUTE) - (set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1))) + (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) (use (const_int 1))])] "") (define_split - [(set (reg:CCU 33) + [(set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "register_operand" "")) @@ -2193,7 +2120,7 @@ (parallel [(unspec [(match_dup 2) (mem:BLK (match_dup 3)) (label_ref (match_dup 4))] UNSPEC_EXECUTE) - (set (reg:CCU 33) (compare:CCU (match_dup 0) (match_dup 1))) + (set (reg:CCU CC_REGNUM) (compare:CCU (match_dup 0) (match_dup 1))) (use (const_int 1))])] "operands[4] = gen_label_rtx ();") @@ -2203,7 +2130,7 @@ [(parallel [(clobber (match_dup 2)) (clobber (match_dup 3)) - (set (reg:CCU 33) + (set (reg:CCU CC_REGNUM) (compare:CCU (match_operand:BLK 0 "memory_operand" "") (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "general_operand" "")) @@ -2232,28 +2159,15 @@ operands[3] = reg1; }) -(define_insn "*cmpmem_long_64" - [(clobber (match_operand:TI 0 "register_operand" "=d")) - (clobber (match_operand:TI 1 "register_operand" "=d")) - (set (reg:CCU 33) - (compare:CCU (mem:BLK (subreg:DI (match_operand:TI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:DI (match_operand:TI 3 "register_operand" "1") 0)))) - (use (match_dup 2)) - (use (match_dup 3))] - "TARGET_64BIT" - "clcle\t%0,%1,0\;jo\t.-4" - [(set_attr "length" "8") - (set_attr "type" "vs")]) - -(define_insn "*cmpmem_long_31" - [(clobber (match_operand:DI 0 "register_operand" "=d")) - (clobber (match_operand:DI 1 "register_operand" "=d")) - (set (reg:CCU 33) - (compare:CCU (mem:BLK (subreg:SI (match_operand:DI 2 "register_operand" "0") 0)) - (mem:BLK (subreg:SI (match_operand:DI 3 "register_operand" "1") 0)))) +(define_insn "*cmpmem_long" + [(clobber (match_operand: 0 "register_operand" "=d")) + (clobber (match_operand: 1 "register_operand" "=d")) + (set (reg:CCU CC_REGNUM) + (compare:CCU (mem:BLK (subreg:P (match_operand: 2 "register_operand" "0") 0)) + (mem:BLK (subreg:P (match_operand: 3 "register_operand" "1") 0)))) (use (match_dup 2)) (use (match_dup 3))] - "!TARGET_64BIT" + "" "clcle\t%0,%1,0\;jo\t.-4" [(set_attr "length" "8") (set_attr "type" "vs")]) @@ -2265,17 +2179,17 @@ [(set (match_operand:SI 0 "register_operand" "=d") (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] UNSPEC_CMPINT)) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "#" "reload_completed" [(set (match_dup 0) (ashift:SI (match_dup 0) (const_int 2))) (parallel [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 30))) - (clobber (reg:CC 33))])]) + (clobber (reg:CC CC_REGNUM))])]) (define_insn_and_split "*cmpint_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] UNSPEC_CMPINT) (const_int 0))) @@ -2298,17 +2212,17 @@ [(set (match_operand:DI 0 "register_operand" "=d") (sign_extend:DI (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] UNSPEC_CMPINT))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "#" "&& reload_completed" [(set (match_dup 0) (ashift:DI (match_dup 0) (const_int 34))) (parallel [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 62))) - (clobber (reg:CC 33))])]) + (clobber (reg:CC CC_REGNUM))])]) (define_insn_and_split "*cmpint_sign_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (ashift:DI (subreg:DI (unspec:SI [(match_operand:CCU 1 "register_operand" "0")] UNSPEC_CMPINT) 0) @@ -2334,30 +2248,21 @@ ;;- Conversion instructions. ;; -(define_insn "*sethighqisi" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (unspec:SI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] - "" - "@ - icm\t%0,8,%S1 - icmy\t%0,8,%S1" - [(set_attr "op_type" "RS,RSY")]) -(define_insn "*sethighhisi" +(define_insn "*sethighsi" [(set (match_operand:SI 0 "register_operand" "=d,d") - (unspec:SI [(match_operand:HI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] + (unspec:SI [(match_operand:HQI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) + (clobber (reg:CC CC_REGNUM))] "" "@ - icm\t%0,12,%S1 - icmy\t%0,12,%S1" + icm\t%0,,%S1 + icmy\t%0,,%S1" [(set_attr "op_type" "RS,RSY")]) (define_insn "*sethighqidi_64" [(set (match_operand:DI 0 "register_operand" "=d") (unspec:DI [(match_operand:QI 1 "s_operand" "QS")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "icmh\t%0,8,%S1" [(set_attr "op_type" "RSY")]) @@ -2365,7 +2270,7 @@ (define_insn "*sethighqidi_31" [(set (match_operand:DI 0 "register_operand" "=d,d") (unspec:DI [(match_operand:QI 1 "s_operand" "Q,S")] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "@ icm\t%0,8,%S1 @@ -2377,14 +2282,14 @@ (zero_extract:SI (match_operand:QI 1 "s_operand" "Q") (match_operand 2 "const_int_operand" "n") (const_int 0))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT && INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 8" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))] { operands[2] = GEN_INT (32 - INTVAL (operands[2])); @@ -2396,14 +2301,14 @@ (zero_extract:SI (match_operand:QI 1 "s_operand" "Q") (match_operand 2 "const_int_operand" "n") (const_int 0))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT && INTVAL (operands[2]) >= 8 && INTVAL (operands[2]) < 16" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (set (match_dup 0) (lshiftrt:SI (match_dup 0) (match_dup 2)))] { operands[2] = GEN_INT (32 - INTVAL (operands[2])); @@ -2441,27 +2346,29 @@ [(set_attr "op_type" "RRE,RXY")]) ; -; extendhidi2 instruction pattern(s). +; extend(hi|qi)di2 instruction pattern(s). ; -(define_expand "extendhidi2" +(define_expand "extenddi2" [(set (match_operand:DI 0 "register_operand" "") - (sign_extend:DI (match_operand:HI 1 "register_operand" "")))] + (sign_extend:DI (match_operand:HQI 1 "register_operand" "")))] "" " { if (!TARGET_64BIT) { rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_extendhisi2 (tmp, operands[1])); + emit_insn (gen_extendsi2 (tmp, operands[1])); emit_insn (gen_extendsidi2 (operands[0], tmp)); DONE; } else { + rtx bitcount = GEN_INT (GET_MODE_BITSIZE (DImode) - + GET_MODE_BITSIZE (mode)); operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48))); - emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (48))); + emit_insn (gen_ashldi3 (operands[0], operands[1], bitcount)); + emit_insn (gen_ashrdi3 (operands[0], operands[0], bitcount)); DONE; } } @@ -2474,33 +2381,6 @@ "lgh\t%0,%1" [(set_attr "op_type" "RXY")]) -; -; extendqidi2 instruction pattern(s). -; - -(define_expand "extendqidi2" - [(set (match_operand:DI 0 "register_operand" "") - (sign_extend:DI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - if (!TARGET_64BIT) - { - rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_extendqisi2 (tmp, operands[1])); - emit_insn (gen_extendsidi2 (operands[0], tmp)); - DONE; - } - else - { - operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56))); - emit_insn (gen_ashrdi3 (operands[0], operands[0], GEN_INT (56))); - DONE; - } -} -") - (define_insn "*extendqidi2" [(set (match_operand:DI 0 "register_operand" "=d") (sign_extend:DI (match_operand:QI 1 "memory_operand" "m")))] @@ -2511,31 +2391,33 @@ (define_insn_and_split "*extendqidi2_short_displ" [(set (match_operand:DI 0 "register_operand" "=d") (sign_extend:DI (match_operand:QI 1 "s_operand" "Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT && !TARGET_LONG_DISPLACEMENT" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (unspec:DI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_dup 0) (ashiftrt:DI (match_dup 0) (const_int 56))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "") ; -; extendhisi2 instruction pattern(s). +; extend(hi|qi)si2 instruction pattern(s). ; -(define_expand "extendhisi2" +(define_expand "extendsi2" [(set (match_operand:SI 0 "register_operand" "") - (sign_extend:SI (match_operand:HI 1 "register_operand" "")))] + (sign_extend:SI (match_operand:HQI 1 "register_operand" "")))] "" " { + rtx bitcount = GEN_INT (GET_MODE_BITSIZE(SImode) - + GET_MODE_BITSIZE(mode)); operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (16))); - emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (16))); + emit_insn (gen_ashlsi3 (operands[0], operands[1], bitcount)); + emit_insn (gen_ashrsi3 (operands[0], operands[0], bitcount)); DONE; } ") @@ -2549,23 +2431,6 @@ lhy\t%0,%1" [(set_attr "op_type" "RX,RXY")]) -; -; extendqisi2 instruction pattern(s). -; - -(define_expand "extendqisi2" - [(set (match_operand:SI 0 "register_operand" "") - (sign_extend:SI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_ashlsi3 (operands[0], operands[1], GEN_INT (24))); - emit_insn (gen_ashrsi3 (operands[0], operands[0], GEN_INT (24))); - DONE; -} -") - (define_insn "*extendqisi2" [(set (match_operand:SI 0 "register_operand" "=d") (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))] @@ -2576,16 +2441,16 @@ (define_insn_and_split "*extendqisi2_short_displ" [(set (match_operand:SI 0 "register_operand" "=d") (sign_extend:SI (match_operand:QI 1 "s_operand" "Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_LONG_DISPLACEMENT" "#" "&& reload_completed" [(parallel [(set (match_dup 0) (unspec:SI [(match_dup 1)] UNSPEC_SETHIGH)) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "") ; @@ -2623,37 +2488,39 @@ [(set_attr "op_type" "RRE,RXY")]) ; -; zero_extendhidi2 instruction pattern(s). +; zero_extend(hi|qi)di2 instruction pattern(s). ; -(define_expand "zero_extendhidi2" +(define_expand "zero_extenddi2" [(set (match_operand:DI 0 "register_operand" "") - (zero_extend:DI (match_operand:HI 1 "register_operand" "")))] + (zero_extend:DI (match_operand:HQI 1 "register_operand" "")))] "" " { if (!TARGET_64BIT) { rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_zero_extendhisi2 (tmp, operands[1])); + emit_insn (gen_zero_extendsi2 (tmp, operands[1])); emit_insn (gen_zero_extendsidi2 (operands[0], tmp)); DONE; } else { + rtx bitcount = GEN_INT (GET_MODE_BITSIZE(DImode) - + GET_MODE_BITSIZE(mode)); operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (48))); - emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (48))); + emit_insn (gen_ashldi3 (operands[0], operands[1], bitcount)); + emit_insn (gen_lshrdi3 (operands[0], operands[0], bitcount)); DONE; } } ") -(define_insn "*zero_extendhidi2" +(define_insn "*zero_extenddi2" [(set (match_operand:DI 0 "register_operand" "=d") - (zero_extend:DI (match_operand:HI 1 "memory_operand" "m")))] + (zero_extend:DI (match_operand:HQI 1 "memory_operand" "m")))] "TARGET_64BIT" - "llgh\t%0,%1" + "llg\t%0,%1" [(set_attr "op_type" "RXY")]) ; @@ -2672,7 +2539,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (and:DI (subreg:DI (match_operand:SI 1 "memory_operand" "m") 0) (const_int 2147483647))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "#" "&& reload_completed" @@ -2691,17 +2558,6 @@ llgt\t%0,%1" [(set_attr "op_type" "RRE,RXE")]) -(define_split - [(set (match_operand:SI 0 "register_operand" "") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "") - (const_int 2147483647))) - (clobber (reg:CC 33))] - "TARGET_64BIT && reload_completed" - [(set (match_dup 0) - (and:SI (match_dup 1) - (const_int 2147483647)))] - "") - (define_insn "*llgt_didi" [(set (match_operand:DI 0 "register_operand" "=d,d") (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o") @@ -2713,109 +2569,53 @@ [(set_attr "op_type" "RRE,RXE")]) (define_split - [(set (match_operand:DI 0 "register_operand" "") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "") - (const_int 2147483647))) - (clobber (reg:CC 33))] + [(set (match_operand:GPR 0 "register_operand" "") + (and:GPR (match_operand:GPR 1 "nonimmediate_operand" "") + (const_int 2147483647))) + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT && reload_completed" [(set (match_dup 0) - (and:DI (match_dup 1) - (const_int 2147483647)))] + (and:GPR (match_dup 1) + (const_int 2147483647)))] "") ; -; zero_extendqidi2 instruction pattern(s) -; - -(define_expand "zero_extendqidi2" - [(set (match_operand:DI 0 "register_operand" "") - (zero_extend:DI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - if (!TARGET_64BIT) - { - rtx tmp = gen_reg_rtx (SImode); - emit_insn (gen_zero_extendqisi2 (tmp, operands[1])); - emit_insn (gen_zero_extendsidi2 (operands[0], tmp)); - DONE; - } - else - { - operands[1] = gen_lowpart (DImode, operands[1]); - emit_insn (gen_ashldi3 (operands[0], operands[1], GEN_INT (56))); - emit_insn (gen_lshrdi3 (operands[0], operands[0], GEN_INT (56))); - DONE; - } -} -") - -(define_insn "*zero_extendqidi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (zero_extend:DI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_64BIT" - "llgc\t%0,%1" - [(set_attr "op_type" "RXY")]) - -; -; zero_extendhisi2 instruction pattern(s). +; zero_extend(hi|qi)si2 instruction pattern(s). ; -(define_expand "zero_extendhisi2" +(define_expand "zero_extendsi2" [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:HI 1 "register_operand" "")))] + (zero_extend:SI (match_operand:HQI 1 "register_operand" "")))] "" " { operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xffff))); + emit_insn (gen_andsi3 (operands[0], operands[1], + GEN_INT ((1 << GET_MODE_BITSIZE(mode)) - 1))); DONE; } ") -(define_insn "*zero_extendhisi2_64" +(define_insn "*zero_extendsi2_64" [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))] + (zero_extend:SI (match_operand:HQI 1 "memory_operand" "m")))] "TARGET_ZARCH" - "llgh\t%0,%1" + "llg\t%0,%1" [(set_attr "op_type" "RXY")]) (define_insn_and_split "*zero_extendhisi2_31" [(set (match_operand:SI 0 "register_operand" "=&d") (zero_extend:SI (match_operand:HI 1 "s_operand" "QS"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) (const_int 0)) (parallel [(set (strict_low_part (match_dup 2)) (match_dup 1)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[2] = gen_lowpart (HImode, operands[0]);") -; -; zero_extendqisi2 instruction pattern(s). -; - -(define_expand "zero_extendqisi2" - [(set (match_operand:SI 0 "register_operand" "") - (zero_extend:SI (match_operand:QI 1 "register_operand" "")))] - "" - " -{ - operands[1] = gen_lowpart (SImode, operands[1]); - emit_insn (gen_andsi3 (operands[0], operands[1], GEN_INT (0xff))); - DONE; -} -") - -(define_insn "*zero_extendqisi2_64" - [(set (match_operand:SI 0 "register_operand" "=d") - (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] - "TARGET_ZARCH" - "llgc\t%0,%1" - [(set_attr "op_type" "RXY")]) - (define_insn_and_split "*zero_extendqisi2_31" [(set (match_operand:SI 0 "register_operand" "=&d") (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))] @@ -2861,86 +2661,65 @@ ; -; fixuns_truncdfdi2 and fix_truncdfsi2 instruction pattern(s). +; fixuns_trunc(sf|df)(si|di)2 and fix_trunc(sf|df)(si|di)2 instruction pattern(s). ; -(define_expand "fixuns_truncdfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (unsigned_fix:DI (match_operand:DF 1 "register_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" +(define_expand "fixuns_trunc2" + [(set (match_operand:GPR 0 "register_operand" "") + (unsigned_fix:GPR (match_operand:FPR 1 "register_operand" "")))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" { rtx label1 = gen_label_rtx (); rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (DFmode); - operands[1] = force_reg (DFmode, operands[1]); - - emit_insn (gen_cmpdf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("9223372036854775808.0", DFmode), DFmode))); + rtx temp = gen_reg_rtx (mode); + REAL_VALUE_TYPE cmp, sub; + + operands[1] = force_reg (mode, operands[1]); + real_2expN (&cmp, GET_MODE_BITSIZE(mode) - 1); + real_2expN (&sub, GET_MODE_BITSIZE(mode)); + + emit_insn (gen_cmp (operands[1], + CONST_DOUBLE_FROM_REAL_VALUE (cmp, mode))); emit_jump_insn (gen_blt (label1)); - emit_insn (gen_subdf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("18446744073709551616.0", DFmode), DFmode))); - emit_insn (gen_fix_truncdfdi2_ieee (operands[0], temp, GEN_INT(7))); + emit_insn (gen_sub3 (temp, operands[1], + CONST_DOUBLE_FROM_REAL_VALUE (sub, mode))); + emit_insn (gen_fix_trunc2_ieee (operands[0], temp, + GEN_INT(7))); emit_jump (label2); emit_label (label1); - emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5))); + emit_insn (gen_fix_trunc2_ieee (operands[0], + operands[1], GEN_INT(5))); emit_label (label2); DONE; }) -(define_expand "fix_truncdfdi2" +(define_expand "fix_truncdi2" [(set (match_operand:DI 0 "register_operand" "") - (fix:DI (match_operand:DF 1 "nonimmediate_operand" "")))] + (fix:DI (match_operand:FPR 1 "nonimmediate_operand" "")))] "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" { - operands[1] = force_reg (DFmode, operands[1]); - emit_insn (gen_fix_truncdfdi2_ieee (operands[0], operands[1], GEN_INT(5))); + operands[1] = force_reg (mode, operands[1]); + emit_insn (gen_fix_truncdi2_ieee (operands[0], operands[1], + GEN_INT(5))); DONE; }) -(define_insn "fix_truncdfdi2_ieee" - [(set (match_operand:DI 0 "register_operand" "=d") - (fix:DI (match_operand:DF 1 "register_operand" "f"))) - (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cgdbr\t%0,%h2,%1" +(define_insn "fix_trunc2_ieee" + [(set (match_operand:GPR 0 "register_operand" "=d") + (fix:GPR (match_operand:FPR 1 "register_operand" "f"))) + (unspec:GPR [(match_operand:GPR 2 "immediate_operand" "K")] UNSPEC_ROUND) + (clobber (reg:CC CC_REGNUM))] + "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" + "cbr\t%0,%h2,%1" [(set_attr "op_type" "RRE") (set_attr "type" "ftoi")]) ; -; fixuns_truncdfsi2 and fix_truncdfsi2 instruction pattern(s). +; fix_truncdfsi2 instruction pattern(s). ; -(define_expand "fixuns_truncdfsi2" - [(set (match_operand:SI 0 "register_operand" "") - (unsigned_fix:SI (match_operand:DF 1 "register_operand" "")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - rtx label1 = gen_label_rtx (); - rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (DFmode); - - operands[1] = force_reg (DFmode,operands[1]); - emit_insn (gen_cmpdf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("2147483648.0", DFmode), DFmode))); - emit_jump_insn (gen_blt (label1)); - emit_insn (gen_subdf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("4294967296.0", DFmode), DFmode))); - emit_insn (gen_fix_truncdfsi2_ieee (operands[0], temp, GEN_INT (7))); - emit_jump (label2); - - emit_label (label1); - emit_insn (gen_fix_truncdfsi2_ieee (operands[0], operands[1], GEN_INT (5))); - emit_label (label2); - DONE; -}) - -(define_expand "fix_truncdfsi2" +(define_expand "fix_truncdfsi2" [(set (match_operand:SI 0 "register_operand" "") (fix:SI (match_operand:DF 1 "nonimmediate_operand" "")))] "TARGET_HARD_FLOAT" @@ -2966,23 +2745,13 @@ DONE; }) -(define_insn "fix_truncdfsi2_ieee" - [(set (match_operand:SI 0 "register_operand" "=d") - (fix:SI (match_operand:DF 1 "register_operand" "f"))) - (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cfdbr\t%0,%h2,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "ftoi")]) - (define_insn "fix_truncdfsi2_ibm" [(set (match_operand:SI 0 "register_operand" "=d") (fix:SI (match_operand:DF 1 "nonimmediate_operand" "+f"))) (use (match_operand:DI 2 "immediate_operand" "m")) (use (match_operand:DI 3 "immediate_operand" "m")) (use (match_operand:BLK 4 "memory_operand" "m")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" { output_asm_insn ("sd\t%1,%2", operands); @@ -2994,86 +2763,9 @@ [(set_attr "length" "20")]) ; -; fixuns_truncsfdi2 and fix_truncsfdi2 instruction pattern(s). -; - -(define_expand "fixuns_truncsfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (unsigned_fix:DI (match_operand:SF 1 "register_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - rtx label1 = gen_label_rtx (); - rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (SFmode); - - operands[1] = force_reg (SFmode, operands[1]); - emit_insn (gen_cmpsf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("9223372036854775808.0", SFmode), SFmode))); - emit_jump_insn (gen_blt (label1)); - - emit_insn (gen_subsf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("18446744073709551616.0", SFmode), SFmode))); - emit_insn (gen_fix_truncsfdi2_ieee (operands[0], temp, GEN_INT(7))); - emit_jump (label2); - - emit_label (label1); - emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5))); - emit_label (label2); - DONE; -}) - -(define_expand "fix_truncsfdi2" - [(set (match_operand:DI 0 "register_operand" "") - (fix:DI (match_operand:SF 1 "nonimmediate_operand" "")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - operands[1] = force_reg (SFmode, operands[1]); - emit_insn (gen_fix_truncsfdi2_ieee (operands[0], operands[1], GEN_INT(5))); - DONE; -}) - -(define_insn "fix_truncsfdi2_ieee" - [(set (match_operand:DI 0 "register_operand" "=d") - (fix:DI (match_operand:SF 1 "register_operand" "f"))) - (unspec:DI [(match_operand:DI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cgebr\t%0,%h2,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "ftoi")]) - -; -; fixuns_truncsfsi2 and fix_truncsfsi2 instruction pattern(s). +; fix_truncsfsi2 instruction pattern(s). ; -(define_expand "fixuns_truncsfsi2" - [(set (match_operand:SI 0 "register_operand" "") - (unsigned_fix:SI (match_operand:SF 1 "register_operand" "")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" -{ - rtx label1 = gen_label_rtx (); - rtx label2 = gen_label_rtx (); - rtx temp = gen_reg_rtx (SFmode); - - operands[1] = force_reg (SFmode, operands[1]); - emit_insn (gen_cmpsf (operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("2147483648.0", SFmode), SFmode))); - emit_jump_insn (gen_blt (label1)); - emit_insn (gen_subsf3 (temp, operands[1], - CONST_DOUBLE_FROM_REAL_VALUE ( - REAL_VALUE_ATOF ("4294967296.0", SFmode), SFmode))); - emit_insn (gen_fix_truncsfsi2_ieee (operands[0], temp, GEN_INT (7))); - emit_jump (label2); - - emit_label (label1); - emit_insn (gen_fix_truncsfsi2_ieee (operands[0], operands[1], GEN_INT (5))); - emit_label (label2); - DONE; -}) - (define_expand "fix_truncsfsi2" [(set (match_operand:SI 0 "register_operand" "") (fix:SI (match_operand:SF 1 "nonimmediate_operand" "")))] @@ -3095,37 +2787,15 @@ DONE; }) -(define_insn "fix_truncsfsi2_ieee" - [(set (match_operand:SI 0 "register_operand" "=d") - (fix:SI (match_operand:SF 1 "register_operand" "f"))) - (unspec:SI [(match_operand:SI 2 "immediate_operand" "K")] UNSPEC_ROUND) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cfebr\t%0,%h2,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "ftoi")]) - -; -; floatdidf2 instruction pattern(s). -; - -(define_insn "floatdidf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (float:DF (match_operand:DI 1 "register_operand" "d")))] - "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cdgbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "itof" )]) - ; -; floatdisf2 instruction pattern(s). +; floatdi(df|sf)2 instruction pattern(s). ; -(define_insn "floatdisf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (float:SF (match_operand:DI 1 "register_operand" "d")))] +(define_insn "floatdi2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (float:FPR (match_operand:DI 1 "register_operand" "d")))] "TARGET_64BIT && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "cegbr\t%0,%1" + "cgbr\t%0,%1" [(set_attr "op_type" "RRE") (set_attr "type" "itof" )]) @@ -3163,7 +2833,7 @@ (float:DF (match_operand:SI 1 "register_operand" "d"))) (use (match_operand:DI 2 "immediate_operand" "m")) (use (match_operand:BLK 3 "memory_operand" "m")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" { output_asm_insn ("st\t%1,%N3", operands); @@ -3226,7 +2896,7 @@ ler\t%0,%1 le\t%0,%1" [(set_attr "op_type" "RR,RX") - (set_attr "type" "floads,floads")]) + (set_attr "type" "floadsf")]) ; ; extendsfdf2 instruction pattern(s). @@ -3252,18 +2922,18 @@ ldebr\t%0,%1 ldeb\t%0,%1" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "floads,floads")]) + (set_attr "type" "floadsf")]) (define_insn "extendsfdf2_ibm" [(set (match_operand:DF 0 "register_operand" "=f,f") (float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "f,R"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ sdr\t%0,%0\;ler\t%0,%1 sdr\t%0,%0\;le\t%0,%1" [(set_attr "length" "4,6") - (set_attr "type" "floads,floads")]) + (set_attr "type" "floadsf")]) ;; @@ -3285,19 +2955,19 @@ [(set (match_operand:TI 0 "register_operand" "=&d") (plus:TI (match_operand:TI 1 "nonimmediate_operand" "%0") (match_operand:TI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "#" "&& reload_completed" [(parallel - [(set (reg:CCL1 33) + [(set (reg:CCL1 CC_REGNUM) (compare:CCL1 (plus:DI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (plus:DI (match_dup 7) (match_dup 8)))]) (parallel [(set (match_dup 3) (plus:DI (plus:DI (match_dup 4) (match_dup 5)) - (ltu:DI (reg:CCL1 33) (const_int 0)))) - (clobber (reg:CC 33))])] + (ltu:DI (reg:CCL1 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] "operands[3] = operand_subword (operands[0], 0, 0, TImode); operands[4] = operand_subword (operands[1], 0, 0, TImode); operands[5] = operand_subword (operands[2], 0, 0, TImode); @@ -3313,7 +2983,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (plus:DI (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ agfr\t%0,%2 @@ -3321,7 +2991,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_zero_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0")) (const_int 0))) @@ -3334,7 +3004,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_zero_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0")) (const_int 0))) @@ -3349,7 +3019,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (plus:DI (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")) (match_operand:DI 1 "register_operand" "0,0"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ algfr\t%0,%2 @@ -3357,7 +3027,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_imm_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "0") (match_operand:DI 2 "const_int_operand" "K")) (const_int 0))) @@ -3370,7 +3040,7 @@ [(set_attr "op_type" "RI")]) (define_insn "*adddi3_carry1_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (match_dup 1))) @@ -3383,7 +3053,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_carry1_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (match_dup 1))) @@ -3395,7 +3065,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_carry2_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (match_dup 2))) @@ -3408,7 +3078,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_carry2_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (match_dup 2))) @@ -3420,7 +3090,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -3433,7 +3103,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -3445,7 +3115,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*adddi3_cconly2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 1 "nonimmediate_operand" "%0,0") (neg:SI (match_operand:DI 2 "general_operand" "d,m")))) (clobber (match_scratch:DI 0 "=d,d"))] @@ -3459,7 +3129,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d,d") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0") (match_operand:DI 2 "general_operand" "d,K,m") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ agr\t%0,%2 @@ -3471,19 +3141,19 @@ [(set (match_operand:DI 0 "register_operand" "=&d") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT && TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel - [(set (reg:CCL1 33) + [(set (reg:CCL1 CC_REGNUM) (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))]) (parallel [(set (match_dup 3) (plus:SI (plus:SI (match_dup 4) (match_dup 5)) - (ltu:SI (reg:CCL1 33) (const_int 0)))) - (clobber (reg:CC 33))])] + (ltu:SI (reg:CCL1 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); operands[5] = operand_subword (operands[2], 0, 0, DImode); @@ -3495,25 +3165,25 @@ [(set (match_operand:DI 0 "register_operand" "=&d") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel [(set (match_dup 3) (plus:SI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (reg:CCL1 33) + [(set (reg:CCL1 CC_REGNUM) (compare:CCL1 (plus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (plus:SI (match_dup 7) (match_dup 8)))]) (set (pc) - (if_then_else (ltu (reg:CCL1 33) (const_int 0)) + (if_then_else (ltu (reg:CCL1 CC_REGNUM) (const_int 0)) (pc) (label_ref (match_dup 9)))) (parallel [(set (match_dup 3) (plus:SI (match_dup 3) (const_int 1))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (match_dup 9)] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); @@ -3528,7 +3198,7 @@ [(set (match_operand:DI 0 "register_operand" "") (plus:DI (match_operand:DI 1 "nonimmediate_operand" "") (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" "") @@ -3537,7 +3207,7 @@ ; (define_insn "*addsi3_imm_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "0") (match_operand:SI 2 "const_int_operand" "K")) (const_int 0))) @@ -3549,7 +3219,7 @@ [(set_attr "op_type" "RI")]) (define_insn "*addsi3_carry1_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (match_dup 1))) @@ -3563,7 +3233,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*addsi3_carry1_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (match_dup 1))) @@ -3576,7 +3246,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*addsi3_carry2_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (match_dup 2))) @@ -3590,7 +3260,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*addsi3_carry2_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (match_dup 2))) @@ -3603,7 +3273,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*addsi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -3617,7 +3287,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*addsi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -3630,7 +3300,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*addsi3_cconly2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (neg:SI (match_operand:SI 2 "general_operand" "d,R,T")))) (clobber (match_scratch:SI 0 "=d,d,d"))] @@ -3645,7 +3315,7 @@ [(set (match_operand:SI 0 "register_operand" "=d,d") (plus:SI (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")) (match_operand:SI 1 "register_operand" "0,0"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "@ ah\t%0,%2 @@ -3656,7 +3326,7 @@ [(set (match_operand:SI 0 "register_operand" "=d,d,d,d") (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:SI 2 "general_operand" "d,K,R,T"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "@ ar\t%0,%2 @@ -3666,132 +3336,68 @@ [(set_attr "op_type" "RR,RI,RX,RXY")]) ; -; adddf3 instruction pattern(s). -; - -(define_expand "adddf3" - [(parallel - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*adddf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - adbr\t%0,%2 - adb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) - -(define_insn "*adddf3_cc" - [(set (reg 33) - (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - adbr\t%0,%2 - adb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) - -(define_insn "*adddf3_cconly" - [(set (reg 33) - (compare (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f,f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - adbr\t%0,%2 - adb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) - -(define_insn "*adddf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - adr\t%0,%2 - ad\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimpd,fsimpd")]) - -; -; addsf3 instruction pattern(s). +; add(df|sf)3 instruction pattern(s). ; -(define_expand "addsf3" +(define_expand "add3" [(parallel - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*addsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +(define_insn "*add3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - aebr\t%0,%2 - aeb\t%0,%2" + abr\t%0,%2 + ab\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*addsf3_cc" - [(set (reg 33) - (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_dup 1) (match_dup 2)))] + (set_attr "type" "fsimp")]) + +(define_insn "*add3_cc" + [(set (reg CC_REGNUM) + (compare (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R")) + (match_operand:FPR 3 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_dup 1) (match_dup 2)))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - aebr\t%0,%2 - aeb\t%0,%2" + abr\t%0,%2 + ab\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*addsf3_cconly" - [(set (reg 33) - (compare (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f,f"))] + (set_attr "type" "fsimp")]) + +(define_insn "*add3_cconly" + [(set (reg CC_REGNUM) + (compare (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R")) + (match_operand:FPR 3 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f,f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - aebr\t%0,%2 - aeb\t%0,%2" + abr\t%0,%2 + ab\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*addsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +(define_insn "*add3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - aer\t%0,%2 - ae\t%0,%2" + ar\t%0,%2 + a\t%0,%2" [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimps,fsimps")]) + (set_attr "type" "fsimp")]) ;; @@ -3806,19 +3412,19 @@ [(set (match_operand:TI 0 "register_operand" "=&d") (minus:TI (match_operand:TI 1 "register_operand" "0") (match_operand:TI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "#" "&& reload_completed" [(parallel - [(set (reg:CCL2 33) + [(set (reg:CCL2 CC_REGNUM) (compare:CCL2 (minus:DI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (minus:DI (match_dup 7) (match_dup 8)))]) (parallel [(set (match_dup 3) (minus:DI (minus:DI (match_dup 4) (match_dup 5)) - (gtu:DI (reg:CCL2 33) (const_int 0)))) - (clobber (reg:CC 33))])] + (gtu:DI (reg:CCL2 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] "operands[3] = operand_subword (operands[0], 0, 0, TImode); operands[4] = operand_subword (operands[1], 0, 0, TImode); operands[5] = operand_subword (operands[2], 0, 0, TImode); @@ -3834,7 +3440,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (minus:DI (match_operand:DI 1 "register_operand" "0,0") (sign_extend:DI (match_operand:SI 2 "general_operand" "d,m")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ sgfr\t%0,%2 @@ -3842,7 +3448,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_zero_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))) (const_int 0))) @@ -3855,7 +3461,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_zero_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m"))) (const_int 0))) @@ -3870,7 +3476,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (minus:DI (match_operand:DI 1 "register_operand" "0,0") (zero_extend:DI (match_operand:SI 2 "general_operand" "d,m")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ slgfr\t%0,%2 @@ -3878,7 +3484,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_borrow_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m")) (match_dup 1))) @@ -3891,7 +3497,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_borrow_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m")) (match_dup 1))) @@ -3903,7 +3509,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -3916,7 +3522,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_cc2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m"))) (set (match_operand:DI 0 "register_operand" "=d,d") @@ -3928,7 +3534,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:DI (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -3940,7 +3546,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*subdi3_cconly2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m"))) (clobber (match_scratch:DI 0 "=d,d"))] @@ -3954,7 +3560,7 @@ [(set (match_operand:DI 0 "register_operand" "=d,d") (minus:DI (match_operand:DI 1 "register_operand" "0,0") (match_operand:DI 2 "general_operand" "d,m") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "@ sgr\t%0,%2 @@ -3965,19 +3571,19 @@ [(set (match_operand:DI 0 "register_operand" "=&d") (minus:DI (match_operand:DI 1 "register_operand" "0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT && TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel - [(set (reg:CCL2 33) + [(set (reg:CCL2 CC_REGNUM) (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))]) (parallel [(set (match_dup 3) (minus:SI (minus:SI (match_dup 4) (match_dup 5)) - (gtu:SI (reg:CCL2 33) (const_int 0)))) - (clobber (reg:CC 33))])] + (gtu:SI (reg:CCL2 CC_REGNUM) (const_int 0)))) + (clobber (reg:CC CC_REGNUM))])] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); operands[5] = operand_subword (operands[2], 0, 0, DImode); @@ -3989,25 +3595,25 @@ [(set (match_operand:DI 0 "register_operand" "=&d") (minus:DI (match_operand:DI 1 "register_operand" "0") (match_operand:DI 2 "general_operand" "do") ) ) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_CPU_ZARCH" "#" "&& reload_completed" [(parallel [(set (match_dup 3) (minus:SI (match_dup 4) (match_dup 5))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (reg:CCL2 33) + [(set (reg:CCL2 CC_REGNUM) (compare:CCL2 (minus:SI (match_dup 7) (match_dup 8)) (match_dup 7))) (set (match_dup 6) (minus:SI (match_dup 7) (match_dup 8)))]) (set (pc) - (if_then_else (gtu (reg:CCL2 33) (const_int 0)) + (if_then_else (gtu (reg:CCL2 CC_REGNUM) (const_int 0)) (pc) (label_ref (match_dup 9)))) (parallel [(set (match_dup 3) (plus:SI (match_dup 3) (const_int -1))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (match_dup 9)] "operands[3] = operand_subword (operands[0], 0, 0, DImode); operands[4] = operand_subword (operands[1], 0, 0, DImode); @@ -4022,7 +3628,7 @@ [(set (match_operand:DI 0 "register_operand" "") (minus:DI (match_operand:DI 1 "register_operand" "") (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" "") @@ -4031,7 +3637,7 @@ ; (define_insn "*subsi3_borrow_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (match_dup 1))) @@ -4045,7 +3651,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*subsi3_borrow_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (match_dup 1))) @@ -4058,7 +3664,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*subsi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -4072,7 +3678,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*subsi3_cc2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T"))) (set (match_operand:SI 0 "register_operand" "=d,d,d") @@ -4085,7 +3691,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*subsi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -4098,7 +3704,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*subsi3_cconly2" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T"))) (clobber (match_scratch:SI 0 "=d,d,d"))] @@ -4113,7 +3719,7 @@ [(set (match_operand:SI 0 "register_operand" "=d,d") (minus:SI (match_operand:SI 1 "register_operand" "0,0") (sign_extend:SI (match_operand:HI 2 "memory_operand" "R,T")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "@ sh\t%0,%2 @@ -4124,7 +3730,7 @@ [(set (match_operand:SI 0 "register_operand" "=d,d,d") (minus:SI (match_operand:SI 1 "register_operand" "0,0,0") (match_operand:SI 2 "general_operand" "d,R,T"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "@ sr\t%0,%2 @@ -4134,132 +3740,68 @@ ; -; subdf3 instruction pattern(s). -; - -(define_expand "subdf3" - [(parallel - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*subdf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sdbr\t%0,%2 - sdb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) - -(define_insn "*subdf3_cc" - [(set (reg 33) - (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_dup 1) (match_dup 2)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sdbr\t%0,%2 - sdb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) - -(define_insn "*subdf3_cconly" - [(set (reg 33) - (compare (minus:DF (match_operand:DF 1 "nonimmediate_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")) - (match_operand:DF 3 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f,f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sdbr\t%0,%2 - sdb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimpd,fsimpd")]) - -(define_insn "*subdf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - sdr\t%0,%2 - sd\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimpd,fsimpd")]) - -; -; subsf3 instruction pattern(s). +; sub(df|sf)3 instruction pattern(s). ; -(define_expand "subsf3" +(define_expand "sub3" [(parallel - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*subsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +(define_insn "*sub3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sebr\t%0,%2 - seb\t%0,%2" + sbr\t%0,%2 + sb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*subsf3_cc" - [(set (reg 33) - (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_dup 1) (match_dup 2)))] + (set_attr "type" "fsimp")]) + +(define_insn "*sub3_cc" + [(set (reg CC_REGNUM) + (compare (minus:FPR (match_operand:FPR 1 "nonimmediate_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R")) + (match_operand:FPR 3 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_dup 1) (match_dup 2)))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sebr\t%0,%2 - seb\t%0,%2" + sbr\t%0,%2 + sb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) - -(define_insn "*subsf3_cconly" - [(set (reg 33) - (compare (minus:SF (match_operand:SF 1 "nonimmediate_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")) - (match_operand:SF 3 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f,f"))] + (set_attr "type" "fsimp")]) + +(define_insn "*sub3_cconly" + [(set (reg CC_REGNUM) + (compare (minus:FPR (match_operand:FPR 1 "nonimmediate_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R")) + (match_operand:FPR 3 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f,f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sebr\t%0,%2 - seb\t%0,%2" + sbr\t%0,%2 + sb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsimps,fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*subsf3_ibm" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R"))) - (clobber (reg:CC 33))] +(define_insn "*sub3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - ser\t%0,%2 - se\t%0,%2" + sr\t%0,%2 + s\t%0,%2" [(set_attr "op_type" "RR,RX") - (set_attr "type" "fsimps,fsimps")]) + (set_attr "type" "fsimp")]) ;; @@ -4267,137 +3809,68 @@ ;; ; -; adddicc instruction pattern(s). -; - -(define_insn "*adddi3_alc_cc" - [(set (reg 33) - (compare - (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_alc_comparison" "")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (plus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" - "@ - alcgr\t%0,%2 - alcg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*adddi3_alc" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (plus:DI (plus:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_alc_comparison" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "@ - alcgr\t%0,%2 - alcg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*subdi3_slb_cc" - [(set (reg 33) - (compare - (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_slb_comparison" "")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (minus:DI (match_dup 1) (match_dup 2)) (match_dup 3)))] - "s390_match_ccmode (insn, CCLmode) && TARGET_64BIT" - "@ - slbgr\t%0,%2 - slbg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_insn "*subdi3_slb" - [(set (match_operand:DI 0 "register_operand" "=d,d") - (minus:DI (minus:DI (match_operand:DI 1 "nonimmediate_operand" "0,0") - (match_operand:DI 2 "general_operand" "d,m")) - (match_operand:DI 3 "s390_slb_comparison" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "@ - slbgr\t%0,%2 - slbg\t%0,%2" - [(set_attr "op_type" "RRE,RXY")]) - -(define_expand "adddicc" - [(match_operand:DI 0 "register_operand" "") - (match_operand 1 "comparison_operator" "") - (match_operand:DI 2 "register_operand" "") - (match_operand:DI 3 "const_int_operand" "")] - "TARGET_64BIT" - "if (!s390_expand_addcc (GET_CODE (operands[1]), - s390_compare_op0, s390_compare_op1, - operands[0], operands[2], - operands[3])) FAIL; DONE;") - -; -; addsicc instruction pattern(s). +; add(di|si)cc instruction pattern(s). ; -(define_insn "*addsi3_alc_cc" - [(set (reg 33) +(define_insn "*add3_alc_cc" + [(set (reg CC_REGNUM) (compare - (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_alc_comparison" "")) + (plus:GPR (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_alc_comparison" "")) (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d") - (plus:SI (plus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] + (set (match_operand:GPR 0 "register_operand" "=d,d") + (plus:GPR (plus:GPR (match_dup 1) (match_dup 2)) (match_dup 3)))] "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" "@ - alcr\t%0,%2 - alc\t%0,%2" + alcr\t%0,%2 + alc\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*addsi3_alc" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (plus:SI (plus:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_alc_comparison" ""))) - (clobber (reg:CC 33))] +(define_insn "*add3_alc" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (plus:GPR (plus:GPR (match_operand:GPR 1 "nonimmediate_operand" "%0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_alc_comparison" ""))) + (clobber (reg:CC CC_REGNUM))] "TARGET_CPU_ZARCH" "@ - alcr\t%0,%2 - alc\t%0,%2" + alcr\t%0,%2 + alc\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*subsi3_slb_cc" - [(set (reg 33) +(define_insn "*sub3_slb_cc" + [(set (reg CC_REGNUM) (compare - (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_slb_comparison" "")) + (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_slb_comparison" "")) (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d,d") - (minus:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 3)))] + (set (match_operand:GPR 0 "register_operand" "=d,d") + (minus:GPR (minus:GPR (match_dup 1) (match_dup 2)) (match_dup 3)))] "s390_match_ccmode (insn, CCLmode) && TARGET_CPU_ZARCH" "@ - slbr\t%0,%2 - slb\t%0,%2" + slbr\t%0,%2 + slb\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_insn "*subsi3_slb" - [(set (match_operand:SI 0 "register_operand" "=d,d") - (minus:SI (minus:SI (match_operand:SI 1 "nonimmediate_operand" "0,0") - (match_operand:SI 2 "general_operand" "d,m")) - (match_operand:SI 3 "s390_slb_comparison" ""))) - (clobber (reg:CC 33))] +(define_insn "*sub3_slb" + [(set (match_operand:GPR 0 "register_operand" "=d,d") + (minus:GPR (minus:GPR (match_operand:GPR 1 "nonimmediate_operand" "0,0") + (match_operand:GPR 2 "general_operand" "d,m")) + (match_operand:GPR 3 "s390_slb_comparison" ""))) + (clobber (reg:CC CC_REGNUM))] "TARGET_CPU_ZARCH" "@ - slbr\t%0,%2 - slb\t%0,%2" + slbr\t%0,%2 + slb\t%0,%2" [(set_attr "op_type" "RRE,RXY")]) -(define_expand "addsicc" - [(match_operand:SI 0 "register_operand" "") +(define_expand "addcc" + [(match_operand:GPR 0 "register_operand" "") (match_operand 1 "comparison_operator" "") - (match_operand:SI 2 "register_operand" "") - (match_operand:SI 3 "const_int_operand" "")] + (match_operand:GPR 2 "register_operand" "") + (match_operand:GPR 3 "const_int_operand" "")] "TARGET_CPU_ZARCH" "if (!s390_expand_addcc (GET_CODE (operands[1]), s390_compare_op0, s390_compare_op1, @@ -4408,90 +3881,44 @@ ; scond instruction pattern(s). ; -(define_insn_and_split "*sconddi" - [(set (match_operand:DI 0 "register_operand" "=&d") - (match_operand:DI 1 "s390_alc_comparison" "")) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "#" - "&& reload_completed" - [(set (match_dup 0) (const_int 0)) - (parallel - [(set (match_dup 0) (plus:DI (plus:DI (match_dup 0) (match_dup 0)) - (match_dup 1))) - (clobber (reg:CC 33))])] - "") - -(define_insn_and_split "*scondsi" - [(set (match_operand:SI 0 "register_operand" "=&d") - (match_operand:SI 1 "s390_alc_comparison" "")) - (clobber (reg:CC 33))] +(define_insn_and_split "*scond" + [(set (match_operand:GPR 0 "register_operand" "=&d") + (match_operand:GPR 1 "s390_alc_comparison" "")) + (clobber (reg:CC CC_REGNUM))] "TARGET_CPU_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) (const_int 0)) (parallel - [(set (match_dup 0) (plus:SI (plus:SI (match_dup 0) (match_dup 0)) - (match_dup 1))) - (clobber (reg:CC 33))])] - "") - -(define_insn_and_split "*sconddi_neg" - [(set (match_operand:DI 0 "register_operand" "=&d") - (match_operand:DI 1 "s390_slb_comparison" "")) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "#" - "&& reload_completed" - [(set (match_dup 0) (const_int 0)) - (parallel - [(set (match_dup 0) (minus:DI (minus:DI (match_dup 0) (match_dup 0)) + [(set (match_dup 0) (plus:GPR (plus:GPR (match_dup 0) (match_dup 0)) (match_dup 1))) - (clobber (reg:CC 33))]) - (parallel - [(set (match_dup 0) (neg:DI (match_dup 0))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "") -(define_insn_and_split "*scondsi_neg" - [(set (match_operand:SI 0 "register_operand" "=&d") - (match_operand:SI 1 "s390_slb_comparison" "")) - (clobber (reg:CC 33))] +(define_insn_and_split "*scond_neg" + [(set (match_operand:GPR 0 "register_operand" "=&d") + (match_operand:GPR 1 "s390_slb_comparison" "")) + (clobber (reg:CC CC_REGNUM))] "TARGET_CPU_ZARCH" "#" "&& reload_completed" [(set (match_dup 0) (const_int 0)) (parallel - [(set (match_dup 0) (minus:SI (minus:SI (match_dup 0) (match_dup 0)) - (match_dup 1))) - (clobber (reg:CC 33))]) + [(set (match_dup 0) (minus:GPR (minus:GPR (match_dup 0) (match_dup 0)) + (match_dup 1))) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (match_dup 0) (neg:SI (match_dup 0))) - (clobber (reg:CC 33))])] + [(set (match_dup 0) (neg:GPR (match_dup 0))) + (clobber (reg:CC CC_REGNUM))])] "") -(define_expand "sltu" - [(match_operand:SI 0 "register_operand" "")] - "TARGET_CPU_ZARCH" - "if (!s390_expand_addcc (LTU, s390_compare_op0, s390_compare_op1, - operands[0], const0_rtx, const1_rtx)) FAIL; DONE;") - -(define_expand "sgtu" - [(match_operand:SI 0 "register_operand" "")] - "TARGET_CPU_ZARCH" - "if (!s390_expand_addcc (GTU, s390_compare_op0, s390_compare_op1, - operands[0], const0_rtx, const1_rtx)) FAIL; DONE;") - -(define_expand "sleu" - [(match_operand:SI 0 "register_operand" "")] - "TARGET_CPU_ZARCH" - "if (!s390_expand_addcc (LEU, s390_compare_op0, s390_compare_op1, - operands[0], const0_rtx, const1_rtx)) FAIL; DONE;") -(define_expand "sgeu" - [(match_operand:SI 0 "register_operand" "")] +(define_expand "s" + [(set (match_operand:SI 0 "register_operand" "") + (SCOND (match_dup 0) + (match_dup 0)))] "TARGET_CPU_ZARCH" - "if (!s390_expand_addcc (GEU, s390_compare_op0, s390_compare_op1, + "if (!s390_expand_addcc (, s390_compare_op0, s390_compare_op1, operands[0], const0_rtx, const1_rtx)) FAIL; DONE;") @@ -4512,7 +3939,7 @@ msgfr\t%0,%2 msgf\t%0,%2" [(set_attr "op_type" "RRE,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imuldi")]) (define_insn "muldi3" [(set (match_operand:DI 0 "register_operand" "=d,d,d") @@ -4524,7 +3951,7 @@ mghi\t%0,%h2 msg\t%0,%2" [(set_attr "op_type" "RRE,RI,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imuldi")]) ; ; mulsi3 instruction pattern(s). @@ -4537,7 +3964,7 @@ "" "mh\t%0,%2" [(set_attr "op_type" "RX") - (set_attr "type" "imul")]) + (set_attr "type" "imulhi")]) (define_insn "mulsi3" [(set (match_operand:SI 0 "register_operand" "=d,d,d,d") @@ -4550,7 +3977,7 @@ ms\t%0,%2 msy\t%0,%2" [(set_attr "op_type" "RRE,RI,RX,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imulsi,imulhi,imulsi,imulsi")]) ; ; mulsidi3 instruction pattern(s). @@ -4567,7 +3994,7 @@ mr\t%0,%2 m\t%0,%2" [(set_attr "op_type" "RR,RX") - (set_attr "type" "imul")]) + (set_attr "type" "imulsi")]) ; ; umulsidi3 instruction pattern(s). @@ -4584,121 +4011,64 @@ mlr\t%0,%2 ml\t%0,%2" [(set_attr "op_type" "RRE,RXY") - (set_attr "type" "imul")]) + (set_attr "type" "imulsi")]) ; -; muldf3 instruction pattern(s). +; mul(df|sf)3 instruction pattern(s). ; -(define_expand "muldf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*muldf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - mdbr\t%0,%2 - mdb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuld")]) - -(define_insn "*muldf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (mult:DF (match_operand:DF 1 "nonimmediate_operand" "%0,0") - (match_operand:DF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - mdr\t%0,%2 - md\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fmuld")]) - -(define_insn "*fmadddf" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (plus:DF (mult:DF (match_operand:DF 1 "register_operand" "%f,f") - (match_operand:DF 2 "nonimmediate_operand" "f,R")) - (match_operand:DF 3 "register_operand" "0,0")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" - "@ - madbr\t%0,%1,%2 - madb\t%0,%1,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuld")]) - -(define_insn "*fmsubdf" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (minus:DF (mult:DF (match_operand:DF 1 "register_operand" "f,f") - (match_operand:DF 2 "nonimmediate_operand" "f,R")) - (match_operand:DF 3 "register_operand" "0,0")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" - "@ - msdbr\t%0,%1,%2 - msdb\t%0,%1,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuld")]) - -; -; mulsf3 instruction pattern(s). -; - -(define_expand "mulsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")))] +(define_expand "mul3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (mult:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R")))] "TARGET_HARD_FLOAT" "") -(define_insn "*mulsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")))] +(define_insn "*mul3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (mult:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - meebr\t%0,%2 - meeb\t%0,%2" + mbr\t%0,%2 + mb\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuls")]) + (set_attr "type" "fmul")]) -(define_insn "*mulsf3_ibm" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (mult:SF (match_operand:SF 1 "nonimmediate_operand" "%0,0") - (match_operand:SF 2 "general_operand" "f,R")))] +(define_insn "*mul3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (mult:FPR (match_operand:FPR 1 "nonimmediate_operand" "%0,0") + (match_operand:FPR 2 "general_operand" "f,R")))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - mer\t%0,%2 - me\t%0,%2" + mr\t%0,%2 + m\t%0,%2" [(set_attr "op_type" "RR,RX") - (set_attr "type" "fmuls")]) + (set_attr "type" "fmul")]) -(define_insn "*fmaddsf" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f,f") - (match_operand:SF 2 "nonimmediate_operand" "f,R")) - (match_operand:SF 3 "register_operand" "0,0")))] +(define_insn "*fmadd" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (plus:FPR (mult:FPR (match_operand:FPR 1 "register_operand" "%f,f") + (match_operand:FPR 2 "nonimmediate_operand" "f,R")) + (match_operand:FPR 3 "register_operand" "0,0")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" "@ - maebr\t%0,%1,%2 - maeb\t%0,%1,%2" + mabr\t%0,%1,%2 + mab\t%0,%1,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuls")]) + (set_attr "type" "fmul")]) -(define_insn "*fmsubsf" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (minus:SF (mult:SF (match_operand:SF 1 "register_operand" "f,f") - (match_operand:SF 2 "nonimmediate_operand" "f,R")) - (match_operand:SF 3 "register_operand" "0,0")))] +(define_insn "*fmsub" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (minus:FPR (mult:FPR (match_operand:FPR 1 "register_operand" "f,f") + (match_operand:FPR 2 "nonimmediate_operand" "f,R")) + (match_operand:FPR 3 "register_operand" "0,0")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT && TARGET_FUSED_MADD" "@ - msebr\t%0,%1,%2 - mseb\t%0,%1,%2" + msbr\t%0,%1,%2 + msb\t%0,%1,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fmuls")]) + (set_attr "type" "fmul")]) ;; ;;- Divide and modulo instructions. @@ -5137,82 +4507,57 @@ }) ; -; divdf3 instruction pattern(s). +; div(df|sf)3 instruction pattern(s). ; -(define_expand "divdf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (div:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*divdf3" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (div:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - ddbr\t%0,%2 - ddb\t%0,%2" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fdivd")]) - -(define_insn "*divdf3_ibm" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (div:DF (match_operand:DF 1 "register_operand" "0,0") - (match_operand:DF 2 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "@ - ddr\t%0,%2 - dd\t%0,%2" - [(set_attr "op_type" "RR,RX") - (set_attr "type" "fdivd")]) - -; -; divsf3 instruction pattern(s). -; - -(define_expand "divsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (div:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")))] +(define_expand "div3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (div:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R")))] "TARGET_HARD_FLOAT" "") -(define_insn "*divsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (div:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")))] +(define_insn "*div3" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (div:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - debr\t%0,%2 - deb\t%0,%2" + dbr\t%0,%2 + db\t%0,%2" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fdivs")]) + (set_attr "type" "fdiv")]) -(define_insn "*divsf3" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (div:SF (match_operand:SF 1 "register_operand" "0,0") - (match_operand:SF 2 "general_operand" "f,R")))] +(define_insn "*div3_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (div:FPR (match_operand:FPR 1 "register_operand" "0,0") + (match_operand:FPR 2 "general_operand" "f,R")))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" "@ - der\t%0,%2 - de\t%0,%2" + dr\t%0,%2 + d\t%0,%2" [(set_attr "op_type" "RR,RX") - (set_attr "type" "fdivs")]) + (set_attr "type" "fdiv")]) ;; ;;- And instructions. ;; +(define_expand "and3" + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (and:INT (match_operand:INT 1 "nonimmediate_operand" "") + (match_operand:INT 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "" + "s390_expand_logical_operator (AND, mode, operands); DONE;") + ; ; anddi3 instruction pattern(s). ; (define_insn "*anddi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5225,7 +4570,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*anddi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5244,7 +4589,7 @@ "%d,o,0,0,0,0,0,0,0,0") (match_operand:DI 2 "general_operand" "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m,NxQDF,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT && s390_logical_operator_ok_p (operands)" "@ # @@ -5262,27 +4607,20 @@ (define_split [(set (match_operand:DI 0 "s_operand" "") (and:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") -(define_expand "anddi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (and:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "s390_expand_logical_operator (AND, DImode, operands); DONE;") ; ; andsi3 instruction pattern(s). ; (define_insn "*andsi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -5296,7 +4634,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*andsi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -5316,7 +4654,7 @@ "%d,o,0,0,0,0,0,0,0") (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T,NxQSF,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ # @@ -5334,7 +4672,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q") (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:SI 2 "general_operand" "d,R,NxQSF,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 @@ -5346,21 +4684,13 @@ (define_split [(set (match_operand:SI 0 "s_operand" "") (and:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") -(define_expand "andsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (and:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (AND, SImode, operands); DONE;") - ; ; andhi3 instruction pattern(s). ; @@ -5369,7 +4699,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q") (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:HI 2 "general_operand" "d,n,NxQHF,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 @@ -5382,7 +4712,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") (and:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") (match_operand:HI 2 "general_operand" "d,NxQHF,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 @@ -5393,21 +4723,13 @@ (define_split [(set (match_operand:HI 0 "s_operand" "") (and:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (and:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);") -(define_expand "andhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (and:HI (match_operand:HI 1 "nonimmediate_operand" "") - (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (AND, HImode, operands); DONE;") - ; ; andqi3 instruction pattern(s). ; @@ -5416,7 +4738,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q") (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0") (match_operand:QI 2 "general_operand" "d,n,n,n,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 @@ -5430,7 +4752,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q") (and:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "d,n,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ nr\t%0,%2 @@ -5438,14 +4760,6 @@ #" [(set_attr "op_type" "RR,SI,SS")]) -(define_expand "andqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (and:QI (match_operand:QI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (AND, QImode, operands); DONE;") - ; ; Block and (NC) patterns. ; @@ -5455,7 +4769,7 @@ (and:BLK (match_dup 0) (match_operand:BLK 1 "memory_operand" "Q"))) (use (match_operand 2 "const_int_operand" "n")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" "nc\t%O0(%2,%R0),%S1" [(set_attr "op_type" "SS")]) @@ -5464,14 +4778,14 @@ [(set (match_operand 0 "memory_operand" "") (and (match_dup 0) (match_operand 1 "memory_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed && GET_MODE (operands[0]) == GET_MODE (operands[1]) && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" [(parallel [(set (match_dup 0) (and:BLK (match_dup 0) (match_dup 1))) (use (match_dup 2)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] { operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); operands[0] = adjust_address (operands[0], BLKmode, 0); @@ -5484,20 +4798,20 @@ (and:BLK (match_dup 0) (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "const_int_operand" "")) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_operand:BLK 3 "memory_operand" "") (and:BLK (match_dup 3) (match_operand:BLK 4 "memory_operand" ""))) (use (match_operand 5 "const_int_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_offset_p (operands[0], operands[3], operands[2]) && s390_offset_p (operands[1], operands[4], operands[2]) && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" [(parallel [(set (match_dup 6) (and:BLK (match_dup 6) (match_dup 7))) (use (match_dup 8)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") @@ -5507,12 +4821,20 @@ ;;- Bit set (inclusive or) instructions. ;; +(define_expand "ior3" + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (ior:INT (match_operand:INT 1 "nonimmediate_operand" "") + (match_operand:INT 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "" + "s390_expand_logical_operator (IOR, mode, operands); DONE;") + ; ; iordi3 instruction pattern(s). ; (define_insn "*iordi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5525,7 +4847,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*iordi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5541,7 +4863,7 @@ (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0") (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m,NxQD0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT && s390_logical_operator_ok_p (operands)" "@ oihh\t%0,%i2 @@ -5557,27 +4879,19 @@ (define_split [(set (match_operand:DI 0 "s_operand" "") (ior:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") -(define_expand "iordi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (ior:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "s390_expand_logical_operator (IOR, DImode, operands); DONE;") - ; ; iorsi3 instruction pattern(s). ; (define_insn "*iorsi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -5591,7 +4905,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*iorsi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -5607,7 +4921,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,d,d,AQ,Q") (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0") (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T,NxQS0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ oilh\t%0,%i2 @@ -5623,7 +4937,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,AQ,Q") (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:SI 2 "general_operand" "d,R,NxQS0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 @@ -5635,21 +4949,13 @@ (define_split [(set (match_operand:SI 0 "s_operand" "") (ior:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") -(define_expand "iorsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (ior:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (IOR, SImode, operands); DONE;") - ; ; iorhi3 instruction pattern(s). ; @@ -5658,7 +4964,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,d,AQ,Q") (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:HI 2 "general_operand" "d,n,NxQH0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 @@ -5671,7 +4977,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") (ior:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") (match_operand:HI 2 "general_operand" "d,NxQH0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 @@ -5682,21 +4988,13 @@ (define_split [(set (match_operand:HI 0 "s_operand" "") (ior:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (ior:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);") -(define_expand "iorhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (ior:HI (match_operand:HI 1 "nonimmediate_operand" "") - (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (IOR, HImode, operands); DONE;") - ; ; iorqi3 instruction pattern(s). ; @@ -5705,7 +5003,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,d,Q,S,Q") (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0,0") (match_operand:QI 2 "general_operand" "d,n,n,n,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 @@ -5719,7 +5017,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,Q") (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0") (match_operand:QI 2 "general_operand" "d,n,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_ZARCH && s390_logical_operator_ok_p (operands)" "@ or\t%0,%2 @@ -5727,14 +5025,6 @@ #" [(set_attr "op_type" "RR,SI,SS")]) -(define_expand "iorqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (ior:QI (match_operand:QI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (IOR, QImode, operands); DONE;") - ; ; Block inclusive or (OC) patterns. ; @@ -5744,7 +5034,7 @@ (ior:BLK (match_dup 0) (match_operand:BLK 1 "memory_operand" "Q"))) (use (match_operand 2 "const_int_operand" "n")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" "oc\t%O0(%2,%R0),%S1" [(set_attr "op_type" "SS")]) @@ -5753,14 +5043,14 @@ [(set (match_operand 0 "memory_operand" "") (ior (match_dup 0) (match_operand 1 "memory_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed && GET_MODE (operands[0]) == GET_MODE (operands[1]) && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" [(parallel [(set (match_dup 0) (ior:BLK (match_dup 0) (match_dup 1))) (use (match_dup 2)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] { operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); operands[0] = adjust_address (operands[0], BLKmode, 0); @@ -5773,20 +5063,20 @@ (ior:BLK (match_dup 0) (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "const_int_operand" "")) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_operand:BLK 3 "memory_operand" "") (ior:BLK (match_dup 3) (match_operand:BLK 4 "memory_operand" ""))) (use (match_operand 5 "const_int_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_offset_p (operands[0], operands[3], operands[2]) && s390_offset_p (operands[1], operands[4], operands[2]) && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" [(parallel [(set (match_dup 6) (ior:BLK (match_dup 6) (match_dup 7))) (use (match_dup 8)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") @@ -5796,12 +5086,20 @@ ;;- Xor instructions. ;; +(define_expand "xor3" + [(set (match_operand:INT 0 "nonimmediate_operand" "") + (xor:INT (match_operand:INT 1 "nonimmediate_operand" "") + (match_operand:INT 2 "general_operand" ""))) + (clobber (reg:CC CC_REGNUM))] + "" + "s390_expand_logical_operator (XOR, mode, operands); DONE;") + ; ; xordi3 instruction pattern(s). ; (define_insn "*xordi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5814,7 +5112,7 @@ [(set_attr "op_type" "RRE,RXY")]) (define_insn "*xordi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0") (match_operand:DI 2 "general_operand" "d,m")) (const_int 0))) @@ -5829,7 +5127,7 @@ [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,AQ,Q") (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:DI 2 "general_operand" "d,m,NxQD0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT && s390_logical_operator_ok_p (operands)" "@ xgr\t%0,%2 @@ -5841,27 +5139,19 @@ (define_split [(set (match_operand:DI 0 "s_operand" "") (xor:DI (match_dup 0) (match_operand:DI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") -(define_expand "xordi3" - [(set (match_operand:DI 0 "nonimmediate_operand" "") - (xor:DI (match_operand:DI 1 "nonimmediate_operand" "") - (match_operand:DI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "s390_expand_logical_operator (XOR, DImode, operands); DONE;") - ; ; xorsi3 instruction pattern(s). ; (define_insn "*xorsi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -5875,7 +5165,7 @@ [(set_attr "op_type" "RR,RX,RXY")]) (define_insn "*xorsi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0") (match_operand:SI 2 "general_operand" "d,R,T")) (const_int 0))) @@ -5891,7 +5181,7 @@ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,AQ,Q") (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0,0,0") (match_operand:SI 2 "general_operand" "d,R,T,NxQS0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "s390_logical_operator_ok_p (operands)" "@ xr\t%0,%2 @@ -5904,21 +5194,13 @@ (define_split [(set (match_operand:SI 0 "s_operand" "") (xor:SI (match_dup 0) (match_operand:SI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") -(define_expand "xorsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (xor:SI (match_operand:SI 1 "nonimmediate_operand" "") - (match_operand:SI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (XOR, SImode, operands); DONE;") - ; ; xorhi3 instruction pattern(s). ; @@ -5927,7 +5209,7 @@ [(set (match_operand:HI 0 "nonimmediate_operand" "=d,AQ,Q") (xor:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0,0") (match_operand:HI 2 "general_operand" "d,NxQH0,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "s390_logical_operator_ok_p (operands)" "@ xr\t%0,%2 @@ -5938,21 +5220,13 @@ (define_split [(set (match_operand:HI 0 "s_operand" "") (xor:HI (match_dup 0) (match_operand:HI 1 "immediate_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed" [(parallel [(set (match_dup 0) (xor:QI (match_dup 0) (match_dup 1))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);") -(define_expand "xorhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (xor:HI (match_operand:HI 1 "nonimmediate_operand" "") - (match_operand:HI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (XOR, HImode, operands); DONE;") - ; ; xorqi3 instruction pattern(s). ; @@ -5961,7 +5235,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=d,Q,S,Q") (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0,0") (match_operand:QI 2 "general_operand" "d,n,n,Q"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "s390_logical_operator_ok_p (operands)" "@ xr\t%0,%2 @@ -5970,14 +5244,6 @@ #" [(set_attr "op_type" "RR,SI,SIY,SS")]) -(define_expand "xorqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (xor:QI (match_operand:QI 1 "nonimmediate_operand" "") - (match_operand:QI 2 "general_operand" ""))) - (clobber (reg:CC 33))] - "" - "s390_expand_logical_operator (XOR, QImode, operands); DONE;") - ; ; Block exclusive or (XC) patterns. ; @@ -5987,7 +5253,7 @@ (xor:BLK (match_dup 0) (match_operand:BLK 1 "memory_operand" "Q"))) (use (match_operand 2 "const_int_operand" "n")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "INTVAL (operands[2]) >= 1 && INTVAL (operands[2]) <= 256" "xc\t%O0(%2,%R0),%S1" [(set_attr "op_type" "SS")]) @@ -5996,14 +5262,14 @@ [(set (match_operand 0 "memory_operand" "") (xor (match_dup 0) (match_operand 1 "memory_operand" ""))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "reload_completed && GET_MODE (operands[0]) == GET_MODE (operands[1]) && GET_MODE_SIZE (GET_MODE (operands[0])) > 0" [(parallel [(set (match_dup 0) (xor:BLK (match_dup 0) (match_dup 1))) (use (match_dup 2)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] { operands[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0]))); operands[0] = adjust_address (operands[0], BLKmode, 0); @@ -6016,20 +5282,20 @@ (xor:BLK (match_dup 0) (match_operand:BLK 1 "memory_operand" ""))) (use (match_operand 2 "const_int_operand" "")) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_operand:BLK 3 "memory_operand" "") (xor:BLK (match_dup 3) (match_operand:BLK 4 "memory_operand" ""))) (use (match_operand 5 "const_int_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_offset_p (operands[0], operands[3], operands[2]) && s390_offset_p (operands[1], operands[4], operands[2]) && INTVAL (operands[2]) + INTVAL (operands[5]) <= 256" [(parallel [(set (match_dup 6) (xor:BLK (match_dup 6) (match_dup 7))) (use (match_dup 8)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[6] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); operands[7] = gen_rtx_MEM (BLKmode, XEXP (operands[1], 0)); operands[8] = GEN_INT (INTVAL (operands[2]) + INTVAL (operands[5]));") @@ -6042,7 +5308,7 @@ [(set (match_operand:BLK 0 "memory_operand" "=Q") (const_int 0)) (use (match_operand 1 "const_int_operand" "n")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "INTVAL (operands[1]) >= 1 && INTVAL (operands[1]) <= 256" "xc\t%O0(%1,%R0),%S0" [(set_attr "op_type" "SS")]) @@ -6052,18 +5318,18 @@ [(set (match_operand:BLK 0 "memory_operand" "") (const_int 0)) (use (match_operand 1 "const_int_operand" "")) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel [(set (match_operand:BLK 2 "memory_operand" "") (const_int 0)) (use (match_operand 3 "const_int_operand" "")) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "s390_offset_p (operands[0], operands[2], operands[1]) && INTVAL (operands[1]) + INTVAL (operands[3]) <= 256" [(parallel [(set (match_dup 4) (const_int 0)) (use (match_dup 5)) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "operands[4] = gen_rtx_MEM (BLKmode, XEXP (operands[0], 0)); operands[5] = GEN_INT (INTVAL (operands[1]) + INTVAL (operands[3]));") @@ -6073,19 +5339,19 @@ ;; ; -; negdi2 instruction pattern(s). +; neg(di|si)2 instruction pattern(s). ; -(define_expand "negdi2" +(define_expand "neg2" [(parallel - [(set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))])] + [(set (match_operand:DSI 0 "register_operand" "=d") + (neg:DSI (match_operand:DSI 1 "register_operand" "d"))) + (clobber (reg:CC CC_REGNUM))])] "" "") (define_insn "*negdi2_sign_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (neg:DI (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 1 "register_operand" "d") 0) (const_int 32)) (const_int 32))) @@ -6099,59 +5365,59 @@ (define_insn "*negdi2_sign" [(set (match_operand:DI 0 "register_operand" "=d") (neg:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "lcgfr\t%0,%1" [(set_attr "op_type" "RRE")]) -(define_insn "*negdi2_cc" - [(set (reg 33) - (compare (neg:DI (match_operand:DI 1 "register_operand" "d")) +(define_insn "*neg2_cc" + [(set (reg CC_REGNUM) + (compare (neg:GPR (match_operand:GPR 1 "register_operand" "d")) (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (match_dup 1)))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" - "lcgr\t%0,%1" - [(set_attr "op_type" "RRE")]) + (set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (match_dup 1)))] + "s390_match_ccmode (insn, CCAmode)" + "lcr\t%0,%1" + [(set_attr "op_type" "RR")]) -(define_insn "*negdi2_cconly" - [(set (reg 33) - (compare (neg:DI (match_operand:DI 1 "register_operand" "d")) +(define_insn "*neg2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:GPR (match_operand:GPR 1 "register_operand" "d")) (const_int 0))) - (clobber (match_scratch:DI 0 "=d"))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" - "lcgr\t%0,%1" - [(set_attr "op_type" "RRE")]) + (clobber (match_scratch:GPR 0 "=d"))] + "s390_match_ccmode (insn, CCAmode)" + "lcr\t%0,%1" + [(set_attr "op_type" "RR")]) -(define_insn "*negdi2_64" - [(set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "lcgr\t%0,%1" - [(set_attr "op_type" "RRE")]) +(define_insn "*neg2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (match_operand:GPR 1 "register_operand" "d"))) + (clobber (reg:CC CC_REGNUM))] + "" + "lcr\t%0,%1" + [(set_attr "op_type" "RR")]) (define_insn_and_split "*negdi2_31" [(set (match_operand:DI 0 "register_operand" "=d") (neg:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "#" "&& reload_completed" [(parallel [(set (match_dup 2) (neg:SI (match_dup 3))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (parallel - [(set (reg:CCAP 33) + [(set (reg:CCAP CC_REGNUM) (compare:CCAP (neg:SI (match_dup 5)) (const_int 0))) (set (match_dup 4) (neg:SI (match_dup 5)))]) (set (pc) - (if_then_else (ne (reg:CCAP 33) (const_int 0)) + (if_then_else (ne (reg:CCAP CC_REGNUM) (const_int 0)) (pc) (label_ref (match_dup 6)))) (parallel [(set (match_dup 2) (plus:SI (match_dup 2) (const_int -1))) - (clobber (reg:CC 33))]) + (clobber (reg:CC CC_REGNUM))]) (match_dup 6)] "operands[2] = operand_subword (operands[0], 0, 0, DImode); operands[3] = operand_subword (operands[1], 0, 0, DImode); @@ -6160,137 +5426,55 @@ operands[6] = gen_label_rtx ();") ; -; negsi2 instruction pattern(s). +; neg(df|sf)2 instruction pattern(s). ; -(define_insn "*negsi2_cc" - [(set (reg 33) - (compare (neg:SI (match_operand:SI 1 "register_operand" "d")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d") - (neg:SI (match_dup 1)))] - "s390_match_ccmode (insn, CCAmode)" - "lcr\t%0,%1" - [(set_attr "op_type" "RR")]) - -(define_insn "*negsi2_cconly" - [(set (reg 33) - (compare (neg:SI (match_operand:SI 1 "register_operand" "d")) - (const_int 0))) - (clobber (match_scratch:SI 0 "=d"))] - "s390_match_ccmode (insn, CCAmode)" - "lcr\t%0,%1" - [(set_attr "op_type" "RR")]) - -(define_insn "negsi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (neg:SI (match_operand:SI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "" - "lcr\t%0,%1" - [(set_attr "op_type" "RR")]) - -; -; negdf2 instruction pattern(s). -; - -(define_expand "negdf2" +(define_expand "neg2" [(parallel - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*negdf2_cc" - [(set (reg 33) - (compare (neg:DF (match_operand:DF 1 "register_operand" "f")) - (match_operand:DF 2 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_dup 1)))] +(define_insn "*neg2_cc" + [(set (reg CC_REGNUM) + (compare (neg:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_dup 1)))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcdbr\t%0,%1" + "lcbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*negdf2_cconly" - [(set (reg 33) - (compare (neg:DF (match_operand:DF 1 "register_operand" "f")) - (match_operand:DF 2 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f"))] +(define_insn "*neg2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcdbr\t%0,%1" + "lcbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*negdf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] +(define_insn "*neg2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcdbr\t%0,%1" + "lcbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*negdf2_ibm" - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] +(define_insn "*neg2_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lcdr\t%0,%1" + "lcr\t%0,%1" [(set_attr "op_type" "RR") - (set_attr "type" "fsimpd")]) - -; -; negsf2 instruction pattern(s). -; - -(define_expand "negsf2" - [(parallel - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*negsf2_cc" - [(set (reg 33) - (compare (neg:SF (match_operand:SF 1 "register_operand" "f")) - (match_operand:SF 2 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_dup 1)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcebr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) - -(define_insn "*negsf2_cconly" - [(set (reg 33) - (compare (neg:SF (match_operand:SF 1 "register_operand" "f")) - (match_operand:SF 2 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcebr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) - -(define_insn "*negsf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lcebr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) - -(define_insn "*negsf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lcer\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) ;; @@ -6298,11 +5482,11 @@ ;; ; -; absdi2 instruction pattern(s). +; abs(di|si)2 instruction pattern(s). ; (define_insn "*absdi2_sign_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 1 "register_operand" "d") 0) (const_int 32)) (const_int 32))) @@ -6316,170 +5500,88 @@ (define_insn "*absdi2_sign" [(set (match_operand:DI 0 "register_operand" "=d") (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d")))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "lpgfr\t%0,%1" [(set_attr "op_type" "RRE")]) -(define_insn "*absdi2_cc" - [(set (reg 33) - (compare (abs:DI (match_operand:DI 1 "register_operand" "d")) - (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d") - (abs:DI (match_dup 1)))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" - "lpgr\t%0,%1" - [(set_attr "op_type" "RRE")]) - -(define_insn "*absdi2_cconly" - [(set (reg 33) - (compare (abs:DI (match_operand:DI 1 "register_operand" "d")) +(define_insn "*abs2_cc" + [(set (reg CC_REGNUM) + (compare (abs:GPR (match_operand:DI 1 "register_operand" "d")) (const_int 0))) - (clobber (match_scratch:DI 0 "=d"))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" - "lpgr\t%0,%1" - [(set_attr "op_type" "RRE")]) - -(define_insn "absdi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (abs:DI (match_operand:DI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "lpgr\t%0,%1" - [(set_attr "op_type" "RRE")]) - -; -; abssi2 instruction pattern(s). -; - -(define_insn "*abssi2_cc" - [(set (reg 33) - (compare (abs:SI (match_operand:SI 1 "register_operand" "d")) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d") - (abs:SI (match_dup 1)))] + (set (match_operand:GPR 0 "register_operand" "=d") + (abs:GPR (match_dup 1)))] "s390_match_ccmode (insn, CCAmode)" - "lpr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lpr\t%0,%1" + [(set_attr "op_type" "RR")]) -(define_insn "*abssi2_cconly" - [(set (reg 33) - (compare (abs:SI (match_operand:SI 1 "register_operand" "d")) +(define_insn "*abs2_cconly" + [(set (reg CC_REGNUM) + (compare (abs:GPR (match_operand:GPR 1 "register_operand" "d")) (const_int 0))) - (clobber (match_scratch:SI 0 "=d"))] + (clobber (match_scratch:GPR 0 "=d"))] "s390_match_ccmode (insn, CCAmode)" - "lpr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lpr\t%0,%1" + [(set_attr "op_type" "RR")]) -(define_insn "abssi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (abs:SI (match_operand:SI 1 "register_operand" "d"))) - (clobber (reg:CC 33))] +(define_insn "abs2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) + (clobber (reg:CC CC_REGNUM))] "" - "lpr\t%0,%1" - [(set_attr "op_type" "RR")]) - -; -; absdf2 instruction pattern(s). -; - -(define_expand "absdf2" - [(parallel - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] - "TARGET_HARD_FLOAT" - "") - -(define_insn "*absdf2_cc" - [(set (reg 33) - (compare (abs:DF (match_operand:DF 1 "register_operand" "f")) - (match_operand:DF 2 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_dup 1)))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpdbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) - -(define_insn "*absdf2_cconly" - [(set (reg 33) - (compare (abs:DF (match_operand:DF 1 "register_operand" "f")) - (match_operand:DF 2 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpdbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) - -(define_insn "*absdf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpdbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) - -(define_insn "*absdf2_ibm" - [(set (match_operand:DF 0 "register_operand" "=f") - (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lpdr\t%0,%1" - [(set_attr "op_type" "RR") - (set_attr "type" "fsimpd")]) + "lpr\t%0,%1" + [(set_attr "op_type" "RR")]) ; -; abssf2 instruction pattern(s). +; abs(df|sf)2 instruction pattern(s). ; -(define_expand "abssf2" +(define_expand "abs2" [(parallel - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))])] + [(set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))])] "TARGET_HARD_FLOAT" "") -(define_insn "*abssf2_cc" - [(set (reg 33) - (compare (abs:SF (match_operand:SF 1 "register_operand" "f")) - (match_operand:SF 2 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_dup 1)))] +(define_insn "*abs2_cc" + [(set (reg CC_REGNUM) + (compare (abs:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_dup 1)))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpebr\t%0,%1" + "lpbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*abssf2_cconly" - [(set (reg 33) - (compare (abs:SF (match_operand:SF 1 "register_operand" "f")) - (match_operand:SF 2 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f"))] +(define_insn "*abs2_cconly" + [(set (reg CC_REGNUM) + (compare (abs:FPR (match_operand:FPR 1 "register_operand" "f")) + (match_operand:FPR 2 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpebr\t%0,%1" + "lpbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*abssf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] +(define_insn "*abs2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lpebr\t%0,%1" + "lpbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*abssf2_ibm" - [(set (match_operand:SF 0 "register_operand" "=f") - (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (clobber (reg:CC 33))] +(define_insn "*abs2_ibm" + [(set (match_operand:FPR 0 "register_operand" "=f") + (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IBM_FLOAT" - "lper\t%0,%1" + "lpr\t%0,%1" [(set_attr "op_type" "RR") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) ;; ;;- Negated absolute value instructions @@ -6490,7 +5592,7 @@ ; (define_insn "*negabsdi2_sign_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (neg:DI (abs:DI (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 1 "register_operand" "d") 0) (const_int 32)) (const_int 32)))) @@ -6505,214 +5607,105 @@ [(set (match_operand:DI 0 "register_operand" "=d") (neg:DI (abs:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "d"))))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "lngfr\t%0,%1" [(set_attr "op_type" "RRE")]) -(define_insn "*negabsdi2_cc" - [(set (reg 33) - (compare (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))) +(define_insn "*negabs2_cc" + [(set (reg CC_REGNUM) + (compare (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) (const_int 0))) - (set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (abs:DI (match_dup 1))))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" - "lngr\t%0,%1" - [(set_attr "op_type" "RRE")]) - -(define_insn "*negabsdi2_cconly" - [(set (reg 33) - (compare (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d"))) - (const_int 0))) - (clobber (match_scratch:DI 0 "=d"))] - "TARGET_64BIT && s390_match_ccmode (insn, CCAmode)" - "lngr\t%0,%1" - [(set_attr "op_type" "RRE")]) - -(define_insn "*negabsdi2" - [(set (match_operand:DI 0 "register_operand" "=d") - (neg:DI (abs:DI (match_operand:DI 1 "register_operand" "d")))) - (clobber (reg:CC 33))] - "TARGET_64BIT" - "lngr\t%0,%1" - [(set_attr "op_type" "RRE")]) - -(define_insn "*negabssi2_cc" - [(set (reg 33) - (compare (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))) - (const_int 0))) - (set (match_operand:SI 0 "register_operand" "=d") - (neg:SI (abs:SI (match_dup 1))))] + (set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (abs:GPR (match_dup 1))))] "s390_match_ccmode (insn, CCAmode)" - "lnr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lnr\t%0,%1" + [(set_attr "op_type" "RR")]) -(define_insn "*negabssi2_cconly" - [(set (reg 33) - (compare (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d"))) +(define_insn "*negabs2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d"))) (const_int 0))) - (clobber (match_scratch:SI 0 "=d"))] + (clobber (match_scratch:GPR 0 "=d"))] "s390_match_ccmode (insn, CCAmode)" - "lnr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lnr\t%0,%1" + [(set_attr "op_type" "RR")]) -(define_insn "*negabssi2" - [(set (match_operand:SI 0 "register_operand" "=d") - (neg:SI (abs:SI (match_operand:SI 1 "register_operand" "d")))) - (clobber (reg:CC 33))] +(define_insn "*negabs2" + [(set (match_operand:GPR 0 "register_operand" "=d") + (neg:GPR (abs:GPR (match_operand:GPR 1 "register_operand" "d")))) + (clobber (reg:CC CC_REGNUM))] "" - "lnr\t%0,%1" - [(set_attr "op_type" "RR")]) + "lnr\t%0,%1" + [(set_attr "op_type" "RR")]) ; ; Floating point ; -(define_insn "*negabsdf2_cc" - [(set (reg 33) - (compare (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (match_operand:DF 2 "const0_operand" ""))) - (set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (abs:DF (match_dup 1))))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lndbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) - -(define_insn "*negabsdf2_cconly" - [(set (reg 33) - (compare (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f"))) - (match_operand:DF 2 "const0_operand" ""))) - (clobber (match_scratch:DF 0 "=f"))] +(define_insn "*negabs2_cc" + [(set (reg CC_REGNUM) + (compare (neg:FPR (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (match_operand:FPR 2 "const0_operand" ""))) + (set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (abs:FPR (match_dup 1))))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lndbr\t%0,%1" + "lnbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) + (set_attr "type" "fsimp")]) -(define_insn "*negabsdf2" - [(set (match_operand:DF 0 "register_operand" "=f") - (neg:DF (abs:DF (match_operand:DF 1 "register_operand" "f")))) - (clobber (reg:CC 33))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lndbr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimpd")]) - -(define_insn "*negabssf2_cc" - [(set (reg 33) - (compare (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (match_operand:SF 2 "const0_operand" ""))) - (set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (abs:SF (match_dup 1))))] +(define_insn "*negabs2_cconly" + [(set (reg CC_REGNUM) + (compare (neg:FPR (abs:FPR (match_operand:FPR 1 "register_operand" "f"))) + (match_operand:FPR 2 "const0_operand" ""))) + (clobber (match_scratch:FPR 0 "=f"))] "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lnebr\t%0,%1" + "lnbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) -(define_insn "*negabssf2_cconly" - [(set (reg 33) - (compare (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f"))) - (match_operand:SF 2 "const0_operand" ""))) - (clobber (match_scratch:SF 0 "=f"))] - "s390_match_ccmode (insn, CCSmode) && TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lnebr\t%0,%1" - [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) - -(define_insn "*negabssf2" - [(set (match_operand:SF 0 "register_operand" "=f") - (neg:SF (abs:SF (match_operand:SF 1 "register_operand" "f")))) - (clobber (reg:CC 33))] +(define_insn "*negabs2" + [(set (match_operand:FPR 0 "register_operand" "=f") + (neg:FPR (abs:FPR (match_operand:FPR 1 "register_operand" "f")))) + (clobber (reg:CC CC_REGNUM))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "lnebr\t%0,%1" + "lnbr\t%0,%1" [(set_attr "op_type" "RRE") - (set_attr "type" "fsimps")]) + (set_attr "type" "fsimp")]) ;; ;;- Square root instructions. ;; ; -; sqrtdf2 instruction pattern(s). +; sqrt(df|sf)2 instruction pattern(s). ; -(define_insn "sqrtdf2" - [(set (match_operand:DF 0 "register_operand" "=f,f") - (sqrt:DF (match_operand:DF 1 "general_operand" "f,R")))] +(define_insn "sqrt2" + [(set (match_operand:FPR 0 "register_operand" "=f,f") + (sqrt:FPR (match_operand:FPR 1 "general_operand" "f,R")))] "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" "@ - sqdbr\t%0,%1 - sqdb\t%0,%1" + sqbr\t%0,%1 + sqb\t%0,%1" [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsqrtd")]) - -; -; sqrtsf2 instruction pattern(s). -; + (set_attr "type" "fsqrt")]) -(define_insn "sqrtsf2" - [(set (match_operand:SF 0 "register_operand" "=f,f") - (sqrt:SF (match_operand:SF 1 "general_operand" "f,R")))] - "TARGET_HARD_FLOAT && TARGET_IEEE_FLOAT" - "@ - sqebr\t%0,%1 - sqeb\t%0,%1" - [(set_attr "op_type" "RRE,RXE") - (set_attr "type" "fsqrts")]) ;; ;;- One complement instructions. ;; ; -; one_cmpldi2 instruction pattern(s). -; - -(define_expand "one_cmpldi2" - [(parallel - [(set (match_operand:DI 0 "register_operand" "") - (xor:DI (match_operand:DI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] - "TARGET_64BIT" - "") - -; -; one_cmplsi2 instruction pattern(s). -; - -(define_expand "one_cmplsi2" - [(parallel - [(set (match_operand:SI 0 "register_operand" "") - (xor:SI (match_operand:SI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] - "" - "") - -; -; one_cmplhi2 instruction pattern(s). -; - -(define_expand "one_cmplhi2" - [(parallel - [(set (match_operand:HI 0 "register_operand" "") - (xor:HI (match_operand:HI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] - "" - "") - -; -; one_cmplqi2 instruction pattern(s). +; one_cmpl(di|si|hi|qi)2 instruction pattern(s). ; -(define_expand "one_cmplqi2" +(define_expand "one_cmpl2" [(parallel - [(set (match_operand:QI 0 "register_operand" "") - (xor:QI (match_operand:QI 1 "register_operand" "") - (const_int -1))) - (clobber (reg:CC 33))])] + [(set (match_operand:INT 0 "register_operand" "") + (xor:INT (match_operand:INT 1 "register_operand" "") + (const_int -1))) + (clobber (reg:CC CC_REGNUM))])] "" "") @@ -6722,62 +5715,49 @@ ;; ; -; rotldi3 instruction pattern(s). +; rotl(di|si)3 instruction pattern(s). ; -(define_insn "rotldi3" - [(set (match_operand:DI 0 "register_operand" "=d") - (rotate:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "TARGET_64BIT" - "rllg\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") - (set_attr "atype" "reg")]) - -; -; rotlsi3 instruction pattern(s). -; - -(define_insn "rotlsi3" - [(set (match_operand:SI 0 "register_operand" "=d") - (rotate:SI (match_operand:SI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] +(define_insn "rotl3" + [(set (match_operand:GPR 0 "register_operand" "=d") + (rotate:GPR (match_operand:GPR 1 "register_operand" "d") + (match_operand:SI 2 "shift_count_operand" "Y")))] "TARGET_CPU_ZARCH" - "rll\t%0,%1,%Y2" + "rll\t%0,%1,%Y2" [(set_attr "op_type" "RSE") (set_attr "atype" "reg")]) ;; -;;- Arithmetic shift instructions. +;;- Shift instructions. ;; ; -; ashldi3 instruction pattern(s). +; (ashl|lshr)di3 instruction pattern(s). ; -(define_expand "ashldi3" +(define_expand "di3" [(set (match_operand:DI 0 "register_operand" "") - (ashift:DI (match_operand:DI 1 "register_operand" "") - (match_operand:SI 2 "shift_count_operand" "")))] + (SHIFT:DI (match_operand:DI 1 "register_operand" "") + (match_operand:SI 2 "shift_count_operand" "")))] "" "") -(define_insn "*ashldi3_31" +(define_insn "*di3_31" [(set (match_operand:DI 0 "register_operand" "=d") - (ashift:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] + (SHIFT:DI (match_operand:DI 1 "register_operand" "0") + (match_operand:SI 2 "shift_count_operand" "Y")))] "!TARGET_64BIT" - "sldl\t%0,%Y2" + "sdl\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) -(define_insn "*ashldi3_64" +(define_insn "*di3_64" [(set (match_operand:DI 0 "register_operand" "=d") - (ashift:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] + (SHIFT:DI (match_operand:DI 1 "register_operand" "d") + (match_operand:SI 2 "shift_count_operand" "Y")))] "TARGET_64BIT" - "sllg\t%0,%1,%Y2" + "slg\t%0,%1,%Y2" [(set_attr "op_type" "RSE") (set_attr "atype" "reg")]) @@ -6790,12 +5770,12 @@ [(set (match_operand:DI 0 "register_operand" "") (ashiftrt:DI (match_operand:DI 1 "register_operand" "") (match_operand:SI 2 "shift_count_operand" ""))) - (clobber (reg:CC 33))])] + (clobber (reg:CC CC_REGNUM))])] "" "") (define_insn "*ashrdi3_cc_31" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_operand" "Y")) (const_int 0))) @@ -6807,7 +5787,7 @@ (set_attr "atype" "reg")]) (define_insn "*ashrdi3_cconly_31" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_operand" "Y")) (const_int 0))) @@ -6821,14 +5801,14 @@ [(set (match_operand:DI 0 "register_operand" "=d") (ashiftrt:DI (match_operand:DI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_operand" "Y"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_64BIT" "srda\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) (define_insn "*ashrdi3_cc_64" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") (match_operand:SI 2 "shift_count_operand" "Y")) (const_int 0))) @@ -6840,7 +5820,7 @@ (set_attr "atype" "reg")]) (define_insn "*ashrdi3_cconly_64" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") (match_operand:SI 2 "shift_count_operand" "Y")) (const_int 0))) @@ -6854,7 +5834,7 @@ [(set (match_operand:DI 0 "register_operand" "=d") (ashiftrt:DI (match_operand:DI 1 "register_operand" "d") (match_operand:SI 2 "shift_count_operand" "Y"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" "srag\t%0,%1,%Y2" [(set_attr "op_type" "RSE") @@ -6862,15 +5842,15 @@ ; -; ashlsi3 instruction pattern(s). +; (ashl|lshr)si3 instruction pattern(s). ; -(define_insn "ashlsi3" +(define_insn "si3" [(set (match_operand:SI 0 "register_operand" "=d") - (ashift:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] + (SHIFT:SI (match_operand:SI 1 "register_operand" "0") + (match_operand:SI 2 "shift_count_operand" "Y")))] "" - "sll\t%0,%Y2" + "sl\t%0,%Y2" [(set_attr "op_type" "RS") (set_attr "atype" "reg")]) @@ -6879,7 +5859,7 @@ ; (define_insn "*ashrsi3_cc" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_operand" "Y")) (const_int 0))) @@ -6892,7 +5872,7 @@ (define_insn "*ashrsi3_cconly" - [(set (reg 33) + [(set (reg CC_REGNUM) (compare (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_operand" "Y")) (const_int 0))) @@ -6906,7 +5886,7 @@ [(set (match_operand:SI 0 "register_operand" "=d") (ashiftrt:SI (match_operand:SI 1 "register_operand" "0") (match_operand:SI 2 "shift_count_operand" "Y"))) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "" "sra\t%0,%Y2" [(set_attr "op_type" "RS") @@ -6914,163 +5894,18 @@ ;; -;;- logical shift instructions. -;; - -; -; lshrdi3 instruction pattern(s). -; - -(define_expand "lshrdi3" - [(set (match_operand:DI 0 "register_operand" "") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "") - (match_operand:SI 2 "shift_count_operand" "")))] - "" - "") - -(define_insn "*lshrdi3_31" - [(set (match_operand:DI 0 "register_operand" "=d") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "!TARGET_64BIT" - "srdl\t%0,%Y2" - [(set_attr "op_type" "RS") - (set_attr "atype" "reg")]) - -(define_insn "*lshrdi3_64" - [(set (match_operand:DI 0 "register_operand" "=d") - (lshiftrt:DI (match_operand:DI 1 "register_operand" "d") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "TARGET_64BIT" - "srlg\t%0,%1,%Y2" - [(set_attr "op_type" "RSE") - (set_attr "atype" "reg")]) - -; -; lshrsi3 instruction pattern(s). -; - -(define_insn "lshrsi3" - [(set (match_operand:SI 0 "register_operand" "=d") - (lshiftrt:SI (match_operand:SI 1 "register_operand" "0") - (match_operand:SI 2 "shift_count_operand" "Y")))] - "" - "srl\t%0,%Y2" - [(set_attr "op_type" "RS") - (set_attr "atype" "reg")]) - - -;; ;; Branch instruction patterns. ;; -(define_expand "beq" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bne" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bgt" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bgtu" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "blt" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bltu" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bge" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bgeu" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "ble" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bleu" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bunordered" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bordered" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "buneq" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bunlt" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bungt" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bunle" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bunge" - [(match_operand 0 "" "")] - "" - "s390_emit_jump (operands[0], - s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;") - -(define_expand "bltgt" - [(match_operand 0 "" "")] +(define_expand "b" + [(set (pc) + (if_then_else (COMPARE (match_operand 0 "" "") + (const_int 0)) + (match_dup 0) + (pc)))] "" "s390_emit_jump (operands[0], - s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;") + s390_emit_compare (, s390_compare_op0, s390_compare_op1)); DONE;") ;; @@ -7080,7 +5915,7 @@ (define_insn "*cjump_64" [(set (pc) (if_then_else - (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)]) + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (label_ref (match_operand 0 "" "")) (pc)))] "TARGET_CPU_ZARCH" @@ -7099,15 +5934,13 @@ (define_insn "*cjump_31" [(set (pc) (if_then_else - (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)]) + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (label_ref (match_operand 0 "" "")) (pc)))] "!TARGET_CPU_ZARCH" { - if (get_attr_length (insn) == 4) - return "j%C1\t%l0"; - else - abort (); + gcc_assert (get_attr_length (insn) == 4); + return "j%C1\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") @@ -7121,7 +5954,7 @@ (define_insn "*cjump_long" [(set (pc) (if_then_else - (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)]) + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (match_operand 0 "address_operand" "U") (pc)))] "" @@ -7145,7 +5978,7 @@ (define_insn "*icjump_64" [(set (pc) (if_then_else - (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)]) + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (pc) (label_ref (match_operand 0 "" ""))))] "TARGET_CPU_ZARCH" @@ -7164,15 +5997,13 @@ (define_insn "*icjump_31" [(set (pc) (if_then_else - (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)]) + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (pc) (label_ref (match_operand 0 "" ""))))] "!TARGET_CPU_ZARCH" { - if (get_attr_length (insn) == 4) - return "j%D1\t%l0"; - else - abort (); + gcc_assert (get_attr_length (insn) == 4); + return "j%D1\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") @@ -7186,7 +6017,7 @@ (define_insn "*icjump_long" [(set (pc) (if_then_else - (match_operator 1 "s390_comparison" [(reg 33) (const_int 0)]) + (match_operator 1 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (pc) (match_operand 0 "address_operand" "U")))] "" @@ -7224,7 +6055,7 @@ }) (define_insn "*trap" - [(trap_if (match_operator 0 "s390_comparison" [(reg 33) (const_int 0)]) + [(trap_if (match_operator 0 "s390_comparison" [(reg CC_REGNUM) (const_int 0)]) (const_int 0))] "" "j%C0\t.+2"; @@ -7267,7 +6098,7 @@ (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d") (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:SI 3 "=X,&1")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_CPU_ZARCH" { if (which_alternative != 0) @@ -7280,12 +6111,12 @@ "&& reload_completed && (! REG_P (operands[2]) || ! rtx_equal_p (operands[1], operands[2]))" - [(parallel [(set (reg:CCAN 33) + [(parallel [(set (reg:CCAN CC_REGNUM) (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) (const_int 0))) (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) (set (match_dup 2) (match_dup 3)) - (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0)) + (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) (label_ref (match_dup 0)) (pc)))] "" @@ -7305,7 +6136,7 @@ (set (match_operand:SI 2 "nonimmediate_operand" "=1,?*m*d") (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:SI 3 "=X,&1")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_CPU_ZARCH" { if (which_alternative != 0) @@ -7313,17 +6144,17 @@ else if (get_attr_length (insn) == 4) return "brct\t%1,%l0"; else - abort (); + gcc_unreachable (); } "&& reload_completed && (! REG_P (operands[2]) || ! rtx_equal_p (operands[1], operands[2]))" - [(parallel [(set (reg:CCAN 33) + [(parallel [(set (reg:CCAN CC_REGNUM) (compare:CCAN (plus:SI (match_dup 3) (const_int -1)) (const_int 0))) (set (match_dup 3) (plus:SI (match_dup 3) (const_int -1)))]) (set (match_dup 2) (match_dup 3)) - (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0)) + (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) (label_ref (match_dup 0)) (pc)))] "" @@ -7346,7 +6177,7 @@ (set (match_operand:SI 2 "register_operand" "=1,?*m*d") (plus:SI (match_dup 1) (const_int -1))) (clobber (match_scratch:SI 3 "=X,&1")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "!TARGET_CPU_ZARCH" { if (get_attr_op_type (insn) == OP_TYPE_RR) @@ -7370,7 +6201,7 @@ (set (match_operand:DI 2 "nonimmediate_operand" "=1,?*m*d") (plus:DI (match_dup 1) (const_int -1))) (clobber (match_scratch:DI 3 "=X,&1")) - (clobber (reg:CC 33))] + (clobber (reg:CC CC_REGNUM))] "TARGET_64BIT" { if (which_alternative != 0) @@ -7383,12 +6214,12 @@ "&& reload_completed && (! REG_P (operands[2]) || ! rtx_equal_p (operands[1], operands[2]))" - [(parallel [(set (reg:CCAN 33) + [(parallel [(set (reg:CCAN CC_REGNUM) (compare:CCAN (plus:DI (match_dup 3) (const_int -1)) (const_int 0))) (set (match_dup 3) (plus:DI (match_dup 3) (const_int -1)))]) (set (match_dup 2) (match_dup 3)) - (set (pc) (if_then_else (ne (reg:CCAN 33) (const_int 0)) + (set (pc) (if_then_else (ne (reg:CCAN CC_REGNUM) (const_int 0)) (label_ref (match_dup 0)) (pc)))] "" @@ -7430,10 +6261,8 @@ [(set (pc) (label_ref (match_operand 0 "" "")))] "!TARGET_CPU_ZARCH" { - if (get_attr_length (insn) == 4) - return "j\t%l0"; - else - abort (); + gcc_assert (get_attr_length (insn) == 4); + return "j\t%l0"; } [(set_attr "op_type" "RI") (set_attr "type" "branch") @@ -7583,7 +6412,7 @@ }) (define_insn "*sibcall_br" - [(call (mem:QI (reg 1)) + [(call (mem:QI (reg SIBCALL_REGNUM)) (match_operand 0 "const_int_operand" "n"))] "SIBLING_CALL_P (insn) && GET_MODE (XEXP (XEXP (PATTERN (insn), 0), 0)) == Pmode" @@ -7624,7 +6453,7 @@ (define_insn "*sibcall_value_br" [(set (match_operand 0 "" "") - (call (mem:QI (reg 1)) + (call (mem:QI (reg SIBCALL_REGNUM)) (match_operand 1 "const_int_operand" "n")))] "SIBLING_CALL_P (insn) && GET_MODE (XEXP (XEXP (XEXP (PATTERN (insn), 1), 0), 0)) == Pmode" @@ -7769,29 +6598,29 @@ ;; (define_expand "get_tp_64" - [(set (match_operand:DI 0 "nonimmediate_operand" "") (reg:DI 36))] + [(set (match_operand:DI 0 "nonimmediate_operand" "") (reg:DI TP_REGNUM))] "TARGET_64BIT" "") (define_expand "get_tp_31" - [(set (match_operand:SI 0 "nonimmediate_operand" "") (reg:SI 36))] + [(set (match_operand:SI 0 "nonimmediate_operand" "") (reg:SI TP_REGNUM))] "!TARGET_64BIT" "") (define_expand "set_tp_64" - [(set (reg:DI 36) (match_operand:DI 0 "nonimmediate_operand" "")) - (unspec_volatile [(reg:DI 36)] UNSPECV_SET_TP)] + [(set (reg:DI TP_REGNUM) (match_operand:DI 0 "nonimmediate_operand" "")) + (set (reg:DI TP_REGNUM) (unspec_volatile:DI [(reg:DI TP_REGNUM)] UNSPECV_SET_TP))] "TARGET_64BIT" "") (define_expand "set_tp_31" - [(set (reg:SI 36) (match_operand:SI 0 "nonimmediate_operand" "")) - (unspec_volatile [(reg:SI 36)] UNSPECV_SET_TP)] + [(set (reg:SI TP_REGNUM) (match_operand:SI 0 "nonimmediate_operand" "")) + (set (reg:SI TP_REGNUM) (unspec_volatile:SI [(reg:SI TP_REGNUM)] UNSPECV_SET_TP))] "!TARGET_64BIT" "") (define_insn "*set_tp" - [(unspec_volatile [(reg 36)] UNSPECV_SET_TP)] + [(set (reg TP_REGNUM) (unspec_volatile [(reg TP_REGNUM)] UNSPECV_SET_TP))] "" "" [(set_attr "type" "none") @@ -8058,7 +6887,9 @@ [(set (match_operand 0 "register_operand" "=a") (unspec_volatile [(const_int 0)] UNSPECV_MAIN_POOL))] "GET_MODE (operands[0]) == Pmode" - "* abort ();" +{ + gcc_unreachable (); +} [(set (attr "type") (if_then_else (ne (symbol_ref "TARGET_CPU_ZARCH") (const_int 0)) (const_string "larl") (const_string "la")))]) @@ -8082,7 +6913,9 @@ (define_insn "pool" [(unspec_volatile [(match_operand 0 "const_int_operand" "n")] UNSPECV_POOL)] "" - "* abort ();" +{ + gcc_unreachable (); +} [(set (attr "length") (symbol_ref "INTVAL (operands[0])"))]) ;; @@ -8099,9 +6932,8 @@ [(unspec_volatile [(const_int 0)] UNSPECV_TPF_PROLOGUE) (clobber (reg:DI 1))] "TARGET_TPF_PROFILING" - "bas\t%%r1,4064" - [(set_attr "type" "jsr") - (set_attr "op_type" "RX")]) + "larl\t%%r1,.+14\;tm\t4065,255\;bnz\t4064" + [(set_attr "length" "14")]) (define_expand "epilogue" [(use (const_int 1))] @@ -8112,10 +6944,8 @@ [(unspec_volatile [(const_int 0)] UNSPECV_TPF_EPILOGUE) (clobber (reg:DI 1))] "TARGET_TPF_PROFILING" - "bas\t%%r1,4070" - [(set_attr "type" "jsr") - (set_attr "op_type" "RX")]) - + "larl\t%%r1,.+14\;tm\t4071,255\;bnz\t4070" + [(set_attr "length" "14")]) (define_expand "sibcall_epilogue" [(use (const_int 0))] diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt new file mode 100644 index 00000000000..9ece6f13a3c --- /dev/null +++ b/gcc/config/s390/s390.opt @@ -0,0 +1,96 @@ +; Options for the S/390 / zSeries port of the compiler. + +; Copyright (C) 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. + +m31 +Target Report RejectNegative InverseMask(64BIT) +31 bit ABI + +m64 +Target Report RejectNegative Mask(64BIT) +64 bit ABI + +march= +Target RejectNegative Joined +Generate code for given CPU + +mbackchain +Target Report Mask(BACKCHAIN) +Maintain backchain pointer + +mdebug +Target Report Mask(DEBUG_ARG) +Additional debug prints + +mesa +Target Report RejectNegative InverseMask(ZARCH) +ESA/390 architecture + +mfused-madd +Target Report Mask(FUSED_MADD) +Enable fused multiply/add instructions + +mhard-float +Target Report RejectNegative Mask(HARD_FLOAT) +Use hardware fp + +mpacked-stack +Target Report Mask(PACKED_STACK) +Use packed stack layout + +msmall-exec +Target Report Mask(SMALL_EXEC) +Use bras for executable < 64k + +msoft-float +Target Report RejectNegative InverseMask(HARD_FLOAT, SOFT_FLOAT) +Don't use hardware fp + +mstack-guard= +Target RejectNegative Joined +Set the max. number of bytes which has to be left to stack size before a trap instruction is triggered + +mstack-size= +Target RejectNegative Joined +Emit extra code in the function prologue in order to trap if the stack size exceeds the given limit + +mtpf-trace +Target Report Mask(TPF_PROFILING) +Enable tpf OS tracing code + +mtune= +Target RejectNegative Joined +Schedule code for given CPU + +mvcle +Target Report Mask(MVCLE) +mvcle use + +mwarn-dynamicstack +Target RejectNegative Var(s390_warn_dynamicstack_p) +Warn if a function uses alloca or creates an array with dynamic size + +mwarn-framesize= +Target RejectNegative Joined +Warn if a single function's framesize exceeds the given framesize + +mzarch +Target Report RejectNegative Mask(ZARCH) +z/Architecture diff --git a/gcc/config/s390/tpf.h b/gcc/config/s390/tpf.h index 33a50b47498..e5645c92c2d 100644 --- a/gcc/config/s390/tpf.h +++ b/gcc/config/s390/tpf.h @@ -1,5 +1,5 @@ /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by P.J. Darcy (darcypj@us.ibm.com), Hartmut Penner (hpenner@de.ibm.com), and Ulrich Weigand (uweigand@de.ibm.com). @@ -101,6 +101,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #undef CPLUSPLUS_CPP_SPEC #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" +#undef ASM_SPEC +#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}" + #undef LIB_SPEC #define LIB_SPEC "%{pthread:-lpthread} -lc" diff --git a/gcc/config/sh/crt1.asm b/gcc/config/sh/crt1.asm index f2c4e0d7beb..ec6d3cb3a05 100644 --- a/gcc/config/sh/crt1.asm +++ b/gcc/config/sh/crt1.asm @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file was pretty much copied from newlib. This file is part of GCC. @@ -27,6 +27,19 @@ along with this program; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifdef MMU_SUPPORT + /* Section used for exception/timer interrupt stack area */ + .section .data.vbr.stack,"aw" + .align 4 + .global __ST_VBR +__ST_VBR: + .zero 1024 * 2 /* ; 2k for VBR handlers */ +/* Label at the highest stack address where the stack grows from */ +__timer_stack: +#endif /* MMU_SUPPORT */ + + /* ;---------------------------------------- + Normal newlib crt1.asm */ #ifdef __SH5__ .section .data,"aw" @@ -37,6 +50,89 @@ ___data: .global ___rodata ___rodata: +#define ICCR_BASE 0x01600000 +#define OCCR_BASE 0x01e00000 +#define MMUIR_BASE 0x00000000 +#define MMUDR_BASE 0x00800000 + +#define PTE_ENABLED 1 +#define PTE_DISABLED 0 + +#define PTE_SHARED (1 << 1) +#define PTE_NOT_SHARED 0 + +#define PTE_CB_UNCACHEABLE 0 +#define PTE_CB_DEVICE 1 +#define PTE_CB_CACHEABLE_WB 2 +#define PTE_CB_CACHEABLE_WT 3 + +#define PTE_SZ_4KB (0 << 3) +#define PTE_SZ_64KB (1 << 3) +#define PTE_SZ_1MB (2 << 3) +#define PTE_SZ_512MB (3 << 3) + +#define PTE_PRR (1 << 6) +#define PTE_PRX (1 << 7) +#define PTE_PRW (1 << 8) +#define PTE_PRU (1 << 9) + +#define SR_MMU_BIT 31 +#define SR_BL_BIT 28 + +#define ALIGN_4KB (0xfff) +#define ALIGN_1MB (0xfffff) +#define ALIGN_512MB (0x1fffffff) + +#define DYNACON_BASE 0x0f000000 +#define DM_CB_DLINK_BASE 0x0c000000 +#define DM_DB_DLINK_BASE 0x0b000000 + +#define FEMI_AREA_0 0x00000000 +#define FEMI_AREA_1 0x04000000 +#define FEMI_AREA_2 0x05000000 +#define FEMI_AREA_3 0x06000000 +#define FEMI_AREA_4 0x07000000 +#define FEMI_CB 0x08000000 + +#define EMI_BASE 0X80000000 + +#define DMA_BASE 0X0e000000 + +#define CPU_BASE 0X0d000000 + +#define PERIPH_BASE 0X09000000 +#define DMAC_BASE 0x0e000000 +#define INTC_BASE 0x0a000000 +#define CPRC_BASE 0x0a010000 +#define TMU_BASE 0x0a020000 +#define SCIF_BASE 0x0a030000 +#define RTC_BASE 0x0a040000 + + + +#define LOAD_CONST32(val, reg) \ + movi ((val) >> 16) & 65535, reg; \ + shori (val) & 65535, reg + +#define LOAD_PTEH_VAL(sym, align, bits, scratch_reg, reg) \ + LOAD_ADDR (sym, reg); \ + LOAD_CONST32 ((align), scratch_reg); \ + andc reg, scratch_reg, reg; \ + LOAD_CONST32 ((bits), scratch_reg); \ + or reg, scratch_reg, reg + +#define LOAD_PTEL_VAL(sym, align, bits, scratch_reg, reg) \ + LOAD_ADDR (sym, reg); \ + LOAD_CONST32 ((align), scratch_reg); \ + andc reg, scratch_reg, reg; \ + LOAD_CONST32 ((bits), scratch_reg); \ + or reg, scratch_reg, reg + +#define SET_PTE(pte_addr_reg, pteh_val_reg, ptel_val_reg) \ + putcfg pte_addr_reg, 0, r63; \ + putcfg pte_addr_reg, 1, ptel_val_reg; \ + putcfg pte_addr_reg, 0, pteh_val_reg + #if __SH5__ == 64 .section .text,"ax" #define LOAD_ADDR(sym, reg) \ @@ -55,8 +151,279 @@ ___rodata: start: LOAD_ADDR (_stack, r15) +#ifdef MMU_SUPPORT + ! Set up the VM using the MMU and caches + + ! .vm_ep is first instruction to execute + ! after VM initialization + pt/l .vm_ep, tr1 + + ! Configure instruction cache (ICCR) + movi 3, r2 + movi 0, r3 + LOAD_ADDR (ICCR_BASE, r1) + putcfg r1, 0, r2 + putcfg r1, 1, r3 + + ! movi 7, r2 ! write through + ! Configure operand cache (OCCR) + LOAD_ADDR (OCCR_BASE, r1) + putcfg r1, 0, r2 + putcfg r1, 1, r3 + + ! Disable all PTE translations + LOAD_ADDR (MMUIR_BASE, r1) + LOAD_ADDR (MMUDR_BASE, r2) + movi 64, r3 + pt/l .disable_ptes_loop, tr0 +.disable_ptes_loop: + putcfg r1, 0, r63 + putcfg r2, 0, r63 + addi r1, 16, r1 + addi r2, 16, r2 + addi r3, -1, r3 + bgt r3, r63, tr0 + + LOAD_ADDR (MMUIR_BASE, r1) + + ! FEMI instruction mappings + ! Area 0 - 1Mb cacheable at 0x00000000 + ! Area 1 - None + ! Area 2 - 1Mb cacheable at 0x05000000 + ! - 1Mb cacheable at 0x05100000 + ! Area 3 - None + ! Area 4 - None + + ! Map a 1Mb page for instructions at 0x00000000 + LOAD_PTEH_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRX | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1Mb page for instructions at 0x05000000 + addi r1, 16, r1 + LOAD_PTEH_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRX | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1Mb page for instructions at 0x05100000 + addi r1, 16, r1 + LOAD_PTEH_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRX | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 512M page for instructions at EMI base + addi r1, 16, r1 + LOAD_PTEH_VAL (EMI_BASE, ALIGN_512MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (EMI_BASE, ALIGN_512MB, PTE_CB_CACHEABLE_WB | PTE_SZ_512MB | PTE_PRX | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for instructions at DM_DB_DLINK_BASE + addi r1, 16, r1 + LOAD_PTEH_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_CB_CACHEABLE_WB | PTE_SZ_4KB | PTE_PRX | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + LOAD_ADDR (MMUDR_BASE, r1) + + ! FEMI data mappings + ! Area 0 - 1Mb cacheable at 0x00000000 + ! Area 1 - 1Mb device at 0x04000000 + ! Area 2 - 1Mb cacheable at 0x05000000 + ! - 1Mb cacheable at 0x05100000 + ! Area 3 - None + ! Area 4 - None + ! CB - 1Mb device at 0x08000000 + + ! Map a 1Mb page for data at 0x00000000 + LOAD_PTEH_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1Mb page for data at 0x04000000 + addi r1, 16, r1 + LOAD_PTEH_VAL (FEMI_AREA_1, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (FEMI_AREA_1, ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1Mb page for data at 0x05000000 + addi r1, 16, r1 + LOAD_PTEH_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1Mb page for data at 0x05100000 + addi r1, 16, r1 + LOAD_PTEH_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for registers at 0x08000000 + addi r1, 16, r1 + LOAD_PTEH_VAL (FEMI_CB, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (FEMI_CB, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 512M page for data at EMI + addi r1, 16, r1 + LOAD_PTEH_VAL (EMI_BASE, ALIGN_512MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (EMI_BASE, ALIGN_512MB, PTE_CB_CACHEABLE_WB | PTE_SZ_512MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for DYNACON at DYNACON_BASE + addi r1, 16, r1 + LOAD_PTEH_VAL (DYNACON_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (DYNACON_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for instructions at DM_DB_DLINK_BASE + addi r1, 16, r1 + LOAD_PTEH_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_CB_CACHEABLE_WB | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for data at DM_DB_DLINK_BASE+0x1000 + addi r1, 16, r1 + LOAD_PTEH_VAL ((DM_DB_DLINK_BASE+0x1000), ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((DM_DB_DLINK_BASE+0x1000), ALIGN_4KB, PTE_CB_UNCACHEABLE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for stack DM_DB_DLINK_BASE+0x2000 + addi r1, 16, r1 + LOAD_PTEH_VAL ((DM_DB_DLINK_BASE+0x2000), ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((DM_DB_DLINK_BASE+0x2000), ALIGN_4KB, PTE_CB_CACHEABLE_WB | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK + ! 0x0c000000 - 0x0c0fffff + addi r1, 16, r1 + LOAD_PTEH_VAL (DM_CB_DLINK_BASE, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (DM_CB_DLINK_BASE, ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK + ! 0x0c100000 - 0x0c1fffff + addi r1, 16, r1 + LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x100000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK + ! 0x0c200000 - 0x0c2fffff + addi r1, 16, r1 + LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x200000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x200000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK + ! 0x0c400000 - 0x0c4fffff + addi r1, 16, r1 + LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x400000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x400000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK + ! 0x0c800000 - 0x0c8fffff + addi r1, 16, r1 + LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x800000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x800000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map a 4K page for DMA control registers + addi r1, 16, r1 + LOAD_PTEH_VAL (DMA_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (DMA_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map lots of 4K pages for peripherals + + ! /* peripheral */ + addi r1, 16, r1 + LOAD_PTEH_VAL (PERIPH_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (PERIPH_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + ! /* dmac */ + addi r1, 16, r1 + LOAD_PTEH_VAL (DMAC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (DMAC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + ! /* intc */ + addi r1, 16, r1 + LOAD_PTEH_VAL (INTC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (INTC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + ! /* rtc */ + addi r1, 16, r1 + LOAD_PTEH_VAL (RTC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (RTC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + ! /* dmac */ + addi r1, 16, r1 + LOAD_PTEH_VAL (TMU_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (TMU_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + ! /* scif */ + addi r1, 16, r1 + LOAD_PTEH_VAL (SCIF_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (SCIF_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + ! /* cprc */ + addi r1, 16, r1 + LOAD_PTEH_VAL (CPRC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (CPRC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Map CPU WPC registers + addi r1, 16, r1 + LOAD_PTEH_VAL (CPU_BASE, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL (CPU_BASE, ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + addi r1, 16, r1 + + LOAD_PTEH_VAL ((CPU_BASE+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((CPU_BASE+0x100000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + addi r1, 16, r1 + LOAD_PTEH_VAL ((CPU_BASE+0x200000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((CPU_BASE+0x200000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + addi r1, 16, r1 + LOAD_PTEH_VAL ((CPU_BASE+0x400000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) + LOAD_PTEL_VAL ((CPU_BASE+0x400000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) + SET_PTE (r1, r2, r3) + + ! Switch over to virtual addressing and enabled cache + getcon sr, r1 + movi 1, r2 + shlli r2, SR_BL_BIT, r2 + or r1, r2, r1 + putcon r1, ssr + getcon sr, r1 + movi 1, r2 + shlli r2, SR_MMU_BIT, r2 + or r1, r2, r1 + putcon r1, ssr + gettr tr1, r1 + putcon r1, spc + synco + rte + + ! VM entry point. From now on, we are in VM mode. +.vm_ep: + + ! Install the trap handler, by seeding vbr with the + ! correct value, and by assigning sr.bl = 0. + + LOAD_ADDR (vbr_start, r1) + putcon r1, vbr + movi ~(1<<28), r1 + getcon sr, r2 + and r1, r2, r2 + putcon r2, sr +#endif /* MMU_SUPPORT */ + pt/l .Lzero_bss_loop, tr0 - pt/l _atexit, tr1 pt/l _init, tr5 pt/l ___setup_argv_and_call_main, tr6 pt/l _exit, tr7 @@ -72,12 +439,7 @@ start: LOAD_ADDR (___data, r26) LOAD_ADDR (___rodata, r27) -#if ! __SH4_NOFPU__ && ! __SH2A_NOFPU__ -#if __SH5__ == 32 - pt/l ___set_fpscr, tr0 - movi 0, r4 - blink tr0, r18 -#endif +#ifdef __SH_FPU_ANY__ getcon sr, r0 ! enable the FP unit, by resetting SR.FD ! also zero out SR.FR, SR.SZ and SR.PR, as mandated by the ABI @@ -85,9 +447,15 @@ start: shori 0xf000, r1 andc r0, r1, r0 putcon r0, sr +#if __SH5__ == 32 + pt/l ___set_fpscr, tr0 + movi 0, r4 + blink tr0, r18 +#endif #endif ! arrange for exit to call fini + pt/l _atexit, tr1 LOAD_ADDR (_fini, r2) blink tr1, r18 @@ -99,13 +467,253 @@ start: ! call exit blink tr7, r18 + ! We should never return from _exit but in case we do we would enter the + ! the following tight loop. This avoids executing any data that might follow. +limbo: + pt/l limbo, tr0 + blink tr0, r63 -#else +#ifdef MMU_SUPPORT + ! All these traps are handled in the same place. + .balign 256 +vbr_start: + pt/l handler, tr0 ! tr0 trashed. + blink tr0, r63 + .balign 256 +vbr_100: + pt/l handler, tr0 ! tr0 trashed. + blink tr0, r63 +vbr_100_end: + .balign 256 +vbr_200: + pt/l handler, tr0 ! tr0 trashed. + blink tr0, r63 + .balign 256 +vbr_300: + pt/l handler, tr0 ! tr0 trashed. + blink tr0, r63 + .balign 256 +vbr_400: ! Should be at vbr+0x400 +handler: + /* If the trap handler is there call it */ + LOAD_ADDR (__superh_trap_handler, r2) + pta chandler,tr2 + beq r2, r63, tr2 /* If zero, ie not present branch around to chandler */ + /* Now call the trap handler with as much of the context unchanged as possible. + Move trapping address into R18 to make it look like the trap point */ + getcon spc, r18 + pt/l __superh_trap_handler, tr0 + blink tr0, r7 +chandler: + getcon spc, r62 + getcon expevt, r2 + pt/l _exit, tr0 + blink tr0, r63 + + /* Simulated trap handler */ + .section .text..SHmedia32,"ax" +gcc2_compiled.: + .section .debug_abbrev +.Ldebug_abbrev0: + .section .text..SHmedia32 +.Ltext0: + .section .debug_info +.Ldebug_info0: + .section .debug_line +.Ldebug_line0: + .section .text..SHmedia32,"ax" + .align 5 + .global __superh_trap_handler + .type __superh_trap_handler,@function +__superh_trap_handler: +.LFB1: + ptabs r18, tr0 + addi.l r15, -8, r15 + st.l r15, 4, r14 + addi.l r15, -8, r15 + add.l r15, r63, r14 + st.l r14, 0, r2 + ptabs r7, tr0 + addi.l r14, 8, r14 + add.l r14, r63, r15 + ld.l r15, 4, r14 + addi.l r15, 8, r15 + blink tr0, r63 +.LFE1: +.Lfe1: + .size __superh_trap_handler,.Lfe1-__superh_trap_handler + + .section .text..SHmedia32 +.Letext0: + + .section .debug_info + .ualong 0xa7 + .uaword 0x2 + .ualong .Ldebug_abbrev0 + .byte 0x4 + .byte 0x1 + .ualong .Ldebug_line0 + .ualong .Letext0 + .ualong .Ltext0 + .string "trap_handler.c" + + .string "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + .string "GNU C 2.97-sh5-010522" + + .byte 0x1 + .byte 0x2 + .ualong 0x9a + .byte 0x1 + .string "_superh_trap_handler" + + .byte 0x1 + .byte 0x2 + .byte 0x1 + .ualong .LFB1 + .ualong .LFE1 + .byte 0x1 + .byte 0x5e + .byte 0x3 + .string "trap_reason" + + .byte 0x1 + .byte 0x1 + .ualong 0x9a + .byte 0x2 + .byte 0x91 + .byte 0x0 + .byte 0x0 + .byte 0x4 + .string "unsigned int" + + .byte 0x4 + .byte 0x7 + .byte 0x0 + + .section .debug_abbrev + .byte 0x1 + .byte 0x11 + .byte 0x1 + .byte 0x10 + .byte 0x6 + .byte 0x12 + .byte 0x1 + .byte 0x11 + .byte 0x1 + .byte 0x3 + .byte 0x8 + .byte 0x1b + .byte 0x8 + .byte 0x25 + .byte 0x8 + .byte 0x13 + .byte 0xb + .byte 0,0 + .byte 0x2 + .byte 0x2e + .byte 0x1 + .byte 0x1 + .byte 0x13 + .byte 0x3f + .byte 0xc + .byte 0x3 + .byte 0x8 + .byte 0x3a + .byte 0xb + .byte 0x3b + .byte 0xb + .byte 0x27 + .byte 0xc + .byte 0x11 + .byte 0x1 + .byte 0x12 + .byte 0x1 + .byte 0x40 + .byte 0xa + .byte 0,0 + .byte 0x3 + .byte 0x5 + .byte 0x0 + .byte 0x3 + .byte 0x8 + .byte 0x3a + .byte 0xb + .byte 0x3b + .byte 0xb + .byte 0x49 + .byte 0x13 + .byte 0x2 + .byte 0xa + .byte 0,0 + .byte 0x4 + .byte 0x24 + .byte 0x0 + .byte 0x3 + .byte 0x8 + .byte 0xb + .byte 0xb + .byte 0x3e + .byte 0xb + .byte 0,0 + .byte 0 + + .section .debug_pubnames + .ualong 0x27 + .uaword 0x2 + .ualong .Ldebug_info0 + .ualong 0xab + .ualong 0x5b + .string "_superh_trap_handler" + + .ualong 0x0 + + .section .debug_aranges + .ualong 0x1c + .uaword 0x2 + .ualong .Ldebug_info0 + .byte 0x4 + .byte 0x0 + .uaword 0x0,0 + .ualong .Ltext0 + .ualong .Letext0-.Ltext0 + .ualong 0x0 + .ualong 0x0 + .ident "GCC: (GNU) 2.97-sh5-010522" +#endif /* MMU_SUPPORT */ +#else /* ! __SH5__ */ + + ! make a place to keep any previous value of the vbr register + ! this will only have a value if it has been set by redboot (for example) + .section .bss +old_vbr: + .long 0 + .section .text .global start + .import ___rtos_profiler_start_timer + .weak ___rtos_profiler_start_timer start: mov.l stack_k,r15 +#if defined (__SH3__) || (defined (__SH_FPU_ANY__) && ! defined (__SH2A__)) || defined (__SH4_NOFPU__) +#define VBR_SETUP + ! before zeroing the bss ... + ! if the vbr is already set to vbr_start then the program has been restarted + ! (i.e. it is not the first time the program has been run since reset) + ! reset the vbr to its old value before old_vbr (in bss) is wiped + ! this ensures that the later code does not create a circular vbr chain + stc vbr, r1 + mov.l vbr_start_k, r2 + cmp/eq r1, r2 + bf 0f + ! reset the old vbr value + mov.l old_vbr_k, r1 + mov.l @r1, r2 + ldc r2, vbr +0: +#endif /* VBR_SETUP */ + ! zero out bss mov.l edata_k,r0 mov.l end_k,r1 @@ -116,14 +724,39 @@ start_l: cmp/ge r0,r1 bt start_l -#if ! __SH2A_NOFPU__ -#if defined (__SH2E__) || defined (__SH2A__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) +#if defined (__SH_FPU_ANY__) mov.l set_fpscr_k, r1 + mov #4,r4 jsr @r1 - mov #0,r4 - lds r3,fpscr -#endif /* defined (__SH2E__) || defined (__SH2A__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */ -#endif /* ! __SH2A_NOFPU__ */ + shll16 r4 ! Set DN bit (flush denormal inputs to zero) + lds r3,fpscr ! Switch to default precision +#endif /* defined (__SH_FPU_ANY__) */ + +#ifdef VBR_SETUP + ! save the existing contents of the vbr + ! there will only be a prior value when using something like redboot + ! otherwise it will be zero + stc vbr, r1 + mov.l old_vbr_k, r2 + mov.l r1, @r2 + ! setup vbr + mov.l vbr_start_k, r1 + ldc r1,vbr +#endif /* VBR_SETUP */ + + ! if an rtos is exporting a timer start fn, + ! then pick up an SR which does not enable ints + ! (the rtos will take care of this) + mov.l rtos_start_fn, r0 + mov.l sr_initial_bare, r1 + tst r0, r0 + bt set_sr + + mov.l sr_initial_rtos, r1 + +set_sr: + ! Set status register (sr) + ldc r1, sr ! arrange for exit to call fini mov.l atexit_k,r0 @@ -146,14 +779,12 @@ start_l: mov.l exit_k,r0 jsr @r0 nop - + .align 2 -#if ! __SH2A_NOFPU__ -#if defined (__SH2E__) || defined (__SH2A__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) +#if defined (__SH_FPU_ANY__) set_fpscr_k: .long ___set_fpscr -#endif /* defined (__SH2E__) || defined (__SH2A__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */ -#endif /* ! __SH2A_NOFPU__ */ +#endif /* defined (__SH_FPU_ANY__) */ stack_k: .long _stack @@ -171,11 +802,428 @@ init_k: .long _init fini_k: .long _fini +#ifdef VBR_SETUP +old_vbr_k: + .long old_vbr +vbr_start_k: + .long vbr_start +#endif /* VBR_SETUP */ + +sr_initial_rtos: + ! Privileged mode RB 1 BL 0. Keep BL 0 to allow default trap handlers to work. + ! Whether profiling or not, keep interrupts masked, + ! the RTOS will enable these if required. + .long 0x600000f1 + +rtos_start_fn: + .long ___rtos_profiler_start_timer + +sr_initial_bare: + ! Privileged mode RB 1 BL 0. Keep BL 0 to allow default trap handlers to work. + ! Keep interrupts disabled - the application will enable as required. + .long 0x600000f1 ! supplied for backward compatibility only, in case of linking ! code whose main() was compiled with an older version of GCC. - .global ___main + .global ___main ___main: rts nop -#endif +#ifdef VBR_SETUP +! Exception handlers + .balign 256 +vbr_start: + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + bf 1f + ! no previous vbr - jump to own generic handler + bra handler + nop +1: ! there was a previous handler - chain them + jmp @r0 + nop + .balign 4 +2: + .long old_vbr + + .balign 256 +vbr_100: + ! Non profiling case. +handler_100: + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + bf 1f + ! no previous vbr - jump to own generic handler + bra handler + nop +1: ! there was a previous handler - chain them + add #0x7f, r0 ! 0x7f + add #0x7f, r0 ! 0xfe + add #0x2, r0 ! add 0x100 without corrupting another register + jmp @r0 + nop + .balign 4 +2: + .long old_vbr + + .balign 256 +vbr_200: + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + bf 1f + ! no previous vbr - jump to own generic handler + bra handler + nop +1: ! there was a previous handler - chain them + add #0x7f, r0 ! 0x7f + add #0x7f, r0 ! 0xfe + add #0x7f, r0 ! 0x17d + add #0x7f, r0 ! 0x1fc + add #0x4, r0 ! add 0x200 without corrupting another register + jmp @r0 + nop + .balign 4 +2: + .long old_vbr + + .balign 256 +vbr_300: + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + bf 1f + ! no previous vbr - jump to own generic handler + bra handler + nop +1: ! there was a previous handler - chain them + add #0x7f, r0 ! 0x7f + add #0x7f, r0 ! 0xfe + add #0x7f, r0 ! 0x17d + add #0x7f, r0 ! 0x1fc + add #0x7f, r0 ! 0x27b + add #0x7f, r0 ! 0x2fa + add #0x6, r0 ! add 0x300 without corrupting another register + jmp @r0 + nop + .balign 4 +2: + .long old_vbr + + .balign 256 +vbr_400: ! Should be at vbr+0x400 + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + ! no previous vbr - jump to own generic handler + bt handler + ! there was a previous handler - chain them + add #0x7f, r0 ! 0x7f + add #0x7f, r0 ! 0xfe + add #0x7f, r0 ! 0x17d + add #0x7f, r0 ! 0x1fc + add #0x7f, r0 ! 0x27b + add #0x7f, r0 ! 0x2fa + add #0x7f, r0 ! 0x379 + add #0x7f, r0 ! 0x3f8 + add #0x8, r0 ! add 0x400 without corrupting another register + jmp @r0 + nop + .balign 4 +2: + .long old_vbr +handler: + /* If the trap handler is there call it */ + mov.l superh_trap_handler_k, r0 + cmp/eq #0, r0 ! True if zero. + bf 3f + bra chandler + nop +3: + ! Here handler available, call it. + /* Now call the trap handler with as much of the context unchanged as possible. + Move trapping address into PR to make it look like the trap point */ + stc spc, r1 + lds r1, pr + mov.l expevt_k, r4 + mov.l @r4, r4 ! r4 is value of expevt, first parameter. + mov r1, r5 ! Remember trapping pc. + mov r1, r6 ! Remember trapping pc. + mov.l chandler_k, r1 + mov.l superh_trap_handler_k, r2 + ! jmp to trap handler to avoid disturbing pr. + jmp @r2 + nop + + .balign 256 +vbr_500: + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + ! no previous vbr - jump to own generic handler + bt handler + ! there was a previous handler - chain them + add #0x7f, r0 ! 0x7f + add #0x7f, r0 ! 0xfe + add #0x7f, r0 ! 0x17d + add #0x7f, r0 ! 0x1fc + add #0x7f, r0 ! 0x27b + add #0x7f, r0 ! 0x2fa + add #0x7f, r0 ! 0x379 + add #0x7f, r0 ! 0x3f8 + add #0x7f, r0 ! 0x477 + add #0x7f, r0 ! 0x4f6 + add #0xa, r0 ! add 0x500 without corrupting another register + jmp @r0 + nop + .balign 4 +2: + .long old_vbr + + .balign 256 +vbr_600: + mov.l 2f, r0 ! load the old vbr setting (if any) + mov.l @r0, r0 + cmp/eq #0, r0 + ! no previous vbr - jump to own handler + bt chandler + ! there was a previous handler - chain them + add #0x7f, r0 ! 0x7f + add #0x7f, r0 ! 0xfe + add #0x7f, r0 ! 0x17d + add #0x7f, r0 ! 0x1fc + add #0x7f, r0 ! 0x27b + add #0x7f, r0 ! 0x2fa + add #0x7f, r0 ! 0x379 + add #0x7f, r0 ! 0x3f8 + add #0x7f, r0 ! 0x477 + add #0x7f, r0 ! 0x4f6 + add #0x7f, r0 ! 0x575 + add #0x7f, r0 ! 0x5f4 + add #0xc, r0 ! add 0x600 without corrupting another register + jmp @r0 + nop + .balign 4 +2: + .long old_vbr +chandler: + mov.l expevt_k, r4 + mov.l @r4, r4 ! r4 is value of expevt hence making this the return code + mov.l handler_exit_k,r0 + jsr @r0 + nop + ! We should never return from _exit but in case we do we would enter the + ! the following tight loop +limbo: + bra limbo + nop + .balign 4 +expevt_k: + .long 0xff000024 ! Address of expevt +chandler_k: + .long chandler +superh_trap_handler_k: + .long __superh_trap_handler +handler_exit_k: + .long _exit + .align 2 +! Simulated compile of trap handler. + .section .debug_abbrev,"",@progbits +.Ldebug_abbrev0: + .section .debug_info,"",@progbits +.Ldebug_info0: + .section .debug_line,"",@progbits +.Ldebug_line0: + .text +.Ltext0: + .align 5 + .type __superh_trap_handler,@function +__superh_trap_handler: +.LFB1: + mov.l r14,@-r15 +.LCFI0: + add #-4,r15 +.LCFI1: + mov r15,r14 +.LCFI2: + mov.l r4,@r14 + lds r1, pr + add #4,r14 + mov r14,r15 + mov.l @r15+,r14 + rts + nop +.LFE1: +.Lfe1: + .size __superh_trap_handler,.Lfe1-__superh_trap_handler + .section .debug_frame,"",@progbits +.Lframe0: + .ualong .LECIE0-.LSCIE0 +.LSCIE0: + .ualong 0xffffffff + .byte 0x1 + .string "" + .uleb128 0x1 + .sleb128 -4 + .byte 0x11 + .byte 0xc + .uleb128 0xf + .uleb128 0x0 + .align 2 +.LECIE0: +.LSFDE0: + .ualong .LEFDE0-.LASFDE0 +.LASFDE0: + .ualong .Lframe0 + .ualong .LFB1 + .ualong .LFE1-.LFB1 + .byte 0x4 + .ualong .LCFI0-.LFB1 + .byte 0xe + .uleb128 0x4 + .byte 0x4 + .ualong .LCFI1-.LCFI0 + .byte 0xe + .uleb128 0x8 + .byte 0x8e + .uleb128 0x1 + .byte 0x4 + .ualong .LCFI2-.LCFI1 + .byte 0xd + .uleb128 0xe + .align 2 +.LEFDE0: + .text +.Letext0: + .section .debug_info + .ualong 0xb3 + .uaword 0x2 + .ualong .Ldebug_abbrev0 + .byte 0x4 + .uleb128 0x1 + .ualong .Ldebug_line0 + .ualong .Letext0 + .ualong .Ltext0 + .string "trap_handler.c" + .string "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" + .string "GNU C 3.2 20020529 (experimental)" + .byte 0x1 + .uleb128 0x2 + .ualong 0xa6 + .byte 0x1 + .string "_superh_trap_handler" + .byte 0x1 + .byte 0x2 + .byte 0x1 + .ualong .LFB1 + .ualong .LFE1 + .byte 0x1 + .byte 0x5e + .uleb128 0x3 + .string "trap_reason" + .byte 0x1 + .byte 0x1 + .ualong 0xa6 + .byte 0x2 + .byte 0x91 + .sleb128 0 + .byte 0x0 + .uleb128 0x4 + .string "unsigned int" + .byte 0x4 + .byte 0x7 + .byte 0x0 + .section .debug_abbrev + .uleb128 0x1 + .uleb128 0x11 + .byte 0x1 + .uleb128 0x10 + .uleb128 0x6 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0x1b + .uleb128 0x8 + .uleb128 0x25 + .uleb128 0x8 + .uleb128 0x13 + .uleb128 0xb + .byte 0x0 + .byte 0x0 + .uleb128 0x2 + .uleb128 0x2e + .byte 0x1 + .uleb128 0x1 + .uleb128 0x13 + .uleb128 0x3f + .uleb128 0xc + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0x3a + .uleb128 0xb + .uleb128 0x3b + .uleb128 0xb + .uleb128 0x27 + .uleb128 0xc + .uleb128 0x11 + .uleb128 0x1 + .uleb128 0x12 + .uleb128 0x1 + .uleb128 0x40 + .uleb128 0xa + .byte 0x0 + .byte 0x0 + .uleb128 0x3 + .uleb128 0x5 + .byte 0x0 + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0x3a + .uleb128 0xb + .uleb128 0x3b + .uleb128 0xb + .uleb128 0x49 + .uleb128 0x13 + .uleb128 0x2 + .uleb128 0xa + .byte 0x0 + .byte 0x0 + .uleb128 0x4 + .uleb128 0x24 + .byte 0x0 + .uleb128 0x3 + .uleb128 0x8 + .uleb128 0xb + .uleb128 0xb + .uleb128 0x3e + .uleb128 0xb + .byte 0x0 + .byte 0x0 + .byte 0x0 + .section .debug_pubnames,"",@progbits + .ualong 0x27 + .uaword 0x2 + .ualong .Ldebug_info0 + .ualong 0xb7 + .ualong 0x67 + .string "_superh_trap_handler" + .ualong 0x0 + .section .debug_aranges,"",@progbits + .ualong 0x1c + .uaword 0x2 + .ualong .Ldebug_info0 + .byte 0x4 + .byte 0x0 + .uaword 0x0 + .uaword 0x0 + .ualong .Ltext0 + .ualong .Letext0-.Ltext0 + .ualong 0x0 + .ualong 0x0 +#endif /* VBR_SETUP */ +#endif /* ! __SH5__ */ diff --git a/gcc/config/sh/divtab.c b/gcc/config/sh/divtab.c new file mode 100644 index 00000000000..25855c5a612 --- /dev/null +++ b/gcc/config/sh/divtab.c @@ -0,0 +1,204 @@ +/* Copyright (C) 2003 Free Software Foundation, Inc. + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +In addition to the permissions in the GNU General Public License, the +Free Software Foundation gives you unlimited permission to link the +compiled version of this file into combinations with other programs, +and to distribute those combinations without any restriction coming +from the use of this file. (The General Public License restrictions +do apply in other respects; for example, they cover modification of +the file, and distribution when not linked into a combine +executable.) + +This file 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; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* Calculate division table for SH5Media integer division + Contributed by Joern Rennecke + joern.rennecke@superh.com */ + +#include +#include + +#define BITS 5 +#define N_ENTRIES (1 << BITS) +#define CUTOFF_BITS 20 + +#define BIAS (-330) + +double max_defect = 0.; +double max_defect_x; + +double min_defect = 1e9; +double min_defect_x; + +double max_defect2 = 0.; +double max_defect2_x; + +double min_defect2 = 0.; +double min_defect2_x; + +double min_defect3 = 01e9; +double min_defect3_x; +int min_defect3_val; + +double max_defect3 = 0.; +double max_defect3_x; +int max_defect3_val; + +static double note_defect3 (int val, double d2, double y2d, double x) +{ + int cutoff_val = val >> CUTOFF_BITS; + double cutoff; + double defect; + + if (val < 0) + cutoff_val++; + cutoff = (cutoff_val * (1< max_defect3) + { + max_defect3 = defect; + max_defect3_x = x; + max_defect3_val = val; + } + if (defect < min_defect3) + { + min_defect3 = defect; + min_defect3_x = x; + min_defect3_val = val; + } +} + +/* This function assumes 32 bit integers. */ +static double +calc_defect (double x, int constant, int factor) +{ + double y0 = (constant - (int) floor ((x * factor * 64.))) / 16384.; + double y1 = 2 * y0 -y0 * y0 * (x + BIAS / (1.*(1LL<<30))); + double y2d0, y2d; + int y2d1; + double d, d2; + + y1 = floor (y1 * (1024 * 1024 * 1024)) / (1024 * 1024 * 1024); + d = y1 - 1 / x; + if (d > max_defect) + { + max_defect = d; + max_defect_x = x; + } + if (d < min_defect) + { + min_defect = d; + min_defect_x = x; + } + y2d0 = floor (y1 * x * (1LL << 60-16)); + y2d1 = (int) (long long) y2d0; + y2d = - floor ((y1 - y0 / (1<<30-14)) * y2d1) / (1LL<<44); + d2 = y1 + y2d - 1/x; + if (d2 > max_defect2) + { + max_defect2 = d2; + max_defect2_x = x; + } + if (d2 < min_defect2) + { + min_defect2 = d2; + min_defect2_x = x; + } + /* zero times anything is trivially zero. */ + note_defect3 ((1 << CUTOFF_BITS) - 1, d2, y2d, x); + note_defect3 (1 << CUTOFF_BITS, d2, y2d, x); + note_defect3 ((1U << 31) - (1 << CUTOFF_BITS), d2, y2d, x); + note_defect3 ((1U << 31) - 1, d2, y2d, x); + note_defect3 (-1, d2, y2d, x); + note_defect3 (-(1 << CUTOFF_BITS), d2, y2d, x); + note_defect3 ((1U << 31) - (1 << CUTOFF_BITS) + 1, d2, y2d, x); + note_defect3 (-(1U << 31), d2, y2d, x); + return d; +} + +int +main () +{ + int i; + unsigned char factors[N_ENTRIES]; + short constants[N_ENTRIES]; + int steps = N_ENTRIES / 2; + double step = 1. / steps; + double eps30 = 1. / (1024 * 1024 * 1024); + + for (i = 0; i < N_ENTRIES; i++) + { + double x_low = (i < steps ? 1. : -3.) + i * step; + double x_high = x_low + step - eps30; + double x_med; + int factor, constant; + double low_defect, med_defect, high_defect, max_defect; + + factor = (1./x_low- 1./x_high) / step * 256. + 0.5; + if (factor == 256) + factor = 255; + factors[i] = factor; + /* Use minimum of error function for x_med. */ + x_med = sqrt (256./factor); + if (x_low < 0) + x_med = - x_med; + low_defect = 1. / x_low + x_low * factor / 256.; + high_defect = 1. / x_high + x_high * factor / 256.; + med_defect = 1. / x_med + x_med * factor / 256.; + max_defect + = ((low_defect > high_defect) ^ (x_med < 0)) ? low_defect : high_defect; + constant = (med_defect + max_defect) * 0.5 * 16384. + 0.5; + if (constant < -32768 || constant > 32767) + abort (); + constants[i] = constant; + calc_defect (x_low, constant, factor); + calc_defect (x_med, constant, factor); + calc_defect (x_high, constant, factor); + } + printf ("/* This table has been generated by divtab.c .\n"); + printf ("Defects for bias %d:\n", BIAS); + printf (" Max defect: %e at %e\n", max_defect, max_defect_x); + printf (" Min defect: %e at %e\n", min_defect, min_defect_x); + printf (" Max 2nd step defect: %e at %e\n", max_defect2, max_defect2_x); + printf (" Min 2nd step defect: %e at %e\n", min_defect2, min_defect2_x); + printf (" Max div defect: %e at %d:%e\n", max_defect3, max_defect3_val, max_defect3_x); + printf (" Min div defect: %e at %d:%e\n", min_defect3, min_defect3_val, min_defect3_x); + printf (" Defect at 1: %e\n", + calc_defect (1., constants[0], factors[0])); + printf (" Defect at -2: %e */\n", + calc_defect (-2., constants[steps], factors[steps])); + printf ("\t.section\t.rodata\n"); + printf ("\t.balign 2\n"); + printf ("/* negative division constants */\n"); + for (i = steps; i < 2 * steps; i++) + printf ("\t.word\t%d\n", constants[i]); + printf ("/* negative division factors */\n"); + for (i = steps; i < 2*steps; i++) + printf ("\t.byte\t%d\n", factors[i]); + printf ("\t.skip %d\n", steps); + printf ("\t.global GLOBAL(div_table):\n"); + printf ("GLOBAL(div_table):\n"); + printf ("\t.skip %d\n", steps); + printf ("/* positive division factors */\n"); + for (i = 0; i < steps; i++) + printf ("\t.byte\t%d\n", factors[i]); + printf ("/* positive division constants */\n"); + for (i = 0; i < steps; i++) + printf ("\t.word\t%d\n", constants[i]); + exit (0); +} diff --git a/gcc/config/sh/elf.h b/gcc/config/sh/elf.h index b069308ea8c..52d0727eb64 100644 --- a/gcc/config/sh/elf.h +++ b/gcc/config/sh/elf.h @@ -57,19 +57,11 @@ Boston, MA 02111-1307, USA. */ /* Pass -ml and -mrelax to the assembler and linker. */ #undef ASM_SPEC #define ASM_SPEC SH_ASM_SPEC -#undef SUBTARGET_ASM_ISA_SPEC -#define SUBTARGET_ASM_ISA_SPEC "\ -%{m2a:--isa=sh2a} \ -%{m2a-single:--isa=sh2a} \ -%{m2a-single-only:--isa=sh2a} \ -%{m2a-nofpu:--isa=sh2a-nofpu} \ -%{m5-compact*:--isa=SHcompact} %{m5-32media*:--isa=SHmedia --abi=32} \ -%{m5-64media*:--isa=SHmedia --abi=64}" ASM_ISA_DEFAULT_SPEC #undef LINK_SPEC #define LINK_SPEC SH_LINK_SPEC #undef LINK_EMUL_PREFIX -#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT +#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN #define LINK_EMUL_PREFIX "sh%{!mb:l}elf" #else #define LINK_EMUL_PREFIX "sh%{ml:l}elf" diff --git a/gcc/config/sh/lib1funcs.asm b/gcc/config/sh/lib1funcs.asm index 30f10a992cd..22778531c1b 100644 --- a/gcc/config/sh/lib1funcs.asm +++ b/gcc/config/sh/lib1funcs.asm @@ -1,4 +1,5 @@ -/* Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +/* Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is free software; you can redistribute it and/or modify it @@ -40,11 +41,15 @@ Boston, MA 02111-1307, USA. */ #ifdef __ELF__ #define LOCAL(X) .L_##X #define FUNC(X) .type X,@function +#define HIDDEN_FUNC(X) FUNC(X); .hidden X +#define HIDDEN_ALIAS(X,Y) ALIAS (X,Y); .hidden GLOBAL(X) #define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X #define ENDFUNC(X) ENDFUNC0(X) #else #define LOCAL(X) L_##X #define FUNC(X) +#define HIDDEN_FUNC(X) +#define HIDDEN_ALIAS(X,Y) ALIAS (X,Y) #define ENDFUNC(X) #endif @@ -54,10 +59,6 @@ Boston, MA 02111-1307, USA. */ #define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y) -#if defined __SH5__ && ! defined __SH4_NOFPU__ && ! defined (__LITTLE_ENDIAN__) -#define FMOVD_WORKS -#endif - #ifdef __SH2A__ #undef FMOVD_WORKS #define FMOVD_WORKS @@ -99,39 +100,39 @@ Boston, MA 02111-1307, USA. */ .global GLOBAL(ashiftrt_r4_31) .global GLOBAL(ashiftrt_r4_32) - FUNC(GLOBAL(ashiftrt_r4_0)) - FUNC(GLOBAL(ashiftrt_r4_1)) - FUNC(GLOBAL(ashiftrt_r4_2)) - FUNC(GLOBAL(ashiftrt_r4_3)) - FUNC(GLOBAL(ashiftrt_r4_4)) - FUNC(GLOBAL(ashiftrt_r4_5)) - FUNC(GLOBAL(ashiftrt_r4_6)) - FUNC(GLOBAL(ashiftrt_r4_7)) - FUNC(GLOBAL(ashiftrt_r4_8)) - FUNC(GLOBAL(ashiftrt_r4_9)) - FUNC(GLOBAL(ashiftrt_r4_10)) - FUNC(GLOBAL(ashiftrt_r4_11)) - FUNC(GLOBAL(ashiftrt_r4_12)) - FUNC(GLOBAL(ashiftrt_r4_13)) - FUNC(GLOBAL(ashiftrt_r4_14)) - FUNC(GLOBAL(ashiftrt_r4_15)) - FUNC(GLOBAL(ashiftrt_r4_16)) - FUNC(GLOBAL(ashiftrt_r4_17)) - FUNC(GLOBAL(ashiftrt_r4_18)) - FUNC(GLOBAL(ashiftrt_r4_19)) - FUNC(GLOBAL(ashiftrt_r4_20)) - FUNC(GLOBAL(ashiftrt_r4_21)) - FUNC(GLOBAL(ashiftrt_r4_22)) - FUNC(GLOBAL(ashiftrt_r4_23)) - FUNC(GLOBAL(ashiftrt_r4_24)) - FUNC(GLOBAL(ashiftrt_r4_25)) - FUNC(GLOBAL(ashiftrt_r4_26)) - FUNC(GLOBAL(ashiftrt_r4_27)) - FUNC(GLOBAL(ashiftrt_r4_28)) - FUNC(GLOBAL(ashiftrt_r4_29)) - FUNC(GLOBAL(ashiftrt_r4_30)) - FUNC(GLOBAL(ashiftrt_r4_31)) - FUNC(GLOBAL(ashiftrt_r4_32)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_0)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_1)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_2)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_3)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_4)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_5)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_6)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_7)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_8)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_9)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_10)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_11)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_12)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_13)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_14)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_15)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_16)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_17)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_18)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_19)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_20)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_21)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_22)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_23)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_24)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_25)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_26)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_27)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_28)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_29)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_30)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_31)) + HIDDEN_FUNC(GLOBAL(ashiftrt_r4_32)) .align 1 GLOBAL(ashiftrt_r4_32): @@ -268,7 +269,7 @@ GLOBAL(ashiftrt_r4_0): ! .global GLOBAL(ashrsi3) - FUNC(GLOBAL(ashrsi3)) + HIDDEN_FUNC(GLOBAL(ashrsi3)) .align 2 GLOBAL(ashrsi3): mov #31,r0 @@ -418,7 +419,7 @@ LOCAL(ashrsi3_0): ! (none) ! .global GLOBAL(ashlsi3) - FUNC(GLOBAL(ashlsi3)) + HIDDEN_FUNC(GLOBAL(ashlsi3)) .align 2 GLOBAL(ashlsi3): mov #31,r0 @@ -577,7 +578,7 @@ LOCAL(ashlsi3_0): ! (none) ! .global GLOBAL(lshrsi3) - FUNC(GLOBAL(lshrsi3)) + HIDDEN_FUNC(GLOBAL(lshrsi3)) .align 2 GLOBAL(lshrsi3): mov #31,r0 @@ -719,121 +720,143 @@ LOCAL(lshrsi3_0): #ifdef L_movmem .text + .balign 4 + .global GLOBAL(movmem) + HIDDEN_FUNC(GLOBAL(movmem)) + HIDDEN_ALIAS(movstr,movmem) + /* This would be a lot simpler if r6 contained the byte count + minus 64, and we wouldn't be called here for a byte count of 64. */ +GLOBAL(movmem): + sts.l pr,@-r15 + shll2 r6 + bsr GLOBAL(movmemSI52+2) + mov.l @(48,r5),r0 + .balign 4 +LOCAL(movmem_loop): /* Reached with rts */ + mov.l @(60,r5),r0 + add #-64,r6 + mov.l r0,@(60,r4) + tst r6,r6 + mov.l @(56,r5),r0 + bt LOCAL(movmem_done) + mov.l r0,@(56,r4) + cmp/pl r6 + mov.l @(52,r5),r0 + add #64,r5 + mov.l r0,@(52,r4) + add #64,r4 + bt GLOBAL(movmemSI52) ! done all the large groups, do the remainder - ! jump to movmem+ -done: - add #64,r5 - mova GLOBAL(movmemSI0),r0 - shll2 r6 + mova GLOBAL(movmemSI4)+4,r0 add r6,r0 jmp @r0 - add #64,r4 - .align 4 +LOCAL(movmem_done): ! share slot insn, works out aligned. + lds.l @r15+,pr + mov.l r0,@(56,r4) + mov.l @(52,r5),r0 + rts + mov.l r0,@(52,r4) + .balign 4 ! ??? We need aliases movstr* for movmem* for the older libraries. These ! aliases will be removed at the some point in the future. .global GLOBAL(movmemSI64) - FUNC(GLOBAL(movmemSI64)) - ALIAS(movstrSI64,movmemSI64) + HIDDEN_FUNC(GLOBAL(movmemSI64)) + HIDDEN_ALIAS(movstrSI64,movmemSI64) GLOBAL(movmemSI64): mov.l @(60,r5),r0 mov.l r0,@(60,r4) .global GLOBAL(movmemSI60) - FUNC(GLOBAL(movmemSI60)) - ALIAS(movstrSI60,movmemSI60) + HIDDEN_FUNC(GLOBAL(movmemSI60)) + HIDDEN_ALIAS(movstrSI60,movmemSI60) GLOBAL(movmemSI60): mov.l @(56,r5),r0 mov.l r0,@(56,r4) .global GLOBAL(movmemSI56) - FUNC(GLOBAL(movmemSI56)) - ALIAS(movstrSI56,movmemSI56) + HIDDEN_FUNC(GLOBAL(movmemSI56)) + HIDDEN_ALIAS(movstrSI56,movmemSI56) GLOBAL(movmemSI56): mov.l @(52,r5),r0 mov.l r0,@(52,r4) .global GLOBAL(movmemSI52) - FUNC(GLOBAL(movmemSI52)) - ALIAS(movstrSI52,movmemSI52) + HIDDEN_FUNC(GLOBAL(movmemSI52)) + HIDDEN_ALIAS(movstrSI52,movmemSI52) GLOBAL(movmemSI52): mov.l @(48,r5),r0 mov.l r0,@(48,r4) .global GLOBAL(movmemSI48) - FUNC(GLOBAL(movmemSI48)) - ALIAS(movstrSI48,movmemSI48) + HIDDEN_FUNC(GLOBAL(movmemSI48)) + HIDDEN_ALIAS(movstrSI48,movmemSI48) GLOBAL(movmemSI48): mov.l @(44,r5),r0 mov.l r0,@(44,r4) .global GLOBAL(movmemSI44) - FUNC(GLOBAL(movmemSI44)) - ALIAS(movstrSI44,movmemSI44) + HIDDEN_FUNC(GLOBAL(movmemSI44)) + HIDDEN_ALIAS(movstrSI44,movmemSI44) GLOBAL(movmemSI44): mov.l @(40,r5),r0 mov.l r0,@(40,r4) .global GLOBAL(movmemSI40) - FUNC(GLOBAL(movmemSI40)) - ALIAS(movstrSI40,movmemSI40) + HIDDEN_FUNC(GLOBAL(movmemSI40)) + HIDDEN_ALIAS(movstrSI40,movmemSI40) GLOBAL(movmemSI40): mov.l @(36,r5),r0 mov.l r0,@(36,r4) .global GLOBAL(movmemSI36) - FUNC(GLOBAL(movmemSI36)) - ALIAS(movstrSI36,movmemSI36) + HIDDEN_FUNC(GLOBAL(movmemSI36)) + HIDDEN_ALIAS(movstrSI36,movmemSI36) GLOBAL(movmemSI36): mov.l @(32,r5),r0 mov.l r0,@(32,r4) .global GLOBAL(movmemSI32) - FUNC(GLOBAL(movmemSI32)) - ALIAS(movstrSI32,movmemSI32) + HIDDEN_FUNC(GLOBAL(movmemSI32)) + HIDDEN_ALIAS(movstrSI32,movmemSI32) GLOBAL(movmemSI32): mov.l @(28,r5),r0 mov.l r0,@(28,r4) .global GLOBAL(movmemSI28) - FUNC(GLOBAL(movmemSI28)) - ALIAS(movstrSI28,movmemSI28) + HIDDEN_FUNC(GLOBAL(movmemSI28)) + HIDDEN_ALIAS(movstrSI28,movmemSI28) GLOBAL(movmemSI28): mov.l @(24,r5),r0 mov.l r0,@(24,r4) .global GLOBAL(movmemSI24) - FUNC(GLOBAL(movmemSI24)) - ALIAS(movstrSI24,movmemSI24) + HIDDEN_FUNC(GLOBAL(movmemSI24)) + HIDDEN_ALIAS(movstrSI24,movmemSI24) GLOBAL(movmemSI24): mov.l @(20,r5),r0 mov.l r0,@(20,r4) .global GLOBAL(movmemSI20) - FUNC(GLOBAL(movmemSI20)) - ALIAS(movstrSI20,movmemSI20) + HIDDEN_FUNC(GLOBAL(movmemSI20)) + HIDDEN_ALIAS(movstrSI20,movmemSI20) GLOBAL(movmemSI20): mov.l @(16,r5),r0 mov.l r0,@(16,r4) .global GLOBAL(movmemSI16) - FUNC(GLOBAL(movmemSI16)) - ALIAS(movstrSI16,movmemSI16) + HIDDEN_FUNC(GLOBAL(movmemSI16)) + HIDDEN_ALIAS(movstrSI16,movmemSI16) GLOBAL(movmemSI16): mov.l @(12,r5),r0 mov.l r0,@(12,r4) .global GLOBAL(movmemSI12) - FUNC(GLOBAL(movmemSI12)) - ALIAS(movstrSI12,movmemSI12) + HIDDEN_FUNC(GLOBAL(movmemSI12)) + HIDDEN_ALIAS(movstrSI12,movmemSI12) GLOBAL(movmemSI12): mov.l @(8,r5),r0 mov.l r0,@(8,r4) .global GLOBAL(movmemSI8) - FUNC(GLOBAL(movmemSI8)) - ALIAS(movstrSI8,movmemSI8) + HIDDEN_FUNC(GLOBAL(movmemSI8)) + HIDDEN_ALIAS(movstrSI8,movmemSI8) GLOBAL(movmemSI8): mov.l @(4,r5),r0 mov.l r0,@(4,r4) .global GLOBAL(movmemSI4) - FUNC(GLOBAL(movmemSI4)) - ALIAS(movstrSI4,movmemSI4) + HIDDEN_FUNC(GLOBAL(movmemSI4)) + HIDDEN_ALIAS(movstrSI4,movmemSI4) GLOBAL(movmemSI4): mov.l @(0,r5),r0 - mov.l r0,@(0,r4) - .global GLOBAL(movmemSI0) - FUNC(GLOBAL(movmemSI0)) - ALIAS(movstrSI0,movmemSI0) -GLOBAL(movmemSI0): rts - nop + mov.l r0,@(0,r4) ENDFUNC(GLOBAL(movmemSI64)) ENDFUNC(GLOBAL(movmemSI60)) @@ -851,71 +874,7 @@ GLOBAL(movmemSI0): ENDFUNC(GLOBAL(movmemSI12)) ENDFUNC(GLOBAL(movmemSI8)) ENDFUNC(GLOBAL(movmemSI4)) - ENDFUNC(GLOBAL(movmemSI0)) - - .align 4 - - .global GLOBAL(movmem) - FUNC(GLOBAL(movmem)) - ALIAS(movstr,movmem) -GLOBAL(movmem): - mov.l @(60,r5),r0 - mov.l r0,@(60,r4) - - mov.l @(56,r5),r0 - mov.l r0,@(56,r4) - - mov.l @(52,r5),r0 - mov.l r0,@(52,r4) - - mov.l @(48,r5),r0 - mov.l r0,@(48,r4) - - mov.l @(44,r5),r0 - mov.l r0,@(44,r4) - - mov.l @(40,r5),r0 - mov.l r0,@(40,r4) - - mov.l @(36,r5),r0 - mov.l r0,@(36,r4) - - mov.l @(32,r5),r0 - mov.l r0,@(32,r4) - - mov.l @(28,r5),r0 - mov.l r0,@(28,r4) - - mov.l @(24,r5),r0 - mov.l r0,@(24,r4) - - mov.l @(20,r5),r0 - mov.l r0,@(20,r4) - - mov.l @(16,r5),r0 - mov.l r0,@(16,r4) - - mov.l @(12,r5),r0 - mov.l r0,@(12,r4) - - mov.l @(8,r5),r0 - mov.l r0,@(8,r4) - - mov.l @(4,r5),r0 - mov.l r0,@(4,r4) - - mov.l @(0,r5),r0 - mov.l r0,@(0,r4) - - add #-16,r6 - cmp/pl r6 - bf done - - add #64,r5 - bra GLOBAL(movmem) - add #64,r4 - - FUNC(GLOBAL(movmem)) + ENDFUNC(GLOBAL(movmem)) #endif #ifdef L_movmem_i4 @@ -924,13 +883,13 @@ GLOBAL(movmem): .global GLOBAL(movmem_i4_odd) .global GLOBAL(movmemSI12_i4) - FUNC(GLOBAL(movmem_i4_even)) - FUNC(GLOBAL(movmem_i4_odd)) - FUNC(GLOBAL(movmemSI12_i4)) + HIDDEN_FUNC(GLOBAL(movmem_i4_even)) + HIDDEN_FUNC(GLOBAL(movmem_i4_odd)) + HIDDEN_FUNC(GLOBAL(movmemSI12_i4)) - ALIAS(movstr_i4_even,movmem_i4_even) - ALIAS(movstr_i4_odd,movmem_i4_odd) - ALIAS(movstrSI12_i4,movmemSI12_i4) + HIDDEN_ALIAS(movstr_i4_even,movmem_i4_even) + HIDDEN_ALIAS(movstr_i4_odd,movmem_i4_odd) + HIDDEN_ALIAS(movstrSI12_i4,movmemSI12_i4) .p2align 5 L_movmem_2mod4_end: @@ -991,7 +950,7 @@ GLOBAL(movmemSI12_i4): .global GLOBAL(mulsi3) - FUNC(GLOBAL(mulsi3)) + HIDDEN_FUNC(GLOBAL(mulsi3)) ! r4 = aabb ! r5 = ccdd @@ -1024,7 +983,7 @@ hiset: sts macl,r0 ! r0 = bb*dd rts add r2,r0 - FUNC(GLOBAL(mulsi3)) + ENDFUNC(GLOBAL(mulsi3)) #endif #endif /* ! __SH5__ */ #ifdef L_sdivsi3_i4 @@ -1034,7 +993,7 @@ hiset: sts macl,r0 ! r0 = bb*dd !! args in r4 and r5, result in fpul, clobber dr0, dr2 .global GLOBAL(sdivsi3_i4) - FUNC(GLOBAL(sdivsi3_i4)) + HIDDEN_FUNC(GLOBAL(sdivsi3_i4)) GLOBAL(sdivsi3_i4): lds r4,fpul float fpul,dr0 @@ -1053,7 +1012,7 @@ GLOBAL(sdivsi3_i4): .mode SHcompact #endif .global GLOBAL(sdivsi3_i4) - FUNC(GLOBAL(sdivsi3_i4)) + HIDDEN_FUNC(GLOBAL(sdivsi3_i4)) GLOBAL(sdivsi3_i4): sts.l fpscr,@-r15 mov #8,r2 @@ -1086,7 +1045,6 @@ GLOBAL(sdivsi3_i4): !! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit .global GLOBAL(sdivsi3) - FUNC(GLOBAL(sdivsi3)) #if __SHMEDIA__ #if __SH5__ == 32 .section .text..SHmedia32,"ax" @@ -1152,7 +1110,7 @@ LOCAL(sdivsi3_dontadd): muls.l r0, r2, r0 add.l r0, r63, r0 blink tr0, r63 -#else /* ! 0 */ +#elif 0 /* ! 0 */ // inputs: r4,r5 // clobbered: r1,r2,r3,r18,r19,r20,r21,r25,tr0 // result in r0 @@ -1214,6 +1172,65 @@ GLOBAL(sdivsi3): add.l r19,r25,r0 xor r0,r18,r0 blink tr0,r63 +#else /* ! 0 && ! 0 */ + + // inputs: r4,r5 + // clobbered: r1,r18,r19,r20,r21,r25,tr0 + // result in r0 + HIDDEN_FUNC(GLOBAL(sdivsi3_2)) +#ifndef __pic__ + FUNC(GLOBAL(sdivsi3)) +GLOBAL(sdivsi3): /* this is the shcompact entry point */ + // The special SHmedia entry point sdivsi3_1 prevents accidental linking + // with the SHcompact implementation, which clobbers tr1 / tr2. + .global GLOBAL(sdivsi3_1) +GLOBAL(sdivsi3_1): + .global GLOBAL(div_table_internal) + movi (GLOBAL(div_table_internal) >> 16) & 65535, r20 + shori GLOBAL(div_table_internal) & 65535, r20 +#endif + .global GLOBAL(sdivsi3_2) + // div_table in r20 + // clobbered: r1,r18,r19,r21,r25,tr0 +GLOBAL(sdivsi3_2): + nsb r5, r1 + shlld r5, r1, r25 // normalize; [-2 ..1, 1..2) in s2.62 + shari r25, 58, r21 // extract 5(6) bit index (s2.4 with hole -1..1) + ldx.ub r20, r21, r19 // u0.8 + shari r25, 32, r25 // normalize to s2.30 + shlli r21, 1, r21 + muls.l r25, r19, r19 // s2.38 + ldx.w r20, r21, r21 // s2.14 + ptabs r18, tr0 + shari r19, 24, r19 // truncate to s2.14 + sub r21, r19, r19 // some 11 bit inverse in s1.14 + muls.l r19, r19, r21 // u0.28 + sub r63, r1, r1 + addi r1, 92, r1 + muls.l r25, r21, r18 // s2.58 + shlli r19, 45, r19 // multiply by two and convert to s2.58 + /* bubble */ + sub r19, r18, r18 + shari r18, 28, r18 // some 22 bit inverse in s1.30 + muls.l r18, r25, r0 // s2.60 + muls.l r18, r4, r25 // s32.30 + /* bubble */ + shari r0, 16, r19 // s-16.44 + muls.l r19, r18, r19 // s-16.74 + shari r25, 63, r0 + shari r4, 14, r18 // s19.-14 + shari r19, 30, r19 // s-16.44 + muls.l r19, r18, r19 // s15.30 + xor r21, r0, r21 // You could also use the constant 1 << 27. + add r21, r25, r21 + sub r21, r19, r21 + shard r21, r1, r21 + sub r21, r0, r0 + blink tr0, r63 +#ifndef __pic__ + ENDFUNC(GLOBAL(sdivsi3)) +#endif + ENDFUNC(GLOBAL(sdivsi3_2)) #endif #elif defined __SHMEDIA__ /* m5compact-nofpu */ @@ -1221,6 +1238,7 @@ GLOBAL(sdivsi3): .mode SHmedia .section .text..SHmedia32,"ax" .align 2 + FUNC(GLOBAL(sdivsi3)) GLOBAL(sdivsi3): pt/l LOCAL(sdivsi3_dontsub), tr0 pt/l LOCAL(sdivsi3_loop), tr1 @@ -1245,7 +1263,9 @@ LOCAL(sdivsi3_dontsub): xor r20,r19,r20 sub.l r20,r19,r0 blink tr2,r63 + ENDFUNC(GLOBAL(sdivsi3)) #else /* ! __SHMEDIA__ */ + FUNC(GLOBAL(sdivsi3)) GLOBAL(sdivsi3): mov r4,r1 mov r5,r0 @@ -1343,7 +1363,7 @@ div0: rts !! and t bit .global GLOBAL(udivsi3_i4) - FUNC(GLOBAL(udivsi3_i4)) + HIDDEN_FUNC(GLOBAL(udivsi3_i4)) GLOBAL(udivsi3_i4): mov #1,r1 cmp/hi r1,r5 @@ -1390,7 +1410,7 @@ L1: !! args in r4 and r5, result in fpul, clobber r20, r21, dr0, fr33 .mode SHmedia .global GLOBAL(udivsi3_i4) - FUNC(GLOBAL(udivsi3_i4)) + HIDDEN_FUNC(GLOBAL(udivsi3_i4)) GLOBAL(udivsi3_i4): addz.l r4,r63,r20 addz.l r5,r63,r21 @@ -1410,6 +1430,7 @@ GLOBAL(udivsi3_i4): !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 .global GLOBAL(udivsi3_i4) + HIDDEN_FUNC(GLOBAL(udivsi3_i4)) GLOBAL(udivsi3_i4): mov #1,r1 cmp/hi r1,r5 @@ -1469,7 +1490,7 @@ L1: !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit .global GLOBAL(udivsi3) - FUNC(GLOBAL(udivsi3)) + HIDDEN_FUNC(GLOBAL(udivsi3)) #if __SHMEDIA__ #if __SH5__ == 32 @@ -1671,6 +1692,7 @@ LOCAL(large_divisor): .global GLOBAL(udivdi3) FUNC(GLOBAL(udivdi3)) GLOBAL(udivdi3): + HIDDEN_ALIAS(udivdi3_internal,udivdi3) shlri r3,1,r4 nsb r4,r22 shlld r3,r22,r6 @@ -1798,7 +1820,7 @@ LOCAL(no_lo_adj): .global GLOBAL(divdi3) FUNC(GLOBAL(divdi3)) GLOBAL(divdi3): - pta GLOBAL(udivdi3),tr0 + pta GLOBAL(udivdi3_internal),tr0 shari r2,63,r22 shari r3,63,r23 xor r2,r22,r2 @@ -1822,6 +1844,7 @@ GLOBAL(divdi3): .global GLOBAL(umoddi3) FUNC(GLOBAL(umoddi3)) GLOBAL(umoddi3): + HIDDEN_ALIAS(umoddi3_internal,umoddi3) shlri r3,1,r4 nsb r4,r22 shlld r3,r22,r6 @@ -1950,7 +1973,7 @@ LOCAL(no_lo_adj): .global GLOBAL(moddi3) FUNC(GLOBAL(moddi3)) GLOBAL(moddi3): - pta GLOBAL(umoddi3),tr0 + pta GLOBAL(umoddi3_internal),tr0 shari r2,63,r22 shari r3,63,r23 xor r2,r22,r2 @@ -1973,7 +1996,7 @@ GLOBAL(moddi3): .mode SHcompact #endif .global GLOBAL(set_fpscr) - FUNC(GLOBAL(set_fpscr)) + HIDDEN_FUNC(GLOBAL(set_fpscr)) GLOBAL(set_fpscr): lds r4,fpscr #ifdef __PIC__ @@ -2041,7 +2064,7 @@ LOCAL(set_fpscr_L1): .section .text..SHmedia32,"ax" .align 2 .global GLOBAL(init_trampoline) - FUNC(GLOBAL(init_trampoline)) + HIDDEN_FUNC(GLOBAL(init_trampoline)) GLOBAL(init_trampoline): st.l r0,8,r2 #ifdef __LITTLE_ENDIAN__ @@ -2057,8 +2080,9 @@ GLOBAL(init_trampoline): #endif st.q r0,0,r20 st.l r0,12,r3 + ENDFUNC(GLOBAL(init_trampoline)) .global GLOBAL(ic_invalidate) - FUNC(GLOBAL(ic_invalidate)) + HIDDEN_FUNC(GLOBAL(ic_invalidate)) GLOBAL(ic_invalidate): ocbwb r0,0 synco @@ -2066,65 +2090,123 @@ GLOBAL(ic_invalidate): ptabs r18, tr0 synci blink tr0, r63 - ENDFUNC(GLOBAL(ic_invalidate)) - ENDFUNC(GLOBAL(init_trampoline)) #elif defined(__SH4A__) .global GLOBAL(ic_invalidate) - FUNC(GLOBAL(ic_invalidate)) + HIDDEN_FUNC(GLOBAL(ic_invalidate)) GLOBAL(ic_invalidate): ocbwb @r4 synco rts icbi @r4 ENDFUNC(GLOBAL(ic_invalidate)) -#elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) - /* This assumes a direct-mapped cache, which is the case for - the first SH4, but not for the second version of SH4, that - uses a 2-way set-associative cache, nor SH4a, that is 4-way. - SH4a fortunately offers an instruction to invalidate the - instruction cache, and we use it above, but SH4 doesn't. - However, since the libraries don't contain any nested - functions (the only case in which GCC would emit this pattern) - and we actually emit the ic_invalidate_line_i pattern for - cache invalidation on all SH4 multilibs (even 4-nofpu, that - isn't even corevered here), and pre-SH4 cores don't have - caches, it seems like this code is pointless, unless it's - meant for backward binary compatibility or for userland-only - cache invalidation for say sh4-*-linux-gnu. Such a feature - should probably be moved into a system call, such that the - kernel could do whatever it takes to invalidate a cache line - on the core it's actually running on. I.e., this hideous :-) - piece of code should go away at some point. */ - +#elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) || (defined(__SH4_NOFPU__) && !defined(__SH5__)) + /* For system code, we use ic_invalidate_line_i, but user code + needs a different mechanism. A kernel call is generally not + available, and it would also be slow. Different SH4 variants use + different sizes and associativities of the Icache. We use a small + bit of dispatch code that can be put hidden in every shared object, + which calls the actual processor-specific invalidation code in a + separate module. + Or if you have operating system support, the OS could mmap the + procesor-specific code from a single page, since it is highly + repetitive. */ .global GLOBAL(ic_invalidate) - FUNC(GLOBAL(ic_invalidate)) + HIDDEN_FUNC(GLOBAL(ic_invalidate)) GLOBAL(ic_invalidate): - ocbwb @r4 + mov.l 0f,r1 +#ifdef __pic__ mova 0f,r0 - mov.w 1f,r1 -/* Compute how many cache lines 0f is away from r4. */ - sub r0,r4 - and r1,r4 -/* Prepare to branch to 0f plus the cache-line offset. */ - add # 0f - 1f,r4 - braf r4 - nop -1: - .short 0x1fe0 + mov.l 1f,r2 + add r1,r0 + mov.l @(r0,r2),r1 +#endif + ocbwb @r4 + mov.l @(8,r1),r0 + sub r1,r4 + and r4,r0 + add r1,r0 + jmp @r0 + mov.l @(4,r1),r0 +#ifndef __pic__ +0: .long GLOBAL(ic_invalidate_array) +#else /* __pic__ */ + .global GLOBAL(ic_invalidate_array) + /* ??? Why won't the assembler allow to add these two constants? */ +0: .long _GLOBAL_OFFSET_TABLE_ +1: .long GLOBAL(ic_invalidate_array)@GOT + ENDFUNC(GLOBAL(ic_invalidate)) +#endif /* __pic__ */ +#endif /* SH4 */ +#endif /* L_ic_invalidate */ + +#ifdef L_ic_invalidate_array +#if defined(__SH4A__) + /* This is needed when an SH4 dso with trampolines is used on SH4A. */ + .global GLOBAL(ic_invalidate_array) + FUNC(GLOBAL(ic_invalidate_array)) +GLOBAL(ic_invalidate_array): + add r1,r4 + synco + rts + icbi @r4 + .long 0 + ENDFUNC(GLOBAL(ic_invalidate_array)) +#elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) || (defined(__SH4_NOFPU__) && !defined(__SH5__)) + .global GLOBAL(ic_invalidate_array) .p2align 5 + FUNC(GLOBAL(ic_invalidate_array)) /* This must be aligned to the beginning of a cache line. */ -0: - .rept 256 /* There are 256 cache lines of 32 bytes. */ +GLOBAL(ic_invalidate_array): +#ifndef WAYS +#define WAYS 4 +#define WAY_SIZE 0x4000 +#endif +#if WAYS == 1 + .rept WAY_SIZE * WAYS / 32 + rts + nop + .rept 7 + .long WAY_SIZE - 32 + .endr + .endr +#elif WAYS <= 6 + .rept WAY_SIZE * WAYS / 32 + braf r0 + add #-8,r0 + .long WAY_SIZE + 8 + .long WAY_SIZE - 32 + .rept WAYS-2 + braf r0 + nop + .endr + .rept 7 - WAYS + rts + nop + .endr + .endr +#else /* WAYS > 6 */ + /* This variant needs two different pages for mmap-ing. */ + .rept WAYS-1 + .rept WAY_SIZE / 32 + braf r0 + nop + .long WAY_SIZE + .rept 6 + .long WAY_SIZE - 32 + .endr + .endr + .endr + .rept WAY_SIZE / 32 rts .rept 15 nop .endr .endr - - ENDFUNC(GLOBAL(ic_invalidate)) +#endif /* WAYS */ + ENDFUNC(GLOBAL(ic_invalidate_array)) #endif /* SH4 */ -#endif /* L_ic_invalidate */ +#endif /* L_ic_invalidate_array */ #if defined (__SH5__) && __SH5__ == 32 #ifdef L_shcompact_call_trampoline @@ -2546,7 +2628,7 @@ LOCAL(ct_ret_wide): /* Call the function, so that we can unpack its .section .text..SHmedia32, "ax" .align 2 .global GLOBAL(GCC_shcompact_return_trampoline) - FUNC(GLOBAL(GCC_shcompact_return_trampoline)) + HIDDEN_FUNC(GLOBAL(GCC_shcompact_return_trampoline)) GLOBAL(GCC_shcompact_return_trampoline): ptabs/l r18, tr0 #if __LITTLE_ENDIAN__ @@ -2614,7 +2696,7 @@ LOCAL(ia_main_table): actual bit pattern. */ .global GLOBAL(GCC_shcompact_incoming_args) - FUNC(GLOBAL(GCC_shcompact_incoming_args)) + FUNC(GLOBAL(GCC_shcompact_incoming_args)) GLOBAL(GCC_shcompact_incoming_args): ptabs/l r18, tr0 /* Prepare to return. */ shlri r17, 32, r0 /* Load the cookie. */ @@ -2779,7 +2861,7 @@ LOCAL(ia_end_of_push_seq): /* Label used to compute the first push instruction. #endif .align 3 /* It is copied in units of 8 bytes in SHmedia mode. */ .global GLOBAL(GCC_nested_trampoline) - FUNC(GLOBAL(GCC_nested_trampoline)) + HIDDEN_FUNC(GLOBAL(GCC_nested_trampoline)) GLOBAL(GCC_nested_trampoline): .mode SHmedia ptrel/u r63, tr0 @@ -2824,10 +2906,11 @@ GLOBAL(GCC_push_shmedia_regs): fst.d r15, 2*8, dr40 fst.d r15, 1*8, dr38 fst.d r15, 0*8, dr36 -#endif +#else /* ! __SH4_NOFPU__ */ .global GLOBAL(GCC_push_shmedia_regs_nofpu) FUNC(GLOBAL(GCC_push_shmedia_regs_nofpu)) GLOBAL(GCC_push_shmedia_regs_nofpu): +#endif /* ! __SH4_NOFPU__ */ ptabs/l r18, tr0 addi.l r15, -27*8, r15 gettr tr7, r62 @@ -2861,12 +2944,12 @@ GLOBAL(GCC_push_shmedia_regs_nofpu): st.q r15, 1*8, r29 st.q r15, 0*8, r28 blink tr0, r63 - #ifndef __SH4_NOFPU__ ENDFUNC(GLOBAL(GCC_push_shmedia_regs)) -#endif +#else ENDFUNC(GLOBAL(GCC_push_shmedia_regs_nofpu)) -#ifndef __SH4_NOFPU__ +#endif +#ifndef __SH4_NOFPU__ .global GLOBAL(GCC_pop_shmedia_regs) FUNC(GLOBAL(GCC_pop_shmedia_regs)) GLOBAL(GCC_pop_shmedia_regs): @@ -2887,10 +2970,11 @@ GLOBAL(GCC_pop_shmedia_regs): fld.d r15, 28*8, dr38 fld.d r15, 27*8, dr36 blink tr1, r63 -#endif +#else /* ! __SH4_NOFPU__ */ .global GLOBAL(GCC_pop_shmedia_regs_nofpu) FUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu)) GLOBAL(GCC_pop_shmedia_regs_nofpu): +#endif /* ! __SH4_NOFPU__ */ movi 27*8, r0 .L0: ptabs r18, tr0 @@ -2929,7 +3013,239 @@ GLOBAL(GCC_pop_shmedia_regs_nofpu): #ifndef __SH4_NOFPU__ ENDFUNC(GLOBAL(GCC_pop_shmedia_regs)) -#endif +#else ENDFUNC(GLOBAL(GCC_pop_shmedia_regs_nofpu)) +#endif #endif /* __SH5__ == 32 */ #endif /* L_push_pop_shmedia_regs */ + +#if __SH5__ +#ifdef L_div_table +#if defined(__pic__) && defined(__SHMEDIA__) + .global GLOBAL(sdivsi3) + FUNC(GLOBAL(sdivsi3)) +#if __SH5__ == 32 + .section .text..SHmedia32,"ax" +#else + .text +#endif +#if 0 +/* ??? FIXME: Presumably due to a linker bug, exporting data symbols + in a text section does not work (at least for shared libraries): + the linker sets the LSB of the address as if this was SHmedia code. */ +#define TEXT_DATA_BUG +#endif + .align 2 + // inputs: r4,r5 + // clobbered: r1,r18,r19,r20,r21,r25,tr0 + // result in r0 + .global GLOBAL(sdivsi3) +GLOBAL(sdivsi3): +#ifdef TEXT_DATA_BUG + ptb datalabel Local_div_table,tr0 +#else + ptb GLOBAL(div_table_internal),tr0 +#endif + nsb r5, r1 + shlld r5, r1, r25 // normalize; [-2 ..1, 1..2) in s2.62 + shari r25, 58, r21 // extract 5(6) bit index (s2.4 with hole -1..1) + /* bubble */ + gettr tr0,r20 + ldx.ub r20, r21, r19 // u0.8 + shari r25, 32, r25 // normalize to s2.30 + shlli r21, 1, r21 + muls.l r25, r19, r19 // s2.38 + ldx.w r20, r21, r21 // s2.14 + ptabs r18, tr0 + shari r19, 24, r19 // truncate to s2.14 + sub r21, r19, r19 // some 11 bit inverse in s1.14 + muls.l r19, r19, r21 // u0.28 + sub r63, r1, r1 + addi r1, 92, r1 + muls.l r25, r21, r18 // s2.58 + shlli r19, 45, r19 // multiply by two and convert to s2.58 + /* bubble */ + sub r19, r18, r18 + shari r18, 28, r18 // some 22 bit inverse in s1.30 + muls.l r18, r25, r0 // s2.60 + muls.l r18, r4, r25 // s32.30 + /* bubble */ + shari r0, 16, r19 // s-16.44 + muls.l r19, r18, r19 // s-16.74 + shari r25, 63, r0 + shari r4, 14, r18 // s19.-14 + shari r19, 30, r19 // s-16.44 + muls.l r19, r18, r19 // s15.30 + xor r21, r0, r21 // You could also use the constant 1 << 27. + add r21, r25, r21 + sub r21, r19, r21 + shard r21, r1, r21 + sub r21, r0, r0 + blink tr0, r63 + ENDFUNC(GLOBAL(sdivsi3)) +/* This table has been generated by divtab.c . +Defects for bias -330: + Max defect: 6.081536e-07 at -1.000000e+00 + Min defect: 2.849516e-08 at 1.030651e+00 + Max 2nd step defect: 9.606539e-12 at -1.000000e+00 + Min 2nd step defect: 0.000000e+00 at 0.000000e+00 + Defect at 1: 1.238659e-07 + Defect at -2: 1.061708e-07 */ +#else /* ! __pic__ || ! __SHMEDIA__ */ + .section .rodata +#endif /* __pic__ */ +#if defined(TEXT_DATA_BUG) && defined(__pic__) && defined(__SHMEDIA__) + .balign 2 + .type Local_div_table,@object + .size Local_div_table,128 +/* negative division constants */ + .word -16638 + .word -17135 + .word -17737 + .word -18433 + .word -19103 + .word -19751 + .word -20583 + .word -21383 + .word -22343 + .word -23353 + .word -24407 + .word -25582 + .word -26863 + .word -28382 + .word -29965 + .word -31800 +/* negative division factors */ + .byte 66 + .byte 70 + .byte 75 + .byte 81 + .byte 87 + .byte 93 + .byte 101 + .byte 109 + .byte 119 + .byte 130 + .byte 142 + .byte 156 + .byte 172 + .byte 192 + .byte 214 + .byte 241 + .skip 16 +Local_div_table: + .skip 16 +/* positive division factors */ + .byte 241 + .byte 214 + .byte 192 + .byte 172 + .byte 156 + .byte 142 + .byte 130 + .byte 119 + .byte 109 + .byte 101 + .byte 93 + .byte 87 + .byte 81 + .byte 75 + .byte 70 + .byte 66 +/* positive division constants */ + .word 31801 + .word 29966 + .word 28383 + .word 26864 + .word 25583 + .word 24408 + .word 23354 + .word 22344 + .word 21384 + .word 20584 + .word 19752 + .word 19104 + .word 18434 + .word 17738 + .word 17136 + .word 16639 + .section .rodata +#endif /* TEXT_DATA_BUG */ + .balign 2 + .type GLOBAL(div_table),@object + .size GLOBAL(div_table),128 +/* negative division constants */ + .word -16638 + .word -17135 + .word -17737 + .word -18433 + .word -19103 + .word -19751 + .word -20583 + .word -21383 + .word -22343 + .word -23353 + .word -24407 + .word -25582 + .word -26863 + .word -28382 + .word -29965 + .word -31800 +/* negative division factors */ + .byte 66 + .byte 70 + .byte 75 + .byte 81 + .byte 87 + .byte 93 + .byte 101 + .byte 109 + .byte 119 + .byte 130 + .byte 142 + .byte 156 + .byte 172 + .byte 192 + .byte 214 + .byte 241 + .skip 16 + .global GLOBAL(div_table) +GLOBAL(div_table): + HIDDEN_ALIAS(div_table_internal,div_table) + .skip 16 +/* positive division factors */ + .byte 241 + .byte 214 + .byte 192 + .byte 172 + .byte 156 + .byte 142 + .byte 130 + .byte 119 + .byte 109 + .byte 101 + .byte 93 + .byte 87 + .byte 81 + .byte 75 + .byte 70 + .byte 66 +/* positive division constants */ + .word 31801 + .word 29966 + .word 28383 + .word 26864 + .word 25583 + .word 24408 + .word 23354 + .word 22344 + .word 21384 + .word 20584 + .word 19752 + .word 19104 + .word 18434 + .word 17738 + .word 17136 + .word 16639 +#endif /* L_div_table */ +#endif /* __SH5__ */ diff --git a/gcc/config/sh/libgcc-excl.ver b/gcc/config/sh/libgcc-excl.ver index 1083ba2c20a..325c74054ec 100644 --- a/gcc/config/sh/libgcc-excl.ver +++ b/gcc/config/sh/libgcc-excl.ver @@ -3,5 +3,6 @@ __ashlsi3 __ashrsi3 __lshrsi3 + __mulsi3 # this is an SH1-only symbol. __udivsi3 } diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h index 412ce46d9cd..fe48d0ca0b1 100644 --- a/gcc/config/sh/linux.h +++ b/gcc/config/sh/linux.h @@ -48,7 +48,8 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (TARGET_CPU_DEFAULT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT) + (TARGET_CPU_DEFAULT | MASK_USERMODE | TARGET_ENDIAN_DEFAULT \ + | TARGET_OPT_DEFAULT) #define TARGET_ASM_FILE_END file_end_indicate_exec_stack @@ -104,3 +105,10 @@ Boston, MA 02111-1307, USA. */ #undef DBX_REGISTER_NUMBER #define DBX_REGISTER_NUMBER(REGNO) \ ((! TARGET_SH5 && (REGNO) == 16) ? 16 : SH_DBX_REGISTER_NUMBER (REGNO)) + +/* Since libgcc is compiled with -fpic for this target, we can't use + __sdivsi3_1 as the division strategy for -O0 and -Os. */ +#undef SH_DIV_STRATEGY_DEFAULT +#define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL2 +#undef SH_DIV_STR_FOR_SIZE +#define SH_DIV_STR_FOR_SIZE "call2" diff --git a/gcc/config/sh/little.h b/gcc/config/sh/little.h index 98c2bc27f68..c0ccbd7693c 100644 --- a/gcc/config/sh/little.h +++ b/gcc/config/sh/little.h @@ -19,4 +19,4 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_ENDIAN_DEFAULT LITTLE_ENDIAN_BIT +#define TARGET_ENDIAN_DEFAULT MASK_LITTLE_ENDIAN diff --git a/gcc/config/sh/netbsd-elf.h b/gcc/config/sh/netbsd-elf.h index b50344bdf50..92d7ae1e309 100644 --- a/gcc/config/sh/netbsd-elf.h +++ b/gcc/config/sh/netbsd-elf.h @@ -1,5 +1,5 @@ /* Definitions for SH running NetBSD using ELF - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. @@ -20,21 +20,21 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Run-time Target Specification. */ -#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT +#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN #define TARGET_VERSION_ENDIAN "le" #else #define TARGET_VERSION_ENDIAN "" #endif -#if TARGET_CPU_DEFAULT & SH5_BIT -#if TARGET_CPU_DEFAULT & SH_E_BIT +#if TARGET_CPU_DEFAULT & MASK_SH5 +#if TARGET_CPU_DEFAULT & MASK_SH_E #define TARGET_VERSION_CPU "sh5" #else #define TARGET_VERSION_CPU "sh64" -#endif /* SH_E_BIT */ +#endif /* MASK_SH_E */ #else #define TARGET_VERSION_CPU "sh" -#endif /* SH5_BIT */ +#endif /* MASK_SH5 */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (NetBSD/%s%s ELF)", \ @@ -80,7 +80,7 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ - (TARGET_CPU_DEFAULT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT) + (TARGET_CPU_DEFAULT | MASK_USERMODE | TARGET_ENDIAN_DEFAULT) /* Define because we use the label and we do not need them. */ #define NO_PROFILE_COUNTERS 1 @@ -89,15 +89,10 @@ Boston, MA 02111-1307, USA. */ #define FUNCTION_PROFILER(STREAM,LABELNO) \ do \ { \ - if (TARGET_SHMEDIA32) \ + if (TARGET_SHMEDIA32 || TARGET_SHMEDIA64) \ { \ /* FIXME */ \ - abort (); \ - } \ - else if (TARGET_SHMEDIA64) \ - { \ - /* FIXME */ \ - abort (); \ + sorry ("unimplemented-shmedia profiling"); \ } \ else \ { \ @@ -114,3 +109,10 @@ do \ } \ } \ while (0) + +/* Since libgcc is compiled with -fpic for this target, we can't use + __sdivsi3_1 as the division strategy for -O0 and -Os. */ +#undef SH_DIV_STRATEGY_DEFAULT +#define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL2 +#undef SH_DIV_STR_FOR_SIZE +#define SH_DIV_STR_FOR_SIZE "call2" diff --git a/gcc/config/sh/newlib.h b/gcc/config/sh/newlib.h new file mode 100644 index 00000000000..062cc7efe4b --- /dev/null +++ b/gcc/config/sh/newlib.h @@ -0,0 +1,26 @@ +/* Definitions of target machine for gcc for Super-H using sh-superh-elf. + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* This header file is used when with_libgloss is enabled during gcc + configuration. */ + +#undef LIB_SPEC +#define LIB_SPEC "-lc -lgloss" diff --git a/gcc/config/sh/predicates.md b/gcc/config/sh/predicates.md new file mode 100644 index 00000000000..981cc8f10f5 --- /dev/null +++ b/gcc/config/sh/predicates.md @@ -0,0 +1,38 @@ +(define_predicate "trapping_target_operand" + (match_code "if_then_else") +{ + rtx cond, mem, res, tar, and; + + if (GET_MODE (op) != PDImode) + return 0; + cond = XEXP (op, 0); + mem = XEXP (op, 1); + res = XEXP (op, 2); + if (GET_CODE (mem) != MEM + || (GET_CODE (res) != SIGN_EXTEND && GET_CODE (res) != TRUNCATE)) + return 0; + tar = XEXP (res, 0); + if (!rtx_equal_p (XEXP (mem, 0), tar) + || GET_MODE (tar) != Pmode) + return 0; + if (GET_CODE (cond) == CONST) + { + cond = XEXP (cond, 0); + if (!EXTRA_CONSTRAINT_Csy (tar)) + return 0; + if (GET_CODE (tar) == CONST) + tar = XEXP (tar, 0); + } + else if (!arith_reg_operand (tar, VOIDmode) + && ! EXTRA_CONSTRAINT_Csy (tar)) + return 0; + if (GET_CODE (cond) != EQ) + return 0; + and = XEXP (cond, 0); + return (GET_CODE (and) == AND + && rtx_equal_p (XEXP (and, 0), tar) + && GET_CODE (XEXP (and, 1)) == CONST_INT + && GET_CODE (XEXP (cond, 1)) == CONST_INT + && INTVAL (XEXP (and, 1)) == 3 + && INTVAL (XEXP (cond, 1)) == 3); +}) diff --git a/gcc/config/sh/sh-modes.def b/gcc/config/sh/sh-modes.def index c1520685451..e6315174640 100644 --- a/gcc/config/sh/sh-modes.def +++ b/gcc/config/sh/sh-modes.def @@ -1,5 +1,5 @@ /* Alpha extra machine modes. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. */ /* The SH uses a partial integer mode to represent the FPSCR register. */ PARTIAL_INT_MODE (SI); +/* PDI mode is used to represent a function address in a target register. */ +PARTIAL_INT_MODE (DI); /* Vector modes. */ VECTOR_MODE (INT, QI, 2); /* V2QI */ diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h index 039f8cb8913..d3644d87805 100644 --- a/gcc/config/sh/sh-protos.h +++ b/gcc/config/sh/sh-protos.h @@ -1,5 +1,6 @@ /* Definitions of target machine for GNU compiler for Renesas / SuperH SH. - Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004 + Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2003, + 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com). Improved by Jim Wilson (wilson@cygnus.com). @@ -24,6 +25,19 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_SH_PROTOS_H #define GCC_SH_PROTOS_H +enum sh_function_kind { + /* A function with normal C ABI */ + FUNCTION_ORDINARY, + /* A special function that guarantees that some otherwise call-clobbered + registers are not clobbered. These can't go through the SH5 resolver, + because it only saves argument passing registers. */ + SFUNC_GOT, + /* A special function that should be linked statically. These are typically + smaller or not much larger than a PLT entry. + Some also have a non-standard ABI which precludes dynamic linking. */ + SFUNC_STATIC +}; + #ifdef RTX_CODE extern rtx sh_fsca_sf2int (void); extern rtx sh_fsca_df2int (void); @@ -101,6 +115,7 @@ extern int sh_can_redirect_branch (rtx, rtx); extern void sh_expand_unop_v2sf (enum rtx_code, rtx, rtx); extern void sh_expand_binop_v2sf (enum rtx_code, rtx, rtx, rtx); extern int sh_expand_t_scc (enum rtx_code code, rtx target); +extern rtx sh_gen_truncate (enum machine_mode, rtx, int); extern bool sh_vector_mode_supported_p (enum machine_mode); #ifdef TREE_CODE extern void sh_va_start (tree, rtx); @@ -137,7 +152,7 @@ extern void fpscr_set_from_mem (int, HARD_REG_SET); extern void sh_pr_interrupt (struct cpp_reader *); extern void sh_pr_trapa (struct cpp_reader *); extern void sh_pr_nosave_low_regs (struct cpp_reader *); -extern rtx function_symbol (const char *); +extern rtx function_symbol (rtx, const char *, enum sh_function_kind); extern rtx sh_get_pr_initial_val (void); extern rtx sh_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); @@ -147,6 +162,12 @@ extern void sh_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, signed extern const char *sh_pch_valid_p (const void *data_p, size_t sz); extern bool sh_promote_prototypes (tree); +extern rtx replace_n_hard_rtx (rtx, rtx *, int , int); +extern int shmedia_cleanup_truncate (rtx *, void *); + +extern int sh_contains_memref_p (rtx); +extern rtx shmedia_prepare_call_address (rtx fnaddr, int is_sibcall); + #endif /* ! GCC_SH_PROTOS_H */ #ifdef SYMBIAN diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 9587b5373aa..a0b7862299f 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -52,6 +52,7 @@ Boston, MA 02111-1307, USA. */ #include "sched-int.h" #include "ggc.h" #include "tree-gimple.h" +#include "cfgloop.h" int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch; @@ -197,6 +198,7 @@ int assembler_dialect; static bool shmedia_space_reserved_for_target_registers; +static bool sh_handle_option (size_t, const char *, int); static void split_branches (rtx); static int branch_dest (rtx); static void force_into (rtx, rtx); @@ -265,6 +267,9 @@ static bool unspec_caller_rtx_p (rtx); static bool sh_cannot_copy_insn_p (rtx); static bool sh_rtx_costs (rtx, int, int, int *); static int sh_address_cost (rtx); +#ifdef TARGET_ADJUST_UNROLL_MAX +static int sh_adjust_unroll_max (struct loop *, int, int, int, int); +#endif static int shmedia_target_regs_stack_space (HARD_REG_SET *); static int shmedia_reserve_space_for_target_registers_p (int, HARD_REG_SET *); static int shmedia_target_regs_stack_adjust (HARD_REG_SET *); @@ -321,6 +326,11 @@ static int hard_regs_intersect_p (HARD_REG_SET *, HARD_REG_SET *); #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION sh_handle_option + #undef TARGET_INSERT_ATTRIBUTES #define TARGET_INSERT_ATTRIBUTES sh_insert_attributes @@ -480,8 +490,119 @@ static int hard_regs_intersect_p (HARD_REG_SET *, HARD_REG_SET *); #endif /* SYMBIAN */ +#ifdef TARGET_ADJUST_UNROLL_MAX +#undef TARGET_ADJUST_UNROLL_MAX +#define TARGET_ADJUST_UNROLL_MAX sh_adjust_unroll_max +#endif + struct gcc_target targetm = TARGET_INITIALIZER; +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +sh_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, + int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_m1: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH1; + return true; + + case OPT_m2: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2; + return true; + + case OPT_m2a: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A; + return true; + + case OPT_m2a_nofpu: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A_NOFPU; + return true; + + case OPT_m2a_single: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE; + return true; + + case OPT_m2a_single_only: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE_ONLY; + return true; + + case OPT_m2e: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2E; + return true; + + case OPT_m3: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH3; + return true; + + case OPT_m3e: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH3E; + return true; + + case OPT_m4: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4; + return true; + + case OPT_m4_nofpu: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4_NOFPU; + return true; + + case OPT_m4_single: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE; + return true; + + case OPT_m4_single_only: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE_ONLY; + return true; + + case OPT_m4a: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A; + return true; + + case OPT_m4a_nofpu: + case OPT_m4al: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A_NOFPU; + return true; + + case OPT_m4a_single: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE; + return true; + + case OPT_m4a_single_only: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE_ONLY; + return true; + + case OPT_m5_32media: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA; + return true; + + case OPT_m5_32media_nofpu: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA_NOFPU; + return true; + + case OPT_m5_64media: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA; + return true; + + case OPT_m5_64media_nofpu: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA_NOFPU; + return true; + + case OPT_m5_compact: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT; + return true; + + case OPT_m5_compact_nofpu: + target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT_NOFPU; + return true; + + default: + return true; + } +} + /* Print the operand address in x to the stream. */ void @@ -518,8 +639,7 @@ print_operand_address (FILE *stream, rtx x) } default: - debug_rtx (x); - abort (); + gcc_unreachable (); } } break; @@ -547,6 +667,7 @@ print_operand_address (FILE *stream, rtx x) '@' print trap, rte or rts depending upon pragma interruptness '#' output a nop if there is nothing to put in the delay slot ''' print likelihood suffix (/u for unlikely). + '>' print branch target if -fverbose-asm 'O' print a constant without the # 'R' print the LSW of a dp value - changes if in little endian 'S' print the MSW of a dp value - changes if in little endian @@ -555,12 +676,16 @@ print_operand_address (FILE *stream, rtx x) 'N' print 'r63' if the operand is (const_int 0). 'd' print a V2SF reg as dN instead of fpN. 'm' print a pair `base,offset' or `base,index', for LD and ST. + 'U' Likewise for {LD,ST}{HI,LO}. 'u' prints the lowest 16 bits of CONST_INT, as an unsigned value. 'o' output an operator. */ void print_operand (FILE *stream, rtx x, int code) { + int regno; + enum machine_mode mode; + switch (code) { case '.': @@ -593,6 +718,13 @@ print_operand (FILE *stream, rtx x, int code) fputs ("/u", stream); break; } + case '>': + if (flag_verbose_asm && JUMP_LABEL (current_output_insn)) + { + fputs ("\t! target: ", stream); + output_addr_const (stream, JUMP_LABEL (current_output_insn)); + } + break; case 'O': x = mark_constant_pool_use (x); output_addr_const (stream, x); @@ -646,9 +778,10 @@ print_operand (FILE *stream, rtx x, int code) break; case 'm': - if (GET_CODE (x) != MEM) - abort (); + gcc_assert (GET_CODE (x) == MEM); x = XEXP (x, 0); + /* Fall through. */ + case 'U': switch (GET_CODE (x)) { case REG: @@ -664,13 +797,12 @@ print_operand (FILE *stream, rtx x, int code) break; default: - abort (); + gcc_unreachable (); } break; case 'd': - if (GET_CODE (x) != REG || GET_MODE (x) != V2SFmode) - abort (); + gcc_assert (GET_CODE (x) == REG && GET_MODE (x) == V2SFmode); fprintf ((stream), "d%s", reg_names[REGNO (x)] + 1); break; @@ -692,36 +824,87 @@ print_operand (FILE *stream, rtx x, int code) default_output: default: + regno = 0; + mode = GET_MODE (x); + switch (GET_CODE (x)) { + case TRUNCATE: + { + rtx inner = XEXP (x, 0); + int offset = 0; + enum machine_mode inner_mode; + + /* We might see SUBREGs with vector mode registers inside. */ + if (GET_CODE (inner) == SUBREG + && (GET_MODE_SIZE (GET_MODE (inner)) + == GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner)))) + && subreg_lowpart_p (inner)) + inner = SUBREG_REG (inner); + if (GET_CODE (inner) == CONST_INT) + { + x = GEN_INT (trunc_int_for_mode (INTVAL (inner), GET_MODE (x))); + goto default_output; + } + inner_mode = GET_MODE (inner); + if (GET_CODE (inner) == SUBREG + && (GET_MODE_SIZE (GET_MODE (inner)) + < GET_MODE_SIZE (GET_MODE (SUBREG_REG (inner)))) + && GET_CODE (SUBREG_REG (inner)) == REG) + { + offset = subreg_regno_offset (REGNO (SUBREG_REG (inner)), + GET_MODE (SUBREG_REG (inner)), + SUBREG_BYTE (inner), + GET_MODE (inner)); + inner = SUBREG_REG (inner); + } + if (GET_CODE (inner) != REG || GET_MODE_SIZE (inner_mode) > 8) + abort (); + /* Floating point register pairs are always big endian; + general purpose registers are 64 bit wide. */ + regno = REGNO (inner); + regno = (HARD_REGNO_NREGS (regno, inner_mode) + - HARD_REGNO_NREGS (regno, mode)) + + offset; + x = inner; + goto reg; + } + case SIGN_EXTEND: + x = XEXP (x, 0); + goto reg; /* FIXME: We need this on SHmedia32 because reload generates some sign-extended HI or QI loads into DImode registers but, because Pmode is SImode, the address ends up with a subreg:SI of the DImode register. Maybe reload should be fixed so as to apply alter_subreg to such loads? */ + case IF_THEN_ELSE: + gcc_assert (trapping_target_operand (x, VOIDmode)); + x = XEXP (XEXP (x, 2), 0); + goto default_output; case SUBREG: - if (SUBREG_BYTE (x) != 0 - || GET_CODE (SUBREG_REG (x)) != REG) - abort (); + gcc_assert (SUBREG_BYTE (x) == 0 + && GET_CODE (SUBREG_REG (x)) == REG); x = SUBREG_REG (x); /* Fall through. */ + reg: case REG: - if (FP_REGISTER_P (REGNO (x)) - && GET_MODE (x) == V16SFmode) - fprintf ((stream), "mtrx%s", reg_names[REGNO (x)] + 2); + regno += REGNO (x); + if (FP_REGISTER_P (regno) + && mode == V16SFmode) + fprintf ((stream), "mtrx%s", reg_names[regno] + 2); else if (FP_REGISTER_P (REGNO (x)) - && GET_MODE (x) == V4SFmode) - fprintf ((stream), "fv%s", reg_names[REGNO (x)] + 2); + && mode == V4SFmode) + fprintf ((stream), "fv%s", reg_names[regno] + 2); else if (GET_CODE (x) == REG - && GET_MODE (x) == V2SFmode) - fprintf ((stream), "fp%s", reg_names[REGNO (x)] + 2); + && mode == V2SFmode) + fprintf ((stream), "fp%s", reg_names[regno] + 2); else if (FP_REGISTER_P (REGNO (x)) - && GET_MODE_SIZE (GET_MODE (x)) > 4) - fprintf ((stream), "d%s", reg_names[REGNO (x)] + 1); + && GET_MODE_SIZE (mode) > 4) + fprintf ((stream), "d%s", reg_names[regno] + 1); else - fputs (reg_names[REGNO (x)], (stream)); + fputs (reg_names[regno], (stream)); break; case MEM: @@ -731,7 +914,8 @@ print_operand (FILE *stream, rtx x, int code) case CONST: if (TARGET_SHMEDIA && GET_CODE (XEXP (x, 0)) == SIGN_EXTEND - && GET_MODE (XEXP (x, 0)) == DImode + && (GET_MODE (XEXP (x, 0)) == DImode + || GET_MODE (XEXP (x, 0)) == SImode) && GET_CODE (XEXP (XEXP (x, 0), 0)) == TRUNCATE && GET_MODE (XEXP (XEXP (x, 0), 0)) == HImode) { @@ -846,16 +1030,11 @@ expand_block_move (rtx *operands) return 0; else if (bytes == 12) { - tree entry_name; - rtx sym; - rtx func_addr_rtx; + rtx func_addr_rtx = gen_reg_rtx (Pmode); rtx r4 = gen_rtx_REG (SImode, 4); rtx r5 = gen_rtx_REG (SImode, 5); - entry_name = get_identifier ("__movmemSI12_i4"); - - sym = function_symbol (IDENTIFIER_POINTER (entry_name)); - func_addr_rtx = copy_to_mode_reg (Pmode, sym); + function_symbol (func_addr_rtx, "__movmemSI12_i4", SFUNC_STATIC); force_into (XEXP (operands[0], 0), r4); force_into (XEXP (operands[1], 0), r5); emit_insn (gen_block_move_real_i4 (func_addr_rtx)); @@ -863,19 +1042,15 @@ expand_block_move (rtx *operands) } else if (! TARGET_SMALLCODE) { - tree entry_name; - rtx sym; - rtx func_addr_rtx; + const char *entry_name; + rtx func_addr_rtx = gen_reg_rtx (Pmode); int dwords; rtx r4 = gen_rtx_REG (SImode, 4); rtx r5 = gen_rtx_REG (SImode, 5); rtx r6 = gen_rtx_REG (SImode, 6); - entry_name = get_identifier (bytes & 4 - ? "__movmem_i4_odd" - : "__movmem_i4_even"); - sym = function_symbol (IDENTIFIER_POINTER (entry_name)); - func_addr_rtx = copy_to_mode_reg (Pmode, sym); + entry_name = (bytes & 4 ? "__movmem_i4_odd" : "__movmem_i4_even"); + function_symbol (func_addr_rtx, entry_name, SFUNC_STATIC); force_into (XEXP (operands[0], 0), r4); force_into (XEXP (operands[1], 0), r5); @@ -890,16 +1065,12 @@ expand_block_move (rtx *operands) if (bytes < 64) { char entry[30]; - tree entry_name; - rtx sym; - rtx func_addr_rtx; + rtx func_addr_rtx = gen_reg_rtx (Pmode); rtx r4 = gen_rtx_REG (SImode, 4); rtx r5 = gen_rtx_REG (SImode, 5); sprintf (entry, "__movmemSI%d", bytes); - entry_name = get_identifier (entry); - sym = function_symbol (IDENTIFIER_POINTER (entry_name)); - func_addr_rtx = copy_to_mode_reg (Pmode, sym); + function_symbol (func_addr_rtx, entry, SFUNC_STATIC); force_into (XEXP (operands[0], 0), r4); force_into (XEXP (operands[1], 0), r5); emit_insn (gen_block_move_real (func_addr_rtx)); @@ -910,17 +1081,13 @@ expand_block_move (rtx *operands) less common function name, so this will occasionally use more space. */ if (! TARGET_SMALLCODE) { - tree entry_name; - rtx sym; - rtx func_addr_rtx; + rtx func_addr_rtx = gen_reg_rtx (Pmode); int final_switch, while_loop; rtx r4 = gen_rtx_REG (SImode, 4); rtx r5 = gen_rtx_REG (SImode, 5); rtx r6 = gen_rtx_REG (SImode, 6); - entry_name = get_identifier ("__movmem"); - sym = function_symbol (IDENTIFIER_POINTER (entry_name)); - func_addr_rtx = copy_to_mode_reg (Pmode, sym); + function_symbol (func_addr_rtx, "__movmem", SFUNC_STATIC); force_into (XEXP (operands[0], 0), r4); force_into (XEXP (operands[1], 0), r5); @@ -1001,7 +1168,8 @@ prepare_move_operands (rtx operands[], enum machine_mode mode) of a library call to the target. Reject `st r0,@(rX,rY)' because reload will fail to find a spill register for rX, since r0 is already being used for the source. */ - else if (refers_to_regno_p (R0_REG, R0_REG + 1, operands[1], (rtx *)0) + else if (TARGET_SH1 + && refers_to_regno_p (R0_REG, R0_REG + 1, operands[1], (rtx *)0) && GET_CODE (operands[0]) == MEM && GET_CODE (XEXP (operands[0], 0)) == PLUS && GET_CODE (XEXP (XEXP (operands[0], 0), 1)) == REG) @@ -1078,7 +1246,7 @@ prepare_move_operands (rtx operands[], enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } operands[1] = op1; } @@ -1101,7 +1269,7 @@ prepare_scc_operands (enum rtx_code code) { case NE: /* It isn't possible to handle this case. */ - abort (); + gcc_unreachable (); case LT: code = GT; break; @@ -1239,12 +1407,17 @@ output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[], int dreg = REGNO (dst); rtx inside = XEXP (src, 0); - if (GET_CODE (inside) == REG) - ptrreg = REGNO (inside); - else if (GET_CODE (inside) == SUBREG) - ptrreg = subreg_regno (inside); - else if (GET_CODE (inside) == PLUS) + switch (GET_CODE (inside)) { + case REG: + ptrreg = REGNO (inside); + break; + + case SUBREG: + ptrreg = subreg_regno (inside); + break; + + case PLUS: ptrreg = REGNO (XEXP (inside, 0)); /* ??? A r0+REG address shouldn't be possible here, because it isn't an offsettable address. Unfortunately, offsettable addresses use @@ -1253,15 +1426,16 @@ output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[], supported, so we can't use the 'o' constraint. Thus we must check for and handle r0+REG addresses here. We punt for now, since this is likely very rare. */ - if (GET_CODE (XEXP (inside, 1)) == REG) - abort (); + gcc_assert (GET_CODE (XEXP (inside, 1)) != REG); + break; + + case LABEL_REF: + return "mov.l %1,%0\n\tmov.l %1+4,%T0"; + case POST_INC: + return "mov.l %1,%0\n\tmov.l %1,%T0"; + default: + gcc_unreachable (); } - else if (GET_CODE (inside) == LABEL_REF) - return "mov.l %1,%0\n\tmov.l %1+4,%T0"; - else if (GET_CODE (inside) == POST_INC) - return "mov.l %1,%0\n\tmov.l %1,%T0"; - else - abort (); /* Work out the safe way to copy. Copy into the second half first. */ if (dreg == ptrreg) @@ -1278,7 +1452,7 @@ output_movedouble (rtx insn ATTRIBUTE_UNUSED, rtx operands[], static void print_slot (rtx insn) { - final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, optimize, 0, 1, NULL); + final_scan_insn (XVECEXP (insn, 0, 1), asm_out_file, optimize, 1, NULL); INSN_DELETED_P (XVECEXP (insn, 0, 1)) = 1; } @@ -1430,9 +1604,9 @@ output_branch (int logic, rtx insn, rtx *operands) { int label = lf++; - if (final_sequence - && INSN_ANNULLED_BRANCH_P (XVECEXP (final_sequence, 0, 0))) - abort (); + gcc_assert (!final_sequence + || !(INSN_ANNULLED_BRANCH_P + (XVECEXP (final_sequence, 0, 0)))); asm_fprintf (asm_out_file, "b%s%ss\t%LLF%d\n", logic ? "f" : "t", ASSEMBLER_DIALECT ? "/" : ".", label); @@ -1459,7 +1633,7 @@ output_branch (int logic, rtx insn, rtx *operands) /* There should be no longer branches now - that would indicate that something has destroyed the branches set up in machine_dependent_reorg. */ - abort (); + gcc_unreachable (); } } @@ -1663,7 +1837,7 @@ shift_insns_rtx (rtx insn) case ASHIFT: return shift_insns[shift_count]; default: - abort (); + gcc_unreachable (); } } @@ -1790,8 +1964,17 @@ addsubcosts (rtx x) static inline int multcosts (rtx x ATTRIBUTE_UNUSED) { + if (*sh_multcost_str) + return atoi (sh_multcost_str); if (TARGET_SHMEDIA) - return 3; + /* ??? We have a mul insn, but it has a latency of three, and doesn't + accept constants. Ideally, we would use a cost of one or two and + add the cost of the operand, but disregard the latter when inside loops + and loop invariant code motion is still to follow. + Using a multiply first and splitting it later if it's a loss + doesn't work because of different sign / zero extension semantics + of multiplies vs. shifts. */ + return TARGET_SMALLCODE ? 2 : 3; if (TARGET_SH2) { @@ -1835,7 +2018,7 @@ sh_rtx_costs (rtx x, int code, int outer_code, int *total) else if (CONST_OK_FOR_I16 (INTVAL (x))) *total = COSTS_N_INSNS (outer_code != SET); else if (CONST_OK_FOR_I16 (INTVAL (x) >> 16)) - *total = COSTS_N_INSNS (2); + *total = COSTS_N_INSNS ((outer_code != SET) + 1); else if (CONST_OK_FOR_I16 ((INTVAL (x) >> 16) >> 16)) *total = COSTS_N_INSNS (3); else @@ -1868,8 +2051,19 @@ sh_rtx_costs (rtx x, int code, int outer_code, int *total) else *total = 10; return true; + case CONST_VECTOR: + if (x == CONST0_RTX (GET_MODE (x))) + *total = 0; + else if (sh_1el_vec (x, VOIDmode)) + *total = outer_code != SET; + if (sh_rep_vec (x, VOIDmode)) + *total = ((GET_MODE_UNIT_SIZE (GET_MODE (x)) + 3) / 4 + + (outer_code != SET)); + *total = COSTS_N_INSNS (3) + (outer_code != SET); + return true; case PLUS: + case MINUS: *total = COSTS_N_INSNS (addsubcosts (x)); return true; @@ -1894,6 +2088,15 @@ sh_rtx_costs (rtx x, int code, int outer_code, int *total) *total = COSTS_N_INSNS (20); return true; + case PARALLEL: + if (sh_1el_vec (x, VOIDmode)) + *total = outer_code != SET; + if (sh_rep_vec (x, VOIDmode)) + *total = ((GET_MODE_UNIT_SIZE (GET_MODE (x)) + 3) / 4 + + (outer_code != SET)); + *total = COSTS_N_INSNS (3) + (outer_code != SET); + return true; + case FLOAT: case FIX: *total = 100; @@ -2022,10 +2225,10 @@ gen_shifty_op (int code, rtx *operands) } else if (value == 0) { - /* This can happen when not optimizing. We must output something here - to prevent the compiler from aborting in final.c after the try_split - call. */ - emit_insn (gen_nop ()); + /* This can happen even when optimizing, if there were subregs before + reload. Don't output a nop here, as this is never optimized away; + use a no-op move instead. */ + emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[0])); return; } @@ -2074,10 +2277,8 @@ gen_shifty_hi_op (int code, rtx *operands) int expand_ashiftrt (rtx *operands) { - rtx sym; rtx wrk; char func[18]; - tree func_name; int value; if (TARGET_SH3) @@ -2105,6 +2306,16 @@ expand_ashiftrt (rtx *operands) if (value == 31) { + /* If we are called from abs expansion, arrange things so that we + we can use a single MT instruction that doesn't clobber the source, + if LICM can hoist out the load of the constant zero. */ + if (currently_expanding_to_rtl) + { + emit_insn (gen_cmpgtsi_t (force_reg (SImode, CONST0_RTX (SImode)), + operands[1])); + emit_insn (gen_mov_neg_si_t (operands[0])); + return 1; + } emit_insn (gen_ashrsi2_31 (operands[0], operands[1])); return 1; } @@ -2134,9 +2345,7 @@ expand_ashiftrt (rtx *operands) /* Load the value into an arg reg and call a helper. */ emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); sprintf (func, "__ashiftrt_r4_%d", value); - func_name = get_identifier (func); - sym = function_symbol (IDENTIFIER_POINTER (func_name)); - emit_move_insn (wrk, sym); + function_symbol (wrk, func, SFUNC_STATIC); emit_insn (gen_ashrsi3_n (GEN_INT (value), wrk)); emit_move_insn (operands[0], gen_rtx_REG (SImode, 4)); return 1; @@ -2389,8 +2598,7 @@ gen_shl_and (rtx dest, rtx left_rtx, rtx mask_rtx, rtx source) /* Cases 3 and 4 should be handled by this split only while combining */ - if (kind > 2) - abort (); + gcc_assert (kind <= 2); if (right) { emit_insn (gen_lshrsi3 (dest, source, GEN_INT (right))); @@ -2457,8 +2665,7 @@ shl_sext_kind (rtx left_rtx, rtx size_rtx, int *costp) left = INTVAL (left_rtx); size = INTVAL (size_rtx); insize = size - left; - if (insize <= 0) - abort (); + gcc_assert (insize > 0); /* Default to left / right shift. */ kind = 0; best_cost = shift_insns[32 - insize] + ashiftrt_insns[32 - size]; @@ -2680,14 +2887,21 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source) rtx gen_datalabel_ref (rtx sym) { + const char *str; + if (GET_CODE (sym) == LABEL_REF) return gen_rtx_CONST (GET_MODE (sym), gen_rtx_UNSPEC (GET_MODE (sym), gen_rtvec (1, sym), UNSPEC_DATALABEL)); - if (GET_CODE (sym) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (sym) == SYMBOL_REF); + + str = XSTR (sym, 0); + /* Share all SYMBOL_REF strings with the same value - that is important + for cse. */ + str = IDENTIFIER_POINTER (get_identifier (str)); + XSTR (sym, 0) = str; return sym; } @@ -2759,10 +2973,10 @@ typedef struct } pool_node; /* The maximum number of constants that can fit into one pool, since - the pc relative range is 0...1020 bytes and constants are at least 4 - bytes long. */ + constants in the range 0..510 are at least 2 bytes long, and in the + range from there to 1018 at least 4 bytes. */ -#define MAX_POOL_SIZE (1020/4) +#define MAX_POOL_SIZE 372 static pool_node pool_vector[MAX_POOL_SIZE]; static int pool_size; static rtx pool_window_label; @@ -2965,8 +3179,7 @@ dump_table (rtx start, rtx barrier) scan); break; default: - abort (); - break; + gcc_unreachable (); } if (p->mode != HImode) @@ -3018,8 +3231,7 @@ dump_table (rtx start, rtx barrier) scan); break; default: - abort (); - break; + gcc_unreachable (); } if (p->mode != HImode) @@ -3130,10 +3342,9 @@ fixup_mova (rtx mova) do { worker = NEXT_INSN (worker); - if (! worker - || GET_CODE (worker) == CODE_LABEL - || GET_CODE (worker) == JUMP_INSN) - abort (); + gcc_assert (worker + && GET_CODE (worker) != CODE_LABEL + && GET_CODE (worker) != JUMP_INSN); } while (recog_memoized (worker) != CODE_FOR_casesi_worker_1); wpat = PATTERN (worker); wpat0 = XVECEXP (wpat, 0, 0); @@ -3265,11 +3476,6 @@ find_barrier (int num_mova, rtx mova, rtx from) if (num_mova) si_limit -= GET_MODE_SIZE (mode); } - - /* See the code in machine_dependent_reorg, which has a similar if - statement that generates a new mova insn in many cases. */ - if (GET_CODE (dst) == REG && FP_ANY_REGISTER_P (REGNO (dst))) - inc += 2; } if (mova_p (from)) @@ -3772,6 +3978,7 @@ gen_far_branch (struct far_branch *bp) rtx insn = bp->insert_place; rtx jump; rtx label = gen_label_rtx (); + int ok; emit_label_after (label, insn); if (bp->far_label) @@ -3790,8 +3997,9 @@ gen_far_branch (struct far_branch *bp) emit_barrier_after (jump); emit_label_after (bp->near_label, insn); JUMP_LABEL (jump) = bp->far_label; - if (! invert_jump (insn, label, 1)) - abort (); + ok = invert_jump (insn, label, 1); + gcc_assert (ok); + /* If we are branching around a jump (rather than a return), prevent reorg from using an insn from the jump target as the delay slot insn - when reorg did this, it pessimized code (we rather hide the delay slot) @@ -4365,9 +4573,8 @@ sh_reorg (void) - 1); rtx clobber = *clobberp; - if (GET_CODE (clobber) != CLOBBER - || ! rtx_equal_p (XEXP (clobber, 0), r0_rtx)) - abort (); + gcc_assert (GET_CODE (clobber) == CLOBBER + && rtx_equal_p (XEXP (clobber, 0), r0_rtx)); if (last_float && reg_set_between_p (r0_rtx, last_float_move, scan)) @@ -4501,6 +4708,7 @@ split_branches (rtx first) rtx insn; struct far_branch **uid_branch, *far_branch_list = 0; int max_uid = get_max_uid (); + int ok; /* Find out which branches are out of range. */ shorten_branches (first); @@ -4590,8 +4798,8 @@ split_branches (rtx first) bp->insert_place = insn; bp->address = addr; } - if (! redirect_jump (insn, label, 1)) - abort (); + ok = redirect_jump (insn, label, 1); + gcc_assert (ok); } else { @@ -4737,19 +4945,29 @@ final_prescan_insn (rtx insn, rtx *opvec ATTRIBUTE_UNUSED, rtx pattern; pattern = PATTERN (insn); - if (GET_CODE (pattern) == PARALLEL) - pattern = XVECEXP (pattern, 0, 0); - if (GET_CODE (pattern) == CALL - || (GET_CODE (pattern) == SET - && (GET_CODE (SET_SRC (pattern)) == CALL - || get_attr_type (insn) == TYPE_SFUNC))) - asm_fprintf (asm_out_file, "\t.uses %LL%d\n", - CODE_LABEL_NUMBER (XEXP (note, 0))); - else if (GET_CODE (pattern) == SET) - (*targetm.asm_out.internal_label) (asm_out_file, "L", - CODE_LABEL_NUMBER (XEXP (note, 0))); - else - abort (); + switch (GET_CODE (pattern)) + { + case PARALLEL: + pattern = XVECEXP (pattern, 0, 0); + break; + + case SET: + if (GET_CODE (SET_SRC (pattern)) != CALL + && get_attr_type (insn) != TYPE_SFUNC) + { + targetm.asm_out.internal_label + (asm_out_file, "L", CODE_LABEL_NUMBER (XEXP (note, 0))); + break; + } + /* else FALLTHROUGH */ + case CALL: + asm_fprintf (asm_out_file, "\t.uses %LL%d\n", + CODE_LABEL_NUMBER (XEXP (note, 0))); + break; + + default: + gcc_unreachable (); + } } } } @@ -4819,8 +5037,7 @@ output_stack_adjust (int size, rtx reg, int epilogue_p, /* This test is bogus, as output_stack_adjust is used to re-align the stack. */ #if 0 - if (size % align) - abort (); + gcc_assert (!(size % align)); #endif if (CONST_OK_FOR_ADD (size)) @@ -4843,7 +5060,7 @@ output_stack_adjust (int size, rtx reg, int epilogue_p, /* If TEMP is invalid, we could temporarily save a general register to MACL. However, there is currently no need - to handle this case, so just abort when we see it. */ + to handle this case, so just die when we see it. */ if (epilogue_p < 0 || current_function_interrupt || ! call_really_used_regs[temp] || fixed_regs[temp]) @@ -4890,53 +5107,53 @@ output_stack_adjust (int size, rtx reg, int epilogue_p, temp = scavenge_reg (live_regs_mask); if (temp < 0) { + rtx adj_reg, tmp_reg, mem; + /* If we reached here, the most likely case is the (sibcall) epilogue for non SHmedia. Put a special push/pop sequence for such case as the last resort. This looks lengthy but - would not be problem because it seems to be very rare. */ - if (! TARGET_SHMEDIA && epilogue_p) - { - rtx adj_reg, tmp_reg, mem; - - /* ??? There is still the slight possibility that r4 or r5 - have been reserved as fixed registers or assigned as - global registers, and they change during an interrupt. - There are possible ways to handle this: - - If we are adjusting the frame pointer (r14), we can do - with a single temp register and an ordinary push / pop - on the stack. - - Grab any call-used or call-saved registers (i.e. not - fixed or globals) for the temps we need. We might - also grab r14 if we are adjusting the stack pointer. - If we can't find enough available registers, issue - a diagnostic and abort - the user must have reserved - way too many registers. - But since all this is rather unlikely to happen and - would require extra testing, we just abort if r4 / r5 - are not available. */ - if (fixed_regs[4] || fixed_regs[5] - || global_regs[4] || global_regs[5]) - abort (); - - adj_reg = gen_rtx_REG (GET_MODE (reg), 4); - tmp_reg = gen_rtx_REG (GET_MODE (reg), 5); - emit_move_insn (gen_rtx_MEM (Pmode, reg), adj_reg); - emit_insn (GEN_MOV (adj_reg, GEN_INT (size))); - emit_insn (GEN_ADD3 (adj_reg, adj_reg, reg)); - mem = gen_rtx_MEM (Pmode, gen_rtx_PRE_DEC (Pmode, adj_reg)); - emit_move_insn (mem, tmp_reg); - emit_move_insn (tmp_reg, gen_rtx_MEM (Pmode, reg)); - mem = gen_rtx_MEM (Pmode, gen_rtx_PRE_DEC (Pmode, adj_reg)); - emit_move_insn (mem, tmp_reg); - emit_move_insn (reg, adj_reg); - mem = gen_rtx_MEM (Pmode, gen_rtx_POST_INC (Pmode, reg)); - emit_move_insn (adj_reg, mem); - mem = gen_rtx_MEM (Pmode, gen_rtx_POST_INC (Pmode, reg)); - emit_move_insn (tmp_reg, mem); - return; - } - else - abort (); + would not be problem because it seems to be very + rare. */ + + gcc_assert (!TARGET_SHMEDIA && epilogue_p); + + + /* ??? There is still the slight possibility that r4 or + r5 have been reserved as fixed registers or assigned + as global registers, and they change during an + interrupt. There are possible ways to handle this: + + - If we are adjusting the frame pointer (r14), we can do + with a single temp register and an ordinary push / pop + on the stack. + - Grab any call-used or call-saved registers (i.e. not + fixed or globals) for the temps we need. We might + also grab r14 if we are adjusting the stack pointer. + If we can't find enough available registers, issue + a diagnostic and die - the user must have reserved + way too many registers. + But since all this is rather unlikely to happen and + would require extra testing, we just die if r4 / r5 + are not available. */ + gcc_assert (!fixed_regs[4] && !fixed_regs[5] + && !global_regs[4] && !global_regs[5]); + + adj_reg = gen_rtx_REG (GET_MODE (reg), 4); + tmp_reg = gen_rtx_REG (GET_MODE (reg), 5); + emit_move_insn (gen_rtx_MEM (Pmode, reg), adj_reg); + emit_insn (GEN_MOV (adj_reg, GEN_INT (size))); + emit_insn (GEN_ADD3 (adj_reg, adj_reg, reg)); + mem = gen_rtx_MEM (Pmode, gen_rtx_PRE_DEC (Pmode, adj_reg)); + emit_move_insn (mem, tmp_reg); + emit_move_insn (tmp_reg, gen_rtx_MEM (Pmode, reg)); + mem = gen_rtx_MEM (Pmode, gen_rtx_PRE_DEC (Pmode, adj_reg)); + emit_move_insn (mem, tmp_reg); + emit_move_insn (reg, adj_reg); + mem = gen_rtx_MEM (Pmode, gen_rtx_POST_INC (Pmode, reg)); + emit_move_insn (adj_reg, mem); + mem = gen_rtx_MEM (Pmode, gen_rtx_POST_INC (Pmode, reg)); + emit_move_insn (tmp_reg, mem); + return; } const_reg = gen_rtx_REG (GET_MODE (reg), temp); @@ -5131,7 +5348,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask) CLEAR_HARD_REG_SET (*live_regs_mask); if ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && interrupt_handler && regs_ever_live[FPSCR_REG]) - target_flags &= ~FPU_SINGLE_BIT; + target_flags &= ~MASK_FPU_SINGLE; /* If we can save a lot of saves by switching to double mode, do that. */ else if ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && TARGET_FPU_SINGLE) for (count = 0, reg = FIRST_FP_REG; reg <= LAST_FP_REG; reg += 2) @@ -5140,7 +5357,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask) || (interrupt_handler && ! pragma_trapa)) && ++count > 2) { - target_flags &= ~FPU_SINGLE_BIT; + target_flags &= ~MASK_FPU_SINGLE; break; } /* PR_MEDIA_REG is a general purpose register, thus global_alloc already @@ -5222,7 +5439,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask) else if (XD_REGISTER_P (reg)) { /* Must switch to double mode to access these registers. */ - target_flags &= ~FPU_SINGLE_BIT; + target_flags &= ~MASK_FPU_SINGLE; } } } @@ -5285,6 +5502,8 @@ sh_media_register_for_return (void) if (lookup_attribute ("interrupt_handler", DECL_ATTRIBUTES (current_function_decl))) return -1; + if (sh_cfun_interrupt_handler_p ()) + return -1; tr0_used = flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM]; @@ -5590,8 +5809,7 @@ sh_expand_prologue (void) GO_IF_LEGITIMATE_ADDRESS (mode, XEXP (mem_rtx, 0), try_pre_dec); - if (! r0) - abort (); + gcc_assert (r0); mem_rtx = NULL_RTX; try_pre_dec: @@ -5661,11 +5879,10 @@ sh_expand_prologue (void) registers or for special registers without pre-dec memory addresses, since we store their values in r0 first. */ - if (TARGET_REGISTER_P (reg) - || ((reg == PR_REG || SPECIAL_REGISTER_P (reg)) - && mem_rtx != pre_dec)) - abort (); - + gcc_assert (!TARGET_REGISTER_P (reg) + && ((reg != PR_REG && !SPECIAL_REGISTER_P (reg)) + || mem_rtx == pre_dec)); + addr_ok: orig_reg_rtx = reg_rtx; if (TARGET_REGISTER_P (reg) @@ -5680,8 +5897,8 @@ sh_expand_prologue (void) { offset_in_r0 = -1; sp_in_r0 = 0; - if (refers_to_regno_p (R0_REG, R0_REG+1, mem_rtx, (rtx *) 0)) - abort (); + gcc_assert (!refers_to_regno_p + (R0_REG, R0_REG+1, mem_rtx, (rtx *) 0)); } if (*++tmp_pnt <= 0) @@ -5729,8 +5946,7 @@ sh_expand_prologue (void) } } - if (entry->offset != d_rounding) - abort (); + gcc_assert (entry->offset == d_rounding); } else push_regs (&live_regs_mask, current_function_interrupt); @@ -5756,12 +5972,12 @@ sh_expand_prologue (void) if (SHMEDIA_REGS_STACK_ADJUST ()) { - emit_move_insn (gen_rtx_REG (Pmode, R0_REG), - function_symbol (TARGET_FPU_ANY - ? "__GCC_push_shmedia_regs" - : "__GCC_push_shmedia_regs_nofpu")); /* This must NOT go through the PLT, otherwise mach and macl may be clobbered. */ + function_symbol (gen_rtx_REG (Pmode, R0_REG), + (TARGET_FPU_ANY + ? "__GCC_push_shmedia_regs" + : "__GCC_push_shmedia_regs_nofpu"), SFUNC_GOT); emit_insn (gen_shmedia_save_restore_regs_compact (GEN_INT (-SHMEDIA_REGS_STACK_ADJUST ()))); } @@ -5791,8 +6007,8 @@ sh_expand_prologue (void) { /* This must NOT go through the PLT, otherwise mach and macl may be clobbered. */ - emit_move_insn (gen_rtx_REG (Pmode, R0_REG), - function_symbol ("__GCC_shcompact_incoming_args")); + function_symbol (gen_rtx_REG (Pmode, R0_REG), + "__GCC_shcompact_incoming_args", SFUNC_GOT); emit_insn (gen_shcompact_incoming_args ()); } } @@ -5867,10 +6083,10 @@ sh_expand_epilogue (bool sibcall_p) if (SHMEDIA_REGS_STACK_ADJUST ()) { - emit_move_insn (gen_rtx_REG (Pmode, R0_REG), - function_symbol (TARGET_FPU_ANY - ? "__GCC_pop_shmedia_regs" - : "__GCC_pop_shmedia_regs_nofpu")); + function_symbol (gen_rtx_REG (Pmode, R0_REG), + (TARGET_FPU_ANY + ? "__GCC_pop_shmedia_regs" + : "__GCC_pop_shmedia_regs_nofpu"), SFUNC_GOT); /* This must NOT go through the PLT, otherwise mach and macl may be clobbered. */ emit_insn (gen_shmedia_save_restore_regs_compact @@ -5974,9 +6190,8 @@ sh_expand_epilogue (bool sibcall_p) stack_pointer_rtx, r0)); - if ((reg == PR_REG || SPECIAL_REGISTER_P (reg)) - && mem_rtx != post_inc) - abort (); + gcc_assert ((reg != PR_REG && !SPECIAL_REGISTER_P (reg)) + || mem_rtx == post_inc); addr_ok: if ((reg == PR_REG || SPECIAL_REGISTER_P (reg)) @@ -6005,8 +6220,7 @@ sh_expand_epilogue (bool sibcall_p) REG_NOTES (insn)); } - if (entry->offset + offset_base != d + d_rounding) - abort (); + gcc_assert (entry->offset + offset_base == d + d_rounding); } else /* ! TARGET_SH5 */ { @@ -6121,7 +6335,7 @@ sh_set_return_address (rtx ra, rtx tmp) goto found; /* We can't find pr register. */ - abort (); + gcc_unreachable (); found: offset = entry->offset - offset; @@ -6248,10 +6462,9 @@ sh_builtin_saveregs (void) saved). We emit the moves in reverse order so that we can use predecrement. */ - fpregs = gen_reg_rtx (Pmode); - emit_move_insn (fpregs, XEXP (regbuf, 0)); - emit_insn (gen_addsi3 (fpregs, fpregs, - GEN_INT (n_floatregs * UNITS_PER_WORD))); + fpregs = copy_to_mode_reg (Pmode, + plus_constant (XEXP (regbuf, 0), + n_floatregs * UNITS_PER_WORD)); if (TARGET_SH4 || TARGET_SH2A_DOUBLE) { rtx mem; @@ -6990,8 +7203,7 @@ sh_setup_incoming_varargs (CUMULATIVE_ARGS *ca, int *pretend_arg_size, int second_time ATTRIBUTE_UNUSED) { - if (! current_function_stdarg) - abort (); + gcc_assert (current_function_stdarg); if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl)) { int named_parm_regs, anon_parm_regs; @@ -7065,38 +7277,34 @@ initial_elimination_offset (int from, int to) if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) return 0; - if (from == RETURN_ADDRESS_POINTER_REGNUM - && (to == FRAME_POINTER_REGNUM || to == STACK_POINTER_REGNUM)) + gcc_assert (from == RETURN_ADDRESS_POINTER_REGNUM + && (to == FRAME_POINTER_REGNUM || to == STACK_POINTER_REGNUM)); + if (TARGET_SH5) { - if (TARGET_SH5) - { - int n = total_saved_regs_space; - int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG; - save_schedule schedule; - save_entry *entry; - - n += total_auto_space; - - /* If it wasn't saved, there's not much we can do. */ - if (! TEST_HARD_REG_BIT (live_regs_mask, pr_reg)) - return n; - - target_flags = copy_flags; - - sh5_schedule_saves (&live_regs_mask, &schedule, n); - for (entry = &schedule.entries[1]; entry->mode != VOIDmode; entry++) - if (entry->reg == pr_reg) - { - target_flags = save_flags; - return entry->offset; - } - abort (); - } - else - return total_auto_space; + int n = total_saved_regs_space; + int pr_reg = TARGET_SHMEDIA ? PR_MEDIA_REG : PR_REG; + save_schedule schedule; + save_entry *entry; + + n += total_auto_space; + + /* If it wasn't saved, there's not much we can do. */ + if (! TEST_HARD_REG_BIT (live_regs_mask, pr_reg)) + return n; + + target_flags = copy_flags; + + sh5_schedule_saves (&live_regs_mask, &schedule, n); + for (entry = &schedule.entries[1]; entry->mode != VOIDmode; entry++) + if (entry->reg == pr_reg) + { + target_flags = save_flags; + return entry->offset; + } + gcc_unreachable (); } - - abort (); + else + return total_auto_space; } /* Handle machine specific pragmas to be semi-compatible with Renesas @@ -7185,7 +7393,7 @@ sh_handle_interrupt_handler_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -7206,21 +7414,21 @@ sh_handle_sp_switch_attribute (tree *node, tree name, tree args, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (!pragma_interrupt) { /* The sp_switch attribute only has meaning for interrupt functions. */ - warning ("%qs attribute only applies to interrupt functions", + warning (0, "%qs attribute only applies to interrupt functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (TREE_CODE (TREE_VALUE (args)) != STRING_CST) { /* The argument must be a constant string. */ - warning ("%qs attribute argument not a string constant", + warning (0, "%qs attribute argument not a string constant", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -7241,21 +7449,21 @@ sh_handle_trap_exit_attribute (tree *node, tree name, tree args, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (!pragma_interrupt) { /* The trap_exit attribute only has meaning for interrupt functions. */ - warning ("%qs attribute only applies to interrupt functions", + warning (0, "%qs attribute only applies to interrupt functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } else if (TREE_CODE (TREE_VALUE (args)) != INTEGER_CST) { /* The argument must be a constant integer. */ - warning ("%qs attribute argument not an integer constant", + warning (0, "%qs attribute argument not an integer constant", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -7307,27 +7515,26 @@ sh_cfun_interrupt_handler_p (void) != NULL_TREE); } -/* ??? target_switches in toplev.c is static, hence we have to duplicate it. */ -static const struct -{ - const char *const name; - const int value; - const char *const description; -} -sh_target_switches[] = TARGET_SWITCHES; -#define target_switches sh_target_switches - -/* Like default_pch_valid_p, but take flag_mask into account. */ +/* Like default_pch_valid_p, but only check certain target_flags. */ const char * sh_pch_valid_p (const void *data_p, size_t len) { +#ifdef TARGET_OPTIONS + /* ??? We have a copy of this in toplev.c, but it is static. */ + static const struct + { + const char *const prefix; + const char **const variable; + const char *const description; + const char *const value; + } + target_options[] = TARGET_OPTIONS; +#endif + const char *data = (const char *)data_p; const char *flag_that_differs = NULL; size_t i; int old_flags; - int flag_mask - = (SH1_BIT | SH2_BIT | SH3_BIT | SH_E_BIT | HARD_SH4_BIT | FPU_SINGLE_BIT - | SH4_BIT | HITACHI_BIT | LITTLE_ENDIAN_BIT); /* -fpic and -fpie also usually make a PCH invalid. */ if (data[0] != flag_pic) @@ -7338,24 +7545,15 @@ sh_pch_valid_p (const void *data_p, size_t len) /* Check target_flags. */ memcpy (&old_flags, data, sizeof (target_flags)); - if (((old_flags ^ target_flags) & flag_mask) != 0) - { - for (i = 0; i < ARRAY_SIZE (target_switches); i++) - { - int bits; + if ((old_flags ^ target_flags) & (MASK_SH1 | MASK_SH2 | MASK_SH3 + | MASK_SH_E | MASK_HARD_SH4 + | MASK_FPU_SINGLE | MASK_SH4)) + return _("created and used with different architectures / ABIs"); + if ((old_flags ^ target_flags) & MASK_HITACHI) + return _("created and used with different ABIs"); + if ((old_flags ^ target_flags) & MASK_LITTLE_ENDIAN) + return _("created and used with different endianness"); - bits = target_switches[i].value; - if (bits < 0) - bits = -bits; - bits &= flag_mask; - if ((target_flags & bits) != (old_flags & bits)) - { - flag_that_differs = target_switches[i].name; - goto make_message; - } - } - abort (); - } data += sizeof (target_flags); len -= sizeof (target_flags); @@ -7441,6 +7639,14 @@ general_movsrc_operand (rtx op, enum machine_mode mode) && system_reg_operand (XEXP (op, 0), mode))) return 0; + if (TARGET_SHMEDIA + && (GET_CODE (op) == PARALLEL || GET_CODE (op) == CONST_VECTOR) + && sh_rep_vec (op, mode)) + return 1; + if (TARGET_SHMEDIA && 1 + && GET_CODE (op) == SUBREG && GET_MODE (op) == mode + && SUBREG_REG (op) == const0_rtx && subreg_lowpart_p (op)) + /* FIXME */ abort (); /* return 1; */ return general_operand (op, mode); } @@ -7453,6 +7659,10 @@ general_movdst_operand (rtx op, enum machine_mode mode) /* Only pre dec allowed. */ if (GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == POST_INC) return 0; + if (mode == DImode && TARGET_SHMEDIA && GET_CODE (op) == SUBREG + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) < 8 + && ! (high_life_started || reload_completed)) + return 0; return general_operand (op, mode); } @@ -7478,6 +7688,28 @@ arith_reg_operand (rtx op, enum machine_mode mode) && (regno != FPUL_REG || TARGET_SH4) && regno != MACH_REG && regno != MACL_REG); } + /* Allow a no-op sign extension - compare LOAD_EXTEND_OP. + We allow SImode here, as not using an FP register is just a matter of + proper register allocation. */ + if (TARGET_SHMEDIA + && GET_MODE (op) == DImode && GET_CODE (op) == SIGN_EXTEND + && GET_MODE (XEXP (op, 0)) == SImode + && GET_CODE (XEXP (op, 0)) != SUBREG) + return register_operand (XEXP (op, 0), VOIDmode); +#if 0 /* Can't do this because of PROMOTE_MODE for unsigned vars. */ + if (GET_MODE (op) == SImode && GET_CODE (op) == SIGN_EXTEND + && GET_MODE (XEXP (op, 0)) == HImode + && GET_CODE (XEXP (op, 0)) == REG + && REGNO (XEXP (op, 0)) <= LAST_GENERAL_REG) + return register_operand (XEXP (op, 0), VOIDmode); +#endif + if (GET_MODE_CLASS (GET_MODE (op)) == MODE_VECTOR_INT + && GET_CODE (op) == SUBREG + && GET_MODE (SUBREG_REG (op)) == DImode + && GET_CODE (SUBREG_REG (op)) == SIGN_EXTEND + && GET_MODE (XEXP (SUBREG_REG (op), 0)) == SImode + && GET_CODE (XEXP (SUBREG_REG (op), 0)) != SUBREG) + return register_operand (XEXP (SUBREG_REG (op), 0), VOIDmode); return 0; } @@ -7488,7 +7720,21 @@ int arith_reg_dest (rtx op, enum machine_mode mode) { if (mode == DImode && GET_CODE (op) == SUBREG - && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) < 8) + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) < 8 + && TARGET_SHMEDIA) + return 0; + return arith_reg_operand (op, mode); +} + +/* Like arith_reg_operand, but for register source operands of narrow + logical SHMEDIA operations: forbid subregs of DImode / TImode regs. */ +int +logical_reg_operand (rtx op, enum machine_mode mode) +{ + if (TARGET_SHMEDIA + && GET_CODE (op) == SUBREG + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) > 4 + && mode != DImode) return 0; return arith_reg_operand (op, mode); } @@ -7526,6 +7772,15 @@ fp_arith_reg_operand (rtx op, enum machine_mode mode) return 0; } +int +fp_arith_reg_dest (rtx op, enum machine_mode mode) +{ + if (mode == DImode && GET_CODE (op) == SUBREG + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) < 8) + return 0; + return fp_arith_reg_operand (op, mode); +} + /* Returns 1 if OP is a valid source operand for an arithmetic insn. */ int @@ -7544,6 +7799,14 @@ arith_operand (rtx op, enum machine_mode mode) if (GET_CODE (op) == CONST_INT || EXTRA_CONSTRAINT_C16 (op)) return 1; + else if (GET_CODE (op) == TRUNCATE + && ! system_reg_operand (XEXP (op, 0), VOIDmode) + && (mode == VOIDmode || mode == GET_MODE (op)) + && (GET_MODE_SIZE (GET_MODE (op)) + < GET_MODE_SIZE (GET_MODE (XEXP (op, 0)))) + && (! FP_REGISTER_P (REGNO (XEXP (op, 0))) + || GET_MODE_SIZE (GET_MODE (op)) == 4)) + return register_operand (XEXP (op, 0), VOIDmode); else return 0; } @@ -7567,14 +7830,34 @@ arith_reg_or_0_operand (rtx op, enum machine_mode mode) return 0; } -/* Return 1 if OP is a valid source operand for an SHmedia operation - that takes either a register or a 6-bit immediate. */ +/* Return 1 if OP is a valid source operand for xor. */ + +int +xor_operand (rtx op, enum machine_mode mode) +{ + if (GET_CODE (op) == CONST_INT) + return (TARGET_SHMEDIA + ? (CONST_OK_FOR_I06 (INTVAL (op)) + || (no_new_pseudos && INTVAL (op) == 0xff)) + : CONST_OK_FOR_K08 (INTVAL (op))); + if (TARGET_SHMEDIA + && mode != DImode && GET_CODE (op) == SUBREG + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) > 4) + return 0; + return arith_reg_operand (op, mode); +} +/* Return 1 if OP is a valid source operand for shmedia cmpgt / cmpgtu. */ int -shmedia_6bit_operand (rtx op, enum machine_mode mode) +cmp_operand (rtx op, enum machine_mode mode) { - return (arith_reg_operand (op, mode) - || (GET_CODE (op) == CONST_INT && CONST_OK_FOR_I06 (INTVAL (op)))); + if (GET_CODE (op) == CONST_INT && CONST_OK_FOR_N (INTVAL (op))) + return 1; + if (TARGET_SHMEDIA + && mode != DImode && GET_CODE (op) == SUBREG + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) > 4) + return 0; + return arith_reg_operand (op, mode); } /* Returns 1 if OP is a valid source operand for a logical operation. */ @@ -7582,6 +7865,11 @@ shmedia_6bit_operand (rtx op, enum machine_mode mode) int logical_operand (rtx op, enum machine_mode mode) { + if (TARGET_SHMEDIA + && mode != DImode && GET_CODE (op) == SUBREG + && GET_MODE_SIZE (GET_MODE (SUBREG_REG (op))) > 4) + return 0; + if (arith_reg_operand (op, mode)) return 1; @@ -7792,7 +8080,7 @@ equality_comparison_operator (rtx op, enum machine_mode mode) int greater_comparison_operator (rtx op, enum machine_mode mode) { - if (mode != VOIDmode && GET_MODE (op) == mode) + if (mode != VOIDmode && GET_MODE (op) != mode) return 0; switch (GET_CODE (op)) { @@ -7809,7 +8097,7 @@ greater_comparison_operator (rtx op, enum machine_mode mode) int less_comparison_operator (rtx op, enum machine_mode mode) { - if (mode != VOIDmode && GET_MODE (op) == mode) + if (mode != VOIDmode && GET_MODE (op) != mode) return 0; switch (GET_CODE (op)) { @@ -7823,12 +8111,45 @@ less_comparison_operator (rtx op, enum machine_mode mode) } } +int +shift_operator (rtx op, enum machine_mode mode) +{ + if (mode != VOIDmode && GET_MODE (op) != mode) + return 0; + switch (GET_CODE (op)) + { + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + return 1; + default: + return 0; + } +} + +int +logical_operator (rtx op, enum machine_mode mode) +{ + if (mode != VOIDmode && GET_MODE (op) != mode) + return 0; + switch (GET_CODE (op)) + { + case AND: + case IOR: + case XOR: + return 1; + default: + return 0; + } +} + /* Accept pseudos and branch target registers. */ int target_reg_operand (rtx op, enum machine_mode mode) { - if (mode != DImode - || GET_MODE (op) != DImode) + if (mode == VOIDmode + ? GET_MODE (op) != Pmode && GET_MODE (op) != PDImode + : mode != GET_MODE (op)) return 0; if (GET_CODE (op) == SUBREG) @@ -7852,10 +8173,10 @@ target_reg_operand (rtx op, enum machine_mode mode) int target_operand (rtx op, enum machine_mode mode) { - if (mode != DImode) + if (mode != VOIDmode && mode != Pmode) return 0; - if ((GET_MODE (op) == DImode || GET_MODE (op) == VOIDmode) + if ((GET_MODE (op) == Pmode || GET_MODE (op) == VOIDmode) && EXTRA_CONSTRAINT_Csy (op)) return ! reload_completed; @@ -7901,6 +8222,12 @@ extend_reg_or_0_operand (rtx op, enum machine_mode mode) } int +minuend_operand (rtx op, enum machine_mode mode) +{ + return op == constm1_rtx || extend_reg_or_0_operand (op, mode); +} + +int general_extend_operand (rtx op, enum machine_mode mode) { return (GET_CODE (op) == TRUNCATE @@ -7909,6 +8236,32 @@ general_extend_operand (rtx op, enum machine_mode mode) } int +ua_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + if (GET_CODE (op) == PLUS + && (GET_CODE (XEXP (op, 1)) != CONST_INT + || ! CONST_OK_FOR_I06 (INTVAL (XEXP (op, 1))))) + return 0; + return address_operand (op, QImode); +} + +int +cache_address_operand (rtx op, enum machine_mode mode) +{ + if (GET_CODE (op) == PLUS) + { + if (GET_CODE (XEXP (op, 0)) != REG) + return 0; + if (GET_CODE (XEXP (op, 1)) != CONST_INT + || (INTVAL (XEXP (op, 1)) & 31)) + return 0; + } + else if (GET_CODE (op) != REG) + return 0; + return address_operand (op, mode); +} + +int inqhi_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) != TRUNCATE || mode != GET_MODE (op)) @@ -8261,10 +8614,8 @@ get_free_reg (HARD_REG_SET regs_live) /* Hard reg 1 is live; since this is a SMALL_REGISTER_CLASSES target, there shouldn't be anything but a jump before the function end. */ - if (! TEST_HARD_REG_BIT (regs_live, 7)) - return gen_rtx_REG (Pmode, 7); - - abort (); + gcc_assert (!TEST_HARD_REG_BIT (regs_live, 7)); + return gen_rtx_REG (Pmode, 7); } /* This function will set the fpscr from memory. @@ -8505,6 +8856,12 @@ mark_constant_pool_use (rtx x) return lab; } + +int +ua_offset (rtx c, enum machine_mode mode ATTRIBUTE_UNUSED) +{ + return GET_CODE (c) == CONST_INT && CONST_OK_FOR_I06 (INTVAL (c)); +} /* Return true if it's possible to redirect BRANCH1 to the destination of an unconditional jump BRANCH2. We only want to do this if the @@ -8572,11 +8929,58 @@ sh_adjust_cost (rtx insn, rtx link ATTRIBUTE_UNUSED, rtx dep_insn, int cost) /* On SHmedia, if the dependence is an anti-dependence or output-dependence, there is no cost. */ if (REG_NOTE_KIND (link) != 0) - cost = 0; + { + /* However, dependencies between target register loads and + uses of the register in a subsequent block that are separated + by a conditional branch are not modelled - we have to do with + the anti-dependency between the target register load and the + conditional branch that ends the current block. */ + if (REG_NOTE_KIND (link) == REG_DEP_ANTI + && GET_CODE (PATTERN (dep_insn)) == SET + && (get_attr_type (dep_insn) == TYPE_PT_MEDIA + || get_attr_type (dep_insn) == TYPE_PTABS_MEDIA) + && get_attr_type (insn) == TYPE_CBRANCH_MEDIA) + { + int orig_cost = cost; + rtx note = find_reg_note (insn, REG_BR_PROB, 0); + rtx target = ((! note + || INTVAL (XEXP (note, 0)) * 2 < REG_BR_PROB_BASE) + ? insn : JUMP_LABEL (insn)); + /* On the likely path, the branch costs 1, on the unlikely path, + it costs 3. */ + cost--; + do + target = next_active_insn (target); + while (target && ! flow_dependent_p (target, dep_insn) + && --cost > 0); + /* If two branches are executed in immediate succession, with the + first branch properly predicted, this causes a stall at the + second branch, hence we won't need the target for the + second branch for two cycles after the launch of the first + branch. */ + if (cost > orig_cost - 2) + cost = orig_cost - 2; + } + else + cost = 0; + } - if (get_attr_is_mac_media (insn) - && get_attr_is_mac_media (dep_insn)) - cost = 1; + else if (get_attr_is_mac_media (insn) + && get_attr_is_mac_media (dep_insn)) + cost = 1; + + else if (! reload_completed + && GET_CODE (PATTERN (insn)) == SET + && GET_CODE (SET_SRC (PATTERN (insn))) == FLOAT + && GET_CODE (PATTERN (dep_insn)) == SET + && fp_arith_reg_operand (SET_SRC (PATTERN (dep_insn)), VOIDmode) + && cost < 4) + cost = 4; + /* Schedule the ptabs for a casesi_jump_media in preference to stuff + that is needed at the target. */ + else if (get_attr_type (insn) == TYPE_JUMP_MEDIA + && ! flow_dependent_p (insn, dep_insn)) + cost--; } else if (REG_NOTE_KIND (link) == 0) { @@ -8605,7 +9009,9 @@ sh_adjust_cost (rtx insn, rtx link ATTRIBUTE_UNUSED, rtx dep_insn, int cost) if (GET_CODE (call) == SET) call = SET_SRC (call); if (GET_CODE (call) == CALL && GET_CODE (XEXP (call, 0)) == MEM - && ! reg_set_p (XEXP (XEXP (call, 0), 0), dep_insn)) + /* sibcalli_thunk uses a symbol_ref in an unspec. */ + && (GET_CODE (XEXP (XEXP (call, 0), 0)) == UNSPEC + || ! reg_set_p (XEXP (XEXP (call, 0), 0), dep_insn))) cost = 0; } /* Likewise, the most timing critical input for an sfuncs call @@ -9024,8 +9430,38 @@ sh_target_reg_class (void) static bool sh_optimize_target_register_callee_saved (bool after_prologue_epilogue_gen) { - return (shmedia_space_reserved_for_target_registers - && (! after_prologue_epilogue_gen || TARGET_SAVE_ALL_TARGET_REGS)); + HARD_REG_SET dummy; + rtx insn; + + if (! shmedia_space_reserved_for_target_registers) + return 0; + if (after_prologue_epilogue_gen && ! TARGET_SAVE_ALL_TARGET_REGS) + return 0; + if (calc_live_regs (&dummy) >= 6 * 8) + return 1; + /* This is a borderline case. See if we got a nested loop, or a loop + with a call, or with more than 4 labels inside. */ + for (insn = get_insns(); insn; insn = NEXT_INSN (insn)) + { + if (GET_CODE (insn) == NOTE + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) + { + int labels = 0; + + do + { + insn = NEXT_INSN (insn); + if ((GET_CODE (insn) == NOTE + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) + || GET_CODE (insn) == CALL_INSN + || (GET_CODE (insn) == CODE_LABEL && ++labels > 4)) + return 1; + } + while (GET_CODE (insn) != NOTE + || NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_END); + } + } + return 0; } static bool @@ -9196,7 +9632,8 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) if (TARGET_HARVARD) { if (TARGET_USERMODE) - emit_library_call (function_symbol ("__ic_invalidate"), + emit_library_call (function_symbol (NULL, "__ic_invalidate", + FUNCTION_ORDINARY), 0, VOIDmode, 1, tramp, SImode); else emit_insn (gen_ic_invalidate_line (tramp)); @@ -9207,13 +9644,18 @@ sh_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt) receives arguments ``by reference'' will have them stored in its own stack frame, so it must not pass pointers or references to these arguments to other functions by means of sibling calls. */ +/* If PIC, we cannot make sibling calls to global functions + because the PLT requires r12 to be live. */ static bool sh_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) { - return (decl + return (1 && (! TARGET_SHCOMPACT || current_function_args_info.stack_regs == 0) - && ! sh_cfun_interrupt_handler_p ()); + && ! sh_cfun_interrupt_handler_p () + && (! flag_pic + || (decl && ! TREE_PUBLIC (decl)) + || (decl && DECL_VISIBILITY (decl) != VISIBILITY_DEFAULT))); } /* Machine specific built-in functions. */ @@ -9227,6 +9669,7 @@ struct builtin_description /* describe number and signedness of arguments; arg[0] == result (1: unsigned, 2: signed, 4: don't care, 8: pointer 0: no argument */ +/* 9: 64 bit pointer, 10: 32 bit pointer */ static const char signature_args[][4] = { #define SH_BLTIN_V2SI2 0 @@ -9252,28 +9695,34 @@ static const char signature_args[][4] = #define SH_BLTIN_SISF 10 { 4, 2 }, #define SH_BLTIN_LDUA_L 11 - { 2, 8 }, + { 2, 10 }, #define SH_BLTIN_LDUA_Q 12 - { 1, 8 }, + { 1, 10 }, #define SH_BLTIN_STUA_L 13 - { 0, 8, 2 }, + { 0, 10, 2 }, #define SH_BLTIN_STUA_Q 14 - { 0, 8, 1 }, -#define SH_BLTIN_UDI 15 - { 0, 8, 1 }, -#define SH_BLTIN_NUM_SHARED_SIGNATURES 16 -#define SH_BLTIN_2 16 -#define SH_BLTIN_SU 16 + { 0, 10, 1 }, +#define SH_BLTIN_LDUA_L64 15 + { 2, 9 }, +#define SH_BLTIN_LDUA_Q64 16 + { 1, 9 }, +#define SH_BLTIN_STUA_L64 17 + { 0, 9, 2 }, +#define SH_BLTIN_STUA_Q64 18 + { 0, 9, 1 }, +#define SH_BLTIN_NUM_SHARED_SIGNATURES 19 +#define SH_BLTIN_2 19 +#define SH_BLTIN_SU 19 { 1, 2 }, -#define SH_BLTIN_3 17 -#define SH_BLTIN_SUS 17 +#define SH_BLTIN_3 20 +#define SH_BLTIN_SUS 20 { 2, 2, 1 }, -#define SH_BLTIN_PSSV 18 +#define SH_BLTIN_PSSV 21 { 0, 8, 2, 2 }, -#define SH_BLTIN_XXUU 19 -#define SH_BLTIN_UUUU 19 +#define SH_BLTIN_XXUU 22 +#define SH_BLTIN_UUUU 22 { 1, 1, 1, 1 }, -#define SH_BLTIN_PV 20 +#define SH_BLTIN_PV 23 { 0, 8 }, }; /* mcmv: operands considered unsigned. */ @@ -9291,10 +9740,7 @@ static const struct builtin_description bdesc[] = { CODE_FOR_ssaddv2si3,"__builtin_ssaddv2si3", SH_BLTIN_V2SI3 }, { CODE_FOR_usaddv8qi3,"__builtin_usaddv8qi3", SH_BLTIN_V8QI3 }, { CODE_FOR_ssaddv4hi3,"__builtin_ssaddv4hi3", SH_BLTIN_V4HI3 }, -#if 0 - { CODE_FOR_alloco32, "__builtin_sh_media_ALLOCO", SH_BLTIN_PV }, - { CODE_FOR_alloco64, "__builtin_sh_media_ALLOCO", SH_BLTIN_PV }, -#endif + { CODE_FOR_alloco_i, "__builtin_sh_media_ALLOCO", SH_BLTIN_PV }, { CODE_FOR_negcmpeqv8qi,"__builtin_sh_media_MCMPEQ_B", SH_BLTIN_V8QI3 }, { CODE_FOR_negcmpeqv2si,"__builtin_sh_media_MCMPEQ_L", SH_BLTIN_V2SI3 }, { CODE_FOR_negcmpeqv4hi,"__builtin_sh_media_MCMPEQ_W", SH_BLTIN_V4HI3 }, @@ -9305,13 +9751,13 @@ static const struct builtin_description bdesc[] = { CODE_FOR_mcnvs_lw, "__builtin_sh_media_MCNVS_LW", SH_BLTIN_3 }, { CODE_FOR_mcnvs_wb, "__builtin_sh_media_MCNVS_WB", SH_BLTIN_V4HI2V8QI }, { CODE_FOR_mcnvs_wub, "__builtin_sh_media_MCNVS_WUB", SH_BLTIN_V4HI2V8QI }, - { CODE_FOR_mextr1, "__builtin_sh_media_MEXTR1", SH_BLTIN_UDI }, - { CODE_FOR_mextr2, "__builtin_sh_media_MEXTR2", SH_BLTIN_UDI }, - { CODE_FOR_mextr3, "__builtin_sh_media_MEXTR3", SH_BLTIN_UDI }, - { CODE_FOR_mextr4, "__builtin_sh_media_MEXTR4", SH_BLTIN_UDI }, - { CODE_FOR_mextr5, "__builtin_sh_media_MEXTR5", SH_BLTIN_UDI }, - { CODE_FOR_mextr6, "__builtin_sh_media_MEXTR6", SH_BLTIN_UDI }, - { CODE_FOR_mextr7, "__builtin_sh_media_MEXTR7", SH_BLTIN_UDI }, + { CODE_FOR_mextr1, "__builtin_sh_media_MEXTR1", SH_BLTIN_V8QI3 }, + { CODE_FOR_mextr2, "__builtin_sh_media_MEXTR2", SH_BLTIN_V8QI3 }, + { CODE_FOR_mextr3, "__builtin_sh_media_MEXTR3", SH_BLTIN_V8QI3 }, + { CODE_FOR_mextr4, "__builtin_sh_media_MEXTR4", SH_BLTIN_V8QI3 }, + { CODE_FOR_mextr5, "__builtin_sh_media_MEXTR5", SH_BLTIN_V8QI3 }, + { CODE_FOR_mextr6, "__builtin_sh_media_MEXTR6", SH_BLTIN_V8QI3 }, + { CODE_FOR_mextr7, "__builtin_sh_media_MEXTR7", SH_BLTIN_V8QI3 }, { CODE_FOR_mmacfx_wl, "__builtin_sh_media_MMACFX_WL", SH_BLTIN_MAC_HISI }, { CODE_FOR_mmacnfx_wl,"__builtin_sh_media_MMACNFX_WL", SH_BLTIN_MAC_HISI }, { CODE_FOR_mulv2si3, "__builtin_mulv2si3", SH_BLTIN_V2SI3, }, @@ -9348,8 +9794,10 @@ static const struct builtin_description bdesc[] = { CODE_FOR_fsina_s, "__builtin_sh_media_FSINA_S", SH_BLTIN_SISF }, { CODE_FOR_fipr, "__builtin_sh_media_FIPR_S", SH_BLTIN_3 }, { CODE_FOR_ftrv, "__builtin_sh_media_FTRV_S", SH_BLTIN_3 }, + { CODE_FOR_mac_media, "__builtin_sh_media_FMAC_S", SH_BLTIN_3 }, + { CODE_FOR_sqrtdf2, "__builtin_sh_media_FSQRT_D", SH_BLTIN_2 }, + { CODE_FOR_sqrtsf2, "__builtin_sh_media_FSQRT_S", SH_BLTIN_2 }, { CODE_FOR_fsrra_s, "__builtin_sh_media_FSRRA_S", SH_BLTIN_2 }, -#if 0 { CODE_FOR_ldhi_l, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L }, { CODE_FOR_ldhi_q, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q }, { CODE_FOR_ldlo_l, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L }, @@ -9358,21 +9806,17 @@ static const struct builtin_description bdesc[] = { CODE_FOR_sthi_q, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q }, { CODE_FOR_stlo_l, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L }, { CODE_FOR_stlo_q, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q }, - { CODE_FOR_ldhi_l64, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L }, - { CODE_FOR_ldhi_q64, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q }, - { CODE_FOR_ldlo_l64, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L }, - { CODE_FOR_ldlo_q64, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q }, - { CODE_FOR_sthi_l64, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L }, - { CODE_FOR_sthi_q64, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q }, - { CODE_FOR_stlo_l64, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L }, - { CODE_FOR_stlo_q64, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q }, -#endif + { CODE_FOR_ldhi_l64, "__builtin_sh_media_LDHI_L", SH_BLTIN_LDUA_L64 }, + { CODE_FOR_ldhi_q64, "__builtin_sh_media_LDHI_Q", SH_BLTIN_LDUA_Q64 }, + { CODE_FOR_ldlo_l64, "__builtin_sh_media_LDLO_L", SH_BLTIN_LDUA_L64 }, + { CODE_FOR_ldlo_q64, "__builtin_sh_media_LDLO_Q", SH_BLTIN_LDUA_Q64 }, + { CODE_FOR_sthi_l64, "__builtin_sh_media_STHI_L", SH_BLTIN_STUA_L64 }, + { CODE_FOR_sthi_q64, "__builtin_sh_media_STHI_Q", SH_BLTIN_STUA_Q64 }, + { CODE_FOR_stlo_l64, "__builtin_sh_media_STLO_L", SH_BLTIN_STUA_L64 }, + { CODE_FOR_stlo_q64, "__builtin_sh_media_STLO_Q", SH_BLTIN_STUA_Q64 }, { CODE_FOR_nsb, "__builtin_sh_media_NSB", SH_BLTIN_SU }, { CODE_FOR_byterev, "__builtin_sh_media_BYTEREV", SH_BLTIN_2 }, -#if 0 - { CODE_FOR_prefetch32,"__builtin_sh_media_PREFO", SH_BLTIN_PSSV }, - { CODE_FOR_prefetch64,"__builtin_sh_media_PREFO", SH_BLTIN_PSSV } -#endif + { CODE_FOR_prefetch, "__builtin_sh_media_PREFO", SH_BLTIN_PSSV }, }; static void @@ -9384,7 +9828,7 @@ sh_media_init_builtins (void) memset (shared, 0, sizeof shared); for (d = bdesc; d - bdesc < (int) ARRAY_SIZE (bdesc); d++) { - tree type, arg_type; + tree type, arg_type = 0; int signature = d->signature; int i; @@ -9394,8 +9838,9 @@ sh_media_init_builtins (void) { int has_result = signature_args[signature][0] != 0; - if (signature_args[signature][1] == 8 - && (insn_data[d->icode].operand[has_result].mode != Pmode)) + if ((signature_args[signature][1] & 8) + && (((signature_args[signature][1] & 1) && TARGET_SHMEDIA32) + || ((signature_args[signature][1] & 2) && TARGET_SHMEDIA64))) continue; if (! TARGET_FPU_ANY && FLOAT_MODE_P (insn_data[d->icode].operand[0].mode)) @@ -9406,12 +9851,12 @@ sh_media_init_builtins (void) int arg = signature_args[signature][i]; int opno = i - 1 + has_result; - if (arg == 8) + if (arg & 8) arg_type = ptr_type_node; else if (arg) - arg_type = ((*lang_hooks.types.type_for_mode) - (insn_data[d->icode].operand[opno].mode, - (arg & 1))); + arg_type = (*lang_hooks.types.type_for_mode) + (insn_data[d->icode].operand[opno].mode, + (arg & 1)); else if (i) continue; else @@ -9486,7 +9931,7 @@ sh_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, enum machine_mode tmode = VOIDmode; int nop = 0, i; rtx op[4]; - rtx pat; + rtx pat = 0; if (signature_args[signature][0]) { @@ -9507,6 +9952,7 @@ sh_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, { tree arg; enum machine_mode opmode, argmode; + tree optype; if (! signature_args[signature][i]) break; @@ -9514,11 +9960,19 @@ sh_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, if (arg == error_mark_node) return const0_rtx; arglist = TREE_CHAIN (arglist); - opmode = insn_data[icode].operand[nop].mode; + if (signature_args[signature][i] & 8) + { + opmode = ptr_mode; + optype = ptr_type_node; + } + else + { + opmode = insn_data[icode].operand[nop].mode; + optype = (*lang_hooks.types.type_for_mode) (opmode, 0); + } argmode = TYPE_MODE (TREE_TYPE (arg)); if (argmode != opmode) - arg = build1 (NOP_EXPR, - (*lang_hooks.types.type_for_mode) (opmode, 0), arg); + arg = build1 (NOP_EXPR, optype, arg); op[nop] = expand_expr (arg, NULL_RTX, opmode, 0); if (! (*insn_data[icode].operand[nop].predicate) (op[nop], opmode)) op[nop] = copy_to_mode_reg (opmode, op[nop]); @@ -9539,7 +9993,7 @@ sh_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED, pat = (*insn_data[d->icode].genfun) (op[0], op[1], op[2], op[3]); break; default: - abort (); + gcc_unreachable (); } if (! pat) return 0; @@ -9668,6 +10122,16 @@ sh_register_move_cost (enum machine_mode mode, || ((dstclass) == TARGET_REGS && ! REGCLASS_HAS_GENERAL_REG (srcclass))) return 20; + /* ??? ptabs faults on (value & 0x3) == 0x3 */ + if (TARGET_SHMEDIA + && ((srcclass) == TARGET_REGS || (srcclass) == SIBCALL_REGS)) + { + if (*sh_gettrcost_str) + return atoi (sh_gettrcost_str); + else if (!TARGET_PT_FIXED) + return 100; + } + if ((srcclass == FPSCR_REGS && ! REGCLASS_HAS_GENERAL_REG (dstclass)) || (dstclass == FPSCR_REGS && ! REGCLASS_HAS_GENERAL_REG (srcclass))) return 4; @@ -9695,11 +10159,43 @@ int cmpsi_operand (rtx op, enum machine_mode mode) { if (GET_CODE (op) == REG && REGNO (op) == T_REG - && GET_MODE (op) == SImode) + && GET_MODE (op) == SImode + && TARGET_SH1) return 1; return arith_operand (op, mode); } +int +shift_count_reg_operand (rtx op, enum machine_mode mode) +{ + if ((GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND + || (GET_CODE (op) == SUBREG && SUBREG_BYTE (op) == 0)) + && (mode == VOIDmode || mode == GET_MODE (op)) + && GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0))) >= 6 + && GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_INT) + { + mode = VOIDmode; + do + op = XEXP (op, 0); + while ((GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == SIGN_EXTEND + || GET_CODE (op) == TRUNCATE) + && GET_MODE_BITSIZE (GET_MODE (XEXP (op, 0))) >= 6 + && GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_INT); + + } + return arith_reg_operand (op, mode); +} + +int +shift_count_operand (rtx op, enum machine_mode mode) +{ + return (CONSTANT_P (op) + ? (GET_CODE (op) == CONST_INT + ? (unsigned) INTVAL (op) < GET_MODE_BITSIZE (mode) + : nonmemory_operand (op, mode)) + : shift_count_reg_operand (op, mode)); +} + static rtx emit_load_ptr (rtx, rtx); static rtx @@ -9712,7 +10208,7 @@ emit_load_ptr (rtx reg, rtx addr) return emit_move_insn (reg, mem); } -void +static void sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, tree function) @@ -9724,6 +10220,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, int simple_add = CONST_OK_FOR_ADD (delta); int did_load = 0; rtx scratch0, scratch1, scratch2; + unsigned i; reload_completed = 1; epilogue_completed = 1; @@ -9754,18 +10251,39 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, static chain pointer (even if you can't have nested virtual functions right now, someone might implement them sometime), and the rest of the registers are used for argument passing, are callee-saved, or reserved. */ + /* We need to check call_used_regs / fixed_regs in case -fcall_saved-reg / + -ffixed-reg has been used. */ + if (! call_used_regs[0] || fixed_regs[0]) + error ("r0 needs to be available as a call-clobbered register"); scratch0 = scratch1 = scratch2 = gen_rtx_REG (Pmode, 0); if (! TARGET_SH5) { - scratch1 = gen_rtx_REG (ptr_mode, 1); + if (call_used_regs[1] && ! fixed_regs[1]) + scratch1 = gen_rtx_REG (ptr_mode, 1); /* N.B., if not TARGET_HITACHI, register 2 is used to pass the pointer pointing where to return struct values. */ - scratch2 = gen_rtx_REG (Pmode, 3); + if (call_used_regs[3] && ! fixed_regs[3]) + scratch2 = gen_rtx_REG (Pmode, 3); } else if (TARGET_SHMEDIA) { - scratch1 = gen_rtx_REG (ptr_mode, 21); - scratch2 = gen_rtx_REG (Pmode, TR0_REG); + for (i = FIRST_GENERAL_REG; i <= LAST_GENERAL_REG; i++) + if (i != REGNO (scratch0) && + call_used_regs[i] && ! fixed_regs[i] && ! FUNCTION_ARG_REGNO_P (i)) + { + scratch1 = gen_rtx_REG (ptr_mode, i); + break; + } + if (scratch1 == scratch0) + error ("Need a second call-clobbered general purpose register"); + for (i = FIRST_TARGET_REG; i <= LAST_TARGET_REG; i++) + if (call_used_regs[i] && ! fixed_regs[i]) + { + scratch2 = gen_rtx_REG (Pmode, i); + break; + } + if (scratch2 == scratch0) + error ("Need a call-clobbered target register"); } this_value = plus_constant (this, delta); @@ -9797,7 +10315,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, offset_addr = plus_constant (scratch0, vcall_offset); if (strict_memory_address_p (ptr_mode, offset_addr)) ; /* Do nothing. */ - else if (! TARGET_SH5) + else if (! TARGET_SH5 && scratch0 != scratch1) { /* scratch0 != scratch1, and we have indexed loads. Get better schedule by loading the offset into r1 and using an indexed @@ -9818,7 +10336,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, offset_addr = scratch0; } else - abort (); /* FIXME */ + gcc_unreachable (); /* FIXME */ emit_load_ptr (scratch0, offset_addr); if (Pmode != ptr_mode) @@ -9833,9 +10351,30 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, TREE_USED (function) = 1; } funexp = XEXP (DECL_RTL (function), 0); - emit_move_insn (scratch2, funexp); - funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2); - sibcall = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX)); + /* If the function is overridden, so is the thunk, hence we don't + need GOT addressing even if this is a public symbol. */ +#if 0 + if (TARGET_SH1 && ! flag_weak) + sibcall = gen_sibcalli_thunk (funexp, const0_rtx); + else +#endif + if (TARGET_SH2 && flag_pic) + { + sibcall = gen_sibcall_pcrel (funexp, const0_rtx); + XEXP (XVECEXP (sibcall, 0, 2), 0) = scratch2; + } + else + { + if (TARGET_SHMEDIA && flag_pic) + { + funexp = gen_sym2PIC (funexp); + PUT_MODE (funexp, Pmode); + } + emit_move_insn (scratch2, funexp); + funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2); + sibcall = gen_sibcall (funexp, const0_rtx, NULL_RTX); + } + sibcall = emit_call_insn (sibcall); SIBLING_CALL_P (sibcall) = 1; use_reg (&CALL_INSN_FUNCTION_USAGE (sibcall), this); emit_barrier (); @@ -9852,7 +10391,7 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, /* Initialize the bitmap obstacks. */ bitmap_obstack_initialize (NULL); bitmap_obstack_initialize (®_obstack); - if (! basic_block_info) + if (! cfun->cfg) init_flow (); rtl_register_cfg_hooks (); find_basic_blocks (insns); @@ -9866,10 +10405,17 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, sh_reorg (); if (optimize > 0 && flag_delayed_branch) - dbr_schedule (insns, dump_file); + { + if (! cfun->cfg) + { + init_flow (); + find_basic_blocks (insns); + } + dbr_schedule (insns, dump_file); + } shorten_branches (insns); final_start_function (insns, file, 1); - final (insns, file, 1, 0); + final (insns, file, 1); final_end_function (); if (optimize > 0 && flag_schedule_insns_after_reload) @@ -9888,10 +10434,49 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, } rtx -function_symbol (const char *name) +function_symbol (rtx target, const char *name, enum sh_function_kind kind) { - rtx sym = gen_rtx_SYMBOL_REF (Pmode, name); + rtx sym; + + /* If this is not an ordinary function, the name usually comes from a + string literal or an sprintf buffer. Make sure we use the same + string consistently, so that cse will be able to unify address loads. */ + if (kind != FUNCTION_ORDINARY) + name = IDENTIFIER_POINTER (get_identifier (name)); + sym = gen_rtx_SYMBOL_REF (Pmode, name); SYMBOL_REF_FLAGS (sym) = SYMBOL_FLAG_FUNCTION; + if (flag_pic) + switch (kind) + { + case FUNCTION_ORDINARY: + break; + case SFUNC_GOT: + { + rtx reg = target ? target : gen_reg_rtx (Pmode); + + emit_insn (gen_symGOT2reg (reg, sym)); + sym = reg; + break; + } + case SFUNC_STATIC: + { + /* ??? To allow cse to work, we use GOTOFF relocations. + we could add combiner patterns to transform this into + straight pc-relative calls with sym2PIC / bsrf when + label load and function call are still 1:1 and in the + same basic block during combine. */ + rtx reg = target ? target : gen_reg_rtx (Pmode); + + emit_insn (gen_symGOTOFF2reg (reg, sym)); + sym = reg; + break; + } + } + if (target && sym != target) + { + emit_move_insn (target, sym); + return target; + } return sym; } @@ -9983,9 +10568,8 @@ extract_sfunc_addr (rtx insn) && GENERAL_REGISTER_P (true_regnum (XEXP (part, 0)))) return XEXP (part, 0); } - if (GET_CODE (XVECEXP (pattern, 0, 0)) == UNSPEC_VOLATILE) - return XVECEXP (XVECEXP (pattern, 0, 0), 0, 1); - abort (); + gcc_assert (GET_CODE (XVECEXP (pattern, 0, 0)) == UNSPEC_VOLATILE); + return XVECEXP (XVECEXP (pattern, 0, 0), 0, 1); } /* Verify that the register in use_sfunc_addr still agrees with the address @@ -10011,7 +10595,7 @@ check_use_sfunc_addr (rtx insn, rtx reg) continue; return rtx_equal_p (extract_sfunc_addr (insn), reg); } - abort (); + gcc_unreachable (); } /* Returns 1 if OP is a MEM that can be source of a simple move operation. */ @@ -10155,7 +10739,7 @@ sh_init_cumulative_args (CUMULATIVE_ARGS * pcum, the TYPE or the FNDECL available so we synthesize the contents of that function as best we can. */ pcum->force_mem = - (TARGET_DEFAULT & HITACHI_BIT) + (TARGET_DEFAULT & MASK_HITACHI) && (mode == BLKmode || (GET_MODE_SIZE (mode) > 4 && !(mode == DFmode @@ -10184,4 +10768,540 @@ lose: return 0; } +#ifdef TARGET_ADJUST_UNROLL_MAX +static int +sh_adjust_unroll_max (struct loop * loop, int insn_count, + int max_unrolled_insns, int strength_reduce_p, + int unroll_type) +{ +/* This doesn't work in 4.0 because the old unroller & loop.h is gone. */ + if (TARGET_ADJUST_UNROLL && TARGET_SHMEDIA) + { + /* Throttle back loop unrolling so that the costs of using more + targets than the eight target register we have don't outweigh + the benefits of unrolling. */ + rtx insn; + int n_labels = 0, n_calls = 0, n_exit_dest = 0, n_inner_loops = -1; + int n_barriers = 0; + rtx dest; + int i; + rtx exit_dest[8]; + int threshold; + int unroll_benefit = 0, mem_latency = 0; + int base_cost, best_cost, cost; + int factor, best_factor; + int n_dest; + unsigned max_iterations = 32767; + int n_iterations; + int need_precond = 0, precond = 0; + basic_block * bbs = get_loop_body (loop); + struct niter_desc *desc; + + /* Assume that all labels inside the loop are used from inside the + loop. If the loop has multiple entry points, it is unlikely to + be unrolled anyways. + Also assume that all calls are to different functions. That is + somewhat pessimistic, but if you have lots of calls, unrolling the + loop is not likely to gain you much in the first place. */ + i = loop->num_nodes - 1; + for (insn = BB_HEAD (bbs[i]); ; ) + { + if (GET_CODE (insn) == CODE_LABEL) + n_labels++; + else if (GET_CODE (insn) == CALL_INSN) + n_calls++; + else if (GET_CODE (insn) == NOTE + && NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG) + n_inner_loops++; + else if (GET_CODE (insn) == BARRIER) + n_barriers++; + if (insn != BB_END (bbs[i])) + insn = NEXT_INSN (insn); + else if (--i >= 0) + insn = BB_HEAD (bbs[i]); + else + break; + } + free (bbs); + /* One label for the loop top is normal, and it won't be duplicated by + unrolling. */ + if (n_labels <= 1) + return max_unrolled_insns; + if (n_inner_loops > 0) + return 0; + for (dest = loop->exit_labels; dest && n_exit_dest < 8; + dest = LABEL_NEXTREF (dest)) + { + for (i = n_exit_dest - 1; + i >= 0 && XEXP (dest, 0) != XEXP (exit_dest[i], 0); i--); + if (i < 0) + exit_dest[n_exit_dest++] = dest; + } + /* If the loop top and call and exit destinations are enough to fill up + the target registers, we're unlikely to do any more damage by + unrolling. */ + if (n_calls + n_exit_dest >= 7) + return max_unrolled_insns; + + /* ??? In the new loop unroller, there is no longer any strength + reduction information available. Thus, when it comes to unrolling, + we know the cost of everything, but we know the value of nothing. */ +#if 0 + if (strength_reduce_p + && (unroll_type == LPT_UNROLL_RUNTIME + || unroll_type == LPT_UNROLL_CONSTANT + || unroll_type == LPT_PEEL_COMPLETELY)) + { + struct loop_ivs *ivs = LOOP_IVS (loop); + struct iv_class *bl; + + /* We'll save one compare-and-branch in each loop body copy + but the last one. */ + unroll_benefit = 1; + /* Assess the benefit of removing biv & giv updates. */ + for (bl = ivs->list; bl; bl = bl->next) + { + rtx increment = biv_total_increment (bl); + struct induction *v; + + if (increment && GET_CODE (increment) == CONST_INT) + { + unroll_benefit++; + for (v = bl->giv; v; v = v->next_iv) + { + if (! v->ignore && v->same == 0 + && GET_CODE (v->mult_val) == CONST_INT) + unroll_benefit++; + /* If this giv uses an array, try to determine + a maximum iteration count from the size of the + array. This need not be correct all the time, + but should not be too far off the mark too often. */ + while (v->giv_type == DEST_ADDR) + { + rtx mem = PATTERN (v->insn); + tree mem_expr, type, size_tree; + + if (GET_CODE (SET_SRC (mem)) == MEM) + mem = SET_SRC (mem); + else if (GET_CODE (SET_DEST (mem)) == MEM) + mem = SET_DEST (mem); + else + break; + mem_expr = MEM_EXPR (mem); + if (! mem_expr) + break; + type = TREE_TYPE (mem_expr); + if (TREE_CODE (type) != ARRAY_TYPE + || ! TYPE_SIZE (type) || ! TYPE_SIZE_UNIT (type)) + break; + size_tree = fold (build (TRUNC_DIV_EXPR, + bitsizetype, + TYPE_SIZE (type), + TYPE_SIZE_UNIT (type))); + if (TREE_CODE (size_tree) == INTEGER_CST + && ! TREE_INT_CST_HIGH (size_tree) + && TREE_INT_CST_LOW (size_tree) < max_iterations) + max_iterations = TREE_INT_CST_LOW (size_tree); + break; + } + } + } + } + } +#else /* 0 */ + /* Assume there is at least some benefit. */ + unroll_benefit = 1; +#endif /* 0 */ + + desc = get_simple_loop_desc (loop); + n_iterations = desc->const_iter ? desc->niter : 0; + max_iterations + = max_iterations < desc->niter_max ? max_iterations : desc->niter_max; + + if (! strength_reduce_p || ! n_iterations) + need_precond = 1; + if (! n_iterations) + { + n_iterations + = max_iterations < 3 ? max_iterations : max_iterations * 3 / 4; + if (! n_iterations) + return 0; + } +#if 0 /* ??? See above - missing induction variable information. */ + while (unroll_benefit > 1) /* no loop */ + { + /* We include the benefit of biv/ giv updates. Check if some or + all of these updates are likely to fit into a scheduling + bubble of a load. + We check for the following case: + - All the insns leading to the first JUMP_INSN are in a strict + dependency chain. + - there is at least one memory reference in them. + + When we find such a pattern, we assume that we can hide as many + updates as the total of the load latency is, if we have an + unroll factor of at least two. We might or might not also do + this without unrolling, so rather than considering this as an + extra unroll benefit, discount it in the unroll benefits of unroll + factors higher than two. */ + + rtx set, last_set; + + insn = next_active_insn (loop->start); + last_set = single_set (insn); + if (! last_set) + break; + if (GET_CODE (SET_SRC (last_set)) == MEM) + mem_latency += 2; + for (insn = NEXT_INSN (insn); insn != end; insn = NEXT_INSN (insn)) + { + if (! INSN_P (insn)) + continue; + if (GET_CODE (insn) == JUMP_INSN) + break; + if (! reg_referenced_p (SET_DEST (last_set), PATTERN (insn))) + { + /* Check if this is a to-be-reduced giv insn. */ + struct loop_ivs *ivs = LOOP_IVS (loop); + struct iv_class *bl; + struct induction *v; + for (bl = ivs->list; bl; bl = bl->next) + { + if (bl->biv->insn == insn) + goto is_biv; + for (v = bl->giv; v; v = v->next_iv) + if (v->insn == insn) + goto is_giv; + } + mem_latency--; + is_biv: + is_giv: + continue; + } + set = single_set (insn); + if (! set) + continue; + if (GET_CODE (SET_SRC (set)) == MEM) + mem_latency += 2; + last_set = set; + } + if (mem_latency < 0) + mem_latency = 0; + else if (mem_latency > unroll_benefit - 1) + mem_latency = unroll_benefit - 1; + break; + } +#endif /* 0 */ + if (n_labels + (unroll_benefit + n_labels * 8) / n_iterations + <= unroll_benefit) + return max_unrolled_insns; + + n_dest = n_labels + n_calls + n_exit_dest; + base_cost = n_dest <= 8 ? 0 : n_dest - 7; + best_cost = 0; + best_factor = 1; + if (n_barriers * 2 > n_labels - 1) + n_barriers = (n_labels - 1) / 2; + for (factor = 2; factor <= 8; factor++) + { + /* Bump up preconditioning cost for each power of two. */ + if (! (factor & (factor-1))) + precond += 4; + /* When preconditioning, only powers of two will be considered. */ + else if (need_precond) + continue; + n_dest = ((unroll_type != LPT_PEEL_COMPLETELY) + + (n_labels - 1) * factor + n_calls + n_exit_dest + - (n_barriers * factor >> 1) + + need_precond); + cost + = ((n_dest <= 8 ? 0 : n_dest - 7) + - base_cost * factor + - ((factor > 2 ? unroll_benefit - mem_latency : unroll_benefit) + * (factor - (unroll_type != LPT_PEEL_COMPLETELY))) + + ((unroll_benefit + 1 + (n_labels - 1) * factor) + / n_iterations)); + if (need_precond) + cost += (precond + unroll_benefit * factor / 2) / n_iterations; + if (cost < best_cost) + { + best_cost = cost; + best_factor = factor; + } + } + threshold = best_factor * insn_count; + if (max_unrolled_insns > threshold) + max_unrolled_insns = threshold; + } + return max_unrolled_insns; +} +#endif /* TARGET_ADJUST_UNROLL_MAX */ + +/* Replace any occurrence of FROM(n) in X with TO(n). The function does + not enter into CONST_DOUBLE for the replace. + + Note that copying is not done so X must not be shared unless all copies + are to be modified. + + This is like replace_rtx, except that we operate on N_REPLACEMENTS + replacements simultaneously - FROM(n) is replacements[n*2] and to(n) is + replacements[n*2+1] - and that we take mode changes into account. + + If a replacement is ambiguous, return NULL_RTX. + + If MODIFY is zero, don't modify any rtl in place, + just return zero or nonzero for failure / success. */ + +rtx +replace_n_hard_rtx (rtx x, rtx *replacements, int n_replacements, int modify) +{ + int i, j; + const char *fmt; + + /* The following prevents loops occurrence when we change MEM in + CONST_DOUBLE onto the same CONST_DOUBLE. */ + if (x != 0 && GET_CODE (x) == CONST_DOUBLE) + return x; + + for (i = n_replacements - 1; i >= 0 ; i--) + if (x == replacements[i*2] && GET_MODE (x) == GET_MODE (replacements[i*2+1])) + return replacements[i*2+1]; + + /* Allow this function to make replacements in EXPR_LISTs. */ + if (x == 0) + return 0; + + if (GET_CODE (x) == SUBREG) + { + rtx new = replace_n_hard_rtx (SUBREG_REG (x), replacements, + n_replacements, modify); + + if (GET_CODE (new) == CONST_INT) + { + x = simplify_subreg (GET_MODE (x), new, + GET_MODE (SUBREG_REG (x)), + SUBREG_BYTE (x)); + if (! x) + abort (); + } + else if (modify) + SUBREG_REG (x) = new; + + return x; + } + else if (GET_CODE (x) == REG) + { + unsigned regno = REGNO (x); + unsigned nregs = (regno < FIRST_PSEUDO_REGISTER + ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1); + rtx result = NULL_RTX; + + for (i = n_replacements - 1; i >= 0; i--) + { + rtx from = replacements[i*2]; + rtx to = replacements[i*2+1]; + unsigned from_regno, from_nregs, to_regno, new_regno; + + if (GET_CODE (from) != REG) + continue; + from_regno = REGNO (from); + from_nregs = (from_regno < FIRST_PSEUDO_REGISTER + ? HARD_REGNO_NREGS (from_regno, GET_MODE (from)) : 1); + if (regno < from_regno + from_nregs && regno + nregs > from_regno) + { + if (regno < from_regno + || regno + nregs > from_regno + nregs + || GET_CODE (to) != REG + || result) + return NULL_RTX; + to_regno = REGNO (to); + if (to_regno < FIRST_PSEUDO_REGISTER) + { + new_regno = regno + to_regno - from_regno; + if ((unsigned) HARD_REGNO_NREGS (new_regno, GET_MODE (x)) + != nregs) + return NULL_RTX; + result = gen_rtx_REG (GET_MODE (x), new_regno); + } + else if (GET_MODE (x) <= GET_MODE (to)) + result = gen_lowpart_common (GET_MODE (x), to); + else + result = gen_lowpart_SUBREG (GET_MODE (x), to); + } + } + return result ? result : x; + } + else if (GET_CODE (x) == ZERO_EXTEND) + { + rtx new = replace_n_hard_rtx (XEXP (x, 0), replacements, + n_replacements, modify); + + if (GET_CODE (new) == CONST_INT) + { + x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x), + new, GET_MODE (XEXP (x, 0))); + if (! x) + abort (); + } + else if (modify) + XEXP (x, 0) = new; + + return x; + } + + fmt = GET_RTX_FORMAT (GET_CODE (x)); + for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) + { + rtx new; + + if (fmt[i] == 'e') + { + new = replace_n_hard_rtx (XEXP (x, i), replacements, + n_replacements, modify); + if (!new) + return NULL_RTX; + if (modify) + XEXP (x, i) = new; + } + else if (fmt[i] == 'E') + for (j = XVECLEN (x, i) - 1; j >= 0; j--) + { + new = replace_n_hard_rtx (XVECEXP (x, i, j), replacements, + n_replacements, modify); + if (!new) + return NULL_RTX; + if (modify) + XVECEXP (x, i, j) = new; + } + } + + return x; +} + +rtx +sh_gen_truncate (enum machine_mode mode, rtx x, int need_sign_ext) +{ + enum rtx_code code = TRUNCATE; + + if (GET_CODE (x) == ZERO_EXTEND || GET_CODE (x) == SIGN_EXTEND) + { + rtx inner = XEXP (x, 0); + enum machine_mode inner_mode = GET_MODE (inner); + + if (inner_mode == mode) + return inner; + else if (GET_MODE_SIZE (inner_mode) >= GET_MODE_SIZE (mode)) + x = inner; + else if (GET_MODE_SIZE (inner_mode) < GET_MODE_SIZE (mode) + && (! need_sign_ext || GET_CODE (x) == SIGN_EXTEND)) + { + code = GET_CODE (x); + x = inner; + } + } + return gen_rtx_fmt_e (code, mode, x); +} + +/* called via for_each_rtx after reload, to clean up truncates of + registers that span multiple actual hard registers. */ +int +shmedia_cleanup_truncate (rtx *p, void *n_changes) +{ + rtx x = *p, reg; + + if (GET_CODE (x) != TRUNCATE) + return 0; + reg = XEXP (x, 0); + if (GET_MODE_SIZE (GET_MODE (reg)) > 8 && GET_CODE (reg) == REG) + { + enum machine_mode reg_mode = GET_MODE (reg); + XEXP (x, 0) = simplify_subreg (DImode, reg, reg_mode, + subreg_lowpart_offset (DImode, reg_mode)); + *(int*) n_changes += 1; + return -1; + } + return 0; +} + +/* Load and store depend on the highpart of the address. However, + set_attr_alternative does not give well-defined results before reload, + so we must look at the rtl ourselves to see if any of the feeding + registers is used in a memref. */ + +/* Called by sh_contains_memref_p via for_each_rtx. */ +static int +sh_contains_memref_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED) +{ + return (GET_CODE (*loc) == MEM); +} + +/* Return non-zero iff INSN contains a MEM. */ +int +sh_contains_memref_p (rtx insn) +{ + return for_each_rtx (&PATTERN (insn), &sh_contains_memref_p_1, NULL); +} + +/* FNADDR is the MEM expression from a call expander. Return an address + to use in an SHmedia insn pattern. */ +rtx +shmedia_prepare_call_address (rtx fnaddr, int is_sibcall) +{ + int is_sym; + + fnaddr = XEXP (fnaddr, 0); + is_sym = GET_CODE (fnaddr) == SYMBOL_REF; + if (flag_pic && is_sym) + { + if (! SYMBOL_REF_LOCAL_P (fnaddr)) + { + rtx reg = gen_reg_rtx (Pmode); + + /* We must not use GOTPLT for sibcalls, because PIC_REG + must be restored before the PLT code gets to run. */ + if (is_sibcall) + emit_insn (gen_symGOT2reg (reg, fnaddr)); + else + emit_insn (gen_symGOTPLT2reg (reg, fnaddr)); + fnaddr = reg; + } + else + { + fnaddr = gen_sym2PIC (fnaddr); + PUT_MODE (fnaddr, Pmode); + } + } + /* If ptabs might trap, make this visible to the rest of the compiler. + We generally assume that symbols pertain to valid locations, but + it is possible to generate invalid symbols with asm or linker tricks. + In a list of functions where each returns its successor, an invalid + symbol might denote an empty list. */ + if (!TARGET_PT_FIXED + && (!is_sym || TARGET_INVALID_SYMBOLS) + && (!REG_P (fnaddr) || ! TARGET_REGISTER_P (REGNO (fnaddr)))) + { + rtx tr = gen_reg_rtx (PDImode); + + emit_insn (gen_ptabs (tr, fnaddr)); + fnaddr = tr; + } + else if (! target_reg_operand (fnaddr, Pmode)) + fnaddr = copy_to_mode_reg (Pmode, fnaddr); + return fnaddr; +} + +const char *sh_multcost_str = ""; +const char *sh_gettrcost_str = ""; +const char *sh_div_str = ""; +const char *sh_divsi3_libfunc = ""; +const char *cut2_workaround_str = ""; +enum sh_divide_strategy_e sh_div_strategy = SH_DIV_STRATEGY_DEFAULT; + +/* This defines the storage for the variable part of a -mboard= option. + It is only required when using the sh-superh-elf target */ +#ifdef _SUPERH_H +const char * boardtype = "7750p2"; +const char * osruntime = "bare"; +#endif + #include "gt-sh.h" diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index edeb135714b..92d8ce00696 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler for Renesas / SuperH SH. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steve Chamberlain (sac@cygnus.com). Improved by Jim Wilson (wilson@cygnus.com). @@ -84,6 +84,10 @@ do { \ builtin_define ("__SH4_NOFPU__"); \ } \ } \ + if (TARGET_FPU_ANY) \ + builtin_define ("__SH_FPU_ANY__"); \ + if (TARGET_FPU_DOUBLE) \ + builtin_define ("__SH_FPU_DOUBLE__"); \ if (TARGET_HITACHI) \ builtin_define ("__HITACHI__"); \ builtin_define (TARGET_LITTLE_ENDIAN \ @@ -144,104 +148,49 @@ do { \ SET_HARD_REG_BIT (reg_class_contents[SIBCALL_REGS], regno); \ } while (0) -/* ??? Need to write documentation for all SH options and add it to the - invoke.texi file. */ - -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; -#define ISIZE_BIT (1<<1) -#define DALIGN_BIT (1<<6) -#define SH1_BIT (1<<8) -#define SH2_BIT (1<<9) -#define SH3_BIT (1<<10) -#define SH_E_BIT (1<<11) -#define HARD_SH4_BIT (1<<5) -#define FPU_SINGLE_BIT (1<<7) -#define SH4_BIT (1<<12) -#define SH4A_BIT (1<<3) -#define FMOVD_BIT (1<<4) -#define SH5_BIT (1<<0) -#define SPACE_BIT (1<<13) -#define BIGTABLE_BIT (1<<14) -#define RELAX_BIT (1<<15) -#define USERMODE_BIT (1<<16) -#define HITACHI_BIT (1<<22) -#define NOMACSAVE_BIT (1<<23) -#define PREFERGOT_BIT (1<<24) -#define PADSTRUCT_BIT (1<<28) -#define LITTLE_ENDIAN_BIT (1<<29) -#define IEEE_BIT (1<<30) -#define SAVE_ALL_TR_BIT (1<<2) -#define HARD_SH2A_BIT (1<<17) -#define HARD_SH2A_DOUBLE_BIT (1<<18) - /* Nonzero if this is an ELF target - compile time only */ #define TARGET_ELF 0 -/* Nonzero if we should dump out instruction size info. */ -#define TARGET_DUMPISIZE (target_flags & ISIZE_BIT) - -/* Nonzero to align doubles on 64 bit boundaries. */ -#define TARGET_ALIGN_DOUBLE (target_flags & DALIGN_BIT) - -/* Nonzero if we should generate code using type 1 insns. */ -#define TARGET_SH1 (target_flags & SH1_BIT) - -/* Nonzero if we should generate code using type 2 insns. */ -#define TARGET_SH2 (target_flags & SH2_BIT) - /* Nonzero if we should generate code using type 2E insns. */ -#define TARGET_SH2E ((target_flags & SH_E_BIT) && TARGET_SH2) +#define TARGET_SH2E (TARGET_SH2 && TARGET_SH_E) /* Nonzero if we should generate code using type 2A insns. */ -#define TARGET_SH2A (target_flags & HARD_SH2A_BIT) +#define TARGET_SH2A TARGET_HARD_SH2A /* Nonzero if we should generate code using type 2A SF insns. */ -#define TARGET_SH2A_SINGLE ((target_flags & HARD_SH2A_BIT) && TARGET_SH2E) +#define TARGET_SH2A_SINGLE (TARGET_SH2A && TARGET_SH2E) /* Nonzero if we should generate code using type 2A DF insns. */ -#define TARGET_SH2A_DOUBLE ((target_flags & HARD_SH2A_DOUBLE_BIT) && TARGET_SH2A) - -/* Nonzero if we should generate code using type 3 insns. */ -#define TARGET_SH3 (target_flags & SH3_BIT) +#define TARGET_SH2A_DOUBLE (TARGET_HARD_SH2A_DOUBLE && TARGET_SH2A) /* Nonzero if we should generate code using type 3E insns. */ -#define TARGET_SH3E ((target_flags & SH_E_BIT) && TARGET_SH3) +#define TARGET_SH3E (TARGET_SH3 && TARGET_SH_E) /* Nonzero if the cache line size is 32. */ -#define TARGET_CACHE32 (target_flags & HARD_SH4_BIT || TARGET_SH5) +#define TARGET_CACHE32 (TARGET_HARD_SH4 || TARGET_SH5) /* Nonzero if we schedule for a superscalar implementation. */ -#define TARGET_SUPERSCALAR (target_flags & HARD_SH4_BIT) +#define TARGET_SUPERSCALAR TARGET_HARD_SH4 /* Nonzero if the target has separate instruction and data caches. */ -#define TARGET_HARVARD (target_flags & HARD_SH4_BIT) - -/* Nonzero if compiling for SH4 hardware (to be used for insn costs etc.) */ -#define TARGET_HARD_SH4 (target_flags & HARD_SH4_BIT) - -/* Nonzero if the default precision of th FPU is single */ -#define TARGET_FPU_SINGLE (target_flags & FPU_SINGLE_BIT) +#define TARGET_HARVARD (TARGET_HARD_SH4 || TARGET_SH5) /* Nonzero if a double-precision FPU is available. */ -#define TARGET_FPU_DOUBLE ((target_flags & SH4_BIT) || TARGET_SH2A_DOUBLE) +#define TARGET_FPU_DOUBLE (TARGET_SH4 || TARGET_SH2A_DOUBLE) /* Nonzero if an FPU is available. */ #define TARGET_FPU_ANY (TARGET_SH2E || TARGET_FPU_DOUBLE) /* Nonzero if we should generate code using type 4 insns. */ -#define TARGET_SH4 ((target_flags & SH4_BIT) && (target_flags & SH1_BIT)) +#undef TARGET_SH4 +#define TARGET_SH4 ((target_flags & MASK_SH4) != 0 && TARGET_SH1) /* Nonzero if we're generating code for the common subset of instructions present on both SH4a and SH4al-dsp. */ -#define TARGET_SH4A_ARCH (target_flags & SH4A_BIT) +#define TARGET_SH4A_ARCH TARGET_SH4A /* Nonzero if we're generating code for SH4a, unless the use of the FPU is disabled (which makes it compatible with SH4al-dsp). */ #define TARGET_SH4A_FP (TARGET_SH4A_ARCH && TARGET_FPU_ANY) -/* Nonzero if we should generate code for a SH5 CPU (either ISA). */ -#define TARGET_SH5 (target_flags & SH5_BIT) - /* Nonzero if we should generate code using the SHcompact instruction set and 32-bit ABI. */ #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1) @@ -252,55 +201,14 @@ extern int target_flags; /* Nonzero if we should generate code using the SHmedia ISA and 32-bit ABI. */ -#define TARGET_SHMEDIA32 (TARGET_SH5 && ! TARGET_SH1 \ - && (target_flags & SH_E_BIT)) +#define TARGET_SHMEDIA32 (TARGET_SH5 && ! TARGET_SH1 && TARGET_SH_E) /* Nonzero if we should generate code using the SHmedia ISA and 64-bit ABI. */ -#define TARGET_SHMEDIA64 (TARGET_SH5 && ! TARGET_SH1 \ - && ! (target_flags & SH_E_BIT)) +#define TARGET_SHMEDIA64 (TARGET_SH5 && ! TARGET_SH1 && ! TARGET_SH_E) /* Nonzero if we should generate code using SHmedia FPU instructions. */ #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE) -/* Nonzero if we should generate fmovd. */ -#define TARGET_FMOVD (target_flags & FMOVD_BIT) - -/* Nonzero if we respect NANs. */ -#define TARGET_IEEE (target_flags & IEEE_BIT) - -/* Nonzero if we should generate smaller code rather than faster code. */ -#define TARGET_SMALLCODE (target_flags & SPACE_BIT) - -/* Nonzero to use long jump tables. */ -#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT) - -/* Nonzero to generate pseudo-ops needed by the assembler and linker - to do function call relaxing. */ -#define TARGET_RELAX (target_flags & RELAX_BIT) - -/* Nonzero if using Renesas's calling convention. */ -#define TARGET_HITACHI (target_flags & HITACHI_BIT) - -/* Nonzero if not saving macl/mach when using -mhitachi */ -#define TARGET_NOMACSAVE (target_flags & NOMACSAVE_BIT) - -/* Nonzero if padding structures to a multiple of 4 bytes. This is - incompatible with Renesas's compiler, and gives unusual structure layouts - which confuse programmers. - ??? This option is not useful, but is retained in case there are people - who are still relying on it. It may be deleted in the future. */ -#define TARGET_PADSTRUCT (target_flags & PADSTRUCT_BIT) - -/* Nonzero if generating code for a little endian SH. */ -#define TARGET_LITTLE_ENDIAN (target_flags & LITTLE_ENDIAN_BIT) - -/* Nonzero if we should do everything in userland. */ -#define TARGET_USERMODE (target_flags & USERMODE_BIT) - -/* Nonzero if we should prefer @GOT calls when generating PIC. */ -#define TARGET_PREFERGOT (target_flags & PREFERGOT_BIT) - -#define TARGET_SAVE_ALL_TARGET_REGS (target_flags & SAVE_ALL_TR_BIT) /* This is not used by the SH2E calling convention */ #define TARGET_VARARGS_PRETEND_ARGS(FUN_DECL) \ @@ -309,289 +217,142 @@ extern int target_flags; #ifndef TARGET_CPU_DEFAULT #define TARGET_CPU_DEFAULT SELECT_SH1 -#define SUPPORT_SH1 -#define SUPPORT_SH2E -#define SUPPORT_SH4 -#define SUPPORT_SH4_SINGLE -#define SUPPORT_SH2A -#define SUPPORT_SH2A_SINGLE +#define SUPPORT_SH1 1 +#define SUPPORT_SH2E 1 +#define SUPPORT_SH4 1 +#define SUPPORT_SH4_SINGLE 1 +#define SUPPORT_SH2A 1 +#define SUPPORT_SH2A_SINGLE 1 #endif -#define SELECT_SH1 (SH1_BIT) -#define SELECT_SH2 (SH2_BIT | SELECT_SH1) -#define SELECT_SH2E (SH_E_BIT | SH2_BIT | SH1_BIT | FPU_SINGLE_BIT) -#define SELECT_SH2A (SH_E_BIT | HARD_SH2A_BIT | HARD_SH2A_DOUBLE_BIT | SH2_BIT | SH1_BIT) -#define SELECT_SH2A_NOFPU (HARD_SH2A_BIT | SH2_BIT | SH1_BIT) -#define SELECT_SH2A_SINGLE_ONLY (SH_E_BIT | HARD_SH2A_BIT | SH2_BIT | SH1_BIT | FPU_SINGLE_BIT) -#define SELECT_SH2A_SINGLE (SH_E_BIT | HARD_SH2A_BIT | FPU_SINGLE_BIT \ - | HARD_SH2A_DOUBLE_BIT | SH2_BIT | SH1_BIT) -#define SELECT_SH3 (SH3_BIT | SELECT_SH2) -#define SELECT_SH3E (SH_E_BIT | FPU_SINGLE_BIT | SELECT_SH3) -#define SELECT_SH4_NOFPU (HARD_SH4_BIT | SELECT_SH3) -#define SELECT_SH4_SINGLE_ONLY (HARD_SH4_BIT | SELECT_SH3E) -#define SELECT_SH4 (SH4_BIT | SH_E_BIT | HARD_SH4_BIT | SELECT_SH3) -#define SELECT_SH4_SINGLE (FPU_SINGLE_BIT | SELECT_SH4) -#define SELECT_SH4A_NOFPU (SH4A_BIT | SELECT_SH4_NOFPU) -#define SELECT_SH4A_SINGLE_ONLY (SH4A_BIT | SELECT_SH4_SINGLE_ONLY) -#define SELECT_SH4A (SH4A_BIT | SELECT_SH4) -#define SELECT_SH4A_SINGLE (SH4A_BIT | SELECT_SH4_SINGLE) -#define SELECT_SH5_64MEDIA (SH5_BIT | SH4_BIT) -#define SELECT_SH5_64MEDIA_NOFPU (SH5_BIT) -#define SELECT_SH5_32MEDIA (SH5_BIT | SH4_BIT | SH_E_BIT) -#define SELECT_SH5_32MEDIA_NOFPU (SH5_BIT | SH_E_BIT) -#define SELECT_SH5_COMPACT (SH5_BIT | SH4_BIT | SELECT_SH3E) -#define SELECT_SH5_COMPACT_NOFPU (SH5_BIT | SELECT_SH3) - -/* Disable processor switches for which we have no suitable multilibs. */ -#ifndef SUPPORT_SH1 -#define TARGET_SWITCH_SH1 -#ifndef SUPPORT_SH2 -#define TARGET_SWITCH_SH2 -#ifndef SUPPORT_SH3 -#define TARGET_SWITCH_SH3 -#ifndef SUPPORT_SH4_NOFPU -#define TARGET_SWITCH_SH4_NOFPU -#endif -#ifndef SUPPORT_SH4A_NOFPU -#define TARGET_SWITCH_SH4A_NOFPU -#endif -#ifndef SUPPORT_SH4AL -#define TARGET_SWITCH_SH4AL -#endif -#ifndef SUPPORT_SH2A_NOFPU -#define TARGET_SWITCH_SH2A_NOFPU +#define TARGET_DIVIDE_INV \ + (sh_div_strategy == SH_DIV_INV || sh_div_strategy == SH_DIV_INV_MINLAT \ + || sh_div_strategy == SH_DIV_INV20U || sh_div_strategy == SH_DIV_INV20L \ + || sh_div_strategy == SH_DIV_INV_CALL \ + || sh_div_strategy == SH_DIV_INV_CALL2 || sh_div_strategy == SH_DIV_INV_FP) +#define TARGET_DIVIDE_FP (sh_div_strategy == SH_DIV_FP) +#define TARGET_DIVIDE_INV_FP (sh_div_strategy == SH_DIV_INV_FP) +#define TARGET_DIVIDE_CALL2 (sh_div_strategy == SH_DIV_CALL2) +#define TARGET_DIVIDE_INV_MINLAT (sh_div_strategy == SH_DIV_INV_MINLAT) +#define TARGET_DIVIDE_INV20U (sh_div_strategy == SH_DIV_INV20U) +#define TARGET_DIVIDE_INV20L (sh_div_strategy == SH_DIV_INV20L) +#define TARGET_DIVIDE_INV_CALL (sh_div_strategy == SH_DIV_INV_CALL) +#define TARGET_DIVIDE_INV_CALL2 (sh_div_strategy == SH_DIV_INV_CALL2) + +#define SELECT_SH1 (MASK_SH1) +#define SELECT_SH2 (MASK_SH2 | SELECT_SH1) +#define SELECT_SH2E (MASK_SH_E | MASK_SH2 | MASK_SH1 \ + | MASK_FPU_SINGLE) +#define SELECT_SH2A (MASK_SH_E | MASK_HARD_SH2A \ + | MASK_HARD_SH2A_DOUBLE \ + | MASK_SH2 | MASK_SH1) +#define SELECT_SH2A_NOFPU (MASK_HARD_SH2A | MASK_SH2 | MASK_SH1) +#define SELECT_SH2A_SINGLE_ONLY (MASK_SH_E | MASK_HARD_SH2A | MASK_SH2 \ + | MASK_SH1 | MASK_FPU_SINGLE) +#define SELECT_SH2A_SINGLE (MASK_SH_E | MASK_HARD_SH2A \ + | MASK_FPU_SINGLE | MASK_HARD_SH2A_DOUBLE \ + | MASK_SH2 | MASK_SH1) +#define SELECT_SH3 (MASK_SH3 | SELECT_SH2) +#define SELECT_SH3E (MASK_SH_E | MASK_FPU_SINGLE | SELECT_SH3) +#define SELECT_SH4_NOFPU (MASK_HARD_SH4 | SELECT_SH3) +#define SELECT_SH4_SINGLE_ONLY (MASK_HARD_SH4 | SELECT_SH3E) +#define SELECT_SH4 (MASK_SH4 | MASK_SH_E | MASK_HARD_SH4 \ + | SELECT_SH3) +#define SELECT_SH4_SINGLE (MASK_FPU_SINGLE | SELECT_SH4) +#define SELECT_SH4A_NOFPU (MASK_SH4A | SELECT_SH4_NOFPU) +#define SELECT_SH4A_SINGLE_ONLY (MASK_SH4A | SELECT_SH4_SINGLE_ONLY) +#define SELECT_SH4A (MASK_SH4A | SELECT_SH4) +#define SELECT_SH4A_SINGLE (MASK_SH4A | SELECT_SH4_SINGLE) +#define SELECT_SH5_64MEDIA (MASK_SH5 | MASK_SH4) +#define SELECT_SH5_64MEDIA_NOFPU (MASK_SH5) +#define SELECT_SH5_32MEDIA (MASK_SH5 | MASK_SH4 | MASK_SH_E) +#define SELECT_SH5_32MEDIA_NOFPU (MASK_SH5 | MASK_SH_E) +#define SELECT_SH5_COMPACT (MASK_SH5 | MASK_SH4 | SELECT_SH3E) +#define SELECT_SH5_COMPACT_NOFPU (MASK_SH5 | SELECT_SH3) + +#if SUPPORT_SH1 +#define SUPPORT_SH2 1 #endif +#if SUPPORT_SH2 +#define SUPPORT_SH3 1 #endif +#if SUPPORT_SH3 +#define SUPPORT_SH4_NOFPU 1 #endif +#if SUPPORT_SH4_NOFPU +#define SUPPORT_SH4A_NOFPU 1 +#define SUPPORT_SH4AL 1 +#define SUPPORT_SH2A_NOFPU 1 #endif -#ifndef SUPPORT_SH2E -#define TARGET_SWITCH_SH2E -#ifndef SUPPORT_SH3E -#define TARGET_SWITCH_SH3E -#ifndef SUPPORT_SH4_SINGLE_ONLY -#define TARGET_SWITCH_SH4_SINGLE_ONLY -#endif -#ifndef SUPPORT_SH4A_SINGLE_ONLY -#define TARGET_SWITCH_SH4A_SINGLE_ONLY -#endif -#ifndef SUPPORT_SH2A_SINGLE_ONLY -#define TARGET_SWITCH_SH2A_SINGLE_ONLY -#endif +#if SUPPORT_SH2E +#define SUPPORT_SH3E 1 #endif +#if SUPPORT_SH3E +#define SUPPORT_SH4_SINGLE_ONLY 1 +#define SUPPORT_SH4A_SINGLE_ONLY 1 +#define SUPPORT_SH2A_SINGLE_ONLY 1 #endif -#ifndef SUPPORT_SH4 -#define TARGET_SWITCH_SH4 -#ifndef SUPPORT_SH4A -#define TARGET_SWITCH_SH4A -#endif +#if SUPPORT_SH4 +#define SUPPORT_SH4A 1 #endif -#ifndef SUPPORT_SH4_SINGLE -#define TARGET_SWITCH_SH4_SINGLE -#ifndef SUPPORT_SH4A_SINGLE -#define TARGET_SWITCH_SH4A_SINGLE -#endif +#if SUPPORT_SH4_SINGLE +#define SUPPORT_SH4A_SINGLE 1 #endif -#ifndef SUPPORT_SH2A -#define TARGET_SWITCH_SH2A +#if SUPPORT_SH5_COMPAT +#define SUPPORT_SH5_32MEDIA 1 #endif -#ifndef SUPPORT_SH2A_SINGLE -#define TARGET_SWITCH_SH2A_SINGLE +#if SUPPORT_SH5_COMPACT_NOFPU +#define SUPPORT_SH5_32MEDIA_NOFPU 1 #endif -#ifndef SUPPORT_SH5_64MEDIA -#define TARGET_SWITCH_SH5_64MEDIA -#endif +#define SUPPORT_ANY_SH5_32MEDIA \ + (SUPPORT_SH5_32MEDIA || SUPPORT_SH5_32MEDIA_NOFPU) +#define SUPPORT_ANY_SH5_64MEDIA \ + (SUPPORT_SH5_64MEDIA || SUPPORT_SH5_64MEDIA_NOFPU) +#define SUPPORT_ANY_SH5 \ + (SUPPORT_ANY_SH5_32MEDIA || SUPPORT_ANY_SH5_64MEDIA) -#ifndef SUPPORT_SH5_64MEDIA_NOFPU -#define TARGET_SWITCH_SH5_64MEDIA_NOFPU -#endif +/* Reset all target-selection flags. */ +#define MASK_ARCH (MASK_SH1 | MASK_SH2 | MASK_SH3 | MASK_SH_E | MASK_SH4 \ + | MASK_HARD_SH2A | MASK_HARD_SH2A_DOUBLE | MASK_SH4A \ + | MASK_HARD_SH4 | MASK_FPU_SINGLE | MASK_SH5) -#if !defined(SUPPORT_SH5_32MEDIA) && !defined (SUPPORT_SH5_COMPACT) -#define TARGET_SWITCHES_SH5_32MEDIA +/* This defaults us to big-endian. */ +#ifndef TARGET_ENDIAN_DEFAULT +#define TARGET_ENDIAN_DEFAULT 0 #endif -#if !defined(SUPPORT_SH5_32MEDIA_NOFPU) && !defined (SUPPORT_SH5_COMPACT_NOFPU) -#define TARGET_SWITCHES_SH5_32MEDIA_NOFPU +#ifndef TARGET_OPT_DEFAULT +#define TARGET_OPT_DEFAULT MASK_ADJUST_UNROLL #endif -/* Reset all target-selection flags. */ -#define TARGET_NONE -(SH1_BIT | SH2_BIT | SH3_BIT | SH_E_BIT | SH4_BIT \ - | HARD_SH2A_BIT | HARD_SH2A_DOUBLE_BIT \ - | SH4A_BIT | HARD_SH4_BIT | FPU_SINGLE_BIT | SH5_BIT) - -#ifndef TARGET_SWITCH_SH1 -#define TARGET_SWITCH_SH1 \ - {"1", TARGET_NONE, "" }, \ - {"1", SELECT_SH1, "Generate SH1 code" }, -#endif -#ifndef TARGET_SWITCH_SH2 -#define TARGET_SWITCH_SH2 \ - {"2", TARGET_NONE, "" }, \ - {"2", SELECT_SH2, "Generate SH2 code" }, -#endif -#ifndef TARGET_SWITCH_SH2E -#define TARGET_SWITCH_SH2E \ - {"2e", TARGET_NONE, "" }, \ - {"2e", SELECT_SH2E, "Generate SH2e code" }, -#endif -#ifndef TARGET_SWITCH_SH2A -#define TARGET_SWITCH_SH2A \ - {"2a", TARGET_NONE, "" }, \ - {"2a", SELECT_SH2A, "Generate SH2a code" }, -#endif -#ifndef TARGET_SWITCH_SH2A_SINGLE_ONLY -#define TARGET_SWITCH_SH2A_SINGLE_ONLY \ - {"2a-single-only", TARGET_NONE, "" }, \ - {"2a-single-only", SELECT_SH2A_SINGLE_ONLY, "Generate only single-precision SH2a code" }, -#endif -#ifndef TARGET_SWITCH_SH2A_SINGLE -#define TARGET_SWITCH_SH2A_SINGLE \ - {"2a-single", TARGET_NONE, "" }, \ - {"2a-single", SELECT_SH2A_SINGLE, "Generate default single-precision SH2a code" }, -#endif -#ifndef TARGET_SWITCH_SH2A_NOFPU -#define TARGET_SWITCH_SH2A_NOFPU \ - {"2a-nofpu", TARGET_NONE, "" }, \ - {"2a-nofpu", SELECT_SH2A_NOFPU, "Generate SH2a FPU-less code" }, -#endif -#ifndef TARGET_SWITCH_SH3 -#define TARGET_SWITCH_SH3 \ - {"3", TARGET_NONE, "" }, \ - {"3", SELECT_SH3, "Generate SH3 code" }, -#endif -#ifndef TARGET_SWITCH_SH3E -#define TARGET_SWITCH_SH3E \ - {"3e", TARGET_NONE, "" }, \ - {"3e", SELECT_SH3E, "Generate SH3e code" }, -#endif -#ifndef TARGET_SWITCH_SH4_SINGLE_ONLY -#define TARGET_SWITCH_SH4_SINGLE_ONLY \ - {"4-single-only", TARGET_NONE, "" }, \ - {"4-single-only", SELECT_SH4_SINGLE_ONLY, "Generate only single-precision SH4 code" }, -#endif -#ifndef TARGET_SWITCH_SH4_SINGLE -#define TARGET_SWITCH_SH4_SINGLE \ - {"4-single", TARGET_NONE, "" }, \ - {"4-single", SELECT_SH4_SINGLE, "Generate default single-precision SH4 code" }, -#endif -#ifndef TARGET_SWITCH_SH4_NOFPU -#define TARGET_SWITCH_SH4_NOFPU \ - {"4-nofpu", TARGET_NONE, "" }, \ - {"4-nofpu", SELECT_SH4_NOFPU, "Generate SH4 FPU-less code" }, -#endif -#ifndef TARGET_SWITCH_SH4 -#define TARGET_SWITCH_SH4 \ - {"4", TARGET_NONE, "" }, \ - {"4", SELECT_SH4, "Generate SH4 code" }, -#endif -#ifndef TARGET_SWITCH_SH4A -#define TARGET_SWITCH_SH4A \ - {"4a", TARGET_NONE, "" }, \ - {"4a", SELECT_SH4A, "Generate SH4a code" }, -#endif -#ifndef TARGET_SWITCH_SH4A_SINGLE_ONLY -#define TARGET_SWITCH_SH4A_SINGLE_ONLY \ - {"4a-single-only", TARGET_NONE, "" }, \ - {"4a-single-only", SELECT_SH4A_SINGLE_ONLY, "Generate only single-precision SH4a code" }, -#endif -#ifndef TARGET_SWITCH_SH4A_SINGLE -#define TARGET_SWITCH_SH4A_SINGLE \ - {"4a-single", TARGET_NONE, "" },\ - {"4a-single", SELECT_SH4A_SINGLE, "Generate default single-precision SH4a code" }, -#endif -#ifndef TARGET_SWITCH_SH4A_NOFPU -#define TARGET_SWITCH_SH4A_NOFPU \ - {"4a-nofpu", TARGET_NONE, "" },\ - {"4a-nofpu", SELECT_SH4A_NOFPU, "Generate SH4a FPU-less code" }, -#endif -#ifndef TARGET_SWITCH_SH4AL -#define TARGET_SWITCH_SH4AL \ - {"4al", TARGET_NONE, "" },\ - {"4al", SELECT_SH4A_NOFPU, "Generate SH4al-dsp code" }, -#endif -#ifndef TARGET_SWITCH_SH5_64MEDIA -#define TARGET_SWITCH_SH5_64MEDIA \ - {"5-64media", TARGET_NONE, "" }, \ - {"5-64media", SELECT_SH5_64MEDIA, "Generate 64-bit SHmedia code" }, -#endif -#ifndef TARGET_SWITCH_SH5_64MEDIA_NOFPU -#define TARGET_SWITCH_SH5_64MEDIA_NOFPU \ - {"5-64media-nofpu", TARGET_NONE, "" }, \ - {"5-64media-nofpu", SELECT_SH5_64MEDIA_NOFPU, "Generate 64-bit FPU-less SHmedia code" }, -#endif -#ifndef TARGET_SWITCHES_SH5_32MEDIA -#define TARGET_SWITCHES_SH5_32MEDIA \ - {"5-32media", TARGET_NONE, "" }, \ - {"5-32media", SELECT_SH5_32MEDIA, "Generate 32-bit SHmedia code" }, \ - {"5-compact", TARGET_NONE, "" }, \ - {"5-compact", SELECT_SH5_COMPACT, "Generate SHcompact code" }, -#endif -#ifndef TARGET_SWITCHES_SH5_32MEDIA_NOFPU -#define TARGET_SWITCHES_SH5_32MEDIA_NOFPU \ - {"5-32media-nofpu", TARGET_NONE, "" }, \ - {"5-32media-nofpu", SELECT_SH5_32MEDIA_NOFPU, "Generate 32-bit FPU-less SHmedia code" }, \ - {"5-compact-nofpu", TARGET_NONE, "" }, \ - {"5-compact-nofpu", SELECT_SH5_COMPACT_NOFPU, "Generate FPU-less SHcompact code" }, +#define TARGET_DEFAULT \ + (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT | TARGET_OPT_DEFAULT) + +#ifndef SUBTARGET_OPTIONS +#define SUBTARGET_OPTIONS #endif -#define TARGET_SWITCHES \ -{ TARGET_SWITCH_SH1 \ - TARGET_SWITCH_SH2 \ - TARGET_SWITCH_SH2A_SINGLE_ONLY \ - TARGET_SWITCH_SH2A_SINGLE \ - TARGET_SWITCH_SH2A_NOFPU \ - TARGET_SWITCH_SH2A \ - TARGET_SWITCH_SH2E \ - TARGET_SWITCH_SH3 \ - TARGET_SWITCH_SH3E \ - TARGET_SWITCH_SH4_SINGLE_ONLY \ - TARGET_SWITCH_SH4_SINGLE \ - TARGET_SWITCH_SH4_NOFPU \ - TARGET_SWITCH_SH4 \ - TARGET_SWITCH_SH4A_SINGLE_ONLY \ - TARGET_SWITCH_SH4A_SINGLE \ - TARGET_SWITCH_SH4A_NOFPU \ - TARGET_SWITCH_SH4A \ - TARGET_SWITCH_SH4AL \ - TARGET_SWITCH_SH5_64MEDIA \ - TARGET_SWITCH_SH5_64MEDIA_NOFPU \ - TARGET_SWITCHES_SH5_32MEDIA \ - TARGET_SWITCHES_SH5_32MEDIA_NOFPU \ - {"b", -LITTLE_ENDIAN_BIT, "Generate code in big endian mode" }, \ - {"bigtable", BIGTABLE_BIT, "Generate 32-bit offsets in switch tables" }, \ - {"dalign", DALIGN_BIT, "Aligns doubles at 64-bit boundaries" }, \ - {"fmovd", FMOVD_BIT, "" }, \ - {"hitachi", HITACHI_BIT, "Follow Renesas (formerly Hitachi) / SuperH calling conventions" }, \ - {"renesas", HITACHI_BIT, "Follow Renesas (formerly Hitachi) / SuperH calling conventions" }, \ - {"no-renesas",-HITACHI_BIT,"Follow the GCC calling conventions" }, \ - {"nomacsave", NOMACSAVE_BIT, "Mark MAC register as call-clobbered" }, \ - {"ieee", IEEE_BIT, "Increase the IEEE compliance for floating-point code" }, \ - {"isize", ISIZE_BIT, "" }, \ - {"l", LITTLE_ENDIAN_BIT, "Generate code in little endian mode" }, \ - {"no-ieee", -IEEE_BIT, "" }, \ - {"padstruct", PADSTRUCT_BIT, "" }, \ - {"prefergot", PREFERGOT_BIT, "Emit function-calls using global offset table when generating PIC" }, \ - {"relax", RELAX_BIT, "Shorten address references during linking" }, \ - {"space", SPACE_BIT, "Deprecated. Use -Os instead" }, \ - {"usermode", USERMODE_BIT, "Generate library function call to invalidate instruction cache entries after fixing trampoline" }, \ - SUBTARGET_SWITCHES \ - {"", TARGET_DEFAULT, "" } \ +#define TARGET_OPTIONS \ +{ { "ultcost=", &sh_multcost_str, \ + N_("Cost to assume for a multiply insn"), 0 }, \ + { "gettrcost=", &sh_gettrcost_str, \ + N_("Cost to assume for gettr insn"), 0 }, \ + { "div=", &sh_div_str, \ + N_("division strategy, one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call, inv:call2, inv:fp"), 0 }, \ + { "divsi3_libfunc=", &sh_divsi3_libfunc, \ + N_("Specify name for 32 bit signed division function"), 0 }, \ + { "cut2-workaround", &cut2_workaround_str, \ + N_("Enable SH5 cut2 workaround"), "\1" }, \ + SUBTARGET_OPTIONS \ } -/* This are meant to be redefined in the host dependent files */ -#define SUBTARGET_SWITCHES - -/* This defaults us to big-endian. */ -#ifndef TARGET_ENDIAN_DEFAULT -#define TARGET_ENDIAN_DEFAULT 0 -#endif - -#define TARGET_DEFAULT (TARGET_CPU_DEFAULT|TARGET_ENDIAN_DEFAULT) +#define TARGET_SH5_CUT2_WORKAROUND (*cut2_workaround_str) #ifndef SH_MULTILIB_CPU_DEFAULT #define SH_MULTILIB_CPU_DEFAULT "m1" @@ -621,10 +382,11 @@ extern int target_flags; { "subtarget_link_spec", SUBTARGET_LINK_SPEC }, \ { "subtarget_asm_endian_spec", SUBTARGET_ASM_ENDIAN_SPEC }, \ { "subtarget_asm_relax_spec", SUBTARGET_ASM_RELAX_SPEC }, \ - { "subtarget_asm_isa_spec", SUBTARGET_ASM_ISA_SPEC }, \ + { "subtarget_asm_isa_spec", SUBTARGET_ASM_ISA_SPEC }, \ + { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, \ SUBTARGET_EXTRA_SPECS -#if TARGET_CPU_DEFAULT & HARD_SH4_BIT +#if TARGET_CPU_DEFAULT & MASK_HARD_SH4 #define SUBTARGET_ASM_RELAX_SPEC "%{!m1:%{!m2:%{!m3*:%{!m5*:-isa=sh4}}}}" #else #define SUBTARGET_ASM_RELAX_SPEC "%{m4*:-isa=sh4}" @@ -632,40 +394,68 @@ extern int target_flags; #define SH_ASM_SPEC \ "%(subtarget_asm_endian_spec) %{mrelax:-relax %(subtarget_asm_relax_spec)}\ -%(subtarget_asm_isa_spec) %{m4al:-dsp}" +%(subtarget_asm_isa_spec) %(subtarget_asm_spec)\ +%{m2a:--isa=sh2a} \ +%{m2a-single:--isa=sh2a} \ +%{m2a-single-only:--isa=sh2a} \ +%{m2a-nofpu:--isa=sh2a-nofpu} \ +%{m5-compact*:--isa=SHcompact} \ +%{m5-32media*:--isa=SHmedia --abi=32} \ +%{m5-64media*:--isa=SHmedia --abi=64} \ +%{m4al:-dsp} %{mcut2-workaround:-cut2-workaround}" #define ASM_SPEC SH_ASM_SPEC #ifndef SUBTARGET_ASM_ENDIAN_SPEC -#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT +#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN #define SUBTARGET_ASM_ENDIAN_SPEC "%{mb:-big} %{!mb:-little}" #else #define SUBTARGET_ASM_ENDIAN_SPEC "%{ml:-little} %{!ml:-big}" #endif #endif -#define SUBTARGET_ASM_ISA_SPEC "" +#if STRICT_NOFPU == 1 +/* Strict nofpu means that the compiler should tell the assembler + to reject FPU instructions. E.g. from ASM inserts. */ +#if TARGET_CPU_DEFAULT & MASK_HARD_SH4 && !(TARGET_CPU_DEFAULT & MASK_SH_E) +#define SUBTARGET_ASM_ISA_SPEC "%{!m1:%{!m2:%{!m3*:%{m4-nofpu|!m4*:%{!m5:-isa=sh4-nofpu}}}}}" +#else +/* If there were an -isa option for sh5-nofpu then it would also go here. */ +#define SUBTARGET_ASM_ISA_SPEC \ + "%{m4-nofpu:-isa=sh4-nofpu} " ASM_ISA_DEFAULT_SPEC +#endif +#else /* ! STRICT_NOFPU */ +#define SUBTARGET_ASM_ISA_SPEC ASM_ISA_DEFAULT_SPEC +#endif + +#ifndef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "" +#endif +#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN +#define LINK_EMUL_PREFIX "sh%{!mb:l}" +#else #define LINK_EMUL_PREFIX "sh%{ml:l}" +#endif -#if TARGET_CPU_DEFAULT & SH5_BIT -#if TARGET_CPU_DEFAULT & SH_E_BIT +#if TARGET_CPU_DEFAULT & MASK_SH5 +#if TARGET_CPU_DEFAULT & MASK_SH_E #define LINK_DEFAULT_CPU_EMUL "32" -#if TARGET_CPU_DEFAULT & SH1_BIT +#if TARGET_CPU_DEFAULT & MASK_SH1 #define ASM_ISA_SPEC_DEFAULT "--isa=SHcompact" #else #define ASM_ISA_SPEC_DEFAULT "--isa=SHmedia --abi=32" -#endif /* SH1_BIT */ -#else /* !SH_E_BIT */ +#endif /* MASK_SH1 */ +#else /* !MASK_SH_E */ #define LINK_DEFAULT_CPU_EMUL "64" #define ASM_ISA_SPEC_DEFAULT "--isa=SHmedia --abi=64" -#endif /* SH_E_BIT */ +#endif /* MASK_SH_E */ #define ASM_ISA_DEFAULT_SPEC \ " %{!m1:%{!m2*:%{!m3*:%{!m4*:%{!m5*:" ASM_ISA_SPEC_DEFAULT "}}}}}" -#else /* !SH5_BIT */ +#else /* !MASK_SH5 */ #define LINK_DEFAULT_CPU_EMUL "" #define ASM_ISA_DEFAULT_SPEC "" -#endif /* SH5_BIT */ +#endif /* MASK_SH5 */ #define SUBTARGET_LINK_EMUL_SUFFIX "" #define SUBTARGET_LINK_SPEC "" @@ -682,29 +472,73 @@ extern int target_flags; %(subtarget_link_emul_suffix) \ %{mrelax:-relax} %(subtarget_link_spec)" +#ifndef SH_DIV_STR_FOR_SIZE +#define SH_DIV_STR_FOR_SIZE "call" +#endif + #define DRIVER_SELF_SPECS "%{m2a:%{ml:%eSH2a does not support little-endian}}" #define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ do { \ if (LEVEL) \ - flag_omit_frame_pointer = -1; \ + { \ + flag_omit_frame_pointer = -1; \ + if (! SIZE) \ + sh_div_str = "inv:minlat"; \ + } \ if (SIZE) \ - target_flags |= SPACE_BIT; \ - if (TARGET_SHMEDIA && LEVEL > 1) \ + { \ + target_flags |= MASK_SMALLCODE; \ + sh_div_str = SH_DIV_STR_FOR_SIZE ; \ + } \ + /* We can't meaningfully test TARGET_SHMEDIA here, because -m options \ + haven't been parsed yet, hence we';d read only the default. \ + sh_target_reg_class will return NO_REGS if this is not SHMEDIA, so \ + it's OK to always set flag_branch_target_load_optimize. */ \ + if (LEVEL > 1) \ { \ flag_branch_target_load_optimize = 1; \ if (! (SIZE)) \ - target_flags |= SAVE_ALL_TR_BIT; \ + target_flags |= MASK_SAVE_ALL_TARGET_REGS; \ } \ + /* Likewise, we can't meaningfully test TARGET_SH2E / TARGET_IEEE \ + here, so leave it to OVERRIDE_OPTIONS to set \ + flag_finite_math_only. We set it to 2 here so we know if the user \ + explicitly requested this to be on or off. */ \ + flag_finite_math_only = 2; \ } while (0) #define ASSEMBLER_DIALECT assembler_dialect extern int assembler_dialect; +enum sh_divide_strategy_e { + SH_DIV_CALL, + SH_DIV_CALL2, + SH_DIV_FP, + SH_DIV_INV, + SH_DIV_INV_MINLAT, + SH_DIV_INV20U, + SH_DIV_INV20L, + SH_DIV_INV_CALL, + SH_DIV_INV_CALL2, + SH_DIV_INV_FP +}; + +extern enum sh_divide_strategy_e sh_div_strategy; + +#ifndef SH_DIV_STRATEGY_DEFAULT +#define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL +#endif + #define OVERRIDE_OPTIONS \ do { \ int regno; \ \ + if (flag_finite_math_only == 2) \ + flag_finite_math_only \ + = !flag_signaling_nans && TARGET_SH2E && ! TARGET_IEEE; \ + if (TARGET_SH2E && !flag_finite_math_only) \ + target_flags |= MASK_IEEE; \ sh_cpu = CPU_SH1; \ assembler_dialect = 0; \ if (TARGET_SH2) \ @@ -715,7 +549,7 @@ do { \ { \ sh_cpu = CPU_SH2A; \ if (TARGET_SH2A_DOUBLE) \ - target_flags |= FMOVD_BIT; \ + target_flags |= MASK_FMOVD; \ } \ if (TARGET_SH3) \ sh_cpu = CPU_SH3; \ @@ -734,26 +568,62 @@ do { \ if (TARGET_SH5) \ { \ sh_cpu = CPU_SH5; \ - target_flags |= DALIGN_BIT; \ - if (TARGET_FPU_ANY \ - && ! (TARGET_SHCOMPACT && TARGET_LITTLE_ENDIAN)) \ - target_flags |= FMOVD_BIT; \ + target_flags |= MASK_ALIGN_DOUBLE; \ + if (TARGET_SHMEDIA_FPU) \ + target_flags |= MASK_FMOVD; \ if (TARGET_SHMEDIA) \ { \ /* There are no delay slots on SHmedia. */ \ flag_delayed_branch = 0; \ /* Relaxation isn't yet supported for SHmedia */ \ - target_flags &= ~RELAX_BIT; \ + target_flags &= ~MASK_RELAX; \ + /* After reload, if conversion does little good but can cause \ + ICEs: \ + - find_if_block doesn't do anything for SH because we don't\ + have conditional execution patterns. (We use conditional\ + move patterns, which are handled differently, and only \ + before reload). \ + - find_cond_trap doesn't do anything for the SH because we \ + don't have conditional traps. \ + - find_if_case_1 uses redirect_edge_and_branch_force in \ + the only path that does an optimization, and this causes \ + an ICE when branch targets are in registers. \ + - find_if_case_2 doesn't do anything for the SHmedia after \ + reload except when it can redirect a tablejump - and \ + that's rather rare. */ \ + flag_if_conversion2 = 0; \ + if (! strcmp (sh_div_str, "call")) \ + sh_div_strategy = SH_DIV_CALL; \ + else if (! strcmp (sh_div_str, "call2")) \ + sh_div_strategy = SH_DIV_CALL2; \ + if (! strcmp (sh_div_str, "fp") && TARGET_FPU_ANY) \ + sh_div_strategy = SH_DIV_FP; \ + else if (! strcmp (sh_div_str, "inv")) \ + sh_div_strategy = SH_DIV_INV; \ + else if (! strcmp (sh_div_str, "inv:minlat")) \ + sh_div_strategy = SH_DIV_INV_MINLAT; \ + else if (! strcmp (sh_div_str, "inv20u")) \ + sh_div_strategy = SH_DIV_INV20U; \ + else if (! strcmp (sh_div_str, "inv20l")) \ + sh_div_strategy = SH_DIV_INV20L; \ + else if (! strcmp (sh_div_str, "inv:call2")) \ + sh_div_strategy = SH_DIV_INV_CALL2; \ + else if (! strcmp (sh_div_str, "inv:call")) \ + sh_div_strategy = SH_DIV_INV_CALL; \ + else if (! strcmp (sh_div_str, "inv:fp")) \ + { \ + if (TARGET_FPU_ANY) \ + sh_div_strategy = SH_DIV_INV_FP; \ + else \ + sh_div_strategy = SH_DIV_INV; \ + } \ } \ /* -fprofile-arcs needs a working libgcov . In unified tree \ configurations with newlib, this requires to configure with \ --with-newlib --with-headers. But there is no way to check \ here we have a working libgcov, so just assume that we have. */\ if (profile_flag) \ - { \ - warning ("Profiling is not supported on this target."); \ - profile_flag = profile_arc_flag = 0; \ - } \ + warning (0, "Profiling is still experimental for this target.");\ } \ else \ { \ @@ -761,6 +631,19 @@ do { \ targetm.asm_out.aligned_op.di = NULL; \ targetm.asm_out.unaligned_op.di = NULL; \ } \ + if (sh_divsi3_libfunc[0]) \ + ; /* User supplied - leave it alone. */ \ + else if (TARGET_HARD_SH4 && TARGET_SH2E) \ + sh_divsi3_libfunc = "__sdivsi3_i4"; \ + else if (TARGET_SH5) \ + { \ + if (TARGET_FPU_ANY && TARGET_SH1) \ + sh_divsi3_libfunc = "__sdivsi3_i4"; \ + else \ + sh_divsi3_libfunc = "__sdivsi3_1"; \ + } \ + else \ + sh_divsi3_libfunc = "__sdivsi3"; \ if (TARGET_FMOVD) \ reg_class_from_letter['e' - 'a'] = NO_REGS; \ \ @@ -783,7 +666,8 @@ do { \ flag_omit_frame_pointer = 0; \ } \ \ - if (flag_pic && ! TARGET_PREFERGOT) \ + if ((flag_pic && ! TARGET_PREFERGOT) \ + || (TARGET_SHMEDIA && !TARGET_PT_FIXED)) \ flag_no_function_cse = 1; \ \ if (SMALL_REGISTER_CLASSES) \ @@ -947,7 +831,7 @@ do { \ barrier_align (LABEL_AFTER_BARRIER) #define LOOP_ALIGN(A_LABEL) \ - ((! optimize || TARGET_HARVARD || TARGET_SMALLCODE) \ + ((! optimize || TARGET_HARD_SH4 || TARGET_SMALLCODE) \ ? 0 : sh_loop_align (A_LABEL)) #define LABEL_ALIGN(A_LABEL) \ @@ -1293,11 +1177,14 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \ || ((((TARGET_SH4 || TARGET_SH2A_DOUBLE) && (MODE) == DFmode) || (MODE) == DCmode \ || (TARGET_SHMEDIA && ((MODE) == DFmode || (MODE) == DImode \ || (MODE) == V2SFmode || (MODE) == TImode))) \ - && (((REGNO) - FIRST_FP_REG) & 1) == 0)) \ + && (((REGNO) - FIRST_FP_REG) & 1) == 0) \ + || ((TARGET_SH4 || TARGET_SHMEDIA) \ + && (MODE) == TImode \ + && (((REGNO) - FIRST_FP_REG) & 3) == 0)) \ : XD_REGISTER_P (REGNO) \ ? (MODE) == DFmode \ : TARGET_REGISTER_P (REGNO) \ - ? ((MODE) == DImode || (MODE) == SImode) \ + ? ((MODE) == DImode || (MODE) == SImode || (MODE) == PDImode) \ : (REGNO) == PR_REG ? (MODE) == SImode \ : (REGNO) == FPSCR_REG ? (MODE) == PSImode \ : 1) @@ -1312,6 +1199,9 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \ #define MODES_TIEABLE_P(MODE1, MODE2) \ ((MODE1) == (MODE2) \ + || (TARGET_SHMEDIA \ + && GET_MODE_SIZE (MODE1) == GET_MODE_SIZE (MODE2) \ + && INTEGRAL_MODE_P (MODE1) && INTEGRAL_MODE_P (MODE2)) \ || (GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2) \ && (TARGET_SHMEDIA ? ((GET_MODE_SIZE (MODE1) <= 4) \ && (GET_MODE_SIZE (MODE2) <= 4)) \ @@ -1578,7 +1468,8 @@ extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER]; 145,146,147,148,149,152 } /* The class value for index registers, and the one for base regs. */ -#define INDEX_REG_CLASS (TARGET_SHMEDIA ? GENERAL_REGS : R0_REGS) +#define INDEX_REG_CLASS \ + (!ALLOW_INDEXED_ADDRESS ? NO_REGS : TARGET_SHMEDIA ? GENERAL_REGS : R0_REGS) #define BASE_REG_CLASS GENERAL_REGS /* Get reg_class from a letter such as appears in the machine @@ -1619,30 +1510,11 @@ extern enum reg_class reg_class_from_letter[]; unused CONST_INT constraint letters: LO unused EXTRA_CONSTRAINT letters: D T U Y */ -#if 1 /* check that the transition went well. */ -#define CONSTRAINT_LEN(C,STR) \ - (((C) == 'L' || (C) == 'O' || (C) == 'D' || (C) == 'T' || (C) == 'U' \ - || (C) == 'Y' \ - || ((C) == 'I' \ - && (((STR)[1] != '0' && (STR)[1] != '1' && (STR)[1] != '2') \ - || (STR)[2] < '0' || (STR)[2] > '9')) \ - || ((C) == 'B' && ((STR)[1] != 's' || (STR)[2] != 'c')) \ - || ((C) == 'J' && ((STR)[1] != '1' || (STR)[2] != '6')) \ - || ((C) == 'K' && ((STR)[1] != '0' || (STR)[2] != '8')) \ - || ((C) == 'P' && ((STR)[1] != '2' || (STR)[2] != '7'))) \ - ? -1 \ - : ((C) == 'A' || (C) == 'B' || (C) == 'C' \ - || (C) == 'I' || (C) == 'J' || (C) == 'K' || (C) == 'P' \ - || (C) == 'R' || (C) == 'S') \ - ? 3 \ - : DEFAULT_CONSTRAINT_LEN ((C), (STR))) -#else #define CONSTRAINT_LEN(C,STR) \ (((C) == 'A' || (C) == 'B' || (C) == 'C' \ || (C) == 'I' || (C) == 'J' || (C) == 'K' || (C) == 'P' \ || (C) == 'R' || (C) == 'S') \ ? 3 : DEFAULT_CONSTRAINT_LEN ((C), (STR))) -#endif /* The letters I, J, K, L and M in a register constraint string can be used to stand for particular ranges of immediate operands. @@ -1671,7 +1543,7 @@ extern enum reg_class reg_class_from_letter[]; && ((HOST_WIDE_INT)(VALUE)) <= 524287 \ && TARGET_SH2A) #define CONST_OK_FOR_I(VALUE, STR) \ - ((STR)[1] == '0' && (STR)[2] == 6 ? CONST_OK_FOR_I06 (VALUE) \ + ((STR)[1] == '0' && (STR)[2] == '6' ? CONST_OK_FOR_I06 (VALUE) \ : (STR)[1] == '0' && (STR)[2] == '8' ? CONST_OK_FOR_I08 (VALUE) \ : (STR)[1] == '1' && (STR)[2] == '0' ? CONST_OK_FOR_I10 (VALUE) \ : (STR)[1] == '1' && (STR)[2] == '6' ? CONST_OK_FOR_I16 (VALUE) \ @@ -1722,11 +1594,12 @@ extern enum reg_class reg_class_from_letter[]; #define PREFERRED_RELOAD_CLASS(X, CLASS) \ ((CLASS) == NO_REGS && TARGET_SHMEDIA \ && (GET_CODE (X) == CONST_DOUBLE \ - || GET_CODE (X) == SYMBOL_REF) \ + || GET_CODE (X) == SYMBOL_REF \ + || PIC_DIRECT_ADDR_P (X)) \ ? GENERAL_REGS \ : (CLASS)) \ -#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,X) \ +#define SECONDARY_INOUT_RELOAD_CLASS(CLASS,MODE,X,ELSE) \ ((((REGCLASS_HAS_FP_REG (CLASS) \ && (GET_CODE (X) == REG \ && (GENERAL_OR_AP_REGISTER_P (REGNO (X)) \ @@ -1747,18 +1620,21 @@ extern enum reg_class reg_class_from_letter[]; || REGNO (X) == T_REG \ || system_reg_operand (X, VOIDmode))))) \ ? GENERAL_REGS \ - : ((CLASS) == TARGET_REGS \ - || (TARGET_SHMEDIA && (CLASS) == SIBCALL_REGS)) \ - ? ((target_operand ((X), (MODE)) \ - && ! target_reg_operand ((X), (MODE))) \ - ? NO_REGS : GENERAL_REGS) \ + : (((CLASS) == TARGET_REGS \ + || (TARGET_SHMEDIA && (CLASS) == SIBCALL_REGS)) \ + && !EXTRA_CONSTRAINT_Csy (X) \ + && (GET_CODE (X) != REG || ! GENERAL_REGISTER_P (REGNO (X)))) \ + ? GENERAL_REGS \ : (((CLASS) == MAC_REGS || (CLASS) == PR_REGS) \ && GET_CODE (X) == REG && ! GENERAL_REGISTER_P (REGNO (X)) \ && (CLASS) != REGNO_REG_CLASS (REGNO (X))) \ ? GENERAL_REGS \ : ((CLASS) != GENERAL_REGS && GET_CODE (X) == REG \ && TARGET_REGISTER_P (REGNO (X))) \ - ? GENERAL_REGS : NO_REGS) + ? GENERAL_REGS : (ELSE)) + +#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,X) \ + SECONDARY_INOUT_RELOAD_CLASS(CLASS,MODE,X,NO_REGS) #define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,X) \ ((REGCLASS_HAS_FP_REG (CLASS) \ @@ -1767,17 +1643,17 @@ extern enum reg_class reg_class_from_letter[]; && ! ((fp_zero_operand (X) || fp_one_operand (X)) \ && (MODE) == SFmode && fldi_ok ())) \ ? R0_REGS \ - : (CLASS == FPUL_REGS \ + : ((CLASS) == FPUL_REGS \ && ((GET_CODE (X) == REG \ && (REGNO (X) == MACL_REG || REGNO (X) == MACH_REG \ || REGNO (X) == T_REG)) \ || GET_CODE (X) == PLUS)) \ ? GENERAL_REGS \ - : CLASS == FPUL_REGS && immediate_operand ((X), (MODE)) \ + : (CLASS) == FPUL_REGS && immediate_operand ((X), (MODE)) \ ? (GET_CODE (X) == CONST_INT && CONST_OK_FOR_I08 (INTVAL (X)) \ ? GENERAL_REGS \ : R0_REGS) \ - : (CLASS == FPSCR_REGS \ + : ((CLASS) == FPSCR_REGS \ && ((GET_CODE (X) == REG && REGNO (X) >= FIRST_PSEUDO_REGISTER) \ || (GET_CODE (X) == MEM && GET_CODE (XEXP ((X), 0)) == PLUS)))\ ? GENERAL_REGS \ @@ -1787,7 +1663,13 @@ extern enum reg_class reg_class_from_letter[]; && (X) != CONST0_RTX (GET_MODE (X)) \ && GET_MODE (X) != V4SFmode) \ ? GENERAL_REGS \ - : SECONDARY_OUTPUT_RELOAD_CLASS((CLASS),(MODE),(X))) + : (((MODE) == QImode || (MODE) == HImode) \ + && TARGET_SHMEDIA && inqhi_operand ((X), (MODE))) \ + ? GENERAL_REGS \ + : (TARGET_SHMEDIA && (CLASS) == GENERAL_REGS \ + && (GET_CODE (X) == LABEL_REF || PIC_DIRECT_ADDR_P (X))) \ + ? TARGET_REGS \ + : SECONDARY_INOUT_RELOAD_CLASS((CLASS),(MODE),(X), NO_REGS)) /* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. @@ -1904,7 +1786,7 @@ extern enum reg_class reg_class_from_letter[]; #define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG ( \ ((GET_MODE_CLASS (TYPE_MODE (VALTYPE)) == MODE_INT \ - && GET_MODE_SIZE (TYPE_MODE (VALTYPE)) < UNITS_PER_WORD \ + && GET_MODE_SIZE (TYPE_MODE (VALTYPE)) < 4 \ && (TREE_CODE (VALTYPE) == INTEGER_TYPE \ || TREE_CODE (VALTYPE) == ENUMERAL_TYPE \ || TREE_CODE (VALTYPE) == BOOLEAN_TYPE \ @@ -1912,7 +1794,7 @@ extern enum reg_class reg_class_from_letter[]; || TREE_CODE (VALTYPE) == REAL_TYPE \ || TREE_CODE (VALTYPE) == OFFSET_TYPE)) \ && sh_promote_prototypes (VALTYPE) \ - ? (TARGET_SHMEDIA ? DImode : SImode) : TYPE_MODE (VALTYPE)), \ + ? (TARGET_SHMEDIA64 ? DImode : SImode) : TYPE_MODE (VALTYPE)), \ BASE_RETURN_VALUE_REG (TYPE_MODE (VALTYPE))) /* Define how to find the value returned by a library function @@ -2225,10 +2107,19 @@ struct sh_args { #define FUNCTION_PROFILER(STREAM,LABELNO) \ { \ - fprintf((STREAM), "\t.align\t2\n"); \ - fprintf((STREAM), "\ttrapa\t#33\n"); \ - fprintf((STREAM), "\t.align\t2\n"); \ - asm_fprintf((STREAM), "\t.long\t%LLP%d\n", (LABELNO)); \ + if (TARGET_SHMEDIA) \ + { \ + fprintf((STREAM), "\tmovi\t33,r0\n"); \ + fprintf((STREAM), "\ttrapa\tr0\n"); \ + asm_fprintf((STREAM), "\t.long\t%LLP%d\n", (LABELNO)); \ + } \ + else \ + { \ + fprintf((STREAM), "\t.align\t2\n"); \ + fprintf((STREAM), "\ttrapa\t#33\n"); \ + fprintf((STREAM), "\t.align\t2\n"); \ + asm_fprintf((STREAM), "\t.long\t%LLP%d\n", (LABELNO)); \ + } \ } /* Define this macro if the code for function profiling should come @@ -2418,7 +2309,8 @@ struct sh_args { #define EXTRA_CONSTRAINT_C16(OP) \ (GET_CODE (OP) == CONST \ && GET_CODE (XEXP ((OP), 0)) == SIGN_EXTEND \ - && GET_MODE (XEXP ((OP), 0)) == DImode \ + && (GET_MODE (XEXP ((OP), 0)) == DImode \ + || GET_MODE (XEXP ((OP), 0)) == SImode) \ && GET_CODE (XEXP (XEXP ((OP), 0), 0)) == TRUNCATE \ && GET_MODE (XEXP (XEXP ((OP), 0), 0)) == HImode \ && (MOVI_SHORI_BASE_OPERAND_P (XEXP (XEXP (XEXP ((OP), 0), 0), 0)) \ @@ -2433,14 +2325,7 @@ struct sh_args { (GET_CODE (OP) == UNSPEC \ && XINT ((OP), 1) == UNSPEC_DATALABEL \ && XVECLEN ((OP), 0) == 1 \ - && (GET_CODE (XVECEXP ((OP), 0, 0)) == SYMBOL_REF \ - || GET_CODE (XVECEXP ((OP), 0, 0)) == LABEL_REF)) - -/* Check whether OP is a datalabel unspec, possibly enclosed within a - CONST. */ -#define DATALABEL_REF_P(OP) \ - ((GET_CODE (OP) == CONST && DATALABEL_REF_NO_CONST_P (XEXP ((OP), 0))) \ - || DATALABEL_REF_NO_CONST_P (OP)) + && GET_CODE (XVECEXP ((OP), 0, 0)) == LABEL_REF) #define GOT_ENTRY_P(OP) \ (GET_CODE (OP) == CONST && GET_CODE (XEXP ((OP), 0)) == UNSPEC \ @@ -2474,10 +2359,14 @@ struct sh_args { #define NON_PIC_REFERENCE_P(OP) \ (GET_CODE (OP) == LABEL_REF || GET_CODE (OP) == SYMBOL_REF \ - || DATALABEL_REF_P (OP) \ + || (GET_CODE (OP) == CONST \ + && (GET_CODE (XEXP ((OP), 0)) == LABEL_REF \ + || GET_CODE (XEXP ((OP), 0)) == SYMBOL_REF \ + || DATALABEL_REF_NO_CONST_P (XEXP ((OP), 0)))) \ || (GET_CODE (OP) == CONST && GET_CODE (XEXP ((OP), 0)) == PLUS \ && (GET_CODE (XEXP (XEXP ((OP), 0), 0)) == SYMBOL_REF \ - || DATALABEL_REF_P (XEXP (XEXP ((OP), 0), 0))) \ + || GET_CODE (XEXP (XEXP ((OP), 0), 0)) == LABEL_REF \ + || DATALABEL_REF_NO_CONST_P (XEXP (XEXP ((OP), 0), 0))) \ && GET_CODE (XEXP (XEXP ((OP), 0), 1)) == CONST_INT)) #define PIC_REFERENCE_P(OP) \ @@ -2574,6 +2463,8 @@ struct sh_args { #define BASE_REGISTER_RTX_P(X) \ ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ || (GET_CODE (X) == SUBREG \ + && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE ((X))), \ + GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (X)))) \ && GET_CODE (SUBREG_REG (X)) == REG \ && REG_OK_FOR_BASE_P (SUBREG_REG (X)))) @@ -2583,6 +2474,8 @@ struct sh_args { #define INDEX_REGISTER_RTX_P(X) \ ((GET_CODE (X) == REG && REG_OK_FOR_INDEX_P (X)) \ || (GET_CODE (X) == SUBREG \ + && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (GET_MODE ((X))), \ + GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (X)))) \ && GET_CODE (SUBREG_REG (X)) == REG \ && SUBREG_OK_FOR_INDEX_P (SUBREG_REG (X), SUBREG_BYTE (X)))) @@ -2614,7 +2507,15 @@ struct sh_args { { \ if (TARGET_SHMEDIA) \ { \ - int MODE_SIZE = GET_MODE_SIZE (MODE); \ + int MODE_SIZE; \ + /* Check if this the address of an unaligned load / store. */\ + if ((MODE) == VOIDmode) \ + { \ + if (CONST_OK_FOR_I06 (INTVAL (OP))) \ + goto LABEL; \ + break; \ + } \ + MODE_SIZE = GET_MODE_SIZE (MODE); \ if (! (INTVAL (OP) & (MODE_SIZE - 1)) \ && INTVAL (OP) >= -512 * MODE_SIZE \ && INTVAL (OP) < 512 * MODE_SIZE) \ @@ -2627,6 +2528,9 @@ struct sh_args { } \ } while(0) +#define ALLOW_INDEXED_ADDRESS \ + ((!TARGET_SHMEDIA32 && !TARGET_SHCOMPACT) || TARGET_ALLOW_INDEXED_ADDRESS) + #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, LABEL) \ { \ if (BASE_REGISTER_RTX_P (X)) \ @@ -2642,9 +2546,15 @@ struct sh_args { rtx xop1 = XEXP ((X), 1); \ if (GET_MODE_SIZE (MODE) <= 8 && BASE_REGISTER_RTX_P (xop0)) \ GO_IF_LEGITIMATE_INDEX ((MODE), xop1, LABEL); \ - if (GET_MODE_SIZE (MODE) <= 4 \ - || (TARGET_SHMEDIA && GET_MODE_SIZE (MODE) <= 8) \ - || ((TARGET_SH4 || TARGET_SH2A_DOUBLE) && TARGET_FMOVD && MODE == DFmode)) \ + if ((ALLOW_INDEXED_ADDRESS || GET_MODE (X) == DImode \ + || ((xop0 == stack_pointer_rtx || xop0 == frame_pointer_rtx) \ + && REG_P (xop1) && REGNO (xop1) == R0_REG) \ + || ((xop1 == stack_pointer_rtx || xop1 == frame_pointer_rtx) \ + && REG_P (xop0) && REGNO (xop0) == R0_REG)) \ + && ((!TARGET_SHMEDIA && GET_MODE_SIZE (MODE) <= 4) \ + || (TARGET_SHMEDIA && GET_MODE_SIZE (MODE) <= 8) \ + || ((TARGET_SH4 || TARGET_SH2A_DOUBLE) \ + && TARGET_FMOVD && MODE == DFmode))) \ { \ if (BASE_REGISTER_RTX_P (xop1) && INDEX_REGISTER_RTX_P (xop0))\ goto LABEL; \ @@ -2731,7 +2641,10 @@ struct sh_args { && BASE_REGISTER_RTX_P (XEXP (X, 0)) \ && ! TARGET_SHMEDIA \ && ! (TARGET_SH4 && (MODE) == DFmode) \ - && ! ((MODE) == PSImode && (TYPE) == RELOAD_FOR_INPUT_ADDRESS)) \ + && ! ((MODE) == PSImode && (TYPE) == RELOAD_FOR_INPUT_ADDRESS) \ + && (ALLOW_INDEXED_ADDRESS \ + || XEXP ((X), 0) == stack_pointer_rtx \ + || XEXP ((X), 0) == frame_pointer_rtx)) \ { \ rtx index_rtx = XEXP (X, 1); \ HOST_WIDE_INT offset = INTVAL (index_rtx), offset_base; \ @@ -2748,7 +2661,7 @@ struct sh_args { { \ X = copy_rtx (X); \ push_reload (index_rtx, NULL_RTX, &XEXP (X, 1), NULL, \ - INDEX_REG_CLASS, Pmode, VOIDmode, 0, 0, (OPNUM), \ + R0_REGS, Pmode, VOIDmode, 0, 0, (OPNUM), \ (TYPE)); \ goto WIN; \ } \ @@ -2892,7 +2805,9 @@ struct sh_args { #define SHIFT_COUNT_TRUNCATED (! TARGET_SH3 && ! TARGET_SH2A) /* All integers have the same format so truncation is easy. */ -#define TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) 1 +/* But SHmedia must sign-extend DImode when truncating to SImode. */ +#define TRULY_NOOP_TRUNCATION(OUTPREC,INPREC) \ + (!TARGET_SHMEDIA || (INPREC) < 64 || (OUTPREC) >= 64) /* Define this if addresses of constant functions shouldn't be put through pseudo regs where they can be cse'd. @@ -3060,10 +2975,26 @@ struct sh_args { } #define ASM_OUTPUT_REG_PUSH(file, v) \ - fprintf ((file), "\tmov.l\tr%d,@-r15\n", (v)); +{ \ + if (TARGET_SHMEDIA) \ + { \ + fprintf ((file), "\taddi.l\tr15,-8,r15\n"); \ + fprintf ((file), "\tst.q\tr15,0,r%d\n", (v)); \ + } \ + else \ + fprintf ((file), "\tmov.l\tr%d,@-r15\n", (v)); \ +} #define ASM_OUTPUT_REG_POP(file, v) \ - fprintf ((file), "\tmov.l\t@r15+,r%d\n", (v)); +{ \ + if (TARGET_SHMEDIA) \ + { \ + fprintf ((file), "\tld.q\tr15,0,r%d\n", (v)); \ + fprintf ((file), "\taddi.l\tr15,8,r15\n"); \ + } \ + else \ + fprintf ((file), "\tmov.l\t@r15+,r%d\n", (v)); \ +} /* DBX register number for a given compiler register number. */ /* GDB has FPUL at 23 and FP0 at 25, so we must add one to all FP registers @@ -3207,7 +3138,7 @@ struct sh_args { #define PRINT_OPERAND_PUNCT_VALID_P(CHAR) \ ((CHAR) == '.' || (CHAR) == '#' || (CHAR) == '@' || (CHAR) == ',' \ - || (CHAR) == '$'|| (CHAR) == '\'') + || (CHAR) == '$' || (CHAR) == '\'' || (CHAR) == '>') /* Recognize machine-specific patterns that may appear within constants. Used for PIC-specific UNSPECs. */ @@ -3326,8 +3257,6 @@ extern int current_function_interrupt; for interrupt functions. */ extern struct rtx_def *sp_switch; -extern int rtx_equal_function_value_matters; - /* Instructions with unfilled delay slots take up an extra two bytes for the nop in the delay slot. @@ -3339,50 +3268,69 @@ extern int rtx_equal_function_value_matters; /* Define the codes that are matched by predicates in sh.c. */ #define PREDICATE_CODES \ {"and_operand", {SUBREG, REG, CONST_INT}}, \ + {"any_arith_reg_dest", {SUBREG, REG}}, \ {"any_register_operand", {SUBREG, REG}}, \ {"arith_operand", {SUBREG, REG, CONST_INT}}, \ {"arith_reg_dest", {SUBREG, REG}}, \ - {"arith_reg_operand", {SUBREG, REG}}, \ + {"arith_reg_operand", {SUBREG, REG, SIGN_EXTEND}}, \ {"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}}, \ {"binary_float_operator", {PLUS, MINUS, MULT, DIV}}, \ {"binary_logical_operator", {AND, IOR, XOR}}, \ + {"cache_address_operand", {PLUS, REG}}, \ + {"cmp_operand", {SUBREG, REG, CONST_INT}}, \ {"cmpsi_operand", {SUBREG, REG, CONST_INT}}, \ {"commutative_float_operator", {PLUS, MULT}}, \ {"equality_comparison_operator", {EQ,NE}}, \ {"extend_reg_operand", {SUBREG, REG, TRUNCATE}}, \ {"extend_reg_or_0_operand", {SUBREG, REG, TRUNCATE, CONST_INT}}, \ + {"ext_dest_operand", {SUBREG, REG}}, \ + {"fp_arith_reg_dest", {SUBREG, REG}}, \ {"fp_arith_reg_operand", {SUBREG, REG}}, \ {"fpscr_operand", {REG}}, \ {"fpul_operand", {REG}}, \ {"general_extend_operand", {SUBREG, REG, MEM, TRUNCATE}}, \ - {"general_movsrc_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM}}, \ + {"general_movsrc_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE, MEM, CONST }}, \ {"general_movdst_operand", {SUBREG, REG, MEM}}, \ {"unaligned_load_operand", {MEM}}, \ {"greater_comparison_operator", {GT,GE,GTU,GEU}}, \ - {"int_gpr_dest", {SUBREG, REG}}, \ {"inqhi_operand", {TRUNCATE}}, \ + {"int_gpr_dest", {SUBREG, REG}}, \ {"less_comparison_operator", {LT,LE,LTU,LEU}}, \ {"logical_operand", {SUBREG, REG, CONST_INT}}, \ + {"logical_operator", {AND,IOR,XOR}}, \ + {"logical_reg_operand", {SUBREG, REG}}, \ {"mextr_bit_offset", {CONST_INT}}, \ + {"minuend_operand", {SUBREG, REG, TRUNCATE, CONST_INT}}, \ {"noncommutative_float_operator", {MINUS, DIV}}, \ - {"shmedia_6bit_operand", {SUBREG, REG, CONST_INT}}, \ + {"sh_const_vec", {CONST_VECTOR}}, \ + {"sh_1el_vec", {CONST_VECTOR}}, \ {"sh_register_operand", {REG, SUBREG, CONST_INT}}, \ - {"target_reg_operand", {SUBREG, REG}}, \ + {"sh_rep_vec", {CONST_VECTOR}}, \ + {"shift_count_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \ + LABEL_REF, SUBREG, REG, ZERO_EXTEND, SIGN_EXTEND}},\ + {"shift_count_reg_operand", {SUBREG, REG, ZERO_EXTEND, SIGN_EXTEND}}, \ + {"shift_operator", {ASHIFT, ASHIFTRT, LSHIFTRT}}, \ + {"symbol_ref_operand", {SYMBOL_REF}}, \ {"target_operand", {SUBREG, REG, LABEL_REF, SYMBOL_REF, CONST, UNSPEC}},\ + {"target_reg_operand", {SUBREG, REG}}, \ {"trunc_hi_operand", {SUBREG, REG, TRUNCATE}}, \ - {"sh_const_vec", {CONST_VECTOR}}, \ - {"sh_1el_vec", {CONST_VECTOR, PARALLEL}}, \ - {"sh_rep_vec", {CONST_VECTOR, PARALLEL}}, \ - {"symbol_ref_operand", {SYMBOL_REF}}, \ + {"ua_address_operand", {SUBREG, REG, PLUS}}, \ + {"ua_offset", {CONST_INT}}, \ {"unary_float_operator", {ABS, NEG, SQRT}}, \ + {"xor_operand", {SUBREG, REG, CONST_INT}}, \ #define SPECIAL_MODE_PREDICATES \ + "any_arith_reg_dest", \ "any_register_operand", \ "int_gpr_dest", \ + "target_operand", \ + "target_reg_operand", \ "trunc_hi_operand", \ /* This line intentionally left blank. */ #define any_register_operand register_operand +#define any_arith_reg_dest arith_reg_dest +#define ext_dest_operand arith_reg_operand /* Define this macro if it is advisable to hold scalars in registers in a wider mode than that declared by the program. In such cases, @@ -3395,12 +3343,15 @@ extern int rtx_equal_function_value_matters; load instructions. */ #define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ if (GET_MODE_CLASS (MODE) == MODE_INT \ - && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ + && GET_MODE_SIZE (MODE) < 4/* ! UNITS_PER_WORD */)\ (UNSIGNEDP) = ((MODE) == SImode ? 0 : (UNSIGNEDP)), \ - (MODE) = (TARGET_SH1 ? SImode : DImode); + (MODE) = (TARGET_SH1 ? SImode \ + : TARGET_SHMEDIA32 ? SImode : DImode); #define MAX_FIXED_MODE_SIZE (TARGET_SH5 ? 128 : 64) +#define SIDI_OFF (TARGET_LITTLE_ENDIAN ? 0 : 4) + /* ??? Define ACCUMULATE_OUTGOING_ARGS? This is more efficient than pushing and popping arguments. However, we do have push/pop instructions, and rather limited offsets (4 bits) in load/store instructions, so it isn't @@ -3475,8 +3426,7 @@ extern int rtx_equal_function_value_matters; if (((ENCODING) & 0xf) != DW_EH_PE_sdata4 \ && ((ENCODING) & 0xf) != DW_EH_PE_sdata8) \ { \ - if (GET_CODE (ADDR) != SYMBOL_REF) \ - abort (); \ + gcc_assert (GET_CODE (ADDR) == SYMBOL_REF); \ SYMBOL_REF_FLAGS (ADDR) |= SYMBOL_FLAG_FUNCTION; \ if (0) goto DONE; \ } \ @@ -3508,4 +3458,15 @@ extern int rtx_equal_function_value_matters; : gen_rtx_MEM (Pmode, return_address_pointer_rtx)) \ : NULL_RTX) +#define SIMULTANEOUS_PREFETCHES 2 + +extern const char *sh_multcost_str; +extern const char *sh_gettrcost_str; +extern const char *sh_div_str; +extern const char *sh_divsi3_libfunc; +extern const char *cut2_workaround_str; + +/* FIXME: middle-end support for highpart optimizations is missing. */ +#define high_life_started reload_in_progress + #endif /* ! GCC_SH_H */ diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index e367d602cc9..f05be16d92d 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -143,6 +143,13 @@ (UNSPEC_GOTTPOFF 24) (UNSPEC_TPOFF 25) (UNSPEC_RA 26) + (UNSPEC_DIV_INV_M0 30) + (UNSPEC_DIV_INV_M1 31) + (UNSPEC_DIV_INV_M2 32) + (UNSPEC_DIV_INV_M3 33) + (UNSPEC_DIV_INV20 34) + (UNSPEC_ASHIFTRT 35) + (UNSPEC_THUNK 36) ;; These are used with unspec_volatile. (UNSPECV_BLOCKAGE 0) @@ -247,7 +254,7 @@ ;; mcmp_media SHmedia multimedia compare, absolute, saturating ops ;; mac_media SHmedia mac-style fixed point operations ;; d2mpy_media SHmedia: two 32 bit integer multiplies -;; atrans SHmedia approximate transcendental functions +;; atrans_media SHmedia approximate transcendental functions ;; ustore_media SHmedia unaligned stores ;; nil no-op move, will be deleted. @@ -424,6 +431,9 @@ (eq_attr "type" "pt_media") (if_then_else (ne (symbol_ref "TARGET_SHMEDIA64") (const_int 0)) (const_int 20) (const_int 12)) + (and (eq_attr "type" "jump_media") + (ne (symbol_ref "TARGET_SH5_CUT2_WORKAROUND") (const_int 0))) + (const_int 8) ] (if_then_else (ne (symbol_ref "TARGET_SHMEDIA") (const_int 0)) (const_int 4) (const_int 2)))) @@ -434,6 +444,8 @@ (include "shmedia.md") (include "sh4.md") +(include "predicates.md") + ;; Definitions for filling delay slots (define_attr "needs_delay_slot" "yes,no" (const_string "no")) @@ -494,6 +506,9 @@ (const_string "yes")] (const_string "no"))) +(define_attr "highpart" "user, ignore, extend, depend, must_split" + (const_string "user")) + (define_delay (eq_attr "needs_delay_slot" "yes") [(eq_attr "in_delay_slot" "yes") (nil) (nil)]) @@ -537,7 +552,7 @@ ;; SH2e has a hardware bug that pretty much prohibits the use of ;; annuled delay slots. [(eq_attr "cond_delay_slot" "yes") (and (eq_attr "cond_delay_slot" "yes") - (not (eq_attr "cpu" "sh2e"))) (nil)]) + (not (eq_attr "cpu" "sh2e"))) (nil)]) ;; ------------------------------------------------------------------------- ;; SImode signed integer comparisons @@ -616,7 +631,7 @@ [(set (reg:SI T_REG) (compare (match_operand:SI 0 "cmpsi_operand" "") (match_operand:SI 1 "arith_operand" "")))] - "TARGET_SH1" + "TARGET_SH1 || TARGET_SHMEDIA" " { if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == T_REG @@ -731,14 +746,30 @@ [(set_attr "length" "8") (set_attr "type" "arith3")]) +(define_insn "cmpeqsi_media" + [(set (match_operand:DI 0 "register_operand" "=r") + (eq:DI (match_operand:SI 1 "logical_operand" "%r") + (match_operand:SI 2 "cmp_operand" "Nr")))] + "TARGET_SHMEDIA" + "cmpeq %1, %N2, %0" + [(set_attr "type" "cmp_media")]) + (define_insn "cmpeqdi_media" [(set (match_operand:DI 0 "register_operand" "=r") (eq:DI (match_operand:DI 1 "register_operand" "%r") - (match_operand:DI 2 "arith_reg_or_0_operand" "Nr")))] + (match_operand:DI 2 "cmp_operand" "Nr")))] "TARGET_SHMEDIA" "cmpeq %1, %N2, %0" [(set_attr "type" "cmp_media")]) +(define_insn "cmpgtsi_media" + [(set (match_operand:DI 0 "register_operand" "=r") + (gt:DI (match_operand:SI 1 "cmp_operand" "Nr") + (match_operand:SI 2 "cmp_operand" "rN")))] + "TARGET_SHMEDIA" + "cmpgt %N1, %N2, %0" + [(set_attr "type" "cmp_media")]) + (define_insn "cmpgtdi_media" [(set (match_operand:DI 0 "register_operand" "=r") (gt:DI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr") @@ -747,6 +778,14 @@ "cmpgt %N1, %N2, %0" [(set_attr "type" "cmp_media")]) +(define_insn "cmpgtusi_media" + [(set (match_operand:DI 0 "register_operand" "=r") + (gtu:DI (match_operand:SI 1 "cmp_operand" "Nr") + (match_operand:SI 2 "cmp_operand" "rN")))] + "TARGET_SHMEDIA" + "cmpgtu %N1, %N2, %0" + [(set_attr "type" "cmp_media")]) + (define_insn "cmpgtudi_media" [(set (match_operand:DI 0 "register_operand" "=r") (gtu:DI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr") @@ -755,6 +794,69 @@ "cmpgtu %N1, %N2, %0" [(set_attr "type" "cmp_media")]) +(define_insn "cmpsieqsi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (eq:SI (match_operand:SI 1 "logical_operand" "%r") + (match_operand:SI 2 "cmp_operand" "Nr")))] + "TARGET_SHMEDIA" + "cmpeq %1, %N2, %0" + [(set_attr "type" "cmp_media")]) + +(define_insn "cmpsieqdi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (eq:SI (match_operand:DI 1 "register_operand" "%r") + (match_operand:DI 2 "cmp_operand" "Nr")))] + "TARGET_SHMEDIA" + "cmpeq %1, %N2, %0" + [(set_attr "type" "cmp_media")]) + +(define_insn "cmpsigtsi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (gt:SI (match_operand:SI 1 "cmp_operand" "Nr") + (match_operand:SI 2 "cmp_operand" "rN")))] + "TARGET_SHMEDIA" + "cmpgt %N1, %N2, %0" + [(set_attr "type" "cmp_media")]) + +(define_insn "cmpsigtdi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (gt:SI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr") + (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))] + "TARGET_SHMEDIA" + "cmpgt %N1, %N2, %0" + [(set_attr "type" "cmp_media")]) + +(define_insn "cmpsigtusi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (gtu:SI (match_operand:SI 1 "cmp_operand" "Nr") + (match_operand:SI 2 "cmp_operand" "rN")))] + "TARGET_SHMEDIA" + "cmpgtu %N1, %N2, %0" + [(set_attr "type" "cmp_media")]) + +(define_insn "cmpsigtudi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (gtu:SI (match_operand:DI 1 "arith_reg_or_0_operand" "Nr") + (match_operand:DI 2 "arith_reg_or_0_operand" "rN")))] + "TARGET_SHMEDIA" + "cmpgtu %N1, %N2, %0" + [(set_attr "type" "cmp_media")]) + +; These two patterns are for combine. +(define_insn "*cmpne0si_media" + [(set (match_operand:DI 0 "register_operand" "=r") + (ne:DI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 0)))] + "TARGET_SHMEDIA" + "cmpgtu %1,r63,%0" + [(set_attr "type" "cmp_media")]) + +(define_insn "*cmpne0sisi_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (ne:SI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 0)))] + "TARGET_SHMEDIA" + "cmpgtu %1,r63,%0" + [(set_attr "type" "cmp_media")]) + ;; We save the compare operands in the cmpxx patterns and use them when ;; we generate the branch. @@ -796,6 +898,37 @@ "cmvne %1, %N2, %0" [(set_attr "type" "arith_media")]) +(define_peephole2 + [(set (match_operand:DI 0 "arith_reg_dest" "") + (if_then_else:DI (match_operator 3 "equality_comparison_operator" + [(match_operand:DI 1 "arith_reg_operand" "") + (const_int 0)]) + (match_operand:DI 2 "arith_reg_dest" "") + (match_dup 0))) + (set (match_dup 2) (match_dup 0))] + "TARGET_SHMEDIA && peep2_reg_dead_p (2, operands[0])" + [(set (match_dup 2) + (if_then_else:DI (match_dup 3) (match_dup 0) (match_dup 2)))] + " +{ + operands[3] = gen_rtx_fmt_ee (reverse_condition (GET_CODE (operands[3])), + VOIDmode, operands[1], CONST0_RTX (DImode)); +}") + +(define_peephole2 + [(set (match_operand:DI 0 "general_movdst_operand" "") + (match_operand:DI 1 "arith_reg_or_0_operand" "")) + (set (match_operand:DI 2 "arith_reg_dest" "") + (if_then_else:DI (match_operator 4 "equality_comparison_operator" + [(match_operand:DI 3 "arith_reg_operand" "") + (const_int 0)]) + (match_dup 0) + (match_dup 2)))] + "TARGET_SHMEDIA && peep2_reg_dead_p (2, operands[0])" + [(set (match_dup 2) + (if_then_else:DI (match_dup 4) (match_dup 1) (match_dup 2)))] + "") + (define_expand "movdicc" [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operand 1 "comparison_operator" "") @@ -889,10 +1022,274 @@ FAIL; default: + gcc_unreachable (); + } + } +}") + +;; Add SImode variants for cmveq / cmvne to compensate for not promoting +;; SImode to DImode. +(define_insn "movsicc_false" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (if_then_else:SI (eq (match_operand:SI 1 "arith_reg_operand" "r") + (const_int 0)) + (match_operand:SI 2 "arith_reg_or_0_operand" "rN") + (match_operand:SI 3 "arith_reg_operand" "0")))] + "TARGET_SHMEDIA" + "cmveq %1, %N2, %0" + [(set_attr "type" "arith_media")]) + +(define_insn "movsicc_true" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (if_then_else:SI (ne (match_operand:SI 1 "arith_reg_operand" "r") + (const_int 0)) + (match_operand:SI 2 "arith_reg_or_0_operand" "rN") + (match_operand:SI 3 "arith_reg_operand" "0")))] + "TARGET_SHMEDIA" + "cmvne %1, %N2, %0" + [(set_attr "type" "arith_media")]) + +(define_peephole2 + [(set (match_operand:SI 0 "arith_reg_dest" "") + (if_then_else:SI (match_operator 3 "equality_comparison_operator" + [(match_operand:SI 1 "arith_reg_operand" "") + (const_int 0)]) + (match_operand:SI 2 "arith_reg_dest" "") + (match_dup 0))) + (set (match_dup 2) (match_dup 0))] + "TARGET_SHMEDIA && peep2_reg_dead_p (2, operands[0])" + [(set (match_dup 2) + (if_then_else:SI (match_dup 3) (match_dup 0) (match_dup 2)))] + " +{ + operands[3] = gen_rtx_fmt_ee (reverse_condition (GET_CODE (operands[3])), + VOIDmode, operands[1], CONST0_RTX (SImode)); +}") + +(define_peephole2 + [(set (match_operand:SI 0 "general_movdst_operand" "") + (match_operand:SI 1 "arith_reg_or_0_operand" "")) + (set (match_operand:SI 2 "arith_reg_dest" "") + (if_then_else:SI (match_operator 4 "equality_comparison_operator" + [(match_operand:SI 3 "arith_reg_operand" "") + (const_int 0)]) + (match_dup 0) + (match_dup 2)))] + "TARGET_SHMEDIA && peep2_reg_dead_p (2, operands[0]) + && (GET_CODE (operands[1]) != REG || GENERAL_REGISTER_P (REGNO (operands[1])))" + [(set (match_dup 2) + (if_then_else:SI (match_dup 4) (match_dup 1) (match_dup 2)))] + " +{ + replace_rtx (operands[4], operands[0], operands[1]); +}") + +(define_peephole2 + [(set (match_operand 0 "any_register_operand" "") + (match_operand 1 "any_register_operand" "")) + (set (match_operand 2 "any_register_operand" "") (match_operand 3 "" "")) + (set (match_operand 4 "" "") (match_operand 5 "" ""))] + "(HARD_REGNO_NREGS (REGNO (operands[0]), GET_MODE (operands[2])) + <= HARD_REGNO_NREGS (REGNO (operands[0]), GET_MODE (operands[0]))) + && peep2_reg_dead_p (3, operands[0]) && peep2_reg_dead_p (3, operands[2]) + && ! reg_overlap_mentioned_p (operands[0], operands[3]) + && ! reg_overlap_mentioned_p (operands[2], operands[0]) + && ! reg_overlap_mentioned_p (operands[0], operands[1]) + && (REGNO_REG_CLASS (REGNO (operands[0])) + == REGNO_REG_CLASS (REGNO (operands[2]))) + && (REGNO_REG_CLASS (REGNO (operands[1])) + == REGNO_REG_CLASS (REGNO (operands[0])))" + [(set (match_dup 0) (match_dup 3)) + (set (match_dup 4) (match_dup 5))] + " +{ + rtx set1, set2; + rtx replacements[4]; + + /* We want to replace occurences of operands[0] with operands[1] and + operands[2] with operands[0] in operands[4]/operands[5]. + Doing just two replace_rtx calls naively would result in the second + replacement undoing all that the first did if operands[1] and operands[2] + are identical, so we must do this simultaneously. */ + replacements[0] = operands[0]; + replacements[1] = operands[1]; + replacements[2] = operands[2]; + replacements[3] = operands[0]; + if (!replace_n_hard_rtx (operands[5], replacements, 2, 0) + || !replace_n_hard_rtx (operands[4], replacements, 2, 0) + || !replace_n_hard_rtx (operands[2], replacements, 2, 0)) + FAIL; + + operands[5] = replace_n_hard_rtx (operands[5], replacements, 2, 1); + replace_n_hard_rtx (operands[4], replacements, 2, 1); + operands[2] = replace_n_hard_rtx (operands[2], replacements, 2, 1); + /* The operands array is aliased to recog_data.operand, which gets + clobbered by extract_insn, so finish with it now. */ + set1 = gen_rtx_SET (VOIDmode, operands[2], operands[3]); + set2 = gen_rtx_SET (VOIDmode, operands[4], operands[5]); + /* ??? The last insn might be a jump insn, but the generic peephole2 code + always uses emit_insn. */ + /* Check that we don't violate matching constraints or earlyclobbers. */ + extract_insn (emit_insn (set1)); + if (! constrain_operands (1)) + goto failure; + extract_insn (emit (set2)); + if (! constrain_operands (1)) + { + rtx tmp; + failure: + tmp = replacements[0]; + replacements[0] = replacements[1]; + replacements[1] = tmp; + tmp = replacements[2]; + replacements[2] = replacements[3]; + replacements[3] = tmp; + replace_n_hard_rtx (SET_DEST (set1), replacements, 2, 1); + replace_n_hard_rtx (SET_DEST (set2), replacements, 2, 1); + replace_n_hard_rtx (SET_SRC (set2), replacements, 2, 1); + FAIL; + } + DONE; +}") + +;; The register allocator is rather clumsy in handling multi-way conditional +;; moves, so allow the combiner to make them, and we split them up after +;; reload. */ +(define_insn_and_split "*movsicc_umin" + [(set (match_operand:SI 0 "arith_reg_dest" "=&r") + (umin:SI (if_then_else:SI + (eq (match_operand:SI 1 "arith_reg_operand" "r") + (const_int 0)) + (match_operand:SI 2 "arith_reg_or_0_operand" "rN") + (match_operand:SI 3 "register_operand" "0")) + (match_operand:SI 4 "arith_reg_or_0_operand" "r"))) + (clobber (match_scratch:SI 5 "=&r"))] + "TARGET_SHMEDIA && no_new_pseudos" + "#" + "TARGET_SHMEDIA && reload_completed" + [(pc)] + " +{ + emit_insn (gen_movsicc_false (operands[0], operands[1], operands[2], + operands[3])); + emit_insn (gen_cmpsigtusi_media (operands[5], operands[4], operands[0])); + emit_insn (gen_movsicc_false (operands[0], operands[5], operands[4], + operands[0])); + DONE; +}") + +(define_expand "movsicc" + [(set (match_operand:SI 0 "register_operand" "") + (if_then_else:SI (match_operand 1 "comparison_operator" "") + (match_operand:SI 2 "register_operand" "") + (match_operand:SI 3 "register_operand" "")))] + "TARGET_SHMEDIA" + " +{ + if ((GET_CODE (operands[1]) == EQ || GET_CODE (operands[1]) == NE) + && GET_MODE (sh_compare_op0) == SImode + && sh_compare_op1 == const0_rtx) + operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]), VOIDmode, + sh_compare_op0, sh_compare_op1); + else + { + rtx tmp; + + if (no_new_pseudos) + FAIL; + + tmp = gen_reg_rtx (SImode); + + switch (GET_CODE (operands[1])) + { + case EQ: + emit_insn (gen_seq (tmp)); + operands[1] = gen_rtx_NE (VOIDmode, tmp, const0_rtx); + break; + + case NE: + emit_insn (gen_seq (tmp)); + operands[1] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + break; + + case GT: + emit_insn (gen_sgt (tmp)); + operands[1] = gen_rtx_NE (VOIDmode, tmp, const0_rtx); + break; + + case LT: + emit_insn (gen_slt (tmp)); + operands[1] = gen_rtx_NE (VOIDmode, tmp, const0_rtx); + break; + + case GE: + emit_insn (gen_slt (tmp)); + operands[1] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + break; + + case LE: + emit_insn (gen_sgt (tmp)); + operands[1] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + break; + + case GTU: + emit_insn (gen_sgtu (tmp)); + operands[1] = gen_rtx_NE (VOIDmode, tmp, const0_rtx); + break; + + case LTU: + emit_insn (gen_sltu (tmp)); + operands[1] = gen_rtx_NE (VOIDmode, tmp, const0_rtx); + break; + + case GEU: + emit_insn (gen_sltu (tmp)); + operands[1] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + break; + + case LEU: + emit_insn (gen_sgtu (tmp)); + operands[1] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + break; + + case UNORDERED: + emit_insn (gen_sunordered (tmp)); + operands[1] = gen_rtx_NE (VOIDmode, tmp, const0_rtx); + break; + + case ORDERED: + emit_insn (gen_sunordered (tmp)); + operands[1] = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + break; + + case UNEQ: + case UNGE: + case UNGT: + case UNLE: + case UNLT: + case LTGT: + FAIL; + + default: abort (); } } }") + +(define_expand "movqicc" + [(set (match_operand:QI 0 "register_operand" "") + (if_then_else:QI (match_operand 1 "comparison_operator" "") + (match_operand:QI 2 "register_operand" "") + (match_operand:QI 3 "register_operand" "")))] + "TARGET_SHMEDIA" + " +{ + operands[0] = simplify_gen_subreg (SImode, operands[0], QImode, 0); + operands[2] = simplify_gen_subreg (SImode, operands[2], QImode, 0); + operands[3] = simplify_gen_subreg (SImode, operands[3], QImode, 0); + emit (gen_movsicc (operands[0], operands[1], operands[2], operands[3])); + DONE; +}") ;; ------------------------------------------------------------------------- ;; Addition instructions @@ -916,7 +1313,7 @@ }") (define_insn "*adddi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") (plus:DI (match_operand:DI 1 "arith_reg_operand" "%r,r") (match_operand:DI 2 "arith_operand" "r,I10")))] "TARGET_SHMEDIA" @@ -925,17 +1322,29 @@ addi %1, %2, %0" [(set_attr "type" "arith_media")]) +(define_insn "*adddisi3_media" + [(set (subreg:DI (match_operand:SI 0 "arith_reg_operand" "=r,r") 0) + (plus:DI (match_operand:DI 1 "arith_reg_operand" "%r,r") + (match_operand:DI 2 "arith_operand" "r,I10")))] + "TARGET_SHMEDIA" + "@ + add.l %1, %2, %0 + addi.l %1, %2, %0" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) + (define_insn "adddi3z_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (zero_extend:DI (plus:SI (match_operand:SI 1 "extend_reg_operand" "r") (match_operand:SI 2 "extend_reg_or_0_operand" "rN"))))] "TARGET_SHMEDIA" "addz.l %1, %N2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn "adddi3_compact" - [(set (match_operand:DI 0 "arith_reg_operand" "=&r") + [(set (match_operand:DI 0 "arith_reg_dest" "=&r") (plus:DI (match_operand:DI 1 "arith_reg_operand" "%0") (match_operand:DI 2 "arith_reg_operand" "r"))) (clobber (reg:SI T_REG))] @@ -944,7 +1353,7 @@ [(set_attr "length" "6")]) (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (plus:DI (match_operand:DI 1 "arith_reg_operand" "") (match_operand:DI 2 "arith_reg_operand" ""))) (clobber (reg:SI T_REG))] @@ -966,7 +1375,7 @@ }") (define_insn "addc" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (plus:SI (plus:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "r")) (reg:SI T_REG))) @@ -977,7 +1386,7 @@ [(set_attr "type" "arith")]) (define_insn "addc1" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (plus:SI (plus:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "r")) (reg:SI T_REG))) @@ -998,17 +1407,31 @@ }") (define_insn "addsi3_media" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (plus:SI (match_operand:SI 1 "extend_reg_operand" "%r,r") (match_operand:SI 2 "arith_operand" "r,I10")))] "TARGET_SHMEDIA" "@ add.l %1, %2, %0 addi.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) + +(define_insn "addsidi3_media" + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") + (sign_extend:DI (plus:SI (match_operand:SI 1 "extend_reg_operand" + "%r,r") + (match_operand:SI 2 "arith_operand" + "r,I10"))))] + "TARGET_SHMEDIA" + "@ + add.l %1, %2, %0 + addi.l %1, %2, %0" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn "*addsi3_compact" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (plus:SI (match_operand:SI 1 "arith_operand" "%0") (match_operand:SI 2 "arith_operand" "rI08")))] "TARGET_SH1" @@ -1035,15 +1458,24 @@ }") (define_insn "*subdi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (minus:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rN") (match_operand:DI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "sub %N1, %2, %0" [(set_attr "type" "arith_media")]) + +(define_insn "subdisi3_media" + [(set (subreg:DI (match_operand:SI 0 "arith_reg_operand" "=r") 0) + (minus:DI (match_operand:DI 1 "arith_reg_or_0_operand" "rN") + (match_operand:DI 2 "arith_reg_operand" "r")))] + "TARGET_SHMEDIA" + "sub.l %N1, %2, %0" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn "subdi3_compact" - [(set (match_operand:DI 0 "arith_reg_operand" "=&r") + [(set (match_operand:DI 0 "arith_reg_dest" "=&r") (minus:DI (match_operand:DI 1 "arith_reg_operand" "0") (match_operand:DI 2 "arith_reg_operand" "r"))) (clobber (reg:SI T_REG))] @@ -1052,7 +1484,7 @@ [(set_attr "length" "6")]) (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (minus:DI (match_operand:DI 1 "arith_reg_operand" "") (match_operand:DI 2 "arith_reg_operand" ""))) (clobber (reg:SI T_REG))] @@ -1074,7 +1506,7 @@ }") (define_insn "subc" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (minus:SI (minus:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "r")) (reg:SI T_REG))) @@ -1087,7 +1519,7 @@ [(set_attr "type" "arith")]) (define_insn "subc1" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (minus:SI (minus:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "r")) (reg:SI T_REG))) @@ -1096,22 +1528,57 @@ "subc %2,%0" [(set_attr "type" "arith")]) +;; life_analysis thinks rn is live before subc rn,rn, so make a special +;; pattern for this case. This helps multimedia applications that compute +;; the sum of absolute differences. +(define_insn "mov_neg_si_t" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (neg:SI (reg:SI T_REG)))] + "TARGET_SH1" + "subc %0,%0" + [(set_attr "type" "arith")]) + (define_insn "*subsi3_internal" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (minus:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "r")))] "TARGET_SH1" "sub %2,%0" [(set_attr "type" "arith")]) -(define_insn "*subsi3_media" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") - (minus:SI (match_operand:SI 1 "extend_reg_or_0_operand" "rN") +(define_insn_and_split "*subsi3_media" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (minus:SI (match_operand:SI 1 "minuend_operand" "rN") (match_operand:SI 2 "extend_reg_operand" "r")))] - "TARGET_SHMEDIA" + "TARGET_SHMEDIA + && (operands[1] != constm1_rtx + || (GET_CODE (operands[2]) != TRUNCATE + && GET_CODE (operands[2]) != SUBREG))" "sub.l %N1, %2, %0" - [(set_attr "type" "arith_media")]) + "operands[1] == constm1_rtx" + [(set (match_dup 0) (xor:SI (match_dup 2) (match_dup 1)))] + "" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) +(define_split + [(set (match_operand:SI 0 "arith_reg_dest" "") + (zero_extend:SI (subreg:QI (not:SI (subreg:SI (match_operand:QI 1 + "general_extend_operand" + "") 0)) 0)))] + "TARGET_SHMEDIA && TARGET_LITTLE_ENDIAN" + [(set (match_dup 0) (zero_extend:SI (match_dup 1))) + (set (match_dup 0) (xor:SI (match_dup 0) (const_int 255)))] + "") + +(define_split + [(set (match_operand:SI 0 "arith_reg_dest" "") + (zero_extend:SI (subreg:QI (not:SI (subreg:SI (match_operand:QI 1 + "general_extend_operand" + "") 0)) 3)))] + "TARGET_SHMEDIA && ! TARGET_LITTLE_ENDIAN" + [(set (match_dup 0) (zero_extend:SI (match_dup 1))) + (set (match_dup 0) (xor:SI (match_dup 0) (const_int 255)))] + "") ;; Convert `constant - reg' to `neg rX; add rX, #const' since this ;; will sometimes save one instruction. Otherwise we might get ;; `mov #const, rY; sub rY,rX; mov rX, rY' if the source and dest regs @@ -1134,7 +1601,7 @@ { if (no_new_pseudos && ! arith_reg_or_0_operand (operands[1], SImode)) FAIL; - if (operands[1] != const0_rtx) + if (operands[1] != const0_rtx && GET_CODE (operands[1]) != SUBREG) operands[1] = force_reg (SImode, operands[1]); } }") @@ -1159,7 +1626,7 @@ [(set_attr "length" "0")]) (define_insn "udivsi3_sh2a" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (udiv:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "z")))] "TARGET_SH2A" @@ -1204,8 +1671,8 @@ (clobber (reg:DI TR0_REG)) (clobber (reg:DI TR1_REG)) (clobber (reg:DI TR2_REG)) - (use (match_operand:DI 1 "target_operand" "b"))] - "TARGET_SHMEDIA && ! TARGET_SHMEDIA_FPU" + (use (match_operand 1 "target_operand" "b"))] + "TARGET_SHMEDIA && (! TARGET_SHMEDIA_FPU || ! TARGET_DIVIDE_FP)" "blink %1, r18" [(set_attr "type" "sfunc") (set_attr "needs_delay_slot" "yes")]) @@ -1290,7 +1757,7 @@ /* Emit the move of the address to a pseudo outside of the libcall. */ if (TARGET_HARD_SH4 && TARGET_SH2E) { - emit_move_insn (operands[3], function_symbol (\"__udivsi3_i4\")); + function_symbol (operands[3], \"__udivsi3_i4\", SFUNC_STATIC); if (TARGET_FPU_SINGLE) last = gen_udivsi3_i4_single (operands[0], operands[3]); else @@ -1312,17 +1779,12 @@ } else if (TARGET_SH5) { - emit_move_insn (operands[3], - function_symbol (TARGET_FPU_ANY - ? \"__udivsi3_i4\" - : \"__udivsi3\")); + function_symbol (operands[3], + TARGET_FPU_ANY ? \"__udivsi3_i4\" : \"__udivsi3\", + SFUNC_STATIC); if (TARGET_SHMEDIA) - last = gen_udivsi3_i1_media (operands[0], - Pmode == DImode - ? operands[3] - : gen_rtx_SUBREG (DImode, operands[3], - 0)); + last = gen_udivsi3_i1_media (operands[0], operands[3]); else if (TARGET_FPU_ANY) last = gen_udivsi3_i4_single (operands[0], operands[3]); else @@ -1330,7 +1792,7 @@ } else { - emit_move_insn (operands[3], function_symbol (\"__udivsi3\")); + function_symbol (operands[3], \"__udivsi3\", SFUNC_STATIC); last = gen_udivsi3_i1 (operands[0], operands[3]); } first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); @@ -1344,7 +1806,7 @@ }") (define_insn "divsi3_sh2a" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (div:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "z")))] "TARGET_SH2A" @@ -1366,30 +1828,110 @@ [(set_attr "type" "sfunc") (set_attr "needs_delay_slot" "yes")]) -; Since shmedia-nofpu code could be linked against shcompact code, and -; the sdivsi3 libcall has the same name, we must consider all registers -; clobbered that are in the union of the registers clobbered by the -; shmedia and the shcompact implementation. Note, if the shcompact -; implementation actually used shcompact code, we'd need to clobber -; also r22, r23 and fr23. (define_insn "divsi3_i1_media" [(set (match_operand:SI 0 "register_operand" "=z") (div:SI (reg:SI R4_REG) (reg:SI R5_REG))) (clobber (reg:SI T_MEDIA_REG)) (clobber (reg:SI PR_MEDIA_REG)) (clobber (reg:SI R1_REG)) - (clobber (reg:SI R2_REG)) - (clobber (reg:SI R3_REG)) (clobber (reg:SI R20_REG)) (clobber (reg:SI R21_REG)) - (clobber (reg:DI TR0_REG)) - (clobber (reg:DI TR1_REG)) - (clobber (reg:DI TR2_REG)) - (use (match_operand:DI 1 "target_operand" "b"))] - "TARGET_SHMEDIA && ! TARGET_SHMEDIA_FPU" + (clobber (reg:SI TR0_REG)) + (use (match_operand 1 "target_operand" "b"))] + "TARGET_SHMEDIA && (! TARGET_SHMEDIA_FPU || ! TARGET_DIVIDE_FP)" "blink %1, r18" [(set_attr "type" "sfunc")]) +(define_insn "divsi3_media_2" + [(set (match_operand:SI 0 "register_operand" "=z") + (div:SI (reg:SI R4_REG) (reg:SI R5_REG))) + (clobber (reg:SI T_MEDIA_REG)) + (clobber (reg:SI PR_MEDIA_REG)) + (clobber (reg:SI R1_REG)) + (clobber (reg:SI R21_REG)) + (clobber (reg:SI TR0_REG)) + (use (reg:SI R20_REG)) + (use (match_operand 1 "target_operand" "b"))] + "TARGET_SHMEDIA && (! TARGET_SHMEDIA_FPU || ! TARGET_DIVIDE_FP)" + "blink %1, r18" + [(set_attr "type" "sfunc")]) + +;; This pattern acts as a placeholder for -mdiv=inv:call to carry +;; hard reg clobbers and data dependencies that we need when we want +;; to rematerialize the division into a call. +(define_insn_and_split "divsi_inv_call" + [(set (match_operand:SI 0 "register_operand" "=r") + (div:SI (match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "register_operand" "r"))) + (clobber (reg:SI R4_REG)) + (clobber (reg:SI R5_REG)) + (clobber (reg:SI T_MEDIA_REG)) + (clobber (reg:SI PR_MEDIA_REG)) + (clobber (reg:SI R1_REG)) + (clobber (reg:SI R21_REG)) + (clobber (reg:SI TR0_REG)) + (clobber (reg:SI R20_REG)) + (use (match_operand:SI 3 "register_operand" "r"))] + "TARGET_SHMEDIA" + "#" + "&& (high_life_started || reload_completed)" + [(set (match_dup 0) (match_dup 3))] + "" + [(set_attr "highpart" "must_split")]) + +;; This is the combiner pattern for -mdiv=inv:call . +(define_insn_and_split "*divsi_inv_call_combine" + [(set (match_operand:SI 0 "register_operand" "=z") + (div:SI (match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "register_operand" "r"))) + (clobber (reg:SI R4_REG)) + (clobber (reg:SI R5_REG)) + (clobber (reg:SI T_MEDIA_REG)) + (clobber (reg:SI PR_MEDIA_REG)) + (clobber (reg:SI R1_REG)) + (clobber (reg:SI R21_REG)) + (clobber (reg:SI TR0_REG)) + (clobber (reg:SI R20_REG)) + (use (unspec:SI [(match_dup 1) + (match_operand:SI 3 "" "") + (unspec:SI [(match_operand:SI 4 "" "") + (match_dup 3) + (match_operand:DI 5 "" "")] + UNSPEC_DIV_INV_M2) + (match_operand:DI 6 "" "") + (const_int 0) + (const_int 0)] + UNSPEC_DIV_INV_M3))] + "TARGET_SHMEDIA" + "#" + "&& (high_life_started || reload_completed)" + [(pc)] + " +{ + const char *name = sh_divsi3_libfunc; + enum sh_function_kind kind = SFUNC_GOT; + rtx sym; + + emit_move_insn (gen_rtx_REG (SImode, R4_REG), operands[1]); + emit_move_insn (gen_rtx_REG (SImode, R5_REG), operands[2]); + while (TARGET_DIVIDE_INV_CALL2) + { + rtx x = operands[3]; + + if (GET_CODE (x) != UNSPEC || XINT (x, 1) != UNSPEC_DIV_INV_M1) + break; + x = XVECEXP (x, 0, 0); + name = \"__sdivsi3_2\"; + kind = SFUNC_STATIC; + emit_move_insn (gen_rtx_REG (DImode, R20_REG), x); + break; + } + sym = function_symbol (NULL, name, kind); + emit_insn (gen_divsi3_media_2 (operands[0], sym)); + DONE; +}" + [(set_attr "highpart" "must_split")]) + (define_expand "divsi3_i4_media" [(set (match_dup 3) (float:DF (match_operand:SI 1 "register_operand" "r"))) (set (match_dup 4) (float:DF (match_operand:SI 2 "register_operand" "r"))) @@ -1453,7 +1995,7 @@ /* Emit the move of the address to a pseudo outside of the libcall. */ if (TARGET_HARD_SH4 && TARGET_SH2E) { - emit_move_insn (operands[3], function_symbol (\"__sdivsi3_i4\")); + function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_STATIC); if (TARGET_FPU_SINGLE) last = gen_divsi3_i4_single (operands[0], operands[3]); else @@ -1466,7 +2008,87 @@ emit_insn (gen_divsi3_sh2a (operands[0], operands[1], operands[2])); DONE; } - else if (TARGET_SHMEDIA_FPU) + else if (TARGET_DIVIDE_INV) + { + rtx dividend = operands[1]; + rtx divisor = operands[2]; + rtx tab_base; + rtx nsb_res = gen_reg_rtx (DImode); + rtx norm64 = gen_reg_rtx (DImode); + rtx tab_ix = gen_reg_rtx (DImode); + rtx norm32 = gen_reg_rtx (SImode); + rtx i92 = force_reg (DImode, GEN_INT (92)); + rtx scratch0a = gen_reg_rtx (DImode); + rtx scratch0b = gen_reg_rtx (DImode); + rtx inv0 = gen_reg_rtx (SImode); + rtx scratch1a = gen_reg_rtx (DImode); + rtx scratch1b = gen_reg_rtx (DImode); + rtx shift = gen_reg_rtx (DImode); + rtx i2p27, i43; + rtx inv1 = gen_reg_rtx (SImode); + rtx scratch2a = gen_reg_rtx (DImode); + rtx scratch2b = gen_reg_rtx (SImode); + rtx inv2 = gen_reg_rtx (SImode); + rtx scratch3a = gen_reg_rtx (DImode); + rtx scratch3b = gen_reg_rtx (DImode); + rtx scratch3c = gen_reg_rtx (DImode); + rtx scratch3d = gen_reg_rtx (SImode); + rtx scratch3e = gen_reg_rtx (DImode); + rtx result = gen_reg_rtx (SImode); + + if (! arith_reg_or_0_operand (dividend, SImode)) + dividend = force_reg (SImode, dividend); + if (! arith_reg_operand (divisor, SImode)) + divisor = force_reg (SImode, divisor); + if (flag_pic && Pmode != DImode) + { + tab_base = gen_rtx_SYMBOL_REF (Pmode, \"__div_table\"); + tab_base = gen_datalabel_ref (tab_base); + tab_base = force_reg (DImode, gen_rtx_SIGN_EXTEND (DImode, tab_base)); + } + else + { + tab_base = gen_rtx_SYMBOL_REF (DImode, \"__div_table\"); + tab_base = gen_datalabel_ref (tab_base); + tab_base = force_reg (DImode, tab_base); + } + if (TARGET_DIVIDE_INV20U) + i2p27 = force_reg (DImode, GEN_INT (-2 << 27)); + else + i2p27 = GEN_INT (0); + if (TARGET_DIVIDE_INV20U || TARGET_DIVIDE_INV20L) + i43 = force_reg (DImode, GEN_INT (43)); + else + i43 = GEN_INT (0); + emit_insn (gen_nsbdi (nsb_res, + simplify_gen_subreg (DImode, divisor, SImode, 0))); + emit_insn (gen_ashldi3_media (norm64, + gen_rtx_SUBREG (DImode, divisor, 0), + nsb_res)); + emit_insn (gen_ashrdi3_media (tab_ix, norm64, GEN_INT (58))); + emit_insn (gen_ashrdisi3_media_high (norm32, norm64, GEN_INT (32))); + emit_insn (gen_divsi_inv_m1 (inv1, tab_base, tab_ix, norm32, + inv0, scratch0a, scratch0b, + scratch1a, scratch1b)); + emit_insn (gen_subdi3 (shift, i92, nsb_res)); + emit_insn (gen_divsi_inv_m2 (inv2, norm32, inv1, i92, + scratch2a)); + emit_insn (gen_divsi_inv_m3 (result, dividend, inv1, inv2, shift, + i2p27, i43, + scratch3a, scratch3b, scratch3c, + scratch2a, scratch2b, scratch3d, scratch3e)); + if (TARGET_DIVIDE_INV_CALL || TARGET_DIVIDE_INV_CALL2) + emit_insn (gen_divsi_inv_call (operands[0], dividend, divisor, result)); + else if (TARGET_DIVIDE_INV_FP) + emit_insn (gen_divsi_inv_fp (operands[0], dividend, divisor, result, + gen_reg_rtx (SImode), gen_reg_rtx (SImode), + gen_reg_rtx (DFmode), gen_reg_rtx (DFmode), + gen_reg_rtx (DFmode))); + else + emit_move_insn (operands[0], result); + DONE; + } + else if (TARGET_SHMEDIA_FPU && TARGET_DIVIDE_FP) { operands[1] = force_reg (SImode, operands[1]); operands[2] = force_reg (SImode, operands[2]); @@ -1475,17 +2097,22 @@ } else if (TARGET_SH5) { - emit_move_insn (operands[3], - function_symbol (TARGET_FPU_ANY - ? \"__sdivsi3_i4\" - : \"__sdivsi3\")); + if (TARGET_DIVIDE_CALL2) + { + rtx tab_base = gen_rtx_SYMBOL_REF (Pmode, \"__div_table\"); + tab_base = gen_datalabel_ref (tab_base); + emit_move_insn (gen_rtx_REG (Pmode, R20_REG), tab_base); + } + if (TARGET_FPU_ANY && TARGET_SH1) + function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_STATIC); + else if (TARGET_DIVIDE_CALL2) + function_symbol (operands[3], \"__sdivsi3_2\", SFUNC_STATIC); + else + function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_GOT); if (TARGET_SHMEDIA) - last = gen_divsi3_i1_media (operands[0], - Pmode == DImode - ? operands[3] - : gen_rtx_SUBREG (DImode, operands[3], - 0)); + last = ((TARGET_DIVIDE_CALL2 ? gen_divsi3_media_2 : gen_divsi3_i1_media) + (operands[0], operands[3])); else if (TARGET_FPU_ANY) last = gen_divsi3_i4_single (operands[0], operands[3]); else @@ -1493,7 +2120,7 @@ } else { - emit_move_insn (operands[3], function_symbol (\"__sdivsi3\")); + function_symbol (operands[3], sh_divsi3_libfunc, SFUNC_GOT); last = gen_divsi3_i1 (operands[0], operands[3]); } first = emit_move_insn (gen_rtx_REG (SImode, 4), operands[1]); @@ -1505,6 +2132,411 @@ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last)); DONE; }") + +;; operands: inv0, tab_base, tab_ix, norm32 +;; scratch equiv in sdivsi3_2: r19, r21 +(define_expand "divsi_inv_m0" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "register_operand" "r") + (match_operand:SI 3 "register_operand" "r")] + UNSPEC_DIV_INV_M0)) + (clobber (match_operand:DI 4 "register_operand" "=r")) + (clobber (match_operand:DI 5 "register_operand" "=r"))] + "TARGET_SHMEDIA" + " +{ +/* +tab_base: r20 +tab_ix: r21 +norm32: r25 + ldx.ub r20, r21, r19 // u0.8 + shlli r21, 1, r21 + muls.l r25, r19, r19 // s2.38 + ldx.w r20, r21, r21 // s2.14 + shari r19, 24, r19 // truncate to s2.14 + sub r21, r19, r19 // some 11 bit inverse in s1.14 +*/ + + rtx inv0 = operands[0]; + rtx tab_base = operands[1]; + rtx tab_ix = operands[2]; + rtx norm32 = operands[3]; + rtx scratch0 = operands[4]; + rtx scratch0_si = simplify_gen_subreg (SImode, scratch0, DImode, SIDI_OFF); + rtx scratch1 = operands[5]; + rtx mem; + + mem = gen_rtx_MEM (QImode, gen_rtx_PLUS (DImode, tab_base, tab_ix)); + emit_insn (gen_zero_extendqidi2 (scratch0, mem)); + emit_insn (gen_ashldi3_media (scratch1, tab_ix, GEN_INT (1))); + emit_insn (gen_mulsidi3_media (scratch0, norm32, scratch0_si)); + mem = gen_rtx_MEM (HImode, gen_rtx_PLUS (DImode, tab_base, scratch1)); + emit_insn (gen_extendhidi2 (scratch1, mem)); + emit_insn (gen_ashrdi3_media (scratch0, scratch0, GEN_INT (24))); + emit_insn (gen_subdisi3_media (inv0, scratch1, scratch0)); + DONE; +}") + +;; operands: inv1, tab_base, tab_ix, norm32 +(define_insn_and_split "divsi_inv_m1" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "register_operand" "r") + (match_operand:SI 3 "register_operand" "r")] + UNSPEC_DIV_INV_M1)) + (clobber (match_operand:SI 4 "register_operand" "=r")) + (clobber (match_operand:DI 5 "register_operand" "=r")) + (clobber (match_operand:DI 6 "register_operand" "=r")) + (clobber (match_operand:DI 7 "register_operand" "=r")) + (clobber (match_operand:DI 8 "register_operand" "=r"))] + "TARGET_SHMEDIA" + "#" + "&& no_new_pseudos" + [(pc)] + " +{ +/* inv0: r19 + muls.l r19, r19, r18 // u0.28 + muls.l r25, r18, r18 // s2.58 + shlli r19, 45, r0 // multiply by two and convert to s2.58 + sub r0, r18, r18 + shari r18, 28, r18 // some 18 bit inverse in s1.30 +*/ + + rtx inv1 = operands[0]; + rtx tab_base = operands[1]; + rtx tab_ix = operands[2]; + rtx norm32 = operands[3]; + rtx inv0 = operands[4]; + rtx inv0_di = simplify_gen_subreg (DImode, inv0, SImode, 0); + rtx scratch0a = operands[5]; + rtx scratch0b = operands[6]; + rtx scratch0 = operands[7]; + rtx scratch1 = operands[8]; + rtx scratch1_si = simplify_gen_subreg (SImode, scratch1, DImode, SIDI_OFF); + + emit_insn (gen_divsi_inv_m0 (inv0, tab_base, tab_ix, norm32, + scratch0a, scratch0b)); + emit_insn (gen_mulsidi3_media (scratch1, inv0, inv0)); + emit_insn (gen_mulsidi3_media (scratch1, norm32, scratch1_si)); + emit_insn (gen_ashldi3_media (scratch0, inv0_di, GEN_INT (45))); + emit_insn (gen_subdi3 (scratch1, scratch0, scratch1)); + emit_insn (gen_ashrdisi3_media_opaque (inv1, scratch1, GEN_INT (28))); + DONE; +}") + +;; operands: inv2, norm32, inv1, i92 +(define_insn_and_split "divsi_inv_m2" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "register_operand" "r") + (match_operand:DI 3 "register_operand" "r")] + UNSPEC_DIV_INV_M2)) + (clobber (match_operand:DI 4 "register_operand" "=r"))] + "TARGET_SHMEDIA" + "#" + "&& no_new_pseudos" + [(pc)] + " +{ +/* + muls.l r18, r25, r0 // s2.60 + shari r0, 16, r0 // s-16.44 + sub + muls.l r0, r18, r19 // s-16.74 + shari r19, 30, r19 // s-16.44 +*/ + rtx inv2 = operands[0]; + rtx norm32 = operands[1]; + rtx inv1 = operands[2]; + rtx i92 = operands[3]; + rtx scratch0 = operands[4]; + rtx scratch0_si = simplify_gen_subreg (SImode, scratch0, DImode, SIDI_OFF); + + emit_insn (gen_mulsidi3_media (scratch0, inv1, norm32)); + emit_insn (gen_ashrdi3_media (scratch0, scratch0, GEN_INT (16))); + emit_insn (gen_subdi3 (scratch0, i92, scratch0)); + emit_insn (gen_mulsidi3_media (scratch0, scratch0_si, inv1)); + emit_insn (gen_ashrdisi3_media_opaque (inv2, scratch0, GEN_INT (30))); + DONE; +}") + +(define_insn_and_split "divsi_inv_m3" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:SI 1 "arith_reg_or_0_operand" "rN") + (match_operand:SI 2 "register_operand" "r") + (match_operand:SI 3 "register_operand" "r") + (match_operand:DI 4 "register_operand" "r") + (match_operand:DI 5 "arith_reg_or_0_operand" "rN") + (match_operand:DI 6 "arith_reg_or_0_operand" "rN")] + UNSPEC_DIV_INV_M3)) + (clobber (match_operand:DI 7 "register_operand" "=r")) + (clobber (match_operand:DI 8 "register_operand" "=r")) + (clobber (match_operand:DI 9 "register_operand" "=r")) + (clobber (match_operand:DI 10 "register_operand" "=r")) + (clobber (match_operand:SI 11 "register_operand" "=r")) + (clobber (match_operand:SI 12 "register_operand" "=r")) + (clobber (match_operand:DI 13 "register_operand" "=r"))] + "TARGET_SHMEDIA" + "#" + "&& no_new_pseudos" + [(pc)] + " +{ +/* + r0: result r1: shift r4: dividend r18: inv1 r19: inv2 + r0: scratch0 r19: scratch1 r21: scratch2 + + muls.l r18, r4, r25 // s32.30 + muls.l r19, r4, r19 // s15.30 + shari r25, 63, r21 + shari r19, 14, r19 // s18.-14 + sub r25, r19, r0 + shard r0, r1, r0 + sub r0, r21, r0 +*/ + + rtx result = operands[0]; + rtx dividend = operands[1]; + rtx inv1 = operands[2]; + rtx inv2 = operands[3]; + rtx shift = operands[4]; + rtx scratch0 = operands[7]; + rtx scratch1 = operands[8]; + rtx scratch2 = operands[9]; + + emit_insn (gen_mulsidi3_media (scratch0, inv1, dividend)); + emit_insn (gen_mulsidi3_media (scratch1, inv2, dividend)); + emit_insn (gen_ashrdi3_media (scratch2, scratch0, GEN_INT (63))); + emit_insn (gen_ashrdi3_media (scratch1, scratch1, GEN_INT (14))); + emit_insn (gen_adddi3 (scratch0, scratch0, scratch1)); + emit_insn (gen_ashrdi3_media (scratch0, scratch0, shift)); + emit_insn (gen_subdisi3_media (result, scratch0, scratch2)); + DONE; +}") + +;; operands: quotient, dividend, inv1, inv2, shift, i2p27, i43 +;; inv1: tab_base, tab_ix, norm32 +;; inv2: norm32, inv1, i92 +(define_insn_and_split "divsi_inv_m1_3" + [(set (match_operand:SI 0 "register_operand" "=r") + (unspec:SI [(match_operand:SI 1 "arith_reg_or_0_operand" "rN") + (unspec:SI [(match_operand:DI 2 "register_operand" "r") + (match_operand:DI 3 "register_operand" "r") + (match_operand:SI 4 "register_operand" "r")] + UNSPEC_DIV_INV_M1) + (unspec:SI [(match_dup 4) + (unspec:SI [(match_dup 2) + (match_dup 3) + (match_dup 4)] UNSPEC_DIV_INV_M1) + (match_operand:SI 5 "" "")] + UNSPEC_DIV_INV_M2) + (match_operand:DI 6 "register_operand" "r") + (match_operand:DI 7 "arith_reg_or_0_operand" "rN") + (match_operand:DI 8 "arith_reg_or_0_operand" "rN")] + UNSPEC_DIV_INV_M3)) + (clobber (match_operand:DI 9 "register_operand" "=r")) + (clobber (match_operand:DI 10 "register_operand" "=r")) + (clobber (match_operand:DI 11 "register_operand" "=r")) + (clobber (match_operand:DI 12 "register_operand" "=r")) + (clobber (match_operand:SI 13 "register_operand" "=r")) + (clobber (match_operand:SI 14 "register_operand" "=r")) + (clobber (match_operand:DI 15 "register_operand" "=r"))] + "TARGET_SHMEDIA + && (TARGET_DIVIDE_INV_MINLAT + || TARGET_DIVIDE_INV20U || TARGET_DIVIDE_INV20L)" + "#" + "&& no_new_pseudos" + [(pc)] + " +{ + rtx result = operands[0]; + rtx dividend = operands[1]; + rtx tab_base = operands[2]; + rtx tab_ix = operands[3]; + rtx norm32 = operands[4]; + /* rtx i92 = operands[5]; */ + rtx shift = operands[6]; + rtx i2p27 = operands[7]; + rtx i43 = operands[8]; + rtx scratch0 = operands[9]; + rtx scratch0_si = simplify_gen_subreg (SImode, scratch0, DImode, SIDI_OFF); + rtx scratch1 = operands[10]; + rtx scratch1_si = simplify_gen_subreg (SImode, scratch1, DImode, SIDI_OFF); + rtx scratch2 = operands[11]; + rtx scratch3 = operands[12]; + rtx scratch4 = operands[13]; + rtx scratch4_di = simplify_gen_subreg (DImode, scratch4, SImode, 0); + rtx scratch5 = operands[14]; + rtx scratch5_di = simplify_gen_subreg (DImode, scratch5, SImode, 0); + rtx scratch6 = operands[15]; + + emit_insn (gen_divsi_inv_m0 (scratch4, tab_base, tab_ix, norm32, + scratch0, scratch1)); + /* inv0 == scratch4 */ + if (! TARGET_DIVIDE_INV20U) + { + emit_insn (gen_mulsidi3_media (scratch0, scratch4, scratch4)); + i2p27 = scratch0; + emit_insn (gen_mulsidi3_media (scratch1, norm32, scratch0_si)); + } + else + { + emit_insn (gen_mulsidi3_media (scratch1, scratch4, scratch4)); + emit_insn (gen_mulsidi3_media (scratch1, norm32, scratch1_si)); + } + emit_insn (gen_ashldi3_media (scratch2, scratch4_di, GEN_INT (45))); + emit_insn (gen_subdi3 (scratch1, scratch2, scratch1)); + emit_insn (gen_ashrdisi3_media_opaque (scratch4, scratch1, GEN_INT (28))); + /* inv1 == scratch4 */ + + if (TARGET_DIVIDE_INV_MINLAT) + { + emit_insn (gen_mulsidi3_media (scratch1, scratch4, norm32)); + emit_insn (gen_mulsidi3_media (scratch2, dividend, scratch4)); + emit_insn (gen_ashrdi3_media (scratch1, scratch1, GEN_INT (16))); + emit_insn (gen_mulsidi3_media (scratch1, scratch1_si, scratch4)); + emit_insn (gen_ashrdi3_media (scratch3, scratch2, GEN_INT (63))); + emit_insn (gen_ashrsi3_media (scratch5, dividend, GEN_INT (14))); + emit_insn (gen_ashrdi3_media (scratch1, scratch1, GEN_INT (30))); + emit_insn (gen_mulsidi3_media (scratch1, scratch1_si, scratch5)); + emit_insn (gen_xordi3 (scratch0, scratch3, i2p27)); + emit_insn (gen_adddi3 (scratch2, scratch2, scratch0)); + emit_insn (gen_subdi3 (scratch2, scratch2, scratch1)); + } + else + { + rtx label = gen_rtx_LABEL_REF (Pmode, gen_label_rtx ()); + /* Use separate scratch regs for nsb and sign to allow scheduling. */ + emit_insn (gen_nsbdi (scratch6, + simplify_gen_subreg (DImode, dividend, SImode, 0))); + emit_insn (gen_xorsi3 (scratch5, dividend, norm32)); + emit_insn (gen_ashrdi3_media (scratch3, scratch5_di, GEN_INT (63))); + emit_insn (gen_divsi_inv20 (scratch2, + norm32, scratch4, dividend, + scratch6, scratch3, i43, + /* scratch0 may be shared with i2p27. */ + scratch0, scratch1, scratch5, + label, label, i2p27)); + } + emit_insn (gen_ashrdi3_media (scratch2, scratch2, shift)); + emit_insn (gen_subdisi3_media (result, scratch2, scratch3)); + DONE; +}") + +(define_insn "divsi_inv20" + [(set (match_operand:DI 0 "register_operand" "=&r") + (unspec:DI [(match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "register_operand" "r") + (match_operand:SI 3 "register_operand" "r") + (match_operand:DI 4 "register_operand" "r") + (match_operand:DI 5 "register_operand" "r") + (match_operand:DI 6 "register_operand" "r") + (match_operand:DI 12 "register_operand" "r") + (match_operand 10 "target_operand" "b") + (match_operand 11 "immediate_operand" "i")] + UNSPEC_DIV_INV20)) + (clobber (match_operand:DI 7 "register_operand" "=&r")) + (clobber (match_operand:DI 8 "register_operand" "=&r")) + (clobber (match_operand:SI 9 "register_operand" "=r"))] + "TARGET_SHMEDIA + && (TARGET_DIVIDE_INV20U || TARGET_DIVIDE_INV20L)" + "* +{ +/* operands: %0 div_result, %1 norm32, %2 inv1, %3 dividend, + %4 dividend_nsb, %5 result_sign, %6 i43, %12 i2p27, + %7 round_scratch, %8 scratch0 (di), %9 scratch1 (si) + %10 label (tr), %11 label (imm) + + muls.l inv1, norm32, scratch0 // s2.60 + muls.l inv1, dividend, result // s32.30 + xor i2p27, result_sign, round_scratch + bge/u dividend_nsb, i43, tr.. (label) + shari scratch0, 16, scratch0 // s-16.44 + muls.l sratch0_si, inv1, scratch0 // s-16.74 + sub result, round_scratch, result + shari dividend, 14, scratch1 // s19.-14 + shari scratch0, 30, scratch0 // s-16.44 + muls.l scratch0, scratch1, round_scratch // s15.30 +label: + sub result, round_scratch, result */ + + int likely = TARGET_DIVIDE_INV20L; + + if (! likely) output_asm_insn (\"muls.l\t%2, %1 , %8\", operands); + output_asm_insn (\"muls.l\t%2, %3, %0\;xor\t%12, %5, %7\", operands); + output_asm_insn (likely + ? \"bge/l\t%4, %6, %10\;muls.l\t%2, %1 , %8\" + : \"bge/u\t%4, %6, %10\", operands); + output_asm_insn (\"shari\t%8, 16, %8\;muls.l\t%8, %2, %8\", operands); + if (! likely) output_asm_insn (\"sub\t%0, %7, %0\", operands); + output_asm_insn (\"shari\t%3, 14, %9\;shari\t%8, 30, %8\", operands); + return (likely + ? \"muls.l\t%8, %9, %8\;sub\t%0, %8, %0\n%11:\tadd\t%0, %7, %0\" + : \"muls.l\t%8, %9, %7\n%11:\tsub\t%0, %7, %0\"); +}") + +(define_insn_and_split "divsi_inv_fp" + [(set (match_operand:SI 0 "general_movdst_operand" "=rf") + (div:SI (match_operand:SI 1 "general_movsrc_operand" "rf") + (match_operand:SI 2 "register_operand" "rf"))) + (use (match_operand:SI 3 "general_movsrc_operand" "r")) + (clobber (match_operand:SI 4 "register_operand" "=r")) + (clobber (match_operand:SI 5 "register_operand" "=r")) + (clobber (match_operand:DF 6 "register_operand" "=r")) + (clobber (match_operand:DF 7 "register_operand" "=r")) + (clobber (match_operand:DF 8 "register_operand" "=r"))] + "TARGET_SHMEDIA_FPU" + "#" + "&& (high_life_started || reload_completed)" + [(set (match_dup 0) (match_dup 3))] + "" + [(set_attr "highpart" "must_split")]) + +;; If a matching group of divide-by-inverse instructions is in the same +;; basic block after gcse & loop optimizations, we want to transform them +;; to a straight division using floating point for TARGET_DIVIDE_INV_FP. +(define_insn_and_split "*divsi_inv_fp_combine" + [(set (match_operand:SI 0 "register_operand" "=f") + (div:SI (match_operand:SI 1 "register_operand" "f") + (match_operand:SI 2 "register_operand" "f"))) + (use (unspec:SI [(match_dup 1) + (match_operand:SI 3 "" "") + (unspec:SI [(match_operand:SI 4 "" "") + (match_dup 3) + (match_operand:DI 5 "" "")] UNSPEC_DIV_INV_M2) + (match_operand:DI 6 "" "") + (const_int 0) + (const_int 0)] UNSPEC_DIV_INV_M3)) + (clobber (match_operand:SI 7 "fp_arith_reg_operand" "")) + (clobber (match_operand:SI 8 "fp_arith_reg_operand" "")) + (clobber (match_operand:DF 9 "fp_arith_reg_operand" "")) + (clobber (match_operand:DF 10 "fp_arith_reg_operand" "")) + (clobber (match_operand:DF 11 "fp_arith_reg_operand" ""))] + "TARGET_SHMEDIA_FPU && TARGET_DIVIDE_INV_FP && no_new_pseudos" + "#" + "&& 1" + [(set (match_dup 9) (float:DF (match_dup 1))) + (set (match_dup 10) (float:DF (match_dup 2))) + (set (match_dup 11) (div:DF (match_dup 9) (match_dup 10))) + (set (match_dup 8) + (fix:SI (match_dup 11))) + (set (match_dup 0) (match_dup 8))] + " +{ + if (! fp_arith_reg_operand (operands[1], SImode)) + { + emit_move_insn (operands[7], operands[1]); + operands[1] = operands[7]; + } + if (! fp_arith_reg_operand (operands[2], SImode)) + { + emit_move_insn (operands[8], operands[2]); + operands[2] = operands[8]; + } +}" + [(set_attr "highpart" "must_split")]) ;; ------------------------------------------------------------------------- ;; Multiplication instructions @@ -1625,7 +2657,7 @@ "") (define_insn "mul_r" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (mult:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "z")))] "TARGET_SH2A" @@ -1655,7 +2687,7 @@ { /* The address must be set outside the libcall, since it goes into a pseudo. */ - rtx sym = function_symbol (\"__mulsi3\"); + rtx sym = function_symbol (NULL, \"__mulsi3\", SFUNC_STATIC); rtx addr = force_reg (SImode, sym); rtx insns = gen_mulsi3_call (operands[0], operands[1], operands[2], addr); @@ -1710,15 +2742,16 @@ }") (define_insn "mulsidi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (mult:DI (sign_extend:DI (match_operand:SI 1 "extend_reg_operand" "%r")) (sign_extend:DI (match_operand:SI 2 "extend_reg_operand" "r"))))] "TARGET_SHMEDIA" "muls.l %1, %2, %0" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set_attr "highpart" "ignore")]) (define_insn "mulsidi3_compact" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (mult:DI (sign_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "r")))) @@ -1728,7 +2761,7 @@ "#") (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (mult:DI (sign_extend:DI (match_operand:SI 1 "arith_reg_operand" "")) (sign_extend:DI (match_operand:SI 2 "arith_reg_operand" "")))) @@ -1781,15 +2814,16 @@ }") (define_insn "umulsidi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (mult:DI (zero_extend:DI (match_operand:SI 1 "extend_reg_operand" "%r")) (zero_extend:DI (match_operand:SI 2 "extend_reg_operand" "r"))))] "TARGET_SHMEDIA" "mulu.l %1, %2, %0" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set_attr "highpart" "ignore")]) (define_insn "umulsidi3_compact" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (mult:DI (zero_extend:DI (match_operand:SI 1 "arith_reg_operand" "r")) (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "r")))) @@ -1799,7 +2833,7 @@ "#") (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (mult:DI (zero_extend:DI (match_operand:SI 1 "arith_reg_operand" "")) (zero_extend:DI (match_operand:SI 2 "arith_reg_operand" "")))) (clobber (reg:SI MACH_REG)) @@ -1905,30 +2939,82 @@ REG_NOTES (last) = gen_rtx_INSN_LIST (REG_RETVAL, first, REG_NOTES (last)); DONE; }") + +(define_insn_and_split "muldi3" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (mult:DI (match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "arith_reg_operand" "r"))) + (clobber (match_scratch:DI 3 "=&r")) + (clobber (match_scratch:DI 4 "=r"))] + "TARGET_SHMEDIA" + "#" + "reload_completed" + [(const_int 0)] + " +{ + rtx op3_v2si, op2_v2si; + + op3_v2si = operands[3]; + if (GET_CODE (op3_v2si) == SIGN_EXTEND) + { + op3_v2si = XEXP (op3_v2si, 0); + op3_v2si = simplify_gen_subreg (DImode, op3_v2si, GET_MODE (op3_v2si), 0); + } + op3_v2si = simplify_gen_subreg (V2SImode, op3_v2si, DImode, 0); + op2_v2si = operands[2]; + if (GET_CODE (op2_v2si) == SIGN_EXTEND) + { + op2_v2si = XEXP (op2_v2si, 0); + op2_v2si = simplify_gen_subreg (DImode, op2_v2si, GET_MODE (op2_v2si), 0); + } + op2_v2si = simplify_gen_subreg (V2SImode, op2_v2si, DImode, 0); + emit_insn (gen_rotldi3 (operands[3], operands[1], GEN_INT (32))); + emit_insn (gen_mulv2si3 (op3_v2si, op3_v2si, op2_v2si)); + emit_insn (gen_umulsidi3_media (operands[4], + sh_gen_truncate (SImode, operands[1], 0), + sh_gen_truncate (SImode, operands[2], 0))); + emit_insn (gen_anddi3 (operands[0], operands[3], GEN_INT (0xffffffff00000000LL))); + emit_insn (gen_ashldi3_media (operands[3], operands[3], GEN_INT (32))); + emit_insn (gen_adddi3 (operands[0], operands[3], operands[0])); + emit_insn (gen_adddi3 (operands[0], operands[4], operands[0])); + DONE; +}") + ;; ------------------------------------------------------------------------- ;; Logical operations ;; ------------------------------------------------------------------------- (define_insn "*andsi3_compact" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,z") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,z") (and:SI (match_operand:SI 1 "arith_reg_operand" "%0,0") (match_operand:SI 2 "logical_operand" "r,K08")))] "TARGET_SH1" "and %2,%0" [(set_attr "type" "arith")]) +(define_insn "*andsi3_media" + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") + (and:SI (match_operand:SI 1 "logical_reg_operand" "%r,r") + (match_operand:SI 2 "logical_operand" "r,I10")))] + "TARGET_SHMEDIA" + "@ + and %1, %2, %0 + andi %1, %2, %0" + [(set_attr "type" "arith_media")]) + ;; If the constant is 255, then emit an extu.b instruction instead of an ;; and, since that will give better code. (define_expand "andsi3" [(set (match_operand:SI 0 "arith_reg_operand" "") - (and:SI (match_operand:SI 1 "arith_reg_operand" "") + (and:SI (match_operand:SI 1 "logical_reg_operand" "") (match_operand:SI 2 "logical_operand" "")))] - "TARGET_SH1" + "" " { - if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255) + if (TARGET_SH1 + && GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) == 255) { emit_insn (gen_zero_extendqisi2 (operands[0], gen_lowpart (QImode, operands[1]))); @@ -1937,7 +3023,7 @@ }") (define_insn_and_split "anddi3" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r,r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r,r") (and:DI (match_operand:DI 1 "arith_reg_operand" "%r,r,r") (match_operand:DI 2 "and_operand" "r,I10,J16")))] "TARGET_SHMEDIA" @@ -1950,7 +3036,7 @@ [(const_int 0)] " { - if (INTVAL (operands[2]) == (unsigned) 0xffffffff) + if ((unsigned)INTVAL (operands[2]) == (unsigned) 0xffffffff) emit_insn (gen_mshflo_l_di (operands[0], operands[1], CONST0_RTX (DImode))); else emit_insn (gen_mshfhi_l_di (operands[0], CONST0_RTX (DImode), operands[1])); @@ -1958,24 +3044,49 @@ }" [(set_attr "type" "arith_media")]) +(define_insn "andcsi3" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (and:SI (match_operand:SI 1 "arith_reg_operand" "r") + (not:SI (match_operand:SI 2 "arith_reg_operand" "r"))))] + "TARGET_SHMEDIA" + "andc %1,%2,%0" + [(set_attr "type" "arith_media")]) + (define_insn "andcdi3" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (and:DI (match_operand:DI 1 "arith_reg_operand" "r") (not:DI (match_operand:DI 2 "arith_reg_operand" "r"))))] "TARGET_SHMEDIA" "andc %1,%2,%0" [(set_attr "type" "arith_media")]) -(define_insn "iorsi3" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,z") +(define_expand "iorsi3" + [(set (match_operand:SI 0 "arith_reg_operand" "") + (ior:SI (match_operand:SI 1 "logical_reg_operand" "") + (match_operand:SI 2 "logical_operand" "")))] + "" + "") + +(define_insn "*iorsi3_compact" + [(set (match_operand:SI 0 "arith_reg_dest" "=r,z") (ior:SI (match_operand:SI 1 "arith_reg_operand" "%0,0") (match_operand:SI 2 "logical_operand" "r,K08")))] "TARGET_SH1" "or %2,%0" [(set_attr "type" "arith")]) +(define_insn "*iorsi3_media" + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") + (ior:SI (match_operand:SI 1 "logical_reg_operand" "%r,r") + (match_operand:SI 2 "logical_operand" "r,I10")))] + "TARGET_SHMEDIA" + "@ + or %1, %2, %0 + ori %1, %2, %0" + [(set_attr "type" "arith_media")]) + (define_insn "iordi3" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") (ior:DI (match_operand:DI 1 "arith_reg_operand" "%r,r") (match_operand:DI 2 "logical_operand" "r,I10")))] "TARGET_SHMEDIA" @@ -1984,18 +3095,74 @@ ori %1, %2, %0" [(set_attr "type" "arith_media")]) -(define_insn "xorsi3" - [(set (match_operand:SI 0 "arith_reg_operand" "=z,r") +(define_insn_and_split "*logical_sidi3" + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") + (sign_extend:DI (match_operator:SI 3 "logical_operator" + [(match_operand:SI 1 "arith_reg_operand" "%r,r") + (match_operand:SI 2 "logical_operand" "r,I10")])))] + "TARGET_SHMEDIA" + "#" + "&& reload_completed" + [(set (match_dup 0) (match_dup 3))] + " +{ + operands[3] + = gen_rtx_fmt_ee (GET_CODE (operands[3]), DImode, + simplify_gen_subreg (DImode, operands[1], SImode, 0), + simplify_gen_subreg (DImode, operands[2], SImode, 0)); +}") + +(define_insn_and_split "*logical_sidisi3" + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") + (truncate:SI (sign_extend:DI + (match_operator:SI 3 "logical_operator" + [(match_operand:SI 1 "arith_reg_operand" "%r,r") + (match_operand:SI 2 "logical_operand" "r,I10")]))))] + "TARGET_SHMEDIA" + "#" + "&& 1" + [(set (match_dup 0) (match_dup 3))]) + +(define_insn_and_split "*logical_sidi3_2" + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") + (sign_extend:DI (truncate:SI (sign_extend:DI + (match_operator:SI 3 "logical_operator" + [(match_operand:SI 1 "arith_reg_operand" "%r,r") + (match_operand:SI 2 "logical_operand" "r,I10")])))))] + "TARGET_SHMEDIA" + "#" + "&& 1" + [(set (match_dup 0) (sign_extend:DI (match_dup 3)))]) + +(define_expand "xorsi3" + [(set (match_operand:SI 0 "arith_reg_operand" "") + (xor:SI (match_operand:SI 1 "logical_reg_operand" "") + (match_operand:SI 2 "xor_operand" "")))] + "" + "") + +(define_insn "*xorsi3_compact" + [(set (match_operand:SI 0 "arith_reg_dest" "=z,r") (xor:SI (match_operand:SI 1 "arith_reg_operand" "%0,0") (match_operand:SI 2 "logical_operand" "K08,r")))] "TARGET_SH1" "xor %2,%0" [(set_attr "type" "arith")]) +(define_insn "*xorsi3_media" + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") + (xor:SI (match_operand:SI 1 "logical_reg_operand" "%r,r") + (match_operand:SI 2 "xor_operand" "r,I06")))] + "TARGET_SHMEDIA" + "@ + xor %1, %2, %0 + xori %1, %2, %0" + [(set_attr "type" "arith_media")]) + (define_insn "xordi3" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") (xor:DI (match_operand:DI 1 "arith_reg_operand" "%r,r") - (match_operand:DI 2 "shmedia_6bit_operand" "r,I06")))] + (match_operand:DI 2 "xor_operand" "r,I06")))] "TARGET_SHMEDIA" "@ xor %1, %2, %0 @@ -2005,7 +3172,7 @@ ;; Combiner bridge pattern for 2 * sign extend -> logical op -> truncate. ;; converts 2 * sign extend -> logical op into logical op -> sign extend (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (sign_extend:DI (match_operator 4 "binary_logical_operator" [(match_operand 1 "any_register_operand" "") (match_operand 2 "any_register_operand" "")])))] @@ -2022,8 +3189,7 @@ offset = SUBREG_BYTE (operands[0]); operands[0] = SUBREG_REG (operands[0]); } - if (GET_CODE (operands[0]) != REG) - abort (); + gcc_assert (GET_CODE (operands[0]) == REG); if (! TARGET_LITTLE_ENDIAN) offset += 8 - GET_MODE_SIZE (inmode); operands[5] = gen_rtx_SUBREG (inmode, operands[0], offset); @@ -2076,8 +3242,25 @@ }" [(set_attr "type" "arith_media")]) +(define_split + [(set (match_operand:DI 0 "arith_reg_dest" "") + (ior:DI (zero_extend:DI (mem:QI (match_operand 1 + "ua_address_operand" ""))) + (ashift:DI (match_operand:DI 2 "arith_reg_operand" "") + (const_int 8)))) + (clobber (match_operand:DI 3 "register_operand" ""))] + "TARGET_SHMEDIA" + [(match_dup 4) (match_dup 5)] + " +{ + operands[4] = ((TARGET_LITTLE_ENDIAN ? gen_ldhi_q : gen_ldlo_q) + (operands[3], operands[1])); + operands[5] = gen_mextr_rl (operands[0], operands[3], operands[2], + GEN_INT (56), GEN_INT (8)); +}") + (define_insn "rotlsi3_1" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (rotate:SI (match_operand:SI 1 "arith_reg_operand" "0") (const_int 1))) (set (reg:SI T_REG) @@ -2087,7 +3270,7 @@ [(set_attr "type" "arith")]) (define_insn "rotlsi3_31" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (rotate:SI (match_operand:SI 1 "arith_reg_operand" "0") (const_int 31))) (clobber (reg:SI T_REG))] @@ -2096,7 +3279,7 @@ [(set_attr "type" "arith")]) (define_insn "rotlsi3_16" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (rotate:SI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 16)))] "TARGET_SH1" @@ -2104,7 +3287,7 @@ [(set_attr "type" "arith")]) (define_expand "rotlsi3" - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (rotate:SI (match_operand:SI 1 "arith_reg_operand" "") (match_operand:SI 2 "immediate_operand" "")))] "TARGET_SH1" @@ -2160,7 +3343,7 @@ }") (define_insn "*rotlhi3_8" - [(set (match_operand:HI 0 "arith_reg_operand" "=r") + [(set (match_operand:HI 0 "arith_reg_dest" "=r") (rotate:HI (match_operand:HI 1 "arith_reg_operand" "r") (const_int 8)))] "TARGET_SH1" @@ -2182,7 +3365,7 @@ ;; shift left (define_insn "ashlsi3_sh2a" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashift:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "arith_reg_operand" "r")))] "TARGET_SH2A" @@ -2194,7 +3377,7 @@ ;; insns. (define_insn_and_split "ashlsi3_std" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r,r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r,r,r") (ashift:SI (match_operand:SI 1 "arith_reg_operand" "0,0,0,0") (match_operand:SI 2 "nonmemory_operand" "r,M,P27,?ri"))) (clobber (match_scratch:SI 3 "=X,X,X,&r"))] @@ -2219,7 +3402,7 @@ (set_attr "type" "dyn_shift,arith,arith,arith")]) (define_insn "ashlhi3_k" - [(set (match_operand:HI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:HI 0 "arith_reg_dest" "=r,r") (ashift:HI (match_operand:HI 1 "arith_reg_operand" "0,0") (match_operand:HI 2 "const_int_operand" "M,P27")))] "TARGET_SH1 && CONST_OK_FOR_P27 (INTVAL (operands[2]))" @@ -2229,7 +3412,7 @@ [(set_attr "type" "arith")]) (define_insn "ashlsi3_n" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashift:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "const_int_operand" "n"))) (clobber (reg:SI T_REG))] @@ -2246,7 +3429,7 @@ (set_attr "type" "arith")]) (define_split - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (ashift:SI (match_operand:SI 1 "arith_reg_operand" "") (match_operand:SI 2 "const_int_operand" ""))) (clobber (reg:SI T_REG))] @@ -2259,14 +3442,15 @@ }") (define_insn "ashlsi3_media" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (ashift:SI (match_operand:SI 1 "extend_reg_operand" "r,r") - (match_operand:SI 2 "nonmemory_operand" "r,n")))] + (match_operand:SI 2 "shift_count_operand" "r,n")))] "TARGET_SHMEDIA" "@ shlld.l %1, %2, %0 shlli.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_expand "ashlsi3" [(parallel [(set (match_operand:SI 0 "arith_reg_operand" "") @@ -2293,8 +3477,8 @@ FAIL; }") -(define_insn "ashlhi3" - [(set (match_operand:HI 0 "arith_reg_operand" "=r") +(define_insn "*ashlhi3_n" + [(set (match_operand:HI 0 "arith_reg_dest" "=r") (ashift:HI (match_operand:HI 1 "arith_reg_operand" "0") (match_operand:HI 2 "const_int_operand" "n"))) (clobber (reg:SI T_REG))] @@ -2308,8 +3492,24 @@ (const_string "6"))) (set_attr "type" "arith")]) +(define_expand "ashlhi3" + [(parallel [(set (match_operand:HI 0 "arith_reg_operand" "") + (ashift:HI (match_operand:HI 1 "arith_reg_operand" "") + (match_operand:SI 2 "nonmemory_operand" ""))) + (clobber (reg:SI T_REG))])] + "TARGET_SH1" + " +{ + if (GET_CODE (operands[2]) != CONST_INT) + FAIL; + /* It may be possible to call gen_ashlhi3 directly with more generic + operands. Make sure operands[1] is a HImode register here. */ + if (!arith_reg_operand (operands[1], HImode)) + operands[1] = copy_to_mode_reg (HImode, operands[1]); +}") + (define_split - [(set (match_operand:HI 0 "arith_reg_operand" "") + [(set (match_operand:HI 0 "arith_reg_dest" "") (ashift:HI (match_operand:HI 1 "arith_reg_operand" "") (match_operand:HI 2 "const_int_operand" ""))) (clobber (reg:SI T_REG))] @@ -2326,7 +3526,7 @@ ; (define_insn "ashrsi3_sh2a" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (neg:SI (match_operand:SI 2 "arith_reg_operand" "r"))))] "TARGET_SH2A" @@ -2335,7 +3535,7 @@ (set_attr "length" "4")]) (define_insn "ashrsi3_k" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "const_int_operand" "M"))) (clobber (reg:SI T_REG))] @@ -2352,7 +3552,7 @@ ;; ??? This should be a define expand. (define_insn "ashrsi2_16" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 16)))] "TARGET_SH1" @@ -2360,7 +3560,7 @@ [(set_attr "length" "4")]) (define_split - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "") (const_int 16)))] "TARGET_SH1" @@ -2371,7 +3571,7 @@ ;; ??? This should be a define expand. (define_insn "ashrsi2_31" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (const_int 31))) (clobber (reg:SI T_REG))] @@ -2380,7 +3580,7 @@ [(set_attr "length" "4")]) (define_split - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "") (const_int 31))) (clobber (reg:SI T_REG))] @@ -2389,12 +3589,26 @@ " { emit_insn (gen_ashlsi_c (operands[0], operands[1])); - emit_insn (gen_subc1 (operands[0], operands[0], operands[0])); + emit_insn (gen_mov_neg_si_t (operands[0])); + DONE; +}") + +(define_peephole2 + [(set (match_operand:SI 0 "arith_reg_dest" "") (const_int 0)) + (set (reg:SI T_REG) + (gt:SI (match_dup 0) (match_operand:SI 1 "arith_reg_operand" "")))] + "TARGET_SH1 + && peep2_reg_dead_p (2, operands[0]) + && peep2_reg_dead_p (2, operands[1])" + [(const_int 0)] + " +{ + emit_insn (gen_ashlsi_c (operands[1], operands[1])); DONE; }") (define_insn "ashlsi_c" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashift:SI (match_operand:SI 1 "arith_reg_operand" "0") (const_int 1))) (set (reg:SI T_REG) (lt:SI (match_dup 1) (const_int 0)))] @@ -2402,8 +3616,16 @@ "shll %0" [(set_attr "type" "arith")]) +(define_insn "*ashlsi_c_void" + [(set (reg:SI T_REG) + (lt:SI (match_operand:SI 0 "arith_reg_operand" "r") (const_int 0))) + (clobber (match_scratch:SI 1 "=0"))] + "TARGET_SH1 && cse_not_expected" + "shll %0" + [(set_attr "type" "arith")]) + (define_insn "ashrsi3_d" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ashiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (neg:SI (match_operand:SI 2 "arith_reg_operand" "r"))))] "TARGET_SH3" @@ -2423,14 +3645,15 @@ (set_attr "needs_delay_slot" "yes")]) (define_insn "ashrsi3_media" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (ashiftrt:SI (match_operand:SI 1 "extend_reg_operand" "r,r") - (match_operand:SI 2 "nonmemory_operand" "r,n")))] + (match_operand:SI 2 "shift_count_operand" "r,n")))] "TARGET_SHMEDIA" "@ shard.l %1, %2, %0 shari.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_expand "ashrsi3" [(parallel [(set (match_operand:SI 0 "arith_reg_operand" "") @@ -2454,7 +3677,7 @@ ;; logical shift right (define_insn "lshrsi3_sh2a" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (neg:SI (match_operand:SI 2 "arith_reg_operand" "r"))))] "TARGET_SH2A" @@ -2463,7 +3686,7 @@ (set_attr "length" "4")]) (define_insn "lshrsi3_d" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (neg:SI (match_operand:SI 2 "arith_reg_operand" "r"))))] "TARGET_SH3" @@ -2473,7 +3696,7 @@ ;; Only the single bit shift clobbers the T bit. (define_insn "lshrsi3_m" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "const_int_operand" "M"))) (clobber (reg:SI T_REG))] @@ -2482,7 +3705,7 @@ [(set_attr "type" "arith")]) (define_insn "lshrsi3_k" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "const_int_operand" "P27")))] "TARGET_SH1 && CONST_OK_FOR_P27 (INTVAL (operands[2])) @@ -2491,7 +3714,7 @@ [(set_attr "type" "arith")]) (define_insn "lshrsi3_n" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (match_operand:SI 2 "const_int_operand" "n"))) (clobber (reg:SI T_REG))] @@ -2508,7 +3731,7 @@ (set_attr "type" "arith")]) (define_split - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "") (match_operand:SI 2 "const_int_operand" ""))) (clobber (reg:SI T_REG))] @@ -2521,17 +3744,18 @@ }") (define_insn "lshrsi3_media" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (lshiftrt:SI (match_operand:SI 1 "extend_reg_operand" "r,r") - (match_operand:SI 2 "nonmemory_operand" "r,n")))] + (match_operand:SI 2 "shift_count_operand" "r,n")))] "TARGET_SHMEDIA" "@ shlrd.l %1, %2, %0 shlri.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_expand "lshrsi3" - [(parallel [(set (match_operand:SI 0 "arith_reg_operand" "") + [(parallel [(set (match_operand:SI 0 "arith_reg_dest" "") (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "") (match_operand:SI 2 "nonmemory_operand" ""))) (clobber (reg:SI T_REG))])] @@ -2560,7 +3784,7 @@ ;; ??? This should be a define expand. (define_insn "ashldi3_k" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (ashift:DI (match_operand:DI 1 "arith_reg_operand" "0") (const_int 1))) (clobber (reg:SI T_REG))] @@ -2570,15 +3794,24 @@ (set_attr "type" "arith")]) (define_insn "ashldi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r,r") (ashift:DI (match_operand:DI 1 "arith_reg_operand" "r,r") - (match_operand:DI 2 "nonmemory_operand" "r,n")))] + (match_operand:DI 2 "shift_count_operand" "r,n")))] "TARGET_SHMEDIA" "@ shlld %1, %2, %0 shlli %1, %2, %0" [(set_attr "type" "arith_media")]) +(define_insn "*ashldisi3_media" + [(set (subreg:DI (match_operand:SI 0 "arith_reg_operand" "=r") 0) + (ashift:DI (match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "const_int_operand" "n")))] + "TARGET_SHMEDIA && INTVAL (operands[2]) < 32" + "shlli.l %1, %2, %0" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) + (define_expand "ashldi3" [(parallel [(set (match_operand:DI 0 "arith_reg_operand" "") (ashift:DI (match_operand:DI 1 "arith_reg_operand" "") @@ -2600,7 +3833,7 @@ ;; ??? This should be a define expand. (define_insn "lshrdi3_k" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (lshiftrt:DI (match_operand:DI 1 "arith_reg_operand" "0") (const_int 1))) (clobber (reg:SI T_REG))] @@ -2610,15 +3843,26 @@ (set_attr "type" "arith")]) (define_insn "lshrdi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "ext_dest_operand" "=r,r") (lshiftrt:DI (match_operand:DI 1 "arith_reg_operand" "r,r") - (match_operand:DI 2 "nonmemory_operand" "r,n")))] - "TARGET_SHMEDIA" + (match_operand:DI 2 "shift_count_operand" "r,n")))] + "TARGET_SHMEDIA + && (arith_reg_dest (operands[0], DImode) + || (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) > 32))" "@ shlrd %1, %2, %0 shlri %1, %2, %0" [(set_attr "type" "arith_media")]) +(define_insn "*lshrdisi3_media" + [(set (subreg:DI (match_operand:SI 0 "arith_reg_operand" "=r") 0) + (lshiftrt:DI (match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "const_int_operand" "n")))] + "TARGET_SHMEDIA && INTVAL (operands[2]) < 32" + "shlri.l %1, %2, %0" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) + (define_expand "lshrdi3" [(parallel [(set (match_operand:DI 0 "arith_reg_operand" "") (lshiftrt:DI (match_operand:DI 1 "arith_reg_operand" "") @@ -2640,7 +3884,7 @@ ;; ??? This should be a define expand. (define_insn "ashrdi3_k" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (ashiftrt:DI (match_operand:DI 1 "arith_reg_operand" "0") (const_int 1))) (clobber (reg:SI T_REG))] @@ -2650,15 +3894,44 @@ (set_attr "type" "arith")]) (define_insn "ashrdi3_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "ext_dest_operand" "=r,r") (ashiftrt:DI (match_operand:DI 1 "arith_reg_operand" "r,r") - (match_operand:DI 2 "nonmemory_operand" "r,n")))] - "TARGET_SHMEDIA" + (match_operand:DI 2 "shift_count_operand" "r,n")))] + "TARGET_SHMEDIA + && (arith_reg_dest (operands[0], DImode) + || (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) >= 32))" "@ shard %1, %2, %0 shari %1, %2, %0" [(set_attr "type" "arith_media")]) +(define_insn "*ashrdisi3_media" + [(set (subreg:DI (match_operand:SI 0 "arith_reg_operand" "=r") 0) + (ashiftrt:DI (match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "const_int_operand" "n")))] + "TARGET_SHMEDIA && INTVAL (operands[2]) < 32" + "shari.l %1, %2, %0" + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) + +(define_insn "ashrdisi3_media_high" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (truncate:SI + (ashiftrt:DI (match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "const_int_operand" "n"))))] + "TARGET_SHMEDIA && INTVAL (operands[2]) >= 32" + "shari %1, %2, %0" + [(set_attr "type" "arith_media")]) + +(define_insn "ashrdisi3_media_opaque" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (unspec:SI [(match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "const_int_operand" "n")] + UNSPEC_ASHIFTRT))] + "TARGET_SHMEDIA" + "shari %1, %2, %0" + [(set_attr "type" "arith_media")]) + (define_expand "ashrdi3" [(parallel [(set (match_operand:DI 0 "arith_reg_operand" "") (ashiftrt:DI (match_operand:DI 1 "arith_reg_operand" "") @@ -2875,7 +4148,7 @@ ;; allow the xtrct instruction to be generated from C source. (define_insn "xtrct_left" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ior:SI (ashift:SI (match_operand:SI 1 "arith_reg_operand" "r") (const_int 16)) (lshiftrt:SI (match_operand:SI 2 "arith_reg_operand" "0") @@ -2885,7 +4158,7 @@ [(set_attr "type" "arith")]) (define_insn "xtrct_right" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (ior:SI (lshiftrt:SI (match_operand:SI 1 "arith_reg_operand" "0") (const_int 16)) (ashift:SI (match_operand:SI 2 "arith_reg_operand" "r") @@ -2899,7 +4172,7 @@ ;; ------------------------------------------------------------------------- (define_insn "negc" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (neg:SI (plus:SI (reg:SI T_REG) (match_operand:SI 1 "arith_reg_operand" "r")))) (set (reg:SI T_REG) @@ -2910,7 +4183,7 @@ [(set_attr "type" "arith")]) (define_insn "*negdi_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (neg:DI (match_operand:DI 1 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "sub r63, %1, %0" @@ -2941,35 +4214,61 @@ }") (define_insn "negsi2" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (neg:SI (match_operand:SI 1 "arith_reg_operand" "r")))] "TARGET_SH1" "neg %1,%0" [(set_attr "type" "arith")]) (define_insn "one_cmplsi2" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (not:SI (match_operand:SI 1 "arith_reg_operand" "r")))] "TARGET_SH1" "not %1,%0" [(set_attr "type" "arith")]) (define_expand "one_cmpldi2" - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (xor:DI (match_operand:DI 1 "arith_reg_operand" "") (const_int -1)))] "TARGET_SHMEDIA" "") + +/* The SH4 202 can do zero-offset branches without pipeline stalls. + This can be used as some kind of conditional execution, which is useful + for abs. */ +(define_split + [(set (match_operand:SI 0 "arith_reg_dest" "") + (plus:SI (xor:SI (neg:SI (reg:SI T_REG)) + (match_operand:SI 1 "arith_reg_operand" "")) + (reg:SI T_REG)))] + "TARGET_HARD_SH4" + [(const_int 0)] + "emit_insn (gen_movsi_i (operands[0], operands[1])); + emit_insn (gen_cneg (operands[0], operands[0], operands[0])); + DONE;") + +(define_insn "cneg" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (if_then_else:SI (eq:SI (reg:SI T_REG) (const_int 0)) + (match_operand:SI 1 "arith_reg_operand" "0") + (neg:SI (match_operand:SI 2 "arith_reg_operand" "r"))))] + "TARGET_HARD_SH4" + "bf 0f\;neg %2,%0\\n0:" + [(set_attr "type" "arith") ;; poor approximation + (set_attr "length" "4")]) + ;; ------------------------------------------------------------------------- ;; Zero extension instructions ;; ------------------------------------------------------------------------- (define_insn "zero_extendsidi2" - [(set (match_operand:DI 0 "register_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (zero_extend:DI (match_operand:SI 1 "extend_reg_operand" "r")))] "TARGET_SHMEDIA" "addz.l %1, r63, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "extend")]) (define_insn "zero_extendhidi2" [(set (match_operand:DI 0 "register_operand" "=r,r") @@ -2978,7 +4277,11 @@ "@ # ld%M1.uw %m1, %0" - [(set_attr "type" "*,load_media")]) + [(set_attr "type" "*,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:DI 0 "register_operand" "") @@ -2995,7 +4298,7 @@ ;; ??? when a truncated input to a zero_extend is reloaded, reload will ;; reload the entire truncate expression. (define_insn_and_split "*loaddi_trunc" - [(set (match_operand 0 "int_gpr_dest" "=r") + [(set (match_operand 0 "any_register_operand" "=r") (truncate (match_operand:DI 1 "memory_operand" "m")))] "TARGET_SHMEDIA && reload_completed" "#" @@ -3010,7 +4313,11 @@ "@ andi %1, 255, %0 ld%M1.ub %m1, %0" - [(set_attr "type" "arith_media,load_media")]) + [(set_attr "type" "arith_media,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_expand "zero_extendhisi2" [(set (match_operand:SI 0 "arith_reg_operand" "") @@ -3023,7 +4330,7 @@ }") (define_insn "*zero_extendhisi2_compact" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (zero_extend:SI (match_operand:HI 1 "arith_reg_operand" "r")))] "TARGET_SH1" "extu.w %1,%0" @@ -3036,18 +4343,27 @@ "@ # ld%M1.uw %m1, %0" - [(set_attr "type" "arith_media,load_media")]) + [(set_attr "type" "arith_media,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:SI 0 "register_operand" "") (zero_extend:SI (match_operand:HI 1 "extend_reg_operand" "")))] "TARGET_SHMEDIA && reload_completed" - [(set (match_dup 0) (ashift:SI (subreg:SI (match_dup 1) 0) (const_int 16))) + [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 16))) (set (match_dup 0) (lshiftrt:SI (match_dup 0) (const_int 16)))] " { - if (GET_CODE (operands[1]) == TRUNCATE) - operands[1] = XEXP (operands[1], 0); + rtx op1 = operands[1]; + + if (GET_CODE (op1) == TRUNCATE) + op1 = XEXP (op1, 0); + operands[2] + = simplify_gen_subreg (SImode, op1, GET_MODE (op1), + subreg_lowpart_offset (SImode, GET_MODE (op1))); }") (define_expand "zero_extendqisi2" @@ -3061,7 +4377,7 @@ }") (define_insn "*zero_extendqisi2_compact" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (zero_extend:SI (match_operand:QI 1 "arith_reg_operand" "r")))] "TARGET_SH1" "extu.b %1,%0" @@ -3074,10 +4390,14 @@ "@ andi %1, 255, %0 ld%M1.ub %m1, %0" - [(set_attr "type" "arith_media,load_media")]) + [(set_attr "type" "arith_media,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_insn "zero_extendqihi2" - [(set (match_operand:HI 0 "arith_reg_operand" "=r") + [(set (match_operand:HI 0 "arith_reg_dest" "=r") (zero_extend:HI (match_operand:QI 1 "arith_reg_operand" "r")))] "TARGET_SH1" "extu.b %1,%0" @@ -3092,13 +4412,18 @@ ;; convert_move generates good code for SH[1-4]. (define_insn "extendsidi2" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "r,m")))] + [(set (match_operand:DI 0 "register_operand" "=r,r,r") + (sign_extend:DI (match_operand:SI 1 "nonimmediate_operand" "r,m,?f")))] "TARGET_SHMEDIA" "@ add.l %1, r63, %0 - ld%M1.l %m1, %0" - [(set_attr "type" "arith_media,load_media")]) + ld%M1.l %m1, %0 + fmov.sl %1, %0" + [(set_attr "type" "arith_media,load_media,fpconv_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "extend")))]) (define_insn "extendhidi2" [(set (match_operand:DI 0 "register_operand" "=r,r") @@ -3107,7 +4432,11 @@ "@ # ld%M1.w %m1, %0" - [(set_attr "type" "*,load_media")]) + [(set_attr "type" "*,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:DI 0 "register_operand" "") @@ -3128,7 +4457,11 @@ "@ # ld%M1.b %m1, %0" - [(set_attr "type" "*,load_media")]) + [(set_attr "type" "*,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:DI 0 "register_operand" "") @@ -3143,13 +4476,13 @@ }") (define_expand "extendhisi2" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (sign_extend:SI (match_operand:HI 1 "general_extend_operand" "r,m")))] "" "") (define_insn "*extendhisi2_compact" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (sign_extend:SI (match_operand:HI 1 "general_movsrc_operand" "r,m")))] "TARGET_SH1" "@ @@ -3164,28 +4497,36 @@ "@ # ld%M1.w %m1, %0" - [(set_attr "type" "arith_media,load_media")]) + [(set_attr "type" "arith_media,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:HI 1 "extend_reg_operand" "")))] "TARGET_SHMEDIA && reload_completed" - [(set (match_dup 0) (ashift:SI (subreg:SI (match_dup 1) 0) (const_int 16))) + [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 16))) (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 16)))] " { - if (GET_CODE (operands[1]) == TRUNCATE) - operands[1] = XEXP (operands[1], 0); + rtx op1 = operands[1]; + if (GET_CODE (op1) == TRUNCATE) + op1 = XEXP (op1, 0); + operands[2] + = simplify_gen_subreg (SImode, op1, GET_MODE (op1), + subreg_lowpart_offset (SImode, GET_MODE (op1))); }") (define_expand "extendqisi2" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (sign_extend:SI (match_operand:QI 1 "general_extend_operand" "r,m")))] "" "") (define_insn "*extendqisi2_compact" - [(set (match_operand:SI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r,r") (sign_extend:SI (match_operand:QI 1 "general_movsrc_operand" "r,m")))] "TARGET_SH1" "@ @@ -3200,22 +4541,30 @@ "@ # ld%M1.b %m1, %0" - [(set_attr "type" "arith_media,load_media")]) + [(set_attr "type" "arith_media,load_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:SI 0 "register_operand" "") (sign_extend:SI (match_operand:QI 1 "extend_reg_operand" "")))] "TARGET_SHMEDIA && reload_completed" - [(set (match_dup 0) (ashift:SI (subreg:SI (match_dup 1) 0) (const_int 24))) + [(set (match_dup 0) (ashift:SI (match_dup 2) (const_int 24))) (set (match_dup 0) (ashiftrt:SI (match_dup 0) (const_int 24)))] " { - if (GET_CODE (operands[1]) == TRUNCATE) - operands[1] = XEXP (operands[1], 0); + rtx op1 = operands[1]; + if (GET_CODE (op1) == TRUNCATE) + op1 = XEXP (op1, 0); + operands[2] + = simplify_gen_subreg (SImode, op1, GET_MODE (op1), + subreg_lowpart_offset (SImode, GET_MODE (op1))); }") (define_insn "extendqihi2" - [(set (match_operand:HI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:HI 0 "arith_reg_dest" "=r,r") (sign_extend:HI (match_operand:QI 1 "general_movsrc_operand" "r,m")))] "TARGET_SH1" "@ @@ -3237,8 +4586,11 @@ fmov.ls %1, %0 fmov.sl %T1, %0 fmov.s %T1, %0" - [(set_attr "type" "arith_media,store_media,fstore_media,fload_media,fpconv_media,fmove_media")]) - + [(set_attr "type" "arith_media,store_media,fstore_media,fload_media,fpconv_media,fmove_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "extend")))]) (define_insn "truncdihi2" [(set (match_operand:HI 0 "general_movdst_operand" "=?r,m") @@ -3248,7 +4600,11 @@ shlli\\t%1,48,%0\;shlri\\t%0,48,%0 st%M0.w %m0, %1" [(set_attr "type" "arith_media,store_media") - (set_attr "length" "8,4")]) + (set_attr "length" "8,4") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "extend")))]) ; N.B. This should agree with LOAD_EXTEND_OP and movqi. ; Because we use zero extension, we can't provide signed QImode compares @@ -3260,8 +4616,11 @@ "@ andi %1, 255, %0 st%M0.b %m0, %1" - [(set_attr "type" "arith_media,store")]) - + [(set_attr "type" "arith_media,store") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "extend")))]) ;; ------------------------------------------------------------------------- ;; Move instructions ;; ------------------------------------------------------------------------- @@ -3465,7 +4824,7 @@ (define_insn_and_split "load_ra" [(set (match_operand:SI 0 "general_movdst_operand" "") - (unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))] + (unspec:SI [(match_operand:SI 1 "register_operand" "")] UNSPEC_RA))] "TARGET_SH1" "#" "&& ! currently_expanding_to_rtl" @@ -3476,14 +4835,18 @@ operands[1] = gen_rtx_MEM (SImode, return_address_pointer_rtx); }") +;; The '?'s in the following constraints may not reflect the time taken +;; to perform the move. They are there to discourage the use of floating- +;; point registers for storing integer values. (define_insn "*movsi_media" [(set (match_operand:SI 0 "general_movdst_operand" - "=r,r,r,r,m,f,m,f,r,f,*b,r,b") + "=r,r,r,r,m,f?,m,f?,r,f?,*b,r,b") (match_operand:SI 1 "general_movsrc_operand" - "r,I16C16,nCpg,m,rZ,m,f,rZ,f,f,r,*b,Csy"))] + "r,I16C16,nCpg,m,rZ,m,f?,rZ,f?,f?,r,*b,Csy"))] "TARGET_SHMEDIA_FPU && (register_operand (operands[0], SImode) - || sh_register_operand (operands[1], SImode))" + || sh_register_operand (operands[1], SImode) + || GET_CODE (operands[1]) == TRUNCATE)" "@ add.l %1, r63, %0 movi %1, %0 @@ -3499,16 +4862,21 @@ gettr %1, %0 pt %1, %0" [(set_attr "type" "arith_media,arith_media,*,load_media,store_media,fload_media,fstore_media,fload_media,fpconv_media,fmove_media,ptabs_media,gettr_media,pt_media") - (set_attr "length" "4,4,8,4,4,4,4,4,4,4,4,4,12")]) + (set_attr "length" "4,4,8,4,4,4,4,4,4,4,4,4,12") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_insn "*movsi_media_nofpu" [(set (match_operand:SI 0 "general_movdst_operand" - "=r,r,r,r,m,*b,r,b") + "=r,r,r,r,m,*b,r,*b") (match_operand:SI 1 "general_movsrc_operand" "r,I16C16,nCpg,m,rZ,r,*b,Csy"))] "TARGET_SHMEDIA && (register_operand (operands[0], SImode) - || sh_register_operand (operands[1], SImode))" + || sh_register_operand (operands[1], SImode) + || GET_CODE (operands[1]) == TRUNCATE)" "@ add.l %1, r63, %0 movi %1, %0 @@ -3519,18 +4887,72 @@ gettr %1, %0 pt %1, %0" [(set_attr "type" "arith_media,arith_media,*,load_media,store_media,ptabs_media,gettr_media,pt_media") - (set_attr "length" "4,4,8,4,4,4,4,12")]) + (set_attr "length" "4,4,8,4,4,4,4,12") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) + +(define_expand "movsi_const" + [(set (match_operand:SI 0 "arith_reg_operand" "=r") + (const:SI (sign_extend:SI + (truncate:HI + (ashiftrt:SI + (match_operand:DI 1 "immediate_operand" "s") + (const_int 16)))))) + (set (match_dup 0) + (ior:SI (ashift:SI (match_dup 0) (const_int 16)) + (zero_extend:SI + (truncate:HI + (const:SI + (sign_extend:SI + (truncate:HI (match_dup 1))))))))] + "TARGET_SHMEDIA && reload_completed + && MOVI_SHORI_BASE_OPERAND_P (operands[1])" + " +{ + if (GET_CODE (operands[1]) == LABEL_REF + && GET_CODE (XEXP (operands[1], 0)) == CODE_LABEL) + LABEL_NUSES (XEXP (operands[1], 0)) += 2; + else if (GOTOFF_P (operands[1])) + { + rtx unspec = XEXP (operands[1], 0); + + if (! UNSPEC_GOTOFF_P (unspec)) + { + unspec = XEXP (unspec, 0); + if (! UNSPEC_GOTOFF_P (unspec)) + abort (); + } + if (GET_CODE (XVECEXP (unspec , 0, 0)) == LABEL_REF + && (GET_CODE (XEXP (XVECEXP (unspec, 0, 0), 0)) == CODE_LABEL)) + LABEL_NUSES (XEXP (XVECEXP (unspec, 0, 0), 0)) += 2; + } +}") + +(define_expand "movsi_const_16bit" + [(set (match_operand:SI 0 "arith_reg_operand" "=r") + (const:SI (sign_extend:SI + (truncate:HI + (match_operand:DI 1 "immediate_operand" "s")))))] + "TARGET_SHMEDIA && flag_pic && reload_completed + && GET_CODE (operands[1]) == SYMBOL_REF" + "") (define_split - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (match_operand:SI 1 "immediate_operand" ""))] "TARGET_SHMEDIA && reload_completed && MOVI_SHORI_BASE_OPERAND_P (operands[1])" - [(set (subreg:DI (match_dup 0) 0) (match_dup 2))] + [(const_int 0)] " { - operands[2] = shallow_copy_rtx (operands[1]); - PUT_MODE (operands[2], DImode); + rtx insn = emit_insn (gen_movsi_const (operands[0], operands[1])); + + REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, operands[1], + REG_NOTES (insn)); + + DONE; }") (define_split @@ -3562,7 +4984,7 @@ } else if (TARGET_SHCOMPACT) { - operands[1] = function_symbol (\"__ic_invalidate\"); + operands[1] = function_symbol (NULL, \"__ic_invalidate\", SFUNC_STATIC); operands[1] = force_reg (Pmode, operands[1]); emit_insn (gen_ic_invalidate_line_compact (operands[0], operands[1])); DONE; @@ -3603,7 +5025,7 @@ ;; ??? could make arg 0 an offsettable memory operand to allow to save ;; an add in the code that calculates the address. (define_insn "ic_invalidate_line_media" - [(unspec_volatile [(match_operand 0 "register_operand" "r")] + [(unspec_volatile [(match_operand 0 "any_register_operand" "r")] UNSPEC_ICACHE)] "TARGET_SHMEDIA" "ocbwb %0,0\;synco\;icbi %0, 0\;synci" @@ -3630,7 +5052,8 @@ rtx sfun, tramp; tramp = force_reg (Pmode, operands[0]); - sfun = force_reg (Pmode, function_symbol (\"__init_trampoline\")); + sfun = force_reg (Pmode, function_symbol (NULL, \"__init_trampoline\", + SFUNC_STATIC)); emit_move_insn (gen_rtx_REG (SImode, R2_REG), operands[1]); emit_move_insn (gen_rtx_REG (SImode, R3_REG), operands[2]); @@ -3670,13 +5093,17 @@ (match_operand:QI 1 "general_movsrc_operand" "r,I16C16,m,rZ"))] "TARGET_SHMEDIA && (arith_reg_operand (operands[0], QImode) - || arith_reg_or_0_operand (operands[1], QImode))" + || extend_reg_or_0_operand (operands[1], QImode))" "@ add.l %1, r63, %0 movi %1, %0 ld%M1.ub %m1, %0 st%M0.b %m0, %N1" - [(set_attr "type" "arith_media,arith_media,load_media,store_media")]) + [(set_attr "type" "arith_media,arith_media,load_media,store_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_expand "movqi" [(set (match_operand:QI 0 "general_operand" "") @@ -3734,7 +5161,11 @@ # ld%M1.w %m1, %0 st%M0.w %m0, %N1" - [(set_attr "type" "arith_media,arith_media,*,load_media,store_media")]) + [(set_attr "type" "arith_media,arith_media,*,load_media,store_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split [(set (match_operand:HI 0 "register_operand" "") @@ -3796,14 +5227,20 @@ && GET_CODE (XEXP (operands[1], 0)) == POST_INC)) FAIL; - if (GET_CODE (operands[0]) == REG) - regno = REGNO (operands[0]); - else if (GET_CODE (operands[0]) == SUBREG) - regno = subreg_regno (operands[0]); - else if (GET_CODE (operands[0]) == MEM) - regno = -1; - else - abort (); + switch (GET_CODE (operands[0])) + { + case REG: + regno = REGNO (operands[0]); + break; + case SUBREG: + regno = subreg_regno (operands[0]); + break; + case MEM: + regno = -1; + break; + default: + gcc_unreachable (); + } if (regno == -1 || ! refers_to_regno_p (regno, regno + 1, operands[1], 0)) @@ -3826,11 +5263,14 @@ FAIL; }") +;; The '?'s in the following constraints may not reflect the time taken +;; to perform the move. They are there to discourage the use of floating- +;; point registers for storing integer values. (define_insn "*movdi_media" [(set (match_operand:DI 0 "general_movdst_operand" - "=r,r,r,rl,m,f,m,f,r,f,*b,r,b") + "=r,r,r,rl,m,f?,m,f?,r,f?,*b,r,*b") (match_operand:DI 1 "general_movsrc_operand" - "r,I16C16,nCpgF,m,rlZ,m,f,rZ,f,f,r,*b,Csy"))] + "r,I16C16,nCpgF,m,rlZ,m,f?,rZ,f?,f?,r,*b,Csy"))] "TARGET_SHMEDIA_FPU && (register_operand (operands[0], DImode) || sh_register_operand (operands[1], DImode))" @@ -3852,7 +5292,7 @@ (set_attr "length" "4,4,16,4,4,4,4,4,4,4,4,4,*")]) (define_insn "*movdi_media_nofpu" - [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,rl,m,*b,r,b") + [(set (match_operand:DI 0 "general_movdst_operand" "=r,r,r,rl,m,*b,r,*b"); (match_operand:DI 1 "general_movsrc_operand" "r,I16C16,nCpgF,m,rlZ,r,*b,Csy"))] "TARGET_SHMEDIA && (register_operand (operands[0], DImode) @@ -3869,8 +5309,16 @@ [(set_attr "type" "arith_media,arith_media,*,load_media,store_media,ptabs_media,gettr_media,pt_media") (set_attr "length" "4,4,16,4,4,4,4,*")]) +(define_insn "*movdi_media_I16" + [(set (match_operand:DI 0 "ext_dest_operand" "=r") + (match_operand:DI 1 "const_int_operand" "I16"))] + "TARGET_SHMEDIA && reload_completed" + "movi %1, %0" + [(set_attr "type" "arith_media") + (set_attr "length" "4")]) + (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "arith_reg_dest" "") (match_operand:DI 1 "immediate_operand" ""))] "TARGET_SHMEDIA && reload_completed && MOVI_SHORI_BASE_OPERAND_P (operands[1])" @@ -3964,7 +5412,7 @@ "") (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "ext_dest_operand" "") (match_operand:DI 1 "immediate_operand" ""))] "TARGET_SHMEDIA && reload_completed && GET_CODE (operands[1]) == CONST_INT @@ -3986,10 +5434,20 @@ /* Arithmetic shift right the word by 16 bits. */ high >>= 16; - sign = 1; - sign <<= (HOST_BITS_PER_WIDE_INT - 16 - 1); - high ^= sign; - high -= sign; + if (GET_CODE (operands[0]) == SUBREG + && GET_MODE (SUBREG_REG (operands[0])) == SImode) + { + high &= 0xffff; + high ^= 0x8000; + high -= 0x8000; + } + else + { + sign = 1; + sign <<= (HOST_BITS_PER_WIDE_INT - 16 - 1); + high ^= sign; + high -= sign; + } do { /* If we can't generate the constant with a two-insn movi / shori @@ -4063,7 +5521,7 @@ }") (define_split - [(set (match_operand:DI 0 "arith_reg_operand" "") + [(set (match_operand:DI 0 "ext_dest_operand" "") (match_operand:DI 1 "immediate_operand" ""))] "TARGET_SHMEDIA && reload_completed && GET_CODE (operands[1]) == CONST_DOUBLE" @@ -4103,18 +5561,28 @@ }") (define_insn "shori_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r,r") + [(set (match_operand:DI 0 "ext_dest_operand" "=r,r") (ior:DI (ashift:DI (match_operand:DI 1 "arith_reg_operand" "0,0") (const_int 16)) (zero_extend:DI (truncate:HI (match_operand:DI 2 "immediate_operand" "I16C16,nF")))))] - "TARGET_SHMEDIA" + "TARGET_SHMEDIA && (reload_completed || arith_reg_dest (operands[0], DImode))" "@ shori %u2, %0 #" [(set_attr "type" "arith_media,*")]) +(define_insn "*shori_media_si" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (ior:SI (ashift:SI (match_operand:SI 1 "arith_reg_operand" "0") + (const_int 16)) + (zero_extend:SI + (truncate:HI + (match_operand:SI 2 "immediate_operand" "I16C16")))))] + "TARGET_SHMEDIA" + "shori %u2, %0") + (define_expand "movdi" [(set (match_operand:DI 0 "general_movdst_operand" "") (match_operand:DI 1 "general_movsrc_operand" ""))] @@ -4153,7 +5621,7 @@ [(set_attr "type" "arith_media,*,load_media,store_media")]) (define_split - [(set (match_operand:DF 0 "arith_reg_operand" "") + [(set (match_operand:DF 0 "arith_reg_dest" "") (match_operand:DF 1 "immediate_operand" ""))] "TARGET_SHMEDIA && reload_completed" [(set (match_dup 3) (match_dup 2))] @@ -4170,11 +5638,12 @@ operands[2] = immed_double_const ((unsigned long) values[endian] | ((HOST_WIDE_INT) values[1 - endian] << 32), 0, DImode); - else if (HOST_BITS_PER_WIDE_INT == 32) - operands[2] = immed_double_const (values[endian], values[1 - endian], - DImode); else - abort (); + { + gcc_assert (HOST_BITS_PER_WIDE_INT == 32); + operands[2] = immed_double_const (values[endian], values[1 - endian], + DImode); + } operands[3] = gen_rtx_REG (DImode, true_regnum (operands[0])); }") @@ -4542,14 +6011,20 @@ && GET_CODE (XEXP (operands[1], 0)) == POST_INC)) FAIL; - if (GET_CODE (operands[0]) == REG) - regno = REGNO (operands[0]); - else if (GET_CODE (operands[0]) == SUBREG) - regno = subreg_regno (operands[0]); - else if (GET_CODE (operands[0]) == MEM) - regno = -1; - else - abort (); + switch (GET_CODE (operands[0])) + { + case REG: + regno = REGNO (operands[0]); + break; + case SUBREG: + regno = subreg_regno (operands[0]); + break; + case MEM: + regno = -1; + break; + default: + gcc_unreachable (); + } if (regno == -1 || ! refers_to_regno_p (regno, regno + 1, operands[1], 0)) @@ -4579,7 +6054,8 @@ [(set (match_operand:SI 0 "register_operand" "") (match_operand:SI 1 "" "")) (clobber (match_operand 2 "register_operand" ""))] - "TARGET_SH1 && ! reload_in_progress && ! reload_completed" + "TARGET_SH1 && ! reload_in_progress && ! reload_completed + && ALLOW_INDEXED_ADDRESS" [(use (reg:SI R0_REG))] " { @@ -4606,7 +6082,8 @@ [(set (match_operand:SI 1 "" "") (match_operand:SI 0 "register_operand" "")) (clobber (match_operand 2 "register_operand" ""))] - "TARGET_SH1 && ! reload_in_progress && ! reload_completed" + "TARGET_SH1 && ! reload_in_progress && ! reload_completed + && ALLOW_INDEXED_ADDRESS" [(use (reg:SI R0_REG))] " { @@ -4845,7 +6322,11 @@ fst%M0.s %m0, %1 ld%M1.l %m1, %0 st%M0.l %m0, %N1" - [(set_attr "type" "fmove_media,fload_media,fpconv_media,arith_media,*,fload_media,fstore_media,load_media,store_media")]) + [(set_attr "type" "fmove_media,fload_media,fpconv_media,arith_media,*,fload_media,fstore_media,load_media,store_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_insn "movsf_media_nofpu" [(set (match_operand:SF 0 "general_movdst_operand" "=r,r,r,m") @@ -4858,10 +6339,14 @@ # ld%M1.l %m1, %0 st%M0.l %m0, %N1" - [(set_attr "type" "arith_media,*,load_media,store_media")]) + [(set_attr "type" "arith_media,*,load_media,store_media") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_split - [(set (match_operand:SF 0 "arith_reg_operand" "") + [(set (match_operand:SF 0 "arith_reg_dest" "") (match_operand:SF 1 "immediate_operand" ""))] "TARGET_SHMEDIA && reload_completed && ! FP_REGISTER_P (true_regnum (operands[0]))" @@ -4999,12 +6484,70 @@ "") (define_expand "reload_insi" - [(parallel [(set (match_operand:SF 0 "register_operand" "=y") - (match_operand:SF 1 "immediate_operand" "FQ")) + [(parallel [(set (match_operand:SI 0 "fpul_operand" "=y") + (match_operand:SI 1 "immediate_operand" "i")) (clobber (match_operand:SI 2 "register_operand" "=&z"))])] "TARGET_SH1" "") +(define_expand "ptabs" + [(set (match_operand 0 "" "=b") (match_operand 1 "" "r"))] + "TARGET_SHMEDIA" + " +{ + if (!TARGET_PT_FIXED) + { + rtx eq = operands[1]; + + /* ??? For canonical RTL we really should remove any CONST from EQ + before wrapping it in the AND, and finally wrap the EQ into a + const if is constant. However, for reload we must expose the + input register or symbolic constant, and we can't have + different insn structures outside of the operands for different + alternatives of the same pattern. */ + eq = gen_rtx_EQ (SImode, gen_rtx_AND (Pmode, eq, GEN_INT (3)), + GEN_INT (3)); + operands[1] + = (gen_rtx_IF_THEN_ELSE + (PDImode, + eq, + gen_rtx_MEM (PDImode, operands[1]), + gen_rtx_fmt_e (TARGET_SHMEDIA32 ? SIGN_EXTEND : TRUNCATE, + PDImode, operands[1]))); + } +}") + +;; expanded by ptabs expander. +(define_insn "*extendsipdi_media" + [(set (match_operand:PDI 0 "target_reg_operand" "=b,b"); + (if_then_else:PDI (eq (and:SI (match_operand:SI 1 "target_operand" + "r,Csy") + (const_int 3)) + (const_int 3)) + (mem:PDI (match_dup 1)) + (sign_extend:PDI (match_dup 1))))] + "TARGET_SHMEDIA && !TARGET_PT_FIXED" + "@ + ptabs %1, %0 + pt %1, %0" + [(set_attr "type" "ptabs_media,pt_media") + (set_attr "length" "4,*")]) + +(define_insn "*truncdipdi_media" + [(set (match_operand:PDI 0 "target_reg_operand" "=b,b"); + (if_then_else:PDI (eq (and:DI (match_operand:DI 1 "target_operand" + "r,Csy") + (const_int 3)) + (const_int 3)) + (mem:PDI (match_dup 1)) + (truncate:PDI (match_dup 1))))] + "TARGET_SHMEDIA && !TARGET_PT_FIXED" + "@ + ptabs %1, %0 + pt %1, %0" + [(set_attr "type" "ptabs_media,pt_media") + (set_attr "length" "4,*")]) + (define_insn "*movsi_y" [(set (match_operand:SI 0 "register_operand" "=y,y") (match_operand:SI 1 "immediate_operand" "Qi,I08")) @@ -5081,8 +6624,8 @@ ;; jump around the unconditional jump because it was out of range. (define_insn "stuff_delay_slot" [(set (pc) - (unspec [(match_operand 0 "const_int_operand" "") (pc)] UNSPEC_BBR)) - (set (reg:SI T_REG) (match_operand 1 "const_int_operand" ""))] + (unspec [(match_operand:SI 0 "const_int_operand" "") (pc)] UNSPEC_BBR)) + (set (reg:SI T_REG) (match_operand:SI 1 "const_int_operand" ""))] "TARGET_SH1" "" [(set_attr "length" "0") @@ -5094,90 +6637,126 @@ [(set (pc) (if_then_else (eq (match_operand:DI 1 "arith_reg_operand" "r,r") (match_operand:DI 2 "arith_operand" "r,I06")) - (label_ref:DI (match_operand 0 "" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" - "") + "operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);") (define_insn "*beq_media_i" [(set (pc) (if_then_else (match_operator 3 "equality_comparison_operator" [(match_operand:DI 1 "arith_reg_operand" "r,r") (match_operand:DI 2 "arith_operand" "r,I06")]) - (match_operand:DI 0 "target_operand" "b,b") + (match_operand 0 "target_operand" "b,b") + (pc)))] + "TARGET_SHMEDIA" + "@ + b%o3%' %1, %2, %0%> + b%o3i%' %1, %2, %0%>" + [(set_attr "type" "cbranch_media")]) + +(define_insn "*beq_media_i32" + [(set (pc) + (if_then_else (match_operator 3 "equality_comparison_operator" + [(match_operand:SI 1 "arith_reg_operand" "r,r") + (match_operand:SI 2 "arith_operand" "r,I06")]) + (match_operand 0 "target_operand" "b,b") (pc)))] "TARGET_SHMEDIA" "@ - b%o3%' %1, %2, %0 - b%o3i%' %1, %2, %0" + b%o3%' %1, %2, %0%> + b%o3i%' %1, %2, %0%>" [(set_attr "type" "cbranch_media")]) (define_expand "bne_media" [(set (pc) (if_then_else (ne (match_operand:DI 1 "arith_reg_operand" "r,r") (match_operand:DI 2 "arith_operand" "r,I06")) - (label_ref:DI (match_operand 0 "" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" - "") + "operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);") (define_expand "bgt_media" [(set (pc) - (if_then_else (gt (match_operand:DI 1 "arith_reg_or_0_operand" "r") - (match_operand:DI 2 "arith_reg_or_0_operand" "r")) - (label_ref:DI (match_operand 0 "" "")) + (if_then_else (gt (match_operand:DI 1 "arith_reg_or_0_operand" "") + (match_operand:DI 2 "arith_reg_or_0_operand" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" - "") + "operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);") (define_expand "bge_media" [(set (pc) - (if_then_else (ge (match_operand:DI 1 "arith_reg_or_0_operand" "r") - (match_operand:DI 2 "arith_reg_or_0_operand" "r")) - (label_ref:DI (match_operand 0 "" "")) + (if_then_else (ge (match_operand:DI 1 "arith_reg_or_0_operand" "") + (match_operand:DI 2 "arith_reg_or_0_operand" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" - "") + "operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);") (define_expand "bgtu_media" [(set (pc) - (if_then_else (gtu (match_operand:DI 1 "arith_reg_or_0_operand" "r") - (match_operand:DI 2 "arith_reg_or_0_operand" "r")) - (label_ref:DI (match_operand 0 "" "")) + (if_then_else (gtu (match_operand:DI 1 "arith_reg_or_0_operand" "") + (match_operand:DI 2 "arith_reg_or_0_operand" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" - "") + "operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);") (define_expand "bgeu_media" [(set (pc) - (if_then_else (geu (match_operand:DI 1 "arith_reg_or_0_operand" "r") - (match_operand:DI 2 "arith_reg_or_0_operand" "r")) - (label_ref:DI (match_operand 0 "" "")) + (if_then_else (geu (match_operand:DI 1 "arith_reg_or_0_operand" "") + (match_operand:DI 2 "arith_reg_or_0_operand" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" - "") + "operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]);") (define_insn "*bgt_media_i" [(set (pc) (if_then_else (match_operator 3 "greater_comparison_operator" [(match_operand:DI 1 "arith_reg_or_0_operand" "rN") (match_operand:DI 2 "arith_reg_or_0_operand" "rN")]) - (match_operand:DI 0 "target_operand" "b") + (match_operand 0 "target_operand" "b") + (pc)))] + "TARGET_SHMEDIA" + "b%o3%' %N1, %N2, %0%>" + [(set_attr "type" "cbranch_media")]) + +(define_insn "*bgt_media_i32" + [(set (pc) + (if_then_else (match_operator 3 "greater_comparison_operator" + [(match_operand:SI 1 "arith_reg_or_0_operand" "rN") + (match_operand:SI 2 "arith_reg_or_0_operand" "rN")]) + (match_operand 0 "target_operand" "b") (pc)))] "TARGET_SHMEDIA" - "b%o3%' %N1, %N2, %0" + "b%o3%' %N1, %N2, %0%>" [(set_attr "type" "cbranch_media")]) -;; These are only needed to make invert_jump() happy. +;; These are only needed to make invert_jump() happy - otherwise, jump +;; optimization will be silently disabled. (define_insn "*blt_media_i" [(set (pc) (if_then_else (match_operator 3 "less_comparison_operator" [(match_operand:DI 1 "arith_reg_or_0_operand" "rN") (match_operand:DI 2 "arith_reg_or_0_operand" "rN")]) - (match_operand:DI 0 "target_operand" "b") + (match_operand 0 "target_operand" "b") + (pc)))] + "TARGET_SHMEDIA" + "b%o3%' %N2, %N1, %0%>" + [(set_attr "type" "cbranch_media")]) + +(define_insn "*blt_media_i32" + [(set (pc) + (if_then_else (match_operator 3 "less_comparison_operator" + [(match_operand:SI 1 "arith_reg_or_0_operand" "rN") + (match_operand:SI 2 "arith_reg_or_0_operand" "rN")]) + (match_operand 0 "target_operand" "b") (pc)))] "TARGET_SHMEDIA" - "b%o3%' %N2, %N1, %0" + "b%o3%' %N2, %N1, %0%>" [(set_attr "type" "cbranch_media")]) (define_expand "beq" @@ -5190,7 +6769,9 @@ { if (TARGET_SHMEDIA) { - if (GET_MODE (sh_compare_op0) != DImode) + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if (mode != DImode && mode != SImode) { rtx tmp = gen_reg_rtx (DImode); @@ -5199,7 +6780,11 @@ DONE; } - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); + if (CONSTANT_P (sh_compare_op1) + && (GET_CODE (sh_compare_op1) != CONST_INT + || ! CONST_OK_FOR_I06 (INTVAL (sh_compare_op1)))) + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_beq_media (operands[0], sh_compare_op0, sh_compare_op1)); DONE; @@ -5218,7 +6803,9 @@ { if (TARGET_SHMEDIA) { - if (GET_MODE (sh_compare_op0) != DImode) + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if (mode != DImode && mode != SImode) { rtx tmp = gen_reg_rtx (DImode); @@ -5227,7 +6814,11 @@ DONE; } - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); + if (CONSTANT_P (sh_compare_op1) + && (GET_CODE (sh_compare_op1) != CONST_INT + || ! CONST_OK_FOR_I06 (INTVAL (sh_compare_op1)))) + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bne_media (operands[0], sh_compare_op0, sh_compare_op1)); DONE; @@ -5246,7 +6837,9 @@ { if (TARGET_SHMEDIA) { - if (GET_MODE (sh_compare_op0) != DImode) + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if (mode != DImode && mode != SImode) { rtx tmp = gen_reg_rtx (DImode); @@ -5256,9 +6849,9 @@ } if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bgt_media (operands[0], sh_compare_op0, sh_compare_op1)); DONE; @@ -5277,7 +6870,9 @@ { if (TARGET_SHMEDIA) { - if (GET_MODE (sh_compare_op0) != DImode) + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if (mode != DImode && mode != SImode) { rtx tmp = gen_reg_rtx (DImode); @@ -5287,9 +6882,9 @@ } if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bgt_media (operands[0], sh_compare_op1, sh_compare_op0)); DONE; @@ -5316,7 +6911,9 @@ { if (TARGET_SHMEDIA) { - if (GET_MODE (sh_compare_op0) != DImode) + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if (mode != DImode && mode != SImode) { rtx tmp = gen_reg_rtx (DImode); @@ -5326,9 +6923,9 @@ } if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bge_media (operands[0], sh_compare_op1, sh_compare_op0)); DONE; @@ -5357,7 +6954,9 @@ { if (TARGET_SHMEDIA) { - if (GET_MODE (sh_compare_op0) != DImode) + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if (mode != DImode && mode != SImode) { rtx tmp = gen_reg_rtx (DImode); @@ -5367,9 +6966,9 @@ } if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bge_media (operands[0], sh_compare_op0, sh_compare_op1)); DONE; @@ -5398,10 +6997,12 @@ { if (TARGET_SHMEDIA) { + enum machine_mode mode = GET_MODE (sh_compare_op0); + if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bgtu_media (operands[0], sh_compare_op0, sh_compare_op1)); DONE; @@ -5420,10 +7021,12 @@ { if (TARGET_SHMEDIA) { + enum machine_mode mode = GET_MODE (sh_compare_op0); + if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bgtu_media (operands[0], sh_compare_op1, sh_compare_op0)); DONE; @@ -5442,10 +7045,12 @@ { if (TARGET_SHMEDIA) { + enum machine_mode mode = GET_MODE (sh_compare_op0); + if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bgeu_media (operands[0], sh_compare_op0, sh_compare_op1)); DONE; @@ -5464,10 +7069,12 @@ { if (TARGET_SHMEDIA) { + enum machine_mode mode = GET_MODE (sh_compare_op0); + if (sh_compare_op0 != const0_rtx) - sh_compare_op0 = force_reg (DImode, sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (DImode, sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); emit_jump_insn (gen_bgeu_media (operands[0], sh_compare_op1, sh_compare_op0)); DONE; @@ -5480,15 +7087,45 @@ [(set (match_dup 1) (unordered:DI (match_dup 2) (match_dup 3))) (set (pc) (if_then_else (ne (match_dup 1) (const_int 0)) - (label_ref:DI (match_operand 0 "" "")) + (match_operand 0 "" "") (pc)))] "TARGET_SHMEDIA" " { + operands[0] = gen_rtx_LABEL_REF (Pmode, operands[0]); operands[1] = gen_reg_rtx (DImode); operands[2] = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0); operands[3] = force_reg (GET_MODE (sh_compare_op1), sh_compare_op1); }") + +;; combiner splitter for test-and-branch on single bit in register. This +;; is endian dependent because the non-paradoxical subreg looks different +;; on big endian. +(define_split + [(set (pc) + (if_then_else + (match_operator 3 "equality_comparison_operator" + [(subreg:SI (zero_extract:DI (subreg:DI (match_operand:SI 1 + "extend_reg_operand" "") + 0) + (const_int 1) + (match_operand 2 + "const_int_operand" "")) 0) + (const_int 0)]) + (match_operand 0 "target_operand" "") + (pc))) + (clobber (match_operand:SI 4 "arith_reg_dest" ""))] + "TARGET_SHMEDIA && TARGET_LITTLE_ENDIAN" + [(set (match_dup 4) (ashift:SI (match_dup 1) (match_dup 5))) + (set (pc) (if_then_else (match_dup 6) (match_dup 0) (pc)))] + + " +{ + operands[5] = GEN_INT (31 - INTVAL (operands[2])); + operands[6] = (GET_CODE (operands[3]) == EQ + ? gen_rtx_GE (VOIDmode, operands[4], const0_rtx) + : gen_rtx_GT (VOIDmode, const0_rtx, operands[4])); +}") ;; ------------------------------------------------------------------------ ;; Jump and linkage insns @@ -5524,9 +7161,9 @@ (define_insn "jump_media" [(set (pc) - (match_operand:DI 0 "target_operand" "b"))] + (match_operand 0 "target_operand" "b"))] "TARGET_SHMEDIA" - "blink %0, r63" + "blink %0, r63%>" [(set_attr "type" "jump_media")]) (define_expand "jump" @@ -5541,7 +7178,7 @@ { if (reload_in_progress || reload_completed) FAIL; - emit_jump_insn (gen_jump_media (gen_rtx_LABEL_REF (DImode, + emit_jump_insn (gen_jump_media (gen_rtx_LABEL_REF (Pmode, operands[0]))); } DONE; @@ -5651,7 +7288,7 @@ (set_attr "needs_delay_slot" "yes")]) (define_insn "call_media" - [(call (mem:DI (match_operand:DI 0 "target_reg_operand" "b")) + [(call (mem:DI (match_operand 0 "target_reg_operand" "b")) (match_operand 1 "" "")) (clobber (reg:DI PR_MEDIA_REG))] "TARGET_SHMEDIA" @@ -5758,7 +7395,7 @@ (define_insn "call_value_media" [(set (match_operand 0 "" "=rf") - (call (mem:DI (match_operand:DI 1 "target_reg_operand" "b")) + (call (mem:DI (match_operand 1 "target_reg_operand" "b")) (match_operand 2 "" ""))) (clobber (reg:DI PR_MEDIA_REG))] "TARGET_SHMEDIA" @@ -5776,48 +7413,7 @@ { if (TARGET_SHMEDIA) { - operands[0] = XEXP (operands[0], 0); - if (flag_pic && GET_CODE (operands[0]) == SYMBOL_REF) - { - if (! SYMBOL_REF_LOCAL_P (operands[0])) - { - rtx reg = gen_reg_rtx (Pmode); - - emit_insn (gen_symGOTPLT2reg (reg, operands[0])); - operands[0] = reg; - } - else - { - operands[0] = gen_sym2PIC (operands[0]); - PUT_MODE (operands[0], Pmode); - } - } - if (GET_MODE (operands[0]) == SImode) - { - if (GET_CODE (operands[0]) == REG) - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); - else if (GET_CODE (operands[0]) == SUBREG) - { - operands[0] = SUBREG_REG (operands[0]); - if (GET_MODE (operands[0]) != DImode) - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); - } - else if (TARGET_SHMEDIA64) - { - operands[0] = shallow_copy_rtx (operands[0]); - PUT_MODE (operands[0], DImode); - } - else - { - rtx reg = gen_reg_rtx (DImode); - - operands[0] = copy_to_mode_reg (SImode, operands[0]); - emit_insn (gen_extendsidi2 (reg, operands[0])); - operands[0] = reg; - } - } - if (! target_reg_operand (operands[0], DImode)) - operands[0] = copy_to_mode_reg (DImode, operands[0]); + operands[0] = shmedia_prepare_call_address (operands[0], 0); emit_call_insn (gen_call_media (operands[0], operands[1])); DONE; } @@ -5849,14 +7445,9 @@ run out of registers when adjusting fpscr for the call. */ emit_insn (gen_force_mode_for_call ()); - operands[0] = function_symbol (\"__GCC_shcompact_call_trampoline\"); - if (flag_pic) - { - rtx reg = gen_reg_rtx (Pmode); - - emit_insn (gen_symGOTPLT2reg (reg, operands[0])); - operands[0] = reg; - } + operands[0] + = function_symbol (NULL, \"__GCC_shcompact_call_trampoline\", + SFUNC_GOT); operands[0] = force_reg (SImode, operands[0]); emit_move_insn (r0, func); @@ -5943,58 +7534,51 @@ "TARGET_SHCOMPACT" " { - if (operands[2] && INTVAL (operands[2])) - { - rtx cookie_rtx = operands[2]; - long cookie = INTVAL (cookie_rtx); - rtx func = XEXP (operands[0], 0); - rtx r0, r1; + rtx cookie_rtx; + long cookie; + rtx func; + rtx r0, r1; - if (flag_pic) - { - if (GET_CODE (func) == SYMBOL_REF && ! SYMBOL_REF_LOCAL_P (func)) - { - rtx reg = gen_reg_rtx (Pmode); + gcc_assert (operands[2] && INTVAL (operands[2])); + cookie_rtx = operands[2]; + cookie = INTVAL (cookie_rtx); + func = XEXP (operands[0], 0); - emit_insn (gen_symGOTPLT2reg (reg, func)); - func = reg; - } - else - func = legitimize_pic_address (func, Pmode, 0); + if (flag_pic) + { + if (GET_CODE (func) == SYMBOL_REF && ! SYMBOL_REF_LOCAL_P (func)) + { + rtx reg = gen_reg_rtx (Pmode); + emit_insn (gen_symGOTPLT2reg (reg, func)); + func = reg; } + else + func = legitimize_pic_address (func, Pmode, 0); + } - r0 = gen_rtx_REG (SImode, R0_REG); - r1 = gen_rtx_REG (SImode, R1_REG); - - /* Since such a call function may use all call-clobbered - registers, we force a mode switch earlier, so that we don't - run out of registers when adjusting fpscr for the call. */ - emit_insn (gen_force_mode_for_call ()); - - operands[0] = function_symbol (\"__GCC_shcompact_call_trampoline\"); - if (flag_pic) - { - rtx reg = gen_reg_rtx (Pmode); + r0 = gen_rtx_REG (SImode, R0_REG); + r1 = gen_rtx_REG (SImode, R1_REG); - emit_insn (gen_symGOTPLT2reg (reg, operands[0])); - operands[0] = reg; - } - operands[0] = force_reg (SImode, operands[0]); + /* Since such a call function may use all call-clobbered + registers, we force a mode switch earlier, so that we don't + run out of registers when adjusting fpscr for the call. */ + emit_insn (gen_force_mode_for_call ()); - emit_move_insn (r0, func); - emit_move_insn (r1, cookie_rtx); + operands[0] = function_symbol (NULL, \"__GCC_shcompact_call_trampoline\", + SFUNC_GOT); + operands[0] = force_reg (SImode, operands[0]); - if (cookie & CALL_COOKIE_RET_TRAMP (1)) - emit_call_insn (gen_call_pop_compact_rettramp - (operands[0], operands[1], operands[2], operands[3])); - else - emit_call_insn (gen_call_pop_compact - (operands[0], operands[1], operands[2], operands[3])); + emit_move_insn (r0, func); + emit_move_insn (r1, cookie_rtx); - DONE; - } + if (cookie & CALL_COOKIE_RET_TRAMP (1)) + emit_call_insn (gen_call_pop_compact_rettramp + (operands[0], operands[1], operands[2], operands[3])); + else + emit_call_insn (gen_call_pop_compact + (operands[0], operands[1], operands[2], operands[3])); - abort (); + DONE; }") (define_expand "call_value" @@ -6009,48 +7593,7 @@ { if (TARGET_SHMEDIA) { - operands[1] = XEXP (operands[1], 0); - if (flag_pic && GET_CODE (operands[1]) == SYMBOL_REF) - { - if (! SYMBOL_REF_LOCAL_P (operands[1])) - { - rtx reg = gen_reg_rtx (Pmode); - - emit_insn (gen_symGOTPLT2reg (reg, operands[1])); - operands[1] = reg; - } - else - { - operands[1] = gen_sym2PIC (operands[1]); - PUT_MODE (operands[1], Pmode); - } - } - if (GET_MODE (operands[1]) == SImode) - { - if (GET_CODE (operands[1]) == REG) - operands[1] = gen_rtx_SUBREG (DImode, operands[1], 0); - else if (GET_CODE (operands[1]) == SUBREG) - { - operands[1] = SUBREG_REG (operands[1]); - if (GET_MODE (operands[1]) != DImode) - operands[1] = gen_rtx_SUBREG (DImode, operands[1], 0); - } - else if (TARGET_SHMEDIA64) - { - operands[1] = shallow_copy_rtx (operands[1]); - PUT_MODE (operands[1], DImode); - } - else - { - rtx reg = gen_reg_rtx (DImode); - - operands[1] = copy_to_mode_reg (SImode, operands[1]); - emit_insn (gen_extendsidi2 (reg, operands[1])); - operands[1] = reg; - } - } - if (! target_reg_operand (operands[1], DImode)) - operands[1] = copy_to_mode_reg (DImode, operands[1]); + operands[1] = shmedia_prepare_call_address (operands[1], 0); emit_call_insn (gen_call_value_media (operands[0], operands[1], operands[2])); DONE; @@ -6083,14 +7626,9 @@ run out of registers when adjusting fpscr for the call. */ emit_insn (gen_force_mode_for_call ()); - operands[1] = function_symbol (\"__GCC_shcompact_call_trampoline\"); - if (flag_pic) - { - rtx reg = gen_reg_rtx (Pmode); - - emit_insn (gen_symGOTPLT2reg (reg, operands[1])); - operands[1] = reg; - } + operands[1] + = function_symbol (NULL, \"__GCC_shcompact_call_trampoline\", + SFUNC_GOT); operands[1] = force_reg (SImode, operands[1]); emit_move_insn (r0, func); @@ -6158,6 +7696,22 @@ (const_string "single") (const_string "double"))) (set_attr "type" "jump_ind")]) +;; This uses an unspec to describe that the symbol_ref is very close. +(define_insn "sibcalli_thunk" + [(call (mem:SI (unspec:SI [(match_operand:SI 0 "symbol_ref_operand" "")] + UNSPEC_THUNK)) + (match_operand 1 "" "")) + (use (reg:PSI FPSCR_REG)) + (return)] + "TARGET_SH1" + "bra %O0" + [(set_attr "needs_delay_slot" "yes") + (set (attr "fp_mode") + (if_then_else (eq_attr "fpu_single" "yes") + (const_string "single") (const_string "double"))) + (set_attr "type" "jump") + (set_attr "length" "2")]) + (define_insn_and_split "sibcall_pcrel" [(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "")) (match_operand 1 "" "")) @@ -6205,7 +7759,7 @@ (set_attr "type" "jump_ind")]) (define_insn "sibcall_media" - [(call (mem:DI (match_operand:DI 0 "target_reg_operand" "k")) + [(call (mem:DI (match_operand 0 "target_reg_operand" "k")) (match_operand 1 "" "")) (use (reg:SI PR_MEDIA_REG)) (return)] @@ -6225,42 +7779,7 @@ { if (TARGET_SHMEDIA) { - operands[0] = XEXP (operands[0], 0); - if (flag_pic && GET_CODE (operands[0]) == SYMBOL_REF) - { - if (! SYMBOL_REF_LOCAL_P (operands[0])) - { - rtx reg = gen_reg_rtx (Pmode); - - /* We must not use GOTPLT for sibcalls, because PIC_REG - must be restored before the PLT code gets to run. */ - emit_insn (gen_symGOT2reg (reg, operands[0])); - operands[0] = reg; - } - else - { - operands[0] = gen_sym2PIC (operands[0]); - PUT_MODE (operands[0], Pmode); - } - } - if (GET_MODE (operands[0]) == SImode) - { - if (GET_CODE (operands[0]) == REG) - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); - else if (GET_CODE (operands[0]) == SUBREG) - { - operands[0] = SUBREG_REG (operands[0]); - if (GET_MODE (operands[0]) != DImode) - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); - } - else - { - operands[0] = shallow_copy_rtx (operands[0]); - PUT_MODE (operands[0], DImode); - } - } - if (! target_reg_operand (operands[0], DImode)) - operands[0] = copy_to_mode_reg (DImode, operands[0]); + operands[0] = shmedia_prepare_call_address (operands[0], 1); emit_call_insn (gen_sibcall_media (operands[0], operands[1])); DONE; } @@ -6302,14 +7821,9 @@ run out of registers when adjusting fpscr for the call. */ emit_insn (gen_force_mode_for_call ()); - operands[0] = function_symbol (\"__GCC_shcompact_call_trampoline\"); - if (flag_pic) - { - rtx reg = gen_reg_rtx (Pmode); - - emit_insn (gen_symGOT2reg (reg, operands[0])); - operands[0] = reg; - } + operands[0] + = function_symbol (NULL, \"__GCC_shcompact_call_trampoline\", + SFUNC_GOT); operands[0] = force_reg (SImode, operands[0]); /* We don't need a return trampoline, since the callee will @@ -6414,60 +7928,54 @@ "TARGET_SHCOMPACT" " { - if (TARGET_SHCOMPACT && operands[3] && INTVAL (operands[3])) - { - rtx cookie_rtx = operands[3]; - long cookie = INTVAL (cookie_rtx); - rtx func = XEXP (operands[1], 0); - rtx r0, r1; + rtx cookie_rtx; + long cookie; + rtx func; + rtx r0, r1; - if (flag_pic) - { - if (GET_CODE (func) == SYMBOL_REF && ! SYMBOL_REF_LOCAL_P (func)) - { - rtx reg = gen_reg_rtx (Pmode); + gcc_assert (TARGET_SHCOMPACT && operands[3] && INTVAL (operands[3])); + cookie_rtx = operands[3]; + cookie = INTVAL (cookie_rtx); + func = XEXP (operands[1], 0); - emit_insn (gen_symGOTPLT2reg (reg, func)); - func = reg; - } - else - func = legitimize_pic_address (func, Pmode, 0); - } + if (flag_pic) + { + if (GET_CODE (func) == SYMBOL_REF && ! SYMBOL_REF_LOCAL_P (func)) + { + rtx reg = gen_reg_rtx (Pmode); - r0 = gen_rtx_REG (SImode, R0_REG); - r1 = gen_rtx_REG (SImode, R1_REG); + emit_insn (gen_symGOTPLT2reg (reg, func)); + func = reg; + } + else + func = legitimize_pic_address (func, Pmode, 0); + } - /* Since such a call function may use all call-clobbered - registers, we force a mode switch earlier, so that we don't - run out of registers when adjusting fpscr for the call. */ - emit_insn (gen_force_mode_for_call ()); + r0 = gen_rtx_REG (SImode, R0_REG); + r1 = gen_rtx_REG (SImode, R1_REG); - operands[1] = function_symbol (\"__GCC_shcompact_call_trampoline\"); - if (flag_pic) - { - rtx reg = gen_reg_rtx (Pmode); + /* Since such a call function may use all call-clobbered + registers, we force a mode switch earlier, so that we don't + run out of registers when adjusting fpscr for the call. */ + emit_insn (gen_force_mode_for_call ()); - emit_insn (gen_symGOTPLT2reg (reg, operands[1])); - operands[1] = reg; - } - operands[1] = force_reg (SImode, operands[1]); + operands[1] = function_symbol (NULL, \"__GCC_shcompact_call_trampoline\", + SFUNC_GOT); + operands[1] = force_reg (SImode, operands[1]); - emit_move_insn (r0, func); - emit_move_insn (r1, cookie_rtx); + emit_move_insn (r0, func); + emit_move_insn (r1, cookie_rtx); - if (cookie & CALL_COOKIE_RET_TRAMP (1)) - emit_call_insn (gen_call_value_pop_compact_rettramp + if (cookie & CALL_COOKIE_RET_TRAMP (1)) + emit_call_insn (gen_call_value_pop_compact_rettramp (operands[0], operands[1], operands[2], operands[3], operands[4])); - else - emit_call_insn (gen_call_value_pop_compact + else + emit_call_insn (gen_call_value_pop_compact (operands[0], operands[1], operands[2], operands[3], operands[4])); - DONE; - } - - abort (); + DONE; }") (define_expand "sibcall_epilogue" @@ -6521,8 +8029,8 @@ "" " { - if (TARGET_SHMEDIA && GET_MODE (operands[0]) == SImode) - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); + if (GET_MODE (operands[0]) != Pmode) + operands[0] = gen_rtx_SUBREG (Pmode, operands[0], 0); }") ;; The use of operand 1 / 2 helps us distinguish case table jumps @@ -6551,7 +8059,7 @@ (set_attr "type" "jump_ind")]) (define_insn "casesi_jump_media" - [(set (pc) (match_operand:DI 0 "target_reg_operand" "b")) + [(set (pc) (match_operand 0 "target_reg_operand" "b")) (use (label_ref (match_operand 1 "" "")))] "TARGET_SHMEDIA" "blink %0, r63" @@ -6593,7 +8101,7 @@ (define_insn "dect" [(set (reg:SI T_REG) - (eq:SI (match_operand:SI 0 "arith_reg_operand" "+r") (const_int 1))) + (eq:SI (match_operand:SI 0 "arith_reg_dest" "+r") (const_int 1))) (set (match_dup 0) (plus:SI (match_dup 0) (const_int -1)))] "TARGET_SH2" "dt %0" @@ -6637,40 +8145,35 @@ operands[0] = gen_rtx_REG (Pmode, PIC_REG); operands[1] = gen_rtx_SYMBOL_REF (VOIDmode, GOT_SYMBOL_NAME); - if (TARGET_SH5) - operands[1] = gen_datalabel_ref (operands[1]); - if (TARGET_SHMEDIA) { - rtx tr = gen_rtx_REG (DImode, TR0_REG); - rtx dipic = operands[0]; + rtx tr = gen_rtx_REG (Pmode, TR0_REG); + rtx pic = operands[0]; rtx lab = PATTERN (gen_call_site ()); rtx insn, equiv; equiv = operands[1]; - operands[1] = gen_rtx_MINUS (DImode, + operands[1] = gen_rtx_MINUS (Pmode, operands[1], gen_rtx_CONST - (DImode, - gen_rtx_MINUS (DImode, - gen_rtx_CONST (DImode, + (Pmode, + gen_rtx_MINUS (Pmode, + gen_rtx_CONST (Pmode, lab), pc_rtx))); operands[1] = gen_sym2PIC (operands[1]); - PUT_MODE (operands[1], DImode); + PUT_MODE (operands[1], Pmode); - if (GET_MODE (dipic) != DImode) - dipic = gen_rtx_SUBREG (DImode, dipic, 0); - - if (TARGET_SHMEDIA64) - emit_insn (gen_movdi_const (dipic, operands[1])); + if (Pmode == SImode) + { + emit_insn (gen_movsi_const (pic, operands[1])); + emit_insn (gen_ptrel_si (tr, pic, lab)); + } else - emit_insn (gen_movdi_const_32bit (dipic, operands[1])); - - emit_insn (gen_ptrel (tr, dipic, lab)); - - if (GET_MODE (operands[0]) != GET_MODE (tr)) - tr = gen_lowpart (GET_MODE (operands[0]), tr); + { + emit_insn (gen_movdi_const (pic, operands[1])); + emit_insn (gen_ptrel_di (tr, pic, lab)); + } insn = emit_move_insn (operands[0], tr); @@ -6683,16 +8186,25 @@ ") (define_insn "*ptb" - [(set (match_operand:DI 0 "target_reg_operand" "=b") - (const:DI (unspec:DI [(match_operand:DI 1 "" "Csy")] + [(set (match_operand 0 "target_reg_operand" "=b") + (const (unspec [(match_operand 1 "" "Csy")] UNSPEC_DATALABEL)))] "TARGET_SHMEDIA && flag_pic && EXTRA_CONSTRAINT_Csy (operands[1])" "ptb/u datalabel %1, %0" - [(set_attr "type" "pt_media") + [(set_attr "type" "ptabs_media") (set_attr "length" "*")]) -(define_insn "ptrel" +(define_insn "ptrel_si" + [(set (match_operand:SI 0 "target_reg_operand" "=b") + (plus:SI (match_operand:SI 1 "register_operand" "r") + (pc))) + (match_operand:SI 2 "" "")] + "TARGET_SHMEDIA" + "%O2: ptrel/u %1, %0" + [(set_attr "type" "ptabs_media")]) + +(define_insn "ptrel_di" [(set (match_operand:DI 0 "target_reg_operand" "=b") (plus:DI (match_operand:DI 1 "register_operand" "r") (pc))) @@ -6747,13 +8259,20 @@ { rtx reg = operands[2]; - if (GET_MODE (reg) != DImode) - reg = gen_rtx_SUBREG (DImode, reg, 0); - - if (flag_pic > 1) - emit_insn (gen_movdi_const_32bit (reg, operands[1])); + if (Pmode == DImode) + { + if (flag_pic > 1) + emit_insn (gen_movdi_const_32bit (reg, operands[1])); + else + emit_insn (gen_movdi_const_16bit (reg, operands[1])); + } else - emit_insn (gen_movdi_const_16bit (reg, operands[1])); + { + if (flag_pic > 1) + emit_insn (gen_movsi_const (reg, operands[1])); + else + emit_insn (gen_movsi_const_16bit (reg, operands[1])); + } } else emit_move_insn (operands[2], operands[1]); @@ -6871,7 +8390,7 @@ (define_insn "tls_global_dynamic" [(set (match_operand:SI 0 "register_operand" "=&z") - (call (mem:SI (unspec:SI [(match_operand:SI 1 "" "")] + (call:SI (mem:SI (unspec:SI [(match_operand:SI 1 "" "")] UNSPEC_TLSGD)) (const_int 0))) (use (reg:PSI FPSCR_REG)) @@ -6900,7 +8419,7 @@ mov.l\\t1f,r4\\n\\ (define_insn "tls_local_dynamic" [(set (match_operand:SI 0 "register_operand" "=&z") - (call (mem:SI (unspec:SI [(match_operand:SI 1 "" "")] + (call:SI (mem:SI (unspec:SI [(match_operand:SI 1 "" "")] UNSPEC_TLSLDM)) (const_int 0))) (use (reg:PSI FPSCR_REG)) @@ -7023,9 +8542,10 @@ mov.l\\t1f,r0\\n\\ { rtx reg = gen_reg_rtx (DImode); rtx reg2 = gen_reg_rtx (DImode); - rtx reg3 = gen_reg_rtx (DImode); - rtx reg4 = gen_reg_rtx (DImode); - rtx reg5 = gen_reg_rtx (DImode); + rtx reg3 = gen_reg_rtx (Pmode); + rtx reg4 = gen_reg_rtx (Pmode); + rtx reg5 = gen_reg_rtx (Pmode); + rtx load; operands[0] = convert_modes (DImode, SImode, operands[0], 0); operands[1] = convert_modes (DImode, SImode, operands[1], 0); @@ -7036,9 +8556,18 @@ mov.l\\t1f,r0\\n\\ emit_jump_insn (gen_bgtu_media (operands[4], reg, operands[2])); emit_insn (gen_casesi_shift_media (reg2, reg, operands[3])); emit_move_insn (reg3, gen_datalabel_ref (gen_rtx_LABEL_REF - (DImode, operands[3]))); - emit_insn (gen_casesi_load_media (reg4, reg3, reg2, operands[3])); - emit_move_insn (reg5, gen_rtx_PLUS (DImode, reg3, reg4)); + (Pmode, operands[3]))); + /* Messy: can we subreg to clean this up? */ + if (Pmode == DImode) + load = gen_casesi_load_media (reg4, reg3, reg2, operands[3]); + else + load = gen_casesi_load_media (reg4, + gen_rtx_SUBREG (DImode, reg3, 0), + reg2, operands[3]); + PUT_MODE (SET_SRC (load), Pmode); + emit_insn (load); + /* ??? The following add could be eliminated if we used ptrel. */ + emit_move_insn (reg5, gen_rtx_PLUS (Pmode, reg3, reg4)); emit_jump_insn (gen_casesi_jump_media (reg5, operands[3])); emit_barrier (); DONE; @@ -7129,8 +8658,7 @@ mov.l\\t1f,r0\\n\\ { rtx diff_vec = PATTERN (next_real_insn (operands[2])); - if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) - abort (); + gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC); switch (GET_MODE (diff_vec)) { @@ -7143,7 +8671,7 @@ mov.l\\t1f,r0\\n\\ return \"mov.b @(r0,%1),%0\;extu.b %0,%0\"; return \"mov.b @(r0,%1),%0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "length" "4")]) @@ -7161,8 +8689,7 @@ mov.l\\t1f,r0\\n\\ rtx diff_vec = PATTERN (next_real_insn (operands[2])); const char *load; - if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) - abort (); + gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC); switch (GET_MODE (diff_vec)) { @@ -7179,7 +8706,7 @@ mov.l\\t1f,r0\\n\\ load = \"mov.b @(r0,%1),%0\"; break; default: - abort (); + gcc_unreachable (); } output_asm_insn (\"add\tr0,%1\;mova\t%O3,r0\\n\", operands); return load; @@ -7187,7 +8714,7 @@ mov.l\\t1f,r0\\n\\ [(set_attr "length" "8")]) (define_insn "casesi_shift_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") + [(set (match_operand:DI 0 "arith_reg_dest" "=r") (ashift:DI (match_operand:DI 1 "arith_reg_operand" "r") (unspec:DI [(label_ref:DI (match_operand 2 "" ""))] UNSPEC_CASESI)))] @@ -7196,8 +8723,7 @@ mov.l\\t1f,r0\\n\\ { rtx diff_vec = PATTERN (next_real_insn (operands[2])); - if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) - abort (); + gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC); switch (GET_MODE (diff_vec)) { @@ -7210,23 +8736,22 @@ mov.l\\t1f,r0\\n\\ return \"\"; return \"add %1, r63, %0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "type" "arith_media")]) (define_insn "casesi_load_media" - [(set (match_operand:DI 0 "arith_reg_operand" "=r") - (mem:DI (unspec [(match_operand 1 "arith_reg_operand" "r") - (match_operand 2 "arith_reg_operand" "r") - (label_ref:DI (match_operand 3 "" ""))] 2)))] + [(set (match_operand 0 "any_arith_reg_dest" "=r") + (mem (unspec [(match_operand:DI 1 "arith_reg_operand" "r") + (match_operand:DI 2 "arith_reg_operand" "r") + (label_ref:DI (match_operand 3 "" ""))] UNSPEC_CASESI)))] "TARGET_SHMEDIA" "* { rtx diff_vec = PATTERN (next_real_insn (operands[3])); - if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) - abort (); + gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC); switch (GET_MODE (diff_vec)) { @@ -7243,7 +8768,7 @@ mov.l\\t1f,r0\\n\\ return \"ldx.ub %1, %2, %0\"; return \"ldx.b %1, %2, %0\"; default: - abort (); + gcc_unreachable (); } }" [(set_attr "type" "load_media")]) @@ -7284,13 +8809,8 @@ mov.l\\t1f,r0\\n\\ " { rtx reg = gen_rtx_REG (Pmode, R0_REG); - rtx sym = function_symbol (\"__GCC_shcompact_return_trampoline\"); - - if (flag_pic) - emit_insn (gen_symGOTPLT2reg (reg, sym)); - else - emit_move_insn (reg, sym); + function_symbol (reg, \"__GCC_shcompact_return_trampoline\", SFUNC_STATIC); emit_jump_insn (gen_shcompact_return_tramp_i ()); DONE; }") @@ -7304,7 +8824,7 @@ mov.l\\t1f,r0\\n\\ (set_attr "needs_delay_slot" "yes")]) (define_insn "return_media_i" - [(parallel [(return) (use (match_operand:DI 0 "target_reg_operand" "k"))])] + [(parallel [(return) (use (match_operand 0 "target_reg_operand" "k"))])] "TARGET_SHMEDIA && reload_completed" "blink %0, r63" [(set_attr "type" "jump_media")]) @@ -7330,16 +8850,15 @@ mov.l\\t1f,r0\\n\\ } if (tr_regno < 0) { - rtx r18 = gen_rtx_REG (DImode, PR_MEDIA_REG); + rtx r18 = gen_rtx_REG (Pmode, PR_MEDIA_REG); - if (! call_really_used_regs[TR0_REG] || fixed_regs[TR0_REG]) - abort (); + gcc_assert (call_really_used_regs[TR0_REG] && !fixed_regs[TR0_REG]); tr_regno = TR0_REG; - tr = gen_rtx_REG (DImode, tr_regno); + tr = gen_rtx_REG (Pmode, tr_regno); emit_move_insn (tr, r18); } else - tr = gen_rtx_REG (DImode, tr_regno); + tr = gen_rtx_REG (Pmode, tr_regno); emit_jump_insn (gen_return_media_i (tr)); DONE; @@ -7450,31 +8969,73 @@ mov.l\\t1f,r0\\n\\ ;; ------------------------------------------------------------------------ (define_insn "movt" - [(set (match_operand:SI 0 "arith_reg_operand" "=r") + [(set (match_operand:SI 0 "arith_reg_dest" "=r") (eq:SI (reg:SI T_REG) (const_int 1)))] "TARGET_SH1" "movt %0" [(set_attr "type" "arith")]) (define_expand "seq" - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (match_dup 1))] "" " { if (TARGET_SHMEDIA) { - if (GET_MODE (operands[0]) != DImode) - operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0); if (sh_compare_op1 != const0_rtx) sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode ? GET_MODE (sh_compare_op0) : GET_MODE (sh_compare_op1), sh_compare_op1); + if (GET_MODE_SIZE (GET_MODE (operands[0])) <= 4) + { + if (GET_MODE (operands[0]) != SImode) + operands[0] = gen_rtx_SUBREG (SImode, operands[0], 0); + + switch (GET_MODE (sh_compare_op0)) + { + case SImode: + emit_insn (gen_cmpsieqsi_media (operands[0], + sh_compare_op0, sh_compare_op1)); + break; + + case DImode: + emit_insn (gen_cmpsieqdi_media (operands[0], + sh_compare_op0, sh_compare_op1)); + break; + + case SFmode: + if (! TARGET_SHMEDIA_FPU) + FAIL; + emit_insn (gen_cmpsieqsf_media (operands[0], + sh_compare_op0, sh_compare_op1)); + break; + + case DFmode: + if (! TARGET_SHMEDIA_FPU) + FAIL; + emit_insn (gen_cmpsieqdf_media (operands[0], + sh_compare_op0, sh_compare_op1)); + break; + + default: + FAIL; + } + DONE; + } + + if (GET_MODE (operands[0]) != DImode) + operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); switch (GET_MODE (sh_compare_op0)) { + case SImode: + emit_insn (gen_cmpeqsi_media (operands[0], + sh_compare_op0, sh_compare_op1)); + break; + case DImode: emit_insn (gen_cmpeqdi_media (operands[0], sh_compare_op0, sh_compare_op1)); @@ -7525,6 +9086,11 @@ mov.l\\t1f,r0\\n\\ switch (GET_MODE (sh_compare_op0)) { + case SImode: + emit_insn (gen_cmpgtsi_media (operands[0], + sh_compare_op1, sh_compare_op0)); + break; + case DImode: emit_insn (gen_cmpgtdi_media (operands[0], sh_compare_op1, sh_compare_op0)); @@ -7574,6 +9140,16 @@ mov.l\\t1f,r0\\n\\ switch (GET_MODE (sh_compare_op0)) { + case SImode: + { + tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); + + emit_insn (gen_cmpgtsi_media (tmp, + sh_compare_op0, sh_compare_op1)); + emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx)); + break; + } + case DImode: { tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); @@ -7629,6 +9205,11 @@ mov.l\\t1f,r0\\n\\ switch (GET_MODE (sh_compare_op0)) { + case SImode: + emit_insn (gen_cmpgtsi_media (operands[0], + sh_compare_op0, sh_compare_op1)); + break; + case DImode: emit_insn (gen_cmpgtdi_media (operands[0], sh_compare_op0, sh_compare_op1)); @@ -7666,17 +9247,28 @@ mov.l\\t1f,r0\\n\\ { if (TARGET_SHMEDIA) { + enum machine_mode mode = GET_MODE (sh_compare_op0); + + if ((mode) == VOIDmode) + mode = GET_MODE (sh_compare_op1); if (GET_MODE (operands[0]) != DImode) operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); - sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0); + sh_compare_op0 = force_reg (mode, sh_compare_op0); if (sh_compare_op1 != const0_rtx) - sh_compare_op1 = force_reg (GET_MODE (sh_compare_op1) == VOIDmode - ? GET_MODE (sh_compare_op0) - : GET_MODE (sh_compare_op1), - sh_compare_op1); + sh_compare_op1 = force_reg (mode, sh_compare_op1); - switch (GET_MODE (sh_compare_op0)) + switch (mode) { + case SImode: + { + rtx tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); + + emit_insn (gen_cmpgtsi_media (tmp, + sh_compare_op1, sh_compare_op0)); + emit_insn (gen_cmpeqdi_media (operands[0], tmp, const0_rtx)); + break; + } + case DImode: { rtx tmp = no_new_pseudos ? operands[0] : gen_reg_rtx (DImode); @@ -7868,7 +9460,9 @@ mov.l\\t1f,r0\\n\\ if (GET_MODE (operands[0]) != DImode) operands[0] = gen_rtx_SUBREG (DImode, operands[0], 0); - if (! TARGET_SHMEDIA_FPU && GET_MODE (sh_compare_op0) != DImode) + if (! TARGET_SHMEDIA_FPU + && GET_MODE (sh_compare_op0) != DImode + && GET_MODE (sh_compare_op0) != SImode) FAIL; sh_compare_op0 = force_reg (GET_MODE (sh_compare_op0), sh_compare_op0); @@ -7905,6 +9499,10 @@ mov.l\\t1f,r0\\n\\ }") ;; Use the same trick for FP sle / sge + +;; Apart from the constant use and the T setting, this is like movt, +;; except that it uses the logically negated value of T, i.e. +;; operand[0] := T ? 0 : 1. (define_expand "movnegt" [(set (match_dup 2) (const_int -1)) (parallel [(set (match_operand 0 "" "") @@ -7921,7 +9519,7 @@ mov.l\\t1f,r0\\n\\ ;; mov/neg for sne. (define_split - [(set (match_operand:SI 0 "arith_reg_operand" "") + [(set (match_operand:SI 0 "arith_reg_dest" "") (plus:SI (reg:SI T_REG) (const_int -1)))] "TARGET_SH1" @@ -8362,9 +9960,9 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "fparith_media")]) (define_insn "addsf3_i" - [(set (match_operand:SF 0 "arith_reg_operand" "=f") - (plus:SF (match_operand:SF 1 "arith_reg_operand" "%0") - (match_operand:SF 2 "arith_reg_operand" "f"))) + [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") + (plus:SF (match_operand:SF 1 "fp_arith_reg_operand" "%0") + (match_operand:SF 2 "fp_arith_reg_operand" "f"))) (use (match_operand:PSI 3 "fpscr_operand" "c"))] "TARGET_SH2E" "fadd %2,%0" @@ -8449,7 +10047,7 @@ mov.l\\t1f,r0\\n\\ "fmul %2,%0" [(set_attr "type" "fp")]) -(define_insn "*mac_media" +(define_insn "mac_media" [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") (plus:SF (mult:SF (match_operand:SF 1 "fp_arith_reg_operand" "%f") (match_operand:SF 2 "fp_arith_reg_operand" "f")) @@ -8492,7 +10090,7 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "fdiv_media")]) (define_insn "divsf3_i" - [(set (match_operand:SF 0 "arith_reg_operand" "=f") + [(set (match_operand:SF 0 "arith_reg_dest" "=f") (div:SF (match_operand:SF 1 "arith_reg_operand" "0") (match_operand:SF 2 "arith_reg_operand" "f"))) (use (match_operand:PSI 3 "fpscr_operand" "c"))] @@ -8545,7 +10143,7 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "fp")]) (define_insn "fix_truncsfdi2" - [(set (match_operand:DI 0 "fp_arith_reg_operand" "=f") + [(set (match_operand:DI 0 "fp_arith_reg_dest" "=f") (fix:DI (match_operand:SF 1 "fp_arith_reg_operand" "f")))] "TARGET_SHMEDIA_FPU" "ftrc.sq %1, %0" @@ -8676,6 +10274,14 @@ mov.l\\t1f,r0\\n\\ "fcmpeq.s %1, %2, %0" [(set_attr "type" "fcmp_media")]) +(define_insn "cmpsieqsf_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (eq:SI (match_operand:SF 1 "fp_arith_reg_operand" "f") + (match_operand:SF 2 "fp_arith_reg_operand" "f")))] + "TARGET_SHMEDIA_FPU" + "fcmpeq.s %1, %2, %0" + [(set_attr "type" "fcmp_media")]) + (define_insn "cmpgtsf_media" [(set (match_operand:DI 0 "register_operand" "=r") (gt:DI (match_operand:SF 1 "fp_arith_reg_operand" "f") @@ -9076,7 +10682,7 @@ mov.l\\t1f,r0\\n\\ (set_attr "fp_mode" "double")]) (define_insn "fix_truncdfdi2" - [(set (match_operand:DI 0 "fp_arith_reg_operand" "=f") + [(set (match_operand:DI 0 "fp_arith_reg_dest" "=f") (fix:DI (match_operand:DF 1 "fp_arith_reg_operand" "f")))] "TARGET_SHMEDIA_FPU" "ftrc.dq %1, %0" @@ -9174,6 +10780,14 @@ mov.l\\t1f,r0\\n\\ "fcmpeq.d %1,%2,%0" [(set_attr "type" "fcmp_media")]) +(define_insn "cmpsieqdf_media" + [(set (match_operand:SI 0 "register_operand" "=r") + (eq:SI (match_operand:DF 1 "fp_arith_reg_operand" "f") + (match_operand:DF 2 "fp_arith_reg_operand" "f")))] + "TARGET_SHMEDIA_FPU" + "fcmpeq.d %1,%2,%0" + [(set_attr "type" "fcmp_media")]) + (define_insn "cmpgtdf_media" [(set (match_operand:DI 0 "register_operand" "=r") (gt:DI (match_operand:DF 1 "fp_arith_reg_operand" "f") @@ -9231,8 +10845,8 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "fmove_media")]) (define_insn "negdf2_i" - [(set (match_operand:DF 0 "arith_reg_operand" "=f") - (neg:DF (match_operand:DF 1 "arith_reg_operand" "0"))) + [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") + (neg:DF (match_operand:DF 1 "fp_arith_reg_operand" "0"))) (use (match_operand:PSI 2 "fpscr_operand" "c"))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE)" "fneg %0" @@ -9260,8 +10874,8 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "dfdiv_media")]) (define_insn "sqrtdf2_i" - [(set (match_operand:DF 0 "arith_reg_operand" "=f") - (sqrt:DF (match_operand:DF 1 "arith_reg_operand" "0"))) + [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") + (sqrt:DF (match_operand:DF 1 "fp_arith_reg_operand" "0"))) (use (match_operand:PSI 2 "fpscr_operand" "c"))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE)" "fsqrt %0" @@ -9289,8 +10903,8 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "fmove_media")]) (define_insn "absdf2_i" - [(set (match_operand:DF 0 "arith_reg_operand" "=f") - (abs:DF (match_operand:DF 1 "arith_reg_operand" "0"))) + [(set (match_operand:DF 0 "fp_arith_reg_operand" "=f") + (abs:DF (match_operand:DF 1 "fp_arith_reg_operand" "0"))) (use (match_operand:PSI 2 "fpscr_operand" "c"))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE)" "fabs %0" @@ -9731,8 +11345,7 @@ mov.l\\t1f,r0\\n\\ (match_operand 1 "sh_const_vec" ""))] "TARGET_SHMEDIA && reload_completed && GET_MODE (operands[0]) == GET_MODE (operands[1]) - && sh_vector_mode_supported_p (GET_MODE (operands[0])) - && operands[1] != CONST0_RTX (GET_MODE (operands[1]))" + && sh_vector_mode_supported_p (GET_MODE (operands[0]))" [(set (match_dup 0) (match_dup 1))] " { @@ -9758,13 +11371,17 @@ mov.l\\t1f,r0\\n\\ && (register_operand (operands[0], V2HImode) || sh_register_operand (operands[1], V2HImode))" "@ - addz.l %1, r63, %0 + add.l %1, r63, %0 movi %1, %0 # ld%M1.l %m1, %0 st%M0.l %m0, %N1" [(set_attr "type" "arith_media,arith_media,*,load_media,store_media") - (set_attr "length" "4,4,16,4,4")]) + (set_attr "length" "4,4,16,4,4") + (set (attr "highpart") + (cond [(ne (symbol_ref "sh_contains_memref_p (insn)") (const_int 0)) + (const_string "user")] + (const_string "ignore")))]) (define_expand "movv4hi" [(set (match_operand:V4HI 0 "general_movdst_operand" "") @@ -9785,7 +11402,8 @@ mov.l\\t1f,r0\\n\\ ld%M1.q %m1, %0 st%M0.q %m0, %N1" [(set_attr "type" "arith_media,arith_media,*,load_media,store_media") - (set_attr "length" "4,4,16,4,4")]) + (set_attr "length" "4,4,16,4,4") + (set_attr "highpart" "depend")]) (define_expand "movv2si" [(set (match_operand:V2SI 0 "general_movdst_operand" "") @@ -9806,7 +11424,8 @@ mov.l\\t1f,r0\\n\\ ld%M1.q %m1, %0 st%M0.q %m0, %N1" [(set_attr "type" "arith_media,arith_media,*,load_media,store_media") - (set_attr "length" "4,4,16,4,4")]) + (set_attr "length" "4,4,16,4,4") + (set_attr "highpart" "depend")]) ;; Multimedia Intrinsics @@ -9815,14 +11434,16 @@ mov.l\\t1f,r0\\n\\ (abs:V2SI (match_operand:V2SI 1 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "mabs.l %1, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "absv4hi2" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") (abs:V4HI (match_operand:V4HI 1 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "mabs.w %1, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "addv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -9830,7 +11451,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "madd.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "addv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -9838,7 +11460,30 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "madd.w %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) + +(define_insn_and_split "addv2hi3" + [(set (match_operand:V2HI 0 "arith_reg_dest" "=r") + (plus:V2HI (match_operand:V2HI 1 "extend_reg_operand" "%r") + (match_operand:V2HI 2 "extend_reg_operand" "r")))] + "TARGET_SHMEDIA" + "#" + "TARGET_SHMEDIA" + [(const_int 0)] + " +{ + rtx src0 = simplify_gen_subreg (V4HImode, operands[1], V2HImode, 0); + rtx src1 = simplify_gen_subreg (V4HImode, operands[2], V2HImode, 0); + rtx v4hi_dst = simplify_gen_subreg (V4HImode, operands[0], V2HImode, 0); + rtx di_dst = simplify_gen_subreg (DImode, operands[0], V2HImode, 0); + rtx si_dst = simplify_gen_subreg (SImode, operands[0], V2HImode, 0); + + emit_insn (gen_addv4hi3 (v4hi_dst, src0, src1)); + emit_insn (gen_truncdisi2 (si_dst, di_dst)); + DONE; +}" + [(set_attr "highpart" "must_split")]) (define_insn "ssaddv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -9846,7 +11491,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "madds.l %1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "usaddv8qi3" [(set (match_operand:V8QI 0 "arith_reg_dest" "=r") @@ -9854,7 +11500,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V8QI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "madds.ub %1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "ssaddv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -9862,7 +11509,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "madds.w %1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "negcmpeqv8qi" [(set (match_operand:V8QI 0 "arith_reg_dest" "=r") @@ -9870,7 +11518,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))))] "TARGET_SHMEDIA" "mcmpeq.b %N1, %N2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "negcmpeqv2si" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -9878,7 +11527,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))))] "TARGET_SHMEDIA" "mcmpeq.l %N1, %N2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "negcmpeqv4hi" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -9886,7 +11536,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))))] "TARGET_SHMEDIA" "mcmpeq.w %N1, %N2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "negcmpgtuv8qi" [(set (match_operand:V8QI 0 "arith_reg_dest" "=r") @@ -9894,7 +11545,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V8QI 2 "arith_reg_or_0_operand" "rZ"))))] "TARGET_SHMEDIA" "mcmpgt.ub %N1, %N2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "negcmpgtv2si" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -9902,7 +11554,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_or_0_operand" "rZ"))))] "TARGET_SHMEDIA" "mcmpgt.l %N1, %N2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "negcmpgtv4hi" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -9910,7 +11563,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_or_0_operand" "rZ"))))] "TARGET_SHMEDIA" "mcmpgt.w %N1, %N2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "mcmv" [(set (match_operand:DI 0 "arith_reg_dest" "=r") @@ -9920,7 +11574,8 @@ mov.l\\t1f,r0\\n\\ (not:DI (match_dup 2)))))] "TARGET_SHMEDIA" "mcmv %N1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "mcnvs_lw" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10082,6 +11737,8 @@ mov.l\\t1f,r0\\n\\ DONE; }") +;; This could be highpart ignore if it only had inputs 2 or 3, but input 1 +;; is depend (define_insn "mmacfx_wl_i" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") (ss_plus:V2SI @@ -10095,7 +11752,8 @@ mov.l\\t1f,r0\\n\\ (const_int 1)))))] "TARGET_SHMEDIA" "mmacfx.wl %2, %3, %0" - [(set_attr "type" "mac_media")]) + [(set_attr "type" "mac_media") + (set_attr "highpart" "depend")]) (define_expand "mmacnfx_wl" [(match_operand:V2SI 0 "arith_reg_dest" "") @@ -10123,7 +11781,8 @@ mov.l\\t1f,r0\\n\\ (const_int 1)))))] "TARGET_SHMEDIA" "mmacnfx.wl %2, %3, %0" - [(set_attr "type" "mac_media")]) + [(set_attr "type" "mac_media") + (set_attr "highpart" "depend")]) (define_insn "mulv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10131,7 +11790,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "mmul.l %1, %2, %0" - [(set_attr "type" "d2mpy_media")]) + [(set_attr "type" "d2mpy_media") + (set_attr "highpart" "depend")]) (define_insn "mulv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10139,7 +11799,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "mmul.w %1, %2, %0" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set_attr "highpart" "depend")]) (define_insn "mmulfx_l" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10151,7 +11812,8 @@ mov.l\\t1f,r0\\n\\ (const_int 31))))] "TARGET_SHMEDIA" "mmulfx.l %1, %2, %0" - [(set_attr "type" "d2mpy_media")]) + [(set_attr "type" "d2mpy_media") + (set_attr "highpart" "depend")]) (define_insn "mmulfx_w" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10163,7 +11825,8 @@ mov.l\\t1f,r0\\n\\ (const_int 15))))] "TARGET_SHMEDIA" "mmulfx.w %1, %2, %0" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set_attr "highpart" "depend")]) (define_insn "mmulfxrp_w" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10177,7 +11840,9 @@ mov.l\\t1f,r0\\n\\ (const_int 15))))] "TARGET_SHMEDIA" "mmulfxrp.w %1, %2, %0" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set_attr "highpart" "depend")]) + (define_expand "mmulhi_wl" [(match_operand:V2SI 0 "arith_reg_dest" "") @@ -10214,7 +11879,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mmulhi.wl %1, %2, %0\" : \"mmullo.wl %1, %2, %0\");" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "big") (const_string "ignore")] + (const_string "user")))]) (define_insn "mmul01_wl" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10227,7 +11895,11 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mmullo.wl %1, %2, %0\" : \"mmulhi.wl %1, %2, %0\");" - [(set_attr "type" "dmpy_media")]) + [(set_attr "type" "dmpy_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "little") (const_string "ignore")] + (const_string "user")))]) + (define_expand "mmulsum_wq" [(match_operand:DI 0 "arith_reg_dest" "") @@ -10316,7 +11988,8 @@ mov.l\\t1f,r0\\n\\ "trunc_hi_operand" "r"))))] "TARGET_SHMEDIA" "mperm.w %1, r63, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_expand "msad_ubq" [(match_operand:DI 0 "arith_reg_dest" "") @@ -10383,7 +12056,8 @@ mov.l\\t1f,r0\\n\\ (const_int 31)))))] "TARGET_SHMEDIA" "mshalds.l %1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "mshalds_w" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10394,7 +12068,8 @@ mov.l\\t1f,r0\\n\\ (const_int 15)))))] "TARGET_SHMEDIA" "mshalds.w %1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "ashrv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10402,7 +12077,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:DI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "mshard.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "ashrv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10410,7 +12086,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:DI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "mshard.w %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "mshards_q" [(set (match_operand:HI 0 "arith_reg_dest" "=r") @@ -10457,7 +12134,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mshfhi.b %N1, %N2, %0\" : \"mshflo.b %N1, %N2, %0\");" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "big") (const_string "ignore")] + (const_string "user")))]) (define_insn "mshf0_b" [(set @@ -10471,7 +12151,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mshflo.b %N1, %N2, %0\" : \"mshfhi.b %N1, %N2, %0\");" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "little") (const_string "ignore")] + (const_string "user")))]) (define_expand "mshfhi_l" [(match_operand:V2SI 0 "arith_reg_dest" "") @@ -10507,7 +12190,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mshfhi.l %N1, %N2, %0\" : \"mshflo.l %N1, %N2, %0\");" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "big") (const_string "ignore")] + (const_string "user")))]) (define_insn "mshf0_l" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10519,7 +12205,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mshflo.l %N1, %N2, %0\" : \"mshfhi.l %N1, %N2, %0\");" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "little") (const_string "ignore")] + (const_string "user")))]) (define_expand "mshfhi_w" [(match_operand:V4HI 0 "arith_reg_dest" "") @@ -10555,7 +12244,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mshfhi.w %N1, %N2, %0\" : \"mshflo.w %N1, %N2, %0\");" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "big") (const_string "ignore")] + (const_string "user")))]) (define_insn "mshf0_w" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10567,7 +12259,10 @@ mov.l\\t1f,r0\\n\\ "* return (TARGET_LITTLE_ENDIAN ? \"mshflo.w %N1, %N2, %0\" : \"mshfhi.w %N1, %N2, %0\");" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set (attr "highpart") + (cond [(eq_attr "endian" "little") (const_string "ignore")] + (const_string "user")))]) (define_insn "mshflo_w_x" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10577,7 +12272,8 @@ mov.l\\t1f,r0\\n\\ (parallel [(const_int 2) (const_int 0) (const_int 3) (const_int 1)])))] "TARGET_SHMEDIA" "mshflo.w %N1, %N2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) /* These are useful to expand ANDs and as combiner patterns. */ (define_insn_and_split "mshfhi_l_di" @@ -10641,7 +12337,8 @@ mov.l\\t1f,r0\\n\\ "TARGET_SHMEDIA" "mshflo.l %N1, %N2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn "*mshflo_l_di_rev" [(set (match_operand:DI 0 "arith_reg_dest" "=r") @@ -10652,7 +12349,8 @@ mov.l\\t1f,r0\\n\\ "TARGET_SHMEDIA" "mshflo.l %N2, %N1, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) ;; Combiner pattern for trampoline initialization. (define_insn_and_split "*double_shori" @@ -10674,7 +12372,8 @@ mov.l\\t1f,r0\\n\\ emit_insn (gen_shori_media (operands[0], operands[0], gen_int_mode (v, HImode))); DONE; -}") +}" + [(set_attr "highpart" "ignore")]) (define_insn "*mshflo_l_di_x" @@ -10686,7 +12385,8 @@ mov.l\\t1f,r0\\n\\ "TARGET_SHMEDIA" "mshflo.l %N1, %N2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn_and_split "concat_v2sf" [(set (match_operand:V2SF 0 "register_operand" "=r,f,f?") @@ -10708,7 +12408,8 @@ mov.l\\t1f,r0\\n\\ operands[3] = simplify_gen_subreg (SFmode, operands[0], V2SFmode, 0); operands[4] = simplify_gen_subreg (SFmode, operands[0], V2SFmode, 4); }" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn "*mshflo_l_di_x_rev" [(set (match_operand:DI 0 "arith_reg_dest" "=r") @@ -10718,39 +12419,67 @@ mov.l\\t1f,r0\\n\\ "TARGET_SHMEDIA" "mshflo.l %N2, %N1, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "ignore")]) (define_insn "ashlv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") (ashift:V2SI (match_operand:V2SI 1 "arith_reg_operand" "r") - (match_operand:DI 2 "arith_reg_operand" "r")))] + (match_operand:DI 2 "shift_count_reg_operand" "r")))] "TARGET_SHMEDIA" "mshlld.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) + +(define_split + [(set (match_operand 0 "any_register_operand" "") + (match_operator 3 "shift_operator" + [(match_operand 1 "any_register_operand" "") + (match_operand 2 "shift_count_reg_operand" "")]))] + "TARGET_SHMEDIA && ! register_operand (operands[2], VOIDmode)" + [(set (match_dup 0) (match_dup 3))] + " +{ + rtx count = operands[2]; + enum machine_mode outer_mode = GET_MODE (operands[2]), inner_mode; + + while (GET_CODE (count) == ZERO_EXTEND || GET_CODE (count) == SIGN_EXTEND + || (GET_CODE (count) == SUBREG && SUBREG_BYTE (count) == 0) + || GET_CODE (count) == TRUNCATE) + count = XEXP (count, 0); + inner_mode = GET_MODE (count); + count = simplify_gen_subreg (outer_mode, count, inner_mode, + subreg_lowpart_offset (outer_mode, inner_mode)); + operands[3] = gen_rtx_fmt_ee (GET_CODE (operands[3]), GET_MODE (operands[3]), + operands[1], count); +}") (define_insn "ashlv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") (ashift:V4HI (match_operand:V4HI 1 "arith_reg_operand" "r") - (match_operand:DI 2 "arith_reg_operand" "r")))] + (match_operand:DI 2 "shift_count_reg_operand" "r")))] "TARGET_SHMEDIA" "mshlld.w %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "lshrv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") (lshiftrt:V2SI (match_operand:V2SI 1 "arith_reg_operand" "r") - (match_operand:DI 2 "arith_reg_operand" "r")))] + (match_operand:DI 2 "shift_count_reg_operand" "r")))] "TARGET_SHMEDIA" "mshlrd.l %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "lshrv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") (lshiftrt:V4HI (match_operand:V4HI 1 "arith_reg_operand" "r") - (match_operand:DI 2 "arith_reg_operand" "r")))] + (match_operand:DI 2 "shift_count_reg_operand" "r")))] "TARGET_SHMEDIA" "mshlrd.w %1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "subv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10758,7 +12487,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "msub.l %N1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) (define_insn "subv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10766,7 +12496,30 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "msub.w %N1, %2, %0" - [(set_attr "type" "arith_media")]) + [(set_attr "type" "arith_media") + (set_attr "highpart" "depend")]) + +(define_insn_and_split "subv2hi3" + [(set (match_operand:V2HI 0 "arith_reg_dest" "=r") + (minus:V2HI (match_operand:V2HI 1 "arith_reg_or_0_operand" "rZ") + (match_operand:V2HI 2 "arith_reg_operand" "r")))] + "TARGET_SHMEDIA" + "#" + "TARGET_SHMEDIA" + [(const_int 0)] + " +{ + rtx src0 = simplify_gen_subreg (V4HImode, operands[1], V2HImode, 0); + rtx src1 = simplify_gen_subreg (V4HImode, operands[2], V2HImode, 0); + rtx v4hi_dst = simplify_gen_subreg (V4HImode, operands[0], V2HImode, 0); + rtx di_dst = simplify_gen_subreg (DImode, operands[0], V2HImode, 0); + rtx si_dst = simplify_gen_subreg (SImode, operands[0], V2HImode, 0); + + emit_insn (gen_subv4hi3 (v4hi_dst, src0, src1)); + emit_insn (gen_truncdisi2 (si_dst, di_dst)); + DONE; +}" + [(set_attr "highpart" "must_split")]) (define_insn "sssubv2si3" [(set (match_operand:V2SI 0 "arith_reg_dest" "=r") @@ -10774,15 +12527,17 @@ mov.l\\t1f,r0\\n\\ (match_operand:V2SI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "msubs.l %N1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "ussubv8qi3" [(set (match_operand:V8QI 0 "arith_reg_dest" "=r") - (us_minus:V8QI (match_operand:V8QI 1 "arith_reg_operand" "r") + (us_minus:V8QI (match_operand:V8QI 1 "arith_reg_or_0_operand" "rZ") (match_operand:V8QI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" - "msubs.ub %1, %2, %0" - [(set_attr "type" "mcmp_media")]) + "msubs.ub %N1, %2, %0" + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) (define_insn "sssubv4hi3" [(set (match_operand:V4HI 0 "arith_reg_dest" "=r") @@ -10790,7 +12545,8 @@ mov.l\\t1f,r0\\n\\ (match_operand:V4HI 2 "arith_reg_operand" "r")))] "TARGET_SHMEDIA" "msubs.w %N1, %2, %0" - [(set_attr "type" "mcmp_media")]) + [(set_attr "type" "mcmp_media") + (set_attr "highpart" "depend")]) ;; Floating Point Intrinsics @@ -10870,6 +12626,353 @@ mov.l\\t1f,r0\\n\\ "ftrv.s %1, %2, %0" [(set_attr "type" "fparith_media")]) +(define_insn "ldhi_l" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (zero_extract:SI + (mem:SI (plus:SI (ior:SI (match_operand:QI 1 "ua_address_operand" "p") + (const_int 3)) + (const_int -3))) + (plus:SI (and:SI (match_dup 1) (const_int 3)) (const_int 1)) + (const_int 0)))] + "TARGET_SHMEDIA32" + "ldhi.l %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn "ldhi_q" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (plus:SI (ior:SI (match_operand:QI 1 "ua_address_operand" "p") + (const_int 7)) + (const_int -7))) + (plus:SI (and:SI (match_dup 1) (const_int 7)) (const_int 1)) + (const_int 0)))] + "TARGET_SHMEDIA32" + "ldhi.q %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn_and_split "*ldhi_q_comb0" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (plus:SI (ior:SI (plus:SI (match_operand:SI 1 + "register_operand" "r") + (match_operand:SI 2 + "ua_offset" "I06")) + (const_int 7)) + (const_int -7))) + (plus:SI (and:SI (match_dup 1) (const_int 7)) + (const_int 1)) + (const_int 0)))] + "TARGET_SHMEDIA32 && (INTVAL (operands[2]) & 7) == 0" + "#" + "" + [(pc)] + "emit_insn (gen_ldhi_q (operands[0], + gen_rtx_PLUS (SImode, operands[1], operands[2]))); + DONE;") + + +(define_insn_and_split "*ldhi_q_comb1" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (plus:SI (ior:SI (plus:SI (match_operand:SI 1 + "register_operand" "r") + (match_operand:SI 2 + "ua_offset" "I06")) + (const_int 7)) + (const_int -7))) + (plus:SI (and:SI (plus:SI (match_dup 1) (match_operand:SI 3 + "ua_offset" "I06")) + (const_int 7)) + (const_int 1)) + (const_int 0)))] + "TARGET_SHMEDIA32 && (INTVAL (operands[2]) & -8) + && (INTVAL (operands[2]) & 7) == INTVAL (operands[3])" + "#" + "" + [(pc)] + "emit_insn (gen_ldhi_q (operands[0], + gen_rtx_PLUS (SImode, operands[1], operands[2]))); + DONE;") + + +(define_insn "ldlo_l" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (zero_extract:SI + (mem:SI (and:SI (match_operand:QI 1 "ua_address_operand" "p") + (const_int -4))) + (minus:SI (const_int 4) (and:SI (match_dup 1) (const_int 3))) + (and:SI (match_dup 1) (const_int 3))))] + "TARGET_SHMEDIA32" + "ldlo.l %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn "ldlo_q" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (and:SI (match_operand:QI 1 "ua_address_operand" "p") + (const_int -8))) + (minus:SI (const_int 8) (and:SI (match_dup 1) (const_int 7))) + (and:SI (match_dup 1) (const_int 7))))] + "TARGET_SHMEDIA32" + "ldlo.q %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn_and_split "*ldlo_q_comb0" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (and:SI (plus:SI (match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "ua_offset" "I06")) + (const_int -8))) + (minus:SI (const_int 8) (and:SI (match_dup 1) (const_int 7))) + (and:SI (match_dup 1) (const_int 7))))] + "TARGET_SHMEDIA32 && (INTVAL (operands[2]) & 7) == 0" + "#" + "" + [(pc)] + "emit_insn (gen_ldlo_q (operands[0], + gen_rtx_PLUS (SImode, operands[1], operands[2]))); + DONE;") + +(define_insn_and_split "*ldlo_q_comb1" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (and:SI (plus:SI (match_operand:SI 1 "register_operand" "r") + (match_operand:SI 2 "ua_offset" "I06")) + (const_int -8))) + (minus:SI (const_int 8) + (and:SI (plus:SI (match_dup 1) + (match_operand:SI 3 "ua_offset" "I06")) + (const_int 7))) + (and:SI (plus:SI (match_dup 1) (match_dup 3)) (const_int 7))))] + "TARGET_SHMEDIA32 && (INTVAL (operands[2]) & -8) + && (INTVAL (operands[2]) & 7) == INTVAL (operands[3])" + "#" + "" + [(pc)] + "emit_insn (gen_ldlo_q (operands[0], + gen_rtx_PLUS (SImode, operands[1], operands[2]))); + DONE;") + +(define_insn "sthi_l" + [(set (zero_extract:SI + (mem:SI (plus:SI (ior:SI (match_operand:QI 0 "ua_address_operand" "p") + (const_int 3)) + (const_int -3))) + (plus:SI (and:SI (match_dup 0) (const_int 3)) (const_int 1)) + (const_int 0)) + (match_operand:SI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32" + "sthi.l %U0, %1" + [(set_attr "type" "ustore_media")]) + +;; All unaligned stores are considered to be 'narrow' because they typically +;; operate on less that a quadword, and when they operate on a full quadword, +;; the vanilla store high / store low sequence will cause a stall if not +;; scheduled apart. +(define_insn "sthi_q" + [(set (zero_extract:DI + (mem:DI (plus:SI (ior:SI (match_operand:QI 0 "ua_address_operand" "p") + (const_int 7)) + (const_int -7))) + (plus:SI (and:SI (match_dup 0) (const_int 7)) (const_int 1)) + (const_int 0)) + (match_operand:DI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32" + "sthi.q %U0, %1" + [(set_attr "type" "ustore_media")]) + +(define_insn_and_split "*sthi_q_comb0" + [(set (zero_extract:DI + (mem:DI (plus:SI (ior:SI (plus:SI (match_operand:SI 0 + "register_operand" "r") + (match_operand:SI 1 "ua_offset" + "I06")) + (const_int 7)) + (const_int -7))) + (plus:SI (and:SI (match_dup 0) (const_int 7)) (const_int 1)) + (const_int 0)) + (match_operand:DI 2 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32 && (INTVAL (operands[1]) & 7) == 0" + "#" + "" + [(pc)] + "emit_insn (gen_sthi_q (gen_rtx_PLUS (SImode, operands[0], operands[1]), + operands[2])); + DONE;") + +(define_insn_and_split "*sthi_q_comb1" + [(set (zero_extract:DI + (mem:DI (plus:SI (ior:SI (plus:SI (match_operand:SI 0 + "register_operand" "r") + (match_operand:SI 1 "ua_offset" + "I06")) + (const_int 7)) + (const_int -7))) + (plus:SI (and:SI (plus:SI (match_dup 0) + (match_operand:SI 2 "ua_offset" "I06")) + (const_int 7)) + (const_int 1)) + (const_int 0)) + (match_operand:DI 3 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32 && (INTVAL (operands[1]) & -8) + && (INTVAL (operands[1]) & 7) == INTVAL (operands[2])" + "#" + "" + [(pc)] + "emit_insn (gen_sthi_q (gen_rtx_PLUS (SImode, operands[0], operands[1]), + operands[3])); + DONE;") + +;; This is highpart user because the address is used as full 64 bit. +(define_insn "stlo_l" + [(set (zero_extract:SI + (mem:SI (and:SI (match_operand:QI 0 "ua_address_operand" "p") + (const_int -4))) + (minus:SI (const_int 4) (and:SI (match_dup 0) (const_int 3))) + (and:SI (match_dup 0) (const_int 3))) + (match_operand:SI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32" + "stlo.l %U0, %1" + [(set_attr "type" "ustore_media")]) + +(define_insn "stlo_q" + [(set (zero_extract:DI + (mem:DI (and:SI (match_operand:QI 0 "ua_address_operand" "p") + (const_int -8))) + (minus:SI (const_int 8) (and:SI (match_dup 0) (const_int 7))) + (and:SI (match_dup 0) (const_int 7))) + (match_operand:DI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32" + "stlo.q %U0, %1" + [(set_attr "type" "ustore_media")]) + +(define_insn_and_split "*stlo_q_comb0" + [(set (zero_extract:DI + (mem:DI (and:SI (plus:SI (match_operand:SI 0 "register_operand" "r") + (match_operand:SI 1 "ua_offset" "I06")) + (const_int -8))) + (minus:SI (const_int 8) (and:SI (match_dup 0) (const_int 7))) + (and:SI (match_dup 0) (const_int 7))) + (match_operand:DI 2 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32 && (INTVAL (operands[1]) & 7) == 0" + "#" + "" + [(pc)] + "emit_insn (gen_stlo_q (gen_rtx_PLUS (SImode, operands[0], operands[1]), + operands[2])); + DONE;") + +(define_insn_and_split "*stlo_q_comb1" + [(set (zero_extract:DI + (mem:DI (and:SI (plus:SI (match_operand:SI 0 "register_operand" "r") + (match_operand:SI 1 "ua_offset" "I06")) + (const_int -8))) + (minus:SI (const_int 8) (and:SI (plus:SI (match_dup 0) + (match_operand:SI 2 + "ua_offset" "I06")) + (const_int 7))) + (and:SI (plus:SI (match_dup 0) (match_dup 2)) (const_int 7))) + (match_operand:DI 3 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA32 && (INTVAL (operands[1]) & 7) == INTVAL (operands[2])" + "#" + "" + [(pc)] + "emit_insn (gen_stlo_q (gen_rtx_PLUS (SImode, operands[0], operands[1]), + operands[3])); + DONE;") + +(define_insn "ldhi_l64" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (zero_extract:SI + (mem:SI (plus:DI (ior:DI (match_operand:QI 1 "ua_address_operand" "p") + (const_int 3)) + (const_int -3))) + (plus:DI (and:DI (match_dup 1) (const_int 3)) (const_int 1)) + (const_int 0)))] + "TARGET_SHMEDIA64" + "ldhi.l %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn "ldhi_q64" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (plus:DI (ior:DI (match_operand:QI 1 "ua_address_operand" "p") + (const_int 7)) + (const_int -7))) + (plus:DI (and:DI (match_dup 1) (const_int 7)) (const_int 1)) + (const_int 0)))] + "TARGET_SHMEDIA64" + "ldhi.q %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn "ldlo_l64" + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (zero_extract:SI + (mem:SI (and:DI (match_operand:QI 1 "ua_address_operand" "p") + (const_int -4))) + (minus:DI (const_int 4) (and:DI (match_dup 1) (const_int 3))) + (and:DI (match_dup 1) (const_int 3))))] + "TARGET_SHMEDIA64" + "ldlo.l %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn "ldlo_q64" + [(set (match_operand:DI 0 "arith_reg_dest" "=r") + (zero_extract:DI + (mem:DI (and:DI (match_operand:QI 1 "ua_address_operand" "p") + (const_int -8))) + (minus:DI (const_int 8) (and:DI (match_dup 1) (const_int 7))) + (and:DI (match_dup 1) (const_int 7))))] + "TARGET_SHMEDIA64" + "ldlo.q %U1, %0" + [(set_attr "type" "load_media")]) + +(define_insn "sthi_l64" + [(set (zero_extract:SI + (mem:SI (plus:DI (ior:DI (match_operand:QI 0 "ua_address_operand" "p") + (const_int 3)) + (const_int -3))) + (plus:DI (and:DI (match_dup 0) (const_int 3)) (const_int 1)) + (const_int 0)) + (match_operand:SI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA64" + "sthi.l %U0, %1" + [(set_attr "type" "ustore_media")]) + +(define_insn "sthi_q64" + [(set (zero_extract:DI + (mem:DI (plus:DI (ior:DI (match_operand:QI 0 "ua_address_operand" "p") + (const_int 7)) + (const_int -7))) + (plus:DI (and:DI (match_dup 0) (const_int 7)) (const_int 1)) + (const_int 0)) + (match_operand:DI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA64" + "sthi.q %U0, %1" + [(set_attr "type" "ustore_media")]) + +(define_insn "stlo_l64" + [(set (zero_extract:SI + (mem:SI (and:DI (match_operand:QI 0 "ua_address_operand" "p") + (const_int -4))) + (minus:DI (const_int 4) (and:DI (match_dup 0) (const_int 3))) + (and:DI (match_dup 0) (const_int 3))) + (match_operand:SI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA64" + "stlo.l %U0, %1" + [(set_attr "type" "ustore_media")]) + +(define_insn "stlo_q64" + [(set (zero_extract:DI + (mem:DI (and:DI (match_operand:QI 0 "ua_address_operand" "p") + (const_int -8))) + (minus:DI (const_int 8) (and:DI (match_dup 0) (const_int 7))) + (and:DI (match_dup 0) (const_int 7))) + (match_operand:DI 1 "arith_reg_operand" "r"))] + "TARGET_SHMEDIA64" + "stlo.q %U0, %1" + [(set_attr "type" "ustore_media")]) + (define_insn "nsb" [(set (match_operand:QI 0 "arith_reg_dest" "=r") (unspec:QI [(match_operand:DI 1 "arith_reg_operand" "r")] @@ -10953,7 +13056,7 @@ mov.l\\t1f,r0\\n\\ "byterev %1, %0" [(set_attr "type" "arith_media")]) -(define_insn "prefetch_media" +(define_insn "*prefetch_media" [(prefetch (match_operand:QI 0 "address_operand" "p") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] @@ -10966,11 +13069,11 @@ mov.l\\t1f,r0\\n\\ }" [(set_attr "type" "other")]) -(define_insn "prefetch_i4" +(define_insn "*prefetch_i4" [(prefetch (match_operand:SI 0 "register_operand" "r") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] - "TARGET_HARD_SH4" + "TARGET_HARD_SH4 || TARGET_SHCOMPACT" "* { return \"pref @%0\"; @@ -10978,20 +13081,53 @@ mov.l\\t1f,r0\\n\\ [(set_attr "type" "other")]) (define_expand "prefetch" - [(prefetch (match_operand:QI 0 "address_operand" "p") + [(prefetch (match_operand 0 "address_operand" "p") (match_operand:SI 1 "const_int_operand" "n") (match_operand:SI 2 "const_int_operand" "n"))] - "TARGET_SHMEDIA || TARGET_HARD_SH4" + "TARGET_HARD_SH4 || TARGET_SH5" " { - if (TARGET_HARD_SH4 && ! register_operand (operands[0], SImode)) + if (GET_MODE (operands[0]) != Pmode + || GET_CODE (operands[1]) != CONST_INT + || GET_CODE (operands[2]) != CONST_INT) + FAIL; + if (! TARGET_SHMEDIA) + operands[0] = force_reg (Pmode, operands[0]); +}") + +(define_insn "alloco_i" + [(set (mem:BLK (match_operand:QI 0 "cache_address_operand" "p")) + (unspec:BLK [(const_int 0)] UNSPEC_ALLOCO))] + "TARGET_SHMEDIA32" + "* +{ + rtx xops[2]; + + if (GET_CODE (operands[0]) == PLUS) + { + xops[0] = XEXP (operands[0], 0); + xops[1] = XEXP (operands[0], 1); + } + else { - rtx reg = gen_reg_rtx (SImode); - emit_move_insn (reg, operands[0]); - operands[0] = reg; + xops[0] = operands[0]; + xops[1] = const0_rtx; } + output_asm_insn (\"alloco %0, %1\", xops); + return \"\"; +}" + [(set_attr "type" "other")]) - emit_insn ((TARGET_SHMEDIA ? gen_prefetch_media : gen_prefetch_i4) - (operands[0], operands[1], operands[2])); - DONE; +(define_split + [(set (match_operand 0 "any_register_operand" "") + (match_operand 1 "" ""))] + "TARGET_SHMEDIA && reload_completed" + [(set (match_dup 0) (match_dup 1))] + " +{ + int n_changes = 0; + + for_each_rtx (&operands[1], shmedia_cleanup_truncate, &n_changes); + if (!n_changes) + FAIL; }") diff --git a/gcc/config/sh/sh.opt b/gcc/config/sh/sh.opt new file mode 100644 index 00000000000..c3c659f95d2 --- /dev/null +++ b/gcc/config/sh/sh.opt @@ -0,0 +1,214 @@ +; Options for the SH port of the compiler. + +; Copyright (C) 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. + +;; Used for various architecture options. +Mask(SH_E) + +;; Set if the default precision of th FPU is single. +Mask(FPU_SINGLE) + +;; Set if we should generate code using type 2A insns. +Mask(HARD_SH2A) + +;; Set if we should generate code using type 2A DF insns. +Mask(HARD_SH2A_DOUBLE) + +;; Set if compiling for SH4 hardware (to be used for insn costs etc.) +Mask(HARD_SH4) + +;; Set if we should generate code for a SH5 CPU (either ISA). +Mask(SH5) + +;; Set if we should save all target registers. +Mask(SAVE_ALL_TARGET_REGS) + +m1 +Target RejectNegative Mask(SH1) Condition(SUPPORT_SH1) +Generate SH1 code + +m2 +Target RejectNegative Mask(SH2) Condition(SUPPORT_SH2) +Generate SH2 code + +m2a +Target RejectNegative Condition(SUPPORT_SH2A) +Generate SH2a code + +m2a-nofpu +Target RejectNegative Condition(SUPPORT_SH2A_NOFPU) +Generate SH2a FPU-less code + +m2a-single +Target RejectNegative Condition (SUPPORT_SH2A_SINGLE) +Generate default single-precision SH2a code + +m2a-single-only +Target RejectNegative Condition (SUPPORT_SH2A_SINGLE_ONLY) +Generate only single-precision SH2a code + +m2e +Target RejectNegative Condition(SUPPORT_SH2E) +Generate SH2e code + +m3 +Target RejectNegative Mask(SH3) Condition(SUPPORT_SH3) +Generate SH3 code + +m3e +Target RejectNegative Condition(SUPPORT_SH3E) +Generate SH3e code + +m4 +Target RejectNegative Mask(SH4) Condition(SUPPORT_SH4) +Generate SH4 code + +m4-nofpu +Target RejectNegative Condition(SUPPORT_SH4_NOFPU) +Generate SH4 FPU-less code + +m4-single +Target RejectNegative Condition(SUPPORT_SH4_SINGLE) +Generate default single-precision SH4 code + +m4-single-only +Target RejectNegative Condition(SUPPORT_SH4_SINGLE_ONLY) +Generate only single-precision SH4 code + +m4a +Target RejectNegative Mask(SH4A) Condition(SUPPORT_SH4A) +Generate SH4a code + +m4a-nofpu +Target RejectNegative Condition(SUPPORT_SH4A_NOFPU) +Generate SH4a FPU-less code + +m4a-single +Target RejectNegative Condition(SUPPORT_SH4A_SINGLE) +Generate default single-precision SH4a code + +m4a-single-only +Target RejectNegative Condition(SUPPORT_SH4A_SINGLE_ONLY) +Generate only single-precision SH4a code + +m4al +Target RejectNegative Condition(SUPPORT_SH4AL) +Generate SH4al-dsp code + +m5-32media +Target RejectNegative Condition(SUPPORT_SH5_32MEDIA) +Generate 32-bit SHmedia code + +m5-32media-nofpu +Target RejectNegative Condition(SUPPORT_SH5_32MEDIA_NOFPU) +Generate 32-bit FPU-less SHmedia code + +m5-64media +Target RejectNegative Condition(SUPPORT_SH5_64MEDIA) +Generate 64-bit SHmedia code + +m5-64media-nofpu +Target RejectNegative Condition(SUPPORT_SH5_64MEDIA_NOFPU) +Generate 64-bit FPU-less SHmedia code + +m5-compact +Target RejectNegative Condition(SUPPORT_SH5_32MEDIA) +Generate SHcompact code + +m5-compact-nofpu +Target RejectNegative Condition(SUPPORT_SH5_32MEDIA_NOFPU) +Generate FPU-less SHcompact code + +madjust-unroll +Target Report Mask(ADJUST_UNROLL) Condition(SUPPORT_ANY_SH5) +Throttle unrolling to avoid thrashing target registers unless the unroll benefit outweighs this + +mb +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Generate code in big endian mode + +mbigtable +Target Report RejectNegative Mask(BIGTABLE) +Generate 32-bit offsets in switch tables + +mdalign +Target Report RejectNegative Mask(ALIGN_DOUBLE) +Align doubles at 64-bit boundaries + +mfmovd +Target RejectNegative Mask(FMOVD) Undocumented + +mhitachi +Target Report RejectNegative Mask(HITACHI) +Follow Renesas (formerly Hitachi) / SuperH calling conventions + +mieee +Target Report Mask(IEEE) +Increase the IEEE compliance for floating-point code + +mindexed-addressing +Target Report Mask(ALLOW_INDEXED_ADDRESS) Condition(SUPPORT_ANY_SH5_32MEDIA) +Enable the use of the indexed addressing mode for SHmedia32/SHcompact + +minvalid-symbols +Target Report Mask(INVALID_SYMBOLS) Condition(SUPPORT_ANY_SH5) +Assume symbols might be invalid + +misize +Target Report RejectNegative Mask(DUMPISIZE) +Annotate assembler instructions with estimated addresses + +ml +Target Report RejectNegative Mask(LITTLE_ENDIAN) +Generate code in little endian mode + +mnomacsave +Target Report RejectNegative Mask(NOMACSAVE) +Mark MAC register as call-clobbered + +;; ??? This option is not useful, but is retained in case there are people +;; who are still relying on it. It may be deleted in the future. +mpadstruct +Target Report RejectNegative Mask(PADSTRUCT) +Make structs a multiple of 4 bytes (warning: ABI altered) + +mprefergot +Target Report RejectNegative Mask(PREFERGOT) +Emit function-calls using global offset table when generating PIC + +mpt-fixed +Target Report Mask(PT_FIXED) Condition(SUPPORT_ANY_SH5) +Assume pt* instructions won't trap + +mrelax +Target Report RejectNegative Mask(RELAX) +Shorten address references during linking + +mrenesas +Target Mask(HITACHI) MaskExists +Follow Renesas (formerly Hitachi) / SuperH calling conventions + +mspace +Target Report RejectNegative Mask(SMALLCODE) +Deprecated. Use -Os instead + +musermode +Target Report RejectNegative Mask(USERMODE) +Generate library function call to invalidate instruction cache entries after fixing trampoline diff --git a/gcc/config/sh/shmedia.md b/gcc/config/sh/shmedia.md index 4efed77b7ed..36460477e20 100644 --- a/gcc/config/sh/shmedia.md +++ b/gcc/config/sh/shmedia.md @@ -1,5 +1,5 @@ ;; DFA scheduling description for SH-5 SHmedia instructions. -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. ;; This file is part of GCC. @@ -25,9 +25,11 @@ ;; the integer and multimedia unit (imu), the load/store unit (lsu), and ;; the floating point unit (fpu). -(define_automaton "shmedia") +(define_automaton "sh5inst_pipe, sh5fpu_pipe") -(define_cpu_unit "sh5issue,sh5fds" "shmedia") +(define_cpu_unit "sh5issue" "sh5inst_pipe") + +(define_cpu_unit "sh5fds" "sh5fpu_pipe") ;; Every instruction on SH-5 occupies the issue resource for at least one ;; cycle. @@ -86,8 +88,8 @@ ;; can continue to issue. (define_insn_reservation "shmedia_fdiv" 19 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "fdiv_media")) - "sh5fds*19") + "sh5issue+sh5fds,sh5fds*18") (define_insn_reservation "shmedia_dfdiv" 35 (and (eq_attr "pipe_model" "sh5media") (eq_attr "type" "dfdiv_media")) - "sh5fds*35") + "sh5issue+sh5fds,sh5fds*34") diff --git a/gcc/config/sh/sshmedia.h b/gcc/config/sh/sshmedia.h index 6795a990fd2..c94e598149b 100644 --- a/gcc/config/sh/sshmedia.h +++ b/gcc/config/sh/sshmedia.h @@ -31,6 +31,9 @@ Boston, MA 02111-1307, USA. */ #define _SSHMEDIA_H #if __SHMEDIA__ +__inline__ static unsigned long long sh_media_GETCON (unsigned int k) + __attribute__((always_inline)); + __inline__ static unsigned long long sh_media_GETCON (unsigned int k) @@ -40,6 +43,9 @@ sh_media_GETCON (unsigned int k) return res; } +__inline__ static void sh_media_PUTCON (unsigned long long mm, unsigned int k) + __attribute__((always_inline)); + __inline__ static void sh_media_PUTCON (unsigned long long mm, unsigned int k) diff --git a/gcc/config/sh/superh.h b/gcc/config/sh/superh.h new file mode 100644 index 00000000000..deb71bf7206 --- /dev/null +++ b/gcc/config/sh/superh.h @@ -0,0 +1,151 @@ +/* Definitions of target machine for gcc for Super-H using sh-superh-elf. + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +/* This header file is used when the vendor name is set to 'superh'. + It configures the compiler for SH4 only and switches the default + endianess to little (although big endian is still available). + It also configures the spec file to the default board configuration + but in such a way that it can be overridden by a boardspecs file + (using the -specs= option). This file is expected to disable the + defaults and provide options --defsym _start and --defsym _stack + which are required by the SuperH configuration of GNU ld. + + This file is intended to overide sh.h */ + + +#ifndef _SUPERH_H +#define _SUPERH_H +#endif + + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (SuperH SH special %s)", __DATE__); + + +/* We override TARGET_PROCESSOR_SWITCHES in order to remove all the unrequired cpu options + and add options for all the SuperH CPU variants: + -m4-100 is an alias for -m4. + -m4-200 is an alias for -m4. + -m4-400 is an alias for -m4-nofpu and passes -isa=sh4-nommu-nofpu to the assembler. + -m4-500 is an alias for -m4-nofpu and passes -isa=sh4-nofpu to the assembler. */ +#undef TARGET_PROCESSOR_SWITCHES +#define TARGET_PROCESSOR_SWITCHES \ + {"4-500", TARGET_NONE, "SH4 500 series (FPU-less)" }, \ + {"4-500", SELECT_SH4_NOFPU, "" }, \ + {"4-400", TARGET_NONE, "SH4 400 series (MMU/FPU-less)" }, \ + {"4-400", SELECT_SH4_NOFPU, "" }, \ + {"4-200-single-only", TARGET_NONE, "SH4 200 series with double = float (SH3e ABI)" }, \ + {"4-200-single-only", SELECT_SH4_SINGLE_ONLY, "" }, \ + {"4-200-single", TARGET_NONE, "SH4 200 series with single precision pervading" }, \ + {"4-200-single", SELECT_SH4_SINGLE, "" }, \ + {"4-200-nofpu", TARGET_NONE, "SH4 200 series using soft floating point" }, \ + {"4-200-nofpu", SELECT_SH4_NOFPU, "" }, \ + {"4-200", TARGET_NONE, "SH4 200 series" }, \ + {"4-200", SELECT_SH4_NOFPU, "" }, \ + {"4-100-single-only", TARGET_NONE, "SH4 100 series with double = float (SH3e ABI)" }, \ + {"4-100-single-only", SELECT_SH4_SINGLE_ONLY, "" }, \ + {"4-100-single", TARGET_NONE, "SH4 100 series with single precision pervading" }, \ + {"4-100-single", SELECT_SH4_SINGLE, "" }, \ + {"4-100-nofpu", TARGET_NONE, "SH4 100 series using soft floating point" }, \ + {"4-100-nofpu", SELECT_SH4_NOFPU, "" }, \ + {"4-100", TARGET_NONE, "SH4 100 series" }, \ + {"4-100", SELECT_SH4_NOFPU, "" }, \ + {"4-single-only", TARGET_NONE, "Generic SH4 with double = float (SH3e ABI)" }, \ + {"4-single-only", SELECT_SH4_SINGLE_ONLY, "" }, \ + {"4-single", TARGET_NONE, "Generic SH4 with single precision pervading" }, \ + {"4-single", SELECT_SH4_SINGLE, "" }, \ + {"4-nofpu", TARGET_NONE, "Generic SH4 using soft floating point" }, \ + {"4-nofpu", SELECT_SH4_NOFPU, "" }, \ + {"4", TARGET_NONE, "Generic SH4 (default)" }, \ + {"4", SELECT_SH4, "" } + + +/* Provide the -mboard= option used by the boardspecs file */ +#undef SUBTARGET_OPTIONS +#define SUBTARGET_OPTIONS \ + { "board=", &boardtype, "Board name [and momory region].", 0 }, \ + { "runtime=", &osruntime, "Runtime name.", 0 }, \ + +/* These are required by the mboard= option and runtime= option + and are defined in sh.c but are not used anywhere */ +extern const char * boardtype; +extern const char * osruntime; + + +/* Override the linker spec strings to use the new emulation + The specstrings are concatenated as follows + LINK_EMUL_PREFIX.(''|'32'|'64'|LINK_DEFAULT_CPU_EMUL).SUBTARGET_LINK_EMUL_SUFFIX +*/ +#undef LINK_EMUL_PREFIX +#undef SUBTARGET_LINK_EMUL_SUFFIX + +#define LINK_EMUL_PREFIX "superh" +#define SUBTARGET_LINK_EMUL_SUFFIX "" + +/* Add the SUBTARGET_LINK_SPEC to add the board and runtime support and + change the endianness */ +#undef SUBTARGET_LINK_SPEC +#if TARGET_ENDIAN_DEFAULT == LITTLE_ENDIAN_BIT +#define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml|!mb:-EL}%{mb:-EB}" +#else +#define SUBTARGET_LINK_SPEC "%(board_link) %(ldruntime) %{ml:-EL}%{mb|!ml:-EB}" +#endif + + +/* This is used by the link spec if the boardspecs file is not used (for whatever reason). + If the boardspecs file overrides this then an alternative can be used. */ +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ +{ "board_link", "--defsym _start=0x1000 --defsym _stack=0x30000" }, \ +{ "asruntime", "" }, \ +{ "cppruntime", "-D__GDB_SIM__" }, \ +{ "cc1runtime", "" }, \ +{ "ldruntime", "" }, \ +{ "libruntime", "-lc -lgloss" } + + +/* Set the SUBTARGET_CPP_SPEC to define __EMBEDDED_CROSS__ which has an effect + on newlib and provide the runtime support */ +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC \ +"-D__EMBEDDED_CROSS__ %{m4-100*:-D__SH4_100__} %{m4-200*:-D__SH4_200__} %{m4-400:-D__SH4_400__} %{m4-500:-D__SH4_500__} \ +%(cppruntime)" + +/* Override the SUBTARGET_ASM_SPEC to add the runtime support */ +#undef SUBTARGET_ASM_SPEC +#define SUBTARGET_ASM_SPEC "%{m4-100*|m4-200*:-isa=sh4} %{m4-400:-isa=sh4-nommu-nofpu} %{m4-500:-isa=sh4-nofpu} %(asruntime)" + +/* Override the SUBTARGET_ASM_RELAX_SPEC so it doesn't interfere with the + runtime support by adding -isa=sh4 in the wrong place. */ +#undef SUBTARGET_ASM_RELAX_SPEC +#define SUBTARGET_ASM_RELAX_SPEC "%{!m4-100*:%{!m4-200*:%{!m4-400:%{!m4-500:-isa=sh4}}}}" + +/* Create the CC1_SPEC to add the runtime support */ +#undef CC1_SPEC +#define CC1_SPEC "%(cc1runtime)" + +#undef CC1PLUS_SPEC +#define CC1PLUS_SPEC "%(cc1runtime)" + + +/* Override the LIB_SPEC to add the runtime support */ +#undef LIB_SPEC +#define LIB_SPEC "%{!shared:%{!symbolic:%(libruntime) -lc}} %{pg:-lprofile -lc}" diff --git a/gcc/config/sh/superh64.h b/gcc/config/sh/superh64.h new file mode 100644 index 00000000000..1d07e7ed4e6 --- /dev/null +++ b/gcc/config/sh/superh64.h @@ -0,0 +1,50 @@ +/* + Definitions of target machine for gcc for SuperH using target sh-superh-elf, + + Copyright 2000 Free Software Foundation, Inc. + Contributed by Alexandre Oliva + Modified for SuperH by Richard Shann + +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 header file is used when the vendor name is set to 'superh'. + It configures the compiler for SH5 only and switches the default + endianess to little. + This file is intended to overide sh.h, superh.h and sh64.h (which + should have been included in that order) */ + + +#ifndef _SUPERH_H + #error superh64.h should not be used without superh.h +#endif + +/* We override TARGET_PROCESSOR_SWITCHES in order to remove all the unrequired cpu options */ +#undef TARGET_PROCESSOR_SWITCHES +#define TARGET_PROCESSOR_SWITCHES \ + {"5-64media", TARGET_NONE, "" }, \ + {"5-64media", SELECT_SH5_64, "SH5 64-bit SHmedia code" }, \ + {"5-64media-nofpu", TARGET_NONE, "" }, \ + {"5-64media-nofpu", SELECT_SH5_64_NOFPU, "SH5 64-bit FPU-less SHmedia code" }, \ + {"5-32media", TARGET_NONE, "" }, \ + {"5-32media", SELECT_SH5_32, "SH5 32-bit SHmedia code" }, \ + {"5-32media-nofpu", TARGET_NONE, "" }, \ + {"5-32media-nofpu", SELECT_SH5_32_NOFPU, "SH5 32-bit FPU-less SHmedia code" }, \ + {"5-compact", TARGET_NONE, "" }, \ + {"5-compact", SELECT_SH5_COMPACT, "SH5 SHcompact code" }, \ + {"5-compact-nofpu", TARGET_NONE, "" }, \ + {"5-compact-nofpu", SELECT_SH5_COMPACT_NOFPU, "SH5 FPU-less SHcompact code" } diff --git a/gcc/config/sh/symbian-pre.h b/gcc/config/sh/symbian-pre.h index 53e2d92a1df..1d882bec0c3 100644 --- a/gcc/config/sh/symbian-pre.h +++ b/gcc/config/sh/symbian-pre.h @@ -25,7 +25,7 @@ #define SYMBIAN 1 /* Default to using the Renesas ABI. */ -#define TARGET_ABI_DEFAULT RENESAS_BIT +#define TARGET_ABI_DEFAULT MASK_HITACHI #define SUBTARGET_CPP_SPEC "" diff --git a/gcc/config/sh/symbian.c b/gcc/config/sh/symbian.c index cb04c8c8d76..b3e8287a66b 100644 --- a/gcc/config/sh/symbian.c +++ b/gcc/config/sh/symbian.c @@ -1,5 +1,5 @@ /* Routines for GCC for a Symbian OS targeted SH backend. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by RedHat. Most of this code is stolen from i386/winnt.c. @@ -144,7 +144,7 @@ sh_symbian_dllimport_p (tree decl) { /* Don't warn about artificial methods. */ if (!DECL_ARTIFICIAL (decl)) - warning ("%H function '%D' is defined after prior declaration as dllimport: attribute ignored", + warning (0, "%H function '%D' is defined after prior declaration as dllimport: attribute ignored", & DECL_SOURCE_LOCATION (decl), decl); return false; } @@ -155,7 +155,7 @@ sh_symbian_dllimport_p (tree decl) else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) { if (extra_warnings) - warning ("%Hinline function '%D' is declared as dllimport: attribute ignored.", + warning (0, "%Hinline function '%D' is declared as dllimport: attribute ignored.", & DECL_SOURCE_LOCATION (decl), decl); return false; } @@ -216,14 +216,10 @@ sh_symbian_mark_dllexport (tree decl) tree idp; rtlname = XEXP (DECL_RTL (decl), 0); - - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (sh_symbian_dllimport_name_p (oldname)) { @@ -265,14 +261,10 @@ sh_symbian_mark_dllimport (tree decl) rtx newrtl; rtlname = XEXP (DECL_RTL (decl), 0); - - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (sh_symbian_dllexport_name_p (oldname)) { @@ -329,7 +321,7 @@ sh_symbian_encode_section_info (tree decl, rtx rtl, int first) tree idp = get_identifier (oldname + strlen (DLL_IMPORT_PREFIX)); rtx newrtl = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); - warning ("%H%s '%D' %s after being referenced with dllimport linkage.", + warning (0, "%H%s '%D' %s after being referenced with dllimport linkage.", & DECL_SOURCE_LOCATION (decl), TREE_CODE (decl) == VAR_DECL ? "variable" : "function", decl, (DECL_INITIAL (decl) || !DECL_EXTERNAL (decl)) @@ -411,14 +403,14 @@ sh_symbian_handle_dll_attribute (tree *pnode, tree name, tree args, | (int) ATTR_FLAG_FUNCTION_NEXT | (int) ATTR_FLAG_ARRAY_NEXT)) { - warning ("%qs attribute ignored", attr); + warning (0, "%qs attribute ignored", attr); *no_add_attrs = true; return tree_cons (name, args, NULL_TREE); } if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE) { - warning ("%qs attribute ignored", attr); + warning (0, "%qs attribute ignored", attr); *no_add_attrs = true; } diff --git a/gcc/config/sh/t-linux b/gcc/config/sh/t-linux index 777d157909e..698882fe92e 100644 --- a/gcc/config/sh/t-linux +++ b/gcc/config/sh/t-linux @@ -1,5 +1,5 @@ TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES -LIB1ASMFUNCS_CACHE = _ic_invalidate +LIB1ASMFUNCS_CACHE = _ic_invalidate _ic_invalidate_array LIB2FUNCS_EXTRA= diff --git a/gcc/config/sh/t-sh64 b/gcc/config/sh/t-sh64 index 97a13beeb78..031180842d2 100644 --- a/gcc/config/sh/t-sh64 +++ b/gcc/config/sh/t-sh64 @@ -1,11 +1,9 @@ -EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o - LIB1ASMFUNCS = \ _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ _shcompact_call_trampoline _shcompact_return_trampoline \ _shcompact_incoming_args _ic_invalidate _nested_trampoline \ _push_pop_shmedia_regs \ - _udivdi3 _divdi3 _umoddi3 _moddi3 + _udivdi3 _divdi3 _umoddi3 _moddi3 _div_table MULTILIB_CPU_DIRS= $(ML_sh1) $(ML_sh2e) $(ML_sh2) $(ML_sh3e) $(ML_sh3) $(ML_sh4_nofpu) $(ML_sh4_single_only) $(ML_sh4_single) $(ML_sh4) $(ML_sh5_32media:m5-32media/=media32) $(ML_sh5_32media_nofpu:m5-32media-nofpu/=nofpu/media32) $(ML_sh5_compact:m5-compact/=compact) $(ML_sh5_compact_nofpu:m5-compact-nofpu/=nofpu/compact) $(ML_sh5_64media:m5-64media/=media64) $(ML_sh5_64media_nofpu:m5-64media-nofpu/=nofpu/media64) diff --git a/gcc/config/sh/t-superh b/gcc/config/sh/t-superh new file mode 100644 index 00000000000..35803caeb05 --- /dev/null +++ b/gcc/config/sh/t-superh @@ -0,0 +1,6 @@ +MULTILIB_OPTIONS= mb m4-nofpu/m4-single/m4-single-only +MULTILIB_DIRNAMES= +MULTILIB_MATCHES = m4=m4-100 m4-nofpu=m4-100-nofpu m4-single=m4-100-single m4-single-only=m4-100-single-only \ + m4=m4-200 m4-nofpu=m4-200-nofpu m4-single=m4-200-single m4-single-only=m4-200-single-only \ + m4-nofpu=m4-400 \ + m4-nofpu=m4-500 diff --git a/gcc/config/sh/ushmedia.h b/gcc/config/sh/ushmedia.h index 6fb70162618..514ddff35b5 100644 --- a/gcc/config/sh/ushmedia.h +++ b/gcc/config/sh/ushmedia.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -36,767 +36,706 @@ typedef float __GCC_FV __attribute__ ((vector_size (4 * sizeof (float)))); typedef float __GCC_MTRX __attribute__ ((vector_size (16 * sizeof (float)))); #endif -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MABS_L (unsigned long long mm) { - unsigned long long res; - __asm__ ("mabs.l %1, %0" : "=r" (res) : "r" (mm)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_absv2si2 ((v2si) mm); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MABS_W (unsigned long long mm) { - unsigned long long res; - __asm__ ("mabs.w %1, %0" : "=r" (res) : "r" (mm)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_absv4hi2 ((v4hi) mm); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MADD_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("madd.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_addv2si3 ((v2si) mm, (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MADD_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("madd.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_addv4hi3 ((v4hi) mm, (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MADDS_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("madds.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_ssaddv2si3 ((v2si) mm, (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MADDS_UB (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("madds.ub %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_usaddv8qi3 ((v8qi) mm, (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MADDS_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("madds.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_ssaddv4hi3 ((v4hi) mm, (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MCMPEQ_B (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcmpeq.b %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MCMPEQ_B ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MCMPEQ_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcmpeq.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MCMPEQ_L ((v2si) mm, + (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MCMPEQ_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcmpeq.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; -} + typedef float v4hi __attribute__ ((mode(V4HI))); -__inline__ static -unsigned long long -sh_media_MCMPGT_L (unsigned long long mm, unsigned long long mn) -{ - unsigned long long res; - __asm__ ("mcmpgt.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + return (unsigned long long) __builtin_sh_media_MCMPEQ_W ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MCMPGT_UB (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcmpgt.ub %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MCMPGT_UB ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long -sh_media_MCMPGT_W (unsigned long long mm, unsigned long long mn) +static __inline unsigned long long +sh_media_MCMPGT_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcmpgt.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MCMPGT_L ((v2si) mm, + (v2si) mn); } -__inline__ static -unsigned long long -sh_media_MCMV (unsigned long long mm, unsigned long long mn, unsigned long long mw) +static __inline unsigned long long +sh_media_MCMPGT_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcmv %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MCMPGT_W ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +#define sh_media_MCMV __builtin_sh_media_MCMV + +static __inline unsigned long long sh_media_MCNVS_LW (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcnvs.lw %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + typedef unsigned int uv2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MCNVS_LW ((v2si) mm, + (uv2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MCNVS_WB (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcnvs.wb %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MCNVS_WB ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MCNVS_WUB (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mcnvs.wub %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MCNVS_WUB ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR1 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr1 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR1 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR2 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr2 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR2 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR3 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr3 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR3 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR4 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr4 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR4 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR5 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr5 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR5 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR6 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr6 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR6 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MEXTR7 (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mextr7 %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MEXTR7 ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long -sh_media_MMACFX_WL (unsigned long long mm, unsigned long long mn, unsigned long long mw) +static __inline unsigned long long +sh_media_MMACFX_WL (unsigned long long mm, unsigned long long mn, + unsigned long long mw) { - unsigned long long res; - __asm__ ("mmacfx.wl %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + typedef float v2hi __attribute__ ((mode(V2HI))); + typedef float v2si __attribute__ ((mode(V2SI))); + typedef unsigned int uv2si __attribute__ ((mode(V2SI))); + + long mm_l = (long) mm; + long mn_l = (long) mn; + + return ((unsigned long long) + __builtin_sh_media_MMACFX_WL ((v2hi) mm_l, (v2hi) mn_l, + (uv2si) mw)); } -__inline__ static -unsigned long long -sh_media_MMACNFX_WL (unsigned long long mm, unsigned long long mn, unsigned long long mw) +static __inline unsigned long long +sh_media_MMACNFX_WL (unsigned long long mm, unsigned long long mn, + unsigned long long mw) { - unsigned long long res; - __asm__ ("mmacnfx.wl %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + typedef float v2hi __attribute__ ((mode(V2HI))); + typedef float v2si __attribute__ ((mode(V2SI))); + typedef unsigned int uv2si __attribute__ ((mode(V2SI))); + + long mm_l = (long) mm; + long mn_l = (long) mn; + + return ((unsigned long long) + __builtin_sh_media_MMACNFX_WL ((v2hi) mm_l, (v2hi) mn_l, + (uv2si) mw)); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMUL_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmul.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_mulv2si3 ((v2si) mm, (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMUL_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmul.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_mulv4hi3 ((v4hi) mm, (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMULFX_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmulfx.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MMULFX_L ((v2si) mm, + (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMULFX_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmulfx.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MMULFX_W ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMULFXRP_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmulfxrp.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MMULFXRP_W ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMULHI_WL (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmulhi.wl %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MMULHI_WL ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MMULLO_WL (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mmullo.wl %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MMULLO_WL ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long -sh_media_MMULSUM_WQ (unsigned long long mm, unsigned long long mn, unsigned long long mw) +static __inline unsigned long long +sh_media_MMULSUM_WQ (unsigned long long mm, unsigned long long mn, + unsigned long long mw) { - unsigned long long res; - __asm__ ("mmulsum.wq %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + typedef unsigned int uv4hi __attribute__ ((mode(V4HI))); + + return __builtin_sh_media_MMULSUM_WQ ((uv4hi) mm, (uv4hi) mn, mw); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MPERM_W (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mperm.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MPERM_W ((v4hi) mm, mn); } -__inline__ static -unsigned long long -sh_media_MSAD_UBQ (unsigned long long mm, unsigned long long mn, unsigned long long mw) +static __inline unsigned long long +sh_media_MSAD_UBQ (unsigned long long mm, unsigned long long mn, + unsigned long long mw) { - unsigned long long res; - __asm__ ("msad.ubq %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + typedef unsigned int uv8qi __attribute__ ((mode(V8QI))); + + return __builtin_sh_media_MSAD_UBQ ((uv8qi) mm, (uv8qi) mn, mw); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHALDS_L (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshalds.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MSHALDS_L ((v2si) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHALDS_W (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshalds.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MSHALDS_W ((v4hi) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHARD_L (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshard.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_ashrv2si3 ((v2si) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHARD_W (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshard.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; -} + typedef float v4hi __attribute__ ((mode(V4HI))); -__inline__ static -short -sh_media_MSHARDS_Q (long long mm, unsigned int mn) -{ - short res; - __asm__ ("mshards.q %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + return (unsigned long long) __builtin_ashrv4hi3 ((v4hi) mm, mn); } -__inline__ static -unsigned long long +#define sh_media_MSHARDS_Q __builtin_sh_media_MSHARDS_Q + +static __inline unsigned long long sh_media_MSHFHI_B (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mshfhi.b %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MSHFHI_B ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHFHI_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mshfhi.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MSHFHI_L ((v2si) mm, + (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHFHI_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mshfhi.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MSHFHI_W ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHFLO_B (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mshflo.b %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_MSHFLO_B ((v8qi) mm, + (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHFLO_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mshflo.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sh_media_MSHFLO_L ((v2si) mm, + (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHFLO_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("mshflo.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sh_media_MSHFLO_W ((v4hi) mm, + (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHLLD_L (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshlld.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_ashlv2si3 ((v2si) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHLLD_W (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshlld.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_ashlv4hi3 ((v4hi) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHLRD_L (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshlrd.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_lshrv2si3 ((v2si) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSHLRD_W (unsigned long long mm, unsigned int mn) { - unsigned long long res; - __asm__ ("mshlrd.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_lshrv4hi3 ((v4hi) mm, mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSUB_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("msub.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_subv2si3 ((v2si) mm, (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSUB_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("msub.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_subv4hi3 ((v4hi) mm, (v4hi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSUBS_L (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("msubs.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v2si __attribute__ ((mode(V2SI))); + + return (unsigned long long) __builtin_sssubv2si3 ((v2si) mm, (v2si) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSUBS_UB (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("msubs.ub %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_ussubv8qi3 ((v8qi) mm, (v8qi) mn); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_MSUBS_W (unsigned long long mm, unsigned long long mn) { - unsigned long long res; - __asm__ ("msubs.w %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + typedef float v4hi __attribute__ ((mode(V4HI))); + + return (unsigned long long) __builtin_sssubv4hi3 ((v4hi) mm, (v4hi) mn); } #if ! __SH4_NOFPU__ -__inline__ static -double -sh_media_FABS_D (double dg) -{ - double res; - __asm__ ("fabs.d %1, %0" : "=f" (res) : "f" (dg)); - return res; -} +/* Floating-point Intrinsics */ -__inline__ static -float -sh_media_FABS_S (float fg) -{ - float res; - __asm__ ("fabs.s %1, %0" : "=f" (res) : "f" (fg)); - return res; -} +#define sh_media_FABS_D __builtin_fabs +#define sh_media_FABS_S __builtin_fabsf +#define sh_media_FCMPUN_D __builtin_isunordered +#define sh_media_FCMPUN_S __builtin_isunordered -__inline__ static -int -sh_media_FCMPUN_D (double dg, double dh) +static __inline float sh_media_FCOSA_S (float fg) { - int res; - __asm__ ("fcmpun.d %1, %2, %0" : "=f" (res) : "f" (dg), "f" (dh)); - return res; -} + union { int i; float f; } u; -__inline__ static -int -sh_media_FCMPUN_S (float fg, float fh) -{ - int res; - __asm__ ("fcmpun.s %1, %2, %0" : "=f" (res) : "f" (fg), "f" (fh)); - return res; + u.f = fg; + return __builtin_sh_media_FCOSA_S (u.i); } -__inline__ static -float +static __inline float sh_media_FGETSCR (void) -{ - float res; - __asm__ ("fgetscr %0" : "=f" (res)); - return res; +{ + float f; + + __asm volatile ("fgetscr %0" : "=f" (f)); + return f; } -__inline__ static -float +static __inline float sh_media_FIPR_S (const void *fvg, const void *fvh) { - float res; - __asm__ ("fipr.s %1, %2, %0" : "=f" (res) - : "f" (*(const __GCC_FV *)fvg), "f" (*(const __GCC_FV *)fvh)); - return res; + typedef float v4sf __attribute__ ((mode(V4SF))); + v4sf vg = *(v4sf*) fvg; + v4sf vh = *(v4sf*) fvh; + + return __builtin_sh_media_FIPR_S (vg, vh); } -__inline__ static -float +#if 0 +/* This gives different results for -O0 */ +static __inline float sh_media_FMAC_S (float fg, float fh, float fq) { - float res; - __asm__ ("fmac.s %1, %2, %0" : "=f" (res) - : "f" (fg), "f" (fh), "0" (fq)); - return res; + return fg * fh + fq; } +#else -__inline__ static -long long +#define sh_media_FMAC_S __builtin_sh_media_FMAC_S +#endif + +static __inline long long sh_media_FMOV_DQ (double dg) { - long long res; - __asm__ ("fmov.dq %1, %0" : "=r" (res) : "f" (dg)); - return res; + union { long long l; double d; } u; + + u.d = dg; + return u.l; } -__inline__ static -float +static __inline float sh_media_FMOV_LS (int mm) { - float res; - __asm__ ("fmov.ls %1, %0" : "=f" (res) : "r" (mm)); - return res; + union { int i; float f; } u; + + u.i = mm; + return u.f; } -__inline__ static -double +static __inline double sh_media_FMOV_QD (long long mm) { - double res; - __asm__ ("fmov.qd %1, %0" : "=f" (res) : "r" (mm)); - return res; + union { long long l; double d; } u; + + u.l = mm; + return u.d; } -__inline__ static -int +static __inline int sh_media_FMOV_SL (float fg) { - int res; - __asm__ ("fmov.sl %1, %0" : "=r" (res) : "f" (fg)); - return res; + union { int i; float f; } u; + + u.f = fg; + return u.i; } -__inline__ static -void +static __inline void sh_media_FPUTSCR (float fg) -{ - __asm__ ("fputscr %0" : : "f" (fg)); +{ + __asm volatile ("fputscr %0" : : "f" (fg)); } -__inline__ static -double -sh_media_FSQRT_D (double dg) +static __inline float sh_media_FSINA_S (float fg) { - double res; - __asm__ ("fsqrt.d %1, %0" : "=f" (res) : "f" (dg)); - return res; -} + union { int i; float f; } u; -__inline__ static -float -sh_media_FSQRT_S (float fg) -{ - float res; - __asm__ ("fsqrt.s %1, %0" : "=f" (res) : "f" (fg)); - return res; + u.f = fg; + return __builtin_sh_media_FSINA_S (u.i); } -__inline__ static -void +/* Can't use __builtin_sqrt / __builtin_sqrtf because they still implement + error handling unless -ffast-math is used. */ +#define sh_media_FSQRT_D __builtin_sh_media_FSQRT_D +#define sh_media_FSQRT_S __builtin_sh_media_FSQRT_S +#define sh_media_FSRRA_S __builtin_sh_media_FSRRA_S + +static __inline void sh_media_FTRV_S (const void *mtrxg, const void *fvh, void *fvf) { - __asm__ ("ftrv.s %2, %1, %0" : "=f" (*(__GCC_FV *)fvf) - : "f" (*(const __GCC_FV *)fvh), "f" (*(const __GCC_MTRX *)mtrxg)); + typedef float v16sf __attribute__ ((mode(V16SF))); + typedef float v4sf __attribute__ ((mode(V4SF))); + v16sf mtrx = *(v16sf*) mtrxg; + v4sf vh = *(v4sf*) fvh; + + *(v4sf*) fvf = __builtin_sh_media_FTRV_S (mtrx, vh); } #endif /* ! __SH4_NOFPU__ */ -__inline__ static -unsigned long long +/* Not implemented here: Control and Configuration intrinsics. */ +/* Misaligned Access Support intrinsics */ + +static __inline unsigned long long sh_media_LDHI_L (void *p, int s) { - unsigned long long res; - __asm__ ("ldhi.l %m1, %0" : "=r" (res) : "o" (((char*)p)[s])); - return res; + return __builtin_sh_media_LDHI_L ((char *)p + s); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_LDHI_Q (void *p, int s) { - unsigned long long res; - __asm__ ("ldhi.q %m1, %0" : "=r" (res) : "o" (((char*)p)[s])); - return res; + return __builtin_sh_media_LDHI_Q ((char *)p + s); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_LDLO_L (void *p, int s) { - unsigned long long res; - __asm__ ("ldlo.l %m1, %0" : "=r" (res) : "o" (((char*)p)[s])); - return res; + return __builtin_sh_media_LDLO_L ((char *)p + s); } -__inline__ static -unsigned long long +static __inline unsigned long long sh_media_LDLO_Q (void *p, int s) { - unsigned long long res; - __asm__ ("ldlo.q %m1, %0" : "=r" (res) : "o" (((char*)p)[s])); - return res; + return __builtin_sh_media_LDLO_Q ((char *)p + s); } -__inline__ static -void +static __inline void sh_media_STHI_L (void *p, int s, unsigned int mw) { - __asm__ ("sthi.l %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw)); + __builtin_sh_media_STHI_L ((char*)p + s, mw); } -__inline__ static -void +static __inline void sh_media_STHI_Q (void *p, int s, unsigned long long mw) { - __asm__ ("sthi.q %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw)); + __builtin_sh_media_STHI_Q ((char*)p + s, mw); } -__inline__ static -void +static __inline void sh_media_STLO_L (void *p, int s, unsigned int mw) { - __asm__ ("stlo.l %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw)); + __builtin_sh_media_STLO_L ((char*)p + s, mw); } -__inline__ static -void +static __inline void sh_media_STLO_Q (void *p, int s, unsigned long long mw) { - __asm__ ("stlo.q %m0, %1" : "+o" (((char*)p)[s]) : "r" (mw)); + __builtin_sh_media_STLO_Q ((char*)p + s, mw); } -__inline__ static -unsigned char -sh_media_NSB (long long mm) -{ - unsigned char res; - __asm__ ("nsb %1, %0" : "=r" (res) : "r" (mm)); - return res; -} +/* Miscellaneous intrinsics */ -__inline__ static -unsigned long long +#define sh_media_NSB __builtin_sh_media_NSB + +static __inline unsigned long long sh_media_BYTEREV (unsigned long long mm) { - unsigned long long res; - __asm__ ("byterev %1, %0" : "=r" (res) : "r" (mm)); - return res; + typedef float v8qi __attribute__ ((mode(V8QI))); + + return (unsigned long long) __builtin_sh_media_BYTEREV ((v8qi) mm); } -__inline__ static -unsigned long long +__inline__ static unsigned long long +sh_media_CMVEQ (unsigned long long mm, unsigned long long mn, unsigned long long mw) __attribute__ ((always_inline)); + +__inline__ static unsigned long long sh_media_CMVEQ (unsigned long long mm, unsigned long long mn, unsigned long long mw) { - unsigned long long res; - __asm__ ("cmveq %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + return mm == 0 ? mn : mw; } -__inline__ static -unsigned long long +__inline__ static unsigned long long +sh_media_CMVNE (unsigned long long mm, unsigned long long mn, unsigned long long mw) __attribute__ ((always_inline)); + +__inline__ static unsigned long long sh_media_CMVNE (unsigned long long mm, unsigned long long mn, unsigned long long mw) { - unsigned long long res; - __asm__ ("cmveq %1, %2, %0" : "=r" (res) - : "r" (mm), "r" (mn), "0" (mw)); - return res; + return mm != 0 ? mn : mw; } -__inline__ static -unsigned long long +static __inline long long sh_media_ADDZ_L (unsigned int mm, unsigned int mn) { - unsigned long long res; - __asm__ ("addz.l %1, %2, %0" : "=r" (res) : "r" (mm), "r" (mn)); - return res; + return mm + mn; } -__inline__ static +/* NOP and Synchronization instrinsics not implemented here. */ + +static __inline__ void sh_media_PREFO(void *mm, int s) +{ + __builtin_sh_media_PREFO (mm + s, 0, 0); +} + +/* Event Handling instrinsics not implemented here. */ + +/* Old asm stuff */ + +static __inline__ void sh_media_NOP (void) { - __asm__ __volatile__ ("nop" : :); + __asm__ ("nop" : :); } __inline__ static @@ -827,7 +766,7 @@ __inline__ static void sh_media_ALLOCO (void *mm, int s) { - __asm__ __volatile__ ("alloco %m0" : : "o" (((char*)mm)[s])); + __builtin_sh_media_ALLOCO (mm + s); } __inline__ static @@ -867,13 +806,6 @@ sh_media_PREFI (void *mm, int s) __inline__ static void -sh_media_PREFO (void *mm, int s) -{ - __asm__ __volatile__ ("ld.b %m0, r63" : : "o" (((char*)mm)[s])); -} - -__inline__ static -void sh_media_BRK (void) { __asm__ __volatile__ ("brk"); @@ -911,14 +843,19 @@ sh_media_unaligned_LD_UW (void *p) #endif } +/* We don't use the sh_media_LD* functions here because that turned out + to impede constant propagation of the offsets into the ldhi / ldlo + instructions. */ __inline__ static int sh_media_unaligned_LD_L (void *p) { #if __LITTLE_ENDIAN__ - return sh_media_LDHI_L (p, 3) | sh_media_LDLO_L (p, 0); + return (__builtin_sh_media_LDHI_L ((char *)p + 3) + | __builtin_sh_media_LDLO_L (p)); #else - return sh_media_LDLO_L (p, 3) | sh_media_LDHI_L (p, 0); + return (__builtin_sh_media_LDLO_L ((char *)p + 3) + | __builtin_sh_media_LDHI_L (p)); #endif } @@ -927,9 +864,11 @@ long long sh_media_unaligned_LD_Q (void *p) { #if __LITTLE_ENDIAN__ - return sh_media_LDHI_Q (p, 7) | sh_media_LDLO_Q (p, 0); + return (__builtin_sh_media_LDHI_Q ((char *)p + 7) + | __builtin_sh_media_LDLO_Q (p)); #else - return sh_media_LDLO_Q (p, 7) | sh_media_LDHI_Q (p, 0); + return (__builtin_sh_media_LDLO_Q ((char *)p + 7) + | __builtin_sh_media_LDHI_Q (p)); #endif } @@ -947,16 +886,19 @@ sh_media_unaligned_ST_W (void *p, unsigned int k) #endif } +/* We don't use the sh_media_ST* functions here because that turned out + to impede constant propagation of the offsets into the ldhi / ldlo + instructions. */ __inline__ static void sh_media_unaligned_ST_L (void *p, unsigned int k) { #if __LITTLE_ENDIAN__ - sh_media_STHI_L (p, 3, k); - sh_media_STLO_L (p, 0, k); + __builtin_sh_media_STHI_L (p + 3, k); + __builtin_sh_media_STLO_L (p, k); #else - sh_media_STLO_L (p, 3, k); - sh_media_STHI_L (p, 0, k); + __builtin_sh_media_STLO_L (p + 3, k); + __builtin_sh_media_STHI_L (p, k); #endif } @@ -965,11 +907,11 @@ void sh_media_unaligned_ST_Q (void *p, unsigned long long k) { #if __LITTLE_ENDIAN__ - sh_media_STHI_Q (p, 7, k); - sh_media_STLO_Q (p, 0, k); + __builtin_sh_media_STHI_Q (p + 7, k); + __builtin_sh_media_STLO_Q (p, k); #else - sh_media_STLO_Q (p, 7, k); - sh_media_STHI_Q (p, 0, k); + __builtin_sh_media_STLO_Q (p + 7, k); + __builtin_sh_media_STHI_Q (p, k); #endif } diff --git a/gcc/config/sol2-c.c b/gcc/config/sol2-c.c index 784d20b2c7a..330f1ca3c2f 100644 --- a/gcc/config/sol2-c.c +++ b/gcc/config/sol2-c.c @@ -1,5 +1,5 @@ /* Solaris support needed only by C/C++ frontends. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. @@ -91,7 +91,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) if (c_lex (&x) != CPP_NUMBER || c_lex (&t) != CPP_OPEN_PAREN) { - warning ("malformed %<#pragma align%>, ignoring"); + warning (0, "malformed %<#pragma align%>, ignoring"); return; } @@ -100,14 +100,14 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) || (low != 1 && low != 2 && low != 4 && low != 8 && low != 16 && low != 32 && low != 64 && low != 128)) { - warning ("invalid alignment for %<#pragma align%>, ignoring"); + warning (0, "invalid alignment for %<#pragma align%>, ignoring"); return; } ttype = c_lex (&t); if (ttype != CPP_NAME) { - warning ("malformed %<#pragma align%>, ignoring"); + warning (0, "malformed %<#pragma align%>, ignoring"); return; } @@ -115,7 +115,7 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) { tree decl = identifier_global_value (t); if (decl && DECL_P (decl)) - warning ("%<#pragma align%> must appear before the declaration of " + warning (0, "%<#pragma align%> must appear before the declaration of " "%D, ignoring", decl); else solaris_pending_aligns = tree_cons (t, build_tree_list (NULL, x), @@ -127,19 +127,19 @@ solaris_pragma_align (cpp_reader *pfile ATTRIBUTE_UNUSED) ttype = c_lex (&t); if (ttype != CPP_NAME) { - warning ("malformed %<#pragma align%>"); + warning (0, "malformed %<#pragma align%>"); return; } } else if (ttype == CPP_CLOSE_PAREN) { if (c_lex (&t) != CPP_EOF) - warning ("junk at end of %<#pragma align%>"); + warning (0, "junk at end of %<#pragma align%>"); return; } else { - warning ("malformed %<#pragma align%>"); + warning (0, "malformed %<#pragma align%>"); return; } } @@ -155,14 +155,14 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED) if (c_lex (&t) != CPP_OPEN_PAREN) { - warning ("malformed %<#pragma init%>, ignoring"); + warning (0, "malformed %<#pragma init%>, ignoring"); return; } ttype = c_lex (&t); if (ttype != CPP_NAME) { - warning ("malformed %<#pragma init%>, ignoring"); + warning (0, "malformed %<#pragma init%>, ignoring"); return; } @@ -185,19 +185,19 @@ solaris_pragma_init (cpp_reader *pfile ATTRIBUTE_UNUSED) ttype = c_lex (&t); if (ttype != CPP_NAME) { - warning ("malformed %<#pragma init%>"); + warning (0, "malformed %<#pragma init%>"); return; } } else if (ttype == CPP_CLOSE_PAREN) { if (c_lex (&t) != CPP_EOF) - warning ("junk at end of %<#pragma init%>"); + warning (0, "junk at end of %<#pragma init%>"); return; } else { - warning ("malformed %<#pragma init%>"); + warning (0, "malformed %<#pragma init%>"); return; } } @@ -213,14 +213,14 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED) if (c_lex (&t) != CPP_OPEN_PAREN) { - warning ("malformed %<#pragma fini%>, ignoring"); + warning (0, "malformed %<#pragma fini%>, ignoring"); return; } ttype = c_lex (&t); if (ttype != CPP_NAME) { - warning ("malformed %<#pragma fini%>, ignoring"); + warning (0, "malformed %<#pragma fini%>, ignoring"); return; } @@ -243,19 +243,19 @@ solaris_pragma_fini (cpp_reader *pfile ATTRIBUTE_UNUSED) ttype = c_lex (&t); if (ttype != CPP_NAME) { - warning ("malformed %<#pragma fini%>"); + warning (0, "malformed %<#pragma fini%>"); return; } } else if (ttype == CPP_CLOSE_PAREN) { if (c_lex (&t) != CPP_EOF) - warning ("junk at end of %<#pragma fini%>"); + warning (0, "junk at end of %<#pragma fini%>"); return; } else { - warning ("malformed %<#pragma fini%>"); + warning (0, "malformed %<#pragma fini%>"); return; } } diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c index ae34584a961..348e752ee7c 100644 --- a/gcc/config/sol2.c +++ b/gcc/config/sol2.c @@ -1,5 +1,5 @@ /* General Solaris system support. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. @@ -51,7 +51,7 @@ solaris_insert_attributes (tree decl, tree *attributes) { if (lookup_attribute ("aligned", DECL_ATTRIBUTES (decl)) || lookup_attribute ("aligned", *attributes)) - warning ("%Jignoring %<#pragma align%> for explicitly " + warning (0, "%Jignoring %<#pragma align%> for explicitly " "aligned %<%D%>", decl, decl); else *attributes = tree_cons (get_identifier ("aligned"), value, diff --git a/gcc/config/sparc/freebsd.h b/gcc/config/sparc/freebsd.h index c032d644be0..aefa1d45ab8 100644 --- a/gcc/config/sparc/freebsd.h +++ b/gcc/config/sparc/freebsd.h @@ -72,11 +72,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Definitions for 64-bit SPARC running systems with ELF. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ - {"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)"); diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h index 5b7244707d2..fdad997056b 100644 --- a/gcc/config/sparc/linux.h +++ b/gcc/config/sparc/linux.h @@ -86,11 +86,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc GNU/Linux with ELF)"); -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ -{"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" @@ -209,8 +204,6 @@ do { \ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack - /* Determine whether the the entire c99 runtime is present in the runtime library. */ #define TARGET_C99_FUNCTIONS 1 @@ -233,3 +226,6 @@ do { \ change their minds. */ #undef SPARC_RELAXED_ORDERING #define SPARC_RELAXED_ORDERING true + +#undef NEED_INDICATE_EXEC_STACK +#define NEED_INDICATE_EXEC_STACK 1 diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h index 4a266dfc61c..3a4613b89c9 100644 --- a/gcc/config/sparc/linux64.h +++ b/gcc/config/sparc/linux64.h @@ -106,11 +106,6 @@ Boston, MA 02111-1307, USA. */ #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_MEDLOW -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ -{"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - #undef WCHAR_TYPE #define WCHAR_TYPE "int" @@ -343,8 +338,6 @@ do { \ #undef CTORS_SECTION_ASM_OP #undef DTORS_SECTION_ASM_OP -#define TARGET_ASM_FILE_END file_end_indicate_exec_stack - /* Determine whether the the entire c99 runtime is present in the runtime library. */ #define TARGET_C99_FUNCTIONS 1 @@ -367,3 +360,6 @@ do { \ change their minds. */ #undef SPARC_RELAXED_ORDERING #define SPARC_RELAXED_ORDERING true + +#undef NEED_INDICATE_EXEC_STACK +#define NEED_INDICATE_EXEC_STACK 1 diff --git a/gcc/config/sparc/lite.h b/gcc/config/sparc/lite.h deleted file mode 100644 index cac67ec1d0b..00000000000 --- a/gcc/config/sparc/lite.h +++ /dev/null @@ -1,31 +0,0 @@ -/* Definitions of target machine for GCC, for SPARClite w/o FPU. - Copyright (C) 1993, 1996 Free Software Foundation, Inc. - Contributed by Jim Wilson (wilson@cygnus.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. */ - -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (sparclite)"); - -/* Enable app-regs and epilogue options. Do not enable the fpu. */ - -#undef TARGET_DEFAULT -#define TARGET_DEFAULT MASK_APP_REGS - -/* Enable US Software GOFAST library support. */ -#define US_SOFTWARE_GOFAST diff --git a/gcc/config/sparc/litecoff.h b/gcc/config/sparc/litecoff.h deleted file mode 100644 index c58c55817b8..00000000000 --- a/gcc/config/sparc/litecoff.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Definitions of target machine for GCC, for SPARClite w/o FPU, COFF. - Copyright (C) 1994, 1996, 2000, 2002, 2004, 2005 - Free Software Foundation, Inc. - Written by Ken Raeburn (raeburn@cygnus.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. */ - -#define BSS_SECTION_ASM_OP "\t.section\t\".bss\"" - -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define_std ("sparclite"); \ - } \ - while (0) - -/* Default to stabs in COFF. */ - -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - -/* Support the ctors and dtors sections for g++. */ - -#undef INIT_SECTION_ASM_OP - -#undef DO_GLOBAL_CTORS_BODY -#undef DO_GLOBAL_DTORS_BODY - -/* These compiler options take an argument. We ignore -target for now. */ - -#define WORD_SWITCH_TAKES_ARG(STR) \ - (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ - || !strcmp (STR, "target") || !strcmp (STR, "assert")) - -/* Output the label for a function definition. */ - -#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ -do { \ - ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ - ASM_OUTPUT_LABEL (FILE, NAME); \ -} while (0) - -/* Output before read-only data. */ - -#define TEXT_SECTION_ASM_OP "\t.text" - -/* Output before writable data. */ - -#define DATA_SECTION_ASM_OP "\t.data" diff --git a/gcc/config/sparc/liteelf.h b/gcc/config/sparc/liteelf.h deleted file mode 100644 index 584816b4a1e..00000000000 --- a/gcc/config/sparc/liteelf.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Definitions of target machine for GCC, for SPARClite w/o FPU, ELF. - Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc. - Contributed by Stan Cox (scox@cygnus.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. */ - -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (sparclite)"); - -#undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("__sparclite__"); \ - } \ - while (0) - -/* Enable app-regs and epilogue options. Do not enable the fpu. */ - -#undef TARGET_DEFAULT -#define TARGET_DEFAULT MASK_APP_REGS - -/* Enable US Software GOFAST library support. */ -#define US_SOFTWARE_GOFAST - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "crti.o%s crtbegin.o%s" - -/* Use __main method of constructor invocation. */ -#undef INIT_SECTION_ASM_OP -#undef FINI_SECTION_ASM_OP diff --git a/gcc/config/sparc/little-endian.opt b/gcc/config/sparc/little-endian.opt new file mode 100644 index 00000000000..81a87585223 --- /dev/null +++ b/gcc/config/sparc/little-endian.opt @@ -0,0 +1,28 @@ +; Options for the SPARC port of the compiler +; +; Copyright (C) 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. + +mlittle-endian +Target Report RejectNegative Mask(LITTLE_ENDIAN) MaskExists +Generate code for little-endian + +mbig-endian +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Generate code for big-endian diff --git a/gcc/config/sparc/long-double-switch.opt b/gcc/config/sparc/long-double-switch.opt new file mode 100644 index 00000000000..565cb8e09b2 --- /dev/null +++ b/gcc/config/sparc/long-double-switch.opt @@ -0,0 +1,28 @@ +; Options for the SPARC port of the compiler +; +; Copyright (C) 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. + +mlong-double-128 +Target Report RejectNegative Mask(LONG_DOUBLE_128) MaskExists +Use 128-bit long double + +mlong-double-64 +Target Report RejectNegative InverseMask(LONG_DOUBLE_128) +Use 64-bit long double diff --git a/gcc/config/sparc/netbsd-elf.h b/gcc/config/sparc/netbsd-elf.h index c86adc5fe01..f12a00a42e9 100644 --- a/gcc/config/sparc/netbsd-elf.h +++ b/gcc/config/sparc/netbsd-elf.h @@ -195,13 +195,6 @@ Boston, MA 02111-1307, USA. */ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, -/* What extra switches do we need? */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - {"long-double-64", -MASK_LONG_DOUBLE_128, N_("Use 64 bit long doubles") }, \ - {"long-double-128", MASK_LONG_DOUBLE_128, N_("Use 128 bit long doubles") }, - - /* Build a compiler that supports -m32 and -m64? */ #ifdef SPARC_BI_ARCH diff --git a/gcc/config/sparc/predicates.md b/gcc/config/sparc/predicates.md new file mode 100644 index 00000000000..b56ae65af35 --- /dev/null +++ b/gcc/config/sparc/predicates.md @@ -0,0 +1,472 @@ +;; Predicate definitions for SPARC. +;; Copyright (C) 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. + +;; Predicates for numerical constants. + +;; Return true if OP is the zero constant for MODE. +(define_predicate "const_zero_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST0_RTX (mode)"))) + +;; Return true if OP is the one constant for MODE. +(define_predicate "const_one_operand" + (and (match_code "const_int,const_double,const_vector") + (match_test "op == CONST1_RTX (mode)"))) + +;; Return true if OP is the integer constant 4096. +(define_predicate "const_4096_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) == 4096"))) + +;; Return true if OP is a constant that is representable by a 13-bit +;; signed field. This is an acceptable immediate operand for most +;; 3-address instructions. +(define_predicate "small_int_operand" + (and (match_code "const_int") + (match_test "SPARC_SIMM13_P (INTVAL (op))"))) + +;; Return true if OP is a constant operand for the umul instruction. That +;; instruction sign-extends immediate values just like all other SPARC +;; instructions, but interprets the extended result as an unsigned number. +(define_predicate "uns_small_int_operand" + (match_code "const_int,const_double") +{ +#if HOST_BITS_PER_WIDE_INT == 32 + return ((GET_CODE (op) == CONST_INT && (unsigned) INTVAL (op) < 0x1000) + || (GET_CODE (op) == CONST_DOUBLE + && CONST_DOUBLE_HIGH (op) == 0 + && (unsigned) CONST_DOUBLE_LOW (op) - 0xFFFFF000 < 0x1000)); +#else + return (GET_CODE (op) == CONST_INT + && ((INTVAL (op) >= 0 && INTVAL (op) < 0x1000) + || (INTVAL (op) >= 0xFFFFF000 + && INTVAL (op) <= 0xFFFFFFFF))); +#endif +}) + +;; Return true if OP is a constant that can be loaded by the sethi instruction. +;; The first test avoids emitting sethi to load zero for example. +(define_predicate "const_high_operand" + (and (match_code "const_int") + (and (not (match_operand 0 "small_int_operand")) + (match_test "SPARC_SETHI_P (INTVAL (op) & GET_MODE_MASK (mode))")))) + +;; Return true if OP is a constant whose 1's complement can be loaded by the +;; sethi instruction. +(define_predicate "const_compl_high_operand" + (and (match_code "const_int") + (and (not (match_operand 0 "small_int_operand")) + (match_test "SPARC_SETHI_P (~INTVAL (op) & GET_MODE_MASK (mode))")))) + +;; Return true if OP is a FP constant that needs to be loaded by the sethi/losum +;; pair of instructions. +(define_predicate "fp_const_high_losum_operand" + (match_operand 0 "const_double_operand") +{ + gcc_assert (mode == SFmode); + return fp_high_losum_p (op); +}) + + +;; Predicates for symbolic constants. + +;; Return true if OP is either a symbol reference or a sum of a symbol +;; reference and a constant. +(define_predicate "symbolic_operand" + (match_code "symbol_ref,label_ref,const") +{ + enum machine_mode omode = GET_MODE (op); + + if (omode != mode && omode != VOIDmode && mode != VOIDmode) + return false; + + switch (GET_CODE (op)) + { + case SYMBOL_REF: + return !SYMBOL_REF_TLS_MODEL (op); + + case LABEL_REF: + return true; + + case CONST: + op = XEXP (op, 0); + return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF + && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) + || GET_CODE (XEXP (op, 0)) == LABEL_REF) + && GET_CODE (XEXP (op, 1)) == CONST_INT); + + default: + gcc_unreachable (); + } +}) + +;; Return true if OP is a symbolic operand for the TLS Global Dynamic model. +(define_predicate "tgd_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "tls_symbolic_operand (op) == TLS_MODEL_GLOBAL_DYNAMIC"))) + +;; Return true if OP is a symbolic operand for the TLS Local Dynamic model. +(define_predicate "tld_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "tls_symbolic_operand (op) == TLS_MODEL_LOCAL_DYNAMIC"))) + +;; Return true if OP is a symbolic operand for the TLS Initial Exec model. +(define_predicate "tie_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "tls_symbolic_operand (op) == TLS_MODEL_INITIAL_EXEC"))) + +;; Return true if OP is a symbolic operand for the TLS Local Exec model. +(define_predicate "tle_symbolic_operand" + (and (match_code "symbol_ref") + (match_test "tls_symbolic_operand (op) == TLS_MODEL_LOCAL_EXEC"))) + +;; Return true if the operand is an argument used in generating PIC references +;; in either the medium/low or embedded medium/anywhere code models on V9. +;; Check for (const (minus (symbol_ref:GOT) +;; (const (minus (label) (pc))))) +(define_predicate "medium_pic_operand" + (match_code "const") +{ + /* Check for (const (minus (symbol_ref:GOT) + (const (minus (label) (pc))))). */ + op = XEXP (op, 0); + return GET_CODE (op) == MINUS + && GET_CODE (XEXP (op, 0)) == SYMBOL_REF + && GET_CODE (XEXP (op, 1)) == CONST + && GET_CODE (XEXP (XEXP (op, 1), 0)) == MINUS; +}) + +;; Return true if OP is a LABEL_REF of mode MODE. +(define_predicate "label_ref_operand" + (and (match_code "label_ref") + (match_test "GET_MODE (op) == mode"))) + +;; Return true if OP is a data segment reference. This includes the readonly +;; data segment or, in other words, anything but the text segment. +;; This is needed in the embedded medium/anywhere code model on V9. These +;; values are accessed with EMBMEDANY_BASE_REG. */ +(define_predicate "data_segment_operand" + (match_code "symbol_ref,plus,const") +{ + switch (GET_CODE (op)) + { + case SYMBOL_REF : + return ! SYMBOL_REF_FUNCTION_P (op); + case PLUS : + /* Assume canonical format of symbol + constant. + Fall through. */ + case CONST : + return data_segment_operand (XEXP (op, 0), VOIDmode); + default : + gcc_unreachable (); + } +}) + +;; Return true if OP is a text segment reference. +;; This is needed in the embedded medium/anywhere code model on V9. +(define_predicate "text_segment_operand" + (match_code "label_ref,symbol_ref,plus,const") +{ + switch (GET_CODE (op)) + { + case LABEL_REF : + return true; + case SYMBOL_REF : + return SYMBOL_REF_FUNCTION_P (op); + case PLUS : + /* Assume canonical format of symbol + constant. + Fall through. */ + case CONST : + return text_segment_operand (XEXP (op, 0), VOIDmode); + default : + gcc_unreachable (); + } +}) + + +;; Predicates for registers. + +;; Return true if OP is either the zero constant or a register. +(define_predicate "register_or_zero_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "const_zero_operand"))) + +;; Return true if OP is a register operand in a floating point register. +(define_predicate "fp_register_operand" + (match_operand 0 "register_operand") +{ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); /* Possibly a MEM */ + return REG_P (op) && SPARC_FP_REG_P (REGNO (op)); +}) + +;; Return true if OP is an integer register. +(define_special_predicate "int_register_operand" + (ior (match_test "register_operand (op, SImode)") + (match_test "TARGET_ARCH64 && register_operand (op, DImode)"))) + +;; Return true if OP is a floating point condition code register. +(define_predicate "fcc_register_operand" + (match_code "reg") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return false; + if (mode == VOIDmode + && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) + return false; + +#if 0 /* ??? 1 when %fcc0-3 are pseudos first. See gen_compare_reg(). */ + if (reg_renumber == 0) + return REGNO (op) >= FIRST_PSEUDO_REGISTER; + return REGNO_OK_FOR_CCFP_P (REGNO (op)); +#else + return ((unsigned) REGNO (op) - SPARC_FIRST_V9_FCC_REG) < 4; +#endif +}) + +;; Return true if OP is the floating point condition code register fcc0. +(define_predicate "fcc0_register_operand" + (match_code "reg") +{ + if (mode != VOIDmode && mode != GET_MODE (op)) + return false; + if (mode == VOIDmode + && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) + return false; + + return REGNO (op) == SPARC_FCC_REG; +}) + +;; Return true if OP is an integer or floating point condition code register. +(define_predicate "icc_or_fcc_register_operand" + (match_code "reg") +{ + if (REGNO (op) == SPARC_ICC_REG) + { + if (mode != VOIDmode && mode != GET_MODE (op)) + return false; + if (mode == VOIDmode + && GET_MODE (op) != CCmode && GET_MODE (op) != CCXmode) + return false; + + return true; + } + + return fcc_register_operand (op, mode); +}) + + +;; Predicates for arithmetic instructions. + +;; Return true if OP is a register, or is a constant that is representable +;; by a 13-bit signed field. This is an acceptable operand for most +;; 3-address instructions. +(define_predicate "arith_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "small_int_operand"))) + +;; 64-bit: Same as above. +;; 32-bit: Return true if OP is a register, or is a constant that is +;; representable by a couple of 13-bit signed fields. This is an +;; acceptable operand for most 3-address splitters. +(define_predicate "arith_double_operand" + (match_code "const_int,const_double,reg,subreg") +{ + bool arith_simple_operand = arith_operand (op, mode); + HOST_WIDE_INT m1, m2; + + if (TARGET_ARCH64 || arith_simple_operand) + return arith_simple_operand; + +#if HOST_BITS_PER_WIDE_INT == 32 + if (GET_CODE (op) != CONST_DOUBLE) + return false; + m1 = CONST_DOUBLE_LOW (op); + m2 = CONST_DOUBLE_HIGH (op); +#else + if (GET_CODE (op) != CONST_INT) + return false; + m1 = trunc_int_for_mode (INTVAL (op), SImode); + m2 = trunc_int_for_mode (INTVAL (op) >> 32, SImode); +#endif + + return SPARC_SIMM13_P (m1) && SPARC_SIMM13_P (m2); +}) + +;; Return true if OP is suitable as second operand for add/sub. +(define_predicate "arith_add_operand" + (ior (match_operand 0 "arith_operand") + (match_operand 0 "const_4096_operand"))) + +;; Return true if OP is suitable as second double operand for add/sub. +(define_predicate "arith_double_add_operand" + (match_code "const_int,const_double,reg,subreg") +{ + bool _arith_double_operand = arith_double_operand (op, mode); + + if (_arith_double_operand) + return true; + + return TARGET_ARCH64 && const_4096_operand (op, mode); +}) + +;; Return true if OP is a register, or is a CONST_INT that can fit in a +;; signed 10-bit immediate field. This is an acceptable SImode operand for +;; the movrcc instructions. +(define_predicate "arith10_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "SPARC_SIMM10_P (INTVAL (op))")))) + +;; Return true if OP is a register, or is a CONST_INT that can fit in a +;; signed 11-bit immediate field. This is an acceptable SImode operand for +;; the movcc instructions. +(define_predicate "arith11_operand" + (ior (match_operand 0 "register_operand") + (and (match_code "const_int") + (match_test "SPARC_SIMM11_P (INTVAL (op))")))) + +;; Return true if OP is a register or a constant for the umul instruction. +(define_predicate "uns_arith_operand" + (ior (match_operand 0 "register_operand") + (match_operand 0 "uns_small_int_operand"))) + + +;; Predicates for miscellaneous instructions. + +;; Return true if OP is valid for the lhs of a comparison insn. +(define_predicate "compare_operand" + (match_code "reg,subreg,zero_extract") +{ + if (GET_CODE (op) == ZERO_EXTRACT) + return (register_operand (XEXP (op, 0), mode) + && small_int_operand (XEXP (op, 1), mode) + && small_int_operand (XEXP (op, 2), mode) + /* This matches cmp_zero_extract. */ + && ((mode == SImode + && INTVAL (XEXP (op, 2)) > 19) + /* This matches cmp_zero_extract_sp64. */ + || (TARGET_ARCH64 + && mode == DImode + && INTVAL (XEXP (op, 2)) > 51))); + else + return register_operand (op, mode); +}) + +;; Return true if OP is a valid operand for the source of a move insn. +(define_predicate "input_operand" + (match_code "const_int,const_double,const_vector,reg,subreg,mem") +{ + enum mode_class mclass; + + /* If both modes are non-void they must be the same. */ + if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op)) + return false; + + /* Allow any 1-instruction integer constant. */ + if (GET_MODE_CLASS (mode) == MODE_INT + && (small_int_operand (op, mode) || const_high_operand (op, mode))) + return true; + + /* If 32-bit mode and this is a DImode constant, allow it + so that the splits can be generated. */ + if (TARGET_ARCH32 + && mode == DImode + && (GET_CODE (op) == CONST_DOUBLE || GET_CODE (op) == CONST_INT)) + return true; + + if (register_operand (op, mode)) + return true; + + mclass = GET_MODE_CLASS (mode); + if ((mclass == MODE_FLOAT && GET_CODE (op) == CONST_DOUBLE) + || (mclass == MODE_VECTOR_INT && GET_CODE (op) == CONST_VECTOR)) + return true; + + /* If this is a SUBREG, look inside so that we handle + paradoxical ones. */ + if (GET_CODE (op) == SUBREG) + op = SUBREG_REG (op); + + /* Check for valid MEM forms. */ + if (GET_CODE (op) == MEM) + return memory_address_p (mode, XEXP (op, 0)); + + return false; +}) + +;; Return true if OP is an address suitable for a call insn. +;; Call insn on SPARC can take a PC-relative constant address +;; or any regular memory address. +(define_predicate "call_address_operand" + (ior (match_operand 0 "symbolic_operand") + (match_test "memory_address_p (Pmode, op)"))) + +;; Return true if OP is an operand suitable for a call insn. +(define_predicate "call_operand" + (and (match_code "mem") + (match_test "call_address_operand (XEXP (op, 0), mode)"))) + + +;; Predicates for operators. + +;; Return true if OP is a comparison operator. This allows the use of +;; MATCH_OPERATOR to recognize all the branch insns. +(define_predicate "noov_compare_operator" + (match_code "ne,eq,ge,gt,le,lt,geu,gtu,leu,ltu") +{ + enum rtx_code code = GET_CODE (op); + if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode + || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) + /* These are the only branches which work with CC_NOOVmode. */ + return (code == EQ || code == NE || code == GE || code == LT); + return true; +}) + +;; Return true if OP is a 64-bit comparison operator. This allows the use of +;; MATCH_OPERATOR to recognize all the branch insns. +(define_predicate "noov_compare64_operator" + (and (match_code "ne,eq,ge,gt,le,lt,geu,gtu,leu,ltu") + (match_test "TARGET_V9")) +{ + enum rtx_code code = GET_CODE (op); + if (GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) + /* These are the only branches which work with CCX_NOOVmode. */ + return (code == EQ || code == NE || code == GE || code == LT); + return (GET_MODE (XEXP (op, 0)) == CCXmode); +}) + +;; Return true if OP is a comparison operator suitable for use in V9 +;; conditional move or branch on register contents instructions. +(define_predicate "v9_register_compare_operator" + (match_code "eq,ne,ge,lt,le,gt")) + +;; Return true if OP is an operator which can set the condition codes +;; explicitly. We do not include PLUS and MINUS because these +;; require CC_NOOVmode, which we handle explicitly. +(define_predicate "cc_arith_operator" + (match_code "and,ior,xor")) + +;; Return true if OP is an operator which can bitwise complement its +;; second operand and set the condition codes explicitly. +;; XOR is not here because combine canonicalizes (xor (not ...) ...) +;; and (xor ... (not ...)) to (not (xor ...)). */ +(define_predicate "cc_arith_not_operator" + (match_code "and,ior")) diff --git a/gcc/config/sparc/sol2-64.h b/gcc/config/sparc/sol2-64.h index 2a15f3db51a..d0dd284daf0 100644 --- a/gcc/config/sparc/sol2-64.h +++ b/gcc/config/sparc/sol2-64.h @@ -4,4 +4,4 @@ #undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ + \ - MASK_STACK_BIAS + MASK_FPU + MASK_LONG_DOUBLE_128) + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128) diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h index 12cd24fccae..1c68133a8c9 100644 --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -148,7 +148,8 @@ Boston, MA 02111-1307, USA. */ /* Solaris allows 64 bit out and global registers in 32 bit mode. sparc_override_options will disable V8+ if not generating V9 code. */ #undef TARGET_DEFAULT -#define TARGET_DEFAULT (MASK_V8PLUS + MASK_FPU + MASK_LONG_DOUBLE_128) +#define TARGET_DEFAULT (MASK_V8PLUS + MASK_APP_REGS + MASK_FPU \ + + MASK_LONG_DOUBLE_128) /* Solaris-specific #pragmas are implemented on top of attributes. Hook in the bits from config/sol2.c. */ diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h index b261299058c..b77a6e2b5ff 100644 --- a/gcc/config/sparc/sp-elf.h +++ b/gcc/config/sparc/sp-elf.h @@ -22,9 +22,6 @@ Boston, MA 02111-1307, USA. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc-elf)") -#undef TARGET_DEFAULT -#define TARGET_DEFAULT MASK_FPU - /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index e75a5f53bf6..dcb79ee95fa 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -81,12 +81,6 @@ crtbegin.o%s \ || (CHAR) == 'h' \ || (CHAR) == 'z') -/* V9 chips can handle either endianness. */ -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ -{"big-endian", -MASK_LITTLE_ENDIAN, N_("Generate code for big endian") }, \ -{"little-endian", MASK_LITTLE_ENDIAN, N_("Generate code for little endian") }, - #undef BYTES_BIG_ENDIAN #define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h deleted file mode 100644 index 971f3583b7f..00000000000 --- a/gcc/config/sparc/sp86x-elf.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Definitions of target machine for GCC, for sparclite 86x w/o FPU. - Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc. - Contributed by Stan Cox (scox@cygnus.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. */ - -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (sparclite 86x)"); - -#undef TARGET_OS_CPP_BUILTINS -#define TARGET_OS_CPP_BUILTINS() \ - do \ - { \ - builtin_define ("__sparclite86x__"); \ - } \ - while (0) - -/* Enable app-regs and epilogue options. Do not enable the fpu. */ - -#undef TARGET_DEFAULT -#define TARGET_DEFAULT MASK_APP_REGS - -#undef ASM_SPEC -#define ASM_SPEC "%{v:-V} %{mlittle-endian-data:--little-endian-data} %(asm_cpu)" - -/* Enable US Software GOFAST library support. */ -#define US_SOFTWARE_GOFAST - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "crti.o%s crtbegin.o%s" - -#undef LINK_SPEC -#define LINK_SPEC "%{v:-V} %{mlittle-endian-data:-EL}" - -#undef BYTES_BIG_ENDIAN -#define BYTES_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN_DATA) -#undef WORDS_BIG_ENDIAN -#define WORDS_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN_DATA) - -/* Use __main method of constructor invocation */ -#undef INIT_SECTION_ASM_OP - -#define TARGET_LITTLE_ENDIAN_DATA (target_flags & MASK_LITTLE_ENDIAN) -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "little-endian-data", MASK_LITTLE_ENDIAN, N_("Use little-endian byte order for data")}, diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 1d791ccd1e3..2ab08fde5d6 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -299,6 +299,7 @@ static HOST_WIDE_INT frame_base_offset; /* 1 if the next opcode is to be specially indented. */ int sparc_indent_opcode = 0; +static bool sparc_handle_option (size_t, const char *, int); static void sparc_init_modes (void); static void scan_record_type (tree, int *, int *, int *); static int function_arg_slotno (const CUMULATIVE_ARGS *, enum machine_mode, @@ -314,10 +315,10 @@ static rtx sparc_builtin_saveregs (void); static int epilogue_renumber (rtx *, int); static bool sparc_assemble_integer (rtx, unsigned int, int); static int set_extends (rtx); -static void load_pic_register (void); +static void emit_pic_helper (void); +static void load_pic_register (bool); static int save_or_restore_regs (int, int, rtx, int, int); -static void emit_save_regs (void); -static void emit_restore_regs (void); +static void emit_save_or_restore_regs (int); static void sparc_asm_function_prologue (FILE *, HOST_WIDE_INT); static void sparc_asm_function_epilogue (FILE *, HOST_WIDE_INT); #ifdef OBJECT_FORMAT_ELF @@ -362,6 +363,7 @@ static bool sparc_pass_by_reference (CUMULATIVE_ARGS *, static int sparc_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); static void sparc_dwarf_handle_frame_unspec (const char *, rtx, int); +static void sparc_file_end (void); #ifdef SUBTARGET_ATTRIBUTE_TABLE const struct attribute_spec sparc_attribute_table[]; #endif @@ -370,6 +372,7 @@ const struct attribute_spec sparc_attribute_table[]; /* Code model option as passed by user. */ const char *sparc_cmodel_string; + /* Parsed value. */ enum cmodel sparc_cmodel; @@ -386,7 +389,10 @@ struct sparc_cpu_select sparc_select[] = /* CPU type. This is set from TARGET_CPU_DEFAULT and -m{cpu,tune}=xxx. */ enum processor_type sparc_cpu; - + +/* Whether an FPU option was specified. */ +static bool fpu_option_set = false; + /* Initialize the GCC target structure. */ /* The sparc default is to use .half rather than .short for aligned @@ -504,8 +510,45 @@ enum processor_type sparc_cpu; #undef TARGET_RELAXED_ORDERING #define TARGET_RELAXED_ORDERING SPARC_RELAXED_ORDERING +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION sparc_handle_option + +#undef TARGET_ASM_FILE_END +#define TARGET_ASM_FILE_END sparc_file_end + struct gcc_target targetm = TARGET_INITIALIZER; - + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +sparc_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) + { + case OPT_mfpu: + case OPT_mhard_float: + case OPT_msoft_float: + fpu_option_set = true; + break; + + case OPT_mcpu_: + sparc_select[1].string = arg; + break; + + case OPT_mtune_: + sparc_select[2].string = arg; + break; + + case OPT_mcmodel_: + sparc_cmodel_string = arg; + break; + } + + return true; +} + /* Validate and override various options, and do some machine dependent initialization. */ @@ -625,8 +668,7 @@ sparc_override_options (void) for (def = &cpu_default[0]; def->name; ++def) if (def->cpu == TARGET_CPU_DEFAULT) break; - if (! def->name) - abort (); + gcc_assert (def->name); sparc_select[0].string = def->name; for (sel = &sparc_select[0]; sel->name; ++sel) @@ -653,13 +695,9 @@ sparc_override_options (void) } /* If -mfpu or -mno-fpu was explicitly used, don't override with - the processor default. Clear MASK_FPU_SET to avoid confusing - the reverse mapping from switch values to names. */ - if (TARGET_FPU_SET) - { - target_flags = (target_flags & ~MASK_FPU) | fpu; - target_flags &= ~MASK_FPU_SET; - } + the processor default. */ + if (fpu_option_set) + target_flags = (target_flags & ~MASK_FPU) | fpu; /* Don't allow -mvis if FPU is disabled. */ if (! TARGET_FPU) @@ -766,56 +804,6 @@ v9_regcmp_p (enum rtx_code code) /* Operand constraints. */ -/* Return nonzero only if OP is a register of mode MODE, - or const0_rtx. */ - -int -reg_or_0_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - if (op == const0_rtx) - return 1; - if (GET_MODE (op) == VOIDmode && GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && CONST_DOUBLE_LOW (op) == 0) - return 1; - if (fp_zero_operand (op, mode)) - return 1; - return 0; -} - -/* Return nonzero only if OP is const1_rtx. */ - -int -const1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return op == const1_rtx; -} - -/* Nonzero if OP is a floating point value with value 0.0. */ - -int -fp_zero_operand (rtx op, enum machine_mode mode) -{ - enum mode_class mclass = GET_MODE_CLASS (GET_MODE (op)); - if (mclass != MODE_FLOAT && mclass != MODE_VECTOR_INT) - return 0; - return op == CONST0_RTX (mode); -} - -/* Nonzero if OP is a register operand in floating point register. */ - -int -fp_register_operand (rtx op, enum machine_mode mode) -{ - if (! register_operand (op, mode)) - return 0; - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - return GET_CODE (op) == REG && SPARC_FP_REG_P (REGNO (op)); -} - /* Nonzero if OP is a floating point constant which can be loaded into an integer register using a single sethi instruction. */ @@ -829,12 +817,8 @@ fp_sethi_p (rtx op) long i; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - if (REAL_VALUES_EQUAL (r, dconst0) && - ! REAL_VALUE_MINUS_ZERO (r)) - return 0; REAL_VALUE_TO_TARGET_SINGLE (r, i); - if (SPARC_SETHI_P (i)) - return 1; + return !SPARC_SIMM13_P (i) && SPARC_SETHI_P (i); } return 0; @@ -853,12 +837,8 @@ fp_mov_p (rtx op) long i; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - if (REAL_VALUES_EQUAL (r, dconst0) && - ! REAL_VALUE_MINUS_ZERO (r)) - return 0; REAL_VALUE_TO_TARGET_SINGLE (r, i); - if (SPARC_SIMM13_P (i)) - return 1; + return SPARC_SIMM13_P (i); } return 0; @@ -880,107 +860,13 @@ fp_high_losum_p (rtx op) long i; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - if (REAL_VALUES_EQUAL (r, dconst0) && - ! REAL_VALUE_MINUS_ZERO (r)) - return 0; REAL_VALUE_TO_TARGET_SINGLE (r, i); - if (! SPARC_SETHI_P (i) - && ! SPARC_SIMM13_P (i)) - return 1; + return !SPARC_SIMM13_P (i) && !SPARC_SETHI_P (i); } return 0; } -/* Nonzero if OP is an integer register. */ - -int -intreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (register_operand (op, SImode) - || (TARGET_ARCH64 && register_operand (op, DImode))); -} - -/* Nonzero if OP is a floating point condition code register. */ - -int -fcc_reg_operand (rtx op, enum machine_mode mode) -{ - /* This can happen when recog is called from combine. Op may be a MEM. - Fail instead of calling abort in this case. */ - if (GET_CODE (op) != REG) - return 0; - - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (mode == VOIDmode - && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) - return 0; - -#if 0 /* ??? ==> 1 when %fcc0-3 are pseudos first. See gen_compare_reg(). */ - if (reg_renumber == 0) - return REGNO (op) >= FIRST_PSEUDO_REGISTER; - return REGNO_OK_FOR_CCFP_P (REGNO (op)); -#else - return (unsigned) REGNO (op) - SPARC_FIRST_V9_FCC_REG < 4; -#endif -} - -/* Nonzero if OP is a floating point condition code fcc0 register. */ - -int -fcc0_reg_operand (rtx op, enum machine_mode mode) -{ - /* This can happen when recog is called from combine. Op may be a MEM. - Fail instead of calling abort in this case. */ - if (GET_CODE (op) != REG) - return 0; - - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (mode == VOIDmode - && (GET_MODE (op) != CCFPmode && GET_MODE (op) != CCFPEmode)) - return 0; - - return REGNO (op) == SPARC_FCC_REG; -} - -/* Nonzero if OP is an integer or floating point condition code register. */ - -int -icc_or_fcc_reg_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == REG && REGNO (op) == SPARC_ICC_REG) - { - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - if (mode == VOIDmode - && GET_MODE (op) != CCmode && GET_MODE (op) != CCXmode) - return 0; - return 1; - } - - return fcc_reg_operand (op, mode); -} - -/* Call insn on SPARC can take a PC-relative constant address, or any regular - memory address. */ - -int -call_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != MEM) - abort (); - op = XEXP (op, 0); - return (symbolic_operand (op, mode) || memory_address_p (Pmode, op)); -} - -int -call_operand_address (rtx op, enum machine_mode mode) -{ - return (symbolic_operand (op, mode) || memory_address_p (Pmode, op)); -} - /* If OP is a SYMBOL_REF of a thread-local symbol, return its TLS mode, otherwise return 0. */ @@ -991,628 +877,6 @@ tls_symbolic_operand (rtx op) return 0; return SYMBOL_REF_TLS_MODEL (op); } - -int -tgd_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_GLOBAL_DYNAMIC; -} - -int -tld_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_DYNAMIC; -} - -int -tie_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_INITIAL_EXEC; -} - -int -tle_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return tls_symbolic_operand (op) == TLS_MODEL_LOCAL_EXEC; -} - -/* Returns 1 if OP is either a symbol reference or a sum of a symbol - reference and a constant. */ - -int -symbolic_operand (register rtx op, enum machine_mode mode) -{ - enum machine_mode omode = GET_MODE (op); - - if (omode != mode && omode != VOIDmode && mode != VOIDmode) - return 0; - - switch (GET_CODE (op)) - { - case SYMBOL_REF: - return !SYMBOL_REF_TLS_MODEL (op); - - case LABEL_REF: - return 1; - - case CONST: - op = XEXP (op, 0); - return (((GET_CODE (XEXP (op, 0)) == SYMBOL_REF - && !SYMBOL_REF_TLS_MODEL (XEXP (op, 0))) - || GET_CODE (XEXP (op, 0)) == LABEL_REF) - && GET_CODE (XEXP (op, 1)) == CONST_INT); - - default: - return 0; - } -} - -/* Return truth value of statement that OP is a symbolic memory - operand of mode MODE. */ - -int -symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - if (GET_CODE (op) != MEM) - return 0; - op = XEXP (op, 0); - return ((GET_CODE (op) == SYMBOL_REF && !SYMBOL_REF_TLS_MODEL (op)) - || GET_CODE (op) == CONST || GET_CODE (op) == HIGH - || GET_CODE (op) == LABEL_REF); -} - -/* Return truth value of statement that OP is a LABEL_REF of mode MODE. */ - -int -label_ref_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) != LABEL_REF) - return 0; - if (GET_MODE (op) != mode) - return 0; - return 1; -} - -/* Return 1 if the operand is an argument used in generating pic references - in either the medium/low or medium/anywhere code models of sparc64. */ - -int -sp64_medium_pic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* Check for (const (minus (symbol_ref:GOT) - (const (minus (label) (pc))))). */ - if (GET_CODE (op) != CONST) - return 0; - op = XEXP (op, 0); - if (GET_CODE (op) != MINUS) - return 0; - if (GET_CODE (XEXP (op, 0)) != SYMBOL_REF) - return 0; - /* ??? Ensure symbol is GOT. */ - if (GET_CODE (XEXP (op, 1)) != CONST) - return 0; - if (GET_CODE (XEXP (XEXP (op, 1), 0)) != MINUS) - return 0; - return 1; -} - -/* Return 1 if the operand is a data segment reference. This includes - the readonly data segment, or in other words anything but the text segment. - This is needed in the medium/anywhere code model on v9. These values - are accessed with EMBMEDANY_BASE_REG. */ - -int -data_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case SYMBOL_REF : - return ! SYMBOL_REF_FUNCTION_P (op); - case PLUS : - /* Assume canonical format of symbol + constant. - Fall through. */ - case CONST : - return data_segment_operand (XEXP (op, 0), VOIDmode); - default : - return 0; - } -} - -/* Return 1 if the operand is a text segment reference. - This is needed in the medium/anywhere code model on v9. */ - -int -text_segment_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - switch (GET_CODE (op)) - { - case LABEL_REF : - return 1; - case SYMBOL_REF : - return SYMBOL_REF_FUNCTION_P (op); - case PLUS : - /* Assume canonical format of symbol + constant. - Fall through. */ - case CONST : - return text_segment_operand (XEXP (op, 0), VOIDmode); - default : - return 0; - } -} - -/* Return 1 if the operand is either a register or a memory operand that is - not symbolic. */ - -int -reg_or_nonsymb_mem_operand (register rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - - if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode)) - return 1; - - return 0; -} - -int -splittable_symbolic_memory_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != MEM) - return 0; - if (! symbolic_operand (XEXP (op, 0), Pmode)) - return 0; - return 1; -} - -int -splittable_immediate_memory_operand (rtx op, - enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != MEM) - return 0; - if (! immediate_operand (XEXP (op, 0), Pmode)) - return 0; - return 1; -} - -/* Return truth value of whether OP is EQ or NE. */ - -int -eq_or_neq (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == EQ || GET_CODE (op) == NE); -} - -/* Return 1 if this is a comparison operator, but not an EQ, NE, GEU, - or LTU for non-floating-point. We handle those specially. */ - -int -normal_comp_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code; - - if (!COMPARISON_P (op)) - return 0; - - if (GET_MODE (XEXP (op, 0)) == CCFPmode - || GET_MODE (XEXP (op, 0)) == CCFPEmode) - return 1; - - code = GET_CODE (op); - return (code != NE && code != EQ && code != GEU && code != LTU); -} - -/* Return 1 if this is a comparison operator. This allows the use of - MATCH_OPERATOR to recognize all the branch insns. */ - -int -noov_compare_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code; - - if (!COMPARISON_P (op)) - return 0; - - code = GET_CODE (op); - if (GET_MODE (XEXP (op, 0)) == CC_NOOVmode - || GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) - /* These are the only branches which work with CC_NOOVmode. */ - return (code == EQ || code == NE || code == GE || code == LT); - return 1; -} - -/* Return 1 if this is a 64-bit comparison operator. This allows the use of - MATCH_OPERATOR to recognize all the branch insns. */ - -int -noov_compare64_op (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code; - - if (! TARGET_V9) - return 0; - - if (!COMPARISON_P (op)) - return 0; - - code = GET_CODE (op); - if (GET_MODE (XEXP (op, 0)) == CCX_NOOVmode) - /* These are the only branches which work with CCX_NOOVmode. */ - return (code == EQ || code == NE || code == GE || code == LT); - return (GET_MODE (XEXP (op, 0)) == CCXmode); -} - -/* Nonzero if OP is a comparison operator suitable for use in v9 - conditional move or branch on register contents instructions. */ - -int -v9_regcmp_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code; - - if (!COMPARISON_P (op)) - return 0; - - code = GET_CODE (op); - return v9_regcmp_p (code); -} - -/* Return 1 if this is a SIGN_EXTEND or ZERO_EXTEND operation. */ - -int -extend_op (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND; -} - -/* Return nonzero if OP is an operator of mode MODE which can set - the condition codes explicitly. We do not include PLUS and MINUS - because these require CC_NOOVmode, which we handle explicitly. */ - -int -cc_arithop (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == AND - || GET_CODE (op) == IOR - || GET_CODE (op) == XOR) - return 1; - - return 0; -} - -/* Return nonzero if OP is an operator of mode MODE which can bitwise - complement its second operand and set the condition codes explicitly. */ - -int -cc_arithopn (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* XOR is not here because combine canonicalizes (xor (not ...) ...) - and (xor ... (not ...)) to (not (xor ...)). */ - return (GET_CODE (op) == AND - || GET_CODE (op) == IOR); -} - -/* Return true if OP is a register, or is a CONST_INT that can fit in a - signed 13 bit immediate field. This is an acceptable SImode operand for - most 3 address instructions. */ - -int -arith_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode)) - return 1; - if (GET_CODE (op) != CONST_INT) - return 0; - return SMALL_INT32 (op); -} - -/* Return true if OP is a constant 4096 */ - -int -arith_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return 0; - else - return INTVAL (op) == 4096; -} - -/* Return true if OP is suitable as second operand for add/sub */ - -int -arith_add_operand (rtx op, enum machine_mode mode) -{ - return arith_operand (op, mode) || arith_4096_operand (op, mode); -} - -/* Return true if OP is a CONST_INT or a CONST_DOUBLE which can fit in the - immediate field of OR and XOR instructions. Used for 64-bit - constant formation patterns. */ -int -const64_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT - && SPARC_SIMM13_P (INTVAL (op))) -#if HOST_BITS_PER_WIDE_INT != 64 - || (GET_CODE (op) == CONST_DOUBLE - && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)) - && (CONST_DOUBLE_HIGH (op) == - ((CONST_DOUBLE_LOW (op) & 0x80000000) != 0 ? - (HOST_WIDE_INT)-1 : 0))) -#endif - ); -} - -/* The same, but only for sethi instructions. */ -int -const64_high_operand (rtx op, enum machine_mode mode) -{ - return ((GET_CODE (op) == CONST_INT - && (INTVAL (op) & ~(HOST_WIDE_INT)0x3ff) != 0 - && SPARC_SETHI_P (INTVAL (op) & GET_MODE_MASK (mode)) - ) - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & ~(HOST_WIDE_INT)0x3ff) != 0 - && SPARC_SETHI_P (CONST_DOUBLE_LOW (op)))); -} - -/* Return true if OP is a register, or is a CONST_INT that can fit in a - signed 11 bit immediate field. This is an acceptable SImode operand for - the movcc instructions. */ - -int -arith11_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && SPARC_SIMM11_P (INTVAL (op)))); -} - -/* Return true if OP is a register, or is a CONST_INT that can fit in a - signed 10 bit immediate field. This is an acceptable SImode operand for - the movrcc instructions. */ - -int -arith10_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && SPARC_SIMM10_P (INTVAL (op)))); -} - -/* Return true if OP is a register, is a CONST_INT that fits in a 13 bit - immediate field, or is a CONST_DOUBLE whose both parts fit in a 13 bit - immediate field. - ARCH64: Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that - can fit in a 13 bit immediate field. This is an acceptable DImode operand - for most 3 address instructions. */ - -int -arith_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_INT && SMALL_INT (op)) - || (! TARGET_ARCH64 - && GET_CODE (op) == CONST_DOUBLE - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x1000) < 0x2000 - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_HIGH (op) + 0x1000) < 0x2000) - || (TARGET_ARCH64 - && GET_CODE (op) == CONST_DOUBLE - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x1000) < 0x2000 - && ((CONST_DOUBLE_HIGH (op) == -1 - && (CONST_DOUBLE_LOW (op) & 0x1000) == 0x1000) - || (CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & 0x1000) == 0)))); -} - -/* Return true if OP is a constant 4096 for DImode on ARCH64 */ - -int -arith_double_4096_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (TARGET_ARCH64 && - ((GET_CODE (op) == CONST_INT && INTVAL (op) == 4096) || - (GET_CODE (op) == CONST_DOUBLE && - CONST_DOUBLE_LOW (op) == 4096 && - CONST_DOUBLE_HIGH (op) == 0))); -} - -/* Return true if OP is suitable as second operand for add/sub in DImode */ - -int -arith_double_add_operand (rtx op, enum machine_mode mode) -{ - return arith_double_operand (op, mode) || arith_double_4096_operand (op, mode); -} - -/* Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that - can fit in an 11 bit immediate field. This is an acceptable DImode - operand for the movcc instructions. */ -/* ??? Replace with arith11_operand? */ - -int -arith11_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_DOUBLE - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned HOST_WIDE_INT) (CONST_DOUBLE_LOW (op) + 0x400) < 0x800 - && ((CONST_DOUBLE_HIGH (op) == -1 - && (CONST_DOUBLE_LOW (op) & 0x400) == 0x400) - || (CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & 0x400) == 0))) - || (GET_CODE (op) == CONST_INT - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x400) < 0x800)); -} - -/* Return true if OP is a register, or is a CONST_INT or CONST_DOUBLE that - can fit in an 10 bit immediate field. This is an acceptable DImode - operand for the movrcc instructions. */ -/* ??? Replace with arith10_operand? */ - -int -arith10_double_operand (rtx op, enum machine_mode mode) -{ - return (register_operand (op, mode) - || (GET_CODE (op) == CONST_DOUBLE - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned) (CONST_DOUBLE_LOW (op) + 0x200) < 0x400 - && ((CONST_DOUBLE_HIGH (op) == -1 - && (CONST_DOUBLE_LOW (op) & 0x200) == 0x200) - || (CONST_DOUBLE_HIGH (op) == 0 - && (CONST_DOUBLE_LOW (op) & 0x200) == 0))) - || (GET_CODE (op) == CONST_INT - && (GET_MODE (op) == mode || GET_MODE (op) == VOIDmode) - && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x200) < 0x400)); -} - -/* Return truth value of whether OP is an integer which fits the - range constraining immediate operands in most three-address insns, - which have a 13 bit immediate field. */ - -int -small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == CONST_INT && SMALL_INT (op)); -} - -int -small_int_or_double (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT && SMALL_INT (op)) - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)))); -} - -/* Recognize operand values for the umul instruction. That instruction sign - extends immediate values just like all other sparc instructions, but - interprets the extended result as an unsigned number. */ - -int -uns_small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ -#if HOST_BITS_PER_WIDE_INT > 32 - /* All allowed constants will fit a CONST_INT. */ - return (GET_CODE (op) == CONST_INT - && ((INTVAL (op) >= 0 && INTVAL (op) < 0x1000) - || (INTVAL (op) >= 0xFFFFF000 - && INTVAL (op) <= 0xFFFFFFFF))); -#else - return ((GET_CODE (op) == CONST_INT && (unsigned) INTVAL (op) < 0x1000) - || (GET_CODE (op) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (op) == 0 - && (unsigned) CONST_DOUBLE_LOW (op) - 0xFFFFF000 < 0x1000)); -#endif -} - -int -uns_arith_operand (rtx op, enum machine_mode mode) -{ - return register_operand (op, mode) || uns_small_int (op, mode); -} - -/* Return truth value of statement that OP is a call-clobbered register. */ -int -clobbered_register (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return (GET_CODE (op) == REG && call_used_regs[REGNO (op)]); -} - -/* Return 1 if OP is a valid operand for the source of a move insn. */ - -int -input_operand (rtx op, enum machine_mode mode) -{ - enum mode_class mclass; - - /* If both modes are non-void they must be the same. */ - if (mode != VOIDmode && GET_MODE (op) != VOIDmode && mode != GET_MODE (op)) - return 0; - - /* Allow any one instruction integer constant, and all CONST_INT - variants when we are working in DImode and !arch64. */ - if (GET_MODE_CLASS (mode) == MODE_INT - && ((GET_CODE (op) == CONST_INT - && (SPARC_SETHI_P (INTVAL (op) & GET_MODE_MASK (mode)) - || SPARC_SIMM13_P (INTVAL (op)) - || (mode == DImode - && ! TARGET_ARCH64))) - || (TARGET_ARCH64 - && GET_CODE (op) == CONST_DOUBLE - && ((CONST_DOUBLE_HIGH (op) == 0 - && SPARC_SETHI_P (CONST_DOUBLE_LOW (op))) - || -#if HOST_BITS_PER_WIDE_INT == 64 - (CONST_DOUBLE_HIGH (op) == 0 - && SPARC_SIMM13_P (CONST_DOUBLE_LOW (op))) -#else - (SPARC_SIMM13_P (CONST_DOUBLE_LOW (op)) - && (((CONST_DOUBLE_LOW (op) & 0x80000000) == 0 - && CONST_DOUBLE_HIGH (op) == 0) - || (CONST_DOUBLE_HIGH (op) == -1 - && CONST_DOUBLE_LOW (op) & 0x80000000) != 0)) -#endif - )))) - return 1; - - /* If !arch64 and this is a DImode const, allow it so that - the splits can be generated. */ - if (! TARGET_ARCH64 - && mode == DImode - && GET_CODE (op) == CONST_DOUBLE) - return 1; - - if (register_operand (op, mode)) - return 1; - - mclass = GET_MODE_CLASS (mode); - if ((mclass == MODE_FLOAT && GET_CODE (op) == CONST_DOUBLE) - || (mclass == MODE_VECTOR_INT && GET_CODE (op) == CONST_VECTOR)) - return 1; - - /* If this is a SUBREG, look inside so that we handle - paradoxical ones. */ - if (GET_CODE (op) == SUBREG) - op = SUBREG_REG (op); - - /* Check for valid MEM forms. */ - if (GET_CODE (op) == MEM) - return memory_address_p (mode, XEXP (op, 0)); - - return 0; -} - -/* Return 1 if OP is valid for the lhs of a compare insn. */ - -int -compare_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == ZERO_EXTRACT) - return (register_operand (XEXP (op, 0), mode) - && small_int_or_double (XEXP (op, 1), mode) - && small_int_or_double (XEXP (op, 2), mode) - /* This matches cmp_zero_extract. */ - && ((mode == SImode - && ((GET_CODE (XEXP (op, 2)) == CONST_INT - && INTVAL (XEXP (op, 2)) > 19) - || (GET_CODE (XEXP (op, 2)) == CONST_DOUBLE - && CONST_DOUBLE_LOW (XEXP (op, 2)) > 19))) - /* This matches cmp_zero_extract_sp64. */ - || (mode == DImode - && TARGET_ARCH64 - && ((GET_CODE (XEXP (op, 2)) == CONST_INT - && INTVAL (XEXP (op, 2)) > 51) - || (GET_CODE (XEXP (op, 2)) == CONST_DOUBLE - && CONST_DOUBLE_LOW (XEXP (op, 2)) > 51))))); - else - return register_operand (op, mode); -} - /* We know it can't be done in one insn when we get here, the movsi expander guarantees this. */ @@ -1622,16 +886,6 @@ sparc_emit_set_const32 (rtx op0, rtx op1) enum machine_mode mode = GET_MODE (op0); rtx temp; - if (GET_CODE (op1) == CONST_INT) - { - HOST_WIDE_INT value = INTVAL (op1); - - if (SPARC_SETHI_P (value & GET_MODE_MASK (mode)) - || SPARC_SIMM13_P (value)) - abort (); - } - - /* Full 2-insn decomposition is needed. */ if (reload_in_progress || reload_completed) temp = op0; else @@ -1639,20 +893,15 @@ sparc_emit_set_const32 (rtx op0, rtx op1) if (GET_CODE (op1) == CONST_INT) { + gcc_assert (!small_int_operand (op1, mode) + && !const_high_operand (op1, mode)); + /* Emit them as real moves instead of a HIGH/LO_SUM, this way CSE can see everything and reuse intermediate values if it wants. */ - if (TARGET_ARCH64 - && HOST_BITS_PER_WIDE_INT != 64 - && (INTVAL (op1) & 0x80000000) != 0) - emit_insn (gen_rtx_SET - (VOIDmode, temp, - immed_double_const (INTVAL (op1) & ~(HOST_WIDE_INT)0x3ff, - 0, DImode))); - else - emit_insn (gen_rtx_SET (VOIDmode, temp, - GEN_INT (INTVAL (op1) - & ~(HOST_WIDE_INT)0x3ff))); + emit_insn (gen_rtx_SET (VOIDmode, temp, + GEN_INT (INTVAL (op1) + & ~(HOST_WIDE_INT)0x3ff))); emit_insn (gen_rtx_SET (VOIDmode, op0, @@ -1666,7 +915,6 @@ sparc_emit_set_const32 (rtx op0, rtx op1) gen_rtx_HIGH (mode, op1))); emit_insn (gen_rtx_SET (VOIDmode, op0, gen_rtx_LO_SUM (mode, temp, op1))); - } } @@ -1767,10 +1015,8 @@ sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) it TImode). Pick the other one to use as our scratch. */ if (rtx_equal_p (temp, op0)) { - if (ti_temp) - temp = gen_rtx_REG (DImode, REGNO (temp) + 1); - else - abort(); + gcc_assert (ti_temp); + temp = gen_rtx_REG (DImode, REGNO (temp) + 1); } temp1 = op0; temp2 = temp; /* op0 is _not_ allowed, see above. */ @@ -1841,10 +1087,8 @@ sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) it TImode). Pick the other one to use as our scratch. */ if (rtx_equal_p (temp, op0)) { - if (ti_temp) - temp = gen_rtx_REG (DImode, REGNO (temp) + 1); - else - abort(); + gcc_assert (ti_temp); + temp = gen_rtx_REG (DImode, REGNO (temp) + 1); } temp1 = op0; temp2 = temp; /* op0 is _not_ allowed, see above. */ @@ -1873,56 +1117,52 @@ sparc_emit_set_symbolic_const64 (rtx op0, rtx op1, rtx temp) break; default: - abort(); + gcc_unreachable (); } } +#if HOST_BITS_PER_WIDE_INT == 32 +void +sparc_emit_set_const64 (rtx op0 ATTRIBUTE_UNUSED, rtx op1 ATTRIBUTE_UNUSED) +{ + gcc_unreachable (); +} +#else /* These avoid problems when cross compiling. If we do not go through all this hair then the optimizer will see invalid REG_EQUAL notes or in some cases none at all. */ -static void sparc_emit_set_safe_HIGH64 (rtx, HOST_WIDE_INT); +static rtx gen_safe_HIGH64 (rtx, HOST_WIDE_INT); static rtx gen_safe_SET64 (rtx, HOST_WIDE_INT); static rtx gen_safe_OR64 (rtx, HOST_WIDE_INT); static rtx gen_safe_XOR64 (rtx, HOST_WIDE_INT); -#if HOST_BITS_PER_WIDE_INT == 64 -#define GEN_HIGHINT64(__x) GEN_INT ((__x) & ~(HOST_WIDE_INT)0x3ff) -#define GEN_INT64(__x) GEN_INT (__x) -#else -#define GEN_HIGHINT64(__x) \ - immed_double_const ((__x) & ~(HOST_WIDE_INT)0x3ff, 0, DImode) -#define GEN_INT64(__x) \ - immed_double_const ((__x) & 0xffffffff, \ - ((__x) & 0x80000000 ? -1 : 0), DImode) -#endif - /* The optimizer is not to assume anything about exactly which bits are set for a HIGH, they are unspecified. Unfortunately this leads to many missed optimizations during CSE. We mask out the non-HIGH bits, and matches a plain movdi, to alleviate this problem. */ -static void -sparc_emit_set_safe_HIGH64 (rtx dest, HOST_WIDE_INT val) +static rtx +gen_safe_HIGH64 (rtx dest, HOST_WIDE_INT val) { - emit_insn (gen_rtx_SET (VOIDmode, dest, GEN_HIGHINT64 (val))); + return gen_rtx_SET (VOIDmode, dest, GEN_INT (val & ~(HOST_WIDE_INT)0x3ff)); } static rtx gen_safe_SET64 (rtx dest, HOST_WIDE_INT val) { - return gen_rtx_SET (VOIDmode, dest, GEN_INT64 (val)); + return gen_rtx_SET (VOIDmode, dest, GEN_INT (val)); } static rtx gen_safe_OR64 (rtx src, HOST_WIDE_INT val) { - return gen_rtx_IOR (DImode, src, GEN_INT64 (val)); + return gen_rtx_IOR (DImode, src, GEN_INT (val)); } static rtx gen_safe_XOR64 (rtx src, HOST_WIDE_INT val) { - return gen_rtx_XOR (DImode, src, GEN_INT64 (val)); + return gen_rtx_XOR (DImode, src, GEN_INT (val)); } /* Worker routines for 64-bit constant formation on arch64. @@ -1947,7 +1187,7 @@ sparc_emit_set_const64_quick1 (rtx op0, rtx temp, else high_bits = low_bits; - sparc_emit_set_safe_HIGH64 (temp, high_bits); + emit_insn (gen_safe_HIGH64 (temp, high_bits)); if (!is_neg) { emit_insn (gen_rtx_SET (VOIDmode, op0, @@ -1986,7 +1226,7 @@ sparc_emit_set_const64_quick2 (rtx op0, rtx temp, if ((high_bits & 0xfffffc00) != 0) { - sparc_emit_set_safe_HIGH64 (temp, high_bits); + emit_insn (gen_safe_HIGH64 (temp, high_bits)); if ((high_bits & ~0xfffffc00) != 0) emit_insn (gen_rtx_SET (VOIDmode, op0, gen_safe_OR64 (temp, (high_bits & 0x3ff)))); @@ -2030,7 +1270,7 @@ sparc_emit_set_const64_longway (rtx op0, rtx temp, if ((high_bits & 0xfffffc00) != 0) { - sparc_emit_set_safe_HIGH64 (temp, high_bits); + emit_insn (gen_safe_HIGH64 (temp, high_bits)); if ((high_bits & ~0xfffffc00) != 0) emit_insn (gen_rtx_SET (VOIDmode, sub_temp, @@ -2054,7 +1294,7 @@ sparc_emit_set_const64_longway (rtx op0, rtx temp, gen_rtx_ASHIFT (DImode, sub_temp, GEN_INT (32)))); - sparc_emit_set_safe_HIGH64 (temp2, low_bits); + emit_insn (gen_safe_HIGH64 (temp2, low_bits)); if ((low_bits & ~0xfffffc00) != 0) { emit_insn (gen_rtx_SET (VOIDmode, temp3, @@ -2161,9 +1401,7 @@ analyze_64bit_constant (unsigned HOST_WIDE_INT high_bits, } /* If there are no bits set this should have gone out as one instruction! */ - if (lowest_bit_set == -1 - || highest_bit_set == -1) - abort (); + gcc_assert (lowest_bit_set != -1 && highest_bit_set != -1); all_bits_between_are_set = 1; for (i = lowest_bit_set; i <= highest_bit_set; i++) { @@ -2233,8 +1471,7 @@ create_simple_focus_bits (unsigned HOST_WIDE_INT high_bits, lo = 0; hi = ((high_bits >> (lowest_bit_set - 32)) << shift); } - if (hi & lo) - abort (); + gcc_assert (! (hi & lo)); return (hi | lo); } @@ -2251,22 +1488,19 @@ sparc_emit_set_const64 (rtx op0, rtx op1) rtx temp = 0; /* Sanity check that we know what we are working with. */ - if (! TARGET_ARCH64) - abort (); + gcc_assert (TARGET_ARCH64); if (GET_CODE (op0) != SUBREG) { - if (GET_CODE (op0) != REG - || (REGNO (op0) >= SPARC_FIRST_FP_REG - && REGNO (op0) <= SPARC_LAST_V9_FP_REG)) - abort (); + gcc_assert (GET_CODE (op0) == REG + && (REGNO (op0) < SPARC_FIRST_FP_REG + || REGNO (op0) > SPARC_LAST_V9_FP_REG)); } if (reload_in_progress || reload_completed) temp = op0; - if (GET_CODE (op1) != CONST_DOUBLE - && GET_CODE (op1) != CONST_INT) + if (GET_CODE (op1) != CONST_INT) { sparc_emit_set_symbolic_const64 (op0, op1, temp); return; @@ -2275,28 +1509,8 @@ sparc_emit_set_const64 (rtx op0, rtx op1) if (! temp) temp = gen_reg_rtx (DImode); - if (GET_CODE (op1) == CONST_DOUBLE) - { -#if HOST_BITS_PER_WIDE_INT == 64 - high_bits = (CONST_DOUBLE_LOW (op1) >> 32) & 0xffffffff; - low_bits = CONST_DOUBLE_LOW (op1) & 0xffffffff; -#else - high_bits = CONST_DOUBLE_HIGH (op1); - low_bits = CONST_DOUBLE_LOW (op1); -#endif - } - else - { -#if HOST_BITS_PER_WIDE_INT == 64 - high_bits = ((INTVAL (op1) >> 32) & 0xffffffff); - low_bits = (INTVAL (op1) & 0xffffffff); -#else - high_bits = ((INTVAL (op1) < 0) ? - 0xffffffff : - 0x00000000); - low_bits = INTVAL (op1); -#endif - } + high_bits = ((INTVAL (op1) >> 32) & 0xffffffff); + low_bits = (INTVAL (op1) & 0xffffffff); /* low_bits bits 0 --> 31 high_bits bits 32 --> 63 */ @@ -2335,8 +1549,8 @@ sparc_emit_set_const64 (rtx op0, rtx op1) else if (lowest_bit_set == 0) shift = -(63 - highest_bit_set); - if (! SPARC_SIMM13_P (the_const)) - abort (); + gcc_assert (SPARC_SIMM13_P (the_const)); + gcc_assert (shift != 0); emit_insn (gen_safe_SET64 (temp, the_const)); if (shift > 0) @@ -2351,8 +1565,6 @@ sparc_emit_set_const64 (rtx op0, rtx op1) gen_rtx_LSHIFTRT (DImode, temp, GEN_INT (-shift)))); - else - abort (); return; } @@ -2368,10 +1580,10 @@ sparc_emit_set_const64 (rtx op0, rtx op1) create_simple_focus_bits (high_bits, low_bits, lowest_bit_set, 10); - if (! SPARC_SETHI_P (focus_bits)) - abort (); + gcc_assert (SPARC_SETHI_P (focus_bits)); + gcc_assert (lowest_bit_set != 10); - sparc_emit_set_safe_HIGH64 (temp, focus_bits); + emit_insn (gen_safe_HIGH64 (temp, focus_bits)); /* If lowest_bit_set == 10 then a sethi alone could have done it. */ if (lowest_bit_set < 10) @@ -2384,8 +1596,6 @@ sparc_emit_set_const64 (rtx op0, rtx op1) op0, gen_rtx_ASHIFT (DImode, temp, GEN_INT (lowest_bit_set - 10)))); - else - abort (); return; } @@ -2428,26 +1638,20 @@ sparc_emit_set_const64 (rtx op0, rtx op1) || (((~high_bits) & 0xffffffff) == 0xffffffff && ((~low_bits) & 0x80000000) != 0)) { - int fast_int = (~low_bits & 0xffffffff); + unsigned HOST_WIDE_INT fast_int = (~low_bits & 0xffffffff); if ((SPARC_SETHI_P (fast_int) && (~high_bits & 0xffffffff) == 0) || SPARC_SIMM13_P (fast_int)) emit_insn (gen_safe_SET64 (temp, fast_int)); else - sparc_emit_set_const64 (temp, GEN_INT64 (fast_int)); + sparc_emit_set_const64 (temp, GEN_INT (fast_int)); } else { rtx negated_const; -#if HOST_BITS_PER_WIDE_INT == 64 negated_const = GEN_INT (((~low_bits) & 0xfffffc00) | (((HOST_WIDE_INT)((~high_bits) & 0xffffffff))<<32)); -#else - negated_const = immed_double_const ((~low_bits) & 0xfffffc00, - (~high_bits) & 0xffffffff, - DImode); -#endif sparc_emit_set_const64 (temp, negated_const); } @@ -2483,9 +1687,7 @@ sparc_emit_set_const64 (rtx op0, rtx op1) lowest_bit_set, 0); /* We can't get here in this state. */ - if (highest_bit_set < 32 - || lowest_bit_set >= 32) - abort (); + gcc_assert (highest_bit_set >= 32 && lowest_bit_set < 32); /* So what we know is that the set bits straddle the middle of the 64-bit word. */ @@ -2514,6 +1716,7 @@ sparc_emit_set_const64 (rtx op0, rtx op1) #endif sparc_emit_set_const64_longway (op0, temp, high_bits, low_bits); } +#endif /* HOST_BITS_PER_WIDE_INT == 32 */ /* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE, return the mode to be used for the comparison. For floating-point, @@ -2547,7 +1750,7 @@ select_cc_mode (enum rtx_code op, rtx x, rtx y ATTRIBUTE_UNUSED) return CCFPEmode; default: - abort (); + gcc_unreachable (); } } else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS @@ -2722,7 +1925,7 @@ gen_v9_scc (enum rtx_code compare_code, register rtx *operands) case CCFPmode : break; default : - abort (); + gcc_unreachable (); } emit_insn (gen_rtx_SET (VOIDmode, operands[0], const0_rtx)); emit_insn (gen_rtx_SET (VOIDmode, operands[0], @@ -2776,8 +1979,7 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands) int i; /* We only expect to be called for conversions, unary, and binary ops. */ - if (nargs < 2 || nargs > 3) - abort (); + gcc_assert (nargs == 2 || nargs == 3); for (i = 0; i < nargs; ++i) { @@ -2840,8 +2042,7 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands) { rtx ret; - if (nargs != 2) - abort (); + gcc_assert (nargs == 2); ret = emit_library_call_value (func_sym, operands[0], LCT_NORMAL, GET_MODE (operands[0]), 1, @@ -2874,7 +2075,7 @@ emit_soft_tfmode_binop (enum rtx_code code, rtx *operands) func = "_Qp_div"; break; default: - abort (); + gcc_unreachable (); } emit_soft_tfmode_libcall (func, 3, operands); @@ -2885,14 +2086,8 @@ emit_soft_tfmode_unop (enum rtx_code code, rtx *operands) { const char *func; - switch (code) - { - case SQRT: - func = "_Qp_sqrt"; - break; - default: - abort (); - } + gcc_assert (code == SQRT); + func = "_Qp_sqrt"; emit_soft_tfmode_libcall (func, 2, operands); } @@ -2914,7 +2109,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_dtoq"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2928,7 +2123,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_qtod"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2942,7 +2137,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_xtoq"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2956,7 +2151,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_uxtoq"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2970,7 +2165,7 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_qtox"; break; default: - abort (); + gcc_unreachable (); } break; @@ -2984,12 +2179,12 @@ emit_soft_tfmode_cvt (enum rtx_code code, rtx *operands) func = "_Qp_qtoux"; break; default: - abort (); + gcc_unreachable (); } break; default: - abort (); + gcc_unreachable (); } emit_soft_tfmode_libcall (func, 2, operands); @@ -3351,17 +2546,16 @@ sparc_cannot_force_const_mem (rtx x) case UNSPEC: return true; default: - abort (); + gcc_unreachable (); } } -/* The table we use to reference PIC data. */ +/* PIC support. */ +static GTY(()) char pic_helper_symbol_name[256]; +static GTY(()) rtx pic_helper_symbol; +static GTY(()) bool pic_helper_emitted_p = false; static GTY(()) rtx global_offset_table; -/* The function we use to get at it. */ -static GTY(()) rtx add_pc_to_pic_symbol; -static GTY(()) char add_pc_to_pic_symbol_name[256]; - /* Ensure that we are not using patterns that are not OK with PIC. */ int @@ -3370,14 +2564,13 @@ check_pic (int i) switch (flag_pic) { case 1: - if (GET_CODE (recog_data.operand[i]) == SYMBOL_REF - || (GET_CODE (recog_data.operand[i]) == CONST - && ! (GET_CODE (XEXP (recog_data.operand[i], 0)) == MINUS - && (XEXP (XEXP (recog_data.operand[i], 0), 0) - == global_offset_table) - && (GET_CODE (XEXP (XEXP (recog_data.operand[i], 0), 1)) - == CONST)))) - abort (); + gcc_assert (GET_CODE (recog_data.operand[i]) != SYMBOL_REF + && (GET_CODE (recog_data.operand[i]) != CONST + || (GET_CODE (XEXP (recog_data.operand[i], 0)) == MINUS + && (XEXP (XEXP (recog_data.operand[i], 0), 0) + == global_offset_table) + && (GET_CODE (XEXP (XEXP (recog_data.operand[i], 0), 1)) + == CONST)))); case 2: default: return 1; @@ -3436,7 +2629,7 @@ legitimate_constant_p (rtx x) && (GET_MODE (x) == SFmode || GET_MODE (x) == DFmode || GET_MODE (x) == TFmode) - && fp_zero_operand (x, GET_MODE (x))) + && const_zero_operand (x, GET_MODE (x))) return true; return false; @@ -3496,7 +2689,7 @@ legitimate_pic_operand_p (rtx x) int legitimate_address_p (enum machine_mode mode, rtx addr, int strict) { - rtx rs1 = NULL, rs2 = NULL, imm1 = NULL, imm2; + rtx rs1 = NULL, rs2 = NULL, imm1 = NULL; if (REG_P (addr) || GET_CODE (addr) == SUBREG) rs1 = addr; @@ -3560,7 +2753,6 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) && ! TARGET_CM_MEDMID && RTX_OK_FOR_OLO10_P (rs2)) { - imm2 = rs2; rs2 = NULL; imm1 = XEXP (rs1, 1); rs1 = XEXP (rs1, 0); @@ -3576,25 +2768,10 @@ legitimate_address_p (enum machine_mode mode, rtx addr, int strict) if (! CONSTANT_P (imm1) || tls_symbolic_operand (rs1)) return 0; - if (USE_AS_OFFSETABLE_LO10) - { - /* We can't allow TFmode, because an offset greater than or equal to - the alignment (8) may cause the LO_SUM to overflow if !v9. */ - if (mode == TFmode && ! TARGET_V9) - return 0; - } - else - { - /* We prohibit LO_SUM for TFmode when there are no quad move insns - and we consequently need to split. We do this because LO_SUM - is not an offsettable address. If we get the situation in reload - where source and destination of a movtf pattern are both MEMs with - LO_SUM address, then only one of them gets converted to an - offsettable address. */ - if (mode == TFmode - && ! (TARGET_FPU && TARGET_ARCH64 && TARGET_HARD_QUAD)) - return 0; - } + /* We can't allow TFmode in 32-bit mode, because an offset greater + than the alignment (8) may cause the LO_SUM to overflow. */ + if (mode == TFmode && TARGET_ARCH32) + return 0; } else if (GET_CODE (addr) == CONST_INT && SMALL_INT (addr)) return 1; @@ -3672,8 +2849,7 @@ legitimize_tls_address (rtx addr) { rtx temp1, temp2, temp3, ret, o0, got, insn; - if (no_new_pseudos) - abort (); + gcc_assert (! no_new_pseudos); if (GET_CODE (addr) == SYMBOL_REF) switch (SYMBOL_REF_TLS_MODEL (addr)) @@ -3789,11 +2965,11 @@ legitimize_tls_address (rtx addr) break; default: - abort (); + gcc_unreachable (); } else - abort (); /* for now ... */ + gcc_unreachable (); /* for now ... */ return ret; } @@ -3815,10 +2991,8 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, if (reg == 0) { - if (reload_in_progress || reload_completed) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (! reload_in_progress && ! reload_completed); + reg = gen_reg_rtx (Pmode); } if (flag_pic == 2) @@ -3869,20 +3043,14 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, if (reg == 0) { - if (reload_in_progress || reload_completed) - abort (); - else - reg = gen_reg_rtx (Pmode); + gcc_assert (! reload_in_progress && ! reload_completed); + reg = gen_reg_rtx (Pmode); } - if (GET_CODE (XEXP (orig, 0)) == PLUS) - { - base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); - offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, - base == reg ? 0 : reg); - } - else - abort (); + gcc_assert (GET_CODE (XEXP (orig, 0)) == PLUS); + base = legitimize_pic_address (XEXP (XEXP (orig, 0), 0), Pmode, reg); + offset = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode, + base == reg ? 0 : reg); if (GET_CODE (offset) == CONST_INT) { @@ -3892,7 +3060,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, offset = force_reg (Pmode, offset); else /* If we reach here, then something is seriously wrong. */ - abort (); + gcc_unreachable (); } return gen_rtx_PLUS (Pmode, base, offset); } @@ -3951,46 +3119,57 @@ legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode) return x; } -/* Emit the special PIC prologue. */ +/* Emit the special PIC helper function. */ static void -load_pic_register (void) +emit_pic_helper (void) { - int orig_flag_pic = flag_pic; + const char *pic_name = reg_names[REGNO (pic_offset_table_rtx)]; + int align; - /* If we haven't emitted the special helper function, do so now. */ - if (add_pc_to_pic_symbol_name[0] == 0) - { - const char *pic_name = reg_names[REGNO (pic_offset_table_rtx)]; - int align; + text_section (); - ASM_GENERATE_INTERNAL_LABEL (add_pc_to_pic_symbol_name, "LADDPC", 0); - text_section (); + align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); + if (align > 0) + ASM_OUTPUT_ALIGN (asm_out_file, align); + ASM_OUTPUT_LABEL (asm_out_file, pic_helper_symbol_name); + if (flag_delayed_branch) + fprintf (asm_out_file, "\tjmp\t%%o7+8\n\t add\t%%o7, %s, %s\n", + pic_name, pic_name); + else + fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp\t%%o7+8\n\t nop\n", + pic_name, pic_name); - align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); - if (align > 0) - ASM_OUTPUT_ALIGN (asm_out_file, align); - ASM_OUTPUT_LABEL (asm_out_file, add_pc_to_pic_symbol_name); - if (flag_delayed_branch) - fprintf (asm_out_file, "\tjmp %%o7+8\n\t add\t%%o7, %s, %s\n", - pic_name, pic_name); - else - fprintf (asm_out_file, "\tadd\t%%o7, %s, %s\n\tjmp %%o7+8\n\t nop\n", - pic_name, pic_name); + pic_helper_emitted_p = true; +} + +/* Emit code to load the PIC register. */ + +static void +load_pic_register (bool delay_pic_helper) +{ + int orig_flag_pic = flag_pic; + + /* If we haven't initialized the special PIC symbols, do so now. */ + if (!pic_helper_symbol_name[0]) + { + ASM_GENERATE_INTERNAL_LABEL (pic_helper_symbol_name, "LADDPC", 0); + pic_helper_symbol = gen_rtx_SYMBOL_REF (Pmode, pic_helper_symbol_name); + global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); } - /* Initialize every time through, since we can't easily - know this to be permanent. */ - global_offset_table = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_"); - add_pc_to_pic_symbol = gen_rtx_SYMBOL_REF (Pmode, add_pc_to_pic_symbol_name); + /* If we haven't emitted the special PIC helper function, do so now unless + we are requested to delay it. */ + if (!delay_pic_helper && !pic_helper_emitted_p) + emit_pic_helper (); flag_pic = 0; if (TARGET_ARCH64) emit_insn (gen_load_pcrel_symdi (pic_offset_table_rtx, global_offset_table, - add_pc_to_pic_symbol)); + pic_helper_symbol)); else emit_insn (gen_load_pcrel_symsi (pic_offset_table_rtx, global_offset_table, - add_pc_to_pic_symbol)); + pic_helper_symbol)); flag_pic = orig_flag_pic; /* Need to emit this whether or not we obey regdecls, @@ -4013,7 +3192,8 @@ mem_min_alignment (rtx mem, int desired) return 0; /* Obviously... */ - if (MEM_ALIGN (mem) / BITS_PER_UNIT >= (unsigned)desired) + if (!TARGET_UNALIGNED_DOUBLES + && MEM_ALIGN (mem) / BITS_PER_UNIT >= (unsigned)desired) return 1; /* ??? The rest of the function predates MEM_ALIGN so @@ -4327,10 +3507,9 @@ sparc_compute_frame_size (HOST_WIDE_INT size, int leaf_function_p) /* Make sure nothing can clobber our register windows. If a SAVE must be done, or there is a stack-local variable, - the register window area must be allocated. - ??? For v8 we apparently need an additional 8 bytes of reserved space. */ + the register window area must be allocated. */ if (! leaf_function_p || size > 0) - actual_fsize += (16 * UNITS_PER_WORD) + (TARGET_ARCH64 ? 0 : 8); + actual_fsize += FIRST_PARM_OFFSET (current_function_decl); return SPARC_STACK_ALIGN (actual_fsize); } @@ -4442,14 +3621,14 @@ save_or_restore_regs (int low, int high, rtx base, int offset, int action) /* Emit code to save call-saved registers. */ static void -emit_save_regs (void) +emit_save_or_restore_regs (int action) { HOST_WIDE_INT offset; rtx base; offset = frame_base_offset - apparent_fsize; - if (offset < -4096 || offset + num_gfregs * 4 > 4096) + if (offset < -4096 || offset + num_gfregs * 4 > 4095) { /* ??? This might be optimized a little as %g1 might already have a value close enough that a single add insn will do. */ @@ -4467,34 +3646,8 @@ emit_save_regs (void) else base = frame_base_reg; - offset = save_or_restore_regs (0, 8, base, offset, SORR_SAVE); - save_or_restore_regs (32, TARGET_V9 ? 96 : 64, base, offset, SORR_SAVE); -} - -/* Emit code to restore call-saved registers. */ - -static void -emit_restore_regs (void) -{ - HOST_WIDE_INT offset; - rtx base; - - offset = frame_base_offset - apparent_fsize; - - if (offset < -4096 || offset + num_gfregs * 4 > 4096 - 8 /*double*/) - { - base = gen_rtx_REG (Pmode, 1); - emit_move_insn (base, GEN_INT (offset)); - emit_insn (gen_rtx_SET (VOIDmode, - base, - gen_rtx_PLUS (Pmode, frame_base_reg, base))); - offset = 0; - } - else - base = frame_base_reg; - - offset = save_or_restore_regs (0, 8, base, offset, SORR_RESTORE); - save_or_restore_regs (32, TARGET_V9 ? 96 : 64, base, offset, SORR_RESTORE); + offset = save_or_restore_regs (0, 8, base, offset, action); + save_or_restore_regs (32, TARGET_V9 ? 96 : 64, base, offset, action); } /* Generate a save_register_window insn. */ @@ -4633,29 +3786,22 @@ sparc_expand_prologue (void) RTX_FRAME_RELATED_P (XVECEXP (PATTERN (insn), 0, i)) = 1; } - /* Call-saved registers are saved just above the outgoing argument area. */ if (num_gfregs) - emit_save_regs (); + emit_save_or_restore_regs (SORR_SAVE); /* Load the PIC register if needed. */ if (flag_pic && current_function_uses_pic_offset_table) - load_pic_register (); + load_pic_register (false); } /* This function generates the assembly code for function entry, which boils - down to emitting the necessary .register directives. - - ??? Historical cruft: "On SPARC, move-double insns between fpu and cpu need - an 8-byte block of memory. If any fpu reg is used in the function, we - allocate such a block here, at the bottom of the frame, just in case it's - needed." Could this explain the -8 in emit_restore_regs? */ + down to emitting the necessary .register directives. */ static void sparc_asm_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) { /* Check that the assumption we made in sparc_expand_prologue is valid. */ - if (sparc_leaf_function_p != current_function_uses_only_leaf_regs) - abort(); + gcc_assert (sparc_leaf_function_p == current_function_uses_only_leaf_regs); sparc_output_scratch_registers (file); } @@ -4667,7 +3813,7 @@ void sparc_expand_epilogue (void) { if (num_gfregs) - emit_restore_regs (); + emit_save_or_restore_regs (SORR_RESTORE); if (actual_fsize == 0) /* do nothing. */ ; @@ -4739,8 +3885,7 @@ output_restore (rtx pat) return; } - if (GET_CODE (pat) != SET) - abort (); + gcc_assert (GET_CODE (pat) == SET); operands[0] = SET_DEST (pat); pat = SET_SRC (pat); @@ -4759,8 +3904,7 @@ output_restore (rtx pat) break; case ASHIFT: operands[1] = XEXP (pat, 0); - if (XEXP (pat, 1) != const1_rtx) - abort(); + gcc_assert (XEXP (pat, 1) == const1_rtx); output_asm_insn (" restore %r1, %r1, %Y0", operands); break; default: @@ -4782,8 +3926,7 @@ output_return (rtx insn) semantics of restore/return. We simply output the jump to the return address and the insn in the delay slot (if any). */ - if (current_function_calls_eh_return) - abort (); + gcc_assert (! current_function_calls_eh_return); return "jmp\t%%o7+%)%#"; } @@ -4798,8 +3941,7 @@ output_return (rtx insn) { /* If the function uses __builtin_eh_return, the eh_return machinery occupies the delay slot. */ - if (final_sequence) - abort (); + gcc_assert (! final_sequence); if (! flag_delayed_branch) fputs ("\tadd\t%fp, %g1, %fp\n", asm_out_file); @@ -4819,8 +3961,7 @@ output_return (rtx insn) rtx delay, pat; delay = NEXT_INSN (insn); - if (! delay) - abort (); + gcc_assert (delay); pat = PATTERN (delay); @@ -4859,8 +4000,7 @@ output_sibcall (rtx insn, rtx call_operand) { rtx operands[1]; - if (! flag_delayed_branch) - abort(); + gcc_assert (flag_delayed_branch); operands[0] = call_operand; @@ -4870,8 +4010,7 @@ output_sibcall (rtx insn, rtx call_operand) register window. We simply output the jump to the function and the insn in the delay slot (if any). */ - if (LEAF_SIBCALL_SLOT_RESERVED_P && final_sequence) - abort(); + gcc_assert (!(LEAF_SIBCALL_SLOT_RESERVED_P && final_sequence)); if (final_sequence) output_asm_insn ("sethi\t%%hi(%a0), %%g1\n\tjmp\t%%g1 + %%lo(%a0)%#", @@ -4893,8 +4032,7 @@ output_sibcall (rtx insn, rtx call_operand) if (final_sequence) { rtx delay = NEXT_INSN (insn); - if (! delay) - abort (); + gcc_assert (delay); output_restore (PATTERN (delay)); @@ -5156,8 +4294,7 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE) { /* The SPARC port defines no floating-point vector modes. */ - if (mode != BLKmode) - abort (); + gcc_assert (mode == BLKmode); } else { @@ -5165,8 +4302,7 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, mode or an integral mode, because we are guaranteed by pass_by_reference that their size is not greater than 16 bytes and TImode is 16-byte wide. */ - if (mode == BLKmode) - abort (); + gcc_assert (mode != BLKmode); /* Vector integers are handled like floats according to the Sun VIS SDK. */ @@ -5203,8 +4339,7 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, /* MODE is VOIDmode when generating the actual call. */ return -1; - if (mode != BLKmode) - abort (); + gcc_assert (mode == BLKmode); /* For SPARC64, objects requiring 16-byte alignment get it. */ if (TARGET_ARCH64 @@ -5253,7 +4388,7 @@ function_arg_slotno (const struct sparc_args *cum, enum machine_mode mode, break; default : - abort (); + gcc_unreachable (); } *pregno = regno; @@ -5610,8 +4745,7 @@ function_arg_record_value (tree type, enum machine_mode mode, if (nregs + slotno > SPARC_INT_ARG_MAX) nregs = SPARC_INT_ARG_MAX - slotno; } - if (nregs == 0) - abort (); + gcc_assert (nregs != 0); parms.ret = gen_rtx_PARALLEL (mode, rtvec_alloc (parms.stack + nregs)); @@ -5631,8 +4765,7 @@ function_arg_record_value (tree type, enum machine_mode mode, function_arg_record_value_2 (type, 0, &parms, false); function_arg_record_value_3 (typesize * BITS_PER_UNIT, &parms); - if (parms.nregs != nregs) - abort (); + gcc_assert (parms.nregs == nregs); return parms.ret; } @@ -5748,8 +4881,7 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, /* Structures up to 16 bytes in size are passed in arg slots on the stack and are promoted to registers where possible. */ - if (int_size_in_bytes (type) > 16) - abort (); /* shouldn't get here */ + gcc_assert (int_size_in_bytes (type) <= 16); return function_arg_record_value (type, mode, slotno, named, regbase); } @@ -5757,8 +4889,7 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, { HOST_WIDE_INT size = int_size_in_bytes (type); - if (size > 16) - abort (); /* shouldn't get here */ + gcc_assert (size <= 16); return function_arg_union_value (size, mode, slotno, regno); } @@ -5769,8 +4900,7 @@ function_arg (const struct sparc_args *cum, enum machine_mode mode, instructions are enabled. */ HOST_WIDE_INT size = int_size_in_bytes (type); - if (size > 16) - abort (); /* shouldn't get here */ + gcc_assert (size <= 16); if (mode == BLKmode) return function_arg_vector_value (size, @@ -6125,8 +5255,8 @@ function_value (tree type, enum machine_mode mode, int incoming_p) instructions are enabled. */ HOST_WIDE_INT size = int_size_in_bytes (type); - if ((TARGET_ARCH32 && size > 8) || (TARGET_ARCH64 && size > 32)) - abort (); /* shouldn't get here */ + gcc_assert ((TARGET_ARCH32 && size <= 8) + || (TARGET_ARCH64 && size <= 32)); if (mode == BLKmode) return function_arg_vector_value (size, @@ -6142,8 +5272,7 @@ function_value (tree type, enum machine_mode mode, int incoming_p) /* Structures up to 32 bytes in size are passed in registers, promoted to fp registers where possible. */ - if (int_size_in_bytes (type) > 32) - abort (); /* shouldn't get here */ + gcc_assert (int_size_in_bytes (type) <= 32); return function_arg_record_value (type, mode, 0, 1, regbase); } @@ -6151,8 +5280,7 @@ function_value (tree type, enum machine_mode mode, int incoming_p) { HOST_WIDE_INT size = int_size_in_bytes (type); - if (size > 32) - abort (); /* shouldn't get here */ + gcc_assert (size <= 32); return function_arg_union_value (size, mode, 0, regbase); } @@ -6162,8 +5290,7 @@ function_value (tree type, enum machine_mode mode, int incoming_p) in a mode corresponding to the size of the type. */ HOST_WIDE_INT bytes = int_size_in_bytes (type); - if (bytes > 32) - abort (); /* shouldn't get here */ + gcc_assert (bytes <= 32); mode = mode_for_size (bytes * BITS_PER_UNIT, MODE_INT, 0); @@ -6475,7 +5602,7 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, break; default: - abort (); + gcc_unreachable (); } /* ??? !v9: FP branches cannot be preceded by another floating point @@ -6530,7 +5657,7 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, break; default: - abort (); + gcc_unreachable (); } strcpy (string, branch); } @@ -6567,17 +5694,14 @@ output_cbranch (rtx op, rtx dest, int label, int reversed, int annul, labelno = v9_fcc_labelno; if (v8) { - if (REGNO (cc_reg) == SPARC_FCC_REG) - labelno = ""; - else - abort (); + gcc_assert (REGNO (cc_reg) == SPARC_FCC_REG); + labelno = ""; } } else if (mode == CCXmode || mode == CCX_NOOVmode) { labelno = "%%xcc, "; - if (v8) - abort (); + gcc_assert (! v8); } else { @@ -6673,8 +5797,7 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison) break; default: - abort(); - break; + gcc_unreachable (); } if (TARGET_ARCH64) @@ -6886,8 +6009,7 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, code = reverse_condition (code); /* Only 64 bit versions of these instructions exist. */ - if (mode != DImode) - abort (); + gcc_assert (mode == DImode); /* Start by writing the branch condition. */ @@ -6918,7 +6040,7 @@ output_v9branch (rtx op, rtx dest, int reg, int label, int reversed, break; default: - abort (); + gcc_unreachable (); } p = strchr (string, '\0'); @@ -7094,8 +6216,7 @@ int sparc_splitdi_legitimate (rtx reg, rtx mem) { /* Punt if we are here by mistake. */ - if (! reload_completed) - abort (); + gcc_assert (reload_completed); /* We must have an offsettable memory reference. */ if (! offsettable_memref_p (mem)) @@ -7379,7 +6500,7 @@ print_operand (FILE *file, rtx x, int code) else if (GET_MODE (x) == CCXmode) fputs ("%xcc", file); else - abort (); + gcc_unreachable (); } else /* %fccN register */ @@ -7727,12 +6848,11 @@ sparc_type_code (register tree type) case VECTOR_TYPE: case CHAR_TYPE: /* GNU Pascal CHAR type. Not used in C. */ case BOOLEAN_TYPE: /* GNU Fortran BOOLEAN type. */ - case FILE_TYPE: /* GNU Pascal FILE type. */ case LANG_TYPE: /* ? */ return qualifiers; default: - abort (); /* Not a type! */ + gcc_unreachable (); /* Not a type! */ } } @@ -8202,7 +7322,7 @@ sparc_output_deferred_case_vectors (void) return; /* Align to cache line in the function's code section. */ - function_section (current_function_decl); + current_function_section (current_function_decl); align = floor_log2 (FUNCTION_BOUNDARY / BITS_PER_UNIT); if (align > 0) @@ -8229,8 +7349,7 @@ sparc_check_64 (rtx x, rtx insn) int set_once = 0; rtx y = x; - if (GET_CODE (x) != REG) - abort (); + gcc_assert (GET_CODE (x) == REG); if (GET_MODE (x) == DImode) y = gen_rtx_REG (SImode, REGNO (x) + WORDS_BIG_ENDIAN); @@ -8673,7 +7792,7 @@ sparc_extra_constraint_check (rtx op, int c, int strict) break; case 'Y': - return fp_zero_operand (op, GET_MODE (op)); + return const_zero_operand (op, GET_MODE (op)); default: return 0; @@ -8732,12 +7851,12 @@ sparc_rtx_costs (rtx x, int code, int outer_code, int *total) return true; case CONST_DOUBLE: - if (GET_MODE (x) == DImode - && ((XINT (x, 3) == 0 - && (unsigned HOST_WIDE_INT) XINT (x, 2) < 0x1000) - || (XINT (x, 3) == -1 - && XINT (x, 2) < 0 - && XINT (x, 2) >= -0x1000))) + if (GET_MODE (x) == VOIDmode + && ((CONST_DOUBLE_HIGH (x) == 0 + && CONST_DOUBLE_LOW (x) < 0x1000) + || (CONST_DOUBLE_HIGH (x) == -1 + && CONST_DOUBLE_LOW (x) < 0 + && CONST_DOUBLE_LOW (x) >= -0x1000))) *total = 0; else *total = 8; @@ -8795,11 +7914,11 @@ sparc_rtx_costs (rtx x, int code, int outer_code, int *total) nbits++; } else if (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE - && GET_MODE (XEXP (x, 1)) == DImode) + && GET_MODE (XEXP (x, 1)) == VOIDmode) { rtx x1 = XEXP (x, 1); - unsigned HOST_WIDE_INT value1 = XINT (x1, 2); - unsigned HOST_WIDE_INT value2 = XINT (x1, 3); + unsigned HOST_WIDE_INT value1 = CONST_DOUBLE_LOW (x1); + unsigned HOST_WIDE_INT value2 = CONST_DOUBLE_HIGH (x1); for (nbits = 0; value1 != 0; value1 &= value1 - 1) nbits++; @@ -8990,8 +8109,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, rtx vcall_offset_rtx = GEN_INT (vcall_offset); rtx scratch = gen_rtx_REG (Pmode, 1); - if (vcall_offset >= 0) - abort (); + gcc_assert (vcall_offset < 0); /* SCRATCH = *THIS. */ emit_move_insn (scratch, gen_rtx_MEM (Pmode, this)); @@ -9061,7 +8179,9 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, { spill_reg = gen_rtx_REG (word_mode, 15); /* %o7 */ start_sequence (); - load_pic_register (); /* clobbers %o7 */ + /* Delay emitting the PIC helper function because it needs to + change the section and we are emitting assembly code. */ + load_pic_register (true); /* clobbers %o7 */ scratch = legitimize_pic_address (funexp, Pmode, scratch); seq = get_insns (); end_sequence (); @@ -9098,7 +8218,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, break; default: - abort(); + gcc_unreachable (); } } @@ -9115,7 +8235,7 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, insn_locators_initialize (); shorten_branches (insn); final_start_function (insn, file, 1); - final (insn, file, 1, 0); + final (insn, file, 1); final_end_function (); reload_completed = 0; @@ -9160,7 +8280,7 @@ get_some_local_dynamic_name (void) && for_each_rtx (&PATTERN (insn), get_some_local_dynamic_name_1, 0)) return cfun->machine->some_ld_name; - abort (); + gcc_unreachable (); } static int @@ -9206,10 +8326,21 @@ sparc_output_dwarf_dtprel (FILE *file, int size, rtx x) fputs ("\t.xword\t%r_tls_dtpoff64(", file); break; default: - abort (); + gcc_unreachable (); } output_addr_const (file, x); fputs (")", file); } +static +void sparc_file_end (void) +{ + /* If we haven't emitted the special PIC helper function, do so now. */ + if (pic_helper_symbol_name[0] && !pic_helper_emitted_p) + emit_pic_helper (); + + if (NEED_INDICATE_EXEC_STACK) + file_end_indicate_exec_stack (); +} + #include "gt-sparc.h" diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index cddf48a927d..0e0aea211ff 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -214,6 +214,9 @@ extern enum cmodel sparc_cmodel; total memory ordering (TMO). */ #define SPARC_RELAXED_ORDERING false +/* Do not use the .note.GNU-stack convention by default. */ +#define NEED_INDICATE_EXEC_STACK 0 + /* This is call-clobbered in the normal ABI, but is reserved in the home grown (aka upward compatible) embedded ABI. */ #define EMBMEDANY_BASE_REG "%g4" @@ -480,122 +483,14 @@ extern enum cmodel sparc_cmodel; /* Show we can debug even without a frame pointer. */ #define CAN_DEBUG_WITHOUT_FP +/* Option handling. */ + #define OVERRIDE_OPTIONS sparc_override_options () -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* Nonzero if we should generate code to use the fpu. */ -#define MASK_FPU 1 -#define TARGET_FPU (target_flags & MASK_FPU) - -/* Nonzero if we should assume that double pointers might be unaligned. - This can happen when linking gcc compiled code with other compilers, - because the ABI only guarantees 4 byte alignment. */ -#define MASK_UNALIGNED_DOUBLES 4 -#define TARGET_UNALIGNED_DOUBLES (target_flags & MASK_UNALIGNED_DOUBLES) - -/* Nonzero means that we should generate code for a v8 sparc. */ -#define MASK_V8 0x8 -#define TARGET_V8 (target_flags & MASK_V8) - -/* Nonzero means that we should generate code for a sparclite. - This enables the sparclite specific instructions, but does not affect - whether FPU instructions are emitted. */ -#define MASK_SPARCLITE 0x10 -#define TARGET_SPARCLITE (target_flags & MASK_SPARCLITE) - -/* Nonzero if we're compiling for the sparclet. */ -#define MASK_SPARCLET 0x20 -#define TARGET_SPARCLET (target_flags & MASK_SPARCLET) - -/* Nonzero if we're compiling for v9 sparc. - Note that v9's can run in 32 bit mode so this doesn't necessarily mean - the word size is 64. */ -#define MASK_V9 0x40 -#define TARGET_V9 (target_flags & MASK_V9) - -/* Nonzero to generate code that uses the instructions deprecated in - the v9 architecture. This option only applies to v9 systems. */ -/* ??? This isn't user selectable yet. It's used to enable such insns - on 32 bit v9 systems and for the moment they're permanently disabled - on 64 bit v9 systems. */ -#define MASK_DEPRECATED_V8_INSNS 0x80 -#define TARGET_DEPRECATED_V8_INSNS (target_flags & MASK_DEPRECATED_V8_INSNS) - /* Mask of all CPU selection flags. */ #define MASK_ISA \ (MASK_V8 + MASK_SPARCLITE + MASK_SPARCLET + MASK_V9 + MASK_DEPRECATED_V8_INSNS) -/* Nonzero means don't pass `-assert pure-text' to the linker. */ -#define MASK_IMPURE_TEXT 0x100 -#define TARGET_IMPURE_TEXT (target_flags & MASK_IMPURE_TEXT) - -/* 0x200 is unused */ - -/* Nonzero means use the registers that the SPARC ABI reserves for - application software. This must be the default to coincide with the - setting in FIXED_REGISTERS. */ -#define MASK_APP_REGS 0x400 -#define TARGET_APP_REGS (target_flags & MASK_APP_REGS) - -/* Option to select how quad word floating point is implemented. - When TARGET_HARD_QUAD is true, we use the hardware quad instructions. - Otherwise, we use the SPARC ABI quad library functions. */ -#define MASK_HARD_QUAD 0x800 -#define TARGET_HARD_QUAD (target_flags & MASK_HARD_QUAD) - -/* Nonzero on little-endian machines. */ -/* ??? Little endian support currently only exists for sparc86x-elf and - sparc64-elf configurations. May eventually want to expand the support - to all targets, but for now it's kept local to only those two. */ -#define MASK_LITTLE_ENDIAN 0x1000 -#define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN) - -/* 0x2000, 0x4000 are unused */ - -/* Nonzero if pointers are 64 bits. */ -#define MASK_PTR64 0x8000 -#define TARGET_PTR64 (target_flags & MASK_PTR64) - -/* Nonzero if generating code to run in a 64 bit environment. - This is intended to only be used by TARGET_ARCH{32,64} as they are the - mechanism used to control compile time or run time selection. */ -#define MASK_64BIT 0x10000 -#define TARGET_64BIT (target_flags & MASK_64BIT) - -/* 0x20000,0x40000 unused */ - -/* Nonzero means use a stack bias of 2047. Stack offsets are obtained by - adding 2047 to %sp. This option is for v9 only and is the default. */ -#define MASK_STACK_BIAS 0x80000 -#define TARGET_STACK_BIAS (target_flags & MASK_STACK_BIAS) - -/* 0x100000,0x200000 unused */ - -/* Nonzero means -m{,no-}fpu was passed on the command line. */ -#define MASK_FPU_SET 0x400000 -#define TARGET_FPU_SET (target_flags & MASK_FPU_SET) - -/* Use the UltraSPARC Visual Instruction Set extensions. */ -#define MASK_VIS 0x1000000 -#define TARGET_VIS (target_flags & MASK_VIS) - -/* Compile for Solaris V8+. 32 bit Solaris preserves the high bits of - the current out and global registers and Linux 2.2+ as well. */ -#define MASK_V8PLUS 0x2000000 -#define TARGET_V8PLUS (target_flags & MASK_V8PLUS) - -/* Force a the fastest alignment on structures to take advantage of - faster copies. */ -#define MASK_FASTER_STRUCTS 0x4000000 -#define TARGET_FASTER_STRUCTS (target_flags & MASK_FASTER_STRUCTS) - -/* Use IEEE quad long double. */ -#define MASK_LONG_DOUBLE_128 0x8000000 -#define TARGET_LONG_DOUBLE_128 (target_flags & MASK_LONG_DOUBLE_128) - /* TARGET_HARD_MUL: Use hardware multiply instructions but not %y. TARGET_HARD_MUL32: Use hardware multiply instructions with rd %y to get high 32 bits. False in V8+ or V9 because multiply stores @@ -610,79 +505,11 @@ extern int target_flags; (TARGET_V8 || TARGET_SPARCLITE || TARGET_SPARCLET \ || TARGET_DEPRECATED_V8_INSNS || TARGET_V8PLUS) - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - { {"fpu", MASK_FPU | MASK_FPU_SET, \ - N_("Use hardware fp") }, \ - {"no-fpu", -MASK_FPU, \ - N_("Do not use hardware fp") }, \ - {"no-fpu", MASK_FPU_SET, NULL, }, \ - {"hard-float", MASK_FPU | MASK_FPU_SET, \ - N_("Use hardware fp") }, \ - {"soft-float", -MASK_FPU, \ - N_("Do not use hardware fp") }, \ - {"soft-float", MASK_FPU_SET, NULL }, \ - {"unaligned-doubles", MASK_UNALIGNED_DOUBLES, \ - N_("Assume possible double misalignment") }, \ - {"no-unaligned-doubles", -MASK_UNALIGNED_DOUBLES, \ - N_("Assume all doubles are aligned") }, \ - {"impure-text", MASK_IMPURE_TEXT, \ - N_("Pass -assert pure-text to linker") }, \ - {"no-impure-text", -MASK_IMPURE_TEXT, \ - N_("Do not pass -assert pure-text to linker") }, \ - {"app-regs", MASK_APP_REGS, \ - N_("Use ABI reserved registers") }, \ - {"no-app-regs", -MASK_APP_REGS, \ - N_("Do not use ABI reserved registers") }, \ - {"hard-quad-float", MASK_HARD_QUAD, \ - N_("Use hardware quad fp instructions") }, \ - {"soft-quad-float", -MASK_HARD_QUAD, \ - N_("Do not use hardware quad fp instructions") }, \ - {"v8plus", MASK_V8PLUS, \ - N_("Compile for v8plus ABI") }, \ - {"no-v8plus", -MASK_V8PLUS, \ - N_("Do not compile for v8plus ABI") }, \ - {"vis", MASK_VIS, \ - N_("Utilize Visual Instruction Set") }, \ - {"no-vis", -MASK_VIS, \ - N_("Do not utilize Visual Instruction Set") }, \ - {"ptr64", MASK_PTR64, \ - N_("Pointers are 64-bit") }, \ - {"ptr32", -MASK_PTR64, \ - N_("Pointers are 32-bit") }, \ - {"32", -MASK_64BIT, \ - N_("Use 32-bit ABI") }, \ - {"64", MASK_64BIT, \ - N_("Use 64-bit ABI") }, \ - {"stack-bias", MASK_STACK_BIAS, \ - N_("Use stack bias") }, \ - {"no-stack-bias", -MASK_STACK_BIAS, \ - N_("Do not use stack bias") }, \ - {"faster-structs", MASK_FASTER_STRUCTS, \ - N_("Use structs on stronger alignment for double-word copies") }, \ - {"no-faster-structs", -MASK_FASTER_STRUCTS, \ - N_("Do not use structs on stronger alignment for double-word copies") }, \ - {"relax", 0, \ - N_("Optimize tail call instructions in assembler and linker") }, \ - {"no-relax", 0, \ - N_("Do not optimize tail call instructions in assembler or linker") }, \ - SUBTARGET_SWITCHES \ - { "", TARGET_DEFAULT, ""}} - /* MASK_APP_REGS must always be the default because that's what FIXED_REGISTERS is set to and -ffixed- is processed before CONDITIONAL_REGISTER_USAGE is called (where we process -mno-app-regs). */ #define TARGET_DEFAULT (MASK_APP_REGS + MASK_FPU) -/* This is meant to be redefined in target specific files. */ -#define SUBTARGET_SWITCHES - /* Processor type. These must match the values for the cpu attribute in sparc.md. */ enum processor_type { @@ -709,20 +536,6 @@ extern enum processor_type sparc_cpu; Every file includes us, but not every file includes insn-attr.h. */ #define sparc_cpu_attr ((enum attr_cpu) sparc_cpu) -#define TARGET_OPTIONS \ -{ \ - { "cpu=", &sparc_select[1].string, \ - N_("Use features of and schedule code for given CPU"), 0}, \ - { "tune=", &sparc_select[2].string, \ - N_("Schedule code for given CPU"), 0}, \ - { "cmodel=", &sparc_cmodel_string, \ - N_("Use given SPARC code model"), 0}, \ - SUBTARGET_OPTIONS \ -} - -/* This is meant to be redefined in target specific files. */ -#define SUBTARGET_OPTIONS - /* Support for a compile-time default CPU, et cetera. The rules are: --with-cpu is ignored if -mcpu is specified. --with-tune is ignored if -mtune is specified. @@ -775,7 +588,7 @@ extern struct sparc_cpu_select sparc_select[]; #define MIN_UNITS_PER_WORD 4 #endif -#define UNITS_PER_SIMD_WORD (TARGET_VIS ? 8 : 0) +#define UNITS_PER_SIMD_WORD (TARGET_VIS ? 8 : UNITS_PER_WORD) /* Now define the sizes of the C data types. */ @@ -1093,9 +906,6 @@ extern int sparc_mode_class[]; /* Specify the registers used for certain standard purposes. The values of these macros are register numbers. */ -/* SPARC pc isn't overloaded on a register that the compiler knows about. */ -/* #define PC_REGNUM */ - /* Register to use for pushing function arguments. */ #define STACK_POINTER_REGNUM 14 @@ -1195,11 +1005,12 @@ extern int sparc_mode_class[]; because reg_class_subunion[GENERAL_REGS][FP_REGS] will yield FP_REGS, because FP_REGS > GENERAL_REGS. - It is also important that one class contain all the general and all the - fp regs. Otherwise when spilling a DFmode reg, it may be from EXTRA_FP_REGS - but find_reloads() may use class GENERAL_OR_FP_REGS. This will cause - allocate_reload_reg() to bypass it causing an abort because the compiler - thinks it doesn't have a spill reg when in fact it does. + It is also important that one class contain all the general and all + the fp regs. Otherwise when spilling a DFmode reg, it may be from + EXTRA_FP_REGS but find_reloads() may use class + GENERAL_OR_FP_REGS. This will cause allocate_reload_reg() to die + because the compiler thinks it doesn't have a spill reg when in + fact it does. v9 also has 4 floating point condition code registers. Since we don't have a class that is the union of FPCC_REGS with either of the others, @@ -1376,8 +1187,8 @@ extern char leaf_reg_remap[]; : (C) == 'c' ? FPCC_REGS \ : NO_REGS)) -/* The letters I, J, K, L and M in a register constraint string - can be used to stand for particular ranges of immediate operands. +/* The letters I, J, K, L, M, N, O, P in a register constraint string + can be used to stand for particular ranges of CONST_INTs. This macro defines what the ranges are. C is the letter, and VALUE is a constant value. Return 1 if VALUE is in the range specified by C. @@ -1388,20 +1199,32 @@ extern char leaf_reg_remap[]; `L' is used for the range of constants supported by the movcc insns. `M' is used for the range of constants supported by the movrcc insns. `N' is like K, but for constants wider than 32 bits. - `O' is used for the range which is just 4096. */ + `O' is used for the range which is just 4096. + `P' is free. */ +/* Predicates for 10-bit, 11-bit and 13-bit signed constants. */ #define SPARC_SIMM10_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x200 < 0x400) #define SPARC_SIMM11_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x400 < 0x800) #define SPARC_SIMM13_P(X) ((unsigned HOST_WIDE_INT) (X) + 0x1000 < 0x2000) -/* 10 and 11 bit immediates are only used for a few specific insns. + +/* 10- and 11-bit immediates are only used for a few specific insns. SMALL_INT is used throughout the port so we continue to use it. */ #define SMALL_INT(X) (SPARC_SIMM13_P (INTVAL (X))) -/* 13 bit immediate, considering only the low 32 bits */ -#define SMALL_INT32(X) (SPARC_SIMM13_P (trunc_int_for_mode \ - (INTVAL (X), SImode))) + +/* Predicate for constants that can be loaded with a sethi instruction. + This is the general, 64-bit aware, bitwise version that ensures that + only constants whose representation fits in the mask + + 0x00000000fffffc00 + + are accepted. It will reject, for example, negative SImode constants + on 64-bit hosts, so correct handling is to mask the value beforehand + according to the mode of the instruction. */ #define SPARC_SETHI_P(X) \ (((unsigned HOST_WIDE_INT) (X) \ & ((unsigned HOST_WIDE_INT) 0x3ff - GET_MODE_MASK (SImode) - 1)) == 0) + +/* Version of the above predicate for SImode constants and below. */ #define SPARC_SETHI32_P(X) \ (SPARC_SETHI_P ((unsigned HOST_WIDE_INT) (X) & GET_MODE_MASK (SImode))) @@ -1415,13 +1238,12 @@ extern char leaf_reg_remap[]; : (C) == 'O' ? (VALUE) == 4096 \ : 0) -/* Similar, but for floating constants, and defining letters G and H. +/* Similar, but for CONST_DOUBLEs, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. */ #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'G' ? fp_zero_operand (VALUE, GET_MODE (VALUE)) \ + ((C) == 'G' ? const_zero_operand (VALUE, GET_MODE (VALUE)) \ : (C) == 'H' ? arith_double_operand (VALUE, DImode) \ - : (C) == 'O' ? arith_double_4096_operand (VALUE, DImode) \ : 0) /* Given an rtx X being reloaded into a reg required to be @@ -1444,7 +1266,7 @@ extern char leaf_reg_remap[]; || (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \ && ! TARGET_FPU) \ || (GET_MODE (X) == TFmode \ - && ! fp_zero_operand (X, TFmode))) \ + && ! const_zero_operand (X, TFmode))) \ ? NO_REGS \ : (!FP_REG_CLASS_P (CLASS) \ && GET_MODE_CLASS (GET_MODE (X)) == MODE_INT) \ @@ -1550,16 +1372,12 @@ extern char leaf_reg_remap[]; If FRAME_GROWS_DOWNWARD, this is the offset to the END of the first local allocated. Otherwise, it is the offset to the BEGINNING of the first local allocated. */ -/* This allows space for one TFmode floating point value. */ +/* This allows space for one TFmode floating point value, which is used + by SECONDARY_MEMORY_NEEDED_RTX. */ #define STARTING_FRAME_OFFSET \ (TARGET_ARCH64 ? -16 \ : (-SPARC_STACK_ALIGN (LONG_DOUBLE_TYPE_SIZE / BITS_PER_UNIT))) -/* If we generate an insn to push BYTES bytes, - this says how many the stack pointer really advances by. - On SPARC, don't define this because there are no push insns. */ -/* #define PUSH_ROUNDING(BYTES) */ - /* Offset of first parameter from the argument pointer register value. !v9: This is 64 for the ins and locals, plus 4 for the struct-return reg even if this function isn't going to use it. @@ -1677,7 +1495,7 @@ extern char leaf_reg_remap[]; /* Define the size of space to allocate for the return value of an untyped_call. */ -#define APPLY_RESULT_SIZE 16 +#define APPLY_RESULT_SIZE (TARGET_ARCH64 ? 24 : 16) /* 1 if N is a possible register number for function argument passing. On SPARC, these are the "output" registers. v9 also uses %f0-%f31. */ @@ -1795,7 +1613,7 @@ extern GTY(()) rtx sparc_compare_op1; case of a global register variable occupying more than one register we prefix the second and following registers with .gnu.part1. etc. */ -extern char sparc_hard_reg_printed[8]; +extern GTY(()) char sparc_hard_reg_printed[8]; #ifdef HAVE_AS_REGISTER_PSEUDO_OP #define ASM_DECLARE_REGISTER_GLOBAL(FILE, DECL, REGNO, NAME) \ @@ -2568,10 +2386,9 @@ extern int sparc_indent_opcode; base = XEXP (addr, 0), index = XEXP (addr, 1); \ if (GET_CODE (base) == LO_SUM) \ { \ - if (! USE_AS_OFFSETABLE_LO10 \ - || TARGET_ARCH32 \ - || TARGET_CM_MEDMID) \ - abort (); \ + gcc_assert (USE_AS_OFFSETABLE_LO10 \ + && TARGET_ARCH64 \ + && ! TARGET_CM_MEDMID); \ output_operand (XEXP (base, 0), 0); \ fputs ("+%lo(", FILE); \ output_address (XEXP (base, 1)); \ @@ -2587,7 +2404,7 @@ extern int sparc_indent_opcode; else if (GET_CODE (index) == SYMBOL_REF \ || GET_CODE (index) == CONST) \ fputc ('+', FILE), output_addr_const (FILE, index); \ - else abort (); \ + else gcc_unreachable (); \ } \ } \ else if (GET_CODE (addr) == MINUS \ @@ -2637,60 +2454,5 @@ extern int sparc_indent_opcode; #define TARGET_SUN_TLS TARGET_TLS #define TARGET_GNU_TLS 0 -/* Define the codes that are matched by predicates in sparc.c. */ - -#define PREDICATE_CODES \ -{"reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"const1_operand", {CONST_INT}}, \ -{"fp_zero_operand", {CONST_DOUBLE}}, \ -{"fp_register_operand", {SUBREG, REG}}, \ -{"intreg_operand", {SUBREG, REG}}, \ -{"fcc_reg_operand", {REG}}, \ -{"fcc0_reg_operand", {REG}}, \ -{"icc_or_fcc_reg_operand", {REG}}, \ -{"call_operand", {MEM}}, \ -{"call_operand_address", {SYMBOL_REF, LABEL_REF, CONST, CONST_DOUBLE, \ - SUBREG, REG, PLUS, LO_SUM, CONST_INT}}, \ -{"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \ -{"symbolic_memory_operand", {SUBREG, MEM}}, \ -{"label_ref_operand", {LABEL_REF}}, \ -{"sp64_medium_pic_operand", {CONST}}, \ -{"data_segment_operand", {SYMBOL_REF, PLUS, CONST}}, \ -{"text_segment_operand", {LABEL_REF, SYMBOL_REF, PLUS, CONST}}, \ -{"reg_or_nonsymb_mem_operand", {SUBREG, REG, MEM}}, \ -{"splittable_symbolic_memory_operand", {MEM}}, \ -{"splittable_immediate_memory_operand", {MEM}}, \ -{"eq_or_neq", {EQ, NE}}, \ -{"normal_comp_operator", {GE, GT, LE, LT, GTU, LEU}}, \ -{"noov_compare_op", {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU}}, \ -{"noov_compare64_op", {NE, EQ, GE, GT, LE, LT, GEU, GTU, LEU, LTU}}, \ -{"v9_regcmp_op", {EQ, NE, GE, LT, LE, GT}}, \ -{"extend_op", {SIGN_EXTEND, ZERO_EXTEND}}, \ -{"cc_arithop", {AND, IOR, XOR}}, \ -{"cc_arithopn", {AND, IOR}}, \ -{"arith_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith_add_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith11_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith10_operand", {SUBREG, REG, CONST_INT}}, \ -{"arith_double_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"arith_double_add_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"arith11_double_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"arith10_double_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \ -{"small_int", {CONST_INT}}, \ -{"small_int_or_double", {CONST_INT, CONST_DOUBLE}}, \ -{"uns_small_int", {CONST_INT}}, \ -{"uns_arith_operand", {SUBREG, REG, CONST_INT}}, \ -{"clobbered_register", {REG}}, \ -{"input_operand", {SUBREG, REG, CONST_INT, MEM, CONST}}, \ -{"compare_operand", {SUBREG, REG, ZERO_EXTRACT}}, \ -{"const64_operand", {CONST_INT, CONST_DOUBLE}}, \ -{"const64_high_operand", {CONST_INT, CONST_DOUBLE}}, \ -{"tgd_symbolic_operand", {SYMBOL_REF}}, \ -{"tld_symbolic_operand", {SYMBOL_REF}}, \ -{"tie_symbolic_operand", {SYMBOL_REF}}, \ -{"tle_symbolic_operand", {SYMBOL_REF}}, - /* The number of Pmode words for the setjmp buffer. */ #define JMP_BUF_SIZE 12 - -#define DONT_ACCESS_GBLS_AFTER_EPILOGUE (flag_pic) diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 6153b5adbe6..f40d59cd58b 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -68,14 +68,13 @@ (UNSPECV_SAVEW 6) ]) -(define_mode_macro P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) - ;; The upper 32 fp regs on the v9 can't hold SFmode values. To deal with this ;; a second register class, EXTRA_FP_REGS, exists for the v9 chip. The name ;; is a bit of a misnomer as it covers all 64 fp regs. The corresponding ;; constraint letter is 'e'. To avoid any confusion, 'e' is used instead of ;; 'f' for all DF/TFmode values, including those that are specific to the v8. + ;; Attribute for cpu type. ;; These must match the values for enum processor_type in sparc.h. (define_attr "cpu" @@ -158,7 +157,7 @@ (const_int 2) (const_int 1))) (eq_attr "branch_type" "icc") - (if_then_else (match_operand 0 "noov_compare64_op" "") + (if_then_else (match_operand 0 "noov_compare64_operator" "") (if_then_else (lt (pc) (match_dup 1)) (if_then_else (lt (minus (match_dup 1) (pc)) (const_int 260000)) (if_then_else (eq_attr "empty_delay_slot" "true") @@ -178,7 +177,7 @@ (const_int 2) (const_int 1))) (eq_attr "branch_type" "fcc") - (if_then_else (match_operand 0 "fcc0_reg_operand" "") + (if_then_else (match_operand 0 "fcc0_register_operand" "") (if_then_else (eq_attr "empty_delay_slot" "true") (if_then_else (eq (symbol_ref "TARGET_V9") (const_int 0)) (const_int 3) @@ -300,6 +299,7 @@ (define_delay (eq_attr "type" "return") [(eq_attr "eligible_for_return_delay" "true") (nil) (nil)]) + ;; Include SPARC DFA schedulers (include "cypress.md") @@ -309,9 +309,13 @@ (include "ultra1_2.md") (include "ultra3.md") - + +;; Operand and operator predicates. + +(include "predicates.md") + + ;; Compare instructions. -;; This controls RTL generation and register allocation. ;; We generate RTL for comparisons and branches by having the cmpxx ;; patterns store away the operands. Then, the scc and bcc patterns @@ -326,8 +330,6 @@ ;; the patterns. Finally, we have the DEFINE_SPLITs for some of the scc ;; insns that actually require more than one machine instruction. -;; Put cmpsi first among compare insns so it matches two CONST_INT operands. - (define_expand "cmpsi" [(set (reg:CC 100) (compare:CC (match_operand:SI 0 "compare_operand" "") @@ -345,7 +347,7 @@ (define_expand "cmpdi" [(set (reg:CCX 100) (compare:CCX (match_operand:DI 0 "compare_operand" "") - (match_operand:DI 1 "arith_double_operand" "")))] + (match_operand:DI 1 "arith_operand" "")))] "TARGET_ARCH64" { if (GET_CODE (operands[0]) == ZERO_EXTRACT && operands[1] != const0_rtx) @@ -405,13 +407,13 @@ (define_insn "*cmpdi_sp64" [(set (reg:CCX 100) (compare:CCX (match_operand:DI 0 "register_operand" "r") - (match_operand:DI 1 "arith_double_operand" "rHI")))] + (match_operand:DI 1 "arith_operand" "rI")))] "TARGET_ARCH64" "cmp\t%0, %1" [(set_attr "type" "compare")]) (define_insn "*cmpsf_fpe" - [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFPE 0 "fcc_register_operand" "=c") (compare:CCFPE (match_operand:SF 1 "register_operand" "f") (match_operand:SF 2 "register_operand" "f")))] "TARGET_FPU" @@ -423,7 +425,7 @@ [(set_attr "type" "fpcmp")]) (define_insn "*cmpdf_fpe" - [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFPE 0 "fcc_register_operand" "=c") (compare:CCFPE (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU" @@ -436,7 +438,7 @@ (set_attr "fptype" "double")]) (define_insn "*cmptf_fpe" - [(set (match_operand:CCFPE 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFPE 0 "fcc_register_operand" "=c") (compare:CCFPE (match_operand:TF 1 "register_operand" "e") (match_operand:TF 2 "register_operand" "e")))] "TARGET_FPU && TARGET_HARD_QUAD" @@ -448,7 +450,7 @@ [(set_attr "type" "fpcmp")]) (define_insn "*cmpsf_fp" - [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFP 0 "fcc_register_operand" "=c") (compare:CCFP (match_operand:SF 1 "register_operand" "f") (match_operand:SF 2 "register_operand" "f")))] "TARGET_FPU" @@ -460,7 +462,7 @@ [(set_attr "type" "fpcmp")]) (define_insn "*cmpdf_fp" - [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFP 0 "fcc_register_operand" "=c") (compare:CCFP (match_operand:DF 1 "register_operand" "e") (match_operand:DF 2 "register_operand" "e")))] "TARGET_FPU" @@ -473,7 +475,7 @@ (set_attr "fptype" "double")]) (define_insn "*cmptf_fp" - [(set (match_operand:CCFP 0 "fcc_reg_operand" "=c") + [(set (match_operand:CCFP 0 "fcc_register_operand" "=c") (compare:CCFP (match_operand:TF 1 "register_operand" "e") (match_operand:TF 2 "register_operand" "e")))] "TARGET_FPU && TARGET_HARD_QUAD" @@ -573,7 +575,7 @@ ;; ??? v9: Operand 0 needs a mode, so SImode was chosen. ;; However, the code handles both SImode and DImode. (define_expand "seq" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (eq:SI (match_dup 1) (const_int 0)))] "" { @@ -625,7 +627,7 @@ ;; ??? v9: Operand 0 needs a mode, so SImode was chosen. ;; However, the code handles both SImode and DImode. (define_expand "sne" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (ne:SI (match_dup 1) (const_int 0)))] "" { @@ -675,7 +677,7 @@ }) (define_expand "sgt" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (gt:SI (match_dup 1) (const_int 0)))] "" { @@ -695,7 +697,7 @@ }) (define_expand "slt" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (lt:SI (match_dup 1) (const_int 0)))] "" { @@ -715,7 +717,7 @@ }) (define_expand "sge" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (ge:SI (match_dup 1) (const_int 0)))] "" { @@ -735,7 +737,7 @@ }) (define_expand "sle" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (le:SI (match_dup 1) (const_int 0)))] "" { @@ -755,7 +757,7 @@ }) (define_expand "sgtu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (gtu:SI (match_dup 1) (const_int 0)))] "" { @@ -789,7 +791,7 @@ }) (define_expand "sltu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (ltu:SI (match_dup 1) (const_int 0)))] "" { @@ -802,7 +804,7 @@ }) (define_expand "sgeu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (geu:SI (match_dup 1) (const_int 0)))] "" { @@ -815,7 +817,7 @@ }) (define_expand "sleu" - [(set (match_operand:SI 0 "intreg_operand" "") + [(set (match_operand:SI 0 "int_register_operand" "") (leu:SI (match_dup 1) (const_int 0)))] "" { @@ -1186,7 +1188,7 @@ ;; ??? Combine should canonicalize these next two to the same pattern. (define_insn "*x_minus_y_minus_sltu" [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC 100) (const_int 0))))] "" @@ -1195,7 +1197,7 @@ (define_insn "*x_minus_sltu_plus_y" [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (plus:SI (ltu:SI (reg:CC 100) (const_int 0)) (match_operand:SI 2 "arith_operand" "rI"))))] "" @@ -1220,8 +1222,8 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") - (match_operator:SI 2 "noov_compare_op" - [(match_operand 1 "icc_or_fcc_reg_operand" "") + (match_operator:SI 2 "noov_compare_operator" + [(match_operand 1 "icc_or_fcc_register_operand" "") (const_int 0)]))] "TARGET_V9 && REGNO (operands[1]) == SPARC_ICC_REG @@ -1556,7 +1558,7 @@ ;; XXX fpcmp nop braindamage (define_insn "*normal_branch" [(set (pc) - (if_then_else (match_operator 0 "noov_compare_op" + (if_then_else (match_operator 0 "noov_compare_operator" [(reg 100) (const_int 0)]) (label_ref (match_operand 1 "" "")) (pc)))] @@ -1572,7 +1574,7 @@ ;; XXX fpcmp nop braindamage (define_insn "*inverted_branch" [(set (pc) - (if_then_else (match_operator 0 "noov_compare_op" + (if_then_else (match_operator 0 "noov_compare_operator" [(reg 100) (const_int 0)]) (pc) (label_ref (match_operand 1 "" ""))))] @@ -1589,7 +1591,7 @@ (define_insn "*normal_fp_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFP 0 "fcc_reg_operand" "c") + [(match_operand:CCFP 0 "fcc_register_operand" "c") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] @@ -1606,7 +1608,7 @@ (define_insn "*inverted_fp_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFP 0 "fcc_reg_operand" "c") + [(match_operand:CCFP 0 "fcc_register_operand" "c") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] @@ -1623,7 +1625,7 @@ (define_insn "*normal_fpe_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFPE 0 "fcc_reg_operand" "c") + [(match_operand:CCFPE 0 "fcc_register_operand" "c") (const_int 0)]) (label_ref (match_operand 2 "" "")) (pc)))] @@ -1640,7 +1642,7 @@ (define_insn "*inverted_fpe_branch" [(set (pc) (if_then_else (match_operator 1 "comparison_operator" - [(match_operand:CCFPE 0 "fcc_reg_operand" "c") + [(match_operand:CCFPE 0 "fcc_register_operand" "c") (const_int 0)]) (pc) (label_ref (match_operand 2 "" ""))))] @@ -1661,7 +1663,7 @@ ;; XXX (define_insn "*normal_int_branch_sp64" [(set (pc) - (if_then_else (match_operator 0 "v9_regcmp_op" + (if_then_else (match_operator 0 "v9_register_compare_operator" [(match_operand:DI 1 "register_operand" "r") (const_int 0)]) (label_ref (match_operand 2 "" "")) @@ -1678,7 +1680,7 @@ ;; XXX (define_insn "*inverted_int_branch_sp64" [(set (pc) - (if_then_else (match_operator 0 "v9_regcmp_op" + (if_then_else (match_operator 0 "v9_register_compare_operator" [(match_operand:DI 1 "register_operand" "r") (const_int 0)]) (pc) @@ -1691,7 +1693,10 @@ } [(set_attr "type" "branch") (set_attr "branch_type" "reg")]) - + + +(define_mode_macro P [(SI "Pmode == SImode") (DI "Pmode == DImode")]) + ;; Load in operand 0 the (absolute) address of operand 1, which is a symbolic ;; value subject to a PC-relative relocation. Operand 2 is a helper function ;; that adds the PC value at the call point to operand 0. @@ -1699,7 +1704,7 @@ (define_insn "load_pcrel_sym" [(set (match_operand:P 0 "register_operand" "=r") (unspec:P [(match_operand:P 1 "symbolic_operand" "") - (match_operand:P 2 "call_operand_address" "")] UNSPEC_LOAD_PCREL_SYM)) + (match_operand:P 2 "call_address_operand" "")] UNSPEC_LOAD_PCREL_SYM)) (clobber (reg:P 15))] "" { @@ -1713,8 +1718,9 @@ (if_then_else (eq_attr "delayed_branch" "true") (const_int 3) (const_int 4)))]) - -;; Move instructions + + +;; Integer move instructions (define_expand "movqi" [(set (match_operand:QI 0 "general_operand" "") @@ -1724,15 +1730,12 @@ /* Working with CONST_INTs is easier, so convert a double if needed. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) - { - operands[1] = GEN_INT (trunc_int_for_mode - (CONST_DOUBLE_LOW (operands[1]), QImode)); - } + operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), QImode); /* Handle sets of MEM first. */ if (GET_CODE (operands[0]) == MEM) { - if (reg_or_0_operand (operands[1], QImode)) + if (register_or_zero_operand (operands[1], QImode)) goto movqi_is_ok; if (! reload_in_progress) @@ -1774,7 +1777,7 @@ [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,m") (match_operand:QI 1 "input_operand" "rI,m,rJ"))] "(register_operand (operands[0], QImode) - || reg_or_0_operand (operands[1], QImode))" + || register_or_zero_operand (operands[1], QImode))" "@ mov\t%1, %0 ldub\t%1, %0 @@ -1790,12 +1793,12 @@ /* Working with CONST_INTs is easier, so convert a double if needed. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); + operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), HImode); /* Handle sets of MEM first. */ if (GET_CODE (operands[0]) == MEM) { - if (reg_or_0_operand (operands[1], HImode)) + if (register_or_zero_operand (operands[1], HImode)) goto movhi_is_ok; if (! reload_in_progress) @@ -1830,28 +1833,22 @@ /* This makes sure we will not get rematched due to splittage. */ if (! CONSTANT_P (operands[1]) || input_operand (operands[1], HImode)) ; - else if (CONSTANT_P (operands[1]) - && GET_CODE (operands[1]) != HIGH + else if (GET_CODE (operands[1]) != HIGH && GET_CODE (operands[1]) != LO_SUM) { sparc_emit_set_const32 (operands[0], operands[1]); DONE; } + movhi_is_ok: ; }) -(define_insn "*movhi_const64_special" - [(set (match_operand:HI 0 "register_operand" "=r") - (match_operand:HI 1 "const64_high_operand" ""))] - "TARGET_ARCH64" - "sethi\t%%hi(%a1), %0") - (define_insn "*movhi_insn" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r,r,m") (match_operand:HI 1 "input_operand" "rI,K,m,rJ"))] "(register_operand (operands[0], HImode) - || reg_or_0_operand (operands[1], HImode))" + || register_or_zero_operand (operands[1], HImode))" "@ mov\t%1, %0 sethi\t%%hi(%a1), %0 @@ -1864,7 +1861,7 @@ (define_insn "*movhi_lo_sum" [(set (match_operand:HI 0 "register_operand" "=r") (ior:HI (match_operand:HI 1 "register_operand" "%r") - (match_operand:HI 2 "small_int" "I")))] + (match_operand:HI 2 "small_int_operand" "I")))] "" "or\t%1, %2, %0") @@ -1876,12 +1873,12 @@ /* Working with CONST_INTs is easier, so convert a double if needed. */ if (GET_CODE (operands[1]) == CONST_DOUBLE) - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); + operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), SImode); /* Handle sets of MEM first. */ if (GET_CODE (operands[0]) == MEM) { - if (reg_or_0_operand (operands[1], SImode)) + if (register_or_zero_operand (operands[1], SImode)) goto movsi_is_ok; if (! reload_in_progress) @@ -1904,7 +1901,6 @@ if (GET_CODE (operands[1]) == LABEL_REF) { - /* shit */ emit_insn (gen_movsi_pic_label_ref (operands[0], operands[1])); DONE; } @@ -1932,41 +1928,32 @@ /* This makes sure we will not get rematched due to splittage. */ if (! CONSTANT_P (operands[1]) || input_operand (operands[1], SImode)) ; - else if (CONSTANT_P (operands[1]) - && GET_CODE (operands[1]) != HIGH + else if (GET_CODE (operands[1]) != HIGH && GET_CODE (operands[1]) != LO_SUM) { sparc_emit_set_const32 (operands[0], operands[1]); DONE; } + movsi_is_ok: ; }) -;; This is needed to show CSE exactly which bits are set -;; in a 64-bit register by sethi instructions. -(define_insn "*movsi_const64_special" - [(set (match_operand:SI 0 "register_operand" "=r") - (match_operand:SI 1 "const64_high_operand" ""))] - "TARGET_ARCH64" - "sethi\t%%hi(%a1), %0") - (define_insn "*movsi_insn" - [(set (match_operand:SI 0 "nonimmediate_operand" "=r,f,r,r,r,f,m,m,d") - (match_operand:SI 1 "input_operand" "rI,!f,K,J,m,!m,rJ,!f,J"))] + [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r,m,!f,!f,!m,d") + (match_operand:SI 1 "input_operand" "rI,K,m,rJ,f,m,f,J"))] "(register_operand (operands[0], SImode) - || reg_or_0_operand (operands[1], SImode))" + || register_or_zero_operand (operands[1], SImode))" "@ mov\t%1, %0 - fmovs\t%1, %0 sethi\t%%hi(%a1), %0 - clr\t%0 - ld\t%1, %0 ld\t%1, %0 st\t%r1, %0 + fmovs\t%1, %0 + ld\t%1, %0 st\t%1, %0 fzeros\t%0" - [(set_attr "type" "*,fpmove,*,*,load,fpload,store,fpstore,fga")]) + [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga")]) (define_insn "*movsi_lo_sum" [(set (match_operand:SI 0 "register_operand" "=r") @@ -2038,11 +2025,12 @@ "or\t%1, %%lo(%a3-(%a2-.)), %0") (define_expand "movdi" - [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "") + [(set (match_operand:DI 0 "general_operand" "") (match_operand:DI 1 "general_operand" ""))] "" { - /* Where possible, convert CONST_DOUBLE into a CONST_INT. */ + /* Working with CONST_INTs is easier, so convert + a double if needed. */ if (GET_CODE (operands[1]) == CONST_DOUBLE #if HOST_BITS_PER_WIDE_INT == 32 && ((CONST_DOUBLE_HIGH (operands[1]) == 0 @@ -2051,17 +2039,12 @@ && (CONST_DOUBLE_LOW (operands[1]) & 0x80000000) != 0)) #endif ) - operands[1] = GEN_INT (CONST_DOUBLE_LOW (operands[1])); + operands[1] = gen_int_mode (CONST_DOUBLE_LOW (operands[1]), DImode); /* Handle MEM cases first. */ if (GET_CODE (operands[0]) == MEM) { - /* If it's a REG, we can always do it. - The const zero case is more complex, on v9 - we can always perform it. */ - if (register_operand (operands[1], DImode) - || (TARGET_V9 - && (operands[1] == const0_rtx))) + if (register_or_zero_operand (operands[1], DImode)) goto movdi_is_ok; if (! reload_in_progress) @@ -2083,8 +2066,7 @@ if (GET_CODE (operands[1]) == LABEL_REF) { - if (! TARGET_ARCH64) - abort (); + gcc_assert (TARGET_ARCH64); emit_insn (gen_movdi_pic_label_ref (operands[0], operands[1])); DONE; } @@ -2136,15 +2118,15 @@ ;; (reg:DI 2 %g2)) ;; -(define_insn "*movdi_insn_sp32_v9" +(define_insn "*movdi_insn_sp32" [(set (match_operand:DI 0 "nonimmediate_operand" - "=T,o,T,U,o,r,r,r,?T,?f,?f,?o,?e,?e,?W") + "=o,T,U,o,r,r,r,?T,?f,?f,?o,?f") (match_operand:DI 1 "input_operand" - " J,J,U,T,r,o,i,r, f, T, o, f, e, W, e"))] - "! TARGET_ARCH64 && TARGET_V9 - && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)" + " J,U,T,r,o,i,r, f, T, o, f, f"))] + "! TARGET_V9 + && (register_operand (operands[0], DImode) + || register_or_zero_operand (operands[1], DImode))" "@ - stx\t%%g0, %0 # std\t%1, %0 ldd\t%1, %0 @@ -2156,22 +2138,21 @@ ldd\t%1, %0 # # - fmovd\\t%1, %0 - ldd\\t%1, %0 - std\\t%1, %0" - [(set_attr "type" "store,store,store,load,*,*,*,*,fpstore,fpload,*,*,fpmove,fpload,fpstore") - (set_attr "length" "*,2,*,*,2,2,2,2,*,*,2,2,*,*,*") - (set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*")]) + #" + [(set_attr "type" "store,store,load,*,*,*,*,fpstore,fpload,*,*,*") + (set_attr "length" "2,*,*,2,2,2,2,*,*,2,2,2")]) -(define_insn "*movdi_insn_sp32" +(define_insn "*movdi_insn_sp32_v9" [(set (match_operand:DI 0 "nonimmediate_operand" - "=o,T,U,o,r,r,r,?T,?f,?f,?o,?f") + "=T,o,T,U,o,r,r,r,?T,?f,?f,?o,?e,?e,?W") (match_operand:DI 1 "input_operand" - " J,U,T,r,o,i,r, f, T, o, f, f"))] + " J,J,U,T,r,o,i,r, f, T, o, f, e, W, e"))] "! TARGET_ARCH64 + && TARGET_V9 && (register_operand (operands[0], DImode) - || register_operand (operands[1], DImode))" + || register_or_zero_operand (operands[1], DImode))" "@ + stx\t%%g0, %0 # std\t%1, %0 ldd\t%1, %0 @@ -2183,66 +2164,30 @@ ldd\t%1, %0 # # - #" - [(set_attr "type" "store,store,load,*,*,*,*,fpstore,fpload,*,*,*") - (set_attr "length" "2,*,*,2,2,2,2,*,*,2,2,2")]) - -;; The following are generated by sparc_emit_set_const64 -(define_insn "*movdi_sp64_dbl" - [(set (match_operand:DI 0 "register_operand" "=r") - (match_operand:DI 1 "const64_operand" ""))] - "(TARGET_ARCH64 - && HOST_BITS_PER_WIDE_INT != 64)" - "mov\t%1, %0") - -;; This is needed to show CSE exactly which bits are set -;; in a 64-bit register by sethi instructions. -(define_insn "*movdi_const64_special" - [(set (match_operand:DI 0 "register_operand" "=r") - (match_operand:DI 1 "const64_high_operand" ""))] - "TARGET_ARCH64" - "sethi\t%%hi(%a1), %0") + fmovd\\t%1, %0 + ldd\\t%1, %0 + std\\t%1, %0" + [(set_attr "type" "store,store,store,load,*,*,*,*,fpstore,fpload,*,*,fpmove,fpload,fpstore") + (set_attr "length" "*,2,*,*,2,2,2,2,*,*,2,2,*,*,*") + (set_attr "fptype" "*,*,*,*,*,*,*,*,*,*,*,*,double,*,*")]) -(define_insn "*movdi_insn_sp64_novis" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,m,?e,?e,?W") - (match_operand:DI 1 "input_operand" "rI,N,J,m,rJ,e,W,e"))] - "TARGET_ARCH64 && ! TARGET_VIS +(define_insn "*movdi_insn_sp64" + [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,m,?e,?e,?W,b") + (match_operand:DI 1 "input_operand" "rI,N,m,rJ,e,W,e,J"))] + "TARGET_ARCH64 && (register_operand (operands[0], DImode) - || reg_or_0_operand (operands[1], DImode))" - "@ - mov\t%1, %0 - sethi\t%%hi(%a1), %0 - clr\t%0 - ldx\t%1, %0 - stx\t%r1, %0 - fmovd\t%1, %0 - ldd\t%1, %0 - std\t%1, %0" - [(set_attr "type" "*,*,*,load,store,fpmove,fpload,fpstore") - (set_attr "fptype" "*,*,*,*,*,double,*,*")]) - -;; We don't define V1SI because SI should work just fine. -(define_mode_macro V64 [DF V2SI V4HI V8QI]) -(define_mode_macro V32 [SF V2HI V4QI]) - -(define_insn "*movdi_insn_sp64_vis" - [(set (match_operand:DI 0 "nonimmediate_operand" "=r,r,r,r,m,?e,?e,?W,b") - (match_operand:DI 1 "input_operand" "rI,N,J,m,rJ,e,W,e,J"))] - "TARGET_ARCH64 && TARGET_VIS && - (register_operand (operands[0], DImode) - || reg_or_0_operand (operands[1], DImode))" + || register_or_zero_operand (operands[1], DImode))" "@ mov\t%1, %0 sethi\t%%hi(%a1), %0 - clr\t%0 ldx\t%1, %0 stx\t%r1, %0 fmovd\t%1, %0 ldd\t%1, %0 std\t%1, %0 fzero\t%0" - [(set_attr "type" "*,*,*,load,store,fpmove,fpload,fpstore,fga") - (set_attr "fptype" "*,*,*,*,*,double,*,*,double")]) + [(set_attr "type" "*,*,load,store,fpmove,fpload,fpstore,fga") + (set_attr "fptype" "*,*,*,*,double,*,*,double")]) (define_expand "movdi_pic_label_ref" [(set (match_dup 3) (high:DI @@ -2303,7 +2248,7 @@ (define_insn "*sethi_di_medlow_embmedany_pic" [(set (match_operand:DI 0 "register_operand" "=r") - (high:DI (match_operand:DI 1 "sp64_medium_pic_operand" "")))] + (high:DI (match_operand:DI 1 "medium_pic_operand" "")))] "(TARGET_CM_MEDLOW || TARGET_CM_EMBMEDANY) && check_pic (1)" "sethi\t%%hi(%a1), %0") @@ -2459,7 +2404,9 @@ /* Slick... but this trick loses if this subreg constant part can be done in one insn. */ - if (low == high && (low & 0x3ff) != 0 && low + 0x1000 >= 0x2000) + if (low == high + && ! SPARC_SETHI32_P (high) + && ! SPARC_SIMM13_P (high)) emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), gen_highpart (SImode, operands[0]))); else @@ -2487,8 +2434,8 @@ /* Slick... but this trick loses if this subreg constant part can be done in one insn. */ if (CONST_DOUBLE_LOW (operands[1]) == CONST_DOUBLE_HIGH (operands[1]) - && !(SPARC_SETHI32_P (CONST_DOUBLE_HIGH (operands[1])) - || SPARC_SIMM13_P (CONST_DOUBLE_HIGH (operands[1])))) + && ! SPARC_SETHI32_P (CONST_DOUBLE_HIGH (operands[1])) + && ! SPARC_SIMM13_P (CONST_DOUBLE_HIGH (operands[1]))) { emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), gen_highpart (SImode, operands[0]))); @@ -2584,7 +2531,7 @@ (define_split [(set (match_operand:DI 0 "memory_operand" "") - (const_int 0))] + (match_operand:DI 1 "const_zero_operand" ""))] "reload_completed && (! TARGET_V9 || (! TARGET_ARCH64 @@ -2596,66 +2543,87 @@ emit_insn (gen_movsi (adjust_address (operands[0], SImode, 4), const0_rtx)); DONE; }) - -;; Floating point move insns -(define_insn "*movsf_insn_novis" - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,*r,*r,*r,*r,*r,f,m,m") - (match_operand:SF 1 "input_operand" "f,G,Q,*rR,S,m,m,f,*rG"))] - "(TARGET_FPU && ! TARGET_VIS) - && (register_operand (operands[0], SFmode) - || register_operand (operands[1], SFmode) - || fp_zero_operand (operands[1], SFmode))" + +;; Floating point and vector move instructions + +;; We don't define V1SI because SI should work just fine. +(define_mode_macro V32 [SF V2HI V4QI]) + +;; Yes, you guessed it right, the former movsf expander. +(define_expand "mov" + [(set (match_operand:V32 0 "general_operand" "") + (match_operand:V32 1 "general_operand" ""))] + "mode == SFmode || TARGET_VIS" { - if (GET_CODE (operands[1]) == CONST_DOUBLE - && (which_alternative == 2 - || which_alternative == 3 - || which_alternative == 4)) + /* Force constants into memory. */ + if (GET_CODE (operands[0]) == REG && CONSTANT_P (operands[1])) { - REAL_VALUE_TYPE r; - long i; + /* emit_group_store will send such bogosity to us when it is + not storing directly into memory. So fix this up to avoid + crashes in output_constant_pool. */ + if (operands [1] == const0_rtx) + operands[1] = CONST0_RTX (mode); - REAL_VALUE_FROM_CONST_DOUBLE (r, operands[1]); - REAL_VALUE_TO_TARGET_SINGLE (r, i); - operands[1] = GEN_INT (i); + if ((TARGET_VIS || REGNO (operands[0]) < 32) + && const_zero_operand (operands[1], mode)) + goto movsf_is_ok; + + /* We are able to build any SF constant in integer registers + with at most 2 instructions. */ + if (REGNO (operands[0]) < 32 + && mode == SFmode) + goto movsf_is_ok; + + operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), + operands[1])); } - switch (which_alternative) + /* Handle sets of MEM first. */ + if (GET_CODE (operands[0]) == MEM) { - case 0: - return "fmovs\t%1, %0"; - case 1: - return "clr\t%0"; - case 2: - return "sethi\t%%hi(%a1), %0"; - case 3: - return "mov\t%1, %0"; - case 4: - return "#"; - case 5: - case 6: - return "ld\t%1, %0"; - case 7: - case 8: - return "st\t%r1, %0"; - default: - abort(); + if (register_or_zero_operand (operands[1], mode)) + goto movsf_is_ok; + + if (! reload_in_progress) + { + operands[0] = validize_mem (operands[0]); + operands[1] = force_reg (mode, operands[1]); + } } -} - [(set_attr "type" "fpmove,*,*,*,*,load,fpload,fpstore,store")]) -(define_insn "*movsf_insn_vis" - [(set (match_operand:V32 0 "nonimmediate_operand" "=f,f,*r,*r,*r,*r,*r,f,m,m") - (match_operand:V32 1 "input_operand" "f,GY,GY,Q,*rR,S,m,m,f,*rGY"))] - "(TARGET_FPU && TARGET_VIS) + /* Fixup PIC cases. */ + if (flag_pic) + { + if (CONSTANT_P (operands[1]) + && pic_address_needs_scratch (operands[1])) + operands[1] = legitimize_pic_address (operands[1], mode, 0); + + if (symbolic_operand (operands[1], mode)) + { + operands[1] = legitimize_pic_address (operands[1], + mode, + (reload_in_progress ? + operands[0] : + NULL_RTX)); + } + } + + movsf_is_ok: + ; +}) + +(define_insn "*movsf_insn" + [(set (match_operand:V32 0 "nonimmediate_operand" "=d,f,*r,*r,*r,f,*r,m,m") + (match_operand:V32 1 "input_operand" "GY,f,*rRY,Q,S,m,m,f,*rGY"))] + "TARGET_FPU && (register_operand (operands[0], mode) - || register_operand (operands[1], mode) - || fp_zero_operand (operands[1], mode))" + || register_or_zero_operand (operands[1], mode))" { if (GET_CODE (operands[1]) == CONST_DOUBLE - && (which_alternative == 3 - || which_alternative == 4 - || which_alternative == 5)) + && (which_alternative == 2 + || which_alternative == 3 + || which_alternative == 4)) { REAL_VALUE_TYPE r; long i; @@ -2668,45 +2636,42 @@ switch (which_alternative) { case 0: - return "fmovs\t%1, %0"; - case 1: return "fzeros\t%0"; + case 1: + return "fmovs\t%1, %0"; case 2: - return "clr\t%0"; + return "mov\t%1, %0"; case 3: return "sethi\t%%hi(%a1), %0"; case 4: - return "mov\t%1, %0"; - case 5: return "#"; + case 5: case 6: - case 7: return "ld\t%1, %0"; + case 7: case 8: - case 9: return "st\t%r1, %0"; default: - abort(); + gcc_unreachable (); } } - [(set_attr "type" "fpmove,fga,*,*,*,*,load,fpload,fpstore,store")]) + [(set_attr "type" "fga,fpmove,*,*,*,fpload,load,fpstore,store")]) ;; Exactly the same as above, except that all `f' cases are deleted. ;; This is necessary to prevent reload from ever trying to use a `f' reg ;; when -mno-fpu. -(define_insn "*movsf_no_f_insn" - [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,r,r,m") - (match_operand:SF 1 "input_operand" "G,Q,rR,S,m,rG"))] +(define_insn "*movsf_insn_no_fpu" + [(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,r,r,m") + (match_operand:SF 1 "input_operand" "rR,Q,S,m,rG"))] "! TARGET_FPU && (register_operand (operands[0], SFmode) - || register_operand (operands[1], SFmode) - || fp_zero_operand (operands[1], SFmode))" + || register_or_zero_operand (operands[1], SFmode))" { if (GET_CODE (operands[1]) == CONST_DOUBLE - && (which_alternative == 1 - || which_alternative == 2 - || which_alternative == 3)) + && (which_alternative == 0 + || which_alternative == 1 + || which_alternative == 2)) { REAL_VALUE_TYPE r; long i; @@ -2719,30 +2684,28 @@ switch (which_alternative) { case 0: - return "clr\t%0"; + return "mov\t%1, %0"; case 1: return "sethi\t%%hi(%a1), %0"; case 2: - return "mov\t%1, %0"; - case 3: return "#"; - case 4: + case 3: return "ld\t%1, %0"; - case 5: + case 4: return "st\t%r1, %0"; default: - abort(); + gcc_unreachable (); } } - [(set_attr "type" "*,*,*,*,load,store")]) + [(set_attr "type" "*,*,*,load,store")]) ;; The following 3 patterns build SFmode constants in integer registers. (define_insn "*movsf_lo_sum" [(set (match_operand:SF 0 "register_operand" "=r") (lo_sum:SF (match_operand:SF 1 "register_operand" "r") - (match_operand:SF 2 "const_double_operand" "S")))] - "fp_high_losum_p (operands[2])" + (match_operand:SF 2 "fp_const_high_losum_operand" "S")))] + "" { REAL_VALUE_TYPE r; long i; @@ -2755,8 +2718,8 @@ (define_insn "*movsf_high" [(set (match_operand:SF 0 "register_operand" "=r") - (high:SF (match_operand:SF 1 "const_double_operand" "S")))] - "fp_high_losum_p (operands[1])" + (high:SF (match_operand:SF 1 "fp_const_high_losum_operand" "S")))] + "" { REAL_VALUE_TYPE r; long i; @@ -2769,76 +2732,12 @@ (define_split [(set (match_operand:SF 0 "register_operand" "") - (match_operand:SF 1 "const_double_operand" ""))] - "fp_high_losum_p (operands[1]) - && (GET_CODE (operands[0]) == REG - && REGNO (operands[0]) < 32)" + (match_operand:SF 1 "fp_const_high_losum_operand" ""))] + "REG_P (operands[0]) && REGNO (operands[0]) < 32" [(set (match_dup 0) (high:SF (match_dup 1))) (set (match_dup 0) (lo_sum:SF (match_dup 0) (match_dup 1)))]) -;; Yes, you guessed it right, the former movsf expander. -(define_expand "mov" - [(set (match_operand:V32 0 "general_operand" "") - (match_operand:V32 1 "general_operand" ""))] - "mode == SFmode || TARGET_VIS" -{ - /* Force constants into memory. */ - if (GET_CODE (operands[0]) == REG && CONSTANT_P (operands[1])) - { - /* emit_group_store will send such bogosity to us when it is - not storing directly into memory. So fix this up to avoid - crashes in output_constant_pool. */ - if (operands [1] == const0_rtx) - operands[1] = CONST0_RTX (mode); - - if ((TARGET_VIS || REGNO (operands[0]) < 32) - && fp_zero_operand (operands[1], mode)) - goto movsf_is_ok; - - /* We are able to build any SF constant in integer registers - with at most 2 instructions. */ - if (REGNO (operands[0]) < 32 - && mode == SFmode) - goto movsf_is_ok; - - operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), - operands[1])); - } - - /* Handle sets of MEM first. */ - if (GET_CODE (operands[0]) == MEM) - { - if (register_operand (operands[1], mode) - || fp_zero_operand (operands[1], mode)) - goto movsf_is_ok; - - if (! reload_in_progress) - { - operands[0] = validize_mem (operands[0]); - operands[1] = force_reg (mode, operands[1]); - } - } - - /* Fixup PIC cases. */ - if (flag_pic) - { - if (CONSTANT_P (operands[1]) - && pic_address_needs_scratch (operands[1])) - operands[1] = legitimize_pic_address (operands[1], mode, 0); - - if (symbolic_operand (operands[1], mode)) - { - operands[1] = legitimize_pic_address (operands[1], - mode, - (reload_in_progress ? - operands[0] : - NULL_RTX)); - } - } - - movsf_is_ok: - ; -}) +(define_mode_macro V64 [DF V2SI V4HI V8QI]) ;; Yes, you again guessed it right, the former movdf expander. (define_expand "mov" @@ -2856,7 +2755,7 @@ operands[1] = CONST0_RTX (mode); if ((TARGET_VIS || REGNO (operands[0]) < 32) - && fp_zero_operand (operands[1], mode)) + && const_zero_operand (operands[1], mode)) goto movdf_is_ok; /* We are able to build any DF constant in integer registers. */ @@ -2872,8 +2771,7 @@ /* Handle MEM cases first. */ if (GET_CODE (operands[0]) == MEM) { - if (register_operand (operands[1], mode) - || fp_zero_operand (operands[1], mode)) + if (register_or_zero_operand (operands[1], mode)) goto movdf_is_ok; if (! reload_in_progress) @@ -2911,8 +2809,7 @@ "TARGET_FPU && ! TARGET_V9 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ ldd\t%1, %0 std\t%1, %0 @@ -2927,15 +2824,13 @@ [(set_attr "type" "fpload,fpstore,load,store,*,*,*,*,*,*") (set_attr "length" "*,*,*,*,2,2,2,2,2,2")]) -(define_insn "*movdf_no_e_insn_sp32" +(define_insn "*movdf_insn_sp32_no_fpu" [(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,o,r,o") (match_operand:DF 1 "input_operand" "T,U,G,ro,r"))] "! TARGET_FPU && ! TARGET_V9 - && ! TARGET_ARCH64 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ ldd\t%1, %0 std\t%1, %0 @@ -2945,61 +2840,15 @@ [(set_attr "type" "load,store,*,*,*") (set_attr "length" "*,*,2,2,2")]) -(define_insn "*movdf_no_e_insn_v9_sp32" - [(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,T,r,o") - (match_operand:DF 1 "input_operand" "T,U,G,ro,rG"))] - "! TARGET_FPU - && TARGET_V9 - && ! TARGET_ARCH64 - && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" - "@ - ldd\t%1, %0 - std\t%1, %0 - stx\t%r1, %0 - # - #" - [(set_attr "type" "load,store,store,*,*") - (set_attr "length" "*,*,*,2,2")]) - -;; We have available v9 double floats but not 64-bit -;; integer registers and no VIS. -(define_insn "*movdf_insn_v9only_novis" - [(set (match_operand:DF 0 "nonimmediate_operand" "=e,e,T,W,U,T,f,*r,o") - (match_operand:DF 1 "input_operand" "e,W#F,G,e,T,U,o#F,*roF,*rGf"))] - "TARGET_FPU - && TARGET_V9 - && ! TARGET_VIS - && ! TARGET_ARCH64 - && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" - "@ - fmovd\t%1, %0 - ldd\t%1, %0 - stx\t%r1, %0 - std\t%1, %0 - ldd\t%1, %0 - std\t%1, %0 - # - # - #" - [(set_attr "type" "fpmove,load,store,store,load,store,*,*,*") - (set_attr "length" "*,*,*,*,*,*,2,2,2") - (set_attr "fptype" "double,*,*,*,*,*,*,*,*")]) - -;; We have available v9 double floats but not 64-bit -;; integer registers but we have VIS. -(define_insn "*movdf_insn_v9only_vis" - [(set (match_operand:V64 0 "nonimmediate_operand" "=e,e,e,T,W,U,T,f,*r,o") +;; We have available v9 double floats but not 64-bit integer registers. +(define_insn "*movdf_insn_sp32_v9" + [(set (match_operand:V64 0 "nonimmediate_operand" "=b,e,e,T,W,U,T,f,*r,o") (match_operand:V64 1 "input_operand" "GY,e,W#F,GY,e,T,U,o#F,*roGYF,*rGYf"))] "TARGET_FPU - && TARGET_VIS + && TARGET_V9 && ! TARGET_ARCH64 && (register_operand (operands[0], mode) - || register_operand (operands[1], mode) - || fp_zero_operand (operands[1], mode))" + || register_or_zero_operand (operands[1], mode))" "@ fzero\t%0 fmovd\t%1, %0 @@ -3015,40 +2864,31 @@ (set_attr "length" "*,*,*,*,*,*,*,2,2,2") (set_attr "fptype" "double,double,*,*,*,*,*,*,*,*")]) -;; We have available both v9 double floats and 64-bit -;; integer registers. No VIS though. -(define_insn "*movdf_insn_sp64_novis" - [(set (match_operand:DF 0 "nonimmediate_operand" "=e,e,W,*r,*r,m,*r") - (match_operand:DF 1 "input_operand" "e,W#F,e,*rG,m,*rG,F"))] - "TARGET_FPU - && ! TARGET_VIS - && TARGET_ARCH64 +(define_insn "*movdf_insn_sp32_v9_no_fpu" + [(set (match_operand:DF 0 "nonimmediate_operand" "=U,T,T,r,o") + (match_operand:DF 1 "input_operand" "T,U,G,ro,rG"))] + "! TARGET_FPU + && TARGET_V9 + && ! TARGET_ARCH64 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ - fmovd\t%1, %0 ldd\t%1, %0 std\t%1, %0 - mov\t%r1, %0 - ldx\t%1, %0 stx\t%r1, %0 + # #" - [(set_attr "type" "fpmove,load,store,*,load,store,*") - (set_attr "length" "*,*,*,*,*,*,2") - (set_attr "fptype" "double,*,*,*,*,*,*")]) - -;; We have available both v9 double floats and 64-bit -;; integer registers. And we have VIS. -(define_insn "*movdf_insn_sp64_vis" - [(set (match_operand:V64 0 "nonimmediate_operand" "=e,e,e,W,*r,*r,m,*r") + [(set_attr "type" "load,store,store,*,*") + (set_attr "length" "*,*,*,2,2")]) + +;; We have available both v9 double floats and 64-bit integer registers. +(define_insn "*movdf_insn_sp64" + [(set (match_operand:V64 0 "nonimmediate_operand" "=b,e,e,W,*r,*r,m,*r") (match_operand:V64 1 "input_operand" "GY,e,W#F,e,*rGY,m,*rGY,F"))] "TARGET_FPU - && TARGET_VIS && TARGET_ARCH64 && (register_operand (operands[0], mode) - || register_operand (operands[1], mode) - || fp_zero_operand (operands[1], mode))" + || register_or_zero_operand (operands[1], mode))" "@ fzero\t%0 fmovd\t%1, %0 @@ -3062,14 +2902,13 @@ (set_attr "length" "*,*,*,*,*,*,*,2") (set_attr "fptype" "double,double,*,*,*,*,*,*")]) -(define_insn "*movdf_no_e_insn_sp64" +(define_insn "*movdf_insn_sp64_no_fpu" [(set (match_operand:DF 0 "nonimmediate_operand" "=r,r,m") (match_operand:DF 1 "input_operand" "r,m,rG"))] "! TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], DFmode) - || register_operand (operands[1], DFmode) - || fp_zero_operand (operands[1], DFmode))" + || register_or_zero_operand (operands[1], DFmode))" "@ mov\t%1, %0 ldx\t%1, %0 @@ -3083,7 +2922,7 @@ "TARGET_FPU && (GET_CODE (operands[0]) == REG && REGNO (operands[0]) < 32) - && ! fp_zero_operand(operands[1], DFmode) + && ! const_zero_operand(operands[1], DFmode) && reload_completed" [(clobber (const_int 0))] { @@ -3096,27 +2935,26 @@ if (TARGET_ARCH64) { -#if HOST_BITS_PER_WIDE_INT == 64 +#if HOST_BITS_PER_WIDE_INT == 32 + gcc_unreachable (); +#else HOST_WIDE_INT val; val = ((HOST_WIDE_INT)(unsigned long)l[1] | ((HOST_WIDE_INT)(unsigned long)l[0] << 32)); - emit_insn (gen_movdi (operands[0], GEN_INT (val))); -#else - emit_insn (gen_movdi (operands[0], - immed_double_const (l[1], l[0], DImode))); + emit_insn (gen_movdi (operands[0], gen_int_mode (val, DImode))); #endif } else { emit_insn (gen_movsi (gen_highpart (SImode, operands[0]), - GEN_INT (l[0]))); + gen_int_mode (l[0], SImode))); /* Slick... but this trick loses if this subreg constant part can be done in one insn. */ if (l[1] == l[0] - && !(SPARC_SETHI32_P (l[0]) - || SPARC_SIMM13_P (l[0]))) + && ! SPARC_SETHI32_P (l[0]) + && ! SPARC_SIMM13_P (l[0])) { emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), gen_highpart (SImode, operands[0]))); @@ -3124,7 +2962,7 @@ else { emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), - GEN_INT (l[1]))); + gen_int_mode (l[1], SImode))); } } DONE; @@ -3244,7 +3082,7 @@ (define_split [(set (match_operand:V64 0 "memory_operand" "") - (match_operand:V64 1 "fp_zero_operand" ""))] + (match_operand:V64 1 "const_zero_operand" ""))] "reload_completed && (! TARGET_V9 || (! TARGET_ARCH64 @@ -3271,7 +3109,7 @@ (define_split [(set (match_operand:V64 0 "register_operand" "") - (match_operand:V64 1 "fp_zero_operand" ""))] + (match_operand:V64 1 "const_zero_operand" ""))] "reload_completed && ! TARGET_ARCH64 && ((GET_CODE (operands[0]) == REG @@ -3313,7 +3151,7 @@ if (operands [1] == const0_rtx) operands[1] = CONST0_RTX (TFmode); - if (TARGET_VIS && fp_zero_operand (operands[1], TFmode)) + if (TARGET_VIS && const_zero_operand (operands[1], TFmode)) goto movtf_is_ok; operands[1] = validize_mem (force_const_mem (GET_MODE (operands[0]), @@ -3324,8 +3162,7 @@ full 16-byte alignment for quads. */ if (GET_CODE (operands[0]) == MEM) { - if (register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode)) + if (register_or_zero_operand (operands[1], TFmode)) goto movtf_is_ok; if (! reload_in_progress) @@ -3356,29 +3193,13 @@ ; }) -;; Be careful, fmovq and {st,ld}{x,q} do not exist when !arch64 so -;; we must split them all. :-( (define_insn "*movtf_insn_sp32" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,U,r") - (match_operand:TF 1 "input_operand" "oe,GeUr,o,roG"))] - "TARGET_FPU - && ! TARGET_VIS - && ! TARGET_ARCH64 - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "#" - [(set_attr "length" "4")]) - -(define_insn "*movtf_insn_vis_sp32" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,U,r") - (match_operand:TF 1 "input_operand" "Goe,GeUr,o,roG"))] + [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,o,U,r") + (match_operand:TF 1 "input_operand" "G,oe,GeUr,o,roG"))] "TARGET_FPU - && TARGET_VIS && ! TARGET_ARCH64 && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "4")]) @@ -3386,94 +3207,52 @@ ;; This is necessary to prevent reload from ever trying to use a `e' reg ;; when -mno-fpu. -(define_insn "*movtf_no_e_insn_sp32" +(define_insn "*movtf_insn_sp32_no_fpu" [(set (match_operand:TF 0 "nonimmediate_operand" "=o,U,o,r,o") - (match_operand:TF 1 "input_operand" "G,o,U,roG,r"))] - "! TARGET_FPU - && ! TARGET_ARCH64 - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "#" - [(set_attr "length" "4")]) - -;; Now handle the float reg cases directly when arch64, -;; hard_quad, and proper reg number alignment are all true. -(define_insn "*movtf_insn_hq_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,e,m,o,r") - (match_operand:TF 1 "input_operand" "e,m,e,Gr,roG"))] - "TARGET_FPU - && ! TARGET_VIS - && TARGET_ARCH64 - && TARGET_HARD_QUAD - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "@ - fmovq\t%1, %0 - ldq\t%1, %0 - stq\t%1, %0 - # - #" - [(set_attr "type" "fpmove,fpload,fpstore,*,*") - (set_attr "length" "*,*,*,2,2")]) - -(define_insn "*movtf_insn_hq_vis_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,e,m,eo,r,o") - (match_operand:TF 1 "input_operand" "e,m,e,G,roG,r"))] - "TARGET_FPU - && TARGET_VIS - && TARGET_ARCH64 - && TARGET_HARD_QUAD - && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "@ - fmovq\t%1, %0 - ldq\t%1, %0 - stq\t%1, %0 - # - # - #" - [(set_attr "type" "fpmove,fpload,fpstore,*,*,*") - (set_attr "length" "*,*,*,2,2,2")]) + (match_operand:TF 1 "input_operand" "G,o,U,roG,r"))] + "! TARGET_FPU + && ! TARGET_ARCH64 + && (register_operand (operands[0], TFmode) + || register_or_zero_operand (operands[1], TFmode))" + "#" + [(set_attr "length" "4")]) -;; Now we allow the integer register cases even when -;; only arch64 is true. (define_insn "*movtf_insn_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,r") - (match_operand:TF 1 "input_operand" "oe,Ger,orG"))] + [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,o,r") + (match_operand:TF 1 "input_operand" "G,oe,Ger,roG"))] "TARGET_FPU - && ! TARGET_VIS && TARGET_ARCH64 && ! TARGET_HARD_QUAD && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "2")]) -(define_insn "*movtf_insn_vis_sp64" - [(set (match_operand:TF 0 "nonimmediate_operand" "=e,o,r") - (match_operand:TF 1 "input_operand" "Goe,Ger,orG"))] +(define_insn "*movtf_insn_sp64_hq" + [(set (match_operand:TF 0 "nonimmediate_operand" "=b,e,e,m,o,r") + (match_operand:TF 1 "input_operand" "G,e,m,e,rG,roG"))] "TARGET_FPU - && TARGET_VIS && TARGET_ARCH64 - && ! TARGET_HARD_QUAD + && TARGET_HARD_QUAD && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" - "#" - [(set_attr "length" "2")]) + || register_or_zero_operand (operands[1], TFmode))" + "@ + # + fmovq\t%1, %0 + ldq\t%1, %0 + stq\t%1, %0 + # + #" + [(set_attr "type" "*,fpmove,fpload,fpstore,*,*") + (set_attr "length" "2,*,*,*,2,2")]) -(define_insn "*movtf_no_e_insn_sp64" +(define_insn "*movtf_insn_sp64_no_fpu" [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o") (match_operand:TF 1 "input_operand" "orG,rG"))] "! TARGET_FPU && TARGET_ARCH64 && (register_operand (operands[0], TFmode) - || register_operand (operands[1], TFmode) - || fp_zero_operand (operands[1], TFmode))" + || register_or_zero_operand (operands[1], TFmode))" "#" [(set_attr "length" "2")]) @@ -3515,7 +3294,7 @@ (define_split [(set (match_operand:TF 0 "nonimmediate_operand" "") - (match_operand:TF 1 "fp_zero_operand" ""))] + (match_operand:TF 1 "const_zero_operand" ""))] "reload_completed" [(clobber (const_int 0))] { @@ -3533,7 +3312,7 @@ dest2 = adjust_address (set_dest, DFmode, 8); break; default: - abort (); + gcc_unreachable (); } emit_insn (gen_movdf (dest1, CONST0_RTX (DFmode))); @@ -3594,8 +3373,9 @@ gen_df_reg (set_src, 1))); DONE; }) - -;; SPARC V9 conditional move instructions. + + +;; SPARC-V9 conditional move instructions. ;; We can handle larger constants here for some flavors, but for now we keep ;; it simple and only allow those constants supported by all flavors. @@ -3690,8 +3470,8 @@ (define_expand "movdicc" [(set (match_operand:DI 0 "register_operand" "") (if_then_else:DI (match_operand 1 "comparison_operator" "") - (match_operand:DI 2 "arith10_double_operand" "") - (match_operand:DI 3 "arith10_double_operand" "")))] + (match_operand:DI 2 "arith10_operand" "") + (match_operand:DI 3 "arith10_operand" "")))] "TARGET_ARCH64" { enum rtx_code code = GET_CODE (operands[1]); @@ -3805,7 +3585,7 @@ (define_insn "*movqi_cc_sp64" [(set (match_operand:QI 0 "register_operand" "=r,r") (if_then_else:QI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:QI 3 "arith11_operand" "rL,0") (match_operand:QI 4 "arith11_operand" "0,rL")))] @@ -3818,7 +3598,7 @@ (define_insn "*movhi_cc_sp64" [(set (match_operand:HI 0 "register_operand" "=r,r") (if_then_else:HI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:HI 3 "arith11_operand" "rL,0") (match_operand:HI 4 "arith11_operand" "0,rL")))] @@ -3831,7 +3611,7 @@ (define_insn "*movsi_cc_sp64" [(set (match_operand:SI 0 "register_operand" "=r,r") (if_then_else:SI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:SI 3 "arith11_operand" "rL,0") (match_operand:SI 4 "arith11_operand" "0,rL")))] @@ -3841,14 +3621,13 @@ mov%c1\t%x2, %4, %0" [(set_attr "type" "cmove")]) -;; ??? The constraints of operands 3,4 need work. (define_insn "*movdi_cc_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") (if_then_else:DI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) - (match_operand:DI 3 "arith11_double_operand" "rLH,0") - (match_operand:DI 4 "arith11_double_operand" "0,rLH")))] + (match_operand:DI 3 "arith11_operand" "rL,0") + (match_operand:DI 4 "arith11_operand" "0,rL")))] "TARGET_ARCH64" "@ mov%C1\t%x2, %3, %0 @@ -3858,10 +3637,10 @@ (define_insn "*movdi_cc_sp64_trunc" [(set (match_operand:SI 0 "register_operand" "=r,r") (if_then_else:SI (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) - (match_operand:SI 3 "arith11_double_operand" "rLH,0") - (match_operand:SI 4 "arith11_double_operand" "0,rLH")))] + (match_operand:SI 3 "arith11_operand" "rL,0") + (match_operand:SI 4 "arith11_operand" "0,rL")))] "TARGET_ARCH64" "@ mov%C1\t%x2, %3, %0 @@ -3871,7 +3650,7 @@ (define_insn "*movsf_cc_sp64" [(set (match_operand:SF 0 "register_operand" "=f,f") (if_then_else:SF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:SF 3 "register_operand" "f,0") (match_operand:SF 4 "register_operand" "0,f")))] @@ -3884,7 +3663,7 @@ (define_insn "movdf_cc_sp64" [(set (match_operand:DF 0 "register_operand" "=e,e") (if_then_else:DF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:DF 3 "register_operand" "e,0") (match_operand:DF 4 "register_operand" "0,e")))] @@ -3898,7 +3677,7 @@ (define_insn "*movtf_cc_hq_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") (if_then_else:TF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") (match_operand:TF 4 "register_operand" "0,e")))] @@ -3911,7 +3690,7 @@ (define_insn_and_split "*movtf_cc_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") (if_then_else:TF (match_operator 1 "comparison_operator" - [(match_operand 2 "icc_or_fcc_reg_operand" "X,X") + [(match_operand 2 "icc_or_fcc_register_operand" "X,X") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") (match_operand:TF 4 "register_operand" "0,e")))] @@ -3953,7 +3732,7 @@ (define_insn "*movqi_cc_reg_sp64" [(set (match_operand:QI 0 "register_operand" "=r,r") - (if_then_else:QI (match_operator 1 "v9_regcmp_op" + (if_then_else:QI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:QI 3 "arith10_operand" "rM,0") @@ -3966,7 +3745,7 @@ (define_insn "*movhi_cc_reg_sp64" [(set (match_operand:HI 0 "register_operand" "=r,r") - (if_then_else:HI (match_operator 1 "v9_regcmp_op" + (if_then_else:HI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:HI 3 "arith10_operand" "rM,0") @@ -3979,7 +3758,7 @@ (define_insn "*movsi_cc_reg_sp64" [(set (match_operand:SI 0 "register_operand" "=r,r") - (if_then_else:SI (match_operator 1 "v9_regcmp_op" + (if_then_else:SI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:SI 3 "arith10_operand" "rM,0") @@ -3990,27 +3769,13 @@ movr%d1\t%2, %r4, %0" [(set_attr "type" "cmove")]) -;; ??? The constraints of operands 3,4 need work. (define_insn "*movdi_cc_reg_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") - (if_then_else:DI (match_operator 1 "v9_regcmp_op" - [(match_operand:DI 2 "register_operand" "r,r") - (const_int 0)]) - (match_operand:DI 3 "arith10_double_operand" "rMH,0") - (match_operand:DI 4 "arith10_double_operand" "0,rMH")))] - "TARGET_ARCH64" - "@ - movr%D1\t%2, %r3, %0 - movr%d1\t%2, %r4, %0" - [(set_attr "type" "cmove")]) - -(define_insn "*movdi_cc_reg_sp64_trunc" - [(set (match_operand:SI 0 "register_operand" "=r,r") - (if_then_else:SI (match_operator 1 "v9_regcmp_op" + (if_then_else:DI (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) - (match_operand:SI 3 "arith10_double_operand" "rMH,0") - (match_operand:SI 4 "arith10_double_operand" "0,rMH")))] + (match_operand:DI 3 "arith10_operand" "rM,0") + (match_operand:DI 4 "arith10_operand" "0,rM")))] "TARGET_ARCH64" "@ movr%D1\t%2, %r3, %0 @@ -4019,7 +3784,7 @@ (define_insn "*movsf_cc_reg_sp64" [(set (match_operand:SF 0 "register_operand" "=f,f") - (if_then_else:SF (match_operator 1 "v9_regcmp_op" + (if_then_else:SF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:SF 3 "register_operand" "f,0") @@ -4032,7 +3797,7 @@ (define_insn "movdf_cc_reg_sp64" [(set (match_operand:DF 0 "register_operand" "=e,e") - (if_then_else:DF (match_operator 1 "v9_regcmp_op" + (if_then_else:DF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:DF 3 "register_operand" "e,0") @@ -4046,7 +3811,7 @@ (define_insn "*movtf_cc_reg_hq_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") - (if_then_else:TF (match_operator 1 "v9_regcmp_op" + (if_then_else:TF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") @@ -4059,7 +3824,7 @@ (define_insn_and_split "*movtf_cc_reg_sp64" [(set (match_operand:TF 0 "register_operand" "=e,e") - (if_then_else:TF (match_operator 1 "v9_regcmp_op" + (if_then_else:TF (match_operator 1 "v9_register_compare_operator" [(match_operand:DI 2 "register_operand" "r,r") (const_int 0)]) (match_operand:TF 3 "register_operand" "e,0") @@ -4101,7 +3866,7 @@ [(set_attr "length" "2")]) -;;- zero extension instructions +;; Zero-extension instructions ;; These patterns originally accepted general_operands, however, slightly ;; better code is generated by only accepting register_operands, and then @@ -4217,7 +3982,6 @@ [(set_attr "type" "load") (set_attr "us3load_type" "3cycle")]) - ;; ??? Write truncdisi pattern using sra? (define_expand "zero_extendsidi2" @@ -4381,7 +4145,8 @@ "andcc\t%1, 0xff, %0" [(set_attr "type" "compare")]) -;;- sign extension instructions + +;; Sign-extension instructions ;; These patterns originally accepted general_operands, however, slightly ;; better code is generated by only accepting register_operands, and then @@ -4566,7 +4331,8 @@ ldsw\t%1, %0" [(set_attr "type" "shift,sload") (set_attr "us3load_type" "*,3cycle")]) - + + ;; Special pattern for optimizing bit-field compares. This is needed ;; because combine uses this as a canonical form. @@ -4574,23 +4340,14 @@ [(set (reg:CC 100) (compare:CC (zero_extract:SI (match_operand:SI 0 "register_operand" "r") - (match_operand:SI 1 "small_int_or_double" "n") - (match_operand:SI 2 "small_int_or_double" "n")) + (match_operand:SI 1 "small_int_operand" "I") + (match_operand:SI 2 "small_int_operand" "I")) (const_int 0)))] - "(GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) > 19) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && CONST_DOUBLE_LOW (operands[2]) > 19)" -{ - int len = (GET_CODE (operands[1]) == CONST_INT - ? INTVAL (operands[1]) - : CONST_DOUBLE_LOW (operands[1])); - int pos = 32 - - (GET_CODE (operands[2]) == CONST_INT - ? INTVAL (operands[2]) - : CONST_DOUBLE_LOW (operands[2])) - len; + "INTVAL (operands[2]) > 19" +{ + int len = INTVAL (operands[1]); + int pos = 32 - INTVAL (operands[2]) - len; HOST_WIDE_INT mask = ((1 << len) - 1) << pos; - operands[1] = GEN_INT (mask); return "andcc\t%0, %1, %%g0"; } @@ -4600,29 +4357,20 @@ [(set (reg:CCX 100) (compare:CCX (zero_extract:DI (match_operand:DI 0 "register_operand" "r") - (match_operand:SI 1 "small_int_or_double" "n") - (match_operand:SI 2 "small_int_or_double" "n")) + (match_operand:SI 1 "small_int_operand" "I") + (match_operand:SI 2 "small_int_operand" "I")) (const_int 0)))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) > 51) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && CONST_DOUBLE_LOW (operands[2]) > 51))" -{ - int len = (GET_CODE (operands[1]) == CONST_INT - ? INTVAL (operands[1]) - : CONST_DOUBLE_LOW (operands[1])); - int pos = 64 - - (GET_CODE (operands[2]) == CONST_INT - ? INTVAL (operands[2]) - : CONST_DOUBLE_LOW (operands[2])) - len; + "TARGET_ARCH64 && INTVAL (operands[2]) > 51" +{ + int len = INTVAL (operands[1]); + int pos = 64 - INTVAL (operands[2]) - len; HOST_WIDE_INT mask = (((unsigned HOST_WIDE_INT) 1 << len) - 1) << pos; - operands[1] = GEN_INT (mask); return "andcc\t%0, %1, %%g0"; } [(set_attr "type" "compare")]) - + + ;; Conversions between float, double and long double. (define_insn "extendsfdf2" @@ -4702,7 +4450,8 @@ "TARGET_FPU && TARGET_HARD_QUAD" "fqtod\t%1, %0" [(set_attr "type" "fp")]) - + + ;; Conversion between fixed point and floating point. (define_insn "floatsisf2" @@ -4875,8 +4624,9 @@ (unsigned_fix:DI (match_operand:TF 1 "general_operand" "")))] "TARGET_FPU && TARGET_ARCH64 && ! TARGET_HARD_QUAD" "emit_tfmode_cvt (UNSIGNED_FIX, operands); DONE;") - -;;- arithmetic instructions + + +;; Integer addition/subtraction instructions. (define_expand "adddi3" [(set (match_operand:DI 0 "register_operand" "") @@ -4934,41 +4684,6 @@ } [(set_attr "length" "2")]) -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_operand:DI 1 "arith_double_operand" "") - (match_operand:DI 2 "arith_double_operand" ""))) - (clobber (reg:CC 100))] - "! TARGET_ARCH64 && reload_completed" - [(parallel [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (minus:SI (match_dup 4) - (match_dup 5)) - (const_int 0))) - (set (match_dup 3) - (minus:SI (match_dup 4) (match_dup 5)))]) - (set (match_dup 6) - (minus:SI (minus:SI (match_dup 7) - (match_dup 8)) - (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] -{ - operands[3] = gen_lowpart (SImode, operands[0]); - operands[4] = gen_lowpart (SImode, operands[1]); - operands[5] = gen_lowpart (SImode, operands[2]); - operands[6] = gen_highpart (SImode, operands[0]); - operands[7] = gen_highpart (SImode, operands[1]); -#if HOST_BITS_PER_WIDE_INT == 32 - if (GET_CODE (operands[2]) == CONST_INT) - { - if (INTVAL (operands[2]) < 0) - operands[8] = constm1_rtx; - else - operands[8] = const0_rtx; - } - else -#endif - operands[8] = gen_highpart_mode (SImode, DImode, operands[2]); -}) - ;; LTU here means "carry set" (define_insn "addx" [(set (match_operand:SI 0 "register_operand" "=r") @@ -4982,7 +4697,7 @@ (define_insn_and_split "*addx_extend_sp32" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extend:DI (plus:SI (plus:SI - (match_operand:SI 1 "reg_or_0_operand" "%rJ") + (match_operand:SI 1 "register_or_zero_operand" "%rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] "! TARGET_ARCH64" @@ -4997,46 +4712,13 @@ (define_insn "*addx_extend_sp64" [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") + (zero_extend:DI (plus:SI (plus:SI (match_operand:SI 1 "register_or_zero_operand" "%rJ") (match_operand:SI 2 "arith_operand" "rI")) (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] "TARGET_ARCH64" "addx\t%r1, %2, %0" [(set_attr "type" "ialuX")]) -(define_insn "subx" - [(set (match_operand:SI 0 "register_operand" "=r") - (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") - (match_operand:SI 2 "arith_operand" "rI")) - (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] - "" - "subx\t%r1, %2, %0" - [(set_attr "type" "ialuX")]) - -(define_insn "*subx_extend_sp64" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") - (match_operand:SI 2 "arith_operand" "rI")) - (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] - "TARGET_ARCH64" - "subx\t%r1, %2, %0" - [(set_attr "type" "ialuX")]) - -(define_insn_and_split "*subx_extend" - [(set (match_operand:DI 0 "register_operand" "=r") - (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") - (match_operand:SI 2 "arith_operand" "rI")) - (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] - "! TARGET_ARCH64" - "#" - "&& reload_completed" - [(set (match_dup 3) (minus:SI (minus:SI (match_dup 1) (match_dup 2)) - (ltu:SI (reg:CC_NOOV 100) (const_int 0)))) - (set (match_dup 4) (const_int 0))] - "operands[3] = gen_lowpart (SImode, operands[0]); - operands[4] = gen_highpart (SImode, operands[0]);" - [(set_attr "length" "2")]) - (define_insn_and_split "" [(set (match_operand:DI 0 "register_operand" "=r") (plus:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) @@ -5061,7 +4743,7 @@ (define_insn "*adddi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") (plus:DI (match_operand:DI 1 "register_operand" "%r,r") - (match_operand:DI 2 "arith_double_add_operand" "rHI,O")))] + (match_operand:DI 2 "arith_add_operand" "rI,O")))] "TARGET_ARCH64" "@ add\t%1, %2, %0 @@ -5090,8 +4772,8 @@ (define_insn "*cmp_ccx_plus" [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (plus:DI (match_operand:DI 0 "arith_double_operand" "%r") - (match_operand:DI 1 "arith_double_operand" "rHI")) + (compare:CCX_NOOV (plus:DI (match_operand:DI 0 "arith_operand" "%r") + (match_operand:DI 1 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "addcc\t%0, %1, %%g0" @@ -5110,8 +4792,8 @@ (define_insn "*cmp_ccx_plus_set" [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (plus:DI (match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")) + (compare:CCX_NOOV (plus:DI (match_operand:DI 1 "arith_operand" "%r") + (match_operand:DI 2 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (plus:DI (match_dup 1) (match_dup 2)))] @@ -5137,62 +4819,77 @@ } }) -(define_insn_and_split "*subdi3_sp32" +(define_insn_and_split "subdi3_insn_sp32" [(set (match_operand:DI 0 "register_operand" "=r") - (minus:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI"))) + (minus:DI (match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "arith_double_operand" "rHI"))) (clobber (reg:CC 100))] "! TARGET_ARCH64" "#" - "&& reload_completed - && (GET_CODE (operands[2]) == CONST_INT - || GET_CODE (operands[2]) == CONST_DOUBLE)" - [(clobber (const_int 0))] + "&& reload_completed" + [(parallel [(set (reg:CC_NOOV 100) + (compare:CC_NOOV (minus:SI (match_dup 4) + (match_dup 5)) + (const_int 0))) + (set (match_dup 3) + (minus:SI (match_dup 4) (match_dup 5)))]) + (set (match_dup 6) + (minus:SI (minus:SI (match_dup 7) + (match_dup 8)) + (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] { - rtx highp, lowp; - - highp = gen_highpart_mode (SImode, DImode, operands[2]); - lowp = gen_lowpart (SImode, operands[2]); - if ((lowp == const0_rtx) - && (operands[0] == operands[1])) + operands[3] = gen_lowpart (SImode, operands[0]); + operands[4] = gen_lowpart (SImode, operands[1]); + operands[5] = gen_lowpart (SImode, operands[2]); + operands[6] = gen_highpart (SImode, operands[0]); + operands[7] = gen_highpart (SImode, operands[1]); +#if HOST_BITS_PER_WIDE_INT == 32 + if (GET_CODE (operands[2]) == CONST_INT) { - emit_insn (gen_rtx_SET (VOIDmode, - gen_highpart (SImode, operands[0]), - gen_rtx_MINUS (SImode, - gen_highpart_mode (SImode, DImode, - operands[1]), - highp))); + if (INTVAL (operands[2]) < 0) + operands[8] = constm1_rtx; + else + operands[8] = const0_rtx; } else - { - emit_insn (gen_cmp_minus_cc_set (gen_lowpart (SImode, operands[0]), - gen_lowpart (SImode, operands[1]), - lowp)); - emit_insn (gen_subx (gen_highpart (SImode, operands[0]), - gen_highpart_mode (SImode, DImode, operands[1]), - highp)); - } - DONE; +#endif + operands[8] = gen_highpart_mode (SImode, DImode, operands[2]); } [(set_attr "length" "2")]) -(define_split - [(set (match_operand:DI 0 "register_operand" "") - (minus:DI (match_operand:DI 1 "register_operand" "") - (match_operand:DI 2 "register_operand" ""))) - (clobber (reg:CC 100))] - "! TARGET_ARCH64 - && reload_completed" - [(clobber (const_int 0))] -{ - emit_insn (gen_cmp_minus_cc_set (gen_lowpart (SImode, operands[0]), - gen_lowpart (SImode, operands[1]), - gen_lowpart (SImode, operands[2]))); - emit_insn (gen_subx (gen_highpart (SImode, operands[0]), - gen_highpart (SImode, operands[1]), - gen_highpart (SImode, operands[2]))); - DONE; -}) +;; LTU here means "carry set" +(define_insn "subx" + [(set (match_operand:SI 0 "register_operand" "=r") + (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") + (match_operand:SI 2 "arith_operand" "rI")) + (ltu:SI (reg:CC_NOOV 100) (const_int 0))))] + "" + "subx\t%r1, %2, %0" + [(set_attr "type" "ialuX")]) + +(define_insn "*subx_extend_sp64" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") + (match_operand:SI 2 "arith_operand" "rI")) + (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] + "TARGET_ARCH64" + "subx\t%r1, %2, %0" + [(set_attr "type" "ialuX")]) + +(define_insn_and_split "*subx_extend" + [(set (match_operand:DI 0 "register_operand" "=r") + (zero_extend:DI (minus:SI (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") + (match_operand:SI 2 "arith_operand" "rI")) + (ltu:SI (reg:CC_NOOV 100) (const_int 0)))))] + "! TARGET_ARCH64" + "#" + "&& reload_completed" + [(set (match_dup 3) (minus:SI (minus:SI (match_dup 1) (match_dup 2)) + (ltu:SI (reg:CC_NOOV 100) (const_int 0)))) + (set (match_dup 4) (const_int 0))] + "operands[3] = gen_lowpart (SImode, operands[0]); + operands[4] = gen_highpart (SImode, operands[0]);" + [(set_attr "length" "2")]) (define_insn_and_split "" [(set (match_operand:DI 0 "register_operand" "=r") @@ -5218,7 +4915,7 @@ (define_insn "*subdi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r,r") (minus:DI (match_operand:DI 1 "register_operand" "r,r") - (match_operand:DI 2 "arith_double_add_operand" "rHI,O")))] + (match_operand:DI 2 "arith_add_operand" "rI,O")))] "TARGET_ARCH64" "@ sub\t%1, %2, %0 @@ -5238,7 +4935,7 @@ (define_insn "*cmp_minus_cc" [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (minus:SI (match_operand:SI 0 "reg_or_0_operand" "rJ") + (compare:CC_NOOV (minus:SI (match_operand:SI 0 "register_or_zero_operand" "rJ") (match_operand:SI 1 "arith_operand" "rI")) (const_int 0)))] "" @@ -5248,7 +4945,7 @@ (define_insn "*cmp_minus_ccx" [(set (reg:CCX_NOOV 100) (compare:CCX_NOOV (minus:DI (match_operand:DI 0 "register_operand" "r") - (match_operand:DI 1 "arith_double_operand" "rHI")) + (match_operand:DI 1 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "subcc\t%0, %1, %%g0" @@ -5256,7 +4953,7 @@ (define_insn "cmp_minus_cc_set" [(set (reg:CC_NOOV 100) - (compare:CC_NOOV (minus:SI (match_operand:SI 1 "reg_or_0_operand" "rJ") + (compare:CC_NOOV (minus:SI (match_operand:SI 1 "register_or_zero_operand" "rJ") (match_operand:SI 2 "arith_operand" "rI")) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") @@ -5268,15 +4965,16 @@ (define_insn "*cmp_minus_ccx_set" [(set (reg:CCX_NOOV 100) (compare:CCX_NOOV (minus:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI")) + (match_operand:DI 2 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (minus:DI (match_dup 1) (match_dup 2)))] "TARGET_ARCH64" "subcc\t%1, %2, %0" [(set_attr "type" "compare")]) - -;; Integer Multiply/Divide. + + +;; Integer multiply/divide instructions. ;; The 32 bit multiply/divide instructions are deprecated on v9, but at ;; least in UltraSPARC I, II and IIi it is a win tick-wise. @@ -5290,9 +4988,9 @@ [(set_attr "type" "imul")]) (define_expand "muldi3" - [(set (match_operand:DI 0 "register_operand" "=r") - (mult:DI (match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + [(set (match_operand:DI 0 "register_operand" "") + (mult:DI (match_operand:DI 1 "arith_operand" "") + (match_operand:DI 2 "arith_operand" "")))] "TARGET_ARCH64 || TARGET_V8PLUS" { if (TARGET_V8PLUS) @@ -5304,8 +5002,8 @@ (define_insn "*muldi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r") - (mult:DI (match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + (mult:DI (match_operand:DI 1 "arith_operand" "%r") + (match_operand:DI 2 "arith_operand" "rI")))] "TARGET_ARCH64" "mulx\t%1, %2, %0" [(set_attr "type" "imul")]) @@ -5314,8 +5012,8 @@ ;; XXX (define_insn "muldi3_v8plus" [(set (match_operand:DI 0 "register_operand" "=r,h") - (mult:DI (match_operand:DI 1 "arith_double_operand" "%r,0") - (match_operand:DI 2 "arith_double_operand" "rI,rI"))) + (mult:DI (match_operand:DI 1 "arith_operand" "%r,0") + (match_operand:DI 2 "arith_operand" "rI,rI"))) (clobber (match_scratch:SI 3 "=&h,X")) (clobber (match_scratch:SI 4 "=&h,X"))] "TARGET_V8PLUS" @@ -5404,7 +5102,7 @@ (define_insn "const_mulsidi3_v8plus" [(set (match_operand:DI 0 "register_operand" "=h,r") (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "small_int" "I,I"))) + (match_operand:DI 2 "small_int_operand" "I,I"))) (clobber (match_scratch:SI 3 "=X,&h"))] "TARGET_V8PLUS" "@ @@ -5445,7 +5143,7 @@ (define_insn "const_mulsidi3_sp32" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "small_int" "I")))] + (match_operand:DI 2 "small_int_operand" "I")))] "TARGET_HARD_MUL32" { return TARGET_SPARCLET @@ -5462,7 +5160,7 @@ (define_insn "const_mulsidi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "small_int" "I")))] + (match_operand:DI 2 "small_int_operand" "I")))] "TARGET_DEPRECATED_V8_INSNS && TARGET_ARCH64" "smul\t%1, %2, %0" [(set_attr "type" "imul")]) @@ -5502,7 +5200,7 @@ (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) (sign_extend:DI (match_operand:SI 2 "register_operand" "r,r"))) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,&h"))] "TARGET_V8PLUS" "@ @@ -5519,7 +5217,7 @@ (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) (sign_extend:DI (match_operand:SI 2 "register_operand" "r,r"))) - (match_operand:SI 3 "const_int_operand" "i,i")) + (match_operand:SI 3 "small_int_operand" "I,I")) 4)) (clobber (match_scratch:SI 4 "=X,&h"))] "TARGET_V8PLUS" @@ -5534,8 +5232,8 @@ [(set (match_operand:SI 0 "register_operand" "=h,r") (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "small_int" "i,i")) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:DI 2 "small_int_operand" "I,I")) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,&h"))] "TARGET_V8PLUS" "@ @@ -5561,7 +5259,7 @@ [(set (match_operand:SI 0 "register_operand" "=r") (truncate:SI (lshiftrt:DI (mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "small_int" "i")) + (match_operand:DI 2 "small_int_operand" "i")) (const_int 32))))] "TARGET_HARD_MUL32" "smul\t%1, %2, %%g0\n\trd\t%%y, %0" @@ -5639,7 +5337,7 @@ (define_insn "const_umulsidi3_sp32" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "uns_small_int" "")))] + (match_operand:DI 2 "uns_small_int_operand" "")))] "TARGET_HARD_MUL32" { return TARGET_SPARCLET @@ -5656,7 +5354,7 @@ (define_insn "const_umulsidi3_sp64" [(set (match_operand:DI 0 "register_operand" "=r") (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "uns_small_int" "")))] + (match_operand:DI 2 "uns_small_int_operand" "")))] "TARGET_DEPRECATED_V8_INSNS && TARGET_ARCH64" "umul\t%1, %s2, %0" [(set_attr "type" "imul")]) @@ -5665,7 +5363,7 @@ (define_insn "const_umulsidi3_v8plus" [(set (match_operand:DI 0 "register_operand" "=h,r") (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "uns_small_int" ""))) + (match_operand:DI 2 "uns_small_int_operand" ""))) (clobber (match_scratch:SI 3 "=X,h"))] "TARGET_V8PLUS" "@ @@ -5709,7 +5407,7 @@ (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r")) (zero_extend:DI (match_operand:SI 2 "register_operand" "r,r"))) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,h"))] "TARGET_V8PLUS" "@ @@ -5723,8 +5421,8 @@ [(set (match_operand:SI 0 "register_operand" "=h,r") (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r,r")) - (match_operand:DI 2 "uns_small_int" "")) - (match_operand:SI 3 "const_int_operand" "i,i")))) + (match_operand:DI 2 "uns_small_int_operand" "")) + (match_operand:SI 3 "small_int_operand" "I,I")))) (clobber (match_scratch:SI 4 "=X,h"))] "TARGET_V8PLUS" "@ @@ -5750,15 +5448,15 @@ [(set (match_operand:SI 0 "register_operand" "=r") (truncate:SI (lshiftrt:DI (mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "r")) - (match_operand:DI 2 "uns_small_int" "")) + (match_operand:DI 2 "uns_small_int_operand" "")) (const_int 32))))] "TARGET_HARD_MUL32" "umul\t%1, %s2, %%g0\n\trd\t%%y, %0" [(set_attr "type" "multi") (set_attr "length" "2")]) -;; The v8 architecture specifies that there must be 3 instructions between -;; a y register write and a use of it for correct results. +;; The V8 architecture specifies that there must be 3 instructions between +;; a Y register write and a use of it for correct results. (define_expand "divsi3" [(parallel [(set (match_operand:SI 0 "register_operand" "=r,r") @@ -5814,7 +5512,7 @@ (define_insn "divdi3" [(set (match_operand:DI 0 "register_operand" "=r") (div:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + (match_operand:DI 2 "arith_operand" "rI")))] "TARGET_ARCH64" "sdivx\t%1, %2, %0" [(set_attr "type" "idiv")]) @@ -5842,17 +5540,19 @@ ;; XXX (define_expand "udivsi3" [(set (match_operand:SI 0 "register_operand" "") - (udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "") (match_operand:SI 2 "input_operand" "")))] "TARGET_V8 || TARGET_DEPRECATED_V8_INSNS" "") +;; The V8 architecture specifies that there must be 3 instructions between +;; a Y register write and a use of it for correct results. + (define_insn "udivsi3_sp32" [(set (match_operand:SI 0 "register_operand" "=r,&r,&r") - (udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "r,r,m") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r,r,m") (match_operand:SI 2 "input_operand" "rI,m,r")))] - "(TARGET_V8 - || TARGET_DEPRECATED_V8_INSNS) + "(TARGET_V8 || TARGET_DEPRECATED_V8_INSNS) && TARGET_ARCH32" { output_asm_insn ("wr\t%%g0, %%g0, %%y", operands); @@ -5871,7 +5571,7 @@ (define_insn "udivsi3_sp64" [(set (match_operand:SI 0 "register_operand" "=r") - (udiv:SI (match_operand:SI 1 "reg_or_nonsymb_mem_operand" "r") + (udiv:SI (match_operand:SI 1 "nonimmediate_operand" "r") (match_operand:SI 2 "input_operand" "rI")))] "TARGET_DEPRECATED_V8_INSNS && TARGET_ARCH64" "wr\t%%g0, 0, %%y\n\tudiv\t%1, %2, %0" @@ -5881,7 +5581,7 @@ (define_insn "udivdi3" [(set (match_operand:DI 0 "register_operand" "=r") (udiv:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "arith_double_operand" "rHI")))] + (match_operand:DI 2 "arith_operand" "rI")))] "TARGET_ARCH64" "udivx\t%1, %2, %0" [(set_attr "type" "idiv")]) @@ -5938,8 +5638,10 @@ "TARGET_SPARCLET" "umacd\t%1, %2, %L0" [(set_attr "type" "imul")]) - -;;- Boolean instructions + + +;; Boolean instructions. + ;; We define DImode `and' so with DImode `not' we can get ;; DImode `andn'. Other combinations are possible. @@ -5967,8 +5669,8 @@ (define_insn "*and3_sp64" [(set (match_operand:V64I 0 "register_operand" "=r,b") - (and:V64I (match_operand:V64I 1 "arith_double_operand" "%r,b") - (match_operand:V64I 2 "arith_double_operand" "rHI,b")))] + (and:V64I (match_operand:V64I 1 "arith_operand" "%r,b") + (match_operand:V64I 2 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ and\t%1, %2, %0 @@ -5979,7 +5681,7 @@ (define_insn "and3" [(set (match_operand:V32I 0 "register_operand" "=r,d") (and:V32I (match_operand:V32I 1 "arith_operand" "%r,d") - (match_operand:V32I 2 "arith_operand" "rI,d")))] + (match_operand:V32I 2 "arith_operand" "rI,d")))] "" "@ and\t%1, %2, %0 @@ -5990,11 +5692,9 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (and:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" ""))) + (match_operand:SI 2 "const_compl_high_operand" ""))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (and:SI (not:SI (match_dup 3)) (match_dup 1)))] { @@ -6070,8 +5770,8 @@ (define_insn "*ior3_sp64" [(set (match_operand:V64I 0 "register_operand" "=r,b") - (ior:V64I (match_operand:V64I 1 "arith_double_operand" "%r,b") - (match_operand:V64I 2 "arith_double_operand" "rHI,b")))] + (ior:V64I (match_operand:V64I 1 "arith_operand" "%r,b") + (match_operand:V64I 2 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ or\t%1, %2, %0 @@ -6093,11 +5793,9 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (ior:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" ""))) + (match_operand:SI 2 "const_compl_high_operand" ""))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (ior:SI (not:SI (match_dup 3)) (match_dup 1)))] { @@ -6173,8 +5871,8 @@ (define_insn "*xor3_sp64" [(set (match_operand:V64I 0 "register_operand" "=r,b") - (xor:V64I (match_operand:V64I 1 "arith_double_operand" "%rJ,b") - (match_operand:V64I 2 "arith_double_operand" "rHI,b")))] + (xor:V64I (match_operand:V64I 1 "arith_operand" "%rJ,b") + (match_operand:V64I 2 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ xor\t%r1, %2, %0 @@ -6182,14 +5880,6 @@ [(set_attr "type" "*,fga") (set_attr "fptype" "*,double")]) -(define_insn "*xordi3_sp64_dbl" - [(set (match_operand:DI 0 "register_operand" "=r") - (xor:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:DI 2 "const64_operand" "")))] - "(TARGET_ARCH64 - && HOST_BITS_PER_WIDE_INT != 64)" - "xor\t%1, %2, %0") - (define_insn "xor3" [(set (match_operand:V32I 0 "register_operand" "=r,d") (xor:V32I (match_operand:V32I 1 "arith_operand" "%rJ,d") @@ -6204,11 +5894,9 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (xor:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" ""))) + (match_operand:SI 2 "const_compl_high_operand" ""))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (not:SI (xor:SI (match_dup 3) (match_dup 1))))] { @@ -6218,11 +5906,9 @@ (define_split [(set (match_operand:SI 0 "register_operand" "") (not:SI (xor:SI (match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "" "")))) + (match_operand:SI 2 "const_compl_high_operand" "")))) (clobber (match_operand:SI 3 "register_operand" ""))] - "GET_CODE (operands[2]) == CONST_INT - && !SMALL_INT32 (operands[2]) - && (INTVAL (operands[2]) & 0x3ff) == 0x3ff" + "" [(set (match_dup 3) (match_dup 4)) (set (match_dup 0) (xor:SI (match_dup 3) (match_dup 1)))] { @@ -6232,7 +5918,7 @@ ;; Split DImode logical operations requiring two instructions. (define_split [(set (match_operand:V64I 0 "register_operand" "") - (match_operator:V64I 1 "cc_arithop" ; AND, IOR, XOR + (match_operator:V64I 1 "cc_arith_operator" ; AND, IOR, XOR [(match_operand:V64I 2 "register_operand" "") (match_operand:V64I 3 "arith_double_operand" "")]))] "! TARGET_ARCH64 @@ -6293,8 +5979,8 @@ (define_insn "*xor_not__sp64" [(set (match_operand:V64I 0 "register_operand" "=r,b") - (not:V64I (xor:V64I (match_operand:V64I 1 "reg_or_0_operand" "rJ,b") - (match_operand:V64I 2 "arith_double_operand" "rHI,b"))))] + (not:V64I (xor:V64I (match_operand:V64I 1 "register_or_zero_operand" "rJ,b") + (match_operand:V64I 2 "arith_operand" "rI,b"))))] "TARGET_ARCH64" "@ xnor\t%r1, %2, %0 @@ -6304,7 +5990,7 @@ (define_insn "*xor_not_" [(set (match_operand:V32I 0 "register_operand" "=r,d") - (not:V32I (xor:V32I (match_operand:V32I 1 "reg_or_0_operand" "rJ,d") + (not:V32I (xor:V32I (match_operand:V32I 1 "register_or_zero_operand" "rJ,d") (match_operand:V32I 2 "arith_operand" "rI,d"))))] "" "@ @@ -6319,7 +6005,7 @@ (define_insn "*cmp_cc_arith_op" [(set (reg:CC 100) (compare:CC - (match_operator:SI 2 "cc_arithop" + (match_operator:SI 2 "cc_arith_operator" [(match_operand:SI 0 "arith_operand" "%r") (match_operand:SI 1 "arith_operand" "rI")]) (const_int 0)))] @@ -6330,9 +6016,9 @@ (define_insn "*cmp_ccx_arith_op" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 2 "cc_arithop" - [(match_operand:DI 0 "arith_double_operand" "%r") - (match_operand:DI 1 "arith_double_operand" "rHI")]) + (match_operator:DI 2 "cc_arith_operator" + [(match_operand:DI 0 "arith_operand" "%r") + (match_operand:DI 1 "arith_operand" "rI")]) (const_int 0)))] "TARGET_ARCH64" "%A2cc\t%0, %1, %%g0" @@ -6341,12 +6027,12 @@ (define_insn "*cmp_cc_arith_op_set" [(set (reg:CC 100) (compare:CC - (match_operator:SI 3 "cc_arithop" + (match_operator:SI 3 "cc_arith_operator" [(match_operand:SI 1 "arith_operand" "%r") (match_operand:SI 2 "arith_operand" "rI")]) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") - (match_operator:SI 4 "cc_arithop" [(match_dup 1) (match_dup 2)]))] + (match_operator:SI 4 "cc_arith_operator" [(match_dup 1) (match_dup 2)]))] "GET_CODE (operands[3]) == GET_CODE (operands[4])" "%A3cc\t%1, %2, %0" [(set_attr "type" "compare")]) @@ -6354,12 +6040,12 @@ (define_insn "*cmp_ccx_arith_op_set" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 3 "cc_arithop" - [(match_operand:DI 1 "arith_double_operand" "%r") - (match_operand:DI 2 "arith_double_operand" "rHI")]) + (match_operator:DI 3 "cc_arith_operator" + [(match_operand:DI 1 "arith_operand" "%r") + (match_operand:DI 2 "arith_operand" "rI")]) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") - (match_operator:DI 4 "cc_arithop" [(match_dup 1) (match_dup 2)]))] + (match_operator:DI 4 "cc_arith_operator" [(match_dup 1) (match_dup 2)]))] "TARGET_ARCH64 && GET_CODE (operands[3]) == GET_CODE (operands[4])" "%A3cc\t%1, %2, %0" [(set_attr "type" "compare")]) @@ -6367,7 +6053,7 @@ (define_insn "*cmp_cc_xor_not" [(set (reg:CC 100) (compare:CC - (not:SI (xor:SI (match_operand:SI 0 "reg_or_0_operand" "%rJ") + (not:SI (xor:SI (match_operand:SI 0 "register_or_zero_operand" "%rJ") (match_operand:SI 1 "arith_operand" "rI"))) (const_int 0)))] "" @@ -6377,8 +6063,8 @@ (define_insn "*cmp_ccx_xor_not" [(set (reg:CCX 100) (compare:CCX - (not:DI (xor:DI (match_operand:DI 0 "reg_or_0_operand" "%rJ") - (match_operand:DI 1 "arith_double_operand" "rHI"))) + (not:DI (xor:DI (match_operand:DI 0 "register_or_zero_operand" "%rJ") + (match_operand:DI 1 "arith_operand" "rI"))) (const_int 0)))] "TARGET_ARCH64" "xnorcc\t%r0, %1, %%g0" @@ -6387,7 +6073,7 @@ (define_insn "*cmp_cc_xor_not_set" [(set (reg:CC 100) (compare:CC - (not:SI (xor:SI (match_operand:SI 1 "reg_or_0_operand" "%rJ") + (not:SI (xor:SI (match_operand:SI 1 "register_or_zero_operand" "%rJ") (match_operand:SI 2 "arith_operand" "rI"))) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") @@ -6399,8 +6085,8 @@ (define_insn "*cmp_ccx_xor_not_set" [(set (reg:CCX 100) (compare:CCX - (not:DI (xor:DI (match_operand:DI 1 "reg_or_0_operand" "%rJ") - (match_operand:DI 2 "arith_double_operand" "rHI"))) + (not:DI (xor:DI (match_operand:DI 1 "register_or_zero_operand" "%rJ") + (match_operand:DI 2 "arith_operand" "rI"))) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (not:DI (xor:DI (match_dup 1) (match_dup 2))))] @@ -6411,9 +6097,9 @@ (define_insn "*cmp_cc_arith_op_not" [(set (reg:CC 100) (compare:CC - (match_operator:SI 2 "cc_arithopn" + (match_operator:SI 2 "cc_arith_not_operator" [(not:SI (match_operand:SI 0 "arith_operand" "rI")) - (match_operand:SI 1 "reg_or_0_operand" "rJ")]) + (match_operand:SI 1 "register_or_zero_operand" "rJ")]) (const_int 0)))] "" "%B2cc\t%r1, %0, %%g0" @@ -6422,9 +6108,9 @@ (define_insn "*cmp_ccx_arith_op_not" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 2 "cc_arithopn" - [(not:DI (match_operand:DI 0 "arith_double_operand" "rHI")) - (match_operand:DI 1 "reg_or_0_operand" "rJ")]) + (match_operator:DI 2 "cc_arith_not_operator" + [(not:DI (match_operand:DI 0 "arith_operand" "rI")) + (match_operand:DI 1 "register_or_zero_operand" "rJ")]) (const_int 0)))] "TARGET_ARCH64" "%B2cc\t%r1, %0, %%g0" @@ -6433,12 +6119,12 @@ (define_insn "*cmp_cc_arith_op_not_set" [(set (reg:CC 100) (compare:CC - (match_operator:SI 3 "cc_arithopn" + (match_operator:SI 3 "cc_arith_not_operator" [(not:SI (match_operand:SI 1 "arith_operand" "rI")) - (match_operand:SI 2 "reg_or_0_operand" "rJ")]) + (match_operand:SI 2 "register_or_zero_operand" "rJ")]) (const_int 0))) (set (match_operand:SI 0 "register_operand" "=r") - (match_operator:SI 4 "cc_arithopn" + (match_operator:SI 4 "cc_arith_not_operator" [(not:SI (match_dup 1)) (match_dup 2)]))] "GET_CODE (operands[3]) == GET_CODE (operands[4])" "%B3cc\t%r2, %1, %0" @@ -6447,12 +6133,12 @@ (define_insn "*cmp_ccx_arith_op_not_set" [(set (reg:CCX 100) (compare:CCX - (match_operator:DI 3 "cc_arithopn" - [(not:DI (match_operand:DI 1 "arith_double_operand" "rHI")) - (match_operand:DI 2 "reg_or_0_operand" "rJ")]) + (match_operator:DI 3 "cc_arith_not_operator" + [(not:DI (match_operand:DI 1 "arith_operand" "rI")) + (match_operand:DI 2 "register_or_zero_operand" "rJ")]) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") - (match_operator:DI 4 "cc_arithopn" + (match_operator:DI 4 "cc_arith_not_operator" [(not:DI (match_dup 1)) (match_dup 2)]))] "TARGET_ARCH64 && GET_CODE (operands[3]) == GET_CODE (operands[4])" "%B3cc\t%r2, %1, %0" @@ -6521,7 +6207,7 @@ (define_insn "*cmp_ccx_neg" [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (neg:DI (match_operand:DI 0 "arith_double_operand" "rHI")) + (compare:CCX_NOOV (neg:DI (match_operand:DI 0 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "subcc\t%%g0, %0, %%g0" @@ -6539,7 +6225,7 @@ (define_insn "*cmp_ccx_set_neg" [(set (reg:CCX_NOOV 100) - (compare:CCX_NOOV (neg:DI (match_operand:DI 1 "arith_double_operand" "rHI")) + (compare:CCX_NOOV (neg:DI (match_operand:DI 1 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (neg:DI (match_dup 1)))] @@ -6580,7 +6266,7 @@ (define_insn "*one_cmpl2_sp64" [(set (match_operand:V64I 0 "register_operand" "=r,b") - (not:V64I (match_operand:V64I 1 "arith_double_operand" "rHI,b")))] + (not:V64I (match_operand:V64I 1 "arith_operand" "rI,b")))] "TARGET_ARCH64" "@ xnor\t%%g0, %1, %0 @@ -6608,7 +6294,7 @@ (define_insn "*cmp_ccx_not" [(set (reg:CCX 100) - (compare:CCX (not:DI (match_operand:DI 0 "arith_double_operand" "rHI")) + (compare:CCX (not:DI (match_operand:DI 0 "arith_operand" "rI")) (const_int 0)))] "TARGET_ARCH64" "xnorcc\t%%g0, %0, %%g0" @@ -6626,7 +6312,7 @@ (define_insn "*cmp_ccx_set_not" [(set (reg:CCX 100) - (compare:CCX (not:DI (match_operand:DI 1 "arith_double_operand" "rHI")) + (compare:CCX (not:DI (match_operand:DI 1 "arith_operand" "rI")) (const_int 0))) (set (match_operand:DI 0 "register_operand" "=r") (not:DI (match_dup 1)))] @@ -6653,7 +6339,8 @@ "TARGET_ARCH64" "orcc\t%1, 0, %0" [(set_attr "type" "compare")]) - + + ;; Floating point arithmetic instructions. (define_expand "addtf3" @@ -7013,8 +6700,9 @@ "TARGET_FPU" "fsqrts\t%1, %0" [(set_attr "type" "fpsqrts")]) - -;;- arithmetic shift instructions + + +;; Arithmetic shift instructions. (define_insn "ashlsi3" [(set (match_operand:SI 0 "register_operand" "=r") @@ -7027,7 +6715,7 @@ return "sll\t%1, %2, %0"; } [(set (attr "type") - (if_then_else (match_operand 2 "const1_operand" "") + (if_then_else (match_operand 2 "const_one_operand" "") (const_string "ialu") (const_string "shift")))]) (define_expand "ashldi3" @@ -7056,7 +6744,7 @@ return "sllx\t%1, %2, %0"; } [(set (attr "type") - (if_then_else (match_operand 2 "const1_operand" "") + (if_then_else (match_operand 2 "const_one_operand" "") (const_string "ialu") (const_string "shift")))]) ;; XXX UGH! @@ -7133,17 +6821,10 @@ [(set (match_operand:DI 0 "register_operand" "=r") (ashiftrt:DI (ashift:DI (subreg:DI (match_operand:SI 1 "register_operand" "r") 0) (const_int 32)) - (match_operand:SI 2 "small_int_or_double" "n")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) >= 32 && INTVAL (operands[2]) < 64) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && !CONST_DOUBLE_HIGH (operands[2]) - && CONST_DOUBLE_LOW (operands[2]) >= 32 - && CONST_DOUBLE_LOW (operands[2]) < 64))" + (match_operand:SI 2 "small_int_operand" "I")))] + "TARGET_ARCH64 && INTVAL (operands[2]) >= 32 && INTVAL (operands[2]) < 64" { operands[2] = GEN_INT (INTVAL (operands[2]) - 32); - return "sra\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7206,14 +6887,8 @@ [(set (match_operand:DI 0 "register_operand" "=r") (and:DI (subreg:DI (lshiftrt:SI (match_operand:SI 1 "register_operand" "r") (match_operand:SI 2 "arith_operand" "r")) 0) - (match_operand 3 "" "")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[3]) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (operands[3]) == 0 - && CONST_DOUBLE_LOW (operands[3]) == 0xffffffff) - || (HOST_BITS_PER_WIDE_INT >= 64 - && GET_CODE (operands[3]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) == 0xffffffff))" + (match_operand 3 "const_int_operand" "")))] + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) == 0xffffffff" "srl\t%1, %2, %0" [(set_attr "type" "shift")]) @@ -7223,17 +6898,11 @@ (define_insn "*lshrsi3_extend2" [(set (match_operand:DI 0 "register_operand" "=r") (zero_extract:DI (subreg:DI (match_operand:SI 1 "register_operand" "r") 0) - (match_operand 2 "small_int_or_double" "n") + (match_operand 2 "small_int_operand" "I") (const_int 32)))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && CONST_DOUBLE_HIGH (operands[2]) == 0 - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))" + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32" { operands[2] = GEN_INT (32 - INTVAL (operands[2])); - return "srl\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7280,16 +6949,10 @@ [(set (match_operand:SI 0 "register_operand" "=r") (ashiftrt:SI (subreg:SI (lshiftrt:DI (match_operand:DI 1 "register_operand" "r") (const_int 32)) 4) - (match_operand:SI 2 "small_int_or_double" "n")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && !CONST_DOUBLE_HIGH (operands[2]) - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))" + (match_operand:SI 2 "small_int_operand" "I")))] + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32" { operands[2] = GEN_INT (INTVAL (operands[2]) + 32); - return "srax\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7298,16 +6961,10 @@ [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (subreg:SI (ashiftrt:DI (match_operand:DI 1 "register_operand" "r") (const_int 32)) 4) - (match_operand:SI 2 "small_int_or_double" "n")))] - "TARGET_ARCH64 - && ((GET_CODE (operands[2]) == CONST_INT - && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32) - || (GET_CODE (operands[2]) == CONST_DOUBLE - && !CONST_DOUBLE_HIGH (operands[2]) - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (operands[2]) < 32))" + (match_operand:SI 2 "small_int_operand" "I")))] + "TARGET_ARCH64 && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) < 32" { operands[2] = GEN_INT (INTVAL (operands[2]) + 32); - return "srlx\t%1, %2, %0"; } [(set_attr "type" "shift")]) @@ -7315,10 +6972,9 @@ (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (ashiftrt:SI (subreg:SI (ashiftrt:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:SI 2 "small_int_or_double" "n")) 4) - (match_operand:SI 3 "small_int_or_double" "n")))] + (match_operand:SI 2 "small_int_operand" "I")) 4) + (match_operand:SI 3 "small_int_operand" "I")))] "TARGET_ARCH64 - && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) >= 32 && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) < 32 && (unsigned HOST_WIDE_INT) (INTVAL (operands[2]) + INTVAL (operands[3])) < 64" @@ -7332,10 +6988,9 @@ (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") (lshiftrt:SI (subreg:SI (lshiftrt:DI (match_operand:DI 1 "register_operand" "r") - (match_operand:SI 2 "small_int_or_double" "n")) 4) - (match_operand:SI 3 "small_int_or_double" "n")))] + (match_operand:SI 2 "small_int_operand" "I")) 4) + (match_operand:SI 3 "small_int_operand" "I")))] "TARGET_ARCH64 - && GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT && (unsigned HOST_WIDE_INT) INTVAL (operands[2]) >= 32 && (unsigned HOST_WIDE_INT) INTVAL (operands[3]) < 32 && (unsigned HOST_WIDE_INT) (INTVAL (operands[2]) + INTVAL (operands[3])) < 64" @@ -7345,8 +7000,10 @@ return "srlx\t%1, %2, %0"; } [(set_attr "type" "shift")]) - -;; Unconditional and other jump instructions + + +;; Unconditional and other jump instructions. + (define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] "" @@ -7358,8 +7015,7 @@ (use (label_ref (match_operand 1 "" "")))])] "" { - if (GET_MODE (operands[0]) != CASE_VECTOR_MODE) - abort (); + gcc_assert (GET_MODE (operands[0]) == CASE_VECTOR_MODE); /* In pic mode, our address differences are against the base of the table. Add that base value back in; CSE ought to be able to combine @@ -7390,7 +7046,9 @@ "jmp\t%a0%#" [(set_attr "type" "uncond_branch")]) -;;- jump to subroutine + +;; Jump to subroutine instructions. + (define_expand "call" ;; Note that this expression is not used for generating RTL. ;; All the RTL is generated explicitly below. @@ -7402,11 +7060,9 @@ { rtx fn_rtx; - if (GET_MODE (operands[0]) != FUNCTION_MODE) - abort (); + gcc_assert (GET_MODE (operands[0]) == FUNCTION_MODE); - if (GET_CODE (operands[3]) != CONST_INT) - abort(); + gcc_assert (GET_CODE (operands[3]) == CONST_INT); if (GET_CODE (XEXP (operands[0], 0)) == LABEL_REF) { @@ -7568,8 +7224,7 @@ rtx fn_rtx; rtvec vec; - if (GET_MODE (operands[1]) != FUNCTION_MODE) - abort (); + gcc_assert (GET_MODE (operands[1]) == FUNCTION_MODE); fn_rtx = operands[1]; @@ -7626,21 +7281,22 @@ (define_expand "untyped_call" [(parallel [(call (match_operand 0 "" "") (const_int 0)) - (match_operand 1 "" "") + (match_operand:BLK 1 "memory_operand" "") (match_operand 2 "" "")])] "" { - int i; + rtx valreg1 = gen_rtx_REG (DImode, 8); + rtx valreg2 = gen_rtx_REG (TARGET_ARCH64 ? TFmode : DFmode, 32); + rtx result = operands[1]; /* Pass constm1 to indicate that it may expect a structure value, but we don't know what size it is. */ emit_call_insn (GEN_CALL (operands[0], const0_rtx, NULL, constm1_rtx)); - for (i = 0; i < XVECLEN (operands[2], 0); i++) - { - rtx set = XVECEXP (operands[2], 0, i); - emit_move_insn (SET_DEST (set), SET_SRC (set)); - } + /* Save the function value registers. */ + emit_move_insn (adjust_address (result, DImode, 0), valreg1); + emit_move_insn (adjust_address (result, TARGET_ARCH64 ? TFmode : DFmode, 8), + valreg2); /* The optimizer does not know that the call sets the function value registers we stored in the result block. We avoid problems by @@ -7651,7 +7307,8 @@ DONE; }) -;;- tail calls +;; Tail call instructions. + (define_expand "sibcall" [(parallel [(call (match_operand 0 "call_operand" "") (const_int 0)) (return)])] @@ -7699,13 +7356,8 @@ "* return output_sibcall(insn, operands[1]);" [(set_attr "type" "sibcall")]) -(define_expand "sibcall_epilogue" - [(return)] - "" -{ - sparc_expand_epilogue (); - DONE; -}) + +;; Special instructions. (define_expand "prologue" [(const_int 0)] @@ -7739,6 +7391,14 @@ sparc_expand_epilogue (); }) +(define_expand "sibcall_epilogue" + [(return)] + "" +{ + sparc_expand_epilogue (); + DONE; +}) + (define_expand "return" [(return)] "sparc_can_use_return_insn_p ()" @@ -8008,8 +7668,8 @@ { return TARGET_V9 ? "flush\t%f0" : "iflush\t%f0"; } [(set_attr "type" "iflush")]) - -;; find first set. + +;; Find first set instructions. ;; The scan instruction searches from the most significant bit while ffs ;; searches from the least significant bit. The bit index and treatment of @@ -8205,6 +7865,9 @@ (compare:CCX (match_dup 1) (const_int 0)))])] "") + +;; Prefetch instructions. + ;; ??? UltraSPARC-III note: A memory operation loading into the floating point register ;; ??? file, if it hits the prefetch cache, has a chance to dual-issue with other memory ;; ??? operations. With DFA we might be able to model this, but it requires a lot of @@ -8241,10 +7904,8 @@ int read_or_write = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (read_or_write != 0 && read_or_write != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (read_or_write == 0 || read_or_write == 1); + gcc_assert (locality >= 0 && locality < 4); return prefetch_instr [read_or_write][locality == 0 ? 0 : 1]; } [(set_attr "type" "load")]) @@ -8268,14 +7929,15 @@ int read_or_write = INTVAL (operands[1]); int locality = INTVAL (operands[2]); - if (read_or_write != 0 && read_or_write != 1) - abort (); - if (locality < 0 || locality > 3) - abort (); + gcc_assert (read_or_write == 0 || read_or_write == 1); + gcc_assert (locality >= 0 && locality < 4); return prefetch_instr [read_or_write][locality == 0 ? 0 : 1]; } [(set_attr "type" "load")]) - + + +;; Trap instructions. + (define_insn "trap" [(trap_if (const_int 1) (const_int 5))] "" @@ -8283,7 +7945,7 @@ [(set_attr "type" "trap")]) (define_expand "conditional_trap" - [(trap_if (match_operator 0 "noov_compare_op" [(match_dup 2) (match_dup 3)]) + [(trap_if (match_operator 0 "noov_compare_operator" [(match_dup 2) (match_dup 3)]) (match_operand:SI 1 "arith_operand" ""))] "" "operands[2] = gen_compare_reg (GET_CODE (operands[0]), @@ -8293,7 +7955,7 @@ operands[3] = const0_rtx;") (define_insn "" - [(trap_if (match_operator 0 "noov_compare_op" [(reg:CC 100) (const_int 0)]) + [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CC 100) (const_int 0)]) (match_operand:SI 1 "arith_operand" "rM"))] "" { @@ -8305,13 +7967,15 @@ [(set_attr "type" "trap")]) (define_insn "" - [(trap_if (match_operator 0 "noov_compare_op" [(reg:CCX 100) (const_int 0)]) + [(trap_if (match_operator 0 "noov_compare_operator" [(reg:CCX 100) (const_int 0)]) (match_operand:SI 1 "arith_operand" "rM"))] "TARGET_V9" "t%C0\t%%xcc, %1" [(set_attr "type" "trap")]) -;; TLS support + +;; TLS support instructions. + (define_insn "tgd_hi22" [(set (match_operand:SI 0 "register_operand" "=r") (high:SI (unspec:SI [(match_operand 1 "tgd_symbolic_operand" "")] @@ -8874,6 +8538,7 @@ "stx\t%0, [%1 + %2], %%tldo_add(%3)" [(set_attr "type" "store")]) + ;; Vector instructions. (define_insn "addv2si3" @@ -9096,8 +8761,8 @@ (define_insn "alignaddr_vis" [(set (match_operand:P 0 "register_operand" "=r") - (unspec:P [(match_operand:P 1 "reg_or_0_operand" "rJ") - (match_operand:P 2 "reg_or_0_operand" "rJ")] + (unspec:P [(match_operand:P 1 "register_or_zero_operand" "rJ") + (match_operand:P 2 "register_or_zero_operand" "rJ")] UNSPEC_ALIGNADDR))] "TARGET_VIS" "alignaddr\t%r1, %r2, %0") diff --git a/gcc/config/sparc/sparc.opt b/gcc/config/sparc/sparc.opt new file mode 100644 index 00000000000..88a603c6f56 --- /dev/null +++ b/gcc/config/sparc/sparc.opt @@ -0,0 +1,123 @@ +; Options for the SPARC port of the compiler +; +; Copyright (C) 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. + +mfpu +Target Report Mask(FPU) +Use hardware FP + +mhard-float +Target RejectNegative Mask(FPU) MaskExists +Use hardware FP + +msoft-float +Target RejectNegative InverseMask(FPU) +Do not use hardware FP + +munaligned-doubles +Target Report Mask(UNALIGNED_DOUBLES) +Assume possible double misalignment + +mimpure-text +Target Report +Pass -assert pure-text to linker + +mapp-regs +Target Report Mask(APP_REGS) +Use ABI reserved registers + +mhard-quad-float +Target Report RejectNegative Mask(HARD_QUAD) +Use hardware quad FP instructions + +msoft-quad-float +Target Report RejectNegative InverseMask(HARD_QUAD) +Do not use hardware quad fp instructions + +mv8plus +Target Report Mask(V8PLUS) +Compile for V8+ ABI + +mvis +Target Report Mask(VIS) +Use UltraSPARC Visual Instruction Set extensions + +mptr64 +Target Report RejectNegative Mask(PTR64) +Pointers are 64-bit + +mptr32 +Target Report RejectNegative InverseMask(PTR64) +Pointers are 32-bit + +m64 +Target Report RejectNegative Mask(64BIT) +Use 64-bit ABI + +m32 +Target Report RejectNegative InverseMask(64BIT) +Use 32-bit ABI + +mstack-bias +Target Report Mask(STACK_BIAS) +Use stack bias + +mfaster-structs +Target Report Mask(FASTER_STRUCTS) +Use structs on stronger alignment for double-word copies + +mrelax +Target +Optimize tail call instructions in assembler and linker + +mcpu= +Target RejectNegative Joined +Use features of and schedule code for given CPU + +mtune= +Target RejectNegative Joined +Schedule code for given CPU + +mcmodel= +Target RejectNegative Joined +Use given SPARC-V9 code model + + +Mask(LITTLE_ENDIAN) +;; Generate code for little-endian + +Mask(LONG_DOUBLE_128) +;; Use 128-bit long double + +Mask(SPARCLITE) +;; Generate code for SPARClite + +Mask(SPARCLET) +;; Generate code for SPARClet + +Mask(V8) +;; Generate code for SPARC-V8 + +Mask(V9) +;; Generate code for SPARC-V9 + +Mask(DEPRECATED_V8_INSNS) +;; Generate code that uses the V8 instructions deprecated +;; in the V9 architecture. diff --git a/gcc/config/sparc/t-sp86x b/gcc/config/sparc/t-sp86x deleted file mode 100644 index 6dd5c03e619..00000000000 --- a/gcc/config/sparc/t-sp86x +++ /dev/null @@ -1,23 +0,0 @@ -LIB1ASMSRC = sparc/lb1spc.asm -LIB1ASMFUNCS = _divsi3 _modsi3 - -# We want fine grained libraries, so use the new code to build the -# floating point emulation libraries. -FPBIT = fp-bit.c -DPBIT = dp-bit.c - -dp-bit.c: $(srcdir)/config/fp-bit.c - echo '#define US_SOFTWARE_GOFAST' > dp-bit.c - cat $(srcdir)/config/fp-bit.c >> dp-bit.c - -fp-bit.c: $(srcdir)/config/fp-bit.c - echo '#define FLOAT' > fp-bit.c - echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c - cat $(srcdir)/config/fp-bit.c >> fp-bit.c - -MULTILIB_OPTIONS = mlittle-endian-data -MULTILIB_DIRNAMES = little - -LIBGCC = stmp-multilib -INSTALL_LIBGCC = install-multilib - diff --git a/gcc/config/sparc/t-sparclite b/gcc/config/sparc/t-sparclite deleted file mode 100644 index 27492b91cb8..00000000000 --- a/gcc/config/sparc/t-sparclite +++ /dev/null @@ -1,23 +0,0 @@ -LIB1ASMSRC = sparc/lb1spl.asm -LIB1ASMFUNCS = _divsi3 _udivsi3 _modsi3 _umodsi3 - -# We want fine grained libraries, so use the new code to build the -# floating point emulation libraries. -FPBIT = fp-bit.c -DPBIT = dp-bit.c - -dp-bit.c: $(srcdir)/config/fp-bit.c - echo '#define US_SOFTWARE_GOFAST' > dp-bit.c - cat $(srcdir)/config/fp-bit.c >> dp-bit.c - -fp-bit.c: $(srcdir)/config/fp-bit.c - echo '#define FLOAT' > fp-bit.c - echo '#define US_SOFTWARE_GOFAST' >> fp-bit.c - cat $(srcdir)/config/fp-bit.c >> fp-bit.c - -MULTILIB_OPTIONS = mfpu -MULTILIB_DIRNAMES = -MULTILIB_MATCHES = mfpu=mhard-float mfpu=mcpu?f934 - -LIBGCC = stmp-multilib -INSTALL_LIBGCC = install-multilib diff --git a/gcc/config/stormy16/predicates.md b/gcc/config/stormy16/predicates.md new file mode 100644 index 00000000000..b56b725b4da --- /dev/null +++ b/gcc/config/stormy16/predicates.md @@ -0,0 +1,146 @@ +;; Predicate definitions for XSTORMY16. +;; Copyright (C) 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. + +;; Return 1 if OP is a shift operator. + +(define_predicate "shift_operator" + (match_code "ashift,ashiftrt,lshiftrt") +{ + enum rtx_code code = GET_CODE (op); + + return (code == ASHIFT + || code == ASHIFTRT + || code == LSHIFTRT); +}) + +;; Return 1 if this is an EQ or NE operator. + +(define_predicate "equality_operator" + (match_code "eq,ne") +{ + return ((mode == VOIDmode || GET_MODE (op) == mode) + && (GET_CODE (op) == EQ || GET_CODE (op) == NE)); +}) + +;; Return 1 if this is a comparison operator but not an EQ or NE +;; operator. + +(define_predicate "inequality_operator" + (match_code "ge,gt,le,lt,geu,gtu,leu,ltu") +{ + return comparison_operator (op, mode) && ! equality_operator (op, mode); +}) + +;; Return 1 if this is a LT, GE, LTU, or GEU operator. + +(define_predicate "xstormy16_ineqsi_operator" + (match_code "lt,ge,ltu,geu") +{ + enum rtx_code code = GET_CODE (op); + + return ((mode == VOIDmode || GET_MODE (op) == mode) + && (code == LT || code == GE || code == LTU || code == GEU)); +}) + +;; Predicate for MEMs that can use special 8-bit addressing. + +(define_predicate "xstormy16_below100_operand" + (match_code "mem") +{ + if (GET_MODE (op) != mode) + return 0; + if (GET_CODE (op) == MEM) + op = XEXP (op, 0); + else if (GET_CODE (op) == SUBREG + && GET_CODE (XEXP (op, 0)) == MEM + && !MEM_VOLATILE_P (XEXP (op, 0))) + op = XEXP (XEXP (op, 0), 0); + else + return 0; + if (GET_CODE (op) == CONST_INT) + { + HOST_WIDE_INT i = INTVAL (op); + return (i >= 0x7f00 && i < 0x7fff); + } + return xstormy16_below100_symbol (op, HImode); +}) + +;; TODO: Add a comment here. + +(define_predicate "xstormy16_below100_or_register" + (match_code "mem,reg,subreg") +{ + return (xstormy16_below100_operand (op, mode) + || register_operand (op, mode)); +}) + +;; TODO: Add a comment here. + +(define_predicate "xstormy16_splittable_below100_or_register" + (match_code "mem,reg,subreg") +{ + if (GET_CODE (op) == MEM && MEM_VOLATILE_P (op)) + return 0; + return (xstormy16_below100_operand (op, mode) + || register_operand (op, mode)); +}) + +;; Predicate for constants with exactly one bit not set. + +(define_predicate "xstormy16_onebit_clr_operand" + (match_code "const_int") +{ + HOST_WIDE_INT i; + if (GET_CODE (op) != CONST_INT) + return 0; + i = ~ INTVAL (op); + if (mode == QImode) + i &= 0xff; + if (mode == HImode) + i &= 0xffff; + return exact_log2 (i) != -1; +}) + +;; Predicate for constants with exactly one bit set. + +(define_predicate "xstormy16_onebit_set_operand" + (match_code "const_int") +{ + HOST_WIDE_INT i; + if (GET_CODE (op) != CONST_INT) + return 0; + i = INTVAL (op); + if (mode == QImode) + i &= 0xff; + if (mode == HImode) + i &= 0xffff; + return exact_log2 (i) != -1; +}) + +;; TODO: Add a comment here. + +(define_predicate "nonimmediate_nonstack_operand" + (match_code "reg,mem,subreg") +{ + /* 'Q' is for pushes, 'R' for pops. */ + return (nonimmediate_operand (op, mode) + && ! xstormy16_extra_constraint_p (op, 'Q') + && ! xstormy16_extra_constraint_p (op, 'R')); +}) diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h index a8b23565418..f5f5bb67b8e 100644 --- a/gcc/config/stormy16/stormy16-protos.h +++ b/gcc/config/stormy16/stormy16-protos.h @@ -68,9 +68,6 @@ extern void xstormy16_expand_andqi3 (rtx *); #endif #if defined (HAVE_MACHINE_MODES) && defined (RTX_CODE) -extern int xstormy16_ineqsi_operator (rtx, enum machine_mode); -extern int equality_operator (rtx, enum machine_mode); -extern int inequality_operator (rtx, enum machine_mode); extern void xstormy16_split_cbranch (enum machine_mode, rtx, rtx, rtx, rtx); extern int short_memory_operand (rtx, enum machine_mode); extern int nonimmediate_nonstack_operand (rtx, enum machine_mode); @@ -85,15 +82,9 @@ extern void xstormy16_split_move (enum machine_mode, rtx, rtx); extern void xstormy16_expand_move (enum machine_mode, rtx, rtx); extern void xstormy16_expand_arith (enum machine_mode, enum rtx_code, rtx, rtx, rtx, rtx); -extern int shift_operator (rtx, enum machine_mode); extern const char * xstormy16_output_shift (enum machine_mode, enum rtx_code, rtx, rtx, rtx); extern int xstormy16_below100_symbol (rtx, enum machine_mode); -extern int xstormy16_below100_operand (rtx, enum machine_mode); extern int xstormy16_splittable_below100_operand (rtx, enum machine_mode); -extern int xstormy16_below100_or_register (rtx, enum machine_mode); -extern int xstormy16_splittable_below100_or_register (rtx, enum machine_mode); -extern int xstormy16_onebit_set_operand (rtx, enum machine_mode); -extern int xstormy16_onebit_clr_operand (rtx, enum machine_mode); #endif diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index ec40cd916b2..79d35def779 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -1,5 +1,5 @@ /* Xstormy16 target functions. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Red Hat, Inc. @@ -65,34 +65,6 @@ static bool xstormy16_return_in_memory (tree, tree); struct rtx_def * xstormy16_compare_op0; struct rtx_def * xstormy16_compare_op1; -/* Return 1 if this is a LT, GE, LTU, or GEU operator. */ - -int -xstormy16_ineqsi_operator (register rtx op, enum machine_mode mode) -{ - enum rtx_code code = GET_CODE (op); - - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (code == LT || code == GE || code == LTU || code == GEU)); -} - -/* Return 1 if this is an EQ or NE operator. */ - -int -equality_operator (register rtx op, enum machine_mode mode) -{ - return ((mode == VOIDmode || GET_MODE (op) == mode) - && (GET_CODE (op) == EQ || GET_CODE (op) == NE)); -} - -/* Return 1 if this is a comparison operator but not an EQ or NE operator. */ - -int -inequality_operator (register rtx op, enum machine_mode mode) -{ - return comparison_operator (op, mode) && ! equality_operator (op, mode); -} - /* 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. */ @@ -174,8 +146,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx loc) enum machine_mode mode; mode = GET_MODE (op0); - if (mode != HImode && mode != SImode) - abort (); + gcc_assert (mode == HImode || mode == SImode); if (mode == SImode && (code == GT || code == LE || code == GTU || code == LEU)) @@ -278,8 +249,7 @@ xstormy16_split_cbranch (enum machine_mode mode, rtx label, rtx comparison, seq = get_insns (); end_sequence (); - if (! INSN_P (seq)) - abort (); + gcc_assert (INSN_P (seq)); last_insn = seq; while (NEXT_INSN (last_insn) != NULL_RTX) @@ -352,7 +322,7 @@ xstormy16_output_cbranch_hi (rtx op, const char *label, int reversed, rtx insn) case LEU: ccode = "ls"; break; default: - abort (); + gcc_unreachable (); } if (need_longbranch) @@ -402,7 +372,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn) /* The missing codes above should never be generated. */ default: - abort (); + gcc_unreachable (); } switch (code) @@ -411,8 +381,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn) { int regnum; - if (GET_CODE (XEXP (op, 0)) != REG) - abort (); + gcc_assert (GET_CODE (XEXP (op, 0)) == REG); regnum = REGNO (XEXP (op, 0)); sprintf (prevop, "or %s,%s", reg_names[regnum], reg_names[regnum+1]); @@ -424,7 +393,7 @@ xstormy16_output_cbranch_si (rtx op, const char *label, int reversed, rtx insn) break; default: - abort (); + gcc_unreachable (); } if (need_longbranch) @@ -576,28 +545,6 @@ xstormy16_below100_symbol (rtx x, return 0; } -/* Predicate for MEMs that can use special 8-bit addressing. */ -int -xstormy16_below100_operand (rtx x, enum machine_mode mode) -{ - if (GET_MODE (x) != mode) - return 0; - if (GET_CODE (x) == MEM) - x = XEXP (x, 0); - else if (GET_CODE (x) == SUBREG - && GET_CODE (XEXP (x, 0)) == MEM - && !MEM_VOLATILE_P (XEXP (x, 0))) - x = XEXP (XEXP (x, 0), 0); - else - return 0; - if (GET_CODE (x) == CONST_INT) - { - HOST_WIDE_INT i = INTVAL (x); - return (i >= 0x7f00 && i < 0x7fff); - } - return xstormy16_below100_symbol (x, HImode); -} - /* Likewise, but only for non-volatile MEMs, for patterns where the MEM will get split into smaller sized accesses. */ int @@ -608,52 +555,6 @@ xstormy16_splittable_below100_operand (rtx x, enum machine_mode mode) return xstormy16_below100_operand (x, mode); } -int -xstormy16_below100_or_register (rtx x, enum machine_mode mode) -{ - return (xstormy16_below100_operand (x, mode) - || register_operand (x, mode)); -} - -int -xstormy16_splittable_below100_or_register (rtx x, enum machine_mode mode) -{ - if (GET_CODE (x) == MEM && MEM_VOLATILE_P (x)) - return 0; - return (xstormy16_below100_operand (x, mode) - || register_operand (x, mode)); -} - -/* Predicate for constants with exactly one bit set. */ -int -xstormy16_onebit_set_operand (rtx x, enum machine_mode mode) -{ - HOST_WIDE_INT i; - if (GET_CODE (x) != CONST_INT) - return 0; - i = INTVAL (x); - if (mode == QImode) - i &= 0xff; - if (mode == HImode) - i &= 0xffff; - return exact_log2 (i) != -1; -} - -/* Predicate for constants with exactly one bit not set. */ -int -xstormy16_onebit_clr_operand (rtx x, enum machine_mode mode) -{ - HOST_WIDE_INT i; - if (GET_CODE (x) != CONST_INT) - return 0; - i = ~ INTVAL (x); - if (mode == QImode) - i &= 0xff; - if (mode == HImode) - i &= 0xffff; - return exact_log2 (i) != -1; -} - /* Expand an 8-bit IOR. This either detects the one case we can actually do, or uses a 16-bit IOR. */ void @@ -875,15 +776,6 @@ short_memory_operand (rtx x, enum machine_mode mode) return (GET_CODE (XEXP (x, 0)) != PLUS); } -int -nonimmediate_nonstack_operand (rtx op, enum machine_mode mode) -{ - /* 'Q' is for pushes, 'R' for pops. */ - return (nonimmediate_operand (op, mode) - && ! xstormy16_extra_constraint_p (op, 'Q') - && ! xstormy16_extra_constraint_p (op, 'R')); -} - /* Splitter for the 'move' patterns, for modes not directly implemented by hardware. Emit insns to copy a value of mode MODE from SRC to DEST. @@ -904,21 +796,16 @@ xstormy16_split_move (enum machine_mode mode, rtx dest, rtx src) rtx auto_inc_reg_rtx = NULL_RTX; /* Check initial conditions. */ - if (! reload_completed - || mode == QImode || mode == HImode - || ! nonimmediate_operand (dest, mode) - || ! general_operand (src, mode)) - abort (); + gcc_assert (reload_completed + && mode != QImode && mode != HImode + && nonimmediate_operand (dest, mode) + && general_operand (src, mode)); /* This case is not supported below, and shouldn't be generated. */ - if (GET_CODE (dest) == MEM - && GET_CODE (src) == MEM) - abort (); + gcc_assert (GET_CODE (dest) != MEM || GET_CODE (src) != MEM); /* This case is very very bad after reload, so trap it now. */ - if (GET_CODE (dest) == SUBREG - || GET_CODE (src) == SUBREG) - abort (); + gcc_assert (GET_CODE (dest) != SUBREG && GET_CODE (src) != SUBREG); /* The general idea is to copy by words, offsetting the source and destination. Normally the least-significant word will be copied @@ -975,12 +862,12 @@ xstormy16_split_move (enum machine_mode mode, rtx dest, rtx src) && reg_overlap_mentioned_p (dest, src)) { int regno; - if (GET_CODE (dest) != REG) - abort (); + + gcc_assert (GET_CODE (dest) == REG); regno = REGNO (dest); - if (! refers_to_regno_p (regno, regno + num_words, mem_operand, 0)) - abort (); + gcc_assert (refers_to_regno_p (regno, regno + num_words, + mem_operand, 0)); if (refers_to_regno_p (regno, regno + 1, mem_operand, 0)) direction = -1; @@ -992,7 +879,7 @@ xstormy16_split_move (enum machine_mode mode, rtx dest, rtx src) (set (reg:DI r0) (mem:DI (reg:HI r1))) which we'd need to support by doing the set of the second word last. */ - abort (); + gcc_unreachable (); } end = direction < 0 ? -1 : num_words; @@ -1015,9 +902,8 @@ xstormy16_split_move (enum machine_mode mode, rtx dest, rtx src) MEM_VOLATILE_P (w_dest) = 1; /* The simplify_subreg calls must always be able to simplify. */ - if (GET_CODE (w_src) == SUBREG - || GET_CODE (w_dest) == SUBREG) - abort (); + gcc_assert (GET_CODE (w_src) != SUBREG + && GET_CODE (w_dest) != SUBREG); insn = emit_insn (gen_rtx_SET (VOIDmode, w_dest, w_src)); if (auto_inc_reg_rtx) @@ -1180,7 +1066,7 @@ xstormy16_initial_elimination_offset (int from, int to) else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) result = -(layout.sp_minus_fp + layout.fp_minus_ap); else - abort (); + gcc_unreachable (); return result; } @@ -1761,25 +1647,22 @@ xstormy16_encode_section_info (tree decl, rtl = r; rtlname = XEXP (rtl, 0); - if (GET_CODE (rtlname) == SYMBOL_REF) - oldname = XSTR (rtlname, 0); - else if (GET_CODE (rtlname) == MEM - && GET_CODE (XEXP (rtlname, 0)) == SYMBOL_REF) - oldname = XSTR (XEXP (rtlname, 0), 0); - else - abort (); + if (GET_CODE (rtlname) == MEM) + rtlname = XEXP (rtlname, 0); + gcc_assert (GET_CODE (rtlname) == SYMBOL_REF); + oldname = XSTR (rtlname, 0); if (DECL_INITIAL (decl)) { newsection = ".data_below100"; - DECL_SECTION_NAME (decl) = build_string (strlen (newsection), newsection); + DECL_SECTION_NAME (decl) = build_string (strlen (newsection), + newsection); } newname = alloca (strlen (oldname) + 4); sprintf (newname, "@b.%s", oldname); idp = get_identifier (newname); - XEXP (rtl, 0) = - gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); + XEXP (rtl, 0) = gen_rtx_SYMBOL_REF (Pmode, IDENTIFIER_POINTER (idp)); } } @@ -1874,8 +1757,7 @@ xstormy16_print_operand_address (FILE *file, rtx address) if (GET_CODE (address) == PLUS) { - if (GET_CODE (XEXP (address, 1)) != CONST_INT) - abort (); + gcc_assert (GET_CODE (XEXP (address, 1)) == CONST_INT); offset = INTVAL (XEXP (address, 1)); address = XEXP (address, 0); } @@ -1887,8 +1769,7 @@ xstormy16_print_operand_address (FILE *file, rtx address) if (pre_dec || post_inc) address = XEXP (address, 0); - if (GET_CODE (address) != REG) - abort (); + gcc_assert (GET_CODE (address) == REG); fputc ('(', file); if (pre_dec) @@ -2074,7 +1955,7 @@ xstormy16_output_addr_vec (FILE *file, rtx label ATTRIBUTE_UNUSED, rtx table) { int vlen, idx; - function_section (current_function_decl); + current_function_section (current_function_decl); vlen = XVECLEN (table, 0); for (idx = 0; idx < vlen; idx++) @@ -2102,8 +1983,7 @@ xstormy16_expand_call (rtx retval, rtx dest, rtx counter) rtx call, temp; enum machine_mode mode; - if (GET_CODE (dest) != MEM) - abort (); + gcc_assert (GET_CODE (dest) == MEM); dest = XEXP (dest, 0); if (! CONSTANT_P (dest) @@ -2225,7 +2105,7 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code, break; default: - abort (); + gcc_unreachable (); } firstloop = 0; @@ -2238,18 +2118,6 @@ xstormy16_expand_arith (enum machine_mode mode, enum rtx_code code, emit (gen_nop ()); } -/* Return 1 if OP is a shift operator. */ - -int -shift_operator (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - enum rtx_code code = GET_CODE (op); - - return (code == ASHIFT - || code == ASHIFTRT - || code == LSHIFTRT); -} - /* The shift operations are split at output time for constant values; variable-width shifts get handed off to a library routine. @@ -2264,10 +2132,8 @@ xstormy16_output_shift (enum machine_mode mode, enum rtx_code code, const char *r0, *r1, *rt; static char r[64]; - if (GET_CODE (size_r) != CONST_INT - || GET_CODE (x) != REG - || mode != SImode) - abort (); + gcc_assert (GET_CODE (size_r) == CONST_INT + && GET_CODE (x) == REG && mode == SImode); size = INTVAL (size_r) & (GET_MODE_BITSIZE (mode) - 1); if (size == 0) @@ -2291,7 +2157,7 @@ xstormy16_output_shift (enum machine_mode mode, enum rtx_code code, sprintf (r, "shr %s,#1 | rrc %s,#1", r1, r0); break; default: - abort (); + gcc_unreachable (); } return r; } @@ -2311,7 +2177,7 @@ xstormy16_output_shift (enum machine_mode mode, enum rtx_code code, sprintf (r, "mov %s,%s | mov %s,#0", r0, r1, r1); break; default: - abort (); + gcc_unreachable (); } return r; } @@ -2332,7 +2198,7 @@ xstormy16_output_shift (enum machine_mode mode, enum rtx_code code, r0, r1, r1, r0, (int) size - 16); break; default: - abort (); + gcc_unreachable (); } return r; } @@ -2361,7 +2227,7 @@ xstormy16_output_shift (enum machine_mode mode, enum rtx_code code, r0, rt); break; default: - abort (); + gcc_unreachable (); } return r; } @@ -2410,7 +2276,7 @@ xstormy16_handle_interrupt_attribute (tree *node, tree name, { if (TREE_CODE (*node) != FUNCTION_TYPE) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2431,14 +2297,14 @@ xstormy16_handle_below100_attribute (tree *node, && TREE_CODE (*node) != POINTER_TYPE && TREE_CODE (*node) != TYPE_DECL) { - warning ("%<__BELOW100__%> attribute only applies to variables"); + warning (0, "%<__BELOW100__%> attribute only applies to variables"); *no_add_attrs = true; } else if (args == NULL_TREE && TREE_CODE (*node) == VAR_DECL) { if (! (TREE_PUBLIC (*node) || TREE_STATIC (*node))) { - warning ("__BELOW100__ attribute not allowed with auto storage class."); + warning (0, "__BELOW100__ attribute not allowed with auto storage class."); *no_add_attrs = true; } } @@ -2483,7 +2349,7 @@ xstormy16_init_builtins (void) case 'S': arg = short_unsigned_type_node; break; case 'l': arg = long_integer_type_node; break; case 'L': arg = long_unsigned_type_node; break; - default: abort(); + default: gcc_unreachable (); } if (a == 0) ret_type = arg; @@ -2658,7 +2524,7 @@ combine_bnp (rtx insn) if (and) { - /* Some mis-optimisations by GCC can generate a RIGHT-SHIFT + /* Some mis-optimizations by GCC can generate a RIGHT-SHIFT followed by an AND like this: (parallel [(set (reg:HI r7) (lshiftrt:HI (reg:HI r7) (const_int 3))) diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h index a9f97792a77..6c48ca16766 100644 --- a/gcc/config/stormy16/stormy16.h +++ b/gcc/config/stormy16/stormy16.h @@ -61,13 +61,6 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("cpu=xstormy16"); \ } while (0) -/* This declaration should be present. */ -extern int target_flags; - -#define TARGET_SWITCHES \ - {{ "sim", 0, "Provide libraries for the simulator" }, \ - { "", 0, "" }} - #define TARGET_VERSION fprintf (stderr, " (xstormy16 cpu core)"); #define CAN_DEBUG_WITHOUT_FP @@ -810,18 +803,6 @@ do { \ /* Miscellaneous Parameters. */ -#define PREDICATE_CODES \ - {"shift_operator", {ASHIFT, ASHIFTRT, LSHIFTRT }}, \ - {"equality_operator", {EQ, NE }}, \ - {"inequality_operator", {GE, GT, LE, LT, GEU, GTU, LEU, LTU }}, \ - {"xstormy16_ineqsi_operator", {LT, GE, LTU, GEU }}, \ - {"xstormy16_below100_operand", {MEM }}, \ - {"xstormy16_below100_or_register", {MEM, REG }}, \ - {"xstormy16_splittable_below100_or_register", {MEM, REG }}, \ - {"xstormy16_onebit_clr_operand", {CONST_INT }}, \ - {"xstormy16_onebit_set_operand", {CONST_INT }}, \ - {"nonimmediate_nonstack_operand", {REG, MEM}}, - #define CASE_VECTOR_MODE SImode #define WORD_REGISTER_OPERATIONS diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md index a4feac0658d..6693f8f6bff 100644 --- a/gcc/config/stormy16/stormy16.md +++ b/gcc/config/stormy16/stormy16.md @@ -1,5 +1,5 @@ ;; XSTORMY16 Machine description template -;; Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004 +;; Copyright (C) 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by Red Hat, Inc. @@ -91,6 +91,7 @@ (define_asm_attributes [(set_attr "length" "4") (set_attr "psw_operand" "clobber")]) +(include "predicates.md") ;; :::::::::::::::::::: ;; :: @@ -1104,7 +1105,7 @@ ;; the epilogue. Using an epilogue insn is favored compared to putting ;; all of the instructions in the TARGET_ASM_FUNCTION_EPILOGUE macro, ;; since it allows the scheduler to intermix instructions with the -;; restires of the caller saved registers. In some cases, it might be +;; restores of the caller saved registers. In some cases, it might be ;; necessary to emit a barrier instruction as the first insn to ;; prevent such scheduling. (define_expand "epilogue" diff --git a/gcc/config/stormy16/stormy16.opt b/gcc/config/stormy16/stormy16.opt new file mode 100644 index 00000000000..b15bb33c619 --- /dev/null +++ b/gcc/config/stormy16/stormy16.opt @@ -0,0 +1,25 @@ +; Options for the XSTORMY16 port of the compiler. + +; Copyright (C) 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. + +; Not used by the compiler +msim +Target RejectNegative +Provide libraries for the simulator diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin index ab2e6ae05c1..fc8735bd9c0 100644 --- a/gcc/config/t-darwin +++ b/gcc/config/t-darwin @@ -22,4 +22,8 @@ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c -TARGET_LIBGCC2_CFLAGS = -fPIC +# -pipe because there's an assembler bug, 4077127, which causes +# it to not properly process the first # directive, causing temporary +# file names to appear in stabs, causing the bootstrap to fail. Using -pipe +# works around this by not having any temporary file names. +TARGET_LIBGCC2_CFLAGS = -fPIC -pipe diff --git a/gcc/config/t-slibgcc-darwin b/gcc/config/t-slibgcc-darwin index 46fb36f2bc3..fb96fde1e0a 100644 --- a/gcc/config/t-slibgcc-darwin +++ b/gcc/config/t-slibgcc-darwin @@ -3,35 +3,40 @@ SHLIB_MINOR = 1 SHLIB_REVISION = 0 SHLIB_VERSTRING = -compatibility_version $(SHLIB_MINOR) -current_version $(SHLIB_MINOR).$(SHLIB_REVISION) SHLIB_EXT = .dylib -SHLIB_SOLINK = @shlib_base_name@.dylib -SHLIB_SONAME = @shlib_base_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib +SHLIB_SUFFIX = `if test @multilib_dir@ != . ; then echo _@multilib_dir@ ; fi` +SHLIB_SOLINK = @shlib_base_name@$(SHLIB_SUFFIX)$(SHLIB_EXT) +SHLIB_SONAME = @shlib_base_name@$(SHLIB_SUFFIX).$(SHLIB_MINOR).$(SHLIB_REVISION)$(SHLIB_EXT) SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ SHLIB_DIR = @multilib_dir@ -SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ + +# Darwin only searches in /usr/lib for shared libraries, not in subdirectories, +# so the libgcc variants have different names not different locations. SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \ - -Wl,-install_name,$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME) \ - -Wl,-flat_namespace -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp \ + -Wl,-install_name,$(slibdir)/$(SHLIB_SONAME) \ + -Wl,-flat_namespace -o $(SHLIB_SONAME).tmp \ -Wl,-exported_symbols_list,$(SHLIB_MAP) \ $(SHLIB_VERSTRING) \ @multilib_flags@ $(SHLIB_OBJS) -lc && \ - rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ - if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \ - mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \ - $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \ + rm -f $(SHLIB_SOLINK) $(SHLIB_DIR)/$(SHLIB_SOLINK) && \ + if [ -f $(SHLIB_SONAME) ]; then \ + mv -f $(SHLIB_SONAME) $(SHLIB_SONAME).backup; \ else true; fi && \ - mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \ - $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) + mv $(SHLIB_SONAME).tmp $(SHLIB_SONAME) && \ + $(LN_S) $(SHLIB_SONAME) $(SHLIB_SOLINK) && \ + if [ $(SHLIB_DIR) != . ] ; then \ + $(LN_S) `pwd`/$(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) ; \ + else true; fi # $(slibdir) double quoted to protect it from expansion while building # libgcc.mk. We want this delayed until actual install time. SHLIB_INSTALL = \ - $$(mkinstalldirs) $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \ - $(INSTALL_DATA) $(SHLIB_DIR)/$(SHLIB_SONAME) \ - $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \ - rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \ + $$(mkinstalldirs) $$(DESTDIR)$$(slibdir); \ + $(INSTALL_DATA) $(SHLIB_SONAME) \ + $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \ + rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_SOLINK); \ $(LN_S) $(SHLIB_SONAME) \ - $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) + $$(DESTDIR)$$(slibdir)/$(SHLIB_SOLINK) SHLIB_MKMAP = $(srcdir)/mkmap-flat.awk SHLIB_MKMAP_OPTS = -v leading_underscore=1 SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver diff --git a/gcc/config/v850/predicates.md b/gcc/config/v850/predicates.md new file mode 100644 index 00000000000..a878fdc01fd --- /dev/null +++ b/gcc/config/v850/predicates.md @@ -0,0 +1,439 @@ +;; Predicate definitions for NEC V850. +;; Copyright (C) 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. + +;; Return true if OP is either a register or 0. + +(define_predicate "reg_or_0_operand" + (match_code "reg,subreg,const_int,const_double") +{ + if (GET_CODE (op) == CONST_INT) + return INTVAL (op) == 0; + + else if (GET_CODE (op) == CONST_DOUBLE) + return CONST_DOUBLE_OK_FOR_G (op); + + else + return register_operand (op, mode); +}) + +;; Return true if OP is either a register or a signed five bit +;; integer. + +(define_predicate "reg_or_int5_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == CONST_INT) + return CONST_OK_FOR_J (INTVAL (op)); + + else + return register_operand (op, mode); +}) + +;; Return true if OP is either a register or a signed nine bit +;; integer. + +(define_predicate "reg_or_int9_operand" + (match_code "reg,subreg,const_int") +{ + if (GET_CODE (op) == CONST_INT) + return CONST_OK_FOR_O (INTVAL (op)); + + return register_operand (op, mode); +}) + +;; Return true if OP is either a register or a const integer. + +(define_predicate "reg_or_const_operand" + (match_code "reg,const_int") +{ + if (GET_CODE (op) == CONST_INT) + return TRUE; + + return register_operand (op, mode); +}) + +;; Return true if OP is a valid call operand. + +(define_predicate "call_address_operand" + (match_code "reg,symbol_ref") +{ + /* Only registers are valid call operands if TARGET_LONG_CALLS. */ + if (TARGET_LONG_CALLS) + return GET_CODE (op) == REG; + return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); +}) + +;; TODO: Add a comment here. + +(define_predicate "movsi_source_operand" + (match_code "label_ref,symbol_ref,const_int,const_double,const,high,mem,reg,subreg") +{ + /* Some constants, as well as symbolic operands + must be done with HIGH & LO_SUM patterns. */ + if (CONSTANT_P (op) + && GET_CODE (op) != HIGH + && !(GET_CODE (op) == CONST_INT + && (CONST_OK_FOR_J (INTVAL (op)) + || CONST_OK_FOR_K (INTVAL (op)) + || CONST_OK_FOR_L (INTVAL (op))))) + return special_symbolref_operand (op, mode); + else + return general_operand (op, mode); +}) + +;; TODO: Add a comment here. + +(define_predicate "special_symbolref_operand" + (match_code "symbol_ref") +{ + if (GET_CODE (op) == CONST + && GET_CODE (XEXP (op, 0)) == PLUS + && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT + && CONST_OK_FOR_K (INTVAL (XEXP (XEXP (op, 0), 1)))) + op = XEXP (XEXP (op, 0), 0); + + if (GET_CODE (op) == SYMBOL_REF) + return (SYMBOL_REF_FLAGS (op) + & (SYMBOL_FLAG_ZDA | SYMBOL_FLAG_TDA | SYMBOL_FLAG_SDA)) != 0; + + return FALSE; +}) + +;; TODO: Add a comment here. + +(define_predicate "power_of_two_operand" + (match_code "const_int") +{ + if (GET_CODE (op) != CONST_INT) + return 0; + + if (exact_log2 (INTVAL (op)) == -1) + return 0; + return 1; +}) + +;; Return nonzero if the given RTX is suitable for collapsing into a +;; jump to a function prologue. + +(define_predicate "pattern_is_ok_for_prologue" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int i; + rtx vector_element; + + /* If there are no registers to save then the function prologue + is not suitable. */ + if (count <= 2) + return 0; + + /* The pattern matching has already established that we are adjusting the + stack and pushing at least one register. We must now check that the + remaining entries in the vector to make sure that they are also register + pushes, except for the last entry which should be a CLOBBER of r10. + + The test below performs the C equivalent of this machine description + pattern match: + + (set (mem:SI (plus:SI (reg:SI 3) + (match_operand:SI 2 "immediate_operand" "i"))) + (match_operand:SI 3 "register_is_ok_for_epilogue" "r")) + + */ + + for (i = 2; i < count - (TARGET_LONG_CALLS ? 2: 1); i++) + { + rtx dest; + rtx src; + rtx plus; + + vector_element = XVECEXP (op, 0, i); + + if (GET_CODE (vector_element) != SET) + return 0; + + dest = SET_DEST (vector_element); + src = SET_SRC (vector_element); + + if (GET_CODE (dest) != MEM + || GET_MODE (dest) != SImode + || GET_CODE (src) != REG + || GET_MODE (src) != SImode + || ! register_is_ok_for_epilogue (src, SImode)) + return 0; + + plus = XEXP (dest, 0); + + if ( GET_CODE (plus) != PLUS + || GET_CODE (XEXP (plus, 0)) != REG + || GET_MODE (XEXP (plus, 0)) != SImode + || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM + || GET_CODE (XEXP (plus, 1)) != CONST_INT) + return 0; + + /* If the register is being pushed somewhere other than the stack + space just acquired by the first operand then abandon this quest. + Note: the test is <= because both values are negative. */ + if (INTVAL (XEXP (plus, 1)) + <= INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1))) + { + return 0; + } + } + + /* Make sure that the last entries in the vector are clobbers. */ + for (; i < count; i++) + { + vector_element = XVECEXP (op, 0, i); + + if (GET_CODE (vector_element) != CLOBBER + || GET_CODE (XEXP (vector_element, 0)) != REG + || !(REGNO (XEXP (vector_element, 0)) == 10 + || (TARGET_LONG_CALLS ? (REGNO (XEXP (vector_element, 0)) == 11) : 0 ))) + return 0; + } + + return 1; +}) + +;; Return nonzero if the given RTX is suitable for collapsing into +;; jump to a function epilogue. + +(define_predicate "pattern_is_ok_for_epilogue" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int i; + + /* If there are no registers to restore then the function epilogue + is not suitable. */ + if (count <= 2) + return 0; + + /* The pattern matching has already established that we are performing a + function epilogue and that we are popping at least one register. We must + now check the remaining entries in the vector to make sure that they are + also register pops. There is no good reason why there should ever be + anything else in this vector, but being paranoid always helps... + + The test below performs the C equivalent of this machine description + pattern match: + + (set (match_operand:SI n "register_is_ok_for_epilogue" "r") + (mem:SI (plus:SI (reg:SI 3) (match_operand:SI n "immediate_operand" "i")))) + */ + + for (i = 3; i < count; i++) + { + rtx vector_element = XVECEXP (op, 0, i); + rtx dest; + rtx src; + rtx plus; + + if (GET_CODE (vector_element) != SET) + return 0; + + dest = SET_DEST (vector_element); + src = SET_SRC (vector_element); + + if (GET_CODE (dest) != REG + || GET_MODE (dest) != SImode + || ! register_is_ok_for_epilogue (dest, SImode) + || GET_CODE (src) != MEM + || GET_MODE (src) != SImode) + return 0; + + plus = XEXP (src, 0); + + if (GET_CODE (plus) != PLUS + || GET_CODE (XEXP (plus, 0)) != REG + || GET_MODE (XEXP (plus, 0)) != SImode + || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM + || GET_CODE (XEXP (plus, 1)) != CONST_INT) + return 0; + } + + return 1; +}) + +;; Return true if the given RTX is a register which can be restored by +;; a function epilogue. + +(define_predicate "register_is_ok_for_epilogue" + (match_code "reg") +{ + /* The save/restore routines can only cope with registers 20 - 31. */ + return ((GET_CODE (op) == REG) + && (((REGNO (op) >= 20) && REGNO (op) <= 31))); +}) + +;; Return nonzero if the given RTX is suitable for collapsing into a +;; DISPOSE instruction. + +(define_predicate "pattern_is_ok_for_dispose" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int i; + + /* If there are no registers to restore then + the dispose instruction is not suitable. */ + if (count <= 2) + return 0; + + /* The pattern matching has already established that we are performing a + function epilogue and that we are popping at least one register. We must + now check the remaining entries in the vector to make sure that they are + also register pops. There is no good reason why there should ever be + anything else in this vector, but being paranoid always helps... + + The test below performs the C equivalent of this machine description + pattern match: + + (set (match_operand:SI n "register_is_ok_for_epilogue" "r") + (mem:SI (plus:SI (reg:SI 3) + (match_operand:SI n "immediate_operand" "i")))) + */ + + for (i = 3; i < count; i++) + { + rtx vector_element = XVECEXP (op, 0, i); + rtx dest; + rtx src; + rtx plus; + + if (GET_CODE (vector_element) != SET) + return 0; + + dest = SET_DEST (vector_element); + src = SET_SRC (vector_element); + + if ( GET_CODE (dest) != REG + || GET_MODE (dest) != SImode + || ! register_is_ok_for_epilogue (dest, SImode) + || GET_CODE (src) != MEM + || GET_MODE (src) != SImode) + return 0; + + plus = XEXP (src, 0); + + if ( GET_CODE (plus) != PLUS + || GET_CODE (XEXP (plus, 0)) != REG + || GET_MODE (XEXP (plus, 0)) != SImode + || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM + || GET_CODE (XEXP (plus, 1)) != CONST_INT) + return 0; + } + + return 1; +}) + +;; Return nonzero if the given RTX is suitable for collapsing into a +;; PREPARE instruction. + +(define_predicate "pattern_is_ok_for_prepare" + (match_code "parallel") +{ + int count = XVECLEN (op, 0); + int i; + + /* If there are no registers to restore then the prepare instruction + is not suitable. */ + if (count <= 1) + return 0; + + /* The pattern matching has already established that we are adjusting the + stack and pushing at least one register. We must now check that the + remaining entries in the vector to make sure that they are also register + pushes. + + The test below performs the C equivalent of this machine description + pattern match: + + (set (mem:SI (plus:SI (reg:SI 3) + (match_operand:SI 2 "immediate_operand" "i"))) + (match_operand:SI 3 "register_is_ok_for_epilogue" "r")) + + */ + + for (i = 2; i < count; i++) + { + rtx vector_element = XVECEXP (op, 0, i); + rtx dest; + rtx src; + rtx plus; + + if (GET_CODE (vector_element) != SET) + return 0; + + dest = SET_DEST (vector_element); + src = SET_SRC (vector_element); + + if ( GET_CODE (dest) != MEM + || GET_MODE (dest) != SImode + || GET_CODE (src) != REG + || GET_MODE (src) != SImode + || ! register_is_ok_for_epilogue (src, SImode) + ) + return 0; + + plus = XEXP (dest, 0); + + if ( GET_CODE (plus) != PLUS + || GET_CODE (XEXP (plus, 0)) != REG + || GET_MODE (XEXP (plus, 0)) != SImode + || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM + || GET_CODE (XEXP (plus, 1)) != CONST_INT) + return 0; + + /* If the register is being pushed somewhere other than the stack + space just acquired by the first operand then abandon this quest. + Note: the test is <= because both values are negative. */ + if (INTVAL (XEXP (plus, 1)) + <= INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1))) + return 0; + } + + return 1; +}) + +;; TODO: Add a comment here. + +(define_predicate "not_power_of_two_operand" + (match_code "const_int") +{ + unsigned int mask; + + if (mode == QImode) + mask = 0xff; + else if (mode == HImode) + mask = 0xffff; + else if (mode == SImode) + mask = 0xffffffff; + else + return 0; + + if (GET_CODE (op) != CONST_INT) + return 0; + + if (exact_log2 (~INTVAL (op) & mask) == -1) + return 0; + return 1; +}) diff --git a/gcc/config/v850/v850-c.c b/gcc/config/v850/v850-c.c index 82c71deb8d9..3346fe3447c 100644 --- a/gcc/config/v850/v850-c.c +++ b/gcc/config/v850/v850-c.c @@ -64,9 +64,9 @@ static int pop_data_area (v850_data_area data_area) { if (data_area_stack == NULL) - warning ("#pragma GHS endXXXX found without previous startXXX"); + warning (0, "#pragma GHS endXXXX found without previous startXXX"); else if (data_area != data_area_stack->data_area) - warning ("#pragma GHS endXXX does not match previous startXXX"); + warning (0, "#pragma GHS endXXX does not match previous startXXX"); else { data_area_stack_element * elem; @@ -91,7 +91,7 @@ mark_current_function_as_interrupt (void) if (current_function_decl == NULL_TREE) { - warning ("cannot set interrupt attribute: no current function"); + warning (0, "cannot set interrupt attribute: no current function"); return; } @@ -99,7 +99,7 @@ mark_current_function_as_interrupt (void) if (name == NULL_TREE || TREE_CODE (name) != IDENTIFIER_NODE) { - warning ("cannot set interrupt attribute: no such identifier"); + warning (0, "cannot set interrupt attribute: no such identifier"); return; } @@ -144,7 +144,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) if (type == CPP_COMMA) repeat = 1; else if (type != CPP_EOF) - warning ("junk at end of #pragma ghs section"); + warning (0, "junk at end of #pragma ghs section"); if (streq (sect, "data")) kind = GHS_SECTION_KIND_DATA; else if (streq (sect, "text")) kind = GHS_SECTION_KIND_TEXT; @@ -161,7 +161,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) else if (streq (sect, "zbss")) kind = GHS_SECTION_KIND_ZDATA; else { - warning ("unrecognized section name \"%s\"", sect); + warning (0, "unrecognized section name \"%s\"", sect); return; } @@ -176,7 +176,7 @@ ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED) return; bad: - warning ("malformed #pragma ghs section"); + warning (0, "malformed #pragma ghs section"); return; reset: @@ -195,7 +195,7 @@ ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs interrupt"); + warning (0, "junk at end of #pragma ghs interrupt"); mark_current_function_as_interrupt (); } @@ -206,7 +206,7 @@ ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs starttda"); + warning (0, "junk at end of #pragma ghs starttda"); push_data_area (DATA_AREA_TDA); } @@ -217,7 +217,7 @@ ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs startsda"); + warning (0, "junk at end of #pragma ghs startsda"); push_data_area (DATA_AREA_SDA); } @@ -228,7 +228,7 @@ ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs startzda"); + warning (0, "junk at end of #pragma ghs startzda"); push_data_area (DATA_AREA_ZDA); } @@ -239,7 +239,7 @@ ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs endtda"); + warning (0, "junk at end of #pragma ghs endtda"); pop_data_area (DATA_AREA_TDA); } @@ -250,7 +250,7 @@ ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs endsda"); + warning (0, "junk at end of #pragma ghs endsda"); pop_data_area (DATA_AREA_SDA); } @@ -261,7 +261,7 @@ ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED) tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma ghs endzda"); + warning (0, "junk at end of #pragma ghs endzda"); pop_data_area (DATA_AREA_ZDA); } diff --git a/gcc/config/v850/v850-protos.h b/gcc/config/v850/v850-protos.h index cb36601996b..010e3355534 100644 --- a/gcc/config/v850/v850-protos.h +++ b/gcc/config/v850/v850-protos.h @@ -1,5 +1,5 @@ /* Prototypes for v850.c functions used in the md file & elsewhere. - Copyright (C) 1999, 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -35,7 +35,6 @@ extern void zdata_section (void); extern void rozdata_section (void); extern void zbss_section (void); extern int v850_handle_pragma (int (*)(void), void (*)(int), char *); -extern void override_options (void); extern int compute_register_save_size (long *); extern int compute_frame_size (int, long *); extern void v850_init_expanders (void); @@ -51,23 +50,9 @@ extern void notice_update_cc (rtx, rtx); extern char * construct_save_jarl (rtx); extern char * construct_restore_jr (rtx); #ifdef HAVE_MACHINE_MODES -extern int reg_or_int9_operand (rtx, Mmode); -extern int reg_or_const_operand (rtx, Mmode); extern char * construct_dispose_instruction (rtx); extern char * construct_prepare_instruction (rtx); -extern int pattern_is_ok_for_prepare (rtx, Mmode); -extern int pattern_is_ok_for_dispose (rtx, Mmode); extern int ep_memory_operand (rtx, Mmode, int); -extern int reg_or_0_operand (rtx, Mmode); -extern int reg_or_int5_operand (rtx, Mmode); -extern int call_address_operand (rtx, Mmode); -extern int movsi_source_operand (rtx, Mmode); -extern int power_of_two_operand (rtx, Mmode); -extern int not_power_of_two_operand (rtx, Mmode); -extern int special_symbolref_operand (rtx, Mmode); -extern int pattern_is_ok_for_prologue (rtx, Mmode); -extern int pattern_is_ok_for_epilogue (rtx, Mmode); -extern int register_is_ok_for_epilogue (rtx, Mmode); #ifdef TREE_CODE extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int); #endif diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index f3a165d28f4..06e26db0e1e 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for NEC V850 series - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). @@ -49,6 +49,7 @@ #endif /* Function prototypes for stupid compilers: */ +static bool v850_handle_option (size_t, const char *, int); static void const_double_split (rtx, HOST_WIDE_INT *, HOST_WIDE_INT *); static int const_costs_int (HOST_WIDE_INT, int); static int const_costs (rtx, enum rtx_code); @@ -75,10 +76,10 @@ static int v850_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, /* Information about the various small memory areas. */ struct small_memory_info small_memory[ (int)SMALL_MEMORY_max ] = { - /* name value max physical max */ - { "tda", (char *)0, 0, 256 }, - { "sda", (char *)0, 0, 65536 }, - { "zda", (char *)0, 0, 32768 }, + /* name max physical max */ + { "tda", 0, 256 }, + { "sda", 0, 65536 }, + { "zda", 0, 32768 }, }; /* Names of the various data areas used on the v850. */ @@ -115,6 +116,11 @@ static int v850_interrupt_p = FALSE; #undef TARGET_ASM_FILE_START_FILE_DIRECTIVE #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (MASK_DEFAULT | MASK_APP_REGS) +#undef TARGET_HANDLE_OPTION +#define TARGET_HANDLE_OPTION v850_handle_option + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS v850_rtx_costs @@ -144,49 +150,64 @@ static int v850_interrupt_p = FALSE; struct gcc_target targetm = TARGET_INITIALIZER; -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ +/* Set the maximum size of small memory area TYPE to the value given + by VALUE. Return true if VALUE was syntactically correct. VALUE + starts with the argument separator: either "-" or "=". */ -void -override_options (void) +static bool +v850_handle_memory_option (enum small_memory_type type, const char *value) { - int i; - extern int atoi (const char *); + int i, size; - /* Parse -m{s,t,z}da=nnn switches */ - for (i = 0; i < (int)SMALL_MEMORY_max; i++) - { - if (small_memory[i].value) - { - if (!ISDIGIT (*small_memory[i].value)) - error ("%s=%s is not numeric", - small_memory[i].name, - small_memory[i].value); - else - { - small_memory[i].max = atoi (small_memory[i].value); - if (small_memory[i].max > small_memory[i].physical_max) - error ("%s=%s is too large", - small_memory[i].name, - small_memory[i].value); - } - } - } + if (*value != '-' && *value != '=') + return false; - /* Make sure that the US_BIT_SET mask has been correctly initialized. */ - if ((target_flags & MASK_US_MASK_SET) == 0) + value++; + for (i = 0; value[i]; i++) + if (!ISDIGIT (value[i])) + return false; + + size = atoi (value); + if (size > small_memory[type].physical_max) + error ("value passed to %<-m%s%> is too large", small_memory[type].name); + else + small_memory[type].max = size; + return true; +} + +/* Implement TARGET_HANDLE_OPTION. */ + +static bool +v850_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED) +{ + switch (code) { - target_flags |= MASK_US_MASK_SET; - target_flags &= ~MASK_US_BIT_SET; + case OPT_mspace: + target_flags |= MASK_EP | MASK_PROLOG_FUNCTION; + return true; + + case OPT_mv850: + target_flags &= ~(MASK_CPU ^ MASK_V850); + return true; + + case OPT_mv850e: + case OPT_mv850e1: + target_flags &= ~(MASK_CPU ^ MASK_V850E); + return true; + + case OPT_mtda: + return v850_handle_memory_option (SMALL_MEMORY_TDA, arg); + + case OPT_msda: + return v850_handle_memory_option (SMALL_MEMORY_SDA, arg); + + case OPT_mzda: + return v850_handle_memory_option (SMALL_MEMORY_ZDA, arg); + + default: + return true; } } - static bool v850_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, @@ -497,30 +518,40 @@ print_operand (FILE * file, rtx x, int code) fprintf (file, "l"); break; default: - abort (); + gcc_unreachable (); } break; case 'F': /* high word of CONST_DOUBLE */ - if (GET_CODE (x) == CONST_INT) - fprintf (file, "%d", (INTVAL (x) >= 0) ? 0 : -1); - else if (GET_CODE (x) == CONST_DOUBLE) + switch (GET_CODE (x)) { + case CONST_INT: + fprintf (file, "%d", (INTVAL (x) >= 0) ? 0 : -1); + break; + + case CONST_DOUBLE: const_double_split (x, &high, &low); fprintf (file, "%ld", (long) high); + break; + + default: + gcc_unreachable (); } - else - abort (); break; case 'G': /* low word of CONST_DOUBLE */ - if (GET_CODE (x) == CONST_INT) - fprintf (file, "%ld", (long) INTVAL (x)); - else if (GET_CODE (x) == CONST_DOUBLE) + switch (GET_CODE (x)) { + case CONST_INT: + fprintf (file, "%ld", (long) INTVAL (x)); + break; + + case CONST_DOUBLE: const_double_split (x, &high, &low); fprintf (file, "%ld", (long) low); + break; + + default: + gcc_unreachable (); } - else - abort (); break; case 'L': fprintf (file, "%d\n", (int)(INTVAL (x) & 0xffff)); @@ -529,54 +560,42 @@ print_operand (FILE * file, rtx x, int code) fprintf (file, "%d", exact_log2 (INTVAL (x))); break; case 'O': - if (special_symbolref_operand (x, VOIDmode)) - { - if (GET_CODE (x) == SYMBOL_REF) - ; - else if (GET_CODE (x) == CONST) - x = XEXP (XEXP (x, 0), 0); - else - abort (); - - if (SYMBOL_REF_ZDA_P (x)) - fprintf (file, "zdaoff"); - else if (SYMBOL_REF_SDA_P (x)) - fprintf (file, "sdaoff"); - else if (SYMBOL_REF_TDA_P (x)) - fprintf (file, "tdaoff"); - else - abort (); - } + gcc_assert (special_symbolref_operand (x, VOIDmode)); + + if (GET_CODE (x) == CONST) + x = XEXP (XEXP (x, 0), 0); + else + gcc_assert (GET_CODE (x) == SYMBOL_REF); + + if (SYMBOL_REF_ZDA_P (x)) + fprintf (file, "zdaoff"); + else if (SYMBOL_REF_SDA_P (x)) + fprintf (file, "sdaoff"); + else if (SYMBOL_REF_TDA_P (x)) + fprintf (file, "tdaoff"); else - abort (); + gcc_unreachable (); break; case 'P': - if (special_symbolref_operand (x, VOIDmode)) - output_addr_const (file, x); - else - abort (); + gcc_assert (special_symbolref_operand (x, VOIDmode)); + output_addr_const (file, x); break; case 'Q': - if (special_symbolref_operand (x, VOIDmode)) - { - if (GET_CODE (x) == SYMBOL_REF) - ; - else if (GET_CODE (x) == CONST) - x = XEXP (XEXP (x, 0), 0); - else - abort (); - - if (SYMBOL_REF_ZDA_P (x)) - fprintf (file, "r0"); - else if (SYMBOL_REF_SDA_P (x)) - fprintf (file, "gp"); - else if (SYMBOL_REF_TDA_P (x)) - fprintf (file, "ep"); - else - abort (); - } + gcc_assert (special_symbolref_operand (x, VOIDmode)); + + if (GET_CODE (x) == CONST) + x = XEXP (XEXP (x, 0), 0); else - abort (); + gcc_assert (GET_CODE (x) == SYMBOL_REF); + + if (SYMBOL_REF_ZDA_P (x)) + fprintf (file, "r0"); + else if (SYMBOL_REF_SDA_P (x)) + fprintf (file, "gp"); + else if (SYMBOL_REF_TDA_P (x)) + fprintf (file, "ep"); + else + gcc_unreachable (); break; case 'R': /* 2nd word of a double. */ switch (GET_CODE (x)) @@ -615,7 +634,7 @@ print_operand (FILE * file, rtx x, int code) switch (GET_MODE (x)) { default: - abort (); + gcc_unreachable (); case QImode: fputs (".b", file); break; case HImode: fputs (".h", file); break; @@ -627,12 +646,13 @@ print_operand (FILE * file, rtx x, int code) fputs (reg_names[0], file); break; case 'z': /* reg or zero */ - if (x == const0_rtx) - fputs (reg_names[0], file); - else if (GET_CODE (x) == REG) + if (GET_CODE (x) == REG) fputs (reg_names[REGNO (x)], file); else - abort (); + { + gcc_assert (x == const0_rtx); + fputs (reg_names[0], file); + } break; default: switch (GET_CODE (x)) @@ -659,7 +679,7 @@ print_operand (FILE * file, rtx x, int code) print_operand_address (file, x); break; default: - abort (); + gcc_unreachable (); } break; @@ -758,7 +778,7 @@ print_operand_address (FILE * file, rtx addr) reg_name = "ep"; } else - abort (); + gcc_unreachable (); fprintf (file, "%s(", off_name); output_addr_const (file, addr); @@ -1078,132 +1098,6 @@ ep_memory_operand (rtx op, enum machine_mode mode, int unsigned_load) return FALSE; } - -/* Return true if OP is either a register or 0 */ - -int -reg_or_0_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return INTVAL (op) == 0; - - else if (GET_CODE (op) == CONST_DOUBLE) - return CONST_DOUBLE_OK_FOR_G (op); - - else - return register_operand (op, mode); -} - -/* Return true if OP is either a register or a signed five bit integer */ - -int -reg_or_int5_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return CONST_OK_FOR_J (INTVAL (op)); - - else - return register_operand (op, mode); -} - -/* Return true if OP is either a register or a signed nine bit integer. */ - -int -reg_or_int9_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return CONST_OK_FOR_O (INTVAL (op)); - - return register_operand (op, mode); -} - -/* Return true if OP is either a register or a const integer. */ - -int -reg_or_const_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return TRUE; - - return register_operand (op, mode); -} - -/* Return true if OP is a valid call operand. */ - -int -call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* Only registers are valid call operands if TARGET_LONG_CALLS. */ - if (TARGET_LONG_CALLS) - return GET_CODE (op) == REG; - return (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == REG); -} - -int -special_symbolref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST - && GET_CODE (XEXP (op, 0)) == PLUS - && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT - && CONST_OK_FOR_K (INTVAL (XEXP (XEXP (op, 0), 1)))) - op = XEXP (XEXP (op, 0), 0); - - if (GET_CODE (op) == SYMBOL_REF) - return (SYMBOL_REF_FLAGS (op) - & (SYMBOL_FLAG_ZDA | SYMBOL_FLAG_TDA | SYMBOL_FLAG_SDA)) != 0; - - return FALSE; -} - -int -movsi_source_operand (rtx op, enum machine_mode mode) -{ - /* Some constants, as well as symbolic operands - must be done with HIGH & LO_SUM patterns. */ - if (CONSTANT_P (op) - && GET_CODE (op) != HIGH - && !(GET_CODE (op) == CONST_INT - && (CONST_OK_FOR_J (INTVAL (op)) - || CONST_OK_FOR_K (INTVAL (op)) - || CONST_OK_FOR_L (INTVAL (op))))) - return special_symbolref_operand (op, mode); - else - return general_operand (op, mode); -} - -int -power_of_two_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) != CONST_INT) - return 0; - - if (exact_log2 (INTVAL (op)) == -1) - return 0; - return 1; -} - -int -not_power_of_two_operand (rtx op, enum machine_mode mode) -{ - unsigned int mask; - - if (mode == QImode) - mask = 0xff; - else if (mode == HImode) - mask = 0xffff; - else if (mode == SImode) - mask = 0xffffffff; - else - return 0; - - if (GET_CODE (op) != CONST_INT) - return 0; - - if (exact_log2 (~INTVAL (op) & mask) == -1) - return 0; - return 1; -} - /* Substitute memory references involving a pointer, to use the ep pointer, taking care to save and preserve the ep. */ @@ -2207,7 +2101,7 @@ v850_handle_interrupt_attribute (tree * node, { if (TREE_CODE (*node) != FUNCTION_DECL) { - warning ("%qs attribute only applies to functions", + warning (0, "%qs attribute only applies to functions", IDENTIFIER_POINTER (name)); *no_add_attrs = true; } @@ -2236,7 +2130,7 @@ v850_handle_data_area_attribute (tree* node, else if (is_attribute_p ("zda", name)) data_area = DATA_AREA_ZDA; else - abort (); + gcc_unreachable (); switch (TREE_CODE (decl)) { @@ -2351,7 +2245,7 @@ v850_encode_data_area (tree decl, rtx symbol) case DATA_AREA_ZDA: flags |= SYMBOL_FLAG_ZDA; break; case DATA_AREA_TDA: flags |= SYMBOL_FLAG_TDA; break; case DATA_AREA_SDA: flags |= SYMBOL_FLAG_SDA; break; - default: abort (); + default: gcc_unreachable (); } SYMBOL_REF_FLAGS (symbol) = flags; } @@ -2366,75 +2260,6 @@ v850_encode_section_info (tree decl, rtx rtl, int first) v850_encode_data_area (decl, XEXP (rtl, 0)); } -/* Return true if the given RTX is a register which can be restored - by a function epilogue. */ -int -register_is_ok_for_epilogue (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - /* The save/restore routines can only cope with registers 20 - 31. */ - return ((GET_CODE (op) == REG) - && (((REGNO (op) >= 20) && REGNO (op) <= 31))); -} - -/* Return nonzero if the given RTX is suitable for collapsing into - jump to a function epilogue. */ -int -pattern_is_ok_for_epilogue (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int i; - - /* If there are no registers to restore then the function epilogue - is not suitable. */ - if (count <= 2) - return 0; - - /* The pattern matching has already established that we are performing a - function epilogue and that we are popping at least one register. We must - now check the remaining entries in the vector to make sure that they are - also register pops. There is no good reason why there should ever be - anything else in this vector, but being paranoid always helps... - - The test below performs the C equivalent of this machine description - pattern match: - - (set (match_operand:SI n "register_is_ok_for_epilogue" "r") - (mem:SI (plus:SI (reg:SI 3) (match_operand:SI n "immediate_operand" "i")))) - */ - - for (i = 3; i < count; i++) - { - rtx vector_element = XVECEXP (op, 0, i); - rtx dest; - rtx src; - rtx plus; - - if (GET_CODE (vector_element) != SET) - return 0; - - dest = SET_DEST (vector_element); - src = SET_SRC (vector_element); - - if (GET_CODE (dest) != REG - || GET_MODE (dest) != SImode - || ! register_is_ok_for_epilogue (dest, SImode) - || GET_CODE (src) != MEM - || GET_MODE (src) != SImode) - return 0; - - plus = XEXP (src, 0); - - if (GET_CODE (plus) != PLUS - || GET_CODE (XEXP (plus, 0)) != REG - || GET_MODE (XEXP (plus, 0)) != SImode - || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM - || GET_CODE (XEXP (plus, 1)) != CONST_INT) - return 0; - } - - return 1; -} - /* Construct a JR instruction to a routine that will perform the equivalent of the RTL passed in as an argument. This RTL is a function epilogue that pops registers off the stack and possibly releases some extra stack space @@ -2459,12 +2284,9 @@ construct_restore_jr (rtx op) /* Work out how many bytes to pop off the stack before retrieving registers. */ - if (GET_CODE (XVECEXP (op, 0, 1)) != SET) - abort (); - if (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) != PLUS) - abort (); - if (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)) != CONST_INT) - abort (); + gcc_assert (GET_CODE (XVECEXP (op, 0, 1)) == SET); + gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) == PLUS); + gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)) == CONST_INT); stack_bytes = INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)); @@ -2484,12 +2306,10 @@ construct_restore_jr (rtx op) { rtx vector_element = XVECEXP (op, 0, i); - if (GET_CODE (vector_element) != SET) - abort (); - if (GET_CODE (SET_DEST (vector_element)) != REG) - abort (); - if (! register_is_ok_for_epilogue (SET_DEST (vector_element), SImode)) - abort (); + gcc_assert (GET_CODE (vector_element) == SET); + gcc_assert (GET_CODE (SET_DEST (vector_element)) == REG); + gcc_assert (register_is_ok_for_epilogue (SET_DEST (vector_element), + SImode)); mask |= 1 << REGNO (SET_DEST (vector_element)); } @@ -2501,24 +2321,19 @@ construct_restore_jr (rtx op) break; } - if (first >= 32) - abort (); + gcc_assert (first < 32); /* Discover the last register to pop. */ if (mask & (1 << LINK_POINTER_REGNUM)) { - if (stack_bytes != 16) - abort (); + gcc_assert (stack_bytes == 16); last = LINK_POINTER_REGNUM; } else { - if (stack_bytes != 0) - abort (); - - if ((mask & (1 << 29)) == 0) - abort (); + gcc_assert (!stack_bytes); + gcc_assert (mask & (1 << 29)); last = 29; } @@ -2552,89 +2367,6 @@ construct_restore_jr (rtx op) } -/* Return nonzero if the given RTX is suitable for collapsing into - a jump to a function prologue. */ -int -pattern_is_ok_for_prologue (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int i; - rtx vector_element; - - /* If there are no registers to save then the function prologue - is not suitable. */ - if (count <= 2) - return 0; - - /* The pattern matching has already established that we are adjusting the - stack and pushing at least one register. We must now check that the - remaining entries in the vector to make sure that they are also register - pushes, except for the last entry which should be a CLOBBER of r10. - - The test below performs the C equivalent of this machine description - pattern match: - - (set (mem:SI (plus:SI (reg:SI 3) - (match_operand:SI 2 "immediate_operand" "i"))) - (match_operand:SI 3 "register_is_ok_for_epilogue" "r")) - - */ - - for (i = 2; i < count - (TARGET_LONG_CALLS ? 2: 1); i++) - { - rtx dest; - rtx src; - rtx plus; - - vector_element = XVECEXP (op, 0, i); - - if (GET_CODE (vector_element) != SET) - return 0; - - dest = SET_DEST (vector_element); - src = SET_SRC (vector_element); - - if (GET_CODE (dest) != MEM - || GET_MODE (dest) != SImode - || GET_CODE (src) != REG - || GET_MODE (src) != SImode - || ! register_is_ok_for_epilogue (src, SImode)) - return 0; - - plus = XEXP (dest, 0); - - if ( GET_CODE (plus) != PLUS - || GET_CODE (XEXP (plus, 0)) != REG - || GET_MODE (XEXP (plus, 0)) != SImode - || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM - || GET_CODE (XEXP (plus, 1)) != CONST_INT) - return 0; - - /* If the register is being pushed somewhere other than the stack - space just acquired by the first operand then abandon this quest. - Note: the test is <= because both values are negative. */ - if (INTVAL (XEXP (plus, 1)) - <= INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1))) - { - return 0; - } - } - - /* Make sure that the last entries in the vector are clobbers. */ - for (; i < count; i++) - { - vector_element = XVECEXP (op, 0, i); - - if (GET_CODE (vector_element) != CLOBBER - || GET_CODE (XEXP (vector_element, 0)) != REG - || !(REGNO (XEXP (vector_element, 0)) == 10 - || (TARGET_LONG_CALLS ? (REGNO (XEXP (vector_element, 0)) == 11) : 0 ))) - return 0; - } - - return 1; -} - /* Construct a JARL instruction to a routine that will perform the equivalent of the RTL passed as a parameter. This RTL is a function prologue that saves some of the registers r20 - r31 onto the stack, and possibly acquires @@ -2658,14 +2390,10 @@ construct_save_jarl (rtx op) } /* Paranoia. */ - if (GET_CODE (XVECEXP (op, 0, 0)) != SET) - abort (); - if (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != PLUS) - abort (); - if (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0)) != REG) - abort (); - if (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)) != CONST_INT) - abort (); + gcc_assert (GET_CODE (XVECEXP (op, 0, 0)) == SET); + gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) == PLUS); + gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0)) == REG); + gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)) == CONST_INT); /* Work out how many bytes to push onto the stack after storing the registers. */ @@ -2687,12 +2415,10 @@ construct_save_jarl (rtx op) { rtx vector_element = XVECEXP (op, 0, i); - if (GET_CODE (vector_element) != SET) - abort (); - if (GET_CODE (SET_SRC (vector_element)) != REG) - abort (); - if (! register_is_ok_for_epilogue (SET_SRC (vector_element), SImode)) - abort (); + gcc_assert (GET_CODE (vector_element) == SET); + gcc_assert (GET_CODE (SET_SRC (vector_element)) == REG); + gcc_assert (register_is_ok_for_epilogue (SET_SRC (vector_element), + SImode)); mask |= 1 << REGNO (SET_SRC (vector_element)); } @@ -2704,23 +2430,19 @@ construct_save_jarl (rtx op) break; } - if (first >= 32) - abort (); + gcc_assert (first < 32); /* Discover the last register to push. */ if (mask & (1 << LINK_POINTER_REGNUM)) { - if (stack_bytes != -16) - abort (); + gcc_assert (stack_bytes == -16); last = LINK_POINTER_REGNUM; } else { - if (stack_bytes != 0) - abort (); - if ((mask & (1 << 29)) == 0) - abort (); + gcc_assert (!stack_bytes); + gcc_assert (mask & (1 << 29)); last = 29; } @@ -2899,7 +2621,7 @@ v850_insert_attributes (tree decl, tree * attr_ptr ATTRIBUTE_UNUSED ) switch (v850_get_data_area (decl)) { default: - abort (); + gcc_unreachable (); case DATA_AREA_SDA: kind = ((TREE_READONLY (decl)) @@ -2946,67 +2668,6 @@ v850_insert_attributes (tree decl, tree * attr_ptr ATTRIBUTE_UNUSED ) } } -/* Return nonzero if the given RTX is suitable - for collapsing into a DISPOSE instruction. */ - -int -pattern_is_ok_for_dispose (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int i; - - /* If there are no registers to restore then - the dispose instruction is not suitable. */ - if (count <= 2) - return 0; - - /* The pattern matching has already established that we are performing a - function epilogue and that we are popping at least one register. We must - now check the remaining entries in the vector to make sure that they are - also register pops. There is no good reason why there should ever be - anything else in this vector, but being paranoid always helps... - - The test below performs the C equivalent of this machine description - pattern match: - - (set (match_operand:SI n "register_is_ok_for_epilogue" "r") - (mem:SI (plus:SI (reg:SI 3) - (match_operand:SI n "immediate_operand" "i")))) - */ - - for (i = 3; i < count; i++) - { - rtx vector_element = XVECEXP (op, 0, i); - rtx dest; - rtx src; - rtx plus; - - if (GET_CODE (vector_element) != SET) - return 0; - - dest = SET_DEST (vector_element); - src = SET_SRC (vector_element); - - if ( GET_CODE (dest) != REG - || GET_MODE (dest) != SImode - || ! register_is_ok_for_epilogue (dest, SImode) - || GET_CODE (src) != MEM - || GET_MODE (src) != SImode) - return 0; - - plus = XEXP (src, 0); - - if ( GET_CODE (plus) != PLUS - || GET_CODE (XEXP (plus, 0)) != REG - || GET_MODE (XEXP (plus, 0)) != SImode - || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM - || GET_CODE (XEXP (plus, 1)) != CONST_INT) - return 0; - } - - return 1; -} - /* Construct a DISPOSE instruction that is the equivalent of the given RTX. We have already verified that this should be possible. */ @@ -3029,12 +2690,9 @@ construct_dispose_instruction (rtx op) /* Work out how many bytes to pop off the stack before retrieving registers. */ - if (GET_CODE (XVECEXP (op, 0, 1)) != SET) - abort (); - if (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) != PLUS) - abort (); - if (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)) != CONST_INT) - abort (); + gcc_assert (GET_CODE (XVECEXP (op, 0, 1)) == SET); + gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 1))) == PLUS); + gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)) == CONST_INT); stack_bytes = INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 1)), 1)); @@ -3056,12 +2714,10 @@ construct_dispose_instruction (rtx op) { rtx vector_element = XVECEXP (op, 0, i); - if (GET_CODE (vector_element) != SET) - abort (); - if (GET_CODE (SET_DEST (vector_element)) != REG) - abort (); - if (! register_is_ok_for_epilogue (SET_DEST (vector_element), SImode)) - abort (); + gcc_assert (GET_CODE (vector_element) == SET); + gcc_assert (GET_CODE (SET_DEST (vector_element)) == REG); + gcc_assert (register_is_ok_for_epilogue (SET_DEST (vector_element), + SImode)); if (REGNO (SET_DEST (vector_element)) == 2) use_callt = 1; @@ -3133,75 +2789,6 @@ construct_dispose_instruction (rtx op) return buff; } -/* Return nonzero if the given RTX is suitable - for collapsing into a PREPARE instruction. */ - -int -pattern_is_ok_for_prepare (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - int count = XVECLEN (op, 0); - int i; - - /* If there are no registers to restore then the prepare instruction - is not suitable. */ - if (count <= 1) - return 0; - - /* The pattern matching has already established that we are adjusting the - stack and pushing at least one register. We must now check that the - remaining entries in the vector to make sure that they are also register - pushes. - - The test below performs the C equivalent of this machine description - pattern match: - - (set (mem:SI (plus:SI (reg:SI 3) - (match_operand:SI 2 "immediate_operand" "i"))) - (match_operand:SI 3 "register_is_ok_for_epilogue" "r")) - - */ - - for (i = 2; i < count; i++) - { - rtx vector_element = XVECEXP (op, 0, i); - rtx dest; - rtx src; - rtx plus; - - if (GET_CODE (vector_element) != SET) - return 0; - - dest = SET_DEST (vector_element); - src = SET_SRC (vector_element); - - if ( GET_CODE (dest) != MEM - || GET_MODE (dest) != SImode - || GET_CODE (src) != REG - || GET_MODE (src) != SImode - || ! register_is_ok_for_epilogue (src, SImode) - ) - return 0; - - plus = XEXP (dest, 0); - - if ( GET_CODE (plus) != PLUS - || GET_CODE (XEXP (plus, 0)) != REG - || GET_MODE (XEXP (plus, 0)) != SImode - || REGNO (XEXP (plus, 0)) != STACK_POINTER_REGNUM - || GET_CODE (XEXP (plus, 1)) != CONST_INT) - return 0; - - /* If the register is being pushed somewhere other than the stack - space just acquired by the first operand then abandon this quest. - Note: the test is <= because both values are negative. */ - if (INTVAL (XEXP (plus, 1)) - <= INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1))) - return 0; - } - - return 1; -} - /* Construct a PREPARE instruction that is the equivalent of the given RTL. We have already verified that this should be possible. */ @@ -3224,12 +2811,9 @@ construct_prepare_instruction (rtx op) /* Work out how many bytes to push onto the stack after storing the registers. */ - if (GET_CODE (XVECEXP (op, 0, 0)) != SET) - abort (); - if (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != PLUS) - abort (); - if (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)) != CONST_INT) - abort (); + gcc_assert (GET_CODE (XVECEXP (op, 0, 0)) == SET); + gcc_assert (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) == PLUS); + gcc_assert (GET_CODE (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)) == CONST_INT); stack_bytes = INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)); @@ -3250,12 +2834,10 @@ construct_prepare_instruction (rtx op) { rtx vector_element = XVECEXP (op, 0, i); - if (GET_CODE (vector_element) != SET) - abort (); - if (GET_CODE (SET_SRC (vector_element)) != REG) - abort (); - if (! register_is_ok_for_epilogue (SET_SRC (vector_element), SImode)) - abort (); + gcc_assert (GET_CODE (vector_element) == SET); + gcc_assert (GET_CODE (SET_SRC (vector_element)) == REG); + gcc_assert (register_is_ok_for_epilogue (SET_SRC (vector_element), + SImode)); if (REGNO (SET_SRC (vector_element)) == 2) use_callt = 1; diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h index 3c2ba9322f4..00b542bc77f 100644 --- a/gcc/config/v850/v850.h +++ b/gcc/config/v850/v850.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. NEC V850 series - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com). @@ -83,137 +83,11 @@ builtin_assert( "cpu=v850" ); \ } while(0) -/* Run-time compilation parameters selecting different hardware subsets. */ - -extern int target_flags; - -/* Target flags bits, see below for an explanation of the bits. */ -#define MASK_GHS 0x00000001 -#define MASK_LONG_CALLS 0x00000002 -#define MASK_EP 0x00000004 -#define MASK_PROLOG_FUNCTION 0x00000008 -#define MASK_DEBUG 0x40000000 - -#define MASK_CPU 0x00000030 -#define MASK_V850 0x00000010 -#define MASK_V850E 0x00000020 -#define MASK_SMALL_SLD 0x00000040 - -#define MASK_BIG_SWITCH 0x00000100 -#define MASK_NO_APP_REGS 0x00000200 -#define MASK_DISABLE_CALLT 0x00000400 -#define MASK_STRICT_ALIGN 0x00000800 - -#define MASK_US_BIT_SET 0x00001000 -#define MASK_US_MASK_SET 0x00002000 - -/* Macros used in the machine description to test the flags. */ - -/* The GHS calling convention support doesn't really work, - mostly due to a lack of documentation. Outstanding issues: - - * How do varargs & stdarg really work. How to they handle - passing structures (if at all). - - * Doubles are normally 4 byte aligned, except in argument - lists where they are 8 byte aligned. Is the alignment - in the argument list based on the first parameter, - first stack parameter, etc etc. - - * Passing/returning of large structures probably isn't the same - as GHS. We don't have enough documentation on their conventions - to be compatible. - - * Tests of TARGET_SETUP_INCOMING_VARARGS need to be made runtime checks - since it depends on TARGET_GHS. */ -#define TARGET_GHS (target_flags & MASK_GHS) - -/* Don't do PC-relative calls, instead load the address of the target - function into a register and perform a register indirect call. */ -#define TARGET_LONG_CALLS (target_flags & MASK_LONG_CALLS) - -/* Whether to optimize space by using ep (r30) for pointers with small offsets - in basic blocks. */ -#define TARGET_EP (target_flags & MASK_EP) - -/* Whether to call out-of-line functions to save registers or not. */ -#define TARGET_PROLOG_FUNCTION (target_flags & MASK_PROLOG_FUNCTION) - -#define TARGET_V850 ((target_flags & MASK_CPU) == MASK_V850) - -/* Whether to emit 2 byte per entry or 4 byte per entry switch tables. */ -#define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH) - -/* General debug flag. */ -#define TARGET_DEBUG (target_flags & MASK_DEBUG) -#define TARGET_V850E ((target_flags & MASK_V850E) == MASK_V850E) - -#define TARGET_US_BIT_SET (target_flags & MASK_US_BIT_SET) - -/* Whether to assume that the SLD.B and SLD.H instructions only have small - displacement fields, thus allowing the generated code to run on any of - the V850 range of processors. */ -#define TARGET_SMALL_SLD (target_flags & MASK_SMALL_SLD) - -/* True if callt will not be used for function prolog & epilog. */ -#define TARGET_DISABLE_CALLT (target_flags & MASK_DISABLE_CALLT) - -/* False if r2 and r5 can be used by the compiler. True if r2 - and r5 are to be fixed registers (for compatibility with GHS). */ -#define TARGET_NO_APP_REGS (target_flags & MASK_NO_APP_REGS) - -#define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN) - -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - {{ "ghs", MASK_GHS, N_("Support Green Hills ABI") }, \ - { "no-ghs", -MASK_GHS, "" }, \ - { "long-calls", MASK_LONG_CALLS, \ - N_("Prohibit PC relative function calls") },\ - { "no-long-calls", -MASK_LONG_CALLS, "" }, \ - { "ep", MASK_EP, \ - N_("Reuse r30 on a per function basis") }, \ - { "no-ep", -MASK_EP, "" }, \ - { "prolog-function", MASK_PROLOG_FUNCTION, \ - N_("Use stubs for function prologues") }, \ - { "no-prolog-function", -MASK_PROLOG_FUNCTION, "" }, \ - { "space", MASK_EP | MASK_PROLOG_FUNCTION, \ - N_("Same as: -mep -mprolog-function") }, \ - { "debug", MASK_DEBUG, N_("Enable backend debugging") }, \ - { "v850", MASK_V850, \ - N_("Compile for the v850 processor") }, \ - { "v850", -(MASK_V850 ^ MASK_CPU), "" }, \ - { "v850e1", MASK_V850E, N_("Compile for v850e1 processor") }, \ - { "v850e1", -(MASK_V850E ^ MASK_CPU), "" }, /* Make sure that the other bits are cleared. */ \ - { "v850e", MASK_V850E, N_("Compile for v850e processor") }, \ - { "v850e", -(MASK_V850E ^ MASK_CPU), "" }, /* Make sure that the other bits are cleared. */ \ - { "small-sld", MASK_SMALL_SLD, N_("Enable the use of the short load instructions") }, \ - { "no-small-sld", -MASK_SMALL_SLD, "" }, \ - { "disable-callt", MASK_DISABLE_CALLT, \ - N_("Do not use the callt instruction") }, \ - { "no-disable-callt", -MASK_DISABLE_CALLT, "" }, \ - { "US-bit-set", (MASK_US_BIT_SET | MASK_US_MASK_SET), "" }, \ - { "no-US-bit-set", -MASK_US_BIT_SET, "" }, \ - { "no-US-bit-set", MASK_US_MASK_SET, "" }, \ - { "app-regs", -MASK_NO_APP_REGS, "" }, \ - { "no-app-regs", MASK_NO_APP_REGS, \ - N_("Do not use registers r2 and r5") }, \ - { "strict-align", MASK_STRICT_ALIGN, \ - N_("Enforce strict alignment") }, \ - { "no-strict-align", -MASK_STRICT_ALIGN, "" }, \ - { "big-switch", MASK_BIG_SWITCH, \ - N_("Use 4 byte entries in switch tables") },\ - { "", MASK_DEFAULT, ""}} +#define MASK_CPU (MASK_V850 | MASK_V850E) /* Information about the various small memory areas. */ struct small_memory_info { const char *name; - const char *value; long max; long physical_max; }; @@ -230,30 +104,6 @@ enum small_memory_type { extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max]; -#define TARGET_OPTIONS \ -{ \ - { "tda=", &small_memory[ (int)SMALL_MEMORY_TDA ].value, \ - N_("Set the max size of data eligible for the TDA area"), 0}, \ - { "tda-", &small_memory[ (int)SMALL_MEMORY_TDA ].value, "", 0}, \ - { "sda=", &small_memory[ (int)SMALL_MEMORY_SDA ].value, \ - N_("Set the max size of data eligible for the SDA area"), 0}, \ - { "sda-", &small_memory[ (int)SMALL_MEMORY_SDA ].value, "", 0}, \ - { "zda=", &small_memory[ (int)SMALL_MEMORY_ZDA ].value, \ - N_("Set the max size of data eligible for the ZDA area"), 0}, \ - { "zda-", &small_memory[ (int)SMALL_MEMORY_ZDA ].value, "", 0}, \ -} - -/* Sometimes certain combinations of command options do not make - sense on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. - - Don't use this macro to turn on various extra optimizations for - `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */ -#define OVERRIDE_OPTIONS override_options () - - /* Show we can debug even without a frame pointer. */ #define CAN_DEBUG_WITHOUT_FP @@ -400,14 +250,14 @@ extern struct small_memory_info small_memory[(int)SMALL_MEMORY_max]; 0, 1, 3, 4, 5, 30, 32, 33 /* fixed registers */ \ } -/* If TARGET_NO_APP_REGS is not defined then add r2 and r5 to +/* If TARGET_APP_REGS is not defined then add r2 and r5 to the pool of fixed registers. See PR 14505. */ #define CONDITIONAL_REGISTER_USAGE \ { \ - if (TARGET_NO_APP_REGS) \ + if (!TARGET_APP_REGS) \ { \ - fixed_regs[2] = 1; call_used_regs[2] = 1; \ - fixed_regs[5] = 1; call_used_regs[5] = 1; \ + fixed_regs[2] = 1; call_used_regs[2] = 1; \ + fixed_regs[5] = 1; call_used_regs[5] = 1; \ } \ } @@ -704,7 +554,7 @@ enum reg_class else if ((FROM) == ARG_POINTER_REGNUM) \ (OFFSET) = compute_frame_size (get_frame_size (), (long *)0); \ else \ - abort (); \ + gcc_unreachable (); \ } /* Keep the stack pointer constant throughout the function. */ @@ -1368,30 +1218,4 @@ extern union tree_node * GHS_current_section_names [(int) COUNT_OF_GHS_SECTION_K #define SYMBOL_REF_TDA_P(X) ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_TDA) != 0) #define SYMBOL_REF_SDA_P(X) ((SYMBOL_REF_FLAGS (X) & SYMBOL_FLAG_SDA) != 0) -/* Define this if you have defined special-purpose predicates in the - file `MACHINE.c'. This macro is called within an initializer of an - array of structures. The first field in the structure is the name - of a predicate and the second field is an array of rtl codes. For - each predicate, list all rtl codes that can be in expressions - matched by the predicate. The list should have a trailing comma. */ - -#define PREDICATE_CODES \ -{ "reg_or_0_operand", { REG, SUBREG, CONST_INT, CONST_DOUBLE }}, \ -{ "reg_or_int5_operand", { REG, SUBREG, CONST_INT }}, \ -{ "reg_or_int9_operand", { REG, SUBREG, CONST_INT }}, \ -{ "reg_or_const_operand", { REG, CONST_INT }}, \ -{ "call_address_operand", { REG, SYMBOL_REF }}, \ -{ "movsi_source_operand", { LABEL_REF, SYMBOL_REF, CONST_INT, \ - CONST_DOUBLE, CONST, HIGH, MEM, \ - REG, SUBREG }}, \ -{ "special_symbolref_operand", { SYMBOL_REF }}, \ -{ "power_of_two_operand", { CONST_INT }}, \ -{ "pattern_is_ok_for_prologue", { PARALLEL }}, \ -{ "pattern_is_ok_for_epilogue", { PARALLEL }}, \ -{ "register_is_ok_for_epilogue",{ REG }}, \ -{ "pattern_is_ok_for_dispose", { PARALLEL }}, \ -{ "pattern_is_ok_for_prepare", { PARALLEL }}, \ -{ "register_is_ok_for_dispose", { REG }}, \ -{ "not_power_of_two_operand", { CONST_INT }}, - #endif /* ! GCC_V850_H */ diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md index cc82079629b..7a3e9d2652c 100644 --- a/gcc/config/v850/v850.md +++ b/gcc/config/v850/v850.md @@ -1,5 +1,5 @@ ;; GCC machine description for NEC V850 -;; Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004 +;; Copyright (C) 1996, 1997, 1998, 1999, 2002, 2004, 2005 ;; Free Software Foundation, Inc. ;; Contributed by Jeff Law (law@cygnus.com). @@ -71,6 +71,8 @@ (define_insn_reservation "v850_memory" 2 (eq_attr "type" "load") "nothing") + +(include "predicates.md") ;; ---------------------------------------------------------------------- ;; MOVE INSTRUCTIONS @@ -874,6 +876,7 @@ " { rtx insn = get_last_insn_anywhere (); + rtx src; if ( (GET_CODE (operands[2]) == CONST_INT && GET_CODE (operands[3]) == CONST_INT)) @@ -901,28 +904,28 @@ if (GET_CODE (operands[3]) != REG) operands[3] = copy_to_mode_reg (SImode, operands[3]); } - if (GET_CODE (insn) == INSN - && GET_CODE (PATTERN (insn)) == SET - && SET_DEST (PATTERN (insn)) == cc0_rtx) + gcc_assert (GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == SET + && SET_DEST (PATTERN (insn)) == cc0_rtx); + + src = SET_SRC (PATTERN (insn)); + + switch (GET_CODE (src)) { - rtx src = SET_SRC (PATTERN (insn)); - - if (GET_CODE (src) == COMPARE) - { - operands[4] = XEXP (src, 0); - operands[5] = XEXP (src, 1); - } - else if (GET_CODE (src) == REG - || GET_CODE (src) == SUBREG) - { - operands[4] = src; - operands[5] = const0_rtx; - } - else - abort (); + case COMPARE: + operands[4] = XEXP (src, 0); + operands[5] = XEXP (src, 1); + break; + + case REG: + case SUBREG: + operands[4] = src; + operands[5] = const0_rtx; + break; + + default: + gcc_unreachable (); } - else - abort (); }") ;; ??? Clobbering the condition codes is overkill. @@ -1000,7 +1003,7 @@ (ashift:SI (match_operand:SI 2 "register_operand" "") (const_int 1))))] "TARGET_V850E" - "* abort ();") + "* gcc_unreachable ();") (define_insn "*sasf_2" [(set (match_operand:SI 0 "register_operand" "=r") diff --git a/gcc/config/v850/v850.opt b/gcc/config/v850/v850.opt new file mode 100644 index 00000000000..8b19791b871 --- /dev/null +++ b/gcc/config/v850/v850.opt @@ -0,0 +1,91 @@ +; Options for the NEC V850 port of the compiler. + +; Copyright (C) 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. + +mapp-regs +Target Report Mask(APP_REGS) +Use registers r2 and r5 + +mbig-switch +Target Report Mask(BIG_SWITCH) +Use 4 byte entries in switch tables + +mdebug +Target Report Mask(DEBUG) +Enable backend debugging + +mdisable-callt +Target Report Mask(DISABLE_CALLT) +Do not use the callt instruction + +mep +Target Report Mask(EP) +Reuse r30 on a per function basis + +mghs +Target Report Mask(GHS) +Support Green Hills ABI + +mlong-calls +Target Report Mask(LONG_CALLS) +Prohibit PC relative function calls + +mprolog-function +Target Report Mask(PROLOG_FUNCTION) +Use stubs for function prologues + +msda +Target RejectNegative Joined +Set the max size of data eligible for the SDA area + +msmall-sld +Target Report Mask(SMALL_SLD) +Enable the use of the short load instructions + +mspace +Target RejectNegative +Same as: -mep -mprolog-function + +mtda +Target RejectNegative Joined +Set the max size of data eligible for the TDA area + +mstrict-align +Target Report Mask(STRICT_ALIGN) +Enforce strict alignment + +mUS-bit-set +Target Report Mask(US_BIT_SET) + +mv850 +Target Report RejectNegative Mask(V850) +Compile for the v850 processor + +mv850e +Target Report RejectNegative Mask(V850E) +Compile for the v850e processor + +mv850e1 +Target RejectNegative Mask(V850E) MaskExists +Compile for the v850e1 processor + +mzda +Target RejectNegative Joined +Set the max size of data eligible for the ZDA area diff --git a/gcc/config/vax/elf.h b/gcc/config/vax/elf.h index 0668d5b8d3f..bc8a4d50f3e 100644 --- a/gcc/config/vax/elf.h +++ b/gcc/config/vax/elf.h @@ -1,6 +1,6 @@ /* Target definitions for GNU compiler for VAX using ELF - Copyright (C) 2002, 2004 Free Software Foundation, Inc. - Contributed by Matt Thomas (matt@3am-software.com) + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Contributed by Matt Thomas This file is part of GCC. @@ -26,9 +26,9 @@ Boston, MA 02111-1307, USA. */ #undef REGISTER_NAMES #define REGISTER_PREFIX "%" #define REGISTER_NAMES \ -{"%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \ - "%r8", "%r9", "%r10", "%r11", "%ap", "%fp", "%sp", "%pc"} - + { "%r0", "%r1", "%r2", "%r3", "%r4", "%r5", "%r6", "%r7", \ + "%r8", "%r9", "%r10", "%r11", "%ap", "%fp", "%sp", "%pc", } + #undef SIZE_TYPE #define SIZE_TYPE "long unsigned int" @@ -52,13 +52,13 @@ Boston, MA 02111-1307, USA. */ /* Place the top of the stack for the DWARF2 EH stackadj value. */ #define EH_RETURN_STACKADJ_RTX \ gen_rtx_MEM (SImode, \ - plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM), \ + plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\ -4)) /* Simple store the return handler into the call frame. */ #define EH_RETURN_HANDLER_RTX \ gen_rtx_MEM (Pmode, \ - plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM), \ + plus_constant (gen_rtx_REG (Pmode, FRAME_POINTER_REGNUM),\ 16)) @@ -71,19 +71,20 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) #undef OVERRIDE_OPTIONS -#define OVERRIDE_OPTIONS \ - do \ - { \ - /* Do generic VAX overrides. */ \ - override_options (); \ - \ - /* Turn off function CSE if we're \ - doing PIC. */ \ - if (flag_pic) flag_no_function_cse = 1; \ - } \ +#define OVERRIDE_OPTIONS \ + do \ + { \ + /* Do generic VAX overrides. */ \ + override_options (); \ + \ + /* Turn off function CSE if we're doing PIC. */ \ + if (flag_pic) \ + flag_no_function_cse = 1; \ + } \ while (0) /* VAX ELF is always gas; override the generic VAX ASM_SPEC. */ #undef ASM_SPEC #define ASM_SPEC "" + diff --git a/gcc/config/vax/vax-modes.def b/gcc/config/vax/vax-modes.def index 5f137f9aca9..dc630b45b9b 100644 --- a/gcc/config/vax/vax-modes.def +++ b/gcc/config/vax/vax-modes.def @@ -1,4 +1,4 @@ -/* VAX extra machine modes. +/* VAX extra machine modes. Copyright (C) 2003 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/config/vax/vax-protos.h b/gcc/config/vax/vax-protos.h index bc8c02f3bc1..8ba14900e84 100644 --- a/gcc/config/vax/vax-protos.h +++ b/gcc/config/vax/vax-protos.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. VAX version. - Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -20,15 +20,22 @@ Boston, MA 02111-1307, USA. */ extern void override_options (void); +extern int legitimate_constant_address_p (rtx); +extern int legitimate_constant_p (rtx); +extern int legitimate_address_p (enum machine_mode, rtx, int); +extern int vax_mode_dependent_address_p (rtx); + #ifdef RTX_CODE extern const char *rev_cond_name (rtx); extern void split_quadword_operands (rtx *, rtx *, int); extern void print_operand_address (FILE *, rtx); extern int vax_float_literal (rtx); extern void vax_notice_update_cc (rtx, rtx); +extern const char * vax_output_int_move (rtx, rtx *, enum machine_mode); +extern const char * vax_output_int_add (rtx, rtx *, enum machine_mode); +extern const char * vax_output_conditional_branch (enum rtx_code); #endif /* RTX_CODE */ #ifdef REAL_VALUE_TYPE extern int check_float_value (enum machine_mode, REAL_VALUE_TYPE *, int); #endif /* REAL_VALUE_TYPE */ - diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index ca5fb6ac629..75892f2b48d 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -1,5 +1,6 @@ /* Subroutines for insn-output.c for VAX. - Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1987, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, + 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -50,7 +51,6 @@ static void vax_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree); static int vax_address_cost_1 (rtx); static int vax_address_cost (rtx); -static int vax_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code); static bool vax_rtx_costs (rtx, int, int, int *); static rtx vax_struct_value_rtx (tree, int); @@ -74,6 +74,9 @@ static rtx vax_struct_value_rtx (tree, int); #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK #define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS vax_rtx_costs #undef TARGET_ADDRESS_COST @@ -109,8 +112,8 @@ override_options (void) static void vax_output_function_prologue (FILE * file, HOST_WIDE_INT size) { - register int regno; - register int mask = 0; + int regno; + int mask = 0; for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) if (regs_ever_live[regno] && !call_used_regs[regno]) @@ -196,9 +199,9 @@ split_quadword_operands (rtx * operands, rtx * low, int n ATTRIBUTE_UNUSED) } void -print_operand_address (FILE * file, register rtx addr) +print_operand_address (FILE * file, rtx addr) { - register rtx reg1, breg, ireg; + rtx reg1, breg, ireg; rtx offset; retry: @@ -266,7 +269,7 @@ print_operand_address (FILE * file, register rtx addr) addr = XEXP (addr, 1); } else - abort (); + gcc_unreachable (); if (GET_CODE (addr) == REG) { @@ -277,8 +280,9 @@ print_operand_address (FILE * file, register rtx addr) } else if (GET_CODE (addr) == MULT) ireg = addr; - else if (GET_CODE (addr) == PLUS) + else { + gcc_assert (GET_CODE (addr) == PLUS); if (CONSTANT_ADDRESS_P (XEXP (addr, 0)) || GET_CODE (XEXP (addr, 0)) == MEM) { @@ -286,10 +290,11 @@ print_operand_address (FILE * file, register rtx addr) { if (GET_CODE (offset) == CONST_INT) offset = plus_constant (XEXP (addr, 0), INTVAL (offset)); - else if (GET_CODE (XEXP (addr, 0)) == CONST_INT) - offset = plus_constant (offset, INTVAL (XEXP (addr, 0))); else - abort (); + { + gcc_assert (GET_CODE (XEXP (addr, 0)) == CONST_INT); + offset = plus_constant (offset, INTVAL (XEXP (addr, 0))); + } } offset = XEXP (addr, 0); } @@ -300,14 +305,12 @@ print_operand_address (FILE * file, register rtx addr) else reg1 = XEXP (addr, 0); } - else if (GET_CODE (XEXP (addr, 0)) == MULT) + else { - if (ireg) - abort (); + gcc_assert (GET_CODE (XEXP (addr, 0)) == MULT); + gcc_assert (!ireg); ireg = XEXP (addr, 0); } - else - abort (); if (CONSTANT_ADDRESS_P (XEXP (addr, 1)) || GET_CODE (XEXP (addr, 1)) == MEM) @@ -316,10 +319,11 @@ print_operand_address (FILE * file, register rtx addr) { if (GET_CODE (offset) == CONST_INT) offset = plus_constant (XEXP (addr, 1), INTVAL (offset)); - else if (GET_CODE (XEXP (addr, 1)) == CONST_INT) - offset = plus_constant (offset, INTVAL (XEXP (addr, 1))); else - abort (); + { + gcc_assert (GET_CODE (XEXP (addr, 1)) == CONST_INT); + offset = plus_constant (offset, INTVAL (XEXP (addr, 1))); + } } offset = XEXP (addr, 1); } @@ -330,25 +334,20 @@ print_operand_address (FILE * file, register rtx addr) else reg1 = XEXP (addr, 1); } - else if (GET_CODE (XEXP (addr, 1)) == MULT) + else { - if (ireg) - abort (); + gcc_assert (GET_CODE (XEXP (addr, 1)) == MULT); + gcc_assert (!ireg); ireg = XEXP (addr, 1); } - else - abort (); } - else - abort (); /* If REG1 is nonzero, figure out if it is a base or index register. */ if (reg1) { if (breg != 0 || (offset && GET_CODE (offset) == MEM)) { - if (ireg) - abort (); + gcc_assert (!ireg); ireg = reg1; } else @@ -365,8 +364,7 @@ print_operand_address (FILE * file, register rtx addr) { if (GET_CODE (ireg) == MULT) ireg = XEXP (ireg, 0); - if (GET_CODE (ireg) != REG) - abort (); + gcc_assert (GET_CODE (ireg) == REG); fprintf (file, "[%s]", reg_names[REGNO (ireg)]); } break; @@ -403,14 +401,14 @@ rev_cond_name (rtx op) return "lssu"; default: - abort (); + gcc_unreachable (); } } int -vax_float_literal(register rtx c) +vax_float_literal(rtx c) { - register enum machine_mode mode; + enum machine_mode mode; REAL_VALUE_TYPE r, s; int i; @@ -429,12 +427,13 @@ vax_float_literal(register rtx c) for (i = 0; i < 7; i++) { int x = 1 << i; + bool ok; REAL_VALUE_FROM_INT (s, x, 0, mode); if (REAL_VALUES_EQUAL (r, s)) return 1; - if (!exact_real_inverse (mode, &s)) - abort (); + ok = exact_real_inverse (mode, &s); + gcc_assert (ok); if (REAL_VALUES_EQUAL (r, s)) return 1; } @@ -454,7 +453,7 @@ vax_float_literal(register rtx c) static int -vax_address_cost_1 (register rtx addr) +vax_address_cost_1 (rtx addr) { int reg = 0, indexed = 0, indir = 0, offset = 0, predec = 0; rtx plus_op0 = 0, plus_op1 = 0; @@ -529,179 +528,228 @@ vax_address_cost (rtx x) /* Cost of an expression on a VAX. This version has costs tuned for the CVAX chip (found in the VAX 3 series) with comments for variations on - other models. */ + other models. -static int -vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code) + FIXME: The costs need review, particularly for TRUNCATE, FLOAT_EXTEND + and FLOAT_TRUNCATE. We need a -mcpu option to allow provision of + costs on a per cpu basis. */ + +static bool +vax_rtx_costs (rtx x, int code, int outer_code, int *total) { enum machine_mode mode = GET_MODE (x); - register int c; - int i = 0; /* may be modified in switch */ + int i = 0; /* may be modified in switch */ const char *fmt = GET_RTX_FORMAT (code); /* may be modified in switch */ switch (code) { /* On a VAX, constants from 0..63 are cheap because they can use the - 1 byte literal constant format. compare to -1 should be made cheap - so that decrement-and-branch insns can be formed more easily (if - the value -1 is copied to a register some decrement-and-branch + 1 byte literal constant format. Compare to -1 should be made cheap + so that decrement-and-branch insns can be formed more easily (if + the value -1 is copied to a register some decrement-and-branch patterns will not match). */ case CONST_INT: if (INTVAL (x) == 0) - return 0; + return true; if (outer_code == AND) - return ((unsigned HOST_WIDE_INT) ~INTVAL (x) <= 077) ? 1 : 2; - if ((unsigned HOST_WIDE_INT) INTVAL (x) <= 077) - return 1; - if (outer_code == COMPARE && INTVAL (x) == -1) - return 1; - if (outer_code == PLUS && (unsigned HOST_WIDE_INT) -INTVAL (x) <= 077) - return 1; + { + *total = ((unsigned HOST_WIDE_INT) ~INTVAL (x) <= 077) ? 1 : 2; + return true; + } + if ((unsigned HOST_WIDE_INT) INTVAL (x) <= 077 + || (outer_code == COMPARE + && INTVAL (x) == -1) + || ((outer_code == PLUS || outer_code == MINUS) + && (unsigned HOST_WIDE_INT) -INTVAL (x) <= 077)) + { + *total = 1; + return true; + } /* FALLTHRU */ case CONST: case LABEL_REF: case SYMBOL_REF: - return 3; + *total = 3; + return true; case CONST_DOUBLE: if (GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT) - return vax_float_literal (x) ? 5 : 8; + *total = vax_float_literal (x) ? 5 : 8; else - return (((CONST_DOUBLE_HIGH (x) == 0 - && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x) < 64) - || (outer_code == PLUS - && CONST_DOUBLE_HIGH (x) == -1 \ - && (unsigned HOST_WIDE_INT)-CONST_DOUBLE_LOW (x) < 64)) - ? 2 : 5); - + *total = ((CONST_DOUBLE_HIGH (x) == 0 + && (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (x) < 64) + || (outer_code == PLUS + && CONST_DOUBLE_HIGH (x) == -1 + && (unsigned HOST_WIDE_INT)-CONST_DOUBLE_LOW (x) < 64)) + ? 2 : 5; + return true; + case POST_INC: - return 2; + *total = 2; + return true; /* Implies register operand. */ + case PRE_DEC: - return 3; + *total = 3; + return true; /* Implies register operand. */ + case MULT: switch (mode) { case DFmode: - c = 16; /* 4 on VAX 9000 */ + *total = 16; /* 4 on VAX 9000 */ break; case SFmode: - c = 9; /* 4 on VAX 9000, 12 on VAX 2 */ + *total = 9; /* 4 on VAX 9000, 12 on VAX 2 */ break; case DImode: - c = 16; /* 6 on VAX 9000, 28 on VAX 2 */ + *total = 16; /* 6 on VAX 9000, 28 on VAX 2 */ break; case SImode: case HImode: case QImode: - c = 10; /* 3-4 on VAX 9000, 20-28 on VAX 2 */ + *total = 10; /* 3-4 on VAX 9000, 20-28 on VAX 2 */ break; default: - return MAX_COST; /* Mode is not supported. */ + *total = MAX_COST; /* Mode is not supported. */ + return true; } break; + case UDIV: if (mode != SImode) - return MAX_COST; /* Mode is not supported. */ - c = 17; + { + *total = MAX_COST; /* Mode is not supported. */ + return true; + } + *total = 17; break; + case DIV: if (mode == DImode) - c = 30; /* highly variable */ + *total = 30; /* Highly variable. */ else if (mode == DFmode) /* divide takes 28 cycles if the result is not zero, 13 otherwise */ - c = 24; + *total = 24; else - c = 11; /* 25 on VAX 2 */ + *total = 11; /* 25 on VAX 2 */ break; + case MOD: - c = 23; + *total = 23; break; + case UMOD: if (mode != SImode) - return MAX_COST; /* Mode is not supported. */ - c = 29; + { + *total = MAX_COST; /* Mode is not supported. */ + return true; + } + *total = 29; break; + case FLOAT: - c = 6 + (mode == DFmode) + (GET_MODE (XEXP (x, 0)) != SImode); - /* 4 on VAX 9000 */ + *total = (6 /* 4 on VAX 9000 */ + + (mode == DFmode) + (GET_MODE (XEXP (x, 0)) != SImode)); break; + case FIX: - c = 7; /* 17 on VAX 2 */ + *total = 7; /* 17 on VAX 2 */ break; + case ASHIFT: case LSHIFTRT: case ASHIFTRT: if (mode == DImode) - c = 12; + *total = 12; else - c = 10; /* 6 on VAX 9000 */ + *total = 10; /* 6 on VAX 9000 */ break; + case ROTATE: case ROTATERT: - c = 6; /* 5 on VAX 2, 4 on VAX 9000 */ + *total = 6; /* 5 on VAX 2, 4 on VAX 9000 */ if (GET_CODE (XEXP (x, 1)) == CONST_INT) - fmt = "e"; /* all constant rotate counts are short */ + fmt = "e"; /* all constant rotate counts are short */ break; + case PLUS: case MINUS: - c = (mode == DFmode) ? 13 : 8; /* 6/8 on VAX 9000, 16/15 on VAX 2 */ + *total = (mode == DFmode) ? 13 : 8; /* 6/8 on VAX 9000, 16/15 on VAX 2 */ /* Small integer operands can use subl2 and addl2. */ if ((GET_CODE (XEXP (x, 1)) == CONST_INT) && (unsigned HOST_WIDE_INT)(INTVAL (XEXP (x, 1)) + 63) < 127) fmt = "e"; break; + case IOR: case XOR: - c = 3; + *total = 3; break; + case AND: /* AND is special because the first operand is complemented. */ - c = 3; + *total = 3; if (GET_CODE (XEXP (x, 0)) == CONST_INT) { if ((unsigned HOST_WIDE_INT)~INTVAL (XEXP (x, 0)) > 63) - c = 4; + *total = 4; fmt = "e"; i = 1; } break; + case NEG: if (mode == DFmode) - return 9; + *total = 9; else if (mode == SFmode) - return 6; + *total = 6; else if (mode == DImode) - return 4; + *total = 4; + else + *total = 2; + break; + case NOT: - return 2; + *total = 2; + break; + case ZERO_EXTRACT: case SIGN_EXTRACT: - c = 15; + *total = 15; break; + case MEM: if (mode == DImode || mode == DFmode) - c = 5; /* 7 on VAX 2 */ + *total = 5; /* 7 on VAX 2 */ else - c = 3; /* 4 on VAX 2 */ + *total = 3; /* 4 on VAX 2 */ x = XEXP (x, 0); - if (GET_CODE (x) == REG || GET_CODE (x) == POST_INC) - return c; - return c + vax_address_cost_1 (x); - default: - c = 3; + if (GET_CODE (x) != REG && GET_CODE (x) != POST_INC) + *total += vax_address_cost_1 (x); + return true; + + case FLOAT_EXTEND: + case FLOAT_TRUNCATE: + case TRUNCATE: + *total = 3; /* FIXME: Costs need to be checked */ break; + + default: + return false; } /* Now look inside the expression. Operands which are not registers or short constants add to the cost. FMT and I may have been adjusted in the switch above for instructions - which require special handling */ + which require special handling. */ while (*fmt++ == 'e') { - register rtx op = XEXP (x, i++); + rtx op = XEXP (x, i); + + i += 1; code = GET_CODE (op); /* A NOT is likely to be found as the first operand of an AND @@ -715,12 +763,12 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code) case CONST_INT: if ((unsigned HOST_WIDE_INT)INTVAL (op) > 63 && GET_MODE (x) != QImode) - c += 1; /* 2 on VAX 2 */ + *total += 1; /* 2 on VAX 2 */ break; case CONST: case LABEL_REF: case SYMBOL_REF: - c += 1; /* 2 on VAX 2 */ + *total += 1; /* 2 on VAX 2 */ break; case CONST_DOUBLE: if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT) @@ -728,37 +776,30 @@ vax_rtx_costs_1 (register rtx x, enum rtx_code code, enum rtx_code outer_code) /* Registers are faster than floating point constants -- even those constants which can be encoded in a single byte. */ if (vax_float_literal (op)) - c++; + *total += 1; else - c += (GET_MODE (x) == DFmode) ? 3 : 2; + *total += (GET_MODE (x) == DFmode) ? 3 : 2; } else { if (CONST_DOUBLE_HIGH (op) != 0 || (unsigned)CONST_DOUBLE_LOW (op) > 63) - c += 2; + *total += 2; } break; case MEM: - c += 1; /* 2 on VAX 2 */ + *total += 1; /* 2 on VAX 2 */ if (GET_CODE (XEXP (op, 0)) != REG) - c += vax_address_cost_1 (XEXP (op, 0)); + *total += vax_address_cost_1 (XEXP (op, 0)); break; case REG: case SUBREG: break; default: - c += 1; + *total += 1; break; } } - return c; -} - -static bool -vax_rtx_costs (rtx x, int code, int outer_code, int * total) -{ - *total = vax_rtx_costs_1 (x, code, outer_code); return true; } @@ -771,16 +812,16 @@ vax_rtx_costs (rtx x, int code, int outer_code, int * total) static void vax_output_mi_thunk (FILE * file, - tree thunk ATTRIBUTE_UNUSED, + tree thunk ATTRIBUTE_UNUSED, HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED, tree function) { fprintf (file, "\t.word 0x0ffc\n\taddl2 $" HOST_WIDE_INT_PRINT_DEC, delta); asm_fprintf (file, ",4(%Rap)\n"); - fprintf (file, "\tjmp "); - assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0)); - fprintf (file, "+2\n"); + fprintf (file, "\tjmp "); + assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0)); + fprintf (file, "+2\n"); } static rtx @@ -813,7 +854,7 @@ vax_notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED) { case NEG: if (GET_MODE_CLASS (GET_MODE (exp)) == MODE_FLOAT) - break; + break; case AND: case IOR: case XOR: @@ -858,3 +899,425 @@ vax_notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED) /* Actual condition, one line up, should be that value2's address depends on value1, but that is too much of a pain. */ } + +/* Output integer move instructions. */ + +const char * +vax_output_int_move (rtx insn ATTRIBUTE_UNUSED, rtx *operands, + enum machine_mode mode) +{ + switch (mode) + { + case SImode: + if (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST) + { + if (push_operand (operands[0], SImode)) + return "pushab %a1"; + return "movab %a1,%0"; + } + if (operands[1] == const0_rtx) + return "clrl %0"; + if (GET_CODE (operands[1]) == CONST_INT + && (unsigned) INTVAL (operands[1]) >= 64) + { + int i = INTVAL (operands[1]); + if ((unsigned)(~i) < 64) + return "mcoml %N1,%0"; + if ((unsigned)i < 0x100) + return "movzbl %1,%0"; + if (i >= -0x80 && i < 0) + return "cvtbl %1,%0"; + if ((unsigned)i < 0x10000) + return "movzwl %1,%0"; + if (i >= -0x8000 && i < 0) + return "cvtwl %1,%0"; + } + if (push_operand (operands[0], SImode)) + return "pushl %1"; + return "movl %1,%0"; + + case HImode: + if (GET_CODE (operands[1]) == CONST_INT) + { + int i = INTVAL (operands[1]); + if (i == 0) + return "clrw %0"; + else if ((unsigned int)i < 64) + return "movw %1,%0"; + else if ((unsigned int)~i < 64) + return "mcomw %H1,%0"; + else if ((unsigned int)i < 256) + return "movzbw %1,%0"; + } + return "movw %1,%0"; + + case QImode: + if (GET_CODE (operands[1]) == CONST_INT) + { + int i = INTVAL (operands[1]); + if (i == 0) + return "clrb %0"; + else if ((unsigned int)~i < 64) + return "mcomb %B1,%0"; + } + return "movb %1,%0"; + + default: + gcc_unreachable (); + } +} + +/* Output integer add instructions. + + The space-time-opcode tradeoffs for addition vary by model of VAX. + + On a VAX 3 "movab (r1)[r2],r3" is faster than "addl3 r1,r2,r3", + but it not faster on other models. + + "movab #(r1),r2" is usually shorter than "addl3 #,r1,r2", and is + faster on a VAX 3, but some VAXen (e.g. VAX 9000) will stall if + a register is used in an address too soon after it is set. + Compromise by using movab only when it is shorter than the add + or the base register in the address is one of sp, ap, and fp, + which are not modified very often. */ + +const char * +vax_output_int_add (rtx insn ATTRIBUTE_UNUSED, rtx *operands, + enum machine_mode mode) +{ + switch (mode) + { + case SImode: + if (rtx_equal_p (operands[0], operands[1])) + { + if (operands[2] == const1_rtx) + return "incl %0"; + if (operands[2] == constm1_rtx) + return "decl %0"; + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) (- INTVAL (operands[2])) < 64) + return "subl2 $%n2,%0"; + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) INTVAL (operands[2]) >= 64 + && GET_CODE (operands[1]) == REG + && ((INTVAL (operands[2]) < 32767 && INTVAL (operands[2]) > -32768) + || REGNO (operands[1]) > 11)) + return "movab %c2(%1),%0"; + return "addl2 %2,%0"; + } + + if (rtx_equal_p (operands[0], operands[2])) + return "addl2 %1,%0"; + + if (GET_CODE (operands[2]) == CONST_INT + && INTVAL (operands[2]) < 32767 + && INTVAL (operands[2]) > -32768 + && GET_CODE (operands[1]) == REG + && push_operand (operands[0], SImode)) + return "pushab %c2(%1)"; + + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) (- INTVAL (operands[2])) < 64) + return "subl3 $%n2,%1,%0"; + + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) INTVAL (operands[2]) >= 64 + && GET_CODE (operands[1]) == REG + && ((INTVAL (operands[2]) < 32767 && INTVAL (operands[2]) > -32768) + || REGNO (operands[1]) > 11)) + return "movab %c2(%1),%0"; + + /* Add this if using gcc on a VAX 3xxx: + if (REG_P (operands[1]) && REG_P (operands[2])) + return "movab (%1)[%2],%0"; + */ + return "addl3 %1,%2,%0"; + + case HImode: + if (rtx_equal_p (operands[0], operands[1])) + { + if (operands[2] == const1_rtx) + return "incw %0"; + if (operands[2] == constm1_rtx) + return "decw %0"; + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) (- INTVAL (operands[2])) < 64) + return "subw2 $%n2,%0"; + return "addw2 %2,%0"; + } + if (rtx_equal_p (operands[0], operands[2])) + return "addw2 %1,%0"; + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) (- INTVAL (operands[2])) < 64) + return "subw3 $%n2,%1,%0"; + return "addw3 %1,%2,%0"; + + case QImode: + if (rtx_equal_p (operands[0], operands[1])) + { + if (operands[2] == const1_rtx) + return "incb %0"; + if (operands[2] == constm1_rtx) + return "decb %0"; + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) (- INTVAL (operands[2])) < 64) + return "subb2 $%n2,%0"; + return "addb2 %2,%0"; + } + if (rtx_equal_p (operands[0], operands[2])) + return "addb2 %1,%0"; + if (GET_CODE (operands[2]) == CONST_INT + && (unsigned) (- INTVAL (operands[2])) < 64) + return "subb3 $%n2,%1,%0"; + return "addb3 %1,%2,%0"; + + default: + gcc_unreachable (); + } +} + +/* Output a conditional branch. */ +const char * +vax_output_conditional_branch (enum rtx_code code) +{ + switch (code) + { + case EQ: return "jeql %l0"; + case NE: return "jneq %l0"; + case GT: return "jgtr %l0"; + case LT: return "jlss %l0"; + case GTU: return "jgtru %l0"; + case LTU: return "jlssu %l0"; + case GE: return "jgeq %l0"; + case LE: return "jleq %l0"; + case GEU: return "jgequ %l0"; + case LEU: return "jlequ %l0"; + default: + gcc_unreachable (); + } +} + +/* 1 if X is an rtx for a constant that is a valid address. */ + +int +legitimate_constant_address_p (rtx x) +{ + return (GET_CODE (x) == LABEL_REF || GET_CODE (x) == SYMBOL_REF + || GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST + || GET_CODE (x) == HIGH); +} + +/* Nonzero if the constant value X is a legitimate general operand. + It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ + +int +legitimate_constant_p (rtx x ATTRIBUTE_UNUSED) +{ + return 1; +} + +/* The other macros defined here are used only in legitimate_address_p (). */ + +/* Nonzero if X is a hard reg that can be used as an index + or, if not strict, if it is a pseudo reg. */ +#define INDEX_REGISTER_P(X, STRICT) \ +(GET_CODE (X) == REG && (!(STRICT) || REGNO_OK_FOR_INDEX_P (REGNO (X)))) + +/* Nonzero if X is a hard reg that can be used as a base reg + or, if not strict, if it is a pseudo reg. */ +#define BASE_REGISTER_P(X, STRICT) \ +(GET_CODE (X) == REG && (!(STRICT) || REGNO_OK_FOR_BASE_P (REGNO (X)))) + +#ifdef NO_EXTERNAL_INDIRECT_ADDRESS + +/* Re-definition of CONSTANT_ADDRESS_P, which is true only when there + are no SYMBOL_REFs for external symbols present. */ + +static int +indirectable_constant_address_p (rtx x) +{ + if (!CONSTANT_ADDRESS_P (x)) + return 0; + if (GET_CODE (x) == CONST && GET_CODE (XEXP ((x), 0)) == PLUS) + x = XEXP (XEXP (x, 0), 0); + if (GET_CODE (x) == SYMBOL_REF && !SYMBOL_REF_LOCAL_P (x)) + return 0; + + return 1; +} + +#else /* not NO_EXTERNAL_INDIRECT_ADDRESS */ + +static int +indirectable_constant_address_p (rtx x) +{ + return CONSTANT_ADDRESS_P (x); +} + +#endif /* not NO_EXTERNAL_INDIRECT_ADDRESS */ + +/* Nonzero if X is an address which can be indirected. External symbols + could be in a sharable image library, so we disallow those. */ + +static int +indirectable_address_p(rtx x, int strict) +{ + if (indirectable_constant_address_p (x)) + return 1; + if (BASE_REGISTER_P (x, strict)) + return 1; + if (GET_CODE (x) == PLUS + && BASE_REGISTER_P (XEXP (x, 0), strict) + && indirectable_constant_address_p (XEXP (x, 1))) + return 1; + return 0; +} + +/* Return 1 if x is a valid address not using indexing. + (This much is the easy part.) */ +static int +nonindexed_address_p (rtx x, int strict) +{ + rtx xfoo0; + if (GET_CODE (x) == REG) + { + extern rtx *reg_equiv_mem; + if (! reload_in_progress + || reg_equiv_mem[REGNO (x)] == 0 + || indirectable_address_p (reg_equiv_mem[REGNO (x)], strict)) + return 1; + } + if (indirectable_constant_address_p (x)) + return 1; + if (indirectable_address_p (x, strict)) + return 1; + xfoo0 = XEXP (x, 0); + if (GET_CODE (x) == MEM && indirectable_address_p (xfoo0, strict)) + return 1; + if ((GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC) + && BASE_REGISTER_P (xfoo0, strict)) + return 1; + return 0; +} + +/* 1 if PROD is either a reg times size of mode MODE and MODE is less + than or equal 8 bytes, or just a reg if MODE is one byte. */ + +static int +index_term_p (rtx prod, enum machine_mode mode, int strict) +{ + rtx xfoo0, xfoo1; + + if (GET_MODE_SIZE (mode) == 1) + return BASE_REGISTER_P (prod, strict); + + if (GET_CODE (prod) != MULT || GET_MODE_SIZE (mode) > 8) + return 0; + + xfoo0 = XEXP (prod, 0); + xfoo1 = XEXP (prod, 1); + + if (GET_CODE (xfoo0) == CONST_INT + && INTVAL (xfoo0) == (int)GET_MODE_SIZE (mode) + && INDEX_REGISTER_P (xfoo1, strict)) + return 1; + + if (GET_CODE (xfoo1) == CONST_INT + && INTVAL (xfoo1) == (int)GET_MODE_SIZE (mode) + && INDEX_REGISTER_P (xfoo0, strict)) + return 1; + + return 0; +} + +/* Return 1 if X is the sum of a register + and a valid index term for mode MODE. */ +static int +reg_plus_index_p (rtx x, enum machine_mode mode, int strict) +{ + rtx xfoo0, xfoo1; + + if (GET_CODE (x) != PLUS) + return 0; + + xfoo0 = XEXP (x, 0); + xfoo1 = XEXP (x, 1); + + if (BASE_REGISTER_P (xfoo0, strict) && index_term_p (xfoo1, mode, strict)) + return 1; + + if (BASE_REGISTER_P (xfoo1, strict) && index_term_p (xfoo0, mode, strict)) + return 1; + + return 0; +} + +/* legitimate_address_p returns 1 if it recognizes an RTL expression "x" + that is a valid memory address for an instruction. + The MODE argument is the machine mode for the MEM expression + that wants to use this address. */ +int +legitimate_address_p (enum machine_mode mode, rtx x, int strict) +{ + rtx xfoo0, xfoo1; + + if (nonindexed_address_p (x, strict)) + return 1; + + if (GET_CODE (x) != PLUS) + return 0; + + /* Handle
[index] represented with index-sum outermost */ + + xfoo0 = XEXP (x, 0); + xfoo1 = XEXP (x, 1); + + if (index_term_p (xfoo0, mode, strict) + && nonindexed_address_p (xfoo1, strict)) + return 1; + + if (index_term_p (xfoo1, mode, strict) + && nonindexed_address_p (xfoo0, strict)) + return 1; + + /* Handle offset(reg)[index] with offset added outermost */ + + if (indirectable_constant_address_p (xfoo0) + && (BASE_REGISTER_P (xfoo1, strict) + || reg_plus_index_p (xfoo1, mode, strict))) + return 1; + + if (indirectable_constant_address_p (xfoo1) + && (BASE_REGISTER_P (xfoo0, strict) + || reg_plus_index_p (xfoo0, mode, strict))) + return 1; + + return 0; +} + +/* Return 1 if x (a legitimate address expression) has an effect that + depends on the machine mode it is used for. On the VAX, the predecrement + and postincrement address depend thus (the amount of decrement or + increment being the length of the operand) and all indexed address depend + thus (because the index scale factor is the length of the operand). */ + +int +vax_mode_dependent_address_p (rtx x) +{ + rtx xfoo0, xfoo1; + + if (GET_CODE (x) == POST_INC || GET_CODE (x) == PRE_DEC) + return 1; + if (GET_CODE (x) != PLUS) + return 0; + + xfoo0 = XEXP (x, 0); + xfoo1 = XEXP (x, 1); + + if (CONSTANT_ADDRESS_P (xfoo0) && GET_CODE (xfoo1) == REG) + return 0; + if (CONSTANT_ADDRESS_P (xfoo1) && GET_CODE (xfoo0) == REG) + return 0; + + return 1; +} diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h index 5efd790dde4..86259880e80 100644 --- a/gcc/config/vax/vax.h +++ b/gcc/config/vax/vax.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. VAX version. Copyright (C) 1987, 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -60,50 +60,9 @@ Boston, MA 02111-1307, USA. */ /* Run-time compilation parameters selecting different hardware subsets. */ -extern int target_flags; - -#define MASK_UNIX_ASM 1 -#define MASK_VAXC_ALIGNMENT 2 -#define MASK_G_FLOAT 4 - - -/* Macros used in the machine description to test the flags. */ - -/* Nonzero if compiling code that Unix assembler can assemble. */ -#define TARGET_UNIX_ASM (target_flags & MASK_UNIX_ASM) - -/* Nonzero if compiling with VAX-11 "C" style structure alignment */ -#define TARGET_VAXC_ALIGNMENT (target_flags & MASK_VAXC_ALIGNMENT) - -/* Nonzero if compiling with `G'-format floating point */ -#define TARGET_G_FLOAT (target_flags & MASK_G_FLOAT) - /* Nonzero if ELF. Redefined by vax/elf.h. */ #define TARGET_ELF 0 -/* Macro to define tables used to set the flags. - This is a list in braces of pairs in braces, - each pair being { "NAME", VALUE } - where VALUE is the bits to set or minus the bits to clear. - An empty string NAME is used to identify the default VALUE. */ - -#define TARGET_SWITCHES \ - { {"unix", MASK_UNIX_ASM, \ - "Generate code for UNIX assembler"}, \ - {"gnu", -MASK_UNIX_ASM, \ - "Generate code for GNU assembler (gas)"}, \ - {"vaxc-alignment", MASK_VAXC_ALIGNMENT, \ - "Use VAXC structure conventions"}, \ - {"g", MASK_G_FLOAT, \ - "Generate GFLOAT double precision code"}, \ - {"g-float", MASK_G_FLOAT, \ - "Generate GFLOAT double precision code"}, \ - {"d", -MASK_G_FLOAT, \ - "Generate DFLOAT double precision code"}, \ - {"d-float", -MASK_G_FLOAT, \ - "Generate DFLOAT double precision code"}, \ - { "", TARGET_DEFAULT, 0}} - /* Default target_flags if no switches specified. */ #ifndef TARGET_DEFAULT @@ -191,8 +150,8 @@ extern int target_flags; This is ordinarily the length in words of a value of mode MODE but can be less for certain modes in special long registers. On the VAX, all registers are one word long. */ -#define HARD_REGNO_NREGS(REGNO, MODE) \ - ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) +#define HARD_REGNO_NREGS(REGNO, MODE) \ + ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. On the VAX, all registers can hold all modes. */ @@ -208,13 +167,13 @@ extern int target_flags; The values of these macros are register numbers. */ /* VAX pc is overloaded on a register. */ -#define PC_REGNUM 15 +#define PC_REGNUM VAX_PC_REGNUM /* Register to use for pushing function arguments. */ -#define STACK_POINTER_REGNUM 14 +#define STACK_POINTER_REGNUM VAX_SP_REGNUM /* Base register for access to local variables of the function. */ -#define FRAME_POINTER_REGNUM 13 +#define FRAME_POINTER_REGNUM VAX_FP_REGNUM /* Value should be nonzero if functions must have frame pointers. Zero means the frame pointer need not be set up (and parms @@ -223,7 +182,7 @@ extern int target_flags; #define FRAME_POINTER_REQUIRED 1 /* Base register for access to arguments of the function. */ -#define ARG_POINTER_REGNUM 12 +#define ARG_POINTER_REGNUM VAX_AP_REGNUM /* Register in which static-chain is passed to a function. */ #define STATIC_CHAIN_REGNUM 0 @@ -251,7 +210,7 @@ extern int target_flags; For any two classes, it is very desirable that there be another class that represents their union. */ - + /* The VAX has only one kind of registers, so NO_REGS and ALL_REGS are the only classes. */ @@ -266,8 +225,8 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* Give names of register classes as strings for dump file. */ -#define REG_CLASS_NAMES \ - {"NO_REGS", "ALL_REGS" } +#define REG_CLASS_NAMES \ + { "NO_REGS", "ALL_REGS" } /* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET @@ -305,7 +264,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; 'N' is a value between 0 and 65535 (inclusive) `O' is a value between -63 and -1 (inclusive) */ -#define CONST_OK_FOR_LETTER_P(VALUE, C) \ +#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ( (C) == 'I' ? (VALUE) == 0 \ : (C) == 'J' ? 0 <= (VALUE) && (VALUE) < 64 \ : (C) == 'O' ? -63 <= (VALUE) && (VALUE) < 0 \ @@ -316,11 +275,11 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; : 0) /* Similar, but for floating constants, and defining letters G and H. - Here VALUE is the CONST_DOUBLE rtx itself. + Here VALUE is the CONST_DOUBLE rtx itself. `G' is a floating-point zero. */ -#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ +#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' ? ((VALUE) == CONST0_RTX (DFmode) \ || (VALUE) == CONST0_RTX (SFmode)) \ : 0) @@ -330,7 +289,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; For the VAX, `Q' means that OP is a MEM that does not have a mode-dependent address. */ -#define EXTRA_CONSTRAINT(OP, C) \ +#define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'Q' \ ? GET_CODE (OP) == MEM && ! mode_dependent_address_p (XEXP (OP, 0)) \ : 0) @@ -389,23 +348,23 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; On the VAX, the RET insn pops a maximum of 255 args for any function. */ -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((SIZE) > 255*4 ? 0 : (SIZE)) +#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ + ((SIZE) > 255 * 4 ? 0 : (SIZE)) /* Define how to find the value returned by a function. VALTYPE is the data type of the value (as a tree). If the precise function being called is known, FUNC is its FUNCTION_DECL; otherwise, FUNC is 0. */ -/* On the VAX the return value is in R0 regardless. */ +/* On the VAX the return value is in R0 regardless. */ -#define FUNCTION_VALUE(VALTYPE, FUNC) \ +#define FUNCTION_VALUE(VALTYPE, FUNC) \ gen_rtx_REG (TYPE_MODE (VALTYPE), 0) /* Define how to find the value returned by a library function assuming the value has mode MODE. */ -/* On the VAX the return value is in R0 regardless. */ +/* On the VAX the return value is in R0 regardless. */ #define LIBCALL_VALUE(MODE) gen_rtx_REG (MODE, 0) @@ -449,9 +408,9 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; (TYPE is null for libcalls where that information may not be available.) */ #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - ((CUM) += ((MODE) != BLKmode \ - ? (GET_MODE_SIZE (MODE) + 3) & ~3 \ - : (int_size_in_bytes (TYPE) + 3) & ~3)) + ((CUM) += ((MODE) != BLKmode \ + ? (GET_MODE_SIZE (MODE) + 3) & ~3 \ + : (int_size_in_bytes (TYPE) + 3) & ~3)) /* Define where to put the arguments to a function. Value is zero to push the argument on the stack, @@ -466,7 +425,7 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; NAMED is nonzero if this argument is a named parameter (otherwise it is an extra parameter matching an ellipsis). */ -/* On the VAX all args are pushed. */ +/* On the VAX all args are pushed. */ #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0 @@ -551,9 +510,9 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; FRAMEADDR is already the frame pointer of the COUNT frame, so we can ignore COUNT. */ -#define RETURN_ADDR_RTX(COUNT, FRAME) \ - ((COUNT == 0) \ - ? gen_rtx_MEM (Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) \ +#define RETURN_ADDR_RTX(COUNT, FRAME) \ + ((COUNT == 0) \ + ? gen_rtx_MEM (Pmode, plus_constant (FRAME, RETURN_ADDRESS_OFFSET)) \ : (rtx) 0) @@ -571,10 +530,10 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; Since they use reg_renumber, they are safe only once reg_renumber has been allocated, which happens in local-alloc.c. */ -#define REGNO_OK_FOR_INDEX_P(regno) \ -((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0) -#define REGNO_OK_FOR_BASE_P(regno) \ -((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0) +#define REGNO_OK_FOR_INDEX_P(regno) \ + ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0) +#define REGNO_OK_FOR_BASE_P(regno) \ + ((regno) < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0) /* Maximum number of registers that can appear in a valid memory address. */ @@ -582,15 +541,12 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* 1 if X is an rtx for a constant that is a valid address. */ -#define CONSTANT_ADDRESS_P(X) \ - (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ - || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \ - || GET_CODE (X) == HIGH) +#define CONSTANT_ADDRESS_P(X) legitimate_constant_address_p (X) /* Nonzero if the constant value X is a legitimate general operand. It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ -#define LEGITIMATE_CONSTANT_P(X) 1 +#define LEGITIMATE_CONSTANT_P(X) legitimate_constant_p (X) /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx and check its validity for a certain class. @@ -610,169 +566,35 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* Nonzero if X is a hard reg that can be used as an index or if it is a pseudo reg. */ #define REG_OK_FOR_INDEX_P(X) 1 + /* Nonzero if X is a hard reg that can be used as a base reg or if it is a pseudo reg. */ #define REG_OK_FOR_BASE_P(X) 1 +/* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression + that is a valid memory address for an instruction. */ +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ + { if (legitimate_address_p ((MODE), (X), 0)) goto ADDR; } + #else /* Nonzero if X is a hard reg that can be used as an index. */ #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X)) + /* Nonzero if X is a hard reg that can be used as a base reg. */ #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) -#endif - /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression - that is a valid memory address for an instruction. - The MODE argument is the machine mode for the MEM expression - that wants to use this address. - - The other macros defined here are used only in GO_IF_LEGITIMATE_ADDRESS, - except for CONSTANT_ADDRESS_P which is actually machine-independent. */ - -#ifdef NO_EXTERNAL_INDIRECT_ADDRESS - -/* Zero if this contains a (CONST (PLUS (SYMBOL_REF) (...))) and the - symbol in the SYMBOL_REF is an external symbol. */ - -#define INDIRECTABLE_CONSTANT_P(X) \ - (! (GET_CODE ((X)) == CONST \ - && GET_CODE (XEXP ((X), 0)) == PLUS \ - && GET_CODE (XEXP (XEXP ((X), 0), 0)) == SYMBOL_REF \ - && SYMBOL_REF_FLAG (XEXP (XEXP ((X), 0), 0)))) - -/* Re-definition of CONSTANT_ADDRESS_P, which is true only when there - are no SYMBOL_REFs for external symbols present. */ - -#define INDIRECTABLE_CONSTANT_ADDRESS_P(X) \ - (GET_CODE (X) == LABEL_REF \ - || (GET_CODE (X) == SYMBOL_REF && !SYMBOL_REF_FLAG (X)) \ - || (GET_CODE (X) == CONST && INDIRECTABLE_CONSTANT_P(X)) \ - || GET_CODE (X) == CONST_INT) - - -/* Nonzero if X is an address which can be indirected. External symbols - could be in a sharable image library, so we disallow those. */ - -#define INDIRECTABLE_ADDRESS_P(X) \ - (INDIRECTABLE_CONSTANT_ADDRESS_P (X) \ - || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ - || (GET_CODE (X) == PLUS \ - && GET_CODE (XEXP (X, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ - && INDIRECTABLE_CONSTANT_ADDRESS_P (XEXP (X, 1)))) - -#else /* not NO_EXTERNAL_INDIRECT_ADDRESS */ - -#define INDIRECTABLE_CONSTANT_ADDRESS_P(X) CONSTANT_ADDRESS_P(X) - -/* Nonzero if X is an address which can be indirected. */ -#define INDIRECTABLE_ADDRESS_P(X) \ - (CONSTANT_ADDRESS_P (X) \ - || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X)) \ - || (GET_CODE (X) == PLUS \ - && GET_CODE (XEXP (X, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ - && CONSTANT_ADDRESS_P (XEXP (X, 1)))) - -#endif /* not NO_EXTERNAL_INDIRECT_ADDRESS */ - -/* Go to ADDR if X is a valid address not using indexing. - (This much is the easy part.) */ -#define GO_IF_NONINDEXED_ADDRESS(X, ADDR) \ -{ register rtx xfoob = (X); \ - if (GET_CODE (xfoob) == REG) \ - { \ - extern rtx *reg_equiv_mem; \ - if (! reload_in_progress \ - || reg_equiv_mem[REGNO (xfoob)] == 0 \ - || INDIRECTABLE_ADDRESS_P (reg_equiv_mem[REGNO (xfoob)])) \ - goto ADDR; \ - } \ - if (CONSTANT_ADDRESS_P (xfoob)) goto ADDR; \ - if (INDIRECTABLE_ADDRESS_P (xfoob)) goto ADDR; \ - xfoob = XEXP (X, 0); \ - if (GET_CODE (X) == MEM && INDIRECTABLE_ADDRESS_P (xfoob)) \ - goto ADDR; \ - if ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_INC) \ - && GET_CODE (xfoob) == REG && REG_OK_FOR_BASE_P (xfoob)) \ - goto ADDR; } - -/* 1 if PROD is either a reg times size of mode MODE and MODE is less - than or equal 8 bytes, or just a reg if MODE is one byte. - This macro's expansion uses the temporary variables xfoo0 and xfoo1 - that must be declared in the surrounding context. */ -#define INDEX_TERM_P(PROD, MODE) \ -(GET_MODE_SIZE (MODE) == 1 \ - ? (GET_CODE (PROD) == REG && REG_OK_FOR_BASE_P (PROD)) \ - : (GET_CODE (PROD) == MULT && GET_MODE_SIZE (MODE) <= 8 \ - && \ - (xfoo0 = XEXP (PROD, 0), xfoo1 = XEXP (PROD, 1), \ - ((((GET_CODE (xfoo0) == CONST_INT \ - && GET_CODE (xfoo1) == REG) \ - && INTVAL (xfoo0) == (int)GET_MODE_SIZE (MODE)) \ - && REG_OK_FOR_INDEX_P (xfoo1)) \ - || \ - (((GET_CODE (xfoo1) == CONST_INT \ - && GET_CODE (xfoo0) == REG) \ - && INTVAL (xfoo1) == (int)GET_MODE_SIZE (MODE)) \ - && REG_OK_FOR_INDEX_P (xfoo0)))))) - -/* Go to ADDR if X is the sum of a register - and a valid index term for mode MODE. */ -#define GO_IF_REG_PLUS_INDEX(X, MODE, ADDR) \ -{ register rtx xfooa; \ - if (GET_CODE (X) == PLUS) \ - { if (GET_CODE (XEXP (X, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ - && (xfooa = XEXP (X, 1), \ - INDEX_TERM_P (xfooa, MODE))) \ - goto ADDR; \ - if (GET_CODE (XEXP (X, 1)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 1)) \ - && (xfooa = XEXP (X, 0), \ - INDEX_TERM_P (xfooa, MODE))) \ - goto ADDR; } } - -#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ -{ register rtx xfoo, xfoo0, xfoo1; \ - GO_IF_NONINDEXED_ADDRESS (X, ADDR); \ - if (GET_CODE (X) == PLUS) \ - { /* Handle
[index] represented with index-sum outermost */\ - xfoo = XEXP (X, 0); \ - if (INDEX_TERM_P (xfoo, MODE)) \ - { GO_IF_NONINDEXED_ADDRESS (XEXP (X, 1), ADDR); } \ - xfoo = XEXP (X, 1); \ - if (INDEX_TERM_P (xfoo, MODE)) \ - { GO_IF_NONINDEXED_ADDRESS (XEXP (X, 0), ADDR); } \ - /* Handle offset(reg)[index] with offset added outermost */ \ - if (INDIRECTABLE_CONSTANT_ADDRESS_P (XEXP (X, 0))) \ - { if (GET_CODE (XEXP (X, 1)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 1))) \ - goto ADDR; \ - GO_IF_REG_PLUS_INDEX (XEXP (X, 1), MODE, ADDR); } \ - if (INDIRECTABLE_CONSTANT_ADDRESS_P (XEXP (X, 1))) \ - { if (GET_CODE (XEXP (X, 0)) == REG \ - && REG_OK_FOR_BASE_P (XEXP (X, 0))) \ - goto ADDR; \ - GO_IF_REG_PLUS_INDEX (XEXP (X, 0), MODE, ADDR); } } } - + that is a valid memory address for an instruction. */ +#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ + { if (legitimate_address_p ((MODE), (X), 1)) goto ADDR; } + +#endif + /* Go to LABEL if ADDR (a legitimate address expression) - has an effect that depends on the machine mode it is used for. - On the VAX, the predecrement and postincrement address depend thus - (the amount of decrement or increment being the length of the operand) - and all indexed address depend thus (because the index scale factor - is the length of the operand). */ -#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ - { if (GET_CODE (ADDR) == POST_INC || GET_CODE (ADDR) == PRE_DEC) \ - goto LABEL; \ - if (GET_CODE (ADDR) == PLUS) \ - { if (CONSTANT_ADDRESS_P (XEXP (ADDR, 0)) \ - && GET_CODE (XEXP (ADDR, 1)) == REG); \ - else if (CONSTANT_ADDRESS_P (XEXP (ADDR, 1)) \ - && GET_CODE (XEXP (ADDR, 0)) == REG); \ - else goto LABEL; }} + has an effect that depends on the machine mode it is used for. */ +#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL) \ + { if (vax_mode_dependent_address_p (ADDR)) goto LABEL; } /* Specify the machine mode that this machine uses for the index in the tablejump instruction. */ @@ -843,13 +665,14 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; after execution of an instruction whose pattern is EXP. Do not alter them if the instruction would not alter the cc's. */ -#define NOTICE_UPDATE_CC(EXP, INSN) \ +#define NOTICE_UPDATE_CC(EXP, INSN) \ vax_notice_update_cc ((EXP), (INSN)) -#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \ -{ if (cc_status.flags & CC_NO_OVERFLOW) \ - return NO_OV; \ - return NORMAL; } +#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \ + { if (cc_status.flags & CC_NO_OVERFLOW) \ + return NO_OV; \ + return NORMAL; \ + } /* Control the assembler format that we output. */ @@ -882,9 +705,9 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; The register names will be prefixed by REGISTER_PREFIX, if any. */ #define REGISTER_PREFIX "" -#define REGISTER_NAMES \ -{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", \ - "r9", "r10", "r11", "ap", "fp", "sp", "pc"} +#define REGISTER_NAMES \ + { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ + "r8", "r9", "r10", "r11", "ap", "fp", "sp", "pc", } /* This is BSD, so it wants DBX format. */ @@ -938,8 +761,8 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* This is how to output an insn to pop a register from the stack. It need not be very fast code. */ -#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ - fprintf (FILE, "\tmovl (%s)+,%s\n", reg_names[STACK_POINTER_REGNUM], \ +#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ + fprintf (FILE, "\tmovl (%s)+,%s\n", reg_names[STACK_POINTER_REGNUM], \ reg_names[REGNO]) /* This is how to output an element of a case-vector that is absolute. @@ -989,26 +812,26 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES }; /* This says how to output an assembler line to define a global common symbol. */ -#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ -( fputs (".comm ", (FILE)), \ - assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ",%u\n", (int)(ROUNDED))) +#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ + ( fputs (".comm ", (FILE)), \ + assemble_name ((FILE), (NAME)), \ + fprintf ((FILE), ",%u\n", (int)(ROUNDED))) /* This says how to output an assembler line to define a local common symbol. */ -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ -( fputs (".lcomm ", (FILE)), \ - assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ",%u\n", (int)(ROUNDED))) +#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ + ( fputs (".lcomm ", (FILE)), \ + assemble_name ((FILE), (NAME)), \ + fprintf ((FILE), ",%u\n", (int)(ROUNDED))) /* Store in OUTPUT a string (made with alloca) containing an assembler-name for a local static variable named NAME. LABELNO is an integer which is different for each call. */ #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ -( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ - sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) + ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ + sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) /* Print an instruction operand X on file FILE. CODE is the code from the %-spec that requested printing this operand; @@ -1043,7 +866,7 @@ VAX operand formatting codes: #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ ((CODE) == '#' || (CODE) == '|') -#define PRINT_OPERAND(FILE, X, CODE) \ +#define PRINT_OPERAND(FILE, X, CODE) \ { if (CODE == '#') fputc (ASM_DOUBLE_CHAR, FILE); \ else if (CODE == '|') \ fputs (REGISTER_PREFIX, FILE); \ @@ -1088,9 +911,10 @@ VAX operand formatting codes: This uses a function in output-vax.c. */ #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ - print_operand_address (FILE, ADDR) + print_operand_address (FILE, ADDR) /* This is a blatent lie. However, it's good enough, since we don't actually have any code whatsoever for which this isn't overridden by the proper FDE definition. */ #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PC_REGNUM) + diff --git a/gcc/config/vax/vax.md b/gcc/config/vax/vax.md index b3b8ff6f396..6d447f79a61 100644 --- a/gcc/config/vax/vax.md +++ b/gcc/config/vax/vax.md @@ -23,7 +23,7 @@ ;;- Instruction patterns. When multiple patterns apply, ;;- the first one in the file is chosen. ;;- -;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. +;;- See file "rtl.def" for documentation on define_insn, match_*, et al. ;;- ;;- cpp macro #define NOTICE_UPDATE_CC in file tm.h handles condition code ;;- updates for most instructions. @@ -31,105 +31,66 @@ ;; UNSPEC_VOLATILE usage: (define_constants - [(VUNSPEC_BLOCKAGE 0) ; `blockage' insn to prevent scheduling across an - ; insn in the code. + [(VUNSPEC_BLOCKAGE 0) ; `blockage' insn to prevent scheduling across an + ; insn in the code. (VUNSPEC_SYNC_ISTREAM 1) ; sequence of insns to sync the I-stream + (VAX_AP_REGNUM 12) ; Register 12 contains the argument pointer + (VAX_FP_REGNUM 13) ; Register 13 contains the frame pointer + (VAX_SP_REGNUM 14) ; Register 14 contains the stack pointer + (VAX_PC_REGNUM 15) ; Register 15 contains the program counter ] ) -;; We don't want to allow a constant operand for test insns because -;; (set (cc0) (const_int foo)) has no mode information. Such insns will -;; be folded while optimizing anyway. - -(define_insn "tstsi" - [(set (cc0) - (match_operand:SI 0 "nonimmediate_operand" "g"))] - "" - "tstl %0") +;; Integer modes supported on VAX, with a mapping from machine mode +;; to mnemonic suffix. DImode is always a special case. +(define_mode_macro VAXint [QI HI SI]) +(define_mode_attr isfx [(QI "b") (HI "w") (SI "l")]) -(define_insn "tsthi" - [(set (cc0) - (match_operand:HI 0 "nonimmediate_operand" "g"))] - "" - "tstw %0") +;; Similar for float modes supported on VAX. +(define_mode_macro VAXfp [SF DF]) +(define_mode_attr fsfx [(SF "f") (DF "%#")]) -(define_insn "tstqi" - [(set (cc0) - (match_operand:QI 0 "nonimmediate_operand" "g"))] - "" - "tstb %0") +;; Some output patterns want integer immediates with a prefix... +(define_mode_attr iprefx [(QI "B") (HI "H") (SI "N")]) -(define_insn "tstdf" - [(set (cc0) - (match_operand:DF 0 "general_operand" "gF"))] - "" - "tst%# %0") - -(define_insn "tstsf" - [(set (cc0) - (match_operand:SF 0 "general_operand" "gF"))] - "" - "tstf %0") - -(define_insn "cmpsi" - [(set (cc0) - (compare (match_operand:SI 0 "nonimmediate_operand" "g") - (match_operand:SI 1 "general_operand" "g")))] - "" - "cmpl %0,%1") +;; We don't want to allow a constant operand for test insns because +;; (set (cc0) (const_int foo)) has no mode information. Such insns will +;; be folded while optimizing anyway. -(define_insn "cmphi" +(define_insn "tst" [(set (cc0) - (compare (match_operand:HI 0 "nonimmediate_operand" "g") - (match_operand:HI 1 "general_operand" "g")))] + (match_operand:VAXint 0 "nonimmediate_operand" "g"))] "" - "cmpw %0,%1") + "tst %0") -(define_insn "cmpqi" +(define_insn "tst" [(set (cc0) - (compare (match_operand:QI 0 "nonimmediate_operand" "g") - (match_operand:QI 1 "general_operand" "g")))] + (match_operand:VAXfp 0 "general_operand" "gF"))] "" - "cmpb %0,%1") + "tst %0") -(define_insn "cmpdf" +(define_insn "cmp" [(set (cc0) - (compare (match_operand:DF 0 "general_operand" "gF,gF") - (match_operand:DF 1 "general_operand" "G,gF")))] + (compare (match_operand:VAXint 0 "nonimmediate_operand" "g") + (match_operand:VAXint 1 "general_operand" "g")))] "" - "@ - tst%# %0 - cmp%# %0,%1") + "cmp %0,%1") -(define_insn "cmpsf" +(define_insn "cmp" [(set (cc0) - (compare (match_operand:SF 0 "general_operand" "gF,gF") - (match_operand:SF 1 "general_operand" "G,gF")))] + (compare (match_operand:VAXfp 0 "general_operand" "gF,gF") + (match_operand:VAXfp 1 "general_operand" "G,gF")))] "" "@ - tstf %0 - cmpf %0,%1") - -(define_insn "" - [(set (cc0) - (and:SI (match_operand:SI 0 "general_operand" "g") - (match_operand:SI 1 "general_operand" "g")))] - "" - "bitl %0,%1") - -(define_insn "" - [(set (cc0) - (and:HI (match_operand:HI 0 "general_operand" "g") - (match_operand:HI 1 "general_operand" "g")))] - "" - "bitw %0,%1") + tst %0 + cmp %0,%1") -(define_insn "" +(define_insn "*bit" [(set (cc0) - (and:QI (match_operand:QI 0 "general_operand" "g") - (match_operand:QI 1 "general_operand" "g")))] + (and:VAXint (match_operand:VAXint 0 "general_operand" "g") + (match_operand:VAXint 1 "general_operand" "g")))] "" - "bitb %0,%1") + "bit %0,%1") ;; The VAX has no sCOND insns. It does have add/subtract with carry ;; which could be used to implement the sltu and sgeu patterns. However, @@ -139,21 +100,13 @@ ;; and has been deleted. -(define_insn "movdf" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g,g") - (match_operand:DF 1 "general_operand" "G,gF"))] +(define_insn "mov" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") + (match_operand:VAXfp 1 "general_operand" "G,gF"))] "" "@ - clr%# %0 - mov%# %1,%0") - -(define_insn "movsf" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g,g") - (match_operand:SF 1 "general_operand" "G,gF"))] - "" - "@ - clrf %0 - movf %1,%0") + clr %0 + mov %1,%0") ;; Some VAXen don't support this instruction. ;;(define_insn "movti" @@ -187,60 +140,11 @@ ;; Loads of constants between 64 and 128 used to be done with ;; "addl3 $63,#,dst" but this is slower than movzbl and takes as much space. -(define_insn "movsi" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g") - (match_operand:SI 1 "general_operand" "g"))] +(define_insn "mov" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") + (match_operand:VAXint 1 "general_operand" "g"))] "" - "* -{ - if (GET_CODE (operands[1]) == SYMBOL_REF || GET_CODE (operands[1]) == CONST) - { - if (push_operand (operands[0], SImode)) - return \"pushab %a1\"; - return \"movab %a1,%0\"; - } - if (operands[1] == const0_rtx) - return \"clrl %0\"; - if (GET_CODE (operands[1]) == CONST_INT - && (unsigned) INTVAL (operands[1]) >= 64) - { - int i = INTVAL (operands[1]); - if ((unsigned)(~i) < 64) - return \"mcoml %N1,%0\"; - if ((unsigned)i < 0x100) - return \"movzbl %1,%0\"; - if (i >= -0x80 && i < 0) - return \"cvtbl %1,%0\"; - if ((unsigned)i < 0x10000) - return \"movzwl %1,%0\"; - if (i >= -0x8000 && i < 0) - return \"cvtwl %1,%0\"; - } - if (push_operand (operands[0], SImode)) - return \"pushl %1\"; - return \"movl %1,%0\"; -}") - -(define_insn "movhi" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g") - (match_operand:HI 1 "general_operand" "g"))] - "" - "* -{ - if (GET_CODE (operands[1]) == CONST_INT) - { - int i = INTVAL (operands[1]); - if (i == 0) - return \"clrw %0\"; - else if ((unsigned int)i < 64) - return \"movw %1,%0\"; - else if ((unsigned int)~i < 64) - return \"mcomw %H1,%0\"; - else if ((unsigned int)i < 256) - return \"movzbw %1,%0\"; - } - return \"movw %1,%0\"; -}") + "* return vax_output_int_move (insn, operands, mode);") (define_insn "movstricthi" [(set (strict_low_part (match_operand:HI 0 "register_operand" "+g")) @@ -263,23 +167,6 @@ return \"movw %1,%0\"; }") -(define_insn "movqi" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g") - (match_operand:QI 1 "general_operand" "g"))] - "" - "* -{ - if (GET_CODE (operands[1]) == CONST_INT) - { - int i = INTVAL (operands[1]); - if (i == 0) - return \"clrb %0\"; - else if ((unsigned int)~i < 64) - return \"mcomb %B1,%0\"; - } - return \"movb %1,%0\"; -}") - (define_insn "movstrictqi" [(set (strict_low_part (match_operand:QI 0 "register_operand" "+g")) (match_operand:QI 1 "general_operand" "g"))] @@ -397,218 +284,38 @@ ;; Fix-to-float conversion insns. -(define_insn "floatsisf2" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g") - (float:SF (match_operand:SI 1 "nonimmediate_operand" "g")))] - "" - "cvtlf %1,%0") - -(define_insn "floatsidf2" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g") - (float:DF (match_operand:SI 1 "nonimmediate_operand" "g")))] - "" - "cvtl%# %1,%0") - -(define_insn "floathisf2" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g") - (float:SF (match_operand:HI 1 "nonimmediate_operand" "g")))] - "" - "cvtwf %1,%0") - -(define_insn "floathidf2" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g") - (float:DF (match_operand:HI 1 "nonimmediate_operand" "g")))] - "" - "cvtw%# %1,%0") - -(define_insn "floatqisf2" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g") - (float:SF (match_operand:QI 1 "nonimmediate_operand" "g")))] +(define_insn "float2" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g") + (float:VAXfp (match_operand:VAXint 1 "nonimmediate_operand" "g")))] "" - "cvtbf %1,%0") + "cvt %1,%0") -(define_insn "floatqidf2" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g") - (float:DF (match_operand:QI 1 "nonimmediate_operand" "g")))] - "" - "cvtb%# %1,%0") - ;; Float-to-fix conversion insns. -(define_insn "fix_truncsfqi2" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g") - (fix:QI (fix:SF (match_operand:SF 1 "general_operand" "gF"))))] - "" - "cvtfb %1,%0") - -(define_insn "fix_truncsfhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g") - (fix:HI (fix:SF (match_operand:SF 1 "general_operand" "gF"))))] - "" - "cvtfw %1,%0") - -(define_insn "fix_truncsfsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g") - (fix:SI (fix:SF (match_operand:SF 1 "general_operand" "gF"))))] - "" - "cvtfl %1,%0") - -(define_insn "fix_truncdfqi2" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g") - (fix:QI (fix:DF (match_operand:DF 1 "general_operand" "gF"))))] - "" - "cvt%#b %1,%0") - -(define_insn "fix_truncdfhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g") - (fix:HI (fix:DF (match_operand:DF 1 "general_operand" "gF"))))] - "" - "cvt%#w %1,%0") - -(define_insn "fix_truncdfsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g") - (fix:SI (fix:DF (match_operand:DF 1 "general_operand" "gF"))))] +(define_insn "fix_trunc2" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") + (fix:VAXint (fix:VAXfp (match_operand:VAXfp 1 "general_operand" "gF"))))] "" - "cvt%#l %1,%0") + "cvt %1,%0") ;;- All kinds of add instructions. -(define_insn "adddf3" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g,g,g") - (plus:DF (match_operand:DF 1 "general_operand" "0,gF,gF") - (match_operand:DF 2 "general_operand" "gF,0,gF")))] +(define_insn "add3" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g") + (plus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF") + (match_operand:VAXfp 2 "general_operand" "gF,0,gF")))] "" "@ - add%#2 %2,%0 - add%#2 %1,%0 - add%#3 %1,%2,%0") - -(define_insn "addsf3" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g,g,g") - (plus:SF (match_operand:SF 1 "general_operand" "0,gF,gF") - (match_operand:SF 2 "general_operand" "gF,0,gF")))] - "" - "@ - addf2 %2,%0 - addf2 %1,%0 - addf3 %1,%2,%0") - -/* The space-time-opcode tradeoffs for addition vary by model of VAX. - - On a VAX 3 "movab (r1)[r2],r3" is faster than "addl3 r1,r2,r3", - but it not faster on other models. - - "movab #(r1),r2" is usually shorter than "addl3 #,r1,r2", and is - faster on a VAX 3, but some VAXen (e.g. VAX 9000) will stall if - a register is used in an address too soon after it is set. - Compromise by using movab only when it is shorter than the add - or the base register in the address is one of sp, ap, and fp, - which are not modified very often. */ - - -(define_insn "addsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g") - (plus:SI (match_operand:SI 1 "general_operand" "g") - (match_operand:SI 2 "general_operand" "g")))] - "" - "* -{ - if (rtx_equal_p (operands[0], operands[1])) - { - if (operands[2] == const1_rtx) - return \"incl %0\"; - if (operands[2] == constm1_rtx) - return \"decl %0\"; - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) (- INTVAL (operands[2])) < 64) - return \"subl2 $%n2,%0\"; - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) INTVAL (operands[2]) >= 64 - && GET_CODE (operands[1]) == REG - && ((INTVAL (operands[2]) < 32767 && INTVAL (operands[2]) > -32768) - || REGNO (operands[1]) > 11)) - return \"movab %c2(%1),%0\"; - return \"addl2 %2,%0\"; - } - if (rtx_equal_p (operands[0], operands[2])) - return \"addl2 %1,%0\"; - - if (GET_CODE (operands[2]) == CONST_INT - && INTVAL (operands[2]) < 32767 - && INTVAL (operands[2]) > -32768 - && GET_CODE (operands[1]) == REG - && push_operand (operands[0], SImode)) - return \"pushab %c2(%1)\"; - - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) (- INTVAL (operands[2])) < 64) - return \"subl3 $%n2,%1,%0\"; - - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) INTVAL (operands[2]) >= 64 - && GET_CODE (operands[1]) == REG - && ((INTVAL (operands[2]) < 32767 && INTVAL (operands[2]) > -32768) - || REGNO (operands[1]) > 11)) - return \"movab %c2(%1),%0\"; - - /* Add this if using gcc on a VAX 3xxx: - if (REG_P (operands[1]) && REG_P (operands[2])) - return \"movab (%1)[%2],%0\"; - */ - return \"addl3 %1,%2,%0\"; -}") - -(define_insn "addhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g") - (plus:HI (match_operand:HI 1 "general_operand" "g") - (match_operand:HI 2 "general_operand" "g")))] - "" - "* -{ - if (rtx_equal_p (operands[0], operands[1])) - { - if (operands[2] == const1_rtx) - return \"incw %0\"; - if (operands[2] == constm1_rtx) - return \"decw %0\"; - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) (- INTVAL (operands[2])) < 64) - return \"subw2 $%n2,%0\"; - return \"addw2 %2,%0\"; - } - if (rtx_equal_p (operands[0], operands[2])) - return \"addw2 %1,%0\"; - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) (- INTVAL (operands[2])) < 64) - return \"subw3 $%n2,%1,%0\"; - return \"addw3 %1,%2,%0\"; -}") + add2 %2,%0 + add2 %1,%0 + add3 %1,%2,%0") -(define_insn "addqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g") - (plus:QI (match_operand:QI 1 "general_operand" "g") - (match_operand:QI 2 "general_operand" "g")))] +(define_insn "add3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") + (plus:VAXint (match_operand:VAXint 1 "general_operand" "g") + (match_operand:VAXint 2 "general_operand" "g")))] "" - "* -{ - if (rtx_equal_p (operands[0], operands[1])) - { - if (operands[2] == const1_rtx) - return \"incb %0\"; - if (operands[2] == constm1_rtx) - return \"decb %0\"; - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) (- INTVAL (operands[2])) < 64) - return \"subb2 $%n2,%0\"; - return \"addb2 %2,%0\"; - } - if (rtx_equal_p (operands[0], operands[2])) - return \"addb2 %1,%0\"; - if (GET_CODE (operands[2]) == CONST_INT - && (unsigned) (- INTVAL (operands[2])) < 64) - return \"subb3 $%n2,%1,%0\"; - return \"addb3 %1,%2,%0\"; -}") + "* return vax_output_int_add (insn, operands, mode);") ;; The add-with-carry (adwc) instruction only accepts two operands. (define_insn "adddi3" @@ -656,50 +363,23 @@ ;;- All kinds of subtract instructions. -(define_insn "subdf3" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g,g") - (minus:DF (match_operand:DF 1 "general_operand" "0,gF") - (match_operand:DF 2 "general_operand" "gF,gF")))] - "" - "@ - sub%#2 %2,%0 - sub%#3 %2,%1,%0") - -(define_insn "subsf3" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g,g") - (minus:SF (match_operand:SF 1 "general_operand" "0,gF") - (match_operand:SF 2 "general_operand" "gF,gF")))] - "" - "@ - subf2 %2,%0 - subf3 %2,%1,%0") - -(define_insn "subsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g") - (minus:SI (match_operand:SI 1 "general_operand" "0,g") - (match_operand:SI 2 "general_operand" "g,g")))] +(define_insn "sub3" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") + (minus:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF") + (match_operand:VAXfp 2 "general_operand" "gF,gF")))] "" "@ - subl2 %2,%0 - subl3 %2,%1,%0") + sub2 %2,%0 + sub3 %2,%1,%0") -(define_insn "subhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g") - (minus:HI (match_operand:HI 1 "general_operand" "0,g") - (match_operand:HI 2 "general_operand" "g,g")))] +(define_insn "sub3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") + (minus:VAXint (match_operand:VAXint 1 "general_operand" "0,g") + (match_operand:VAXint 2 "general_operand" "g,g")))] "" "@ - subw2 %2,%0 - subw3 %2,%1,%0") - -(define_insn "subqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g") - (minus:QI (match_operand:QI 1 "general_operand" "0,g") - (match_operand:QI 2 "general_operand" "g,g")))] - "" - "@ - subb2 %2,%0 - subb3 %2,%1,%0") + sub2 %2,%0 + sub3 %2,%1,%0") ;; The subtract-with-carry (sbwc) instruction only takes two operands. (define_insn "subdi3" @@ -747,55 +427,25 @@ ;;- Multiply instructions. -(define_insn "muldf3" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g,g,g") - (mult:DF (match_operand:DF 1 "general_operand" "0,gF,gF") - (match_operand:DF 2 "general_operand" "gF,0,gF")))] +(define_insn "mul3" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g,g") + (mult:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF,gF") + (match_operand:VAXfp 2 "general_operand" "gF,0,gF")))] "" "@ - mul%#2 %2,%0 - mul%#2 %1,%0 - mul%#3 %1,%2,%0") + mul2 %2,%0 + mul2 %1,%0 + mul3 %1,%2,%0") -(define_insn "mulsf3" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g,g,g") - (mult:SF (match_operand:SF 1 "general_operand" "0,gF,gF") - (match_operand:SF 2 "general_operand" "gF,0,gF")))] +(define_insn "mul3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") + (mult:VAXint (match_operand:VAXint 1 "general_operand" "0,g,g") + (match_operand:VAXint 2 "general_operand" "g,0,g")))] "" "@ - mulf2 %2,%0 - mulf2 %1,%0 - mulf3 %1,%2,%0") - -(define_insn "mulsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g,g") - (mult:SI (match_operand:SI 1 "general_operand" "0,g,g") - (match_operand:SI 2 "general_operand" "g,0,g")))] - "" - "@ - mull2 %2,%0 - mull2 %1,%0 - mull3 %1,%2,%0") - -(define_insn "mulhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g,") - (mult:HI (match_operand:HI 1 "general_operand" "0,g,g") - (match_operand:HI 2 "general_operand" "g,0,g")))] - "" - "@ - mulw2 %2,%0 - mulw2 %1,%0 - mulw3 %1,%2,%0") - -(define_insn "mulqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g,g") - (mult:QI (match_operand:QI 1 "general_operand" "0,g,g") - (match_operand:QI 2 "general_operand" "g,0,g")))] - "" - "@ - mulb2 %2,%0 - mulb2 %1,%0 - mulb3 %1,%2,%0") + mul2 %2,%0 + mul2 %1,%0 + mul3 %1,%2,%0") (define_insn "mulsidi3" [(set (match_operand:DI 0 "nonimmediate_operand" "=g") @@ -826,7 +476,7 @@ (sign_extend:DI (match_operand:SI 2 "nonimmediate_operand" "g"))) (match_operand:DI 3 "immediate_operand" "F")))] - "GET_CODE (operands[3]) == CONST_DOUBLE + "GET_CODE (operands[3]) == CONST_DOUBLE && CONST_DOUBLE_HIGH (operands[3]) == (CONST_DOUBLE_LOW (operands[3]) >> 31)" "* { @@ -837,50 +487,23 @@ ;;- Divide instructions. -(define_insn "divdf3" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g,g") - (div:DF (match_operand:DF 1 "general_operand" "0,gF") - (match_operand:DF 2 "general_operand" "gF,gF")))] +(define_insn "div3" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g,g") + (div:VAXfp (match_operand:VAXfp 1 "general_operand" "0,gF") + (match_operand:VAXfp 2 "general_operand" "gF,gF")))] "" "@ - div%#2 %2,%0 - div%#3 %2,%1,%0") + div2 %2,%0 + div3 %2,%1,%0") -(define_insn "divsf3" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g,g") - (div:SF (match_operand:SF 1 "general_operand" "0,gF") - (match_operand:SF 2 "general_operand" "gF,gF")))] +(define_insn "div3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") + (div:VAXint (match_operand:VAXint 1 "general_operand" "0,g") + (match_operand:VAXint 2 "general_operand" "g,g")))] "" "@ - divf2 %2,%0 - divf3 %2,%1,%0") - -(define_insn "divsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g") - (div:SI (match_operand:SI 1 "general_operand" "0,g") - (match_operand:SI 2 "general_operand" "g,g")))] - "" - "@ - divl2 %2,%0 - divl3 %2,%1,%0") - -(define_insn "divhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g") - (div:HI (match_operand:HI 1 "general_operand" "0,g") - (match_operand:HI 2 "general_operand" "g,g")))] - "" - "@ - divw2 %2,%0 - divw3 %2,%1,%0") - -(define_insn "divqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g") - (div:QI (match_operand:QI 1 "general_operand" "0,g") - (match_operand:QI 2 "general_operand" "g,g")))] - "" - "@ - divb2 %2,%0 - divb3 %2,%1,%0") + div2 %2,%0 + div3 %2,%1,%0") ;This is left out because it is very slow; ;we are better off programming around the "lack" of this insn. @@ -895,10 +518,10 @@ ; "ediv %2,%1,%0,%3") ;; Bit-and on the VAX is done with a clear-bits insn. -(define_expand "andsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "") - (and:SI (not:SI (match_operand:SI 1 "general_operand" "")) - (match_operand:SI 2 "general_operand" "")))] +(define_expand "and3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "") + (and:VAXint (not:VAXint (match_operand:VAXint 1 "general_operand" "")) + (match_operand:VAXint 2 "general_operand" "")))] "" " { @@ -915,227 +538,80 @@ if (GET_CODE (op1) == CONST_INT) operands[1] = GEN_INT (~INTVAL (op1)); else - operands[1] = expand_unop (SImode, one_cmpl_optab, op1, 0, 1); + operands[1] = expand_unop (mode, one_cmpl_optab, op1, 0, 1); }") -(define_expand "andhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "") - (and:HI (not:HI (match_operand:HI 1 "general_operand" "")) - (match_operand:HI 2 "general_operand" "")))] - "" - " -{ - rtx op1 = operands[1]; - - if (GET_CODE (operands[2]) == CONST_INT && GET_CODE (op1) != CONST_INT) - { - operands[1] = operands[2]; - operands[2] = op1; - op1 = operands[1]; - } - - if (GET_CODE (op1) == CONST_INT) - operands[1] = GEN_INT (~INTVAL (op1)); - else - operands[1] = expand_unop (HImode, one_cmpl_optab, op1, 0, 1); -}") - -(define_expand "andqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "") - (and:QI (not:QI (match_operand:QI 1 "general_operand" "")) - (match_operand:QI 2 "general_operand" "")))] - "" - " -{ - rtx op1 = operands[1]; - - if (GET_CODE (operands[2]) == CONST_INT && GET_CODE (op1) != CONST_INT) - { - operands[1] = operands[2]; - operands[2] = op1; - op1 = operands[1]; - } - - if (GET_CODE (op1) == CONST_INT) - operands[1] = GEN_INT (~INTVAL (op1)); - else - operands[1] = expand_unop (QImode, one_cmpl_optab, op1, 0, 1); -}") - -(define_insn "" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g") - (and:SI (not:SI (match_operand:SI 1 "general_operand" "g,g")) - (match_operand:SI 2 "general_operand" "0,g")))] - "" - "@ - bicl2 %1,%0 - bicl3 %1,%2,%0") - -(define_insn "" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g") - (and:HI (not:HI (match_operand:HI 1 "general_operand" "g,g")) - (match_operand:HI 2 "general_operand" "0,g")))] - "" - "@ - bicw2 %1,%0 - bicw3 %1,%2,%0") - -(define_insn "" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g") - (and:QI (not:QI (match_operand:QI 1 "general_operand" "g,g")) - (match_operand:QI 2 "general_operand" "0,g")))] +(define_insn "*and" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") + (and:VAXint (not:VAXint (match_operand:VAXint 1 "general_operand" "g,g")) + (match_operand:VAXint 2 "general_operand" "0,g")))] "" "@ - bicb2 %1,%0 - bicb3 %1,%2,%0") + bic2 %1,%0 + bic3 %1,%2,%0") ;; The following used to be needed because constant propagation can ;; create them starting from the bic insn patterns above. This is no ;; longer a problem. However, having these patterns allows optimization ;; opportunities in combine.c. -(define_insn "" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g") - (and:SI (match_operand:SI 1 "general_operand" "0,g") - (match_operand:SI 2 "const_int_operand" "n,n")))] +(define_insn "*and_const_int" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g") + (and:VAXint (match_operand:VAXint 1 "general_operand" "0,g") + (match_operand:VAXint 2 "const_int_operand" "n,n")))] "" "@ - bicl2 %N2,%0 - bicl3 %N2,%1,%0") + bic2 %2,%0 + bic3 %2,%1,%0") -(define_insn "" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g") - (and:HI (match_operand:HI 1 "general_operand" "0,g") - (match_operand:HI 2 "const_int_operand" "n,n")))] - "" - "@ - bicw2 %H2,%0 - bicw3 %H2,%1,%0") - -(define_insn "" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g") - (and:QI (match_operand:QI 1 "general_operand" "0,g") - (match_operand:QI 2 "const_int_operand" "n,n")))] - "" - "@ - bicb2 %B2,%0 - bicb3 %B2,%1,%0") ;;- Bit set instructions. -(define_insn "iorsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g,g") - (ior:SI (match_operand:SI 1 "general_operand" "0,g,g") - (match_operand:SI 2 "general_operand" "g,0,g")))] +(define_insn "ior3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") + (ior:VAXint (match_operand:VAXint 1 "general_operand" "0,g,g") + (match_operand:VAXint 2 "general_operand" "g,0,g")))] "" "@ - bisl2 %2,%0 - bisl2 %1,%0 - bisl3 %2,%1,%0") - -(define_insn "iorhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g,g") - (ior:HI (match_operand:HI 1 "general_operand" "0,g,g") - (match_operand:HI 2 "general_operand" "g,0,g")))] - "" - "@ - bisw2 %2,%0 - bisw2 %1,%0 - bisw3 %2,%1,%0") - -(define_insn "iorqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g,g") - (ior:QI (match_operand:QI 1 "general_operand" "0,g,g") - (match_operand:QI 2 "general_operand" "g,0,g")))] - "" - "@ - bisb2 %2,%0 - bisb2 %1,%0 - bisb3 %2,%1,%0") + bis2 %2,%0 + bis2 %1,%0 + bis3 %2,%1,%0") ;;- xor instructions. -(define_insn "xorsi3" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g,g,g") - (xor:SI (match_operand:SI 1 "general_operand" "0,g,g") - (match_operand:SI 2 "general_operand" "g,0,g")))] - "" - "@ - xorl2 %2,%0 - xorl2 %1,%0 - xorl3 %2,%1,%0") - -(define_insn "xorhi3" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g,g,g") - (xor:HI (match_operand:HI 1 "general_operand" "0,g,g") - (match_operand:HI 2 "general_operand" "g,0,g")))] +(define_insn "xor3" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g,g,g") + (xor:VAXint (match_operand:VAXint 1 "general_operand" "0,g,g") + (match_operand:VAXint 2 "general_operand" "g,0,g")))] "" "@ - xorw2 %2,%0 - xorw2 %1,%0 - xorw3 %2,%1,%0") + xor2 %2,%0 + xor2 %1,%0 + xor3 %2,%1,%0") -(define_insn "xorqi3" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g,g,g") - (xor:QI (match_operand:QI 1 "general_operand" "0,g,g") - (match_operand:QI 2 "general_operand" "g,0,g")))] - "" - "@ - xorb2 %2,%0 - xorb2 %1,%0 - xorb3 %2,%1,%0") -(define_insn "negdf2" - [(set (match_operand:DF 0 "nonimmediate_operand" "=g") - (neg:DF (match_operand:DF 1 "general_operand" "gF")))] - "" - "mneg%# %1,%0") - -(define_insn "negsf2" - [(set (match_operand:SF 0 "nonimmediate_operand" "=g") - (neg:SF (match_operand:SF 1 "general_operand" "gF")))] - "" - "mnegf %1,%0") - -(define_insn "negsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g") - (neg:SI (match_operand:SI 1 "general_operand" "g")))] +(define_insn "neg2" + [(set (match_operand:VAXfp 0 "nonimmediate_operand" "=g") + (neg:VAXfp (match_operand:VAXfp 1 "general_operand" "gF")))] "" - "mnegl %1,%0") + "mneg %1,%0") -(define_insn "neghi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g") - (neg:HI (match_operand:HI 1 "general_operand" "g")))] +(define_insn "neg2" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") + (neg:VAXint (match_operand:VAXint 1 "general_operand" "g")))] "" - "mnegw %1,%0") + "mneg %1,%0") -(define_insn "negqi2" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g") - (neg:QI (match_operand:QI 1 "general_operand" "g")))] - "" - "mnegb %1,%0") - -(define_insn "one_cmplsi2" - [(set (match_operand:SI 0 "nonimmediate_operand" "=g") - (not:SI (match_operand:SI 1 "general_operand" "g")))] +(define_insn "one_cmpl2" + [(set (match_operand:VAXint 0 "nonimmediate_operand" "=g") + (not:VAXint (match_operand:VAXint 1 "general_operand" "g")))] "" - "mcoml %1,%0") + "mcom %1,%0") -(define_insn "one_cmplhi2" - [(set (match_operand:HI 0 "nonimmediate_operand" "=g") - (not:HI (match_operand:HI 1 "general_operand" "g")))] - "" - "mcomw %1,%0") - -(define_insn "one_cmplqi2" - [(set (match_operand:QI 0 "nonimmediate_operand" "=g") - (not:QI (match_operand:QI 1 "general_operand" "g")))] - "" - "mcomb %1,%0") ;; Arithmetic right shift on the VAX works by negating the shift count, ;; then emitting a right shift with the shift count negated. This means -;; that all actual shift counts in the RTL will be positive. This +;; that all actual shift counts in the RTL will be positive. This ;; prevents converting shifts to ZERO_EXTRACTs with negative positions, ;; which isn't valid. (define_expand "ashrsi3" @@ -1525,101 +1001,24 @@ "" "insv %3,%2,%1,%0") +;; Unconditional jump (define_insn "jump" [(set (pc) (label_ref (match_operand 0 "" "")))] "" "jbr %l0") -(define_insn "beq" - [(set (pc) - (if_then_else (eq (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jeql %l0") - -(define_insn "bne" - [(set (pc) - (if_then_else (ne (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jneq %l0") - -(define_insn "bgt" - [(set (pc) - (if_then_else (gt (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jgtr %l0") - -(define_insn "bgtu" - [(set (pc) - (if_then_else (gtu (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jgtru %l0") - -(define_insn "blt" - [(set (pc) - (if_then_else (lt (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jlss %l0") - -(define_insn "bltu" - [(set (pc) - (if_then_else (ltu (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jlssu %l0") - -(define_insn "bge" - [(set (pc) - (if_then_else (ge (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jgeq %l0") - -(define_insn "bgeu" - [(set (pc) - (if_then_else (geu (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jgequ %l0") - -(define_insn "ble" - [(set (pc) - (if_then_else (le (cc0) - (const_int 0)) - (label_ref (match_operand 0 "" "")) - (pc)))] - "" - "jleq %l0") +;; Conditional jumps +(define_code_macro any_cond [eq ne gt lt gtu ltu ge le geu leu]) -(define_insn "bleu" +(define_insn "b" [(set (pc) - (if_then_else (leu (cc0) - (const_int 0)) + (if_then_else (any_cond (cc0) + (const_int 0)) (label_ref (match_operand 0 "" "")) (pc)))] "" - "jlequ %l0") + "* return vax_output_conditional_branch ();") ;; Recognize reversed jumps. (define_insn "" @@ -1801,13 +1200,12 @@ (define_expand "call_pop" [(parallel [(call (match_operand:QI 0 "memory_operand" "") (match_operand:SI 1 "const_int_operand" "")) - (set (reg:SI 14) - (plus:SI (reg:SI 14) + (set (reg:SI VAX_SP_REGNUM) + (plus:SI (reg:SI VAX_SP_REGNUM) (match_operand:SI 3 "immediate_operand" "")))])] "" { - if (INTVAL (operands[3]) > 255 * 4 || INTVAL (operands[3]) % 4) - abort (); + gcc_assert (INTVAL (operands[3]) <= 255 * 4 && INTVAL (operands[3]) % 4 == 0); /* Operand 1 is the number of bytes to be popped by DW_CFA_GNU_args_size during EH unwinding. We must include the argument count pushed by @@ -1818,8 +1216,8 @@ (define_insn "*call_pop" [(call (match_operand:QI 0 "memory_operand" "m") (match_operand:SI 1 "const_int_operand" "n")) - (set (reg:SI 14) (plus:SI (reg:SI 14) - (match_operand:SI 2 "immediate_operand" "i")))] + (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM) + (match_operand:SI 2 "immediate_operand" "i")))] "" { operands[1] = GEN_INT ((INTVAL (operands[1]) - 4) / 4); @@ -1830,13 +1228,12 @@ [(parallel [(set (match_operand 0 "" "") (call (match_operand:QI 1 "memory_operand" "") (match_operand:SI 2 "const_int_operand" ""))) - (set (reg:SI 14) - (plus:SI (reg:SI 14) + (set (reg:SI VAX_SP_REGNUM) + (plus:SI (reg:SI VAX_SP_REGNUM) (match_operand:SI 4 "immediate_operand" "")))])] "" { - if (INTVAL (operands[4]) > 255 * 4 || INTVAL (operands[4]) % 4) - abort (); + gcc_assert (INTVAL (operands[4]) <= 255 * 4 && INTVAL (operands[4]) % 4 == 0); /* Operand 2 is the number of bytes to be popped by DW_CFA_GNU_args_size during EH unwinding. We must include the argument count pushed by @@ -1848,8 +1245,8 @@ [(set (match_operand 0 "" "") (call (match_operand:QI 1 "memory_operand" "m") (match_operand:SI 2 "const_int_operand" "n"))) - (set (reg:SI 14) (plus:SI (reg:SI 14) - (match_operand:SI 3 "immediate_operand" "i")))] + (set (reg:SI VAX_SP_REGNUM) (plus:SI (reg:SI VAX_SP_REGNUM) + (match_operand:SI 3 "immediate_operand" "i")))] "" "* { @@ -2020,7 +1417,7 @@ "" "casel %0,$0,%1") -;;- load or push effective address +;;- load or push effective address ;; These come after the move and add/sub patterns ;; because we don't want pushl $1 turned into pushad 1. ;; or addl3 r1,r2,r3 turned into movab 0(r1)[r2],r3. @@ -2103,7 +1500,7 @@ ;; These used to be peepholes, but it is more straightforward to do them ;; as single insns. However, we must force the output to be a register ;; if it is not an offsettable address so that we know that we can assign -;; to it twice. +;; to it twice. ;; If we had a good way of evaluating the relative costs, these could be ;; machine-independent. diff --git a/gcc/config/vax/vax.opt b/gcc/config/vax/vax.opt new file mode 100644 index 00000000000..b51d2816f66 --- /dev/null +++ b/gcc/config/vax/vax.opt @@ -0,0 +1,48 @@ +; Options for the VAX port of the compiler. + +; Copyright (C) 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. + +md +Target RejectNegative InverseMask(G_FLOAT) +Target DFLOAT double precision code + +md-float +Target RejectNegative InverseMask(G_FLOAT) +Target DFLOAT double precision code + +mg +Target RejectNegative Mask(G_FLOAT) +Generate GFLOAT double precision code + +mg-float +Target RejectNegative Mask(G_FLOAT) MaskExists +Generate GFLOAT double precision code + +mgnu +Target RejectNegative InverseMask(UNIX_ASM) +Generate code for GNU assembler (gas) + +munix +Target RejectNegative Mask(UNIX_ASM) +Generate code for UNIX assembler + +mvaxc-alignment +Target RejectNegative Mask(VAXC_ALIGNMENT) +Use VAXC structure conventions diff --git a/gcc/config/x-darwin b/gcc/config/x-darwin new file mode 100644 index 00000000000..c2ffd7d5c89 --- /dev/null +++ b/gcc/config/x-darwin @@ -0,0 +1,3 @@ +host-darwin.o : $(srcdir)/config/host-darwin.c $(CONFIG_H) $(SYSTEM_H) \ + coretypes.h toplev.h config/host-darwin.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< diff --git a/gcc/config/xtensa/lib1funcs.asm b/gcc/config/xtensa/lib1funcs.asm index 2df00218a5a..bc3c45218f0 100644 --- a/gcc/config/xtensa/lib1funcs.asm +++ b/gcc/config/xtensa/lib1funcs.asm @@ -1,5 +1,5 @@ /* Assembly functions for the Xtensa version of libgcc1. - Copyright (C) 2001,2002,2003 Free Software Foundation, Inc. + Copyright (C) 2001,2002,2003, 2005 Free Software Foundation, Inc. Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. This file is part of GCC. @@ -123,9 +123,9 @@ __mulsi3: #elif XCHAL_HAVE_MAC16 mul.aa.hl a2, a3 mula.aa.lh a2, a3 - rsr a5, 16 # ACCLO + rsr a5, ACCLO umul.aa.ll a2, a3 - rsr a4, 16 # ACCLO + rsr a4, ACCLO slli a5, a5, 16 add a2, a4, a5 @@ -299,19 +299,21 @@ __udivsi3: .Lreturn: abi_return +.Lle_one: + beqz a3, .Lerror # if divisor == 1, return the dividend + abi_return + .Lspecial: # return dividend >= divisor - movi a2, 0 - bltu a6, a3, .Lreturn2 + bltu a6, a3, .Lreturn0 movi a2, 1 -.Lreturn2: abi_return -.Lle_one: - beqz a3, .Lerror # if divisor == 1, return the dividend - abi_return .Lerror: - movi a2, 0 # just return 0; could throw an exception + # just return 0; could throw an exception + +.Lreturn0: + movi a2, 0 abi_return .size __udivsi3,.-__udivsi3 @@ -361,22 +363,24 @@ __divsi3: movltz a2, a5, a7 # return (sign < 0) ? -quotient : quotient abi_return +.Lle_one: + beqz a3, .Lerror + neg a2, a6 # if udivisor == 1, then return... + movgez a2, a6, a7 # (sign < 0) ? -udividend : udividend + abi_return + .Lspecial: - movi a2, 0 - bltu a6, a3, .Lreturn2 # if dividend < divisor, return 0 + bltu a6, a3, .Lreturn0 # if dividend < divisor, return 0 movi a2, 1 movi a4, -1 movltz a2, a4, a7 # else return (sign < 0) ? -1 : 1 -.Lreturn2: abi_return -.Lle_one: - beqz a3, .Lerror - neg a2, a6 # if udivisor == 1, then return... - movgez a2, a6, a7 # (sign < 0) ? -udividend : udividend - abi_return .Lerror: - movi a2, 0 # just return 0; could throw an exception + # just return 0; could throw an exception + +.Lreturn0: + movi a2, 0 abi_return .size __divsi3,.-__divsi3 @@ -414,17 +418,12 @@ __umodsi3: #endif /* !XCHAL_HAVE_LOOPS */ .Lloopend: +.Lspecial: bltu a2, a3, .Lreturn sub a2, a2, a3 # subtract once more if dividend >= divisor .Lreturn: abi_return -.Lspecial: - bltu a2, a3, .Lreturn2 - sub a2, a2, a3 # subtract once if dividend >= divisor -.Lreturn2: - abi_return - .Lle_one: # the divisor is either 0 or 1, so just return 0. # someday we may want to throw an exception if the divisor is 0. @@ -468,6 +467,7 @@ __modsi3: #endif /* !XCHAL_HAVE_LOOPS */ .Lloopend: +.Lspecial: bltu a2, a3, .Lreturn sub a2, a2, a3 # subtract once more if udividend >= udivisor .Lreturn: @@ -476,15 +476,6 @@ __modsi3: .Lpositive: abi_return -.Lspecial: - bltu a2, a3, .Lreturn2 - sub a2, a2, a3 # subtract once if dividend >= divisor -.Lreturn2: - bgez a7, .Lpositive2 - neg a2, a2 # if (dividend < 0), return -udividend -.Lpositive2: - abi_return - .Lle_one: # udivisor is either 0 or 1, so just return 0. # someday we may want to throw an exception if udivisor is 0. diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md new file mode 100644 index 00000000000..335584d00e1 --- /dev/null +++ b/gcc/config/xtensa/predicates.md @@ -0,0 +1,157 @@ +;; Predicate definitions for Xtensa. +;; Copyright (C) 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. + +(define_predicate "add_operand" + (ior (and (match_code "const_int") + (match_test "xtensa_simm8 (INTVAL (op)) + || xtensa_simm8x256 (INTVAL (op))")) + (match_operand 0 "register_operand"))) + +(define_predicate "arith_operand" + (ior (and (match_code "const_int") + (match_test "xtensa_simm8 (INTVAL (op))")) + (match_operand 0 "register_operand"))) + +;; Non-immediate operand excluding the constant pool. +(define_predicate "nonimmed_operand" + (ior (and (match_operand 0 "memory_operand") + (match_test "!constantpool_address_p (XEXP (op, 0))")) + (match_operand 0 "register_operand"))) + +;; Memory operand excluding the constant pool. +(define_predicate "mem_operand" + (and (match_operand 0 "memory_operand") + (match_test "!constantpool_address_p (XEXP (op, 0))"))) + +(define_predicate "mask_operand" + (ior (and (match_code "const_int") + (match_test "xtensa_mask_immediate (INTVAL (op))")) + (match_operand 0 "register_operand"))) + +(define_predicate "extui_fldsz_operand" + (and (match_code "const_int") + (match_test "xtensa_mask_immediate ((1 << INTVAL (op)) - 1)"))) + +(define_predicate "sext_operand" + (if_then_else (match_test "TARGET_SEXT") + (match_operand 0 "nonimmed_operand") + (match_operand 0 "mem_operand"))) + +(define_predicate "sext_fldsz_operand" + (and (match_code "const_int") + (match_test "INTVAL (op) >= 8 && INTVAL (op) <= 23"))) + +(define_predicate "lsbitnum_operand" + (and (match_code "const_int") + (match_test "BITS_BIG_ENDIAN + ? (INTVAL (op) == BITS_PER_WORD - 1) + : (INTVAL (op) == 0)"))) + +(define_predicate "branch_operand" + (ior (and (match_code "const_int") + (match_test "xtensa_b4const_or_zero (INTVAL (op))")) + (match_operand 0 "register_operand"))) + +(define_predicate "ubranch_operand" + (ior (and (match_code "const_int") + (match_test "xtensa_b4constu (INTVAL (op))")) + (match_operand 0 "register_operand"))) + +(define_predicate "call_insn_operand" + (match_code "const_int,const,symbol_ref,reg") +{ + if ((GET_CODE (op) == REG) + && (op != arg_pointer_rtx) + && ((REGNO (op) < FRAME_POINTER_REGNUM) + || (REGNO (op) > LAST_VIRTUAL_REGISTER))) + return true; + + if (CONSTANT_ADDRESS_P (op)) + { + /* Direct calls only allowed to static functions with PIC. */ + if (flag_pic) + { + tree callee, callee_sec, caller_sec; + + if (GET_CODE (op) != SYMBOL_REF + || !SYMBOL_REF_LOCAL_P (op) || SYMBOL_REF_EXTERNAL_P (op)) + return false; + + /* Don't attempt a direct call if the callee is known to be in + a different section, since there's a good chance it will be + out of range. */ + + if (flag_function_sections + || DECL_ONE_ONLY (current_function_decl)) + return false; + caller_sec = DECL_SECTION_NAME (current_function_decl); + callee = SYMBOL_REF_DECL (op); + if (callee) + { + if (DECL_ONE_ONLY (callee)) + return false; + callee_sec = DECL_SECTION_NAME (callee); + if (((caller_sec == NULL_TREE) ^ (callee_sec == NULL_TREE)) + || (caller_sec != NULL_TREE + && strcmp (TREE_STRING_POINTER (caller_sec), + TREE_STRING_POINTER (callee_sec)) != 0)) + return false; + } + else if (caller_sec != NULL_TREE) + return false; + } + return true; + } + + return false; +}) + +(define_predicate "move_operand" + (ior + (ior (match_operand 0 "register_operand") + (match_operand 0 "memory_operand")) + (ior (and (match_code "const_int") + (match_test "GET_MODE_CLASS (mode) == MODE_INT + && xtensa_simm12b (INTVAL (op))")) + (and (match_code "const_int,const_double,const,symbol_ref,label_ref") + (match_test "TARGET_CONST16 && CONSTANT_P (op) + && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0"))))) + +;; Accept the floating point constant 1 in the appropriate mode. +(define_predicate "const_float_1_operand" + (match_code "const_double") +{ + REAL_VALUE_TYPE d; + REAL_VALUE_FROM_CONST_DOUBLE (d, op); + return REAL_VALUES_EQUAL (d, dconst1); +}) + +(define_predicate "fpmem_offset_operand" + (and (match_code "const_int") + (match_test "xtensa_mem_offset (INTVAL (op), SFmode)"))) + +(define_predicate "branch_operator" + (match_code "eq,ne,lt,ge")) + +(define_predicate "ubranch_operator" + (match_code "ltu,geu")) + +(define_predicate "boolean_operator" + (match_code "eq,ne")) diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h index f50286d058f..5f19ebfe028 100644 --- a/gcc/config/xtensa/xtensa-protos.h +++ b/gcc/config/xtensa/xtensa-protos.h @@ -1,5 +1,5 @@ /* Prototypes of target machine for GNU compiler for Xtensa. - Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. This file is part of GCC. @@ -23,45 +23,24 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define __XTENSA_PROTOS_H__ /* Functions to test whether an immediate fits in a given field. */ -extern int xtensa_simm7 (int); -extern int xtensa_simm8 (int); -extern int xtensa_simm8x256 (int); -extern int xtensa_simm12b (int); -extern int xtensa_uimm8 (int); -extern int xtensa_uimm8x2 (int); -extern int xtensa_uimm8x4 (int); -extern int xtensa_ai4const (int); -extern int xtensa_lsi4x4 (int); -extern int xtensa_b4const (int); -extern int xtensa_b4constu (int); -extern int xtensa_tp7 (int); +extern bool xtensa_simm8 (HOST_WIDE_INT); +extern bool xtensa_simm8x256 (HOST_WIDE_INT); +extern bool xtensa_simm12b (HOST_WIDE_INT); +extern bool xtensa_b4const_or_zero (HOST_WIDE_INT); +extern bool xtensa_b4constu (HOST_WIDE_INT); +extern bool xtensa_mask_immediate (HOST_WIDE_INT); +extern bool xtensa_const_ok_for_letter_p (HOST_WIDE_INT, int); +extern bool xtensa_mem_offset (unsigned, enum machine_mode); /* Functions within xtensa.c that we reference. */ #ifdef RTX_CODE extern int xt_true_regnum (rtx); -extern int add_operand (rtx, enum machine_mode); -extern int arith_operand (rtx, enum machine_mode); -extern int nonimmed_operand (rtx, enum machine_mode); -extern int mem_operand (rtx, enum machine_mode); extern int xtensa_valid_move (enum machine_mode, rtx *); -extern int mask_operand (rtx, enum machine_mode); -extern int extui_fldsz_operand (rtx, enum machine_mode); -extern int sext_operand (rtx, enum machine_mode); -extern int sext_fldsz_operand (rtx, enum machine_mode); -extern int lsbitnum_operand (rtx, enum machine_mode); -extern int branch_operand (rtx, enum machine_mode); -extern int ubranch_operand (rtx, enum machine_mode); -extern int call_insn_operand (rtx, enum machine_mode); -extern int move_operand (rtx, enum machine_mode); extern int smalloffset_mem_p (rtx); extern int constantpool_address_p (rtx); extern int constantpool_mem_p (rtx); -extern int const_float_1_operand (rtx, enum machine_mode); -extern int fpmem_offset_operand (rtx, enum machine_mode); extern void xtensa_extend_reg (rtx, rtx); -extern int branch_operator (rtx, enum machine_mode); -extern int ubranch_operator (rtx, enum machine_mode); -extern int boolean_operator (rtx, enum machine_mode); +extern bool xtensa_extra_constraint (rtx, int); extern void xtensa_expand_conditional_branch (rtx *, enum rtx_code); extern int xtensa_expand_conditional_move (rtx *, int); extern int xtensa_expand_scc (rtx *); @@ -94,8 +73,6 @@ extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int); #endif /* TREE_CODE */ -extern int xtensa_mask_immediate (int); -extern int xtensa_mem_offset (unsigned, enum machine_mode); extern void xtensa_setup_frame_addresses (void); extern int xtensa_dbx_register_number (int); extern void override_options (void); diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 0c29324eeec..a45c886e3c1 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Tensilica's Xtensa architecture. - Copyright 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. This file is part of GCC. @@ -192,7 +192,6 @@ enum reg_class xtensa_char_to_class[256] = NO_REGS, NO_REGS, NO_REGS, NO_REGS, }; -static int b4const_or_zero (int); static enum internal_test map_test_to_internal_test (enum rtx_code); static rtx gen_int_relational (enum rtx_code, rtx, rtx, int *); static rtx gen_float_relational (enum rtx_code, rtx, rtx); @@ -233,6 +232,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] = #undef TARGET_ASM_SELECT_RTX_SECTION #define TARGET_ASM_SELECT_RTX_SECTION xtensa_select_rtx_section +#undef TARGET_DEFAULT_TARGET_FLAGS +#define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | MASK_FUSED_MADD) + #undef TARGET_RTX_COSTS #define TARGET_RTX_COSTS xtensa_rtx_costs #undef TARGET_ADDRESS_COST @@ -270,13 +272,55 @@ struct gcc_target targetm = TARGET_INITIALIZER; * Functions to test Xtensa immediate operand validity. */ -int -xtensa_b4constu (int v) +bool +xtensa_simm8 (HOST_WIDE_INT v) +{ + return v >= -128 && v <= 127; +} + + +bool +xtensa_simm8x256 (HOST_WIDE_INT v) +{ + return (v & 255) == 0 && (v >= -32768 && v <= 32512); +} + + +bool +xtensa_simm12b (HOST_WIDE_INT v) +{ + return v >= -2048 && v <= 2047; +} + + +static bool +xtensa_uimm8 (HOST_WIDE_INT v) +{ + return v >= 0 && v <= 255; +} + + +static bool +xtensa_uimm8x2 (HOST_WIDE_INT v) +{ + return (v & 1) == 0 && (v >= 0 && v <= 510); +} + + +static bool +xtensa_uimm8x4 (HOST_WIDE_INT v) +{ + return (v & 3) == 0 && (v >= 0 && v <= 1020); +} + + +static bool +xtensa_b4const (HOST_WIDE_INT v) { switch (v) { - case 32768: - case 65536: + case -1: + case 1: case 2: case 3: case 4: @@ -291,36 +335,28 @@ xtensa_b4constu (int v) case 64: case 128: case 256: - return 1; + return true; } - return 0; + return false; } -int -xtensa_simm8x256 (int v) -{ - return (v & 255) == 0 && (v >= -32768 && v <= 32512); -} -int -xtensa_ai4const (int v) +bool +xtensa_b4const_or_zero (HOST_WIDE_INT v) { - return (v == -1 || (v >= 1 && v <= 15)); + if (v == 0) + return true; + return xtensa_b4const (v); } -int -xtensa_simm7 (int v) -{ - return v >= -32 && v <= 95; -} -int -xtensa_b4const (int v) +bool +xtensa_b4constu (HOST_WIDE_INT v) { switch (v) { - case -1: - case 1: + case 32768: + case 65536: case 2: case 3: case 4: @@ -335,51 +371,47 @@ xtensa_b4const (int v) case 64: case 128: case 256: - return 1; + return true; } - return 0; + return false; } -int -xtensa_simm8 (int v) -{ - return v >= -128 && v <= 127; -} -int -xtensa_tp7 (int v) +bool +xtensa_mask_immediate (HOST_WIDE_INT v) { - return (v >= 7 && v <= 22); -} - -int -xtensa_lsi4x4 (int v) -{ - return (v & 3) == 0 && (v >= 0 && v <= 60); -} +#define MAX_MASK_SIZE 16 + int mask_size; -int -xtensa_simm12b (int v) -{ - return v >= -2048 && v <= 2047; -} + for (mask_size = 1; mask_size <= MAX_MASK_SIZE; mask_size++) + { + if ((v & 1) == 0) + return false; + v = v >> 1; + if (v == 0) + return true; + } -int -xtensa_uimm8 (int v) -{ - return v >= 0 && v <= 255; + return false; } -int -xtensa_uimm8x2 (int v) -{ - return (v & 1) == 0 && (v >= 0 && v <= 510); -} -int -xtensa_uimm8x4 (int v) +bool +xtensa_const_ok_for_letter_p (HOST_WIDE_INT v, int c) { - return (v & 3) == 0 && (v >= 0 && v <= 1020); + switch (c) + { + case 'I': return xtensa_simm12b (v); + case 'J': return xtensa_simm8 (v); + case 'K': return (v == 0 || xtensa_b4const (v)); + case 'L': return xtensa_b4constu (v); + case 'M': return (v >= -32 && v <= 95); + case 'N': return xtensa_simm8x256 (v); + case 'O': return (v == -1 || (v >= 1 && v <= 15)); + case 'P': return xtensa_mask_immediate (v); + default: break; + } + return false; } @@ -410,52 +442,6 @@ xt_true_regnum (rtx x) int -add_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return (xtensa_simm8 (INTVAL (op)) || xtensa_simm8x256 (INTVAL (op))); - - return register_operand (op, mode); -} - - -int -arith_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return xtensa_simm8 (INTVAL (op)); - - return register_operand (op, mode); -} - - -int -nonimmed_operand (rtx op, enum machine_mode mode) -{ - /* We cannot use the standard nonimmediate_operand() predicate because - it includes constant pool memory operands. */ - - if (memory_operand (op, mode)) - return !constantpool_address_p (XEXP (op, 0)); - - return register_operand (op, mode); -} - - -int -mem_operand (rtx op, enum machine_mode mode) -{ - /* We cannot use the standard memory_operand() predicate because - it includes constant pool memory operands. */ - - if (memory_operand (op, mode)) - return !constantpool_address_p (XEXP (op, 0)); - - return FALSE; -} - - -int xtensa_valid_move (enum machine_mode mode, rtx *operands) { /* Either the destination or source must be a register, and the @@ -485,165 +471,6 @@ xtensa_valid_move (enum machine_mode mode, rtx *operands) int -mask_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return xtensa_mask_immediate (INTVAL (op)); - - return register_operand (op, mode); -} - - -int -extui_fldsz_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT) - && xtensa_mask_immediate ((1 << INTVAL (op)) - 1)); -} - - -int -sext_operand (rtx op, enum machine_mode mode) -{ - if (TARGET_SEXT) - return nonimmed_operand (op, mode); - return mem_operand (op, mode); -} - - -int -sext_fldsz_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - return ((GET_CODE (op) == CONST_INT) && xtensa_tp7 (INTVAL (op) - 1)); -} - - -int -lsbitnum_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST_INT) - { - return (BITS_BIG_ENDIAN - ? (INTVAL (op) == BITS_PER_WORD-1) - : (INTVAL (op) == 0)); - } - return FALSE; -} - - -static int -b4const_or_zero (int v) -{ - if (v == 0) - return TRUE; - return xtensa_b4const (v); -} - - -int -branch_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return b4const_or_zero (INTVAL (op)); - - return register_operand (op, mode); -} - - -int -ubranch_operand (rtx op, enum machine_mode mode) -{ - if (GET_CODE (op) == CONST_INT) - return xtensa_b4constu (INTVAL (op)); - - return register_operand (op, mode); -} - - -int -call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if ((GET_CODE (op) == REG) - && (op != arg_pointer_rtx) - && ((REGNO (op) < FRAME_POINTER_REGNUM) - || (REGNO (op) > LAST_VIRTUAL_REGISTER))) - return TRUE; - - if (CONSTANT_ADDRESS_P (op)) - { - /* Direct calls only allowed to static functions with PIC. */ - if (flag_pic) - { - tree callee, callee_sec, caller_sec; - - if (GET_CODE (op) != SYMBOL_REF - || !SYMBOL_REF_LOCAL_P (op) || SYMBOL_REF_EXTERNAL_P (op)) - return FALSE; - - /* Don't attempt a direct call if the callee is known to be in - a different section, since there's a good chance it will be - out of range. */ - - if (flag_function_sections - || DECL_ONE_ONLY (current_function_decl)) - return FALSE; - caller_sec = DECL_SECTION_NAME (current_function_decl); - callee = SYMBOL_REF_DECL (op); - if (callee) - { - if (DECL_ONE_ONLY (callee)) - return FALSE; - callee_sec = DECL_SECTION_NAME (callee); - if (((caller_sec == NULL_TREE) ^ (callee_sec == NULL_TREE)) - || (caller_sec != NULL_TREE - && strcmp (TREE_STRING_POINTER (caller_sec), - TREE_STRING_POINTER (callee_sec)) != 0)) - return FALSE; - } - else if (caller_sec != NULL_TREE) - return FALSE; - } - return TRUE; - } - - return FALSE; -} - - -int -move_operand (rtx op, enum machine_mode mode) -{ - if (register_operand (op, mode) - || memory_operand (op, mode)) - return TRUE; - - switch (mode) - { - case DFmode: - case SFmode: - return TARGET_CONST16 && CONSTANT_P (op); - - case DImode: - case SImode: - if (TARGET_CONST16) - return CONSTANT_P (op); - /* Fall through. */ - - case HImode: - case QImode: - if (GET_CODE (op) == CONST_INT && xtensa_simm12b (INTVAL (op))) - return TRUE; - break; - - default: - break; - } - - return FALSE; -} - - -int smalloffset_mem_p (rtx op) { if (GET_CODE (op) == MEM) @@ -654,11 +481,14 @@ smalloffset_mem_p (rtx op) if (GET_CODE (addr) == PLUS) { rtx offset = XEXP (addr, 0); + HOST_WIDE_INT val; if (GET_CODE (offset) != CONST_INT) offset = XEXP (addr, 1); if (GET_CODE (offset) != CONST_INT) return FALSE; - return xtensa_lsi4x4 (INTVAL (offset)); + + val = INTVAL (offset); + return (val & 3) == 0 && (val >= 0 && val <= 60); } } return FALSE; @@ -704,46 +534,6 @@ constantpool_mem_p (rtx op) } -/* Accept the floating point constant 1 in the appropriate mode. */ - -int -const_float_1_operand (rtx op, enum machine_mode mode) -{ - REAL_VALUE_TYPE d; - static REAL_VALUE_TYPE onedf; - static REAL_VALUE_TYPE onesf; - static int one_initialized; - - if ((GET_CODE (op) != CONST_DOUBLE) - || (mode != GET_MODE (op)) - || (mode != DFmode && mode != SFmode)) - return FALSE; - - REAL_VALUE_FROM_CONST_DOUBLE (d, op); - - if (! one_initialized) - { - onedf = REAL_VALUE_ATOF ("1.0", DFmode); - onesf = REAL_VALUE_ATOF ("1.0", SFmode); - one_initialized = TRUE; - } - - if (mode == DFmode) - return REAL_VALUES_EQUAL (d, onedf); - else - return REAL_VALUES_EQUAL (d, onesf); -} - - -int -fpmem_offset_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) -{ - if (GET_CODE (op) == CONST_INT) - return xtensa_mem_offset (INTVAL (op), SFmode); - return 0; -} - - void xtensa_extend_reg (rtx dst, rtx src) { @@ -759,82 +549,7 @@ xtensa_extend_reg (rtx dst, rtx src) } -int -branch_operator (rtx x, enum machine_mode mode) -{ - if (GET_MODE (x) != mode) - return FALSE; - - switch (GET_CODE (x)) - { - case EQ: - case NE: - case LT: - case GE: - return TRUE; - default: - break; - } - return FALSE; -} - - -int -ubranch_operator (rtx x, enum machine_mode mode) -{ - if (GET_MODE (x) != mode) - return FALSE; - - switch (GET_CODE (x)) - { - case LTU: - case GEU: - return TRUE; - default: - break; - } - return FALSE; -} - - -int -boolean_operator (rtx x, enum machine_mode mode) -{ - if (GET_MODE (x) != mode) - return FALSE; - - switch (GET_CODE (x)) - { - case EQ: - case NE: - return TRUE; - default: - break; - } - return FALSE; -} - - -int -xtensa_mask_immediate (int v) -{ -#define MAX_MASK_SIZE 16 - int mask_size; - - for (mask_size = 1; mask_size <= MAX_MASK_SIZE; mask_size++) - { - if ((v & 1) == 0) - return FALSE; - v = v >> 1; - if (v == 0) - return TRUE; - } - - return FALSE; -} - - -int +bool xtensa_mem_offset (unsigned v, enum machine_mode mode) { switch (mode) @@ -865,6 +580,26 @@ xtensa_mem_offset (unsigned v, enum machine_mode mode) } +bool +xtensa_extra_constraint (rtx op, int c) +{ + /* Allow pseudo registers during reload. */ + if (GET_CODE (op) != MEM) + return (c >= 'R' && c <= 'U' + && reload_in_progress && GET_CODE (op) == REG + && REGNO (op) >= FIRST_PSEUDO_REGISTER); + + switch (c) + { + case 'R': return smalloffset_mem_p (op); + case 'T': return !TARGET_CONST16 && constantpool_mem_p (op); + case 'U': return !constantpool_mem_p (op); + default: break; + } + return false; +} + + /* Make normal rtx_code into something we can index from an array. */ static enum internal_test @@ -903,7 +638,7 @@ gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */ struct cmp_info { enum rtx_code test_code; /* test code to use in insn */ - int (*const_range_p) (int); /* predicate function to check range */ + bool (*const_range_p) (HOST_WIDE_INT); /* range check function */ int const_add; /* constant to add (convert LE -> LT) */ int reverse_regs; /* reverse registers in test */ int invert_const; /* != 0 if invert value if cmp1 is constant */ @@ -913,13 +648,13 @@ gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */ static struct cmp_info info[ (int)ITEST_MAX ] = { - { EQ, b4const_or_zero, 0, 0, 0, 0, 0 }, /* EQ */ - { NE, b4const_or_zero, 0, 0, 0, 0, 0 }, /* NE */ + { EQ, xtensa_b4const_or_zero, 0, 0, 0, 0, 0 }, /* EQ */ + { NE, xtensa_b4const_or_zero, 0, 0, 0, 0, 0 }, /* NE */ - { LT, b4const_or_zero, 1, 1, 1, 0, 0 }, /* GT */ - { GE, b4const_or_zero, 0, 0, 0, 0, 0 }, /* GE */ - { LT, b4const_or_zero, 0, 0, 0, 0, 0 }, /* LT */ - { GE, b4const_or_zero, 1, 1, 1, 0, 0 }, /* LE */ + { LT, xtensa_b4const_or_zero, 1, 1, 1, 0, 0 }, /* GT */ + { GE, xtensa_b4const_or_zero, 0, 0, 0, 0, 0 }, /* GE */ + { LT, xtensa_b4const_or_zero, 0, 0, 0, 0, 0 }, /* LT */ + { GE, xtensa_b4const_or_zero, 1, 1, 1, 0, 0 }, /* LE */ { LTU, xtensa_b4constu, 1, 1, 1, 0, 1 }, /* GTU */ { GEU, xtensa_b4constu, 0, 0, 0, 0, 1 }, /* GEU */ @@ -932,8 +667,7 @@ gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */ struct cmp_info *p_info; test = map_test_to_internal_test (test_code); - if (test == ITEST_MAX) - abort (); + gcc_assert (test != ITEST_MAX); p_info = &info[ (int)test ]; @@ -1129,7 +863,7 @@ gen_conditional_move (rtx cmp) { case LT: code = GE; break; case GE: code = LT; break; - default: abort (); + default: gcc_unreachable (); } } @@ -1221,7 +955,7 @@ xtensa_split_operand_pair (rtx operands[4], enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } switch (GET_CODE (operands[0])) @@ -1237,7 +971,7 @@ xtensa_split_operand_pair (rtx operands[4], enum machine_mode mode) break; default: - abort (); + gcc_unreachable (); } } @@ -1341,8 +1075,7 @@ xtensa_copy_incoming_a7 (rtx opnd) return opnd; /* This function should never be called again once a7 has been copied. */ - if (cfun->machine->set_frame_ptr_insn) - abort (); + gcc_assert (!cfun->machine->set_frame_ptr_insn); mode = GET_MODE (opnd); @@ -1351,8 +1084,7 @@ xtensa_copy_incoming_a7 (rtx opnd) reg = opnd; if (GET_CODE (reg) == SUBREG) { - if (SUBREG_BYTE (reg) != 0) - abort (); + gcc_assert (SUBREG_BYTE (reg) == 0); reg = SUBREG_REG (reg); } if (GET_CODE (reg) != REG @@ -1361,8 +1093,7 @@ xtensa_copy_incoming_a7 (rtx opnd) return opnd; /* 1-word args will always be in a7; 2-word args in a6/a7. */ - if (REGNO (reg) + HARD_REGNO_NREGS (A7_REG, mode) - 1 != A7_REG) - abort (); + gcc_assert (REGNO (reg) + HARD_REGNO_NREGS (A7_REG, mode) - 1 == A7_REG); cfun->machine->need_a7_copy = false; @@ -1394,7 +1125,7 @@ xtensa_copy_incoming_a7 (rtx opnd) emit_insn (gen_movqi_internal (tmp, gen_raw_REG (mode, A7_REG))); break; default: - abort (); + gcc_unreachable (); } cfun->machine->set_frame_ptr_insn = emit_insn (gen_set_frame_ptr ()); @@ -1828,6 +1559,15 @@ override_options (void) /* There's no need for -fPIC (as opposed to -fpic) on Xtensa. */ if (flag_pic > 1) flag_pic = 1; + + /* Hot/cold partitioning does not work on this architecture, because of + constant pools (the load instruction cannot necessarily reach that far). + Therefore disable it on this architecture. */ + if (flag_reorder_blocks_and_partition) + { + flag_reorder_blocks_and_partition = 0; + flag_reorder_blocks = 1; + } } @@ -2094,8 +1834,7 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno) switch (GET_MODE_CLASS (mode)) { case MODE_FLOAT: - if (GET_CODE (x) != CONST_DOUBLE) - abort (); + gcc_assert (GET_CODE (x) == CONST_DOUBLE); REAL_VALUE_FROM_CONST_DOUBLE (r, x); switch (mode) @@ -2112,7 +1851,7 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno) break; default: - abort (); + gcc_unreachable (); } break; @@ -2120,24 +1859,27 @@ xtensa_output_literal (FILE *file, rtx x, enum machine_mode mode, int labelno) case MODE_INT: case MODE_PARTIAL_INT: size = GET_MODE_SIZE (mode); - if (size == 4) + switch (size) { + case 4: output_addr_const (file, x); fputs ("\n", file); - } - else if (size == 8) - { + break; + + case 8: output_addr_const (file, operand_subword (x, 0, 0, DImode)); fputs (", ", file); output_addr_const (file, operand_subword (x, 1, 0, DImode)); fputs ("\n", file); + break; + + default: + gcc_unreachable (); } - else - abort (); break; default: - abort (); + gcc_unreachable (); } } @@ -2669,7 +2411,7 @@ xtensa_multibss_section_type_flags (tree decl, const char *name, int reloc) && DECL_INITIAL (decl) == NULL_TREE)) flags |= SECTION_BSS; /* @nobits */ else - warning ("only uninitialized variables can be placed in a " + warning (0, "only uninitialized variables can be placed in a " ".bss section"); } diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index f60df57bb93..bfe0be1d387 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -24,7 +24,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA /* Standard GCC variables that we reference. */ extern int current_function_calls_alloca; -extern int target_flags; extern int optimize; /* External variables defined in xtensa.c. */ @@ -42,10 +41,6 @@ extern struct rtx_def * branch_cmp[2]; /* operands for compare */ extern enum cmp_type branch_type; /* what type of branch to use */ extern unsigned xtensa_current_frame_size; -/* Masks for the -m switches */ -#define MASK_NO_FUSED_MADD 0x00000001 /* avoid f-p mul/add */ -#define MASK_CONST16 0x00000002 /* use CONST16 instruction */ - /* Macros used in the machine description to select various Xtensa configuration options. */ #define TARGET_BIG_ENDIAN XCHAL_HAVE_BE @@ -66,40 +61,23 @@ extern unsigned xtensa_current_frame_size; #define TARGET_ABS XCHAL_HAVE_ABS #define TARGET_ADDX XCHAL_HAVE_ADDX -/* Macros controlled by command-line options. */ -#define TARGET_NO_FUSED_MADD (target_flags & MASK_NO_FUSED_MADD) -#define TARGET_CONST16 (target_flags & MASK_CONST16) - #define TARGET_DEFAULT ( \ (XCHAL_HAVE_L32R ? 0 : MASK_CONST16)) -#define TARGET_SWITCHES \ -{ \ - {"const16", MASK_CONST16, \ - N_("Use CONST16 instruction to load constants")}, \ - {"no-const16", -MASK_CONST16, \ - N_("Use PC-relative L32R instruction to load constants")}, \ - {"no-fused-madd", MASK_NO_FUSED_MADD, \ - N_("Disable fused multiply/add and multiply/subtract FP instructions")}, \ - {"fused-madd", -MASK_NO_FUSED_MADD, \ - N_("Enable fused multiply/add and multiply/subtract FP instructions")}, \ - {"text-section-literals", 0, \ - N_("Intersperse literal pools with code in the text section")}, \ - {"no-text-section-literals", 0, \ - N_("Put literal pools in a separate literal section")}, \ - {"target-align", 0, \ - N_("Automatically align branch targets to reduce branch penalties")}, \ - {"no-target-align", 0, \ - N_("Do not automatically align branch targets")}, \ - {"longcalls", 0, \ - N_("Use indirect CALLXn instructions for large programs")}, \ - {"no-longcalls", 0, \ - N_("Use direct CALLn instructions for fast calls")}, \ - {"", TARGET_DEFAULT, 0} \ -} +#define OVERRIDE_OPTIONS override_options () +/* Reordering blocks for Xtensa is not a good idea unless the compiler + understands the range of conditional branches. Currently all branch + relaxation for Xtensa is handled in the assembler, so GCC cannot do a + good job of reordering blocks. Do not enable reordering unless it is + explicitly requested. */ +#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ + do \ + { \ + flag_reorder_blocks = 0; \ + } \ + while (0) -#define OVERRIDE_OPTIONS override_options () /* Target CPU builtins. */ #define TARGET_CPU_CPP_BUILTINS() \ @@ -545,29 +523,16 @@ extern enum reg_class xtensa_char_to_class[256]; For Xtensa: - I = 12-bit signed immediate for movi - J = 8-bit signed immediate for addi + I = 12-bit signed immediate for MOVI + J = 8-bit signed immediate for ADDI K = 4-bit value in (b4const U {0}) L = 4-bit value in b4constu - M = 7-bit value in simm7 - N = 8-bit unsigned immediate shifted left by 8 bits for addmi - O = 4-bit value in ai4const - P = valid immediate mask value for extui */ - -#define CONST_OK_FOR_LETTER_P(VALUE, C) \ - ((C) == 'I' ? (xtensa_simm12b (VALUE)) \ - : (C) == 'J' ? (xtensa_simm8 (VALUE)) \ - : (C) == 'K' ? (((VALUE) == 0) || xtensa_b4const (VALUE)) \ - : (C) == 'L' ? (xtensa_b4constu (VALUE)) \ - : (C) == 'M' ? (xtensa_simm7 (VALUE)) \ - : (C) == 'N' ? (xtensa_simm8x256 (VALUE)) \ - : (C) == 'O' ? (xtensa_ai4const (VALUE)) \ - : (C) == 'P' ? (xtensa_mask_immediate (VALUE)) \ - : FALSE) - - -/* Similar, but for floating constants, and defining letters G and H. - Here VALUE is the CONST_DOUBLE rtx itself. */ + M = 7-bit immediate value for MOVI.N + N = 8-bit unsigned immediate shifted left by 8 bits for ADDMI + O = 4-bit immediate for ADDI.N + P = valid immediate mask value for EXTUI */ + +#define CONST_OK_FOR_LETTER_P xtensa_const_ok_for_letter_p #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) (0) @@ -591,15 +556,7 @@ extern enum reg_class xtensa_char_to_class[256]; address will be checked anyway because of the code in GO_IF_LEGITIMATE_ADDRESS. */ -#define EXTRA_CONSTRAINT(OP, CODE) \ - ((GET_CODE (OP) != MEM) ? \ - ((CODE) >= 'R' && (CODE) <= 'U' \ - && reload_in_progress && GET_CODE (OP) == REG \ - && REGNO (OP) >= FIRST_PSEUDO_REGISTER) \ - : ((CODE) == 'R') ? smalloffset_mem_p (OP) \ - : ((CODE) == 'T') ? !TARGET_CONST16 && constantpool_mem_p (OP) \ - : ((CODE) == 'U') ? !constantpool_mem_p (OP) \ - : FALSE) +#define EXTRA_CONSTRAINT xtensa_extra_constraint #define PREFERRED_RELOAD_CLASS(X, CLASS) \ xtensa_preferred_reload_class (X, CLASS, 0) @@ -644,12 +601,17 @@ extern enum reg_class xtensa_char_to_class[256]; #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ do { \ compute_frame_size (get_frame_size ()); \ - if ((FROM) == FRAME_POINTER_REGNUM) \ - (OFFSET) = 0; \ - else if ((FROM) == ARG_POINTER_REGNUM) \ - (OFFSET) = xtensa_current_frame_size; \ - else \ - abort (); \ + switch (FROM) \ + { \ + case FRAME_POINTER_REGNUM: \ + (OFFSET) = 0; \ + break; \ + case ARG_POINTER_REGNUM: \ + (OFFSET) = xtensa_current_frame_size; \ + break; \ + default: \ + gcc_unreachable (); \ + } \ } while (0) /* If defined, the maximum amount of space required for outgoing @@ -1149,37 +1111,6 @@ typedef struct xtensa_args #define BRANCH_COST 3 -/* Optionally define this if you have added predicates to - 'MACHINE.c'. This macro is called within an initializer of an - array of structures. The first field in the structure is the - name of a predicate and the second field is an array of rtl - codes. For each predicate, list all rtl codes that can be in - expressions matched by the predicate. The list should have a - trailing comma. */ - -#define PREDICATE_CODES \ - {"add_operand", { REG, CONST_INT, SUBREG }}, \ - {"arith_operand", { REG, CONST_INT, SUBREG }}, \ - {"nonimmed_operand", { REG, SUBREG, MEM }}, \ - {"mem_operand", { MEM }}, \ - {"mask_operand", { REG, CONST_INT, SUBREG }}, \ - {"extui_fldsz_operand", { CONST_INT }}, \ - {"sext_fldsz_operand", { CONST_INT }}, \ - {"lsbitnum_operand", { CONST_INT }}, \ - {"fpmem_offset_operand", { CONST_INT }}, \ - {"sext_operand", { REG, SUBREG, MEM }}, \ - {"branch_operand", { REG, CONST_INT, SUBREG }}, \ - {"ubranch_operand", { REG, CONST_INT, SUBREG }}, \ - {"call_insn_operand", { CONST_INT, CONST, SYMBOL_REF, REG }}, \ - {"move_operand", { REG, SUBREG, MEM, CONST_INT, CONST_DOUBLE, \ - CONST, SYMBOL_REF, LABEL_REF }}, \ - {"const_float_1_operand", { CONST_DOUBLE }}, \ - {"branch_operator", { EQ, NE, LT, GE }}, \ - {"ubranch_operator", { LTU, GEU }}, \ - {"boolean_operator", { EQ, NE }}, - -/* Control the assembler format that we output. */ - /* How to refer to registers in assembler output. This sequence is indexed by compiler's hard-register-number (see above). */ #define REGISTER_NAMES \ diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 448a892d744..cd08f7633a6 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -1,5 +1,5 @@ ;; GCC machine description for Tensilica's Xtensa architecture. -;; Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. ;; Contributed by Bob Wilson (bwilson@tensilica.com) at Tensilica. ;; This file is part of GCC. @@ -88,6 +88,11 @@ (eq_attr "type" "fconv") "nothing") +;; Include predicate definitions + +(include "predicates.md") + + ;; Addition. (define_expand "adddi3" @@ -366,7 +371,7 @@ (plus:SF (mult:SF (match_operand:SF 1 "register_operand" "%f") (match_operand:SF 2 "register_operand" "f")) (match_operand:SF 3 "register_operand" "0")))] - "TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD" + "TARGET_HARD_FLOAT && TARGET_FUSED_MADD" "madd.s\t%0, %1, %2" [(set_attr "type" "fmadd") (set_attr "mode" "SF") @@ -377,7 +382,7 @@ (minus:SF (match_operand:SF 1 "register_operand" "0") (mult:SF (match_operand:SF 2 "register_operand" "%f") (match_operand:SF 3 "register_operand" "f"))))] - "TARGET_HARD_FLOAT && !TARGET_NO_FUSED_MADD" + "TARGET_HARD_FLOAT && TARGET_FUSED_MADD" "msub.s\t%0, %2, %3" [(set_attr "type" "fmadd") (set_attr "mode" "SF") @@ -879,8 +884,8 @@ %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0 - rsr\t%0, 16 # ACCLO - wsr\t%1, 16 # ACCLO" + rsr\t%0, ACCLO + wsr\t%1, ACCLO" [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr") (set_attr "mode" "SI") (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")]) @@ -907,8 +912,8 @@ movi\t%0, %x1 %v1l16ui\t%0, %1 %v0s16i\t%1, %0 - rsr\t%0, 16 # ACCLO - wsr\t%1, 16 # ACCLO" + rsr\t%0, ACCLO + wsr\t%1, ACCLO" [(set_attr "type" "move,move,move,move,load,store,rsr,wsr") (set_attr "mode" "HI") (set_attr "length" "2,2,3,3,3,3,3,3")]) @@ -935,8 +940,8 @@ movi\t%0, %x1 %v1l8ui\t%0, %1 %v0s8i\t%1, %0 - rsr\t%0, 16 # ACCLO - wsr\t%1, 16 # ACCLO" + rsr\t%0, ACCLO + wsr\t%1, ACCLO" [(set_attr "type" "move,move,move,move,load,store,rsr,wsr") (set_attr "mode" "QI") (set_attr "length" "2,2,3,3,3,3,3,3")]) @@ -1321,7 +1326,7 @@ case NE: return "bne\t%0, %1, %2"; case LT: return "blt\t%0, %1, %2"; case GE: return "bge\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } } else if (INTVAL (operands[1]) == 0) @@ -1336,7 +1341,7 @@ : "bnez\t%0, %2"); case LT: return "bltz\t%0, %2"; case GE: return "bgez\t%0, %2"; - default: break; + default: gcc_unreachable (); } } else @@ -1347,11 +1352,10 @@ case NE: return "bnei\t%0, %d1, %2"; case LT: return "blti\t%0, %d1, %2"; case GE: return "bgei\t%0, %d1, %2"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "jump,jump") (set_attr "mode" "none") @@ -1374,7 +1378,7 @@ case NE: return "beq\t%0, %1, %2"; case LT: return "bge\t%0, %1, %2"; case GE: return "blt\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } } else if (INTVAL (operands[1]) == 0) @@ -1389,7 +1393,7 @@ : "beqz\t%0, %2"); case LT: return "bgez\t%0, %2"; case GE: return "bltz\t%0, %2"; - default: break; + default: gcc_unreachable (); } } else @@ -1400,11 +1404,10 @@ case NE: return "beqi\t%0, %d1, %2"; case LT: return "bgei\t%0, %d1, %2"; case GE: return "blti\t%0, %d1, %2"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "jump,jump") (set_attr "mode" "none") @@ -1425,7 +1428,7 @@ { case LTU: return "bltu\t%0, %1, %2"; case GEU: return "bgeu\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } } else @@ -1434,11 +1437,10 @@ { case LTU: return "bltui\t%0, %d1, %2"; case GEU: return "bgeui\t%0, %d1, %2"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "jump,jump") (set_attr "mode" "none") @@ -1459,7 +1461,7 @@ { case LTU: return "bgeu\t%0, %1, %2"; case GEU: return "bltu\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } } else @@ -1468,11 +1470,10 @@ { case LTU: return "bgeui\t%0, %d1, %2"; case GEU: return "bltui\t%0, %d1, %2"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "jump,jump") (set_attr "mode" "none") @@ -1500,7 +1501,7 @@ { case EQ: return "bbci\t%0, %d1, %2"; case NE: return "bbsi\t%0, %d1, %2"; - default: break; + default: gcc_unreachable (); } } else @@ -1509,11 +1510,10 @@ { case EQ: return "bbc\t%0, %1, %2"; case NE: return "bbs\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "jump") (set_attr "mode" "none") @@ -1539,7 +1539,7 @@ { case EQ: return "bbsi\t%0, %d1, %2"; case NE: return "bbci\t%0, %d1, %2"; - default: break; + default: gcc_unreachable (); } } else @@ -1548,11 +1548,10 @@ { case EQ: return "bbs\t%0, %1, %2"; case NE: return "bbc\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "jump") (set_attr "mode" "none") @@ -1572,10 +1571,8 @@ { case EQ: return "bnone\t%0, %1, %2"; case NE: return "bany\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } - abort (); - return ""; } [(set_attr "type" "jump") (set_attr "mode" "none") @@ -1595,10 +1592,8 @@ { case EQ: return "bany\t%0, %1, %2"; case NE: return "bnone\t%0, %1, %2"; - default: break; + default: gcc_unreachable (); } - abort (); - return ""; } [(set_attr "type" "jump") (set_attr "mode" "none") @@ -1753,7 +1748,7 @@ case NE: return "movnez\t%0, %2, %1"; case LT: return "movltz\t%0, %2, %1"; case GE: return "movgez\t%0, %2, %1"; - default: break; + default: gcc_unreachable (); } } else @@ -1764,11 +1759,10 @@ case NE: return "moveqz\t%0, %3, %1"; case LT: return "movgez\t%0, %3, %1"; case GE: return "movltz\t%0, %3, %1"; - default: break; + default: gcc_unreachable (); } } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "move,move") (set_attr "mode" "SI") @@ -1792,9 +1786,9 @@ case 1: if (isEq) return "movt\t%0, %3, %1"; return "movf\t%0, %3, %1"; + default: + gcc_unreachable (); } - abort (); - return ""; } [(set_attr "type" "move,move") (set_attr "mode" "SI") @@ -1809,52 +1803,52 @@ (match_operand:SF 3 "register_operand" "0,r,0,f")))] "" { - if (which_alternative == 0) + switch (which_alternative) { + case 0: switch (GET_CODE (operands[4])) { case EQ: return "moveqz\t%0, %2, %1"; case NE: return "movnez\t%0, %2, %1"; case LT: return "movltz\t%0, %2, %1"; case GE: return "movgez\t%0, %2, %1"; - default: break; + default: gcc_unreachable (); } - } - else if (which_alternative == 1) - { + break; + case 1: switch (GET_CODE (operands[4])) { case EQ: return "movnez\t%0, %3, %1"; case NE: return "moveqz\t%0, %3, %1"; case LT: return "movgez\t%0, %3, %1"; case GE: return "movltz\t%0, %3, %1"; - default: break; + default: gcc_unreachable (); } - } - else if (which_alternative == 2) - { + break; + case 2: switch (GET_CODE (operands[4])) { case EQ: return "moveqz.s %0, %2, %1"; case NE: return "movnez.s %0, %2, %1"; case LT: return "movltz.s %0, %2, %1"; case GE: return "movgez.s %0, %2, %1"; - default: break; + default: gcc_unreachable (); } - } - else if (which_alternative == 3) - { + break; + case 3: switch (GET_CODE (operands[4])) { case EQ: return "movnez.s %0, %3, %1"; case NE: return "moveqz.s %0, %3, %1"; case LT: return "movgez.s %0, %3, %1"; case GE: return "movltz.s %0, %3, %1"; - default: break; + default: gcc_unreachable (); } + break; + default: + gcc_unreachable (); } - abort (); - return ""; + gcc_unreachable (); } [(set_attr "type" "move,move,move,move") (set_attr "mode" "SF") @@ -1884,9 +1878,9 @@ case 3: if (isEq) return "movt.s\t%0, %3, %1"; return "movf.s\t%0, %3, %1"; + default: + gcc_unreachable (); } - abort (); - return ""; } [(set_attr "type" "move,move,move,move") (set_attr "mode" "SF") diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt new file mode 100644 index 00000000000..6be1b3862be --- /dev/null +++ b/gcc/config/xtensa/xtensa.opt @@ -0,0 +1,40 @@ +; Options for the Tensilica Xtensa port of the compiler. + +; Copyright (C) 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. + +mconst16 +Target Report Mask(CONST16) +Use CONST16 instruction to load constants + +mfused-madd +Target Report Mask(FUSED_MADD) +Enable fused multiply/add and multiply/subtract FP instructions + +mlongcalls +Target +Use indirect CALLXn instructions for large programs + +mtarget-align +Target +Automatically align branch targets to reduce branch penalties + +mtext-section-literals +Target +Intersperse literal pools with code in the text section diff --git a/gcc/configure b/gcc/configure index dfefaebfd17..5a57cdb1b97 100755 --- a/gcc/configure +++ b/gcc/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default set_gcc_lib_path GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir libstdcxx_incdir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -867,8 +867,9 @@ Optional Features: --enable-checking=LIST enable expensive run-time checks. With LIST, enable only specific categories of checks. - Categories are: assert,fold,gc,gcac,misc, - rtlflag,rtl,tree,valgrind,release,yes,all; + Categories are: yes,no,all,none,release. + Flags are: assert,fold,gc,gcac,misc, + rtlflag,rtl,runtime,tree,valgrind. --enable-mapped-location location_t is fileline integer cookie --enable-coverage=LEVEL enable compiler's code coverage collection. @@ -1032,7 +1033,7 @@ esac else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -2386,8 +2387,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -2445,8 +2445,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -2562,8 +2561,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -2617,8 +2615,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -2663,8 +2660,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -2708,8 +2704,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3131,8 +3126,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3203,8 +3197,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3263,8 +3256,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3346,8 +3338,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3517,8 +3508,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3583,8 +3573,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3646,8 +3635,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3687,8 +3675,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3744,8 +3731,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3785,8 +3771,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3850,8 +3835,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -3882,10 +3866,8 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -3997,8 +3979,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4060,8 +4041,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4101,8 +4081,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4158,8 +4137,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4199,8 +4177,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4264,8 +4241,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4296,10 +4272,8 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -4411,8 +4385,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4474,8 +4447,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4515,8 +4487,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4572,8 +4543,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4613,8 +4583,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4678,8 +4647,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4710,10 +4678,8 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -4825,8 +4791,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4888,8 +4853,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4929,8 +4893,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -4986,8 +4949,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5027,8 +4989,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5092,8 +5053,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5124,10 +5084,8 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -5240,8 +5198,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5303,8 +5260,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5344,8 +5300,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5401,8 +5356,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5442,8 +5396,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5507,8 +5460,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5539,10 +5491,8 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -5656,8 +5606,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5719,8 +5668,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5760,8 +5708,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5817,8 +5764,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5858,8 +5804,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5923,8 +5868,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -5955,10 +5899,8 @@ See \`config.log' for more details." >&2;} esac else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} + { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5 +echo "$as_me: error: internal error: not reached in cross-compile" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF @@ -6074,8 +6016,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -6125,8 +6066,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -6184,8 +6124,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -6275,37 +6214,50 @@ fi fi; ac_assert_checking=1 ac_checking= -ac_tree_checking= -ac_rtl_checking= -ac_rtlflag_checking= +ac_fold_checking= ac_gc_checking= ac_gc_always_collect= -ac_fold_checking= +ac_rtl_checking= +ac_rtlflag_checking= +ac_runtime_checking=1 +ac_tree_checking= +ac_valgrind_checking= IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," for check in $ac_checking_flags do case $check in + # these set all the flags to specific states yes) ac_assert_checking=1 ; ac_checking=1 ; - ac_tree_checking=1 ; ac_gc_checking=1 ; - ac_rtlflag_checking=1 ;; - no) ac_assert_checking= ; ac_checking= ; - ac_tree_checking= ; ac_rtl_checking= ; - ac_rtlflag_checking= ; ac_gc_checking= ; - ac_gc_always_collect= ; ac_fold_checking= ;; + ac_fold_checking= ; ac_gc_checking=1 ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + no|none) ac_assert_checking= ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking= ; + ac_tree_checking= ; ac_valgrind_checking= ;; all) ac_assert_checking=1 ; ac_checking=1 ; - ac_tree_checking=1 ; ac_rtl_checking=1 ; - ac_rtlflag_checking=1 ; ac_gc_checking=1 ; - ac_gc_always_collect=1 ; ac_fold_checking=1 ;; - release) ac_assert_checking=1 ;; + ac_fold_checking=1 ; ac_gc_checking=1 ; + ac_gc_always_collect=1 ; ac_rtl_checking=1 ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + release) ac_assert_checking=1 ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking=1 ; + ac_tree_checking= ; ac_valgrind_checking= ;; + # these enable particular checks assert) ac_assert_checking=1 ;; fold) ac_fold_checking=1 ;; gc) ac_gc_checking=1 ;; gcac) ac_gc_always_collect=1 ;; misc) ac_checking=1 ;; - rtlflag) ac_rtlflag_checking=1 ;; rtl) ac_rtl_checking=1 ;; + rtlflag) ac_rtlflag_checking=1 ;; + runtime) ac_runtime_checking=1 ;; tree) ac_tree_checking=1 ;; - valgrind) ac_checking_valgrind=1 ;; + valgrind) ac_valgrind_checking=1 ;; *) { { echo "$as_me:$LINENO: error: unknown check category $check" >&5 echo "$as_me: error: unknown check category $check" >&2;} { (exit 1); exit 1; }; } ;; @@ -6330,6 +6282,14 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi + +if test x$ac_runtime_checking != x ; then + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_RUNTIME_CHECKING 1 +_ACEOF + +fi if test x$ac_tree_checking != x ; then cat >>confdefs.h <<\_ACEOF @@ -6407,8 +6367,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -6522,7 +6481,7 @@ fi -if test x$ac_checking_valgrind != x ; then +if test x$ac_valgrind_checking != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. echo "$as_me:$LINENO: checking for VALGRIND_DISCARD in " >&5 @@ -7378,7 +7337,7 @@ if test "${gcc_cv_prog_makeinfo_modern+set}" = set; then else ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` - echo "configure:7381: version of makeinfo is $ac_prog_version" >&5 + echo "configure:7340: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; 4.[2-9]*) @@ -7633,8 +7592,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -7704,8 +7662,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -7870,8 +7827,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -7932,8 +7888,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -8003,8 +7958,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -8279,8 +8233,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -8323,8 +8276,7 @@ echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. + # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8333,13 +8285,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + int main () { - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif + ; return 0; } @@ -8353,8 +8306,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -8375,13 +8327,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include + int main () { - #if BYTE_ORDER != BIG_ENDIAN not big endian #endif + ; return 0; } @@ -8395,8 +8348,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -8420,11 +8372,68 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_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 + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - echo $ac_n "cross-compiling... " 2>&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8432,7 +8441,9 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main () { +int +main () +{ /* Are we little or big endian? From Harbison&Steele. */ union { @@ -8466,67 +8477,26 @@ fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -if test $ac_cv_c_bigendian = unknown; then -echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 -echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 - -cat >conftest.c <&6 - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&6 - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&6 - fi - fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -fi -if test $ac_cv_c_bigendian = yes; then +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HOST_WORDS_BIG_ENDIAN 1 -_ACEOF - - BYTEORDER=4321 -else - BYTEORDER=1234 -fi - -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF - -if test $ac_cv_c_bigendian = unknown; then - { { echo "$as_me:$LINENO: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&5 -echo "$as_me: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&2;} - { (exit 1); exit 1; }; } -fi + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac # -------- @@ -8598,8 +8568,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -8673,8 +8642,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -8728,8 +8696,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -8807,8 +8774,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -8862,8 +8828,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -8931,8 +8896,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -8990,11 +8954,22 @@ fi + + + + + + + + + + + + for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \ - sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \ - scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \ - setlocale + sysconf strsignal getrusage nl_langinfo scandir alphasort \ + gettimeofday mbstowcs wcswidth mmap mincore setlocale \ + clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -9062,8 +9037,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -9184,8 +9158,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -9536,8 +9509,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -9654,8 +9626,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -9767,8 +9738,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -9926,8 +9896,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -10799,8 +10768,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -10850,8 +10818,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -10941,8 +10908,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11011,8 +10977,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -11075,8 +11040,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -11137,10 +11101,22 @@ CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" -for ac_func in getenv atol sbrk abort atof getcwd getwd \ - strsignal putc_unlocked fputs_unlocked fwrite_unlocked \ - fprintf_unlocked strstr errno snprintf vasprintf \ - malloc realloc calloc free basename getopt clock getpagesize + + + + + + + + + + + + + +for ac_func in getenv atol sbrk abort atof getcwd getwd strsignal \ + strstr errno snprintf vsnprintf vasprintf malloc realloc calloc \ + free basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp` echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5 @@ -11179,8 +11155,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11265,8 +11240,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11335,8 +11309,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11411,8 +11384,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11495,8 +11467,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11572,8 +11543,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11639,8 +11609,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -11776,8 +11745,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 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' + { 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=$? @@ -12086,8 +12054,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -12192,7 +12159,7 @@ host_xm_file="auto-host.h ansidecl.h ${host_xm_file}" build_xm_file="${build_auto} ansidecl.h ${build_xm_file}" # We don't want ansidecl.h in target files, write code there in ISO/GNU C. # put this back in temporarily. -xm_file="ansidecl.h ${xm_file}" +xm_file="auto-host.h ansidecl.h ${xm_file}" # -------- # UNSORTED @@ -12342,8 +12309,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -12397,8 +12363,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 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' + { 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=$? @@ -12667,7 +12632,7 @@ then BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' if test "x$TARGET_SYSTEM_ROOT" = x; then - if "x$STMP_FIXPROTO" != x ; then + if test "x$STMP_FIXPROTO" != x; then STMP_FIXPROTO=stmp-install-fixproto fi fi @@ -13291,8 +13256,12 @@ else -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'` + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'` ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` + ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` + ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` + ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` if test 0"$ld_date" -lt 20020404; then if test -n "$ld_date"; then # If there was date string, but was earlier than 2002-04-04, fail @@ -13301,9 +13270,6 @@ else # If there was no date string nor ld version number, something is wrong gcc_cv_ld_hidden=no else - ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` - ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` - ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` test -z "$ld_vers_patch" && ld_vers_patch=0 if test "$ld_vers_major" -lt 2; then gcc_cv_ld_hidden=no @@ -13330,6 +13296,7 @@ echo "$as_me:$LINENO: result: $gcc_cv_ld_hidden" >&5 echo "${ECHO_T}$gcc_cv_ld_hidden" >&6 libgcc_visibility=no + if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then libgcc_visibility=yes @@ -13577,7 +13544,7 @@ else gcc_cv_as_comdat_group=no if test $in_tree_gas = yes; then if test $in_tree_gas_is_elf = yes \ - && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91` + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0` then gcc_cv_as_comdat_group=yes fi elif test x$gcc_cv_as != x; then @@ -13611,7 +13578,7 @@ else gcc_cv_as_comdat_group_percent=no if test $in_tree_gas = yes; then if test $in_tree_gas_is_elf = yes \ - && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 15 \) \* 1000 + 91` + && test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 16 \) \* 1000 + 0` then gcc_cv_as_comdat_group_percent=yes fi elif test x$gcc_cv_as != x; then @@ -13635,9 +13602,26 @@ echo "$as_me:$LINENO: result: $gcc_cv_as_comdat_group_percent" >&5 echo "${ECHO_T}$gcc_cv_as_comdat_group_percent" >&6 fi +if test $in_tree_ld != yes && test x"$ld_vers" != x; then + comdat_group=yes + if test 0"$ld_date" -lt 20050308; then + if test -n "$ld_date"; then + # If there was date string, but was earlier than 2005-03-08, fail + comdat_group=no + elif test "$ld_vers_major" -lt 2; then + comdat_group=no + elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then + comdat_group=no + fi + fi + if test $comdat_group = no; then + gcc_cv_as_comdat_group=no + gcc_cv_as_comdat_group_percent=no + fi +fi cat >>confdefs.h <<_ACEOF -#define HAVE_GAS_COMDAT_GROUP `if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi` +#define HAVE_COMDAT_GROUP `if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi` _ACEOF @@ -14518,7 +14502,8 @@ fi powerpc*-*-*) case $target in - *-*-aix*) conftest_s=' .csect .text[PR] + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[PR] mfcr 3,128';; *-*-darwin*) echo "$as_me:$LINENO: checking assembler for .machine directive support" >&5 @@ -14595,6 +14580,53 @@ cat >>confdefs.h <<\_ACEOF _ACEOF fi + + case $target in + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[PR] + popcntb 3,3';; + *) conftest_s=' .machine power5 + .text + popcntb 3,3';; + esac + + echo "$as_me:$LINENO: checking assembler for popcntb support" >&5 +echo $ECHO_N "checking assembler for popcntb support... $ECHO_C" >&6 +if test "${gcc_cv_as_powerpc_popcntb+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_as_powerpc_popcntb=no + if test $in_tree_gas = yes; then + if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 17 \) \* 1000 + 0` + then gcc_cv_as_powerpc_popcntb=yes +fi + elif test x$gcc_cv_as != x; then + echo "$conftest_s" > conftest.s + if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + gcc_cv_as_powerpc_popcntb=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_as_powerpc_popcntb" >&5 +echo "${ECHO_T}$gcc_cv_as_powerpc_popcntb" >&6 +if test $gcc_cv_as_powerpc_popcntb = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_AS_POPCNTB 1 +_ACEOF + +fi + ;; mips*-*-*) @@ -14889,6 +14921,7 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_eh_frame_hdr=yes fi fi + if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then cat >>confdefs.h <<\_ACEOF @@ -15006,6 +15039,32 @@ _ACEOF ;; esac +echo "$as_me:$LINENO: checking linker --sysroot support" >&5 +echo $ECHO_N "checking linker --sysroot support... $ECHO_C" >&6 +if test "${gcc_cv_ld_sysroot+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + gcc_cv_ld_sysroot=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 ; then + gcc_cv_ld_sysroot=yes + fi + elif test x$gcc_cv_ld != x; then + if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then + gcc_cv_ld_sysroot=yes + fi + fi +fi +echo "$as_me:$LINENO: result: $gcc_cv_ld_sysroot" >&5 +echo "${ECHO_T}$gcc_cv_ld_sysroot" >&6 +if test x"$gcc_cv_ld_sysroot" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LD_SYSROOT 1 +_ACEOF + +fi + if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then @@ -15346,21 +15405,6 @@ objdir=`${PWDCMD-pwd}` - -if test x"$SET_GCC_LIB_PATH_CMD" != x; then - # SET_GCC_LIB_PATH_CMD is "XXX=path; export XXX;". It is expanded to - # - # eval "set_gcc_lib_path=XXX=path; export XXX;" - # - eval "set_gcc_lib_path=$SET_GCC_LIB_PATH_CMD" - # It will set set_gcc_lib_path to "export XXX=path" for GNU make. - set_gcc_lib_path="export $set_gcc_lib_path" -else - set_gcc_lib_path= -fi - - - # Echo link setup. if test x${build} = x${host} ; then if test x${host} = x${target} ; then @@ -16176,7 +16220,6 @@ s,@xm_defines@,$xm_defines,;t t s,@c_target_objs@,$c_target_objs,;t t s,@cxx_target_objs@,$cxx_target_objs,;t t s,@target_cpu_default@,$target_cpu_default,;t t -s,@set_gcc_lib_path@,$set_gcc_lib_path,;t t s,@GMPLIBS@,$GMPLIBS,;t t s,@GMPINC@,$GMPINC,;t t s,@LIBOBJS@,$LIBOBJS,;t t @@ -16345,11 +16388,6 @@ esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -16388,6 +16426,12 @@ echo "$as_me: error: cannot find input file: $f" >&2;} fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff --git a/gcc/configure.ac b/gcc/configure.ac index d8be15830ff..da325274e1e 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -393,8 +393,9 @@ AC_ARG_ENABLE(checking, [ --enable-checking[=LIST] enable expensive run-time checks. With LIST, enable only specific categories of checks. - Categories are: assert,fold,gc,gcac,misc, - rtlflag,rtl,tree,valgrind,release,yes,all;], + Categories are: yes,no,all,none,release. + Flags are: assert,fold,gc,gcac,misc, + rtlflag,rtl,runtime,tree,valgrind.], [ac_checking_flags="${enableval}"],[ # Determine the default checks. if test x$is_release = x ; then @@ -404,37 +405,50 @@ else fi]) ac_assert_checking=1 ac_checking= -ac_tree_checking= -ac_rtl_checking= -ac_rtlflag_checking= +ac_fold_checking= ac_gc_checking= ac_gc_always_collect= -ac_fold_checking= +ac_rtl_checking= +ac_rtlflag_checking= +ac_runtime_checking=1 +ac_tree_checking= +ac_valgrind_checking= IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS," for check in $ac_checking_flags do case $check in + # these set all the flags to specific states yes) ac_assert_checking=1 ; ac_checking=1 ; - ac_tree_checking=1 ; ac_gc_checking=1 ; - ac_rtlflag_checking=1 ;; - no) ac_assert_checking= ; ac_checking= ; - ac_tree_checking= ; ac_rtl_checking= ; - ac_rtlflag_checking= ; ac_gc_checking= ; - ac_gc_always_collect= ; ac_fold_checking= ;; + ac_fold_checking= ; ac_gc_checking=1 ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + no|none) ac_assert_checking= ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking= ; + ac_tree_checking= ; ac_valgrind_checking= ;; all) ac_assert_checking=1 ; ac_checking=1 ; - ac_tree_checking=1 ; ac_rtl_checking=1 ; - ac_rtlflag_checking=1 ; ac_gc_checking=1 ; - ac_gc_always_collect=1 ; ac_fold_checking=1 ;; - release) ac_assert_checking=1 ;; + ac_fold_checking=1 ; ac_gc_checking=1 ; + ac_gc_always_collect=1 ; ac_rtl_checking=1 ; + ac_rtlflag_checking=1 ; ac_runtime_checking=1 ; + ac_tree_checking=1 ; ac_valgrind_checking= ;; + release) ac_assert_checking=1 ; ac_checking= ; + ac_fold_checking= ; ac_gc_checking= ; + ac_gc_always_collect= ; ac_rtl_checking= ; + ac_rtlflag_checking= ; ac_runtime_checking=1 ; + ac_tree_checking= ; ac_valgrind_checking= ;; + # these enable particular checks assert) ac_assert_checking=1 ;; fold) ac_fold_checking=1 ;; gc) ac_gc_checking=1 ;; gcac) ac_gc_always_collect=1 ;; misc) ac_checking=1 ;; - rtlflag) ac_rtlflag_checking=1 ;; rtl) ac_rtl_checking=1 ;; + rtlflag) ac_rtlflag_checking=1 ;; + runtime) ac_runtime_checking=1 ;; tree) ac_tree_checking=1 ;; - valgrind) ac_checking_valgrind=1 ;; + valgrind) ac_valgrind_checking=1 ;; *) AC_MSG_ERROR(unknown check category $check) ;; esac done @@ -452,6 +466,11 @@ if test x$ac_assert_checking != x ; then AC_DEFINE(ENABLE_ASSERT_CHECKING, 1, [Define if you want assertions enabled. This is a cheap check.]) fi +GCC_TARGET_TEMPLATE(ENABLE_RUNTIME_CHECKING) +if test x$ac_runtime_checking != x ; then + AC_DEFINE(ENABLE_RUNTIME_CHECKING, 1, +[Define if you want runtime assertions enabled. This is a cheap check.]) +fi if test x$ac_tree_checking != x ; then AC_DEFINE(ENABLE_TREE_CHECKING, 1, [Define if you want all operations on trees (the basic data @@ -498,7 +517,7 @@ dnl # an if statement. This was the source of very frustrating bugs dnl # in converting to autoconf 2.5x! AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no) -if test x$ac_checking_valgrind != x ; then +if test x$ac_valgrind_checking != x ; then # It is certainly possible that there's valgrind but no valgrind.h. # GCC relies on making annotations so we must have both. AC_MSG_CHECKING(for VALGRIND_DISCARD in ) @@ -875,7 +894,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) # These tests can't be done till we know if we have limits.h. gcc_AC_C_CHAR_BIT -AC_C_BIGENDIAN_CROSS +AC_C_BIGENDIAN # -------- # UNSORTED @@ -959,11 +978,15 @@ fi dnl Disabled until we have a complete test for buggy enum bitfields. dnl gcc_AC_C_ENUM_BF_UNSIGNED +define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl + ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl + fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl + fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl + putchar_unlocked putc_unlocked) AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \ - sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \ - scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \ - setlocale) + sysconf strsignal getrusage nl_langinfo scandir alphasort \ + gettimeofday mbstowcs wcswidth mmap mincore setlocale \ + gcc_UNLOCKED_FUNCS) if test x$ac_cv_func_mbstowcs = xyes; then AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works, @@ -1030,10 +1053,9 @@ AM_LANGINFO_CODESET # We will need to find libiberty.h and ansidecl.h saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include" -gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \ - strsignal putc_unlocked fputs_unlocked fwrite_unlocked \ - fprintf_unlocked strstr errno snprintf vasprintf \ - malloc realloc calloc free basename getopt clock getpagesize, , ,[ +gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd strsignal \ + strstr errno snprintf vsnprintf vasprintf malloc realloc calloc \ + free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[ #include "ansidecl.h" #include "system.h"]) @@ -1381,7 +1403,7 @@ host_xm_file="auto-host.h ansidecl.h ${host_xm_file}" build_xm_file="${build_auto} ansidecl.h ${build_xm_file}" # We don't want ansidecl.h in target files, write code there in ISO/GNU C. # put this back in temporarily. -xm_file="ansidecl.h ${xm_file}" +xm_file="auto-host.h ansidecl.h ${xm_file}" # -------- # UNSORTED @@ -1672,7 +1694,7 @@ then BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)' if test "x$TARGET_SYSTEM_ROOT" = x; then - if [ "x$STMP_FIXPROTO" != x ] ; then + if test "x$STMP_FIXPROTO" != x; then STMP_FIXPROTO=stmp-install-fixproto fi fi @@ -2082,8 +2104,12 @@ changequote(,)dnl -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'` + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p'` ld_date=`echo $ld_ver | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'` + ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` + ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` + ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` if test 0"$ld_date" -lt 20020404; then if test -n "$ld_date"; then # If there was date string, but was earlier than 2002-04-04, fail @@ -2092,9 +2118,6 @@ changequote(,)dnl # If there was no date string nor ld version number, something is wrong gcc_cv_ld_hidden=no else - ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'` - ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'` - ld_vers_patch=`expr "$ld_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'` test -z "$ld_vers_patch" && ld_vers_patch=0 if test "$ld_vers_major" -lt 2; then gcc_cv_ld_hidden=no @@ -2119,6 +2142,7 @@ changequote([,])dnl fi]) libgcc_visibility=no AC_SUBST(libgcc_visibility) +GCC_TARGET_TEMPLATE([HAVE_GAS_HIDDEN]) if test $gcc_cv_as_hidden = yes && test $gcc_cv_ld_hidden = yes; then libgcc_visibility=yes AC_DEFINE(HAVE_GAS_HIDDEN, 1, @@ -2235,18 +2259,35 @@ AC_DEFINE_UNQUOTED(HAVE_GAS_SHF_MERGE, [Define 0/1 if your assembler supports marking sections with SHF_MERGE flag.]) gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group, - [elf,2,15,91], [--fatal-warnings], + [elf,2,16,0], [--fatal-warnings], [.section .text,"axG",@progbits,.foo,comdat]) if test $gcc_cv_as_comdat_group = yes; then gcc_cv_as_comdat_group_percent=no else gcc_GAS_CHECK_FEATURE(COMDAT group support, gcc_cv_as_comdat_group_percent, - [elf,2,15,91], [--fatal-warnings], + [elf,2,16,0], [--fatal-warnings], [.section .text,"axG",%progbits,.foo,comdat]) fi -AC_DEFINE_UNQUOTED(HAVE_GAS_COMDAT_GROUP, +if test $in_tree_ld != yes && test x"$ld_vers" != x; then + comdat_group=yes + if test 0"$ld_date" -lt 20050308; then + if test -n "$ld_date"; then + # If there was date string, but was earlier than 2005-03-08, fail + comdat_group=no + elif test "$ld_vers_major" -lt 2; then + comdat_group=no + elif test "$ld_vers_major" -eq 2 -a "$ld_vers_minor" -lt 16; then + comdat_group=no + fi + fi + if test $comdat_group = no; then + gcc_cv_as_comdat_group=no + gcc_cv_as_comdat_group_percent=no + fi +fi +AC_DEFINE_UNQUOTED(HAVE_COMDAT_GROUP, [`if test $gcc_cv_as_comdat_group = yes || test $gcc_cv_as_comdat_group_percent = yes; then echo 1; else echo 0; fi`], -[Define 0/1 if your assembler supports COMDAT group.]) +[Define 0/1 if your assembler and linker support COMDAT groups.]) # Thread-local storage - the check is heavily parametrized. conftest_s= @@ -2747,7 +2788,8 @@ foo: nop powerpc*-*-*) case $target in - *-*-aix*) conftest_s=' .csect .text[[PR]] + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[[PR]] mfcr 3,128';; *-*-darwin*) gcc_GAS_CHECK_FEATURE([.machine directive support], @@ -2770,6 +2812,22 @@ foo: nop [$conftest_s],, [AC_DEFINE(HAVE_AS_MFCRF, 1, [Define if your assembler supports mfcr field.])]) + + case $target in + *-*-aix*) conftest_s=' .machine "pwr5" + .csect .text[[PR]] + popcntb 3,3';; + *) conftest_s=' .machine power5 + .text + popcntb 3,3';; + esac + + gcc_GAS_CHECK_FEATURE([popcntb support], + gcc_cv_as_powerpc_popcntb, [2,17,0],, + [$conftest_s],, + [AC_DEFINE(HAVE_AS_POPCNTB, 1, + [Define if your assembler supports popcntb field.])]) + ;; mips*-*-*) @@ -2913,6 +2971,7 @@ elif test x$gcc_cv_ld != x; then gcc_cv_ld_eh_frame_hdr=yes fi fi +GCC_TARGET_TEMPLATE([HAVE_LD_EH_FRAME_HDR]) if test x"$gcc_cv_ld_eh_frame_hdr" = xyes; then AC_DEFINE(HAVE_LD_EH_FRAME_HDR, 1, [Define if your linker supports --eh-frame-hdr option.]) @@ -3003,6 +3062,23 @@ EOF ;; esac +AC_CACHE_CHECK(linker --sysroot support, + gcc_cv_ld_sysroot, + [gcc_cv_ld_sysroot=no + if test $in_tree_ld = yes ; then + if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 ; then + gcc_cv_ld_sysroot=yes + fi + elif test x$gcc_cv_ld != x; then + if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then + gcc_cv_ld_sysroot=yes + fi + fi]) +if test x"$gcc_cv_ld_sysroot" = xyes; then + AC_DEFINE(HAVE_LD_SYSROOT, 1, + [Define if your linker supports --sysroot.]) +fi + if test x$with_sysroot = x && test x$host = x$target \ && test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include", @@ -3325,8 +3401,6 @@ AC_SUBST(target_cpu_default) AC_SUBST_FILE(language_hooks) -TL_AC_GNU_MAKE_GCC_LIB_PATH - # Echo link setup. if test x${build} = x${host} ; then if test x${host} = x${target} ; then diff --git a/gcc/convert.c b/gcc/convert.c index f900ace21e4..97705a2926a 100644 --- a/gcc/convert.c +++ b/gcc/convert.c @@ -349,6 +349,26 @@ convert_to_integer (tree type, tree expr) switch (fcode) { + case BUILT_IN_CEIL: case BUILT_IN_CEILF: case BUILT_IN_CEILL: + /* Only convert in ISO C99 mode. */ + if (!TARGET_C99_FUNCTIONS) + break; + if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node)) + fn = mathfn_built_in (s_intype, BUILT_IN_LLCEIL); + else + fn = mathfn_built_in (s_intype, BUILT_IN_LCEIL); + break; + + case BUILT_IN_FLOOR: case BUILT_IN_FLOORF: case BUILT_IN_FLOORL: + /* Only convert in ISO C99 mode. */ + if (!TARGET_C99_FUNCTIONS) + break; + if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node)) + fn = mathfn_built_in (s_intype, BUILT_IN_LLFLOOR); + else + fn = mathfn_built_in (s_intype, BUILT_IN_LFLOOR); + break; + case BUILT_IN_ROUND: case BUILT_IN_ROUNDF: case BUILT_IN_ROUNDL: if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (long_long_integer_type_node)) fn = mathfn_built_in (s_intype, BUILT_IN_LLROUND); @@ -367,6 +387,13 @@ convert_to_integer (tree type, tree expr) else fn = mathfn_built_in (s_intype, BUILT_IN_LRINT); break; + + case BUILT_IN_TRUNC: case BUILT_IN_TRUNCF: case BUILT_IN_TRUNCL: + { + tree arglist = TREE_OPERAND (s_expr, 1); + return convert_to_integer (type, TREE_VALUE (arglist)); + } + default: break; } diff --git a/gcc/coverage.c b/gcc/coverage.c index a4f4d001c13..0973d4ad886 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -1,6 +1,6 @@ /* Read and write coverage files, and associated functionality. Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, - 2000, 2001, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by James E. Wilson, UC Berkeley/Cygnus Support; based on some ideas from Dain Samples of UC Berkeley. Further mangling by Bob Manson, Cygnus Support. @@ -120,7 +120,22 @@ static tree build_ctr_info_type (void); static tree build_ctr_info_value (unsigned, tree); static tree build_gcov_info (void); static void create_coverage (void); + +/* Return the type node for gcov_type. */ + +tree +get_gcov_type (void) +{ + return lang_hooks.types.type_for_size (GCOV_TYPE_SIZE, false); +} + +/* Return the type node for gcov_unsigned_t. */ +static tree +get_gcov_unsigned_t (void) +{ + return lang_hooks.types.type_for_size (32, true); +} static hashval_t htab_counts_entry_hash (const void *of) @@ -165,7 +180,7 @@ read_counts_file (void) if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC)) { - warning ("%qs is not a gcov data file", da_file_name); + warning (0, "%qs is not a gcov data file", da_file_name); gcov_close (); return; } @@ -176,7 +191,7 @@ read_counts_file (void) GCOV_UNSIGNED2STRING (v, tag); GCOV_UNSIGNED2STRING (e, GCOV_VERSION); - warning ("%qs is version %q.*s, expected version %q.*s", + warning (0, "%qs is version %q.*s, expected version %q.*s", da_file_name, 4, v, 4, e); gcov_close (); return; @@ -330,7 +345,7 @@ get_coverage_counts (unsigned counter, unsigned expected, entry = htab_find (counts_hash, &elt); if (!entry) { - warning ("no coverage for function %qs found.", IDENTIFIER_POINTER + warning (0, "no coverage for function %qs found.", IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl))); return 0; } @@ -377,16 +392,17 @@ coverage_counter_alloc (unsigned counter, unsigned num) /* We don't know the size yet; make it big enough that nobody will make any clever transformation on it. */ char buf[20]; + tree gcov_type_node = get_gcov_type (); tree domain_tree = build_index_type (build_int_cst (NULL_TREE, 1000)); /* replaced later */ tree gcov_type_array_type - = build_array_type (GCOV_TYPE_NODE, domain_tree); + = build_array_type (gcov_type_node, domain_tree); tree_ctr_tables[counter] = build_decl (VAR_DECL, NULL_TREE, gcov_type_array_type); TREE_STATIC (tree_ctr_tables[counter]) = 1; ASM_GENERATE_INTERNAL_LABEL (buf, "LPBX", counter + 1); DECL_NAME (tree_ctr_tables[counter]) = get_identifier (buf); - DECL_ALIGN (tree_ctr_tables[counter]) = TYPE_ALIGN (GCOV_TYPE_NODE); + DECL_ALIGN (tree_ctr_tables[counter]) = TYPE_ALIGN (gcov_type_node); } fn_b_ctrs[counter] = fn_n_ctrs[counter]; fn_n_ctrs[counter] += num; @@ -399,8 +415,7 @@ coverage_counter_alloc (unsigned counter, unsigned num) rtx rtl_coverage_counter_ref (unsigned counter, unsigned no) { - unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1); - enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0); + enum machine_mode mode = mode_for_size (GCOV_TYPE_SIZE, MODE_INT, 0); rtx ref; gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]); @@ -412,7 +427,8 @@ rtl_coverage_counter_ref (unsigned counter, unsigned no) (tree_ctr_tables[counter])))); SYMBOL_REF_FLAGS (ctr_labels[counter]) = SYMBOL_FLAG_LOCAL; } - ref = plus_constant (ctr_labels[counter], gcov_size / BITS_PER_UNIT * no); + ref = plus_constant (ctr_labels[counter], + GCOV_TYPE_SIZE / BITS_PER_UNIT * no); ref = gen_rtx_MEM (mode, ref); set_mem_alias_set (ref, new_alias_set ()); MEM_NOTRAP_P (ref) = 1; @@ -425,18 +441,19 @@ rtl_coverage_counter_ref (unsigned counter, unsigned no) tree tree_coverage_counter_ref (unsigned counter, unsigned no) { + tree gcov_type_node = get_gcov_type (); tree domain_type = TYPE_DOMAIN (TREE_TYPE (tree_ctr_tables[counter])); gcc_assert (no < fn_n_ctrs[counter] - fn_b_ctrs[counter]); no += prg_n_ctrs[counter] + fn_b_ctrs[counter]; /* "no" here is an array index, scaled to bytes later. */ - return build4 (ARRAY_REF, GCOV_TYPE_NODE, tree_ctr_tables[counter], + return build4 (ARRAY_REF, gcov_type_node, tree_ctr_tables[counter], fold_convert (domain_type, build_int_cst (NULL_TREE, no)), TYPE_MIN_VALUE (domain_type), - size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (GCOV_TYPE_NODE), - size_int (TYPE_ALIGN_UNIT (GCOV_TYPE_NODE)))); + size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (gcov_type_node), + size_int (TYPE_ALIGN_UNIT (gcov_type_node)))); } /* Generate a checksum for a string. CHKSUM is the current @@ -564,7 +581,7 @@ coverage_end_function (void) if (bbg_file_opened > 1 && gcov_is_error ()) { - warning ("error writing %qs", bbg_file_name); + warning (0, "error writing %qs", bbg_file_name); bbg_file_opened = -1; } @@ -602,10 +619,10 @@ build_fn_info_type (unsigned int counters) tree array_type; /* ident */ - fields = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + fields = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); /* checksum */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; @@ -636,12 +653,12 @@ build_fn_info_value (const struct function_list *function, tree type) tree array_value = NULL_TREE; /* ident */ - value = tree_cons (fields, build_int_cstu (unsigned_intSI_type_node, + value = tree_cons (fields, build_int_cstu (get_gcov_unsigned_t (), function->ident), value); fields = TREE_CHAIN (fields); /* checksum */ - value = tree_cons (fields, build_int_cstu (unsigned_intSI_type_node, + value = tree_cons (fields, build_int_cstu (get_gcov_unsigned_t (), function->checksum), value); fields = TREE_CHAIN (fields); @@ -670,11 +687,11 @@ build_ctr_info_type (void) { tree type = lang_hooks.types.make_type (RECORD_TYPE); tree field, fields = NULL_TREE; - tree gcov_ptr_type = build_pointer_type (GCOV_TYPE_NODE); + tree gcov_ptr_type = build_pointer_type (get_gcov_type ()); tree gcov_merge_fn_type; /* counters */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; @@ -711,7 +728,7 @@ build_ctr_info_value (unsigned int counter, tree type) /* counters */ value = tree_cons (fields, - build_int_cstu (unsigned_intSI_type_node, + build_int_cstu (get_gcov_unsigned_t (), prg_n_ctrs[counter]), value); fields = TREE_CHAIN (fields); @@ -785,11 +802,11 @@ build_gcov_info (void) const_type = build_qualified_type (type, TYPE_QUAL_CONST); /* Version ident */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; - value = tree_cons (field, build_int_cstu (unsigned_intSI_type_node, - GCOV_VERSION), value); + value = tree_cons (field, build_int_cstu (TREE_TYPE (field), GCOV_VERSION), + value); /* next -- NULL */ field = build_decl (FIELD_DECL, NULL_TREE, build_pointer_type (const_type)); @@ -798,11 +815,11 @@ build_gcov_info (void) value = tree_cons (field, null_pointer_node, value); /* stamp */ - field = build_decl (FIELD_DECL, NULL_TREE, unsigned_intSI_type_node); + field = build_decl (FIELD_DECL, NULL_TREE, get_gcov_unsigned_t ()); TREE_CHAIN (field) = fields; fields = field; - value = tree_cons (field, build_int_cstu (unsigned_intSI_type_node, - local_tick), value); + value = tree_cons (field, build_int_cstu (TREE_TYPE (field), local_tick), + value); /* Filename */ string_type = build_pointer_type (build_qualified_type (char_type_node, diff --git a/gcc/coverage.h b/gcc/coverage.h index 033d3fdf120..ec33a3cd2df 100644 --- a/gcc/coverage.h +++ b/gcc/coverage.h @@ -47,4 +47,6 @@ extern gcov_type *get_coverage_counts (unsigned /*counter*/, unsigned /*expected*/, const struct gcov_ctr_summary **); +extern tree get_gcov_type (void); + #endif diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 85ce155906e..0fd719d9e77 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,681 @@ +2005-05-19 Jakub Jelinek + + PR c++/21495 + * decl.c (grokdeclarator): Fix "storage class specified for" + error reporting. + +2005-05-19 Kazu Hirata + + * parser.c: Fix comment typos. + +2005-05-18 Geoffrey Keating + + * Make-lang.in (cc1plus-dummy): New. + (cc1plus-checksum.c): New. + (cc1plus-checksum.o): New. + (cc1plus): Add cc1plus-checksum.o. + +2005-05-17 H.J. Lu + + PR C++/19664 + * decl2.c (determine_visibility): Don't set visibility to + hidden if it has been set explicitly by user. + +2005-05-17 Mike Stump + + Yet more Objective-C++... + + * cp-objcp-common.h (cxx_get_alias_set): Move from + here... + (cxx_warn_unused_global_decl): Likewise. + (cp_expr_size): Likewise. + (cp_tree_size): Likewise. + (cp_var_mod_type_p): Likewise. + (cxx_initialize_diagnostics): Likewise. + (cxx_types_compatible_p): Likewise. + * cp-tree.h: to here. + (do_poplevel): Add. + * lex.c (D_OBJC): Add. + (init_reswords): Add. + * Make-lang.in (cp/pt.o): Add cp/cp-objcp-common.h. + * parser.c: Add c-common.h include. + * pt.c: Add c-common.h and cp-objcp-common.h includes. + (template_args_equal): Use objc_comptypes as well. + (tsubst_copy_and_build): Use objcp_tsubst_copy_and_build as well. + * semantics.c (do_poplevel): Remove static. + + * decl.c (objc_mark_locals_volatile): Don't change decls that are + already ok. + * decl2.c (generate_ctor_or_dtor_function): Add code to initialize + Objective C++ early enough. + * lex.c (struct resword reswords): Add Objective-C++ support. + * parser.c (cp_lexer_get_preprocessor_token): Add Objective-C++. + (cp_parser_objc_message_receiver): Add. + (cp_parser_objc_message_args): Likewise. + (cp_parser_objc_message_expression): Likewise. + (cp_parser_objc_encode_expression): Likewise. + (cp_parser_objc_defs_expression): Likewise. + (cp_parser_objc_protocol_expression): Likewise. + (cp_parser_objc_selector_expression): Likewise. + (cp_parser_objc_expression): Likewise. + (cp_parser_objc_visibility_spec): Likewise. + (cp_parser_objc_method_type): Likewise. + (cp_parser_objc_protocol_qualifiers): Likewise. + (cp_parser_objc_typename): Likewise. + (cp_parser_objc_selector_p): Likewise. + (cp_parser_objc_selector): Likewise. + (cp_parser_objc_method_keyword_params): Likewise. + (cp_parser_objc_method_tail_params_opt): Likewise. + (cp_parser_objc_interstitial_code): Likewise. + (cp_parser_objc_method_signature): Likewise. + (cp_parser_objc_method_prototype_list): Likewise. + (cp_parser_objc_method_definition_list): Likewise. + (cp_parser_objc_class_ivars): Likewise. + (cp_parser_objc_identifier_list): Likewise. + (cp_parser_objc_alias_declaration): Likewise. + (cp_parser_objc_class_declaration): Likewise. + (cp_parser_objc_protocol_declaration): Likewise. + (cp_parser_objc_protocol_refs_opt): Likewise. + (cp_parser_objc_superclass_or_category): Likewise. + (cp_parser_objc_class_interface): Likewise. + (cp_parser_objc_class_implementation): Likewise. + (cp_parser_objc_end_implementation): Likewise. + (cp_parser_objc_declaration): Likewise. + (cp_parser_objc_try_catch_finally_statement): Likewise. + (cp_parser_objc_synchronized_statement): Likewise. + (cp_parser_objc_throw_statement): Likewise. + (cp_parser_objc_statement): Likewise. + (cp_parser_primary_expression): Add Objective-C++. + (cp_parser_statement): Likewise. + (cp_parser_declaration): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_type_name): Likewise. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_member_declaration) Likewise. + * tree.c: Include debug.h. + * typeck.c (composite_pointer_type): Add Objective-C++ support. + (finish_class_member_access_expr): Likewise. + (build_function_call): Allow objc to rewrite FUNCTION_DECLs. + (build_modify_expr): Allow objc to generate write barriers. + + * Make-lang.in (cp/tree.o): Add debug.h. + * tree.c (lvalue_p_1, case CONST_DECL): Add. + +2005-05-18 Jan Hubicka + + * method.c: Include tree-pass.h + (use_thunk): Lower body before expanding. + +2005-05-17 Jakub Jelinek + + PR c++/21454 + * decl.c (maybe_deduce_size_from_array_init): Call + cp_apply_type_quals_to_decl after completing array type. + +2005-05-16 Richard Henderson + + * decl.c (build_library_fn_1): Move setting TREE_NOTHROW ... + (build_library_fn): ... here. + +2005-05-12 Ian Lance Taylor + + * cp-tree.h (cp_stmt_codes): Don't define. + (statement_code_p): Declare. + (STATEMENT_CODE_P): Define. + * lex.c (statement_code_p): Define. + (cxx_init): Use actual codes in stmt_codes initializer, not + cp_stmt_codes macro. Initialize statement_code_p directly, rather + than using INIT_STATEMENT_CODES. + +2005-05-09 Mark Mitchell + + * typeck.c (build_unary_op): Do not resort to address arithmetic + when taking the address of a COMPONENT_REF. + +2005-05-08 Kazu Hirata + + * class.c (vtbl_init_data_s): Change the type of fns to + VEC(tree,gc)*. + (build_vtbl_initializer, add_vcall_offset, add_vcall_offset): + Use VEC instead of VARRAY. + +2005-05-07 Richard Sandiford + + * mangle.c: Remove a reference to the MIPS -mint64 option. + +2005-05-07 Kazu Hirata + + * decl.c (wrapup_globals_for_namespace): Use VEC instead of + VARRAY. + * name-lookup.c (add_decl_to_level, begin_scope): Likewise. + * name-lookup.h (cp_binding_level): Change the type of + static_decls to VEC(tree,gc)*. + + * mangle.c (globals): Change the type of substitutions to + VEC(tree,gc)*. + (dump_substitution_candidates, add_substitution, + find_substitution, finish_mangling, init_mangle): Use VEC + instead of VARRAY. + +2005-05-06 Kazu Hirata + + * decl2.c (spew_debug): Remove. + + * decl2.c (ssdf_decls, start_static_storage_duration_function, + generate_ctor_or_dtor_function): Use VEC instead of VARRAY. + + * decl2.c (pending_statics, note_vague_linkage_var, + cp_finish_file): Use VEC instead of VARRAY. + (pending_statics_used): Remove. + +2005-05-05 Kazu Hirata + + * decl2.c (deferred_fns, note_vague_linkage_fn, + cp_finish_file): Use VEC instead of VARRAY. + +2005-05-05 Mark Mitchell + + PR c++/21352 + * pt.c (build_non_dependent_expr): Use is_overloaded_fn. + +2005-05-05 Kazu Hirata + + * pt.c: Fix a comment typo. + +2005-05-04 Kazu Hirata + + * cp-tree.h (language_function): Change the type of + x_local_names to VEC. + * decl.c (push_local_name): Adjust uses of local_names. + +2005-05-03 Kazu Hirata + + * friend.c, lex.c, mangle.c, repo.c: Update copyright. + +2005-05-02 Kazu Hirata + + * class.c (local_classes, init_class_processing): Use VEC + instead of VARRAY. + * cp-tree.h (local_classes): Likewise. + * mangle.c (discriminator_for_local_entity): Likewise. + * name-lookup.c (pushtag): Likewise. + + * class.c (current_lang_depth, push_lang_context, + pop_lang_context): Use VEC instead of VARRAY. + * cp-tree.h (saved_scope): Use VEC for lang_base instead of + VARRAY. + * name-lookup.c (push_to_top_level): Use VEC instead of + VARRAY. + +2005-05-02 Paolo Bonzini + + * semantics.c (finish_call_expr): Call resolve_overloaded_builtin + for BUILT_IN_MD built-ins. + +2005-05-02 Michael Matz + + PR c++/19542 + * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C + common frontend. + (null_node): Remove. + * lex.c (cxx_init): Move null_node initialisation to C common frontend. + +2005-04-25 Ian Lance Taylor + + * cp-tree.def: Add EXPR_STMT. + * cp-tree.h (cp_stmt_codes): Add EXPR_STMT. + (EXPR_STMT_EXPR): Define. + * cp-gimplify.c: Include "flags.h". + (gimplify_expr_stmt): New static function. + (cp_gimplify_expr): Handle EXPR_STMT. + * cxx-pretty-print.c (pp_cxx_statement): Use pp_cxx_expression + rather than pp_expression. + (pp_cxx_statement): Handle EXPR_STMT. + * dump.c (cp_dump_tree): Handle EXPR_STMT. + * lex.c (cxx_init): Don't use c_common_stmt_codes in stmt_codes + initializer. + +2005-04-25 Andrew Pinski + + PR C++/21188 + * rtti.c (ifnonnull): Cast the zero comparison operand + to the correct type. + +2005-04-24 Jakub Jelinek + + PR middle-end/20991 + * class.c: Include cgraph.h. + (cp_fold_obj_type_ref): Set node->local.vtable_method. + * Make-lang.in (cgraph.o): Depend on $(CGRAPH_H). + +2005-04-12 Markus F.X.J. Oberhumer + + * mangle.c (write_builtin_type): Handle integer types which are + not one of the shared integer type nodes and emit a "vendor + extended builtin type" with an encoding in the form of "u5int96". + +2005-04-24 Ian Lance Taylor + + * cp-tree.def (USING_STMT): Change class to tcc_statement. + (TRY_BLOCK, EH_SPEC_BLOCK, HANDLER, CLEANUP_STMT): Likewise. + (IF_STMT, FOR_STMT, WHILE_STMT, DO_STMT): Likewise. + (BREAK_STMT, CONTINUE_STMT, SWITCH_STMT): Likewise. + +2005-04-23 DJ Delorie + + * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, friend.c, + init.c, lex.c, mangle.c, method.c, name-lookup.c, parser.c, + repo.c, rtti.c, tree.c, typeck.c, typeck2.c: Adjust warning() + callers. + +2005-04-22 Per Bothner + + * decl.c (make_rtl_for_nonlocal_decl): Don't try get_fileinfo if + input_filename is NULL, as it is for (say) __PRETTY_FUNCTION__. + +2005-04-22 Alexandre Oliva + + PR c++/21087 + * name-lookup.c (push_overloaded_decl): Do not overload with + non-duplicate anticipated built-in. + +2005-04-21 Kazu Hirata + + * cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT, + VTABLE_BASE, VTABLE_NAME_PREFIX, STATIC_NAME_FORMAT): Remove. + +2005-04-21 Nathan Sidwell + + * cp-tree.h: Adjust for new VEC API. + Define VEC(tree_pair_s,gc). + (struct save_scope): Adjust. + (struct lang_type_class): Adjust. + (unemitted_tinfo_decls): Adjust. + * class.c (add_method, resort_type_method_vec, + finish_struct_methods, struct find_final_overrider_data, + dfs_find_final_overrider_pre, find_final_overrider, + get_vcall_index, warn_hidden, walk_subobject_offsets, + check_methods, fixup_inline_methods, end_of_class, + warn_about_ambiguous_bases, finish_struct, build_vtbl_initializer, + add_vcall_offset): Adjust. + * decl.c (xref_basetypes, finish_method): Adjust. + * decl2.c (check_classfn): Adjust. + * init.c (sort_mem_initializers, push_base_cleanups): Adjust. + * method.c (do_build_copy_constructor): Adjust. + * name-lookup.c (new_class_binding, store_binding, + store_bindings, store_class_bindings): Adjust. + * name-lookup.h: Define VEC(cxx_saved_binding,gc), + VEC(cp_class_binding,gc). + (struct cp_binding_level): Adjust. + * parser.c: Define VEC(cp_token_position,heap). + (struct cp_lexer): Adjust. + (cp_lexer_new_main, cp_lexer_new_from_tokens, cp_lexer_destroy, + cp_lexer_save_tokens): Adjust. + * pt.c (retrieve_specialization, + check_explicit_specialization): Adjust. + * rtti.c (unemitted_tinfo_decls): Adjust. + (init_rtti_processing, get_tinfo_decl, get_pseudo_ti_init, + get_pseudo_ti_desc): Adjust. + * search.c (dfs_access_in_type, lookup_conversion_operator, + lookup_fnfields_1, dfs_walk_once, dfs_walk_once_accessible, + dfs_get_pure_virtuals, lookup_conversions_r, binfo_for_vbase): Adjust. + * semantics.c: Define VEC(deferred_access,gc). + (push_deferring_access_checks): Adjust. + * typeck2.c (abstract_virtuals_error): Adjust. + +2005-04-20 Ian Lance Taylor + + * cp-tree.def: Add STMT_EXPR. + * cp-tree.h (STMT_EXPR_NO_SCOPE): Define. + (STMT_EXPR_STMT): Define. + * cxx-pretty-print.c (pp_cxx_primary_expression): Handle + STMT_EXPR. + (pp_cxx_expression): Likewise. + (pp_cxx_statement): Call pp_cxx_statement, not pp_statement. + * dump.c (cp_dump_tree): Handle STMT_EXPR. + +2005-04-18 Kazu Hirata + + * decl.c (expand_static_init): Call build2 and build3 instead + of build. + + * cp-tree.h (VPTR_NAME, VPTR_NAME_P): Remove. + +2005-04-17 Ian Lance Taylor + + * cp-tree.def: Add SIZEOF_EXPR, ARROW_EXPR and ALIGNOF_EXPR. + * cxx-pretty-print.c (pp_cxx_postfix_expression): Handle + ARROW_EXPR. + (pp_cxx_unary_expression): Handle SIZEOF_EXPR and ALIGNOF_EXPR. + (pp_cxx_expression): Handle ARROW_EXPR, SIZEOF_EXPR, and + ALIGNOF_EXPR. + * typeck.c (cxx_sizeof_or_alignof_type): Update call to + c_sizeof_or_alignof_type for change in parameter type. + +2005-04-16 Mark Mitchell + + PR c++/21025 + * typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to + which sizeof/alignof is dependent, rather than just whether we are + processing_template_decl. + +2005-04-17 Kazu Hirata + + * cp-tree.h (LOOKUP_GLOBAL): Remove. + (LOOKUP_ONLYCONVERTING, DIRECT_BIND, LOOKUP_NO_CONVERSION, + LOOKUP_DESTRUCTOR, LOOKUP_NO_TEMP_BIND, LOOKUP_PREFER_TYPES, + LOOKUP_PREFER_NAMESPACES, LOOKUP_CONSTRUCTOR_CALLABLE): Adjust + their values. + +2005-04-15 Richard Henderson + + PR middle-end/14311 + * semantics.c (finish_call_expr): Call resolve_overloaded_builtin. + +2005-04-15 Kazu Hirata + + * cp-tree.h (lang_type_class): Remove redefined. Move + java_interface into where redefined was. Increment the width + of dummy. + (TYPE_REDEFINED): Remove. + +2005-04-14 Kazu Hirata + + * cp-tree.h (SET_TMPL_ARG, ENUM_TI_TEMPLATE, ENUM_TI_ARGS, + CLASSTYPE_TEMPLATE_LEVEL): Remove. + +2005-04-11 Mark Mitchell + + * decl2.c (determine_visibility): Don't use export_class_data. + (import_export_decl): Honor TARGET_CXX_CLASS_DATA_ALWAYS_WEAK and + TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY. + +2005-04-09 Kazu Hirata + + * cp-tree.h (cxx_alignof): Remove. + + * cp-tree.h (DECL_ARRAY_DELETE_OPERATOR_P): Remove. + + * cp-tree.h (EXCEPTION_CLEANUP_NAME, B_SET, B_CLR, B_TST, + CONV_STATIC_CAST): Remove. + + * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Remove. + + * cp-tree.h (VF_BINFO_VALUE, VF_BASETYPE_VALUE): Remove. + + * cp-tree.h (cp_deprecated): Remove. + +2005-04-08 Ian Lance Taylor + + * cp-tree.def: Define FOR_STMT, WHILE_STMT, DO_STMT, BREAK_STMT, + CONTINUE_STMT, SWITCH_STMT. + * cp-tree.h (cp_stmt_codes): Add FOR_STMT, WHILE_STMT, DO_STMT, + BREAK_STMT, CONTINUE_STMT, SWITCH_STMT. + (WHILE_COND, WHILE_BODY): Define. + (DO_COND, DO_BODY): Define. + (FOR_INIT_STMT, FOR_COND, FOR_EXPR, FOR_BODY): Define. + (SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE): Define. + * cp-gimplify.c (enum bc_t): Define. + (struct cp_gimplify_ctx, ctxp): Define. + (push_context, pop_context): New static functions. + (begin_bc_block, finish_bc_block): New static functions. + (build_bc_goto): New static function. + (gimplify_cp_loop, gimplify_for_stmt): New static functions. + (gimplify_while_stmt, gimplify_do_stmt): Likewise. + (gimplify_switch_stmt): Likewise. + (cp_gimplify_expr): Handle FOR_STMT, WHILE_STMT, DO_STMT, + SWITCH_STMT, CONTINUE_STMT, BREAK_STMT. + (cp_genericize): Call push_context and pop_context. + * semantics.c (finish_break_stmt): Just call build_stmt + (BREAK_STMT) rather than build_break_stmt. + (finish_continue_stmt): Corresponding change. + * decl.c (pop_switch): Update call to c_do_switch_warnings for new + parameters. + * cxx-pretty-print.c (pp_cxx_statement): Handle SWITCH_STMT, + WHILE_STMT, DO_STMT, FOR_STMT, BREAK_STMT, CONTINUE_STMT. + * dump.c (cp_dump_tree): Likewise. + +2005-04-08 Mark Mitchell + + PR c++/20905 + * parser.c (cp_parser_type_specifier_seq): Add is_condition + parameter. + (cp_parser_new_type_id): Pass it. + (cp_parser_condition): Likewise. + (cp_parser_conversion_type_id): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_type_specifier_seq): In a condition, do not allow + invalid type-specifier combinations. + (cp_parser_exception_declaration): Adjust call to + cp_parser_type_specifier_seq. + + * cp-tree.def (TINST_LEVEL): Document TINST_IN_SYSTEM_HEADER_P. + * cp-tree.h (struct tinst_level): Add in_system_header_p. + (TINST_IN_SYSTEM_HEADER_P): New macro. + (make_tinst_level): Remove. + * pt.c (lookup_template_class): Preserve DECL_IN_SYSTEM_HEADER on + the instantiated class. + (push_tinst_level): Do not use make_tinst_level. Set + TINST_IN_SYSTEM_HEADER_P. + (pop_tinst_level): Likewise. + (instantiate_class_template): Set in_system_header. + (instantiate_pending_templates): Likewise. + * tree.c (make_tinst_level): Remove. + +2005-04-06 Joseph S. Myers + + * decl.c (start_decl): Apply pending #pragma weak regardless of + scope. + +2005-04-06 Mark Mitchell + + PR c++/20212 + * pt.c (regenerate_decl_from_template): Copy attributes for + parameters from the pattern to the instantiation. + +2005-04-05 Mark Mitchell + + PR c++/20734 + * cp-tree.def (OFFSET_REF): Correct comments. + * init.c (build_offset_ref): Remove misleading comment. + * typeck.c (build_unary_op): Handle pointer-to-member creation + here, rather than ... + (unary_complex_lvalue): ... here. + +2005-04-06 Jason Merrill + + PR c++/19312 + * tree.c (stabilize_init): Don't bother trying to stabilize + something with no side-effects. + +2005-04-05 Mark Mitchell + + PR c++/20763 + * decl.c (grokdeclarator): Correct attribute handling. + +2005-04-05 Mark Mitchell + + PR c++/19159 + * decl2.c (import_export_decl): Use non-COMDAT external linkage + for virtual tables, typeinfo, etc. that will be emitted in only + one translation unit on systems without weak symbols. + +2005-04-04 Mark Mitchell + + PR c++/20679 + * parser.c (cp_parser_template_name): Fix thinko. + +2005-04-04 Nathan Sidwell + + PR c++/20746 + * method.c (use_thunk): Protect covariant pointer return + adjustments from NULL pointers. + +2005-04-04 Jan Hubicka + + * decl2.c (finish_objects): Revert my previous patch. + (cp_finish_file): Likewise. + +2005-04-03 Kazu Hirata + + * pt.c: Fix comment typos. + +2005-04-03 Nathan Sidwell + + PR c++/20723 + * pt.c (more_specialized_fn): Member functions are unordered wrt + non-members. Conversion operators are unordered wrt other + functions. + +2005-04-01 Nathan Sidwell + + * call.c (add_template_candidates_real): Remove length parameter + from fn_type_unification call. + * class.c (resolve_address_of_overloaded_function): Likewise + * cp-tree.h (fn_type_unification): Remove length parameter. + * pt.c (get_bindings_overload): Remove. + (get_bindings_real): Rename to ... + (get_bindings): ... here. Remove length and strict + parameters. Change return type flag to boolean. Remove original + forwarding function. + (determine_specialization): Adjust get_bindings call. + (fn_type_unification): Remove length parameter. Adjust. + (type_unification_real): Remove length parameter. Adjust. + (resolve_overloaded_unification): Adjust get_bindings call. + (try_one_overload): Simplify confusing cascaded if control flow. + (unify): Remove length paramter from type_unification_real call. + (most_specialized_instantiation): Adjust get_bindings calls. + (most_specialized): Likewise. + +2005-03-31 Nathan Sidwell + + PR c++/19203, implement DR 214 + * call.c (joust): Use more_specialized_fn. + * cp-tree.h (DEDUCE_ORDER): Remove. + (more_specialized): Replace with ... + (more_specialized_fn): ... this. + * pt.c (maybe_adjust_types_for_deduction): Remove DEDUCE_ORDER + case. + (type_unification_real): Remove DEDUCE_ORDER case. + (more_specialized): Replace with ... + (more_specialized_fn): ... this. Implement DR 214. + (most_specialized_instantiation): Use get_bindings_real directly. + +2005-03-31 Gabriel Dos Reis + + PR c++/18644 + * call.c (build_new_op): Remove check for -Wsynth. + +2005-03-31 Jan Hubicka + + * decl2.c (finish_objects): Mark ctor as needed. + (cp_finish_file): Output variables only in nonunit-at-a-time. + +2005-03-29 Richard Henderson + + PR c/20519 + * decl.c (cp_complete_array_type): Rename from complete_array_type. + Use the new complete_array_type in c-common.c. Update all callers. + * cp-tree.h (cp_complete_array_type): Update to match. + +2005-03-24 Geoffrey Keating + + * typeck.c (build_static_cast_1): Allow scalar_cast between + any integral, floating, or enumeration type. + +2005-03-24 Steven Bosscher + + * typeck.c (comptypes): First determine if the types are compatible + from a target-independent point of view. Check target attributes + last. + + * class.c (build_base_path): + (build_vbase_offset_vtbl_entries): + (add_vcall_offset): Replace fold (buildN (...)) with fold_buildN. + * error.c (dump_expr): Likewise. + * init.c (build_zero_init, expand_cleanup_for_base, + build_vec_delete_1): Likewise. + * mangle.c (write_integer_cst): Likewise. + * method.c (thunk_adjust): Likewise. + * pt.c (convert_nontype_argument, tsubst, unify): Likewise. + * tree.c (cxx_print_statistics, array_type_nelts_total): Likewise. + * typeck.c (build_ptrmemfunc_access_expr, + (get_member_function_from_ptrfunc): Likewise. + +2005-03-23 Joseph S. Myers + + * cp-objcp-common.h (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-23 Joseph S. Myers + + * cp-tree.h (perform_integral_promotions): Remove. + (default_conversion): Add. + +2005-03-22 Mark Mitchell + + * parser.c (cp_parser_warn_min_max): New function. + (cp_parser_binary_expression): Use it. + (cp_parser_assignment_operator_opt): Likewise. + (cp_parser_operator): Likewise. + +2005-03-22 Volker Reichelt + + PR c++/19980 + * decl.c (start_preparsed_function): Robustify. + +2005-03-22 Volker Reichelt + + PR c++/20499 + * parser.c (cp_parser_class_head): Return NULL_TREE when + encountering a redefinition. + +2005-03-22 Nathan Sidwell + + PR c++/20465 + PR c++/20381 + * typeck.c (build_ptrmemfunc): Allow OFFSET_REF when processing a + template. + +2005-03-21 Paolo Carlini + + PR c++/20461 + PR c++/20536 + * init.c (emit_mem_initializers): Don't crash on undefined + types. + +2005-03-21 Paolo Carlini + + PR c++/20147 + * semantics.c (finish_stmt_expr_expr): Return immediately + if error_operand_p (expr). + +2005-03-21 Joseph S. Myers + + * cp-tree.h (lvalue_or_else, lvalue_p): New. + * typeck.c (lvalue_or_else): New. Call lvalue_error. + +2005-03-19 Kriang Lerdsuwanakij + + PR c++/20240 + * decl.c (decls_match): Compare context of VAR_DECL. + +2005-03-19 Kriang Lerdsuwanakij + + PR c++/20333 + * parser.c (cp_parser_postfix_expression) : + Check the return value of cp_parser_nested_name_specifier. + +2005-03-18 Dale Johannesen + + * cp/tree.c (cp_tree_equal): Handle SSA_NAME. + +2005-03-18 Paolo Carlini + + PR c++/20463 + * parser.c (cp_parser_diagnose_invalid_type_name): + Check TYPE_BINFO (current_class_type) before attempting + to emit inform messages. + 2005-03-17 Paolo Carlini PR c++/19966 @@ -220,7 +898,7 @@ Add qualifiers when declaring a typedef of a function type. Member function pointers pick up the qualifiers of the typedef used to declare them. - Don't complain about creating cv-qualified function types. + Don't complain about creating cv-qualified function types. Complain about qualified function typedefs that are used to declare non-static member functions or free functions. Use cp_apply_type_quals_to_decl. diff --git a/gcc/cp/ChangeLog-1993 b/gcc/cp/ChangeLog-1993 new file mode 100644 index 00000000000..074a7d2d8d2 --- /dev/null +++ b/gcc/cp/ChangeLog-1993 @@ -0,0 +1,606 @@ +Tue Dec 28 21:10:03 1993 Mike Stump + + * cp-init.c (expand_vec_init): Remove comptypes test, as it is too + harsh here. + +Tue Dec 28 13:42:22 1993 Mike Stump + + * cp-pt.c (do_pending_expansions): Decide to expand a template + member function, based upon it's class type, not the class type of + the first place it was declared. + +Tue Dec 28 05:42:31 1993 Mike Stump + + * cp-class.c (is_normal): New routine, use to determine when the + given binfo is the normal one. (The one that should have the simple + vtable name.) + * cp-class.c (modify_other_vtable_entries): Use DECL_ASSEMBLER_NAME + to check if two fndecls are `the same'. Sometimes this routine can + modify the main vtable, and normal should be 1, in that case, so use + is_normal() to determine if this is the main vtable for the class. + Don't recurse down virtual bases, as they are shared, and we take + care of them elsewhere. + * cp-class.c (modify_vtable_entries): If we have already updated the + vtable with the new virtual, don't do it again. + * cp-class.c (finish_struct): Set CLASSTYPE_VFIELD_PARENT as + appropriate. Do virtual function overriding in virtual bases, after + normal overriding, so that the base function list in DECL_VINDEX is + not overridden, before we have a chance to run through the list. + Use DECL_ASSEMBLER_NAME to check if two fndecls are `the same'. + Make sure we pass the right address into modify_vtable_entries. + * cp-tree.h (CLASSTYPE_VFIELD_PARENT): New field to indicate which + binfo is the one that has the vtable that we based our vtable on. + +Fri Dec 24 09:40:52 1993 Michael Tiemann + + * cp-typeck.c (c_expand_start_case): Use default_conversion to + convert expression from reference type if necessary. + +Wed Dec 22 17:58:43 1993 Jason Merrill + + * cp-typeck.c (build_unary_op): Make sure that it's a TREE_LIST before + trying to read its TREE_VALUE. + + * cp-class.c (finish_struct_methods): Clear DECL_IN_AGGR_P here. + (finish_struct): Instead of here. + +Tue Dec 21 14:34:25 1993 Brendan Kehoe + + * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't + have TYPE_PTRMEMFUNC_P set before we try to build its + CLASSTYPE_ID_AS_LIST. + (get_decl_list): Likewise, when trying to read it. + + * cp-tree.h (VTABLE_NAME): No def with NO_{DOLLAR,DOT} defined. + (VTABLE_NAME_P): Use it instead of VTABLE_NAME_FORMAT. + +Mon Dec 20 13:35:03 1993 Brendan Kehoe + + * cp-typeck.c (rationalize_conditional_expr): New function. + (unary_complex_lvalue): Use it. + (build_modify_expr): Use it, since trying to do an ADDR_EXPR of it + with build_unary_op won't cut it. Don't wrap the COND_EXPR with a + SAVE_EXPR either. + + * cp-decl2.c (explicit_warn_return_type): Deleted variable. + (lang_decode_option): Set warn_return_type, not explicit_*, for + -Wreturn-type and -Wall. This is what rest_of_compilation uses to + decide if it should go into jump_optimize or not. + * cp-tree.h (explicit_warn_return_type): Deleted. + * cp-decl.c (grokdeclarator): Use warn_return_type, not explicit_*. + (finish_function): Also complain about no return in a non-void fn if + we're being pedantic (don't rely on use of -Wreturn-type). + +Fri Dec 17 15:45:46 1993 Brendan Kehoe + + * cp-decl.c (grokdeclarator): Forbid declaration of a function as + static if it's being done inside another function. + + * cp-search.c (compute_visibility): Check for friendship both ways. + +Fri Dec 17 14:28:25 1993 Jason Merrill + + * cp-cvt.c (build_default_binary_type_conversion): Make error + messages more helpful. + + * cp-error.c (op_as_string): New function, returns "operator ==" + given EQ_EXPR or suchlike. + +Fri Dec 17 13:28:11 1993 Brendan Kehoe + + * cp-call.c (print_n_candidates): New function. + (build_overload_call_real): Use it when we complain about a call + being ambiguous. + +Fri Dec 17 12:41:17 1993 Jason Merrill + + * cp-call.c (build_method_call): Fix checking for static call + context. + + * cp-method.c (build_opfncall): Call build_indirect_ref on argument + to operator new. + + * cp-init.c (build_new): Don't mess with rval when building + indirect ref. + +Thu Dec 16 16:48:05 1993 Kung Hsu + + * cp-lex.c (default_assign_ref_body): Add check when TYPE_NESTED_ + NAME(type) may not be exist. It's not a problem for old compiler. + +Thu Dec 16 14:46:06 1993 Brendan Kehoe + + * cp-tree.h (CLASSTYPE_ALTERS_VISIBILITIES_P): Delete macro, it's + never used for anything. + (struct lang_type, member type_flags): Delete field + `alters_visibility', and up `dummy' by 1. + * cp-class.c (finish_base_struct): Delete code that copies the + setting of CLASSTYPE_ALTERS_VISIBILITIES_P. + (finish_struct): Delete code that sets it. + +Thu Dec 16 14:44:39 1993 Jason Merrill + + * cp-decl.c, cp-init.c, cp-typeck.c: Fix arguments to + build_method_call that I messed up before. + + * cp-search.c (get_base_distance): If protect > 1, allow immediate + private base. + + * cp-class.c (finish_base_struct): Set cant_synth_* correctly. + (finish_struct): Likewise. Well, nigh-correctly; it won't deal + properly with the case where a class contains an object of an + ambiguous base class which has a protected op=. Should be fixed + when the access control code gets overhauled. + (finish_struct_methods): Set TYPE_HAS_NONPUBLIC_* correctly. + +Thu Dec 16 12:17:06 1993 Brendan Kehoe + + * cp-lex.c (real_yylex): Turn the code back on that deals with + __FUNCTION__ and __PRETTY_FUNCTION__. Don't use lookup_name, to + avoid the ambiguity problems that led to it being turned off in the + first place. + + * cp-method.c (hack_identifier): Also check for a TYPE_PTRMEMFUNC_P + to see if something is a method. + +Wed Dec 15 18:35:58 1993 Mike Stump + + * cp-typeck.c (build_modify_expr): Avoid error messages on small + enum bit fields. + * cp-typeck.c (convert_for_assignment): Add missing argument to + cp_warning and cp_pedwarn calls. + +Wed Dec 15 18:25:32 1993 Jason Merrill + + * cp-parse.y (member_init): ANSI C++ doesn't forbid old-style base + initializers; it's just anachronistic. + + * cp-decl.c (finish_decl): Don't require external-linkage arrays + to have a complete type at declaration time when pedantic. + +Tue Dec 14 11:37:23 1993 Jason Merrill + + * cp-decl.c (pushdecl): Don't set DECL_CONTEXT if it's already set. + + * cp-call.c (build_method_call): Don't dereference pointer given + as instance. + + * cp-decl.c (finish_function): Don't pass pointer to + build_method_call. + (finish_function): Likewise. + + * cp-typeck.c (build_x_function_call): Likewise. + + * cp-method.c (build_component_type_expr): Likewise. + + * cp-init.c (build_member_call): Likewise. + (build_new): Likewise. + +Mon Dec 13 18:04:33 1993 Kung Hsu + + * cp-decl.c (xref_tag): Fix regression created by changes made + in Dec. 7 1993. + * cp-decl.c (xref_defn_tag): Fix parallel nested class problem. + +Fri Dec 10 12:40:25 1993 Brendan Kehoe + + * cp-call.c (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print + out the final evaluation of the function, so we can see if ELLIPSIS, + USER, and EVIL were set at the end. + + * cp-call.c (convert_harshness_ansi): When the parm isn't an lvalue, + only go for setting TRIVIAL_CODE if we are dealing with types that + are compatible. + +Thu Dec 9 18:27:22 1993 Mike Stump + + * cp-decl.c (flag_huge_objects): New flag to allow large objects. + * toplev.c (lang_options): Likewise. + * cp-decl2.c (flag_huge_objects, lang_f_options): Likewise. + * cp-decl.c (delta_type_node): New type for delta entries. + * cp-tree.h (delta_type_node): Likewise. + * cp-decl.c (init_decl_processing): Setup delta_type_node. + * cp-decl.c (init_decl_processing, build_ptrmemfunc_type): Use + delta_type_node instead of short_integer_type_node. + * cp-class.c (build_vtable_entry): Likewise. + +Thu Dec 9 16:19:05 1993 Brendan Kehoe + + * cp-tree.h (OPERATOR_TYPENAME_P): Define outside of + NO_{DOLLAR,DOT} macro checks, so it always gets defined. + (VTABLE_NAME_P): Define for NO_DOT && NO_DOLLAR_IN_LABEL. + +Wed Dec 8 17:38:06 1993 Mike Stump + + * cp-decl.c (finish_decl): Make sure things that can go into + "common", do go into common, if -fcommon is given. + +Wed Dec 8 13:01:54 1993 Brendan Kehoe + + * cp-call.c (print_harshness) [DEBUG_MATCHING]: New function. + (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print out + argument matching diagnostics to make instantly clear what the + compiler is doing. + + * cp-call.c (convert_harshness_ansi): If the parm isn't an lvalue, + then check to see if the penalty was increased due to + signed/unsigned mismatch, and use a TRIVIAL_CODE if it wasn't. + +Tue Dec 7 18:29:14 1993 Kung Hsu + + * cp-decl.c (xref_tag, pushtag): Fix nested class search/resolution + problem. + +Tue Dec 7 16:09:34 1993 Jason Merrill + + * cp-class.c (finish_struct): Before synthesizing methods, if no + methods have yet been declared then set nonprivate_method. Don't + set non_private method after synthesizing a method. + + * cp-lex.c (extract_interface_info): If flag_alt_external_templates + is set, tie emitted code to the location of template instantiation, + rather than definition. + + * cp-tree.h: Declare flag_alt_external_templates. + + * cp-decl2.c (lang_decode_option): Support -falt-external-templates. + + * toplev.c (lang_options): Likewise. + +Mon Oct 4 12:50:02 1993 Chip Salzenberg + + [changes propagated from 930810 snapshot] + * cp-decl.c (init_decl_processing): Make long long available for use + as SIZE_TYPE and PTRDIFF_TYPE. + (finish_decl): Allow file-scope static incomplete array. + (grokdeclarator): Don't pass on const and volatile fron function + value type to function type. + Warn here for volatile fn returning non-void type. + * cp-parse.y (attrib): Accept attributes `volatile' with alias + `noreturn', and `const'. + * cp-typeck.c (default_conversion): Don't lose const and volatile. + (build_binary_op_nodefault): Generate pedantic warning for comparison + of complete pointer type with incomplete pointer type. + (build_c_cast): Be careful that null pointer constant be INTEGER_CST. + +Tue Dec 7 10:46:48 1993 Jason Merrill + + * cp-init.c (expand_vec_init): When creating a temporary for copying + arrays, use the type of the source, not the target. + + * cp-cvt.c (convert): Pass an argument for errtype to + convert_to_reference. + + * cp-error.c (dump_expr, COMPONENT_REF & CALL_EXPR): Deal with + methods, -> and `this'. + +Mon Dec 6 17:12:33 1993 Jason Merrill + + * cp-error.c (parm_as_string): New function; returns `this' or arg + number. Corresponds to %P. + (dump_expr): Deal with method calls. + + * cp-cvt.c (convert_to_reference): Stop using warn_for_assignment. + * cp-typeck.c (convert_for_assignment): Likewise. + (warn_for_assignment): Lose. + +Mon Dec 6 11:33:35 1993 Brendan Kehoe + + * cp-call.c (ideal_candidate_ansi): Delete code that was never + doing anything useful. Instead, sort once, and DO NOT wipe + out any codes with EVIL_CODE, since that's what we use as a + marker for the end of the list of candidates. + + * cp-cvt.c (convert_to_aggr): Make sure to always set H_LEN. + +Mon Dec 6 12:49:17 1993 Jason Merrill + + * cp-init.c (get_aggr_from_typedef): New function, like + is_aggr_typedef but returns the _TYPE. + + * cp-call.c, cp-init.c, cp-method.c: Eradicate err_name. + +Sun Dec 5 18:12:48 1993 Brendan Kehoe + + * cp-lex.c (readescape): Pedwarn when a hex escape is out of range. + +Thu Nov 25 23:50:19 1993 Chip Salzenberg + + Delay language context change until beginning of next decl. + + * cp-lex.h (c_header_level): Removed. + (pending_lang_change): Declared. + * cp-lex.c (c_header_level): Renamed from in_c_header, made static. + (pending_lang_change): Defined. + (check_newline): Rework code that recognizes line number and + filename changes. Instead of pushing and popping lang context, + increment and decrement pending_lang_change. + (do_pending_lang_change): Push and pop lang context according + to value of pending_lang_change. + * cp-parse.y (extdefs): Use lang_extdef instead of extdef. + (extdef): Same as extdef, but call do_pending_lang_change() first. + +Mon Nov 15 15:39:15 1993 Chip Salzenberg + + * cp-typeck.c (build_binary_op_nodefault): Warn for ordered + compare of ptr with 0 only if pedantic in both cases. + +Thu Nov 25 13:31:37 1993 Chip Salzenberg + + Reinstate the below patch, which got lost in the Cygnus merge: + Tue Nov 23 13:59:24 1993 Hallvard B Furuseth (hbf@durin.uio.no) + * cp-parse.y (maybe_type_qual): Don't fail to set $$. + +Wed Nov 17 19:03:30 1993 Chip Salzenberg + + * cp-parse.y (attrib): Allow "ident(ident)" like the C front end. + +Fri Oct 22 20:43:37 1993 Paul Eggert + + * cp-lex.c (real_yylex): Diagnose floating point constants + that are too large. + +Wed Nov 17 19:10:37 1993 Chip Salzenberg + + * cp-type2.c (build_functional_cast): ARM page 16: When a class + and an object, function or enumerator are declared in the same + scope with the same name, the class name is hidden. + +Wed Nov 17 19:07:18 1993 Chip Salzenberg + + * cp-call.c (convert_harshness_ansi): Distinguish float, double, + and long double from each other when overloading. + (compute_conversion_costs_{ansi,old}, build_method_call, + build_overlay_call_real, convert_to_aggr): Always set and + always use H_LEN member of candidate structure. + +Mon Oct 11 23:10:53 1993 Chip Salzenberg + + * cp-decl.c (duplicate_decls): Note redeclarations of library + functions, and generate distinct warnings for them. + +Mon Oct 4 12:26:49 1993 Chip Salzenberg + + Support format warnings in G++. + + * cp-tree.h: Protect against multiple inclusion. + Declare all public functions in c-common.c (copy from c-tree.h). + (STDIO_PROTO): Define. + (warn_format): Declare. + (record_format_info): Remove declaration. + * cp-decl.c (init_decl_processing): Call init_function_format_info. + * cp-decl2.c (lang_decode_option): Make "-Wall" include warn_format. + * cp-typeck.c (build_function_call_real): Call check_function_format. + (record_format_info): Remove -- obsolete stub. + +Sat Jul 24 12:04:29 1993 Chip Salzenberg + + * cp-decl.c (duplicate_decls): Don't warn for non-extern var decl + following an extern one (for -Wredundant-decls). + * cp-parse.y (primary): In statement expression case, if compstmt + returns something other than a BLOCK, return it unchanged. + +Thu Dec 2 20:44:58 1993 Chip Salzenberg + + * cp-decl.c (warn_extern_redeclared_static): New function made + from code extracted from pushdecl. + (duplicate_decls, pushdecl): Call new function. + (lookup_name_current_level): Allow for IDENTIFIER_GLOBAL_VALUE + to be a TREE_LIST when function is declared in 'extern "C" {}'. + +Fri Dec 3 16:01:10 1993 Jason Merrill + + * cp-class.c (duplicate_tag_error): Use cp_error. + (finish_base_struct): Check for ambiguity with direct base, and don't + generate op= or copy ctor if it exists. + +Fri Dec 3 15:32:34 1993 Kung Hsu + + * cp-init.c (expand_member_init): When initializer name is null, + don't try to build it now because emit_base_init will handle it. + +Fri Dec 3 12:28:59 1993 Jason Merrill + + * cp-lex.c (init_lex): Initialize input_filename to "" for + code such as ExceptionHandler::operator=. + +Fri Dec 3 10:32:08 1993 Jason Merrill + + * cp-decl.c (grokdeclarator): Don't try to print out dname when + complaining about arrays of references if decl_context==TYPENAME, + since it will be null. + + * cp-decl2.c: Default to flag_ansi_overloading. + +Thu Dec 2 18:05:56 1993 Kung Hsu + + * cp-call.c (build_method_call): Use binfo from instance if it's + different from binfo (basetype_path) passed from above. + +Wed Nov 17 19:14:29 1993 Chip Salzenberg + + cp-error.c (dump_expr): Use unsigned chars to output a + TREE_REAL_CST in hex. + +Thu Dec 2 11:05:48 1993 Jason Merrill + + * cp-class.c (finish_struct): Fix typo in setting + cant_synth_asn_ref. + + * cp-tree.h (TYPE_NESTED_NAME): New macro, does + DECL_NESTED_TYPENAME (TYPE_NAME (NODE)). + + * cp-lex.c (default_copy_constructor_body): Change + DECL_NAME (TYPE_NAME (btype)) to TYPE_NESTED_NAME (btype). + (default_assign_ref_body): Likewise. + (default_copy_constructor_body): Call operator= explicitly for + base classes that have no constructor. + +Thu Dec 2 10:47:15 1993 Michael Tiemann + + * cp-call.c (build_method_call): If the instance variable is + converted to error_mark_node when we're trying to convert it to the + base type of a method we're looking up, return error_mark_node. + +Thu Dec 2 10:41:16 1993 Torbjorn Granlund + + * cp-typeck.c (build_binary_op_nodefault): In *_DIV_EXPR *_MOD_EXPR + cases, tests for unsigned operands by peeking inside a NOP_EXPR. + +Wed Dec 1 13:33:34 1993 Brendan Kehoe + + * cp-call.c (compute_conversion_costs_ansi): Use the size of struct + harshness_code, not the size of short, for clearing out the + ansi_harshness. + + * cp-call.c (print_candidates): New function. + (build_method_call): When we had some candidates, but didn't get a + usable match, don't report that we got an error with the first + candidate. Instead, say there were no matches, and list the + candidates with print_candidates. In the second pass, make sure we + clear out ever_seen, so we can accurately count the number of + functions that qualified. + +Wed Dec 1 09:53:59 1993 Torbjorn Granlund + + * cp-typeck.c (build_binary_op_nodefault): Shorten for *_MOD_EXPR + only if op1 is known to be != -1. + (build_binary_op_nodefault): Handle *_DIV_EXPR likewise. + +Tue Nov 30 14:07:26 1993 Brendan Kehoe + + * cp-method.c (hack_identifier): If the field itself is private, and + not from a private base class, say so. + +Mon Nov 29 03:00:56 1993 Jason Merrill + + * cp-decl.c (grokdeclarator): Always warn on initialization of + const member. + +Wed Nov 24 00:49:35 1993 Jason Merrill + + * cp-class.c (finish_struct): Set TYPE_GETS_CONST_* properly. + (finish_base_struct): Set cant_synth_asn_ref properly. + + * cp-lex.c (cons_up_default_function): Add section for operator=. + (default_assign_ref_body): New function, mostly cribbed from + default_copy_constructor_body. + + * cp-class.c (base_info): Add members cant_synth_copy_ctor, + cant_synth_asn_ref, no_const_asn_ref. + (finish_base_struct): Update no_const_asn_ref, note that you should + update cant_synth_*, propagate TYPE_GETS_ASSIGN_REF. + (finish_struct): Add decls for cant_synth_*, no_const_asn_ref, and + initialize them properly. Set no_const_asn_ref properly. Set + cant_synth_* in some of the situations where they should be set. + Propagate TYPE_GETS_ASSIGN_REF. Use cant_synth_copy_ctor. Add call + to cons_up_default_function for operator=. + +Tue Nov 23 20:24:58 1993 Mike Stump + + * cp-cvt.c (convert_force): Add code to perform casting of pointer + to member function types. + * cp-typeck.c (build_ptrmemfunc): Add FORCE parameter to indicate + when the conversion should be done, regardless. + * cp-tree.h (build_ptrmemfunc): Likewise. + * cp-type2.c (digest_init): Likewise. + * cp-typeck.c (convert_for_assignment): Likewise. + +Tue Nov 23 18:06:58 1993 Jason Merrill + + * cp-error.c (dump_expr): Do the right thing for variables of + reference type. + + * cp-decl.c (grok_op_properties): Set TYPE_HAS_ASSIGN_REF + and its kin properly. + (xref_tag): Propagate TYPE_GETS_ASSIGN_REF. + +Tue Nov 23 12:26:13 1993 Mike Stump + + * cp-method.c (build_opfncall): Don't count pointer to member + functions as aggregates here, as we don't want to look up methods in + them. The compiler would core dump if we did, as they don't have + normal names. + * cp-typeck.c (build_indirect_ref): Improve wording on error + message. + +Mon Nov 22 14:22:23 1993 Jason Merrill + + * cp-decl.c (grok_op_properties): Allow operator?: with pedwarn + (since it's supported in other compiler bits). + + * cp-method.c (report_type_mismatch): Use cp_error; ignore err_name + argument. + + * cp-error.c (dump_function_decl): Don't print return type for + constructors and destructors. + + * cp-cvt.c (cp_convert_to_pointer): Import code from + convert_to_pointer so we can return error_mark_node in the case of an + error, and to allow more meaningful error messages. + (build_type_conversion): Don't go through void* when trying + to convert to a pointer type. + + * cp-decl.c (grokfndecl): Move call to grok_op_properties back + after grokclassfn so that it's dealing with the right decl. + (grok_op_properties): Don't assert !methodp for op new and op delete. + + * cp-init.c (build_delete): Don't use TYPE_BUILT_IN (there are now + no uses of it in the compiler). + + * cp-call.c (build_scoped_method_call): Fix for destructors of simple + types. + (build_method_call): Likewise. + +Fri Nov 19 12:59:38 1993 Jason Merrill + + * cp-tree.c (count_functions): Abstraction function. + + * cp-call.c (build_overload_call_real): Deal with new overloading + properly, remove dead code. + + * gcc.c (default_compilers): Generate and use .ii files in the + intermediate stage of compiling C++ source. + +Fri Nov 19 11:26:09 1993 Jim Wilson + + * cp-expr.c (cplus_expand_expr): Make call_target a valid memory + address before using it, so it can be later safely compared. + +Fri Nov 12 15:30:27 1993 Jason Merrill + + * cp-pt.c (tsubst): Deal with new overloading. + + * cp-typeck.c (fntype_p): Is the arg function type? + (comp_target_parms): pedwarn on conversion from (anything) to (...). + (build_x_function_call): Deal with new overloading. + + * cp-tree.c (decl_list_length): Deal with new overloading. + (decl_value_member): Like value_member, but for DECL_CHAINs. + + * cp-decl.c (duplicate_decls): Deal with new overloading. + (start_decl): Likewise. + + * cp-class.c (instantiate_type): Deal with new overloading. + + * cp-call.c (convert_harshness_ansi): Deal with new overloading. + (convert_harshness_old): Deal with new overloading. + (build_overload_call_real): Likewise. + +Mon Nov 8 13:50:49 1993 Jason Merrill + + * cp-tree.c (get_unique_fn): New function; returns FUNCTION_DECL + if unambiguous, NULL_TREE otherwise. + (get_first_fn): Returns the first appropriate FUNCTION_DECL. + (is_overloaded_fn): Returns whether or not the passed tree is + a function or list of functions. + + * cp-init.c (init_init_processing): Use `get_first_fn' to find + the FUNCTION_DEFN for new and delete. + + * cp-decl.c (push_overloaded_decl): Use new overloading strategy, cut + code size in half (I spit on special cases). + +Tue Sep 7 20:03:33 1993 Jason Merrill + + * cp-decl.c: Allow references and template type parameters as well diff --git a/gcc/cp/ChangeLog-1994 b/gcc/cp/ChangeLog-1994 new file mode 100644 index 00000000000..1ec125fa86d --- /dev/null +++ b/gcc/cp/ChangeLog-1994 @@ -0,0 +1,5405 @@ +Fri Dec 30 17:57:30 1994 Mike Stump + + * gc.c (build_bltn_desc): Handle bool as a built-in type. + +Fri Dec 30 14:20:21 1994 Mike Stump + + * tree.c (layout_vbasetypes): Ensure that we don't loose alignment + on the complete type because of small virtual bases. + +Fri Dec 30 12:22:29 1994 Mike Stump + + * decl.c (n_incomplete): Bump n_incomplete up to int to match C + front end. + (pushdecl): Also count decls pushed that are of a type being defined + as incomplete things. + * class.c (finish_struct): Move hack_incomplete_structures up to + just after we set it as not being defined, so that the decls we + build for RTTI don't count as incomplete. + +Thu Dec 29 18:20:57 1994 Mike Stump + + * pt.c (tsubst): Fix problem with defining constructors in templated + classes with virtual bases. + +Wed Dec 28 08:31:00 1994 Mike Stump + + * parse.y (TYPEID): Strip top-level cv-qualifiers on typeid + expressions. + * gc.c (build_typeid): Likewise. + +Thu Dec 22 17:26:33 1994 Mike Stump + + * cvt.c (build_up_reference): Fix breakage introduced on Nov 29, + don't assert on complex AGGR inits. + +Thu Dec 22 14:32:31 1994 Mike Stump + + * method.c (build_overload_value): Handle pointer to members as + template arguments. + +Thu Dec 22 13:09:07 1994 Mike Stump + + * typeck.c (unary_complex_lvalue): Don't call sorry if we know how + to do take the address of a data member for a pointer to data + member. + +Thu Dec 22 10:04:19 1994 Mike Stump + + * decl.c (grokdeclarator): Use the typedef name for linkage if the + type doesn't otherwise have a name. + + * decl2.c (grokfield): Likewise. + + * class.c (finish_struct): Since we reuse the TYPE_DECL for the + DECL_NAME of enums, structs and classes, we have to avoid trying to + put it in the TYPE_FIELDS again. + +Wed Dec 21 11:07:05 1994 Mike Stump + + * decl2.c (check_classfn): Ignore this parameter on static functions + when checking to see if we match. + +Tue Dec 20 17:47:02 1994 Mike Stump + + * typeck.c (unary_complex_lvalue): Handle address of non-left most + pointers to members by calling get_delta_difference. + +Mon Dec 19 22:40:53 1994 Mike Stump + + * decl2.c (check_classfn): Don't use decls_match yet, as it modifies + static functions to early. + +Thu Dec 19 22:37:48 1994 Mike Stump + + * method.c (make_thunk): Handle encoding of positive thunk offsets. + +Sat Dec 17 13:29:50 1994 Doug Evans + + * Make-lang.in (.PHONY): Tell GNU make C++ and c++ are phony targets. + +Thu Dec 15 16:32:12 1994 Mike Stump + + * decl2.c (check_classfn): Use decls_match to check if this has + already been declared, as the DECL_ASSEMBLER_NAME may have been + changed via asm("new_name"). + * decl.c (decls_match): Make public. + +Thu Dec 15 15:17:55 1994 Mike Stump + + * *.[chy] (expand_aggr_init): Add fourth argument to handle + distinction between = init and (init) style of initializations. + * *.[chy] (finish_decl): Add fifth argument to handle + distinction between = init and (init) style of initializations. + +Tue Dec 13 19:16:05 1994 Mike Stump + + Fix some random `explicit' bugs. + + * cvt.c (convert_to_reference): Add third parameter to + convert_force. + (convert_force): Likewise. + * call.c (build_method_call): Likewise. + * decl2.c (setup_vtbl_ptr): Likewise. + * init.c (expand_virtual_init): Likewise. + (build_member_call): Likewise. + (build_delete): Likewise. + (build_vbase_delete): Likewise. + * typeck.c (build_component_addr): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + * cp-tree.h (CONV_NONCONVERTING): Likewise. Add so that we can + distinguish the context in which the conversion appears. Add thrid + argument to build_c_cast. + * cvt.c (cp_convert): Pass whether or not we want to consider + non-converting constructors down to build_method_call. + * decl2.c (reparse_absdcl_as_casts): Add third argument to + build_c_cast. + * gc.c (build_m_desc): Likewise. + * init.c (build_new): Likewise. + * parse.y (expr_no_commas): Likewise. + (primary): Likewise. + * typeck.c (build_x_function_call): Likewise. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (build_c_cast): Likewise. + (build_ptrmemfunc): Likewise. + * typeck2.c (build_functional_cast): Likewise. + * init.c (expand_aggr_init): Added LOOKUP_ONLYCONVERTING to + expand_aggr_init_1 as inits are converted to the destination type. + +Tue Dec 13 16:18:57 1994 Jason Merrill + + * Make-lang.in (cc1plus): Depends on c-pragma.o. + + * Makefile.in (OBJ{DEP,}S): Add ../c-pragma.o. + + * lex.c (check_newline): If the #pragma is not recognized by g++, + try machine-specific ones too. + (handle_sysv_pragma): Copied from c-lex.c. + +Mon Dec 12 23:53:06 1994 Mike Stump + + * except.c (expand_throw): Fix Dec 6th change, build_new likes a + reference better. + +Mon Dec 12 18:01:00 1994 Jason Merrill + + * typeck.c (build_binary_op): Lose checks on TYPE_PTRMEMFUNC_P with + IS_AGGR_TYPE, since now they will not both be set on the same type. + + * pt.c (do_pending_expansions): Don't clear TREE_PUBLIC on + instantiations controlled by -fexternal-templates. + + * decl.c (duplicate_decls): Don't complain about different values of + __attribute__ ((const)) and ((noreturn)). + +Fri Dec 9 18:17:37 1994 Doug Evans + + * Makefile.in (BISONFLAGS): Delete --yacc. + (PARSE_H): Depend on $(PARSE_C), for parallel makes. + (PARSE_C): Undo last patch. + +Fri Dec 2 10:44:36 1994 Mike Stump + + * Makefile.in (BISONFLAGS): Add --yacc so that output winds up in + y.tab.c. + +Thu Dec 8 17:39:46 1994 Jason Merrill + + * decl.c (finish_decl): Don't call obscure_complex_init for decls + of indeterminate size. + +Wed Dec 7 16:49:22 1994 Jason Merrill + + * decl.c (obscure_complex_init): Function to tweak the decl to + prevent expand_decl from tring to initialize it. + (finish_decl): Use it rather than writing the same code in three + different places. + + * parse.y (bad_parm): Stop trying to support parms without types. + +Wed Dec 7 12:06:56 1994 Mike Stump + + * decl2.c (grokfield): Make asm specs on static member functions + work. + +Tue Dec 6 15:43:20 1994 Mike Stump + + * except.c (expand_throw): Make a copy of the thrown object. + +Tue Dec 6 14:16:34 1994 Jason Merrill + + * parse.y: : Has lower precedence than =. + +Tue Dec 6 12:46:17 1994 Mike Stump + + * decl.c (pushdecl): Use DECL_NAME of VAR_DECLs to avoid namespace + manglings. + (grokvardecl): Add namespace into variable name. + +Tue Dec 6 11:26:55 1994 Mike Stump + + * decl2.c (current_namespace_id): New routine to transform a simple + name into a name in a namespace. + * decl.c (grokdeclarator): Use it. + * decl2.c (get_namespace_id): Find the name of the current + namespace. + (push_namespace, pop_namespace): Complete out missing + functionality. + +Mon Dec 5 17:11:51 1994 Jason Merrill + + * class.c (finish_struct): Don't use LONG_LONG_TYPE_SIZE, as it may + not be defined. Fix warning message for enums and restore warning + for non-enums. + + * decl2.c (push_namespace): Dummy function. + (pop_namespace): Likewise. + (do_namespace_alias): Likewise. + (do_using_decl): Likewise. + (do_using_directive): Likewise. + + * parse.y: New token NSNAME for namespace names. + (extdef): Add namespace, using definitions. + (using_decl): New rule for using declarations. + (any_id): New rule for identifiers with any degree of scoping. + (identifier): Add NSNAME. + (notype_identifier): Likewise. + (component_decl): Add using_decl. + (nested_name_specifier): Add NSNAME SCOPE. + + * typeck.c (convert_for_assignment): Handle conversions between + enums and bool. + + * decl.c (duplicate_decls): Only propagate DECL_MAIN_VARIANT on + FUNCTION_DECLs. + +Mon Dec 5 13:03:16 1994 Mike Stump + + * class.c (finish_struct): Give an error if one tries to declare a + bit-field's size greater than a long long, as the backend will dump. + It is not an error to declare an enum bit-field greater than its + precision. Warn if an enum bit-field is too small to hold all + its values. + +Mon Dec 5 11:41:50 1994 Mike Stump + + * typeck.c (convert_for_assignment): Use cp_convert instead of + convert so that we don't get static casts. + +Sun Dec 4 11:59:01 1994 Mike Stump + + * cvt.c (cp_convert): Don't complain about int->enum conversion if + we are doing static casts. + +Fri Dec 2 18:32:41 1994 Mike Stump + + * error.c (dump_expr): Do something more intelligent with SAVE_EXPRs + when dumping expressions in error messages. + +Fri Dec 2 17:04:27 1994 Mike Stump + + * gc.c (build_dynamic_cast): Change interface to libg++, ensure that + the return type is the right type, and make references work. + +Fri Dec 2 16:36:43 1994 Jason Merrill + + * decl.c (poplevel): Don't be confused by function-scope + declarations of non-nested functions. + (duplicate_decls): Propagate DECL_MAIN_VARIANT. + (pushdecl): Use duplicate_decls to copy info from old decl into new + function-scope one rather than doing it here. + + * decl2.c (mark_inline_for_output): Deal with the DECL_MAIN_VARIANT + of this decl, in case this is a function-scope declaration. + + * decl.c (finish_enum): Make sure that the type has the right + precision when we call fixup_*_type. + +Tue Nov 29 19:12:07 1994 Jason Merrill + + * cvt.c (build_up_reference): Strip superfluous NOP_EXPRs; we do + want to build up references to rvalues if possible. + (cp_convert): Stick on a NOP_EXPR when converting to the same type. + +Tue Nov 29 11:28:59 1994 Mike Stump + + * parse.y (maybe_raises): Handle throw (). + * parse.y (ansi_raise_identifier): Grok type-ids in exception + specifications. + * tree.c (build_exception_variant): Use list compare to check if + two exception specifications match. + * decl.c (duplicate_decls, bad_specifiers): Enhance wording on error + messages. + * call.c (build_method_call): Remove TREE_RAISES. + * cvt.c (convert_to_aggr): Likewise. + * typeck.c (build_function_call_real, convert_arguments): Likewise. + * init.c (expand_aggr_init_1): Likewise. + +Tue Nov 29 09:50:39 1994 Mike Stump + + * except.c: Add support for m68k and mips exception handling + support. + +Tue Nov 29 08:48:33 1994 Mike Stump + + * except.c (expand_end_all_catch): Throw into outer context, if we + fall off end of catch handlers. + +Mon Nov 28 16:44:41 1994 Mike Stump + + * Makefile.in: Make is easier to decide where parse.[ch] will be + built. + +Thu Nov 17 20:11:24 1994 Doug Evans + + * cp/Make-lang.in (CXX_INSTALL_NAME): Use program_transform_name. + (GXX_INSTALL_NAME): Likewise. + (CXX_CROSS_NAME): Use program_transform_cross_name. + (GXX_CROSS_NAME): Likewise. + (c++.install-man): Use program_transform_name on g++.1. + (c++.uninstall): Likewise. + +Mon Nov 28 13:53:03 1994 Mike Stump + + * parse.y (THROW): Fix precedence of throw expressions. + +Mon Nov 28 13:15:16 1994 Mike Stump + + * typeck.c (build_unary_op): Allow promotions from bool to int on + unary ~. + +Sun Nov 27 00:16:21 1994 Jason Merrill + + * method.c (build_overload_name): Use DECL_ASSEMBLER_NAME for + classes when appropriate. + (build_overload_nested_name): When dealing with a function context, + use ASM_FORMAT_PRIVATE_NAME to tweak the name of the function to + avoid conflicts between local classes of the same name. + +Wed Nov 23 17:59:42 1994 Mike Stump + + * gxx.gperf, parse.y, lex.h, hash.h, lex.c (init_lex), delc.c + (duplicate_decls, grokdeclarator), cp-tree.h: Add support for + `explicit'. + * cvt.c (convert_to_reference, cp_convert, build_type_conversion_1, + build_type_conversion): Use LOOKUP_ONLYCONVERTING in + build_method_calls so that non-converting constructors are not used. + * call.c (build_method_call): If we shouldn't use a non-converting + constructor, then don't. + +Wed Nov 23 14:46:56 1994 Jason Merrill + + * call.c (build_method_call): Don't try to synthesize methods yet. + +Tue Nov 22 12:45:21 1994 Jason Merrill + + * pt.c (push_template_decls): Create CONST_DECLs for template + constant parameters, not VAR_DECLs. + +Sat Nov 19 15:28:31 1994 Jim Wilson + + * typeck.c (build_binary_op_nodefault): Can shorten shift only if + shift count is less than size in bits of arg0. + +Thu Nov 17 15:30:50 1994 Mike Stump + + * gxx.gperf, hash.h, lex.c (init_lex, real_yylex), parse.y: Add new + ANSI keywords and, and_eq, bitand, bitor, explicit, namespace, not, + not_eq, or, or_eq, typename, using, xor, xor_eq to g++. Still need + to add support for explicit, namespace, typename, and using, support + for the rest is already in. + +Fri Nov 4 19:04:18 1994 Mike Stump + + * gc.c (get_bad_cast_node): New routine to support compile time + throws of bad_cast. + * gc.c (build_dynamic_cast): Support throwing of bad_cast at compile + time. + +Fri Nov 4 11:12:00 1994 Mike Stump + + * except.c: Add hppa support. + +Fri Nov 4 10:50:50 1994 Mike Stump + + * except.c: Add rs6000 support. + +Thu Nov 3 14:24:23 1994 Mike Stump + + * except.c (do_unwind): Add i[34]86 support. + +Thu Nov 3 00:10:46 1994 Jason Merrill + + * pt.c (do_pending_expansions): Unset TREE_PUBLIC on implicit + instantiations. + +Wed Nov 2 15:08:24 1994 Kung Hsu + + * decl.c (finish_function): Emit types used in method parameters + into symbol table. + +Wed Nov 2 15:05:47 1994 Jason Merrill + + * pt.c (process_template_parm): Allow pointer to member function + template parameter types. + (uses_template_parms): Handle pointer to member function + CONSTRUCTORs. + + * g++.c (main): Cast first argument of bzero to (char *). + Pass -lstdc++ instead of -lg++ unless we are invoked as 'g++'. + +Mon Oct 31 14:50:48 1994 Kung Hsu + + * gc.c (build_dynamic_cast): Rewrite to make it work. + * class.c (finish_vtbls): Build more vtables if flag_rtti is on. + * class.c (modify_all_direct_vtables): Likewise. + * init.c (expand_direct_vtbls_init): Expand more vtables if + flag_rtti is on. + * decl.c (init_type_desc): Add default return. + +Tue Oct 25 17:13:09 1994 Kung Hsu + + * tree.c (debug_binfo): Get rid of the initial size entry of + vtable. + * cp-tree.h: Change flag_dossier to flag rtti, define type + descriptor type nodes. + * decl.c (init_type_desc): New function to initialize type + descriptor type nodes. + * decl.c (record_builtin_type): Change flag_dossier to flag_rtti. + * lex.c (init_lex): Likewise. + * decl.c: Change variable flag_dossier to flag_rtti. + * decl.c (duplicate_decls): Get rid initial size entry of vtable. + * decl.c (hack_incomplete_structures): Take out assert 164. + * search.c (get_abstract_virtuals_1): Likewise. + * search.c (dfs_init_vbase_pointers): Change CLASSTYPE_DOSSIER to + CLASSTYPE_RTTI. + * parse.y: Likewise. + * class.c (prepare_fresh_vtable): For virtual bases, get right + offset. + * class.c (add_virtual_function): Change flag_dossier to + flag_rtti. + * class.c (modify_one_vtable): Modify the right rtti entry. + * class.c (override_one_vtable): Get rid of size entry. + * class.c (finish_struct): Change flag_dossier to flag_rtti, and + build extra vtables, build type descriptors for polymorphic + classes. + * gc.c (build_headof): Make headof() works correctly with new + rtti. + * gc.c (build_typeid): Make this function work with new rtti. + * gc.c (get_typeid): Make this function work with new rtti. + * gc.c (build_bltn_desc): New function for new rtti. + * gc.c (build_user_desc): Likewise. + * gc.c (build_class_desc): Ditto. + * gc.c (build_ptr_desc): Ditto. + * gc.c (build_attr_desc): Ditto. + * gc.c (build_func_desc): Ditto. + * gc.c (build_ptmf_desc): Ditto. + * gc.c (build_ptmd_desc): Ditto. + * gc.c (build_t_desc): Ditto. + * gc.c: Comment out old build_t_desc, build_i_desc, build_m_desc. + +Tue Oct 25 13:37:41 1994 Jason Merrill + + * call.c (convert_harshness): Check for TREE_UNSIGNED differences + after checking for integral conversions. + +Wed Nov 30 19:13:50 1994 Mike Stump + + * Version 2.6.3 released. + +Thu Nov 17 10:56:50 1994 Jason Merrill + + * typeck2.c (build_m_component_ref): Check the basetype of the + member pointer against the main variant of the object type. + +Mon Nov 14 14:21:52 1994 Jason Merrill + + * cvt.c (convert_to_reference): Make sure that the original expr + gets its type back when converting a reference. + + * method.c (build_overload_name): Clear numeric_outputed_need_bar here. + (build_decl_overload): Instead of here. + +Tue Nov 8 17:11:24 1994 Jason Merrill + + * cvt.c (cp_convert): Don't build a TARGET_EXPR if we're not in a + function. + + * typeck.c (convert_for_initialization): Handle initialization from + a TARGET_EXPR. + +Sun Nov 6 01:34:24 1994 Jason Merrill + + * pt.c (lookup_nested_type_by_name): Fix list-walking logic. + (tsubst): When replacing a TEMPLATE_TYPE_PARM, propagate + TYPE_READONLY and TYPE_VOLATILE from the argument. + (unify): When unifying with a TEMPLATE_TYPE_PARM, remove cv-quals + present in parm from arg. + (type_unification): Strip REFERENCE_TYPE from the argument type. + (unify): Don't strip REFERENCE_TYPE from the argument type. + +Sat Nov 5 22:42:15 1994 Greg McGary + + * pt.c (do_type_instantiation): Check to see if there's a + IDENTIFIER_TEMPLATE on a class before calling + instantiate_member_templates(). + +Sat Nov 12 06:35:42 1994 Mike Stump + + * Version 2.6.2 released. + +Thu Nov 3 18:48:19 1994 Paul Eggert + + * Makefile.in (spew.o, lex.o, pt.o): + Depend on $(srcdir)/parse.h, not parse.h. + +Tue Nov 1 19:19:41 1994 Mike Stump + + * Version 2.6.1 released. + +Sun Oct 23 13:19:55 1994 Jason Merrill + + * decl2.c: Declare flag_access_control. + (struct lang_f_options): Add access-control. + * expr.c (cplus_expand_expr, NEW_EXPR): Unset flag_access_control + for the call to expand_aggr_init to copy the object out of the + pcc_struct_return slot. + * search.c (compute_access): if (!flag_access_control) return + access_public. + +Fri Oct 21 00:32:54 1994 Jason Merrill + + * lex.c (cons_up_default_function): Don't try to defer method + synthesis now. + + * decl.c (init_decl_processing): Use __pure_virtual for abort_fndecl + instead of abort, since the OSF/1 dynamic linker doesn't like to see + relocation entries for abort. + + * tree.c (array_type_nelts_total): Use sizetype, not + integer_type_node. + (array_type_nelts_top): Likewise. + +Thu Oct 20 15:48:27 1994 Mike Stump + + * decl.c (grokdeclarator): Added handling for catch parameters + (CATCHPARM). + * except.c (expand_start_catch_block): Use the new CATCHPARM context + instead of NORMAL. + * except.c (expand_throw): Don't let convert_to_reference complain + about what we are doing. + +Thu Oct 20 12:55:24 1994 Jim Wilson + + * method.c (emit_thunk): Call instantiate_virtual_regs. + +Wed Oct 19 14:15:33 1994 Mike Stump + + * except.c (expand_exception_blocks): Make sure throw code doesn't + get put in function that won't be output. + +Mon Oct 17 18:03:15 1994 Jason Merrill + + * decl.c (init_decl_processing): Make alloca a builtin. + +Thu Oct 27 21:10:25 1994 Craig Burley + + * g++.c (main): Only decrement "added" and set "library" to + NULL when "library" != NULL (just like 940829 fix). + +Mon Oct 17 15:56:11 1994 Mike Stump + + * except.c (expand_start_catch_block): Make sure the false label + gets onto the permanent obstack, as it is used for the exception + table. + +Fri Oct 14 18:54:48 1994 Mike Stump + + * class.c (modify_one_vtable): Since the DECL_CONTEXT of fndecl can + be set just below, use current_fndecl instead. + +Fri Oct 14 15:12:22 1994 Jason Merrill + + * init.c (expand_aggr_vbase_init_1): Don't call expand_aggr_init_1 + with LOOKUP_SPECULATIVELY. + (expand_default_init): Abort if build_method_call returns NULL_TREE. + + * typeck.c (build_modify_expr): Don't just build a MODIFY_EXPR if + the rhs is a TARGET_EXPR. + + * parse.y (left_curly): Anonymous types are not affected by #pragma + interface/implementation. + + * method.c (synthesize_method): Don't call setup_vtbl_ptr for the + default constructor if it isn't needed. + + * lex.c (cons_up_default_function): Do synthesize methods for + anonymous types if necessary. + +Thu Oct 13 17:44:55 1994 Jason Merrill + + * method.c (build_decl_overload): Set numeric_outputed_need_bar to 0. + +Wed Oct 12 13:27:57 1994 Jason Merrill + + * typeck.c (build_modify_expr): Understand how to copy an aggregate. + + * init.c (expand_default_init): Likewise. Also remove some of the + crufty code that assumes methods will not be synthesized properly. + + * lex.c (cons_up_default_function): If the containing type has no + name, these functions should never need to be called, so just + declare them. + + * lex.c (real_yylex): Use HOST_BITS_PER_WIDE_INT to determine the + bitmask for lexing character constants. + + * call.c (build_method_call): Disable code that tries to do tricky + stuff with a default parameter that is a constructor call, but + actually does other tricky stuff that breaks things. + +Wed Oct 12 16:14:01 1994 Benoit Belley + + * decl.c (finish_enum): Disable code which forces enums to be signed, + since this conflicts with their use as bitfields. type_promotes_to + handles promotion of enums of underlying unsigned types to signed + integer types. + +Wed Oct 12 13:24:03 1994 Jason Merrill + + * cvt.c (type_promotes_to): Also promote enums to long if + appropriate. + + * typeck.c (default_conversion): Don't expect type_promotes_to to + return a main variant. + +Wed Oct 12 12:19:45 1994 Jason Merrill + + * call.c (build_scoped_method_call): Don't lose side effects in the + object expression when calling a non-existent destructor. + +Fri Sep 2 19:05:21 1994 Rohan Lenard + + * call.c (build_scoped_method_call): Remove erroneous error message + when destructor call is written as a scoped call. + +Tue Oct 11 23:48:31 1994 Jason Merrill + + * various: Cast pointer arguments to bzero and bcopy to char *. + +Tue Oct 11 19:34:32 1994 Mike Stump + + * class.c (get_derived_offset): Added a type parameter to limit how + far up the CLASSTYPE_VFIELD_PARENT chain we search. + * class.c (modify_one_vtable, fixup_vtable_deltas): When forming the + offset to put into the vtable for the this parameter, make sure we + don't offset from a parent of the DECL_CONTEXT of the function. + +Tue Oct 11 16:10:52 1994 Jason Merrill + + * pt.c (do_function_instantiation): Set DECL_EXTERNAL and + TREE_STATIC when setting DECL_INTERFACE_KNOWN. + (do_type_instantiation): Likewise. + + * lex.c (cons_up_default_function): Set DECL_INTERFACE_KNOWN, + DECL_EXTERNAL and TREE_STATIC as appropriate. + + * decl2.c (finish_file): Also synthesize methods that don't have + DECL_EXTERNAL set. Set interface_unknown before doing so. + + * decl.c (start_function): If DECL_INTERFACE_KNOWN is set on the + function decl, don't muck with TREE_PUBLIC and DECL_EXTERNAL. + +Mon Oct 10 00:56:53 1994 Jason Merrill + + * lex.c (cons_up_default_function): Mark methods in a template class + as template instances. Store the values of interface_unknown and + interface_only for do_pending_inlines. + (do_pending_inlines): Use them. + + * decl2.c (finish_file): If we haven't seen a definition of a + function declared static, make the decl non-PUBLIC so compile_file + can give an error. + +Sun Oct 9 02:42:29 1994 Jason Merrill + + * method.c (do_build_copy_constructor): Handle anonymous unions. + (do_build_assign_ref): Likewise. + (largest_union_member): Move from lex.c. + +Sat Oct 8 14:59:43 1994 Jason Merrill + + Re-implement g++'s vague linkage independent of TREE_PUBLIC. + * pt.c (instantiate_member_templates): Lose redundant + -fexternal-templates handling. + (tsubst): Set TREE_PUBLIC and DECL_EXTERNAL on new decls. Don't set + TREE_STATIC or DECL_INTERFACE_KNOWN. + (do_pending_expansions): Predicate on DECL_INTERFACE_KNOWN instead + of DECL_EXTERNAL for explicit instantiations. + (do_function_instantiation): Do the new thing. + (do_type_instantiation): Likewise. + (instantiate_template): Deal with member templates defined in a .cc + file with -fexternal-templates. + * except.c (expand_exception_blocks): Use DECL_LINKAGE_KNOWN to + decide whether to stick builtin_throw here. + * decl2.c (import_export_inline): Predicate on DECL_INTERFACE_KNOWN + rather than TREE_PUBLIC. Generally fix rules. + (finish_file): Use DECL_INITIAL to determine whether or not a method + has been synthesized, rather than TREE_ASM_WRITTEN. + * decl.c (warn_extern_redeclared_static): Use DECL_PUBLIC instead of + TREE_PUBLIC. + (pushdecl): Likewise. + (duplicate_decls): Likewise. Deal with DECL_DECLARED_STATIC and + DECL_INTERFACE_KNOWN. + (redeclaration_error_message): Fix checking for conflicting linkage. + (define_function): Set DECL_INTERFACE_KNOWN. + (grokfndecl): Function decls are PUBLIC until we are sure about + their linkage. Set DECL_DECLARED_STATIC as needed. + (start_function): Deal with linkage. Move pushdecl after linkage + magic. + (finish_function): Don't set TREE_ASM_WRITTEN on discarded inlines. + * cp-tree.h (lang_decl_flags): Add interface_known and + declared_static. + (DECL_INTERFACE_KNOWN): New macro. + (DECL_DECLARED_STATIC): New macro. + (DECL_PUBLIC): New macro. + + Clean up bogus use of TREE_PUBLIC. + * class.c (alter_access): Fix mistaken use of TREE_PUBLIC (it + doesn't correspond to TREE_PROTECTED and TREE_PRIVATE). + * init.c (do_friend): Don't arbitrarily set TREE_PUBLIC. + +Wed Oct 5 13:44:41 1994 Jason Merrill + + * call.c (build_overload_call_real): Don't immediately do + array->pointer conversion. + + * pt.c (type_unification): If not passing to a reference, strip + cv-quals. Also handle array->pointer conversion. + +Tue Oct 4 17:45:37 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't warn about applying const to a + const typedef or template type parameter. + + * decl2.c (finish_file): Also synthesize methods after walking the + vtables. Ugly ugly ugly. + +Mon Oct 3 15:02:41 1994 Jason Merrill + + * various: Remove lingering remnants of old exception handling code. + + * decl2.c (finish_file): Synthesize methods before walking the + vtables, so that the vtables get emitted as needed. + + * decl.c (shadow_tag): Remove obsolete code for pushing tags and + dealing with exceptions. + +Mon Oct 3 13:05:27 1994 Ian Lance Taylor + + * Make-lang.in (g++-cross): Depend upon version.o and $(LIBDEPS). + +Mon Oct 3 02:59:28 1994 Jason Merrill + + * decl2.c (finish_file): Fix inline handling. + +Sun Oct 2 00:21:56 1994 Jason Merrill + + * decl.c (grokdeclarator): Handle redundant scope even better. + ({push,pop}_cp_function_context): Take toplev parameter. + + * method.c (synthesize_method): Pass toplev parameter to + {push,pop}_cp_function_context depending on decl_function_context + (fndecl). + + * typeck.c (build_x_unary_op): Unary & on OFFSET_REFs is always the + built-in version. + + * method.c (synthesize_method): Don't be confused by __in_chrg + parameter. + + * class.c (popclass): Set C_C_D like start_function does. + + * decl.c (grokdeclarator): Handle redundant scope better. + + * parse.y (expr_or_declarator): Add '(' expr_or_declarator ')' rule. + (direct_notype_declarator): Likewise. + (complex_direct_notype_declarator): Remove it here. + +Sat Oct 1 21:42:18 1994 Jason Merrill + + * init.c (resolve_offset_ref): Fix types used in resolving .* + expressions. + +Sat Oct 1 15:18:49 1994 Jason Merrill + + Beginnings of work to synthesize methods only when needed. + * call.c (build_method_call): Synthesize methods as necessary + (currently never necessary). + * class.c (popclass): Don't try to set C_C_D here, as it'll end up + on the wrong obstack. + * decl.c (push_cp_function_context): Mostly copied from + push_c_function_context. + (pop_cp_function_context): Similarly. + (finish_function): Reverse order of poplevel and pop_nested_class so + that current_class_decl is restored properly. + (start_function): Likewise. + (finish_function): Add parameter 'nested'. Don't call + permanent_allocation if (nested). + * various: Pass extra parameter to finish_function. + * decl2.c (finish_file): Reorganize end-of-file inline handling, + synthesizing methods as necessary. + * lex.c (cons_up_default_function): Call mark_inline_for_output. + Only synthesize methods immediately if #pragma implementation + (currently disabled). + (do_pending_inlines): Call synthesize_method. + * method.c (synthesize_method): New function; all method synthesis + goes through here. Calls do_build_assign_ref and + do_build_copy_constructor. + (build_default_constructor): Remove. + (build_dtor): Likewise. + (build_assign_ref): Rename to do_build_assign_ref and remove stuff + done by synthesize_method. + (build_copy_constructor): Similarly. + +Thu Sep 29 16:58:52 1994 Mike Stump + + * typeck.c (c_expand_return): Use magic so the backend can fixup the + assignment into the return register, so cleanups won't clobber it. + +Thu Sep 29 13:08:50 1994 Jason Merrill + + * method.c (hack_identifier): Don't call assemble_external for + template decls. + + * decl.c (finish_decl): Also end temporary allocation if the decl in + question has a type of error_mark_node. + +Wed Sep 28 21:45:00 1994 Mike Stump + + * typeck.c (build_modify_expr): When optimizing ?: on lhs, make sure + that if the ?: was a reference type, that the subparts will be also. + +Wed Sep 28 16:14:04 1994 Brendan Kehoe + + * except.c (register_exception_table): Use Pmode, not PTRmode. + +Fri Sep 23 13:54:27 1994 Jason Merrill + + * lex.c (do_pending_inlines): Do method synthesis after the + pending_inlines have been reversed. + +Thu Sep 22 12:53:03 1994 Per Bothner + + * decl2.c (finish_file): Fix Brendan's fix: Only call + register_exception_table if there is a non-empty exception table. + +Thu Sep 22 12:03:46 1994 Brendan Kehoe + + * decl2.c (finish_file): Only do register_exception_table if + -fhandle-exceptions is being used. + +Wed Sep 21 19:01:51 1994 Per Bothner + + * except.c (output_exception_table_entry): Simplify + by using assemble_integer. + (build_exception_table): Change to return a count. + Cleanup to use standard macros, instead of hard-wired + sparc asm format. Don't make __EXCEPTION_TABLE__ global. + (register_exception_table): New function. Generate call to builtin. + * decl2.c (finish_file): Call register_exception_table. + * cp-tree.h (build_exception_table): Fix prototype. + +Wed Sep 21 13:20:42 1994 Brendan Kehoe + + * tree.c (break_out_calls): Don't try to duplicate the DECL_INITIAL. + + * decl2.c (delete_sanity): Give an error at trying to delete a + function. + +Wed Sep 21 11:47:10 1994 Jason Merrill + + * lex.c (cons_up_default_function): Mark synthesized destructors + inline. + + * decl.c (duplicate_decls): Ignore redeclarations of wchar_t as + something other than __wchar_t, complaining if -pedantic and not in + a system header. + +Tue Sep 20 09:43:28 1994 Jason Merrill + + * decl.c (xref_tag): Set up BINFO_INHERITANCE_CHAIN on base binfos + here. + + * typeck.c (build_modify_expr): Require complete type after checking + for error_mark_node. + + * call.c (build_method_call): Print parmtypes when complaining of + ambiguous call. + + * typeck.c (build_modify_expr): Handle assignment to array from + non-array. + + * decl.c (lookup_name_real): Deal with got_scope == error_mark_node. + + * call.c (build_method_call): Don't bother with the exact match. + +Mon Sep 19 00:51:39 1994 Jason Merrill + + * init.c (expand_aggr_init): If we munge the type of the variable, + also munge the type of the initializer. + + * decl.c (grokdeclarator): Use <= when comparing to RID_LAST_MODIFIER. + (init_decl_processing): Push artificial declaration of wchar_t so + people don't have to declare it before they can use it. + + * error.c (cp_line_of): Return lineno in lieu of 0. + + * typeck.c (convert_for_assignment): Handle conversion of pmfs to + int and bool. + (build_component_ref): Fold the COMPONENT_REF in case it can be + reduced. + + * typeck2.c (store_init_value): Don't pedwarn about non-constant + bracketed initializers for automatic variables. + +Sun Sep 18 10:12:12 1994 Jason Merrill + + * error.c (dump_decl): Don't say `typedef enum foo foo'. + + * decl.c (start_decl): Don't set TREE_PUBLIC on template decls just + because they're affected by #pragma i/i. We'll deal with that when + they get instantiated. + + * typeck.c (build_unary_op): Clean up cruft in ADDR_EXPR case. + + * class.c (instantiate_type): Set TREE_CONSTANT on instantiated + ADDR_EXPRs if appropriate. + + * decl.c (build_ptrmemfunc_type): Unset IS_AGGR_TYPE on pmf types. + + * typeck.c (build_ptrmemfunc): Handle &overloaded_method as an + initializer properly. + * typeck2.c (digest_init): Likewise. + + * tree.c (cp_build_type_variant): Like c_build_type_variant, except + it uses build_cplus_array_type. + * *.c: Use cp_build_type_variant instead of c_build_type_variant. + + * pt.c (do_type_instantiation): Don't try to instantiate nested + enums. + +Tue Sep 13 10:56:58 1994 Jason Merrill + + * cvt.c (build_up_reference): Handle preincrement and predecrement + properly. + +Tue Sep 13 09:51:59 1994 Brendan Kehoe + + * decl.c (finish_decl): Only lay out the rtl for DECL if it is, in + fact, static. + +Mon Sep 12 14:40:30 1994 Brendan Kehoe + + * decl.c (finish_decl): Lay out the rtl for DECL before doing + grok_reference_init, in case it's static. + +Mon Sep 12 12:45:38 1994 Jason Merrill + + * class.c (finish_struct): Don't synthesize constructors if the + class has a field with the same name as the class. Don't die on + classes with no constructors or destructors. Don't die if the head + and tail of the class are in different files. + + * decl.c (grokdeclarator): Don't treat a function pointer field + with the same name as the class as a constructor. + +Fri Sep 9 13:17:00 1994 Jason Merrill + + * typeck.c (build_c_cast): Pull constant values out of their + variables here. + + * decl.c (duplicate_decls): Only propagate DECL_CHAIN in + FUNCTION_DECLs and TEMPLATE_DECLs. + +Thu Sep 8 10:07:48 1994 Jason Merrill + + * decl.c (duplicate_decls): Propagate DECL_CHAIN in all DECLs that + have it. + + * pt.c (unify): REALs and INTEGERs only unify with their own genus. + (instantiate_member_templates): Don't muck with DECL_EXTERNAL and + TREE_PUBLIC unless -fexternal-templates. + +Wed Sep 7 13:17:10 1994 Jason Merrill + + * pt.c (do_type_instantiation): Call instantiate_member_templates. + Deal with specializations. + (tsubst): Don't stick the mangled name in DECL_NAME for function + instantiations. Don't push them, either. + + * decl2.c (grokfield): Move code for generating the + DECL_ASSEMBLER_NAME for static members from here. + * method.c (build_static_name): To here. + * decl.c (grokvardecl): Call build_static_name. + (duplicate_decls): Keep old DECL_ASSEMBLER_NAME. + +Mon Sep 5 12:49:18 1994 Jason Merrill + + * call.c (build_method_call): If -Wsynth, warn when selecting + synthesized op= over user-supplied one cfront would select. + * decl2.c (lang_decode_option): Handle -Wsynth. + +Fri Sep 2 15:11:59 1994 Jason Merrill + + * decl.c (finish_enum): Overhaul to fix several bugs. + (start_enum): Disable useless code. + +Thu Sep 1 16:04:54 1994 Jason Merrill + + * typeck.c (c_expand_return): Warn about returning a reference to a + temporary. + (convert_arguments): Increment argument counter when using default + arguments, too. + +Wed Aug 31 14:29:22 1994 Jason Merrill + + * decl.c (finish_decl): If the type of decl is error_mark_node, + don't bother trying to do anything. + + * typeck.c (convert_for_initialization): If the rhs contains a + constructor call, pretend the lhs type needs to be constructed. + + * init.c (expand_default_init): If we stick the object inside the + initializer, mark the initializer used. + +Tue Aug 30 13:50:18 1994 Jason Merrill + + * method.c (build_assign_ref): Return *this; + (build_assign_ref): Fix base assignment order. + (build_copy_constructor): Fix member init order. + +Mon Aug 29 13:54:39 1994 Brendan Kehoe + + * g++.c (main): Remember to clear out SAW_SPECLANG after we see + its argument. + +Sat Aug 27 09:36:03 1994 Jason Merrill + + * method.c (build_copy_constructor): Also copy virtual bases. + +Fri Aug 26 17:05:15 1994 Jason Merrill + + * lex.c (do_pending_inlines): Clear out pending_inlines before doing + any synthesis. Also first set deja_vu on all pending_inlines. + + * method.c (build_assign_ref): Use build_member_call to invoke base + operator=, rather than build_modify_expr. And use + build_reference_type instead of TYPE_REFERENCE_TO. + (build_copy_constructor): Use TYPE_NESTED_NAME to identify the + basetype. + + * decl2.c (grokfield): Don't complain about undefined local class + methods. + + * class.c (finish_struct): Don't try to synthesize methods here. + * lex.c (do_pending_inlines): Instead, synthesize them here. + (init_lex): Initialize synth_obstack. + (cons_up_default_function): Stick synthesis request on + pending_inlines. + +Fri Aug 26 12:24:14 1994 Brendan Kehoe + + * call.c (build_method_call) [PCC_STATIC_STRUCT_RETURN]: Also + accept an RTL_EXPR in what we're about to use for the instance, + since anything which would end up with pcc_struct_return set + inside cplus_expand_expr. + + * cp-tree.h (cons_up_default_function): Note change of prototype. + +Thu Aug 25 23:05:30 1994 Gerald Baumgartner + + * class.c (finish_struct): Undid change from Aug 21 testing + CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING. + * parse.y (left_curly): Likewise, undid change from Aug 21. + * decl.c (xref_tag): Undid change from Aug 21, set + CLASSTYPE_INTERFACE correctly, and added comments. + +Thu Aug 25 00:36:31 1994 Jason Merrill + + Rework approach to synthesized methods; don't go through the parser + anymore. + * class.c (finish_struct): Use new synthesis approach. + * lex.c (cons_up_default_function): Now just creates declaration, + not code. + (largest_union_member): #if 0 out. + (default_assign_ref_body): Likewise. + (default_copy_constructor_body): Likewise. + * method.c (build_default_constructor): New function to synthesize X(). + (build_copy_constructor): Synthesize X(X&). + (build_assign_ref): Synthesize X::operator=(X&). + (build_dtor): Synthesize ~X(). + + * error.c (cp_line_of): If we're dealing with an artificial + TYPE_DECL, look at the type instead. + +Wed Aug 24 11:11:50 1994 Jason Merrill + + * init.c (sort_member_init): Check warn_reorder. + * decl2.c (lang_decode_option): Handle -W{no-,}reorder. + + * cp-tree.h (CLASSTYPE_SOURCE_LINE): New macro. + * error.c (cp_line_of): Use CLASSTYPE_SOURCE_LINE for aggregates. + * class.c (finish_struct): Set CLASSTYPE_SOURCE_LINE. + +Tue Aug 23 09:28:35 1994 Mike Stump + + * error.c (dump_decl): Improve wording, so that error messages + dont't read template<, class foo>... + +Mon Aug 22 15:30:51 1994 Brendan Kehoe + + * parse.y (label_colon): Also match a TYPENAME as a label name, + since they may have declared a class by that name but have also + tried to have a local label under the same name. + + * pt.c (coerce_template_parms): Call cp_error, not cp_error_at, + for the message so they know at what point it was instantiated. + +Sun Aug 21 23:07:35 1994 Gerald Baumgartner + + * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING for signatures up to left_curly time. + * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING for signatures down to left_curly time. + * parse.y (left_curly): New final resting place for setting + CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING for signatures. + + * class.c (finish_struct): Don't test for function/field name + conflicts in signatures, since all the fields are compiler-constructed. + +Fri Aug 19 14:04:47 1994 Kung Hsu + + * method.c (build_overload_nested_name): In qualified name + mangling, the template with value instantiation will have numeric + at end and may mixed with the name length of next nested level. + Add a '_' in between. + * method.c (build_overload_name): Ditto. + * method.c (build_overload_identifier): Ditto. + +Thu Aug 18 16:24:43 1994 Mike Stump + + * error.c (dump_decl): Handle NULL args. + +Thu Sep 29 16:15:36 1994 Michael I Bushnell + + * g++.c: Rework last change so it's done like collect.c (and + gcc.c). + +Wed Sep 14 10:17:27 1994 Michael I Bushnell + + * g++.c: Include in case `errno' is a macro + as permitted by ANSI C. + +Thu Aug 18 12:48:09 1994 Mike Stump + + * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING up to left_curly time. + * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and + CLASSTYPE_VTABLE_NEEDS_WRITING down to left_curly time. + * parse.y (left_curly): New final resting place for setting + CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING. + +Thu Aug 11 11:32:42 1994 H.J. Lu + + * g++.c (main): Only decrement "added" and set "library" to + NULL when "library" != NULL. + +Sat Aug 13 00:14:52 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't set TREE_PUBLIC on a function decl + just because its class has a known interface. + (decls_match): Deal with new format of template parms. + + * lex.c (cons_up_default_function): Don't play with TREE_PUBLIC and + DECL_EXTERNAL here. + +Fri Aug 12 01:55:15 1994 Jason Merrill + + * decl.c (pushtag): SET_DECL_ARTIFICIAL on gratuitous typedefs. + (xref_defn_tag): Likewise. + (pushdecl): Only allow artificial typedefs to be shadowed. + + * init.c (emit_base_init): Pass the right binfos to + expand_aggr_init_1. + + * class.c (delete_duplicate_fields_1): Make it work right. + (finish_struct): Catch function/field name conflict. + + * decl2.c (check_classfn): Pass the function to cp_error, not just + the name. + + * init.c (sort_member_init): Warn when order of member initializers + does not match order of member declarations. + (emit_base_init): Call expand_aggr_init_1 with LOOKUP_PROTECT. + + * error.c (dump_expr): Handle lists of functions. + + * decl.c (start_function): #pragma interface only affects functions + that would otherwise be static. + (finish_decl): Don't warn about an unused variable if it has both + constructor and destructor, since the 'resource allocation is + initialization' idiom is relatively common. + + * typeck.c (comp_target_types): Don't handle TEMPLATE_TYPE_PARMs. + (comp_target_parms): Likewise. + (compparms): Never consider default parms. + (common_base_type): Don't choose a virtual baseclass if there is a + more derived class in common. + (build_conditional_expr): If pedantic, pedwarn about conversion to + common base in conditional expr. + + * class.c (instantiate_type): Handle template instantiation better. + + * typeck.c (convert_arguments): Don't try to get tricky and convert + to int directly when PROMOTE_PROTOTYPES is set, as it breaks + user-defined conversions. + + * lex.c (check_for_missing_semicolon): Also give error at end of + file. + + * call.c (build_method_call): Don't promote arrays to pointers here. + + * typeck.c (convert_arguments): Don't require the actual parameter + to be of a complete type if the formal parameter is a reference. + +Thu Aug 11 15:21:40 1994 Jason Merrill + + * decl.c (grokdeclarator): Soften 'static' on member function error + to pedwarn. + + * init.c (build_new): Don't automatically save rval. + (build_offset_ref): Do field lookup with proper basetype_path. + +Thu Aug 11 12:46:54 1994 Brendan Kehoe + + * errfn.c (cp_silent): Declare to mark when we should avoid + emitting warnings and errors. + (cp_error): Check it. + (cp_warning): Likewise. + (cp_pedwarn): Likewise. + (cp_compiler_error): Likewise. + (cp_error_at): Likewise. + (cp_warning_at): Likewise. + (cp_pedwarn_at): Likewise. + * call.c (compute_conversion_costs): Set CP_SILENT when we start + out, and make sure we turn it off before we leave. + +Thu Aug 11 00:02:54 1994 Jason Merrill + + * decl2.c (grok_array_decl): Try computing *(A+B) if neither + argument is obviously an array. + +Wed Aug 10 15:32:04 1994 Jason Merrill + + * typeck.c (c_expand_start_case): Do cleanups here. + + * parse.y (xcond): Do bool conversion here, too. + (simple_stmt, SWITCH case): Don't do cleanups here. + + * decl.c (duplicate_decls): Don't treat builtins that have been + explicitly declared specially. + +Tue Aug 9 01:16:09 1994 Jason Merrill + + * tree.c (make_deep_copy): Support copying pointer, reference, + function, array, offset and method types. + + * decl.c (init_decl_processing): Mark exit and abort as + BUILT_IN_NONANSI so that duplicate_decls is kinder about + redeclaration. + (duplicate_decls): Don't give two errors for redeclaring a C + function with the same parms but a different return type. + + * parse.y (paren_cond_or_null): Do cleanup and bool conversion here. + (condition): Instead of here. + (simple_stmt, SWITCH case): Also do cleanup here. + + * decl2.c (finish_anon_union): Only break out FIELD_DECLs. + + * call.c (build_method_call): Don't throw away the side effects of + the object in a call to a non-existent constructor. + * parse.y (primary): Likewise. + + * method.c (build_decl_overload): Oop. + + * decl2.c (lang_decode_option): Deal with flag_no_nonansi_builtin, + warn about uselessness of specifying -fansi-overloading. + + * method.c (build_decl_overload): Treat any non-member new with one + parameter as __builtin_new. + + * decl.c (init_decl_processing): Setup built-in meanings of exit, + _exit and abort. + +Mon Aug 8 15:03:30 1994 Jason Merrill + + * error.c (dump_readonly_or_volatile): Put a space between const and + volatile if both apply. + + * init.c (perform_member_init): Clean up after this initialization. + (emit_base_init): Clean up after each base init, not after all have + been done. + (expand_aggr_vbase_init_1): Clean up after this init. + +Sun Aug 7 14:55:05 1994 Jason Merrill + + * call.c (build_method_call): Deal with destroying references. + + * parse.y (condition): Do bool_truthvalue_conversion here. + (paren_expr_or_null): And here. + (simple_if): Not here. + (simple_stmt): Or here. + +Sat Aug 6 22:29:45 1994 Jason Merrill + + * parse.y (paren_expr_or_null): Wrap the expression in a + CLEANUP_POINT_EXPR. + (condition): Likewise. + +Sat Aug 6 19:46:37 1994 Rohan Lenard + + * call.c (build_scoped_method_call): Fix error message when + destructor call refers to a nonexistent type. + +Sat Apr 16 22:43:30 1993 Gerald Baumgartner + + * lex.h (rid): Deleted RID_RAISES, it's never used. + Moved RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, RID_EXCEPTION, + RID_TEMPLATE and RID_SIGNATURE to the end of the enumeration, + they don't need to be touched in `grokdeclarator.' + (RID_LAST_MODIFIER): Defined macro to be RID_MUTABLE. + + * decl.c (grokdeclarator): Use RID_LAST_MODIFIER instead of + RID_MAX as loop limit for finding declaration specifiers. + +Sat Apr 3 21:59:07 1993 Gerald Baumgartner + + * lex.c (debug_yytranslate): Moved to parse.y since it needs to + access `yytname,' which is static in parse.c. + +Fri Apr 2 23:36:57 1993 Gerald Baumgarnter + + * cp-tree.h (GNU_xref_ref): Fixed typo in extern declaration, it + was `GNU_xref_def' instead of `GNU_xref_ref.' + +Fri Aug 5 14:20:16 1994 Jason Merrill + + * pt.c (do_function_instantiation): Don't set TREE_PUBLIC and + DECL_EXTERNAL on 'extern' instantiations; wait until EOF to do that. + (do_type_instantiation): Likewise. + + * decl2.c (import_export_inline): Decides at EOF what an inline's + linkage should be. + (finish_file): Call it. + + * decl.c (start_function): Don't rely on the settings of TREE_PUBLIC + and DECL_EXTERNAL from do_*_instantiation. Only set + DECL_DEFER_OUTPUT on inlines whose linkage might actually change. + (finish_function): Use DECL_DEFER_OUTPUT to decide which inlines to + mark for later consideration, rather than DECL_FUNCTION_MEMBER_P. + +Fri Aug 5 01:12:20 1994 Mike Stump + + * class.c (get_class_offset_1, get_class_offset): New routine to + find the offset of the class where a virtual function is defined, + from the complete type. + * class.c (modify_one_vtable, fixup_vtable_deltas): Use + get_class_offset instead of virtual_offset as get_class_offset will + always provide the right answer. + * tree.c (virtual_offset): Remove. It only ever worked some of the + time. + +Tue Aug 2 12:44:21 1994 Jason Merrill + + * call.c (build_method_call): Put back unary_complex_lvalue call + that I thought was redundant. + + * typeck.c (c_expand_return): Fix a case I missed before. + +Sun Jul 31 17:54:02 1994 Jason Merrill + + * pt.c (unify): Strip cv-quals from template type arguments (when + 'const T*' is matched to 'const char*', that does not mean that T is + 'const char'). + +Fri Jul 29 01:03:06 1994 Jason Merrill + + * pt.c (do_type_instantiation): Instantiate nested TAGS, not + typedefs. Third time's the charm? + + * parse.y (template_parm): Support default template parms. + * pt.c (process_template_parm): Likewise. + (end_template_parm_list): Likewise. + (coerce_template_parms): Likewise. + (mangle_class_name_for_template): Likewise. + (push_template_decls): Likewise. + (unify): Likewise. + * method.c (build_overload_identifier): Likewise. + * error.c (dump_decl): Likewise. + +Wed Jul 27 17:47:00 1994 Jason Merrill + + * pt.c (do_type_instantiation): Only instantiate nested *classes*. + +Tue Jul 26 13:22:40 1994 Jason Merrill + + * search.c (note_debug_info_needed): Also emit debugging information + for the types of fields. + +Mon Jul 25 00:34:44 1994 Jason Merrill + + * pt.c (lookup_template_class): Pass 'template' to + coerce_template_parms instead of 'in_decl', since it's a more + meaningful context. + + * typeck.c (c_expand_return): Make sure any cleanups for the return + expression get run. + (build_c_cast): Use CONVERT_EXPR for conversion to void. + + * pt.c (do_type_instantiation): Also instantiate nested types. + + * typeck.c (convert_for_assignment): Don't die when comparing + pointers with different levels of indirection. + + * decl.c (grokdeclarator): The sub-call to grokdeclarator for + class-local typedefs sets DECL_ARGUMENTS, so we need to clear it + out. + + * decl2.c (finish_anon_union): Don't die if the union has no + members. + + * decl.c (grokdeclarator): Undo changes to declspecs when we're done + so that 'typedef int foo, bar;' will work. + + * decl2.c (finish_file): Don't call expand_aggr_init for + non-aggregates. + +Mon Jul 25 00:03:10 1994 Teemu Torma + + * decl.c (finish_function): We can't inline constructors and + destructors under some conditions with -fpic, but don't unset + DECL_INLINE. + +Mon Jul 25 00:03:10 1994 Jason Merrill + + * typeck.c (build_object_ref): Make sure 'datum' is a valid object. + +Sun Jul 24 14:19:31 1994 Jason Merrill + + * class.c (finish_struct): Don't set DECL_FIELD_BITPOS on + non-fields. + (finish_struct_methods): Use copy_assignment_arg_p. + + * cvt.c (cp_convert): If expr is an OFFSET_REF, resolve it instead + of giving an error. + + * typeck.c (build_binary_op_nodefault): Don't set result_type if we + don't know how to compare the operands. + + * decl.c (grokdeclarator): Avoid seg fault when someone uses '__op' + as a declarator-id in their program. Like the Linux headers do. + Arrgh. + + * tree.c (lvalue_p): Treat calls to functions returning objects by + value as lvalues again. + + * typeck.c (build_component_addr): Use convert_force to convert the + pointer in case the component type is also a private base class. + + * search.c (get_matching_virtual): Fix bogus warning of overloaded + virtual. + + * pt.c (overload_template_name): Set DECL_ARTIFICIAL on the created + TYPE_DECL to fix bogus shadowing warnings. + +Fri Jul 22 01:15:32 1994 Jason Merrill + + * init.c (expand_aggr_init_1): const and volatile mismatches do not + prevent a TARGET_EXPR from initializing an object directly. + +Tue Jul 19 17:55:37 1994 Jason Merrill + + * cvt.c (build_up_reference): Allow building up references to + `this', don't warn about making references to artificial variables + (like `this'). + + * tree.c (lvalue_p): `this' is not an lvalue. + + * call.c (build_method_call): Accept using a typedef name (or + template type parameter) for explicit destructor calls. + +Thu Jul 14 09:42:23 1994 Mike Stump + + * Version 2.6.0 released. + +Wed Jul 13 03:57:54 1994 Jason Merrill + + * method.c (hack_identifier): Put back old code so lists of + non-functions will be handled properly. + + * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): #if 0 out; this macro is now + defined in the language-independent tree.h. + + * tree.c (count_functions): Avoid bogus warning when compiling this + function. + +Mon Jul 11 18:37:20 1994 Jason Merrill + + * decl.c (grok_reference_init): Always save the initializer of a + reference. + +Fri Jul 8 17:41:46 1994 Mike Stump + + * decl.c (cplus_expand_expr_stmt): Wrap statement expressions inside + CLEANUP_POINT_EXPRs so that the stack slots can be reused. + (disabled for now) + +Fri Jul 8 12:59:38 1994 Jason Merrill + + * method.c (hack_identifier): Fix for new overloading. + + * typeck.c (build_binary_op_nodefault): Don't mess with division by + zero. + +Fri Jul 8 13:20:28 1994 Gerald Baumgartner + + * decl2.c (finish_file): Only call walk_sigtables, if + flag_handle_signatures is turned on, don't waste time otherwise. + +Fri Jul 8 02:27:41 1994 Jason Merrill + + * decl.c (push_overloaded_decl): Don't create overloads of one when + shadowing a class type. + * typeck.c (build_x_function_call): Complain about overloads of one. + + * decl.c (grokdeclarator): Don't try to treat a char* as a tree. + (grokdeclarator): Fix setting of TREE_STATIC. + (start_decl): Clear DECL_IN_AGGR_P after calling duplicate_decls. + +Thu Jul 7 22:20:46 1994 Gerald Baumgartner + + * cp-tree.h (walk_sigtables): Created extern declaration. + * decl2.c (walk_sigtables): Created function, patterned after + walk_vtables, even though we only need it to write out sigtables. + (finish_sigtable_vardecl): Created function. + (finish_vtable_vardecl): Changed 0 to NULL_PTR. + (finish_file): Call walk_sigtables. + + * sig.c (build_signature_table_constructor): Mark class member + function pointed to from signature table entry as addressable. + +Thu Jul 7 13:39:37 1994 Jason Merrill + + * decl.c (start_decl): Check new decl of static member variable + against the declaration in the class here. + (grokvardecl): Instead of here. + + * class.c (prepare_fresh_vtable): Call import_export_vtable if not + -fvtable-thunks. + (build_vtable): Likewise. + + * decl2.c (import_export_vtable): Move logic for deciding the + interface of a template class from here. + (import_export_template): To here. + (finish_vtable_vardecl): Call import_export_template before + import_export_vtable. + +Wed Jul 6 20:25:48 1994 Mike Stump + + * except.c (init_exception_processing): Setup interim_eh_hook to + call lang_interim_eh. + * except.c (do_unwind): Propagate throw object value across + stack unwinding. + * except.c (saved_throw_value): Used to hold the value of the object + being thrown. It is always a reference to the real value. + * except.c (expand_start_catch_block): Add handling for the + value of the exception object. + * except.c (expand_start_catch_block): Add handler for the handler, + so that throws inside the handler go to the outer block. + * except.c (expand_end_catch_block): Likewise. + * parse.y (handler_args): Use parm instead, as the other doesn't yet + handle references correctly. + +Wed Jul 6 17:55:32 1994 Per Bothner + + * decl2.c (mark_vtable_entries): If -ftable-thunks, set the + vtable entry properly to abort. + +Tue Jul 5 14:07:54 1994 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Downgrade division by zero + errors to warnings. + + * call.c (build_overload_call_real): Handle fnname being a list of + functions. + * typeck.c (build_x_function_call): Pass list of functions to + build_overload_call, not just the name. + * tree.c (count_functions): Complain when called for invalid + argument. + + * decl.c (grokdeclarator): Fix settings of TREE_STATIC, TREE_PUBLIC + and DECL_EXTERNAL on static members and initialized const members. + * decl2.c (grokfield): Reflect this change. + +Fri Jul 1 09:35:51 1994 Jason Merrill + + * parse.y (init): ANSI C++ does not forbid { }. + +Thu Jun 30 00:35:22 1994 Jason Merrill + + * decl2.c (lang_decode_option): Set warn_nonvdtor along with -Wall. + warn_nonvdtor defaults to off. + + * class.c (instantiate_type): Use comptypes rather than relying on + types to satisfy ==. + + * decl.c (start_function): Set DECL_DEFER_OUTPUT on all inlines that + might be static. + + * tree.c (build_cplus_new): Never build WITH_CLEANUP_EXPRs. + + * decl.c (grok_reference_init): Deal with ADDR_EXPRs of TARGET_EXPRs. + + * cvt.c (cp_convert): Pass 0 to with_cleanup_p arg of + build_cplus_new. + +Wed Jun 29 22:31:09 1994 Jason Merrill + + * decl2.c (finish_file): Maybe consider static inlines multiple + times, in case they reference each other. + +Tue Jun 28 11:58:38 1994 Gerald Baumgartner + + * class.c (finish_struct): Don't `cons_up_default_function's + for signatures. + (finish_struct): Handle an empty method_vec correctly. + + * decl.c (grokdeclarator): Don't warn about a signature being + empty in a signature pointer declaration if we only saw a + forward declaration of the signature. Changed `warning's into + `cp_warning's. + + * sig.c (build_sigtable): Don't die if a null signature table + constructor is returned. + (build_signature_pointer_constructor): If the signature table + constructor is null, the _sptr field is set to a null pointer + and cast to the appropriate type. Make copies of all null + pointers so that the type null_pointer_node doesn't get changed. + (build_signature_table_constructor): Added comments. + + * sig.c (build_signature_pointer_constructor): Complain if we + try to assign to/initialize a signature pointer/reference of + an undefined signature. + +Mon Jun 27 14:05:16 1994 Gerald Baumgartner + + * typeck2.c (store_init_value): Don't be pedantic about + non-constant initializers of signature tables/pointers/references. + +Fri Jun 24 16:49:41 1994 Gerald Baumgartner + + * decl.c (grokdeclarator): If we are grokking an opaque typedef + in a signature, don't complain about it begin static. + +Wed Jun 29 16:44:45 1994 Mike Stump + + Fixes a problem of the this pointer being wrong in virtual calls to + methods that are not overridden in more derived classes. + + * class.c (fixup_vtable_delta): New routine. It will fixup the + delta entries in vtables, wheever they need updating. + * class.c (finish_struct): Call the new routine for all virtual + bases, as they can have different offsets, than those used in base + classes that we derive our vtable from. + +Tue Jun 28 23:49:28 1994 Jason Merrill + + * typeck.c (build_binary_op): Use the types before default + conversions in the error message. + + * *.c: Use c_build_type_variant instead of build_type_variant where + the type might be an array. + + * call.c (build_method_call): Call build_type_variant and + build_reference_type in the right order. + * decl.c (record_builtin_type): Likewise. + +Wed Jun 29 16:58:53 1994 Jason Merrill + + * call.c (build_method_call): Call build_type_variant and + build_reference_type in the right order. + * decl.c (record_builtin_type): Likewise. + +Tue Jun 28 23:49:28 1994 Jason Merrill + + * typeck.c (build_binary_op): Use the types before default + conversions in the error message. + + * *.c: Use c_build_type_variant instead of build_type_variant where + the type might be an array. + +Sat Jun 25 11:50:54 1994 Jason Merrill + + * cvt.c (convert_to_reference): Try UDC's before doing the + reinterpret_cast thang, though. + +Fri Jun 24 01:24:01 1994 Jason Merrill + + * typeck.c (c_expand_return): Don't USE the return value location + after we've expanded the jump. + + * decl2.c (finish_file): Make sure DECL_SAVED_INSNS is not 0 before + trying to write out an inline. + + * cvt.c (build_up_reference): Also do address adjustment when the + target type uses MI. + (convert_to_reference): Try UDCs only after built-in conversions. + (build_type_conversion_1): Don't play games with the argument to the + method. + (build_type_conversion): #if 0 out code for binding to reference. + +Thu Jun 23 00:22:28 1994 Jason Merrill + + * decl2.c (finish_file): Use TREE_SYMBOL_REFERENCED to decide + whether to emit inlines. + + * decl.c (grokdeclarator): Set explicit_int for decls that just + specify, say, 'long'. + + * init.c (do_friend): Do overload C functions (or call pushdecl, + anyaway). + +Wed Jun 22 13:40:49 1994 Jason Merrill + + * cvt.c (build_up_reference): Don't call readonly_error. + (convert_to_reference): Propagate const and volatile from expr to + its type. + + * tree.c (lvalue_p): Random CALL_EXPRs are not lvalues. + + * cvt.c (build_up_reference): Break out WITH_CLEANUP_EXPR when + creating a temporary. + (convert_to_reference): Lose excessive and incorrect trickiness. + (cp_convert): Call build_cplus_new with with_cleanup_p set. + + * typeck2.c (build_functional_cast): Likewise. + +Tue Jun 21 17:38:38 1994 Jason Merrill + + * decl.c (grokdeclarator): signed, unsigned, long and short all + imply 'int'. + + * decl.c (grokdeclarator): Allow "this is a type" syntax. + (grok_reference_init): Simplify and fix. + +Sun Jun 19 17:08:48 1994 Jason Merrill + + * decl.c (grokdeclarator): pedwarn about a typedef that specifies no + type. + +Sat Jun 18 04:16:50 1994 Jason Merrill + + * decl.c (start_function): Move TREE_PUBLIC and DECL_EXTERNAL + tinkering to after call to pushdecl. + +Fri Jun 17 14:48:28 1994 Jason Merrill + + * call.c (build_method_call): Handle destructors for non-aggregate + types properly. + +Thu Jun 16 16:48:05 1994 Jason Merrill + + * call.c (build_method_call): Make sure that the name given for the + destructor matches the constructor_name of the instance. + + * pt.c (do_function_instantiation): A non-extern instantiation + overrides a later extern one. + (do_type_instantiation): Likewise. + +Wed Jun 15 19:34:54 1994 Jason Merrill + + * init.c (expand_aggr_init): Use TYPE_MAIN_VARIANT to get the + unqualified array type. + + * cp-tree.h (EMPTY_CONSTRUCTOR_P): Tests whether NODE is a + CONSTRUCTOR with no elements. + + * decl.c (various): Lose empty_init_node. + (finish_decl): Use EMPTY_CONSTRUCTOR_P, do the empty CONSTRUCTOR + thing depending on the value of DECL_COMMON instead of + flag_conserve_space, do the empty CONSTRUCTOR thing for types that + don't have constructors, don't treat a real empty CONSTRUCTOR + specially. + + * typeck2.c (process_init_constructor): Don't treat empty_init_node + specially. + +Wed Jun 15 19:05:25 1994 Mike Stump + + * class.c (override_one_vtable): Don't forget to merge in an old + overrider when we wanted to reuse a vtable, but couldn't. + +Wed Jun 15 15:03:16 1994 Jason Merrill + + * decl.c (start_decl): Put statics in common again. + + * decl.c (grokdeclarator): Return NULL_TREE for an error rather than + setting the type to error_mark_node. + + * typeck.c (build_modify_expr): Build up a COMPOUND_EXPR for enum + bitfield assignments. + +Tue Jun 14 12:23:38 1994 Jason Merrill + + * decl.c (grok_op_properties): Const objects can be passed by value. + +Mon Jun 13 03:10:59 1994 Jason Merrill + + * decl2.c (import_export_vtable): Force implicit instantiations to + be interface_only when -fno-implicit-templates. + + * decl.c (duplicate_decls): Redeclaring a class template name is an + error. + + * pt.c (end_template_decl): Call GNU_xref_decl for class templates. + * xref.c (GNU_xref_decl): Support templates. + +Sat Jun 11 17:09:05 1994 Jason Merrill + + * decl.c (grok_op_properties): Split out checking for whether this + function should suppress the default assignment operator. + * decl2.c (grok_function_init): Likewise. + (copy_assignment_arg_p): New function to do just that. + Now considers virtual assignment operators that take a base as an + argument to count as copy assignment operators. + + * search.c (dfs_debug_mark): Lose checks for DWARF_DEBUG and + TREE_ASM_WRITTEN, as they are redundant. + + * pt.c (end_template_decl): Don't try to set DECL_CLASS_CONTEXT on a + decl that has no LANG_SPECIFIC part. + (do_type_instantiation): Force the debugging information for this + type to be emitted. + + * decl.c (start_decl): Clear up uses of various types of templates + (say sorry for static data members, rather than "invalid template"). + (expand_static_init): Fix initialization of static data members of + template classes. + +Fri Jun 10 00:41:19 1994 Jason Merrill + + * decl.c (grokdeclarator): Set DECL_CONTEXT on static data members. + + * g++.c (main): Use -xc++-cpp-output for .i files. + + * pt.c (tsubst): Give meaningful error about declaring template for + a copy constructor which was not declared in the class template. + (do_type_instantiation): Explicit instantiation before the class + template is an error. + (instantiate_template): Don't die if tsubst returns error_mark_node. + +Thu Jun 9 19:04:59 1994 Jason Merrill + + Don't synthesize the copy assignment operator if the one in a base + class is pure virtual. + * cp-tree.h (TYPE_HAS_ABSTRACT_ASSIGN_REF): New macro to indicate + whether the type has a pure virtual copy assignment operator. + * class.c (finish_base_struct): Don't generate the copy assignment + operator if a base class has a pure virtual one. + * decl.c (grok_op_properties): Add disabled code to set + TYPE_HAS_ABSTRACT_ASSIGN_REF with comment pointing to where it is + actually set. + * decl2.c (grok_function_init): Set TYPE_HAS_ABSTRACT_ASSIGN_REF. + + * decl2.c (import_export_vtable): Always treat template + instantiations as if write_virtuals >= 2, and treat implicit + instantiations as external if -fno-implicit-templates. + (finish_file): Output all pending inlines if + flag_keep_inline_functions. + +Wed Jun 8 20:48:02 1994 Mike Stump + + * tree.c (layout_vbasetypes): Align virtual base classes inside + complete objects, so that we don't core dump on machines such as + SPARCs when we access members that require larger than normal + alignments, such as a double. Also, we bump up the total alignment + on the complete type, as necessary. + +Wed Jun 8 16:18:14 1994 Jason Merrill + + * gxxint.texi (Free Store): New section with code for examining + cookie. + (Limitations of g++): Remove operator delete entry, since it is no + longer accurate. Fix access control entry. + + * typeck.c (build_unary_op): Pedwarn about taking the address of or + incrementing a cast to non-reference type. + (build_modify_expr): Use convert instead of convert_force again. + + * search.c (get_base_distance): Use IS_AGGR_TYPE_CODE to check for + class type, not == RECORD_TYPE. + + * decl.c (grokdeclarator): Cope with grokfndecl returning NULL_TREE. + + * typeck2.c (report_case_error): #if 0 out. + * lex.c (real_yylex): Lose RANGE. + * parse.y: Likewise. + +Tue Jun 7 18:17:35 1994 Jason Merrill + + * parse.y (simple_stmt, case ranges): Use ELLIPSIS instead of RANGE. + +Mon Jun 6 19:39:57 1994 Jason Merrill + + * typeck.c (build_c_cast): Don't shortcut conversions to the same + type. Don't replace consts with their values here, since that's now + done in cp_convert. + + * cvt.c (cp_convert): When converting to bool, take + integer_zero_node to false_node and all other INTEGER_CSTs to + true_node. + (build_type_conversion): Don't complain about multiple conversions + to float if we're not really converting. + +Fri Jun 3 02:10:56 1994 Jason Merrill + + Implement 'extern template class A;' syntax for suppressing + specific implicit instantiations. + * cp-tree.h: Update prototypes for do_*_instantiation. + * pt.c (do_pending_expansions): Don't compile 'extern' explicit + instantiations. + (do_function_instantiation): Set DECL_EXTERNAL on 'extern' explicit + instantiations. + (do_type_instantiation): Likewise. + * parse.y (explicit_instantiation): Support 'extern template class + A;' syntax. + * decl.c (start_function): Don't modify the settings of TREE_PUBLIC + and DECL_EXTERNAL on explicit instantiations. + + * cvt.c (cp_convert): Replace constants with their values before + converting. + (cp_convert): Consistently use 'e' instead of 'expr'. + +Thu Jun 2 03:53:30 1994 Jason Merrill + + * typeck2.c (build_x_arrow): Resolve OFFSET_REFs first. + +Wed Jun 1 18:57:35 1994 Jason Merrill + + * typeck2.c (digest_init): Handle initializing a pmf with an + overloaded method. + * typeck.c (build_ptrmemfunc): Handle overloaded methods. + + * decl.c (pushtag): Use build_decl to make TYPE_DECLs. + (xref_defn_tag): Likewise. + * pt.c (process_template_parm): Likewise. + (lookup_template_class): Likewise. + (push_template_decls): Likewise. + (instantiate_class_template): Likewise. + (create_nested_upt): Likewise. + * class.c (finish_struct): Don't try to set DECL_CLASS_CONTEXT on + TYPE_DECLs. + + * typeck.c (convert_arguments): Make sure type is not NULL before + checking its TREE_CODE. + +Wed Jun 1 17:40:39 1994 Mike Stump + + * class.c (get_derived_offset): New routine. + * class.c (finish_base_struct): Make sure we set BINFO_VTABLE and + BINFO_VIRTUALS when we choose a new base class to inherit from. + * class.c (modify_one_vtable): Use get_derived_offset to get the + offset to the most base class subobject that we derived this binfo + from. + * class.c (finish_struct): Move code to calculate the + DECL_FIELD_BITPOS of the vfield up, as we need might need it for + new calls to get_derived_offset in modify_one_vtable. + +Wed Jun 1 16:50:59 1994 Jason Merrill + + * init.c (build_member_call): Use build_pointer_type instead of + TYPE_POINTER_TO. + +Wed Jun 1 11:11:15 1994 Brendan Kehoe + + * decl.c (grokdeclarator): Make sure we have a DNAME set before we + try to use it in an error. + +Wed Jun 1 09:48:49 1994 Mike Stump + + * typeck.c (convert_arguments, convert_for_initialization): Don't + strip NOP_EXPRs, when we are converting to a reference. + +Wed Jun 1 01:11:38 1994 Jason Merrill + + * typeck.c (build_modify_expr): Don't dereference references when + initializing them. + + * decl2.c (grokfield): Don't check for grokdeclarator returning + error_mark_node any more. + + * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. + (start_method): Return void_type_node instead of error_mark_node. + + * typeck.c (build_modify_expr): Resolve offset refs earlier. + +Tue May 31 16:06:58 1994 Jason Merrill + + * call.c (build_method_call): Resolve OFFSET_REFs in the object. + + * typeck.c (build_modify_expr): Dereference references before trying + to assign to them. + + * call.c (build_method_call): Don't confuse type conversion + operators with constructors. + * typeck2.c (build_functional_cast): Just call build_c_cast if there + was only one parameter. + * method.c (build_typename_overload): Don't set + IDENTIFIER_GLOBAL_VALUE on these identifiers. + * decl.c (grok_op_properties): Warn about defining a type conversion + operator that converts to a base class (or reference to it). + * cvt.c (cp_convert): Don't try to use a type conversion operator + when converting to a base class. + (build_type_conversion_1): Don't call constructor_name_full on an + identifier. + * cp-tree.h (DERIVED_FROM_P): Should be self-explanatory. + + * decl.c (start_decl): Don't complain that error_mark_node is an + incomplete type. + (finish_decl): Check for type == error_mark_node. + +Mon May 30 23:38:55 1994 Jason Merrill + + * decl.c (start_function): Set DECL_DEFER_OUTPUT on implicit + instantiations and inline members. + + * spew.c (yylex): Set looking_for_template if the next token is a '<'. + + * lex.h: Declare looking_for_template. + + * decl.c (lookup_name_real): Use looking_for_template to arbitrate + between type and template interpretations of an identifier. + +Sat May 28 04:07:40 1994 Jason Merrill + + * pt.c (instantiate_template): Zero out p if we found a + specialization. + + * decl.c (grokdeclarator): Elucidate warning. + (grokdeclarator): If pedantic AND -ansi, complain about long long. + + Make explicit instantiation work reasonably. It is now appropriate + to deprecate the use of -fexternal-templates. + * pt.c (instantiate_template): Set DECL_TEMPLATE_SPECIALIZATION or + DECL_IMPLICIT_INSTANTIATION on fndecl as appropriate. + (end_template_instantiation): Reflect changes in USE_TEMPLATE + semantics. + (do_pending_expansions): if (!flag_implicit_templates) DECIDE(0); + (do_function_instantiation): Don't set EXPLICIT_INST if + flag_external_templates is set. Do set TREE_PUBLIC and DECL_EXTERN + appropriately otherwise. + (do_type_instantiation): Set interface info for class. Set + TREE_PUBLIC and DECL_EXTERN for methods. Do none of this if + flag_external_templates is set. + * parse.y: Reflect changes in USE_TEMPLATE semantics. + * decl2.c: New flag flag_implicit_templates determines whether or + not implicit instantiations get emitted. This flag currently + defaults to true, and must be true for -fexternal-templates to work. + (finish_file): Consider flag_implement_inlines when + setting DECL_EXTERNAL. Consider flag_implicit_templates when + deciding whether or not to emit a static copy. + * decl.c (start_function): Set TREE_PUBLIC and DECL_EXTERNAL + properly for template instantiations. + (start_method): Set DECL_IMPLICIT_INSTANTIATION on methods of a + template class. + * cp-tree.h (CLASSTYPE_USE_TEMPLATE): Change semantics. + (DECL_USE_TEMPLATE): Parallel macro for FUNCTION and VAR_DECLs. + (various others): Accessor macros for the above. + +Fri May 27 13:57:40 1994 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Division by constant zero is + an error. + +Fri May 27 13:50:15 1994 Mike Stump + + * class.c (override_one_vtable): Don't modify things we don't own. + +Fri May 27 01:42:58 1994 Jason Merrill + + * decl.c (finish_decl): Don't postpone processing the initializer of + a decl with DECL_EXTERNAL set, and do call rest_of_compilation for a + PUBLIC const at toplevel. + (grokdeclarator): pedwarn about initializing non-const or + non-integral statics in the class body. + + * decl.c (pushtag): Don't try to set DECL_CLASS_CONTEXT on a + TYPE_DECL. + + * call.c (convert_harshness): Dereference reference on rhs before + proceeding, properly grok passing const things to non-const + references. + + * typeck.c (build_unary_op): Soften error about taking the address + of main() to a pedwarn. + + * lex.c (default_copy_constructor_body): Unambiguously specify base + classes (i.e. A((const class ::A&)_ctor_arg) ). + (default_assign_ref_body): Likewise. + +Thu May 26 13:13:55 1994 Gerald Baumgartner + + * decl2.c (grokfield): Don't complain about local signature + method declaration without definition. + + * call.c (convert_harshness): If `type' is a signature pointer + and `parmtype' is a pointer to a signature, just return 0. We + don't really convert in this case; it's a result of making the + `this' parameter of a signature method a signature pointer. + + * call.c (build_method_call): Distinguish calling the default copy + constructor of a signature pointer/reference from a signature + member function call. + +Thu May 26 12:56:25 1994 Jason Merrill + + * decl2.c (grokfield): Don't set TREE_PUBLIC on member function + declarations. + + * decl.c (duplicate_decls): A previous function declaration as + static overrides a subsequent non-static definition. + (grokdeclarator): Don't set TREE_PUBLIC on inline method + declarations. + +Wed May 25 14:36:38 1994 Jason Merrill + + * decl.c (grokdeclarator): Handle initialization of static const + members. + (finish_decl): Likewise. + + * decl2.c (grokfield): Allow initialization of static const members + even when pedantic. + + * decl2.c (grokfield): Deal with grokdeclarator returning + error_mark_node. + + * decl.c (grok_ctor_properties): Return 0 for A(A) constructor. + (grokfndecl): Check the return value of grok_ctor_properties. + (start_method): Likewise. + + * parse.y (absdcl): Expand type_quals inline. + +Tue May 24 19:10:32 1994 Jason Merrill + + * decl.c (pushtag): Use IS_AGGR_TYPE rather than checking for a + RECORD_TYPE. + +Tue May 24 18:09:16 1994 Per Bothner + + * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks, + always use "__vt_%s". + * decl2.c (finish_vtable_vardecl): Don't consider abstract virtuals + when looking for a "sentinal" method (to decide on emitting vtables). + * decl2.c (finish_file): Scan all decls for thunks that need + to be emitted. + * decl2.c (finish_vtable_vardecl): Don't bother calling emit_thunk. + * method.c (make_thunk): Use a more meaningful label. If there + exists a matching top-level THUNK_DECL re-use it; otherwise + create a new THUNK_DECL (and declare it). + * method.c (emit_thunk): Make thunk external/public depending + on the underlying method. + +Tue May 24 00:22:04 1994 Jason Merrill + + * pt.c (tsubst): Use lookup_name_nonclass to find guiding decls, not + lookup_name. + + * call.c (build_overload_call_real): Don't immediately pick a + function which matches perfectly. + + * decl.c (grokdeclarator): Use c_build_type_variant for arrays. + (grokdeclarator): Warn about, and throw away, cv-quals attached to a + reference (like 'int &const j'). + + * typeck.c (convert_arguments): Don't mess with i for methods. + * call.c (build_method_call): Pass the function decl to + convert_arguments. + + * typeck.c (comp_ptr_ttypes_real): New function. Implements the + checking for which multi-level pointer conversions are allowed. + (comp_target_types): Call it. + (convert_for_assignment): Check const parity on the ultimate target + type, too. And make those warnings pedwarns. + +Mon May 23 14:11:24 1994 Jason Merrill + + * error.c (dump_char): Use TARGET_* for character constants. + +Mon May 23 13:03:03 1994 Brendan Kehoe + + * tree.c (debug_no_list_hash): Make static. + + * decl.c (decls_match): Say the types don't match if newdecl ends up + with a null type, after we've checked if olddecl does. + (pushdecl): Check if the decls themselves match before looking for + an extern redeclared as static, to avoid inappropriate and incorrect + warnings. + +Fri May 20 14:04:34 1994 Jason Merrill + + * decl.c (grokdeclarator): Make warning about duplicate short, etc. + a pedwarn. + + * typeck.c (build_c_cast): Casting to function or method type is an + error. + + * class.c (finish_struct): Make warning for anonymous class with no + instances a pedwarn. + + * Makefile.in (stamp-parse): Expect a s/r conflict. + + * typeck.c (build_modify_expr): pedwarn about using a non-lvalue + cast as an lvalue. + +Thu May 19 12:08:48 1994 Jason Merrill + + * cvt.c (type_promotes_to): Make sure bool promotes to int rather + than unsigned on platforms where sizeof(char)==sizeof(int). + +Wed May 18 14:27:06 1994 Jason Merrill + + * typeck.c (build_c_cast): Tack on a NOP_EXPR when casting to + another variant. + (build_modify_expr): Don't strip NOP_EXPRs, and don't get tricky + and treat them as lvalues. + + * decl.c (shadow_tag): Do complain about forward declarations of + enums and empty declarations. + * parse.y: Don't complain about forward declarations of enums and + empty declarations. + + * typeck.c (convert_for_assignment): Complain about changing + the signedness of a pointer's target type. + + * parse.y (stmt): Move duplicated code for checking case values from + here. + * decl2.c (check_cp_case_value): To here. And add a call to + constant_expression_warning. + + * typeck.c (convert_for_assignment): Don't complain about assigning + a negative value to bool. + + * decl.c (init_decl_processing): Make bool unsigned. + + * class.c (finish_struct): Allow bool bitfields. + +Wed May 18 12:35:27 1994 Ian Lance Taylor + + * Make-lang.in (c++.install-man): Get g++.1 from $(srcdir)/cp. + +Wed May 18 03:28:35 1994 Jason Merrill + + * cvt.c (build_type_conversion): Lose special handling of + truthvalues. + + * search.c (dfs_pushdecls): Improve shadowing warning. + +Tue May 17 13:34:46 1994 Jason Merrill + + * init.c (build_delete): Throw away const and volatile on `this'. + + * decl.c (finish_enum): Put the constants in TYPE_VALUES again, + rather than the enumerators. + (pushtag): s/cdecl/c_decl/g + +Mon May 16 23:04:01 1994 Stephen R. van den Berg + + * cp/typeck.c (common_type): Attribute merging. + (comp_types): Utilize COMP_TYPE_ATTRIBUTES macro. + + * cp/parse.y: Revamp attribute parsing. + +Mon May 16 01:40:34 1994 Jason Merrill + + * decl.c (shadow_tag): Also check for inappropriate use of auto and + register. + + * method.c (build_overload_name): Clarify that the illegal case is a + pointer or reference to array of unknown bound. + + * error.c (dump_type_prefix): Print references to arrays properly. + + * typeck.c (various): Be more helpful in pointer + comparison diagnostics. + + * tree.c (lvalue_p): MODIFY_EXPRs are lvalues again. Isn't this + fun? + + * parse.y: Also catch an error after valid stmts. + + * search.c (dfs_init_vbase_pointers): Don't abort because `this' is + const. + + * typeck.c (convert_for_initialization): If call to + convert_to_reference generated a diagnostic, print out the parm + number and function decl if any. + + * errfn.c (cp_thing): Check atarg1 to determine whether or not we're + specifying a line, not atarg. + + * tree.c (build_cplus_method_type): Always make `this' const. + + * decl2.c (grokclassfn): If -fthis-is-variable and this function is + a constructor or destructor, make `this' non-const. + + * typeck.c (build_modify_expr): Don't warn specially about + assignment to `this' here anymore, since it will be caught by the + usual machinery. + + * various: Disallow specific GNU extensions (variable-size arrays, + etc.) when flag_ansi is set, not necessarily when pedantic is set, + so that people can compile with -pedantic-errors for tighter const + checking and such without losing desirable extensions. + + * typeck2.c (build_functional_cast): Call build_method_call with + LOOKUP_PROTECT. + (process_init_constructor): Only process FIELD_DECLs. + + * decl.c (finish_decl): Also force static consts with no explicit + initializer that need constructing into the data segment. + + * init.c (build_delete): Undo last patch, as it interferes with + automatic cleanups. + +Sat May 14 01:59:31 1994 Jason Merrill + + * call.c, class.h, cp-tree.h, cvt.c, decl2.c: Lose old overloading + code. + + * init.c (build_delete): pedwarn about using plain delete to delete + an array. + +Fri May 13 16:45:07 1994 Jason Merrill + + * typeck.c (comp_target_types): Be more helpful in contravariance + warnings, and make them pedwarns. + + * decl.c (grokdeclarator): Use decl_context to decide whether or not + this is an access declaration. + + * class.c (finish_struct_bits): Set TYPE_HAS_INT_CONVERSION if it + has a conversion to enum or bool, too. + +Fri May 13 16:31:27 1994 Mike Stump + + * method.c (emit_thunk): Make declaration for + current_call_is_indirect local (needed for hppa). + +Fri May 13 16:16:37 1994 Jason Merrill + + * pt.c (uses_template_parms): Grok BOOLEAN_TYPE. + (tsubst): Likewise. + +Fri May 13 16:23:32 1994 Mike Stump + + * pt.c (tsubst): If there is already a function for this expansion, + use it. + * pt.c (instantiate_template): Likewise. + +Fri May 13 10:30:42 1994 Brendan Kehoe + + * parse.y (implicitly_scoped_stmt, simple_stmt case): Use + kept_level_p for MARK_ENDS argument to expand_end_bindings, to avoid + generating debug info for unemitted symbols on some systems. + + * cp-tree.h (build_static_cast, build_reinterpret_cast, + build_const_cast): Add declarations. + +Fri May 13 09:50:31 1994 Mike Stump + + * search.c (expand_indirect_vtbls_init): Fix breakage from Apr 27 + fix. We now try get_binfo, and if that doesn't find what we want, + we go back to the old method, which still sometimes fails. + +Fri May 13 01:43:18 1994 Jason Merrill + + * parse.y (initdcl): Call cplus_decl_attributes on the right + variable. + * decl2.c (cplus_decl_attributes): Don't call decl_attributes for + void_type_node. + + * typeck.c (build_binary_op_nodefault): Change result_type for + comparison ops to bool. + (build_binary_op): Convert args of && and || to bool. + * cvt.c (build_default_binary_type_conversion): Convert args of && + and || to bool. + (build_default_unary_type_conversion): Convert arg of ! to bool. + (type_promotes_to): bool promotes to int. + +Fri May 13 01:43:18 1994 Mike Stump + + Implement the new builtin `bool' type. + * typeck.c (build_binary_op_nodefault): Convert args of && and || to + bool. + (build_unary_op): Convert arg of ! to bool. + * parse.y: Know true and false. Use bool_truthvalue_conversion. + * method.c (build_overload_value): Know bool. + (build_overload_name): Likewise. + * lex.c (init_lex): Set up RID_BOOL. + * gxx.gperf: Add bool, true, false. + * error.c (*): Know bool. + * decl.c (init_decl_processing): Set up bool, true, false. + * cvt.c (cp_convert): Handle conversion to bool. + (build_type_conversion): Likewise. + * *.c: Accept bool where integers and enums are accepted (use + INTEGRAL_CODE_P macro). + +Thu May 12 19:13:54 1994 Richard Earnshaw + + * g++.c: Use #ifdef for __MSDOS__, not #if. + +Thu May 12 18:05:18 1994 Mike Stump + + * decl2.c (lang_f_options): Handle -fshort-temps. -fshort-temps + gives old behavior , and destroys temporaries earlier. Default + behavior now conforms to the ANSI working paper. + +Thu May 12 14:45:35 1994 Jason Merrill + + * typeck.c (build_modify_expr): Understand MODIFY_EXPR as an lvalue. + Use convert_force to convert the result of a recursive call when we + are dealing with a NOP_EXPR. Don't automatically wrap MODIFY_EXPRs + in COMPOUND_EXPRs any more. + (various): Lose pedantic_lvalue_warning. + (unary_complex_lvalue): Understand MODIFY_EXPR. + + * cvt.c (convert_to_reference): Allow DECL to be error_mark_node if + we don't know what we're initializing. + +Wed May 11 01:59:36 1994 Jason Merrill + + * cvt.c (convert_to_reference): Modify to use convtype parameter. + Only create temporaries when initializing a reference, not when + casting. + (cp_convert): New main function. + (convert): Call cp_convert. + * cvt.c, decl.c, typeck.c: Fix calls to convert_to_reference. + * cp-tree.h (CONV_*): New constants used by conversion code for + selecting conversions to perform. + + * tree.c (lvalue_p): MODIFY_EXPRs are no longer lvalues. + + * typeck.c (build_{static,reinterpret,const_cast): Stubs that just + call build_c_cast. + * parse.y: Add {static,reinterpret,const}_cast. + * gxx.gperf: Likewise. + + * typeck.c (common_type): Allow methods with basetypes of different + UPTs. + (comptypes): Deal with UPTs. + (build_modify_expr): Wrap all MODIFY_EXPRs in a COMPOUND_EXPR. + + * pt.c (end_template_decl): Check for multiple definitions of member + templates. + + * call.c (build_method_call): Complain about calling an abstract + virtual from a constructor. + + * typeck.c (pointer_int_sum): Check for the integer operand being 0 + after checking the validity of the pointer operand. + + * typeck2.c (digest_init): Pedwarn about string initializer being + too long. + +Tue May 10 12:10:28 1994 Jason Merrill + + * decl.c (push_overloaded_decl): Only throw away a builtin if the + decl in question is the artificial one. + + * parse.y (simple_stmt, switch): Use implicitly_scoped_stmt because + expand_{start,end}_case cannot happen in the middle of a block. + + * cvt.c (build_type_conversion_1): Use convert again. + +Tue May 10 11:52:04 1994 Brendan Kehoe + + * typeck2.c (digest_init): Make sure we check for signed and + unsigned chars as well when warning about string initializers. + + * init.c (emit_base_init): Check if there's a DECL_NAME on the + member before trying to do an initialization for it. + +Tue May 10 11:34:37 1994 Mike Stump + + * except.c: Don't do anything useful when cross compiling. + +Tue May 10 03:04:13 1994 Jason Merrill + + * decl.c (duplicate_decls): Fix up handling of builtins yet again. + (push_overloaded_decl): Likewise. + + * cvt.c (convert): Don't look for void type conversion. + +Mon May 9 18:05:41 1994 Jason Merrill + + * init.c (do_friend): Only do a pushdecl for friends, not + pushdecl_top_level. + +Mon May 9 13:36:34 1994 Jim Wilson + + * decl.c (lookup_name_current_level): Put empty statement after + the label OUT to make the code valid C. + +Mon May 9 12:20:57 1994 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Only complain about + comparing void * and a function pointer if void * is smaller. + +Sun May 8 01:29:13 1994 Jason Merrill + + * decl.c (lookup_name_current_level): Move through temporary binding + levels. + + * parse.y (already_scoped_stmt): Revive. + (simple_stmt): Use it again. + + * decl.c (poplevel): Always call poplevel recursively if we're + dealing with a temporary binding level. + +Sat May 7 10:52:28 1994 Mike Stump + + * decl.c (finish_decl): Make sure we run cleanups for initial values + of decls. Cures memory leak. + * decl.c (expand_static_init): Likewise for static variables. + * decl2.c (finish_file): Likewise for globals. + +Sat May 7 03:57:44 1994 Jason Merrill + + * typeck.c (commonparms): Don't complain about redefining default + args. + + * decl.c (duplicate_decls): Don't complain twice about conflicting + function decls. + (decls_match): Don't look at default args. + (redeclaration_error_message): Complain about redefining default + args. + + * call.c (build_overload_call_real): Also deal with guiding + declarations coming BEFORE the template decl. + + * pt.c (unify): Allow different parms to have different + cv-qualifiers. + (unify): Allow trivial conversions on non-template parms. + +Fri May 6 03:53:23 1994 Jason Merrill + + * pt.c (tsubst): Support OFFSET_TYPEs. + (unify): Likewise. + + * decl2.c (finish_decl_parsing): Call push_nested_class with a type. + + * init.c (build_offset_ref): Fix error message. + * search.c (lookup_field): Likewise. + + * call.c (build_scoped_method_call): Pass binfo to + build_method_call. + * typeck.c (build_object_ref): Likewise. + + * typeck2.c (binfo_or_else): Don't return a _TYPE. + + * class.c (finish_struct): Don't complain about re-use of inherited + names or shadowing of type decls. + * decl.c (pushdecl_class_level): Likewise. + + * decl.c (finish_enum): Set the type of all the enums. + + * class.c (finish_struct): Don't get confused by access decls. + + * cp-tree.h (TYPE_MAIN_DECL): New macro to get the _DECL for a + _TYPE. You can stop using TYPE_NAME for that now. + + * parse.y: Lose doing_explicit (check $0 instead). + * gxx.gperf: 'template' now has a RID. + * lex.h (rid): Likewise. + * lex.c (init_lex): Set up the RID for 'template'. + + * parse.y (type_specifier_seq): typed_typespecs or + nonempty_type_quals. Use it. + (handler_args): Fix bogus syntax. + (raise_identifier{,s}, optional_identifier): Lose. + * except.c (expand_start_catch_block): Use grokdeclarator to parse + the catch variable. + (init_exception_processing): The second argument to + __throw_type_match is ptr_type_node. + + Fri May 6 07:18:54 1994 Chip Salzenberg + + [ change propagated from c-decl.c of snapshot 940429 ] + * cp/decl.c (finish_decl): Setting asmspec_tree should not + zero out the old RTL. + +Fri May 6 01:25:38 1994 Mike Stump + + Add alpha exception handling support to the compiler. + Quick and dirty backend in except.c. + + * cp/*: Remove most remnants of old exception handling support. + * decl.c (finish_function): Call expand_exception_blocks to put + the exception hanlding blocks at the end of the function. + * dec.c (hack_incomplete_structures): Make sure expand_decl_cleanup + comes after expand_decl_init. + * except.c: Reimplementation. + * expr.c (cplus_expand_expr): Handle THROW_EXPRs. + * lex.c (init_lex): Always have catch, try and throw be reserved + words, so that we may always parse exception handling. + * parse.y: Cleanup to support new interface into exception handling. + * tree.def (THROW_EXPR): Add. + +Thu May 5 17:35:37 1994 Jason Merrill + + * parse.y (simple_stmt, for loops): Use implicitly_scoped_stmt. + (various): Lose .kindof_pushlevel and partially_scoped_stmt. + +Thu May 5 16:17:27 1994 Kung Hsu + + * parse.y (already_scoped_stmt): Move expand_end_binding() to + fix the unmatched LBB/LBE in stabs. + +Thu May 5 14:36:17 1994 Jason Merrill + + * decl.c (set_nested_typename): Set TREE_MANGLED on the new + identifiers. + (pushdecl): Check TREE_MANGLED. + (xref_tag): Likewise. + * cp-tree.h (TREE_MANGLED): This identifier is a + DECL_NESTED_TYPENAME (named to allow for future use to denote + mangled function names as well). + + Implement inconsistency checking specified in [class.scope0]. + * decl.c (lookup_name_real): Don't set ICV here after all. + (finish_enum): Also set the type of the enumerators themselves. + (build_enumerator): Put the CONST_DECL in the list instead of its + initial value. + (pushdecl_class_level): Check inconsistent use of a name in the + class body. + * class.c (finish_struct): Check inconsistent use of a name in the + class body. Don't set DECL_CONTEXT on types here anymore. + * parse.y (qualified_type_name): Note that the identifier has now + been used (as a type) in the class body. + * lex.c (do_identifier): Note that the identifier has now been used + (as a constant) in the class body. + * error.c (dump_decl): Print type and enum decls better. + +Thu May 5 09:35:35 1994 Brendan Kehoe + + * typeck.c (build_modify_expr): Warn about assignment to `this'. + +Wed May 4 15:55:49 1994 Jason Merrill + + * init.c (build_delete): Use the global operator delete when + requested. + + * decl.c (lookup_name_real): If we find the type we're looking in a + base class while defining a class, set IDENTIFIER_CLASS_VALUE for + the type. + + * class.c (finish_struct): Remove a couple of dependencies on + language linkage. + + * decl.c (pushtag): Classes do nest in extern "C" blocks. + (pushdecl): Only set DECL_NESTED_TYPENAME on the canonical one for + the type. + (pushtag): Remove another dependency on the language linkage. + + * lex.c (cons_up_default_function): Don't set DECL_CLASS_CONTEXT to + a const-qualified type. + + * decl.c (push_overloaded_decl): Throw away built-in decls here. + (duplicate_decls): Instead of here. + +Wed May 4 15:27:40 1994 Per Bothner + + * typeck.c (get_member_function_from_ptrfunc): Do The Right + Thing (I hope) if we're using thunks. + +Wed May 4 13:52:38 1994 Jason Merrill + + * parse.y (specialization): aggr template_type_name ';'. + (named_class_head_sans_basetype): Use it. + (explicit_instantiation): Likewise. + (tmpl.2): Revert. + + * cvt.c (build_type_conversion_1): Use convert_for_initialization, + rather than convert, to do conversions after the UDC. + + * cp-tree.h (SHARED_MEMBER_P): This member is shared between all + instances of the class. + + * search.c (lookup_field): If the entity found by two routes is the + same, it's not ambiguous. + +Wed May 4 12:10:00 1994 Per Bothner + + * decl.c (lookup_name_real): Check for a NULL TREE_VALUE, + to prevent the compiler from crashing ... + +Wed May 4 11:19:45 1994 Jason Merrill + + * call.c (build_method_call): If we don't have an object, check + basetype_path to figure out where to look up the function. + + * typeck.c (convert_for_initialization): Pass TYPE_BINFO (type) to + build_method_call in case exp is NULL_TREE. + +Tue May 3 16:02:53 1994 Per Bothner + + Give a vtable entries a unique named type, for the sake of gdb. + * class.c (build_vtable_entry): The address of a thunk now has + type vtable_entry_type, not ptr_type_node. + * method.c (make_thunk): Fix type of THUNK_DECL. + * class.c (add_virtual_function, override_one_vtable): Use + vfunc_ptr_type_node, instead of ptr_type_node. + * cp-tree.h (vfunc_ptr_type_node): New macro. + * decl.c (init_decl_processing): Make vtable_entry_type + be a unique type of pointer to a unique function type. + +Tue May 3 09:20:44 1994 Jason Merrill + + * parse.y (do_explicit): Sets doing_explicit to 1. + (explicit_instantiation): Use do_explicit rather than TEMPLATE + directly, add "do_explicit error" rule. + (datadef): Set doing_explicit to 0 after an explicit instantiation. + (tmpl.2): Don't instantiate if we see a ';' unless we're doing an + explicit instantiation. + (named_class_head_sans_basetype): Remove aggr template_type_name + ';' again. + +Mon May 2 23:17:21 1994 Jason Merrill + + * search.c (lookup_nested_tag): Lose. + + * decl2.c (grokfield): Set DECL_CONTEXT on TYPE_DECLs. + (lookup_name_nonclass): Lose. + + * decl.c (poplevel_class): Add force parameter. + (lookup_name_real): Fix handling of explicit scoping which specifies + a class currently being defined. Add 'nonclass' argument. + (lookup_name, lookup_name_nonclass): Shells for lookup_name_real. + + * class.c (finish_struct): Don't unset IDENTIFIER_CLASS_VALUEs here. + (popclass): Force clearing of IDENTIFIER_CLASS_VALUEs if we're being + called from finish_struct. + +Mon May 2 19:06:21 1994 Per Bothner + + * decl.c (init_decl_processing), cp-tree.h: Removed memptr_type. + (It seeems redundant, given build_ptrmemfunc_type.) + * typeck.c (get_member_function_from_ptrfunc), gc.c (build_headof, + build_classof): Use vtable_entry_type instead of memptr_type. + * method.c (emit_thunk): Call poplevel with functionbody==0 + to prevent DECL_INITIAL being set to a BLOCK. + +Mon May 2 15:02:11 1994 Jason Merrill + + * parse.y (named_class_head_sans_basetype): Add "aggr + template_type_name ';'" rule for forward declaration of + specializations. + +Mon May 2 15:02:11 1994 Jason Merrill + + * class.c (instantiate_type): Deal with pmf's. + + * Make-lang.in (cc1plus): Don't depend on OBJS or BC_OBJS, since + stamp-objlist does. + + * Makefile.in (../cc1plus): Depend on OBJDEPS. + (OBJDEPS): Dependency version of OBJS. + +Mon May 2 12:51:31 1994 Kung Hsu + + * search.c (dfs_debug_mark): Unmark TYPE_DECL_SUPPRESS_DEBUG, not + DECL_IGNORED_P. + +Fri Apr 29 12:29:56 1994 Jason Merrill + + * class.c (finish_struct): Clear out memory of local tags. And + typedefs. + + * decl2.c (grokclassfn): Don't set DECL_CONTEXT to a cv-qualified + type. + * search.c (get_matching_virtual): Be more helpful in error message. + + * *: Use DECL_ARTIFICIAL (renamed from DECL_SYNTHESIZED). + + * lex.c (default_assign_ref_body): Expect TYPE_NESTED_NAME to work. + (default_copy_constructor_body): Likewise. + + * class.c (finish_struct): Don't gratuitously create multiple decls + for nested classes. + +Thu Apr 28 23:39:38 1994 Jason Merrill + + Avoid clobbering the arg types of other functions when reverting + static member functions. + * decl.c (revert_static_member_fn): Rearrange arguments, don't + require values for 'fn' and 'argtypes', add warning to comment + above. + (decls_match): Rearrange arguments in call to rsmf. + (grok_op_properties): Don't pass values for fn and argtypes. + * pt.c (instantiate_template): Don't pass values for fn and argtypes. + +Thu Apr 28 16:29:11 1994 Doug Evans + + * Make-lang.in (cc1plus): Depend on stamp-objlist. + * Makefile.in (BC_OBJS): Delete. + (OBJS): Cat ../stamp-objlist to get language independent files. + Include ../c-common.o. + (../cc1plus): Delete reference to BC_OBJS. + +Thu Apr 28 02:12:08 1994 Jason Merrill + + * search.c (compute_access): No really, deal with static members + properly. Would I lie to you? + + Implement lexical hiding of function declarations. + * pt.c (tsubst): Use lookup_name to look for function decls to guide + instantiation. + * method.c (build_opfncall): Use lookup_name_nonclass to look for + non-member functions. + * init.c (do_friend): Use lookup_name_nonclass to look for + functions. + * error.c (ident_fndecl): Use lookup_name to look for functions. + * decl2.c (lookup_name_nonclass): New function, skips over + CLASS_VALUE. + * decl.c (struct binding_level): Lose overloads_shadowed field. + (poplevel): Don't deal with overloads_shadowed. + (push_overloaded_decl): Do lexical hiding for functions. + * class.c (instantiate_type): Don't check non-members if we have + members with the same name. + * call.c (build_method_call): Use lookup_name_nonclass instead of + IDENTIFIER_GLOBAL_VALUE to check for non-member functions. + (build_overload_call_real): Likewise. + + * decl.c (duplicate_decls): Check for ambiguous overloads here. + (push_overloaded_decl): Instead of here. + + * decl.c (pushdecl): Back out Chip's last change. + + * decl.c (grok_op_properties): Operators cannot be static members. + + * cp-tree.h (DECL_SYNTHESIZED): DECL_SOURCE_LINE == 0 + (SET_DECL_SYNTHESIZED): DECL_SOURCE_LINE = 0 + * lex.c (cons_up_default_function): Use SET_DECL_SYNTHESIZED. + + * method.c (do_inline_function_hair): Don't put friends of local + classes into global scope, either. + + * typeck2.c (build_functional_cast): Don't look for a function call + interpretation. + +Thu Apr 28 15:19:46 1994 Mike Stump + + * cp-tree.h: Disable use of backend EH. + +Wed Apr 27 21:01:24 1994 Doug Evans + + * Make-lang.in (c++.distdir): mkdir tmp/cp first. + * Makefile.in (INCLUDES): Move definition to same place as + parent makefile. + (ALLOCA): Define. + (OLDAR_FLAGS): Delete. + (OLDCC): Define. + (DIR): Delete. + (CLIB): Define. + (####site): Delete. + (SUBDIR_USE_ALLOCA): Don't use ALLOCA if compiling with gcc. + +Wed Apr 27 19:10:04 1994 Kung Hsu + + * decl.c (xref_tag): Not to use strstr(), it's not available on + all platforms. + +Wed Apr 27 18:10:12 1994 Jason Merrill + + * class.c (finish_struct): Resolve yet another class/pmf confusion. + + * call.c (build_overload_call_real): Don't take the single-function + shortcut if we're dealing with an overloaded operator. + +Wed Apr 27 17:35:37 1994 Mike Stump + + * search.c (get_base_distance): Search the virtual base class + binfos, incase someone wants to convert to a real virtual base + class. + * search.c (expand_indirect_vtbls_init): Use convert_pointer_to_real + instead of convert_pointer_to, as it now will work. + +Wed Apr 27 15:36:49 1994 Jason Merrill + + * cvt.c (convert_to_reference): Don't complain about casting away + const and volatile. + + * typeck.c (build_unary_op): References are too lvalues. + +Wed Apr 27 13:58:05 1994 Mike Stump + + * class.c (override_one_vtable): We have to prepare_fresh_vtable + before we modify it, not after, also, we cannot reuse an old vtable, + once we commit to a new vtable. Implement ambiguous overrides in + virtual bases as abstract. Hack until we make the class + ill-formed. + +Wed Apr 27 01:17:08 1994 Jason Merrill + + * parse.y (unary_expr): Expand new_placement[opt] and + new_initializer[opt] inline. + + * search.c (lookup_fnfields): Don't throw away the inheritance + information here, either. + (compute_access): Handle static members properly. + + * init.c (build_member_call): Always set basetype_path, and pass it + to lookup_fnfields. + + * search.c (lookup_field): Deal properly with the case where + xbasetype is a chain of binfos; don't throw away the inheritance + information. + (compute_access): protected_ok always starts out at 0. + + * init.c (resolve_offset_ref): Don't cast `this' to the base type + until we've got our basetype_path. + + * cp-tree.h (IS_OVERLOAD_TYPE): aggregate or enum. + + * cvt.c (build_up_reference): Use build_pointer_type rather than + TYPE_POINTER_TO. + + * call.c (convert_harshness_ansi): Call type_promotes_to for reals + as well. + + * cvt.c (type_promotes_to): Retain const and volatile, add + float->double promotion. + + * decl.c (grokdeclarator): Don't bash references to arrays into + references to pointers in function parms. Use type_promotes_to. + +Tue Apr 26 23:44:36 1994 Mike Stump + + Finish off Apr 19th work. + + * class.c (finish_struct_bits): Rename has_abstract_virtuals to + might_have_abstract_virtuals. + * class.c (strictly_overrides, override_one_vtable, + merge_overrides): New routines to handle virtual base overrides. + * class.c (finish_struct): Call merge_overrides to handle overrides + in virtual bases. + +Tue Apr 26 12:45:53 1994 Jason Merrill + + * typeck.c (build_function_call): Call build_function_call_real with + LOOKUP_NORMAL. + + * *: Don't deal with TYPE_EXPRs. + + * tree.c (lvalue_p): If the type of the expression is a reference, + it's an lvalue. + + * cvt.c (convert_to_reference): Complain about passing const + lvalues to non-const references. + (convert_from_reference): Don't arbitrarily throw away const and + volatile on the target type. + + * parse.y: Simplify and fix rules for `new'. + + * decl.c (grok_op_properties): operator void is illegal. + +Mon Apr 25 02:36:28 1994 Jason Merrill + + * parse.y (components): Anonymous bitfields can still have declspecs. + + * decl.c (pushdecl): Postpone handling of function templates like we + do C functions. + + * search.c (expand_indirect_vtbls_init): Fix infinite loop when + convert_pointer_to fails. + + * call.c (compute_conversion_costs_ansi): A user-defined conversion + by itself is better than that UDC followed by standard conversions. + Don't treat integers and reals specially. + + * cp-tree.h: Declare flag_ansi. + + * typeck.c (c_expand_return): pedwarn on return in void function + even if the expression is of type void. + (build_c_cast): Don't do as much checking for casts to void. + (build_modify_expr): pedwarn about array assignment if this code + wasn't generated by the compiler. + + * tree.c (lvalue_p): A comma expression is an lvalue if its second + operand is. + + * typeck.c (default_conversion): Move code for promoting enums and + ints from here. + * cvt.c (type_promotes_to): To here. + * call.c (convert_harshness_ansi): Use type_promotes_to. Also fix + promotion semantics for reals. + +Sun Apr 24 16:52:51 1994 Doug Evans + + * Make-lang.in (c++.install-common): Check for g++-cross. + * Makefile.in: Remove Cygnus cruft. + (config.status): Delete. + (RTL_H): Define. + (TREE_H): Use complete pathname, some native makes have minimal + VPATH support. + (*.o): Use complete pathname to headers in parent dir. + (doc, info, dvi): Delete. + +Sun Apr 24 16:52:51 1994 Doug Evans + + * Make-lang.in (c++.install-common): Check for g++-cross. + * Makefile.in: Remove Cygnus cruft. + (config.status): Delete. + (RTL_H): Define. + (TREE_H): Use complete pathname, some native makes have minimal + VPATH support. + (*.o): Use complete pathname to headers in parent dir. + (doc, info, dvi): Delete. + +Sun Apr 24 00:47:49 1994 Jason Merrill + + * decl.c (pushdecl): Avoid redundant warning on redeclaring function + with different return type. + (decls_match): Compare return types strictly. + +Fri Apr 22 12:55:42 1994 Jason Merrill + + * cvt.c (build_type_conversion): Do try to convert through other + pointers. This will fail if the class defines multiple pointer + conversions. + + * error.c (dump_type_prefix): Print out pointers to arrays properly. + (dump_type_suffix): Likewise. (was 'int *[]', now 'int (*)[]') + + * typeck.c (build_unary_op): Disallow ++/-- on pointers to + incomplete type. + + * decl.c (duplicate_decls): Check mismatched TREE_CODES after + checking for shadowing a builtin. If we're redeclaring a builtin + function, bash the old decl to avoid an ambiguous overload. + + * cvt.c (convert_to_reference): Don't force arrays to decay here. + + * tree.c (lvalue_p): A MODIFY_EXPR is an lvalue. + + * decl.c (duplicate_decls): Don't assume that the decls will have + types. + + Mon Apr 18 11:35:32 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940318 snapshot ] + * c-decl.c (pushdecl): Warn if type mismatch with another external decl + in a global scope. + + Fri Apr 22 06:38:56 1994 Chip Salzenberg + + * cp/typeck2.c (signature_error): Use cp_error for "%T". + + Mon Apr 18 11:59:59 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940415 snapshot ] + * cp/decl.c (duplicate_decls, pushdecl, builtin_function): + Use DECL_FUNCTION_CODE instead of DECL_SET_FUNCTION_CODE. + + Mon Apr 18 11:55:18 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940409 snapshot ] + * cp/decl.c (duplicate_decls): Put new type in same obstack as + old ones, or permanent if old ones in different obstacks. + + Mon Apr 18 11:48:49 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940401 snapshot ] + * cp/parse.y (attrib): Handle string args as expressions, + merging the two rules. `mode' attribute now takes a string arg. + Delete the rule for an identifier as arg. + + Mon Apr 18 11:24:00 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940312 snapshot ] + * cp/typeck.c (pointer_int_sum): Multiplication should be done signed. + (pointer_diff): Likewise the division. + + Sun Mar 6 19:43:39 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940304 snapshot ] + * cp/decl.c (finish_decl): Issue warning for large objects, + if requested. + + Sat Feb 19 22:20:32 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940218 snapshot ] + * cp/parse.y (attrib): Handle attribute ((section ("string"))). + * cp/decl.c (duplicate_decls): Merge section name into new decl. + + Tue Feb 8 09:49:17 1994 Chip Salzenberg + + [ cp/* changes propagated from c-* changes in 940206 snapshot ] + * cp/typeck.c (signed_or_unsigned_type): Check for any + INTEGRAL_TYPE_P not just INTEGER_TYPE. + + Mon Dec 6 13:35:31 1993 Norbert Kiesel + + * cp/decl.c (finish_enum): Start from 0 when determining precision + for short enums. + + Fri Dec 3 17:07:58 1993 Ralph Campbell + + * cp/parse.y (unary_expr): Look at $1 for tree_code rather than + casting $$. + + Wed Nov 17 19:22:09 1993 Chip Salzenberg + + * cp/typeck.c (build_binary_op_nodefault): Propagate code + from C front-end to optimize unsigned short division. + (build_conditional_expr): Fix bug in "1 ? 42 : (void *) 8". + + Wed Nov 17 19:17:18 1993 Chip Salzenberg + + * cp/call.c (convert_harshness_ansi): Given an (e.g.) char + constant, prefer 'const char &' to 'int'. + + Wed Feb 3 13:11:48 1993 Chip Salzenberg + + * cp/class.c (finish_struct_methods): Handle multiple + constructors in fn_fields list. + +Fri Apr 22 12:48:10 1994 Kung Hsu + + * class.c (finish_struct): Use TYPE_DECL_SUPPRESS_DEBUG to flag + types not to be dumped in stabs, like types in #pragma interface. + * decl.c (init_decl_processing): Use TYPE_DECL_SUPPRESS_DEBUG to + mark unknown type. + +Fri Apr 22 03:27:26 1994 Doug Evans + + * Language directory reorganization. + See parent makefile. + +Thu Apr 21 18:27:57 1994 Per Bothner + + * cp-tree.h (THUNK_DELTA): It is normally negative, so + use signed .i variant of frame_size rather than unsigned .u. + * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks, + use "VT" rather than "vt" due to binary incompatibility. + * class.c (get_vtable_name): Use strlen of VTABLE_NAME_FORMAT, + rather than sizeof, since it is now an expression. + * class.c (modify_one_vtable): Modify to skip initial element + containing a count of the vtable. + +Thu Apr 21 00:09:02 1994 Jason Merrill + + * lex.c (check_newline): Force interface_unknown on main input file. + + * pt.c (do_pending_expansions): Always emit functions that have been + explicitly instantiated. + (do_function_instantiation): Set DECL_EXPLICITLY_INSTANTIATED. + (do_type_instantiation): Set CLASSTYPE_VTABLE_NEEDS_WRITING and + DECL_EXPLICITLY_INSTANTIATED on all my methods. + * parse.y (explicit_instantiation): Call do_type_instantiation for + types. + * decl2.c (finish_vtable_vardecl): Call import_export_vtable. + * decl.c (start_function): Don't set DECL_EXTERNAL on a function + that has been explicitly instantiated. + * cp-tree.h (DECL_EXPLICITLY_INSTANTIATED): Alias for + DECL_LANG_FLAG_4. + * class.c: Move import_export_vtable to decl2.c, and comment out all + uses. + +Wed Apr 20 16:51:06 1994 Jason Merrill + + * lex.c (process_next_inline): Don't muck with DECL_INLINE. + (do_pending_inlines): Likewise. + +Tue Apr 19 22:25:41 1994 Mike Stump + + Reimplement vtable building, and most vtable pointer setting. + Allows for earier maintenance, easier understandability, and most + importantly, correct semantics. + + * class.c (build_vtable): Removed unneeded + SET_BINFO_VTABLE_PATH_MARKED. + * class.c (prepare_fresh_vtable): Likewise. Added argument. + * class.c (modify_vtable_entry): General cleanup. + * class.c (related_vslot, is_normal, modify_other_vtable_entries, + modify_vtable_entries): Removed. + * class.c (add_virtual_function): General cleanup. + * class.c (finish_base_struct): Setup BINFO_VTABLE and + BINFO_VIRTUALS as early as we can, so that modify_all_vtables can + work. + * class.c (finish_vtbls): New routine, mostly from + unmark_finished_struct. + * class.c (overrides): New routine. + * class.c (modify_one_vtable): New routine, mostly from + modify_other_vtable_entries and modify_vtable_entries. + * class.c (modify_all_direct_vtables, modify_all_indirect_vtables, + modify_all_vtables): New routines. + * class.c (finish_struct): Added arguemnt to prepare_fresh_vtable + call. General cleanup on how pending_hard_virtuals are handled. + General cleanup on modifying vtables. Use finish_vtbls, instead of + unmark_finished_struct. + * cp-tree.h (init_vtbl_ptrs, expand_direct_vtbls_init, + get_first_matching_virtual, get_matching_virtual, + expand_vbase_vtables_init, expand_indirect_vtbls_init): Update. + * cvt.c (convert_pointer_to_real): Cleanup error message. + * decl.c (grokfndecl): General cleanup. + * decl.c (finish_function): Change init_vtbl_ptrs call to + expand_direct_vtbls_init. Change expand_vbase_vtables_init call to + expand_indirect_vtbls_init. + * init.c (expand_virtual_init): Remove unneeded argument. + * init.c (init_vtbl_ptrs): Rename to expand_direct_vtbls_init, added + two arguments to make more general. Made more general. Now can be + used for vtable pointer initialization from virtual bases. + * init.c (emit_base_init): Change expand_vbase_vtables_init call to + expand_indirect_vtbls_init. Change init_vtbl_ptrs call to + expand_direct_vtbls_init. + * init.c (expand_virtual_init): General cleanup. + * init.c (expand_default_init): Change expand_vbase_vtables_init + call to expand_indirect_vtbls_init. + * init.c (expand_recursive_init_1): Change expand_vbase_vtables_init + call to expand_indirect_vtbls_init. + * init.c (expand_recursive_init): Change expand_vbase_vtables_init + call to expand_indirect_vtbls_init. + * search.c (get_first_matching_virtual): Rename to + get_matching_virtual. General cleanup and remove setting of + DECL_CONTEXT. That is now done in a cleaner way in + modify_vtable_entry and add_virtual_function. + * search.c (expand_vbase_vtables_init): Rename to + expand_indirect_vtbls_init. General cleanup. Use + expand_direct_vtbls_init to do hard work. Ensures that _all_ vtable + pointers from virtual bases are set up. + * search.c (bfs_unmark_finished_struct, unmark_finished_struct): + Removed. + + * *.[chy]: Remove support for VTABLE_USES_MASK. + +Tue Apr 19 12:51:59 1994 Jason Merrill + + * cvt.c (convert_to_reference): Use NOP_EXPRs to switch between + reference and pointer types instead of bashing the types directly. + + * call.c (build_overload_call_real): Use the TREE_CODE to determine + whether the function is overloaded or not, rather than + TREE_OVERLOADED. + * *: Remove all uses of TREE_OVERLOADED. + + * decl.c (grokdeclarator): Only complain about initializing const + fields when -ansi or -pedantic. + +Tue Apr 19 12:42:42 1994 Doug Evans + + * cp-tree.h (THUNK_DELTA): frame_size is now a union. + +Mon Apr 18 00:17:13 1994 Jason Merrill + + Do overloading on a block-by-block basis, not function-by-function. + * decl.c: Lose overloads_to_forget. + (struct binding_level): Add overloads_shadowed field. + (poplevel): Restore overloads_shadowed. + (push_overloaded_decl): Use overloads_shadowed instead of + overloads_to_forget. + (finish_function): Don't look at overloads_to_forget. + + Copy enum_overflow logic from c-decl.c. + * decl.c (start_enum): Initialize enum_overflow. + (build_enumerator): Use enum_overflow. Also use current_scope(). + + * search.c (current_scope): Move Brendan's comment from + build_enumerator here. + + * typeck.c (convert_for_assignment): Change warnings to pedwarns for + discarding const/volatile. + +Sat Apr 16 01:18:21 1994 Jason Merrill + + * typeck.c (comp_target_parms): Accept TEMPLATE_TYPE_PARMs on the rhs. + (comp_target_types): Likewise. + + * decl.c (lookup_name): Don't unset got_scope here. + + * spew.c (yylex): Only replace yylval with the TYPE_NESTED_NAME if + got_scope != NULL_TREE. + +Fri Apr 15 16:36:33 1994 Jason Merrill + + Horrible kludge to prevent templates from being instantiated by + their base classes. + * parse.y (template_instantiate_once): Unset TYPE_BEING_DEFINED + before we get to left_curly. + * pt.c (instantiate_class_template): Set TYPE_BEING_DEFINED. + + * error.c (dump_decl): If it's a typedef, print out the name of the + decl, not just the underlying type. + + * decl.c (pushdecl): If the old duplicate decl was a TYPE_DECL, + update the IDENTIFIER_TYPE_VALUE of its name. + + * decl2.c (finish_file): When processing the initializer for a + static member, pretend that the dummy function is a member of the + same class. + +Fri Apr 15 15:56:35 1994 Kung Hsu + + * class.c (build_vtable_entry): Revert Apr 4 change. + * decl2.c (mark_vtable_entries): Replace pure virtual function + decl with abort's. + +Fri Apr 15 13:49:33 1994 Jason Merrill + + * typeck.c (build_conditional_expr): Pedwarn on pointer/integer + mismatch, and don't pedwarn on 0/function pointer mismatch. + + * typeck2.c (digest_init): Lose code for special handling of unions. + (process_init_constructor): Since they're handled just fine here. + Pedwarn on excess elements. + + * decl2.c (grokfield): Complain about local class method declaration + without definition. + +Fri Apr 15 13:19:40 1994 Per Bothner + + * method.c (emit_thunk): Add extern declaration for + current_call_is_indirect (needed for hppa). + +Thu Apr 14 16:12:31 1994 Jason Merrill + + Improve local class support; allow classes in different blocks to + have the same name. + * decl.c (pushtag): Support local classes better. + (pushdecl_nonclass_level): New function for pushing mangled decls of + nested types into the appropriate scope. + (xref_defn_tag): Use pushdecl_nonclass_level instead of + pushdecl_top_level. + (grokfndecl): Don't mess with IDENTIFIER_GLOBAL_VALUE for local + class methods. + * method.c (do_inline_function_hair): Likewise. + + * class.c (finish_struct): It is legal for a class with no + constructors to have nonstatic const and reference members. + +Thu Apr 14 07:15:11 1994 Brendan Kehoe + + * decl.c (push_overloaded_decl): Avoid giving errors about + built-ins, since duplicate_decls will have given warnings/errors + for them. + +Thu Apr 14 03:45:12 1994 Jason Merrill + + * cvt.c (convert_to_reference): Warn about casting pointer type to + reference type when this is probably not what they wanted. + +Wed Apr 13 13:12:35 1994 Per Bothner + + * decl.c (finish_decl): Don't mindlessly set TREE_USED for + static consts any more (toplev.c has now been modified to + not emit warnings if they are unused). + +Wed Apr 13 00:22:35 1994 Jason Merrill + + * decl.c (grok_op_properties): If op new/delete get here with + METHOD_TYPEs, do a revert_static_member_fn. + + * cp-tree.h (IDENTIFIER_CLASS_TYPE_VALUE): Lose. + * init.c (is_aggr_typedef): Don't look at + IDENTIFIER_CLASS_TYPE_VALUE. + (get_aggr_from_typedef): Likewise. + (get_type_value): Likewise. + * call.c (build_scoped_method_call): Don't rely on overloaded + template names having IDENTIFIER_CLASS_VALUE set. + + * parse.y (component_decl_1, fn.def2): Revert rules for + constructors. + (component_decl_1, fn.def2): Use $1 instead of $$, since $$ is being + clobbered. + + * decl.c (start_function): Only warn about `void main()' if pedantic + || warn_return_type. + +Tue Apr 12 02:14:17 1994 Jason Merrill + + Clean up overloading of the template name. + * class.c (pushclass): Overload the template name whenever pushing + into the scope of a template class, not just if it is + uninstantiated. + (popclass): Correspondingly. + * search.c (push_class_decls): Don't overload_template_name. + * pt.c (overload_template_name): Don't set IDENTIFIER_LOCAL_VALUE or + DECL_CONTEXT on things. + * parse.y (left_curly): Don't overload_template_name. + * class.c (finish_struct): Don't undo_template_name_overload. + + * method.c (build_opfncall): Only pass one argument to global op + delete. + + * call.c (build_method_call): Use TYPE_VEC_DELETE_TAKES_SIZE to + decide how many arguments to use for vec delete. + + * decl.c (grok_op_properties): Be consistent in modifying + current_class_type. + (grokdeclarator): Only complain about function decls with no return + type if we're being pedantic. + +Mon Apr 11 00:10:53 1994 Jason Merrill + + Add support for operator new [] and operator delete []. + + * tree.def: Add VEC_NEW_EXPR and VEC_DELETE_EXPR. + * ptree.c (print_lang_type): Indicate vec new/delete. + * parse.y: Support vec new/delete. + * method.c (build_decl_overload): Deal with vec new/delete. + (build_opfncall): Likewise. + * lex.c (init_lex): Set up values of ansi_opname and opname_tab for + vec new/delete. vec new uses "__vn", and vec delete uses "__vd". + * init.c (init_init_processing): Set up BIVN and BIVD. + (do_friend): Don't clean up after mistaken setting of TREE_GETS_NEW, + since it doesn't happen any more. + (build_new): Support vec new. Always call something. + (build_x_delete): Support vec delete. + (build_vec_delete): Lose dtor_dummy argument, add use_global_delete, + and pass it to build_x_delete. + * decl2.c (delete_sanity): Don't change behavior by whether or not + the type has a destructor. Pass use_global_delete to + build_vec_delete. + (coerce_delete_type): Make sure that the type returned has a first + argument of ptr_type_node. + * decl.c (init_decl_processing): Also declare the global vec + new/delete. + (grokdeclarator): Also force vec new/delete to be static. + (grok_op_properties): Note presence of vec new/delete, and play with + their args. If vec delete takes the optional size_t argument, set + TYPE_VEC_DELETE_TAKES_SIZE. + * cp-tree.h (TYPE_GETS_{REG,VEC}_DELETE): New macros to simplify + checking for one delete or the other. + (lang_type): gets_new and gets_delete are now two bits long. The + low bit is for the non-array version. Lose gets_placed_new. + (TYPE_VEC_DELETE_TAKES_SIZE): New macro indicating that the vec + delete defined by this class wants to know how much space it is + deleting. + (TYPE_VEC_NEW_USES_COOKIE): New macro to indicate when vec new must + add a header containing the number of elements in the vector; i.e. + when the elements need to be destroyed or vec delete wants to know + the size. + * class.c (finish_struct_methods): Also check for overloading vec + delete. + * call.c (build_method_call): Also delete second argument for vec + delete. + + * decl.c (grokdeclarator): Correct complaints again. + (grokdeclarator): Fix segfault on null declarator. + (decls_match): Also accept redeclaration with no arguments if both + declarations were in C context. Bash TREE_TYPE (newdecl) here. + (duplicate_decls): Instead of here. + + * parse.y (nested_name_specifier_1): Lose rules for dealing with + syntax errors nicely, since they break parsing of 'const i;'. + + * decl.c (lookup_name): if (got_scope == current_class_type) + val = IDENTIFIER_CLASS_VALUE (name). + + * search.c (lookup_nested_tag): Look in enclosing classes, too. + + * spew.c (yylex): Only look one character ahead when checking for a + SCOPE. + + * lex.c (check_newline): Read first nonwhite char before + incrementing lineno. + + * decl.c (grokdeclarator): Don't claim that typedefs are variables + in warning. + + * parse.y: Divide up uses of unqualified_id into + notype_unqualified_id and unqualified_id, so that TYPENAME can be + used as an identifier after an object. + + * class.c (push_nested_class): Don't push into non-class scope. + + * decl.c (grokdeclarator): If an identifier could be a type + conversion operator, but has no associated type, it's not a type + conversion operator. + + * pt.c (unify): Check for equality of constants better. + + * decl.c (grokdeclarator): Don't complain about access decls. + +Sun Apr 10 02:39:55 1994 Jason Merrill + + * decl.c (grokdeclarator): pedwarn about data definitions without + types here. + + * parse.y (datadef): Don't pedwarn about decls without types here, + since that is valid for functions. + (fn.def2, component_decl): Support constructors with declmods again. + (nomods_initdecls): For decls without any mods, so that we don't try + to get declspecs from some arbitrary $0. + + * search.c (lookup_field): Use cp_error. + + * parse.y (nested_name_specifier_1): Don't check aggr/non-aggr type + here; it breaks destructors for non-aggr types. + + * decl.c (lookup_name): Only look for TYPE_DECLs in base classes of + a type being defined, like the comment says. + If got_scope is not an aggregate, just return NULL_TREE. + + * pt.c (create_nested_upt): Kung's code for creating types nested + within uninstantiated templates now lives here (it used to live in + hack_more_ids). It needs to be expanded. + + * parse.y: Stop calling see_typename so much. + + * decl.c (lookup_name): Deal with TTPs and UPTs. + + * lex.c (real_yylex): Don't set looking_for_typename just because we + saw a 'new'. + (dont_see_typename): #if 0 out. + + * spew.c (yylex): Increment looking_for_typename if the next + character is SCOPE, rather than setting it to 1; this way, the value + from seeing an aggr specifier will not be lost. This kinda relies + on looking_for_typename never being < 0, which is now true. + + * parse.y (nested_name_specifier_1): Accept TEMPLATE_TYPE_PARMs, + too. + (named_class_head_sans_basetype): Accept template types, too. Oops. + +Fri Apr 8 16:39:35 1994 Jason Merrill + + * decl2.c (reparse_decl_as_expr1): Handle SCOPE_REFs. + + * parse.y: Lose START_DECLARATOR. + + * search.c (lookup_nested_tag): New function to scan CLASSTYPE_TAGS + for a class. + + * parse.y: Simplify fn.def2 and component_decl. Support 'enum + A::foo' syntax. Catch invalid scopes better. + + * parse.y, lex.c: Lose TYPENAME_COLON. + + * decl2.c (groktypefield): #if 0 out. + + * decl.c (lookup_name): If the type denoted by got_scope is + currently being defined, look in CLASSTYPE_TAGS rather than FIELDS. + + * class.c (push_nested_class): Don't try to push into + error_mark_node. + +Fri Apr 8 07:26:36 1994 Brendan Kehoe + + * Makefile.in (stamp-parse): Update count of conflicts to 33. + +Thu Apr 7 17:47:53 1994 Jason Merrill + + A saner implementation of nested types that treats template types + no differently from non-template types. There are still some + shortcomings of our system; most notably, it is difficult to look + for a nested type that is hidden by another name, because of the way + we keep track of hidden types. But this shouldn't be a problem for + just about anyone. Perhaps lookup_field should be fixed up a bit. + + * spew.c: Moved handling of nested types/scoping from the lexer + into the parser. Removed variable template_type_seen_before_scope. + Removed functions frob_identifier, hack_more_ids, and various cruft + that was #if 0'd out in the past, reducing the size of the file from + 1146 lines to 450 lines. We can't quite do away with spew.c yet, + though; we still need it for do_aggr () and checking for SCOPE after + the current identifier. And setting lastiddecl. + + * parse.y: Moved handling of nested types/scoping from the lexer + into the parser, using a new global variable `got_scope'. Reduced + the number of states by 53. Implemented all uses of explicit global + scope. Removed terminals SCOPED_TYPENAME and SCOPED_NAME. Removed + nonterminals tmpl.1, scoped_base_class, id_scope, typename_scope, + scoped_typename. Added nonterminals nested_type, + qualified_type_name, complete_type_name, qualified_id, ptr_to_mem, + nested_name_specifier, global_scope, overqualified_id, type_name. + Changed many others. Added 9 new reduce/reduce conflicts, which are + nested type parallels of 9 that were already in the grammar for + non-nested types. Eight of the now 33 conflicts should be removed + in the process of resolving the late binding between variable and + function decls. + + * gxxint.texi (Parser): Update. + + * cp-tree.h (IS_AGGR_TYPE_CODE): Add UNINSTANTIATED_P_TYPE. + + * lex.h: Add decl for got_scope. + + * lex.c (see_typename): Claim to be the lexer when calling + lookup_name. + + * decl.c (lookup_name): When called from the lexer, look at + got_scope and looking_at_typename; otherwise don't. + +Thu Apr 7 22:05:47 1994 Mike Stump + + 31th Cygnus<->FSF merge. + +Thu Apr 7 17:47:53 1994 Jason Merrill + + * decl2.c (mark_vtable_entries): Call this to mark all the + entries in the vtable addressable. + (finish_decl_parsing): Handle SCOPE_REFs. + + * decl.c (decls_match): Always call compparms with strict == 1. + Handle the special case of C function redecl here. + (duplicate_decls): Only keep the old type if the new decl takes no + arguments. + + * typeck.c (compparms): Also allow t1 to be ... if strict == 0. + +Thu Apr 7 16:17:50 1994 Mike Stump + + * class.c (build_vtable_entry): Fix breakage introduced Apr 5 + 17:48:41. + +Wed Apr 6 16:05:10 1994 Per Bothner + + * init.c (build_virtual_init), search.c (build_vbase_vtables_init), + ch-tree.h: Every place these functions were called, the result was + immediately passed to expand_expr_stmt. Reduce redundancy by + calling expand_expr_init *inside* these functions. These + makes for a simpler interface, and we don't have to build + compound expressions. Hence, rename these function to: + expand_virtual_init and expand_vbase_vtables_init respectively. + * init.c, decl.c: Change callers of these functions. + * init.c, cp-tree.h (expand_virtual_init): Make static. + + * decl2.c (finish_file): Check TREE_PUBLIC||TREE_ADDRESSABLE + rather than DECL_SAVED_INSNS before emitting inlines. + +Wed Apr 6 13:06:39 1994 Jason Merrill + + * spew.c (init_spew): #if 0 out stuff used by arbitrate_lookup. + + * decl.c (duplicate_decls): If this is a new declaration of an + extern "C" function, keep the type (for the argtypes). + (redeclaration_error_message): Don't check DECL_LANGUAGE here. + (decls_match): Call compparms with a value of strict dependent on + the value of strict_prototypes for DECL_LANGUAGE (oldecl). + + * typeck.c (compparms): ... is only equivalent to non-promoting + parms if we're not being strict. + + * parse.y (empty_parms): Don't check flag_ansi || pedantic here. + + * decl.c (init_decl_processing): if (flag_ansi || pedantic) + strict_prototypes_lang_c = strict_prototypes_lang_cplusplus; + + * decl2.c (grok_function_init): Don't set DECL_INITIAL on pure + virtuals. + +Tue Apr 5 17:48:41 1994 Per Bothner + + Support for implementing vtables with thunks. + * tree.def (THUNK_DECL): New TREE_CODE. + * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY), tree.c + (fnaddr_from_vtable_entry): Handle flag_vtable_thunks case. + * cp-tree.h (memptr_type): New variable. + * class.c (build_vtable_entry): Build thunk if necessary. + * class.c (build_vfn_ref): If using thunks, don't need + to add delta field from vtable (there is none!). + * decl.c: Add memptr_type as well as vtable_entry_type. + If using thunks, the latter is just ptr_type_node. + * gc.c, typeck.c: Use memptr_typeChange, not vtable_entry_type. + * decl2.c (finish_vtable_vardecl): Handle thunks. + * expr.c (cplus_expand_expr): Support THUNK_DECL. + + * decl.c (grokdeclarator): Set DECL_THIS_EXTERN if "extern". + * decl.c (start_function): Set current_extern_inline based on + DECL_THIS_EXTERN, not TREE_PUBLIC. + * decl.c (finish_function): Call mark_inline_for_output if needed, + + Improve intelligence about when to emit inlines. + * cp-tree.h (lang_decl_flags): New field saved_inline. + * cp-tree.h (DECL_SAVED_INLINE): New macro. + * class.c (add_virtual_function): Don't set TREE_ADDRESSABLE. + * decl.h, decl.c (pending_addressable_inlines): Removed. + * decl2.c (pending_addressable_inlines): Renamed to saved_inlines. + * decl2.c (mark_inline_for_output): Do nothing if + DECL_SAVED_INLINE; otherwise set it (and add to saved_inlines list). + * decl2.c (finish_vtable_vardecl): SET_CLASSTYPE_INTERFACE_KNOWN + and set CLASSTYPE_INTERFACE_ONLY if there is a non-inline virtual. + * decl2.c (finish_file): Writing out inlines later, so we can + also handle the ones needed for vtbales. + * decl2.c (write_vtable_entries, finish_vtable_typedecl): Removed. + + * cp-tree.h, class.c, decl2.c, search.c: Remove -fvtable-hack + and flag_vtable_hack. Use -fvtable-thunks and flag_vtable_thunks + instead. (The rationale is that these optimizations both break binary + compatibility, but should become the default in a future release.) + +Wed Apr 6 10:53:56 1994 Mike Stump + + * class.c (modify_vtable_entries): Never reset the DECL_CONTEXT + of a fndecl, as we might not be from that vfield. + +Tue Apr 5 17:43:35 1994 Kung Hsu + + * class.c (add_virtual_function): Fix bug for pure virtual, so + that DECL_VINDEX of the dummy decl copied won't be error. + (see also Apr 4 change) + +Tue Apr 5 17:23:45 1994 Per Bothner + + * typeck.c (c_expand_return): Before checking that we're not + returning the address of a local, make sure it's a VAR_DECL. + (And don't worry about it being a TREE_LIST.) + +Tue Apr 5 13:26:42 1994 Jason Merrill + + * parse.y (YYDEBUG): Always define. + * lex.c (YYDEBUG): Likewise. + +Mon Apr 4 11:28:17 1994 Kung Hsu + + * class.c (finish_struct): Backup out the change below, put the + new change for the same purpose. The change below breaks code. + + * class.c (finish_struct): If pure virtual, copy node and make + RTL point to abort, then put in virtual table. + * decl2.c (grok_function_iit): Reinstate Mar 31 change. + +Sat Apr 2 03:12:58 1994 Jason Merrill + + * init.c (build_new): pedwarn about newing const and volatile + types. + + * tree.c (get_identifier_list): Only do the special handling + thing if we're dealing with the main variant of the record type. + + * cvt.c (convert_to_reference): When converting between + compatible reference types, use the pointer conversion machinery. + Don't just blindly overwrite the old type. + +Fri Apr 1 17:14:42 1994 Jason Merrill + + * call.c (build_method_call): When looking at global functions, + be sure to use instance_ptr for the first argument, not some version + of it that has been cast to a base class. Also do this before + comparing candidates. + +Thu Mar 31 19:50:35 1994 Jason Merrill + + * call.c (build_method_call): Constructors can be called for + const objects. + +Thu Mar 31 16:20:16 1994 Kung Hsu + + * decl2.c (grok_func_init): Do not abort as rtl for pur virtual + functions. They can be defined somewhere else. + +Sat Jan 23 23:23:26 1994 Stephen R. van den Berg + + * decl.c (init_decl_processing): Declare __builtin_return_address + and __builtin_frame_address for C++ as well. + +Thu Mar 31 12:35:49 1994 Mike Stump + + * typeck2.c (store_init_value): Integral constant variables are + always constant, even when doing -fpic. + +Sat Jan 23 23:23:26 1994 Stephen R. van den Berg + + * decl.c (redeclaration_error_message): Pass the types to + comptypes. + +Wed Mar 30 21:29:25 1994 Mike Stump + + Cures incorrect errors about pure virtuals in a class, when they + have been overridden in a derived class. + + * search.c (get_abstract_virtuals): Reimplement. + * search.c (get_abstract_virtuals_1): New routine. + +Wed Mar 30 14:10:04 1994 Jason Merrill + + * pt.c (push_template_decls): Make the pushed level pseudo + global. + + * parse.y (extdefs): Don't pop everything if the current binding + level is pseudo_global. + + * decl.c (pop_everything): Stop on reaching a pseudo-global + binding level. + + * cp-tree.h (DECL_FUNCTION_MEMBER_P): Change to more reliable test. + + * decl.c (duplicate_decls): Only copy DECL_SOURCE_{FILE_LINE} if + the old decl actually had an initializer. + + * {various}: Clean up gcc -W complaints. + + * cp-tree.h (DECL_FUNCTION_MEMBER_P): Currently defined to be + (DECL_CONTEXT (NODE) != NULL_TREE). + + * parse.y (lang_extdef): Call pop_everything if necessary. + + * decl.c (pop_everything): New function for popping binding + levels left over after a syntax error. + (pushdecl): Use DECL_FUNCTION_MEMBER_P to decide whether or not + a function is a member. + +Wed Mar 30 14:20:50 1994 Mike Stump + + Cures calling a more base base class function, when a more derived + base class member should be called in some MI situations. + + * search.c (make_binfo): Use more the more specialized base + binfos from the binfo given as the second argument to make_binfo, + instead of the unspecialized ones from the TYPE_BINFO. + * class.c (finish_base_struct): Likewise, update callers. + * search.c (dfs_get_vbase_types): Likewise. + * tree.c (propagate_binfo_offsets, layout_vbasetypes): Likewise. + * decl.c (xref_tag): Use NULL_TREE instead of 0. + * lex.c (make_lang_type): Likewise. + +Wed Mar 30 14:10:04 1994 Jason Merrill + + * decl.c (pushdecl): If pushing a C-linkage function, only do a + push_overloaded_decl. + (duplicate_decls): Standard overloading does not shadow built-ins. + +Tue Mar 29 00:54:18 1994 Jason Merrill + + * pt.c (end_template_decl): Don't call push_overloaded_decl. + + * init.c (do_friend): Don't call push_overloaded_decl. + + * decl.c (pushdecl): Call push_overloaded_decl for functions and + function templates. + (duplicate_decls): Functions and function templates are not + duplicates, but don't complain about calling this function to + compare them. + (push_overloaded_decl): Don't deal with linkage. Call + duplicate_decls. + (redeclaration_error_message): Deal with linkage. + + * decl.c (start_function): If push_overloaded_decl returns an + older version of the function, deal with it. + + * decl.c (start_function): Be sure only to push_overloaded_decl + for non-members. + + * decl.c (grokfndecl): Put back clearing of DECL_CHAIN for + methods. + (start_function): Lose broken and redundant code for checking old + decl. + + * init.c (add_friend): Give line numbers of both friend decls + when warning about re-friending. + + * pt.c (tsubst): Use comptypes rather than == to compare the + types of the method as declared and as defined, since default + parameters may be different. + + * call.c (build_method_call): Use brendan's candidate printing + routine. + + * decl.c (start_method): Methods defined in the class body are + inline whether or not it's a template class. + +Mon Mar 28 16:39:26 1994 Jason Merrill + + * parse.y (initdcl0): Add "extern" to current_declspecs if + have_extern_spec && ! used_extern_spcec. + + * tree.c (really_overloaded_fn): A fn with more than one + overload. + + * pt.c (end_template_decl): Use really_overloaded_fn. + + * decl.c (duplicate_decls): When smashing a decl into a previous + definition, keep the old file and line. + Don't deal with overloaded functions. + Lose old code for checking arg types of functions. + Check for overloaded C functions. + (pushdecl): Deal with overloaded functions. + (start_decl): Expect pushdecl to return an appropriate function decl. + (start_function): Likewise. + (push_overloaded_decl): Don't check for overloaded C functions. + + * *.c: Stop using DECL_OVERLOADED, it being archaic. + TREE_OVERLOADED should probably go, too. + +Mon Mar 28 14:00:45 1994 Ron Guilmette + + * typeck.c (comp_target_types): Call comp_target_parms with + strict == 1. + +Sun Mar 27 00:07:45 1994 Jason Merrill + + * parse.y (empty_parms): Don't parse () as (...) in extern "C" + sections if we're compiling with -ansi or -pedantic. + + * decl.c (decls_match): Don't treat (int) and (int&) as matching. + + * decl2.c (grokfield): Don't pedwarn twice about initializing + field. + + * decl.c (push_overloaded_decl): Warn about shadowing + constructor. + (redeclaration_error_message): Don't allow 'int a; int a;' + + * cvt.c (build_up_reference): Only check for valid upcast if + LOOKUP_PROTECT is set, not just any flag. + +Fri Mar 25 01:22:31 1994 Jason Merrill + + * lex.c (check_newline): When we see a #pragma implementation, + also set it for the main input file. + + * init.c (build_new): Convert array size argument to size_t. + + * parse.y (primary): If we're doing a parenthesized type-id, call + groktypename before passing it to build_new. + + * call.c (build_method_call): Deal properly with const and + volatile for instances of reference type. + + * decl.c (store_return_init): Change 'if (pedantic) error' to 'if + (pedantic) pedwarn'. + + * decl.c (grokdeclarator): Don't complain about putting `static' + and `inline' on template function decls. + +Thu Mar 24 23:18:19 1994 Jason Merrill + + * call.c (build_method_call): Preserve const & volatile on + `this'. + +Thu Mar 24 16:21:52 1994 Mike Stump + + * init.c (build_new, build_vec_delete): Use global new and delete + for arrays. + * decl2.c (delete_sanity): Likewise. + +Thu Mar 24 02:10:46 1994 Jason Merrill + + * cvt.c (convert_to_reference): If i is an lvalue, + (int &)i -> *(int*)&i, as per 5.2.8p9 of the latest WP. + (convert_force): Call convert_to_reference with LOOKUP_COMPLAIN. + +Wed Mar 23 17:45:37 1994 Jason Merrill + + * decl.c (duplicate_decls): Also propagate DECL_TEMPLATE_MEMBERS + and DECL_TEMPLATE_INSTANTIATIONS. + + * init.c (build_new): Handle array typedefs properly. + +Wed Mar 23 18:23:33 1994 Mike Stump + + 30th Cygnus<->FSF merge. + +Wed Mar 23 00:46:24 1994 Mike Stump + + * class.c (modify_vtable_entries): Avoid running off the end of the + virtuals list when processing a virtual destructor. + * class.c (get_vtable_entry): Likewise. + +Wed Mar 23 00:23:59 1994 Jason Merrill + + * decl.c (duplicate_decls): If two template decls don't match, + just return 0. + +Tue Mar 22 23:49:41 1994 Jason Merrill + + * typeck.c (convert_for_assignment): Don't pedwarn about + converting function pointer to void *. + +Tue Mar 22 22:23:19 1994 Mike Stump + + Major revamp of pointer to member functions. Cures major + nonfunctionality when used in casts, and MI situations. + + * cvt.c (convert_force): Update call site of build_ptrmemfunc. + * typeck.c (convert_for_assignment): Likewise. + * typeck2.c (digest_init): Likewise. + * typeck2.c (process_init_constructor): Simplify by moving code into + digest_init. + * typeck2.c (digest_init): Do default_conversions on init value, if + we are processing pointer to member functions. + * class.c (get_vfield_offset): Now non-static. Convert bit offset + into byte offset. + * cp-tree.h (get_vfield_offset): Likewise. + * typeck.c (get_member_function_from_ptrfunc): Convert down to right + instance, before fetching vtable pointer. + * typeck.c (get_delta_difference): New routine. + * typeck.c (build_ptrmemfunc): Revamp to handle casting better, also + get vtable pointer out of right subobject. + +Tue Mar 22 17:56:48 1994 Mike Stump + + * search.c (get_binfo): Return NULL instead of aborting, when + passed a UNION_TYPE. + +Tue Mar 22 12:44:54 1994 Jason Merrill + + These patches implement handling of redefinition/redeclaration of + templates. + + * typeck.c (comptypes): Simplify. All TEMPLATE_TYPE_PARMs are + considered compatible. + + * parse.y (template_def): Pass defn argument to end_template_decl. + + * pt.c (end_template_decl): Add defn argument. Check for + redefinition. Simplify. + + * error.c (OB_UNPUT): New macro, to remove mistakes. + (aggr_variety): Subroutine of dump_aggr_type. + + * decl.c (decls_match): Support templates. + (duplicate_decls): No longer static. Don't try to lay out template + decls. + (pushdecl): Simplify. + + * cp-tree.h (DECL_TEMPLATE_MEMBERS): Use DECL_SIZE instead of + DECL_INITIAL. + +Mon Mar 21 11:46:55 1994 Jason Merrill + + * error.c (dump_decl): Support class template decls. + (dump_type): Don't adorn template type parms. + + * decl.c (duplicate_decls): Save DECL_TEMPLATE_INFO from old decl + if it was a definition. + (redeclaration_error_message): Do the cp_error thang, and reject + redefinition of templates. + +Mon Mar 21 19:36:06 1994 Per Bothner + + * decl.c (grokdeclarator): Set TREE_PUBLIC for METHOD_TYPE + in FIELD context, when appropriate. Also, + CLASSTYPE_INTERFACE_ONLY is irrelevant to setting TREE_PUBLIC. + Also, simplify check for bogus return specifiers. + +Mon Mar 21 11:46:55 1994 Jason Merrill + + * parse.y (after_type_declarator1): Expand type_quals. + (notype_declarator1): Likewise. + (absdcl1): Likewise. + +Sat Mar 19 01:05:17 1994 Jason Merrill + + * decl.c (grokdeclarator): Treat class-local typedefs like static + members; i.e. 'typedef int f();' means that f is a function type, + not a method type. + + * parse.y (decl): Change direct_* back to *. + (type_id): Change direct_abstract_declarator to absdcl. + (direct_declarator, direct_initdecls, direct_initdcl0): Remove again. + +Fri Mar 18 12:47:59 1994 Jason Merrill + + These two patches fix crashes on instantiating a template inside a + function with C linkage or containing labels. + + * class.c (current_lang_stacksize): No longer static. + + * decl.c (struct saved_scope): Add lang_base, lang_stack, + lang_name, lang_stacksize, and named_labels. + (push_to_top_level): Save them. + (pop_from_top_level): Restore them. + + * gxxint.texi (Parser): Update. + + These two patches finish moving the task of expr/declarator + ambiguity resolution from the lexer to the parser, and add one more + r/r conflict. START_DECLARATOR can now be nuked. + + * parse.y (decl): Add "direct_" in typespec X rules. + (direct_declarator): New nonterminal for + direct_after_type_declarator and direct_notype_declarator. + (direct_initdecls): Like initdecls, but uses direct_initdcl0. + (direct_initdcl0): Like initdcl0, but uses direct_declarator. + (named_parm): Add typespec direct_declarator rule. + + * spew.c (yylex): #if 0 out START_DECLARATOR insertion. + + These two patches disable some excessive cleverness on the part of + g++; a non-class declaration always hides a class declaration in the + same scope, and g++ was trying to unhide it depending on the + enclosing expression. + + * spew.c (arbitrate_lookup): #if 0 out. + + * decl.c (lookup_name): Never call arbitrate_lookup. + + * parse.y (complex_notype_declarator1): Add '*' + complex_notype_declarator1 and '&' complex_notype_declarator1 rules. + + * parse.y (complex_direct_notype_declarator): Restore id_scope + see_typename TYPENAME rule, remove all other rules beginning with + those tokens. + (notype_unqualified_id): Add '~' see_typename IDENTIFIER rule. + +Thu Mar 17 17:30:01 1994 Jason Merrill + + These changes fix the compiler's handling of the functional cast/ + object declaration ambiguities in section 6.8 of the ARM. They also + add 11 reduce/reduce conflicts. Sigh. + + * parse.y: Add precedence decls for OPERATOR and '~'. + (notype_unqualified_id): New nonterminal, encompasses all of the + ANSI unqualified-id nonterminal except TYPENAMEs. + (expr_or_declarator): New nonterminal to delay parsing of code like + `int (*a)'. + (primary): Use notype_unqualified_id. + (decl): Add typespec initdecls ';' and typespec declarator ';' + rules. + (initdcl0): Deal with the above. + (complex_notype_declarator1): A notype_declarator that is not also + an expr_or_declarator. + (complex_direct_notype_declarator): A direct_notype_declarator that + doesn't conflict with expr_or_declarator. Use + notype_unqualified_id. Remove id_scope see_typename TYPENAME rule. + (functional_cast): New nonterminal, for the three functional cast + rules. So that they can be moved after + complex_direct_notype_declarator. + (see_typename): Don't accept type_quals any more. + + * decl2.c (reparse_decl_as_expr): New function to deal with parse + nodes for code like `int (*a)++;'. + (reparse_decl_as_expr1): Recursive subroutine of the above. + (finish_decl_parsing): New function to deal with parse nodes for + code like `int (*a);'. See the difference? + +Thu Mar 17 12:16:10 1994 Mike Stump + + These changes break binary compatibility in code with classes + that use virtual bases. + + * search.c (dfs_get_vbase_types): Simplify and correct to make + sure virtual bases are initialized in dfs ordering. + * search.c (get_vbase_types): Simplify and make readable. + +Thu Mar 17 12:01:10 1994 Jason Merrill + + * parse.y: s/ typename / type_id /g + +Wed Mar 16 17:42:52 1994 Kung Hsu + + * parse.y (typespec): Add SCOPE TYPENAME for global scoped + type. e.g. ::B x. + + * decl.c (complete_array_type): Fix a bug that in -pendantic + mode even there's no initializer, it will continue to build + default index. + +Wed Mar 16 17:43:07 1994 Jason Merrill + + * parse.y (direct_notype_declarator): Add PTYPENAME rule, remove + all of the scoped PTYPENAME rules. + +Wed Mar 16 16:39:02 1994 Mike Stump + + * init.c (build_offset_ref): The value of A::typedef_name is + always the TYPE_DECL, and never an error. + +Tue Mar 15 20:02:35 1994 Jason Merrill + + * search.c (get_base_distance_recursive): Two binfos can only + represent the same object if they are both via_virtual. + + * class.c (finish_base_struct): Check vbases for ambiguity, too. + + * search.c (get_vbase_types): Accept binfo argument, too. + +Tue Mar 15 19:22:05 1994 Kung Hsu + + * decl.c (complete_array_type): Complete TYPE_DOMAIN of the + initializer also, because back-end requires it. + +Tue Mar 15 15:33:31 1994 Jason Merrill + + * error.c (dump_expr): Support member functions (which show up as + OFFSET_REFs). + +Mon Mar 14 16:24:36 1994 Mike Stump + + * init.c (build_new): Set the return type of multidimensional + news correctly. + +Fri Mar 11 15:35:39 1994 Kung Hsu + + * call.c (build_method_call): If basetype not equal to type + of the instance, use the type of the instance in building + destructor. + +Thu Mar 10 17:07:10 1994 Kung Hsu + + * parse.y (direct_notype_declarator): Add push_nested_type for + 'template_type SCOPED_NAME' rule. + +Tue Mar 8 00:19:58 1994 Jason Merrill + + * parse.y (parm): Add typed_declspec1 {absdcl, epsilon} rules. + +Sat Mar 5 04:47:48 1994 Jason Merrill + + * parse.y (regcast_or_absdcl): New nonterminal to implement late + reduction of constructs like `int ((int)(int)(int))'. + (cast_expr): Use it. + (sub_cast_expr): Everything that can come after a cast. + (typed_declspecs1): typed_declspecs that are not typed_typespecs. + (direct_after_type_declarator): Lose PAREN_STAR_PAREN rule. + (direct_abstract_declarator): Replace '(' parmlist ')' rule with + '(' complex_parmlist ')' and regcast_or_absdcl. + (parmlist): Split + (complex_parmlist): Parmlists that are not also typenames. + (parms_comma): Enabler. + (named_parm): A parm that is not also a typename. Use declarator + rather than dont_see_typename abs_or_notype_decl. Expand + typed_declspecs inline. + (abs_or_notype_decl): Lose. + (dont_see_typename): Comment out. + (bad_parm): Break out abs_or_notype_decl into two rules. + +Fri Mar 4 18:22:39 1994 Jason Merrill + + * decl2.c (reparse_decl_as_casts): New function to change parse + nodes for `(int)(int)(int)' from "function taking int and returning + function taking int and returning function taking int" to "... cast + to int, cast to int, cast to int". + + * decl2.c (reparse_decl_as_expr): Recursive function to change + parse nodes for `A()()' from "function returning function returning + A" to "A().operator()". + + * parse.y (primary): Replace `typespec LEFT_RIGHT' rule with + `typespec fcast_or_absdcl' rule. + (fcast_or_absdcl): New nonterminal to implement late reduction of + constructs like `A()()()()'. + (typename): Replace `typespec absdcl1' rule with + `typespec direct_abstract_declarator' rule. + (direct_abstract_declarator): Replace `LEFT_RIGHT type_quals' rule + with `fcast_or_absdcl type_quals' rule. + +Fri Mar 4 16:18:03 1994 Mike Stump + + * tree.c (lvalue_p): Improve OFFSET_REF handling, so that it + matches Section 5.5. + +Fri Mar 4 14:01:59 1994 Jason Merrill + + * error.c (dump_type_prefix): Don't print basetype twice for + pmfs. + +Fri Mar 4 13:24:33 1994 Mike Stump + + * typeck.c (convert_arguments): Handle setHandler(A::handlerFn) + so that it is like setHandler(&A::handlerFn). Cures an `invalid + lvalue in unary `&''. + +Fri Mar 4 11:15:59 1994 Jason Merrill + + * gxxint.texi (Copying Objects): New section discussing default + op= problems with virtual inheritance. + + * decl2.c (grokoptypename): Just does grokdeclarator and + build_typename_overload, since the parser can't call grokdeclarator + directly. + + * method.c (build_typename_overload): Set IDENTIFIER_GLOBAL_VALUE + and TREE_TYPE on generated identifiers. + + * decl.c (grokdeclarator): Don't deal with TYPE_EXPRs anymore. + + * parse.y (parm): Convert `const char *' to `__opPCc' here. + + * error.c (dump_decl): Say sorry rather than my_friendly_aborting + if we can't figure out what to do. + (dump_type*): Likewise. + + * typeck2.c (build_m_component_ref): 'component' is an expr, not + a decl. Also move the IS_AGGR_TYPE check after the stripping of + REFERENCE_TYPE. + +Fri Mar 4 04:46:05 1994 Mike Stump + + * call.c (build_method_call): Handle b->setHandler(A::handlerFn) + so that it is like b->setHandler(&A::handlerFn). Cures an `invalid + lvalue in unary `&''. + +Thu Mar 3 12:38:15 1994 Jason Merrill + + * parse.y: Add precedence specification for START_DECLARATOR. + (type_quals): Move before primary. + (typename): Move before typed_declspecs, add 'typespec absdcl1' rule. + + * decl2.c (grokoptypename): Lose. + + * decl.c (grokdeclarator): Parse TYPE_EXPRs in the initial scan, + rather than waiting until later. + +Wed Mar 2 14:12:23 1994 Jason Merrill + + * parse.y (unary_expr): Use 'typename' in 'new' rules, rather + than expanding it inline. + (typename): Expand empty option of (former) absdcl inline. + (abs_or_notype_decl): Likewise. + (absdcl): Lose empty rule. + (conversion_declarator): New nonterminal for 'typename' of 'operator + typename'. + (operator_name): Use it instead of absdcl. + + * parse.y: Add precedence declarations for SCOPED_TYPENAME, + TYPEOF, and SIGOF. + (typed_declspecs): Accept typed_typespecs, rather than typespec + directly. Add rules with reserved_typespecquals. + (reserved_declspecs): Don't accept typespecqual_reserved at the + beginning of the list. The typed_declspecs rule will deal with this + omission. + (declmods): Accept nonempty_type_quals, rather than TYPE_QUAL + directly. + + * parse.y (direct_notype_declarator, + direct_after_type_declarator, direct_abstract_declarator): Split up + the declarator1 nonterminals to match the draft standard and avoid + ambiguities. + (new_type_id, new_declarator, direct_new_declarator, + new_member_declarator): New nonterminals to implement the subset of + 'typename' allowed in new expressions. + (unary_expr): Use new_type_id instead of typename. + (after_type_declarator1, absdcl1): Fix semantics of member pointers. + (abs_member_declarator, after_type_member_declarator): Lose. + + * parse.y (absdcl1): Don't require parens around + abs_member_declarator. + (abs_member_declarator): Lose see_typename from rules. + (after_type_member_declarator): Likewise. + + * tree.c (get_identifier_list): New function, containing code + previously duplicated in get_decl_list and list_hash_lookup_or_cons. + (get_decl_list): Use it. + (list_hash_lookup_or_cons): Likewise. + + * parse.y (typed_declspecs, declmods): It's not necessary to hash + the declspecs on class_obstack, so don't. This way typed_typespecs + can reduce to typed_declspecs. + +Wed Mar 2 14:29:18 1994 Jason Merrill + + * cvt.c (build_up_reference): If we aren't checking visibility, + also allow base->derived conversions. + +Mon Feb 28 15:14:29 1994 Per Bothner + + * typeck.c (build_c_cast): Remove bogus hack when converting + to a reference type. + + * cp-tree.h (lang_decl::vbase_init_list, DECL_VBASE_INIT_LIST): + Removed, not used. + (lang_stype::methods, lang_decl::next_method): New fields. + (CLASSTYPE_METHODS, DECL_NEXT_METHOD): New macros. + * decl.c (duplicate_decls): Preserve DECL_NEXT_METHOD. + + * cp-tree.h, decl2.c (flag_vtable_hack): New flag. + * decl2.c (finish_vtable_vardecl): If flag_vtable_hack, + and !CLASSTYPE_INTERFACE_KNOWN, try to use the presence of + a non-inline virtual function to control emitting of vtables. + * class.c (finish_struct): Build CLASSTYPE_METHODS list. + * search.c (build_vbase_vtables_init): Don't assemble_external + (yet) if flag_vtable_hack. + * class.c (build_vfn_ref): Likewise. + +Mon Feb 28 14:54:13 1994 Jason Merrill + + * parse.y (component_decl): Don't include "typed_declspecs + declarator ';'" speedup, since it breaks enums. + +Fri Feb 25 15:43:44 1994 Per Bothner + + * class.c (finish_struct): Minor optimization for building + fn_fields list. + +Fri Feb 25 15:23:42 1994 Jason Merrill + + * decl.c (start_function): Fix detection of function overloading. + +Thu Feb 24 22:26:19 1994 Mike Stump + + * lex.c (check_newline): #pragma interface can take a string + argument, just like #pragma implementation. #pragma implementation + checks for garbage on the line, line #pragma interface does. Main + input files do not auto implement like named files, #pragma + implementation must be used explicitly. + +Thu Feb 24 17:09:01 1994 Jason Merrill + + * parse.y (components): Handle list of one again. + (notype_components): Likewise. + (after_type_declarator1): Take maybe_raises out again. + + * gxxint.texi (Parser): Document additional r/r conflict. + +Wed Feb 23 14:42:55 1994 Jason Merrill + + * gxxint.texi (Parser): Add node. + + * Makefile.in (stamp-parse): Update expected conflict count. + + * parse.y (various): Replace "declmods declarator" with "declmods + notype_declarator". The comment saying that "declmods declarator ';'" + corresponds to "int i;" was wrong; it corresponds to "const i;". + (component_decl): Add "typed_declspecs declarator ';'" rule; this + *does* correspond to "int i;". Change "declmods components" to + "declmods notype_components". + (components): Don't deal with a list of one anymore. + (notype_components): New nonterminal, corresponds to notype_declarator. + ({after_,no}type_component_decl{,0}): More new nonterminals. + ({after_,no}type_declarator): Fold in START_DECLARATOR token. + Eliminates four reduce/reduce conflicts. + + (expr): Depend on nontrivial_exprlist instead of nonnull_exprlist. + (nontrivial_exprlist): New nonterminal: A list of at least two + expr_no_commas's. + (nonnull_exprlist): Depend on nontrival_exprlist. + Eliminates four reduce/reduce conflicts. + + (named_class_head): Move intermediate code block into separate + nonterminal so that we can stick %prec EMPTY on it. + + Add more %prec EMPTY's to eliminate remaining shift/reduce + conflicts. + + (after_type_declarator): Add maybe_raises to fndecl rules. + (after_type_declarator_no_typename): Remove. + For correctness. + + Document remaining reduce/reduce conflicts. + +Tue Feb 22 12:10:32 1994 Jason Merrill + + * search.c (get_base_distance): Only bash BINFO_INHERITANCE_CHAIN + (TYPE_BINFO (type)) if we care about the path. + + * tree.c (lvalue_p): A COND_EXPR is an lvalue if both of the + options are. + +Mon Feb 21 19:59:40 1994 Mike Stump + + * Makefile.in (mostlyclean): lex.c is a source file, don't + remove. + +Sat Feb 19 01:27:14 1994 Jason Merrill + + * parse.y: Eliminate 20 shift/reduce conflicts. + +Fri Feb 18 11:49:42 1994 Jason Merrill + + * pt.c (type_unification): Add subr argument; if set, it means + that we are calling ourselves recursively, so a partial match is OK. + (unify): Support pointers to methods and functions. + (tsubst): Support method pointers. + * decl.c (build_ptrmemfunc_type): No longer static, so that + tsubst can get at it. + + * init.c (is_aggr_typedef): Pretend template type parms are + aggregates. + * decl2.c (build_push_scope): If cname refers to a template type + parm, just grin and nod. + + * call.c (build_overload_call_real): Pass subr argument to + type_unification. + * pt.c (do_function_instantiation): Likewise. + * class.c (instantiate_type): Likewise. + + * search.c (get_base_distance): If BINFO is a binfo, use it and + don't mess with its BINFO_INHERITANCE_CHAIN. + + * cvt.c (convert_to_reference): Fix temporary generation. + If ambiguous, return error_mark_node. + + * init.c (build_new): Put back some necessary code. + +Thu Feb 17 15:39:47 1994 Jason Merrill + + * init.c (build_new): Deal with array types properly. + + * search.c (get_binfo): Become a shell for get_base_distance. + (get_binfo_recursive): Lose. + (get_base_distance_recursive): Find the path to the via_virtual base + that provides the most access. + (get_base_distance): Likewise. + + * parse.y (explicit_instantiation): Syntax is 'template class + A', not 'template A'. + + * typeck.c (convert_for_initialization): Remove bogus warning. + + * parse.y (datadef): Revert patch of Oct 27. + +Thu Feb 17 15:12:29 1994 Per Bothner + + * class.c (build_vfn_ref): Cast delta field to ptrdiff_type_node, + rather than integer_type_node. Does wonders for the Alpha. + +Thu Feb 17 13:36:21 1994 Jason Merrill + + * decl.c (build_ptrmemfunc_type): Make sure that the pmf type + goes onto the same obstack as its target type. + +Wed Feb 16 00:34:46 1994 Jason Merrill + + * cvt.c (convert_to_reference): If converting via constructor + on local level, go back to build_cplus_new approach. + + * tree.c (build_cplus_new): If with_cleanup_p, set cleanup slot + to error_mark_node to prevent expand_expr from building a cleanup + for this variable. + + * lex.c (default_assign_ref_body): Return *this from the memcpy + version, too. + + * decl.c (grok_reference_init): Just return if called with + error_mark_node, don't worry about initializing non-const reference + with temporary. + + * cvt.c (convert_to_reference): Do the right thing for + non-aggregate reference conversions, pedwarn when generating a + non-const reference to a temporary. + + * class.c (finish_struct): TYPE_HAS_COMPLEX_{INIT,ASSIGN}_REF and + TYPE_NEEDS_CONSTRUCTING all depend on TYPE_USES_VIRTUAL_BASECLASSES + again. + +Tue Feb 15 19:47:19 1994 Jason Merrill + + * decl.c (grok_reference_init): Pawn off a lot of the work on + convert_to_reference. Generally do the right thing. + + * cvt.c (convert_to_reference): Conform to the initial comment; + i.e. don't create temps if decl != error_mark_node. Handle + cleanups better for temps that do get created. Don't pretend + that we can use an 'A' to initialize a 'const double &' just by + tacking on a NOP_EXPR. Support LOOKUP_SPECULATIVELY. + + * call.c (build_method_call): Set TREE_HAS_CONSTRUCTOR on + constructor calls. + +Mon Feb 14 14:50:17 1994 Jason Merrill + + * decl.c (grok_reference_init): Make a temporary for initializing + const reference from constant expression. + +Mon Feb 14 11:31:31 1994 Per Bothner + + * cp-tree.h, decl.c (set_identifier_local_value): Deleted function. + * decl.c (pushdecl): Define decl in correct binding_level + (which isn't always the inner_binding_level). + + * cvt.c (build_up_reference): Don't ever call expand_aggr_init. + It's ugly, and I don't think it's the right thing to do. + + * cp-tree.h, class.c, decl.c, decl2.c, sp/search.c: + Remove NEW_CLASS_SCOPING, assuming it is always 1. + * decl.c (pop_decl_level): Removed; manually inlined. + +Sun Feb 13 19:04:56 1994 Jason Merrill + + * class.h (candidate): Add basetypes field. + + * call.c (build_method_call): Do access checking after choosing a + function, not before. + + * Makefile.in (cvt.o, call.o, method.o): Depend on class.h. + (mostlyclean): Remove ../cc1plus. + +Fri Feb 11 11:52:26 1994 Jason Merrill + + * class.c (finish_struct): Don't allow adjusting access to a field + of a base class if a local field has the same name. + + * error.c (dump_type_prefix): Output basetype for METHOD_TYPEs. + +Thu Jan 13 17:55:51 1994 Gnanasekaran Swaminathan + + * cp-tree.h (DESTRUCTOR_NAME_P): Do not confuse AUTO_TEMP names + with destructor names when either NO_DOLLAR_IN_LABEL or + NO_DOT_IN_LABEL are not defined. + + Now `template class A {...}' works. + + * pt.c (grok_template_type): Substitute template parm types + with actual types in complex type as well. + (coerce_template_parms): Update the grok_template_type () + function call. + + * pt.c (tsubst): Traverse method list using DECL_CHAIN. + + * decl.c (grok_op_properties): Allow operator++/-- to have + default arguments. + + * typeck2.c (store_init_value): Don't abort when called to + initialize a type that needs constructing with a CONSTRUCTOR. + + * init.c (expand_aggr_init_1, CONSTRUCTOR case): If + store_init_value fails, build and expand an INIT_EXPR. If + store_init_value succeeds, call expand_decl_init. + +Fri Feb 11 02:49:23 1994 Mike Stump + + * class.c (build_vbase_path): Use complete_type_p instead of + resolves_to_fixed_type_p to determine if the virtual bases are in + their right place for the type of expr. Cures problem of thinking a + virtual base class is one place, when it is in fact someplace else. + +Fri Feb 11 00:26:46 1994 Mike Stump + + * init.c (resolve_offset_ref): Make sure we first convert to + intermediate type, if given, when dealing with members off `this'. + Solves an incorrrect `type `foo' is not a base type for type + `multiple'' when it is infact, a base type. + +Thu Feb 10 21:49:35 1994 Mike Stump + + * class.c (modify_other_vtable_entries): Use get_binfo, instead + of binfo_value. Solves problem with compiler giving a `base class + `B' ambiguous in binfo_value (compiler error)' on complex MI + herarchies, when a virtual function is first defied in a virtual + base class. + +Thu Feb 10 17:19:32 1994 Mike Stump + + * class.c (build_vbase_path): Don't complain about ambiguous + intermediate conversion when converting down to a virtual base + class, even if they might seem to be ambiguous. + +Thu Feb 10 12:18:26 1994 Jason Merrill + + * typeck2.c (build_functional_cast): #if 0 out constructor + inheritance code, improve error messages. + + * class.c (finish_base_struct): Complain about base with only + non-default constructors in derived class with no constructors. + + * decl.c (grokdeclarator): Fix detection of virtual new/delete. + +Wed Feb 9 22:02:32 1994 Mike Stump + + * search.c (build_mi_virtuals, add_mi_virtuals, + report_ambiguous_mi_virtuals): Removed unneeded code. + * class.c (finish_struct_bits): Likewise. + +Wed Feb 9 11:27:17 1994 Jason Merrill + + * pt.c (end_template_instantiation): Push decl before + pop_from_top_level. + + * typeck2.c (build_m_component_ref): Make sure datum is of + aggregate type. + + * init.c (get_type_value): New function, returns + IDENTIFIER_TYPE_VALUE or IDENTIFIER_CLASS_TYPE_VALUE or NULL_TREE. + + * call.c (build_method_call): Don't die on call to destructor for + non-type. + + * decl.c (grokdeclarator): Complain about virtual op new and op + delete, make static virtuals unvirtual instead of unstatic. + + * typeck.c (build_c_cast): Also call default_conversion on + methods. + + * decl.c (grokdeclarator): Don't complain about anonymous + bitfields. + + * parse.y (simple_stmt, for loops): Move the continue point after + the cleanups. + + * class.c (finish_struct): Fix setting of + TYPE_HAS_COMPLEX_INIT_REF. + +Tue Feb 8 13:21:40 1994 Jason Merrill + + * init.c (build_new): Deal with `new double (1)'. + + * class.c (finish_struct): TYPE_HAS_COMPLEX_*_REF are supersets of + TYPE_HAS_REAL_*_REF, but TYPE_HAS_COMPLEX_INIT_REF is independent of + TYPE_NEEDS_CONSTRUCTING. + + * decl.c (duplicate_decls): Propagate access decls. + + * typeck2.c (process_init_constructor): Accept empty_init_node + for initializing unions. + + * class.c, lex.c, cp-tree.h: Use + TYPE_HAS_COMPLEX_ASSIGN_REF where TYPE_HAS_REAL_ASSIGN_REF was used + before, use TYPE_HAS_COMPLEX_INIT_REF for TYPE_NEEDS_CONSTRUCTING in + some places. + + * decl.c (finish_decl): Don't complain about uninitialized const + if it was initialized before. + +Mon Feb 7 18:12:34 1994 Jason Merrill + + * lex.c (default_assign_ref_body): Don't deal with vbases for + now. + + * decl.c (finish_decl): Fix reversed logic for objects and other + things that need to be constructed but have no initializer. + + * class.c (finish_struct): Don't set TYPE_HAS_* flags that are + set by grok_op_properties or finish_decl. + + * decl.c: Don't warn about extern redeclared inline unless + -Wextern-inline is given. + * decl2.c (lang_decode_option): Likewise. + * cp-tree.h: Likewise. + +Mon Feb 7 17:29:24 1994 Per Bothner + + * decl.c (pushdecl_with_scope): Fix thinko. Add forward + declaration. + + * decl.c (pushdecl_with_scope): New function. + * decl.c (pushdecl_top_level): Use new function. + * decl.c (pushtag): Initialize newdecl. + * decl.c (pushtag): Push new type decl into correct scope. + +Mon Feb 7 14:42:03 1994 Jason Merrill + + * call.c, cvt.c, init.c, search.c, cp-tree.h: + Eradicate LOOKUP_PROTECTED_OK. + +Mon Feb 7 13:57:19 1994 Per Bothner + + * decl.c (pushtag, xref_tag), cp-tree.h: Add extra parameter + 'globalize' to signify implicit declarations. + * decl.c (globalize_nested_type, maybe_globalize_type): Removed. + * decl.c (set_identifier_type_value_with_scope): New function. + * decl.c (set_identifier_local_value): Simplify. + * spew.c (yylex, do_addr): Modify to return a _DEFN if a + forward declaration (followed by ';' and not preceded by 'friend'). + * class.c, decl.c, except.c, init.c, parse.y, + pt.c, search.c: Add new argument to calls to xref_tag and + pushtag. + +Mon Feb 7 00:22:59 1994 Jason Merrill + + * cp-tree.h (ACCESSIBLY_UNIQUELY_DERIVED_P): New macro, means what + ACCESSIBLY_DERIVED_FROM_P meant before. + (ACCESSIBLY_DERIVED_FROM_P): Now disregards ambiguity. + + * cvt.c (build_up_reference): Call get_binfo with PROTECT == 1. + + * search.c (get_base_distance_recursive): Members and friends of + a class X can implicitly convert an X* to a pointer to a private or + protected immediate base class of X. + (get_binfo_recursive): Likewise. + (get_base_distance): Ignore ambiguity if PROTECT < 0. + (get_binfo): Lose multiple values of PROTECT. + (compute_access): Protected is OK if the start of the + search is an accessible base class of current_class_type. + + * method.c (build_opfncall): Do check access on operator new here. + + * decl.c (finish_function): Don't check access on operator new + here. + +Sun Feb 6 14:06:58 1994 Jason Merrill + + * decl.c (xref_tag): The base of a derived struct is NOT always + public. Duh. + + * pt.c (do_explicit_instantiation): New function, called from + parser to do explicit function instantiation. + (type_unification): Allow the args list to be terminated with + void_list_node. + (do_pending_expansions): Look at i->interface for non-member + templates. + + * parse.y (datadef): Move explicit_instantiation here. + (structsp): From here. + (datadef): Complain about `int;'. + +Sun Feb 6 12:33:18 1994 Per Bothner + + * pt.c (end_template_instantiation), cp-tree.h: Remove unused + second parameter, and simplify first from a TREE_LIST where + we only care about its TREE_VALUE to just the value (an IDENTIFIER). + * pt.c (instantiate_member_templates): Simplify argument list + from a TREE_LIST to just an IDENTIFIER. + * lex.c (yyprint): PRE_PARSED_CLASS_DECL is now just an IDENTIFIER. + * parse.y (template_instantiate_once): Simplify accordingly. + * decl.c (inner_binding_level): New. Use various places to + simplify. + +Sun Feb 6 02:49:37 1994 Jason Merrill + + * typeck2.c (build_functional_cast): int() -> int(0). + +Sat Feb 5 00:53:21 1994 Jason Merrill + + * class.c (finish_struct): Don't do a bitwise copy for op= if the + class has a virtual function table. + + * typeck.c (convert_for_initialization): Restore warnings about + not using defined op=. Should really be my_friendly_aborts, I + s'pose. + +Fri Feb 4 14:21:00 1994 Jason Merrill + + * class.c (finish_struct): Tidy up conditions for doing bitwise + copies of objects. + + * decl.c (build_default_constructor): #if 0 out. + + * *: Eradicate TYPE_GETS_{ASSIGNMENT,ASSIGN_REF,CONST_ASSIGN_REF, + CONST_INIT_REF}, TYPE_HAS_REAL_CONSTRUCTOR. + + * decl.c (grokdeclarator): Don't return void_type_node for + friends being defined here. + + * init.c (perform_member_init): Only do the init if it's useful. + + * lex.c (default_copy_constructor_body): If we don't need to do + memberwise init, just call __builtin_memcpy. + (default_assign_ref_body): Likewise. + + * decl.c (grokdeclarator): If friendp && virtualp, friendp = 0. + +Fri Feb 4 13:02:56 1994 Mike Stump + + * lex.c (reinit_parse_for_method, cons_up_default_function): + Don't give warn_if_unknown_interface warning when it came from a + system header file. + * pt.c (end_template_decl, instantiate_template): Likewise. + * decl.c (start_decl): Likewise. + +Fri Feb 4 00:41:21 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't try to set TYPE_WAS_ANONYMOUS on + enums. + + * decl2.c (constructor_name_full): Use IS_AGGR_TYPE_CODE instead of + IS_AGGR_TYPE, since we don't know it's a type. + +Thu Feb 3 11:36:46 1994 Jason Merrill + + * decl.c (grokdeclarator): Don't complain about anonymous unions. + + * cp-tree.h (TYPE_WAS_ANONYMOUS): This struct was originally + anonymous, but had a name given to it by a typedef. + + * decl.c (grokdeclarator): When renaming an anonymous struct, set + TYPE_WAS_ANONYMOUS. + + * decl2.c (constructor_name_full): Use TYPE_WAS_ANONYMOUS. + + * cp-tree.h (DECL_UNDEFINED_FRIENDS): #if 0 out. + + * init.c (xref_friend): Don't set up DECL_UNDEFINED_FRIENDS. + (embrace_waiting_friends): Don't use DECL_UNDEFINED_FRIENDS. + + * decl.c (grokdeclarator): Set TYPE_NESTED_NAME properly on nested + anonymous structs that get typedef'd. + + * decl.c (grokdeclarator): Always return void_type_node for + friends. + + * error.c (dump_function_decl): Don't use DECL_CLASS_CONTEXT for + friends. + (dump_function_decl): Don't print out default args for + a function used in an expression. + + * decl.c (grokdeclarator): Give error on abstract declarator used + in an invalid context (i.e. `void (*)();'). + + * error.c (cp_line_of): Support _TYPE nodes. + (cp_file_of): Likewise. + + * cvt.c (build_up_reference): Don't abort if passed a SAVE_EXPR; + it can happen for the RHS of an assignment stmt where the LHS is + a COND_EXPR. + + * init.c (expand_aggr_init_1): Deal with bracketed initializer + lists properly. + + * class.c (finish_struct): Deal with enumerators and typedefs + again. + +Wed Feb 2 11:30:22 1994 Jason Merrill + + * class.c (finish_struct): Tidy up loop over fields. + + * errfn.c (cp_thing): Don't advance twice after a format. + + * class.c (finish_struct): Complain about needing a constructor + if a member has only non-default constructors, and don't try to + generate a default constructor. + + * decl.c (finish_decl): Also do the constructor thing if + TYPE_NEEDS_CONSTRUCTING is set (for arrays). + + * search.c (unuse_fields): New function: mark all fields in this + type unused. + (dfs_unuse_fields): Helper function. + + * class.c (pushclass): If the new class is the same as the old + class, still unuse the fields. + (unuse_fields): Move to search.c. + + * decl.c (grok_op_properties): Add friendp argument. + (grokfndecl): Pass it. + (start_method): Likewise. + + * decl2.c (delete_sanity): Add use_global_delete parameter to catch + ::delete calls. + + * parse.y (unary_expr): Pass new parameter to delete_sanity. + + * lex.c (default_copy_constructor_body): Don't choke if the union + has no fields. + (default_assign_ref_body): Likewise. + + * call.c (compute_conversion_costs_ansi): Do the right thing for + ellipsis matches. + + * decl.c (push_to_top_level): Optimize. + + * decl.c (start_function): Look for the lexical scope of a friend + in DECL_CLASS_CONTEXT. + + * init.c (do_friend): Set DECL_CLASS_CONTEXT on global friends. + +Tue Feb 1 15:59:24 1994 Jason Merrill + + * cp-tree.h (TREE_GETS_PLACED_NEW): New macro. + + * init.c (init_init_processing): Don't assign BIN/BID to the + IDENTIFIER_GLOBAL_VALUEs of their respective operators. + (build_new): Check TREE_GETS_PLACED_NEW. + + * decl.c (grok_op_properties): Don't set TREE_GETS_NEW for a decl of + op new with placement, set TREE_GETS_PLACED_NEW. + + * cp-tree.h (ANON_UNION_P): New macro. Applies to decls. + + * class.c (finish_struct): Don't treat anonymous unions like + other aggregate members. Do synthesize methods for unions without + a name, since they may or may not be "anonymous unions". + + * decl2.c (grok_x_components): Wipe out memory of synthesized methods + in anonymous unions. + + * lex.c (default_copy_constructor_body): Support unions. + (default_assign_ref_body): Likewise. + +Mon Jan 31 12:07:30 1994 Jason Merrill + + * cp-tree.h: Fix documentation of LOOKUP_GLOBAL, add prototypes. + + * error.c (args_as_string): New function (%A), like type_as_string + except NULL_TREE -> "..." + + * call.c (build_overload_call_real): Fix for new overloading. + + * decl.c (grok_op_properties): Set all of the TYPE_OVERLOADS_* flags + here. + + * parse.y (operator_name): Instead of here. + + * typeck2.c (build_functional_cast): Treat a TREE_LIST as a list + of functions. + + * call.c (build_overload_call_real): Support LOOKUP_SPECULATIVELY. + + * method.c (build_opfncall): Don't need to massage return value + any more, call build_overload_call with all flags. + + * typeck.c (build_x_binary_op): Put back speculative call to + build_opfncall. + (build_x_unary_op): Likewise. + (build_x_conditional_expr): Likewise. + +Mon Jan 31 10:00:30 1994 Mike Stump + + * cvt.c (build_type_conversion_1): Change call to pedwarn into + warning, and conditionalize upon warn_cast_qual. + +Fri Jan 28 11:48:15 1994 Jason Merrill + + * search.c (lookup_field): If xbasetype is a binfo, copy it to + avoid clobbering its inheritance info. + + * call.c (build_method_call): Don't overwrite basetype_path with + TYPE_BINFO (inst_ptr_basetype) if they have the same type. + + * search.c (compute_access): Fix handling of protected inheritance + and friendship with the enclosing class. + + * typeck2.c (store_init_value): Allow passing of TREE_CHAIN for + initialization of arbitrary variable. + + * typeck2.c (build_functional_cast): Only try calling a method if + one exists. + + * decl.c (grokdeclarator): Move handling of constructor syntax + initialization into first loop for generality. + (parmlist_is_random): Lose. + + * lex.c (cons_up_default_function): Set TREE_PARMLIST on arguments + to default function. + +Thu Jan 27 19:26:51 1994 Jason Merrill + + * decl.c (grokparms): Abort if we get called with something we don't + expect. + +Thu Jan 27 17:37:25 1994 Mike Stump + + * call.c (build_overload_call_real): Change argument complain to + flags to match style of rest of code. Pass it down to + build_function_call_real as necessary. + * call.c (build_overload_call, build_overload_call_maybe): Change + argument complain to flags to match style of rest of code. + * cp-tree.h (build_function_call_real): Added fourth flags + argument. + * cvt.c (convert_to_reference): Only give warning messages, if + LOOKUP_COMPLAIN is set. + * typeck.c (build_x_function_call): Change simple complain + argument to build_overload_call_maybe and build_overload_call, to + LOOKUP_COMPLAIN to match style of rest of code. + * typeck2.c (build_functional_cast): Likewise. + * typeck.c (build_function_call_real): Add flags, so that we can + not complain, if we don't want to complain. Complain about + arguments, if we are complaining, otherwise don't. + * typeck.c (build_function_call, build_function_call_maybe): + Stick in flags argument. + * typeck.c (build_x_binary_op, build_x_unary_op, + build_x_conditional_expr, build_x_compound_expr): Follow style of + build_x_indirect_ref, as it is more correct and more common. + +Thu Jan 27 14:36:20 1994 Jason Merrill + + * call.c (build_method_call): Don't check for being called with + a pointer. + + * decl2.c (finish_file): Don't play with DECL_CLASS_CONTEXT for the + static initializer function. + + * init.c (build_member_call): Use convert_force here, too. + + * search.c (compute_access): Only treat static members specially + if they are referenced directly. + +Wed Jan 26 18:28:14 1994 Jason Merrill + + * gxxint.texi (Access Control): New node. + + * search.c (current_scope): New function; returns whichever of + current_class_type and current_function_decl is the most nested. + (compute_access): Total overhaul to make it clearer and more + correct. Don't use the cache for now; in the only situation where + it was used before, it gained nothing. This frees up three of the + DECL_LANG_FLAGs for possible other use! + + * cp-tree.h: #if 0 out DECL_PUBLIC & friends. + + * typeck.c (build_component_ref_1): Don't check DECL_PUBLIC. + + * call.c (build_method_call): Use convert_force to cast `this' -- + rely on the access checking for the method itself. + + * init.c (is_friend): Do the nesting thing, handle types. I am + my own friend. + (is_friend_type): Become a shell for is_friend. + (add_friend): Never stick in ctype. + Why are the friendship functions in init.c, anyway? + +Wed Jan 26 17:50:00 1994 Mike Stump + + * cvt.c (build_type_conversion_1): Don't conditionalize call to + pedwarn upon pedantic. + +Wed Jan 26 17:20:46 1994 Mike Stump + + * cvt.c (convert_to_reference): Add 8.4.3 checking so that one + gets a warning if one tries to initialize a non-const & from a + non-lvalue. + * cvt.c (convert_to_reference): Use %P format for argument + numbers in warnings. + +Wed Jan 26 14:35:06 1994 Mike Stump + + * init.c (build_delete): Follow style in call.c to construct the + virtual call to the desctructor, as that code is right. Fixes a + problem of the compiler saying a pointer conversion is ambiguous. + +Wed Jan 26 11:28:14 1994 Jason Merrill + + * cp-tree.h (VTABLE_NAME_P): Change other occurrence of + VTABLE_NAME_FORMAT to VTABLE_NAME. + + * *: s/visibility/access/g + +Tue Jan 25 18:39:12 1994 Jason Merrill + + * typeck.c (build_modify_expr): Don't smash references if INIT_EXPR. + +Tue Jan 25 13:54:29 1994 Mike Stump + + * init.c (build_delete): Back out Jan 17th & 18th pacthes, as + they break libg++. + +Tue Jan 25 13:11:45 1994 Jason Merrill + + * decl.c (duplicate_decls): Fix pointer arithmetic. + +Mon Jan 24 15:50:06 1994 Chip Salzenberg + + [ cp-* changes propagated from c-* changes in 940114 snapshot ] + * cp-parse.y (maybe_attribute): Allow multiple __attribute__ + clauses on a declaration. + +Mon Jan 24 17:06:23 1994 Jason Merrill + + * class.c (finish_struct): Do synthesize methods for anon + structs, just not unions. + +Mon Jan 24 13:50:13 1994 Kung Hsu + + * decl.c (xref_tag): Handle anonymous nested type. + * decl.c (globalize_nested_type): Add no globalize bit check. + * spew.c (hack_more_ids): Templated nested decl not push top + level. + + * parse.y: Get rid of 'goto do_components'. It is much better + for debugging. + + * decl.c (is_anon_name): Get rid of the function and use the + macro ANON_AGGRNAME_P. + * pt.c: Ditto. + +Fri Jan 21 14:06:02 1994 Jason Merrill + + * class.c (finish_struct): Don't synthesize any methods for + anonymous structs/unions. + + * typeck.c (build_modify_expr): Don't treat pmf's as class objects. + +Thu Jan 20 18:56:46 1994 Jason Merrill + + * method.c (build_opfncall): Call build_indirect_ref on + synthesized instance for operator delete. + + * pt.c (type_unification): Don't abort if called with a list of + types in ARGS. + + * class.c (instantiate_type): Deal with function templates. + +Thu Jan 20 16:55:35 1994 Jim Wilson + + * Makefile.in (CC): Default to cc not gcc. + +Thu Jan 20 13:47:54 1994 Jason Merrill + + * typeck.c (build_modify_expr): Call constructor if appropriate. + + * decl.c (push_to_top_level): Clear out class-level bindings cache. + +Wed Jan 19 13:51:22 1994 Jason Merrill + + * call.c (resolve_scope_to_name): Work recursively (previously only + looked down one level). + + * lex.c (do_pending_inlines): If we're still dealing with the last + batch of inlines, don't start working on a new one. + + * Makefile.in (stamp-parse): Update conflict count. + (TAGS): Fix. + + * parse.y (explicit_instantiation): New rule; implements + 'template A' syntax (though not 'template foo(int)' yet). + (structsp): Add explicit_instantiation. + +Tue Jan 18 13:53:05 1994 Jason Merrill + + * class.c (finish_struct, etc.): Simplify decision to synthesize + a destructor. + + * call.c, class.c, cp-tree.h, decl.c, init.c, + ptree.c, search.c, typeck.c, typeck2.c: Nuke + TYPE_NEEDS_CONSTRUCTOR (change all calls to TYPE_NEEDS_CONSTRUCTING). + * init.c (expand_aggr_init_1): Don't try non-constructor methods + of initializing objects. + (build_new): Don't try other methods if the constructor lookup fails. + + * class.c (finish_base_struct): Set cant_have_default_ctor and + cant_synth_copy_ctor properly. + (finish_struct): Likewise. + +Mon Jan 17 13:58:18 1994 Jason Merrill + + * typeck.c (build_modify_expr_1): #if 0 out again. + (build_modify_expr): #if 0 out memberwise init code again. + + * lex.c (default_copy_constructor_body): Be const-correct. + (default_assign_ref_body): Likewise. + + * init.c (perform_member_init): Use TYPE_HAS_CONSTRUCTOR to decide + whether or not to use it, rather than TYPE_NEEDS_CONSTRUCTING. + (expand_aggr_init): Disable silent conversion from initializer list + to list of args for a constructor. + + * class.c (base_info): Lose needs_default_ctor. + (finish_base_struct): Likewise. + (finish_struct): Likewise. + + * decl.c (init_decl_processing): Don't turn off flag_default_inline + just because flag_no_inline is on. + (finish_decl): Use TYPE_HAS_CONSTRUCTOR to decide to use + constructor. + + * class.c (finish_struct): Synthesize default ctor whenever + allowed. + + * Makefile.in (TAGS): Don't try to run etags on cp-parse.y. + +Sat Jan 15 18:34:33 1994 Mike Stump + + * Makefile.in, configure: Handle the C++ front-end in a + subdirectory. + * cp-*: Move C++ front-end to cp/*. + +Fri Jan 14 14:09:37 1994 Jason Merrill + + * cp-typeck.c (build_function_call_real): Modify to match other + instances of taking the address of the function. + + * cp-class.c (finish_struct): Set TYPE_HAS_REAL_CONSTRUCTOR to 1 if + there are non-synthesized constructors. + Only set TYPE_NEEDS_CONSTRUCTOR if TYPE_HAS_REAL_CONSTRUCTOR. + Always generate copy constructor if possible. + + * cp-tree.h (lang_type): Add has_real_constructor bitfield. + (TYPE_HAS_REAL_CONSTRUCTOR): Define. + + * cp-lex.c (default_copy_constructor_body): Use init syntax + for all bases. + + * cp-type2.c (store_init_value): Only give error for initializer list + if TYPE_HAS_REAL_CONSTRUCTOR. + +Thu Jan 13 15:38:29 1994 Jason Merrill + + * cp-tree.h (DECL_SYNTHESIZED): Add defn. + (lang_decl): Add synthesized bitfield to decl_flags. + + * cp-lex.c (cons_up_default_function): Use DECL_SYNTHESIZED to mark + artificial methods, rather than a line # of 0. + +Fri Jan 14 18:25:29 1994 Kung Hsu + + * cp-decl (xref_tag): Fix a bug in conflict type. + * cp-parse.y: Add SCOPED_NAME for uninstantiated template nested + type reference. + * cp-spew.c (yylex): Generated SCOPED_NAME token. + * cp-lex.c (yyprint): Handle SCOPED_NAME. + +Fri Jan 14 17:00:29 1994 Mike Stump + + * cp-decl.c (pushdecl): Revert patch from Jan 11 19:33:03, as it is + not right. + +Thu Jan 13 14:00:35 1994 Kung Hsu + + * cp-decl2.c (grok_x_components): Fix a bug that enum type does not + have type_flags. + +Thu Jan 13 11:39:34 1994 Mike Stump + + Ensure that all vtable pointers are initialized with all the right + values. + + * cp-class.c (is_normal): Changed to reflect new meaning of + CLASSTYPE_VFIELD_PARENT. + * cp-class.c (maybe_fixup_vptrs): Use of + CLASSTYPE_NEEDS_VIRTUAL_REINIT here is misguided. Use + BINFO_MODIFIED instead. + * cp-class.c (finish_struct): Changed to reflect new meaning of + CLASSTYPE_VFIELD_PARENT. + * cp-decl.c (get_binfo_from_vfield): Removed, unneeded now. + * cp-decl.c (finish_function): Use init_vtbl_ptrs, instead of open + coding it here. + * cp-init.c (init_vfields): Changed name to init_vtbl_ptrs, and + re-implement. + * cp-init.c (emit_base_init): Use new name init_vtbl_ptrs. + * cp-tree.h (vfield_parent): Changed to integer. + * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Changed docs to reflect new + meaning. + * cp-tree.h (init_vtbl_ptrs): Added init_vtbl_ptrs. + +Wed Jan 12 18:24:16 1994 Kung Hsu + + * cp-decl.c (xref_tag): Re-implement globalize nested type. + * cp-decl2.c (grok_x_components): Ditto. + * cp-parse.y: Ditto. + * cp-tree.h (lang_type): Add no_globalize bit in type_flags. + +Wed Jan 12 14:08:09 1994 Jason Merrill + + * cp-decl.c (grokdeclarator): Don't set TREE_PUBLIC on friend + decls with a definition attached. + + * cp-typeck.c (build_modify_expr): Undo previous change in the case + of INIT_EXPRs. + +Tue Jan 11 19:33:03 1994 Jason Merrill + + * cp-typeck.c (build_modify_expr): Replace code for generating + assignment semantics for classes with an error. + (build_modify_expr_1): #if 0 out. + + * cp-decl.c (pushdecl): Patch bogus design of pushdecl + behavior for overloaded functions (it doesn't push anything). + + * cp-class.c (finish_struct): When generating default op=, + set TYPE_HAS_ASSIGNMENT. + +Mon Jan 10 18:48:06 1994 Mike Stump + + * cp-cvt.c (convert): Make {double, clashing enum} -> enum + invalid. + * cp-typeck.c (convert_for_assignment): Simplify. + * cp-decl2.c (warn_enum_clash): Removed. + * invoke.texi (-Wenum-clash): Removed. + * toplev.c (-Wenum-clash): Removed. + +Mon Jan 10 17:48:37 1994 Kung Hsu + + * cp-decl.c (finish_decl): Fix incorrect popclass call. + + * cp-decl.c (is_anon_name): New function, check whether the name + is anonymous name generated by compiler. + * cp-decl.c (grokdeclarator): Allow nested SCOPE_REF + * cp-spew.c (hack_more_ids): Handle nested type in template. + * cp-parse.y: Handle nested type reference in uninstantiated + template. + * cp-call.c (build_method_call): Handle uninstantiated template + case. + * cp-pt.c (search_nested_type_in_tmpl): New function, search nested + type in template. + * cp-pt.c (lookup_nested_type_by_name): New function, lookup nested + type by name. + * cp-pt.c (tsubst): Handle nested type search by name. + +Mon Jan 10 14:32:18 1994 Jason Merrill + + * cp-init.c (build_member_call): Propagate qualifiers to new type. + + * cp-call.c (build_method_call): Count functions the new way. + +Fri Jan 7 19:03:26 1994 Jason Merrill + + * cp-decl.c (pushtag): Set DECL_ASSEMBLER_NAME for nested classes, + too. + +Tue Jan 4 16:45:51 1994 Kung Hsu + + * cp-parse.y: Change to handle whether to globalize nested class. + * cp-decl.c (xref_tag, maybe_globalize_type): Likewise. + +Mon Jan 3 22:22:32 1994 Gerald Baumgartner + + * Makefile.in cp-call.c cp-class.c cp-cvt.c cp-decl.c cp-decl2.c + cp-error.c cp-init.c cp-lex.c cp-lex.h cp-method.c cp-parse.y + cp-spew.c cp-tree.c cp-tree.h cp-type2.c cp-typeck.c cp-xref.c + gplus.gperf toplev.c: Incorporated C++ signature extension. + * cp-sig.c: New file, contains most of signature processing. + * cp-hash.h: Regenerated from gplus.gperf. + + * gcc.1 g++.1: Added explanation for the `-fhandle-signatures' + and `-fno-handle-signatures' command line flags. + + * gcc.texi: Changed the last-modification date. + * invoke.texi: Added `-fhandle-signatures' in the list of + C++ language options. Added explanation for this option. + diff --git a/gcc/cp/ChangeLog-1995 b/gcc/cp/ChangeLog-1995 new file mode 100644 index 00000000000..c4f4046ad05 --- /dev/null +++ b/gcc/cp/ChangeLog-1995 @@ -0,0 +1,3791 @@ +Thu Dec 28 11:13:15 1995 Mike Stump + + * except.c (expand_builtin_throw): Use RETURN_ADDR_OFFSET instead of + NORMAL_RETURN_ADDR_OFFSET. + (end_eh_unwinder): Likewise. + +Wed Dec 27 22:18:16 1995 Mike Stump + + * gc.c (build_dynamic_cast): Make sure we don't cast away const + when dealing with references, and make sure we handle dynamic + casting to a cv qualified reference. + +Thu Dec 21 23:50:35 1995 Mike Stump + + * except.c (struct eh_context): New structure top hold eh context + information. + (push_eh_context): New routine. + (pop_eh_context): Likewise. + * decl.c (push_cp_function_context): Use them. + (pop_cp_function_context): Likewise. + +Wed Dec 20 12:42:51 1995 Jason Merrill + + * decl2.c (finish_file): Also prune uninteresting functions in the + inline emission loop. + +Wed Dec 20 02:32:07 1995 Jeffrey A Law + + * sig.c (build_signature_table_constructor): Mark functions + in the signature as referenced. + +Tue Dec 19 22:36:56 1995 Jason Merrill + + * decl2.c (finish_file): Do all the vtable/synthesis stuff before + the inline emission stuff. + +Mon Dec 18 15:51:33 1995 Jason Merrill + + * cp-tree.h, decl2.c (flag_weak): New flag to control the use of + weak symbols. + * lang-options.h: Add -f{no-,}weak. + * decl.c (init_decl_processing): If the target does not support weak + symbols, don't use them. + * decl2.c, pt.c: s/SUPPORTS_WEAK/flag_weak/. + +Sun Dec 17 21:13:23 1995 Rusty Russell + + * init.c (expand_member_init): warning for base init after members. + +Fri Dec 15 15:32:18 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Don't convert to a reference + type. + +Thu Dec 14 16:05:58 1995 Mike Stump + + * method.c (report_type_mismatch): Improve wording for volatile + mismatches. + +Thu Dec 14 14:16:26 1995 Mike Stump + + * init.c (expand_aggr_init_1): Use expand_aggr_init_1 instead of + expand_assignment, as the later doesn't handle things that have + copy constructors well. The compiler would do bitwise copying, + instead of ctor calling in some cases. + +Wed Dec 13 17:05:54 1995 Paul Eggert + + * g++.c (my_strerror): Return "cannot access" if errno is 0. + (pfatal_with_name, perror_exec): Don't assume that + the returned value from my_strerror contains no '%'s. + (concat): Remove. + (sys_nerror): Declare only if HAVE_STRERROR is not defined. + +Wed Dec 13 16:22:38 1995 Jason Merrill + + Lose CLASSTYPE_METHODS/DECL_NEXT_METHOD chain; make + TYPE_METHODS/TREE_CHAIN mean what they used to. + * decl2.c (constructor_name_full): Refer to CLASSTYPE_METHOD_VEC + instead of TYPE_METHODS. + * decl.c (duplicate_decls): Lose references to DECL_NEXT_METHOD. + * tree.c (tree_copy_lang_decl_for_deferred_output): Likewise. + * cp-tree.h (CLASSTYPE_METHODS): Lose. + (CLASSTYPE_METHOD_VEC): Point to lang_spec->methods instead of + TYPE_METHODS. + (struct lang_decl): Lose next_method field. + (DECL_NEXT_METHOD): Lose. + * class.c (finish_struct_methods): Don't mess with TYPE_METHODS. + (finish_struct): Just use TYPE_METHODS; we don't need fn_fields + anymore. + (finish_struct_methods): Don't mess with the TREE_CHAINs in + fn_fields. + + * search.c (add_conversions): Don't use TREE_CHAIN to traverse method + vector. + + * call.c (build_method_call): Synthesize here even when not inlining. + * typeck.c (build_function_call_real): Likewise. + +Wed Dec 13 15:02:39 1995 Ian Lance Taylor + + * cp/lex.c (check_newline): If DBX_DEBUGGING_INFO and write_symbols + == DBX_DEBUG, call dbxout_start_new_source_file and + dbxout_resume_previous_source_file when appropriate. + +Tue Dec 12 20:38:55 1995 Mike Stump + + * except.c (start_anon_func): Push to the top level. + (end_anon_func): Pop from the top level. + +Mon Dec 11 18:56:14 1995 Mike Stump + + * cp-tree.h (build_cleanup): New routine to build cleanups. + * decl.c (expand_static_init): Use build_cleanup to build a cleanup + call at ctor time and use atexit to run it later. + * decl2.c (build_cleanup): New routine, taken from finish_file. + (finish_file): Use build_cleanup instead, and don't put function + local statics in global dtor list. + +Wed Dec 6 14:34:29 1995 Mike Stump + + * except.c (expand_throw): Ensure that we have cleanups, if we try + and expand cleanups. + +Wed Dec 6 11:48:21 1995 Mike Stump + + * except.c (expand_throw): Add logic to manage dynamic cleanups for + the EH object. + (expand_end_catch_block): Use the magic of expand_goto, instead of + emit_jump so that we get the cleanup for any catch clause parameter + and the cleanup for the exception object. Update to reflect label + changes. + (push_eh_cleanup): New routine to register a cleanup for an + exception object. + (empty_fndecl): Used to default cleanup actions to + nothing. + (init_exception_processing): Setup empty_fndecl. Setup + saved_cleanup. + (expand_start_catch_block): Update to reflect label changes. Call + push_eh_object to register the cleanup for the EH object. + (start_anon_func): New routine to start building lambda expressions + from trees. + (end_anon_func): New routine to end them. + (struct labelNode): Change so that we can use tree labels, or rtx + labels. + (saved_cleanup): Object to check for dynamic cleanups for the + exception handling object. + (push_label_entry): Change so that we can use tree labels, or rtx + labels. + (pop_label_entry): Likewise. + (top_label_entry): Likewise. + (expand_start_all_catch): Use tree label instead of rtx label, so + that we can get the magic of expand_goto. + (expand_end_all_catch): Update to reflect label changes. + + * class.c (build_vfn_ref): Remove building_cleanup logic, as we now + use UNSAVE_EXPRs. + * typeck.c (get_member_function_from_ptrfunc): Remove remnants of + building_cleanup logic, as we now use UNSAVE_EXPRs. + * cp-tree.h (unsave_expr): Declare it. + * decl.c (building_cleanup): Remove. + (maybe_build_cleanup): Remove building_cleanup logic, and use + UNSAVE_EXPR instead. + +Sun Dec 3 01:34:58 1995 Mike Stump + + * gc.c (build_t_desc): Update error message to say . + +Thu Nov 30 12:30:05 1995 Brendan Kehoe + + * decl.c (pushdecl): Only warn about shadowing a local variable if + warn_shadow is true. + +Sun Nov 26 16:06:55 1995 Rusty Russell + + * typeck.c (build_binary_op_nodefault): Added warning about + comparisons between different enum types with -Wall, unless + -fenum-int-equiv set. + +Wed Nov 22 15:44:02 1995 Mike Stump + + * class.c (finish_struct_1): Skip down to the inner type in + multidimensional arrays. Ensures ctors will be made for types that + need constructing. + +Wed Nov 22 14:19:22 1995 Mike Stump + + * decl.c (last_dtor_insn): New to track the last compiler generated + insn in a dtor. + (store_parm_decls): Set it. + (finish_function): Use it to see if the dtor is empty. Avoid doing + vtable setup all the time, if we can. + (struct cp_function): Add last_dtor_insn. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + +Wed Nov 22 11:52:19 1995 Paul Russell + + * typeck.c (build_unary_op): Set TREE_NO_UNUSED_WARNING to avoid + warnings. + +Tue Nov 21 17:15:23 1995 Mike Stump + + * typeck.c (expand_target_expr): Make sure targets get put into the + current temp_slot_level, so that the free_temp_slots call will reuse + them. + +Tue Nov 21 13:32:03 1995 Mike Stump + + * class.c (finish_struct_1): Delay delta fixups for virtual bases + until after we have done the hard virtuals, to avoid a bogus `every + virtual function must have a unique final overrider' for virtual + functions that are only overridden by hard virtuals. + +Thu Nov 9 13:35:30 1995 Jason Merrill + + * pt.c (do_function_instantiation): Don't try to find a file-scope + template for a member function. + +Tue Nov 14 06:20:35 1995 Mike Stump + + * g++.c (main): Add handling of -nodefaultlibs. + +Mon Nov 13 15:45:34 1995 Mike Stump + + * cp-tree.h (INDIRECT_BIND): Add a way for the frontend to + distinguish between direct bindings of reference variables, and + indirect bindings of reference variables. + * cvt.c (build_up_reference): Use it. + * typeck.c (convert_arguments): Use it to indicate this is an + indirect binding. + * decl.c (cp_finish_decl): Ensure that we reuse stack slots as fast + as they are unused. + (expand_static_init): Likewise. + (cplus_expand_expr_stmt): Likewise. + * decl2.c (finish_file): Likewise. + * init.c (perform_member_init): Likewise. + (emit_base_init): Likewise. + (expand_aggr_vbase_init_1): Likewise. + +Fri Nov 10 09:18:09 1995 Brendan Kehoe + + * decl.c (push_namespace): Rewrite to use build_lang_decl, so we + get a DECL_LANG_SPECIFIC node. + * cp-tree.h (lang_decl_flags): Add new member `level'. + (NAMESPACE_LEVEL): Don't use decl.arguments, instead use the + decl_flags level member. + +Mon Nov 6 18:36:13 1995 Brendan Kehoe + + * call.c (build_method_call): Make sure instance has a + TYPE_LANG_SPECIFIC node before we dive into it. + +Sat Nov 4 20:01:52 1995 Jason Molenda + + * method.c (make_thunk): Use TREE_SET_CODE to set thunk's tree code. + +Thu Nov 2 17:56:57 1995 Mike Stump + + * decl.c (duplicate_decls): When smashing decls, smash staticness in + the usual way. + +Thu Nov 2 16:44:02 1995 Mike Stump + + * decl.c (poplevel): Handle the merging of subblocks of cleanups + when finishing blocks that have already been created (usually due to + the fixup goto code). Fixes bad debugging information. + +Wed Nov 1 12:33:53 1995 Jason Merrill + + * method.c (hack_identifier): Don't abort when we get a TREE_LIST + that's not a list of overloaded functions. + +Wed Nov 1 11:38:58 1995 Brendan Kehoe + + * decl2.c (mark_vtable_entries): Check DECL_LANG_SPECIFIC on fn + before trying to use DECL_ABSTRACT_VIRTUAL_P. + +Tue Oct 31 11:56:55 1995 Jason Merrill + + * decl2.c (mark_used): New function for hooking into setting of + TREE_USED on decls. + * call.c (build_method_call): Use it. + * class.c (instantiate_type): Likewise. + * init.c (build_offset_ref): Likewise. Don't call assemble_external + for all like-named functions. + * method.c (hack_identifier): Likewise. + (emit_thunk): Don't call assemble_external. + (make_thunk): Create thunk as a FUNCTION_DECL so that it + gets the right mode and ENCODE_SECTION_INFO works. + + * parse.y: Use mark_used. Pass operator names to do_identifier. + * lex.c (do_identifier): Handle operator names. + + * decl2.c (grokclassfn): Tweak __in_chrg attributes. + +Thu Oct 26 16:45:58 1995 Brendan Kehoe + + * errfn.c: Include stdio.h. + (cp_sprintf): Take out decl of sprintf, and cast sprintf to errorfn*. + +Wed Oct 25 18:58:41 1995 Mike Stump + + * typeck2.c (digest_init): Always convert initializers to the + right type. + +Wed Oct 25 13:25:24 1995 Mike Stump + + * init.c (member_init_ok_or_else): Don't allow member initializers + for indirect members, as it is invalid. + +Wed Oct 25 11:35:28 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow `friend signed ()'. + +Fri Oct 20 10:30:59 1995 Mike Stump + + * parse.y (for.init.statement): Catch compound statements inside for + initializations, if we're being pedantic. + +Fri Oct 20 10:03:42 1995 Mike Stump + + * decl.c (lookup_tag): Return NULL_TREE if we don't find what we are + looking for. + +Thu Oct 19 14:26:10 1995 Mike Stump + + * error.c (dump_expr): Don't core dump when a boolean expression is + used as a default argument. + +Thu Oct 19 10:36:30 1995 Jason Merrill + + * class.c (finish_struct_bits): Check aggregate_value_p instead of + RETURN_IN_MEMORY. + +Wed Oct 18 18:12:32 1995 Jason Merrill + + * class.c (finish_struct_bits): Also set TREE_ADDRESSABLE on a + BLKmode type that would otherwise be returned in registers. + +Mon Oct 16 12:32:19 1995 Brendan Kehoe + + * g++.c (WITHLIBC): New macro. + (main): Declare saw_libc. Use WITHLIBC if `-lc' was used; set + saw_libc and pass it at the end if it was set. + +Wed Oct 11 16:30:34 1995 Brendan Kehoe + + * parse.y (fn.def1): Call split_specs_attrs in + declmods notype_declarator case. + +Sun Nov 26 14:47:42 1995 Richard Kenner + + * Version 2.7.2 released. + +Mon Nov 20 14:05:00 1995 Mike Stump + + * g++.c (pfatal_with_name): Add missing third argument to concat. + +Thu Oct 26 13:59:54 1995 Mike Stump + + * init.c (expand_aggr_init): Handle cv qualifiers on the object's + type. + +Sat Nov 11 08:25:55 1995 Richard Kenner + + * Version 2.7.1 released. + +Thu Nov 2 17:02:47 1995 Jason Merrill + + * call.c (convert_harshness): Handle references to arrays. + +Fri Oct 27 14:20:21 1995 Jason Merrill + + * typeck.c (comp_target_types): Check multi-level pointer + conversions in both directions. + +Tue Oct 17 21:39:05 1995 Jason Merrill + + * parse.y (explicit_instantiation): Fix 'extern template' with no + return type. + +Mon Oct 16 14:35:20 1995 Jason Merrill + + * parse.y (explicit_instantiation): Support automatic instantiation + of constructors. + (named_class_head_*): Support out-of-class definition of nested + types. + +Wed Oct 11 12:20:56 1995 Mike Stump + + * search.c (envelope_add_decl): New routine. Fix so that + methods are hidden in the same way that other members are. + (dfs_pushdecls): Cleanup and move functionality out of line, + into envelope_add_decl. + +Tue Oct 10 15:46:01 1995 Mike Stump + + * typeck.c (mark_addressable): Only call assemble_external if we + have started the output file. + +Tue Oct 10 11:27:18 1995 Jason Merrill + + * decl.c (start_function): Fix earlier cv-quals change. + +Mon Oct 9 23:53:05 1995 Mike Stump + + * parse.y (complex_direct_notype_declarator): Only push the class if + we are not already in the class. + +Mon Oct 9 11:22:03 1995 Doug Evans + + * decl.c (duplicate_decls): Call merge_machine_decl_attributes. + Update olddecl's attributes too. + (grokdeclarator): #if 0 out call to build_decl_attribute_variant. + * typeck.c (common_type): Call merge_machine_type_attributes. + +Fri Oct 6 14:44:27 1995 Mike Stump + + * typeck.c (mark_addressable): Add missing call to + assemble_external. + +Wed Oct 4 15:06:39 1995 Mike Stump + + * decl.c (store_parm_decls): Make sure the unwinder start comes + before the exception specification start. + * except.c (expand_exception_blocks): Make sure the unwinder end + comes after the terminate protected catch clause region and after + the end of the exception specification region. + +Wed Oct 4 12:47:02 1995 Jason Merrill + + * lex.c (real_yylex): Fix identifier case for linemode. + (handle_sysv_pragma): Don't abort when we see a pragma we don't + recognize. + +Tue Oct 3 14:09:46 1995 Mike Stump + + * decl.c (store_parm_decls): Add a call to start_eh_unwinder. + * except.c (init_exception_processing): __throw doesn't take any + arguments. + (expand_builtin_throw): Likewise. Always use Pmode, instead of SImode + for all pointers. Use expand_builtin_return_addr to unwind the + first level off the stack. + (do_unwind): Always use Pmode, instead of SImode for all pointers. + (expand_exception_blocks): Add a call to end_eh_unwinder. + (start_eh_unwinder, end_eh_unwinder): New routines to build machine + independent stack unwinders for function/method calls. + +Mon Oct 2 17:20:42 1995 Mike Stump + + * tree.c (unsave_expr_now): Make sure we process the argument list + of any called functions. Fixes incorrect code generation for + cleanups. + +Mon Oct 2 13:04:16 1995 Mike Stump + + * typeck.c (get_member_function_from_ptrfunc): Save function if it + needs it. Cures core dump on things like (this->*(f()))(). + +Sat Sep 23 22:51:25 1995 Jason Merrill + + * decl.c (start_function): Conform to gcc cv-quals convention (no + expression has a cv-qualified type) in RESULT_DECLs. + * method.c (make_thunk): Likewise. + +Fri Sep 22 10:21:13 1995 Mike Stump + + * decl.c (pushtag): Add in the namespace name for the tag. + +Thu Sep 21 13:11:13 1995 Mike Stump + + * parse.y (maybe_base_class_list, base_class_list, base_class, + base_class_access_list): Make sure we see the typenames for base + classes. + * lex.c (see_typename): Instead of failing to see a typename when + there is no next token, perfer a typename, and get the next token. + +Wed Sep 20 12:35:27 1995 Michael Meissner + + * decl.c (init_decl_processing): Add __builtin_expect. + +Tue Sep 19 16:48:11 1995 Mike Stump + + * cvt.c (cp_convert_to_pointer): Don't allow leftover conversions to + or from pointer to member functions, they must all be handled before + this point. + +Fri Sep 15 17:14:47 1995 Brendan Kehoe + + * init.c (resolve_offset_ref): Fix wording of non-static member + being referenced as a static. + +Fri Sep 15 12:39:11 1995 Jason Merrill + + * typeck.c (build_indirect_ref): Only bash pointer if we actually + call build_expr_type_conversion. + +Thu Sep 14 18:24:56 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Handle conversion from + reference. + * typeck.c (build_indirect_ref): Avoid infinite recursion. + +Thu Sep 14 17:23:28 1995 Mike Stump + + * decl.c (expand_start_early_try_stmts): New routine to start a try + block at the start of the function, for function-try-blocks. + * cp-tree.h (expand_start_early_try_stmts): Declare it. + * parse.y (function_try_block): Use it, instead of doing it here, as + we don't want to include rtl.h here, as that conflicts with RETURN + in the parser. + +Wed Sep 13 18:32:24 1995 Mike Stump + + * lex.c (reinit_parse_for_block): Support saving inline + function-try-blocks, uses peekyylex. + * parse.y (eat_saved_input): New rule, permit the parser to see that + END_OF_SAVED_INPUT is ok, as it can see this when parsing the + handlers of a function-try-block. + (fndef): Use it. + (component_decl): Make sure TRY and RETURN can come after fn.def2. + * spew.c (peekyylex): New routine to peek at what will come next. + +Wed Sep 13 16:52:06 1995 Jason Merrill + + * typeck.c (comptypes): Tighten up comparisons of template type + parms. + + * decl.c (duplicate_decls): Turn off whining about virtual functions + redeclared inline for now. + +Wed Sep 13 11:13:40 1995 Mike Stump + + * decl.c (store_in_parms): New routine to put things before we + put base inits. + * cp-tree.h (store_in_parms): Declare it. + * decl.c (store_parm_decls): Use it to makr sure the starting of the + eh spec comes before base inits. + (finish_function): Use sequences instead of the obsolete + reorder_insns. + * parse.y (fndef): Enhance readability and maintainability. Update + to include function_try_block syntax. + (function_try_block): Add. + +Tue Sep 12 17:43:07 1995 Brendan Kehoe + + * call.c (convert_harshness): Use comptypes, not ==, to check if + TYPE and PARMTYPE are equivalent on a function type. + +Tue Sep 12 17:31:33 1995 Douglas Rupp + + * Make-lang.in (cc1plus): Removed unnecessary $(exeext). + +Mon Sep 11 23:24:07 1995 Mike Stump + + * except.c (expand_throw): Never allocate storage for thrown pointer + to objects. + +Mon Sep 11 19:36:45 1995 Mike Stump + + * except.c (expand_start_catch_block): Pointers to objects come + back from catch matching already dereferenced, don't dereference + again. + +Mon Sep 11 15:46:28 1995 Mike Stump + + * except.c (expand_throw): Only decay the throw expression, don't do + any default conversions. This is so that one can throw and catch + characters, and not have them match integers. + +Mon Sep 11 13:46:45 1995 Mike Stump + + * error.c (dump_aggr_type): Deal with anonymous unions that don't + have a TYPE_NAME. + +Fri Sep 8 20:40:27 1995 Brendan Kehoe + + * lex.c (handle_sysv_pragma): Deal with getting a comma from yylex. + +Fri Sep 8 15:51:41 1995 Mike Stump + + * except.c (expand_end_eh_spec): Handle empty EH specifications. + +Fri Sep 8 15:27:22 1995 Mike Stump + + * cp-tree.h (expand_start_eh_spec): Declare new routine. + (expand_end_eh_spec): Likewise. + * decl.c (store_parm_decls): Call expand_start_eh_spec to process + exception specifications. + * except.c (expand_leftover_cleanups): Remove unused parameter. + (expand_end_catch_block): Likewise. + (expand_exception_blocks): Likewise. + (expand_start_eh_spec): New routine to mark the start of an + exception specification region. + (expand_end_eh_spec): New routine to mark the end of an exception + specification region. + (expand_exception_blocks): Call expand_end_eh_spec to process + exception specifications. + +Fri Sep 8 14:40:48 1995 Per Bothner + + * lex.c (do_identifier): Use global binding in preference of + dead for local variable. + +Wed Sep 6 19:32:59 1995 Mike Stump + + * cp-tree.h (build_exception_variant): Remove used first argument. + * decl.c (duplicate_decls): Likewise. + (grokfndecl): Likewise. + (revert_static_member_fn): Likewise. + * decl2.c (grok_method_quals): Likewise. + * tree.c (build_exception_variant): Likewise. + * typeck.c (common_type): Likewise. + * decl2.c (grokclassfn): After changing the type, call + build_exception_variant, if necessary. + +Tue Sep 5 15:56:27 1995 Mike Stump + + * except.c (expand_throw): Run cleanups for the throw expression. + +Wed Aug 30 15:24:38 1995 Stephen L. Favor + + * except.c (expand_builtin_throw): Moved gen_label_rtx calls beyond + the store_parm_decls call which does initialization in the emit_* + code concerning label numbering. + +Thu Aug 31 09:01:07 1995 Mike Stump + + * except.c (expand_internal_throw): Let the frontend be responsible + for managing all frontend EH parameters, the backend routine only + needs to deal with backend values. type and value are no longer + passed to __throw. + (init_exception_processing): Likewise. + (expand_start_all_catch): Likewise. + (expand_end_all_catch): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + (expand_builtin_throw): Likewise. + (expand_throw): Likewise. + +Tue Aug 29 15:04:36 1995 Jason Merrill + + * cp-tree.h (DECL_REAL_CONTEXT): Give the real declaration context + for a decl. + * decl.c (cp_finish_decl): Use it. + +Tue Aug 29 10:30:27 1995 Mike Stump + + * except.c (expand_internal_throw): Oops, almost forgot type and + value are now trees. + +Mon Aug 28 17:57:45 1995 Brendan Kehoe + + Fix the attribute handling to make sure they get noted before we + create the function's RTL, in case they can affect that. + * decl.c (grokfndecl): New arg ATTRLIST. Run + cplus_decl_attributes before creating the decl's rtl. + (grokdeclarator): New arg ATTRLIST, passed down into grokfndecl. + (shadow_tag, groktypename, start_decl, start_method): Pass a + NULL_TREE to grokdeclarator's new last arg. + * decl2.c (grokfield): New arg ATTRLIST, passed into grokdeclarator. + (grokbitfield, grokoptypename): Pass a NULL_TREE to + grokdeclarator's new last arg. + * except.c (expand_start_catch_block): Likewise. + * pt.c (process_template_parm, end_template_decl, + do_function_instantiation): Likewise. + * cp-tree.h (grokfield): Add arg. + (grokdeclarator): Move the prototype from here... + * decl.h: ...to here. + * lex.c (cons_up_default_function): Pass NULL_TREE to grokfield + ATTRLIST argument. + * parse.y: Create a list for the grokfield arg where appropriate, + and pass it down instead of calling cplus_decl_attributes. + +Mon Aug 28 15:07:24 1995 Mike Stump + + * except.c: Always allow turning on exception handling. Allow cross + compilations to use EH. + +Thu Aug 24 17:39:24 1995 Mike Stump + + * except.c (saved_pc, saved_throw_type, saved_throw_value): Use + trees, instead of rtxs, and don't depend on using special machine + dependent registers. + (expand_internal_throw): Likewise. + (init_exception_processing): Likewise. + (expand_start_all_catch): Likewise. + (expand_end_all_catch): Likewise. + (expand_start_catch_block): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + (expand_builtin_throw): Likewise. + (expand_throw): Likewise. + +Wed Aug 23 17:25:51 1995 Jason Merrill + + * cvt.c (build_expr_type_conversion): Handle conversions to + reference types. + +Wed Aug 23 15:33:59 1995 Mike Stump + + * except.c (do_unwind): Work around backend bug with -fpic. + +Tue Aug 22 17:20:07 1995 Per Bothner + + * decl2.c (flag_new_for_scope): Add a new mode that follows ANSI + for-scoping, but supports (and warns about) old programs. + Make the new mode (with value 1) the default. + (lang_f_options): The on-value for flag_new_for_scope is now 2. + * cp-tree.h (DECL_DEAD_FOR_LOCAL, DECL_ERROR_REPORTED): New macros + (DECL_SHADOWED_FOR_VAR): Likewise. + * decl.c (struct binding_level): New fields dead_vars_from_for + and is_for_scope. + (note_level_for_for): New function. + (poplevel): Special processing if is_for_scope. + (pushdecl): Warn if for-scope variable shadows local. + * lex.c (do_identifier): Handle old (non-ANSI) for scoping, + and warn if conflicts. + * parse.y (FOR): Call note_level_for_for. + +Mon Aug 21 10:28:31 1995 Jason Merrill + + * decl2.c (import_export_inline): Class interface hackery does not + apply to synthesized methods. + +Sun Aug 20 16:29:00 1995 Mike Stump + + * search.c (virtual_context): Find the right context more often. + Solves a `recoverable compiler error, fixups for virtual function' + problem. + +Sun Aug 20 13:53:24 1995 Mike Stump + + * except.c (expand_start_all_catch): Ensure that we always transfer + control to the right EH handler, by rethrowing the end label on the + region, instead of hoping we are nested and falling through. + (expand_leftover_cleanups): Likewise. + (end_protect): Since we now rethrow the end label, put a + nop after it, so that outer regions are recognized. + * init.c (build_vec_delete_1): New routine to handle most of vector + deleting, all code moved here from build_vec_delete. + (build_array_eh_cleanup): Use build_vec_delete_1 to do all the real + work. + (expand_vec_init): If the array needs partial destructing, setup an + EH region to handle it. + (build_vec_delete): Move lots of code to build_vec_delete_1, use + build_vec_delete_1 to do the grunt work. + +Sat Aug 19 14:25:33 1995 Brendan Kehoe + + Handle decl attributes properly for function definitions without + previous attribute-loaded declarations. + * decl.c (start_function): New arg ATTRS. Add a call to + cplus_decl_attributes with it before we create the RTL. + * cp-tree.h (start_function): Update prototype. + * parse.y (fn.def1): Pass ATTRS into start_function instead of + trying to call cplus_decl_attributes too late. Pass a NULL_TREE + for other use. + * decl2.c (finish_file): Pass NULL_TREE as fourth arg to + start_function. + * method.c (synthesize_method): Likewise. + * except.c (expand_builtin_throw): Likewise for start on __throw. + +Sat Aug 19 13:36:08 1995 Mike Stump + + * class.c (set_rtti_entry): Turn on -fvtable-thunk -frtti support. + This changes -fvtable-thunks vtable layout, so a recompile will be + necessary, if you use -fvtable-thunks. + (get_vtable_entry): Use n, instead of i to be consistent with the + rest of the compiler. + (get_vtable_entry_n): Likewise. + (add_virtual_function): Add a slot for the tdesc, if -fvtable-thunks + are being used. + (finish_struct_1): Likewise. + (skip_rtti_stuff): New routine to collapse similar code from many + different parts of the compiler. I think I got them all. + (modify_one_vtable): Use it. + (fixup_vtable_deltas1): Likewise. + (override_one_vtable): Likewise. + * decl2.c (mark_vtable_entries): Likewise. + * tree.c (debug_binfo): Likewise. + * search.c (expand_upcast_fixups): Likewise. + (get_abstract_virtuals_1): Likewise. Use virtuals, instead of tmp to + consistent with the rest of the compiler. + (get_abstract_virtuals): Likewise. + * cp-tree.h (skip_rtti_stuff): New routine, declare it. + * gc.c (build_headof): Support -fvtable-thunk and -frtti together. + (build_typeid): Likewise. + (build_classof): Remove old style way of doing rtti. Remove support + for `classof' and `headof'. + * gxx.gperf: Likewise. + * hash.h: Likewise. + * parse.y: Likewise. + +Fri Aug 18 17:31:58 1995 Jason Merrill + + * decl.c (start_function): Clear ctor_label and dtor_label. + + * class.c (finish_struct_1): Fix handling of access decls. + +Tue Aug 15 19:21:54 1995 Jason Merrill + + * class.c (finish_struct): Only do minimal processing here, so it + can be used for class template definitions, as well. + (finish_struct_1): New function with the rest of the code. + +Tue Aug 15 09:46:16 1995 Mike Stump + + * class.c (prepare_fresh_vtable): On second though, always build the + offset (see Aug 10 change), unless -fvtable-thunks is given. It + does this by calling the new routine set_rtti_entry. + (finish_struct): Likewise. + (set_rtti_entry): New routine to update the rtti information at the + start of the vtable. + +Mon Aug 14 12:21:22 1995 Brendan Kehoe + + * error.c (dump_decl, case IDENTIFIER_NODE): Only work on a dtor + if it's declared in the C++ language spec. + (dump_function_decl): Likewise. + (dump_function_name): Likewise. + (ident_fndecl): Make sure we got something back from lookup_name. + * decl.c (start_function): Likewise. + +Fri Aug 11 16:52:15 1995 Jason Merrill + + * call.c (build_method_call): Don't call build_new when calling a + constructor without an instance. + +Thu Aug 10 20:00:17 1995 Mike Stump + + * class.c (prepare_fresh_vtable): Always build the offset to the + complete object, as it doesn't cost much. This allows dynamic_cast + to void * to work when -frtti isn't given. + (finish_struct): Likewise. + +Thu Aug 10 16:31:28 1995 Mike Stump + + * except.c (build_eh_type): Split out some functionality to new + routine named build_eh_type_type. + (build_eh_type_type): New routine. + (expand_start_catch_block): Use build_eh_type_type, as we never want + the dynamic type of the catch parameter, just the static type. + Fixes core dumps when -frtti is used and one catchs pointers to + classes. + +Thu Aug 10 14:55:29 1995 Mike Stump + + * except.c (expand_builtin_throw): Since we now use normal calling + conventions for __throw, we have to remove the first layer off the + stack, so that the next context we search for handlers is the outer + context instead of the context that had the call to __throw, if we + don't immediately find the desired context. + +Tue Aug 8 17:44:23 1995 Jason Merrill + + * tree.c (cp_expand_decl_cleanup): Returns int, not tree. + * cp-tree.h: Update. + + * parse.y (template_type_parm): Add support for `typename'. + +Tue Aug 8 12:06:31 1995 Mike Stump + + * except.c (expand_internal_throw): New internal routine to throw a + value. + (expand_end_all_catch, expand_leftover_cleanups): All throwers + changed to use `expand_internal_throw' instead of jumping to throw + label. + (expand_end_catch_block, expand_throw): Likewise. + (throw_label): Removed. + (expand_builtin_throw): Changed so that EH parameters are passed by + normal function call conventions. Completes Aug 4th work. + +Fri Aug 4 17:17:08 1995 Mike Stump + + * cp-tree.h (expand_builtin_throw): Declare it. + * decl2.c (finish_file): Call expand_builtin_throw. + * except.c (make_first_label): Remove. + (init_exception_processing): Don't use a LABEL_REF for throw_label, + instead use a SYMBOL_REF, this is so that we don't use LABEL_REFs in + other functions that don't really appear in those functions. This + solves a problem where cc1plus consumed exponential amounts of + memory when -Wall was used. + (expand_end_all_catch, expand_leftover_cleanups, + expand_end_catch_block, expand_throw): Change all uses of + throw_label to match new style. + (do_unwind): Rename parameter to inner_throw_label, as it is now + different from throw_label. Also, assume that our caller will wrap + the passed label with a LABEL_REF, if needed. + (expand_builtin_throw): Make external, change so that the generated + throw is now a real function. + (expand_exception_blocks): Never generate throw code inside another + function. + +Fri Aug 4 12:20:02 1995 Mike Stump + + * decl.c (grokdeclarator): Move checking of mutable const objects + and mutable static objects down, as we might decide during parsing + to unset staticp or constp (for example, when const is part of the + object being pointed to). + +Thu Aug 3 17:13:43 1995 Mike Stump + + * except.c (output_exception_table_entry): Enhance portability to + weird machines. + (emit_exception_table): Likewise. + +Thu Aug 3 16:41:38 1995 Mike Stump + + * typeck.c (build_ptrmemfunc): Handle casting of pointer to + non-virtual member functions. + +Wed Aug 2 11:58:25 1995 Mike Stump + + * gc.c (build_typeid): Strip cv qualifiers so that const T&, T&, T + and const T all match. + +Wed Aug 2 11:25:33 1995 Mike Stump + + * except.c (build_eh_type): Strip cv qualifiers so that const T&, + T&, T and const T all match. + +Tue Aug 1 14:20:16 1995 Mike Stump + + * except.c: Fix up comments, cleanup code and eliminate exceptNode, + exceptStack, exceptstack, push_except_stmts, pop_except_stmts, + new_except_stack, push_last_insn, pop_last_insn, insn_save_node and + InsnSave. Also, numerous speed improvements, and correctness + improvements. Double faulting in all situations should now be + handled correctly. + (expand_start_all_catch): Instead of having many terminate protected + regions, just have one. + (expand_start_catch_block): No longer have to protect + false_label_rtx, as it isn't used for EH region marking. + (expand_end_catch_block): Expand out EH cleanups here by using + expand_leftover_cleanups. + (expand_end_all_catch): Use sequences instead of playing with insn + links directly. + (expand_exception_blocks): Likewise. Also protect all catch clauses + with one terminate region. + +Mon Jul 31 13:24:30 1995 Jason Merrill + + * method.c (report_type_mismatch): Don't talk about an object + parameter for non-methods. + +Sun Jul 30 13:13:02 1995 Jason Merrill + + * class.c (finish_struct): Catch private and protected members of + anonymous unions here. + * decl2.c (finish_anon_union): And here. + * parse.y: Instead of here. + + * errfn.c (ARGSLIST): Support passing four args. + * error.c (cv_as_string): New function. + (cp_printers): Add it. + * call.c (build_method_call): Report 'const' at end of pseudo-decl. + + * method.c (report_type_mismatch): Deal with a bad_arg of 0. + + * init.c (expand_aggr_init): Handle volatile objects, too. + +Sat Jul 29 13:42:03 1995 Jason Merrill + + * decl.c (struct binding_level): Keep list of incomplete decls. + (print_binding_level): Use list_length to count them. + (pushdecl): Build up the list. + (hack_incomplete_structures): Walk it and prune completed decls. + +Fri Jul 28 15:26:44 1995 Jason Merrill + + * typeck.c (comp_target_types): Don't check const and volatile for + function types. + (comp_ptr_ttypes_real): Likewise. + +Thu Jul 27 15:40:48 1995 Jason Merrill + + * typeck.c (comp_target_types): Fix. + +Thu Jul 27 15:10:48 1995 Mike Stump + + * cp-tree.h (unsave_expr_now, build_unsave_expr, + cp_expand_decl_cleanup): Declare new routines. + * decl.c (cp_finish_decl, store_parm_decls, + hack_incomplete_structures): Change all cals from + expand_decl_cleanup to cp_expand_decl_cleanup. + * gc.c (protect_value_from_gc): Likewise. + * expr.c (cplus_expand_expr): Handle UNSAVE_EXPRs. + * tree.c (unsave_expr): New routine to build an UNSAVE_EXPR. + (unsave_expr_now): Backend routine used by tree expander. + (cp_expand_decl_cleanup): Wrap second argument in an UNSAVE_EXPR to + work around a limitation in the backend. The backend uses the + cleanups multiple times, on disjoint control flows, so we cannot + pass unsaved SAVE_EXPRs to the backend. + * tree.def (UNSAVE_EXPR): New tree code. + * typeck.c (c_expand_return): Move goto/return code up inside + conditional, as we don't always want to do this, we only want to do + this when we don't otherwise finish with this control flow. + +Thu Jul 27 10:38:43 1995 Brendan Kehoe + + * parse.y (typespec): Only complain about typeof if we're not + getting it from a system header. + +Thu Jul 27 10:26:23 1995 Doug Evans + + Clean up prefix attribute handling. + * parse.y (reserved_declspecs): Link prefix attributes with declspecs. + (declmods): Likewise. + (all rules that reference typed_declspecs and declmods): Call + split_specs_attrs or strip_attrs to separate declspecs and attrs. + (lang_extdef): Delete resetting of prefix_attributes. + (template_def, notype_declarator rule): Use NULL_TREE for + prefix_attributes. + (condition): Use NULL_TREE for prefix_attributes. + (setattrs): Deleted. + (nomods_initdcl0): Set prefix_attributes to NULL_TREE. + (component_decl): Delete resetting of prefix_attributes. + (component_decl_1, notype_components rule): Use NULL_TREE for + prefix_attributes. + (simple_stmt): Delete resetting of prefix_attributes. + +Mon Jul 24 13:37:53 1995 Jason Merrill + + * call.c (convert_harshness): Deal with reference conversions before + others. Actually do array->pointer decay. Call comp_target_types + with pointer types rather than their targets. + + * typeck.c (comp_target_types): Avoid assigning D const * to B *. + +Mon Jul 24 08:54:46 1995 Brendan Kehoe + + * pt.c (to_be_restored): Move decl to global scope. + +Sat Jul 22 12:22:11 1995 Jason Merrill + + * decl.c (start_decl): Put back clearing of DECL_IN_AGGR_P. + +Fri Jul 21 17:09:02 1995 Jason Merrill + + * decl.c (grokdeclarator): Downgrade error about 'extern int A::i' + to pedwarn. + + * pt.c (instantiate_template): Also avoid instantiation if the + function has already been declared to be a specialization. + + * decl2.c (check_classfn): Ignore cname argument, and return the + matching function. + + * decl.c (start_decl): Handle declarations of member functions + outside of the class (i.e. specialization declarations). + +Thu Jul 20 10:34:48 1995 Jason Merrill + + * class.c (finish_struct): Don't mess with the type of bitfields. + + * various.c: s/TYPE_POINTER_TO/build_pointer_type/. + +Thu Jul 20 01:43:10 1995 Mike Stump + + * init.c (expand_aggr_init): Assume LOOKUP_ONLYCONVERTING if init + is not a parameter list (TREE_LIST). + (expand_default_init): If LOOKUP_ONLYCONVERTING is set, then set + LOOKUP_NO_CONVERSION so that we don't allow two-level conversions, + but don't set it otherwise. + +Wed Jul 19 20:32:01 1995 Mike Stump + + * init.c (expand_default_init): Don't allow two-level conversions + during construction. + +Wed Jul 19 18:06:37 1995 Mike Stump + + * gc.c (build_headof): The type of dyncasting to a pointer to cv + void, should be pointer to cv void. + +Wed Jul 19 17:25:43 1995 Mike Stump + + * gc.c (build_dynamic_cast): Allow casting in const. + +Wed Jul 19 16:34:27 1995 Mike Stump + + * typeck.c (build_const_cast): If we are passed error_mark_node, + return it. + +Wed Jul 19 15:24:48 1995 Brendan Kehoe + + * class.c (push_nested_class): Make sure TYPE is non-nil. + + * cvt.c (type_promotes_to): Watch for error_mark_node on the + incoming TYPE. + +Wed Jul 19 13:23:12 1995 Gerald Baumgartner + + * cp-tree.h (SIGTABLE_VT_OFF_NAME): Renamed from SIGTABLE_OFFSET_NAME. + (SIGTABLE_VB_OFF_NAME): New macro. + (vt_off_identifier): Renamed from offset_identifier. + (vb_off_identifier): Added extern declaration. + + * decl.c (vt_off_identifier): Renamed from offset identifier. + (vb_off_identifier): New variable to hold the identifier for the + sigtable field vb_off. + (init_decl_processing): Initialize vb_off_identifier. + Renamed vt_off_identifier from offset_identifier. + * sig.c (build_signature_method_call): Renamed offset_identifier and + local variable offset to vt_off_identifier and vt_off, respectively. + * sig.c (build_signature_table_constructor): Renamed offset to vt_off. + + * decl.c (init_decl_processing): Add vb_off field to + sigtable_entry_type. Reorder fields so that pfn gets properly + aligned at a 64 bit boundary on the Alpha. + * sig.c (build_signature_table_constructor): Build the constructor + according to the new layout. Set the vb_off field to -1 for now. + + * decl.c (init_decl_processing): Align sigtable_entry_type on word + boundaries instead of double word boundaries to save space. + +Tue Jul 18 16:58:37 1995 Mike Stump + + * cvt.c (cp_convert): Always call build_cplus_new for a ctor. + +Tue Jul 18 14:24:53 1995 Brendan Kehoe + + * parse.y (opt.component_decl_list): Only forbid private/protected + in anonymous unions. We need to make this know when the type is + defined for an object, to not give the error. + +Mon Jul 17 14:22:44 1995 Brendan Kehoe + + * parse.y (opt.component_decl_list): Don't allow access control + as private or protected for union members. + +Sun Jul 16 14:01:00 1995 Jim Wilson + + * lex.c (check_newline): For 'p' case, move goto skipline line to + before end brace for 'pragma'. + +Fri Jul 7 13:55:58 1995 Mike Stump + + * g++.1: Tiny updates. + +Fri Jul 7 13:05:20 1995 Mike Stump + + * decl.c (cp_finish_decl): Only destruct local static variables if + they are constructed, and only construct the first time control + passes completely through its declaration (if not initialized with a + constant-expression). + (expand_static_init): Likewise. + +Wed Jul 5 14:05:04 1995 Brendan Kehoe + + * typeck.c (comptypes, case OFFSET_REF): If either offset basetype + is a TEMPLATE_TYPE_PARM, give a match. + +Fri Jun 30 15:42:57 1995 Mike Stump + + * method.c (build_overload_value): Handle encoding of null pointer + constants (or any pointer with a constant numeric value) for + templates. + +Fri Jun 30 13:45:51 1995 Brendan Kehoe + + * call.c (convert_harshness): Add QUAL_CODE when we're faced with + const vs non-const for void conversions. + +Fri Jun 30 10:19:52 1995 Mike Stump + + * except.c (expand_start_all_catch): Fix problem with finding an + outer nested try block when there is no code to separate it from an + inner try block. + +Fri Jun 30 02:22:26 1995 Mike Stump + + * search.c (dfs_pushdecls): Consume 2 or 3 orders of magnitude less + memory please when virtual bases are used. + +Thu Jun 29 19:03:47 1995 Mike Stump + + * class.c (build_vbase_path): Avoid testing things that cannot be + null to see if they are null. + * cvt.c (convert_pointer_to_vbase): Remove code that doesn't work. + * decl.c (finish_function): Pass a type into the new + convert_pointer_to_vbase instead of a binfo. + * search.c (convert_pointer_to_vbase): Rewritten to use get_vbase + and convert_pointer_to_real. + (expand_indirect_vtbls_init): Use convert_pointer_to_vbase instead + of the more cryptic call to get_vbase. + +Thu Jun 29 09:35:05 1995 Mike Stump + + * decl.c (BOOL_TYPE_SIZE): Fix broken SLOW_BYTE_ACCESS check. + +Thu Jun 29 03:43:55 1995 Jason Merrill + + * pt.c (instantiate_template): Don't strip 'this' twice. + + * pt.c (coerce_template_parms): Allow null pointer constants. + + * decl.c (revert_static_member_fn): But only if DECL_ARGUMENTS is + set. + +Wed Jun 28 18:39:03 1995 Jason Merrill + + * decl.c (revert_static_member_fn): Also remove 'this' from + DECL_ARGUMENTS. + * decl2.c (check_classfn): Don't revert this function until we get a + match. + +Wed Jun 28 14:07:27 1995 Brendan Kehoe + + * parse.y (component_decl): Clear PREFIX_ATTRIBUTES here. + +Wed Jun 28 11:05:13 1995 Mike Stump + + * decl2.c (finish_file): Handle global vector news. + * init.c (build_new): Encode vector news so that later we will know + how many elements there are. + +Mon Jun 26 13:38:06 1995 Jason Merrill + + * expr.c (cplus_expand_expr): Don't mess with temp slots. + + * decl2.c (warn_if_unknown_interface): Don't crash if tinst_for_decl + returns null. + + * decl2.c (check_classfn): Use revert_static_member_fn. + * decl.c (revert_static_member_fn): Diagnose static member functions + declared const or volatile. + + * decl2.c (grokfield): Check for missing default args here, too. + (check_default_args): Function to do the checking. + * decl.c (pushdecl): Use it. + + * decl.c (pushdecl): Don't warn about shadowing a member of `this' + if there is no `this'. + +Sun Jun 25 11:34:25 1995 Jason Merrill + + * call.c (build_method_call): Downgrade 'called before definition' + to a warning, as it ought to go away after Monterey. + +Sat Jun 24 14:18:42 1995 Jason Merrill + + * pt.c (coerce_template_parms): Don't do extra checking on pointer + to member arguments. + + * class.c (finish_struct): const and reference members don't prevent + a class from being an aggregate. + + * class.c (finish_struct): Signatures are always aggregates. + +Fri Jun 23 17:20:29 1995 Jason Merrill + + * decl2.c (check_classfn): Improve error message. + + * pt.c (tsubst): Handle PROMOTE_PROTOTYPES. + +Thu Jun 22 01:50:42 1995 Jason Merrill + + * typeck.c (comptypes): Don't ignore method quals. + + * class.c (finish_struct): Non-abstract virtuals are always USED. + + * decl.c (build_ptrmemfunc_type): The underlying union type isn't + IS_AGGR_TYPE, either. + * class.c (finish_struct): Use CLASSTYPE_NON_AGGREGATE instead. + * cp-tree.h: Likewise. + + * cp-tree.h (lang_type): Add aggregate. + (CLASSTYPE_AGGREGATE): New macro. + (TYPE_NON_AGGREGATE_CLASS): Likewise. + * class.c (finish_struct): Determine whether a class is an + aggregate. + * decl.c (cp_finish_decl): Check TYPE_NON_AGGREGATE_CLASS instead of + TYPE_NEEDS_CONSTRUCTING. + * typeck2.c (digest_init): Check TYPE_NON_AGGREGATE_CLASS for + subobjects, too. + + * pt.c (tsubst, PARM_TYPE): Propagate DECL_ARTIFICIAL. + + * decl.c (start_function): For pre-parsed functions, layout all of + the parm decls again. + (grokvardecl): TREE_PUBLIC depends on DECL_THIS_EXTERN, not + DECL_EXTERNAL. + + * pt.c (coerce_template_parms): Improve checking for invalid + template parms. + +Wed Jun 21 12:01:16 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Forbid declaration of a static member + with the same name as its enclosing class. + +Mon Jun 19 10:28:14 1995 Jason Merrill + + * decl.c (finish_function): Clear current_class_decl. + + * typeck.c (build_conditional_expr): Use convert (boolean_type_node + instead of truthvalue_conversion. + + * class.c (finish_struct): A data member with the same name as the + class doesn't suppress constructors. + +Fri Jun 16 18:11:39 1995 Gerald Baumgartner + + * decl.c (start_function): If current_class_decl is a signature + pointer, don't dereference it but set C_C_D to current_class_decl. + +Fri Jun 16 17:06:28 1995 Jason Merrill + + * decl.c (duplicate_decls): Complain about virtual functions + redeclared to be inline. + +Fri Jun 16 13:20:38 1995 Mike Stump + + * decl.c (get_unique_name): New routine to name unnamed namespaces. + (push_namespace): Use get_unique_name for naming unnamed namespaces. + +Thu Jun 15 15:00:41 1995 Jason Merrill + + * parse.y: Call cplus_decl_attributes with prefix_attributes where + appropriate. + +Wed Jun 14 19:24:49 1995 Mike Stump + + * search.c (get_vbase): New routine to switch hierarchies from the + CLASSTYPE_VBASECLASSES to the normal one. + (expand_indirect_vtbls_init): Use get_vbase to figure out how we + want to convert to a vbase pointer. + +Mon Jun 12 17:50:30 1995 Jason Merrill + + * pt.c (instantiate_class_template): Add the new instantiation to + template_classes. + (do_pending_expansions): Call instantiate_member_templates on all of + the classes in template_classes. + +Mon Jun 12 12:36:59 1995 Mike Stump + + * decl.c (complete_array_type): Fill in the TYPE_DOMAIN of our + TYPE_MAIN_VARIANT if it is not filled in. + * init.c (build_delete): If the TYPE_DOMAIN is not set, give an + error instead of core dumping. + +Mon Jun 12 10:41:40 1995 Jason Merrill + + * call.c (can_convert): Also check for distance > 0. + (can_convert_arg): Likewise. + (user_harshness): Likewise. + +Fri Jun 9 19:17:21 1995 Jason Merrill + + * g++.c (MATH_LIBRARY): Provide default. + (main): Always link with the math library if we link with libstdc++. + + * decl.c (start_function): Complain about redefinition of a function + even when the pending_inline version is compiled after the other + version. + +Thu Jun 8 15:44:38 1995 Jason Merrill + + * gc.c (build_dynamic_cast): Build up a reference to a parameter of + aggregate type. + +Wed Jun 7 15:31:57 1995 Brendan Kehoe + + * init.c (build_vec_delete): Resolve an offset ref before we try to + use it. + +Wed Jun 7 14:19:32 1995 Jason Merrill + + * typeck.c (build_modify_expr): If the class lacks a constructor or + assignment operator, return error_mark_node. + (common_type): Use build_cplus_array_type. + +Tue Jun 6 09:41:27 1995 Mike Stump + + * class.c (dont_allow_type_definitions): New variable set when types + cannot be defined. + (finish_struct): Use it. + * cp-tree.h (dont_allow_type_definitions): Define it. + * parse.y (primary, handler_seq): Set it. + +Mon Jun 5 18:49:38 1995 Mike Stump + + * method.c (build_opfncall): Use DECL_CHAIN, not TREE_CHAIN for + results from lookup_fnfields. Always give warning/error on bad + code. + +Mon Jun 5 11:39:37 1995 Brendan Kehoe + + * init.c (member_init_ok_or_else): Don't allow initialization of + an ancestor's member from within a constructor. + +Mon Jun 5 11:20:34 1995 Gerald Baumgartner + + * sig.c (build_signature_table_constructor): Use DECL_CONTEXT + instead of DECL_CLASS_CONTEXT for calculating the vfield offset so + abstract virtual functions are handled correctly. + + * sig.c (build_signature_table_constructor): Store the correct + delta in signature table entries. It does not yet work for + classes with virtual base classes as implementations of signatures. + (build_signature_method_call): Add the delta to the object_ptr + before generating the function call. + + * call.c (build_method_call): Make instance_ptr the signature + pointer itself instead of dereferencing the optr. + * sig.c (build_signature_method_call): Dereference the optr for the + direct and virtual calls. + + * sig.c (build_signature_table_constructor): Make the tag for + default implementations -1 instead of 2. + (build_signature_method_call): Change the generated conditional + expression correspondingly. + + * sig.c (build_signature_pointer_constructor): Deleted the sorry + message that said we can't handle multiple inheritance for + implementations of signatures + (build_signature_method_call): Use the offset from the sigtable + entry instead of the vptr field from the signature pointer for + building a virtual function call. + + * class.c (build_vfn_ref): Deleted signature specific code, we don't + call this function anymore from build_signature_method_call. + + * cp-tree.h (SIGNATURE_VPTR_NAME): Deleted. We use the right vptr + field in the object now instead of in the signature pointer/ref. + (build_vptr_ref): Deleted extern declaration. + * sig.c (build_vptr_ref): Deleted. + (build_signature_pointer_or_reference_type): Deleted construction of + the vptr field. + (build_signature_pointer_constructor): Deleted initialization of/ + assignment to the vptr field. + + * sig.c (build_signature_table_constructor): Convert the signature + table entry fields to their correct types. + + * sig.c (build_signature_table_constructor): Don't call digest_init + for the fields of a sigtable entry, it's wasted time. + + * sig.c (build_signature_table_constructor): Correctly set the + offset and index fields of a sigtable entry. Build the constructor + the way digest_init does, digest_init can't handle initializing an + anonymous union inside a struct. + (build_signature_method_call): Use the index field instead of the + delta field to get the vtable index. + + * decl.c (init_decl_processing): Fix number of fields for building + sigtable_entry_type. + + * cp-tree.h (tag_identifier, offset_identifier): Added extern decls. + (SIGTABLE_CODE_NAME): Renamed to SIGTABLE_TAG_NAME. + (SIGTABLE_PFN_NAME): Deleted, we'll use VTABLE_PFN_NAME instead. + * decl.c (tag_identifier, offset_identifier): New variables to + hold the identifiers for the sigtable fields tag and offset. + (init_decl_processing): Initialize these variables. + (init_decl_processing): Use these variables to build the + sigtable_entry_type structure. Rename the code and offset fields + to tag and delta, respectively; add offset and index fields. Changed + types of fields from short_integer_type_node to delta_type_node. + * sig.c (build_signature_table_constructor): Rename code and offset + to tag and delta, respectively. + (build_signature_method_call): Likewise. Use above variables. + +Thu Jun 1 17:03:51 1995 Jason Merrill + + * decl.c (lookup_name_real): Don't try to look anything up in an + erroneous object. + +Fri Jun 2 10:30:14 1995 Mike Stump + + * method.c (build_overload_int): New routine. Break out + functionality from build_overload_value so we can reuse it. + (build_overload_value): Handle pointer to member functions as value + parameters for templates. + (build_overload_identifier): Since template parameters are shared + among all instantiations, we have to substitute in the real types + in TREE_TYPE (parm). + pt.c (coerce_template_parms): Likewise. + (push_template_decls): Likewise. + (grok_template_type): Deleted as template parameters are shared + among all instantiations. + +Wed May 31 19:10:32 1995 Mike Stump + + * decl.c (grokdeclarator): Always give errors on constant overflow + for array indices. + +Wed May 31 11:39:43 1995 Jason Merrill + + * typeck.c (commonparms): Don't abort if simple_cst_equal returns < 0. + (build_c_cast): Don't tack on a NON_LVALUE_EXPR when casting to + reference type. + (build_indirect_ref): Fix check for *&. + +Fri Jun 16 06:54:03 1995 Mike Stump + + * Version 2.7.0 released. + +Fri Jun 16 15:07:29 1995 Richard Kenner + + * Make-lang.in (DEMANGLER_PROG): Add LIBS. + +Thu Jun 15 15:00:41 1995 Jason Merrill + + * decl.c (define_function): Don't set DECL_INTERFACE_KNOWN. + +Wed Jun 7 20:00:31 1995 Mike Stump + + * *.[chy]: Change all callers of finish_decl to cp_finish_decl. + * decl.c (finish_decl): New routine to handle call backs from the + mid end (declare_hidden_char_array). + +Wed Jun 7 19:02:50 1995 Jason Merrill + + * decl.c (start_function): Handle setting C_C_D here. + (set_C_C_D): Removed. + (struct saved_scope): Remove class_decl. + (push_to_top_level): Don't save current_class_decl. + (pop_from_top_level): Don't restore current_class_decl or C_C_D. + (struct cp_function): Add C_C_D. + (push_cp_function_context): Save C_C_D. + (pop_cp_function_context): Restore C_C_D. + +Fri Jun 2 11:05:58 1995 Jason Merrill + + * decl.c (set_C_C_D): New function. suspend_momentary before + building C_C_D. + (pop_from_top_level): Call it. + (start_function): Likewise. + (pop_cp_function_context): Likewise. + + * class.c, cp-tree.h, decl.c, decl2.c, parse.y: Lose all references + to current_vtable_decl, CLASSTYPE_INST_VAR and CLASSTYPE_VTBL_PTR. + + * decl.c (push_cp_function_context): Save current_class_decl. + (pop_cp_function_context): Restore current_class_decl and set C_C_D. + (pop_from_top_level): Don't use CLASSTYPE_INST_VAR to set C_C_D. + (start_function): Likewise. + + * class.c (popclass): Don't mess with current_class_decl, + current_vtable_decl, or C_C_D. + +Mon May 29 12:45:10 1995 Paul Eggert + + * Make-lang.in (c++.mostlyclean): Remove $(DEMANGLER_PROG). + +Wed May 24 15:55:18 1995 Richard Kenner + + * decl.c (duplicate_decls): Check simple_cst_equal result against 0. + * decl2.c (finish_anon_union): Likewise. + * method.c (largest_union_member): Likewise. + +Wed May 24 14:41:11 1995 H.J. Lu + + * Make-lang.in (cxxmain.o): Replace single quotes with backslashes. + +Mon May 22 17:38:48 1995 Richard Kenner + + * Make-lang.in (g++, g++-cross, cc1plus, DEMANGLER_PROG): + Use $@ instead of output name so works even if have .exe. + (cxxmain.o): Use cp if ln -s fails. + (c++.install-man): Use $(exeext) in executable names. + (c++.mostlyclean, stage[1-4]): Use $(objext) in object file names. + * Makefile.in (../cc1plus): Use $(exeext) in name of executable. + +Wed May 24 01:39:03 1995 Jason Merrill + + * call.c (build_method_call): Parms can be null, duh. + +Tue May 23 01:32:09 1995 Jason Merrill + + * call.c (build_method_call): If convert_arguments failed, just bail. + +Fri May 19 10:31:11 1995 Jason Merrill + + * cvt.c (convert_force): Pass LOOKUP_NORMAL to cp_convert. + + * tree.c (copy_to_permanent): Oops. + +Fri May 19 10:01:07 1995 Brendan Kehoe + + * cp-tree.h (break_out_target_exprs): Add decl. + +Thu May 18 13:02:30 1995 Jason Merrill + + * decl.c (start_function): Move *all* interface handling stuff after + the pushdecl. + + * tree.c (mapcar): Renamed from make_deep_copy and generalized. + (perm_manip): Return t if permanent, otherwise 0. + (copy_to_permanent): Use them. + (bot_manip): Helper for break_out_target_exprs. + (break_out_target_exprs): New function. Uses mapcar. + + * typeck.c (convert_arguments): Use it. + + * method.c (hack_identifier): Use convert_from_reference to + dereference a reference. + +Wed May 17 17:54:54 1995 Mike Stump + + * call.c (convert_harshness): Move reference bashing before pointer + to member bashing. + +Wed May 17 16:57:53 1995 Mike Stump + + * cvt.c (convert_to_reference): Only complain, if complaints are + wanted. + * typeck.c (build_function_call_real): Likewise. If + LOOKUP_SPECULATIVELY is set and something won't work, return + NULL_TREE. + * cvt.c (cp_convert): Likewise. Pass flags down to build_method_call. + (convert): Pass LOOKUP_NORMAL to cp_convert. + * typeck.c (convert_for_assignment): Likewise. + (convert_force): Pass LOOKUP_COMPLAIN to cp_convert. + (convert_arguments): Get out early if we get an error_mark_node. + (convert_for_initialization): Use cp_convert instead of convert so + that we can pass flags down. + * cp-tree.h (LOOKUP_SPECULATIVELY): Added documentation. + +Wed May 17 01:43:58 1995 Jason Merrill + + * typeck2.c (store_init_value): Don't take the MAIN_VARIANT of the + decl type. + + * class.c (finish_struct): Don't complain about a class with no + user-defined constructors but with a member that has no default + constructor, as this is OK for aggregates. + + * expr.c (cplus_expand_expr, NEW_EXPR): If this is an explicit + constructor call, mark slot addressable. + +Tue May 16 18:37:51 1995 Douglas Rupp + + * g++.c: Changed WINNT to _WIN32. + +Tue May 16 12:40:16 1995 Jason Merrill + + * lex.c (handle_sysv_pragma): Don't use token_buffer. + +Tue May 16 12:05:26 1995 Mike Stump + + * call.c (resolve_scope_to_name): Add initial semantic support for + namespaces. + * class.c (finish_struct): Likewise. + * cp-tree.h (NAMESPACE_LEVEL): Likewise. + * cvt.c (build_up_reference, convert_to_reference): Likewise. + * decl.c (binding_level::namespace_p, suspend_binding_level): Likewise. + (resume_binding_level, toplevel_bindings_p): Likewise + (namespace_bindings_p, declare_namespace_level): Likewise. + (resume_level, push_namespace, pop_namespace): Likewise. + (pop_everything, pushtag, duplicate_decls, pushdecl): Likewise. + (implicitly_declare, lookup_namespace_name): Likewise. + (lookup_name_real, start_decl, make_temporary_for_reference): Likewise. + (obscure_complex_init, finish_decl, expand_static_init): Likewise. + (grokvardecl, grokdeclarator, parmlist_is_exprlist): Likewise. + (store_parm_decls, hack_incomplete_structures): Likewise. + * decl2.c (get_temp_name, finish_anon_union): Likewise. + (current_namespace, push_namespace, pop_namespace): Likewise. + (do_namespace_alias, do_toplevel_using_decl): Likewise. + (do_class_using_decl): Likewise. + * error.c (dump_decl): Likewise. + * init.c (build_member_call, build_offset_ref): Likewise. + * lex.c (identifier_type): Likewise. + * parse.y (lang_extdef, using_decl, extdef): Likewise. + (component_decl_1, nested_name_specifier_1): Likewise. + * spew.c (yylex): Likewise. + * tree.def (NAMESPACE_DECL): Likewise. + +Tue May 16 11:55:35 1995 Jason Merrill + + * decl.c (push_overloaded_decl): Return the new decl even if it + can't be pushed. + +Tue May 16 11:00:37 1995 Jason Merrill + + * typeck.c (decay_conversion): Split out from default_conversion. + (default_conversion): Call it. + (build_binary_op): Likewise. + (build_binary_op_nodefault): Use decay_conversion for truth ops. + +Mon May 15 12:47:56 1995 Jason Merrill + + * decl.c (warn_extern_redeclared_static): This is a pedwarn. + (duplicate_decls): Always use the old decl's linkage info. Don't + play with linkage of consts. + (pushdecl): Don't play with linkage of consts. + (redeclaration_error_message): Don't complain about an old public + decl and a new non-public decl here. + (grokvardecl): Handle linkage of consts here. + (grokdeclarator): An 'extern inline' is public. Pass constp to + grokvardecl. + (start_function): Wait until after the pushdecl to do some linkage + stuff. + + * decl2.c (import_export_vtable): Make duplicates weak rather than + static if supported. + (import_export_inline): Likewise. + * pt.c (do_pending_expansions): Likewise. + + * class.c (build_vbase_path): flag_assume_nonnull_objects only + affects reference conversion. + + * init.c (emit_base_init): Build up an RTL_EXPR and add it to + rtl_expr_chain. + * decl.c, decl2.c: s/base_init_insns/base_init_expr/. + +Tue May 16 07:06:28 1995 Paul Eggert + + * method.c (numeric_output_need_bar): Renamed from misspelling. + + * typeck.c (build_ptrmemfunc): Fix misspellings in messages. + +Sun May 14 10:26:22 1995 Richard Kenner + + * lang-options.h, lang-specs.h: New files. + +Thu May 11 00:31:48 1995 Jason Merrill + + * typeck.c (default_conversion): Don't check for BLKmode before + pulling out the decl_constant_value. + + * decl.c (start_function): Clear named_labels and shadowed_labels. + + * typeck.c (build_function_call_real): Also synthesize methods here. + +Wed May 10 00:55:59 1995 Jason Merrill + + * decl2.c (finish_file): Synthesize exported methods before the + reconsider loop. + + * parse.y: Move declaration of flag_new_for_scope to file scope. + +Tue May 9 19:10:33 1995 Mike Stump + + * decl2.c: Add flag_new_for_scope for new -ffor-scope flag. + * parse.y (FOR): Conditionalize the pushing and popping of scope for + the for-init-statement upon the new flag_new_for_scope. + * parse.y (try_block): Simplify and use compstmt. + +Mon May 8 12:41:52 1995 Jason Merrill + + * decl.c (define_function): Mark function decl artificial. + +Sun May 7 00:51:28 1995 Jason Merrill + + * parse.y (simple_stmt, FOR): Put back push/pop for condition scope. + + * decl2.c (grokclassfn): DECLs don't have cv-qualified types. + * tree.c (build_cplus_method_type): Likewise. + + * cp-tree.h (SET_DECL_ARTIFICIAL): Just set DECL_ARTIFICIAL to 1. + + * typeck.c (build_function_call_real): If convert_arguments failed, + just bail. + (convert_arguments): If one of the arguments is error_mark_node, + just bail. + +Sat May 6 02:39:41 1995 Jason Merrill + + * decl.c (duplicate_decls): Don't check DECL_NOT_REALLY_EXTERN for + decls that don't include it. + +Fri May 5 14:23:30 1995 Jason Merrill + + * decl.c (duplicate_decls): Decls that have DECL_INTERFACE_KNOWN or + DECL_NOT_REALLY_EXTERN set aren't extern decls. + + * typeck.c (build_indirect_ref): Don't call default_conversion for a + parameter of reference_type. + * cvt.c (convert_from_reference): Just use build_indirect_ref. + + * pt.c (do_type_instantiation): Only instantiate member functions + that actually come from templates. + +Fri May 5 09:46:05 1995 Mike Stump + + * parse.y: Generalized cleanup of poplevels, and compound statements + and compound statements in try blocks. Rewritten `for' rule so that + the scope of variables declared in the for clause is shortened to + span just to the end of the statement, instead of the whole + containing block. + +Fri May 5 00:37:14 1995 Jason Merrill + + * call.c (convert_harshness): Handle pointers to members better. + +Thu May 4 16:00:26 1995 Jason Merrill + + * decl2.c (delete_sanity): Do access control here. + * init.c (build_delete): Instead of here. + + * Make-lang.in: Build c++filt. + +Wed May 3 02:59:53 1995 Jason Merrill + + * decl2.c (cplus_decl_attributes): If we just modified a TYPE_DECL, + update our IDENTIFIER_TYPE_VALUE. + +Fri Apr 28 07:58:41 1995 Jason Merrill + + * lex.c (cons_up_default_function): Fix linkage of #pragma + implemented functions. + +Thu Apr 27 16:56:24 1995 Jason Merrill + + * method.c (build_overload_name): Simplify and fix repeated type + folding. + + * decl.c (grokdeclarator): Prohibit pointers to void or reference + members. + +Thu Apr 27 09:49:07 1995 Mike Stump + + * typeck2.c (process_init_constructor): Make sure initializers are + fully digested. + +Thu Apr 27 01:11:55 1995 Jason Merrill + + * lex.c (cons_up_default_function): Always defer synthesis. + +Thu Apr 27 00:20:37 1995 Jason Merrill + + * decl2.c (mark_inline_for_output): Don't play with pending_inline + stuff. + +Wed Apr 26 17:48:24 1995 Jason Merrill + + * call.c (user_harshness): New function; like build_type_conversion, + but doesn't actually build anything. + (compute_conversion_costs): Use it instead of build_type_conversion. + +Wed Apr 26 17:11:25 1995 Jason Merrill + + * typeck.c (build_function_call_real): Improve error message for + calling a non-function. + + * method.c (hack_identifier): Lose check for calling a data member. + +Wed Apr 26 16:59:13 1995 Mike Stump + + * typeck2.c (build_functional_cast): Remove very old cruft. + Seems like good code is generated without it. + +Wed Apr 26 00:47:16 1995 Jason Merrill + + * method.c (do_build_assign_ref): Fix handling of anonymous unions. + (do_build_copy_constructor): Likewise. + + * parse.y (simple_stmt, SWITCH): Call {push,pop}_switch. + + * decl.c (push_switch): New function. + (pop_switch): Likewise. + (define_case_label): Check for jumping over initialization. + + * call.c (build_method_call): Check for an inline function being + called before its definition has been seen. + * typeck.c (build_function_call_real): Likewise. + + * decl.c (duplicate_decls): Check for a function being redeclared + inline after its address has been taken. + + * typeck.c (build_conditional_expr): Handle related class lvalues. + +Tue Apr 25 13:20:45 1995 Jason Merrill + + * pt.c (do_pending_expansions): Don't expand unused templates. + + * parse.y (component_decl): Accept a lone semicolon. + +Tue Apr 25 00:25:56 1995 Jason Merrill + + * call.c (build_method_call): Don't allow an RTL_EXPR to serve as the + object parameter anymore. + + * expr.c (cplus_expand_expr): Don't create RTL_EXPRs with no insns. + +Mon Apr 24 12:35:48 1995 Jason Merrill + + * parse.y (simple_stmt, decl case): Clear prefix_attributes. + (lang_extdef): Likewise. + + * parse.y (maybe_parmlist): New rule for use in declarators where + this could either be a list of expressions or parameters. Calls + suspend_momentary before deciding which. + (direct_after_type_declarator): Use it. + (complex_direct_notype_declarator): Use it. + + * pt.c (tsubst): Propagate attributes const and noreturn. + + * typeck.c (build_modify_expr): If warn_synth, call build_opfncall + before doing the default thing. + +Thu Apr 27 21:49:36 1995 Doug Evans + + * typeck.c (common_type): Call lookup_attribute instead of + value_member. + +Tue Apr 25 18:07:43 1995 Richard Kenner + + * Make-lang.in: Change "realclean" to "maintainer-clean". + +Sun Apr 23 12:32:38 1995 Mike Stump + + * decl2.c (finish_file): Fix broken linked list handling. + +Fri Apr 21 18:08:43 1995 Jason Merrill + + * class.c (finish_base_struct): Don't set TYPE_HAS_COMPLEX_*_REF + as often. + (finish_struct): Likewise. + + * various: Use TYPE_HAS_TRIVIAL_* instead of TYPE_HAS_COMPLEX_*. + + * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): New macro. + (TYPE_HAS_TRIVIAL_ASSIGN_REF): New macro. + +Fri Apr 21 15:52:22 1995 Jason Merrill + + * typeck.c (c_expand_return): Only expand a returned TARGET_EXPR if + it is of the same type as the return value. + +Fri Apr 21 03:01:46 1995 Jason Merrill + + * decl2.c (finish_file): Reconsider if synthesizing a method wrote + out its assembly. + + * typeck.c (convert_for_initialization): Don't call a trivial copy + constructor. + + * typeck2.c (store_init_value): Only abort if the type has a + non-trivial copy constructor. + + * typeck.c (c_expand_return): If we're returning in a register and + the return value is a TARGET_EXPR, expand it. Only do + expand_aggr_init if we're returning in memory. + (expand_target_expr): Function to expand a TARGET_EXPR. + (build_modify_expr): Use it. + + * tree.c (build_cplus_new): Layout the slot. + + * expr.c (cplus_expand_expr): Use expand_call to expand the call + under a NEW_EXPR, so the target is not discarded. + +Thu Apr 20 14:59:31 1995 Mike Stump + + * gc.c (build_dynamic_cast): Tighten error checking. + +Thu Apr 20 11:23:54 1995 Jason Merrill + + * expr.c (cplus_expand_expr): Only abort if the returned target is + different from what we expected if the type has a non-trivial copy + constructor. + + * decl2.c (cplus_decl_attributes): Attributes applied to a template + really apply to the template's result. + + * tree.c (lvalue_p): Check IS_AGGR_TYPE instead of TREE_ADDRESSABLE + to decide whether to consider a CALL_EXPR an lvalue. + + * class.c (finish_struct_bits): Only set TREE_ADDRESSABLE if the + type has a non-trivial copy constructor. + + * decl.c (start_function): If interface_known, unset + DECL_NOT_REALLY_EXTERN on the function. + +Wed Apr 19 16:53:13 1995 Jason Merrill + + * pt.c (do_function_instantiation): Handle explicit instantiation of + member functions. + (do_type_instantiation): Handle 'inline template class foo', + meaning just spit out the vtable. + + * lex.c (cons_up_default_function): Set DECL_NOT_REALLY_EXTERN on + the consed functions. + + * decl2.c (import_export_inline): Set DECL_INTERFACE_KNOWN. + +Wed Apr 19 16:28:17 1995 Brendan Kehoe + + * call.c, class.c, decl2.c, gc.c, init.c, parse.y, pt.c, search.c, + typeck.c: Include output.h. + +Wed Apr 19 14:57:21 1995 Gerald Baumgartner + + * call.c (build_method_call): Allow a signature member functions to + be called from a default implementation. + +Wed Apr 19 10:21:17 1995 Jason Merrill + + * repo.c (finish_repo): Remember what directory we are in. + + * search.c (expand_upcast_fixups): Don't mess with abort_fndecl. + + * repo.c: Use obstacks instead of fixed-size buffers. Don't spit + out the second copy of the symbol name. Don't remember COLLECT_GCC. + +Wed Apr 19 02:32:40 1995 Mike Stump + + * search.c (virtual_context): New function to get the virtual + context of a function. + (expand_upcast_fixups): New function to generate runtime vtables. + (fixup_virtual_upcast_offsets): Likewise. + (expand_indirect_vtbls_init): Use fixup_virtual_upcast_offsets to + ensure that the this offsets for upcasts from virtual bases into + other virtual bases or non-virtual bases are correct at construction + time and destruction time. + * class.c (fixup_vtable_deltas): Modify to fixup all offsets in all + vtables in all virtual bases, instead of just one vtable in each + virtual base. + (fixup_vtable_deltas1): Likewise. + +Tue Apr 18 03:57:35 1995 Michael Meissner + + * Makefile.in (lex.o): Add dependency on c-pragma.h. + + * lex.c (handle_sysv_pragma): Use NULL_PTR and NULL_TREE as + appropriate, instead of 0. + +Mon Apr 17 12:28:42 1995 Jason Merrill + + * decl.c (pushdecl): Use decls_match, not duplicate_decls, for + comparing local and global decls. + +Fri Apr 14 01:46:52 1995 Jason Merrill + + * typeck.c (convert_arguments): Only prohibit passing to ... of + types with non-trivial copy constructors. + + * repo.c (repo_template_used): Don't try to mess with no id. + +Fri Apr 14 23:32:50 1995 Per Bothner + + * decl.c (duplicate_decls): Use cp_warning_at for redundant-decls. + +Thu Apr 13 15:37:42 1995 Brendan Kehoe + + * cp-tree.h (current_tinst_level): Delete declaration, since it's + static inside pt.c. + + * typeck.c (build_modify_expr): Catch incompatible array assignment. + + * parse.y (attribute_list, attrib): Rewrite actions to feed the + right stuff to decl_attributes. + +Thu Apr 13 11:24:10 1995 Jason Merrill + + * search.c (dfs_debug_mark): Check for magic virtual like + import_export_vtable. + + * typeck.c (build_binary_op_nodefault): Don't call cp_pedwarn with + four args. + +Wed Apr 12 12:02:57 1995 Jason Merrill + + * decl2.c (finish_file): Move prevtable pass before needs_messing_up + decision. + +Tue Apr 11 11:20:27 1995 Jason Merrill + + * decl.c (finish_decl): If we're writing out a static data member of + a class, we want the debug info for that class. + + * gc.c (build_t_desc): Check linkage of a class properly. + + * class.c (finish_struct): Set the 'headof' offset for the main + vtable properly. + (prepare_fresh_vtable): Fix typeinfo pointer here. + (modify_one_vtable): Instead of here. + +Mon Apr 10 12:15:59 1995 Jason Merrill + + * repo.c (repo_get_id): New function to return the interesting + identifier for a repo entity. + (repo_template_used): Use it. + (repo_template_instantiated): Mark the id as chosen. + (init_repo): Record whether or not the id was chosen. + (finish_repo): Note if an id was newly chosen. + + * pt.c (do_function_instantiation): Call repo_template_instantiated. + (do_type_instantiation): Likewise. Don't diagnose multiple + instantiation. + + * decl2.c (finish_file): Use DECL_NOT_REALLY_EXTERN when deciding + whether or not to synthesize a method. + + Undo these changes: + * class.c (finish_vtbls): Build more vtables if flag_rtti is on. + * class.c (modify_all_direct_vtables): Likewise. + * init.c (expand_direct_vtbls_init): Expand more vtables if + flag_rtti is on. + +Sat Apr 8 17:45:41 1995 Mike Stump + + * gc.c (build_headof): Use ptrdiff_type_node instead of + integer_type_node on pointer arithmetic. + +Sat Apr 8 11:57:04 1995 Jason Merrill + + * typeck.c (build_modify_expr): Undo previous change. + +Thu Apr 6 01:23:50 1995 Jason Merrill + + * Makefile.in (compiler): Remove ../cc1plus before rebuilding it. + + * repo.c (get_base_filename): Put the .rpo file in the directory + with the object file, not the source. + + * typeck.c (build_conditional_expr): Handle pmf's better. + + * repo.c (finish_repo): Also use ASM_OUTPUT_LABELREF to print out + the name of the symbol. + +Wed Apr 5 15:24:12 1995 Jason Merrill + + * repo.c (open_repo_file): Make repo filename DOS-compliant. + (*): Also write a new repo file if some previously-used + templates are no longer used. Only remember the identifier. + + * lex.c (cons_up_default_function): If this function belongs to a + template class, call repo_template_used for it. + + * repo.c (repo_template_used): Using a class means using its vtable, + if any. + (finish_repo): Likewise. + + * typeck.c (build_modify_expr): Only wrap TARGET_EXPRs in RTL_EXPRs + if the type has a complex copy constructor. + + * decl2.c (lang_decode_option): -frepo implies + -fno-implicit-templates. + + * decl.c (start_function): Clear current_{base,member}_init_list. + + * lex.c (init_lex): Also unset *_eq if ! flag_operator_names. + +Tue Apr 4 16:11:08 1995 Jason Merrill + + * decl.c (struct cp_function): Add {base,member}_init_list. + (push_cp_function_context): Save current_{base,member}_init_list. + (pop_cp_function_context): Restore them. + +Mon Apr 3 16:55:08 1995 Jason Merrill + + * repo.c (get_base_filename): Take filename parm, fix logic bug. + + * typeck.c (build_compound_expr): Do not warn about a compound expr + in which the first expression has no side effects. + (build_x_compound_expr): Warn here instead. + (build_conditional_expr): Don't warn about a conditional expression + between an enum and the type it promotes to. + + * init.c (build_new): Handle initialization of arrays of builtins + properly. + +Mon Apr 3 15:08:04 1995 Brendan Kehoe + + * repo.c: Include config.h to get definitions of bcopy and rindex + on systems that don't have them (e.g., SVR4). + +Mon Apr 3 14:41:55 1995 Mike Stump + + * decl2.c (finish_table): Pass NULL_TREE instead of init to + finish_decl so that it won't try and do error checking on the + initializer. + +Mon Apr 3 10:45:50 1995 Jason Merrill + + * repo.c (get_base_filename): Analyze COLLECT_GCC_OPTIONS to + determine whether this compile used -c -o. + (open_repo_file): Use get_base_filename. Remove the extension. + (finish_repo): Spit out the values of main_input_filename, + COLLECT_GCC and COLLECT_GCC_OPTIONS. + + * parse.y (structsp): Add TYPENAME_KEYWORD complex_type_name. + +Sun Apr 2 23:43:51 1995 Jason Merrill + + * search.c (compute_access): Don't try to do access control on + nested types. + +Fri Mar 31 10:14:23 1995 Jason Merrill + + * repo.c: New file to handle things repo. + + * pt.c (instantiate_template): Call repo_template_used if the + definition is accessible. + (mark_function_instantiated): Split out from + do_function_instantiation. + (mark_class_instantiated): Split out from do_type_instantiation. + + * parse.y (template_instantiate_once): Call repo_template_used. + + * lex.c (lang_init): Call init_repo. + + * decl2.c: Handle flag_use_repository. + (finish_file): Call finish_repo. + + * decl.c (start_method): Call repo_template_used if this is a + template method. + + * Makefile.in (CXX_OBJS): Add repo.o. + (repo.o): Add dependencies. + + * Make-lang.in (CXX_SRCS): Add repo.c. + + * decl.c (start_function): If DECL_INTERFACE_KNOWN and + DECL_NOT_REALLY_EXTERN are both set, unset DECL_EXTERNAL. + + * typeck.c (build_binary_op_nodefault): Identify the invalid operand + types used. + + * decl.c (duplicate_decls): Propagate DECL_NOT_REALLY_EXTERN. + +Thu Mar 30 17:54:42 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Tidy up use of build_type + and result_type. When checking for comparison between signed + and unsigned, use result_type rather than the (possibly shortened) + type of op0. Also, don't warn about equality comparison of a + signed operand to an unsigned constant that fits in the signed + type. + + * method.c (do_build_copy_constructor): Reverse + current_base_init_list after we've built it up. + +Thu Mar 30 14:35:18 1995 Mike Stump + + * except.c (build_throw): Never warn about the value of throw not + being used. + +Thu Mar 30 13:16:54 1995 Mike Stump + + * except.c (expand_start_catch_block): Check for bad catch parameter + declarations. + +Thu Mar 30 13:06:11 1995 Jason Merrill + + * decl.c (finish_function): Only set DECL_NOT_REALLY_EXTERN if + DECL_EXTERNAL is not already set. + +Thu Mar 30 11:26:24 1995 Mike Stump + + * method.c (emit_thunk): Let poplevel know that the last level is + for a function so it can create a BLOCK_NODE and set DECL_INITIAL. + +Thu Mar 30 11:15:06 1995 Jason Merrill + + * decl2.c (import_export_inline): Don't set DECL_NOT_REALLY_EXTERN + here. + + * decl.c (grokdeclarator): OK, don't abort if we see a decl with + METHOD_TYPE. + (finish_function): Set DECL_EXTERNAL and DECL_NOT_REALLY_EXTERN on + all deferred inlines. + +Wed Mar 29 19:35:02 1995 Jason Merrill + + * cp-tree.h (DECL_THIS_INLINE): New macro. + (DECL_NOT_REALLY_EXTERN): New macro. + (DECL_THIS_STATIC): New macro. + + * decl.c: Lose all references to current_extern_inline. Break + inline semantics into DECL_INLINE for actual inlining and + DECL_THIS_INLINE for the linkage wierdness. Use DECL_THIS_STATIC. + * decl2.c: Use DECL_NOT_REALLY_EXTERN to indicate that we want to + emit an inline here. Associated changes. + * lex.c: Likewise. + * pt.c: Likewise. + * typeck.c: Likewise. + + * call.c (build_method_call): Don't bother trying to handle inlines + specially. + * cvt.c (convert_to_aggr): Likewise. + + * pt.c (do_function_instantiation): Handle instantiation of + public inlines, too. + +Wed Mar 29 16:04:25 1995 Mike Stump + + * except.c (init_exception_processing): Change the interface for + __throw_type_match and add decl for new rtti matching routine + __throw_type_match_rtti. + (build_eh_type): New routine to build a run time descriptor for the + expression given. + (expand_start_catch_block): Update to use new calling convention for + the matcher. + (expand_throw): Update to use build_eh_type. + +Mon Mar 27 07:14:33 1995 Warner Losh + + * g++.c: Removed __NetBSD__ from conditional. + Declare strerror if HAVE_STRERROR is defined; otherwise + declare sys_errlist and sys_nerr. + (my_strerror): New function. + +Tue Mar 28 14:16:35 1995 Jason Merrill + + * search.c (get_binfo): Don't try to be so clever. + + * tree.c (copy_to_permanent): Also suspend_momentary(). + + * cvt.c (cp_convert_to_pointer): Hand off to convert_fn_pointer even + if the types are the same. + + * decl.c (start_function): Handle extern inlines more like C++ says + we should. + + * init.c (build_member_call): Hand constructor calls off to + build_functional_cast. + + * typeck2.c (build_functional_cast): Use DECL_NESTED_TYPENAME to get + the name of the type. + +Tue Mar 28 13:13:56 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Check for the decl returned by + grokfndecl to be null before using build_decl_attribute_variant. + +Mon Mar 27 18:04:41 1995 Brendan Kehoe + + * init.c (build_new): Use build_pointer_type instead of + TYPE_POINTER_TO. + +Fri Mar 24 12:11:24 1995 Jason Merrill + + * typeck.c (build_conditional_expr): Handle pmfs. + (convert_for_assignment): Fix pmf support. + + * cvt.c (convert_fn_ptr): Support !flag_vtable_thunks. + (cp_convert_to_pointer): Handle pmfs. + (cp_convert): Pass pmfs to cp_convert_to_pointer. + + * typeck.c (common_type): Handle inheritance for pmfs. + + * typeck2.c (build_m_component_ref): Do access control. + + * typeck.c (comp_target_types): Check for conversion to void * + before checking trickier conversions. + + * decl.c (duplicate_decls): Propagate DECL_ABSTRACT_VIRTUAL_P. + + * pt.c (push_tinst_level): Complain if template instantiation depth + is greater than max_tinst_depth. + + * typeck.c (common_type): Assume that we can call common_type to + unify the target type of a pointer. + +Thu Mar 23 00:48:44 1995 Jason Merrill + + * decl2.c (finish_file): Don't synthesize methods at + finish_vtable_prevardecl time. Do synthesize methods that are not + used, but are public and not external. + + * cvt.c (build_type_conversion): Only give an error if for_sure. + + * typeck.c (comp_target_types): Only support pointer conversions if + nptrs > 0. + +Wed Mar 22 19:30:15 1995 Brendan Kehoe + + * init.c (build_new): Catch use of an initializer list where it + shouldn't be. + +Wed Mar 22 16:21:07 1995 Jason Merrill + + * init.c (build_new): Wrap alloc_expr in an RTL_EXPR if nelts is + non-constant. + + * decl2.c: temp_name_counter is now public. + + * decl.c (struct cp_function): Add temp_name_counter field. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + + * typeck.c (common_type): Handle unifying function types, and unify + unmatched things to void* with a compiler_error, rather than + silently like before. + +Wed Mar 22 15:10:34 1995 Mike Stump + + * decl2.c (finish_prevtable_vardecl, finish_vtable_vardecl): Revert + Brendan's last change and fix latent problem that causes TD entries + to not come out when the things that need them has yet to be + expanded. + +Wed Mar 22 15:12:00 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault, comparison ops): Update type0 + and type1, since we might have changed op0 or op1. + +Wed Mar 22 13:33:45 1995 Jason Merrill + + * typeck.c (common_type): Don't mess up templates. + +Wed Mar 22 04:56:00 1995 Jason Merrill + + * typeck.c (common_type): Handle ptms properly. Also handle + T* -> void*. + (build_binary_op_nodefault): New variable build_type controls what + type is given to the expression when it is created. Set this to + boolean_type_node for comparison ops instead of using result_type. + (comp_target_types): Allow T * -> void *. + + * cvt.c (cp_convert_to_pointer): Do access control when converting + ptms, too. + +Tue Mar 21 17:25:06 1995 Brendan Kehoe + + * parse.y (extern_lang_string): Catch use of linkage specs that + aren't all naming the same language. + + * class.c (finish_struct): Delete accidental duplicate code. + +Tue Mar 21 14:00:57 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Disable pedwarns about + comparing functions and incomplete types. + + * decl.c (finish_function): Only unset current_function_decl if + !nested. + (duplicate_decls): Last change went too far; we only want to stop + checking for value/reference ambiguity. + +Tue Mar 21 01:26:39 1995 Mike Stump + + * gc.c (build_generic_desc): Zap the DECL_SIZE so that we can lay it + out fresh, as the new type may be larger. + +Mon Mar 20 19:01:10 1995 Jason Merrill + + * expr.c (extract_init): Try to expand the RTL for the + initialization and figure out what it will look like so we can avoid + run-time initialization. Disabled for now. + (extract_scalar_init): Helper for scalar initialization. + (extract_aggr_init): Helper for aggregate initialization. + + * decl.c (duplicate_decls): Don't complain about ambiguous + declarations. + (obscure_complex_init): Now returns a tree. Call extract_init if + we're optimizing and this is a toplevel decl. + (finish_decl): Update accordingly. + + * lex.c (check_newline): If we're just changing files (not pushing + or popping), update input_file_stack->name. + +Mon Mar 20 17:55:04 1995 Mike Stump + + * pt.c (type_unification): Only TEMPLATE_DECLs are handled right now + in the transitive unification code. + +Mon Mar 20 16:07:50 1995 Brendan Kehoe + + * decl.c (shadow_tag): Don't allow inline, virtual, or explicit on + non-functions. + (grokdeclarator): Don't allow friends to be defined in local classes. + +Sat Mar 18 04:03:33 1995 Jason Merrill + + * decl2.c (finish_prevtable_vardecl): Use DECL_DECLARED_STATIC + rather than DECL_SAVED_INSNS to decide whether or not this method + was declared inline. + + * method.c (synthesize_method): Turn off DECL_INLINE if + function_cannot_inline_p thinks we're too large. + + * typeck.c (build_indirect_ref): Use build_expr_type_conversion. + +Fri Mar 17 17:47:36 1995 Jason Merrill + + * class.c (instantiate_type): Handle pmfs. + + * typeck.c (convert_for_assignment): Check types when assigning one + pmf to another. + + * decl.c (define_label): Fix logic for printing out the name of the + label in an error message. + + * error.c (dump_expr): Support ARRAY_REF. + +Fri Mar 17 17:43:02 1995 Brendan Kehoe + + * decl2.c (finish_vtable_vardecl): Call build_t_desc here. + (finish_prevtable_vardecl): Instead of here. + +Fri Mar 17 14:40:45 1995 Jason Merrill + + * decl.c (expand_static_init): Also use expand_aggr_init if the + initializer is a TREE_LIST. + (grokdeclarator): Only pedwarn about extra qualification if -pedantic. + + * pt.c (unify): Fix unification of return type. + + * expr.c (fixup_result_decl): Use store_expr, rather than + emit_move_insn, to move the return value into the place where + callers will expect it. + +Thu Mar 16 22:05:25 1995 Jason Merrill + + * init.c (build_offset_ref): Call assmble_external on functions. + * typeck.c (build_component_ref): Likewise. + +Thu Mar 16 20:28:16 1995 Brendan Kehoe + + * decl.c (struct saved_scope): Add members base_init_list and + member_init_list. + (push_to_top_level): Save current_base_init_list and + current_member_init_list to them. + (pop_from_top_level): Put it back. + +Thu Mar 16 19:21:14 1995 Jason Merrill + + * pt.c (instantiate_template): Call assemble_external. + +Thu Mar 16 18:07:54 1995 Brendan Kehoe + + * class.c: Include rtl.h, to get NULL_RTX. + (finish_struct): Also zero out DECL_SAVED_INSNS, to avoid problems + on hosts with different sizes for each part of the union. + * tree.c: Also include rtl.h. + (layout_basetypes): Same change for DECL_SAVED_INSNS. + +Thu Mar 16 13:57:36 1995 Jason Merrill + + * pt.c (unify): Fix array domain unification for 64-bit targets. + + * decl2.c (finish_file): Push bizarre type decl before walking the + vtables the first time. + (walk_vtables): OK, don't set prev to vars if the vardecl_fn messed + with TREE_CHAIN (prev). + + * init.c (emit_base_init): Use convert_pointer_to_real instead of + convert_pointer_to when converting to a direct base. + +Wed Mar 15 20:26:29 1995 Mike Stump + + * pt.c (type_unification): Handle transitive unification better. + +Wed Mar 15 13:56:16 1995 Jason Merrill + + * decl2.c (walk_vtables): Always set prev to vars. + (mark_vtable_entries): Call assemble_external on the vtable entries. + + * class.c (finish_struct): Set the vtable's size to NULL_TREE before + calling layout_decl, so that it gets updated properly. + + Finally re-enable dynamic synthesis. This time it works. + * method.c (synthesize_method): Pass decl_function_context (fndecl) + to {push,pop}_cp_function_context. + * decl.c (push_cp_function_context): Now takes a tree argument. + (pop_cp_function_context): Likewise. + * call.c (build_method_call): Enable synthesis. + * lex.c (cons_up_default_function): Likewise. + +Tue Mar 14 19:14:19 1995 Doug Evans + + * parse.y (setattrs): Chain onto prefix_attributes rather than + setting it. + +Wed Mar 15 13:00:00 1995 Brendan Kehoe + + * decl.c (pushdecl): Check if the type of the VAR_DECL is an + error_mark_node before trying to read TYPE_LANG_SPECIFIC. + +Mon Mar 13 21:00:28 1995 Brendan Kehoe + + * decl.c (grokdeclarator, case ARRAY_REF): Wrap the exp with fold, + and convert the size and integer_one_node to the index type. + +Mon Mar 13 08:01:02 1995 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Save the instance + argument, and tack it onto the front of the COND_EXPR to make the + semantics come out right. Grab the instance argument from + '*instance_ptrptr', rather than having it passed in separately. + + * various: Change various consed-up comparison operations to have + boolean type. Remove the instance argument in calls to + get_member_function_from_ptrfunc. + + * error.c (dump_expr): Dump true and false as "true" and "false". + + * decl2.c (finish_file): Also set DECL_STATIC_FUNCTION_P on the + global init function. + + * decl.c (finish_function): Only set DECL_EXTERNAL here if the + inline function is public. + +Sat Mar 11 00:58:03 1995 Jason Merrill + + * init.c (is_friend): Be more careful about checking + DECL_CLASS_CONTEXT on non-member functions. + + * decl2.c (finish_vtable_vardecl): Don't bother calling + assemble_external here. + (prune_vtable_vardecl): New function that just splices out the + vtable decl from the top-level decls. + (import_export_inline): Unset DECL_EXTERNAL at first. + (finish_file): Don't bother calling assemble_external here. Do + splice out all of the vtables. + +Fri Mar 10 14:42:29 1995 Jason Merrill + + * decl.c (finish_function): If we're not emitting the function yet, + call assemble_external for it. + + * decl2.c (finish_prevtable_vardecl): Don't call mark_vtable_entries + here. + (finish_vtable_vardecl): Don't do the linkage deduction thing here. + Also don't splice out the current vtable if it is unused. + (finish_file): Move the second walk_vtables and the synthesis check + inside the 'reconsider' loop. Move thunk emission after the + 'reconsider' loop. + +Thu Mar 9 16:28:16 1995 Brendan Kehoe + + * pt.c (tsubst): Don't bother calling cp_build_type_variant, since it + was passing bogus values for readonly and volatile from the original + template decl, not the resultant type of the tsubst call. + + * class.c (duplicate_tag_error): Use cp_error_at to point out the + previous definition of the tag. + +Thu Mar 9 10:46:17 1995 Jason Merrill + + * decl.c (start_function): Clear base_init_insns and protect_list. + (struct cp_function): Add base_init_insns field. + (push_cp_function_context): Also save base_init_insns. + (pop_cp_function_context): Also restore base_init_insns. + +Wed Mar 8 13:31:44 1995 Jason Merrill + + * init.c (member_init_ok_or_else): Check for initializing a static + member here. + (emit_base_init): Instead of here. + +Tue Mar 7 16:03:26 1995 Jason Merrill + + * call.c (build_method_call): Disable synthesis as needed. + * lex.c (cons_up_default_function): Likewise. + +Tue Mar 7 10:14:29 1995 Brendan Kehoe + + * parse.y: New rules to allow attributes in a prefix position. + (prefix_attributes): New variable. Pass it into cplus_decl_attributes. + (setattr): New rule. + (reserved_declspecs, declmods): Catch attributes here. + * decl2.c (cplus_decl_attributes): Add PREFIX_ATTRIBUTES argument. + * decl.c (duplicate_decls): Pass DECL_MACHINE_ATTRIBUTES to + descendent typedef. + (grokdeclarator): Added code to support machine attributes. + * Makefile.in (stamp-parse): Expect 5 shift/reduce failures. + +Mon Mar 6 15:07:02 1995 Jason Merrill + + * call.c (build_method_call): Don't synthesize methods outside of a + function. + + Make base initialization more re-entrant so that synthesis on the + fly will work (and, eventually, template instantiation on the fly). + * init.c (sort_member_init): Don't bother with members that can't be + initialized. Reorganize a bit. Don't initialize base members here. + (sort_base_init): New function, like sort_member_init, but for base + classes. Steals some code from emit_base_init. + (emit_base_init): Simplify. Call sort_{member,base}_init before + doing any initialization, so we don't have to save + current_{member,base}_init_list in push_cp_function_context. + (expand_aggr_vbase_init_1): Adjust for sort_base_init. + (expand_aggr_vbase_init): Simplify. + * decl.c (struct cp_function): Add protect_list field. + (push_cp_function_context): Also save protect_list. + (pop_cp_function_context): Also restore protect_list. + * call.c (build_method_call): Enable synthesis at point of call. + * lex.c (cons_up_default_function): Likewise. + + * parse.y: Turn -ansi checks back into -pedantic checks. + + * init.c (build_new): Fix -fcheck-new for array new. + +Sat Mar 4 15:55:42 1995 Fergus Henderson + + * typeck.c (build_compound_expr): warn if left-hand operand of + comma expression has no side-effects. + +Fri Mar 3 15:16:45 1995 Jason Merrill + + * parse.y (primary): Change 'object qualified_id *' rules to 'object + overqualified_id *'. + +Fri Mar 3 12:48:17 1995 Brendan Kehoe + + * parse.y (unary_expr): Catch doing sizeof an overloaded function. + Make the error look the same as the one we issue in c_sizeof. + + * typeck.c (build_binary_op_nodefault): Give an error for trying + to compare a pointer-to-member to `void *'. + +Fri Mar 3 11:28:50 1995 Jason Merrill + + * typeck.c (build_unary_op): Handle bool increment with smoke and + mirrors here, rather than in expand_increment where it belongs, + because Kenner doesn't agree with me. + +Fri Mar 3 00:08:10 1995 Brendan Kehoe + + * decl.c (grokparms): Catch a PARM_DECL being used for a default + argument as well. + +Thu Mar 2 20:05:54 1995 Brendan Kehoe + + * init.c (build_new): Don't allow new on a function type. + + * parse.y (primary): Avoid a crash when seeing if the arg is of + the same type as that given for the typespec in an explicit dtor call. + +Thu Mar 2 00:49:38 1995 Jason Merrill + + * decl.c (finish_function): Change test for calling + mark_inline_for_output. + +Wed Mar 1 11:23:46 1995 Jason Merrill + + * typeck.c (build_modify_expr): Complain if + build_default_binary_type_conversion fails. + + * init.c (expand_default_init): Handle arguments of unknown type + properly. + + * cvt.c (build_expr_type_conversion): Only complain about ambiguity + if 'complain'. + * various: Pass 'complain'. + + * typeck.c (comptypes): Be more picky about comparing UPTs. + +Wed Mar 1 11:03:41 1995 Brendan Kehoe + + * decl.c (grokdeclarator): If declarator is null, say that the + type used has an incomplete type. + +Wed Mar 1 10:06:20 1995 Jason Merrill + + * pt.c (instantiate_template): Copy the template arguments to the + permanent_obstack. Also use simple_cst_equal to compare them when + looking for a previous instantiation. + + * tree.c (make_deep_copy): Support copying INTEGER_TYPEs (assuming + they are array domain types). + +Tue Feb 28 23:24:55 1995 Jason Merrill + + * cp-tree.h: Define WANT_* constants for passing to + build_expr_type_conversion. + * cvt.c (build_expr_type_conversion): New function to build + conversion to one of a group of suitable types. + (build_default_binary_type_conversion): Use it. + * decl2.c (grok_array_decl): Likewise. + * typeck.c (build_unary_op): Likewise. + (build_array_ref): Tidy up a bit. + (build_binary_op): Likewise. + +Tue Feb 28 19:57:31 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow decl of an argument as `void'. + +Tue Feb 28 17:23:36 1995 Jason Merrill + + * parse.y (typed_declspecs1): Add 'typespec reserved_typespecquals + reserved_declspecs' rule. + + * parse.y (expr_or_declarator): Remove notype_qualified_id rule. + (direct_notype_declarator): Likewise. + (complex_direct_notype_declarator): Add notype_qualified_id rule. + + * lex.c (real_yylex): Handle :> digraph properly. + +Tue Feb 28 12:26:29 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Check if it's a friend, not if it's + non-virtual, that's being initialized. Move the check up to + before FRIENDP would get cleared. Catch an unnamed var/field + being declared void. Say just `field' instead of `structure field' + in the error message. Only go for the operator name if DECLARATOR + is non-null. + +Tue Feb 28 00:08:01 1995 Jason Merrill + + * decl.c (start_function): Complain about abstract return type. + (grokdeclarator): Complain about declaring constructors and + destructors to be const or volatile. Complain about declaring + destructors to be static. + + * pt.c (uses_template_parms): Handle pmfs. + + * decl.c (grokdeclarator): Don't call variable_size for array bounds + that only depend on template constant parameters. + +Mon Feb 27 15:38:16 1995 Brendan Kehoe + + * error.c (dump_decl): Only look to see if it's a vtable if we + actually have a name to check out. + +Mon Feb 27 13:37:53 1995 Jason Merrill + + * cvt.c (convert_to_aggr): Lose misleading shortcut. + +Sun Feb 26 17:27:32 1995 Doug Evans + + * decl.c (set_nested_typename): Always set DECL_IGNORED_P, + not just for dwarf. + +Sun Feb 26 00:10:18 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow a static member to be + declared `register'. + + * init.c (make_friend_class): Move up to a pedwarn for the warning + about a class declaring friends with itself. + + * decl.c (grokdeclarator): You can't do `volatile friend class foo' + or `inline friend class foo'. Only try to make a friend out of + TYPE if we didn't already reset it to integer_type_node. + +Sat Feb 25 22:32:03 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Don't allow initialization of a + non-virtual function. + + * decl.c (start_function): Do a pedwarn if we're changing `main' + to have an int return type. + +Sat Feb 25 00:02:05 1995 Jason Merrill + + * typeck.c (build_modify_expr): Handle simple assignment from + TARGET_EXPRs by building up an RTL_EXPR to force expansion. Whew. + +Fri Feb 24 18:27:14 1995 Brendan Kehoe + + * decl.c (grokdeclarator): Also don't allow virtual outside of a + class decl for a scope method definition performed at global binding. + + * init.c (build_offset_ref): Don't allow creation of an OFFSET_REF + of a bitfield. + + * decl.c (grokdeclarator): Don't allow a const to be declared mutable. + + * typeck.c (build_binary_op): Return an error_mark_node if either + one of the args turned into an error_mark_node when we tried to + use default_conversion. + + * typeck.c (build_unary_op): Forbid using postfix -- on a bool. + + * decl.c (grokdeclarator): Allow `signed' and `unsigned' to be + used on `__wchar_t'. + +Fri Feb 24 13:59:53 1995 Mike Stump + + * except.c (end_protect_partials): Do it the right way. + +Wed Feb 22 15:42:56 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Upgrade warning about + comparing distinct pointer types to pedwarn. + + * typeck2.c (digest_init): Cope with extra braces. + + * typeck.c (build_binary_op_nodefault): Use tree_int_cst_sgn instead + of INT_CST_LT (..., interger_zero_node). + +Wed Feb 22 14:45:52 1995 Brendan Kehoe + + * except.c [!TRY_NEW_EH] (end_protect_partials): Define dummy + function for systems that don't have EH. + +Tue Feb 21 19:18:31 1995 Jason Merrill + + * call.c (can_convert_arg): Like can_convert, but takes an arg as + well. + + * pt.c (type_unification): Allow implicit conversions for parameters + that do not depend on template parameters. + +Tue Feb 21 18:43:48 1995 Douglas Rupp + + * Make-lang.in, config-lang.in: ($exeext): New macro. + * Make-lang.in: Try a "cp" if "ln" fails. + * cp-tree.h (decl_attributes): Added argument. + * decl2.c (cplus_decl_attribute): Add arg to decl_attributes. + * cp/g++.c: Added #ifdefs for sys/file.h and process.h for NT. + Modified spawnvp to have to correct number of arguments for OS/2, NT. + +Tue Feb 21 18:36:55 1995 Mike Stump + + * decl.c (finish_function): Add calls to end_protect_partials to end + the exception region that protects constructors so that partially + constructed objects can be partially destructed when the constructor + throws an exception. + * init.c (perform_member_init, sort_member_init, emit_base_init): + Added support for partially constructed objects. + * init.c (build_partial_cleanup_for): New routine to do partial + cleanups of a base class. + * decl2.c (finish_file): Move the emitting of the exception table + down, after we emit all code that might have exception regions in + them. + * except.c (end_protect_partials, might_have_exceptions_p): New + routines. + (emit_exception_table): Always output table if called. + * cp-tree.h (protect_list, end_protect_partials, + might_have_exceptions_p, emit_exception_table): Added. + +Tue Feb 21 16:05:59 1995 Brendan Kehoe + + * gc.c (build_typeid): Pass a NULL_TREE, not the bogus, unused + address of a local variable. + * class.c (build_vfn_ref): Only try to build the PLUS_EXPR if we + were given a non-null PTR_TO_INSTPTR. + +Tue Feb 21 01:53:18 1995 Jason Merrill + + * decl.c (duplicate_decls): Always lay out the merged decl. + + * decl2.c (finish_vtable_vardecl): Don't do vtable hack on templates. + (finish_prevtable_vardecl): Likewise. + + * method.c (synthesize_method): Set interface_{unknown,only} + according to the settings for our class, not the file where it comes + from. + +Sat Feb 18 12:26:48 1995 Mike Stump + + * except.c: Handle systems that define __i386__ but not __i386. + +Fri Feb 17 15:31:31 1995 Jason Merrill + + * decl2.c (reparse_decl_as_expr): Support being called without a + type argument. + + * parse.y (primary): Add '(' expr_or_declarator ')'. Adds 4 r/r + conflicts. Sigh. + +Fri Feb 17 12:02:06 1995 Mike Stump + + * parse.y (template_def, fndef, fn.def1, return_init, condition, + initdcl0, initdcl, notype_initdcl0, nomods_initdcl0, + component_decl_1, after_type_component_declarator0, + notype_component_declarator0, after_type_component_declarator, + notype_component_declarator, after_type_component_declarator, + full_parm, maybe_raises, exception_specification_opt): Fix up, + include exception_specification_opt maybeasm maybe_attribute and + maybe_init if missing. Rename maybe_raises to + exception_specification_opt to match draft wording. Use maybe_init + to simplify rules. + +Fri Feb 17 01:54:46 1995 Jason Merrill + + * init.c (build_new): Set TREE_NO_UNUSED_WARNING on COMPOUND_EXPRs + built for news of scalar types. + +Thu Feb 16 17:48:28 1995 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Update code for warning + about signed/unsigned comparisons from C frontend. Realize that the + code in the C frontend is, if anything, even more bogus. Fix it. + (build_binary_op): Undo default_conversion if it wasn't useful. + + * typeck.c (build_unary_op, ADDR_EXPR): Lose bogus special case for + PRE*CREMENT_EXPR. + + * decl2.c (import_export_vtable): Don't try the vtable hack + if the class doesn't have any real non-inline virtual functions. + (finish_vtable_vardecl): Don't bother trying to find a non-inline + virtual function in a non-polymorphic class. + (finish_prevtable_vardecl): Likewise. + + * decl2.c (import_export_vtable): Use and set DECL_INTERFACE_KNOWN. + + * cp-tree.h (DECL_INTERFACE_KNOWN): Use DECL_LANG_FLAG_5. + + * init.c (expand_virtual_init): Always call assemble_external. + + * class.c (build_vfn_ref): Always call assemble_external. + (build_vtable): Always call import_export_vtable. + (prepare_fresh_vtable): Likewise. + (add_virtual_function): Don't bother setting TREE_ADDRESSABLE. + +Thu Feb 16 03:28:49 1995 Jason Merrill + + * class.c (finish_struct): Use TYPE_{MIN,MAX}_VALUE to determine + whether an enumerated type fits in a bitfield. + +Wed Feb 15 15:38:12 1995 Jason Merrill + + * class.c (grow_method): Update method_vec after growing the class + obstack. + +Wed Feb 15 13:42:59 1995 Mike Stump + + * parse.y (handler_seq): Push a level for the catch parameters. + +Wed Feb 15 12:42:57 1995 Jason Merrill + + * init.c (emit_base_init): Update BINFO_INHERITANCE_CHAIN on my + bases, in case they've been clobbered. + +Wed Feb 15 12:07:29 1995 Mike Stump + + * class.c (finish_base_struct): Set up BINFO_INHERITANCE_CHAIN here, + so that one day it will always be valid. + * tree.c (propagate_binfo_offsets, layout_vbasetypes): Likewise. + + * cp-tree.h (copy_binfo): Removed, unused. + * tree.c (copy_binfo): Likewise. + +Wed Feb 15 00:05:30 1995 Jason Merrill + + * init.c (build_new): Save the allocation before calling + expand_vec_init on it. + + * decl.c (finish_enum): The TYPE_PRECISION of the enum type mush + match the TYPE_PRECISION of the underlying type for constant folding + to work. + +Tue Feb 14 15:31:25 1995 Mike Stump + + * except.c (push_eh_entry, expand_start_all_catch, + expand_leftover_cleanups, expand_end_catch_block): Keep track of + the context in which the exception region occurs. + (build_exception_table): If the region was not output, don't output + the entry in the eh table for it. + +Tue Feb 14 02:15:43 1995 Jason Merrill + + * init.c (expand_default_init): Only use a previous constructor call + if it's a call to our constructor. Does the word "Duh" mean + anything to you? + + * decl.c (grokparms): Fine, just don't call + convert_for_initialization at all. OK? Happy now? + +Mon Feb 13 02:23:44 1995 Jason Merrill + + * cp-tree.h (CLASSTYPE_FIRST_CONVERSION): Make sure that the class + method vector has a second element before returning it. + + * decl.c (grokparms): Don't strip REFERENCE_TYPE before calling + convert_for_initialization. + +Sun Feb 12 03:57:06 1995 Jason Merrill + + * typeck.c (build_modify_expr): Compare function name to + constructor_name (current_class_type) instead of current_class_name. + + * decl.c (grokparms): Don't do anything with the return value of + convert_for_initialization. + + * error.c (dump_decl): Also dump_readonly_or_volatile on the decl. + + * decl.c (duplicate_decls): Tweak error message. + + * typeck.c (build_const_cast): Implement checking. + (build_reinterpret_cast): Implement some checking. + + * cp-tree.h (CONV_FORCE_TEMP): Require a new temporary when + converting to the same aggregate type. + (CONV_STATIC_CAST): Include it. + (CONV_C_CAST): Likewise. + * cvt.c (convert_force): Use CONV_C_CAST instead of CONV_OLD_CONVERT. + (cp_convert): Only force a new temporary if CONV_FORCE_TEMP. + +Fri Feb 10 16:18:52 1995 Jason Merrill + + * typeck.c (build_c_cast): Use non_lvalue to tack something on + where necessary. + + * decl.c (auto_function): Now a function. + * except.c (init_exception_processing): terminate, unexpected, + set_terminate, and set_unexpected have C++ linkage. + + * typeck.c (build_unary_op, TRUTH_NOT_EXPR): Use convert instead of + truthvalue_conversion for converting to bool, as it handles + user-defined conversions properly. + (condition_conversion): Likewise. + + * except.c (expand_throw): Don't call convert_to_reference. + Pass the correct parameters to build_new. + + * method.c (do_build_assign_ref): Don't use access control when + converting to a base reference here. + (do_build_copy_constructor): Or here. + + * init.c (build_new): Unset TREE_READONLY on the dereferenced + pointer before assigning to it. + + * decl.c (maybe_build_cleanup): Don't bother stripping const here. + + * decl2.c (delete_sanity): You can now delete pointer to const. + +Fri Feb 10 13:28:38 1995 Jason Merrill + + * decl.c (finish_function): Don't rely on actual parameters being + evaluated left-to-right. + * except.c (expand_end_catch_block): Likewise. + +Fri Feb 10 00:52:04 1995 Jason Merrill + + * tree.c (real_lvalue_p): Like lvalue_p, but class temps aren't + considered lvalues. + * cvt.c (convert_to_reference): Use real_lvalue_p instead of + lvalue_p. + + * cvt.c (build_type_conversion_1): Don't call convert on aggregate + types. + (convert_to_reference): Fix erroneous text substitution. + + * typeck2.c (initializer_constant_valid_p): Update from C frontend. + Add new argument to all callers. + + * typeck.c (convert_arguments): Check for error_mark_node before + trying to do anything with the actual parameter. + + * typeck.c (condition_conversion): Build up a CLEANUP_POINT_EXPR and + fold it. + (bool_truthvalue_conversion): Remove. Fix all callers to call + truthvalue_conversion instead. + (various): Fold CLEANUP_POINT_EXPRs. + + * parse.y (conditions): Call condition_conversion rather than + building up a CLEANUP_POINT_EXPR. + + * pt.c (end_template_decl): Don't warn_if_unknown_interface here + under -falt-external-templates. + +Thu Feb 9 05:24:10 1995 Jason Merrill + + * init.c (build_new): Complain about new of const type without + initializer. Other cleanup. + + * call.c (compute_conversion_costs): Don't call + build_type_conversion with a reference type; convert to the target + type and check its lvaluetude. + * cvt.c (convert_to_reference): Likewise. + + * cvt.c (build_type_conversion_1): There will never be any need to + dereference references here now. + +Thu Feb 9 00:37:47 1995 Mike Stump + + * except.c (expand_builtin_throw): Make sure we only `use' the + value of return_val_rtx. + +Wed Feb 8 15:45:55 1995 Jason Merrill + + * parse.y (structsp): Don't complain about declaring a type being + defined to be a friend. + + * decl2.c (warn_if_unknown_interface): Note the template in question + and the point of instantiation, for -falt-external-templates. + * lex.c (reinit_parse_for_method): Pass the decl to + warn_if_unknown_interface. + * pt.c (instantiate_template): Likewise. + (end_template_decl): Likewise. + + * decl.c (set_nested_typename): Set IDENTIFIER_TYPE_VALUE on the + nested name again, to make local classes work a bit better. + + * typeck.c (build_function_call_real): Dereference reference after + checking for incomplete type. + + * init.c (build_new): Accept new of const and volatile types. + +Wed Feb 8 14:04:16 1995 Jason Merrill + + * decl.c (grokdeclarator): Fix error message. + +Wed Feb 8 03:16:15 1995 Jason Merrill + + * typeck.c (convert_for_initialization): Do bash arrays when + converting to a reference to non-array. + +Tue Feb 7 15:50:33 1995 Jason Merrill + + * cvt.c (cp_convert): Don't call convert_to_reference, or + automatically dereference references. Do pass reference conversions + to cp_convert_to_pointer. + (cp_convert_to_pointer): Support references. + + * call.c (build_method_call): Don't build up a reference to the + parameter here; let build_overload_call handle that. + + * typeck.c (build_c_cast): Call convert_to_reference directly if + converting to a reference type. + * method.c (do_build_copy_constructor): Likewise. + * method.c (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + + * call.c (build_method_call): Dereference a returned reference. + * typeck.c (build_function_call_real): Likewise. + + * decl.c (xref_basetypes): Check for unions with basetypes here. + (xref_tag): Instead of here. + + * pt.c (process_template_parm): Template type parm decls are + artificial. + +Mon Feb 6 04:32:09 1995 Jason Merrill + + * parse.y (typed_declspecs): Add missing semicolon. + (do_xref_defn): Resurrect. + (named_class_head_sans_basetype): Move template specialization + definition cases to named_class_head_sans_basetype_defn. + + * decl2.c (grokfield): Call pushdecl_class_level after setting the + TYPE_NAME, not before. + +Sun Feb 5 02:50:45 1995 Jason Merrill + + * call.c (convert_harshness): Don't call sorry here. Don't allow + conversions between function pointer types if pedantic. + + * pt.c (overload_template_name): Pass globalize=1 to xref_tag. + + * lex.c (cons_up_default_function): Use the full name for the return + type of op=. + + * decl.c (set_nested_typename): Don't worry about anonymous types, + as they already have a unique name. + (pushdecl): Remove redundant set_nested_typename + (xref_tag): Split out base handling into xref_basetypes. + + * cp-tree.h (TYPE_INCOMPLETE): New macro; TEMPLATE_TYPE_PARMs are + not considered incomplete even though their definition is unknown. + + * decl.c (xref_defn_tag): Lose. + (xref_tag): xref_next_defn = ! globalize. + (pushdecl): Don't set DECL_NESTED_TYPENAME on artificial decls. The + ones that should have it set will have it set by pushtag. + (pushdecl_class_level): Likewise. + (pushtag): Tidy up a bit. + (set_nested_typename): Push a decl for the nested typename from + here, rather than from xref_defn_tag. + + * parse.y (do_xref): Lose. + (named_class_head): If we see 'class foo:' we know it's a + definition, so don't worry about base lists for non-definitions. + + * pt.c (push_template_decls): Template parm decls are artificial. + + * decl.c (duplicate_decls): Restore check for qualifier + disagreement for non-functions. + (decls_match): Remove check for qualifier disagreement. + +Fri Feb 3 14:58:58 1995 Jason Merrill + + * decl.c (grok_reference_init): Convert initializer from + reference. + * typeck.c (convert_for_initialization): Likewise. + + * decl.c (duplicate_decls): Propagate DECL_NESTED_TYPENAME. + + * cvt.c (cp_convert): Don't convert to the same class type by just + tacking on a NOP_EXPR. + (convert_to_reference): Use comp_target_types instead of comptypes + so that we don't allow conversions two levels down. + +Thu Feb 2 15:07:58 1995 Jason Merrill + + * class.c (build_vbase_path): Bash types to make the backend happy. + * cvt.c (build_up_reference): Bash the types bashed by + build_vbase_path to be reference types instead of pointer types. + (convert_to_reference): Likewise. + + * typeck.c (build_c_cast): Don't strip NOPs if we're converting to a + reference type. + + * parse.y (structsp): Put back error for 'struct B: public A;'. + +Wed Feb 1 23:02:06 1995 Mike Stump + + * except.c: Add support for mips systems that don't define __mips + but do define mips, like Ultrix. + +Wed Feb 1 22:39:07 1995 Mike Stump + + * except.c: Add support for exception handling on the Alpha. + +Wed Feb 1 10:12:14 1995 Mike Stump + + * decl2.c (finish_file): Fix bug in Jan 31st change. + +Tue Jan 31 16:59:15 1995 Gerald Baumgartner + + * sig.c (build_signature_pointer_or_reference_type): Don't set + IS_AGGR_TYPE for signature pointers/reference so expand_default_init + doesn't expect to find a copy constructor. + * call.c (build_method_call): Treat signature pointers/reference + as if IS_AGGR_TYPE were set. + +Tue Jan 31 13:28:56 1995 Mike Stump + + * gc.c (get_typeid): Pawn off error messages to build_t_desc. + (build_t_desc): Inform the user here if they try and build + with -frtti and don't include . + + * decl2.c (finish_prevtable_vardecl): Support rescanning. + (finish_file): Move finish_prevtable_vardecl up to before the global + initializers are done as tdecls are initialized in the global + initializer. Also Pick up any new tdecls or vtables needed by + synthesized methods. + + * class.c (finish_struct): Simplify. We have to do rtti scanning at + end, so we might as well do all of it there. + +Tue Jan 31 05:35:02 1995 Jason Merrill + + * call.c (build_method_call): Fix -fthis-is-variable for 32-bit + targets, too. + +Tue Jan 31 00:11:04 1995 Mike Stump + + * decl2.c (finish_prevtable_vardecl): New routine, mostly split from + finish_vtable_vardecl. It has the first half functionality from + that routine. + * decl2.c (finish_vtable_vardecl): Update to not include stuff not + in finish_prevtable_vardecl. + * decl2.c (finish_file): Call finish_prevtable_vardecl. + * gc.c (build_generic_desc): Allow it to be called when not at the + global binding layer, but behave as if we were. + (build_t_desc): Rearrange a bit so that it really works and is + easier to follow. + * class.c (finish_struct): Don't decide on tdecls here, as we have + to wait until the end of the file in general to decide whether or + not they come out. + +Mon Jan 30 01:00:40 1995 Jason Merrill + + * init.c (build_delete): Check access to operator delete before + calling the destructor. + * method.c (build_opfncall, DELETE_EXPR): build_method is allowed to + return error_mark_node. + * call.c (build_method_call): Use the one-argument op delete even if + it's an error. + + * init.c (build_new): Fix -fthis-is-variable support. + * call.c (build_method_call): Likewise. + + * call.c (convert_harshness): Make conversion from a pointer to bool + worse than conversion to another pointer. + +Sat Jan 28 16:46:10 1995 Jason Merrill + + * init.c (build_new): Check new return value if -fcheck-new. + + * lex.c (check_newline): Clear end_of_file when we're done, too. + +Sat Jan 28 10:38:39 1995 Mike Stump + + * decl2.c (finish_vtable_vardecl): Make rtti TD tables follow + vtables whereever they go. + + * gc.c (build_t_desc): Remove old way of setting it up, as it wasn't + right. + +Sat Jan 28 09:10:44 1995 Mike Stump + + * decl2.c (finish_vtable_vardecl): Now set the + interface/implementation of vtables on the first virtual function, + if one exists, otherwise we use the old method. This is a major win + in terms of cutting down the size of objects and executables in + terms of text space and data space. Now most of the savings that + #pragma interface/implementation gives is automatic in a fair number + of cases. + +Sat Jan 28 04:57:33 1995 Jason Merrill + + * decl.c (grokdeclarator): Discard the template parameters in a + template constructor declaration so that the function is always + named constructor_name (ctype). + + * lex.c (check_newline): Use ungetc to put back the character before + calling HANDLE_PRAGMA. + +Fri Jan 27 17:23:47 1995 Mike Stump + + * decl2.c (check_classfn): If the cname is T and fn_name is T, + make sure we still match them. + +Fri Jan 27 16:32:10 1995 Jason Merrill + + * parse.y: Add END_OF_LINE token. + + * lex.c (check_newline): Set linemode when we see a # directive, and + unset it when we're done. Turn all 'return's into 'goto skipline'. + Fix all uses of '\n', since we won't see it anymore. Put back the + character we read before checking for a sysv or target pragma. + (real_yylex): If we see an EOF in linemode, return END_OF_LINE. + (handle_sysv_pragma): Don't look at the input stream; quit when we + see an END_OF_LINE token. + + * input.c (getch): Return EOF if we're in line mode and at the end + of a line. + (put_back): Don't put back an EOF. + +Thu Jan 26 19:26:34 1995 Mike Stump + + * except.c (expand_throw): Do the newing of the exception object + before we load the type descriptor or the address so that we don't + wipe any of the values out. + +Thu Jan 26 19:20:00 1995 Mike Stump + + * except.c (init_exception_processing): Don't use r12 on the rs6000. + +Tue Jan 24 16:36:31 1995 Jason Merrill + + * decl.c (grokparms): Don't try to build up a reference at this point. + + * typeck2.c (build_functional_cast): Don't assume that a NOP_EXPR + will suffice to convert from integer_zero_node. + +Wed Jan 25 15:02:09 1995 David S. Miller + + * class.c (instantiate_type): Change error message text. + * typeck2.c (store_init_value): Likewise. + +Mon Jan 23 21:57:14 1995 Mike Stump + + * pt.c (tsubst): When we copy a node, don't forget to copy + TREE_CHAIN, we use it later. + +Mon Jan 23 03:33:47 1995 Jason Merrill + + * typeck.c (convert_for_assignment): Initialize variable before use. + +Fri Jan 20 01:17:59 1995 Jason Merrill + + * g++.c (main): Link with both libstdc++ and libg++ if called as + something ending with "g++", otherwise only libstdc++. Move -lm to + the end of the line. + +Thu Jan 19 15:43:11 1995 Jason Merrill + + * call.c (build_method_call): Don't mess with 'this' before calling + compute_conversion_costs. + +Wed Jan 18 15:40:55 1995 Jason Merrill + + * search.c (get_matching_virtual): Give line number for previous + declaration. + + * call.c (convert_harshness): Handle conversions to references + better. + + * cvt.c (build_up_reference): OK, handle {MIN,MAX}_EXPR *properly*. + +Wed Jan 18 15:21:38 1995 Mike Stump + + * class.c (instantiate_type): Use DECL_CHAIN to walk lists instead, + as the TREE_CHAIN for methods will take us to the next differently + named function, DECL_CHAIN won't. + +Wed Jan 18 14:26:59 1995 Jason Merrill + + * tree.c (lvalue_p): Handle {MIN,MAX}_EXPR. + + * decl2.c (lang_decode_option): -Wall implies -Wparentheses. + warn_parentheses defaults to 0. + + * decl.c (grokparms): Put back call to require_instantiated_type. + +Tue Jan 17 19:56:15 1995 Mike Stump + + * except.c (exception_section): Use the data section on the rs6000. + Change calling convention for named_section. + +Wed Jan 17 18:20:57 1994 Fergus Henderson + + * cp-tree.h: Make if (x=0) warn with wall + * parse.y: Make if (x=0) warn with wall + +Tue Jan 17 14:12:00 1995 Jason Merrill + + * decl.c (BOOL_TYPE_SIZE): BITS_PER_WORD if SLOW_BYTE_ACCESS, + BITS_PER_UNIT otherwise. + + * search.c (get_matching_virtual): Don't check the binfo if the + types are the same. + + * cvt.c (cp_convert): Just call truthvalue_conversion to convert to + bool. + +Mon Jan 16 13:28:48 1995 Jason Merrill + + * various: Use boolean_type_node, boolean_true_node, + boolean_false_node. + + * search.c (get_matching_virtual): Allow covariant returns that + don't require pointer adjustment. + + * typeck.c (build_conditional_expr): Don't call default_conversion + on ifexp. + + * cvt.c (build_up_reference): Handle MIN_EXPR and MAX_EXPR. + + * decl.c (grokdeclarator): Upgrade warning about &const to pedwarn. + +Sun Jan 15 22:17:32 1995 David Binderman + + * pt.c (do_function_instantiation): Free targs once we're done. + +Sun Jan 15 22:17:32 1995 Jason Merrill + + * decl.c (BOOL_TYPE_SIZE): Defaults to BITS_PER_WORD. + (init_decl_processing): Use BOOL_TYPE_SIZE instead of CHAR_TYPE_SIZE + for bool. + +Sat Jan 14 05:33:55 1995 Jason Merrill + + * decl2.c (finish_file): We need to mess up if there are any + variables in the list, not just if there is one with a constructor. + +Fri Jan 13 14:42:55 1995 Jason Merrill + + * decl.c (duplicate_decls): Propagate DECL_STATIC_{CON,DE}STRUCTOR. + (finish_function): Handle DECL_STATIC_{CON,DE}STRUCTOR. + (finish_function): Trust rest_of_compilation. + + * decl2.c (finish_file): Also call functions designated as static + constructors/destructors. + + * decl.c (grokdeclarator): Allow access decls of operator functions. + (grokparms): Only do convert_for_initialization if the initializer + has a type. + (duplicate_decls): Put back push_obstacks_nochange call. + + * lex.c (real_yylex): Downgrade complaint about the escape sequence + being too large from pedwarn to warning. + + * decl.c (grokdeclarator): Don't complain about long long in system + headers. + + * lex.c (real_yylex): Handle digraphs. + +Thu Jan 12 12:17:24 1995 Jason Merrill + + * decl.c (init_decl_processing): -f{no-,}strict-prototype only + affects C linkage declarations now. + + * typeck.c (comp_target_types): Grok simple contravariant conversions. + (common_type): t1 and t2 are interchangeable. + + * various: Test return value of comp_target_types differently in + different places; it now returns -1 for a contravariant conversion + (which is fine in symmetric cases). + + (common_type): Prefer long double to double even when + they have the same precision. + + * decl.c (grokparms): Call convert_for_initialization to check + default arguments. + + * init.c (build_new): void_type_node has a size (of 0). + + * decl.c (decls_match): Also check for agreement of TREE_READONLY + and TREE_THIS_VOLATILE. + (push_class_level_binding): Properly handle shadowing of + nested tags by fields. + + * search.c (dfs_pushdecls): Likewise. + + * decl2.c (finish_file): Don't second-guess self-initialization. + + * cvt.c (convert_to_reference): Work with expr directly, rather than + a copy. + + * decl.c (push_overloaded_decl): Only shadow artificial TYPE_DECLs. + + * init.c (add_friend): Downgrade duplicate friend message from + pedwarn to warning. + + * decl.c (duplicate_decls): Push obstacks before calling common_type. + +Thu Jan 12 17:15:21 1995 Michael Ben-Gershon + + * except.c (push_eh_entry): Set LABEL_PRESERVE_P flag for + exception table labels. + (expand_start_all_catch): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + * except.c (make_first_label): New function. + (expand_start_all_catch): Add a call to make_first_label() before + using a label as a jump destination. + (expand_end_all_catch): Likewise. + (expand_leftover_cleanups): Likewise. + (expand_end_catch_block): Likewise. + (expand_builtin_throw): Likewise. + (expand_throw): Likewise. + * except.c: Add ARM processor support for exception handling. + +Thu Jan 12 12:17:24 1995 Jason Merrill + + (complete_array_type): Copy code from C frontend. + + * lex.c (real_yylex): Don't multiply the length of a wide string + literal by WCHAR_BYTES. + + * decl.c (pushdecl): Check for redeclaration of wchar_t here. + (duplicate_decls): Instead of here. + (define_label): Complain about a label named wchar_t. + (grokdeclarator): Complain about declarations of + operator-function-ids as non-functions. + + * typeck.c (unary_complex_lvalue): Also wrap prefix -- and ++ in + COMPOUND_EXPRs. + (build_unary_op): Wrap unary plus in a NON_LVALUE_EXPR. + + * lex.c (real_yylex): Don't skip whitespace when reading the next + character after ->. + +Wed Jan 11 16:32:49 1995 Mike Stump + + * except.c: Allow cc1plus to be built with native compiler on rs6000. + (expand_start_all_catch): Add assemble_external calls for various + routines we call. + (expand_leftover_cleanups): Likewise. + (expand_start_catch_block): Likewise. + (do_unwind): Likewise. + (expand_builtin_throw): Likewise. + +Wed Jan 11 01:05:42 1995 Jason Merrill + + * decl.c (pushtag): Only look for a previous decl in the current + binding level. Use explicit global scope in DECL_NESTED_TYPENAME. + + * gxx.gperf: Add __signature__ and __sigof__ keywords. + + * decl2.c (lang_decode_option): -ansi does not set flag_no_asm. It + does set flag_no_gnu_keywords and flag_operator_names. + + * lex.c (init_lex): 'overload' is not a keyword unless -traditional. + Unset extension keywords if -fno-gnu-keywords. + Allow operator names ('bitand') if -foperator-names. + Never unset 'asm'; -fno-asm only affects 'typeof'. + + * decl.c (lookup_name_real): The got_object special lookup only + applies to types. + +Tue Jan 10 18:07:51 1995 Jason Merrill + + * spew.c (yylex): Also use DECL_NESTED_TYPENAME if got_object is set. + + * parse.y (primary): Unset got_object after all rules that use the + 'object' nonterminal. + (object): Set got_object. + + * lex.h: Declare got_object. + + * decl.c (lookup_name_real): Also lookup names in the context of an + object specified. + +Tue Jan 10 14:30:30 1995 Mike Stump + + * typeck.c (get_member_function_from_ptrfunc): Use ptrdiff_type_node + for things that have to be added to pointers, not size_type. Cures + problems with pointer to members on Alphas. + (build_binary_op_nodefault): Likewise. + (get_delta_difference_: Likewise. + (build_ptrmemfunc): Likewise. + +Tue Jan 10 01:49:25 1995 Jason Merrill + + * decl.c (pushtag): Stick the new decl in TYPE_NAME before pushing + it. + + * typeck.c (build_component_ref): Don't build up a COMPONENT_REF + when dealing with overloaded member functions; just act like + build_offset_ref. + (commonparms): Remove misleading comment. + + * decl.c (duplicate_decls): Complain about repeated default + arguments here. + (redeclaration_error_message): Instead of here. + (pushdecl): Complain about missing default arguments here. + (grokparms): Instead of here. + (lookup_name_current_level): Also match on DECL_ASSEMBLER_NAME. + (grok_reference_init): Do not complain about missing initializer if + declared 'extern'. + + * search.c (lookup_field): Don't return a TYPE_DECL if there is a + function alternative and want_type is not set. + +Mon Jan 9 18:16:23 1995 Jason Merrill + + * decl.c (pushtag): Don't set TYPE_NAME to an identifier. Do push + the decl when the type has no TYPE_NAME. + (lookup_nested_type): Don't assume that type has TYPE_NAME set. + (lookup_name_real): Call lookup_field with want_type = + prefer_type. + + * search.c (lookup_field): Handle want_type properly in the presence + of fields with the same name. + + * decl.c (set_nested_typename): Set nested name for file-scope types + to include leading ::. + (pushdecl): Set the nested typename if the decl doesn't have one, + rather than if the type's canonical decl doesn't have one. + +Mon Jan 9 03:44:33 1995 Jason Merrill + + * typeck.c (convert_for_assignment): Complain about contravariance + violation here. + (comp_target_types): Instead of here. + (build_unary_op): resolve_offset_ref before checking for a valid + type. + + * spew.c (yylex): Decrement looking_for_typename after we see a + _DEFN. + + * decl.c (pushdecl): Don't install an artificial TYPE_DECL in + IDENTIFIER_LOCAL_VALUE if we already have a decl with that name. + + * typeck.c (convert_for_assignment): Converting pointers to bool + does not need a cast. + +Sun Jan 8 18:16:45 1995 Jason Merrill + + * class.c (instantiate_type): Initialize nsubsts parm. + + * pt.c (do_function_instantiation): Likewise. + +Sat Jan 7 14:37:05 1995 Jason Merrill + + * pt.c (tsubst): Use TREE_STATIC instead of DECL_INLINE && + DECL_SAVED_INSNS to determine whether or not we've seen a definition + of this function. + (instantiate_template): Likewise. + + * call.c (convert_harshness): Allow const reference binding when + called from the overloading code, but not when called from + can_convert (since it isn't a conversion). + (convert_harshness): Put back some disabled code. + +Fri Jan 6 14:10:57 1995 Jason Merrill + + * call.c (convert_harshness): There is no implicit conversion from + void* to other pointer types (unless the parameter is (void*)0). + (convert_harshness): Non-lvalues do not convert to reference types. + + * class.c (finish_struct_methods): Still set + TYPE_HAS_{INT,REAL}_CONVERSION. + + * call.c (can_convert): Don't use aggregate initialization. + + * cp-tree.h: Declare lookup_conversions. + +Thu Jan 5 21:08:00 1995 Mike Stump + + * parse.y (simple_stmt): Fix duplicate case value error messages to + be more readable. + +Wed Jan 4 16:44:19 1995 Jason Merrill + + * cvt.c (build_type_conversion): Total rewrite to use + convert_harshness instead of reproducing conversion logic here. Now + much shorter. + + * call.c (convert_harshness): Support conversions to bool. + (can_convert): Checks whether a conversion is less harsh + than USER_CODE, for build_type_conversion. + + * search.c (add_conversions): Function for passing to dfs_walk which + adds all the type conversion operators in the current type to a list. + (lookup_conversions): Calls dfs_walk with add_conversions and return + the list. + (dfs_walk): Don't require a qfn. + + * cp-tree.h: Lose CLASSTYPE_CONVERSIONS hackery. + (CLASSTYPE_FIRST_CONVERSION): Points to elt 1 of CLASSTYPE_METHOD_VEC. + + * class.c (finish_struct_bits): Lose CLASSTYPE_CONVERSIONS hackery. + (grow_method): A separate function for building onto the growing + method vector. + (finish_struct_methods): Use it. Put all type conversion operators + right after the constructors. Perhaps we should sort the methods + alphabetically? + +Mon Jan 2 14:42:58 1995 Jason Merrill + + * call.c (build_method_call): Lose another misleading shortcut. + diff --git a/gcc/cp/ChangeLog-1996 b/gcc/cp/ChangeLog-1996 new file mode 100644 index 00000000000..348378beb15 --- /dev/null +++ b/gcc/cp/ChangeLog-1996 @@ -0,0 +1,4047 @@ +Tue Dec 31 20:25:50 1996 Mike Stump + + * search.c (expand_upcast_fixups): Fix bogus code generation + problem where the generated code uses the wrong index into the + runtime built vtable on the stack. Old code could clobber random + stack values. + +Tue Dec 31 15:16:56 1996 Mike Stump + + * init.c (perform_member_init): Make sure the partial EH cleanups + live on the function_obstack. + +Fri Dec 27 10:31:40 1996 Paul Eggert + + * Make-lang.in (g++spec.o): Don't use $< with an explicit target; + this isn't portable to some versions of `make' (e.g. Solaris 2.5.1). + +Tue Dec 24 10:24:03 1996 Jeffrey A Law + + * decl.c (grokvardecl): Avoid ANSI style initialization. + +Sun Dec 22 04:22:06 1996 Jason Merrill + + * pt.c (tsubst): Tweak arg types for a FUNCTION_TYPE. + +Fri Dec 20 17:09:25 1996 Jason Merrill + + * pt.c (instantiate_class_template): Call grok_{ctor,op}_properties. + +Fri Dec 20 12:17:12 1996 Brendan Kehoe + + * g++spec.c (lang_specific_driver): Put missing hyphen in front of + arguments we compare against. Start the count of I at 1, not 0, + since argv[0] is still the command. + +Thu Dec 19 11:53:57 1996 Stan Shebs + + * lang-specs.h: Accept .cp as an C++ extension. + +Mon Dec 16 22:43:31 1996 Brendan Kehoe + + * cp-tree.h (ptr_reasonably_similar): Add decl. + +Thu Dec 12 15:00:35 1996 Brendan Kehoe + + * decl.c (grokvardecl): Change SPECBITS parm to be the SPECBITS_IN + pointer. New local SPECBITS with the parm's value. + (grokdeclarator): Pass &specbits down. + + * parse.y (expr_no_commas): Make sure $$ is not an error_mark_node + before we try to do C_SET_EXP_ORIGINAL_CODE on it. + + * search.c (envelope_add_decl): Check that the CLASSTYPE_CID of + CONTEXT is not 0 before we try to use TYPE_DERIVES_FROM. + + * decl.c (cplus_expand_expr_stmt): Only expand the expr if EXP is + not an error_mark_node. + +Sat Dec 7 17:20:22 1996 Jason Merrill + + * cp-tree.h (TYPE_MAIN_DECL): Use TYPE_STUB_DECL. + * *.c: Use TYPE_MAIN_DECL instead of TYPE_NAME where appropriate. + +Fri Dec 6 14:40:09 1996 Jason Merrill + + * decl.c (grokdeclarator): When giving an anonymous struct a name, + replace TYPE_NAME instead of TYPE_IDENTIFIER (so TYPE_STUB_DECL is + not affected). + + * typeck2.c (build_m_component_ref): If component is a pointer + to data member, resolve the OFFSET_REF now. + + * call.c (convert_like): Don't go into infinite recursion. + + * pt.c (coerce_template_parms): Use tsubst_expr for non-type args. + + * class.c (finish_struct_1): Set DECL_ARTIFICIAL on the vptr. + * tree.c (layout_basetypes): And on the vbase ptr. + +Thu Dec 5 02:11:28 1996 Jason Merrill + + * decl.c (BOOL_TYPE_SIZE): Define in terms of POINTER_SIZE or + CHAR_TYPE_SIZE so bool is always the same size as another type. + + * decl.c (pushtag): Set DECL_IGNORED_P for DWARF, too. + +Tue Dec 3 23:18:37 1996 Jason Merrill + + * decl2.c (grok_x_components): Remove synthesized methods from + TYPE_METHODS of an anonymous union, complain about member + functions. + * decl.c (shadow_tag): Wipe out memory of synthesized methods in + anonymous unions. + (finish_function): Just clear the DECL_RTL of our arguments. + +Fri Nov 29 21:54:17 1996 Jason Merrill + + * decl2.c (finish_file): Emit DWARF debugging info for static data + members. + + * pt.c (tsubst): If t is a stub decl, return the stub decl for type. + +Wed Nov 27 14:47:15 1996 Bob Manson + + * typeck.c (build_component_ref): Don't die if COMPONENT isn't a + IDENTIFIER_NODE. + +Wed Nov 27 16:05:19 1996 Michael Meissner + + * Make-lang.in (g++-cross$(exeext)): Fix typo. + +Wed Nov 27 08:14:00 1996 Brendan Kehoe + + Make the g++ driver now be a standalone program, rather than one + that tries to run the gcc driver after munging up the options. + * Make-lang.in (g++.c, g++spec.o): New rules. + (g++.o): New rule, based on gcc.o with -DLANG_SPECIFIC_DRIVER + added. + (g++$(exeext)): New rule, based on xgcc rule. + (g++-cross$(exeext)): Now just copies g++$(exeext) over. + * g++spec.c: New file. + * g++.c: Removed file. + +Tue Nov 26 19:01:09 1996 Mike Stump + + * cvt.c (build_up_reference): Arrange for any temporary values + that have been keep in registers until now to be put into memory. + +Mon Nov 25 15:16:41 1996 Kaveh R. Ghazi + + * Make-lang.in (c++.stage[1234]): Depend upon stage[1-4]-start, so + that make -j3 bootstrap works better. + +Sun Nov 24 02:09:39 1996 Jason Merrill + + * decl.c (pushtag): Do pushdecl for anon tags. + +Thu Nov 21 16:30:24 1996 Jason Merrill + + * typeck.c (c_expand_return): Fix logic. + (unary_complex_lvalue): Avoid unused warning on address of INIT_EXPR. + +Wed Nov 20 18:47:31 1996 Bob Manson + + * g++.c (main): Make sure arglist has a final NULL entry. Add + PEXECUTE_LAST to the flags passed to pexecute, as otherwise + stdin/stdout of the invoked program are redirected to + nowheresville. + +Tue Nov 19 16:12:44 1996 Jason Merrill + + * decl.c (implicitly_declare): Set DECL_ARTIFICIAL. + +Tue Nov 19 15:48:19 1996 Mike Stump + + * init.c (resolve_offset_ref): Handle obj.vfn better. + * typeck.c (build_component_ref): Set TREE_TYPE on result from + build_vfn_ref. + +Tue Nov 19 13:14:33 1996 Mike Stump + + * typeck.c (convert_for_assignment): Also handle anachronistic + implicit conversions from (::*)() to cv void*. + * cvt.c (cp_convert_to_pointer): Likewise. + +Mon Nov 18 17:05:26 1996 Jason Merrill + + * lex.c (handle_cp_pragma): Fix bogus warning. + +Mon Nov 18 16:10:43 1996 Mike Stump + + * cvt.c (cp_convert_to_pointer): Avoid thinking a POINTER_TYPE + (METHOD_TYPE) is a TYPE_PTRMEMFUNC_P. + +Thu Nov 14 23:18:17 1996 Jason Merrill + + * class.c (finish_struct_1): Support DWARF2_DEBUG. + * search.c (dfs_debug_mark): Likewise. + * decl2.c (finish_vtable_vardecl): Likewise. + * decl.c (pushtag, finish_enum): Likewise. + * lex.c (check_newline): Use debug_* instead of calling *out + functions directly. + +Thu Nov 14 15:21:46 1996 Brendan Kehoe + + * Make-lang.in (cplib2.ready): Add else clause to avoid problems + on some picky hosts. + +Wed Nov 13 12:32:07 1996 Jason Merrill + + * class.c (finish_struct_1): A class has a non-trivial copy + constructor if it has virtual functions. + + * cvt.c (cp_convert): Always call a constructor. + + * call.c (reference_binding): Still tack on a REF_BIND + for bad conversions. + (build_user_type_conversion_1): Propagate ICS_BAD_FLAG. + + * typeck.c (convert_arguments): Pass LOOKUP_ONLYCONVERTING. + (c_expand_return): Likewise. + * typeck2.c (digest_init): Likewise for { }. + * init.c (expand_aggr_init_1): Keep the CONSTRUCTOR handling. + * cvt.c (cp_convert): Handle failure better. + +Wed Nov 13 11:51:20 1996 Brendan Kehoe + + * g++.c (main): Also set PEXECUTE_SEARCH, to make the invocation + of GCC be path-relative. + +Wed Nov 13 11:27:16 1996 Michael Meissner + + * Make-lang.in (g++-cross): G++-cross doesn't need version.o, but + it does need choose-temp.o and pexecute.o. + +Wed Nov 13 07:53:38 1996 Brendan Kehoe + + * g++.c (error) [!HAVE_VPRINTF]: Put error back for the only time + that we still use it. + (P_tmpdir, R_OK, W_OK, X_OK) [__MSDOS__]: Delete unnecessary macros. + +Wed Nov 13 02:00:26 1996 Jason Merrill + + * init.c (expand_default_init): Avoid calling constructors to + initialize reference temps. + + * cvt.c (convert_to_reference): Fix. + +Tue Nov 12 19:10:07 1996 Jason Merrill + + * cvt.c (cp_convert): Simplify for flag_ansi_overloading. + (convert_to_reference): Likewise. + * typeck.c (convert_for_initialization): Likewise. + * init.c (expand_default_init): Likewise. + (expand_aggr_init_1): Likewise. + * cp-tree.h (CONV_NONCONVERTING): Lose. + * typeck.c (build_c_cast): Lose allow_nonconverting parm. + * *.c: Adjust. + * call.c (build_user_type_conversion_1): Assume LOOKUP_ONLYCONVERTING. + +Tue Nov 12 16:29:04 1996 Brendan Kehoe + + * pt.c (tsubst_expr): Reverse args to expand_start_catch_block. + +Tue Nov 12 15:26:17 1996 Jason Merrill + + * init.c (expand_aggr_init_1): Don't crash on non-constructor + TARGET_EXPR. + +Tue Nov 12 14:00:50 1996 Brendan Kehoe + + * g++.c: Include gansidecl.h. + (VPROTO, PVPROTO, VA_START): Delete. + (choose_temp_base_try, choose_temp_base, perror_exec, + run_dos) [__MSDOS__]: Delete fns. + (pfatal_with_name): Delete fn. + (temp_filename): Declare like in gcc.c. + (pexecute, pwait, choose_temp_base): Declare from gcc.c. + (error_count, signal_count): Define. + (error): Delete both definitions. + (PEXECUTE_{FIRST,LAST,SEARCH,VERBOSE}): Define from gcc.c. + (pfatal_pexecute): Add fn from gcc.c. + (main): Rename local VERBOSE var to VERBOSE_FLAG. Rewrite the + code to use the pexecute stuff also used by gcc.c. + (MIN_FATAL_STATUS): Define. + * Make-lang.in (g++): Add dependency on and linking with + choose-temp.o and pexecute.o. + + * cp-tree.h: Include gansidecl.h. + (STDIO_PROTO): Delete #undef/#define. + * cvt.c (NULL): Delete #undef/#define. + * expr.c (NULL): Likewise. + * init.c (NULL): Likewise. + * rtti.c (NULL): Likewise. + * xref.c (NULL): Likewise. + + * cp-tree.h (build_user_type_conversion): Add prototype. + * call.c (build_user_type_conversion): Delete prototype. Correct + decl of FLAGS arg to be an int. + * cvt.c (build_user_type_conversion): Likewise. + +Tue Nov 12 12:16:20 1996 Jason Merrill + + * cp-tree.def: Add TRY_BLOCK and HANDLER. + * except.c (expand_start_catch_block): Support templates. + * parse.y (try_block, handler_seq): Likewise. + * pt.c (tsubst_expr): Support TRY_BLOCK and HANDLER. + +Mon Nov 11 13:57:31 1996 Jason Merrill + + * pt.c (current_template_args): New fn. + (push_template_decl): Use it. + * decl.c (grokdeclarator): Use it. + + * decl2.c (build_expr_from_tree): Dereference ref vars. + + * decl.c (grokdeclarator): Generalize handling of TYPENAME_TYPEs in + the decl-specifier-seq. + + * decl.c (grok_op_properties): Don't force the type of a conversion + op to be complete. Don't warn about converting to the same type + for template instantiations. + + * decl2.c (finish_file): Don't call instantiate_decl on synthesized + methods. + +Mon Nov 11 13:20:34 1996 Bob Manson + + * typeck.c (get_delta_difference): Remove previous bogusness. + Don't give errors if force is set. + +Fri Nov 8 17:38:44 1996 Jason Merrill + + * decl2.c (finish_file): Don't emit debug info. + * decl.c (pushdecl): Lose obsolete code. + (grokdeclarator): Still do the long long thing after complaining. + * search.c (note_debug_info_needed): Don't do anything if we're in a + template. + * method.c (synthesize_method): For non-local classes, + push_to_top_level first. + +Fri Nov 8 11:52:28 1996 Bob Manson + + * typeck.c (get_delta_difference): Add no_error parameter. + (build_ptrmemfunc): Call get_delta_difference with no_error set; + we don't want error messages when converting unrelated + pointer-to-member functions. + +Thu Nov 7 11:16:24 1996 Mike Stump + + * error.c (dump_expr): Improve the wording on error messages that + involve pointer to member functions. + +Tue Nov 5 17:12:05 1996 Mike Stump + + * cvt.c (cp_convert_to_pointer): Move code for conversions from + (::*)() to void* or (*)() up a bit, so that we can convert from + METHOD_TYPEs as well. + +Tue Nov 5 14:54:17 1996 Jason Merrill + + * rtti.c (get_tinfo_fn): Make sure 'type' is permanent. + There are no 'member' types. + (get_tinfo_fn_dynamic): Diagnose typeid of overloaded fn. + (build_x_typeid): Handle errors. + +Mon Nov 4 17:43:12 1996 Mike Stump + + * typeck.c (convert_for_assignment): Handle anachronistic implicit + conversions from (::*)() to void* or (*)(). + * cvt.c (cp_convert_to_pointer): Likewise. + (cp_convert_to_pointer_force): Remove cp_convert_to_pointer + conversions from here. + * decl2.c (lang_decode_option): Add -W{no-,}pmf-conversions. + * lang-options.h: Likewise. + * decl2.c (warn_pmf2ptr): Define. + * cp-tree.h: Declare it. + * typeck2.c (digest_init): Allow pmfs down into + convert_for_initialization. + +Sun Nov 3 09:43:00 1996 Jason Merrill + + * typeck.c (c_expand_return): Fix for returning overloaded fn. + +Fri Nov 1 08:53:17 1996 Jason Merrill + + * cp-tree.h (DIRECT_BIND): Change from INDIRECT_BIND. + * decl.c (grok_reference_init): Pass DIRECT_BIND. + * cvt.c (build_up_reference): Don't mark 'this' addressable. Use + DIRECT_BIND. + * call.c (convert_like): Don't pass INDIRECT_BIND. + * typeck.c (convert_arguments): Likewise. + * typeck.c (mark_addressable): Allow &this if flag_this_is_variable. + +Thu Oct 31 17:08:49 1996 Jason Merrill + + * typeck.c (mark_addressable): Support TARGET_EXPR, unify with + similar code in build_up_ref. + * cvt.c (build_up_reference): Drastically simplify. + +Mon Oct 28 12:45:05 1996 Jeffrey A Law + + * typeck.c (signed_or_unsigned_type): If the given type already + as the correct signedness, then just return it. + + * typeck.c ({un,}signed_type): If can't do anything, call + signed_or_unsigned_type. + +Thu Oct 24 14:21:59 1996 Bob Manson + + * decl2.c (copy_assignment_arg_p): Don't buy the farm if + current_class_type is NULL. + +Wed Oct 23 00:43:10 1996 Jason Merrill + + * class.c (finish_struct_1): Avoid empty structs by adding a field + so layout_type gets the mode right. + + * typeck.c (c_expand_return): Drastically simplify. + +Mon Oct 21 22:34:02 1996 Jason Merrill + + * typeck.c (decay_conversion): Handle overloaded methods. + +Fri Oct 18 16:03:48 1996 Jason Merrill + + * call.c (build_over_call): A TARGET_EXPR has side-effects. + +Thu Oct 17 11:31:59 1996 Mike Stump + + * cvt.c (convert_to_pointer_force): Add code to support pointer to + member function to pointer to function conversions. + * init.c (resolve_offset_ref): Add code to allow faked up objects, + ignoring them if they are not used, and giving an error, if they + are needed. + * typeck.c (get_member_function_from_ptrfunc): Fold e1 to improve + code, and so that we can give an error, if we needed an object, + and one was not provided. + (build_c_cast): Don't call default_conversion when we want to + convert to pointer to function from a METHOD_TYPE. + +Mon Oct 14 00:28:51 1996 Jason Merrill + + * Make-lang.in (cplib2.ready): Fix logic. + + * decl.c (shadow_tag): Only complain about non-artificial function + members. + + * class.c (finish_struct_1): Add synthesized methods to TYPE_METHODS. + +Fri Oct 11 16:12:40 1996 Jason Merrill + + * expr.c (cplus_expand_expr): Pre-tweak call_target like + expand_inline_function would. + + * pt.c (mark_decl_instantiated): If extern_p, call + mark_inline_for_output. + +Thu Oct 10 15:58:08 1996 Mike Stump + + * typeck.c (unary_complex_lvalue): Add code to handle intermediate + pmd conversions. + + * typeck.c (get_delta_difference): Fix wording, as we can be used + for pointer to data members. + +Tue Oct 8 12:43:51 1996 Bob Manson + + * pt.c (tsubst): If the function decl isn't a member of this + template, return a copy of the decl (including copying the + lang-specific part) so we don't hose ourselves later. + +Thu Oct 3 16:24:28 1996 Jason Merrill + + * class.c (finish_struct): Remove DWARF-specific tag handling. + * decl.c (pushtag): Likewise. + (finish_function): Always clear DECL_ARGUMENTS on function decls with + no saved RTX. + * decl2.c (finish_file): Emit DWARF debugging info for static data + members. + +Wed Oct 2 21:58:01 1996 Bob Manson + + * decl.c (duplicate_decls): Make sure the old DECL_LANG_SPECIFIC + isn't the same as the new one before we whack it. + +Mon Sep 30 13:38:24 1996 Jason Merrill + + * class.c, cp-tree.h, cvt.c, decl.c, decl2.c, gxx.gperf, hash.h, + lex.c, method.c, parse.y, typeck.c, typeck2.c: Remove + warn_traditional and warn_strict_prototypes; remove ancient + 'overload' code; remove references to flag_traditional. + +Mon Sep 30 12:58:40 1996 Mike Stump + + * input.c (sub_getch): Handle 8-bit characters in string literals. + +Sun Sep 29 03:12:01 1996 Jason Merrill + + * tree.c (mapcar): Handle CONSTRUCTORs. + (copy_to_permanent): Handle expression_obstack properly. + + * Make-lang.in (cplib2.txt): Also depend on the headers. + + * rtti.c (get_tinfo_var): Don't assume that POINTER_SIZE == + INT_TYPE_SIZE. + (expand_class_desc): Use USItype for offset field. + * tinfo.h (struct __class_type_info): Likewise. + + * method.c (build_overload_int): TYPE_PRECISION should be applied + to types. + +Sat Sep 28 14:44:50 1996 Jason Merrill + + * call.c (build_new_op): A COND_EXPR involving void must be a + builtin. + +Fri Sep 27 16:40:30 1996 Jason Merrill + + * typeck.c (build_x_component_ref): New fn. + (build_object_ref): Use it. + * parse.y (primary): Use it. + * decl2.c (build_expr_from_tree): Use it. + * cp-tree.h: Declare it. + + * decl.c (start_decl): Variable-sized arrays cannot be initialized. + * error.c (dump_type_suffix): Handle variable arrays. + +Fri Sep 27 13:14:05 1996 Brendan Kehoe + + * Make-lang.in (exception.o): Put back compiling it with -fPIC. + +Fri Sep 27 03:00:09 1996 Jason Merrill + + * decl.c (lookup_name_real): Don't try to look up anything in a + TYPENAME_TYPE. + + * tinfo2.cc (__throw_type_match_rtti): Oops. + +Thu Sep 26 22:11:05 1996 Brendan Kehoe + + * Make-lang.in (exception.o): Use -fno-PIC for now. + +Thu Sep 26 10:59:00 1996 Jason Merrill + + * rtti.c (build_dynamic_cast): Pass tinfo fns rather than + calling them. + (get_tinfo_fn_dynamic): Extracted from build_typeid. + * tinfo2.cc (__dynamic_cast): Adjust. + + * rtti.c (build_typeid): Use resolves_to_fixed_type_p. + (build_x_typeid): Likewise. + + * parse.y: Call build_x_typeid instead of build_typeid. + * cp-tree.def: Add TYPEID_EXPR. + * pt.c (tsubst_copy): Handle typeid. + * decl2.c (build_expr_from_tree): Likewise. + * rtti.c (build_x_typeid): Throw bad_typeid from here. + (build_typeid): Not here. + * cp-tree.h: Declare build_x_typeid. + +Wed Sep 25 17:26:16 1996 Jason Merrill + + * call.c (convert_like): Pull out constant values. + + * tree.c (mapcar): Use build_cplus_array_type, not build_array_type. + +Wed Sep 25 17:28:53 1996 Michael Meissner + + * decl.c (init_decl_processing): Create short int types before + creating size_t in case a machine description needs to use + unsigned short for size_t. + +Tue Sep 24 18:18:44 1996 Jason Merrill + + * Make-lang.in (exception.o): Turn off pic. + + * tinfo2.cc (__throw_type_match_rtti): Fix cv-variants of the same + type, multi-level ptr conversions. + + * rtti.c (call_void_fn): Renamed and genericized from throw_bad_cast. + (throw_bad_cast): Use it. + (throw_bad_typeid): New fn. + (build_typeid): Throw bad_typeid as needed. + Use build_call. + (synthesize_tinfo_fn): Handle functions and arrays before checking + for cv-quals. + + * Remove .h from standard C++ headers, add new.h, move into inc + subdirectory. + + * exception*: Remove pointer from object, constructors. Add + default exception::what that uses type_info::name. Add + __throw_bad_typeid. + + * init.c (build_new): Don't add a cookie to new (void *) T[2]. + +Mon Sep 23 15:21:53 1996 Jason Merrill + + * Make-lang.in: Building C++ code depends on cc1plus. + +Mon Sep 23 12:38:40 1996 Brendan Kehoe + + * decl.c (struct saved_scope): Declare PROCESSING_TEMPLATE_DECL as + a HOST_WIDE_INT, not a tree. + +Mon Sep 23 12:36:02 1996 Jason Merrill + + * exception.cc: Don't include . + + * Make-lang.in (c++.clean): Remove cplib2.*. + +Mon Sep 23 09:42:19 1996 Doug Evans + + * parse.y (component_decl_1, component_costructor_declarator case): + Pass attributes/prefix_attributes in tree list. + +Mon Sep 23 01:18:50 1996 Jason Merrill + + * tinfo{,2}.cc: #include instead of . + +Sun Sep 22 05:31:22 1996 Jason Merrill + + * lex.c (do_identifier): Don't do deferred lookup in a template + header. + + * typeck2.c (store_init_value): Oops. + + * new.{h,cc}, exception.{h,cc}, typeinfo.h, tinfo{2.cc,.cc,.h}: + New files for C++ lang-support library. + * Make-lang.in (CXX_EXTRA_HEADERS): Define. + (CXX_LIB2FUNCS): Define. + And rules for building the C++ lang-support code. + * config-lang.in (headers): Define. + (lib2funcs): Define. + +Sat Sep 21 19:17:28 1996 Jason Merrill + + * decl2.c (build_expr_from_tree): If CONSTRUCTOR has a type, call + digest_init. + * pt.c (tsubst_copy): Compute type for CONSTRUCTOR. + * typeck2.c (store_init_value): Check for initializing pmf with { } + here. + (process_init_constructor): Not here. + +Thu Sep 19 16:41:07 1996 Jason Merrill + + * pt.c (begin_template_parm_list): Increment + processing_template_decl here. + (end_template_parm_list): Not here. + (process_template_parm): No need to add 1 to it now. + * *.c: Use processing_template_decl instead of current_template_parms + to check for being in a template. + + * pt.c (uses_template_parms): Handle SCOPE_REF. Fix CONSTRUCTOR. + (tsubst_copy): Handle CONSTRUCTOR. + (instantiate_decl): Set up context properly for variables. + * decl2.c (build_expr_from_tree): Handle CONSTRUCTOR. + * class.c (finish_struct): Reverse CLASSTYPE_TAGS. + +Wed Sep 18 13:30:20 1996 Brendan Kehoe + + * lex.c (enum tree_node_kind) [GATHER_STATISTICS]: Put the enum back. + +Wed Sep 18 04:24:07 1996 Jason Merrill + + * method.c (make_thunk): Call comdat_linkage before setting the + TREE_CODE. + + * decl2.c (comdat_linkage): Use make_decl_one_only. + (import_export_decl): Likewise. + * decl.c (init_decl_processing): Check supports_one_only instead of + SUPPORTS_WEAK. + +Sat Sep 14 08:34:41 1996 Jason Merrill + + * decl2.c (grokfield): Tighten checking for access decls. + + * decl.c (make_typename_type): Resolve references to + current_class_type. Set CLASSTYPE_GOT_SEMICOLON. + (lookup_name_real): Types that depend on a template parameter get + an implicit 'typename' unless they're in the current scope. + (start_decl_1): We don't care about incomplete types that depend + on a template parm. + (grokdeclarator): Resolve 'typename's in the type specifier that + refer to members of the current scope. + + * call.c (build_over_call): Remove 'inline called before + definition' diagnostic. + (build_method_call): Likewise. + * decl.c (duplicate_decls): Downgrade 'used before declared + inline' to a warning, only with -Winline. + +Fri Sep 13 17:31:40 1996 Stan Shebs + + * mpw-make.sed: Fix include paths, add @DASH_C_FLAG@ to compile. + +Wed Sep 11 22:38:13 1996 Gerald Baumgartner + + * call.c (build_method_call): When calling a signature + default implementation, as in other cases, let instance_ptr simply + be instance. + +Wed Sep 11 22:14:44 1996 Mike Stump + + * parse.y (simple_stmt): Cleanup and use do_poplevel (). + +Wed Sep 11 22:10:48 1996 Mike Stump + + * except.c (expand_start_catch_block): Add a pushlevel so that -g + works on hppa and SPARC. + +Wed Sep 11 10:18:06 1996 Brendan Kehoe + + * typeck.c (build_indirect_ref): Catch PTR being an error_mark_node. + +Mon Sep 9 19:51:14 1996 Gerald Baumgartner + + * call.c (build_over_call): Check first whether DECL_CONTEXT exists + before testing whether it's a signature. + +Sun Sep 8 16:06:57 1996 Gerald Baumgartner + + * call.c (build_new_method_call): Don't complain about signature + pointers and references not being an aggr type. + (build_this): If a signature pointer or reference was passed in, + just return it. + (build_new_method_call): If instance is a signature pointer, set + basetype to the signature type of instance. + * sig.c (build_signature_method_call): Deleted basetype and + instance parameters, they can be found as the DECL_CONTEXT of + function and as the first argument passed in. + * cp-tree.h: Changed declaration of build_signature_method_call. + * call.c (build_method_call): Deleted first two arguments in call + of build_signature_method_call. + (build_over_call): Added call to build_signature_method_call. + +Thu Sep 5 16:51:28 1996 Jason Merrill + + * typeck.c (build_c_cast): Don't tack a non_lvalue_expr onto a + target_expr. + +Thu Sep 5 10:05:38 1996 Brendan Kehoe + + * cvt.c (convert_to_reference): Use %#T, not %#D, for error. + +Wed Sep 4 17:16:09 1996 Bob Manson + + * except.c (expand_start_try_stmts): Move to except.c in the backend. + (expand_end_try_stmts): Remove. + + * init.c (perform_member_init): Use add_partial_entry () instead + of directly manipulating lists. + (emit_base_init): Likewise. + +Wed Sep 4 12:14:36 1996 Mike Stump + + * except.c (expand_exception_blocks): Always make sure USE and + CLOBBER insns that came at the end still do, the backend relies + upon this. + +Wed Sep 4 07:44:48 1996 Jason Merrill + + * call.c (build_over_call): We can only use a TARGET_EXPR of the + right type. + +Tue Sep 3 19:26:05 1996 Jason Merrill + + * cvt.c (convert_to_reference): Revert last change, don't complain + about temp without target decl. + +Tue Sep 3 10:22:56 1996 Mike Stump + + * decl.c (grokdeclarator): Don't core dump when void() is given. + +Tue Sep 3 02:38:56 1996 Jason Merrill + + * decl.c (copy_args_p): Don't crash. + +Fri Aug 30 14:26:57 1996 Mike Stump + + * pt.c (tsubst): And support template args inside the exception + specification. + + * pt.c (tsubst): Add support for exception specifications in + template functions. + +Fri Aug 30 10:01:55 1996 Mike Stump + + * cp-tree.def (DECL_STMT): Eliminate the throw spec field, only 3 + fields now. + * cp-tree.h (start_decl): Eliminate the throw spec parameter. + (start_function): Likewise. + (start_method): Likewise. + (grokfield): Likewise. + (make_call_declarator): Add throw spec parameter. + (set_quals_and_spec): Add routine. + * lex.c (set_quals_and_spec): Likewise. + * decl.h (grokdeclarator): Eliminate the throw spec parameter. + * decl.c (shadow_tag): Eliminate the throw spec parameter to + grokdeclarator. + (groktypename): Likewise. + (start_decl): Eliminate the throw spec parameter. Eliminate the + throw spec parameter to grokdeclarator. Eliminate the throw spec + field in DECL_STMT. + (cp_finish_decl): Eliminate the throw spec field in DECL_STMT. + (grokfndecl): Remove useless set of raises. + (grokdeclarator): Eliminate the throw spec parameter. Eliminate + the throw spec parameter to start_decl. Pull the throw spec out + of the call declarator. + (grokparms): Eliminate the throw spec parameter to grokdeclarator. + (start_function): Eliminate the throw spec parameter. Eliminate + the throw spec parameter to grokdeclarator. + (start_method): Likewise. + * decl2.c (grokfield): Likewise. + (grokbitfield): Eliminate the throw spec parameter to grokdeclarator. + (grokoptypename): Likewise. + (finish_file): Eliminate the throw spec parameter to + start_function. Add throw spec to make_call_declarator. + * except.c (init_exception_processing): Add throw spec to + make_call_declarator. Eliminate the throw spec parameter to + start_decl. + (expand_start_catch_block): Eliminate the throw spec parameter to + grokdeclarator. + (expand_builtin_throw): Add throw spec to make_call_declarator. + Eliminate the throw spec parameter to start_function. + (start_anon_func): Likewise. + * lex.c (make_call_declarator): Add throw spec parameter. + (set_quals_and_spec): New routine. + (cons_up_default_function): Add throw spec to make_call_declarator. + Eliminate the throw spec parameter to grokfield. + * method.c (synthesize_method): Eliminate the throw spec parameter + to start_function. + * pt.c (process_template_parm): Eliminate the throw spec parameter + to grokdeclarator. + (tsubst): Add throw spec to make_call_declarator. + (tsubst_expr): Eliminate the throw spec parameter to start_decl. + (do_function_instantiation): Eliminate the throw spec parameter to + grokdeclarator. Eliminate the throw spec parameter to + start_function. + * rtti.c (synthesize_tinfo_fn): Eliminate the throw spec parameter + to start_function. + * parse.y (datadef): Remove non-winning optimization. + (decl): Likewise. + (fndef): Remove ambiguous error productions uncovered by grammar + fixing. + (constructor_declarator): Add exception_specification_opt here. + (component_constructor_declarator): Likewise. + (direct_after_type_declarator): Likewise. + (complex_direct_notype_declarator): Likewise. + (direct_abstract_declarator): Likewise. + (fn.def1): Remove exception_specification_opt. + (fn.def2): Likewise. + (condition): Likewise. + (initdcl0): Likewise. + (initdcl): Likewise. + (notype_initdcl0): Likewise. + (nomods_initdcl0): Likewise. + (component_decl_1): Likewise. + (component_declarator): Likewise. + (after_type_component_declarator0): Likewise. + (after_type_component_declarator): Likewise. + (notype_component_declarator): Likewise. + +Wed Aug 28 01:40:30 1996 Jason Merrill + + * call.c (build_over_call): Also use an INIT_EXPR when + initializing anything from an rvalue. + + * call.c (build_over_call): Call stabilize_reference when building + an INIT_EXPR instead of calling the copy ctor. + + * call.c (joust): Extend the previous change to all comparisons. + + * decl2.c, method.c, lex.c: Use MAKE_DECL_ONE_ONLY and + NO_LINKAGE_HEURISTICS. + + * decl2.c (finish_file): Emit any statics that weren't already. + + * typeck.c (build_static_cast): Implement. + * tree.c (build_cplus_new): Handle getting a TARGET_EXPR. + * decl.c (grokparms): Use can_convert_arg instead of + implicit_conversion directly. + (copy_args_p): New fn. + * cvt.c (convert_to_reference): Don't complain about temp with + static_cast. + (build_up_reference): Handle TARGET_EXPRs. + * call.c (build_over_call): Elide unnecessary temps. + (can_convert*): Use new overloading code. + +Tue Aug 27 13:12:21 1996 Jason Merrill + + * call.c: Move TYPE_PTR*_MACROS ... + * cp-tree.h: To here. + * typeck.c (build_reinterpret_cast): Implement. + + * call.c (add_builtin_candidate): Use TYPE_PTROB_P instead of + ptr_complete_ob. + (joust): If we're comparing a function to a builtin and the worst + conversion for the builtin is worse than the worst conversion for the + function, take the function. + + * typeck.c (build_const_cast): Implement. + (comp_ptr_ttypes_const): Like comp_ptr_ttypes, for const_cast. + (comp_ptr_ttypes_reinterpret): Like cpt, for reinterpret_cast. + +Tue Aug 27 13:14:58 1996 Bob Manson + + * rtti.c (build_dynamic_cast): Don't try to dereference exprtype + too early. Make sure we explode if exprtype turns out to be a + NULL_TREE when it shouldn't be. + +Tue Aug 27 10:56:21 1996 Mike Stump + + * cp-tree.h: New routine make_call_declarator. + * lex.c (make_call_declarator): Define it. + * except.c (init_exception_processing): Use it. + (expand_builtin_throw): Likewise. + (start_anon_func): Likewise. + * decl2.c (finish_file): Likewise. + * lex.c (cons_up_default_function): Likewise. + * parse.y: Likewise. + * pt.c (tsubst): Likewise. + +Mon Aug 26 17:40:03 1996 Mike Stump + + * decl2.c (groktypefield): Remove unused code. + +Mon Aug 26 17:00:33 1996 Mike Stump + + * gxx.gperf: Change TYPE_QUAL into CV_QUALIFIER. + * parse.y: Likewise. Change maybe_type_qual into maybe_cv_qualifier. + Change type_quals into cv_qualifiers. Change nonempty_type_quals into + nonempty_cv_qualifiers. + * hash.h: Rebuild. + + * lex.c (make_pointer_declarator): Change type_quals into + cv_qualifiers. + (make_reference_declarator): Likewise. + +Thu Aug 22 01:09:22 1996 Jason Merrill + + * decl.c (start_function): Only check interface_* for templates + with flag_alt_external_templates. + + * call.c (build_new_op): Check for comparison of different enum types. + (build_over_call): Fix arg # output. + + * typeck.c (build_component_ref): Handle pre-found TYPE_DECL. + +Wed Aug 21 00:13:15 1996 Jason Merrill + + * call.c (build_new_op): Check for erroneous args. + + * call.c (build_new_method_call): Add missing args to cp_error. + + * tree.c (error_type): Don't print reference-to-array. + + * typeck.c (convert_for_assignment): Don't say contravariance for + removing const. + +Tue Aug 20 13:23:00 1996 Jason Merrill + + * call.c (build_over_call): Diagnose bad convs for `this'. + + * lex.c (cons_up_default_function): Set DECL_ARTIFICIAL + on _ctor_arg. + + * call.c (convert_like): Handle bad convs. + (build_over_call): Handle bad convs better. + + * decl2.c: -fansi-overloading is now the default. + + * call.c (build_new_method_call): Check for erroneous args. + + * pt.c (instantiate_class_template): Propagate + TYPE_USES_MULTIPLE_INHERITANCE. + +Tue Aug 20 13:09:57 1996 Mike Stump + + * call.c (enforce_access): Add static to routine. + +Sun Aug 18 14:35:54 1996 Jason Merrill + + * call.c (build_user_type_conversion_1): Fix bad handling. + (compare_ics): Likewise. + +Sat Aug 17 21:54:11 1996 Jason Merrill + + * call.c (standard_conversion): Oops. + +Sat Aug 17 16:28:11 1996 Geoffrey Noer + + * g++.c: Update test for win32 (&& ! cygwin32). + +Sat Aug 17 03:45:31 1996 Jason Merrill + + * typeck.c (comp_ptr_ttypes_real): Handle OFFSET_TYPEs properly. + (ptr_reasonably_similar): New fn. + * call.c (BAD_RANK): New rank. + (ICS_BAD_FLAG): New macro. + (standard_conversion): Handle almost-right pointer conversions. + (reference_binding): Handle bad rvalue bindings. + (add_*_candidate): Stuff. + (build_over_call): Pass bad conversions to convert_for_initialization. + (compare_ics): Handle bad convs. + (joust): Likewise. + +Fri Aug 16 15:02:19 1996 Bob Manson + + * init.c (expand_vec_init): Use ptrdiff_type_node instead of + integer_type_node when computing pointer offsets. + +Fri Aug 16 01:28:32 1996 Jason Merrill + + * tree.c (lvalue_type): New fn. + (error_type): New fn. + * call.c (op_error): Use error_type. + (add_conv_candidate): Use lvalue_type. + (add_builtin_candidates): Likewise. + * error.c (args_as_string): Use error_type. + +Thu Aug 15 17:27:13 1996 Jason Merrill + + * pt.c (instantiate_decl): Evaluate DECL_INITIAL of a VAR_DECL here. + (tsubst): Not here. + + * decl.c (init_decl_processing): With -ansi, __null's type is the + signed integral type with the same number of bits as a pointer. + Introduce a new variable null_node for it. + * cp-tree.h: Adjust. + * call.c (null_ptr_cst_p): Adjust. + +Thu Aug 15 17:09:54 1996 Mike Stump + + * except.c (do_unwind): Mark %i7 as used on the SPARC so we can + optimize. + +Thu Aug 15 01:36:49 1996 Jason Merrill + + * decl2.c (import_export_decl): Ignore #pragma interface for tinfo + fns of classes without virtual functions. + + * call.c (add_function_candidate): Handle `this' specially. + (compare_ics): Likewise. + +Tue Aug 13 12:16:10 1996 Jason Merrill + + * typeck.c (build_conditional_expr): Fix handling of __null. + + * decl2.c (comdat_linkage): New fn. + (import_export_vtable): Use it. + (import_export_decl): Use it. + * method.c (make_thunk): Use it. + +Mon Aug 12 00:09:18 1996 Jason Merrill + + * pt.c (end_template_decl): If we don't actually have parms, return. + * parse.y (template_header): Accept 'template <>'. + + * errfn.c: Allow 5 args. + +Sun Aug 11 15:20:58 1996 Jason Merrill + + * tree.c (make_temp_vec): New fn. + * pt.c (push_template_decl): Handle partial specs. + (instantiate_class_template): Likewise. + (more_specialized): Use get_bindings. + (more_specialized_class): New fn. + (get_class_bindings): New fn. + (most_specialized_class): New fn. + (do_function_instantiation): List candidates for ambiguous case. + * decl.c (duplicate_decls): Lose reference to DECL_TEMPLATE_MEMBERS. + (shadow_tag): Call push_template_decl for partial specializations. + * parse.y: Likewise. + * cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Replaces + DECL_TEMPLATE_MEMBERS. + * call.c (print_z_candidates): Reduce duplication. + +Fri Aug 9 14:36:08 1996 Jason Merrill + + * decl2.c (lang_decode_option): Allow -fansi-overloading. + +Thu Aug 8 17:04:18 1996 Jason Merrill + + * pt.c (get_bindings): New fn. + (most_specialized): Likewise. + (do_function_instantiation): Use them. + (add_maybe_template): New fn. + * cp-tree.h (DECL_MAYBE_TEMPLATE): New macro. + * call.c (build_new_op): Handle guiding decls. + (build_new_function_call): Likewise. + * decl2.c (finish_file): Likewise. + + * decl2.c (mark_used): Do synthesis here. + * call.c (build_method_call): Not here. + (build_over_call): Or here. + * typeck.c (build_function_call_real): Or here. + * tree.c (bot_manip): Call mark_used on functions used in default + args. + +Thu Aug 8 17:48:16 1996 Michael Meissner + + * decl2.c (import_export_vtable): Delete code that disabled vtable + heuristic on systems with ASM_OUTPUT_EXTERNAL. + +Wed Aug 7 12:44:11 1996 Jason Merrill + + * typeck.c (build_x_function_call): Handle static call context + better. + + * decl.c (finish_function): Set the DECL_CONTEXT of the result to + the function, not its outer block. + + * call.c (build_field_call): Pass fields on to build_opfncall + regardless of TYPE_OVERLOADS_CALL_EXPR. + (build_method_call): Pass on to build_new_method_call sooner. + + * typeck.c (build_ptrmemfunc): Just return what instantiate_type + gives us. + * class.c (instantiate_type): Don't put a POINTER_TYPE to + METHOD_TYPE on an expression. Also make a copy of rhs instead of + modifying it. + +Tue Aug 6 12:58:46 1996 Jason Merrill + + * call.c (compare_ics): Handle qual_conv after lvalue_conv. + (add_builtin_candidate): Don't take enums for ++. + (build_new_method_call): Handle non-aggregates and field calls. + Move new overloading code from... + * cvt.c: Here. + + * decl.c (grokparms): Don't check default args in templates. + +Mon Aug 5 17:17:06 1996 Jason Merrill + + * cvt.c (build_new_op): Fix args to build_unary_op. + (add_builtin_candidates): Don't call type_promotes_to on float. + + * decl.c (grokparms): Check the type of the default arg. + + * cvt.c (build_new_op): Pass non-overloaded cases on rather than + returning NULL_TREE. + + * typeck.c (build_x_binary_op): Avoid doing extra work. + (build_x_unary_op): Likewise. + (build_x_conditional_expr): Likewise. + * cvt.c (build_over_call): Return. + (add_builtin_candidate): Fix MEMBER_REF. + (build_new_op): Likewise. + +Mon Aug 5 17:07:47 1996 Mike Stump + + * method.c (build_overload_name): Put bug fix into code but leave + disabled for now so we can be bug compatible with older releases + that do repeats incorrectly. In the future, we can enable it. + +Mon Aug 5 13:46:28 1996 Jason Merrill + + * cvt.c (convert_like): Don't call build_cplus_new twice. + + * call.c, cp-tree.h, cvt.c, decl2.c, init.c, method.c, pt.c, typeck.c: + Control new overloading code with -fansi-overloading. + +Sun Aug 4 15:29:11 1996 Jason Merrill + + * cvt.c (build_over_call): Call build_cplus_new. + * call.c (build_method_call): Likewise. + * typeck.c (build_function_call_real): Likewise. + (build_conditional_expr): If both operands are TARGET_EXPRs, wrap + the COND_EXPR in a TARGET_EXPR so they use the same slot. + + * cvt.c (build_up_reference): Propagate INDIRECT_BIND to + recursive calls. + * typeck.c (complete_type): Propagate + TYPE_NEEDS_{CONSTRUCTING,DESTRUCTOR}. + +Sat Aug 3 14:05:07 1996 Jason Merrill + + * cvt.c (joust): More ?: kludging. Sigh. + (build_over_call): Don't try to synthesize global fns. + + * search.c (lookup_conversions): Use binfo marking. + +Sat Aug 3 12:33:42 1996 Bob Manson + + * search.c (build_mi_matrix): Use the correct value of cid + when determining the new mi_size. + +Sat Aug 3 01:27:41 1996 Jason Merrill + + * cvt.c (add_builtin_candidates): Do consider type conversion ops + for the first parms of += et al. + (strip_top_quals): New fn. + (reference_binding): Use it instead of TYPE_MAIN_VARIANT. + (implicit_conversion): Likewise. + (add_builtin_candidates): Be careful about arrays. + (build_new_method_call): Handle vtable optimization. + +Fri Aug 2 01:26:59 1996 Jason Merrill + + * cp-tree.h (LOOKUP_NO_TEMP_BIND): New flag. + * cvt.c (reference_binding): Use it. + (implicit_conversion): Use it. + (add_builtin_candidate, COND_EXPR): Use it. + + * cvt.c (build_new_function_call): Check for error args. + + * typeck.c (comptypes): Just check DERIVED_FROM_P, not UNIQUELY. + + * gxx.gperf: Add __null. + * hash.h: Regenerate. + * lex.h: Add RID_NULL. + * lex.c (init_lex): Create null_pointer_node here, stick it in + RID_NULL. + * decl.c (init_decl_processing): Still set its type here. + * cvt.c (cp_convert_to_pointer): Don't produce null_pointer_node. + (convert_to_pointer_force): Likewise. + (null_ptr_cst_p): Check for null_pointer_node; only accept (void*)0 + if (! pedantic). + * call.c (convert_harshness): Use null_ptr_cst_p. + * typeck.c (convert_for_assignment): Likewise. Don't produce + null_pointer_node. + + * error.c (args_as_string): Handle lists of actual args, too. + * cvt.c (null_ptr_cst): Support (void*)0 for now. + (build_user_type_conversion_1): Improve diagnostics. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_method_call): Likewise. Move call before def diagnostic... + (build_over_call): Here. + + * cvt.c (build_new_method_call): Don't complain about no match if + LOOKUP_SPECULATIVELY. + (build_over_call): Fix 'this' for virtual fn. + (build_new_method_call): Add diagnostic. + +Thu Aug 1 16:45:09 1996 Jason Merrill + + * cvt.c (add_function_candidate): Expect 'this' and 'in_chrg' for + constructors to be passed in. + (build_over_call): Likewise. + (build_user_type_conversion_1): Pass them in. + (convert_like): Likewise. + (build_object_call): Handle overloaded conversions. + (build_over_call): Pass the right args to build_vfn_ref. + (standard_conversion): Fix pmf convs. + (joust): Handle comparing statics and non-statics. + (build_new_method_call): New fn. + * call.c (build_method_call): Call it if NEW_OVER. + +Thu Aug 1 16:06:14 1996 Mike Stump + + * lex.c (do_identifier): Don't use %O on IDENTIFIER_OPNAME_Ps, use + %D instead. + +Thu Aug 1 15:24:02 1996 Mike Stump + + * except.c (expand_throw): Use maybe_build_cleanup_and_delete + instead of just maybe_build_cleanup so that we deallocate the + thrown object. + +Thu Aug 1 15:18:00 1996 Brendan Kehoe + + * decl2.c (finish_prevtable_vardecl): Make non-static for pt.c's use. + * cp-tree.h (finish_prevtable_vardecl): Add decl. + +Thu Aug 1 11:53:51 1996 Bob Manson + + * pt.c (instantiate_class_template): Call complete_type. Also, if + we're at the end of the file and we just instantiated a template + class with a vtable, call finish_prevtable_vardecl. + + * error.c (dump_decl): Don't explode (or explode more gracefully + as appropriate) if the object being dumped has a null type. + (dump_expr): Likewise. + + * search.c (build_mi_matrix): Ensure that mi_size is large enough, + by counting the number of nodes that we'll need before allocating + the array. + (lookup_fnfields): Fix comment. + (breadth_first_search): Fix comment. + +Wed Jul 31 09:57:05 1996 Jason Merrill + + * pt.c (instantiate_class_template): Propagate TYPE_PACKED and + TYPE_ALIGN. + * class.c (finish_struct): Call cplus_decl_attributes here. + (finish_struct_1): Not here. + * cp-tree.h: Adjust. + + * pt.c (type_unification): New parameter STRICT. + (unify): If STRICT, don't allow cv addition or base deduction. + * call.c, class.c, cvt.c, cp-tree.h: Adjust. + +Tue Jul 30 13:06:13 1996 Jason Merrill + + * search.c (get_template_base{_recursive}): New fns. + * pt.c (more_specialized): New fn. + (do_function_instantiation): Use it. + (unify): Handle base deduction. + * cvt.c (joust): Use more_specialized. + Don't arbitrarily choose between non-builtin candidates. + (build_over_call): Call require_complete_type. + + * decl.c (start_function): Statics are static even in a #pragma + interface file. + + * decl2.c (import_export_vtable): Disable vtable heuristic on + systems with ASM_OUTPUT_EXTERNAL. + + * cvt.c (compare_ics): Fix comparison of PMEM_CONV and BASE_CONV. + (standard_conversion): No std conv to enum type. + + * cvt.c (standard_conversion): Fix order of args to DERIVED_FROM_P + for ptm's. + + * cvt.c (reference_binding): Bind directly to a base subobject of + a class rvalue. + + * cvt.c (build_new_op): Enforce access control. + +Tue Jul 30 09:22:53 1996 Bob Manson + + * typeck2.c (process_init_constructor): When scanning the + union for a named field, skip things that aren't FIELD_DECLs. + + * method.c (synthesize_method): Don't scan fndecl's rtl if + we're at the end of the file; just assume the function can't + be inlined. + +Mon Jul 29 15:48:30 1996 Jason Merrill + + * cvt.c (build_builtin_candidate): Stick a dummy conversion in if + it failed. + + * cvt.c (build_user_type_conversion_1): Handle overloaded + conversion ops. + + * cvt.c (add_builtin_candidates): Don't consider type conversion + operators for the first parameter of operator=. + +Mon Jul 29 15:33:55 1996 Bob Manson + + * typeck.c (complete_type): Only call layout_type if we're not + expanding a template. + +Mon Jul 29 14:40:38 1996 Jason Merrill + + * cvt.c (compare_ics): Oops. + + * cvt.c (op_error): Oops. + + * cp-tree.def: Add RVALUE_CONV, rename EXACT_CONV to IDENTITY_CONV. + * cvt.c: Add IDENTITY_RANK before others. Use real_lvalue_p. + (build_conv): Use them. + (implicit_conversion): Use them. + (convert_like): Handle them. + (build_new_op): Handle builtin COND_EXPR again. + (add_builtin_candidates): Strip cv-quals. Fix oops. Include enums + in lists of types for COND_EXPR. + (add_builtin_candidate): Add enum candidates for COND_EXPR. + +Mon Jul 29 12:05:40 1996 Bob Manson + + * typeck.c (build_modify_expr): Always attempt to build a call to + the assignment operator, even if we're using a default one. + (convert_for_initialization): Call complete_type. + +Mon Jul 29 11:25:08 1996 Jason Merrill + + * cvt.c (reference_binding): A REF_BIND gets the reference type. + (implicit_conversion): Likewise. + (convert_like): Likewise. + (compare_ics): Likewise. + (compare_qual): Likewise. + (print_z_candidates): Handle no candidates. + (build_new_op): Don't handle builtin COND_EXPR for now. + +Sat Jul 27 11:27:47 1996 Stan Shebs + + * cvt.c (build_builtin_candidate): Init local var in an ANSI way. + +Fri Jul 26 01:07:22 1996 Jason Merrill + + * cvt.c (joust): If the candidates are the same, arbitrarily pick one. + + * cvt.c (build_builtin_candidate): Oops. + (build_new_op): Oops. + + * method.c (build_opfncall): Pass COND_EXPR on. + * cvt.c (build_builtin_candidate): Reorganize, support COND_EXPR. + (add_builtin_candidate{,s}): Likewise. + (add_builtin_candidates): Likewise. + (print_z_candidates, op_error, build_new_op): Likewise. + (type_decays_to): New fn. + * lex.c (init_lex): Just say ?: for COND_EXPR. + +Thu Jul 25 09:33:33 1996 Jason Merrill + + * typeck.c (complete_type): Call layout_type rather than building + a new array type. + + * cvt.c (add_builtin_candidate): Pointer arithmetic candidates + only use ptrdiff_t. + +Wed Jul 24 12:45:08 1996 Jason Merrill + + * cvt.c: Always compile the new overloading code (but don't use it). + (implicit_conversion): Add a BASE_CONV when converting to + the same class type. + (convert_like): Handle BASE_CONV. + +Tue Jul 23 12:46:30 1996 Jason Merrill + + * cvt.c (build_new_op): Support {MAX,MIN}_EXPR. + (add_builtin_candidate): Likewise. + + NEW_OVER changes: + * typeck.c (build_x_function_call): Try an operator function + whenever we call an object of class type. + * method.c (build_opfncall): Pass CALL_EXPRs through. + * cvt.c (implicit_conversion): Do const-ref case first. + (add_conv_candidate, build_object_call, op_error): New fns. + (ptr_complete_ob, TYPE_PTROB_P): void is not an object type. + ({add,build}_builtin_candidate{,s}, print_z_candidates): Display + builtin candidates. + (build_new_op): Handle CALL_EXPR. Don't try to decay void. + Fall back on preincrement handling. Use op_error. + Handle warn_synth. + (convert_like): Pass INDIRECT_BIND. Don't try to do anything with + an error_mark_node. + (build_over_call): Handle PROMOTE_PROTOTYPES and ellipsis promotions + properly. + +Mon Jul 22 16:21:55 1996 Bob Manson + + * pt.c (tsubst_expr): Handle CONTINUE_STMT. + +Mon Jul 22 15:38:58 1996 Mike Stump + + * typeck.c (build_component_ref_1): Use build_component_ref + instead of open coding it here. + +Mon Jul 22 12:18:54 1996 Jason Merrill + + * g++.c (main): Don't link with -lg++. + + NEW_OVER changes: + * cvt.c (convert_to_reference): Don't use convert_from_reference on + result of build_type_conversion. + (cp_convert): Only call build_method_call for ctors if + build_type_conversion failed. + (ptr_complete_ob): New function. + (TYPE_PTR{,OB,MEM}_P): New macros. + ({add,build}_builtin_candidate{,s}): New functions. + (print_z_candidates): Handle builtins. + (build_user_type_conversion_1): Don't use conversion fns for + converting to a base type. + (build_user_type_conversion_1): Set ICS_USER_FLAG on AMBIG_CONVs. + (build_user_type_conversion): Use convert_from_reference. + (build_new_op): New function. + (build_over_call): Fix handling of methods. + (compare_ics): Handle AMBIG_CONV properly. + * typeck2.c: Increment abort count. + * method.c (build_opfncall): Forward most requests to build_new_op. + * cp-tree.h (IS_OVERLOAD_TYPE): Tweak. + +Fri Jul 19 17:59:29 1996 Brendan Kehoe + + * error.c (dump_expr, case CONSTRUCTOR, case CAST_EXPR): Take out + invalid second argument to dump_expr_list. + +Fri Jul 19 14:04:05 1996 Mike Stump + + * decl.c (lookup_name_real): Make sure we do obj->X::i correctly. + +Thu Jul 18 14:48:23 1996 Bob Manson + + * decl2.c (import_export_vtable): ASM_OUTPUT_EXTERNAL, not + ASSEMBLE_EXTERNAL. + +Mon Jul 15 17:48:43 1996 Mike Stump + + * typeck2.c (process_init_constructor): New pedwarn for using { } + to initialize a pointer to member function. + * typeck.c (build_ptrmemfunc1): Avoid use of digest_init so that + we can avoid the new error. + +Mon Jul 15 15:42:03 1996 Mike Stump + + * typeck.c (build_ptrmemfunc1): New function to hide details of + pointer to member functions better. + +Mon Jul 15 14:23:02 1996 Mike Stump + + * init.c (resolve_offset_ref): Resolve OFFSET_REFs that are + methods into the actual method, as we know the implied object is + not used. + +Mon Jul 15 13:08:29 1996 Brendan Kehoe + + * parse.y (maybecomma_warn): Only emit the pedwarn if we're not + inside a system header. + +Fri Jul 12 16:30:05 1996 Bob Manson + + * call.c (build_method_call): Call complete_type on the + instance type. + +Thu Jul 11 17:16:40 1996 Mike Stump + + * typeck.c (build_component_ref): Always build up an OFFSET_REF + for obj_ptr->func so that we can know which object to use in a + method call. + +Wed Jul 10 19:36:37 1996 Mike Stump + + * typeck.c (build_ptrmemfunc): Remove sorry, now we can cast + around things. Also improve maintainability. + +Wed Jul 10 18:20:11 1996 Bob Manson + + * decl.c (grokdeclarator): Check for overflow when evaluating an + array dimension. + +Wed Jul 10 17:26:19 1996 Jason Merrill + + * cvt.c (cp_convert): Don't check for ambiguity with constructor + if NEW_OVER. + + * typeck.c (build_x_function_call): Pass function overload + questions to new overloading code if NEW_OVER. + * init.c (expand_aggr_init_1): Only check for type conversion ops + if we're doing copy-initialization (i.e. LOOKUP_ONLYCONVERTING). + Don't check for ambiguity with constructor if NEW_OVER. + * cvt.c (convert_to_reference): Dereference the result of a type + conversion operator. + (build_conv): Propagate ICS_USER_FLAG. + (implicit_conversion): Call instantiate_type. + Pass LOOKUP_ONLYCONVERTING instead of LOOKUP_NORMAL. + (add_function_candidate): Fix cv-quals on argtype. + (print_z_candidates): New function. + (build_new_function_call): Call it. + (build_user_type_conversion_1): If LOOKUP_ONLYCONVERTING, don't + consider non-converting constructors. + Call print_z_candidates. + Return an AMBIG_CONV for an ambiguous conversion. + (build_user_type_conversion): Handle AMBIG_CONV. + (convert_like): Fix test for building TARGET_EXPR. + Call instantiate_type. + Handle AMBIG_CONV and LVALUE_CONV. + (build_over_call): Handle 0 args and ellipsis. + * cp-tree.def: Add AMBIG_CONV. + +Tue Jul 9 17:48:48 1996 Mike Stump + + * decl.c (lookup_name_real): If we find mem in obj when parsing + `obj->mem', make sure we return the right value. + +Tue Jul 9 16:11:28 1996 Bob Manson + + * search.c (get_base_distance): Call complete_type. + +Tue Jul 9 12:46:34 1996 Mike Stump + + * decl.c (store_bindings): Make static. + +Mon Jul 8 16:42:31 1996 Jason Merrill + + * init.c (expand_aggr_init_1): Don't check type conversions if + NEW_OVER. + + * cvt.c (z_candidate): Put back template field. + (add_function_candidate): Set it. + (add_template_candidate): Likewise. + (joust): Use it. + (compare_qual): Handle references and pointers to members. + (compare_ics): Handle reference bindings. + + * decl.c (duplicate_decls): Propagate DECL_ONE_ONLY. + +Mon Jul 8 16:18:56 1996 Bob Manson + + * call.c (compute_conversion_costs): Call complete_type. + + * tree.c (vec_binfo_member): Use comptypes instead of comparing + pointers, so we can handle template parameters. + +Fri Jul 5 16:51:53 1996 Bob Manson + + * cvt.c (cp_convert_to_pointer): We have to call complete_type + here; let's make it explicit instead of a side effect of an + error check. + +Wed Jul 3 16:29:51 1996 Jason Merrill + + * cvt.c (z_candidate): Remove template field. + (reference_binding): Handle binding to temporary. + (implicit_conversion): Likewise. + (add_function_candidate): Handle artificial constructor parms. + Handle functions with too few parms. + (add_template_candidate): New function. + (build_user_type_conversion_1): Handle constructors. + (convert_like): Likewise. + (build_over_call): Likewise. + (build_new_function_call): Support templates. + (compare_ics): Fix reference, inheritance handling. + +Mon Jul 1 22:58:18 1996 Bob Manson + + * decl.c: Add signed_size_zero_node. + (init_decl_processing): Build it. + * class.c (prepare_fresh_vtable): Use it instead of size_zero_node + when we're trying to make a negative delta. + +Mon Jul 1 17:56:19 1996 Brendan Kehoe + + Stop doing this damn index==strchr variable name confusion. + * class.c (add_virtual_function): Change local var INDEX to be + named IDX. + (add_method): Likewise. + * lex.c (print_parse_statistics): Likewise. + * search.c (make_memoized_table_entry): Likewise. + (lookup_fnfields_here): Likewise. + (lookup_field): Likewise. + (lookup_fnfields): Likewise. + (get_baselinks): Likewise. + * sig.c (build_signature_table_constructor): Likewise. + (build_signature_method_call): Likewise. + * typeck.c (build_x_array_ref): Change INDEX parm to be named IDX. + (get_member_function_from_ptrfunc): Likewise. + (build_ptrmemfunc): Change local var INDEX to be IDX. + (c_expand_start_case): Likewise. + +Sat Jun 29 14:05:46 1996 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Move user-defined type conversion + handling to before extraction of TYPE_PTRMEMFUNC_FN_TYPE. + (convert_to_reference): Use build_type_conversion to convert to + the reference type directly. + (standard_conversion): Fix void* case, non-conversions. + (reference_binding): Fix expr == 0 case, non-conversions. + (convert_like): Support REF_BIND. + (compare_qual): Split out from compare_ics. + (compare_ics): Use it, handle icses with only a qual_conv. + + * init.c (expand_vec_init): Don't crash if decl is NULL. + +Fri Jun 28 11:52:51 1996 Stan Shebs + + * mpw-config.in: New file, configury for Mac MPW. + * mpw-make.sed: New file, makefile editing for MPW. + +Thu Jun 27 15:18:30 1996 Jason Merrill + + * pt.c (instantiate_class_template): Call repo_template_used. + + * search.c (lookup_conversions): Only lookup conversions in + complete types. + +Thu Jun 27 12:59:53 1996 Brendan Kehoe + + * cp-tree.def: Renamed from tree.def, to avoid confusion with + gcc's tree.def. + * cp-tree.h, lex.c: Include cp-tree.def. + * Makefile.in (CXX_TREE_H): Reference cp-tree.def. + +Wed Jun 26 18:29:47 1996 Bob Manson + + * init.c (build_vec_delete_1): Call complete_type. + +Mon Jun 24 17:17:32 1996 Mike Stump + + * except.c (start_anon_func): Make sure anonymous functions are + never external. + +Fri Jun 21 15:10:58 1996 Jason Merrill + + * decl.c (finish_function): If function_depth > 1, set nested. + + * decl2.c (grokbitfield): Revert Bob's change. + * class.c (finish_struct_1): Fix handling of named bitfield widths. + +Thu Jun 20 23:35:38 1996 Jason Merrill + + * pt.c (add_pending_template): Handle types. + (lookup_template_class): With -fexternal-templates, just add the class + to pending_templates instead of instantiating it now. + * decl2.c (finish_file): Handle types in pending_templates. + +Thu Jun 20 14:08:40 1996 Bob Manson + + * decl2.c (grokbitfield): Handle constant decls appropriately. + Give an appropriate error message now instead of spewing core + later. + +Thu Jun 20 13:01:51 1996 Jason Merrill + + * decl2.c: Don't turn on thunks by default for now. + +Wed Jun 19 11:37:04 1996 Jason Merrill + + * typeck.c (complete_type): Handle error_mark_node. + (common_type, OFFSET_TYPE): Handle template_type_parms. + +Tue Jun 18 10:02:15 1996 Jason Merrill + + * pt.c (instantiate_decl): If at_eof, call import_export_decl + regardless of DECL_INLINE. + + * typeck.c (mark_addressable): Set TREE_ADDRESSABLE on CONSTRUCTORs. + + * class.c (finish_struct_bits): Copy TYPE_SIZE. + + * rtti.c (build_dynamic_cast): Support templates. + * tree.def: Support DYNAMIC_CAST_EXPR. + * pt.c (tsubst_copy): Likewise. + * decl2.c (build_expr_from_tree): Likewise. + +Mon Jun 17 15:23:36 1996 Jason Merrill + + * typeck.c (build_static_cast): Support templates. + (build_const_cast): Likewise. + * tree.def: Support CONST/STATIC_CAST_EXPR. + * pt.c (tsubst_copy): Likewise. + * decl2.c (build_expr_from_tree): Likewise. + +Sun Jun 16 12:33:57 1996 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Don't trust + TREE_SYMBOL_REFERENCED for vtables of local classes. + +Fri Jun 14 18:13:36 1996 Jason Merrill + + * pt.c (tsubst_copy): Handle operator T. + +Wed Jun 12 17:52:40 1996 Brendan Kehoe + + * init.c (build_delete): Move creation of PARMS inside test of + TYPE_HAS_DESTRUCTOR, since it's never used outside of that block. + +Tue Jun 11 15:09:18 1996 Bob Manson + + * typeck.c (build_conditional_expr): Don't assume that + the arguments to ?: are always pointers or records. + +Tue Jun 11 13:56:23 1996 Jason Merrill + + * decl2.c (import_export_decl): Still emit static/weak/comdat + copies of inline template functions with -fno-implicit-templates. + +Tue Jun 11 11:42:13 1996 Bob Manson + + * init.c (build_delete): Determine the complete basetype + path to the destructor we're calling. + +Fri Jun 7 15:30:10 1996 Bob Manson + + * decl.c (build_enumerator): Always copy the INTEGER_CST used to + initialize the enum, because we really and truly don't know where + it came from. + (start_enum): Don't copy integer_zero_node because + build_enumerator will do it. + +Fri Jun 7 11:11:09 1996 Jason Merrill + + * decl.c (finish_function): Do access control on base destructors. + + * pt.c (tsubst, case FUNCTION_DECL): Set up + IDENTIFIER_GLOBAL_VALUE for member functions so pushdecl doesn't + hose us. + +Fri Jun 7 10:37:33 1996 Mike Stump + + * cvt.c (build_up_reference): If we have already extended the + lifetime of the temporary, don't try it again. + * typeck.c (c_expand_return): Don't try and convert the return + value twice when we want a reference, once is enough. + +Tue Jun 4 15:41:45 1996 Jason Merrill + + * pt.c (tsubst_expr, case DECL_STMT): Don't pass + LOOKUP_ONLYCONVERTING at all for now. + + * search.c (add_conversions): Put the conversion function in + TREE_VALUE, the basetype in TREE_PURPOSE. + * cvt.c (build_type_conversion): Adjust. + * cvt.c (build_expr_type_conversion): Adjust. + * call.c (user_harshness): Adjust. + +Mon Jun 3 15:30:52 1996 Jason Merrill + + * method.c (emit_thunk): Pretend this is a FUNCTION_DECL for the + backend's benefit. + +Mon Jun 10 18:58:19 1996 Mike Stump + + * except.c (expand_start_catch_block): Add a dummy region, if we + get an error, so that we can avoid core dumping later. + +Fri May 31 14:56:13 1996 Mike Stump + + * cp-tree.h (OFFSET_REF): Remove. + * tree.def (CP_OFFSET_REF): Rename to OFFSET_REF. + * expr.c (cplus_expand_expr): Cleanup callers of expand_expr. + * init.c (expand_aggr_init_1): Likewise. + (build_new): Likewise. + * typeck.c (expand_target_expr): Likewise. + +Fri May 31 14:22:08 1996 Jason Merrill + + * typeck.c (build_modify_expr): Don't use TREE_VALUE on a + TARGET_EXPR. + +Wed May 29 17:04:33 1996 Mike Stump + + * cvt.c (build_up_reference): Redo how and when temporaries are + created. + * decl.c (grok_reference_init): Don't try and be smart about + running cleanups. + +Wed May 29 16:02:08 1996 Mike Stump + + * cvt.c (build_up_reference): Add NULL_TREE to all calls to build + (TARGET_EXPR...), now that it has 4 arguments. + * tree.c (build_cplus_new): Likewise. + +Thu May 23 16:40:30 1996 Jason Merrill + + * error.c (dump_expr, case CAST_EXPR): Handle T() properly. + + * pt.c (instantiate_decl): Don't call push/pop_cp_function_context. + * decl.c (struct saved_scope): Remove named_labels, + {base,member}_init_list. + (maybe_push_to_top_level): Don't set them. Call + push_cp_function_context if appropriate. + (pop_from_top_level): Likewise. + + * method.c (do_build_assign_ref): Remove obsolete check of + TYPE_HAS_ASSIGN_REF (basetype). + + * decl.c (grokfndecl): Diagnose user definition of + implicitly-declared methods. + +Thu May 23 12:13:08 1996 Bob Manson + + * method.c (do_build_copy_constructor): Add code to give + meaningful error messages instead of crashing. + (do_build_assign_ref): Don't synthesize assignment operators for + classes containing reference or const members. + + * class.c (struct base_info): Remove cant_synth_copy_ctor + and cant_synth_asn_ref. + (finish_base_struct): Remove the code that tries to conditionalize + synthesis of copy constructors & assignment operators based on + access permissions. Instead, let it fail when it tries to + synthesize the copy constructor. This will give meaningful error + messages instead of silently generating code to perform a bitcopy. + +Wed May 22 11:45:19 1996 Bob Manson + + * lex.c (real_yylex): Remove old-n-crufty #if 0 code for + determining types for constant values. + + * decl.c (struct named_label_list): Use instead of stuffing + random items into a TREE_LIST node. + (named_label_uses): Use the new struct. + (poplevel): Likewise. + (lookup_label): Likewise. + (define_label): Add an error message to tell the user the line + where the goto is located in addition to the destination of the + goto. + (init_decl_processing): Use NULL instead of NULL_TREE to initialize + named_label_uses. + (finish_function): Likewise. + + (start_decl): Complain about defining a static data member + in a different type from which it was declared. + +Wed May 22 09:33:23 1996 Jason Merrill + + * cvt.c (build_expr_type_conversion): Adjust. + +Tue May 21 11:21:56 1996 Jason Merrill + + * call.c (build_method_call): Always convert 'this' to the + appropriate type. + + * search.c (add_conversions): Put the conversion function in + TREE_VALUE, the type in TREE_PURPOSE. + * cvt.c (build_type_conversion): Adjust. + * call.c (user_harshness): Adjust. + + * method.c (emit_thunk): Call temporary_allocation and + permanent_allocation around the ASM_OUTPUT_MI_THUNK case, too. + + * tree.c (build_cplus_array_type): Handle tweaking of + TYPE_MAIN_VARIANT here. + * typeck.c (common_type): Not here. + + * typeck.c (complete_type): Only try to complete an array type if + it has a domain. + +Mon May 20 14:55:59 1996 Jason Merrill + + * decl.c (grokvardecl): Call complete_type. + (grokdeclarator): Call complete_type for PARM_DECLs. + +Fri May 17 16:41:17 1996 Jason Merrill + + * pt.c (instantiate_class_template): Re-set + CLASSTYPE_GOT_SEMICOLON after calling finish_struct_1. + +Fri May 17 14:56:55 1996 Mike Stump + + * cp-tree.h (cp_expand_decl_cleanup): Remove, the backend is now + smart enough to do it right. + * tree.c (cp_expand_decl_cleanup): Likewise. + * decl.c (cp_finish_decl): Use expand_decl_cleanup instead of + cp_expand_decl_cleanup. + (store_parm_decls): Likewise. + (hack_incomplete_structures): Likewise. + * except.c (push_eh_cleanup): Likewise. + +Fri May 17 13:13:51 1996 Mike Stump + + * expr.c (expand_expr, cond UNSAVE_EXPR): Move from the C++ + frontend to the backend where it belongs. + * tree.c (unsave_expr): Likewise. + (unsave_expr_now): Likewise. + * tree.def (UNSAVE_EXPR): Likewise. + * cp-tree.h (unsave_expr): Likewise. + (unsave_expr_now): Likewise. + +Fri May 17 11:02:41 1996 Mike Stump + + * init.c (emit_base_init): Make sure the partial EH cleanups live + on the function_obstack. + +Thu May 16 15:29:33 1996 Bob Manson + + * expr.c (do_case): Don't try to dereference null TREE_TYPEs + when checking for pointer types. + +Thu May 16 13:38:58 1996 Jason Merrill + + * pt.c (instantiate_class_template): Remove obsolete check for + access declarations. + +Thu May 16 13:34:15 1996 Mike Stump + + * call.c (build_overload_call): Simplify calls to + build_overload_call by removing last parameter. + (build_method_call): Likewise. + * cp-tree.h: Likewise. + * method.c (build_opfncall): Likewise. + * typeck.c (build_x_function_call): Likewise. + +Thu May 16 13:15:43 1996 Mike Stump + + * call.c (default_parm_conversions): Factor out common code. + (build_method_call): Use it. + (build_overload_call_real): Use it. + +Wed May 15 14:46:14 1996 Mike Stump + + * call.c (build_method_call): Allow implicit & on METHOD_TYPEs, + but pedwarn as the code is bogus. + * typeck.c (decay_conversion): Likewise. + (build_function_call_real): Use build_addr_func instead of + default_conversion. Don't allow pointer-to-method functions down + here. + (build_unary_op): Use real pointer-to-member functions instead of + fake ones. + (build_ptrmemfunc): Use build_addr_func instead of build_unary_op. + (convert_for_assignment): Removed some obsolete code. + * decl2.c (reparse_absdcl_as_expr): Pass current_class_ref to + build_x_function_call instead of current_class_ptr. Only call + digest_init once on an initializer, we do this just checking + TREE_TYPE. + (build_expr_from_tree): Pass current_class_ref to + build_x_function_call instead of current_class_ptr. + * init.c (build_member_call): Likewise. + * pase.y: Likewise. + * error.c (dump_expr): Handle OFFSET_REFs better. + * pt.c (unify): Handle pointer-to-member functions better. + * decl.c (finish_function): Clear out current_class_ref just like + we do for current_class_ptr. + + * typeck.c (get_delta_difference): Handle virtual bases better. + +Tue May 14 16:37:37 1996 Jason Merrill + + * sig.c (build_signature_table_constructor): Use the delta for + the original basetype for this virtual function with thunks. + (build_signature_method_call): We still need to adjust 'this' + with thunks. + +Tue May 14 16:27:25 1996 Mike Stump + + * call.c (build_addr_func): New routine. Used to get the `real' + address of a function or a method. Needed to avoid getting a + pointer-to-member function. + (build_call): New routine to build CALL_EXPRs. + (build_method_call): Use it. + * cvt.c (convert_to_aggr): Likewise. + * typeck.c (build_function_call_real): Likewise. + * sig.c (build_signature_table_constructor): Use build_addr_func. + * cp-tree.h (build_call, build_addr_func): Declare them. + +Tue May 14 12:47:47 1996 Mike Stump + + * cp-tree.h (LOOKUP_AGGR): Remove, unused. + * parse.y: Remove uses of LOOKUP_AGGR. + +Tue May 14 12:07:51 1996 Mike Stump + + * *.[chy]: Rename current_class_decl to current_class_ptr, and + C_C_D to current_class_ref. + +Mon May 13 16:55:23 1996 Jason Merrill + + * call.c (convert_harshness): Tighten up pointer conversions. + +Sat May 11 04:33:50 1996 Doug Evans + + * decl2.c (finish_vtable_vardecl): Surround DECL_ONE_ONLY with ifdef. + (finish_file): Likewise. + +Fri May 10 11:09:57 1996 Jason Merrill + + * cvt.c (convert_fn_ptr): We don't use thunks for pmfs. + + * method.c (emit_thunk): Set flag_omit_frame_pointer in default + code. + +Thu May 9 18:18:30 1996 Jason Merrill + + * decl2.c: Turn on thunks by default where supported. + +Tue May 7 20:39:57 1996 Mike Stump + + * cp-tree.h (build_overload_call_maybe): Removed. + * call.c (build_overload_call_real): Invert meaning of last arg to + be require_complete. + (build_overload_call): Likewise. + * typeck.c (build_x_function_call): Use build_overload_call_real + instead of build_overload_call_maybe. + +Mon May 6 01:23:32 1996 Jason Merrill + + * decl2.c (finish_file): Don't try to emit functions that haven't + been compiled. + +Fri May 3 09:30:13 1996 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Oops. + + * decl.c (maybe_push_to_top_level): Do save previous_class_*. + Also store the bindings from previous_class_values. + (pop_from_top_level): Restore them. + +Thu May 2 21:56:49 1996 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Only write out vtable if its + symbol has been referenced. + (finish_file): Re-join synthesis/vtable loop with inline emission + loop, disable inlining when an inline is output. + +Thu May 2 17:20:02 1996 Mike Stump + + * except.c (init_exception_processing): Setup saved_in_catch. + (push_eh_cleanup): Reset __eh_in_catch. + (expand_start_catch_block): Set __eh_in_catch. + +Thu May 2 16:21:17 1996 Mike Stump + + * except.c (push_eh_cleanup): Add tracking for whether or not we + have an active exception object. + (expand_builtin_throw): Use it to make sure a rethrow without an + exception object is caught. + +Thu May 2 11:26:41 1996 Jason Merrill + + * decl.c (maybe_push_to_top_level): Clear out class-level bindings + cache. + +Wed May 1 11:26:52 1996 Jason Merrill + + * decl2.c (finish_file): Also use sentries for vars with + DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be + created). + + * lex.c (handle_cp_pragma): Disable #pragma + interface/implementation if SUPPORTS_ONE_ONLY > 1. + +Tue Apr 30 11:25:46 1996 Jason Merrill + + * method.c (emit_thunk): Wrap default case in + temporary/permanent_allocation. + + * method.c (make_thunk): Use DECL_ONE_ONLY. + (emit_thunk): Call assemble_end_function. + +Mon Apr 29 15:38:29 1996 Jason Merrill + + * decl2.c (import_export_vtable): Use DECL_ONE_ONLY. + (import_export_decl): Likewise. + (finish_prevtable_vardecl): Disable vtable hack if + SUPPORTS_ONE_ONLY > 1. + +Mon Apr 29 14:32:47 1996 Mike Stump + + * typeck.c (build_modify_expr): PREINCREMENT_EXPR and + PREDECREMENT_EXPRs take two arguments, not one. + +Mon Apr 29 00:27:53 1996 Jason Merrill + + * class.c (build_vtable_entry): Don't build thunks for abstract + virtuals. + + * lex.c (real_yylex): Fix handling of __PRETTY_FUNCTION__ like C + frontend. + +Sat Apr 27 16:45:35 1996 Jason Merrill + + * class.c (set_rtti_entry): Use size_zero_node. + (build_vtable): Likewise. + +Sat Apr 27 14:48:57 1996 Jason Merrill + + * class.c (finish_struct_1): Pass size_zero_node to set_rtti_entry. + (prepare_fresh_vtable): Likewise. + +Fri Apr 26 13:14:14 1996 Jason Merrill + + * method.c (emit_thunk): Call mark_used on the target function. + + * call.c (build_method_call): Don't warn about pending templates. + +Thu Apr 25 14:55:44 1996 Jason Merrill + + * decl2.c (finish_file): Fix list walking logic. + + * typeck2.c (check_for_new_type): Only warn if -pedantic. + +Wed Apr 24 15:41:15 1996 Bob Manson + + * class.c (finish_struct_1): Remove old code for + dont_allow_type_definitions. + * cp-tree.h: Likewise. + * spew.c: Make sure cp-tree.h is included before parse.h, so the + definition of flagged_type_tree is found before it is used. + * lex.c: Likewise. + * parse.y: Added the ftype member to the type union, and changed a + number of rules to use it instead of ttype. Added calls to + check_for_new_type() as appropriate. + * typeck2.c (check_for_new_type): New function for checking + if a newly defined type appears in the specified tree. + * cp-tree.h: Add new type flagged_type_tree. Add a prototype + for check_for_new_type(). + +Wed Apr 24 00:36:21 1996 Jason Merrill + + * decl2.c (finish_file): Only use a sentry if the decl is public. + + * pt.c (tsubst_expr, DECL_STMT): If we don't have an initializer, + don't pass LOOKUP_ONLYCONVERTING. + +Tue Apr 23 17:18:47 1996 Bob Manson + + * typeck.c (common_type): Fix the ARRAY_TYPE case so it + properly keeps track of const and volatile type modifiers. + +Tue Apr 23 10:52:56 1996 Jason Merrill + + * tree.c (cp_tree_equal): C++ version of simple_cst_equal. + * pt.c (comp_template_args): Use it. + + * rtti.c (get_tinfo_fn, build_dynamic_cast, expand_*_desc): Call + assemble_external for artificial function decls. + + * decl.c (cp_finish_decl): Oops. + +Mon Apr 22 17:28:27 1996 Jason Merrill + + * decl2.c (import_export_decl): Put static data member templates + into common storage, or make them weak, depending on whether they + are dynamically or statically initialized. + (get_sentry): New function. + (finish_file): Do import_export_decl for static data members before + building the init/fini functions. Don't init/fini a variable that's + EXTERNAL. Use a sentry for variables in common. Fix mismatching + push/pop_temp_slots. + * decl.c (cp_finish_decl): If DECL_NOT_REALLY_EXTERN, do the + expand_static_init thang. + * method.c (get_id_2): New function. + +Mon Apr 22 15:32:45 1996 Bob Manson + + * parse.y (empty_parms): Make sure we use C++-style prototypes + when we're declaring member functions. + +Sun Apr 21 10:08:22 1996 Jason Merrill + + * Makefile.in (CONFLICTS): 16 s/r conflicts. + * parse.y (self_template_type): New nonterminal. + +Thu Apr 18 08:56:54 1996 Jason Merrill + + * decl.c (make_typename_type): Handle getting a TYPE_DECL for a + name. + * parse.y (base_class.1): Allow 'typename foo::bar'. + + * lex.c (check_newline): Remove #pragma code that plays with the + input stream, since we now deal with tokens. Clear nextchar when + we're done. + (handle_cp_pragma): Use real_yylex. + (handle_sysv_pragma): Don't do skipline here. Only call real_yylex + in one place. + + * lex.c (check_for_missing_semicolon): Handle SELFNAME. + + * lex.c (handle_cp_pragma): Fix "#pragma implementation". + +Wed Apr 17 16:51:33 1996 Jason Merrill + + * parse.y: New token SELFNAME for potential constructor. + * spew.c (yylex): Handle it. + * lex.c (identifier_type): Produce it. + + * parse.y (complete_type_name): In :: case, don't push class binding. + (complex_type_name): Likewise. + +Wed Apr 17 15:02:40 1996 Mike Stump + + * typeck.c (build_reinterpret_cast): Handle pointer to member + functions. + +Wed Apr 17 12:28:26 1996 Brendan Kehoe + + * lex.c (handle_cp_pragma): New function, with decl, doing the cc1plus + pragmas. + (check_newline): Put the vtable/unit/implementation/interface pragma + code into handle_cp_pragma, replacing it with a call. + (handle_sysv_pragma): Give int return type, and take FINPUT and TOKEN + args. Get the next token after handling the pragma token. + +Wed Apr 17 10:28:34 1996 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Avoid doing base analysis on pmfs. + (convert_to_pointer_force): Likewise. + + * init.c (build_new): Fix array new without -fcheck-new. + +Tue Apr 16 13:44:58 1996 Jason Merrill + + * cp-tree.h, call.c, class.c, decl.c, parse.y, pt.c, rtti.c, + tree.c: Lose TYPE_NESTED_NAME. + + * parse.y (nested_name_specifier_1): Don't treat non-identifiers + as identifiers. + + * tree.def: Add VEC_INIT_EXPR. + * expr.c (cplus_expand_expr): Handle it. + * init.c (build_new): Use it instead of the RTL_EXPR nastiness and + the extra file-scope symbol nastiness. + +Mon Apr 15 16:21:29 1996 Jason Merrill + + * method.c (make_thunk): Thunks are static. + (emit_thunk): Use ASM_OUTPUT_MI_THUNK if it's defined. + + * decl2.c (mark_vtable_entries): Emit thunks as needed. + (finish_file): Don't emit them here. + +Sun Apr 14 11:34:39 1996 Jason Merrill + + * rtti.c (build_dynamic_cast): Handle null pointers. + (ifnonnull): New function. + +Fri Apr 12 09:08:27 1996 Bob Manson + + * call.c (build_method_call): Remember the original basetype we + were called with. Give an error message instead of trying + (incorrectly) to call a non-static member function through a + non-inherited class. + + * search.c (expand_upcast_fixups): Mark the new fixup as + DECL_ARTIFICIAL. + +Thu Apr 11 03:57:09 1996 Jason Merrill + + * init.c (build_new): Use a TARGET_EXPR for alloc_expr. + + * class.c (set_rtti_entry): Fix for thunks. + + * decl2.c (import_export_decl): Still emit typeinfo fns for + cv-variants of builtin types. + + * rtti.c (expand_class_desc): Set up base_info_type_node here. + (init_rtti_processing): Instead of here. + +Wed Apr 10 14:17:13 1996 Jason Merrill + + * rtti.c (init_rtti_processing): Do init regardless of -frtti. + (build_typeid): Only complain about taking dynamic typeid without + -frtti. + + * decl2.c: flag_rtti defaults to 1. + + * rtti.c (get_tinfo_var): The general class case is now smaller. + (init_rtti_processing): Pack the latter three fields of base_info + into 32 bits. + +Wed Apr 10 13:50:14 1996 Mike Stump + + * init.c (expand_member_init): Don't dump if name is NULL_TREE. + +Wed Apr 10 12:56:02 1996 Mike Stump + + * search.c (make_memoized_table_entry): Undefer the pop, if necessary. + (push_memoized_context): Split out code to undefer pop_type_level to + (clear_memoized_cache): here. + (pop_memoized_context): We can only handle one layer of deferral of + pop_type_level so clear the cache, if there was a previous level. + +Tue Apr 9 23:06:09 1996 Jason Merrill + + * rtti.c (init_rtti_processing): Build up base_info_type_node. + (expand_class_desc): Use one pointer to an array of base_info + structs, passed using a CONSTRUCTOR. + +Tue Apr 9 14:20:57 1996 Mike Stump + + * class.c (build_vbase_path): Remove block extern for + flag_assume_nonnull_objects here. + (build_vfn_ref): Split out functionality into build_vtbl_ref. + (build_vtbl_ref): New routine. + (build_vtable): Set up rtti info here. + (add_virtual_function): Note in CLASSTYPE_RTTI the best + place where we can get the rtti pointers from to avoid having to + search around for a place. + (finish_base_struct): Likewise. + (finish_struct_1): Likewise. Never create totally new vtables + with totally new vtable pointers for rtti. Disable code to layout + vtable pointers better until we want to break binary + compatibility. + * rtti.c (build_headof_sub): New routine to convert down to a + sub-object that has an rtti pointer in the vtable. + (build_headof): Use it. Also, use build_vtbl_ref now to be more + maintainable. + (build_dynamic_cast): Make sure we have saved it, if we need to. + * search.c (dfs_init_vbase_pointers): Disable code that deals with + a more efficient vtable layout, enable later. + * call.c (flag_assume_nonnull_objects): Moved declaration to + * cp-tree.h: here. Declare build_vtbl_ref. + * pt.c (instantiate_class_template): Use NULL_TREE instead of 0 in + function calls that want a tree. + +Tue Apr 9 12:10:26 1996 Jason Merrill + + * rtti.c (build_dynamic_cast): Handle downcasting to X* given + other X subobjects in the most derived type. Ack. + + * rtti.c (build_dynamic_cast): No need to strip cv-quals here, + get_typeid will do it for us. + (get_typeid_1): Break out call-building for expand_*_desc to use. + (get_typeid): Call it. + (expand_*_desc): Likewise. + * decl.c (init_decl_processing): Don't set TYPE_BUILT_IN on char * + and void *. + (init_decl_processing): Lose builtin_type_tdescs lossage. + * decl2.c (finish_vtable_vardecl): Remove obsolete code. + +Mon Apr 8 17:23:23 1996 Bob Manson + + * pt.c (tsubst): When calling set_nested_typename, use + TYPE_NESTED_NAME (current_class_type) instead of + current_class_name. + + * decl.c (pushdecl): Likewise. + (pushdecl_class_level): Likewise. + (grokdeclarator): Use NULL_TREE instead of 0 in the call to + set_nested_typename. + +Sun Apr 7 10:44:31 1996 Jason Merrill + + * rtti.c (synthesize_tinfo_fn): Handle arrays. + + * cp-tree.h (DECL_REALLY_EXTERN): New macro. + +Sat Apr 6 13:56:27 1996 Jason Merrill + + * rtti.c (throw_bad_cast): Use entry point __throw_bad_cast. + (init_rtti_processing): Lose bad_cast_type. + (build_dynamic_cast): Use throw_bad_cast. + + * rtti.c (synthesize_tinfo_fn): Handle enums and pmfs. + + * decl2.c (finish_file): Don't synthesize artificial functions + that are external and not inline. + + * rtti.c (get_tinfo_fn): If at_eof, call import_export_decl. + + * decl2.c (finish_file): Handle having new inlines added to + saved_inlines by synthesis. + + * rtti.c (get_bad_cast_node): Don't require . + +Fri Apr 5 17:02:09 1996 Jason Merrill + + RTTI rewrite to initialize nodes as needed, not require that + users #include , complete functionality and reduce wasted + space. + * rtti.c (init_rtti_processing): New fn. + (build_typeid): The vtable entry is now a function. + (get_tinfo_var): New fn. + (get_tinfo_fn): Likewise. + (get_typeid): Use it. + (build_dynamic_cast): Declare and use entry point __dynamic_cast. + (build_*_desc): Rename to expand_*_desc and rewrite to use entry + points __rtti_*. + (add_uninstantiated_desc, get_def_to_follow, build_t_desc): Lose. + (synthesize_tinfo_fn): New fn. + * method.c (build_t_desc_overload): Lose. + (build_overload_with_type): More generic. + * decl.c (init_decl_processing): Call init_rtti_processing. + * class.c (set_rtti_entry): Use get_tinfo_fn. + * decl2.c (mark_vtable_entries): Mark the rtti function. + (finish_prevtable_vardecl): Don't build_t_desc. + (import_export_decl): Handle tinfo functions. + (finish_file): Likewise. + * typeck.c (inline_conversion): New fn. + (build_function_call_real): Use it. + * cp-tree.h: Add decls. + + * method.c (hack_identifier): Also convert component_refs from + references. + + * lex.c (cons_up_default_function): Use the type, not the name, in + declspecs. + + * decl2.c (import_export_vtable): Fix weak vtables. + +Fri Apr 5 13:30:17 1996 Bob Manson + + * search.c (get_base_distance_recursive): Fix access checks for + protected bases. + +Fri Apr 5 11:02:06 1996 Brendan Kehoe + + * call.c (unary_complex_lvalue): Delete unneeded decl, it's in + cp-tree.h. + (convert_harshness): Add prototypes wrapped by PROTO. + * decl2.c (grok_function_init): Likewise. + (do_toplevel_using_decl): Change to void return type. + * class.c (build_vtable_entry): Remove decl of make_thunk. + (merge_overrides): Fix order of arg definitions. + (finish_vtbls): Likewise. + (fixup_vtable_deltas): Likewise. + (modify_all_direct_vtables): Likewise. + (modify_all_indirect_vtables): Likewise. + * search.c (get_base_distance_recursive): Likewise. + (get_abstract_virtuals_1): Likewise. + (fixup_virtual_upcast_offsets): Likewise. + (lookup_fnfields_1): Add prototypes wrapped by PROTO. + * init.c (perform_member_init): Fix order of arg definitions. + (expand_aggr_init_1): Add prototypes wrapped by PROTO. + * cp-tree.h (make_thunk): Add decl. + (overload_template_name, push_template_decl): Add decls. + (do_toplevel_using_decl): Change to void return type. + (vec_binfo_member): Add decl. + +Thu Apr 4 13:33:10 1996 Brendan Kehoe + + * typeck.c (mark_addressable, convert_for_assignment, + convert_for_initialization, pointer_int_sum, pointer_diff, + unary_complex_lvalue): Add prototypes wrapped by PROTO. + (convert_sequence): #if 0 fn decl, since definition also is. + +Thu Apr 4 11:00:53 1996 Mike Stump + + * rtti.c (build_dynamic_cast): Make sure we strip qualifiers on + cast to pointer types for type searching. + +Wed Apr 3 17:10:57 1996 Brendan Kehoe + + * typeck.c (get_delta_difference): Use cp_error, not error, in the + case where BINFO == 0. + +Wed Apr 3 12:01:02 1996 Mike Stump + + * call.c (build_method_call): Fix wording of error messages so + constructors come out right. + +Tue Apr 2 16:06:59 1996 Bob Manson + + * decl.c (push_overloaded_decl): Don't warn about hidden + constructors when both the type and the function are declared + in a system header file. + +Mon Apr 1 09:03:13 1996 Bob Manson + + * class.c (finish_struct_1): Propagate the TYPE_PACKED + flag for the type to the type's fields. + +Sat Mar 30 12:14:33 1996 Brendan Kehoe + + * parse.y (complex_parmlist, ELLIPSES): Take out ARM-based warning. + +Fri Mar 29 15:51:36 1996 Bob Manson + + * class.c (base_info, finish_base_struct): Replace + needs_virtual_dtor with base_has_virtual. + + (finish_struct_1): Remove the old code that tried to make default + destructors virtual. Use base_has_virtual when checking if we need + to add a vtable entry for the rtti code. + +Fri Mar 29 14:02:36 1996 Jason Merrill + + * pt.c (push_template_decl): Complain about template decl with + inappropriate declaration. + +Fri Mar 29 12:15:35 1996 Bob Manson + + * typeck.c (build_x_unary_op): Remove bogus check for taking + the address of a member function. + +Fri Mar 29 11:56:02 1996 Jason Merrill + + * parse.y (constructor_declarator): Only push the class if + we are not already in the class. + +Fri Mar 29 09:41:02 1996 Jeffrey A. Law + + * method.c (emit_thunk): Remove current_call_is_indirect nonsense. + Add additional argument to INIT_CUMULATIVE_ARGS. + +Thu Mar 28 16:41:39 1996 Jason Merrill + + * decl.c (shadow_tag): Fix error about anon union with methods. + + * parse.y (self_reference): Only generate a self-reference if this + is a non-template class. + (opt.component_decl_list): Only use it if it was generated. + + * parse.y (component_decl_1): Use constructor_declarator. + (fn.def2): Likewise. + (notype_component_declarator0): Likewise. + +Thu Mar 28 15:11:35 1996 Bob Manson + + * typeck.c (build_x_unary_op): Add checks for taking the address + of a TARGET_EXPR or of a member function, and give appropriate + warnings. + +Thu Mar 28 14:49:26 1996 Jason Merrill + + * pt.c (process_template_parm): Allow template type parms to be + used as types for template const parms. + +Wed Mar 27 15:51:19 1996 Mike Stump + + * init.c (expand_vec_init): Ensure the eh cleanups are on the + function_obstack. + +Wed Mar 27 10:14:30 1996 Jason Merrill + + * decl.c (lookup_name_real): Be even more picky about the + ambiguous lookup warning. + (grokdeclarator): Tweak SCOPE_REF constructor declarators here. + * parse.y (constructor_declarator): Rather than here. + + * parse.y (constructor_declarator): New nonterminal. + (fn.def1): Use it. + (explicit_instantiation): Likewise. + +Tue Mar 26 13:41:33 1996 Jason Merrill + + Add implicit declaration of class name at class scope. + * decl.c (lookup_name_real): Restrict pedwarn about ambiguous lookup. + * parse.y (self_reference): New nonterminal. + (opt.component_decl_list): Use it. + (fn.def1): Add nested_name_specifier type_name cases. + * class.c (build_self_reference): New function. + (finish_struct): Handle access_default later, move self-reference + decl to the end. + * pt.c (lookup_template_class): Handle getting a TYPE_DECL. + * cp-tree.h: Adjust. + + * pt.c (do_function_instantiation): Separate handling of member + functions and non-member functions properly. + +Mon Mar 25 14:23:22 1996 Jason Merrill + + * pt.c (process_template_parm): Improve error for 'volatile class K'. + + * class.c (finish_struct_1): Check the right slot for destructors. + + * decl.c (start_enum): Complain about enum templates. + +Mon Mar 25 13:25:31 1996 Mike Stump + + * init.c (resolve_offset_ref): Offset pointers to member data by one. + * typeck.c (unary_complex_lvalue): Likewise. + +Mon Mar 25 13:30:42 1996 Bob Manson + + * typeck.c (c_expand_return): Check for a returned local + array name, similar to the check for an ADDR_EXPR. + +Mon Mar 25 13:07:19 1996 Jason Merrill + + * decl.c (cp_finish_decl): Don't build cleanups for static + variables here. + +Fri Mar 22 17:57:55 1996 Mike Stump + + * typeck.c (build_modify_expr): Fix error messages to be more + accurate. + * cp-tree.h (assop_as_string): Parallel to op_as_string, but for + assignment operators. + * error.c (assop_as_string): Likewise. Add support for `%Q' for + assignment operators. + +Fri Mar 22 13:48:29 1996 Jason Merrill + + * decl.c (grokdeclarator): Call bad_specifiers for typedefs. Also + give an error if initialized. pedwarn about nested type with the + same name as its enclosing class. + + * pt.c (tsubst, case TYPE_DECL): Set DECL_CONTEXT. + + * typeck.c (require_complete_type): Be sure to instantiate the + MAIN_VARIANT of the type. + + * decl2.c (finish_file): Instantiate pending templates before + processing static constructors and destructors. + + * pt.c (instantiate_decl): Don't instantiate functions at toplevel + unless at_eof. + +Fri Mar 22 09:30:17 1996 Bob Manson + + * decl2.c (delete_sanity): If error_mark_node is passed + in as an expression, quit while we're ahead. + + * decl.c (grokdeclarator): Give an error message if `friend' + is combined with any storage class specifiers. + +Wed Mar 20 14:51:55 1996 Jason Merrill + + * parse.y (named_complex_class_head_sans_basetype): Don't crash on + definition of nonexistent nested type. + + * error.c (dump_decl, case TYPE_DECL): Fix decision for whether or + not to say 'typedef'. + +Wed Mar 20 00:11:47 1996 Brendan Kehoe + + * cp-tree.h (struct lang_type): Make search_slot a tree, not a char*. + * search.c (dfs_walk, dfs_init_vbase_pointers, + expand_upcast_fixups): Remove cast of CLASSTYPE_SEARCH_SLOT. + (dfs_find_vbases): Remove cast for CLASSTYPE_SEARCH_SLOT init. + +Tue Mar 19 17:56:03 1996 Jason Merrill + + * except.c (build_throw): Support minimal parse. + * pt.c (tsubst_copy): Support THROW_EXPR. + * decl2.c (build_expr_from_tree): Likewise. + + * pt.c (mangle_class_name_for_template): Always allocate + scratch_firstobj. + +Tue Mar 19 16:34:31 1996 Bob Manson + + * cvt.c (cp_convert_to_pointer): Give an appropriate error + when trying to cast from an incomplete type. + +Tue Mar 19 16:00:33 1996 Jason Merrill + + * pt.c (instantiate_class_template): Don't bother setting up + CLASSTYPE_TAGS explicitly, as the nested types will add + themselves. + +Tue Mar 19 15:48:43 1996 Bob Manson + + * decl.c (shadow_tag): Remove old error check for usage of + an enum without a previous declaration. + (xref_tag): Add error message about usage of enums without a + previous declaration. + +Tue Mar 19 09:21:35 1996 Jason Merrill + + * lex.c (do_identifier): Only do name consistency check if we're + parsing. + + * pt.c (push_template_decl): Don't crash if we get a member defn + that doesn't match. + + * decl.c (xref_tag_from_type): New function to do an xref without + always having to figure out code_type_node. + * cp-tree.h: Declare it. + * pt.c (instantiate_class_template): Use it for friend classes. + (lookup_template_class): Use it. + + * typeck2.c (build_functional_cast): Pull out a single parm before + passing it to build_c_cast. + +Tue Mar 19 09:07:15 1996 Bob Manson + + * expr.c (do_case): Give an error message if a pointer is + given as a case value. + +Mon Mar 18 21:57:54 1996 Jason Merrill + + * typeck.c (build_c_cast): Don't pull single TEMPLATE_DECL out of + an overload list. + + * lex.c (cons_up_default_function): Really, now, interface hackery + does not apply to synthesized methods. + +Mon Mar 18 18:20:57 1996 Mike Stump + + * call.c (build_method_call): Ctors and dtors now have special names + with respect to lookups. + * class.c (add_method): Likewise. + (grow_method): Likewise. + (finish_struct_methods): Likewise. + (warn_hidden): Likewise. + (finish_struct_1): Likewise. + * cvt.c (convert_to_reference): Likewise. + (convert_to_aggr): Likewise. + (cp_convert): Likewise. + * decl2.c (check_classfn): Likewise. + * init.c (expand_member_init): Likewise. + (expand_default_init): Likewise. + (expand_aggr_init_1): Likewise. + (build_offset_ref): Likewise. + (build_new): Likewise. + (build_delete): Likewise. + * lex.c (do_inline_function_hair): Likewise. + * search.c (lookup_field_1): Likewise. + (lookup_fnfields_here): Likewise. + (lookup_field): Likewise. + (lookup_fnfields): Likewise. + (get_virtual_destructor): Likewise. + (dfs_debug_mark): Likewise. + (dfs_pushdecls): Likewise. + (dfs_compress_decls): Likewise. + * tree.c (layout_basetypes): Likewise. + * typeck.c (build_component_ref): Likewise. + (build_x_function_call): Likewise. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + (build_functional_cast): Likewise. + * cp-tree.h (CLASSTYPE_FIRST_CONVERSION): Likewise. + (CTOR_NAME): New. + (DTOR_NAME): New. + * decl.c (ctor_identifier): New. + (dtor_identifier): New. + (init_decl_processing): Set them. + +Mon Mar 18 18:00:51 1996 Mike Stump + + * typeck.c (build_component_ref): Don't get confused by fields whose + context has no type name, like pointer to member functions. + +Mon Mar 18 13:19:03 1996 Jason Merrill + + * decl.c (grokdeclarator): Handle typedef without declarator. + + * pt.c (tsubst): Handle SCOPE_REF in declarator. + + * parse.y (bad_parm): Catch another case of missing `typename'. + + * lex.c (yyprint): Handle TYPE_DECLs. + + * decl.c (start_function): Don't try to be clever. + + * lex.c: Lose compiler_error_with_decl. + * typeck2.c: Lose error_with_aggr_type. + (incomplete_type_error): Use cp_* instead of old functions. + (readonly_error): Likewise. + * typeck.c (convert_arguments): Likewise. + * search.c (lookup_nested_field): Likewise. + * method.c (make_thunk): Likewise. + * decl.c (grokparms): Likewise. + * cp-tree.h: Update. + + * tree.c (min_tree_cons): Call copy_to_permanent for the purpose + and value. + +Mon Mar 18 11:25:52 1996 Bob Manson + + * method.c (build_opfncall): When deleting a pointer to an + array, build a new pointer to the tree past any ARRAY_TYPE + nodes. + +Mon Mar 18 10:11:46 1996 Brendan Kehoe + + * decl.c (lookup_name_real): Initialize local var TYPE to NULL_TREE. + +Fri Mar 15 11:03:57 1996 Jason Merrill + + * pt.c (instantiate_decl): Only call import_export_decl if at_eof + and ! DECL_INLINE. + + * decl.c (finish_function): Don't set nested based on + hack_decl_function_context. + * parse.y (function_try_block): Check for nested function. + (pending_inlines): Likewise. + + * decl2.c (build_expr_from_tree): If a unary op already has a + type, just return it. + + * decl2.c (finish_prevtable_vardecl): Use ADJUST_VTABLE_LINKAGE. + + * decl2.c (walk_vtables): vardecl_fn returns int; return 1 if it does. + (finish_file): Check the return value of walk_vtables. + (finish_prevtable_vardecl): Return int. + (finish_vtable_vardecl): Likewise. + (prune_vtable_vardecl): Likewise. + * lex.c (set_vardecl_interface_info): Likewise. + * cp-tree.h: Adjust return types. + + * class.c (delete_duplicate_fields_1): Don't complain about + duplicate nested types if they're the same type. + (finish_struct): Remove check for duplicate. + * decl2.c (grokfield): Don't check for typedef of anonymous type. + +Thu Mar 14 10:00:19 1996 Jason Merrill + + * cp-tree.h: Lose SIGNATURE_GROKKING_TYPEDEF. + + * decl.c (grokdeclarator): Lose special handling of class-level + typedef. Lose SIGNATURE_GROKKING_TYPEDEF. Set + SIGNATURE_HAS_OPAQUE_TYPEDECLS later. + + * cvt.c (convert_pointer_to_real): Retain cv-quals in conversion. + + * pt.c (tsubst_copy): Strip cv-quals from destructor name types. + + * search.c (compute_access): Fix handling of anonymous union + members. + * class.c (finish_struct_anon): Propagate TREE_{PRIVATE,PROTECTED} + from anonymous unions to their members. + + * typeck.c (build_x_function_call): For static member functions, + hand off to build_member_call. + +Wed Mar 13 14:03:34 1996 Jason Merrill + + * typeck.c (build_component_ref): Handle OFFSET_REFs. + + * init.c (expand_vec_init): Fix init == 0 case. + +Tue Mar 12 14:36:02 1996 Jason Merrill + + * init.c (build_new): pedwarn about init and array new. + (expand_vec_init): Handle lists, use convert_for_initialization. + + * typeck.c (convert_for_initialization): Pass LOOKUP_NO_CONVERSION + when converting to an aggregate type. + * cvt.c (cp_convert): Pass it through. + + * typeck.c (build_conditional_expr): Handle user-defined + conversions to slightly different types. + + * decl.c (grokdeclarator): Force an array type in a parm to be + permanent. + + * decl2.c (do_using_directive): Sorry. + (do_namespace_alias): Likewise. + * lex.c (real_yylex): Warn about using the `namespace' keyword. + +Sun Mar 10 22:26:09 1996 Jason Merrill + + * parse.y (datadef): Move call to note_list_got_semicolon up. + +Fri Mar 8 11:47:26 1996 Mike Stump + + * tree.c (unsave_expr): Don't unsave, UNSAVE_EXPRs. + +Fri Mar 8 11:29:06 1996 Mike Stump + + * decl.c (cp_finish_decl): The exception regions have to be + nested, not overlapping. We start the exception region for a + decl, after it has been fully built, and all temporaries for it + have been cleaned up. + +Thu Mar 7 17:46:06 1996 Mike Stump + + * tree.c (vec_binfo_member): Don't core dump if we have no bases. + +Thu Mar 7 14:11:49 1996 Jason Merrill + + * tree.def: Add RETURN_INIT. + * pt.c (instantiate_decl): Handle RETURN_INIT. + * decl.c (store_return_init): Handle minimal_parse_mode. + + * tree.c (cp_build_type_variant): Just return an error_mark_node. + * decl.c (make_typename_type): Don't try to get the file and line + of an identifier. + * typeck.c (comptypes): Handle TYPENAME_TYPE. + +Wed Mar 6 18:47:50 1996 Per Bothner + + * decl.c (poplevel): Make sure we clear out and restore old local + non-VAR_DECL values by default when they go out of scope. + +Wed Mar 6 09:57:36 1996 Jason Merrill + + * method.c (build_overload_value): Use DECL_ASSEMBLER_NAME in + referring to addresses of variables and functions. + + * error.c (dump_expr): Support SIZEOF_EXPR. + + * init.c (do_friend): Use the return value of check_classfn. + + * typeck.c (convert_arguments): Call complete_type. + + * method.c (hack_identifier): After giving an error, set value to + error_mark_node. + +Tue Mar 5 16:00:15 1996 Jason Merrill + + * tree.c (hack_decl_function_context): Kludge around DECL_CONTEXT + lossage for local classes. + * cp-tree.h: Declare it. + * decl.c (lookup_name_real): Evil, painful hack for local classes. + (grokfndecl): Set DECL_CLASS_CONTEXT and DECL_NO_STATIC_CHAIN here. + Use hack_decl_function_context. + (grokdeclarator): Don't set DECL_NO_STATIC_CHAIN here. + (start_function): Use hack_decl_function_context. + (finish_function): Likewise. + * method.c (synthesize_method): Likewise. + * lex.c (process_next_inline): Likewise. + (do_pending_inlines): Likewise. + * decl2.c (finish_file): Unset DECL_STATIC_FUNCTION_P when we're + done with it. + +Mon Mar 4 22:38:39 1996 Gerald Baumgartner + + * sig.c (build_signature_pointer_or_reference_type): Align + signature pointers/references on 8-byte boundaries so they can be + grabbed 2 words at a time on a SPARC. + +Tue Mar 5 10:21:01 1996 Jason Merrill + + * method.c (hack_identifier): Requiring a static chain is now a + hard error. + * decl.c (grokdeclarator): Set DECL_NO_STATIC_CHAIN on nested + functions. + +Mon Mar 4 20:03:33 1996 Jason Merrill + + * init.c (build_offset_ref): Call complete_type. + + * decl.c (pop_from_top_level): Always pop previous_class_type. + + * parse.y: Handle multiple decls in a for-init-statement. + * pt.c (tsubst_expr): Likewise. + + * pt.c (tsubst): Use tsubst_expr for the second operand of an + ARRAY_REF. + + * decl.c (maybe_push_to_top_level): Don't save previous_class_type. + (poplevel_class): Set it here. + (pop_from_top_level): Pop it here if we're returning to class scope. + * class.c (pushclass): Don't set it here. + + * decl.c (maybe_push_to_top_level): Save current_template_parms, + and clear it if !pseudo. + (pop_from_top_level): Restore it. + + * decl2.c (finish_file): Push the dummy each time we walk the list + of vtables. + + * error.c (dump_expr): Support LOOKUP_EXPR and actually do + something for CAST_EXPR. + +Mon Feb 19 14:49:18 1996 Rusty Russell + + * cvt.c (cp_convert): Warn about implicit conversion of the + address of a function to bool, as it is always true. + +Fri Feb 23 23:06:01 1996 Rusty Russell + + * typeck.c (c_expand_return): Fix warning for local externs returned. + +Mon Mar 4 15:03:11 1996 Jason Merrill + + * tree.c (mapcar): Propagate const and volatile properly. + + * typeck.c (complete_type): Be sure to instantiate the + MAIN_VARIANT of the type. + + * method.c (synthesize_method): Class interface hackery does not + apply to synthesized methods. + +Mon Mar 4 14:05:23 1996 Jason Merrill + + * pt.c (comp_template_args): Use comptypes rather than just + checking for TEMPLATE_TYPE_PARM equivalence. + + * typeck.c (build_x_function_call): Call complete_type before + checking TYPE_OVERLOADS_CALL_EXPR. + +Mon Mar 4 18:48:30 1996 Manfred Hollstein + + * g++.c (main): Check also for new define ALT_LIBM. + +Fri Mar 1 13:09:33 1996 Jason Merrill + + * pt.c (instantiate_class_template): If we don't have a pattern + yet, that's OK. + (coerce_template_parms): If we see a local class, bail. + + * decl.c (grok_reference_init): Make sure there's a type before + checking its code. + + * pt.c (do_function_instantiation): Avoid crashing on invalid decls. + (push_template_decl): Likewise. + + * parse.y (named_class_head): Set + CLASSTYPE_TEMPLATE_SPECIALIZATION here if we have basetypes. + + * decl.c (xref_tag): Diagnose redeclaration of template + type-parameter name. + + * error.c (dump_type): Handle anonymous template type parms. + + * pt.c (instantiate_template): Use TYPE_MAIN_DECL instead of + TYPE_STUB_DECL. + (coerce_template_parms): Likewise. + +Thu Feb 29 16:26:01 1996 Mike Stump + + * class.c (instantiate_type, case {ARRAY,INDIRECT}_REF, + case ADDR_EXPR): Don't modify rhs if a subinstantiation fails. + +Thu Feb 29 08:20:25 1996 Jason Merrill + + * pt.c (instantiate_template): Take the MAIN_VARIANT of the type + before trying to get its STUB_DECL. + (coerce_template_parms): Likewise. + + * parse.y (template_type_parm): If they didn't use 'class', + pretend they did after giving an error. + + * pt.c (coerce_template_parms): Diagnose use of local class. + + * decl.c (grok_reference_init): Use instantiate_type. + + * error.c (dump_expr): Handle TEMPLATE_DECLs. + + * parse.y (named_class_head): Diagnose mismatching types and tags. + + * decl.c (pushdecl): Type decls and class templates clash with + artificial type decls, not hide them. + + * decl.c (redeclaration_error_message): Diagnose redefinition of + templates properly. + (duplicate_decls): Diagnose disallowed overloads for template + functions, too. + + * decl.c (start_decl): Call complete_type before checking for a + destructor. + + * pt.c (tsubst): Use tsubst_expr on the elts of a VEC. + + * decl.c (xref_tag): A TEMPLATE_TYPE_PARM is a match. + +Wed Feb 28 09:28:44 1996 Jason Merrill + + * decl.c (grok_op_properties): Don't check for operator++(int) in + a template. + + * tree.c (perm_manip): Return a copy of variable and function + decls with external linkage. + + * tree.def: Change some of the min tree codes to type "1". + * pt.c (uses_template_parms): Handle 'e's, return 1 for LOOKUP_EXPRs. + * method.c (build_overload_int): Emit something arbitrary for + anything but an INTEGER_CST if we're in a template. + + * decl.c (cp_finish_decl): Call complete_type before deciding + whether or not to lay out the decl. + + * lex.c (do_identifier): Check for DECL_INITIAL before using it. + +Tue Feb 27 16:35:32 1996 Jason Merrill + + * typeck2.c (build_x_arrow): Call complete_type. + + * pt.c (add_pending_template): Broken out. + (lookup_template_class): If -fexternal-templates, call it for all + the methods of implemented types. + (instantiate_class_template): Instead of instantiating them here. + (instantiate_decl): Handle -fexternal-templates earlier. + +Tue Feb 27 15:51:32 1996 Brendan Kehoe + + * search.c, lex.c, decl.c, class.c, cp-tree.h: Don't wrap the + memoized lookup stuff inside GATHER_STATISTICS. + +Tue Feb 27 10:38:08 1996 Jason Merrill + + * decl.c (start_decl): Complain about array of incomplete type + here. + (grokdeclarator): Not here. + + * parse.y (template_parm): Expand full_parm inline so we can set + the rule's precedence. + + * pt.c (tsubst_expr): If we're in a template, just do tsubst_copy. + (tsubst): tsubst_expr the DECL_INITIAL of FIELD_DECLs. + * decl2.c (grokbitfield): Don't check for integer constant here. + * class.c (finish_struct_1): Check here. + + * decl.c (define_label): Make the min decl go on permanent_obstack. + + * pt.c (unify): Don't handle CONST_DECLs. + (uses_template_parms): Don't check DECL_INITIAL on a CONST_DECL. + (tsubst_copy): Likewise. + + * lex.c (do_identifier): Do pull the DECL_INITIAL out of a + CONST_DECL for a template parm. + +Mon Feb 26 12:48:18 1996 Jason Merrill + + * decl.c (grokdeclarator): Complain about array of incomplete type + here. + (start_decl_1): Not here. + + * pt.c (tsubst): Handle pointer-to-function declarators. + + * method.c (hack_identifier): If pedantic, diagnose local class + methods that require a static chain. + + * decl.c (grok_op_properties): No longer static. + * cp-tree.h: Declare it. + * pt.c (tsubst): Call it for operators. + Use tsubst_copy for TREE_VECs. + + * parse.y (template_arg): The expr has precedence like '>'. + +Fri Feb 23 14:51:52 1996 Jason Merrill + + * pt.c (coerce_template_parms): Don't coerce an expression using + template parms. + (uses_template_parms): Also check DECL_INITIAL in CONST_DECLs. + (tsubst): Don't use build_index_2_type if the max_value uses template + parms. + * method.c (build_overload_int): Emit something arbitrary for an + expression using template parms. + + * parse.y (template_close_bracket): New non-terminal to catch use + of '>>' instead of '> >' in template class names. + (template_type): Use it. + * Makefile.in (CONFLICTS): Causes one more r/r conflict. + + * tree.def: Add CAST_EXPR. + * typeck2.c (build_functional_cast): Use CAST_EXPR instead of + CONVERT_EXPR for minimal_parse_mode. + * typeck.c (build_c_cast): Likewise. + * pt.c (tsubst_copy): Likewise. + * decl2.c (build_expr_from_tree): Likewise. + * error.c (dump_expr): Likewise. + +Fri Feb 23 10:36:46 1996 Brendan Kehoe + + * except.c (SetTerminate, SetUnexpected): Put back global vars. + (init_exception_processing): Put back decl/init of + set_unexpected_fndecl and set_terminate_fndecl, needed to get the + fns from libstdc++. + + * decl.c (struct binding_level): Delete ACCEPT_ANY bitfield. + (declare_uninstantiated_type_level, uninstantiated_type_level_p): + Delete unused fns. + * cp-tree.h (declare_uninstantiated_type_level, + uninstantiated_type_level_p): Delete prototypes. + +Thu Feb 22 19:36:15 1996 Jason Merrill + + * pt.c (tsubst_expr): Add default return. + +Thu Feb 22 16:47:24 1996 Brendan Kehoe + + * error.c (fndecl_as_string): Delete unused arg CNAME. + * sig.c (build_signature_table_constructor, + build_signature_method_call): Fix calls. + + * class.c (the_null_vtable_entry): Delete var definition. + (init_class_processing): Delete tree the_null_vtable_entry init. + * decl.c (no_print_{functions, builtins}): Declare as static. + (__tp_desc_type_node): #if 0 var definition. + (init_type_desc): #if 0 init of __tp_desc_type_node. + (vb_off_identifier): Move var decl into init_decl_processing. + (current_function_assigns_this): Declare as static. + (int_ftype_ptr_ptr_int, void_ftype_ptr_int_int): Delete var decls. + (init_decl_processing): Delete init of void_ftype_ptr_ptr_int. + Move decls of string_ftype_ptr_ptr and int_ftype_string_string here. + * decl2.c (delete_sanity): Delete definition/mod of local var ELT_SIZE. + * init.c (BI_header_type, BI_header_size): Declare as static. + * pt.c (template_classes): Delete unused var. + (add_pending_template): Delete decl for non-existent fn. + (lookup_template_class): Delete vars CODE and TAG_CODE. + (instantiate_template): Delete unused var TARGS. + * cp-tree.h (vb_off_identifier, current_function_assigns_this): + Delete decls. + (__tp_desc_type_node): #if 0 var decl. + (fndecl_as_string): Fix prototype. + +Thu Feb 22 15:56:19 1996 Jason Merrill + + * tree.def: Add GOTO_STMT. + * pt.c (tsubst_expr): Support goto and labels. + * decl.c (define_label): Support minimal parsing. + * parse.y (simple_stmt): Likewise. + +Thu Feb 22 15:30:12 1996 Brendan Kehoe + + * xref.c (GNU_xref_member): Only define/set var I if + XREF_SHORT_MEMBER_NAMES is defined, to match when it's actually + used. + (GNU_xref_end_scope): Delete unused fifth arg TRNS. + (GNU_xref_end): Fix call. + * decl.c (poplevel, poplevel_class, finish_method): Fix calls. + * cp-tree.h (GNU_xref_end_scope): Fix prototype. + + * tree.c (build_exception_variant): Delete unused vars I, A, T, + T2, and CNAME. + (layout_vbasetypes): Delete unused var NONVIRTUAL_VAR_SIZE. + (mapcar): Delete unused var CODE. + (build_cplus_new): Delete unused arg WITH_CLEANUP_P. + (break_out_cleanups): Fix call. + (bot_manip): Likewise. + * call.c (build_method_call): Likewise. + * cvt.c (build_up_reference, convert_to_reference, cp_convert): + Likewise. + * typeck.c (unary_complex_lvalue, build_modify_expr, + convert_for_initialization): Likewise. + * typeck2.c (build_functional_cast): Likewise. + * cp-tree.h (build_cplus_new): Fix prototype. + + * repo.c (open_repo_file): Delete unused var Q. + (repo_compile_flags, repo_template_declared, + repo_template_defined, repo_class_defined, repo_inline_used, + repo_vtable_used, repo_tinfo_used): #if 0 unused fns. + (repo_get_id, repo_vtable_used): Declare as static. + * cp-tree.h (mark_{decl,class}_instantiated, finish_repo): Add + prototypes. + +Thu Feb 22 14:53:35 1996 Jason Merrill + + * parse.y (pending_inlines): Add function_try_block case. + + * pt.c (unify): Fix for template const parms. + +Thu Feb 22 13:24:15 1996 Brendan Kehoe + + * lex.c (extract_interface_info): Delete forward decl. + (default_copy_constructor_body, default_assign_ref_body): Delete + decls for non-existent functions. + (synth_firstobj, inline_text_firstobjs): Delete unused vars. + (init_lex): Delete setting them. + (cons_up_default_function): Delete unused vars FUNC_BUF, + FUNC_LEN, and COMPLEX. Delete code setting COMPLEX. Delete old + #if 0'd synth code. + (toplevel, expression_obstack): Delete unused extern decls. + (tree_node_kind): Delete unused enum. + (tree_node_counts, tree_node_sizes): Wrap with #ifdef + GATHER_STATISTICS. + (tree_node_kind_names): Delete unused extern decl. + (synth_obstack): Delete unused var. + (init_lex): Don't set it. + (init_parse): Add decl before use. + (reduce_count): Only define #ifdef GATHER_STATISTICS && REDUCE_LENGTH. + (current_unit_{name, language}): Delete unused vars. + (check_newline): Don't bother setting them, just accept the #pragma. + * cp-tree.h (init_repo, peek_yylex): Add prototypes. + (current_unit_{name, language}): Delete decls. + + * search.c: Wrap all of the memoized functions, macros, and + variables inside #ifdef GATHER_STATISTICS. + (lookup_field, lookup_fnfields): Likewise. + (init_search_processing): Likewise. + (reinit_search_statistics): Wrap whole function. + * lex.c (reinit_lang_specific): Wrap call to reinit_search_statistics. + + * decl.c (finish_function): Only call pop_memoized_context if + GATHER_STATISTICS is defined. + (start_function): Likewise for push_memoized_context. + * class.c (pushclass, popclass): Likewise. + + * cp-tree.h (CLASSTYPE_MTABLE_ENTRY): Move definition from here... + * search.c (CLASSTYPE_MTABLE_ENTRY): ... to here. + + * cvt.c (cp_convert): Delete unused local var FORM. + * cp-tree.h (can_convert, can_convert_arg, real_lvalue_p): Add + prototypes. + +Thu Feb 22 13:19:44 1996 Jason Merrill + + * pt.c (do_poplevel): Oops; really return what we get from + poplevel this time. + +Thu Feb 22 11:41:44 1996 Brendan Kehoe + + * cp-tree.h (is_aggr_type): Add prototype. + + * cp-tree.h ({push,pop}_cp_function_context): Add decls. + * method.c ({push,pop}_cp_function_context): Delete decls. + * except.c (start_eh_unwinder, end_eh_unwinder): Declare as void. + (SetUnexpected, SetTerminate): Delete unused vars. + (init_exception_processing): Don't set SetUnexpected or + SetTerminate. Don't set SET_UNEXPECTED_FNDECL or SET_TERMINATE_FNDECL. + (output_exception_table_entry): Delete unused array LABEL. + (expand_internal_throw): Delete unused var PARAMS. + (expand_start_catch_block): Delete unused var CLEANUP. + (emit_exception_table): Delete unused var EH_NODE_DECL. + (expand_builtin_throw): Delete unused vars UNWIND_AND_THROW and + GOTO_UNWIND_AND_THROW. Don't set them. + (end_eh_unwinder): Add top decl. + (pop_rtl_from_perm): Delete unused decl of PERMANENT_OBSTACK. + (exception_section, push_rtl_perm, do_function_call, + lang_interim_eh, push_eh_cleanup, eh_outer_context, + expand_end_eh_spec, end_eh_unwinder): Declare as static. + (saved_pc, saved_throw_type, saved_throw_value, saved_cleanup, + throw_used): Likewise. + * cp-tree.h (expand_end_eh_spec): Delete prototype. + + * search.c (dfs_mark, dfs_mark_vtable_path, + dfs_unmark_vtable_path, dfs_mark_new_vtable, + dfs_unmark_new_vtable, dfs_clear_search_slot, + dfs_search_slot_nonempty_p, bfs_markedp, bfs_unmarkedp, + bfs_marked_vtable_pathp, bfs_unmarked_vtable_pathp, + bfs_marked_new_vtablep, bfs_unmarked_new_vtablep): #if 0 unused + functions. + (n_fields_searched, n_calls_lookup_field, n_calls_lookup_field_1, + n_calls_lookup_fnfields, n_calls_lookup_fnfields_1, + n_calls_get_base_type, n_outer_fields_searched, n_contexts_saved): + Only define #ifdef GATHER_STATISTICS. + (reinit_search_statistics): Only init some vars if GATHER_STATISTICS + is defined. + (vbase_decl): Delete var definition. + (init_search): Delete old decl. + (init_vbase_pointers): Delete building of VBASE_DECL, since it's + never actually used. + (expand_indirect_vtbls_init): Delete init of VBASE_DECL. + (get_base_distance_recursive): Delete unused fourth arg + BASETYPE_PATH. Fix call . + (get_base_distance): Fix call. + (push_class_decls): Delete unused var ID. + (make_memoized_table_entry): Declare as static. + (breadth_first_search): Declare as static. + (tree_has_any_destructor_p): Declare as static. + (pop_class_decls): Delete unused arg pop_class_decls. + * class.c (popclass): Fix call to pop_class_decls. + * cp-tree.h (make_memoized_table_entry, breadth_first_search, + tree_has_any_destructor_p): Delete prototypes. + + * rtti.c (build_ptmf_desc): Delete unused arg TYPE. + (build_t_desc): Fix call. Delete unused vars ELEMS and TT. + (build_dynamic_cast): Delete unused local vars TMP1 and RETVAL. + (build_user_desc): Delete unused var T. + (build_class_desc): Delete unused vars T and OFF. + (build_t_desc): Delete unused var NAME_STRING. + (build_headof): Make static. + (get_bad_cast_node): Likewise. + (get_def_to_follow): Likewise. + * cp-tree.h (init_type_desc): Add prototype. + (build_headof): Remove prototype. + +Thu Feb 22 00:54:22 1996 Jason Merrill + + * pt.c (tsubst): Only look for matching decls at file scope for + non-member functions. + + * call.c (build_scoped_method_call): Handle scoped destructor + calls in templates. + + * decl.c (*_top_level): Also save previous_class_values. + + * pt.c (tsubst_expr): Support do {} while loops. + * parse.y (simple_stmt): Likewise. + * tree.def: Likewise. + + * method.c (build_overload_identifier): For a class nested in a + template class, don't mangle in the template parms from our + context. + + * lex.c, cp-tree.h: Remove support for template instantiations in + the pending_inlines code. + * pt.c: Remove dead functions and unused arguments. + (uses_template_parms): TYPENAME_TYPEs always use template parms. + * parse.y: Stop passing anything to end_template_decl. + * tree.c (print_lang_statistics): Only print tinst info #ifdef + GATHER_STATISTICS. + +Wed Feb 21 16:57:33 1996 Brendan Kehoe + + * init.c (expand_recursive_init{,_1}): Delete decls. + (sort_member_init): Delete unused var INIT. + (emit_base_init): Delete unused var X. + (build_offset_ref): Delete unused var CNAME. + (sort_member_init): Delete unused var FIELDS_TO_UNMARK. + (emit_base_init): Delete unused local var BASE. Delete extern + decl of IN_CHARGE_IDENTIFIER. + (build_delete): Delete unused local var VIRTUAL_SIZE. + + * init.c (build_vec_delete): Delete unused third arg ELT_SIZE. + (build_delete): Fix call. + * decl2.c (delete_sanity): Likewise. + * cp-tree.h (build_vec_delete): Update prototype. + + * typeck.c (common_base_type): Delete unused var TMP. + (build_binary_op): Delete local var ARGS_SAVE. + (build_array_ref): Delete unused var ITYPE. + (c_expand_return): Delete unused var USE_TEMP. + + * typeck.c (compexcepttypes): Delete unused arg STRICT. + (comptypes): Fix calls. + * decl.c (duplicate_decls): Likewise. + * cp-tree.h (compexcepttypes): Delete extra arg. + + * decl2.c (check_classfn): Delete unused second arg CNAME. + * decl.c (start_decl, grokfndecl): Fix calls. + * init.c (do_friend): Likewise. + * cp-tree.h (check_classfn): Update prototype. + + * cp-tree.h (signature_error, import_export_vtable, + append_signature_fields, id_in_current_class, mark_used, + copy_assignment_arg_p): Add decls. + * decl2.c (mark_used): Delete decl. + + * class.c (n_*): Wrap with #ifdef GATHER_STATISTICS. + + * class.c (get_vtable_entry): Disable unused function. + (doing_hard_virtuals): Delete unused static global var. + (finish_struct_1): Don't init DOING_HARD_VIRTUALS. + (prepare_fresh_vtable): Delete unused vars PATH and RESULT. + (overrides): Delete unused vars RETTYPE and BASE_RETTYPE. + (modify_one_vtable): Delete unused var OLD_RTTI. + (finish_struct_anon): Delete unused vars OFFSET and X. + (finish_struct_bits): Delete unused var METHOD_VEC. + (get_basefndecls): Delete unused var PURPOSE. Delete unused + for-scope local variable METHODS. + + * call.c (user_harshness): Delete unused/unneeded arg PARM. + (ideal_candidate): Delete unused args BASETYPE and PARMS. + (build_method_call): Delete unused args passed into ideal_candidate. + (build_overload_call_real): Likewise. Delete unused var OVERLOAD_NAME. + * cp-tree.h (synthesize_method): Add decl. + + * decl.c (note_level_for_for): Give void return type. + (pushdecl_nonclass_level): Likewise. + (finish_function): Delete unused vars VFIELDS and ALLOCATED_THIS. + (poplevel): Delete unused var IMPLICIT_TRY_BLOCK. + (suspend_binding_level): Delete unused var LEVEL. + (duplicate_decls): Delete unused var CTYPE. + (duplicate_decls): Delete unused var PREVIOUS_C_DECL. + (init_decl_processing): Delete unused vars FLOAT_ENDLINK and + PTR_ENDLINK. + (grokdeclarator): Delete unused var C. + (grokdeclarator): Delete unused var SIZE_VARIES. + (grokparms): Delete unused var SAW_VOID. + (start_function): Delete unused var OLDDECL. + (cplus_expand_expr_stmt): Delete unused var + REMOVE_IMPLICIT_IMMEDIATELY. + + * cp-tree.h (pushdecl_nonclass_level): Fix prototype. + + * Makefile.in (CONFLICTS): Update to 12 shift/reduce. + +Wed Feb 21 00:06:17 1996 Jason Merrill + + * tree.c (build_min): Set TREE_COMPLEXITY to lineno. + (build_min_nt): Likewise. + * pt.c (do_pushlevel): Emit line note. + (do_poplevel): Return what we get from poplevel. + (tsubst_expr): Set lineno from TREE_COMPLEXITY in stmt nodes. + * parse.y: Use do_pushlevel and do_poplevel. + * cp-tree.h: Declare do_poplevel. + + * cp-tree.h: Declare at_eof. + * decl.c (cp_finish_decl): Pass it to rest_of_decl_compilation. + * decl2.c (import_export_decl): Renamed from import_export_inline. + (finish_file): Call it to do interface handling for statics. + * pt.c (tsubst_copy): Call mark_used on variables and functions + used here. + + * decl2.c (finish_file): Don't emit statics we can't generate. + * pt.c (instantiate_decl): Don't set interface on instantiations + we can't generate. + + * cp-tree.h (struct tinst_level): Change 'classname' to 'decl'. + * tree.c (print_lang_statistics): Print max template depth. + * pt.c (push_tinst_level): Dump entire instantiation context. + (instantiate_class_template): Use it and pop_tinst_level. + (instantiate_decl): Likewise. + + * call.c class.c cp-tree.h decl.c decl2.c error.c lex.c method.c + pt.c ptree.c tree.def: Remove all traces of UNINSTANTIATED_P_TYPE. + +Tue Feb 20 18:21:51 1996 Jason Merrill + + * call.c class.c cp-tree.h cvt.c decl.c decl2.c error.c expr.c + init.c lex.c method.c parse.y pt.c repo.c search.c spew.c tree.c + tree.def typeck.c typeck2.c xref.c: Massive, systemic changes for + the new template implementation. + +Tue Feb 20 17:14:29 1996 Brendan Kehoe + + * decl2.c (check_cp_case_value): Use STRIP_TYPE_NOPS. + +Thu Feb 15 18:44:42 1996 Mike Stump + + * decl.c (cp_finish_decl): Delay emitting the debug information for + a typedef that has been installed as the canonical typedef, if the + type has not yet been defined. + +Thu Feb 15 09:39:08 1996 Jason Merrill + + * decl2.c (grokfield): Still call pop_nested_class for access decls. + +Wed Feb 14 17:30:04 1996 Brendan Kehoe + + * decl.c (lookup_label): Call label_rtx. + + * decl.c (make_binding_level): New function. + (pushlevel, pushlevel_class): Call it instead of explicit + duplicate calls to xmalloc. + + * decl.c (init_decl_processing): Delete useless build_pointer_type + call. + + * decl.c (float_ftype_float, ldouble_ftype_ldouble): Add definitions. + (sizet_ftype_string): Delete variable. + (init_decl_processing): Add built-in functions fabsf, fabsl, + sqrtf, sqrtl, sinf, sin, sinl, cosf, cos, cosl. New local + variable strlen_ftype, used for strlen. + +Wed Feb 14 16:21:25 1996 Jason Merrill + + * decl.c (push_to_top_level): Start from current_binding_level + again for now; the stl hacks depend on g++ being broken in this + way, and it'll be fixed in the template rewrite. + + * tree.def: Add USING_DECL. + * decl2.c (do_class_using_decl): Implement. + (grokfield): Pass access decls off to do_class_using_decl instead of + grokdeclarator. + * error.c (dump_decl): Handle USING_DECLs. + * decl.c (grokdeclarator): Remove code for handling access decls. + * class.c (finish_struct_1): Adjust accordingly, treat using-decls + as access decls for now. + (finish_struct): Don't check USING_DECLs for other uses of the name. + + * search.c (get_matching_virtual): Use cp_error_at. + +Wed Feb 14 10:36:58 1996 Brendan Kehoe + + * typeck.c (comptypes): Default COMP_TYPE_ATTRIBUTES to 1, to + match c-typeck.c. + (self_promoting_args_p): Move the check that TYPE is non-nil + before trying to look at its main variant. + (unsigned_type, signed_type): Add checking of DI/SI/HI/QI nodes. + + * cp-tree.h (DECL_WAITING_FRIENDS, SET_DECL_WAITING_FRIENDS): + Delete macros. + * init.c (xref_friend, embrace_waiting_friends): Delete functions. + (do_friend): Delete call to xref_friend. + * class.c (finish_struct_1): Delete call to embrace_waiting_friends. + + * typeck.c (convert_sequence): #if 0 unused function. + + * cp-tree.h (DECL_IN_MEMORY_P): New macro w/ the check that used to + be in decl_in_memory_p. + (decl_in_memory_p): Delete decl. + * expr.c (decl_in_memory_p): Delete fn. + * typeck.c (mark_addressable): Use DECL_IN_MEMORY_P. + + * decl.c (cp_finish_decl): Use DECL_IN_MEMORY_P. + +Tue Feb 13 12:51:21 1996 Jason Merrill + + * class.c (finish_struct_1): Check for a pure-specifier on a + non-virtual function here. + + * decl2.c (grok_function_init): Don't check whether the function + is virtual here. + (grokfield): Don't call check_for_override here. + + * decl.c (push_to_top_level): Start from inner_binding_level, + check class_shadowed in class levels. + +Mon Feb 12 17:46:59 1996 Mike Stump + + * decl.c (resume_level): Ignore things that don't have names, instead + of core dumping. + +Mon Feb 12 15:47:44 1996 Brendan Kehoe + + * decl2.c (grokfield): Set DECL_VINDEX properly for FUNCTION_DECLs. + +Sat Feb 10 17:59:45 1996 Jason Merrill + + * class.c (finish_struct_1): Set DECL_VINDEX properly on a + synthesized dtor. + + * parse.y (complete_type_name): Bind global_scope earlier. + (complex_type_name): Likewise. + (qualified_type_name): Remove. + +Thu Feb 8 15:15:14 1996 Jason Merrill + + * decl.c (grokfndecl): Move code that looks for virtuals in base + classes... + * class.c (check_for_override): ... to a new function. + (finish_struct_1): Call it. + + * cp-tree.h: Declare warn_sign_compare. + + * typeck.c (build_binary_op_nodefault): Check warn_sign_compare + rather than extra_warnings to decide whether to warn about + comparison of signed and unsigned. + + * decl2.c (lang_decode_option): Handle warn_sign_compare. -Wall + implies -Wsign-compare. -Wall doesn't imply -W. + +Wed Feb 7 15:27:57 1996 Mike Stump + + * typeck.c (build_component_ref): Fix to handle anon unions in base + classes as well. + +Wed Feb 7 14:29:12 1996 Brendan Kehoe + + * class.c (resolves_to_fixed_type_p): Delete code dealing with + a WITH_CLEANUP_EXPR, since we don't generate them any more. + * cvt.c (build_up_reference): Likewise. + * decl.c (grok_reference_init): Likewise. + (cp_finish_decl): Likewise. + * error.c (dump_expr): Likewise. + * tree.c (real_lvalue_p): Likewise. + (lvalue_p): Likewise. + (build_cplus_new): Likewise. + (unsave_expr_now): Likewise. + * typeck.c (unary_complex_lvalue, build_modify_expr, + c_expand_return): Likewise. + +Tue Feb 6 13:39:22 1996 Brendan Kehoe + + Make the C++ front-end pay attention to attributes for structures. + * class.c (finish_struct): New argument ATTRIBUTES, passed down into + finish_struct_1. + (finish_struct_1): New argument ATTRIBUTES; call cplus_decl_attributes. + Take out old round_up_size use and setting the DECL_ALIGN possibly + using it. Take out setting of TYPE_ALIGN to round_up_size, which + can override what the attribute set. + * cp-tree.h (finish_struct): Update prototype. + * parse.y (template_instantiate_once): Pass a NULL_TREE for the + attributes to finish_struct. + (structsp): For a CLASS decl, add maybe_attribute to rule and pass that + value down into finish_struct. + * Makefile.in (CONFLICTS): Switch to 7 shift/reduce conflicts. + +Tue Feb 6 13:12:15 1996 Per Bothner + + * decl.c (poplevel): Re-word dead for local handling. + (pushdecl): Remove useless DECL_DEAD_FOR_LOCAL test. + (cp_finish_decl): If is_for_scope, check for duplicates so + we can disable is_for_scope. Otherwise, preserve_temp_slots. + + * lex.c (do_identifier): Use global binding in preference of + dead for local variable. + +Mon Feb 5 17:46:46 1996 Mike Stump + + * init.c (initializing_context): Handle anon union changes, the + context where fields of anon unions can be initialized now has to be + found by walking up the TYPE_CONTEXT chain. + +Fri Feb 2 14:54:04 1996 Doug Evans + + * decl.c (start_decl): #ifdef out code to set DECL_COMMON + if ASM_OUTPUT{,_ALIGNED}_BSS is defined. + (obscure_complex_init): If bss is supported, always set + DECL_INITIAL to error_mark_node. + +Thu Feb 1 16:19:56 1996 Brendan Kehoe + + * init.c (is_friend): Make sure there's a context before we see if + it's an aggr type. + +Thu Feb 1 15:44:53 1996 Mike Stump + + * init.c (is_friend): Classes are not friendly with nested classes. + +Thu Feb 1 15:27:37 1996 Doug Evans + + * lex.c (check_newline): Pass last character read to HANDLE_PRAGMA, + and record its result. + +Thu Feb 1 09:27:01 1996 Mike Stump + + * class.c (finish_struct_anon): Switch around code to not move anon + union elements around, nor mess up their contexts, nor offsets, + instead we now build up the right number of COMPONENT_REFs for all + the anon unions that may be present at build_component_ref time. + * typeck.c (lookup_anon_field): New routine to handle field lookup + on fields without names. We find them, based upon their unique type + instead. + * typeck.c (build_component_ref): Allow FIELD_DECL components. + Handle finding components in anonymous unions, and ensure that a + COMPONENT_REF is built for each level as necessary. + +Tue Jan 30 18:18:23 1996 Mike Stump + + * cvt.c (build_up_reference): Make the INDIRECT_BIND case come after + code that ensures that copy ctors are used if appropriate. + +Tue Jan 30 17:35:14 1996 Brendan Kehoe + + * init.c (build_vec_delete): Only give an error if base isn't an + error_mark_node. + +Mon Jan 29 17:09:06 1996 Mike Stump + + * spew.c (do_aggr): `new struct S;' isn't a forward declaration. + (yylex): If we see `new', keep slurping. + +Thu Jan 25 18:31:36 1996 Mike Stump + + * class.c (finish_struct_1): Move code for handling anon unions... + (finish_struct_anon): to here. Fixup so that we do the offset + calculations right, and so that the fields are physically moved to + the containers's chain. + +Thu Jan 25 18:27:37 1996 Brendan Kehoe + + * decl.c (grokdeclarator): Avoid trying to get an operand off an + identifier node. + +Wed Jan 24 11:25:30 1996 Jim Wilson + + * typeck.c (pointer_int_sum): Use TYPE_PRECISION (sizetype) not + POINTER_SIZE to agree with expr.c. + +Thu Jan 25 13:01:23 1996 Mike Stump + + * search.c (lookup_field): Don't report ambiguities if protect is 0, + instead return NULL_TREE. + +Wed Jan 24 13:01:26 1996 Mike Stump + + * class.c (finish_struct_1): Call warn_hidden if we want warnings + about overloaded virtual functions. + (warn_hidden): New routine to warn of virtual functions that are + hidden by other virtual functions, that are not overridden. + (get_basefndecls): New routine, used by warn_hidden. + (mark_overriders): New routine, used by warn_hidden. + * search.c (get_matching_virtual): Remove old warning that just + isn't very useful. + +Tue Jan 23 12:26:10 1996 Brendan Kehoe + + * decl.c (output_builtin_tdesc_entries): #if 0 the function definition. + + * typeck.c (null_ptr_cst_p): Delete unused fn. + (build_function_call_maybe): Delete unused fn. + + * expr.c (extract_init): #if 0 the code after unconditional return 0 + for now. + + Delete old cadillac code. + * edsel.c: Remove file. + * Make-lang.in (CXX_SRCS): Take edsel.c off the list. + * Makefile.in (CXX_OBJS): Delete edsel.o. + (edsel.o): Delete rule. + * cp-tree.h (flag_cadillac): Delete var decl. + * lang-options.h: Delete "-fcadillac" and "-fno-cadillac". + * decl2.c (flag_cadillac): Delete var definition. + (lang_decode_option): Delete handling of -fcadillac and -fno-cadillac. + (grokfield): Delete code depending on flag_cadillac. + (finish_anon_union): Likewise. + * class.c (finish_struct_1): Likewise. + (pushclass): Likewise. + (popclass): Likewise. + (push_lang_context): Likewise. + (pop_lang_context): Likewise. + * decl.c (init_decl_processing): Likewise. + (start_decl): Likewise. + (cp_finish_decl): Likewise. + (xref_tag): Likewise. + (finish_enum): Likewise. + (start_function): Likewise. + (finish_function): Likewise. + (finish_stmt): Likewise. + * lex.c (lang_init): Likewise. + (check_newline): Likewise. + + * lex.c (do_pending_inlines): Delete synthesized method kludge. + + Delete defunct, ancient garbage collection implementation. + * rtti.c: New file with the RTTI stuff from gc.c. + * gc.c: Removed file (moved the remaining stuff into rtti.c). + * Makefile.in (CXX_OBJS): Replace gc.o with rtti.o. + (rtti.o): New rule, replacing gc.o. + * Make-lang.in (CXX_SRCS): Replace gc.c with rtti.c. + * cp-tree.h: Delete gc-related fn decls. + (DECL_GC_OFFSET): Delete macro. + (flag_gc): Delete extern decl. + * decl.c (current_function_obstack_index): Delete var decl. + (current_function_obstack_usage): Delete var decl. + (start_function): Delete clearing of current_function_obstack_index + and current_function_obstack_usage. + (init_decl_processing): Delete code relying on -fgc. + Delete call to init_gc_processing. + (cp_finish_decl): Delete calls to build_static_gc_entry and + type_needs_gc_entry. Delete gc code setting DECL_GC_OFFSET. + (store_parm_decls): Delete -fgc calls to cp_expand_decl_cleanup + and to expand_expr of a __gc_main call. + (maybe_gc_cleanup): Delete var decl. + (finish_function): Delete call to expand_gc_prologue_and_epilogue. + * decl2.c (flag_gc): Delete var decl. + (lang_f_options): Delete offering of -fgc. + (lang_decode_option): Delete -fgc and -fno-gc handling. + (get_temp_regvar): Delete gc code. + * init.c (build_new): Delete gc code. + * lex.c (init_lex): Delete checking of flag_gc. + + * typeck.c (convert_arguments): Delete gc code. + (build_component_addr): Delete -fgc warning. + (build_modify_expr): Delete gc code. + + * decl2.c (build_push_scope): Delete fn. + * cp-tree.h (build_push_scope): Delete decl. + + * search.c (clear_search_slots): Delete fn. + * cp-tree.h (clear_search_slots): Delete decl. + + * search.c (tree_needs_constructor_p): Delete fn. + * cp-tree.h (tree_needs_constructor_p): Delete decl. + + * tree.c (id_cmp): Delete fn. + + * tree.c (set_fnaddr_from_vtable_entry): Delete fn. + * cp-tree.h (set_fnaddr_from_vtable_entry): Delete decl. + + * tree.c (decl_value_member): Delete fn. + * cp-tree.h (decl_value_member): Delete decl. + + * tree.c (list_hash_lookup_or_cons): Delete fn. + * cp-tree.h (list_hash_lookup_or_cons): Delete decl. + + * method.c (cplus_exception_name): Delete fn. + (EXCEPTION_NAME_{PREFIX, LENGTH}): Delete macros. + + * spew.c (shift_tokens): Delete fn. + +Mon Jan 22 17:49:33 1996 Jason Merrill + + * except.c (init_exception_processing): Pass 1 to needs_pop in calls + to cp_finish_decl. + * parse.y: Likewise. + +Mon Jan 22 17:34:29 1996 Brendan Kehoe + + * tree.c (build_cplus_staticfn_type): Delete function definition; + never used. + * cp-tree.h (build_cplus_staticfn_type): Delete decl. + + * tree.c (virtual_member): Delete function definition; never used. + * cp-tree.h (virtual_member): Delete decl. + +Fri Jan 19 18:03:14 1996 Mike Stump + + * typeck.c (build_component_ref): Handle getting vbase pointers + out of complex multiple inheritance better. + +Fri Jan 19 16:27:40 1996 Mike Stump + + * typeck.c (build_object_ref): Make sure we use the real type, not + any reference type. + +Fri Jan 19 16:01:47 1996 Mike Stump + + * tree.c (build_exception_variant): Don't create new types if we + don't have to, also build new types on the right obstack. + +Fri Jan 19 14:09:44 1996 Jason Merrill + + * decl.c (store_bindings): Split out from push_to_top_level. + (push_to_top_level): Call it for b->type_shadowed on class binding + levels. + +Fri Jan 19 13:53:14 1996 Mike Stump + + * search.c (expand_upcast_fixups): Fix so that offsets stored in + vbase_offsets are always right. Fixes a problem where virtual base + upcasting and downcasting could be wrong during conversions on this + during virtual function dispatch at ctor/dtor time when dynamic + vtable fixups for deltas are needed. This only sounds easier than + it is. :-) + (fixup_virtual_upcast_offsets): Change to reflect new calling + convention for expand_upcast_fixups. + +Fri Jan 19 12:23:08 1996 Brendan Kehoe + + * decl2.c (grokbitfield): Strip the NOPs from WIDTH before we + check that it's usable as the bitfield width. + +Wed Jan 17 21:22:40 1996 Brendan Kehoe + + * decl2.c (grokfield): Call cplus_decl_attributes with the attrlist. + Pass a null tree to grokdeclarator for its ATTRLIST arg, since it's + only ever used for functions in it. + +Wed Jan 17 12:10:38 1996 Jason Merrill + + * parse.y (qualified_type_name): Use the TYPE_DECL, not the type. + (nested_type): Likewise. + (nested_name_specifier): Use lastiddecl. + + * decl.c (grokdeclarator): Adjust accordingly. + * init.c (expand_member_init): Likewise. + * parse.y (base_class): Likewise. + * typeck2.c (build_functional_cast): Likewise. + + * typeck2.c (build_functional_cast): Fill in name after we've + checked for non-aggr type. + +Wed Jan 17 10:18:01 1996 Mike Stump + + * decl2.c (warn_pointer_arith): Default to on. + +Tue Jan 16 12:45:38 1996 Jason Merrill + + * lex.c (is_rid): New function. + * decl.c (grokdeclarator): Diagnose reserved words used as + declarator-ids. + +Tue Jan 16 11:39:40 1996 Jason Merrill + + * tree.c (get_decl_list): Don't lose cv-quals. + + * decl.c (grokdeclarator): Fix SCOPE_REF handling and diagnose + typespecs used as declarator-ids. + +Tue Jan 16 11:09:42 1996 Mike Stump + + * decl.c (poplevel): When popping a level, don't give a warning for + any subblocks that already exist. + +Tue Jan 16 00:25:33 1996 Jason Merrill + + * typeck.c (build_object_ref): Finish what I started. + + * parse.y (qualified_type_name): Don't check TYPE_BUILT_IN. + + * decl2.c (constructor_name_full): Handle TEMPLATE_TYPE_PARMs. + + * decl.c (grokdeclarator): Also accept TEMPLATE_TYPE_PARM as a + scope. + +Mon Jan 15 16:19:32 1996 Jason Merrill + + * decl.c (xref_tag): Handle passing a type in directly. + + * parse.y (qualified_type_name): Pull out the type. + (nested_type): Likewise. + Take types directly instead of as identifiers. + * call.c (build_scoped_method_call): Take types directly instead of + as identifiers. + * decl.c (xref_basetypes): Likewise. + * init.c (expand_member_init): Likewise. + (build_member_call): Likewise. + (build_offset_ref): Likewise. + * typeck2.c (build_scoped_ref): Likewise, remove bogus code. + * method.c (do_build_assign_ref): Likewise. + * decl.c (grokdeclarator): Handle a type appearing as the + declarator-id for constructors. + * method.c (do_build_copy_constructor): current_base_init_list now + uses the types directly, not their names. + * init.c (sort_base_init): Likewise. + (expand_member_init): Likewise. + * init.c (is_aggr_type): New function, like is_aggr_typedef. + +Mon Jan 15 08:45:01 1996 Jeffrey A Law + + * tree.c (layout_basetypes): Call build_lang_field_decl instead + of build_lang_decl if first arg is a FIELD_DECL. + +Thu Jan 11 14:55:07 1996 Brendan Kehoe + + * decl.c (cp_finish_decl): Only clear TREE_USED if DECL_NAME is + non-empty. + * except.c (expand_start_catch_block): Set TREE_USED to avoid + warnings about the catch handler. + +Mon Jan 8 17:35:12 1996 Jason Merrill + + * typeck.c (build_modify_expr): Use a COMPOUND_EXPR instead of + expand_target_expr. + +Thu Jan 4 12:30:32 1996 Brendan Kehoe + + Fix access control to use trees rather than integers. + * class.c (access_{default, public, protected, private, + default_virtual, public_virtual, private_virtual}_node): Add + definitions. + (init_class_processing): Do creation of those nodes. + * cp-tree.h (access_type): Delete enum decl. + (access_{default, public, protected, private, default_virtual, + public_virtual, private_virtual}_node): Add decls. + (compute_access): Change return type. + * search.c (compute_access): Have tree return type, instead of enum. + (lookup_field): Declare THIS_V and NEW_V to be tree nodes. + * lex.c (real_yylex): Use yylval.ttype for giving the value of the + access_* node for each of RID_{PUBLIC, PRIVATE, PROTECTED}. + * parse.y (VISSPEC): Make ttype rather than itype. + (base_class_access_list): Likewise. + * *.[cy]: Change all refs of `access_public' to `access_public_node', + etc. + * call.c (build_method_call): Make ACCESS be a tree. + * class.c (alter_access, finish_struct_1, filter_struct): Likewise. + * cvt.c (convert_to_aggr): Likewise. + * init.c (build_offset_ref, resolve_offset_ref, build_delete): + Likewise. + * method.c (hack_identifier): Likewise. + * typeck.c (build_component_ref_1, build_component_ref): ): Likewise. + +Thu Jan 4 11:02:20 1996 Mike Stump + + * typeck.c (pointer_int_sum, pointer_diff): Make code agree with C + frontend, and make it more consistent with respect to + warn_pointer_arith. + +Tue Jan 2 00:13:38 1996 Rusty Russell + + * decl.c (pushdecl): Check for duplicate parameter names. + +Wed Jan 3 09:25:48 1996 Mike Stump + + * decl.c (expand_static_init): Call assemble_external for atexit. + +Wed Jan 3 07:55:19 1996 Mike Stump + + * except.c (do_unwind): Remove some generated dead code. + (eh_outer_context): New routine, factor out some common code from + expand_builtin_throw and end_eh_unwinder. Add code to do return + address masking for the PA. + (expand_builtin_throw): Use eh_outer_context instead of open coding + it here. + (end_eh_unwinder): Likewise. + +Tue Jan 2 17:00:56 1996 Mike Stump + + * except.c (expand_throw): Call assemble_external for __empty, if we + use it. + diff --git a/gcc/cp/ChangeLog-1997 b/gcc/cp/ChangeLog-1997 new file mode 100644 index 00000000000..8e2c7343428 --- /dev/null +++ b/gcc/cp/ChangeLog-1997 @@ -0,0 +1,2607 @@ +Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi + + * call.c (add_builtin_candidate): Add default case in enumeration + switch. + (build_new_op): Likewise. + (convert_like): Likewise. + * cvt.c (build_expr_type_conversion): Likewise. + * tree.c (real_lvalue_p): Likewise. + (lvalue_p): Likewise. + (cp_tree_equal): Likewise. + * typeck.c (comptypes): Likewise. + (build_component_ref): Likewise. + (build_function_call_real): Likewise. + (build_binary_op_nodefault): Likewise. + (build_unary_op): Likewise. + (build_modify_expr): Likewise. + * typeck2.c (initializer_constant_valid_p): Likewise. + +Sun Dec 21 15:59:00 1997 Nick Clifton + + * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas. + +Thu Dec 18 14:51:50 1997 Mark Mitchell + + * pt.c (coerce_template_parms): Make sure to digest_init if + possible. + + * decl.c (duplicate_decls): Make the newdecl virtual if the + olddecl was, just as is done with other attributes of olddecl. + +Thu Dec 18 14:43:19 1997 Jason Merrill + + * typeck.c (unary_complex_lvalue): Ignore op0 when taking the + address of an OFFSET_REF. + + * cp-tree.def: Add AGGR_INIT_EXPR. + * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with + AGGR_INIT_EXPR where appropriate. + * expr.c (cplus_expand_expr): Likewise. Simplify. + + * decl2.c (finish_file): Remove call to register_exception_table. + +Wed Dec 17 17:08:52 1997 Benjamin Kosnik + + * pt.c (instantiate_class_template): Don't do injection when + processing_template_decl is true, as pollutes current_binding_level + for base classes. + +Wed Dec 17 21:17:39 1997 Peter Schmid + + * pt.c (maybe_fold_nontype_arg): Add prototype. + +Tue Dec 16 10:31:20 1997 Jason Merrill + + * tree.c (mapcar): Handle TRY_CATCH_EXPR et al. + * error.c (dump_expr): Likewise. + +Mon Dec 15 12:22:04 1997 Jason Merrill + + * typeck.c (build_function_call_real): Remove "inline called before + definition" pedwarn. + + * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg. + +Sun Dec 14 22:34:20 1997 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's. + + * pt.c (type_unification_real): Change __null to type void* with + a warning. + +Sun Dec 14 20:38:35 1997 Mark Mitchell + + * call.c (implicit_conversion): Don't call + build_user_type_conversion_1 with a NULL expr, since it will + crash. + + * pt.c (unify): Don't try to unify array bounds if either array is + unbounded. + +Fri Dec 12 16:09:14 1997 Jason Merrill + + * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at): + Replace extern decls with casts. + + * decl.c (expand_start_early_try_stmts): Don't mess with a sequence. + Update last_parm_cleanup_insn. + (store_after_parms): Remove. + * cp-tree.h: Adjust. + +Thu Dec 11 22:18:37 1997 Jason Merrill + + * decl2.c (comdat_linkage): Also set DECL_COMDAT. + (finish_file): Check DECL_COMDAT instead of weak|one_only. + (import_export_vtable): Use make_decl_one_only instead of + comdat_linkage for win32 tweak. + (import_export_decl): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + + * decl2.c (finish_file): Lose handling of templates in pending_statics. + +Thu Dec 11 21:12:09 1997 Jason Merrill + + * decl2.c (finish_file): Lose call to expand_builtin_throw. + * except.c (expand_builtin_throw): Remove. + * cp-tree.h: Remove ptr_ptr_type_node. + * decl.c: Likewise. + +Thu Dec 11 20:43:33 1997 Teemu Torma + + * decl.c (ptr_ptr_type_node): Define. + (init_decl_processing): Initialize it. + * cp-tree.h: Declare it. + * exception.cc (__cp_exception_info): Use __get_eh_info. + (__cp_push_exception): Likewise. + (__cp_pop_exception): Likewise. + + From Scott Snyder : + * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of + saved_pc. + (init_exception_processing): Removed saved_pc initialization. + +Wed Dec 10 11:04:45 1997 Jason Merrill + + * pt.c (instantiate_decl): Defer all templates but inline functions. + +Mon Dec 8 23:17:13 1997 Jason Merrill + + * init.c (expand_vec_init): Don't fold a list of parameters. + + * decl.c (copy_args_p): Handle copy elision for types with virtual + bases. + * call.c (build_over_call): Likewise. + +Sun Dec 7 22:38:12 1997 Mark Mitchell + + * pt.c (lookup_template_function): Copy the template arguments, + not just the list containing them, to the permanent obstack. + +Sun Dec 7 15:53:06 1997 Jason Merrill + + * except.c (expand_start_catch_block): suspend_momentary for the + terminate handler. + + * error.c (dump_decl): Handle LOOKUP_EXPR. + +Sun Dec 7 15:45:07 1997 Mark Mitchell + + * rtti.c (build_dynamic_cast): Copy the cast-to type to the + permanent obstack if we are processing a template decl. + * typeck.c (build_static_cast): Likewise. + (build_const_cast): Likewise. + (build_reinterpret_cast): Likewise. + + * pt.c (coerce_template_parms): Coerce some expressions, even + when processing_template_decl. + +Sun Dec 7 01:46:33 1997 Bruno Haible + + * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric + handling of pointer difference expressions. + + * typeck.c (comp_target_types): Comparison of function/method types + is independent of nptrs. + +Sun Dec 7 01:40:27 1997 Mark Mitchell + + * pt.c (tsubst): Avoid creating pointer to reference and + reference to reference types. + +Sat Dec 6 01:29:37 1997 Jason Merrill + + * parse.y (do_id): New nonterminal. + (template_id): Use it. + +Fri Dec 5 01:17:34 1997 Jason Merrill + + * parse.y (template_id): do_identifier for PFUNCNAMEs, too. + * spew.c (yylex): Don't do_identifier here. + * decl2.c (build_expr_from_tree): Revert last change. + + * decl2.c (build_expr_from_tree): Expand the name for a method call. + * parse.y (object_template_id): Don't try to take the DECL_NAME. + +Wed Dec 3 20:02:39 1997 Jason Merrill + + * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for + alloc_expr. + * call.c (build_op_delete_call): Adjust. + + * except.c (expand_end_catch_block): Lose rethrow region. + (expand_start_catch_block): Likewise. + (expand_end_catch_block): Don't expand_leftover_cleanups. + +Wed Dec 3 13:24:04 1997 Benjamin Kosnik + + * pt.c (tsubst): Remove tree_cons call (places redundant info into + DECL_TEMPLATE_INSTANTIATION). + +Wed Dec 3 11:44:52 1997 Jason Merrill + + * tree.c (is_overloaded_fn): Handle getting a fn template. + (really_overloaded_fn): Likewise. + * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better. + * pt.c (check_explicit_specialization): Tweak. + (determine_explicit_specialization): Tweak. + + * tree.c, cp-tree.h (get_target_expr): New fn. + +Wed Dec 3 08:47:27 1997 Paul Eggert + + * pt.c (check_explicit_specialization): Fix misspelling in + diagnostic: `preceeded'. + * typeck.c (get_delta_difference): Fix misspelling in diagnostic: + `conversiona'. + +1997-12-02 Mark Mitchell + + * pt.c (determine_explicit_specialization): Avoid an internal + error for bad specializations. + + * method.c (build_overload_value): Handle SCOPE_REF. + +Tue Dec 2 19:18:50 1997 Mike Stump + + * class.c (prepare_fresh_vtable): Enable even more complex MI + vtable names. + +Tue Dec 2 01:37:19 1997 Jason Merrill + + * exception.cc (__check_eh_spec): Optimize a bit. + + * exception.cc (__cp_pop_exception): Lose handler arg. + * except.c (do_pop_exception): Likewise. + (push_eh_cleanup): Let the cleanup mechanism supply the handler. + (expand_end_catch_block): Likewise. + +Fri Nov 28 01:58:14 1997 Jason Merrill + + * pt.c (check_explicit_specialization): Complain about using a + template-id for a non-specialization. + +Fri Nov 28 12:35:19 1997 Scott Christley + + * repo.c: Prototype rindex only if needed. + * xref.c: Likewise. + +Fri Nov 28 01:56:35 1997 Bruno Haible + + * error.c (dump_decl): Handle TEMPLATE_ID_EXPR. + +Thu Nov 27 00:59:46 1997 Jason Merrill + + * typeck.c (build_const_cast): Handle references here instead of + handing off to convert_to_reference. + + * except.c: Lose Unexpected, SetTerminate, SetUnexpected, + TerminateFunctionCall. + (init_exception_processing): Likewise. Terminate et al are now + the fns, not ADDR_EXPRs. + (various): Lose redundant assemble_external calls. + (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/. + + * cp-tree.h (struct lang_decl_flags): Add comdat. + (DECL_COMDAT): New macro. + * decl.c (duplicate_decls): Propagate it. + (cp_finish_decl): Handle it. + * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs. + + * class.c: Remove static pending_hard_virtuals. + (add_virtual_function): Take pointers to pending_virtuals + and pending_hard_virtuals. + (finish_struct_1): Pass them. Declare pending_hard_virtuals. + +Wed Nov 26 20:28:49 1997 Jason Merrill + + * decl2.c (import_export_vtable): If we support one_only but not + weak symbols, mark instantiated template vtables one_only. + (import_export_decl): Likewise for tinfo functions. + (finish_vtable_vardecl): Also write out vtables from explicitly + instantiated template classes. + * pt.c (mark_class_instantiated): Revert last change. + + * except.c (expand_throw): Call mark_used on the destructor. + +Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com) + + * lex.c (lang_init): Enable flag_exceptions by default if no + command line switch was specified. + +1997-11-26 Mark Mitchell + + * pt.c (unify): Handle `void' template parameters in + specializations. + +Wed Nov 26 01:11:24 1997 Jason Merrill + + * rtti.c (build_dynamic_cast): Handle template case here. + (build_dynamic_cast_1): Not here. + + * typeck2.c (digest_init): Make copies where appropriate. + + * decl2.c (delete_sanity): resolve_offset_ref. + + * except.c: Call terminate without caching so many bits. + + * except.c (expand_start_catch_block): Fix catching a reference + to pointer. + +Tue Nov 25 11:28:21 1997 Jason Merrill + + * init.c (build_new): Copy size to the saveable obstack. + + * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the + TRY_CATCH_EXPR for now. + +Mon Nov 24 12:15:55 1997 Jason Merrill + + * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL + has DECL_LANG_SPECIFIC. + + * exception.cc (struct cp_eh_info): Add handlers field. + (__cp_push_exception): Initialize it. + (__cp_pop_exception): Decrement it. Don't pop unless it's 0. + (__throw_bad_exception): Remove. + * except.c (call_eh_info): Add handlers field. + (get_eh_handlers): New fn. + (push_eh_cleanup): Increment handlers. + +Fri Nov 21 12:22:07 1997 Jason Merrill + + * except.c (expand_start_eh_spec): Use the try/catch code. + (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of + doing everything inline. + (init_exception_processing): throw_type_match now takes + const void pointers. + * exception.cc (__check_eh_spec): New fn. + * inc/exception: Neither terminate nor unexpected return. + * decl.c: Make const_ptr_type_node public. + * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly. + + * except.c (expand_start_catch_block): We only need the rethrow + region for non-sjlj exceptions. + (expand_end_catch_block): Likewise. Use outer_context_label_stack. + +Thu Nov 20 14:40:17 1997 Jason Merrill + + * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs. + (various.o): Likewise. + * inc/new: Add placement deletes. Add throw specs for default new. + * new.cc (set_new_handler): Move here from libgcc2. + * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler. + (new): Move from libgcc2. Throw bad_alloc. + * new2.cc: Move the rest of the op news and op deletes from libgcc2. + * decl.c (init_decl_processing): Update exception specs on new and + delete. + + * method.c (build_decl_overload_real): Don't mess with global + placement delete. + + * init.c (build_new): Check for null throw spec, not nothrow_t. + + * decl.c (duplicate_decls): Don't complain about different exceptions + from an internal declaration. + + * call.c (build_op_delete_call): Fix check for member fns again. + + * decl2.c (import_export_decl): Interface hackery affects + virtual synthesized methods. + +Wed Nov 19 18:24:14 1997 Jason Merrill + + * decl.c (start_decl): Don't just complain about a mismatched + scope, fix it. + + * decl.c (make_implicit_typename): Handle case where t is not + actually from context. + * tree.c (get_type_decl): Lose identifier case. + * spew.c (yylex): Lose useless call to identifier_typedecl_value. + * parse.y (nonnested_type): Just use lookup_name. + (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE. + +Wed Nov 19 11:45:07 1997 Michael Tiemann + + * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case + T was built in C language context (for example, by + output_func_start_profiler). + +Wed Nov 19 10:39:27 1997 Jason Merrill + + * decl.c (make_implicit_typename): New fn. + (lookup_name_real): Use it. Use current_class_type as the context. + +Mon Nov 17 23:42:03 1997 Bruno Haible + + * pt.c (do_poplevel): Don't prohibit jumps into this contour. + +Mon Nov 17 02:01:28 1997 Jason Merrill + + * friend.c (do_friend): Warn about non-template friends in templates. + + * call.c (build_op_delete_call): Fix handling of inherited delete. + + * search.c (dfs_record_inheritance): Ignore template type parms. + +Sat Nov 15 00:30:51 1997 Jason Merrill + + * call.c (build_new_op): Fix copy error. + (build_op_new_call): New fn. + (build_op_delete_call): New fn. + * cp-tree.h: Declare them. + * init.c (build_new): Use them. Support placement delete. + (build_x_delete): Use build_op_delete_call. + (build_delete): Likewise. + * decl2.c (delete_sanity): Likewise. + (coerce_delete_type): Don't complain about placement delete. + +Thu Nov 13 01:52:36 1997 Jason Merrill + + * call.c (build_new_function_call): Remove unused 'obj' parm. + * cp-tree.h, typeck.c: Adjust. + + * init.c (build_new): Make the cleanup last longer. + (expand_vec_init): Call do_pending_stack_adjust. + +Wed Nov 12 11:04:33 1997 Jason Merrill + + * pt.c (do_type_instantiation): Fix typo. + (mark_class_instantiated): If we support one_only but not weak + symbols, don't mark this as known. + + * init.c (build_new): Handle vec delete in EH cleanup. + +Wed Nov 12 08:11:55 1997 Benjamin Kosnik + + * call.c (build_method_call): Call complete_type before checking + for destructor. + +Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com) + + * decl.c (add_block_current_level): Delete. + * init.c (build_vec_delete_1): Delete build_block and + add_block_current_level calls. + +Wed Nov 12 00:48:16 1997 Jason Merrill + + * init.c (build_new): Handle freeing allocated memory when the + constructor throws. + + * call.c (build_new_method_call): Fix flags arg. + + * pt.c (do_type_instantiation): Don't try to instantiate + member templates. + (mark_decl_instantiated): If we support one_only but not + weak symbols, mark this one_only. + * decl2.c (import_export_vtable): Don't defer handling of vtables + if MULTIPLE_SYMBOL_SPACES. + +Tue Nov 11 12:02:12 1997 Jason Merrill + + * except.c (expand_end_catch_block): Lose call to __sjpopnthrow. + +Tue Nov 11 02:53:44 1997 Jason Merrill + + * except.c (do_pop_exception): Return a value. + +Mon Nov 10 20:25:31 1997 Jason Merrill + + * call.c (build_new_method_call): Handle getting a + TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field + if we got template parms. + * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR, + not just the args. + * decl2.c (build_expr_from_tree): Tweak last change. + * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE. + (maybe_fold_nontype_arg): Split out from tsubst_copy. + * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR. + +Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij + + * pt.c (tsubst_copy): Handle explicit template arguments in + function calls. + * typeck.c (build_x_function_call): Likewise. + * decl2.c (build_expr_from_tree): Lookup function name if it + hasn't been done. + + * pt.c (tsubst): Instantiate template functions properly when + template parameter does not appear in function arguments and return + type. + (comp_template_args): Handle member templates required by tsubst. + +Mon Nov 10 20:08:38 1997 Jason Merrill + + * decl.c (grokdeclarator): Tweak conditions for pedwarn in + previous change. + +Mon Nov 10 20:08:29 1997 Bruno Haible + + * pt.c (coerce_template_parms): Tweak error message. + + * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a + return type defaults to `int', even if there are storage-class + specifiers. + +Mon Nov 10 03:04:20 1997 Jason Merrill + + Complete nested exception support. + * except.c (do_pop_exception): Split out... + (push_eh_cleanup): From here. Handle the EH region by hand. + (expand_start_catch_block): Add a new level for the catch parm. + Move the rethrow region outside the two cleanup regions. + Protect the initializer for the catch parm with terminate. + (expand_end_catch_block): Likewise. End the region for the eh_cleanup. + * exception.cc (__cp_pop_exception): Now takes two parms. Handle + popping off the middle of the stack. + * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR, + WITH_CLEANUP_EXPR, and UNSAVE_EXPR. + (build_cplus_new): Only wrap CALL_EXPRs. + * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around + the constructor call. + +Sun Nov 9 18:00:26 1997 Richard Kenner + + * Make-lang.in (c++.distdir): Make inc subdirectory. + +Fri Nov 7 11:57:28 1997 Jason Merrill + + * decl2.c (finish_file): Put back some code. + +Thu Nov 6 11:28:14 1997 Jason Merrill + + * decl2.c (finish_file): Remove redundant code. + * method.c (emit_thunk): Don't let the backend defer generic thunks. + +Wed Nov 5 23:52:50 1997 Jason Merrill + + * except.c (call_eh_info): Split out... + (push_eh_info): From here. + (expand_builtin_throw): Use it. + (expand_start_catch_block): Move region start back. + +Tue Nov 4 13:45:10 1997 Doug Evans + + * lex.c (MULTIBYTE_CHARS): #undef if cross compiling. + (real_yylex): Record wide strings using target endianness, not host. + +1997-11-03 Brendan Kehoe + + * repo.c (rindex): Add decl unconditionally. + (get_base_filename, open_repo_file): Don't cast rindex. + * xref.c (rindex): Add decl unconditionally. + (index): Remove unused decl. + (open_xref_file): Don't cast rindex. + +Sun Nov 2 15:04:12 1997 Jason Merrill + + * class.c (build_vbase_path): Propagate the result type properly. + +1997-11-01 Brendan Kehoe + + * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace + remaining use of saved_throw_type with a call to get_eh_type. + +1997-10-31 Brendan Kehoe + + * lex.c (FILE_NAME_NONDIRECTORY): Delete macro. + (file_name_nondirectory): New function, doing the same as the macro. + (set_typedecl_interface_info): Use it instead of the macro. + (check_newline): Likewise. + (handle_cp_pragma): Likewise. + + * repo.c (get_base_filename): Cast result of rindex to char*. + (open_repo_file): Likewise. + * xref.c (open_xref_file): Likewise. + * error.c (dump_char): Make its arg int, not char. + + * except.c (push_eh_info): Pass the number of fields - 1 down, not + the exact number of fields. + +Fri Oct 31 01:47:57 1997 Jason Merrill + + Support for nested exceptions. + * tinfo2.cc (__is_pointer): New fn. + * exception.cc (struct cp_eh_info): Define. + (__cp_exception_info, __uncatch_exception): New fns. + (__cp_push_exception, __cp_pop_exception): New fns. + * except.c: Lose saved_throw_{type,value,cleanup,in_catch}. + Lose empty_fndecl. + (init_exception_processing): Likewise. __eh_pc is now external. + (push_eh_info): New fn. + (get_eh_{info,value,type,caught}): New fns. + (push_eh_cleanup): Just call __cp_pop_exception. + (expand_start_catch_block): Use push_eh_info. Start the eh region + sooner. + (expand_end_eh_spec): Use push_eh_info. + (expand_throw): Call __cp_push_exception to set up the exception info. + Just pass the destructor or 0 as the cleanup. Call __uncatch_exception + when we rethrow. + (expand_builtin_throw): Don't refer to empty_fndecl. + +Thu Oct 23 02:01:30 1997 Jason Merrill + + * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl. + +1997-10-22 Brendan Kehoe + + * method.c (build_template_parm_names, build_decl_overload_real): + Add static to definitions. + * pt.c (add_to_template_args, note_template_header, + processing_explicit_specialization, type_unification_real): Likewise. + ({determine,check}_explicit_specialization): Use a single string for + error messages. + +Mon Oct 20 12:06:34 1997 Jason Merrill + + * except.c (expand_exception_blocks): Call do_pending_stack_adjust. + (expand_end_catch_block): Likewise. + (expand_end_eh_spec): Likewise. + +Mon Oct 20 11:44:20 1997 Mark Mitchell + + * decl.c (duplicate_decls): Handle template specializations + correctly. + * error.c (dump_function_name): Fix printing of specializations of + member functions that are not member templates. + * cp-tree.h (processing_specialization): Make global. + * pt.c (processing_specialization): Likewise. + * lex.c (cons_up_default_function): Save and restore + processing_specialization to avoid confusion. + +Mon Oct 20 10:52:22 1997 Jason Merrill + + * decl.c (init_decl_processing): Give null_node unknown* type. + * typeck.c (comp_target_types): Handle UNKNOWN_TYPE. + (common_type): Likewise. + * error.c (args_as_string): Recognize null_node. + +Sun Oct 19 09:13:01 1997 Richard Kenner + + * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR. + (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR. + + * decl.c (init_decl_processing): Call using_eh_for_cleanups. + + * Make-lang.in (g++): Include prefix.o. + +Thu Oct 16 15:31:09 1997 Judy Goldberg + + * pt.c (determine_explicit_specialization): Initialize "dummy" + to keep Purify quiet. + +Thu Oct 16 00:14:48 1997 Jason Merrill + + * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here. + (build_overload_int): Not here. + +Wed Oct 15 00:35:28 1997 Mike Stump + + * class.c (build_type_pathname): Remove. + (prepare_fresh_vtable): Fix problem with complex MI vtable names. + +1997-10-14 Brendan Kehoe + + * parse.y (unary_expr): Give a pedwarn if someone tries to use the + &&label GNU extension. + +Tue Oct 14 12:01:00 1997 Mark Mitchell + + * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it, + so as to avoid incorrect manglings. + * method.c (build_decl_overload_real): Don't mangle return types + for constructors. + +Tue Oct 14 11:46:14 1997 Jason Merrill + + * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec, + scratch_tree_cons): Define as macros for now. + * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c, + lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c, + typeck2.c: Use them and the expression_obstack variants. + +Mon Oct 13 17:41:26 1997 Benjamin Kosnik + + * decl.c (store_return_init): Allow classes with explicit ctors to + be used with the named return values extension. + +Fri Oct 10 12:21:11 1997 Jason Merrill + + * pt.c (instantiate_decl): Fix previous change. + +Thu Oct 9 12:08:21 1997 Jason Merrill + + * pt.c (tsubst): Fix thinko. + (instantiate_decl): Really use the original template. + + * call.c (build_new_method_call): Use simple constructor_name for + error messages. + +Wed Oct 8 22:44:42 1997 Jeffrey A Law + + * method.c (build_underscore_int): Don't use ANSI specific + features. + +Wed Oct 8 00:18:22 1997 Jason Merrill + + * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN + for our key method; it might have been inlined by -O3. + +Tue Oct 7 23:00:12 1997 Mark Mitchell + + * decl.c (make_typename_type): Do not try to call lookup_field for + non-aggregate types. + +Tue Oct 7 22:52:10 1997 Jason Merrill + + * typeck.c (build_reinterpret_cast): Tweak. + +Tue Oct 7 22:45:31 1997 Alexandre Oliva + + * typeck.c (build_reinterpret_cast): Converting a void pointer + to function pointer with a reinterpret_cast produces a warning + if -pedantic is issued. + +Tue Oct 7 22:43:43 1997 Bruno Haible + + * typeck.c (c_expand_return): Don't warn about returning a + reference-type variable as a reference. + +Tue Oct 7 21:11:22 1997 Jason Merrill + + * method.c (build_static_name): Fix typo. + +1997-10-07 Brendan Kehoe + + * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on + OLDDECL before we try to do DECL_USE_TEMPLATE. + +Tue Oct 7 00:48:36 1997 Jason Merrill + + * decl.c (duplicate_decls): Don't warn about template instances. + + * typeck.c (mark_addressable): Lose ancient code that unsets + DECL_EXTERNAL. + + * pt.c (do_decl_instantiation): Lose support for instantiating + non-templates. + + * call.c (build_new_function_call): Fix handling of null explicit + template args. + (build_new_method_call): Likewise. + +Mon Oct 6 23:44:34 1997 Mark Mitchell + + * method.c (build_underscore_int): Fix typo. + +1997-10-06 Brendan Kehoe + + * tree.c (print_lang_statistics): #if 0 call to + print_inline_obstack_statistics until its definition is checked in. + +Mon Oct 6 09:27:29 1997 Jason Merrill + + * decl2.c (finish_file): Move dump_tree_statistics to end. + + * pt.c (instantiate_decl): Look for the original template. + (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations + of member templates. + +Wed Oct 1 08:41:38 1997 Jason Merrill + + * Makefile.in (g++FAQ.*): New rules. + (CONFLICTS): Update. + * g++FAQ.texi: Moved from libg++. + + * parse.y (PFUNCNAME): Only specify the type once. + +1997-10-01 Brendan Kehoe + + * lex.c (real_yylex): Clean up the code to fully behave the way + the c-lex.c parser does for complex and real numbers. + +Tue Sep 30 08:51:36 1997 Jason Merrill + + * method.c (build_decl_overload_real): Reformat. + +Tue Sep 30 00:18:26 1997 Jason Merrill + + * method.c (synthesize_method): If at_eof, determine our linkage. + +1997-09-29 Paul Eggert + + * lex.c (real_yylex): Treat `$' just like `_', except issue a + diagnostic if !dollars_in_ident or if pedantic. + + * lang-specs.h (@c++): -ansi no longer implies -$. + + * decl2.c (lang_decode_option): + -traditional and -ansi now do not mess with + dollars_in_ident. + +Mon Sep 29 19:57:51 1997 H.J. Lu + + * Makefile.in (parse.o, decl.o): Also depend on + $(srcdir)/../except.h $(srcdir)/../output.h. + (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h + $(srcdir)/../except.h $(srcdir)/../output.h. + (typeck.o, init.o): Also depend on $(srcdir)/../expr.h + ../insn-codes.h. + + * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping. + + * expr.c (cplus_expand_expr): Make it static. + + * decl2.c, init.c, typeck.c: Include "expr.h". + (expand_expr): Use proper values when calling the function. + +Mon Sep 29 11:05:54 1997 Alexandre Oliva + + * lang-options.h: New -Wold-style-cast flag. + * cp-tree.h (warn_old_style_cast): New variable. + * decl2.c (warn_old_style_cast): Likewise. + (lang_decode_option): Support -Wold-style-cast. + (reparse_absdcl_as_casts): Produce old-style-cast warning. + +Mon Sep 29 09:20:53 1997 Benjamin Kosnik + + * decl.c (cp_finish_decl): Allow expand_aggr_init to set + TREE_USED, reset value based on already_used. + + * init.c (expand_member_init): Revert change. + +Mon Sep 29 08:57:53 1997 Jason Merrill + + * cp-tree.h, decl.c, decl2.c, pt.c: + Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public. + + * decl2.c (lang_decode_option): Add missing ;. + +Sat Sep 27 16:22:48 1997 Jason Merrill + + * friend.c (do_friend): Disable injection for all template-derived + decls. + * decl2.c (lang_decode_option): Handle -fguiding-decls. + * parse.y (notype_template_declarator): New nonterminal. + (direct_notype_declarator): Use it. + (complex_direct_notype_declarator): Likewise. + (object_template_id): Accept any kind of identifier after TEMPLATE. + (notype_qualified_id): Don't add template declarators here. + +Sat Sep 27 16:21:58 1997 Mark Mitchell + + * call.c (add_template_candidate): Add explicit_targs parameter. + (build_scoped_method_call): Use it. + (build_overload_call_real): Likewise. + (build_user_type_conversion_1): Likewise. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + (build_new_function_call): Handle TEMPLATE_ID_EXPR. + (build_new_method_call): Likewise. + + * class.c (finish_struct_methods): Add specialization pass to + determine which methods were specializing which other methods. + (instantiate_type): Handle TEMPLATE_ID_EXPR. + + * cp-tree.def (TEMPLATE_ID_EXPR): New tree code. + + * cp-tree.h (name_mangling_version): New variable. + (flag_guiding_decls): Likewise. + (build_template_decl_overload): New function. + (begin_specialization): Likewise. + (reset_specialization): Likewise. + (end_specialization): Likewise. + (determine_explicit_specialization): Likewise. + (check_explicit_specialization): Likewise. + (lookup_template_function): Likewise. + (fn_type_unification): Add explicit_targs parameter. + (type_unification): Likewise. + + * decl.c (duplicate_decls): Add smarts for explicit + specializations. + (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function + specializations. + (grokfndecl): Call check_explicit_specialization. + + * decl2.c (lang_decode_option): Handle -fname-mangling-version. + (build_expr_from_tree): Handle TEMPLATE_ID_EXPR. + (check_classfn): Handle specializations. + + * error.c (dump_function_name): Print specialization arguments. + + * friend.c (do_friend): Don't call pushdecl for template + instantiations. + + * init.c (build_member_call): Handle TEMPLATE_ID_EXPR. + + * lang-options.h: Add -fname-mangling-version, -fguiding-decls, + and -fno-guiding-decls. + + * lex.c (identifier_type): Return PFUNCNAME for template function + names. + + * method.c (build_decl_overload_real): New function. + (build_template_parm_names): New function. + (build_overload_identifier): Use it. + (build_underscore_int): New function. + (build_overload_int): Use it. Add levels for template + parameters. + (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs. + (build_overload_nested_names): Handle template type parameters. + (build_template_decl_overload): New function. + + * parse.y (YYSTYPE): New ntype member. + (nested_name_specifier): Use it. + (nested_name_specifier_1): Likewise. + (PFUNCNAME): New token. + (template_id, object_template_id): New non-terminals. + (template_parm_list): Note specializations. + (template_def): Likewise. + (structsp): Likewise. + (fn.def2): Handle member template specializations. + (component_decl_1): Likewise. + (direct_notype_declarator): Handle template-ids. + (component_decl_1): Likewise. + (direct_notype_declarator): Handle template-ids. + (primary): Handle TEMPLATE_ID_EXPR, and template-ids. + + * pt.c (processing_specializations): New variable. + (template_header_count): Likewise. + (type_unification_real): New function. + (processing_explicit_specialization): Likewise. + (note_template_header): Likewise. + (is_member_template): Handle specializations. + (end_template_decl): Call reset_specialization. + (push_template_decl): Handle member template specializations. + (tsubst): Likewise. + (tsubst_copy): Handle TEMPLATE_ID_EXPR. + (instantiate_template): Handle specializations. + (instantiate_decl): Likewise. + (fn_type_unification): Handle explicit_targs. + (type_unification): Likewise. Allow incomplete unification + without an error message, if allow_incomplete. + (get_bindings): Use new calling sequence for fn_type_unification. + + * spew.c (yylex): Handle PFUNCNAME. + + * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR. + (really_overloaded_fn): Likewise. + (get_first_fn): Handle function templates. + + * typeck.c (build_x_function_call): Use really_overloaded_fn. + Handle TEMPLATE_ID_EXPR. + (build_x_unary_op): Likewise. + (build_unary_op): Likewise. + (mark_addressable): Templates whose address is taken are marked + as used. + +1997-09-25 Andreas Schwab + + * decl.c (init_decl_processing): Declare __builtin_constant_p as + accepting any kind of type, not only int. + +Fri Sep 26 00:22:56 1997 Jason Merrill + + * search.c (get_matching_virtual): Notice virtual bases when sorrying + about covariant returns. + + * parse.y (member_init): Also imply typename here. Remove ancient + extension for initializing base members. + +Thu Sep 25 11:11:13 1997 Jason Merrill + + Handle multi-level typenames and implicit typename in base list. + * parse.y (typename_sub{,[0-2]}): New rules. + (structsp, rule TYPENAME_KEYWORD): Use typename_sub. + (nonnested_type): New rule. + (complete_type_name): Use it. + (base_class.1): Use typename_sub and nonnested_type. + (nested_name_specifier): Don't elide std:: here. + * decl.c (make_typename_type): Handle getting a type for NAME. + (lookup_name_real): Turn std:: into :: here. + + Rvalue conversions were removed in London. + * call.c (is_subseq): Don't consider lvalue transformations. + (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK. + (joust): Re-enable ?: kludge. + +1997-09-22 Brendan Kehoe + + * decl.c (start_function): Up warning of no return type to be a + pedwarn. + +Mon Sep 22 14:15:34 1997 Benjamin Kosnik + + * init.c (expand_member_init): Don't set TREE_USED. + * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED + set,don't clear TREE_USED wholesale. + +Sat Sep 20 15:31:00 1997 Jason Merrill + + * call.c (build_over_call): Do require_complete_type before + build_cplus_new. + +Thu Sep 18 16:47:52 1997 Jason Merrill + + * search.c (lookup_field): Call complete_type in all cases. + + * decl.c (finish_function): Just warn about flowing off the end. + +Wed Sep 17 10:31:25 1997 Jason Merrill + + * decl.c (grokparms): Don't bash a permanent list node if we're + in a function. + +1997-09-17 Brendan Kehoe + + * Makefile.in (CONFLICTS): Fix s/r conflict count to 18. + +Tue Sep 16 14:06:56 1997 Jason Merrill + + * call.c (build_new_op): Give better error for syntactically + correct, but semantically invalid, use of undeclared template. + + * call.c (compare_qual): Handle pmfs. + + * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn + after the exception spec. + +Mon Sep 15 11:52:13 1997 Jason Merrill + + * call.c (null_ptr_cst_p): Integer type, not integral type. + + * call.c (joust): Disable warnings until they can be moved to the + right place. + +Fri Sep 12 16:11:13 1997 Per Bothner + + * Makefile.in, config-lang.in: Convert to autoconf. + +Thu Sep 11 17:14:55 1997 Jason Merrill + + * decl.c (lookup_name_real): Add implicit 'typename' to types from + base classes. + + * pt.c (most_specialized_class): Fix typo. + (tsubst): Move constant folding to TREE_VEC case. + +Thu Sep 11 10:08:45 1997 Mark Mitchell + + * pt.c (do_poplevel): Don't warn about unused local variables + while processing_template_decl since we don't always know whether + or not they will need constructing/destructing. + + * pt.c (uses_template_parms): Check the values of an enumeration + type to make sure they don't depend on template parms. + + * decl.c (make_typename_type): Don't lookup the field if the + context uses template parms, even if we're not + processing_template_decl at the moment. + + * pt.c (coerce_template_parms): Avoid looking at the + TYPE_LANG_DECL portion of a typename type, since there won't be + one. + (tsubst): Do constant folding as necessary to make sure that + arguments passed to lookup_template_class really are constants. + +Wed Sep 10 16:39:26 1997 Jim Wilson + + * Make-lang.in (LN, LN_S): New macros, use where appropriate. + +Wed Sep 10 11:21:55 1997 Jason Merrill + + * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO. + * decl2.c (finish_file): Only register exception tables if we + need to. + + * decl.c (init_decl_processing): Add __builtin_[fs]p. + +Tue Sep 9 19:49:38 1997 Jason Merrill + + * pt.c (unify): Just return 0 for a TYPENAME_TYPE. + +Tue Sep 9 17:57:25 1997 Mark Mitchell + + * error.c (dump_decl): Avoid crashing when presented with a + uninitialized constant, as can occur with a template parameter. + (dump_expr): Make sure that there are enough levels of + current_template_parms before we start diving through them. + +1997-09-09 Brendan Kehoe + + * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to + c-typeck.c. + +Tue Sep 9 09:36:39 1997 Benjamin Kosnik + + * except.c (expand_throw): Call build_delete for all + exception types, not just objects with destructors. + +Mon Sep 8 02:33:20 1997 Jody Goldberg + + * decl.c (current_local_enum): Remove static. + * pt.c (tsubst_enum): Save and restore value of current_local_enum + in case template is expanded in enum decl. + (instantiate_class_template): Use new tsubst_enum signature. + (tsubst_expr): Likewise. + +Mon Sep 8 01:21:43 1997 Mark Mitchell + + * pt.c (begin_member_template_processing): Take a function as + argument, not a set of template arguments. Use the template + parameters, rather than the arguments. Handle non-type parameters + correctly. Push a binding level for the parameters so that multiple + member templates using the same parameter names can be declared. + (end_member_template_processing): Pop the binding level. + (push_template_decl): Mark member templates as static when + appropriate. + + * lex.c (do_pending_inlines): Pass the function, not its template + arguments, to begin_member_template_processing. + (process_next_inline): Likewise. + (do_pending_defargs): Likewise. + + * error.c (dump_expr): Obtain the correct declaration for a + TEMPLATE_CONST_PARM. + + * call.c (add_template_conv_candidate): New function. + (build_object_call): Handle member templates, as done in the other + build_ functions. + +Sat Sep 6 10:20:27 1997 Mark Mitchell + + * decl.c (replace_defag): Undo previous change. + * lex.c (do_pending_defargs): Deal with member templates. + + * pt.c (is_member_template): Avoid crashing when passed a + non-function argument. + +Fri Sep 5 17:27:38 1997 Jason Merrill + + * class.c (grow_method): Remove check for redeclaration. + +Fri Sep 5 01:37:17 1997 Mark Mitchell + + * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro. + (DECL_INNERMOST_TEMPLATE_PARMS): Likewise. + (PRIMARY_TEMPLATE_P): Use it. + * call.c (build_overload_call_real): Use it. + * class.c (instantiate_type): Likewise. + * decl.c (decls_match): Likewise. + * method.c (build_overload_identifier): Likewise. + * pt.c (push_template_decl): Likewise. + (classtype_mangled_name): Likewise. + (lookup_template_class): Likewise. + + * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to + DECL_NTPARMS to conform to usage elsewhere. + * call.c (add_template_candidate): Likewise. + * class.c (instantiate_type): Likewise. + * pt.c (instantiate_template): Likewise. + (get_bindings): Likewise. + + * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of + is_member_template. + + * pt.c (unify): Undo changes to allow multiple levels of template + parameters. + (type_unification): Likewise. + (fn_type_unification): Likewise. + (get_class_bindings): Likewise. + * cp-tree.h (Likewise). + + * decl.c (replace_defarg): Check that the type of the default + parameter does not invlove a template type before complaining + about the initialization. + + * error.c (dump_expr): Deal with template constant parameters in + member templates correctly. + + * pt.c (is_member_template): Deal with class specializations + correctly. + (tsubst): Handle "partial instantiation" of member templates + correctly. + +Wed Sep 3 12:30:24 1997 Mark Mitchell + + * pt.c (type_unification): Change calling sequence to allow for + multiple levels of template parameters. + (tsubst_expr): Likewise. + (tsubst): Likewise. + (tsubst_copy): Likewise. + (instantiate_template): Likewise. + (unify): Likewise. + * call.c (build_overload_call_real): Use it. + (add_builtin_candidate): Use it. + (build_new_method_call): Use it. + * class.c (instantiate_type): Use it. + * decl.c (grokdeclarator): Use it. + * decl2.c (finish_file): Use it. + * method.c (build_overload_identifier): Use it. + + * call.c (add_template_candidate): Add additional parameter for + the function return type. Call fn_type_unification istead of + type_unification. + (build_user_type_conversion_1): Handle member templates. + (build_new_function_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + + * class.c (grow_method): Don't give an error message indicating + that two member templates with the same name are ambiguous. + (finish_struct): Treat member template functions just like member + functions. + + * cp-tree.h (check_member_template): Add declaration. + (begin_member_template_processing): Likewise. + (end_member_template_processing): Likewise. + (fn_type_unification): Likewise. + (is_member_template): Likewise. + (tsubst): Change prototype. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (instantiate_template): Likewise. + (get_bindings): Likewise. + + * decl.c (decls_match): Handle multiple levels of template + parameters. + (pushdecl): Handle template type params just like other type + declarations. + (push_class_level_binding): Return immediately if the + class_binding_level is NULL. + (grokfndecl): If check_classfn() returns a member_template, use + the result of the template, not the template itself. + + * decl2.c (check_member_template): New function. Check to see + that the entity declared to be a member template can be one. + (check_classfn): Allow redeclaration of member template functions + with different types; the new functions can be specializations or + explicit instantiations. + + * error.c (dump_decl): Handle multiple levels of template + parameters. + (dump_function_decl): Update to handle function templates. + + * lex.c (do_pending_inlines): Set up template parameter context + for member templates. + (process_next_inline): Likewise. + + * method.c (build_overload_identifier): Adjust for multiple levels + of template parameters. + + * parse.y (fn.def2): Add member templates. + (component_decl_1): Likewise. + + * pt.c (begin_member_template_processing): New function. + (end_member_template_processing): Likewise. + (is_member_template): Likewise. + (fn_type_unification): Likewise. + (current_template_parms): Return a vector of all the template + parms, not just the innermost level of parms. + (push_template_decl): Deal with the possibility of member + templates. + (lookup_template_class): Likewise. + (uses_template_parms): Likewise. + (tsubst): Modify processing to TEMPLATE_TYPE_PARM and + TEMPLATE_CONST_PARM to deal with multiple levels of template + arguments. Add processing of TEMPLATE_DECL to produce new + TEMPLATE_DECLs from old ones. + (do_decl_instantiation): Handle member templates. + + * search.c (lookup_fnfields_1): Handle member template conversion + operators. + + * tree.c (cp_tree_equal): Check the levels, as well as the + indices, of TEMPLATE_CONST_PARMs. + + * typeck.c (comptypes): Check the levels, as well as the indices, + fo TEMPLATE_TYPE_PARMs. + (build_x_function_call): Treat member templates like member + functions. + +Wed Sep 3 11:09:25 1997 Jason Merrill + + * typeck.c (c_expand_return): Always convert_for_initialization + before checking for returning a pointer to local. + + * pt.c (type_unification): If strict and the function parm doesn't + use template parms, just compare types. + +Wed Sep 3 10:35:49 1997 Klaus Espenlaub + + * method.c (build_overloaded_value): Replace direct call + to the floating point emulator with REAL_VALUE_TO_DECIMAL macro. + +Wed Sep 3 00:02:53 1997 Jason Merrill + + * typeck.c (convert_arguments): Don't arbitrarily choose the first + of a set of overloaded functions. + +Tue Sep 2 12:09:13 1997 Jason Merrill + + * lex.c (real_yylex): Don't elide __FUNCTION__. + + * method.c (build_overload_value): Add in_template parm. + (build_overload_int): Likewise. + (build_overload_identifier): Pass it. + + * decl.c (duplicate_decls): Don't bash a previous template + definition with a redeclaration. + + * pt.c (unify): float doesn't match double. + + * pt.c (do_type_instantiation): Handle getting a _TYPE or a + TYPE_DECL. Handle getting non-template types. + * parse.y (explicit_instantiation): Use typespec instead of + aggr template_type. + +Tue Sep 2 10:27:08 1997 Richard Henderson + + * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings. + +Mon Sep 1 13:19:04 1997 Eugene Mamchits + + * call.c (add_builtin_candidate): Add missing TREE_TYPE. + (compare_ics): Likewise. + +Mon Sep 1 13:19:04 1997 Jason Merrill + + * call.c (joust): Warn about choosing one conversion op over + another because of 'this' argument when the other return type is + better. + (source_type): New fn. + + * call.c (build_new_op): Strip leading REF_BIND from first operand + to builtin operator. + + * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we + use its RTL. + +Thu Aug 28 09:45:23 1997 Jason Merrill + + * call.c (null_ptr_cst_p): Remove support for (void*)0. + +Wed Aug 27 02:03:34 1997 Jeffrey A Law + + * typeck.c (expand_target_expr): Make definition match declaration. + + * class.c (get_basefndecls): Make definition match declaration. + +Mon Aug 25 14:30:02 1997 Jason Merrill + + * input.c (sub_getch): Eventually give up and release the input file. + + * decl.c (cp_finish_decl): If #p i/i, put inline statics in the + right place. + + * call.c (joust): Tweak message. + +Sat Aug 23 18:02:59 1997 Mark Mitchell + + * error.c (type_as_string): Put const/volatile on template type + parameters where appropriate. + +Sat Aug 23 17:47:22 1997 Jeffrey A Law + + * call.c (strictly_better): Make arguments unsigned ints. + +Thu Aug 21 18:48:44 1997 Jason Merrill + + * lex.c (real_yylex): Refer to __complex instead of complex. + +Thu Aug 21 22:25:46 1997 J"orn Rennecke + + * lex.c (real_yylex): Don't use getc directly. + +Wed Aug 20 17:25:08 1997 Jason Merrill + + * call.c (is_subseq): Don't try to be clever. + +Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * parse.y, pt.c: Include "except.h". + * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c, + error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c, + lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c, + sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish + prototyping. + +Wed Aug 20 01:34:40 1997 Jason Merrill + + * decl2.c (mark_vtable_entries): Instead of replacing pure + virtuals with a reference to __pure_virtual, copy the decl and + change the RTL. + +Tue Aug 19 02:26:07 1997 Jason Merrill + + * pt.c (lookup_nested_type_by_name): Handle typedef wierdness. + + * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com. + + * pt.c (instantiate_class_template): Call repo_template_used + before finish_prevtable_vardecl. + + * call.c (is_subseq): New fn. + (compare_ics): Use it. + + * repo.c (finish_repo): Don't crash on no args. + + * parse.y (named_complex_class_head_sans_basetype): Handle + explicit global scope. + * decl2.c (handle_class_head): New fn. + + * pt.c (unify): Add CONST_DECL case. + +Thu Aug 14 10:05:13 1997 Brendan Kehoe + + * rtti.c (permanent_obstack): Fix decl to not be a pointer. + + * cp-tree.h (report_type_mismatch): Add prototype. + * call.c (build_overload_call_real): Remove erroneous fourth + argument to report_type_mismatch. + (build_user_type_conversion_1): Remove erroneous second arg to + tourney. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + +Wed Aug 13 19:19:25 1997 Jason Merrill + + * error.c (dump_decl): Don't bother processing a function with no + DECL_LANG_SPECIFIC. + + * method.c (emit_thunk): Call init_function_start in the macro case. + +Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not + defined and used to set flag_vtable_thunks. + +Tue Aug 12 20:13:57 1997 Jason Merrill + + * parse.y: Don't clear the inlines from their obstack until they've + all been processed. + + * decl.c (duplicate_decls): Don't complain about exception + specification mismatch if flag_exceptions is off. + +Mon Aug 11 15:01:56 1997 Marc Lehmann + + * Make-lang.in (c++.distclean): Remove g++.c on make distclean. + +Sun Aug 10 12:06:09 1997 Paul Eggert + + * cp-tree.h: Replace STDIO_PROTO with PROTO in include files. + * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c: + Include before include files that formerly used STDIO_PROTO. + + * decl.c, g++spec.c, lex.c, method.c, repo.c: + Include "config.h" first, as per autoconf manual. + +Fri Aug 8 11:47:48 1997 Jason Merrill + + * decl.c (duplicate_decls): Tweak wording. + * lex.c (do_pending_defargs): Don't die if we see a default arg + that isn't a DEFAULT_ARG. + * error.c (dump_expr): Handle DEFAULT_ARG. + + * decl2.c (lang_decode_option): Handle -fhandle-exceptions. + * lang-options.h: Add -fhandle-exceptions. + + * class.c (build_vtable): Vtables are artificial. + (prepare_fresh_vtable): Likewise. + +Wed Aug 6 11:02:36 1997 Jason Merrill + + * cvt.c (ocp_convert): After converting to the target type, set + LOOKUP_NO_CONVERSION. + + * call.c (joust): Warn about potentially confusing promotion rules + with -Wsign-promo. + * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo. + +Tue Aug 5 15:15:07 1997 Michael Meissner + + * exception.cc: Declare __terminate_func with noreturn attribute. + +Fri Aug 1 03:18:15 1997 Jason Merrill + + * parse.y: Break out eat_saved_input, handle errors. + (function_try_block): Use compstmt instead of compstmt_or_error. + +Thu Jul 31 17:14:04 1997 Jason Merrill + + * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE. + +Fri Jul 4 01:45:16 1997 Andreas Schwab + + * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for + existence of cc1plus check whether $(LANGUAGES) contains C++. + +Wed Jul 30 13:04:21 1997 Andreas Schwab + + * method.c (do_build_copy_constructor): When copying an anonymous + union member loop around to handle nested anonymous unions. Use + the offset of the member relative to the outer structure, not the + union. + +Tue Jul 29 21:17:29 1997 Jason Merrill + + * call.c (resolve_args): New fn. + (build_new_function_call): Use it. + (build_object_call): Likewise. + (build_new_method_call): Likewise. + +Mon Jul 28 16:02:36 1997 Jason Merrill + + * call.c (build_over_call): tsubst all default parms from templates. + +Wed Jul 23 13:36:25 1997 Jason Merrill + + * decl.c (struct cp_function): Add static_labelno. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + +Tue Jul 22 14:43:29 1997 Jason Merrill + + * typeck.c (build_component_ref_1): Convert from reference. + +Tue Jul 22 11:06:23 1997 Brendan Kehoe + + * parse.y (current_declspecs, prefix_attributes): Initialize to + NULL_TREE. + + * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil + before we try to force it to be a TREE_LIST. + (decl): Make sure $1.t is non-nil. + +Sun Jul 20 11:53:07 1997 Jason Merrill + + * pt.c (uses_template_parms): Handle template first-parse codes. + + * decl.c (cp_finish_decl): Only warn about user-defined statics. + +Fri Jul 18 17:56:08 1997 Jason Merrill + + * pt.c (unify): Handle BOOLEAN_TYPE. + + * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE. + * pt.c (tsubst): Don't set it. + * call.c (build_over_call): Use uses_template_parms. + +Thu Jul 17 18:06:30 1997 Jason Merrill + + * method.c (build_overload_nested_name): Use static_labelno + instead of var_labelno. + (build_qualified_name): New fn. + (build_overload_name): Split out from here. + (build_static_name): Use build_qualified_name. + * decl.c (cp_finish_decl): Statics in extern inline functions + have comdat linkage. + (start_function): Initialize static_labelno. + +Thu Jul 17 11:20:17 1997 Benjamin Kosnik + + * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy + before "all member functions in class [] are private". + +Wed Jul 16 23:47:08 1997 Jason Merrill + + * lex.c (do_scoped_id): convert_from_reference. + * init.c (build_offset_ref): Likewise. + +Wed Jul 16 12:34:29 1997 Benjamin Kosnik + + * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list. + +Mon Jul 14 03:23:46 1997 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Promote index + before saving it. + +Sun Jul 13 00:11:52 1997 Jason Merrill + + * tree.c (layout_basetypes): Move non-virtual destructor warning. + * decl.c (xref_basetypes): Remove non-virtual destructor warning. + +Sat Jul 12 12:47:12 1997 Jason Merrill + + * decl.c (grokdeclarator): Call add_defarg_fn for the function + type, too. + * lex.c (add_defarg_fn): Adjust. + (do_pending_defargs): Adjust. Don't skip the first parm. + +Fri Jul 11 01:39:50 1997 Jason Merrill + + * decl.c (build_enumerator): Global enumerators are also readonly. + + * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast. + (build_dynamic_cast): Call it and convert_from_reference. + + * lex.c (add_defarg_fn): New fn. + (snarf_defarg): Don't add to defarg_types. + (do_pending_defargs): Lose defarg_types. All fns we process now + have defargs. + * decl.c (grokfndecl): Call add_defarg_fn. + + * Makefile.in (CONFLICTS): Expect 18 s/r conflicts. + * cp-tree.def: Add DEFAULT_ARG. + * spew.c (yylex): Call snarf_defarg as appropriate. + * parse.y: New tokens DEFARG and DEFARG_MARKER. + (defarg_again, pending_defargs, defarg, defarg1): New rules. + (structsp): Use pending_defargs. + (parms, full_parm): Use defarg. + * lex.c (init_lex): Initialize inline_text_firstobj. + (do_pending_inlines): Never pass the obstack to feed_input. + (process_next_inline): Call end_input instead of restore_pending_input. + (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs, + finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns. + * input.c (end_input): New fn. + (sub_getch): At the end of some fed input, just keep returning EOF + until someone calls end_input. + Remove 'obstack' field from struct input_source. + * decl.c (grokparms): Handle DEFAULT_ARG. + (replace_defarg): New fn. + * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros. + +Wed Jul 9 13:44:12 1997 Jason Merrill + + * call.c (implicit_conversion): If nothing else works, try binding + an rvalue to a reference. + +Wed Jul 9 13:04:38 1997 Geoffrey Noer + + * decl.c (init_decl_processing): Fix Jun 30 patch -- move + ifndef for Cygwin32 to include SIGSEGV. + +Thu Jul 3 01:44:05 1997 Jason Merrill + + * class.c (finish_struct_1): Only complain about pointers without + copy stuff if there are any constructors. + + * rtti.c (build_dynamic_cast): Call complete_type on the types. + + * decl.c (grokfndecl): If the function we chose doesn't actually + match, die. + + * decl2.c (grokclassfn): Don't specify 'const int' for the + artificial destructor parm. + + * pt.c (type_unification): If we are called recursively, nothing + decays. + +Mon Jun 30 17:53:21 1997 Geoffrey Noer + + * decl.c (init_decl_processing): Stop trying to catch signals + other than SIGABRT since the Cygwin32 library doesn't support + them correctly yet. This fixes a situation in which g++ causes + a hang on SIGSEGVs and other such signals in our Win32-hosted + tools. + +Mon Jun 30 14:50:01 1997 Jason Merrill + + * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data. + +Fri Jun 27 15:18:49 1997 Jason Merrill + + * typeck2.c (store_init_value): Always return the value if our + type needs constructing. + + * method.c (hack_identifier): Convert class statics from + reference, too. + +Thu Jun 26 11:44:46 1997 Jason Merrill + + * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency. + +Thu Jun 19 16:49:28 1997 Mike Stump + + * typeck.c (c_expand_return): Make sure we clean up temporaries at + the end of return x; + +Thu Jun 19 12:28:43 1997 Brendan Kehoe + + * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER. + +Tue Jun 17 18:35:57 1997 Mike Stump + + * except.c (expand_builtin_throw): Add support + -fno-sjlj-exceptions -fPIC exception handling on the SPARC. + +Mon Jun 16 01:24:37 1997 Jason Merrill + + * repo.c (extract_string): Null-terminate. + + * cp-tree.h (TI_SPEC_INFO): New macro. + (CLASSTYPE_TI_SPEC_INFO): New macro. + * pt.c (push_template_decl): Correctly determine # of template parms + for partial specs. + + * call.c (compare_ics): Really fix 'this' conversions. + + * pt.c (do_decl_instantiation): Don't crash on explicit inst of + non-template fn. + + * pt.c (push_template_decl): Complain about mismatch in # of + template parms between a class template and a member template. + +Sun Jun 15 02:38:20 1997 Jason Merrill + + * method.c (synthesize_method): You can't call + function_cannot_inline_p after finish_function. + * decl.c (finish_function): Turn on flag_inline_functions and turn + off DECL_INLINE before handing a synthesized method to the + backend. + +Thu Jun 12 17:35:28 1997 Jason Merrill + + * method.c (synthesize_method): Remove July 30 change to never set + DECL_INLINE if at_eof. + +Thu Jun 12 15:25:08 1997 Mike Stump + + * xref.c (GNU_xref_member): Ensure that the node has a + decl_lang_specific part before checking DECL_FRIEND_P. + +Thu Jun 12 12:36:05 1997 Jason Merrill + + * pt.c (instantiate_class_template): Diagnose non-class types used + as bases. + +Wed Jun 11 17:33:40 1997 Jason Merrill + + * typeck.c (build_conditional_expr): Use convert_for_initialization + instead of convert_and_check. + +Wed Jun 11 12:31:33 1997 Brendan Kehoe + + * parse.y (typespec): Don't pedwarn for typeof. + +Tue Jun 10 00:22:09 1997 Jason Merrill + + * repo.c (finish_repo): Only check changes if we would write a + repo file. + + * call.c (compare_ics): Fix handling of 'this' conversions. + + * pt.c (do_decl_instantiation): Support static data too. Rename + from do_function_instantiation. + * cp-tree.h: Adjust. + * parse.y: Adjust. + + * repo.c (extract_string): New fn. + (get_base_filename): Use it. + (init_repo): Compare old args with current args. + +Mon Jun 9 14:25:30 1997 Mike Stump + + * Makefile.in, Make-lang.in: Protect C-ls with a comment + character, idea from Paul Eggert . + +Mon Jun 9 01:52:03 1997 Jason Merrill + + * typeck.c (c_expand_return): Be more persistent in looking for + returned temps. + + * cvt.c (build_up_reference): Use NOP_EXPR for switching from + pointer to reference. + + * class.c (build_vbase_path): Don't do anything if PATH has no steps. + +Sun Jun 8 03:07:05 1997 Jason Merrill + + * init.c (build_member_call, build_offset_ref): + Use do_scoped_id instead of do_identifier. + + * cvt.c (convert): Remove bogosity. + +Sat Jun 7 20:50:17 1997 Brendan Kehoe + + * cvt.c (build_up_reference): Do checks of ARGTYPE and + TARGET_TYPE before trying to use get_binfo. + +Fri Jun 6 17:36:39 1997 Jason Merrill + + * cvt.c (build_up_reference): Call get_binfo to get access control. + + * decl2.c (import_export_decl): If we don't support weaks, leave + statics undefined. + +Fri Jun 6 15:55:49 1997 Mike Stump + + * except.c (expand_builtin_throw): Add support for machines that + cannot access globals after throw's epilogue when + -fno-sjlj-exceptions is used. + +Thu Jun 5 16:28:43 1997 Jason Merrill + + * parse.y: 'std::' becomes '::'. + * lex.c (real_yylex): Remove 'namespace' warning. + * init.c (build_member_call): Ignore 'std::'. + (build_offset_ref): Likewise. + * decl2.c (do_using_directive): Ignore 'using namespace std;'. + (do_toplevel_using_decl): Ignore 'using std::whatever'. + * decl.c (push_namespace): Just sorry. + (pop_namespace): Nop. + (init_decl_processing): Declare std namespace. + +Tue Jun 3 18:08:23 1997 Jason Merrill + + * search.c (push_class_decls): A name which ambiguously refers to + several instantiations of the same template just refers to the + template. + +Tue Jun 3 12:30:40 1997 Benjamin Kosnik + + * decl.c (build_enumerator): Fix problem with unsigned long + enumerated values being smashed to ints, causing overflow + when computing next enumerated value (for enum values around + MAX_VAL). + +Mon Jun 2 17:40:56 1997 Jason Merrill + + * typeck.c (build_component_ref): Only call mark_used on a decl. + +Thu May 29 15:54:17 1997 Brendan Kehoe + + * typeck.c (build_c_cast): Make the check for a ptr to function + more specific before possible default_conversion call. + +Thu May 29 13:02:06 1997 Mike Stump + + * except.c (expand_exception_blocks): Simplify and fix and make + sure we don't end a region in a sequence, as expand_end_bindings + doesn't like it. + +Wed May 28 17:08:03 1997 Mike Stump + + * except.c (init_exception_processing): Mark terminate as not + returning so that the optimizer can optimize better. + +Tue May 27 19:49:19 1997 Mike Stump + + * cvt.c (convert): Don't do any extra work, if we can avoid it + easily. + +Tue May 27 18:21:47 1997 Mike Stump + + * *.[chy]: Change cp_convert to ocp_convert, change convert to + cp_convert. convert is now reserved for the backend, and doesn't + have the semantics a frontend person should ever want. + +Fri May 23 10:58:31 1997 Jason Merrill + + * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled. + Lose -traditional support. + +Thu May 22 15:41:28 1997 Jason Merrill + + * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype). + + * parse.y (self_reference): Do it for templates, too. + * class.c (pushclass): Don't overload_template_name; the alias + generated by build_self_reference serves the same purpose. + + * tree.c (list_hash): Make static, take more args. + (list_hash_lookup): Likewise. + (list_hash_add): Make static. + (list_hash_canon): Lose. + (hash_tree_cons): Only build a new node if one isn't already in the + hashtable. + (hash_tree_chain): Use hash_tree_cons. + * cp-tree.h: Adjust. + * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead + of calling lookup_name. + +Wed May 21 18:24:19 1997 Jason Merrill + + * pt.c (instantiate_class_template): TYPE_VALUES for an enum + doesn't refer to the CONST_DECLs. + +Tue May 20 21:09:32 1997 Bob Manson + + * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever + is bigger. + (expand_class_desc): Convert the last argument to a sizetype. + +Tue May 20 13:55:57 1997 Brendan Kehoe + + * gxx.gperf (__complex, __complex__, __imag, __imag__, __real, + __real__): Add reswords. + * hash.h: Regenerate. + * lex.h (rid): Add RID_COMPLEX. + (RID_LAST_MODIFIER): Set to RID_COMPLEX. + * lex.c (init_lex): Add building of RID_COMPLEX. + (real_yylex): General cleanup in line with what c-lex.c also has, + sans the cruft for traditional; add handling of SPEC_IMAG, complex + types, and imaginary numeric constants. + * parse.y (REALPART, IMAGPART): Add tokens. + (unary_expr): Add REALPART and IMAGPART rules. + * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare. + * decl.c (complex_{integer,float,double,long}_type_node): Define + types. + (init_decl_processing): Set up the types. + (grokdeclarator): Add handling of RID_COMPLEX. Set and use + DEFAULTED_INT instead of EXPLICIT_INT when we default to int type. + * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases. + * cvt.c (cp_convert): Handle COMPLEX_TYPE. + * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add + COMPLEX_TYPE case. + * method.c (build_overload_name): Add handling of the different + COMPLEX_TYPEs, prefixing them with `J'. + * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE + as a template parm. + (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case. + * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases. + (mapcar): Handle COMPLEX_CST. + * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE. + (common_type): Add code for complex types. + (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases. + (convert_for_assignment): Likewise. + (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases. + +Mon May 19 12:26:27 1997 Jason Merrill + + * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to + tsubst_expr, as it might try to do overload resolution. + +Sat May 17 10:48:31 1997 Jason Merrill + + * pt.c (instantiate_class_template): Oops. + +Fri May 16 14:23:57 1997 Jason Merrill + + * cp-tree.def: Add TAG_DEFN. + * pt.c (tsubst_enum): New fn. + (instantiate_class_template): Use it. + (tsubst_expr): Support TAG_DEFN. + (tsubst): Support local enums. + (tsubst_copy): Likewise. + * decl.c (finish_enum): Likewise. + (start_enum): If this is a local enum, switch to permanent_obstack. + +Wed May 14 19:08:28 1997 Mike Stump + + * decl.c (store_parm_decls): Set last_parm_cleanup_insn here. + (finish_function): Put the base init code for constructors just + after the parm cleanup insns. + (struct cp_function): Add last_parm_cleanup_insn. + (push_cp_function_context): Likewise. + (pop_cp_function_context): Likewise. + +Tue May 13 15:51:20 1997 Jason Merrill + + * pt.c (tsubst_copy): Handle BIT_NOT_EXPR. + +Wed May 7 11:17:59 1997 Brendan Kehoe + + * method.c (emit_thunk) [ASM_OUTPUT_MI_THUNK]: Build up the RTL + for THUNK_FNDECL before we switch to temporary allocation. + +Mon May 5 14:46:53 1997 Jason Merrill + + * call.c (build_new_op): Handle null arg2 for ?:. + +Thu May 1 18:26:37 1997 Mike Stump + + * except.c (expand_exception_blocks): Ensure that we flow through + the end of the exception region for the exception specification. + Move exception region for the exception specification in, so that + it doesn't protect the parm cleanup. Remove some obsolete code. + * decl.c (store_parm_decls): Likewise. + (finish_function): Likewise. + +Tue Apr 29 15:38:54 1997 Jason Merrill + + * init.c (build_new): Fix nothrow handling. + +Tue Apr 29 14:29:50 1997 Brendan Kehoe + + * init.c (emit_base_init): Don't warn about the initialization + list for an artificial member. + +Fri Apr 25 17:47:59 1997 Brendan Kehoe + + * expr.c (do_case): Handle !START case for the error msg. + +Fri Apr 25 11:55:23 1997 Jason Merrill + + * decl2.c, lang-options.h: New option -Weffc++. + * class.c, decl.c, init.c, typeck.c: Move Effective C++ warnings + to -Weffc++. + + * decl2.c (finish_prevtable_vardecl): Change NO_LINKAGE_HEURISTICS + to MULTIPLE_SYMBOL_SPACES. + +Wed Apr 23 18:06:50 1997 Jason Merrill + + * method.c (emit_thunk, generic case): Set current_function_is_thunk. + + * method.c (emit_thunk, macro case): Set up DECL_RESULT. + + * typeck.c (c_expand_return): Don't complain about returning void + to void in an artificial function. + * method.c (make_thunk): Change settings of READONLY/VOLATILE, + don't set DECL_RESULT, set DECL_ARTIFICIAL. + (emit_thunk, generic code): Also set up DECL_LANG_SPECIFIC. + +Wed Apr 23 14:43:06 1997 Mike Stump + + * init.c (init_decl_processing): Add support for setjmp/longjmp based + exception handling. + * except.c (init_exception_processing): Likewise. + (expand_end_catch_block): Likewise. + (expand_exception_blocks): Likewise. + (expand_throw): Likewise. + * exception.cc (__default_terminate): Likewise. + + * init.c (perform_member_init): Use new method of expr level + cleanups, instead of cleanups_this_call and friends. + (emit_base_init): Likewise. + (expand_aggr_vbase_init_1): Likewise. + (expand_vec_init): Likewise. + * decl.c (cp_finish_decl): Likewise. + (expand_static_init): Likewise. + (store_parm_decls): Likewise. + (cplus_expand_expr_stmt): Likewise. + * decl2.c (finish_file): Likewise. + + * Make-lang.in (exception.o): Ok to compile with -O now. + + * decl.c (maybe_build_cleanup_1): We no longer have to unsave, as + we know it will be done later by the backend. + + * decl2.c (lang_f_options): Remove support for short temps. + * lang-options.h: Likewise. + +Wed Apr 23 04:12:06 1997 Jason Merrill + + * tree.c (varargs_function_p): New fn. + * method.c (emit_thunk): Replace broken generic code with code to + generate a heavyweight thunk function. + +Tue Apr 22 02:45:18 1997 Jason Merrill + + * pt.c (process_template_parm): pedwarn about floating-point parms. + + * decl.c (grokdeclarator): inline no longer implies static. + + * spew.c (yylex): Always return the TYPE_DECL if we got a scope. + +Mon Apr 21 15:42:27 1997 Jason Merrill + + * class.c (check_for_override): The signature of an overriding + function is not changed. + + * call.c (build_over_call): Move setting of conv into the loop. + Note: this change, along with the related changes of the 18th thru + the 20th of April, fix an infinite loop problem in conversions. + +Sun Apr 20 16:24:29 1997 Jason Merrill + + * call.c (build_user_type_conversion_1): Really ignore rvalue + conversions when looking for a REFERENCE_TYPE. + + * cvt.c (build_up_reference): Eviscerate, use build_unary_op. + * cp-tree.h (TREE_REFERENCE_EXPR): #if 0. + * typeck.c (decay_conversion): Don't set TREE_REFERENCE_EXPR. + (build_unary_op): Likewise. + * call.c (build_over_call): See through a CONVERT_EXPR around the + ADDR_EXPR for on a temporary. + * typeck.c (c_expand_return): See through a CONVERT_EXPR around + the ADDR_EXPR for a local variable. + +Fri Apr 18 12:11:33 1997 Jason Merrill + + * call.c (build_user_type_conversion_1): If we're trying to + convert to a REFERENCE_TYPE, only consider lvalue conversions. + (build_new_function_call): Print candidates. + (implicit_conversion): Try a temp binding if the lvalue conv is BAD. + (reference_binding): Binding a temporary of a reference-related type + is BAD. + +Thu Apr 17 14:37:22 1997 Brendan Kehoe + + * inc/typeinfo (type_info::before): Add cv-qualifier-seq. + * tinfo2.cc (type_info::before): Likewise. + +Mon Apr 14 12:38:17 1997 Jason Merrill + + * call.c (implicit_conversion): Oops. + +Fri Apr 11 02:18:30 1997 Jason Merrill + + * call.c (implicit_conversion): Try to find a reference conversion + before binding a const reference to a temporary. + +Wed Apr 2 12:51:36 1997 Mike Stump + + * exception.cc (__default_unexpected): Call terminate by default, + so that if the user overrides terminate, the correct function will + be called. + +Wed Mar 19 14:14:45 1997 Mike Stump + + * parse.y (left_curly): Avoid trying to use any fields of + error_mark_node, as there aren't any. + +Thu Mar 13 16:33:22 1997 Jason Merrill + + * lex.c (do_identifier): Avoid breaking on overloaded methods + as default arguments. + +Wed Mar 12 13:55:10 1997 Hans-Peter Nilsson + + * call.c (add_template_candidate): Initialize the variable "dummy". + +Mon Mar 10 15:13:14 1997 Brendan Kehoe + + * decl.c (start_decl): Make sure TYPE isn't an error_mark_node + before we try to use TYPE_SIZE and TREE_CONSTANT on it. + +Fri Mar 7 13:19:36 1997 Brendan Kehoe + + * cp-tree.h (comp_ptr_ttypes, more_specialized): Add decl. + (debug_binfo): Delete decl, not needed. + + * tree.c (fnaddr_from_vtable_entry, function_arg_chain, + promotes_to_aggr_type): Delete fns. + * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY, + SET_FNADDR_FROM_VTABLE_ENTRY, FUNCTION_ARG_CHAIN, + PROMOTES_TO_AGGR_TYPE): Delete alternates to #if 1. + + * decl.c (pending_invalid_xref{,_file,_line}): Delete unused vars. + + * friend.c (is_friend_type): Delete fn. + * cp-tree.h (is_friend_type): Delete decl. + + * decl.c (original_result_rtx, double_ftype_double, + double_ftype_double_double, int_ftype_int, long_ftype_long, + float_ftype_float, ldouble_ftype_ldouble, last_dtor_insn): Make static. + * typeck.c (original_result_rtx, warn_synth): Delete extern decls. + + * decl.c (push_overloaded_decl{,_top_level}): Make static, adding + fwd decls. + * cp-tree.h (push_overloaded_decl{,_top_level}): Delete decls. + + * decl.c (pushdecl_nonclass_level): #if 0, unused. + * cp-tree.h (pushdecl_nonclass_level): #if 0 decl. + + * lex.c (reinit_lang_specific): #if 0, unused. + * cp-tree.h (reinit_lang_specific): #if 0 decl. + + * decl.c (revert_static_member_fn): Make static, adding fwd decl. + * cp-tree.h (revert_static_member_fn): Delete decl. + + * class.c (root_lang_context_p): Delete fn. + * cp-tree.h (root_lang_context_p): Delete decl. + + * decl.c (set_current_level_tags_transparency): #if 0, unused. + * cp-tree.h (set_current_level_tags_transparency): #if 0 decl. + + * lex.c (set_vardecl_interface_info): Make static. + * cp-tree.h (set_vardecl_interface_info): Delete decl. + + * call.c (find_scoped_type): Make static. + * cp-tree.h (find_scoped_type): Delete decl. + + * search.c (convert_pointer_to_vbase): Make static. + * cp-tree.h (convert_pointer_to_vbase): Delete decl. + + * decl.c (const_ptr_type_node): Likewise. + * cp-tree.h (const_ptr_type_node): Delete decl. + + * typeck.c (common_base_type): Make static. + * cp-tree.h (common_base_types): Delete erroneous decl. + + * pt.c (classtype_mangled_name): Make static. + * cp-tree.h (classtype_mangled_name): Delete decl. + + * lex.c (check_newline): Make static. + * cp-tree.h (check_newline): Delete decl. + + * typeck.c (build_x_array_ref): Delete fn, same idea as + grok_array_decl. + * cp-tree.h (build_x_array_ref): Delete decl. + + * lex.c (copy_decl_lang_specific): Delete fn, same idea as + copy_lang_decl. + * cp-tree.h (copy_decl_lang_specific): #if 0 decl. + + * class.c (build_vtable_entry): Make static. + * cp-tree.h (build_vtable_entry): Delete decl. + + * class.c (build_vbase_pointer): Make static. + * cp-tree.h (build_vbase_pointer): Delete decl. + + * sig.c (build_sptr_ref): Add forward decl and make static. + * cp-tree.h (build_sptr_ref): Delete decl. + + * call.c (build_new_method_call): Add forward decl and make static. + * cp-tree.h (build_new_method_call): Delete decl. + + * call.c (build_object_call): Make static. + * class.c (check_for_override, complete_type_p, mark_overriders): + Likewise. + * decl.c (cp_function_chain): Likewise. + * lex.c (set_typedecl_interface_info, reinit_parse_for_block): + Likewise. + * pt.c (comp_template_args, get_class_bindings, push_tinst_level): + Likewise. + * tree.c (build_cplus_array_type_1): Likewise. + * typeck.c (comp_ptr_ttypes_{const,real,reinterpret}): Likewise. + (comp_target_parms): Likewise. + + * init.c (build_builtin_call): Make static. + * cp-tree.h (build_builtin_call): Delete decl. + + * typeck.c (binary_op_error): Delete decl. + * cp-tree.h (binary_op_error): Likewise. + +Thu Mar 6 16:13:52 1997 Brendan Kehoe + + * call.c (build_method_call): Compare against error_mark_node + directly, rather than the ERROR_MARK tree code. + * cvt.c (cp_convert): Likewise. + * decl.c (print_binding_level): Likewise. + (duplicate_decls): Likewise. + (grokdeclarator): Likewise. + (grokdeclarator): Likewise. + * init.c (expand_aggr_init_1): Likewise. + (decl_constant_value): Likewise. + * method.c (build_opfncall): Likewise. + (hack_identifier): Likewise. + * typeck.c (build_modify_expr): Likewise. + + * typeck.c (build_c_cast): Don't decl TYPE as register tree. + +Sun Mar 2 02:54:36 1997 Bruno Haible + + * pt.c (unify): Strip NOP_EXPR wrappers before unifying integer values. + + * pt.c (coerce_template_parms): Add new error message. + + * method.c (build_overload_value): Implement name mangling for + floating-point template arguments. + + * method.c (build_overload_int, icat, dicat): Fix mangling of template + arguments whose absolute value doesn't fit in a signed word. + +Mon Mar 3 12:14:54 1997 Brendan Kehoe + + * friend.c: New file; put all of the friend stuff in here. + * init.c: Instead of here. + * Makefile.in (CXX_OBJS): Add friend.o. + (friend.o): Add dependencies. + * Make-lang.in (CXX_SRCS): Add $(srcdir)/cp/friend.c. + +Sun Mar 2 11:04:43 1997 Jason Merrill + + * call.c (build_scoped_method_call): Complain if the scope isn't a + base. + +Wed Feb 26 11:31:06 1997 Jason Merrill + + * parse.y (left_curly): Don't crash on erroneous type. + + * init.c (build_delete): Fix type of ref. + +Tue Feb 25 12:41:48 1997 Jason Merrill + + * search.c (get_vbase_1): Renamed from get_vbase. + (get_vbase): Wrapper, now non-static. + (convert_pointer_to_vbase): Now static. + + * call.c (build_scoped_method_call): Accept a binfo for BASETYPE. + * init.c (build_delete): Pass one. + (build_partial_cleanup_for): Use build_scoped_method_call. + * decl.c (finish_function): Pass a binfo. + +Mon Feb 24 15:00:12 1997 Jason Merrill + + * call.c (build_over_call): Only synthesize non-trivial copy ctors. + + * typeck.c (build_c_cast): Lose other reference to flag. + + * call.c (build_field_call): Don't look for [cd]tor_identifier. + * decl2.c (delete_sanity): Remove meaningless use of + LOOKUP_HAS_IN_CHARGE. + * decl.c (finish_function): Use build_scoped_method_call instead + of build_delete for running vbase dtors. + * init.c (build_delete): Call overload resolution code instead of + duplicating it badly. + +Thu Feb 20 15:12:15 1997 Jason Merrill + + * call.c (build_over_call): Call mark_used before trying to elide + the call. + + * decl.c (implicitly_declare): Don't set DECL_ARTIFICIAL. + +Wed Feb 19 11:18:53 1997 Brendan Kehoe + + * typeck.c (build_modify_expr): Always pedwarn for a cast to + non-reference used as an lvalue. + +Wed Feb 19 10:35:37 1997 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Convert from 0 to a pmf properly. + +Tue Feb 18 15:40:57 1997 Jason Merrill + + * parse.y (handler): Fix template typo. + +Sun Feb 16 02:12:28 1997 Jason Merrill + + * error.c (lang_decl_name): New fn. + * tree.c (lang_printable_name): Use it. + +Fri Feb 14 16:57:05 1997 Mike Stump + + * g++spec.c: Include config.h so that we can catch bzero #defines + from the config file. + +Tue Feb 11 13:50:48 1997 Mike Stump + + * new1.cc: Include a declaration for malloc, to avoid warning, and + avoid lossing on systems that require one (ones that define malloc + in xm.h). + +Mon Feb 10 22:51:13 1997 Bruno Haible + + * decl2.c (max_tinst_depth): New variable. + (lang_decode_option): Parse "-ftemplate-depth-NN" command line + option. + * pt.c (max_tinst_depth): Variable moved. + * lang-options.h: Declare "-ftemplate-depth-NN" command line option + as legal. + +Fri Feb 7 15:43:34 1997 Jason Merrill + + * decl.c (xref_basetypes): Allow a base class that depends on + template parms to be incomplete. + + * decl2.c (build_expr_from_tree): Support typeid(type). + * rtti.c (get_typeid): Support templates. + (expand_si_desc, expand_class_desc): Fix string length. + (expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. + +Tue Feb 4 11:28:24 1997 Jason Merrill + + * pt.c (unify, case TEMPLATE_CONST_PARM): Use cp_tree_equal. + + * pt.c (tsubst): Put it back for -fno-ansi-overloading. + +Mon Feb 3 18:41:12 1997 Jason Merrill + + * pt.c (tsubst, case FUNCTION_DECL): Lose obsolete code that + smashes together template and non-template decls of the same + signature. + +Thu Jan 30 19:18:00 1997 Jason Merrill + + * pt.c (tsubst): Don't recurse for the type of a TYPENAME_TYPE. + +Wed Jan 29 11:40:35 1997 Brendan Kehoe + + * decl.c (duplicate_decls): Next route, pedwarn about different + exceptions if -pedantic *or* olddecl !DECL_IN_SYSTEM_HEADER. + +Tue Jan 28 20:43:29 1997 Brendan Kehoe + + * cp-tree.h (HAS_DEFAULT_IMPLEMENTATION): Delete macro. + (struct lang_type): Delete has_default_implementation member. + Increase dummy to 21. + * decl.c (start_method): Delete usage. + + * cp-tree.h (build_call, null_ptr_cst_p, in_function_p, + store_after_parms, start_decl_1, auto_function): Add decls. + (get_arglist_len_in_bytes, declare_implicit_exception, + have_exceptions_p, make_type_decl, typedecl_for_tag, + store_in_parms, pop_implicit_try_blocks, push_exception_cleanup, + build_component_type_expr, cplus_exception_name, + {make,clear}_anon_parm_name, dont_see_typename): Removed decls. + * call.c (build_this): Make static. + (is_complete): Likewise. + (implicit_conversion): Likewise. + (reference_binding): Likewise. + (standard_conversion): Likewise. + (strip_top_quals): Likewise. + (non_reference): Likewise. + (build_conv): Likewise. + (user_harshness): Likewise. + (rank_for_ideal): Likewise. + * decl.c (start_decl_1): Delete forward decl. + (push_decl_level): Make static. + (resume_binding_level): Make static. + (namespace_bindings_p): Make static. + (declare_namespace_level): Make static. + (lookup_name_real): Make static. + (duplicate_decls): Make static. Take register off NEWDECL and + OLDDECL parm decls. + * decl2.c (get_sentry): Make static. + (temp_name_p): Delete fn. + * except.c (auto_function): Delete decl. + * lex.c (handle_{cp,sysv}_pragma): Make static. + (handle_sysv_pragma) [HANDLE_SYSV_PRAGMA]: Add forward decl. + * method.c (do_build_{copy_constructor,assign_ref}): Make static. + * pt.c (tsubst_expr_values): Make static. + * rtti.c (combine_strings): Delete decl. + +Tue Jan 28 16:40:40 1997 Jason Merrill + + * pt.c (push_template_decl): Handle getting a typedef. + + * call.c (build_new_function_call): Complain about void arg. + +Tue Jan 28 15:25:09 1997 Brendan Kehoe + + * decl.c (duplicate_decls): Give pedwarn of different exceptions + if -pedantic, instead of olddecl !DECL_IN_SYSTEM_HEADER. + +Mon Jan 27 19:21:29 1997 Mike Stump + + * except.c (expand_throw): Don't expand the cleanup tree here, + since we are not going to write the rtl out. Fixes problem with + -g -O on SPARC. + +Mon Jan 27 16:24:35 1997 Sean McNeil + + * Make-lang.in: Add $(exeext) as necessary. + +Mon Jan 27 13:20:39 1997 Mike Stump + + * parse.y (handler_seq): Must have at least one catch clause. + +Sat Jan 25 12:00:05 1997 Jason Merrill + + * call.c (add_builtin_candidate): Restore ?: hack. + + * decl.c (grok_op_properties): More warnings. + +Sat Jan 25 08:50:03 1997 Brendan Kehoe + + * decl.c (duplicate_decls): On second thought, do it as a pedwarn + still but only if !DECL_IN_SYSTEM_HEADER (olddecl). + + * decl.c (duplicate_decls): Scale back to a warning, and only do + 'em if -pedantic. + +Fri Jan 24 17:52:54 1997 Mike Stump + + * decl.c (duplicate_decls): pedwarn mismatched exception + specifications. + +Thu Jan 23 18:18:54 1997 Mike Stump + + * call.c (build_new_method_call): Don't display the invisible + argument for controlling virtual bases. + +Thu Jan 23 16:48:10 1997 Mike Stump + + * new: Add nothrow new and delete, bad_alloc and throw specifications + for delete. + * decl.c (init_decl_processing): Add throw specification for delete. + * new.cc (nothrow): Define. + * lex.c (real_yylex): Removing warning that throw and friends are + keywords. + * new1.cc (operator new (size_t sz, const nothrow_t&)): Define. + * new2.cc (operator new[] (size_t sz, const nothrow_t&): Define. + * Make-lang.in: Add new{1,2}.{cc,o}. + +Thu Jan 23 16:39:06 1997 Jason Merrill + + * lex.c (cons_up_default_function): Fix return type of synth op=. + + * init.c (emit_base_init): Add warnings for uninitialized members + and bases. + + * decl.c (xref_basetypes): Add warning for non-polymorphic type + with destructor used as base type. + + * decl.c (grok_op_properties): Add warning for op= returning void. + * typeck.c (c_expand_return): Add warning for op= returning anything + other than *this. + + * class.c (finish_struct_1): Add warning for class with pointers + but not copy ctor or copy op=. + + * cp-tree.h (TI_PENDING_TEMPLATE_FLAG): New macro. + * pt.c (add_pending_template): Use it instead of LANG_FLAG_0. + (instantiate_template): If -fexternal-templates, add this + instantiation to pending_templates. + + * decl2.c (copy_assignment_arg_p): Disable old hack to support + Booch components. + +Tue Jan 21 18:32:04 1997 Mike Stump + + * cvt.c (cp_convert): pedwarn enum to pointer conversions. + +Mon Jan 20 17:59:51 1997 Jason Merrill + + * call.c (standard_conversion): Handle getting references. Tack + on RVALUE_CONV here. Do it for non-class types, too. + (reference_binding): Pass references to standard_conversion. + (implicit_conversion): Likewise. + (add_builtin_candidate): Disable one ?: kludge. + (convert_like): Handle RVALUE_CONVs for non-class types. + (joust): Disable the other ?: kludge. + +Mon Jan 20 14:53:13 1997 Brendan Kehoe + + * decl.c (init_decl_processing): Add code to build up common + function types beforehand, to avoid creation then removal of + things already in the hash table. + +Mon Jan 20 14:43:49 1997 Jason Merrill + + * decl.c (finish_function): Also zero out DECL_INCOMING_RTL for + the arguments. + + * error.c (dump_expr, TEMPLATE_CONST_PARM): Don't require + current_template_parms. + +Fri Jan 17 10:25:42 1997 Jason Merrill + + * search.c (lookup_field): Don't return a function, check want_type. + +Thu Jan 16 18:14:35 1997 Brendan Kehoe + + * init.c (build_new): Make sure PLACEMENT has a type. + +Thu Jan 16 17:40:28 1997 Jason Merrill + + * init.c (build_new): Support new (nothrow). + +Wed Jan 15 12:38:14 1997 Jason Merrill + + * pt.c (instantiate_decl): Also do push_to_top_level before setting + up DECL_INITIAL. + + * cp-tree.h (PARM_DEFAULT_FROM_TEMPLATE): New macro. + * pt.c (tsubst): Defer instantiation of default args. + * call.c (build_over_call): Until here. + +Wed Jan 15 10:08:10 1997 Brendan Kehoe + + * search.c (lookup_field): Make sure we have an + IDENTIFIER_CLASS_VALUE before we try to return it. + +Thu Jan 9 07:19:01 1997 Brendan Kehoe + + * call.c (build_method_call): Delete unused var PARM. + (build_overload_call_real): Likewise. + (build_object_call): Delete unused var P. + (build_new_op): Likewise. + * decl.c (builtin_type_tdescs_{arr, len, max}): #if 0 out static + var definitions, which are never used. + (shadow_tag): Delete unused var FN. + * expr.c (cplus_expand_expr): Delete unused var ORIGINAL_TARGET. + * init.c (build_new): Delete unused var ALLOC_TEMP. + * method.c (hack_identifier): Delete unused var CONTEXT. + (do_build_copy_constructor): Delete unused var NAME. + (synthesize_method): Delete unused var BASE. + * pt.c (lookup_template_class): Delete unused var CODE_TYPE_NODE. + * rtti.c (build_headof): Delete unused var VPTR. + (get_typeid): Delete unused var T. + * typeck.c (build_conditional_expr): Delete unused vars ORIG_OP1 + and ORIG_OP2. + (build_ptrmemfunc): Delete unused vars U and NINDEX. + * typeck2.c (build_functional_cast): Delete unused var BINFO. + +Wed Jan 8 13:09:54 1997 Jason Merrill + + * search.c (lookup_field): Use IDENTIFIER_CLASS_VALUE to look up + things in a type being defined. + * decl.c (finish_enum): Reverse the values so that they are in + the correct order. + + * pt.c (instantiate_class_template): Don't initialize + BINFO_BASETYPES until the vector is filled out. + (unify): Don't abort on conflicting bindings, just fail. + (instantiate_decl): Do push_tinst_level before any tsubsting. + + * method.c (build_overload_value): Handle getting a + TEMPLATE_CONST_PARM for a pointer. + +Tue Jan 7 14:00:58 1997 Jason Merrill + + * init.c (expand_member_init): Don't give 'not a base' error for + templates. + + * pt.c (instantiate_decl): Call import_export_decl later. + + * pt.c (instantiate_class_template): Return a value. + + * parse.y (extension): New rule for __extension__. + (extdef, unary_expr, decl, component_decl): Use it. + +Tue Jan 7 09:20:28 1997 Mike Stump + + * class.c (base_binfo): Remove unused base_has_virtual member. + (finish_base_struct): Likewise. + (finish_struct_1): Likewise. + diff --git a/gcc/cp/ChangeLog-1998 b/gcc/cp/ChangeLog-1998 new file mode 100644 index 00000000000..1b4e301d025 --- /dev/null +++ b/gcc/cp/ChangeLog-1998 @@ -0,0 +1,6887 @@ +Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi + + * Makefile.in (cvt.o): Depend on toplev.h. + + * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes. + + * cvt.c: Include toplev.h. + + * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and + definitions. + + * init.c (expand_vec_init): Initialize variable `itype'. + + * lex.c (yyerror): Cast the argument passed to a ctype function to + an unsigned char. + + * method.c (build_mangled_C9x_name): Wrap prototype and definition + in "HOST_BITS_PER_WIDE_INT >= 64". + + * typeck.c (build_binary_op): Mark parameter `convert_p' with + ATTRIBUTE_UNUSED. + +1998-12-22 Mark Mitchell + + * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation. + * tree.c (build_exception_variant): Don't crash on empty throw + specs. + +1998-12-18 DJ Delorie + + * cvt.c (convert_to_reference): Check for both error_mark_node + and NULL_NODE after call to convert_for_initialization. + +1998-12-17 Jason Merrill + + * error.c (interesting_scope_p): New fn. + (dump_simple_decl): Use it. + (dump_expr, case CONSTRUCTOR): Force a & for a PMF. + (dump_expr, case OFFSET_REF): Print ->* if appropriate. + +1998-12-16 Mark Mitchell + + * class.c (resolve_address_of_overloaded_function): Do conversion + to correct type here, rather than ... + (instantiate_type): Here. + + * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro. + (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it. + (decl_template_parm_p): Remove. + * decl.c (pushdecl): Don't set DECL_CONTEXT for a template + parameter. + * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P. + * pt.c (push_inline_template_parms_recursive): Set it. + (decl_template_parm_p): Remove. + (check_template_shadow): Use DECL_TEMPLATE_PARM_P. + (process_template_parm): Set it. + +Wed Dec 16 16:33:58 1998 Dave Brolley + + * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus + if configured with cpplib. + +1998-12-15 Mark Mitchell + + * decl.c (poplevel): Make sure ns_binding is initialized. + + * decl.c (finish_function): Undo inadvertent change in previous + patch. + +1998-12-14 Mark Mitchell + + * class.c (pushclass): Tweak handling of class-level bindings. + (resolve_address_of_overloaded_function): Update pointer-to-member + handling. + (instantiate_type): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + * decl.c (pop_binding): Take the DECL to pop, not just the name. + Deal with `struct stat' hack. + (binding_level): Add to documentation. + (push_binding): Clear BINDING_TYPE. + (add_binding): New function. + (push_local_binding): Use it. + (push_class_binding): Likewise. + (poplevel): Adjust calls to pop_binding. + (poplevel_class): Likewise. + (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden + declarations to current binding level. + (push_class_level_binding): Likewise. + (push_overloaded_decl): Adjust handling of OVERLOADs in local + bindings. + (lookup_namespace_name): Don't crash when confronted with a + TEMPLATE_DECL. + (lookup_name_real): Do `struct stat' hack in local binding + contexts. + (build_ptrmemfunc_type): Adjust documentation. + (grokdeclarator): Don't avoid building real array types when + processing templates unless really necessary. + (finish_method): Adjust calls to pop_binding. + * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves, + not reparse_decl_as_expr. + (build_expr_from_tree): Deal with a template-id as the function to + call in a METHOD_CALL_EXPR. + * pt.c (convert_nontype_argument): Tweak pointer-to-member handling. + (maybe_adjust_types_For_deduction): Don't do peculiar things with + METHOD_TYPEs here. + (resolve_overloaded_unification): Handle COMPONENT_REFs. Build + pointer-to-member types where necessary. + * tree.c (build_cplus_array_type_1): Don't avoid building real + array types when processing templates unless really necessary. + (build_exception_variant): Compare the exception lists correctly. + +1998-12-13 Mark Mitchell + + * cp-tree.def (CPLUS_BINDING): Update documentation. + * cp-tree.h (LOCAL_BINDING_P): New macro. + (lang_identifier): Rename local_value to bindings. + (tree_binding): Make `scope' of type `void*', not `tree'. + (BINDING_SCOPE): Update documentation. + (IDENTIFIER_LOCAL_VALUE): Remove. + (IDENTIFIER_CLASS_VALUE): Document. + (IDENTIFIER_BINDING): New macro. + (IDENTIFIER_VALUE): Likewise. + (TIME_IDENTIFIER_TIME): Likewise. + (TIME_IDENTIFIER_FILEINFO): Likewise. + (IMPLICIT_TYPENAME_P): Likewise. + (set_identifier_local_value): Remove. + (push_local_binding): New function. + (push_class_binding): Likewise. + * class.c (pushclass): Update comments; use push_class_binding. + * decl.c (set_identifier_local_value_with_scope): Remove. + (set_identifier_local_value): Likewise. + (push_binding): New function. + (pop_binding): Likewise. + (binding_level): Update documentation. Remove shadowed. + (BINDING_LEVEL): New macro. + (free_binding_nodes): New variable. + (poplevel): Adjust for new name-lookup scheme. Don't mess up + BLOCK_VARs when doing for-scope extension. Remove effectively + dead code. + (pushlevel_class): Tweak formatting. + (poplevel_class): Adjust for new name-lookup scheme. + (print_binding_level): Likewise. + (store_bindings): Likewise. + (pushdecl): Likewise. + (pushdecl_class_level): Likewise. + (push_class_level_binding): Likewise. + (push_overloaded_decl): Update comments. Adjust for new + name-lookup scheme. + (lookup_name_real): Likewise. + (lookup_name_current_level): Likewise. + (cp_finish_decl): Likewise. + (require_complete_types_for_parms): Likewise. Remove misleading + #if 0'd code. + (grok_parms): Likewise. Don't call + require_complete_types_for_parms here. + (grok_ctor_properties): Don't treat templates as copy + constructors. + (grop_op_properties): Or as assignment operators. + (start_function): Document. Adjust for new name-lookup scheme. + (finish_function): Likewise. + * decl2.c (do_local_using_decl): Use push_local_binding. + * lex.c (begin_definition_of_inclass_inline): New function, split + out from ... + (do_pending_inlines): Here, and ... + (process_next_inline): Here. + (get_time_identifier): Use TIME_IDENTIFIER_* macros. + (init_filename_times): Likewise. + (extract_interface_info): Likewise. + (ste_typedecl_interface_info): Likewise. + (check_newline): Likewise. + (dump_time_statistics): Likewise. + (handle_cp_pragma): Likewise. + (do_identifier): Adjust for new name-lookup scheme. + * parse.y (function_try_block): Return ctor_initializer_opt value. + (fndef): Use it. + (fn.defpen): Pass appropriate values to start_function. + (pending_inline): Use functor_try_block value, and pass + appropriate values to finish_function. + * pt.c (is_member_template): Update documentation; remove handling + of FUNCTION_DECLs. As per name, this function should deal only in + TEMPLATE_DECLs. + (decl_template_parm_p): Change name of olddecl parameter to decl. + (check_template_shadow): Adjust for new name-lookup scheme. + (lookup_template_class): Likewise. + (tsubst_decl): Tweak so as not to confuse member templates with + copy constructors and assignment operators. + (unify): Handle UNION_TYPEs. + * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme. + (lang_print_xnode): Adjust for new name-lookup scheme. + * typeck.c (mark_addressable): Likewise. + (c_expand_return): Likewise. + +1998-12-08 Jason Merrill + + * decl.c (grokdeclarator): Allow field with same name as class + in extern "C". + + * decl.c (lookup_name_real): Don't limit field lookup to types. + * class.c (check_member_decl_is_same_in_complete_scope): No error + if icv and x are the same. + * lex.c (do_identifier): Tweak error message. + +1998-12-10 Mark Mitchell + + * decl.c (start_enum): Use push_obstacks, not + end_temporary_allocation. + (finish_enum): Call pop_obstacks. + +1998-12-10 Mark Mitchell + + * class.c (instantiate_type): Return error_mark_node rather than + junk. + +1998-12-09 Mark Mitchell + + * cp-tree.h (most_specialized_instantiation): New function. + (print_candidates): Likewise. + * class.c (validate_lhs): Remove. + (resolve_address_of_overloaded_function): New function, split out + and then substantially reworked, from ... + (instantiate_type): Use it. Simplify. + * cvt.c (convert_to_reference): Complain when caller has indicated + that's the right thing to do. Don't crash if instantiate_type + fails. + * pt.c: Substitute `parameters' for `paramters' throughout. + (print_candidates): Don't make it static. + (most_specialized_instantiation): Split out from ... + (most_specialized): Here. + +Wed Dec 9 15:33:01 1998 Dave Brolley + + * lex.c (lang_init_options): Initialize cpplib. + * decl2.c (parse_options,cpp_initialized): Removed. + (lang_decode_option): Move initialization of cpplib to + lang_init_options. + +1998-12-09 Mark Mitchell + + * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as + well as the TYPE_DECL, when a typedef name is assigned to a + previously anonymous type. + +1998-12-08 Andrew MacLeod + + * cp/except.c (call_eh_info): Use __start_cp_handler instead of + __cp_eh_info for getting the eh info pointer. Add table_index to + field list. + (push_eh_cleanup): Don't increment 'handlers' data field. + (process_start_catch_block): Don't set the 'caught' field. + + * cp/exception.cc (CP_EH_INFO): New macro for getting the + exception info pointer within library routines. + (__cp_eh_info): Use CP_EH_INFO. + (__start_cp_handler): Get exception info pointer, set caught field, + and increment the handlers field. Avoids this being done by handlers. + (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro. + (uncaught_exception): Use CP_EH_INFO macro. + +Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com) + + * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h + +Mon Dec 7 17:56:06 1998 Mike Stump + + * lex.c (check_newline): Add support for \ as `natural' + characters in file names in #line to be consistent with #include + handling. We support escape processing in the # 1 "..." version of + the command. See also support in cp/lex.c. + +1998-12-07 Zack Weinberg + + * cp/decl2.c: s/data/opts/ when initializing cpp_reader + structure. + +1998-12-07 Jason Merrill + + * decl.c (build_typename_type): Set DECL_ARTIFICIAL. + + * error.c (dump_simple_decl): Also print namespace context. + (dump_function_decl): Likewise. + + * decl2.c (ambiguous_decl): Don't print old value if it's + error_mark_node. + + * decl.c (lookup_name_real): Fix handling of local types shadowed + by a non-type decl. Remove obsolete code. + * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro. + + * lang-options.h: Add -fpermissive. + * decl2.c: Likewise. + * cp-tree.h: Add flag_permissive. + * decl.c (init_decl_processing): If neither -fpermissive or -pedantic + were specified, set flag_pedantic_errors. + * call.c (build_over_call): Turn dropped qualifier messages + back into pedwarns. + * cvt.c (convert_to_reference): Likewise. + * typeck.c (convert_for_assignment): Likewise. + +1998-12-05 Jason Merrill + + * decl2.c (coerce_new_type): Use same_type_p. + (coerce_delete_type): Likewise. + + * call.c (check_dtor_name): Return 1, not error_mark_node. + +1998-12-04 Jason Merrill + + * lex.c (handle_cp_pragma): Disable #pragma interface/implementation + if MULTIPLE_SYMBOL_SPACES. + + * pt.c (check_template_shadow): New fn. + * decl2.c (grokfield): Use it. + * decl.c (pushdecl): Likewise. + (pushdecl_class_level): Likewise. + (start_method): Likewise. + (xref_tag): Don't try to use 't' if we're defining. + + * call.c (check_dtor_name): Just return an error_mark_node. + * pt.c (lookup_template_class): Complain about using non-template here. + * parse.y (apparent_template_type): Not here. + + * pt.c (check_explicit_specialization): Complain about specialization + with C linkage. + + * lang-options.h: Add -f{no-,}implicit-inline-templates. + + * pt.c (convert_nontype_argument): Don't assume that any integer + argument is intended to be a constant-expression. + +1998-12-03 Mark Mitchell + + * class.c (handle_using_decl): Fix comment. Don't lookup + constructors in base classes. + (validate_lhs): Fix typo in comment. + * search.c (lookup_field_1): Don't return a USING_DECL. + + * cp-tree.h (DECL_ACCESS): Improve documentation. + + * decl.c (expand_static_init): Don't set the initialization-done + flag until the initialization is done. + +1998-12-02 Mark Mitchell + + * decl2.c (validate_nonmember_using_decl): Complain about using + declarations for class members. + +1998-11-29 Jason Merrill + + * typeck2.c (process_init_constructor): Use same_type_p. + + * decl.c (check_tag_decl): Don't warn about null decl inside a + class. + + * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than + UNIFY_ALLOW_NONE. + (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE. + (resolve_overloaded_unification): Strip baselinks. + +Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi + + * g++spec.c: Don't prototype xmalloc. + +1998-11-25 Jason Merrill + + * except.c (expand_throw): Use TYPE_PTR_P to check for pointers. + + * decl.c (check_tag_decl): Do complain about null friend decl at + file scope. + +1998-11-25 Andreas Schwab + + * lex.c (make_lang_type): Clear the whole struct lang_type, not + only the first multiple of sizeof (int). + +1998-11-24 Jason Merrill + + * decl.c (start_decl): An explicit specialization of a static data + member is only a definition if it has an initializer. + + * except.c (expand_throw): Use cp_finish_decl for the throw temp. + * cvt.c (build_up_reference): Pass DIRECT_BIND down into + cp_finish_decl. + * init.c (expand_default_init): Check for DIRECT_BIND instead of + DECL_ARTIFICIAL. + + * call.c (build_over_call): Use build_decl. + + * except.c (expand_throw): Just use convert, not + build_reinterpret_cast. + + * lex.c (handle_generic_pragma): Use token_buffer. + + * decl.c (check_tag_decl): Don't complain about null friend decl. + +1998-11-24 Dave Pitts + + * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the + first position. + * lex.c (check_newline): Use ISALPHA. + (readescape): Use ISGRAPH. + (yyerror): Use ISGRAPH. + +1998-11-24 Nathan Sidwell + + * search.c (get_abstract_virtuals): Do not use initial + CLASSTYPE_ABSTRACT_VIRTUALS. + * typeck2.c (abstract_virtuals_error): Show location of abstract + declaration. + * call.c (build_new_method_call): Use + CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate. + * class.c (finish_struct_bits): Don't bother working out whether + get_abstract_virtuals will do anything, just do it. + +1998-11-24 Graham + + * typeck.c (build_component_ref): Remove unused statement. + +1998-11-24 Jason Merrill + + * class.c (add_method): Catch invalid overloads. + + * class.c (add_method): Build up OVERLOADs properly for conversion ops. + * search.c (lookup_conversions): Handle getting real OVERLOADs. + (add_conversions): Likewise. Revert last change. + * call.c (add_conv_candidate): Pass totype to add_candidate instead + of fn. Don't add a new candidate if the last one was for the same + type. + (print_z_candidates): Handle getting a type as a function. + (joust): If we got two conversion candidates to the same type, + just pick one. + (build_object_call): Lose 'templates'. + (build_user_type_conversion_1): Handle getting real OVERLOADs. + +1998-11-23 Jason Merrill + + * typeck2.c (process_init_constructor): If there are elements + that don't have initializers and they need to have constructors + run, supply them with initializers. + + * class.c (finish_struct_1): A class with a 0-width bitfield is + still empty. + +1998-11-23 Mark Mitchell + + * pt.c (instantiate_class_template): Don't try to figure out what + specialization to use for a partial instantiation. Correct + typos in a couple of comments. Avoid calling uses_template_parms + multiple times. + +1998-11-23 Benjamin Kosnik + + * method.c (process_overload_item): Add call to + build_mangled_C9x_name for intTI_type_nodes. + (build_mangled_C9x_name): Add prototype, define. + * decl.c (init_decl_processing): Add names for + TImode_type_node. + +1998-11-23 Jason Merrill + + * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS. + + * class.c (finish_struct_1): Set things up for 0-width bitfields + like we do for others. + + * decl.c (check_tag_decl): New fn. + (shadow_tag): Split out from here. + * decl2.c (grok_x_components): Call it. + +1998-11-22 Jason Merrill + + * decl.c: Lose warn_about_return_type. + (grokdeclarator): Always complain about implicit int, except for + `main () { ... }'. + + * decl.c (tag_name): New fn. + (xref_tag): Complain about using typedef-name after class-key. + + * init.c (expand_vec_init): Also keep going if from_array. + + * tree.c (is_overloaded_fn): Also handle the output of + build_offset_ref. + + * decl.c (grokdeclarator): Use constructor_name when comparing + field name against enclosing class. + * class.c (finish_struct_anon): Likewise. + +1998-11-22 Mark Mitchell + + * decl.c (poplevel): Remove code to handle KEEP == 2. + (finish_function): Don't confuse BLOCK-order when + processing a destructor. + +1998-11-21 Jason Merrill + + * decl.c (require_complete_types_for_parms): Call layout_decl + after we've completed the type. + +1998-11-21 Martin von Löwis + + * decl2.c (validate_nonmember_using_decl): Allow using templates + from the global namespace. + +1998-11-21 Jason Merrill + + Handle specifying template args to member function templates. + * tree.c (build_overload): Always create an OVERLOAD for a template. + * search.c (add_conversions): Handle finding an OVERLOAD. + * decl2.c (check_classfn): Likewise. + * lex.c (identifier_type): See through a baselink. + * parse.y (do_id): Don't call do_identifier if we got a baselink. + * class.c (instantiate_type, case TREE_LIST): Recurse. + + * decl.c (grokdeclarator): Allow a boolean constant for array + bounds, odd as that sounds. + + * pt.c (unify): Be more strict about non-type parms, except for + array bounds. + (UNIFY_ALLOW_INTEGER): New macro. + +1998-11-19 Manfred Hollstein + + * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir). + +1998-11-19 Jason Merrill + + * semantics.c (begin_class_definition): Call + maybe_process_partial_specialization before push_template_decl. + Don't call push_template_decl for a specialization. + * search.c (lookup_field): Do return a member template class. + * decl2.c (handle_class_head): Handle member template classes. + + * decl.c (grokdeclarator): A parm type need not be complete. + + * pt.c (convert_nontype_argument): Fix thinko. + +1998-11-18 Mark Mitchell + + * cp-tree.h (PTRMEM_CST_CLASS): Fix typo. + (global_delete_fndecl): New variable. + * decl.c (global_delete_fndecl): Define it. + (init_decl_processing): Set it. + * init.c (build_builtin_delete_call): Use it. + * tree.c (mapcar): Recursively call mapcar for the type of EXPR + nodes. + +1998-11-18 Jason Merrill + + * decl.c (cplus_expand_expr_stmt): Always complain about unresolved + type. + + * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue. + * call.c (build_object_call): Also support references to functions. + * typeck.c (convert_for_initialization): Don't decay a function + if the target is a reference to function. + + * search.c (add_conversions): Get all the overloads from a class. + + * decl.c (grok_ctor_properties): Complain about any constructor + that will take a single arg of the class type by value. + + * typeck2.c (build_functional_cast): Can't create objects of + abstract classes this way. + * cvt.c (ocp_convert): Likewise. + + * decl.c (grokfndecl): Member functions of local classes are not + public. + +1998-11-18 Mark Mitchell + + * Make-lang.in (cc1plus): Add dependency on hash.o. + +1998-11-18 Jason Merrill + + * search.c (get_abstract_virtuals): Complain about virtuals with + no final overrider. + * typeck2.c (abstract_virtuals_error): Remove handling for virtuals + with no final overrider. + * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P + on virtuals with no final overrider. + + * lex.c (reinit_parse_for_block): Add a space after the initial ':'. + + * class.c (finish_struct_1): Don't remove zero-width bit-fields until + after layout_type. + + * friend.c (do_friend): Don't set_mangled_name_for_decl. + + * class.c (finish_struct_anon): Complain about non-fields. + * decl2.c (build_anon_union_vars): Likewise. + + * decl.c (grokdeclarator): Normal data members can't have the same + name as the class, either. + * class.c (finish_struct_anon): Neither can members of an + anonymous union. + +1998-11-17 Mark Mitchell + + * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses. + (TYPE_BINFO): Likewise. + (IS_AGGR_TYPE): Tweak. + (SET_IS_AGGR_TYPE): New macro. + (CLASS_TYPE_P): Tweak. + (lang_type): Group mark bitfields together. Remove linenum. + (CLASSTYPE_SOURCE_LINE): Remove macro. + (CLASSTYPE_MARKED_N): New macro. + (SET_CLASSTYPE_MARKED_N): Likewise. + (CLEAR_CLASSTYPE_MARKED_N): Likewise. + (CLASS_TYPE_MARKED_*): Use them. + (SET_CLASSTYPE_MARKED_*): Likewise. + (CLEAR_CLASSTYPE_MARKED_*): Likewise. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. + (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well. + (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE. + * class.c (class_cache_obstack): New variable. + (class_cache_firstobj): Likewise. + (finish_struct): Don't set CLASSTYPE_SOURCE_LINE. + (pushclass): Free the cache, when appropriate. + (popclass): Tidy. + (maybe_push_cache_obstack): Use class_cache_obstack. + * decl.c (include hash.h). + (typename_hash): New function. + (typename_compare): Likewise. + (build_typename_type): Check the hash table to avoid creating + duplicates. + (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE. + (grokdeclarator): Use CLASS_TYPE_P. + (xref_basetypes): Likewise. + (start_function): Likewise. Don't put current_class_ref on the + permanent obstack. + * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO + and TYPE_TI_ARGS. + * lex.c (note_got_semicolon): Use CLASS_TYPE_P. + (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated + fields for types other than class types. Do clear TYPE_ALIAS_SET + for types other than class types, though. + * method.c (build_overload_identifier): Use CLASS_TYPE_P and + TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + * pt.c (process_template_parm): Don't set + CLASSTYPE_GOT_SEMICOLON. + (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + Coerce arguments on the momentary obstack. + (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + (instantiate_class_template): Calculate template arguments on the + momentary obstack. Tidy. + (tsubst_template_arg_vector): Use make_temp_vec. + (tsubst_aggr_type): Put template arguments on the momentary + obstack. + (tsubst_decl): Likewise. + (tsubst): Copy the array bounds index to the permanent obstack + before building index types. Use new macros. + (unify): Use new macros. + (do_type_instantiation): Likewise. + * search.c (lookup_fnfields_1): Use new macros. + (dfs_pushdecls): Build envelopes on the cache obstack. + (dfs_compress_decls): Use new macros. + (push_class_decls): Build on the cache obstack. + * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON. + * sign.c (build_signature_pointer_or_reference_type): Use + SET_IS_AGGR_TYPE. + * tree.c (make_binfo): Check CLASS_TYPE_P. + (copy_template_template_parm): Adjust. + (make_temp_vec): Use push_expression_obstack. + * typeck.c (complete_type): Use new macros. + (comptypes): Likewise. + +1998-11-17 Jason Merrill + + * pt.c (tsubst): Add diagnostics for invalid array, reference + and pointer to member types. + +1998-11-16 Jason Merrill + + * typeck2.c (my_friendly_abort): Don't fatal twice in a row. + + * typeck.c (c_expand_start_case): Use build_expr_type_conversion. + Simplify. + + * parse.y (structsp): Fix cut-and-paste error. + + * init.c (build_new): Complain about non-integral size. + + * parse.y (unary_expr): Complain about defining types in sizeof. + + * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn. + + * rtti.c (build_x_typeid): Complain about typeid without + including . + (get_typeid): Likewise. Complain about typeid of incomplete type. + (get_tinfo_fn_dynamic): Likewise. + (get_typeid_1): Not static anymore. + * except.c (build_eh_type_type): Use get_typeid_1. + + * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to + ambiguous or private bases. Fix warning for reference cast. + +1998-11-16 Mark Mitchell + + * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro. + * decl.c (duplicate_decls): Remove special-case code to deal with + template friends, and just do the obvious thing. + * pt.c (register_specialization): Tweak for clarity, and also to + clear DECL_INITIAL for an instantiation before it is merged with a + specialization. + (check_explicit_specialization): Fix indentation. + (tsubst_friend_function): Handle both definitions in friend + declaration and outside friend declarations. + (tsubst_decl): Don't clear DECL_INITIAL for an instantiation. + (regenerate_decl_from_template): Tweak accordingly. + (instantiate_decl): Likewise. + +1998-11-16 Jason Merrill + + * decl.c (cplus_expand_expr_stmt): Promote warning about naked + member function reference to error. + * cvt.c (ocp_convert): Complain about converting an overloaded + function to void. + + * init.c (build_offset_ref): Just return a lone static member + function. + + * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs, + not internal ones. + + * typeck.c (build_binary_op_nodefault): Improve error handling. + + * decl.c (grokfndecl): Complain about making 'main' a template. + + * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*. + + * call.c (build_method_call): Handle a BIT_NOT_EXPR around a + TYPE_DECL in a template. + +1998-11-15 Jason Merrill + + * typeck2.c (my_friendly_abort): Add URL in the other case, too. + + * decl.c (struct cp_function): Add named_label_uses. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + (define_label): Also complain about jumping into the scope of + non-POD objects that don't have constructors. + * tree.c (pod_type_p): New fn. + + * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner. + * rtti.c (synthesize_tinfo_fn): Call import_export_decl here. + (get_tinfo_fn): Not here. + * repo.c (repo_get_id): Abort if we get called for an incomplete + type. + +1998-11-13 Mark Mitchell + + * except.c (expand_throw): Make sure first argument to + __cp_push_exception is of type `void*' to avoid spurious error + messages. + +1998-11-11 Jason Merrill + + * pt.c (try_one_overload): Take orig_targs again. Only check for + mismatches against them; we don't care what a previous call found. + (resolve_overloaded_unification): Adjust. + + * search.c (lookup_field): Don't return anything for a non-type + field from a dependent type. + * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class + in an array declarator. + (start_decl): Push into the class before looking for the field. + +1998-11-08 Mark Mitchell + + * method.c (build_overload_value): Handle REFERENCE_TYPE. + +1998-11-08 Martin von Löwis + + * decl.c (grokdeclarator): Allow namespace-scoped members if they + are friends. + +1998-11-08 Jason Merrill + + * pt.c (tsubst_decl): Don't mess with the global value of an + un-mangled DECL_ASSEMBLER_NAME. + +1998-11-03 Christopher Faylor + + * decl.c (init_decl_processing): Remove CYGWIN conditional + since CYGWIN is now able to deal with trapping signals. + +Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi + + * cp-tree.h: Don't include gansidecl.h. + * exception.cc: Include gansidecl.h (since we don't include config.h) + * g++spec.c: Don't include gansidecl.h. + +1998-11-06 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease + size of dummy. + (DECL_DEFINED_IN_CLASS_P): New macro. + (TEMPLATE_PARMS_FOR_INLINE): Document. + (check_static_variable_definition): New function. + * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if + appropriate. + (check_static_variable_definition): Split out from ... + (grokdeclarator): Here. + * pt.c (check_default_tmpl_args): New function, split out from ... + (push_template_decl_real): Here. + (instantiate_template): Fix comment. + +1998-11-04 Mark Mitchell + + * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued. + (CP_TYPE_VOLATILE_P): Likewise. + (CP_TYPE_RESTRICT_P): Likewise. + +1998-11-03 Mark Mitchell + + * pt.c (tsubst): Use build_index_type, not build_index_2_type. + +1998-11-02 Jason Merrill + + * class.c (instantiate_type): Be more helpful. + + * decl2.c (import_export_decl): Call import_export_class. + + * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR. + * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR. + * pt.c (tsubst_copy): Likewise. + +1998-11-02 Mark Mitchell + + * init.c (expand_vec_init): Fix off-by-one error. + +1998-11-02 Alexandre Oliva + + * parse.y (apparent_template_type): New type. + (named_complex_class_head_sans_basetype): Use it. + * Makefile.in (CONFLICTS): One new conflict. + * parse.c: Regenerated. + +1998-11-01 Mark Mitchell + + * cp-tree.h (COMPARE_STRICT): New macro. + (COMPARE_BASE): Likewise. + (COMPARE_RELAXED): Likewise. + (COMPARE_REDECLARATION): Likewise. + (same_type_p): Likewise. + (same_or_base_type_p): Likewise. + * call.c (standard_conversion): Use them, in place of comptypes + with numeric arguments. + (reference_binding): Likewise. + (convert_like): Likewise. + (build_over_call): Likewise. + (is_subseq): Likewise. + (is_properly_derived_from): Likewise. + (compare_ics): Likewise. + (joust): Likewise. + * class.c (delete_duplicate_fields_1): Likewise. + (resolves_to_fixed_type_p): Likewise. + (instantiate_type): Likewise. Remove #if 0'd code. + * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here. + (pushdecl): Likewise. + (lookup_name_real): Likewise. + (grokdeclarator): Likewise. Check for illegal array declarations. + (grokparms): Likewise. + (grok_op_properties): Likewise. + * decl2.c (check_classfn): Likewise. + * friend.c (is_friend): Likewise. + (make_friend_class): Likewise. + * init.c (expand_aggr_init): Likewise. + (expand_vec_init): Likewise. + * pt.c (is_member_template_class): Remove declaration. + (is_specialization_of): Use COMPARE_* and new macros. + (comp_template_parms): Likewise. + (convert_nontype_argument): Likewise. + (coerce_template_template_parms): Likewise. + (template_args_equal): Likewise. + (lookup_template_class): Likewise. + (type_unification_real): Likewise. + (unify): Likewise. + (get_bindings_real): Likewise. + * search.c (covariant_return_p): Likewise. + (get_matching_virtual): Likewise. + * sig.c (match_method_types): Likewise. + * tree.c (vec_binfo_member): Likewise. + (cp_tree_equal): Likewise. + * typeck.c (common_type): Likewise. + (comp_array_types): Likewise. Get issues involving unknown array + bounds right. + (comptypes): Update comments. Use new flags. + (comp_target_types): Use new macros. + (compparms): Likewise. + (comp_target_parms): Likewise. + (string_conv_p): Likewise. + (build_component_ref): Likewise. + (build_indirect_ref): Likewise. + (build_conditional_expr): Likewise. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (build_modify_expr): Likewise. + (convert_for_assignment): Likewise. + (comp_ptr_ttypes_real): Likewise. + (ptr_reasonably_similar): Likewise. + (comp_ptr_ttypes_const): Likewise. + +1998-10-31 Jason Merrill + + * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error. + +1998-10-30 Mark Mitchell + + * decl2.c (delete_sanity): Pass integer_zero_node, not + integer_two_node, to build_vec_delete. + * init.c (build_array_eh_cleanup): Remove. + (expand_vec_init_try_block): New function. + (expand_vec_init_catch_clause): Likewise. + (build_vec_delete_1): Don't deal with case that auto_delete_vec + might be integer_two_node anymore. + (expand_vec_init): Rework for initialization-correctness and + exception-correctness. + * typeck2.c (process_init_constructor): Make mutual exclusivity + of cases more obvious. + +1998-10-29 Jason Merrill + + * decl.c (lookup_name_real): OK, only warn if not lexing. + Simplify suggested fix. + + * cp-tree.h (IDENTIFIER_MARKED): New macro. + * search.c (lookup_conversions): Use breadth_first_search. + (add_conversions): Avoid adding two conversions to the same type. + (breadth_first_search): Work with base binfos, rather + than binfos and base indices. + (get_virtual_destructor): Adjust. + (tree_has_any_destructor_p): Adjust. + (get_matching_virtual): Adjust. + + * pt.c (push_template_decl_real): Generalize check for incorrect + number of template parms. + (is_member_template_class): #if 0. + +1998-10-29 Richard Henderson + + * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@, + last. + +1998-10-28 Zack Weinberg + + * lex.c: Call check_newline from lang_init always. After + calling cpp_start_read, set yy_cur and yy_lim to read from the + cpplib token buffer. + +1998-10-28 Jason Merrill + + * class.c (instantiate_type): Don't consider templates for a normal + match. + + * class.c (finish_struct_1): Don't complain about non-copy + assignment ops in union members. + + * class.c (build_vtable): Don't pass at_eof to import_export_vtable. + (prepare_fresh_vtable): Likewise. + (finish_struct_1): Don't call import_export_class. + * decl2.c (finish_vtable_vardecl): Do import/export stuff. + (finish_prevtable_vardecl): Lose. + (finish_file): Don't call it. + * pt.c (instantiate_class_template): Likewise. + * cp-tree.h: Remove it. + + * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here. + * decl.c (finish_function): Not here. + (start_function): Do set DECL_INITIAL. + + * pt.c (push_template_decl_real): Complain about default template + args for enclosing classes. + + * call.c (add_function_candidate): Treat conversion functions + as coming from the argument's class. + * cp-tree.h (DECL_CONV_FN_P): New fn. + (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE. + * class.c (add_method): Use DECL_CONV_FN_P. + * decl2.c (check_classfn): Likewise. + * error.c (dump_function_name): Likewise. + (dump_function_decl): Likewise. + * pt.c (fn_type_unification): Likewise. + * search.c (add_conversions): Likewise. + +1998-10-27 Jason Merrill + + * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL. + * method.c (hack_identifier): Also check for using RESULT_DECL + from outer context. + +1998-10-27 Mark Mitchell + + * decl.c (grokdeclarator): Use type_quals, rather than constp, + consistently. + +1998-10-27 Jason Merrill + + * call.c (standard_conversion): instantiate_type here. + (reference_binding): And here. + (implicit_conversion): Not here. + (build_op_delete_call): No need to cons up an OVERLOAD. + * cvt.c (cp_convert_to_pointer): instantiate_type here. + (convert_to_reference): And here. + * decl.c (grok_reference_init): Not here. + (grokparms): Or here. + * typeck2.c (digest_init): Or here. + * typeck.c (decay_conversion): Take the address of overloaded + functions, too. + (require_instantiated_type): Lose. + (convert_arguments): Don't handle unknown types here. + (build_c_cast): Likewise. + (build_binary_op): Gut. + (build_conditional_expr): Don't require_instantiated_type. + (build_modify_expr): Likewise. + (build_static_cast): Don't instantiate_type. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (convert_for_initialization): Likewise. + (build_ptrmemfunc): Use type_unknown_p. + (convert_for_assignment): Also do default_conversion on overloaded + functions. Hand them off to ocp_convert. + +1998-10-26 Mark Mitchell + + * error.c (dump_decl): Deal with TEMPLATE_DECLs that are + VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type. + + * class.c (finish_struct_1): Use build_cplus_array_type to build + array types. + * decl.c (init_decl_processing): Likewise. + * except.c (expand_end_eh_spec): Likewise. + * search.c (expand_upcast_fixups): Simplify very slightly. + +1998-10-26 Jason Merrill + + * decl.c (grokdeclarator): Complain about a variable using + constructor syntax coming back null from start_decl. + + * friend.c (make_friend_class): Complain about trying to make + a non-class type a friend. + + * decl.c (grokfndecl): Set DECL_INITIAL for a defn here. + (start_function): Not here. + +1998-10-26 Brendan Kehoe + + * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration. + +1998-10-26 Jason Merrill + + * typeck2.c (process_init_constructor): Only skip anonymous fields + if they are bitfields. + + * cp-tree.def (TYPEOF_TYPE): New code. + * error.c (dump_type_real): Handle it. + * pt.c (tsubst): Likewise. + * tree.c (search_tree): Likewise. + * semantics.c (finish_typeof): New fn. + * parse.y (typespec): Use it. + * cp-tree.h: Declare it. + +1998-10-26 Manfred Hollstein + + * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional. + +1998-10-26 Jason Merrill + + * typeck.c (convert_arguments): Don't handle pmf references + specially. + + * init.c (build_member_call): Don't try to convert to the base type + if it's ambiguous or pedantic. + + * typeck2.c (check_for_new_type): Only depend on pedantic for + C-style casts. + +1998-10-25 Mark Mitchell + + * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all + non-converting constructors. + +1998-10-24 Martin von Löwis + + * gxxint.texi: Correct documentation for n, N, Q, and B. + +1998-10-23 Martin von Löwis + + * parse.y (condition): Convert VAR_DECL from reference to indirect + reference. + +1998-10-23 Andrew MacLeod + + * exception.cc (__cp_pop_exception): Free the original exception + value, not the potentially coerced one. + +1998-10-23 Mark Mitchell + + * Makefile.in (hash.h): Run gperf when necessary. + + * cp-tree.h (CP_TYPE_READONLY): Remove. + (CP_TYPE_VOLATILE): Likewise. + (CP_TYPE_QUALS): New macro. + (CP_TYPE_CONST_P): Likewise. + (CP_TYPE_VOLATILE_P): Likewise. + (CP_TYPE_RESTRICT_P): Likewise. + (CP_TYPE_CONST_NON_VOLATILE_P): Likewise. + (cp_build_type_variant): Rename to ... + (cp_build_qualified_type): New function. + (c_apply_type_quals_to_decl): Declare. + (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'. + (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise. + (cp_type_qual_from_rid): New function. + (compparms): Remove unused parameter. All callers changed. + (cp_type_quals): New function. + (at_least_as_qualified_p): Likewise. + (more_qualified_p): Likewise. + + * call.c (standard_conversion): Replace calls to + cp_build_type_variant with cp_build_qualified_type. Use + CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to + compare them. Use CP_TYPE_* macros to check qualifiers. + (reference_binding): Likewise. + (implicit_conversion): Likewise. + (add_builtin_candidates): Likewise. + (build_over_call): Likewise. + * class.c (overrides): Compare all qualifiers, not just `const', + on method declarations. + * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc. + (convert_pointer_to_real): Likewise. + (type_promotes_to): Likewise. + * decl.c (check_for_uninitialized_const_var): New function. + (init_decl_processing): More CP_TYPE_QUALS conversion, etc. + (cp_finish_decl): Use check_for_uninitialized_const_var. + (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to + handle `restrict'. + (grok_ctor_properties): Likewise. + (grok_op_properties): Likewise. + (start_function): Likewise. + (rever_static_member_fn): Likewise. + * decl2.c (grok_method_quals): Likewise. + (grokfield): Likewise. + * error.c (dump_readonly_or_volatile): Rename to ... + (dump_qualifiers): New function. Handle `restrict'. + (dump_type_real): Use it. + (dump_aggr_type): Likewise. + (dump_type_prefix): Likewise. + (dump_type_suffix): Likewise. + (dump_function_decl): Likewise. + (cv_as_string): Likewise. + * gxx.gperf: Add __restrict and __restrict__. + * gxxint.texi: Document `u' as used for `__restrict', and a few + other previously undocumented codes. + * hash.h: Regenerated. + * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc. + (build_member_call): Likewise. + (build_new_1): Likewise. + * lex.c (init_parse): Add entry for RID_RESTRICT. + (cons_up_default_function): More CP_TYPE_QUALS conversion, etc. + (cp_type_qual_from_rid): Define. + * lex.h (enum rid): Add RID_RESTRICT. + * method.c (process_modifiers): Deal with `restrict'. + * parse.y (primary): More CP_TYPE_QUALS conversion, etc. + * parse.c: Regenerated. + * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc. + (tsubst_aggr_type): Likewise. + (tsubst): Likewise. + (check_cv_quals_for_unify): Likewise. + (unify): Likewise. + * rtti.c (init_rtti_processing): Likewise. + (build_headof): Likewise. + (get_tinfo_var): Likewise. + (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling. + (expand_class_desc): Likewise. + (expand_attr_desc): Likewise. + (synthesize_tinfo_fn): Likewise. + * search.c (covariant_return_p): Likewise. Fix `volatile' handling. + (get_matching_virtual): Likewise. + (expand_upcast_fixups): Likewise. + * sig.c (build_signature_pointer_or_reference_name): Take + type_quals, not constp and volatilep. + (build_signature_pointer_or_reference_type): Likewise. + (match_method_types): More CP_TYPE_QUALS conversion, etc. + (build_signature_pointer_constructor): Likewise. + (build_signature_method_call): Likewise. + * tree.c (build_cplus_array_type): Likewise. + (cp_build_type_variant): Rename to ... + (cp_build_qualified_type): New function. Deal with `__restrict'. + (canonical_type_variant): More CP_TYPE_QUALS conversion, etc. + (build_exception_variant): Likewise. + (mapcar): Likewise. + * typeck.c (qualif_type): Likewise. + (common_type): Likewise. + (comptypes): Likewise. + (comp_cv_target_types): Likewise. + (at_least_as_qualified_p): Define. + (more_qualified_p): Likewise. + (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc. + (compparms): Likewise. + (inline_conversion): Likewise. + (string_conv_p): Likewise. + (build_component_ref): Likewise. + (build_indirect_ref): Likewise. + (build_array_ref): Likewise. + (build_unary_op): Likewise. + (build_conditional_expr): Likewise. + (build_static_cast): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + (convert_For_assignment): Likewise. + (comp_ptr_ttypes_real): Likewise. + (cp_type_quals): New function. + +1998-10-23 Jason Merrill + + * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays. + (CP_TYPE_VOLATILE): Likewise. + * decl.c (grokdeclarator): Use them. + * tree.c (canonical_type_variant): Likewise. + +1998-10-22 Martin von Löwis + + * parse.y (named_class_head): Push into class while parsing the + base class list. + * decl2.c (push_scope, pop_scope): New functions. + * cp-tree.h: Declare them. + * init.c (build_new_1): Delay cleanup until end of full expression. + +1998-10-21 Jason Merrill + + * typeck.c (build_component_ref): Use of a type here is an error. + +1998-10-19 Jason Merrill + + Revamp references to member functions. + * method.c (hack_identifier): Call build_component_ref for a + reference to a member function. + * typeck.c (build_component_ref): Only return a single function + if it's static. Otherwise, return a COMPONENT_REF. + (build_x_function_call): Handle a COMPONENT_REF. + (build_unary_op): Handle all unknown-type things. + * decl2.c (arg_assoc): Handle COMPONENT_REF. + * class.c (instantiate_type): Complain if the function we get is a + nonstatic member function. Remove code for finding "compatible" + functions. + * pt.c (tsubst_copy): Handle NOP_EXPR. + * tree.c (build_dummy_object): New fn. + (maybe_dummy_object): New fn. + (is_dummy_object): New fn. + * cp-tree.h: Declare them. + * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object. + * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object. + * init.c (build_member_call): Use maybe_dummy_object and + is_dummy_object. + (build_offset_ref): Use maybe_dummy_object. + (resolve_offset_ref): Use is_dummy_object. + * typeck.c (build_x_function_call): Call build_dummy_object. + (unary_complex_lvalue): Call is_dummy_object. + + * typeck.c (build_component_addr): Make sure field is a field. + + * call.c (build_new_op): Delete obsolete code. + + * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args. + +1998-10-18 Martin von Löwis + + * decl2.c (validate_nonmember_using_decl): Fix using-directives of + std if std is ignored. + +1998-10-18 Jason Merrill + + * decl.c (grokvardecl): Fix thinko. + + * decl.c (grokdeclarator): Embedded attrs bind to the right, + not the left. + + * parse.y (fn.def2): Fix 'attrs' format. + +1998-10-18 Alastair J. Houghton + + * Makefile.in (CONFLICTS): Update. + * parse.y (expr_or_declarator_intern): New rule. + (expr_or_declarator, direct_notype_declarator, primary, + functional_cast): Use it. + (notype_declarator_intern): New rule. + (notype_declarator, complex_notype_declarator): Use it. + +1998-10-17 Jason Merrill + + * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate. + (grokvardecl): Likewise. + +Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi + + * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR). + (add_method): Likewise for arguments 1 & 2 of `bcopy'. + + * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN. + + * pt.c (process_partial_specialization): Cast 1st argument of + `bzero' to (PTR). + + * tree.c (build_base_fields): Cast `base_align' to (int) when + comparing against one. + +1998-10-16 Mark Mitchell + + * decl.c (lookup_name_real): Handle template parameters for member + templates where said parameters have the same name as the + surrounding class. + + * decl.c (expand_static_init): Build cleanups before entering the + anonymous function used to do them to avoid access-checking + confusion. + + * decl.c (grokfndecl): Add back call to cplus_decl_attributes + accidentally removed by previous change, and make DECL_RTL here. + * class.c (add_method): Don't make DECL_RTL here. + + * pt.c (for_each_template_parm): Don't examine uninstantiated + default arguments. + +1998-10-16 Dave Brolley + + * lex.c (real_yylex): Fix unaligned access of wchar_t. + +1998-10-16 Mark Mitchell + + * class.c (add_method): Fix documentation to reflect previous + changes. Check for duplicate method declarations here. + * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL + correctly; such things never match. + (grokfndecl): Don't look for duplicate methods here. + * decl2.c (check_classfn): Don't assume names are mangled. + Don't add bogus member function declarations to a class before the + class type is complete. + (grokfield): Reformat error message. + * method.c (set_mangled_name_for_decl): Don't mangle names while + processing_template_decl. + +1998-10-16 Jason Merrill + + * typeck.c (build_indirect_ref): Complain about a pointer to data + member, too. + * typeck2.c (build_m_component_ref): Don't indirect a pointer to + data member. + * init.c (resolve_offset_ref): Don't undo the above. + + * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros. + (struct lang_decl_flags): Add `bitfield'. + * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of + DECL_BIT_FIELD. + * decl2.c (grokbitfield, grok_alignof): Likewise. + * init.c (build_offset_ref): Likewise. + * typeck.c (build_component_addr, expr_sizeof): Likewise. + * cvt.c (build_up_reference): Don't crash if taking the address + returns error_mark_node. + + * decl.c (grokfndecl): Also check ctype when checking for ::main(). + +1998-10-15 Jason Merrill + + * decl.c (grokfndecl): ::main and __builtin_* get C linkage. + Do mangling here. + (grokdeclarator): Instead of here. + * friend.c (do_friend): Lose special handling of ::main and + __builtin_*. + * cp-tree.h (DECL_MAIN_P): Check for C linkage. + + * spew.c (yylex): Clear looking_for_typename if we got + 'enum { ... };'. + +1998-10-15 Mark Mitchell + + * class.c (maybe_warn_about_overly_private_class): Improve error + messages for class with only private constructors. + + * cp-tree.def (TYPENAME_TYPE): Add to documentation. + * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document. + (build_typename_type): New function. + * decl.c (build_typename_type): Broken out from ... + (make_typename_type): Use it. + * search.c (lookup_field): Likewise. + +1998-10-14 Benjamin Kosnik + + * pt.c (convert_nontype_argument): Check against type_referred_to. + * decl.c (grokvardecl): Check for declarator name before building + DECL_ASSEMBLER_NAME. + +1998-10-14 Mark Mitchell + + * pt.c (lookup_template_class): Add comment. + (instantiate_class_template): Don't mark the _TYPE node for + member class templates as an instantiation. + +1998-10-14 Jason Merrill + + * decl.c (grokfndecl): Fix my thinko. + +1998-10-13 Jason Merrill + + * tinfo2.cc (fast_compare): Remove. + (before): Just use strcmp. + * tinfo.cc (operator==): Just use strcmp. + +1998-10-13 Klaus-Georg Adams + + * decl.c (grokfndecl): Don't check for linkage in `extern "C"' + declarations. + +1998-10-13 Mark Mitchell + + * cp-tree.h (specializations_of_same_template_p): Remove. + * search.c (get_template_base): Don't use it. + (get_template_base_recursive): Likewise. + * pt.c (specializations_of_same_template_p): Remove. + (unify): Don't use it. + (lookup_template_class): Find the correct parent when setting + CLASSTYPE_TI_TEMPLATE. + +1998-10-12 Jason Merrill + + * tinfo.cc (operator==): Always compare names. + +1998-10-12 Herman ten Brugge + + * decl.c (start_function): Fix cut-and-paste error. + +1998-10-12 Jason Merrill + + * inc/typeinfo: Add #pragma interface. + (operator!=): Just call operator==. + * tinfo.cc: Add #pragma implementation. + (operator==): Move from inc/typeinfo and tinfo2.cc. + Check __COMMON_UNRELIABLE instead of _WIN32. + + * typeck2.c (my_friendly_abort): Add URL. + +1998-10-12 Alastair J. Houghton + + * decl.c (start_method): Added extra parameter for attributes. + * cp-tree.h (start_method): Update prototype. + * parse.y (fn.def2): Update start_method parameter list. + +1998-10-11 Mark Mitchell + + * cp-tree.h (specializations_of_same_template_p): Declare. + * pt.c (specializations_of_same_template_p): New function. + (unify): Use it. + * search.c (get_template_base): Use it. + (get_template_base_recursive): Likewise. + +1998-10-10 Manfred Hollstein + + * decl2.c (start_objects): Add new variable `joiner' and + initialize it properly. + +1998-10-09 Mark Mitchell + + * search.c (expand_upcast_fixups): Tweak to match 1998-10-07 + change to vtable types. + + * cvt.c (ocp_convert): Avoid infinite recursion caused by + 1998-10-03 change. + +1998-10-08 Jason Merrill + + * pt.c (resolve_overloaded_unification): New fn. + (try_one_overload): Likewise. + (unify): Don't fail on unknown type. + (type_unification_real): Likewise. Use resolve_overloaded_unification + to handle an overloaded argument. + (template_args_equal): Split out... + (comp_template_args): From here. + (determine_specialization): Also allow a template with more + parms than were explicitly specified. + * cp-tree.h: Add template_args_equal. + * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code. + +Thu Oct 8 15:58:30 1998 Anthony Green + + * semantics.c (finish_asm_stmt): Revert my 1998-09-28 + change. + +Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com) + + * typeck.c (unsigned_type): Only return TItype nodes when + HOST_BITS_PER_WIDE_INT is >= 64 bits. + (signed_type): Likewise. + * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare + when HOST_BITS_PER_WIDE_INT is >= 64 bits. + (init_decl_processing): Only create TItype nodes when + HOST_BITS_PER_WIDE_INT is >= 64 bits. + * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare + when HOST_BITS_PER_WIDE_INT is >= 64 bits. + +Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi + + * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf. + (gxx.gperf): Update comments describing invocation flags. + (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs). + +1998-10-07 Mark Mitchell + + * class.c (finish_struct_1): Add commentary on previous change. + + * cp-tree.h (vtbl_ptr_type_node): New variable. + * class.c (build_vtbl_ref): Don't indirect through the vptr; it's + already of the right type. + (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node. + Simplify code to grow vtable. + * decl.c (vtbl_ptr_type_node): Define. + (init_decl_processing): Initialize it. + +1998-10-06 Mark Mitchell + + * cp-tree.def (PTRMEM_CST): New tree node. + * cp-tree.h (ptrmem_cst): New type. + (lang_type): Remove local_typedecls. + (dummy): Increase to 12 bits from 11. + (CLASSTYPE_LOCAL_TYPEDECLS): Remove. + (PTRMEM_CST_CLASS): New macro. + (PTRMEM_CST_MEMBER): Likewise. + (current_access_specifier): New variable. + (current_class_type): Remove duplicate declaration. + (finish_struct): Change prototype. + (unreverse_member_declarations): New function. + (pushdecl_class_level): Change prototype. + (grok_enum_decls): Remove. + (fixup_anonymous_union): New function. + (grok_x_components): Change prototype. + (tsubst_chain): Remove. + (finish_member_template_decl): Likewise. + (check_explicit_specialization): Fix indentation. + (finish_class_definition): Change prototype. + (finish_member_class_template): Likewise. + (finish_member_declaration): New function. + (check_multiple_declarators): Likewise. + * class.c (class_stack_node_t): New type. + (current_class_base): Remove. + (current_class_stack): Change type. + (current_access_specifier): New variable. + (grow_method): Remove. + (check_member_decl_is_same_in_complete_scope): Break out from + finish_struct. + (make_method_vec): New function. + (free_method_vec): Likewise. + (add_implicitly_declared_members): Break out from finish_struct_1. + (free_method_vecs): New variable. + (add_method): Rework for direct use from parser. + (handle_using_decl): Watch for NULL_TREE while iterating through + CLASSTYPE_METHOD_VEC. + (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; + just do some error-checking. + (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. + (finish_struct_1): Simplify. Use add_implicitly_declared_members. + (finish_struct): Change prototype. Simplify; fields and methods + are already set up at this point. + (init_class_processing): Set up current_class_stack. + (pushclass): Save current_access_specifier. + (popclass): Restore it. + (currently_open_class): Simplify. + (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. + * decl.c (saved_scope): Add access_specifier. + (maybe_push_to_top_level): Save it. + (pop_from_top_level): Restore it. + (maybe_process_template_type_declaration): Use + finish_member_declaration. + (pushtag): Likewise. + (pushdecl_class_level): Don't return a value. + (fixup_anonymous_union): Break out from grok_x_components. + (shadow_tag): Use it. + (xref_tag): Complain about using an elaborated type specifier to + reference a template type parameter or typedef name. + (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. + (current_local_enum): Remove. + (build_enumerator): Call finish_member_declaration. + (grok_enum_decls): Remove. + * decl2.c (grok_x_components): Simplify. + (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. + (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. + (merge_functions): Add to comment. + (arg_assoc_type): Prototype. + (arg_assoc): Pass as many arguments as there are parameters. + * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of + OFFSET_REF. + * expr.c (cpls_expand_expr): Remove dead code. Handle + PTRMEM_CST. + * friend.c (do_friend): Lookup friends when in nested classes. + Change comments. + * init.c (build_offset_ref): Do lookup even for classes that are + only partially defined. + (decl_constant_value): Remove dead code. + * method.c (build_overload_value): Remove hack where by TYPE was + not a TYPE. Handle PTRMEM_CST. + (build_template_parm_names): Don't pass a PARM_DECL where a TYPE + should go. + * parse.y (components, notype_components, component_decl, + component_decl_1, component_declarator, component_declarator0): + Now all are itype rather than ttype. Rework to add members to + classes on the fly. + (typesqpecqual_reserved): Use check_multiple_declarators. + (structsp): Update class to finish_class_definition. + (do_xref_defn): Unsplit into named_class_head. + (access_specifier): Set current_access_specifier. + * pt.c (set_current_access_from_decl): New function. + (finish_member_template_decl): Don't take the parameters. + (comp_template_args): Make more robust. + (lookup_template_class): Don't use current_local_enum. + (for_each_template_parm): Handle PTRMEM_CST. + (instantiate_class_template): Use set_current_access_from_decl, + finish_member_declaration and unreverse_member_declarations. Set + lineno/input_filename before generating implicit member functions. + (type_unification_real): Don't assume back-unification happens + only for the last argument. + (regenerate_decl_from_template): Call pushclass a bit earlier. + (tsubst_chain): Remove. + (tsubst_enum): Use set_current_access_from_decl. + (set_mangled_name_for_template_decl): Fix indentation. + * search.c (lookup_fnfields_1): Change iteration through + CLASSTYPE_METHOD_VEC. + (dfs_pushdecls): Likewise. + (dfs_compress_decls): Likewise. + (add_conversions): Likewise. + * semantics.c (finish_class_definition): Don't take components. + Change call to finish_struct. + (finish_member_declaration): New function. + (finish_member_class_template): Don't take template parameters. + Change call to grok_x_components. Call finish_member_template_decl. + (check_multiple_declarators): New function. + * sig.c (append_signature_fields): Work from the TYPE_METHODS, not + a passed in fieldlist. + * tree.c (search_tree): Handle PTRMEM_CST. + (mapcar): Likewise. + * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not + INTEGER_CSTs, for pointer-to-data members. + + * call.c (resolve_args): Resolve template specializations, if + possible. + +Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi + + * Makefile.in (spew.o): Depend on toplev.h. + + * call.c (compare_ics): Initialize variables `deref_from_type2', + `deref_to_type1' and `deref_to_type2'. + + * except.c (get_eh_type): Hide prototype and definition. + (process_start_catch_block_old): Remove unused static prototype. + + * pt.c (tsubst_decl): Initialize variable `argvec'. + + * spew.c: Include toplev.h. + +1998-10-05 Jason Merrill + + * pt.c (instantiate_decl): Do save and restore file position. + +1998-10-05 Martin von Löwis + + * method.c (build_decl_overload_real): Clear + numeric_output_need_bar after __. + +1998-10-05 Nathan Sidwell + + * call.c (build_new_method_call): Issue 'incomplete type' error, + if class is not defined. + +1998-10-05 Kaveh R. Ghazi + + * call.c (build_object_call): Move declaration of variable + `fn' into the scope where it is used. Don't access variable + `fn' when it is uninitialized, instead use `fns'. + +1998-10-04 Theodore Papadopoulo + + * errfn.c (cp_thing): Print buf as a string not as a printf format + to avoid problems with the operator%. Consequently, `%%' sequences + in format are copied as `%' in buf. + +1998-10-04 Jason Merrill + + * pt.c (pop_tinst_level): Call extract_interface_info. + (instantiate_decl): Don't save and restore file position. + + * decl.c (cp_finish_decl): Make statics in extern inlines and + templates common, if possible and the target doesn't support weak + symbols. + + * decl.c (grokdeclarator): Remove redundant calls to + build_type_variant and some duplicated code. + * sig.c (build_signature_reference_type): Only take the type parm. + (build_signature_pointer_type): Likewise. + * tree.c (build_cplus_method_type): Adjust. + * cp-tree.h: Update. + +1998-10-04 Mark Mitchell + + * call.c (build_over_call): Make pedwarns about dropped qualifiers + into full-fledged errors. + * cvt.c (convert_to_reference): Likewise. + * typeck.c (convert_for_assignment): Likewise. + + * search.c (expand_upcast_vtables): In addition to unsetting + TREE_READONLY, remove top-level const type qualifier. + +1998-10-03 Mark Mitchell + + * class.c (current_class_ptr, current_class_ref): Clarify + documentation. + * cvt.c (ocp_convert): Don't expect fold to remove all trivial + NOP type conversions. + * decl.c (decls_match): Use comptypes directly; ignore + qualifiers on the DECL. + (duplicate_decls): Remove qualifier checks on DECL. + (grokdeclarator): Make the type built up include top-level + qualifiers. + * decl2.c (do_dtors): Fix spelling error. + * error.c (dump_simple_decl): Don't look at qualifiers on the decl + when printing type information. + * init.c (build_new_1): Add documentation. Deal with the fact + that type of allocated memory now contains qualifiers. + * lex.c (is_global): Improve error-recovery. + * sig.c (build_member_function_pointer): Don't cast away const + on fields of sigtable_entry_type. + * tree.c (lvalue_type): Don't look at top-level qualifiers on + expressions. + * typeck.c (decay_conversion): Likewise. + (build_component_ref): Make sure the type of the COMPONENT_REF + contains top-level qualifiers, as appropriate. Improve + error-handling. + (build_indirect_ref): Simplify. Don't strip top-level qualifiers. + (build_array_ref): Likewise. + (build_unary_op): Improve error-recovery. + (unary_complex_lvalue): Make taking the address a bound member + function an error, not a sorry. + (build_conditional_expr): Look at the type qualifiers, not the + qualifiers on the expression itself. + +1998-10-03 Jason Merrill + + * decl2.c (merge_functions): Remove duplicates. + + * decl2.c: Add -f{no-,}implicit-inline-templates. + (import_export_decl): Check it. + + * decl.c (lookup_name_real): Template parms also take precedence + over implicit typename. Only warn if yylex. + + * typeck.c (build_conditional_expr): Only fold if ifexp is an + INTEGER_CST. + + * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN + instead of linkage. + +1998-10-01 Jason Merrill + + * cp-tree.h (FORMAT_VBASE_NAME): New macro. + * class.c (build_vbase_pointer): Use it. + * rtti.c (expand_class_desc): Likewise. + * tree.c (build_vbase_pointer_fields): Likewise. + +Thu Oct 1 10:43:45 1998 Nick Clifton + + * decl.c (start_decl): Add invocation of + SET_DEFAULT_DECL_ATTRIBUTES, if defined. + (start_function): Add invocation of + SET_DEFAULT_DECL_ATTRIBUTES, if defined. + + * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with + HANDLE_GENERIC_PRAGMAS. + +1998-09-28 Anthony Green + + * semantics.c (finish_asm_stmt): Always permit volatile asms. + +1998-09-28 Mark Mitchell + + * decl.c (grokdeclarator): Tighten checks for invalid + destructors. Improve error-messages and error-recovery. + * decl2.c (check_classfn): Don't assume that mangled destructor + names contain type information. + +1998-09-25 Jason Merrill + + * search.c (get_base_distance): Remove assert. + + * decl2.c (build_anon_union_vars): Don't process a field with no + name. + (finish_anon_union): Also complain about local anon unions with no + members. + +1998-09-25 Martin von Löwis + + * decl.c (lookup_namespace_name): If the name is a namespace, + return it immediately. + +Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi + + * cp-tree.h (define_case_label): Remove unused parameter. + (check_java_method): Likewise. + (grokclassfn): Likewise. + (expand_aggr_init): Likewise. + (build_x_delete): Likewise. + (maybe_end_member_template_processing): Likewise. + (unshare_base_binfos): Add prototype. + (string_conv_p): Likewise. + (my_friendly_abort): Mark with ATTRIBUTE_NORETURN. + + * cvt.c (build_up_reference): Remove unused parameter + `checkconst', all callers changed. + (build_type_conversion): Mark parameter `code' with + ATTRIBUTE_UNUSED. + (build_expr_type_conversion): Initialize variable `conv'. + + * decl.c (push_namespace): Initialize variable `d'. + (define_case_label): Remove unused parameter `decl', all callers + changed. + + * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter + `argc' with ATTRIBUTE_UNUSED. + (grokclassfn): Remove unused parameter `cname', all callers + changed. + (check_java_method): Likewise for parameter `ctype'. + (copy_assignment_arg_p): Mark parameter `virtualp' with + ATTRIBUTE_UNUSED. + (finish_prevtable_vardecl): Likewise for parameter `prev'. + + * expr.c (extract_init): Likewise for parameters `decl' and `init'. + + * init.c (expand_aggr_init_1): Remove unused parameter + `alias_this', all callers changed. + (expand_aggr_init): Likewise. + (expand_default_init): Likewise. + (build_new_1): Initialize variable `susp'. + (build_x_delete): Remove unused parameter `type', all callers + changed. + + * lex.c (set_typedecl_interface_info): Mark parameter `prev' with + ATTRIBUTE_UNUSED. + (readescape): Use (unsigned) value in shift. + (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when + comparing to a signed quantity. + + * pt.c (maybe_end_member_template_processing): Remove unused + parameter `decl', all callers changed. + (check_explicit_specialization): Add braces around empty body in + an else-statement. + (current_template_args): Initialize variable `args'. + (lookup_template_class): Likewise for variable `prev_local_enum'. + (tsubst_decl): Likewise for variable `r'. + (set_mangled_name_for_template_decl): Initialize variable + `context'. + + * spew.c (scan_tokens): Change type of parameter `n' to unsigned. + Likewise for variable `i'. + (yylex): Initialize variable `trrr'. + + * typeck.c (compparms): Mark variable `strict' with + ATTRIBUTE_UNUSED. + + * xref.c (simplify_type): Cast argument of ctype function to + `unsigned char'. + +1998-09-24 Mark Mitchell + + * cp-tree.h (language_lvalue_valid): Remove. + * decl.c (grokdeclarator): Don't disallow references to functions. + * tree.c (lvalue_p_1): New function, combining duplicated + code from ... + (lvalue_p): Use it. + (real_lvalue_p): Likewise. + * typeck.c (language_lvalue_valid): Remove. + (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though + they don't have TREE_READONLY set. + * typeck2.c (readonly_error): Add case for FUNCTION_DECLs. + +1998-09-24 Benjamin Kosnik + + * spew.c (yylex): Give diagnostic. + * hash.h (is_reserved_word): Add export. + * gxx.gperf: Likewise. + * lex.h (rid): Add RID_EXPORT. + * lex.c (init_parse): Likewise. + +Tue Sep 22 21:01:19 1998 Gerald Pfeifer + + * friend.c (do_friend): Make warning a full sentence. + +1998-09-22 Mark Mitchell + + * parse.y (component_decl_list): Improve error-recovery. + +1998-09-22 Benjamin Kosnik + + * decl.c (make_typename_type): Move error to point where name + variable can be used by dump_type. + +1998-09-22 Mark Mitchell + + * decl.c (grokfndecl): Improve error-recovery. + * decl2.c (grokfield): Likewise. + * pt.c (finish_member_template_decl): Likewise. + +1998-09-20 Martin von Löwis + + * method.c (hack_identifier): Finding multiple members is always + an error. + +1998-09-21 Per Bothner + + * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o. + +Mon Sep 21 01:53:05 1998 Felix Lee + + * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT (). + +1998-09-20 Mark Mitchell + + * class.c (maybe_warn_about_overly_private_class): Reformat. + +1998-09-17 Andrew MacLeod + + * exception.cc (__cplus_type_matcher): Realign some code. + +1998-09-16 Mark Mitchell + + * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling. + (tinfo2.o): Likewise. + (exception.o): Likewise. + (new.o): Likewise. + (opnew.o): Likewise. + (opnewnt.o): Likewise. + (opvnew.o): Likewise. + (opvnewnt.o): Likewise. + (opdel.o): Likewise. + (opdelnt.o): Likewise. + (opvdel.o): Likewise. + (opvdelnt.o): Likewise. + +1998-09-16 Richard Henderson + + * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp. + +1998-09-15 Alexandre Oliva + + * call.c (build_field_call): Handle static data members too. + + * typeck.c (comptypes): When comparing pointer types, check + whether referred types match even in strictest modes. + +1998-09-15 Mark Mitchell + + * cp-tree.h: Revert previous change. + (finish_struct_methods): Remove declaration. + * class.c: Revert previous change. + (maybe_warn_about_overly_private_class): New function. + (finish_struct_methods): Declare here, and make static. Remove + unnecessary parameters. Tidy slightly. Use + maybe_warn_about_overly_private_class. + (finish_struct_1): Adjust. Remove check for private constructors, + now done elsewhere. + (finish_struct): Adjust. + +1998-09-15 Andrew MacLeod + + * except.c (expand_start_catch_block): No need to check for new + exception model. + (process_start_catch_block_old): Deleted. + (process_start_catch_block): Add call to start_decl_1(). + (expand_end_catch_block): Add call to end_catch_handler(). + * exception.cc (__cplus_type_matcher): Only check the exception + language if there is an exception table. + +1998-09-15 Andrew MacLeod + + * search.c (expand_indirect_vtbls_init): Mark temporary stack slots + as used to prevent conflicts with virtual function tables. + +1998-09-14 Mark Mitchell + + * cp-tree.h (lang_type): Add has_non_private_static_mem_fn. + (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it. + * class.c (maybe_class_too_private_p): New function. + (finish_struct_methods): Use it. + (finish_struct_1): Likewise. + (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if + appropriate. + + * pt.c (check_specialization_scope): Fix spelling error. + (check_explicit_specialization): Remove code to handle explicit + specializations in class scope; they are now correctly diagnosed + as errors. + +1998-09-10 Mark Mitchell + + * decl.c (pushdecl): Don't copy types if the + DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the + type. + +1998-09-09 Kriang Lerdsuwanakij + + * class.c (get_enclosing_class): New function. + (is_base_of_enclosing_class): Likewise. + * cp-tree.h (get_enclosing_class): Declare. + (is_base_of_enclosing_class): Likewise. + * pt.c (coerce_template_parms): Use them. + +1998-09-09 Jason Merrill + + * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is + null to decide whether to use it. + + * error.c (dump_type_real): Handle NAMESPACE_DECL. + * parse.y (base_class.1): Avoid crash on error. + +1998-09-08 Martin von Löwis + + * decl.c (make_typename_type): If context is a namespace, the code + is in error. + +1998-09-08 Mumit Khan + + * parse.y (nomods_initdcl0): Set up the parser stack correctly. + +1998-09-08 Mark Mitchell + + * cp-tree.h (anonymous_namespace_name): Declare. + * decl.c: Define it. + (push_namespace): Use anonymous_namespace_name, rather than local + static anon_name. + * error.c (dump_decl): If a namespace is named + anonymous_namespace_name, call it {anonymous}. + + * decl.c (grokparms): Distinguish between references and pointers + in error message. + +1998-09-08 Richard Henderson + Mark Mitchell + + * pt.c (process_partial_specialization): Consistently allocate + and zero tpd.parms based on ntparms. Use tpd2.parms, not + tpd.parms, where appropriate. + +Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INCLUDES): Update after recent toplevel gcc + reorganizations. + +1998-09-05 Mark Mitchell + + * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove. + * class.c (finish_struct): Remove hackery to deal with explicit + specializations in class scope. + * decl.c (grokfndecl): Improve error-recovery. + * decl2.c (grokfield): Likewise. + * pt.c (check_specialization_scope): New function. + (begin_specialization): Call it. + (process_partial_specialization): New function, split out from + push_template_decl. Check partial specializations more + stringently. + (push_template_decl): Call it. + (check_explicit_specialization): Don't attempt to handle explicit + specializations in class scope. + (template_parm_data): Document. Add current_arg and + arg_uses_template_parms. + (mark_template_parm): Set it. + (tsubst_arg_types): Remove unused variable. + * semantics.c (begin_class_definition): Tweak. + +1998-09-04 Mark Mitchell + + * inc/typeinfo (type_info::type_info(const char*)): Make + `explicit'. + + * cp-tree.h (hash_tree_cons_simple): New macro. + * pt.c (tsubst_arg_types): New function. Use hash_tree_cons. + (coerce_template_parms): Use make_temp_vec, instead of + make_tree_vec. Document this behavior. + (lookup_template_class): Likewise. + (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types. + Remove dead code (and add assertion to check its deadness). Fix + bug w.r.t. exception specifications. + +1998-09-03 Jason Merrill + + * decl2.c (import_export_vtable): Always make artificials comdat. + (import_export_decl): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + +1998-09-03 Mark Mitchell + + * cp-tree.h (finish_globally_qualified_member_call_expr): + Rename to ... + (finish_qualified_call_expr). + * semantics.c: Likewise. + * parse.y (primary): Use it. + * method.c (hack_identifier): Remove redundant code. + + * init.c (resolve_offset_ref): Call convert_from_reference to + handle members of reference type. Improve error recovery. + +1998-09-03 Benjamin Kosnik + + * cp-tree.h: Declare warn_nontemplate_friend. + * decl2.c (lang_decode_option): Set. + * lang-options.h: Add -Wnon-template-friend. + * friend.c (do_friend): Use to toggle non-template function warning. + +1998-09-03 Mark Mitchell + + * decl.c (finish_enum): Don't resolve CONST_DECLs to their + corresponding INTEGER_CSTs when processing_template_decl. + * pt.c (tsubst_enum): Tweak accordingly. + +1998-09-03 Benjamin Kosnik + + * decl.c (pushdecl_class_level): Add warning here. + (pushdecl): Tweak. + +1998-09-02 Jason Merrill + + * cvt.c (convert_pointer_to_real): Tidy. + * search.c (get_base_distance_recursive): Simplify. + (get_base_distance): Likewise. + + * pt.c (unify): Only special-case INTEGER_TYPE if it uses template + parms. + +Wed Sep 02 09:25:29 1998 Nick Clifton + + * lex.c (check_newline): Call HANDLE_PRAGMA before + HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages + if unknown pragmas are encountered. + (handle_sysv_pragma): Interpret return code from + handle_pragma_token (). Return success/failure indication rather + than next unprocessed character. + (pragma_getc): New function: retrieves characters from the + input stream. Defined when HANDLE_PRAGMA is defined. + (pragma_ungetc): New function: replaces characters back into the + input stream. Defined when HANDLE_PRAGMA is defined. + +1998-09-01 Jason Merrill + + * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands. + * class.c (build_vtable_entry_ref): Likewise. + +1998-09-01 Mark Mitchell + + * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro. + * decl2.c (import_export_decl): Likewise. + * pt.c (instantiate_decl): Use it. + +1998-09-01 Jason Merrill + + * decl.c (lookup_name_real): Also do implicit typename thing for + artificial TYPE_DECLs. + * search.c (lookup_field): Likewise. + (lookup_fnfields, lookup_field): Adjust for implicit typename kludge. + * semantics.c (begin_constructor_declarator): Use enter_scope_of. + (enter_scope_of): Extract type from implicit typename. + (begin_class_definition): Likewise. + * lex.c (identifier_type): Handle implicit typename when checking + for SELFNAME. + + * cp-tree.h: Declare flag_strict_prototype. + * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if + -fstrict-prototype. + * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't + specified, set it to the value of pedantic. + +1998-09-01 Mark Mitchell + + * decl2.c (arg_assoc): Handle template-id expressions as arguments. + +1998-08-31 Mark Mitchell + + * decl.c (finish_enum): Handle member enums of classes declared in + template functions. + + * decl2.c (grok_x_components): Strip attributes before calling + groktypename. + +1998-08-31 Jason Merrill + + * cp-tree.h, decl2.c: Remove support for -fall-virtual, + -fenum-int-equivalence and -fno-nonnull-objects. + * class.c (check_for_override): Remove support for -fall-virtual. + (finish_struct_1): Likewise. + * call.c (build_new_op): Remove support for -fenum-int-equivalence. + * typeck.c (build_binary_op_nodefault): Likewise. + * cvt.c (ocp_convert): Likewise. + * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects. + * class.c (build_vbase_path): Likewise. + +Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org) + + * Makefile.in (INTERFACE): New, set to 1. + +1998-08-30 Mark Mitchell + + * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when + comparing with global_namespace. + (dump_aggr_type): Likewise. + + * decl.c (grokfndecl): Issue error on declaration of friend + templates with explicit template arguments. + + * pt.c (convert_template_argument): New function, split out + from... + (coerce_template_parms): Here. + (tsubst): Attempt better error-recovery. + +1998-08-28 Benjamin Kosnik + + * pt.c (decl_template_parm_p): Add checks for + TEMPLATE_TEMPLATE_PARM. + +1998-08-28 Mark Mitchell + + * lex.c (do_identifier): Fix thinko in previous change. + +1998-08-28 Jason Merrill + + * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns. + * decl2.c (output_vtable_inherit): Call binfo_for_vtable. + +1998-08-28 Richard Henderson + + Add support for discarding unused virtual functions. + * lang-options.h: Add -fvtable-gc. + * cp-tree.h: Add flag_vtable_gc. + * decl2.c (output_vtable_inherit): New fn. + (finish_vtable_vardecl): Call it. + * class.c (build_vtable_entry_ref): New fn. + (build_vtbl_ref): Call it. + +1998-08-28 Mark Mitchell + + * cp-tree.h (build_enumerator): Take the enumeration type as a + parameter. + * decl.c (finish_enum): Don't set the TREE_TYPE for the + enumeration constant values if we're processing_template_decls. + Don't set the type for the CONST_DECLs either; that's done in + build_enumerator. + (build_enumerator): Take the enumeration type as a + parameter. + * lex.c (do_identifier): Don't resolve enumeration constants while + processing template declarations, even if they happen to be + TEMPLATE_PARM_INDEXs. + + * parse.y (current_enum_type): New variable. + (primary): Don't allow statement-expression in local classes just + as we don't in global classes. + (structsp): Use current_enum_type. + (enum_list): Likewise. + * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by + finish_enum; they no longer occur. + + * cp-tree.h (finish_base_specifier): New function. + * parse.y (base_class): Use it. + * semantics.c (finish_base_specifier): Define it. + + * parse.y (structsp): Warn on use of typename outside of template + declarations. + +1998-08-27 Jason Merrill + + * lex.c (handle_cp_pragma): Remove #pragma vtable. + * lang-options.h: Remove +e options. + * decl2.c (lang_decode_option): Likewise. + (import_export_vtable): Don't check write_virtuals. + (finish_vtable_vardecl, finish_file): Likewise. + * search.c (dfs_debug_mark): Likewise. + * semantics.c (begin_class_definition): Likewise. + * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise. + + * call.c (build_over_call): Check flag_elide_constructors. + * decl2.c: flag_elide_constructors defaults to 1. + * typeck.c (convert_arguments): Remove return_loc parm. + (build_function_call_real): Adjust. + + * search.c: Tear out all mi_matrix and memoize code. + (lookup_field, lookup_fnfields): Use scratch_tree_cons. + * lang-options.h: Remove documentation for -fhandle-exceptions, + -fmemoize-lookups and -fsave-memoized. + * cp-tree.h: Lose mi_matrix and memoize support. + * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized. + * class.c: Lose struct class_level. + (pushclass, popclass): Lose memoize support. + * init.c (build_offset_ref): Likewise. + + Never change BINFO_INHERITANCE_CHAIN. + * init.c (emit_base_init): Change modification of + BINFO_INHERITANCE_CHAIN to an assert. + * search.c (get_base_distance_recursive): Likewise. + (get_base_distance): Likewise. + (lookup_member): Likewise. + (convert_pointer_to_single_level): Likewise. + (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs. + (lookup_fnfields): Likewise. + * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos. + (unshare_base_binfos): Don't call propagate_binfo_offsets. + (layout_basetypes): Call propagate_binfo_offsets instead of + unshare_base_binfos. + * decl.c (xref_basetypes): Call unshare_base_binfos. + * pt.c (instantiate_class_template): Likewise. + * tree.c (reverse_path): Remove 'copy' parm; always make a + temporary copy. + * class.c (build_vbase_path): Just call it. + * search.c (compute_access): Likewise. Don't re-reverse. + +1998-08-27 Mark Mitchell + + * class.c (build_vbase_path): Use reverse_path. + (finish_base_struct): Move warnings for inaccessible bases to + layout_basetypes. + (modify_one_vtable): Remove check of TREE_USED (binfo). + (fixup_vtable_deltas1): Likewise. + * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here. + (xref_tag): Remove binfos parameter. + (make_binfo): Remove chain parameter. + (reverse_path): Add copy parameter. + * decl.c (init_decl_processing): Change calls to xref_tag. + (xref_tag): Remove binfos parameter. + (xref_basetypes): Change calls to make_binfo. + * decl2.c (grok_x_components): Change calls to xref_tag. + (handle_class_head): Likewise. + * friend.c (do_friend): Likewise. + * lex.c (make_lang_type): Change calls to make_binfo. + * parse.y (structsp): Change calls to xref_tag. + (named_complex_class_head_sans_basetype): Likewise. + (named_class_head): Likewise. + * rtti.c (init_rtti_processing): Likewise. + * search.c (compute_access): Change calls to reverse_path. + (dfs_get_vbase_types): Change calls to make_binfo. + (get_vbase_types): Remove dead code. + * tree.c (unshare_base_binfos): Change calls to make_binfo. + (layout_basetypes): Warn here about inaccessible bases. + (make_binfo): Remove chain parameter. + (reverse_path): Add copy parameter. + +1998-08-27 Jason Merrill + + * class.c: #if 0 complete_type_p. + * init.c (build_java_class_ref, build_new_1): Remove unused locals. + * method.c (process_overload_item): Likewise. + * typeck.c (comp_target_types): Likewise. + + Stop sharing binfos for indirect virtual bases. + * tree.c (propagate_binfo_offsets): Unshare vbases, too. + (layout_basetypes): Likewise. + (unshare_base_binfos): Copy vbases, too. + * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED, + BINFO_VBASE_INIT_MARKED): Remove obsolete macros. + (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED, + CLEAR_BINFO_PUSHDECLS_MARKED): New macros. + * search.c (lookup_field, lookup_fnfields, lookup_member): Remove + reference to BINFO_VIA_PUBLIC. + (marked_pushdecls_p, unmarked_pushdecls_p): New fns. + (push_class_decls): Use them. + (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED. + (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED. + +1998-08-27 Mark Mitchell + + * decl.c (build_enumerator): Set DECL_CONTEXT for the + CONST_DECLs. + +1998-08-26 Mark Mitchell + + * cp-tree.h (finish_enum): Change prototype. + * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a + VALUES parameter. Don't try to compute mins/maxs if + processing_template_decl. + * parse.y (structsp): Use new calling sequence for finish_enum. + * pt.c (tsubst_enum): Likewise. Take the new type as input. + (lookup_template_class): Remove unused variables. Tweak. + Register enums on instantiation list before substituting + enumeration constants. + (tsubst_decl): Remove unused variables. + (regenerate_decl_from_template): Likewise. + + * decl.c (duplicate_decls): Don't obliterate the + DECL_TEMPLATE_INFO for a template if we're not replacing it with + anything. + + * lex.c (do_identifier): Fix typo in comment. + +Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi + + * errfn.c: Remove stdarg.h/varargs.h. + * tree.c: Likewise. + +1998-08-25 Brendan Kehoe + + * pt.c (tsubst_copy): Only do typename overloading on an + IDENTIFIER_NODE that happens to look like a typename if it actually + has a type for us to use. + +1998-08-25 Jason Merrill + + * typeck.c (comp_cv_target_types): Split out... + (comp_target_types): From here. Don't allow cv-qual changes under + a pointer if nptrs == 0. Fix OFFSET_TYPE handling. + (build_ptrmemfunc): Pass 1 to nptrs. + * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes. + +1998-08-25 Mark Mitchell + + * search.c (dependent_base_p): Don't compare a binfo to + current_class_type; use the TREE_TYPE of the binfo instead. + + * cp-tree.h (CLASS_TYPE_P): Revise definition. + +1998-08-25 Jason Merrill + + * decl.c (duplicate_decls): Don't complain about different + exceptions from an internal decl even if pedantic. + + * typeck.c (convert_for_assignment): Converting from pm of vbase + to derived is an error, not a sorry. + + * call.c (build_over_call): Use convert_pointer_to_real for 'this'. + * class.c (fixed_type_or_null): Rename from + resolves_to_fixed_type_p. Return the dynamic type of the + expression, if fixed, or null. + (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type + does not match the static type. + (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use + resolves_to_fixed_type_p again. + +1998-08-24 Mark Mitchell + + * pt.c (tsubst_decl): Move special case code for dealing with + tricky friend templates here from ... + (regenerate_decl_from_template): Here. + +1998-08-24 Jason Merrill + + * decl.c (start_decl): Remove redundant linkage check. + +1998-08-24 Gavin Romig-Koch + + * typeck.c (c_expand_return): Handle the case that valtype + is wider than the functions return type. + +1998-08-24 Mark Mitchell + + * cp-tree.h (CLASS_TYPE_P): New macro. + * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE. + * pt.c (process_template_parm): Undo previous change. + +1998-08-24 Benjamin Kosnik + + * cp-tree.h: Declare. + * pt.c (decl_template_parm_p): New function. + * decl.c (pushdecl): Check decls for redeclaring template parms. + (xref_tag): Make redeclaration an error, print decl. + * decl2.c (grokfield): Check field_decls for redeclaration as well. + +1998-08-24 Jason Merrill + + * parse.y (primary): Fix up the type of string constants. + +1998-08-24 Mark Mitchell + + * typeck.c (convert_for_initialization): Move check for odd uses + of NULL to avoid duplicate warnings. + +1998-08-24 Jason Merrill + + * tree.c (lvalue_type): Fix for arrays. + * typeck.c (string_conv_p): New fn. + (convert_for_assignment): Use it. + (build_unary_op): Use lvalue_type. + * call.c (standard_conversion, convert_like): Use string_conv_p. + (add_function_candidate): Use lvalue_type. + * cvt.c (convert_to_reference): Likewise. + * decl2.c (lang_decode_option): Ignore -traditional. + * decl.c (init_decl_processing): flag_writable_strings inhibits + flag_const_strings. + +1998-08-24 Andrew MacLeod + + * lang-options.h (lang_options): Add fconst-strings to the list + of valid options. + * decl2.c (lang_f_options, lang_decode_option): Likewise. + +1998-08-24 Nathan Sidwell + + * lex.c (real_yylex): Don't warn about long long constants if + we're allowing long long. + +1998-08-24 Martin von Löwis + + * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of + accessing bindings directly. + + * search.c (my_tree_cons): Reimplement. + + * lang-specs.h: Remove __HONOR_STD. + * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise. + +1998-08-23 Mark Mitchell + + * decl.c (grokdeclarator): Complain about in-class initialization + of aggregates and/or references. + * pt.c (process_template_parm): Clear IS_AGGR_TYPE for + TEMPLATE_TYPE_PARMs. + + * decl2.c (grok_array_decl): Add comment. + (mark_used): Don't instantiate an explicit instantiation. + * friend.c (make_friend_class): Remove bogus comment. Fix check + for partial specializations. + * pt.c (check_explicit_specialization): Don't + SET_DECL_EXPLICIT_INSTANTIATION here. + (mark_decl_instantiated): Or here. + (do_decl_instantiation): Do it here, instead. Add checks for + duplicate explicit instantiations, etc. Tidy. + (do_type_instantiation): Likewise. + (instantiate_decl): Improve comments. Complain about explicit + instantiations where no definition is available. + + * cp-tree.h (ansi_null_node): Remove. + * call.c (build_over_call): Warn about converting NULL to an + arithmetic type. + * cvt.c (build_expr_type_conversion): Likewise. Use + null_ptr_cst_p instead of expanding it inline. + * decl.c (ansi_null_node): Remove. + (init_decl_processing): Make null_node always have integral type. + * except.c (build_throw): Warn about converting NULL to an + arithmetic type. + * lex.c (init_parse): Remove handling of ansi_null_node. + * pt.c (type_unification_real): Don't convert NULL to void* type. + * typeck.c (build_binary_op_nodefault): Fix NULL warnings. + (convert_for_assignment): Warn about converting NULL to an + arithmetic type. + (convert_for_initialization): Likewise. + +1998-08-20 Jason Merrill + + * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn. + * pt.c (coerce_template_parms): Use no_linkage_check. + * decl.c (grokvardecl): Likewise. + (grokfndecl): Likewise. Members of anonymous types have no linkage. + + * method.c (process_overload_item): Remove useless code. + +1998-08-20 Per Bothner + + Handle new'ing of Java classes. + * init.c (build_class_classref): New function. + (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject; + constructor does not return this; don't need to exception-protect. + + * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag. + * decl2.c (acceptable_java_type): Handle template-derived types. + +1998-08-20 Per Bothner + + * decl2.c (import_export_vtable): Suppress vtables for Java classes. + +1998-08-20 Mark Mitchell + + * decl.c (duplicate_decls): Always merge the old and new patterns + for templates, regardless of whether or not the new one has + DECL_INITIAL. Don't throw away specializations. Merge + DECL_SAVED_TREE. + * pt.c (tsubst_decl): Use the right pattern when calculating the + complete args for a new template instance. + (do_decl_instantiation): Fix typo in comment. + (regenerate_decl_from_template): Deal with tricky friend template + case. + (instantiate_decl): Likewise. + +Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com) + + * init.c (build_builtin_delete_call): Add missing assemble_external + call. + +1998-08-20 Jason Merrill + + * parse.y (notype_unqualified_id): Also accept ~A. + +1998-08-19 Mark Mitchell + + * typeck.c (build_binary_op_nodefault): Warn on use of NULL in + arithmetic. + * except.c (build_throw): Warn when NULL is thrown, even with + -ansi. Use ansi_null_node, rather than integer_zero_node, in the + thrown expression. + + * cp-tree.h (ansi_null_node): New variable. + * decl.c (ansi_null_node): New variable. + (init_decl_processing): Initialize its type. + * lex.c (init_parse): Initialize its value. Use ansi_null_node + for null_node in non-ANSI mode. + * typeck.c (build_binary_op_nodefault): Use ansi_null_node in + place of null_node to avoid spurious errors. + +1998-08-17 Mark Mitchell + + * cp-tree.h (enter_scope_of): New function. + * parse.y (complex_direct_notype_declarator): Use it. + * semantics.c (enter_scope_of): New function. + +1998-08-17 Jason Merrill + + * decl.c (grokparms): No, here. + + * decl.c (grokdeclarator): Catch parm with pointer to array of + unknown bound here... + * method.c (process_overload_item): ...not here. + + * gxxint.texi: Remove obsolete documentation of overloading code. + + * decl.c (finish_enum): Also set TYPE_SIZE_UNIT. + * class.c (finish_struct_bits): Likewise. + + * tree.c (lvalue_type): Fix for arrays. + * typeck.c (build_unary_op): Use lvalue_type. + * call.c (add_function_candidate): Likewise. + * cvt.c (convert_to_reference): Likewise. + + * decl2.c (lang_decode_option): Ignore -traditional. + + * init.c (build_offset_ref): Don't mess with error_mark_node. + * lex.c (do_scoped_id): Use cp_error. + + * rtti.c (get_tinfo_fn): Don't mess with the context for now. + +1998-08-17 Benjamin Kosnik + + * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified. + +Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com) + + * cp-tree.h (set_identifier_local_value): Provide prototype. + + * decl2.c (do_namespace_alias): Remove unused variables `binding' + and `old'. + +Fri Aug 14 16:42:27 1998 Nick Clifton + + * Makefile.in: Rename BBISON to BISON so that it can be properly + inherited from the parent makefile. + +1998-08-13 Jason Merrill + + * lang-options.h: Add -finit-priority. + * decl2.c: Likewise. Check flag_init_priority instead of + USE_INIT_PRIORITY. + + * decl2.c (setup_initp): New fn. + (start_objects, finish_objects, do_ctors): Handle init_priority. + (do_dtors, finish_file): Likewise. + +1998-08-13 Jason Merrill + + * pt.c (tsubst_copy): Hush warning. + + * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P. + +1998-08-12 Mark Mitchell + + * pt.c (print_template_context): Don't abort when instantiating a + synthesized method. + + * decl.c (grokdeclarator): Issue errors on namespace qualified + declarators in parameter lists or in class scope. + +1998-08-09 Mark Mitchell + + * pt.c (check_explicit_specialization): Don't abort on bogus + explicit instantiations. + +1998-08-07 Mark Mitchell + + * typeck.c (require_complete_type): Use complete_type_or_else. + (complete_type_or_else): Always return NULL_TREE on failure, as + documented. + + * pt.c (tsubst_aggr_type): Prototype. + (tsubst_decl): New function, split out from tsubst. Set + input_filename and lineno as appropriate. + (pop_tinst_level): Restore the file and line number saved in + push_tinst_level. + (instantiate_class_template): Set input_filename and lineno as + appropriate. + (tsubst): Move _DECL processing to tsubst_decl. Make sure the + context for a TYPENAME_TYPE is complete. + + * decl2.c (grokbitfield): Issue errors on bitfields declared with + function type. + (do_dtors): As in do_ctors, pretend to be a member of the same + class as a static data member while generating a call to its + destructor. + + * cvt.c (cp_convert_to_pointer): Handle NULL pointer + conversions, even in complex virtual base class hierarchies. + +1998-08-06 Mark Mitchell + + * cp-tree.h (ENUM_TEMPLATE_INFO): New macro. + (TYPE_TEMPLATE_INFO): Likewise. + (SET_TYPE_TEMPLATE_INFO): Likewise. + (ENUM_TI_TEMPLATE): Likewise. + (ENUM_TI_ARGS): Likewise. + (lookup_nested_type_by_name): Remove. + * decl.c (maybe_process_template_type_declaration): Handle enums. + (start_enum): Don't check for primary-template enum declarations + here. + (finish_enum): Clean up, document. Make sure template enum + constants get the correct type. + (build_enumerator): Copy initializers for template enumerations, + too. + (grok_enum_decls): Document. + * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit + better. Build LOOKUP_EXPRs for local variables, even if they are + TREE_PERMANENT. + * pt.c (tsubst_enum): Remove field_chain parameter. + (template_class_depth): Include the depth of surrounding function + contexts. + (push_template_decl): Check for primary-template enum declarations + here. Deal with enumeration templates. + (lookup_template_class): Likewise. + (for_each_template_parm): Likewise. + (instantiate_class_template): Don't call tsubst_enum directly, + call tsubst instead, to instantiate enums. Deal with all + field_chain issues here, not in tsubst_enum. + (lookup_nested_type_by_name): Remove. + (tsubst_aggr_type): Revise handling of enumeration types. + (tsubst): Likewise. + (tsubst_copy): Likewise. + (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs. + +1998-08-04 Mark Mitchell + + * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it + uses template parameters. + * method.c (build_template_parm_names): Use the full set of + template arguments for tsubst'ing. + (build_overload_identifier): Pass the full set of template + arguments to build_template_parm_names, not just the + innermost_args. + * pt.c (TMPL_ARGS_DEPTH): Define using + TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity. + (NUM_TMPL_ARGS): New macro. + (add_outermost_template_args): Deal with the case where the outer + args will be completely discarded. + (coerce_template_parms): Use the full set of template arguments + for tsubst'ing. Simplify. Add some asserts. Improve + error messages. + (lookup_template_class): Pass the full set of template arguments + to coerce_template_parms. + (tsubst): Add assertion. + (do_type_instantiation): Don't instantiate member template + classes. + + * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose + name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE. + +1998-08-03 Jason Merrill + + * method.c (set_mangled_name_for_decl): Change return type to void. + + * decl.c (lookup_name_real): A namespace-level decl takes priority + over implicit typename. Avoid doing the same lookup twice. + + * search.c (dependent_base_p): New fn. + (dfs_pushdecls, dfs_compress_decls): Use it. + + * typeck.c (get_member_function_from_ptrfunc): Don't try to handle + virtual functions if the type doesn't have any. + +1998-08-03 Mark Mitchell + + * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it + uses template parameters. + +1998-08-02 Mark Mitchell + + * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument. + * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation. + * lex.c (do_identifier): Don't use a second argument, or a type, + when building LOOKUP_EXPRs. + (do_identifier): Likewise. + (do_scoped_id): Likewise. + * method.c (hack_identifier): Improve error message. + * pt.c (lookup_template_function): Don't needlessly call + copy_to_permanent or build_min. + (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if + necessary. + (do_decl_instantiation): Improve error message. + * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy. + (build_min): Copy the type to the permanent obstack, too. + +1998-08-01 Jason Merrill + + * init.c (init_init_processing): Remove BI* handling. + (build_builtin_call): Remove. + (build_builtin_delete_call): New fn. + (build_delete): Use it. + +1998-07-31 Mark Mitchell + + * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro. + (maybe_check_template_type): New function. + * decl.c (maybe_process_template_type_declaration): New function, + split out from pushtag Call maybe_check_template_type. + (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P. + (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P. + * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P. + * pt.c (template_class_depth_real): Generalization of ... + (template_class_depth): Use it. + (register_specialization): Use duplicate_decls for duplicate + declarations of specializations. + (maybe_check_template_type): New function. + (push_template_decl_real): Fix comment. + (convert_nontype_argument): Likewise. + (lookup_template_class): Likewise. Avoid an infinite loop on + erroneous code. + (tsubst_friend_function): Fix comment. + (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is + an IDENTIFIER_NODE. + * semantics.c (begin_function_definition): Use + reset_specialization to note that template headers don't apply + directly to declarations after the opening curly for a function. + +1998-07-29 Jason Merrill + + * decl.c (push_overloaded_decl): Use current_namespace instead of + DECL_CONTEXT (decl) to determine where we go. + + * decl.c (lookup_name_real): Fix typo. + +1998-07-28 Mark Mitchell + + * friend.c (is_friend): Be lenient with member functions to deal + with nested friends. + +1998-07-28 Jason Merrill + + * class.c (finish_struct_1): Convert integer_zero_node to + ssizetype before passing it to set_rtti_entry. + * typeck2.c (initializer_constant_valid_p): Allow conversion of 0 + of any size to a pointer. + +1998-07-27 Mark Mitchell + + * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. + (build_template_decl_overload): Remove. + (set_mangled_name_for_decl): New function. + (innermost_args): Remove is_spec parameter. + (most_specialized, most_specialized_class): Remove declarations. + (lookup_template_class): Add entering_scope parameter. + (maybe_process_partial_specialization): New function. + (finish_template_decl): Likewise. + (finish_template_type): Likewise. + * class.c (finish_struct): Clean up processing of member template + specializations. + * decl.c (pushtag): Fix formatting. + (lookup_tag): Improve handling of pseudo-global levels. + (make_typename_type): Adjust call to lookup_template_class. + (shadow_tag): Use maybe_process_partial_specialization. + (xref_tag): Improve handling of member friends. + (start_function): Call push_nested_class before + push_template_decl. Don't call push_template_decl for + specializations. + * decl2.c (grok_x_components): Don't call xref_tag for + template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. + (grokclassfn): Use set_mangled_name_for_decl. + (arg_assoc_class): Adjust call to innermost_args. + (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. + * error.c (dump_function_name): Improve printing of template + function names. + * friend.c (is_friend): Don't compare types of decls to determine + friendship, unless flag_guiding_decls. + (make_friend_class): Partial specializations cannot be friends. + (do_friend): Use set_mangled_name_for_decl. Call + push_template_decl_real instead of push_template_decl. + * method.c (build_decl_overload_real): Remove prototype. Give it + external linkage. + (build_overload_identifier): Adjust call to innermost_args. + (build_template_decl_overload): Remove. + (set_mangled_name_for_decl): New function. + * parse.y (.finish_template_type): New non-terminal. + (template_def): Use finish_template_decl. Use template_extdef + instead of extdef. + (template_extdef, template_datadef): New non-terminals, containing + only those rules for things which can be templates. + (datadef): Tidy. + (template_type, self_template_type): Use .finish_template_type. + (named_class_head): Use maybe_process_partial_specialization. + * pt.c (mangle_class_name_for_template): Remove context parameter. + (get_class_bindings): Remove outer_args parameter. + (complete_template_args): Remove. + (add_outermost_template_args): New function. + (register_specialization): Return the specialization. + (unregister_specialization): New function. + (tsubst_template_parms): Likewise. + (most_specialized, most_specialized_class): Prototype here as + static. + (original_template): Rename to most_general_template. + (tsubst_template_parms): New function. + (set_mangled_name_for_template_decl): Likewise. + (TMPL_ARGS_DEPTH): New macro. + (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. + (TMPL_ARGS_LEVEL): New macro. + (SET_TMPL_ARGS_LEVEL): Likewise. + (TMPL_ARG): Likewise. + (SET_TMPL_ARG): Likewise. + (TMPL_ARGS_DEPTH): Likewise. + (finish_member_template_decl): Use finish_template_decl. + (maybe_process_partial_specialization): New function, split out + from tsubst. + (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. + (maybe_begin_member_template_processing): Use new macros. + (is_member_template): Likewise. + (is_member_template_class): Likewise. + (add_to_template_args): Likewise. Deal with multiple levels of + args. + (maybe_process_partial_specialization): New function. + (retrieve_specialization): Add consistency check. + (determine_specialization): Return full argument list. + (check_explicit_specialization): Tweak friend handling. Use full + argument lists. Simplify. + (current_template_args): Use new macros. + (push_template_decl_real): Change ill-named mainargs to specargs. + Check that a partial specialization actually specializes at least + one parameter. Improve friend handling. Modify for full + template arguments. + (classtype_mangled_name): Don't mangle the names of + specializations. + (lookup_template_class): Add entering_scope parameter. Use it to + avoid finding a template type when an instantiation is required. + Simplify. Use full template arguments. + (tsubst_friend_function): Use unregister_specialization. Use new + macros. Use full template arguments. + (tsubst_friend_class): Substitute, using tsubst_template_parms, + into the template parameters before passing them to + redeclare_class_template. + (instantiate_class_template): Simplify. Use full template + arguments. Adjust calls to get_class_bindings. Use + SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. + (innermost_args): Use new macros. + (tsubst_aggr_type): New function, split out from tsubst. + (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling + conventions for lookup_template_class. Refine handling of partial + instantiations. Remove calls to complete_template_args. + Simplify. Add consistency checks. Use set_mangled_name_for_decl + and set_mangled_name_for_template_decl. + (tsubst_copy): Use tsubst_aggr_type. + (instantiate_template): Use full template arguments. + (more_specialized): Improve formatting. + (more_specialized_class): Adjust calls to get_class_bindings. + (get_bindings_real): Don't call complete_template_args. + (most_specialized): Don't overwrite input; create a new list. + (most_specialized_class): Use most_general_template. + (regenerate_decl_from_template): Use unregister_specialization. + Use full template arguments. + (instantiate_decl): Use full template arguments. + (set_mangled_name_for_template_decl): New function. + * semantics.c (begin_class_definition): Use + maybe_process_partial_specialization. + (finish_member_class_template): New function. + (finish_template_decl): Likewise. + (finish_template_type): Likewise. + (typeck.c): Don't crash after issuing a compiler_error. + * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. + +1998-07-27 Jason Merrill + + * typeck2.c (build_functional_cast): Handle default-initialization. + + * call.c (build_over_call): Pass 1 to popclass. + + * parse.y (direct_notype_declarator): Add precedence declaration + to notype_unqualified_id case. + * Makefile.in (EXPECT): Adjust. + + * tree.c (ovl_member): Fix for single function in OVL. + +1998-07-27 Dave Brolley + + * c-lex.c (yylex): Fix boundary conditions in character literal and + string literal loops. + +1998-07-24 Jason Merrill + + * decl.c (lookup_name_real): OK, do return the from_obj value + unless got_object depends on template parms. + + * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT. + + * pt.c (coerce_template_parms): Also complain about local enums. + + * cp-tree.h: Add prototype for set_identifier_local_value. + * decl.c (set_identifier_local_value_with_scope): Make static, + prototype. + * search.c (covariant_return_p): Likewise. + * except.c (build_terminate_handler, alloc_eh_object): Likewise. + + * call.c (build_method_call): Only pull out the type of a destructor + if it's a template type parm. + * decl.c (lookup_name_real): Never return the from_obj value. + +1998-07-23 Jason Merrill + + * except.c (process_start_catch_block_old): Call start_decl_1 for + catch parm. + * decl.c (start_decl_1): Avoid duplicate error. + + * init.c (expand_default_init): Only perform the initialization if + it will do something. + +1998-07-23 H.J. Lu (hjl@gnu.org) + + * parse.y (base_class): Check for invalid base class. + +1998-07-23 Jason Merrill + + * decl2.c (import_export_template): Fold in... + (import_export_class): ...to here. Handle dllimport/export. + + * class.c (build_vtable): Pass at_eof to import_export_vtable. + (prepare_fresh_vtable): Likewise. + * decl2.c (import_export_class): Split out... + (finish_prevtable_vardecl): From here. + * class.c (finish_struct_1): Call import_export_class if at_eof. + + * decl.c (start_function): #if 0 mysterious code I wrote and have + forgotten why. + * rtti.c (get_tinfo_fn): If this is for a class type, set + DECL_CONTEXT. + +1998-07-22 Jason Merrill + + * inc/exception: Change terminate and unexpected to (). + + * parse.y (named_class_head_sans_basetype_defn): A + named_class_head_sans_basetype followed by '{' or ':' is a defn. + +1998-07-21 Jason Merrill + + * tree.c (canonical_type_variant): New fn to handle arrays. + * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove. + * pt.c (unify, default case): Also fold arg. Fix array bounds case. + * method.c (process_overload_item): Use build_overload_value for + arrays. + +1998-07-20 Dave Brolley + + * lex.c (mbchar.h): #include it. + (GET_ENVIRONMENT): New macro. + (init_parse): Set character set based on LANG environment variable. + (real_yylex): Handle multibyte characters in character literals. + (real_yylex): Handle multibyte characters in string literals. + +1998-07-19 Jason Merrill + + * lex.c (do_identifier): Look for class value even if we don't + have a global value. Do implicit declaration if parsing is 2. + * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig + lookup. + +1998-07-19 Mark Mitchell + + * decl.c (pushtag): Revert previous change. + * pt.c (lookup_template_class): Don't put out debugging + information for types that use template parameters. + + * decl.c (pushtag): Don't put out debugging information for + compiler-generated typedefs. + + * error.c (dump_type_real): Don't crash when presented with + intQI_type_node or the like. + + * semantics.c (finish_translation_unit): Fix spelling error in + comment. + +1998-07-17 Jason Merrill + + * decl.c (lookup_name_real): Pull out single function here. + (select_decl): Not here. + (unqualified_namespace_lookup): Use CP_DECL_CONTEXT. + + * decl.c (qualify_lookup): Tweak again. + + * pt.c (lookup_template_class): Don't mess with the context of the + instantiation. + * decl2.c (current_decl_namespace): Remove special handling for + templates. + + * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for + a member template specialization. + + * tree.c (ovl_member): Use decls_match to compare functions. + * decl.c (decls_match): Check the context of a function. + + * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER + in Koenig lookup support rules. + * semantics.c (finish_call_expr): Handle the new cases. + + * typeck.c (build_x_function_call): Handle overloaded methods. + + * decl.c (grokvardecl): Don't call build_static_name for extern "C". + +1998-07-16 Mark Mitchell + + * semantics.c (finish_object_call_expr): Revert previous change. + * call.c (build_new_method_call): Likewise. Instead, convert + TYPE_DECLs to IDENTIFIERs here, in the presence of templates. + +1998-07-16 Jason Merrill + + * decl.c (qualify_lookup): Handle templates. + + * decl2.c (do_using_directive): Don't pass ancestor. + * decl.c (push_using_directive): Calculate ancestor. + + * decl2.c (do_nonmember_using_decl): Allow for type shadowing. + * decl.c (pushdecl): Move type shadowing handling from here... + (duplicate_decls): ...to here. + * decl.c (set_identifier_local_value_with_scope): New fn. + (pushdecl): Use it. + (set_identifier_local_value, lookup_type_current_level): New fns. + * decl2.c (do_local_using_decl): Handle types and binding level + stuff properly. + + * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD. + * decl.c (select_decl): Extract a lone function from an OVERLOAD. + (lookup_namespace_name): Likewise. + * typeck.c (build_unary_op): Not here anymore. + + * decl2.c (do_class_using_decl): Make sure we get an identifier. + * class.c (handle_using_decl): Ignore TYPE_DECLs. + + * decl.c (qualify_lookup): New fn. + (lookup_name_real): Use it. + +1998-07-16 Martin v. Loewis + + * decl2.c (add_using_namespace): When directly using a namespace + that was indirect before, promote it. + + * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES, + LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY, + LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros. + * decl.c (select_decl): Replace two flag parameters by one. + (unqualified_namespace_lookup): Likewise, pass flag. + (lookup_flags): New function. + (lookup_name_real): Compute flags, pass them. + (lookup_namespace_name): Call with zero-flag. + * decl2.c (ambiguous_decl): Add flag parameter, complain only + according to flags. + (lookup_using_namespace, qualified_lookup_using_namespace): + Add flag parameter, pass them through. + * lex.c (do_scoped_id): Call with zero-flag. + +1998-07-16 Jason Merrill + + * typeck.c (convert_for_assignment): Use comptypes. + +1998-07-16 Mark Mitchell + + * semantics.c (finish_object_call_expr): Move test for the + function called being a TYPE_DECL to ... + * call.c (build_new_method_call): Here. + +1998-07-15 Jason Merrill + + * decl2.c (arg_assoc_class): Also look at template arguments, if any. + (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST. + + * lex.c (looking_for_typename): Don't initialize. + + * decl2.c (ambiguous_decl): Clarify error message. + + * decl.c (push_using_directive): Iterate over namespaces used + indirectly. + +1998-07-15 Martin v. Löwis + + * decl2.c (add_using_namespace): Iterate over namespaces used + indirectly. + + * decl.c (lookup_name_real): Accept namespace aliases as locals. + (cat_namespace_levels): Ignore aliases. + (duplicate_decls): Ignore duplicate aliases. + * decl2.c (do_namespace_alias): Process block level namespace + aliases. Store alias with pushdecl. Remove odr errors. + * parse.y (namespace_alias): New non-terminal. + (extdef): Use it. + +1998-07-15 Jason Merrill + + * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE. + Handle TEMPLATE_TYPE_PARM. + (arg_assoc): Rewrite. + + * pt.c (complete_template_args): Don't look at the context unless + we have to. + + * method.c (build_decl_overload_real): Fix namespace handling. + + * typeck.c (build_unary_op): Extract a lone function from an + OVERLOAD. + + * call.c (build_scoped_method_call): Handle getting a namespace + for basetype in a destructor call. + (check_dtor_name): Handle enums. + + * parse.y (using_directive): New nonterminal. + (extdef, simple_stmt): Use it. + +1998-07-14 Martin von Löwis + + * decl2.c (add_function): Move error message ... + (arg_assoc_namespace): ... from here. + +1998-07-14 Jason Merrill + + * parse.y (namespace_qualifier): Fix multiple level handling. + * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT. + (arg_assoc): Don't skip the first argument of a function. + +Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com) + + * search.c (my_tree_cons): Clean up. + +1998-07-14 Jason Merrill + + * call.c (joust): Don't warn about "confusing" conversions to the + same type. + +1998-07-14 Martin von Löwis + + * class.c (push_nested_class): Complain about namespaces. + * decl.c (start_decl): Enter the object's namespace. + (cp_finish_decl): Leave it. + (grokdeclarator): Likewise. + * decl2.c (check_decl_namespace): New function. + (finish_file): Call it. + * parse.y (complex_direct_notype_declarator): Set complexity + of namespace-qualified ids to -1, enter the namespace. + + * method.c (build_template_decl_overload): Expect _DECL as first + parameter. Put context temporarily into current_namespace. + * pt.c (check_explicit_specialization): Change caller. + (tsubst): Likewise. + + * init.c (build_offset_ref): Call mark_used and + convert_from_reference for namespace members. + +Mon Jul 13 23:25:28 1998 Martin von Löwis + + * search.c (my_tree_cons): The bitfield is at index 2. + +Mon Jul 13 17:21:01 1998 Nick Clifton + + * lang-options.h: Format changed to work with new --help support + in gcc/toplev.c + +1998-07-12 Martin von Löwis + + * decl2.c (build_expr_from_tree): Change calls of do_identifier. + Do Koenig lookup in CALL_EXPR. + (arg_assoc): Handle error_mark. + * lex.c (is_global): New function. + (do_identifier): Expect arguments for Koenig lookup. + * parse.y (primary): Add rules for calls of unqualified function calls. + (do_id): Change call of do_identifier. + * pt.c (finish_stmt_expr): Likewise. + * semantics.c (finish_id_expr): Likewise. + (finish_call_expr): Add integer parameter to indicate + argument-dependent lookup. + + * decl.c (struct binding_level): New field using_directives. + (push_using_decl): Not sorry anymore. + (push_using_directive): New function. + (lookup_tag): Use CP_DECL_CONTEXT to iterate. + (unqualified_namespace_lookup): New function, code from ... + (lookup_name_real): ... here. + * decl2.c (lookup_using_namespace): Pass using list instead of + initial scope. + (validate_nonmember_using_decl): New function. + (do_nonmember_using_decl): New function. + (do_toplevel_using_decl): Use them. + (do_local_using_decl): New function. + (do_using_directive): Support block-level directives. + * parse.y (simple_stmt): Support using declarations and + directives. + (namespace_qualifier, namespace_using_decl): New non-terminals. + + * xref.c (classname): New function. + (GNU_xref_hier): Change class and base parameters to tree. + * decl.c (xref_baseypes): Change caller. + * friend.c (make_friend_class): Likewise. + +1998-07-12 Kriang Lerdsuwanakij + + * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter + comparison. + + * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a + template template parameter, record its use. + (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse + its template arguments if exists. + + * pt.c (coerce_template_template_parms): New function equivalent + to coerce_template_parms when IS_TMPL_PARM is true. + (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter, + all callers changed. + + (coerce_template_parms): Access ARGLIST properly when creating a + new vector. Only accept implicit TYPE_DECL as valid argument for + a template template parameter when it is a base class of + current_class_type. Don't display error message when COMPLAIN is + false. + +1998-07-12 Klaus Kaempf (kkaempf@progis.de) + + * repo.c (get_base_filename): Use file_name_nondirectory. + (open_repo_file): Likewise. + * cp-tree.h (file_name_nondirectory): Add prototype. + +1998-07-12 Jason Merrill + + * friend.c (do_friend): Pull the identifier out of declarator. + Use cp_error and friends. + * decl2.c (qualified_lookup_using_namespace): Fix call to + purpose_member. + * decl.c (lookup_name_real): Don't call complete_type on a namespace. + (grokvardecl): Use DECL_CLASS_SCOPE_P. + * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner. + * class.c (warn_hidden): Fix for OVERLOAD. + From grahams@rcp.co.uk: + * cp-tree.h (DEFARG_NODE_CHECK): New macro. + (DEFARG_LENGTH, DEFARG_POINTER): Use it. + +Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com) + + * g++.1 (-traditional): Remove duplicated documentation. + +1998-07-11 Mark Mitchell + + * method.c (flush_repeats): Add nrepeats parameter. + (issue_nrepeats): Likewise. + (is_back_referenceable_type): New function. Don't back-reference + TEMPLATE_TYPE_PARMs as well as simple types like integers. + (build_mangled_name_for_type): Likewise. + (build_mangled_name_for_type_with_Gcode): Likewise. + (lasttype): Remove. + (nrepeats): Likewise. + (Nrepeats): Likewise. + (start_squangling): Don't clear the variables removed above. + (end_squangling): Likewise. + (flush_repeats): Tidy. Use nrepeats parameter rather than + Nrepeats global. + (issue_nrepeats): Likewise, but with nrepeats global. Use + is_backreferenceable_type. + (build_overload_nested_name): Tidy. Add comment. Use + build_mangled_name_for_type. + (build_underscore_int): Comment. + (build_overload_scope_ref): Use build_mangled_name_for_type. + (build_overload_int): Likewise. + (build_template_template_parm_names): Tidy. + (build_template_parm_names): Use build_mangled_name_for_type. + (build_overload_identifier): Add comments. + (build_mangled_name_for_type_with_Gcode): Split out from + build_mangled_name. + (build_mangled_name_for_type): Use it. + (build_mangled_name): Rework to use build_mangled_name_for_type + and to not use global nrepeats/Nrepeats. Tidy. + (process_modifiers): Tidy. + (check_btype): Use is_backreferenceable_type. Add comment. + Rename `node' to `type'. + (process_overload_item): Set numeric_output_need_bar here. + Use build_mangled_name_for_type. Tidy. + (build_decl_overload_real): Tidy. Don't use Nrepeats. Use + build_mangled_name_for_type. + + * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO + for TYPE_DECLs. + +1998-07-08 Vladimir N. Makarov + + * cp-tree.h (warn_long_long): Define. + * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for + warning "ANSI C++ does not support `long long'". + * decl2.c (warn_long_long): Define. + (lang_decode_option): Parse -Wlong-long, -Wno-long-long options. + +1998-07-07 Jason Merrill + + * decl.c (xref_tag): Handle attributes between 'class' and name. + * parse.y (aggr): Likewise. + * semantics.c (finish_class_definition): Likewise. + * Makefile.in (EXPECTED): Adjust. + + * cp-tree.h: Declare flag_optional_diags and warn_multichar. + * decl2.c: Define them. + (lang_decode_option): Handle them. + * lang-options.h: Add -foptional-diags. + * class.c (finish_struct): Don't complain about multiple meanings of + name if -fno-optional-diags. + * decl.c (pushdecl_class_level): Likewise. + * lex.c (real_yylex): Check warn_multichar. + +1998-07-06 Jason Merrill + + * decl.c (lookup_tag): Use CP_DECL_CONTEXT. + + * tree.c (make_binfo): Fix length. + +1998-06-30 Benjamin Kosnik + + * decl2.c (lang_decode_option): Remove warn_template_debugging. + * lang-options.h: Likewise. + +Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi + + * except.c (build_eh_type_type_ref): Remove unused variable `susp'. + (process_start_catch_block): Likewise for variables + `false_label_rtx', `call_rtx' and `return_value_rtx'. + +1998-06-29 Brendan Kehoe + + * tree.c (build_srcloc): Make sure we allocate this node on the + permanent obstack. + +Sat Jun 27 23:34:18 1998 Fred Fish + + * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined. + (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY. + (lang_specific_driver): Only add -lm automatically if need_math is + nonzero. + +Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com) + + * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o + +Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi + + * Makefile.in (EXPR_H): New dependency variable. + (decl2.o): Depend on $(EXPR_H). + (typeck.o): Likewise. + (init.o): Likewise. + (expr.o): Likewise. + +1998-06-25 Benjamin Kosnik + + * decl.c (start_enum): Put local enums on permanent_obstack. + +1998-06-25 Mark Mitchell + + * cp-tree.h (c_get_alias_set): Declare. + * decl.c (init_decl_processing): Set lang_get_alias_set. + +1998-06-25 Andrew MacLeod + + * cp-tree.h (mark_all_runtime_matches): Add function prototype. + * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED + flag for all function decls which are in the exception table. + * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match. + * decl2.c (finish_file): Call mark_all_runtime_matches to make sure + code is emitted for any referenced rtti function. + +1998-06-25 Dave Brolley + + * lang-specs.h: Use new | syntax to eliminate + string concatenation. + +1998-06-25 Jason Merrill + + * cp-tree.h (CP_DECL_CONTEXT): New macro. + * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it. + * method.c (build_overload_nested_name): Likewise. + * sig.c (build_signature_pointer_or_reference_type): Don't set + DECL_CONTEXT. + +1998-06-24 Martin v. Löwis + + Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace. + * cp-tree.h (FROB_CONTEXT): New macro. + (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE. + * decl.c (namespace_binding): Replace NULL_TREE with + global_namespace. + (set_namespace_binding, pop_namespace, lookup_name_real): Likewise. + * decl2.c (is_namespace_ancestor, lookup_using_namespace): + Likewise. + * decl.c (pushtag): Use FROB_CONTEXT. + (pushdecl, make_typename_type, define_function, grokdeclarator): + Likewise. + * decl2.c (set_decl_namespace, do_namespace_alias): Likewise. + * pt.c (push_template_decl_real, lookup_template_class, tsubst): + Likewise. + * decl2.c (decl_namespace): Return global_namespace if no context. + * method.c (build_overload_nested_name): Expect null as context. + * pt.c (mangle_class_name_for_template): Do nothing for null + contexts. + (lookup_template_class): Allow for null id_context. + +1998-06-25 Richard Henderson + + * method.c (emit_thunk): Set current_function_is_thunk for the + ASM_OUTPUT_MI_THUNK case as well. + +1998-06-23 Andrew MacLeod + + * exception.cc (__cplus_type_matcher): Get a match_info pointer + instead of an exception table entry as a parameter. + +1998-06-23 Andrew MacLeod + + * parse.y (function_try_block): Don't call start_catch_handler. + * except.c (call_eh_info): Remove coerced field from declaration. + (build_eh_type_type_ref): New function to create an address of a + rtti function for the new style exception tables. + (expand_start_catch_block): Split function, this contains the + common part. + (process_start_catch_block_old): New function to perform the rest + of expand_start_catch_block under old style exceptions. + (process_start_catch_block_old): New function to perform the rest + of expand_start_catch_block under new style exceptions. + (expand_end_catch_block): Only pop the false label off the stack under + the old style of exceptions. + * semantics.c (finish_try_block): Don't call start_catch_handler. + * exception.cc (struct cp_eh_info): Add original_value field. + (__cplus_type_matcher): Perform type matching on the original exception + value, and if we have a match, set the current value. + (__cp_push_exception): Set the original exception value. + +1998-06-23 Jason Merrill + + * call.c (joust): Fix confusing conversion warning. + + * call.c (build_op_delete_call): Add placement parm. Check + LOOKUP_SPECULATIVELY. + * cp-tree.h, decl2.c, init.c: Adjust. + * decl.c (finish_function): Use it. + + * pt.c (tsubst): Diagnose creating void fields or variables. + +Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi + + * call.c (build_scoped_method_call): Remove unused variable `tmp'. + + * cp-tree.h (check_dtor_name): Add prototype. + + * init.c (expand_member_init): Remove unused variables + `ptr_type_node', `parm' and `rval'. + + * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier + in call to fprintf. + (lang_print_xnode): Likewise. + + * typeck2.c (enum_name_string): Cast argument to sprintf to long + and use %ld specifier. + + * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC + specifier in call to fprintf. + (GNU_xref_member): Cast argument to sprintf to int. + +Fri Jun 19 23:22:42 1998 Bruno Haible + + * typeck2.c (pop_init_level): Warn about implicit zero initialization + of struct members. + +Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi + + * cp-tree.h: Prototype function `check_java_method'. + +1998-06-17 Jason Merrill + + * class.c (finish_struct): Make conflicting use of id a pedwarn. + * decl.c (pushdecl_class_level): Likewise. + +1998-06-17 Mark Mitchell + + * pt.c (convert_nontype_argument): Issue an error when presented + with an integer (real) constant that cannot be simplified to an + INT_CST (REAL_CST). + + * cp-tree.h (c_get_alias_set): Remove declaration added in + 1998-06-13 change that should never have been checked in. + +1998-06-17 Jason Merrill + + * typeck.c (build_binary_op_nodefault): Change % in format strings + to %%. + + * decl.c (grokvardecl): Don't build_static_name for decls that + aren't at namespace scope. + + * init.c (perform_member_init): Catch default-initialization of + references. + +1998-06-17 Mark Mitchell + + * errfn.c (cp_thing): Handle the `%%' formatting sequence. + +1998-06-17 Jason Merrill + + * method.c (hack_identifier): Complain about getting a namespace + or class template. + * typeck.c (decay_conversion): Remove check for namespaces. + * typeck2.c (incomplete_type_error): Likewise. + * parse.y (template_arg): Add PTYPENAME expansion. + +1998-06-16 Andrew MacLeod + + * decl.c (grokvardecl): Don't build external assembler names for + TYPENAMEs in other namespaces as there is no declarator. + * error.c (cp_file_of, cp_line_of): Don't extract file or line number + info from DECL_CONTEXT if it is NULL. + +1998-06-16 Jason Merrill + + * call.c (check_dtor_name): Split out. + (build_scoped_method_call): Use it. + (build_method_call): Use it. + * init.c (build_offset_ref): Use it. + + * typeck.c (build_static_cast): Fix handling of pointers to members. + + * decl.c (finish_function): Just return nothing from a constructor. + * typeck.c (c_expand_return): Complain about returning a void + expression from a destructor. + +1998-06-13 Mark Mitchell + + * class.c (alter_access): Accept a BINFO explaining how to get + from the entity whose accessed is being altered to the type doing + the altering. + (handle_using_decl): New function containing code split out from ... + (finish_struct_1): Here. + + * cp-tree.h (complete_type_or_else): Declare. + * init.c (build_new_1, build_delete): Use it. + * typeck.c (require_complete_type): Use complete_type, rather than + expanding it inline. + (complete_type_or_else): New function. + (build_component_ref): Use it. + (pointer_int_sum): Make sure the type pointed to is complete. + (pointer_diff): Likewise. + + * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for + types. + + * search.c (get_matching_virtual): Note that member templates + cannot override virtual functions. + +1998-06-12 Brendan Kehoe + + * pt.c (check_explicit_specialization): If DECLARATOR turned into + an error_mark_node from lookup_template_function, return the same. + (determine_specialization): Also make sure TEMPLATE_ID isn't an + error_mark_node, before we try to read its operands. + * decl.c (grokdeclarator): If we got an error_mark_node from + check_explicit_specialization, just return it right back. + +1998-06-12 Mark Mitchell + + * class.c (instantiate_type): Don't treat template-ids that don't + specify any template arguments as equivalent to ordinary + identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to + pointer-to-members for member templates. Tidy slightly. + * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation. + * init.c (build_offset_ref): Handle template-ids like ordinary + identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the + offset part of the OFFSET_REF. + * typeck.c (build_unary_op): Change check for unknown types to + look for OFFSET_REFs, not SCOPE_REFs. + +1998-06-11 Mark Mitchell + + * pt.c (is_member_template_class): New function. + (push_template_decl_real): Use it. + +1998-06-11 Benjamin Kosnik + + * friend.c (do_friend): Add support for nested classes using + member functions of the enclosing class as friends. + +1998-06-10 Mark Mitchell + + * call.c (convert_default_arg): Make global, not static. + (convert_arg_for_ellipsis): Split out from ... + (build_over_call): Here. + * cp-tree.h (convert_default_arg); Declare. + (convert_arg_to_ellipsis): Likewise. + (do_member_init): Remove. + * init.c (do_member_init): Remove; this code is dead. + (expand_member_init): Remove much of this code; it is dead. + * typeck.c (convert_arguments): Use convert_default_arg and + convert_arg_for_ellipsis, rather than duplicating here. + + * call.c (convert_like): Don't fail silently if + build_user_type_conversion fails. Always return error_mark_node + for failure. + +1998-06-10 Jason Merrill + + * search.c (covariant_return_p): Complain about ambiguous base. + + * typeck.c (build_component_ref): Diagnose ref to nested type. + +1998-06-10 Brendan Kehoe + + * decl.c (grokparms): Check that INIT isn't an error_mark_node + before giving error about invalid type for default arg. + +1998-06-10 Jason Merrill + + * call.c (build_method_call): Fix thinko. + +1998-06-10 Dave Brolley + + * decl2.c (lang_decode_option): New argc/argv interface. + * cp-tree.h (lang_decode_option): New argc/argv interface. + * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is + specified for cpplib-enabled compilers. + * lex.c (lang_init): Don't check_newline for cpplib. + (init_parse): Don't initialize cpplib here. + +1998-06-10 Brendan Kehoe + + * typeck.c (build_component_ref): Make sure FIELD has a lang_specific + piece before checking DECL_MUTABLE_P. + +1998-06-10 John Carr + + * tree.c (debug_binfo): Make printf format match arguments. + + * error.c (OB_PUTI): Make printf format match arguments. + +1998-06-10 Jason Merrill + + * init.c (perform_member_init): Handle default-initialization. + + * except.c (build_throw): Handle throwing NULL. + + * typeck.c (build_x_function_call): Use resolve_offset_ref. + + * search.c (compute_access): Only strip an anonymous union + for a FIELD_DECL. + + * call.c (add_builtin_candidates): Tweak. + + * cvt.c (build_expr_type_conversion): Restore code for conversion + from class types. + * decl2.c (delete_sanity): Use it. Clean up. + + * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons. + +1998-06-10 Branko Cibej + + * typeck.c (c_expand_return): Don't warn about void expressions on + return statements in functions returning void. + +1998-06-09 Mark Mitchell + + * pt.c (fn_type_unification): Revise documentation. Tidy. + (type_unification): Likewise. + +1998-06-09 Andrew MacLeod + + * semantics.c (finish_try_block): Rename expand_start_catch, and delete + expand_end_catch. + * parse.y (function_try_block): Rename expand_start_catch, and delete + expand_end_catch. + * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete + expand_end_catch. + +1998-06-09 Jason Merrill + + * search.c (lookup_member): New fn. + * class.c (finish_struct_1): Use it. + * decl.c (lookup_name_real): Use it. + +Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi + + * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h. + + * cp-tree.h: Add prototype for `maybe_print_template_context' and + `maybe_make_one_only'. + + * decl.c (auto_function): Remove unused variable `decl'. + + * decl2.c: Include dwarf2out.h and dwarfout.h. + + * lex.c: Remove redundant declarations of `set_float_handler' and + `asm_out_file'. + +1998-06-08 Andrew MacLeod + + * except.c (init_exception_processing): Remove NEW_EH_MODEL compile + time flag. Call __cp_eh_info instead of __cp_exception_info. + * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag. + (__cp_exception_info): Return offset into cp_eh_info structure to + match what use to be the start of this structure. + (__cp_eh_info): New function to return a pointer to cp_eh_info struct. + (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL + compile time flag. + (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call + __cp_eh_info instead of __cp_exception_info. + +1998-06-08 Jason Merrill + + * decl.c (cp_finish_decl): Disable inlining of extern inlines + with static variables. + +1998-06-08 Mark Mitchell + + * init.c (build_offset_ref): Correct previous change to use build, + not build_min. + +1998-06-07 Mark Mitchell + + * class.c (instantiate_type): Handle pointer-to-members where the + member is a template. + * init.c (build_offset_ref): Likewise. + * typeck.c (build_unary_op): Likewise. + +1998-06-07 Richard Henderson + + * lex.c (lang_init_options): New function. + (lang_init): Remove flag_exceptions == 2 hack. + +1998-06-05 Jason Merrill + + * search.c (envelope_add_decl): Tweak for implicit typename. + + * call.c (joust): Also warn about confusing conversion op/constructor + overload resolution. + + * spew.c (yylex): Also return the TYPE_DECL if got_object. + Don't clear got_object after '~'. + * call.c (build_scoped_method_call): Tweak destructor handling. + (build_method_call): Likewise. + * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with + TYPE_MAIN_VARIANT for destructors. + * semantics.c (finish_object_call_expr): Complain about calling a + TYPE_DECL. + +1998-06-05 Per Bothner + + * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles): + Define - update needed by gcc.c change. + +1998-06-05 Jason Merrill + + * error.c (cp_printers): Use 'o' instead of '_' for the null entry. + +1998-06-05 Martin v. Loewis + + * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare. + * decl.c (lookup_name_real): Add namespaces_only parameter. + If set, return only NAMESPACE_DECLs. + (select_decl): Likewise. + (identifier_type_value): Give additional parameter. + (lookup_name_nonclass): Likewise. + (lookup_name): Likewise. + (find_binding): Skip namespace aliases. + (binding_for_name): Likewise. + (push_namespace): Check for namespace aliases. + (lookup_name_namespace_only): New function. + (begin_only_namespace_names, end_only_namespace_names): New functions. + * decl2.c (set_decl_namespace): Skip namespace aliases. + (do_using_directive): Likewise. + (do_namespace_alias): Produce namespace aliases, fix alias + redeclaration. + * error.c (dump_decl): Support SCOPE_REF. + * parse.y (extdef): Wrap lookup with namespace_only for namespace + aliases and using declarations. + +1998-06-04 Jason Merrill + + * tree.c (really_overloaded_fn): Only see through one TREE_LIST. + + * error.c (dump_expr): Clean up NEW_EXPR case. + +1998-06-04 Martin von Löwis + + Suggested by Brendan Kehoe + * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL, + treat it as using ::decl. + + * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE. + + * tree.c (mapcar): Support NEW_EXPR. + + * error.c (dump_expr): Support NEW_EXPR. + +1998-06-03 Jason Merrill + + * method.c (make_thunk): Use overload machinery to make name. + * search.c (covariant_return_p): New fn. + (get_matching_virtual): Use it. + + * init.c (build_new_1): Fix check for void. + +1998-06-01 Per Bothner + + * cp-tree.h (TYPE_FOR_JAVA): New macro. + * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node, + java_int_type_node, java_long_type_node, java_float_type_node, + java_double_type_node, java_char_type_node, java_boolean_type_node): + New "primitive" types, with predefined names __java_byte etc. + (record_builtin_java_type): New function. + (init_decl_processing): Make Java types with record_builtin_java_type. + (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA". + (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class. + (grokfndecl): Call check_java_method for Java classes. + * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA. + (process_overload_item): Match types against specific + java_XX_type_node types, rather than using is_java_type. + * class.c (finish_struct_1): Don't add default copy constructor + or operator= if TYPE_FOR_JAVA. + (pop_lang_conext): Restore strict_prototyp proper if Java. + * decl2.c (acceptable_java_type, check_java_method): New functions. + * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern. + (tsubst): Move common statement after if statement. + * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match. + +1998-06-01 Jason Merrill + + * pt.c (for_each_template_parm): Use first_rtl_op. + + * tree.c (build_cplus_array_type_1): Also check index_type for + template parms. + +1998-05-31 Jason Merrill + + * pt.c (tsubst): Always copy BINFO_BASETYPES. + +1998-05-29 scott snyder + + * tree.c (layout_basetypes): If we change TYPE_SIZE, change + TYPE_SIZE_UNIT too. + +1998-05-29 Mark Mitchell + + * decl.c (grokdeclarator): Don't complain about in-class + initialization of static consts if we don't really know the type + of the variable. + +1998-05-29 Jason Merrill + + * cp-tree.h (DECL_DESTRUCTOR_P): New macro. + * method.c (build_destructor_name): New fn. + * decl2.c (maybe_retrofit_in_chrg): Split out... + (grokclassfn): From here. Reorganize. + * decl.c (grok_ctor_properties): Make sure ctors for types with + vbases have the in_chrg parm. + * pt.c (instantiate_class_template): Update + TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call + grok_*_properties. + (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg. + +1998-05-28 Mark Mitchell + + * pt.c (instantiate_decl): Make test for whether or not static + variables should be instantiated early match its comment. + +1998-05-28 Jason Merrill + + * decl.c (start_decl): Always pedwarn about vacuously redeclaring + a member. + (start_function): Call check_default_args. + * decl2.c (grokfield): Don't call check_default_args. + (check_default_args): Use cp_error_at. + * lex.c (do_pending_defargs): Call check_default_args. + +1998-05-27 Brendan Kehoe + + * call.c (build_method_call): Make sure get_type_value returns + something before we try to use its TYPE_MAIN_VARIANT. + (build_scoped_method_call): Likewise. + +1998-05-27 Jason Merrill + + * typeck2.c (digest_init): Complain about getting a TREE_LIST to + initialize an array. + + * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and + DECL_VIRTUAL_P. + + * friend.c (do_friend): Clarify template warning. + +1998-05-27 Mark Mitchell + + * decl.c (shadow_label): Don't treat decls as identifiers. + (maybe_push_to_top_level): Clear shadowed_labels. + + * pt.c (instantiate_decl): Reset lineno and filename after calling + regenerate_decl_from_template. + + * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an + error_mark_node. + +1998-05-27 Kevin Buhr + + * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE. + +1998-05-26 Kriang Lerdsuwanakij + + * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes. + (convert_nontype_argument): Handle cases when nontype template + parameters become classes after substitution. + +1998-05-26 Mark Mitchell + + * friend.c (is_friend): Use comptypes, rather than == to compare + types. Modify for new representation of template friends. + (make_friend_class): Likewise. + * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak. + (instantiate_class_template): Deal with template friends. + + * decl.c (store_parm_decls): Remove redundant call to + expand_main_function. + +1998-05-26 Benjamin Kosnik + + * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before + DECL_USE_TEMPLATE. + +1998-05-26 Per Bothner + + * language_as_string: Handle lang_java. + +1998-05-26 Jason Merrill + + * decl.c (pushdecl): Don't copy the type_decl. + +1998-05-26 Martin v. Löwis + + * class.c (pushclass): Always store TYPE_MAIN_VARIANT in + current_class_type. + * decl.c (grokdeclarator): Put typedefs on the type's obstack. + + * parse.y (complex_direct_notype_declarator): Use $1 to access + scope of notype_qualified_id. + +1998-05-26 Dave Brolley + + * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib. + (init_parse): Initialize cpplib interface. + + * Makefile.in (CXX_OBJS): Make sure dependencies never end with an + empty continuation. + +1998-05-26 Mark Mitchell + + * decl.c (pushtag): Avoid crashing on erroneous input. + +1998-05-25 Martin v. Löwis + + * decl.c (push_namespace): Only produce one unique name for + anonymous namespaces. + (get_unique_name): Remove. + +1998-05-25 Mark Mitchell + + * call.c (tourney): Don't do any extra comparisons. + + * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions. + + * cp-tree.h (processing_template_parmlist): Declare. + * decl.c (pushtag): Don't call push_template_decl when we + shouldn't. + * pt.c (processing_template_parmlist): New variable. + (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro. + (complete_template_args): Use it. + (add_to_template_args): Likewise. + (innermost_args): Likewise. + (tsubst): Likewise. + (begin_template_parm_list): Use processing_template_parmlist. + (end_template_parm_list): Likewise. + + * cp-tree.h (ANON_UNION_TYPE_P): New macro. + * decl.c (grokdeclarator): Use it. + * decl2.c (grok_x_components): Likewise. + * init.c (initializing_context): Likewise. + * method.c (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + * search.c (compute_access): Likewise. + * typeck.c (build_component_ref): Likewise. + + * decl.c (grokdeclarator): Don't give a cv-qualified version of an + unnamed type a typedef name "for linkage purposes". + + * pt.c (lookup_template_class): Don't look at + IDENTIFIER_CLASS_VALUE when there's no current_class_type. + + * method.c (build_overload_int): Handle error cases gracefully. + + * pt.c (instantiate_decl): Handle static member variables + correctly. + + * pt.c (tsubst): Use the tsubst'd type when producing new + TEMPLATE_PARM_INDEX nodes. + +1998-05-24 Mark Mitchell + + * tree.c (cp_tree_equal): Handle pointers to member functions. + + * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make + sure the type of the REF_BIND is a reference type. + (maybe_handle_ref_bind, compare_ics): Rename reference_type to + target_type for clarity. + + * parse.y (xcond): Move call to condition_conversion ... + * semantics.c (finish_for_cond): Here. + * parse.c: Regenerated. + +1998-05-24 Jason Merrill + + * decl.c (push_namespace): Namespaces have type void. + * typeck2.c (incomplete_type_error): Complain about namespace + used as expression. + * typeck.c (decay_conversion): Likewise. + +1998-05-24 Martin von Löwis + + * error.c (dump_expr): Support namespaces. + +1998-05-23 Jason Merrill + + * cp-tree.def: Add SRCLOC. + * cp-tree.h: Add struct tree_srcloc and accessor macros. + * tree.c (build_srcloc, build_srcloc_here): New fns. + * pt.c (add_pending_template): Use build_srcloc_here. + (push_tinst_level): Update last_template_error_tick before erroring. + (instantiate_decl): Restore lineno and input_filename before + calling add_pending_template. + * decl2.c (finish_file): Set up lineno and input_filename for + pending templates. + +1998-05-22 Jason Merrill + + * decl.c (lang_print_error_function): New fn. + (init_decl_processing): Set print_error_function to use it. + * errfn.c (cp_thing): Don't call maybe_print_template_context here. + + * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and + ICS_BAD_FLAG. + + * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for + copy-initialization. + + * class.c (build_vtable_entry): Use int_fits_type_p. + (build_vtable): Pass a signed offset to build_vtable_entry. + (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1, + set_rtti_entry): Likewise. + +1998-05-22 Per Bothner + + * cp-tree.h: Add comments documenting which LANG_FLAGS are used. + (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used. + +1998-05-22 Jason Merrill + + * pt.c (print_template_context): Use fprintf instead of cp_error. + + * pt.c (determine_specialization): Just return an error_mark_node. + Also print the decl we want in error messages. If we complain, + return error_mark_node. + (tsubst_friend_function): Set lineno and input_filename so + error messages will be useful. + (instantiate_template): Just return an error_mark_node. + (check_explicit_specialization): Don't mess with a returned + error_mark_node. + + * pt.c (print_template_context): Add new argument. + (maybe_print_template_context): New fn. + (push_tinst_level): Increment tinst_level_tick. + (pop_tinst_level): Likewise. + * errfn.c (cp_thing): Call maybe_print_template_context. Use + xrealloc instead of xmalloc. + + * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT. + +1998-05-21 Jason Merrill + + * pt.c (tsubst_friend_class): Don't call redeclare_class_template + if the template we looked up is the same as the one we already + have. + +Thu May 21 11:54:44 1998 Dave Brolley + + * lex.c: (handle_sysv_pragma): FILE* parameter not used. + (cpp_reader,parse_in): Add for cpplib. + (check_newline): Call handle_sysv_pragma with new interface. + (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line. + + * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib. + (sub_getch): Call GETC for cpplib. + + * cp-tree.h: (get_directive_line): Different prototype for cpplib. + (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line. + + * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib. + +1998-05-21 Jason Merrill + + * decl2.c (maybe_make_one_only): New fn. + (import_export_vtable): Use it. + (import_export_decl): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + +1998-05-21 Mark Mitchell + + * decl2.c (find_representative_member): Rename to ... + (build_anon_union_vars): New function. + (finish_anon_union): Fix stupidity of previous change. + +1998-05-20 Jason Merrill + + * decl.c (grokfndecl): Handle definition of specialization in + friend declaration. + + * error.c (dump_decl): Fix LOOKUP_EXPR handling. + +1998-05-20 Mark Mitchell + + * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P + to look for type declarations. + (finish_struct): Deal with templates on the CLASSTYPE_TAGS list. + * cp-tree.h (DECL_DECLARES_TYPE_P): New macro. + (finish_member_class_template): Declare. + * decl.c (pushtag): Put member class templates on the + CLASSTYPE_TAGS list, just as for ordinary member classes. + (pushdecl_class_level): Use DECL_DECLARES_TYPE_P. + (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with + IDENTIFIER_NAMESPACE_VALUEs. + * parse.y (component_decl): Move code to ... + * semantics.c (finish_member_class_template): New function. + Don't put member class templates on the list of components for a + class. + * parse.c: Regenerated. + * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types. + In fact, don't use DECL_CONTEXT at all here. + +1998-05-20 Martin von Loewis + + * decl.c (record_unknown_type): New function. + (init_decl_processing): Call it for the unknown and global type + nodes. + +1998-05-20 Mark Mitchell + + * decl2.c (find_representative_member): New function. + (finish_anon_union): Use it. + + * cp-tree.h (MAIN_NAME_P): New macro. + (DECL_MAIN_P): Likwise. + * decl.c (pushdecl): Avoid crashing on redefinitions of `main'. + (grokfndecl): Use the new macros. + (grokdeclarator): Likewise. + (start_function): Likewise. + (store_parm_decls): Likewise. + (finsh_function): Likewise. + * friend.c (do_friend): Likewise. + * typeck.c (build_function_call_real): Likewise. + (build_unary_op): Likewise. + +Wed May 20 02:16:01 1998 Jason Merrill + + * decl2.c (start_objects, finish_objects, do_dtors, + do_ctors): Split out from... + (finish_file): ...here. + +Tue May 19 20:36:23 1998 Jason Merrill + + * tree.c (is_overloaded_fn): Don't abort on placeholders from + push_class_decls. + +Tue May 19 15:16:22 1998 Brendan Kehoe + + * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node. + + * error.c (dump_expr): Handle an ARROW_EXPR. + +Tue May 19 15:13:39 1998 Mark Mitchell + + * decl.c (saveable_obstack): Declare. + (pushdecl): Copy TYPE_DECLs to the same obstack as the type they + declare, if necessary. + +Tue May 19 14:50:27 1998 Mark Mitchell + + * call.c (compare_qual): Remove. + (is_subseq): Tweak. + (is_properly_derived_from): New function. + (maybe_handle_ref_bind): Likewise. + (maybe_handle_implicit_object): Likewise. + (compare_ics): Modify substantially to bring into conformance with + the standard. + * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro. + (comp_cv_qualification): Declare. + (comp_cv_qual_signature): Likewise. + * typeck.c (comp_cv_qualification): Likewise. + (comp_cv_qual_signature): Likewise. + +Tue May 19 10:05:02 1998 Kaveh R. Ghazi + + * Makefile.in (parse.o): Depend on toplev.h. + + * class.c (typecode_p): Remove prototype and definition. + + * cp-tree.h (currently_open_class, is_empty_class, member_p): + Add prototype. + + * decl.c (push_overloaded_decl_top_level): Remove prototype and + definition. + + * errfn.c (cp_error): Cast function pointer `error' to (errorfn *) + in call to `cp_thing'. + (cp_warning): Likewise for function pointer `warning'. + + * except.c (do_function_call): Remove prototype and definition. + (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL. + + * method.c (is_java_type): Add prototype and make it static. + + * parse.y: Include toplev.h. + + * pt.c (type_unification): Remove unused variable `arg'. + (instantiate_decl): Likewise for `save_ti'. + + * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'. + +Tue May 19 02:43:25 1998 Jason Merrill + + * init.c (build_member_call): Handle template_ids. + * parse.y (primary): Add global_scope template_id. + +Mon May 18 23:22:52 1998 Jason Merrill + + * decl2.c (get_sentry): Use end_temporary_allocation. + Don't declare permanent_obstack. + +Mon May 18 12:28:44 1998 Mark Mitchell + + * parse.y (.finish_new_placement): New non-terminal. + (unary_expr, new_type_id): Use it. + * parse.c: Regenerated. + +Mon May 18 12:20:27 1998 Brendan Kehoe + + * pt.c (redeclare_class_template): Say where the original definition + of the template-parameter's default argument appeared. + +Mon May 18 03:00:57 1998 Jason Merrill + + * call.c (build_over_call): Tweak empty class handling. + + * decl.c (make_typename_type): Use currently_open_class. + + * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG. + +Mon May 18 01:43:01 1998 Martin v. Loewis + + * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE + for a type unless it is one. + + * class.c (finish_struct_1): Use OVL_CURRENT in error message. + +Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (program_transform_name, objdir): Define. + + * Makefile.in (BISON): Use bison from the build tree if it exists. + (FLEX): Likewise. + +Sun May 17 14:52:08 1998 Martin v. Loewis + + * typeck.c (type_unknown_p): Return true for TREE_LIST also. + + * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs. + +Sun May 17 14:51:41 1998 Jason Merrill + + * call.c (build_scoped_method_call): Likewise. + +Sun May 17 13:53:48 1998 Mark Mitchell + + * init.c (build_new_1): Call suspend_momentary around the creation + of values that must be saved for exception handling. + * parse.y (.build_new_placement): New non-terminal. + (unary_expr, new_placement): Use it. + * parse.c: Regenerated. + +Sun May 17 12:32:08 1998 Jason Merrill + + * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare + old and new types. + + * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the + canonical type. + + * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace. + +Fri May 15 20:28:00 1998 Jason Merrill + + * decl.c (start_decl): Revert problem change. + + * Makefile.in (CONFLICTS): Fix. + +Fri May 15 15:34:02 1998 Benjamin Kosnik + + * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits. + +Fri May 15 00:46:05 1998 Jason Merrill + + * class.c (finish_struct_1): Use BINFO_SIZE. + + * decl.c (start_decl): Use 'tem'. + +Thu May 14 16:30:47 1998 Andrew MacLeod + + * exception.cc: Include eh-common.h. + (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL. + (__cplus_type_matcher): First stab at new C++ runtime type matcher. + (__cp_push_exception): Initialize eh_info struct as well. + * except.c: Remove local structs and include eh-common.h. + (init_exception_processing): Set language and version codes. + (call_eh_info): Add presence of eh_info to runtime description of + struct cp_eh_info. + (expand_end_eh_spec): Call start_catch_block() and end_catch_block(). + * semantics.c (finish_try_block): Call start_catch_block() and + end_catch_block(). + * parse.y (function_try_block): Call start_catch_block() and + end_catch_block(). + +Thu May 14 12:27:34 1998 Brendan Kehoe + + * typeck.c (original_type): New function. + (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2, + to see if they're actually the same. + * cp-tree.h (original_type): Declare. + +Wed May 13 12:54:30 1998 Kaveh R. Ghazi + + * Makefile.in (lex.o): Depend on output.h. + + * call.c (add_function_candidate): Remove unused variable `cand'. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + + * cp-tree.h: Add prototype for `types_overlap_p'. + + * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED. + + * decl2.c (merge_functions): Remove unused variables `tmp' and + `tempn'. + + * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED. + (code_as_string): Likewise. + (language_as_string): Likewise. + (parm_as_string): Likewise. + (op_as_string): Likewise. + (assop_as_string): Likewise. + (cv_as_string): Likewise. + + * lex.c: Include output.h. + + * pt.c (type_unification): Cast first argument of `bzero' to a char*. + + * search.c (dfs_no_overlap_yet): Mark parameter `t' with + ATTRIBUTE_UNUSED. + + * tinfo.cc (__class_type_info::dcast): Change the type of variable + `i' from int to size_t. + + * typeck.c (language_lvalue_valid): Mark parameter `exp' with + ATTRIBUTE_UNUSED. + +Tue May 12 21:37:49 1998 Jason Merrill + + * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or + DECL_NAMESPACE_SCOPE_P. + (lang_decl_name): Likewise. + * pt.c (tsubst_friend_function, tsubst): Likewise. + * decl.c (pushdecl, redeclaration_error_message, start_decl, + cp_finish_decl, start_function): Likewise. + * class.c (finish_struct_1): Likewise. + * call.c (build_over_call): Likewise. + (compare_ics): Use DERIVED_FROM_P. + +Tue May 12 07:24:18 1998 Mark Mitchell + + * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro. + * method.c (build_mangled_name): Use it. + (build_decl_overload_real): Likewise. + + * error.c (dump_simple_decl): New function, broken out from ... + (dump_decl): Use it. + +Mon May 11 11:38:07 1998 Mark Mitchell + + * ptree.c (lang_print_xnode): Add missing `break'. + + * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE. + + * call.c (add_template_candidate): Adjust for changes to + fn_type_unification. + (add_template_candidate_real): Likewise. + (add_template_conv_candidate): Likewise. + (build_user_type_conversion_1): Likewise. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + * class.c (instantiate_type): Likewise. + * cp-tree.h (unification_kind_t): New type. + (fn_type_unification): Adjust prototype. + (type_unificaiton): Likewise. + * pt.c (UNIFY_ALLOW_NONE): New macro. + (UNIFY_ALLOW_MORE_CV_QUAL): Likewise. + (UNIFY_ALLOW_LESS_CV_QUAL): Likewise. + (UNIFY_ALLOW_DERIVED): Likewise. + (unify): Change prototype. + (maybe_adjust_types_for_deduction): New function. + (check_cv_quals_for_unify): Likewise. + (determine_specialization): Adjust. + (fn_type_unification): Likewise. + (type_unification): Likewise. + (type_unification_real): Likewise. Use + maybe_adjust_types_for_deduction. Fix mishandling of + back-unification of template functions passed as arguments. Pass + appropriate combination of UNIFY_ALLOW_* to unify. + (unify): Remove unused NTPARMS parameter. Use + check_cv_quals_for_unify. Remove bogus code that allowed + too-generous unification in order to adhere more closely to standard. + (get_bindings_real): Adjust. + (get_class_bindings): Likewise. + + * method.c (build_overload_identifier): Only use the innermost + template arguments when mangling. + * pt.c (tsubst_template_argument_vector): New function. + (complete_template_args): Deal with the situation where the + extra_args contain more than one level of arguments. + (lookup_template_class): Deal with member template classes, which + may have more than one level of arguments. + (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE. + Improve handling of member template classes. Use + DECL_PRIMARY_TEMPLATE instead of inline expansion. Use + tsubst_template_argument_vector where appropriate. + (regenerate_decl_from_template): Break out from ... + (instantiate_decl): Here. + + * lex.c (yyprint): Remove TYPENAME_ELLIPSIS. + * parse.h: Regenerated. + * parse.c: Really regenerated. + + * cp-tree.h (finish_unary_op_expr): New function. + (finish_id_expr): Likewise. + (begin_new_placement): Likewise. + (finish_new_placement): Likewise. + (finish_declarator): Likewise. + (finish_translation_unit): Likewise. + (finish_parmlist): Likewise. + (begin_class_definition): Likewise. + (finish_class_definition): Likewise. + (finish_default_args): Likewise. + (finish_inline_definitions): Likewise. + * parse.y (GCC_ASM_KEYWORD): Remove. + (TYPENAME_ELLIPSIS): Likewise. + * parse.c: Regenerated. + Use new functions in semantics.c in the actions for many rules. + * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD. + * hash.h: Regenerated. + * semantics.c (finish_expr_stmt): Allow NULL expr. + (finish_unary_op_expr): New function, containing + code previously in parse.y. + (finish_id_expr): Likewise. + (begin_new_placement): Likewise. + (finish_new_placement): Likewise. + (finish_declarator): Likewise. + (finish_translation_unit): Likewise. + (finish_parmlist): Likewise. + (begin_class_definition): Likewise. + (finish_class_definition): Likewise. + (finish_default_args): Likewise. + (finish_inline_definitions): Likewise. + +Sun May 10 23:43:13 1998 Mark Mitchell + + * typeck.c (build_c_cast): Don't decay arrays and functions to + pointer type when converting to a class type. + +Sun May 10 22:53:56 1998 Jason Merrill + + * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro. + (DECL_CLASS_SCOPE_P): Likewise. + +Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org) + + * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT. + * decl2.c (constructor_name_full): Likewise. + +Sun May 10 22:48:12 1998 Mike Stump + + * tree.c (mapcar): Add OVERLOAD support. + + * init.c (resolve_offset_ref): We must use basetype_path before we + destroy it with a call to convert_pointer_to. + +Sat May 9 14:44:37 1998 Jason Merrill + + * class.c (currently_open_class): New fn. + * decl.c (lookup_name_real): Use it. + * search.c (lookup_field): Likewise. + +Fri May 8 23:32:42 1998 Martin von Loewis + + * cp-tree.def (OVERLOAD): New node. + * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE, + SET_IDENTIFIER_NAMESPACE_VALUE): Define. + (NAMESPACE_BINDING): Remove. + (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use + namespace_binding. + (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED): + Define. + (tree_overload): New struct. + (IDENTIFIER_TYPE_VALUE): Use identifier_type_value. + (REAL_IDENTIFIER_TYPE_VALUE): Define. + (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE. + (lang_decl_flags): Remove in_namespace. + (lang_decl): Remove chain. + (DECL_CHAIN, DECL_NAMESPACE): Remove. + (flag_honor_std): Declare extern. + (identifier_type_value, pushdecl_namespace_level, push_using_decl, + namespace_binding, set_namespace_binding, + lookup_function_nonclass, cat_namespace_levels, + set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons, + scratch_ovl_cons, ovl_member, build_overload): Declare. + (decl_list_length, get_namespace_id, current_namespace_id, + overloaded_globals_p): Remove. + (lookup_using_namespace, qualified_lookup_using_namespace): Change + return type. + (push_scratch_obstack): New macro. + * call.c (add_function_candidate): Special-case type of OVERLOAD node. + (build_user_conversions_1): Iterate using OVL_NEXT for ctors, + convs, fns. + (build_new_function_call): Iterate using OVL_CHAIN. + Print DECL_NAME in when reporting ambiguities. + (build_object_call): Iterate using OVL_NEXT for fns, convs. + (build_new_op): Call lookup_function_nonclass. + Iterate using OVL_NEXT. + (build_op_delete_call): Change detection of members. + Do not wrap TREE_LIST around fields and single global functions. + (build_over_call): Don't push a class level if the context is a + namespace. + (build_new_method_call): Iterate using OVL_NEXT. + * class.c (add_method): Chain overloaded members using + build_overload. Remove copying of method. + (grow_method): When iterating through the obstack, expect OVERLOAD + nodes. Chain overload members. + (finish_struct_methods): Chain overload members. Unpack OVERLOAD + nodes in call to get_baselinks. + (duplicate_tag_error): Expect OVERLOAD nodes when unchaining. + (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle + fdecls that are OVERLOAD nodes. + (validate_lhs): New function. + (instantiate_type): Do not copy OVERLOAD nodes. Remove dead + code. Use DECL_NAME in error messages. Split code between global + and member function processing. + * decl.c (global_type_node): New static variable. + (in_std): New global. + (struct binding_level): New field usings. + (resume_binding_level): Assert that we are not in a class. + (toplevel_bindings_p): Just check for namespace_p or + pseudo_global. + (resume_level): Remove. + (find_binding): New function. + (binding_for_name): Call it. + (namespace_binding, set_namespace_binding): New functions. + (push_namespace): Associate binding level with new namespace, + resume_binding_level for existing namespace. Remove old code. + Fake std by counting. + (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE. + (maybe_push_to_top_level): Save current namespace. + (pop_from_top_level): Restore saved namespace. + (pop_namespace): Call suspend_binding_level. Remove old code. + (cat_namespace_levels): New function. + (set_identifier_type_value_with_scope): For namespace bindings, + set BINDING_TYPE, and use global_type_node. + Use REAL_IDENTIFIER_TYPE_VALUE otherwise. + (identifier_type_value): New function. + (pushtag): If no context, use current_namespace. + (duplicate_decls): Don't process DECL_CHAIN. + (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not + already set. Never reset it to NULL_TREE. Lookup global variables + in their namespace. Push overloaded templates if they are on + namespace level. + (pushdecl_namespace_level): New function. + (pushdecl_top_level): Implement using pushdecl_namespace_level. + (pushdecl_using_decl): New function. + (overloaded_globals_p): Remove. + (push_overloaded_decl): Create OVERLOAD nodes, and iterate through + them. Use namespace_binding and set_namespace_value. + (redeclaration_error_message): Complain if the declarations come + from different namespaces. + (lookup_tag): On namespace level, look in the BINDING_TYPE. + (lookup_namespace_name): Pass tree_bindings from stack. Remove + old code. + (select_decl): New function. + (lookup_name_real): Call it for qualified and unqualified lookup. + Pass tree_bindings from the stack. + If prefer_type is 1, also accept namespaces. + (lookup_function_nonclass): New function. + (init_decl_processing): Set the binding level of the global + namespace to global_binding_level. + Build a proper type list for __builtin_apply. + Initialize std_node to "fake std" if flag_honor_std is set. + Initialize global_type_node. + Allocated bad_alloc in namespace std if flag_honor_std. + (define_function): Set the DECL_CONTEXT to the current_namespace. + (start_decl): A namespace is not considered as a context here. If + the DECL_CONTEXT is a namespace, push the decl. + (cp_finish_decl): Check for namespaces used as initializers. + (grokfndecl): Add namespace parameter. Remove processing of + DECL_CHAIN. + (grokvardecl): Add namespace parameter. + (grokdeclarator): Process SCOPEs that are namespaces. For + mangling, temporarily set the DECL_CONTEXT on anonymous structs. + (start_function): Check for contexts that are namespaces. + Set context for declarations that have not been pushed. + (store_parm_decls): Check for ::main only. + (finish_function): Likewise. + (start_method): Check for contexts that are namespaces. + (start_method): Remove DECL_CHAIN processing. + * decl2.c (flag_honor_std): Declare. + (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given. + (decl_namespace_list): New static global. + (grok_x_components): Ignore namespaces as type contexts. + (check_classfn): Expect OVERLOAD nodes. + (grokfield): Remove DECL_CHAIN processing. + (finish_file): Call cat_namespace_levels. + (merge_functions): New function. + (ambiguous_decl): Rewrite. + (lookup_using_namespace): Produce tree_bindings. + (qualified_lookup_using_namespace): Likewise. + (set_decl_namespace, decl_namespace, current_decl_namespace, + push_decl_namespace, pop_decl_namespace): New functions. + (arg_lookup): New struct. + (add_function, arg_assoc_namespace, arg_assoc_class, + arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent): + New functions. + (get_namespace_id, current_namespace_id): Remove. + (do_toplevel_using_decl): Rewrite. + (do_class_using_decl): Complain about namespace qualifiers. + (do_using_directive): Sorry if not on namespace level. Complain + about unknown namespaces. + * error.c (dump_aggr_type): Check for namespace contexts. + * except.c (init_exception_processing): Push terminate into std. + * friend.c (is_friend): A namespace is not a context, here. + * init.c (expand_member_init): Remove DECL_CHAIN processing. + (build_offset_ref): Process OVERLOAD nodes. + * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std. + * lex.c (identifier_type): Loop using OVL_CHAIN. + (see_typename): Set looking_for_typename to 2. + (real_yylex): Likewise. + (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs. + (do_scoped_id): Expect OVERLOAD nodes. + Change calling convention for qualified_lookup_using_namespace. + (build_lang_decl): Don't set in_namespace anymore. + * method.c (typevec_size): New global. + (build_overload_nested_name): Return if global_namespace. + Otherwise, always expect a declaration context. + (build_qualified_name): Likewise. + Make sure we don't write beyond typevec_size. + (build_decl_overload_real): Likewise. + Allocate one extra slot for the namespace. + (hack_identifier): Mark code dead. + Process OVERLOAD and NAMESPACE_DECL nodes. + * parse.y (program): Pop namespaces until in global namespace. + (extdef): In a using-declaration, don't discard the identifier if + there is no declaration. + (left_curly): Ignore type contexts which are namespaces. + (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type + used as scope. + * pt.c (template_class_depth): Expect types to be namespaces. + (determine_specialization): Simplify by expecting OVERLOAD nodes. + (push_template_decl): Push into namespace level. + Reset ctx if it is a namespace. + Set DECL_CONTEXT to current_namespace if not set already. + Ignore real contexts that are namespaces. + (mangle_class_name_for_template): Skip global_namespace. + Mangle other namespaces as declarations. + (lookup_template_function): Set type of OVERLOAD nodes to unknown. + (lookup_template_class): Push into namespace of context. + If the context is a namespace, set it to global_namespace. + Use id_context for mangling. + (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes. + (tsubst_friend_function): Ignore namespace contexts. + Push into namespace level. + (tsubst): Handle NAMESPACE_DECL nodes. + Remove DECL_CHAIN processing. + (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes. + * ptree.c (print_lang_identifier): Print bindings. + (lang_print_xnode): Print OVERLOAD nodes. + * rtti.c (init_rtti_processing): Push type_info into std. + * search.c (lookup_fnfields_here): Expect OVERLOAD nodes. + (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual, + dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions, + lookup_fnfields_here): Likewise. + Process all nodes, instead of going through TREE_CHAIN. + * sig.c (build_signature_pointer_or_reference_type): Set context + to global_namespace. + (build_signature_table_constructor): Expect OVERLOAD nodes. + * spew.c (yylex): Save old setting of looking_for_typename. + * tree.c (decl_list_length): Remove. + (binding_init): New function. + (count_functions): Rewrite. + (is_overloaded_fn): Expect OVERLOAD nodes. + (really_overloaded_fn, get_first_fn, lvalue_type): Likewise. + (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after, + ovl_member): New functions. + * typeck.c (require_complete_type): Expect OVERLOAD nodes. + (type_unknown_p): Likewise. + (require_instantiated_type): Likewise. + (build_component_ref): Declare code dead. + (build_x_function_call): Create and expect OVERLOAD nodes. + (build_function_call_real): Check for ::main only. + (build_unary_op): Likewise. Expect OVERLOAD nodes. + (convert_for_assignment): Check for TREE_LIST before accessing + TREE_VALUE. + * decl.c (duplicate_decls): Check for namespace bindings instead + of global bindings. + (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real, + lookup_name_current_level, start_decl, xref_tag, + finish_enum): Likewise. + * init.c (build_offset_ref): Likewise. + * search.c (lookup_field): Likewise. + (lookup_fnfields): Likewise. + (dfs_debug_mark): Likewise. + * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE. + (poplevel_class, pop_from_top_level): Likewise. + * decl2.c (finish_method): Likewise. + * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE. + * decl.c (record_builtin_type): Likewise. + (init_decl_processing, grokfndecl): Likewise. + * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise. + (make_lang_type): Likewise. + * parse.y (make_thunk): Likewise. + * pt.c (tsubst): Likewise. + * tree.c (debug_binfo): Likewise. + * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h, + tinfo2.cc, inc/new.h: Add std qualifications. + * inc/new: Wrap with namespace std if __HONOR_STD. + * inc/typeinfo: Likewise. + +Fri May 8 00:43:50 1998 Jason Merrill + + * call.c (build_user_type_conversion_1): Handle second_conv + properly for templates. + +Thu May 7 17:09:25 1998 Andrew MacLeod + + * method.c (build_decl_overload_real): Set TREE_USED flag to + zero for build_type_variants nodes as well. + +Wed May 6 19:27:09 1998 Jason Merrill + + * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE. + +Wed May 6 16:49:48 1998 Jim Wilson + + * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o, + except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o, + rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o, + xref.o): Add toplev.h dependencies. + +Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com) + + * errfn.c (cp_error, cp_warning): Remove declarations for + error and warning respectively. + +Wed May 6 14:28:18 1998 Kaveh R. Ghazi + + * error.c: Convert to using ctype macros defined in system.h. + * method.c: Likewise. + * xref.c: Likewise. + * lex.c: Likewise. Also remove redundant system header stuff. + +Wed May 6 06:36:41 1998 Robert Lipe + + * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c, + expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c, + search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c, + xref.c: Add include of toplev.h. + +Wed May 6 02:33:39 1998 Jason Merrill + + * tree.c (perm_manip): Also regenerate the RTL of an extern. + (copy_to_permanent): Use end_temporary_allocation. + +Tue May 5 23:54:04 1998 Jason Merrill + + * init.c (expand_vec_init): The initialization of each array + element is a full-expression. + +Tue May 5 18:24:13 1998 Andrew MacLeod + + * method.c (build_mangled_name): Add a call to build_type_variant + to get the right type. + +Tue May 5 01:25:03 1998 Jason Merrill + + * Makefile.in: Add .SUFFIXES. + + * cp-tree.def: Remove NAMESPACE_DECL. + +Sun May 3 01:32:14 1998 Jason Merrill + + * call.c (build_over_call): Do evaluate arg even if it has empty + class type. + * decl.c (start_function): Don't push a member function. + +Thu Apr 30 18:59:23 1998 Jim Wilson + + * Makefile.in (g++FAQ.info): Put -o option before input file. + +Thu Apr 30 13:05:33 1998 Andrew MacLeod + + * gxxint.texi: Add info for squangling codes K and B. + +Tue Apr 28 13:22:01 1998 Mark Mitchell + + * semantics.c (begin_stmt_expr): Avoid duplicating the effect of + the expression in templates. + (finish_stmt_expr): Likewise. + +1998-04-28 Brendan Kehoe + + * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int. + +Mon Apr 27 13:58:10 1998 Mark Mitchell + + * decl.c (maybe_push_to_top_level): Always clear + current_template_parms and processing_template_decl. + (pushtag): Remove check of current_class_type and some comments, + since maybe_push_to_top_level no longer creates confusion. + +Sun Apr 26 12:10:18 1998 Mark Mitchell + + * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro. + (DECL_CLASS_TEMPLATE_P): Likewise. + (DECL_PRIMARY_TEMPLATE): Likewise. + (PRIMARY_TEMPLATE_P): Use it. + (push_template_decl_real): New function. + (redeclare_class_template): Take new template parameters as + input. + (is_specialization_of): New function. + (comp_template_args): Declare. + * decl.c (pushtag): Handle friend template classes. + (xref_tag): Likewise. Use new calling convention for + redeclare_class_template. + * decl2.c (grok_x_components): Handle friend templates. + * friend.c (is_friend): Use is_specialization_of where + appropriate. Deal with friend class templates. + (make_friend_class): Let a class template be friends with itself. + * pt.c (comp_template_args): Remove declaration. + (tsubst_friend_class): New function. + (push_template_decl_real): New function. + (push_template_decl): Use it. + (redeclare_class_template): Adjust for new calling convention. + (comp_template_args): Give it external linkage. + (instantiate_class_type): Use tsubst_friend_class to deal + with friend templates. + * typeck.c (comptypes): Use comp_template_args, rather than + expanding it inline. + * parse.y (component_decl): Handle a nested template type + like other component type declarations. + + * pt.c (check_explicit_specialization): Handle overloaded + constructors correctly. + + * pt.c (mabybe_get_template_decl_from_type_decl): New function. + (lookup_template_class): Use it. + +Thu Apr 23 21:19:06 1998 Jason Merrill + + * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops. + * cp-tree.h: Add WRAPPER support. + * call.c (add_candidate): Split out from add_*_candidate fns. + (build_over_call): Take the candidate instead of function and args. + Enforce access control here. Emit overload warnings here. + (add_warning): New fn. + (joust): Add WARN parm. If not set, call add_warning instead of + printing a warning. Re-enable some warnings. + (tourney): Pass it. + (convert_like): Adjust. + (build_new_op): Adjust. + (build_new_function_call): Adjust. + (build_user_type_conversion_1): Adjust. + (USER_CONV_FN): Adjust. + * tree.c (build_expr_wrapper, build_expr_ptr_wrapper, + build_int_wrapper): New fns. + +Thu Apr 23 18:27:53 1998 Mark P. Mitchell + + * pt.c (unify): Fix typo in previous change. + +Thu Apr 23 09:32:58 1998 Jason Merrill + + * error.c (dump_type_real): Declare canonical_name. + + * typeck.c (comp_target_types): Fix PMFs. + +Wed Apr 22 13:24:48 1998 Mark Mitchell + + * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for + the DECL_RESULTs of a member TEMPLATE_DECL, not just the + TEMPLATE_DECL. + + * pt.c (tsubst): Decrease the template-level of + TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a + TEMPLATE_PARM_INDEX. + (template_decl_level): New function. + (unify): Make sure to record unifications for template + parameters, even when the parameters exactly match the arguments. + Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and + TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that + aren't from the level we're currently working on. + +Tue Apr 21 22:00:04 1998 Mark Mitchell + + * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory. + + * decl2.c (check_member_template): Set DECL_IGNORED for member + class templates, too. + + * decl2.c (grokfield): Remangle the name of a member TYPE_DECL. + +Tue Apr 21 18:59:11 1998 Benjamin Kosnik + + * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function. + +Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com) + + * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare. + * decl.c (intTI_type_node, unsigned_intTI_type_node): Define. + (init_decl_processing): Handle TI types. + * typeck.c (unsigned_type, signed_type): Handle TI types. + +Sat Apr 18 15:25:21 1998 Jim Wilson + + * g++spec.c (lang_specific_driver): New argument in_added_libraries. + New local added_libraries. Increment count when add library to + arglist. + +Fri Apr 17 21:25:00 1998 Mark Mitchell + + * cp-tree.h (type_as_string_real): New function. + * pt.c (mangle_class_name_for_template): Use it. + * error.c (dump_aggr_type): Change prototype. + (dump_type_prefix): Likewise. + (dump_type_suffix): Likewise. + (dump_type_real): Convert from dump_type. If desired, the + "canonica" name of a typedef, i.e., the name of the underlying + type, can be printed. + (dump_type): Call dump_type_real. + +Fri Apr 17 14:30:45 1998 Jason Merrill + + * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks. + + * typeck.c (comp_target_types): Tweak pedantic case. + (comp_target_parms): Tweak pedantic case. Clean up somewhat. + Return -1 or 1 instead of 1 or 2. + (compparms): Remove STRICT handling. + (convert_for_assignment): Fix handling of pmfs. + +Fri Apr 17 14:04:16 1998 Mark Mitchell + + * typeck.c (comp_target_types): Handle references like pointers. + (comp_target_parms): Note that return code from comp_target_types + can be negative to indicate failure. + +Fri Apr 17 09:10:52 1998 Andreas Schwab + + * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG), + which requires a working target compiler to build. + +Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com) + + * tree.c (avoid_overlap): Add prototype. + + * spew.c (num_tokens): Add prototype. + (nth_noken, add_token, consume_token, debug_yychar): Likewise. + + * search.c (dfs_check_overlap): Add prototype. + (dfs_no_overlap_yet): Likewise. + + * pt.c (original_template): Add prototype. + (inline_needs_template_parms): Likewise. + (push_inline_template_parms_recursive): Likewise. + (retrieve_specialization, register_specialization): Likewise. + (print_candidates, reduce_template_parm_level): Likewise. + (build_template_decl, mark_template_parm): Likewise. + (tsubst_friend_function, get_bindings_real): Likewise. + + * method.c (start_squangling): Add prototype. + (end_squangling, check_ktype, issue_ktype): Likewise. + (build_overloaded_scope_ref, check_btype): Likewise. + (build_mangled_template_parm_index): Likewise. + + * lex.c (init_cpp_parse): Add prototype. + (handle_cp_pragma, handle_sysv_pragma): Likewise. + (reduce_cmp, token_cmp): Likewise. + + * except.c (call_eh_info): Add prototype. + (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise. + (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise. + + * decl2.c (is_namespace_ancestor): Add prototype. + (namespace_ancestor, add_using_namespace): Likewise. + (ambiguous_decl): Likewise. + + * decl.c (indent): Add prototype. + + * call.c (add_template_candidate_real): Add prototype. + +Fri Apr 17 01:57:12 1998 Jason Merrill + + * decl2.c (build_expr_from_tree): Just return a PMF. + +Fri Apr 17 00:45:12 1998 Mark Mitchell + + * typeck2.c (process_init_constructor): Don't strip cv-qualifiers + when doing initializations. + + * pt.c (unify): Use comptypes to compare type args. + +Fri Apr 17 00:24:22 1998 Jason Merrill + + * decl.c (duplicate_decls): Fix check for when it's safe to free + the new decl. + + * pt.c (mangle_class_name_for_template): Don't pass a typedef type + to type_as_string. + +Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com) + + * pt.c (build_template_parm_index): Add prototype. + + * search.c (my_tree_cons): Don't clear words outside the + newly allocated node. + +Wed Apr 15 15:34:44 1998 Dave Brolley + + * lex.c (init_parse): Now returns char* containing the filename. + +Wed Apr 15 13:20:06 1998 John Carr + Jeff Law + + * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer + than a pointer. + +Sun Apr 12 22:31:19 1998 Richard Kenner + + * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION. + +Fri Apr 10 12:16:49 1998 Benjamin Kosnik + + * decl.c (duplicate_decls): Don't warn for redundant decls if + friend: let add_friend take care of it. + +Thu Apr 9 02:40:48 1998 Jason Merrill + + * sig.c (build_signature_pointer_constructor): Don't set + TREE_HAS_CONSTRUCTOR for a signature pointer. + * cvt.c (ocp_convert): Don't force a temporary for internal structs. + * init.c (resolve_offset_ref): Warn about implicit & on pmfs + here, too. + * typeck.c (build_unary_op): Only allow taking the address of a + real constructor. + * typeck2.c (digest_init): Simplify. + (store_init_value): Don't pedwarn about using { } for pmfs. + +Thu Apr 9 22:16:57 1998 Per Bothner + + * cp-tree.h (start_decl): Update prototype. + * decl.c (start_decl): Like the C version, new parameters + for the attributes. Call cplus_decl_attributes here, + (pushdecl): Like C version, do build_type_copy if TYPE_DECL, + (grokdeclarator): Pass NULL for new start_decl arguments. + * pt.c (tsubst_expr): Likewise. + * parse.y: Merge cplus_decl_attribute calls into start_decl calls. + * typeck.c (common_type): Check TYPE_MAIN_VARIANT. + * lex.c (build_lang_decl): Add lang_name_java. + * class.c (push_lang_context): Add lang_name_java. + * method.c (build_mangled_name): Check for is_java_type. + +Thu Apr 9 22:16:57 1998 Benjamin Kosnik + + * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT. + * call.c (build_scoped_method_call): Check for TREE_CODE for + VOID_TYPE instead of type == void_type_node. + (build_method_call): Likewise. + * decl.c (lookup_name_real): Likewise. + (grokdeclarator): Likewise. + (start_decl): Likewise. + (grokparms): Likewise. + (start_function): Likewise. + (finish_function): Likewise. + (start_method): Likewise. + +Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com) + + * lex.c (finput): New variable. + (init_cpp_parse): Renamed from init_parse. + (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished. + (finish_parse): New function. + * cp-tree.h (init_lex, init_parse): Remove declarations. + +Mon Apr 6 02:25:05 1998 Jason Merrill + + * call.c (build_call): Still evaluate the actual argument. + * class.c (is_empty_class): Update for -fnew-abi. + + * decl2.c: -fnew-abi implies -fsquangle. + + * method.c (do_build_assign_ref): Don't do anything to copy + an empty class. + (do_build_copy_constructor): Likewise. + * call.c (build_over_call): Likewise. + +Sat Apr 4 18:43:58 1998 Jason Merrill + + * tree.c (avoid_overlap): Return a value. + +Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com) + + * method.c (check_btype): Add missing argument to xrealloc. + (check_ktype): Likewise. + +Fri Apr 3 02:22:59 1998 Jason Merrill + + Implement empty base optimization. + * class.c (finish_struct_1): Add vbase fields earlier. Set + CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty. + * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns. + (types_overlap_p): New fn. + * tree.c (avoid_overlap): New fn. + (build_base_fields): Use it to avoid overlapping empty bases. + * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi. + + * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs. + + Re-implement allocation of base class subobjects. + * tree.c (unshare_base_binfos): New fn. + (layout_basetypes): Use it. Now handles offsets of both virtual and + non-virtual bases, after layout_type. + (layout_vbasetypes): Remove. + (build_base_fields): Generate FIELD_DECLs for each non-virtual base. + (build_vbase_pointer_fields): Split out from old layout_basetypes. + * class.c (finish_base_struct): Lose offset handling code. + Move nonvdtor warning here. Don't mess with t_binfo anymore. + (finish_struct_1): Don't mess with t_binfo anymore. Use fns above. + * cp-tree.h: Adjust. + +Thu Apr 2 14:25:13 1998 Jason Merrill + + * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff. + * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise. + * class.c (duplicate_tag_error): Likewise. + (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN. + * tree.c (layout_vbasetypes): Update from layout_record, remove + var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE. + (layout_basetypes): Likewise. + +Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com) + + * class.c, Make sure system.h is included just after config.h. + Delete lingering stdio and errno references too. + * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise. + +Wed Apr 1 15:38:36 1998 Jason Merrill + + * friend.c (is_friend): Fix access control for local classes. + + * class.c (is_empty_class): New fn. + * call.c (build_call): Don't pass empty class objects to a function. + +Wed Apr 1 14:58:35 1998 Mark Mitchell + + * call.c (build_over_call): Do name resolution for default + arguments of function templates in the scope of the templates. + +Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com) + + * call.c: Include system.h. Remove includes, declarations and + defines provided by system.h. + * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise. + * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise. + * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise. + * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise. + * typeck2.c, xref.c: Likewise. + * Makefile.in: Dependencies updated as appropriate. + * Make-lang.in: Likewise. + +Mon Mar 30 12:15:00 1998 Mark Mitchell + + * pt.c (fn_type_unification): Allow incomplete unification without + an immediate error message. + +Mon Mar 30 08:55:42 1998 Jason Merrill + + * tree.c (member_p): New fn. + * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for + initializing class members. + + * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'. + * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX. + + * call.c (build_method_call): Handle non-scoped destructors, too. + * pt.c (tsubst_copy): Likewise. + + * pt.c (print_template_context): Split out... + (push_tinst_level): ...from here. + + * friend.c (is_friend): Don't pass a type to decl_function_context. + + * typeck.c (convert_for_initialization): Always hand off + conversions to class type. + +Sun Mar 29 20:01:59 1998 Jason Merrill + + * friend.c (is_friend): Local classes have the same access as the + enclosing function. + +Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com) + + * typeck.c (expand_target_expr): Delete dead function. + + * search.c: Put various prototypes inside #ifdef MI_MATRIX. + + * repo.c (save_string): Delete dead function. + + * method.c (thunk_printable_name): Delete dead function. + + * lex.c (yynextch): Delete dead function. + + * expr.c (tree_extract_aggr_init): #if 0 out. + + * except.c (do_unwind): Delete dead function. + (easy_expand_asm): Likewise. + + * cvt.c (build_conversion_type_1): Delete dead function. + + * cp-tree.h (push_expression_obstack): Declare. + + * call.c (source_type): #if 0 out. + + * class.c (alter_access): Remove unused label. Add braces + around empty else clause. + + * lex.c (yyprint): Fix argument to printf. + +Sat Mar 28 17:43:52 1998 Mark Mitchell + + * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs. + + * pt.c (instantiate_class_template): Make sure template + arguments are permanent. + * init.c (resolve_offset_ref): Don't go looking around in + template types. + + * semantics.c: Add routines to handle expressions, and some + declaration processing. + * parse.y: Use them. + (current_class_depth): Move declaration to cp-tree.h. + * parse.c: Regenerated. + * cp-tree.h: Use them. + (current_class_depth): Declare. + * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr. + +Fri Mar 27 20:23:18 1998 Mark Mitchell + + * error.c (dump_decl): Be a bit more explicit with template + type arguments, when verbose. + +Fri Mar 27 18:16:40 1998 Jason Merrill + + * inc/exception: Reorder closing braces. + +Fri Mar 27 13:22:18 1998 Mark Mitchell + + * pt.c (redeclare_class_template): New function. + * cp_tree.h (redeclare_class_template): Declare it. + * decl.c (xref_tag): Use it. + +Thu Mar 26 11:16:30 1998 Jason Merrill + + * call.c (build_over_call): Check IS_AGGR_TYPE, not + TYPE_LANG_SPECIFIC. + * typeck.c (convert_arguments): Likewise. + + * decl.c (grokdeclarator): Remove const and volatile from type after + setting constp and volatilep. + + * class.c (finish_struct_1): Don't warn about bool bitfield larger + than one bit. + +Thu Mar 26 10:25:52 1998 Mark Mitchell + + * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate. + +Thu Mar 26 10:24:05 1998 Mark Mitchell + + * call.c (build_object_call): Complain about ambiguous operator(), + rather that crashing. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + +Thu Mar 26 10:23:24 1998 Mark Mitchell + + * cvt.c (perform_qualification_conversions): Use comp_target_types + instead of comp_ptr_ttypes. + +Wed Mar 25 16:10:50 1998 Mark Mitchell + + * cp-tree.h (enforce_access): Declare. + * call.c (enforce_access): Make it extern, not static. + * class.c (alter_access): Use enforce_access; modify code for ISO + compliance, rather than ARM rules. + +Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij + + * cp-tree.h: Fix typo. + +Wed Mar 25 02:01:02 1998 Jason Merrill + + * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing + if (aggregate_value_p (type)). + + * decl2.c (constructor_name_full): Handle TYPENAME_TYPE. + +Tue Mar 24 16:12:01 1998 Mark Mitchell + + * tree.c (mapcar): When dealing with a DECL, use it's constant + value, if any. + * pt.c (lookup_template_class): Don't mangle the names of template + classes whose arguments are unknown. + + * pt.c (tsubst_expr): Handle GOTO_STMT correctly. + +Tue Mar 24 12:21:55 1998 Benjamin Kosnik + + * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1. + +Tue Mar 24 12:21:48 1998 Jim Wilson + + * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for + boolean_type_node to 1. + +Tue Mar 24 10:23:47 1998 Mark Mitchell + + * error.c (dump_expr): Remove unused variable `l'. + + * pt.c (for_each_template_parm): New function, created by + converting uses_template_parms. + (tree_fn_t): New typedef. + (uses_template_parms): Use it. + (mark_template_parm): New function. + (push_template_decl): Check that the argument list of a partial + specialization uses all the template parameters. + + * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done + with it; we might want it for debugging. + * cp-tree.h (type_unification): Change interface. + * class.c (finish_struct_1): Skip nested template types, just like + ordinary nested types. + (instantiate_type): Use new interface to type_unification. + * lex.c (init_lex): Add __sz as opname for sizeof. + * method.c (build_overload_scope_ref): New function. + (build_overload_int): Handle complex expressions. Set + numeric_output_need_bar if necessary. + (build_overload_value): Handle non-PARM_DECL nodes; this + routine is now used by build_overload_int. Remove some + assignments to numeric_output_need_bar. Use + build_overload_scope_ref. + (build_qualified_name): Note that some template mangled names end + with digits, and set numeric_output_need_bar appropriately. Use + build_underscore_int. + * pt.c (unify): Change interface. + (type_unification_real): Likewise. + (determine_specialization): Use new interfaces. + (tsubst): Deal gracefully with situations in which the argument + vector is not fully filled. + (fn_type_unification): Use new interfaces. + (type_unification): Likewise. Remove NOP_EXPR hack. + (type_unification_real): Likewise. + (unify): Likewise. Deal with unification of complex expressions. + +Mon Mar 23 12:24:37 1998 Jason Merrill + + * pt.c (complete_template_args): Initialize skip properly. + + * decl.c (make_typename_type): Revert. + (make_implicit_typename): Remove. + (lookup_name_real): Don't call it. Call lookup_field if we see a + TYPE_DECL from a template base. + * search.c (lookup_field): Do implicit typename stuff. + +Sun Mar 22 00:50:42 1998 Nick Clifton + Geoff Noer + + * Makefile.in: Various fixes for building cygwin32 native toolchains. + * Make-lang.in: Likewise. + +Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij + + * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify. + +Fri Mar 20 10:42:07 1998 Jason Merrill + + * decl.c (make_implicit_typename): Rewrite removed code. + (make_typename_type): Call it if the type we look up comes from + a base that uses template parms. + + * pt.c (complete_template_args): Rewrite. + (tsubst, FUNCTION_DECL): Use it. + +Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org) + + * semantics.c (finish_asm_stmt): Fix combine strings. Call + c_expand_asm_operands () if output_operands, input_operands or + clobbers is not NULL_TREE. + +Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij + + * pt.c (complete_template_args): New function. + (get_bindings): Deal with specializations of function templates + with return type containing parameters from outer class + templates. + (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level, + substitute arguments and compose a new type. + +Thu Mar 19 19:01:48 1998 Mark Mitchell + + * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new + FUNCTION_DECLs. + +Thu Mar 19 11:51:58 1998 Jason Merrill + + * decl.c (make_implicit_typename): Lose useless code. + + * call.c (standard_conversion): Handle A* -> const A* properly. + + * pt.c (get_bindings_real): Rename from get_bindings. Add + check_rettype parm. + (get_bindings): Pass 1. + (get_bindings_overload): Pass 0. + +Wed Mar 19 09:08:12 1998 Mark Mitchell + + * pt.c (check_explicit_specialization): When reverting a static + member function, also remove the `this' parameter from + last_function_parms. + +Thu Mar 19 02:27:48 1998 Jason Merrill + + * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting + a function context. + + * decl.c (store_bindings): Use free_binding_vecs. + (pop_from_top_level): Likewise. + +Wed Mar 18 12:41:43 1998 Jason Merrill + + * decl.c (make_implicit_typename): Only change the type of a + TYPENAME_TYPE. + +Wed Mar 18 10:09:51 1998 Mark Mitchell + + * semantics.c: New file, containing routines to perform the + semantic phase of parsing. + * parse.y: Use it. + * pt.c (tsubst_expr): Likewise. + * cp-tree.h: Declare the various functions in semantics.c. + Provide macros to access _STMT tree nodes. + * cp-tree.def: Add ASM_STMT tree node. + * Makefile.in, Make-lang.in: Add dependencies on and for + semantics.c. + +Wed Mar 18 00:24:10 1998 Jason Merrill + + * pt.c (push_template_decl): Only check primary templates. + + * pt.c (check_explicit_specialization): Complain about default args + in explicit specialization. + + * parse.y (nomods_initdcl0): Also call cp_finish_decl for a + constructor_declarator. + +Tue Mar 17 14:44:54 1998 Mark Mitchell + + * typeck2.c (build_x_arrow): Don't crash when an aggregate type + has no overloaded operator ->. + + * call.c (build_field_call): Don't crash when presented with a + field that is actually a nested type. + + * decl.c (pushtag): Deal with friend class injection in local + classes. + + * call.c (build_object_call): Don't crash if OBJ is a + pointer-to-member-function. + +Tue Mar 17 11:40:26 1998 Jason Merrill + + * pt.c (push_template_decl): Complain about template with C linkage, + anonymous template class. + +Mon Mar 16 12:10:39 1998 Jason Merrill + + * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX. + * search.c: Likewise. + + * lex.c (do_pending_defargs): Only call + maybe_{begin,end}_member_template_processing for FUNCTION_DECLs. + + * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al. + +Mon Mar 16 10:47:22 1998 Mark Mitchell + + * parse.y: Deal with CONSTRUCTORS in new_initializers. + +Mon Mar 16 10:54:21 1998 Mark Mitchell + + * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more + closely mimics the behavior in parse.y. + (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing + into a compound statement. + +Sun Mar 15 02:07:26 1998 Jason Merrill + + * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro. + * pt.c (inline_needs_template_parms): New fn. + (original_template): New fn. + (push_inline_template_parms_recursive): New fn. + (maybe_begin_member_template_processing): Use them. + (maybe_end_member_template_processing): Likewise. + (is_member_or_friend_template): Rename to is_member_template. + Member functions of local classes are never member templates. + +Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij + + * lex.c (do_identifier): Handle TEMPLATE_DECL that was + added in the class scope to catch redefinition error. + + * pt.c (reduce_template_parm_level): Also copy + the DECL_TEMPLATE_PARMS field. + +Sun Mar 15 10:54:08 1998 Mark Mitchell + + * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a + reduced-level template type parameter. + +Sun Mar 15 12:26:02 1998 Manfred Hollstein + + * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider. + (DECL_NEEDS_FINAL_OVERRIDER_P): New macro. + * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P. + * decl.c (duplicate_decls): Propagate it. + * typeck2.c (abstract_virtuals_error): Use two loops to emit + abstract virtual functions and virtual functions which need a + final overrider separately. + +Thu Mar 12 09:39:40 1998 Manfred Hollstein + + * lang-specs.h: Properly put brackets around array elements in + initializer. + + * typeck.c (build_binary_op_nodefault): Correctly place parens around + && and || in expression. + +Thu Mar 12 09:26:04 1998 Manfred Hollstein + + * call.c (default_parm_conversions): Remove prototype definition. + (build_method_call): Remove unused variable result. + + * cvt.c (ocp_convert): Remove unused variable conversion. + + * decl2.c (ambiguous_decl): Add explicit parameter definition for name. + + * except.c (do_unwind): #if 0 definition of unused variables fcall + and next_pc. + + * expr.c (extract_scalar_init): #if 0 prototype and function + definition. + + * init.c (expand_aggr_init_1): Remove unused variable init_type. + (build_new_1): Remove unused variable t. + + * pt.c (instantiate_class_template): Remove unused variable newtag; + cast called function return value to void. + (do_decl_instantiation): Remove unused variables name and fn. + + * tree.c (get_type_decl): Add default return to shut up compiler from + complaining control reaches end of non-void function. + + * typeck.c (build_x_conditional_expr): Remove unused variable rval. + +Thu Mar 12 09:12:15 1998 Manfred Hollstein + + * call.c (default_parm_conversions): Remove prototype definition. + (build_method_call): Remove unused variable result. + (build_over_call): Add default case in enumeration switch. + +Thu Mar 12 08:39:13 1998 Manfred Hollstein + + * decl2.c (lang_decode_option): Change j's type to size_t. + + * tree.c (layout_vbasetypes): record_align and desired_align are of + type unsigned int; const_size and nonvirtual_const_size likewise. + +Wed Mar 11 07:25:20 1998 Mark Mitchell + + * parse.y (new_initializer): Make sure all initializers are + lists. + +Tue Mar 10 07:32:36 1998 Mark Mitchell + + * decl2.c (import_export_decl): Mark tinfo functions for + cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN. + +Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com) + + * method.c: Fix typo. + +Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi + + * method.c: Include "system.h" to get stdlib.h, stdio.h, + ctype.h, string.h, etc. + (issue_nrepeats): Add default case in enumeration switch. + (check_btype): Likewise. + (process_overload_item): Likewise. + + * Makefile.in (method.o): Depend on system.h. + +Wed Mar 4 22:26:53 1998 Andreas Schwab + + * lex.c (do_scoped_id): Fix parenthesizing. + +Wed Mar 4 12:11:53 1998 Michael Tiemann + + * rtti.c (get_tinfo_fn_dynamic): If this function is called an + FLAG_RTTI is unset, initialize type info machinery and continue + with FLAG_RTTI enabled. + (get_typeid): Likewise. + +Wed Mar 4 11:47:55 1998 Jason Merrill + + * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes + from B. + +Wed Mar 4 11:28:08 1998 Mark Mitchell + + * pt.c (finish_member_template_decl): Deal more gracefully with + invalid declarations. + +Tue Mar 3 01:38:17 1998 Jason Merrill + + * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c, + cp-tree.h: Clean up more old overloading code, old RTTI code, and + some formatting quirks. + + * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c, + method.c, pt.c, ptree.c, typeck.c: Remove support for + -fno-ansi-overloading and overloading METHOD_CALL_EXPR. + * class.h: Remove. + * Makefile.in: Adjust. + + * pt.c (unify): Don't allow reduced cv-quals when strict. + + * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from + *type_unification* and unify. + +Mon Mar 2 12:11:06 1998 Jason Merrill + + * parse.y (explicit_template_type): Remove TEMPLATE keyword. + (nested_name_specifier): And add it before this use. + (typename_sub0): And this use. Also add use without the keyword. + (typename_sub1): Likewise. + * pt.c (instantiate_class_template): Don't actually instantiate + anything if our type uses template parms. + +Mon Mar 2 11:04:59 1998 Jim Wilson + + * decl.c (start_function): Don't call temporary_allocation for a + nested function. + +Sun Mar 1 21:06:37 1998 Jason Merrill + + * pt.c (instantiate_class_template): Don't mess with friends if + our type uses template parms. + +Sat Feb 28 12:06:44 1998 Jason Merrill + + * parse.y (nested_name_specifier): Use explicit_template_type. + (typename_sub): Allow a template_type, an explicit_template_type, + or an implicit template type at the end. + * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL. + * decl.c (make_typename_type): Handle template-id where the name + is a TEMPLATE_DECL. + * call.c (build_scoped_method_call): Handle member template + destructor call. + * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member + destructor is represented by the type. + + * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro. + * parse.y (nested_name_specifier): Add 'template' case. + (explicit_template_type): New rule. + (typename_sub): Use it. + * decl.c (make_typename_type): Handle getting a template-id for NAME. + * pt.c (tsubst): Likewise. + +Fri Feb 27 11:17:50 1998 Jason Merrill + + * pt.c (add_to_template_args): Fix thinko. + (instantiate_class_template): Call it later. + + * pt.c (get_class_bindings): Add outer_args parm. + (most_specialized_class): Likewise. + (instantiate_class_template): Pass it. + (more_specialized_class): Likewise. + (lookup_template_class): Get context from template if none + was specified. + (finish_member_template_decl): Don't do anything with a + partial specialization. + * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of + AGGREGATE_TYPE_P. + * class.c (finish_struct): Member class templates have already been + checked for name clashes. + * decl.c (pushdecl_with_scope): Handle pushing at class level. + +Fri Feb 27 02:25:16 1998 Jason Merrill + + * pt.c (tsubst, TEMPLATE_DECL): Support member class templates. + (tsubst, *_PARM): Support multiple levels of template classes. + (instantiate_class_template): Look up the pattern from the + original template. + (lookup_template_class): Handle getting a template for d1. + (push_template_decl): Correct setting of 'primary'. + (reduce_template_parm_level): Add 'levels' parm. + (finish_member_template_decl): Support member class templates. + (template_class_depth): Handle multiple levels. + * parse.y (component_decl_1, fn.def2): Remove member template case. + (component_decl): Add member template cases. + * decl2.c (check_member_template): We now handle member template + classes. + * decl.c (pushtag): Handle member templates. + * method.c (do_inline_function_hair): Don't touch + IDENTIFIER_GLOBAL_VALUE. + * init.c (build_offset_ref): If name isn't an identifier, just + return it. + * spew.c (yylex): Handle PTYPENAME like TYPENAME. + + * typeck.c (get_delta_difference): Do adjust for conversions to + and from virtual base. + +Wed Feb 25 09:51:29 1998 Jason Merrill + + * typeck.c (get_delta_difference): Give hard error for conversion + from virtual base. + + * cp-tree.h: Tweak formatting. + +Wed Feb 25 00:35:33 1998 Jason Merrill + + * decl.c (push_namespace): Handle redeclaration error. + + * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro. + (IDENTIFIER_NAMESPACE_BINDINGS): New macro. + (NAMESPACE_BINDING): New macro. + (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING. + * *.c: Use them. + + * pt.c (push_template_decl): Use innermost_args. + + * decl.c (get_unique_name): Tweak from earlier in the name. + +Tue Feb 24 22:15:04 1998 Martin von Loewis + + * cp-tree.def: Add CPLUS_BINDING node. + * cp-tree.h (tree_binding): New struct. + (BINDING_SCOPE, BINDING_VALUE): New macros. + (current_namespace, global_namespace): Declare extern. + (struct lang_decl_flags): New field in_namespace. + (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros. + (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros. + (TREE_INDIRECT_USING): New macro. + * decl2.c (current_namespace, global_namespace): Declare. The + value is a NAMESPACE_DECL now, not a TREE_LIST. + (is_namespace_ancestor, namespace_ancestor): New static functions. + (add_using_namespace, ambiguous_decl): Likewise. + (lookup_using_namespace): New support function for lookup_name. + (qualified_lookup_using_namespace): New support function for + do_scoped_id and lookup_namespace_name. + (get_namespace_id): Mark as obsolete. + (current_namespace_id): Likewise. + (do_namespace_alias): Implement. + (do_using_directive): Implement as call to add_using_namespace. + * decl.c (binding_for_name): New function. + (push_namespace, pop_namespace): Implement. + (push_decl): Don't install a FUNCTION_DECL in the global branch. + (lookup_namespace_name): Implement using qualified lookup. + (lookup_name_real): For global scoping, lookup in + global_namespace. For namespace scoping, lookup in given + namespace. For unscoped lookup, iterate over namespace, + considering using directives. + (init_decl_processing): Initialize global_namespace. + (grokvardecl): Build assembler name as static name for globals. + (grokdeclarator): Remove old namespace mangling. + (xref_tag): When installing a global binding for the + tag, make sure we have an identifier. + * method.c (build_overload_nested_name): Mangle namespaces. + (build_qualified_name): Likewise. + (build_decl_overload_real): Likewise. + * lex.c (build_lang_decl): Set namespace for new declaration to + current_namespace. + (do_scoped_id): Find global names in global or current + namespace, or using qualified namespace lookup, depending on + context. + * init.c (build_member_call): When scope is namespace, use + build_x_function_call instead. + (build_offset_ref): When scope is namespace, collapse processing + to lookup_namespace_name instead. + * error.c (dump_decl): Support NAMESPACE_DECL. + * decl.c (pushdecl): Bind globals to current namespace. + (push_overloaded_decl): Likewise. + (lookup_tag): Likewise. + (lookup_name_current_level): Likewise. + (xref_tag): Likewise. + (start_function): Likewise. + * lex.c (do_identifier): Likewise. + (identifier_typedecl_value): Likewise. + (real_yylex): Likewise. + * method.c (do_inline_function_hair): Likewise. + * parse.y (unscoped): Likewise. + * pt.c (check_explicit_specialization): Likewise. + (lookup_template_class): Likewise. + * rtti.c (call_void_fn): Likewise. + * sig.c (build_sigtable): Likewise. + * ptree.c (lang_print_xnode): New function. + +Tue Feb 24 01:40:24 1998 Jason Merrill + + * pt.c (instantiate_class_template): Don't instantiate if pedantic + and the args use template parms. + + * pt.c (push_tinst_level): If the instantiation uses template parms, + fail silently. + * decl.c (xref_basetypes): Do call complete_type for basetypes + that involve template parameters. + +Tue Feb 24 00:36:43 1998 Jason Merrill + + * typeck2.c (process_init_constructor): Fix labeled init check. + +Mon Feb 23 05:08:55 1998 Jason Merrill + + * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS + argument to tsubst and friends. + + * pt.c (tsubst, FUNCTION_DECL): Tidy. + + * typeck.c (build_x_function_call): Handle static member function + templates like non-templates. Handle friend templates like normal + function templates. + * pt.c (tsubst, *_PARM): Don't use orig_level. + (get_bindings): Don't call add_to_template_args. + (instantiate_template): Likewise. + (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate. + * ptree.c (print_lang_type): Print index/level for template parms. + +Mon Feb 23 02:52:29 1998 Mark Mitchell + + * Make-lang.in (cc1plus): Note that cc1plus depends on + cp/cp-tree.h and cp/cp-tree.def. + + * cp-tree.def (TEMPLATE_CONST_PARM): Remove. + (TEMPLATE_PARM_INDEX): New tree code, used to indicate a + position in a template parameter list. + * cp-tree.h (template_parm_index): New structure, used as the tree + structure for a TEMPLATE_PARM_INDEX. + (TEMPLATE_PARM_IDX): New macro. + (TEMPLATE_PARM_LEVEL): Likewise. + (TEMPLATE_PARM_DESCENDANTS): Likewise. + (TEMPLATE_PARM_ORIG_LEVEL): Likewise. + (TEMPLATE_PARM_DECL): Likewise. + (TEMPLATE_TYPE_PARM_INDEX): Likewise. + (TEMPLATE_TYPE_ORIG_LEVEL): Likewise. + (TEMPLATE_TYPE_DECL): Likewise. + (TEMPLATE_CONST_IDX): Remove. + (TEMPLATE_CONST_LEVEL): Likewise. + (TEMPLATE_CONST_SET_INFO): Likewise. + (TEMPLATE_TYPE_SET_INFO): Likewise. + (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX + node. + (TEMPLATE_TYPE_LEVEL): Likewise. + * decl.c (decls_match): Call comp_template_parms, rather than + expanding it inline. + (duplicate_decls): If two template declarations are being merged, + then their TEMPLATE_INFOs should be merged as well. + (grokfndecl): Save template-id information when declaring a friend + with explicit template arguments. Pass arguments to + check_explicit_specialization via correct convention; at some + point check_explicit_specialization changed, but these call-sites + did not. + (grokdeclarator): Tidy up slightly. + * decl2.c (check_classfn): Tidy up slightly. Don't assume that + two template functions with the same DECL_ASSEMBLER_NAME the same, + since the names are not yet mangled. + * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of + TEMPLATE_CONST_PARM. + (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the + decl for a non-type parameter, rather than printing `'. + * friend.c (is_friend): Handle TEMPLATE_DECL friends. + (do_friend): Deal with template friends. + * lex.c (do_pending_inlines): Call + maybe_begin_member_template_processing, rather than + conditionally calling begin_member_template_processing. + (process_next_inline): Likewise. Call + maybe_end_member_template_processing, rather than + conditionally calling end_member_template_processing. + (do_pending_defargs): Likewise. + (do_identifier): Use TEMPLATE_PARM_INDEX instead of + TEMPLATE_CONST_PARM. + * method.c (build_mangled_template_parm_index): New function. + (build_overload_value): Use it. + (build_overload_name): Likewise. + * pt.c (finish_member_template_decl): Allow friend declarations. + (template_class_depth): New function. + (is_member_template): Rename, and modify, to become... + (is_member_or_friend_template): New function. + (end_member_template_processing): Rename, and modify, to become... + (maybe_end_member_template_processing). + (build_template_parm_index): New function. + (reduce_template_parm_level): New function. + (process_template_parm): Modify to use build_template_parm_index. + (push_template_decl): Deal with friend templates. + (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of + TEMPLATE_CONST_PARM. + (tsubst_friend_function): New function. + (instantiate_class_template): Generate the DECL_FRIENDLIST + for a new instantiation by using tsubst_friend_function rather + than just tsubst. + (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL. + Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the + appropriate new macros. Use reduce_template_parm_level to + generate lower-level template parameters. Handle tsubst'ing into + TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget + to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created + templates. Similarly for the template parameters for a new + template. + (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead + of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them. + (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM. + (get_bindings): Call add_to_template_args if necessary. + (instantiate_decl): Handle instantiations of friend templates. + * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a + TEMPLATE_TYPE_PARM as a list of fields; it's not! + * spew.c (yylex): Do a little manual constant propagation to + clarify the code. + +Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com) + + * error.c: Include sys/types.h. + +Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com) + + * method.c (build_mangled_name): Start CPP directives in column zero. + +Thu Feb 19 10:36:48 1998 Jason Merrill + + * typeck2.c (process_init_constructor): Sorry about non-trivial + labeled initializers. + * parse.y (initlist): Re-enable labeled initializers. + +Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij + + * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm, + all callers changed. Rely on the new parameter instead of arg + being a TREE_LIST when determine whether we are working inside + template template parameter. Clean up is_type test. + +Thu Feb 19 10:04:12 1998 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT. + * typeck2.c (initializer_constant_valid_p): Allow conversions + between pointers and references. + +1998-02-19 Brendan Kehoe + + * typeck.c (build_unary_op): Only warn about incr/decr a pointer + if pedantic || warn_pointer_arith. + +Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij + + * pt.c (unify): Handle TEMPLATE_DECL. + +1998-02-18 Brendan Kehoe + + * cp-tree.h (strip_attrs): Remove decl. + +1998-02-18 Doug Evans + + * decl.c (duplicate_decls): Call merge_machine_decl_attributes. + Update olddecl's attributes too. + (strip_attrs): Remove function. + * typeck.c (common_type): Call merge_machine_type_attributes. + +Tue Feb 17 14:07:52 1998 Mark Mitchell + + * parse.y (initdcl0_innards): New grammar symbol. + (nomods_initdecls, nomods_initdcl0): Change type from itype to + none, since the resulting value is never used. + (parse_decl): New function. + (datadef): Remove redundant actions. + (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards. + * parse.c: Regenerated. + +Tue Feb 17 11:54:16 1998 Jason Merrill + + * parse.y (simple_stmt): Use getdecls() to check for decl. + +Sat Feb 14 11:50:51 1998 Manfred Hollstein + + * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New + macros. + (c++.install-common): Install c++filt properly as native or as cross + variant. + (c++.uninstall): Add c++filt. + +Fri Feb 13 14:55:37 1998 Jason Merrill + + * call.c (standard_conversion): Fix multi-level ptr conversions. + +Fri Feb 13 14:06:22 1998 Mike Stump + + * init.c (build_new): Propagate error_mark_node up. + +Fri Feb 13 13:24:32 1998 Jason Merrill + + * parse.y (simple_stmt): If the condition isn't a declaration, + start the controlled block after the test. + +Fri Feb 13 02:26:10 1998 Andreas Schwab + + * call.c (build_over_call): Convert builtin abs, labs and fabs to + tree-codes. + * decl.c (init_decl_processing): Re-enable abs, labs and fabs as + builtins. + +Fri Feb 13 01:36:42 1998 Jason Merrill + + * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV. + +Fri Feb 13 00:21:59 1998 Jason Merrill + + * cp-tree.h: Add access_protected_virtual_node. + * class.c (init_class_processing): Initialize it. + * decl.c (xref_basetypes): Use it. + * parse.y (base_class_access_list): Likewise. + + * Make-lang.in (DEMANGLER_PROG): Add $(exeext). + (c++.install-common): Install c++filt. + +Thu Feb 12 12:46:51 1998 Benjamin Kosnik + + * decl.c (shadow_tag): Give error for typedef-ing built-in types. + +Wed Feb 11 23:28:05 1998 Mark Mitchell + + * call.c (reference_binding): Use comptypes when comparing + TYPE_MAIN_VARIANTS to handle non-canonical array/index types. + +Wed Feb 11 16:42:04 1998 Mark Mitchell + + * tree.c (is_overloaded_fn): Use really_overloaded_fn. + (really_overloaded_fn): Move check here from is_overloaded_fn. + (get_first_fn): Use really_overloaded_fn and is_overloaded_fn. + +Wed Feb 11 15:54:18 1998 Mark Mitchell + + * typeck.c (build_ptrmemfunc): Type-check pointer-to-member + conversions. + +Mon Feb 9 22:23:31 1998 Mark Mitchell + + * cp-tree.h (push_template_decl): Return the decl passed in, or an + equivalent duplicate. + * decl.c (pushtag): Use the return value from push_template_decl. + (duplicate_decls): When duplicating a template declaration, merge + the DECL_TEMPLATE_RESULTs as well. + (make_implicit_typename): Don't try to dive into typename types to + find a context for making a new implicit typename. + (start_decl): Use the return value from push_template_decl. + (grokdeclarator): Complain about declarations list `const operator + int'. Since we don't correctly handle in-class initializations of + non-static data members, complain about this (now illegal) + practice. Issue an error for initializations of non-const statics + since that is illegal as well, and since we don't handle that case + correctly either. + (start_function): Use the return value from push_template_decl. + (start_method): Likewise. + * decl2.c (grokfield): Likewise. Since the change to + grokdeclarator ensures that all initialized fields are in fact + static, remove a redundant test for TREE_PUBLIC. + * parse.y (initlist): Disable labeled initializers since they do + not work as per the documentation, and since they do not use the + same syntax as the C front end. + * pt.c (push_template_decl): Return the decl passed in, or an + equivalent duplicate. + (lookup_template_class): When searching in a nested context, + use the right arguments. + (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL. + * typeck.c (build_component_ref): Assign the correct type to the + result of build_vfn_ref. + +Tue Feb 10 23:56:46 1998 Jason Merrill + + * pt.c (convert_nontype_argument): Fix typo. + (check_explicit_specialization): Allow old-style specialization + of class template members. + +Tue Feb 10 20:36:52 1998 Jason Merrill + Manfred Hollstein + + * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead + when deciding to override DECL_ASSEMBLER_NAME. + +Tue Feb 10 15:30:55 1998 Andrew MacLeod + + * decl2.c (lang_f_options): Add -fsquangle to option processing list. + * cp-tree.h (flag_do_squangling): Add declaration. + * lang-options.h: Add -fsquangle and -fno-squangle. + * method.c: Add macros and static variables for squangling. + (build_overload_name): Rename to build_mangled_name, add logic for B + compression, and split into process_modifiers and + process_overload_item. + (process_modifiers): New function, to handle constant, reference, + and pointer types. + (process_overload_item): New function, handles issue of type codes. + (build_overload_name): New function, start squangling and call + build_mangled_name. + (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline. + (start_squangling): New function to initialize squangling structs. + (end_squangling): New function to destroy squangling structs. + (nrepeats): Rename variable to Nrepeats. + (issue_nrepeats): New function for issuing 'n' type repeats. + (check_ktype): New function to check for type K name compression. + (build_overload_nested_name): Add a check for K name compression. + (build_qualified_name): Add a check for K name compression and don't + use DECL_ASSEMBLER_NAME when squangling is on. + (check_btype): New function, checks for B type compression. + (build_static_name, build_decl_overload_real): Initiate squangling. + (build_typename_overload, build_overload_with_type): Initiate + squangling + +Sun Feb 8 23:47:38 1998 scott snyder + + * method.c (make_thunk): Avoid name buffer overflow. + +Sat Feb 7 16:48:54 1998 Jason Merrill + + * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we + don't define them yet. + + * parse.y (nomods_initdcl0): Add constructor_declarator case. + +Fri Feb 6 21:32:25 1998 Richard Kenner + + * config-lang.in (diff_excludes): Use basename only. + +Thu Feb 5 19:10:40 1998 Jason Merrill + + * tinfo2.cc: Add tinfo for signed char. + +Thu Feb 5 14:38:23 1998 Mike Stump + + * search.c (compute_access): Handle protected constructors in derived + classes as accessible. + +Wed Feb 4 01:26:49 1998 Jason Merrill + + * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code): + Call convert_from_reference sooner. + +Tue Feb 3 23:50:52 1998 Mark Mitchell + + * cvt.c (ocp_convert): Obtain the constant values from constant + decls even if the destination type is the same as the type of the + decl. + + * decl2.c (finish_file): Make sure that static inlines with + definitions are not marked DECL_EXTERNAL before returning. + +Tue Feb 3 22:43:42 1998 Jason Merrill + + * decl.c: Lose arg_looking_for_template. + (lookup_name_real): Likewise. + * parse.y: Lose processing_template_arg, template_arg1. + (primary): Likewise. + * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too. + +Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij + + * error.c (dump_decl): Fix type of default arguments for template + template parameters and nontype template parameters. + * parse.y (template_parm): Handle invalid default template + template arguments here. + + * parse.y (template_parm): Use template_arg instead of PTYPENAME + for default template template argument. + * pt.c (coerce_template_parms): Merge default template argument + codes. Can treat RECORD_TYPE as template name if it is implicitly + created. Fix argument index in error message. + * typeck.c (comptypes): Merge template argument comparison codes in + TEMPLATE_TEMPLATE_PARM and RECORD_TYPE. + +Tue Jan 6 01:42:44 1998 Mumit Khan + + * lex.c (file_name_nondirectory): Also check for '/'. + +Mon Feb 2 11:24:22 1998 Mark Mitchell + + * parse.y (primary): Deal with statement-expressions in + templates. + * pt.c (tsubst_copy): Handle BIND_EXPR. + * tree.c (mapcar): Likewise. + + * call.c (add_template_candidate_real): Pass extra parameter to + fn_type_unification. + * cp-tree.h (fn_type_unification): Add parameter. + * pt.c (fn_type_unification): Add additional parameter to deal with + static member functions. + (get_bindings): Deal with static member functions. + + * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro. + (revert_static_member_fn): Declare. + * decl.c (revert_static_member_fn): Remove declaration. Change + linkage from internal to external. + (cp_finish_decl): Deal with virtual functions in classes local to + template functions. + * decl2.c (finish_file): Don't forget to emit increment/decrement + expressions in initializers for file-scope variables. + * parse.y (typename_sub2): If the typename doesn't names a + template, rather than a type, issue an error message. + * pt.c (check_explicit_specialization): Handle specializations of + static member functions. + (coerce_template_parms): Handle offset references to lists of + member functions. + * search.c (note_debug_info_needed): Don't crash when handed a + type which is being defined. + * typeck.c (complete_type): Don't crash when handed NULL_TREE; + that can happen with some illegal code. + +Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi + + * call.c (user_harshness): Initialize `code' to 0. + (build_method_call): Initialize `candidates', `cp' and `len' to 0. + (null_ptr_cst_p): Add parentheses around && within ||. + (standard_conversion): Likewise. + (z_candidate): Likewise. + (build_user_type_conversion_1): Initialize `args' to NULL_TREE. + (build_object_call): Likewise for `mem_args'. + (build_new_op): Likewise for `mem_arglist'. Add `return' from + default case in enumeration switch. + + * class.c (build_vtable_entry): Add explicit braces to avoid + ambiguous `else'. + (build_class_init_list): Likewise. + (finish_struct_1): Initialize `width' to 0. + (instantiate_type): Initialize `name' to NULL_TREE. Add + explicit braces to avoid ambiguous `else'. + + * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous + `else'. + + * decl.c (grok_reference_init): Eliminate unused parameter, all + callers changed. + (record_builtin_type): Initialize `tdecl' to NULL_TREE. + (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE. + (cp_finish_decl): Initialize `ttype' to NULL_TREE. + (grokdeclarator): Add parentheses around && within ||. Add + explicit braces to avoid ambiguous `else'. + (grokparms): Initialize `type' to NULL_TREE. + (xref_tag): Remove unused label `just_return'. + (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE. + (finish_function): Initialize `cond' and `thenclause' to NULL_TREE. + (hack_incomplete_structures): Add parentheses around assignment + used as truth value. + + * decl2.c (coerce_delete_type): Hide definition of `e3'. + + * error.c: Include . + (dump_expr): Change the type of `i' to size_t. Remove unused + label `error'. + + * except.c (init_exception_processing): Remove unused variable `d'. + (expand_throw): Likewise for `label'. + + * friend.c (add_friends): Add explicit braces to avoid ambiguous + `else'. + + * init.c (sort_member_init): Initialize `last_field' to NULL_TREE. + (sort_base_init): Likewise for `binfo'. + (expand_member_init): Likewise for `rval'. + (build_member_call): Add parentheses around assignment used as + truth value. + (build_offset_ref): Add explicit braces to avoid ambiguous `else'. + (build_new): Initialize `nelts' to NULL_TREE. Initialize + `old_immediate_size_expand' to 0. + (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE. + (build_vec_delete_1): Remove unused variable `block'. + (expand_vec_init): Initialize `itype' to NULL_TREE. + + * lex.c: Include if we don't have . Protect + declaration of `index' and `rindex' with autoconf macros. + (reinit_parse_for_expr): Remove unused variables + `look_for_semicolon' and `look_for_lbrac'. + (cons_up_default_function): Initialize `args' to NULL_TREE. + (readescape): Initialize `firstdig' to 0. + (real_yylex): Add parentheses around assignment used as truth value. + + * method.c: Include if we don't have . + Protect declaration of `index' with autoconf macro. + + * parse.y (primary): Add explicit braces to avoid ambiguous `else'. + Initialize `type' to NULL_TREE. + (structsp): Remove unused variable `id'. + + * pt.c (coerce_template_parms): Add explicit braces to avoid + ambiguous `else'. + (lookup_template_class): Initialize `template' to NULL_TREE. + (instantiate_class_template): Remove unused variable `name' and `e'. + (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE. + (do_poplevel): Initialize `saved_warn_unused' to 0. + (type_unification): Remove unused varable `parm'. + (unify): Likewise for `j'. + + * repo.c (init_repo): Add parentheses around assignment used as + truth value. + (finish_repo): Remove unused varable `p'. + + * search.c (get_binfo): Initialize `type' to NULL_TREE. + (get_base_distance): Likewise. + (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path' + and `new_v' to NULL_TREE. + (lookup_fnfields): Likewise for `rval_binfo_h'. + (breadth_first_search): Add parentheses around assignment used as + truth value. + (get_template_base): Initialize `type' to NULL_TREE. + + * sig.c (append_signature_fields): Initialize `last_mfptr' to + NULL_TREE. + (build_signature_table_constructor): Likewise for + `last_rhs_field', `pfn' and `vt_off'. + (build_sigtable): Likewise for `init'. + + * tree.c (break_out_calls): Initialize `t2' to NULL_TREE. + (propagate_binfo_offsets): Likewise for `delta'. + (hash_tree_cons): Initialize hashcode to 0. + (can_free): Likewise for `size'. + (cp_tree_equal): Add explicit braces to avoid ambiguous `else'. + + * typeck.c (convert_sequence): Hide prototype. + (common_type): Add explicit braces to avoid ambiguous `else'. + (comp_target_types): Likewise. + (build_x_function_call): Initialize `ctypeptr' to NULL_TREE. + (build_function_call_real): Add explicit braces to avoid ambiguous + `else'. + (convert_arguments): Initialize `called_thing' to 0. + (convert_for_initialization): Initialize `savew' and `savee' to 0. + + * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0. + (digest_init): Initialize `old_tail_contents' to NULL_TREE. + (build_x_arrow): Likewise for `last_rval'. + + * xref.c (GNU_xref_decl): Initialize `cls' to 0. + +Sun Feb 1 12:45:34 1998 J"orn Rennecke + + * decl.c (init_decl_processing): Use set_sizetype. + * decl2.c (sizetype): Don't declare. + * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype. + (c_sizeof_nowarn, build_binary_op_nodefault): Likewise. + (build_component_addr, unary_complex_lvalue): Likewise. + * rtti.c (expand_class_desc): Likewise. + * class.c (get_vfield_offset): Likewise. + +Thu Jan 29 10:39:30 1998 Mark Mitchell + + * pt.c (convert_nontype_argument): Move check for is_overloaded_fn + early to avoid bogus error. Handle overloaded function + names provided as template arguments correctly. + (coerce_template_parms): Don't mishandle overloaded functions when + dealing with template template parameters. + (lookup_template_class): Issue an error message, rather than + crashing, when the TYPE_DECL provided is not a template type. + +Wed Jan 28 23:14:44 1998 Jason Merrill + + * class.c (instantiate_type): Don't just return a known type if + it's wrong. + +Wed Jan 28 11:04:07 1998 Mark Mitchell + + * class.c (instantiate_type): Remove handling of FUNCTION_DECL + since that code could never be reached. + + * error.c (dump_decl): Avoid aborting in the midst of printing an + error message about an illegal template declaration. + + * parse.y (structsp): Print an error message, rather than crashing, + when a class-head does not name a class. + + * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE + template arguments as a g++ extension. + + * cp-tree.def (ALIGNOF_EXPR): New tree code. + * decl2.c (grok_alignof): If processing_template_decl, just store + the expression. + * typeck.c (c_alignof): Likewise. + * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR. + * error.c (dump_expr): Likewise. + * pt.c (tsubst_copy): Likewise. + * tree.c (cp_tree_equal): Likewise. + * pt.c (uses_template_parms): Correctly determine whether or not a + SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant + folding can be done. + + * cp-tree.h (grok_enum_decls): Remove type parameter. + * decl.c (grok_enum_decls): Likewise. + * decl2.c (grok_x_components): Call grok_enum_decls + unconditionally, since it will do nothing if there is no + current_local_enum. Use the new calling sequence. + * pt.c (tsubst_enum): Use the new calling sequence for + grok_enum_decls. + + * decl.c (start_function): Make member functions of local classes + in extern inline functions have comdat linkage here... + (grokdeclarator): Rather than here. + +Wed Jan 28 10:55:47 1998 Jason Merrill + + * pt.c (convert_nontype_argument): Use decl_constant_value. + +Tue Jan 27 16:42:21 1998 Mark Mitchell + + * call.c (add_template_candidate_real): New function. + (add_template_candidate): Use it. + (add_template_conv_candidate): Likewise. + (joust): Pass extra argument to more_specialized. + * class.c (instantiate_type): Handle a single FUNCTION_DECL. + (is_local_class): Remove. + (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG. + * cp-tree.h (is_local_class): Remove. + (perform_array_to_pointer_conversion): Likewise. + (finish_member_template_decl): Add. + (check_explicit_specialization): Return a tree, not an int. + (more_specialized): Take additional argument. + (get_bindings): Likewise. + (TI_PENDING_SPECIALIZATION_FLAG): New macro. + * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes. + (perform_array_to_pointer_conversion): Remove. + * decl.c (saved_scope): Add processing_specialization, + processing_explicit_instantiation fields. + (maybe_push_to_top_level): Save them. + (pop_from_top_level): Restore them. + (grokfndecl): Use new return value from + check_explicit_specialization. + (start_decl): Don't check flag_guiding_decls before pushing + decls. + (cp_finish_decl): Remove previous (bogus) change. + (grok_declarator): Use decl_function_context rather than + is_local_class. + * decl2.c (finish_file): Pass extra argument to get_bindings. + (build_expr_from_tree): Let build_x_component_ref check + validity of arguments rather than doing it here. + * lex.c (cons_up_default_function): Remove code fooling with + processing_specialization, processing_explicit_instantiation + flags, as that is now done in {maybe_push_top,pop_from}_top_level. + * method.c (build_overload_identifier): Mangle local classes in + template functions correctly. + * parse.y (finish_member_template_decl): Move to pt.c. + * pt.c (finish_member_template_decl): Moved here from parse.y. + (print_candidates): New function. + (determine_specialization): Change interface. Properly look for + most specialized versions of template candidates. + (check_explicit_specialization): Fully process explicit + instantiations. + (push_template_decl): Avoid looking at CLASSTYPE fields in + FUNCTION_DECLS. + (determine_overloaded_function): Remove. + (convert_nontype_argument): Change name from + convert_nontype_parameter. Use determine_overloaded_function + instead of instantiate_type. + (mangle_class_name_for_template): Handle type contexts as well as + function contexts. + (classtype_mangled_name): Likewise. + (lookup_template_class): Likewise. + (tsubst): Likewise. + (more_specialized): Take explicit template arguments as a + parameter. + (most_specialized): Likewise. + (get_bindings): Likewise. Check that return types match before + proclaiming a function a match. + (do_decl_instantiation): Remove code searching for function to + instantiate; that is now done in check_explicit_specialization. + (add_maybe_template): Pass extra argument to get_bindings. + * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify + implementation. + * typeck.c (build_component_ref): Check for invalid arguments. + +Tue Jan 27 01:44:02 1998 Jason Merrill + + * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that + return_target and call_target are equivalent. + + * pt.c (type_unification_real): Just accept function parms that + don't use any template parms. + +Sun Jan 25 03:30:00 1998 Jason Merrill + + * decl.c (cp_finish_decl): When bailing on a comdat variable, also + unset DECL_NOT_REALLY_EXTERN. + + * parse.y (typename_sub*): Fix std::. + +Sat Jan 24 12:13:54 1998 Jason Merrill + + * error.c (dump_decl): Fix type default template args. + (dump_type): Hand TEMPLATE_DECL off to dump_decl. + +Fri Jan 23 18:34:37 1998 Mumit Khan + + * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined. + (file_name_nondirectory): Use. + +Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij + + * pt.c (coerce_template_parms): Don't access elements of ARGLIST + that are not really present. Substitute default arguments in + template template arguments. Correctly convert TEMPLATE_DECL to + TEMPLATE_TEMPLATE_PARM. + (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM + are no longer treated specially here. + * parse.y (template_template_parm): Fix copy error. + * decl.c (grokdeclarator): Warn about missing `typename' for nested + type created from template template parameters. + * parse.y (bad_parm): Likewise + + * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM. + (push_nested_class): Likewise. + * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code. + * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro. + (copy_template_template_parm): Declare. + * decl.c (arg_looking_for_template): New variable. + (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM. + Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM + node if arg_looking_for_template is nonzero. + (pushdecl): Handle TEMPLATE_TEMPLATE_PARM. + (grok_op_properties, xref_tag, xref_basetypes): Likewise. + (grokdeclarator): Handle TEMPLATE_DECL. + * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM. + * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM. + (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM. + (dump_decl): Handle unnamed template type parameters. + Handle template template parameters. + (dump_function_name): Handle template template parameters. + * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef): + Handle TEMPLATE_TEMPLATE_PARM. + * method.c (build_template_template_parm_names): New function. + (build_template_parm_names): Handle TEMPLATE_DECL. + (build_overload_nested_name, build_overload_name): + Handle TEMPLATE_TEMPLATE_PARM. + * parse.y (maybe_identifier): New nonterminal. + (template_type_parm): Use it. + (template_template_parm, template_arg1): New nonterminal. + (template_parm): Add template_template_parm rules. + (template_arg): Set processing_template_arg. + (template_arg1): Rules moved from template_arg. + (primary, nonnested_type): Set arg_looking_for_template if we are + processing template arguments. + * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL. + (process_template_parm): Handle template template parameters. + (coerce_template_parms, comp_template_args): Likewise. + (mangle_class_name_for_template, lookup_template_class): Likewise. + (uses_template_parms): Handle TEMPLATE_DECL and + TEMPLATE_TEMPLATE_PARM. + (current_template_args): Handle TEMPLATE_DECL. + (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM. + * search.c (dfs_walk, dfs_record_inheritance): + Handle TEMPLATE_TEMPLATE_PARM. + * tree.c (copy_template_template_parm): New function. + (mapcar): Handle TEMPLATE_TEMPLATE_PARM. + * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM. + +Mon Jan 19 22:40:03 1998 Mark Mitchell + + * decl.c (start_decl): Don't allow duplicate definitions of static + data members. + + * call.c (build_user_type_conversion_1): Handle user-defined + template conversion operators correctly. + + * decl2.c (build_expr_from_tree): Issue an error message if the + object in a COMPONENT_REF is a TEMPLATE_DECL. + + * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs. + + * class.c (is_local_class): New function. + * cp-tree.h (is_local_class): Declare it. + (last_tree): Likewise. + (begin_tree): Likewise. + (end_tree): Likewise. + (lookup_template_class): Change prototype. + * decl.c (cp_finish_decl): Check for NULL where necessary. + Consider FUNCTION_DECLS to declare objects with top-level binding, + when calling make_decl_rtl. + (grokdeclarator): Give members of local classes internal linkage. + (start_function): Remove declaration of last_tree. + (finish_function): Set flag_keep_inline_functions around call to + rest_of_compilation if we are processing a member function in a + local class. + (start_method): Call push_template_decl for member functions of + local classes in template functions. + * decl2.c (import_export_decl): Don't give external linkage to + instantiations of templates with internal linkage. + * parse.y (last_tree): Remove declaration. + (template_type): Pass extra parameter to lookup_template_class. + (self_template_type): Likewise. + (structsp): Move call to reset_specialization into left_curly. + (left_curly): Call reset_specialization, and begin_tree. + * pt.c (saved_trees): New variable. + (mangle_class_name_for_template): Change prototype. Use + additional function context to name local classes in templates + correctly. + (classtype_mangled_name): Pass the context. + (push_template_decl): Handle local classes and templates, and + member functions for such classes. + (convert_nontype_parameter): Fix handling of pointer-to-member + constants. + (lookup_template_class): Handle local classes in templates. + (tsubst): Likewise. Don't assume that template instantiations + have external linkage; pay attention to the template declaration. + (mark_decl_instantiated): Likewise. + (begin_tree): New function. + (end_tree): Likewise. + + * decl.c (xref_basetypes): Don't call complete_type for basetypes + that involve template parameters; that can lead to infinite + recursion unnecessarily. + + * pt.c (register_specialization): Do not register specializations + that aren't ready to be registered yet. + (check_explicit_specialization): Handle explicit specialization of + constructors and destructors. + (build_template_decl): New function. + (push_template_delc): Handle out-of-class specializations of + member templates. + + * pt.c (check_explicit_specialization): Set up the template + information before registering the specialization. + (coerce_template_parms): Fix thinko. + (tsubst): Handle specializations of member templates correctly. + + * class.c (finish_struct_methods): Remove calls to + check_explicit_specialization from here. + (finish_struct): And insert them here. + * cp-tree.h (perform_qualification_conversions): New function. + (perform_array_to_pointer_conversion): Likewise. + (begin_explicit_instantiation): Likewise. + (end_explicit_instantiation): Likewise. + (determine_specialization): Renamed from + determine_explicit_specialization. + (comp_template_parms): New function. + (processing_explicit_instantiation): New variable. + * cvt.c (perform_qualification_conversions): New function. + (perform_array_to_pointer_conversion): Likewise. + * decl.c (duplicate_decls): Don't consider template functions + alike unless they have the same parameters. Refine handling of + instantiation/specialization mismatches. + (start_decl): Don't call pushdecl for template specializations, + since they don't affect overloading. + (start_function): Likewise. + (grokfndecl): Call check_explicit_specialization a little later. + Don't call duplicate_decls for memberm template specializations. + (grokdeclarator): Don't update template_count for classes that are + themselves specializations. Remove use of `2' as parameter to + grokfndecl since that value isn't used. + * lex.c (cons_up_default_function): Save and restore + processing_explicit_instantiation around calls to grokfield. + * parse.y (finish_member_template_decl): New function. + (component_decl_1): Use it. + (fn.def2): Likewise. + (template_arg_list_opt): New nonterminal. + (template_type): Use it. + (self_template_type): Likewise. + (template_id): Likewise. + (object_template_id): Likewise. + (notype_template_declarator): Likwise. + (begin_explicit_instantiation): Likewise. + (end_explicit_instantiation): Likewise. + (explicit_instantiation): Use them. + * pt.c (coerce_template_parms): Add parameters. + (processing_explicit_instantiation): New variable. + (convert_nontype_parameter): New function. + (determine_overloaded_function): Likewise. + (begin_explicit_instantiation): Likewise. + (end_explicit_instantiation): Likewise. + (retrieve_specialization): Likewise. + (register_specialization): Likewise. + (processing_explicit_specialization): Removed. + (determine_specialization): Handle specializations of member + functions of template class instantiations. + (check_explicit_specialization): Refine to conform to standard. + (comp_template_parms): New function. + (coerce_template_parms): Call convert_nontype_parameter. + (tsubst): Refine handling of member templates. Use + register_specialization. + (instantiate_template): Use retrieve_specialization. + (do_decl_instantiation): Likewise. + (instantiate_decl): Likewise. + (type_unification): Improve handling of explicit template + arguments. + * tree.c (mapcar): Return error_mark_node, rather than aborting, + on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS. + * typeck.c (build_unary_op): Call determine_specialization, rather + than determine_explicit_specialization. + +Mon Jan 19 13:18:51 1998 Jason Merrill + + * cvt.c (build_up_reference): A TARGET_EXPR has side effects. + +Fri Jan 16 11:40:50 1998 Bruno Haible + + * error.c (dump_decl): For enum tags, output the tag, not its value. + +1998-01-13 Brendan Kehoe + + * decl.c (init_decl_processing): Only call init_rtti_processing + FLAG_RTTI is set. + +Mon Jan 12 01:35:18 1998 Jason Merrill + + * init.c (build_new_1): Split out from build_new. + (build_new): Just return a NEW_EXPR. + * expr.c (cplus_expand_expr): Handle NEW_EXPR. + + * decl2.c (get_temp_regvar): Tweak. + + * cp-tree.h (TREE_CALLS_NEW): Comment out. + * class.c (resolves_to_fixed_type_p): Remove use. + * method.c (build_opfncall): Likewise. + * call.c (build_new_op): Likewise. + +Wed Jan 7 23:47:13 1998 Jason Merrill + + * exception.cc (__eh_alloc, __eh_free): New fns. + (__cp_push_exception, __cp_pop_exception): Use them. + (__uncatch_exception): Call terminate here if no exception. + * except.c (build_terminate_handler): New fn. + (expand_start_catch_block): Use it. + (expand_exception_blocks): Likewise. + (alloc_eh_object): New fn. + (expand_throw): Use it. Protect exception init with terminate. + * typeck.c (build_modify_expr): Remove code that ignores trivial + methods. + diff --git a/gcc/cp/ChangeLog-1999 b/gcc/cp/ChangeLog-1999 new file mode 100644 index 00000000000..b89cd350ae9 --- /dev/null +++ b/gcc/cp/ChangeLog-1999 @@ -0,0 +1,6787 @@ +1999-12-31 Mark Mitchell + + * cp-tree.h (VF_NORMAL_VALUE): Remove. + * class.c (struct base_info): Remove vfield, vfields, and rtti. + (set_primary_base): New function, split out from ... + (finish_base_struct): ... here. Rename to ... + (determine_primary_base): ... this. Simplify. + (create_vtable_ptr): Tweak accordingly. + (finish_struct_1): Simplify. + + * cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation. + (CLASSTYPE_N_BASECLASSES): Likewise. + (BINFO_FOR_VBASE): New macro. + (get_vbase_types): Change prototype. + * class.c (build_vbase_path): Use BINFO_FOR_VBASE. + (prepare_fresh_vtable): Likewise. + (finish_vtbls): Likewise. + (get_class_offset_1): Likewise. + (modify_all_indirect_vtables): Likewise. + (build_vbase_pointer_fields): Likewise. + * decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here. + * init.c (sort_base_init): Use BINFO_FOR_VBASE. + (expand_member_init): Likewise. + * search.c (get_base_distance): Likewise. + (lookup_field_queue_p): Likewise. + (virtual_context): Likewise. + (get_vbase_types): Don't return a value. Set + CLASSTYPE_VBASECLASSES here. + * typeck.c (get_delta_difference): Use BINFO_FOR_VBASE. + +1999-12-30 Mark Mitchell + + * class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS. + +1999-12-29 Mark Mitchell + + * class.c (create_vtable_ptr): Put the vtable at the beginning of + the class, not the end, in the new ABI. + * tree.c (propagate_binfo_offsets): Do the right thing for the new + ABI. + +1999-12-29 Mark Mitchell + + * cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy. + (CLASSTYPE_NEARLY_EMPTY_P): New macro. + * class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P. + (check_field_decls): Likewise. + (check_bases_and_members): Likewise. + +1999-12-28 Mark Mitchell + + * cp-tree.h (do_inline_function_hair): Remove. + * class.c (layout_class_type): New function, split out from + finish_struct_1. + (fixup_pending_inline): Likewise. + (fixup_inline_methods): New function. + * method.c (fixup_pending_inline): Remove. + (do_inline_function_hair): Likewise. + + * decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the + new ABI. + + * cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals. + (CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ... + (CLASSTYPE_PURE_VIRTUALS): ... this. + (lang_decl_flags): Replace abstract_virtual with pure_virtual. + (DECL_ABSTRACT_VIRTUAL_P): Rename to ... + (DECL_PURE_VIRTUAL_P): ... this. + (get_abstract_virtuals): Rename to ... + (get_pure_virtuals): ... this. + * call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with + DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with + CLASSTYPE_PURE_VIRTUALS. + * class.c (build_vtable_entry): Likewise. + (finish_struct_bits): Likewise. Call get_pure_virtuals, not + get_abstract_virtuals. + (build_vtbl_initializer): Likewise. + (override_one_vtable): Likewise. + (check_methods): Likewise. + * decl.c (duplicate_decls): Likewise. + (redeclaration_error_message): Likewise. + (lang_mark_tree): Likewise. + * decl2.c (grok_function_init): Likewise. + (import_export_vtable): Likewise. + (import_expor_class): Likewise. + * typeck2.c (abstract_virtuals_error): Likewise. + * xref.c (GNU_xref_member): Likewise. + * search.c (get_abstract_virtuals): Rename to get_pure_virtuals. + +1999-12-26 Zack Weinberg + + * cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING + throughout. + +1999-12-26 Mark Mitchell + + * decl.c (store_return_init): Use mode of old RTL generated for + DECL_RESULT, not the mode of DECL_RESULT itself. + * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE + for functions that used named return values. + +1999-12-24 Mark Mitchell + + * semantics.c (expand_body): Use + note_deferral_of_defined_inline_function. + +1999-12-22 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle CTOR_STMTs. + +1999-12-22 Alexandre Oliva + + * error.c (dump_decl): Support named return values. + +1999-12-20 Mark Mitchell + + * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments. + (CLASSTYPE_HAS_PRIMARY_BASE_P): New macro. + (CLASSTYPE_PRIMARY_BINFO): Likewise. + * class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF, + TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here. + (check_bases_and_members): Set them here instead. + (create_vtable_ptr): New function, split out from ... + (finish_struct_1): ... here. Use it. Tidy. Use + CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO. + * search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as + the first field in the class. + * tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle + seeing TYPE_VFIELD as the first field in the class. + + * cp-tree.h (TYPE_VIRTUAL_P): Rename to ... + (TYPE_POLYMORPHIC_P): ... this. + (TYPE_USES_COMPLEX_INHERITANCE): Rename to ... + (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this. + (TREE_CALLS_NEW): Remove. + (TREE_MANGLED): Likewise. + * call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, + and TYPE_POLYMORPHIC_P. + * class.c (check_bases): Likewise. + (finish_base_struct): Likewise. + (finish_struct_bits): Likewise. + (check_for_override): Likewise. + (finish_struct_1): Likewise. + (get_vfield_name): Likewise. + * decl.c (xref_basetypes): Likewise. + * decl2.c (import_export_class): Likewise. + (import_export_decl): Likewise. + * error.c (dump_function_decl): Likewise. + * pt.c (instantiate_class_template): Likewise. + * repo.c (repo_inline_used): Likewise. + * rtti.c (build_headof): Likewise. + (get_tinfo_fn_dynamic): Likewise. + (build_x_typeid): Likewise. + (get_tinfo_var): Likewise. + (build_dynamic_cast_1): Likewise. + (synthesize_tinfo_fn): Likewise. + * search.c (lookup_field_1): Likewise. + (dfs_debug_mark): Likewise. + (maybe_suppress_debug_info): Likewise. + * typeck.c (build_component_ref): Likewise. + (build_component_addr): Likewise. + * typeck2.c (process_init_constructor): Likewise. + +1999-12-20 Nathan Sidwell + + * typeck.c (strip_all_pointer_quals): New static function. + (build_static_cast): Use it. Don't use at_least_as_qualified_p. + +1999-12-16 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE. + (dso_handle_node): New macro. + (flag_use_cxa_atexit): New variable. + (declare_global_var): New function. + (start_anon_func): Remove declaration. + (end_anon_func): Likewise. + * decl.c (get_atexit_node): New function, split out from + destroy_local_static. Handle flag_use_cxa_atexit. + (get_dso_handle_node): Likewise. + (start_cleanup_fn): Renamed from start_anon_func. Moved here from + except.c. Handle flag_use_cxa_atexit. + (end_cleanup_fn): Renamed from end_anon_func. Moved here from + except.c. + (declare_global_var): New variable. + (destroy_local_static): Handle flag_use_cxa_atexit. + * decl2.c (flag_use_cxa_atexit): New variable. + (lang_f_options): Likewise. + * except.c (start_anon_func): Remove. + (end_anon_func): Liekwise. + * lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit. + * rtti.c (get_tinfo_var): Use declare_global_var. + +1999-12-16 Mark Mitchell + + * class.c (check_field_decls): Don't return a value. + (avoid_overlap): Moved here from tree.c. + (build_base_fields): Likewise. + (check_bases): New function, split out from finish_base_struct. + (check_bases_and_members): New function, split out from + finish_struct_1. + (struct base_info): Remove cant_have_default_ctor, + cant_have_const_ctor, cant_have_asn_ref. + (finish_base_struct): Split semantic analysis into check_bases. + (finish_struct_methods): Fix bogus assertion. + (check_field_decls): Call finish_struct_anon here. + (build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES. + (finish_struct_1): Use check_bases_and_members. Reorganize. + * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. + (build_base_fields): Don't declare. + * tree.c (avoid_overlap): Remove. + (build_base_fields): Likewise. + + * optimize.c (struct inline_data): Remove scope_stmt. + (remap_block): Don't use insert_block_after_note. Don't update + scope_stmt. + (expand_call_inline): Don't update scope_stmt. + (optimize_function): Don't initialize scope_stmt. + * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted + NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes. + +1999-12-15 Mark Mitchell + + * class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS + out of the class, rather than taking them as parameters. + (build_vbase_pointer_fields): Move here from tree.c. + (build_vtbl_or_vbase_field): New function. + (check_methods): Likewise. + (remove_zero_width_bitfields): Likewise. + (add_virtual_function): Use tree_cons instead of temp_tree_cons. + (delete_duplicate_fields_1): Tidy. Don't delete duplicate + USING_DECLs here. + (finish_struct_methods): Handle the case where there are no + methods here. + (get_basefndecls): Use tree_cons instead of temp_tree_cons. + (check_field_decls): Call delete_duplicate_fields here. + (finish_struct_1): Tidy. Use check_methods and + remove_zero_width_bitfields. + * cp-tree.h (build_vbase_pointer_fields): Remove. + * decl.c (grokdeclarator): Use tree_cons instead of + temp_tree_cons. + * decl2.c (qualified_lookup_using_namespace): Use tree_cons + instead of temp_tree_cons. + * lex.c (cons_up_default_function): Remove dead code. + * method.c (fixup_pending_inline): New function, split out from ... + (do_inline_function_hair): ... here. + * tree.c (build_vbase_pointer_fields): Remove. + +1999-12-15 Jason Merrill + + * tree.c (walk_tree): Walk operand subtrees in forward order. + * optimize.c (expand_call_inline): Likewise. + (optimize_function): Initialize id->scope_stmt to something useful. + (remap_block): Assume id->scope_stmt has a useful value. + +1999-12-15 Nathan Sidwell + + * typeck.c (build_c_cast): Expand warning message. Move pointer + alignment warning to after the cast. Don't warn about pointer + alignment when given a pointer to incomplete. + +1999-12-15 Richard Henderson + + * cp-tree.h (make_aggr_type): Declare. + * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE. + (make_aggr_type): New. + + * decl.c (build_typename_type, init_decl_processing): Use it. + (build_ptrmemfunc_type, xref_tag): Likewise. + * except.c (call_eh_info): Likewise. + * init.c (init_init_processing): Likewise. + * pt.c (process_template_parm, lookup_template_class): Likewise. + * rtti.c (expand_class_desc): Likewise. + * semantics.c (begin_class_definition, finish_typeof): Likewise. + * tree.c (copy_template_template_parm): Likewise. + +1999-12-15 Jason Merrill + + * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using + sizeof (struct tree_common). + +1999-12-14 Jason Merrill + + * optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the + outermost block to point to the inlined function decl. + + * error.c (dump_decl): operator==, not operator ==. + (op_to_string): Likewise. + + * decl.c (compute_array_index_type): Handle null name. + + * decl2.c (ambiguous_decl): Fix to match comment. + (lookup_using_namespace): Adjust. + + * decl2.c (import_export_class): Don't ignore dllimport. + +1999-12-14 Mark Mitchell + + * class.c (check_field_decls): Split out from ... + (finish_struct_1): ... here. Use it. Tidy. + + * cp-tree.h (remap_save_expr): Add walk_subtrees parameter. + * optimize.c (copy_body_r): Pass it. + * tree.c (remap_save_expr): Clear walk_subtrees for an + already-handled SAVE_EXPR. + (cp_unsave_r): Pass walk_subtrees to remap_save_expr. + + * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS. + * ir.texi (DECL_NAMESPACE_ALIAS): Document it. + + * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION. + +1999-12-14 Mumit Khan + + * class.c (finish_base_struct): Allow multiple COM base classes + as well as non-COM bases as long as it's not the leftmost. + +1999-12-13 Mumit Khan + + * lex.c (saving_parse_to_obstack): New global. + (reinit_parse_for_block): Use. + (reinit_parse_for_expr): Use. + (check_newline): Use. + +1999-12-13 Mark Mitchell + + * optimize.c (initialize_inlined_parameters): Take FN to which the + parameters belong as an argument. + (expand_call_inline): Expand calls into the parameter + initializations before pushing the function onto the list of + functions we are presently expanding. + +1999-12-11 Kaveh R. Ghazi + + * class.c (get_vtable_name): Use a literal format string and + VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT. + (prepare_fresh_vtable): Likewise. + + * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of + VTABLE_NAME_FORMAT. + + * decl.c (make_rtl_for_local_static): Remove unused variable `type'. + + * init.c (build_vec_init): Initialize variable `try_body'. + + * lex.c (yyerror): Don't call a variadic function with a + non-literal format string. + + * optimize.c (optimize_function): Call memset, not bzero. + + * pt.c (for_each_template_parm_r): Add static prototype. + +1999-12-09 Andreas Jaeger + + * except.c (expand_throw): Add static attribute to match + prototype. + + * Makefile.in (semantics.o): Add dependency on output.h. + * semantics.c: Include output.h for declaration of + make_function_rtl. + +1999-12-09 Mark Mitchell + + * decl.c (init_decl_processing): Reenable inlining on trees. + (finish_function): Likewise. + * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here. + * semantics.c (simplify_aggr_init_exprs): New function. + (expand_body): Use it. + * tree.c (walk_tree): Special-case TARGET_EXPRs since they + sometimes present the same sub-tree twice. + + * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not + `csl'. + + * semantics.c (finish_switch_cond): Do conversions here, not ... + * typeck.c (c_expand_start_case): Here. + + * semantics.c (do_poplevel): Remove unused variable. + +1999-12-06 Mark Mitchell + + * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE + unless we're declaring the variable in question. + +1999-12-06 Mark Mitchell + + * decl.c (init_decl_processing): #if 0 last patch. + (finish_function): Likewise. + +1999-12-05 Mark Mitchell + + * decl.c (init_decl_processing): Set flag_inline_trees if + !flag_no_inline. + + * cp-tree.h (calls_setjmp_p): Declare. + * decl.c (finish_function): Mark functions that call setjmp as + uninlinable. + * optimize.c (calls_setjmp_r): New function. + (calls_setjmp_p): Likewise. + +1999-12-04 Mark Mitchell + + * optimize.c (expand_call_inline): Wrap the expanded call in an + EXPR_WITH_FILE_LOCATION node to get correct line numbers for + inlined functions. + + * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add + in_target_cleanup_p. + (remap_decl): New function. + (remap_block): Likewise. + (copy_scope_stmt): Likewise. + (copy_body_r): Use remap_decl and copy_scope_stmt. + (copy_body): Use VARRAY_TOP_TREE. + (initialize_inlined_parameters): Likewise. + (declare_return_variable): Likewise. + (inlinable_function_p): Check flag_inline_trees. + (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs + specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the + parameters of the inlined function. + (optimize_function): Prevent recursion into partially complete + functions. + + * cp-tree.def (SCOPE_STMT): Take one operand. + * cp-tree.h (SCOPE_STMT_BLOCK): New macro. + (SCOPE_NULLIFIED_P): Redefine. + (SCOPE_NO_CLEANUPS_P): New macro. + (add_scope_stmt): Change prototype. + * decl.c (poplevel): Tidy. Warn about unused variables here. + Record SCOPE_STMT_BLOCKs. + (finish_function): Keep DECL_INITIAL for functions that might be + inlined. + * ir.texi: Document SCOPE_NO_CLEANUPS_P. + * semantics.c: Include rtl.h. + (add_scope_stmt): Return the new scope statement and, for an + end-of-scope statement, its matching begin statement. Don't set + SCOPE_NULLIFIED_P. + (do_pushlevel): Simplify, now that we are always + function-at-a-time. + (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs. + (expand_stmt): Don't call expand_start_bindings or + expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set. + * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting + SCOPE_NULLIFIED_P. + * Makefile.in (semantics.o): Depend on RTL_H. + + * decl2.c (pending_statics_used): Make it a macro. + (saved_inlines_used): Likewise. + (finish_static_data_member_decl): Use VARRAY_PUSH_TREE. + (mark_inline_for_output): Likewise. + (ssdf_decls_used): Remove. + (start_static_storage_duration_function): Use VARRAY_PUSH_TREE. + (generate_ctor_or_dtor_function): Adjust accordingly. + +1999-11-24 Geoffrey Keating + Greg McGary + + * decl.c (duplicate_decls): Merge + DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, + DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK. + +1999-12-02 Mike Stump + + * init.c (perform_member_init): Handle parse errors better. + +1999-12-01 Mark Mitchell + + * cp-tree.h (min_tree_cons): Remove. + (scratch_ovl_cons): Likewise. + * decl.c (saveable_obstack): Don't declare. + (duplicate_decls): Tweak error-message. + (initialize_local_var): Explicitly mark the definition as static. + (finish_function): Call permanent_allocation, just so + that the middle-end sees the obstacks it expects. + (mark_cp_function_context): Likewise. + * init.c (build_new): Don't use min_tree_cons. + * lex.c (permanent_obstack): Don't declare. + (current_obstack, saveable_obstack): Likewise. + * spew.c (current_obstack, saveable_obstack): Likewise. + * tree.c (current_obstack, saveable_obstack): Likewise. + (scratch_ovl_cons): Remove. + (build_min_nt): Don't mess with obstacks. + (build_min): Likewise. + (min_tree_cons): Remove + * typeck.c (build_component_ref): Don't use scratch_ovl_cons. + (build_x_function_call): Likewise. + (build_c_cast): Don't use min_tree_cons. + +1999-11-29 Mark Mitchell + + * pt.c (tsubst_decl): Robustify. + +1999-11-27 Mark Mitchell + + * decl2.c (finish_file): Call expand_body for inline functions + that will be written out but that do not yet have RTL. + * semantics.c (expand_body): Do not generate RTL For inline + functions that do not yet need to be written out. + +1999-11-25 Mark Mitchell + + * Make-lang.in (CXX_SRCS): Add optimize.c. + * Makefile.in (CXX_OBJS): Add optimize.o. + (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). + (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. + (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. + (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. + (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. + (dump.o): Likewise. + (optimize.o): New target. + * class.c: Don't include splay-tree.h. + * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. + * cp-tree.h: Include splay-tree.h. + (DECL_UNINLINABLE): New macro. + (CTOR_BEGIN_P, CTOR_END_P): New macros. + (flag_inline_trees): New variable. + (local_variable_p): New function. + (nonstatic_local_decl_p): Likewise. + (optimize_function): Likewise. + (cplus_unsave_expr_now): Remove. + (copy_tree_r): Declare. + (remap_save_expr): Likewise. + * decl.c (local_variable_p): Don't + make it static. + (local_variable_p_walkfn): New function. + (make_rtl_for_local_static): Remove code to try to avoid writing + out static constants. + (emit_local_var): Fix indentation. + (nonstatic_local_decl_p): New function. + (check_default_argument): Use local_variable_p_walkfn, not + local_variable_p, when walking the tree. + (start_function): Set the DECL_CONTEXT for automatically generated + labels. + (finish_constructor_body): Use CTOR_STMT to mark the end of a + constructor. + * decl2.c: Don't include splay-tree.h. + (flag_inline_trees): Define. + * dump.c: Don't include + splay-tree.h. + * except.c (expand_end_catch_block): Fix comment formatting. + (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. + (expand_throw): Tidy comment. + * init.c (build_vec_delete_1): Use create_temporary_var. + * lex.c (cplus_tree_code_type): Make it static. + (cplus_tree_code_length): Likewise. + (cplus_tree_code_name): Likewise. + * optimize.c: New file. + * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions + with computed gotos. + (setup_vtbl_ptr): Mark the beginnings of constructors with + CTOR_STMT. + (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. + (expand_body): Call optimize_function. Save bodies if we're doing + inlining on trees. + * tree.c: Don't include splay-tree.h. Include insn-config.h and + integrate.h. + (copy_tree_r): Make it public. + (statement_code_p): New function. + (mark_local_for_remap_r): Likewise. + (cp_usave_r): Likewise. + (cp_unsave): Likewise. + (build_cplus_new): Set DECL_CONTEXT for temporary variables. + (walk_tree): Walk into `s' class nodes. Walk statement chains. + (copy_tree_r): Handle 's' class nodes. Restore chains for + statements. Nullify scopes. Don't copy types. + (init_tree): Set lang_unsave to cp_unsave. + (remap_save_expr): Define. + * ir.texi: Document CTOR_STMT. + +1999-11-24 Jason Merrill + + * search.c (note_debug_info_needed): Do perform this optimization + for dwarf2. + (maybe_suppress_debug_info): Likewise. Start by clearing + TYPE_DECL_SUPPRESS_DEBUG. + +1999-11-24 Mark Mitchell + + * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs. + + * decl2.c (finish_vtable_vardecl): Don't prune vtables here. + +1999-11-23 Kaveh R. Ghazi + + * decl.c (pushdecl, grokdeclarator): Don't call a variadic + function with a non-literal format string. + + * lex.c (do_identifier): Likewise. + + * typeck.c (build_unary_op): Likewise. + +1999-11-23 Mark Mitchell + + * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation. + +1999-11-22 Mark Mitchell + + * cp-tree.def (CTOR_COMPLETE): New tree node. + * decl.c (finish_constructor_body): Add it, to mark the end of the + constructor. + (finish_function): Don't call end_protect_partials here. + * ir.texi (CTOR_COMPLETE): Document it. + * semantics.c (expand_stmt): Handle it. + + * cp-tree.def (FUNCTION_NAME): New tree node. + * cp-tree.h (current_function_name_declared): Tweak documentation. + (lang_decl_flags): Add pretty_function_p, adjust dummy. + (DECL_PRETTY_FUNCTION_P): New macro. + * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__, + etc., in a template function. Use at_function_scope_p instead of + expanding it inline. + * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations + specially. + (tsubst): Handle FUNCTION_NAME. + (tsubst_copy): Likewise. + (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__, + etc. in instantiation. + * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc., + even in template functions. + (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the + conditional scope at the top of a destructor. + + * error.c (dump_function_decl): Use `[ with ... ]' syntax for + specializations too. + +1999-11-22 Nathan Sidwell + + * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT + when actually negative. + + * typeck.c (convert_for_assignment): Expand comment about + strange NULL check, moved from ... + (convert_for_initialization): ... here. Remove unneeded + code. + +1999-11-21 Alexandre Oliva + + * cp-tree.h (build_vec_delete): Remove `auto_delete' argument. + * init.c (build_vec_delete, build_vec_delete_1): Likewise. + Always destruct virtual bases of array components, but never + delete them. + (build_vec_init): Adjust invocations. + (build_delete): Likewise. + * decl2.c (delete_sanity): Likewise. + +1999-11-19 Nathan Sidwell + + * cp-tree.h (grok_method_quals): Return this pointer qualifiers. + * decl.c (grokdeclarator): Adjust calls to grok_method_quals. + * decl2.c (grok_method_quals): Accept `restrict' as applying to + the object pointer. Return such qualifiers. + (grokclassfn): Apply this pointer qualifiers. Cleanup unused + variables. + +1999-11-18 Mark Mitchell + + * except.c (expand_end_catch_block): Fix typo. + (expand_exception_blocks): Simplify. Don't call + expand_leftover_cleanups. + +1999-11-15 Jason Merrill + + * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic. + * pt.c (tsubst, case INTEGER_TYPE): Call it. + Check uses_template_parms. + + * class.c (finish_struct): If we're a local class in a template + function, add a TAG_DEFN. + * pt.c (lookup_template_class): If this is a local class in a + template function, call pushtag. + (tsubst_expr, case TAG_DEFN): Handle classes, too. + + Emit debug info with the vtable. + * search.c (maybe_suppress_debug_info): New function... + * class.c (finish_struct_1): ...split out from here. + * cp-tree.h: Declare it. + * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG + if we're writing out the vtable. + * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p, + note_debug_info_needed): #if 0 out. + +1999-11-14 Mark Mitchell + + * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro. + * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not + TREE_PERMANENT. + * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P. + * decl2.c (lookup_arg_dependent): Use it. + + * cp-tree.h (cp_finish_decl): Change prototype. + (finish_static_data_member_decl): Likewise. + (push_permanent_obstack): Remove declaration. + (push_expression_obstack): Likewise. + (push_scratch_obstack): Likewise. + (DECL_TEMPLATE_PARM_P): Robustify. + (SET_DECL_TEMPLATE_PARM_P): New macro. + * class.c (add_method): Don't manipulate obstacks. + (finish_vtbls): Likewise. + * cvt.c (build_up_reference): Adjust calls to cp_finish_decl. + * decl.c (binding_for_name): Don't manipulate obstacks. + (maybe_push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (duplicate_decls): Likewise. + (pushdecl): Likewise. + (implicitly_declare): Likewise. + (build_typename_type): Likewise. + (start_decl): Likewise. + (cp_finish_decl): Likewise. + (finish_decl): Likewise. + (destroy_local_static): Likewise. + (expand_static_init): Likewise. + (complete_array_type): Likewise. + (grokvardecl): Likewise. + (build_ptrmemfnc_type): Likewise. + (grokdeclarator): Likewise. + (xref_tag): Likewise. + (xref_basetypes): Likewise. + (start_enum): Likewise. + (finish_enum): Likewise. + (start_function): Likewise. + (finish_function): Likewise. + (start_method): Adjust call to cp_finish_decl. + * decl2.c (finish_static_data_member_decl): Don't manipulate + obstacks. + (grokfield): Likewise. + (grokbitfield): Likewise. + (get_temp_name): Likewise. + (get_sentry): Likewise. + (fnish_file): Likewise. + (lookup_arg_dependent): Likewise. + * except.c (call_eh_info): Likewise. + (push_eh_info): Likewise. + (do_pop_exception): Likewise. + (initialize_handler_parm): Likewise. + (expand_end_eh_spec): Likewise. + (alloc_eh_object): Likewise. + (expand_throw): Likewise. + * expr.c (extract_scalar_init): Likewise. + * init.c (build_java_class_ref): Likewise. + * lex.c (get_time_identifier): Likewise. + (snarf_defarg): Likewise. + (add_defarg_fn): Likewise. + (is_global): Simplify. + (do_identifier): Don't check TREE_PERMANENT. + * method.c (emit_thunk): Don't manipulate obstacks. + * parse.y (condition): Adjust call to cp_finish_decl. + (primary): Likewise. + (initdcl): Likewise. + (initdcl0_innards): Likewise. + (nomods_initdcl0): Likewise. + * pt.c (push_inline_template_parms_recursive): Use + SET_DECL_TEMPLATE_PARM_P. + (process_template_parm): Likewise. + (lookup_template_class): Don't manipulate obstacks. + (instantiate_class_template): Adjust call to + finish_static_data_member_decl. + (tsubst_decl): Don't manipulate obstacks. + (tsubst_expr): Likewise. + (instantiate_template): Likewise. + (instantiate_decl): Adjust calls to cp_finish_decl. + * rtti.c (call_void_fn): Don't manipulate obstacks. + (get_tinfo_var): Likewise. + (get_tinfo_fn_unused): Likewise. + (build_dynamic_cast_1): Likewise. + (expand_si_desc): Likewise. + (expand_class_desc): Likewise. + (expand_ptr_desc): Likewise. + (expand_attr_desc): Likewise. + (expand_generic_desc): Likewise. + (synthesize_tinfo_fn): Likewise. + * search.c (expand_upcast_fixups): Likewise. + * semantics.c (finish_asm_stmt): Likewise. + (finish_named_return_value): Likewise. + (begin_class_definition): Likewise. + (finish_class_definition): Likewise. + (finish_typeof): Likewise. + * tree.c (build_cplus_method_type): Likewise. + (reverse_path): Likewise. + (copy_template_template_parm): Likewise. + (build_expr_ptr_wrapper): Likewise. + (push_expression_obstack): Remove. + (push_permanent_obstack): Likewise. + * typeck.c (mark_addressable): Likewise. + +1999-11-13 Mark Mitchell + + * call.c (build_conditional_expr): Use build_target_expr_with_type. + (convert_like): Likewise. + (build_over_call): Likewise. + * cp-tree.h (build_target_expr): Remove. + (build_target_expr_with_type): New function. + * cvt.c (build_up_reference): Use get_target_expr. + * decl.c (build_target_expr): Move to ... + * tree.c (build_target_expr): Here. Make it static. + (build_target_expr_with_type): New function. Set DECL_CONTEXT on + the temporary VAR_DECLs. + (get_target_expr): Use it. + +1999-11-13 Jason Merrill + + * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT. + * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT. + * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. + * class.c (set_rtti_entry): Use it. + +1999-11-12 Mark Mitchell + + * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups + here. + * semantics.c (finish_expr_stmt): Call it here instead. Move + default_conversion logic to semantic-analysis time. + +1999-11-12 Jason Merrill + + * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT. + +Fri Nov 12 12:56:32 MST 1999 Diego Novillo + + * init.c (init_init_processing): Re-instated Nov 11 patch after + approval. + +Fri Nov 12 10:42:02 MST 1999 Diego Novillo + + * init.c (init_init_processing): Undo patch from Nov 11, 1999. + Patch had not been approved yet. + +1999-11-12 Mark Mitchell + + * decl.c (compute_array_index_type): New function, split out from + grokdeclarator. + (create_array_type_for_decl): Likewise. + (grokdeclarator): Use them. + + * semantics.c (expand_stmt): Don't suspend_momentary or + resume_momentary. + +Thu Nov 11 12:42:11 MST 1999 Diego Novillo + + * init.c (init_init_processing): Header information for + arrays allocated via `new' should have the same alignment used by + malloc. + +1999-11-10 Mark Mitchell + + * error.c (dump_function_name): Don't crash if given a friend + pseudo-instantiation. + + * cp-tree.h (build_enumerator): Change prototype. + * decl.c (enum_next_value): Remove. + (enum_overflow): Likewise. + (init_decl_processing): Don't register enum_next_value as a root. + (start_enum): Clear TYPE_VALUES for a redefined enum. + (finish_enum): Reset the type of enumeration constants. + (build_enumerator): Fix indentation. Don't copy CONST_DECLs when + we don't need to. Maintain the TYPE_VALUES list and look there + for the previously defined enumeration constant. Let enumeration + constants have the type of their values until the enumeration type + is complete. + * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value. + (structsp): Adjust. + * parse.c: Regenerated. + * pt.c (tsubst_enum): Adjust according to build_enumerator changes. + +Wed Nov 10 12:43:21 1999 Philippe De Muyter + Kaveh R. Ghazi + + * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. + +1999-11-09 Mark Mitchell + + * cp-tree.h (language_function): Remove x_last_dtor_insn and + x_last_parm_cleanup_insn. + * decl.c (last_dtor_insn): Remove. + (last_parm_cleanup_insn): Likewise. + (expand_start_early_try_stmts): Don't set them. + (store_parm_decls): Likewise. + (save_function_data): Or save them. + (mark_lang_function): Or mark them. + +1999-11-08 Mark Mitchell + + * decl.c (store_parm_decls): Generate cleanup code at + semantic-analysis time. Destroy objects in the correct order. + +1999-11-07 Mark Mitchell + + * cp-tree.h (begin_new_placement): Remove. + (finish_new_placement): Likewise. + * class.c (finish_struct_1): Don't suspend_momentary or + resume_momentary. + * decl.c (grokdeclarator): Likewise. + (maybe_build_cleanup_1): Likewise. + * except.c (push_eh_cleanup): Likewise. + (build_terminate_handler): Likewise. + * init.c (build_new_1): Likewise. + * parse.y (parse_decl): Change prototype. + (initdecls, notype_initdecls, initdcl): Don't return int. + (initdcl0, notype_initdcl0, initdcl0_innards): Likewise. + (.begin_new_placement): Remove. + (.finish_new_placement): Likewise. + (nonmomentary_expr): Likewise. + (suspend_mom): Likewise. + (condition): Don't suspend_momentary, resume_momentary, or keep + track of need to resume. + (unary_expr): Likewise. + (new_placement): Likewise. + (decl): Likewise. + (structsp): Likewise. + (new_type_id): Likewise. + (maybe_parmlist): Likewise. + (direct_after_type_declaration): Likewise. + (direct_new_declarator): Likewise. + (direct_abstract_declaration): Likewise. + * parse.c: Regenerated. + * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary. + * semantics.c (begin_new_placement): Remove. + (finish_new_placement): Likewise. + +1999-11-05 Martin v. Löwis + + * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. + (DECL_TEMPLATE_INFO): Use it. + * decl.c (warn_extern_redeclared_static): Do nothing for + TEMPLATE_DECLs. + * decl2.c (mark_used): Explicitly check for function or variable. + * semantics.c (finish_unary_op_expr): Check whether result is also + an INTEGER_CST. + +1999-11-05 Mark Mitchell + + * Makefile.in (typeck2.o): Depend on output.h. + * typeck2.c: Include output.h. + + * decl.c (flag_ansi): Remove declaration. + + * pt.c (tinst_level_tick): Make it static. + (last_template_error_tick): Likewise. + + * cp-tree.h (mapcar): Remove declaration. + (search_tree): Likewise. + (walk_tree_fn): New typedef. + (walk_tree): New function. + * tree.c (bot_manip): Change prototype. Adjust to be called via + walk_tree. + (bot_replace): Likewise. + (no_linkage_helper): Likewise. + (copy_tree_r): New function. + (search_tree): Rename, and adjust, to become ... + (walk_tree): New function. + (mapcar): Remove. + (target_remap): Remove. + (target_remap_count): Likewise. + (break_out_target_exprs): Use walk_tree. + * decl.c (local_variable_p): Change prototype. + (check_default_argument): Use walk_tree. + * pt.c (for_each_template_parm_r): New function, split out from ... + (for_each_template_parm): Here. Use it, via walk_tree. + +1999-11-03 Mark Mitchell + + * class.c (check_bitfield_decl): New function, split out from + finish_stuct_1. + (check_field_decl): Likewise. Recursively examine members of + anonymous structs. + (finish_struct_1): Use them. + * cp-tree.h (ANON_UNION_TYPE_P): New macro. + +1999-11-02 Mark Mitchell + + * decl.c (grokfndecl): Remove dead code. + + * dump.c (dequeue_and_dump): Fix thinko for catch-clauses. + +1999-11-02 Scott Snyder + + * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and + IMAGPART_EXPR. + * pt.c (tsubst_copy): Likewise. + +1999-11-01 Jason Merrill + + * decl2.c (maybe_make_one_only): Always make things comdat on + ELF targets, too. + +1999-10-31 Mark Mitchell + + * decl.c (finish_function): Call free_after_parsing for functions + we are not immediately turning into RTL. + +1999-10-31 Brendan Kehoe + + * cp-tree.h (flag_dump_translation_unit): Add decl. + +Sat Oct 30 22:42:50 1999 Stephen L Moshier + + * lex.c (yylex): Accept 'f' in mantissa of hex float constant. + +1999-10-30 Mark Mitchell + + * decl.c (pop_cp_function_context): Don't call free on a NULL + pointer. + * semantics.c: Include ggc.h. + (expand_body): Do garbage-collection after processing a template + function. Clear DECL_SAVED_TREE after generating RTL for a + function. + * Makefile.in (semantics.o): Depend on ggc.h. + +1999-10-29 Mark Mitchell + + * cp-tree.h (make_typename_type): Change prototype. + * decl.c (make_typename_type): Only complain if so requested. + * parse.y (nested_name_specifier): Adjust calls. + (typename_sub0): Likewise. + (typename_sub1): Likewise. + * parse.c: Regenerated. + * pt.c (convert_template_argument): Pass complain to + make_typename_type. + (tsubst): Likewise. + +1999-10-28 Mark Mitchell + + * semantics.c (finish_handler): End the scope of the handler + before attaching it to the statement-tree. + +1999-10-28 Ian Lance Taylor + + * rtti.c (build_dynamic_cast_1): Give a better error message for + an attempt to dynamic_cast from a non-polymorphic type. + +1999-10-27 Mark Mitchell + + * cp-tree.h (make_temp_vec): Remove. + (make_scratch_vec): Likewise. + * call.c (add_function_candidate): Use make_tree_vec. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (add_template_candidate_real): Likewise. + * class.c (resolve_address_of_overloaded_function): Likewise. + * decl.c (start_function): Don't fool with the momentary obstack. + (finish_function): Likewise. + * init.c (expand_direct_vtbls_init): Likewise. + (begin_init_stmts): Likewise. + (finish_init_stmts): Likewise. + * pt.c (add_to_template_args): Use make_tree_vec. + (check_explicit_specialization): Likewise. + (coerce_template_parms): Likewise. + (lookup_template_class): Don't fool with the momentary obstack. + (instantiate_class_template): Likewise. + (tsubst_template_arg_vector): Use make_tree_vec. + (tsubst_aggr_type): Don't fool with the momentary obstack. + (tsubst_decl): Likewise. Use make_tree_vec. + (try_one_overload): Likewise. + (try_class_unification): Don't fool with the momentary obstack. + (get_bindings_real): Use make_tree_vec. + (set_mangled_name_for_template_decl): Likewise. + * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack. + * semantics.c (finish_expr_stmt): Likewise. + (finish_do_stmt): Likewise. + (finish_for_expr): Likewise. + (finish_switch_cond): Likewise. + (do_pushlevel): Likewise. + (do_poplevel): Likewise. + * tree.c (make_temp_vec): Remove. + + * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump + CLEANUP_P for a TRY_BLOCK. + * ir.texi: Document SAVE_EXPR. + +Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) + + * call.c (build_over_call): Check that the built-in function is + of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS. + * typeck.c (build_function_call_real): Similarly. + +1999-10-26 Mark Mitchell + + * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call + remember_end_note. + +1999-10-24 Mark Mitchell + + * decl.c (push_overloaded_decl_1): Use pushdecl. + + * decl.c (auto_function): Replace #ifdef'd __inline with just + plain inline. + * lex.c (my_get_run_time): Likeise. + (yyprint): Likewise. + (identifier_type): Likewise. + * method.c (start_squangling): Likewise. + (end_squangling): Likewise. + (icat): Likewise. + (old_backref_index): Likewise. + (flush_repeats): Likewise. + (issue_ktype): Likewise. + * parse.y (empty_parms): Likewise. + * parse.c: Regenerated. + +1999-10-21 Mark Mitchell + + * dump.c (dequeue_and_dump): Replace several uses of + queue_and_dump_index with dump_child. + +1999-10-21 Kaveh R. Ghazi + + * expr.c: Include tm_p.h. + +1999-10-21 Mark Mitchell + + * cp-tree.h (SCOPE_PARTIAL_P): New macro. + (pushlevel_temporary): Remove. + (add_scope_stmt): New function. + * decl.c (pushlevel_temporary): Remove. + (poplevel): Use add_scope_stmt. + (start_decl_1): Likewise. + * semantics.c (add_scope_stmt): New function. + (do_pushlevel): Use it. + (do_poplevel): Use it. + (expand_stmt): Check SCOPE_PARTIAL_P. + + * cp-tree.def (EMPTY_CLASS_EXPR): New tree node. + * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR. + * expr.c (cplus_expand_expr): Expand it. + * ir.texi: Document EMPTY_CLASS_EXPR. + +1999-10-20 Mark Mitchell + + * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template + parameters as having namespace scope. + +1999-10-19 Mark Mitchell + + * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove. + (mangling_flags): New type. + (build_overload_int): Change prototype. + (build_overload_value): Likewise. + (numeric_output_need_bar): Improve comment. + (mangle_expression): New function, broken out from ... + (build_overload_int): Here. + (build_overload_value): Adjust for use of mangling flags. Don't + warn about real-valued template parameters here. Do handle + complex expressions involving real-valued template parameters. + (build_template_parm_names): Encase non-type template parameters + in underscores, if necessary. + (process_overload_item): Remove conditional on + PARM_CAN_BE_ARRAY_TYPE. + +1999-10-17 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR. + + * ir.texi: Clean up documentation of RETURN_INIT. + +1999-10-15 Greg McGary + + * lex.c (lang_init_options): Set flag_bounds_check as "unspecified". + (lang_init): Set default for flag_bounds_check if still "unspecified". + +1999-10-13 Andrew Haley + + * class.c (finish_struct_1): Force alignment of non-bitfields to + BITS_PER_UNIT. + +Wed Oct 13 22:01:35 1999 J"orn Rennecke + + * typeck2.c (process_init_constructor): Handle empty constructors. + +1999-10-13 Jason Merrill + + * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL. + + * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size + array error. + +1999-10-13 Mark Mitchell + + * decl.c (make_rtl_for_local_static): Don't create register RTL + for addressable constants. + +1999-10-13 Nathan Sidwell + + * cp-tree.h (build_x_va_arg): Prototype new function. + * call.c (build_x_va_arg): Define it. + * parse.y (unary_expr): Call build_x_va_arg. + + * cp-tree.h (convert_type_from_ellipsis): Prototype new function. + * call.c (convert_type_from_ellipsis): Define it. + * decl.c (init_decl_processing): Set lang_type_promotes_to. + + * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates. + +1999-10-11 Jason Merrill + + * class.c (fixed_type_or_null): Always set *nonnull. + +1999-10-10 Kaveh R. Ghazi + + * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing + __GNUC__ and __GNUC_MINOR__. + +1999-10-09 Mark Mitchell + + * cp-tree.h (make_rtl_for_local_static): New function. + * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for + local statics ... + (make_rtl_for_local_static): Here. + * semantics.c (expand_stmt): Use make_rtl_for_local_static. + +1999-10-08 Kaveh R. Ghazi + + * method.c: Include tm_p.h. + +1999-10-7 Franz Sirl + + * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type. + * lex.c (cp_make_lake_type): Likewise. + * tree.c (init_tree): Init make_lang_type_fn. + +1999-10-07 Mark Mitchell + + * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch + parameter. + + * semantics.c (expand_stmt): Don't pretend to have asmspecs for + local statics if we don't really have them. + + * ir.texi: Improve documentation for STMT_EXPR. Describe + CLEANUP_POINT_EXPR. + +1999-10-07 Jason Merrill + + * class.c (build_vtable_entry_ref): Use finish_asm_stmt. + +1999-10-07 Greg McGary + + * class.c (finish_struct_1): Use simpler method of + removing elements of a singly-linked list which doesn't + lose for classes without data members. + +1999-10-07 Mark Mitchell + + * friend.c (make_friend_class): Robustify. + + * semantics.c (finish_object_call_expr): Reject calls to template + types. + +1999-10-06 Mark Mitchell + + * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR. + + * cp-tree.h (CLASSTYPE_VFIELD): Remove. + * call.c (build_vfield_ref): Use TYPE_VFIELD, not + CLASSTYPE_VFIELD. + * class.c (get_vfield_offset): Likewise. + (finish_base_struct): Likewise. + (modify_one_vtable): Likewise. + (fixup_vtable_deltas): Likewise. + (finish_struct_1): Likewise. + * init.c (expand_virtual_init): Likewise. + * search.c (lookup_field_1): Likewise. + (expand_upcast_fixups): Likewise. + * typeck.c (build_component_ref): Likewise. + (build_binary_op_nodefault): Likewise. + + * dump.c (dqueue_and_dump): Dump TYPE_VFIELD. + * ir.texi: Document TYPE_VFIELD. + +1999-10-06 Brendan Kehoe + + * decl.c (grokdeclarator): Only warn about nonzero arrays if + !in_system_header (linux socketbits.h can give this for + __cmsg_data, which is using a GNU extension). + +1999-10-05 Mark Mitchell + + * decl2.c (start_static_storage_duration_function): Push the + function declaration so it ends up in namespace scope. + + * dump.c (DUMP_CHILDREN): Remove. + (DUMP_BINFO): Adjust. + (struct dump_node_info): Remove dump_children_p. + (queue_and_dump_type): Remove dump_children_p parameter. + (queue): Don't set dump_children_p. + (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to + queue_and_dump_index. + (dequeue_and_dump): Unconditionally print children. Adjust calls + to functions mentioned above. + (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue. + + * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR. + * dump.c (dequeue_and_dump): Dump them. + + * method.c (synthesize_method): Call setup_vtbl_ptr for destructors. + + * decl.c (start_function): Set current_in_charge_parm for + constructors, too, where appropriate. + * search.c (fixup_all_virtual_upcast_offsets): New function. + (expand_indirect_vtbls_init): Use it. + +1999-10-04 Nathan Sidwell + + * decl2.c (grok_alignof): Don't decay lvalues. + + * init.c (build_new): Remove unused variable. + +1999-10-04 Mark Mitchell + + * cp-tree.h (struct language_function): Remove static_labelno. + (static_labelno): Remove macro. + * method.c (build_overload_nested_name): Make static_labelno + static here. + + * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL, + to decide whether or not a function is defined. + + * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for + situations where make_node will do it automatically. + * decl.c (grok_reference_init): Likewise. + (expand_static_init): Likewise. + (do_static_initialization): Likewise. + * init.c (perform_member_init): Likewise. + (expand_aggr_init_1): Likewise. + (build_new_1): Likewise. + * method.c (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + * search.c (expand_upcast_fixups): Likewise. + * semantics.c (finish_stmt_expr): Likewise. + * typeck.c (build_unary_op): Likewise. + (check_return_expr): Likewise. + +1999-10-04 Jason Merrill + + * init.c (build_vec_delete_1): Fold COND_EXPRs. + +1999-10-03 Mark Mitchell + + * cp-tree.def (VEC_INIT_EXPR): Remove. + * cp-tree.h (struct stmt_tree): New type. + (struct saved_scope): Remove firstobj. Add x_saved_tree, + x_stmt_tree. + (class_cache_firstobj): Remove. + (struct language_function): Remove stmts_are_full_exprs_p, + x_last_tree, and x_last_expr_type. Add x_stmt_tree. + (current_stmt_tree): New macro. + (last_tree): Adjust. + (last_expr_type): Likewise. + (doing_semantic_analysis_p): Simplify. + (stmts_are_full_exprs_p): Adjust. + (begin_tree): Remove prototype. + (end_tree): Likewise. + (begin_stmt_tree): Change prototype. + (finish_stmt_tree): Likewise. + (building_stmt_tree): Simplify. + * decl.c (mark_stmt_tree): New function. + (mark_saved_scope): Use it. + (start_function): Rearrange slightly to call begin_stmt_tree + earlier. + (save_function_data): Tweak. + (finish_function): Adjust call to finish_stmt_tree. + (mark_lang_function): Use mark_stmt_tree. + * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. + * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. + (build_vec_init): Remove creation of stand-in initializer. + * pt.c (begin_tree): Remove. + (end_tree): Likewise. + * semantics.c (SET_LAST_STMT): New macro. Use it throughout. + (begin_compound_stmt): Handle a compound-statement outside of a + function. + (begin_stmt_expr): Handle a statement-expression outsidef of a + function. + (finish_stmt_expr): Likewise. + (begin_class_definition): Don't call begin_tree. + (finish_inline_definitions): Don't call end_tree. + (begin_stmt_tree): Take a pointer to tree, not a function as input. + (finish_stmt_tree): Likewise. + * tree.c (search_tree): Don't handle VEC_INIT_EXPR. + (mapcar): Likewise. + + * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. + * parse.c: Regenerated. + + * dump.c (dqueue_and_dump): Dump bitfieldness. + + * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for + bitfields, rather than DECL_BIT_FIELD. + * ir.texi: Document how to tell whether or not a field is a + bitfield. + + * lex.c (make_lang_type): Fix typo in comment. + +1999-10-01 Jason Merrill + + * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. + +1999-10-01 Mark Mitchell + + * pt.c (tsubst_decl): If the type of a template instantiation is + bogus, so is the whole instantiation. + +1999-09-30 Mark Mitchell + + * decl.c (initialize_local_var): Handle static variables here. + (cp_finish_decl): Tweak handling of function-scope static + variables. + * semantics.c (expand_stmt): Handle DECL_STMTs for static + variables. + + * method.c (emit_thunk): Don't crash when -fsyntax-only. + + * cp-tree.h (lang_decl_flags): Add global_ctor_p and + global_dtor_p. Add init_priority. + (DECL_ACCESS): Adjust accordingly. + (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros. + (GLOBAL_INIT_PRIORITY): Likewise. + * decl.c (lang_mark_tree): Adjust accordingly. + (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P, + and GLOBAL_INIT_PRIORITY. + * dump.c (dequeue_and_dump): Print them. + * ir.texi: Document them. + + * decl2.c (struct priority_info_s): Remove initialization_sequence + and destruction_sequence. + (start_static_storage_duration_function): Return the body of the + function. Convert for function-at-a-time mode. + (generate_inits_for_priority): Remove. + (finish_static_storage_duration_function): Change prototype. + Adjust for function-at-a-time mode. + (do_static_initialization): Likewise. + (do_static_destruction): Likewise. + (do_static_initialization_and_destruction): Remove. + (start_static_initialization_or_destruction): New function. + (finish_static_initialization_or_destruction): Likewise. + (get_priority_info): Don't manipulation initialization_sequence or + destruction_sequence. + (prune_vars_needing_no_initialization): New function. + (write_out_vars): Likewise. + (finish_file): Use the various new functions instead of the old. + +Thu Sep 30 00:13:27 1999 Dirk Zoller + + * cp-tree.h (warn_float_equal): Declare. + * decl2.c (warn_float_equal): Define. + (lang_decode_option): Recognize -W[no-]float-equal. + * typeck.c (build_binary_op_nodefault): Conditionally warn + about equality tests of floating point types. + +1999-09-29 Jason Merrill + + Support normal type_info-based EH mechanisms with -fno-rtti. + * except.c (build_eh_type_type): Remove special -fno-rtti handling. + (build_eh_type_type_ref): Likewise. + (build_eh_type): Remove. + (expand_throw): Call build_eh_type_type, not build_eh_type. + * decl2.c (import_export_decl): Don't associate the tinfo fn with + the vtable if -fno-rtti. + * decl.c (init_decl_processing): Always init_rtti_processing. + + * rtti.c (get_typeid): Don't complain about -fno-rtti. + + * class.c (class_cache_obstack, class_obstack): Remove. + (init_class_processing): Don't initialize class_obstack. + (push_cache_obstack): Remove. + (pushclass): Don't call it. + * cp-tree.h: Remove prototype for push_cache_obstack. + * decl.c (decl_obstack, decl_stack, push_decl_level): Remove. + (pushlevel_class): Don't push_decl_level. + (poplevel_class): Don't pop_stack_level. + (push_class_level_binding): Don't push_cache_obstack. + (init_decl_processing): Don't initialize decl_obstack. + * search.c (push_class_decls): Don't push_cache_obstack. + * tree.c (list_hash_add): Put hash node on permanent_obstack. + (hash_tree_cons): Don't mess with obstacks. + (print_lang_statistics): Don't print stats for class_obstack and + decl_obstack. + +1999-09-29 Mark Mitchell + + * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL. + * ir.texi: Document DECL_EXTERNAL. + + * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs. + * ir.texi: Document THUNK_DECLs. + + * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c. + (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. + (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. + * error.c (dump_template_bindings): Remove unused parameter. + Handle multiple levels of template parameters. + (dump_template_decl): Use `parms', not `args', for template + parameters. Fix thinko. + (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass + flags to dump_template_bindings. + * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h. + (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. + (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. + (tsubst_copy): Clarify variable name. + (most_general_template): Robustify. + +1999-09-29 Nathan Sidwell + + * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME + to change primary template rendering. + +1999-09-29 Mark Mitchell + + * cp-tree.h (UPT_TEMPLATE): Remove. + (UPT_PARMS): Likewise. + (DECL_NEEDED_P): New macro. + * decl2.c (finish_vtable_vardecl): Use it. + (finish_objects): Don't crash with -fsyntax-only. + (finish_file): Use DECL_NEEDED_P. Don't prune vtables when + -fsyntax-only. + * pt.c (tsubst_friend_function): Remove FIXME that talks about + obstacks. + (tsubst_expr): Correct handling of function try-blocks. + * semantics.c: Include flags.h. + (expand_body): Don't do RTL generation if -fsyntax-only. + * Makefile.in (semantics.o): Depends on flags.h. + +1999-09-28 Gabriel Dos Reis + + * pt.c (most_general_template): Adjust declaration. + + * cp-tree.h: (most_general_template): Declare. + + * error.c (dump_template_value): Rename to ... + (dump_template_argument): This. + (dump_template_argument_list): New function. + (dump_type): Use it. + (dump_template_parameter): New function. + (dump_template_decl): Use it. + (dump_template_bindings): New function. + (dump_function_decl): Use it. Pretty print function template + instantiations. + +1999-09-28 Nathan Sidwell + + * decl.c (grokdeclarator): Distinguish parameter context for + diagnostics. Tidy up missing type diagnostic. + Diagnose `explicit' in one place. Diagnose `mutable' in one place. + +1999-09-28 Mark Mitchell + + * ir.texi: Improve documentation for TARGET_EXPR. + +1999-09-27 Nathan Sidwell + + Augment stringification of trees. + * cp-tree.h (tree_string_flags): New error stringifying enumeration. + (fndecl_as_string, type_as_string_real, args_as_string, + code_as_string, language_as_string, parm_as_string, + op_as_string, assop_as_string, cv_as_string): Remove. + (type_as_string, decl_as_string, expr_as_string): Adjust prototype. + (context_as_string): Declare new function. + * error.c (cp_printers): Move definition. + (OB_UNPUT): Remove. + (OB_END_TEMPLATE_ID): Adjust. + (interesting_scope_p): Remove. + (dump_scope): New static function. + (dump_qualifiers): Adjust prototype, reimplement. + (dump_template_value): Use tree_string_flags. + (dump_type_real): Move back to dump_type. + (dump_type): Adjust prototype. Use tree_string_flags. + (dump_aggr_type): Likewise. Use dump_template_parms. + (dump_type_prefix): Adjust prototype. Use tree_string_flags. + Return pad flag. + (dump_type_suffix): Adjust prototype. Use tree_string_flags. + (dump_simple_decl): Likewise. + (dump_decl): Likewise. Use dump_template_decl. + (dump_template_decl): New static function broken out of dump_decl. + (dump_function_decl): Adjust prototype. Use tree_string_flags. + (dump_parameters): Likewise. Prefix space. + (dump_exception_spec): Adjust prototype. Use tree_string_flags. + (dump_function_name): Likewise. Use dump_template_parms. + (dump_template_parms): New static function broken out of + dump_function_name. + (dump_expr_list): Adjust prototype. Use tree_string_flags. + (dump_expr): Likewise. + (fndecl_as_string): Removed + (type_as_string_real): Removed + (dump_binary_op): Adjust prototype. Use tree_string_flags. + (dump_unary_op): Likewise. + (type_as_string): Likewise. + (expr_as_string): Likewise. + (decl_as_string): Likewise. + (context_as_string): New function. + (lang_decl_name): Adjust. + (decl_to_string): New static print callback. + (expr_to_string): Likewise. + (fndecl_to_string): Likewise. + (code_as_string): Renamed to ... + (code_to_string): ... here. Adjust. + (language_as_string): Renamed to ... + (language_to_string): ... here. Adjust. + (parm_as_string): Renamed to ... + (parm_to_string): ... here. + (op_as_string): Renamed to ... + (op_to_string): ... here. + (assop_as_string): Renamed to ... + (assop_to_string): ... here. + (type_to_string): New static print callback. + (args_as_string): Renamed to ... + (args_to_string): ... here. Adjust. + (cv_as_string): Renamed to ... + (cv_to_string): ... here. Adjust. + * pt.c (mangle_class_name_for_template): Use tree_string_flags. + (print_template_context): Likewise. + +1999-09-26 Mark Mitchell + + * cp-tree.h (expand_throw): Remove prototype. + * except.c (expand_throw): Make it static. Use tree-generation + functions, rather than RTL-generation functions. + (build_throw): Use it. + * expr.c: Include except.h. + (cplus_expand_expr): Don't call expand_throw here. + * Makefile.in (expr.o): Depend on except.h. + * ir.texi: Update documentation for THROW_EXPR. + + * decl.c (start_function): Set x_dont_save_pending_sizes rather + than calling get_pending_sizes. + * init.c (build_new): Don't save and restore + immediate_size_expand; instead, assert that it has the expected + value already. + +1999-09-26 Kaveh R. Ghazi + + * lex.c (compiler_error): Add missing call to va_end(). + +1999-09-25 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle RESULT_DECL. + * ir.texi: Document RESULT_DECL and DECL_RESULT. + + * cp-tree.h (check_return_expr): New function. + * decl.c (finish_constructor_body): New function. + (pushdecl): Put global friend functions in namespace binding + level, not the class binding level. + (finish_destructor_body): Make sure the dtor_label is always + defined. Fix typo in comment. + (finish_function): Move generation of constructor-termination code + to semantic-analysis time. Move generation of implicit `main' + return value to semantic-analysis time. + * semantics.c (finish_return_stmt): Generate goto's to + ctor_label/dtor_label here. Use check_return_expr to do semantic + analysis on the returned expression. + * typeck.c (maybe_warn_about_returning_address_of_local): New + function split out from c_expand_return. + (check_return_expr): Likewise. + (c_expand_return): Just generate the RTL for the return. + +1999-09-24 Mark Mitchell + + * cp-tree.h (CPTI_CLEANUP_TYPE): New macro. + (cleanup_type): Likewise. + (search_tree): Change prototype. + * decl.c (local_variable_p): Adjust for new interface to + search_tree. + (check_default_argument): Likewise. + * error.c (dump_expr): Handle INIT_EXPR. + * except.c (expand_throw): Don't make cleanup_type a local static. + * expr.c (cplus_expand_expr): Don't handle NEW_EXPR. + * init.c (build_new): Call build_new_1 directly, rather than + building a NEW_EXPR. + (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when + processing file-scope initializers. + * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR. + * tree.c: Include splay-tree.h + (no_linkage_helper): Adjust for new interface to search_tree. + (search_tree): Pass around pointers to tree nodes, rather than the + nodes themselves. Handle VEC_INIT_EXPR. + (no_linkage_check): Adjust for new interface to search_tree. + (mapcar): Handle VEC_INIT_EXPR. + (target_remap): New variable. + (bot_manip): Use it. + (bot_replace): New function. + (break_out_target_exprs): Use it to remap all variables used in a + default argument expression. + * typeck.c (build_modify_expr): Don't crash when outside a + function and presented with an INIT_EXPR assignment + * Makefile.in (tree.o): Depend on splay-tree.h. + +Fri Sep 24 10:48:10 1999 Bernd Schmidt + + * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than + DECL_BUILT_IN. + (builtin_function): New arg CLASS. Arg CODE now of type int. All + callers changed. + Set the builtin's DECL_BUILT_IN_CLASS. + +1999-09-24 Mark Mitchell + + * decl.c (pushdecl): Don't make local declarations of extern + variables give the variable a DECL_CONTEXT for the function. + (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify. + Don't accidentally make RTL for local declarations. + (emit_local_var): Handle declarations with asm-specifiers here. + +1999-09-23 Mark Mitchell + + * ir.texi: Improve documentation for TARGET_EXPRs. Discuss + STMT_IS_FULL_EXPR_P. + + * cp-tree.h (language_function): Add cannot_inline. + * decl.c (start_function): Restore current_function_cannot_inline + from the saved value. + (save_function_data): Save current_function_cannot_inline. + * decl2.c (start_objects): Change prototype. Build the function + in function-at-a-time mode. + (finish_objects): Likewise. + (generate_ctor_or_dtor_function): Adjust accordingly. + + * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro. + * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS. + Don't call expand_anon_union_decl here + * semantics.c (exapnd_stmt): Call it here, instead. + * typeck.c (mark_addressable): Addressed variables are implicitly + used. + +1999-09-23 Martin v. Löwis + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. + (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. + (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK. + * cp-tree.h: Add tree checking macros to various tree access + macros. + * ptree.c (print_lang_decl): Test for function or variable + before accessing template info. + +1999-09-23 Jason Merrill + + * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node. + * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__. + * decl2.c (lang_f_options): Add -fshort-wchar. + * cp-tree.h: Declare flag_short_wchar. + * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned + int' for wchar_t. + +1999-09-23 Martin v. Löwis + + * ir.texi: Fix formatting errors and typos. + +1999-09-22 Mark Mitchell + + * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT. + + * decl.c (pushdecl): Do create a binding for extern "C" functions, + but not for their DECL_ASSEMBLER_NAMEs. + (lookup_name_current_level): Fix formatting. + (xref_tag): Likewise. + * decl2.c (start_objects): Mark static constructors and + destructors as used. + +1999-09-22 Jason Merrill + + * decl.c (define_case_label): Don't crash if we're not in a switch. + + * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags. + * lang-options.h: Restore -fthis-is-variable. Remove help strings + for unsupported flags. + +1999-09-21 Jason Merrill + + * decl2.c (lang_decode_option): Accept and ignore -finit-priority. + Accept and warn about -fthis-is-variable. + +1999-09-21 Mark Mitchell + + * dump.c (dequeue_and_dump): Handle START_CATCH_STMT, + CLEANUP_STMT, and SCOPE_STMT. + + * decl2.c (lang_decode_option): Adjust, in the wake of recent + changes to option processing. + +1999-09-21 Martin v. Löwis + + * typeck.c (get_member_function_from_ptrfunc): Allow extraction of + function pointer from pmfs with no object given. + (convert_for_assignment): Do not return error when converting + pmfs. + +1999-09-21 Alex Samuel + + * lex.c (internal_filename): New variable. + (INTERNAL_FILENAME): New macro. + (init_parse): Allocate internal_filename and mark as root. Use it + instead of a string constant. + +1999-09-21 Nathan Sidwell + + Reimplement dynamic cast and catch matching. + * cp-tree.h (get_dynamic_cast_base_type): Prototype new function + * search.c (dynamic_cast_base_recurse): New function. + (get_dynamic_cast_base_type): New function for dynamic cast. + * rtti.c (build_dynamic_cast_1): Determine source and target + class relationship. Call __dynamic_cast_2. + * tinfo.h (__user_type_info::upcast): New catch dispatcher. + (__user_type_info::dyncast): New dynamic cast dispatcher. + (__user_type_info::sub_kind): New nested enumeration. + (__user_type_info::contained_p): sub_kind predicate. + (__user_type_info::contained_public_p): Likewise. + (__user_type_info::contained_nonpublic_p): Likewise. + (__user_type_info::contained_nonvirtual_p: Likewise. + (__user_type_info::upcast_result): New nested struct. + (__user_type_info::dyncast_result): New nested struct. + (*::do_upcast): New catch function. + (*::do_dyncast): New dynamic cast function. + (__user_type_info::find_public_subobj): New dynamic cast + helper dispatcher. + (*::do_find_public_subobj): New dynamic cast helper function. + * tinfo.cc (__user_type_info::upcast): Define catch dispatcher. + (__user_type_info::dyncast): Define dynamic cast dispatcher. + (*::do_upcast): Define catch function. + (*::do_dyncast): Define dynamic cast function. + (*::do_find_public_subobj): Define dynamic cast helper function. + * tinfo2.cc (__throw_type_match_rtti_2): Use upcast. + (__dynamic_cast): Backwards compatibility wrapper. Use dyncast. + (__dynamic_cast_2): New dynamic cast runtime. + +1999-09-20 Mark Mitchell + + * cp-tree.h (finish_stmt_expr): Change prototype. + * expr.c (cplus_expand_expr): Adjust call accordingly. + * init.c (finish_init_stmts): Likewise. + * parse.y (primary): Likewise. + * pt.c (tsubst_copy): Likewise. + * semantics.c (finish_stmt_expr): Don't take two parameters. + Don't remove generated BLOCKs from the block-tree. + + Remove support for assigning to `this'. + * NEWS: Note that fact. + * class.c (build_vbase_path): Don't check flag_this_is_variable. + * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. + (language_function): Remove assigns_this, just_assigned_this, and + x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. + (base_init_expr): Remove. + (current_vcalls_possible_p): New macro. + (vtbls_set_up_p): Likewise. + (emit_base_init): Change prototype. + * decl.c (finish_destructor_body): New function, split out from + finish_function. + (current_function_assigns_this): Remove. + (current_function_just_assigned_this): Likewise. + (start_function): Don't set them. + (finish_function): Don't check them. Don't emit + base-initialization code here. Generate code for destructors when + doing semantic analysis. + (finish_stmt): Don't check current_function_just_assigned_this. + * decl2.c (lang_f_options): Remove this-is-variable. + (lang_decode_option): Likewise. + (grokclassfn): Don't check flag_this_is_variable. + * init.c (emit_base_init): Return the expression generated. + (construct_virtual_bases): Don't push/pop obstacks. Fix + typo. + (build_new_1): Don't check flag_this_is_variable. + (get_temp_regvar): Don't set DECL_REGISTER. + (build_vec_init): Don't call use_variable. + * lang-options.h: Remove "-fthis-is-variable" and + "-fno-this-is-variable". + * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. + * search.c (expand_upcast_fixups): Use finish_expr_stmt, not + expand_expr_stmt. + * semantics.c (finish_expr_stmt_real): Rename to ... + (finish_expr_stmt): This. Remove assigned_this parameter. + (begin_if_stmt): Call do_pushlevel before starting the statement. + (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less + blocks. + (setup_vtbl_ptr): Emit initialization code for bases and members + at semantic-analysis time. Emit code to initialize vtables in + destructors here. + (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. + Don't handle CTOR_INITIALIZER any more. + * typeck.c (build_modify_expr): Don't check for assignments to + this. + (c_expand_return): Don't suggest assigning to `this'. + + * Makefile.in (decl.o): Depend on RTL_H. + (decl2.o): Likewise. + (class.o): Likewise. + (call.o): Likewise. + (method.o): Likewise. + (search.o): Likewise. + (tree.o): Likewise. + (pt.o): Likewise. + + * decl.c (duplicate_decls): When a builtin function is redeclared + as static, make sure it is mangled correctly. + + * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add + detail about the statement-tree. + +1999-09-20 Nathan Sidwell + + * parse.y (primary): Use build_functional_cast for CV_QUALIFIER. + +1999-09-20 Nick Clifton + + * decl2.c (lang_decode_option): Extend comment. + +Mon Sep 20 10:49:05 1999 Bernd Schmidt + + * typeck.c: Include "tm_p.h". + +1999-09-19 Mark Mitchell + + * ir.texi: New file. + +1999-09-19 Paul Burchard + + * semantics.c (expand_stmt): Initialize return value. + +1999-09-18 Paul Burchard + + * gxxint.texi: G++ now implements namespaces. + +1999-09-18 Mark Mitchell + + * decl.c (pop_label): Don't warn about unused labels more than + once. + * semantics.c (finish_goto_stmt): Always marked used labels as + used. + + * decl.c (layout_var_decl): Change prototype. Call layout_decl + even when the declaration is external. + (cp_finish_decl): Adjust call to layout_var_decl. + * pt.c (tsubst_expr): Make sure to initialize stmt before using it. + +1999-09-18 Martin von Loewis + + * typeck.c (get_member_function_from_ptrfunc): Always consider + virtuality inside member pointer. + +1999-09-17 Mark Mitchell + + Turn on function-at-a-time processing. + * cp-tree.h (doing_semantic_analysis_p): New macro. + (SF_DEFAULT): Define to zero, not SF_EXPAND. + (start_handler_parms): Change prototype. + (expand_start_catch_block): Likewise. + (expand_end_catch_block): Likewise. + (expand_start_eh_spec): Likewise. + (expand_end_eh_spec): Declare. + (finish_handler_parms): Change prototype. + (begin_catch_block): Declare. + (finish_handler): Change prototype. + (do_pushlevel): Declare. + (do_poplevel): Likewise. + * decl.c (pushlevel): Don't create + binding levels when not doing semantic analysis. + (poplevel): Don't pop them. + (pushdecl): Assert that we are never called when not doing + semantic analysis. + (pushdecl_top_level): Use push_to_top_level. + (make_label_decl): Don't fiddle with obstacks. Make RTL For the + label when expanding. + (cp_finish_decl): Only inject for-scope variables when doing + semantic analysis. Add comments. + (start_handler_parms): Return the handler parm. + (start_function): Reorganize. Don't clear DECL_INITIAL if it is + already set. Reinitialize from saved function data if available. + Don't pushlevel when not doing semantic analysis. + (store_parm_decls): Only generate RTL when expanding. Only + pushdecl when doing semantic analysis. Set + current_eh_spec_try_block if appropriate. + (finish_function): Simplify. Use do_pushlevel and do_poplevel. + Combine common code. Don't poplevel when not doing semantic + analysis. + (push_cp_function_context): Don't expand functions without an + explicit call to expand_body. + (mark_lang_function): Make eh_spec_try_block and + x_scope_stmt_stack. + * except.c (expand_end_eh_spec): Don't + declare. + (process_start_catch_block): Likewise. + (push_eh_cleanup): Use finish_decl_cleanup. + (initialize_handler_parm): New function. + (expand_start_catch_block): Use it. + (expand_end_catch_block): Use tree-generation functions, not + RTL-generation functions. + (expand_start_eh_spec): Likewise. + (expand_end_eh_spec): Likewise. + (expand_exception_blocks): Simplify. + (start_anon_func): Use do_pushlevel. + (end_anon_func): Use do_poplvel. Call expand_body for the + function. + * expr.c (do_case): Don't call define_case_label. + * init.c (create_temporary_var): Set DECL_CONTEXT for local + variables. + * method.c (emit_thunk): Call expand_body for the + thunk. + (sythesize_method): Likewise. + * parse.y (handler_args): Give it ttype. + (eat_saved_input): Call expand_body. + (base_init): Use do_pushlevel. + (pending_inline): Call expand_body. + (handler): Adjust calls to finish_handler_parms and + finish_handler. + (handler_args): Don't call expand_start_catch_block. Return the + catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. + * parse.c: Regenerated. + * rtti.c (synthesize_tinfo_fn): Call finish_function. + * semantics.c (do_pushlevel): Give it external linkage. Build + SCOPE_STMTs. + (do_poplevel): Likewise. + (finish_case_label): Call define_case_label when doing semantic + analysis. + (finish_goto_stmt): Create RTL for labels. + (finish_function_try_block): Set in_function_try_handler + unconditionally. + (finish_function_handler_sequence): Unset it. + (finish_handler_parms): Use expand_start_catch_block even when + building a statement-tree. + (begin_catch_block): New function. + (finish_handler): Move a little RTL-generation logic here. + (finish_decl_cleanup): Allow cleanups for empty declarations. + (finish_named_return_value): Don't pushdecl when not doing + semantic analysis. + (expand_stmt): Don't do semantic analysis for variable + declarations. Handle START_CATCH_STMT. Call expand_label + directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust + HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. + (expand_body): Let expand_stmt handle CTOR_INITIALIZER, + RETURN_INIT and function try blocks. + + * cp-tree.h (language_function): Add x_eh_spec_try_block. Add + x_scope_stmt_stack. Add x_in_charge_parm. + (current_eh_spec_try_block): New macro. + (current_scope_stmt_stack): Likewise. + (current_in_charge_parm): Likewise. + * decl.c (start_function): Initialize current_in_charge_parm. + (finish_function): Use current_in_charge_parm rather than looking + up __in_chrg. + * search.c (expand_indirect_vtbls_init): Likewise. + + * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps. + (TRY_BLOCK): Likewise. + (HANDLER): Likewise. + (START_CATCH_STMT): New tree node. + (SCOPE_STMT): Likewise. + * cp-tree.h (SCOPE_BEGIN_P): New macro. + (SCOPE_NULLIFIED_P): Likewise. + (struct lang_decl_flags): Add pending_inline_p. Adjust dummy. + (struct lang_decl): Add saved_language_function. + (DECL_PENDING_INLINE_INFO): Adjust documentation. + (DECL_PENDING_INLINE_P): New macro. + (TYPE_TI_ARGS): Fix typo in comment. + (DECL_SAVED_TREE): Add to documentation. + (DECL_SAVED_FUNCTION_DATA): New macro. + (START_CATCH_TYPE): Likewise. + (SCOPE_END_P): New macro. + (declare_parm_level): Don't declare. + * decl.c (mark_lang_function): New function, split out from + mark_cp_function_context. + (save_function_data): New function. + (declare_parm_level): Remove. + (finish_function): Use save_function_data to squirrel away + important stuff for later use. + (mark_cp_function_context): Use mark_function_data. + (lang_mark_tree): Likewise. + * lex.c (begin_definition_of_inclass_inline): Set + DECL_PENDING_INLINE_P. + (store_pending_inline): Clear it. + * pt.c (tsubst_decl): Likewise. + +1999-09-17 Nathan Sidwell + + * call.c (perform_implicit_conversion): Deal with error_mark_node. + +1999-09-17 Mark Mitchell + + * decl.c (warn_extern_redeclared_static): Don't get confused by + static member functions. + (duplicate_decls): Merge DECL_THIS_STATIC. + + * decl.c (expand_static_init): Make sure assignments to local + statics actually occur. + +1999-09-17 Mark Mitchell + + * cp-tree.h (poplevel_class): Declare. + * class.c (popclass): Use poplevel_class, not poplevel. + * decl.c (poplevel_class): Don't make it static. Don't return a + value. + (poplevel): Don't call poplevel_class; abort in a class + binding level is seen. + * semantics.c (finish_translation_unit): Use pop_everything. + * parse.y (member_init): Allow errors. + (pending_inline): Call finish_function. + * parse.c: Regenerated. + * Makefile.in (CONFLICTS): Adjust. + +1999-09-17 Gabriel Dos Reis + + * error.c: Reduce code duplication. + (dump_template_value): New function. + (dump_type_real): Use it. + (dump_decl): Likewise. + (dump_function_name): Likewise. + (dump_function_decl): Don't be too talkative about function return + type variety. + +1999-09-16 Kaveh R. Ghazi + + * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero. + + * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy. + +1999-09-16 Jason Merrill + + * decl2.c (finish_file): Also call check_global_declarations for + the pending_statics list. + +1999-09-15 Jason Merrill + + * lex.c (cp_pragma_implementation): Allow #pragma implementation + in header files. + +1999-09-15 Richard Henderson + + * lex.c (mark_impl_file_chain): Follow the next chain. + +1999-09-15 Mark Mitchell + + * decl.c (warn_extern_redeclared_static): Simplify. Catch + problems with extern "C" functions redeclared as static. + (duplicate_decls): When a builtin is redeclared static, make the + new function have internal linkage. + +1999-09-15 Mark Mitchell + + * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR. + * pt.c (tsubst_copy): Likewise. + * tree.c (search_tree): Likewise. + (mapcar): Likewise. + +1999-09-15 Kaveh R. Ghazi + + * typeck2.c (ack): Don't declare progname. + +1999-09-14 Alexandre Oliva + + * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy + filenames with ggc_alloc_string. + +1999-09-14 Mark Mitchell + + * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the + TARGET_EXPR. + * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on + the TARGET_EXPR. + * cvt.c (build_up_reference): Likewise. + * tree.c (build_cplus_new): Likewise. + (get_target_expr): Likewise. + +Tue Sep 14 01:45:10 1999 Marc Espie + + * Makefile.in: Prepend $(SHELL) to move-if-change calls. + +1999-09-13 Mark Mitchell + + * cp-tree.h (build_target_expr): New function. + * call.c (build_conditional_expr): Use build_target_expr. + (convert_like): Likewise. + (build_over_call): Likewise. + * cvt.c (build_up_reference): Likewise. + * decl.c (build_cleanup_on_safe_obstack): Fold into ... + (destroy_local_var): Here. + (build_target_expr): New function. + * tree.c (build_cplus_new): Use it. + (get_target_expr): Likewise. + +1999-09-13 Nathan Sidwell + + * typeck.c (expr_sizeof): Don't decay arrays and functions. + Remove misleading comment. + (build_compound_expr): Don't decay arrays. + +1999-09-13 Jason Merrill + + * call.c (build_conditional_expr): Always use a TARGET_EXPR for + class rvalues again. + +Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi + + * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. + + * g++spec.c: Include gcc.h. + (lang_specific_driver): Constify a char*. Call xcalloc, not + xmalloc/bzero. All calls to the function pointer parameter now + explicitly call `fatal'. + +1999-09-12 Mark Mitchell + + * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs. + * cvt.c (ocp_convert): Complete the from and destination types. + Adjust warning about functions always being `true' in conditionals. + * decl.c (duplicate_decls): Don't play funny games with abort. + * error.c (dump_expr): Handle OVERLOADs. + * spew.c (probe_obstack): Remove. + * typeck.c (condition_conversion): Use perform_implicit_conversion. + +1999-09-12 Bernd Schmidt + + * cp-tree.h (auto_function, define_function): Adjust prototypes. + * decl.c (define_function): Lose FUNCTION_CODE arg. All callers + changed. + (auto_function): Likewise, for CODE arg. + Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to... + (builtin_function): ... here. + +1999-09-11 Mark Mitchell + + * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion. + (init_decl_processing): Don't set TREE_PERMANENT for the + error_mark_node. + (start_decl): Don't rebuild non-permanent ARRAY_TYPEs. + (grokdeclarator): Likewise. + (grokparms): Don't check TREE_PERMANENT when building up lists. + * decl2.c (grokfield): Don't assert TREE_PERMANENT. + (mark_inline_for_output): Likewise. + * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT. + * init.c (build_offset_ref): Don't check TREE_PERMANENT. + * lex.c (check_newline): Don't check ggc_p; it is always one. + * pt.c (process_template_parm): Don't check TREE_PERMANENT. + * spew.c (yylex): Don't copy_node or probe_obstacks for + non-permanent CONSTANTs and STRINGs. + * tree.c (build_cplus_array_type_1): Don't fuss with + TREE_PERMANENT on ARRAY_TYPEs. + + * cp-tree.def (CLEANUP_STMT): New node. + * cp-tree.h (language_function): Add name_declared. + (current_function_name_declared): New macro. + (CLEANUP_DECL): New macro. + (CLEANUP_EXPR): Likewise. + (emit_local_var): Likewise. + (finish_decl_cleanup): New function. + * cvt.c (build_up_reference): Simplify. + (ocp_convert): Remove dead code. + * decl.c (start_decl): Remove call to add_decl_stmt. + (grok_reference_init): Adjust, to handle bindings temporaries to + references. Remove dead code. + (initialize_local_var): Don't generate RTL for + declarations here, or build cleanups here. Don't fuss with + obstacks. Replace expand_start_target_temps calls with explicit + setting of stms_are_full_exprs_p. + (destroy_local_var): New function. + (emit_local_var): Likewise. + (cp_finish_decl): Use them, as appropriate. + (start_function): Announce template functions. + (store_parm_decls): Don't call declare_function_name here. + (finish_stmt): Don't start emit base-initialization code when just + building the statement-tree. + * init.c (create_temporary_var): Move add_decl_stmt call ... + (get_temp_regvar): Here. + * pt.c (tsubst_expr): Make DECL_INITIAL look like what + cp_finish_decl would expect. Don't call add_decl_stmt. + * semantics.c (begin_compound_stmt): Call declare_function_name, + if appropriate. + (finish_decl_cleanup): New function. + (expand_stmt): Use emit_local_var to output variables. + (expand_body): Set current_function_name_declared. + +1999-09-10 Mark Mitchell + + * cp-tree.h (finish_cleanup_try_block): New function. + * semantics.c (finish_cleanup_try_block): Add comment. + +Fri Sep 10 10:32:32 1999 Bernd Schmidt + + * cp-tree.h: Delete declarations for all tree nodes now moved to + global_trees. + * decl.c: Delete their definitions. + (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, + FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't + provide defaults. + (init_decl_processing): Call build_common_tree_nodes and + build_common_tree_nodes_2 instead of building their nodes here. + Don't add gc roots for them. + +1999-09-10 Mark Mitchell + + * cp-tree.h (language_function): Rename expanding_p to + x_expanding_p. Rename named_label_uses to x_named_label_uses. + (expanding_p): Adjust accordingly. + (TREE_VIA_PRIVATE): Fix typo in comment. + (DECL_REFERENCE_SLOT): Remove. + (SET_DECL_REFERENCE_SLOT): Likewise. + * decl.c (named_label_uses): Adjust. Remove chicken comment. + (push_overloaded_decl): Don't truncate the chain of bindings when + adding an overloaded function. + (grok_reference_init): Don't use DECL_REFERENCE_SLOT. + (initialize_local_var): Fix typo in comment. + (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up. + * decl2.c (start_objects): Make the fact that we are expanding + the generated function right away explicit. + (start_static_storage_duration_function): Likewise. + (finish_file): Fix typo in comment. + * init.c (build_vec_init): Correct bugs in handling cleanups. + * semantics.c (maybe_convert_cond): New function. + (FINISH_COND): Always store the condition, even if there's + a declaration. + (finish_if_stmt_cond): Use maybe_convert_cond. + (finish_while_stmt_cond): Likewise. + (finish_do_stmt): Likewise. + (finish_for_cond): Likewise. + (expand_cond): Adjust. + + * cp-tree.h (FN_TRY_BLOCK_P): New macro. + * init.c (perform_member_init): Remove obstack machinations. + (expand_cleanup_for_base): Likewise. + (finish_init_stmts): Mark the statement-expression as used. + * method.c (emit_thunk): Use tree-generating functions, not + RTL. + (do_build_copy_constructor): Likewise. + (do_build_assign_ref): Likewise. + (synthesize_method): Likewise. Keep track of line numbers. + * pt.c (tsubst_expr): Handle various kinds of try blocks. + * semantics.c (expand_stmts): Remove. + (begin_function_try_block): Set FN_TRY_BLOCK_P. + (finish_function_try_block): Be careful rechaining + function try blocks. + (expand_stmt): Loop through all the statements at a given level. + (exapnd_body): Be careful with line-numbers here too. Prepare for + being called directly from the parser. + + * cp-tree.h (finish_function): Adjust prototype. + * decl.c (finish_function): Return the function compiled. + * pt.c (instantiate_decl): Don't play games with obstacks. + * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF. + (search_tree): Likewise. + * typeck.c: Fix typo in comment. + * typeck2.c (store_init_value): Add comment. + + * cp-tree.h (CPTI_ATEXIT): New macro. + (atexit_node): Likewise. + * decl.c (destroy_local_static): New function, broken out from ... + (expand_static_init): Here. + + * rtti.c (get_tinfo_var): These should always be global + (expand_si_desc): Use tree, not RTL, functions to generate code. + (expand_class_desc): Likewise. + (expand_ptr_desc): Likewise. + (expand_attr_desc): Likewise. + (expand_generic_desc): Likewise. + (synthesize_tinfo_fn): Likewise. + +1999-09-09 Mark Mitchell + + * semantics.c (RECHAIN_STMTS): Remove `last' parameter. + (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with + RECHAIN_STMTS. + (RECHAIN_STMST_FROM_CHAIN): Likewise. + + * parse.y (simple_stmt): Fix typo in last change. + + * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro. + (STMT_IS_FULL_EXPR_P): Likewise. + (STMT_LINENO_FOR_FN_P): Likewise. + (prep_stmt): New function. + (building_stmt_tree): Tweak for safety. + * pt.c (tsubst_expr): Use prep_stmt throughout. + (add_tree): Move it to semantics.c + * semantics.c (add_tree): Move it here. + (finish_expr_stmt_real): New function. + (finish_expr_stmt): Use it. + (finish_if_stmt_cond): Use FINISH_COND. + (finish_while_stmt_cond): Likewise. + (finish_for_cond): Likewise. + (finish_stmt_tree): Tweak line-number handling. + (prep_stmt): New function. + (expand_stmt): Use it. + + * cp-tree.h (begin_switch_stmt): Adjust prototype. + (finish_switch_cond): Likewise. + * parse.y (simple_stmt): Adjust accordingly. + * parse.c: Regenerated. + * pt.c (tsubst_expr): Adjust accordingly. + * semantics.c (expand_cond): New function. + (FINISH_COND): New macro. + (begin_switch_stmt): Build the SWITCH_STMT here. + (finish_switch_stmt_cond): Not here. + (expand_stmt): Adjust calls to begin_switch_stmt and + finish_switch_cond. Use expand_cond throughout. + + * dump.c (dequeue_and_dump): Dump types for constants. + Describe DECL_ARG_TYPE more intuitively. + Handle ARRAY_REF. + + * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC. + (lang_cleanup_tree): Remove. + * lex.c (make_lang_type): Use ggc_alloc to allocate + TYPE_LANG_SPECIFIC. + + Reorganize per-function data. + * cp-tree.h (saved_scope): Add function_decl, bindings. + (language_function): Rename binding_level to bindings. + (cp_function_chain): Use the current_function, not the + outer_function_chain. + (current_class_ptr): Make it work, even when there's no + current function. + (current_class_ref): Likewise. + (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New + macros. + (clear_temp_name): Remove. + * decl.c (check_function_type): New function, broken out from + start_function. + (current_binding_level): Adjust definition. + (pushlevel): Simplify. + (poplevel): Don't use named_label_uses when we're outside + a function scope. + (mark_saved_scope): Mark function_decl and bindings. + (maybe_push_to_top_level): Don't unconditionally push a new + function context. Save bindings and the current_function_decl. + Don't clear named_labels. + (pop_from_top_level): Pop function context if appropriate. + (init_decl_processing): Set init_lang_status and free_lang_status, + rather than save_lang_status and restore_lang_status. + (start_function): Take SF_* flags. Don't clear per-function data. + Reorder and simplify to use new per-function data code. Add + asserts. + (store_parm_decls): Don't call init_function_start here. + (finish_function): Adjust for new handling of per-function data. + (push_cp_function_context): Simplify. + (mark_cp_function_context): Change binding_level to bindings. + * decl2.c (clear_temp_name): Remove. + (start_objects): Use SF flags to start_function. + (start_static_storage_duration_function): Likewise. + * except.c (start_anon_func): Remove redundant calls to + push_function_context_to. Use SF flags to start function. + (end_anon_func): Remove redundant call to pop_function_context + from. + * lex.c (reinit_parse_for_function): Don't initialize per-function + data. + * method.c (emit_thunk): Clear current_function after calling + assemble_end_function. Use SF flags for start_function. + (synthesize_method): Use SF flags for start_function. + * parse.c: Regenerated. + * parse.y (fn.defpen): Likewise. + (pending_inline): Clear current_function, even if something goes + wrong. + * pt.c (instantiate_decl): Use SF flags to start_function. + Don't save and restore expanding_p. + (add_tree): Handle the case where we are outside any function. + (end_tree): Likewise. + * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function. + * semantics.c (begin_function_definition): Likewise. + (expand_body): Likewise. + +1999-09-09 Nathan Sidwell + + * cp-tree.h (convert_to_void): Prototype new function. + (require_complete_type_in_void): Remove prototype. + * cvt.c (convert_to_void): New function. + (ocp_convert): Use convert_to_void. + * decl.c (cplus_expand_expr_stmt): Likewise, for complete + expressions. + * typeck.c (require_complete_type_in_void): Remove function. + (build_compound_expr): Use convert_to_void. + (build_static_cast): Likewise. + (build_c_cast): Likewise. + * semantics.c (finish_expr_stmt): Do not decay full expressions. + + * typeck.c (build_x_compound_expr): Add FIXME. + +1999-09-08 Mark Mitchell + + * cp-tree.h (scratch_tree_cons): Remove. + * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons, + and perm_tree_cons with plain tree_cons. + * class.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * expr.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * method.c: Likewise. + * parse.y: Likewise. + * pt.c: Likewise. + * repo.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * typeck.c: Likewise. + * parse.c: Regenerated. + * tree.c (build_srcloc): Simplify. + +1999-09-08 Bruce Korb autogen@linuxbox.com + + * Makefile.in: Give the gperf user a hint about why "gperf -F" fails. + +1999-09-08 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove permanent_attr. + Remove next. + (LANG_DECL_PERMANENT): Remove. + * decl.c (duplicate_decls): Don't mess about with obstacks trying + to free memory. + (lang_mark_tree): Mark DECL_LANG_SPECIFIC. + * lex.c (free_lang_decl_chain): Remove. + (build_lang_decl): Don't use obstacks. + (retrofit_lang_decl): Likewise. + (copy_lang_decl): Likewise. + + * cp-tree.h (saved_scope): Remove old_binding_level and + function_decl. Tidy up. + * decl.c (mark_saved_scope): Don't set them. + (maybe_push_to_top_level): Clear memory. + + * decl.c (layout_var_decl): Change prototype. Don't complete + types for external objects. + (check_initializer): Likewise. Tidy. + (initialize_local_var): Complete types here. + (cp_finish_decl): Not here. Reorganize a little. + (grokvardecl): Don't complete types here. + + * decl.c (start_function): Clear last_dtor_insn and + last_parm_cleanup_insn. + (push_cp_function_context): Just copy over a little of + the old context, not all of it. + + * cp-tree.h (copy_to_permanent): Remove. + (permanent_p): Likewise. + * decl.c (building_typename_type): Don't use copy_to_permanent. + (start_decl): Likewise. + (grok_reference_init): Likewise. + (cp_finish_decl): Likewise. + * init.c (build_new_1): Don't use mapcar. + (build_vec_delete_1): Don't use copy_to_permanent. + (build_vec_init): Likewise. + * parse.y (primary): Likewise. + * parse.c: Regenerated. + * pt.c (push_template_decl_real): Don't use copy_to_permanent. + (lookup_template_class): Likewise. + (tsubst_friend_function): Likewise. + (instantiate_class_template): Likewise. + (tsubst_decl): Likewise. + (tsubst): Likewise. + (instantiate_template): Likewise. + (unify): Likewise. + * rtti.c (get_tinfo_fn): Likewise. + (build_dynamic_cast): Likewise. + * semantics.c (finish_if_stmt_cond): Likewise. + (finish_while_stmt_cond): Likewise. + (finish_do_stmt): Likewise. + (finish_for_cond): Likewise. + (finish_for_expr): Likewise. + (finish_cleanup): Likewise. + (add_decl_stmt): Likewise. + (finish_named_return_value): Likewise. + (finish_qualified_call_expr): Likewise. + * tree.c (perm_manip): Remove. + (build_exception_variant): Don't use copy_to_permanent. + (permanent_p): Remove. + (copy_to_permament): Remove. + (build_min_nt): Don't use copy_to_permanent. + (build_min): Likewise. + (min_tree_cons): Likewise. + * typeckc.c (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + +1999-09-07 Mark Mitchell + + * decl.c (ggc_p): Set it to 1. + (mark_saved_scope): Add prototype. + +1999-09-07 Richard Henderson + + * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete. + * typeck.c (self_promoting_args_p): Delete. + +1999-09-07 Jason Merrill + + * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT. + (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove. + +1999-09-07 Mark Mitchell + + * Makefile.in (tree.o): Depend on ggc.h. + * class.c (make_method_vec): Remove. + (free_method_vec): Likewise. + (free_method_vecs): Remove. + (add_method): Don't use them. + * cp-tree.def (PTRMEM_CST): Make it longer. + (TEMPLATE_PARM_INDEX): Make it shorter. + * cp-tree.h (BINDING_HAS_LEVEL_P): New macro. + (template_parm_index): Remove RTL field. + (ptrmem_cst): Add RTL field. + (finish_function): Removed parameter. + (process_next_inline): Change prototype. + (init_cplus_unsave): Rename to init_tree. + (binding_init): Remove. + * decl.c (free_binding_nodes): Remove. + (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P. + (pop_binding): Don't use free_binding_nodes. + (free_binding_vecs): Remove. + (store_bindings): Don't use them. + (pop_from_top_level): Likewise. + (lookup_namespace_name): Simplify. + (build_typename_type): Don't use obstack_free. + (unqualified_namespace_lookup): Simplify. + (lookup_name_real): Simplify. + (start_function): Remove comment about leaks. + (finish_function): Removed nested parameter. Call + expand_end_bindings even when building_stmt_tree. + Call ggc_push_context and ggc_pop_context around + rest_of_compilation, if necessary. + (mark_cp_function_context): Handle a NULL language-context. + (lang_mark_false_label_stack): Fix typo. + (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD, + TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on + pointer to method types. + (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC. + * decl2.c (finish_objects): Adjust call to finish_function. + (finish_static_store_duration_function): Likewise. + (do_nonmember_using_decl): Remove call to binding_init. + * except.c (end_anon_func): Adjust call to finish_function. + * lex.c (mark_impl_file_chain): New function. + (init_parse): Call init_tree, not init_cplus_unsave. + Add GC roots. + (cp_pramga_interface): Use xmalloc, not permalloc. + (cp_pragma_implementation): Likewise. + (begin_definition_of_inclass_inline): Simplify. + (process_next_inline): Adjust prototype. + (do_scoped_id): Don't call binding_init. + (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc. + * method.c (emit_thunk): Adjust call to finish_function. + (synthesize_method): Likewise. + * parse.y (%union): Add a new `pi' variant. + (PRE_PARSED_FUNCTION_DECL): Use it. + (fn.defpen): Likewise. + (fndef): Adjust call to finish_function. + * pt.c (instantiate_decl): Likewise. + * rtti.c (syntheisze_tinfo_fn): Likewise. + * semantics.c (expand_body): Likewise. + * tree.c: Include ggc.h. + (mark_list_hash): New function. + (binding_init): Remove. + (init_cplus_unsave): Rename to ... + (init_tree): This. Add GC roots. + +1999-09-05 Mark Mitchell + + Get ready for garbage collection. + * Makefile.in (CXX_TREE_H): Add varray.h + (lex.o): Depend on ggc.h. + (decl.o): Likewise. + (decl2.o): Likewise. + (method.o): Likewise. + (search.o): Likewise. + (pt.o): Likewise. + (repo.o): Likewise. + * class.c: Include ggc.h. + (current_class_name): Remove. + (current_class_type): Likewise. + (current_access_specifier): Likewise. + (previous_class_type): Likewise. + (previous_class_values): Likewise. + (class_cache_firstobj): Likewise. + (current_lang_base): Likewise. + (current_lang_stack): Likewise. + (current_lang_stacksize): Likewise. + (lang_name_c): Likewise. + (lang_name_cplusplus): Likewise. + (lang_name_java): Likewise. + (current_lang_name): Likewise. + (base_layout_decl): Likewise. + (access_default_node): Likewise. + (access_public_node): Likewise. + (access_protected_node): Likewise. + (access_private_node): Likewise. + (access_default_virtual_node): Likewise. + (access_public_virtual_node): Likewise. + (access_protected_virtual_node): Likewise. + (access_private_virtual_node): Likewise. + (signed_zero_node): Likewise. + (init_class_processing): Don't build base_layout_decl. + (push_lang_context): Adjust now that current_lang_base is a varray. + (pop_lang_context): Likewise. + * cp-tree.h: Include varray.h. + (cp_global_trees): Add access_default, access_public, + access_protected, access_private, access_default_virtual, + access_public_virtual, access_protected_virtual, + access_private_virtual, ctor_identifier, delta2_identifier, + delta_identifier, dtor_identifier, in_charge_identifier, + index_identifier, nelts_identifier, this_identifier, + pfn_identifier, pfn_or_delta2_identifier, vptr_identifier, + lang_name_c, lang_name_cplusplus, lang_name_java, + empty_except_spec, null, jclass, minus_one, terminate. + (saved_scope): Move here from decl.c. Define globals in terms of + saved_scope: current_namespace, current_class_name, + current_class_type, current_access_specifier, current_lang_stack, + current_lang_base, current_lang_name, current_function_parms, + current_template_parms, processing_template_decl, + processing_specialization, processing_explicit_instantiation, + previous_class_type, previous_class_values, class_cache_firstobj. + (scope_chain): New variable. + (init_pt): New function. + * decl.c (current_namespace): Remove. + (this_identifier, in_charge_identifier, ctor_identifier): Likewise. + (dtor_identifier, pfn_identifier, index_identifier): Likewise. + (delta_identifier, delta2_identifier): Likewise. + (pfn_or_delta2_identifier, tag_identifier): Likewise + (vt_off_identifier, empty_except_spec, null_node): Likewise. + (current_function_parms, current_lang_base): Remove. + (current_lang_stack, previous_class_values): Remove. + (class_binding_level): Macroize. + (saved_scope): Remove. + (current_saved_scope): Rename to scope_chain. + (mark_saved_scope): Adjust for new scope structure. + (maybe_push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (duplicate_decls): Adjust now that current_lang_base is a varray. + (build_typename_type): Call ggc_add_tree_hash_table_root. + (init_decl_processing): Call init_pt. Call push_to_top_level to + set up globals. Add GC roots. + (xref_basetypes): Adjust now that current_lang_base is a varray. + * decl.h (this_identifier): Remove. + (in_charge_identifier): Likewise. + * decl2.c: Don't include varray.h. + (current_namespace): Remove. + (init_decl2): Add GC roots. + * except.c (Terminate): Remove. + (init_exception_processing): Use terminate_node instead. + (build_terminate_handler): Likewise. + * init.c (nc_nelts_field_id): Remove. + (minus_one): Likewise. + (init_init_processing): Use minus_one_node and nelts_identifier + instead. Add GC roots. + (jclass_node): Remove. + (build_new_1): Use nelts_identifier. + (build_vec_init): Likewise. + (build_vec_delete): Likewise. + * lex.c: Include ggc.h. + (defarg_fn): Move declaration early. + (defarg_parms): Likewise. + (init_parse): Add GC roots. + (handle_cp_pragma): Remove redundant declaration of + pending_vtables. + * method.c: Include ggc.h. + (btypelist): Make it a varray. All uses changed. + (ktypelist): Likewise. + (init_method): Add GC roots. + * pt.c: Don't include varray.h. Include ggc.h. + (current_template_parms): Remove. + (processing_template_decl): Likewise. + (processing_specialization): Likewise. + (processing_explicit_instantiation): Likewise. + (init_pt): New function. + * repo.c: Include ggc.h. + (init_repo): Add GC roots. + * search.c: Don't include varray.h. + (_vptr_name): Remove. + (lookup_field_1): Use vtpr_identifier instead. + (expand_indirect_vtbls_init): Remove redundant declaration of + in_charge_identifier. + (init_search_processing): Use vptr_identifier. + +1999-09-05 Richard Henderson + Bernd Schmidt + Mark Mitchell + + * Makefile.in (parse.o): Depend on ggc.h. + (decl2.o): Depend on ggc.h. + (init.o): Depend on ggc.h. + * cp-tree.h (init_decl2): Declare. + (cp_parse_init): Likewise. + * decl.c (ggc_p): Define to zero. + (mark_saved_scope): New function. + (init_decl_processing): Call cp_parse_init, and cp_decl2. + Register GC roots. + (expand_static_init): Add GC roots. + * decl2.c: Include ggc.h. + (init_decl2): New function. + * init.c: Include ggc.h. + (init_init_processing): Add GC roots. + * parse.y: Include ggc.h. + (cp_parse_init): New function. + +1999-09-04 Mark Mitchell + + * decl.c (init_decl_processing): Set mark_lang_status. + (lang_mark_false_label_stack): Adjust prototype. + * decl2.c (grok_function_init): Remove extraneous declaration of + abort_fndecl. + + * Make-lang.in (cc1plus): Remove dependency on GGC. + * Makefile.in (OBJS): Don't mention ggc-simple.o. + (OBJDEPS): Don't mention ggc-simple.o. + + * Make-lang.in (cc1plus): Depend on $(GGC). + * Makefile.in (OBJS): Add ggc-simple.o. + (OBJDEPS): Likewise. + * cp-tree.h (language_function): Rename members to `x_' versions; + we now have x_named_labels, x_ctor_label, x_dtor_label, + x_base_init_list, x_member_init_list, x_base_init_expr, + x_current_class_ptr, x_current_class_ref, x_last_tree, + x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and + x_result_rtx. + (dtor_label, ctor_label, current_base_init_list, + current_member_init_list, base_init_expr, current_class_ptr, + current_class_ref, last_tree, last_expr_type): Adjust accordingly. + * decl.c: Include ggc.h. + (last_dtor_insn): Adjust to use x_ names. + (last_parm_cleanup_insn): Likewise. + (original_result_rtx): Likewise. + (named_labels): Likewise. + (mark_binding_level): New function. + (mark_cp_function_context): Likewise. + (mark_false_label_stack): Likewise. + (lang_mark_tree): Likewise. + (lang_cleanup_tree): Likewise. + +1999-09-03 Mark Mitchell + + * Makefile.in (CXX_TREE_H): Include function.h. + (decl.o): Don't depend on function.h. + (decl2.o): Likewise. + (typeck.o): Likewise. + (init.o): Likewise. + (method.o): Likewise. + * cp-tree.h: Include function.h. + (cp_function): Rename to language_function. Remove next. + (cp_function_chain): Make it a macro, not a variable. + (push_cp_function_context): Don't declare. + (pop_cp_function_context): Likewise. + * decl.c: Don't include function.h. + (push_cp_function_context): Make it static. Make it suitable for + a save_lang_status callback. + (pop_cp_function_context): Likewise. + (maybe_push_to_top_level): Call push_function_context_to, not + push_cp_function_context. + (pop_from_top_level): Call pop_function_context_from, not + pop_cp_function_context. + (init_decl_processing): Set save_lang_status and + restore_lang_status. Call push_function_context_to, not + push_cp_function_context. + (cp_function_chain): Remove. + * decl2.c: Don't include function.h. + * except.c: Don't include function.h. + (start_anon_func): Call push_function_context_to, not + push_cp_function_context. + (end_anon_func): Call pop_function_context_from, not + pop_cp_function_context. + * init.c: Don't include function.h. + * lex.c (begin_definition_of_inclass_inline): Call + push_function_context_to, not push_cp_function_context. + (process_next_inline): Call pop_function_context_from, not + pop_cp_function_context. + * method.c: Don't include function.h. + (synthesize_method): Call push_function_context_to, not + push_cp_function_context. Call pop_function_context_from, not + pop_cp_function_context. + * typeck.c: Don't include function.h. + + * decl.c (expand_static_init): Tweak handling of static + initializations for objects without constructors. + +1999-09-03 Nathan Sidwell + + * typeck.c (build_indirect_ref): Reject dereference of pointer to + void. + +1999-09-02 Mark Mitchell + + * cp-tree.h (cp_function): Move here, from decl.c. + (cp_function_chain): Declare. + (dtor_label): New macro, instead of variable. + (ctor_label): Likewise. + (current_base_init_list): Likewise. + (current_member_init_list): Likewise. + (base_init_expr): Likewise. + (current_class_ptr): Likewise. + (current_class_ref): Likewise. + (last_tree): Likewise. + (last_expr_type): Likewise. + (current_function_returns_value): Likewise. + (current_function_returns_null): Likewise. + (current_function_just_assigned_this): Likewise. + (current_function_parms_stored): Likewise. + (temp_name_counter): Likewise. + (static_labelno): Likewise. + (expanding_p): Likewise. + (stmts_are_full_exprs_p): Likewise. + (in_function_try_handler): Likewise. + (lang_type): Remove nested type_flags. All uses changed. + * call.c (ctor_label): Remove. + (dtor_label): Likewise. + * class.c (current_class_ptr): Remove. + (current_class_ref): Likewise. + * decl.c (static_labelno): Remove. + (dtor_label): Likewise. + (last_dtor_insn): New macro, instead of variable. + (last_parm_cleanup_insn): Likewise. + (original_result_rtx): Likewise. + (in_function_try_handler): Remove. + (named_label_uses): New macro, instead of variable. + (named_labels): Likewise. + (current_function_returns_value): Remove. + (current_function_returns_null): Likewise. + (current_function_assigns_this): New macro, instead of variable. + (current_function_just_assigned_this): Likewise. + (current_binding_level): Likewise. + (init_decl_processing): Call push_cp_function_context. + (cp_function): Move to cp-tree.h + (cp_function_chain): Make it global. + (temp_name_counter): Remove. + (push_cp_function_context): Simplify. + (pop_cp_function_context): Likewise. + * decl2.c (temp_name_counter): Remove. + * init_c (current_base_init_list): Likewise. + (current_member_init_list): Likewise. + (base_init_expr): Likewise. + * method.c (static_labelno): Likewise. + * pt.c (last_tree): Likewise. + * semantics.c (expanding_p): Likewise. + (stmts_are_full_exprs_p): Likewise. + (last_expr_type): Likewise. + * typeck.c (dtor_label): Likewise. + (ctor_label): Likewise. + +1999-09-01 Alex Samuel + + * decl2.c (arg_assoc_template_arg): New prototype. New function. + (arg_assoc_class): Use arg_assoc_template_arg for template + arguments. + (arg_assoc): Likewise. + * pt.c (mangle_class_name_for_template): Allow member template + template arguments. + +1999-09-02 Nathan Sidwell + + * call.c (build_conditional_expr): Warn on enum mismatches. + (convert_arg_to_ellipsis): Move non-pod check to after + conversion. + +1999-09-01 Kaveh R. Ghazi + + * gxx.gperf (hash, is_reserved_word): Add prototypes. + + * init.c (build_vec_init): Initialize variable `try_block'. + + * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts. + Likewise for bzero/memset. + (token_getch, token_put_back): Add static prototypes. Remove + `inline' from the definitions. + (retrofit_lang_decl): Call memset, not bzero, to avoid casts. + +1999-09-01 Mark Mitchell + + * cp-tree.h (lang_type): Move align into type_flags. + (CLASSTYPE_ALIGN): Adjust accordingly. + * call.c (direct_reference_binding): Remove misleading comment. + +1999-08-30 Kaveh R. Ghazi + + * parse.y (language_string): Constify. + +1999-08-30 Kaveh R. Ghazi + + * repo.c (getpwd): Don't prototype. + * xref.c (getpwd): Likewise + +1999-08-30 Kaveh R. Ghazi + + * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a. + Remove hacks for stuff which now comes from libiberty. + +1999-08-30 Jason Merrill + + * cp-tree.h (IS_AGGR_TYPE_2): Fix typo. + +1999-08-30 Mark Mitchell + + * cp-tree.h (begin_init_stmts): Declare. + (finish_init_stmts): Likewise. + * cvt.c (build_up_reference): Wrap the declaration of a temporary + in a statement-expression so that we will see it when expanding + tree structure later. + * init.c (begin_init_stmts): Don't make it static. + (finish_init_stmts): Likewise. + + * cp-tree.h (start_handler_parms): New function. + (expand_start_catch_block): Take only one parameter. + (start_handler_parms): New function. + * decl.c (start_handler_parms): Define it. + * except.c (process_start_catch_block): Take only one parameter. + Don't call grokdeclarator here. + (expand_start_catch_block): Don't call grokdeclarator here, + either. + * parse.y (handler_args): Adjust call to + expand_start_catch_block. Use start_handler_parms. + * pt.c (push_template_decl_real): Make permanent lists have + permanent elements. + (tsubst_expr): Adjust calls to expand_start_catch_block + appropriately. + * semantics.c (expand_stmt): Likewise. + +1999-08-29 Alex Samuel + + * pt.c (push_template_decl_real): Use template declaration from + class type if it exists. + +1999-08-29 Mark Mitchell + + * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition. + (maybe_inject_for_scope_var): Declare it. + (initialize_local_var): Likewise. + * decl.c (maybe_inject_for_scope_var): Make it global. + (initialize_local_var): Likewise. Move cleanup handling here, + from cp_finish_decl. + (make_rtl_for_nonlocal_decl): Use + push_obstacks_nochange/pop_obstacks, rather than + end_temporary_allocation/resume_temporary_allocation. + (cp_finish_decl): Try to complete the type of a variable when it + is declared. Move cleanup-handling to initialize_local_var. + (expand_static_init): Use tree-building code, rather than + RTL-building code. + * decl2.c (get_temp_name): Assert non-initializedness of + temporaries. + * init.c (create_temporary_var): Move RTL-assigning code to ... + (get_temp_regvar): Here. + * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here. + * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just + call initialize_local_var to generate initialization code. + +1999-08-29 Kaveh R. Ghazi + + * cp-tree.h (fndecl_as_string, type_as_string, + type_as_string_real, args_as_string, decl_as_string, + expr_as_string, code_as_string, language_as_string, + parm_as_string, op_as_string, assop_as_string, cv_as_string, + lang_decl_name, cp_file_of, lang_printable_name): Constify a char*. + + * errfn.c (cp_printer): Likewise. + + * error.c (cp_printer, fndecl_as_string, type_as_string_real, + type_as_string, expr_as_string, decl_as_string, lang_decl_name, + cp_file_of, code_as_string, language_as_string, parm_as_string, + op_as_string, assop_as_string, args_as_string, cv_as_string): + Likewise. + + * tree.c (lang_printable_name): Likewise. + +1999-08-28 Richard Henderson + + * decl2.c (arg_assoc_class): Bail if the class is a builtin type. + +1999-08-28 Mark Mitchell + + * cp-tree.h (strip_array_types): New function. + * decl.c (maybe_deduce_size_from_array_init): New function, split + out from cp_finish_decl. + (layout_var_decl): Likewise. + (maybe_commonize_var): Likewise. + (maybe_inject_for_scope_var): Likewise. + (initialize_local_var): Likewise. + (build_cleanup_on_safe_obstack): Likewise. + (check_initializer): Likewise. + (make_rtl_for_nonlocal_decl): Likewise. + (cp_finish_decl): Use them. + * typeck.c (strip_array_types): New function. + + * cp-tree.def (LABEL_STMT): New tree node. + * cp-tree.h (LABEL_STMT_LABEL): New macro. + (shadow_label): Remove. + (declare_local_label): New function. + (finish_label_decl): Likewise. + * decl.c (make_label_decl): New function, split out from + lookup_label. + (shadowed_labels): Remove. + (binding_level): Add shadowed_labels. + (clear_binding_level): Remove. + (push_binding_level): Just bzero the new binding level. + (pushlevel): Fix indentation. + (pop_label): New function. + (pop_labels): Likewise, split out from poplevel. + (poplevel): Pop local labels. Use pop_labels. + (maybe_push_to_top_level): Don't clear shadowed_labels. + (lookup_label): Use make_label_decl. + (shadow_label): Remove. + (declare_local_label): New function. + (define_label): Simplify. + (start_function): Don't clear shadowed_labels. + (cp_function): Remove shadowed_labels. + (push_cp_function_context): Don't save shadowed_labels. + (pop_cp_function_context): Don't restore it. + * dump.c (dequeue_and_dump): Handle LABEL_STMT. + * parse.y (label_decl): Use finish_label_decl. + * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label + declarations. + * semantics.c (finish_label_stmt): Add a LABEL_STMT when + building_stmt_tree. + (finish_label_decl): New function. + (expand_stmt): Handle LABEL_STMTs and local label declarations. + +1999-08-26 Mark Mitchell + + * decl.c (lookup_label): Build labels on the permanent obstack + when building statement trees. Don't build RTL for labels when + building statement trees. + * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when + building statement trees. + (finish_label_stmt): Likewise. + (expand_stmt): Adjust accordingly. + * pt.c (tsubst_expr); Likewise. + (do_decl_instantiation): Robustify. + + * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro. + * tree.c (build_cplus_new): Set it. + * expr.c (cplus_expand_expr): Use it. + * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR. + + * decl.c (store_parm_decls): Reset immediate_size_expand. + (finish_function): Likewise. + + * tree.c (cplus_unsave_expr_now): Don't return a value. + + * semantics.c (do_poplevel): Always initialize the return value. + +1999-08-26 Gavin Romig-Koch + + * cp-tree.h (cplus_unsave_expr_now) : Correct return type. + * tree.h (cplus_unsave_expr_now) : Same. + +1999-08-25 Mark Mitchell + + * decl.c (grokdeclarator): Amend comment. + * except.c (expand_start_catch_block): Call push_template_decl for + catch-block parameters. + * method.c (synthesize_method): Build an empty compound statement + for the body of a constructor. + +1999-08-25 Jason Merrill + + * tree.c (cp_build_qualified_type_real): If we're asking for the + same quals we already have, just return. + +1999-08-25 Mark Mitchell + + * cp-tree.def (SUBOBJECT): New tree node. + * cp-tree.h (CLEANUP_P): New macro. + (SUBOBJECT_CLEANUP): Likewise. + (keep_next_level): Add parameter. + (get_temp_regvar): Don't declare. + (emit_base_init): Remove parameter. + (expand_aggr_init): Rename to build_aggr_init. + (expand_vec_init): Rename to build_vec_init. + (do_pushlevel): Remove. + (do_poplevel): Likewise. + (finish_cleanup): New function. + (finish_subobject): Likewise. + (stmts_are_full_exprs_p): New variable. + * decl.c (keep_next_level): Add parameter. + (cp_finish_decl): Use build_aggr_init, not + expand_aggr_init. Use finish_expr_stmt to expand the code. + (expand_static_init): Use tree-generating, not RTL-generating, + functions to handle the initialization. + (start_function): Remove dead code. Always have a momentary + obstack inside the function, even before hitting the first curly + brace. + (cplus_expand_expr_stmt): Move calls to + expand_{start,end}_target_temps into semantics.c. + (cp_function): Add stmts_are_full_exprs_p. + (push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + * decl2.c (get_temp_regvar): Move to init.c. + (do_static_initialization): Use build_{aggr,vec}_init. + (do_static_destruction): Fix typo in comment. + * dump.c (dequeue_and_dump): Handle INIT_EXPR. + * except.c (expand_throw): Use create_temporary_var. + * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. + * init.c (expand_vec_init_try_block): Remove. + (expand_vec_init_catch_clause): Likewise. + (get_temp_regvar): New function. + (begin_init_stmts): Likewise. + (finish_init_stmts): Likewise. + (perform_member_init): Use build_{aggr,vec}_init. Build up tree + structure here. + (emit_base_init): Likewise. Remove unused parameter. + (expand_virtual_init): Likewise. + (expand_cleanup_for_base): Use finish_subobject. + (expand_aggr_vbase_init_1): Simplify. + (construct_virtual_bases): Use tree-generating functions to build + up initialization. + (expand_aggr_init): Likewise. Rename to build_aggr_init. + (expand_default_init): Likewise. + (expand_aggr_init_1): Likewise. + (expand_vec_init): Rename to build_vec_init. + * method.c (do_build_copy_constructor): Use tree-generating + functions. Don't call clear_last_expr. + (do_build_assign_ref): Likewise. + (synthesize_method): Call clear_last_expr here. + * parse.y (base_init): Don't call clear_last_expr here. + (nodecls): Likewise. + * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. + * semantics.c (do_pushlevel): Move to here. + (do_poplevel): Likewise. + (stmts_are_full_exprs_p): New variable. + (finish_expr_stmt): Handle logic for temoprary cleanup here. + (finish_for_stmt): Use finish_expr_stmt. + (finish_cleanup): New function. + (finish_function_try_block): Fix indentation. + (finish_subobject): New function. + (setup_vtbl_ptr): Call keep_next_level here. + (finish_stmt_expr): Handle a block with no scope inside the + statement-expression. + (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle + SUBOBJECT. + * tree.c (search_tree): Handle INIT_EXPR. + (mapcar): Likewise. + * typeck.c (build_modify_expr): Don't build an RTL_EXPR. + * typeck2.c (store_init_value): Change expand_aggr_init to + build_aggr_init in comment. + +1999-08-25 Mark Mitchell + + * dump.c (dequeue_and_dump): Dump TARGET_EXPRs. + +1999-08-25 Nathan Sidwell + + * decl2.c (handle_class_head): Be graceful about additional + scope qualifiers. Adjust comments to reflect reality. + +1999-08-24 Jason Merrill + + * call.c (build_conditional_expr): Fix typo. + * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an + lvalue before trying to mess with the sides. + + * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly. + +Mon Aug 23 22:17:20 1999 Mumit Khan + + * g++spec.c (lang_specific_driver): Add room for NULL in arglist. + +1999-08-23 Jason Merrill + + * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2. + Return arbitrary pointer or NULL. + (check_eh_spec): Call __throw_type_match_rtti_2. + * tinfo.h (*::dcast): Return int. Add valp parm. + * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers. + * tinfo2.cc (__throw_type_match_rtti_2): Likewise. + (__throw_type_match_rtti): Now just a wrapper. + + * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind. + (init_exception_processing): Don't initialize them. + +1999-08-23 Paul Burchard + + * decl.c (check_default_argument): Fix typo. + +1999-08-22 Mark Mitchell + + * cp-tree.def (STMT_EXPR): Fix typo in node name. + + * dump.c (dump_next_stmt): New function. + (dequeue_and_dump): Use it. + + * pt.c (tsubst_copy): Make sure to initialize return value for a + STMT_EXPR, even when processing_template_decl. + * semantics.c (finish_stmt_expr): A statement-expression whose + last statement is not an expression-statement has type `void'. + +1999-08-20 Mark Mitchell + + * semantics.c (finish_stmt_expr): Fix typo in comment. + * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR. + (mapcar): Likewise. + * init.c (build_vec_delete_1): Make the children of a permanent + BIND_EXPR permanent. + * pt.c (register_specialization): Don't register a specialization + more than once. + +1999-08-18 Andrew Haley + + * method.c (process_overload_item): Call build_mangled_C9x_name () + for all integer parameter types larger than long long. + +1999-08-19 Mark Mitchell + + * pt.c (redeclare_class_template): Merge default template + arguments in both directions. + + * typeck.c (common_type): Undo 1999-08-18 change. Remove + compiler_error message. + +1999-08-19 Jason Merrill + + * cp-tree.h: Declare flag_use_repository. + * pt.c (do_decl_instantiation): Don't complain about duplicate + instantiation with -frepo. + (do_type_instantiation): Likewise. + + * pt.c (push_template_decl_real): Complain about everything + that isn't a valid template. + + * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't + affect inlines. + +1999-08-19 Mark Mitchell + + * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code. + * decl2.c (build_expr_from_tree): Handle it. + * error.c (dump_expr): Likewise. + * pt.c (for_each_template_parm): Likewise. + (tsubst_copy): Likewise. + * tree.c (search_tree): Likewise. + * semantics.c (finish_pseudo_destructor_call): Create it. + +1999-08-18 Mark Mitchell + + * search.c (setup_class_bindings): Robustify. + * typeck.c (common_type): Use same_type_p, not pointer equality, + to compare types. + + * cp-tree.h (build_lang_field_decl): Remove. + * class.c (build_vtable): Replace calls to build_lang_field_decl + with build_lang_decl. + (prepare_fresh_vtable): Likewise. + (finish_struct_1): Likewise. + (init_class_processing): Likewise. + * decl.c (push_using_decl): Likewise. + (init_decl_processing): Likewise. + (grokvardecl): Likewise. + (build_ptrmemfunc_type): Likewise. + (grokdeclarator): Likewise. + (build_enumerator): Likewise. + * decl2.c (grok_x_components): Likewise. + (do_class_using_decl): Likewise. + * except.c (call_eh_info): Likewise. + * init.c (init_init_processing): Likewise. + * rtti.c (expand_class_decl): Likewise. + * tree.c (build_base_fields): Likewise. + (build_vbase_pointer_fields): Likewise. + * lex.c (build_lang_decl): Build declarations on the permanent + obstack if we're building statmeent trees. + (retrofit_lang_decl): Handle both the full lang_decl and also the + smaller lang_decl_flags here. + (build_lang_field_decl): Remove. + * pt.c (push_template_decl_real): Issue errors for variable + declarations that are not static members. + +1999-08-18 Richard Henderson + + * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too. + (mapcar): Likewise. + +1999-08-17 Mark Mitchell + + * cp-tree.h (back_end_hook): New variable. + * decl2.c (back_end_hook): Define it. + (finish_file): If it's non-NULL, call it. + + * decl.c (add_decl_to_level): New function. + (push_local_binding): Use it. + (find_binding): Fix typo in comment. + (pushdecl): Use add_decl_to_level. Put templates on the + corresponding namespace-scope binding levels. + * dump.c (dequeue_and_dump): Print the specializations of a + template. + * pt.c (push_template_decl_real): Don't push a template multiple + times. + +1999-08-17 Mark Mitchell + + * cp-tree.h (CALL_DECLARATOR_PARMS): New macro. + (CALL_DECLARATOR_QUALS): Likewise. + (CALL_DECARATOR_EXCEPTION_SPEC): Likewise. + * decl.c (grokdeclarator): Adjust to use them. + * decl2.c (grokfield): Likewise. + (reparse_absdcl_as_casts): Likewise. + * lex.c (make_call_declarator): Likewise. + (set_quals_and_spec): Likewise. + * pt.c (tsubst): Likewise. + * tree.c (mapcar): Remove special hack to handle third operand of + a CALL_EXPR. + +1999-08-16 Mark Mitchell + + * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro. + * class.c (build_vtable): Use build_lang_field_decl to build the + VAR_DECLs for vtables. + (prepare_fresh_vtable): Likewise. + * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if + CAN_HAVE_FULL_LANG_DECL_P. + (push_using_decl): Use build_lang_decl to build USING_DECLs. + (grokdeclarator): Use build_lang_decl to build TYPE_DECLs. + * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P. + (build_lang_field_decl): Likewise. + (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much + to copy. + + * cp-tree.def (STMT_EXPR): New tree node. + * cp-tree.h (STMT_EXPR_STMT): New macro. + (store_return_init): Change prototype. + (finish_named_return_value): New function. + (expand_stmt): Likewise. + (expand_body): Likewise. + (begin_stmt_tree): Likewise. + (finish_stmt_tree): Likewise. + (expanding_p): New variable. + (last_expr_type): Likewise. + (building_stmt_tree): New macro. + * decl.c (start_function): Use building_stmt_tree, not + processing_template_decl, where appropriate. + (store_parm_decls): Likewise. + (store_return_init): Move most of the body to semantics.c. + (finish_function): Use building_stmt_tree. + (finish_stmt): Clear last_expr_type here. + (cp_function): Add expanding_p, last_tree, last_expr_type. + (push_cp_function_context): Save them. + (pop_cp_function_context): Restore them. + * decl2.c (setup_vtbl_ptr): Move to semantics.c. + * error.c (dump_expr): Handle STMT_EXPR. + * except.c (expand_start_catch_block): Use building_stmt_tree. + Use add_decl_stmt. + * expr.c (cplus_expand_expr): Handle STMT_EXPR. + (do_case): Move add_tree call to semantics.c. + * parse.y (return_init): Use finish_named_return_value. + (for.init.statement): Use finish_expr_stmt. + * parse.c: Regenerated. + * pt.c (do_pushlevel): Move to semantics.c. + (do_poplevel): Likewise. + (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. + (tsubst_expr): Don't expand all the way to RTL here. Handle + RETURN_INIT and CTOR_INITIALIZER. + (instantiate_decl): Call expand_body after tsubst'ing into + DECL_SAVED_TREE. + * semantics.c (expand_stmts): New function. + (expanding_p): New variable. + (last_expr_type): Likewise. + (finish_expr_stmt): Use building_stmt_tree. + (begin_if_stmt): Likewise. + (finish_if_stmt_cond): Likewise. + (finish_then_clause): Likewise. + (begin_else_clause): Likewise. + (finish_else_clause): Likewise. + (begin_while_stmt): Likewise. + (finish_while_stmt_cond): Likewise. + (finish_while_stmt): Likewise. + (finish_do_body): Likewise. + (finish_do_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (fnish_for_init_stmt): Likewise. + (finish_for_cond): Likewise. + (finish_for_expr): Likewise. + (finish_for_stmt): Likewise. + (finish_break_stmt): Likewise. + (finish_continue_stmt): Likewise. + (finish_switch_cond): Likewise. + (finish_switch_stmt): Likewise. + (finish_case_label): Call add_tree here if necessary. + (finish_goto_statement): Use building_stmt_tree. + (begin_try_block): Likewise. + (begin_function_try_block): Likewise. + (finish_try_block): Likewise. + (finish_function_try_block): Likewise. + (finish_handler_sequence): Likewise. + (finish_function_handler_sequence): Likewise. + (begin_handler): Likewise. + (finish_handler_parms): Likewise. + (finish_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_compound_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (finish_named_return_value): New function. + (setup_vtbl_ptr): Moved here from decl2.c. + (do_pushlevel): Moved here from pt.c. + (do_poplevel): Likewise. + (begin_stmt_expr): Use building_stmt_tree. + (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, + when building_stmt_tree. + (begin_stmt_tree): New function. + (finish_stmt_tree): Likewise. + (expand_stmt): Likewise. + (expand_body): Likewise. + * tree.c (build_cplus_method_type): Make sure the argument types + end up on the same obstack as the METHOD_TYPE. + (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, + THROW_EXPR, STMT_EXPR. + (mapcar): Break out common cases. Handle COMPOUND_EXPR, + MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than + sorry, if an unsupported node is encountered. + * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. + (c_expand_return): Don't call add_tree here. + +1999-08-15 Mark Mitchell + + * pt.c (check_default_tmpl_args): Don't check in local scopes. + (tsubst_decl): Make sure the declaration is on a saveable + obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local + variable. + (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs. + +1999-08-14 Jason Merrill + + Speed up Koenig lookup. + * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm + to return namespaces we've looked at. + * decl2.c (lookup_using_namespace): Likewise. + (add_function): Don't call ovl_member. + (lookup_arg_dependent): Initialize k.namespaces to the list of + namespaces seen in unqualified lookup. + * call.c (equal_functions): Move here from tree.c. + (joust): Use it to handle duplicate candidates. + * tree.c (ovl_member): Use ==. + +1999-08-13 Mark Mitchell + + * cp-tree.def (DECL_STMT): Make it smaller. + * cp-tree.h (lang_decl_flags): Move saved_tree to ... + (lang_decl): ... here. Add next. + (DECL_SAVED_TREE): Adjust accordingly. + (DECL_IMPLICIT_TYPEDEF_P): New macro. + (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. + (DECL_STMT_DECL): Likewise. + (create_implicit_typedef): New function. + (maybe_push_decl): Likewise. + (tsubst_default_argument): New function. + (at_function_scope_p): Likewise. + (add_decl_stmt): Likewise. + (push_permanent_obstack): Likewise. + * call.c (convert_default_arg): Use tsubst_default_argument. + * class.c (add_method): Use push_permanent_obstack. + (build_self_reference): Create a TEMPLATE_DECL for the + self-reference, if necessary. + * decl.c (pseudo_global_level_p): Only look at the current binding + level. + (push_binding): Use push_permanent_obstack. + (create_implicit_typedef): New function. + (pushtag): Use it. + (duplicate_decls): Use push_permanent_obstack. + (maybe_push_decl): New function. + (start_decl): Use it. Remove dead code. Use add_decl_stmt. + (start_decl_1): Remove dead code. + (cp_finish_decl): Remove DECL_STMT handling here. Don't use + pseudo_global_level_p. + (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a + template. + (grokdeclarator): Likewise, for TYPE_DECLs. Don't use + pseudo_global_level_p. + * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in + a template. + (get_sentry): Use push_permanent_obstack. + * dump.c (dequeue_and_dump): Enable DECL_STMT. + * except.c (call_eh_info): Use push_permanent_obstack. + (build_eh_type_ref): Likewise. + (do_pop_exception): Likewise. + (expand_eh_spec): Likewise. + (alloc_eh_object): Likewise. + (expand_throw): Likewise. + * init.c (build_java_class_ref): Likewise. + * lex.c (get_time_identifier): Likewise. + (free_lang_decl_chain): Correct type. + (retrofit_lang_decl): Adjust accordingly. + (build_lang_field_decl): Likewise. + * lex.h (free_lang_decl_chain): Likewise. + * parse.y (lang_extdef): Don't use pseudo_global_level_p. + * parse.c: Regenerated. + * pt.c (tsubst_default_arguments): New function. + (retrieve_local_specialization): Likewise. + (register_local_specialization): Likewise. + (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use + pseudo_global_level_p to determine whether or not a template is + primary. + (lookup_template_class): Likewise. Use create_implicit_typedef. + (instantiate_class_template): Call tsubst_default_arguments for + member functions, if appropriate. + (tsubst_default_argument): New function. + (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs. + * search.c (at_function_scope_p): New function. + * semantics.c (finish_asm_stmt): Use push_permanent_obstack. + (finish_label_stmt): Likewise. + (add_decl_stmt): New function. + (begin_class_definition): Likewise. + (finish_typeof): Likewise. + * tree.c (copy_template_template_parm): Likewise. + (copy_to_permanent): Likewise. + (push_permanent_obstack): Define. + (mark_addressable): Use it. + * typeck.c (mark_addressable): Likewise. + +1999-08-13 Gavin Romig-Koch + + * cp-tree.h (init_cplus_unsave): New. + (cplus_unsave_expr_now): New. + * lex.c (init_parse): Call init_cplus_unsave. + * tree.c (init_cplus_unsave): New. + (cplus_unsave_expr_now): New. + +1999-08-13 Mark Mitchell + + * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and + decl_constant_value to simplify array bounds. + +1999-08-11 Jason Merrill + + * lang-options.h: Add -fms-extensions. + * cp-tree.h: Declare flag_ms_extensions. + * decl2.c: Define it. + * class.c (instantiate_type): Don't complain about taking the address + of a bound member function if -fms-extensions. + * typeck.c (build_unary_op): Likewise. + * decl.c (grokdeclarator): Or about implicit int. + * init.c (resolve_offset_ref): Or about implicit '&'. + +1999-08-11 Mark Mitchell + + * cp-tree.h (minimal_parse_mode): Remove. + (finish_label_stmt): New function. + * decl.c (saved_scope): Remove minimal parse mode. + (maybe_push_to_top_level): Don't save it. + (pop_from_top_level): Don't restore it. + (define_label): Split out template-handling code to semantics.c. + (start_decl): Don't use minimal_parse_mode. + (cp_finish_decl): Likewise. + (start_function): Don't increment it. + (store_return_init): Don't use it. + (finish_function): Don't decrement it. + * parse.y (label_colon): Use finish_label_stmt throughout. + * parse.c: Regenerated. + * pt.c (minimal_parse_mode): Don't define it. + (tsubst_expr): Use finish_label_stmt. + * semantics.c (finish_label_stmt): New function. + + * dump.c (queue): Be careful when computing bitmasks. + (dequeue_and_dump): Describe binfos as binfos, not as + vectors. + + * parse.y (pedantic): Give it itype. Adjust usage accordingly + throughout. + * parse.c: Regenerated. + + * Make-lang.in (CXX_SRCS): Remove sig.c. + * Makefile.in (CXX_OBJS): Remove sig.o. + (sig.o): Remove. + * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. + (CPTI_SIGNATURE_TYPE): Likewise. + (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. + (opaque_type_node): Likewise. + (signature_type_node): Likewise. + (sigtable_entry_type): Likewise. + (flag_handle_signatures): Likewise. + (lang_type): Remove is_signature, is_signature_pointer, + is_signature_reference, has_opaque_typedecls, + sigtables_has_been_generated. Adjust dummy. Remove signature, + signature_pointer_to, signature_reference_to. + (IS_SIGNATURE): Remove. + (SET_SIGNATURE): Remove. + (CLEAR_SIGNATURE): Remove. + (IS_SIGNATURE_POINTER): Remove. + (IS_SIGNATURE_REFERENCE): Remove. + (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. + (SIGTABLE_HAS_BEEN_GENERATED): Remove. + (CLASSTYPE_SIGNATURE): Remove. + (SIGNATURE_TYPE): Remove. + (SIGNATURE_METHOD_VEC): Remove. + (SIGNATURE_POINTER_TO): Remove. + (SIGNATURE_REFERENCE_TO): Remove. + (lang_decl_flags): Remove is_default_implementation. Rename + memfunc_pointer_to to saved_tree. + (IS_DEFAULT_IMPLEMENTATION): Remove. + (DECL_MEMFUNC_POINTER_TO): Remove. + (DECL_MEMFUNC_POINTING_TO): Remove. + (DECL_SAVED_TREE): Adjust definition. + (tag_types): Remove signature_type_node. + (SIGNATURE_FIELD_NAME): Remove. + (SIGNATURE_FIELD_NAME_FORMAT): Likewise. + (SIGNATURE_OPTR_NAME): Likewise. + (SIGNATURE_SPTR_NAME): Likewise. + (SIGNATURE_POINTER_NAME): Likewise. + (SIGNATURE_POINTER_NAME_FORMAT): Likewise. + (SIGNATURE_REFERENCE_NAME): Likewise. + (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. + (SIGTABLE_PTR_TYPE): Likewise. + (SIGTABLE_NAME_FORMAT): Likewise. + (SIGTABLE_NAME_FORMAT_LONG): Likewise. + (SIGTABLE_TAG_NAME): Likewise. + (SIGTABLE_VB_OFF_NAME): Likewise. + (SIGTABLE_VT_OFF_NAME): Likewise. + (finish_base_specifiers): Change prototype. + (build_signature_pointer_type): Remove. + (build_signature_reference_type): Remove. + (build_signature_pointer_constructor): Remove. + (build_signature_method_call): Remove. + (build_optr_ref): Likewise. + (append_signature_fields): Likewise. + (signature_error): Likewise. + * call.c (build_this): Remove signature support. + (build_over_call): Likewise. + (build_new_method_call): Likewise. + * class.c (add_implicitly_declared_members): Likewise. + (finish_struct_1): Likewise. + (finish_struct): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_pointer_force): Likewise. + (ocp_convert): Likewise. + * decl.c (sigtable_decl_p): Remove. + (init_decl_processing): Remove support for signatures. + (cp_finish_decl): Likewise. + (grokdeclarator): Likewise. + (grokparms): Likewise. + (xref_tag): Likewise. + (start_function): Likewise. + (start_method): Likewise. + * decl2.c (finish_sigtable_vardecl): Remove. + (flag_handle_signatures): Remove. + (lang_f_options): Remove handle-signatures. + (grokfield): Remove support for signatures. + (grokbitfield): Likewise. + (finish_file): Likewise. + (reparse_absdcl_as_casts): Likewise. + * error.c (dump_type_real): Likewise. + (dump_function_decl): Likewise. + * friend.c (make_friend_class): Likewise. + * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. + * hash.h: Regenerated. + * init.c (build_new_1): Remove support for signatures. + * lang-options.h: Remove -fhandle-signatures, + -fno-handle-signatures. + * lex.c (init_parse): Remove support for signatures. + (yyprint): Likewise. + * lex.h (rid): Remove RID_SIGNATURE. + * method.c (build_decl_overload_real): Remove support for + signatures. + (hack_identifier): Likewise. + * parse.y (base_class): Likewise. + (base_class.1): Likewise. + (access_specifier): Likewise. + * search.c (lookup_member): Likewise. + * semantics.c (finish_qualified_object_call_expr): Likewise. + (finish_template_type_parm): Likewise. + (begin_class_definition): Likewise. + (finish_base_specifier): Likewise. + * sig.c: Remove. + * tree.c (build_cplus_method_type): Remove support for signatures. + * typeck.c (require_complete_type): Likewise. + (c_sizeof): Likewise. + (c_alignof): Likewise. + (build_object_ref): Likewise. + (build_component_ref): Likewise. + (build_indirect_ref): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (signature_error): Remove. + (store_init_value): Remove support for signatures. + (digest_init): Likewise. + (build_x_arrow): Likewise. + (build_functional_cast): Likewise. + * xref.c (GNU_xref_decl): Likewise. + +1999-08-10 Martin v. Loewis + + * lex.c (do_identifier): Remove unnecessary lookup of class field. + +1999-08-09 Martin v. Loewis + + * decl2.c (set_decl_namespace): Do not complain about non-matching + decls if processing a template. + +1999-08-09 Mark Mitchell + + * decl.c (build_ptrmemfunc_type): Handle qualified + pointer-to-member types here. + * tree.c (cp_build_qualified_type_real): Simplify handling here. + +1999-08-09 Kaveh R. Ghazi + + * lex.c (lang_identify): Likewise. + +1999-08-09 Bernd Schmidt + + * Makefile.in: Update dependencies. + * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with + NULL_RTX. + * decl.c: Include "function.h" + (cleanup_label, return_label): Delete declarations. + (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX. + (finish_function): Rename last_parm_insn variable to + fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX. + * decl2.c: Include "function.h". + (rtl_expr_chain): Delete declaration. + * method.c: Include "function.h" + * tree.c (build_vbase_pointer_fields): Don't initialize + DECL_SAVED_INSNS with NULL_RTX. + * typeck.c: Include "function.h" + +1999-08-09 Jason Merrill + + * semantics.c (begin_function_try_block, finish_function_try_block, + finish_function_handler_sequence): New fns. + * parse.y (function_try_block): Use them. + * pt.c (instantiate_decl): Likewise. + + * cp-tree.h: Declare in_function_try_handler. + * decl.c: Define it. + (start_function): Clear it. + (struct cp_function, push_cp_function_context): Save it. + (pop_cp_function_context): Restore it. + * parse.y (function_try_block): Set and clear it. + * except.c (expand_end_catch_block): Rethrow if we reach the end + of a function-try-block handler in a ctor or dtor. + * typeck.c (c_expand_return): Complain about returning from a + function-try-block handler of a ctor. + + * parse.y (function_try_block): Call end_protect_partials + before expand_start_all_catch. + +1999-08-08 Jason Merrill + + * decl.c (struct binding_level): Add eh_region field. + (push_binding_level): Set it. + (define_label): Complain about jumping into an EH block. + + * ptree.c (print_lang_type): Print the real type of a PMF. + Print what exceptions a fn type throws. + +1999-08-07 Kaveh R. Ghazi + + * class.c (count_fields, add_fields_to_vec): Add static prototype. + + * cp-tree.h (opname_tab, assignop_tab, operator_name_string, + get_id_2, composite_pointer_type, dump_node_to_file): Constify a + char*. + + * decl.c (named_label_list, cp_finish_decl, grokdeclarator): + Constify a char*. + + * decl2.c (finish_static_data_member_decl, grokfield): Constify a + char*. + + * dump.c (queue_and_dump_index, dump_int, dump_string, + dump_string_field, dequeue_and_dump, dump_node_to_file): Constify + a char*. + (dump_stmt): Add static prototype. + + * errfn.c (cp_thing): Constify a char*. + + * error.c (dump_unary_op, dump_binary_op, aggr_variety, + dump_aggr_type, dump_global_iord, dump_decl, dump_function_name, + dump_expr): Constify a char*. + + * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc, + read_line_number): Add static prototype. + (opname_tab, assignop_tab, operator_name_string): Constify a char*. + (real_yylex): Move label `letter' into the scope where it is used. + + * method.c (build_mangled_template_parm_index, build_overload_int, + build_decl_overload_real, get_id_2): Constify a char*. + + * search.c (check_final_overrider): Make static. + + * typeck.c (composite_pointer_type): Constify a char*. + +1999-08-06 Jason Merrill + + * pt.c (maybe_get_template_decl_from_type_decl): Make sure that + we're looking at a class. + + * decl.c (lookup_name_real): Set the complain flag if we're + looking for a namespace member. + + * lex.c (real_yylex): We can have a number with no digits. + + * cvt.c (cp_convert_to_pointer): Don't force pmf conversions. + + * search.c (binfo_from_vbase): New fn. + * cp-tree.h: Declare it. + * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion + from pointer to member of virtual base. + * typeck.c (get_delta_difference): Likewise. + +1999-08-06 Alexandre Oliva + + * pt.c (tsubst): Use build_index_type to build in-template array + index type. Fixes g++.oliva/dwarf1.C. + * decl.c (grokdeclarator): Likewise, just for consistency, as it + doesn't seem to trigger the bug without it. + +1999-08-06 Jason Merrill + + * typeck2.c (add_exception_specifier): Use complete_type. + +1999-08-06 Mark Mitchell + + * error.c (dump_expr): Handle EXACT_DIV_EXPR. + (dump_binary_op): Bulletproof. + * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR]. + * tree.c (search_tree): Don't enumerate all the nodes of classes + `1', `2', and `<'; handle them generically. Don't be sorry about + "unrecognized tree codes"; just abort. + (no_linkage_check): Don't do linkage checks for templates. + + * tree.c (cp_build_qualified_type_real): Handle + pointer-to-member-function types correctly. + +1999-08-05 Jason Merrill + + * decl.c (pushdecl): Only give an error for shadowing a parm + from *this* function. + +Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) + + * typeck2.c: Update URLs and mail addresses. + +1999-08-04 Nathan Sidwell + + * cp-tree.h (empty_except_spec): New global var. + (compexcepttypes): Remove prototype. + (comp_except_specs): Prototype new global function. + (add_exception_specifier): Prototype new global function. + * decl.c (empty_except_spec): Define new global var. + (duplicate_decls): Use comp_except_specs, reword error message. + (init_decl_processing): Initialize empty_except_spec. + Adjust build_exception_variant calls. + * parse.y (exception_specification_opt): Use empty_except_spec. + (ansi_raise_identifier): Call check_for_new_type. + (ansi_raise_identifiers): Use add_exception_specifier. + * pt.c (tsubst): Use add_exception_specifier to build exception + specifier. + * search.c (check_final_overrider): New static function, broken + out of get_matching_virtual. Check throw specifiers, reword + diagnostics. + (get_matching_virtual): Use check_final_overrider. + * tree.c (build_exception_variant): Use comp_except_specs. + * typeck.c (compexcepttypes): Remove. + (comp_except_types): New static function, helper for + comp_except_specs. Compare two types as exception specifiers. + (comp_except_specs): New global function, compare two exception + specifiers. + (comptypes): Adjust for comp_except_specs. + * typeck2.c (add_exception_specifier): New global function. + + * class.c (check_for_override): Reword error message. + +1999-08-03 Nathan Sidwell + + * call.c (convert_arg_to_ellipsis): Use pod_type_p. + * cp-tree.h (struct lang_type): Added non_pod_class flag. + (CLASSTYPE_NON_POD_P): New macro to access it. + * class.c (finish_struct_1): Determine non-PODness. + Check for arrays of pointers (-Weffc++). + Remove array inspection duplicated code. + * tree.c (pod_type_p): Detect non-pod non-aggregate types. + Use CLASSTYPE_NON_POD_P. + +1999-08-03 Nathan Sidwell + + * class.c (duplicate_tag_error): Preserve template information. + +1999-08-03 Nathan Sidwell + + * decl.c (start_enum): Show location of previous definition. + * parse.y (enumlist_opt): New reduction. + (structsp): Simplify enum rules to use enumlist_opt. + +1999-08-03 Jason Merrill + + * lex.c (yyprint): Handle PFUNCNAME. + + * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only + build_expr_from_tree on the args of a TEMPLATE_ID_EXPR. + +1999-08-03 Mumit Khan + + * decl.c (start_decl): Set attributes before duplicate_decls call. + +1999-08-02 Mark Mitchell + + * Make-lang.in (CXX_SRCS): Add dump.c. + * Makefile.in (CXX_OBJS): Add dump.o. + (dump.o): New target. + * cp-tree.h (DECL_CONV_FN_P): Document. + (DECL_OVERLOADED_OPERATOR_P): New function. + (TYPE_PTRMEM_CLASS_TYPE): New macro. + (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. + (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE. + (ASM_VOLATILE_P): New macro. + (STMT_LINENO): Likewise. + (cp_namespace_decls): New function. + (dump_node_to_file): New function. + * decl.c (cp_namespace_decls): New function. + (walk_namespaces_r): Use it. + (wrapup_globals_for_namespace): Likewise. + * decl2.c (flag_dump_translation_unit): New variable. + (lang_decode_option): Handle -fdump-translation-unit. + (finish_file): If flag_dump_translation_unit is set, dump the + translation unit. + * dump.c: New file. + * lang-options.h: Add -fdump-translation-unit. + * pt.c (tsubst_template_parms): Robustify. + (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P. + (tsubst_expr): Use STMT_LINENO. + * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check + for invalid cv-qualifiers even while building templates. + +1999-08-02 Richard Henderson + + * call.c: Include defaults.h instead of expr.h. + * decl.c: Likewise. + * pt.c: Likewise. + * typeck.c: Include defaults.h. + +1999-08-02 Mark Mitchell + + * lex.c (errorcount, sorrycount): Don't declare. + * repo.c (errorcount, sorrycount): Likewise. + * typeck2.c (errorcount, sorrycount): Likewise. + +1999-08-02 Jakub Jelinek + + * call.c (convert_default_arg, build_over_call): Change all uses of + PROMOTE_PROTOTYPES, so that it tests it as a C expression. + Ensure expr.h is included. + * decl.c (grokparams): Ditto. + * pt.c (tsubst_decl): Ditto. + * typeck.c (convert_arguments): Ditto. + +1999-08-02 Jason Merrill + + * class.c (mark_overriders): Fix order of args to overrides. + (warn_hidden): Likewise. Fix for having virtual and non-virtual + functions with the same name. + +1999-08-02 Richard Henderson + + * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null. + +1999-08-01 Mark Mitchell + + * call.c (build_conditional_expr): Fix typo in comment. + +1999-08-01 Bernd Schmidt + + * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack, + case_stack; use in_control_zone_p. + * typeck.c (c_expand_return): Likewise. + +1999-07-31 Bernd Schmidt + + * except.c (catch_clauses): Delete declaration. + +1999-07-30 Mark Mitchell + + * call.c (build_conditional_expr): Call convert_from_reference to + avoid reference/non-reference type confusion. Fix typo. + +1999-07-30 Richard Henderson + + * typeck2.c (initializer_constant_valid_p): Moved to c-common.c. + * cp-tree.h (initializer_constant_valid_p): Remove. + +1999-07-28 Mark Mitchell + + * call.c (conditional_conversion): Don't build BASE_CONVs for + conversions between things that have the same type. + (build_conditional_expr): Tweak. + (convert_like): Some BASE_CONVs really do require the generation + of code. + + * init.c (perform_member_init): Don't go through build_modify_expr + for simple initializations. + +1999-07-27 Jason Merrill + + * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro. + * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for + virtual functions and MI. Simplify. + + * method.c: Remove prototype for largest_union_member. + * pt.c (determine_specialization): Fix uninitialized warning. + * lex.c (real_yylex): Likewise. + +1999-07-27 Mark Mitchell + + * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS + here too. + + * cp-tree.h (BINFO_VIRTUALS): Document new format. + * class.c (modify_one_vtable): Change prototype accordingly. + (modify_all_vtables): Likewise. + (modify_all_direct_vtables): Likewise. + (modify_all_indirect_vtables): Likewise. + (build_vtable_entry_for_fn): New function. + (set_rtti_entry): Simplify for new BINFO_VIRTUALS format. + (modify_vtable_entry): Likewise. + (add_virtual_function): Likewise. + (build_vtbl_initializer): New function. + (finish_vtbls): Simplify for new BINFO_VIRTUALS format. + (fixup_vtable_deltas1): Likewise. + (fixup_vtable_deltas): Likewise. + (override_one_vtable): Likewise. + (finish_struct_1): Likewise. + + * error.c (dump_expr): Likewise. + * search.c (get_abstract_virtuals_1): Likewise. + (get_abstract_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to + __pure_virtual here. + +1999-07-26 Mark Mitchell + + * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error + as per 1999-07-26 change. + + * typeck.c (c_sizeof): Don't allow non-static data members. + (expr_sizeof): Likewise. + +1999-07-26 Jason Merrill + + * input.c (feed_input): Only touch lineno and input_filename + if !USE_CPPLIB. Save the old values before setting the new ones. + + * input.c (feed_input): Add file, line parms. + * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust. + (real_yylex): Check linemode before input_redirected(). + + * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL + from op new to warning. + +1999-07-26 Mark Mitchell + + * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion. + * call.c: All uses changed. + * typeck.c: Likewise. + +1999-07-26 Nathan Sidwell + + * exception.cc (__cplus_type_matcher): Match __eh_matcher + prototype. + +1999-07-26 Mark Mitchell + + * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro. + (ARITHMETIC_TYPE_P): Adjust definition for standard conformance. + (strip_top_quals): Declare. + (ncp_convert): Likewise. + (type_after_usual_arithmetic_conversions): Likewise. + (composite_pointer_type): Likewise. + * call.c (strip_top_quals): Don't make it static. + (promoted_arithmetic_type_p): New function. + (conditional_conversion): Likewise. + (null_ptr_cst_p): Allow `false' as a NULL pointer constant. + (standard_conversion): Use same_type_p. Don't build BASE_CONVs + for converting a type to itself. + (reference_binding): Honor LOOKUP_NO_TEMP_BIND. + (implicit_conversion): Make sure the from and to types are + complete. + (add_builtin_candidate): Correct handling of ?: operator. + (add_builtin_candidates): Improve documentation. + (build_conditional_expr): New function. + (can_convert): Implement in terms of can_convert_arg. + (ncp_convert): New function. + * typeck.c (type_after_usual_arithmetic_conversions): New + function, split out from common_type. + (composite_pointer_type): New function, split out from + build_conditional_expr. + (common_type): Use type_after_usual_arithmetic_conversions. + Remove redundant attribute merging. + (comptypes): Tidy. Handle COMPLEX_TYPE. + (build_binary_op_nodefault): Use null_ptr_cst_p. + (build_conditional_expr): Remove. + (convert_for_assignment): Use new conversion functions. + + * cp-tree.h (abstract_virtuals_error): Change declaration. + * typeck2.c (abstract_virtuals_error): Check to see if an error + occurred, and return a boolean value accordingly. + (build_functional_cast): Adjust accordingly. + * class.c (finish_struct_1): Likewise. + * cvt.c (ocp_convert): Likewise. + * decl.c (cp_finish_decl): Likewise. + (grokparams): Likewise. + (grok_op_properties): Likewise. + (start_function): Likewise. + * init.c (build_new_1): Likewise. + + * pt.c (unify): Don't get confused by pointers-to-member functions. + + * search.c (build_cplus_new): Robustify. + +1999-07-24 Richard Henderson + + * gxx.gperf (__builtin_va_arg): New. + * parse.y (VA_ARG): New token. + (unary_expr): Recognize it. + +Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com) + + * g++FAQ.texi: Deleted per Joe Buck's request. + * Makefile.in: Corresponding changes. + +1999-07-23 Jason Merrill + + * lex.c: Sync with C frontend. + (whitespace_cr): New fn. + (skip_white_space): Use it. + (init_parse): Reorder. + (yyprint): Support CONSTANT. + (pragma_getc, pragma_ungetc): Bring back. + (read_line_number): Change in_system_header directly. + (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file. + (parse_float): Update to C version. + (yylex): Handle '$' under the letter case. + Remove looking_for_typename handling. + Support hex floating point constants. + Follow C's lead for choosing type of integer constants. + Rearrange stuff to match C frontend. + (yyungetc, reinit_parse_for_block, yylex): Support indent_level. + * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC. + +1999-07-23 Mark Mitchell + + * call.c (reference_binding): Tweak. + (mayble_handle_implicit_object): Use direct_reference_binding to + create the right implicit conversion sequence. + +1999-07-22 Mark Mitchell + + * pt.c (convert_nontype_argument): Don't call decl_constant_value + if we're converting to a reference type. + + * call.c (NEED_TEMPORARY_P): New macro. + (standard_conversion): Set it, for derived-to-base conversions. + (reference_related_p): New function. + (reference_compatible_p): Likewise. + (convert_class_to_reference): Likewise. + (direct_reference_binding): Likewise. + (reference_binding): Rework for standards-compliance. + (convert_like): Adjust accordingly. + (maybe_handle_ref_bind): Simplify; the right conversion sequences + are now built up in reference_binding. + (initialize_reference): New function. + * cp-tree.h (ICS_USER_FLAG): Document. + (ICS_THIS_FLAG): Likewise. + (ICS_BAD_FLAG): Likewise. + (NEED_TEMPORARY_P): Likewise. + (cp_lvalue_kind): New type. + (real_lvalue_p): Return it. + * error.c (dump_expr): Provide more accurate representation for + AGGR_INIT_EXPRs. + * init.c (expand_default_init): Do not try to perform implicit + conversions for a brace-enclosed initializer. + * search.c (lookup_conversions): Document. + * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate + appropriately. + (real_lvalue_p): Adjust accordingly. + (lvalue_p): Likewise. + (build_cplus_new): Don't allow the creation of an abstract class. + * typeck.c (convert_for_initialization): Use initialize_reference. + +1999-07-21 Gavin Romig-Koch + + * lex.c (real_yylex) : Correct the test for overflow when lexing + integer literals. + +1999-07-20 Jason Merrill + + * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL, + not DECL_BUILT_IN, to determine if a function is internally declared. + (duplicate_decls): Likewise. Improve handling of builtins. + (push_overloaded_decl): Remove special handling of builtins. + + * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P. + + * decl.c (grokdeclarator): Pull out decl_constant_value in + templates, too. + + * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm. + * cp-tree.h, pt.c, semantics.c: Adjust. + * method.c (largest_union_member): Remove. + + * lang-specs.h (c++-cpp-output): Pass -fpreprocessed. + + * lex.c (token_getch, token_put_back): New fns. + (real_yylex): Use them. + + * lex.c (lang_init): Generalize. + (lang_init_options): Tell cpplib this is C++. + (nextchar): Remove. Replace uses with put_back. + (skip_white_space): Handle linemode here. Optimize for cpplib. + (extend_token_buffer_to): New fn. + (extend_token_buffer): Use it. + (read_line_number, check_newline): Just deal with tokens. + (real_yylex): More cpplib optimizations. Simplify. Don't produce + EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here. + * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING. + * parse.y (PAREN_STAR_PAREN): Remove. + * input.c: Don't use the putback machinery with cpplib. + (sub_getch): Fold back into getch. + (getch): Don't handle linemode here. + (feed_input): Unget any text in the token buffer. + + * lex.c (set_typedecl_interface_info, set_vardecl_interface_info, + nextyychar, nextyylval): Remove. + +1999-07-20 Michael Tiemann + Jason Merrill + + * lex.c (indent_level): New variable. + (init_parse): Set cpp_token to CPP_DIRECTIVE. + (consume_string): Make this smart about USE_CPPLIB. + (yyungetc): Use put_back function. + (pragma_getc, pragma_ungetc): Functions deleted. + (check_newline): Rewrite to be intelligent about USE_CPPLIB. + Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and + pragma_ungetc. + (real_yylex): Rewrite to be intelligent about USE_CPPLIB. + Also, clean up cases where we redundantly set token_buffer[0]. + (read_line_number): New fn. + * input.c (feed_input): Use integrated cpplib if USE_CPPLIB. + (end_input): Call cpp_pop_buffer if USE_CPPLIB. + (sub_getch): Conditionalize out code that's not appropriate if + USE_CPPLIB. + (put_back): Rewrite in case USE_CPPLIB is defined. + (input_redirected): Ditto. + +Tue Jul 20 11:24:19 1999 Bernd Schmidt + + * cp-tree.h: Delete lots of declarations of tree nodes; replaced by + c_global_trees and accessor macros defined in c-common.h. + (cp_tree_index): New enumeration. + (cp_global_trees): Declare new array. Add accessor macros for it, and + delete declarations of tree nodes replaced by it. + (builtin_function): Delete macro, add declaration for new function. + Include c-common.h. + * decl.c: Delete definitions for tree nodes that were replaced by + cp_global_trees and c_global_trees. + (init_decl_processing): Call c_common_nodes_and_builtins; delete code + to generate the common builtins here. + (builtin_function): New function. + * decl2.c (abort_fndecl): Delete declaration. + * except.c (expand_builtin_return_address): Delete declaration. + (builtin_return_address_fndecl): Delete variable. + (const_ptr_type_node): Delete declaration. + * lex.c (cons_up_default_function): Delete declaration of + void_list_node. + * parse.y (void_list_node): Delete declaration. + * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type): + Delete variables. + (const_string_type_node): Delete declaration. + * search.c (abort_fndecl): Delete declaration. + * Makefile.in: Update dependencies. + +1999-07-19 Mark Mitchell + + * pt.c (check_default_tmpl_args): Move test for missing default + arguments here, from ... + (end_template_parm_list): Here. + +1999-07-18 Mark Mitchell + + * decl.c (lookup_nested_type): Remove. + (pushtag): Don't call it. + +Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (INTERFACE): Bump to 2. + +1999-07-17 Alexandre Oliva + + * typeck2.c (my_friendly_abort): Updated URL with bug reporting + instructions to gcc.gnu.org. Removed e-mail address. + +1999-07-17 Mark Mitchell + + * pt.c (determine_specialization): Tighten error-checking. + (end_template_parm_list): Likewise. + +1999-07-14 Mark Mitchell + + * pt.c (check_default_tmpl_args): Handle friends defined in the + class just like member functions defined in the class. + +1999-07-09 Michael Tiemann + Jason Merrill + + * cp-tree.h (struct lang_decl): Added field for storing sorted + FIELD_DECLs (used in TYPE_DECLs). + (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union. + (DECL_SORTED_FIELDS): New macro. + * class.c (method_name_cmp): New function. + (finish_struct_methods): Modified to support sorting and searching + methods. + (finish_struct_anon): Changed code in inner loop to use ELT rather + than UELT (which required an extra indirection for every reference). + (field_decl_cmp): New function to support sorting FIELD_DECLs. + (finish_struct_1): Sort fields. + * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them. + (lookup_fnfields_1): Search sorted methods in METHOD_VEC. + Also, switch to using array indexing rather than a changing pointer. + * ptree.c (print_lang_decl): Handle TYPE_DECLs that have + DECL_SORTED_FIELDS. + +1999-07-09 Jason Merrill + + * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style + casts in system headers or extern "C" blocks. + + * pt.c (do_decl_instantiation): Downgrade duplicate instantiation + errors to pedwarn. + +1999-07-09 Michael Tiemann + + * decl2.c (write_virtuals): Deleted declaration. + * cp-tree.h (write_virtuals): Deleted extern declaration. + * class.c (finish_struct_1): Removed #if 0'd code that mentions + write_virtuals. + * semantics.c (begin_class_definition): Rewrite code to not depend + on write_virtuals. + + * lex.c (cp_pragma_interface): New function. + (cp_pragma_implementation): Likewise. + (handle_cp_pragma): Call them. + + * typeck.c (comptypes): Simplify C code in look_hard. + + * xref.c (PALLOC): Use xcalloc, not calloc. + (SALLOC): Use xmalloc, not malloc. + + * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary. + + * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS + is NO_DEBUG. + + * decl.c (duplicate_decls): If a redeclaration doesn't match the + initial declaration, then don't save the inline info and by all + means don't mark the function as a builtin function. + + * decl.c (lookup_name_real): Set NONCLASS to 1 if + CURRENT_CLASS_TYPE is 0. + + * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to + NULL_TREE. + + * ptree.c (print_lang_type): Added vtable-needs-writing. + +Wed Jul 7 01:26:47 1999 Alexandre Oliva + + * decl2.c (mark_vtable_entries): Fix check for rtti offset. + +1999-07-06 Gavin Romig-Koch + + * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Merged into c-common. + +1999-07-05 Dave Brolley + + * lex.c (errorcount): Declare it. + (finish_parse): Update errorcount for when using CPPLIB. + +1999-07-05 Mark Mitchell + + * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template + parameters. + (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro. + * decl.c (push_class_binding): Use it. + (lookup_name_real): Likewise. + +1999-07-02 Gavin Romig-Koch + + * cp-tree.h (widest_integer_literal_type_node, + widest_unsigned_literal_type) : New. + * decl.c (widest_integer_literal_type_node, + widest_unsigned_literal_type) : New. + (init_decl_processing): Handle/use the two new types. + * lex.c (real_yylex): Same. + * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : + Same. + +1999-07-01 Mark Mitchell + + * decl.c (grokdeclarator): Don't give names "for linkage purposes" + to anonymous cv-qualified types. + +1999-07-01 Gavin Romig-Koch + + * lex.c (real_yylex) : Change integer literal overflow handling to + be like c-lex.c. + + * lex.c (real_yylex): Improve 'integer constant out of range' messages. + +1999-06-28 Richard Henderson + + * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. + +1999-06-28 Jason Merrill + + * error.c (dump_type_real): Handle TREE_LIST again. + + * typeck.c (comp_target_parms): Don't complain about + converting from () to (...) if !flag_strict_prototype. + + * decl.c (grokdeclarator): Update the names of all variants when + de-anonymizing. + +1999-06-21 Mark Mitchell + + * init.c (expand_aggr_vbase_init): Rename to + construct_virtual_bases. Conditionalize construction here, + rather than ... + (emit_base_init): Here. + +1999-06-19 Mark Mitchell + + * semantics.c (finish_asm_stmt): Apply decay conversions to + input operands. + + * decl.c (expand_static_init): When building an anonymous function + for use with atexit, compute its body before and after entering + the function. + + * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and + EXIT_EXPR. + +1999-06-18 Mark Mitchell + + * init.c (expand_aggr_vbase_init): Add flag parameter. + (build_partial_cleanup_for): Remove, inlining into .. + (expand_cleanup_for_base): ... here. Take flag parameter. + (emit_base_init): Pass the in_chrg parameter to + emit_aggr_vbase_init. + (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base. + +1999-06-16 Mark Mitchell + + * decl2.c (import_export_decl): Use same_type_p, rather than + relying on pointer-equality for types. + + * method.c (do_build_copy_constructor): Simplify. + + * call.c (build_method_call): Remove bogus code for two-argument + delete. + * init.c (build_new_1): Expand on comment, and remove dead code. + + * init.c (expand_cleanup_for_base): New function, split out + from ... + (emit_base_init): Here. + (expand_aggr_vbase_init): Use it. + +1999-06-15 Mark Mitchell + + * cp-tree.h (class_cache_firstobj): Declare. + (maybe_push_cache_obstack): Rename to push_cache_obstack. + * class.c (permanent_obstack): Remove declaration. + (class_cache_firstobj): Make it global. + (add_method): Don't use permanent_obstack directly. + (pushclass): Only free the class_cache_obstack if we know how far + back to free it. + (maybe_push_cache_obstack): Rename to push_cache_obstack. + * decl.c: Remove dead comment. + (saved_scope): Add class_cache_firstobj. + (push_to_top_level): Save it. + (pop_from_top_level): Restore it. + (push_class_level_binding): Use push_cache_obstack, not + maybe_push_cache_obstack. + * search.c (push_class_decls): Likewise. + +1999-06-14 Martin von Löwis + + * pt.c (tsubst_friend_function): Push into namespace of friend + function before pushdecl'ing it. + +1999-06-14 Nathan Sidwell + + * call.c (build_new_op): Remove REF_BIND from all operands. + +1999-06-13 Alexandre Oliva + + * init.c (build_new_1): Look up operator delete even if there was + no explicit new placement. + +1999-06-08 Nathan Sidwell + + * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out + of ... + (build_throw): ... here. Call it. + (process_start_catch_block): Call it. + +1999-06-07 Mark Mitchell + + * search.c (convert_pointer_to_single_level): Reimplement without + using get_binfo. + +1999-06-06 Mark Mitchell + + * method.c (is_back_referenceable_type): Back-reference bools when + not squangling. + +1999-06-07 Dave Brolley + + * lex.c (real_yylex): Replace unused bytes from bad multibyte char. + * input.c (putback_buffer): New structure type. + (putback): Replaces putback_char member. + (putback): Replaces putback_char static variable. + (feed_input): Use putback. + (end_input): Use putback. + (sub_getch): Use putback. + (put_back): Use putback. + +1999-06-05 Mark Mitchell + + * decl.c (grokdeclarator): Fix typo in last change. + +1999-06-04 Jason Merrill + + * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack. + (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise. + +1999-06-04 Nathan Sidwell + + * except.c (build_throw): Check throw expression validity. + +1999-06-03 Mark Mitchell + + * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned + just because flag_signed_bitfields is false. + +1999-06-03 Nathan Sidwell + + * semantics.c (begin_class_definition): Update the struct's + location here ... + * class.c (finish_struct): ... rather than here. + + * decl.c (make_typename_type): Don't rely on uninitialized + variable. + +1999-05-31 Kaveh R. Ghazi + + * Makefile.in (ALL_CFLAGS): Add '-W -Wall'. + +1999-05-31 Mark Mitchell + + * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange + and friends rather than messing with current_obstack directly. + (cp_build_qualified_type_real): Rework ARRAY_TYPE + allocation to match practice throughout the rest of the + compiler. + +1999-05-30 Mark Mitchell + + * lex.c (make_lang_type): Create TYPE_BINFO for + TEMPLATE_TYPE_PARMs just like for non-template types. + + * decl.c (start_decl): Move checks on initialization to ... + (cp_finish_decl): Here. Tidy formatting slightly. + +1999-05-28 Mark Mitchell + + * decl.c (add_binding): Don't complain about a redeclaration of a + semantically identical typedef in a local scope. + +1999-05-28 Nathan Sidwell + + * decl.c (complete_array_type): Allocate off same obstack. Fix + DO_DEFAULT comment to match reality. + + * friend.c (make_friend_class): Fix diagnostic typo. + +1999-05-28 Mark Mitchell + + * decl.c (lookup_namespace_name): Handle getting a + TEMPLATE_ID_EXPR. + (expand_static_init): Don't call pushdecl for implicitly declared + `atexit' used to register destructors. + +1999-05-25 Mark Mitchell + + * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to + initialize a vtable. + + * cp-tree.h (NAMESPACE_LEVEL): Reformat. + (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes + by combining TEMPLATE_INFO and LEVEL into a single union. + (DECL_TEMPLATE_INFO): Reformat. + (DECL_SAVED_TREE): Document. + (DECL_TEMPLATE_INJECT): Remove. + * class.c (finish_struct): Remove code to deal with + DECL_TEMPLATE_INJECT. + + * decl.c (maybe_process_template_type_declaration): Handle all new + types in templates uniformly. + * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not + DECL_CONTEXT. + * pt.c (lookup_template_class): Inject template instantiations of + forward-declarations. + (instantiate_class_template): Remove code processing + DECL_TEMPLATE_INJECT. + + * pt.c (lookup_template_class): Tweak lookup to find member + templates. + + * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into + ASM_CV_QUAL. + * semantics.c (finish_asm_stmt): Make strings permanent if they're + used in a template. + +1999-05-25 Jason Merrill + + * typeck.c (casts_away_constness, casts_away_constness_r): Strip both + parts of pointer to data member types. + +1999-05-24 Mark Mitchell + + * decl2.c (mark_vtable_entries): Don't make a copy of a function, + and then make it look like `abort'. Just use `abort' instead. + + * typeck.c (build_static_cast): Don't allow static_casts that cast + away constness. + (casts_away_constness_r): New function. + (casts_away_constness): Likewise. + + * decl.c (lookup_tag): Remove code no longer needed after + name-lookup improvements. + * decl2.c (handle_class_head): Make error-recovery more robust. + * friend.c (make_friend_class): Reject templated typename types. + * lex.c (is_global): A template parameter isn't global. + * parse.y (class_head): Robustify. + * parse.c: Regenerated. + +1999-05-22 Mark Mitchell + + * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs, + INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs. + + * cp-tree.h (push_nested_namespace): Declare. + (pop_nested_namespace): Likewise. + * decl.c (push_nested_namespace): New function. + (pop_nested_namespace): Likewise. + * pt.c (instantiate_class_template): Use them. + + * tree.c (mapcar): Handle NON_LVALUE_EXPR. + + * cp-tree.h (cplus_expand_constant): Declare. + * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're + converted from one pointer-to-object type to another. + * expr.c (cplus_expand_constant): Don't make it static. + * typeck.c (build_component_ref): Don't crash when presented with + a component which is a TEMPLATE_DECL. + (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a + cast from a pointer-to-member constant to its own type does not + result in a valid non-type template argument. + +1999-05-21 Mark Mitchell + Nathan Sidwell + + * Make-lang.in (cc1plus): Make it depend on gxx.gperf. + * cp-tree.h: Fix typo in documentation on pointers-to-members. + (cp_build_qualified_type): Make it a macro. + (cp_build_qualified_type_real): Declare. + * decl.c (grokdeclarator): Remove misleading comment. Avoid + problem with template parameters and restrict-qualification. + * gxx.gperf: Replace NORID with RID_UNUSED throughout. + * hash.h: Regenerated. + * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into + the enumeration. + (NORID): Remove definition. + * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real. + (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs. + (fn_type_unification): Check that the function type resulting from + the deduction is legal. + (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially. + (unify): Use cp_build_qualified_type_real. + * tree.c (build_cplus_array_type_1): Handle error_marks as inputs. + (cp_build_qualified_type): Rename to ... + (cp_build_qualified_type_real): Add additional COMPLAIN parameter + and modify appropriately. + + * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to + reveal optimization opportunities. + + * pt.c (tsubst): Don't issue error messages when we're not + complaining, even if we see a qualified function type. + (check_cv_quals_for_unify): Don't allow a qualified function + type. + +1999-05-20 Jason Merrill + + * class.c (instantiate_type): Downgrade errors for object-dependent + memfn refs to pedwarn. + +1999-05-20 Mark Mitchell + + * decl.c (grokdeclarator): Don't treat [] as indicating a + zero-sized array in a typedef. + + * call.c (build_object_call): Don't look at DECL_NAME for a type. + (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK. + (typeck.c): Or TYPE_MAIN_VARIANT for a type. + + * pt.c (for_each_template_parm): Rework to match documentation. + Don't be fooled by a COMPONENT_REF with no TREE_TYPE. + +1999-05-20 Jason Merrill + + * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P. + + * class.c (finish_base_struct): Allow non-COM bases for COM classes + except at the leftmost position. + (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable): + Pass the binfo's class, not the most derived, to skip_rtti_stuff. + * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise. + + * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue. + (build_cplus_new): Make sure that what we return is of the right type. + +1999-05-20 Mark Mitchell + + * cp-tree.h (make_ptrmem_cst): New function. + * expr.c (cplus_expand_constant): Split out from ... + (cplus_expand_expr): Here. Use cplus_expand_constant. + (init_cplus_expand): Set lang_expand_constant. + * pt.c (convert_nontype_argument): Use make_ptrmem_cst. + + * tree.c (make_ptrmem_cst): Define. + * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst. + * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst. + +1999-05-19 Mark Mitchell + + * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P. + + * decl2.c (start_static_storage_duration_function): Fix comment. + (finish_file): Create static storage duration functions lazily. + +1999-05-19 Jason Merrill + + Implement anonymous structs. + * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P. + * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust. + * class.c (finish_struct_1): Remove redundant check for anon struct. + * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union. + (check_tag_decl): Check for anonymous struct here. + * decl2.c (build_anon_union_vars): Catch anon struct at file scope. + * init.c (sort_member_init, emit_base_init): Handle getting fields + as well as names in current_member_init_list. + (perform_member_init): Handle getting an anon aggr. + * method.c (do_build_assign_ref): Don't descend into anon aggrs. + (do_build_copy_constructor): Likewise. + +1999-05-19 Mark Mitchell + + * tree.c (cp_build_qualified_type): Don't allow qualified function + types. + +Wed May 19 02:50:53 1999 Arvind Sankar + + * gxxint.texi: Fix typo. + +1999-05-19 Jason Merrill + + * call.c (find_scoped_type, resolve_scope_to_name): Lose. + * class.c (finish_struct_1): Use CLASS_TYPE_P. + * ptree.c (print_lang_type): Likewise. + * typeck.c (build_modify_expr, c_expand_asm_operands): Use + IS_AGGR_TYPE_CODE. + * typeck2.c (digest_init): Likewise. + +1999-05-18 Jason Merrill + + * call.c (joust): Compare the types of the conv ops, not the + target types of the conversions. + +Tue May 18 00:21:34 1999 Zack Weinberg + + * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc + was not given. + +1999-05-17 Mark Mitchell + + * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation. + * decl.c (grokfndecl): Don't allow inline declarations of friend + template specializations, or friend template specializations with + default arguments. + * pt.c (tsubst): Handle substitution into array types that does + not yield a fixed upper bound, even when not processing a + template. + (tsubst_copy): Deal with the fact that the second operand to a + TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC. + * search.c (marked_pushdecls_p): Don't descend into + TEMPLATE_TYPE_PARMs and the like. + (unmarked_pushdecls_p): Likewise. + + * call.c (build_over_call): Don't throw away + initializations/copies of empty classes; use MODIFY_EXPR and + INIT_EXPR as for non-empty classes. + * class.c (finish_struct_1): Put the padding byte for an empty + class on the TYPE_NONCOPIED_PARTS list for the class. + +1999-05-16 Mark Mitchell + + * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that + indicate a reference to a field that is a qualified name. + +1999-05-16 Jason Merrill + + * decl2.c (finish_objects): Don't use .?tors.* if we don't have + ASM_OUTPUT_CONSTRUCTOR. + + * friend.c (do_friend): Add attrlist arg. Remove support for + getting a non-decl as 'decl'. + * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or + rtl. + (grokdeclarator): Adjust. + * cp-tree.h: Adjust. + +1999-05-16 Mark Mitchell + + * cp-tree.h (permanent_p): New function. + * init.c (build_new_1): Use mapcar, not copy_node, to copy a + possibly complex tree node. + * tree.c (mapcar): Adjust comments, and follow coding standards in + conditional. + (permanent_p): New function. + +1999-05-13 Per Bothner + + * class.c (push_lang_context): Turn off DECL_IGNORED_P for + primitive Java types, if we actually see `extern "Java"'. + +1999-05-10 18:21 -0400 Zack Weinberg + + * lang-specs.h: Pass -$ to the preprocessor. + +1999-05-10 Jason Merrill + + * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too. + Don't bother wrapping an OFFSET_TYPE around unknown_type_node. + (resolve_offset_ref): Don't handle a raw baselink. + * cvt.c (build_expr_type_conversion): Likewise. + * typeck.c (decay_conversion, build_c_cast, convert_for_assignment, + convert_for_initialization): Likewise. + * class.c (instantiate_type): Handle seeing a baselink under an + OFFSET_REF. + * error.c (dump_expr): Likewise. + * pt.c (for_each_template_parm): Likewise. + (resolve_overloaded_unification): Likewise. + * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise. + * typeck.c (expr_sizeof): Also complain about other permutations + of overloaded functions. + +1999-05-07 Jason Merrill + + * init.c (resolve_offset_ref): Don't return a raw method. + Use BASELINK_P. + * typeck.c (decay_conversion): Don't handle a raw method. + Resolve all OFFSET_REFs. + (get_member_function_from_ptrfunc): 0 is a valid vtable index. + (build_binary_op_nodefault): Handle resolving overloaded fns. Use + same_type_p for pmf bits. Don't use build_binary_op to compare + raw pointers to methods. + (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE, + to decide when to call resolve_offset_ref. + (build_c_cast, convert_for_initialization): Likewise. + * cvt.c (build_expr_type_conversion): Likewise. + +1999-05-06 Nathan Sidwell + + * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class. + +1999-05-05 Mark Mitchell + + * decl2.c (start_objects): Don't let static constructors and + destructors get inlined. + + * parse.y (nested_name_specifier): Make sure ordinary types are + complete, just like template types. + * parse.c: Regenerated. + + * pt.c (check_explicit_specialization): Improve error messages. + +1999-05-04 Martin von Löwis + + * typeck.c (string_conv_p): Use same_type_p to check whether we + try to convert between char and wchar_t. + +1999-05-03 Mark Mitchell + + * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous + lookup to error_mark_node here. + (lookup_member): Revise documentation. Add comments. Don't set + the TREE_TYPE to error_mark_node here, and don't build up an extra + TREE_LIST for ambiguous lookups. + (setup_class_bindings): Adjust accordingly. + (push_class_decls): Revise out-of-date comments. + + * typeck.c (build_const_cast): Tighten checks for legality. + +1999-05-02 Martin von Löwis + + * init.c (build_member_call): Lookup names coming from + namespace-scoped LOOKUP_EXPR. + +1999-05-03 Jim Blandy + + * gxxint.texi: Add documentation for 'I'. + +1999-05-02 Martin von Löwis + + * tinfo.cc (operator==): Qualify type_info with std::. + +1999-05-02 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy. + (DECL_COMDAT): Remove definition. + +1999-05-01 Mark Mitchell + + * decl.c (wrapup_globals_for_namespace): Fix thinko in previous + change. + +1999-04-30 Mark Mitchell + + * class.c (build_vtable): Use build_lang_decl when building + vtables, not just build_decl. + (prepare_fresh_vtable): Likewise. + * decl.c (wrapup_globals_for_namespace): Mark vtables as + DECL_EXTERNAL when calling wrapup_global_declarations. + * decl2.c (priority_info_s): Add initializations_p and + destructions_p members. + (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED, + when deciding what vtables to write out. + (ssdf_decls): New variable. + (ssdf_decls_used): Likewise. + (start_static_storage_duration_function): Deal with being called + multiple times. Avoid inlining this function. + (generate_inits_for_priority): Deal with reuse of priority map. + (get_priority_info): Clear initializations_p and destructions_p. + (do_static_initialization): Tweak comment. + (do_static_destruction): Likewise. Fix condition on sentries for + destruction. + (generate_ctor_or_dtor_function): Call all of the static storage + duration functions. + (generate_ctor_or_dtor_function_for_priority): Check + initializations_p and destructions_p to see what priorities need + initialization functions. + (finish_file): Rework to generate multiple static storage duration + functions, rather than just one. + + * typeck.c (build_const_cast): Tweak last change to handle + templates correctly. + + * typeck.c (build_const_cast): Disallow use of const_cast to + anything but a pointer or reference type. + +1999-04-30 Nathan Sidwell + + * decl.c (cp_finish_decl): Don't permit arrays of abstract or + signature type. + +1999-04-29 Mark Mitchell + + * decl2.c (do_static_destruction): Remove obsolete FIXME comment. + (finish_file): Indent comments properly. + +1999-04-29 Richard Henderson + + * decl2.c (do_static_initialization): Call do_pending_stack_adjust. + (do_static_destruction): Likewise. + +1999-04-29 Nathan Sidwell + + * cp-tree.h (TYPE_NOTHROW_P): New macro. + * decl2.c (delete_sanity): Warn on deleting void *. + * init.c (build_new_1): Use TYPE_NOTHROW_P. + * typeck.c (c_expand_return): cp_pedwarn on returning NULL from + throwing operator new. + +1999-04-28 Nathan Sidwell + + * cp-tree.h (build_component_addr): Remove prototype. + * typeck.c (build_component_addr): Make static. Remove MSG + argument. + (build_component_addr): Remove MSG parameter, clean up + comment. + (build_x_function_call): Use cp_error. + (build_unary_op): Adjust call of build_component_addr. + +1999-04-28 Mark Mitchell + + * pt.c (tsubst_friend_class): Check for NULL. + +Wed Apr 28 11:42:22 1999 Andreas Schwab + + * search.c (binfo_for_vtable): Initialize bfvi.var. + +1999-04-27 Nathan Sidwell + + * rtti.c (build_x_typeid): Check rtti is enabled. + +1999-04-26 Mark Mitchell + + * search.c (is_subobject_of_p): Make sure we're looking at the + right baseclasses. + +1999-04-26 Marc Espie + + * Make-lang.in (cplib2.ready): Don't depend on phony targets. + +1999-04-23 Mark Mitchell + + * decl2.c (finish_file): Tweak handling of extern inlines so that + they are not unnecessarily put out. + + * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and + such as base classes. + +1999-04-22 Brendan Kehoe + + * tree.c (build_exception_variant): Fix typo: use the chain of U, + not trying V, while cycling through U. + +1999-04-22 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove returns_first_arg and + preserves_first_arg. Enlarge dummy accordingly. + (DECL_TINFO_FN_P): New macro. + (SET_DECL_TINFO_FN_P): Likeiwse. + (DECL_RETURNS_FIRST_ARG): Remove. + (DECL_PRESERVES_THIS): Likewise. + (DECL_INIT_PRIORITY): New macro. + (finish_struct_1): Change prototype. + (cat_namespace_levels): Remove prototype. + (vtable_decl_p): New prototype. + (vtype_decl_p): Likewise. + (sigtable_decl_p): Likewise. + (walk_globals_pred): New typedef. + (walk_globals_fn): Likewise. + (walk_globals): New prototype. + (walk_namespaces_fn): New typedef. + (walk_namespaces): New prototype. + (wrapup_globals_for_namespace): Likewise. + (walk_vtables): Remove prototype. + (walk_sigtables): Likewise. + (instantiate_pending_templates): New prototype. + * class.c (finish_struct_1): Don't return a value. + * decl.h (pending_statics): Remove declaration. + * decl.c (walk_namespaces_r): New function. + (walk_globals_r): Likewise. + (vtable_decl_p): Likewise. + (vtype_decl_p): Likewise. + (sigtable_decl_p): Likewise. + (walk_namespaces): Likewise. + (walk_globals_data): New type. + (walk_globals): New function. + (wrapup_globals_for_namespace): Likewise. + (expand_static_init): Remove assertion. Remove redundancy in + conditional. Don't put static data members in static_aggregates + Tidy. + (finish_function): Remove redundancy in conditional. Don't set + DECL_RETURNS_FIRST_ARG. + (cat_namespace_levels): Remove. + * decl2.c: Include splay-tree.h and varray.h. + (priority_info_s): New structure. + (finish_vtable_vardecl): Change prototype. Adjust for new calling + conventions. + (prune_vtable_vardecl): Likewise. + (finish_sigtable_vardecl): Likewise. + (setup_initp): Remove. + (do_dtors): Remove. + (do_ctors): Remove. + (start_static_storage_duration_function): New function. + (generate_inits_for_priority): Likewise. + (finish_static_storage_duration_function): Likewise. + (get_priority_info): Likewise. + (do_static_initialization): Likewise. + (do_static_destruction): Likewise. + (do_static_initialization_and_destruction): Likewise. + (generate_ctor_or_dtor_function): Likewise. + (generate_ctor_and_dtor_functions_for_priority): Likewise. + (pending_statics): Make it a varray. + (pending_statics_used): New variable. + (saved_inlines): Make it a varray. + (saved_inlines_used): New variable. + (finish_static_data_member): Change method of updating + pending_statics. + (mark_inline_for_output): Remove #if 0'd code. Change method of + updating saved_inlines. + (walk_vtables): Remove. + (walk_sigtables): Likewise. + (import_export_decl): Use DECL_TINFO_FN_P. + (pending_templates): Remove declaration. + (maybe_templates): Likewise. + (static_aggregates_initp): Likewise. + (setup_initp): Likewise. + (finish_objects): Simplify. + (INITIALIZE_P_IDENTIFIER): New macro. + (PRIORITY_IDENTIFIER): New macro. + (SSDF_IDENTIFIER): New macro. + (initialize_p_decl): New variable. + (priority_decl): Likewise. + (ssdf_decl): Likewise. + (priority_info_map): Likewise. + (finish_file): Recode output of static intializers and other + file-scope finalization tasks. + * error.c (OB_END_TEMPLATE_ID): New macro. + (dump_type_real): Use it. + (dump_decl): Likewise. + (dump_function_name): Likewise. + * lex.c (set_typedecl_interface_info): Adjust for new walk_globals + interface. + (check_newline): Use walk_globals, not walk_vtables. + * pt.c (pending_tempalte_expansions): Remove. + (set_vardecl_interface_info): Likewise. + (pending_templates): Make static. + (maybe_templates): Likewise. + (instantiate_class_template): Adjust call to finish_struct_1. + (instantiate_pending_templates): New function. + * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P. + * tree.c (static_aggregates_initp): Remove. + (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY + instead. + * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h. + + * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes + with the RTL code RETURN. + * hash.h: Regenerated. + * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD. + * parse.y: Replace RETURN with RETURN_KEYWORD throughout. + * parse.c: Regenerated. + * pt.c: Include varray.h. Include rtl.h since varray.h requires + it. + (inline_parm_levels): New variable. + (inline_parm_levels_used): Likewise. + (maybe_begin_member_template_processing): Update them. + (maybe_end_member_template_processing): Use them, rather than + guessing how many levels to pop. + + * decl.c (make_typename_type): Tighten error-checking. + +1999-04-20 Mark Mitchell + + * cp-tree.h (build_binary_op): Remove unneeded parameter. + * class.c (build_vrable_entry_ref): Adjust call to + build_binary_op. + * decl.c (expand_static_init): Likewise. + (grokdeclarator): Likewise. + (finish_function): Likewise. + * decl2.c (delete_sanity): Likewise. + (do_dtors): Likewise. + (do_ctors): Likewise. + * error.c (dump_type_suffix): Likewise. + * expr.c (cplus_expand_expr): Likewise. + * init.c (resolve_offset_ref): Likewise. + (build_new): Likewise. + (build_new_1): Likewise. + (build_vec_delete_1): Likewise. + (expand_vec_init_catch_clause): Likewise. + (build_delete): Likewise. + * pt.c (tsubst): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + * search.c (expand_upcast_fixups): Likewise. + (expand_direct_vtbls_init): Likewise. + * typeck.c (get_member_function_from_ptrfunc): Likewise. + (build_binary_op_nodefault): Likewise. + (point_int_sum): Likewise. + (pointer_diff): Likewise. + (build_unary_op): Likewise. + (build_modify_expr): Likewise. + (get_delta_difference): Likewise. + (build_ptrmemfunc): Likewise. + (expand_ptrmemfunc_cst): Likewise. + +1999-04-20 Jason Merrill + + * decl.c (grokfndecl): Always call cplus_decl_attributes. + * decl2.c (grokfield): Pass attrlist to grokdeclarator. + +1999-04-19 Mark Mitchell + + * cp-tree.h (finish_static_data_member_decl): New function. + * decl2.c (finish_static_data_member_decl): Split out from ... + (grokfield): Here. + * pt.c (instantiate_class_template): Use it here instead of + trying to fake it. + (tsubst_decl): Don't set DECL_ASSEMBLER_NAME; + finish_static_data_member_decl will do that. Explicit set + DECL_EXTERNAL to match non-template processing. + +1999-04-18 Mark Mitchell + + * cp-tree.h (finish_class_definition): Add parameter. + * parse.y (structsp): Use it. Don't call pop_scope here. + * parse.c: Regenerated. + * semantics.c (finish_class_definition): Pop it here. + +1999-04-17 Mark Mitchell + + * decl.c (xref_tag): Revise handling of nested template + declarations. + * pt.c (check_explicit_specialization): Tweak handling of friend + templates in template classes. + (tsubst_friend_class): Handle friend declarations for nested + member template classes. + +1999-04-16 Mark Mitchell + + * class.c (finish_struct): Remove unused variable. + (pushclass): Likewise. + (invalidate_class_lookup_cache): Likewise. + * cp-tree.def (TYPENAME_TYPE): Improve documentation. + * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME + doesn't get obliterated. + (make_typename_type): Handle template classes correctly. + + * cp-tree.h (TREE_NONLOCAL_FLAG): Remove. + (storetags): Declare. + * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG. + (pushclass): Likewise. Use storetags to install tag declarations, + not pushtag. + (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG. + * decl.c (storetags): Make it global. + (push_class_binding): Set INHERITED_VALUE_BINDING_P for an + implicit typename declaration. + (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG. + * method.c (hack_identifier): Likewise. + * search.c (lookup_member): Likewise. + + * decl.c (warn_about_implicit_typename_lookup): New function. + (lookup_name_real): Use it. Rework handling of implicit typename + extension. + +1999-04-15 Mark Mitchell + + * cp-tree.h (lookup_nested_field): Remove. + * class.c (push_nested_class): Handle UNION_TYPEs. + (pop_nested_class): Likewise. + * decl.c (lookup_name_real): Don't call lookup_nested_field. + (start_decl): Use push_nested_class, not just pushclass. + (cp_finish_decl): Use pop_nested_class, not just popclass. + * search.c (lookup_nested_field): Remove. + + * cp-tree.h (lang_type): Add documentation. + * decl2.c (handle_class_head): Create template declarations here, + as appropriate. + * parse.y (class_head): Return whether or not we entered a new + scope, as well as the type named. + (named_class_head): Likewise. + (named_complex_class_head_sans_basetype): Likewise. + (structsp): Adjust accordingly. Pop scope when required. + * parse.c: Regenerated. + * pt.c (check_default_tmpl_args): Robustify. + (redeclare_class_template): Likewise. + (instantiate_class_template): An instantiation of an + anonymous union is itself an anonymous union. + * semantics.c (begin_class_definition): Don't create template + declarations here. + +1999-04-15 Jason Merrill + + * parse.y (after_type_declarator_intern): New nonterminal. + (after_type_declarator): Use it. + (direct_after_type_declarator): Likewise. Move above + nonnested_type to fix reduce/reduce conflict resolution. + (declmods): Reducing from just 'attributes' has EMPTY precedence. + * Makefile.in (CONFLICTS): Update. + + * decl.c (define_label): Downgrade error for jumping over a + non-POD decl to pedwarn. + +1999-04-14 Mark Mitchell + + * cp-tree.h (popclass): Change declaration. + (pop_nested_class): Likewise. + (poplevel_class): Remove declaration. + * call.c (convert_default_argument): Pass no arguments to + popclass. + * class.c (finish_struct_1): Likewise. + (finish_struct): Likewise. + (popclass): Remove argument. Simplify code accordingly. + (pop_nested_class): Likewise. + * decl.c (poplevel_class): Declare it here, and make it static. + (poplevel): Handle class scopes. + (poplevel_class): Don't take an rgument. Simplify. + (pop_everything): Pass no arguments to pop_nested_class. + (cp_finish_decl): Pass no arguments to popclass. + (grokdeclarator): Pass no arguments to pop_nested_class. + (finish_function): Likewise. + * decl2.c (grokfield): Likewise. + (pop_scope): Pass no arguments to popclass. + * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class. + * pt.c (instantiate_class_template): Move call to pushclass, and + document. Pass no arguments to popclass. + (regenerate_decl_from_template): Likewise. + +1999-04-14 Jason Merrill + + * typeck.c (build_unary_op): Handle taking the address of a unique + bound non-static member function. + +1999-04-13 Martin von Loewis + + * lang-options.h (-Wdeprecated): New flag. + * decl2.c (warn_deprecated): New flag. + (lang_decode_option): Deprecated this-is-variable, + external-templates, alt-external-templates. + Support -Wdeprecated. + * errfn.c (cp_deprecated): New function. + +1999-04-13 Jason Merrill + + * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead + of the decls themselves. + + * pt.c (tsubst_function_type): Copy attributes over. + + * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority + and com_interface. + * cp-tree.h: Add prototype. + * decl.c (init_decl_processing): Set valid_lang_attribute. + +1999-04-13 Mark Mitchell + + * class.c (finish_struct_1): Look at the const-ness of the field's + type, not the TREE_READONLY-ness of the declaration. + * method.c (synthesize_method): Likewise. + * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when + creating new declarations. + +1999-04-13 Mike Stump + + * decl2.c (import_export_decl): Because vtables always reference + virtual functions, even if they are inlined, don't allow + -fno-implement-inlines to not emit them, instead, emit them with + the vtable. + * decl.c (start_function): Likewise. + +1999-04-12 Jason Merrill + + * cp-tree.h (struct lang_type): Add com_interface. + (CLASSTYPE_COM_INTERFACE): New macro. + * class.c (set_rtti_entry): COM interface classes have no RTTI + entries in their vtables; adjust. + (add_virtual_function, finish_base_struct, skip_rtti_stuff, + modify_one_vtable, fixup_vtable_deltas1, override_one_vtable, + finish_struct_1): Likewise. + * decl2.c (mark_vtable_entries): Likewise. + * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise. + * search.c (get_abstract_virtuals_1, get_abstract_virtuals, + expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + + * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro. + * typeck.c (comptypes): If we get it, ignore attributes. + * class.c (instantiate_type): Use BASELINK_P. Change complain + parameter to flags; 2 means ignore attributes. + * call.c (build_op_delete_call): Pass it. + + * decl.c (xref_tag): Only complain once about using a typedef-name + with 'struct'. Downgrade to pedwarn. + + * decl.c (grokdeclarator): Allow [] syntax for zero-length array. + + * parse.y (absdcl_intern): New nonterminal. + (absdcl, direct_abstract_declarator): Use it. + + * pt.c (lookup_template_class): Look through implict typename. + +1999-04-11 Mark Mitchell + + * friend.c (add_friend): Deal gracefully with error_mark_node. + * method.c (build_overload_value): Handle pointers-to-members as + template parameters. + + * decl.c (push_binding): Fix typo in comment. + +1999-04-10 Mark Mitchell + + * error.c (dump_type_real): If a typename is a template-id, put + out the template arguments. + (dump_expr): Handle TEMPLATE_ID_EXPR. + * pt.c (lookup_template_class): Now that full arguments are + available everywhere, remove code that tried to guess them. + +1999-04-09 Mark Mitchell + + * decl.c (make_typename_type): Complain if we don't find a type + when trying to make a typename type for a non-template type. + +1999-04-09 Jason Merrill + + * decl.c (start_decl): Pass attributes to grokdeclarator. + (grokdeclarator): Handle attributes on constructor-syntax + initializers. + +1999-04-08 Mark Mitchell + + * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands + don't have types. + + * search.c (template_self_reference_p): Tweak. + +1999-04-07 Mark Mitchell + + * init.c (build_offset_ref): Don't build yet another weird data + structure to describe overloaded functions. + +1999-04-06 Mark Mitchell + + * cp-tree.h (BASELINK_P): New macro. + (SET_BASELINK_P): Likewise. + * init.c (build_member_call): Remove needless assignment in if + statement. + * search.c (lookup_field_r): Fix handling when we are looking + specifically for a type; these are not hidden by functions and + variables. + (lookup_member): Use SET_BASELINK_P. + * tree.c (is_overloaded_fn): Use BASELINK_P. + (really_overloaed_fn): Likewise. + (get_first_fn): Likewise. + +1999-04-05 Mark Mitchell + + * decl.c (lookup_name_current_level): Tweak, and improve + documentation. + + * class.c (maybe_fixup_vptrs): Remove declaration. + (build_class_init_list): Likewise. + * decl.c (pushdecl_class_level): Call check_template_shadow here + ... + (push_class_level_binding): ... not here. + * search.c (dfs_push_type_decls): Only avoid + template-self-reference TYPE_DECLs if they are from base classes. + +1999-04-04 Mark Mitchell + + * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL + nodes. Tidy. + +1999-04-03 Jason Merrill + + * class.c (maybe_fixup_vptrs, build_class_init_list): Lose. + (finish_struct_1): Don't call build_class_init_list. + +1999-04-02 Mark Mitchell + + * tinfo.h (__class_type_info): Fix illegal declaration. + + * cp-tree.def (TEMPLATE_ID_EXPR): Update comment. + * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro. + (IDENTIFIER_CLASS_VALUE): Improve documentation. + (is_properly_derived_from): Declare. + (invalidate_class_lookup_cache): Likewise. + (maybe_maybe_note_name_used_in_class): Likewise. + (note_name_declared_in_class): Likewise. + (push_using_decl): Remove duplicate declaration. + (id_in_current_class): Remove declaration. + (push_class_binding): Change prototype. + (clear_identitifer_class_values): Declare. + * call.c (is_properly_derived_from): Make it global. + (build_new_function_call): Be careful about updating candidates. + (build_new_method_call): Handle COMPONENT_REFs. Don't crash when + asked to make illegal calls. + * class.c: Include splay-tree.h. + (class_stack_node): Add names_used slot. + (check_member_decl_is_same_in_complete_scope): Remove. + (add_method): Fix comment. Push the declaration into class + scope. + (finish_struct_1): When popping the class, pop the bindings too. + Remove check for data member/function member conflict. + (finish_struct): Remove calls to + check_member_decl_is_same_in_complete_scope. Change calls to + popclass. + (pushclass): Clear names_used in the class stack entry. + Use invalidate_class_lookup_cache to remove cached entries, rather + than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE + before entering a new class. Remove dead code. Don't mess with + current_function_decl when pushing declarations. + (invalidate_class_lookup_cache): New function, split out from ... + (popclass): Here. Clean up names_used on our way out. + (instantiate_type): Adjust. + (build_self_reference): Don't push the declaration here. + (maybe_note_name_used_in_class): New function. + (note_name_declared_in_class): Likewise. + * decl.c (add_binding): Change prototype. + (find_class_binding_level): New function. + (innermost_nonclass_level): Likewise. + (current_binding_level): Update documentation. + (inner_binding_level): Remove. Replace with current_binding_level + throughout. + (push_binding_level): Remove special handling of + class_binding_level. + (pop_binding_level): Likewise. Use find_class_binding_level. + (suspend_binding_level): Likewise. + (global_bindings_p): Use innermost_nonclass_level. + (toplevel_bindings_p): Likewise. + (namespace_bindings_p): Likewise. + (pseudo_global_level_p): Likewise. + (push_binding): Clear INHERITED_VALUE_BINDING_P. + (add_binding): Check for illegal multiple declarations. Return a + value indicating whether or not the new binding was legal. + (push_local_binding): Skip over class binding levels. Check + return value from add_binding. + (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call + note_name_declared_in_class. + (pushlevel_class): Remove "fake out the rest of the compiler" + code. + (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs. + (clear_identifier_class_values): New function. + (pop_from_top_level): Use it. + (pop_everything): Tweak. + (maybe_process_template_type_declaration): Don't push the + declaration for the template here. + (pushtag): Don't push tag declarations into class scope here. + (pushdecl): Apply DeMorgan's law for readability. + (pushdecl_class_level): Remove special-case code for + TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions. + (push_class_level_bindng): Deal with inherited bindings. + (lookup_name_real): Remove special-case code for + TYPE_BEING_DEFINED, and some implicit typename magic. + (grokdeclarator): Handle COMPONENT_REF for a template function. + (build_enumerator): Don't call pushdecl_class_level here. + (id_in_current_class): Remove. + * decl2.c (grokfield): Don't call pushdecl_class_level or + check_template_shadow. + * errfn.c (cp_file_of): Don't declare. + (cp_line_of): Likewise. + * error.c (dump_decl): Handle an OVERLOAD. + (cp_file_of): Likewise. + (cp_line_of): Likewise. + * init.c (build_member_call): Handle a COMPONENT_REF. + * lex.c (do_identifier): Call maybe_note_name_used_in_class, not + pushdecl_class_level. + * method.c (hack_identifier): Build COMPONENT_REFs for references + to member templates as well as member functions. Remove dead + code. + * parse.y (left_curly): Remove. + (nonnested_type): Call maybe_note_name_used_in_class, not + pushdecl_class_level. + * parse.c: Regenerated. + (nested_name_specifier_1): Likewise. + * pt.c (check_explicit_specialization): Adjust, for robustness. + (check_template_shadow): Handle OVERLOADs. + (build_template_decl): Set DECL_CONSTRUCTOR_P on the + TEMPLATE_DECL, if appropriate. + * search.c (envelope_add_decl): Remove. + (dfs_pushdecls): Likewise. + (dfs_compress_decls): Likewise. + (dfs_push_decls): New function. + (dfs_push_type_decls): Likewise. + (setup_class_bindings): Likewise. + (template_self_reference_p): Likewise. + (lookup_field_r): Use it. + (looup_member): Remove old comment. Deal with ambiguity. + (push_class_decls): Use dfs_push_decls and dfs_push_type_decls, + and remove envelope processing. + * semantics.c (begin_class_definition): Let pushclass push + declarations for base classes. + (finish_member_declaration): Push declarations into class scope. + * typeck.c (build_component_ref): Just put an OVERLOAD into the + COMPONENT_REF, not a TREE_LIST of an OVERLOAD. + (build_x_function_call): Deal with OVERLOAD. Handle template-ids. + * Makefile.in (class.o): Depend on splay-tree.h. + +Wed Mar 31 11:30:43 1999 Nathan Sidwell + + * cvt.c (convert_pointer_to_real): Use same_type_p. + * typeck.c (comp_target_types): Use same_type_p. + +1999-03-31 Jason Merrill + + * semantics.c (begin_inline_definitions, + finish_inline_definitions): Rename from finish_default_args and + begin_inline_definitions, respectively, to something that isn't a + total lie. :) + * parse.y (structsp): Adjust. + + * tree.c (hash_tree_cons): Remove obsolete via_* parms. + (list_hash_lookup): Likewise. + (hash_tree_chain): Adjust. + * pt.c (tsubst): Adjust. + (tsubst_arg_types): Use plain hash_tree_cons. + * cp-tree.h (hash_tree_cons_simple): Lose. + * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons. + +Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi + + * Makefile.in (hash.h): Generate using gperf language 'C', not + 'KR-C', so gperf uses the `const' keyword on strings. + + * gxx.gperf (resword): Const-ify a char*. + +1999-03-30 Jason Merrill + + * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, + CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES, + CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH, + CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST, + CLASSTYPE_BINFO_AS_LIST): Remove cruft. + * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c, + tree.c: Adjust. + +1999-03-29 Jason Merrill + + * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall. + +1999-03-28 Jason Merrill + + * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops. + +1999-03-27 Mark Mitchell + + * cp-tree.h (add_friend): Declare. + (add_friends): Likewise. + * friend.c (add_friend): Make it global. Don't add to + DECL_BEFRIENDING_CLASSES if the befriending class is a template. + (add_friends): Make it global. + (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the + befriending class is a template. + * parse.y (component_decl_1): Fix typo in comment. + * parse.c: Regenerated. + * pt.c (instantiate_class_template): Use add_friend and + add_friends rather that duplicating some of their functionality + here. + +1999-03-27 Jason Merrill + + * call.c (build_field_call): Unify 'this' and non-'this' cases. + + * typeck.c (build_indirect_ref): Check for 'this' sooner. + +Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi + + * call.c (op_error): Const-ify a char*. + (add_candidate, source_type, add_warning): Add static prototype. + (print_z_candidates): Const-ify a char*. + + * class.c (resolve_address_of_overloaded_function, + fixed_type_or_null, build_vtable_entry_ref): Add static prototype. + (get_vtable_name, finish_struct_1): Const-ify a char*. + + * cvt.c (convert_to_reference): Likewise. + + * decl.c (redeclaration_error_message, record_builtin_type, + record_unknown_type, member_function_or_else, bad_specifiers): + Likewise. + (find_binding, select_decl, unqualified_namespace_lookup, + lookup_flags, qualify_lookup, record_builtin_java_type, tag_name): + Add static prototype. + (warn_extern_redeclared_static, duplicate_decls, pushdecl, + implicitly_declare, record_builtin_java_type, define_function, + grok_op_properties, tag_name): Const-ify a char*. + + * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const. + (define_function, finish_builtin_type): Const-ify a char*. + (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn, + cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args. + (file_name_nondirectory): Const-ify a char*. + (init_filename_times): Don't prototype. + (compiler_error): Prototype. + (yyerror, init_repo): Const-ify a char*. + (build_srcloc): Don't prototype. + (build_x_indirect_ref, build_indirect_ref, build_component_addr): + Const-ify a char*. + (warn_for_assignment): Don't prototype. + (convert_for_initialization, readonly_error, check_for_new_type, + GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call): + Const-ify a char*. + + * decl2.c (acceptable_java_type, output_vtable_inherit, + setup_initp, start_objects, finish_objects, do_dtors, do_ctors, + merge_functions, decl_namespace, validate_nonmember_using_decl, + do_nonmember_using_decl): Add static prototype. + (lang_f_options): Const-ify a char*. + (finish_builtin_type): Likewise. + (add_function, arg_assoc_namespace, arg_assoc_class): Add static + prototype. + + * errfn.c: Include cp-tree.h. + (cp_thing): Add static prototype. + (compiler_error): Don't protoptype. + (cp_compiler_error): Cast `compiler_error' to `errorfn' before + passing it to `cp_thing'. + + * error.c (interesting_scope_p): Add static prototype. + + * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify + a char*. + + * init.c (compiler_error): Don't prototype. + (member_init_ok_or_else): Const-ify a char*. + (build_java_class_ref): Add static prototype. + + * lex.c (compiler_error): Don't prototype. + (get_time_identifier, interface_strcmp, extend_token_buffer, + handle_cp_pragma): Const-ify a char*. + (is_global, init_filename_times): Add static prototype. + (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*. + (compiler_error): Change from fixed args to variable args. + (yyerror): Const-ify a char*. + + * parse.y (cond_stmt_keyword): Const-ify a char*. + (parse_decl): Add static prototype. + + * pt.c (template_args_equal, print_template_context): Likewise. + (print_candidates, check_default_tmpl_args): Const-ify a char*. + (instantiate_class_template): Likewise. + + * repo.c (get_base_filename, open_repo_file, init_repo): Likewise. + + * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc, + expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise. + + * search.c (lookup_field_info, lookup_member): Likewise. + (lookup_member): Cast the first argument of `bzero' to a PTR. + + * sig.c (compiler_error): Don't prototype. + (build_signature_pointer_or_reference_nam): Const-ify a char*. + (get_sigtable_name, build_member_function_pointer): Likewise. + + * tree.c (compiler_error): Don't prototype. + (no_linkage_helper, build_srcloc): Add static prototype. + (build_vbase_pointer_fields): Const-ify a char*. + (__eprintf): Don't unnecessarily handle `const' when !__STDC__. + + * typeck.c (compiler_error): Don't prototype. + (convert_for_assignment): Const-ify a char*. + (comp_cv_target_types): Add static prototype. + (build_x_indirect_ref, build_indirect_ref, convert_arguments, + build_component_addr, build_unary_op, convert_for_initialization): + Const-ify a char*. + + * typeck2.c (ack): Add static prototype and change from fixed args + to variable args. + (readonly_error, check_for_new_type): Const-ify a char*. + + * xref.c (_XREF_FILE, find_file, filename, fctname, declname, + fixname, open_xref_file, classname, GNU_xref_begin): Likewise. + (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'. + (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, + gen_assign, GNU_xref_member): Const-ify a char*. + +1999-03-25 Martin von Löwis + + * gxxint.texi: Remove old discussion on copying virtual bases. + +1999-03-25 Zack Weinberg + + * Make-lang.in: Remove all references to g++.o/g++.c. + Link g++ from gcc.o. + +1999-03-25 Jason Merrill + + * decl2.c (comdat_linkage): Treat vtables like functions. + +1999-03-25 Mark Mitchell + + * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES. + +1999-03-25 Nathan Sidwell + + * decl.c (init_decl_processing): Add `signed' type as a synonym + for `int'. + +1999-03-25 Jason Merrill + + * typeck.c (common_type): Handle cv-qual unification for pointers + to members. + + * decl.c (unqualified_namespace_lookup): Return error_mark_node + on error. + (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing. + * lex.c (do_identifier): If we got error_mark_node, call + lookup_name again. + +1999-03-24 Martin von Löwis + + * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty + classes. + +1999-03-24 Jason Merrill + + * decl.c (lookup_name_real): Do nested field lookup regardless of + TYPE_BEING_DEFINED. + +1999-03-24 Mark Mitchell + + * cp-tree.h (lang_type): Remove has_assignment and + has_real_assignment. Add befriending_classes. + (TYPE_HAS_ASSIGNMENT): Remove. + (TYPE_HAS_REAL_ASSIGNMENT): Likewise. + (CLASSTYPE_BEFRIENDING_CLASSES): New macro. + (lang_decl): Document. + (DECL_BEFRIENDING_CLASSES): New macro. + (FRIEND_NAME): Move declaration to more obvious location. + (FRIEND_DECLS): Likewise. + * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT. + * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES. + (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT. + (grok_op_properties): Likewise. + * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS. + (add_friend): Likewise. Don't do weird things with assignment + operators. Update DECL_BEFRIENDING_CLASSES. + (add_friends): Don't do weird things with assignment operators. + (make_friend_class): Likewise. Update + CLASSTYPE_BEFRIENDING_CLASSES. + * pt.c (instantiate_class_template): Don't set + TYPE_HAS_ASSIGNMENT. + (tsubst_copy): Substitute the TREE_TYPE for more unary + expressions. + * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT. + * search.c (protected_accessible_p): New function. + (friend_accessible_p): Likewise. + (accessible_p): Use them. + +1999-03-23 Mark Mitchell + + * pt.c (convert_nontype_argument): Don't create things that aren't + PTRMEM_CSTs when applying a qualification conversion to a + PTRMEM_CST. + +1999-03-23 Mark Mitchell + + * Makefile.in (OBJS): Don't mention hash.o. + (OBJDEPS): Likewise. + +1999-03-23 Jason Merrill + + * decl2.c (finish_file): Set at_eof to 2 after expanding ctors. + * decl.c (expand_static_init): Make sure we don't add any after + then. + + * decl.c (cp_finish_decl): Move intelligence about handling + DECL_COMDAT for variables from here... + * decl2.c (comdat_linkage): ...to here. + (maybe_make_one_only): Tweak. + (import_export_decl): Call comdat_linkage for variables, too. + (finish_file): Handle template statics properly. + +1999-03-22 Mark Mitchell + + * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG. + Document internals of pointer-to-member-functions. + (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc. + (PFN_FROM_PTRMEMFUNC): Likewise. + (build_type_conversion): Remove unused parameter. + (build_ptrmemfunc1): Declare. + (expand_ptrmemfunc_cst): New function. + (delta2_from_ptrmemfunc): Likewise. + (pfn_from_ptrmemfunc): Likewise. + * cvt.c (cp_convert_to_pointer): Remove unused parameter to + build_type_conversion. Use TYPE_PTRMEM_P for readability. + (convert_to_reference): Remove unused parameter to + build_type_conversion. + (ocp_convert): Likewise. + (build_user_type_conversion): Likewise. + * error.c (dump_expr): Handle NULL pointer-to-member functions. + * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions. + * method.c (build_overload_value): Don't go splitting CONSTRUCTORs + open when handling pointer-to-member functions. + * pt.c (convert_nontype_argument): Clean up error messages. Be + more stringent with pointers-to-members. + * typeck.c (build_ptrmemfunc1): Don't declare. Make it global. + (build_unary_op): Tidy ever-so-slightly. + (build_conditional_expr): Remove extra parameter to + build_type_conversion. + (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function + we're using. + (expand_ptrmemfunc_cst): Define. + (delta2_from_ptrmemfunc): Likewise. + (pfn_from_ptrmemfunc): Likewise. + +1999-03-19 Mark Mitchell + + * init.c (build_member_call): Handle template-id expressions + correctly. + * typeck.c (build_x_function_call): Likewise. + +1999-03-19 Chip Salzenberg + + * friend.c (make_friend_class): Avoid core dump when + not-yet-defined friend type lacks TYPE_LANG_SPECIFIC(). + +1999-03-18 Jason Merrill + + * decl.c (start_function): Suppress normal linkage heuristics + for #pragma interface under MULTIPLE_SYMBOL_SPACES. + +1999-03-19 Alexandre Oliva + + * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. + ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. + +1999-03-17 Martin von Löwis + + * parse.y (named_complex_class_head_sans_basetype): + Do not push a scope for error_mark_node. + (maybe_base_class_list): Likewise. + + * decl.c (start_decl): Check for error_mark_node as a type. + Detected by g++.brendan/array-refs.C. + (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C. + (maybe_build_cleanup_1): Likewise. Detected by + g++.jason/incomplete1.C. + + * tree.c (build_dummy_object): Use void_zero_node instead of the + error_mark_node. + (is_dummy_object): Check for such a node. + Detected by g++.bob/inherit1.C + +1999-03-16 Jason Merrill + + * method.c (old_backref_index): Split out... + (flush_repeats): From here. Rename back from try_old_backref. + (build_mangled_name): Put back some old-style repeat handling. + +Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi + + * lex.c: Don't include setjmp.h. + (parse_float): New static function. + (pf_args): New struct. + (real_yylex): Use them in call to `do_float_handler'. + +1999-03-15 Mark Mitchell + + * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here. + * tree.c (layout_basetypes): Not here. + * search.c (dfs_search): Remove; no longer used. + +1999-03-12 Mark Mitchell + + * decl2.c (validate_nonmember_using_decl): Issue sensible + error-messages on bogus qualifiers. + +1999-03-14 Jason Merrill + + * call.c (add_function_candidate): Fix uninitialized variable. + + * Makefile.in (search.o): Add dependency on varray.h. + +1999-03-13 Jason Merrill + + * decl.c (duplicate_decls): Use same_type_p. + * method.c (try_old_backref): Renamed from flush_repeats. Use + same_type_p. Don't try to handle repeats. Return success. + (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support + calls from old-style code, too. + (check_ktype): Use same_type_p. + (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT. + (build_qualified_name): Simplify logic. + (process_overload_item): Strip typedefs and quals at the top. + (build_mangled_name_for_type_with_Gcode): Remove call to + type_canonical_variant. + (build_mangled_name): Likewise. Remove support for old-style + repeats, which have been disabled since 2.7.2. Don't mess with + TREE_USED. + (build_decl_overload_real): Don't mess with TREE_USED. + +1999-03-13 Nathan Sidwell + + * error.c (cp_printers): Add 'F' escape character. + (dump_type_real): Remove TREE_LIST (fnargs) printing. + Functionality moved to dump_parameters. + (dump_type_suffix): Use dump_parameters and dump_exception_spec. + (dump_function_decl): Extend meaning of V parameter. Use + dump_parameters and dump_exception_spec. + (dump_parameters): New static function. + (dump_exception_spec): New static function. + (fndecl_as_string): Change argument semantics. Use + dump_function_decl directly. + + * sig.c (build_signature_table_constructor): Use cp_error. + +1999-03-13 Martin von Löwis + + * semantics.c (finish_switch_cond): Handle error cases gracefully. + Detected by g++.law/enum5.C. + + * typeck.c (build_modify_expr): Check for errors after resolving + offsets. Detected by g++.brendan/static1.C. + + * decl.c (complete_array_type): Ignore initial_value if it is an + error. Detected by g++.benjamin/17930.C. + + * typeck2.c (process_init_constructor): Return error if one argument + is in error. Detected by g++.benjamin/13478.C. + +1999-03-12 Martin von Löwis + + * decl.c (select_decl): Allow class templates when we need types. + * decl2.c (ambiguous_decl): Likewise. + +1999-03-12 Mark Mitchell + + * lex.c (do_identifier): Correct call to enforce_access. + * search.c (accessible_p): Tweak comment. + +1999-03-10 Mark Mitchell + + * semantics.c (begin_class_definition): Call build_self_reference. + (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs. + + * search.c (assert_canonical_unmarked): Fix typo in prototype. + + * search.c (dfs_canonical_queue): New function. + (dfs_assert_unmarked_p): Likewise. + (assert_canonical_unmarked): Likewise. + (access_in_type): Use it. + (accessible_p): Likewise. Walk the whole tree when umarking. + + * sig.c (build_signature_table_constructor): Use accessible_p + instead of compute_access. + +1999-03-09 Jason Merrill + + * call.c (add_builtin_candidates): Handle overloaded conversion ops. + +1999-03-09 Mark Mitchell + + * cp-tree.h (flag_access_control): Declare. + (TREE_VIA_PPUBLIC): Document. + (DECL_NONSTATIC_MEMBER_P): New macro. + (enforce_access): Return an indication of whether or not access + was permitted. + (build_self_reference): Change prototype. + (compute_access): Replace with ... + (accessible_p): New function. + (dfs_walk): Change prototype. + (dfs_unmark): Likewise. + (markedp): Likewise. + * call.c (enforce_access): Use accessible_p. + * class.c (build_self_reference): Insert the declaration into the + list of members for this type, and make it public. + * decl.c (xref_basetypes): Avoid ill-timed recursion. + * init.c (build_offset_ref): Use lookup_member, not three separate + name-lookups. Call enforce_access rather than checking for + illegal accesses here. + (resolve_offset_ref): Likewise. + * lex.c (do_identifier): Likewise. + * method.c (hack_identifier): Likewise. + * parse.y (self_reference): Remove. + (opt_component_decl_list): Don't use it. + * parse.c: Regenerated. + * pt.c (print_candidates): Generalize to handle lists of + overloaded functions. + (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's + not set. + (get_template_base): Use new calling convention for dfs_walk. + * search.c: Include varray.h. Add prototypes. + (dfs_walk): Accept a data pointer to pass to the work functions. + All callers changed. All work functions changed. + (breadth_first_search): Rename to bfs_walk, and make consistent + with dfs_walk. + (dfs_walk_real): New function. + (canonical_binfo): New function. + (context_for_name_lookup): Likewise. + (shared_marked_p): Likewise. + (shared_unmarked_p): Likewise. + (lokup_field_queue_p): Likewise. + (lookup_field_r): Generalize to handle both functions and fields. + (lookup_field): Just call lookup_member. + (lookup_fnfields): Likewise. + (lookup_member): Move body of lookup_field here and generalize. + (dfs_accessible_queue_p): Likewise. + (dfs_accessible_p): Likewise. + (dfs_access_in_type): Likewise. + (access_in_type): Likewise. + (compute_access): Remove, and replace with ... + (accessible_p): New function. + (vbase_types): Remove. + (vbase_decl_ptr_intermediate): Likewise. + (vbase_decl_ptr): Likewise. + (vbase_init_result): Likewise. + (closed_envelopes): Likewise. + (bvtable): Likewise. + +1999-03-09 Jason Merrill + + * call.c (add_function_candidate): Check for proper number of args + before checking the validity of those args. + +1999-03-06 Jason Merrill + + * cp-tree.h (struct lang_type): Add anon_union field. + (ANON_UNION_TYPE_P): Use it instead of examining type. + (SET_ANON_UNION_TYPE_P): New macro. + * decl.c (check_tag_decl): Use it. + + * search.c (compute_access): Handle non-type contexts earlier, and + handle NULL_TREE. + + * tree.c (build_exception_variant): Use copy_to_permanent. + + * decl2.c (setup_initp): Give statics with no priority the default + priority here. + (do_dtors, do_ctors, finish_file): Remove special handling of + non-prioritized statics. + +1999-03-05 Mark Mitchell + + * cp-tree.h (ANON_UNION_TYPE_P): Robustify. + * decl.c (make_typename_type): Don't issue an error if an + immediate lookup fails; it migt be resolved later. + * friend.c (is_friend): Add comment. + * search.c (breadth_first_search): Add POSTFN and DATA + parameters. Tidy. All callers changed. + (lookup_field_queue_p): New function. + (lookup_field_r): Likewise. + (lookup_field_post): Likewise. + (lookup_field): Use them, via breadth_first_search, instead of + duplicating logic. + (compute_access): Robustify. + (lookup_fnfield_info): New structure. + +1999-03-05 Jason Merrill + + * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again. + +1999-03-03 Jason Merrill + + * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4 + cc happy. + + * decl2.c (import_export_class): Also return if + CLASSTYPE_INTERFACE_ONLY is set. + +1999-03-03 Martin von Löwis + + * decl.c (push_overloaded_decl): Only overwrite the old binding if + there was one. + * decl2.c (do_local_using_decl): Fix loop termination. + +1999-03-02 Mark Mitchell + + * cp-tree.h (determine_specialization): Don't declare. + * pt.c (determine_specialization): Make it static. Eliminate + complain parameter. Note that decl is always non-NULL now, and + simplify accordingly. + + * decl.c (maybe_push_to_top_level): Always call + push_cp_function_context. + (pop_from_top_level): Always call pop_cp_function_context. + +1999-02-26 Nathan Sidwell + + * typeck.c (complete_type_or_else): Add VALUE arg, for helpful + diagnostics. + * cp-tree.h (complete_type_or_else): Added VALUE parameter. + * init.c (build_new_1): Extra arg to complete_type_or_else. + (build_delete): Likewise. + * typeck.c (require_complete_type): Likewise. + (pointer_int_sum): Likewise. + (pointer_diff): Likewise. + (build_component_ref): Likewise. + + * typeck2.c (incomplete_type_error): Always use cp_error. + Show declaration of undefined type, if appropriate. + Deal with UNKNOWN_TYPE nodes. + + * typeck.c (require_complete_type): Use TYPE_SIZE as + size_zero_node to mean incomplete type. + (require_complete_type_in_void): New function. + (build_compound_expr): Call complete_type_in_void for LHS. + (build_c_cast): Call complete_type_in_void for void cast. + * cvt.c (ocp_convert): Call complete_type_in_void for void cast. + * decl.c (cplus_expand_expr_stmt): Void expression checks moved to + require_complete_type_in_void. Call it. + * cp-tree.h (require_complete_type_in_void): Prototype new function. + + * typeck.c (convert_arguments): Use alternative format for + function decls. Don't require_complete_type here. Simplify + diagnostic printing. + (convert_for_initialization): Don't require_complete_type on RHS yet. + * call.c (convert_arg_to_ellipsis): Call require_complete_type. + + * call.c (build_over_call): Cope with qualified void return type. + * semantics.c (finish_call_expr): Likewise. + * typeck.c (build_function_call_real): Likewise. + (c_expand_return): Likewise. + * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type. + + * call.c (print_z_candidates): Use alternate print format, to be + consistent with (pt.c) print_candidates. + * method.c (hack_identifier): List candidate members. + * search.c (lookup_field): Build ambiguous list, and show it, if + ambiguous. + +1999-02-26 Mark Mitchell + + * typeck.c (decay_conversion): Don't confuse constant array + variables with their initializers. + + * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when + merging decls. + * pt.c (regenerate_decl_from_template): Tweak for clarity. + (instantiate_decl): Mark a decl instantiated before regenerating + it to avoid recursion. + * tree.c (mapcar): Don't call decl_constant_value unless we know + something is TREE_READONLY_DECL_P. + + * class.c (check_for_override): Don't stop checking when we find + the first overridden function. Delete #if 0'd code. + * search.c (get_matching_virtual): Likewise. + +1999-02-25 Richard Henderson + + * lang-specs.h: Define __FAST_MATH__ when appropriate. + +1999-02-24 Mike Stump + + * typeck.c (convert_for_assignment): Allow boolean integral constant + expressions to convert to null pointer. + +1999-02-24 Martin von Loewis + + * decl.c (lookup_namespace_name): Resolve namespace aliases. + + * class.c (push_nested_class): Allow namespaces. + + * decl2.c (set_decl_namespace): Add friendp parameter. + * decl.c (grokfndecl): Pass it. + (grokvardecl): Likewise. + * cp-tree.h: Change declaration. + +1999-02-24 Jason Merrill + + * pt.c (tsubst): Allow an array of explicit size zero. + +1999-02-23 Jason Merrill + + * errfn.c: Change varargs code to look like toplev.c. + + * method.c (process_modifiers): Don't prepend 'U' for char or + wchar_t. + +1999-02-20 Craig Burley + + * Make-lang.in (cplib2.ready): Don't consider updating + cplib2 stuff if the current directory isn't writable, as + it won't work (such as during a `make install'). + +Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org) + + * decl2.c (start_objects): Make file scope constructors and + destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and + ASM_OUTPUT_DESTRUCTOR are defined. + +1999-02-19 Mark Mitchell + + * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment. + (fn_type_unification): Adjust prototype. + (lookup_fnfields_1): Declare. + * call.c (add_template_candidate_real): Adjust call to + fn_type_unification. + * class.c (add_method): Don't allow duplicate declarations of + constructors or destructors. + (resolve_address_of_overloaded_function): Remove unused variable. + Adjust call to fn_type_unification. + * decl.c (grokfndecl): Be more robust in the face of illegal + specializations. + * decl2.c (check_classfn): Remove hokey handling of member + templates. + * pt.c (determine_specialization): Improve comments. Adjust to + handle template argument deduction as per the standard. + (check_explicit_specialization): Fix comment spacing. Handle + type-conversion operators correctly. Improve error-recovery. + (fn_type_unification): Remove EXTRA_FN_ARG parameter. + (get_bindings_real): Simplify handling of static members. + * search.c (lookup_fnfields_1): Make it have external linkage. + * typeck.c (compparms): Fix comment. + (build_unary_op): Don't try to figure out which template + specialization is being referred to when when the address-of + operator is used with a template function. + +Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi + + * cp-tree.h (lvalue_or_else): Qualify a char* with the `const' + keyword to match an analogous change at the top level. + + * tree.c (lvalue_or_else): Likewise. + +1999-02-17 Mark Mitchell + + * decl.c (xref_basetypes): Comment. + * pt.c (instantiate_class_template): Use xref_basetypes. + +1999-02-16 Mark Mitchell + + * cp-tree.h (tsubst): Change prototype. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (type_unification): Remove prototype. + * call.c (convert_default_arg): Adjust call to tsubst_expr. + * class.c (resolve_address_of_overloaded_function): Just use + fn_type_unification. + * decl.c (grokdeclarator): Adjust call to tsubst. + * method.c (build_template_parm_names): Likewise. + * pt.c (GTB_VIA_VIRTUAL): New macro. + (GTB_IGNORE_TYPE): Likewise. + (resolve_overloaded_unification): Add `complain' parameter. + (try_one_overload): Likewise. + (tsubst_template_arg_vector): Likewise. + (tsubst_template_parms): Likewise. + (tsubst_aggr_type): Likewise. + (tsubst_arg_types): Likewise. + (tsubst_call_declarator_parms): Likewise. + (unify): Remove explicit_mask. + (type_unification_real): Likewise. + (get_template_base_recursive): Likewise. + (coerce_template_template_parms): Provide prototype. + (tsubst_function_type): Likewise. + (try_class_unification): New function. + All callers changed to use new complain parameter. + (get_template_base): Use try_class_unification. + (unify): Adjust handling of classes derived from template types. + (fn_type_unification): Substitute explicit arguments before + unification. + +1999-02-16 Kriang Lerdsuwanakij + + * decl.c (pushdecl): Remove dead code. + +1999-02-16 Jason Merrill + + * decl2.c (finish_objects): Fix code I missed in previous change. + +1999-02-13 Jason Merrill + + * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. + (grokdeclarator): Don't expect error_mark_node from grokfndecl. + + * pt.c (maybe_process_partial_specialization): Complain about + 'template <>' on non-specialization. + +1999-02-10 Jason Merrill + + * decl.c (grokdeclarator): Catch weird declarators. + * decl2.c (finish_file): Don't abort because of namespace parsing + failure. + (check_decl_namespace): Remove. + +1999-02-09 Mark Mitchell + + * cp-tree.h (get_template_base): Don't declare. + (dfs_walk): Declare. + (dfs_unmark): Likewise. + (markedp): Likewise. + * pt.c (unify): Remove duplicate declaration. Pass tparms and + targs to get_template_base. + (get_template_base_recursive): Move here from search.c. Check to + see that the base found can be instantiated to form the desired + type. + (get_template_base): Likewise. + (get_class_bindings): Simplify. + * search.c (get_template_base_recursive): Move to pt.c. + (get_template_base): Likewise. + (markedp): Make it global. + (dfs_walk): Likewise. + (dfs_unmark): Likewise. + +1999-02-07 Jason Merrill + + * pt.c (maybe_process_partial_specialization): Complain about + specialization in wrong namespace. + * tree.c (decl_namespace_context): New fn. + +1999-02-06 Kriang Lerdsuwanakij + + * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM. + * pt.c (coerce_template_template_parms): Handle nested + template template parameters. + +Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com) + + * typeck2.c: Update email addresses. + +1999-02-04 Kriang Lerdsuwanakij + + * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag + turned off. + +1999-02-04 Jason Merrill + + * lex.c (retrofit_lang_decl): Split out... + (build_lang_decl): From here. + * decl.c (pushdecl): Call it for functions generated by the middle + end that don't have DECL_LANG_SPECIFIC. + * cp-tree.h: Declare it. + + * decl2.c: Remove flag_init_priority. Always enable initp stuff. + (start_objects, finish_objects): Only use special + init_priority code if the user specified a priority. + (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp + objects. + +Wed Feb 3 22:50:17 1999 Marc Espie + + * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and + mkstemp.o. Get them from libiberty now. + (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o. + +Tue Feb 2 22:38:48 1999 Theodore Papadopoulo + + * decl2.c (lang_decode_option): Use read_integral_parameter. + +1999-02-01 Mark Mitchell + + * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED + before calling complete_type_or_else. + +Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi + + * input.c (inline): Don't define, its handled by system.h. + +Sun Jan 31 20:34:29 1999 Zack Weinberg + + * decl2.c: Don't define flag_no_ident here. Don't process + -f(no-)ident here. + * cp-tree.h: Don't declare flag_no_ident here. + * lang-specs.h: Map -Qn to -fno-ident. + +1999-01-28 Jason Merrill + + * cp-tree.h (struct tree_binding): Replace scope field with a union. + (BINDING_SCOPE): Adjust. + * decl.c (BINDING_LEVEL): Adjust. + +1999-01-26 Jason Merrill + + * pt.c (instantiate_class_template): Set up the DECL_INITIAL of + member constants. + + * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in + a ctor initializer. + + * tree.c (equal_functions): Fix name in prototype. + + * decl.c (push_local_binding): Add FLAGS argument. + (pushdecl, push_overloaded_decl): Pass it. + * decl2.c (do_local_using_decl): Likewise. + * cp-tree.h: Adjust prototype. + * decl.c (poplevel): Fix logic. + + * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST. + (poplevel): Handle that. Fix logic for removing TREE_LISTs. + (cat_namespace_levels): Don't loop forever. + +1999-01-25 Richard Henderson + + * typeck.c (build_reinterpret_cast): Fix typo in duplicated test. + +1999-01-25 Jason Merrill + + * class.c (resolve_address_of_overloaded_function): Mark the + chosen function used. + + * call.c (build_call): Make sure that a function coming in has + been marked used already. + * decl.c (expand_static_init): Call mark_used instead of + assemble_external. + * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec, + alloc_eh_object, expand_throw): Likewise. + * init.c (build_builtin_delete_call): Likewise. + * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1, + expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, + expand_generic_desc): Likewise. + +1999-01-25 Martin von Löwis + + * tree.c (equal_functions): New function. + (ovl_member): Call it. + +1999-01-24 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. + +1999-01-25 Martin von Loewis + + * decl.c (decls_match): Return 1 if old and new are identical. + (push_overloaded_decl): Set OVL_USED when PUSH_USING. + +1999-01-24 Jason Merrill + + * decl.c (start_function): Make member functions one_only on windows. + * decl2.c (import_export_decl): Likewise. + + * decl.c (grokdeclarator): Don't complain about implicit int in + a system header. Change same-name field check to not complain in + a system header instead of within extern "C". + +1999-01-21 Mark Mitchell + + * cp-tree.h (PUSH_GLOBAL): New macro. + (PUSH_LOCAL): Likewise. + (PUSH_USING): Likewise. + (namespace_bindings_p): Declare. + (push_overloaded_decl): Likewise. + * decl.c (push_overloaded_decl): Don't make it static. Check for + illegal declarations after using declarations here. + (namespace_bindings_p): Likewise. + (duplicate_decls): Don't consider declarations from different + namespaces to be the same. + (pushdecl): Use symbolic PUSH_ constants in calls to + push_overloaded_decl. + (push_overloaded_decl_1): Likewise. + * decl2.c (validate_nonmember_using_decl): Tweak `std' handling. + (do_nonmember_using_decl): Check for illegal using declarations + after ordinary declarations here. + (do_local_using_decl): Call pushdecl to insert declarations. + +1999-01-21 Jason Merrill + + * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo. + +1999-01-21 Mark Mitchell + + * tree.c (build_cplus_array_type_1): Don't call build_array_type + for types involving template parameters. + + * cp-tree.h (PARM_DECL_EXPR): Delete. + (convert_default_arg): Change prototype. + (check_default_argument): Declare. + (search_tree): Likewise. + * call.c (convert_default_arg): Take the function to which the + default argument belongs as a parameter, and do any necessary + instantiation here, instead of ... + (build_over_call): Here. + * decl.c (local_variable_p): New function. + (check_default_argument): Likewise, split out and tidied from ... + (grokparms): Here. + * error.c (dump_expr): Don't set PARM_DECL_EXPR. + * pt.c (tsubst_call_declarator_parms): New function. + (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing + with CALL_EXPRs, rather than trying to be clever. + (tsubst): Use tsubst_call_declarator_parms. + * tree.c (search_tree): Don't make it static. + * typeck.c (convert_arguments): Use new interface to + convert_default_arg. + +1999-01-20 Mark Mitchell + + * error.c (dump_function_decl): Don't print the argument types for + a function when the verbosity level is negative. + + * call.c (build_over_call): Check format attributes at call-time. + + * pt.c (tsubst_copy): Fix comment. + (unify): Don't allow unification with variable-sized arrays. + + * semantics.c (finish_stmt_expr): When processing a template make + the BIND_EXPR long-lived. + +1999-01-19 Jason Merrill + + * decl2.c (finish_vtable_vardecl): Make vtables comdat here. + (import_export_vtable): Not here. + +1999-01-18 Jason Merrill + + * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique + non-static member function. + +1999-01-18 Nathan Sidwell + + * class.c (instantiate_type): Only diagnose illegal address of member + function if complaining. + + * decl.c (lookup_name_real): Remove duplicate code. + +1999-01-18 Jason Merrill + + * tree.c (copy_template_template_parm): Use permanent_obstack. + +1999-01-18 Kriang Lerdsuwanakij + + * pt.c (unify): Remove restrictions on deduction of argument + of template template parameters. + +1999-01-18 Nathan Sidwell + + * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs. + + * class.c (resolve_address_of_overloaded_function): Show list of + all candidates, when none of them match. + +1999-01-18 Chip Salzenberg + + * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up + definition of 'casting away const' in reinterpret_cast<>. + +1999-01-18 Graham + + * cvt.c: Add include for decl.h, remove extern for + static_aggregates which is now provided by decl.h. + + * Makefile.in (cvt.o): Add dependency for decl.h and missing + dependencies for convert.h and flags.h. + +1999-01-18 Nathan Sidwell + + * decl2.c (do_dtors): Set current location to that of the + decl, for sensible diagnostics and debugging. + (check_classfn): Issue `incomplete type' error, if + class is not defined. + +1999-01-16 Jason Merrill + + * cp-tree.h: Add prototype for bound_pmf_p. + +1999-01-16 Jason Merrill + Manfred Hollstein + + * decl.c (grokdeclarator): Don't make 'main(){}' an error with only + -Wreturn-type. + +1999-01-16 Nathan Sidwell + + * cp-tree.h (struct lang_type): Added has_mutable flag. + (CLASSTYPE_HAS_MUTABLE): New macro to access it. + (TYPE_HAS_MUTABLE_P): New macro to read it. + (cp_has_mutable_p): Prototype for new function. + * class.c (finish_struct_1): Set has_mutable from members. + * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if + it contains a mutable. + * typeck.c (cp_has_mutable_p): New function. + +1999-01-15 Mark Mitchell + + * pt.c (process_template_parm): Ignore top-level qualifiers on + non-type parameters. + + * decl.c (start_function): Use current_function_parms in the call + to require_complete_type_for_parms, not the probably empty + DECL_ARGUMENTS. + +1999-01-14 Jason Merrill + + * semantics.c (finish_asm_stmt): Don't warn about redundant volatile. + + * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means + that we don't suppress the other copies. + * lex.c (handle_cp_pragma): Likewise. + +1999-01-13 Mark Mitchell + + * decl.c (grokdeclarator): Undo 1998-12-14 change. + * tree.c (build_cplus_array_type_1): Likewise. + * pt.c (instantiate_class_template): Remove misleading comment. + (tsubst_aggr_type): Substitute if there are template parameters, + regardless of whether or not they use template arguments. + (unify): Likewise, but for unification. + +1999-01-12 Richard Henderson + + * cp-tree.h (flag_permissive): Declare extern. + +1999-01-06 Mark Mitchell + + * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT + here. + (lang_type): Add is_partial_instantiation. Decrease width of + dummy. + (PARTIAL_INSTANTIATION_P): New macro. + (OPERATOR_TYPENAME_P): Remove. + * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not + OPERATOR_TYPENAME_P. + (grok_op_properties): Likewise. + * friend.c (do_friend): Handle friends that are member functions + correctly. + * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT. + * pt.c (instantiate_class_template): Rework for clarity. Avoid + leaving TYPE_BEING_DEFINED set in obscure cases. Don't do + any more partial instantiation than is absolutely necessary for + implicit typename. Set PARTIAL_INSTANTIATION_P. + (tsubst_decl): Use IDENTIFIER_TYPENAME_P. + * semantics.c (begin_class_definition): Handle partial + specializations of a type that was previously partially + instantiated. + +Wed Jan 6 03:18:53 1999 Mark Elbrecht + + * Make-lang.in (g++.o): Depend on prefix.h. + +1999-01-04 Jason Merrill + + * tree.c (bound_pmf_p): New fn. + * typeck.c (build_c_cast): Use it. + + * decl.c (grok_op_properties): Use same_type_p. diff --git a/gcc/cp/ChangeLog-2000 b/gcc/cp/ChangeLog-2000 new file mode 100644 index 00000000000..4855669fd62 --- /dev/null +++ b/gcc/cp/ChangeLog-2000 @@ -0,0 +1,7274 @@ +2000-12-29 Jakub Jelinek + + * decl.c (init_decl_processing): Fix sign of wchar_type_node. + +2000-12-29 Mark Mitchell + + * class.c (pushclass): Remove #if 0'd code. + * cp-tree.h (overload_template_name): Remove. + * decl.c (store_bindings): Simplify. + (pop_from_top_level): Likewise. + * pt.c (overload_template_name): Remove. + (instantiate_decl): Don't call push_to_top_level if it's not + needed. + +2000-12-28 Mark Mitchell + + * pt.c (register_local_specialization): Don't return a value. + (lookup_template_class): Use move-to-front heuristic when looking + up template instantiations. + (instantiate_decl): Only push_to_top_level when we're actually + going to instantiate the template. + +2000-12-29 Hans-Peter Nilsson + + * search.c (binfo_for_vtable): Return least derived class, not + most. Handle secondary vtables. + +2000-12-22 Jason Merrill + + * pt.c (more_specialized): Don't optimize len==0. + (fn_type_unification): If we're adding the return type, increase len. + + * typeck.c (build_binary_op): Fix pmf comparison logic. + + * call.c (joust): Use DECL_NONSTATIC_MEMBER_FUNCTION_P, not + DECL_STATIC_FUNCTION_P. + + * semantics.c (genrtl_finish_function): Don't try to jump to + return_label unless it exists. + + In partial ordering for a call, ignore parms for which we don't have + a real argument. + * call.c (joust): Pass len to more_specialized. + (add_template_candidate_real): Strip 'this', pass len. + * pt.c (more_specialized): Pass len down. Lose explicit_args parm. + (get_bindings_order): New fn. Pass len down. + (get_bindings_real): Strip 'this', pass len. + (fn_type_unification): Likewise. + (type_unification_real): Succeed after checking 'len' args. + (most_specialized_instantiation): Lose explicit_args parm. + * class.c (resolve_address_of_overloaded_function): Strip 'this', + pass len. + +2000-12-21 Jason Merrill + + * pt.c (tsubst_decl): A FUNCTION_DECL has DECL_RESULT, not + DECL_TEMPLATE_RESULT. + + * search.c (lookup_field_r): Call lookup_fnfields_1, not + lookup_fnfields_here. + + * parse.y (typename_sub2): Return the TYPE_DECL, not the type. + + * call.c (build_object_call): Also allow conversions that return + reference to pointer to function. + (add_conv_candidate): Handle totype being ref to ptr to fn. + (build_field_call): Also allow members of type reference to function. + Lose support for calling pointer to METHOD_TYPE fields. + + * error.c (dump_expr): Handle *_CAST_EXPR. + + * typeck2.c (build_scoped_ref): Always convert to the naming class. + + * tree.c (break_out_cleanups): Lose. + * cp-tree.h: Remove prototype. + * typeck.c (build_component_ref): Don't break_out_cleanups. + (build_compound_expr): Likewise. + * semantics.c (finish_expr_stmt): Likewise. + +2000-12-20 Richard Henderson + + * cp-tree.h: Update declarations. + * decl.c (finish_case_label): Return the new stmt node. + * semantics.c (finish_goto_stmt): Likewise. + (finish_expr_stmt, finish_return_stmt): Likewise. + (finish_break_stmt, finish_continue_stmt): Likewise. + (finish_asm_stmt): Likewise. + * parse.y (already_scoped_stmt): Set STMT_LINENO. + (compstmt, implicitly_scoped_stmt, stmt): Likewise. + (simple_if, simple_stmt): Return the new stmt node. + (save_lineno): New. + +2000-12-18 Joseph S. Myers + + * cp-tree.h: Don't declare warn_long_long. + +2000-12-15 Kriang Lerdsuwanakij + + * tree.c (no_linkage_helper): Use CLASS_TYPE_P instead of + IS_AGGR_TYPE. + +2000-12-15 Kriang Lerdsuwanakij + + * pt.c (unify): Handle when both ARG and PARM are + BOUND_TEMPLATE_TEMPLATE_PARM. + +2000-12-15 Kriang Lerdsuwanakij + + * pt.c (reduce_template_parm_level): Set DECL_ARTIFICIAL and + DECL_TEMPLATE_PARM_P. + +2000-12-15 Jason Merrill + + * init.c (build_new_1): Reorganize. Now with 100% fewer SAVE_EXPRs! + + * init.c (build_new_1): Don't strip quals from type. + + * decl.c (pushdecl): Don't check for linkage on a non-decl. + + * call.c (build_op_delete_call): See through ARRAY_TYPEs. + + * call.c (build_new_function_call): Lose space before paren in + error message. + (build_new_method_call): Likewise. + + * typeck2.c (build_m_component_ref): Propagate quals from datum. + +2000-12-14 Kriang Lerdsuwanakij + + * pt.c (check_explicit_specialization): Propagate default + function arguments to explicit specializations. + +2000-12-13 DJ Delorie + + * typeck.c (build_binary_op): Do signed/unsigned warnings for >? + and + + * error.c (dump_function_name): Don't let the user see __comp_ctor. + + Clean up copy-initialization in overloading code. + * call.c (build_user_type_conversion_1): Die if we are asked to + convert to the same or a base type. + (implicit_conversion): Avoid doing so. Lose reference binding code. + (convert_like_real): Treat BASE_CONV and RVALUE_CONV as implicit + direct-initialization. Also do direct-init part of copy-init. + (build_user_type_conversion): Don't provide context to convert_like. + * cvt.c (ocp_convert): build_user_type_conversion will now provide + the constructor call for copy-init. + + * pt.c (tsubst_decl): Call clone_function_decl here if this is an + instantiation of a member template. + (do_decl_instantiation): Not here. + +2000-12-07 Nathan Sidwell + + * class.c (check_field_decls): Don't special case anonymous + fields in error messages. + (note_name_declared_in_class): Use %D on diagnostic. + + * tree.c (pod_type_p): Use strip_array_types. + (cp_valid_lang_attribute): Likewise. + * typeck.c (cp_type_quals): Strip arrays separately, to avoid + multiple evaluations. + (cp_has_mutable_p): Use strip_array_types. + +2000-12-07 Nathan Sidwell + + * cp-tree.h (sufficient_parms_p): Declare new function. + * call.c (sufficient_parms_p): New function, broken out of ... + (add_function_candidate): ... here. Use it. + (add_conv_candidate): Use it. + * decl.c (grok_ctor_properties): Use it. + +2000-12-07 Jakub Jelinek + + * optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT. + +2000-12-07 Joseph S. Myers + + * decl2.c (lang_decode_option): Handle -Wformat-security. + +2000-12-06 Kriang Lerdsuwanakij + + * pt.c (verify_class_unification): New function. + (get_class_bindings): Use it. + (try_class_unification): Tidy. + (unify): Handle when argument of a template-id is not + template parameter dependent. + (template_args_equal): Handle when TREE_CODE's do not match. + +2000-12-06 Alexandre Oliva + + * lang-specs.h (c++): When invoking the stand-alone preprocessor + for -save-temps, pass all relevant -Defines to it, and then don't + pass them to cc1plus. + +2000-12-05 Will Cohen + + * decl.c (finish_case_label): Cleared + more_cleanups_ok in surrounding function scopes. + (define_label): Likewise. + +2000-12-05 Nathan Sidwell + + * cp-tree.h (IDENTIFIER_VIRTUAL_P): Document. + (get_matching_virtual): Remove. + (look_for_overrides): Declare new function. + * decl.c (grokfndecl): Don't set IDENTIFIER_VIRTUAL_P or + DECL_VINDEX here. + * class.c (check_for_override): Move base class iteration code + to look_for_overrides. + * search.c (next_baselink): Remove. + (get_virtuals_named_this): Remove. + (get_virtual_destructor): Remove. + (tree_has_any_destructors_p): Remove. + (struct gvnt_info): Remove. + (check_final_overrider): Remove `virtual' from error messages. + (get_matching_virtuals): Remove. Move functionality to ... + (look_for_overrides): ... here, and ... + (look_for_overrides_r): ... here. Set DECL_VIRTUAL_P, if found + to be overriding. + +2000-12-05 Nathan Sidwell + + * typeck.c (get_delta_difference): If via a virtual base, + return zero. + * cvt.c (cp_convert_to_pointer): If via a virtual base, do no + adjustment. + +2000-12-04 Richard Henderson + + * error.c (dump_tree): Use output_add_string not OB_PUTS. + +2000-12-04 Jason Merrill + + * mangle.c (write_type): Mangle VECTOR_TYPE with "U8__vector". + (write_builtin_type): Pass intSI_type_node and the like through + type_for_mode. + * method.c (process_overload_item): Mangle VECTOR_TYPEs with 'o'. + Pass intSI_type_node and the like through type_for_mode. + * decl2.c (arg_assoc_type): Handle VECTOR_TYPE like COMPLEX_TYPE. + * pt.c (tsubst, unify): Likewise. + * tree.c (walk_tree): Likewise. + * error.c (dump_type): Likewise. + (dump_type_prefix, dump_type_suffix): Don't bother with VECTOR_TYPE. + + * Make-lang.in: Tweak top comment for emacs. + (cp/TAGS): Restore. + + * except.c (expand_throw): Use push_throw_library_fn for _Jv_Throw. + + * class.c (clone_function_decl): Robustify. + +2000-12-04 Michael Matz + + * decl.c (store_bindings): Only search in the non modified + old_bindings for duplicates. + +2000-12-04 Nathan Sidwell + + * error.c (dump_function_decl): Use DECL_VIRTUAL_P, not + TYPE_POLYMORPHIC_P. + + * typeck.c (build_static_cast): Remove unused variable. + +2000-12-01 Kriang Lerdsuwanakij + + * pt.c: Fix typo in comment. + +2000-12-01 Joseph S. Myers + + * decl2.c (warn_format): Remove definition. + (lang_decode_option): Handle -Wformat-nonliteral, + -Wno-format-extra-args and -Wno-format-y2k. Use set_Wformat. + +2000-12-01 Joseph S. Myers + + * decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define. + (init_decl_processing): Don't create string_type_node, + const_string_type_node, wint_type_node, intmax_type_node, + uintmax_type_node, default_function_type, ptrdiff_type_node and + unsigned_ptrdiff_type_node. Adjust position of call to + c_common_nodes_and_builtins. + (identifier_global_value): New function. + +2000-12-01 Nathan Sidwell + + * call.c (standard_conversion): Reject pointer to member + conversions from ambiguous, inaccessible or virtual bases. + * typeck.c (build_static_cast): Don't check pointers to members + specially. + +2000-11-30 Nathan Sidwell + + * method.c (do_build_copy_constructor): Preserve cv + qualifications when accessing source object members. + (do_build_assign_ref): Likewise. Remove separate diagnostics for + unnamed fields. + +2000-11-30 Nathan Sidwell + + * method.c (do_build_assign_ref): Construct appropriately + CV-qualified base reference. Don't allow const casts in base + conversion. + +2000-11-30 Nathan Sidwell + + * call.c (build_over_call): Use VOID_TYPE_P. Don't die on + incomplete return type. + +2000-11-28 Nathan Sidwell + + * parse.y (base_class.1): Produce a _TYPE not a _DECL. + * semantics.c (finish_base_specifier): Accept a _TYPE not a + _DECL. + +2000-11-28 Nathan Sidwell + + * spew.c (yyerror): Cope if yylval.ttype is NULL. + +2000-11-28 Nathan Sidwell + + * decl.c (grokdeclarator): Diagnose undefined template contexts. + +2000-11-28 Nathan Sidwell + + * decl.c (grokdeclarator): Do type access control on friend + class. + +2000-11-27 Nathan Sidwell + + * decl.c (grokfndecl): Undo COMPONENT_REF damage caused by + bison parser ickiness. + * pt.c (tsubst_friend_function): Enter namespace scope when + tsubsting the function name. + * cp-tree.h (DECL_TI_TEMPLATE): Update comment to reflect reality. + +2000-11-27 Nathan Sidwell + + * cp-tree.h (binfo_from_vbase): Return the virtual base's binfo. + * cvt.c (cp_convert_to_pointer): Add force parameter. + Allow conversions via virtual base if forced. + (convert_to_pointer_force): Adjust call to cp_convert_to_pointer. + (ocp_convert): Likewise. + * search.c (binfo_from_vbase): Return the virtual base's binfo. + * typeck.c (get_delta_difference): Adjust handling of virtual + bases. + +2000-11-26 Mark Mitchell + + * tree.c (struct list_hash): Remove. + (list_hash_table): Make it be an htab. + (struct list_proxy): New type. + (list_hash_eq): New function. + (list_hash_pieces): Renamed from ... + (list_hash): ... this. + (list_hash_lookup): Remove. + (list_hash_add): Remove. + (hash_tree_cons): Use the generic hashtable. + (mark_list_hash): Remove. + (init_tree): Create the hashtable. + +2000-11-25 Joseph S. Myers + + * method.c (build_mangled_C9x_name): Rename to + build_mangled_C99_name. Change C9X references in comments to + refer to C99. + +2000-11-24 Nathan Sidwell + + * parse.y (unary_expr): Move VA_ARG from here ... + (primary): ... to here. + +2000-11-24 Nathan Sidwell + + * semantics.c (finish_id_expr): If type is error_mark, return + error_mark. + +2000-11-23 Nathan Sidwell + + * pt.c (lookup_template_class): Simplify loop exit constructs. + Cope when there is no partial instantiation of a template + template member. + +2000-11-23 J"orn Rennecke + + * Make-lang.in (g++spec.o, cxxmain.o): Depend on $(CONFIG_H). + +2000-11-22 Mark Mitchell + + * mangle.c (mangle_conv_op_name_for_type): Don't use `__op' + prefix. + + * pt.c (do_decl_instantiate): Explicitly clone constructors and + destructors that haven't already been cloned. + +2000-11-20 Richard Henderson + + * parse.y (yyparse_1): Rename the parser entry point. + +2000-11-20 Alex Samuel + + * mangle.c (write_name): Use for names directly in + function scope. + (write_unscoped_name): Accept names directly in function scope. + +2000-11-20 Nathan Sidwell + + * lex.c (rid_to_yy, RID_EXPORT): Make unique keyword. + * parse.y (extdef): Add EXPORT reduction. + * spew.c (yylex): Don't skip export here. + +2000-11-19 Mark Mitchell + + * decl.c (init_decl_processing): Correct name of pure virtual + function under the new ABI. + * rtti.c (throw_bad_cast): Likewise, for bad cast function. + (throw_bad_typeid): Likewise for bad typeid function. + +2000-11-18 Mark Mitchell + + * decl.c (grokparms): Don't even function types of `void' type, + either. + * mangle.c (write_type): Don't crash when confronted with the + error_mark_node. + + * decl.c (grokparms): Don't create parameters of `void' type. + +2000-11-17 Zack Weinberg + + * lex.c (mark_impl_file_chain): Delete. + (init_parse): Remove call to ggc_add_string_root. No need to + ggc_strdup a string constant. Do not add impl_file_chain to GC + roots. + (handle_pragma_implementation): No need to ggc_strdup main_filename. + +2000-11-17 Nathan Sidwell + + * pt.c (tsubst_expr, DECL_STMT): Instantiate decl's type. + +2000-11-17 Nathan Sidwell + + * cp-tree.h (PARMLIST_ELLIPSIS_P): New macro. + * decl.c (grokdeclarator): Don't reject void parms here. + (require_complete_types_for_parms): Simplify, use + complete_type_or_else. + (grokparms): Remove bitrot. Remove funcdef parm. + Deal with ellipsis parm lists here. + * semantics.c (finish_parmlist): Don't append void_list_node + here. Set PARMLIST_ELLIPSIS_P. + +2000-11-17 Nathan Sidwell + + * typeck2.c (incomplete_type_error): Reorganize to avoid + excessive diagnostics. + +2000-11-16 Zack Weinberg + + * lex.c (struct impl_files, internal_filename): Constify a char *. + +2000-11-16 Mark Mitchell + + * mangle.c (write_special_name_constructor): Don't generate + assembler junk when confronted with an old-style constructor. + (write_special_name_destructor): Likewise. + (mangle_decl_string): Do it here instead. + +2000-11-16 Nathan Sidwell + + * call.c (op_error): Make error messages clearer. + +2000-11-15 Mark Mitchell + + * decl.c (wrapup_globals_for_namespace): Don't mark things + TREE_ASM_WRITTEN when they're not. + +2000-11-15 Jason Merrill + + * typeck2.c (friendly_abort): Uncount the error before handing + off to fancy_abort. + +2000-11-15 Nathan Sidwell + + * typeck.c (lookup_anon_field): Cope with qv qualifiers. + +2000-11-14 Mark Mitchell + + * class.c (build_vtbl_initializer): Fix typo in comment. + * typeck.c (expr_sizeof): Don't crash on errors. + +2000-11-14 Jim Wilson + + * lang-specs.h: Add %2 after %(cc1_options). + +2000-11-14 Richard Henderson + + * typeck.c (c_sizeof): Be strict about casting result value + back to c_size_type_node. + (expr_sizeof, c_sizeof_nowarn, c_alignof): Likewise. + +2000-11-13 Joseph S. Myers + + * typeck.c (build_unary_op): Use boolean_increment from + c-common.c, moving the relevant code there. + +2000-11-11 Jason Merrill + + * typeck.c (mark_addressable): Don't call put_var_into_stack. + + * decl.c (maybe_commonize_var): Set DECL_UNINLINABLE for statics + in inlines. + +2000-11-10 Kaveh R. Ghazi + + * decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy. + * lex.c (copy_lang_decl): Likewise. + +2000-11-09 Mark Mitchell + + * dump.c (cp_dump_tree): Don't dump function bodies here. + + * Make-lang.in (CXX_C_OBJS): Add c-dump.o. + (dump.o): Update dependency list. + * cp-tree.h (DECL_MAYBE_TEMPLATE): Remove. + (flag_dump_translation_unit): Likewise. + (CP_TYPE_QUALS): Adjust definition. + (DECL_C_BIT_FIELD): Remove. + (SET_DECL_C_BIT_FIELD): Likewise. + (CLEAR_DECL_C_BIT_FIELD): Likewise. + (add_maybe_template): Likewise. + (strip_array_types): Likewise. + (dump_node_to_file): Likewise. + (cp_dump_tree): New function. + * decl.c (init_decl_processing): Set lang_dump_tree. + * decl2.c (flag_dump_translation_unit): Remove. + * dump.c: Move most of it to ../c-dump.c. + (cp_dump_tree): New function. + * pt.c (add_maybe_template): Remove. + * typeck.c (strip_array_types): Likewise. + +2000-11-07 Eric Christopher + + * decl.c (init_decl_processing): Change definition of + __wchar_t to wchar_t. Remove artificial declaration of + wchar_t. + * lex.c: Change instances of __wchar_t to wchar_t. + +2000-11-09 Nathan Sidwell + + * lex.c (do_identifier): Don't lookup_name for operators. + * parse.y (operator): Save looking_for_typename. + (unoperator): Restore it. + * spew.c (frob_opname): Use nth_token for lookahead. + +2000-11-08 Nathan Sidwell + + * decl.c (grok_op_properties): Always use coerce_new_type and + coerce_delete_type. + * decl2.c (coerce_new_type): Use c_size_type_node. Preserve + exception specification. Tidy up. + (coerce_delete_type): Preserve exception specification. Tidy up. + +2000-11-07 Joseph S. Myers + + * class.c (duplicate_tag_error, build_vtbl_initializer), decl.c + (push_binding_level), error.c (cp_tree_printer), pt.c + (process_partial_specialization, tsubst_template_arg_vector), + search.c (lookup_member): Use memset () instead of bzero (). + +2000-11-07 Nathan Sidwell + + * decl.c (build_ptrmemfunc_type): Allow error_mark_node. + +2000-11-05 Joseph S. Myers + + * Make-lang.in (c++.distdir): Remove. + +2000-11-04 Mark Mitchell + + * decl2.c (do_nonmember_using_decl): Allow `extern "C"' + declarations from different namespaces to be combined. + +2000-11-03 Zack Weinberg + + * decl.c: Include tm_p.h. + +2000-11-03 Joseph S. Myers + + * tree.c (cp_tree_equal): Use memcmp () instead of bcmp (). + +2000-11-02 Joseph S. Myers + + * dump.c (dequeue_and_dump), lex.c (interface_strcmp), method.c + (build_overload_value), repo.c (open_repo_file), xref.c + (open_xref_file): Use strchr () and strrchr () instead of index () + and rindex (). + +2000-11-01 Bernd Schmidt + + * call.c (build_over_call): Call fold on the CALL_EXPR. + +2000-11-01 Gabriel Dos Reis + + * error.c (dump_template_decl): Separate template hearders with + space not comma. + +2000-10-31 Gabriel Dos Reis + + * error.c: Move TFF_ macros into cp-tree.h. Throughout, replace + TS_* flags with corresponding TFF_*. Adjust prototypes of + functions (which used to take a tree_string_flags) to take an int. + + * cp-tree.h (enum tree_string_flags): Remove + (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, + TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPEDEF, TFF_DECL_SPECIFIERS, + TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, + TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, + TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, + TFF_TEMPLATE_NAME, TFF_EXPR_IN_PARENS, TFF_SCOPE): New macros. + (type_as_string, decl_as_string, expr_as_string, + context_as_string): Adjust prototype. + + * class.c (dump_class_hierarchy_r): Use TFF_PLAIN_IDENTIFIER + instead of TS_PLAIN. + + * pt.c (mangle_class_name_for_template): Use TFF_CHASE_TYPEDEF + instead of TF_CHASE_TYPEDEFS. Use TFF_PLAIN_IDENTIFIER instead of + plain `0'. + +2000-10-30 Mark Mitchell + + * cp-tree.h (DECL_EXTERNAL_LINKAGE_P): New macro. + (linkage_kind): New enumeration. + (decl_linkage): New function. + * decl2.c (comdat_linkage): Extend comment. + * error.c (dump_function_decl): Print the arguments used to + instantiate a template, even when not printing the type of the + function. + * pt.c (convert_nontype_argument): Use DECL_EXTERNAL_LINKAGE_P, + not TREE_PUBLIC, to test for external linkage. + * tree.c (decl_linkage): New function. + +2000-10-28 Mark Mitchell + + * pt.c (instantiate_decl): Always instantiate static data members + initialized in-class. + +2000-10-27 Zack Weinberg + + * Make-lang.in: Move all build rules here from Makefile.in, + adapt to new context. Wrap all rules that change the current + directory in parentheses. Expunge all references to $(P). + When one command depends on another and they're run all at + once, use && to separate them, not ;. Add OUTPUT_OPTION to + all object-file generation rules. Delete obsolete variables. + + * Makefile.in: Delete. + * config-lang.in: Delete outputs= line. + +2000-10-26 Gabriel Dos Reis + + * error.c (dump_function_decl): Print no space between + `ptr-operator' the `type-specifier' of the return type. + (dump_type_prefix): Make sure we put space at the appropriate + place. + +2000-10-23 Jason Merrill + + * call.c (equal_functions): Also call decls_match for extern "C" fns. + +2000-10-22 Jason Merrill + + * call.c (build_conditional_expr): Use ocp_convert to force + rvalue conversion. + +2000-10-22 Mark Mitchell + + * call.c (standard_conversion): Use RVALUE_CONVs for all + expressions that satisfy lvalue_p, not just those that satisfy + real_lvalue_p. + + * optimize.c (copy_body_r): Don't treat CALL_EXPRs specially. + + * typeck.c (c_sizeof): Return an expression of `size_t' type, + not one with TYPE_IS_SIZETYPE set. + (dubious_conversion_warnings): Remove special-case code. + +2000-10-21 Geoffrey Keating + + * decl2.c (arg_assoc_type): Handle VECTOR_TYPE. + * error.c (dump_type): Handle VECTOR_TYPE like POINTER_TYPE. + (dump_type_prefix): Print vector-of-int as 'int vector'. + (dump_type_suffix): Handle VECTOR_TYPE like POINTER_TYPE. + * tree.c (walk_tree): Handle VECTOR_TYPE. + + * decl.c (init_decl_processing): Call MD_INIT_BUILTINS. + +2000-10-21 Jason Merrill + + * parse.y (operator): Set got_object from got_scope. + Set looking_for_typename. + * decl.c (lookup_name_real): Clear val after setting from_obj. + Reorganize diagnostic. + +2000-10-20 Jason Merrill + + * tree.c (walk_tree): Don't walk into default args. + + * error.c (dump_expr): Use host_integerp. + +2000-10-20 David Edelsohn + + * typeck2.c (abstract_virtuals_error): Use "because" instead of + "since" in error message. + +2000-10-20 Richard Kenner + + * typeck.c (dubious_conversion_warning): Suppress if TYPE_IS_SIZETYPE. + +2000-10-20 Jeffrey Oldham + + * decl.c (revert_static_member_fn): Fixed typo. + +2000-10-19 Mark Mitchell + + * class.c (subobject_offset_fn): New type. + (dfs_record_base_offsets): Remove. + (record_base_offsets): Likewise. + (dfs_search_base_offsets): Likewise. + (record_subobject_offset): New function. + (check_subobject_offset): Likewise. + (walk_subobject_offsets): Likewise. + (record_subobject_offsets): Likewise. + (layout_conflict_p): Reimplement. + (layout_nonempty_base_or_field): Correct handling of type + conflicts during layout. + (layout_empty_base): Likewise. + (build_base_field): Adjust to handle new representation of empty + base offset table. + (build_base_fields): Likewise. + (layout_virtual_bases): Likewise. + (splay_tree_compare_integer_csts): New function. + (layout_class_type): Use a splay_tree, rather than a varray, to + represent the offsets of empty bases. + + * cp-tree.h (DECL_ANTICIPATED): Don't require a FUNCTION_DECL. + * decl.c (select_decl): Don't return declarations that are + DECL_ANTICIPATED. + +2000-10-18 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_FAKE_STD. + (fake_std_node): New macro. + * decl.c (in_std): Rename to ... + (in_fake_std): ... this. + (flag_no_builtin): Remove. + (flag_no_nonansi_builtin): Likewise. + (walk_namespaces_r): Use fake_std_node. + (push_namespace): Use std_identifier. + (pop_namespace): Use in_fake_std. + (lookup_name_real): Use fake_std_node. + (init_decl_processing): When -fhonor-std, create the `std' + namespace. Don't create a dummy fake_std_node in that case. + Adjust call to c_common_nodes_and_builtins. Use std_identifier. + (builtin_function): Put builtins whose names don't begin + with `_' in the std namespace. + * decl2.c (flag_no_builtin): Remove. + (flag_no_nonansi_builtin): Likewise. + (set_decl_namespace): Use fake_std_node. + (validate_nonmember_using_decl): Likewise. + (do_using_directive): Likewise. + (handle_class_head): Likewise. + * dump.c (dequeue_and_dump): Likewise. + * except.c (init_exception_processing): Use std_identifier. + * init.c (build_member_call): Use fake_std_node. + * rtti.c (init_rtti_processing): Use std_identifier. + +2000-10-17 Mark Mitchell + + * cp-tree.h (back_end_hook): Remove declaration. + * decl2.c (back_end_hook): Remove definition. + + * dump.c (dequeue_and_dump): Dump TREE_USED. + +2000-10-17 Brad Lucier + + * spew.c (snarf_defarg): Cast 2nd arg to obstack_blank to (int). + +2000-10-17 Joseph S. Myers + + * decl.c (WINT_TYPE): Define. + (init_decl_processing): Create types unsigned_ptrdiff_type_node, + c_size_type_node, signed_size_type_node and wint_type_node. + +2000-10-17 Joseph S. Myers + + * decl2.c (warn_missing_format_attribute): New variable. + (lang_decode_option): Decode -Wmissing-format-attribute. + +2000-10-16 Mark Mitchell + + * typeck.c (qualify_type): Remove. + (composite_pointer_type): Fix handling of conversions to `cv void*'. + +2000-10-14 Kaveh R. Ghazi + + * Makefile.in (parse.c, parse.h): Fix think-o in last patch. + +2000-10-13 Kaveh R. Ghazi + + * Makefile.in (parse.c, parse.h): Create atomically. + +2000-10-12 Mark Mitchell + + * class.c (current_obstack): Remove. + * decl.c (ggc_p): Remove. + (start_decl): Don't use decl_tree_cons. + (grokdeclarator): Don't use build_decl_list. + (start_function): Don't use decl_tree_cons. + (finish_function): Don't mess with obstacks. + * decl2.c (grok_x_components): Don't use build_decl_list. + * lex.c (make_call_declarator): Don't call decl_tree_cons. + (implicitly_declare_fn): Don't call build_decl_list. + * parse.y (frob_specs): Don't call build_decl_list or + decl_tree_cons. + (expr_or_declarator_intern): Don't call decl_tree_cons. + (primary): Don't call build_decl_list. + (fcast_or_absdcl): Likewise. + (typed_declspecs): Don't call decl_tree_cons. + (reserved_declspecs): Don't call build_decl_list. + (declmods): Likewise. + (reserved_typespecquals): Likewise. + (aggr): Likewise. + (new_type_id): Likewise. + (cv_qualifiers): Likewise. + (after_type_declarator_intern): Likewise. + (notype_declarator_intern): Likewise. + (absdcl_intern): Likewise. + (named_parm): Likewise. + * pt.c (most_specialized_class): Likewise. + * repo.c (temporary_obstack): Make it a structure, not a pointer. + (init_repo): Initialize it. + * search.c (current_obstack): Remove. + * typeck2.c (add_exception_specifier): Don't call build_decl_list. + +2000-10-09 Richard Henderson + + * Make-lang.in (CXX_EXTRA_HEADERS): Remove. + (c++ language support bits for libgcc): Remove. + (c++.clean): Remove cplib2.txt cleanup. + * config-lang.in (headers, lib2funcs): Remove. + + * exception.cc, new.cc, new1.cc, new2.cc: Remove files. + * tinfo.cc, tinfo.h, tinfo2.cc, vec.cc: Remove files. + * inc/cxxabi.h, inc/exception, inc/new: Remove files. + * inc/new.h, inc/typeinfo: Remove files. + +2000-10-08 Joseph S. Myers + + * decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already + defined. + (init_decl_processing): Initialize intmax_type_node and + uintmax_type_node. + +2000-10-06 Richard Henderson + + * cp-tree.h (struct cp_language_function): Remove x_result_rtx. + (original_result_rtx): Remove. + * decl.c (save_function_data): Don't clear x_result_rtx. + (mark_lang_function): Don't mark it either. + * expr.c (fixup_result_decl): Remove. + * semantics.c (genrtl_named_return_value): Frob the return decl + before calling emit_local_var. + (genrtl_finish_function): Don't call fixup_result_decl. + Always emit the jump to return_label. + +2000-10-06 Nathan Sidwell + + * pt.c (lookup_template_class): Set current access for enum. + (tsubst_enum): Set file & line for enum decl. + + * spew.c (yylex): Remove unused variable. + +2000-10-05 Richard Henderson + + * semantics.c (genrtl_finish_function): Don't init or check + can_reach_end; remove noreturn and return value checks. + +2000-10-05 Tom Tromey + + * init.c (build_java_class_ref): Use `build_static_name' with a + suffix, not a prefix, to build the class object's name. + +2000-10-05 Nathan Sidwell + + * cp-tree.h (access_kind): Fix comment typo. + * decl2.c (grokfield): Fix diagnostic typo. + * semantics.c (finish_template_type): Fix comment typo. + (finish_qualified_object_call_expr): Likewise. + +2000-10-05 Nathan Sidwell + + * pt.c (tsubst_expr, DECL_STMT case): Don't process if + tsubsting fails. + +2000-10-05 Nathan Sidwell + + * spew.c (frob_id): New static function. + (frob_opname): Use it. + (yylex): Use it. + +2000-10-01 Mark Mitchell + + * decl.c (lang_mark_false_label_stack): Remove. + * lex.c (cp_mang_lang_type): Use ggc_alloc_cleared. + +2000-09-30 Joseph S. Myers + + * gxxint.texi: Use @email for formatting email addresses. + +2000-09-29 Gabriel Dos Reis + + * error.c: Remove direct obstack manipulation. Replace with + output_buffer-based formatting. Adjust calls to removed macros. + (obstack_chunk_alloc, obstack_chunk_free): Remove. + (OB_INIT, OB_PUTC, OB_PUTC2, OB_PUTS, OB_PUTID, OB_PUTCP, + OB_FINISH, OB_PUTI, OB_END_TEMPLATE): Likewise. + +2000-09-24 Mark Mitchell + + * ir.texi: Move to ../c-tree.texi. + +2000-09-20 Jason Merrill + + * decl2.c (get_guard): Check DECL_FUNCTION_SCOPE_P. + +2000-09-21 Andreas Jaeger + + * errfn.c: Move declaration of cp_printer and cp_printers to ... + * cp-tree.h: ... here. + + * error.c: Remove declaration of cp_printer. + +2000-09-20 Mark Mitchell + + * tree.c (mark_local_for_remap_r): Handle CASE_LABELs. + +2000-09-20 Hans-Peter Nilsson + + * except.c: Delete #if 0:d EXCEPTION_SECTION_ASM_OP-default and + users. + +2000-09-18 Mark Mitchell + + * decl.c (start_function): Robustify. + +2000-09-18 Kaveh R. Ghazi + + * cp-tree.h (check_function_format): Accept a `status' parameter. + + * call.c, typeck.c: Updates calls to `check_function_format'. + +2000-09-17 Geoffrey Keating + + * decl2.c (handle_class_head): Always push some scope even + in the error case. + +2000-09-16 Mark Mitchell + + * cp-tree.h (struct cp_language_function): Remove + x_scope_stmt_stack and name_declared. + (current_scope_stmt_stack): Remove. + (function_name_declared_p): New macro. + (struct lang_decl_flags): Use c_lang_decl as a base class. + (context): Remove. + (struct lang_decl): Replace saved_tree with context. + (DECL_FRIEND_CONTEXT): Adjust accordingly. + (SET_DECL_FRIEND_CONTEXT): Likewise. + (DECL_VIRTUAL_CONTEXT): Likewise. + (DECL_SAVED_TREE): Remove. + (C_DECLARED_LABEL_FLAG): Likewise. + (cplus_expand_expr_stmt): Don't declare. + (add_decl_stmt): Likewise. + (add_scope_stmt): Likewise. + * decl.c (mark_stmt_tree): Remove. + (case_compare): Likewise. + (finish_case_label): Use c_add_case_label. + (init_decl_processing): Set more language-specific hooks. + (build_enumerator): Fix typo in comment. + (cplus_expand_expr_stmt): Remove. + (mark_lang_function): Use mark_c_language_function. + (lang_mark_tree): Use c_mark_lang_decl. + * decl2.c: Change order of inclusion. + * except.c: Likewise. + * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall + back on c_expand_expr. + * friend.c: Include expr.h. + * init.c: Change order of inclusion. + * Makefile.in: Update dependencies. + * lex.h (free_lang_decl_chain): Remove. + * optimize.c (maybe_clone_body): Use function_name_declared_p. + * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if + it doesn't exist. + (instantiate_decl): Use function_name_declared_p. + * semantics.c (lang_expand_expr_stmt): Remove. + (set_current_function_name_declared): Likewise. + (current_function_name_declared): Likewise. + (begin_compound_stmt): Use function_name_declared_p. + (add_decl_stmt): Remove. + (setup_vtbl_ptr): Use function_name_declared_p. + (add_scope_stmt): Remove. + (current_scope_stmt_stack): New function. + (cp_expand_stmt): Don't handle SCOPE_STMTs. + (expand_body): Use function_name_declared_p. + * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. + * typeck.c: Change order of includes. + (convert_sequence): Remove. + +2000-09-14 Joseph S. Myers + + * lex.c (reswords): Add _Complex. + +2000-09-14 Richard Kenner + + * Make-lang.in (cplib2.txt): Depend on cp/Makefile. + +2000-09-13 J. David Anglin + + * init.c (begin_init_stmts): Don't use // comments. + +2000-09-12 Jason Merrill + + * decl.c (maybe_deduce_size_from_array_init): Set do_default for + all non-extern arrays. + + * decl.c (grokdeclarator): Complain about 'friend T' for implicit + typenames, too. Downgrade complaint to pedwarn. + (xref_tag): Warn about surprising behavior of 'friend struct T'. + * decl2.c (handle_class_head): Generate a TYPENAME_TYPE for + 'class This::Inherited'. + +2000-09-12 Mark Mitchell + + * decl.c (finish_case_label): Given the LABEL_DECL a + DECL_CONTEXT. + +2000-09-12 Gabriel Dos Reis + + * error.c (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, + TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPDEF, + TFF_DECL_SPECIFIERS, TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, + TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, + TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, TFF_SCOPE): + New macros. + (sorry_for_unsupported_tree, print_scope_operator, + print_left_paren, print_right_paren, print_left_bracket, + print_right_bracket, print_whitespace): Likewise. + (aggr_variety): Rename to class_key_or_enum. + (print_type): Rename to print_type_id. + (print_type_specifier_seq, print_simple_type_specifier, + print_elaborated_type_specifier, + print_rest_of_abstract_declarator, + print_parameter_declaration_clause, print_exception_specification, + print_nested_name_specifier, print_template_id, + typedef_original_name, print_template_argument_list_start, + print_template_argument_list_end): New functions. + +2000-09-11 Gabriel Dos Reis + + * ir.texi: Add more documentation. + +2000-09-11 Mark Mitchell + + * cp-tree.h (struct saved_scope): Remove x_function_parms. + (current_function_parms): Don't define. + (struct cp_language_function): Remove parms_stored. + (current_function_just_assigned_this): Don't define. + (current_function_parms_stored): Likewise. + (static_ctors): Declare. + (static_dtors): Likewise. + (SF_EXPAND): Don't define. + (expand_start_early_try_stmts): Remove declaration. + (store_parm_decls): Likewise. + * decl.c (static_ctors): Don't declare. + (static_dtors): Likewise. + (struct binding_level): Remove this_block. + (poplevel): Remove dead code. + (set_block): Likewise. + (mark_binding_level): Don't mark this_block. + (mark_saved_scope): Don't mark x_function_parms. + (init_decl_processing): Don't add current_function_parms as a GC + root. + (check_function_type): Change prototype. + (start_function): Remove RTL-generation code. + (expand_start_early_try_stmts): Remove. + (store_parm_decls): Give it internal linkage. Remove + RTL-generation code. + (finish_function): Remove RTL-generation code. + * decl2.c (static_ctors): Fix formatting. + (static_dtors): Likewise. + * method.c (use_thunk): Don't call store_parm_decls. + (synthesize_method): Likewise. + * optimize.c (maybe_clone_body): Likewise. + * parse.y (fn.def2): Likewise. + (.set_base_init): Likewise. + (nodecls): Likewise. + * pt.c (instantiate_decl): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + * semantics.c (genrtl_try_block): Simplify. + (expand_body): Use genrtl_start_function and + genrtl_finish_function. + (genrtl_start_function): New function. + (genrtl_finish_function): Likewise. + +2000-09-11 Nathan Sidwell + + * error.c (cp_tree_printer, case 'P'): Append break. + +2000-09-11 Nathan Sidwell + + * cp-tree.h (frob_opname): Declare. + * parse.y (saved_scopes): New static variable. + (cp_parse_init): Adjust. + (do_id): If lastiddecl is NULL, do do_identifier. + (operator): Save scope information. + (unoperator): New reduction. Restore scope information. + (operator_name): Append unoperator. Call frob_opname. + * spew.c (frob_opname): Define. + +2000-09-10 Zack Weinberg + + * decl.c, rtti.c: Include defaults.h if not already included. + Don't define the *_TYPE_SIZE macros. + +2000-09-09 Mark Mitchell + + * cp-tree.h (push_switch): Change prototype. + (check_cp_case_value): Remove declaration. + (decl_constant_value): Likewise. + * decl.c (struct cp_switch): Add switch_stmt and cases. + (case_compare): New function. + (push_switch): Set switch_stmt. Initialize cases. + (pop_switch): Clean up cases. + (define_case_label): Rename to ... + (finish_case_label): ... this. Do semantic analysis for case + labels here. + (start_function): Correct comment. + * decl2.c (check_cp_case_value): Remove. + * expr.c (do_case): Remove. + * pt.c (tsubst_expr): Adjust call to finish_case_label. + * semantics.c (genrtl_do_poplevel): Remove declaration. + (RECHAIN_STMTS): Remove. + (finish_break_stmt): Use build_break_stmt. + (finish_continue_stmt): Use build_continue_stmt. + (finish_switch_cond): Adjust condition here, rater than in + c_expand_start_case. + (finish_case_label): Remove. + * typeck.c (c_expand_return): Remove. + (c_expand_start_case): Likewise. + +2000-09-07 Gabriel Dos Reis + + * ir.texi: Document type nodes. + +2000-09-06 Mark Mitchell + + * cp-tree.h (init_cp_semantics): Declare. + (genrtl_try_block): Don't declare. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_named_return_value): Likewise. + * lex.c (init_parse): Call init_cp_semantics. + * semantics.c (genrtl_try_block): Give it internal linkage. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_named_return_value): Likewise. + (lang_expand_stmt): Rename to ... + (cp_expand_stmt): ... this. Only handle C++-specific nodes. + (init_cp_semantics): Define. + + * decl.c (initialize_local_var): Remove RTL-generating code. + * semantics.c (genrtl_try_block): Fix formatting. + + Move statement-tree facilities from C++ to C front-end. + * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. + (void_zero_node): Remove. + (stmt_tree): Likewise. + (scope_chain): Adjust. + (language_function): Rename to cp_language_function. + (cp_function_chain): Adjust. + (current_stmt_tree): Remove. + (last_tree): Likewise. + (last_expr_type): Likewise. + (struct lang_decl): Adjust. + (STMT_IS_FULL_EXPR_P): Remove. + (add_tree): Remove. + (begin_stmt_tree): Likewise. + (finish_stmt_tree): Likewise. + (walk_tree_fn): Likewise. + (walk_stmt_tree): Likewise. + * class.c (finish_struct): Replace use of add_tree with add_stmt. + * decl.c (mark_stmt_tree): Adjust type. + (init_decl_processing): Don't build void_zero_node. + (initialize_local_var): Adjust usage of current_stmt_tree. + (finish_enum): Use add_stmt, not add_tree. + (save_function_data): Adjust use of language_function. + (finish_constructor_body): Use add_stmt, not add_tree. + (finish_destructor_body): Likewise. + (push_cp_function_context): Adjust use of language_function. + (pop_cp_function_context): Likewise. + (mark_lang_function): Likewise. + (mark_cp_function_context): Likewise. + * init.c (build_aggr_init): Adjust use of current_stmt_tree. + (build_vec_init): Likewise. + * semantics.c (SET_LAST_STMT): Remove. + (RECHAIN_STMTS): Don't use it. + (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. + (current_stmt_tree): Define. + (add_tree): Remove. + (finish_goto_stmt): Use add_stmt, not add_tree. + (finish_expr_stmt): Likewise. + (begin_if_stmt): Likewise. + (finish_then_clause): Likewise. + (begin_while_stmt): Likewise. + (begin_do_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_break_stmt): Likewise. + (finish_continue_stmt): Likewise. + (begin_switch_stmt): Likewise. + (finish_case_label): Likewise. + (begin_try_block): Likewise. + (begin_function_try_block): Likewise. + (begin_handler): Likewise. + (begin_catch_block): Likewise. + (begin_compound_stmt): Likewise. + (begin_asm_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (add_decl_stmt): Likewise. + (finish_subobject): Likewise. + (finish_decl_cleanup): Likewise. + (finish_named_return_value): Likewise. + (setup_vtbl_ptr): Likewise. + (add_scope_stmt): Likewise. + (finish_stmt_expr): Likewise. + (prune_unused_decls): Remove. + (begin_stmt_tree): Likewise. + (finish_stmt_tree): Likewise. + (prep_stmt): Adjust use of current_stmt_tree. + (lang_expand_stmt): Likewise. + * tree.c (statement_code_p): Remove. + (cp_statement_code_p): New function. + (walk_stmt_tree): Remove. + (init_tree): Set lang_statement_code_p. + +2000-09-06 Zack Weinberg + + Integrated preprocessor. + + * Make-lang.in, Makefile.in: Remove all references to input.c, + gxx.gperf, and hash.h. Add ../c-lex.o to C_OBJS. + * gxx.gperf, hash.h, input.c: Delete. + * lang-specs.h: Pass -lang-c++ to cc1plus so cpplib is + initialized properly. + + * class.c (fixup_pending_inline): Take a tree, not a + struct pending_inline *. All callers changed. + (init_class_processing): Set RID_PUBLIC, RID_PRIVATE, + RID_PROTECTED entries in ridpointers[] array here. + * decl.c (duplicate_decls): Do not refer to struct + pending_inline. + (record_builtin_type, init_decl_processing): Use RID_MAX not + CP_RID_MAX. + (grokdeclarator): Use C_IS_RESERVED_WORD. + * decl2.c (lang_decode_option): Ignore -lang-c++ for sake of + cpplib. + (grok_x_components): Do not inspect pending_inlines chain. + + * cp-tree.h (struct lang_identifier): Add rid_code entry. + (C_IS_RESERVED_WORD, C_RID_CODE, C_RID_YYCODE): New. + (flag_no_gnu_keywords, flag_operator_names, rid_to_yy): Declare. + (DEFARG_LENGTH, struct pending_inline, TIME_IDENTIFIER_TIME, + TIME_IDENTIFIER_FILEINFO): Kill. + Update prototypes. + * lex.h: Expunge cp_rid. Rewrite RIDBIT macros to use just a + single 32-bit word. + * parse.y: Call do_pending_inlines unconditionally. + reinit_parse_for_method is now snarf_method. fn.defpen is no + longer necessary. Remove unnecessary annotation on + SCOPE. Do not refer to end_of_file or struct pending_inline. + * semantics.c (begin_inline_definitions): Call + do_pending_inlines unconditionally. + + * lex.c: Remove all code now shared with C front end. + Initialize cpplib properly if USE_CPPLIB. Put reserved words + into the get_identifier table. Rewrite pragma handling to + work with the registry. Move code to save tokens for later + processing to spew.c. + + * spew.c: Rewrite everything in terms of token streams instead + of text. Move routines here from lex.c / input.c as + appropriate. GC-mark trees hanging off the pending inlines + chain. + +2000-09-06 Mark Mitchell + + * NEWS: Mention that the named return value extension has been + deprecated. + * cp-tree.h (original_result_rtx): Define. + (TREE_REFERENCE_EXPR): Remove. + (DECL_VPARENT): Likewise. + (pushdecl_nonclass_level): Likewise. + (store_return_init): Likewise. + (reinit_lang_specific): Likewise. + (genrtl_named_return_value): Change prototype. + * decl.c (original_result_rtx): Remove. + (cp_finish_decl): Don't build DECL_STMTs for RESULT_DECLs. + Do not generate RTL for local variables here. + (store_return_init): Remove. + * semantics.c (genrtl_named_return_value): Simplify. Fold in + store_return_init. + (finish_named_return_value): Adjust accordingly. Warn that this + extension is deprecated. + (lang_expand_stmt): Adjust call to genrtl_named_return_value. + +2000-09-06 Nathan Sidwell + + * pt.c (type_unification_real): Replace switch with if. + (unify): Tsubst non-type parms before comparing. + +2000-09-06 Nathan Sidwell + + * error.c (dump_typename): New function, broken out of ... + (dump_type): ... here. Use it. + * typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE. + +2000-09-06 Nathan Sidwell + + * init.c (build_offset_ref): Deal with namespace scoped + TEMPLATE_ID_EXPRs. + +2000-09-06 Nathan Sidwell + + * class.c (resolve_address_of_overloaded_function): Add + explanation message. + * decl.c (define_case_label): Reformat explanation. + * decl2.c (finish_static_data_member_decl): Likewise. + (grokfield): Likewise. + * friend.c (do_friend): Likewise. + +2000-09-05 Zack Weinberg + + * tree.c (walk_tree): Expose tail recursion. + (walk_stmt_tree): New function. + * cp-tree.h: Prototype walk_stmt_tree. + * semantics.c (prune_unused_decls): Operate on SCOPE_STMTs not + the BLOCKs directly. If a BLOCK has no variables after + pruning, discard it. + (finish_stmt_tree): Use walk_stmt_tree. No need to save and + restore the line number. + +2000-09-05 Mark Mitchell + + * Makefile.in (CXX_TREE_H): Add dependency on HTAB_H. + (pt.o): Remove dependency on HTAB_H. + * cp-tree.h: Include hashtab.h. + (walk_tree): Change prototype. + (walk_tree_without_duplicates): New function. + * decl.c (check_default_argument): Use it. + * optimize.c (remap_decl): Adjust calls to walk_tree. + (copy_body): Likewise. + (expand_calls_inline): Likewise. + (calls_setjmp_p): Use walk_tree_without_duplicates. + * pt.c: Don't include hashtab.h. + (for_each_template_parm): Use walk_tree_without_duplicates. + * semantics.c (finish-stmt_tree): Likewise. + (expand_body): Likewise. + * tree.c (walk_tree): Add additional parameter. + (walk_tree_without_duplicates): New function. + (count_trees): Use it. + (verify_stmt_tree): Adjust call to walk_tree. + (find_tree): Use walk_tree_without_duplicates. + (no_linkage_check): Likewise. + (break_out_target_exprs): Adjust call to walk_tree. + (cp_unsave): Likewise. + +2000-09-04 Kriang Lerdsuwanakij + + * cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code. + (TEMPLATE_TEMPLATE_PARM): Adjust comment. + * cp-tree.h (TYPE_BINFO): Adjust comment. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. + (TEMPLATE_TYPE_PARM_INDEX): Likewise. + (IS_AGGR_TYPE): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. + (TYPE_TEMPLATE_INFO): Likewise. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Likewise. + * class.c (push_nested_class): Likewise. + * decl.c (lookup_name_real): Likewise. + (grokdeclarator): Likewise. + (grok_op_properties): Likewise. + (xref_tag): Likewise. + (xref_basetypes): Likewise. + * decl2.c (constructor_name_full): Likewise. + (arg_assoc_template_arg): Add TEMPLATE_TEMPLATE_PARM case. + (arg_assoc_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. + * error.c (dump_type): Split TEMPLATE_TEMPLATE_PARM case. + (dump_type_prefix): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (dump_type_suffix): Likewise. + * init.c (is_aggr_type): Use BOUND_TEMPLATE_TEMPLATE_PARM + instead. + (get_aggr_from_typedef): Likewise. + * mangle.c (write_type): Split TEMPLATE_TEMPLATE_PARM case. + (write_expression): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (write_template_parm): Likewise. + (write_template_template_parm): Check tree code instead of + using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + * method.c (build_overload_nested_name): Add + BOUND_TEMPLATE_TEMPLATE_PARM. + (process_overload_item): Split TEMPLATE_TEMPLATE_PARM case. + * parse.y (bad_parm): Add BOUND_TEMPLATE_TEMPLATE_PARM. + * pt.c (convert_template_argument): Check tree code instead of + using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + (for_each_template_parm_r): Split TEMPLATE_TEMPLATE_PARM case. + (for_each_template_parm): Adjust comment. + (tsubst): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. + (tsubst_copy): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (unify): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. Use + template_args_equal to compare template template parameter cases. + * ptree.c (print_lang_type): Add BOUND_TEMPLATE_TEMPLATE_PARM. + * search.c (lookup_field_1): Use BOUND_TEMPLATE_TEMPLATE_PARM + instead. + * tree.c (copy_template_template_parm): Decide whether to create + a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM node. + (walk_tree): Add BOUND_TEMPLATE_TEMPLATE_PARM. + (copy_tree_r): Likewise. + * typeck.c (comptypes): Likewise. Check tree code instead of + using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. + +2000-09-04 Mark Elbrecht + + * decl.c (finish_function): Move the code for handling functions + marked with the constructor and destructor attributes inside the + expand_p block. + +2000-09-04 Nathan Sidwell + + * init.c (resolve_offset_ref): Deal with TEMPLATE_ID_EXPR. + +2000-09-04 Nathan Sidwell + + * pt.c (lookup_template_class): Remove abort. + * tree.c (get_type_decl): Allow error_mark_node. + +2000-09-04 Nathan Sidwell + + * decl2.c (arg_assoc): Deal with COMPONENT_REFs inside + TEMPLATE_ID_EXPRs. + +2000-09-03 Mark Mitchell + + * operators.def (ALIGNOF_EXPR, MAX_EXPR, MIN_EXPR): Change + new ABI mangling. + +2000-09-01 Nathan Sidwell + + * parse.y (named_class_head): Check for TYPENAME_TYPE. Simplify + union tag mismatch error reporting. + +2000-09-01 Nathan Sidwell + + * call.c (build_scoped_method_call): Check it is not a namespace. + +2000-08-30 Jason Merrill + + * cp-tree.h (LOCAL_CLASS_P): Use decl_function_context. + + * tree.c (bot_manip): Check TREE_CONSTANT rather than + !TREE_SIDE_EFFECTS. Call break_out_target_exprs and + build_target_expr_with_type for the non-AGGR_INIT_EXPR case. + + * decl.c (start_function): Always call make_function_rtl. + +2000-08-29 Zack Weinberg + + * semantics.c (prune_unused_decls): New function. + (finish_stmt_tree): Call it via walk_tree. + +2000-08-29 Zack Weinberg + + * class.c (build_secondary_vtable): Constify a char *. + * decl.c (init_decl_processing): Initialize function_id_node, + pretty_function_id_node, and func_id_node. + * input.c (struct input_source): Constify 'str'. + (feed_input): Constify first argument. + * mangle.c (write_identifier): Constify argument. + * pt.c (mangle_class_name_for_template): Constify argument. + +2000-08-29 Mark Mitchell + + * typeck.c (mark_addressable): Remove code that pokes around in + RTL. + +2000-08-28 Jason Merrill + + * lex.c (file_name_nondirectory): Move to toplev.c. + + * cp-tree.h (LOCAL_CLASS_P): New macro. + * class.c (finish_struct_1): Use it. + +2000-08-27 Alex Samuel + + * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Remove unexplained voodoo. + (write_encoding): Pass another argument to write_name. + (write_name): Add ignore_local_scope parameter. Fix handling of + local names. + (write_nested_name): Use write_unqualified_name. + (write_prefix): Likewise. Skip out on FUNCTION_DECLs. + (write_template_prefix): Use write_unqualified_name. + (write_component): Remove. + (write_local_name): Add parameter. Use direct local entity to + discriminator calculation. + (write_class_enum_type): Pass another argument to write_name. + (write_template_template_arg): Likewise. + (make_guard_variable): Likewise. + +2000-08-27 Jason Merrill + + * decl.c (pushdecl): Matching decls for local externs are found in + the current level. Propagate linkage information from previous + declarations. + +2000-08-26 Gabriel Dos Reis + + * ir.texi (Expressions): Fix typo. + +2000-08-25 Greg McGary + + * tree.c (init_tree): Use ARRAY_SIZE. + +2000-08-25 Gabriel Dos Reis + + * error.c (cp_tree_printer): Rework. + +2000-08-25 Mark Mitchell + + * Make-lang.in (CXX_LIB2FUNCS): Remove cp-demangle.o and + dyn-string.o. + (CXX_LIB2SRCS): Remove cp-demangle.c and dyn-string.c. + (cp-demangle.o): Remove target. + (dyn-string.o): Likewise. + + * decl.c (grokfndecl): Require that `main' return an `int'. + * mangle.c (write_encoding): Don't mangle return types for + conversion functions. + +2000-08-25 Gabriel Dos Reis + + * error.c (tree_formatting_info): New data type. + (tree_being_formatted): New macro. + (tree_formatting_flags): Likewise. + (put_whitespace): Likewise. + (print_tree_identifier): Likewise. + (print_identifier): Likewise. + (cp_tree_printer, print_function_argument_list, print_declaration, + print_expression, print_function_declaration, + print_function_parameter, print_type, print_cv_qualifier): New + functions. + (init_error): Initialize lang_printer. + +2000-08-24 Jason Merrill + + * typeck.c (build_ptrmemfunc): Just reinterpret if there's no + adjustment necessary. + +2000-08-24 Greg McGary + + * cp-tree.h (MAIN_NAME_P): Remove macro. + +2000-08-24 Gabriel Dos Reis + + * error.c (print_instantiation_context): Don't forget to flush the + buffer. + +2000-08-23 Jason Merrill + + * typeck.c (build_ptrmemfunc): Save the input pmf. + + * method.c (process_modifiers): Use same_type_p. + +2000-08-23 Mark Mitchell + + * cp-tree.h (DECL_CLONED_FUNCTION_P): Check DECL_LANG_SPECIFIC. + * mangle.c (write_function_type): Change prototype. + (write_encoding): Don't mangle return types for + constructors or destructors. + (write_type): Adjust call to write_function_type. + * pt.c (instantiate_template): Instantiate alternate entry points + when instantiating the main function. + +2000-08-23 Gabriel Dos Reis + + * error.c (cp_print_error_function): Don't use embedded '\n' in + output_printf. + +2000-08-23 Gabriel Dos Reis + + * decl.c (init_decl_processing): Remove bogus initialization. + * error.c (lang_print_error_function): Restore here. + (init_error): Initialize print_error_function. + +2000-08-22 Theodore Papadopoulo + + * decl2.c (arg_assoc): Revert my 2000-08-11 change. + +2000-08-22 Gabriel Dos Reis + + * Makefile.in (error.o): Depends on diagnostic.h + + * cp-tree.h (problematic_instantiation_changed, + record_last_problematic_instantiation, current_instantiation, + print_instantiation_context): Declare. + (maybe_print_template_context): Remove. + + * decl.c (init_decl_processing): Set print_error_function to NULL. + (lang_print_error_function): Remove, since we're using a new + machinery. + + * error.c: #include diagnostic.h + (function_category): New function. + (cp_diagnostic_starter): Likewise. + (cp_diagnostic_finalizer): Likewise. + (cp_print_error_function): Likewise. + (maybe_print_instantiation_context): Likewise. + (print_instantiation_full_context): Likewise. + (print_instantiation_partial_context): Likewise. + (print_instantiation_context): Define. + (init_error): Initialize diagnostic pager and finalizer. + + * pt.c (problematic_instantiation_changed): Define. + (record_last_problematic_instantiation): Likewise. + (current_instantiation): Likewise. + (maybe_print_template_context): Remove. + (print_template_context): Likewise. + (current_tinst_level): Make static to reflect Brendan Kehoe's + change of 1995-04-13. + (push_tinst_level): Call print_instantiation_context. + +2000-08-21 Nix + + * lang-specs.h: Do not process -o or run the assembler if + -fsyntax-only. + +2000-08-21 Joseph S. Myers + + * decl.c (flag_hosted, flag_noniso_default_format_attributes): New + variables. + * decl2.c (lang_decode_option): Disable gettext attributes for + -ansi. + +2000-08-21 Gabriel Dos Reis + + * lex.c (lang_init_options): Default diagnostic message maximum + length to 80, when line-wrapping. + +2000-08-20 Mark Mitchell + + * class.c (build_vtbl_initializer): Clear the entire + vtbl_init_data. Start keeping track of the functions for which we + have created vcall offsets here. + (dfs_build_vcall_offset_vtbl_entries): Remove. + (build_vcall_offset_vtbl_entries): Reimplement. + (add_vcall_offset_vtbl_entries_r): New function. + (add_vcall_offset_vtbl_entries_1): Likewise. Tweak logic for + computing when vcall offsets are necessary. + +2000-08-18 Nathan Sidwell + + * decl.c (member_function_or_else): Use cp_error ... %T. + (grokdeclarator): Likewise. + (start_method): Likewise. + * friend.c (make_friend_class): Use cp_pedwarn ... %T. + +2000-08-18 Nathan Sidwell + + * decl2.c (grokfield): Set CLASSTYPE_GOT_SEMICOLON on class + TYPE_DECLs. + +2000-08-18 Nathan Sidwell + + * cp-tree.h (PTRMEM_OK_P): New macro. + (itf_ptrmem_ok): New enumeration value. + * class.c (resolve_address_of_overloaded_function): Add PTRMEM + argument. Diagnose implicit pointer to member. + (instantiate_type): Don't diagnose implicit pointer to member + here. Pass itf_ptrmem_ok if ok. Adjust calls to + resolve_address_of_overloaded_function. + * init.c (build_offset_ref): Set PTRMEM_OK_P. + (resolve_offset_ref): Don't diagnose implicit pointer to member here. + * semantics.c (finish_parenthesized_expr): Clear OFFSET_REFs here. + * typeck.c (build_x_unary_op): Calculate PTRMEM_OK_P. + (build_unary_op): Deal with single non-static member in + microsoft-land. + +2000-08-18 Nathan Sidwell + + * decl2.c (arg_assoc_type): Cope with TYPENAME_TYPE. + +2000-08-18 Nathan Sidwell + + * cp-tree.h (enum_name_string): Remove prototype. + (report_case_error): Remove prototype. + * cp/typeck2.c (enum_name_string): Remove. + (report_case_error): Remove. + * error.c (dump_expr): Deal with enum values directly. + Correctly negate integer constant. + +2000-08-17 Nathan Sidwell + + * inc/cxxabi.h (__cxa_vec_new2, __cxa_vec_new3): Declare. + (__cxa_vec_delete2, __cxa_vec_delete3): Declare. + * vec.cc (__cxa_vec_new2, __cxa_vec_new3): Implement. + (__cxa_vec_delete2, __cxa_vec_delete3): Implement. + (__cxa_vec_new): Use __cxa_vec_new2. + (__cxa_vec_delete): Use __cxa_vec_delete2. + +2000-08-17 Nathan Sidwell + + * vec.cc (__cxa_vec_new): Set "C" linkage. + (__cxa_vec_ctor): Likewise. + (__cxa_vec_cctor): Likewise. + (__cxa_vec_dtor): Likewise. + (__cxa_vec_delete): Likewise. + * inc/cxxabi.h (__cxa_vec_new): Set "C" linkage. + (__cxa_vec_ctor): Likewise. + (__cxa_vec_cctor): Likewise. + (__cxa_vec_dtor): Likewise. + (__cxa_vec_delete): Likewise. + +2000-08-17 Nathan Sidwell + + * class.c (instantiate_type): Reinstate local variable + deleted in previous change. + + * cvt.c (cp_convert_to_pointer): Pass itf_complain, not + itf_no_attributes. + +2000-08-17 Nathan Sidwell + + * cp-tree.h (instantiate_type_flags): New enumeration. + (instantiate_type): Change parameter. + * class.c (instantiate_type): Adjust prototype. Adjust. + * call.c (standard_conversion): Adjust instantiate_type call. + (reference_binding): Likewise. + (build_op_delete_call): Likewise. + (convert_like_real): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_reference): Likewise. + * pt.c (convert_nontype_argument): Likewise. + * typeck.c (build_binary_op): Likewise. + (build_ptrmemfunc): Likewise. + (convert_for_assignment): Likewise. + +2000-08-17 Nathan Sidwell + + * cp-tree.h (CPTR_AGGR_TAG): New global tree node. + (current_aggr): Define. + * decl.c (grokdeclarator): Make sure a friend class is an + elaborated type specifier. + * parse.y (current_aggr): Remove static definition. + (cp_parse_init): Adjust. + (structsp): Clear and restore current_aggr. + (component_decl_list): Clear current_aggr. + + * error.c (dump_type, case TYPENAME_TYPE): Don't emit the + aggregate tag on the typename's context. + + * pt.c (tsubst_friend_class): Return error_mark_node, if + parms becomes NULL. + (instantiate_class_template): Ignore error_mark_node friend types. + +2000-08-14 Nathan Sidwell + + * cvt.c (warn_ref_binding): New static function, broken out of ... + (convert_to_reference): ... here. Use it. + +2000-08-11 Kriang Lerdsuwanakij + + * parse.y (template_arg): Add rule for template qualified with + global scope. + +2000-08-11 Theodore Papadopoulo + + * decl2.c (add_function): Reorganize. + (arg_assoc): Do not consider function template decls. + +2000-08-11 Jason Merrill + + * decl.c (lookup_name_real): Don't forget the TYPENAME_TYPE we're + looking inside. + +2000-08-11 Nathan Sidwell + + * cp-tree.h (resolve_scope_to_name): Remove unused prototype. + (lookup_nested_tag): Likewise. + + * decl2.c (grokfield): Fix comment to reflect many types of _DECLs + can be produced. + +2000-08-11 Nathan Sidwell + + * parse.y (named_complex_class_head_sans_basetype): Remove + always true if. + +2000-08-11 Nathan Sidwell + + * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Build + explicit TEMPLATE_ID_EXPR args. + (build_expr_from_tree, case CALL_EXPR): Likewise. + +2000-08-11 Nathan Sidwell + + * decl.c (check_tag_decl): Diagnose typename's which don't + declare anything. + +2000-08-10 Nathan Sidwell + + * init.c (build_aggr_init): Reject bogus array initializers + early. + +2000-08-09 Nathan Sidwell + + * rtti.c (build_dynamic_cast_1): Set "C" linkage for new abi + runtime. + * cp/tinfo.cc (__dynamic_cast): Likewise. + * cp/inc/cxxabi.h (__dynamic_cast): Likewise. + +2000-08-09 Nathan Sidwell + + * cvt.c (convert_to_pointer_force): Fix error message when + attempting to cast from ambiguous base. + +2000-08-08 Jason Merrill + + * pt.c (tsubst_aggr_type): Bail if creating the argvec fails. + (tsubst_template_arg_vector): Likewise. + + * decl2.c (build_anon_union_vars): Choose the largest field; don't + assume that one will be as large as the union. + +2000-08-07 Kazu Hirata + + * cp-tree.h (CLASSTYPE_HAS_PRIMARY_BASE_P): Fix a comment typo. + * decl.c (pop_labels): Likewise. + +2000-08-04 Jeffrey Oldham + + * inc/cxxabi.h (__pbase_type_info): Changed member names to match + specifications. + (__pointer_to_member_type_info): Likewise. + (__base_class_info): Likewise. + (__class_type_info): Likewise. + (__si_class_type_info): Likewise. + (__vmi_class_type_info): Likewise. + * tinfo.cc (__si_class_type_info::__do_find_public_src): + Changed member names to match specifications. + (__vmi_class_type_info::__do_find_public_src): Likewise. + (__si_class_type_info::__do_dyncast): Likewise. + (__vmi_class_type_info::__do_dyncast): Likewise. + (__si_class_type_info::__do_upcast): Likewise. + (__vmi_class_type_info::__do_upcast): Likewise. + * tinfo2.cc (__pbase_type_info::__do_catch): Likewise. + (__pbase_type_info::__pointer_catch): Likewise. + (__pointer_type_info::__pointer_catch): Likewise. + (__pointer_to_member_type_info::__pointer_catch): Likewise. + +2000-08-04 Zack Weinberg + + * Make-lang.in (cc1plus): Depend on $(BACKEND), not stamp-objlist. + * Makefile.in: Add C_OBJS, BACKEND; delete OBJS, OBJDEPS. + (cc1plus): Link with $(BACKEND) and $(C_OBJS). + +2000-08-04 Mark Mitchell + + * cp-tree.h (add_method): Change prototype. + * class.c (add_method): Remove FIELDS parameter. Add ERROR_P. + Don't double the size of the method vector in the error case. + (handle_using_decl): Adjust call to add_method. + (add_implicitly_declared_members): Likewise. + (clone_function_decl): Likewise. + * decl2.c (check_classfn): Likewise. + * semantics.c (finish_member_declaration): Likewise. + +2000-08-04 Joseph S. Myers + + * decl.c (flag_isoc94): New variable. + +2000-08-02 Jason Merrill + + * pt.c (do_type_instantiation): Add complain parm; don't complain + if called recursively. + * cp-tree.h, parse.y: Adjust. + +2000-08-02 Zack Weinberg + + * decl2.c: Silently ignore -Wstrict-prototypes; warn about + -Wno-strict-prototypes. + + * g++spec.c: Adjust type of second argument to + lang_specific_driver, and update code as necessary. + + * cp-tree.h: Don't prototype min_precision here. + (my_friendly_assert): Cast expression to void. + * semantics.c (do_poplevel): Initialize scope_stmts. + +2000-08-02 Mark Mitchell + + * cp-tree.h (DECL_NEEDED_P): Tweak. + +2000-07-28 Jason Merrill + + * lang-specs.h: Use %i in rule for .ii files. + +2000-07-31 Zack Weinberg + + * lang-specs.h: Rename cpp to cpp0 and/or tradcpp to tradcpp0. + +2000-07-30 Mark Mitchell + + Allow indirect primary bases. + * cp-tree.h (struct lang_type): Remove vfield_parent. Add + primary_base. + (CLASSTYPE_VFIELD_PARENT): Remove. + (CLASSTYPE_PRIMARY_BINFO): Reimplement. + (BINFO_PRIMARY_BINFO): Remove. + (CLASSTYPE_HAS_PRIMARY_BASE_P): Reimplement. + (BINFO_VBASE_PRIMARY_P): Likewise. + (BINFO_PRIMARY_BASE_OF): New macro. + (BINFO_INDIRECT_PRIMARY_P): Likewise. + (get_primary_binfo): New function. + * decl.c (lang_mark_tree): Make lang_type::primary_base. + * class.c (vcall_offset_data_s): Rename to ... + (vtbl_init_data_s): ... this. Rename primary_p to primary_vtbl_p, + and add ctor_vtbl_p. + (get_derived_offset): Use get_primary_binfo. + (dfs_mark_primary_bases): Adjust handling of virtual primary + bases. + (mark_primary_bases): Likewise. + (set_primary_base): Take a binfo, not an integer, as a + representation of the primary base. + (indirect_primary_base_p): Remove. + (determine_primary_base): Adjust for indirect primary bases. + (dfs_find_final_overrider): Fix typo in coment. + (update_vtable_entry_for_fn): Use get_primary_binfo. + (layout_nonempty_base_or_field): Tweak. + (build_base_fields): Adjust for new primary base semantics. + (dfs_propagate_binfo_offsets): Remove. + (propagate_binfo_offsets): Rewrite. + (dfs_set_offset_for_shared_vbases): Remove. + (layout_virtual_bases): Don't use it. + (layout_class_type): Set CLASSTYPE_SIZE correctly under the new + ABI. + (finish_struct_1): Set CLASSTYPE_PRIMARY_BINFO, not + CLASSTYPE_VFIELD_PARENT. + (dfs_get_primary_binfo): New function. + (get_primary_binfo): Likewise. + (dump_class_hierarchy_r): Tweak printing of primary bases. + (build_vtbl_initializer): Fix typo in comments. Use + vtbl_init_data. + (build_vcall_and_vbase_vtbl_entries): Likewise. + (build_vbaes_offset_vtbl_entries): Likewise. + (dfs_build_vcall_offset_vtbl_entries): Adjust setting of + BV_VCALL_INDEX to handle indirect primary bases. + (build_vcall_offset_vtbl_entries): Use vtbl_init_data. + (build_rtti_vtbl_entries): Likewise. + * search.c (get_shared_vbase_if_not_primary): Tweak. + (find_vbase_instance): Likewise. + (binfo_for_vtable): Simplify. + * tree.c (unshare_base_binfos): Clear BINFO_PRIMARY_BASE_OF. + (make_binfo): Make it have 11 entries. + +2000-07-30 Alex Samuel + + * mangle.c (DECL_TEMPLATE_ID_P): Remove. + (CLASSTYEP_TEMPLATE_ID_P): Check template info, and context when + ascertaining primaryness. + (G): Remove template_args. + (decl_is_template_id): New function. + (write_encoding): Use decl_is_template_id. + (write_name): Likewise. Handle type_decls. Get main variant of + type decls. + (write_nested_name): Likewise. + (write_prefix): Likewise. + (write_template_prefix): Likewise. + (write_special_name_constructor): Remove defunct production from + comment. + (write_bare_function_type): Remove comment about absent parameter. + (write_template_template_arg): Add missing grammar production to + comment. + +2000-07-27 Jason Merrill + + * decl.c (duplicate_decls): If common_type produces a non-typedef + type for a typedef, just use the old type. + +2000-07-27 Mark Mitchell + + * cp-tree.h (function_depth): Declare. + (verify_stmt_tree): Likewise. + (find_tree): Likewise. + * decl.c (function_depth): Give it external linkage. + * optimize.c (optimize_function): Increment and decrement it. + * tree.c (verify_stmt_tree_r): New function. + (verify_stmt_tree): Likewise. + (find_tree_r): Likewise. + (find_tree): Likewise. + +2000-07-27 Jason Merrill + + * pt.c (for_each_template_parm_r, case RECORD_TYPE): Use + TYPE_PTRMEMFUNC_P. + * cp-tree.h (TYPE_TEMPLATE_INFO): Check for TYPE_LANG_SPECIFIC. + +2000-07-26 Mark Mitchell + + * decl.c (start_cleanup_fn): Mark the function as `inline'. + * decl2.c (get_guard): Call cp_finish_decl, not + rest_of_decl_compilation, for local guards. + * lex.c (do_identifier): Remove unused variable. + +2000-07-26 Marc Espie + + * parse.y: Add missing ';'. + +2000-07-26 Mark Mitchell + + * parse.y (empty_parms): Use `()', not `(...)', when in the scope + of `extern "C++"'. + +2000-07-25 Nathan Sidwell + + Kill strict_prototype. Backwards compatibility only for + non NO_IMPLICIT_EXTERN_C systems. + * cp-tree.h (flag_strict_prototype): Remove. + (strict_prototype): Remove. + (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. + * decl.c (maybe_push_to_top_level): Adjust. + (pop_from_top_level): Adjust. + (decls_match): Only allow sloppy parm matching for ancient + system headers. + (init_decl_processing): Adjust. + (grokdeclarator): Adjust. + * decl2.c (flag_strict_prototype): Remove. + (strict_prototype): Remove. + (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. + (lang_f_options): Remove "strict-prototype". + (unsupported-options): Add "strict-prototype". + * lex.c (do_identifier): Adjust. + (do_scoped_id): Adjust. + * parse.y (empty_parms): Adjust. + * class.c (push_lang_context): Adjust. + (pop_lang_context): Adjust. + * typeck.c (comp_target_parms): Adjust. + +2000-07-25 Nathan Sidwell + + * decl.c (poplevel): Deal with anonymous variables at for scope. + (maybe_inject_for_scope_var): Likewise. + +2000-07-25 Zack Weinberg + + * decl.c: Remove all signal handling code, now done in toplev.c. + +2000-07-23 Mark Mitchell + + * decl.c (make_rtl_for_nonlocal_decl): Rework. + + * pt.c (lookup_template_class): Ensure that TYPE_CONTEXT is set + correctly. + +2000-07-20 Zack Weinberg + + * cp-tree.h: Use __FUNCTION__ not __PRETTY_FUNCTION__. + Define my_friendly_assert and my_friendly_abort as macros + which may call friendly_abort. Prototype friendly abort, not + my_friendly_abort or my_friendly_assert. + * decl.c (signal_catch): Report the signal caught in the error + message. Call fatal directly. + * typeck2.c (ack, my_friendly_assert): Delete. + (my_friendly_abort): Rename to friendly_abort. Expect file, + line, and function parameters. Report the abort code, then + call fancy_abort. Do not mask an abort if errors have + already occurred. + +2000-07-18 Nathan Sidwell + + * typeck.c (comp_target_parms): Remove obsolete parameter. + (comp_target_types): Adjust. + +2000-07-17 Jason Merrill + + * typeck.c (mark_addressable): Never set TREE_USED. + * call.c (build_call): Don't abort on calls to library functions + that have been declared normally. + + * typeck.c (build_binary_op): Fix grammar in warning. + + * exception.cc (__eh_free): Fix prototype. + + * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR. + + * decl.c (pushdecl): Handle seeing an OVERLOAD in + IDENTIFIER_NAMESPACE_VALUE. + +2000-07-16 Mark Mitchell + + * cp-tree.h (THUNK_VCALL_OFFSET): Update documentation. + * method.c (use_thunk): Correct handling of vcall offsets. + +2000-07-14 Zack Weinberg + + * .cvsignore: parse.h and parse.c have no cp- prefix. + +2000-07-13 Mark Mitchell + + * .cvsignore: New file. + +2000-07-13 Zack Weinberg + + * lang-specs.h: Use the new named specs. Remove unnecessary braces. + +2000-07-12 Mark Mitchell + + * Makefile.in ($(PARSE_H)): Depend directly on parse.y. + * parse.c: Remove. + * parse.h: Likewise. + +2000-07-11 Mark Mitchell + + * class.c (layout_class_type): Add pointers to virtual bases after + base classes under the old ABI. + +2000-07-10 Benjamin Chelf + + * semantics.c (finish_for_stmt): Remove call to emit_line_note. + (finish_continue_stmt): Likewise. + (begin_for_stmt): Remove call to note_level_for_for. + (finish_goto_stmt): Change call from build_min_nt + to build_stmt. + (finish_expr_stmt): Likewise. + (begin_if_stmt): Likewise. + (begin_while_stmt): Likewise. + (finish_while_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_for_stmt): Likewise. + (finish_break_stmt): Likewise. + (begin_switch_stmt): Likewise. + (finish_case_label): Likewise. + (genrtl_try_block): Likewise. + (begin_try_block): Likewise. + (begin_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (add_decl_stmt): Likewise. + (finish_subobject): Likewise. + (finish_decl_cleanup): Likewise. + (finish_named_return_value): Likewise. + (setup_vtbl_ptr): Likewise. + (add_scope_stmt): Likewise. + * decl.c (finish_constructor_body): Likewise. + (finish_destructor_body): Likewise. + * optimize.c (copy_body_r): Likewise. + (initialize_inlined_parameters): Likewise. + (declare_return_variable): Likewise. + (expand_call_inline): Likewise. + +2000-07-10 Jakub Jelinek + + * semantics.c (expand_body): Sync interface information + at the end of function body expansion. + +2000-07-09 Jason Merrill + + * init.c (build_new_1): Bail early if the call to new fails. + + * decl.c (compute_array_index_type): Check specifically for + an INTEGER_CST, not just TREE_CONSTANT. + + * decl.c (duplicate_decls): Don't call duplicate_decls on + the DECL_TEMPLATE_RESULT. + (decls_match): Return 0 if the DECL_TEMPLATE_RESULTs have different + codes. + + * error.c (dump_template_bindings): Don't crash if we had an + invalid argument list. + + * typeck.c (c_expand_start_case): Do narrowing here. + * semantics.c (finish_switch_cond): Not here. + +2000-07-09 Hidvegi Zoli + + * parse.y (asm_clobbers): Do string concatenation. + +2000-07-09 Mark Mitchell + + * decl.c (pushtag): Don't put local classes in template functions + on the local_classes list. + +2000-07-04 Scott Snyder + + * decl2.c (get_guard): Add missing return for old ABI local + variable case. + +2000-07-09 Mark Mitchell + + * cp-tree.h (char_type_p): New function. + * decl.c (init_decl_processing): Don't initialize + signed_wchar_type_node or unsigned_wchar_type_node. + (complete_array_type): Handle brace-enclosed string-constants. + * rtti.c (emit_support_tinfos): Remove #if 0'd code. + * tree.c (char_type_p): New function. + * typeck2.c (digest_init): Use char_type_p. + +2000-07-06 Nathan Sidwell + + * pt.c (tsubst): Don't layout type, if it's error_mark. + +2000-07-06 Nathan Sidwell + + * pt.c (instantiate_pending_templates): Reset template level. + +2000-07-05 Jason Merrill + + * call.c (joust): Don't complain about `operator char *()' beating + `operator const char *() const'. + +2000-07-04 scott snyder + Jason Merrill + + * repo.c (repo_get_id): Handle the case where a class with virtual + bases has a null TYPE_BINFO_VTABLE. + +2000-07-04 Kevin Buhr + Jason Merrill + + * parse.y (member_init): Just pass in the type. + * init.c (expand_member_init): Handle getting a type. + +2000-07-04 Martin v. Löwis + Jason Merrill + + * decl.c (finish_function): Warn if a function has no return + statement. + Suggested by Andrew Koenig. + * typeck.c (check_return_expr): Do set current_function_returns_value + if we got an error_mark_node. + +2000-07-03 Nathan Sidwell + + * decl2.c (push_decl_namespace): Push the original namespace. + +2000-07-03 Nathan Sidwell + + * pt.c (instantiate_class_template): Set CLASSTYPE_VBASECLASSES. + * semantics.c (begin_class_definition): Clear it. + +2000-07-02 Benjamin Chelf + + * cp-tree.h (genrtl_goto_stmt): Remove declaration. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + + * init.c (begin_init_stmts): Remove call to + genrtl_begin_compound_stmt. + (finish_init_stmts): Remove call to genrtl_finish_compound_stmt. + + * semantics.c (lang_expand_stmt): Changed call to + genrtl_compound_stmt to ignore return value. + +2000-07-02 Mark Mitchell + + * mangle.c (canonicalize_for_substitution): Return the canonical + variant of a type. + + * decl.c (duplicate_decls): Preserve DECL_ORIGINAL_TYPE for a + TYPE_DECL. + * typeck.c (commonparms): Remove obstack manipulations. + +2000-07-01 Benjamin Chelf + + * Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. + + * Makefile.in (OBJS): Added ../c-semantics.o. + (OBJDEPS): Likewise. + + * cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to + ../c-common.h. + (struct stmt_tree): Added comment. + (current_function_name_declared): Removed. + (stmts_are_full_exprs_p): Likewise. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. + (DECL_ANON_UNION_ELEMS): Likewise. + (emit_local_var): Likewise. + (make_rtl_for_local_static): Likewise. + (do_case): Likewise. + (expand_stmt): Likewise. + (genrtl_decl_cleanup): Likewise. + (c_expand_asm_operands): Likewise. + (c_expand_return): Likewise. + (c_expand_start_case): Likewise. + + * decl.c (make_rtl_for_local_static): Moved to c-semantics.c. + (emit_local_var): Likewise. + (initialize_local_var): Change reference to + stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). + Change reference to stmts_are_full_exprs_p to + current_stmt_tree->stmts_are_full_exprs_p. + (push_cp_function_context): Likewise. + + * expect.c (expand_throw): Change reference to + stmts_are_full_exprs_p. + + * init.c (build_aggr_init): Change reference to + stmts_are_full_exprs_p. + (build_vec_init): Likewise. + + * optimize.c (maybe_clone_body): Change reference to + current_function_name_declared to + cp_function_chain->name_declared. + + * pt.c (instantiate_decl): Change reference to + current_function_name_declared to + cp_function_chain->name_declared. + + * semantics.c (expand_cond): Moved declaration to c-common.h. + (genrtl_do_pushlevel): Moved to c-semantics.c. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (gerntl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_decl_cleanup): Likewise. + (expand_cond): Likewise. + (expand_stmt): Renamed to ... + (lang_expand_stmt): ... this. + (lang_expand_expr_stmt): Initialize. + (set_current_function_name_declared): Likewise. + (stmts_are_full_exprs_p): Likewise. + (current_function_name_declared): Likewise. + (anon_aggr_type_p): Likewise. + (do_poplevel): Change reference to + stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). + Change reference to stmts_are_full_exprs_p to + current_stmt_tree->stmts_are_full_exprs_p. + (add_tree): Likewise. + (finish_expr_stmt): Likewise. + (prep_stmt): Likewise. + (lang_expand_stmt): Likewise. + (begin_compound_stmt): Change reference to + current_function_name_declared to + cp_function_chain->name_declared and call to + current_function_name_declared(). + (setup_vtbl_ptr): Likewise. + (genrtl_do_poplevel): Removed. + +2000-06-30 Jason Merrill + + * init.c (init_init_processing): Go back to aligning like + double_type_node for old ABI. + (get_cookie_size): Make cookie larger if we get a type that needs + more alignment. + (build_vec_delete): Call it. + + * typeck.c (qualify_type_recursive): New fn. + (composite_pointer_type): Use it. + (build_binary_op): Use composite_pointer_type. + +2000-06-24 Carlos O'Ryan + Jason Merrill + + * typeck.c (check_return_expr): Don't complain about returning + NULL from operator new if -fcheck-new. + * cp-tree.h: Declare flag_check_new here. + * init.c: Not here. + +2000-06-28 Alex Samuel + + * mangle.c (find_substitution): Use same_type_p. + (write_encoding): Don't check for substitutions. + +2000-06-30 Nathan Sidwell + + * parse.y (expr_no_comma_rangle): New non-terminal. + (template_parm): Use it for default parameter case. + (template_arg): Use it. + (expr_no_commas): Remove commented out undefined extensions. + * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. + * parse.h, parse.c: Rebuilt. + +2000-06-30 Mark Mitchell + + * semantics.c (genrtl_asm_stmt): Don't decay input operands here. + (finish_asm_stmt): Do it here, instead. + + * cp-tree.h (ridpointers): Don't declare. + * decl.c (record_builtin_type): Use CP_RID_MAX instead of RID_MAX. + (record_builtin_java_type): Likewise. + (init_decl_processing): Likewise. + * lex.c: Move inclusion of lex.h. + (ridpointers): Don't define. + (init_parse): Initialize ripdointers. Use CP_RID_MAX instead of + RID_MAX. + * lex.h (enum rid): Rename to ... + (enum cp_rid): ... this. + (ridpointers): Don't declare. + * parse.y: Move inclusion of lex.h. + * parse.c: Regenerated. + * spew.c: Move inclusion of lex.h. + + * cp-tree.h (struct language_function): Remove temp_name_counter. + (temp_name_counter): Remove. + (get_temp_name): Change prototype. + (get_guard): New function. + (get_guard_cond): Likewise. + (set_guard): Likewise. + * cvt.c (build_up_reference): Adjust call to get_temp_name. + * decl.c (expand_static_init): Use get_guard and friends to + implement guard variables. + * decl2.c (get_temp_name): Assume that the variables created are + always static. + (get_sentry): Rename to ... + (get_guard): ... this. Implement new ABI guard variables. + (get_guard_bits): New function. + (get_guard_cond): Likewise. + (set_guard): Likewise. + (start_static_initialization_or_destruction): Use them. + (do_static_initialization): Replace sentry with guard throughout. + (do_static_destruction): Likewise. + * init.c (create_temporary_var): Add comment. + +2000-06-28 Alex Samuel + + * mangle.c (find_substitution): Use same_type_p. + (write_encoding): Don't check for substitutions. + +2000-06-30 Nathan Sidwell + + * parse.y (expr_no_comma_rangle): New non-terminal. + (template_parm): Use it for default parameter case. + (template_arg): Use it. + (expr_no_commas): Remove commented out undefined extensions. + * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. + * parse.h, parse.c: Rebuilt. + +2000-06-29 Mark Mitchell + + * cp-tree.h (flag_const_strings): Remove. + (warn_parentheses): Likewise. + (warn_format): Likewise. + (common_type): Likewise. + (default_conversion): Likewise. + (build_binary_op): Likewise. + (cp_build_binary_op): New macro. + * call.c (build_new_op): Use cp_build_binary_op instead of + build_binary_op. + * class.c (build_vtable_entry_ref): Likewise. + * decl.c (expand_static_init): Likewise. + (compute_array_index_type): Likewise. + (build_enumerator): Likewise. + * decl2.c (delete_sanity): Likewise. + (start_static_initialization_or_destruction): Likewise. + * error.c (dump_type_suffix): Likewise. + * init.c (resolve_offset_ref): Likewise. + (build_new): Likewise. + (build_new_1): Likewise. + (build_vec_delete_1): Likewise. + (build_vec_init): Likewise. + (build_delete): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + (synthesize_tinfo_var): Likewise. + * search.c (expand_upcast_fixups): Likewise. + (fixup_all_virtual_upcast_offsets): Likewise. + * typeck.c (build_array_ref): Likewise. + (get_member_function_from_ptrfunc): Likewise. + (build_binary_op): Add parameter. + (pointer_int_sum): Use cp_build_binary_op. + (pointer_diff): Likewise. + (build_modify_expr): Likewise. + (get_delta_difference): Likewise. + (build_ptrmemfunc): Likewise. + +2000-06-29 Nathan Sidwell + + * cp-tree.h (SET_DECL_ARTIFICIAL): Remove. + * decl.c (create_implicit_typedef): Adjust. + * decl2.c (build_artificial_parm): Adjust. + * method.c (implicitly_declare_fn): Adjust. + * pt.c (push_inline_template_parms_recursive): Adjust. + (process_template_parm): Adjust. + (overloaded_template_name): Adjust. + * semantics.c (finish_template_template_parm): Adjust. + +2000-06-28 Mark Mitchell + + * cp-tree.h (CLEAR_BINFO_NEW_VTABLE_MARKED): Remove. + * class.c (update_vtable_entry_for_fn): Correct logic for deciding + where to emit thunks. + (build_vtt): Adjust call to build_vtt_inits. + (build_vtt_inits): Add parameter to indicate whether or not + sub-VTTs for virtual bases should be included. Adjust handling of + construction vtables. + (get_matching_base): New function. + (dfs_build_vtt_inits): Rename to ... + (dfs_build_secondary_vptr_vtt_inits): Adjust handling of + construction vtables. + (dfs_fixup_binfo_vtbls): Likewise. + (build_ctor_vtbl_groups): Build construction vtables for virtual + bases, too. + (accumulate_vtbl_inits): Tweak logic for deciding whether or not + to build construction vtbls. + (dfs_accumulate_vtbl_inits): Adjust handling of + construction vtables. + + * pt.c (tsubst, case TEMPLATE_TEMPLATE_PARM): Handle cv-qualified + types correctly. + +2000-06-27 Mark Mitchell + + * decl.c (grokfndecl): Set DECL_CONTEXT for static functions too. + +2000-06-26 Nathan Sidwell + + * search.c (hides): Remove. + (is_subobject_of_p): Add most_derived parameter. Use + CANONICAL_BINFO. + (lookup_field_queue_p): Adjust. + (lookup_field_r): Adjust. + +2000-06-26 Nathan Sidwell + + * decl2.c (handle_class_head): Bash typedefs to the type's main + decl. + +2000-06-25 Mark Mitchell + + * cp-tree.h (genrtl_begin_stmt_expr): Rename to ... + (begin_global_stmt_expr): ... this. + (genrtl_finish_stmt_expr): Rename to ... + (finish_global_stmt_expr): ... this. + * init.c (begin_init_stmts): Adjust calls. + (finish_init_stmts): Likewise. + * semantics.c (genrtl_begin_stmt_expr): Rename to ... + (begin_global_stmt_expr): ... this. + (genrtl_finish_stmt_expr): Rename to ... + (finish_global_stmt_expr): ... this. + +2000-06-25 Theodore Papadopoulo + + * search.c (lookup_member): Fix typo in comment. + +2000-06-24 Jason Merrill + + * decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace. + (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL. + +2000-06-24 Martin v. Löwis + + * parse.y (complex_direct_notype_declarator): Support global_scope. + * Makefile.in: Adjust conflict count. + +2000-06-23 Kriang Lerdsuwanakij + + * parse.y (template_arg): Convert TEMPLATE_DECL + that is a template template parameter to + TEMPLATE_TEMPLATE_PARM here. + + * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Adjust comment. + * cp-tree.h (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): New macro. + (copy_template_template_parm): Adjust prototype. + * decl.c (grokdeclarator): Remove dead code. + * pt.c (process_template_parm): Tidy. + (lookup_template_class): Construct nodes in + copy_template_template_parm. + (tsubst): Pass TEMPLATE_DECL rather than IDENTIFIER_NODE to + lookup_template_class. Use TYPE_TI_TEMPLATE. + * tree.c (copy_template_template_parm): Add NEWARGS + parameter. + (mapcar): Adjust call to copy_template_template_parm. + * typeck.c (comptypes): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL. + * method.c (build_template_template_parm_names): Change error + code to avoid compilation warning. + + * gxxint.texi: Document template template parameter + name mangling. + +2000-06-21 Alex Samuel + + * Make-lang.in (CXX_LIB2FUNCS): Add cp-demangle.o and dyn-string.o. + (CXX_LIB2SRCS): Add cp-demangle.c and dyn-string.c. + (cp-demangle.o): New rule. + (dyn-string.o): Likewise. + * inc/cxxabi.h (__cxa_demangle): New declaration. + +2000-06-22 Mark Mitchell + + * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. + (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. + (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset + a tree, not an int. + (THUNK_GENERATE_WITH_VTABLE_P): New macro. + (make_thunk): Change prototype. + (emit_thunk): Rename to use_thunk. + (mangle_thunk): Change prototype. + * class.c (get_derived_offset): Simplify. + (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and + BV_GENERATE_THUNK_WITH_VTABLE_P. + (build_primary_vtable): Simplify. + (add_virtual_function): Use BV_FN, rather than TREE_VALUE. + (dfs_find_base): Remove. + (update_vtable_entry_for_fn): Correct bug in finding the base + where a virtual function was first declared. Figure out whether + or not to emit a vcall-thunk with the vtables in which it appears. + Correct logic for deciding whether to use an ordinary thunk, or a + vcall thunk. + (finish_struct_1): Remove unnecssary code. + (build_vtbl_initializer): Use ssize_int for the running counter of + negative indices. + (build_vtbl_initializer): Only use vcall thunks where necessary. + Mark thunks as needing to be emitted with their vtables, or not. + (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in + indices. Use size_binop. + (dfs_build_vcall_offset_vtbl_entries): Don't rely on + BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use + size_binop. + (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. + (build_vtable_entry): Mark thunks as needing to be emitted with + their vtables, or not. + * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. + * decl2.c (mark_vtable_entries): Use use_thunk instead of + emit_thunk. + * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk + information. + * error.c (dump_expr): Use BV_FN. + * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, + not an int. + * method.c (make_thunk): Likewise. + (emit_thunk): Rename to use_thunk. Allow callers to decide + whether or not to actually emit the thunk. Adjust for changes in + representation of vcall offsets. + * search.c (dfs_get_pure_virtuals): Use BV_FN. + * semantics.c (emit_associated_thunks): New function. + (expand_body): Use it. + * ir.texi: Adjust descriptions of thunks. + +2000-06-22 Jason Merrill + + * pt.c (tsubst_decl, case FUNCTION_DECL): Clear DECL_SAVED_TREE. + (tsubst_friend_function): Copy it here. + + * decl.c (grok_op_properties): Fix typo. + + * decl2.c (delete_sanity): Clarify warning, avoid failure on + deleting void*. + + * pt.c (check_explicit_specialization): Clarify error. + + * decl.c (pushdecl): Also pull out one of the FUNCTION_DECLs from + an old OVERLOAD when we're declaring a non-function. + (pushdecl, destroy_local_var): Check for error_mark_node. + (warn_extern_redeclared_static): Also bail early if + we're a CONST_DECL. + (push_overloaded_decl): Ignore an old error_mark_node. + +2000-06-22 Nathan Sidwell + + * call.c (build_x_va_arg): Check if in a template decl. + * pt.c (tsubst_copy, case VA_ARG_EXPR): Use build_x_va_arg. + +2000-06-20 Alexandre Petit-Bianco + + * class.c (push_lang_context): TYPE_NAME gets you to the Java + types DECLs. + * decl.c (check_goto): Computed gotos assumed OK. + +2000-06-20 Jason Merrill + + * pt.c (tsubst_decl, case TYPE_DECL): Fix test for TYPE_DECLs + for which we don't need to look for instantiations. + +2000-06-21 Nathan Sidwell + + * parse.y (program): Always call finish_translation_unit. + * parse.c, parse.h: Rebuilt. + +2000-06-20 Zack Weinberg + + * method.c: Don't include hard-reg-set.h. + +2000-06-20 Nathan Sidwell + + * rtti.c (get_base_offset): Cope when vbase field is in a base. + +2000-06-20 Nathan Sidwell + + * call.c (build_conditional_expr): Use VOID_TYPE_P. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_void): Likewise. + * error.c (dump_expr): Likewise. + * except.c (complete_ptr_ref_or_void_ptr_p): Likewise. + * init.c (build_delete): Likewise. + * method.c (emit_thunk): Likewise. + * optmize.c (declare_return_variable): Likewise. + * rtti.c (get_tinfo_decl_dynamic): Likewise. + (get_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + * typeck.c (composite_pointer_type): Likewise. + (common_type): Likewise. + (build_indirect_ref): Likewise. + (build_binary_op): Likewise. + (build_x_compound_expr): Likewise. + (check_return_expr): Likewise. + * typeck2.c (add_exception_specifier): Likewise. + + * mangle.c (write_method_parms): Use direct comparison for end + of parmlist. + +2000-06-19 Benjamin Chelf + + * cp-tree.h (genrtl_try_block): Declare function. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_decl_cleanup): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_named_return_value): Likewise. + (genrtl_begin_stmt_expr): Likewise. + (genrtl_finish_stmt_expr): Likewise. + (finish_for_stmt): Removed first argument. + (finish_switch_stmt): Likewise. + + * semantics.c (genrtl_try_block): Define function. + (genrtl_handler): Likewise. + (genrtl_catch_block): Likewise. + (genrtl_ctor_stmt): Likewise. + (genrtl_subobject): Likewise. + (genrtl_decl_cleanup): Likewise. + (genrtl_do_poplevel): Likewise. + (genrtl_do_pushlevel): Likewise. + (genrtl_clear_out_block): Likewise. + (genrtl_goto_stmt): Likewise. + (genrtl_expr_stmt): Likewise. + (genrtl_decl_stmt): Likewise. + (genrtl_if_stmt): Likewise. + (genrtl_while_stmt): Likewise. + (genrtl_do_stmt): Likewise. + (genrtl_return_stmt): Likewise. + (genrtl_for_stmt): Likewise. + (genrtl_break_stmt): Likewise. + (genrtl_continue_stmt): Likewise. + (genrtl_scope_stmt): Likewise. + (genrtl_switch_stmt): Likewise. + (genrtl_case_label): Likewise. + (genrtl_begin_compound_stmt): Likewise. + (genrtl_finish_compound_stmt): Likewise. + (genrtl_compound_stmt): Likewise. + (genrtl_asm_stmt): Likewise. + (genrtl_named_return_value): Likewise. + (genrtl_begin_stmt_expr): Likewise. + (genrtl_finish_stmt_expr): Likewise. + (finish_for_stmt): Removed first argument and generate rtl + specific code. + (finish_switch_stmt): Likewise. + (do_poplevel): Removed generate rtl specific code. + (do_pushlevel): Likewise. + (add_tree): Likewise. + (finish_goto_stmt): Likewise. + (finish_expr_stmt): Likewise. + (begin_if_stmt): Likewise. + (finish_if_stmt_cond): Likewise. + (finish_then_clause): Likewise. + (begin_else_clause): Likewise. + (finish_else_clause): Likewise. + (finish_if_stmt): Likewise. + (clear_out_block): Likewise. + (begin_while_stmt): Likewise. + (finish_while_stmt_cond): Likewise. + (finish_while_stmt): Likewise. + (begin_do_stmt): Likewise. + (finish_do_body): Likewise. + (finish_do_stmt): Likewise. + (finish_return_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_for_init_stmt): Likewise. + (finish_for_cond): Likewise. + (finish_for_expr): Likewise. + (finish_break_stmt): Likewise. + (finish_continue_stmt): Likewise. + (begin_switch_stmt): Likewise. + (finish_switch_cond): Likewise. + (finish_case_label): Likewise. + (begin_try_block): Likewise. + (begin_function_try_block): Likewise. + (finish_try_block): Likewise. + (finish_cleanup_try_block): Likewise. + (finish_cleanup): Likewise. + (finish_function_try_block): Likewise. + (finish_handler_sequence): Likewise. + (finish_function_handler_sequence): Likewise. + (begin_handler): Likewise. + (finish_handler_parms): Likewise. + (begin_catch_block): Likewise. + (finish_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_compound_stmt): Likewise. + (finish_asm_stmt): Likewise. + (finish_label_stmt): Likewise. + (finish_label_decl): Likewise. + (finish_subobject): Likewise. + (finish_decl_cleanup): Likewise. + (finish_named_return_value): Likewise. + (begin_stmt_expr): Likewise. + (finish_stmt_expr): Likewise. + + * decl.c (initialize_local_var): Changed call to finish_expr_stmt + to call genrtl_expr_stmt when appropriate. + + * init.c (begin_init_stmts): Changed calls to begin_stmt_expr and + begin_compound_expr to call genrtl_begin_stmt_expr and + genrtl_begin_compound_expr when appropriate. + (finish_init_stmts): Changed calls to finish_compound_expr and + finish_stmt_expr to call genrtl_finish_compound_expr and + genrtl_finish_stmt_expr when appropriate. + (expand_default_init): Changed call to finish_expr_stmt to call + genrtl_expr_stmt when appropriate. + (build_vec_init): Likewise. + + * parse.y (simple_stmt): Removed first argument from call to + finish_for_stmt. Removed first argument from call to + finish_switch_stmt. + + * parse.c: Regenerated. + + * pt.c (tsubst_expr): Removed first argument from call to + finish_for_stmt. Removed first argument from call to + finish_switch_stmt. + +2000-06-16 Benjamin Chelf + + * cp-tree.h (enum cplus_tree_code): Changed __DUMMY to + CP_DUMMY_TREE_CODE. Remove #include "c-common.def". + + * lex.c (cplus_tree_code_type[]): Removed #include "c-common.def". + (cplus_tree_code_length[]): Likewise. + (cplus_tree_code_name[]): Likewise. + (init_parse): Added call to add_c_tree_codes. Changed + LAST_AND_UNUSED_TREE_CODE to LAST_C_TREE_CODE. + +2000-06-16 Mark Mitchell + + * cp-tree.h (finish_mem_initializers): Declare. + (count_trees): Likewise. + * parse.y (base_init): Use finish_mem_initializers. + * semantics.c (finish_mem_initializers): New function. + + * tree.c (count_trees_r): Prototype. Use DATA parameter to store + the number of trees. + (n_trees): Remove. + (count_trees): Don't use it. + +2000-06-15 Jason Merrill + + * tree.c (count_trees): New debugging function. + + * typeck.c (build_x_function_call): Use DECL_FUNCTION_TEMPLATE_P. + * init.c (build_member_call): Pull out the name of a DECL. + + * Makefile.in (semantics.o, pt.o): Depend on TIMEVAR_H. + * semantics.c (expand_body): Push to TV_INTEGRATION here. + * optimize.c (optimize_function): Not here. + * pt.c (instantiate_decl): Push to TV_PARSE. + +2000-06-15 Mark Mitchell + + * cp-tree.h (struct language_function): Remove x_base_init_list + and x_member_init_list. + (current_base_init_list): Remove. + (current_member_init_list): Likewise. + (setup_vtbl_ptr): Change prototype. + (emit_base_init): Likewise. + (expand_member_init): Likewise. + (reinit_parse_for_function): Remove. + * decl.c (save_function_data): Don't clear x_base_init_list and + x_member_init_list. + (mark_language_function): Don't mark them. + * init.c (perform_member_init): Tweak comment. + (sort_member_init): Take the list of initializers as an argument. + (sort_base_init): Likewise. + (emit_base_init): Likewise. + (expand_member_init): Return the initializer. Don't use global + variables. + * lex.c (reinit_parse_for_function): Remove. + * method.c (build_template_parm_names): Correct substitution. + (do_build_copy_constructor): Don't use current_member_init_list + and current_base_init_list. + (synthesize_method): Likewise. + * parse.y (base_init): Split mem-initializers into + base-initializers and field-initializers. + (member_init_list): Build up the list here. + (member_init): Return the initializer. + (fn.depfn): Don't use reinit_parse_for_function. + * parse.c: Regenerated. + * pt.c (convert_nontype_argument): Don't make an ADDR_EXPR of the + ERROR_MARK. + (tsubst_expr): Don't use current_member_init_list + and current_base_init_list. + (tsubst_expr_values): Rename to ... + (tsubst_initializer_list): ... this. Use convert_from_reference. + * semantics.c (setup_vtbl_ptr): Don't use current_member_init_list + and current_base_init_list. + (begin_function_definition): Don't call reinit_parse_for_function. + + * dump.c (dequeue_and_dump): Use TREE_VEC_LENGTH with vectors. + + * error.c (dump_expr): Handle ADDR_EXPRs with REFERENCE_TYPE + correctly. + + * cp-tree.h (DECL_PENDING_INLINE_P): Relax checking. + +2000-06-14 Benjamin Chelf + + * cp-tree.h (IF_COND): Move to c-common.h. + (THEN_CLAUSE): Likewise. + (ELSE_CLAUSE): Likewise. + (WHILE_COND): Likewise. + (WHILE_BODY): Likewise. + (DO_COND): Likewise. + (DO_BODY): Likewise. + (RETURN_EXPR): Likewise. + (EXPR_STMT_EXPR): Likewise. + (FOR_INIT_STMT): Likewise. + (FOR_COND): Likewise. + (FOR_EXPR): Likewise. + (FOR_BODY): Likewise. + (SWITCH_COND): Likewise. + (SWITCH_BODY): Likewise. + (CASE_LOW): Likewise. + (CASE_HIGH): Likewise. + (GOTO_DESTINATION): Likewise. + (COMPOUND_BODY): Likewise. + (ASM_CV_QUAL): Likewise. + (ASM_STRING): Likewise. + (ASM_OUTPUTS): Likewise. + (ASM_INPUTS): Likewise. + (ASM_CLOBBERS): Likewise. + (DECL_STMT_DECL): Likewise. + (STMT_EXPR_STMT): Likewise. + (LABEL_STMT_LABEL): Likewise. + (SCOPE_BEGIN_P): Likewise. + (SCOPE_END_P): Likewise. + (SCOPE_STMT_BLOCK): Likewise. + (SCOPE_NULLIFIED_P): Likewise. + (SCOPE_NO_CLEANUPS_P): Likewise. + (SCOPE_PARTIAL_P): Likewise. + (ASM_VOLATILE_P): Likewise. + (STMT_LINENO): Likewise. + (STMT_LINENO_FOR_FN_P): Likewise. + + * cp-tree.def: Removed SRCLOC, SIZEOF_EXPR, ARROW_EXPR, + ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, + FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, + CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, + SCOPE_STMT, CASE_LABEL, STMT_EXPR. + + * Makefile.in (CXX_TREE_H): Added $(srcdir)/../c-common.def. + + * Make-lang.in (CXX_SRCS): Added $(srcdir)/c-common.def. + (cc1plus$(exeext)): Added $(srcdir)/c-common.def. + + * lex.c (cplus_tree_code_type[]): Added '#include "c-common.def"'. + (cplus_tree_code_length[]): Added '#include "c-common.def"'. + (cplus_tree_code_name[]): Added '#include "c-common.def"'. + +2000-06-14 Mark Mitchell + + * cp-tree.h (BINFO_OVERRIDE_ALONG_VIRTUAL_PATH): New macro. + * class.c (dfs_find_final_overrider): Set it appropriately. + (dfs_built_vtt_inits): Check BINFO_OVERRIDE_ALONG_VIRTUAL_PATH to + avoid unneeded secondary vptrs. + +2000-06-13 Jakub Jelinek + + * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. + (check_bitfield_decl, check_field_decl): Likewise. + (build_vtbl_or_vbase_field, build_base_field): Likewise. + (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. + * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. + (xfer_tag, finish_enum): Likewise. + * decl2.c (finish_builtin_type): Likewise. + * init.c (init_init_processing): Likewise. + * pt.c (instantiate_class_template): Likewise. + * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. + * cp-tree.h (struct lang_type): Add user_align member. + (CLASSTYPE_USER_ALIGN): Define. + +2000-06-13 Maciej W. Rozycki + + * Make-lang.in (c++.install-common): Install g++-cross in + $(gcc_tooldir)/bin as g++ and c++; g++ in $(bindir) as + $(target_alias)-g++ and $(target_alias)-c++. + +2000-06-12 Mark Mitchell + + * class.c (vcall_offset_data_s): Add last_init and fns. + (overrides): Rename to same_signature_p. + (dfs_find_final_overrider): Adjust accordingly. + (mark_overriders): Likewise. + (warn_hidden): Likewise. + (build_vtbl_initializer): Reorganize machinery for building things + at negative offsets. + (build_vcall_and_vbase_vtbl_entries): Likewise. + (build_vbase_offset_vtbl_entries): Likewise. + (dfs_build_vcall_offset_vtbl_entries): Correct order of vcall + offset entries. Do not create two entries for functions with the + same signature. + (build_vcall_offset_vtbl_entries): Initialize vod->fns. + (build_rtti_vtbl_entries): Reorganize machinery for building things + at negative offsets. + + * optimize.c (expand_call_inline): Don't recurse into the code + used to initialize the parameters more than once. + +2000-06-11 Mark Mitchell + + * mangle.c (NESTED_TEMPLATE_MATCH): Fix typo in comment. + (is_std_substitution): Don't check CLASSTYPE_USE_TEMPLATE here. + (find_substitution): Only use the `Sa' substitution for + std::allocator, not instantiations of it. + (write_template_prefix): Move comment. Only use a TREE_LIST to + represent substitutions for a member template. + (write_array_type): Mangle array dimensions correctly. + * optimize.c (maybe_clone_body): Copy more information from the + cloned function. + * pt.c (regenerate_decl_from_template): Preserve DECL_USE_TEMPLATE + on the regenerated declaration. + +2000-06-11 Chip Salzenberg + Mark Mitchell + + * class.c (build_vtable): Clarify comment. + (build_ctor_vtbl_group): Pass the most derived type to + build_vtable. + +2000-06-11 Kaveh R. Ghazi + + * decl2.c (compare_options): Don't needlessly cast away const-ness. + +2000-06-10 Mark Mitchell + + * decl.c (add_binding): Handle duplicate declarations of external + variables. + +2000-06-09 Chip Salzenberg + Mark Mitchell + + * mangle.c (write_number): Take an unsigned HOST_WIDE_INT as an + argument. + (write_signed_number): New macro. + (write_unsigned_number): Likewise. + (write_source_name): Use them. + (write_number): Handle signed and unsigned values. + (write_integer_cst): Use tree_int_cst_sgn, and use + write_unsigned_number or write_signed_number as appropriate. + (write_discriminator): Use write_unsigned_number or + write_signed_number as appropriate. + (write_template_arg_literal): Likewise. + (write_array_type): Use tree_low_cst. + (write_template_parm): Use write_unsigned_number or + write_signed_number as appropriate. + (write_substitution): Adjust call to write_number. + (write_type): Get the TYPE_MAIN_VARIANT before mangling it. + (write_expression): Handle non-type template arguments of + reference type correctly. + (mangle_thunk): Use write_signed_number. + +2000-06-09 Chip Salzenberg + + * mangle.c (find_substition): Don't mangle objects with typename + substitutions (e.g. "cin" as "Si"). + +2000-06-09 Zack Weinberg + + * call.c (add_candidate): Use ggc_alloc_cleared. + * decl.c (lookup_label): Likewise. + * lex.c (retrofit_lang_decl): Likewise. + +2000-06-09 Jason Merrill + + * semantics.c (expand_body): Push to TV_EXPAND. + * optimize.c (optimize_function): Push to TV_INTEGRATION. + * decl.c (start_function): Always call announce_function. + + * tinfo2.cc: Just declare abort. + +2000-06-09 Gabriel Dos Reis + + * lex.c (DEF_OPERATOR): Say `operator@' -not- `operator @' + whenever @ is a symbolic name. + +2000-06-08 Jakub Jelinek + + * method.c (make_thunk): Clear DECL_VTT_PARM in thunk. + +2000-06-07 Mark Mitchell + + * decl.c (pushdecl): Look up functions by DECL_NAME, not + DECL_ASSEMBLER_NAME. + +2000-06-06 Mark Mitchell + + * decl2.c (c_language): Define. + +2000-06-06 Gabriel Dos Reis + + * lex.c (lang_init_options): Tweak. + + * decl2.c: Remove #inclusion of diagnostic.h + (lang_decode_option): Move diagnostic formatting options to + toplevel. + + * lang-options.h: Remove documentation for diagnostic options. + + * Makefile.in (lex.o): Depends upon diagnostic.h + +2000-06-06 Mark Mitchell + + * decl.c (redeclaration_error_message): If two TEMPLATE_DECLs have + the same DECL_RESULT, it's not a redefinition. + * pt.c (tsubst_decl): Remove code to handle illegal + specializations. + +2000-06-06 Nathan Sidwell + + * exception.cc: (__eh_alloc, __eh_free): Moved to libgcc2.c + +2000-06-05 Jason Merrill + + * search.c (maybe_suppress_debug_info): Don't check + CLASSTYPE_INTERFACE_ONLY if CLASSTYPE_INTERFACE_KNOWN isn't set. + + * pt.c (mark_decl_instantiated): Do SET_DECL_EXPLICIT_INSTANTIATION + here if extern_p. + + Remember instantiation context in deferred instantiations. + * cp-tree.h (struct tinst_level): Remove. + (TINST_DECL, TINST_LINE, TINST_FILE): New macros. + * pt.c (current_tinst_level): Now a tree. + (print_template_context, push_tinst_level, pop_tinst_level, + tinst_for_decl): Adjust. + (reopen_tinst_level): New fn. + (init_pt): Register current_tinst_level as a root. + (add_pending_template): Put current_tinst_level in TREE_PURPOSE + of the pending templates list. + (instantiate_pending_templates): Adjust. Call reopen_tinst_level. + * lex.c (extract_interface_info): Adjust. + * decl2.c (warn_if_unknown_interface): Adjust. + +2000-06-05 Mark Mitchell + + * class.c (indirect_primary_base_p): New function. + (determine_primary_base): Use it. + +2000-06-05 Nathan Sidwell + + Update new-abi dynamic cast algorithm. + * tinfo.cc (__class_type_info::__dyncast_result): Add + whole_details. Adjust constructor. + (__vmi_class_type_info::__do_dyncast): Adjust for vmi_flags. + Avoid unnecessary searching. + (__dynamic_cast): Adjust for __dyncast_result::whole_details. + +2000-06-05 Richard Kenner + + * decl.c (init_decl_processing): Don't call record_component_aliases. + * tree.c (build_cplus_array_type_1): Likewise. + +2000-06-04 Mark Mitchell + + * ir.texi: Correct typo. + * mangle.c (write_expression): Handle non-type template arguments + with reference type. + * method.c (build_overload_value): Likewise. + * pt.c (convert_nontype_argument): Explicitly represent conversion + to a reference with an ADDR_EXPR. + (unify): Always unify arguments in left-to-right order. + +2000-06-03 Alex Samuel + Mark Mitchell + + * Make-lang.in (CXX_SRCS): Add mangle.c. + * Makefile.in (CXX_OBJS): Add mangle.o. + (mangle.o): New rule. + + * class.c (local_classes): New variable. + * class.c (get_vtable_name): Use mangle_vtable_for_type for new ABI. + (get_vtt_name): Use mangle_vtt_name for new ABI. + (init_class_processing): Initialize local_classes. + (build_ctor_vtbl_group): Use mangle_ctor_vtbl_for_type for new ABI. + * cp-tree.h (cp_tree_index): Add CPTI_STD_IDENTIFIER. + (std_identifier): New macro. + (DECL_VOLATILE_MEMFUNC_P): New macro. + (DECL_NAMESPACE_STD_P): Likewise. + (local_classes): Declare. + (get_mostly_instantiated_function_type): Declare. + (init_mangle): Declare. + (mangle_decl): Likewise. + (mangle_type_string): Likewise. + (mangle_type): Likewise. + (mangle_typeinfo_for_type): Likewise. + (mangle_typeinfo_string_for_type): Likewise. + (mangle_vtbl_for_type): Likewise. + (mangle_vtt_for_type): Likewise. + (mangle_ctor_vtbl_for_type): Likewise. + (mangle_thunk): Likewise. + (mangle_conv_op_name_for_type): Likewise. + (mangle_guard_variable): Likewise. + * decl.c (pushtag): Keep track of local classes. + (initialize_predefined_identifiers): Initialize std_identifier. + (init_decl_processing): Use std_identifier. + (start_decl): Don't treat instantiations as specializations. + (grokdeclarator): Likewise. + (grokvardecl): Call mangle_decl for new ABI. Only set mangled + name for fully-instantiated templates. + * decl2.c (grokclassfn): Use set_mangled_name_for_decl for + destructors with the new ABI. + (finish_static_data_member_decl): Use mangle_decl under the new ABI. + (grokfield): Use mangle_type for new ABI. + (grokoptypename): Use mangle_conv_op_for_type for new ABI. + (get_sentry): Use mangle_guard_variable for new ABI. + (start_static_initialization_or_destruction): Likewise. + * expr.c (extract_aggr_init): Remove. + (extract_scalar_init): Likewise. + (extract_init): Remove #if 0'd code. + * mangle.c: New function. + * method.c (build_mangled_name): Assert not flag_new_abi. + (build_static_name): Likewise. + (build_decl_overload_real): Likewise. + (build_typename_overload): Likewise. + (build_overload_with_type): Likewise. + (build_overload_name): Likewise. + (get_ctor_vtbl_name): Likewise. + (start_squangling): Likewise. + (get_id_2): Likewise. + (set_mangled_name_for_decl): Call mangle_decl for new ABI. + (init_method): Call init_mangle for new ABI. + (make_thunk): Call mangle_thunk for new ABI. + * operators.def: Correct new ABI manglings for the `%' operator. + Add `::' operator. + * pt.c (build_template_decl): Copy DECL_OVERLOADED_OPERATOR_P and + DECL_ASSIGNMENT_OPERATOR_P to the TEMPLATE_DECL. + (lookup_template_class): Call mangle_decl for new ABI. + (get_mostly_instantiated_function_type): New function. + (set_mangled_name_for_template_decl): Use it. + (tsubst_decl): Use set_mangled_name_for_decl for destructors with + the new ABI. Use mangle_conv_op_name_for_type for instantiated + conversion op names. + * rtti.c (tinfo_name): Call mangle_type_string for new ABI. + (get_tinfo_decl): Call mangle_typeinfo_for_type for new ABI. + (tinfo_base_init): Likewise. Mangle typeinfo string name with + mangle_typeinfo_string_for_type. + +2000-06-03 Mark Mitchell + + * cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment. + (INNERMOST_TEMPLATE_ARGS): New macro. + (innermost_args): Remove. + (get_innermost_template_args): New function. + * decl2.c (arg_assoc_class): Use INNERMOST_TEMPLATE_ARGS. + * error.c (dump_function_decl): Be caution when using + most_general_template. + * method.c (build_template_parm_names): Use + INNERMOST_TEMPLATE_ARGS. + * pt.c (add_to_template_args): Tidy comment + (get_innermost_template_args): New function. + (check_explicit_specialization): Clear DECL_INITIAL for a new + specialization. + (process_partial_specialization): Use INNERMOST_TEMPLATE_ARGS. + Tidy. + (push_template_decl): Always register specializations of the most + general template. + (convert_template_argument): Use INNERMOST_TEMPLATE_ARGS. + (coerce_template_parms): Likewise. + (lookup_template_class): Likewise. + (innermost_args): Remove. + (tsubst_decl): Use INNERMOST_TEMPLATE_ARGS. + (tsubst_decl): Handle tricky specializations. Use + get_innermost_template_args. + (instantiate_template): Simplify handling of partial + instantiations. + (get_class_bindings): Use INNERMOST_TEMPLATE_ARGS. + (most_general_template): Reimplement, in a more straightforward + manner. + (regenerate_decl_from_template): Tweak formatting. Use + TMPL_ARGS_DEPTH for clarity. + (set_mangled_name_for_template_decl): Use INNERMOST_ARGS. + + * dump.c (dequeue_and_dump): Dump information about thunks. + +2000-06-01 Richard Henderson + + * decl.c (init_decl_processing): Set lang_get_alias_set first thing. + +2000-06-01 Richard Henderson + + * decl2.c (unsupported_options): Fix typo, make const. + (lang_decode_option): Fix bsearch argument order. + +2000-06-01 Mark Mitchell + + * init.c (resolve_offset_ref): Remove check for TREE_ADDRESSABLE + on FIELD_DECLs. + +2000-05-31 Richard Kenner + + * cp-tree.h (c_get_alias_set): Deleted. + * Makefile.in (decl.o): Include ../expr.h. + * decl.c (expr.h): Include. + (init_decl_processing): Call record_component_aliases for arrays. + (grokdeclarator): Likewise. + Set TREE_ADDRESSABLE for fields that aren't bitfields. + * tree.c (build_cplus_array_type_1): Call record_component_aliases. + +2000-05-31 Mark Mitchell + + Remove guiding declaration support. + * cp/cp-tree.h (flag_dump_translation_unit): Make it const. + (flag_guiding_decls): Remove. + * call.c (build_user_type_conversion_1): Remove support for + guiding decls. + (build_new_function_call): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + * decl.c (start_function): Likewise. + * friend.c (is_friend): Likewise. + (do_friend): Likewise. + * decl2.c ((flag_dump_translation_unit): Make it const. + (flag_guiding_decls): Remove. + (unsupported_options): New variable + (compare_options): New function. + (lang_decode_option): Use them. + + * decl.c (build_cp_library_fn): Set DECL_CONTEXT. + + * method.c (mangle_expression): Adjust test for legal expression + operators. + + * pt.c (instantiate_decl): Save and restore the local + specializations list. + +2000-05-30 Jason Merrill + + * decl.c (grok_reference_init): Pass LOOKUP_ONLYCONVERTING. + +2000-05-30 Mark Mitchell + + * call.c (add_template_candidate_real): Handle member template + constructors for classes with virtual bases. + (build_user_type_conversion_1): Use in_charge_arg_for_name. + (build_new_method_call): Use DECL_NONSTATIC_MEMBER_FUNCTION_P. + + * ir.texi: Update thunk documentation. + + * call.c (joust): Fix handling of overloaded builtin operators. + +2000-05-30 Zack Weinberg + + * cp-tree.h (DECL_ANTICIPATED): New macro. + Document new use of DECL_LANG_FLAG_7. + * decl.c (builtin_function): Set DECL_ANTICIPATED on builtins + in the user namespace. + * lex.c (do_identifier): If the identifier's declaration has + DECL_ANTICIPATED on, it has not yet been declared. But do not + replace it with an ordinary implicit declaration. + + * tinfo2.cc: Include stdlib.h. + +2000-05-29 Mark Mitchell + + * cp-tree.h (CLASSTYPE_ALIGN_UNIT): New macro. + * class.c (layout_empty_base): Use CLASSTYPE_ALIGN_UNIT, not + CLASSTYPE_ALIGN. + +2000-05-28 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Use skip_leading_substring instead + of plain strncmp. + +2000-05-28 Alexandre Oliva + + * operators.def (?): this. Fixed. + +2000-05-27 Alex Samuel + Mark Mitchell + + * cp-tree.h (ansi_opname): Make it a macro. + (ansi_assopname): Likewise. + (struct lang_decl_flags): Add assignment_operator_p. + (struct lang_decl): Add operator_code. + (DECL_VTT_PARM): Adjust. + (DECL_OVERLOADED_OPERATOR_P): Return the operator_code for an + overloaded operator. + (SET_OVERLOADED_OPERATOR_CODE): New macro. + (DECL_ASSIGNMENT_OPERATOR_P): New macro. + (DECL_ARRAY_DELETE_OPERATOR_P): Adjust. + (opname_tab): Remove. + (assignop_tab): Likewise. + (operator_name_info_t): New type. + (operator_name_info): New variable. + (assignment_operator_name_info): Likewise. + (build_cp_library_fn): Remove declaration. + (push_cp_library_fn): Likewise. + (operator_name_string): Likewise. + (build_decl_overload): Likewise. + * call.c (print_z_candidates): Simplify. + (build_object_call): Adjust usage of ansi_opname. Use + DECL_OVERLOADED_OPERATOR_P. + (op_error): Adjust operator name lookup. + (build_conditional_expr): Adjust usage of ansi_opname. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + (build_over_call): Likewise. + (joust): Use DECL_OVERLOADED_OPERATOR_P. + * decl.c (duplicate_decls): Copy operator_code. + (init_decl_processing): Adjust parameters to push_cp_library_fn. + (builtin_function): Adjust parameters to build_library_fn_1. + (build_library_fn_1): Accept an overloaded operator code. + (build_library_fn): Pass ERROR_MARK. + (build_cp_library_fn): Accept an overloaded operator code. + (push_cp_library_fn): Likewise. + (grokfndecl): Tweak. + (grokdeclarator): Simplify code to compute names of overloaded + operators. Adjust use of ansi_opname. + (ambi_op_p): Work on tree_codes, not identifiers. + (unary_op_p): Likewise. + (grok_op_properties): Likewise. + (start_function): Use DECL_OVERLOADED_OPERATOR_P. + (lang_mark_tree): Don't try to mark the operator_code. + * decl2.c (grok_function_init): Use DECL_OVERLOADED_OPERATOR_P. + * error.c (dump_decl): Remove special handling for operator + names. + (dump_function_name): Likewise. + (dump_expr): Adjust name lookup of operators. + (op_to_string): Simplify. + (assop_to_string): Likewise. + * init.c (build_new_1): Adjust use of ansi_opname. + * lex.c (opname_tab): Remove. + (assignop_tab): Likewise. + (ansi_opname): Likewise. + (ansi_assopname): Likewise. + (operator_name_string): Likewise. + (reinit_lang_specific): Likewise. + (operator_name_info): New variable. + (assignment_operator_name_info): Likewise. + (init_operators): New function. + (init_parse): Use it. + (do_identifier): Adjust use of ansi_opname. + * method.c (mangle_expression): Don't use ansi_opname for + mangling. + (build_decl_overload_real): Use DECL_OVERLOADED_OPERATOR_P. + (build_decl_overload): Remove. + (build_typename_overload): Use OPERATOR_TYPENAME_FORMAT directly. + (do_build_assign_ref): Adjust use of ansi_opname. + (synthesize_method): Likewise. + (implicitly_declare_fn): Likewise. + * operators.def: New file. + * parse.y (operator): Adjust use of ansi_opname. + * pt.c (tsubst_decl): Use IDENTIFIER_OPNAME_P. + (set_mangled_name_for_template_decl): Don't play games with + current_namespace. + (special_function_p): Adjust use of ansi_opname. + * typeck.c (check_return_expr): Likewise. + * Make-lang.in (cc1plus): Depend on operators.def. + * Makefile.in (lex.o): Likewise. + (decl.o): Likewise. + +2000-05-27 Zack Weinberg + + * Make-lang.in (cplib2.ready): Eradicate. + +2000-05-27 Richard Kenner + + * method.c (mangle_expression): Use TREE_CODE_LENGTH. + * tree.c (break_out_calls, build_min_nt): Use TREE_CODE_LENGTH. + (built_min, cp_tree_equal): Likewise. + +2000-05-26 Mark Mitchell + + * class.c (layout_nonempty_base_or_field): Replace + `record_layout_info' with `record_layout_info_s'. + +2000-05-26 Jason Merrill + + Fix goto checking. + * cp-tree.h (struct language_function): x_named_labels is now + a struct named_label_list*. + * decl.c (struct named_label_use_list): Renamed from... + (struct named_label_list): ...this. New struct. + (push_binding_level): Don't set eh_region. + (note_level_for_eh): New fn. + (pop_label): Take label and old value directly. + (pop_labels): Adjust for new named_labels format. + (lookup_label): Likewise. + (poplevel): Note characteristics of a binding level containing a + named label. Mess with named label lists earlier. + (mark_named_label_lists): New fn. + (mark_lang_function): Call it. + (use_label): New fn, split out from... + (make_label_decl): ...here. Don't call it. + (decl_jump_unsafe, check_previous_goto, check_previous_goto_1, + check_previous_gotos): New fns, split out from... + (define_label): ...here. + (check_switch_goto): New fn. + (define_case_label): Call it. + (check_goto): New fn. + * semantics.c (finish_goto_stmt): Call it and use_label. + (begin_compound_stmt): If we're a try block, call note_level_for_eh. + (expand_stmt): Never pass 1 as DONT_JUMP_IN to expand_end_bindings. + +2000-05-26 Mark Mitchell + + * class.c (build_vtable_entry_ref): Correct usage of + get_vtbl_decl_for_binfo. + + * decl2.c (grokclassfn): Set DECL_LANGUAGE here. + * method.c (implicitly_declare_fn): Not here. + +2000-05-26 Nathan Sidwell + + * cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ... + (CPTI_PTMD_DESC_TYPE): ... here. + (ptmd_desc_type_node): Rename to ... + (ptm_desc_type_node): ... here. + * decl.c: Likewise. + * rtti.c (ptmd_initializer): Rename to ... + (ptm_initializer): ... here. + (sythesize_tinfo_var): Adjust. Deal with pointer to member + function. + (create_tinfo_types): Adjust. + +2000-05-25 Mark Mitchell + + Finish implementation of VTTs. + * cp-tree.h (cp_tree_index): Add CPTI_VTT_PARM_TYPE and + CPTI_VTT_PARM_IDENTIFIER. + (vtt_parm_identifier): New macro. + (vtt_parm_type): Likewise. + (BINFO_SUBVTT_INDEX): Likewise. + (BINFO_VPTR_INDEX): Likewise. + (struct lang_decl): Add vtt_parm. + (DECL_VTT_PARM): New macro. + (DECL_USE_VTT_PARM): Likewise. + (DECL_NEEDS_VTT_PARM_P): Likewise. + (get_vtt_name): Declare. + (build_artificial_parm): Likewise. + (fixup_all_virtual_upcast_offsets): Likewise. + (expand_indirect_vtbls_init): Remove. + * call.c (build_new_method_call): Pass the vtt to subobject + constructors and destructors. + * class.c (get_vtt_name): Give it external linkage. + (build_clone): Handle the magic VTT parameters for clones. + (clone_function_decl): Fix typo in comment. + (build_vtt): Keep track of the indices in the VTTs where various + entities are stored. + (build_vtt_inits): Likewise. + (dfs_build_vtt_inits): Likewise. + (build_ctor_vtbl_group): Tweak type of construction vtables. + (dfs_accumulate_vtbl_inits): Build vtables for all bases, even + primary bases, when building construction vtables. + * decl.c (duplicate_decls): Handle DECL_VTT_PARM. + (initialize_predefined_identifiers): Add vtt_parm_identifier. + (init_decl_processing): Initialize vtt_parm_type. + (grokfndecl): Use DECL_OVERLOADED_OPERATOR_P. + (lang_mark_tree): Make vtt_parm. + * decl2.c (build_artificial_parm): New function. + (maybe_retrofit_in_chrg): Use it. Add VTT parameters. + (grokclassfn): Use build_artificial_parm. + * init.c (initialize_vtbl_ptrs): Call + fixup_all_virtual_upcast_offsets directly. + (perform_member_init): Use the complete subobject destructor for + member cleanups. + (build_vtbl_address): New function. + (expand_virtual_init): Handle VTTs. + * optimize (maybe_clone_body): Likewise. + * search.c (fixup_all_virtual_upcast_offsets): Give it external + linkage. + (expand_indirect_vtbls_init): Remove. + * semantics.c (setup_vtbl_ptr): Fix typos in comment. + * tree.c (make_binfo): Make them bigger. + +2000-05-25 Nathan Sidwell + + * inc/cxxabi.h (__pbase_type_info): Define, based on + __pointer_type_info. + (__pointer_type_info): Derive from __pbase_type_info. Adjust. + (__pointer_to_member_type_info): Likewise. + * tinfo2.cc (__pbase_type_info::~__pbase_type_info): Implement. + (__pointer_to_member_type_info::__is_pointer_p): Remove. + (__pointer_type_info::__do_catch): Rename to ... + (__pbase_type_info::__do_catch): ... here. Adjust. + (__pbase_type_info::__pointer_catch): Implement. + (__pointer_type_info::__pointer_catch): Adjust. + (__pointer_to_member_type_info::__pointer_catch): Adjust. + +2000-05-25 Nathan Sidwell + + * tinfo.h (__user_type_info::contained_virtual_p): New + predicate. + * tinfo.cc (__user_type_info::do_upcast): Fix bug with diamond + shaped hierarchy. + (__vmi_class_type_info::__do_upcast): Fix bug with NULL pointer to + diamond shaped hierarchy. Add early out for mixed diamond and + duplicate shaped hierarchy. + +2000-05-24 Mark Mitchell + + * cp-tree.h (build_delete): Change prototype. + (build_vec_delete): Likewise. + * call.c (build_scoped_method_call): Use special_function_kind + values to indicate the kind of destruction to be done. + (build_method_call): Likewise. + * decl.c (finish_destructor_body): Likewise. + (maybe_build_cleanup_1): Likewise. Rename to ... + (maybe_build_cleanup): ... this. + * decl2.c (delete_sanity): Use special_function_kind + values to indicate the kind of destruction to be done. + (build_cleanup): Likewise. + * init.c (perform_member_init): Likewise. + (build_vec_delete_1): Likewise. + (build_dtor_call): Simplify. + (build_delete): Use special_function_kind + values to indicate the kind of destruction to be done. + (build_vbase_delete): Likewise. + (build_vec_delete): Likewise. + + * init.c (sort_member_init): Fix typo in error message generation + code. + +2000-05-15 Donald Lindsay + + * semantics.c (begin_class_definition): make the packed + attribute be sensitive to the "-fpack-struct" command line flag + +2000-05-24 Nathan Sidwell + + Update new-abi upcast algorithm. + * inc/cxxabi.h (__class_type_info::__do_upcast): Change + prototype and meaning of return value. + (__si_class_type_info::__do_upcast): Likewise. + (__vmi_class_type_info::__do_upcast): Likewise. + * tinfo.cc (__class_type_info::__upcast_result): Replace + whole2dst with part2dst. Adjust ctor. + (__class_type_info::__do_upcast): Adjust call of worker function. + (__class_type_info::__do_upcast): Adjust. + (__si_class_type_info::__do_upcast): Adjust. Use parent's + __do_upcast. + (__vmi_class_type_info::__do_upcast): Likewise. Fix private + virtual base in diamond hierarchy bug. + +2000-05-23 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable + and bitfield to tinfo_fn_p. + (DECL_TINFO_FN_P): Adjust. + (SET_DECL_TINFO_FN_P): Likewise. + (DECL_MUTABLE_P): Likewise. + (DECL_C_BIT_FIELD): Likewise. + (SET_DECL_C_BIT_FIELD): Likewise. + (CLEAR_DECL_C_BIT_FIELD): Likewise. + (DECL_UNINLINABLE): Likewise. + * class.c (alter_access): Call retrofit_lang_decl if ncessary. + (handle_using_decl): Remove assertion. + (build_vtbl_or_vbase_field): Use build_decl, not build_lang_decl, + to build FIELD_DECLs. + (build_base_field): Likewise. + (layout_class_type): Likewise. + * decl.c (init_decl_processing): Likewise. + (build_ptrmemfunc_type): Likewise. + (grokdeclarator): Likewise. + * decl2.c (grok_x_components): Likewise. + * except.c (call_eh_info): Likewise. + * init.c (init_init_processing): Likewise. + * rtti.c (expand_class_desc): Likewise. + (create_pseudo_type_info): Likewise. + (get_vmi_pseudo_type_info): Likewise. + (create_tinfo_types): Likewise. + * ptree.c (print_lang_decl): Adjust. + * typeck.c (build_component_ref): Don't check DECL_LANG_SPECIFIC + before checking DECL_MUTABLE_P. + + * decl2.c (maybe_retrofit_in_chrg): Don't create in-charge + parameters for template functions. + * pt.c (tsubst_decl): Make sure we call maybe_retrofit_in_chrg for + destructors as well as constructors. + +2000-05-22 Mark Mitchell + + * class.c (build_ctor_vtbl_group): Set inits. + * optimize.c (maybe_clone_body): Set DECL_INLINE and + DECL_THIS_INLINE appropriately for clones. + + * cp-tree.h (IDENTIFIER_TYPENAME_P): Use a flag, not strncmp. + (DECL_CONV_FN_P): Simplify. + (DECL_OPERATOR): Remove. + (language_to_string): Declare. + * decl.c (duplicate_decls): Fix typo in comment. + (grokdeclarator): Adjust use of IDENTIFIER_TYPENAME_P. + (grok_op_properties): Use DECL_CONV_FN_P instead of + IDENTIFIER_TYPENAME_P. + * dump.c (dequeue_and_dump): Dump the language linkage of + declarations. + * error.c (language_to_string): Give it external linkage. + * method.c (build_typename_overload): Set IDENTIFIER_TYPENAME_P. + (implicitly_declare_fn): Set DECL_LANGUAGE. + * pt.c (check_explicit_specialization): Use DECL_CONV_FN_P, not + IDENTIFIER_TYPENAME_P. + (tsubst_decl): Likewise. + (tsubst_copy): Adjust use of IDENTIFIER_TYPENAME_P. + * semantics.c (finish_member_declaration): Don't mark members of + classes declared in an extern "C" region as extern "C". + +2000-05-22 Martin v. Löwis + + * decl2.c (qualified_lookup_using_namespace): Look through + namespace aliases. + + * decl.c (push_using_decl): Return the old decl on namespace level. + +2000-05-21 Mark Mitchell + + * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Add sanity checks. + (VTT_NAME_PREFIX): New macro. + (CTOR_VTBL_NAME_PREFIX): Likewise. + (get_ctor_vtbl_name): New function. + * class.c (get_vtable_name): Simplify. + (get_vtt_name): New function. + (get_vtable_decl): Don't set IDENTIFIER_GLOBAL_VALUE. + (dfs_mark_primary_bases): Update the CLASSTYPE_VBASECLASSES list + when a virtual base becomes primary. + (finish_struct_1): Set CLASSTYPE_VFIELDS a little earlier. Build + VTTs. + (finish_vtbls): Adjust calls to accumulate_vtbl_inits to pass in + additional parameters. + (dfs_finish_vtbls): Don't clear BINFO_NEW_VTABLE_MARKED. + (initialize_array): New function. + (build_vtt): Likewise. + (build_vtt_inits): Likewise. + (dfs_build_vtt_inits): Likewise. + (dfs_fixup_binfo_vtbls): Likewise. + (build_ctor_vtbl_group): Likewise. + (initialize_vtable): Use initialize_array. + (accumulate_vtbl_inits): Reimplement to handle construction + vtables. + (dfs_accumulate_vtbl_inits): Likewise. + (bulid_vtbl_initializer): Adjust parameter name. + * method.c (build_typename_overload): Remove #if 0'd code. + (get_ctor_vtbl_name): New function. + * search.c (dfs_walk_real): Use BINFO_N_BASETYPES. + (init_vbase_pointers): Don't mess with the TREE_CHAIN of a binfo. + + * cp-tree.h (struct lang_type): Remove search_slot. + (CLASSTYPE_SEARCH_SLOT): Remove. + (emit_base_init): Change prototype. + (initialize_vtbl_ptrs): Likewise. + (expand_indirect_vtbls_init): Likewise. + (clear_search_slots): Remove. + * decl.c (lang_mark_tree): Don't mark search_slot. + * init.c (initialize_vtbl_ptrs): Simplify. + (emit_base_init): Likewise. + * search.c (struct vbase_info): Document decl_ptr. + (convert_pointer_to_single_level): Remove. + (dfs_find_vbases): Remove. + (dfs_init_base_pointers): Simplify. + (dfs_clear_vbase_slots): Remove. + (dfs_vtable_path_unmark): New function. + (init_vbase_pointers): Simplify. + (expand_upcast_fixups): Don't rely on CLASSTYPE_SEARCH_SLOT. + (expand_indirect_vtbls_init): Simplify. Don't call + mark_all_temps_used. + * semantics.c (setup_vtbl_ptr): Adjust calls to emit_base_init and + initialize_vtbl_ptrs. + +2000-05-20 Zack Weinberg + + * except.c: Add static prototypes. + +2000-05-20 H.J. Lu + + * Make-lang.in (cplib2.ready): Also depend on cc1plus$(exeext). + +2000-05-19 Mark Mitchell + + Don't create a separate copy of virtual bases for the + CLASSTYPE_VBASECLASSES list. + * cp-tree.h (CLASSTYPE_VBASECLASSES): Change documentation. + (BINFO_FOR_VBASE): Remove. + (CANONICAL_BINFO): Adjust. + (binfo_for_vbase): New function. + * class.c (build_vbase_pointer_fields): Use binfo_for_vbase + instead of BINFO_FOR_VBASE. + (build_vbase_pointer): Likewise. + (build_secondary_vtable): Likewise. + (dfs_mark_primary_bases): Likewise. + (mark_primary_bases): Likewise. + (layout_nonempty_base_or_field): Likewise. + (dfs_set_offset_for_shared_vbases): Likewise. + (dfs_set_offset_for_unshared_vbases): Likewise. + (layout_virtual_bases): Likewise. Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (dump_class_hierarchy_r): Use binfo_for_vbase + instead of BINFO_FOR_VBASE. + (dump_class_hierarchy): Likewise. + (finish_vtbls): Likewise. + (build_vtbl_initializer): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (build_vbase_offset_vtbl_entries): Use binfo_for_vbase. + * decl.c (finish_destructor_body): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + * init.c (sort_base_init): Use binfo_for_vbase. + (construct_virtual_bases): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (expand_member_init): Use binfo_for_vbase. + (build_vbase_delete): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + * method.c (do_build_copy_constructor): Likewise. + * rtti.c (get_base_offset): Use binfo_for_vbase. + (expand_class_desc): Remove #if 0'd code. + * search.c (struct vbase_info): Remove vbase_types. + (get_base_distance): Use binfo_for_vbase. + (lookup_field_queue_p): Use CANONICAL_BINFO. + (get_shared_vbase_if_not_primary): Use binfo_for_vbase. + (get_pure_virtuals): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (dfs_find_vbases): Use binfo_for_vbase. + (dfs_init_vbase_pointers): Likewise. + (init_vbase_pointers): Don't initialize vi.vbase_types. + (virtual_context): Use binfo_for_vbase. + (fixup_all_virtual_upcast_offsets): Adjust for changes to the + CLASSTYPE_VBASECLASSES list. + (expand_indirect_vtbls_init): Simplify. + (dfs_get_vbase_types): Don't replicate virtual bases. + (find_vbase_instance): Use binfo_for_vbase. + (binfo_for_vbase): New function. + * typeck.c (get_delta_difference): Use binfo_for_vbase. + +2000-05-17 Mark Mitchell + + * decl2.c (finish_anon_union): Generalize error messages to handle + anonymous structures. + * init.c (perform_member_init): Remove `name' parameter. + (build_field_list): New function. + (sort_member_init): Handle anonymous union initialization order + correctly. Check for multiple initializations of the same union. + (emit_base_init): Don't look up fields by name here. + (expand_member_init): Record the result of name lookup for future + reference. + * typeck.c (build_component_ref): Fix formatting. + +2000-05-17 Andrew Cagney + + * decl.c (pop_label): Replace warn_unused with warn_unused_label. + * typeck.c (build_x_compound_expr): Replace warn_unused with + warn_unused_value. + + * decl2.c (lang_decode_option): Update -Wall unused flags by + calling set_Wunused. + +2000-05-16 Mark Mitchell + + * cp-treeh (BINFO_NEW_VTABLE_MARKED): Update documentation. + * init.c (dfs_vtable_path_unmark): Remove. + * search.c (marked_new_vtable_p): Likewise. + (unmarked_new_vtable_p): Likewise. + (dfs_search_slot_nonempty_p): Likewise. + (dfs_mark): Likewise. + (dfs_vtable_path_unmark): Likewise. + (dfs_find_vbases): Don't set BINFO_NEW_VTABLE_MARKED. + (dfs_int_vbase_pointers): Don't clear BINFO_VTABLE_PATH_MARKED. + (dfs_init_vbase_pointers): Remove special-case new ABI code. + (dfs_clear_vbase_slots): Don't clear BINFO_NEW_VTABLE_MARKED. + (init_vbase_pointers): Simplify. + (expand_indirect_vtbls_init): Likewise. + + * class.c (copy_virtuals): New function. + (build_primary_table): Use it. + (build_secondary_vtable): Likewise. + (modify_vtable_entry): Use NULL_TREE, not integer_zero_node, to + indicate that no vcall offset is required. + (add_virtual_function): Likewise. + (modify_all_vtables): Likewise. + (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. + (dfs_accumulate_vtbl_inits): Likewise. + (build_vtbl_initializer): Make changes to handle construction + vtables. + (dfs_build_vcall_offset_vtbl_entries): Likewise. + (build_rtti_vtbl_entries): Likewise. + (build_vtable_entries): Handle a NULL vcall_index. + +2000-05-15 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Fix thinko. + +2000-05-14 Jason Merrill + + * except.c (check_handlers): New fn. + * cp-tree.h: Declare it. + * semantics.c (finish_handler_sequence): Call it. + (finish_function_handler_sequence): Likewise. + (finish_handler_parms): Set TREE_TYPE on the handler. + * cp-tree.h (PUBLICLY_UNIQUELY_DERIVED_P): New macro. + * search.c (get_base_distance_recursive): If protect>1, ignore + special access. + (get_base_distance): Don't reduce watch_access. + +2000-05-13 Gabriel Dos Reis + + * lex.c: #include diagnostic.h. + (lang_init_options): Set default prefixing rules. + + * lang-options.h: Add -fdiagnostics-show-location=. + + * decl2.c: #include diagnostic.h. + (lang_decode_option): Handle -fdiagnostics-show-location=. + +2000-05-12 Nathan Sidwell + + * tinfo.cc: Revert my 2000-05-08 and 2000-05-07 changes. + * vec.cc: Revert my 2000-05-07 change. + +2000-05-11 Jason Merrill + + * class.c (check_field_decls): Complain about non-static data + members with same name as class in class with constructor. + +2000-05-10 Jason Merrill + + * decl.c (grokdeclarator): Allow non-static data members with + same name as class. + +2000-05-09 Zack Weinberg + + * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, + and pending_inline.filename. Update prototypes. + * decl.c (define_label): Constify filename parameter. + * decl2.c (warn_if_unknown_interface): Constify local char *. + * input.c Constify input_source.filename. Don't declare + input_filename or lineno. Constify filename parameter to feed_input. + * lex.c (init_parse): Constify parameter and return value. + (cp_pragma_interface, cp_pragma_implementation): Constify + filename argument. + (reinit_parse_for_method, reinit_parse_for_block, + reinit_parse_for_expr, feed_defarg, handle_cp_pragma): + Constify local char *. + * pt.c: Don't declare lineno or input_filename. + (print_template_context, tsubst_friend_function, tsubst_decl, + tsubst, instantiate_decl): Constify local char *. + * semantics.c (expand_body): Constify local char *. + * tree.c (build_srcloc): Constify filename parameter. + * typeck.c (c_expand_asm_operands): Constify filename + parameter. + +2000-05-08 Nathan Sidwell + + * tinfo.cc (__dynamic_cast): Use a reinterpret_cast. Fix + offsetof expansion. + +2000-05-08 Branko Cibej + + * inc/cxxabi.h: Fix typos in comment. + (__base_class_info::__offset): Use a static_cast. + +2000-05-07 Nathan Sidwell + + * inc/cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place + of std::size_t and std::ptrdiff_t respectively. + * tinfo.cc: Likewise. + * vec.cc: Likewise. + +2000-05-06 Richard Henderson + + * typeck.c (build_c_cast): Don't warn integer->pointer size + mismatch for constants. + +2000-05-06 Nathan Sidwell + + * rtti.c (ptmd_initializer): Set non-public, if class is + incomplete. + + * inc/cxxabi.h (__dynamic_cast): Explicitly say extern "C++". + (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, + __cxa_vec_delete): Likewise. + * tinfo.cc (__dynamic_cast): Likewise. + * vec.cc (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, + __cxa_vec_delete): Likewise. + +2000-05-04 Mark Mitchell + + * cp-tree.h (DELTA_FROM_VTABLE_ENTRY): Remove. + (SET_FNADDR_FROM_VTABLE_ENTRY): Likewise. + (lang_decl_flags): Add vcall_offset. + (THUNK_VCALL_OFFSET): Use it. + * decl.c (lang_mark_tree): Don't mark DECL_ACCESS for a thunk. + * method.c (make_thunk): Create the lang_decl here, not in + emit_thunk. + (emit_thunk): Make generic thunks into ordinary functions once + they have been fed to expand_body. + * semantics.c (expand_body): Set current_function_is_thunk here. + +2000-05-04 Kaveh R. Ghazi + + * class.c (update_vtable_entry_for_fn): Prototype. + + * pt.c (tsubst_decl): Initialize variables `argvec', `gen_tmpl' + and `tmpl'. + + * search.c (dfs_build_inheritance_graph_order): Prototype. + +2000-05-04 Mark Mitchell + + * cp-tree.h (special_function_kind): Add various kinds of + destructors. + (special_function_p): New function. + * class.c (overrides): Don't let one kind of destructor override + another. + * decl2.c (mark_used): Use DECL_NON_THUNK_FUNCTION_P when deciding + whether or not to instantiate a template. + * tree.c (special_function_p): Define. + +2000-05-03 Mark Mitchell + + * cp-tree.def (THUNK_DECL): Remove. + * cp-tree.h (DECL_THUNK_P): New macro. + (DECL_NON_THUNK_FUNCTION_P): Likewise. + (DECL_EXTERN_C_FUNCTION_P): Likewise. + (SET_DECL_THUNK_P): Likewise. + (DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P. + (FNADDR_FROM_VTABLE_ENTRY): Likewise. + (DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P. + * decl.c (decls_match): Use DECL_EXTERN_C_P. + (duplicate_decls): Likewise. + (pushdecl): Likewise. Adjust thunk handling. + (grokfndecl): Use DECL_EXTERN_C_P. + * decl2.c (mark_vtable_entries): Use DECL_THUNK_P. + * dump.c (dequeue_and_dump): Remove THUNK_DECL handling. + * except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P. + * expr.c (cplus_expand_expr): Remove THUNK_DECL handling. + * method.c (make_thunk): Use SET_DECL_THUNK_P. Set + DECL_NO_STATIC_CHAIN. + (emit_thunk): Don't play games with TREE_CODE on thunks. Don't + set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk. + * search.c (covariant_return_p): Remove THUNK_DECL handling. + * ir.texi: Update. + +2000-05-01 Jason Merrill + + * tree.c (walk_tree): Set lineno. + +2000-05-01 Mark Mitchell + + * exception.cc: Update license notice. + * new.cc: Likewise. + * new1.cc: Likewise. + * new2.cc: Likewise. + * tinfo.cc: Likewise. + * tinfo2.cc: Likewise. + * vec.cc: Likewise. + * inc/cxxabi.h: Likewise. + * inc/exception: Likewise. + * inc/new: Likewise. + * inc/new.h: Likewise. + * inc/typeinfo: Likewise. + +2000-05-01 Jason Merrill + + * tree.c (build_target_expr_with_type): If we already have a + TARGET_EXPR, just return it. + + * optimize.c (initialize_inlined_parameters): Don't generate an + EXPR_STMT if we can just use DECL_INITIAL. + * decl.c (emit_local_var): Only make the initialization a + full-expression if stmts_are_full_exprs_p. + +2000-05-01 Mark Mitchell + + * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): New + macro. + * call.c (standard_conversion): Use it. + (direct_reference_binding): Likewise. + (build_over_call): Likewise. + (is_properly_derived_from): Likewise. + (compare_ics): Likewise. + * class.c (resolves_to_fixed_type_p): Likewise. + * optimize.c (declare_return_variable): Likewise. + * pt.c (is_specialization_of): Likewise. + (unify): Likewise. + * typeck.c (comp_target_parms): Likeiwse. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (comp_ptr_ttypes_real): Likewise. + (comp_ptr_ttypes_const): Likewise. + * typeck2.c (process_init_constructor): Likewise. + +2000-04-30 Scott Snyder + + * decl.c (finish_destructor_body): Use the base destructor when + destroying virtual bases. + +2000-04-30 Mark Mitchell + + * expr.c (cplus_expand_expr): Preserve temporaries when expanding + STMT_EXPRs. + * optimize.c (struct inline_data): Add target_exprs field. + (declare_return_variable): When a function returns an aggregate, + use the variable declared in the TARGET_EXPR as the remapped + DECL_RESULT. + (expand_call_inline): Update the pending target_exprs stack. + (optimize_function): Initialize the stack. + + * decl2.c (finish_file): Fix typo in comment. + + * method.c (emit_thunk): Don't try to return a `void' value. + + * optimize.c (initialize_inlined_parameters): If the parameter is + addressable, we need to make a new VAR_DECL, even if the + initializer is constant. + +2000-04-28 Cosmin Truta + + * decl.c (grok_op_properties): Add an extra check of argtypes. + +2000-04-27 Mark Mitchell + + * optimize.c (copy_body_r): Use STRIP_TYPE_NOPS when copying + variables. + (initialize_inlined_parameters): Try to avoid creating new + VAR_DECLs. + +2000-04-27 Alex Samuel + + * lex.c (my_get_run_time): Remove. + (init_filename_times): Use get_run_time instead of my_get_run_time. + (check_newline): Likewise. + (dump_time_statistics): Likewise. + * decl2.c (finish_file): Push and pop timevar TV_VARCONST instead + of computing elapsed time explicitly. + +2000-04-26 Mark Mitchell + + * cp-tree.h (TREE_READONLY_DECL_P): Use DECL_P. + * init.c (decl_constant_value): Check TREE_READONLY_DECL_P. + * call.c (convert_like_real): Don't test TREE_READONLY_DECL_P + before calling decl_constant_value. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (ocp_convert): Likewise. + (convert): Likewise. + * decl.c (compute_array_index_type): Likewise. + (build_enumerator): Likewise. + * decl2.c (check_cp_case_value): Likewise. + * pt.c (convert_nontype_argument): Likewise. + (tsubst): Likewise. + * typeck.c (decay_conversion): Likewise. + (build_compound_expr): Likewise. + (build_reinterpret_cast): Likewise. + (build_c_cast): Likewise. + (convert_for_assignment): Likewise. + +2000-04-26 Jason Merrill + + * decl.c (finish_function): Don't play games with DECL_INLINE. + +2000-04-25 Gabriel Dos Reis + + * ir.texi: Correct typo. + +2000-04-25 Martin v. Löwis + + * decl.c (grokdeclarator): Reject VLAs as members. + +2000-04-24 Gabriel Dos Reis + + * call.c (standard_conversion): Accept conversion between + COMPLEX_TYPEs. + + * cvt.c (ocp_convert): Handle conversion to COMPLEX_TYPE. + +2000-04-24 Zack Weinberg + + * decl2.c (finish_file): Remove double setup for accounting + compile time. + +2000-04-24 Robert Lipe + + * cp-tree.h (lang_type): Member `language' now ENUM_BITFIELD. + +2000-04-23 Benjamin Kosnik + + * new.cc (set_new_handler): Needs to be in std::. + +2000-04-23 Mark Mitchell + + * cp-tree.h (lang_decl): Remove pretty_function_p. + (DECL_PRETTY_FUNCTION_P): Use TREE_LANG_FLAG_0, not a bit in the + language-specific node. + * decl.c (cp_make_fname_decl): Use build_decl, not + build_lang_decl, to build the variables. + (grokvardecl): Don't call build_lang_decl for local variables in + templates. + (grokdeclarator): Don't call build_lang_decl for local type + declarations in templates. + * lex.c (retrofit_lang_decl): Use ggc_alloc_obj to allocated + zero'd memory, rather than calling memset. + * pt.c: Include hashtab.h. + (local_specializations): New variable. + (retrieve_local_specialization): Use it. + (register_local_specialization): Likewise. + (tsubst_decl): Don't assume local variables have + DECL_LANG_SPECIFIC. + (instantiate_decl): Set up local_specializations. + * Makefile.in (HTAB_H): New variable. + +2000-04-23 Richard Henderson + + * typeck.c (c_expand_asm_operands): Restore the original + contents of the output list. + +2000-04-22 Gabriel Dos Reis + + * ir.texi: Document complex number representation. + +2000-04-20 Nathan Sidwell + + * rtti.c (init_rtti_processing): Set tinfo_var_id in new-abi. + (target_incomplete_p): New function. + (tinfo_base_init): Create comdat NTBS name variable. + (ptr_initializer): Add non_public parameter. Calculate it. + (ptmd_initializer): Likewise. + (synthesize_tinfo_var): Adjust. Emit incomplete class tinfo. + (create_real_tinfo_var): Add non_public parameter. Use it. + Push proxy into global namespace. + * inc/cxxabi.h (__pointer_type_info::incomplete_class_mask): + New enumeration. + * inc/typeinfo (type_info::before, type_info::operator==): + Compare __name addresses. + + * tinfo2.cc: Remove new-abi builtins comment. + +2000-04-20 Jason Merrill + + * typeck.c (build_x_function_call): Resolve an OFFSET_REF. + + * call.c (joust): Exit early if we get the same function, too. + + * decl2.c (key_method): Return NULL_TREE for template classes. + (import_export_class): Don't need to check for template classes. + +2000-04-18 Zack Weinberg + + * lex.c: Remove references to cccp.c. + +2000-04-18 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove const_memfunc and + volatile_memfunc. Add destructor_attr. Adjust dummy. + (DECL_DESTRUCTOR_P): Use destructor_attr. + (DECL_CONST_MEMFUNC_P): Reimplement. + (DECL_VOLATILE_MEMFUNC_P): Remove. + * class.c (finish_struct_methods): Use CLASSTYPE_DESTRUCTORS. + (overrides): Use DECL_DESTRUCTOR_P. + (check_for_override): Likewise. + * decl.c (start_function): Likewise. + * decl2.c (grokfclassfn): Likewise. + (check_classfn): Likewise. + (grok_function_init): Likewise. + +2000-04-17 Mark Mitchell + + * decl2.c (grokfield): Issue error on illegal data member + declaration. + +2000-04-17 Mark P Mitchell + + * method.c (make_thunk): Set DECL_CONTEXT for a THUNK_DECL. + +2000-04-16 Mark Mitchell + + * class.c (build_vtable_entry): Don't build thunks for type-info + functions. + +2000-04-16 Jason Merrill + + * decl.c (decls_match): Allow a redeclaration of a builtin to + specify args while the builtin did not. + +2000-04-15 Mark Mitchell + + * cp-tree.def (THUNK_DECL): Add to documentation. + * cp-tree.h (flag_huge_objects): Declare. + * class.c (modify_vtable_entry): Tidy. + (update_vtable_entry_for_fn): Split out from dfs_modify_vtables. + Calculate delta appropriately for the new ABI. + (dfs_modify_vtables): Use it. + (modify_all_vtables): Fix thinko in code to add overriding copies + of functions to primary vtables. + (build_clone): Fix typo in comment. + (clone_function_decl): Correct order of destructors in vtable. + (build_vbase_offset_vtbl_entries): Adjust comment. + (dfs_vcall_offset_queue_p): Remove. + (dfs_build_vcall_offset_vtbl_entries): Update BV_VCALL_INDEX. + (build_vcall_offset_vtbl_entries): Juse use dfs_skip_vbases. + (build_vtable_entry): Correct check for pure virtual functions. + Don't declare flag_huge_objects. + * decl.c (flag_huge_objects): Remove declaration. + * method.c (make_thunk): Tweak mangling for vcall offset thunks. + Use int_size_in_bytes. + (emit_thunk): Handle vcall offset thunks. + +2000-04-15 Richard Kenner + + * decl2.c (parse_time, varconst_time): Delete declarations. + (finish_file): Delete LINENO declaration. + START_TIME and THIS_TIME now long. + +2000-04-13 Nathan Sidwell + + * class.c (build_base_field): Reformat comment. + + * inc/cxxabi.h (stddef.h): Comment inclusion. + (__base_class_info::__offset): Comment shift. + +2000-04-12 Mark Mitchell + + * cp-tree.h (IDENTIFIER_CTOR_OR_DTOR_P): New macro. + (cp_tree_index): Add CPTI_PUSH_EXCEPTION_IDENTIFIER. + (cp_push_exception_identifier): New macro. + (DECL_COMPLETE_DESTRUCTOR_P): New macro. + (DECL_BASE_DESTRUCTOR_P): Likewise. + (DECL_DELETING_DESTRUCTOR_P): Likewise. + (get_vtbl_decl_for_binfo): Fix formatting. + (in_charge_arg_for_name): New macro. + (maybe_build_cleanup_and_delete): Remove declaration. + * call.c (build_field_call): Use IDENTIFIER_CTOR_OR_DTOR_P. + (in_charge_arg_for_name): New function. + (build_new_method_call): Use it. Handle cloned destructors. + (build_clone): Don't make the base constructor virtual. + Automatically defer generated functions. + (clone_function_decl): Handle destructors, too. + (clone_constructors_and_destructors): Likewise. + (create_vtable_ptr): Don't create a vtable entry for a cloned + function. + * decl.c (predefined_identifier): Add ctor_or_dtor_p. + (initialize_predefined_identifiers): Update appropriately. + (finish_destructor_body): Simplify. + (maybe_build_cleanup_and_delete): Remove. + * except.c (expand_throw): Handle new-ABI destructors. + * init.c (expand_cleanup_for_base): Use base_dtor_identifier. + (build_dtor_call): New function. + (build_delete): Use it. Simplify. + * optimize.c (maybe_clone_body): Handle destructors. + * search.c (lookup_field_queue_p): Use IDENTIFIER_CTOR_OR_DTOR_P. + + * exception.cc (cleanup_fn): New typedef. + (CALL_CLEANUP): New macro. + (cp_eh_info): Use them. + (__cp_push_exception): Likewise. + (__cp_pop_exception): Likewise. + +2000-04-11 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER. + (complete_dtor_identifier): New macro. + (CLASSTYPE_FIRST_CONVERSION): Remove. + (CLASSTYPE_CONSTRUCTOR_SLOT): New macro. + (CLASSTYPE_DESTRUCTOR_SLOT): Likewise. + (CLASSTYPE_FIRST_CONVERSION_SLOT): Likewise. + (CLASSTYPE_CONSTRUCTORS): Likewise. + (CLASSTYPE_DESTRUCTORS): Likewise. + (lang_decl): Add cloned_function. + (DECL_COMPLETE_CONSTRUCTOR_P): New macro. + (DECL_BASE_CONSTRUCTOR_P): Likewise. + (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise. + (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise. + (DECL_CLONED_FUNCTION_P): Likewise. + (DECL_CLONED_FUNCTION): Likewise. + (clone_function_decl): Declare. + (maybe_clone_body): Likewise. + * call.c (build_user_type_conversion_1): Call complete object + constructors in the new ABI. + (build_new_method_call): Don't add in-charge parameters under the + new ABI. + * class.c (add_method): Use DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P, + DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P, CLASSTYPE_CONSTRUCTOR_SLOT, and + CLASSTYPE_DESTRUCTOR_SLOT. + (build_clone): New function. + (clone_function_decl): Likewise. + (clone_constructors_and_destructors): Likewise. + (check_bases_and_members): Use it. + * decl.c (iniitialize_predefined_identifiers): Initialize + complete_dtor_identifier. + (finish_function): Don't add extra code to a clone. + (lang_mark_tree): Mark cloned_function. + * decl2.c (mark_used): Don't bother trying to instantiate things + we synthesized. + * dump.c (dequeue_and_dump): Don't dump CP_DECL_CONTEXT twice. + * method.c (set_mangled_name_for_decl): Don't treat clones as + constructors. + (synthesize_method): Sythesize cloned functions, not the clones. + * optimize.c (inline_data): Update comment on ret_label. + (remap_block): Don't assume DECL_INITIAL exists. + (copy_body_r): Allow ret_label to be NULL. + (maybe_clone_body): Define. + * pt.c (tsubst_decl): Handle clones. + (instantiate_clone): New function. + (instantiate_template): Use it. + (set_mangled_name_for_template_decl): Don't treat clones as + constructors. + * search.c (lookup_fnfields_1): Use CLASSTYPE_CONSTRUCTOR_SLOT, + CLASSTYPE_DESTRUCTOR_SLOT, and CLASSTYPE_FIRST_CONVERSION_SLOT. + * semantics.c (expand_body): Clone function bodies as necessary. + + * optimize.c (remap_decl): Avoid sharing structure for arrays + whose size is only known at run-time. + * tree.c (copy_tree_r): Don't copy PARM_DECLs. + + * cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr + to has_in_charge_parm_p. + (DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ... + (DECL_HAS_IN_CHARGE_PARM_P): ... this. + (DECL_COPY_CONSTRUCTOR_P): New macro. + * call.c (add_function_candidate): Use DECL_HAS_IN_CHARGE_PARM_P. + (build_user_type_conversion_1): Likewise. + (convert_like_real): Likewise. + (build_over_call): Likeiwse. Use DECL_COPY_CONSTRUCTOR_P. + * decl.c (grokdeclarator): Use DECL_HAS_IN_CHARGE_PARM_P. + (copy_args_p): Likewise. + (grok_ctor_properties): Likewise. + (start_function): Likewise. + * decl2.c (maybe_retrofit_in_charge): Likewise. Set it. + * error.c (dump_function_decl): Use DECL_HAS_IN_CHARGE_PARM_P. + * init.c (emit_base_init): Use DECL_COPY_CONSTRUCTOR_P. + * method.c (do_build_copy_constructor): Use + DECL_HAS_IN_CHARGE_PARM_P. + (synthesize_method): Likewise. + * pt.c (instantiate_template): Remove goto. + * tree.c (build_cplus_method_type): Remove mention of obstacks in + comment. + + * cp-tre.h (finish_function): Change prototype. + * decl.c (end_cleanup_fn): Adjust caller. + (finish_function): Take only one parameter. + * decl2.c (finish_objects): Adjust caller. + (finish_static_storage_duration_function): Likewise. + * method.c (emit_thunk): Likewise. + * parse.y: Likewise. + * parse.c: Regenerated. + * pt.c (instantiate_decl): Likewise. + * rtti.c (synthesize_tinfo_fn): Likewise. + * semantics.c (expand_body): Likewise. + + * cp-tree.h (copy_decl): New function. + * class.c (finish_struct_1): Use it. + * lex.c (copy_decl): Define it. + * pt.c (tsubst_decl): Likewise. + * tree.c (copy_template_template_parm): Likewise. + + * cp-tree.h (lang_type): Remove has_nonpublic_ctor and + has_nonpublic_assign_ref. + (TYPE_HAS_NONPUBLIC_CTOR): Don't declare. + (TYPE_HAS_NONPUBLIC_ASSIGN_REF): Likewise. + * class.c (finish_struct_methods): Don't set + TYPE_HAS_NONPUBLIC_CTOR or TYPE_HAS_NONPUBLIC_ASSIGN_REF. + (interface_only): Don't declare. + (interface_unknown): Likewise. + +2000-04-11 Martin v. Löwis + + * tree.h (HAVE_TEMPLATES): Remove definition. + * lang-options.h (-fthis-is-variable): Remove documentation. + +2000-04-10 Jason Merrill + + * class.c (instantiate_type): Handle object-relative template-id. + + * semantics.c (finish_expr_stmt): Call convert_to_void here. + * decl.c (cplus_expand_expr_stmt): Not here. + + * rtti.c (build_dynamic_cast_1): Call non_lvalue. + Initialize exprtype earlier. + + * parse.y (fn.def1): Check for defining types in return types. + + * decl.c (check_tag_decl): Notice extra fundamental types. + Diagnose empty decls in classes, too. + + * decl.c (grokdeclarator): Don't override an anonymous name if no + declarator was given. + + * cvt.c (convert_to_void): Call resolve_offset_ref. + + * typeck.c (build_x_function_call): Abort if we get an OFFSET_REF. + + * decl2.c (decl_namespace): Handle getting a type. + + * typeck.c (build_c_cast): Re-enable warning for cast between + pointer and integer of different size. + +2000-04-10 Nathan Sidwell + + * inc/cxxabi.h (__pointer_type_info): Add restrict and + incomplete flags. + (__pointer_type_info::__pointer_catch): New virtual function. + (__pointer_to_member_type_info): Derive from + __pointer_type_info. Adjust. + (__pointer_to_member_type_info::__do_catch): Remove. + (__pointer_to_member_type_info::__is_pointer_p): Declare. + (__pointer_to_member_type_info::__pointer_catch): Declare. + * rtti.c (qualifier_flags): Add restrict flag. + (ptmd_initializer): Reorder members. + (create_tinfo_types): Expand comments. Reorder + ptmd_desc_type_node members. + * tinfo2.cc (__pointer_to_member_type_info::__is_pointer_p): + Implement. + (__pointer_type_info::__do_catch): Move specific code into + __pointer_catch. Call it. + (__pointer_type_info::__pointer_catch): Non-pointer-to-member + specific catch checking. Fix void conversion check. + (__pointer_to_member_type_info::__do_catch): Remove. + (__pointer_to_member_type_info::__pointer_catch): Implement. + +2000-04-10 Martin v. Löwis + + * lex.c (init_parse): Remove traces of classof and headof. + * decl2.c (flag_operator_names): Default to 1. + (lang_decode_option): Do not set it for -ansi. + +2000-04-09 Mark Mitchell + + * cp-tree.h (struct lang_decl): Remove main_decl_variant. + (DECL_MAIN_VARIANT): Remove. + * decl.c (duplicate_decls): Don't set it. + (start_function): Likewise. + (lang_mark_tree): Don't mark it. + * decl2.c (defer_fn): Don't use it. + * lex.c (retrofit_lang_decl): Don't set it. + * pt.c (tsubst_decl): Likewise. + * ptree.c (print_lang_decl): Don't print it. + * typeck.c (mark_addressable): Don't use it. + +2000-04-09 Nathan Sidwell + + * vec.cc: Include and . + (__cxa_vec_ctor): Use __cxa_vec_dtor for cleanup. + (__cxa_vec_dtor): Catch dtor exceptions, and rethrow or + terminate. + (__cxa_vec_delete): Catch dtor exceptions. + +2000-04-09 Nathan Sidwell + + Prepend __ to implementation defined names. + * inc/typeinfo (type_info): Rename _name to __name. + (type_info::type_info): Rename parameter. + (type_info::operator==, type_info::operator!=, + type_info::before): Likewise. + (type_info::is_pointer_p, type_info::is_function_p, + type_info::do_catch, type_info::do_upcast): Prepend __. Rename + parameters. + * inc/cxxabi.h + (__fundamental_type_info::__fundamental_type_info) Rename parameters. + (__pointer_type_info::__pointer_type_info): Likewise. + (__pointer_type_info::is_pointer_p, + __pointer_type_info::do_catch): Prepend __. Rename parameters. + (__array_type_info::__array_type_info): Rename parameters. + (__function_type_info::__function_type_info): Likewise. + (__function_type_info::is_function_p): Prepend __. + (__enum_type_info::__enum_type_info): Rename parameters. + (__pointer_to_member_type_info::__pointer_to_member_type_info): + Likewise. + (__pointer_to_member_type_info::do_catch): Prepend __. Rename + parameters. + (__base_class_info::is_virtual_p, is_public_p, offset): Prepend __. + (__class_type_info::__class_type_info): Rename parameters. + (__class_type_info::sub_kind): Prepend __. Adjust member names. + (__class_type_info::upcast_result, + __class_type_info::dyncast_result): Prepend __. Move definition + into tinfo.cc. + (__class_type_info::do_upcast, __class_type_info::do_catch, + __class_type_info::find_public_src, + __class_type_info::do_dyncast, + __class_type_info::do_find_public_src): Prepend __. Rename + parameters. + (__si_class_type_info::__si_class_type_info): Rename parameters. + (__si_class_type_info::do_upcast, __si_class_type_info::do_dyncast, + __si_class_type_info::do_find_public_src): Prepent __. Rename + parameters. + (__vmi_class_type_info::__vmi_class_type_info): Rename parameters. + (__vmi_class_type_info::do_upcast, __vmi_class_type_info::do_dyncast, + __vmi_class_type_info::do_find_public_src): Prepent __. Rename + parameters. + (__dynamic_cast): Rename parameters. + * tinfo.cc (type_info::is_pointer_p, type_info::is_function_p, + type_info::do_catch, type_info::do_upcast): Prepend __. + (contained_p, public_p, virtual_p, contained_public_p, + contained_nonpublic_p, contained_nonvirtual_p): Adjust. + (__class_type_info::do_catch, + __class_type_info::do_upcast): Prepend __. Adjust. + (__class_type_info::__upcast_result, + __class_type_info::__dyncast_result): Move from inc/cxxabi.h. + Adjust. + (__class_type_info::find_public_src): Prepend __. Adjust. + (__class_type_info::do_find_public_src, + __si_class_type_info::do_find_public_src, + __vmi_class_type_info::do_find_public_src): Likewise. + (__class_type_info::do_dyncast, + __si_class_type_info::do_dyncast, + __vmi_class_type_info::do_dyncast): Likewise. + (__class_type_info::do_upcast, + __si_class_type_info::do_upcast, + __vmi_class_type_info::do_upcast): Likewise. + (__dynamic_cast): Adjust. + * tinfo2.cc (__pointer_type_info::is_pointer_p): Prepend __. + (__function_type_info::is_function_p): Likewise. + (__pointer_type_info::do_catch): Likewise. Adjust. + (__pointer_to_member_type_info::do_catch): Likewise. Adjust. + (__throw_type_match_rtti_2): Adjust. + (__is_pointer): Adjust. + +2000-04-08 Mark Mitchell + + * cp-tree.h (cp_tree_index): Add CPTI_COMPLETE_CTOR_IDENTIFIER. + (complete_ctor_identifier): New macro. + (special_function_kind): Add sfk_copy_constructor and + sfk_assignment_operator. + (LOOKUP_HAS_IN_CHARGE): Remove. + (cons_up_default_function): Rename to ... + (implicitly_declare_fn): ... this. + * call.c (build_new_method_call): Add in-charge parameters for + constructors here. + * class.c (add_implicitly_declared_members): Change parameter name + from cant_have_assignment to cant_have_const_assignment. + Replace calls to cons_up_default_function to implicitly_declare_fn. + * cvt.c (ocp_convert): Use complete_ctor_identifier. + * decl.c (initialize_predefined_identifiers): Initialize it. + (start_function): Use DECL_CONSTRUCTOR_FOR_VBASE_P instead of + complex expression. + * init.c (expand_default_init): Don't calculate the in-charge + parameter here. + (build_new_1): Likewise. + * lex.c (cons_up_default_function): Move to method.c. + * method.c (synthesize_method): Use DECL_DESTRUCTOR_P. + (implicitly_declare_fn): New function. + * typeck.c (build_static_cast): Use complete_ctor_identifier. + (build_modify_expr): Likewise. + * typeck2.c (build_functional_cast): Likewise. + + Under the new ABI, constructors don't return `this'. + * cp-tree.h (warn_reorder): Declare. + (special_function_kind): New enum. + (global_base_init_list): Remove declaration. + (emit_base_init): Don't return a value. + (check_base_init): Don't declare. + (is_aggr_typedef): Likewise. + * decl.c (check_special_function_return_type): New function. + (return_types): Remove. + (grokdeclarator): Use check_special_function_return_type. + (start_function): Don't initialize ctor_label under the new ABI. + (finish_construtor_body): Don't create a corresponding LABEL_STMT. + * init.c (begin_init_stmts): Move to top of file. + (finish_init_stmts): Likewise. + (warn_reorder): Don't declare. + (emit_base_init): Don't create a STMT_EXPR here. Don't return a + value. + (check_base_init): Remove. + (is_aggr_typedef): Likewise. + (build_new_1): Don't use the return value of a constructor. + * semantics.c (setup_vtbl_ptr): Don't use the return value + of emit_base_init. + * typeck.c (check_return_expr): Don't magically convert return + statements into `return this' in constructors under the new ABI. + + * cp-tree.h (cp_tree_index): Add CPTI_BASE_CTOR_IDENTIFIER, + CPTI_BASE_DTOR_IDENTIFIER, and CPTI_DELETING_DTOR_IDENTIFIER. + (base_ctor_identifier): New macro. + (base_dtor_identifier): Likewise. + (deleting_dtor_identifier): Likewise. + * decl.c: Don't include obstack.h. + (obstack_chunk_alloc): Don't define. + (obstack_chunk_free): Likewise. + (struct predefined_identifier): New type. + (initialize_predefined_identifiers): New function. + (init_decl_processing): Use it. + (debug_temp_inits): Remove. + (start_method): Don't call preserve_data. + (hack_incomplete_structures): Update comment. + * init.c (init_init_processing): Don't initialize + nelts_identifier. + (build_offset_rf): Remove dead code. + (build_delete): Use CLASSTYPE_N_BASECLASSES. + * search.c (init_search_processing): Don't initialize + vptr_identifier. + +2000-04-08 Kaveh R. Ghazi + + * typeck.c (build_binary_op): Call `tree_expr_nonnegative_p' to elide + some sign_compare warnings. + +2000-04-07 Nathan Sidwell + + Rename abi::__vmi_class_type_info members. + * inc/cxxabi.h (__vmi_class_type_info): Rename details, n_bases, + base_list, detail_masks members to vmi_flags, vmi_base_count, + vmi_bases and vmi_flags_masks respectively. + (__vmi_class_type_info::vmi_flags_masks): Rename + details_unknown_mask to flags_unknown_mask. + * tinfo.cc (__class_type_info::do_upcast): Adjust. + (__vmi_class_type_info::do_find_public_src): Adjust. + (__vmi_class_type_info::do_dyncast): Adjust. + (__vmi_class_type_info::do_upcast): Adjust. + +2000-04-07 Nathan Sidwell + + * tinfo.cc (convert_to_base): New function. + (get_vbase_offset): Remove. Move into convert_to_base. + (__vmi_class_type_info::do_find_public_src): Adjust. + (__vmi_class_type_info::do_dyncast): Adjust. + (__vmi_class_type_info::do_upcast): Adjust. + +2000-04-06 Jason Merrill + + * tinfo.cc (operator=): Use __builtin_strcmp. + * tinfo2.cc (before): Likewise. + +2000-04-06 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Rename saved_inline to deferred. + (DECL_SAVED_INLINE): Rename to ... + (DECL_DEFERRED_FN): ... this. + (in_function_p): Remove declaration. + (mark_inline_for_output): Rename to ... + (defer_fn): ... this. + * decl.c (finish_function): Adjust call to mark_inline_for_output. + (in_function_p): Remove definition. + * decl2.c (saved_inlines): Rename to ... + (deferred_fns): ... this. + (saved_inlines_used): Rename to ... + (deferred_fns_used): ... this. + (mark_inline_for_output): Rename to ... + (defer_fn): ... this. + (finish_file): Adjust accordingly. + (init_decl2): Likewise. + * lex.c (cons_up_default_function): Likewise. + * pt.c (mark_decl_instantiated): Likewise. + (instantiate_decl): Don't set DECL_DEFER_OUTPUT under any + circumstances. + * rtti.c (get_tinfo_decl): Adjust call to mark_inline_for_output. + * semantics.c (expand_body): Defer more functions. + +2000-04-06 Nathan Sidwell + + * vec.cc: New file. + * Make-lang.in (CXX_LIB2FUNCS): Add it. + (vec.o): Build it. + * inc/cxxabi.h (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, + __cxa_vec_delete): Declare. + +2000-04-06 Nathan Sidwell + + * rtti.c (dfs_class_hint_mark): New static function. + (dfs_class_hint_unmark): New static function. + (class_hint_flags): Use them. + +2000-04-05 Benjamin Kosnik + + * decl2.c: Make flag_honor_std dependent on ENABLE_STD_NAMESPACE. + +2000-04-05 Mark Mitchell + + * cp-tree.h (instantiate_decl): Change prototype. + * decl2.c (mark_used): Adjust call. + * optimize.c (inlinable_function_p): Adjust handling of templates. + * pt.c (do_decl_instantiation): Adjust call to instantiate_decl. + (do_type_instantiation): Likewise. + (instantiate_decl): Defer more templates. + (instantiate_pending_templates): Adjust logic to handle inline + friend functions. + + * Makefile.in (GGC_H): New variable. Use it throughout in place + of ggc.h. + + * call.c: Don't include obstack.h. Include ggc.h. + (obstack_chunk_alloc): Don't define. + (obstack_chunk_free): Likewise. + (add_candidate): Allocate the z_candidate with ggc_alloc_obj. + * decl.c (push_switch): Use xmalloc to allocate the cp_switch. + (pop_switch): Free it. + + * decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs. + + * dump.c (dequeue_and_dump): Don't try to print the bit_position + if we don't have a DECL_FIELD_OFFSET. + +Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka + + * optimize.c (calls_setjmp_r): Use setjmp_call_p instead of + special_function_p. + +2000-04-04 Kaveh R. Ghazi + + * cfns.gperf (hash, libc_name_p): Prototype. + + * rtti.c (build_dynamic_cast_1): Constification. + + * search.c (dfs_debug_unmarkedp, dfs_debug_mark): Unhide prototypes. + + * semantics.c (deferred_type_access_control): Prototype. + +2000-04-04 Mark Mitchell + + Correct many new ABI issues regarding vbase and vcall offset + layout. + * cp-tree.h (BINFO_VTABLE): Document. + (struct lang_type): Tweak formatting. + (BINFO_PRIMARY_BINFO): Add to documentation. + (CLASSTYPE_VSIZE): Fix typo in comment. + (CLASSTYPE_VBASECLASSES): Update documentation. + (BINFO_VBASE_MARKED): Remove. + (SET_BINFO_VBASE_MARKED): Likewise. + (CLEAR_BINFO_VBASE_MARKED): Likewise. + (BINFO_FIELDS_MARKED): Remove. + (SET_BINFO_FIELDS_MARKED): Likewise. + (CLEAR_BINFO_FIELDS_MARKED): Likewise. + (enum access_kind): New enumeration. + (num_extra_vtbl_entries): Remove declaration. + (size_extra_vtbl_entries): Likewise. + (get_vtbl_decl_for_binfo): New function. + (dfs_vbase_unmark): Remove declaration. + (mark_primary_bases): Likewise. + * class.c (SAME_FN): Remove. + (struct vcall_offset_data_s): Move definition. + (build_vbase_pointer): Use `build', not `build_binary_op', to + access the vbase pointer under the new ABI. + (build_vtable_entry_ref): Use get_vtbl_decl_for_binfo. + (build_primary_vtable): Likewise. + (dfs_mark_primary_bases): Move here from search.c. + (mark_primary_bases): Likewise. + (determine_primary_bases): Under the new ABI, don't make a base + class a primary base just because we don't yet have any virtual + functions. + (layout_vtable_decl): Use get_vtbl_decl_for_binfo. + (num_vfun_entries): Remove. + (dfs_count_virtuals): Likewise. + (num_extra_vtbl_entries): Likewise. + (size_extra_vtbl_entries): Likewise. + (layout_virtual_bases): Iterate in inheritance graph order under + the new ABI. + (finish_struct_1): Use TYPE_VFIELD, not CLASSTYPE_VSIZE, to + indicate that a vfield is present. + (init_class_processing): Initialize access_public_node, etc., from + ak_public, etc. + (get_vtbl_decl_for_binfo): New function. + (dump_class_hierarchy_r): Likewise. + (dump_class_hierarchy): Use it. + (finish_vtbls): Build the vtbls in inheritance graph order. + (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. + (initialize_vtable): Use get_vtbl_decl_for_binfo. + (accumulate_vtbl_inits): Add comments explaining why a pre-order + walk is required. + (dfs_accumulate_vtbl_inits): Set BINFO_VTABLE to the location + where the vptr points, even for primary vtables. + (build_vtbl_initializer): Adjust handling of vbase and vcall + offsets. + (build_vcall_and_vbase_vtable_entries): New function. + (dfs_build_vbase_offset_vtbl_entries): Remove. + (build_vbase_offset_vtbl_entries): Reimplement. + (dfs_build_vcall_offset_vtbl_entries): Don't include virtuals that + were already handled in a primary base class vtable. + (build_vcall_offset_vtbl_entries): Adjust. + (build_rtti_vtbl_entries): Adjust. + * decl2.c (output_vtable_inherit): Use get_vtbl_decl_for_binfo. + * init.c (expand_virtual_init): Simplify. + * repo.c (repo_get_id): Use get_vtbl_decl_for_binfo. + * rtti.c (create_pseudo_type_info): Adjust calculation of vptr. + * search.c (BINFO_ACCESS): New macro. + (SET_BINFO_ACCESS): Likewise. + (dfs_access_in_type): Manipulate access_kinds, not access nodes. + (access_in_type): Likewise. + (dfs_accessible_p): Likewise. + (protected_accessible_p): Likewise. + (lookup_fnfields_1): Adjust documentation. + (dfs_mark_primary_bases): Move to class.c + (mark_primary_bases): Likewise. + (dfs_vbase_unmark): Remove. + (virtual_context): Use BINFO_FOR_VBASE. + (dfs_get_vbase_types): Simplify. + (dfs_build_inheritance_graph_order): New function. + (get_vbase_types): Use it. + * tree.c (debug_binfo): Use get_vtbl_decl_for_binfo. + + * tinfo.cc (get_vbase_offset): New function. + (__vmi_class_type_info::do_find_public_src): Use it. + (__vmi_class_type_info::do_dyncast): Likewise. + (__vmi_class_type_info::do_upcast): Likewise. + +2000-04-03 Zack Weinberg + + * lang-specs.h: Pass -fno-show-column to the preprocessor. + +2000-03-30 Nathan Sidwell + + * rtti.c (class_hint_flags): Rename flags. + (class_initializer): Remove flags. + (synthesize_tinfo_var): Combine offset and flags. Add flags + for __vmi_class_type_info. + (create_tinfo_types): Remove flags from __class_type_info and + __si_class_type_info. Merge flags and offset from + base_class_type_info. + * inc/cxxabi.h (__base_class_info): Merge offset and vmi_flags. + (__base_class_info::is_virtual_p): Adjust. + (__base_class_info::is_public_p): Adjust. + (__base_class_info::offset): New accessor. + (__class_type_info::details): Remove member. + (__class_type_info::__class_type_info): Lose details. + (__class_type_info::detail_masks): Remove. + (__si_class_type_info::__si_class_type_info): Lose details. + (__vmi_class_type_info::details): New member. + (__vmi_class_type_info::__vmi_class_type_info): Adjust. + (__vmi_class_type_info::detail_masks): New member. + * tinfo.cc (__class_type_info::do_upcast): Initialize result + with unknown_details_mask. + (__vmi_class_type_info::do_find_public_src): Adjust + (__vmi_class_type_info::do_dyncast): Adjust. + (__vmi_class_type_info::do_upcast): Set result details, if + needed. Adjust. + (__dynamic_cast): Temporarily #if out optimization. + +2000-03-29 Nathan Sidwell + + * rtti.c (get_tinfo_decl): Mark used. + (emit_tinfo_decl): Don't optimize polymorphic type_info. Only + mark as dealt with, if we output it. + +2000-03-28 Mark Mitchell + + * class.c: Reorganize to put virtual function table initialization + machinery at the end of the file. + +2000-03-28 Jason Merrill + + * class.c (finish_struct): Use bitsize_zero_node. + * pt.c (instantiate_class_template): Likewise. + +2000-03-28 Mark Mitchell + + Put RTTI entries at negative offsets in new ABI. + * class.c (dfs_build_vbase_offset_vtbl_entries): Put the first + vbase offset at index -3, not -1. + (build_vtabe_offset_vtbl_entries): Use unmarked_vtable_pathp, not + dfs_vtable_path_unmarked_real_bases_queue_p to walk bases. + (dfs_build_vcall_offset_vtbl_entries): Don't use skip_rtti_stuff. + (build_rtti_vtbl_entries): New function. + (set_rtti_entry): Remove. + (build_primary_vtable): Don't use it. + (build_secondary_vtable): Likewise. + (start_vtable): Remove. + (first_vfun_index): New function. + (set_vindex): Likewise. + (add_virtual_function): Don't call start_vtable. Do call + set_vindex. + (set_primary_base): Rename parameter. + (determine_primary_base): Likewise. + (num_vfun_entries): Don't use skip_rtti_stuff. + (num_extra_vtbl_entries): Include RTTI information. + (build_vtbl_initializer): Use build_rtti_vtbl_entries. + (skip_rtti_stuff): Remove. + (dfs_modify_vtables): Don't use it. + (modify_all_vtables): Don't use start_vtable. Do use set_vindex. + (layout_nonempty_base_or_field): Update size handling. + (create_vtable_ptr): Tweak. + (layout_class_type): Adjust parameter names. + (finish_struct_1): Simplify. + * cp-tree.h (CLASSTYPE_VSIZE): Tweak documentation. + (skip_rtti_stuff): Remove. + (first_vfun_index): New function. + (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. + (dfs_vtable_path_marked_real_bases_queue_p): Remove. + (marked_vtable_pathp): Declare. + (unmarked_vtable_pathp): Likewise. + * error.c (dump_expr): Use first_vfun_index to calculate vtable + offsets. + * rtti.c (build_headof): Look for RTTI at negative offsets. + (get_tinfo_decl_dynamic): Likewise. + (tinfo_base_init): Don't take the address of the TINFO_VTABLE_DECL + here. + (create_pseudo_type_info): Do it here instead. Adjust so that + vptr points at first virtual function. + * search.c (marked_vtable_pathp): Make it global. + (unmarked_vtable_pathp): Likewise. + (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. + (dfs_vtable_path_marked_real_bases_queue_p): Likewise. + (dfs_get_pure_virtuals): Don't use skip_rtti_stuff. + (get_pure_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + * tinfo.cc (__dynamic_cast): Look for vtable_prefix at appropriate + negative offset. + +2000-03-26 Richard Kenner + + * class.c (check_field_decl): Fix typo. + (build_vtbl_or_vbase_field): Don't clear DECL_SAVED_INSNS. + (check_methods): Likewise. + (check_field_decls): Likewise. + Use DECL_CONTEXT, not DECL_FIELD_CONTEXT. + * cp-tree.h (DECL_SHADOWED_FOR_VAR, DECL_TEMPLATE_RESULT): + Use DECL_RESULT_FLD, not DECL_RESULT. + * decl.c (xref_tag): Use DECL_TEMPLATE_RESULT. + * lex.c (identifier_type): Likewise. + * pt.c (determine_specialization, lookup_template_class): Likewise. + (tsubst_friend_function, tsubst_decl, instantiate_template): Likewise. + (resolve_overloaded_unification, more_specialized): Likewise. + * semantics.c (finish_member_declaration): Likewise. + * typeck.c (build_x_function_call): Likewise. + +2000-03-26 Mark Mitchell + + * class.c (layout_empty_base): Handle empty bases with non-byte + alignment. + (build_base_field): Likewise. + (layout_virtual_bases): Likewise. + + * class.c (finish_struct_1): Fix typo in this change: + + Sat Mar 25 09:12:10 2000 Richard Kenner + +2000-03-25 Mark Mitchell + + * decl.c (grokdeclarator): Count partial specializations when + keeping track of how many template classes have been seen. + + * dump.c (dequeue_and_dump): Dump DECL_TEMPLATE_RESULT. + +2000-03-25 Richard Kenner + + * class.c (build_vbase_pointer_fields): layout_field now place_field. + (get_vfield_offset): Use byte_position. + (set_rtti_entry): Set OFFSET to ssizetype zero. + (get_binfo_offset_as_int): Deleted. + (dfs_record_base_offsets): Use tree_low_cst. + (dfs_search_base_offsets): Likewise. + (layout_nonempty_base_or_field): Reflect changes in RLI format + and call byte_position. + (layout_empty_base): Convert offset to ssizetype. + (build_base_field): use rli_size_unit_so_far. + (dfs_propagate_binfo_offsets): Do computation in proper type. + (layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets. + (layout_class_type): Reflect changes in RLI names and fields. + (finish_struct_1): Set DECL_FIELD_OFFSET. + * dump.c (dequeue_and_dump): Call bit_position. + * expr.c (cplus_expand_constant): Use byte_position. + * rtti.c (expand_class_desc): Use bitsize_one_node. + * typeck.c (build_component_addr): Use byte_position and don't + special case for zero offset. + +2000-03-24 Nathan Sidwell + + * decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P. + + * rtti.c (get_tinfo_decl): Set comdat linkage on new-abi + tinfo object. + (emit_tinfo_decl): Only emit polymorphic tinfo's when emitting + vtable. + +2000-03-20 Theodore Papadopoulo + + * call.c (check_dtor_name, build_new_method_call): Use TYPE_P and + DECL_P macros. + * decl.c (push_class_binding, poplevel, pushtag, lookup_namespace_name, + make_typename_type, check_initializer, cp_finish_decl, + xref_tag): Likewise. + * decl2.c (grokfield, build_expr_from_tree, build_expr_from_tree, + decl_namespace, arg_assoc_template_arg, arg_assoc, + validate_nonmember_using_decl, do_class_using_decl): Likewise. + * error.c (dump_template_argument, dump_expr, cp_file_of, cp_line_of, + args_to_string): Likewise. + * friend.c (is_friend): Likewise. + * lex.c (note_got_semicolon, note_list_got_semicolon, + is_global): Likewise. + * method.c (build_overload_nested_name, build_overload_value, + build_qualified_name, build_qualified_name, hack_identifier): Likewise. + * parse.y (typename_sub, typename_sub1): Likewise. + * pt.c (push_inline_template_parms_recursive, check_template_shadow, + process_partial_specialization, convert_template_argument, + template_args_equal, add_pending_template, lookup_template_class, + for_each_template_parm_r, maybe_fold_nontype_arg, + tsubst, instantiate_template, type_unification_real, unify, + instantiate_pending_templates, set_mangled_name_for_template_decl): + Likewise. + * repo.c (repo_get_id, repo_template_used): Likewise. + * search.c (lookup_field_1): Likewise. + * tree.c (walk_tree, get_type_decl, cp_tree_equal, member_p): Likewise. + * xref.c (classname): Likewise. + +2000-03-22 Mark Mitchell + + * cp-tree.h (BINFO_FOR_VBASE): Adjust documentation. + (CANONICAL_BINFO): New macro. + (BINFO_NEW_VTABLE_MARKED): Use it. + (SET_BINFO_NEW_VTABLE_MARKED): Likewise. + (CLEAR_BINFO_NEW_VTABLE_MARKED): Likewise. + * class.c (dfs_build_vbase_offset_vtbl_entries): Use BINFO_TYPE, + not TREE_TYPE. + (build_primary_vtable): Adjust usage of BINFO_NEW_VTABLE_MARKED. + (build_secondary_vtable): Likewise. + (dfs_finish_vtbls): Likewise. + (dfs_accumulate_vtbl_inits): Likewise. + (accumulate_vtbl_inits): New function. + (finish_vtbls): Make sure that virtual bases come after + non-virtual bases in the vtable group. + (record_base_offsets): Don't save and restore TREE_VIA_VIRTUAL. + (finish_struct_1): Adjust usage of BINFO_NEW_VTABLE_MARKED. + * search.c (struct vbase_info): Move definition. + (marked_new_vtable_p): Adjust usage of BINFO_NEW_VTABLE_MARKED. + (unmarked_new_vtable_p): Likewise. + (dfs_mark_vtable_path): Remove. + (dfs_mark_new_vtable): Remove. + (dfs_unmark_new_vtable): Likewise. + (dfs_clear_search_slot): Likewise. + (dfs_find_vbases): Adjust usage of BINFO_NEW_VTABLE_MARKED. + (dfs_clear_vbase_slots): Likewise. + (init_vbase_pointers): LIkewise. + +2000-03-22 Jason Merrill + + * typeck.c (type_after_usual_arithmetic_conversions): Prefer a + SIZETYPE to a non-SIZETYPE. + +2000-03-21 Mark Mitchell + + * class.c (layout_virtual_bases): Adjust names in conditionally + compiled code. + + * class.c (record_base_offsets): New function. + (layout_conflict_p): Likewise. + (layout_nonempty_base_or_field): Use it. + (layout_empty_base): New function. + (build_base_field): Use it. + (build_base_fields): Update comment. + (layout_virtual_bases): Fold in a little code form + layout_basetypes. Use layout_empty_base. + (layout_basetypes): Remove. + (end_of_class): New function. + (layout_class_type): Use it. Adjust. + + * cp-tree.h (CLASSTYPE_VBASECLASSES): Fix typo in comment. + (fntype_p): Remove. + * search.c (dfs_skip_nonprimary_vbases_unmarkedp): Fix typo in + comment. + (dfs_skip_nonprimary_vbases_markedp): Likewise. + * typeck.c (fntype_p): Remove. + + * cp-tree.h (TI_SPEC_INFO): Remove. + (CLASSTYPE_TI_SPEC_INFO): Likewise. + * pt.c (process_partial_specialization): Likewise. + + * class.c (build_base_field): Fix thinko in computation of binfo + offsets. + + * tree.c (mark_local_for_remap_p): Mark variables declared in + TARGET_EXPRs as well. + +2000-03-21 Nathan Sidwell + + * typeck.c (require_complete_type, complete_type, + complete_type_or_else, c_sizeof, c_sizeof_nowarn, + build_array_ref, convert_arguments, pointer_diff, + build_x_unary_op, build_unary_op, build_c_cast, + build_modify_expr): Use COMPLETE_TYPE_P etc. + * call.c (is_complete, convert_like_real, + build_new_method_call): Likewise. + * class.c (build_vbase_pointer_fields, check_bases, + build_base_field, finish_struct_1, pushclass): Likewise. + * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. + * decl.c (maybe_process_template_type_declaration, pushtag, + pushdecl, redeclaration_error_message, start_decl, start_decl_1, + layout_var_decl, check_initializer, cp_finish_decl, + grokdeclarator, require_complete_types_for_parms, + grok_op_properties, xref_tag, xref_basetypes, + check_function_type): Likewise. + * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. + * friend.c (do_friend): Likewise. + * init.c (build_offset_ref): Likewise. + * parse.y (structsp): Likewise. + * pt.c (maybe_process_partial_specialization, + tsubst_friend_function, instantiate_class_template, tsubst, + do_type_instantiation, instantiate_pending_templates): Likewise. + * repo.c (repo_get_id): Likewise. + * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, + synthesize_tinfo_var, emit_support_tinfos): Likewise. + * search.c (lookup_fnfields_1, lookup_conversions): Likewise. + * semantics.c (begin_class_definition): Likewise. + * tree.c (build_cplus_method_type): Likewise. + * typeck2.c (digest_init, build_functional_cast, + add_exception_specifier): Likewise. + * parse.h, parse.c: Regenerated. + +2000-03-21 Nathan Sidwell + + * inc/cxxabi.h: New header file. Define new-abi entry points. + (__pointer_type_info::target): Rename member to ... + (__pointer_type_info::type): ... here. + (__base_class_info::type): Rename member to ... + (__base_class_info::base): ... here. + * Make-lang.in (CXX_EXTRA_HEADERS): Add cxxabi.h + * cp-tree.h (CPTI_ABI): New global tree enumeration. + (abi_node): New global tree node. + * decl.c (abi_node): Document. + (init_decl_processing): Initialize abi_node. + * rtti.c (build_dynamic_cast_1): Use abi_node for new-abi. + (get_vmi_pseudo_type_info): Likewise. + (create_tinfo_types): Likewise. + (emit_support_tinfos): Likewise. + * tinfo.h (cxxabi.h): Include for new-abi. + Move rtti class definitions to new header file. + * tinfo.cc (abi): Use the namespace. + (std): Move new abi rtti classes from here ... + (__cxxabiv1): ... to here. + * tinfo2.cc (cxxabi.h): Include for new-abi. + Move rtti class definitions to new header file. + (std): Move new abi rtti classes from here ... + (__cxxabiv1): ... to here. + * inc/typeinfo (__class_type_info): Move into __cxxabiv1 + namespace. + +2000-03-20 Jed Wing + Jason Merrill + + * method.c (build_overload_int): Use host_integerp. + +2000-03-20 Theodore Papadopoulo + + * init.c (build_offset_ref): Handle the case of a templated member + function. + +2000-03-19 Martin v. Löwis + + * except.c (expand_exception_blocks): Clear catch_clauses_last. + +2000-03-18 Mark Mitchell + + * cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro. + * class.c (check_bitfield_decl): Turn illegal bitfields into + non-bitfields. + (dfs_propagate_binfo_offsets): Adjust for new size_binop + semantics. + (dfs_offset_for_unshared_vbases): Likewise. + * cvt.c (cp_convert_to_pointer): Convert NULL to a + pointer-to-member correctly under the new ABI. + * expr.c (cplus_expand_constant): Don't use cp_convert when + turning an offset into a pointer-to-member. + * init.c (resolve_offset_ref): Don't adjust pointers-to-members + when dereferencing them under the new ABI. + * typeck.c (get_member_function_from_ptrfunc): Tweak calculation + of pointers-to-members under the new ABI. + + * class.c (check_bitfield_decl): Remove restriction on really long + bitfields. + (layout_class_type): Implement new ABI handling of bitfields + longer than their types. + +2000-03-18 Martin v. Löwis + + * parse.y (extdefs): Call ggc_collect. + * parse.c: Regenerated. + +2000-03-18 Nathan Sidwell + + * class.c (build_base_field): Use TYPE_ALIGN to examine a type. + (note_name_declared_in_class): Use OVL_CURRENT to get at a + potential overload. + +2000-03-17 Richard Kenner + + * class.c (build_vbase_path): Use integer_zerop. + (build_vtable_entry): Use tree_low_cst. + (get_vfield_offset): Use bit_position. + (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. + Use tree_low_cst. + (check_bitfield_decl): Set DECL_SIZE using convert. + (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. + (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. + Use tree_low_cst. + (finish_struct_1): Use bit_position. + (dump_class_hierarchy): Use tree_low_cst. + * cp-tree.h (min_precision): Add declaration. + * decl.c (xref_tag, xref_basetypes): Use tree_low_cst. + * error.c (dump_type_suffix): Use host_integerp and tree_low_cst. + (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. + * expr.c (cplus_expand_constant): Use bit_position. + * init.c (build_vec_init): Use host_integerp and tree_low_cst. + * rtti.c (get_base_offset): Use bit_position. + * typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, + host_integerp, and tree_low_cst. + (pointer_int_sum): Use integer_zerop. + (build_component_addr): Use bit_position. + +2000-03-17 Nathan Sidwell + + * typeck.c (require_complete_type): Don't assume size_zero_node. + (complete_type_or_else): Likewise. + +2000-03-16 Steven Grady + Jason Merrill + + * rtti.c (build_dynamic_cast_1): Improve diagnostics. + +2000-03-16 Nathan Sidwell + + * decl2.c (grokfield): Bail out if type is error_mark_node. + +2000-03-15 Nathan Sidwell + + * tinfo2.cc (__ptr_to_member_data): Rename to ... + (__pointer_to_member_data): ... here. Adjust. + * rtti.c (create_tinfo_types): Adjust. + +2000-03-15 Nathan Sidwell + + * cp-tree.h (CPTI_REF_DESC_TYPE, ref_desc_type_node): Remove. + * decl.c (ref_desc_type_node): Undocument. + * rtti.c (ptr_ref_initializer): Rename to ... + (ptr_initializer): ... here. Adjust comments. + (ptmd_initializer): Fix comment thinko. + (synthesize_tinfo_var): Remove REFERENCE_TYPE case. + (create_tinfo_types): Remove ref_desc_type_node init. + * tinfo2.cc (__reference_type_info): Remove. + +2000-03-15 Nathan Sidwell + + * decl.c (cp_finish_decl): Remove obsolete comment. + + * typeck.c (build_ptrmemfunc1): Kill uninitialized warning. + +2000-03-14 Mark Mitchell + + * cp-tree.h: Tweak documentation. + * class.c (build_vbase_pointer_fields): Layout the fields, too. + (avoid_overlap): Remove. + (get_binfo_offset_as_int): New function. + (dfs_serach_base_offsets): Likewise. + (layout_nonempty_base_or_field): Likewise. + (build_base_field): Layout fields here. Avoid placing two objects + of the same type at the same address, under the new ABI. + (build_base_fields): Adjust accordingly. + (create_vtable_ptr): Return the new field, but don't attach it to + TYPE_FIELDS. + (remove_base_field): Remove. + (remove_base_fields): Remove. + (layout_basetypes): Adjust accordingly. + (layout_class_type): Call layout_field for each field, rather than + just making a wholesale call to layout_type. + +2000-03-14 Jeff Sturm + + * except.c (expand_throw): Fix typo in _Jv_Sjlj_Throw. + +2000-03-13 Jason Merrill + + * decl.c (grokfndecl): Set TREE_NOTHROW if TYPE_NOTHROW_P. + + * except.c (dtor_nothrow): New fn. + (do_pop_exception): Use it. Take type parm. + (push_eh_cleanup): Take type parm. + (expand_start_catch_block): Pass it. + (build_eh_type_type_ref): Accept null type. + +2000-03-12 Mark Mitchell + + * cp-tree.h (revert_static_member_fn): Change prototype. + * decl.c (grokfndecl): Adjust call to revert_static_member_fn. + (grok_op_properties): Likewise. + (start_function): Likewise. + (revert_static_member_fn): Simplify. + * pt.c (check_explicit_specialization): Adjust call to + revert_static_member_fn. + +2000-03-11 Mark Mitchell + + * cp-tree.h (scope_kind): New type. + (tmpl_spec_kind): Likewise. + (declare_pseudo_global_level): Remove. + (pseudo_global_level_p): Rename to template_parm_scope_p. + (pushlevel): Remove declaration. + (begin_scope): New function. + (finish_scope): Likewise. + (current_tmpl_spec_kind): Likewise. + * decl.c (struct binding_level): Shorten parm_flag to 2 bits. + Shorten keep to 2 bits. Rename pseudo_global to template_parms_p. + Add template_spec_p. + (toplevel_bindings_p): Adjust. + (declare_pseudo_global_level): Remove. + (pseudo_global_level_p): Rename to template_parm_scope_p. + (current_tmpl_spec_kind): New function. + (begin_scope): Likewise. + (finish_scope): Likewise. + (maybe_push_to_top_level): Adjust. + (maybe_process_template_type_declaration): Likewise. + (pushtag): Likewise. + (pushdecl_nonclass_level): Likewise. + (lookup_tag): Likewise. + (grokfndecl): Handle member template specializations. Share + constructor and non-constructor code. + * decl2.c (check_classfn): Handle member template specializations. + * pt.c (begin_template_parm_list): Use begin_scope. + (begin_specialization): Likewise. + (end_specialization): Likewise. + (check_explicit_specialization): Use current_tmpl_spec_kind. + Handle member template specializations. + (end_template_decl): Use finish_scope. Remove call to + get_pending_sizes. + (push_template_decl_real): Remove bogus error message. + (tsubst_decl): Fix typo in code contained in comment. + (instantiate_template): Handle member template specializations. + (most_general_template): Likewise. + +2000-03-11 Gabriel Dos Reis + + * lex.c (whitespace_cr): Compress consecutive calls to warning(). + (do_identifier): Ditto for error(). + + * pt.c (convert_nontype_argument): Ditto for cp_error(). + (convert_template_argument): Ditto for cp_pedwarn(). + +2000-03-11 Jason Merrill + + * exception.cc (__check_null_eh_spec): New fn. + * except.c (expand_end_eh_spec): Call it if the spec is throw(). + +2000-03-10 Jason Merrill + + * decl.c (push_throw_library_fn): Take the FUNCTION_TYPE. + * except.c (expand_end_eh_spec): Add the return type. + * rtti.c (throw_bad_cast): Add the parmtypes. + (throw_bad_typeid): Likewise. + + * semantics.c (expand_stmt): Only leave out rtl for unused + artificials, and set DECL_IGNORED_P on them as well. + * decl.c (wrapup_globals_for_namespace): Likewise. + +2000-03-09 Nathan Sidwell + + * decl.c (maybe_commonize_var): Skip all artificial decls. + * pt.c (tsubst_decl): Don't copy TREE_ASM_WRITTEN. + +2000-03-10 Jason Merrill + + * lang-options.h, decl2.c: Add -fno-enforce-eh-specs. + * cp-tree.h: Declare flag_enforce_eh_specs. + * decl.c (store_parm_decls, finish_function): Check it. + + C library functions don't throw. + * Makefile.in (cfns.h): New target. + (except.o): Depend on it. + * Make-lang.in (cc1plus): Depend on cfns.gperf. + * cfns.gperf: New file. + * cfns.h: Generated. + * except.c: Include it. + (nothrow_libfn_p): New fn. + * decl.c (grokfndecl): Use it. + * cp-tree.h: Declare it. + + * decl.c (push_overloaded_decl_1, auto_function, + define_function): Lose. + (build_library_fn_1): New static fn. + (builtin_function): Use it. + (get_atexit_node): Use build_library_fn_ptr. + (build_library_fn, build_cp_library_fn, build_library_fn_ptr, + build_cp_library_fn_ptr, push_library_fn, push_cp_library_fn, + push_void_library_fn, push_throw_library_fn): New fns. + * cp-tree.h: Declare them. + (cp_tree_index): Remove CPTI_BAD_CAST, CPTI_BAD_TYPEID. + (throw_bad_cast_node, throw_bad_typeid_node): Lose. + * except.c (init_exception_processing, call_eh_info, do_pop_exception, + (expand_end_eh_spec, alloc_eh_object, expand_throw): Use above fns. + * rtti.c (build_runtime_decl): Lose. + (throw_bad_cast, throw_bad_typeid, get_tinfo_decl, + build_dynamic_cast_1, expand_si_desc, expand_class_desc, + expand_ptr_desc, expand_attr_desc, expand_generic_desc): Use above fns. + + * call.c (build_call): Remove result_type parm. + Call mark_used on unused artificial fns. + * init.c, method.c, typeck.c, except.c, rtti.c: Adjust. + +2000-03-09 Jason Merrill + + * call.c (build_call): Set TREE_NOTHROW on the CALL_EXPR as + appropriate. + * decl.c (define_function): Set TREE_NOTHROW on the FUNCTION_DECL. + * except.c (call_eh_info, alloc_eh_object, expand_throw): Set + TREE_NOTHROW or TREE_THIS_VOLATILE on the function as appropriate. + * rtti.c (build_runtime_decl, get_tinfo_decl, build_dynamic_cast_1, + expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, + expand_generic_desc): Likewise. + +2000-03-08 Nathan Sidwell + + * exception.cc (__cp_pop_exception): Cleanup the original object. + +2000-03-08 Nathan Sidwell + + * decl.c (grok_op_properties): Merge conversion to void warning + with other silly op warnings. + +2000-03-08 Jason Merrill + + * typeck2.c (process_init_constructor): Set TREE_PURPOSE of + array CONSTRUCTOR elements. Don't use expr_tree_cons. + +2000-03-08 Nathan Sidwell + + * decl.c (cp_make_fname_decl): New function. + (wrapup_globals_for_namespace): Don't emit unused static vars. + (init_decl_processing): Remove comment about use of + array_domain_type. Set make_fname_decl. + (cp_finish_decl): Remove __FUNCTION__ nadgering. + * semantics.c (begin_compound_stmt): Remove + current_function_name_declared flagging. + (expand_stmt): Don't emit unused local statics. + * typeck.c (decay_conversion): Don't treat __FUNCTION__ decls + specially. + +2000-03-08 Nathan Sidwell + + * typeck.c (convert_for_assignment): Don't look at array + initializer. + * call.c (convert_like_real): Likewise. + +2000-03-07 Jason Merrill + + Add initial support for '\uNNNN' specifier. + * lex.c (read_ucs): New fn. + (readescape, skip_white_space): Call it. + (is_extended_char, is_extended_char_1): New fns. + (utf8_extend_token): New fn, #if 0'd out. + (real_yylex): Treat extended chars like letters. + + * search.c (note_debug_info_needed): Walk the bases even if we + weren't deferring the type itself. + +2000-03-07 Kaveh R. Ghazi + + * decl2.c (finish_objects): Constify a char*. + + * method.c (emit_thunk): Likewise. + +2000-03-06 Nathan Sidwell + + * typeck.c (dubious_conversion_warnings): Look through + REFERENCE_TYPE. + +2000-03-06 Richard Kenner + + * class.c (dfs_modify_vtables): I is now unsigned. + (check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int. + (build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT. + * error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned. + * init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. + * method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned. + * typeck.c (build_binary_op, case TRUNC_DIV_EXPR): + Call integer_all_onesp. + * typeck2.c (process_init_constructor): Use compare_tree_int. + + * lang-specs.h (as): Don't call if -syntax-only. + +2000-03-06 Mark Mitchell + + * expr.c (cplus_expand_expr, case STMT_EXPR): Don't set + RTL_EXPR_HAS_NO_SCOPE after all. + +2000-03-05 Mark Mitchell + + * expr.c (cplus_expand_expr, case STMT_EXPR): Use + expand_start_stmt_expr and expand_end_stmt_expr directly. Set + RTL_EXPR_HAS_NO_SCOPE. + + * pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG a little + later. + + * dump.c (dequeue_and_dump): Dump SCOPE_NO_CLEANUPS_P. + +2000-03-05 Nathan Sidwell + + * call.c (convert_like): Macrofy. + (convert_like_with_context): New macro. + (convert_like_real): Renamed from convert_like. Add calling + context parameters, for diagnostics. Add recursive flag. Call + dubious_conversion_warnings for outer conversion. + (build_user_type_conversion): Use convert_like_with_context. + (build_over_call): Likewise. Don't warn about dubious + conversions here. Adjust convert_default_arg calls. + (convert_default_arg): Add context parameters for diagnostics. + Pass through to convert_like_with_context. + * cp-tree.h (convert_default_arg): Add context parameters. + (dubious_conversion_warnings): Prototype new function. + * typeck.c (convert_arguments): Adjust convert_default_arg call. + (dubious_conversion_warnings): New function, broken + out of convert_for_assignment. + (convert_for_assignment): Adjust. + +2000-03-03 Jason Merrill + + * decl2.c (key_method): Break out from... + (import_export_vtable, import_export_class): ...here. + + * decl.c (finish_function): Don't mess with flag_keep_inline_functions. + * decl2.c (finish_vtable_vardecl): Don't check decl_function_context. + + * search.c (note_debug_info_needed, dfs_debug_mark, + dfs_debug_unmarkedp): Uncomment. Adjust for new scheme. + * decl2.c (finish_vtable_vardecl): Call note_debug_info_needed. + +2000-03-03 Nathan Sidwell + + * decl.c (cp_finish_decl): Remove obsolete obstack comments, fix + typos. + +2000-03-02 Mark Mitchell + + * cp-tree.h (TYPE_NEEDS_DESTRUCTOR): Rename to ... + (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): ... this. + (TYPE_HAS_TRIVIAL_DESTRUCTOR): New macro. + (lang_type): Split gets_new into has_new and has_array_new. + (TYPE_VEC_NEW_USES_COOKIE): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (TYPE_GETS_NEW): Split into ... + (TYPE_HAS_NEW_OPERATOR): ... this, and ... + (TYPE_HAS_ARRAY_NEW_OPERATOR): ... this. + (DECL_ARRAY_DELETE_OPERATOR_P): New macro + (build_op_new_call): Don't declare. + (build_new_1): Likewise. + * call.c (build_op_new_call): Remove. + * class.c (check_bases): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR + instead of TYPE_NEEDS_DESTRUCTOR. + (finish_struct_bits): Likewise. + (add_implicitly_declared_members): Likewise. + (check_field_decl): Likewise. + (check_methods): Set TYPE_VEC_DELETE_TAKES_SIZE here, and set it + correctly under the new ABI. + * decl.c (start_decl_1): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR + instead of TYPE_NEEDS_DESTRUCTOR. + (initialize_local_var): Likewise. + (destroy_local_var): Likewise. + (cp_finish_decl): Likewise. + (register_dtor_fn): Likewise. + (grok_op_properties): Set TYPE_HAS_NEW_OPERATOR and + TYPE_HAS_ARRAY_NEW_OPERATOR, not TYPE_HAS_NEW. Don't set + TYPE_VEC_DELETE_TAKES_SIZE here. + (xref_basetypes): Set TYPE_HAS_NEW_OPERATOR and + TYPE_HAS_ARRAY_NEW_OPERATOR, not TYPE_HAS_NEW. + (store_parm_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (finish_destructor_body): Likewise. + (maybe_build_cleanup_1): Likewise. + * decl2.c (do_static_destruction): Likewise. + * init.c (build_new_1): Make it static. + (perform_member_init): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (expand_cleanup_for_base): Likewise. + (get_cookie_size): New function. + (build_new_1): Handle array-new cookies correctly under the new + ABI. + (build_vec_delete_1): Likewise. + (build_vec_init): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + (build_delete): Likewise. + (build_vec_delete): Handle array-new cookies correctly under the new + ABI. + * lex.c (do_identifier): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + * pt.c (instantiate_class_template): Set TYPE_HAS_NEW_OPERATOR and + TYPE_HAS_ARRAY_NEW_OPERATOR. + * ptree.c (print_lang_type): Check them. + * search.c (context_for_name_lookup): Fix typo in comment. + (tree_has_any_destructor_p): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. + * tree.c (break_out_cleanups): Likewise. + (build_cplus_array_test_1): Likewise. + (cp_build_qualified_type_real): Likewise. + * typeck.c (complete_type): Likewise. + + * g++spec.c (lang_specific_driver): Add -fnew-abi at the start of + the command-line, not the end. + +2000-03-01 Jason Merrill + + * pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG. + +2000-03-02 Tom Tromey + + * cp-tree.h (build_java_class_ref): Declare. + * init.c (build_java_class_ref): No longer static. + * except.c (expand_throw): Generate a Java-style `throw' if the + thrown object is a "Java" object. + (initialize_handler_parm): Generate a Java-style lookup of + exception info if the caught object is a "Java" object. + (catch_language, catch_language_init): New globals. + (decl_is_java_type): New function. + (expand_start_catch_block): Don't call push_eh_info() or + push_eh_cleanup() when handling a Java-style "catch". Pass Java + class reference to build_catch_block. + +2000-03-02 Richard Kenner + + * typeck.c (comptypes): Treat sizetype like its language equivalent. + +2000-03-01 Bernd Schmidt + + * typeck.c (maybe_warn_about_returning_address_of_local): Reorganize + to merge reference/pointer code and fix incorrect warnings. + +2000-02-29 Jason Merrill + + * search.c (protected_accessible_p): Use context_for_name_lookup. + + * init.c (construct_virtual_bases): Fix thinko. + * typeck.c (expand_ptrmemfunc_cst): Fix thinko. + +2000-03-01 Martin von Loewis + + * decl.c (current_function_decl): Move to toplev.c. + +2000-02-29 Nathan Sidwell + + * pt.c (fn_type_unification): Unify return type, whenever + provided. + (get_bindings_real): Only pass return type when necessary. + Remove explicit return type check. + * class.c (resolve_address_of_overloaded_function): Pass desired + return type to fn_type_unification. + +2000-02-28 Richard Kenner + + * class.c (build_vtbl_or_vbase_field, check_methods): Don't clear + DECL_FIELD_SIZE. + (check_bitfield_decl, check_field_decls): Set DECL_SIZE, not + DECL_FIELD_SIZE. + * rtti.c (expand_class_desc): Likewise. + * cp-tree.h (DECL_INIT_PRIORITY): Use underlying union name. + (THUNK_VCALL_OFFSET): Likewise. + (THUNK_DELTA): Reflect changes in ../tree.h. + +2000-02-28 Jason Merrill + + * search.c (protected_accessible_p): Also allow the access if + the member is public in DERIVED. Lose TYPE parm. + (friend_accessible_p): Lose TYPE parm. + (accessible_p): Adjust. + +2000-02-27 Richard Kenner + + * class.c (dfs_build_vtable_offset_vtbl_entries): Don't use size_binop + on things that are not sizes; ssize_binop deleted. + Call size_diffop when appropriate. + (dfs_build_vcall_offset_vtbl_entries): Likewise. + (build_primary_vtable, build_secondary_vtable): Likewise. + (dfs_set_offset_for_unshared_vbases, dfs_modify_vtables): Likewise. + Variable I is HOST_WIDE_INT. + (get_vfield_offset): Pass proper types to size_binop. + (size_extra_vtbl_entries, layout_virtual_bases): Likewise. + (finish_struct_1): Likewise. + (skip_rtti_stuff): Arg N is now pointer to signed. + (layout_class_type): Use size_zero_node. + * cp-tree.h (skip_rtti_stuff): Arg N is pointer to signed. + * cvt.c (cp_convert_to_pointer): Pass proper types to size_binop. + * decl.c (complete_arry_type): Pass proper types to size_binop. + (xref_basetypes): BINFO_OFFSET is sizetype. + * error.c (dump_expr): Don't use size_binop non-sizes. + * expr.c (cplus_expand_constant): Pass proper types to size_binop. + * init.c (construct_virtual_bases): Fix type error. + (build_vec_delete_1): Pass proper type to size_binop and don't + fold result. + * lex.c (cp_make_lang_type): BINFO_OFFSET is sizetype. + * rtti.c (get_base_offset): Pass proper type to size_binop. + * search.c (dfs_find_vbases): Fix type error. + (expand_upcast_fixups): Arg to skip_rtti_stuff is pointer to signed. + (dfs_get_vbase_types): BINFO_OFFSET is sizetype. + * tree.c (debug_binfo): Variable N is signed. + Use HOST_WIDE_INT_PRINT_DEC. + * typeck.c (comptypes): sizetype is same as equivalent integer type. + (c_sizeof, c_sizeof_nowarn, expr_sizeof): Use TYPE_SIZE_UNIT, + size_one_node and size_zero_node. + (c_alignof): Use size_one_node. + (build_component_addr): Pass proper types to size_binop. + (expand_ptrmemfunc_cst): Don't use size_binop on non-sizes. + +2000-02-26 Jason Merrill + + Implement class scope using-declarations for functions. + * class.c (handle_using_decl): Call add_method for used functions. + Use IDENTIFIER_CLASS_VALUE to check for conflicts. + (add_method): Used functions are hidden by local functions. + (check_bases_and_members): Handle using-decls before finalizing + CLASSTYPE_METHOD_VEC. + * call.c (add_function_candidate): Add ctype parm; if nonzero, + override the type of 'this' accordingly. + (add_template_candidate, add_template_candidate_real): Add ctype parm. + (convert_class_to_reference, build_user_type_conversion_1, + build_new_function_call, build_object_call, build_new_op, + build_new_method_call): Pass ctype parm. + + * search.c (lookup_member): Put rval_binfo, not basetype_path, in + the baselink. + * call.c (convert_class_to_reference, build_user_type_conversion_1, + build_new_function_call, build_object_call, build_new_op, + build_new_method_call, build_op_delete_call): Don't get basetype_path + from a baselink. + * typeck.c (build_component_ref): Likewise. + * init.c (build_offset_ref): Likewise. + (resolve_offset_ref): Don't call enforce_access. + Call build_scoped_ref. + * typeck2.c (build_scoped_ref): Simplify. Do nothing if it + would cause an error or if -pedantic. + * class.c (alter_access): Lose binfo parm. + +2000-02-26 Mark Mitchell + + * semantics.c (simplify_aggr_init_exprs_p): Don't walk into + types. + +2000-02-25 Alfred Minarik + + * rtti.c (get_vmi_pseudo_type_info): Move __vmi_class_type_info + pseudo_type_info creation into the std namespace + +2000-02-26 Mark Mitchell + + * cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF. + (import_export_class): Remove declaration. + * decl2.c (import_export_class): Make it static. + * dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR, + PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, + EXPR_WITH_FILE_LOCATION. + * lex.c (check_newline): Tweak filename/lineno setting. + * semantics.c (begin_while_stmt): Fix typo in comment. + +2000-02-26 Richard Kenner + + * lang-options.h (-fmessage-length=): Add missing option. + + * Make-lang.in (CXX_SRCS): Add .h files and sort list. + +2000-02-26 Zack Weinberg + + * Make-lang.in: Delete refs to LIBGCC2_DEPS. + +2000-02-25 Jim Wilson + + * optimize.c (expand_call_inline): Emit the return label before + evaluating the return value. + +2000-02-24 Mark Mitchell + + * lex.c (check_newline): Use push_srcloc and pop_srcloc, rather + than duplicating functionality here. + * optimize.c: Include input.h. + (expand_call_inline): Use push_srcloc and pop_srcloc. + * parse.y (maybe_cv_qualifier): Remove calls to emit_line_note. + * parse.c: Regenerated. + * Makefile.in (lex.o): Depend on input.h. + (optimize.o): Likewise. + +2000-02-24 Nathan Sidwell + + * decl.c (grokdeclarator): Diagnose qualifiers on non-member + function type, rather than ICE. + +2000-02-23 Jason Merrill + + * decl.c (grokdeclarator): Call decl_type_access_control. + * parse.y (parse_end_decl): Don't call decl_type_access_control if + decl is null. + +2000-02-23 Nathan Sidwell + + * decl.c (decls_match): Remove obsolete static member nadgering. + +2000-02-21 Martin v. Löwis + + * decl.c (grokdeclarator): Change ANSI to ISO. + * lex.c (consume_string, readescape, do_identifier): Likewise. + (parse_float, real_yylex): Likewise. + * parse.y (paren_expr_or_null, paren_cond_or_null): Likewise. + (unary_expr, new_initializer, cast_expr, primary, primary_no_id, + new_type_id, maybe_label_decls, simple_stmt, + for.init.statement): Likewise. + * pt.c (do_decl_instantiation, do_type_instantiation): Likewise. + * semantics.c (finish_named_return_value): Likewise. + * parse.c: Regenerate. + +2000-02-21 Mark Mitchell + + * cp-tree.h (CPTI_VTABLE_INDEX_TYPE): New macro. + (CPTI_CLASS_STAR_TYPE): Remove. + (vtable_index_type): Likewise. + (class_star_type_node): Remove. + (TYPE_PTRMEMFUNC_FN_TYPE): Adjust for the new ABI. + (build_binary_op_nodefault): Remove. + * call.c (build_new_op): Use build_binary_op instead of + build_binary_op_nodefault. + * decl.c (init_decl_processing): Remove class_star_type_node + initialization. Make delta_type_node ptrdiff_type_node under the + new ABI. Initialize vtable_index_type. + (build_ptrmemfunc_type): Build different structures for the new + ABI. + (build_enumerator): Use build_binary_op instead of + build_binary_op_nodefault. + * method.c (build_overload_value): Mangle pointers-to-members + appropriately under the new ABI. + * typeck.c (build_array_ref): Use build_binary_op instead of + build_binary_op_nodefault. + (get_member_function_from_ptrfunc): Adjust for the new ABI. + (build_binary_op_nodefault): Rename to ... + (build_binary_op): ... this. Remove old version. Adjust for + pointer-to-member comparisons under the new ABI. + (build_ptrmemfunc1): Remove dead code. Adjust for the new ABI. + (build_ptrmemfunc): Adjust for the new ABI. + (expand_ptrmemfunc_cst): Likewise. + (delta2_from_ptrmemfunc): Assert that we're not using the new ABI. + (pfn_from_ptrmemfunc): Adjust for the new ABI. + +2000-02-21 Gabriel Dos Reis + + * call.c (build_object_call): Compress consecutive calls to + cp_error. + (build_conditional_expr): Say 'ISO C++' not 'ANSI C++'. + (build_op_delete_call): Adjust message formatting. + + * class.c (check_bases): Compress consecutive calls to + cp_pedwarn. + (finish_struct_anon): Say 'ISO C++'. + + * decl.c (start_decl): Same here. + (grok_reference_init): Likewise. + (grokfndecl): Correct message formatting. + (grokfndecl): Improve diagnostic. + (check_static_variable_definition): Likewise. Say 'ISO C++' + (compute_array_index_type): Say 'ISO C++' + (create_array_type_for_decl): Compress consecutive calls to + cp_error. + (grokdeclarator): Say 'ISO C++' + (grok_op_properties): Likewise. + + * decl2.c (delete_sanity): Clairify diagnostic. + (check_member_template): Same here. + (grok_function_init): Use consistent terminology. + + * expr.c (do_case): Say 'ISO C++' + + * friend.c (do_friend): Compress consecutive calls to warning. + +2000-02-20 Mark Mitchell + + * cp-tree.h (merge_primary_and_secondary_vtables_p): New macro. + * class.c (build_secondary_vtable): Reorganize. Don't create a + new vtable under the new ABI. + (layout_vtable_decl): Don't add num_extra_vtbl_entries when + computing the size. + (build_vtbl_initializer): Don't return a CONSTRUCTOR; just return + the initializing elements. + (initialize_vtable): New function. + (dfs_finish_vtbls): Use it. + (dfs_accumulate_vtbl_inits): New function. + (finish_vtbls): Merge primary and secondary vtables under the new + ABI. + (finish_struct_1): Remove redundant call to layout_vtable_decl. + * init.c (expand_virtual_init): Deal with BINFO_VTABLEs that + aren't VAR_DECLs. + + * class.c (build_vtable): New function, split out from ... + (get_vtable_decl): ... here, and ... + (build_secondary_vtable): ... here. + + * pt.c (tsubst_decl): Fix formatting. + +2000-02-19 Richard Kenner + + * class.c (build_primary_vtable, layout_vtable_decl): Likewise. + (avoid_overlap, build_base_field): Likewise. + (build_base_field, build_base_fields, is_empty_class): + Test DECL_SIZE with integer_zero. + (layout_class_type): Set CLASSTYPE_SIZE_UNIT. + * cp-tree.h (struct lang_type): New field size_unit. + (CLASSTYPE_SIZE_UNIT): New macro. + * decl.c (init_decl_processing): Set DECL_SIZE_UNIT. + (cp_finish_decl): Delete -Wlarger-than processing. + * optimize.c (remap_decl): Walk DECL_SIZE_UNIT. + * pt.c (tsubst_decl): Set DECL_SIZE_UNIT. + * tree.c (make_binfo): binfo vector is one entry longer. + (walk_tree): Walk DECL_SIZE_UNIT. + +2000-02-19 Mark Mitchell + + * class.c (dfs_build_vcall_offset_vtbl_entries): Fix typo in + comment. + (build_vtable_entry): Don't assume all vtable entries are + functions. + (build_vtbl_initializer): Adjust accordingly. + (get_vtable_decl): Fix formatting. + +2000-02-18 Jason Merrill + + * semantics.c (deferred_type_access_control): Walk the entire + type_lookups list. + (save_type_access_control): Rename from + initial_deferred_type_access_control. Just remember the value. + (decl_type_access_control): New fn. + (begin_function_definition): Use deferred_type_access_control, after + we've started the function. Set type_lookups to error_mark_node. + * parse.y (frob_specs, fn.def1): Adjust. + (parse_decl0, parse_field, parse_field0, parse_bitfield): New fns. + (parse_end_decl, parse_bitfield0, parse_method): New fns. + (fn.def2, initdcl, initdcl0_innards, nomods_initdcl0): Use them. + (after_type_component_declarator0): Likewise. + (after_type_component_declarator): Likewise. + (notype_component_declarator): Likewise. + * cp-tree.h: Adjust. + + * decl.c (redeclaration_error_message): Allow redeclaration of + namespace-scope decls. + +2000-02-18 Martin von Loewis + + * typeck2.c (my_friendly_abort): Use GCCBUGURL. + +2000-02-17 Mark Mitchell + + * class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT. + * decl2.c (grokclassfn): Likewise. + + * ir.texi: Document DECL_TEMPLATE_INSTANTIATIONS. + + * decl2.c (lang_decode_option): Don't set default message length + here. + * lex.c (lang_init_options): Set it here. + +2000-02-16 Mark Mitchell + + Make DECL_CONTEXT mean the class in which a member function was + declared, even for a virtual function. + * cp-tree.h (DECL_CLASS_CONTEXT): Adjust. + (DECL_FRIEND_CONTEXT): New macro. + (DECL_REAL_CONTEXT): Remove. + (SET_DECL_FRIEND_CONTEXT): Likewise. + (DECL_VIRTUAL_CONTEXT): Adjust. + (DECL_CLASS_SCOPE_P): Use TYPE_P. + (add_friends): Remove. + (hack_decl_function_context): Likewise. + * call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with + CP_DECL_CONTEXT. + (build_over_call): Fix indentation. Use DECL_CONTEXT + instead of DECL_CLASS_CONTEXT. + * class.c (dfs_build_vcall_offset_vtbl_entries): Likewise. + (add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. + (strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT. + (build_base_field): Likewise. + (finish_struct_1): Likewise. + (build_self_reference): Likewise. + * decl.c (push_class_binding): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (pushtag): Use decl_function_context, not + hack_decl_function_context. + (decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. + (duplicate_decls): Use DECL_VIRTUAL_CONTEXT. + (pushdecl): Remove bogus code. + (start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT. + (cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. + (grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + Use decl_function_context, nothack_decl_function_context. + (grokvardecl): Don't set DECL_CLASS_CONTEXT. + (grokdeclarator): Likewise. Use decl_function_context, not + hack_decl_function_context. + (copy_args_p): Document. Don't use DECL_CLASS_CONTEXT. + (start_function): Use DECL_FRIEND_CONTEXT, not + DECL_CLASS_CONTEXT. Use decl_function_context, not + hack_decl_function_context. + (finish_function): Use decl_function_context, not + hack_decl_function_context. + (maybe_retrofit_in_chrg): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + (grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT. + (finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT. + (grokfield): Likewise. + (finish_builtin_type): Likewise. + (finish_vtable_vardec): Use decl_function_context, not + hack_decl_function_context. + (import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (start_static_initialization_or_destruction): Likewise. + (finish_static_initialization_or_destruction): Likewise. + (mark_used): Adjust logic for deciding when to synthesize methods. + * dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + * error.c (dump_function_decl): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + * friend.c (is_friend): Likewise. + (add_friends): Remove. + (do_friend): Use SET_DECL_FRIEND_CONTEXT. + * lex.c (begin_definition_of_inclass_inline): Use + decl_function_context, not hack_decl_function_context. + (process_next_inline): Likewise. + (do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. + * method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not + DECL_CLASSS_CONTEXT. + (hack_identifier): Likewise. + (synthesize_method): Use decl_function_context, not + hack_decl_function_context. + * pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (is_member_template): Use decl_function_context, not + hack_decl_function_context. Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + (build_template_decl): Set DECL_VIRTUAL_CONTEXT, not + DECL_CLASS_CONTEXT. + (check_default_tmpl_args): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (push_template_decl_real): Likewise. + (instantiate_class_template): Don't call add_friends. + (tsubst_default_argument): Use DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. + Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (set_meangled_name_for_template_decl): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + * repo.c (repo_inline_used): Likewise. + * search.c (current_scope): Adjust for new _CONTEXT macros. + (context_for_name_lookup): Use CP_DECL_CONTEXT, not + DECL_REAL_CONTEXT. + (friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. + (lookup_fnfields_here):Likewise. + (check_final_overrider): Likewise. + (init_vbase_pointers): Likewise. + (virtual_context): Likewise. + * semantics.c (finish_member_declaration): Just set DECL_CONTEXT. + (expand_body): Use decl_function_context, not + hack_decl_function_context. + * tree.c (hack_decl_function_context): Remove. + * typeck.c (build_x_function_call): Use DECL_CONTEXT, not + DECL_CLASS_CONTEXT. + * typeck2.c (error_not_base_type): Likewise. + +2000-02-15 Jason Merrill + + * decl.c (xref_tag): Don't SET_IDENTIFIER_NAMESPACE_VALUE. + +2000-02-16 Kaveh R. Ghazi + + * Make-lang.in (g++spec.o): Depend on $(GCC_H), not gcc.h. + +2000-02-15 Jonathan Larmour + + * lang-specs.h: Add new __GNUC_PATCHLEVEL__ define to default spec. + +2000-01-16 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Enable automatic line wrapping. + +2000-02-13 Jason Merrill + + * parse.y (frob_specs): Split out... + (parse_decl): From here. + (fn.def2): Call initial_deferred_type_access_control. + (after_type_component_declarator0): Call frob_specs. + (notype_component_declarator0): Likewise. + * search.c (friend_accessible_p): Nested classes are friends of their + enclosing classes. + +2000-02-10 Mark Mitchell + + * ir.texi (ADDR_EXPR): Document the fact that an ADDR_EXPR can be + used to create an implicit temporary. + + * class.c (dfs_modify_vtables): Tweak calculation of functions to + override. + +2000-02-08 Nathan Sidwell + + * typeck.c (strip_all_pointer_quals): Use TYPE_MAIN_VARIANT, to + strip array element qualifiers too. + +2000-02-07 Mark Mitchell + + * decl.c (store_parm_decls): Don't build cleanups for parameters + while processing_template_decl. + +2000-02-07 Jason Merrill + + * cp-tree.h (struct saved_scope): Add incomplete field. + (namespace_scope_incomplete): New macro. + * decl.c (pushdecl): Use it. + (hack_incomplete_structures): Use it. See through artificial + binding levels. + (mark_saved_scope): Mark it. + + Implement access control for nested types. + * search.c (type_access_control): New fn. + (accessible_p): Now we do perform access control for types. + * semantics.c (deferred_type_access_control): New fn. + (initial_deferred_type_access_control): New fn. + (begin_function_definition): Call it. Add lookups parm. + * decl.c (struct binding_level): Add this_class field. + (pushlevel_class): Set it. + (mark_binding_level): Mark it. + (lookup_name_real): Use it. Call type_access_control. + (mark_saved_scope): Mark lookups field. + * cp-tree.h (flagged_type_tree): Add lookups field. + (struct saved_scope): Add lookups field. + (type_lookups): New macro. + * parse.y (declmods): Now . + (parse_decl): Add lookups parm. Call + initial_deferred_type_access_control. + (lang_extdef): Clear type_lookups. + (typed_declspecs, declmods, typespec): Set lookups field. + (initdcl): Call deferred_type_access_control. + (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, + component_decl_1, named_parm): Adjust. + * friend.c (is_friend): Nested classes are friends of their + enclosing classes. + + * class.c (currently_open_derived_class): New fn. + * method.c (hack_identifier): Use it. + + * lex.c (do_identifier): Remove obsolete code. + + * parse.y (typed_typespecs): Propagate new_type_flag properly. + +2000-02-05 Zack Weinberg + + * tinfo.h: Remove apostrophes from C++ comment (xgettext + thinks this file is plain C). + +2000-02-05 Kaveh R. Ghazi + + * Makefile.in (call.o): Depend on $(EXPR_H). + + * call.c: Include "expr.h". + + * class.c (dump_class_hierarchy): Add prototype. + + * search.c (dfs_get_pure_virtuals): Likewise. + +2000-02-1 Ulrich Drepper + + * parse.y (simple_stmt): Allow :: token in asm parameter list. + * parse.c: Rebuilt. + +2000-01-31 Jim Wilson + + * class.c (build_vtbl_or_vbase_field): New parameter fcontext. + Store it in DECL_FCONTEXT. + (build_vbase_pointer_fields, create_vtable_ptr): Fix callers. + +2000-01-31 Jason Merrill + + * tinfo.h (old abi): #include "tconfig.h". + * tinfo.cc (convert_to_base): Move into old abi section. + +2000-01-31 Mark Mitchell + + * cp-tree.h (BINFO_VIRTUALS): Tweak documentation. + (CLASSTYPE_PRIMARY_BINFO): Use BINFO_PRIMARY_BINFO. + (BINFO_PRIMARY_BINFO): New macro. + (BF_DELTA): Rename to ... + (BV_DELTA): ... this. + (BF_VCALL_INDEX): Rename to ... + (BV_VCALL_INDEX): ... this. + (BF_FN): Rename to ... + (BV_FN): ... this. + * class.c (build_vbase_path): Adjust for changes to reverse_path. + (set_rtti_entry): Rename BF_ macros to BV_ variants. + (modify_vtable_entry): Simplify. + (add_virtual_function): Rename BF_ macros to BV_ variants. + (build_vtable_initializer): Likewise. + (get_class_offset_1): Remove. + (dfs_get_class_offset): Likewise. + (get_class_offset): Likewise. + (dfs_find_final_overrider): New function. + (find_final_overrider): Likewise. + (modify_one_vtable): Remove. + (dfs_find_base): New function. + (dfs_modify_vtables): Fold modify_one_vtable in here. Use + find_final_overrider. + (modify_all_vtables): Adjust. Set BV_VCALL_INDEX on new + virtuals. + (dfs_fixup_vtable_deltas): Remove. + (override_one_vtable): Remove. + (merge_overrides): Likewise. + (layout_virtual_bases): Make sure BINFO_OFFSET is set right for + unreal chilren of virtual bases. + (finish_struct_1): Don't use merge_overrides. Don't use + dfs_fixup_vtable_deltas. + * tree.c (reverse_path): Return a TREE_LIST, not a chain of + BINFOs. + +2000-01-31 Herman A.J. ten Brugge + Jason Merrill + + * tinfo.h: Rename USItype to myint32, depend on BITS_PER_UNIT. + +2000-01-31 Alfred Minarik + + * exception.cc (__throw_bad_typeid): Add missing std::. + +2000-01-31 Kaveh R. Ghazi + + * cp-tree.h (make_thunk): PROTO -> PARAMS. + +2000-01-31 Nathan Sidwell + + * cp-tree.h (new_abi_rtti_p): Use flag_new_abi. + + Runtime support for new-abi rtti. + * inc/typeinfo (type_info::operator!=): Define in class. + (type_info::before, type_info::name, type_info::operator==, + type_info::operator!=): Define new ABI implementations. + (type_info::is_pointer_p, type_info::is_function_p): Declare + new virtual functions. + (type_info::do_catch, type_info::do_upcast): Likewise. + + * tinfo.h (__base_class_info): Define new class. + (__class_type_info): Likewise. + (__si_class_type_info): Likewise. + (__vmi_class_type_info): Likewise. + (__dynamic_cast): Prototype. + + * tinfo.cc: Conditionalize old and new rtti mechanisms. + (type_info::is_pointer_p): Define new function. + (type_info::is_function_p): Likewise. + (type_info::do_catch): Likewise. + (type_info::do_upcast): Likewise. + (vtable_prefix): New structure for vtable access. + (adjust_pointer): Define new template function. + (contained_p, public_p, virtual_p, contained_public_p, + contained_nonpublic_p, contained_nonvirtual_p): Define new + functions. + (nonvirtual_base_type): New local variable. + (__class_type_info::~__class_type_info): Define. + (__si_class_type_info::~__si_class_type_info): Likewise. + (__vmi_class_type_info::~__vmi_class_type_info): Likewise. + (__class_type_info::do_catch): Define new function. + (__class_type_info::do_upcast): Likewise. + (__class_type_info::find_public_src): Likewise. + (__class_type_info::do_find_public_src): Likewise. + (__si_class_type_info::do_find_public_src): Likewise. + (__vmi_class_type_info::do_find_public_src): Likewise. + (__class_type_info::do_dyncast): Likewise. + (__si_class_type_info::do_dyncast): Likewise. + (__vmi_class_type_info::do_dyncast): Likewise. + (__class_type_info::do_upcast): Likewise. + (__si_class_type_info::do_upcast): Likewise. + (__vmi_class_type_info::do_upcast): Likewise. + (__dynamic_cast): Likewise. + + * tinfo2.cc (__fundamental_type_info): Define new class. + (__pointer_type_info): Likewise. + (__reference_type_info): Likewise. + (__array_type_info): Likewise. + (__function_type_info): Likewise. + (__enum_type_info): Likewise. + (__ptr_to_member_type_info): Likewise. + (__fundamental_type_info::~__fundamental_type_info): Define. + (__pointer_type_info::~__pointer_type_info): Likewise. + (__reference_type_info::~__reference_type_info): Likewise. + (__array_type_info::~__array_type_info): Likewise. + (__function_type_info::~__function_type_info): Likewise. + (__enum_type_info::~__enum_type_info): Likewise. + (__ptr_to_member_type_info::~__ptr_to_member_type_info): Likewise. + (__pointer_type_info::do_catch): Define new function. + (__ptr_to_member_type_info::do_catch): Define new function. + + (__throw_type_match_rtti_2): Use new ABI interface, if enabled. + (__is_pointer): Likewise. + + * exception.cc (__cplus_type_matcher): Deal with new-abi rtti. + +2000-01-30 Mark Mitchell + + * cp/class.c (build_vtable): Rename to build_primary_vtable. + (prepare_fresh_vtable): Rename to build_secondary_vtable. + (make_new_vtable): New function. + (modify_vtable_entry): Handle generation of new vtables correctly. + (modify_one_vtable): Remove unused parameter. + (dfs_fixup_vtable_deltas): Likewise. + (override_one_vtable): Use build_secondary_vtable. + (finish_struct_1): Use build_primary_vtable and + build_secondary_vtable. + +2000-01-28 Ulrich Drepper + + * cp/decl.c: Adjust variable names, comments, help strings. + +2000-01-29 Nathan Sidwell + + * new2.cc (operator delete[]): Use operator delete, don't assume + implementation. + +2000-01-29 Nathan Sidwell + + * class.c (build_vtbl_initializer): Add argument to + build_vtable_entry call. + +2000-01-27 Mark Mitchell + + * cp-tree.def (THUNK_DECL): Discuss vcall indices. + * cp-tree.h (BINFO_VIRTUALS): Update documentation. + (BF_DELTA): New macro. + (BF_VCALL_INDEX): Likewise. + (BF_FN): Likewise. + (THUNK_VCALL_OFFSET): Likewise. + (make_thunk): Change prototype. + * class.c (build_vtable_entry): Integrate + build_vtable_entry_for_fn. Handle vcall indices. + (build_vtable_entry_for_fn): Remove. + (set_rtti_entry): Handle vcall indices. Use BF_DELTA, + BF_VCALL_INDEX, BF_FN. + (modify_vtable_entry): Integrate common code from + modify_one_vtable and dfs_fixup_vtable_deltas. + (add_virtual_function): Set BF_VCALL_INDEX. + (build_vtbl_initializer): Simplify. Use BF_DELTA, BF_VCALL_INDEX, + and BF_FN. + (modify_one_vtable): Simplify. + (dfs_fixup_vtable_deltas): Likewise. + (override_one_vtable): Use BF_DELTA, BF_VCALL_INDEX, BF_FN. + * method.c (make_thunk): Handle vcall indices. + +2000-01-28 Nathan Sidwell + + Compiler side new abi rtti (not enabled). + * cp-tree.h (new_abi_rtti_p): New macro. + (emit_support_tinfos): Prototype new function. + (tinfo_decl_p): Likewise. + (emit_tinfo_decl): Likwise. + * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL): New accessor + macros. + (doing_runtime): New local static. + (init_rtti_processing): Add new-abi initializer. + (get_tinfo_decl): Add new-abi logic. + (tinfo_from_decl): Likewise. + (build_dynamic_cast_1): Likewise. + (qualifier_flags): New static function. + (tinfo_base_init): Likewise. + (generic_initializer): Likewise. + (ptr_ref_initializer): Likewise. + (ptmd_initializer): Likewise. + (class_hint_flags): Likewise. + (class_initializer): Likewise. + (synthesize_tinfo_var): Likewise. + (create_real_tinfo_var): Likewise. + (create_pseudo_type_info): Likewise. + (get_vmi_pseudo_type_info): Likewise. + (create_tinfo_types): Likewise. + (emit_support_tinfos): New global function. + (tinfo_decl_p): New global predicate. + (emit_tinfo_decl): New global function. + * class.c (set_rtti_entry): Generalize for old and new rtti. + (build_vtbl_initializer): Likewise. + * decl2.c (finish_file): Likewise. + +2000-01-27 Jim Wilson + + * optimize.c (remap_decl): Add walk_tree calls for DECL_SIZE (t) + and TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))). + +2000-01-27 Mike Stump + + * decl.c (pushdecl): Fix up shadow warnings with respect to implicit + for scopes. + +2000-01-26 Jason Merrill + + * pt.c (unify): Use fold, not maybe_fold_nontype_arg. + +2000-01-26 J"orn Rennecke + + * optimize.c (calls_setjmp_r): Supply new argument + to special_function_p. + +2000-01-26 Kaveh R. Ghazi + + * call.c: PROTO -> PARAMS. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * decl.c: Likewise. + * decl.h: Likewise. + * decl2.c: Likewise. + * dump.c: Likewise. + * errfn.c: Likewise. + * error.c: Likewise. + * except.c: Likewise. + * expr.c: Likewise. + * init.c: Likewise. + * input.c: Likewise. + * lex.c: Likewise. + * lex.h: Likewise. + * method.c: Likewise. + * optimize.c: Likewise. + * parse.y: Likewise. + * pt.c: Likewise. + * repo.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + * xref.c: Likewise. + +2000-01-25 Richard Henderson + + * typeck.c (build_binary_op_nodefault): Remove UNNE_EXPR. + +2000-01-25 Mark Mitchell + + * cp-tree.h (vcall_offset_in_vtable_p): New macro. + * class.c (build_vbase_offset_vtbl_entries): Fix typo in commment. + (struct vcall_offset_data_s): New type. + (dfs_vcall_offset_queue_p): New function. + (dfs_build_vcall_offset_vtbl_entries): Likewise. + (build_vcall_offset_vtbl_entries): Likewise. + (layout_vtable_decl): Likewise. + (num_vfun_entries): Likewise. + (num_extra_vtbl_entries): Add the entries for vcall offsets. + (build_vtbl_initializer): Likewise. + (dfs_finish_vtabls): Use layout_vtable_decl. + (modify_one_vtables): Always duplicate vtables under the new ABI. + (finish_struct_1): Use layout_vtable_decl. + +2000-01-25 Kaveh R. Ghazi + + * decl.c (member_function_or_else): Change third arg from a format + specifier to an `enum overload_flags'. Callers changed. + +2000-01-25 Gabriel Dos Reis + + * typeck.c (composite_pointer_type, c_sizeof, expr_sizeof, + build_binary_op_nodefault, build_unary_op, build_reinterpret_cast, + build_const_cast, get_delta_difference, check_return_expr): Avoid + ANSI string concatenation usage. + +2000-01-24 Mark Mitchell + + * class.c (layout_class_type): Put the fields required to make a + class non-empty at the end, not the beginning, of the TYPE_FIELDs + list. + +2000-01-24 Jason Merrill + + * pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a + template. + + * decl2.c (mark_used): Do instantiate inlines that have been + explicitly instantiated. + +2000-01-24 Richard Henderson + + * call.c (build_over_call): Use expand_tree_builtin. + * typeck.c (build_function_call_real): Likewise. + (build_binary_op_nodefault): Handle unordered compares. + +2000-01-24 Nathan Sidwell + + * cp-tree.h (CPTI_BAD_CAST, CPTI_BAD_TYPEID, CPTI_DCAST): New + cp_tree_index values. + (throw_bad_cast_node, throw_bad_typeid_node, dynamic_cast_node): + New global node #defines for them. + * rtti.c (call_void_fn): Replace with ... + (build_runtime_decl): ... new static function. + (throw_bad_cast): Use throw_bad_cast_node and build_runtime_decl. + (throw_bad_typeid): Use throw_bad_typeid_node and build_runtime_decl. + (build_dynamic_cast_1): Always produce correctly typed result. + Explicitly produce type_info addresses. Use dynamic_cast_node. + * exception.cc (__throw_bad_cast): Return `void *'. + (__throw_bad_typeid): Return `const type_info &'. + +2000-01-24 Nathan Sidwell + + * cp-tree.h (get_vtable_decl): Prototype new function. + * class.c (get_vtable_decl): New function. Broken out from ... + (build_vtable): ... here. Use it. + * decl2.c (finish_vtable_vardecl): Ignore dummy vtables created + by get_vtable_decl. + +2000-01-24 Nathan Sidwell + + * cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE, + CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE, + CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations. + (CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE, + CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE, + CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations. + (CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ... + (CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here. + (CPTI_TINFO_VAR_ID): New enumeration. + (__tp_desc_type_node, __access_mode_type_node, + __bltn_desc_type_node, __user_desc_type_node, + __class_desc_type_node, __ptr_desc_type_node, + __attr_desc_type_node, __func_desc_type_node, + __ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines. + (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node, + ref_desc_type_node, ary_desc_type_node, func_desc_type_node, + enum_desc_type_node, class_desc_type_node, + si_class_desc_type_node, vmi_class_desc_type_node, + ptmd_desc_type_node, base_desc_type_node): New #defines. + (tinfo_fn_id, tinfo_fn_type): Rename to ... + (tinfo_decl_id, tinfo_decl_type): ... here. Adjust. + (tinfo_var_id): New enumeration. + (DECL_TINFO_FN_P): Augment comment. + * decl.c (cp_global_trees): Adjust documentation. + * rtti.c (init_rtti_processing): Adjust for tinfo_decl_id, + tinfo_decl_type and tinfo_var_id. + (get_tinfo_decl_dynamic): Adjust for tinfo_decl_type. + (build_typeid): Remove unused variable. + (get_tinfo_var): Use tinfo_var_id. + (tinfo_name): New static function. + (get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type. + (tinfo_from_decl): Likewise. + (get_base_offset): New static function, broken out of + expand_class_desc. + (expand_si_desc): Use tinfo_name. + (expand_class_desc): Likewise. Lose local static variable. + Use base_desc_type_node. Use get_base_offset. + (expand_ptr_desc): Use tinfo_name. + (expand_attr_desc): Likewise. + (expand_generic_desc): Likewise. + + * tinfo.cc (__GXX_ABI_VERSION): Test value and existence. + * tinfo.h (__GXX_ABI_VERSION): Test value and existence. + +2000-01-23 Mark Mitchell + + * cp-tree.h (__eprintf): Remove declaration. + * tree.c (__eprintf): Remove definition. + +2000-01-23 Zack Weinberg + Mark Mitchell + + * cp-tree.h (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N, + CLEAR_CLASSTYPE_MARKED_N): Avoid signed vs. unsigned warnings. + +2000-01-23 Brad Lucier + + * class.c (dump_class_hierarchy): Print HOST_WIDE_INT properly. + +2000-01-23 Mark Mitchell + + * cp-tree.h (register_dtor_fn): New function. + * decl.c (destroy_local_static): Rename to ... + (register_dtor_fn): ... this. Give it external linkage. + (expand_static_init): Use it. + * decl2.c (do_static_initialization): Likewise, if using + __cxa_atexit. + (do_static_destruction): Check that __cxa_atexit is not in use. + (finish_file): Don't call do_static_destruction if using + __cxa_atexit. + + * typeck.c (convert_arguments): Restore two-message error + reporting. + +2000-01-20 Nathan Sidwell + + Remap dynamic cast hint values to be consistent across ABIs. + * search.c (dynamic_cast_base_recurse): Remap generated value. + (get_dynamic_cast_base_type): Adjust documentation. + * tinfo.h (__user_type_info::dyncast): Likewise. + (__user_type_info::find_public_subobj): Remap BOFF meaning. + * tinfo.cc (__si_type_info::do_dyncast): Remap BOFF meaning. + (__class_type_info::do_dyncast): Likewise. + (__class_type_info::do_find_public_subobj): Likewise. + * tinfo2.cc (__dynamic_cast): Remap BOFF parameter. + +2000-01-19 Gabriel Dos Reis + + * typeck.c (build_unary_op): Use cp_pedwarn, not pedwarn. + + * typeck2.c (incomplete_type_error): Restore previous + cp_error and cp_error_at call sequence. + +2000-01-20 Brad Lucier + + * class.c (dump_class_hierarchy): Make format agree with argument; + cast pointer to unsigned long and print with %lx. + +2000-01-19 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Set default line-wrap length to 72. + + * typeck.c (composite_pointer_type, common_type, + comp_target_parms, c_sizeof, expr_sizeof, build_array_ref, + build_function_call_real, convert_arguments, + build_binary_op_nodefault, pointer_int_sum, pointer_diff, + build_unary_op, mark_addressable, build_compound_expr, + build_static_cast, build_reinterpret_cast, build_const_cast, + build_c_cast, build_modify_expr, get_delta_difference, + build_ptrmemfunc, check_return_expr): Replace 'ANSI C++' with + 'ISO C++'. Fusion consecutive calls to diagnostic message routines + into a single one. + * typeck2.c (readonly_error, abstract_virtuals_error, + process_init_constructor, check_for_new_type): Likewise. + +2000-01-19 Mark Mitchell + + * tree.c (bot_manip): Set DECL_CONTEXT for newly created + VAR_DECLs. + +2000-01-18 Nathan Sidwell + + * cp-tree.h (get_tinfo_fn_dynamic): Remove prototype. + (build_x_typeid): Likewise. + (get_tinfo_fn): Likewise. + (get_tinfo_fn_unused): Rename to ... + (get_tinfo_decl): ... here. + * rtti.c (build_headof): Replace logic error with assertion. + (get_tinfo_fn_dynamic): Rename to ... + (get_tinfo_decl_dynamic): ... here. Make static. Use + complete_type_or_else. + (build_x_typeid): Move into ... + (build_typeid): ... here. Adjust call to + get_tinfo_decl_dynamic. Use tinfo_from_decl. Simplify + throw_bad_typeid expression. + (get_tinfo_fn_unused): Rename to ... + (get_tinfo_decl): ... here. Adjust comment. + (get_tinfo_fn): Delete. + (tinfo_from_decl): New static function. + (get_typeid_1): Call get_tinfo_decl and tinfo_from_decl. + (get_typeid): Use complete_type_or_else. + (build_dynamic_cast_1): Adjust calls to + get_tinfo_decl_dynamic. Simplify throw_bad_cast expression. + * parse.y (primary): Adjust call to build_typeid. + * except.c (build_eh_type_type_ref): Adjust call to + get_tinfo_decl. Mark as used. + * class.c (set_rtti_entry): Adjust call to get_tinfo_decl. + * decl2.c (build_expr_from_tree): Adjust call to build_typeid. + * parse.c: Regenerated. + +2000-01-17 Mark Mitchell + + * class.c (fixed_type_or_null): Don't clear NONNULL. Document + calling convention. + (resolves_to_fixed_type_p): Document calling convention. + * rtti.c (build_x_typeid): Initialize NONNULL. + + * cp-tree.h (build_shared_int_cst): New function. + * call.c (build_over_call): Use DECL_VIRTUAL_CONTEXT, for clarity. + * class.c (modify_vtable_entry): Likewise. + (add_virtual_function): Split out code to generated shared + INTEGER_CSTs to build_share_int_cst. + (modify_all_vtables): Handle all the overridden functions here. + Add overridden functions from non-primary virtual bases to the + primary vtable. + (finish_struct_1): Adjust call to modify_all_vtables. Add + overridden functions from non-primary bases to the vtable. + * tree.c (build_shared_int_cst): New function. + + * cp-tree.h (scratchalloc): Remove. + (build_scratch_list): Likewise. + * call.c (convert_class_to_reference): Replace build_scratch_list + and build_expr_list with build_tree_list. + (add_candidate): Replace scratchalloc with expralloc. Note memory + leak. + (build_user_type_conversion_1): Replace build_scratch_list + and build_expr_list with build_tree_list. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + (convert_like): Likewise. + * cvt.c (ocp_convert): Likewise. + * decl.c (start_decl): Likewise. + (start_function): Likewise. + (finish_destructor_body): Likewise. + (maybe_build_cleanup_1): Likewise. + * decl2.c (reparse_decl_as_expr): Likewise. + * init.c (perform_member_init): Likewise. + (expand_cleanup_for_base): Likewise. + (build_builtin_delete_call): Likewise. + (build_new_1): Likewise. + (build_delete): Likewise. + * method.c (do_build_assign_ref): Likewise. + * parse.y (already_scoped_stmt): Likewise. + (nontrivial_exprlist): Likewise. + (net_initializer): Likewise. + (initlist): Likewise. + * parse.c: Regenerated. + * rtti.c (build_x_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + * typeck.c (build_x_compound_expr): Likewise. + (build_static_cast): Likewise. + (build_modify_expr): Likewise. + + * cp-tree.h (DECL_VINDEX): Add documentation. + * class.c (build_vtable_entry): Likewise. + (start_vtable): Add comment. + (add_virtual_function): Replace pending_hard_virtuals with + overridden_virtuals and pending_virtuals with new_virtuals. + Replace redundant assignments with assertions. + (check_for_override): Add comment. + (check_bases_and_members): Replace pending_hard_virtuals with + overridden_virtuals and pending_virtuals with new_virtuals. + (create_vtbl_ptr): Likewise. + (layout_class_type): Likewise. + (finish_struct_1): Likewise. Add comments. + +2000-01-16 Mark Mitchell + + * class.c (finish_struct_1): Replace redundant code with + assertions. + + * cp-tree.h (flag_new_abi): Move. + (flag_use_cxa_atexit): Likewise. + (flag_honor_std): Likewise. + (flag_rtti): Likewise. + (vbase_offsets_in_vtable_p): Define. + (vptrs_present_everywhere_p): Likewise. + (TYPE_CONTAINS_VPTR_P): Likewise. + (dfs_walk_real): Declare. + * class.c (build_vbase_pointer_fields): Check + vbase_offsets_in_vtable_p. + (dfs_build_vbase_offset_vtbl_entries): Record the vbase indices in + BINFO_VPTR_FIELD. + (build_vbase_offset_vtbl_entries): Simplify. + (build_vbase_offset_vtbl_entries): Adjust. + (build_vbase_pointer): Add ability to look up vbase offsets in + vtable. + (start_vtable): New function. + (add_virtual_function): Use it. + (determine_primary_base): Use TYPE_CONTAINS_VPTR_P. + (num_extra_vtbl_entries): Use vbase_offsets_in_vtable_p. + (build_vtbl_initializer): Take the type of the complete object as + input. Use it to correctly calculate vbase offsets. + (dfs_finish_vtbls): Pass the complete type to + build_vtbl_initializer. + (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P. + (create_vtable_ptr): Create a vtable even if there are no + new virtual functions, under the new ABI. + (finish_struct_1): Likewise. + (get_vfield_name): Use TYPE_CONTAINS_VPTR_P. + * decl.c (exapnd_static_init): Remove call to + preserve_initializer. + * decl2.c (mark_vtable_entries): Tweak to handle vbase offsets in + vtables. + * init.c (initialize_vtbl_ptrs): Initialize them in pre-order. + (expand_virtual_init): Use vbase_offsets_in_vtable_p. + (construct_virtual_bases): Don't initialize virtual base pointers + under the new ABI. + (build_aggr_init): Clean up comment. + (expand_aggr_init_1): Likewise. + * rtti.c (expand_class_desc): Store the virtual function table + index where the vbase offset lives in the offset field. + * search.c (dfs_walk_real): Make it global. + (dfs_debug_mark): Use TYPE_CONTAINS_VPTR_P. + * tree.c (make_binfo): Don't clear BINFO_VPTR_FIELD. + + * tinfo.h (USItype): Make it signed under the new ABI. + * tinfo.cc (convert_to_base): New function. Encapsulate base + conversion logic here. + (__class_type_info::do_upcast): Use it. + (__class_type_info::do_dyncast): Likewise. + (__class_type_info::do_find_public_subobj): Likewise. + + * init.c (construct_virtual_bases): Don't look up the addresses of + virtual bases at run-time. + + * class.c (build_vbase_pointer): Relocate. + (build_vbase_pointer_fields): Likewise. + (dfs_build_vbase_offset_vtbl_entries): Likewise. + (build_vbase_offset_vtbl_entries): Likewise. + + * decl.c (init_decl_processing): Complain if -fnew-abi + -fno-vtable-thunks is used. + + * decl2.c (lang_decode_option): Don't couple flag_honor_std to + flag_new_abi. + +2000-01-15 Mark Mitchell + + * cp-tree.h (num_extra_vtbl_entries): New function. + (size_extra_vtbl_entries): Likewise. + (dfs_vtable_path_unmark): Likewise. + (dfs_vtable_path_unmarked_real_bases_queue_p): Likewise. + (dfs_vtable_path_marked_real_bases_queue_p): Likewise. + * class.c (num_extra_vtbl_entries): New function. + (size_extra_vtbl_entries): Likewise. + (dfs_build_vbase_offset_vtbl_entries): New function. + (build_vbase_offset_vtbl_entries): Likewise. + (build_vtbl_initializer): Use it. + (finish_struct_1): Adjust vtable sizes (using + num_extra_vtbl_entries). + * expr.c (cplus_expand_expr): Assert that the DECL_RTL for a + THUNK_DECL is non-NULL before expanding it. + * init.c (expand_virtual_init): Adjust the vtable pointer by + size_extra_vtbl_entries before storing it. + * search.c (get_shared_vase_if_not_primary): Adjust prototype. + Handle TREE_LIST parameters here, not in the dfs_* functions. + (dfs_unmarked_real_bases_queue_p): Adjust. + (dfs_marked_real_bases_queue_p): Likewise. + (dfs_vtable_path_unmarked_real_bases_queue_p): New function. + (dfs_vtable_path_marked_real_bases_queue_p): New function. + (dfs_vtable_path_unmark): Likewise. + +2000-01-14 Mark Mitchell + + * optimize.c (copy_body_r): Clear the operand three of a + TARGET_EXPR when copying it. + +2000-01-14 Martin v. Löwis + + * method.c (build_decl_overload_real): Check whether we are in :: + before returning __builtin_new/delete. + +2000-01-13 Mark Mitchell + + * pt.c (tsubst_friend_function): Improve comment. + (instantiate_decl): Avoid crashing when a "nested" function is + instantiated from the top level. + + * dump.c (dqeueue_and_dump): Dump + DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION. + +2000-01-13 Kaveh R. Ghazi + + * call.c: If GATHER_STATISTICS, declare `n_build_method_call'. + +2000-01-13 Nathan Sidwell + + * g++spec.c (lang_specific_driver): Add -fnew-abi if + ENABLE_NEW_GXX_ABI defined. + * Make-lang.in (tinfo.o, tinfo2.o, exception.o, new.o, + opnew.o, opnewnt.o, opvnew.o, opvnewnt.o, opdel.o, opdelnt.o, + opvdel.o, opvdelnt.o): Use GXX_ABI_FLAG switch. + +2000-01-12 Mark Mitchell + + * decl.c (start_cleanup_fn): Call pushdecl. + + * call.c (convert_class_to_reference): Fix typos. + (build_conditional_expr): Handle errors gracefully. + * class.c (push_nested_class): Likewise. + * cp-tree.h (VAR_FUNCTION_OR_PARM_DECL_CHECK): New macro. + (DECL_THIS_EXTERN): Use it. + (DECL_THIS_STATIC): Likewise. + * cvt.c (convert_to_void): Handle errors gracefully. + (build_expr_type_conversion): Likewise. + * decl.c (maybe_push_decl): Likewise. + (start_decl_1): Likewise. + (require_complete_types_for_parms): Likewise. + * parse.y (structsp): Likewise. + (base_class): Likewise. + * parse.c: Regenerated. + * pt.c (finish_member_template_decl): Likewise. + * typeck.c (decay_conversion): Likewise. + + * cp-tree.h (dfs_skip_vbases): New function. + (find_vbase_instance): Likewise. + * class.c (determine_primary_base): Allow a nearly empty base to + serve as a primary base class under the new ABI. + (get_class_offset_1): Rename to ... + (dfs_get_class_offset): ... this. Simplify. Don't issue error + messages here. + (get_class_offset): Use it. Issue error messages here. + (dfs_modify_vtables): Rely on dfs_unmarked_real_bases_queue_p to + find the right copies of virtual bases. + (fixup_vtable_deltas1): Rename to ... + (dfs_fixup_vtable_deltas): ... this. Adjust to handle virtual + bases as primary bases. + (fixup_vtable_deltas): Remove. + (override_one_vtable): Handle virtual bases as primary bases. + (merge_overrides): Likewise. + (finish_struct_1): Likewise. + (dump_class_hierarchy): Dump primary-ness of bases as well. + * search.c (mark_primary_bases): Use a pre-order traversal to + handle primary virtual bases. + (dfs_skip_vbases): New fiunction. + (expand_upcast_fixups): Adjust to handle primary virtual bases. + (fixup_virtual_upcast_offsets): Likewise. + (fixup_all_virtual_upcast_offsets): Likewise. + (dfs_find_vbase_instances): New function. + (find_vbase_instance): Likewise. + +2000-01-11 Mumit Khan + + * lex.c (DIR_SEPARATOR): Delete macro. + +2000-01-12 Gabriel Dos Reis + + * decl2.c (lang_decode_option): Handle automatic line wrapping + option. + +2000-01-11 Mark Mitchell + + * friend.c (do_friend): Don't resolve scopes when processing + template declarations, even if the qualifying scope doesn't + involve template parameters. + +2000-01-10 Mark Mitchell + + * class.c (dfs_modify_vtables_queue_p): Remove. + (modify_all_vtables): Use dfs_unmarked_real_bases_queue_p + and dfs_marked_real_bases_queue_p instead of + dfs_modify_vtables_queue_p. + + * class.c (build_vbase_path): Simplify. + (dfs_propagate_binfo_offsets): New function. + (propagate_binfo_offsets): Use it. + (remove_base_field): Simplify. + (dfs_set_offset_for_vbases): Remove. + (dfs_set_offset_for_shared_vbases): New function. + (dfs_set_offset_for_unshared_vbases): Likewise. + (layout_virtual_bases): Use them. + (layout_basetypes): Don't call propagate_binfo_offsets. + * search.c (dfs_get_vbase_types): Clone completely fresh binfos + for the vbases. + + * class.c (build_base_field): New function, split out from ... + (build_base_fields): ... here. Use it. Allocate primary bases + first, under the new ABI. + (get_vtable_entry): Remove. + (remove_base_field): New function, split out from ... + (remove_base_fields): ... here. Adjust since primary bases come + first under the new ABI. + + * cp-tree.h (expand_direct_vtbls_init): Remove declaration. + (initialize_vtbl_ptrs): New function. + (expand_indirect_vtbls_init): Change prototype. + (convert_pointer_to_vbase): Declare. + * init.c (expand_direct_vtbls_init): Remove. + (dfs_initialize_vtbl_ptrs): New function. + (initialize_vtbl_ptrs): Likewise. + (emit_base_init): Use initialize_vtbl_ptrs. + * search.c (convert_pointer_to_vbase): Make it global. + (expand_indirect_vtbls_init): Remove vtable initialization code. + * semantics.c (setup_vtbl_ptr): Use initialize_vtbl_ptrs. + + * class.c (dfs_finish_vtbls): New function. + (finish_vtbls): Use it. + (dump_class_hierarchy): New function. + + * cp-tree.h (BINFO_PRIMARY_MARKED_P): Change definition. + (BINFO_VBASE_PRIMARY_P): New macro. + (BINFO_VIRTUALS): Add to documentation. + (SET_BINFO_PRIMARY_MARKED_P): Remove. + (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. + (dfs_mark_primary_bases_queue_p): Likewise. + (dfs_unmarked_real_bases_queue_p): New function. + (dfs_marked_real_bases_queue_p): Likewise. + * search.c (dfs_mark_primary_bases): Adjust. + (mark_primary_bases): Likewise. + (get_shared_vbase_if_not_primary): New function. + (dfs_unmarked_real_bases_queue_p): Likewise. + (dfs_marked_real_bases_queue_p): Likewise. + (dfs_get_pure_virtuals): Simplify. + (get_pure_virtuals): Likewise. + +2000-01-10 Kaveh R. Ghazi + + * lex.c: Include tm_p.h. + +2000-01-07 Nathan Sidwell + + * lang-specs.h (__GXX_ABI_VERSION): New preprocessor macro. + +2000-01-06 Jason Merrill + + * decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT. + * pt.c (instantiate_decl): Defer comdat templates that might not be + needed. + + * cp-tree.h (DECL_NEEDED_P): Also true if !DECL_COMDAT. + * decl2.c (finish_vtable_vardecl): Don't check !DECL_COMDAT. + (finish_file): Likewise. + + * decl2.c (import_export_class): Undo 12/14 change. + + * error.c (dump_decl): operator new, not operatornew. + + * class.c (field_decl_cmp): A nontype is "greater" than a type. + * search.c (lookup_field_1): Look for the last field with the + desired name. + +2000-01-05 Nathan Sidwell + + * decl2.c (lookup_arg_dependent): Deal with FNS not being a + FUNCTION_DECL. + +2000-01-05 Nathan Sidwell + + * typeck.c (build_static_cast): Don't strip target qualifiers + when casting from a class. + +2000-01-04 Kaveh R. Ghazi + + * class.c (warn_hidden): Initialize variable `fndecl'. + +2000-01-03 Ulrich Drepper + + * decl.c (flag_isoc9x): New variable to be able to use code in + c-common.c. For now always zero. + +2000-01-03 Mark Mitchell + + * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. + * class.c (layout_basetypes): Don't set BINFO_INHERITANCE_CHAIN + or unshare_base_binfos for virtual bases here. + * search.c (dfs_get_vbase_types): Do it here. + (get_vbase_types): Adjust. + +2000-01-02 Mark Mitchell + + * cp-tree.h (CLASSTYPE_VFIELDS): Move definition. + (BINFO_PRIMARY_MARKED_P): Use flag 5. + (SET_BINFO_PRIMARY_MARKED_P): Likewise. + (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. + (unmark_primary_bases): Remove declaration. + (unmarkedp): Declare. + (dfs_vbase_unmark): Likewise. + * class.c (determine_primary_base): Return immediately if there + are no base classes. Call mark_primary_bases here. + (modify_all_direct_vtables): Remove. + (modify_all_indirect_vtables): Remove. + (dfs_modify_vtables_queue_p): New function. + (dfs_modify_vtables): New function. + (modify_all_vtables): Use them. + (build_base_fields): Build FIELD_DECLs for primary virtual base + classes. + (create_vtable_ptr): Don't call determine_primary_base here. + (dfs_mark_primary_bases_and_set_vbase_offsets): Rename to ... + (dfs_set_offset_for_vbases): ... this. + (layout_virtual_bases): Use it. + (layout_class_type): Call determine_primary_base here. + * search.c (unmarkedp): Make it global. + (shared_marked_p): Simplify. + (shared_unmarked_p): Likewise. + (dfs_primary_bases_queue_p): Remove. + (dfs_unmark_primary_bases): Likewise. + (unmark_primary_bases): Likewise. + (mark_primary_bases): Simplify. + (get_pure_virtuals): Don't call mark_primary_bases here. + (dfs_vbase_unmark): New function. + (get_vbase_types): Simplify. + + * class.c (struct base_info): Remove. + (determine_primary_base): Take has_virtual_p rather than a + base_info as input. Don't calculate max_has_virtual. + (finish_struct_bits): Remove max_has_virtual argument. + (create_vtable_ptr): Remove max_has_virtual_p argument. + (layout_virtual_bases): Remove max argument. + (layout_basetypes): Likewise. + (layout_class_type): Remove max_has_virtual_p argument. + (finish_struct_1): Remove max_has_virtual. + + * cp-tree.h (dfs_mark_primary_bases_queue_p): New function. + (layout_basetypes): Remove. + * class.c (propagate_binfo_offsets): Moved here from tree.c. + Update to handle primary virtual bases. + (remove_base_fields): New function, split out from + layout_basetypes. + (dfs_mark_primary_bases_and_set_vbase_offsets): New function. + (layout_virtual_bases): New function, split out from + layout_basetypes. Update to handle primary virtual bases. + (layout_basetypes): Moved here from tree.c. Use + remove_base_fields and layout_virtual_bases. + * search.c (dfs_mark_primary_bases_queue_p): New function. + (mark_primary_bases): Use it. + * tree.c (CEIL): Remove. + (propagate_binfo_offsets): Remove. + (layout_basetypes): Remove. + +2000-01-01 Mark Mitchell + + * cp-tree.h (CLASSTYPE_N_BASECLASSES): Use BINFO_N_BASETYPES. + (BINFO_PRIMARY_MARKED_P): New macro. + (SET_BINFO_PRIMARY_MARKED_P): Likewise. + (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. + (mark_primary_bases): New function. + (unmark_primary_bases): Likewise. + * search.c (get_abstract_virtuals_1): Remove. + (dfs_mark_primary_bases): New function. + (mark_primary_bases): Likewise. + (dfs_unmark_primary_bases): Likewise. + (unmark_primary_bases): Likewise. + (dfs_get_pure_virtuals): Likewise. + +2000-01-01 Mark Mitchell + + * cp-tree.h (skip_rtti_stuff): Adjust prototype. + * class.c (skip_rtti_stuff): Reorganize parameters and return value. + (modify_one_vtable): Adjust. + (fixup_vtable_deltas1): Likewise. + (override_one_vtable): Likewise. + * search.c (get_abstract_virtuals_1): Likewise. + (get_pure_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + * tree.c (debug_binfo): Likewise. + + * class.c (build_vtable): Don't return a value. Don't rebuild + vtables for bases that have already been handled. + (prepare_fresh_vtable): Don't rebuild vtables for bases that have + already been handled. + (modify_one_vtable): Adjust accordingly. + (fixup_vtable_deltas1): Likewise. + (finish_struct_1): Likewise. + +2000-01-01 Martin v. Löwis + + * call.c (build_new_method_call): Also check destructors. + diff --git a/gcc/cp/ChangeLog-2001 b/gcc/cp/ChangeLog-2001 new file mode 100644 index 00000000000..9643357b261 --- /dev/null +++ b/gcc/cp/ChangeLog-2001 @@ -0,0 +1,3895 @@ +2001-12-29 Nathan Sidwell + + * call.c (build_user_type_conversion_1): Use my_friendly_assert + rather than if ... abort. + * cvt.c (convert_to_reference): Likewise. + * semantics.c (setup_vtbl_ptr): Likewise. + * pt.c (lookup_template_class): Comment typo. + +2001-12-29 Nathan Sidwell + + PR c++/5125 + * pt.c (push_template_decl_real): Make sure DECL has + DECL_LANG_SPECIFIC. + +2001-12-29 Nathan Sidwell + + PR c++/335 + * init.c (resolve_offset_ref): Copy cv qualifiers of this pointer + for non-reference fields. + * typeck.c (require_complete_type): Use resolve_offset_ref). + +2001-12-26 Nathan Sidwell + + PR c++/196 + * parse.y (bad_parm): Better diagnostic when given a SCOPE_REF. + +2001-12-24 Nathan Sidwell + + PR c++/160 + * typeck.c (build_modify_expr): Remove old unreachable code & tidy + up. Don't stabilize_references when initializing a reference. + +2001-12-23 Kaveh R. Ghazi + + * decl2.c (lang_f_options): Const-ify. + +2001-12-20 Joseph S. Myers + + * config-lang.in (diff_excludes): Remove. + +2001-12-19 Nathan Sidwell + + PR c++/90 + * typeck.c (build_function_call_real): Use original function + expression for errors. + +2001-12-18 Jason Merrill + + PR c++/3242 + * class.c (add_method): Do compare 'this' quals when trying to match a + used function. Don't defer to another used function. + +2001-12-18 Nathan Sidwell + + * pt.c (instantiate_clone): Remove, fold into ... + (instantiate_template): ... here. Simplify by removing mutual + recursion. + * typeck2.c (build_m_component_ref): Don't cv qualify the function + pointed to by a pointer to function. + * class.c (delete_duplicate_fields_1): Typo. + +2001-12-18 Jason Merrill + + C++ ABI change: destroy value arguments in caller. + * semantics.c (genrtl_start_function, genrtl_finish_function): Don't + create an extra binding level for the parameters. + * decl.c (store_parm_decls): Don't do parameter cleanups. + +2001-12-18 Nathan Sidwell + + * call.c (build_new_method_call): Use '%#V'. + * error.c (cv_to_string): Use V parameter to determine padding. + +2001-12-18 Joseph S. Myers + + * call.c, decl2.c, init.c: Use "built-in" and "bit-field" + spellings in messages. + +2001-12-17 Zack Weinberg + + * cp-tree.h: Delete #defines for cp_error, cp_warning, + cp_pedwarn, and cp_compiler_error. + * call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c, + except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c, + rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, + typeck2.c: Change calls to the above macros to use their + language-independent equivalents: error, warning, pedwarn, and + internal_error respectively. + +2001-12-16 Neil Booth + + * decl2.c (finish_file): Remove back_end_hook. + +2001-12-16 Joseph S. Myers + + * ChangeLog.1, ChangeLog.2, ChangeLog, NEWS, call.c, class.c, + cp-tree.h, decl.c, decl2.c, except.c, operators.def, optimize.c, + pt.c, rtti.c, semantics.c, typeck.c: Fix spelling errors. + +2001-12-15 Joseph S. Myers + + * lang-options.h: Use American spelling in messages. + +2001-12-13 Jason Merrill + + * Make-lang.in (parse.h): Separate rule, just depend on parse.c. + + Use cleanups to run base and member destructors. + * init.c (push_base_cleanups): New function, split out from... + (build_delete): ...here. Lose !TYPE_HAS_DESTRUCTOR code. + * decl.c (finish_destructor_body): Move vbase destruction code to + push_base_cleanups. + (begin_function_body, finish_function_body): New fns. + (finish_function): Move [cd]tor handling and call_poplevel to + finish_function_body. + (pushdecl): Skip the new level. + * semantics.c (genrtl_try_block): Don't call end_protect_partials. + (setup_vtbl_ptr): Call push_base_cleanups. + * method.c (synthesize_method): Call {begin,end}_function_body. + * pt.c (tsubst_expr): Handle COMPOUND_STMT_BODY_BLOCK. + * cp-tree.h: Declare new fns. + * parse.y (function_body, .begin_function_body): New nonterminals. + (fndef, pending_inline, function_try_block): Use function_body. + (ctor_initializer_opt, function_try_block): No longer has a value. + (base_init): Remove .set_base_init token. + (.set_base_init, compstmt_or_error): Remove. + * Make-lang.in (parse.c): Expect two fewer s/r conflicts. + + * optimize.c (maybe_clone_body): Fix parameter updating. + +2001-12-12 Jason Merrill + + * decl.c (store_parm_decls): Remove parms_have_cleanups cruft. + * semantics.c (genrtl_start_function): Don't pass + parms_have_cleanups or push an extra binding level. + (genrtl_finish_function): Lose cleanup_label cruft. + + * cp-tree.h (struct cp_language_function): Remove x_ctor_label. + (ctor_label): Remove. + * semantics.c (finish_return_stmt): Lose ctor_label support. + * decl.c (finish_constructor_body, mark_lang_function): Likewise. + * typeck.c (check_return_expr): Check DECL_DESTRUCTOR_P, not + dtor_label. + + * call.c (build_new_method_call): Let resolves_to_fixed_type_p + check for [cd]tors. + * class.c (fixed_type_or_null, case INDIRECT_REF): Fix. + + * decl.c (finish_function): Check VMS_TARGET, not VMS. + + * decl.c (start_cleanup_fn): Remove redundant pushlevel. + (end_cleanup_fn): And poplevel. + + * semantics.c (setup_vtbl_ptr): Always build a CTOR_INITIALIZER + if we're in a template. + +2001-12-12 Jakub Jelinek + + * cp-tree.h (DESTRUCTOR_DECL_PREFIX, DESTRUCTOR_NAME_P, + ANON_PARMNAME_FORMAT, ANON_PARMNAME_P, DESTRUCTOR_NAME_FORMAT, + THIS_NAME_P): Delete. + * spew.c (read_process_identifier): Remove DESTRUCTOR_NAME_P, + THIS_NAME_P and ANON_PARMNAME_P tests from warning about clash + with internal naming scheme. + * error.c (dump_decl): Remove DESTRUCTOR_NAME_P use. + +2001-12-12 Nathan Sidwell + + * decl.c (grokdeclarator): Deprecated implicit typename use. + +2001-12-11 Nathan Sidwell + + PR g++/51 + * parse.y (frob_specs): Indicate it is a language linkage which + contained the extern. + * decl.c (grokdeclarator): Allow extern language linkage with + other specifiers. + +2001-12-10 Nathan Sidwell + + PR g++/72 + * decl.c (add_binding): Don't reject duplicate typedefs involving + template parameters. + +2001-12-10 Neil Booth + + * parse.y, semantics.c: Similarly. + +2001-12-09 Nathan Sidwell + + PR g++/87 + * cp-tree.h (DECL_COPY_CONSTRUCTOR_P): Use copy_fn_p. + (copy_args_p): Rename to ... + (copy_fn_p): ... here. + (grok_special_member_properties): New function. + (grok_op_properties): Lose VIRTUALP parameter. + (copy_assignment_arg_p): Remove. + * call.c (build_over_call): Use copy_fn_p. + * decl.c (grokfndecl): Reformat. Adjust call to + grok_op_properties. + (copy_args_p): Rename to ... + (copy_fn_p): ... here. Reject template functions. Check for pass + by value. + (grok_special_member_properties): Remember special functions. + (grok_ctor_properties): Don't remember them here, just check. + (grok_op_properties): Likewise. + (start_method): Call grok_special_member_properties. + * decl2.c (grokfield): Likewise. + (copy_assignment_arg_p): Remove. + (grok_function_init): Don't remember abstract assignment here. + * pt.c (instantiate_class_template): Call + grok_special_member_properties. + (tsubst_decl): Adjust grok_op_properties call. + +2001-12-08 Aldy Hernandez + + * lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and + RID_TYPES_COMPATIBLE_P. + +2001-12-08 John David Anglin + + * semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in + call to build_aggr_init. + * cp-tree.h (DIRECT_BIND): Document new use of DIRECT_BIND. + +2001-12-08 Neil Booth + + * parse.y: Replace uses of the string non-terminal with STRING. + Don't perform string concatentaion here. + (string): Remove non-terminal. + * semantics.c (finish_asm_stmt): Don't concatenate strings here. + +2001-12-05 Jason Merrill + + * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Define. + * tree.c (cp_start_inlining, cp_end_inlining): New fns. + * pt.c (push_tinst_level): No longer static. + * cp-tree.h: Declare them. + + * init.c (resolve_offset_ref): Don't check access for the base + conversion to access a FIELD_DECL. + + * cp-tree.h (TYPE_REFFN_P): New macro. + * decl.c (bad_specifiers): Check it, too. + + * rtti.c (create_pseudo_type_info): Set CLASSTYPE_INTERFACE_ONLY + on the __*_type_info type if we haven't seen a definition. + +2001-12-05 Neil Booth + + * decl.c: Include c-common.h. + (shadow_warning): Move to c-common.c. + +2001-12-05 Richard Kenner + + * decl.c (duplicate_decls): Don't copy DECL_NO_CHECK_MEMORY_USAGE. + +2001-12-04 Nathan Sidwell + + * pt.c (end_template_parm_list): Clear TREE_CHAIN of each parm. + +2001-12-04 Nathan Sidwell + + PR g++/164 + * init.c (sort_base_init): Allow binfos to be directly specified. + * method.c (do_build_copy_constructor): Explicitly convert to the + base instance. + (do_build_assign_ref): Likewise. + +2001-12-03 Hans-Peter Nilsson + + * decl.c (xref_basetypes): Don't use C99 construct in tag_code + declaration and initialization. + +2001-12-03 Neil Booth + + * typeck2.c: Remove leading capital from diagnostic messages, as + per GNU coding standards. + +2001-12-03 Mumit Khan + + PR c++/3394 + * decl.c (xref_basetypes): Handle attributes between + 'class' and name. + +2001-12-03 Nathan Sidwell + + PR g++/3381 + * parse.y (named_complex_class_head_sans_basetype): Add new + reduction. + * Make-lang.in (parse.c): Adjust expected conflict count. + +2001-12-03 Jason Merrill + + * class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the + immediate binfos for our virtual bases. + +2001-12-02 Neil Booth + + * call.c (build_java_interface_fn_ref): Similarly. + * except.c (is_admissible_throw_operand): Similarly. + * init.c (build_java_class_ref): Similarly. + * xref.c (open_xref_file): Similarly. + +2001-12-01 Neil Booth + + * class.c (finish_struct): Remove trailing periods from messages. + * decl.c (check_tag_decl): Similarly. + * lex.c (cxx_set_yydebug): Similarly. + * typeck2.c (friendly_abort): Similarly. + +2001-11-29 Mark Mitchell + + PR c++/3048 + * cp-tree.h (ovl_member): Remove. + * decl2.c (merge_functions): Handle extern "C" functions + specially. + * tree.c (ovl_member): Remove. + +2001-11-29 Mark Mitchell + + PR c++/4842 + * class.c (get_basefndecls): Take an IDENTIFIER_NODE, not a + FUNCTION_DECL, as input. + (mark_overriders): Remove. + (warn_hidden): Rework for the new ABI. + +2001-11-29 Mark Mitchell + + PR c++/3471 + * call.c (convert_like_real): Do not build additional temporaries + for rvalues of class type. + +2001-11-28 Nathan Sidwell + + * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Use lookup base. + (ACCESSIBLY_UNIQUELY_DERIVED_FROM_P): Likewise. + (PUBLICLY_UNIQUELY_DERIVED_FROM_P: Likewise. + (DERIVED_FROM_P): Likewise. + (enum base_access): Renumber, add ba_quiet bit mask. + (get_binfo): Remove. + (get_base_distance): Remove. + (binfo_value): Remove. + (ACCESSIBLY_DERIVED_FROM_P): Remove. + * call.c (standard_conversion): Use lookup_base. + * class.c (strictly_overrides): Likewise. + (layout_virtual_bases): Likewise. + (warn_about_ambiguous_direct_bases): Likewise. + (is_base_of_enclosing_class): Likewise. + (add_vcall_offset_vtbl_entries_1): Likewise. + * cvt.c (build_up_reference): Adjust comment. + * init.c (build_member_call): Reformat. + * search.c (get_binfo): Remove. + (get_base_distance_recursive): Remove. + (get_base_distance): Remove. + (lookup_base_r): Tweak. + (lookup_base): Add ba_quiet control. Complete the types here. + (covariant_return_p): Use lookup_base. + * tree.c (binfo_value): Remove. + (maybe_dummy_object): Use lookup_base. + * typeck.c (build_static_cast): Use lookup_base. + (get_delta_difference): Likewise. + * typeck2.c (binfo_or_else): Use lookup_base. + (build_scoped_ref): Add back error_mark_check. + (build_m_component_ref): Use lookup_base. + +2001-11-29 Joseph S. Myers + + * Make-lang.in (c++.generated-manpages): New dummy target. + +2001-11-27 Richard Kenner + + * Make-lang.in (cp-lang.o): Depends on c-common.h. + * cp-lang.c (c-common.h): Include. + (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks. + * decl.c (cxx_init_decl_processing): Don't set lang_safe_from_p. + * expr.c (init_cplus_expand): Don't set lang_expand_constant. + +2001-11-26 Neil Booth + + * decl2.c (c_language): Move to c-common.c. + * lex.c (cxx_post_options, cxx_init_options): Use c-common.c + functions. + (cxx_init): Update. + +2001-11-26 Jason Merrill + + * call.c (joust): Remove COND_EXPR hack. + +2001-11-25 Aldy Hernandez + + * search.c (lookup_base_r): Declare bk in variable declaration + space. + +2001-11-25 Nathan Sidwell + + PR g++/3145 + * class.c (build_vbase_pointer): Remove. + (build_vbase_path): Remove. + (build_base_path): New function. + * cp-tree.h (base_access, base_kind): New enumerations. + (build_base_path): Declare. + (convert_pointer_to_real): Remove. + (convert_pointer_to): Remove. + (lookup_base): Declare. + (convert_pointer_to_vbase): Remove. + * call.c (build_scoped_method_call): Use lookup_base & + build_base_path instead of convert_pointer_to_real, + get_base_distance & get_binfo. + (build_over_call): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_pointer_force): Likewise. + (build_up_reference): Likewise. + (convert_pointer_to_real): Remove. + (convert_pointer_to): Remove. + * init.c (dfs_initialize_vtbl_ptrs): Use build_base_path + instead of convert_pointer_to_vbase & build_vbase_path. + (emit_base_init): Use build_base_path instead of + convert_pointer_to_real. + (expand_virtual_init): Lose unrequired conversions. + (resolve_offset_ref): Use lookup_base and build_base_path + instead of convert_pointer_to. + * rtti.c (build_dynamic_cast_1): Use lookup_base & + build_base_path instead of get_base_distance & build_vbase_path. + * search.c (get_vbase_1): Remove. + (get_vbase): Remove. + (convert_pointer_to_vbase): Remove. + (lookup_base_r): New function. + (lookup_base): New function. + * typeck.c (require_complete_type): Use lookup_base & + build_base_path instead of convert_pointer_to. + (build_component_ref): Likewise. + (build_x_function_call): Likewise. + (get_member_function_from_ptrfunc): Likewise. + (build_component_addr): Likewise. + * typeck2.c (build_scoped_ref): Likewise. + +2001-11-22 Bryce McKinlay + + * cp-tree.h (CP_TYPE_QUALS): Removed. + * decl.c (cxx_init_decl_processing): Don't set lang_dump_tree. + * cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and + LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN. + * dump.c (cp_dump_tree): Use void* dump_info argument to match + lang-hooks prototype. + * call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c, + rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to + CP_TYPE_QUALS changed to cp_type_quals. + * Make-lang.in: References to c-dump.h changed to tree-dump.h. + (CXX_C_OBJS): Remove c-dump.o. + +2001-11-21 Mark Mitchell + + PR c++/3637 + * pt.c (lookup_template_class): Ensure that all specializations + are registered on the list corresponding to the most general + template. + +2001-11-20 Mark Mitchell + + * call.c (non_reference): Add documentation. + (convert_class_to_reference): Do not strip reference types + from conversion operators. + (maybe_handle_ref_bind): Simplify. + (compare_ics): Correct handling of references. + +2001-11-19 John Wilkinson + + * dump.c (dump_op): New function. + (cp_dump_tree): Dump CLASSTYPE_TEMPLATE_SPECIALIZATION. Use + dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs. + DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P, + +2001-11-19 Mark Mitchell + + PR4629 + * semantics.c (finish_sizeof): Make sure that expression created + while processing a template do not have a type. + (finish_alignof): Likewise. + * typeck.c (c_sizeof): Likewise. + (expr_sizeof): Likewise. + +2001-11-18 Neil Booth + + * lex.c (cxx_finish): Call c_common_finish. + (finish_parse): Remove. + +2001-11-17 Kriang Lerdsuwanakij + + * decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE + when displaying error message about missing array bounds. + +2001-11-17 Kriang Lerdsuwanakij + + * mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR, + CONST_CAST_EXPR. + * operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR. + +2001-11-16 Neil Booth + + * cp-tree.h (print_class_statistics): Restore. + +2001-11-15 Jason Merrill + + * method.c (use_thunk): Don't emit debugging information for thunks. + + * parse.y: Add ... IDENTIFIER SCOPE and ... PTYPENAME SCOPE expansions. + * decl.c (make_typename_type): Handle getting a class template. + * search.c (lookup_field_r): A class template is good enough for + want_type. + + * call.c (convert_like_real): Only use cp_convert for the bad part. + (standard_conversion): Also allow bad int->enum. + * typeck.c (ptr_reasonably_similar): Also allow functions to + interconvert. Pointers to same-size integers are reasonably + similar. + + * cvt.c (convert_to_void): If we build a new COND_EXPR, always + give it void type. + +2001-11-15 Nathan Sidwell + + PR g++/3154 + * init.c (sort_base_init): Remove unreachable code. + (expand_member_init): Adjust comment to reflect reality. Simplify + and remove unreachable code. + +2001-11-15 Neil Booth + + * cp-tree.h (init_reswords, cxx_init_decl_processing): New. + (cxx_init): Update prototype. + * decl.c (init_decl_processing): Rename. Move null node init + to its creation time. + * lex.c (cxx_init_options): Update. + (cxx_init): Combine with old init_parse; also call + cxx_init_decl_processing. + +2001-11-14 Richard Sandiford + + * decl.c (check_initializer): Try to complete the type of an + array element before checking whether it's complete. Don't + complain about arrays with complete element types but an + unknown size. + (cp_finish_decl): Build the hierarchical constructor before + calling maybe_deduce_size_from_array_init. + +2001-11-14 Joseph S. Myers + + * Make-lang.in: Change all uses of $(manext) to $(man1ext). + +2001-11-13 Nathan Sidwell + + PR g++/4206 + * parse.y (already_scoped_stmt): Remove. + (simple_stmt, WHILE & FOR): Use implicitly_scoped_stmt. + +2001-11-12 H.J. Lu + + * cvt.c (ocp_convert): Don't warn the address of a weak + function is always `true'. + +2001-11-09 Neil Booth + + * cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override. + * cp-tree.h (print_class_statistics): Remove. + (cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type, + cxx_print_identifier, cxx_set_yydebug): New. + * lex.c (set_yydebug): Rename c_set_yydebug. + * ptree.c (print_lang_decl, print_lang_type, print_lang_identifier, + lang_print_xnode): Rename. + * tree.c (print_lang_statistics): Rename. + +2001-11-09 Kaveh R. Ghazi + + * class.c (dump_array): Fix format specifier warning. + +2001-11-09 Neil Booth + + * cp-lang.c (LANG_HOOKS_NAME): Override. + (struct lang_hooks): Constify. + * lex.c (cxx_init_options): Update. + (lang_identify): Remove. + * parse.y (language_string): Remove. + +2001-11-08 Andreas Franck + + * Make-lang.in (CXX_INSTALL_NAME, GXX_CROSS_NAME, + DEMANGLER_CROSS_NAME): Handle program_transform_name the way + suggested by autoconf. + (GXX_TARGET_INSTALL_NAME, CXX_TARGET_INSTALL_NAME): Define. + (c++.install-common): Use the transformed target alias names. + +2001-11-06 Neil Booth + + * Make-lang.in: Update. + * cp-lang.c: Include langhooks-def.h. + +2001-11-04 Kriang Lerdsuwanakij + + * pt.c (tsubst_copy): Call tsubst for TYPEOF_EXPR. + +2001-11-03 Kaveh R. Ghazi + + * lex.c (copy_lang_type): Add static prototype. + +2001-11-02 Kriang Lerdsuwanakij + + * pt.c (unify): Handle SCOPE_REF. + +2001-11-01 Jakub Jelinek + + * tree.c (cp_copy_res_decl_for_inlining): Adjust + DECL_ABSTRACT_ORIGIN for the return variable. + +2001-10-31 Zack Weinberg + + * Make-lang.in: Replace $(INTL_TARGETS) with po-generated. + +2001-10-28 Joseph S. Myers + + * ChangeLog.1, ChangeLog.2, ChangeLog, class.c, decl2.c, search.c, + semantics.c, spew.c: Fix spelling errors. + +2001-10-27 Kriang Lerdsuwanakij + + * decl2.c (validate_nonmember_using_decl): Handle NAMESPACE_DECL. + +2001-10-25 Zack Weinberg + + * cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to + pop_everything. + +2001-10-23 Richard Kenner + + * cp-lang.c (cxx_get_alias_set): New function. + Point LANG_HOOKS_GET_ALIAS_SET to it. + +2001-10-23 Kriang Lerdsuwanakij + + * cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node. + * cp-tree.h (make_unbound_class_template): Prototype new function. + * decl.c (make_unbound_class_template): New function. + * decl2.c (arg_assoc_template_arg): Handle UNBOUND_CLASS_TEMPLATE. + * error.c (dump_type): Likewise. + * mangle.c (write_type): Likewise. + * parse.y (template_parm): Likewise. + (template_argument): Use make_unbound_class_template. + * pt.c (convert_template_argument): Handle UNBOUND_CLASS_TEMPLATE. + (tsubst): Likewise. + (tsubst_copy): Likewise. + (unify): Likewise. + * tree.c (walk_tree): Likewise. + * typeck.c (comptypes): Likewise. + +2001-10-21 Kaveh R. Ghazi + + * xref.c (GNU_xref_member): Use safe-ctype macros and/or fold + extra calls into fewer ones. + +2001-10-18 Alexandre Oliva + + * decl.c (duplicate_decls): Propagate DECL_UNINLINABLE. + Warn when merging inline with attribute noinline. + (start_decl, start_function): Warn if inline and attribute + noinline appear in the same declaration. + +2001-10-16 H.J. Lu + + * cp-tree.h (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Defined + for tree checking disabled. + +2001-10-16 Hans-Peter Nilsson + + * cp-tree.h (VFIELD_NAME_FORMAT) [NO_DOLLAR_IN_LABEL && + NO_DOT_IN_LABEL]: Adjust to match VFIELD_NAME. + +2001-10-15 Richard Sandiford + + * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Define. + (unify): Only handle MINUS_EXPR specially if the above flag is set + and the subtracted constant is 1. Clear the flag on recursive calls. + Set it when unifying the maximum value in an INTEGER_TYPE's range. + +2001-10-15 Richard Sandiford + + * decl.c (bad_specifiers): Don't allow exception specifications + on any typedefs. + +2001-10-14 Neil Booth + + * cp/lex.c (init_cp_pragma): Similarly. + +2001-10-13 Kriang Lerdsuwanakij + + * pt.c (lookup_template_class): Build complete template arguments + for BOUND_TEMPLATE_TEMPLATE_PARM. + +2001-10-12 Kriang Lerdsuwanakij + + * cp-tree.h (TYPE_BINFO): Update comment. + (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): New macro. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Use template_info. + (TYPENAME_TYPE_FULLNAME): Use TYPE_FIELDS. + (copy_type): Prototype new function. + * lex.c (copy_lang_decl): Gather tree node statistics. + (copy_lang_type): New function. + (copy_type): Likewise. + (cp_make_lang_type): Create lang_type for + BOUND_TEMPLATE_TEMPLATE_PARM. Set TYPE_BINFO for TYPENAME_TYPE + and BOUND_TEMPLATE_TEMPLATE_PARM. + * pt.c (tsubst): Use copy_type instead of copy_node. + * search.c (lookup_field_1): Ignore TYPENAME_TYPE. + +2001-10-12 Kriang Lerdsuwanakij + + * pt.c (determine_specialization): Ignore functions without + DECL_TEMPLATE_INFO. + +2001-10-12 Nathan Sidwell + + PR g++/4476 + * typeck2.c (abstract_virtuals_error): Ignore incomplete classes. + +2001-10-11 Jason Merrill + + * typeck2.c (store_init_value): Don't re-digest a bracketed + initializer. + + * class.c (finish_struct_anon): Use TYPE_ANONYMOUS_P instead of + ANON_AGGR_TYPE_P. + +2001-10-11 Richard Henderson + + * class.c (build_vtable_entry_ref): Create a VTABLE_REF instead + of an asm statement. + (build_vtbl_ref_1): Split out from build_vtbl_ref. + (build_vfn_ref): Use it to handle vtable descriptors before + calling build_vtable_entry_ref. + * decl2.c (output_vtable_inherit): Use assemble_vtable_inherit. + +2001-10-10 Richard Henderson + + * parse.y (asm_operand): Allow named operands. + * semantics.c (finish_asm_stmt): Tweek for changed location + of the operand constraint. + +2001-10-09 Jason Merrill + + * call.c (standard_conversion): Add bad conversion between + integers and pointers. + (convert_like_real): Don't use convert_for_initialization for bad + conversions; complain here and use cp_convert. + (build_over_call): Don't handle bad conversions specially. + (perform_implicit_conversion): Allow bad conversions. + (can_convert_arg_bad): New fn. + * cp-tree.h: Declare it. + * typeck.c (convert_for_assignment): Use it. + (ptr_reasonably_similar): Any target type is similar to void. + +2001-10-08 Alexandre Oliva + + * Make-lang.in (CXX_OBJS): Added cp-lang.o. + (cp/cp-lang.o): New rule. + * cp-tree.h: Declare hooks. + * tree.c: Make hooks non-static. + (init_tree): Don't initialize hooks here. + * lex.c: Likewise. Move definition of lang_hooks to... + * cp-lang.c: ... new file. + +2001-10-08 Richard Henderson + + * cp-tree.h (struct lang_decl_flags): Remove declared_inline. + (DECL_DECLARED_INLINE_P): Use the bit in struct c_lang_decl. + +2001-10-07 Kaveh R. Ghazi + + * class.c (build_vtable_entry_ref): Const-ify. + * decl.c (predefined_identifier, + initialize_predefined_identifiers): Likewise. + * init.c (build_new_1): Likewise. + * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): + Likewise. + +2001-10-05 Alexandre Oliva + + * optimize.c (struct inline_data): Moved to ../tree-inline.c. + (INSNS_PER_STMT): Likewise. + (remap_decl, remap_block, copy_scopy_stmt, copy_body_r): Likewise. + (copy_body, initialize_inlined_parameters): Likewise. + (declare_return_variable, inlinable_function_p): Likewise. + (expand_call_inline, expand_calls_inline): Likewise. + (optimize_inline_calls, clone_body): Likewise. + * tree.c (walk_tree): Moved to ../tree-inline.c. + (walk_tree_without_duplicates): Likewise. + (copy_tree_r, remap_save_expr): Likewise. + +2001-10-04 Alexandre Oliva + + * Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h. + (cp/pt.o, cp/semantics.o, cp/optimize.o): Likewise. + * cp-tree.h (lang_decl): Moved inlined_fns to tree_decl. + (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved to ../tree.h. + (flag_inline_trees): Moved declaration to ../tree-inline.h. + (walk_tree): Moved declaration to ../tree-inline.h. + (walk_tree_without_duplicates, copy_tree_r): Likewise. + (remap_save_expr): Likewise. + * decl.c: Include tree-inline.h. + (lang_mark_tree): Don't mark inlined_fns. + * decl2.c (flag_inline_trees): Moved defn to ../tree-inline.c. + * optimize.c: Include tree-inline.h. + (optimize_inline_calls): Move declaration to ../tree.h, as + non-static. + (remap_decl): Use language-independent constructs and hooks. + (remap_block, copy_body_r, declare_return_variable): Likewise. + (inlinable_function_p): Likewise. Don't test for + DECL_LANG_SPECIFIC before DECL_INLINED_FNS as inlined_fns is + no longer language-specific. + (optimize_inline_calls): Likewise. Make it non-static. Moved + call of dump_function to... + (optimize_function): Here... + (clone_body): New function, extracted from... + (maybe_clone_body): ... here. Build decl_map locally and pass + it on to clone_body. + * pt.c, semantics.c: Include tree-inline.h. + * tree.c: Likewise. + (cp_walk_subtrees): New language-specific hook for tree inlining. + (cp_cannot_inline_tree_fn, cp_add_pending_fn_decls, + cp_is_overload_p, cp_auto_var_in_fn_p, + cp_copy_res_decl_for_inlining): Likewise. + (walk_tree): Move language-specific constructs into... + (cp_walk_subtrees): this new function. + (copy_tree_r): Use language-independent constructs and hooks. + (init_tree): Initialize tree inlining hooks. + (remap_save_expr): Adjust prototype so that the declaration + does not require the definition of splay_tree. + +2001-10-03 John David Anglin + + * rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used + to build the declaration instead of the declaration itself. + +2001-10-02 Jason Merrill + + * decl2.c (cxx_decode_option): Add 'else'. + + * spew.c (end_input): No longer static. + * cp-tree.h: Declare it. + * parse.y (datadef): Add "error END_OF_SAVED_INPUT" expansion. + +2001-10-02 Joseph S. Myers + + * call.c (build_over_call), typeck.c (build_function_call_real): + Pass type attributes to check_function_format rather than name or + assembler name. Don't require there to be a name or assembler + name to check formats. + +2001-10-02 Joseph S. Myers + + * decl.c (init_decl_processing): Don't call + init_function_format_info. Initialize lang_attribute_table + earlier. + (builtin_function): Call decl_attributes. + (insert_default_attributes): New. + +2001-10-01 Jason Merrill + + * decl.c (grokdeclarator): Copy array typedef handling from C + frontend. + + * decl.c (grokdeclarator): Copy too-large array handling from C + frontend. + +2001-09-29 Alexandre Oliva + + * config-lang.in (target_libs): Added target-gperf, so that we + don't try to build it if C++ is disabled. + +2001-09-23 Zack Weinberg + + * Make-lang.in (CXX_OBJS): Take out cp/errfn.o. + (cp/errfn.o): Delete rule. + (cp/error.o): Depend on flags.h. + * errfn.c: Delete file. + * cp-tree.h: Declare warn_deprecated. Remove definitions of + TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, + and TFF_TEMPLATE_DEFAULT_ARGUMENTS. #define cp_error, cp_warning, + cp_pedwarn, and cp_compiler_error to error, warning, pedwarn, and + internal_error respectively. Make cp_deprecated into a macro. + Don't define cp_printer typedef or declare cp_printers. + * error.c: Include flags.h. + Delete: struct tree_formatting_info, print_function_argument_list, + print_declaration, print_expression, print_function_declaration, + print_function_parameter, print_type_id, print_cv_qualifier_seq, + print_type_specifier_seq, print_simple_type_specifier, + print_elaborated_type_specifier, print_rest_of_abstract_declarator, + print_parameter_declaration_clause, print_exception_specification, + print_nested_name_specifier, and definition of cp_printers. + (locate_error): New function. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Moved here and + rewritten in terms of locate_error and diagnostic.c. + (cp_tree_printer): Rename cp_printer; wire up to *_to_string + instead of deleted print_* routines. Handle %C, %L, %O, %Q also. + (init_error): Adjust to match. + +2001-09-22 Richard Kenner + + * Make-lang.in (CXX_C_OBJS): Add attribs.o. + +2001-09-21 Richard Henderson + + * class.c (set_vindex): Mind TARGET_VTABLE_USES_DESCRIPTORS. + (build_vtbl_initializer): Likewise. + (build_vfn_ref): New. + * cp-tree.h: Declare it. + * call.c (build_over_call): Use it. + * decl2.c (mark_vtable_entries): Mark FDESC_EXPR. + * typeck.c (get_member_function_from_ptrfunc): Mind descriptors. + +2001-09-21 J"orn Rennecke + + * decl.c (grokdeclarator): Use C syntax for attr_flags declaration. + +2001-09-21 Joseph S. Myers + + Table-driven attributes. + * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. + * decl2.c (cplus_decl_attributes): Only take one attributes + parameter. + * cp-tree.c (cplus_decl_attributes): Update prototype. + * class.c (finish_struct), decl.c (start_decl, start_function), + decl2.c (grokfield), friend.c (do_friend), parse.y + (parse_bitfield): Update calls to cplus_decl_attributes. + * decl.c (grokdeclarator): Take a pointer to a single ordinary + attribute list. + * decl.h (grokdeclarator): Update prototype. + * decl2.c (grokfield): Take a single ordinary attribute list. + * friend.c (do_friend): Likewise. + * decl.c (shadow_tag, groktypename, start_decl, + start_handler_parms, grokdeclarator, grokparms, start_function, + start_method), decl2.c (grokfield, grokbitfield, grokoptypename), + parse.y (parse_field, parse_bitfield, component_decl_1), pt.c + (process_template_parm, do_decl_instantiation): Pass single + ordinary attribute lists around. + * decl.c (grokdeclarator): Correct handling of nested attributes. + Revert the patch + 1998-10-18 Jason Merrill + * decl.c (grokdeclarator): Embedded attrs bind to the right, + not the left. + . + * cp-tree.h (cp_valid_lang_attribute): Remove declaration + (cp_attribute_table): Declare. + * decl.c (valid_lang_attribute): Don't define. + (lang_attribute_table): Define. + (init_decl_processing): Initialize lang_attribute_table instead of + valid_lang_attribute. + * tree.c (cp_valid_lang_attribute): Remove. + (handle_java_interface_attribute, handle_com_interface_attribute, + handle_init_priority_attribute): New functions. + (cp_attribute_table): New array. + * decl2.c (import_export_class): Don't use + targetm.valid_type_attribute. + +2001-09-15 Gabriel Dos Reis + + * Make-lang.in (cp/error.o): Depend on real.h + * error.c: #include "real.h" + +2001-09-15 Kaveh R. Ghazi + + * mangle.c (mangle_conv_op_name_for_type): Use concat in lieu of + xmalloc/strcpy/strcat. + +2001-09-13 Kaveh R. Ghazi + + * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): + Const-ification. + * pt.c (tsubst_decl): Likewise. + +2001-09-12 Kaveh R. Ghazi + + * decl2.c (lang_f_options): Const-ification. + * lex.c (cplus_tree_code_name): Likewise. + * spew.c (yyerror): Likewise. + +2001-09-06 Nathan Sidwell + + PR c++/3986 + * class.c (force_canonical_binfo_r): Check & move an indirect + primary base first. + (force_canonical_binfo): Check that it's not already + canonical. + (mark_primary_virtual_base): Remove BINFO parameter. + (mark_primary_bases): Adjust, set BINFO_LOST_PRIMARY_P here. + +2001-09-06 Nathan Sidwell + + Remove TYPE_NONCOPIED_PARTS. + * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Map onto + CLASSTYPE_PURE_VIRTUALS. + (TYPE_RAISES_EXCEPTIONS): Map onto TYPE_BINFO. + * class.c (duplicate_tag_error): Remove TYPE_NONCOPIED_PARTS. + (layout_class_type): Don't call fixup_inline_methods here ... + (finish_struct_1): ... call it here. + +2001-09-04 Mark Mitchell + + * decl.c (duplicate_decls): Remove code deadling with + DECL_SAVED_INSNS. + * decl2.c (finish_file): Likewise. + * pt.c (instantiate_decl): Likewise. + * semantics.c (expand_body): Don't defer local functions if + they wouldn't be deferred for some other reason. Don't + generate RTL for functions that will not be emitted. + (genrtl_start_function): Remove code deadling with + DECL_SAVED_INSNS. + (genrtl_finish_function): Likewise. + +2001-09-04 Nathan Sidwell + + PR c++/4203 + * call.c (build_over_call): Do not optimize any empty base + construction. + +2001-08-31 Kriang Lerdsuwanakij + + * error.c (dump_template_decl): Output template parameters + together with their specifiers. + Output `class' prefix for template template parameter. + (dump_decl): Fix formatting. + +2001-08-30 Kurt Garloff + + * optimize.c (inlinable_function_p): Allow only smaller single + functions. Halve inline limit after reaching recursive limit. + +2001-08-30 Joern Rennecke + Jason Merrill + + * class.c (build_vtable_entry_ref): Subtract in char*, not + ptrdiff_t. + +2001-08-23 Jason Merrill + + * tree.c (cp_build_qualified_type_real): Use get_qualified_type. + (build_cplus_array_type): Use cp_build_qualified_type, not + TYPE_MAIN_VARIANT, to get an unqualified version. + + * decl2.c (grok_alignof): Lose. + (build_expr_from_tree): Use expr_sizeof and c_alignof_expr. + * typeck.c (c_alignof): Lose. + * semantics.c (finish_sizeof, finish_alignof): New. + * parse.y: Use them. + * cp-tree.h: Declare them. + +2001-08-22 Jason Merrill + + * pt.c (tsubst_expr): Hand off to the TREE_CHAIN of a statement. + Don't loop in COMPOUND_STMT, FOR_STMT or TRY_BLOCK. + * tree.c (cp_statement_code_p): A TAG_DEFN is a statement. + +2001-08-19 Jakub Jelinek + + * typeck2.c (add_exception_specifier): Only require complete type if + not in processing template declaration. + +2001-08-18 Kaveh R. Ghazi + + * decl.c: Cast argument to size_t, not HOST_WIDE_INT, in calls to + GNU_xref_start_scope and GNU_xref_end_scope. + + * tree.c (TYPE_HASH): Moved to ../tree.h. + +2001-08-16 Mark Mitchell + + * cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS + on COMPOUND_EXPRs. + +2001-08-14 Richard Henderson + + * class.c, cp-tree.h (build_vfn_ref): Remove. + * call.c, rtti.c: Replace all refernces with build_vtbl_ref. + +2001-08-13 Mark Mitchell + + * call.c (build_over_call): Mark COMPOUND_EXPRs generated for + empty class assignment as having side-effects to avoid + spurious warnings. + +2001-08-13 Zack Weinberg + + * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. + * except.c: Include libfuncs.h. + +2001-08-11 Gabriel Dos Reis + + * decl.c (grokdeclarator): Clarify diagnostic message. + +2001-08-13 Kriang Lerdsuwanakij + + * decl2.c (do_nonmember_using_decl): Replace using directive + with using declaration in the error message. + +2001-08-11 Kriang Lerdsuwanakij + + * pt.c (maybe_fold_nontype_arg): Use TREE_TYPE of ARG as the + criterion to avoid rebuilding expression tree instead of + processing_template_decl. + +2001-08-07 Jason Merrill + + Support named return value optimization for inlines, too. + * decl.c (finish_function): Nullify returns here. + * semantics.c (genrtl_start_function): Not here. + (cp_expand_stmt): Don't mess with CLEANUP_STMTs. + (nullify_returns_r): No longer static. Just clear RETURN_EXPR. + Also nullify the CLEANUP_STMT for the nrv. + * cp-tree.h: Declare it. + * optimize.c (declare_return_variable): Replace the nrv with the + return variable. + * typeck.c (check_return_expr): Be more flexible on alignment check. + Ignore cv-quals when checking for a matching type. + +2001-08-09 Richard Henderson + + * decl2.c (finish_objects): Use target hooks instead of + assemble_constructor and assemble_destructor. + +2001-08-08 John David Anglin + + * g++spec.c (lang_specific_driver): Quote argument after `-Xlinker'. + +2001-08-07 Nathan Sidwell + + PR c++/3820 + Stop using TYPE_NONCOPIED_PARTS. + * call.c (build_over_call): Be careful when copy constructing + or assigning to an empty class. + * class.c (check_bases_and_members): It has a + COMPLEX_ASSIGN_REF if it has a vptr. + (layout_class_type): Don't add empty class padding to + TYPE_NONCOPIED_PARTS. + (finish_struct_1): Don't add the VFIELD either. + * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): Mention _copy_ + initialization. + +2001-08-07 Jason Merrill + + * tree.c (walk_tree): Walk siblings even if !walk_subtrees. + +2001-08-06 Richard Henderson + + * decl2.c (finish_objects): Pass a symbol_ref and priority to + assemble_{constructor,destructor}. Remove priority handling. + +2001-08-05 Gabriel Dos Reis + + Don't allow template-id in using-declaration. + * decl2.c (validate_nonmember_using_decl): Handle template-ids. + (do_class_using_decl): Likewise. + +2001-08-04 Neil Booth + + * cp/spew.c (read_token): No need to pop buffers. + +2001-08-02 Stan Shebs + + * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY): Remove, no longer used. + (fnaddr_from_vtable_entry): Remove decl. + * method.c (use_thunk): Update comment. + +2001-08-01 Andrew Cagney + + * repo.c (get_base_filename): Change return value to const char + pointer. + +2001-08-02 Nathan Sidwell + + Kill -fhonor-std. + * NEWS: Document. + * cp-tree.h (flag_honor_std): Remove. + (CPTI_FAKE_STD): Remove. + (std_node): Remove comment about it being NULL. + (fake_std_node): Remove. + * decl.c (in_fake_std): Remove. + (walk_namespaces_r): Remove fake_std_node check. + (push_namespace): Remove in_fake_std code. + (pop_namespace): Likewise. + (lookup_name_real): Remove fake_std_node check. + (init_decl_processing): Always create std_node. Always add + std:: things there. + (builtin_function): Always put non '_' fns in std. + * decl2.c (flag_honor_std): Remove. + (lang_f_options): Remove honor-std. + (unsupported_options): Add honor-std. + (set_decl_namespace): Remove fake_std_node check. + (validate_nonmember_using_decl): Likewise. + (do_using_directive): Likewise. + (handle_class_head): Likewise. + * dump.c (cp_dump_tree): Likewise. + * except.c (init_exception_processing): Adjust. + * init.c (build_member_call): Remove fake_std_node check. + (build_offset_ref): Likewise. + * lang-options.h: Remove -fhonor-std, -fno-honor-std. + * rtti.c (init_rtti_processing): Adjust. + +2001-07-31 Alexandre Petit-Bianco + + * tree.c (cp_tree_equal): WITH_CLEANUP_EXPR node to use its second + operand while calling cp_tree_equal. + +2001-07-31 Nathan Sidwell + + The 3.0 ABI no longer has vbase pointer fields. + * cp-tree.h (VBASE_NAME, VBASE_NAME_FORMAT, VBASE_NAME_P, + FORMAT_VBASE_NAME): Remove. + * method.c (do_build_copy_constructor): Adjust. + (do_build_assign_ref): Adjust. + * search.c (lookup_field_r): Adjust. + * typeck.c (build_component_ref): Adjust. + + The 3.0 ABI always has a vtable pointer at the start of every + polymorphic class. + * rtti.c (build_headof_sub): Remove. + (build_headof): Adjust. + (get_tinfo_decl_dynamic): No need to check flag_rtti + here. Adjust. + (create_real_tinfo_var): Explain why we need a hidden name. + +2001-07-31 Nathan Sidwell + + PR c++/3631 + * class.c (update_vtable_entry_for_fn): The fixed adjustment + of a virtual thunk should be from declaring base. + +2001-07-31 Nathan Sidwell + + * class.c (dfs_ctor_vtable_bases_queue_p): Always walk into + the shared virtual base, so preserving inheritance graph order. + +2001-07-30 Andreas Jaeger + + * decl2.c: Remove unused var global_temp_name_counter. + +2001-07-28 Richard Henderson + + * method.c (pending_inlines): Remove. + +2001-07-27 Nathan Sidwell + + * class.c (mark_primary_virtual_base): Don't adjust base + offsets here. + (dfs_unshared_virtual_bases): Adjust them here. + (mark_primary_bases): Explain why we adjust at the end. + +2001-07-27 Nathan Sidwell + + * class.c (finish_struct_1): When copying the primary base's + VFIELD, make sure we find it is at offset zero. + +2001-07-26 Kriang Lerdsuwanakij + + * pt.c (tsubst_template_parms): Call maybe_fold_nontype_arg and + tsubst_expr for default template arguments. + +2001-07-26 Nathan Sidwell + + PR c++/3621 + * spew.c (yylex): Only copy the token's lineno, if it is + nonzero. + +2001-07-26 Nathan Sidwell + + PR c++/3624 + * call.c (resolve_args): Simplify, call + convert_from_reference. + (build_new_op): Resolve and convert from reference ARG1 + earlier. Adjust ARG2 & ARG3 resolve and conversion. + +2001-07-26 Nathan Sidwell + + * decl.c (last_function_parm_tags): Remove. + (current_function_parm_tags): Remove. + (init_decl_processing): Adjust. + (start_function): Adjust. + (store_parm_decls): Adjust. + + PR c++/3152 + * decl.c (grokdeclarator): Detect when a function typedef is + declaring a function, and create last_function_parms correctly. + +2001-07-25 Jason Merrill + + * call.c (joust): Only prefer a non-builtin candidate to a builtin + one if they have the same signature. + + * cvt.c (build_up_reference): Take DECL parm. Check TREE_STATIC on + it rather than toplevel_bindings_p. Give it a mangled name if static. + (convert_to_reference): Adjust. + * decl2.c (get_temp_name): Lose. + * mangle.c (mangle_ref_init_variable): New fn. + (mangle_guard_variable): Strip the ref-init header. + * cp-tree.h: Adjust. + * decl.c (cp_finish_decl): Add the DECL_STMT after processing the + initializer. + (grok_reference_init): Always use DECL_INITIAL. + +2001-07-25 Nathan Sidwell + + PR c++/3416 + * call.c (build_conditional_expr): Recheck args after + conversions. + * cp-tree.h (build_conditional_expr): Move to correct file. + * typeck.c (decay_conversion): Diagnose any unknown types + reaching here. + (build_binary_op): Don't do initial decay or default + conversions on overloaded functions. + (build_static_cast): Don't do a decay conversion here. + +2001-07-25 Nathan Sidwell + + PR c++/3543 + * typeck.c (condition_conversion): Resolve an OFFSET_REF. + * expr.c (cplus_expand_expr): An OFFSET_REF should never get here. + +2001-07-25 Nathan Sidwell + + * class.c (build_vtbl_or_vbase_field): Remove, move into ... + (create_vtbl_ptr): ... here. + +2001-07-25 Nathan Sidwell + + * class.c (build_vbase_offset_vbtl_entries): Look for + non-primary base of which we are a sub vtable. + +2001-07-24 Phil Edwards + + * semantics.c (finish_this_expr): Remove unused code. + +2001-07-24 Nathan Sidwell + + Simplify rtti, now we've only one ABI. + * cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID, + CPTI_TINFO_VAR_ID. + (tinfo_decl_id, tinfo_var_id): Remove. + (get_typeid_1): Remove. + * rtti.c + (init_rtti_processing): Remove tinfo_decl_id & tinfo_var_id. + (typeid_ok_p): New function. + (build_type_id): Call typeid_ok_p. Don't call tinfo_from_decl. + (get_tinfo_decl): Remove old abi documentation. + (tinfo_from_decl): Remove. + (get_type_id): Call typeid_ok_p. Absorb get_typeid_1. + (get_typeid_1): Remove. + (get_base_offset): Remove. + (synthesize_tinfo_var): Absorb get_base_offset. + (create_real_tinfo_var): Don't use tinfo_decl_id. + +2001-07-23 Graham Stott + + * cp/class.c (type_requires_array_cookie): Fix use of uninitialized + variable has_two_argument_delete_p. + +2001-07-21 Nathan Sidwell + + Remove flag_vtable_thunk. It is always on for the 3.0 ABI. + * cp-tree.h (CPTI_DELTA2_IDENTIFIER): Remove. + (CPTI_INDEX_IDENTIFIER): Remove. + (CPT_PFN_OR_DELTA2_IDENTIFIER): Remove. + (delta2_identifier): Remove. + (index_identifier): Remove. + (pfn_or_delta2_identifier): Remove. + (flag_vtable_thunks): Remove. + (VTABLE_DELTA2_NAME): Remove. + (VTABLE_INDEX_NAME): Remove. + (FNADDR_FROM_VTABLE_ENTRY): Adjust. + (vfunc_ptr_type_node): Adjust. + (VTABLE_NAME_PREFIX): Adjust. + (build_vfn_ref): Lose first parameter. + (fixup_all_virtual_upcast_offsets): Remove. + * decl.c (initialize_predefined_identifiers): Remove + delta2_identifier, index_identifier, pfn_or_delta2_identifier. + (init_decl_processing): Remove no-vtable-thunk code. + * decl2.c (flag_vtable_thunks): Remove. + (mark_vtable_entries): Remove no-vtable-thunk code. + * error.c (dump_decl): Remove no-vtable-thunk code. + (dump_expr): Adjust ptr to member function code. + * init.c (initialize_vtable_ptrs): Remove no-vtable-thunk + code. + * rtti.c (build_headof): Remove no-vtable-thunk code. + (get_tinfo_decl_dynamic): Adjust build_vfn_ref call. + * search.c (get_base_distance): Remove expand_upcast_fixups case. + (virtual_context) Remove. + (expand_upcast_fixups): Remove. + (fixup_virtual_upcast_offsets): Remove. + (fixup_all_virtual_upcast_offsets): Remove. + * typeck.c (get_member_function_from_ptrfunc): Remove + no-vtable-thunk code. + * call.c (build_over_call): Adjust call to build_vfn_ref. + * class.c (build_vfn_ref): Lose first parameter. Remove + no-vtable-thunk code. + (build_rtti_vtbl_entries): Remove no-vtable-thunk code. + (build_vtable_entry): Remove no-vtable-thunk code. + +2001-07-20 Nathan Sidwell + + Remove old-abi remnants. Remove comments about old abi + behavior. Remove references to 'new-abi' in comments. + * cp-tree.h: Adjust comments. + (vbase_offsets_in_vtable_p): Delete. + (vcall_offsets_in_vtable_p): Delete. + (vptrs_present_everywhere_p): Delete. + (all_overridden_vfuns_in_vtables_p): Delete. + (merge_primary_and_secondary_vtables_p): Delete. + (TYPE_CONTAINS_VPTR_P): Adjust. + (VTT_NAME_PREFIX): Remove. + (CTOR_VTBL_NAME_PREFIX): Remove. + (init_vbase_pointers): Remove. + * class.c: Adjust coments. + (build_vbase_pointer_fields): Delete. + (build_vbase_pointer): Remove old-abi code. + (build_secondary_vtable): Likewise. + (modify_all_vtables): Likewise. + (create_vtable_ptr): Likewise. + (layout_class_type): Likewise. + (finish_struct_1): Likewise. + (finish_vtbls): Likewise. + (dfs_finish_vtbls): Delete. + (build_vbase_offset_vtbl_entries): Remove old-abi code. + * cvt.c: Adjust comments. + * decl.c: Adjust comments. + * decl2.c: Adjust comments. + * init.c: Adjust comments. + (construct_virtual_bases): Remove old-abi code. + * lang-specs.h: Remove -fno-new-abi. + * mangle.c: Adjust comments. + * rtti.c: Adjust comments. + (get_base_offset): Remove old-abi-code. + * search.c: Adjust comments. + (dfs_init_vbase_pointers): Remove. + (dfs_vtable_path_unmark): Remove. + (init_vbase_pointers): Remove. + * semantics.c: Adjust comments. + (emit_associated_thunks): Remove old-abi code. + * typeck.c: Adjust comments. + +2001-07-20 Daniel Berlin + + * Make-lang.in (cp/optimize.o): Depend on $(PARAMS_H), not + params.h. + +2001-07-19 Mark Mitchell + + * class.c (finish_struct_anon): Forbid nested classes. + +2001-07-19 Neil Booth + + * decl2.c: Don't include dwarfout.h and dwarf2out.h. + * optimize.c: Include debug.h. + (maybe_clone_body): Use debug hook. + * semantics.c: Include debug.h. + (expand_body): Use debug hook. + +2001-07-19 Neil Booth + + * spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases. + +2001-07-18 Mark Mitchell + + * class.c (type_requires_array_cookie): New function. + (check_methods): Don't try to figure out whether the type needs a + cookie here. + (check_bases_and_members): Set TYPE_VEC_NEW_USES_COOKIE here. + * cp-tree.h (TYPE_VEC_DELETE_TAKES_SIZE): Remove. + (TYPE_VEC_NEW_USES_COOKIE): Reimplement. + * pt.c (instantiate_class_template): Don't set + TYPE_VEC_DELETE_TAKES_SIZE. + * NEWS: Document ABI changes from GCC 3.0. + +2001-07-18 Xavier Delacour , + Gerald Pfeifer + + * NEWS (Changes in GCC 3.0): Fix typo. + +2001-07-13 Joseph S. Myers + + * decl2.c (cplus_decl_attributes): Take a pointer to the node to + which attributes are to be attached, and a flags argument. Update + call to decl_attributes. + (grokfield): Update call to decl_attributes. + * class.c (finish_struct): Update call to cplus_decl_attributes. + * cp-tree.h (cplus_decl_attributes): Update prototype. + * decl.c (start_decl, grokdeclarator, start_function): Update + calls to decl_attributes and cplus_decl_attributes. + * friend.c (do_friend): Update call to cplus_decl_attributes. + * parse.y (parse_bitfield): Update call to cplus_decl_attributes. + +2001-07-12 Mark Mitchell + + * decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER + for `register' variables with an asm-specification. + +2001-07-11 Mark Mitchell + + * semantics.c (finish_asm_stmt): Mark the output operands + to an asm addressable, if necessary. + +2001-07-11 Ben Elliston + + * Revert this change -- there is a subtle bug. + + PR c++/80 + * decl.c (finish_enum): New "attributes" argument; pass it to + cplus_decl_attributes. Use a narrower type if the enum is packed. + * cp-tree.h (finish_enum): Adjust prototype. + * parse.y (enum_head): New non-terminal. + (structsp): Use it. Enums now may be preceded or followed by + optional attributes -- pass their chained tree to finish_enum(). + * pt.c (tsubst_enum): Pass NULL_TREE for the new argument. + +2001-07-10 Mark Mitchell + + * pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope + variables. + +2001-07-10 Jason Merrill + + * semantics.c (cp_expand_stmt): Fix for null + current_function_return_value. + +2001-07-10 Jan van Male + + * call.c (build_op_delete_call): Initialize fn. + (convert_like_real): Delete conditional. + (joust): Initialize *w and *l. + * class.c: Add prototype for binfo_ctor_vtable. + (get_primary_binfo): Initialize result. + * init.c (build_java_class_ref): Initialize name. + +2001-07-09 Erik Rozendaal + + * typeck.c (unary_complex_lvalue): Do not duplicate the + argument to modify, pre-, or post-increment when used as an + lvalue and when the argument has side-effects. + +2001-07-08 Joseph S. Myers + + * decl.c (start_decl): Don't call SET_DEFAULT_DECL_ATTRIBUTES. + (start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. Call + cplus_decl_attributes even if attrs is NULL. + * friend.c (do_friend): Don't call SET_DEFAULT_DECL_ATTRIBUTES. + +2001-07-08 Joseph S. Myers + + * decl.c (grokdeclarator), decl2.c (cplus_decl_attributes): Update + calls to decl_attributes. + +2001-07-06 Ira Ruben + + * cp-tree.def (TEMPLATE_DECL): Update comment. DECL_RESULT should + be DECL_TEMPLATE_RESULT. + +2001-07-05 Kriang Lerdsuwanakij + + * cp-tree.h (copy_template_template_parm): Rename to ... + (bind_template_template_parm): ... here. + * tree.c (copy_template_template_parm): Rename to ... + (bind_template_template_parm): ... here. Remove the case when + NEWARGS is NULL_TREE. + (copy_tree_r): Don't copy TEMPLATE_TEMPLATE_PARM and + BOUND_TEMPLATE_TEMPLATE_PARM. + * pt.c (lookup_template_class): Adjust. + +2001-07-05 Jason Merrill + + * cvt.c (convert_lvalue): New fn. + * cp-tree.h: Declare it. + * method.c (do_build_assign_ref): Use it. + (do_build_copy_constructor): Convert parm to base types + before calling base constructors. + + * typeck.c (check_return_expr): Check DECL_ALIGN instead of + DECL_USER_ALIGN. Check flag_elide_constructors instead of + optimize. + * semantics.c (cp_expand_stmt): Don't destroy the named return value. + +2001-07-02 Nathan Sidwell + + * optimize.c (optimize_inline_calls): New function, broken out + of ... + (optimize_function): ... here. Call it. Don't inline if it is + a thunk. + (dump_function): Print name of dump flag causing this dump. + * semantics.c (expand_body): Move thunk inline check to + optimize_function. + +2001-06-29 Joseph S. Myers + + * typeck.c (COMP_TYPE_ATTRIBUTES): Don't define. + (comptypes): Use target.comp_type_attributes. + +2001-06-29 Nathan Sidwell + + * cp-tree.h (flag_dump_class_layout): Remove unneeded declaration. + +2001-06-28 Gabriel Dos Reis + + * error.c (lang_print_error_function): Add a `diagnostic_context *' + parameter. Tweak. + +2001-06-27 Neil Booth + + * decl2.c (import_export_class): Update. + +2001-06-26 Gabriel Dos Reis + + * error.c (init_error): Adjust settings. + +2001-06-26 Gabriel Dos Reis + + * error.c (init_error): Adjust settings. + +2001-06-19 Richard Sandiford + + * except.c (initialize_handler_parm): Expect __cxa_begin_catch to + return pointers to data members by reference rather than by value. + +2001-06-18 Jason Merrill + + Implement the Named Return Value optimization. + * cp-tree.h (struct cp_language_function): Add x_return_value. + (current_function_return_value): Now a macro. + * decl.c: Don't define it. + (define_label, finish_case_label): Don't clear it. + (init_decl_processing): Don't register it with GC. + * semantics.c (genrtl_finish_function): Don't check it for + no_return_label. Copy the RTL from the return value to + current_function_return_value and walk, calling... + (nullify_returns_r): ...this new fn. + * typeck.c (check_return_expr): Set current_function_return_value. + +2001-06-15 Jason Merrill + + * class.c (dfs_accumulate_vtbl_inits): Just point to the base we're + sharing a ctor vtable with. Merge code for cases 1 and 2. + (binfo_ctor_vtable): New fn. + (build_vtt_inits, dfs_build_secondary_vptr_vtt_inits): Use it. + +2001-06-14 Jason Merrill + + * class.c (dfs_find_final_overrider): Fix logic. + + * class.c (update_vtable_entry_for_fn): Uncomment optimization to use + virtual thunk instead of non-virtual. + (get_matching_virtual): Uncomment. + + * pt.c (unify): Don't recurse between the POINTER_TYPE and the + OFFSET_TYPE. If we're adding cv-quals, the extra ones would be on + PARM, not ARG. + +2001-06-14 Nathan Sidwell + + * class.c (dfs_accumulate_vtbl_inits): For case 2 & 3, make sure + we've not emerged from the hierarchy of RTTI_BINFO on reaching + a non-virtual base. + +2001-06-13 Mark Mitchell + + * NEWS: Update release number. + +2001-06-12 Nathan Sidwell + + PR c++/3130, c++/3131, c++/3132 + * cp-tree.h (BINFO_UNSHARED_MARKED): New #define. + * class.c (force_canonical_binfo_r): Move + BINFO_UNSHARED_MARKED, BINFO_LOST_PRIMARY_P. Don't move + virtual bases unless they're primary and what they're primary + too has been moved. + (dfs_unshared_virtual_bases): Use BINFO_UNSHARED_MARKED. Cope + with morally virtual bases. Duplicate BINFO_LOST_PRIMARY_P and + BINFO_PRIMARY_BASE_OF. Clear BINFO_VTABLE for all but the most + derived binfo. + (mark_primary_bases): Use BINFO_UNSHARED_MARKED. + (layout_nonempty_base_or_field): Add most derived type + parameter. Adjust. + (layout_empty_base): Likewise. + (build_base_field): Likewise. + (build_base_fields): Likewise. + (propagate_binfo_offsets): Add most derived type + parameter. Skip non canonical virtual bases too. + (dfs_set_offset_for_unshared_vbases): Don't skip primary + bases. Do skip canonical bases. + (layout_virtual_bases): Adjust. + (layout_class_type): Adjust. + (dfs_get_primary_binfo): Build list of virtual primary base + candidates. + (get_primary_binfo): Check that the shared virtual primary + base candidate was found first. + (accumulate_vtbl_inits): Don't do anything for non-vptr + containing binfos. For case 1 primary virtual bases, keep + checking that we've not emerged from the hierarchy of RTTI_BINFO. + +2001-06-12 Nathan Sidwell + + PR c++/3089 + * class.c (dfs_accumulate_vtbl_inits): Always walk down the + hierarchy looking for primary bases for a ctor + vtable. Recursively call oneself, if we meet our primary via + this route and haven't met it yet via inheritance graph order. + +2001-06-11 Mark Mitchell + + * lang-options.h: Emit documentation for -fno-honor-std, not + -fhonor-std. + +2001-06-10 Alexandre Oliva + + * typeck.c (get_member_function_from_ptrfunc) [vbit_in_delta]: + Don't clobber delta. + (expand_ptrmemfunc_cst) [ptrmemfunc_vbit_in_delta]: Adjust pfn. + +2001-06-10 Mark Mitchell + Gabriel Dos Reis + + * Make-lang.in (cp/call.o): Depend on diagnostic.h + (cp/typeck.o): Depend on diagnostic.h + (cp/typeck2.o): Depend on diagnostic.h + (cp/repo.o): Depend on dignostic.h + * typeck.c: #include diagnostic.h + (convert_for_initialization): Remove extern declaration for + warningcount and errorcount. + + * call.c: #include diagnostic.h + (convert_like_real): Remove extern declaration for warnincount and + errorcount. + + * repo.c: #include diagnostic.h + * typeck2.c: #include diagnostic.h + +2001-06-08 Nathan Sidwell + + * decl.c (duplicate_decls): Fix DECL_TEMPLATE_RESULT thinko + in previous change. + +2001-06-08 Nathan Sidwell + + PR c++/2929 + * friend.c (do_friend): Use push_decl_namespace for classes at + namespace scope. + +2001-06-08 Nathan Sidwell + Jason Merrill + + PR c++/3061 + * class.c (build_secondary_vtable): Use assert, rather than an error + message. + (dfs_fixup_binfo_vtbls): BINFO_VTABLE might be NULL. + (dfs_accumulate_vtbl_inits): A lost primary virtual base may + be between ORIG_BINFO and RTTI_BINFO, but neither of them. + Don't set BINFO_VTABLE for a primary virtual base. + +2001-06-07 Mark Mitchell + + * decl.c (duplicate_decls): Update source position information + when a template function is defined. + +2001-06-07 Phil Edwards + + * lang-specs.h: Move -D_GNU_SOURCE to config/linux.h. + +2001-06-07 Nathan Sidwell + + PR c++/2914 + * decl.c (pushtag): Don't push into a complete type's scope. + +2001-06-06 Jason Merrill + + * cp-tree.h (THUNK_GENERATE_WITH_VTABLE_P): Lose. + (struct lang_decl_flags): Lose generate_with_vtable_p. + (BV_GENERATE_THUNK_WITH_VTABLE_P): Lose. + * class.c (copy_virtuals): Adjust. + * decl2.c (mark_vtable_entries): Adjust. + * method.c (make_thunk, build_vtable_entry): Adjust. + * class.c (update_vtable_entry_for_fn): Only look as far as the + first defining class. + (build_vtbl_initializer): Put nothing in the slot for a function only + defined in a lost primary virtual base. + (add_vcall_offset_vtbl_entries_1): Use the same code for + the lost primary case and the normal case. + (dfs_unshared_virtual_bases): Don't lose a non-virtual primary base. + (get_vfield_offset, get_derived_offset): Lose. + (dfs_find_final_overrider): Use look_for_overrides_here. + (get_matching_virtual): New fn. + * semantics.c (emit_associated_thunks): Check BV_USE_VCALL_INDEX_P, + not BV_VCALL_INDEX. + * search.c (look_for_overrides_here): Split out from... + (look_for_overrides_r): Here. + + * class.c (find_final_overrider): Return error_mark_node on error. + + * decl2.c (key_method): #if 0 accidental change. + +2001-06-06 John David Anglin + + * call.c (convert_default_arg): Use INTEGRAL_TYPE_P. + (build_over_call): Likewise. + * decl.c (grokparms): Likewise. + * pt.c (tsubst_decl): Likewise. + * typeck.c (convert_arguments): Likewise. + +2001-06-05 Mark Mitchell + + * semantics.c (begin_class_definition): Robustify. + + * pt.c (instantiate_decl): Tell the repository code about the + clones, not the cloned functions. + * repo.c (repo_template_used): Explicitly instantiate the cloned + function, not the clones. + +2001-06-05 Nathan Sidwell + + * call.c (build_user_type_conversion_1): Set ICS_USER_FLAG and + ICS_BAD_FLAG on created conversion. + (compare_ics): Break out rank. + +2001-06-05 Nathan Sidwell + + * decl.c (xref_tag): Remove extraneous %s on dependent name + lookup warning. + +2001-06-05 Nathan Sidwell + + * class.c (layout_vtable_decl): Fix off by one error on + build_index_type. + (build_vtt): Likewise. + (build_ctor_vtbl_group): Likewise. + +2001-06-05 Nathan Sidwell + + * class.c (maybe_indent_hierarchy): New function. + (dump_class_hierarchy_r): Add flags. Dump extra binfo + information, if enabled. Use maybe_indent_hierarchy. Adjust + output format. + (dump_class_hierarchy): Adjust prototype. Adjust output format. + (dump_array, dump_vtable, dump_vtt): New functions. + (finish_struct_1): Adjust hierarchy dumping. + (initialize_vtable): Call dump_vtable. + (build_vtt): Call dump_vtt. + (build_ctor_vtbl_group): Call dump_vtable. + * decl2.c (flag_dump_class_layout): Remove. + (cxx_decode_option): Remove dump translation unit + and dump class hierarchy check. Call dump_switch_p. + (finish_file): Adjust dumping. + (dump.c): Only dump base classes if not TDF_SLIM. + Only dump namespace members if not TDF_SLIM. + * optimize.c (dump_function): New function. + (optimize_function): Call dump_function. + * semantics.c (expand_body): Use dump_enabled_p. + +2001-06-01 Nathan Sidwell + + PR g++/2936 + Part missed from first commit + * decl2.c (finish_anon_union): Copy context. + +2001-05-30 Nathan Sidwell + + PR g++/2936 + * optimize.c (remap_decl): Remap anonymous aggregate members too. + +2001-05-26 Nathan Sidwell + + PR g++/2823 + * semantics.c (expand_body): Don't optimize thunks. + +2001-05-25 Sam TH + + * cp-tree.h lex.h: Fix header include guards. + +2001-05-25 Mark Mitchell + + * decl.c (init_decl_processing): Tweak. + +2001-05-24 Mark Mitchell + + * decl.c (duplicate_decls): Tidy. + (init_decl_processing): Always set flag_no_builtin. + +2001-05-24 Nathan Sidwell + + PR c++/2184 + * decl2.c (do_local_using_decl): Push the decls, even in a + template. + +2001-05-22 Mark Mitchell + + * optimize.c (initialize_inlined_parameters): Don't set + TREE_READONLY for a VAR_DECL taking the place of an inlined + PARM_DECL. + +2001-05-22 Jason Merrill + + * class.c, cp-tree.h, rtti.c: Remove com_interface attribute support. + * tree.c (cp_valid_lang_attribute): Warn about use of com_interface + attribute. + +2001-05-22 Joseph S. Myers + + * parse.y: Refer to compound literals as such, not as + constructor-expressions. + +2001-05-21 Mark Mitchell + + * call.c (build_op_delete_call): Ignore exception-specifications + when looking for matching delete operators. + * init.c (build_new_1): Compute whether or not the allocation + function used is a placement allocation function or not, and + communicate this information to build_op_delete_call. + +2001-05-21 Jason Merrill + + * class.c (build_vtable_entry_ref): Lose vtbl parm. Fix for new abi. + (build_vtbl_ref): Adjust. + (dfs_accumulate_vtbl_inits): Set TREE_CONSTANT on the vtable address. + * decl2.c (lang_f_options): Remove huge-objects, vtable-thunks. + Re-add vtable-gc. + (unsupported_options): Correspondingly. + + * decl2.c (maybe_make_one_only): Check flag_weak, not + supports_one_only(). + + * cp-tree.def (START_CATCH_STMT): Lose. + * dump.c (cp_dump_tree): Don't dump it. Do dump HANDLER_PARMS. + * tree.c (cp_statement_code_p): Don't case it. + * semantics.c (cp_expand_stmt): Likewise. + * cp-tree.h (START_CATCH_TYPE): Lose. + (HANDLER_TYPE): New. + * except.c (expand_start_catch_block): Don't start any blocks. + Return the type. + (expand_end_catch_block): Don't end any blocks. + * parse.y (handler): Don't pass anything from finish_handler_parms + to finish_handler. + * pt.c (tsubst_expr): Likewise. + * semantics.c (begin_handler): Call note_level_for_catch here. + (finish_handler_parms): Don't return anything. + (genrtl_catch_block, begin_catch_block): Lose. + (genrtl_handler): Call expand_start_catch here. + +2001-05-18 Jason Merrill + + * class.c (build_vtable): Set DECL_ASSEMBLER_NAME for vtables here. + (get_vtable_decl, build_vtt): Not here. + +2001-05-20 Nathan Sidwell + + PR c++/2781 + * optimize.c (update_cloned_parm): Copy addressability and other + flags. + +2001-05-20 Kriang Lerdsuwanakij + + * pt.c (determine_specialization): Ignore artificial functions. + +2001-05-20 Neil Booth + + * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. + (C_RID_CODE): Remove. + * lex.c (cxx_init_options): Call set_identifier_size. Update. + (init_parse): Don't do it here. + +2001-05-18 Diego Novillo + + * decl2.c (finish_objects): Use the original SYMBOL_REF from the + function declaration to avoid stripping the symbol's attributes. + +2001-05-18 Nathan Sidwell + + * decl.c (pushdecl): Adjust error string. + (xref_tag): Adjust friend class injection warning. Remove the + inherited name from the class shadowed scope. + +2001-05-17 Mark Mitchell + + * except.c (cp_protect_cleanup_actions): New function. + (init_exception_processing): Don't set protect_cleanup_actions + here. Do set lang_protect_cleanup_actions. + +2001-05-16 Nathan Sidwell + + * spew.c (read_token): Call yyerror on all unexpected tokens. + +2001-05-16 Nathan Sidwell + + * init.c (member_init_ok_or_else): Take a tree rather than + string for name. + (expand_member_init): Adjust. + +2001-05-14 Nick Clifton + + * decl.c (duplicate_decls): Suppress warning about duplicate + decls if the first decl is a friend. + +2001-05-12 Zack Weinberg + + * except.c (choose_personality_routine): Export. Add + explanatory comment. Take an enum languages, not a boolean. + (initialize_handler_parm): Adjust to match. + * cp-tree.h: Prototype choose_personality_routine. + * lex.c (handle_pragma_java_exceptions): New function. + (init_cp_pragma): Register #pragma GCC java_exceptions. + +2001-05-12 Neil Booth + + * method.c (build_mangled_C99_name): Remove unused prototype. + +2001-05-12 Alexandre Oliva + + * cp-tree.h (ptrmemfunc_vbit_where_t): Declare type. + * typeck.c (get_member_function_from_ptrfunc, + build_ptrmemfunc, expand_ptrmemfunc_cst): Take + TARGET_PTRMEMFUNC_VBIT_LOCATION into account. + + Reverted Geoff Keating's 2001-05-03's patch. + +2001-05-11 Ira Ruben + + * cp/cp-tree.h (C_EXP_ORIGINAL_CODE): Delete; declared in c-common.h. + +2001-05-11 Neil Booth + + * cp-tree.h (finish_label_expr, lookup_label): Delete. + * parse.y: Update for '&&'; don't issue warning here. + * semantics.c (finish_label_expr): Delete. + +2001-05-07 Mark Mitchell + + * splay-tree.h (splay_tree_max): New function. + (splay_tree_min): Likewise. + +2001-05-03 Geoffrey Keating + + * cp-tree.h (enum cp_tree_index): Add CPTI_PFN_VFLAG_IDENTIFIER. + (pfn_vflag_identifier): Define. + Update comment about layout of pointer functions. + (build_ptrmemfunc1): Update prototype. + (expand_ptrmemfunc_cst): Update prototype. + * decl.c (initialize_predefined_identifiers): Initialize + pfn_vflag_identifier. + (build_ptrmemfunc_type): When FUNCTION_BOUNDARY < 16, add + an extra field to the type. + * expr.c (cplus_expand_constant): Pass 'flag' between + expand_ptrmemfunc_cst and build_ptrmemfunc1. + * typeck.c (get_member_function_from_ptrfunc): When + FUNCTION_BOUNDARY < 16, look at additional field to determine + if a pointer-to-member is a real pointer or a vtable offset. + (build_ptrmemfunc1): Add new parameter to contain extra field. + (build_ptrmemfunc): Pass the extra field around. + (expand_ptrmemfunc_cst): Add new parameter to return extra field. + (pfn_from_ptrmemfunc): Ignore the extra field. + +2001-05-03 Mark Mitchell + + * cp-tree.h (flag_inline_trees): Update documentation. + * decl.c (init_decl_processing): Adjust handling of + flag_inline_functions and flag_inline_trees to support -O3. + (grokfndecl): Set DECL_INLINE on all functions if that's what + the user requested. + (save_function_data): Clear DECL_INLINE in + current_function_cannot_inline is non-NULL. + * decl2.c (flag_inline_trees): Update documentation. + +2001-05-03 Nathan Sidwell + + * dump.c (cp_dump_tree, USING_STMT case): New case. + * tree.c (cp_statement_code_p): Add USING_STMT. + * decl2.c (do_using_directive): Add the using directive statement. + + * tree.c (walk_tree): Reformat an if block. + +2001-05-02 Mark Mitchell + + * decl.c (compute_array_index_type): Don't try to do anything with + the indices when processing a template. + +2001-05-02 Kaveh R. Ghazi + + * call.c: NULL_PTR -> NULL. + * class.c: Likewise. + * cvt.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * init.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2001-05-02 Mark Mitchell + + * decl2.c (do_using_directive): Revert previous patch. + +2001-05-01 Nathan Sidwell + + * cp-tree.def (USING_STMT): New statement node. + * cp-tree.h (USING_STMT_NAMESPACE): New macro. + * decl2.c (do_using_directive): Add USING_STMT to statement + tree. Don't emit errors when processing template decl. + * pt.c (tsubst_expr, USING_STMT case): New case. + * semantics.c (cp_expand_stmt, USING_STMT case): New case. + +2001-05-01 Nathan Sidwell + + * call.c (build_new_op): Convert args from reference here. + (build_conditional_expr): Don't convert here. + +2001-05-01 Nathan Sidwell + + * spew.c (last_token_id): New static variable. + (read_token): Set it here. + (yyerror): Use it here. + +2001-04-30 Richard Henderson + + * cvt.c: Downcase C_PROMOTING_INTEGER_TYPE_P invocations. + * decl.c: Likewise. + +2001-04-30 Mark Mitchell + + * gxxint.texi: Remove. + * Make-lang.in: Remove all traces of gxxint.texi. + +2001-04-30 Mark P Mitchell + + * decl2.c (start_static_initialization_or_destruction): Correct + logic to handle the -fno-use-cxa-atexit case. + +2001-04-30 Mark Mitchell + + * optimize.c (update_cloned_parm): New function. + (maybe_clone_body): Use it. Update the `this' parameter too. + +2001-04-29 Joseph S. Myers + + * decl2.c (unsupported_options): Add new-abi. + * lang-options.h: Remove no longer supported options. + +2001-04-27 Nathan Sidwell + + * except.c (can_convert_eh): Don't check template parms, + typename types etc. + +2001-04-27 Nathan Sidwell + + * optimize.c (maybe_clone_body): Copy parameter names and locations. + +2001-04-27 Nathan Sidwell + + * cp-tree.h (adjust_clone_args): Prototype new function. + * class.c (adjust_clone_args): New function. + * decl.c (start_function): Call it for in charge ctors. + +2001-04-26 Mark Mitchell + + * method.c (use_thunk): Make sure that thunks really are emitted + when requested. + +2001-04-26 Nathan Sidwell + + * mangle.c (write_chars): New macro. + (hwint_to_ascii): New function + (write_number): Use it. + (write_integer_cst): Deal with really big numbers. + +2001-04-25 Mark Mitchell + + * optimize.c (maybe_clone_body): Copy TREE_PUBLIC before emitting + the clone. + +2001-04-25 Nathan Sidwell + + * decl.c (grokdeclarator): Set context of namespace scope + TYPE_DECLS. + +2001-04-24 Zack Weinberg + + * cp/optimize.c: Include hashtab.h. + (struct inline_data): Add tree_pruner. + (expand_call_inline, expand_calls_inline): Use it when calling + walk_tree. + (optimize_function): Initialize and free tree_pruner. + +2001-04-24 Nathan Sidwell + + Lazy __FUNCTION__ generation. + * cp-tree.def (FUNCTION_NAME): Remove. + * cp-tree.h (function_name_declared_p): Remove. + (cp_fname_init): Prototype. + * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, + don't call declare_function_name. Call start_fname_decls. + (cp_make_fname_decl): Adjust parameters. Generate the name. Don't + clobber the line number. + (cp_fname_init): New function. + (start_function): Call start_fname_decls. + (finish_function): Call finish_fname_decls. + * lex.c (reswords): Add slots for __FUNCTION__ et al. + (rid_to_yy): Add mappings for __FUNCTION__ et al. + * optimize.c (maybe_clone_body): Remove function_name_declared_p. + * parse.y (VAR_FUNC_NAME): New token. + (primary): Add VAR_FUNC_NAME. + * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's + generation. + (tsubst, FUNCTION_NAME case): Remove. + (tsubst_copy, FUNCTION_NAME case): Remove. + (tsubst_expr, DECL_STMT case): Be careful with a + DECL_PRETTY_FUNCTION_P. + (instantiate_decl): Remove function_name_declared_p. + * semantics.c (begin_compound_statement): Don't call + declare_function_name here. + (setup_vtbl_ptr). Don't save & restore function_name_declared_p. + (finish_translation_unit): Call finish_fname_decls. + (expand_body): Remove function_name_declared_p. + * typeck2.c (digest_init): Allow any ERROR_MARK. + +2001-04-24 Nathan Sidwell + + * pt.c (tsubst_decl): Use VOID_TYPE_P. + * semantics.c: Fix some typos. + +2001-04-23 Phil Edwards + + * cp/decl2.c (flag_honor_std): Always initialize to 1. + +2001-04-22 Kaveh R. Ghazi + + * xref.c (GNU_xref_file): Use concat in lieu of xmalloc/sprintf. + +2001-04-23 Jason Merrill + + * except.c (build_throw): Wrap the initialization of the exception + object in a MUST_NOT_THROW_EXPR. + (do_free_exception): #if 0. + +2001-04-20 Mark Mitchell + + * cp-tree.h (finish_enum): Change prototype. + * decl.c (finish_enum): Reorganize. + * parse.y (structsp): Adjust calls to finish_enum. + +2001-04-20 Nathan Sidwell + + * tree.c (cp_tree_equal): Adjust final switch formatting. Add + 't' case. + +2001-04-20 Nathan Sidwell + + * class.c (dfs_unshared_virtual_bases): Add ATTRIBUTE_UNUSED. + (layout_empty_base): Return at end flag. + (build_base_field): Likewise. + (build_base_fields): Likewise. + (layout_virtual_bases): Don't add 1 to eoc value. + (end_of_class): Use full size for empty bases. + (layout_class_type): Clear CLASSNEARLY_EMPTY_P if we appended + empty bases. Don't add 1 to eoc value. Only add trailing padding + if we're an empty class with no empty bases. + (dump_class_hierarchy): Dump size and alignment. + +2001-04-20 Jakub Jelinek + + * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and + ICS_BAD_FLAG. + +2001-04-20 Jakub Jelinek + + * search.c (lookup_field_r): If looking for type and non-TYPE_DECL + is found, look first if name does not match the structure name. + +2001-04-19 Mark Mitchell + + * cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is + set. + (SET_DECL_LANGUAGE): New macro. + * decl.c (duplicate_decls): Use SET_DECL_LANGUAGE. + (pushdecl): Likewise. + (build_library_fn_1): Likewise. + (build_cp_library_fn): Likewise. + (grokfndecl): Likewise. + (grokvardecl): Mark `extern "C"' variables as having C linkage. + * decl2.c (grokclassfn): Use SET_DECL_LANGUAGE. + * lex.c (retrofit_lang_decl): Likewise. + * mangle.c (mangle_decl_string): Don't mangle the names of + variables declared with C language linkage. + * semantics.c (finish_member_declaration): Use SET_DECL_LANGUAGE. + +2001-04-18 John David Anglin + + * semantics.c (simplify_aggr_init_exprs_r): Don't restore + flag_access_control from uninitialized storage. + +2001-04-15 Mark Mitchell + + * cp-tree.h (TYPE_PTRMEM_CLASS_TYPE): Improve documentation. + * mangle.c (write_pointer_to_member_type): Fix mangling of + pointers to cv-qualified member function types. + + * init.c (build_delete): Create a SAVE_EXPR for the address if + we're going to use it more than once. + +2001-04-13 Mark Mitchell + + * cp-tree.h (DELTA2_FROM_PTRMEMFUNC): Remove. + (expand_ptremfunc_cst): Change prototype. + (delta2_from_ptrmemfunc): Remove. + * expr.c (cplus_expand_constant): Adjust call to + expand_ptrmemfunc_cst. + * typeck.c (build_ptrmemfunc1): Simplify. + (build_ptrmemfunc): Make sure that casting a PTRMEM_CST still + results in a constant. + (expand_ptrmemfunc_cst): Remove idx and delta2 parameters. + (delta2_from_ptrmemfunc): Remove. + (pfn_from_ptrmemfunc): Adjust call to expand_ptrmemfunc_cst. + +2001-04-12 Jason Merrill + + * cp-tree.h (decl_namespace_list): New macro. + (struct saved_scope): Add decl_ns_list. + * decl.c (mark_saved_scope): Mark it. + * decl2.c: Lose static decl_namespace_list. + (init_decl2): Don't save it. + +2001-04-12 Kaveh R. Ghazi + + * cp-tree.h (warn_return_type, yylex): Delete redundant + declarations. + + * decl.c (current_class_depth, global_namespace): Likewise. + + * decl2.c (current_class_depth, flag_gnu_xref): Likewise + + * repo.c (flag_use_repository): Likewise. + +2001-04-12 Kaveh R. Ghazi + + * cp-tree.h (pedantic, convert, global_bindings_p, insert_block, + set_block, pushdecl, getdecls, gettags, init_decl_processing, + maybe_build_cleanup, copy_lang_decl, prep_stmt, lvalue_p, + lvalue_or_else, print_lang_statistics, comp_target_types, + unsigned_type, signed_type, signed_or_unsigned_type, + build_function_call, mark_addressable, incomplete_type_error): + Delete redundant declarations. + +2001-04-11 Jason Merrill + + * cp-tree.h (TYPE_LINKAGE_IDENTIFIER): New macro. + (TYPE_ANONYMOUS_P): New macro. + (TAGGED_TYPE_P): New macro. + * decl.c (check_tag_decl): Use TYPE_ANONYMOUS_P. + (grokfndecl, grokvardecl, grokdeclarator): Likewise. + * tree.c (no_linkage_helper): Likewise. + * semantics.c (begin_class_definition): Likewise. + * pt.c (convert_template_argument): Likewise. + * lex.c (check_for_missing_semicolon): Likewise. + +2001-04-12 Nathan Sidwell + + * class.c (dfs_unshared_virtual_bases): New function. + (mark_primary_bases): Call it. + (check_bases): Ignore virtual bases when determining + nearly-emptiness. + +2001-04-12 Nathan Sidwell + + * method.c (make_thunk): Clear DECL_CLONED_FUNCTION. + +2001-04-11 Mark Mitchell + + * optimize.c (maybe_clone_body): Copy DECL_NUM_STMTS from the + cloned function to the clone. + +2001-04-11 Kaveh R. Ghazi + + * Make-lang.in (cp/semantics.o): Depend on $(EXPR_H). + + * semantics.c: Include expr.h. + +2001-04-11 Nathan Sidwell + + * method.c (implicitly_declare_fn): Commonize code for copy ctor + and assignment op. Set TREE_USED for parameter. + +2001-04-10 Mark Mitchell + + * class.c (find_final_overrider_data): Add `candidates'. + (dfs_find_final_overrider): Don't issue error messages + prematurely. + (find_final_overrider): Issue error messages here. + (build_base_field): Don't warn about amgibuous direct bases here. + (warn_about_ambiguous_direct_bases): New function. + (layout_class_type): Use it. + +2001-04-10 Richard Henderson + + * typeck.c (build_array_ref): Push the array reference inside + COMPOUND_EXPR and COND_EXPR. + +2001-04-05 Mark Mitchell + + * cp-tree.h (DECL_THIS_INLINE): Rename to DECL_DECLARED_INLINE_P. + * decl.c (duplicate_decls): Adjust accordingly. + (maybe_commonize_var): Likewise. + (grokfndecl): Likewise. + (start_function): Likewise. + (start_method): Likewise. + * decl2.c (key_method): Likewise. + (import_export_decl): Likewise. + * method.c (implicitly_declare_fn): Likewise. + * optimize.c (maybe_clone_body): Likewise. + +2001-04-05 Benjamin Kosnik + + * lang-specs.h: Add __DEPRECATED. + +2001-04-05 J"orn Rennecke + + * search.c (get_dynamic_cast_base_type): When building a new + constant, set its type to ssizetype. + +2001-04-04 Jakub Jelinek + + * optimize.c (expand_call_inline): Only add newly inlined statements + into inlined_stmts. + +2001-04-03 Mark Mitchell + + * cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove. + (OPERATOR_FORMAT): Likewise. + (OPERATOR_TYPENAME_FORMAT): Likewise. + * operators.def: Remove old name-mangling information. + * decl.c (grok_op_properties): Adjust accordingly. + * lex.c (init_operators): Likewise. + * rtti.c (get_tinfo_decl): Issue error messages about types that + have variable size. + +2001-04-03 Mark Mitchell + + * decl2.c (import_export_decl): Don't call import_export_class + when processing an inline member function. + * semantics.c (expand_body): Call import_export_decl before + emitting inline functions. + +2001-03-28 Richard Henderson + + IA-64 ABI Exception Handling: + * cp-tree.def (EH_SPEC_BLOCK): New. + (MUST_NOT_THROW_EXPR): New. + * cp-tree.h: Update changed function declarations. + (CPTI_PUSH_EXCEPTION_IDENTIFIER): Remove. + (CPTI_CALL_UNEXPECTED): New. + (struct cp_language_function): Rename x_eh_spec_try_block + to x_eh_spec_block. + (EH_SPEC_STMTS, EH_SPEC_RAISES): New. + * decl.c (current_binding_level): If no current function + bindings, revert to scope_chain. + (initialize_predefined_identifiers): Remove __cp_push_exception. + (store_parm_decls): Use begin_eh_spec_block. + (finish_function): Use finish_eh_spec_block. + (mark_lang_function): Update for name changes. + * decl2.c (finish_file): No mark_all_runtime_matches. + * dump.c (cp_dump_tree): Handle new tree codes. + * error.c (dump_expr) [BIND_EXPR]: Fix typo. + * except.c (catch_language_init, catch_language): Remove. + (init_exception_processing): Don't set language code. + Initialize call_unexpected_node, protect_cleanup_actions, + eh_personality_libfunc, lang_eh_runtime_type. + (call_eh_info, push_eh_info, get_eh_info, get_eh_value): Remove. + (get_eh_type, get_eh_caught, get_eh_handlers): Remove. + (prepare_eh_type): Split out type canonicalizations ... + (build_eh_type_type): ... from here. + (build_eh_type_type_ref): Remove. + (mark_all_runtime_matches): Remove. + (build_exc_ptr): New. + (do_begin_catch, do_end_catch): New. + (do_pop_exception): Remove. + (build_terminate_handler): Remove. + (choose_personality_routine): Split out language choice from ... + (initialize_handler_parm): ... here. + Use MUST_NOT_THROW_EXPR. + (expand_start_catch_block): Use do_begin_catch. Simplify Java + exception object handling. + (expand_start_eh_spec, expand_end_eh_spec): Remove. + (expand_exception_blocks, alloc_eh_object): Remove. + (begin_eh_spec_block, finish_eh_spec_block): New. + (do_allocate_exception, do_free_exception): New. + (expand_throw): Merge into ... + (build_throw): ... here. Update for abi. + * expr.c (cplus_expand_expr): No expand_internal_throw. + Handle MUST_NOT_THROW_EXPR. + * pt.c (tsubst_expr): Handle EH_SPEC_BLOCK. + * semantics.c (*) Update for except.h name changes. + (genrtl_try_block): No protect_with_terminate. + (genrtl_eh_spec_block): New. + (genrtl_handler): Don't emit the goto here. + (cp_expand_stmt): Handle EH_SPEC_BLOCK. + (genrtl_finish_function): Don't expand_exception_blocks. + * tree.c (cp_statement_code_p): Handle EH_SPEC_BLOCK. + +2001-03-28 Richard Henderson + + * decl.c (struct named_label_list): Rename eh_region to + in_try_scope, add in_catch_scope. + (struct binding_level): Rename eh_region to is_try_scope, + add is_catch_scope. + (note_level_for_try): Rename from note_level_for_eh. + (note_level_for_catch): New. + (poplevel): Copy both is_try_scope and is_catch_scope to + the named_label_list struct. + (check_previous_goto_1): Don't check for catch block via + DECL_ARTIFICIAL; use in_try_scope instead. + (check_goto): Likewise. + * cp-tree.h (note_level_for_try, note_level_for_catch): Declare. + * except.c (expand_start_catch_block): Call note_level_for_catch. + * semantics.c (begin_compound_stmt): Update for note_level_for_try. + +2001-03-27 Richard Henderson + + * except.c: Use USING_SJLJ_EXCEPTIONS instead of + exceptions_via_longjmp. + +2001-03-27 Phil Edwards + + * pt.c (check_default_tmpl_args): Make error messages clearer. + +2001-03-26 Phil Edwards + + * error.c: Also undefine 'A' macro used for cp_printers definition. + +2001-03-27 Kaveh R. Ghazi + + * Make-lang.in: Depend on $(SYSTEM_H), not system.h. + +2001-03-26 Mike Yang + Mark Mitchell + + * dump.c (dump_access): New function. + (cp_dump_tree): Use it. Dump basetype information for class + types. + +2001-03-26 Mark Mitchell + + * Makefile.in (optimize.o): Depend on params.h. + (duplicate_decls): Copy DECL_NUM_STMTS, not DECL_FRAME_SIZE. + (init_decl_processing): Set flag_no_inline when doing + inlining-on-trees. + * optimize.c: Include params.h. + (struct inline_data): Improve documentation of FNS. Add + FIRST_INLINED_FN, INLINED_STMTS, and CLONING_P. + (INSNS_PER_STMT): New macro. + (remap_block): Use CLONING_P. + (inlinable_function_p): Don't inline big functions. + (expand_call_inline): Keep track of how much inlining we've done. + (optimize_function): Set FIRST_INLINED_FN. + (maybe_clone_body): Set CLONING_P. + * semantics.c (simplify_aggr_init_exprs_r): Fix typing problems in + tree nodes. + (genrtl_finish_function): Clear DECL_DEFER_OUTPUT before calling + rest_of_compilation. Clear DECL_RTL for local variables + afterwards. + (clear_decl_rtl): New function. + +2001-03-26 Nathan Sidwell + + Implement DR 209 + * cp-tree.h (skip_type_access_control, + reset_type_access_control): Prototype. + * decl.c (grokdeclarator): Access of friends is not checked. + * parse.y (component_decl_list): Reset type access control. + * semantics.c (decl_type_access_control): Clear + current_type_lookups. + (save_type_access_control): Don't save if not deferring. + (skip_type_access_control, reset_type_access_control): New + functions. + (begin_class_definition): Do type access control for basetypes. + Start deferred access control. + (finish_class_definition): Resume immediate access control if + this is a local class. + +2001-03-25 Kaveh R. Ghazi + + * class.c (add_method): Use memcpy/memmove, not bcopy. + + * decl.c (duplicate_decls): Likewise. + +2001-03-23 Jakub Jelinek + + * mangle.c (write_discriminator): Use `_0' for discriminator 1, + not `_'. + +2001-03-23 Jakub Jelinek + + * decl.c (local_names): Define. + (push_local_name): New. + (grok_reference_init): Return init if initializing static reference + variable with non-constant instead of emitting it. + Move expand_static_init call to cp_finish_decl. + (layout_var_decl): Call push_local_name. + (maybe_commonize_var): Allow inlining functions even if they have + static local variables, use comdat_linkage for them if flag_weak. + (check_initializer): Call obscure_complex_init if + grok_reference_init returned nonzero. + (save_function_data): Clear x_local_names. + (pop_cp_function_context): Free x_local_names. + (mark_inlined_fns): Remove. + (mark_lang_function): Mark x_local_names. + (lang_mark_tree): Don't mark DECL_ACCESS for DECL_DISCRIMINATOR_P. + Mark inlined_fns as tree, remove call to mark_inlined_fns. + * class.c (alter_access): Ensure DECL_ACCESS is never set if + DECL_DISCRIMINATOR_P. + * cp-tree.h (cp_language_function): Add x_local_names. + (lang_decl_flags): Add discriminator into u2. + (lang_decl_inlined_fns): Remove. + (lang_decl): inlined_fns is now a TREE_VEC. + (DECL_DISCRIMINATOR_P, DECL_DISCRIMINATOR): Define. + * optimize.c (inlinable_function_p): DECL_INLINED_FNS is now a + TREE_VEC, not a custom structure. + (optimize_function): Likewise. + * mangle.c (discriminator_for_local_entity): Discriminate among + VAR_DECL local entities. + * search.c (dfs_access_in_type): If DECL_DISCRIMINATOR_P, DECL_ACCESS + is not valid. + +2001-03-22 Bryce McKinlay + + Add support for Java interface method calls. + * cp-tree.h (struct lang_type): Add java_interface flag. + (TYPE_JAVA_INTERFACE): New macro. + * tree.c (cp_valid_lang_attribute): Handle "java_interface" attribute + by setting TYPE_JAVA_INTERFACE. + * call.c (java_iface_lookup_fn): New static. + (build_over_call): If calling a method declared in a + TYPE_JAVA_INTERFACE, call build_java_interface_fn_ref to generate the + expression which resolves the function address. + (build_java_interface_fn_ref): New function. + +2001-03-22 Richard Henderson + + * Make-lang.in (cp/except.o): Don't depend on insn-flags.h. + * except.c: Don't include it. + +2001-03-22 Gerald Pfeifer + based on an idea from Joe Buck + + * parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore): + New nonterminals. + (data_def, component_decl): Add reductions to bad_decl. + +2001-03-22 Jakub Jelinek + + * method.c (do_build_assign_ref): Don't use build_modify_expr for + anonymous aggregates, since they don't have assignment operator + method. + * decl.c (fixup_anonymous_aggr): Disallow ctors, dtors and copy + assignment operators for anonymous structure fields. + +2001-03-21 Jason Merrill + + * pt.c (instantiate_decl): Abort if we see a member constant + instantiation that doesn't already have its initializer. + Downgrade explicit instantiation without definition to pedwarn. + + * cp-tree.h (DECL_TINFO_FN_P, SET_DECL_TINFO_FN_P): Remove. + * class.c (build_vtable_entry): Don't check DECL_TINFO_FN_P. + (import_export_decl): Check tinfo_decl_p, not DECL_TINFO_FN_P. + + * cp-tree.h (CLASSTYPE_VTABLE_NEEDS_WRITING): Remove. + (pending_vtables): Remove. + * decl2.c (pending_vtables): Remove. + (import_export_vtable): Use CLASSTYPE_INTERFACE_ONLY, not + CLASSTYPE_VTABLE_NEEDS_WRITING. + (import_export_class): Likewise. + (init_decl2): Don't mark pending_vtables. + * lex.c (handle_pragma_vtable): Just sorry. + * pt.c (instantiate_class_template): Don't mess with + CLASSTYPE_VTABLE_NEEDS_WRITING. + (mark_class_instantiated): Likewise. + * ptree.c (print_lang_type): Don't print it. + * semantics.c (begin_class_definition): Don't set it. + + * pt.c (template_tail): Replace with last_pending_template. + (maybe_templates, maybe_template_tail): Remove. + (add_pending_template): Adjust. + (instantiate_pending_templates): Adjust. + + * cp-tree.h (struct saved_scope): Remove lang_stack field. + (current_lang_stack): Remove. + * decl.c (maybe_push_to_top_level): Don't initialize it. + (duplicate_decls): Use current_lang_depth. + (xref_basetypes): Likewise. + * class.c (current_lang_depth): New fn. + (push_lang_context): Use more varray functionality. + (pop_lang_context): Likewise. + + * error.c (GLOBAL_THING): Always use '__'. + +2001-03-21 Mark Mitchell + + * class.c (build_clone): Clear DECL_ASSEMBLER_NAME. + + * mangle.c (mangle_decl_string): Mangle the names of overloaded + operators, even when they have `extern "C"' linkage. + +2001-03-19 Mark Mitchell + + * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (add_method): Remove optimization involving comparison of + DECL_ASSEMBLER_NAME. + (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (check_methods): Likewise. + (build_clone): Likewise. + (built_vtt): Likewise. + * cp-tree.h (DECL_NEEDED_P): Likewise. + * decl.c (pushtag): Likewise. + (duplicate_decls): Likewise. + (pushdecl): Likewise. + (builtin_function): Likewise. + (build_library_fn_1): Set DECL_LANGUAGE for library functions. + (build_cp_library_fn): Likewise. + (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (make_rtl_for_nonlocal_decl): Likewise. + (cp_finish_decl): Likewise. + (grokfndecl): Likewise. + (grokvardecl): Likewise. + (grokdeclarator): Likewise. + (start_function): Likewise. + (cp_missing_return_ok_p): Likewise. + * decl2.c (grokclassfn): Likewise. + (check_classfn): Likewise. + (finish_static_data_member_decl): Likewise. + (grokfield): Likewise. + * error.c (GLOBAL_IORD_P): Remove. + (dump_global_iord): Improve output. + (dump_decl): Avoid using DECL_ASSEMBLER_NAME. + * except.c (nothrow_libfn_p): Summarily reject any function not in + namespace-scope. + * init.c (build_java_class_ref): Don't explicitly set + DECL_ASSEMBLER_NAME after calling mangle_decl. + * mangle.c (mangle_decl_string): Handle extern "C" functions. + (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl. + * method.c (set_mangled_name_for_decl): Don't explicitly set + DECL_ASSEMBLER_NAME after calling mangle_decl. + (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and + IDENTIFIER_GLOBAL_VALUE for the thunk. + * pt.c (set_mangled_name_for_template_decl): Remove. + (check_explicit_specialization): Don't use it. + (looup_template_class): Don't set DECL_ASSEMBLER_NAME. + (tsubst_friend_function): Likewise. + (tsubst_decl): Likewise. + (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME. + * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME, + COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME + where it's not necessary. + (tinfo_base_init): Likewise. + (create_real_tinfo_var): Likewise. + * search.c (looup_field_1): Likewise. + * semantics.c (finish_named_return_value): Likewise. + * tree.c (init_tree): Set lang_set_decl_assembler_name. + +2001-03-15 Gabriel Dos Reis + + Correct semantics restrictions checking in throw-expression. + * except.c (is_admissible_throw_operand): New function. + (build_throw): Use it. + +2001-03-14 Mark Mitchell + + * decl.c (cp_make_fnname_decl): Set DECL_IGNORED_P on __FUNCTION__ + and its ilk. + +2001-03-14 Mark Mitchell + + * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. + * cp-tree.h (DECL_IN_MEMORY_P): Likewise. + * decl.c (duplicate_decls): Likewise. + (builtin_function): Likewise. + (build_library_fn): Likewise. + (build_cp_library_fn): Likewise. + (check_initializer): Likewise. + (cp_finish_decl): Likewise. + * decl2.c (grokfield): Likewise. + (grok_function_init): Remove #if 0'd code. + (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. + * friend.c (do_friend): Likewise. + * init.c (get_temp_regvar): Likewise. + * method.c (make_thunk): Likewise. + * pt.c (tsubst_friend_function): Likewise. + (tsubst_decl): Likewise. + (regenerate_decl_from_template): Likewise. + * semantics.c (genrtl_named_return_value): Likewise. + (expand_body): Likewise. + (genrtl_finish_function): Likewise. + * tree.c (cp_tree_equal): Likewise. + +2001-03-12 Nathan Sidwell + + * call.c (convert_like_real): Add extra semantics to INNER + parameter. Don't convert to temporary if a user conversion + gives us an lvalue that we're about to bind to a reference. + Set INNER to indicate pending reference binding on recursive + calls. + +2001-03-10 Neil Booth + + * cp/lex.c: Delete duplicate pending_lang_change. + +2001-03-10 Neil Booth + + * cp/lex.c (handle_pragma_interface, handle_pragma_implementation): + Similarly. + * cp/repo.c (get_base_filename, open_repo_file): Similarly. + * cp/cp-tree.h: Remove file_name_nondirectory prototype. + +2001-03-09 Zack Weinberg + + * Make-lang.in: Add dependencies on $(TM_P_H) as appropriate. + +2001-03-08 Stan Shebs + + * cp-tree.h (set_identifier_local_value): Remove unused decl. + +2001-03-06 Zack Weinberg + + * spew.c: Remove references to CPP_OSTRING. + +2001-03-06 Andrew Haley + + * typeck.c (convert_arguments): Check that we have an fndecl. + +2001-03-05 Andrew Haley + + * typeck.c (convert_arguments): Don't do ellipsis conversion for + __built_in_constant_p. + +2001-03-02 Nathan Sidwell + + * typeck.c (build_static_cast): Allow enum to enum conversions + as per DR 128. + +2001-03-02 Nathan Sidwell + + * class.c (check_field_decls): Pointers to member do not a + non-pod struct make, as per DR 148. + +2001-03-02 Nathan Sidwell + + * call.c (joust): cp_pedwarn when using gnu extension concerning + worst conversion sequences. + +2001-03-01 Zack Weinberg + + * decl.c: Replace all uses of 'boolean' with 'bool'. + +2001-03-01 Zack Weinberg + + * lang-specs.h: Add zero initializer for cpp_spec field to + all array elements that need one. Don't put an #ifdef inside + the initializer list; set a default for CPLUSPLUS_CPP_SPEC and + use it. + +2001-03-01 Nathan Sidwell + + Implement using decls inside template functions. + * decl2.c (validate_nonmember_using_decl): Don't special case + fake_std_node in the global namespace. Don't reject early when + processing a template. + (do_local_using_decl): Add to statement tree. Don't do further + processing when building a template. + * pt.c (tsubst_expr, DECL_STMT case): Deal with USING_DECLs. + +2001-03-01 Nathan Sidwell + + * decl2.c (do_nonmember_using_decl): Don't complain if we find + same function. Do complain about ambiguating extern "C" + declarations. + +2001-02-28 Nathan Sidwell + + Remove floating point and complex type template constant parms. + * pt.c (convert_nontype_argument): Remove REAL_TYPE and + COMPLEX_TYPE extensions. + (invalid_nontype_parm_type_p): Likewise. + +2001-02-27 Jeffrey Oldham + + * except.c (call_eh_info): Revert "match_function"'s type. + +2001-02-27 Nathan Sidwell + + Fix ctor vtable vcall offsets. + * class.c (struct vtbl_init_data_s): Add rtti_binfo member. + (build_rtt_vtbl_entries): Lose RTTI_BINFO parameter. + (get_matching_base): Remove. + (get_original_base): New function. + (build_vtbl_initializer): Initialize vid.rtti_binfo. + Use a virtual thunk for a ctor vtable with an index + (add_vcall_offset_vtbl_entries_1): Check if binfo has lost a + primary base within a constructor vtable. Only set + BV_VCALL_INDEX when not a constructor vtable. Adjust vcall offset + when primary base has been lost. + * cp-tree.h (BINFO_VIRTUALS): Remove ambiguity from comment. + +2001-02-26 Jeffrey Oldham + + * call.c (joust): Ensure more_specialized()'s argument length + parameter has correct value for constructors. + +2001-02-26 Nathan Sidwell + + * except.c (call_eh_info): Cleanup generation of cp_eh_info struct. + + * decl.c (mark_inlined_fns): Prototype. + +2001-02-22 Mark Mitchell + + * spew.c (yylex): Correct handling of friends. + +2001-02-22 Mark Mitchell + + * mangle.c (write_encoding): Pass write_function_type the + FUNCTION_DECL for the function being encoded. + (write_function_type): Pass it along to write_bare_function_type. + (write_bare_function_type): Pass it along to write_method_parms. + (write_method_parms): Don't mangle the compiler-generated + parameters to a constructor or destructor. + +2001-02-22 Andreas Jaeger + + * optimize.c: Include toplev.h for + note_deferral_of_defined_inline_function prototype. + +2001-02-22 Jakub Jelinek + + * cp-tree.h (struct lang_decl_inlined_fns): New. + (struct lang_decls): Add inlined_fns. + (DECL_INLINED_FNS): New macro. + * optimize.c (struct inline_data): Add inlined_fns. + (declare_return_variable): Use VARRAY_ACTIVE_SIZE macro. + (inlinable_function_p): Likewise, fix typo in comment, + function is not inlinable if it already inlined function currently + being optimized. + (expand_call_inline): Add fn to inlined_fns if necessary. + (optimize_function): Initialize inlined_fns. + Save inlined_fns into DECL_INLINED_FNS after expanding inlines. + * decl.c (mark_inlined_fns): New function. + (lang_mark_tree): Call it. + +2001-02-21 Jason Merrill + + * cp-tree.h (struct lang_decl_flags): Remove uninlinable flag. + (DECL_UNINLINABLE): Move to middle-end. + + * class.c (clone_function_decl): Set DECL_ABSTRACT on original fn. + * decl.c (duplicate_decls): Preserve DECL_ABSTRACT. + * class.c (build_clone): Set DECL_ABSTRACT_ORIGIN for the clone. + * optimize.c (maybe_clone_body): Set DECL_ABSTRACT_ORIGIN for the + parms and outer BLOCK. note_deferral_of_defined_inline_function. + + * method.c (implicitly_declare_fn): Don't set DECL_ARTIFICIAL on + second parm of op=. + +2001-02-19 Mark Mitchell + + * decl2.c (set_decl_namespace): Allow explicit instantiations in + any namespace. + +2001-02-18 Kriang Lerdsuwanakij + + * optimize.c (expand_call_inline): Don't walk subtrees of type + nodes. + +2001-02-18 Mark Mitchell + + * class.c (add_vcall_offset_vtbl_entries_1): Only add one entry + for a destructor. + +2001-02-18 Jason Merrill + + Do put the VTT parameter in DECL_ARGUMENTS. + * cp-tree.h (struct cp_language_function): Add x_vtt_parm. + (current_vtt_parm): New macro. + (struct lang_decl_flags): Add has_vtt_parm_p, remove vtt_parm. + (DECL_HAS_VTT_PARM_P): New macro. + (DECL_VTT_PARM): Remove. + (FUNCTION_FIRST_USER_PARMTYPE, FUNCTION_FIRST_USER_PARM): New macros. + * decl.c (duplicate_decls): Only copy the operator code if + appropriate. + (start_function): Set current_vtt_parm. + (lang_mark_tree): Don't mark vtt_parm. + * decl2.c (maybe_retrofit_in_chrg): Do add the VTT parm to + DECL_ARGUMENTS. Set DECL_HAS_VTT_PARM_P. + * class.c (build_clone): Maybe remove the VTT parm. + * optimize.c (maybe_clone_body): Set up the VTT parm. + * pt.c (copy_default_args_to_explicit_spec): Preserve the VTT parm. + * call.c (build_over_call): Just allow the VTT arg. + * method.c (make_thunk): Don't set DECL_VTT_PARM. + (do_build_copy_constructor): Use FUNCTION_FIRST_USER_PARM. + (synthesize_method): Use FUNCTION_FIRST_USER_PARMTYPE. + * decl.c (grokdeclarator, copy_args_p, grok_ctor_properties): Likewise. + * error.c (dump_function_decl): Likewise. + * call.c (build_user_type_conversion_1, convert_like_real): Abort + if we try to call a constructor with in-charge or VTT parms. + * method.c (skip_artificial_parms_for): New fn. + * call.c (add_function_candidate, build_over_call): Call it. + * call.c (build_new_method_call): Use current_vtt_parm. + * init.c (expand_virtual_init): Likewise. + * class.c (same_signature_p): No longer static. + * cp-tree.h: Declare it. + * search.c (look_for_overrides_r): Use it. + +2001-02-17 Mark Mitchell + + * cp-tree.h (new_abi_rtti_p): Remove. + (name_mangling_version): Likewise. + (flag_do_squangling): Likewise. + * class.c (build_rtti_vtbl_entries): Remove old ABI support. + * decl.c (grokfndecl): Likewise. + * decl2.c (name_mangling_version): Remove. + (flag_do_squangling): Likewise. + (lang_f_options): Remove `squangle'. + (unsupported_options): Add `squangle'. + (cxx_decode_option): Issue a warning about uses of + -fname-mangling-version. + (finish_file): Remove old ABI support. + * pt.c (check_explicit_specialization): Likewise. + (tsubst_decl): Likewise. + * rtti.c (init_rtti_processing): Likewise. + (build_headof): Likewise. + (get_tinfo_decl_dynamic): Likewise. + (tinfo_from_decl): Likewise. + (build_dynamic_cast_1): Likewise. + (synthesize_tinfo_var): Likewise. + * init.c (build_new): Allow enumeration types for the array-bounds + in a direct-new-declarator. + + * semantics.c (finish_typeof): Resolve OFFSET_REFs. + + * pt.c (check_explicit_specialization): Copy TREE_PRIVATE and + TREE_PROTECTED from the template being specialized. + +2001-02-17 Jason Merrill + + * decl2.c (build_artificial_parm): Set TREE_READONLY. + + * decl.c (bad_specifiers): Allow throw specs on things with + pointer-to-function or -member-function type. + * init.c (build_default_init): Don't use a CONSTRUCTOR to initialize + a pmf. + +2001-02-17 Mark Mitchell + + * call.c (check_dtor_name): Handle template names correctly. + +2001-02-16 Jason Merrill + + * cp-tree.h (DECL_USE_VTT_PARM): Remove. + * decl2.c (maybe_retrofit_in_chrg): Don't create it. + * optimize.c (maybe_clone_body): Don't substitute it. + * call.c (build_new_method_call): Check in_chrg instead. + * init.c (expand_virtual_init): Likewise. + +2001-02-16 Gabriel Dos Reis + + * decl.c (check_tag_decl): Make sure a typedef for an anonymous + class-type introduces at least a type-name. + +2001-02-16 Jakub Jelinek + + * call.c (convert_like_real): Create a temporary for non-lvalue. + +2001-02-16 Jeffrey Oldham + + * cp-tree.h: Fix typos in comments. + +2001-02-16 Jason Merrill + + * optimize.c (remap_block): If we're compiling a clone, pass the + new block to insert_block. + +2001-02-16 Mark Mitchell + + * semantics.c (finish_asm_stmt): Robustify. + +2001-02-15 Mark Mitchell + + * pt.c (push_template_decl_real): Don't remangle the name of a + class template. + +2001-02-15 Jim Meyering + + * Make-lang.in (c++.install-common): Depend on installdirs. + (c++.install-info): Likewise. + (c++.install-man): Likewise. + +2001-02-15 Mark Mitchell + + * typeck2.c (build_m_component_ref): Robustify. + +2001-02-15 Alexandre Oliva + + * friend.c (do_friend): Don't take the nested [template] class + into account when deciding whether to warn about the friend + function not referring to a template function. + +2001-02-14 Jakub Jelinek + + * typeck.c (build_unary_op): Clarify error message. + +2001-02-08 Aldy Hernandez + + * parse.y (component_constructor_declarator): allow optional + parentheses around constructor class name. + +2001-02-14 Nathan Sidwell + + * cp-tree.h (setup_vtbl_ptr): Move prototype to semantics.c + section. + * init.c (emit_base_init): Remove incorrect comment about + virtual bases. + * method.c (make_thunk): Fix comment alignment. + +2001-02-14 Nathan Sidwell + + Kill remnants of this is variable. + * cp-tree.h (flag_this_is_variable): Remove. + * decl2.c (flag_this_is_variable): Remove. + * class.c (fixed_type_or_null): Add cdtor parm. Adjust. + (build_vbase_path): The path is non-static, even in a cdtor. + (resolves_to_fixed_type_p): Add additional return value. + * search.c (init_vbase_pointers): Adjust. + * tree.c (lvalue_p_1): Adjust. + * typeck.c (mark_addressable): Adjust. + +2001-02-14 Nathan Sidwell + + * pt.c (unify): Don't check cv quals of array types. + +2001-02-14 Nathan Sidwell + + * tree.c (cp_build_qualified_type_real): Use CP_TYPE_QUALS to + check whether we already have the type. + +2001-02-13 Mark Mitchell + + * cp-tree.h (CLASSTYPE_DESTRUCTORS): Fix typo in comment. + * call.c (build_op_delete_call): Simplify to remove duplicate + code. + * class.c (clone_function_decl): Don't build the deleting variant + of a non-virtual destructor. + * decl.c (finish_destructor_body): Don't call delete if this is a + non-virtual destructor. + * init.c (build_delete): Explicitly call `operator delete' when + deleting an object with a non-virtual destructor. + +2001-02-13 Jason Merrill + + * lang-specs.h: Add more __EXCEPTIONS. + +2001-02-12 Nathan Sidwell + + * typeck2.c (process_init_constructor): Check + TREE_HAS_CONSTRUCTOR before issuing missing init warning. + +2001-02-12 Nathan Sidwell + + * pt.c (maybe_adjust_types_for_deduction, DEDUCE_ORDER case): + Remove spurious information in comment. Allow further + adjustments of REFERENCE_TYPE args. + +2001-02-12 Nathan Sidwell + + * errfn.c (cp_deprecated): Tweak diagnostic text. + * parse.y (new_initializer): Deprecate initializer lists + extension. + +2001-02-12 Mark Mitchell + + Remove old ABI support. + +2001-02-11 Mark Mitchell + + * decl2.c (flag_vtable_thunks): Always set it to 1. + (flag_new_abi): Likewise. + * lang-specs.h: Remove conditional on ENABLE_NEW_GXX_ABI. + + * Makefile.in (g++spec.o): Fix typo. + +2001-02-09 Jason Merrill + + * lang-specs.h: Restore definition of __EXCEPTIONS. + +2001-02-08 Jason Merrill + + * search.c (shared_member_p): New function. + (lookup_field_r): Use it. + * cp-tree.h (SHARED_MEMBER_P): Remove. + + * method.c (process_overload_item): Handle template-dependent array + bounds. + * pt.c (type_unification_real): If we end up with undeduced nontype + parms, try again. + + * decl.c (lookup_name_real): Tweak warning to refer to decls, not + types. + + * typeck2.c (friendly_abort): Don't say anything if we have + earlier errors or sorries. + + * decl.c (check_tag_decl): Notice attempts to redefine bool and + wchar_t. Ignore if in_system_header. + + * decl.c (maybe_push_cleanup_level): New fn... + (start_decl_1): ...split out from here. + * cvt.c (build_up_reference): Use it. + * cp-tree.h: Declare it. + +2001-02-07 Mark Mitchell + + * lang-specs.h: Use CPLUSPLUS_CPP_SPEC for the preprocessor + spec. + +2001-02-06 Nathan Sidwell + + * pt.c (lookup_template_class): Make sure it's a primary + template or template_template_parm when called from the parser. + (instantiate_template_class): Add assertion. + +2001-02-05 Alexandre Oliva + + * method.c (build_mangled_name) [old abi]: Protect flush_repeats() + from error_mark_node. + +2001-02-05 Nathan Sidwell + + Fix specification and implementation bugs in V3 ABI + construction vtables. + * cp-tree.h (flag_dump_class_layout): New flag. + (BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P): Remove. + (BINFO_LOST_PRIMARY_P): New flag. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust asserts. + (BINFO_PRIMARY_MARKED_P): Rename to ... + (BINFO_PRIMARY_P): ... here. + (binfo_via_virtual): New prototype. + * decl2.c (flag_dump_class_layout): New flag. + (cxx_decode_option): Set it. Adjust -fdump-translation-unit to + use `=' as a file name separator. + * init.c (dfs_initialize_vtbl_ptrs): Walk into virtual primary + bases. + (build_vtbl_address): If this is a virtual primary base, then + get the vtbl of what it is ultimately primary for. + * search.c (dfs_skip_nonprimary_vbases_unmarkedp): Adjust + for BINFO_PRIMARY_P. + (dfs_skip_nonprimary_vbases_markedp): Likewise. + (get_shared_vbase_if_not_primary): Likewise. + (dfs_get_pure_virtuals): Likewise. + (expand_upcast_fixups): Likewise. + (fixup_virtual_upcast_offsets): Likewise. + (dfs_find_vbase_instance): Likewise. + (find_vbase_instance): Likewise. + (binfo_from_vbase): Adjust comment to reflect reality. + (binfo_via_virtual): New function. + * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): New macros + for binfo walking during VTT construction. + (dfs_mark_primary_bases): Remove. + (force_canonical_binfo_r): New function. + (force_canonical_binfo): New function. + (mark_primary_virtual_base): New function. + (mark_primary_bases): Walk in inheritance graph order, use + mark_primary_virtual_base. + (determine_primary_base): Use some more intermediate variables. + (dfs_find_final_overrider): Don't check for overriding along a + virtual path. + (dfs_modify_vtables): Walk into primary virtual bases too. + (walk_subobject_offsets): Adjust for BINFO_PRIMARY_P. + (build_base_fields): Likewise. + (dfs_set_offset_for_unshared_vbases): Likewise. + (layout_virtual_bases): Likewise. + (end_of_class): Likewise. + (finish_struct_1): Call dump_class_hierarchy, if requested. + (dfs_get_primary_binfo): Use BINFO_TYPE for binfos. + (dump_class_hierarchy_r): Add stream parameter. Emit more information. + (dump_class_hierarchy): Add file parameter. Append to file, if + required. + (finish_vtbls): Adjust accumulate_vtbl_inits call. + Use canonical base for virtual bases. + (build_vtt): Add more comments. Adjust build_vtt_inits call. + (build_vtt_inits): Remove VIRTUAL_VTTS_P parm. + Only set BINFO_VPTR_INDEX on top level. Use VTT_TOP_LEVEL_P, + VTT_MARKED_BINFO_P for binfo walking. Use canonical vbase for + virtual VTTs. + (dfs_build_secondary_vptr_vtt_inits): Extract VTT_TOP_LEVEL_P + from DATA. We want virtual primary bases and all bases via virtual. + Only set BINFO_VPTR_INDEX for top level. Look up from a primary + virtual base when not a construction vtable. + (dfs_ctor_vtable_bases_queue_p): New DFS predicate. + (build_ctor_vtbl_group): Adjust accumulate_vtbl_inits call. + Use canonical bases when processing virtual bases. + (accumulate_vtbl_inits): We're interested in any base via a + virtual path. + (dfs_accumulate_vtbl_inits): If this is a primary virtual base + within a construction vtable, determine what is being overridden. + (build_vtbl_initializer): Add more comments + (add_vcall_offset_vtbl_entries_1): Adjust comment. + (build_rtti_vtbl_entries): Check if the base has lost its + primary. + +2001-02-05 Mark Mitchell + + * Makefile.in (g++spec.o): Adjust use of DRIVER_DEFINES. + +2001-02-04 Richard Kenner + + * decl.c (pushdecl): Call abort instead of fatal. + * except.c (decl_is_java_type): Call fatal_error instead of fatal. + * init.c (build_new_1): Likewise. + (build_java_class_ref): Call internal_error and fatal_error, not fatal. + * decl.c (build_typename_type): hash_table_init now returns void. + decl.c (init_decl_processing): Make an error non-fatal. + +2001-02-04 Mark Mitchell + + * cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting. + Document. + (CLASSTYPE_INTERFACE_KNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. + * decl.c (maybe_commonize_var): Use the new name-mangling where + appropriate. + * decl2.c (comdat_linkage): Enhance comments. Make all + compiler-generated things static, if COMDAT is not available. + (get_tinfo_decl): Do not make typeinfo objects that belong in the + library COMDAT. + (tinfo_base_init): Use the correct mangled name for typeinfo + strings, and push them into the global scope. + (typeinfo_in_lib_p): New function. + (synthesize_tinfo_var): Use it. + (create_real_tinfo_var): Likewise. + +2001-02-03 Jakub Jelinek + + * decl.c (push_class_binding): Use context_for_name_lookup instead + of CP_DECL_CONTEXT. + * search.c (context_for_name_lookup): Remove static. Check for NULL + context in the loop. + * cp-tree.h (context_for_name_lookup): Add prototype. + +2001-02-02 Jakub Jelinek + + * cp-tree.h (build_expr_ptr_wrapper, can_free): Remove. + * tree.c (build_expr_ptr_wrapper, can_free, permanent_obstack): + Remove. + * call.c (convert_class_to_reference, build_user_type_conversion_1, + add_warning): Change build_expr_ptr_wrapper to build_ptr_wrapper. + +2001-02-02 Mark Mitchell + + * Make-lang.in (g++spec.o): Add DRIVER_DEFINES to the list + of macros used when compiling g++spec.c. + * g++spec.c (lang_specific_driver): Link with the shared + libgcc by default. + +2001-01-29 Joseph S. Myers + + * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, + make_reference_declarator, make_call_declarator), method.c + (implicitly_declare_fn), parse.y (namespace_using_decl, + notype_unqualified_id, expr_or_declarator, new_type_id, + after_type_declarator, direct_after_type_declarator, + notype_declarator, complex_notype_declarator, + complex_direct_notype_declarator, qualified_id, + notype_qualified_id, overqualified_id, direct_new_declarator, + absdcl, direct_abstract_declarator, conversion_declarator), pt.c + (tsubst), semantics.c (begin_constructor_declarator): Use build_nt + instead of build_parse_node. + +2001-01-28 Kaveh R. Ghazi + + * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE. + (minus_one_node): Moved to top level gcc directory. Renamed + to integer_minus_one_node. + + * init.c (init_init_processing): Don't set minus_one_node. + (build_vec_init): Use integer_minus_one_node. + + * rtti.c (get_tinfo_decl_dynamic): Likewise. + +2001-01-28 Jakub Jelinek + + * optimize.c (copy_body_r): If MODIFY_EXPR has both arguments + identical and they would be replaced with constant, remove + MODIFY_EXPR from the tree. + +2001-01-27 Kaveh R. Ghazi + + * Make-lang.in: Remove all dependencies on defaults.h. + * call.c: Don't include defaults.h. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2001-01-25 Jakub Jelinek + + * mangle.c (write_mangled_name, write_encoding): Mangle overloaded + operators even in "C" linkage. + * method.c (set_mangled_name_for_decl): Likewise. + * decl.c (grokfndecl): Call set_mangled_name_for_decl even for + overloaded operators in "C" linkage. + +2001-01-24 Nathan Sidwell + + * pt.c (tsubst_decl): Remove IN_DECL parameter. + (tsubst_arg_types): Check parameter is not void. + (tsubst): Adjust tsubst_decl call. + +2001-01-24 Nathan Sidwell + + * call.c (add_builtin_candidate): Quote std properly, from + previous change. + +2001-01-23 Kriang Lerdsuwanakij + + * pt.c (check_explicit_specialization): Clone constructors and + destructors. + +2001-01-23 Nathan Sidwell + + * decl.c (grokdeclarator): Don't presume DECL_LANG_SPECIFIC + indicates anything special about template depth. Make sure we + only count the user visible template classes. + +2001-01-23 Nathan Sidwell + + * call.c (build_conv): Typo in comment. + (add_builtin_candidate): Add more explanation. + Remove extra test for ENUMERAL_TYPE in {PRE,POST}INCREMENT_EXPR. + Allow ENUMERAL_TYPEs for relops and eqops. Add both candidates + when we have enumeral types. + (add_builtin_candidates): Add more explanation. Add ENUMERAL_TYPE + candidates for relops and eqops. + (joust): Simplify control flow. Allow a non-template user + function to hide a builtin. + +2001-01-22 Nathan Sidwell + + * cp-tree.h (unification_kind_t): Add DEDUCE_ORDER. + (more_specialized): Add deduction parameter. + * call.c (joust): Adjust more_specialized call. + * pt.c (UNIFY_ALLOW_OUTER_MORE_CV_QUAL, + UNIFY_ALLOW_OUTER_LESS_CV_QUAL): New unify flags. + (get_bindings_order): Remove. + (get_bindings_real): Add DEDUCE parameter. + (maybe_adjust_types_for_deduction): Return extra unify flags. Do + REFERENCE_TYPE jig for DEDUCE_ORDER. + (type_unification_real): Deal with DEDUCE_ORDER. Use result of + maybe_adjust_types_for_deduction. + (more_specialized): Add DEDUCE parameter. Call get_bindings_real + directly. + (try_one_overload): Use result of maybe_adjust_types_for_deduction. + (check_cv_quals_for_unify): Use new unify qualifier flags. + (unify): Clear new unify qualifier flags. + (get_bindings_real): Add DEDUCE parameter. + (get_bindings): Adjust call to get_bindings_real. + (get_bindings_overload): Likewise. + (most_specialized_instantiation): Adjust call to + more_specialized. + +2001-01-19 Jason Merrill + + * decl2.c (flag_vtable_thunks): Also depend on ENABLE_NEW_GXX_ABI. + + * decl.c (init_decl_processing): Just force -fvtable-thunks on if + -fnew-abi. + +2001-01-19 Ute Pelkmann + + * decl2.c (arg_assoc_class): Fix double iteration logic. + +2001-01-19 Jason Merrill + + * init.c (build_delete): Always call convert_force to strip cv-quals. + + * decl2.c (flag_new_abi): Depend on ENABLE_NEW_GXX_ABI. + * lang-specs.h: Default ABI depends on ENABLE_NEW_GXX_ABI. + * g++spec.c: Don't look at ENABLE_NEW_GXX_ABI. + +2001-01-19 Nathan Sidwell + + * search.c (get_vbase_1): Count only virtual bases. + +2001-01-19 Nathan Sidwell + + * class.c (duplicate_tag_error): Robustify flag clearing. + +2001-01-19 Nathan Sidwell + + * cp-tree.h (lookup_template_class): Add complain parm. + * decl.c (lookup_namespace_name): Adjust call to + lookup_template_class. + (make_typename_type): Likewise. + * semantics.c (finish_template_type): Likewise. + * pt.c (lookup_template_class): Add complain parm. Adjust. + (tsubst_aggr_type): Pass COMPLAIN down to lookup_template_class. + (tsubst): Likewise. + +2001-01-19 Nathan Sidwell + + * pt.c (copy_default_args_to_explicit_spec): Preserve + object's CV quals. Reorganize. + +2001-01-18 Nathan Sidwell + + * typeck.c (build_modify_expr): Say `initialization' for + INIT_EXPRs. + * init.c (build_default_init): Convert to enumeral type, if + needed. + +2001-01-18 Jakub Jelinek + + * parse.y (nomods_initdcl0): Properly set things up for + initdcl0_innards. + +2001-01-18 Nathan Sidwell + + * pt.c (UNIFY_ALLOW_OUTER_LEVEL): New unify flag. + (type_unification_real): Set it. + (unify): Use it. + +2001-01-18 Nathan Sidwell + + * decl.c (finish_destructor_body): Convert to vbase pointer here. + +2001-01-18 Nathan Sidwell + + * semantics.c (begin_class_definition): Check we're not inside a + template parm list. + +2001-01-18 Nathan Sidwell + + * tree.c (walk_tree, TREE_LIST): Don't walk the TREE_PURPOSE of + BASELINK_P. + +2001-01-16 Kriang Lerdsuwanakij + + * typeck.c (build_function_call_real): Call fold on the CALL_EXPR. + * call.c (build_over_call): Add comment. + +2001-01-16 Daniel Berlin + + * cvt.c (ocp_convert): Handle vector type conversion + * typeck2.c (digest_init): Handle vector type initializations + +2001-01-16 Phil Edwards + + * g++spec.c: Don't add libraries needlessly if -fsyntax-only + was given. + +2001-01-15 Nathan Sidwell + + * pt.c (check_nontype_parm): Rename to ... + (invalid_nontype_parm_type_p): ... here. + (process_template_parm): Adjust. + (convert_template_argument): Adjust. + +2001-01-15 Nathan Sidwell + + * pt.c (check_nontype_parm): New function. + (process_template_parm): Use it. + (convert_template_argument): Use it. + (convert_nontype_argument, RECORD_TYPE): Assert it's a ptr to + member. + +2001-01-14 Jeffrey Oldham + + * tree.c: Add defaults.h + (cp_valid_lang_attribute): Incorporate SUPPORTS_INIT_PRIORITY. + * Make-lang.in (cp/tree.o): Add defaults.h. + +2001-01-13 Joseph S. Myers + + * Make-lang.in (CXX_C_OBJS): Add c-format.o. + +2001-01-13 Joseph S. Myers + + * g++.1: Change to be ".so man1/gcc.1". + +2001-01-13 Joseph S. Myers + + * Make-lang.in (c++.info, c++.install-info): Build and install g++ + internals info. + (c++.uninstall, c++.maintainer-clean): Remove g++ internals info. + ($(srcdir)/cp/g++int.info): New target. + * gxxint.texi: Add info directory entry. Use @@ in email address. + * .cvsignore: Update. + +2001-01-12 Nathan Sidwell + + * typeck.c (build_c_cast): Do template processing earlier. + Always pedwarn on array casts. + +2001-01-12 Nathan Sidwell + + * friend.c (make_friend_class): Make sure a templated class is + actually a template. + +2001-01-11 Nathan Sidwell + + * decl2.c (get_guard): Set linkage from guarded decl. + +2001-01-11 Nathan Sidwell + + * call.c (convert_default_arg): Check for unprocessed + DEFAULT_ARG. + * cp-tree.h (replace_defarg): Move to spew.c. + (maybe_snarf_defarg, add_defarg_fn, do_pending_defargs): Move to + spew.c, which is where they really are. + (done_pending_defargs): Declare. + (unprocessed_defarg_fn): Declare. + * decl.c (replace_defarg): Move to spew.c + * parse.y (structsp): Call done_pending_defargs. + * spew.c (defarg_fns): Rearrange list structure. + (defarg_fnsdone): New static variable. + (defarg_depfns): New static variable. + (init_spew): Adjust. + (add_defarg_fn): Store the type in TREE_TYPE. + (do_pending_defargs): Detect and deal with ordering constraints + and circularity. + (done_pending_defargs): New function. + (unprocessed_defarg_fn): New function. + (replace_defarg): Moved from decl.c. Robustify. Don't save + if circularity detected. + +2001-01-11 Nathan Sidwell + + * pt.c (unify): Check array has a domain, before checking + whether it is variable sized. + +2001-01-11 Nathan Sidwell + + * decl.c (grokparms): Unobfuscate and get correct diagnostic for + parameters with pointers to arrays of unknown bound. + +2001-01-11 Nathan Sidwell + + * parse.y (template_parm_header, template_spec_header): New + reductions. Split out from ... + (template_header): ... here. Use them. + (template_template_parm): Use template_parm_header. + * semantics.c (finish_template_template_parm): Add assert. + +2001-01-10 Mark Mitchell + + * mangle.c (write_builtin_type): Fix thinko. + + * pt.c (copy_default_args_to_explicit_spec_1): New function. + (copy_default_args_to_explicit_spec): Likewise. + (check_explicit_specialization): Use it. + + * class.c (finish_struct_1): Remove last argument in call to + make_decl_rtl; use make_function_rtl instead of make_decl_rtl. + * decl.c (builtin_function): Likewise. + (build_cp_library_fn): Likewise. + (check_initializer): Likewise. + (make_rtl_for_nonlocal_decl): Likewise. + (cp_finish_decl): Likewise. + (start_function): Likewise. + * decl2.c (finish_anon_union): Likewise. + * friend.c (do_friend): Likewise. + * init.c (build_java_class_ref): Likewise. + * method.c (make_thunk): Likewise. + * pt.c (tsubst_friend_function): Likewise. + * semantics.c (expand_body): Likewise. + +2001-01-10 Mark Mitchell + + * cp-tree.h (DECL_CLONED_FUNCTION_P): Avoid wild reads by not + looking at DECL_CLONED_FUNCTION for non-functions. + +2001-01-10 Nathan Sidwell + + * error.c (dump_template_parameter): Use parm to determine how + to print default value. + +2001-01-10 Nathan Sidwell + + * class.c (duplicate_tag_error): Clear more flags. + +2001-01-10 Nathan Sidwell + + * call.c (build_new_method_call): Use binfo_for_vbase. + +2001-01-10 Joseph S. Myers + + * cp-tree.h (flag_cond_mismatch): Don't declare. + * decl2.c (flag_cond_mismatch): Don't define. + (lang_f_options): Remove cond-mismatch. + (unsupported_options): Add cond-mismatch. + +2001-01-09 Nathan Sidwell + + * class.c (handle_using_decl): Reject using of constructor name + of sourcing class. Allow injecting of a method with same name as + nested class. Fixup error messages. + +2001-01-09 Joseph S. Myers + + * decl2.c (lang_decode_option): Handle -Wformat=2. + +2001-01-08 Nathan Sidwell + + * cp-tree.h (lang_decl_flags): Rename defined_in_class to + initialized_in_class. + (DECL_DEFINED_IN_CLASS_P): Rename to ... + (DECL_INITIALIZED_IN_CLASS_P): ... here, to reflect true meaning. + * decl.c (duplicate_decls): Preseve DECL_INITIALIZED_IN_CLASS_P. + (cp_finish_decl): Adjust for DECL_INITIALIZED_IN_CLASS_P. + * pt.c (check_default_tmpl_args): Adjust for + DECL_INITIALIZED_IN_CLASS_P. + (instantiate_class_template): Likewise. + (instantiate_decl): Check DECL_INITIALIZED_IN_CLASS_P. + + * class.c (finish_struct): Constify saved_filename. + +2001-01-08 Nathan Sidwell + + * class.c (duplicate_tag_error): Adjust diagnostic. + (finish_struct): Locally set location to start of struct. + * decl.c (fixup_anonymous_aggr): Use cp_error_at. + +2001-01-08 Nathan Sidwell + + * decl.c (struct binding_level): Adjust class_shadowed comments + to reflect reality. + (push_class_level_binding): Adjust comments to reflect reality. + Set IDENTIFIER_CLASS_VALUE when replacing an existing binding. + Don't set TREE_VALUE on the class_shadowed list. + +2001-01-07 Alexandre Petit-Bianco + + * decl2.c (acceptable_java_type): Allow references too. + * init.c (build_java_class_ref): When using the new ABI, search + `class$' and have it mangled with `mangle_decl.' + * mangle.c (write_java_integer_type_codes): New function. + (write_builtin_type): Detect and mangle Java integer and real + types. + +2001-01-07 Mark Mitchell + + * decl2.c (grokfield): Don't accept `asm' specifiers for + non-static data members. + +2001-01-07 Kaveh R. Ghazi + + * expr.c (cplus_expand_expr): Don't reset `target'. + +2001-01-07 Neil Booth + + * cp/decl2.c (cxx_post_options): Call cpp_post_options. + +2001-01-05 Nathan Sidwell + + * parse.y (template_datadef): Check for error_mark_node. + +2001-01-05 Nathan Sidwell + + * cp-tree.def (DEFAULT_ARG): Make `x' class. + +2001-01-04 Joseph S. Myers + + * decl.c (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Don't define. + (record_builtin_type): Make non-static. + (flag_short_double): Don't declare. + (init_decl_processing): Remove the creation of many tree nodes now + in c_common_nodes_and_builtins. + (build_void_list_node): New function. + * decl2.c (flag_short_double, flag_short_wchar): Don't define. + * cp-tree.h (flag_short_wchar): Don't declare. + +2001-01-04 Mark Mitchell + + * call.c (build_conv): Don't use build1 for USER_CONV. + * pt.c (tsubst_copy): Or for PREINCREMENT_EXPR and similar nodes. + +2001-01-03 Joseph S. Myers + + * lex.c (lang_init): Call c_common_lang_init. + +2001-01-03 Nathan Sidwell + + * search.c (lookup_fnfields_here): Remove. + (look_for_overrides_r): Use lookup_fnfields_1. + Ignore functions from using declarations. + +2001-01-03 Nathan Sidwell + + Implement exceptions specifiers for implicit member functions. + * cp-tree.h (merge_exceptions_specifiers): Declare new function. + * method.c (synthesize_exception_spec): New function. + (locate_dtor, locate_ctor, locate_copy): New functions. + (implicitly_declare_fn): Generate the exception spec too. + * search.c (check_final_overrider): Check artificial functions + too. + * typeck2.c (merge_exception_specifiers): New function. + +2001-01-03 Jason Merrill + + * init.c (build_default_init): New fn. + (perform_member_init): Split out from here. + (build_new_1): Use it. Simplify initialization logic. + (build_vec_init): Take an array, rather than a pointer and maxindex. + Speed up simple initializations. Don't clean up if we're assigning. + * cp-tree.h: Adjust. + * decl2.c (do_static_initialization): Remove TREE_VEC case. + * parse.y (new_initializer): Return void_zero_node for (). + * typeck.c (build_modify_expr): Handle getting a CONSTRUCTOR. + * typeck2.c (digest_init): Only complain about user-written + CONSTRUCTORs. + +2000-12-22 Mike Stump + + * decl2.c: (max_tinst_depth): Increase to 50. + +2001-01-02 Mark Mitchell + + * class.c (invalidate_class_lookup_cache): Zero the + previous_class_values. + * cp-tree.h (TMPL_PARMS_DEPTH): Use TREE_INT_CST_LOW, not + TREE_INT_CST_HIGH. + (CLASSTYPE_TEMPLATE_LEVEL): Likewise. + * decl.c (free_bindings): New variable. + (push_binding): Don't create a new binding if we have one on the + free list. + (pop_binding): Put old bindings on the free list. + (init_decl_processing): Use size_int, not build_int_2. + Register free_bindings as a GC root. + (cp_make_fname_decl): Use size_int, not build_int_2. + (push_inline_template_parms_recursive): Likewise. + (end_template_parm_list): Likewise. + (for_each_template_parm): Do not use walk_tree_without_duplicates. + (tsubst_template_parms): Use size_int, not build_int_2. + (tsubst): Likewise. + * rtti.c (get_vmi_pseudo_type_info): Likewise. + +2001-01-02 Richard Henderson + + * parse.y (asm): Set ASM_INPUT_P. + +2001-01-02 Jason Merrill + + * tree.c (cp_valid_lang_attribute): Don't set CLASSTYPE_COM_INTERFACE + for v3 ABI. + + * typeck.c (cp_truthvalue_conversion): New fn. + * cvt.c (ocp_convert): Use it. + + * cp-tree.h: Lose c-common.c decls. + + * typeck.c (build_unary_op): Restore old &a.f diagnostic code. + * cvt.c (convert_to_void): Use type_unknown_p. + + * typeck.c (strip_all_pointer_quals): Also strip quals from + pointer-to-member types. + + * Make-lang.in (cp/TAGS): Use --no-globals. Ignore parse.c, and treat + parse.y as C. + + * call.c (build_new_method_call): Do evaluate the object parameter + when accessing a static member. + * typeck.c (build_component_ref): Likewise. + +2001-01-02 Andreas Jaeger + + * decl.c (cp_missing_noreturn_ok_p): New. + (init_decl_processing): Set lang_missing_noreturn_ok_p. + diff --git a/gcc/cp/ChangeLog-2002 b/gcc/cp/ChangeLog-2002 new file mode 100644 index 00000000000..573715384a0 --- /dev/null +++ b/gcc/cp/ChangeLog-2002 @@ -0,0 +1,4574 @@ +2002-12-31 Neil Booth + + * .cvsignore: Remove. + +2002-12-31 Steven Bosscher + + * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c, + except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h, + lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c, + pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c, + typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the + copyright header. + * lex.h: parse.y is dead, so don't mention it. Also replace the + copyright header with the default GNU copyright header. + +2002-12-31 Mark Mitchell + + * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove. + (lookup_name_namespace_only): Likewise. + (begin_only_namespace_names): Likewise. + (end_only_namespace_names): Likewise. + * decl.c (only_namespace_names): Remove. + (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED. + (lookup_name_real): Do not check only_namespace_names. + (lookup_name_namespace_only): Remove. + (begin_only_namespace_names): Likewise. + (end_only_namespace_names): Likewise. + * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous + nested-name-specifiers more gracefully. + (cp_parser_class_or_namespace_name): Avoid looking up namespace + names when they cannot possibly appear. + (cp_parser_template_name): Adjust call to cp_parser_lookup_name. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_namespace_name): Only look for namespace names. + (cp_parser_lookup_name): Add is_namespace parameter. + (cp_parser_lookup_name_simple): Adjust call to + cp_parser_lookup_name. + + * parser.c (cp_parser_dependent_type_p): Fix thinko. + +2002-12-31 Neil Booth + + * .cvsignore: Update. + +2002-12-31 Nathan Sidwell + + * class.c (modify_vtable_entry): Remove unused variable. + (get_vcall_index): Always expect a non-thunk. + (update_vtable_entry_for_fn): Combine covariant adjustments, when + overriding a thunk. Pass get_vcall_index a non-thunk. + + * decl2.c (finish_file): Mark undefined inlines as extern. + +2002-12-31 Mark Mitchell + + * cp-tree.def (RETURN_INIT): Remove. + * cp-tree.h (DECL_IN_MEMORY_P): Remove. + (scope_kind): Add sk_block, sk_try, sk_catch, sk_for. + (note_level_for_for): Remove. + (note_level_for_try): Likewise. + (note_level_for_catch): Likewise. + (finish_named_return_value): Likewise. + (do_pushlevel): Change prototype. + (pending_lang_change): Remove. + * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch, + sk_for. + (note_level_for_for): Remove. + (note_level_for_try): Likewise. + (note_level_for_catch): Likewise. + (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P. + * parser.c (cp_parser_context_free_list): Make it "deletable". + (cp_parser_template_argument): Remove misleading comment. + * pt.c (tsubst_expr): Remove RETURN_INIT code. + * semantics.c (genrtl_named_return_value): Remove. + (do_pushlevel): Take a scope kind as an argument. + (begin_if_stmt): Adjust. + (begin_while_stmt): Likewise. + (begin_for_stmt): Likewise. + (finish_for_init_stmt): Likewise. + (begin_switch_stmt): Likewise. + (begin_handler): Likewise. + (begin_compound_stmt): Likewise. + (finish_named_return_value): Remove. + (cp_expand_stmt): Remove RETURN_INIT case. + * tree.c (cp_statement_code_p): Remove RETURN_INIT case. + +2002-12-31 Mark Mitchell + + PR c++/9112 + * parser.c (cp_parser_direct_declarator): Handle erroneous + parenthesized declarators correctly. + +2002-12-31 Gabriel Dos Reis + + * cp-tree.h (pending_lang_change): Declare. + +2002-12-30 Mark Mitchell + + * parser.c (cp_parser_context_free_list): New variable. + (cp_parser_context_new): Use it. + (cp_parser_error): Check return code from + cp_parser_simulate_error. + (cp_parser_simulate_error): Return a value. + (cp_parser_id_expression): Optimize common case. + (cp_parser_class_name): Likewise. + (cp_parser_class_specifier): Adjust call to + cp_parser_late_parsing_default_args. + (cp_parser_lookup_name): Optimize common case. + (cp_parser_late_parsing_for_member): Adjust call to + cp_parser_late_parsing_default_args. + (cp_parser_late_parsing_default_args): Add scope parameter. + (cp_parser_require): Avoid creating the error message unless it's + needed. + (cp_parser_parse_definitely): Place free'd contexts on the free + list. + + * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change. + +2002-12-30 David Edelsohn + + * parser.c (cp_parser_parameter_declaration_clause): Treat system + header as extern "C" if NO_IMPLICIT_EXTERN_C undefined. + +2002-12-30 Nathanael Nerode + + * config-lang.in, Make-lang.in, operators.def, cp-tree.def: + GCC, not GNU CC. + +2002-12-30 Mark Mitchell + + * parse.y: Remove. + * spew.c: Likewise. + * Make-lang.in (gt-cp-spew.h): Remove. + * cp-tree.h (do_pending_lang_change): Remove. + (do_identifier): Change prototype. + (finish_id_expr): Remove. + * decl.c (lookup_name_real): Remove yylex variable. + * decl2.c (build_expr_from_tree): Adjust call to do_identifier. + * lex.c (init_cpp_parse): Remove. + (reduce_cmp): Likewise. + (token_cmp): Likewise. + (yychar): Likewise. + (lastiddecl): Likewise. + (token_count): Likewise. + (reduce_count): Likewise. + (yyhook): Likewise. + (print_parse_statistics): Likewise. + (do_pending_lang_change): Likewise. + (do_identifier): Remove parsing parameter. + * lex.h (lastiddecl): Remove. + (looking_for_typename): Remove. + (looking_for_template): Likewise. + (pending_lang_change): Likewise. + (yylex): Likewise. + * semantics.c (finish_id_expr): Remove. + + * decl.c (grokdeclarator): Diagnost "extern thread" and "static + thread" correctly. + +2002-12-30 Nathanael Nerode + + * decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front + end, not the C front end. + +2002-12-30 Nathan Sidwell + + * cp-tree.h (THUNK_TARGET): New macro. + (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo. + (finish_thunk): Remove offset parms. + * class.c (find_final_overrider): Look through thunks. + (get_vcall_index): Use THUNK_TARGET. + (update_vtable_entry_for_fn): Look through thunks. Set covariant + fixed offset here. Adjust finish_thunk call. + (build_vtbl_initializer): Adjust finish_thunk calls. + * mangle.c (mangle_call_offset): Remove superfluous if. + (mangle_thunk): Adjust. + * method.c (make_thunk): Adjust. + (finish_thunk): Adjust. + (thunk_adjust): Remove assert. + (use_thunk): Use THUNK_TARGET + * dump1.c (cp_dump_tree): Adjust thunk dumping. + + PR c++/9054 + * class.c (layout_class_type): Set TYPE_CONTEXT of type for base. + * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types. + +2002-12-28 Gabriel Dos Reis + + Remove traditional C constructs 4/n. + * decl2.c (grok_method_quals, warn_if_unknown_interface, + grok_x_components, cp_build_parm_decl, build_artificial_parm, + maybe_retrofit_in_chrg, grokclassfn, grok_array_decl, + delete_sanity, check_member_template, check_java_method, + check_classfn, finish_static_data_member_decl, grokfield, + grokbitfield, grokoptypename, grok_function_init, + cplus_decl_attributes, constructor_name, defer_fn, + build_anon_union_vars, finish_anon_union, coerce_new_type, + coerce_delete_type, comdat_linkage, maybe_make_one_only, + key_method, import_export_vtable, import_export_class, + output_vtable_inherit, import_export_decl, import_export_tinfo, + build_cleanup, get_guard, get_guard_bits, get_guard_cond, + set_guard, start_objects, finish_objects, + start_static_storage_duration_function, + finish_static_storage_duration_function, get_priority_info, + start_static_initialization_or_destruction, + finish_static_initialization_or_destruction, + do_static_initialization, do_static_destruction, + prune_vars_needing_no_initialization, write_out_vars, + reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor, + add_using_namespace, merge_functions, ambiguous_decl, + lookup_using_namespace, lookup_using_namespace, + qualified_lookup_using_namespace, set_decl_namespace, + decl_namespace, current_decl_namespace, push_decl_namespace, + pop_decl_namespace, push_scope, pop_scope, add_function, + arg_assoc_namespace, arg_assoc_template_arg, arg_assoc, + lookup_arg_dependent, do_namespace_alias, + validate_nonmember_using_decl, do_nonmember_using_decl, + do_toplevel_using_decl, do_local_using_decl, + do_class_using_decl, do_using_directive, check_default_args, + mark_used, handle_class_head): Use C90 prototypings. Use booleans. + * parser.c (cp_parser_class_head): Use booleanss. + * decl.c (walk_globals, walk_vtables): Likewise. + * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables, + walk_globals): Change return type from 'int' to 'bool'. + * rtti.c (init_rtti_processing, build_headof, throw_bad_cast + throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p, + build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr, + get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast, + qualifier_flags, tinfo_base_init, generic_initializer, + ptr_initializer, dfs_class_hint_mark, ptm_initializer, + dfs_class_hint_unmark, class_hint_flags, class_initializer, + typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info, + get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos, + unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise. + * repo.c (repo_compile_flags, repo_template_declared, + repo_template_defined, repo_class_defined, repo_get_id, + repo_template_used, repo_vtable_used, repo_inline_used, + repo_tinfo_used, repo_template_instantiated, extract_string, + open_repo_file, afgets, init_repo, reopen_repo_file_for_write, + finish_repo): Likewise. + * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier, + cxx_print_xnode): Likewise.. + * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set, + cxx_warn_unused_global_decl, cp_expr_size): Likewise. + * cxxfilt.c (demangle_it, print_demangler_list, usage, + standard_symbol_characters, hp_symbol_characters, main, fatal): + Likewise. + (strip_underscore): Change type from 'int' to 'bool'. + (main): Use boolean constants. + +2002-12-28 Gabriel Dos Reis + + Remove traditional C constructs 3/n. + * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, + build_up_reference, warn_ref_binding, convert_to_reference, + convert_from_reference, convert_lvalue, cp_convert, ocp_convert, + convert_to_void, convert, convert_force, build_type_conversion, + build_expr_type_conversion, type_promotes_to, + perform_qualification_conversions): Use C90 prototyping style. + * decl2.c (grok_array_decl): Use boolean constant. + (delete_sanity): Likewise. + * typeck.c (build_unary_op): Likewise. + * semantics.c (finish_switch_cond): Likewise. + * parser.c (cp_parser_direct_new_declarator): Likewise. + * init.c (build_new): Likewise. + +2002-12-27 Mark Mitchell + + * Make-lang.in (po-generated): Remove parse.c. + (CXX_OBJS): Remove parse.o and spew.o. Add parser.o. + ($(srcdir)/cp/parse.h): Remove target. + ($(srcdir)/cp/parse.c): Likewise. + (gt-cp-parse.h): Likewise. + (gt-cp-parser.h): New target. + (c++.distclean): Do not remove parse.output. + (c++.maintainer-clean): Do not remove parse.c or parse.h. + (cp/spew.o): Remove target. + (cp/lex.o): Adjust dependencies. + (cp/pt.o): Likewise. + (cp/parse.o): Likewise. + (cp/TAGS): Do not mention parse.c. + (cp/parser.o): New target. + * NEWS: Mention the new parser. + * call.c (build_scoped_method_call): Simplify. + (build_method_call): Likewise. + (build_new_function_call): Adjust calls to add_function_candidate + and add_template_candidate. + (build_new_op): Improve handling of erroroneous operands. + (convert_default_arg): Remove circular argument processing. + (name_as_c_string): New function. + (build_new_method_call): Use it. + (perform_implicit_conversion): Use error_operand_p. + * class.c (finish_struct_anon): Use constructor_name_p. + (check_field_decls): Likewise. + (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN. + (resolve_address_of_overloaded_function): Likewise. + (instantiate_type): Tweak pointer-to-member handling. + (get_primary_binfo): Remove incorrect assertion. + * config-lang.in (gtfiles): Add parser.c, remove parse.c. + * cp-tree.h (DEFARG_TOKENS): New macro. + (default_arg): New structure. + (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG. + (lang_tree_node): Add default_arg. + (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE. + (type_info_ref_type): New macro. + (saved_scope): Make processing_explicit_instantiation a boolean. + (check_access): New field. + (unparsed_text): Remove. + (language_function): Remove unparsed_inlines. + (error_operand_p): New macro. + (lang_decl): Adjust pending_inline_info. + (DEFARG_POINTER): Remove. + (tag_types): Add typenames. + (lookup_ualified_name): Declare. + (lookup_name_real): Likewise. + (shadow_tag): Adjust prototype. + (get_scope_of_declarator): Declare it. + (process_next_inline): Remove it. + (check_for_missing_semicolon): Likewise. + (maybe_get_template_decl_from_type_decl): Declare it. + (finish_label_stmt): Adjust prototype. + (finish_non_static_data_meber): Declare it. + (finish_pseudo_destructor_call_expr): Rename to ... + (finish_pseudo_destructor_expr): ... this. + (finish_compound_literal): Declare it. + (begin_inline_definitions): Remove it. + (init_spew): Remove. + (peekyylex): Likewise. + (arbitrate_lookup): Likewise. + (frob_opname): Likewise. + (maybe_snarf_defarg): Likewise. + (add_defarg_fn): Likewise. + (do_pending_defargs): Likewise. + (done_pending_defargs): Likewise. + (unprocessed_defarg_fn): Likewise. + (replace_defarg): Likewise. + (end_input): Likewise. + (get_overloaded_fn): Likewise. + * cvt.c (convert_to_reference): Improve error handling. + * decl.c (lookup_name_real): Do not declare it static. + (maybe_push_to_top_level): Set check_access. + (identifier_type_value): Adjust call to lookup_name_real. + (lookup_qualified_name): New method. + (lookup_name_real): Remove special-case parsing code. + (lookup_name-nonclass): Adjust call to lookup_name_real. + (lookup_name_namespace_only): Likewise. + (lookup_name): Likewise. + (check_tag_decl): Return the type declared. + (shadow_tag): Likewise. + (register_dtor_fn): Tweak check_access. + (grokfndecl): Use constructor_name_p. + (get_scope_of_declarator): New function. + (grokdeclarator): Obscure tweaks for slightly different declarator + representations. + (start_method): Return error_mark_node to indicate failure. + (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs. + * decl2.c (constructor_name_full): Simplify. + (constructor_name): Use it. + (build_expr_from_tree): Adjust for changes to do new parser. + (push_scope): Improve robustness. + (validate_nonmember_using_decl): Process declarations, not names. + (do_class_using_decl): Likewise. + (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS + here. + * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs. + * expr.c (cxx_expand_expr): Handle BASELINKs. + * init.c (member_init_ok_or_else): Issue more errors. + (build_offset_ref): Tweak handling of FUNCTION_DECLs. + * lex.c: Do not include parse.h. + (yypring): Do not declare. + (yylval): Likewise. + (make_reference_declarator): Remove error-generating code. + (rid_to_yy): Remove. + (cxx_init): Do not call init_spew. + (yypring): Remove. + (check_for_missing_semicolon): Remove. + * lex.h (got_scope): Remove. + (got_object): Remove. + * method.c (hack_identifier): Use finish_non_static_data_member. + (implicitly_declare_fn): Adjust use of constructor_name. + * parser.c: New file. + * pt.c (parse.h): Do not include it. + (maybe_get_template_decl_from_template): Do not declare it. + (finish_member_template_decl): Tweak. + (begin_explicit_instantiation): Adjust for + processing_explicit_instantiation being boolean. + (end_explicit_instantiation): Likewise. + (maybe_process_partial_specialization): Tighten specialization + test. + (retrieve_local_specialization): Adjust ue of hash table. + (eq_local_specializations): New function. + (register_local_specialization): Likewise. + (push_template_decl_real): Remove unnecessary test. + (maybe_get_template_decl_from_type_decl): Don't make it static. + (for_each_template_parm_r): Handle TYPEOF_TYPE. + (tsubst_copy): Use retrieive_local_specialization to handle + PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs. + Handle COMPONENT_REFs with pseudo-destructor-expressions. + Simplify handling of CALL_EXPR and METHOD_CALL_EXPR. + (tsubst_expr): Pass decls, not names, to do_local_using_decl. + (unify): Tweak handling of CONST_DECLs. + (regenerate_decl_from_template): Use push_nested_class. + (template_for_substitution): New funciton. + (instantiate_decl): Use it. Register parameters as local + specializations. + * rtti.c (init_rtti_processing): Set type_info_ref_type. + (build_typeid): Use it. + (get_typeid): Likeise. + * search.c (accessible_p): Use check_access, not + flag_access_control. + (adjust_result_of_qualified_name_lookup): Pay attention to the + context_class. + * semantics.c (finish_asm_stmt): Adjust error handling. + (finish_label_stmt): Return the statement. + (finish_non_static_data_member): New function. + (finish_class_expr): Handle BASELINKs. + (finish_call_expr): Handle PSEUDO_DTOR_EXPR. + (finish_object_call_expr): Simplify handling during templates. + (finish_pseudo_destructor_call_expr): Rename to ... + (finish_pseudo_dtor_expr): ... this. + (finish_compound_literal): New function. + (begin_inline_definitions): Remove. + (finish_sizeof): Remove special template handling. + * spew.c: Do not include parse.h. + * tree.c (get_overloaded_fn): Remove. + * typeck.c (build_class_member_access_expr): Handle + PSEUDO_DTOR_EXPR. Adjust handling of static member functions. + (lookup_destructor): New function. + (finish_class_member_access_expr): Use it. + (convert_arguments): Simplify. + (build_unary_op): Handle BASELINKs. + +2002-12-26 Nathan Sidwell + + PR c++/4803 + * decl2.c (mark_used): Defer inline functions. + (finish_file): Merge deferred_fns loops. Check all used + inline functions have a definition. + * method.c (make_thunk): Thunks are not inline. + + PR c++/5116, c++/764 + * call.c (build_new_op): Make sure template class operands are + instantiated. + +2002-12-24 Nathan Sidwell + + PR C++/7964 + * cp-tree.h (resolve_scoped_fn_name): Prototype. + * call.c (resolve_scoped_fn_name): New function. Deal with + more template expansion. Broken out of ... + * parse.y (parse_finish_call_expr): ... here. Call it. + * decl2.c (build_expr_from_tree, CALL_EXPR): Use + resolve_scoped_fn_name and build_call_from_tree. + + PR c++/9053 + * decl.c (duplicate_decls): Templates may be disambiguated by + return type. + + PR c++/8702 + * decl2.c (check_classfn): Use lookup_fnfield_1. List all + conversion operators on failure. + +2002-12-23 Gabriel Dos Reis + + Remove traditional C constructs 2/n. + * call.c (tourney, build_field_call, equal_functions, joust, + compare_ics, build_over_call, build_java_interface_fn_ref, + convert_like_real, op_error, build_object_call, resolve_args, + build_vfield_ref, check_dtor_name, build_scoped_method_call, + build_addr_func, build_call, build_method_call, null_ptr_cst_p, + sufficient_parms_p, build_conv, non_reference, strip_top_quals, + standard_conversion, reference_related_p, + reference_compatible_p, convert_class_to_reference, + direct_reference_binding, reference_binding, + ,implicit_conversion, is_complete, promoted_arithmetic_type_p, + add_template_conv_candidate, any_viable, any_strictly_viable, + build_this, splice_viable, print_z_candidates, + build_user_type_conversion, build_new_function_call, + conditional_conversion, build_conditional_expr, build_new_op, + build_op_delete_call, enforce_access, call_builtin_trap, + convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to, + convert_default_arg, type_passed_as, convert_for_arg_passing, + in_charge_arg_for_name, is_properly_derived_from, + maybe_handle_implicit_object, maybe_handle_ref_bind, + source_type, add_warning, can_convert, can_convert_arg, + perform_implicit_conversion, can_convert_arg_bad, + initialize_reference, add_conv_candidate, + add_template_candidate_real, add_template_candidate): Ansify. + +2002-12-22 Nathan Sidwell + + PR c++/8572 + * cp-tree.h (grokoptypename): Add SCOPE parameter. + * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type + if in a template scope. + * parse.y (unoperator): Return the scope. + (operator_name): Adjust grokoptypename call. + +2002-12-22 Kriang Lerdsuwanakij + + * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t. + * decl.c (make_unbound_class_template): Adjust. Check for tf_error. + * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error. + +2002-12-20 Kazu Hirata + + * ChangeLog: Fix a typo. + * class.c: Fix comment typos. + * cp-tree.h: Likewise. + +2002-12-18 Jason Merrill + + Handle anonymous unions at the tree level. + C++ ABI change: Mangle anonymous unions using the name of their + first named field (by depth-first search). Should not cause + binary compatibility problems, though, as the compiler previously + didn't emit anything for affected unions. + * cp-tree.def (ALIAS_DECL): New tree code. + * decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the + first field, not the largest. + (finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME, + push the decl, and write it out at namespace scope. + * decl.c (lookup_name_real): See through an ALIAS_DECL. + (pushdecl): Add namespace bindings for ALIAS_DECLs. + * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name + of a decl which doesn't have one. + * typeck.c (build_class_member_access_expr): Don't recurse if + we already have the type we want. + +2002-12-18 Kriang Lerdsuwanakij + + PR c++/8099 + * friend.c (make_friend_class): Allow partial specialization + when declaration is not a template friend. + +2002-12-18 Kriang Lerdsuwanakij + + PR c++/3663 + * pt.c (lookup_template_class): Copy TREE_PRIVATE and + TREE_PROTECTED to created decl nodes. + +2002-12-18 Mark Mitchell + + * class.c (build_base_field): Do not set DECL_PACKED on the + FIELD_DECL. + +2002-12-18 Gabriel Dos Reis + + * cp-tree.h (struct tree_srcloc): Use location_t. + (SOURCE_LOCUS): New. + (SRCLOC_FILE, SRCLOC_LINE): Adjust. + +2002-12-17 Jason Merrill + + * decl.c (finish_function): Also complain about no return in + templates. + * semantics.c (finish_return_stmt): Also call check_return_expr in + templates. + * typeck.c (check_return_expr): In a template, just remember that we + saw a return. + +2002-12-16 Jason Merrill + + * semantics.c (simplify_aggr_init_exprs_r): Don't change the type + of the CALL_EXPR. + + * semantics.c (do_pushlevel): Call pushlevel after adding the + SCOPE_STMT. + (do_poplevel): Call poplevel before adding the SCOPE_STMT. + * parse.y (function_body): Go back to using compstmt. + * decl.c (pushdecl): Skip another level to get to the parms level. + + * call.c (build_new_method_call): Use is_dummy_object to determine + whether or not to evaluate the object parameter to a static member + function. + +2002-12-14 Jason Merrill + + * semantics.c (simplify_aggr_init_exprs_r): Also prepend the + return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR. + * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE, + don't bother with an AGGR_INIT_EXPR. + (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE, + just generate a new decl normally. Take return slot parm. + * cp-tree.h: Adjust prototype. + +2002-12-13 Gabriel Dos Reis + + PR C++/8031 + * cvt.c (convert_to_pointer_force): Don't try comparing against + erronous type. + +2002-12-13 Geoffrey Keating + + * cp-tree.h: Have the multiple-include guards around + the entire file. + +2002-12-10 David Edelsohn + + * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos + for SPEW_DEBUG. + (snarf_method): Same. + (snarf_defarg): Same. + +2002-12-10 Mark Mitchell + + PR c++/8372 + * pt.c (tsubst_copy): Handle destructor names more correctly. + +2002-12-10 Matt Austern + + * cp-tree.h: get rid of needs_virtual_reinit bit. + +2002-12-09 Mark Mitchell + + * NEWS: Document removal of in-class initialization extension for + static data members of non-arithmetic, non-enumeration type. + * decl.c (check_static_variable_definition): Do not allow that + extension. + * decl2.c (grokfield): Do not call digest_init when processing + templates. + +2002-12-05 Kaveh R. Ghazi + + * error.c (dump_expr): Fix format specifier warning. + +2002-12-04 Geoffrey Keating + + * class.c (finish_struct_1): Correct comment. + * cp-tree.c (DECL_SORTED_FIELDS): Likewise. + +2002-12-04 Gabriel Dos Reis + + PR C++/8799 + * error.c (dump_expr): Don't ever try to dump a non-existent + expression. + +2002-12-03 Nathan Sidwell + + Implement covariant returns. + * cp-tree.h (IS_AGGR_TYPE_2): Remove. + (struct lang_decl_flags): Add this_thunk_p flag. + Rename vcall_offset to virtual_offset. + (struct lang_decl): Rename delta to fixed_offset. + (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines. + (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg. + (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ... + (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here. + (make_thunk): Add this_adjusting arg. + (finish_thunk): Declare. + (mangle_thunk): Add this_adjusting arg. + * class.c (get_vcall_index): Use base function for lookup. + (update_vtable_entry_for_fn): Generate covariant thunk. + (finish_struct_1): Set DECL_VINDEX to NULL for thunks. + (build_vtbl_initializer): Use base function for lookup. + Finish covariant thunk here. Adjust thunk generation. + * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling. + Adjust thunk dumping. + * mangle.c (mangle_call_offset): New function. + (mangle_thunk): Adjust for covariant thunks. + * method.c (make_thunk): Adjust. Do not set name here. + (finish_thunk): New function. Set name here. + (use_thunk): Generate covariant thunks too. + (thunk_adjust): New function. + * search.c (covariant_return_p): Remove. Fold into ... + (check_final_overrider): ... here. Simplify. + * semantics.c (emit_associated_thunks): Walk covariant thunk lists. + +2002-12-03 Jason Merrill + + PR c++/8674 + * call.c (build_over_call): Check specifically for TARGET_EXPR + when eliding. + + PR c++/8461, c++/8625 + * call.c (convert_for_arg_passing): Don't mess with error_mark_node. + (cp_convert_parm_for_inlining): Remove. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): + Remove. + * cp-tree.h (ADDR_IS_INVISIREF): Remove. + * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code. + + * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on + an ambiguous conversion. + +2002-12-03 Mark Mitchell + + PR c++/8688 + * decl.c (reshape_init): Handle erroneous initializers. + +2002-12-02 Mark Mitchell + + PR c++/8720 + * spew.c (remove_last_token): Make sure that last_chunk is set + correctly. + + PR c++/8615 + * error.c (dump_expr): Handle character constants with + TREE_OVERFLOW set. + +2002-12-02 Kriang Lerdsuwanakij + + DR 180 + * decl.c (grokdeclarator): Require class-key for all friend class. + Output the correct type and context in the error message. + +2002-12-01 Mark Mitchell + + PR c++/5919 + * pt.c (unify): Use variably_modified_type_p to test validity of + template argument types. + + PR c++/8727 + * cp-tree.h (lang_type_class): Add typeinfo_var. + (CLASSTYPE_TYPEINFO_VAR): New macro. + * rtti.c (get_tinfo_decl): Use it. + + PR c++/8663 + * init.c (expand_member_init): Always get the main variant of a + base class. + +2002-12-01 Mark Mitchell + + PR c++/8332 + PR c++/8493 + * decl.c (cxx_init_decl_processing): Use size_type_node, not + c_size_type_node. + * decl2.c (coerce_new_type): Likewise. + * except.c (do_allocate_exception): Likewise. + +2002-11-30 Zack Weinberg + + * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c, + dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c, + lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c, + repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, + typeck2.c: Include coretypes.h and tm.h. + * Make-lang.in: Update dependencies. + +2002-11-30 Mark Mitchell + + PR c++/8227 + * decl.c (layout_var_decl): Deal gracefully with erroneous types. + (check_initializer): Validate the type of the initialized + variable, even if the initializer is absent. + * typeck.c (cp_type_quals): Deal gracefully with erroneous types. + + PR c++/8214 + * typeck.c (convert_for_assignment): Do not use + decl_constant_value on the operand. + + PR c++/8511 + * pt.c (instantiate_decl): Handle template friends defined outside + of the class correctly. + +2002-11-29 Joe Buck + + * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for + anonymous structs. + +2002-11-29 Mark Mitchell + + * class.c (walk_subobject_offsets): Recur on binfos as well as on + types. + (layout_nonempty_base_or_field): Pass it a binfo when processing a + base class. + (layout_empty_base): Likewise. + (build_base_field): Likewise. + +2002-11-27 Mark Mitchell + + * class.c (build_base_field): Make sure we get the canonical base + when descending through primary bases. + +2002-11-26 Geoffrey Keating + + * decl.c (check_initializer): Don't error on initialisation of + a scalar with a brace-enclosed expression. + +2002-11-26 Nathan Sidwell + + * cp-tree.h (DECL_LANG_FLAG_4): Document more uses. + (template_parms_equal): Remove prototype. + * typeck.c (buuld_indirect_ref): Reformat. + +2002-11-25 Jason Merrill + + * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT + and a DO_STMT. + +2002-11-25 Mark Mitchell + + * tree.c (cp_build_qualified_type_real): Correct handling of + array types. + * class.c (walk_subobject_offsets): Fix thinko. + (build_base_field): Record offsets of empty bases in primary + virtual bases. + (layout_class_type): Record offsets of empty bases in fields. + + * search.c (is_subobject_of_p_1): Fix thinko. + (lookup_field_queue_p): Likewise. + +2002-11-24 Mark Mitchell + + * class.c (layout_class_type): Reuse tail padding when laying out + virtual bases. + +2002-11-22 Mark Mitchell + + * rtti.c (qualifier_flags): Fix thinko. + +2002-11-21 Gabriel Dos Reis + + Remove traditional C constructs 1/n. + * cp-tree.h (init_method, set_mangled_name_for_decl, + build_opfncall, hack_identifier, make_thunk, use_thunk, + synthesize_method, implicitly_declare_fn, + skip_artificial_parms_for, optimize_function, calls_setjmp_p, + maybe_clone_body): Remove use of PARAMS. + + * method.c (do_build_assign_ref, do_build_copy_constructor, + synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy): + Likewise. + (synthesize_method): Use 'bool' type and constants instead of + 'int'. + (locate_copy): Likewise. + (implicitly_declare_fn): Likewise. + + * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function): + Remove old-style declaration. + (maybe_clone_body): Use 'bool' type and constants. + +2002-11-21 Glen Nakamura + + PR c++/8342 + * typeck.c (get_member_function_from_ptrfunc): Make sure that a + SAVE_EXPR for instance_ptr doesn't get evaluated first inside one + of the branches of a COND_EXPR. + +2002-11-19 Mark Mitchell + + * pt.c (for_each_template_parm): Free allocated memory. + * search.c (is_subobject_of_p_1): New function. + (is_subobject_of_p): Avoid walking virtual bases multiple times. + +2002-11-19 Jason Thorpe + + * g++spec.c (lang_specific_spec_functions): New. + +2002-11-15 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * class.c: Likewise. + * decl2.c: Likewise. + +2002-11-14 Zack Weinberg + + * search.c (dfs_push_decls): Do not try to reorder elements + 3..n of method_vec if method_vec has only two elements. + Reverse order of two tests to avoid accessing unallocated + memory. + +2002-11-14 Mark Mitchell + + * class.c (dfs_find_final_overrider): Adjust so that the most + derived object is a binfo, rather than a class type. + (find_final_overrider): Likewise. + (add_vcall_offset_vtbl_entries_1): Simplify accordingly. + (add_vcall_offset): Likewise. + +2002-11-09 Kriang Lerdsuwanakij + + PR c++/8389 + * pt.c (instantiate_template): Push class scope for member + functions. + (get_mostly_instantiated_function_type): Likewise. Don't call + tsubst on context. Remove CONTEXTP and TPARMSP parameters. + * cp-tree.h (get_mostly_instantiated_function_type): Adjust. + * mangle.c (write_encoding, write_unqualified_name): Adjust. + +2002-11-07 Mark Mitchell + + * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of + vcall offfsets. Split out ... + (add_vcall_offset): ... new function. + + PR c++/8338 + * pt.c (for_each_template_parm): Add htab parameter. + (process_partial_specialization): Adjust call. + (push_template_decl_real): Likewise. + (pair_fn_data): Add visited. + (for_each_template_parm_r): Avoid walking duplicates more than + once. + (uses_template_parms): Adjust call to for_each_template_parm. + +2002-11-07 Mark Mitchell + + * class.c (add_implicitly_declared_members): Put implicitly + declared functions at the end of TYPE_METHODs when -fabi-version + is at least 2. + +2002-11-05 Geoffrey Keating + + * decl2.c (finish_file): Correct spelling. + +2002-11-03 Mark Mitchell + + * call.c (build_special_member_call): Do not try to lookup VTTs by + name. + * class.c (vtbl_init_data): Add generate_vcall_entries. + (get_vtable_decl): Do not look up virtual tables by name. + (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P. + (set_primary_base): Do not set CLASSTYPE_RTTI. + (determine_primary_base): Likewise. + (get_matching_virtual): Remove. + (get_vcall_index): New function. + (update_vtable_entry_for_fn): Do not try to use virtual thunks + when they are not required. Assign vcall indices at this point. + (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT. + Do update dynamic_classes. + (build_vtt): Do not add VTTs to the symbol table. + (build_ctor_vtbl_group): Likewise. + (build_vtbl_initializer): Simplify handling of vcall indices. + (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets + for the most derived class. + (add_vcall_offset_vtbl_entries_1): But do not actually add them to + the vtable. + * cp-tree.h (dynamic_classes): New macro. + (lang_type_class): Remove rtti. Add vtables. Add vcall_indices. + (CLASSTYPE_RTTI): Remove. + (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove. + (CLASSTYPE_VCALL_INDICES): New macro. + (CLASSTYPE_VTABLES): Likewise. + (BV_USE_VCALL_INDEX_P): Remove. + (build_vtable_path): Remove. + * decl2.c (finish_vtable_vardecl): Remove. + (key_method): Remove #if 0'd code. + (finish_vtable_vardecl): Rename to ... + (maybe_emit_vtables): ... this. + (finish_file): Use it. + * search.c (look_for_overrides_here): Update comment. + +2002-11-01 Zack Weinberg + + PR c/7353 redux + * decl2.c (grokfield): Reject TYPE_DECLs with initializers. + +2002-10-30 Jason Merrill + + PR c++/8186 + * cp-tree.h (ADDR_IS_INVISIREF): New macro. + * call.c (convert_for_arg_passing): Set it. + * except.c (stabilize_throw_expr): Recurse for such an arg. + +2002-10-31 Mark Mitchell + + * cp-tree.h (lang_decl_flags): Remove init_priority. + (lang_decl): Add delta. + (GLOBAL_INIT_PRIORITY): Remove. + (THUNK_DELTA): Revise definition. + * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY. + * dump.c (cp_dump_tree): Don't dump it. + +2002-10-30 Mark Mitchell + + PR c++/8160 + * typeck2.c (process_init_constructor): Call complete_array_type. + + PR c++/8149 + * decl.c (make_typename_type): Issue errors about invalid results. + +2002-10-30 Kriang Lerdsuwanakij + + Core issue 287, PR c++/7639 + * cp-tree.h (lang_type_class): Add decl_list field. + (CLASSTYPE_DECL_LIST): New macro. + (maybe_add_class_template_decl_list): Add declaration. + * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST. + (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST. + (maybe_add_class_template_decl_list): New function. + (add_implicitly_declared_members): Use it. + * decl.c (maybe_process_template_type_declaration): Likewise. + (pushtag): Likewise. + * friend.c (add_friend): Likewise. + (make_friend_class): Likewise. + * semantics.c (finish_member_declaration): Likewise. + (begin_class_definition): Initialize CLASSTYPE_DECL_LIST. + * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST + to process members and friends in the order of declaration. + +2002-10-29 Mark Mitchell + + PR c++/8287 + * decl.c (finish_destructor_body): Create the label to jump to + when returning from a destructor here. + (finish_function_body): Rather than here. + +2002-10-25 Zack Weinberg + + PR c++/7266 + * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a + SCOPE_REF is not null before dereferencing it. + +2002-10-25 Mark Mitchell + + * call.c (build_over_call): Use DECL_CONTEXT, not + DECL_VIRTUAL_CONTEXT. + * class.c (modify_vtable_entry): Don't mess with + DECL_VIRTUAL_CONTEXT. + (set_vindex): Remove. + (set_primary_base): Remove vfuns_p parameter. + (determine_primary_base): Likewise. + (modify_all_vtables): Likewise. + (layout_class_type): Likewise. Adjust calls to other functions + accordingly. + (finish_struct_1): Adjust calls to modified functions. Set + DECL_VINDEX here. + * cp-tree.h (lang_type_class): Remove vsize. + (CLASSTYPE_VSIZE): Remove. + (lang_decl): Remove thunks. + (DECL_THUNKS): Adjust. + (DECL_VIRTUAL_CONTEXT): Remove. + (duplicate_decls): Don't copy it. + * pt.c (build_template_decl): Don't set it. + (tsubst_decl): Likewise. + * typeck.c (expand_ptrmemfunc_cst): Don't use it. + + * class.c (build_vtbl_initializer): Don't use build_vtable_entry. + (build_vtable_entry): Remove. + * cp-tree.h (BINFO_VIRTUALS): Expand documentation. + (lang_decl): Add thunks. + (DECL_THUNKS): New macro. + * decl.c (duplicate_decls): Copy it. + * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS. + * semantics.c (emit_associated_thunks): Simplify. + +2002-10-24 David Edelsohn + + PR c++/7228 + * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that + lang_type structure exists before accessing field. + (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro. + (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar. + (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro. + * class.c (check_field_decls): Use new macros. + * typeck2.c (process_init_constructor): Remove redundant check for + existence of lang_type structure. + +2002-10-24 Mark Mitchell + + * class.c (end_of_base): New method. + (end_of_class): Use it. Check indirect virtual bases. + + * class.c (check_field_decls): Fix typo. + +2002-10-23 Mark Mitchell + + PR c++/8067 + * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and + related variables. + + PR c++/7679 + * spew.c (next_token): Do not return an endless stream of + END_OF_SAVED_INPUT tokens. + (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of + the cached token stream. + (snarf_defarg): Likewise. + +2002-10-23 Zack Weinberg + + * cp-lang.c (cp_var_mod_type_p): New: C++ hook for + variably_modified_type_p. + * cp-tree.h: Remove prototype of variably_modified_type_p. + * tree.c (variably_modified_type_p): Remove; now implemented + in language-independent code. + +2002-10-22 Mark Mitchell + + PR c++/6579 + * spew.c (snarf_parenthesized_expression): New function. + (snarf_block): Use it. + +2002-10-22 Richard Henderson + + * method.c (use_thunk): Always compute vcall_value; assert that + it is not zero. Use can_output_mi_thunk; use output_mi_thunk + for vcall thunks as well. + +2002-10-21 Mark Mitchell + + * class.c (empty_base_at_nonzero_offset_p): New function. + (layout_nonempty_base_or_field): Do not check for conflicts when + laying out a virtual base using the GCC 3.2 ABI. + (build_base_field): Correct checking for presence of empty classes + at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P. + + * class.c (include_empty_classes): Use normalize_rli. + (layout_class_type): Likewise. + + * decl.c (reshape_init): Tweak handling of character arrays. + + PR c++/8218 + * cp-tree.h (lang_type_class): Add contains_empty_class_p. + (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro. + * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P. + (check_field_decls): Likewise. + (layout_class_type): Likewise. + (finish_struct_1): Initialize it. + (walk_subobject_offsets): Use it to prune searches. + +2002-10-20 Mark Mitchell + + * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT. + * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with + TARGET_ASM_OUTPUT_MI_THUNK in comments. + +2002-10-18 Zack Weinberg + + * decl.c (start_decl): Point users of the old initialized- + typedef extension at __typeof__. + +2002-10-18 Mark Mitchell + + * Make-lang.in (method.o): Depend on TARGET_H. + * method.c (target.h): Include it. + (use_thunk): Use target hooks. Use vcall thunks, if available. + +2002-10-18 Mark Mitchell + + * class.c (base_derived_from): Make sure return value is a bool. + +2002-10-18 Mark Mitchell + + * class.c (find_final_overrider_data_s): Remove overriding_fn and + overriding_base. + (dfs_base_derived_from): New function. + (base_derived_from): Likewise. + (dfs_find_final_overrider): Use base_derived_from. + (find_final_overrider): Adjust. + +2002-10-18 Jason Merrill + + PR c++/8080 + * semantics.c (finish_for_cond, finish_while_cond): Don't mess + with condition decls in a template. + +2002-10-17 Nathan Sidwell + + * class.c (add_method): Compare template parms too. + +2002-10-17 Mark Mitchell + + PR c++/7584 + * class.c (handle_using_decl): Allow the declaration used to be + from an ambiguous base. + + * pt.c (convert_template_argument): Revert this change: + 2002-10-16 Mark Mitchell + * pt.c (convert_template_argument): Do not fold non-type + template rguments when inside a template. + + * init.c (expand_default_init): Handle brace-enclosed initializers + correctly. + +2002-10-16 Mark Mitchell + + * mangle.c (write_expression): Correct handling of enumeration + constants. + (write_template_arg): Likewise. + * pt.c (convert_template_argument): Do not fold non-type template + arguments when inside a template. + + PR c++/7478 + * cvt.c (convert_to_reference): Allow references as the incoming + type. + +2002-10-16 Mark Mitchell + + PR c++/7524 + * method.c (do_build_assign_ref): Use cp_build_qualified_type, not + build_qualified_type. + +2002-10-15 Richard Henderson + + * error.c (dump_expr): Use real_to_decimal directly, and with + the new arguments. + +2002-10-15 Mark Mitchell + + * decl.c (reshape_init): Fix typo. + + * cp-tree.h (operator_name_info_t): Add arity. + * lex.c (init_operators): Initialize it. + * mangle.c (write_conversion_operator_name): New function. + (write_unqualified_name): Use it. + (write_template_args): Accept template arguments as a TREE_LIST. + (write_expression): Adjust handling of qualified names to match + specification. + +2002-10-15 Jason Merrill + + * call.c (call_builtin_trap): New fn. + (convert_arg_to_ellipsis): Use it. Downgrade error to warning. + (build_call): Don't set current_function_returns_abnormally outside + a function. + +2002-10-14 Mark Mitchell + + * class.c (check_field_decls): Remove empty_p parameter. Instead, + clear CLASSTYPE_EMPTY_P. + (build_base_field): Likewise. + (build_base_fields): Likewise. + (check_bases_and_members): Likewise. + (create_vtbl_ptr): Likewise. + (layout_class_type): Likewise. Ensure that empty classes have + size zero when used as base classes in the 3.2 ABI. + (finish_struct_1): Initialize CLASSTYPE_EMPTY_P and + CLASSTYPE_NEARLY_EMPTY_P. Adjust calls to avoid passing empty_p + parameter. + (is_empty_class): Correct definition when using post-3.2 ABI. + * cp-tree.h (lang_type_class): Add empty_p. + (CLASSTYPE_EMPTY_P): New macro. + +2002-10-12 Nathan Sidwell + + * init.c (build_delete): Do not apply save_expr for arrays. + (build_vec_delete): Likewise. + +2002-10-14 Mark Mitchell + + * decl.c (layout_var_decl): Call layout_decl even for variables + whose type is an array with unspecified bounds. + + PR c++/7176 + * lex.c (do_identifier): Add another option for the parsing + parameter. + * parse.y (do_id): Use it. + +2002-10-11 Gabriel Dos Reis + + PRs C++/6803, C++/7721 and C++/7803 + * decl.c (grokdeclarator): Gracefully handle template-name as + decl-specifier. + +2002-10-11 Jason Molenda + + * init.c (build_field_list): Provide uses_unions_p with a default + value. + +2002-10-11 Mark Mitchell + + PR c++/5661 + * cp-tree.h (variably_modified_type_p): New function. + (grokdeclarator) Tighten check for variably modified types as + fields. + * pt.c (convert_template_argument): Do not allow variably modified + types as template arguments. + * tree.c (variably_modified_type_p): New function. + + * NEWS: Document removal of "new X = ..." extension. + * class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on + brace-enclosed initializers. + * cp-tree.h (CP_AGGREGATE_TYPE_P): New macro. + (initialize_local_var): Remove declaration. + (expand_static_init): Likewise. + * decl.c (next_initializable_field): New function. + (reshape_init): Likewise. + (check_initializer): Use them. Build dynamic initializer for + aggregates here too. + (initialize_local_var): Simplify, and incorporate cleanup + insertion code as well. + (destroy_local_var): Remove. + (cp_finish_decl): Tidy. + (expand_static_init): Fold checks for whether or not a variable + needs initialization into this function. Simplify. + * decl2.c (do_static_initialization): Simplify. + * init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will + be done for us automatically. + (expand_default_init): Handle brace-enclosed initializers + correctly. + (expand_aggr_init_1): Remove RTL-generation code. + (build_vec_init): Remove "new X = ..." support. + * parse.y (new_initializer): Likewise. + * rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on + brace-enclosed initializer. + (create_pseudo_type_info): Likewise. + * typeck2.c (store_init_value): Don't try to handle digest_init + being called more than once. + (digest_init): Tidy handling of brace-enclosed initializers. + +2002-10-10 Kaveh R. Ghazi + + * decl.c (typename_hash): Use htab_hash_pointer. + +2002-10-10 Jim Wilson + + * decl.c (duplicate_decls): Don't call decl_attributes. + +2002-10-09 Zack Weinberg + + PR c/7353 + * decl.c (start_decl): Unconditionally issue error for + 'typedef foo = bar'. + (cp_finish_decl): Remove special case for TYPE_DECL with initializer. + (grokdeclarator): Remove redundant error for 'typedef foo = bar'. + +2002-10-09 Kaveh R. Ghazi + + * decl2.c (prune_vtable_vardecl): Delete unused function. + +2002-10-03 Mark Mitchell + + PR c++/7754 + * decl2.c (finish_anon_union): Do not expand anonymous unions when + procesing template functions. + * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable + type. Call layout_decl. + (tsubst_expr, case DECL_STMT): Handle anonymous unions. + +2002-10-07 Richard Henderson + + * decl2.c, pt.c: Revert c++/7754 fix. + +2002-10-05 Kriang Lerdsuwanakij + + PR c++/7804 + * error.c (dump_expr) [REAL_CST]: Output in decimal format. + +2002-10-03 Mark Mitchell + + PR c++/7931 + * pt.c (for_each_template_parm_r): Handle BASELINKs. + + PR c++/7754 + * decl2.c (finish_anon_union): Do not expand anonymous unions when + procesing template functions. + * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable + type. Call layout_decl. + (tsubst_expr, case DECL_STMT): Handle anonymous unions. + +2002-10-03 Mark Mitchell + + PR c++/8006 + * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template + template parameters. + (globals): Add entity and need_abi_warning. + (decl_is_template_id): Use TYPE_TEMPLATE_INFO, not + CLASSTYPE_TEMPLATE_INFO. + (is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not + TYPE_TI_TEMPLATE. + (write_prefix): Handle typename types correctly. + (write_template_prefix): Handle template template parameters + correctly. + (start_mangling): Add entity parameter. + (finish_mangling): Warn about names whose mangling will change. + (mangle_decl_string): Adjust. + (mangle_type_string): Likewise. + (mangle_special_for_type): Likewise. + (mangle_ctor_vtbl_for_type): Likewise. + (mangle_thunk): Likewise. + (mangle_guard_variable): Likewise. + (mangle_ref_init_variable): Likewise. + +2002-10-02 Mark Mitchell + + PR c++/7188. + * cp-tree.def (CTOR_INITIALIZER): Use one slot, not two. + * cp-tree.h (emit_base_init): Rename to .... + (emit_mem_initializers): ... this. + (expand_member_init): Change prototype. + * init.c (perform_member_init): Compute explicit, rather than + requiring it as a parameter. + (sort_member_init): Rename to ... + (sort_mem_initializers): ... this. Process bases and data members + together. + (sort_base_init): Remove. + (emit_base_init): Rename to ... + (emit_mem_initializers): ... this. + (expand_aggr_vbase_init_1): Remove. + (construct_virtual_bases): Rename to ... + (construct_virtual_base): ... this. + (expand_member_init): Rework handling of base initializers. + * method.c (do_build_copy_constructor): Use + finish_mem_initializers. + * parse.y (member_init): Adjust calls to expand_member_init. + * pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case. + (tsubst_initializer_list): Use expand_member_init. + * semantics.c (finish_mem_intiailizers): Simplify. + +2002-10-02 Matt Austern + * decl.c (walk_vtables_r): Fixed typo that caused result to + never get a nonzero value. + +2002-10-02 Roger Sayle + + PR optimization/6627 + * cp-tree.h (enum ptrmemfunc_vbit_where_t): Delete definition + from here, and move it to tree.h. + * decl.c (cxx_init_decl_processing): If storing the vbit + in function pointers, ensure that force_align_functions_log + is atleast one. + +2002-10-02 Matt Austern + + * class.c (check_field_decls): Changed warning about const member + variables so that it doesn't get issued for a class aggregate. + +2002-10-01 Mark Mitchell + + * decl.c (cp_finish_decl): Make sure array types are laid out, + even if the array bounds are unknown. + +2002-10-01 Steve Ellcey + + * class.c (build_vtbl_initializer): Change build_c_cast + to build1. + +2002-10-01 Mark Mitchell + + * decl.c (cp_finish_decl): Make sure array types are laid out, + even if the array bounds are unknown. + + * decl.c (cp_finish_decl): Correct check for dynamic + initialization of thread-local storage. + +2002-09-30 Nathan Sidwell + + * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also + overloaded. + +2002-09-30 Steve Ellcey + + * class.c (build_vtbl_initializer): Add cast. + (add_vcall_offset_vtbl_entries_1): + Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset. + +2002-09-30 Mark Mitchell + + * class.c (walk_subobject_offsets): Correct the calculation of + offsets for virtual bases. Correct the counting of array + elements. + (layout_nonempty_base_or_field): Simplify. Correct the + calculation of offsets to be propagated through the binfo + hierarchy. + (build_base_field): Avoid creating a FIELD_DECL for empty bases. + Add the FIELD_DECL to TYPE_FIELDS. + (build_base_fields): Adjust accordingly. + (layout_virtual_bases): Use build_base_field. + (end_of_class): Return a tree, not an integer. + (warn_about_ambiguous_direct_bases): Rename to ... + (warn_about_ambiguous_bases): ... this. + (include_empty_classes): New function. + (layout_class_type): Create an alternative version of the type to + be used when as a base class type. Do not call + finish_record_layout until we are done laying out the class. + * cp-tree.h (lang_type_class): Remove size, size_unit. Add + as_base. + (CLASSTYPE_SIZE): Reimplement. + (CLASSTYPE_SIZE_UNIT): Likewise. + (CLASSTYPE_ALIGN): Likweise. + (CLASSTYPE_USER_ALIGN): Likewise. + (CLASSTYPE_AS_BASE): New macro. + (DECL_INITIALIZED_P): Likewise. + (extract_init): Remove prototype. + (build_forced_zero_init): Rename to ... + (build_zero_init): ... this. + (force_store_init_value): Remove. + * decl.c (obscure_complex_init): Remove. + (duplicate_decls): Copy DECL_INITIALIZED_P. + (check_initializer): Do not leave junk in DECL_INITIAL. + (cp_finish_decl): Handle zero-initialization of entities with + static storage duration. + * expr.c (extract_init): Remove. + * init.c (build_forced_zero_init): Remove. + (build_zero_init): New function. + (build_default_init): Use it. + (build_field_list): Skip FIELD_DECLs for base subobjects. + (push_base_cleanups): Likewise. + * method.c (do_build_assign_ref): Likewise. + (synthesize_exception_spec): Likewise. + * pt.c (tsubst_decl): Clear DECL_INITIALIZED_P. + (regenerate_decl_from_template): To not set DECL_INITIAL for a + static data member whose initialization took place in its class. + (instantiate_decl): Do not pass an initializer to cp_finish_decl + in that situation. + * search.c (dfs_push_decls): Skip FIELD_DECLs for base subobjects. + (dfs_unuse_fields): Likewise. + * tree.c (pod_type_p): Handle error_mark_node. + (zero_init_p): Likewise. + * typeck.c (lookup_anon_field): Skip FIELD_DECLs for base + subobjects. + * typeck2.c (store_init_value): Remove #if 0'd code. + (force_store_init_value): Remove. + (process_init_constructor): Use build_zero_init. + +2002-09-29 Nathan Sidwell + + PR c++/7788 + * rtti.c (unemitted_tinfo_decl_p): Check it has a field. + +2002-09-29 Kazu Hirata + + * cp-tree.h: Fix comment typos. + * decl.c: Likewise. + * pt.c: Likewise. + +2002-09-25 Mark Mitchell + + * cp/class.c (contains_empty_class_p): New method. + (walk_subobject_offsets): Correct computation of field offset. + (layout_empty_base): Correct placement of emtpy base classes. + (layout_class_type): Warn about ABI changes. + +2002-09-23 Mark Mitchell + + * cp/class.c (layout_virtual_bases): Do not round the size of the + type to a multiple of the alignment before laying out virtual bases. + (layout_class_type): Correct handling of bit-fields that are wider + than their type inside unions. Round the size of the type to a + even number of bytes when computing the size without virtual + bases. + * cp/cp-tree.h (abi_version_at_least): New macro. + +2002-09-21 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.2: Likewise. + * call.c: Likewise. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * except.c: Likewise. + * friend.c: Likewise. + * g++spec.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * mangle.c: Likewise. + * method.c: Likewise. + * operators.def: Likewise. + * optimize.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2002-09-18 Devang Patel + + * cp/cp-tree.h: New prototype for walk_vtabls(). + * cp/decl.c (walk_vtables_r): New function. + (struct cp_binding_level): Add new members, namespaces, + names_size and vtables. + (add_decl_to_level): Add decl in namespaces or vtables + chain, if conditions match. + (walk_vtables): New function. + (walk_namespaces_r): Travers separate namespace chain + for namespace decls. + (wrapup_globals_for_namespace): Use names_size instead + of list_length(). + * cp/decl2.c (finish_file): Use walk_vtables() instead of + walk_globals() to walk vtable decls. + +2002-09-18 Nathan Sidwell + + * decl.c (grokdeclarator): Use assert, not internal_error. Don't + ICE with invalid pointers & references. + +2002-09-17 Zack Weinberg + + * Make-lang.in: Remove all references to the demangler. + * cxxfilt.c: Moved to binutils. + +2002-09-16 Nathan Sidwell + + PR c++/7718 + * pt.c (tsubst_decl): Remove assert. + + Remove DR 295 implementation. + * pt.c (check_cv_quals_for_unify): Disable function & method cases. + * tree.c (cp_build_qualified_type_real): Likewise. Don't warn + about ignoring volatile qualifiers. + + * search.c (lookup_member): Correct documentation. + +2002-09-16 Geoffrey Keating + + * cp-tree.h (union lang_tree_node): Add chain_next option. + +2002-09-16 Nathan Sidwell + + * parse.y (parse_finish_call_expr): Check lookup_member result. + + PR c++/7015 + * semantic.c (finish_asm_stmt): Fix operand/output_operands + thinko. + * typeck.c (c_expand_asm_operands): Protect from error_mark_node. + +2002-09-15 Nathan Sidwell + + PR c++/7919 + * call.c (build_over_call): Convert this pointer for fns found by + using decls. + +2002-09-15 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * ChangeLog.1: Likewise. + +2002-09-14 Nathan Sidwell + + PR c++/7768 + * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P. + +2002-09-14 Kazu Hirata + + * error.c: Fix comment formatting. + * except.c: Likewise. + * expr.c: Likewise. + * friend.c: Likewise. + * g++spec.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * mangle.c: Likewise. + * method.c: Likewise. + * optimize.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2002-09-13 Matt Austern + + PR C++/7828 + * cp/cp-tree.h, cp/tree.c: New function non_cast_lvalue_p. + * cp/call.c: Change call-by-const-reference mechanism to use + non_cast_lvalue_p when deciding whether the create a temporary. + We need a temporary when passing, e.g. (long) x by const ref. + +2002-09-13 Nathan Sidwell + + * pt.c (unify, ARRAY_TYPE): Element type can be more qualified. + +2002-09-13 Kazu Hirata + + * decl.c: Fix comment formatting. + * decl2.c: Likewise. + +2002-09-12 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-lang.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + +2002-09-11 Zack Weinberg + + * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c, + and c++filt from cxxfilt.o + version.o + $(LIBDEPS). + * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with + minor adjustments (use version_string, eliminate yet another + duplicate of xmalloc) + +2002-09-08 Kaveh R. Ghazi + + * cp-tree.h (require_complete_eh_spec_types): Add prototype. + +2002-09-05 Jason Merrill + + * typeck2.c (add_exception_specifier): Only pedwarn for an + incomplete type. + (require_complete_eh_spec_types): New fn. + (cxx_incomplete_type_diagnostic): Also support pedwarning. + * typeck.c (complete_type_or_diagnostic): Likewise. + * call.c (build_call): Call require_complete_eh_spec_types. + * rtti.c (get_pseudo_ti_desc): Give an error rather than aborting + on an incomplete type. + +2002-09-04 Jakub Jelinek + + * decl.c (start_cleanup_fn): Clear interface_only before + start_function, restore it afterwards. + +2002-09-02 Nathan Sidwell + + * cp-tree.h (finish_builtin_type): Remove. + * decl2.c (finish_builtin_type): Move to common code. + * decl.c (build_ptrmemfunc_type): Adjust. + * rtti.c (create_pseudo_type_info): Adjust. + (create_tinfo_types): Adjust. + +2002-08-31 Jason Merrill + + * cp-lang.c (cp_expr_size): Allow initialization from a + CONSTRUCTOR. + +2002-08-30 Richard Henderson + + PR opt/7515 + * tree.c: Include target.h. + (cp_cannot_inline_tree_fn): Don't auto-inline functions that + don't bind locally. + * Makefile.in (tree.o): Update. + +2002-08-27 Mark Mitchell + + * class.c (layout_virtual_bases): Warn about bugs in G++ that + result in incorrect object layouts. + (layout_class_type): Likewise. + +2002-08-24 Matt Austern + + * tree.c (lvalue_p_1): Add argument for whether casts of lvalues + are allowable. + (real_lvalue_p): Update caller. + (lvalue_p): Ditto. + (non_cast_lvalue_or_else): New. + * tree.h: Declare it. + * typeck.c (build_unary_op): Use non_cast_lvalue_or_else. + +2002-08-22 Mark Mitchell + + * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR + and COND_EXPR specially; fix error message output. + +2002-08-22 Jason Merrill + + * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR. + * semantics.c (nullify_returns_r): Likewise. + +2002-08-17 Gabriel Dos Reis + + Fix PR/7621 + * typeck.c (finish_class_member_access_expr): Diagnose cases where + name lookup finds nothing. + +2002-08-15 Jason Merrill + + * semantics.c (finish_then_clause): Remove redundant assignment. + (finish_if_stmt, begin_switch_stmt, finish_switch_stmt): Move the + extra binding level outside the if/switch statement. + (finish_while_cond, finish_for_cond): Rewrite complex condition + into the loop body. + +2002-08-15 Alexandre Oliva + + * parse.y (sizeof, alignof, typeof): New non-terminals to + increment skip_evaluation. Replace terminals with them and + decrement skip_evaluation at the end of rules using them. + * decl2.c (mark_used): Don't assemble_external if + skipping evaluation. + +2002-08-15 Gabriel Dos Reis + + Fix PR/7504 + * parse.y (parse_finish_call_expr): Handle incomplete + type used to name a scope. + +2002-08-15 Nathan Sidwell + + PR c++/7598 + * typeck.c (build_unary_op): Fold offsetof idiom. Fixes + regression caused by my 2002-08-08 patch. + +2002-08-13 Mark Mitchell + + * decl.c (pushdecl_class_level): Honor requests to bind names to + OVERLOADs. + +2002-08-11 Kaveh R. Ghazi + + * decl2.c (build_call_from_tree): Fix uninitialized variable. + * parse.y (parse_finish_call_expr): Likewise. + * repo.c (old_args, old_dir, old_main): Const-ify. + +2002-08-11 Gabriel Dos Reis + + * decl.c (duplicate_decls): Replace DECL_SOURCE_FILE + DECL_SOURCE_LINE with DECL_SOURCE_LOCATION. + * optimize.c (maybe_clone_body): Likewise. + * pt.c (tsubst_enum): Likewise. + (lookup_template_class): Likewise. + * tree.c (cp_copy_res_decl_for_inlining): Likewise. + +2002-08-10 Neil Booth + + * lang-specs.h: Remove -ansi. + +2002-08-10 Nathan Sidwell + + * tree.c (maybe_dummy_object): Replace // with /* */ + +2002-08-09 Mark Mitchell + + * call.c (standard_conversion): Use build_ptrmem_type. + * cp-tree.h (build_ptrmem_type): New function. + (adjust_result_of_qualified_name_lookup): Likewise. + * decl.c (grokvardecl): Do not look for OFFSET_TYPEs to indicate + static data members. + (build_ptrmem_type): New function. + (grokdeclarator): Do not use build_offset_type when encountering a + qualified name. + * parse.y (parse_finish_call_expr): Use + adjust_result_of_qualified_name_lookup. + * search.c (adjust_result_of_qualified_name_lookup): New function. + * typeck.c (qualify_type_recursive): Use TYPE_PTRMEM_* rather than + accessing OFFSET_TYPEs directly. + +2002-08-08 Mike Stump + + * call.c (add_builtin_candidate): legal -> valid, illegal -> invalid. + (type_decays_to): Likewise. + * class.c (find_final_overrider): Likewise. + (maybe_note_name_used_in_class): Likewise. + * decl.c (current_tmpl_spec_kind): Likewise. + (add_binding): Likewise. + (push_class_binding): Likewise. + (duplicate_decls): Likewise. + (layout_var_decl): Likewise. + (grokfndecl): Likewise. + (grokdeclarator): Likewise. + (check_default_argument): Likewise. + * decl2.c (handle_class_head): Likewise. + * error.c (dump_template_decl): Likewise. + * init.c (build_offset_ref): Likewise. + * pt.c (check_specialization_scope): Likewise. + (determine_specialization): Likewise. + (check_explicit_specialization): Likewise. + (maybe_check_template_type): Likewise. + (process_partial_specialization): Likewise. + (check_default_tmpl_args): Likewise. + (push_template_decl_real): Likewise. + (convert_template_argument): Likewise. + (try_class_unification): Likewise. + (get_bindings_real): Likewise. + (do_decl_instantiation): Likewise. + * semantics.c (begin_function_definition): Likewise. + (finish_member_declaration): Likewise. + (check_multiple_declarators): Likewise. + * typeck.c (comp_array_types): Likewise. + (comptypes): Likewise. + (expr_sizeof): Likewise. + (build_binary_op): Likewise. + (dubious_conversion_warnings): Likewise. + (check_return_expr): Likewise. + +2002-08-08 Mark Mitchell + + * typeck.c (build_class_member_access_expr): Do not return + error_mark_node when no error has occurred. + +2002-08-08 Nathan Sidwell + + * typeck.c (build_component_addr): Remove. + (build_unary_op): Just check it's not a bitfield, and then build + an ADDR_EXPR. + +2002-08-08 Nathan Sidwell + + * class.c (convert_to_base): Correct check for error_mark_node. + (create_vtable_ptr): Remove unused VFUNS_P parm. + +2002-08-08 Nathan Sidwell + + * cp/Make-lang.in (c++.mostlyclean): Remove coverage files. + +2002-08-07 Mark Mitchell + + Rework build_component_ref. + * call.c (build_vfield_ref): Do not go through build_component_ref. + (build_field_call): Use build_class_member_access_expr. + (build_user_type_conversion_1): Use BASELINK_FUNCTIONS. + (build_object_call): Likewise. + * class.c (convert_to_base): New function. + (type_requires_array_cookie): Use BASELINK_FUNCTIONS. + (instantiate_type): Handle BASELINKs. + * cp-tree.def (BASELINK): New tree code. + * cp-tree.h (BASELINK_P): Reimplement. + (SET_BASELINK_P): Remove. + (BASELINK_BINFO): Reimplement. + (BASELINK_FUNCTIONS): Likewise. + (BASELINK_ACCESS_BINFO): Likewise. + (BASELINK_OPTYPE): Likewise. + (convert_to_base): New function. + (name_p): Likewise. + (build_object_ref): Remove. + (build_component_ref_1): Likewise. + (build_component_ref): Likewise. + (build_x_component_ref): Likewise. + (build_class_member_access_expr): New function. + (finish_class_member_access_expr): Likewise. + (build_ptrmemfunc_access_expr): Likewise. + * decl.c (grokdeclarator): Handle BASELINKs. + * decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using + finish_class_member_access_expr. + (arg_assoc): Handle BASELINKs. + (do_class_using_decl): Likewise. + * error.c (dump_decl): Likewise. + (dump_expr): Use build_ptrmemfunc_access_expr. + * except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find + destructors. + (build_throw): Use BASELINK_FUNCTIONS. + * init.c (perform_member_init): Use + build_class_member_access_expr. + (build_offset_ref): Handle BASELINKs. Use + build_class_member_access_expr. + * method.c (hack_identifier): Likewise. + * parse.y (do_id): Use BASELINK, not TREE_LIST. + (primary): Remove uses of build_object_ref. + * pt.c (lookup_template_function): Handle BASELINKs. + (resolve_overloaded_unification): Likewise. + * search.c (build_baselink): Build a BASELINK, not a TREE_LIST. + (lookup_field): Use BASELINK, not TREE_LIST. + (lookup_fnfiels): Likewise. + (setup_class_bindings): Likewise. + * semantics.c (finish_object_call_expr): Do not use + build_method_call when we already know what function is being + called. + * spew.c (identifier_type): Use BASELINK, not TREE_LIST. + * tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not + TREE_CHAIN. + (name_p): New function. + * typeck.c (build_object_ref): Remove. + (build_component_ref_1): Likewise. + (build_x_component_ref): Likewise. + (build_class_member_access_expr): New function. + (finish_class_member_access_expr): Likewise. + (build_ptrmemfunc_access_expr): Likewise. + (get_member_function_from_ptrfunc): Use + build_ptrmemfunc_access_expr. + (build_binary_op): Likewise. + (build_unary_op): Likewise. + (build_ptrmemfunc): Likewise. + (pfn_from_ptrmemfunc): Likewise. + * typeck2.c (build_m_component_ref): Adjust comment. + +2002-08-07 Neil Booth + + * Make-lang.in (CXX_C_OBJS): Update. + * cp-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. + * cp-tree.h (cxx_decode_option): Remove. + * decl2.c (compare_options, lang_f_options, unsupported_options, + cxx_decode_option): Remove. + +2002-08-06 Gabriel Dos Reis + + * typeck.c (build_x_unary_op): Handle pointer-to-member. + +2002-08-05 Geoffrey Keating + + * class.c: Don't include obstack.h. + (popclass): + * decl2.c: Delete bogus comment. + * error.c: Don't include obstack.h. + * except.c: Likewise. + (dump_type): Correct comment. + * method.c: Don't include obstack.h. + * tree.c: Likewise. + +2002-08-04 Gabriel Dos Reis + + Fix PR/2213 + * cvt.c (cp_convert_to_pointer): Reject conversions from integral + expressions to pointer-to-data-member of pointer-to-member-functions. + +2002-08-04 Geoffrey Keating + + * cvt.c (ocp_convert): Delete obsolete code. + * parse.y (permanent_obstack): Delete declaration. + * pt.c (permanent_obstack): Delete declaration. + * repo.c (permanent_obstack): Delete declaration. + (open_repo_file): Use xmalloc instead of permanent_obstack. + (init_repo): Use xstrdup instead of permanent_obstack. + +2002-08-04 Nathan Sidwell + + * cp-tree.h (VF_DERIVED_VALUE): Remove. + * class.c (finish_struct_1): Use VF_BINFO_VALUE not VF_DERIVED_VALUE. + +2002-08-03 Nathan Sidwell + + PR 7470. + C++ ABI change - vfunc ordering. + * class.c (add_virtual_function): Remove. + (dfs_modify_all_vtables): Take list of all declared + virtuals. Assign all that are not in primary base. + (check_for_override): Adjust comments. + (create_vtable_ptr): Take single list of virtuals. Build chain + of declared virtuals here. + (layout_class_type): Take single list of virtuals. Adjust. + (finish_struct_1): Keep virtuals on single list. Adjust. + +2002-08-02 Mark Mitchell + + * init.c (build_member_call): Use build_new_method_call, not + build_method_call. + +2002-08-02 Krister Walfridsson + + * Make-lang.in (spew.o, lex.o, pt.o): Add path to parse.h dependencies. + +2002-08-02 Mark Mitchell + + * call.c (build_method_call): Issue a more helpful error message + about ambiguous method names. + +2002-08-02 Nathan Sidwell + + * tree.c (build_shared_int_cst): Make cache file scope, and + GTY it. + +2002-08-02 Jason Merrill + + * cp-lang.c (LANG_HOOKS_EXPR_SIZE): Define. + (cp_expr_size): New fn. + * call.c (build_over_call): Lose empty class hackery. + (convert_arg_to_ellipsis): Promote non-POD warning to error. + * typeck.c (build_modify_expr): Don't use save_expr on an lvalue. + + * semantics.c (expand_body): Do tree optimization in the function + context, too. + +2002-08-01 Neil Booth + + * cp-tree.h: Move all warning and flag declarations to c-common.h. + * decl.c: Move all warning and flag variables to c-common.c. + * decl2.c: Move all warning and flag variables to c-common.c. + * lex.c (flag_digraphs): Remove. + (warn_traditional): Now in c-common.c. + +2002-07-31 Mark Mitchell + + * call.c (build_field_call): Do not look up the field by name. + (build_method_call): Simplify. + (struct z_candidate): Add access_path and conversion_path. Remove + basetype_path. + (convert_class_to_reference): Adjust use of + add_function_candidate. + (add_candidate): Add conversion_path argument. + (add_function_candidate): Use it. + (add_conv_dndidate): Likewise. + (build_builtin_candidate): Likewise. + (add_template_candidate_real): Add conversion_path argument. + (add_template_conv_candidate): Likewise. + (add_template_candidate): Likewise. + (build_user_type_conversion_1): Use it. + (build_new_function_call): Remove name lookup code. Adjust use of + add_template_candidate and add_function_candidate. + (build_new_op): Likewise. + (convert_like_real): Use build_special_member_call. + (build_over_call): Use cand->conversion_path. + (build_special_member_call): New method. + (build_new_method_call): Remove name lookup code. + * cp-tree.def (OFFSET_REF): Update documentation. + (TEMPLATE_ID_EXPR): Likewise. + * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. + (BASELINK_OPTYPE): Likewise. + (build_new_method_call): Adjust prototype. + (build_special_member_call): New method. + (build_baselink): New method. + (build_offset_ref_call_from_tree): Likewise. + (build_call_from_tree): Likewise. + (finish_qualified_call_expr): Remove. + (finish_call_expr): Adjust prototype. + (build_x_function_call): Remove. + * cvt.c (ocp_convert): Use build_special_member_call. + * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. + (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and + CALL_EXPR. + (build_offset_ref_call_from_tree): New function. + (build_call_from_tree): Likewise. + * init.c (expand_cleanup): Use build_special_member_call. + (expand_default_init): Likewise. + (build_member_call): Use finish_call_expr. + (build_new_1): Use build_special_member_call. + (push_base_cleanups): Likewise. + * method.c (do_build_assign_ref): Likewise. + * parse.y (template_id): Do not pass a COMPONENT_REF to + lookup_template_function. + (primary): Use parse_finish_call_epxr, not finish_call_expr. + (parse_finish_call_expr): New function. + * pt.c (lookup_template_function): Add assertions. + * search.c (lookup_base): Allow T to be a binfo. + (build_baselink): New function. + (lookup_member): Use it. + * semantics.c (finish_call_expr): Do not do name lookup. + (finish_object_call_expr): Remove #if 0'd code. + (finish_qualified_call_expr): Remove. + * typeck.c (build_x_function_call): Remove. + (build_static_case): Use build_special_member_call. + * typeck2.c (build_functional_cast): Likewise. + +2002-07-30 Franz Sirl + + * lang-specs.h: Remove __GXX_ABI_VERSION, moved to gcc.c. + +2002-07-30 Gabriel Dos Reis + + * cp-tree.h (VF_DERIVED_VALUE): Restore from previous deletion. + +2002-07-30 Nathan Sidwell + + * cp-tree.h (CLASSTYPE_VFIELDS, VF_*, BV_*): Add more + documentation. + +2002-07-29 Alan Modra + + * cp-tree.h: Comment typo fix. + +2002-07-29 Richard Earnshaw + + * spew.c (space_for_token): Allocate zeroed memory for a new token + chunk. + +2002-07-27 Roger Sayle + + * decl.c (builtin_function_1): No need to explicitly mark + BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn. + +2002-07-27 Roger Sayle + + * decl2.c (cxx_decode_option): Support -fno-builtin-foo. + +2002-07-26 Jason Merrill + + * call.c (build_over_call): Likewise. + (cp_convert_parm_for_inlining): New fn. + (convert_for_arg_passing): New fn. + (convert_default_arg, build_over_call): Use it. + (type_passed_as): New fn. + * pt.c (tsubst_decl): Use it. + * decl2.c (cp_build_parm_decl): New fn. + (build_artificial_parm): Use it. + (start_static_storage_duration_function): Likewise. + * decl.c (start_cleanup_fn, grokdeclarater): Likewise. + (grokparms): Don't mess with DECL_ARG_TYPE. + * typeck.c (convert_arguments): Use convert_for_arg_passing. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): + Define. + * cp-tree.h: Declare new fns. + +2002-07-26 Neil Booth + + * cp-tree.h (flag_operator_names): Remove. + * decl2.c (flag_operator_names): Remove. + (lang_f_options): Remove operator-names. + * lex.c (D_OPNAME): Remove. + (reswords): Remove operator names. + (rid_to_yy): Remove operator names. + (init_reswords): No need to handle D_OPNAME. + * spew.c (read_process_identifier): There are no operator + names. + +2002-07-26 Jason Merrill + + * dump.c (cp_dump_tree): Call c_dump_tree. + * Make-lang.in (CXX_C_OBJS): Add c-dump.o. + +2002-07-25 Neil Booth + + * error.c (print_whitespace): Remove. + * g++spec.c (LIBUNWIND): Move. + * mangle.c (mangled_position, write_signed_number): Remove. + +2002-07-25 Neil Booth + + * decl2.c (cxx_decode_option): Similarly. + +2002-07-25 Gabriel Dos Reis + + * cp-tree.h (cxx_sizeof_nowarn): Now a macro. + (cxx_sizeof_or_alignof_type): Take a third argument. + (cxx_sizeof): Adjust definition. + (cxx_alignof): Likewise. + * init.c (build_delete): Use cxx_sizeof_nowarn to reflect reality. + * typeck.c (cxx_sizeof_or_alignof_type): Take a third argument for + complaining. + (c_sizeof_nowarn): Remove definition. + (build_unary_op): Use cxx_sizeof_nowarn. + +2002-07-24 Geoffrey Keating + + * tree.c (cp_build_qualified_type_real): When copying + pointer-to-method types, unshare the record that holds + the cached pointer-to-member-function type. + +2002-07-23 Neil Booth + + * cp-tree.h (FILE_FUNCTION_PREFIX_LEN): Remove. + +2002-07-23 Gabriel Dos Reis + + Fix PR/7363: + * typeck.c (cxx_sizeof_or_alignof_type): New function. + (c_sizeof): Remove definition. + (expr_sizeof): Use cxx_sizeof. + * decl2.c (build_expr_from_tree): Use cxx_sizeof_or_alignof_type. + * decl.c (finish_destructor_body): Use cxx_sizeof. + * semantics.c (finish_alignof): Likewise. + (finish_alignof): Use cxx_alignof. + * cp-tree.h (cxx_sizeof, cxx_alignof): New macros. + (cxx_sizeof_or_alignof_type): Declare. + (my_friendly_assert): Move to ../c-common.h. + +2002-07-23 Neil Booth + + * class.c, method.c, pt.c, search.c: Don't define obstack macros. + +2002-07-22 Kriang Lerdsuwanakij + + PR c++/7347, c++/7348 + * cp-tree.h (tsubst_flags_t): Add tf_parsing. + * decl.c (make_typename_type): Use it. + (make_unbound_class_template): Likewise. + (lookup_name_real): Don't call type_access_control if scope is + template parameter dependent. + * parse.y (template_arg): Call make_unbound_class_template with + tf_parsing set. + (nest_name_specifier): Call make_typename_type with tf_parsing set. + (typename_sub0): Likewise. + (typename_sub1): Likewise. + (instantiate_decl): Push class scope. + * pt.c (regenerate_decl_from_template): Call pushclass and popclass + for both static variable and member function template. + (instantiate_decl) Call pushclass and popclass when tsubst'ing type + and arguments. + * search.c (type_access_control): Do type access for TEMPLATE_DECL + too. + +2002-07-20 Roger Sayle + + * decl2.c (cxx_decode_option): Simplify -fhandle-exceptions + test by using positive_option. Make whitespace consistent. + +2002-07-20 Gabriel Dos Reis + + * spew.c (struct unparsed_test): Replace 'filename' and 'lineno' + members with 'locus'. Adjust use throughout. + (struct feed): Likewise. + (alloc_unparsed_test): Change prototype, take a 'const location_t *'. + Adjust use. + (snarf_defarg): Use error(), not error_with_file_and_line(). + +2002-07-19 Chris Demetriou + + * lang-specs.h (@c++): Include "%2" (cc1plus_spec) wherever + cpp_options is included. + +2002-07-17 Kriang Lerdsuwanakij + + PR c++/2862, c++/2863 + * pt.c (determine_specialization): Compare the length of + TYPE_ARG_TYPES. Tidy. + +2002-07-17 Kriang Lerdsuwanakij + + PR c++/3797 + * decl.c (duplicate_decls): Don't propagate inlining parameters from + olddecl to newdecl when newdecl is a specialization of the + instantiation olddecl. + +2002-07-17 Kriang Lerdsuwanakij + + PR c++/4802, c++/5387 + * decl.c (make_typename_type): Use enforce_access. + +2002-07-17 Scott Snyder + + PR c++/7320 + * rtti.c (get_tinfo_decl): Set DECL_COMDAT. + +2002-07-12 Mark Mitchell + + * class.c (add_method): Correct handling of conversion operators. + +2002-07-11 Mark Mitchell + + PR c++/7224 + * class.c (add_method): Simplify. + +2002-07-11 Jason Merrill + + PR c++/7279 + * tree.c (cp_copy_res_decl_for_inlining): Also copy + TREE_ADDRESSABLE. + +2002-07-10 Graham Stott + + * pt.c (template_parm_this_level_p, push_template_decl_real): + Pass depth as int pointer. + +2002-07-11 Tim Josling + + Remove front end hard coding from gengtype.c. + + * config-lang.in (gtfiles): Add files needed for this front end. + +2002-07-10 Mark Mitchell + + * cp-tree.h (unqualified_name_lookup_error): Declare it. + (begin_function_definition): Adjust prototype. + * lex.c (unqualified_name_lookup_error): New function, split out + from ... + (do_identifier): ... here. + * parse.y (parse_begin_function_definition): New function. + (fn.def1): Use it. + * semantics.c (begin_function_definition): Accept decl-specifiers + and attributes as separate parameters. + +2002-07-10 Jason Merrill + + PR c++/6255 + * decl.c (lookup_name_real): Build a new TYPENAME_TYPE rather than + modifying the old one. + +2002-07-09 Mark Mitchell + + * cp-tree.h (constructor_name_p): Declare it. + (check_template_template_default_arg): Likewise. + * class.c (handle_using_decl): Use constructor_name_p. + * decl.c (grokdeclarator): Likewise. + * decl2.c (constructor_name_p): Define it. + * init.c (build_member_call): Use constructor_name_p. + * parse.y (template_parm): Use check_template_template_default_arg. + * pt.c (check_explicit_specialization): Use constructor_name_p. + * semantics.c (check_template_template_default_arg): New function. + +2002-07-08 Kriang Lerdsuwanakij + + * pt.c (can_complete_type_without_circularity): Add static to + function definition. + +2002-07-08 Mark Mitchell + + * cp-tree.h (have_extern_spec): Declare it + * decl.c (have_extern_spec): Define it. + (start_decl): Eliminate use of used_extern_spec. + (start_function): Likewise. + * parse.y (have_extern_spec): Remove declaration. + (used_extern_spec): Likewise. + (frob_specs): Eliminate use of used_extern_spec. + (.hush_warning): Likewise. + +2002-07-07 Mark Mitchell + + * Make-lang.in (cp/parse.o): Depend on decl.h. + * cp-tree.h (do_decl_instantiation): Change prototype. + * parse.y: Include decl.h. + (parse_decl_instantiation): New function. + (explicit_instantiation): Use it. + * pt.c (do_decl_instantiation): Accept a DECL, not a DECLARATOR + and DECLSPECS. + +2002-07-07 Roger Sayle + + * error.c (dump_function_name): Use DECL_TEMPLATE_RESULT for + constructor and destructor tests when passed a TEMPLATE_DECL. + +2002-07-05 Jason Merrill + + * cvt.c (cp_convert_to_pointer): Call force_fit_type for null + pointers. + + PR optimization/7145 + * tree.c (cp_copy_res_decl_for_inlining): Also copy DECL_INITIAL. + +2002-07-05 Nathan Sidwell + + Repair damage on weak-impared targets caused by my previous patch. + * cp-tree.h (import_export_tinfo): Add parameter. + * decl2.c (import_export_tinfo): Add parameter, post adjust + DECL_COMDAT. + * rtti.c (emit_tinfo_decl): DECL_COMDAT is (nearly) always setup by + import_export_tinfo. + +2002-07-03 Kriang Lerdsuwanakij + + PR c++/6944 + * init.c (build_aggr_init): Remove qualifiers of init before calling + build_vec_init. + (build_vec_init): Flatten multi-dimensional array during cleanup. + (build_vec_delete_1): Abort if the type of each element is array. + +2002-07-03 Graham Stott + + * pt.c (instantiate_class_template): Fix typo. + +2002-07-02 Kriang Lerdsuwanakij + + * typeck2.c (cxx_incomplete_type_diagnostic): Fix typo caused + by CVS conflict in my last patch. + +2002-07-02 Kriang Lerdsuwanakij + + PR c++/6716 + * pt.c (can_complete_type_without_circularity): New function. + (instantiate_class_template): Use it. + * typeck2.c (cxx_incomplete_type_diagnostic): Improve error + message due to incomplete fields. + +2002-07-01 Mark Mitchell + + PR c++/7112 + * mangle.c (write_expression): Add mangling for sizeof when + applied to a type. + * operators.def: Remove stale comment. + +2002-06-30 Nathan Sidwell + + * cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ... + (CPTI_TYPE_INFO_PTR_TYPE): ... this. + (tinfo_decl_type): Replace with ... + (type_info_ptr_type): ... this. + (import_export_tinfo): Declare. + (tinfo_decl_p): Rename to ... + (unemitted_tinfo_decl_p): ... this. + * decl2.c (import_export_decl): Break out tinfo handling into ... + (import_export_tinfo): ... here. New function. + (finish_file): Adjust. + * rtti.c (TINFO_REAL_NAME): New macro. + (init_rtti_processing): Create the tinfo types. + (get_tinfo_decl_dynamic): Use type_info_ptr_type, get_tinfo_ptr. + (get_tinfo_decl): Adjust. + (get_tinfo_ptr): New function. + (get_type_id): Use it. + (tinfo_base_init): Create vtable decl here, if it doesn't exist. + (ptr_initializer): Use get_tinfo_ptr. + (ptm_initializer): Likewise. + (synthesize_tinfo_var): Break into ... + (get_pseudo_ti_init): ... this. Just create the initializer. + (get_pseudo_ti_desc): .. and this. + (create_real_tinfo_var): Remove. + (create_pseudo_type_info): Don't create the vtable decl here. + (get_vmi_pseudo_type_info): Remove. + (create_tinfo_types): Adjust. + (tinfo_decl_p): Rename to ... + (unemitted_tinfo_decl_p): ... here. Adjust. + (emit_tinfo_decl): Adjust. Create the initializer. + +2002-06-27 Mark Mitchell + + PR c++/6695 + * pt.c (tsubst_friend_class): Substitute into the context of the + friend before using it. + +2002-06-26 Mark Mitchell + + * cp-tree.h (xref_tag): Change prototype. + (handle_class_head): Likewise. + (build_x_component_ref): Likewise. + * decl.c (cxx_init_decl_processing): Adjust call to xref_tag. + (xref_tag): Take attributes as a separate parameter. + (xref_tag_from_type): Adjust call to xref_tag. + * decl2.c (build_expr_from_tree): Adjust call to + build_x_component_ref. + (handle_class_head): Take attributes as a separate parameter. + * parse.y (parse_xref_tag): New function. + (parse_handle_class_head): Likewise. + (primary): Use parse_xref_tag. + (class_head_decl): Use parse_handle_class_head. + (class_head_defn): Likewise. + * rtti.c (init_rtti_processing): Adjust call to xref_tag. + (build_dynamic_cast_1): Likewise. + (create_pseudo_type_info): Likewise. + (emit_support_tinfos): Likewise. + * typeck.c (build_object_ref): Adjust call to + build_x_component_ref. + (build_x_component_ref): Remove protect parameter. + +2002-06-25 Mark Mitchell + + * call.c (build_op_delete_call): Use BASELINK_FUNCTIONS. + * class.c (handle_using_decl): Likewise. + (instantiate_type): Likewise. + * cp-tree.h (BASELINK_FUNCTIONS): New macro. + (xref_basetypes): Change prototype. + (begin_mem_initializers): New function. + (get_overloaded_fn): Likewise. + * decl.c (xref_basetypes): Simplify. + * error.c (dump_expr): Use BASELINK_FUNCTIONS. + * init.c (build_offset_ref): Likewise. + * parse.y (base_init): Use begin_mem_initializers(). + (structsp): Adjust call to xref_basetypes. + * pt.c (determine_specialization): Use BASELINK_FUNCTIONS. + (instantiate_class_template): Adjust call to xref_basetypes. + * semantics.c (begin_mem_initializers): New function. + * tree.c (is_overloaded_fn): Use BASELINK_FUNCTIONS. + (really_overloaded_fn): Likewise. + (get_overloaded_fn): New function.' + (get_first_fn): USe BASELINK_FUNCTIONS. + +2002-06-24 Mark Mitchell + + * cp-tree.h (SCALAR_TYPE_P): New macro. + (check_for_out_of_scope_variable): New function. + (at_class_scope_p): Likewise. + (finish_fname): Likewise. + * class.c (finish_struct): Use at_function_scope_p. + * decl.c (check_for_out_of_scope_variable): New function, split + out from do_identifier. + (finish_enum): Use at_function_scope_p. + * lex.c (do_identifier): Use check_for_out_of_scope_variable. + * parse.y (VAR_FUNC_NAME): Give it . Use finish_fname. + (primary): Use at_function_scope_p. + * search.c (at_class_scope_p): New function. + * semantics.c (finish_fname): Likewise. + (check_multiple_declarators): Use at_function_scope_p. + +2002-06-23 Mark Mitchell + + * parse.y (parse_scoped_id): New function. + (primary): Use it. + * cp-tree.h (do_scoped_id): Adjust declaration. + * lex.c (do_scoped_id): Remove call to yylex. + * decl2.c (build_expr_from_tree): Adjust use of do_scoped_id. + * typeck2.c (add_exception_specifier): Use tree_cons, rather than + expanding it inline. + +2002-06-23 Matt Thomas + + * decl.c (finish_function): Change "#ifdef VMS_TARGET" to + "#if VMS_TARGET". + +2002-06-21 Kaveh R. Ghazi + + * mangle.c (integer_type_codes): Const-ify. + +2002-06-20 Richard Henderson + + PR c++/6747 + * typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early. + Call put_var_into_stack. + +2002-06-20 Kaveh R. Ghazi + + * spew.c (remove_last_token): Use ARRAY_SIZE in lieu of explicit + array size calculation. + +2002-06-20 Kriang Lerdsuwanakij + + PR c++/6892 + * pt.c (tsubst_expr): Handle FILE_STMT. + +2002-06-20 Kriang Lerdsuwanakij + + PR c++/6723 + * pt.c (lookup_template_class): Don't build complete argument of + BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template + argument. + +2002-06-19 Akim Demaille + + * parse.y (TYPENAME): Rename as tTYPENAME to avoid the clash with + decl.h's TYPENAME. + * spew.c, lex.c: Adjust. + * parse.y (explicit_instantiation): Add empty action to override + the default $$ = $1 where it introduces a type clash. + +2002-06-14 Jason Merrill + + * semantics.c (begin_for_stmt): Push the 'for' scope before + adding the FOR_STMT. + + C++ ABI changes. + * class.c (build_base_field): Set DECL_PACKED. + (layout_class_type): Don't use tail padding of PODs. + * mangle.c (write_unqualified_name): Fix template conversion op + mangling. + +2002-06-16 Richard Henderson + + PR opt/6793 + * tree.c (cp_cannot_inline_tree_fn): Don't short-circuit test + after template instantiation. + +2002-06-16 Richard Henderson + + * cp-tree.h, decl2.c (flag_ms_extensions): Move to c-common. + +2002-06-15 Gabriel Dos Reis + + * cp-tree.h (compiler_error): Remove declaration. + * lex.c (compiler_error): Remove definition. + +2002-06-14 Steve Ellcey + + * g++spec.c (LIBUNWIND): New. + (lang_specific_driver): Add it if USE_UNWIND_EXCEPTIONS is set. + +2002-06-13 Jessica Han + + * class.c (build_vtable): Use TARGET_VTABLE_ENTRY_ALIGN. + (build_vtbl_initializer): Honor TARGET_VTABLE_DATA_ENTRY_DISTANCE. + (build_vbase_offset_vtbl_entries): Likewise. + * rtti.c (build_headof): Likewise. + (get_tinfo_decl_dynamic): Likewise. + (create_pseudo_type_info): Likewise. + +2002-06-12 Stan Shebs + + * mpw-config.in: Remove file, no longer used. + * mpw-make.sed: Ditto. + +2002-06-07 Zack Weinberg + + * decl2.c: Update call to cpp_handle_option. + +2002-06-07 H.J. Lu (hjl@gnu.org) + + * decl2.c (flag_use_cxa_atexit): Set to DEFAULT_USE_CXA_ATEXIT. + +2002-06-06 Gabriel Dos Reis + + * error.c (cp_error_at): Fix typo. + +2002-06-04 Gabriel Dos Reis + + * error.c (cp_diagnostic_starter): Adjust call. + (maybe_print_instantiation_context): Change prototype to take a + 'diagnostic_info *'. + (print_instantiation_full_context): Likewise. + (print_instantiation_partial_context): Likewise. + (cp_diagnostic_starter): Likewise. + (cp_diagnostic_finalizer): Likewise. + (cp_print_error_function): Likewise. + (cp_printer): Take a secondary parameter as a 'text_info *'. + Remove output_state savings. Adjust calls. + +2002-06-03 Geoffrey Keating + + * pt.c (inline_parm_levels): Mark for GC. + + * mangle.c (start_mangling): Allocate G.substitutions here... + (init_mangle): ... rather than here. + (finish_mangling): Clear the varray pointer when done with it. + * spew.c (yylexstring): Don't use VARRAY_FREE. + * search.c (bfs_walk): Don't use VARRAY_FREE. + * decl2.c (pending_statics): Use gengtype to mark. + (deferred_fns): Likewise. + (ssdf_decls): Likewise. + (init_decl2): Delete. + * decl.c (pop_from_top_level): Don't use VARRAY_FREE. + (cxx_init_decl_processing): Don't call init_decl2. + (cxx_pop_function_context): Don't use VARRAY_FREE. + * cp-tree.h (struct saved_scope): No need for special marking + of varrays. + (struct language_function): Likewise. + (local_classes): Use gengtype to mark. + (init_decl2): Delete prototype. + * class.c (init_class_processing): Don't use + ggc_add_tree_varray_root. + (build_vtbl_initializer): Don't use VARRAY_FREE. + + * decl.c (typename_compare): Don't use same_type_p. + + * decl.c: Include hashtab.h instead of hash.h. + (typename_hash): Update to use htab_h. + (typename_compare): Likewise. + (typename_htab): Use gengtype to mark. + (build_typename_type): Update to use htab_h. + * Make-lang.in (cp/decl.o): Use HASHTAB_H instead of hash.h. + + * Make-lang.in (gt-cp-tree.h): New rule. + (cp/tree.o): Depend on gt-cp-tree.h. + * config-lang.in (gtfiles): Add cp/tree.c. + * tree.c: Include gt-cp-tree.h. + (list_hash_table): Use gengtype to mark. + (init_tree): Use gengtype to mark trees. + + * Make-lang.in (cp/decl.o): Add debug.h dependency. + * call.c (struct z_candidate): Use gengtype. + (USER_CONV_CAND): Use WRAPPER_ZC. + (convert_class_to_reference): Use build_zc_wrapper. + (build_type_conversion_1): Likewise. + (build_over_call): Use WRAPPER_ZC. + (add_warning): Use build_zc_wrapper. + * cp-lang.c (LANG_HOOKS_MARK_TREE): Delete. + * cp-tree.h (struct lang_identifier): Use gengtype. + (struct template_parm_index_s): Likewise. + (struct ptrmem_cst): Likewise. + (struct tree_binding): Likewise. + (struct tree_overload): Likewise. + (struct tree_srcloc): Likewise. + (struct tree_wrapper): Likewise. Also modify to have a pointer + to struct z_candidate rather than void. + (enum cp_tree_node_structure_enum): New. + (union lang_tree_node): New. + (cxx_mark_tree): Delete prototype. + (cp_tree_node_structure): New prototype. + (build_ptr_wrapper): Delete prototype. + (build_int_wrapper): Delete prototype. + (build_zc_wrapper): New prototype. + * decl.c: Include debug.h + (cxx_mark_tree): Delete. + (cp_tree_node_structure): New. + * tree.c (build_ptr_wrapper): Delete. + (build_int_wrapper): Delete. + (build_zc_wrapper): New. + + * cp-tree.h [! ENABLE_TREE_CHECKING] (LANG_TYPE_PTRMEM_CHECK): + Correct typo. Patch from k_fukui@highway.ne.jp. + + * semantics.c (current_stmt_tree): Update for change to + struct language_function. + (finish_mem_initializers): Likewise. + * decl.c (cxx_init_decl_processing): Don't set mark_lang_status. + * cp-tree.h (struct language_function): Rename from + cp_language_function. Change all uses. + (cp_function_chain): Don't need to cast. + + * class.c (duplicate_tag_error): Reset discriminator. + (check_bases_and_members): Update for data structure changes. + * cp-tree.h (struct lang_id2): Use gengtype. + (flagged_type_tree): Likewise. + (SET_LANG_ID): Use GGC on struct lang_id2. + (struct cp_language_function): Use gengtype. Remove field + 'x_vcalls_possible_p'. + (current_vcalls_possible_p): Delete. + (struct lang_type_header): New. + (struct lang_type_class): Rename from struct lang_type. Include + struct lang_type_header. + (struct lang_type_ptrmem): New. + (struct lang_type): New. + (LANG_TYPE_CLASS_CHECK): New. Use it in all the appropriate macros. + (LANG_TYPE_PTRMEM_CHECK): New. Use it in all the appropriate macros. + (TYPE_SET_PTRMEMFUNC_TYPE): Set discriminator, update for changes. + (struct lang_decl_flags): Use gengtype. Add discriminators. + (struct lang_decl): Use gengtype. Add and use discriminators. + Update the macros that reference moved fields. + (LANG_DECL_U2_CHECK): New function. Use it when appropriate. + (SET_DECL_THUNK_P): Set discriminator too. + (clear_inline_text_obstack): Delete prototype. + (finish_inline_definitions): Delete prototype. + (mark_pending_inlines): Delete prototype. + (lang_check_failed): New prototype. + * decl.c (struct named_label_use_list): Use gengtype. + (struct named_label_list): Likewise. + (mark_binding_level): Delete. + (mark_named_label_lists): Delete. + (push_local_name): Set discriminator on DECL_LANG_SPECIFIC. + (cxx_init_decl_processing): Use generated marker routine. + (begin_destructor_body): Delete dead set to + current_vcalls_possible_p. + (mark_lang_function): Delete. + (mark_cp_function_context): Delete. + (lang_mark_tree): Use generated marker routines. + * decl2.c (start_objects): Set discriminator when setting + GLOBAL_INIT_PRIORITY. + * lex.c (retrofit_lang_decl): Set discriminators. + (copy_lang_type): Update for changes to lang_type structure. + (cp_make_lang_type): Set discriminator. + * parse.y: Use gengtype on YYLVAL. Don't use dots in identifiers. + * search.c: Include ggc.h. + * semantics.c (anon_aggr_type_p): Use the macro, don't hand-code it. + (finish_inline_definitions): Delete. + * spew.c (struct token): Use gengtype. + (struct token_chunk): New. + (struct unparsed_text): Use gengtype. Store tokens in chunks. + (struct feed): Use gengtype. + (feed_obstack): Delete. + (feed): Mark as GC root. + (pending_inlines): Mark as GC root. + (pending_inlines_tail): Likewise. + (processing_these_inlines): Likewise. + (token_obstack): Make static. + (first_token): Likewise. + (init_spew): Don't initialize deleted things; use gengtype for roots. + (clear_inline_text_obstack): Delete. + (feed_input): Use GC for struct feed. Update for changes to + struct unparsed_text. + (mark_pending_inlines): Delete. + (next_token): Rename from add_token. Change all callers. Update + for changes to struct unparsed_text. + (space_for_token): New. + (remove_last_token): New. + (alloc_unparsed_text): New. + (snarf_block): Take an unparsed_text. Update for changes to struct + unparsed_text. + (snarf_method): Update for changes to struct unparsed_text. + (snarf_defarg): Update for changes to struct unparsed_text. + * tree.c (lang_check_failed): New. + + * Make-lang.in (gt-cp-call.h gt-cp-decl2.h gt-cp-parse.h + gt-cp-pt.h gt-cp-repo.h gt-cp-spew.h): New rules. + (cp/spew.o): Add dependency on gt-.h. + (cp/decl2.o): Add dependency on gt-.h. + (cp/call.o): Add dependency on gt-.h. + (cp/pt.o): Add dependency on gt-.h. + (cp/repo.o): Add dependency on gt-.h. + (cp/parse.o): Add dependency on gt-.h. + * call.c: Use gengtype for roots. + * config-lang.in (gtfiles): Add cp-tree.h decl.h lex.h call.c + decl2.c parse.y pt.c repo.c spew.c. + * cp-tree.h: Use gengtype for roots. + (struct saved_scope): Use GGC, gengtype. + (cp_parse_init): Delete prototype. + (init_pt): Delete prototype. + * decl.c: Use gengtype for roots. + (mark_saved_scope): Delete. + (cxx_init_decl_processing): Don't call deleted initilisation + routines. + (signed_size_zero_node): Delete, unused. + * decl.h: Use gengtype for roots. + * decl2.c: Use gengtype for roots. + * lex.h: Use gengtype for roots. + * parse.y: Use gengtype for roots. + (cp_parse_init): Delete. + * pt.c: Use gengtype for roots. + (init_pt): Delete. + * repo.c: Use gengtype for roots. + * spew.c: Use gengtype for roots. + + * Make-lang.in: Allow for filename changes. Add gtype-cp.h. + (cp/decl.o): Add dependency on gtype-cp.h. + * decl.c: Remove use of add_deletable_root, use GTY marker instead. + Include gtype-cp.h. Allow for filename changes. + + * Make-lang.in (cp/gt-decl.h): Generate using gengtype. + (cp/decl.o): Add cp/gt-decl.h dependency. + * config-lang.in (gtfiles): New. + * tree.h: Rename struct binding_level to struct cp_binding_level. + * decl.c: Rename struct binding_level to struct cp_binding_level. + Include cp/gt-decl.h. + (struct cp_binding_level): Use gengtype. + (make_binding_level): Use GGC on struct cp_binding_level. + (mark_binding_level): Use gt_ggc_m_cp_binding_level. + (cxx_init_decl_processing): Mark free_binding_level as + deletable. + + * decl.c (mark_cp_function_context): Update calling sequence. + + * decl.c (start_function): Don't free 'struct + cp_language_function'. + (pop_cp_function_context): Likewise. + (save_function_data): Allocate it using GC. + * semantics.c (genrtl_start_function): Don't free 'struct + cp_language_function'. + +2002-05-31 Matthew Woodcraft + + * lang-specs.h: Use cpp_debug_options. + +2002-05-28 Zack Weinberg + + * mangle.c, tree.c: Include real.h. + * Make-lang.in: Update dependency lists. + +2002-05-25 Neil Booth + + * lex.c: Don't include c-lex.h. + * parse.y, spew.c: Don't include c-lex.h; include c-pragma.h. + +2002-05-23 Neil Booth + + * spew.c (yyungetc, snarf_block): Remove indent_level handling. + +2002-05-22 Richard Henderson + + * decl.c (obscure_complex_init): Check for VAR_DECL + before using DECL_THREAD_LOCAL. + +2002-05-22 Richard Henderson + + * decl.c (check_tag_decl): Handle RID_THREAD. + (obscure_complex_init): Reject run-time init of tls. + (grokvardecl, grokdeclarator): Handle RID_THREAD. + * lex.c (reswords): Add __thread. + (rid_to_yy): Map RID_THREAD to SCSPEC. + +2002-05-22 Neil Booth + + * cp-lang.c (LANG_HOOKS_POST_OPTIONS): Use c_common_post_options. + * cp-tree.h (cxx_post_options): Kill. + * cp-lex.c (cxx_post_options): Kill. + +2002-05-21 Richard Henderson + + * lex.c (rid_to_yy): Add RID_THREAD. + +2002-05-21 Alexandre Oliva + + * init.c (build_vec_init): Test for trivial copy-assignment when + copy-assigning arrays. + +2002-05-20 Andreas Jaeger + + * init.c (build_default_init): Remove unused variable. + +2002-05-20 Alexandre Oliva + + * call.c (any_strictly_viable): New. + (build_new_op): Use it for COMPOUND_EXPR and ADDR_EXPRs. + +2002-05-19 Kriang Lerdsuwanakij + + * error.c (dump_type) [TYPEOF_TYPE]: Fix parenthesis printing. + +2002-05-19 Kriang Lerdsuwanakij + + PR c++/186, DR 259 + * pt.c (do_decl_instantiation): Don't complain explicit + instantiation after explicit specialization. + (do_type_instantiation): Likewise. + +2002-05-19 Alexandre Oliva + + * cp-tree.h (complete_type_or_diagnostic): Changed prototype, + renamed from... + (complete_type_or_else): ... this. Redefined as macro. + (cxx_incomplete_type_diagnostic): Declare. + (cxx_incomplete_type_error): Define as macro. + * init.c (build_delete): Warn about incomplete types other than + void, and use the built-in operator delete for them. + * typeck.c (complete_type_or_diagnostic): Renamed from + complete_type_or_else. Added warn_only argument, passed to... + * typeck2.c (cxx_incomplete_type_diagnostic): ... this. Print + warnings or errors depending on new warn_only argument. Renamed + from... + (cxx_incomplete_type_error): ... this. New implementation in + terms of cxx_incomplete_type_diagnostic. + +2002-05-18 Jason Merrill + + PR c++/6611 + * decl2.c (import_export_decl): If we clear + DECL_NOT_REALLY_EXTERN, make sure DECL_EXTERNAL is set. + +2002-05-15 Kriang Lerdsuwanakij + + PR c++/6620 + * pt.c (verify_class_unification): Don't check if PARM is template + parameter dependent. Simplify. + (unify) [TEMPLATE_PARM_INDEX]: Handle when ARG is a template + parameter dependent expression. + +2002-05-14 Jason Merrill + + * rtti.c (get_tinfo_decl): Don't call comdat_linkage. + Do set DECL_COMDAT. + (synthesize_tinfo_var): Take the public decl. + (create_real_tinfo_var): Likewise. Check DECL_COMDAT. + (emit_tinfo_decl): Adjust. Call import_export_decl. + * decl2.c (import_export_decl): Simplify tinfo decl handling. + +2002-05-14 Alexandre Oliva + + * cp-tree.h (struct lang_type): Added non_zero_init. + (CLASSTYPE_NON_ZERO_INIT_P): New macro. + (zero_init_p, force_store_init_value, build_forced_zero_init): Declare. + * class.c (check_field_decls): Test non_zero_init. + * cvt.c (convert_to_pointer_force): Use cp_convert_to_pointer for + zero-to-NULL conversions. + * decl.c (obscure_complex_init): Don't reset DECL_INITIAL of a + type that needs zero-initialization without zeros. + (check_initializer_decl): Compute zero-initializer for types + that require a non-trivial one. + * init.c (build_forced_zero_init): New function. + (build_default_init): Use it. + * tree.c (zero_init_p): New function. + * typeck2.c (force_store_init_value): New function. + (process_init_constructor): Create non-trivial zero-initializers + for array members and class fields. + +2002-05-14 Neil Booth + + * lang-specs.h: Remove redundant -lang-c++. + +2002-05-13 Jason Merrill + + * class.c (build_vtbl_ref_1): Use fixed_type_or_null. + (fixed_type_or_null): See through reference vars. + (build_base_path): Vtable contents are constant. + * typeck.c (get_member_function_from_ptrfunc): Likewise. + +2002-05-12 Jason Merrill + + * cp-lang.c (ok_to_generate_alias_set_for_type): Backend-created + structs are safe. + +2002-05-09 Neil Booth + + * cp-tree.h (flag_ansi): Remove. + * decl2.c (flag_ansi): Remove. + (cxx_decode_option): Set flag_iso and flag_undef. + +2002-05-09 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Reorganize. + Use subtraction rather than a bitmask to get the index. + * cvt.c (cp_convert_to_pointer): Bail on an error_mark_node. + + * pt.c (tsubst_expr) [ASM_STMT]: Copy ASM_INPUT_P. + +2002-05-07 Neil Booth + + * Make-lang.in (decl2.o): Update. + * cp-tree.h (warn_multichar): Remove. + * decl2.c: Include c-common.h. + (warn_multichar): Remove. + +2002-05-03 Jason Merrill + + * tree.c (build_cplus_array_type): Only const and volatile get + special handling. + + * decl.c (BOOL_TYPE_SIZE): Move default to defaults.h. + +2002-04-30 Mark Mitchell + + ABI change, returning simple classes from functions. + * class.c (finish_struct_bits): Only mark TREE_ADDRESSABLE if + TYPE_HAS_TRIVIAL_INIT_REF is false or + TYPE_HAS_NONTRIVIAL_DESTRUCTOR is true. + +2002-04-30 Jason Merrill + + PR debug/6436 + * decl.c (grokdeclarator): Don't override TYPE_NAME of an + anonymous class with a typedef if there are attributes. + +2002-04-29 Paul Eggert + + * parse.y (nomods_initdcl0): Replace $3 with $$. + +2002-04-29 Jakub Jelinek + + PR c++/6477 + * decl.c (follow_tag_typedef): Check if TYPE_NAME (original) is + non-NULL first. + +2002-04-29 Mark Mitchell + + PR c++/6492 + * pt.c (tsubst_friend_class): If the friend has an explicit scope, + enter that scope before name lookup. + + PR c++/6486 + * method.c (do_build_copy_constructor): Avoid building + cv-qualified reference types. + +2002-04-29 Nathan Sidwell + + PR c++/5719 + * decl.c (grok_op_properties): Assignment ops don't have to return + by value. operator% should. + +2002-04-28 Franz Sirl + + PR c/6343 + * decl.c (duplicate_decls): Call merge_weak. + +2002-04-26 Richard Henderson + + * parse.y (malloced_yyss, malloced_yyvs): New. + (yyoverflow): Re-add. Set them. + (free_parser_stacks): New. + +2002-04-26 Mark Mitchell + + PR c++/6497 + * method.c (do_build_assign_ref): Pass a derivation to + build_method_call when calling base class assignment operators. + +2002-04-26 Richard Henderson + + * parse.y (yyoverflow): Revert. + +2002-04-26 Richard Henderson + + PR c/3581 + * parse.y (string): Remove. Update all uses to use STRING + instead, and not call combine_strings. + * rtti.c (tinfo_name): Use fix_string_type. + * semantics.c (finish_asm_stmt): Don't call combine_strings. + * spew.c (yylexstring): New. + (read_token): Use it. + +2002-04-25 Richard Henderson + + PR c/2161 + * parse.y (yyoverflow): New. + +2002-04-25 Jason Merrill + + PR c++/5607 + * search.c (check_final_overrider): No longer static. + * class.c (update_vtable_entry_for_fn): Call it. + * cp-tree.h: Adjust. + +2002-04-25 Neil Booth + + * cp-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove. + * cp-tree.h (cxx_set_yydebug): Die. + * lex.c (YYDEBUG): Get from c-lex.h. + (cxx_set_yydebug): Remove. + * parse.y: Include c-lex.h. + (YYDEBUG): Get from c-lex.h. + +2002-04-24 Mark Mitchell + + PR c++/6438. + * cvt.c (convert_to_void): Don't unconditionally make COND_EXPRs + void. + +2002-04-24 Neil Booth + + * cp-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, + LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): + Redefine. + * cp-tree.h (cp_attribute_table): Rename. + * decl.c (lang_attribute_table): Remove declaration. + (cxx_init_decl_processing): Don't set it. + * tree.c (cp_attribute_table): Rename. + +2002-04-24 Jason Merrill + + PR c++/6331 + * method.c (do_build_copy_constructor): Use cp_build_qualified_type. + * typeck.c (build_modify_expr): Allow arrays to differ in cv-quals. + The pedwarn for array assignment is now unconditional. + * tree.c (build_cplus_array_type_1): Still process simple array types + normally in templates. + + PR c++/6395 + * decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i + stuff for comdats. + +2002-04-23 Jakub Jelinek + + * parse.y (check_class_key): Allow KEY to be union/enum/struct/class + node with attributes. + +2002-2-23 David O'Brien + + * g++spec.c (MATH_LIBRARY_PROFILE, LIBSTDCXX_PROFILE): Add. + Use MATH_LIBRARY_PROFILE and LIBSTDCXX_PROFILE if profile flag given. + +2002-04-23 Mark Mitchell + + PR c++/6256: + * pt.c (tsubst_friend_class): Handle templates with explicit + nested names. + + PR c++/6331: + * typeck.c (merge_types): Remember the cv-qualification of pointer + types when merging them. + +2002-04-20 Neil Booth + + * cp-lang.c (LANG_HOOKS_FUNCTION_INIT, + LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_MARK): Redefine. + * cp-tree.h (cxx_push_function_context, cxx_pop_function_context, + cxx_mark_function_context): New. + * decl.c (push_cp_function_context, pop_cp_function_context, + mark_cp_function_context): Rename for consistency. + (cxx_init_decl_processing): Don't set old hooks. + +2002-04-19 Neil Booth + + * call.c (convert_type_from_ellipsis): Rename, update. + * cp-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine. + * cp-tree.h (convert_type_from_ellipsis): Rename. + * decl.c (cxx_init_decl_processing): Don't set hook. + +2002-04-18 Neil Booth + + * call.c (build_new_method_call): Update. + * cp-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine. + * cp-tree.h (cxx_incomplete_type_error): New. + * decl.c (grokdeclarator, grokparms): Update. + * decl2.c (check_classfn): Update. + * pt.c (tsubst): Update. + * typeck.c (complete_type_or_else, expr_sizeof, + decay_conversion): Update. + * typeck2.c (incomplete_type_error): Rename. + (add_exception_specifier): Update. + +2002-04-18 Jason Merrill + + PR c++/5658 + * search.c (setup_class_bindings): A class template qualifies as a + type binding. + +2002-04-17 Jakub Jelinek + + PR c++/6316 + * decl2.c (finish_file): Clear DECL_EXTERNAL in a separate loop + before expanding. + +2002-04-16 Mark Mitchell + + * init.c (begin_init_stmts): Remove commented out code. + (finish_init_stmts): Set STMT_EXPR_NO_SCOPE. + * semantics.c (begin_gobal_stmt_expr): Adjust call to + expand_start_stmt_expr. + +2002-04-15 Mark Mitchell + + * decl.c (register_dtor_fn): Pass the address of dso_handle, not + dso_handle itself, to __cxa_atexit. + +2002-04-15 Gabriel Dos Reis + + * error.c (cxx_print_error_function): Adjust call to macros. + +2002-04-14 Jakub Jelinek + + * class.c (layout_virtual_bases): Do all dsize computation on trees. + +2002-04-14 Jason Merrill + + * typeck.c (get_member_function_from_ptrfunc): Don't do + gratuitious division and multiplication on + ptrmemfunc_vbit_in_delta targets. + +2002-04-12 Mark Mitchell + + PR c++/5373. + * semantics.c (finish_expr_stmt): Remember the type of the + expression before any conversions are performed. + +2002-04-12 Mark Mitchell + + PR c++/5189. + * call.c (add_template_candidate_real): Do not treat member + templates as copy constructors. + +2002-04-12 Mark Mitchell + + * decl.c (duplicate_decls): Do not copy the RTL for a variable + declaration if the old variable had an incomplete type and the new + variable does not. + (complete_vars): Do not call layout_decl for completed variables. + +2002-04-12 Richard Sandiford + + * decl.c (duplicate_decls): Don't try to unify an implicit typedef + with an explicit one. + (follow_tag_typedef): New. + (lookup_tag): Use it to extract the tag of an explicit typedef. + (xref_tag): Likewise. + +2002-04-11 Andrew Haley + + * typeck.c (type_after_usual_arithmetic_conversions): + If two types have the same variant, return immediately. + When two floating-point operands are the same precision: + convert to float if one of the operands is float; + if neither operand is one of the standard types, return the type + of the first operand. + +2002-04-10 Nathan Sidwell + + PR c++/5507 + * decl.c (make_typename_type): Remove implicit typenameness. + +2002-04-09 Jason Merrill + + PR optimization/6189 + * semantics.c (genrtl_start_function): Don't free + DECL_SAVED_FUNCTION_DATA for inline functions. + + * init.c (build_member_call): For now, don't convert to + intermediate base if it would cause an error. + +2002-04-08 Paolo Carlini + + * parse.y (namespace_qualifier, maybe_identifier, + begin_explicit_instantiation, end_explicit_instantiation, + apparent_template_type, .finish_template_type, + do_id, maybe_init, defarg_again, component_decl_1): + Add ending ';', in accordance with POSIX. + +2002-04-06 Mark Mitchell + + PR c++/5571 + * class.c (layout_class_type): Remember incomplete static + variables. + (finish_struct_1): Call complete_vars, not + hack_incomplete_structures. + * cp-tree.h (hack_incomplete_structures): Rename to ... + (complete_vars): ... this. + (struct saved_scope): Remove incomplete. + (namespace_scope_incomplete): Remove. + * decl.c (struct binding_level): Remove incomplete. + (incomplete_vars): New variable. + (mark_binding_level): Don't mark incomplete. + (print_binding_level): Don't print it. + (mark_saved_scope): Don't mark incomplete. + (pushdecl): Use maybe_register_incopmlete_var. + (cxx_init_decl_processing): Register incomplete_vars for GC. + (start_decl_1): Clarify error message. + (hack_incomplete_vars): Remove. + (maybe_register_incomplete_var): New function. + (complete_vars): Likewise. + +2002-04-06 Jason Merrill + + PR c++/4934 + * error.c (dump_expr) [CONVERT_EXPR]: Make sure TREE_TYPE (t) is + set before checking it. + + PR c++/525 + * init.c (build_member_call): Use build_scoped_ref. + (resolve_offset_ref): Likewise. + * call.c (build_scoped_method_call): Likewise. + * tree.c (maybe_dummy_object): Kludge around current_class_type being + wrong. + * typeck2.c (build_scoped_ref): Return the binfo via binfo_p parm. + * cp-tree.h: Adjust. + + * init.c (push_base_cleanups): Just use build_scoped_method_call. + + PR c++/6179 + * method.c (implicitly_declare_fn): Pass unqualified type to + synthesize_exception_spec. + +2002-04-04 Neil Booth + + * cp-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. + * cvt.c: Update comment. + * init.c (expand_cleanup_for_base): Update. + * semantics.c (finish_parenthesized_expr): Update. + * typeck.c (cp_truthvalue_conversion): Update. + +2002-04-04 Jason Merrill + + * semantics.c (finish_eh_cleanup): New fn. + * cp-tree.h: Add prototype. + * init.c (perform_member_init, expand_cleanup_for_base): Use + finish_eh_cleanup. + * cp-tree.def (SUBOBJECT, CTOR_STMT): Remove. + * cp-tree.h: Remove references. + * decl.c (begin_constructor_body, end_constructor_body): Likewise. + * dump.c (cp_dump_tree): Likewise. + * pt.c (tsubst_expr): Likewise. + * semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove. + (cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT. + * tree.c (cp_statement_code_p): Likewise. + + * init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup. + + PR c++/5636 + * semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on + cleanup for nrv. + + PR c++/5104 + * typeck.c (comptypes) [FUNCTION_TYPE]: Don't compare exception + specifiers. + [METHOD_TYPE]: Use same code as FUNCTION_TYPE. + +2002-04-03 Richard Henderson + + * cp-lang.c (cxx_warn_unused_global_decl): New. + (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. + +2002-04-03 Neil Booth + + * cp-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Redefine. + * tree.c (init_tree): Don't set hook. + +2002-04-03 Roger Sayle + + PR c++/5998: + * decl.c (duplicate_decls): Don't mess with assembler names when + redeclaring builtin functions as static. + +2002-04-01 Neil Booth + + * call.c (build_addr_func): Update. + * class.c (resolve_address_of_overloaded_function): Update. + * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. + * cp-tree.h (cxx_mark_addressable): New. + * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update. + * decl2.c (build_cleanup): Update. + * except.c (build_throw): Update. + * init.c (resolve_offset_ref): Update. + * pt.c (convert_nontype_argument): Update. + * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update. + * typeck.c (decay_conversion, build_array_ref, build_unary_op, + unary_complex_lvalue): Update. + (mark_addressable): Rename. + +2002-04-01 Roger Sayle + + PR c++/5998: + * decl.c (duplicate_decls): Overwrite the RTL when (and only + when) overwriting a built-in function. Don't use COPY_DECL_RTL, + but follow the SET_DECL_RTL idiom used elsewhere in the function. + +2002-04-01 Neil Booth + + * cp-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, + LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. + * decl.c (grokdeclarator): Update. + * mangle.c (write_integer_cst): Update. + * typeck.c (build_binary_op): Update. + +2002-03-31 Neil Booth + + * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine. + * lex.c (cxx_init): Don't set hook. + +2002-03-31 Neil Booth + + * Make-lang.in (error.o): Update. + * cp-lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine. + * cp-tree.h (struct diagnostic_context): Predeclare. + (cxx_print_error_function): New. + * error.c: Include langhooks-def.h. + (lang_print_error_function): Rename. Update. + (init_error): Don't set hook. + +2002-03-29 Neil Booth + + * cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): + Redefine. + * cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks. + * decl.c (finish_enum): Similarly. + * error.c (dump_type): Similarly. + * lex.c (cxx_init): Similarly. + * mangle.c (write_builtin_type): Similarly. + * typeck.c (comptypes): Similarly. + +2002-03-28 Roger Sayle + + PR c++/5998: + * decl.c (cxx_init_decl_processing): Re-enable built-in functions + in the g++ front-end. + (duplicate_decl): Allow redefinition of anticipated built-ins. + Fix inlining problem by over-writing the old DECL_RTL. + (lookup_namespace_name): Fail to find an identifier in the + specified namespace if its still anticipated. + (builtin_function_1): New function split out from builtin_function + to create a builtin in the current namespace with given context. + (builtin_function): Call builtin_function_1 to define the + appropriate builtins in both the std and global namespaces. + (select_decl): Don't test for anticipated decls here. + (unqualified_namespace_lookup): Instead ignore them whilst + searching through scopes and namespaces. + * decl2.c (do_nonmember_using_decl): If a using declaration + specifies an anticipated built-in function, mark it as no longer + anticipated in that scope. + (ambiguous_decl): Avoid resolving to an anticipated decl. + * lex.c (do_scoped_id): Fail to find an identifier in the global + namespace if its still anticipated. + +2002-03-29 Neil Booth + + * cp-lang.c (LANG_HOOKS_MAKE_TYPE): Redefine. + * cp-tree.h (cp_make_lang_type): Rename. + * lex.c (cp_make_lang_type): Rename. + (make_aggr_type): Update. + * tree.c (init_tree): Don't set make_lang_type_fn. + +2002-03-29 Jakub Jelinek + + PR c++/6073 + * class.c (finish_struct_1): Update static field's DECL_MODE even + if its type is a variant of t. + +2002-03-27 Neil Booth + + * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine. + * cp-tree.h (cxx_insert_default_attributes): New. + * decl.c (insert_default_attributes): Rename. + +2002-03-27 Mark Mitchell + + PR c++/4884 + * call.c (build_op_delete_call): Allow for the fact the placement + may be a COMPOUND_EXPR. + +2002-03-27 Neil Booth + + * cp-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine. + * cp-tree.h (init_cplus_expand): Remove. + (cxx_expand_expr): New. + * expr.c (cplus_expand_expr): Rename cxx_expand_expr, + fix prototype. + (init_cplus_expand): Remove. + * lex.c (cxx_init): Don't call init_cplus_expand. + +2002-03-26 Mark Mitchell + + PR c++/4884. + * init.c (build_new_1): Allow for the fact the result of + build_function_call may be a COMPOUND_EXPR. + +2002-03-26 Nathan Sidwell + + PR c++/5682 + * cp-tree.h (BINFO_PRIMARY_P): Explain meaning better. + (dfs_skip_nonprimary_vbases_unmarkedp): Remove. + (dfs_skip_nonprimary_vbases_markedp): Remove. + * search.c (get_shared_vbase_if_not_primary): Remove. + (dfs_skip_nonprimary_vbases_unmarkedp): Remove. + (dfs_skip_nonprimary_vbases_markedp): Remove. + (dfs_unmarked_real_bases_queue_p): Just get the canonical binfo. + (dfs_marked_real_bases_queue_p): Likewise. + +2002-03-26 Neil Booth + + * cp-lang.c (LANG_HOOKS_MARK_TREE): Redefine. + * cp-tree.h (cxx_mark_tree): New. + * decl.c (lang_mark_tree): Rename cxx_mark_tree. + +2002-03-25 Neil Booth + + * cp-tree.h (cxx_maybe_build_cleanup): New. + * decl.c (destroy_local_var, hack_incomplete_structures): Update. + (maybe_build_cleanup): Rename cxx_maybe_build_cleanup. + * tree.c (build_target_expr): Update. + * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP): Redefine. + +2002-03-24 Neil Booth + + * decl2.c (cxx_decode_option): Handle -E. + * lang-specs.h (default_compilers): Preprocess with cc1plus. + * lex.c (cxx_init): Exit quickly if c_common_init returns NULL. + +2002-03-23 Jakub Jelinek + + PR c++/6037 + * decl.c (start_enum): Don't set TREE_ADDRESSABLE on TREE_LIST node. + +2002-03-23 Gabriel Dos Reis + + * error.c (dump_type): Be careful about implicit typenames. + +2002-03-21 Gabriel Dos Reis + + PR C++/3656 + * semantics.c (finish_base_specifier): Handle erronous base + classes. + +2002-03-22 Zack Weinberg + + * error.c: Always use REAL_VALUE_TO_DECIMAL; don't test + REAL_IS_NOT_DOUBLE. + +2002-03-22 Jeff Knaggs + + * typeck.c (get_member_function_from_ptrfunc): Scale idx down to + an index into the vtable_entry array regardless of + TARGET_PTRMEMFUNC_VBIT_LOCATION. + +2002-03-21 Aldy Hernandez + + * tree.c (cp_cannot_inline_tree_fn): Same. + +2002-03-21 Neil Booth + + * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, + insert_block, getdecls, global_bindings_p): New. + +2002-03-20 Nathan Sidwell + + PR c++/4361 + * mangle.c (struct globals) Add internal_mangling_p member. + (write_template_param): Do internal mangling, if needed. + (mangle_conv_op_name_for_type): Request internal mangling. + +2002-03-20 Jason Merrill + + PR c++/2136 + * init.c (build_delete): Check access for a member op delete here. + * decl2.c (delete_sanity): Not here. + +2002-03-19 Jason Merrill + + PR c++/5118 + * class.c (get_vfield_name): Use the constructor_name. + +2002-03-20 Neil Booth + + * cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine. + * cp-tree.h (lang_printable_name): Rename. + * error.c (lang_decl_name): Use new hook. + * lex.c (cxx_init): Remove old hook. + * pt.c (tsubst_decl): Use new hook. + * tree.c (lang_printable_name): Rename. + +2002-03-18 Eric Botcazou + + PR c++/3882 + * pt.c (tsubst_decl): Move __PRETTY_FUNCTION__ handling... + (tsubst_expr) [DECL_STMT]: ...here. And substitute the initializer + only after recording the declaration. + +2002-03-18 Jason Merrill + + PR c++/2039 + * init.c (resolve_offset_ref): Hand off to build_component_ref. + + PR c++/4222, c++/5995 + * call.c (build_over_call): Fix empty class logic. + + PR c++/3870 + * cp-tree.h (struct saved_scope): Add last_parms field. + * decl.c (maybe_push_to_top_level): Save last_function_parms. + (pop_from_top_level): Restore it. + + PR c++/4377 + * mangle.c (write_expression): Strip NOP_EXPRs sooner. Also strip + NON_LVALUE_EXPRs. + + PR c++/4003 + * pt.c (tsubst_friend_function): Use decl_namespace_context. + + PR c++/3948 -- C++ ABI change, followup to 2001-12-18 patch. + * class.c (finish_struct_bits): Also set TREE_ADDRESSABLE for a + type with a nontrivial destructor. + +2002-03-17 Jason Merrill + + PR c++/4460 + * class.c (build_base_path): Virtual base layout is fixed in + in-charge [cd]tors. + +2002-03-17 Neil Booth + + * cp-lang.c (LANG_HOOKS_PARSE_FILE): Redefine. + * parse.y (yyparse): Remove macro. + +2002-03-17 Jason Merrill + + PR c++/5757 + * init.c (build_new_1): Pass the right pointer to op delete. + +2002-03-16 Nathan Sidwell + + PR c++/4361 + * cp-tree.h (CLASSTYPE_METHOD_VEC): Document where templated + conversion operators go. + (struct lang_decl_flags): Add template_conv_p and unused + bitfields. + (DECL_TEMPLATE_CONV_FN_P): New macro. + * call.c (build_user_type_conversion_1): Don't check second type + conversion of overload set first. + * class.c (add_method): Make sure templated conversion operators + all end up on slot 2. + * lex.c (do_identifier): A conversion operator token might be + satisfied by a templated conversion operator. + * pt.c (check_explicit_specialization): Use + CLASSTYPE_FIRST_CONVERSION_SLOT. + (template_parm_this_level_p): New function. + (push_template_decl_real): Determine DECL_TEMPLATE_CONV_FN_P. + * search.c (lookup_fnfields_1): Template conversions will be on + the first slot. + * typeck.c (build_component_ref): Preserve the type of an + conversion operator name on the overload type. + (build_x_function_call): Retrieve the conversion operator name. + +2002-03-15 Richard Henderson + + * init.c (build_new_1): Use size_binop instead of cp_build_binary_op. + +2002-03-15 Mark Mitchell + + * cp-tree.h (CLEANUP_DECL): Remove. + (CLEANUP_EXPR): Likewise. + * decl.c (destroy_local_var): Simplify. + (maybe_build_cleanup): Tidy. + * dump.c (cp_dump_tree): Remove handling of CLEANUP_STMT. + * semantics.c (cp_expand_stmt): Likewise. + * cp/tree.c (cp_statement_code_p): Likewise. + +2002-03-15 Jason Merrill + + PR c++/5857 + * decl.c (duplicate_decls): Use merge_types instead of common_type. + * typeck.c (common_type): Just hand off to + type_after_usual_arithmetic_conversions and + composite_pointer_type. + (merge_types): New fn. + (commonparms): Use it instead of common_type. + (type_after_usual_arithmetic_conversions): Also handle COMPLEX_TYPE. + (composite_pointer_type): Also handle attributes. + * cp-tree.h: Declare merge_types. + + * decl.c (make_rtl_for_nonlocal_decl): Also defer COMDAT + variables. + * decl2.c (maybe_make_one_only): Also mark the decl as needed. + +2002-03-14 Richard Henderson + + * decl.c: Include c-pragma.h. + (start_decl, start_function): Invoke maybe_apply_pragma_weak. + * Make-lang.in: Update dependencies. + +2002-03-14 Jakub Jelinek + + PR c++/5908 + * call.c (build_over_call): Set TREE_NO_UNUSED_WARNING too. + * cvt.c (convert_to_void): Preserve TREE_NO_UNUSED_WARNING. + +2002-03-12 Richard Sandiford + + * mangle.c (write_builtin_type): Handle 128-bit integers even if + they are not a standard integer type. + +2002-03-12 Richard Sandiford + + * cp-tree.h (init_init_processing): Remove declaration. + * init.c (BI_header_type, init_init_processing): Remove old ABI stuff. + * decl.c (cxx_init_decl_processing): Don't call init_init_processing. + +2002-03-12 Kaveh R. Ghazi + + * cp-lang.c (tree_code_type, tree_code_length, tree_code_name): + Define. + * decl.c (duplicate_decls): Use TREE_CODE_LENGTH, not + tree_code_length. + * lex.c (cplus_tree_code_type, cplus_tree_code_length, + cplus_tree_code_name): Delete. + (cxx_init): Don't call add_c_tree_codes, instead set + lang_unsafe_for_reeval. Don't try to copy into the various + tree_code arrays. + +2002-03-12 Nathan Sidwell + + PR c++/5659 + * decl.c (xref_tag): Don't set CLASSTYPE_DECLARED_CLASS here. + * decl2.c (handle_class_head): Set CLASSTYPE_DECLARED_CLASS for + definitions. + +2002-03-11 Nathan Sidwell + + Revert 2001-03-26 Nathan Sidwell , + DR209 is now not a defect. + * cp-tree.h (skip_type_access_control): Remove. + * decl.c (grokdeclarator): Do type access control for friend + declarations. + * semantics.c (decl_type_access_control): Don't reset + current_type_lookups. + (save_type_access_control): Always save the lookups. + (skip_type_access_control): Remove. + (finish_class_definition): Don't change type_lookups. + +2002-03-11 Nathan Sidwell + + Revert 2000-12-01 Nathan Sidwell , + It is incorrect. + * typeck.c (build_static_cast): Compare non-qualified types + with pointer to member conversions. + +2002-03-11 Dan Nicolaescu + Daniel Berlin + + * cp-lang.c (ok_to_generate_alias_set_for_type): New function. + (cxx_get_alias_set): Use it. + +2002-03-10 Kaveh R. Ghazi + + * cp-tree.h (stabilize_expr): Prototype. + +2002-03-08 Craig Rodrigues + + * cp-tree.h (CLEAR_BINFO_MARKED): Make both parts of + conditional return void. + +2002-03-08 Neil Booth + + * cp-lang.c (LANG_HOOKS_UNSAVE): Redefine. + * cp-tree.h (cxx_unsave): New. + * tree.c (cp_unsave): Rename cxx_unsave, update prototype. + (init_tree): Update. + +2002-03-03 Kaveh R. Ghazi + + * decl.c (cxx_init_decl_processing): Use ARRAY_SIZE in lieu of + explicit sizeof/sizeof. + * decl2.c (cxx_decode_option): Likewise. + * lex.c (init_reswords, REDUCE_LENGTH, TOKEN_LENGTH): Likewise. + +2002-03-02 Nathan Sidwell + + PR c++/775 + * decl.c (lookup_tag): Only reject enum/class mismatch, not + class/union mismatch. + * parse.y (check_class_key): New function. + (structsp): Call it. + +2002-03-01 Michael Matz + + * typeck.c (cp_pointer_int_sum): Complete inner type which is + used later by size_in_bytes(). + +2002-03-01 Phil Edwards + + * cp-tree.h: Require __GNUC__ to be #defined. + (build_init): Add missing prototype. + +2002-03-01 Jason Merrill + + * except.c: Don't include decl.h or obstack.h. Do include + tree-inline.h. + (build_throw): Destroy temporaries from the thrown + expression before calling __cxa_throw. Construct a thrown + temporary directly into the exception object. + (stabilize_throw_expr): New function. + (wrap_cleanups_r): New function. + * tree.c (stabilize_expr): New function. + * init.c (build_init): New function. + * Make-lang.in (cp/except.o): Adjust .h deps. + +2002-02-28 Jason Merrill + + * search.c (lookup_base_r): Don't clear is_non_public just because + we found a friendly scope. + + * decl.c (finish_function): Only warn about missing return + statement with -Wreturn-type. + +2002-02-28 Neil Booth + + * class.c (build_clone): Update. + * cp-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine. + * cp-tree.h (cxx_dup_lang_specific_decl): New. + * lex.c (copy_lang_decl): Rename cxx_dup_lang_specific_decl. + (copy_decl): Update. + * method.c (make_thunk): Update. + +2002-02-27 Zack Weinberg + + * decl2.c: Delete traditional-mode-related code copied from + the C front end but not used, or used only to permit the + compiler to link. + +2002-02-24 Craig Rodrigues + + PR c++/4093 + * cp-tree.h (SET_BINFO_MARKED): Cast false part of condition + to void. + +2002-02-22 Jakub Jelinek + + PR other/5746 + * semantics.c (finish_switch_cond): Don't call get_unwidened + if error_mark_node. + +2002-02-22 Nathan Sidwell + + PR c++/2645, DR 295 + * cp-tree.h (tsubst_flags_t): Add tf_ignore_bad_quals, + tf_keep_type_decl. + (make_typename_type): Use tsubst_flags_t. + * decl.c (make_typename_type): Adjust. Return non-artificial + TYPE_DECLs, if required. + (grokdeclarator): Simplify CVR qualification handling. Allow bad + qualifiers on typedef types. + * decl2.c (handle_class_head): Adjust make_typename_type call. + * parse.y (nested_name_specifier): Likewise. + (typename_sub0): Likewise. + (typename_sub1): Likewise. + * pt.c (convert_template_argument): Adjust make_typename_type + return value. + (tsubst): Adjust cp_build_qualified_type_real calls. + (check_cv_quals_for_unify): Cope with allowing bad qualifications + on template type parms. + (instantiate_decl): Recheck substitutions to give warnings on bad + qualifications. + * tree.c (cp_build_qualified_type_real): Use tf_allow_bad_quals. + +2002-02-21 Aldy Hernandez + + * cp/decl.c (duplicate_decls): Merge always_inline attribute. + + * cp/tree.c (cp_cannot_inline_tree_fn): Do not inline at -O0 + unless DECL_ALWAYS_INLINE. + +2002-02-20 Jakub Jelinek + + * typeck.c (cp_pointer_int_sum): Renamed from + pointer_int_sum, call pointer_int_sum. + +2002-02-20 Jakub Jelinek + + * decl.c (duplicate_decls): Return 0 if issued error about + redeclaration. + +2002-02-19 Jason Merrill + + ABI change: Mangle `void (A::*)() const' as + M1AKFvvE, not MK1AFvvE. + * mangle.c (write_function_type): Write cv-quals for member + function type here. + (write_pointer_to_member_type): Not here. + +2002-02-18 Jason Merrill + + * pt.c (do_type_instantiation): Don't pedwarn if in_system_header. + (do_decl_instantiation): Likewise. + +2002-02-17 Craig Rodrigues + + PR c++/5685 + * decl.c (duplicate_decls): Make warning unconditional + if duplicate default argument declarations are present. + +2002-02-17 Jakub Jelinek + + * typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit + shortening. + +2002-02-15 Nathan Sidwell + + * decl.c (grokdeclarator): Set typedef_decl for all TYPE_DECLs, + remove incorrect comment. Move #if 0'd code to common path. Use + IMPLICIT_TYPENAME_P. Simplify & reformat ARRAY_TYPE duplication. + +2002-02-13 Jason Merrill + + * decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns. + (finish_function): Don't warn if current_function_returns_null. + + * typeck2.c (digest_init): Do handle values of vector type. + + * typeck2.c (digest_init, process_init_constructor): Treat vectors + like arrays. + +2002-02-11 Jason Merrill + + * parse.y (reserved_declspecs): Don't handle attributes. + (reserved_typespecquals): Handle them here. + * Make-lang.in (parse.c): Adjust expected conflicts. + +2002-02-08 Jakub Jelinek + + * parse.y (primary, primary_no_id): Use compstmt_or_stmtexpr + instead of compstmt. + (compstmt_or_stmtexpr): Renamed from compstmt. + (compstmt): In addition to compstmt_or_stmtexpr clear last_expr_type. + +2002-02-07 Nathan Sidwell + + Rename instantiate_type_flags to tsubst_flags_t & expand use. + * cp-tree.h (instantiate_type_flags): Rename to ... + (tsubst_flags_t): ... here. Rename itf_complain to tf_error, + add tf_warning flag. + (instantiate_type): Adjust prototype. + (tsubst, tsubst_expr, tsubst_copy, lookup_template_class, + do_type_instantiation, cp_build_qualified_type_real): Likewise. + cp_build_qualified_type: Adjust. + * class.c (instantiate_type): Adjust parameter. Rename itf_* to + tf_*. + * call.c (standard_conversion): Rename itf_* to tf_*. + (reference_binding): Likewise. + (convert_like_real): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + (convert_to_reference): Likewise. + * decl.c (lookup_namespace_name): Use tf_* flags. + (make_typename_type): Likewise. + (grokdeclarator): Likewise. + * pt.c (convert_nontype_argument): Adjust COMPLAIN usage. + (coerce_template_template_parms, convert_template_argument, + coerce_template_parms, maybe_get_template_decl_from_type_decl, + lookup_template_class, tsubst_friend_function, tsubst_friend_class, + instantiate_class_template, tsubst_template_arg_vector, + tsubst_template_parms, tsubst_aggr_type, tsubst_default_argument, + tsubst_decl, tsubst_arg_types, tsubst_function_type, + tsubst_call_declarator_parms, tsubst, tsubst_copy, tsubst_expr, + instantiate_template, fn_type_unification, + resolve_overloaded_unification, verify_class_unification, + unify, get_bindings_real, do_type_instantiation, + regenerate_decl_from_template, instantiate_decl, + tsubst_initializer_list, tsubst_enum, + get_mostly_instantiated_function_type, + invalid_nontype_parm_type_p): Likewise. + * tree.c (cp_build_qualified_type_real): Likewise. + * typeck.c (build_binary_op): Rename itf_* to tf_*. + (build_ptrmemfunc): Likewise. + (convert_for_assignment): Likewise. + +2002-02-07 Nathan Sidwell + + PR c++/109 + * decl.c (grokdeclarator): Allow friend declarations from + dependent types. + * decl2.c (handle_class_head): Don't push into template parm contexts. + * pt.c (push_template_decl_real): Template parm contexts are never + being defined. + +2002-02-05 Alexandre Oliva + + * class.c: Include target.h. + (check_bitfield_decl): Disregard EMPTY_FIELD_BOUNDARY, + BITFIELDS_NBYTES_LIMITED and PCC_BITFIELD_TYPE_MATTERS for MS + bit-field layout. + * Make-lang.in: Adjust deps. + +2002-02-05 Jason Merrill + + * error.c (dump_type): Be more helpful about VECTOR_TYPE. + +2002-02-04 Jakub Jelinek + + * semantics.c (begin_switch_stmt): Clear SWITCH_TYPE. + (finish_switch_cond): Set SWITCH_TYPE. + +2002-02-04 Richard Henderson + + * method.c (use_thunk): Always initialize the block tree. Reindent. + * semantics.c (expand_body): Emit thunks after function, not before. + +2002-02-04 Jason Merrill + + * decl.c (start_function): Call cplus_decl_attributes immediately + after grokdeclarator. + + * decl.c (start_function): Combine DECL_RESULT handling code. + +2002-02-03 Jason Merrill + + * xref.c: Remove. + * Make-lang.in (CXX_OBJS): Remove cp/xref.o + (cp/xref.o): Remove dependencies. + * class.c (finish_struct_1, check_methods): Don't call xref fns. + (finish_struct_1): Likewise. + * friend.c (make_friend_class): Likewise. + * lex.c (cxx_init, cxx_finish, extract_interface_info): Likewise. + * spew.c (read_process_identifier): Likewise. + +2002-02-01 Jason Merrill + + PR c++/4872 + * decl.c (finish_function): Warn about a non-void function with + no return statement and no abnormal exit. + * cp-tree.h (struct cp_language_function): Add returns_abnormally. + (current_function_returns_abnormally): New macro. + * call.c (build_call): Set it. + + * typeck.c (build_component_ref): Always complain about offsetof + constructs on non-PODs. Only make it an error for members of + virtual bases. + + * error.c (dump_scope): Don't add TFF_DECL_SPECIFIERS. + (dump_function_decl): Always dump parms. + + * decl2.c (finish_static_data_member_decl): Complain about a local + class with a static data member. + + PR c++/4286 + * search.c (lookup_field_1): Don't xref a static data member + just because we looked it up. + +2002-01-31 Jason Merrill + + * Make-lang.in (parse.c): Handle .output file. + + PR c++/3395 + * decl.c (xref_tag): Remember early attributes in TYPE_ATTRIBUTES, + not TREE_TYPE. + * semantics.c (finish_class_definition): Adjust. + + Allow attributes in parms and casts. + * parse.y (named_parm): Don't strip attrs. + (declmods): Remove 'attributes' production. + (nonempty_cv_qualifiers): Accept attributes. + (ATTRIBUTE): Give precedence. + * decl.c (groktypename): Handle attributes. + (grokparms): Likewise. + +2002-01-29 Jakub Jelinek + + * decl2.c (cxx_decode_option): Pass 0 as last argument to + cpp_handle_option. + * lang-specs.h: Use cpp_unique_options instead of cpp_options + when used together with cc1_options. + +2002-01-29 Nathan Sidwell + + PR c++/5132 + * typeck2.c (digest_init): Make sure non-array core type is + instantiated. + * decl2.c (reparse_absdcl_as_casts): Just store the type in the + constructor, rather than build a new one. + (build_expr_from_tree, CONSTRUCTOR case): Be careful with the + PURPOSE of constructor elts. + +2002-01-23 Zack Weinberg + + * Make-lang.in (parse.c): Adjust expected number of + shift-reduce conflicts. + (decl.o): Depend on diagnostic.h. + * decl.c: Include diagnostic.h. + (grokdeclarator): Check for null pointer. + (finish_function): Don't abort when + current_binding_level->parm_flag != 1, if errors have + occurred; throw away the statement tree and extra binding + levels, and continue. + * lex.c (note_list_got_semicolon): Check for null pointer. + * method.c (hack_identifier): Just return error_mark_node if + value is error_mark_node. + * parse.y (primary: TYPEID(type_id)): No need to use + TYPE_MAIN_VARIANT here. + (handler_seq): Accept an empty list of catch clauses and + generate a fake handler block to avoid later crashes. + (ansi_raise_identifier): Accept the error token too. + * semantics.c (begin_class_definition, + finish_class_definition): Check for error_mark_node. + +2002-01-23 Zack Weinberg + + * typeck2.c (friendly_abort): Delete definition. + * cp-tree.h (friendly_abort): Don't prototype. + (my_friendly_assert): Use fancy_abort. + +2002-01-23 Craig Rodrigues + + * cp-tree.h (my_friendly_abort): Remove. + +2002-01-23 Jakub Jelinek + + * spew.c (pending_inlines, pending_inlines_tail, + processing_these_inlines): Make static. + (mark_pending_inlines): Remove static. + (begin_parsing_inclass_inline): If in function, save pi + for GC to cp_function_chain->unparsed_inlines instead. + (process_next_inline): Likewise. + * cp-tree.h (struct cp_language_function): Add unparsed_inlines. + (mark_pending_inlines): Add prototype. + * decl.c (spew_debug): Remove unused extern. + (mark_lang_function): Call mark_pending_inlines. + +2002-01-23 Craig Rodrigues + + * call.c, class.c, decl.c, decl2.c, error.c, expr.c, friend.c, + init.c, lex.c, mangle.c, method.c, pt.c, repo.c, rtti.c, search.c, + semantics.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: + Change my_fancy_abort() to abort(). + +2002-01-23 Jason Merrill + + PR c++/5453 + * class.c (fixed_type_or_null): Fix thinko. + + PR c++/3331 + * init.c (resolve_offset_ref): Use build_indirect_ref. + + * decl2.c (grokclassfn): Don't set DECL_REGISTER on 'this'. + +2002-01-22 Jason Merrill + + * parse.y (function_body): Suppress the block for the outermost + curly braces. + * decl.c (pushdecl): Don't try to skip it. + (begin_function_body): Keep the block we create, not the next one. + * init.c (emit_base_init): Don't mess with keep_next_level. + + * class.c (build_base_path): Tweak formatting. + +2002-01-19 Nathan Sidwell + + Fix regression introduced with patch for c++/775 + * parse.y (class_head_defn): Check for template specializations + with a different class-key. + +2002-01-17 Jason Merrill + + * decl.c (begin_constructor_body, begin_destructor_body): New fns. + (begin_function_body): Call them and keep_next_level. + * init.c (emit_base_init): Call keep_next_level. + * semantics.c (setup_vtbl_ptr): Lose. + * cp-tree.h (struct cp_language_function): Remove vtbls_set_up_p. + (vtbls_set_up_p): Lose. + * pt.c (tsubst_expr, CTOR_INITIALIZER): Call emit_base_init. + * method.c (do_build_copy_constructor): Likewise. + (synthesize_method): Call finish_mem_initializers. + * parse.y (nodecls): Likewise. + + * error.c (dump_type_suffix): Print the exception specs before + recursing. + (dump_function_decl): Here, too. + + * cp-tree.h (TMPL_PARMS_DEPTH): Cast to signed HOST_WIDE_INT. + +2002-01-10 Ira Ruben + + PR c++/907 + * decl.c (start_method): Handle attrlist. + +2002-01-10 Jakub Jelinek + + * decl2.c (max_tinst_depth): Increase default limit to 500. + +2002-01-10 Graham Stott + + * spew.c (YYCHAR): Uppercase macro parameter and add + parenthesis. + (YYCODE): Likewise. + (NAME): Uppercase macro parameter. + +2002-01-09 Graham Stott + + * decl.h (grokdeclarator): Wrap long line. + + * semantics.c (FINISH_COND): Uppercase macro paramaters and + add parenthesis. + +2002-01-08 Graham Stott + + * xref.c (FILE_NAME_ABSOLUTE_P): Add parenthesis. + (PALLOC): Uppercase macro parameter and whitespace. + (SALLOC): Uppercase macro parameter. + (SFREE): Uppercase macros parameter, add parenthese and + whitespace. + (STREQL): Uppercase macro parameter and whitespace. + (STRNEQ): Likewise. + (STRLSS): Likewise. + (STRLEQ): Likewise. + (STRGTR): Likewise. + (STRGEQ): Likewise. + + * call.c (convert_like): Add parenthesis and wrap. + (convert_like_with_context): Likewise. + (ICS_RANK): Whitespace. + (NEED_TEMPORARY_P): Remove parenthesis. + + * class.c (VTT_TOP_LEVEL_P): Uppercase macro parameter and + whitespace. + (VTT_MARKED_BINFO_P): Likewise. + + * decl.c (BINDING_LEVEL): Add parenthesis. + (DEF_OPERATOR): Likewise. + + * mangle.c (MANGLE_TRACE): Add parenthesis. + (MANGLE_TRACE_TREE): Likewise. + (write_signed_number): Likewise. + (write_unsigned_number): Likewise. + + * pt.c (ccat): Uppercase macro parameter. + (cat): Likewise + + * search.c (SET_BINFO_ACCESS): Add parenthesis. + +2002-01-07 Jason Merrill + + * decl2.c (coerce_new_type): Downgrade error for size_t mismatch + to pedwarn. + + PR c++/3536 + * method.c (make_thunk): If !flag_weak, give the thunk the + function's linkage. + (use_thunk): Here, too. + +2002-01-07 Graham Stott + + * error.c: Update copyright date. + (print_scope_operator): Add parenthesis. + (print_left_paren): Likewise. + (print_right_paren): Likewise. + (print_left_bracket): Likewise. + (print_right_bracket): Likewise. + (print_template_argument_list_start): Likewise. + (print_template_argument_list_end): Likewise. + (print_non_consecutive_character): Likewise. + (print_tree_identifier): Likewise. + (print_identifier): Likewise. + (NEXT_CODE): Uppercase macro parameter. + (ident_fndecl): Delete unused. + (GLOBAL_THING): Likewise. + +2002-01-06 Graham Stott + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): Add parenthesis. + (VAR_FUNCTION_OR_PARM_DECL_CHECK): Likewise. + (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK) Likewise. + (RECORD_OR_UNION_TYPE_CHECK): Likewise. + (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Likewise. + (C_IS_RESERVED_WORD): Uppercase macro parameter. + (C_RID_YYCODE) Likewise. + (ptrmem_cst): Use rtx. + (LOCAL_BINDING_P): Add whitespace. + (INHERITED_VALUE_BINDING_P): Likewise. + (BINDING_SCOPE): Wrap long line. + (BINDING_HAS_LEVEL_P): Remove parenthesis. + (BINDING_VALUE): Wrap long line. + (BINDING_TYPE): Whitespace. + (IDENTIFIER_GLOBAL_VALUE): Add parenthesis. + (SET_IDENTIFIER_GLOBAL_VALUE): Likewise. + (IDENTIFIER_NAMESPACE_VALUE): Likewise. + (SET_IDENTIFIER_NAMESPACE_VALUE: Likewise. + (same_type_p): Uppercase macro parameters. + (same_type_ignoring_top_level_qualifiers_p): Likewise. + (OVL_FUNCTION): Wrap long line. + (OVL_CHAIN): Whitespace. + (OVL_CURRENT): Add parenthesis and whitespace. + (OVL_NEXT): Whitespace. + (OVL_USED): Likewise. + (IDENTIFIER_TYPE_VALUE): Likewise. + (REAL_IDENTIFIER_TYPE_VALUE): Remove parenthesis. + (SET_IDENTIFIER_TYPE_VALUE): Add parenthesis and whitespace. + (LANG_ID_FIELD): Whitespace. + (SET_LANG_ID(NODE,VALUE,NAME): Likewise. + (IDENTIFIER_LABEL_VALUE): Whitespace and wrap. + (SET_IDENTIFIER_LABEL_VALUE): Whitespace. + (IDENTIFIER_IMPLICIT_DECL): Whitespace and wrap. + (SET_IDENTIFIER_IMPLICIT_DECL); Whitespace. + (IDENTIFIER_ERROR_LOCUS): Whitespace and wrap. + (SET_IDENTIFIER_ERROR_LOCUS); Whitespace. + (IDENTIFIER_VIRTUAL_P): Likewise. + (IDENTIFIER_OPNAME_P): Likewise. + (IDENTIFIER_TYPENAME_P): Remove parenthesis. + (C_TYPE_FIELDS_READONLY): Uppercase macro parameters. + (C_SET_EXP_ORIGINAL_CODE): Likewise. + (TYPE_ASSEMBLER_NAME_STRING): Wrap long line. + (TYPE_ASSEMBLER_NAME_LENGTH): Likewise. + (IS_AGGR_TYPE): Uppercase macro parameter. + (CLASS_TYPE_P): Likewise. + (IS_AGGR_TYPE_CODE): Uppercase macro parameter and parenthesis. + (IS_AGGR_TYPE_2): Whitespace. + (TAGGED_TYPE_P): Uppercase macro parameter. + (TYPE_BUILT_IN): Whitespace. + (TYPE_FOR_JAVA): Likewise. + (FUNCTION_ARG_CHAIN): Remove parenthesis. + (FUNCTION_FIRST_USER_PARMTYPE): Add parenthesis. + (FUNCTION_FIRST_USER_PARAM): Likewise. + (PROMOTES_TO_AGGR_TYPE): Whitespace. + (DERIVED_FROM_P): Add parenthesis and wrap. + (UNIQUELY_DERIVED_FROM_P): Likewise. + (ACCESSIBLY_UNIQUELY_DERIVED_P): Likewise. + (PUBLICLY_UNIQUELY_DERIVED_P): Likewise. + (CLASSTYPE_USE_TEMPLATE): Whitespace. + (CLASSTYPE_INLINE_FRIENDS): Remove parenthesis. + (TYPE_GETS_DELETE): Add parenthesis. + (TYPE_HAS_CONVERSION): Add parenthesis and wrap. + (TYPE_HAS_ASSIGN_REF): Likewise, + (TYPE_HAS_CONST_ASSIGN_REF): Likewise. + (TYPE_HAS_INIT_REF): Likewise. + (TYPE_HAS_CONST_INIT_REF): Likewise. + (TYPE_BEING_DEFINED): Likewise. + (TYPE_LANG_SPECIFIC): Likewise. + (CLASSTYPE_RTTI): Likewise. + (TYPE_OVERLOADS_CALL_EXPR): Likewise. + (TYPE_OVERLOADS_ARRAY_REF): Likewise. + (TYPE_OVERLOADS_ARROW): Likewise. + (TYPE_USES_MULTIPLE_INHERITANCE): Likewise. + (TYPE_USES_VIRTUAL_BASECLASSES): Add parenthesis. + (CLASSTYPE_METHOD_VEC): Likewise. + (CLASSTYPE_MARKED_N): Likewise. + (CLASSTYPE_MARKED): Likewise. + (CLASSTYPE_MARKED2): Likewise. + (CLASSTYPE_MARKED3): Likewise. + (CLASSTYPE_MARKED4): Likewise. + (CLASSTYPE_MARKED5): Likewise. + (CLASSTYPE_MARKED6): Likewise. + (SET_CLASSTYPE_MARKED): Whitespace. + (CLEAR_CLASSTYPE_MARKED): Likewise. + (SET_CLASSTYPE_MARKED2): Likewise. + (CLEAR_CLASSTYPE_MARKED2): Likewise. + (SET_CLASSTYPE_MARKED3): Likewise. + (CLEAR_CLASSTYPE_MARKED3): Likewise. + (SET_CLASSTYPE_MARKED4): Likewise. + (CLEAR_CLASSTYPE_MARKED4): Likewise. + (SET_CLASSTYPE_MARKED5): Likewise. + (CLEAR_CLASSTYPE_MARKED5): Likewise. + (SET_CLASSTYPE_MARKED6): Likewise. + (CLEAR_CLASSTYPE_MARKED6): Likewise. + (CLASSTYPE_TAGS): Likewise. + (CLASSTYPE_VSIZE): Likewise. + (CLASSTYPE_VBASECLASSES): Likewise. + (CANONICAL_BINFO): Add parenthesis. + (CLASSTYPE_SIZE(NODE): Likewise. + (CLASSTYPE_SIZE_UNIT): Likewise. + (CLASSTYPE_ALIGN(NODE): Likewise. + (CLASSTYPE_USER_ALIGN): Likewise. + (TYPE_JAVA_INTERFACE): Likewise. + (CLASSTYPE_PURE_VIRTUALS): Likewise. + (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Whitespace and wrap. + (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise. + (CLASSTYPE_HAS_MUTABLE): Likewise. + (CLASSTYPE_FRIEND_CLASSES): Likewise. Likewise. + (CLASSTYPE_DECLARED_CLASS): Whitespace and wrap. + (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Likewise. + (CLASSTYPE_REF_FIELDS_NEED_INIT): Likewise. + (CLASSTYPE_INTERFACE_ONLY): Likewise. + (CLASSTYPE_INTERFACE_KNOWN): Likewise. + (CLASSTYPE_INTERFACE_UNKNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. + (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. + (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. + (CLASSTYPE_DEBUG_REQUESTED): Whitespace and wrap. + (BINFO_UNSHARED_MARKED): Whitespace. + (BINFO_MARKED): Whitespace and wrap. + (SET_BINFO_MARKED): Likewise. + (CLEAR_BINFO_MARKED): Likewise. + (BINFO_VTABLE_PATH_MARKED): Likewise. + (SET_BINFO_VTABLE_PATH_MARKED): Likewise. + (CLEAR_BINFO_VTABLE_PATH_MARKED): Likewise. + (BINFO_SUBVTT_INDEX): Remove parenthesis. + (BINFO_VPTR_INDEX): Likewise. + (BINFO_PRIMARY_BASE_OF): Likewise, + (CLASSTYPE_VFIELDS): Whitespace. + (VF_DERIVED_VALUE): Wrap long line. + (NAMESPACE_LEVEL): Whitespace. + (CAN_HAVE_FULL_LANG_DECL_P): Remove parenthesis. + (DEFARG_POINTER): Whitespace. + (DECL_NEEDED_P): Remove parenthesis. + (DECL_LANGUAGE): Whitespace. + (SET_DECL_LANGUAGE): Add parenthesis. + (DECL_CONSTRUCTOR_P): Whitespace and wrap. + (DECL_OVERLOADED_OPERATOR_P): Remove parenthesis. + (DECL_IN_AGGR_P): Whitespace. + (DECL_FRIEND_P): Likewise. + (DECL_BEFRIENDING_CLASSES): Likewise. + (DECL_STATIC_FUNCTION_P): Whitespace and wrap. + (DECL_NONCONVERTING_P): Whitespace. + (DECL_PURE_VIRTUAL_P): Likewise. + (DECL_NEEDS_FINAL_OVERRIDER_P): Likewise. + (DECL_PENDING_INLINE_INFO): Whitespace. + (DECL_SORTED_FIELDS): Likewise. + (DECL_DEFERRED_FN): Likewise. + (DECL_TEMPLATE_INFO): Likewise. + (CLASSTYPE_TEMPLATE_INFO): Whitespace and wrap. + (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO); Likewise. + (SET_TYPE_TEMPLATE_INFO): Add parenthesis. + (TMPL_ARGS_LEVEL): Likewise. + (SET_TMPL_ARGS_LEVEL): Likewise. + (INNERMOST_TEMPLATE_PARMS): Whitespace. + (C_TYPEDEF_EXPLICITLY_SIGNED): Uppercase macro parameter. + (INTEGRAL_CODE_P(CODE): Add parenthesis. + (CP_INTEGRAL_TYPE_P): Remove parenthesis. + (TYPE_HAS_CONSTRUCTOR): Whitespace. + (TREE_HAS_CONSTRUCTOR): Likewise. + (TYPE_HAS_DESTRUCTOR): Likewise. + (TYPE_HAS_REAL_ASSIGN_REF): Likewise. + (TYPE_HAS_COMPLEX_ASSIGN_REF): Likewise. + (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise. + (TYPE_HAS_COMPLEX_INIT_REF): Likewise. + (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise. + (TYPE_PTRMEMFUNC_P): Likewise. + (TYPE_PTRMEMFUNC_FLAG): Likewise. + (TYPE_GET_PTRMEMFUNC_TYPE): Likewise. + (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. + (TYPE_PTRMEM_CLASS_TYPE): Remove parenthesis. + (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. + (DECL_ACCESS): Whitespace. + (DECL_GLOBAL_CTOR_P): Remove parenthesis. + (DECL_GLOBAL_DTOR_P): Likewise. + (GLOBAL_INIT_PRIORITY): Likewise. + (DECL_TEMPLATE_PARMS): Likewise. + (DECL_TEMPLATE_RESULT): Likewise. + (DECL_TEMPLATE_INSTANTIATIONS): Likewise. + (DECL_TEMPLATE_SPECIALIZATIONS): Likewise. + (DECL_IMPLICIT_TYPEDEF_P): Remove parenthesis. + (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. + (PRIMARY_TEMPLATE_P): Add parenthesis. + (DECL_USE_TEMPLATE): Whitespace. + (CLASSTYPE_IMPLICIT_INSTANTIATION): Likewise. + (SET_CLASSTYPE_IMPLICIT_INSTANTIATION): Likewise. + (CLASSTYPE_EXPLICIT_INSTANTIATION): Likewise. + (SET_CLASSTYPE_EXPLICIT_INSTANTIATION): Likewise. + (CALL_DECLARATOR_PARMS): Remove parenthesis. + (CALL_DECLARATOR_QUALS): Likewise. + (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise. + (TEMP_NAME_P): Wrap. + (VFIELD_NAME_P): Likewise. + (B_SET): Uppercase macro parameters and add parenthesis. + (B_CLR): Likewise. + (B_TST): Likewise. + (LOOKUP_NAMESPACES_ONLY): Uppercase macro parameters. + (LOOKUP_TYPES_ONLY): Uppercase macro parameters. + (LOOKUP_QUALIFIERS_ONLY): Uppercase macro parameters. + (same_or_base_type_p): Likewise. + (cp_deprecated): Likewise. + +2002-01-05 Richard Henderson + + * semantics.c (expand_body): Revert last change. + +2002-01-04 Jason Merrill + + PR c++/4122 + * class.c (update_vtable_entry_for_fn): Set delta to zero for a + lost primary. + + * class.c (build_vtbl_initializer): Check for a lost primary + before calculating the vtable entry to throw away. + +2002-01-02 Jason Merrill + + * semantics.c (expand_body): Call outlining_inline_function when + emitting an inline function out of line. + +2002-01-02 Nathan Sidwell + + PR c++/5116, c++/764 reversion + * call.c (build_new_op): Revert the instantiations. They are + incorrect. + +2002-01-02 Nathan Sidwell + + PR c++/5089 + * decl2.c (reparse_absdcl_as_casts): Don't warn about casts to void. + +2002-01-02 Nathan Sidwell + + PR c++/3716 + * pt.c (tsubst_aggr_type): Move pmf handling into tsubst. + (tsubst, case POINTER_TYPE): Handle pmfs here. + (tsubst, case OFFSET_TYPE): Check it is not an offset to + reference. If it is offset to FUNCTION_TYPE, create a METHOD_TYPE. + +2002-01-02 Nathan Sidwell + + PR c++/35 + * cp-tree.h (DECL_LANG_FLAG_0): Used for PARM_DECL too. + (DECL_TEMPLATE_PARM_P): A PARM_DECL might be one too. + * pt.c (process_template_parm): SET_DECL_TEMPLATE_PARM_P on the + PARM_DECL. + (tsubst_template_parms): Break up loop statements. + (tsubst_decl, case PARM_DECL): Copy DECL_TEMPLATE_PARM_P. Template + parm PARM_DECLs don't get promoted. + +2002-01-02 Nathan Sidwell + + PR c++/5123 + * typeck.c (build_component_ref): Cope with a TEMPLATE_ID_EXPR. + (build_x_function_call): Cope with a COMPONENT_REF containing a + TEMPLATE_ID_EXPR. + +2002-01-02 Nathan Sidwell + + PR c++/5213 + * pt.c (convert_template_argument): Be more careful determining + when RECORD_TYPE templates are or are not templates. + +2002-01-02 Nathan Sidwell + + PR c++/775 + * cp-tree.h (handle_class_head): Adjust prototype. + * decl2.c (handle_class_head): Add DEFN_P and NEW_TYPE_P + parameters. Use for all class heads. + * parse.y (named_class_head_sans_basetype, named_class_head, + named_complex_class_head_sans_basetype, + named_class_head_sans_basetype_defn, + unnamed_class_head): Remove. + (class_head, class_head_apparent_template): Recognize class heads + (class_head_decl, class_head_defn): New reductions. Process class + heads. + (structsp): Adjust class definition and class declaration + reductions. + (maybe_base_class_list): Give diagnostic on empty list. + +2002-01-02 Nathan Sidwell + + PR c++/4379 + * typeck.c (build_x_unary_op): Don't destroy the OFFSET_REF on a + single non-static member. + (unary_complex_lvalue): If it cannot be a pointer to member, don't + make it so. Check it is not pointer to reference. + +2002-01-02 Nathan Sidwell + + PR c++/5132 + * decl2.c (reparse_absdcl_as_casts): Don't digest_init if we + are processing a template decl. + +2002-01-02 Nathan Sidwell + + PR c++/5116, c++/764 + * call.c (build_new_op): Make sure template class operands are + instantiated. Simplify arglist construction. + diff --git a/gcc/cp/ChangeLog-2003 b/gcc/cp/ChangeLog-2003 new file mode 100644 index 00000000000..f0500f4b147 --- /dev/null +++ b/gcc/cp/ChangeLog-2003 @@ -0,0 +1,6904 @@ +2003-12-30 Nathan Sidwell + + PR c++/13507 + * decl.c (duplicate_decls): Use build_type_attribute_variant to + merge attributes. + + PR c++/13494 + * tree.c (build_cplus_array_type_1): Only build a minimal array + type for dependent types or domains. + +2003-12-29 Nathan Sidwell + + PR c++/12774 + * typeck.c (comp_array_types): Fold non-dependent domains for + ABI-1. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/13289 + * semantics.c (finish_id_expression): Only check if the type of + a template argument is integral or enumeration when it is not + dependent. + +2003-12-29 Kriang Lerdsuwanakij + + PR c++/12403 + * parser.c (cp_parser_template_declaration_after_export): Set up + template specialization scope in case of explicit specialization. + +2003-12-28 Mark Mitchell + + PR c++/13081 + * decl.c (duplicate_decls): Preserve inline-ness when redeclaring + a function template. + + PR c++/12613 + * decl.c (reshape_init): Reject GNU colon-style designated + initializers in arrays. + + PR c++/13009 + * call.c (build_special_member_call): Do not assume that we have a + pointer to the complete object in an assignment operator. + +2003-12-28 Roger Sayle + + PR c++/13070 + * decl.c (duplicate_decls): When setting the type of an anticipated + declaration, merge the existing type attributes. + +2003-12-25 Andrew Pinski + + PR c++/13268, c++/13339 + * class.c (add_method): Return early when method is error_mark_node. + * pt.c (tsubst_friend_function): Return early when new_friend is + error_mark_node. + +2003-12-23 Mark Mitchell + + * cp-lang.c (cp_expr_size): Return zero for empty classes. + + * cp-tree.h (warn_if_uknown_interface): Remove unused function. + * decl2.c (warn_if_unknown_interface): Likewise. + +2003-12-23 Nathan Sidwell + + PR c++/13387 + * cp-lang.c (cxx_get_alias_set): Correct logic for a base type. + +2003-12-22 Mark Mitchell + + * decl.c (start_function): Do not check + flag_alt_external_templates or flag_external_templates. + * decl2.c (warn_if_unknown_interface): Likewise. + * lex.c (extract_interface_info): Likewise. + * pt.c (lookup_template_class): Likewise. + + PR c++/12862 + * name-lookup.c (pushdecl): Look up all namespace-scope entities + in their corresponding namespace. + + PR c++/12397 + * typeck.c (finish_class_member_access_expr): Don't tree + IDENTIFIER_NODEs as non-dependent expressions. + +2003-12-22 Andrew Pinski + + PR c++/5050 + * tree.c (cp_start_inlining): Remove. + (cp_end_inlining): Remove. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. + (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. + * cp-tree.h (cp_start_inlining): Do not declare. + (cp_end_inlining): Do not declare. + +2003-12-22 Mark Mitchell + + PR c++/12479 + * parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;" + pedwarn when not in a system header. + +2003-12-21 Mark Mitchell + + * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE, + CPTI_UNION_TYPE, CPTI_ENUM_TYPE. + (record_type_node): Remove. + (union_type_node): Likewise. + (enum_type_node): Likewise. + * decl.c: Remove mention of above tree nodes in comment. + * lex.c (cxx_init): Do not assign to record_type_node, + union_type_node, or enum_type_node. Simplify handling of + class_type_node. + + PR c++/11554 + * init.c (sort_mem_initializers): Add warning. + +2003-12-21 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * cxx-pretty-print.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * error.c: Likewise. + * except.c: Likewise. + * init.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * semantics.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-12-19 Kazu Hirata + + * cvt.c: Remove uses of "register" specifier in + declarations of arguments and local variables. + * decl.c: Likewise. + * decl2.c: Likewise. + * expr.c: Likewise. + * friend.c: Likewise. + * lex.c: Likewise. + * name-lookup.c: Likewise. + * repo.c: Likewise. + * search.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-12-19 Mark Mitchell + + PR c++/12795 + * name-lookup.c (pushdecl): Do not treated any functions as being + "nested" in C++. + +2003-12-19 Jason Merrill + + PR c++/13371 + * typeck.c (build_modify_expr): Stabilize lhs if we're narrowing. + * cvt.c (convert_to_void): Don't warn about the RHS of a comma + being useless if TREE_NO_UNUSED_WARNING is set. + +2003-12-18 Richard Henderson + + * cp-tree.h (struct lang_type_header): Remove __extension__. + +2003-12-18 Jason Merrill + + PR c++/12253 + * init.c (build_vec_init): Initialization of an element from + an initializer list is also a full-expression. + + * parser.c, pt.c, semantics.c: Rename constant_expression_p + to integral_constant_expression_p. + +2003-12-18 Kriang Lerdsuwanakij + + PR c++/13262 + * pt.c (instantiate_decl): Wrap push_nested_class and + pop_nested_class around cp_finish_decl call for static member + variable. + +2003-12-18 Giovanni Bajo + + PR c++/9154 + * parser.c (cp_parser_template_argument): A type-id followed by '>>' + is just an user typo, and should be accepted as last resort if any + other parsing fails. + (cp_parser_enclosed_template_argument_list): If the argument list is + parsed correctly, but the next token is '>>', emit a diagnostic. + (cp_parser_next_token_ends_template_argument): Accept '>>' as + delimiter of template argument, it will be later detected as a typo. + +2003-12-17 Kelley Cook + + * Make-lang.in: Replace cp/g++.1 with $(docobjdir)/g++.1. + +2003-12-17 Mark Mitchell + + PR c++/10603 + PR c++/12827 + * parser.c (cp_parser_error): Help c_parse_error print good + messages if the next token is a keyword. + (cp_parser_parameter_declaration_list): When resynchronizing after + a bad parameter declaration, stop if a comma is found. + (cp_parser_parameter_declaration): Avoid backtracking. + +2003-12-16 Mark Mitchell + + PR c++/12696 + * decl.c (reshape_init): Recover quickly from errors. + +2003-12-16 Nathan Sidwell + + PR c++/9043 + C++ ABI change: Mangling array indices in templates. + * decl.c (compute_array_index_type): Reorganize for earlier + template errors. Use value_dependent_expression_p for abi-2. + * mangle.c (write_array_type): Check broken mangling for + expression indices on abi-1 + +2003-12-16 Mark Mitchell + + PR c++/12696 + * decl.c (reshape_init): Recover quickly from errors. + + PR c++/13275 + * lex.c (reswords): Add "__offsetof" and "__offsetof__". + * parser.c (cp_parser): Add in_offsetof_p. + (cp_parser_new): Initialize it. + (cp_parser_primary_expression): Handle __offsetof__ (...). + (cp_parser_postfix_expression): Allow casts to pointer type and + uses of "->" in a constant expression if implementing offsetof. + (cp_parser_unary_expression): Allow the use of "&" in a constant + expression if implementing offsetof. + +2003-12-16 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + +2003-12-16 Giovanni Bajo + + * semantics.c (finish_id_expression): Refactor the code to handle + template parameters, and emit a more informative error message + when they are used within an integral constant expression. + +2003-12-16 Nathan Sidwell + + PR c++/13387 + * class.c (finish_struct_1): Compute mode and alias set for + CLASSTYPE_AS_BASE. + * call.c (build_over_call): Use CLASSTYPE_AS_BASE for trivial + assignment of a class, as necessary. + * cp-lang.c (cxx_get_alias_set): The alias set as a base is the + same as for the complete type. + + PR c++/13242 + C++ ABI change. Mangling template parameters of reference type + * mangle.c (write_template_args): Remove unreachable code. + (write_template_arg): Look through an argument of reference type. + +2003-12-16 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD + if the declaration comes from an using declaration. + +2003-12-15 Mark Mitchell + + PR c++/10926 + * decl2.c (grokfield): Robustify. + + PR c++/11116 + * parser.c (cp_parser_throw_expression): Determine whether or not + an assignment-expression is present by doing one-token lookahead. + + PR c++/13269 + * parser.c (cp_parser_function_definition_after_declarator): Stop + scanning tokens when reaching EOF. + + PR c++/12989 + * typeck.c (cxx_sizeof_or_alignof_expr): Robustify. + + PR c++/13310 + * pt.c (dependent_template_p): Handle OVERLOADs. + +2003-12-15 Mark Mitchell + + PR c++/13243 + PR c++/12573 + * parser.c (cp_parser_postfix_expression): Tighten handling of + integral constant expressions. + (cp_parser_unary_expression): Likewise. + * pt.c (value_dependent_expression_p): Remove handling for + COMPONENT_REFs. + +2003-12-15 Nathan Sidwell + + * class.c (add_method): Disallow destructor for java classes. + * decl.c (xref_basetypes): Check java class inheritance. + * decl2.c (check_java_method): Skip artificial params. + + PR c++/13241 + C++ ABI change. Mangling of symbols in expressions. + * mangle.c (write_mangled_name): Add top_level flag. Rework for + nested and unnested mangling. Deal with abi version 1 and version + 2 differences. + (write_expression): Adjust write_mangled_name call. + (mangle_decl_string): Use write_mangled_name for all non-type decls. + +2003-12-14 Mark Mitchell + + PR c++/10779 + PR c++/12160 + * parser.c (struct cp_parser): Add in_template_argument_list_p. + (cp_parser_error): Use c_parse_error. + (cp_parser_name_lookup_error): New function. + (cp_parser_new): Initialize it. + (cp_parser_declarator): Add parenthesized_p parameter. + (cp_parser_nested_name_specifier_opt): Use + cp_parser_name_lookup_error. + (cp_parser_parenthesized_expression_list): Improve comments. + (cp_parser_condition): Adjust call to cp_parser_declarator. + (cp_parser_template_parameter): Adjust call to + cp_parser_parameter_declaration. + (cp_parser_template_argument_list): Set + in_template_argument_list_p. + (cp_parser_explicit_instantiation): Adjust call to + cp_parser_declarator. + (cp_parser_simple_type_specifier): Remove unncessary code. + (cp_parser_using_declaration): Use cp_parser_name_lookup_error. + (cp_parser_init_declarator): Handle member function definitions. + (cp_parser_direct_declarator): Adjust call to + cp_parser_declarator. + (cp_parser_type_id): Adjust call to cp_parser_declarator. + (cp_parser_parameter_declaration_list): Avoid backtracking where + possible. + (cp_parser_parameter_declaration): Add parenthesized_p parameter. + (cp_parser_function_definition): Remove. + (cp_parser_member_declaration): Do not backtrack to look for + function definitions. + (cp_parser_exception_declaration): Adjust call to + cp_parser_declarator. + (cp_parser_single_declaration): Handle function definitions via + cp_parser_init_declarator. + (cp_parser_save_member_function_body): New function. + +2003-12-14 Kriang Lerdsuwanakij + + PR c++/13106 + * decl.c (finish_function): Check if return type is dependent before + issuing no return statement warning. + +2003-12-12 Nathan Sidwell + + PR c++/13118 + * cp-tree.h (lang_decl_u): Add thunk_alias member. + (THUNK_VIRTUAL_OFFSET): Must be a FUNCTION_DECL. + (THUNK_ALIAS_P): Remove. + (THUNK_ALIAS): Adjust. + * class.c (update_vtable_entry_for_fn): Get the vbase within the + overriding function's return type. + (dump_thunk): Adjust THUNK_ALIAS printing. + (build_vtbl_initializer): Adjust THUNK_ALIAS use. + * method.c (make_thunk): Revert 12881 test change. Clear + THUNK_ALIAS. + (finish_thunk): Adjust THUNK_ALIAS setting. + (use_thunk): Adjust THUNK_ALIAS use. + * semantics.c (emit_associated_thunks): Likewise. + + PR c++/13114, c++/13115 + * class.c (layout_empty_base): Propagate the move of an empty base + to offset zero. + + PR c++/12881 + * method.c (make_thunk): Deal with thunk aliases when searching + for a thunk. Robustify assertion. + +2003-12-11 Nathan Sidwell + + * mangle.c (conv_type_names): Holds IDENTIFIER_NODEs only. + (hash_type): Use TYPE_UID of the identifier's type. + (compare_type): Adjust. + (mangle_conv_op_name_for_type): Store identifier nodes only, use + TYPE_UID has hash value. + +2003-12-10 Mark Mitchell + + * cp-tree.h (DECL_CONV_FN_P): Check that DECL_NAME is non-NULL. + +2003-12-08 Matt Austern + + PR c/13134 + * decl.c (duplicate_decls): Copy visibility flag when appropriate. + +2003-12-09 Giovanni Bajo + + * init.c (build_new_1): Deal with an OVERLOAD set when + looking up for _Jv_AllocObject. + * except.c (build_throw): Likewise for _Jv_Throw. + +2003-12-08 Jason Merrill + + PR c++/11971 + * tree.c (build_local_temp): Split out from build_cplus_new. + (force_target_expr): New fn. + * call.c (call_builtin_trap): Call it. Take a type parm. + (convert_arg_to_ellipsis): Pass it. + (build_x_va_arg): Use call_builtin_trap. + + PR c++/11929 + * call.c (magic_varargs_p): New fn. + (build_over_call): Do no ellipsis conversions for arguments to + functions with magic varargs. + + * name-lookup.c, init.c, except.c: Revert Giovanni's patch from + yesterday. + + Give the anonymous namespace a null DECL_NAME. + * cp-tree.h: Don't declare anonymous_namespace_name. + * decl.c: Don't define it. + * dump.c (cp_dump_tree): Don't check for it. + * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise. + * error.c (dump_decl): Likewise. + * name-lookup.c: Define it here. + (push_namespace): Put it in DECL_ASSEMBLER_NAME instead. + * mangle.c (write_unqualified_name): Adjust. + +2003-12-07 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an + OVERLOAD unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. + * init.c (build_new_1): Deal with an OVERLOAD set when + looking up for _Jv_AllocObject. + * except.c (build_throw): Likewise for _Jv_Throw. + +2003-12-06 Mark Mitchell + + PR c++/13323 + * class.c (same_signature_p): Handle conversion operators + correctly. + (check_for_override): Likewise. + +2003-12-06 Kelley Cook + + * Make-lang.in (GXX_CROSS_NAME, CXX_CROSS_NAME): Delete. + (c++.install_common, cp/g++.1, c++.install-man): Adjust for above. + (c++.uninstall): Likewise. + +2003-12-05 Danny Smith + Mark Mitchell + + PR c++/13305 + * parser.c (cp_parser_elaborated_type_specifier): Accept + attributes. + +2003-12-05 Mark Mitchell + + PR c++/13314 + * parser.c (cp_parser_class_specifier): Match push_scope/pop_scope + calls. + (cp_parser_class_head): Likewise. + +2003-12-05 Kriang Lerdsuwanakij + + PR c++/13166 + * parser.c (cp_parser_late_parsing_default_args): Make sure the + context is a class before calling push_nested_class and + pop_nested_class. + +2003-12-03 James E Wilson + + * g++spec.c (lang_specific_driver): Delete USE_LIBUNWIND_EXCEPTIONS + support. + +2003-12-03 Mark Mitchell + + PR c++/9127 + * cp-tree.h (at_namespace_scope_p): New function. + * parser.c (cp_parser_class_head): Handle invalid explicit + specializations. + * search.c (at_namespace_scope_p): New function. + + PR c++/13179 + * semantics.c (finish_handler_parms): Do not call eh_type_info for + types used in templates. + + PR c++/10771 + * parser.c (cp_parser_check_for_invalid_template_id): New + function. + (cp_parser_simple_type_specifier): Use it. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_class_head): Likewise. + +2003-12-02 Giovanni Bajo + + PR c++/10126 + * pt.c (convert_nontype_argument): Handle default conversions + while converting a pointer to member function. + +2003-12-02 Giovanni Bajo + + PR c++/12573 + * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by + looking into them recursively. + +2003-12-02 Richard Henderson + + * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD. + * parser.c (struct cp_token): Likewise. + (struct cp_parser_token_tree_map_node): Likewise. + * lex.c (struct resword): Move const after ENUM_BITFIELD. + +2003-11-30 Mark Mitchell + + PR c++/9849 + * parser.c (cp_lexer_prev_token): New function. + (cp_parser_skip_to_closing_parenthesis): Add consume_paren + parameter. + (cp_parser_nested_name_specifier_opt): Add is_declaration + parameter. + (cp_parser_nested_name_specifier): Likewise. + (cp_parser_class_or_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_template_id): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_id_expression): Adjust calls to + cp_parser_nested_name_specifier_op, cp_parser_template_id, + cp_parser_class_name. + (cp_parser_unqualified_id): Likewise. + (cp_parser_postfix_expression): Likewise. + (cp_parser_pseudo_destructor_name): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_mem_initializer_id): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_type_name): Likewise. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_qualified_namespace_specifier): Likewise. + (cp_parser_using_declaration): Likewise. + (cp_parser_using_directive): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_declarator_id): Likewise. + (cp_parser_class_head): Likewise. + (cp_parser_base_specifier): Likewise. + (cp_parser_constructor_declarator_p): Likewise. + (cp_parser_direct_declarator): Fix typo in comment. + (cp_parser_parenthesized_expression_list): Adjust call to + cp_parser_skip_to_closing_parenthesis. + (cp_parser_selection_statement): Likewise. + +2003-11-23 Kriang Lerdsuwanakij + + PR c++/12924 + * typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR + with OVERLOAD and DECL nodes as the first operand. + +2003-11-22 Kriang Lerdsuwanakij + + * pt.c (tsubst) : Remove erroneous argument to build_nt. + +2003-11-22 Kriang Lerdsuwanakij + + PR c++/5369 + * friend.c (is_friend): Handle member function of a class + template as template friend. + (do_friend): Likewise. + * decl2.c (check_classfn): Add template_header_p parameter. + * decl.c (start_decl): Adjust check_classfn call. + (grokfndecl): Likewise. + * pt.c (is_specialization_of_friend): New function. + (uses_template_parms_level): Likewise. + (push_template_decl_real): Use uses_template_parms_level. + (tsubst_friend_function): Adjust check_classfn call. + * cp-tree.h (check_classfn): Adjust declaration. + (uses_template_parms_level): Add declaration. + (is_specialization_of_friend): Likewise. + +2003-11-21 Mark Mitchell + + PR c++/12515 + * pt.c (build_non_dependent_expr): Handle GNU extension to ?: + operator. + +2003-11-21 Jan Hubicka + + * parser.c (cp_parser_postfix_expression): Initialize 's' to + NULL_TREE. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (c++.extraclean): Delete. + +2003-11-20 Joseph S. Myers + + * Make-lang.in (check-g++, lang_checks): Add. + +2003-11-18 Kriang Lerdsuwanakij + + PR c++/12932 + * class.c (currently_open_derived_class): Check if + current_class_type is NULL_TREE. + * semantics.c (finish_call_expr): Check if + currently_open_derived_class returns NULL_TREE. + * cp-tree.h (DERIVED_FROM_P): Add parenthesis around PARENT + parameter. + +2003-11-17 Jason Merrill + + * init.c (build_new_1): Preevaluate placement args. + * call.c (build_op_delete_call): Don't expose placement args to + overload resolution. + +2003-11-16 Jason Merrill + + * Make-lang.in (c++.tags): Create TAGS.sub files in each directory + and TAGS files that include them for each front end. + +2003-11-15 Bernardo Innocenti + + PR c++/2294 + * name-lookup.c: Revert previous patch for PR c++/2294 to prevent + build failure on libjava. + +2003-11-14 Giovanni Bajo + + PR c++/2294 + * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD + unless the declaration is a built-in. + (set_namespace_binding): While binding OVERLOADs with only one + declaration, we still need to call supplement_binding. + +2003-11-14 Mark Mitchell + + PR c++/12762 + * parser.c (cp_parser_enclosed_template_argument_list): New + function. + (cp_parser_template_id): Use it. + (cp_parser_simple_type_specifier): Recognize invalid template + syntax. + +2003-11-14 Giovanni Bajo + + PR c++/2094 + * pt.c (unify): Add support for PTRMEM_CST and + FIELD_DECL unification. + +2003-11-13 Richard Earnshaw + + * decl.c (grokfndecl): Change OK to type tree. + +2003-11-12 Mark Mitchell + + * tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like + CONSTRUCTOR. + + * decl.c (cp_make_fname_decl): When creating a top-level + __FUNCTION__-like symbol, do register it with pushdecl. + + * decl.c (finish_case_label): Do not check that we are within a + switch statement here. + * parser.c (struct cp_parser): Add in_iteration_statement_p and + in_switch_statement_p. + (cp_parser_new): Initialize them. + (cp_parser_labeled_statement): Check validity of case labels + here. + (cp_parser_selection_statement): Set in_switch_statement_p. + (cp_parser_iteration_statement): Set in_iteration_statement_p. + (cp_parser_jump_statement): Check validity of break/continue + statements here. + + PR c++/12735 + * cp-tree.h (duplicate_decls): Return a tree. + * decl.c (duplicate_decls): Clarify documentation. Return + error_mark_node to indicate a failed redeclaration. + * friend.c (do_friend): Handle that case. + * name-lookup.c (pushdecl): Likewise. + +2003-11-11 Jason Merrill + + * cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro. + * name-lookup.c (parse_using_directive): New fn. + (is_associated_namespace): New fn. + (arg_assoc_namespace): Also check associated namespaces. + * name-lookup.h: Declare new fns. + * pt.c (maybe_process_partial_specialization): Allow + specialization in associated namespace. + * parser.c (cp_parser_using_directive): Accept attributes. Use + parse_using_directive. + +2003-11-10 Richard Henderson + + * cvt.c (convert_to_void): Use void_zero_node after overload failure. + +2003-11-10 Gabriel Dos Reis + + PR c++/12832 + * name-lookup.c (supplement_binding): Gracefully handle names + used at non-class scope prior declaration. + +2003-11-06 Matt Austern + + * decl.c (duplicate_decls): copy DECL_VISIBILITY field. + * method.c (use_thunk): give thunk same visibility as function. + * optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/11616 + * pt.c (instantiate_pending_templates): Save and restore + input_location. + +2003-11-05 Kriang Lerdsuwanakij + + PR c++/2019 + * friend.c (add_friend): Don't display previous declaration in + case of duplicate friend warning. + +2003-11-02 Kriang Lerdsuwanakij + + PR c++/9810 + * call.c (build_over_call): Check access using primary template + if FN is a member function template. + +2003-11-01 Kriang Lerdsuwanakij + + PR c++/12796 + * class.c (handle_using_decl): Set input_location before calling + error_not_base_type. + +2003-10-26 Kriang Lerdsuwanakij + + PR c++/10371 + * semantics.c (finish_non_static_data_member): Handle when + both processing_template_decl and qualifying_scope are true. + +2003-10-24 Kriang Lerdsuwanakij + + PR c++/11076 + * class.c (handle_using_decl): Swap arguments of error_not_base_type. + * parser.c (cp_parser_direct_declarator): Only resolve typename for + namespace scope declarations. + +2003-10-24 Nathan Sidwell + + PR c++/12698, c++/12699, c++/12700, c++/12566 + * cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New. + (debug_class, debug_thunks): New. + * class.c (dump_class_hierarchy_1): New break out from ... + (dump_class_hierarchy): ... here. + (dump_thunk, debug_thunks, debug_class): New. + (update_vtable_entry_for_fn): Add ssizetype casts. Correct + continued search for primary binfo via virtual. + (build_vtbl_initializer): Follow covariant thunk alias. + * method.c (make_thunk): Clear DECL_THUNKS of the thunk. + (finish_thunk): Look for an alias of the covariant thunk and point + to it. + (use_thunk): We should never use an alias. + * semantics.c (emit_associated_thunks): Do not emit aliases. + + PR c++/12566 + * cp-tree.h (cp_fname_init): Add TYPE pointer param. + * decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't + create an ad-hoc ERROR_MARK. + (cp_make_fname_decl): Adjust. + * pt.c (tsubst_expr): Adjust. + +2003-10-23 Jason Merrill + + PR c++/12726 + * tree.c (build_target_expr_with_type): Don't call force_rvalue + for CONSTRUCTORs. + +2003-10-22 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cxx-pretty-print.c: Likewise. + * init.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * semantics.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + * typeck2.c: Likewise. + +2003-10-21 Mark Mitchell + + PR c++/11962 + * typeck.c (build_x_conditional_expr): Handle missing middle + operands in templates. + * mangle.c (write_expression): Issue errors about attempts to + mangle a non-existant middle operator to the ?: operator. + +2003-10-21 Robert Bowdidge + * decl.c (cp_finish_decl): Remove clause intended for asm directives + in struct or class fields: this code is never executed. + +2003-10-22 Kriang Lerdsuwanakij + + * decl.c (start_decl): Exit if push_template_decl returns + error_mark_node. + +2003-10-20 Kazu Hirata + + * ChangeLog: Fix typos. + * call.c: Fix comment typos. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * cxx-pretty-print.c: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * init.c: Likewise. + * mangle.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2003-10-20 Jan Hubicka + + * decl.c (start_cleanup_fn): Set DECL_DECLARED_INLINE_P to deffer + the expansion. + +2003-10-20 Mark Mitchell + + * Make-lang.in (c++.install-info): Remove. + +2003-10-20 Jason Merrill + + * class.c (layout_class_type): Set DECL_ARTIFICIAL on padding + field. + +2003-10-20 Kriang Lerdsuwanakij + + PR c++/9781, c++/10583, c++/11862 + * decl.c (cp_finish_decl): Exit immediately if decl is an + error_mark_node. + * pt.c (push_template_decl_real): Return error_mark_node for + invalid template declaration of variable. + +2003-10-18 Kriang Lerdsuwanakij + + PR c++/12495 + * pt.c (lookup_template_class): Handle when current_class_type + is a local class. + +2003-10-17 Kriang Lerdsuwanakij + + PR c++/2513 + * decl.c (make_typename_type): Use dependent_type_p. + (make_unbound_class_template): Likewise. + * pt.c (instantiate_class_template): Increment + processing_template_decl during substitution of template friend + function. Preincrement processing_template_decl rather than + postincrement. + (get_mostly_instantiated_function_type): Increment + processing_template_decl during partial substitution of function + type. + +2003-10-15 Jan Hubicka + + PR c++/12574 + * decl2.c (cxx_callgraph_analyze_expr): Deal with baselink. + +2003-10-14 Jason Merrill + + PR c++/11878 + * tree.c (build_target_expr_with_type): Call force_rvalue for + classes with non-trivial copy ctors. + + PR c++/11063 + * typeck.c (build_modify_expr): Call convert rather than abort. + +2003-10-14 Gabriel Dos Reis + + Breack out decl.c (3/n) + * name-lookup.c: Include flags.h + (lookup_name_current_level): Make static. + (add_decl_to_level): Likewise. + (push_local_binding): Likewise. + (push_overloaded_decl): Likewise. + (lookup_using_namespace): Likewise. + (qualified_lookup_using_namespace): Likewise. + (lookup_type_current_level): Likewise. + (unqualified_namespace_lookup): Likewise. + (namespace_ancestor): Likewise. + (push_using_directive): Likewise. + * decl.c (pushdecl): Move to name-lookup.c. + (pushdecl_top_level_1): Likewise. + (pushdecl_top_level): Likewise. + (pushdecl_top_level_and_finish): Likewise. + (maybe_push_decl): Likewise. + (push_using_decl): Likewise. + (push_overloaded_decl): Likewise. + (make_anon_name): Likewise. + (anon_cnt): Likewise. + (clear_anon_tags): Likewise. + (maybe_inject_for_scope_var): Likewise. + (check_for_out_of_scope_variable): Likewise. + * Make-lang.in (cp/name-lookup.o): Depend on flags.h. + * decl.c (warn_extern_redeclared_static): Export. + * cp-tree.h (warn_extern_redeclared_static): Declare. + +2003-10-14 Nathanael Nerode + + * Make-lang.in: Replace uses of $(target_alias) with + $(target_noncanonical). + +2003-10-13 Volker Reichelt + + * ChangeLog: Add PR number to patch for PR c++/12370. + +2003-10-13 Gabriel Dos Reis + + * name-lookup.h (cxx_scope_find_binding_for_name): Don't export. + (binding_for_name): Likewise. + (cxx_binding_clear): Move to name-lookup.c. + * name-lookup.c (cxx_scope_find_binding_for_name): Now static. + (binding_for_name): Likewise. + * decl2.c (is_ancestor): Move to name-lookup.c + (namespace_ancestor): Likewise. + (add_using_namespace): Likewise. + (ambiguous_decl): Likewise. + (lookup_using_namespace): Likewise. + (qualified_lookup_using_namespace): Likewise. + (set_decl_namespace): Likewise. + (decl_namespace): Likewise. + (current_decl_namespace): Likewise. + (push_decl_namespace): Likewise. + (pop_decl_namespace): Likewise. + (push_scope): Likewise. + (pop_scope): Likewise. + (struct arg_lookup): Likewise. + (arg_assoc): Likewise. + (arg_assoc_args): Likewise. + (arg_assoc_type): Likewise. + (add_function): Likewise. + (arg_assoc_namespace): Likewise. + (arg_assoc_class): Likewise. + (arg_assoc_template_arg): Likewise. + (do_namespace_alias): Likewise. + (validate_nonmember_using_decl): Likewise. + (do_nonmember_using_decl): Likewise. + (do_toplevel_using_decl): Likewise. + (do_local_using_decl): Likewise. + (do_class_using_decl): Likewise. + (do_using_directive): Likewise. + (constructor_name_full): Likewise. + (constructor_name): Likewise. + (constructor_name_p): Likewise. + +2003-10-13 Gabriel Dos Reis + + Break out decl.c (2/n) + * name-lookup.c: Include diagnostic.h + (cxx_binding_free): Make static. + (cxx_binding_make): Likewise. + (binding_table_new): Likewise + (binding_table_free): Likewise. + (binding_table_insert): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + (supplement_binding): Likewise. + * name-lookup.h (global_scope_name): Declare extern. + (global_type_node): Likewise. + (cxx_binding_free): Don't export. + (cxx_binding_make): Likewise. + (binding_table_new): Likewise. + (binding_table_free): Likewise. + (binding_table_insert): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) + * decl.c (lookup_namespace_name): Move to name-lookup.c + (select_decl): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_qualified_name): Likewise. + (lookup_name_real): Likewise. + (lookup_name_nonclass): Likewise. + (lookup_function_nonclass): Likewise. + (lookup_name): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (lookup_flags): Likewise. + (qualify_lookup): Likewise. + (lookup_tag): Likewise. + (lookup_tag_reverse): Likewise. + (getdecls): Likewise. + (storedecls): Remove. + (cxx_remember_type_decls): Move to name-lookup.c. + (global_bindings_p): Likewise. + (innermost_nonclass_level): Likewise. + (toplevel_bindings_p): Likewise. + (namespace_bindings_p): Likewise. + (kept_level_p): Likewise. + (innermost_scope_kind): Likewise. + (template_parm_scope_p): Likewise. + (push_binding): Likewise. + (push_local_binding): Likewise. + (add_decl_to_level): Likewise. Make extern. + (push_class_binding): Move to name-lookup.c. + (resume_level): Likewise. Rename to resume_scope. + (begin_scope): Move to name-lookup.c. + (indent): Likewise. + (binding_depth): Likewise. + (is_class_level): Likewise. + (cxx_scope_descriptor): Likewise. + (cxx_scope_debug): Likewise. + (namespace_scope_ht_size): Likewise. + (leave_scope): Likewise. + (pushlevel_class): Likewise. + (poplevel_class): Likewise. + (clear_identifier_class_values): Likewise. + (pushdecl_with_scope): Likewise. + (pushdecl_namespace_level): Likewise. + (pushdecl_class_level): Likewise. + (push_class_level_binding): Likewise. + (push_using_directive): Likewise. + (identifier_global_value): Likewise. + (keep_next_level_flag): Likewise. + (keep_next_level): Likewise. + (free_binding_level): Likewise. + (set_class_shadows): Likewise. + (maybe_push_cleanup_level): Likewise. + (cp_namespace_decls): Likewise. + (bt_print_entry): Likewise. + (print_binding_level): Likewise. + (print_other_binding_stack): Likewise. + (print_binding_stack): Likewise. + (push_namespace): Likewise. + (pop_namespace): Likewise. + (push_nested_namespace): Likewise. + (pop_nested_namespace): Likewise. + (cxx_saved_binding_make): Likewise. + (struct cxx_saved_binding_make): Likewise. + (store_bindings): Likewise. + (maybe_push_to_top_level): Likewise. + (push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (identifier_type_value): Likewise. + (set_identifier_type_value): Likewise. + (set_identifier_type_value_with_scope): Likewise. + (pop_everything): Likewise. + (pushtag): Likewise. + (follow_tag_typedef): Likewise. + (maybe_process_template_type_declaration): Likewise. + (pop_binding): Likewise. + * cp-tree.h: Move corresponding declarations to name-lookup.h + +2003-10-12 Steven Bosscher + + * cvt.c (ocp_convert): Move warning to C common code. + +2003-10-09 Jason Merrill + + PR c++/6392 + * tree.c (build_cplus_array_type): Handle all quals the same. + (cp_build_qualified_type_real): Look through arrays first. + + * tree.c (build_cplus_new): Use build_decl to create a VAR_DECL. + (build_target_expr_with_type): Likewise. + + * pt.c (instantiate_class_template): Sanity check that our + enclosing class has been instantiated. + +2003-10-08 Giovanni Bajo + + * cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS. + * error.c (dump_function_decl): Use it to skip the dump of the + arguments. + (dump_expr): When dumping a declaration found within an + expression, always set TFF_NO_FUNCTION_ARGUMENTS + in the flags. + +2003-10-08 Giovanni Bajo + + PR c++/11097 + * pt.c (tsubst_decl): Substitute also the DECL_NAME node of + USING_DECL. + +2003-10-06 Mark Mitchell + + PR c++/10147 + * call.c (initialize_reference): Tweak error message. + * cxx-pretty-print.h (cxx_pretty_printer_flags): Remove + pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope. + * cxx-pretty-print.c (pp_cxx_id_expression): Always display + qualified entities using qualified names. + + PR c++/12337 + * init.c (build_new_1): Make sure that the expression returned is + not an lvalue. + + PR c++/12344, c++/12236, c++/8656 + * decl.c (start_function): Do not ignore attributes embedded in a + function declarator. + +2003-10-06 Mark Mitchell + + * Make-lang.in (c++.info): Remove. + (c++.dvi): Remove. + (c++.generated-manpages): Replace with ... + (generated-manpages): ... this. + +2003-10-03 Gabriel Dos Reis + + * decl.c (struct cp_binding_level): Move to name-lookup.h + (current_binding_level): Likewise. + (class_binding_level): Likewise. + * cp-tree.h (enum scope_kind): Likewise. + +2003-10-03 Gabriel Dos Reis + + * name-lookup.c (binding_entry_free): Nullify name and type + fields. + +2003-10-02 Mark Mitchell + + PR c++/12486 + * typeck.c (finish_class_member_access_expr): Issue diagnostic + on erroneous use of qualified name. + +2003-09-30 Richard Henderson + + PR c++/12370 + * decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too. + +2003-09-30 Kelley Cook + + * g++spec.c: Convert to ISO C90 prototypes. + * parser.c: Likewise. + +2003-09-30 Gabriel Dos Reis + + * decl.c (pop_binding): Don't mess with nullifying binding->scope + here. + * name-lookup.c: Re-format. + (cxx_binding_free): Nullify binding->scope. + +2003-09-29 Jan Hubicka + + PR C++/12047 + * except.c (build_eh_type_type): Call mark_used on the type. + +2003-09-28 Richard Henderson + + * typeck.c (c_expand_asm_operands): Take location_t, instead of + individual file and line. + +2003-09-28 Andreas Jaeger + + * decl.c (cxx_builtin_type_decls): Convert to ISO C90 function + definition. + * init.c (push_base_cleanups): Likewise. + * decl2.c (finish_file): Likewise. + * mangle.c (init_mangle): Likewise. + (dump_substitution_candidates): Likewise. + * search.c: Likewise. + +2003-09-27 Gabriel Dos Reis + + * name-lookup.h (get_global_value_if_present): New function. + (is_typename_at_global_scope): Likewise. + * except.c (do_begin_catch): Use get_global_value_if_present. + (do_end_catch): Likewise. + (do_allocate_exception): Likewise. + (do_free_exception): Likewise. + (build_throw): Likewise. + * parser.c (cp_parser_member_declaration): Likewise. + * rtti.c (throw_bad_cast): Likewise. + (throw_bad_typeid): Likewise. + * decl.c (check_tag_decl): Use is_typename_at_global_scope. + (grokdeclarator): Likewise. + * cp-tree.h (global_namespace): Move to name-lookup.h + * call.c (call_builtin_trap): Tidy. + +2003-09-27 Kriang Lerdsuwanakij + + PR c++/11415 + * parser.c (cp_parser_nested_name_specifier_opt): Issue correct + error message when parser->scope is global_namespace. + +2003-09-27 Gabriel Dos Reis + + * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to + macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE. + +2003-09-26 Gabriel Dos Reis + + * decl.c (pop_binding_level, suspend_binding_level, + find_class_binding_level): Merge into leave_scope. Remove. + (leave_scope): New function. + (poplevel): Update. + (poplevel_class): Likewise. + (pop_namespace): Likewise. + +2003-09-25 Kriang Lerdsuwanakij + + PR c++/5655 + * parser.c (cp_parser_check_access_in_redeclaration): New function. + (cp_parser_member_declaration): Use it. + (cp_parser_template_declaration_after_export): Likewise. + +2003-09-22 Gabriel Dos Reis + + * cp-tree.h (scope_kind): Add new enumerator. + (keep_next_level): Change parameter type to bool. + (begin_scope): Change prototype. + (pushlevel): Remove declaration. + * decl.c (push_binding_level): Fold in begin_scope. Remove. + (struct cp_binding_level): Remove tag_tranparent field. Make keep + of bitsize one. + (keep_next_level_flag): Make a bool. + (cxx_scope_descriptor): Update scope names table + (make_cxx_scope): Fold in begin_scope. Remove.. + (namespace_scope_ht_size): New function. + (begin_scope): Change prototype. Return a scope. Tidy. + (kept_level_p): Update. + (pushlevel): Remove. + (maybe_push_cleanup_level): Simplify. + (poplevel): Update for sk_cleanup and keep change. + (print_binding_level): Likewise. + (initial_push_namespace_scope): Fold in begin_scope. Remove. + (push_namespace): Update. + (pushtag): Likewise. + (lookup_tag): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (cxx_init_decl_processing): Likewise. + (start_function): Likewise. + (begin_function_body): Likewise. + (start_method): Likewise. + * pt.c (push_inline_template_parms_recursive): Likewise. + (begin_template_parm_list): Likewise. + (begin_specialization): Likewise. + * semantics.c (do_pushlevel): Likewise. + (begin_compound_stmt): Likewise. + (begin_stmt_expr): Likewise. + +2003-09-21 Richard Henderson + + * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, + method.c, optimize.c, pt.c, semantics.c, tree.c: Revert. + +2003-09-21 Richard Henderson + + * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, + method.c, optimize.c, pt.c, semantics.c, tree.c: Update for + DECL_SOURCE_LOCATION rename and change to const. + +2003-09-20 Richard Henderson + + * decl.c, decl2.c, pt.c: Use %J in diagnostics. + +2003-09-20 Kriang Lerdsuwanakij + + PR c++/157 + * parser.c (cp_parser_direct_declarator): Clear + parser->num_template_parameter_lists when parsing function + parameters. + (cp_parser_constructor_declarator_p): Likewise. + +2003-09-19 Kriang Lerdsuwanakij + + PR c++/495 + * pt.c (tsubst_friend_class): Only use innermost template + arguments for the injected friend class template. + +2003-09-19 Nathan Sidwell + + PR c++/12332 + * pt.c (instantiate_class_template): Increment + processing_template_decl around the tsubst of a template member + function. + +2003-09-19 Gabriel Dos Reis + + * decl.c (cxx_scope_descriptor): Fix thinko. + (struct cp_binding_level): Adjust type of binding_depth field. + +2003-09-18 Danny Smith + + PR c++/12320 + * call.c (type_passed_as): Check for incomplete type. + (convert_for_arg_passing): Likewise. + +2003-09-18 Nathan Sidwell + + PR c++/9848 + * optimize.c (maybe_clone_body): Don't set MARK_USED on parameters + here. + * semantics.c (expand_body): Set it here on the remaining clones. + +2003-09-18 Roger Sayle + + * lex.c (init_operators): Remove operator_name_info for FFS_EXPR. + * class.c (instantiate_type): Remove FFS_EXPR case. + +2003-09-18 Volker Reichelt + + * ChangeLog: Fix recent commit. + +2003-09-18 Volker Reichelt + + * ChangeLog: Add PR number to patch for PR c++/12316. + +2003-09-18 Gabriel Dos Reis + + * error.c (dump_type): Simplify. Use pp_type_specifier_seq for + "C" types. + * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko. + +2003-09-17 Richard Henderson + + * semantics.c (expand_body): Don't save/restore input_location. + +2003-09-17 Mark Mitchell + + PR c++/12266 + * cp-tree.h (tsubst_flags_t): Add tf_conv. + * class.c (standard_conversion): Pass tf_conv to + instantiate_type. + (resolve_address_of_overloaded_function): Do not call mark_used + when just checking conversions. + + PR debug/12066 + * cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define. + * cp-tree.h (cxx_builtin_type_decls): Declare. + * decl.c (builtin_type_decls): New variables. + (cxx_builtin_type_decls): New function. + (record_builtin_type): Add to builtin_type_decls. + +2003-09-17 Richard Henderson + + PR c++/12316 + * semantics.c (expand_or_defer_fn): Inc/dec function_depth. + +2003-09-16 Kriang Lerdsuwanakij + + PR c++/7939 + * typeck.c (comptypes): Don't ICE when its first argument is + error_mark_node. + (compparms): Reverse the arguments of same_type_p. + +2003-09-15 Nathan Sidwell + + PR c++/12184 + * typeck.c (convert_arguments): Return error_mark_node for an + incomplete parameter. Make error message more informative. + +2003-09-12 Mark Mitchell + + PR c++/3907 + * class.c (maybe_note_name_used_in_class): Refine test for whether + or not we are in a class scope. + + * cp-tree.h (language_function): Remove x_expanding_p. + (expanding_p): Remove. + (doing_semantic_analysis_p): Remove. + (scope_kind): Add sk_function_parms, sk_class, + sk_namespace. + (innermost_scope_kind): New method. + * call.c (cxx_type_promotes_to): Use type_decays_to. + * cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine. + (LANG_HOOKS_POPLEVEL): Likewise. + * decl.c (cp_binding_level): Remove parm_flag, template_parms_p, + template_spec_p, namespace_p, is_for_scope, is_try_scope, and + is_catch_scope. Add kind and explicit_spec_p. + (cxx_scope_descriptor): Use a lookup table. + (find_class_binding_level): Use "kind" field in binding_level, not + the various flags. + (pop_binding_level): Likewise. + (innermost_nonclass_level): Likewise. + (toplevel_bindings_p): Likewise. + (namespace_bindings_p): Likewise. + (template_parm_scope_p): Likewise. + (innermost_scope_kind): New method. + (current_tmpl_spec_kind): Use "kind" field in binding_level, not + the various flags. + (pushlevel): Remove check for doing_semantic_analysis_p. + (begin_scope): Simplify. + (add_decl_to_level): Use "kind" field in binding_level, not + the various flags. + (push_local_binding): Likewise. + (pop_label): Remove check for doing_semantic_analysis_p. + (poplevel): Use "kind" field in binding_level, not + the various flags. + (set_block): Remove check for doing_semantic_analysis_p. + (pushlevel_class): Use "kind" field in binding_level, not + the various flags. + (poplevel_class): Likewise. + (initial_push_namespace_scope): Likewise. + (maybe_push_to_top_level): Likewise. + (set_identifier_type_value_with_scope): Likewise. + (pop_everything): Likewise. + (maybe_process_template_type_declaration): Likewise. + (pushtag): Likewise. + (pushdecl): Likewise. + (pushdecl_with_scope): Likewise. + (check_previous_goto_1): Likewise. + (define_label): Likewise. + (finish_case_label): Likewise. + (lookup_tag): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_name_real): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (record_builtin_type): Likewise. + (cp_make_fname_decl): Likewise. + (maybe_inject_for_scope_var): Likewise. + (cp_finish_decl): Remove check for doing_semantic_analysis_p. + (start_function): Use begin_scope, not pushlevel. + (finish_function): Use "kind" field in binding_level, not + the various flags. + (start_method): Use begin_scope, not pushlevel. + (make_label_decl): Do not check expanding_p. + (save_function-data): Do not set expanding_p. + (cxx_push_function_context): Do not clear expanding_p. + * semantics.c (cxx_expand_function_start): Do not set expanding_p. + +2003-09-14 Mark Mitchell + + * class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for + an bit-field whose width exceeds that of its type. + +2003-09-14 Geoffrey Keating + + * rtti.c (get_tinfo_decl): Set TREE_PUBLIC for typeinfo decls. + +2003-09-14 Kazu Hirata + + * ChangeLog: Follow spelling conventions. + * parser.c: Likewise. + +2003-09-13 Richard Henderson + + * decl2.c (finish_file): Check cgraph_assemble_pending_functions + during relaxation loop. + +2003-09-11 David Edelsohn + + * decl2.c (var_finalized_p): Swap arms of conditional. + +2003-09-10 Nathan Sidwell + + PR c++/11788 + * typeck.c (build_address): If it is a function, mark it used. + (build_unary_op): Do not lose object's side-effects when taking + address of static member function. + * class.c (resolve_address_of_overloaded_function): Use + tsubst_flags_t parameter. Only expect overload sets. Adjust. + (instantiate_type): Adjust flags passing. Do not lose object's + side-effects when taking address of static member function. + +2003-09-11 Richard Henderson + + * semantics.c (expand_or_defer_fn): Update for new + cgraph_finalize_function argument. + +2003-09-10 Richard Henderson + + * decl2.c (cxx_callgraph_analyze_expr): Mark argument unused. + +2003-09-10 Jan Hubicka + + * decl2.c (var_finalized_p): New. + (maybe_emit_vtables, write_out_vars, finish_file): Use it. + +2003-09-10 Richard Henderson + + * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of + mark_member_pointers. + (lower_function): Remove. + * cp-tree.h: Update to match. + * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New. + (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove. + +2003-09-09 Richard Henderson + + * semantics.c (expand_or_defer_fn): Update call to + cgraph_finalize_function. + + * semantics.c (expand_or_defer_fn): Use cgraph_finalize_function + always. + + * decl2.c (finish_file): Avoid out-of-bounds array reference + during memmove. + +2003-09-09 Richard Henderson + + * decl2.c (mark_member_pointers): Rename from + mark_member_pointers_and_eh_handlers and don't check eh handlers. + +2003-09-09 Christian Ehrhardt + + PR bootstrap/12168 + * method.c (use_thunk): Clear DECL_RTL of copied nodes. + +2003-09-08 Mark Mitchell + + * cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to + c_register_builtin_type. + + PR c++/11786 + * decl2.c (add_function): Do not complain about seeing the same + non-function twice. + * semantics.c (perform_koenig_lookup): Improve documentation. + + PR c++/5296 + * pt.c (try_one_overload): Add addr_p parameter. + (resolve_overloaded_unification): Pass it. + +2003-09-08 Richard Henderson + + * optimize.c (maybe_clone_body): Inc/dec function_depth. + +2003-09-08 Richard Henderson + + * decl.c (finish_function): Clear current_function_decl. + * decl2.c (mark_used): Don't push/pop gc context. + * optimize.c (optimize_function): Likewise. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + * pt.c (instantiate_decl): Inc/dec function_depth instead. + * semantics.c (expand_body): Update for tree_rest_of_compilation + nested argument. + +2003-09-07 Gabriel Dos Reis + + PR c++/11762 + * error.c (dump_decl): Handle namespace-alias-definition. + * decl.c (warn_extern_redeclared_static): There is no point in + checking changes in storage class specifier for a namespace + declaration. + (duplicate_decls): Tidy diagnostic message. + * cxx-pretty-print.c (pp_cxx_left_brace): New macro. + (pp_cxx_right_brace): Likewise. + (pp_cxx_original_namespace_definition): New function. + (pp_cxx_namespace_alias_definition): Likewise. + (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs. + +2003-09-07 Jan Hubicka + + * decl2.c (maybe_emit_vtables, write_out_vars, finish_file): + Avoid re-emitting variables in unit-at-a-time mode. + +2003-09-06 Mark Mitchell + + PR c++/11867 + * call.c (standard_conversion): Improve comments. + (perform_direct_initialization): Make sure we return an expression + of the correct type. + * typeck.c (build_static_cast): Check for ambiguity and + accessibility when performing conversions. + +2003-09-06 Gabriel Dos Reis + + * cp-tree.h (add_binding): Remove declaration. + * name-lookup.h (supplement_binding): Declare. + * decl.c (add_binding): Move to name-lookup.c. + (push_local_binding): Adjust. + (push_class_binding): Likewise. + (set_identifier_type_value_with_scope): Likewise. + * name-lookup.c (supplement_binding): Rename from add_binding. + Return a bool. Improve documentation. + (set_namespace_binding): Adjust. + * Make-lang.in (cp/name-lookup.o): Depend on toplev.h + +2003-09-06 Nathan Sidwell + + PR c++/11794 + * class.c (pushclass): Push dependent using decls for nested + classes of templates too. + +2003-09-06 Roger Sayle + + PR c++/11409 + * class.c (resolve_address_of_overloaded_function): When building + list of matching non-template function decls, ignore anticipated + declarations of undeclared or shadowed GCC builtins. + +2003-09-06 Steven Bosscher + + PR c++/11595 + * decl.c (define_label): Remove unreachable timevar pop. + Always return the decl, even if the definition is invalid. + +2003-09-06 Nathan Sidwell + + PR c++/12167 + * parser.c (cp_parser_late_parsing_default_args): Push & pop the + unparsed functions queue. + +2003-09-05 Mark Mitchell + + PR c++/12163 + * call.c (perform_direct_initialization): Correct logic for + direct-initialization of a class type. + + PR c++/12146 + * pt.c (lookup_template_function): Robustify. + +2003-09-05 Nathan Sidwell + + PR c++/11922 + * pt.c (tsubst_qualified_id): Make sure we get a non-type. + (tsubst_expr, tsubst_copy_and_build): Pass false, not zero, as + is_type_p to lookup_qualified_name. + + * semantics.c (finish_call_expr): Refactor some code. + + PR c++/12037 + * cp-tree.h (COMPOUND_EXPR_OVERLOADED): New. + (build_min_non_dep): Declare. + * tree.c (build_min): Propagate TREE_SIDE_EFFECTS. + (build_min_non_dep): New. + * cvt.c (convert_to_void): Don't explicitly copy + TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING. + * call.c (build_new_method_call): Use build_min_non_dep. + * decl2.c (grok_array_decl): Likewise. + (build_offset_ref_call_from_tree): Likewise. + * typeck.c (finish_class_member_access_expr, + build_x_indirect_ref, build_x_binary_op, build_x_unary_op, + build_x_conditional_expr, build_x_compound_expr): Likewise. + (build_static_cast, build_reinterpret_cast, + build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template. + * typeck2.c (build_x_arrow): Use build_min_non_dep. + (build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a + template. + * rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE. + (build_dynamic_cast): Set TREE_SIDE_EFFECTS. + * pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED. + +2003-09-04 Richard Henderson + + * decl2.c (mark_member_pointers_and_eh_handlers): Update for + change in cgraph_mark_needed_node arguments. + +2003-09-02 Geoffrey Keating + + PR 12161 + * decl2.c (mark_used): Use ggc_push_context/ggc_pop_context. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + +2003-09-04 Nathan Sidwell + + * cp-tree.h (finish_sizeof, finish_alignof): Remove. + (expr_sizeof): Replace with ... + (cxx_sizeof_or_alignof_expr): ... here. + (cxx_sizeof_or_alignof_type): Make complain parameter a bool. + * parser.c (cp_parser_unary_expression): Commonize alignof and + sizeof handling. + * pt.c (tsubst_copy_and_build): Adjust alignof and sizeof + substitution. + * semantics.c (finish_sizeof, finish_alignof): Remove. + * typeck.c (cxx_sizeof_or_alignof_type): Complain parameter + becomes bool. Set TREE_READONLY. + (expr_sizeof): Replace with ... + (cxx_sizeof_or_alignof_expr): ... here. Clear TREE_SIDE_EFFECTS. + +2003-09-04 Mark Mitchell + + Remove cast-as-lvalue extension. + * call.c (build_conditional_expr): Correct formatting. + (convert_like_real): Use lvalue_p, not non_cast_lvalue_p. + (initialize_real): Use real_lvalue_p, not real_non_cast_lvalue_p. + * cp-tree.h (non_cast_lvalue_p): Remove. + (real_non_cast_lvalue_p): Remove. + (non_cast_lvalue_or_else): Remove. + * tree.c (lvalue_p_1): Remove allow_cast_as_lvalue parameter. + (real_lvalue_p): Adjust call to lvalue_p_1. + (non_cast_lvalue_p): Remove. + (non_cast_lvalue_or_else): Remove. + (lvalue_p): Adjust call to lvalue_p_1. + (lvalue_or_else): Simplify. + * typeck.c (build_unary_op): Use lvalue_or_else, not + non_cast_lvalue_or_else. + (build_static_cast): Use real_lvalue_p, not real_non_cast_lvalue_p. + +2003-09-03 DJ Delorie + + * decl.c (finish_function): Pass fndecl to aggregate_value_p. + +2003-09-03 Mark Mitchell + + PR c++/12053 + * class.c (include_empty_classes): Correct logic for ABI version 1. + +2003-09-03 Richard Henderson + + * optimize.c (optimize_function): Push/pop ggc context around + the call to optimize_inline_calls. + +2003-09-02 Scott Brumbaugh + + PR c++/11553 + * parser.c (cp_parser_decl_specifier_seq): Add check for a + duplicate friend decl-specifier. + +2003-09-02 Mark Mitchell + + PR c++/11847 + * pt.c (convert_nontype_argument): Correct representation of + REFERENCE_TYPE expressions. + + PR c++/11808 + * cp-tree.h (KOENIG_LOOKUP_P): New macro. + (finish_call_expr): Change prototype. + * parser.c (cp_parser_postfix_expression): Adjust call to + finish_call_expr. + * pt.c (tsubst_copy_and_build): Use KOENIG_LOOKUP_P. + * semantics.c (finish_call_expr): Add koenig_p parameter. + +2003-09-01 Mark Mitchell + + PR c++/12114 + * cp-tree.h (initialize_reference): Change prototype. + * call.c (initialize_reference): Add cleanup parameter. + * decl.c (grok_reference_init): Likewise. + (check_initializer): Likewise. + (cp_finish_decl): Insert a CLEANUP_STMT if necessary. + (duplicate_decls): When replacing an anticipated builtin, do not + honor TREE_NOTHROW. + * typeck.c (convert_for_initialization): Correct call to + initialize_reference. + + PR c++/11972 + * pt.c (dependent_type_p_r): Pass only the innermost template + arguments to any_dependent_template_arguments_p. + +2003-09-01 Josef Zlomek + + * error.c (dump_expr): Kill BIT_ANDTC_EXPR. + * lex.c (init_operators): Kill BIT_ANDTC_EXPR. + * pt.c (tsubst_copy): Kill BIT_ANDTC_EXPR. + * typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. + (tsubst_copy_and_build): Kill BIT_ANDTC_EXPR. + +2003-08-29 Mark Mitchell + + PR c++/12093 + * pt.c (build_non_dependent_expr): Do not build a + NON_DEPENDENT_EXPR for a STRING_CST. + + PR c++/11928 + * search.c (add_conversions): Avoid adding two conversion + operators for the same type. + +2003-08-29 Mark Mitchell + + PR c++/6196 + * pt.c (tsubst_copy_and_build): Correct handling of + address-of-label extension. + * semantics.c (finish_goto_stmt): The address of a label must go + through the lvalue-to-rvalue conversion. + +2003-08-29 Richard Henderson + Jason Merrill + + * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New. + (LANG_HOOKS_RTL_EXPAND_STMT): New. + * cp-tree.h (cxx_expand_function_start): Declare. + * decl.c (start_function): Use allocate_struct_function. + Move stmts_are_full_exprs_p assertion from expand_body. + Do not free_after_parsing or free_after_compilation. + (cxx_push_function_context): Move code to set struct function + data from genrtl_start_function. + * optimize.c (optimize_function): Don't inc/dec function_depth. + * semantics.c (expand_body): Use tree_rest_of_compilation. + (cxx_expand_function_start): Rename from genrtl_start_function, + omit bits done by tree_rest_of_compilation. + (genrtl_finish_function): Remove. + (clear_decl_rtl): Move to ../tree-optimize.c. + +2003-08-29 Gabriel Dos Reis + + PR c++/11811 + * cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New + function. + * cxx-pretty-print.h: Declare. + * error.c (dump_template_parameter): Use it. + (dump_type): Likewise. + +2003-08-28 Mark Mitchell + + * init.c (decl_constant_value): Deal with COND_EXPR specially. + * call.c (build_conditional_expr): Revert previous patch. + + PR optimization/5079 + * call.c (build_conditional_expr): Use decl_constant_value to + simplify the arguments. + +2003-08-26 Dan Nicolaescu + + * parser.c (struct cp_token): Use enum bitfields. + (CP_TOKEN_BLOCK_NUM_TOKENS): Make sure cp_token_block fits in a + 512B allocation unit. + (cp_parser_token_tree_map_node): Use enum bitfields. + +2003-08-26 Nathan Sidwell + + PR c++/11871 + * decl.c (push_class_level_binding): Correct old_decl value from + my 2003-07-29 reorganization. + + * call.c (build_call): Don't set TREE_SIDE_EFFECTS here. + (build_new_method_call): Add goto finish. + * semantics.c (simplify_aggr_init_exprs_r): Don't set + TREE_SIDE_EFFECTS on a call. + +2003-08-25 Richard Henderson + + * cxx-pretty-print.c (pp_cxx_class_name): Remove unused function. + +2003-08-25 Gabriel Dos Reis + + * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. + (cxx_pretty_printer): Adjust base type. + (pp_cxx_function_specifier): Declare. + * cxx-pretty-print.c (pp_cxx_whitespace): New macro. + (pp_cxx_left_paren): Likewise. + (pp_cxx_right_paren): Likewise. + (pp_cxx_dot): Likewise. + (pp_cxx_arrow): Likewise. + (pp_cxx_semicolon): Likewise. + (pp_cxx_identifier): Likewise. + (pp_cxx_cv_qualifier_seq): Likewise. + (pp_cxx_storage_class_specifier): Likewise. + (pp_cxx_expression_list): Likewise. + (pp_cxx_space_for_pointer_operator): Likewise. + (pp_cxx_init_declarator): Likewise. + (pp_cxx_call_argument_list): Likewise. + (pp_cxx_nonconsecutive_character): Tidy. + (pp_cxx_conversion_function_id): New function. + (pp_cxx_template_id): Likewise. + (pp_cxx_template_keyword_if_needed): Likewise. + (pp_cxx_nested_name_specifier): Likewise. + (pp_cxx_unqualified_id): Tidy + (pp_cxx_qualified_id): Handle more nodes. + (pp_cxx_primary_expression): Tidy. + (pp_cxx_postfix_expression): Likewise. + (pp_cxx_new_expression): Tidy. + (pp_cxx_delete_expression): Likewise. + (pp_cxx_cast_expression): New function. + (pp_cxx_pm_expression): Tidy. + (pp_cxx_conditional_expression): Likewise. + (pp_cxx_assignment_operator): New function. + (pp_cxx_assignment_expression): Tidy. + (pp_cxx_expression): New function. + (pp_cxx_function_specifier): Likewise. + (pp_cxx_decl_specifier_seq): Likewise. + (pp_cxx_simple_type_specifier): Tidy. + (pp_cxx_type_specifier_seq): Likewise. + (pp_cxx_ptr_operator): New function. + (pp_cxx_implicit_parameter_type): Likewise. + (pp_cxx_parameter_declaration): Tidy. + (pp_cxx_parameter_declaration_clause): New function. + (pp_cxx_exception_specification): Likewise. + (pp_cxx_direct_declarator): Tidy. + (pp_cxx_declarator): Likewise. + (pp_cxx_ctor_initializer): New function. + (pp_cxx_function_definition): Likewise. + (pp_cxx_abstract_declarator): Tidy. + (pp_cxx_direct_abstract_declarator): Likewise. + (pp_cxx_type_id): Likewise. + (pp_cxx_exception_declaration): New function. + (pp_cxx_statement): Likewise. + (pp_cxx_simple_declaration): Likewise. + (pp_cxx_template_parameter_list): Likewise. + (pp_cxx_template_parameter): Likewise. + (pp_cxx_template_declaration): Likewise. + (pp_cxx_explicit_specialization): Likewise. + (pp_cxx_explicit_instantiation): Likewise. + (pp_cxx_declaration): Tidy. + (pp_cxx_pretty_printer_init): Initialize more fields. + +2003-08-25 Mark Mitchell + + PR c++/8795 + * cp-tree.h (build_cplus_method_type): Remove. + * call.c (standard_conversion): Use build_method_type_directly + instead of build_cplus_method_type. + * class.c (build_clone): Likewise. + (adjust_clone_args): Likewise. + * decl.c (build_ptrmem_type): Likewise. + (grokdeclarator): Likewise. + (check_function_type): Likewise. + * decl2.c (grok_method_quals): Likewise. + (maybe_retrofit_in_chrg): Likewise. + * pt.c (copy_default_args_to_explicit_spec): Likewise. + (tsubst_function_type): Likewise. + (tsubst): Likewise. + * tree.c (build_cplus_method_type): Remove. + * typeck.c (merge_types): Use build_method_type_directly. + +2003-08-23 Kriang Lerdsuwanakij + + PR c++/3765 + * search.c (dfs_access_in_type): Fix typo in comment. + (dfs_accessible_queue_p): Likewise. + (dfs_accessible_p): Only terminate when a friend is found. + (accessible_p): Return immediately if access_in_type allows + access. + +2003-08-23 Kriang Lerdsuwanakij + + PR c++/641, c++/11876 + * friend.c (add_friend): Add complain parameter. + (make_friend_class): Likewise. + (do_friend): Adjust add_friend call. + * decl.c (grokdeclarator): Adjust make_friend_class call. + * parser.c (cp_parser_member_declaration): Likewise. + (cp_parser_template_declaration_after_export): Likewise. + * pt.c (instantiate_class_template): Adjust make_friend_class + and add_friend call. + * cp-tree.h (make_friend_class): Adjust declaration. + (add_friend): Likewise. + +2003-08-21 Jason Merrill + + PR c++/11283 + * call.c (build_conditional_expr): Ignore cv-qual differences for + non-class types. + +2003-08-21 Mark Mitchell + + PR c++/11551 + * parser.c (cp_parser_id_expression): Add declarator_p parameter. + (cp_parser_primary_expression): Adjust call to + cp_parser_id_expression. + (cp_parser_unqualified_id): Complain about the use of + typedef-names in a destructor declarator. + (cp_parser_postfix_expression): Adjust call to + cp_parser_id_expression. + (cp_parser_type_parameter): Likewise. + (cp_parser_template_argument): Likewise. + (cp_parser_declarator_id): Likewise. + + PR c++/11919 + * call.c (standard_conversion): Use same_type_p, not pointer + equality, to compare types. + + PR c++/10762 + * parser.c (cp_parser_using_declaration): Check for invalid uses + of template-ids here... + * decl2.c (do_class_using_decl): ... rather than here. + +2003-08-20 Mark Mitchell + + PR c++/11834 + * pt.c (more_specialized): Bump processing_template_decl. + +2003-08-21 Jason Merrill + + PR c++/11614 + * decl.c (grokdeclarator): Recognize a flexible array based on the + type, not the form of the declarator. + +2003-08-20 Jason Merrill + + * semantics.c (simplify_aggr_init_expr): Split out from + simplify_aggr_init_exprs_r. Convert slot address to match + the return type. + * cp-tree.h: Declare it. + * tree.c (cp_copy_res_decl_for_inlining): Don't clobber the + DECL_NAME of a user variable. + +2003-08-20 Nathan Sidwell + + PR c++/11945 + * pt.c (build_non_dependent_expr): Look inside COND_EXPR and + COMPOUND_EXPR. + * semantics.c (finish_expr_stmt): Always convert to void. + * typeck.c (build_x_compound_exp): Always convert to void. + +2003-08-19 Mark Mitchell + + PR c++/11684 + * cp-tree.h (grok_op_properties): Change prototype. + * decl.c (grok_op_properties): Add complain parameter. + (grokfndecl): Pass it. + * pt.c (tsubst_decl): Adjust accordingly. + + PR c++/10926 + * decl.c (start_method): Return immediately if push_template_decl + does not like the declaration. + * pt.c (push_template_decl_real): Disallow member template + destructors. + + PR c++/11036 + * cp-tree.h (add_binding): Add prototype. + * class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate. + (maybe_warn_about_overly_private_class): Use + CLASSTYPE_DESTRUCTORS. + (pushclass): Adjust call to set_identifier_type_value. + * decl.c (add_binding): Give it external linkage. + (push_local_binding): Adjust call to add_binding. + (push_class_binding): Likewise. + (set_identifier_type_value_with_scope): Change prototype. Use + add_binding for global bindings. + (set_identifier_type_value): Adjust accordingly. + (pushtag): Likewise. + (pushdecl): Use set_identifier_type_value, not + set_identifier_type_value_with_scope. + (pushdecl_namespace_level): Adjust calls to + SET_IDENTIFIER_TYPE_VALUE to pass a DECL. + (pushdecl_class_level): Likewise. + (lookup_tag): Use select_decl. + (select_decl): Improve comment. + (record_builtin_type): Do not call pushdecl. + (cxx_init_decl_processing): Do not call xref_tag for bad_alloc. + (cp_finish_decl): Adjust call to set_identifier_type_value. + (check_elaborated_type_specifier): Improve checks for invalid uses + of typedefs. + (xref_tag): Adjust call to check_elaborated_type_specifier. + * decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR. + * name-lookup.c (set_namespace_binding): Use add_binding. + * parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL, + rather than an IDENTIFIER_NODE, to represent built-in types, if + requested by the caller. + (cp_parser_postfix_expression): Adjust call. + (cp_parser_type_specifier): Likewise. + (cp_parser_elaborated_type_specifier): Adjust call to + check_elaborated_type_specifier. + * typeck2.c (build_functional_cast): Do not perform name lookups. + + PR c++/10717 + * decl.c (expand_static_init): Remove unnecessary code. + +2003-08-19 Andrew Pinski + + PR c++/10538, PR c/5582 + * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define. + +2003-08-19 Kriang Lerdsuwanakij + + PR c++/11174 + * init.c (build_offset_ref): Perform access checking for + pointer to member correctly. + +2003-08-19 Gabriel Dos Reis + + * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling. + +2003-08-18 Nathan Sidwell + + PR c++/11957 + * cp-tree.h (finish_stmt_expr): Add bool parameter. + * init.c (finish_init_stmts): Pass true to finish_stmt_expr. Don't + adjust the stmt_expr here. + (build_vec_init): Use finish_stmt_expr_expr, convert result to + array type. + * parser.c (cp_parser_primar_expression): Adjust finish_stmt_expr + call. + * pt.c (tsubst_copy): Likewise. + * semantics.c (finish_stmt_expr): Add parameter. + + * pt.c (instantiate_class_template): Push to class's scope before + tsubsting base. + +2003-08-17 Jan Hubicka + + PR C++/11702 + * semantics.c (finish_id_expression): Mark all functions as used. + +2003-08-16 Nathan Sidwell + + PR c++/11512 + * cvt.c (convert_to_void): Indicate which side of conditional has + no effects, and rhs of comma operator. Test for no sideeffect + expressions here and always build a convert expr. + * init.c (expand_default_init): Convert the init to void. + * typeck.c (build_x_compound_expr): Do not check for side effects + here. + (build_compound_expr): Do not convert lhs when building a + template. + +2003-08-15 Nathan Sidwell + + * cp-tree.def (NON_DEPENDENT_EXPR): Add operand. + * decl2.c (build_offset_ref_call_from_tree): Use + build_non_dependent_expr. + * error.c (dump_expr) : Dump the operand. + * pt.c (build_non_dependent_expr): Set operand. + +2003-08-14 Jan Hubicka + + * decl2.c (mark_member_pointers): Rename to... + (mark_member_pointers_and_eh_tinfos): ... this one; deal with eh tinfos + (lower_function): Update call. + * except.c (eh_type_info): Break out from ... + (build_eh_type): ... here; tinfo is already used. + (finish_eh_spec_block): Mark tinfos as used. + * semantics.c (finish_handler_params): Mark tinfo as used. + * cp-tree.h (eh_type_info): Declare. + +2003-08-15 Nathan Sidwell + + * pt.c (instantiate_class_template): Set location before + substuting bases. + + * decl.c (make_typename_type): Use my_friendly_assert. + * pt.c (tsubst_aggr_type): Rearrange context substitution. + +2003-08-14 Jan Hubicka + + * method.c (use_thunk): Expand body directly. + +2003-08-12 Mark Mitchell + + PR c++/11703 + * call.c (type_passed_as): Use TYPE_SIZE, not TYPE_PRECISION to + determine whether or not to promote types. + (convert_for_arg_passing): Likewise. + * decl2.c (cp_build_parm_decl): Do not set DECL_ARG_TYPE in + templates. + * pt.c (tsubst_decl): Do not expect it to be set. + + PR c++/9512 + PR c++/10923 + * cp-tree.h (check_elaborated_type_specifier): Declare. + (handle_class_head): Remove. + (note_got_semicolon): Likewise. + (note_list_got_semicolon): Likewise. + (finish_class_definition): Likewise. + * decl.c (check_elaborated_type_specifier): Make it public. + Robustify. + (handle_class_head): Remove. + * parser.c (cp_parser_elaborated_type_specifier): Use + check_elaborated_type_specifier. + (cp_parser_class_specifier): Do not call finish_class_definition. + (cp_parser_class_head): Or handle_class_head. Check for + over-qualified names. + * semantics.c (finish_class_definition): Remove. + + * parser.c (cp_parser_check_for_definition_in_return_type): New + function. + (cp_parser_simple_declaration): Adjust call to + cp_parser_init_declarator. + (cp_parser_decl_specifier_seq): Change type of + declares_class_or_enum parameter. + (cp_parser_explicit_instantiation): Adjust accordingly. + (cp_parser_type_specifier): Change type of + declares_class_or_enum parameter. + (cp_parser_init_declarator): Add declares_class_or_enum + parameter. + (cp_parser_parameter_declaration): Adjust call to + cp_parser_decl_specifier_seq. + (cp_parser_function_definition): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_single_declaration): Likewise. + + * cp-tree.h (lang_type_class): Remove has_call_overloaded, + has_array_ref_overloaded, has_arrow_overloaded, and got_semicolon. + (TYPE_OVERLOADS_CALL_EXPR): Remove. + (TYPE_OVERLOADS_ARRAY_REF): Likewise. + (TYPE_OVERLOADS_ARROW): Likewise. + (CLASSTYPE_GOT_SEMICOLON): Likewise. + * class.c (check_bases): Do not set them. + (finish_struct_1): Likewise. + * decl.c (cp_finish_decl): Do not set CLASSTYPE_GOT_SEMICOLON. + (build_ptrmemfunc_type): Likewise. + (grok_op_properties): Do not set TYPE_OVERLOADS_*. + (start_function): Do not check CLASSTYPE_GOT_SEMICOLON. + * decl2.c (grokfield): Do not set CLASSTYPE_GOT_SEMICOLON. + * lex.c (note_got_semicolon): Remove. + (note_list_got_semicolon): Likewise. + * parser.c (cp_parser_simple_declaration): Do not call + note_list_got_semicolon. + * pt.c (list_eq): Remove. + (lookup_template_class): Do not set CLASSTYPE_GOT_SEMICOLON. + (instantiate_class_template): Do not set TYPE_OVERLOADS*. + (instantiate_class_template): Do not set CLASSTYPE_GOT_SEMICOLON. + * ptree.c (cxx_print_type): Do not print them. + * semantics.c (finish_member_class_template): Do not call + note_list_got_semicolon. + +2003-08-11 Aldy Hernandez + + * call.c (standard_conversion): Opaque pointers interconvert. + + * testsuite/g++.dg/other/opaque-3.C: New. + +2003-08-11 Mark Mitchell + + * typeck.c (merge_types): Handle cv-qualified pointer-to-member + types correctly. + +2003-08-10 Mark Mitchell + + PR c++/11789 + * cp-tree.h (get_vbase): Remove. + (get_vbase_types): Remove. + * init.c (expand_member_init): Correct logic for looking up base + classes. + +2003-08-10 Gabriel Dos Reis + + * error.c (dump_expr): Tidy. + * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. + (pp_cxx_begin_template_argument_list): Likewise. + (pp_cxx_end_template_argument_list): Likewise. + (is_destructor_name): Likewise. + (pp_cxx_unqualified_id): Likewise. + (pp_cxx_qualified_id): Likewise. + (pp_cxx_id_expression): Likewise. + (pp_cxx_new_expression): Likewise. + (pp_cxx_delete_expression): Likewise. + (pp_cxx_pm_expression): Likewise. + (pp_cxx_type_specifier): Rework. + (pp_cxx_type_id): Likewise. + (pp_cxx_primary_expression): Likewise. + (pp_cxx_postfix_expression): Likewise. + (pp_cxx_unary_expression): Likewise. + (pp_cxx_multiplicative_expression): Likewise. + (pp_cxx_conditional_expression): Likewise. + (pp_cxx_assignment_expression): Likewise. + (pp_cxx_pretty_printer_init): Tidy. + +2003-08-10 Nathan Sidwell + + * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL + NODE is always a TREE_VEC of nonzero size. + (NUM_TMPL_ARGS): NODE is always a TREE_VEC. + * decl2.c (arg_assoc): Template args will be a vec. + * error.c (dump_decl) : Call + dump_template_argument_list. + (dump_template_parms): Args will be a vec. + * parser.c (cp_parser_template_argument_list): Produce a + vector, not a list. + * pt.c (coerce_template_parms): Args are always vectors. + (mangle_class_name_for_template): Likewise. + (lookup_template_function): Likewise. + (lookup_template_class): Likewise. + (tsubst_template_args): Likewise. + (tsubst_baselink): Use tsubst_template_args. + (tsubst_qualified_id): Likewise. + (tsubst_copy) : Likewise. + (tsubst_copy_and_build) : Likewise. + (any_dependent_template_args_p): Args are always vectors. + * tree.c (cp_tree_equal): Add TEMPLATE_ID_EXPR case. + + PR c++/11670 + * call.c (convert_like_real): Add rvalue binding error message. + * error.c (dump_expr) : Detect when the no expr is + really a cast. + + PR c++/10530 + * pt.c (dependent_type_p_r): A dependent template-id is a class + type with dependent template arguments, or a bound template + template parameter. + (type_dependent_expression_p): A template function decl cannot + have a dependent context. + +2003-08-07 Kriang Lerdsuwanakij + + PR c++/5767 + * parser.c (cp_parser_class_name): Return immediately when scope + is error_mark_node. + +2003-08-07 Aldy Hernandez + + * cp/Make-lang.in (cp/call.o): Add dependency for target.h. + + * cp/call.c (standard_conversion): Support opaque types. + Include target.h. + (strip_top_quals): Use cp_build_qualified_type instead of + TYPE_MAIN_VARIANT. + + * cp/typeck.c (convert_for_assignment): Support opaque types. + + * testsuite/g++.dg/other/opaque-1.C: New. + + * testsuite/g++.dg/other/opaque-2.C: New. + +2003-08-06 Aldy Hernandez + + * decl.c (grokparms): Use cp_build_qualified_type instead + TYPE_MAIN_VARIANT. + +2003-08-05 Gabriel Dos Reis + + * cxx-pretty-print.h: New file. + * cxx-pretty-print.c: Likewise. + * error.c (scratch_pretty_printer): Change type. + (init_error): Tidy. + (dump_aggr_type): Likewise. + (dump_global_iord): Likewise. + (dump_expr): Likewise. + (dump_char): Remove. + * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. + (cxx_initialize_diagnostics): New function. + * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o + (CXX_PRETTY_PRINT_H): New variable. + (cp/cxx-pretty-print.o): New rule. + (cp/cp-lang.o): Update dependence. + (cp/error.o): Likewise. + +2003-08-05 Steven Bosscher + + * cp-tree.h (struct lang_decl): Don't include c_lang_decl. + (DECL_DECLARED_INLINE_P): Remove. + * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P + if decl is a FUNCTION_DECL. This never made sense, but now it is + required to avoid a tree check failure. + * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. + * optimize.c (maybe_clone_body): Likewise. + +2003-08-04 Roger Sayle + + * decl.c (cxx_insert_default_attributes): Delete. + * cp-tree.h (cxx_insert_default_attributes): Don't prototype. + * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. + +2003-08-03 Nathan Sidwell + + PR c++/11704 + * pt.c (type_dependent_expression_p): Cope with COMPONENT_REF with + unknown type. + + PR c++/11766 + * typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to + member functions. + +2003-08-02 Nathan Sidwell + + PR c++/9447 + * cp-tree.def (USING_DECL): Document its type. + * class.c (pushclass): If we're entering a template, push any + dependent using decls it has. + * decl2.c (do_class_using_decl): Refactor. Type is NULL iff it is + a dependent scope. + * pt.c (tsubst_decl) : Set type. + (tsubst): Remove USING_DECL checks. + (type_dependent_expression_p): Remove USING_DECL case. + * semantics.c (finish_member_declaration): A USING_DECL's type + indicates whether it is dependent. + +2003-08-02 Nathan Sidwell + + * cp-tree.h (pushclass): Remove unneeded parameter. + * class.c (pushclass): Remove unneeded MODIFY parm. Adjust. + (push_nested_class): Adjust pushclass call. + * pt.c (instantiate_class_template): Likewise. + * semantics.c (begin_class_definition): Likewise. + +2003-08-01 Nathanael Nerode + + * typeck2.c (add_exception_specifier): Use 'bool' where appropriate. + +2003-08-01 Mark Mitchell + + PR c++/11697 + * decl.c (decls_match): Don't ignore the types of template + classes. + + PR c++/11744 + * pt.c (tsubst_copy_and_build): Refine Koenig lookup logic. + +2003-08-01 Kriang Lerdsuwanakij + + PR c++/8442, c++/8806 + * decl.c (qualify_lookup): Accept TEMPLATE_DECL if types are + preferred. + (check_elaborated_type_specifier): Add allow_template_p + parameter. Check tag mismatch and class template. + (xref_tag): Add template_header_p parameter. Add assertion + that name is an IDENTIFIER_NODE. Remove implicit typename + warning. Simplify lookup process if globalize is true. + (cxx_init_decl_processing): Adjust call to xref_tag. + (xref_tag_from_type): Likewise. + * decl2.c (handle_class_head): Likewise. + * parser.c (cp_parser_elaborated_type_specifier, + cp_parser_class_head): Likewise. + * rtti.c (init_rtti_processing, build_dynamic_cast1, + tinfo_base_init, emit_support_tinfos): Likewise. + * class.c (is_base_of_enclosing_class): Remove. + * pt.c (convert_template_argument): Don't accept RECORD_TYPE as + template template argument. + * cp-tree.h (xref_tag): Adjust declaration. + (is_base_of_enclosing_class): Remove. + * NEWS: Document template template argument change. + +2003-08-01 Nathan Sidwell + + * parser.c (cp_parser_init_declarator, + cp_paser_member_declaration): Reformat. + * pt.c (lookup_template_class, type_unification_real, unify, + type_dependent_expression_p): Reformat. + + PR c++/11295 + * cp-tree.h (tubst_flags_t): Add tf_stmt_expr_cmpd, + tf_stmt_expr_body. + (finish_stmt_expr_expr): Declare. + * parser.c (cp_parser_primary_expression): Tell + cp_parser_compount_statement that it is a statement expression. + (cp_parser_statement, cp_parser_labeled_statement, + cp_parser_compound_statement, cp_parser_statement_seq_opt): Add + in_statement_expr_p parameter. + (cp_parser_expression_statement): Likewise. Call + finish_stmt_expr_expr for final expression of a statement + expression. + (cp_parser_for_init_statement, + cp_parser_implicitly_scoped_statement, + cp_parser_already_scoped_statement, cp_parser_function_definition, + cp_parser_try_block, cp_parser_handled): Adjust. + * pt.c (tsubst_copy) : Pass tf_stmt_expr. + (tsubst_expr): Process tf_stmt_expr and tf_stmt_exprs flags. + (tsubst_expr) : Check tf_stmt_exprs flag. + * semantics.c (finish_expr_stmt): Do not deal with statement + expressions. + (begin_stmt_expr): Clear last_expr_type. + (finish_stmt_expr_expr): New. + (finish_stmt_expr): Process the value expression. + + * typeck.c (build_compound_expr): If RHS is a TARGET_EXPR, put the + compound expr inside the target's initializer. + + PR c++/11525 + * parser.c (cp_parser_primary_expression): Do not set + non-constant-p merely because it is a dependent scope. + + PR c++/9447 + * decl2.c (do_class_using_decl): Set type to NULL_TREE. + * semantics.c (finish_expr_stmt): Do not convert to void in a + template. + +2003-07-31 Nathan Sidwell + + * pt.c (coerce_template_parms): Refactor. + (fn_type_unification): Increment processing_template_decl when + tsubsting an incomplete set of explicit args. + + PR c++/11347 + * pt.c (instantiate_class_template): Increment + processing_template_decl around the tsubst of a template member + class. + (tsubst_qualified_id): Assert we do not have a dependent scope. + + * pt.c (coerce_template_template_parms, lookup_template_class, + can_complete_type_without_circularity, instantiate_class_template, + tsubst_decl, unify): Reformat. + +2003-07-31 Jan Hubicka + + * decl2.c (maybe_make_one_only): Use mark_referenced. + * method.c (use_thunk): Likewsie. + +2003-07-30 Jan Hubicka + + * class.c (build_vtable_entry_ref): Kill. + (build_vtbl_ref_1): Do not call build_vtable_entry_ref. + (build_vfn_ref): Do not call build_vtable_entry_ref. + * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Kill. + * cp-tree.h (prepare_assemble_variable): Kill. + * cp-decl.c (prepare_assemble_variable): Kill. + +2003-07-29 Geoffrey Keating + + * parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead + of setting valid_pch by hand. + +2003-07-29 Rainer Orth + + * decl.c (finish_enum): Initialize underlying_type. + +2003-07-29 Nathan Sidwell + + PR c++/9447 + * decl.c (add_binding): Add bval local variable. + (push_class_level_binding): Likewise. Allow a USING_DECL to be + pushed. + * decl2.c (do_class_using_decl): The type of a using decl is + unknown. + * parser.c (cp_parser_postfix_expression): Refactor unqualified-id + function call lookup code. + * pt.c (tsubst): A USING_DECL will have unknown type. + (tsubst_copy_and_build): Allow a using decl. + (type_dependent_expression_p): A USING_DECL will make it + dependent. + * semantics.c (finish_member_declaration): Push a dependent using + declaration. + +2003-07-28 Mark Mitchell + + PR c++/11530 + * parser.c (cp_parser_postfix_expression): Do not call mark_used. + * semantics.c (finish_id_expression): Call mark_used for all + declarations. + +2003-07-28 Mark Mitchell + + PR c++/11667 + * call.c (standard_conversion): Allow all integral->enumeral + conversions, after marking them as bad. + * decl.c (finish_enum): Make sure that all enumerators are + properly converted to the underlying type. + (build_enumerator): Set DECL_CONTEXT for namespace-scope + enumeration types. + * pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly. + (tsubst_enum): Tidy. + + * Make-lang.in (typeck.o): Depend on convert.h. + (class.o): Likewise. + (rtti.o): Likewise. + * call.c: Include convert.h. + (convert_arg_to_ellipsis): Use convert_to_real. + * class.c: Include convert.h. + (build_base_path): Use convert_to_integer. + * rtti.c: Include convert.h. + (build_headof): Use convert_to_integer. + * typeck.c: Include convert.h. + (decay_conversion): Use convert_to_integer. + (build_unary_op): Use build_nop. + (get_delta_difference): Use convert_to_integer. + (build_ptrmemfunc): Avoid unnecessary conversions. + +2003-07-28 Jan Hubicka + + * decl2.c (mark_member_pointers): Verify that member pointer points to + the function. + +2003-07-28 Nathan Sidwell + + * cp-tree.h (begin_compound_stmt): No scope arg is a bool. + (finish_compound_stmt): Remove no scope arg. + * decl.c (register_dtor_fn): Adjust begin_compound_stmt and + end_compound_stmt calls. + (expand_static_init, begin_destructor_body, begin_function_body, + finish_function_body): Likewise. + * decl2.c (start_objects, finish_objects, + start_static_storage_duration_function, + finish_static_storage_duration_function): Likewise. + * init.c (begin_init_stmts, finish_init_stmts, + construct_virtual_base, build_vec_init): Likewise. + * method.c (do_build_assign_ref, synthesize_method): Likewise. + * parser.c (cp_parser_compound_statement, + cp_parser_implicitly_scoped_statement, + cp_parser_already_scoped_statement): Likewise. + * pt.c (tsubst_expr): Likewise. + * semantics.c (begin_compound_stmt): No scope arg is a bool. + (finish_compound_stmt): Remove no scope arg. + + * error.c (dump_expr) : A compound expr is + always dyadic. + +2003-07-27 Mark Mitchell + + * call.c (standard_conversion): Tweak handling of + pointer-to-member types. + * pt.c (tsubst): Correctly qualify pointers-to-data member types. + * typeck.c (comp_ptr_ttypes_real): Check qualifiers on + pointer-to-data member types. + +2003-07-27 Nathan Sidwell + + * parser.c (cp_parser_type_parameter): Reformat. + (cp_parser_parameter_declaration): Deprecate default args where + not allowed. + +2003-07-26 Nathan Sidwell + + * cfns.h: Rebuilt. + + * cp-tree.h (begin_init_stmts, finish_init_stmts): Remove. + (begin_global_stmt_expr, finish_global_stmt_expr): Remove. + * init.c (begin_init_stmts): Make static. Return is_global + value. Always call begin_stmt_expr. + (finish_init_stmts): Make static. Add is_global parm. Always + building a stmt tree. + (build_aggr_init): Adjust begin_init_stmts, finish_init_stmts calls. + (build_vec_init): Likewise. Always building a stmt tree. + (expand_default_init): Always building a stmt tree. + (get_temp_regvar): Likewise. + * semantics.c (begin_global_stmt_expr, + finish_global_stmt_expr): Remove. + +2003-07-25 Nathan Sidwell + + * cp-tree.h (build_compound_expr): Take LHS & RHS args. + (build_x_compound_expr_from_list): Declare. + * typeck.c (build_x_compound_expr_from_list): New. + (build_x_compound_expr): Adjust. + (build_compound_expr): Remove unreachable code. Take two + parameters, adjust. + * decl.c (grok_reference_init): Use + build_x_compound_expr_from_list. + (expand_static_init): Adjust build_compound_expr call. + (cxx_maybe_build_cleanup): Likewise. + * init.c (perform_member_init): Use + build_x_compound_expr_from_list. + (build_new_1): Likewise. + (build_vec_delete): Adjust build_compound_expr calls. + (build_vbase_delete): Likewise. + * typeck2.c (store_init_value): Use + build_x_compound_expr_from_list. + (build_functional_cast): Likewise. + +2003-07-25 Nathan Sidwell + + * cp-tree.h (enum tsubst_flags_t): Add tf_user. + * decl.c (make_typename_type): Pass it. + * pt.c (lookup_template_class): Use it. + (resolve_typename_type): Pass it. + * semantics.c (finish_template_type): Pass it. + +2003-07-25 Nathan Sidwell + + PR c++/11617 + * cp-tree.h (qualified_name_lookup_error): Declare. + * pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for + errors. + (tsubst_expr) : Likewise. + (tsubst_copy_and_build) : Likewise. + * semantics.c (qualified_name_lookup_error): New, broken out of ... + (finish_id_expression): ... here. Use it. + +2003-07-25 Falk Hueffner + + * cfns.gperf: Add '%%' delimiter to placate gperf 3.0. + +2003-07-25 Nathan Sidwell + + PR c++/11596 + * pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove. + (tsubst_template_arg): New. + (tsubst_template_arg_vector): Rename to ... + (tsubst_template_args): ... this. Accept a TREE_LIST form. Use + tsubst_template_arg. + (coerce_template_parms): Use tsubst_template_arg for default + value. + (tsubst_template_parms): Likewise. + (tsubst_aggr_type): Adjust. + (tsubst_decl): Likewise. + (tsubst): Use tsubst_template_arg for a DOMAIN. Adjust. + (tsubst_copy) : Use tsubst_template_args. + +2003-07-25 Gabriel Dos Reis + + * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H. + * error.c: Use the new pretty-printer framework. + +2003-07-24 Per Bothner + + * decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc + which causes errors messages to incorrectly mention included files. + +2003-07-24 Mark Mitchell + + * cp-tree.h (convert_to_base_statically): Declare. + * call.c (build_special_member_call): Convert INSTANCE to the base + type. + * class.c (convert_to_base_statically): New method. + * init.c (construct_virtual_base): Use it. + * method.c (do_build_assign_ref): Fix typo in comment. + +2003-07-24 Jason Merrill + + * decl.c: Just set truthvalue_* to boolean_*. + +2003-07-24 Nathan Sidwell + + * decl.c (reshape_init): Remove unreachable code. + +2003-07-24 Kriang Lerdsuwanakij + + PR c++/11513 + * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope. + +2003-07-23 Mark Mitchell + + PR c++/11645 + * cp-tree.h (accessible_base_p): Declare. + * call.c (build_over_call): Use it. + * search.c (accessible_base_p): New function, split out from ... + (lookup_base): ... here. + + PR c++/11517 + * call.c (build_conditional_expr): Use perform_implicit_conversion + and error_operand_p. Robustify. + * typeck.c (build_unary_op): Use perform_implicit_conversion. + +2003-07-23 Nathan Sidwell + + PR c++/10953 + * parser.c (cp_parser_nested_name_specifier): Reset scope on + failure. + (cp_parser_elaborated_type_specifier): Likewise. + +2003-07-22 Mark Mitchell + + Eliminate use of POINTER_TYPE for pointers-to-members. + * call.c (standard_conversion): Rework pointer-to-member handling. + Add comments. + (add_builtin_candidate): Likewise. + (resolve_scoped_fn_name): Remove. + (build_conditional_expr): Rework pointer-to-member handling. + (compare_ics): Likewise. + * class.c (check_field_decls): Use TYPE_PTR_P. + * cp-lang.c (cp_var_mod_type_p): Rework pointer-to-member + handling. + * cp-tree.h (SCALAR_TYPE_P): Use TYPE_PTR_TO_MEMBER_P. + (TYPE_PTRMEM_P): Add comment. + (TYPE_PTR_P): Simplify. + (TYPE_PTROB_P): Correct definition. + (TYPE_PTR_TO_MEMBER_P): New macro. + (TYPE_PTRMEM_CLASS_TYPE): Adjust. + (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. + (resolved_scoped_fn_name): Remove declaration. + (build_offset_ref): Change prototype. + (resolve_offset_ref): Remove. + (comp_target_types): Remove. + * cvt.c (cp_convert_to_pointer): Rework pointer-to-member + handling. + (convert_to_reference): Use can_convert. + (ocp_convert): Improve error handling. Rework pointer-to-member + handling. + (perform_qualification_conversions): Rework pointer-to-member + handling. + * decl.c (build_ptrmem_type): Handle functions too. + (create_array_type_for_decl): Remove OFFSET_TYPE error message. + (grokdeclarator): Use OFFSET_TYPE for pointers to data members. + (grokparms): Remove OFFSET_TYPE error message. + * dump.c (cp_dump_tree): Rework pointer-to-member handling. + * error.c (dump_type_prefix): Likewise. + * expr.c (cplus_expand_constant): Use build_nop. + * init.c (build_offset_ref): Add address_p parameter. Fold in + necessary bits from resolve_offset_ref. + (resolve_offset_ref): Remove. + * parser.c (cp_parser_postfix_expression): Remove special case + code for OFFSET_TYPE. + * pt.c (convert_nontype_argument): Rework pointer-to-member + handling. + (convert_template_argument): Likewise. + (unify): Likewise. + (invalid_nontype_parm_type_p): Likewise. + (dependent_type_p_r): Likewise. + * rtti.c (get_tinfo_decl): Remove OFFSET_TYPE special case. + (target_incomplete_p_): Rework pointer-to-member + handling. + (get_pseudo_ti_init): Likewise. + (get_pseudo_ti_desc): Likewise. + * semantics.c (finish_qualified_id_expr): Adjust call to + build_offset_ref. Remove use of resolve_offset_ref. + * tree.c (pod_type_p): Use TYPE_PTR_TO_MEMBER_P. + * typeck.c (target_type): Use TYPE_PTRMEM_P. + (type_unknown_p): Remove obsolete code about the time before + non-dependent expressions were handled correctly. + (qualify_type_recursive): Remove. + (composite_pointer_type_r): New function. + (composite_pointer_type): Use it. + (merge_types): Remove dead comments. + (comp_cv_target_types): Remove. + (comp_target_types): Likewise. + (comp_target_parms): Likewise. + (cxx_sizeof_or_alignof_type): Remove OFFSET_TYPE error. + (build_indirect_ref): Use TYPE_PTR_TO_MEMBER_P. + (build_binary_op): Do not use of comp_target_types. + (pointer_diff): Remove OFFSET_TYPE case. + (build_unary_op): Adjust pointer-to-member handling. + (unary_complex_lvalue): Likewise. + (check_for_casting_away_constness): Add description parameter. + (build_static_cast): Pass it. + (build_reinterpret_cast): Use check_for_casting_away_constness. + (build_const_cast): Adjust pointer-to-member handling. + (build_c_cast): Likewise. + (convert_for_assignment): Remove OFFSET_TYPE error message. + (comp_ptr_ttypes_real): Adjust pointer-to-member handling. + (comp_ptr_ttypes_reinterpret): Remove. + (casts_away_constness_r): Adjust pointer-to-member handling. + (casts_away_constness): Liekwise. + (strip_all_pointer_quals): Remove. + * typeck2.c (digest_init): Adjust pointer-to-member handling. + (build_m_component_ref): Likewise. + +2003-07-22 Wolfgang Bangerth + + * lex.c (unqualified_fn_lookup_error): Mention that the error + message needs to be kept in synch with the manual. + +2003-07-22 Nathan Sidwell + + PR c++/11614 + * decl.c (grokdeclarator): An array member is only a flexible + array member if the field itself is the array. + +2003-07-22 Kriang Lerdsuwanakij + + PR c++/10793 + * decl.c (xref_basetypes): Handle error_mark_node. + +2003-07-22 Nathan Sidwell + + * cp-tree.h (enum cp_lvalue_kind): Add clk_packed. + * tree.c (lvalue_p_1): Set it. + * class.c (check_field): Don't allow non-packed non-POD fields to + be packed. + * call.c (reference_binding): Need a temporary for all bitfield + and packed fields. + (convert_like_real): Check it is ok to make a temporary here. + +2003-07-21 Nathan Sidwell + + * cp-tree.h (hack_identifier): Remove. + * method.c (hack_identifier): Remove. + * semantics.c (finish_id_expression): Expand hack_identifier + here. Simplify. + +2003-07-19 Kaveh R. Ghazi + + * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c + semantics.c typeck.c: Remove unnecessary casts. + +2003-07-18 Nathan Sidwell + + * cp-tree.h (hack_identifier): Remove. + * method.c (hack_identifier): Remove. + * semantics.c (finish_id_expression): Expand hack_identifier + here. Simplify. + +2003-07-18 Nathan Sidwell + + * cp-tree.h (finish_non_static_data_member): Add object param. + * method.c (hack_identifier): Adjust. + * pt.c (tsubst_copy_and_build) : Don't search + again for a FIELD_DECL. + * semantics.c (finish_non_static_data_member): Add object + parameter. Always save the DECL in the COMPONENT_REF. + * call.c (resolve_scoped_fn_name): Adjust. + +2003-07-17 Zack Weinberg + + * pt.c (get_bindings): Make definition consistent with + forward declaration. + +2003-07-17 Kriang Lerdsuwanakij + + PR c++/7809 + * friend.c (add_friend): Check access for member functions + and templates. + +2003-07-17 Gabriel Dos Reis + + PR c++/10668 + * typeck.c (build_class_member_access_expr): Improve diagnostic. + +2003-07-16 Mark Mitchell + + PR c++/11547 + * cp-tree.h (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P): New + macro. + (DECL_PRETTY_FUNCTION_P): Use VAR_DECL_CHECK. + * decl.c (duplicate_decls): Merge + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + * parser.c (cp_parser_postfix_expression): Adjust call to + cp_parser_initializer_list and + cp_parser_parenthesized_expression_list. + (cp_parser_parenthesized_expression_list): Add non_constant_p. + (cp_parser_new_placement): Adjust call to + cp_parser_parenthesized_expression_list. + (cp_parser_direct_new_declarator): Likewise. + (cp_parser_conditional_expression): Remove. + (cp_parser_constant_expression): Parse an assignment-expression, + not a conditional-expression. + (cp_parser_simple_declaration): Resolve expression/declaration + ambiguity more quickly. + (cp_parser_mem_initializer): Adjust call to + cp_parser_parenthesized_expression_list. + (cp_parser_init_declarator): Keep track of whether or not the + initializer is a constant-expression. + (cp_parser_initializer): Add non_constant_p parameter. + (cp_parser_initializer_clause): Likewise. + (cp_parser_initializer_list): Likewise. + (cp_parser_attribute_list): Adjust call to + cp_parser_parenthesized_expression_list. + (cp_parser_functional_cast): Likewise. + * pt.c (tsubst_decl): Copy + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + (tsubst_expr): Tweak use of DECL_PRETTY_FUNCTION_P. + * semantics.c (finish_id_expression): Use + DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. + +2003-07-16 Neil Booth + + * lang-options.h: Remove. + +2003-07-16 Andrew Pinski + + PR c/10962 + * class.c (field_decl_cmp): Remove. + (resort_field_decl_cmp): Remove. + (resort_sorted_fields): Remove. + (add_fields_to_vec): Rename to ... + (add_fields_to_record_type): this. + (finish_struct_1): Change to be using + sorted_fields_type's fields. + * cp-tree.h (lang_decl): In lang_decl_u3 + change sorted_fields to be a pointer to + sorted_fields_type. + (resort_sorted_fields): Remove prototype. + * search.c (lookup_field_1): Change to be using + sorted_fields_type's fields. + +2003-07-16 Kriang Lerdsuwanakij + + PR c++/5421 + * decl.c (grokdeclarator): Handle TEMPLATE_ID_EXPR if friend + is a member of other class. + * friend.c (do_friend): Don't build TEMPLATE_DECL if friend + is a specialization of function template. + +2003-07-16 Gabriel Dos Reis + + PR c++/10903 + * pt.c (convert_nontype_argument): Fix thinko in diagnostic. + Improve. + +2003-07-15 Mark Mitchell + + * cp-tree.def (LOOKUP_EXPR): Remove. + * cp-tree.h (cp_id_kind): Add CP_ID_KIND_UNQUALIFIED_DEPENDENT. + (LOOKUP_EXPR_GLOBAL): Remove. + (get_bindings): Remove. + (is_aggr_type_2): Remove. + * call.c (resolved_scoped_fn_name): Remove support for + LOOKUP_EXPR. + * decl.c (grokfndecl): Likewise. + (grokdeclarator): Likewise. + * error.c (dump_decl): Likewise. + (dump_expr): Likewise. + * friend.c (do_friend): Likewise. + * init.c (build_offset_ref): Likewise. + * lex.c (unqualified_fn_lookup_error): Use pedwarn. Do not create + LOOKUP_EXPRs + * mangle.c (write_expression): Remove support for LOOKUP_EXPR. + * parser.c (cp_parser_postfix_expression): Modify Koenig lookup + test. + * pt.c (get_bindings): Give it internal linkage. + (check_explicit_specialization): Remove support for LOOKUP_EXPR. + (lookup_template_function): Likewise. + (for_each_tempalte_parm_r): Likewise. + (tsubst_decl): Likewise. + (tsubst_qualified_id): Handle template template parameters. + (tsubst_copy): Remove support for LOOKUP_EXPR. + (tsubst_copy_and_build): Likewise. + (most_general_template): Likewise. + (value_dependent_expression_p): Likewise. + (type_dependent_expression_p): Note that IDENTIFIER_NODEs are + always dependent. + * semantics.c (perform_koenig_lookup): Do not create + IDENTIFIER_NODEs. + (finish_fname): Likewise. + (finish_id_expression): Likewise. + * tree.c (is_aggr_type_2): Remove. + +2003-07-16 Gabriel Dos Reis + + PR c++/11531 + * typeck.c (check_return_expr): Fix thinko in diagnostic. + +2003-07-15 Kriang Lerdsuwanakij + + PR c++/10108 + * pt.c (tsubst_decl) : Add a check for + error_mark_node. + +2003-07-14 Mark Mitchell + + PR c++/11509 + * pt.c (dependent_scope_ref_p): New function. + (value_dependent_expression_p): Use it. + (type_dependent_expression_p): Likewise. + + * pt.c (tsubst_friend_function): Use reregister_specialization. + + PR c++/7019 + * cp-tree.h (lookup_qualified_name): Adjust prototype. + * decl.c (lookup_qualified_name): Add complain parameter. Adjust + call to is_aggr_type. + * parser.c (cp_parser_lookup_name): Adjust call to + lookup_qualified_name. + * pt.c (tsubst_qualified_id): Likewise. + (tsubst_copy_and_build): Likewise. + * semantics.c (finish_qualified_id_expr): Deal with erroneous + expressions. + +2003-07-14 Gabriel Dos Reis + + PR c++/11510 + * call.c (op_error): Properly format REALPART_EXPR and + IMAGPART_EXPR. + * error.c (dump_expr): Likewise. + +2003-07-14 Gabriel Dos Reis + + * error.c (dump_expr): Handle EMPTY_CLASS_EXPR. + +2003-07-14 Gabriel Dos Reis + + PR c++/5293 + * call.c (initialize_reference): Improve diagnostic. + +2003-07-14 Kriang Lerdsuwanakij + + PR c++/11154 + * pt.c (more_specialized_class): Add full_args parameter. + (most_specialized_class): Adjust calls to more_specialized_class. + * cp-tree.h (more_specialized_class): Adjust declaration. + +2003-07-14 Dan Nicolaescu + + * lex.c (enum tree_node_kind): Delete. + +2003-07-13 Mark Mitchell + + PR c++/11503 + * cp-tree.h (DECL_SELF_REFERENCE_P): New macro. + (SET_DECL_SELF_REFERENCE_P): Likewise. + * class.c (build_self_reference): Use SET_DECL_SELF_REFERENCE_P. + * pt.c (tsubst_decl): Copy it. + * search.c (lookup_base): Use DECL_SELF_REFERENCE_P. + + * pt.c (reregister_specialization): Fix thinko in previous change. + + * cp-tree.h (cp_id_kind): New type. + (unqualified_name_lookup_error): Change prototype. + (unqualified_fn_lookup_error): New function. + (do_identifier): Remove. + (do_scoped_id): Likewise. + (tsubst_copy_and_build): Change prototype. + (reregister_specialization): New function. + (perform_koenig_lookup): Likewise. + (finish_id_expression): Likewise. + * call.c (build_method_call): Adjust call to + unqualified_name_lookup_error. + * decl.c (duplicate_decls): Use reregister_specialization. + * lex.c (is_global): Remove. + (unqualified_name_lookup_error): Return a value. + (do_identifier): Remove. + (do_scoped_id): Likewise. + (identifier_typedecl_value): Remove. + (unqualified_fn_lookup_error): New function. + * parser.c (cp_parser_id_kind): Remove. + (cp_parser_non_constant_id_expression): Remove. + (cp_parser_primary_expression): Use finish_id_expression. + (cp_parser_class_or_namespace_name): Use cp_id_kind, not + cp_parser_id_kind. + (cp_parser_postfix_expression): Use perform_koenig_lookup. + (cp_parser_template_argument): Use cp_id_kind. + (cp_parser_fold_non_dependent_expr): Adjust call to + tsubst_copy_and_build. + * pt.c (unregister_specialization): Rename to ... + (reregister_specialization): This. + (tsubst_friend_function): Use it. + (maybe_fold_nontype_arg): Adjust call to tsubst_copy_and_build. + (tsubst_qualified_id): Likewise. + (tsubst_expr): Likewise. + (tsubst_copy_and_build): Add function_p parameter. Use + finish_id_expression. Introduce RECUR macro. + (tsubst_non_call_postfix_expression): New function. + (regenerate_decl_from_template): Use reregister_specialization. + * semantics.c (perform_koenig_lookup): New function. + (finish_id_expression): Likewise. + +2003-07-13 Kriang Lerdsuwanakij + + * pt.c (push_access_scope_real): Remove. + (push_access_scope): Move code from push_access_scope_real. + (pop_access_scope): Don't check for TEMPLATE_DECL. + (instantiate_template): Defer access checking during template + substitution. + (regenerate_decl_from_template): Tidy. + +2003-07-11 Nathanael Nerode + + PR c++/11437 + * operators.def: Add definitions for __imag__, __real__. + +2003-07-11 Nathan Sidwell + + PR c++/11050 + * parser.c (cp_parser_expression_list): Rename to ... + (cp_parser_parenthesized_expression_list): ... here. Add attribute + parameter, parse the surounding parentheses. + (cp_parser_skip_to_closing_parenthesis): Add recover and or_comma + parameters. Return int. + (cp_parser_skip_to_closing_parenthesis or comma): Remove. + (cp_parser_postfix_expression): Adjust function call parsing. + (cp_parser_new_placement): Adjust. + (cp_parser_new_initializer): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_selection_statement): Likewise. + (cp_parser_mem_initializer): Likewise. + (cp_parser_asm_definition): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_declarator): Make + cdtor_or_conv_p an int ptr. + (cp_parser_direct_declarator): Likewise. Check for a parameter + list on cdtors & conv functions. + (cp_parser_initializer): Adjust. + (cp_parser_member_declaration): Adjust. + (cp_parser_attribute_list): Move code into + cp_parser_parens_expression_list. + (cp_parser_functional_cast): Adjust. + * pt.c (type_dependent_expression_p): Erroneous expressions are + non-dependent. + +2003-07-11 Geoffrey Keating + + * decl.c (cp_finish_decl): Handle 'used' attribute. + + * cp-lang.c (c_reset_state): New dummy routine. + * cp-tree.h (finish_file): Move prototype to c-common.h. + * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. + +2003-07-11 Mark Mitchell + + PR c++/8327 + * pt.c (tsubst_qualified_id): Implement suggested resolution for + Core Issue 2. + (type_dependent_expression_p): Likewise. + +2003-07-10 Mark Mitchell + + * typeck.c (build_binary_op): Do not warn about signed + vs. unsigned comparisons in the bodies of templates. + + PR c++/9411 + * parser.c (cp_parser_postfix_expression): Check dependency of + functions. + +2003-07-09 Mark Mitchell + + PR c++/10032 + * decl.c (cxx_init_decl_processing): With -pedantic, pedwarns are + still errors. + + PR c++/10527 + * error.c (decl_to_string): Do not print default argument + expressions. + + * cp-tree.h (break_out_calls): Remove declaration. + * tree.c (break_out_calls): Remove. + * typeck.c (build_modify_expr): Avoid invalid sharing of trees. + +2003-07-09 Nathan Sidwell + + PR c++ 9483 + * class.c (check_field_decls): Pass DECL_NAME to constructor_name_p. + * decl2.c (constructor_name_p): Avoid repeated constructor_name + calls. + * decl.c (grokdeclarator): Refactor ctor/dtor detection. + +2003-07-09 Mark Mitchell + + * typeck.c (build_x_unary_op): Take note of the fact that + PREINCREMENT_EXPR and POSTINCREMENT_EXPR are binary operations on + trees. + + * parser.c (cp_parser_primary_expression): Preserve the form of + qualified expressions in templates, even if they are not + dependent. + * pt.c (convert_nontype_argument): Handle non-dependent SCOPE_REFs. + (tsubst_qualified_id): Likewise. + * search.c (accessible_p): Treat everything in the body of a + template as accessible. + +2003-07-08 Mark Mitchell + + * cp-tree.def (NON_DEPENDENT_EXPR): New node. + * cp-tree.h (build_call_from_tree): Remove. + (build_member_call): Likewise. + (dependent_template_arg_p): Remove. + (any_dependent_template_arguments_p): New function. + (dependent_template_id_p): Likewise. + (any_type_dependent_arguments_p): Likewise. + (build_non_dependent_expr): Likewise. + (build_non_dependent_args): Likewise. + (build_x_compound_expr): Adjust prototype. + * call.c (build_new_method_call): Handle non-dependent expressions + correctly. + * decl2.c (grok_array_decl): Likewise. + (build_offset_ref_call_from_tree): Likewise. + (build_call_from_tree): Remove. + * error.c (dump_decl): Handle NON_DEPENDENT_EXPR. + (dump_expr): Likewise. + * init.c (build_member_call): Remove. + * mangle.c (write_expression): Update handling for template-ids. + * parser.c (cp_parser_primary_expression): Use + any_dependent_template_arguments_p. Update constant-expression + handling. + (cp_parser_postfix_expression): Use + any_type_dependent_arguments_p. Simplify call processing. + (cp_parser_unary_expression): Simplify. + (cp_parser_expression): Adjust for changes to + build_x_compound_expr. + (cp_parser_template_argument): Implement standard-conforming + parsing of non-type template arguments. + (cp_parser_direct_declarator): Use + cp_parser_fold_non_dependent_expr. + (cp_parser_fold_non_dependent_expr): New function. + (cp_parser_next_token_ends_template_argument_p): Likewise. + * pt.c (convert_template_argument): Do not call + maybe_fold_nontype_arg. + (tsubst_baselink): Likewise. + (tsubst_copy_and_build): Share common code. Make sizeof/alignof + processing work correctly for non-dependent expressions. Adjust + handling of COMPOUND_EXPR. Simplify call processing. + (value_dependent_expression_p): Deal with functional casts and + sizeof/alignof correctly. + (type_dependent_expression_p): Handle overloaded functions. + (any_type_dependent_arguments_p): New function. + (any_dependent_template_arguments_p): Likewise. + (dependent_template_p): Treat SCOPE_REFs as dependent. + (dependent_template_id_p): Simplify. + (build_non_dependent_expr): New function. + (build_non_dependent_args): Likewise. + * semantics.c (finish_stmt_expr): Don't make dependent + statement-expresions have void type. + (finish_call_expr): Handle non-dependent expressions + correctly. + * tree.c (lvalue_p_1): Treat NON_DEPENDENT_EXPRs as lvalues. + * typeck.c (cxx_sizeof_or_alignof_type): Give the expression + type size_t, even in templates. + (expr_sizeof): Likewise. + (finish_class_member_access_expr): Handle non-dependent expressions + correctly. + (build_x_indirect_ref): Likewise. + (build_x_binary_op): Likewise. + (build_x_unary_op): Likewise. + (build_x_conditional_expr): Likewise. + (build_x_compound_expr): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2003-07-09 Jan Hubicka + + * cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New. + * decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS. + (start_function): Use DECL_ESTIMATED_INSNS. + * optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS. + + * decl2.c (maybe_emit_vtables): Fix marking vtables as needed in + unit-at-a-time + +2003-07-08 Kriang Lerdsuwanakij + + PR c++/11030 + * pt.c (instantiate_class_template): Don't call xref_tag to + inject name when the friend class is a specialization. + +2003-07-07 Mark Mitchell + + * cp-tree.h (build_scoped_method_call): Remove. + (lookup_qualified_name): Remove parameter. + (tsubst_copy_and_build): Declare. + (finish_qualified_object_call_expr): Remove. + (check_accessibility_of_qualified_id): New function. + (finish_qualified_id_expr): Likewise. + (non_reference): Likewise. + (build_expr_from-tree): Remove. + * call.c (non_reference): Remove. + (build_scoped_method_call): Likewise. + (build_method_call): Use error_operand_p. Assert that we are not + processing a template. + (standard_conversion): Use non_reference. + * class.c (build_vtbl_entry_ref): Likewise. + (build_vtbl_ref_1): Likewise. + * cvt.c (build_expr_type_conversion): Use non_reference. + * decl.c (lookup_qualified_name): Remove flags parameter. + (grok_op_properties): Use non_reference. + * decl2.c (grok_array_decl): Likewise. + (build_expr_from_tree): Remove. + (build_offset_ref_call_from_tree): Update comment. + * error.c (parm_to_string): Call reinit_global_formatting_buffer. + * except.c (prepare_eh_types): Use non_reference. + (can_convert_eh): Likewise. + * init.c (build_dtor_call): Avoid using build_method_call. + * mangle.c (write_template_param): Remove misleading comment. + * method.c (locate_copy): Use non_reference. + * parser.c (cp_parser_scope_through_which_access_occurs): Remove. + (cp_parser_primary_expression): Do not create SCOPE_REFs is + non-dependent contexts. + (cp_parser_postfix_expression): Use finish_qualified_id_expr. + (cp_parser_direct_declarator): Use tsubst_copy_and_build, not + build_expr_from_tree. + (cp_parser_lookup_name): Adjust call to lookup_qualified_name. + Use check_accessibility_of_qualified_id. + * pt.c (maybe_fold_nontype_arg): Use tsubst_copy_and_build, not + build_expr_from_tree. + (tsubst_baselink): New function. + (tsubst_qualified_id): Likewise. + (tsubst_copy): Use them. Remove support for METHOD_CALL_EXPR. + (tsubst_expr): Adjust call to lookup_qualified_name. + (tsubst_copy_and_build): Handle SCOPE_REFs specially. Adjust + handling of CALL_EXPRs. + (value_dependent_expression_p): Use INTEGRAL_OR_ENUMERATION_TYPE_P. + * rtti.c (get_tinfo_decl_dynamic): Use non_reference. + * search.c (check_final_overrider): Likewise. + * semantics.c (check_accessibility_of_qualified_id): New function. + (finish_qualified_object_call_expr): Remove. + * typeck.c (target_type): Use non_reference. + (cxx_sizeof_or_alignof_type): Likewise. + (dubious_conversion_warnings): Likewise. + (convert_for_initialization): Likewise. + (non_reference): New function. + +2003-07-07 Kaveh R. Ghazi + + * decl.c (print_binding_level, print_other_binding_stack, + print_binding_stack): Merge uses of HOST_PTR_PRINTF with adjacent + stdio calls. + * ptree.c (cxx_print_decl, cxx_print_binding): Likewise. + +2003-07-07 Andreas Jaeger + + * friend.c: Convert to ISO C90 prototypes. + + * Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output + language. + * cfns.h: Regenerate. + + * typeck.c: Convert remaining prototypes to ISO C90. + * search.c: Likewise. + + * decl2.c (build_expr_from_tree): Convert prototype to ISO C90. + * semantics.c (expand_or_defer_fn): Likewise + * mangle.c (discriminator_for_string_literal): Likewise. + * g++spec.c (lang_specific_driver): Likewise. + + * search.c (lookup_base_r): Remove unused variable. + +2003-07-07 Nathan Sidwell + + * semantics.c: (genrtl_try_block) Adjust emit_line_note + calls. + +2003-07-07 Andreas Jaeger + + * search.c (lookup_base_r): Remove unused variable. + +2003-07-06 Michael Chastain + + PR debug/10055 + * lex.c (cxx_init): Call push_srcloc and pop_srcloc rather than + assigning to input_filename directly. + +2003-07-06 Kazu Hirata + + * call.c: Fix comment formatting. + * class.c: Likewise. + * cp-tree.h: Likewise. + * decl.c: Likewise. + * decl2.c: Likewise. + * error.c: Likewise. + * method.c: Likewise. + * name-lookup.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * rtti.c: Likewise. + * search.c: Likewise. + * typeck.c: Likewise. + +2003-07-06 Mark Mitchell + + PR c++/11345 + * search.c (lookup_base_r): Remove is_non_public and + within_current_scope parameters. Remove other dead code. + (lookup_base): Adjust call to lookup_base_r. + (adjust_result_of_qualified_name_lookup): Improve comment. + * semantics.c (finish_call_expr): Use maybe_dummy_object. + +2003-07-06 Neil Booth + + * cp-lang.c (LANG_HOOKS_HANDLE_FILENAME, + LANG_HOOKS_MISSING_ARGUMENT): Override. + +2003-07-05 Mark Mitchell + + PR c++/11431 + * typeck.c (build_static_cast): Check for reference conversions + earlier. + +2003-07-04 Mark Mitchell + + * cp-tree.h (perform_integral_promotions): Declare. + * call.c (build_addr_func): Use decay_conversion. + (convert_arg_to_ellipsis): Likewise. Remove misleading comment. + (convert_for_arg_passing): Use perform_integral_promotions. + * cvt.c (build_expr_type_conversion): Use decay_conversion. + (type_promotes_to): Do not return a cv-qualified type. + * decl.c (grok_reference_init): Fix formatting. + (get_atexit_node): Use decay_conversion. + (build_enumerator): Use perform_integral_promotions. + * init.c (build_vec_init): Use decay_conversion. + * semantics.c (finish_expr_stmt): Likewise. + (finish_switch_cond): Use perform_integral_promotions. + * typeck.c (default_conversion): Likewise. + (perform_integral_promotions): New function. + (build_indirect_ref): Use decay_conversion. + (build_array_ref): Use perform_integral_promotions. + (convert_arguments): Use decay_conversion. + (build_unary_op): Use perform_integral_promotions. + (build_c_cast): Use decay_conversion. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2003-07-04 Kazu Hirata + + * call.c: Fix comment typos. + * class.c: Likewise. + * cp-tree.h: Likewise. + * cvt.c: Likewise. + * decl2.c: Likewise. + * decl.c: Likewise. + * init.c: Likewise. + * mangle.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * tree.c: Likewise. + * typeck.c: Likewise. + +2003-07-04 Zack Weinberg + + * parser.c (cp_lexer_read_token): No need to handle string + constant concatenation. + +2003-07-03 Kaveh R. Ghazi + + * cp-tree.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_CXXDIAG): Define. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Mark with + ATTRIBUTE_GCC_CXXDIAG. + +2003-07-03 Mark Mitchell + + * call.c (build_addr_func): Handle bound pointers-to-members. + (build_method_call): Do not call resolve_offset_ref. + (implicit_conversion): Likewise. + (resolve_scoped_fn_name): Use finish_non_static_data_member, not + resolve_offset_ref. + (resolve_args): Do not call resolve_offset_ref. + (build_conditional_expr): Likewise. + (build_new_method_call): Likewise. + * cp-tree.def (OFFSET_REF): Update documentation. + * cvt.c (cp_convert_to_pointer): Update handling of conversions from + pointers to members to pointers. + (ocp_convert): Do not call resolve_offset_ref. + (convert_to_void): Likewise. + (build_expr_type_conversion): Likewise. + * decl2.c (delete_sanity): Likewise. + * init.c (resolve_offset_ref): Simplify greatly. + (build_vec_delete): Do not call resolve_offset_ref. + * parser.c (cp_parser_postfix_expression): Call resolve_offset_ref + if appropriate. + (cp_parser_unary_expression): Use + cp_parser_simple_cast_expression. + (cp_parser_delete_expression): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_pm_expression): Use cp_parser_binary_op. + (cp_parser_simple_cast_expression): New function. + * rtti.c (build_dynamic_cast_1): Do not call resolve_offset_ref. + * semantics.c (finish_increment_expr): Likewise. + (finish_typeof): Likewise. + * tree.c (lvalue_p_1): Do not handle OFFSET_REF. + * typeck.c (require_complete_type): Do not handle OFFSET_REFs. + (decay_conversion): Do not call resolve_offset_ref. + (finish_class_member_access_expr): Likewise. + (convert_arguments): Likewise. + (build_x_binary_op): Handle DOTSTAR_EXPR. + (condition_conversion): Do not call resolve_offset_ref. + (unary_complex_lvalue): Likewise. + (build_static_cast): Likewise. + (build_reinterpret_cast): Likewise. + (build_const_cast): Likewise. + (build_c_cast): Likewise. + (build_modify_expr): Likewise. + (convert_for_assignment): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (build_x_arrow): Likewise. + (build_m_component_ref): Simplify. + + * call.c (build_scoped_method_call): Use convert_to_void. + (build_method_call): Likewise. + * class.c (check_field_decls): Remove dead code. + * cvt.c (convert_from_reference): Remove OFFSET_TYPE handling. + * decl2.c (grok_array_decl): Remove dead code. + (arg_assoc_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE + as pointer-to-member representation. + * init.c (build_offset_ref): Tidy. + (build_vec_delete_1): Use convert_to_void. + * mangle.c (write_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE + as pointer-to-member representation. + +2003-07-03 Nathan Sidwell + + PR c++/9162 + * decl.c (grokdeclarator): Return friend decls, not + void_type_node. + * decl2.c (grokfield): Alter friend decl check. + * parser.c (struct cp_parser): Document default_arg chain on + unparsed_functions_queue. + (cp_parser_save_default_args): New. + (cp_parser_init_declarator, cp_parser_function_definition, + cp_parser_member_declaration): Call it. + (cp_parser_class_specifier): Remove unused variable. Alter + processing of unparsed_functions_queue. + +2003-07-03 Kaveh R. Ghazi + + * class.c (add_method, check_field_decl): Fix format specifier. + * decl.c (duplicate_decls, pushdecl, check_goto, + fixup_anonymous_aggr, maybe_commonize_var, grokdeclarator, + start_enum): Likewise. + * decl2.c (ambiguous_decl): Likewise. + * pt.c (redeclare_class_template): Likewise. + +2003-07-02 Nathan Sidwell + + PR c++/10219 + * pt.c (type_unification_real): Don't unify exprs of error type. + * tree.c (error_type): Don't die on error_type. + + PR c++/9779 + * decl2.c (arg_assoc_class): Don't die on NULL type. + * typeck.c (type_unknown_p): Don't die on untyped expressions. + +2003-07-01 Mark Mitchell + + PR c++/6949 + * decl2.c (grokfield): Create TEMPLATE_DECLs for methods in local + classes. + +2003-07-01 Kaveh R. Ghazi + + * error.c (locate_error): %P takes an `int', not a `tree'. + +2003-07-02 Jan Hubicka + + * decl2.c (defer_fn): Set DECL_DEFER_OUTPUT. + (finish-file): Do not process function with DECL_DEFER_OUTPUT clear; + clear DECL_DEFER_OUTPUT once function is processed; avoid flags + massaging. + + * cp-tree.h (DECL_NEEDED_P): Support unit-at-a-time + (expand_or_defer_fn): Declare. + (lower_function): Declare. + * decl.c (start_cleanup_fn): Use expand_or_defer_fn. + * decl2.c: Include cgraph.h and varpool.h + (maybe_emit_vtables): Make explicit instantations as needed. + (mark_member_pointers, lower_function): New functions. + (finish_file): Do unit-at-a-time. + * method.c (synthesize_method): Use expand_or_defer_fn. + * optimize.c (maybe_clone_body): Use expand_or_defer_fn. + * parser.c (cp_parser_function_definition_after_decl): Use + expand_or_defer_fn. + * pt.c (instantiate_decl): Likewise. + * semantics.c: Include cgraph.h + (expand_or_defer_fn): Break out from ... + (expand_body): ... here; deal with unit-at-a-time. + * cp-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, + LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Define. + +2003-07-01 Mark Mitchell + + * call.c (resolve_scoped_fn_name): Return error_mark_node for + erroneous cases. + +2003-07-01 Mark Mitchell + + PR c++/11149 + * call.c (resolve_scoped_fn_name): Check that the qualifying scope + is a class type. + +2003-07-01 Giovanni Bajo + + PR c++/8046 + * error.c (dump_decl): Handle BIT_NOT_EXPR as + pseudo destructor calls. + +2003-07-01 Nathan Sidwell + + * cp-tree.h (define_label): Replace filename and lineno + arguments with a location_t. + * decl.c (pop_label): Adjust define_label call. + (define_label): Replace filename and lineno arguments with a + location_t. + * semantics.c (finish_label): Adjust define_label call. + +2003-07-01 Mark Mitchell + + PR c++/9559 + * decl2.c (grokfield): Do not build NOP_EXPRs around the + error_mark_node. + +2003-06-30 Neil Booth + + * Make-lang.in: Update. + * cp-lang.c (c_language): Define. + (LANG_HOOKS_INIT_OPTIONS): Use common hook. + * cp-tree.h (cxx_init_options): Remove. + * lex.c: Don't include diagnostic.h. + (cxx_init_options): Remove. + +2003-06-30 Giovanni Bajo + + PR c++/4933 + * error.c (dump_expr): Support correctly the COMPOUND_EXPR + tree generated within a template. Use dump_expr to dump an + expression sizeof. + +2003-06-30 Giovanni Bajo + + * mangle.c (write_expression): Exit gracefully when trying to + mangle a CALL_EXPR. + +2003-06-30 Giovanni Bajo + + PR c++/10750 + * parser.c (cp_parser_primary_expression): A VAR_DECL with a + (value- or type-) dependent expression as DECL_INITIAL is a + valid constant-expression (at parser time). + +2003-06-30 Giovanni Bajo + + PR c++/11106 + * error.c (dump_decl): Call dump_decl to dump the DECL_NAME for a + USING_DECL, instead of print_tree_identifier. + +2003-06-29 Gabriel Dos Reis + + * cp-tree.h (language_to_string): Adjust declaration. + * dump.c (cp_dump_tree): Adjust usage. + * error.c (dump_char): Use output_formatted_scalar. Tidy. + (parm_to_string): Lose unused parameter. Tidy. + (expr_to_string): Likewise. + (code_to_string): Likewise. + (language_to_string): Likewise. + (op_to_string): Likewise. + (assop_to_string): Likewise. + (digit_buffer): Remove. + (dump_type): Format builtin vector type as __vector__. + +2003-06-29 Gabriel Dos Reis + + * error.c (print_integer): Remove. + (dump_type_suffix): Adjust. + (dump_expr): Likewise. + +2003-06-28 Nathan Sidwell + + * error.c (print_instantiation_partial_context): Take a + location_t. + (print_instantiation_full_context): Adjust. + (print_instantiation_context): Adjust. + + * cp-tree.h (cp_line_of, cp_file_of): Remove. + * error.c (cp_line_of, cp_file_of): Merge into ... + (location_of): ... here. Make static, return a location_t. + (cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust. + +2003-06-28 Nathan Sidwell + + PR c++/10784 + * call.c (joust): Move warn_conversion check outwards. + +2003-06-27 Zack Weinberg + + * decl.c (build_typename_type) + * mangle.c (write_template_template_arg) + * parser.c (cp_parser_scope_through_which_access_occurs) + * pt.c (push_access_scope_real, push_access_scope, pop_access_scope) + * repo.c (get_base_filename) + * semantics.c (maybe_convert_cond): + Mark the definition static, matching the forward declaration. + +2003-06-27 Mark Mitchell + + PR c++/10468 + * pt.c (tsubst): Handle qualified TYPEOF_TYPEs correctly. + +2003-06-27 Mark Mitchell + + PR c++/10796 + * decl.c (finish_enum): Implement DR377. + + * decl.c (cp_finish_decl): Don't make variables with reference + type readonly while they are being initialized. + +2003-06-26 Mark Mitchell + + PR c++/11332 + * typeck.c (build_static_cast): Avoid returning expressions with + reference type. + +2003-06-26 Nathan Sidwell + + * call.c (build_op_delete_call): Use strip_array_call. Correct + error message to say 'delete' or 'delete[]'. + +2003-06-26 Giovanni Bajo + + PR c++/8266 + * pt.c (check_explicit_specialization): When looking up a + template function from an identifier outside class-scope, bind + it to CP_DECL_CONTEXT. + +2003-06-25 Mark Mitchell + + PR c++/10990 + * search.c (lookup_base_r): Rely on accessible_p, rather than + trying to emulate that logic here. + + PR c++/10931 + * call.c (convert_like): Pass issue_conversion_warnings. + (convert_like_with_context): Likewise. + (convert_like_real): Add issue_conversion_warnings parameter. + (perform_direct_initialization_if_possible): New function. + * cp-tree.h (perform_direct_initialization_if_possible): Declare it. + * typeck.c (check_for_casting_away_constness): New function. + (build_static_cast): Rewrite. + +2003-06-24 Nathan Sidwell + + * call.c (enforce_access): Assert we get a binfo. + (build_op_delete_call): Pass a binfo to + perform_or_defer_access_check. + * class.c (alter_access): Likewise. + * decl.c (make_typename_type): Likewise. + (make_unbound_class_template): Likewise. + * lex.c (do_identifier): Likewise. + * method.c (hack_identifier): Likewise. + * parser.c (cp_parser_lookup_name): Likewise. + * search.c (lookup_member): Likewise. Move IDENTIFIER_CLASS_VALUE + test. + * semantics.c (finish_non_static_data_member): Likewise. + (perform_or_defer_access_check): Expect a binfo. + * typeck.c (comptypes): Expect types. + + * mangle.c (find_substitution): Don't pass a non-type to same_type_p + * friend.c (make_friend_class): Likewise. + * pt.c (check_default_tmpl_args): Likewise. + (lookup_template_class): Likewise. + +2003-06-24 Jan Hubicka + + * method.c (thunk_labelno): Move outside ifdef block to make garbage + collector happy. + +2003-06-24 Jan Hubicka + + * class.c (build_vtable): Make vtables. + * cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro. + * decl2.c (output_vtable_inherit): Rename to ... + (prepare_assemble_variable): ... this one; change interface. + (maybe_emit_vtables): Do not call output_vtable_inherit. + * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define. + * cp-tree.h (prepare_assemble_variable): New. + +2003-06-23 Andrew Pinski + + * method.c: add prototype for make_alias_for_thunk. + (thunk_labelno, make_alias_for_thunk): only define + if ASM_OUTPUT_DEF is defined. + +2003-06-23 Jakub Jelinek + + * method.c (thunk_labelno): New variable. + (make_alias_for_thunk): New function. + (use_thunk): Use it if defined ASM_OUTPUT_DEF. Put the thunk + into the same section as the function it is calling. + Include gt-cp-method.h. + * Make-lang.in (gt-cp-method.h): Depend on s-gtype. + (cp/method.o): Depend on gt-cp-method.h. + * config-lang.in (gtfiles): Add $(srcdir)/cp/method.c. + +2003-06-23 Jan Hubicka + + * decl.c (register_dtor_fn): Mark cleanup as used. + * decl2.c (mark_vtable_entries): Skip nops. + * rtti.c (get_tinfo_ptr): Mark tinfo as used. + (build_dynamic_cast_1): Likewise. + (tinfo_base_init): Likewise. + (emit_tinfo_decl): Likewise. + +2003-06-23 Jakub Jelinek + + * mangle.c (hash_type): Val is the TREE_LIST itself, not a pointer + to it. + +2003-06-21 Gabriel Dos Reis + + PR c++/10784 + * call.c (joust): Warn about choosing conversion sequence only if + -Wconversion. + +2003-06-21 Gabriel Dos Reis + + PR c++/10864 + * call.c (op_error): Tidy. + * error.c (dump_expr): Properly format 'T()' when T is an + aggregate type. + +2003-06-21 Gabriel Dos Reis + + PR c++/10915 + * decl.c (grok_op_properties): Warn possible confusing conversion + only if -Wconversion. + +2003-06-20 Mark Mitchell + + PR c++/10749 + * parser.c (cp_parser_class_head): See through dependent names + when parsing a class-head. + + PR c++/10845 + * pt.c (try_class_unification): Correct handling of member class + templates. + +2003-06-20 Nathan Sidwell + + * semantics.c (genrtl_finish_function): Adjust + expand_function_end call. + +2003-06-19 Mark Mitchell + + PR c++/10939 + * pt.c (tsubst_decl): Do not try to substitute into non-dependent + functions. + (value_dependent_expression_p): Correct logic for FUNCTION_DECLs. + + PR c++/9649 + * cp-tree.h (pushdecl_class_level): Change prototype. + (push_class_level_binding): Likewise. + * decl.c (add_binding): Reject duplicate static data members. + (pushdecl_class_level): Return a value indicating whether or not + the binding was valid. + (push_class_level_binding): Likewise. + * semantics.c (finish_member_declaration): Don't keep invalid + declarations. + + PR c++/11041 + * call.c (initialize_reference): Do not use cp_finish_decl to emit + temporary variables. + * cp-tree.h (static_aggregates): Declare. + (pushdecl_top_level_and_finish): Likewise. + * decl.c (pushdecl_top_level_1): New function. + (pushdecl_top_level): Use it. + (pushdecl_top_level_and_finish): New function. + (initialize_local_var): Remove redundant code. + (cp_finish_decl): Remove support for RESULT_DECLs. Don't check + building_stmt_tree. + * decl.h (static_aggregates): Remove. + * decl2.c (get_guard): Use pushdecl_top_level_and_finish. + * rtti.c (get_tinfo_decl): Use pushdecl_top_level_and_finish. + (tinfo_base_init): Likewise. + +2003-06-19 Matt Austern + + PR c++/11228 + * init.c (build_zero_init): Assert that number of array elements + is an integer constant. + (build_default_init) Don't use build_zero_init for arrays with + variable number of elements. + +2003-06-19 Andreas Jaeger + + * cp-tree.h: Remove duplicated declarations. + +2003-06-18 Nathanael Nerode + + * pt.c: Convert to ISO C. + * semantics.c: Convert to ISO C. + +2003-06-18 Nathan Sidwell + + * cp-tree.h (comp_except_specs, compparms, cp_has_mutable_p, + at_least_as_qualified_p, more_qualified_p): Return bool. + * typeck.c: ANSIFY function definitions. + (comp_array_types): Take redeclaration bool parameter. + (comptypes): Rearrange STRICT handling. + (at_least_as_qualified_p, more_qualified_p, + comp_cv_qualification): Cache cv quals. + (compparms): Rearrange loop. + +2003-06-18 Nathan Sidwell + + * cp-tree.h (COMPARE_RELAXED): Rename to ... + (COMPARE_DERIVED): ... here. Adjust comment. + (resolve_typename_type_in_current_instantiation): Remove. + (cp_tree_equal, comptypes): Return a bool. + * cvt.c (convert_to_reference): Adjust comptypes call. + * pt.c (template_args_equal, unify,): Adjust cp_tree_equal call. + (resolve_typename_type_in_current_instantiation): Remove. + * tree.c (cp_tree_equal): Return bool. Cope with TEMPLATE_DECLs and + IDENTIFIER_NODEs. Abort if undeciderable. Adjust recursive + calls. Refactor code. + * typeck.c (comp_array_types): Return bool. Lose callback. + parameter. Adjust cp_tree_equal calls. + (comptypes): Return bool. Adjust strict handling. Remove relaxed + enumeration and java type handling. Deal with typename types here. + Adjust recursive and cp_tree_equals calls. Adjust base and derived + checking. + (comp_target_types): Remove unreachable code. Adjust + same_or_base_type_p calls. + (ptr_reasonably_similar): Adjust base and derived check. + + * typeck.c (maybe_warn_about_returning_address_of_local): Remove + unused calculation. + (check_return_expr): Adjust error messages. + * cp-tree.def (SCOPE_REF): Correct comment. + +2003-06-17 Mark Mitchell + + * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format + string again. + +2003-06-17 Robert Abeles + + * optimize.c (dump_function): Form complete flag name by + prefixing 'fdump-' to string returned by dump_flag_name(). + +2003-06-17 Mark Mitchell + + * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format + string. + +2003-06-17 Jason Merrill + + PR c++/10929 + * decl.c (grokfndecl): Don't mark a function inline for + -finline-functions if it isn't defined. + +2003-06-17 Mark Mitchell + + PR c++/10712 + * class.c (handle_using_decl): Robustify. + + PR c++/11105 + * cp-tree.h (DECL_CONV_FN_TYPE): New method. + * mangle.c (struct globals): Remove internal_mangling_p. + (write_unqualified_name): Use DECL_CONV_FN_TYPE. + (write_template_parm): Don't write out the level number. + (conv_type_names): New variable. + (hash_type): New function. + (compare_type): Likewise. + (mangle_conv_op_name_for_type): Don't try to mangle conversion + operator names. + * search.c (lookup_conversion_operator): New function. + (lookup_fnfields_1): Use it. + +2003-06-17 Andreas Jaeger + + * except.c: Remove duplicate declaration of push_eh_cleanup. + + * call.c: Remove extra declaration of inhibit_warnings. + +2003-06-16 Nathanael Nerode + + 2003-06-16 Jens-Michael Hoffmann + * mangle.c: Convert to ISO C. + +2003-06-16 Kaveh R. Ghazi + + * cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR + macro. + +2003-06-16 Nathanael Nerode + + * tree.c: Convert to ISO C. + +2003-06-16 Kazu Hirata + + * cp-tree.h: Follow spelling conventions. + * mangle.c: Likewise. + * method.c: Likewise. + * parser.c: Likewise. + +2003-06-14 Nathan Sidwell + + * decl.c (start_function): Adjust init_function_start call. + * method.c (use_thunk): Likewise. + * semantics.c (genrtl_start_function): Likewise. + +2003-06-14 Neil Booth + + * Make-lang.in: Remove c-options.o. + +2003-06-13 Nathanael Nerode + + * lex.c: Convert to ISO C. + + 2003-05-19 Jens-Michael Hoffmann + * init.c: removes use of PARAMS macro. Use ISO style function + declarations. (Not copyright-significant change.) + + * rtti.c: Remove PARAMS. + + * typeck2.c: Convert to ISO C. + +2003-06-12 Mark Mitchell + + PR c++/10635 + * typeck.c (build_c_cast): Check that the destination type is + complete. + +2003-06-11 Mark Mitchell + + PR c++/10432 + * cp-tree.h (finish_declarator): Remove. + * decl.c (cp_finish_decl): Make sure to pop_nested_class even for + erroneous declarations. + * semantics.c (finish_declarator): Remove. + +2003-06-11 Roger Sayle + + * decl2.c (generate_ctor_or_dtor_function): Avoid expanding a + global static constructor/destructor if it will be empty, i.e. + either doesn't call any ctors/dtors or only calls pure or const + ctors/dtors. + +2003-06-11 Mark Mitchell + + * mangle.c (tm_p.h): Include it. + * Make-lang.in (cp/mangle.o): Depend on $(TM_P_H). + + PR c++/11131 + * tree.c (cp_cannot_inline_fn): Check for "inline" before + instantiation. + +2003-06-10 Jason Merrill + + PR c++/10968 + * pt.c (mark_decl_instantiated): Clear DECL_COMDAT. + +2003-06-10 Andrew Pinski + + * decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY. + (start_cleanup_cnt): New. + +2003-06-10 Mark Mitchell + + PR c++/11131 + * cp-tree.h (template_for_substitution): Declare. + * decl2.c (mark_used): Use it when figuring out whether or not a + function is inline. + * pt.c (template_for_substitution): Give it external linkage. + * tree.c (cp_cannot_inline_tree_fn): Instantiate as early as + possible. + +2003-06-09 Zack Weinberg + + PR 8861 + * mangle.c (write_real_cst): New function. Implement + ABI-compliant mangling of floating-point literals when + -fabi-version>=2; provide backward compatibility with 3.3 when + -fabi-version=1 (with warning). Clarify commentary. + (write_template_arg_literal): Use write_real_cst. + +2003-06-07 Andreas Jaeger + + * cp/decl.c (xref_tag): Remove undefined macro NONNESTED_CLASSES. + +2003-06-07 Neil Booth + + * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. + (LANG_HOOKS_HANDLE_OPTION): Override. + * cp-tree.h (cxx_init_options): Update. + * lex.c (cxx_init_options): Update. + +2003-06-05 Jan Hubicka + + * Make-lang.in: Add support for stageprofile and stagefeedback + +2003-06-04 J"orn Rennecke + + * decl.c (grokdeclarator): Error_mark_node in, error_mark_node out. + +2003-06-04 Andreas Jaeger + + * g++spec.c (lang_specific_driver): Remove ALT_LIBM usage. + +2003-06-03 Jason Merrill + + * cp/cp-tree.h (CP_AGGREGATE_TYPE_P): Accept vectors. + + * cp/decl.c (reshape_init): Handle vectors. + + * testsuite/g++.dg/init/array10.C: New. + +2003-06-03 Kriang Lerdsuwanakij + + PR c++/10940 + * pt.c (check_explicit_specialization): Check for 'static' + earlier. + +2003-05-31 Diego Novillo + + * class.c (dump_array): Call CONSTRUCTOR_ELTS to access + the operand of a CONSTRUCTOR node. + +2003-05-31 Gabriel Dos Reis + + * decl.c (cp_binding_level::this_entity): Rename from this_class. + (cxx_scope_descriptor): New function. + (cxx_scope_debug): Likewise. + (push_binding_level): Use it. + (pop_binding_level): Likewise. + (suspend_binding_level): Likewise. + (resume_binding_level): Likewise. + (pushlevel_class): Adjust use of this_class. + (pushtag): Likewise. + (lookup_name_real): Likewise. + (global_scope_name): New variable. + (initialize_predefined_identifiers): Initialize it. + (push_namespace): Use it. + (make_cxx_scope): New function. + (pushlevel): Use it. + (pushlevel_class): Likewise. + (push_binding_level): Simplify. Loose the last two arguments. + (make_binding_level): Remove. + (initial_push__namespace_scope): New function. + (push_namespace): Use it. Simplify. + (cxx_init_decl_processing): Likewise. + (declare_namespace_level): Remove. + +2003-05-31 Kriang Lerdsuwanakij + + PR c++/10956 + * pt.c (instantiate_decl): Don't use full template arguments if + we are dealing with specializations. + +2003-05-29 Gabriel Dos Reis + + * decl.c (ENABLE_SCOPE_CHECKING): Rename from DEBUG_BINDING_LEVELS. + (binding_depth): Unconditionally define. + (is_class_level): Likewise. + (indent): Likewise. Take an indenting parameter. + (push_binding_level): Remove conditional definittion. + (pop_binding_level): Likewise. + (suspend_binding_level): Likewise. + (resume_binding_level): Likewise. + (pushlevel): Likewise. + (pushlevel_class): Likewise. + (poplevel_class): Likewise. + (pop_everything): Likewise. + +2003-05-27 Gabriel Dos Reis + + * name-lookup.h (global_scope_p): New macro. + * decl.c (pop_binding_level): Use it. Don't refer directly to + global_binding_level. + (suspend_binding_level): Likewise. + (global_bindings_p): Likewise. + (print_other_binding_stack): Likewise. + (print_binding_stack): Likewise. + (maybe_push_to_top_level): Likewise. + (pushdecl_namespace_level): Likewise. + (cxx_init_decl_processing): Likewise. + (start_decl): Likewise. + (cp_finish_decl): Likewise. + (start_function): Likewise. + (global_binding_level): Remove. + +2003-05-25 Kriang Lerdsuwanakij + + * parser.c (cp_parser_explicit_instantiation): Restore old + access before template instantiation. + +2003-05-23 Geoffrey Keating + + * lang-specs.h: Use -o to specify preprocessor's output file. + Make -no-integrated-cpp work when building PCH files. + +2003-05-23 Kriang Lerdsuwanakij + + PR c++/10682 + * pt.c (instantiate_class_template): Use DECL_ARTIFICIAL to + check for implicitly created typedef to an enum. + +2003-05-21 Jason Merrill + + * init.c (build_vec_delete): Copy the address into a temporary + variable before calling build_vec_delete_1. + * decl2.c (delete_sanity): Don't call stabilize_reference. + +2003-05-21 Nathan Sidwell + + * pt.c (register_specialization): Update the decl's location, + if necessary. + (check_explicit_specialization): Likewise. + +2003-05-20 Kaveh R. Ghazi + + * error.c (dump_expr): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX. + +2003-05-21 Danny Smith + + PR c++/9738 + * decl.c (duplicate_decls): Re-invoke make_decl_rtl + if the old decl had instantiated DECL_RTL. + (Base on Richard Henderson 2003-05-13 patch to c-decl.c). + +2003-05-19 Matt Austern + + * lang-options.h: Document -Wno-invalid-offsetof + * typeck.c (build_class_member_access_expr): Don't complain about + (Foo *)p->x for non-POD Foo if warn_invalid_offset is zero. + +2003-05-18 Andrew Pinski + + * name-lookup.c (free_binding_entry): fix where the GTY markers are. + (binding_entry_make): Make entry->chain NULL after getting an entry. + fix the spelling of chain in a comment. + (binding_table_free): speed up by having temporary variable. + (binding_table_new): set table->chain to be NULL after allocating + a table. + (cxx_binding_make): use gcc_alloc instead of ggc_alloc_cleared and set + binding->previous to NULL after getting an binding for speed. + +2003-05-18 Gabriel Dos Reis + + * cp-tree.h (struct lang_type_class): Replace data member tags + with hash-table nested_udts. + (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. + * class.c (unreverse_member_declarations): Don't touch + CLASSTYPE_TAGS. + (pushclass): Use cxx_remember_type_decls. + * decl.c (struct cp_binding_level): Replace data member tags with + hash-table type_decls. + (pop_binding_level): Handle level->type_decls. + (kept_level_p): Adjust. + (poplevel): Remove unused local variable. + (bt_print_entry): New function. + (print_binding_level): Use it. + (push_namespace): Build current_binding_level->type_decls. + (maybe_process_template_type_declaration): Adjust. + (pushtag): Likewise. + (clear_anon_tags): Use binding_table_remove_anonymous_types. + (gettags): Remove. + (cxx_remember_type_decls): Rename from storetags. Adjust. + (lookup_tag): Use binding_table_find_anon_type. Tidy. + (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. + (cxx_init_decl_processing): Build global_binding_level->type_decls. + (store_parm_decls): Remove pointless code. + * name-lookup.c (free_binding_entry): New variable. + (ENTRY_INDEX): New macro. + (struct binding_table_s): New datatype. + (binding_entry_make): New function. + (binding_entry_free): Likewise. + (binding_table_construct): Likewise. + (binding_table_free): Likewise. + (binding_table_new): Likewise. + (binding_table_expand): Likewise. + (binding_table_insert): Likewise. + (binding_table_find): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + (binding_table_remove_anonymous_types): Likewise. + (binding_table_foreach): Likewise. + * name-lookup.h (binding_table): New type. + (binding_entry): Likewise. + (bt_foreach_proc): Likewise. + (struct binding_entry_s): New datatype. + (SCOPE_DEFAULT_HT_SIZE): New macro. + (CLASS_SCOPE_HT_SIZE): Likewise. + (NAMESPACE_ORDINARY_HT_SIZE): Likewise. + (NAMESPACE_STD_HT_SIZE): Likewise. + (GLOBAL_SCOPE_HT_SIZE): Likewise. + (binding_table_new): Declare. + (binding_table_free): Likewise. + (binding_table_insert): Likewise. + (binding_table_find_anon_type): Likewise. + (binding_table_reverse_maybe_remap): Likewise. + (binding_table_remove_anonymous_types): Likewise. + (binding_table_foreach): Likewise. + (binding_table_find): Likewise. + (cxx_remember_type_decls): Likewise. + * pt.c (bt_instantiate_type_proc): New function. + (do_type_instantiation): Use it. + * search.c (lookup_field_r): Use binding_table_find. + +2003-05-18 Kriang Lerdsuwanakij + + * semantics.c (perform_deferred_access_checks): Don't discard + checked access. + +2003-05-17 Kaveh R. Ghazi + + * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate + libiberty VA_ macros, always use stdarg. + * rtti.c (create_pseudo_type_info): Likewise. + * tree.c (build_min_nt, build_min): Likewise. + +2003-05-16 Kaveh R. Ghazi + + * ptree.c (cxx_print_type, cxx_print_xnode): Use string + concatentation on HOST_WIDE_INT_PRINT_* format specifier to + collapse multiple function calls into one. + * tree.c (debug_binfo): Likewise. + +2003-05-15 Jason Merrill + + PR c++/5388 + * call.c (conditional_conversion): Don't consider implicit + conversions if T2 is a base of T1. + * cp-tree.h (DERIVED_FROM_P, UNIQUELY_DERIVED_FROM_P): Make boolean. + (ACCESSIBLY_UNIQUELY_DERIVED_P, PUBLICLY_UNIQUELY_DERIVED_P): Likewise. + + * parser.c (cp_parser_primary_expression): Convert a static data + member from reference. + +2003-05-15 Mark Mitchell + + * call.c (build_op_delete_call): Avoid creating unnecessary types. + * class.c (instantiate_type): Remove tests for tf_no_attributes. + * cp-tree.h (tsubst_flags_t): Remove tf_no_attributes. + (COMPARE_NO_ATTRIBUTES): Remove. + * typeck.c (comptypes): Do not check COMPARE_NO_ATTRIBUTES. + + PR c++/8385 + * semantics.c (finish_typeof): Refine type-dependency check. + +2003-05-13 Jason Merrill + + * typeck.c (build_modify_expr): Don't always stabilize the lhs and + rhs. Do stabilize the lhs of a MODIFY_EXPR used on the lhs. + +2003-05-11 Kriang Lerdsuwanakij + + * method.c (synthesize_method): Call push/pop_deferring_access_checks. + +2003-05-11 Kriang Lerdsuwanakij + + PR c++/10230, c++/10481 + * semantics.c (finish_non_static_data_member): Handle when the + non-static member is not from a base of the current class type. + +2003-05-11 Kriang Lerdsuwanakij + + PR c++/10552 + * pt.c (tsubst_copy): Handle TEMPLATE_DECL that is a member class + template and has dependent context. + +2003-05-10 Kriang Lerdsuwanakij + + * pt.c (instantiate_decl): Call push/pop_deferring_access_checks. + +2003-05-10 Kriang Lerdsuwanakij + + PR c++/9252 + * cp-tree.h (saved_scope): Remove check_access field. + (tsubst_flags_t): Remove tf_parsing. + * decl.c (maybe_push_to_top_level): Don't initialize + scope_chain->check_access. + (make_typename_type, make_unbound_class_template): Don't use + tf_parsing. + (register_dtor_fn): Use push/pop_deferring_access_checks + instead of scope_chain->check_access. + * method.c (use_thunk): Likewise. + * parser.c (cp_parser_explicit_instantiation + (cp_parser_constructor_declarator_p): Don't call + push/pop_deferring_access_checks here. + (cp_parser_template_argument, cp_parser_class_name): Don't use + tf_parsing. + (yyparse): Check flag_access_control. + * pt.c (instantiate_class_template): Call + push/pop_deferring_access_checks. + * semantics.c (push_deferring_access_checks): Propagate + dk_no_check. + (perform_or_defer_access_check): Make sure basetype_path is + a type before comparison. + * call.c (build_op_delete_call, build_over_call): Use + perform_or_defer_access_check. + * class.c (alter_access): Likewise. + * init.c (build_offset_ref): Likewise. + * lex.c (do_identifier): Likewise. + * method.c (hack_identifier): Likewise. + * search.c (lookup_member): Likewise. + * semantics.c (finish_non_static_data_member): Likewise. + (simplify_aggr_init_exprs_r): Use push/pop_deferring_access_checks + instead of flag_access_control. + +2003-05-10 Kriang Lerdsuwanakij + + PR c++/9554 + * parser.c (cp_parser_class_name): Remove check_access parameter. + All caller adjusted. Update declaration. + (cp_parser_lookup_name): Likewise. + * semantics.c (push_deferring_access_checks): Change parameter type + to enum deferring_kind. All caller adjusted. + (resume_deferring_access_checks): Adjust to use new enum. + (stop_deferring_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + * cp-tree.h (deferring_kind): New enum. + (deferred_access): Adjust field type. + (push_deferring_access_checks): Update declaration. + +2003-05-09 Kriang Lerdsuwanakij + + PR c++/10555, c++/10576 + * pt.c (lookup_template_class): Handle class template with + multiple levels of parameters when one of the levels contain + errors. + +2003-05-08 Jason Merrill + + * init.c (build_new_1): Don't reuse a TARGET_EXPR in an + expression. Undo some of the recent reorg. + +2003-05-07 Richard Henderson + + PR c++/10570 + * cfns.gperf: Comment out POSIX thread cancellation points, + plus abort and raise. + * cfns.h: Regenerate. + +2003-05-07 Jason Merrill + + * call.c (build_conditional_expr): Don't assume that the folded + expression has result_type. + +2003-05-06 Kriang Lerdsuwanakij + + * typeck.c (build_unary_op): Deal with const qualifier in + invalid pointer-to-member earlier. + +2003-05-05 Jason Merrill + + PR c++/9537 + * call.c (conditional_conversion): Build an RVALUE_CONV if + we're just changing the cv-quals. + (build_conditional_expr): Don't call convert to change + cv-quals. + +2003-05-05 Kriang Lerdsuwanakij + + PR c++/10496 + * typeck.c (build_unary_op): Don't output const qualifier when + output invalid pointer-to-member diagnostics. + +2003-05-05 Kriang Lerdsuwanakij + + * decl.c: Fix typos. + +2003-05-05 Kriang Lerdsuwanakij + + PR c++/4494 + * decl.c (start_function): Use same_type_p to check return type + of main. + +2003-05-03 Zack Weinberg + + PR c/10604 + * cp/typeck.c (build_x_compound_expr): No need to check + extra_warnings as well as warn_unused_value. + +2003-05-03 Kriang Lerdsuwanakij + + PR c++/9364, c++/10553, c++/10586 + * decl.c (make_typename_type): Don't crash on illegal code. + +2003-05-03 Nathan Sidwell + + * class.c (finish_struct): Use location_t and input_location + directly. + * decl.c (make_label_decl): Likewise. + (use_label): Likewise. + * decl2.c (warn_if_unknown_interface): Likewise. + (start_static_initialization_or_destruction): Likewise. + (generate_ctor_or_dtor_function): Likewise. + (finish_file): Likewise. + * error.c (print_instantiation_full_context): Likewise. + * init.c (create_temporary_var): Likewise. + * method.c (synthesize_method): Likewise. + * parser.c (cp_token): Likewise. + (cp_lexer_set_source_position_from_token): Likewise. + (cp_lexer_get_preprocessor_token): Likewise. + (cp_parser_statement): Likewise. + * pt.c (tsubst_friend_function): Likewise. + (instantiate_class_template): Likewise. + (tsubst_decl): Likewise. + (tsubst): Likewise. + (instantiate_decl): Likewise. + * semantics.c (begin_class_definition): Likewise. + (expand_body): Likewise. + +2003-05-01 Nathan Sidwell + + * class.c (finish_struct): Rename lineno to input_line. + * decl.c (push_binding_level, pop_binding_level, + suspend_binding_level, resume_binding_level, make_label_decl, + use_label, start_function): Likewise. + * decl2.c (warn_if_unknown_interface, + start_static_initialization_or_destruction, + generate_ctor_or_dtor_function, finish_file): Likewise. + * error.c (cp_line_of, print_instantiation_full_context, + print_instantiation_context): Likewise. + * except.c (check_handlers_1, check_handlers): Likewise. + * init.c (create_temporary_var): Likewise. + * method.c (use_thunk, synthesize_method): Likewise. + * parser.c (cp_lexer_set_source_position_from_token, + cp_lexer_get_preprocessor_token): Likewise. + * pt.c (push_tinst_level, pop_tinst_level, + tsubst_friend_function, instantiate_class_template, tsubst_decl, + tsubst, tsubst_expr, instantiate_decl): Likewise. + * semantics.c (genrtl_try_block, finish_label_stmt, + begin_class_definition, expand_body, + genrtl_finish_function): Likewise. + * tree.c (build_min_nt, build_min): Likewise. + +2003-05-01 Mark Mitchell + + * decl2.c (comdat_linkage): Don't externalize explicit + instantiations. + +2003-05-01 Kriang Lerdsuwanakij + + PR c++/10554 + * decl2.c (do_class_using_decl): Check if operand 0 of SCOPE_REF + is not NULL. + +2003-05-01 Steven Bosscher + + * cp-tree.h (struct lang_id2): Remove. Move fields from here... + (struct lang_identifier): ... to here. + (LANG_ID_FIELD): Remove. + (SET_LANG_ID): Remove. + (IDENTIFIER_LABEL_VALUE): Adjust for new lang_identifier. + (SET_IDENTIFIER_LABEL_VALUE): Likewise. + (IDENTIFIER_IMPLICIT_DECL): Likewise. + (SET_IDENTIFIERL_IMPLICIT_DECL): Likewise. + (IDENTIFIER_ERROR_LOCUS): Likewise. + (SET_IDENTIFIER_ERROR_LOCUS): Likewise. + +2003-05-01 Kriang Lerdsuwanakij + + PR c++/8772 + * pt.c (convert_template_argument): Correct diagnostic. + +2003-04-30 Kriang Lerdsuwanakij + + PR c++/9432, c++/9528 + * decl2.c (validate_nonmember_using_decl): Handle SCOPE_REF. + +2003-04-30 Garbiel Dos Reis + + * decl.c (check_previous_goto_1): Adjust prototype. + (check_previous_goto): Adjust use. + (check_switch_goto): Likewise. + (use_label): Adjust. + (check_previous_goto_1): Don't use pedwarn_with_file_and_line. + (struct named_label_use_list): Use location_t datatype. + +2003-04-29 Mark Mitchell + + PR c++/10551 + * pt.c (mark_decl_instantiated): Defer all explicit instantiations + that have not yet been written out. + +2003-04-29 Mark Mitchell + + PR c++/10549 + * class.c (layout_class_type): Mark overlong bitfields as having + the maximum size permitted by their type, after layout. + + PR c++/10527 + * error.c (dump_expr): Correctly handling of NEW_EXPR.4 + +2003-04-29 Kriang Lerdsuwanakij + + * call.c (build_operator_new_call): Fix typo. + * lang-options.h: Likewise. + +2003-04-29 Mark Mitchell + + PR c++/10515 + * cp-tree.h (lookup_field_1): Declare it. + * search.c (lookup_field_1): Make it public. + * decl.c (reshape_init): Handle designated initializers. + + * decl.c (maybe_commonize_var): Further tweak support for systems + without weak symbols. + +2003-04-27 Mark Mitchell + + * decl.c (maybe_commonize_var): Fix thinko in last patch. + +2003-04-27 Mark Mitchell + + PR c++/10506 + * method.c (use_thunk): Decrement immediate_size_expand. + + PR c++/10503 + * cp-tree.h (DECL_VAR_MARKED_P): New macro. + (DECL_MAYBE_TEMPLATE): Remove. + * class.c (fixed_type_or_null): Avoid infinite recursion. + + * decl.c (maybe_commonize_var): Make the code match the comments. + * pt.c (instantiate_decl): Move call to import_export_decl. + +2003-04-26 Mark Mitchell + + * decl2.c (finish_file): Fix merge botch. + +2003-04-25 Mark Mitchell + + * decl2.c (finish_file): Don't call import_export_decl for + functions that are not defined. + (handle_class_head): Robustify. + * pt.c (instantiate_decl): Do not call cp_finish_decl for + variables that are not defined. + +2003-04-24 Sylvain Pion + + * call.c (print_z_candidates): Fix off by one error. + +2003-04-24 Nathan Sidwell + + PR c++/10337 + * call.c (joust): Don't warn about conversion ops that are exact + or cv-conversions. Rearrange to avoid multiple type comparisons. + +2003-04-23 Mark Mitchell + + PR c++/10471 + * call.c (build_cxx_call): Robustify. + +2003-04-23 Neil Booth + + * Make-lang.in (lex.o): Remove mbchar.h. + * lex.c (MULTIBYTE_CHARS): Lose. + * parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled + in c-lex.c. + +2003-04-23 Mark Mitchell + + PR c++/9847 + * cp-tree.h (duplicate_tag_error): Remove. + * class.c (duplicate_tag_error): Remove. + * semantics.c (begin_class_definition): Return immediately for a + duplicate class definition. + + PR c++/10451 + * decl.c (grokdeclarator): Correct logic for "mutable" errors. + +2003-04-22 Mark Mitchell + + PR c++/10446 + * search.c (lookup_fnfields_1): Handle empty slots in the method + vector. + + PR c++/10428 + * decl.c (check_elaborated_type_specifier): New function, split + out from ... + (xref_tag): ... here. Use the new function in more places. + + * rtti.c (throw_bad_typeid): Use build_cxx_call. + +2003-04-21 Mark Mitchell + + * call.c (build_over_call): Use build_cxx_call. + (build_cxx_call): New method, split out of build_over_call. + * cp-tree.h (language_function): Add can_throw. + (build_cxx_call): Declare it. + * decl.c (finish_function): If a function does not contain any + calls to functions that can throw an exception, indicate that + fact. + * decl2.c (mark_used): Do not defer the instantiation of + functions, if the current function does not throw. + * optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones. + * pt.c (instantiate_decl): Make sure import_export_decl is called + before emitting things. + * rtti.c (throw_bad_cast): Use build_cxx_call. + (build_dynamic_cast_1): Likewise. + * typeck.c (build_function_call): Likewise. + +2003-04-21 Nathan Sidwell + + PR c++/9881 + * typeck.c (build_unary_op): Fold all COMPONENT_REF addr + expressions. Reverts my 2002-08-08 patch. + + * typeck.c (comp_ptr_ttypes_real): Swap final && operands for + cheaper early exit. + +2003-04-20 Nathan Sidwell + + * cp/decl2.c (start_static_storage_duration_function): Take count + arg, don't check if it wraps round. + (generate_ctor_or_dtor_function): Add locus arg, use it. + (generate_ctor_and_dtor_functions_for_priority): Data arg is a + locus. + (finish_file): Set line numbers to past EOF for synthesized + functions. + +2003-04-20 Nathan Sidwell + + PR c++/10405 + * search.c (lookup_field_1): Final scan goes backwards for + types, forwards for non-types. + +2003-04-17 Roger Sayle + + PR c/10375 + * decl.c (duplicate_decls): Preserve "const", "noreturn" and + "nothrow" function attributes. + +2003-04-17 Kriang Lerdsuwanakij + + PR c++/10347 + * pt.c (type_dependent_expression_p): Handle array new. + +2003-04-15 Mark Mitchell + + PR c++/10381 + * parser.c (cp_parser_primary_expression): Reorganize logic for + dealing with name lookup failures. + +2003-04-15 Jason Merrill + + * decl2.c (mark_used): Don't instantiate anything if + skip_evaluation. + +2003-04-14 Ziemowit Laski + + * tree.c (build_cplus_array_type_1): Do not call + uses_template_parms() on a NULL index_type. + +2003-04-13 Roger Sayle + + * decl.c (duplicate_decls): Preserve pure and malloc attributes. + +2003-04-12 Mark Mitchell + + PR c++/10300 + * init.c (build_new_1): Reorganize. + +2003-04-12 Zack Weinberg + + * class.c (initialize_array) + * decl.c (reshape_init) + * decl2.c (build_expr_from_tree) + * init.c (build_zero_init) + * pt.c (tsubst_copy, tsubst_copy_and_build) + * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer) + (ptm_initializer, class_initializer, get_pseudo_ti_init) + * semantics.c (finish_compound_literal) + * typeck.c (build_ptrmemfunc1) + * typeck2.c (store_init_value, process_init_constructor) + (build_functional_cast): Use build_constructor. + +2003-04-12 Zack Weinberg + + * call.c (print_z_candidates): Use gcc_gettext_width, not + strlen, to determine how much padding to use. + +2003-04-10 Zack Weinberg + + * decl.c: Update all calls to shadow_warning. + +2003-04-10 Mark Mitchell + + * class.c (layout_class_type): Correct handling for overlong + bit-fields whose width is the same as an integer type. + +2003-04-06 Zack Weinberg + + * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero. + * cp-lang.c (cp_tree_size): New function. + (LANG_HOOKS_TREE_SIZE): Override. + + * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct + tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill. + (union lang_tree_node): Remove common and srcloc members. + (build_srcloc_here): Don't prototype. + * decl.c (cp_tree_node_structure): Kill SRCLOC case. + * pt.c (pending_templates): Correct comment. + * tree.c (build_srcloc, build_srcloc_here): Kill. + +2003-04-06 Zack Weinberg + + * call.c: Include intl.h. + (print_z_candidate): Always use inform; get rid of errfn + argument. Reorganize so that all the strings get picked up + by xgettext. Note obligation of caller to pass first argument + through gettext. + (print_z_candidates): Update to match. Indent second and + successive candidates by strlen() of translated message. + (joust): Restructure ambiguous-conversion pedwarn so that + translators see a complete sentence. Update calls to + print_z_candidate. + + * Make-lang.in (cp/call.o): Update dependencies. + +2003-04-05 Kaveh R. Ghazi + + * decl.c (set_current_binding_level): Delete, revert last change. + (current_binding_level): Modify to allow it as as lvalue. + +2003-04-04 Kaveh R. Ghazi + + * name-lookup.c (find_binding): Pass appropriate pointer type to + POP_TIMEVAR_AND_RETURN. + +2003-04-03 Kaveh R. Ghazi + + * Make-lang.in (cp-warn): Add $(STRICT_WARN). + * cp-tree.h: Don't insist on having GNUC. + +2003-04-03 Jason Merrill + + * cvt.c (ocp_convert): Only abort if we try to convert an object + of TREE_ADDRESSABLE type. + + * class.c (build_vtable): Set DECL_ALIGN here. + (get_vtable_decl): Not here. + (layout_vtable_decl): Or here. + (create_vtable_ptr): Or here. + (layout_class_type): Or here. + (check_bitfield_decl): Don't mess with field alignment. + +2003-04-03 Kaveh R. Ghazi + + * operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR, + DEF_ASSN_OPERATOR): Delete spurious semi-colon. + * rtti.c (dfs_class_hint_mark): Likewise. + + * decl.c (push_local_name, push_class_level_binding, + maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in + functions returning void. + * decl2.c (add_using_namespace): Likewise. + + * decl.c (print_binding_level, print_other_binding_stack, + print_binding_stack): Cast argument of %p specifier to void*. + * ptree.c (cxx_print_decl): Likewise. + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK, + VAR_FUNCTION_OR_PARM_DECL_CHECK, + VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK, + BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK, + LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__. + + * decl.c (set_current_binding_level): New macro. Use throughout + when setting the current binding level. + + * cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma + in enum. + * method.c (mangling_flags): Likewise. + + * cp-tree.h (lang_type_header): Add __extension__ and use + CHAR_BITFIELD for members. + +2003-04-02 Geoffrey Keating + + PR other/9274 + * mangle.c: Include gt-cp-mangle.h. + (subst_identifiers): Mark with GTY. + * config-lang.in (gtfiles): Add cp/mangle.c. + * Make-lang.in: (gt-cp-mangle.h): New rule. + (cp/mangle.o): Depends on gt-cp-mangle.h. + +2003-04-01 Andrew Pinski + + * config-lang.in (gtfiles): Add \$(srcdir)/cp/name-lookup.c + after \$(srcdir)/cp/name-lookup.h. + * name-lookup.c: (cxx_binding_make): Use ggc_alloc_clearedinstead + of ggc_alloc. Include gt-cp-name-lookup.h at the end of the file. + * Make-lang.in: (gt-cp-name-lookup.h): Is generated by gengtype. + (cp/name-lookup.o): Depends on gt-cp-name-lookup.h. + +2003-03-31 Jason Merrill + + PR java/10145 + * class.c (check_field_decl): Don't set DECL_ALIGN. + +2003-03-30 Mark Mitchell + + PR c++/7647 + * decl.c (grokdeclarator): Tidy, slightly. + * search.c (lookup_field_1): Add want_type parameter. + (lookup_field_r): Adjust call to lookup_field_1. + +2003-03-30 Gabriel Dos Reis + + * Make-lang.in (cp/name-lookup.o): Add more dependencies. + +2003-03-30 Gabriel Dos Reis + + * cp-tree.h (binding_for_name: Move to name-lookup.h Adjust + prototype. + (cxx_scope_find_binding_for_name): Likewise. + * decl.c (find_binding: Move to name-lookup.c. + (binding_for_name): Likewise. + (cxx_scope_find_binding_for_name): Likewise. + (BINDING_LEVEL): Remove. + (push_binding): Tidy. + (push_class_binding): Likewise. + (pop_binding): Likewise. + (poplevel): Likewise. + (poplevel_class): Likewise. + (set_identifier_type_value_with_scope): Likewise. + (push_overloaded_decl): Likewise. + (lookup_tag): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_name_current_level): Likewise. + (maybe_inject_for_scope_var): Likewise. + (namespace_binding): Move to name-lookup.c. + (set_namespace_binding): Likewise. + * decl2.c (lookup_using_namespace): Tidy. + (qualified_lookup_using_namespace): Likewise. + (do_toplevel_using_decl): Likewise. + * name-lookup.c: Include "timevar.h" + * name-lookup.h (cxx_scope): Declare. + (struct cxx_binding): Lose member "has_level". Adjust "scope" + member declaration. + (BINDING_SCOPE): Adjust definition. + (BINDING_HAS_LEVEL_P): Remove. + +2003-03-30 Gabriel Dos Reis + + * name-lookup.c: New file. + * name-lookup.h: Likewise.. + * decl.c (push_binding): Adjust use cxx_binding_make. + (free_bindings): Move to name-lookup.c + (pop_binding): Use cxx_binding_free. + (binding_for_name): Tidy. + * cp-tree.h: Include "name-lookup.h" + (cxx_binding_make): Move to name-lookup.h + (cxx_binding_clear): Likewise. + (struct cxx_binding): Likewise. + (LOCAL_BINDING_P): Likewise. + (INHERITED_VALUE_BINDING_P): Likewise. + (BINDING_SCOPE): Likewise. + (BINDING_HAS_LEVEL_P): Likewise. + (BINDING_VALUE): Likewise. + (BINDING_TYPE): Likewise. + * config-lang.in (gtfiles): Add cp/name-lookup.h + * Make-lang.in (cp/name-lookup.o): New rule. + (CXX_OBJS): Add cp/name-lookup.o + (CXX_TREE_H): Add cp/name-lookup.h + +2003-03-28 Jason Merrill + + PR c++/10245 + * cvt.c (force_rvalue): New fn. + * call.c (build_conditional_expr): Use it. + * cp-tree.h: Declare it. + +2003-03-28 Mike Stump + + * error.c (dump_expr): Add 0x to printed hex numbers to make + output match source code better. + +2003-03-28 Mark Mitchell + + PR c++/10218 + * decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class + definitions. + + * decl2.c (generate_ctor_or_dtor_function): Tolerate a + non-existant ssdf_decls array. + (finish_file): Call generator_ctor_or_dtor_function when there are + static constructors or destructors and no other static + initializations. + +2003-03-28 Nathan Sidwell + + PR c++/10047 + * decl2.c (finish_file): Don't warn about explicitly instantiated + inline decls. + +2003-03-27 Nathan Sidwell + + PR c++/10224 + * pt.c (lookup_template_class): Only check instantiated args if + they do not contain template parameters. + +2003-03-27 Nathan Sidwell + + PR c++/10158 + * parser.c (cp_parser_function_definition): Set + DECL_INITIALIZED_IN_CLASS for members. + * pt.c (instantiate_decl): Only reduce the template args for + friends that are not defined in class. + +2003-03-25 Jason Merrill + + * call.c (print_z_candidate): Change name of first arg to msgid. + (joust): Add comment for translators. + +2003-03-24 Nathan Sidwell + + PR c++/9898, PR c++/383, DR 322 + * pt.c (maybe_adjust_types_for_deduction) : Look + through reference types on both PARM and ARG. + +2003-03-24 Nathan Sidwell + + PR c++/10119 + * error.c (dump_expr) : Use dump_expr. + * pt.c (maybe_fold_nontype_args): New function. + (tsubst_copy) : Subst any template_id args. + : Break out folding code, call it. + (tsubst_copy_and_build) : Call + maybe_fold_nontype_args. + +2003-03-24 Nathan Sidwell + + PR c++/10026 + * decl2.c (arg_assoc_type) : Don't die. + +2003-03-23 Mark Mitchell + + PR c++/7086 + * typeck.c (cxx_mark_addressable): Adjust call to + gen_mem_addressof or put_var_into_stack. + +2003-03-22 Nathan Sidwell + + PR c++/9978, c++/9708 + * cp-tree.h (instantiate_template): Add tsubst_flags parameter. + * call.c (add_template_candidate_real): Adjust + instantiate_template call. + * class.c (resolve_address_of_overloaded_function): Likewise. + * decl.c (build_enumerator): Set TREE_CONSTANT. + * pt.c (check_instantiated_args): New. + (push_inline_template_parms_recursive): Set TREE_CONSTANT, + TREE_READONLY. + (build_template_parm_index): Copy TREE_CONSTANT, TREE_READONLY. + (reduce_template_parm_level): Likewise. + (process_template_parm): Likewise. + (check_explicit_specialization): Adjust instantiate_template call. + (convert_template_argument): Don't check non-type argument here. + (lookup_template_class): Check them here. + (tsubst_friend_function): Adjust instantiate_template call. + (instantiate_template): Add tsubst_flags parameter, use it. Check + instantiated args. + +2003-03-21 Zack Weinberg + + * decl.c: Update calls to shadow_warning. + +2003-03-21 Nathan Sidwell + + PR c++/9898 + * error.c (dump_decl) [CONST_DECL]: Print ''. + (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call. + +2003-03-20 Mark Mitchell + + * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope + friends. + * cp/pt.c (instantiate_class_template): Fix formatting. + +2003-03-14 Matt Austern + + * cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray. + (unemitted_tinfo_decl_p): Remove. + (emit_tinfo_decl): Change declaration to remove unused parameter. + * decl2.c (finish_file): Change tinfo emission to loop through + unemitted_tinfo_decls array instead of looping through all decls. + * rtti.c (unemitted_tinfo_decl_p): Declare as static, remove + unused second parameter. + (init_rtti_processing): initialize unemitted_tinfo_decls varray. + (get_tinfo_decls): push new tinfo decl on unemitted_tinfo_decls. + (emit_tinfo_decl): remove unused second parameter, add assertion + that decl hasn't already been emitted. + +2003-03-19 Nathanael Nerode + + * dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return + type from 'int' to 'bool'. Replace 0 and 1 with true and false in + return statements. + +2003-03-19 Jason Merrill + + PR c++/8316, c++/9315, c++/10136 + * call.c (print_z_candidate): Split out from... + (print_z_candidiates): ...here. + (joust): Use it. + +2003-03-17 Roger Sayle + + PR c++/10031 + * decl.c (duplicate_decls): Use the new type when prototyping + anticipated decls, even when the types match. This defines the + exception list for the built-in function. + +2003-03-17 Jason Merrill + + PR c++/10091 + * typeck.c (build_class_member_access_expr): Compare + TYPE_MAIN_VARIANTs. + +2003-03-17 Mark Mitchell + + PR c++/9639 + * parser.c (cp_parser_declarator_id): Clear parser->scope. + +2003-03-16 Jason Merrill + + PR c++/9993 + * decl.c (finish_function): Only allow the NRVO to use variables + declared at function scope. + +2003-03-17 Andreas Jaeger + + * Make-lang.in (cp/TAGS): Remove. + +2003-03-16 Nathan Sidwell + + PR c++/9629 + * cp-tree.h (struct language_function): Add in_base_initializer. + (in_base_initializer): define it. + (expand_member_init): Remove INIT param. + * init.c (expand_member_init): Remove INIT param, return the member. + (emit_mem_initializers): Set in_base_initializer. + * class.c (build_base_path): Check in_base_initializer. + * parser.c (cp_parser_mem_initializer): Set in_base_initializer. + * pt.c (tsubst_initializer_list): Likewise. + +2003-03-16 Gabriel Dos Reis + + * decl.c (binding_for_name): Fix initialization thinko. + +2003-03-15 Gabriel Dos Reis + + Compile-time improvement: 2/n. + * cp-tree.h (struct cxx_binding): New datatype; + (struct lang_identifier): Use it. + (LOCAL_BINDING_P): Adjust definition. + (INHERITED_VALUE_BINDING_P): Likewise. + (BINDING_SCOPE): Likewise. + (BINDING_HAS_LEVEL_P): Likewise. + (BINDING_VALUE): Likewise. + (BINDING_TYPE): Likewise. + (IDENTIFIER_VALUE): Likewise. + (struct tree_binding): Remove. + (TS_CP_BINDING): Likewise. + ((union lang_tree_node): Remove field "binding". + (cxx_binding_clear): New macro. + (binding_for_name): Adjust return type. + (qualified_lookup_using_namespace): Adjust prototype. + (lookup_using_namespace): Adjust prototype. + (cxx_scope_find_binding_for_name): Declare. + * cp-tree.def: Remove CPLUS_BINDING definition. + * decl.c (push_binding): Adjust local variable type. + (add_binding): Likewise. + (push_class_binding): Likewise. + (pop_binding): Likewise. + (poplevel): Likewise. + (poplevel_class): Likewise. + (free_bindings): Adjust type. + (find_binding): Adjust return type, add a third parameter. Remove + non-useful assertion now that we use static typing. + (cxx_scope_find_binding_for_name): New function. + (binding_for_name): Use it. Adjust local variable type. Simplify. + (namespace_binding): Simplify. + (set_namespace_binding): Likewise. + (set_identifier_type_value_with_scope): Adjust local variable type. + (lookup_tag): Don't type-abuse of local variable 'old'. + (lookup_namespace_name): Likewise. Allocate binding on stack. + (select_decl): Adjust prototype. + (unqualified_namespace_lookup): Allocate binding on stack. + Don't type-abuse of local variable 'val'. + (lookup_name_real): Likewise. + (maybe_inject_for_scope_var): Adjust local variable type. + (cp_tree_node_structure): Remove CPLUS_BINDING case label. + (namespace_binding): Adjust logic, simplify. + (BINDING_LEVEL): Adjust definition. + (push_class_level_binding): Adjust local variable type. + (struct cxx_saved_binding): Adjust field 'binding' type. + * decl2.c (ambiguous_decl): Adjust prototype. + (lookup_using_namespace): Adjust local variable type. + (qualified_lookup_using_namespace): Catch type error and correct + ensueing logic error. + (do_nonmember_using_decl): Adjust local variable type. Allocate + temporary cxx_binding on stack. + (do_toplevel_using_decl): Adjust local variable type. + * ptree.c (cxx_print_cxx_binding): New function. + (cxx_print_identifier): Use it. + (cxx_print_xnode): Delete CPLUS_BINDING case label. + +2003-03-15 Roger Sayle + + * tree.c (count_functions): Fix whitespace. + +2003-03-15 Neil Booth + + * Make-lang.in: Update. + +2003-03-15 Kriang Lerdsuwanakij + + PR c++/6440 + * pt.c (maybe_process_partial_specialization): Handle + member class template when enclosing class template is + explicit specialized. + (most_general_template): Stop looking when DECL is already + specialized. + +2003-03-13 Jason Merrill + + PR c++/9420 + * search.c (lookup_conversions): Call complete_type here. + * call.c (implicit_conversion): Not here. + +2003-03-13 Mark Mitchell + + * decl2.c (do_nonmember_using_decl): Correct handling of + simultaneous type/non-type bindings. + + * call.c (initialize_reference): Remove bogus assertion. + * decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09. + +2003-03-12 Andrew Lewycky + + PR c++/7050 + * expr.c (cxx_expand_expr): Return const0_rtx for throw + expressions. + +2003-03-11 Mark Mitchell + + PR c++/9474 + * decl2.c (do_nonmember_using_decl): Do not call duplicate decls + to merge old and new declarations. + +2003-03-12 Alexandre Oliva + + * g++.1: Remove. + * Make-lang.in (c++.generated-manpages): Build cp/g++.1. + (cp/g++.1): Build it from scratch in the build tree. + (c++.install-man): Depend on it. Install it from the build tree. + (c++.mostlyclean): Clean it. + +2003-03-11 Mark Mitchell + + PR c++/9474 + * decl2.c (do_nonmember_using_decl): Do not call duplicate decls + to merge old and new declarations. + + PR c++/9924 + * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins. + +2003-03-11 Jason Merrill + + PR c++/9820 + * search.c (lookup_member): Fix handling of functions in a class + being defined. + +2003-03-11 Mark Mitchell + + PR c++/8700 + * call.c (convert_class_to_reference): Adjust usage of + splice_viable. + (any_viable): Remove. + (splice_viable): Combine with any_viable. + (print_z_candidates): Avoid printing duplicates. + (build_user_type_conversion_1): Adjust usage of splice_viable. + (build_new_function_call): Likewise. + (build_operator_new_call): Likewise. + (build_object_call): Likewise. + (build_conditional_expr): Likewise. + (build_new_op): Likewise. + (build_new_method_call): Likewise. + (joust): Remove spurious comment. + * cp-tree.h (DECL_FRIENDLIST): Correct documentation. + * decl2.c (arg_assoc_class): Simplify. + * friend.c (add_friend): Likewise. + +2003-03-11 Jason Merrill + + PR c++/8660 + * decl2.c (check_classfn): A member template only matches a + member template. + +2003-03-11 Neil Booth + + * Make-lang.in (CXX_C_OBJS): Update. + * lang-specs.h: Don't define __GNUG__ here. + +2003-03-10 Mark Mitchell + + * call.c (perform_overload_resolution): New function. + (build_new_function_call): Use it. + (build_operator_new_call): Likewise. + (add_candidates): Add explicit_targs and template_only parameters. + (build_new_op): Adjust accordingly. + * cp-tree.h (build_operator_new_call): New function. + (build_function_call_real): Remove. + (build_function_call_maybe): Likewise. + * init.c (build_new_1): Use build_operator_new_call. + * typeck.c (build_function_call_real): Rename to ... + (build_function_call): ... this. + +2003-03-10 Devang Patel + + PR c++/9394 + * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG. + +2003-03-10 Jason Merrill + + PR c++/9798 + * decl.c (push_using_directive): Push before recursing. + + PR c++/9868, c++/9524 + * call.c (resolve_scoped_fn_name): Handle the case of a function + pointer member. + + * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this' + argument in the pointer-to-member case. + +2003-03-09 Mark Mitchell + + PR c++/9373 + * cp-lang.c (cxx_get_alias_set): Use alias set zero for + pointers to member functions. + + PR c++/8534 + * decl.c (build_ptrmemfunc_type): Do not allow default arguments + in pointer-to-member-function types. + +2003-03-10 Gabriel Dos Reis + + * expr.c (cplus_expand_constant): Use C90 prototype style. + (cxx_expand_expr): Likewise. + +2003-03-09 Kriang Lerdsuwanakij + + PR c++/9970 + * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual + functions. + +2003-03-08 Geoffrey Keating + + * lang-specs.h (c++-header): Change .pch to .gch. + +2003-03-08 Neil Booth + + * cp-tree.h (cxx_init): Update prototype. + * lex.c (cxx_init): Similarly. + +2003-03-08 Mark Mitchell + + PR c++/9823 + * cp-tree.h (begin_mem_initializers): Remove. + * parser.c (cp_parser_mem_initializer_list): Inline it here. + Do not call finish_mem_initializers if not in a constructor. + (cp_parser_class_head): Fix typo in error message. + * semantics.c (begin_mem_initializers): Remove. + * testsuite/g++.dg/parser/constructor1.C: New test. + + PR c++/9809 + * call.c (add_function_candidate): Skip builtin fuctions that have + not yet been declared. + + PR c++/9982 + * init.c (build_new_1): Correct logic for determining whether or + not to use an array cookie. + + PR c++/9524 + * parser.c (cp_parser_postfix_expression): Call + finish_non_static_data_member, even when processing_template_decl. + + PR c++/9912 + * cp-tree.h (is_ancestor): New function. + (handle_class_head): Change prototype. + * decl2.c (is_namespace_ancestor): Rename to ... + (namespace_anecestor): ... this. + (set_decl_namespace): Adjust accordingly. + (handle_class_head): Remove unnecessary parameters. + * parser.c (cp_parser_class_head): Check that + nested-name-specifiers are used appropriately. + +2003-03-07 Mark Mitchell + + * call.c (reference_binding): Remove REF_IS_VAR parameter. + (implicit_conversion): Adjust call to reference_binding. + (make_temporary_var_for_ref_to_type): Add TYPE parameter. + (initialize_reference): Adjust handling for references bound to + rvalues. + * cp-tree.h (make_temporary_var_for_ref_to_temp): Change + prototype. + (real_non_cast_lvalue_p): New method. + * cvt.c (build_up_reference): Adjust use of + make_temporary_var_for_ref_to_temp. + * tree.c (real_non_cast_lvalue_p): New method. + +2003-03-07 Gabriel Dos Reis + + * except.c (init_exception_processing): Use C90 prototype style. + (cp_protect_cleanup_actions): Likewise. + (prepare_eh_type): Likewise. + (build_eh_type_type): Likewise. + (build_exc_ptr): Likewise. + (do_begin_catch): Likewise. + (dtor_nothrow): Likewise. + (do_end_catch): Likewise. + (push_eh_cleanup): Likewise. + (decl_is_java_type): Likewise. + (choose_personality_routine): Likewise. + (initialize_handler_parm): Likewise. + (expand_start_catch_block): Likewise. + (expand_end_catch_block): Likewise. + (begin_eh_spec_block): Likewise. + (finish_eh_spec_block): Likewise. + (do_allocate_exception): Likewise. + (do_free_exception): Likewise. + (wrap_cleanups_r): Likewise. + (stabilize_throw_expr): Likewise. + (build_throw): Likewise. + (complete_ptr_ref_or_void_ptr_p): Likewise. + (is_admissible_throw_operand): Likewise. + (nothrow_libfn_p): Likewise. + (can_convert_eh): Likewise. + (check_handlers_1): Likewise. + (check_handlers): Likewise. + +2003-03-06 Mark Mitchell + + * call.c (merge_conversion_sequences): New function. + (build_conv): Set ICS_USER_FLAG for USER_CONVs. + (convert_class_to_reference): Correct handling of second + standard conversion sequence in a user-defined conversion + sequence. + (build_user_type_conversion_1): Use merge_conversion_sequences. + * cp-tree.def: Add comments for CONV nodes. + * rtti.c (get_tinfo_decl): Use build_address/build_nop. + +2003-03-07 Gabriel Dos Reis + + * error.c (init_error): Use C90 prototype style. + (dump_scope): Likewise. + (dump_qualifiers): Likewise. + (dump_template_argument): Likewise. + (dump_template_argument_list): Likewise. + (dump_template_parameter): Likewise. + (dump_template_bindings): Likewise. + (dump_type): Likewise. + (dump_typename): Likewise. + (class_key_or_enum): Likewise. + (dump_aggr_type): Likewise. + (dump_type_prefix): Likewise. + (dump_type_suffix): Likewise. + (dump_global_iord): Likewise. + (dump_simple_decl): Likewise. + (dump_decl): Likewise. + (dump_template_decl): Likewise. + (dump_function_decl): Likewise. + (dump_parameters): Likewise. + (dump_exception_spec): Likewise. + (dump_function_name): Likewise. + (dump_template_parms): Likewise. + (dump_char): Likewise. + (dump_expr_list): Likewise. + (dump_expr): Likewise. + (dump_binary_op): Likewise. + (dump_unary_op): Likewise. + (type_as_string): Likewise. + (expr_as_string): Likewise. + (decl_as_string): Likewise. + (context_as_string): Likewise. + (lang_decl_name): Likewise. + (cp_file_of): Likewise. + (cp_line_of): Likewise. + (decl_to_string): Likewise. + (expr_to_string): Likewise. + (fndecl_to_string): Likewise. + (code_to_string): Likewise. + (language_to_string): Likewise. + (parm_to_string): Likewise. + (op_to_string): Likewise. + (type_to_string): Likewise. + (assop_to_string): Likewise. + (args_to_string): Likewise. + (cv_to_string): Likewise. + (cxx_print_error_function): Likewise. + (cp_diagnostic_starter): Likewise. + (cp_diagnostic_finalizer): Likewise. + (cp_print_error_function): Likewise. + (function_category): Likewise. + (print_instantiation_full_context): Likewise. + (print_instantiation_partial_context): Likewise. + (maybe_print_instantiation_context): Likewise. + (print_instantiation_context): Likewise. + (cp_printer): Likewise. + (print_integer): Likewise. + (print_non_consecutive_character): Likewise. + (locate_error): Likewise. + +2003-03-06 Mark Mitchell + + PR c++/9965 + * call.c (reference_binding): Add ref_is_var parameter. + (implicit_conversion): Adjust call to reference_binding. + (initialize_reference): Likewise. + + PR c++/9400 + * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL + PARM_DECLs. + + PR c++/9791 + * class.c (get_basefndecls): Use lookup_fnfields_1. + +2003-03-06 Kriang Lerdsuwanakij + + PR c++/9188 + * parser.c (cp_parser_type_parameter): Remove redundant `expect' + in error message. + (cp_parser_single_declaration): Likewise. + +2003-03-05 Jason Merrill + + PR c++/9440 + * call.c (build_conditional_expr): Use convert rather than an + explicit NOP_EXPR. + +2003-03-02 Matt Austern + + * decl.c (cp_binding_level): Add static_decls varray member. + (add_decl_to_level): Add static/inline namespace scope + declarations to static_decls array. + (wrapup_global_for_namespace): Pass static_decls only, instead of + all decls, to wrapup_global_declarations/check_global_declarations. + (push_namespace): Initialize static_decls for ordinary namespaces. + (cxx_init_decl_processing): Initialize static_decls for global + namespace. + +2003-03-05 Mark Mitchell + + * class.c (end_of_class): Correct thinko. + +2003-03-04 Nathanael Nerode + + * config-lang.in: Replace ${libstdcxx_version} by its value. + +2003-03-04 Gabriel Dos Reis + + * cp-tree.h (cxx_saved_binding): Declare. + (struct saved_scope): Adjust type of field 'old_binding'. + * decl.c (cxx_saved_binding_make): New macro. + (struct cxx_saved_binding): Define. + (store_bindings): Adjust prototype. Use cxx_saved_binding to save + C++ bindings. + (maybe_push_to_top_level): Adjust local variable type. + (pop_from_top_level): Likewise. + +2003-03-04 Tom Tromey + + * Make-lang.in (c++.tags): New target. + +2003-03-04 Neil Booth + + * Make-lang.in: Update. + +2003-03-03 Jason Merrill + + * decl.c (finish_enum): Do set the type in a template. Simplify. + * pt.c (tsubst_enum, tsubst_copy): Revert last patch. + +2003-03-03 Mark Mitchell + + PR c++/9878 + * call.c (convert_class_to_reference): Correct conversion + sequences. + (reference_binding): Add ref_bound_directly_to_rvalue_p parameter. + (implicit_conversion): Adjust call to reference_binding. + (add_candidate): Change type of candidates parameter. + (add_function_candidate): Likewise. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (add_builtin_candidate): Likewise. + (add_builtin_candidates): Likewise. + (add_template_candidate_real): Likewise. + (add_template_candidate): Likewise. + (add_template_conv_candidate): Likewise. + (build_user_type_conversion_1): Adjust accordingly. + (build_object_call): Likewise. + (build_conditional_expr): Likewise. + (add_candidates): Likewise. + (build_new_op): Likewise. + (convert_like_real): Use USER_CONV_CAND. Use build_nop. + (build_new_method_call): Adjust calls to add_function_candidate. + (make_temporary_var_for_ref_to_temp): New function. + (initialize_reference): Add decl parameter. + * class.c (build_rtti_vtbl_entries): Use build_address and + build_nop. + * cp-tree.h (initialize_reference): Change prototype. + (make_temporary_var_for_ref_to_temp): New function. + (build_type_conversion): Change prototype. + (build_address): New function. + (build_nop): Likewise. + * cvt.c (cp_convert_to_pointer): Adjust call to + build_type_conversion. Avoid indicating redundant NOP_EXPRs. + Use build_nop. + (convert_to_pointer_force): Use build_nop. + (build_up_reference): Use make_temporary_var_for_ref_to_temp. + (convert_to_reference): Adjust call to build_type_conversion. + (ocp_convert): Likewise. + (build_type_conversion): Remove for_sure parameter. + * decl.c (grok_reference_init): Use initialize_reference. + * typeck.c (build_address): New function. + (build_nop): Likewise. + (build_unary_op): Use them. + (build_ptrmemfunc): Tidy slightly. + (convert_for_initialization): Adjust call to + initialize_reference. + * typeck2.c (store_init_value): Remove #if 0'd code. + +2003-03-03 Jason Merrill + + * decl.c (start_function): Clear DECL_NUM_STMTS. + + * class.c (get_vtable_decl): Use vtbl_type_node. + (build_primary_vtable): Check for it. + +2003-03-02 Aldy Hernandez + + * decl.c (check_initializer): Check for vector_opaque_p. + +2003-03-02 Ashif Harji + + * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to + invoke an external cpp during compilation. + +2003-03-01 Gabriel Dos Reis + + * decl.c (duplicate_decls): Convert use of warning_with_decl() to + that of warning(). + (start_decl): Likewise. + (start_function): Likewise. + +2003-03-01 Neil Booth + + * Make-lang.in (CXX_C_OBJS): Update. + +2003-02-28 Mark Mitchell + + PR c++/9892 + * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when + instantiating it. + +2003-02-28 Aldy Hernandez + + * parser.c (cp_parser_init_declarator): Revert opaque + vector_opaque_p change. + Do not include target.h. + +2003-02-28 Mark Mitchell + + PR c++/9879 + * cp-tree.h (build_zero_init): Add parameter. + * decl.c (cp_finish_decl): Adjust call. + * init.c (build_zero_init): Add nelts parameter. Adjust recursive + calls. + (build_default_init): Add nelts parameter. Adjust calls to + build_zero_init. + (build_new_1): Adjust call to build_default_init. + * typeck2.c (process_init_constructor): Adjust call to build_zero_init. + +2003-02-26 Devang Patel + + * decl.c (finish_enum): Merge two 'for' loops. Copy value node if + required. Postpone enum setting for template decls. + (build_enumerator): Delay copying value node until finish_enum + (). Remove #if 0'ed code. + * pt.c (tsubst_enum): Set TREE_TYPE and copy value node. + (tsubst_copy): Add check for enum type. + +2003-02-25 Mark Mitchell + + PR c++/9683 + * decl2.c (prune_vars_needing_no_initialization): Do not throw + away initializations for DECL_EXTERNAL VAR_DECLs. + (finish_file): Adjust accordingly. + * pt.c (instantiate_decl): Do not defer VAR_DECLs. + +2003-02-24 Gabriel Dos Reis + + * decl.c (add_binding): Time TV_NAME_LOOKUP. + (push_class_binding): Likewise. + (set_namespace_binding): Likewise. + +2003-02-24 Mark Mitchell + + PR c++/9836 + * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from + specializations back to the main template. + * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use. + * pt.c (resolve_typename_type): Likewise. + +2003-02-24 Jeffrey D. Oldham + + PR c++/9778 + * pt.c (tsubst_copy_and_build): For a templated function inside a + scope, process template arguments. + +2003-02-24 Kriang Lerdsuwanakij + + PR c++/9602 + * typeck2.c (abstract_virtuals_error): Don't check when + TYPE is still template parameter dependent. + +2003-02-23 Mark Mitchell + + PR c++/5333 + * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro. + * parser.c (cp_parser_diagnose_invalid_type_name): Use it. + * pt.c (instantiate_class_template): Don't try to instantiate + dependent types. + (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE. + +2003-02-21 Mark Mitchell + + PR c++/9749 + * decl.c (grokdeclarator): Do not allow parameters with variably + modified types. + +2003-02-21 Nathan Sidwell + + * search.c (grow_bfs_bases): Remove. Fold into ... + (bfs_walk): ... here, fix fencepost error. Fix merge lossage + in previous patch. + +2003-02-20 Mark Mitchell + + PR c++/9729 + * mangle.c (mangle_conv_op_name_for_type): Issue an error message + when the G++ 3.2 ABI prevents correct compilation. + +2003-02-20 Nathan Sidwell + + Change base class access representation. Share virtual base + binfos. + * cp/call.c (build_special_member_call): Remove binfo_for_vbase + call. + * cp/class.c (build_base_path): Likewise. + (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use. + (build_secondary_vtable): Remove FOR_TYPE arg. Adjust. + (make_new_vtable): Adjust. + (force_canonical_binfo_r): Delete. + (force_canonical_binfo): Delete. + (mark_primary_virtual_base): Delete. + (dfs_unshared_virtual_bases): Delete. + (mark_primary_bases): Adjust. + (maybe_warn_about_overly_private_class): Adjust. + (dfs_base_derived_from): Delete. + (base_derived_from): Follow the inheritance chain. + (struct find_final_overrider_data): Add vpath member. + (dfs_find_final_overrider): Adjust. + (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New. + (find_final_overrider): Adjust. + (update_vtable_entry_for_fn): Adjust. + (modify_all_vtables): Adjust. + (walk_subobject_offsets): Adjust. + (layout_nonempty_base_or_field): Adjust. + (layout_empty_base): Remove last parameter. Adjust. + (build_base_field): Adjust. + (build_base_fields): Adjust. + (propagate_binfo_offsets): Remove last parameter. Adjust. + (dfs_set_offset_for_unshared_vbases): Delete. + (layout_virtual_bases): Adjust. + (finish_struct_1): Adjust. + (init_class_processing): Don't init access nodes. + (dfs_get_primary_binfo): Delete. + (get_primary_binfo): Adjust. + (dump_class_hierarchy_r): Remove most derived arg, add IGO + parameter. Adjust. + (dump_class_hierarchy): Adjust. + (finish_vtbls): Adjust. + (get_original_base): Delete. + (build_vtt_inits): Adjust. + (dfs_build_secondary_vptr_vtt_inits): Adjust. + (dfs_ctor_vtable_bases_queue_p): Adjust. + (build_ctor_vtbl_group): Adjust. + (dfs_accumulate_vtbl_inits): Adjust. + (build_vtbl_initializer): Adjust. + (build_vbase_offset_vtbl_entries): Adjust. + (add_vcall_offset_vtbl_entries_1): Adjust. + * cp/cp-tree.h (CPTI_ACCESS_*): Remove. + (access_*_node): Remove. + (CANONICAL_BINFO): Delete. + (BINFO_UNSHARED_MARKED): Remove. + (BINFO_MARKED): Set LANG_FLAG_0 directly. + (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete. + (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly. + (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED): + Delete. + (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust. + (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED): + Delete. + (BINFO_DEPENDENT_BASE_P): New. + (dfs_walk, dfs_walk_real): Queue function takes derived binfo and + index. + (markedp, unmarkedp): Adjust. + (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p, + dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp, + find_vbase_instance, binfo_for_vbase): Delete. + (copied_binfo, original_binfo): Declare. + (finish_base_specifier): Add virtual_p arg. + (unshare_base_binfos): Delete. + (copy_base_binfos): Declare. + (reverse_path): Delete. + * cp/decl.c (xref_basetypes): Access and virtuality passed + differently. Don't copy direct base binfos here. Call + copy_base_binfos. + * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust. + (initialize_vtbl_ptrs): Adjust. + (expand_member_init): Adjust. + * cp/parser.c (cp_parser_base_specifier): Adjust. + * cp/pt.c (instantiate_class_template): Adjust. + (get_template_base_recursive): Adjust. + * cp/rtti.c (get_pseudo_ti_init): Adjust. + (get_pseudo_ti_desc): Adjust. + * cp/tree.c (unshare_base_binfos): Rename to ... + (copy_base_binfos): ... here, reimplement. + (make_binfo): Set BINFO_DEPENDENT_BASE_P. + (reverse_path): Remove. + * cp/typeck.c (get_delta_difference): Adjust error messages. + * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust. + * cp/search.c (lookup_base_r): Adjust. + (dynamic_cast_base_recurse): Adjust. + (canonical_binfo): Remove. + (dfs_canonical_queue): Remove. + (dfs_assert_unmarked_p): Remove. + (assert_canonical_unmarked): Remove. + (shared_marked_p, shared_unmarked_p): Remove. + (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE. + (dfs_access_in_type): Adjust. + (access_in_type): Adjust. + (dfs_accessible_queue_p): Adjust. + (dfs_accessible_p): Adjust. + (is_subobject_of_p_1, is_subobject_of_p): Remove. + (struct lookup_field_info): Remove from_dep_base_p field. + (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P. + (lookup_field_r): Remove dependent base code. + (lookup_member): Likewise. + (dfs_walk, dfs_walk_real): Add access arg to queue fn. + (dfs_unmarked_real_bases_queue_p): Remove. + (dfs_marked_real_bases_queue_p): Remove. + (dfs_skip_vbases): Remove. + (dfs_get_pure_virtuals): Adjust. + (markedp, unmarkedp): Adjust. + (marked_vtable_pathp, unmarked_vtable_pathp): Remove. + (marked_pushdecls_p, unmarked_pushdecls_p): Adjust. + (dfs_unmark): Adjust. + (dfs_get_vbase_types):Remove. + (dfs_build_inheritance_graph_order): Remove. + (get_vbase_types): Remove + (dfs_find_vbase_instance): Remove. + (find_vbase_instance): Remove. + (dfs_debug_unmarkedp): Adjust. + (dependent_base_p): Remove. + (dfs_push_type_decls): Adjust. + (dfs_push_decls): Adjust. + (dfs_no_overlap_yet): Adjust. + (copied_binfo): New function. + (original_binfo): New function. + (binfo_for_vbase): Remove. + +2003-02-18 Zack Weinberg + + * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk. + (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES + vectors, for speed. + +2003-02-18 Mark Mitchell + + PR c++/9704 + * class.c (layout_class_type): In the 3.2 ABI, take into account + trailing bit fields when computing CLASSTYPE_SIZE_UNIT. + +2003-02-18 Matt Austern + + * cp/cp-lang.c: Change lang hooks so that final_write_globals does + nothing for C++. + * cp/decl.c (wrapup_globals_for_namespace): Remove special + handling of global namespace. + +2003-02-18 Geoffrey Keating + + * cp-tree.h (rid_to_yy): Delete. + (C_RID_YYCODE): Delete. + (finish_file): Delete redundant declaration. + +2003-02-18 Jason Merrill + + PR c++/9623 + * decl.c (reshape_init): Don't mess with initializer labels. + + PR c++/9485 + * parser.c (cp_parser_postfix_expression): Set idk properly for + object->scope::member. + +2003-02-18 Ben Elliston + + PR other/7350 + * decl.c (duplicate_decls): Fix typo in comment. + +2003-02-17 Michael Elizabeth Chastain + + PR debug/9717 + * class.c (build_base_field): Mark fields for base classes with + DECL_IGNORED_P. + +2003-02-17 Kriang Lerdsuwanakij + + PR c++/9457 + * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute + CONSTRUCTOR_ELTS only once. + +2003-02-16 Kriang Lerdsuwanakij + + PR c++/9459 + * error.c (dump_type_prefix): Handle TYPEOF_TYPE. + (dump_type_suffix): Likewise. + +2003-02-14 Nathan Sidwell + + * search.c: ANSIfy function declarations and definitions. + * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool. + * call.c (build_method_call, resolve_scoped_fn_name, + build_java_interface_fn_ref): Adjust lookup_field, lookup_member + calls. + * class.c (handle_using_decl): Likewise. + * decl.c (make_typename_type, make_unmound_class_template, + start_decl, compute_array_index_type): Likewise. + * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise. + * init.c (expand_member_init, build_member_call): Likewise. + * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation, + resolve_typename_type): Likewise. + * typeck.c (lookup_destructor, finish_class_member_access_exprm + build_prememfunc_access_expr): Likewise. + +2003-02-13 Gabriel Dos Reis + + * decl2.c: Include "timevar.h". + (namespace_ancestor): Time name lookup. + (add_using_namespace): Likewise. + (lookup_using_namespace): Likewise. + (qualified_lookup_using_namespace): Likewise. + (decl_namespace): Likewise. + (lookup_arg_dependent): Likewise. + * lex.c (do_identifier): Likewise. + (do_scoped_id): Likewise. + * pt.c (lookup_template_class): Likewise. + +2003-02-14 Andrew Pinski + + * decl.c: (define_label): Fix warning for return 0 instead of NULL. + +2003-02-13 Gabriel Dos Reis + + * decl.c: Include "timevar.h". + (poplevel): Time name lookup. + (find_binding): Likewise. + (push_namespace): Likewise. + (pop_nested_namespace): Likewise. + (store_bindings): Likewise. + (maybe_push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + (push_local_name): Likewise. + (pushtag): Likewise. + (pushdecl): Likewise. + (pushdecl_with_scope): Likewise. + (pushdecl_namespace_level): Likewise. + (pushdecl_top_level): Likewise. + (pushdecl_class_level): Likewise. + (push_class_level_binding): Likewise. + (push_using_decl): Likewise. + (push_using_directive): Likewise. + (push_overloaded_decl): Likewise. + (lookup_label): Likewise. + (define_label): Likewise. + (lookup_tag): Likewise. + (lookup_tag_reverse): Likewise. + (lookup_namespace_name): Likewise. + (select_decl): Likewise. + (unqualified_namespace_lookup): Likewise. + (lookup_name_real): Likewise. + (lookup_name_current_level): Likewise. + (lookup_type_current_level): Likewise. + (maybe_inject_for_scope_var): Likewise. + (xref_tag): Likewise. + + * Make-lang.in (cp/decl.o): Add dependency on timevar.h + +2003-02-12 Phil Edwards + + * decl.c (build_enumerator): Remove unneeded test. + +2003-02-09 Dan Nicolaescu + + * cp-tree.h (struct lang_type_header): Make all fields unsigned + char. + +2003-02-03 Mark Mitchell + + PR c++/7129 + * call.c (z_candidate): Add args. + (convert_class_to_reference): Set it. + (implicit_conversion): Tidy. + (add_candidate): Add args parameter. + (add_function_candidate): Adjust call to add_candidate. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (build_user_type_conversion_1): Eliminate wasteful tree_cons + usage. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (add_candidates): New function. + (build_new_op): Use it. + (covert_like_real): Adjust call to build_over_call. + (build_over_call): Remove args parameter. + * operators.def: Add ?=. + +2003-02-01 Richard Sandiford + + * typeck.c (build_indirect_ref): Don't check flag_volatile. + +2003-01-31 Kriang Lerdsuwanakij + + PR c++/8849 + * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL. + +2003-01-31 Nathan Sidwell + + * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, + BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS. + (BINFO_LANG_ELTS): New #define. + * tree.c (make_binfo): Use BINFO_LANG_ELTS. + +2003-01-30 Geoffrey Keating + + * cp/Make-lang.in: Remove -Wno-error from cp/decl.o. + +2003-01-30 Mark Mitchell + + * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY + for class types. + * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit + rather than TYPE_LANG_FLAG_0. + (TYPE_BUILT_IN): Remove. + (TYPE_DEPENDENT_P): New macro. + (TYPE_DEPENDENT_P_VALID): Likewise. + (lang_type_class): Add fields_readonly. + * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN. + * pt.c (dependent_type_p_r): New function, split out from ... + (dependent_type_p): ... here. Memoize results. + * search.c (dependent_base_p): Use dependent_type_p, not + uses_template_parms. + * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY + for class types. + +2003-01-29 Mark Mitchell + + * call.c (build_field_call): Use build_new_op, not build_opfncall. + (prep_operand): New function. + (build_new_op): Use it. Remove dead code. + * class.c (pushclass): Change "modify" parameter type from int to + bool. + (currently_open_class): Use same_type_p, not pointer equality. + (push_nested_class): Adjust calls to pushclass, remove modify + parameter. + * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro. + (pushclass): Change prototype. + (push_nested_class): Likewise. + (grokoptypename): Remove. + (build_opfncall): Remove. + (value_dependent_expression_p): Declare. + (resolve_typename_type): Likewise. + (resolve_typename_type_in_current_instantiation): Likewise. + (enter_scope_of): Remove. + (tsubst): Remove. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (tsubst_copy_and_build): Likewise. + * decl.c (warn_about_implicit_typename_lookup): Remove. + (finish_case_label): Return error_mark_node for erroneous labels. + (start_decl): Adjust calls to push_nested_class. + (grokfndecl): Call push_scope/pop_scope around call to + duplicate_decls. + (grokdeclarator): Do not call tsubst. + (start_function): Adjust calls to push_nested_class. + * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall. + (check_classfn): Use push_scope/pop_scope around type comparisions. + (grokoptypename): Remove. + (push_sscope): Adjust call to push_nested_class. + * error.c (dump_type): Show cv-qualification of typename types. + * init.c (build_member_call): Use build_new_op, not + build_opfncall. + * method.c (build_opfncall): Remove. + * parser.c (cp_parser): Add allow_non_constant_expression_p and + non_constant_expression_p. + (cp_parser_constant_expression): Adjust prototype. + (cp_parser_resolve_typename_type): Remove. + (cp_parser_non_constant_expression): New function. + (cp_parser_non_constant_id_expression): Likewise. + (cp_parser_new): Set allow_non_constant_expression_p and + non_constant_expression_p. + (cp_parser_primary_expression): Reject `this' and `va_arg' in + constant-expressions. Note that dependent names aren't really + constant. + (cp_parser_postfix_expression): Reject conversions to non-integral + types in constant-expressions. Neither are increments or + decrements. + (cp_parser_unary_expression): Reject increments and decrements in + constant-expressions. + (cp_parser_direct_new_declarator): Adjust call to + cp_parser_constant_expression. + (cp_parser_cast_expression): Reject conversions to non-integral + types in constant-expressions. + (cp_parser_assignment_expression): Rejects assignments in + constant-expressions. + (cp_parser_expression): Reject commas in constant-expressions. + (cp_parser_labeled_statement): Adjust call to + cp_parser_constant_expression. + (cp_parser_direct_declarator): Simplify array bounds, even in + templates, when they are non-dependent. Use + resolve_typename_type, not cp_parser_resolve_typename_type. + (cp_parser_class_head): Use resolve_typename_type, not + cp_parser_resolve_typename_type. + (cp_parser_member_declaration): Adjust call to + cp_parser_constant_expression. + (cp_parser_constant_initializer): Likewise. + (cp_parser_constructor_declarator): Use resolve_typename_type, not + cp_parser_resolve_typename_type. + (cp_parser_late_parsing_default_args): Adjust call to + push_nested_class. + * pt.c (tsubst): Give it internal linkage. + (tsubst_expr): Likewise. + (tsubst_copy): Likewise. + (tsubst_copy_and_build): Likewise. + (push_access_scope_real): Likewise. + (tsubst_friend_class): Likewise. + (instantiate_class_template): Adjust call to pushclass. + (value_dependent_expression_p): Give it external linkage. + Robustify. + (resolve_typename_type): New function. + * semantics.c (finish_call_expr): Use build_new_op, not + build_opfncall. + (begin_constructor_declarator): Remove. + (begin_class_definition): Adjust call to pushclass. + (enter_scope_of): Remove. + * typeck.c (comptypes): Resolve typename types as appropriate. + (build_x_indirect_ref): Use build_new_op, not build_opfncall. + (build_x_compound_expr): Likewise. + (build_modify_expr): Likewise. + (build_x_modify_expr): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2003-01-29 Fariborz Jahanian + + * pt.c (last_pending_template) Declare GTY(). + +2003-01-29 Kriang Lerdsuwanakij + + PR c++/8591 + * parser.c (cp_parser_elaborated_type_specifier): Convert + TEMPLATE_DECL to TYPE_DECL only when processing template friends. + (cp_parser_maybe_treat_template_as_class): Remove redundant tests. + +2003-01-28 Nathan Sidwell + + PR c++/9437 + * pt.c (unify): Don't unify '*T' with 'U C::*'. + + PR c++/3902 + * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor + inside a declarator. + +2003-01-27 Nathan Sidwell + + * class.c (update_vtable_entry_for_fn): Add index parameter. + Generate vcall thunk for covariant overriding from a virtual + primary base. + (dfs_modify_vtables): Adjust. + +2003-01-25 Nathan Sidwell + + PR c++/9403 + * parser.c (cp_parser_class_or_namespace_name): Reject duplicate + template keyword. + (cp_parser_base_specifier): Look for and consume a + TEMPLATE keyword. Replace switch with array index. + + PR c++/795 + * semantics.c (finish_non_static_data_member): Remember the + field's type even in a template. + + PR c++/9415 + * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are + already scoped. + + PR c++/8545 + * parser.c (cp_parser_cast_expression): Be more tentative. + +2003-01-25 Kriang Lerdsuwanakij + + * cp-tree.h (flagged_type_tree_s): Remove. + (check_for_new_type): Likewise. + * typeck2.c (check_for_new_type): Likewise. + +2003-01-23 Nathanael Nerode + + * dump.c: ANSIfy function declarations and definitions. + + * cp-tree.h, decl.h: Get rid of PARAMS. Again. + +2003-01-22 Mark Mitchell + + PR c++/9354 + * init.c (build_new): Set the type of the new-expression, even + when processing_templte_decl. + + PR c++/9216 + * parser.c (cp_parser_primary_expression): Improve error message + for templates used in an expression context. + + PR c++/8696 + * parser.c (cp_parser_decl_specifier_seq): Commit to tentative + parse when encountering "typedef". + +2003-01-22 Nathanael Nerode + + * class.c, parser.c: ANSIfy function definitions and declarations. + +2003-01-22 Mark Mitchell + + PR c++/9328 + * error.c (dump_decl): For an OVERLOAD, just print the name of the + function; it doesn't make sense to try to print its type. + * semantics.c (finish_typeof): Issue errors about invalid uses. + + PR c++/9298 + * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New + function. + (cp_parser_expression_statement): Use it. + (cp_parser_explicit_instantiation): Likewise. + * pt.c (do_decl_instantiation): Improve error handling logic. + +2003-01-22 Mark Mitchell + + PR c++/9384 + * parser.c (cp_parser_using_declaration): Issue error messages + about name resolution failures here. + + PR c++/9388 + * class.c (currently_open_derived_class): Use dependent_type_p. + * cp-tree.h (dependent_type_p): New function. + (dependent_template_arg_p): Likewise. + (dependent_template_p): Likewise. + (type_dependent_expression_p): Likewise. + * parser.c (cp_parser_dependent_type_p): Remove. + (cp_parser_value_dependent_type_p): Likewise. + (cp_parser_type_dependent_expression_p): Likewise. + (cp_parser_dependent_template_arg_p): Likewise. + (cp_parser_dependent_template_id_p): Likewise. + (cp_parser_dependent_template_p): Likewise. + (cp_parser_diagnose_invalid_type_name): Replace + cp_parser_dependent_type_p with dependent_type_p, etc. + (cp_parser_primary_expresion): Likewise. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_postfix_expression): Likewise. + (cp_parser_unary_expression): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name): Likewise. + * pt.c (dependent_type_p): New function. + (value_dependent_expression_p): Likewise. + (type_dependent_expression_p): Likewise. + (dependent_template_arg_p): Likewise. + (dependent_template_id_p): Likewise. + (dependent_template_p): Likewise. + + PR c++/9285 + PR c++/9294 + * parser.c (cp_parser_simple_declaration): Return quickly when + encountering errors. + +2003-01-21 Kaveh R. Ghazi + + Make-lang.in (cp/decl.o-warn): Add -Wno-error. + +2003-01-17 Jason Merrill + + PR c++/9167, c++/9358 + * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE. + +2003-01-17 Jason Merrill + + PR c++/9342 + * call.c (build_conditional_expr): Always do lvalue-rvalue + conversion. + +2003-01-17 Mark Mitchell + + PR c++/9294 + * cp-tree.def (BASELINK): Make it class 'x', not class 'e'. + * cp-tree.h (BASELINK_BINFO): Adjust. + (BASELINK_FUNCTIONS): Likewise. + (BASELINK_ACCESS_BINFO): Likewise. + (tree_baselink): New structure. + (cp_tree_node_structure_enum): Add TS_CP_BASELINK. + (lang_tree_node): Add baselink. + * decl.c (cp_tree_node_structure): Add BASELINK case. + * search.c (build_baselink): Adjust. + * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P + test from TREE_LIST case. + + PR c++/9272 + * parser.c (cp_parser_constructor_declarator_p): Do not assume + that a constructor cannot be declared outside of its own class. + + * parser.c (cp_parser_resolve_typename_type): If the scope cannot + be resolved, neither can the qualified name. + + * rtti.c (get_pseudo_ti_desc): Fix thinko. + +2003-01-16 Jason Merrill + + PR c++/8564 + * init.c (build_vec_init): Re-add maxindex parm. + (perform_member_init, build_aggr_init): Pass it. + (build_new_1): Pass it. Use an incomplete array type for full_type. + * typeck.c (build_modify_expr): Pass it. + * cp-tree.h: Adjust. + +2003-01-16 Jeffrey D. Oldham + + * cp-tree.h (tsubst_copy_and_build): New declaration. + * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment. + (tsubst_expr): Use 'tsubst_copy_and_build'. Update initial comment. + (tsubst_copy_and_build): New function. + +2003-01-16 Mark Mitchell + + * cp-tree.h (lang_type_class): Remove is_partial_instantiation. + (PARTIAL_INSTANTIATION_P): Remove. + (IMPLICIT_TYPENAME_P): Likewise. + (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. + (build_typename_type): Remove declaration. + (parmlist_is_exprlist): Likewise. + * decl.c (build_typename_type): Make it static, remove third + parameter. + (push_class_binding): Don't do implicit typename stuff. + (make_typename_type): Likewise. + (lookup_name_real): Likewise. + (grokdeclarator): Don't try to convert declarations into + initializations. Don't do implicit typename stuff. + (parmlist_is_exprlist): Remove. + (xref_basetypes): Simplify. + * decl2.c (grokfield): Don't try to convert declarations into + initializations. + (build_anon_union_vars): Do this while processing templates, too. + (finish_anon_union): Likewise. + * error.c (dump_type): Remove implicit typename handling. + * parser.c (cp_parser_diagnose_invalid_type_name): New method. + (cp_parser_primary_expression): Correct handling of names not + found by unqualified name lookup in templates. + (cp_parser_nested_name_specifier_opt): Avoid checking dependency + of types when possible. + (cp_parser_simple_declaration): Complain intelligently about some + invalid declarations. + (cp_parser_member_declaration): Likewise. + (cp_parser_constructor_declarator_p): Don't check when we're in a + function scope. + * pt.c (instantiate_class_template): Remove + PARTIAL_INSTANTIATION_P gunk. + * search.c (lookup_field_r): Don't build implicit typenames. + (marked_pushdecls_p): Don't enter dependent base types. + (unmarked_pushdecls_p): Likewise. + * semantics.c (begin_class_definition): Remove implicit typename + stuff. + +2003-01-16 Nathan Sidwell + + PR c++/9212 + * parser.c (cp_parser_direct_declarator): If accepting either + abstract or named, the name must be an unqualified-id. + +2003-01-16 Kaveh R. Ghazi + + * class.c (layout_virtual_bases): Avoid signed/unsigned warning. + +2003-01-14 Kaveh R. Ghazi + + * decl2.c (check_classfn): Fix uninitialized warning. + (build_anon_union_vars): Likewise. + * pt.c (tsubst_copy): Likewise. + +2003-01-14 Jeffrey D. Oldham + + Further conform g++'s __vmi_class_type_info to the C++ ABI + specification. + * rtti.c (dfs_class_hint_mark): Do not set hints not specified by + the specification. + (class_hint_flags): Likewise. + +2003-01-14 Kriang Lerdsuwanakij + + * config-lang.in: Add semantics.c to gtfiles. + * cp-tree.h (flagged_type_tree_s): Remove lookups field. + (saved_scope): Likewise. + (type_lookups): Remove. + (deferred_access): New structure. + (type_access_control): Remove. + (save_type_access_control): Likewise. + (reset_type_access_control): Likewise. + (decl_type_access_control): Likewise. + (push_deferring_access_checks): Declare. + (resume_deferring_access_checks): Likewise. + (stop_deferring_access_checks): Likewise. + (pop_deferring_access_checks): Likewise. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_deferred_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + * decl.c (make_typename_type): Use perform_or_defer_access_check. + (make_unbound_class_template): Likewise. + (grokdeclarator): Don't call decl_type_access_control. + * parser.c (cp_parser_context): Remove deferred_access_checks + and deferring_access_checks_p fields. + (cp_parser_context_new): Adjust. + (cp_parser): Remove access_checks_lists. + (cp_parser_defer_access_check): Remove. + (cp_parser_start_deferring_access_checks): Remove. + (cp_parser_stop_deferring_access_checks): Remove. + (cp_parser_perform_deferred_access_checks): Remove. + (cp_parser_nested_name_specifier_opt): Use new deferred access + functions. + (cp_parser_simple_declaration): Likewise. + (cp_parser_template_id): Likewise. + (cp_parser_function_definition): Likewise. + (cp_parser_class_specifier): Likewise. + (cp_parser_lookup_name): Likewise. + (cp_parser_single_declaration): Likewise. + (cp_parser_pre_parsed_nested_name_specifier): Likewise. + (cp_parser_parse_tentatively): Likewise. + (cp_parser_parse_definitely): Likewise. + (yyparse): Likewise. + (cp_parser_init_declarator): Remove access_checks parameter. + Use new deferred access functions. + (cp_parser_function_definition_from_specifiers_and_declarator): + Likewise. + (cp_parser_class_head): Remove deferring_access_checks_p and + saved_access_checks parameters. Use new deferred access functions. + (cp_parser_member_specification_opt): Don't call + reset_type_access_control. + * search.c (type_access_control): Remove. + * semantics.c: Include "gt-cp-semantics.h". + (deferred_type_access_control): Remove. + (deferred_access_stack): New variable. + (deferred_access_free_list): Likewise. + (push_deferring_access_checks): New function. + (resume_deferring_access_checks): Likewise. + (stop_deferring_access_checks): Likewise. + (pop_deferring_access_checks): Likewise. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_deferred_access_checks): New function, adapted from + cp_parser_perform_deferred_access_checks. + (perform_or_defer_access_check): New function, adapted from + cp_parser_defer_access_check. + (current_type_lookups): Remove. + (deferred_type_access_control): Likewise. + (decl_type_access_control): Likewise. + (save_type_access_control): Likewise. + (reset_type_access_control): Likewise. + (begin_function_definition): Adjust. + (begin_class_definiton): Likewise. + +2003-01-13 Jason Merrill + + PR c++/8748 + * class.c (build_base_path): Take the address before calling save_expr. + + * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if + all the ambiguous conversions are bad. + + * class.c (maybe_warn_about_overly_private_class): Don't stop + searching when we find a nonprivate method. + + * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue. + +2003-01-12 Mark Mitchell + + * cp-tree.h (get_arglist_len_in_bytes): Remove. + + PR c++/9264 + * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous + typeame types more robustly. + +2003-01-11 Phil Edwards + + * parser.c: Fix comment typos. + +2003-01-10 Mark Mitchell + + PR c++/9099 + * parser.c (cp_parser_scope_through_which_access_occurs): Handle + an object_type which is not a class type. + +2003-01-10 Geoffrey Keating + + * parser.c (cp_parser_late_parsing_for_member): Don't cast to void. + (cp_parser_late_parsing_default_args): Likewise. + +2003-01-10 Nathanael Nerode + + * cfns.gperf: ANSIfy function declarations. + * cfns.h: Regenerate. + * cp-tree.h: ANSIfy function declarations. + +2003-01-10 Mark Mitchell + + * cp-tree.h (reparse_absdcl_as_expr): Remove. + (reparse_absdcl_as_casts): Likewise. + (reparse_decl_as_expr): Likewise. + (finish_decl_parsing): Likewise. + * decl2.c (reparse_absdcl_as_expr): Remove. + (reparse_absdcl_as_casts): Likewise. + (repase_decl_as_expr): Likewise. + (finish_decl_parsing): Likewise. + + PR c++/9128 + PR c++/9153 + PR c++/9171 + * parser.c (cp_parser_pre_parsed_nested_name_specifier): New + function. + (cp_parser_nested_name_specifier_opt): Correct the + check_dependency_p false. + (cp_parser_postfix_expression): Fix formatting. + (cp_parser_decl_specifier_seq): Avoid looking for constructor + declarators when possible. + (cp_parser_template_id): Avoid performing name-lookup when + possible. + (cp_parser_class_head): Do not count specializations when counting + levels of templates. + (cp_parser_constructor_declarator_p): Return immediately if + there's no chance that the tokens form a constructor declarator. + * rtti.c (throw_bad_typeid): Add comment. Do not return an + expression with reference type. + (get_tinfo_decl_dynamic): Do not return an expression with + reference type. + (build_typeid): Add comment. Do not return an expression with + reference type. + * typeck.c (build_class_member_access_expr): Improve handling of + conditionals and comma-expressions as objects. + +2003-01-09 Nathanael Nerode + + * cfns.gperf: ANSIfy function declarations. + * cfns.h: Regenerate. + * cp-tree.h: ANSIfy function declarations. + * parser.c: ANSIfy function declarations & definitions. + + * decl.c (bad_specifiers): Fix parameter order error I introduced. + +2003-01-09 Geoffrey Keating + + Merge from pch-branch: + + 2003-01-09 Geoffrey Keating + + Merge to tag pch-merge-20030102: + + * semantics.c (finish_translation_unit): Don't call finish_file. + * parser.c: Don't include ggc.h. + (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer, + read first token here. Don't allow PCH files after the first + token is read. + (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new. + (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL. + (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory. + (cp_parser_late_parsing_for_member): Don't duplicate call to + cp_lexer_set_source_position_from_token. + (cp_parser_late_parsing_default_args): Likewise. + (yyparse): Call finish_file after clearing the_parser. + + 2002-12-11 Geoffrey Keating + + * Make-lang.in: Remove $(GGC_H) from all dependencies. + (CXX_TREE_H): Add $(GGC_H). + * class.c: Don't include ggc.h. + (field_decl_cmp): Make parameters be 'const void *' to match qsort. + (method_name_cmp): Likewise. + (resort_data): New variable. + (resort_field_decl_cmp): New. + (resort_method_name_cmp): New. + (resort_sorted_fields): New. + (resort_type_method_vec): New. + (finish_struct_methods): Delete cast. + (finish_struct_1): Delete cast. + * cp-tree.h: Include ggc.h. + (struct lang_type_class): Add reorder attribute to field `methods'. + (union lang_decl_u3): Add reorder attribute to field `sorted_fields'. + (resort_sorted_fields): New prototype. + (resort_type_method_vec): New prototype. + * call.c: Don't include ggc.h. + * decl.c: Likewise. + * decl2.c: Likewise. + * init.c: Likewise. + * lex.c: Likewise. + * method.c: Likewise. + * optimize.c: Likewise. + * parse.y: Likewise. + * pt.c: Likewise. + * repo.c: Likewise. + * search.c: Likewise. + * semantics.c: Likewise. + * spew.c: Likewise. + * tree.c: Likewise. + + * lang-specs.h: Remove comment. + + 2002-12-03 Geoffrey Keating + + * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery. + (operator_name_info): Mark to be saved for PCH, specify size. + (assignment_operator_name_info): Likewise. + + 2002-11-19 Geoffrey Keating + + * decl.c (anon_cnt): Mark to be saved for PCH. + + 2002-10-25 Geoffrey Keating + + * lex.c (init_reswords): Delete now-untrue comment. + Allocate ridpointers using GGC. + + 2002-10-04 Geoffrey Keating + + * cp-tree.h (union lang_decl_u2): Add tags to all fields. + + * g++spec.c (lang_specific_driver): Don't include standard + libraries in `added'. + + 2002-08-27 Geoffrey Keating + + * decl2.c (finish_file): Call c_common_write_pch. + * Make-lang.in (CXX_C_OBJS): Add c-pch.o. + + 2002-08-17 Geoffrey Keating + + * g++spec.c (lang_specific_driver): Treat .h files as C++ header + files when using g++. + * lang-specs.h: Handle compiling C++ header files. + +2003-01-09 Jakub Jelinek + + * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs. + +2003-01-09 Kriang Lerdsuwanakij + + * pt.c (push_access_scope_real): Call push_to_top_level for + function in namespace scope. + (pop_access_scope): Call pop_from_top_level for function in + namespace scope. + +2003-01-09 Jakub Jelinek + + * decl.c (start_decl): Don't set DECL_COMMON for __thread variables. + +2003-01-09 Christian Cornelssen + + * Make-lang.in (c++.install-common, c++.install-man, + c++.uninstall): Prepend $(DESTDIR) to destination paths in + all (un)installation commands. + (c++.install-common): Rewrite $(LN) commands to support + DESTDIR with "ln" as well as with "ln -s". + +2003-01-08 Jason Merrill + + * parser.c (cp_parser_primary_expression): See through explicitly + scoped ALIAS_DECLs, too. + +2003-01-08 Nathanael Nerode + + * decl.c: Remove some #if 0 code. + + * decl.c: ANSIfy function declarations. + +2003-01-07 Mark Mitchell + + * parser.c (cp_parser_asm_definition): Correct handling of omitted + operands. + +2003-01-08 Kriang Lerdsuwanakij + + PR c++/9030 + * decl.c (make_typename_type): Check access only when tf_error. + (make_unbound_class_template): Likewise. + * pt.c (saved_access_scope): New variable. + (push_access_scope_real): New function. + (push_access_scope): Likewise. + (pop_access_scope): Likewise. + (tsubst_default_argument): Use them. + (instantiate_template): Likewise. + (regenerate_decl_from_template): Likewise. + (instantiate_decl): Likewise. + (get_mostly_instantiated_function_type): Likewise. + +2003-01-07 Nathanael Nerode + + * tree.c: Delete bogus #if 0 code. + +2003-01-07 Andreas Schwab + + * class.c (layout_class_type): Don't use + PCC_BITFIELD_TYPE_MATTERS if not defined. + +2003-01-06 Mark Mitchell + + PR c++/9165 + * decl2.c (build_cleanup): Mark the object as used. + + * pt.c (retrieve_local_specialization): Revert 2003-01-05 change. + (hash_local_specialization): New function. + (register_local_specialization): Revert 2003-01-05 change. + (instantiate_decl): Use hash_local_specialization when creating + the local_specializations table. + + * decl2.c (mark_used): Do not synthesize thunks. + + * class.c (layout_class_type): Correct handling of unnamed + bitfields wider than their types. + + PR c++/9189 + * parser.c (cp_parser): Remove default_arg_types. Update + documentation for unparsed_functions_queues. + (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the + parameter. + (cp_parser_new): Don't set parser->default_arg_types. + (cp_parser_function_definition): Adjust usage of + unparsed_funtions_queues. + (cp_parser_class_specifier): Don't mess with + parser->default_arg_types. Handle default argument processing in + a separate phase from function body processing. + (cp_parser_template_declaration_after_export): Adjust usage of + unparsed_functions_queues. + (cp_parser_late_parsing_for_member): Do not handle default + arguments. + +2003-01-06 Nathan Sidwell + + PR c++/9109 + * parser.c (cp_parser_declarator_kind): New enum. + (cp_parser_declarator): Adjust. + (cp_parser_direct_declarator): Adjust. Allow for either named or + abstract declarator. Prefer abstract, if possible. Allow + parenthesized function name. + (cp_parser_condition): Adjust cp_parser_declarator call. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_function_definition): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_parameter_declaration): Use cp_parser_declarator to do + the tentative parsing. + (cp_parser_exception_declaration): Likewise. + +2003-01-05 Mark Mitchell + + * parser.c (cp_parser_template_parameter): Adjust call to + cp_parser_parameter_declaration. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_parameter_declaration): Replace + greater_than_is_operator_p with template_parm_p parameter. Do not + cache tokens for template default arguments. + + * pt.c (retrieve_local_specialization): Use htab_find, not + htab_find_with_hash. + (register_local_specialization): Use htab_find_slot, not + htab_find_slot_with_hash. + (instantiate_decl): Pass a hash function to htab_create. + +2003-01-04 Kaveh R. Ghazi + + * parser.c (cp_parser_binary_expression, + cp_parser_multiplicative_expression, + cp_parser_additive_expression, cp_parser_shift_expression, + cp_parser_relational_expression, cp_parser_equality_expression, + cp_parser_and_expression, cp_parser_exclusive_or_expression, + cp_parser_inclusive_or_expression, + cp_parser_logical_and_expression, cp_parser_logical_or_expression, + cp_parser_binary_expression): Const-ify. + +2003-01-04 Mark Mitchell + + * method.c (use_thunk): Disable access control while building the + body of the thunk. + +2003-01-03 Nathanael Nerode + + * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C + front end. + +2003-01-03 Matt Austern + + * cp-tree.h (struct lang_type_class): add field for key method + (cp_global_trees): rename dynamic_classes to keyed_classes + (key_method): add definition + * class.c (finish_struct_1): compute class's key method, and add + the class to keyed_classes list if there is no key method. + * decl.c (finish_function): add class to keyed_classes list if we + see a definition of the class's key method. + * pt.c (instantiate_class_template): add template specialization + of a dynamic class to keyed_classes list. + * decl2.c (key_method): remove + (finish_file): iterate only through keyed_classes list when + deciding whether to emit vtables, remove class from its list after + we do the emission. + +2003-01-02 Jason Merrill + + * call.c (build_conditional_expr): Stabilize lvalues properly. + * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type. + * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues. + Don't allow CALL_EXPR or VA_ARG_EXPR, either. + + * call.c (convert_like_real): Call decl_constant_value for an + IDENTITY_CONV even if there are no more conversions. + + * cvt.c (build_up_reference): Don't push unnamed temps. + + * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL. + + * dump.c (cp_dump_tree): Don't try to dump class-specific fields + for a backend struct. + + * except.c (wrap_cleanups_r, build_throw): Make + MUST_NOT_THROW_EXPRs void. + * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR. + + * init.c (build_vec_delete_1): Pre-evaluate the base address. + + * init.c (get_temp_regvar): Simplify logic. + + * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if + our replacement is a decl. + + * decl.c (cp_make_fname_decl): Push the decls inside the + outermost scope. + +2003-01-03 Nathan Sidwell + + PR c++/45, c++/3784 + * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be + the same too. + +2003-01-03 Graham Stott + + * parser.c (struct cp_parser): Add access_checks_lists field + (cp_parser_simple_declaration): Use. + (cp_parser_init_declarator): Likewise. + +2003-01-02 Mark Mitchell + + * parser.c (cp_parser_declaration): Accept the __extension__ + keyword before the declaration. + + PR c++/2843 + * parser.c (cp_parser_parameter_declaration): Allow attributes to + appear after the declarator. + + * call.c (build_new_method_call): Fix typo in message format + string. + +2003-01-02 Mark Mitchell + + * parser.c (cp_lexer_next_token_is): Declare it inline. + (cp_lexer_set_source_position_from_token): Likewise. + (cp_lexer_debugging_p): Likewise. + (cp_parser_parsing_tentatively): Likewise. + (cp_parser_nested_name_specifier_opt): Reduce the number of calls + to the cp_lexer_peek_token. + + * parser.c (cp_parser_sizeof_operand): Do not evaluate the + expression. + +2003-01-02 Steven Bosscher + + * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c, + cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c, + cp/repo.c: Fix copyright years. + +2003-01-01 Neil Booth + + * lex.c: Remove superfluous include of cpplib.h. + (CONSTRAINT): Define without conditions. + (init_cp_pragma): Use c_register_pragma. + diff --git a/gcc/cp/ChangeLog-2004 b/gcc/cp/ChangeLog-2004 new file mode 100644 index 00000000000..7dd4e26d4cb --- /dev/null +++ b/gcc/cp/ChangeLog-2004 @@ -0,0 +1,6877 @@ +2004-12-31 Richard Henderson + + PR middle-end/17799 + * call.c (make_temporary_var_for_ref_to_temp): Set DECL_IGNORED_P. + * class.c (build_vtable): Don't conditionallize setting it + based on DWARF2_DEBUG. + (layout_class_type): Set DECL_IGNORED_P. + * decl2.c (get_guard): Likewise. + * rtti.c (get_tinfo_decl, build_lang_decl): Likewise. + * tree.c (build_local_temp): Likewise. + +2004-12-30 Mark Mitchell + + * cp-tree.h (cp_declarator): Split "name" field into + qualifying_scope and unqualified_name. + * decl.c (get_scope_of_declarator): Adjust accordingly. + (grokdeclarator): Likewise. + * decl2.c (grokfield): Likewise, and adjust call to + do_class_using_decl. + * name-lookup.c (do_class_using_decl): Split "decl" into + "scope" and "name". Remove unnecessary code. + * name-lookup.h (do_class_using_decl): Adjust declaration. + * parser.c (make_id_declarator): Split "id" into qualifying_scope + and unqualified_name. + (cp_parser_using_declaration): Adjust call to do_class_using_decl. + (cp_parser_direct_declarator): Adjust to handle the fact that + cp_parser_declarator_id no longer returns a SCOPE_REF. + (cp_parser_direct_declarator): Likewise. + (cp_parser_declarator_id): Do not create a SCOPE_REF for qualified + names. + (cp_parser_member_declaration): Adjust call to make_id_declarator. + (cp_parser_check_declarator_template_parameters): Do not expect a + SCOPE_REF. + + * decl.c (duplicate_decls): Call ggc_free on declarations we will + not be needing any longer. + + PR c++/19190 + * cvt.c (convert_to_void): Do not use STRIP_NOPs. + +2004-12-28 Richard Henderson + + PR inline-asm/15740 + * semantics.c (finish_asm_stmt): Resolve asm names. Validate input + constraints. Mark memory inputs addressable. + +2004-12-27 Jason Merrill + + * decl.c (expand_static_init): Don't use shortcut if + targetm.relaxed_ordering. + +2004-12-27 Mark Mitchell + + PR c++/19149 + * decl.c (check_tag_decl): Robustify. + +2004-12-23 Mark Mitchell + + PR c++/17595 + * parser.c (cp_parser_error): Issue better messages about + #pragma in locations where it is not permitted. + + PR c++/17413 + * pt.c (check_instantiated_args): Remove bogus SFINAE code. + + * cvt.c (convert_to_void): Fix typo in comment. + +2004-12-23 Alexandre Oliva + + PR c++/18962 + * pt.c (check_explicit_specialization): Use the argument list from + the definition in a template function specialization definition. + +2004-12-23 Giovanni Bajo + + PR c++/18733 + * pt.c (check_explicit_specialization): Use special logic to validate + befriended specializations. + +2004-12-22 Mark Mitchell + + * rtti.c (emit_support_tinfos): Avoid using C99 semantics. + + PR c++/18464 + * call.c (build_this): In templates, do not bother with + build_unary_op. + * typeck.c (unary_complex_lvalue): In a template, always refuse + simplifications. + + PR c++/18492 + * cp-gimplify.c (cp_genericize): Relax assertion. + + PR c++/11224 + * cvt.c (convert_to_void): Warn about unused values. + + PR c++/18257 + * rtti.c (emit_support_tinfos): On systems without weak symbols, + emit the runtime library type-info objects as non-COMDAT. + +2004-12-21 Mark Mitchell + + PR c++/18378 + * call.c (convert_like_real): Do not permit the use of a copy + constructor to copy a packed field. + + PR c++/19063 + * decl.c (grokdeclarator): Return error_mark_node, not + void_type_node, to indicate errors. + * parser.c (cp_parser_template_parameter_list): Robustify. + (cp_parser_template_parameter): Likewise. + + PR c++/19034 + * tree.c (cp_tree_equal): Handle OVERLOAD. + +2004-12-22 Volker Reichelt + + * decl.c (define_label): Use POP_TIMEVAR_AND_RETURN. + * name-lookup.c (pushdecl_class_level): Likewise. + +2004-12-21 Volker Reichelt + + * name-lookup.c (pushtag): Add missing POP_TIMEVAR_AND_RETURN. + +2004-12-21 Andrew Pinski + + PR c++/18984 + * cp-gimplify.c (cp_genericize_r): Don't insert first but instead + check to see if contains the pointer. Insert the statement before + returning. + +2004-12-21 Nathan Sidwell + + PR c++/14075 + * decl.c (check_initializer): Check string initializer of array is + not parenthesized. + * cp-tree.h (PAREN_STRING_LITERAL_P): New. + * semantics.c (finish_parenthesized_expr): Mark a STRING_CST. + * error.c (dump_expr): Add parens, if needed. + + * cp-tree.def (TEMPLATE_TYPE_PARM, + BOUND_TEMPLATE_TEMPLATE_PARM, TYPE_OF_TYPE, TYPENAME_TYPE): Reorder + for better code efficiency. + * cp-tree.h (CLASS_TYPE_P): Short circuit IS_AGGR_TYPE check. + (CAN_HAVE_FULL_LANG_DECL_P): Reorder for better optimization. + (INTEGRAL_CODE_P, CP_INTEGRAL_TYPE_P, + INTEGRAL_OR_ENUMERATION_TYPE_P, SCALAR_TYPE_P, + CP_AGGREGATE_TYPE_P, TYPE_PTROB_P, TYPE_REF_OBJ_P, + TYPE_PTROBV_P): Likewise. + + PR c++/18975 + * method.c (do_build_copy_constructor): Refactor. Don't const + qualify a mutable field. + (do_build_assign_ref): Likewise. + +2004-12-20 Matt Austern + + PR c++/19044 + * decl.c (make_rtl_for_nonlocal_decl): Use + set_builtin_user_assembler_name. + +2004-12-19 Mark Mitchell + + * cp-tree.h (note_decl_for_pch): New function. + * class.c (build_clone): Call note_decl_for_pch. + * semantics.c (finish_member_declaration): Likewise. + (note_decl_for_pch): New function. + +2004-12-17 Steven Bosscher + + * init.c (build_zero_init): max_index is the number of + elements, minus 1. + +2004-12-17 Nathan Sidwell + + PR c++/18721 + * class.c (add_method): Do not push conversion operators into a + binding level. + + * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE_TYPE): Reformat. + * error.c (dump_decl): Remove extraneous braces. + +2004-12-16 Nathan Sidwell + + PR c++/18905 + * cp-tree.h (integral_constant_value): Declare. + * call.c (null_ptr_cst_p): Use integral_constant_value, not + decl_constant_value. + (convert_like_real): Likewise. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (ocp_convert): Likewise. + (convert): Remove unnecessary decl_constant_value call. + * decl.c (compute_array_index_type): Use integral_constant_value, + not decl_constant_value. + (build_enumerator): Likewise. + * decl2.c (grokfield): Likewise. + * init.c (decl_constant_value): Simplify. + (integral_constant_value): New. + * pt.c (fold_decl_constant_value): Use integral_constant_value, + remove subsequent check. + (tsubst): Use integral_constant_value, not decl_constant_value. + (tsubst_copy, unify): Likewise. + * typeck.c (decay_conversion): Likewise. + (build_compound_expr): Remove unnecessary decl_constant_value + calls. + (build_static_cast_1, build_reinterpret_cast_1): + (convert_for_assignment): Remove comment about not calling + decl_constant_value. + +2004-12-15 Kriang Lerdsuwanakij + + PR c++/18825 + * pt.c (instantiate_class_template): Set input_location for + friend function. + (tsubst_friend_function): Don't set input_location here. + Make sure the context is complete if necessary. + +2004-12-15 Nathan Sidwell + + PR c++/18981 + * parser.c (cp_parser_lookup_name): Remove unneeded TYPENAME_TYPE + flag setting. + +2004-12-14 Mark Mitchell + + PR c++/18738 + * decl.c (make_typename_type): Do not handle namespace-scoped + names here. + (tag_name): Handle typename_type. + (check_elaborated_type_specifier): Handle typenames. + * parser.c (cp_parser_diagnose_invalid_type_name): Improve + comment. + (cp_parser_elaborated_type_specifier): Use + cp_parser_diagnose_invalid_type_name. + +2004-12-14 Andrew Pinski + + PR c++/18965 + * init.c (build_zero_init): If the max_index is 0, there is no + need to create a RANGE_EXPR. + +2004-12-14 Mark Mitchell + + PR c++/18793 + * cp-objcp-common.c (cp_expr_size): Loosen assertion. + +2004-12-14 Nathan Sidwell + + PR c++/18949 + * pt.c (tsubst_copy_and_build): Check that a + REFERENCE_REF_P is dereferencing a reference type. + * typeck.c (build_static_cast): Convert from reference even in a + template. + (build_reinterpret_cast, build_const_cast, build_c_cast): Likewise. + +2004-12-14 Volker Reichelt + + * parser.c (cp_parser_uncommitted_to_tentative_parse_p): New function. + (cp_parser_name_lookup_error): Use it. + (cp_parser_check_for_invalid_template_id): Likewise. + (cp_parser_skip_to_closing_parenthesis): Likewise. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_simple_declaration, cp_parser_template_id): Likewise. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_template_name): Let cp_parser_simulate_error perform + the checking. + (cp_parser_committed_to_tentative_parse): Remove. + +2004-12-13 Andrew Pinski + + PR c++/18968 + * class.c (build_base_path): Convert the zero constant to the correct + type when comparing. + +2004-12-13 Mark Mitchell + + PR c++/18925 + * class.c (layout_class_type): Determine the visibility of static + data members. + +2004-12-12 Roger Sayle + + PR middle-end/12454 + * cp-gimplify.c (gimplify_if_stmt): Optimize the case where the + condition is a constant and the unexecuted clause is empty. + +2004-12-10 Volker Reichelt + + PR c++/18731 + * parser.c (cp_parser_class_head): Reject typedef-name in class head. + +2004-12-09 Matt Austern + + PR c++/18514 + * name-lookup.c (do_nonmember_using_decl): A real function + declaration takes precedence over an anticipated declaration. + +2004-12-09 Volker Reichelt + + * parser.c (cp_parser_member_declaration): Fix comment typo. + +2004-12-09 Alexandre Oliva + + PR c++/18757 + * parser.c (cp_parser_template_id): Don't create a CPP_TEMPLATE_ID + if parsing failed. + +2004-12-09 Volker Reichelt + + PR c++/18073 + * typeck.c (build_reinterpret_cast_1): Allow cast from vector type. + +2004-12-09 Nathan Sidwell + + PR c++/16681 + * init.c (build_zero_init): Build a RANGE_EXPR for an array + initializer. + +2004-12-08 Kelley Cook + + * typeck.c: Remove DOS line endings. + +2004-12-08 Kriang Lerdsuwanakij + + PR c++/18100 + * decl.c (lookup_and_check_tag): Diagnose nested class with + the same name as enclosing class. + +2004-12-08 Nathan Sidwell + + PR c++/18803 + * cp-tree.h (REFERENCE_REF_P): New. + (CPTI_TYPE_INFO_TYPE): Rename to ... + (CPTI_CONST_TYPE_INFO_TYPE): ... here. + (CPTI_TYPE_INFO_REF_TYPE): Remove. + (type_info_type_node): Rename to ... + (const_type_info_type_node): ... here. + (type_info_ref_type): Remove. + * call.c (build_user_type_conversion): Reformat. + (resolve_args): Do not convert_from_reference. + (build_object_call): Call convert_from_reference. + (prep_operand): Do not convert_from_reference. + (build_new_method_call): Likewise. + * class.c (build_vfield_ref): Likewise. + * cvt.c (convert_to_reference): Likewise. + (convert_from_reference): Build INDIRECT_REF here, not with + build_indirect_ref. + (convert_force): Do not convert_from_reference. + (build_expr_type_conversion): Likewise. + * decl.c (grok_reference_init): Likewise. + * decl2.c (delete_sanity): Likewise. + * except.c (initialize_handler_parm): Use POINTER_TYPE_P. + * init.c (build_dtor_call): Do not convert_from_reference. + * parser.c (cp_parser_template_argument): Unwrap indirected + reference. Allow TEMPLATE_PARM_INDEX as an object parm. + * pt.c (tsubst_copy_and_build) : Use + convert_from_reference, if indicated. + : Do not convert_from_reference. + : Convert_from_reference if needed. + (tsubst_initializer_list): Do not convert_from_reference. + * rtti.c (init_rtti_processing): Adjust node creation. + (throw_bad_typeid): Use const_type_info_type_node. + Do not convert_from_reference. + (typeid_ok_p): Use const_type_info_type_node. + (build_typeid, get_typeid): Always return type_info typed node. + (build_dynamic_cast_1): Dont convert_from_reference. Refactor. + * semantics.c (finish_stmt_expr_expr): Do not + convert_from_reference. + (finish_id_expression): Convert_from_reference as appropriate. + * typeck.c (decay_conversion): Do not convert_from_reference. + (finish_class_member_access_expr): Likewise. + (build_indirect_ref): Use POINTER_TYPE_P. + (convert_arguments): Do not convert_from_reference. + (build_modify_expr): Likewise. + (convert_for_initialization): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2004-12-07 Ziemowit Laski + + * cp-tree.h (struct lang_type_class): Rename 'objc_protocols' + field to 'objc_info'. + +2004-12-07 Kazu Hirata + + * pt.c: Replace a use of first_rtl_op with TREE_CODE_LENGTH. + +2004-12-07 Roger Sayle + + * name-lookup.c (leave_scope): We only need to update + class_binding_level when leaving a class scope. + +2004-12-06 Ziemowit Laski + + * cp-tree.h (struct lang_type_class): Add 'objc_protocols' field. + +2004-12-04 Kriang Lerdsuwanakij + + PR c++/17011, c++/17971 + * pt.c (tsubst_copy) : Check and diagnose + invalid field. + (tsubst_copy_and_build) : Check + error_mark_node after member substitution. + * semantics.c (finish_id_expression): Call + finish_non_static_data_member for non-dependent FIELD_DECL. + +2004-12-03 Nathan Sidwell + + PR c++/18782 + * decl.c (grokdeclarator): Make sure class in pointer to member is + not a namespace. + +2004-12-02 Nathan Sidwell + + PR c++/18318 + * parser.c (cp_parser_new_type_id): Move array size expression + checks from here ... + * init.c (build_new): ... to here. + +2004-12-02 Nathan Sidwell + + PR c++/18758 + * parser.c (cp_parser_class_head): Return NULL_TREE when + push_template_decl fails. Update comment. + +2004-12-02 Kriang Lerdsuwanakij + + PR c++/15664, c++/18276 + * pt.c (tsubst_decl) : Reorganize. Correctly + tsubst TEMPLATE_DECL that is a TEMPLATE_TEMPLATE_PARM. + +2004-12-02 Kriang Lerdsuwanakij + + PR c++/18123 + * parser.c (cp_parser_type_specifier): Catch template declaration + of enum. + +2004-12-01 Matt Austern + + * name-lookup.c (namespace_binding): Omit alias check for global + namespace. + +2004-12-01 Nathan Sidwell + + PR c++/18729 + * parser.c (cp_parser_class_name): Check decl's type is not + error_mark_node. + + PR c++/17431 + * call.c (standard_conversion): Add FLAGS parameter. Do not allow + derived to base conversion when checking constructor + accessibility. + (implicit_conversion): Pass FLAGS to standard_conversion. + (check_constructir_callable): Disallow conversion functions. + +2004-11-30 Kazu Hirata + + * parser.c: Fix comment typos. + +2004-11-27 Mark Mitchell + + PR c++/18368 + * parser.c (cp_parser_check_for_definition_in_return_type): Take + the defined type as a parameter, and inform the user about the + possibility of a missing semicolon. + (cp_parser_explicit_instantiation): Adjust call to + cp_parser_check_for_definition_in_return_type. + (cp_parser_init_declarator): Likewise. + (cp_parser_member_declaration): Likewise. + + PR c++/18674 + * cp-tree.def (TYPENAME_TYPE): Remove discussion of implicit + typename from comments. + * cp-tree.h (TYPENAME_IS_ENUM_P): New macro. + (TYPENAME_IS_CLASS_P): Likewise. + (make_typename_type): Change prototype. + * decl.c (struct_typename_info): New type. + (typename_compare): Expect the second argument to be a + typename_info, not a tree. + (build_typename_type): Add tag_type parameter. Do not create a + new type until necessary. + (make_typename_type): Add tag_type parameter. + * error.c (TYPENAME_TYPE): Print tags other than "typename" if + appropriate. + * friend.c (make_friend_class): Adjust call to make_typename_type. + * parser.c (cp_parser_make_typename_type): Likewise. + (cp_parser_primary_expression): Adjust call to + cp_parser_lookup_name. + (cp_parser_unqualified_id): Adjust calls to cp_parser_class_name. + (cp_parser_class_or_namespace_name): Likewise. + (cp_parser_postfix_expression): Adjust calls to + make_typename_type. + (cp_parser_mem_initializer_id): Adjust calls to + cp_parser_class_name. + (cp_parser_type_parameter): Adjust calls to cp_parser_lookup_name. + (cp_parser_template_name): Likewise. + (cp_parser_template_argument): Likewise. + (cp_parser_type_name): Adjust call to cp_parser_class_name. + (cp_parser_elaborated_type_specifier): Adjust calls to + make_typename_type and cp_parser_lookup_name. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Replace type_p parameter with tag_type. + Adjust calls to make_typename_type and cp_parser_lookup_name. + (cp_parser_class_head): Adjust calls to cp_parser_class_name. + (cp_parser_base_specifier): Likewise. + (cp_parser_lookup_name): Replace is_type parameter with tag_type. + Adjust calls to make_typename_type and lookup_qualified_name. + (cp_parser_lookup_name_simple): Adjust call to + cp_parser_lookup_name. + (cp_parser_constructor_declarator_p): Adjust call to + cp_parser_class_name. + * pt.c (convert_template_argument): Adjust all to + make_typename_type. + (tsubst_decl): Do not pre-substitute the type of the declaration. + (tsubst): Hand off declarations more quickly. Adjust call to + make_typename_type. + + PR c++/18512 + * parser.c (cp_parser_postfix_dot_deref_expression): Robustify. + +2004-11-29 Daniel Jacobowitz + + PR c/7544 + * Make-lang.in (cp/decl2.o): Update dependencies. + * decl2.c (finish_file): Call maybe_apply_pending_pragma_weaks. + +2004-11-29 Kriang Lerdsuwanakij + + PR c++/18652 + * name-lookup.c (pushtag): Change return type to tree. + * cp-tree.h (pushtag): Adjust declaration. + * decl.c (xref_tag, start_enum): Use return value of pushtag. + * pt.c (push_template_decl_real): Return immediately if + pushdecl_namespace_level returns error_mark_node. + +2004-11-27 Kazu Hirata + + * pt.c: Fix a comment typo. + +2004-11-27 Kriang Lerdsuwanakij + + Friend class name lookup 4/n + * class.c (pushclass): Don't call cxx_remember_type_decls. + * cp-tree.h (clear_anon_tags): Remove declaration. + * decl.c (grokdeclarator): Don't call lookup_tag_reverse. + * name-lookup.c (binding_entry_free, binding_table_free): Comment + out functions. + (binding_table_find_anon_type, binding_table_reverse_maybe_remap, + binding_table_remove_anonymous_types, cxx_remember_type_decls, + bt_print_entry, clear_anon_tags, follow_tag_typedef, lookup_tag, + lookup_tag_reverse): Remove + (begin_scope, leave_scope, kept_level_p, print_binding_level): + Don't use type_decls field in cp_binding_level. + (maybe_process_template_type_declaration, pushtag): Set + CLASSTYPE_NESTED_UTDS directly. + * name-lookup.h (binding_table_remove_anonymous_types, + cxx_remember_type_decls, lookup_tag, lookup_tag_reverse): Remove + declaration. + (cp_binding_level): Remove type_decls field. + +2004-11-26 Kazu Hirata + + * typeck.c: Fix a comment typo. + +2004-11-25 Mark Mitchell + + PR c++/18445 + * class.c (instantiate_type): Treat NON_DEPENDENT_EXPRs with + unknown_type as non matching. Tidy up. + * pt.c (build_non_dependent_expr): Do not build a + NON_DEPENDENT_EXPR for a VAR_DECL. + + PR c++/18001 + * cp-tree.h (lvalue_or_else): Remove declaration. + * tree.c (lvalue_or_else): Remove. + * typeck.c (build_unary_op): Adjust call to lvalue_or_else. + (build_modify_expr): Likewise. + + PR c++/18625 + * decl.c (duplicate_decls): Return error_mark_node on error, as + specified. + + PR c++/18466 + * decl.c (grokvardecl): Keep track of whether or not a there was + explicit qualification. + * name-lookup.c (set_decl_namespace): Complain about explicit + qualification of a name within its own namespace. + + PR c++/18545 + * typeck.c (check_return_expr): Robustify. + +2004-11-25 Kriang Lerdsuwanakij + + Friend class name lookup 3/n, PR c++/3332 + * name-lookup.c (push_inner_scope, pop_inner_scope): New functions. + (lookup_type_scope): Don't deal with name from user declaration + specially. + * name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations. + * parser.c (cp_parser_class_specifier): Use push_inner_scope and + pop_inner_scope. + +2004-11-25 Kriang Lerdsuwanakij + + Friend class name lookup 2/n, PR c++/14513, c++/15410 + * name-lookup.c (lookup_name_real): Simplify. + (lookup_type_scope): Add SCOPE parameter. Handle friend class + lookup. + * name-lookup.h (tag_scope): New enum type. + (lookup_type_scope): Adjust declaration. + * decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type): + Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE. + (start_enum): Likewise. Add assertion test that NAME is + IDENTIFIER_NODE. Use anonymous name for dummy ENUMERAL_TYPE in + case of error. + * cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations. + * parser.c (cp_parser_elaborated_type_specifier, + cp_parser_class_head): Adjust call to xref_tag. + * pt.c (lookup_template_class, instantiate_class_template): + Likewise. + * rtti.c (init_rtti_processing, build_dynamic_cast_1, + tinfo_base_init, emit_support_tinfos): Likewise. + +2004-11-25 Joseph S. Myers + + * g++spec.c, lex.c: Avoid ` as left quote in diagnostics. + +2004-11-24 Mark Mitchell + + PR c++/17473 + * name-lookup.c (supplement_binding): Do not allow typedefs to be + redefined in class scope. + + PR c++/18285 + * parser.c (cp_parser_set_decl_type_spec): Do not try to allow + redefinitions of builtin types other that "bool" or "wchar_t". + +2004-11-24 Steven Bosscher + + * decl.c (cxx_init_decl_processing): Don't clear + flag_inline_functions. + +2004-11-24 Mark Mitchell + + * pt.c (tsubst_function_type): Do not permit function types which + return arrays or functions. + + PR c++/18586 + * parser.c (cp_parser_init_declarator): Do not pop scope twice. + + PR c++/18530 + * cp-tree.h (CTOR_NAME): Remove. + (DTOR_NAME): Remove. + * decl.c (initialize_predefined_identifiers): Add spaces to the + end of constructor and destructor names. + +2004-11-24 Giovanni Bajo + + PR c++/8929 + * decl.c (start_decl): Check for invalid specialization headers. + +2004-11-24 Paolo Bonzini + + PR c++/16882 + + * call.c (standard_conversion): Move check for conversions between + vector pointers... + * typeck.c (ptr_reasonably_similar): ... here. + +2004-11-23 Ben Elliston + + * cp-tree.h (context_as_string): Remove extern. + * error.c (context_as_string): Remove. + + * cp-tree.h (cp_type_qual_from_rid): Remove extern. + * lex.c (cp_type_qual_from_rid): Remove. + + * cp-tree.h (do_poplevel): Remove extern. + (check_multiple_declarators): Likewise. + * semantics.c (do_poplevel): Make static. + (check_multiple_declarators): Remove. + + * cp-tree.h (check_final_overrider): Remove extern. + * search.c (check_final_overrider): Make static. + + * cp-tree.h (build_artificial_parm): Remove extern. + * decl2.c (build_artificial_parm): Make static. + +2004-11-22 Giovanni Bajo + + PR c++/18354 + * typeck.c (build_unary_op) : Unify code. + Make sure the result is always a rvalue. + +2004-11-16 Giovanni Bajo + + * decl.c (start_preparsed_function): Call check_function_type even + in templates. + (require_complete_types_for_parms): Skip dependent types. + (check_function_type): Likewise. + +2004-11-16 Steven Bosscher + + * Make-lang.in (cp/decl.o, cp/search.o): Don't depend on stack.h. + * search.c: Don't include it. + +2004-11-15 Andrew Pinski + + * cp-gimplify.c: Include pointer-set.h + (cp_genericize_r): Use pointer_sets instead of a hashtable. + Also instert the new statement for CLEANUP_STMT. + (cp_genericize): Use pointer_sets instead of a hashtable. + * Make-lang.in (cp-gimplify.o): Depend on pointer-set.h. + +2004-11-15 Kriang Lerdsuwanakij + + Friend class name lookup 1/n, PR c++/18471 + * decl.c (lookup_and_check_tag): New function. + (xref_tag, start_enum): Use it. + (check_elaborated_type_specifier): Move TEMPLATE_TYPE_PARM check + before !DECL_IMPLICIT_TYPEDEF_P. Also display previously declared + location. + * name-lookup.c (lookup_name_current_level): Rename to ... + (lookup_name_innermost_nonclass_level): ... this. + (lookup_type_scope): New function. + * name-lookup.h (lookup_name_current_level): Rename to ... + (lookup_name_innermost_nonclass_level): ... this. + (lookup_type_scope): Add declaration. + +2004-11-14 Kriang Lerdsuwanakij + + PR c++/17344 + * pt.c (coerce_template_parms): Only emit error message about + invalid template argument when TF_ERROR. + +2004-11-12 Mark Mitchell + + PR c++/18389 + * decl.c (start_decl): Make sure to set *pop_scope_p. Return + error_mark_node to indicate errors. + + PR c++/18429 + * parser.c (cp_parser_direct_declarator): Disallow non-constant + array bounds when not inside a function. + + PR c++/18436 + * pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an + unqualified name resolves to a member function. + + PR c++/18407 + * pt.c (tsubst_copy_and_build): Handle qualified names used from a + derived class correctly. + + * decl2.c (import_export_decl): Fix typo in comment. + * tree.c (pod_type_p): Likewise. + +2004-11-10 Andrew Pinski + + * typeck.c (cxx_mark_addressable): Add braces around the first if. + +2004-11-10 Adam Nemet + + PR middle-end/18160 + * typeck.c (cxx_mark_addressable): Issue an error if address of an + explicit register variable is requested. + +2004-11-10 Nathan Sidwell + + PR c++/18143 + * cp-tree.h (NON_THUNK_FUNCTION_CHECK, THUNK_FUNCTION_CHECK): New. + (struct lang_decl_flags): Add thunk_p flag. + (struct lang_decl): Remove separate fixed_offset. Place + cloned_function and fixed_offset into union. + (DECL_CLONED_FUNCTION_P, DECL_CLONED_FUNCTION): Adjust. + (DECL_THUNK_P, SET_DECL_THUNK_P): Adjust. + (THUNK_FIXED_OFFSET): Adjust. + * method.c (make_thunk): Adjust. + +2004-11-09 Mark Mitchell + + PR c++/18369 + * init.c (build_new_1): Handle parenthesized type-ids that name an + array type. Tidy. + +2004-11-09 Joseph S. Myers + + * call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c, + pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for + quoting in diagnostics. + * parser.c (cp_parser_sizeof_operand): Use '' instead of `' for + quoting in printf format. + * decl.c (duplicate_decls, start_decl): Use %qD instead of + unquoted %D. + +2004-11-08 Kazu Hirata + + * class.c, decl.c, lex.c, name-lookup.c, parser.c, pt.c, + search.c, typeck2.c: Fix comment formatting. + +2004-11-04 Ulrich Weigand + + PR tree-optimization/18184 + * cp-objcp-common.c (cxx_types_compatible_p): Do not treat pointers + of different modes or alias-all flags as equivalent. + * typeck.c (comptypes): Likewise. + +2004-11-04 Giovanni Bajo + + DR 49, 100 + * cp-tree.h (TYPE_REF_OBJ_P): New macro. + (TYPE_PTR_P, TYPE_PTROB_P, TYPE_PTROBV_P, TYPE_PTRFN_P, + TYPE_REFFN_P): Document. + (fold_decl_constant_value): New prototype. + * pt.c (convert_nontype_argument_function): Rewrite and extract + parts into... + (fold_decl_constant_value, convert_nontype_argument_function): New. + (lookup_template_class): Add comment about useless double call. + * mangle.c (write_expression): Strip conversions before lowering + pointer to members. + * cvt.c (ocp_convert): Check LOOKUP_COMPLAIN for a pedwarn. Disallow + enum to enum conversion. + +2004-11-02 Mark Mitchell + + PR c++/18124 + * parser.c (cp_parser_type_parameter): Robustify. + + PR c++/18155 + * parser.c (cp_parser_single_declaration): Disallow template + typedefs. + + PR c++/18177 + * typeck.c (build_const_cast): Use error_operand_p. + +2004-11-02 Ziemowit Laski + + * 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 Nathan Sidwell + + PR c++/18064 + * search.c (check_final_overrider): Deprecate gnu covariant extension. + +2004-10-31 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 9/n + * typeck.c (build_x_unary_op, convert_member_func_to_ptr, + get_delta_difference): Use new quotation style. + * repo.c (reopen_repo_file_for_write): Likewise. + * pt.c (do_type_instantiation): Likewise. + * parser.c (cp_parser_diagnose_invalid_type_name): + * name-lookup.c (push_overloaded_decl, set_decl_namespace): + * error.c (cp_print_error_function, + print_instantiation_full_context): Likewise. + * decl.c (define_label, grok_reference_init, + maybe_deduce_size_from_array_init, revert_static_member_fn): + * decl2.c (check_classfn): Likewise. + * class.c (add_method, check_field_decls, layout_class_type, + resolve_address_of_overloaded_function): Likewise. + * call.c (build_x_va_arg, build_over_call): Likewise. + +2004-10-31 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 8/n + * cvt.c (cp_convert_to_pointer, warn_ref_binding, + convert_to_reference, ocp_convert, convert_to_void + cp_convert_to_pointer): Use new quotation style. + +2004-10-31 Mark Mitchell + + PR c++/15172 + * typeck2.c (store_init_value): Use split_nonconstant_init even + for types that require construction. + +1004-10-28 Matt Austern + + PR c++/17542 + * cp-tree.h (class_key_or_enum_as_string): Declare. + * error.c (class_key_or_enum): Rename to class_key_or_enum_as_string + and remove static qualifier. + * decl.c (shadow_tag): Warn about ignored attributes in class/struct/ + union/enum declaration. + +2004-10-29 Kazu Hirata + + * pt.c: Fix a comment typo. + +2004-10-28 Nathan Sidwell + + * typeck.c (composite_pointer_type): Remove comment about DR 195. + (build_reinterpret_cast_1): Revert DR195 patch. Only emit a + warning when being pedantic. + (build_reinterpet_cast, build_c_cast): Adjust. + +2004-10-29 Mark Mitchell + + PR c++/17695 + * decl.c (grokdeclarator): Mark TYPE_DECLs as abstract when they + appear in a constructor/destructor that will be cloned. + +1004-10-28 Matt Austern + + PR c++/14124 + * decl.c (finish_enum): Handle packed attribute. + * parser.c (cp_parser_enum_specifier): Process trailing attributes. + +2004-10-28 Mark Mitchell + + PR c++/17132 + * pt.c (instantiate_class_template): Increment + processing_template_decl when substituting into a member class + template. + +2004-10-27 Mark Mitchell + + PR c++/17435 + * call.c (convert_like_real): Fix formatting. + (initialize_reference): When binding a temporary to a base class, + ensure that the nominal copy made is to the derived class, not the + base class. + + PR c++/18140 + * parser.c (cp_parser_next_token_ends_template_argument_p): Do not + include ">>". + +2004-10-27 Andrew Pinski + + * decl.c (bad_specifiers): Move the q after the %. + +2004-10-27 Andrew Pinski + + * parser.c (cp_parser_diagnose_invalid_type_name): Move the q after + the %. + +2004-10-26 Mark Mitchell + + * name-lookup.c (do_namespace_alias): Use FROB_CONTEXT. + * search.c (current_scope): Fix prototype. + + PR c++/18093 + * search.c (current_scope): Return the innermost non-block scope, + not the innermost non-block, non-namespace scope. + (at_namespace_scope_p): Adjust accordingly. + (dfs_accessible_post): Do not pass namespaces to is_friend. + (dfs_walk_once_accessible_r): Likewise. + * decl.c (grokvardecl): Adjust call to current_scope. + (build_enumerator): Likewise. + * parser.c (cp_parser_using_declaration): Likewise. + (cp_parser_direct_declarator): Use at_namespace_scope_p instead of + current_scope. + (cp_parser_class_head): Adjust call to current_scope. + * name-lookup.c (do_namespace_alias): Set the DECL_CONTEXT for the + alias. + + PR c++/18020 + * pt.c (tusbst_copy_and_build): Resolve enumeration constants to + their underlying values. + + PR c++/18161 + * typeck.c (build_binary_op): Honor build_type, even when in a + template. + +2004-10-26 Nathan Sidwell + + * parser.c (cp_lexer_get_preprocessor_token): Remove unneeded + padding token checking. + +2004-10-25 Andrew Pinski + + PR c++/18121 + * decl.c (grokdeclarator) : Remove the call + layout_type as it is already done by create_array_type_for_decl. + +2004-10-22 Nathan Sidwell + + PR c++/18095 + * parser.c (eof_token): Make const, correctly initialize rid and + location fields. + (struct cp_lexer): Replace buffer_end pointer with buffer_length + count. Adjust. + (cp_lexer_new_main): Directly grow lexer's buffer here. Don't + zero it out. + (cp_lexer_new_from_tokens): Adjust. + (cp_lexer_grow_buffer): Remove. + (cp_lexer_peek_nth_token, cp_lexer_consume_token, + cp_lexer_purge_token): Add const casts. + +2004-10-21 Mark Mitchell + + PR c++/18073 + PR c++/10841 + * cp-tree.h (convert_to_base): Change prototype. + (build_ptrmemfunc): Likewise. + (convert_ptrmem): New function. + * call.c (struct conversion): Adjust documentation for base_p. + (standard_conversion): Set base_p for ck_pmem conversions as + appropriate. + (convert_like_real): Use convert_to_base for ck_pmem and ck_ptr + conversions. + * class.c (convert_to_base): Handle both pointers and objects. + Add nonnull parameter. + (build_vfield_ref): Adjust call to convert_to_base. + * cvt.c (cp_convert_to_pointer): Adjust call to build_ptrmemfunc. + (convert_force): Likewise. + * typeck.c (build_unary_op): Likewise. + (convert_ptrmem): New function. + (build_static_cast_1): Use it. + (build_reinterpret_cast): Allow conversions to vector types. + (get_delta_difference): Add c_cast_p parameter. + (build_ptrmemfunc): Likewise. Adjust calls to + get_delta_difference. + +2004-10-21 Andrew Pinski + + PR c++/13560 + * error.c (cp_error_at): Output the context as it might be + different file as the other location. + +2004-10-21 Kazu Hirata + + * typeck.c: Fix a comment typo. + +2004-10-20 Kriang Lerdsuwanakij + + PR c++/13495 + * decl.c (make_unbound_class_template): Add PARM_LIST parameter. + * cp-tree.h (make_unbound_class_template): Adjust prototype. + * parser.c (cp_parser_lookup_name): Adjust call to + make_unbound_class_template. + (cp_parser_single_declaration): Handle member class of class + template as template friend parsing correctly. + * friend.c (is_friend): Call is_specialization_of_friend for + template friend class. + (make_friend_class): Handle member class of class template as + template friend. + * pt.c (is_specialization_of_friend): Likewise. + (instantiate_class_template): Likewise. + (tsubst): Adjust call to make_unbound_class_template. + +2004-10-20 Nathan Sidwell + + * typeck.c (composite_pointer_type): Add comment about DR 195 + (build_reinterpret_cast_1): Add for_reinterpret_cast_p parameter. + Allow function pointer conversions that DR195 suggests. + (build_reinterpret_cast, build_c_cast): Update + build_reinterpret_cast_1 calls. + +2004-10-20 Kazu Hirata + + * call.c, typeck.c: Fix comment typos. + +2004-10-20 Nathan Sidwell + + * parser.c (cp_token_position): New typedef. Define VEC thereof. + (struct cp_lexer): Allow buffer and buffer_end to be NULL. Make + next_token and last_token cp_token_position. Make saved_tokens a + VEC(cp_token_position). + (eof_token): New static variable. + (CP_SAVED_TOKENS_SIZE): Rename to ... + (CP_SAVED_TOKEN_STACK): ... here. + (cp_lexer_new_main): Adjust main lexer creation and buffer + filling. + (cp_lexer_new_from_tokens): Do not copy the tokens, merely point + to the parent buffer. Do not append eof token. + (cp_lexer_destroy): Only free buffer if non-NULL. Free token + stack. + (cp_lexer_next_token, cp_lexer_prev_token): Remove. + (cp_lexer_token_position, cp_lexer_token_at): New. + (cp_lexer_saving_tokens): Adjust. Make inline. + (cp_lexer_advance_token, cp_lexer_token_difference): Remove. + (cp_lexer_peek_token_emit_debug_info): Fold into ... + (cp_lexer_peek_token): ... here. + (cp_lexer_peek_nth_token): Don't peek past EOF. + (cp_lexer_consume_token): Set next_token to eof_token, if reaching + EOF. + (cp_lexer_purge_token): Adjust eof setting. + (cp_lexer_purge_tokens_after): Likewise. + (cp_lexer_save_tokens): Push next_token directly. + (cp_lexer_commit_tokens): Adjust. + (cp_lexer_rollback_tokens): Pop next_token directly. + (cp_parser_check_for_invalid_template_id): Adjust token purging. + (cp_parser_translation_unit): Do not consume the EOF. + (cp_parser_nested_name_specifier_opt): Adjust token purging. + (cp_parser_template_id, cp_parser_template_name): Likewise. + +2004-10-19 Mark Mitchell + + PR c++/14035 + * call.c (struct conversion): Add base_p. + (convert_like): Add c_cast_p argument. + (convert_like_with_conversion): Likewise. + (build_conv): Clear base_p. + (standard_conversion): Set it, for derived-to-base conversions. + (convert_like_real): Add c_cast_p parameter. Handle pointer + conversions directly rather than relying on ocp_convert. + (perform_direct_initialization_if_possible): Add c_cast_p + parameter. + * cp-tree.h (perform_direct_initialization_if_possible): Change + prototype. + (convert_member_func_to_ptr): New function. + * typeck.c (check_for_casting_away_constness): Add diag_fn + parameter. + (build_static_cast_1): New function, split out from ... + (build_static_cast): ... here. Use build_static_cast_1. + (build_reinterpret_cast_1): New function, split out from ... + (build_reinterpret_cast): ... here. Use build_reinterpret_cast_1. + (build_const_cast_1): New function, split out from ... + (build_const_cast): ... here. Use build_const_cast_1. + (build_c_cast): Rewrite to use build_const_cast_1, + build_static_cast_1, and build_reinterpret_cast_1. + (convert_member_func_to_ptr): New function. + +2004-10-19 Paolo Bonzini + + PR c++/18047 + * parser.c (enum cp_parser_prec): Give relational expressions + a higher precedence than equality expressions. + +2004-10-15 Nathan Sidwell + + * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Adjust lookup_base call. + (ACCESSIBLY_UNIQUELY_DERIVED_P): Remove. + (PUBLICLY_UNIQUELY_DERIVED_P): Adjust lookup_base call. + (enum base_access): Reorganize. + (accessible_base_p, accessible_p): Add consider_local_p parameter. + * call.c (standard_conversion): Update comment about + DERIVED_FROM_P. + (enforce_access): Adjust accessible_p call. + (build_over_call): Adjust accessible_base_p call. + * class.c (convert_to_base): Adjust lookup_base call. + (build_vtbl_ref_1): Likewise. + (warn_about_ambiguous_bases): Likewise. Add early exit. + * cvt.c (convert_to_pointer_force) Adjust lookup_base call. + * search.c (accessible_base_p): Add consider_local_p parameter. + (lookup_base): Pass consider_local_p to accessible_base_p call. + (friend_accessible_p): Check whether scope is a class member. + Remove unnecessary class template check. + (accessible_p): Add consider_local_p parameter. Use it. + (adjust_result_of_qualified_name_lookup): Adjust lookup_base call. + * tree.c (maybe_dummy_object): Likewise. + * typeck.c (comp_except_type): Use PUBLICLY_UNIQUELY_DERIVED_P. + (build_class_member_access_expr): Adjust lookup_base call. + * typeck2.c (binfo_or_else): Likewise. + * rtti.c (build_dynamic_cast_1): Access can consider friendship + and current scope. + +2004-10-17 Giovanni Bajo + + PR c++/17743 + * decl2.c (grokfield): Apply attributes also to TYPE_DECLs. + +2004-10-16 Giovanni Bajo + + PR c++/10479 + * parser.c (cp_parser_parenthesized_expression_list): Fold + non-dependent expressions in attribute lists. + +2004-10-15 Mark Mitchell + + PR c++/17042 + * decl.c (declare_global_var): Use the return value from pushdecl. + + PR c++/14667 + * parser.c (cp_parser_simple_declaration): Do not diagnose invalid + type names if we have already found a valid type. + (cp_parser_member_declaration): Likewise. + + PR c++/17916 + * parser.c (cp_parser_member_specification_opt): Handle + CPP_PRAGMA. + +2004-10-15 Kazu Hirata + + * dump.c, g++spec.c, repo.c: Update copyright. + +2004-10-15 Kazu Hirata + + * decl.c: Fix a comment typo. + +2004-10-13 Andrew Pinski + + PR c++/16301 + * name-lookup.c (parse_using_directive): If we have a + error_mark_node, do not set the decl namespace associations + on it. + +2004-10-14 Mark Mitchell + + PR c++/17976 + * decl.c (cp_finish_decl): Do not call expand_static_init more + than once for a single variable. + +2004-10-14 Matt Austern + + * Make-lang.in (pt.o): depends on pointer-set.h + * cp-tree.h (cp_walk_subtrees): Last argument is pointer_set_t* now. + * pt.c (struct pair_fn_data): Use pointer_set_t, not htab_t + (for_each_template_parm): Convert from htab_t to pointer_set_t. + * tree.c (cp_walk_subtrees): Last argument is pointer_set_t* now. + +2004-10-13 Andrew Pinski + + PR c++/17661 + * semantics.c (finish_for_expr): Convert expression to void + so that we don't create temporaries for a?b:c. + +2004-10-13 Kazu Hirata + + * search.c: Fix a comment typo. + +2004-10-12 Nathan Sidwell + + * class.c (dfs_modify_vtables): Simplify condition. Return + dfs_skip_bases as appropriate. + (modify_all_vtables): Walk in pre-order. + * search.c (dfs_walk_all, dfs_walk_once_r, + dfs_walk_once_accessible_r): Assert post order function never + returns dfs_skip_bases. + + * search.c (struct lookup_base_data_s): New. + (lookup_base_r): Replace with ... + (dfs_lookup_base): ... this. + (lookup_base): Use dfs_walk_all. + +2004-10-12 Kazu Hirata + + * search.c: Fix comment typos. + +2004-10-11 Mark Mitchell + + PR c++/15786 + * parser.c (cp_parser_declarator): Add member_p parameter. + (cp_parser_condition): Adjust calls to cp_parser_declarator. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_direct_declarator): Add member_p parameter. Do not + parse tentatively when parsing the parameters to a member. + (cp_parser_type_id): Adjust calls to cp_parser_declarator. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_exception_declaration): Likewise. + + PR c++/17936 + * cp-tree.h (CLASSTYPE_TEMPLATE_SPECIALIZATION): Add a comment. + * pt.c (optimize_specialization_lookup_p): Do not optimize lookups + for members of partial or explicit specializations. + + PR c++/17929 + * decl2.c (finish_anon_union): Robustify. + +2004-10-11 Nathan Sidwell + + * cp-tree.h (get_dynamic_cast_base_type): Rename to ... + (dcast_base_hint): ... here. + * rtti.c (build_dynamic_cast_1): Use dcast_base_hint. + * search.c (struct dcast_data_s): New. + (dynamic_cast_base_recurse): Remove. Replace with ... + (dfs_dcast_hint_pre, dfs_dcast_base_post): ... these. New. + (get_dynamic_cast_base_type): Rename to ... + (dcast_base_hint): ... here. Use dfs_walk_once_accessible. + (accessible_r): Remove. + (dfs_accessible_post): New, broken out of accessible_r. + (accessible_p): Use dfs_walk_once_accessible. + (dfs_walk_once_accessible_r): New. From accessible_r. + (dfs_walk_once_accessible): New. From acessible_p. + + * cp-tree.h (SAME_BINFO_TYPE_P): New. + * class.c (build_base_path): Use SAME_BINFO_TYPE_P to compare + binfo types. + (convert_to_base_statically, determine_primary_bases, + update_vtable_entry_for_fn, dfs_modify_vtables, build_vtt_inits, + dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group, + accumulate_vtbl_inits, dfs_accumulate_vtbl_inits, + build_vtbl_initializer, add_vcall_offset_vtbl_entries_1): Likewise. + * init.c (expand_member_init): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + binfo_via_virtual, copied_binfo, binfo_for_vbase, + original_binfo): Likewise. + * tree.c (copy_binfo): Likewise. + +2004-10-11 Kazu Hirata + + * semantics.c: Fix comment typos. + +2004-10-10 Andrew Pinski + + PR c++/17554 + part of c++/17657 + middle-end/17703 + * semantics.c (maybe_cleanup_point_expr): Call + fold_build_cleanup_point_expr. + (maybe_cleanup_point_expr_void): New function. + (add_decl_expr): Call maybe_cleanup_point_expr_void. + (finish_expr_stmt): Likewise. + (finish_return_stmt): Likewise. + (finish_for_expr): Likewise. + (finish_asm_stmt): Likewise. + * typeck.c (condition_conversion): Call + fold_build_cleanup_point_expr. + +2004-10-10 Andrew Pinski + + PR c++/17907 + * semantics.c (add_decl_expr): If the decl has a size which + has side effects then the decl expression needs a cleanup point. + +2004-10-10 Mark Mitchell + + PR c++/17393 + * decl.c (grokdeclarator): Robustify error-recovery on invalid + declarations. + +2004-10-10 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 7/n + * typeck.c (composite_pointer_type_r, composite_pointer_type, + cxx_sizeof_or_alignof_type, cxx_sizeof_or_alignof_expr, + string_conv_p, build_class_member_access_expr, + build_class_member_access_expr, lookup_destructor, + finish_class_member_access_expr, build_indirect_ref, + get_member_function_from_ptrfunc, build_function_call, + convert_arguments, build_binary_op, pointer_diff, build_unary_op, + check_for_casting_away_constness, build_static_cast, + build_reinterpret_cast, build_const_cast, build_c_cast, + build_modify_expr, get_delta_difference, build_ptrmemfunc, + dubious_conversion_warnings, convert_for_assignment, + convert_for_initialization, + maybe_warn_about_returning_address_of_local, check_return_expr): + Use quoting marks. + + * typeck2.c (error_not_base_type, readonly_error, + abstract_virtuals_error, cxx_incomplete_type_diagnostic, + store_init_value, digest_init, build_x_arrow, + build_m_component_ref, require_complete_eh_spec_types): Likewise. + + * tree.c (cp_build_qualified_type_real, + handle_java_interface_attribute, handle_init_priority_attribute): + Likewise. + + * semantics.c (finish_asm_stmt, finish_non_static_data_member, + finish_pseudo_destructor_expr, + check_template_template_default_arg, begin_class_definition, + finish_base_specifier, qualified_name_lookup_error, + finish_id_expression, finish_typeof): Likewise. + + * search.c (lookup_base, check_final_overrider, + look_for_overrides_r): Likewise. + + * rtti.c (get_tinfo_decl, build_dynamic_cast_1): Likewise. + +2004-10-09 Mark Mitchell + + PR c++/17867 + * error.c (dump_expr): Correct handling of AGGR_INIT_EXPRs using a + constructor. + + PR c++/17670 + * init.c (build_new): Correct comments. + * parser.c (cp_parser_new_expression): Use NULL_TREE for nelts in + the non-array case. + + PR c++/17821 + * parser.c (cp_parser_postfix_dot_deref_expression): If the + pseduo-destructor-name production does not work, fall back to the + ordinary production. + + PR c++/17826 + * tree.c (cp_tree_equal): Handle a BASELINK. + + PR c++/17524 + * cp-tree.h (check_var_type): New function. + * decl.c (check_var_type): New function, split out from ... + (grokdeclarator): ... here. + * pt.c (tsubst_decl): Use check_var_type. + + PR c++/17685 + * decl.c (grokdeclarator): Disallow declarations of operators as + non-functions. + +2004-10-08 Volker Reichelt + + PR c++/17868 + * error.c (dump_expr): Add missing case for RDIV_EXPR. + +2004-10-08 Kazu Hirata + + * pt.c, search.c: Fix comment typos. + +2004-10-08 Nathan Sidwell + + * cp-tree.h (dfs_walk, dfs_walk_real, dfs_unmark, markedp, + unmarkedp): Remove. + (dfs_skip_bases, dfs_walk_all, dfs_walk_once): New. + * class.c (struct find_final_overrider_data): Remove most_derived, + vpath_list and vpath fields. Add path field. + (dfs_find_final_ocerrider_1): Add DEPTH parameter. Adjust. + (dfs_find_final_overrider): Rename to ... + (dfs_find_final_overrider_pre): ... here. Adjust. + (dfs_find_final_overrider_post): Adjust. + (dfs_find_final_overrider_q): Fold into + dfs_find_final_overrider_pre. + (find_final_overrider): Adjust dfs searching. + (dfs_modify_vtables): Don't mark binfo here. + (modify_all_vtables): Use dfs_walk_once. + (build_vtt_inits): Likwise. Use dfs_walk_all. + (dfs_build_secondary_vptr_vtt_inits): Don't mark binfo here. + Return dfs_skip_bases as appropriate. + (dfs_fixup_binfo_vtbls): Return dfs_skip_bases as appropriate. + * init.c (dfs_initialized_vtbl_ptrs): Return dfs_skip_bases as + appropriate. Don't mark binfo here. + (initialize_vtbl_ptrs): Use dfs_walk_once. + * search.c (struct vbase_info): Remove unused struct. + (access_in_type): Use dfs_walk_once. + (dfs_access_in_type): Don't mark binfo here. + (dfs_accessible_queue_p, dfs_accessible_p) Remove. + Fold into ... + (accessible_r): ... here. New. Specialize dfs_walk_once. + (accessible_p): Use accessible_r. + (lookup_field_queue_p): Remove. Fold into ... + (lookup_field_r): ... here. Adjust. + (lookup_member): Use dfs_walk_all. + (dfs_walk_real, dfs_walk): Replace with ... + (dfs_walk_all, dfs_walk_once): ... these. + (dfs_walk_once_r, dfs_unmark_r): Workers for dfs_walk_once. + (dfs_unmark, unmarkedp, markedp): Remove. + (dfs_get_pure_virtuals): Don't mark binfo here. + (get_pure_virtuals): Use dfs_walk_once. + (dfs_debug_unmarked_p): Remove. Fold into ... + (dfs_debug_mark): ... here. + (note_debug_info_needed): Use dfs_walk_all. + +2004-10-07 Andrew Pinski + + * pt.c (tsubst_expr) : Look passed the + CLEANUP_POINT_EXPR to get the asm expression. + +2004-10-07 Mark Mitchell + + * cp-tree.h (ICS_USER_FLAG): Remove comment about obsolete flag. + (DECL_MEMBER_TEMPLATE_P): New macro. + (is_member_template): Remove. + (class_method_index_for_fn): New function. + * pt.c (build_over_call): Use DECL_MEMBER_TEMPLATE_P. + * class.c (finish_struct_methods): Remove out-of-date comment. + * decl.c (copy_fn_p): Use DECL_MBMER_TEMPLATE_P. + * decl2.c (check_classfn): Use DECL_MEMBER_TEMPLATE_P and + class_method_index_for_fn. + * pt.c (is_member_template): Remove. + (is_member_template_class): Likewise. + (optimize_specialization_lookup_p): New function. + (retrieve_specialization): Optimize lookups for members that are + not member templates. + (register_specialization): Adjust accordingly. + (build_template_decl): Add member_template_p parameter. Set + DECL_MEMBER_TEMPLATE_P. + (process_partial_specialization): Adjust call to + retrieve_specialization. + (push_template_decl_real): Determine whether the template is a + member template. + (lookup_template_class): Use retrieve_specialization. + (tsubst_decl): Adjust call to retrieve_specialization. + (tsubst_exception_specification): New function. + (tsubst): Use it. + (tsubst_copy): Use DECL_MEMBER_TEMPLATE_P. + (instantiate_template): Adjust call to retrieve_specialization. + (regenerate_decl_from_template): Do not actually generate a new + DECL. + (instantiate_decl): Adjust call to retrieve_specialization. + (class_method_index_for_fn): New method. + +2004-10-07 Andrew Pinski + + * parser.c (cp_parser_asm_definition): Look passed the + CLEANUP_POINT_EXPR to get the asm expression. + +2004-10-06 Andrew Pinski + + PR c++/17368 + * semantics.c (finish_asm_stmt): Asm expressions need cleanup + also. + +2004-10-05 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 6/n + * pt.c (finish_member_template_decl, check_specialization_scope, + maybe_process_partial_specialization, determine_specialization, + check_explicit_specialization, maybe_check_template_type, + process_partial_specialization, check_default_tmpl_args, + push_template_decl_real, redeclare_class_template, + convert_nontype_argument, coerce_template_parms, + lookup_template_class, push_tinst_level, + instantiate_class_template, tsubst_arg_types, + tsubst_function_type, tsubst, tsubst_qualified_id, + tsubst_copy_and_build, check_instantiated_args, + do_decl_instantiation, do_type_instantiation, + invalid_nontype_parm_type_p, check_specialization_namespace, + convert_template_argument, determine_specialization, + check_template_shadow, tsubst_decl + instantiate_pending_templates): Use quoting marks. + +2004-10-05 Nathan Sidwell + + PR c++/17829 + * parser.c (cp_parser_postfix_expression): Inhibit Koenig when + unqualified lookup finds a member function. + +2004-10-04 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 5/n + * parser.c (cp_parser_name_lookup_error, + cp_parser_diagnose_invalid_type_name, + cp_parser_primary_expression, cp_parser_unqualified_id, + cp_parser_nested_name_specifier_opt, cp_parser_labeled_statement, + cp_parser_jump_statement, cp_parser_simple_declaration, + cp_parser_decl_specifier_seq, cp_parser_mem_initializer_id, + cp_parser_type_parameter, cp_parser_template_id, + cp_parser_template_name, cp_parser_direct_declarator, + cp_parser_parameter_declaration_list, cp_parser_class_head, + cp_parser_base_specifier, cp_parser_lookup_name, + cp_parser_late_parsing_default_args, + cp_parser_optional_template_keyword + cp_parser_elaborated_type_specifier, cp_parser_check_class_key, + cp_parser_check_access_in_redeclaration): Use quoting marks. + + * name-lookup.c (supplement_binding, pushdecl, + check_for_out_of_scope_variable, validate_nonmember_using_decl, + do_nonmember_using_decl, lookup_tag, set_decl_namespace, + push_namespace, do_namespace_alias, do_using_directive, + ambiguous_decl, lookup_namespace_name, add_function): Likewise. + + * method.c (use_thunk): Likewise. + + * lex.c (unqualified_name_lookup_error, + unqualified_fn_lookup_error): Likewise. + +2004-10-04 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 4/n + * except.c (decl_is_java_type, build_throw, + is_admissible_throw_operand, check_handlers_1, check_handlers): + Use quoting formats. + * friend.c (add_friend, make_friend_class, do_friend): Likewise. + * init.c (sort_mem_initializers, emit_mem_initializers, + member_init_ok_or_else, expand_member_init, is_aggr_type, + build_offset_ref, build_java_class_ref): Likewise. + +2004-10-03 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 3/n + * decl.c (pop_label, duplicate_decls, redeclaration_error_message, + redeclaration_error_message, lookup_label, check_goto, + make_typename_type, make_unbound_class_template, + fixup_anonymous_aggr, check_tag_decl, start_decl, start_decl_1, + grok_reference_init, layout_var_decl, maybe_commonize_var, + check_for_uninitialized_const_var, reshape_init_array, + reshape_init, check_initializer, cp_finish_decl, + member_function_or_else, bad_specifiers, grokfndecl, grokvardecl, + check_static_variable_definition, compute_array_index_type, + create_array_type_for_decl, check_special_function_return_type, + grokdeclarator, check_default_argument, grokparms, + grok_ctor_properties, grok_op_properties, + check_elaborated_type_specifier, xref_tag, finish_enum, + build_enumerator, check_function_type, start_preparsed_function, + store_parm_decls): Use quoting formats. + * decl2.c (grok_array_decl, delete_sanity, check_member_template, + check_java_method, check_classfn, finish_static_data_member_decl, + grokfield, grokbitfield, grok_function_init, + build_anon_union_vars, coerce_new_type, coerce_delete_type, + check_default_args): Likewise. + * parser.c (cp_parser_decl_specifier_seq): Likewise. + +2004-10-03 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 2/n + * class.c (build_base_path, add_method, alter_access, + handle_using_decl, check_bases, + maybe_warn_about_overly_private_class, find_final_overrider, + warn_hidden, finish_struct_anon, add_implicitly_declared_members, + check_bitfield_decl, check_field_decls, layout_empty_base, + build_base_field, check_methods, layout_virtual_bases, + warn_about_ambiguous_bases, layout_class_type, finish_struct_1, + resolve_address_of_overloaded_function, instantiate_type, + note_name_declared_in_class): Use format flag "q" for quoting. + +2004-10-03 Gabriel Dos Reis + + Convert diagnostics to use quoting flag q 1/n + * error.c (locate_error): Ignore quoting flag q. + * call.c (build_user_type_conversion_1, build_operator_new_call, + build_object_call, op_error, build_conditional_expr, + build_new_op, build_op_delete_call, enforce_access, + convert_like_real, convert_arg_to_ellipsis, build_x_va_arg, + convert_default_arg, build_over_call, build_new_method_call, + joust, perform_implicit_conversion, initialize_reference): Use the + quoting flag q. + +2004-10-03 Andrew Pinski + + PR c++/17797 + * typeck.c (build_reinterpret_cast): Return if the inner type + is error_mark_node. + +2004-10-01 Jan Hubicka + + * semantics.c (expand_body): Update call of tree_rest_of_compilation. + +2004-09-30 Nathan Sidwell + + * cp-tree.h (struct lang_decl): Shrink by reordering fields and + turning operator_code and fixed_offset into bitfields. + +2004-09-29 Joseph S. Myers + + * decl.c (duplicate_decls): Merge TREE_DEPRECATED. + +2004-09-29 Jason Merrill + + PR tree-optimization/17697 + * decl.c (duplicate_decls): Copy TREE_NOTHROW from newdecl to olddecl. + +2004-09-28 Jason Merrill + + PR middle-end/17525 + * class.c (build_base_field): Set TYPE_MODE. + +2004-09-28 Roger Sayle + + PR driver/17537 + * g++spec.c (lang_specific_driver): Unrecognized libraries, other + than -lc and -lm, may require linking against libstc++. + +2004-09-28 Kazu Hirata + + * tree.c: Fix a comment typo. + +2004-09-28 Nathan Sidwell + + * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): Remove. + (struct secondary_vptr_vtt_init_data_s): New. + (build_vtt_inits): Adjust dfs_walkers. + (dfs_build_secondary_vptr_vtt_inits): Caller data is a + secondary_vptr_vtt_init_data_s structure. Adjust. + (dfs_ctor_vtable_bases_queue_p): Remove. + (dfs_fixup_binfo_vtbls): No need to clear BINFO_MARKED. Simplify. + + * pt.c (struct get_template_base_data_s): Remove. + (get_template_base_r): Fold into get_template_base. + (get_template_base): Walk base binfos directly in inheritance + graph order. + +2004-09-27 Mark Mitchell + + PR c++/17642 + * cp-tree.h (fold_if_not_in_template): New function. + * call.c (build_conditional_expr): Use fold_if_not_in_template. + (build_cxx_call): Likewise. + * cvt.c (convert_to_complex): Likewise. + (ocp_convert): Likewise. + (convert): Likewise. + (convert_force): Likewise. + * decl.c (compute_array_index_type): Clear + processing_template_decl while folding array bounds. + * pt.c (convert_nontype_argument): Clear + processing_template_decl while processing non-type argument + initialization. + * tree.c (fold_if_not_in_template): New function. + * typeck.c (build_class_member_access_expr): Use + fold_if_not_in_template. + (build_array_ref): Likewise. + (build_binary_op): Likewise. Do not try to optimize computations + when processing templates. + (cp_pointer_int_sum): Use fold_if_not_in_template. + (pointer_diff): Likewise. + (build_unary_op): Likewise. + (build_reinterpret_cast): Likewise. + (get_delta_difference): Likewise. + (expand_ptrmemfunc_cst): Likewise. + (dubious_conversion_warnings): Likewise. + +2004-09-27 Matt Austern + + * cp/parser.c (struct cp_token): New one-bit field , implicit_extern_c + (cp_lexer_get_preprocessor_token): Set implicit_extern_c for + tokens that come from headers that are implicitly extern "C". + (struct cp_parser): new one-bit field, implicit_extern_c. + (cp_parser_new): Set parser's implicit_extern_c to false. + (cp_parser_translation_unit): Pop lang context if we were in a + header that was implicitly extern "C". + (cp_parser_declaration_seq_opt): Push/pop lang context as + required by the token's and parser's implicit_extern_c. + +2004-09-27 Mark Mitchell + + PR c++/17585 + * cp-tree.h (shared_member_p): Declare. + * search.c (shared_member_p): Give it external linkage. + * semantics.c (finish_qualified_id_expr): Use it. + (finish_id_expression): Likewise. + + PR c++/17585 + * semantics.c (finish_id_expression): Do not add "this->" to + static member functions. + +2004-09-27 Nathan Sidwell + + PR c++/17681 + * error.c (dump_type): Change TREE_VEC case into TREE_BINFO. + + * class.c (struct count_depth_data): Remove. + (dfs_depth_post, dfs_depth_q): Remove. + (find_final_overrider): Use number of vbase classes as depth + bound. + + * cp-tree.h (types_overlap_p): Remove. + * search.c (struct overlap_info): Remove. + (dfs_check_overlap, dfs_no_overlap_yet, types_overlap_p): Remove. + + * pt.c (GTB_VIA_VIRTUAL, GTB_IGNORE_TYPE): Remove. + (get_template_base_recursive): Remove. Replace with ... + (get_template_base_r): ... this. + (struct get_template_base_data_s): New. + (get_template_base): Use get_template_base_r via dfs_walk. Always + return NULL on failure. + (unify): Remove error_mark_node check from get_template_base result. + +2004-09-24 Paolo Bonzini + + * parser.c (cp_parser_expression_stack): Clarify why it is + an array of NUM_PREC_VALUES elements. + (cp_parser_binary_expression): Clarify why we do not need to + handle stack overflow. + +2004-09-24 Nathan Sidwell + + PR c++/16889 + * search.c (lookup_field_queue_p): Correct check for hidden base. + + * search.c (bfs_walk): Remove. + (lookup_member): Use dfs_walk_real. + (dfs_walk_real): Move and adjust documentation from bfs_walk. + +2004-09-23 Zack Weinberg + + * decl.c (grokfndecl): If ::main is found not to return int, + correct it after issuing a diagnostic. + (grokdeclarator): If the incoming type was error_mark_node, do + not complain about declaring something with no type. + (start_function): Change check for ::main not returning int to + an assertion, as grokfndecl now catches this when the user did it. + * init.c (perform_member_init, sort_mem_initializers) + (emit_mem_initializers): Make most diagnostics be issued on + the line of current_function_decl, not whatever the current + input line is. + * parser.c (cp_lexer_peek_token_emit_debug_info): Surround + definition and declaration with #ifdef ENABLE_CHECKING. + Avoid unnecessary use of fprintf. + (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub + definitions to avoid warnings. + (cp_lexer_new_main): Add assertion that first token is not a + padding token. + (cp_lexer_new_from_token_array): Fold into ... + (cp_lexer_new_from_tokens): ... here. Add assertion that + first token is not a padding token. + (cp_lexer_set_source_position_from_token): Move nearer to callers. + Remove unused lexer argument. + (cp_lexer_peek_token): Just print debugging report (if enabled) + and return lexer->next_token. + (cp_lexer_skip_purged_tokens): Delete. + (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make + inline, simplify bodies. + (cp_lexer_peek_nth_token): Add debugging report a la + cp_lexer_peek_token. + (cp_lexer_consume_token): Correct commentary. Advance over + purged tokens here. Set current source position here, from + token to be returned. Avoid unnecessary use of fprintf. + (cp_lexer_purge_token): Advance next_token pointer over this and + subsequent purged tokens. + (cp_parser_error): Adjust source position to that of the + peeked token. + (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions. + (cp_parser_string_literal): Remove some excessive cleverness. + (cp_parser_enum_specifier): Call start_enum before consuming + the opening brace. + (cp_parser_member_declaration): Make the "extra semicolon" + diagnostic consistently-worded with the other place this is + diagnosed. Explicitly set the diagnostic location to the + location of the offending semicolon. + (cp_parser_enclosed_template_argument_list): Use % quoting + in diagnostics. Do not use cp_parser_require. Set location + of diagnostics about improper use of '>>' to location of + offending token. + (cp_parser_late_parsing_for_member): + Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer. + (cp_parser_late_parsing_default_args): Likewise. Manually + move some logic outside the loop. + +2004-09-23 Andrew Pinski + + PR c++/17618 + * cvt.c (cp_convert_to_pointer): Return early when the type is + an error_mark_node. + +2004-09-21 Fariborz Jahanian + + PR c++/13989 + PR c++/9844 + * decl.c (grokfndecl): Add new argument "attrlist", use it + to call cplus_decl_attributes. + (start_function): Remove call to cplus_decl_attributes. + * cvt.c (ocp_convert): Add support to use type conversion + function to vector type. + * parser.c (cp_parser_conversion_type_id): Add attributes, if any, + to the parsed type. + +2004-09-23 Paolo Bonzini + + PR c++/17596 + + * parser.c (cp_parser_token_tree_map_node, + cp_parser_pm_expression, cp_parser_additive_expression, + cp_parser_multiplicative_expression, cp_parser_shift_expression, + cp_parser_relational_expression, cp_parser_equality_expression, + cp_parser_and_expression, cp_parser_exclusive_or_expression, + cp_parser_inclusive_or_expression, + cp_parser_logical_and_expression, + cp_parser_logical_or_expression): Removed. + (enum cp_parser_prec, struct cp_parser_token_tree_map_node, + binops, binops_by_token): New. + (cp_parser_assignment_expression): Use cp_parser_binary_expression. + (cp_parser_new): Initialize binops_by_token. + (cp_parser_binary_expression): Rewritten. + (N_CP_TTYPES): New. + +2004-09-23 Kazu Hirata + + * parser.c: Fix a comment typo. + +2004-09-23 Nathan Sidwell + + PR c++/17620 + * decl.c (xref_basetypes): Look through typedefs before checking + for duplicate base. + +2004-09-22 Nathan Sidwell + + * cp-tree.h (unemitted_tinfo_decls): Make a VEC(tree). + * decl2.c (cp_finish_file): Adjust tinfo decl emission loop. + * rtti.c (unemitted_tinfo_decls): Make a VEC(tree). + (init_rtti_processing): Initialize it to something realistic. + (get_tinfo_decl): Adjust pushing the new decl. + + * cp-tree.h (struct lang_type_class): Remove marked flags, add + diamond_shaped and repeated_base flags. Reorder to keep 8-bit blocks. + (TYPE_MARKED_P): New. + (CLASSTYPE_DIAMOND_SHAPED_P, CLASSTYPE_REPEATED_BASE_P): New. + (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N, + CLEAR_CLASSTYPE_MARKED_N): Remove. + (CLASSTYPE_MARKED_*, SET_CLASSTYPE_MARKED_*, + CLEAR_CLASSTYPE_MARKED_*): Remove. + * decl.c (xref_basetypes): Use TYPE_MARKED_P. Determine diamond + shaped and repeated base properties. + * lex.c (cxx_make_type): Don't clear TYPE_ALIAS_SET. + * rtti.c (dfs_class_hint_mark, dfs_class_hint_unmark, + class_hint_flags): Remove. + (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and + CLASSTYPE_DIAMOND_SHAPED_P. + +2004-09-21 Ziemowit Laski + + * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from + cp-objcp-common.h. + (objcp_tsubst_copy_and_build): Reformat function signature. + * cp-objcp-common.h (objcp_tsubst_copy_and_build): Likewise. + (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved to cp-lang.c. + +2004-09-21 Zack Weinberg + + * parser.c (cp_lexer_peek_token, cp_lexer_consume_token): + Don't handle CPP_PRAGMA tokens specially. + (cp_lexer_handle_pragma): Use cp_lexer_consume_token. Don't + purge the token; do clear token->value after processing. Add + assertion at beginning that token->value is nonzero. + (cp_parser_statement, cp_parser_declaration_seq_opt): Handle + CPP_PRAGMA as a full statement or declaration in its own right. + +2004-09-21 Matt Austern + + PR c++/15049 + * decl.c (grokvardecl): Accept declarations of global variables + using anonymous types. + +2004-09-21 Roger Sayle + + PR c++/7503 + * tree.c (lvalue_p_1): Disallow MIN_EXPR and MAX_EXPR as lvalues + if either operand has side-effects. + * typeck.c (rationalize_conditional_expr): Assert that neither + operand of MIN_EXPR or MAX_EXPR has side-effects. + (build_modify_expr): Add support for MIN_EXPR and MAX_EXPR. + Check that the "lhs" is a valid lvalue, i.e. that neither operand + of a MIN_EXPR or MAX_EXPR has a side-effect. + +2004-09-21 Nathan Sidwell + + * cp-tree.h (struct lang_type_header): Remove + uses_multiple_inheritance field. + (TYPE_USES_MULTIPLE_INHERITANCE): Remove. + (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): Remove. + (TYPE_USES_VIRTUAL_BASECLASSES): Remove. + (DECL_NEEDS_VTT_PARM_P): Use CLASSTYPE_VBASECLASSES. + (TYPE_CONTAINS_VPTR_P): Likewise. + * call.c (add_template_candidate_real): Use + CLASSTYPE_VBASECLASSES. + (build_special_member_call): Likewise. + * class.c (finish_struct_bits): Remove + TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P & TYPE_USES_VIRTUAL_BASECLASSES + bookkeeping. + (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P. + (create_vtable_ptr): Remove TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P + bookkeeping. + (build_vtt_inits): Use CLASSTYPE_VBASECLASSES. + (accumulate_vtbl_inits, build_vbase_offset_vtbl_entries): + Likewise. + * decl.c (xref_basetypes): Remove TYPE_USES_MULTIPLE_INHERITANCE, + TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES + bookkeeping. + (cxx_maybe_build_cleanup): Use CLASSTYPE_VBASECLASSES. + * decl2.c (maybe_retrofit_in_chrg): Likewise. + * init.c (expand_member, push_base_cleanups): Likewise. + * pt.c (instantiate_class_template): Remove + TYPE_USES_MULTIPLE_INHERITANCE, + TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, TYPE_USES_VIRTUAL_BASECLASSES + bookkeeping. + * ptree.c (cxx_print_type): Remove TYPE_USES_MULTIPLE_INHERITANCE + check. + * typeck2.c (process_init_constructor): Replace some sorrys with + asserts. + +2004-09-21 Andreas Tobler + + * decl.c (reshape_init_array): Initialize max_index_cst to fix + bootstrap failure. + +2004-09-20 Mark Mitchell + + PR c++/17530 + * pt.c (tsubst): Fix parentheses to accomodate emacs. + (tsubst_baselink): If we get a single function, mark it as used. + +2004-09-20 Matt Austern + Zack Weinberg + + * decl.c (make_rtl_for_nonlocal_decl, start_preparsed_function): + Apply lbasename to input_filename before passing to get_fileinfo. + * semantics.c (begin_class_definition): Likewise. + * lex.c (handle_pragma_interface): Apply get_fileinfo to the + correct filename. Rename variables to be less confusing. + (handle_pragma_implementation): Likewise. Disable "appears + after file is included" diagnostic. + + * parser.c (struct cp_token): Add in_system_header fiag. + (CP_TOKEN_BLOCK_NUM_TOKENS, struct cp_token_block) + (CP_TOKEN_BUFFER_SIZE, cp_token_cache_push_token) + (CPP_NONE, cp_lexer_read_token): Delete. + (struct cp_lexer): Remove first_token, string_tokens, + main_lexer_p fields. Clarify comments. + (struct cp_token_cache): Now just a pair of pointers. + (CP_LEXER_BUFFER_SIZE): New #define. + (CPP_PURGED): New fake token type. + (cp_lexer_new_from_token_array, cp_lexer_destroy) + (cp_lexer_peek_token_emit_debug_info, cp_lexer_skip_purged_tokens) + (cp_lexer_handle_pragma, cp_token_cache_new, cp_parser_string_literal): + New functions. + (cp_lexer_new_from_tokens): Now a simple wrapper around + cp_lexer_new_from_token_array. + (cp_lexer_set_source_position_from_token): Also update + in_system_header. + (cp_lexer_next_token, cp_lexer_prev_token, cp_lexer_advance_token): + Don't wrap round. + (cp_lexer_token_difference): Dont handle wrapping round. + (cp_lexer_new_main): Enable pragma deferral and raw strings, + read the entire translation unit through c_lex_with_flags into + this lexer's buffer, then turn raw strings back off again. + (cp_lexer_grow_buffer): Adjust for buffer no longer being circular. + (cp_lexer_get_preprocessor_token): No need to handle not being + the main lexer. Set token->in_system_header too. + (cp_lexer_peek_token): Skip purged tokens. Feed pragma tokens + to cp_lexer_handle_pragma. No need to call cp_lexer_read_token. + (cp_lexer_peek_nth_token): Likewise. + (cp_lexer_purge_token): Mark the token PURGED, don't shift all + the other tokens down. + (cp_lexer_purge_tokens_after): Likewise. + (cp_lexer_save_tokens, cp_lexer_rollback_tokens): Don't worry + about there being no tokens. + (cp_lexer_print_token): Revise to give useful information on + all tokens. + (struct cp_parser): Add field translate_strings_p. + (cp_parser_new): Initialize it. + (cp_parser_translation_unit): Destroy the lexer when done. + (cp_parser_parameter_declaration): Restructure saving of + default arguments. + (cp_parser_save_member_function_body): Likewise. + (cp_parser_check_for_invalid_template_id) + (cp_parser_nested_name_specifier_opt, cp_parser_template_id): + Adjust calls to cp_lexer_advance_token. + (cp_parser_skip_to_closing_parenthesis, cp_parser_declaration): + No need to fiddle c_lex_string_translate. + (cp_parser_primary_expression, cp_parser_linkage_specification) + (cp_parser_asm_definition, cp_parser_asm_specification_opt) + (cp_parser_asm_operand_list, cp_parser_asm_clobber_list) + Use cp_parser_string_literal. + (cp_parser_attribute_list): Save and restore + parser->translate_strings_p, not c_lex_string_translate. + (cp_parser_cache_group): Delete. + (cp_parser_cache_group_1): Rename cp_parser_cache_group. Do + not take a cache argument. + +2004-09-20 Giovanni Bajo + + PR c++/14179 + * decl.c (reshape_init): Extract array handling into... + (reshape_init_array): New function. Use integers instead of trees + for indices. Handle out-of-range designated initializers. + +2004-09-20 Steven Bosscher + + * lex.c (cxx_init): Don't set the ridpointer for RID_NULL + to null_node. + +2004-09-19 Mark Mitchell + + * decl2.c (determine_visibility): Allow class visibility + directives to override targetm.cxx.export_class_data. + +2004-09-18 Kazu Hirata + + * call.c, semantics.c: Follow spelling conventions. + * class.c: Fix a comment typo. + +2004-09-16 Geoffrey Keating + + PR pch/13361 + * cp/lex.c (handle_pragma_interface): Duplicate string from tree. + (handle_pragma_implementation): Likewise. + +2004-09-17 Jeffrey D. Oldham + Zack Weinberg + + * cp-tree.def: Use tree_code_class enumeration constants + instead of code letters. + * call.c, class.c, cp-gimplify.c, cp-lang.c, cxx-pretty-print.c + * mangle.c, pt.c, semantics.c, tree.c, typeck.c: + Update for new tree-class enumeration constants. + +2004-09-16 Mark Mitchell + + PR c++/16002 + * parser.c (cp_parser_simple_declaration): Commit to tentative + parses after seeing a decl-specifier. + (cp_parser_simple_declaration): Eliminate spurious message. + (cp_parser_init_declarator): Adjust error message. + + PR c++/16029 + * lex.c (unqualified_name_lookup_error): Mark the dummy + declaration as used. + + PR c++/17501 + * parser.c (cp_parser_nested_name_specifier): Do not resolve + typename types if the user explicitly said "typename". + +2004-09-16 Andrew MacLeod + + * error.c (dump_decl): Make sure there is lang_specific info before + checking for DTOR and CTOR decls. + +2004-09-16 Nathan Sidwell + + * class.c (copy_virtuals): Remove. + (build_primary_vtable): Use copy_list directly. + (build_secondary_vtable): Likewise. + (update_vtable_entry_for_fn): Clear BV_CALL_INDEX here. + (create_vtable_ptr): Likewise. + +2004-09-16 Kazu Hirata + + * search.c: Follow spelling conventions. + +2004-09-16 Nathan Sidwell + + * cp-tree.h (struct lang_type_class): Make pure_virtuals a + VEC(tree). + (CLASSTYPE_INLINE_FRIENDS, CLASSTYPE_PURE_VIRTUALS): Update + comments. + * call.c (build_new_method_call): Don't confirm a pure virtual is + in CLASSTYPE_PURE_VIRTUALS. Reorder checks. Make it a warning. + * class.c (check_methods): CLASSTYPE_INLINE_FRIENDS is a VEC(tree). + (fixup_inline_methods, finish_struct): Likewise. + * decl.c (finish_method): Likewise. + * search.c (dfs_get_pure_virtuals, get_pure_virtuals): + CLASSTYPE_PURE_VIRTUALS is a VEC(tree). + * typeck2.c (abstract_virtuals_error): Likewise. Truncate the + vector to avoid repeating the list in error messages. + +2004-09-15 Mark Mitchell + + * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Define. + * cp-tree.h (cxx_comdat_group): Declare. + * decl.c (cxx_comdat_group): New function. + +2004-09-15 Nathan Sidwell + + * search.c (get_pure_virtuals): Remove unused variables. + + * cp-tree.h (struct lang_decl_flags): Remove + needs_final_overrider. + (DECL_NEEDS_FINAL_OVERRIDER_P): Remove. + * decl.c (duplicate_decls): Do not copy DECL_NEEDS_FINAL_OVERRIDER_P. + * class.c (finish_struct_bits): Correct comment about + CLASSTYPE_PURE_VIRTUALS. + * search.c (get_pure_virtuals): Remove useless loop. + +2004-09-14 Mark Mitchell + + PR c++/17324 + * mangle.c (partially_mangled_name): New variable. + (partially_mangled_name_len): Likewise. + (save_partially_mangled_name): New function. + (restore_partially_mangled_name): Likewise. + (write_encoding): Save and restore partially mangled names around + calls to get_mostly_instantiated_function_type. + (write_unqualified_name): Likewise. + +2004-09-14 Nathan Sidwell + + * pt.c (unify): Replace gcc_unreachable with gcc_assert. + +2004-09-13 Mark Mitchell + + PR c++/16162 + * parser.c (cp_parser_id_expression): Correct value for + is_declarator. + (cp_parser_nested_name_specifier_opt): Look through typenames as + necessary. + (cp_parser_template_name): Honor check_dependency_p. + + PR c++/16716 + * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): + Robustify. + + PR c++/17327 + * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with + gcc_unreacable. + +2004-09-12 Richard Henderson + + PR c++/16254 + * semantics.c (maybe_cleanup_point_expr): Don't call fold. + * typeck.c (condition_conversion): Likewise. + +2004-09-11 Richard Henderson + + PR c++/17404 + * pt.c (cur_stmt_expr): Move from tsubst_expr. + (tsubst_expr) : Move ... + (tsubst_copy_and_build): ... here. + +2004-09-10 Zack Weinberg + + * cp-tree.h (interface_only, interface_unknown): Delete declarations; + comment explaining them moved to c-common.h. + * lex.c (interface_only, interface_unknown, extract_interface_info): + Delete definitions. + (cxx_finish): Don't reset interface_unknown. + (handle_pragma_interface): Don't set interface_only and + interface_unknown; just the like-named fields in finfo. + (handle_pragma_implementation): Adjust comment. + * decl2.c (cp_finish_file): Don't reset interface_only and + interface_unknown. + * method.c (synthesize_method): Don't reset interface_unknown or + call extract_interface_info. + * pt.c (pop_tinst_level): Don't call extract_interface_info. + * decl.c (start_cleanup_fn): Don't save or restore interface_only + and interface_unknown. + (make_rtl_for_nonlocal_decl): Call get_fileinfo on input_filename + and use the result instead of the interface_only/interface_unknown + globals. + (start_preparsed_function): Likewise. + * lex.c (cxx_make_type): Likewise. + * semantics.c (begin_class_definition): Likewise. + (expand_body): Don't call extract_interface_info. + +2004-09-10 Ziemowit Laski + + * decl.c (objc_mark_locals_volatile): Make description of + routine more descriptive; only mark VAR_DECLs at each + binding level. + +2004-09-10 Richard Henderson + + PR c++/17386 + * call.c (build_vfield_ref): Move... + * class.c (build_vfield_ref): ... here. Convert datum to the + primary base containing the vptr. + (make_new_vtable): Simplify build_primary_vtable arguments. + (finish_struct_1): Do not duplicate TYPE_VFIELD. + * typeck.c (build_class_member_access_expr): Don't warn for + null object access to base fields. + +2004-09-10 Ziemowit Laski + + * decl.c (objc_get_current_scope, objc_mark_locals_volatile): + New functions, to be called from ObjC++. + +2004-09-10 Kazu Hirata + + * class.c, cp-tree.h, decl.c, decl2.c, mangle.c, + name-lookup.h, parser.c, search.c, semantics.c, typeck2.c: Fix + comment typos. + +2004-09-09 Ziemowit Laski + + * typeck.c (build_c_cast): Preserve the cast if casting + to and from an Objective-C type. + +2004-09-09 Ziemowit Laski + + * Make-lang.in (cp/typeck.o): Depend on c-common.h. + * typeck.c: Include c-common.h. + (comptypes): For RECORD_TYPEs, call objc_comptypes() and + return the result if nonnegative. + +2004-09-09 Zack Weinberg + + * decl2.c (import_export_class) + * lex.c (handle_pragma_interface): + Test MULTIPLE_SYMBOL_SPACES with if, not #ifdef. + +2004-09-08 Ziemowit Laski + + * Make-lang.in (cp/semantics.o): Depend on c-common.h. + * semantics.c: Include c-common.h. + (finish_compound_stmt): Call objc_clear_super_receiver(). + +2004-09-08 Ziemowit Laski + + * cp-tree.h (do_poplevel): New prototype. + * semantics.c (do_poplevel): Make externally visible. + +2004-09-08 Nathan Sidwell + + * cp-tree.h (tree_pair_s): Define a GC'd vector. + * name-lookup.h (cxx_saved_binding, cp_class_binding): Likewise. + * semantics.c (deferred_access): Likewise. + +2004-09-06 Daniel Jacobowitz + + * semantics.c (expand_body): Assert that we are not nested. + +2004-09-06 Zack Weinberg + + * decl.c (build_enumerator): Use add_double and int_fits_type_p + instead of cp_build_binary_op, to avoid creating short-lived trees. + * parser.c (cp_parse_type_specifier ): Use two-token + lookahead instead of backtracking. Move some code to avoid a + conditional branch. + (cp_parser_enum_specifier): Avoid duplication of effort with caller. + Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate. + (cp_parser_enumerator_list, cp_parser_enumerator_definition): + Use cp_lexer_next_token_is/cp_lexer_next_token_is_not as appropriate. + +2004-09-04 Kriang Lerdsuwanakij + + * decl.c (grok_declarator): Remove a redundant semicolon. + + * parser.c (cp_parser_decl_specifier_seq, cp_parser_type_specifier): + Correct comments describing function parameters. + +2004-09-03 Matt Austern + Compile speed improvement. + * parser.c (cp_lexer_print_token): Only define if ENABLE_CHECKING set. + Otherwise define a stub macro that expands to nothing. + (cp_lexer_debugging_p): Only define if ENABLE_CHECKING set. Otherwise + define a stub macro that expands to 0. + (cp_lexer_start_debugging): Only define if ENABLE_CHECKING set. + (cp_lexer_stop_debugging): Likewise. + (cp_lexer_debug_stream): Only define if ENABLE_CHECKING set. Otherwise + define a stub macro that expands to NULL. + (cp_lexer_new_main): Only set debugging_p if ENABLE_CHECKING set. + (cp_lexer_new_from_tokens): Likewise. + +2004-09-03 Jan Hubicka + + * decl.c (finish_function): Clean out pointers we no longer need. + +2004-09-03 Jan Beulich + + * g++spec.c (MATH_LIBRARY_PROFILE): Default to MATH_LIBRARY rather + than "-lm". + +2004-09-02 Paul Brook + + * decl2.c (determine_visibility): Only check data visibility + for VAR_DECLS. + +2004-08-31 Mark Mitchell + + * cp-tree.h (DECL_CONSTRUCTION_VTABLE_P): New macro. + * class.c (build_ctor_vtbl_group): Set DECL_CONSTRUCTION_VTABLE_P. + * decl2.c (determine_visibility): Honor + TARGET_CXX_EXPORT_CLASS_DATA. + + * class.c (key_method): Rename to ... + (determine_key_method): ... this. + (finish_struct_1): Adjust accordingly. + * cp-tree.h (key_method): Declare. + * decl2.c (maybe_emit_vtables): Determine the key method here if + it has not already been done. + +2004-08-31 Ziemowit Laski + + * Make-lang.in (CXX_AND_OBJCXX_OBJS): Add cp/cp-objcp-common.o. + (cp/cp-lang.o): Depend on debug.h, gtype-cp.h and cp/cp-objcp-common.h. + (cp/cp-decl.c): Do not depend on gtype-cp.h. + (cp/cp-objcp-common.o): New target. + * cp-lang.c: Include debug.h, cp-objcp-common.h and gtype-cp.h. + (cxx_get_alias_set, cxx_warn_unused_global_decl, cp_expr_size, + cp_tree_size, cp_var_mod_type_p, cxx_initialize_diagnostics): Move + prototypes and definitions to cp-objcp-common.h and cp-objcp-common.c, + respectively. + (LANG_HOOKS_TREE_SIZE, LANG_HOOKS_FINISH, + LANG_HOOKS_CLEAR_BINDING_STACK, LANG_HOOKS_INIT_OPTIONS, + LANG_HOOKS_INITIALIZE_DIAGNOSTICS, LANG_HOOKS_HANDLE_OPTION, + LANG_HOOKS_HANDLE_FILENAME, LANG_HOOKS_MISSING_ARGUMENT, + LANG_HOOKS_POST_OPTIONS, LANG_HOOKS_GET_ALIAS_SET, + LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_EXPAND_EXPR, + LANG_HOOKS_EXPAND_DECL, LANG_HOOKS_PARSE_FILE, + LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, LANG_HOOKS_TRUTHVALUE_CONVERSION, + LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, LANG_HOOKS_MARK_ADDRESSABLE, + LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, + LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, + LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_PRINT_ERROR_FUNCTION, + LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL, LANG_HOOKS_WRITE_GLOBALS, + LANG_HOOKS_FUNCTION_INIT, LANG_HOOKS_FUNCTION_FINAL, + LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P, + LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, + LANG_HOOKS_ATTRIBUTE_TABLE, LANG_HOOKS_TREE_INLINING_WALK_SUBTREES, + LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN, + LANG_HOOKS_TREE_INLINING_ADD_PENDING_FN_DECLS, + LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P, + LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P, + LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P, + LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN, + LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN, LANG_HOOKS_EXPR_SIZE, + LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR, + LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, LANG_HOOKS_MAKE_TYPE, + LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE, + LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, + LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, LANG_HOOKS_INCOMPLETE_TYPE_ERROR, + LANG_HOOKS_TYPE_PROMOTES_TO, LANG_HOOKS_REGISTER_BUILTIN_TYPE, + LANG_HOOKS_GIMPLIFY_EXPR, LANG_HOOKS_FOLD_OBJ_TYPE_REF): Move + hooks to cp-objcp-common.h. + (finish_file): New function. + * cp-objcp-common.c: New file. + * cp-objcp-common.h: New file. + * cp-tree.h (cp_finish_file): New prototype. + * decl.c: Do not include gtype-cp.h. + * decl2.c (finish_file): Rename to cp_finish_file. + +2004-08-31 Richard Henderson + + PR c++/17221 + * pt.c (tsubst_expr): Move OFFSETOF_EXPR handling ... + (tsubst_copy_and_build): ... here. + +2004-08-30 Mark Mitchell + + * cp-tree.h (initialize_artificial_var): Declare. + * decl.c (initialize_artifical_var): New function. + * class.c (initialize_array): Remove. + (initialize_vtable): Use initialize_artificial_var. + (build_vtt): Likewise. + (build_ctor_vtbl_group): Likewise. + +2004-08-30 Richard Henderson + + * class.c (build_base_path): Use build_address directly. + * typeck.c (build_unary_op): Don't lower &a.b to pointer + arithmetic directly. + * typeck2.c (store_init_value): Don't assume !TREE_CONSTANT + means !initializer_constant_valid_p. + +2004-08-30 Richard Henderson + + * class.c (fixed_type_or_null): Use get_base_address before + assuming an ADDR_EXPR is non-null. + +2004-08-30 Nathan Sidwell + + * name-lookup.c (pop_binding, pushdecl, + set_identifier_type_value_with_scope, push_overloaded_decl, + arg_assoc_type): Replace abort with gcc_assert or gcc_unreachable. + * parser.c (cp_parser_diagnose_invalid_type_name, + cp_parser_postfix_expression, cp_parser_unary_expression, + cp_parser_check_declarator_template_para): Likewise. + * pt.c (push_inline_template_parms_recursive, + check_explicit_specialization, convert_nontype_argument, + coerce_template_template_parms, uses_template_parms, + instantiate_class_template, tsubst_decl, tsubst, tsubst_copy, + tsubst_expr, instantiate_template, + maybe_adjust_types_for_deduction, type_unification_real, + resolve_overloaded_unification, template_decl_level, + type_dependent_expression_p): Likewise. + * search.c (lookup_base_r): Likewise. + * semantics.c (finish_stmt_expr, simplify_aggr_init_expr): Likewise. + * tree.c (lvalue_p_1, count_functions, cxx_printable_name, + verify_stmt_tree_r, get_type_decl, stabilize_call): Likewise. + * typeck.c (common_type, get_member_function_from_ptrfunc, + build_binary_op, build_unary_op, expand_ptrmemfunc_cst): Likewise. + * typeck2.c (cxx_incomplete_type_diagnostic, + split_nonconstant_init_1, store_init_value, + process_init_constructor): Likewise. + +2004-08-30 Nathan Sidwell + + * call.c (check_dtor_name): Replace abort with gcc_assert or + gcc_unreachable. + (build_call, add_builtin_candidate, build_new_op, + convert_like_real, build_over_call, in_charge_arg_for_name, + source_type, joust): Likewise. + * class.c (build_simple_base_path, get_vcall_index, + finish_struct_1, instantiate_type, get_enclosing_class, + add_vcall_offset_vtbl_entries_1, cp_fold_obj_type_ref): Likewise. + * cp-gimplify.c (cp_genericize): Likewise. + * cp-lang.c (cp_expr_size, cp_tree_size): Likewise. + * cvt.c (cp_convert_to_pointer, ocp_convert): Likewise. + * decl.c (poplevel, make_unbound_class_template, reshape_init, + check_special_function_return_type, grokdeclarator, + grok_op_properties, tag_name, xref_tag, start_preparsed_function, + finish_function): Likewise. + * decl2.c (grokfield, maybe_emit_vtables):Likewise. + * error.c (dump_global_iord, dump_decl, dump_template_decl, + language_to_string): Likewise. + * except.c (choose_personality_routine): Likewise. + * friend.c (do_friend): Likewise. + * g++spec.c (lang_specific_driver): Likewise. + * init.c (build_zero_init, expand_default_init, build_new_1, + build_vec_delete_1, build_vec_init, build_dtor_call): Likewise. + * lex.c (retrofit_lang_decl, cp_type_qual_from_rid): Likewise. + * mangle.c (add_substitution, write_unscoped_name, + write_template_prefix, write_identifier, + write_special_name_destructor, write_type, write_builtin_type, + write_expression, write_template_param, + write_java_integer_type_codes): Likewise. + * method.c (implicitly_declare_fn): Likewise. + +2004-08-30 Nathan Sidwell + + * cp-tree.h (BINFO_PRIMARY_P): Use a binfo flag. + (BINFO_INDIRECT_PRIMARY_P): Remove. + * class.c (determine_primary_base): Rename to ... + (determine_primary_bases): ... here. Set all primary bases. + (set_primary_base): Remove. + (mark_primary_bases): Remove. + (build_simple_base_path, walk_subobject_offsets, + propagate_binfo_offsets, end_of_class): Adjust. + (layout_class_type): Rename determine_primary_base call. + (dump_class_hierarchy_r, dump_vtable): Adjust. Don't pass a binfo + to type_as_string. + (dfs_build_secondary_vptr_vtt_inits, dfs_accumulate_vtbl_inits, + build_rtti_vtbl_entries): Adjust. + * init.c (build_vtbl_address): Adjust. + + * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Use gcc_assert. + +2004-08-28 Ziemowit Laski + + * Make-lang.in (CXX_OBJS): Split up into CXX_OBJS and + CXX_AND_OBJCXX_OBJS. + (CXX_C_OBJS): Include in CXX_AND_OBJCXX_OBJS instead of listing + separately on the link line. + +2004-08-28 Jason Merrill + + * decl.c (expand_static_init): Avoid bogus warnings. + +2004-08-27 Jason Merrill + + PR c++/16851 + * tree.c (stabilize_init): See through a COMPOUND_EXPR. + + PR c++/13684 + * decl.c (expand_static_init): Use thread-safety API. + (register_dtor_fn): Return the call, don't expand it. + * tree.c (add_stmt_to_compound): New fn. + (stabilize_call): Use it. + +2004-08-27 Richard Henderson + + * cp-tree.def (OFFSETOF_EXPR): New. + * parser.c (cp_parser_builtin_offsetof): Either built an + OFFSETOF_EXPR, or call fold_offsetof immediately. + * pt.c (tsubst_expr): Handle OFFSETOF_EXPR. + +2004-08-27 Nathan Sidwell + + * call.c (validate_conversion_obstack): Replace + my_friendly_assert with gcc_assert or gcc_unreachable. + (direct_reference_binding, merge_conversion_sequences, + build_user_type_conversion_1, perform_overload_resolution, + build_op_delete_call, enforce_access, call_builtin_trap, + build_over_call, build_special_member_call, build_new_method_call, + initialize_reference): Likewise. + * class.c (build_base_path, build_primary_vtable, alter_access, + check_bases, update_vtable_entry_for_fn, layout_empty_base, + clone_function_decl, adjust_clone_args, + type_requires_array_cookie, include_empty_classes, + finish_struct_1, resolve_address_of_overloaded_function, + instantiate_type, get_vtbl_decl_for_binfo, build_vtt_inits, + dfs_build_secondary_vptr_vtt_inits, build_ctor_vtbl_group, + accumulate_vtbl_inits, build_vtbl_initializer, + build_vbase_offset_vtbl_entries, build_rtti_vtbl_entries): Likewise. + * cvt.c (build_up_reference, convert_to_reference): Likewise. + * decl.c (poplevel, duplicate_decls, make_typename_type, + cxx_init_decl_processing, reshape_init, check_initializer, + make_rtl_for_nonlocal_decl, initialize_local_var, cp_finish_decl, + expand_static_init, grokfndecl, grokvardecl, build_ptrmem_type, + grokdeclarator, copy_fn_p, grok_op_properties, xref_tag, + xref_basetypes, start_preparsed_function, save_function_data, + finish_function, finish_method, maybe_register_incomplete_var, + complete_vars): Likewise. + * decl2.c (grok_array_decl, check_member_template, + check_classfn, finish_static_data_member_decl, coerce_new_type, + coerce_delete_type, import_export_class, decl_needed_p, + determine_visibility, import_export_decl, build_cleanup, + start_static_initialization_or_destructi, do_static_destruction, + prune_vars_needing_no_initialization, + build_offset_ref_call_from_tree): Likewise. + * error.c (dump_decl, dump_expr): Likewise. + * init.c (finish_init_stmts, build_zero_init, + expand_virtual_init, expand_default_init, expand_aggr_init_1, + build_offset_ref, build_new_1, build_delete, build_vbase_delete): + Likewise. + * mangle.c (write_method_parms, write_template_args, + write_expression, write_template_arg): Likewise. + * method.c (make_thunk, finish_thunk, use_thunk): Likewise. + * name-lookup.c (pop_binding, begin_scope, leave_scope, + resume_scope, push_using_decl, validate_nonmember_using_decl, + is_ancestor, poplevel_class, set_inherited_value_binding_p, + push_class_level_binding, do_class_using_decl, push_namespace, + pop_namespace, add_using_namespace, ambiguous_decl, + lookup_namespace_name, lookup_type_current_level, + maybe_process_template_type_declaration): Likewise. + * parser.c (cp_lexer_peek_nth_token, + cp_parser_parse_and_diagnose_invalid_typ, + cp_parser_translation_unit, cp_parser_template_id, + cp_parser_lookup_name, cp_parser_late_parsing_for_member): Likewise. + * pt.c (push_access_scope, finish_member_template_decl, + push_inline_template_parms_recursive, add_outermost_template_args, + get_innermost_template_args, begin_explicit_instantiation, + end_explicit_instantiation, retrieve_specialization, + is_specialization_of, is_specialization_of_friend, + register_specialization, check_explicit_specialization, + comp_template_parms, process_template_parm, + process_partial_specialization, convert_nontype_argument, + coerce_template_template_parms, coerce_template_parms, + mangle_class_name_for_template, lookup_template_function, + lookup_template_class, instantiate_class_template, tsubst_decl, + tsubst_function_type, tsubst, tsubst_qualified_id, tsubst_copy, + instantiate_template, fn_type_unification, type_unification_real, + get_template_base, regenerate_decl_from_template, + template_for_substitution, instantiate_decl, + get_mostly_instantiated_function_type, dependent_scope_ref_p, + value_dependent_expression_p, resolve_typename_type): Likewise. + * repo.c (repo_emit_p): Likewise. + * rtti.c (build_headof, get_tinfo_decl, get_pseudo_ti_init, + create_tinfo_types, emit_tinfo_decl): Likewise. + * search.c (lookup_base_r, lookup_base, lookup_field_1, + dfs_access_in_type, build_baselink, lookup_member, + adjust_result_of_qualified_name_lookup, copied_binfo): Likewise. + * semantics.c (perform_or_defer_access_check, + finish_non_static_data_member, finish_stmt_expr_expr, + finish_stmt_expr, finish_call_expr, finish_pseudo_destructor_expr, + finish_template_template_parm, finish_member_declaration, + emit_associated_thunks): Likewise. + * tree.c (build_target_expr_with_type, force_target_expr, + copy_binfo, get_first_fn, cp_tree_equal): Likewise. + * typeck.c (type_after_usual_arithmetic_conversions, comptypes, + cxx_sizeof_or_alignof_type, perform_integral_promotions, + build_class_member_access_expr, finish_class_member_access_expr, + build_ptrmemfunc_access_expr, build_unary_op, + unary_complex_lvalue, cxx_mark_addressable, build_modify_expr, + build_ptrmemfunc, expand_ptrmemfunc_cst, check_return_expr + * typeck2.c (complete_type_check_abstract, + abstract_virtuals_error, process_init_constructor, + add_exception_specifier): Likewise. + +2004-08-27 Nathan Sidwell + + * class.c (build_vtbl_initializer): Use ssize_int. + * decl.c (complete_array_type): Likewise. + * method.c (finish_thunk): Likewise. + * search.c (get_dynamic_base_type): Likewise. + +2004-08-26 Richard Henderson + + * cp-tree.h (DECL_FIELD_IS_BASE): New. + * class.c (build_base_field): Set it. + (build_simple_base_path): Use it. + (fixed_type_or_null): Don't consider base fields definitive. + +2004-08-25 Roger Sayle + + PR middle-end/16693 + PR tree-optimization/16372 + * decl.c (finish_enum): Make the precision of the enumerated type + the same width as the underlying integer type. + +2004-08-25 Mark Mitchell + + PR c++/17155 + * lex.c (build_lang_decl): Set DECL_NO_STATIC_CHAIN for all C++ + functions. + + * mangle.c (get_identifier_nocopy): Add cast. + + * cp-tree.h (mangle_type): Remove. + * mangle.c (globals): GTY it. + (mangle_obstack): New variable. + (name_obstack): Likewise. + (name_base): Likewise. + (write_char): Adjust accordingly. + (write_chars): Likewise. + (write_string): Likewise. + (start_mangling): Initialize G.substitutions only one. Add + ident_p parameter. + (finish_mangling): Use VARRAY_CLEAR to reclaim + storage in G.substitutions. Use obstack_finish. + (init_mangle): Adjust for changes to variable names above. + Initialize G.substitutions. + (mangle_decl_string): Adjust call to start_mangling. + (get_identifier_nocopy): New function. + (mangle_decl): Use it. + (mangle_type_string): Adjust call to start_mangling. + (mangle_special_for_type): Likewise. + (mangle_vtt_for_type): Likewise. + (mangle_ctor_vtbl_for_type): Likewise. + (mangle_thunk): Likewise. + (mangle_guard_variable): Likewise. + (mangle_ref_init_variable): Likewise. + +2004-08-25 Kriang Lerdsuwanakij + + PR c++/14428 + * pt.c (redeclare_class_template): Check the type of non-type and + template template parameter. + +2004-08-25 Nathan Sidwell + + * call.c (convert_class_to_reference): Adjust build_int_cst calls. + (build_user_type_conversion_1, convert_like_real, + build_java_interface_fn_ref, build_special_member_call): Likewise. + * class.c (finish_struct_1, build_vtbl_initializer): Likewise. + * cp-gimplify.c (cp_gimplify_expr): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. + * decl2.c (start_static_initialization_or_destruction, + generate_ctor_or_dtor_function): Likewise. + * except.c (build_throw): Likewise. + * mangle.c (write_integer_cst): Likewise. + * method.c (finish_thunk): Likewise. + * rtti.c (build_headof, get_tinfo_decl_dynamic, + build_dynamic_cast_1, ptr_initializer, ptm_initializer, + get_pseudo_ti_init): Likewise. + * search.c (get_dynamic_cast_base_type): Likewise. + +2004-08-25 Zack Weinberg + + * class.c, search.c: Remove references to DWARF_DEBUG. + +2004-08-25 Adam Nemet + + * repo.c (extract_string): Reset backquote after one character. + (get_base_filename): Fix indentation. + +2004-08-24 Nathan Sidwell + + * decl.c (cxx_init_decl_processing): Adjust + build_common_tree_nodes call. + +2004-08-24 Nathan Sidwell + + PR c++/16889 + * (is_subobject_of_p): Resurrect & optimize. + (lookup_field_r): Use it. + +2004-08-24 Kriang Lerdsuwanakij + + PR c++/16706 + * search.c (friend_accessible_p): Increment processing_template_decl + when deal with TEMPLATE_DECL of SCOPE. + +2004-08-24 Nathan Sidwell + + PR c++/17149 + * semantics.c (check_accessibility_of_qualified_id): Defer check + if qualifying_type is a template parameter. + +2004-08-23 Mark Mitchell + + PR c++/17163 + * pt.c (instantiate_decl): Do not try to apply + DECL_DECLARED_INLINED_P to a VAR_DECL. + + * search.c (build_baselink): Fix typo in comment. + +2004-08-22 Andrew Pinski + + Revert: + 2004-08-22 Andrew Pinski + PR c++/14029 + * typeck.c (build_unary_op): Use &a.b if the folded lowered + expression is not constant. + +2004-08-23 Nathan Sidwell + + * name-lookup.c (pushdecl): Rename build_type_copy call. + * tree.c (cp_build_qualified_type_real, + build_exception_variant, handle_java_interface_attribute): Likewise. + +2004-08-22 Andrew Pinski + + PR c++/14029 + * typeck.c (build_unary_op): Use &a.b if the folded lowered + expression is not constant. + +2004-08-20 Mark Mitchell + + PR c++/17121 + * decl.c (expand_static_init): Use DECL_FUNCTION_SCOPE_P. + +2004-08-21 Joseph S. Myers + + PR c++/17120 + * pt.c (tsubst_copy_and_build): Avoid clearing TREE_NO_WARNING for + MODOP_EXPR. + +2004-08-20 Kriang Lerdsuwanakij + + * pt.c (register_specialization): Check DECL_TEMPLATE_SPECIALIZATION + before calling comp_template_args. + +2004-08-20 Nathan Sidwell + + * class.c (build_vtbl_initializer): Use build_int_cst for + negative size types. + * decl.c (complete_array_type): Likewise. + * method.c (finish_thunk): Likewise. + +2004-08-20 Andreas Tobler + + * tree.c: Remove unused mark_local_for_remap_r. + +2004-08-19 Eric Christopher + + * cp-tree.h (cxx_unsave_expr_now): Delete prototype. + * tree.c (cxx_unsave_expr_now): Delete. + (cp_unsave_r): Ditto. + +2004-08-19 Mark Mitchell + + PR c++/15890 + * pt.c (push_template_decl_real): Disallow template allocation + functions with fewer than two parameters. + +2004-08-19 Nathan Sidwell + + * cp-tree.h (build_shared_int_cst): Remove. + * tree.c (shared_int_cache): Remove. + (build_shared_int_cst): Remove. + * class.c (finish_struct_1): Use build_int_cst. + +2004-08-19 Nathan Sidwell + + * decl.c (finish_enum): Do not copy value node early, copy + later. + * lex.c (cxx_init): Force null_node to be unique. + +2004-08-19 Joseph S. Myers + + PR c++/17041 + * pt.c (tsubst_copy, tsubst_copy_and_build): Copy TREE_NO_WARNING + from input for MODOP_EXPR. + +2004-08-18 Mark Mitchell + + * pt.c (dependent_template_p): Fix typo in commment. + + PR c++/17068 + * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as + dependent. + +2004-08-17 Mark Mitchell + + PR c++/16246 + * pt.c (unify): Tidy ARRAY_TYPE handling. Make sure that non-type + arguments have the same type as the corresponding parameter. + + PR c++/16215 + * parser.c (cp_parser_name_lookup_error): If parser->object_scope + is set use it for diagnostic purposes. + (cp_parser_pseudo_destructor_name): Remove special-case error + message. + + PR c++/15871 + * semantics.c (expand_or_defer_fn): Honor -fkeep-inline-functions. + + PR c++/16965 + * cp-tree.h (qualified_name_lookup_error): Add parameter. + * name-lookup.c (do_class_using_decl): Restrict set of entities + passed to cp_emit_debug_info_for_using more carefully. + (lookup_qualified_name): Allow lookup_member to return sets of + ambiguous entries. + * parser.c (cp_parser_lookup_name): Add ambiguous_p parameter. + (cp_parser_primary_expression): Handle ambiguous lookups. + (cp_parser_template_name): Adjust use of cp_parser_lookup_name. + (cp_parser_template_argument): Likewise. + (cp_parser_elaborate_type_specifier): Likewise. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name_simple): Likewise. + * pt.c (tsubst_qualified_id): Handle ambiguous results. + (tsubst_expr): Likewise. + * semantics.c (qualified_name_lookup_error): Add decl paramter. + For ambiguous lookups, print candidates. + +2004-08-16 Kriang Lerdsuwanakij + + PR c++/6749 + * pt.c (instantiate_pending_templates): Add int parameter. Don't + return anything. + * cp-tree.h (instantiate_pending_templates): Adjust prototype. + * decl2.c (finish_file): Adjust call to + instantiate_pending_templates. + +2004-08-15 Roger Sayle + + * call.c (build_vfield_ref, build_call, build_conditional_expr, + convert_arg_to_ellipsis, build_x_va_arg, build_over_call, + build_java_interface_fn_ref, build_special_member_call, + build_new_method_call, initialize_reference): Replace calls to + build with calls to buildN. + * class.c (build_base_path, convert_to_base_statically, + build_vfn_ref, instantiate_type, dfs_accumulate_vtbl_inits, + build_vtbl_initializer): Likewise. + * cp-gimplify.c (genericize_try_block, genericize_catch_block, + gimplify_if_stmt, cp_genericize_r): Likewise. + * cvt.c (convert_to_void): Likewise. + * decl.c (check_initializer, finish_constructor_body, + finish_destructor_body): Likewise. + * error.c (dump_expr): Likewise. + * except.c (build_exc_ptr, expand_start_catch_block, build_throw): + Likewise. + * init.c (perform_member_init, expand_virtual_init, + expand_cleanup_for_base, build_init, expand_default_init, + build_offset_ref, decl_constant_value, build_new, build_new_1, + build_vec_delete_1, build_vec_init, build_delete, + push_base_cleanups, build_vec_delete): Likewise. + * mangle.c (write_integer_cst): Likewise. + * method.c (thunk_adjust, do_build_copy_constructor, + do_build_assign_ref): Likewise. + * pt.c (lookup_template_function, tsubst, tsubst_copy_and_build, + unify, build_non_dependent_expr): Likewise. + * rtti.c (build_headof, build_typeid, ifnonnull, + build_dyanmic_cast_1, tinfo_base_init): Likewise. + * semantics.c (begin_compound_stmt, finish_call_expr, + finish_pseudo_destructor_expr, finish_id_expression, + simplify_aggr_init_expr, finalize_nrv_r): Likewise. + * tree.c (build_target_expr, build_cplus_new, array_type_nelts_top, + array_type_nelts_total, stabilize_call): Likewise. + * typeck.c (decay_conversion, build_class_member_access_expr, + lookup_destructor, build_ptrmemfunc_access_expr, build_array_ref, + get_member_function_from_ptrfunc, build_binary_op, pointer_diff, + build_x_unary_op, build_unary_op, unary_complex_lvalue, + build_compound_expr, build_modify_expr, expand_ptrmemfunc_cst, + check_return_expr): Likewise. + * typeck2.c (split_nonconstant_1, split_nonconstant_init_1, + split_nonconstant_init, store_init_value, build_m_component_ref): + Likewise. + +2004-08-15 Nathan Sidwell + + * call.c (convert_class_to_reference, + build_user_type_conversion_1, convert_like_real, + build_java_interface_fn_ref, build_special_member_call): Use + build_int_cst. + * class.c (build_vtbl_initializer): Likewise. + * cp-gimplify.c (cp_gimplify_expr): Likewise. + * cvt.c (cp_convert_to_pointer): Likewise. + * decl.c (cxx_init_decl_processing, complete_array_type): Likewise. + * decl2.c (start_static_initialization_or_destruction, + generate_ctor_or_dtor_function): Likewise. + * except.c (build_throw): Likewise. + * lex.c (cxx_init): Likewise. + * mangle.c (write_integer_cst): Likewise. + * rtti.c (build_headof, get_tinfo_decl_dynamic, + build_dynamic_cast_1, ptr_initializer, ptm_initializer, + get_pseudo_ti_init): Likewise. + * search.c (get_dynamic_cast_base_type): Likewise. + * tree.c (build_shared_int_cst): Likewise. + +2004-08-12 Mark Mitchell + + PR c++/16273 + * class.c (count_depth_data): New type. + (dfs_depth_post): New function. + (dfs_depth_q): Likewise. + (find_final_overrider_data_s): Change type of vpath. + Add vpath_list. + (dfs_find_final_overrider_1): New function. + (dfs_find_final_overrider): Use it. + (dfs_find_final_overrider_q): Adjust use of vpath. + (dfs_find_final_overrider_post): Likewise. + (find_final_overrider): Use dfs_depth. Allocate and deallocate + vpath_list. + +2004-08-12 Jan Beulich + + * parser.c (cp_parser_asm_definition): Properly consume scope operator + tokens preceding the clobbers. Don't check for scope operator + following inputs. Simplify inputs handling to match that now used for + clobbers. + +2004-08-11 Mark Mitchell + + PR c++/16698 + * except.c (build_throw): Allocate cleanup_type and the function + for __cxa_throw separately. + + PR c++/16853 + * call.c (standard_conversion): Do not accept conversions between + pointers to members if the class types are unrelated. + + PR c++/16618 + * parser.c (cp_parser_builtin_offsetof): Cast to "const volatile + char &" instead of just "char &". + + PR c++/16870 + * pt.c (tsubst): Just return the unknown_type_node. + +2004-08-11 Mark Mitchell + + PR c++/16964 + * parser.c (cp_parser_class_specifier): Robustify. + + PR c++/16904 + * pt.c (tsubst_copy_and_build): Complain about invalid + qualification. + + PR c++/16929 + * pt.c (tsubst_default_argument): Clear out current_class_ptr and + current_class_ref while tsubsting. + +2004-08-10 Mark Mitchell + + PR c++/16971 + * parser.c (cp_parser_init_declarator): Robustify. + +2004-08-06 Richard Sandiford + + * typeck2.c (process_init_constructor): Guard the missing field warning + with warn_missing_field_initializers rather than extra_warnings. + +2004-08-06 Paolo Bonzini + + * class.c (instantiate_type) : Do not handle. + +2004-08-05 Mark Mitchell + + * decl.c (start_preparsed_function): Move determine_visibility + call. + * decl2.c (determine_visibility): Incorporate dllexport testing. + +2004-08-05 Geoffrey Keating + + * g++spec.c (lang_specific_driver): An -Xlinker or -Wl, option + means that libstdc++ is needed. + +2004-08-05 Nathan Sidwell + + * cvt.c (cp_convert_to_pointer): Adjust force_fit_type call. + +2004-08-04 Geoffrey Keating + + * decl.c (make_rtl_for_nonlocal_decl): Set DECL_ASSEMBLER_NAME rather + than passing it as a parameter to rest_of_decl_compilation. + * decl2.c (grokfield): Use set_user_assembler_name. + +2004-08-04 Nathan Sidwell + + * decl.c (complete_array_type): Don't gratuitously copy + maxindex. Its type is always set. + +2004-08-04 Paul Brook + + * Make-lang.in (cp/semantics.o, cp/optimize.o): Depend on TARGET_H. + * cp-tree.h (struct language_function): Rename x_dtor_label to + x_cdtor_label. + (dtor_label): Rename ... + (cdtor_label): ... to this. + * decl.c (begin_constructor_body): Remove. + (check_special_function_return_type): Maybe change the return type. + (grokdeclarator): Pass the class type. + (start_preparsed_function): Constructors may need a return label. + (finish_constructor_body, finish_destructor_body): Set the return + value. + (begin_function_body): Don't call begin_constructor_body. + (finish_function): Don't warn for constructors or destructors. + (implicitly_declare_fn): Maybe change the return type. + * optimize.c: Include target.h. + (maybe_clone_body): Remap the function result. + * semantics.c: Include target.h. + (finish_return_stmt): Maybe jump to return label for constructors. + +2004-08-03 Mark Mitchell + + * class.c (build_vtable): Do not set DECL_VISIBILITY here. + (check_field_decls): Or here. + (check_methods): Or here. + (initialize_array): Don't mess with DECL_CONTEXT. + * cp-tree.h (start_decl): Adjust prototype. + (determine_visibility): New function. + * decl.c (duplicate_decls): Remove checks for hidden "operator + new". + (build_library_fn_1): Give all library functions default + visibility. + (start_decl): Add pop_scope_p parameter. Tidy. + (cp_finish_decl): Do not pop scopes here. Call + determine_visibility for variable definitions. + (start_preparsed_function): Call determine_visibility. + * decl2.c (determine_visibility): New function. + * method.c (use_thunk): Fix formatting. + * parser.c (cp_parser_condition): Adjust calls to start_decl. + (cp_parser_init_declarator): Likewise. + * pt.c (instantiate_decl): Always call pop_nested_class. + * rtti.c (get_tinfo_decl): Do not set DECL_VISIBILITY. + (tinfo_base_init): Likewise. + +2004-08-02 Mark Mitchell + + PR c++/16707 + * name-lookup.c (validate_nonmember_using_decl): Robustify. + +2004-08-01 Mark Mitchell + + PR c++/16224 + * name-lookup.c (decl_namespace): Remove. + (current_decl_namespace): Use decl_namespace_context instead of + decl_namespace. + (push_decl_namespace): Likewise. + (arg_assoc_class): Likewise. + (arg_assoc_type): Likewise. + * pt.c (check_specialization_namespace): New function. + (maybe_process_partial_specialization): Use it. + (register_specialization): Likewise. + + PR c++/16489 + * cp-tree.h (DECL_INTEGRAL_CONSTANT_VAR_P): New macro. + * call.c (null_ptr_cst_p): Handle variables with constant + initializers. + * pt.c (convert_nontype_argument): Use + DECL_INTEGRAL_CONSTANT_VAR_P. + * semantics.c (finish_id_expression): Likewise. + + PR c++/16529 + * decl.c (duplicate_decls): Reject duplicate namespace + declarations. + + PR c++/16810 + * typeck.c (build_ptrmemfunc): Loosen assertion. + +2004-08-01 Gabriel Dos Reis + + * call.c (z_candidate::template_decl): Rename from template. + (add_template_candidate_real): Adjust member reference. + (joust): Likewise. + +2004-07-29 Mark Mitchell + + * cp-tree.h (IDENTIFIER_REPO_CHOSEN): Define. + (lang_decl_flags): Narrow the width of "languages". Add + repo_available_p. + (DECL_NEEDED_P): Remove. + (FOR_EACH_CLONE): New macro. + (DECL_REPO_AVAILABLE_P): Likewise. + (DECL_TINFO_P): Likewise. + (set_linkage_according_to_type): Declare. + (import_export_vtable): Remove. + (import_export_tinfo): Likewise. + (mark_needed): New function. + (decl_needed_p): Likewise. + (note_vauge_linkage_fn): Likewise. + (init_repo): Change prototype. + (repo_template_used): Remove. + (repo_template_instantiated): Likewise. + (repo_emit_p): New function. + (repo_export_class_p): Likewise. + (no_linkage_check): Change prototype. + * class.c (set_linkage_according_to_type): New function. + (build_vtable): Use it. Do not call import_export_vtable. Set + DECL_IGNORED_P if appropriate. + * decl.c (duplicate_decls): Preserve DECL_REPO_AVAILABLE_P. + (make_rtL_for_nonlocal_decls): Check for template instantiations + explicitly. + (grokfndecl): Adjust call to no_linkage_check. + (set_linkage_for_static_data_member): New function. + (grokvardecl): Use it. Adjust call to no_linkage_check. + (grokdeclarator): Use set_linkage_for_static_data_member. + * decl2.c (note_vague_linkage_fn): New function. + (note_vague_linkage_var): Likewise. + (finish_static_data_member_decl): Use it. + (import_export_vtable): Remove. + (import_export_class): Use repo_export_class_p. + (var_finalized_p): Simplify. + (maybe_emit_vtables): Simplify. + (mark_needed): New function. + (decl_needed_p): Likewise. + (import_export_decl): Add documentation and consistency checks. + Use repo_emit_p. Handle virtual tables and RTTI information + here. + (import_export_tinfo): Remove. + (write_out_vars): Call import_export_decl. + (cxx_callgraph_analyze_expr): Ensure that all vtables are emitted + whenever one is. + (finish_file): Use decl_needed_p. Do not call import_export_decl + for undefined static data members. Do not warn about undefined + inlines when using a repository. + (mark_used): Use note_vague_linkage_fn. Always defer template + instantiations. + * lex.c (cxx_init): Adjust call to init_repo. Always set + flag_unit_at_a-time. + * method.c (synthesize_method): Remove unncessary + import_export_decl call. + (implicitly_declare_fn): Use set_linkage_according_to_type. + * optimize.c (maybe_clone_body): Use FOR_EACH_CLONE. + * pt.c (instantiate_class_template): Don't redundantly add classes + to keyed_classes. Don't call repo_template_used. + (tsubst_decl): Set DECL_INTERFACE_KNOWN for instantiations of + templates with internal linkage. + (check_instantiated_args): Adjust call to no_linkage_check. + (instantiate_template): Use FOR_EACH_CLONE. + (mark_definable): New function. + (mark_decl_instantiated): Use it. + (do_decl_instantiation): Adjust tests for explicit instantiation + after "extern template". + (instantiate_class_member): Do not use repo_template_instantiated. + (do_type_instantiation): Simplify. + (instantiate_decl): Use mark_definable. Check repo_emit_p. + Simplify. + * repo.c (repo_get_id): Remove. + (original_repo): Remove. + (IDENTIFIER_REPO_USED): Remove. + (IDENTIFIER_REPO_CHOSEN): Remove. + Remove all #if 0'd code. + (repo_template_used): Remove. + (repo_template_instantiated): Remove. + (temporary_obstack_initialized_p): New variable. + (init_repo): Register with lang_post_pch_load. Avoid creating + identifiers unnecessarily. Don't use original_repo. Close the + file here. + (reopen_repo_file_for_write): Not here. + (finish_repo): Always write out a new repository file. + (repo_emit_p): New function. + (repo_export_class_p): Likewise. + * rtti.c (get_tinfo_decl): Use set_linkage_according_to_type. + (involves_incomplete_p): New function. + (tinfo_base_init): Use it. + (ptr_initializer): Remove non_public_ptr parameter. + (ptm_initializer): Likewise. + (get_pseudo_ti_init): Likewise. + (unemitted_tinfo_decl_p): Remove. + (emit_tinfo_decl): Use import_export_decl. + * semantics.c (expand_body): Move updates of static_ctors and + static_dtors to ... + (expand_or_defer_fn): ... here. + * tree.c (no_linkage_check): Add relaxed_p parameter. + +2004-07-28 Eric Christopher + + * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete. + +2004-07-28 Nathan Sidwell + + * cp-tree.h (struct tree_pair_s): New. + (typedef tree_pair_p): New. + (DEF_VEC_O(tree_pair_s)): New. + (struct lang_type_class): Make vcall_indices a VEC(tree_pair_s). + (CLASSTYPE_VCALL_INDICES): Update documentation. + * class.c (get_vcall_index): Adjust. + (add_vcall_offset): Adjust. + +2004-07-27 Kelley Cook + + * pt.c, typeck.c: Remove spurious carriage returns. + +2004-07-27 Kriang Lerdsuwanakij + + PR c++/14429 + * pt.c (coerce_template_template_parms) : Only check + when the type of ARG is not dependent. + +2004-07-26 Geoffrey Keating + + * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX. + (lang_specific_driver): If the C++ or math library options don't + start with '-l', don't count them as added libraries. + +2004-07-26 Nathan Sidwell + + * decl.c (xref_basetypes): Adjust base access vector creation. + * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Adjust base + access accesses. + * search.c (dynamic_cast_base_recurse, dfs_access_in_type): Likewise. + +2004-07-26 Niall Douglas + Brian Ryner + + PR c++/15000 + PR c++/9283 + * class.c (check_field_decls): Apply hidden visibility if + -fvisibility-inlines-hidden and inlined unless otherwise specified + (build_vtable): Set vtable visibility to class visibility. + (check_field_decls): Default static member visibility to class + visibility. + (check_methods): Default method visibility to class visibility. + * cp-tree.h: Added CLASSTYPE_VISIBILITY and + CLASSTYPE_VISIBILITY_SPECIFIED macro. + * decl.c (duplicate_decls): New logic for merging definition decls + with declaration decls. Added ignore & warning when non default + applied to global operator new or delete. + * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED + wherever VISIBILITY was changed + * rtti.c (get_tinfo_decl): Set typeinfo visibility to class + visibility. + (tinfo_base_init): Set typeinfo name visibility to class visibility. + +2004-07-25 Bernardo Innocenti + + * decl.c: Rename all identifiers named `class' to `cl'. + * cp-tree.h: Likewise. + +2004-07-25 Gabriel Dos Reis + + * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Use GGC_CNEW. + * typeck2.c (abstract_virtuals_error): Use GGC_NEW. + * name-lookup.c (binding_entry_make): Use GGC_NEW. + (binding_table_construct): Use GGC_CNEWVEC. + (binding_table_new): Use GGC_NEW. + (cxx_binding_make): Likewise. + (begin_scope): Likewise. + (push_to_top_level): Use GCC_CNEW. + * parser.c (cp_token_cache_new): Likewise. + (cp_token_cache_push_token): Likewise. + (cp_lexer_new_main): Likewise. + (cp_lexer_new_from_tokens): Likewise. + (cp_parser_context_new): Likewise. + (cp_parser_new): Likewise. + (cp_lexer_new_from_tokens): Use GGC_NEWVEC. + * lex.c (cxx_make_type): Use GGC_CNEW. + (retrofit_lang_decl): Use GGC_NEWVAR. + (cxx_dup_lang_specific_decl): Likewise. + (copy_lang_type): Likewise. + * decl.c (use_label): Use GGC_NEW instead of ggc_alloc. + (save_function_data): Likewise. + (lookup_label): Use GGC_CNEW instead of ggc_alloc_cleared. + (cxx_push_function_context): Likewise. + +2004-07-25 Richard Henderson + + * decl.c (start_preparsed_function): Set DECL_ARTIFICIAL and + DECL_IGNORED_P on RESULT_DECL. + * semantics.c (finalize_nrv): Copy them too. + +2004-07-23 Nathan Sidwell + + * search.c (lookup_conversion_operator): Avoid two loops. + (add_conversions): Remove. + (check_hidden_convs, split_conversions, + lookup_conversions_r): New. + (lookup_conversions): Use lookup_conversions_r. + +2004-07-22 Nathan Sidwell + + * pt.c (get_template_base): Check type is completable. + +2004-07-21 Eric Christopher + + * decl.c (poplevel): Inline unused variable checking. + Change formatting. + +2004-07-21 Paolo Bonzini + + * typeck.c (build_binary_op): Do not use RDIV_EXPR for + integer vectors. + +2004-07-21 Giovanni Bajo + + PR c++/14497 + * pt.c (check_explicit_specialization): Remove extension to accept + specializations without template headers. Fall-through to normal + processing. + +2004-07-21 Giovanni Bajo + + PR c++/509 + * pt.c (determine_specialization): New parameter template_count. + Disambiguate between member templates and member functions counting + the template headers. + (check_explicit_specialization): Update caller. + (tsubst_friend_function): Likewise. + +2004-07-20 Steven Bosscher + + * cp-tree.def (TINST_LEVEL): Make it an 'x' node. + * cp-tree.h (tinst_level_t): New tree type. + (union lang_tree_node): Handle it. + (TINST_LOCATION): New accessor macro. + (make_tinst_level): New prototype. + * cp-lang.c (cp_tree_size): Handle TINST_LEVEL. + * decl.c (cp_tree_node_structure): Likewise. + * error.c (print_instantiation_full_context): Use TINST_LOCATION. + (print_instantiation_partial_context): Likewise. + * pt.c (pop_tinst_level): Likewise. + (push_tinst_level): Use make_tinst_level. + * tree.c (make_tinst_level): New function. + (cp_walk_subtrees): Walk TINST_DECL for a TINST_LEVEL node. + +2004-07-20 Mark Mitchell + + * parser.c (cp_parser_simple_type_specifier): Fix typo. + + PR c++/16637 + * parser.c (cp_parser_simple_type_specifier): Do not record usage + of globally-qualified names. + +2004-07-20 Kriang Lerdsuwanakij + + PR c++/16175 + * error.c (dump_type) : Output + cv qualifier. + +2004-07-19 Mark Mitchell + + PR c++/16623 + * cp-tree.h (lang_type_class): Add lazy_assignment_op. + (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro. + * class.c (add_implicitly_declared_members): Use + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * method.c (lazily_declare_fn): Clear + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * search.c (lookup_fnfields_1): Check it. + +2004-07-20 Nathan Sidwell + + * cp-tree.h (vec_binfo_member): Remove. + * tree.c (vec_binfo_member): Remove. + + * cp-tree.h (struct lang_type_class): Remove vfields field. + (CLASSTYPE_VFIELDS): Remove. + (SET_BINFO_NEW_VTABLE_MARKED): Adjust. + * class.c (determine_primary_base): Remove CLASSTYPE_VFIELDS + handling. + (dfs_modify_vtables): Use TYPE_CONTAINS_VPTR_P. + (finish_struct_1): Remove CLASSTYPE_VFIELDS handling. + * init.c (dfs_initialize_vtbl_ptrs): Use TYPE_CONTAINS_VPTR_P. + +2004-07-20 Nathan Sidwell + + * cp-tree.h (DEF_VEC_P(tree)): Remove here. + (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): + Moved to common. + (BINFO_LANG_SLOTS): Remove. + * tree.c (copy_binfo): Adjust BINFO creation and accessors. + * decl.c (xref_basetypes): Adjust BINFO creation and accessors. + * class.c (check_bases): Adjust BINFO accessors. + (determine_primary_base, finish_struct_bits, + maybe_warn_about_overly_private_class, warn_hidden, + walk_subobject_offsets, propagate_binfo_offsets, end_of_class, + warn_about_ambiguous_bases, get_vfield_name, + dump_class_hierarchy_r, build_vtt_inits, accumulate_vtbl_inits, + add_vcall_offset_vtbl_entries_r): Likewise. + * dump.c (cp_dump_tree): Likewise. + * init.c (sort_mem_initializers, expand_member_init, build_delete, + push_base_cleanups): Likewise. + * method.c (do_build_copy_constructor, do_build_assign_ref, + synthesize_exception_spec): Likewise. + name-lookup.c (arg_assoc_class): Likewise. + * pt.c (instantiate_class_template, + get_template_base_recursive): Likewise. + * rtti.c (get_pseudo_ti_init, get_pseudo_ti_desc): Likewise. + * typeck2.c (process_init_constructor): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + dfs_access_in_type, dfs_walk_real, look_for_overrides, + types_overlap_p, copied_binfo, original_binfo): Likewise. + (binfo_for_vtable): Remove + +2004-07-20 Steven Bosscher + + * cp-tree.h (struct lang_decl_flags): Unify the template_info and + thunk_alias, and the access and virtual_offset fields. + (THUNK_VIRTUAL_OFFSET, THUNK_ALIAS): Adjust. + * decl.c (finish_case_label): Update c_add_case_node call. + +2004-07-19 Mark Mitchell + + Revert patch for PR c++/16623. + +2004-07-19 Kelley Cook + + * except.c: Remove two spurious carriage returns. + +2004-07-19 Mark Mitchell + + PR c++/16623 + * cp-tree.h (lang_type_class): Add lazy_assignment_op. + (CLASSTYPE_LAZY_ASSIGNMENT_OP): New macro. + * class.c (add_implicitly_declared_members): Use + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * method.c (lazily_declare_fn): Clear + CLASSTYPE_LAZY_ASSIGNMENT_OP. + * search.c (lookup_fnfields_1): Check it. + +2004-07-19 Nathan Sidwell + + * class.c (add_method): Delay adding the slot until the end. + (determine_primary_base): Adjust VEC_iterate invokation. + (resort_type_method_vec, finish_struct_methods, warn_hidden, + walk_subobject_offsets, end_of_class, warn_about_ambiguous_bases, + build_vtbl_initializer): Likewise. + * init.c (sort_mem_initializers, build_delete, push_base_cleanups, + build_vbase_delete): Likewise. + * method.c (do_build_copy_constructor): Likewise. + * name-lookup.c (new_class_binding, print_binding_level, + poplevel_class, store_class_bindings, push_to_top_level, + pop_from_top_level): Likewise. + * pt.c (check_explicit_specialization): Likewise. + * search.c (lookup_conversion_operator, lookup_fnfields_1, + get_pure_virtuals, add_conversions, dfs_check_overlap, + binfo_for_vbase): Likewise. + +2004-07-19 Kriang Lerdsuwanakij + + PR c++/12170 + * pt.c (unify) : Use only + innermost set of template arguments during deduction. Simplify. + +2004-07-19 Joseph S. Myers + + * typeck.c (build_modify_expr, build_x_modify_expr): Set + TREE_NO_WARNING on assignments with an operator other than '='. + +2004-07-10 Steven Bosscher + Joseph S. Myers + + * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove. + * decl2.c (grokfield): Don't check current_class_depth via + unused TREE_COMPLEXITY. + * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING + to avoid the missing parentheses warning. + Don't set C_SET_EXP_ORIGINAL_CODE. + +2004-07-18 Mark Mitchell + + * tree.c (no_linkage_helper): Remove. + (no_linkage_check): Don't use walk_tree_without_duplicates. + + * mangle.c (write_expression): Issue a sorry for zero-operand + functional casts. + +2004-07-18 Kriang Lerdsuwanakij + + PR c++/13092 + * init.c (build_offset_ref): Build SCOPE_REF with non-null + TREE_TYPE for non-dependent names. + * typeck.c (build_x_unary_op): Handle non-dependent SCOPE_REF. + * pt.c (type_dependent_expression_p): Handle SCOPE_REF with + unknown_type_node as its TREE_TYPE. + * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. + * error.c (dump_decl) : Use pp_expression. + (dump_expr) : Likewise. + +2004-07-17 Jason Merrill + + PR c++/16115 + * call.c (type_passed_as): Make the invisible reference type + __restrict. + * cp-gimplify.c (gimplify_cleanup_stmt): Rename to + cp_genericize_r. Handle invisible reference lowering. + (is_invisiref_parm): New fn. + (cp_genericize): Adjust the types of invisible reference parms. + Don't repeat the walk for clones. + * decl.c (store_parm_decls): Don't generate any code for clones. + +2004-07-17 Joseph S. Myers + + * cp-tree.h (builtin_function): Declare. + +2004-07-16 Mark Mitchell + + * class.c (finish_struct_methods): Remove unncessary code. + (add_implicitly_declared_members): Create declarations for default + constructors and copy constructors lazily. + * cp-tree.h (lang_type_class): Remove lazy_default_ctor and + lazy_copy_ctor. + (CLASSTYPE_LAZY_DEFAULT_CTOR): New macro. + (CLASSTYPE_LAZY_COPY_CTOR): Likewise. + * decl2.c (check_classfn): Robustify. + (locate_dtor): Handle empty CLASSTYPE_METHOD_VEC. + (locate_ctor): Handle lazy default constructors. + (locate_copy): Handle lazy copy constructors. + (implicitly_declare_fn): Make sure we're looking at the + TYPE_MAIN_VARIANT for a class before creating functions. Don't + set TYPE_HAS_CONSTRUCTOR. + (lazily_declare_fn): New function. + * name-lookup.c (constructor_name_full): Simplify. + * search.c (lookup_fnfields_1): Lazily create methods, as + necessary. + (lookup_for_overrides): Handle empty CLASSTYPE_METHOD_VEC. + +2004-07-16 Steven Bosscher + + * cp-tree.h (struct lang_type): Don't have three GTY options on a + single bit GTY desc. + +2004-07-16 Richard Henderson + + * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die. + * cp-tree.h (cp_copy_res_decl_for_inlining): Remove. + * tree.c (cp_copy_res_decl_for_inlining): Remove. + +2004-07-16 Nathan Sidwell + + * class.c (finish_struct_bits): Use for loop. + (propagate_binfo_offsets): Do primary binfo outside of loop. + + PR c++/16583 + * dump.c (cp_dump_tree): Don't dump the bases if there's no + binfo. + + * pt.c (tsubst) : We should never get here. + +2004-07-15 Mark Mitchell + + * cp-tree.h (lang_type_class): Remove has_real_assign_ref and + has_abstract_assign_ref. Make methods a VEC(tree) *. + (TYPE_HAS_CONST_ASSIGN_REF): Add documentation. + (CLASSTYPE_CONSTRUCTORS): Adjust for changes to CLASSTYPE_METHOD_VEC. + (CLASSTYPE_DESTRUCTORS): Likewise. + (TYPE_HAS_REAL_ASSIGN_REF): Remove. + (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise. + (add_method): Change prototoype. + * class.c (add_method): Remove error_p parameter. Adjust for + changes to CLASSTYPE_METHOD_VEC. + (handle_using_decl): Adjust call to add_method. + (maybe_warn_about_overly_private_class): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (resort_type_method_vec): Likewise. + (finish_struct_methods): Likewise. + (check_for_override): Likewise. + (warn_hidden): Likewise. + (add_implicitly_declared_members): Defer creation of assignment + operators. Adjust call to add_method. + (clone_function_decl): Adjust call to add_method. + (check_bases_and_members): Don't set TYPE_HAS_REAL_ASSIGN_REF. + (finish_struct_1): Use CLASSTYPE_DESTRUCTORS. + * decl.c (grok_special_member_properties): Don't set + TYPE_HAS_ABSTRACT_ASSIGN_REF. + * decl2.c (check_classfn): Adjust for + changes to CLASSTYPE_METHOD_VEC. + * method.c (locate_dtor): Use CLASSTYPE_DESTRUCTORS. + (locate_ctor): Use CLASSTYPE_CONSTRUCTORS. + (locate_copy): Adjust for changes to CLASSTYPE_METHOD_VEC. + (implicitly_declare_fn): Set DECL_SOURCE_LOCATION. Do not call + cp_finish_decl. + * pt.c (check_explicit_specialization): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (instantiate_class_template): Do not set + TYPE_HAS_ABSTRACT_ASSIGN_REF. + * ptree.c (cxx_print_type): Don't try to print + CLASSTYPE_METHOD_VEC. + * rtti.c (emit_support_tinfos): Use CLASSTYPE_DESTRUCTORS. + * search.c (lookup_field_r): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (lookup_fnfields): Likewise. + (lookup_conversion_operator): Likewise. + (lookup_fnfields_1): Likewise. Create assignment operators + lazily. + (look_for_overrides_here): Adjust for + changes to CLASSTYPE_METHOD_VEC. + (add_conversions): Likewise. + * semantics.c (finish_member_declaration): Adjust call to add_method. + +2004-07-15 Jason Merrill + + * cp-lang.c (cxx_types_compatible_p): To the middle-end, + references and pointers are compatible. + +2004-07-15 Nathan Sidwell + + * decl.c (xref_basetypes): Refactor. + * tree.c (copy_base_binfos): Replace with ... + (copy_binfo): ... this. Deep copy the given binfo, (not the just + bases of the given base). + * cp-tree.h (copy_base_binfo): Remove. + (copy_binfo): Declare. + +2004-07-15 Mark Mitchell + + * name-lookup.c (set_inherited_value_binding_p): Add class_type + parameter. + (get_class_binding): Adjust. + (push_class_level_binding): Don't use set_inherited_value_binding_p. + +2004-07-15 Nathan Sidwell + + * class.c (finish_struct_bits): Don't set TYPE_HAS_CONVERSION here. + * decl.c (xref_basetypes): Set it here. + + * class.c (check_bases): Don't set CLASSTYPE_NON_AGGREGATE here. + Don't check for incomplete base. + (get_vfield_name): Simplify while loop. + * decl.c (xref_basetypes): Set CLASSTYPE_NON_AGGREGATE here. + +2004-07-14 Mark Mitchell + + * lex.c (cxx_make_type): Remove call to get_pointer_type. + + * cp-tree.h (IDENTIFIER_VALUE): Remove. + (BINFO_PUSHDECLS_MARKED): Likewise. + (maybe_inject_for_scope_var): Likewise. + (push_class_decls): Likewise. + * name-lookup.h (push_class_binding): Remove. + (innermost_non_namespace_value): New function. + (outer_binding): Likewise. + * class.c (add_method): Push bindings before adding to + TYPE_METHODS. + (restore_class_cache): Do not restore class_shadowed. + (pushclass): Do not add USING_DECLs. Do not call + push_class_decls. + * config-lang.in (gtfiles): Remove $(srcdir)/cp/search.c. + * decl.c (pushdecl): Use outer_binding. + (poplevel): Set the scope for an out-of-scope for-loop declaration + appropriately. + (cp_finish_decl): Don't call maybe_inject_for_scope_var. + * name-lookup.c (new_class_binding): New function. + (push_binding): Use it. + (pushdecl): Use innermost_non_namespace_value. + (maybe_inject_for_scope_var): Remove. + (push_class_binding): Remove. + (set_inherited_value_binding_p): New function. + (get_class_binding): New function. + (push_class_level_binding): Assert that the current_class_type is + being defined. + (outer_binding): New function. + (innermost_non_namespace_value): Likewise. + (lookup_name_real): Use outer_binding. + (lookup_name_current_level): Ignore out-of-scope variables. + * pt.c (check_template_shadow): Use innermost_non_namespace_value. + (lookup_template_class): Likewise. + * search.c (dfs_push_type_decls): Remove. + (dfs_push_decls): Likewise. + (setup_class_bindings): Likewise. + (lookup_field_1): Handle USING_DECLs from dependent scopes. + (marked_pushdecls_p): Remove. + (unmarked_pushdecls_p): Remove. + (marked_identifiers): Remove. + (setup_class_bindings): Remove. + (dfs_push_type_decls): Remove. + (dfs_push_decls): Remove. + (push_class_decls): Remove. + +2004-07-13 Mark Mitchell + + PR c++/16518 + PR c++/16337 + * decl.c (grokvardecl): Make declspecs parameter const. + (grokdeclarator): Likewise. Adjust accordingly. + * decl.h (grokdeclarator): Adjust declaration. + * parser.c (cp_parser_init_declarator): Do not clear + decl_specifiers->attributes. + + * cp-tree.h (lang_identifier): Remove class_value. + (IDENTIFIER_CLASS_VALUE): Remove. + (pop_class_decls): Likewise. + (init_search_processing): Likewise. + * class.c (handle_using_decl): Use lookup_member, not + IDENTIFIER_CLASS_VALUE. + (restore_class_cache): New function, split out from ... + (pushclass): ... here. Do not call clear_identifier_class_values. + (invalidate_class_lookup_cache): Do not clear + IDENTIFIER_CLASS_VALUE. + (popclass): Do not call pop_class_decls. + (maybe_note_name_used_in_class): Do not save names looked up after + the class is complete. Use lookup_member, not + IDENTIFIER_CLASS_VALUE. + * config-lang.in (gtfiles): Add $(srcdir)/cp/search.c. + * decl.c (cxx_init_decl_processing): Do not call + init_search_processing. + * method.c (do_build_copy_constructor): Remove unnecessary code. + (do_build_assign_ref): Likewise. + * name-lookup.c (pushdecl): Use lookup_member, not + IDENTIFIER_CLASS_VALUE. + (set_identifier_type_value_with_scope): Set TREE_TYPE on the + type_shadowed list. + (poplevel_class): Do not restore IDENTIFIER_CLASS_VALUE. + (push_class_binding): Do not set it. + (clear_identifier_class_values): Remove. + (push_class_level_binding): Do not set IDENTIFIER_CLASS_VALUE. + (store_binding): Do not save it. + (pop_from_top_level): Do not restore it. + * name-lookup.h (cxx_saved_binding): Remove class_value. + (clear_identifier_class_values): Remove. + * ptree.c (cxx_print_identifier): Do not print + IDENTIFIER_CLASS_VALUE. + * search.c (search_obstack): Remove. + (push_stack_level): Remove. + (pop_stack_level): Remove. + (search_level): Remove. + (search_stack): Remove. + (lookup_member): Don't check IDENTIFIER_CLASS_VALUE. + (setup_class_bindings): Use IDENTIFIER_MARKED, not + IDENTIFIER_CLASS_VALUE. + (marked_identifiers): New variable. + (push_class_decls): Clear IDENTIFIER_MARKED. + (pop_class_decls): Don't call pop_search_level. + (init_search_processing): Remove. + +2004-07-12 Mark Mitchell + + * cp-tree.h (get_aggr_typedef): Remove. + * init.c (get_aggr_typedef): Likewise. + + * name-lookup.c (push_class_level_binding): Simplify. + +2004-07-12 Andrew Pinski + + PR c++/16475 + Revert: + 2004-07-07 H.J. Lu + PR c++/16276 + * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo + is not public. + +2004-07-12 Eric Christopher + + * parser.c (cp_parser_class_head): Remove unused variable. + +2004-07-12 Giovanni Bajo + + * decl.c (grok_op_properties): Reject [de-]allocation functions + declared in a namespace, or declared as static. + +2004-07-12 Nathan Sidwell + + * cp-tree.h (make_binfo): Remove. + * decl.c (xref_basetypes): Use make_tree_binfo directly. + * tree.h (copy_base_binfos): Likewise. + (make_binfo): Remove. + + * call.c (build_user_type_conversion_1, build_new_op, + check_constructor_callable, build_temp, + perform_direct_initialization_of_possible): Pass type directly to + lookup_fnfields & build_special_member_call. + (build_special_member_call): Accept a type, and complete it. + * class.c (finish_stuct_bits): Copy the BINFOs here. + * cvt.c (ocp_convert): Pass type directly to + build_special_member_call. + * decl.c (build_ptrmemfunc_type): Call xref_bastypes here. + (xref_basetypes): Allocate the binfo here. Adjust. + * init.c (build_init, build_new_1): Pass type directly to + build_special_member_call. + * lex.c (cxx_make_type): Do not allocate binfo here. + * name-lookup.c (arg_assoc_class): Incomplete types have no binfo. + * parser.c (cp_parser_class_head): Always call xref_basetypes. + * pt.c (instantiate_class_template): Likewise. Inhibit access + checking for template friends. + * ptree.c (cxx_print_type): Adjust record printing. + * search.c (lookup_base): When taking a type, complete it before + looking for a binfo. + (lookup_member): Delay completing a type. + (push_class_decls): Don't walk an incomplete type. + (lookup_conversions): Likewise. + * semantics.c (finish_stmt_expr_expr): Pass type directly to + build_special_member_call. + * tree.c (copy_base_binfos): Adjust. + (make_binfo): Likewise. + * typeck.c (build_modify_expr): Pass type directly to + build_special_member_call. + * typeck2.c (process_init_constructor): Check a binfo exists. + (build_m_component_ref): Allow accessing an incomplete type. + (build_functional_cast): Pass type directly to + build_special_member_call. + +2004-07-12 Giovanni Bajo + + PR c++/2204 + * config-lang.in (gtfiles): Add typeck2.c. + * Make-lang.in: Tweak typeck2.c dependencies, and add rule for + gt-cp-typeck2.h. + * cp-tree.h: Declare complete_type_check_abstract. + * typeck2.c (pat_calc_hash, pat_compare, + complete_type_check_abstract): New functions. + (abstract_virtuals_error): If the type is abstract, register the + declaration within abstract_pending_vars for further checks. + Inspect also dependent types. Handle IDENTIFIER_NODEs as decl. + * decl.c (cp_finish_decl): Do not strip array types. + (create_array_type_for_decl): Check for abstractness of the element + type. + (complete_vars): Call complete_type_check_abstract. + * class.c (finish_struct): Prepare a list of virtual functions for + template types, and call complete_vars on it to check for abstractness. + +2004-07-12 Paolo Bonzini + + PR tree-optimization/14107 + * decl.c (finish_function): Remove temporary band-aid. + +2004-07-11 Mark Mitchell + + * call.c (build_operator_new_call): Avoid using push_to_top_level. + (build_new_op): Adjust call to lookup_function_nonclass. + * name-lookup.c (identifier_type_value): Adjust call to + lookup_name_real. + (lookup_name_real): Add block_p parameter. + (lookup_name_nonclass): Adjust call to lookup_name_real. + (lookup_function_nonclass): Likewise. + (lookup_name): Likewise. + * name-lookup.h (lookup_name_real): Change prototype. + (lookup_name_nonclass): Likewise. + * parser.c (cp_parser_lookup_name): Likewise. + + * cp-tree.h (saved_scope): Make old_bindings a vector. + (unuse_fields): Remove. + * name-lookup.h (cxx_saved_binding): Define it. + * class.c (pushclass): Don't use unuse_fields. + * name-lookup.c (cxx_saved_binding_make): Remove. + (store_binding): Add new bindings to a vector, using an + accumulator style, rather than adding them to a list. + (store_bindings): Adjust accordingly. + (store_class_bindings): Likewise. + (push_to_top_level): Likewise. + (pop_from_top_level): Likewise. + * optimize.c (maybe_clone_body): Must push_to_top_level and + pop_from_top_level calls outside of loop. + * parser.c (cp_parser_class_specifier): Move push_scope/pop_scope + calls here from cp_parser_late_parsing_default_args. + (cp_parser_save_default_args): Record the class type in which the + function is declared. + (cp_parser_late_parsing_default_args): Do not call + push_nested_class/pop_nested_class. + * search.c (dfs_unuse_fields): Remove. + (unuse_fields): Remove. + +2004-07-11 Joseph S. Myers + + * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP, LANG_HOOKS_PUSHLEVEL, + LANG_HOOKS_POPLEVEL, LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Remove. + * cp-tree.h (poplevel): Declare. + (set_block): Remove. + * decl.c (set_block): Remove. + +2004-07-10 Mike Stump + + * decl2.c (import_export_class): Never export/import vtables + with inline key functions. + +2004-07-09 Steven Bosscher + + * typeck.c (c_expand_asm_operands): Remove. + +2004-07-09 Mike Stump + + * typeck.c (build_class_member_access_expr): Skip null deref + warning when we don't dereference it. + +2004-07-09 Giovanni Bajo + + PR c++/8211 + PR c++/16165 + * class.c (check_field_decls): Improve -Weffc++ warning: do not + warn for pointers to functions/members, or for classes without + destructors. + +2004-07-08 Mark Mitchell + + * name-lookup.h (struct cp_binding_level): Update documentation + for class_shadowed. + +2004-07-08 Giovanni Bajo + + PR c++/16169 + * typeck.c (check_return_expr): Improve -Weffc++ warning: handle + returning CALL_EXPR, and non-reference return type. + +2004-07-08 Nathan Sidwell + + * name-lookup.c (push_binding): Use VEC_reserve. + +2004-07-08 Richard Henderson + + * cp-tree.h (expand_eh_spec_block): Remove. + +2004-07-07 Mark Mitchell + + * cp-tree.h (saved_scope): Remove x_previous_class_type and + x_previous_class_values; add x_previous_class_level. + (previous_class_type): Remove. + (previous_class_values): Remove. + (previous_class_level): New macro. + * class.c (pushclass): Restore the identifier cache more + expeditiously. + (invalidate_class_lookup_cache): Use vector for class_shadowed and + previous_class_values. + * decl.c (poplevel): Likewise. + * name-lookup.c (cxx_binding_init): New function. + (cxx_binding_make): Use it. + (push_binding): For a binding in a class level, use a vector of + cp_class_binding nodes. + (push_binding_level): New function. + (begin_scope): Use it. + (leave_scope): Do not put class binding levels on the free list. + (print_binding_level): Adjust for the fact that class_shadowed is + a vector. + (poplevel_class): Likewise. + (clear_identifier_class_values): Likewise. + (push_class_level_binding): Likewise. + (set_class_shadows): Remove. + (store_binding): New function. + (store_class_bindings): New function. + (push_to_top_level): Use store_class_bindings as appropriate. + (pop_from_top_level): Use previous_class_level, not + previous_class_type. + * name-lookup.h (cp_class_binding): New type. + (cp_binding_level): Use a vector object for class_shadowed. + (push_binding_level): Declare. + (set_class_shadows): Remove. + +2004-07-07 Andrew Pinski + + * class.c (instantiate_type): BUFFER_REF is dead. + * lex.c (init_operators): IN_EXPR is dead. + +2004-07-07 Jason Merrill + + PR c++/16334 + * call.c (build_new_op): Give overload warnings for built-in + candidates. + +2004-07-07 H.J. Lu + + PR c++/16276 + * rtti.c (emit_tinfo_decl): Turn off DECL_ONE_ONLY if typeinfo + is not public. + +2004-07-07 Nathan Sidwell + + * cp-tree.h (CLASSTYPE_N_BASECLASSES): Remove. + * class.c (build_primary_vtable, check_bases, + determine_primary_base, finish_struct_bits, + maybe_warn_about_overly_private_class, dfs_find_final_overrider_q, + get_basefndecls, warn_hidden, walk_subobject_offsets, + build_base_fields, create_vtable_ptr, propagate_binfo_offsets, + layout_virtual_bases, end_of_class, warn_about_ambiguous_bases, + finish_struct_1, get_vfield_name, contains_empty_class_p, + dump_class_hierarchy_r, finish_vtbls, build_vtt_inits, + dfs_ctor_vtable_bases_queue_p, accumulate_vtbl_inits, + add_vcall_offset_vtbl_entries_r, cp_fold_obj_type_ref): Adjust + BINFO macros. + * decl.c (xref_basetypes): Likewise. + * dump.c (cp_dump_tree): Likewise. + * error.c (dump_expr): Likewise. + * init.c (sort_mem_initializers, expand_member_init, + push_base_cleanups): Likewise. + * method.c (do_build_copy_constructor, do_build_assign_reg, + synthesize_exception_spec): Likewise. + * name-lookup.c (arg_assoc_class): Likewise. + * pt.c (instantiate_class_template, tsubst, + get_template_base_recursive): Likewise. + * ptree.c (cxx_print_type): Likewise. + * rtti.c (get_psuedo_ti_init, get_pseudo_ti_desc): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + dfs_access_in_type, access_in_type, lookup_field_queue_p, + bfs_walk, dfs_walk_real, look_for_overrides, markedp, unmarkedp, + marked_pushdecls_p, unmarked_pushdecls_p, dfs_debug_markedp, + dfs_debug_unmarkedp, dfs_check_overlap, dfs_no_overlap_yet, + binfo_for_vtable, copied_binfo, original_binfo): Likewise + * tree.c (copy_base_binfos, make_binfo): Likewise. + * typeck.c (commmon_base_type): Likewise + * typeck2.c (process_init_constructor): Likewise + +2004-07-06 Joseph S. Myers + + * decl.c (check_tag_decl): Name redeclared type in diagnostic. + +2004-07-06 Giovanni Bajo + + PR c++/3671 + * pt.c (convert_nontype_argument): Disallow conversions between + different enumeration types. + +2004-07-06 Nathan Sidwell + + * cp-tree.h (BINFO_MARKED): Remove. + (BINFO_VTABLE_PATH_MARKED, BINFO_NEW_VTABLE_MARKED, + BINFO_DEPENDENT_BASE_P, BINFO_LOST_PRIMARY_P, + BINFO_INDIRECT_PRIMARY_P): Use appropriate BINFO_FLAG_n. + (SET_BINFO_NEW_VTABLE_MARKED): Use BINFO_VIRTUAL_P. + * class.c (build_base_path): Use BINFO_VIRTUAL_P. + (mark_primary_bases, determine_primary_base, base_derived_from, + dfs_find_final_overrider, dfs_find_final_overrider_q, + dfs_find_inal_overrider_post, update_vtable_entry_for_fn, + dfs_modify_vtables, walk_subobject_offsets, + layout_nonempty_base_or_field, build_base_field, + build_base_fields, propagate_binfo_offsets, layout_virtual_bases, + end_of_class, get_vfield_name, dump_class_hierarchy, dump_vtable, + finish_vtbls, build_vtt_inits, dfs_build_secondary_vptr_vtt_inits, + build_ctor_vtbl_group, accumulate_vtble_inits, + dfs_accumulate_vtbls_inits, build_vbase_offset_vtbl_entries, + build_vcall_offset_vtbl_entries, add_vcall_offset_vtbl_entries_r, + add_vcall_offset_vtbl_entries_1): Likewise. + * decl.c (xref_basetypes): Incomming virtual base indicated by + TREE_TYPE. Adjust. + * dump.c (cp_dump_tree): Use BINFO_VIRTUAL_P. + * init.c (finish_init_stmts, sort_mem_initializers, + emit_mem_initializers, build_vtble_address, expand_member_init, + push_base_cleanups): Likewise. + * method.c (do_build_copy_constructor): Likewise. + * pt.c (instantiate_class_template, + get_template_base_recursive): Likewise. + * rtti.c (dfs_class_hint_mark, get_pseudo_ti_init, + get_pseudo_ti_desc): Likewise. + * search.c (lookup_base_r, dynamic_cast_base_recurse, + binfo_from_vbase, binfo_via_virtual, copied_binfo, + original_binfo): Likewise. + * semantics.c (finish_base_specifier): Virtualness is indicated + by TREE_TYPE. + * tree.c (copy_base_binfos): Use BINFO_VIRTUAL_P. + +2004-07-06 Mark Mitchell + + Revert: + 2004-06-24 Jason Merrill + PR c++/16115 + * decl.c (grokparms): Give the PARM_DECL reference type if the + parameter is passed by invisible reference. + +2004-07-05 Richard Kenner + + * cp-lang.c (cp_var_mod_type_p): Add extra arg. + * decl.c (grokdeclarator): Extra arg to variably_modified_type_p. + * pt.c (check_instantiated_args, unify): Likewise. + +2004-07-05 Phil Edwards + + * Make-lang.in (check-c++, lang_checks): Add some comments. + +2004-07-05 Zack Weinberg + + * cp-mudflap.c: Delete file. + * Makefile.in: Remove all references to cp-mudflap.o. + +2004-07-05 Zack Weinberg + + * decl.c (cxx_init_decl_processing): Call + build_common_tree_nodes before creating the global NAMESPACE_DECL. + +2004-07-05 Giovanni Bajo + + PR c++/2518 + * call.c (build_operator_new_call): Look only at global scope. + +2004-07-05 Nathan Sidwell + + * call.c (enforce_access): Expect TREE_BINFO. + * class.c (binfo_ctor_vtable): Check TREE_BINFO. + * cp-tree.h (RECORD_OR_UNION_TYPE_CHECK): Remove. + (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, BINFO_PRIMARY_BASE_OF): + Adjust. + (BINFO_LANG_ELTS): Remove. + (BINFO_LANG_SLOTS): New. + (TYPE_RAISES_EXCEPTIONS, ENUM_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1. + (CLASSTYPE_TEMPLATE_INFO): Adjust. + * pt.c (tsubst): Split TREE_BINFO case from TREE_VEC case. + * search.c (lookup_member): Check TREE_BINFO. + * semantics.c (perform_or_defer_access_check): Likewise. + (check_accessibility_of_qualified_id): Check + deferred_access_no_check. + * tree.c (make_binfo): Use make_tree_binfo. + +2004-07-04 Mark Mitchell + + * method.c (implicitly_declare_fn): Set linkage of generated + functions. + +2004-07-04 Richard Henderson + + * typeck.c (cxx_mark_addressable): Don't put_var_into_stack. + +2004-07-03 Scott Brumbaugh + + PR c++/3761 + * name-lookup.c (push_class_level_binding): Don't pass a + TREE_LIST of ambiguous names to check_template_shadow as it + only handles declarations. Instead, pull the declaration + out and pass that. + +2004-07-03 Giovanni Bajo + + PR c++/14971 + * pt.c (check_explicit_specialization): Clarify error message. + +2004-07-02 Richard Henderson + + * tree.c (cp_unsave_r): Update remap_save_expr call. + +2004-07-02 Mark Mitchell + + PR c++/16240 + * mangle.c (write_template_arg): Correct mangling. + + PR c++/16297 + * decl.c (grokdeclarator): Robustify. + +2004-07-01 Richard Henderson + + * class.c (fixed_type_or_null): Don't handle RTL_EXPR. + * method.c (synthesize_method): Don't clear_last_expr. + * name-lookup.c (maybe_push_cleanup_level): Likewise. + +2004-07-01 Nick Clifton + + * decl2.c (import_export_class): Invoke the + import_export_class field in the gcc_target structure if it is not + empty. + +2004-06-30 Richard Henderson (rth@redhat.com> + + * decl.c (start_preparsed_function): Don't set immediate_size_expand. + * method.c (use_thunk): Likewise. + +2004-06-30 Joseph S. Myers + + * call.c (build_over_call), typeck.c (build_function_call): Call + check_function_arguments instead of check_function_format. + +2004-06-30 Joseph S. Myers + + * call.c (build_over_call), typeck.c (build_function_call): Update + calls to check_function_format. + +2004-06-30 Richard Henderson + + * call.c (build_over_call): Use __builtin_memcpy for copying + CLASS_AS_BASE rather than funny casting. + +2004-06-30 Richard Henderson + + * init.c (build_new_1): Fill in TYPE_DOMAIN, TYPE_SIZE and + TYPE_SIZE_UNIT of full_type. + +2004-06-30 Per Bothner + + Conditionally compile support for --enable-mapped_location. + * decl.c (pop_label): Handle (imperfectly) USE_MAPPED_LOCATION case. + * decl2.c: If USE_MAPPED_LOCATION, don't do some line number + adjustments - which I don't understand. + * error.c (dump_decl): Rename "" to "". + * error.c: Use LOCATION_FILE and EXPR_LOCATION macros. + (print_instantiation_partial_context): Use expand_location. + * decl.c (duplicate_decl): Use new DECL_IS_BUILTIN macro. + * name-lookup.c: Likewise. + * lex.c (cxx_init): Likewise. Also use BUILTINS_LOCATION. + * name-lookup.c: Use input_line macro. + * parser.c (cp_lexer_get_preprocessor_token): Use UNKNOWN_LOCATION. + (cp_parser_statement): Rename locaal variable statement_locus to + statement_location and use SET_EXPR_LOCATION macro. + * pt.c: Handle USE_MAPPED_LOCATION case. Use new macros. + * tree.c (cp_walk_subtrees): Likewise. + +2004-06-29 Per Bothner + + * tree.c (build_min_nt, build_min, build_min_non_dep): + Don't set TREE_COMPLEXITY from input_line. + +2004-06-29 Paul Brook + + * init.c: Include target.h. + (get_cookie_size): Remove and replace with target hook. + Update callers. + (build_new_1): Store the element size in the cookie. + +2004-06-29 Nathan Sidwell + + PR c++/16260 + * parser.c (cp_parser_template_declaration_after_export): Disable + access checks here ... + (cp_parser_class_specifier): ... not here. + +2004-06-28 Nathan Sidwell + + * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK, + VAR_FUNCTION_OR_PARM_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK, + BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Use appropriate + TREE_CHECK macro. + +2004-06-28 Nathan Sidwell + + * cp-tree.h (struct deferred_access): Move to ... + * semantics.c (struct deferred_access): ... here. Adjust. + (deferred_access_stack): Make a VEC(deferred_access), + (deferred_access_free_list): Remove. + (deferred_access_no_check): New. + (push_deferring_access_checks, resume_deferring_access_checks, + stop_deferring_access_checks, pop_deferring_access_checks, + get_deferred_access_checks, pop_to_parent_deferring_access_checks, + perform_deferred_access_checks, perform_or_defer_access_check): Adjust. + +2004-06-28 Nathan Sidwell + + PR c++/16174 + * call.c (build_temp): Declare. + (check_constructor_callable): New. + (reference_binding): Only set CHECK_COPY_CONSTRUCTOR if not for + CONSTRUCTOR_CALLABLE. + (convert_like_real, initialize_reference): Use + check_constructor_callable. + * cp-tree.h (LOOKUP_CONSTRUCTOR_CALLABLE): New. + (LOOKUP_*): Renumber. + +2004-06-28 Nathan Sidwell + + * friend.c (add_friend): Only perform access checks when context + is a class. + * lex.c (cxx_make_type): Only create a binfo for aggregate types. + * parser.c (cp_parser_class_specifier): Disable access checks here + when parsing the body of a templated class. + * semantics.c (perform_or_defer_access_checks): Reorder to allow + NULL binfos when not checking access. + +2004-06-28 Nathan Sidwell + + Use vector API for vbase list. + * cp-tree.h: Include vec.h + (DEF_VEC_P (tree)): New type. + (struct lang_type_class): Change vbase's member type. + (binfo_for_vbase): Declare. + * class.c (determine_primary_base, base_derived_from, + update_vtable_entry_for_fn, walk_subobject_offsets, end_of_class, + warn_about_ambiguous_bases, dfs_accumulate_vtbl_inits, + build_vtbl_initializer): Adjust. + * decl.c (xref_basetypes): Adjust, accumulate upper bound of + vbases. + * init.c (sort_mem_initializers, expand_member_init, + push_base_cleanups): Adjust. + * method.c (do_build_copy_constructor): Adjust. + * search.c (get_pure_virtuals, copied_binfo, original_binfo): Adjust. + (binfo_for_vbase): New. + * tree.c (copy_base_binfos): Adjust. + +2004-06-28 Mark Mitchell + + * parser.c (cp_parser_set_decl_spec_type): Fix thinko. + +2004-06-27 Gabriel Dos Reis + + PR c++/14123 + * cxx-pretty-print.c (pp_cxx_ptr_operator): Properly put + paranthesis in case of pointers to array members. + * error.c (dump_type_prefix): Likewise. + (dump_type_suffix): Maybe issue a whitespace when printing + ARRAY_TYPE. + +2004-06-27 Mark Mitchell + + PR c++/16193 + * parser.c (cp_parser_set_decl_spec_type): Refine test for + redefinition of built-in types. + +2004-06-27 Gabriel Dos Reis + + * error.c (pp_template_argument_list_start): Remove. + (pp_template_argument_list_end): Likewise. + (pp_separate_with_comma): Use pp_cxx_separate_with. + (reinit_global_formatting_buffer): Remove. + (pp_non_consecutive_character): Likewise. + (dump_scope): Use pp_cxx_colon_colon. + (dump_template_parameter): Use pp_cxx_identifier, + pp_cxx_tree_identifier and pp_cxx_whitespace. + (dump_templat_bindings): Replace use of pp_string with sequence + of pp_cxx_whitespace and pp_equal. + (dump_type): Use pp_cxx_identifier, pp_cxx_tree_identifier, + pp_cxx_colon_colon, pp_cxx_whitespace throughout. Don't set + padding here. + (dump_aggr_type): Use pp_cxx_identifier amd pp_cxx_tree_identifier. + (dump_type_prefix): Don't set padding. Use pp_cxx_whitespace, + pp_cxx_left_parent, pp_cxx_colon_colon and pp_cxx_star troughout. + (dump_type_suffix): Use pp_cxx_right_paren, pp_cxx_left_bracket, + pp_cxx_right_bracket, pp_cxx_identifier throughout, + (dump_decl): Likewise. + (dump_template_decl): Likewise. + (dump_function_decl): Likewise. Set padding as appropriate. + (dump_parameters): Use pp_cxx_left_paren, pp_cxx_identifier and + pp_cxx_right_paren. + (dump_exception_spec): Likewise. + (dump_function_name): Use pp_cxx_tree_identifier and + pp_cxx_identifier. + (dump_template_parms): Use pp_cxx_begin_template_argument_list and + pp_cxx_end_template_argument_list. + (dump_expr): Use pp_cxx_left_paren, pp_cxx_right_paren, + pp_cxx_colon_colon, pp_cxx_identifier, pp_cxx_tree_identifier and + pp_cxx_whitespace throughout. + (dump_binary_op): Use pp_cxx_whitespace, pp_cxx_left_paren and + pp_cxx_right_paren. + (dump_unary_op): Likewise. + (reinit_cxx_pp): New function. + (type_as_string); Use it. + (expr_as_string): Likewise. + (decl_as_string); Likewise. + (context_as_string): Likewise. + (lang_decl_name): Likewise. + (decl_to_string): Likewise. + (expr_to_string): Likewise. + (parm_to_string): Likewise. + (type_to_string): Likewise. + (args_to_string): Likewise. + (cv_to_string): Likewise. + +2004-06-26 Mark Mitchell + + * cp-tree.h (cp_cv_quals): New type. + (cp_declarator): Use it instead of "tree" as appropriate. + (grok_method_quals): Adjust prototype. + (grokclassfn): Likewise. + (do_friend): Likewise. + * decl.c (grokfndecl): Use cp_cv_quals, not tree. + (grokdeclarator): Likewise. + * decl2.c (grok_method_quals): Likewise. + (grokclassfn): Likewise. + * friend.c (do_friend): Likewise. + * method.c (implicitly_declare_fn): Adjust call to grokclassfn. + * parser.c (make_call_declarator): Use cp_cv_quals, not tree. + (make_pointer_declarator): Likewise. + (make_reference_declarator): Likewise. + (make_ptrmem_declarator): Likewise. + (cp_parser_ptr_operator): Likewise. + (cp_parser_cv_qualifier_seq_opt): Likewise. + (cp_parser_cv_qualifier_opt): Remove. + (cp_parser_new_declarator_opt): Adjust call to + cp_parser_ptr_operator. + (cp_parser_conversion_declaration_opt): Likewise. + (cp_parser_declarator): Use cp_cv_quals, not tree. + (cp_parser_direct_declarator): Likewise. + +2004-06-26 Richard Kenner + + * call.c, cp-tree.h, cxx-pretty-print.c, decl.c, decl2.c: + Rename DECL_STMT to DECL_EXPR. + * init.c, name-lookup.c, parser.c, pt.c, semantics.c: Likewise. + * cp-lang.c (LANG_HOOKS_SAFE_FROM_P): Deleted. + * tree.c (cp_walk_subtrees): Don't call c_walk_subtrees. + +2004-06-26 Jan Hubicka + + PR C++/14865 + * decl2.c (maybe_emit_vtables): Always import_export_vtable for the + reachability analysis. + +2004-06-25 Mark Mitchell + + * cp-mudflap.c (mflang_flush_calls): Fix thinkos resulting from + 2004-06-23 change. + +2004-06-25 Paul Brook + + * decl2.c (get_guard): Call targetm.cxx.guard_type. + (get_guard_bits, get_guard_cond): Call targetm.cxx.guard_mask_bit. + +2004-06-24 Mark Mitchell + + * decl.c (grokdeclarator): Restore error messages about __thread. + * parser.c (cp_parser_decl_specifier_seq): Likewise. + +2004-06-24 Jason Merrill + + PR c++/16115 + * decl.c (grokparms): Give the PARM_DECL reference type if the + parameter is passed by invisible reference. + +2004-06-24 Andreas Schwab + + * cp-tree.h (enum cp_storage_class): Remove trailing comma. + +2004-06-23 Mark Mitchell + + * Make-lang.in (cp/lex.o): Do not depend on cp/lex.h. + (cp/decl.o): Likewise. + (cp/decl2.o): Likewise. + (cp/pt.o): Likewise. + (cp/semantics.o): Likewise. + * config-lang.in (gtfiles): Do not reference cp/lex.h. + * class.c: Do not include lex.h. + (add_implicitly_declared_members): Do not use + adding_implicit_members. + (check_bases_and_members): Do not talk about grok_x_components. + * cp/cp-tree.h (adding_implicit_members): Remove. + (cp_storage_class): New type. + (cp_decl_spec): Likewise. + (cp_decl_specifier_seq): Likewise. + (cp_parameter_declarator): Use it for the decl_specifiers field. + (check_tag_decl): Adjust prototype. + (shadow_tag): Likewise. + (groktypename): Likewise. + (start_decl): Likewise. + (start_function): Likewise. + (start_method): Likewise. + (grok_x_components): Remove. + (grokfield): Adjust prototype. + (grokbitfield): Likewise. + (finish_member_class_template): Remove. + * decl.c: Do not include lex.h. + (adding_implicit_members): Do not define. + (check_tag_decl): Do not use trees to represent decl-specifiers. + (shadow_tag): Likewise. + (groktypename): Likewise. + (start_decl): Likewise. + (grokvardecl): Likewise. + (grokdeclarator): Likewise. + (grokparms): Likewise. + (start_function): Likewise. + (start_method): Likewise. + * decl.h (grokdeclarator): Adjust prototype. + * decl2.c: Do not include lex.h. + (grok_x_components): Remove. + (grokfield): Do not use trees to represent decl-specifiers. + (grokbitfield): Likewise. + * lex.c: Do not include lex.h. + * lex.h: Remove. + * parser.c: Include target.h. + (clear_decl_specs): New function. + (cp_parser_translation_unit): Do not use trees to represent + decl-specifiers. + (cp_parser_postfix_expression): Likewise. + (cp_parser_new_type_id): Likewise. + (cp_parser_condition): Likewise. + (cp_parser_simple_declaration): Likewise. + (cp_parser_decl_specifier_seq): Likewise. + (cp_parser_function_specifier_opt): Likewise. + (cp_parser_conversion_type_id): Likewise. + (cp_parser_template_parameter): Likewise. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_type_specifier): Likewise. + (cp_parser_simple_type_specifier): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_type_specifier_seq): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_exception_declaration): Likewise. + (cp_parser_function_definition_from_specifiers_and_declarator): + Likewise. + (cp_parser_single_declaration): Likewise. + (cp_parser_save_member_function_body): Likewise. + (cp_parser_friend_p): Likewise. + (cp_parser_set_storage_class): New function. + (cp_parser_set_decl_spec_type): Likewise. + * pt.c: Do not include lex.h. + * semantics.c: Likewise. + (finish_member_class_template): Remove. + +2004-06-23 Roger Sayle + + * call.c (build_cxx_call): Don't call expand_tree_builtin. No + longer take both "args" and "convert_args" as arguments. + (build_op_delete_call): Update call to build_cxx_call. + (build_over_call): Likewise, update call to build_cxx_call. + * cp-tree.h (build_cxx_call): Update funtion prototype. + * typeck.c (build_function_call): Don't call expand_tree_builtin. + * rtti.c (throw_bad_cast): Update call to build_cxx_call. + (throw_bad_typeid): Likewise. + (build_dynamic_cast_1): Likewise. + +2004-06-22 Richard Henderson + + * class.c (build_vfn_ref): Take a pointer not object. Build + an OBJ_TYPE_REF. + (cp_fold_obj_type_ref): New. + * call.c (build_over_call): Update build_vfn_ref call. + * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): New. + * cp-tree.h (cp_fold_obj_type_ref): Declare. + +2004-06-21 Jason Merrill + + PR c++/16112 + * cp-gimplify.c (cp_gimplify_init_expr): Look through + CLEANUP_POINT_EXPR. + +2004-06-21 Mark Mitchell + + * cp-tree.def (NEW_EXPR): Add a fourth slot. + * cp-tree.h (PARMLIST_ELLIPSIS_P): Remove. + (TREE_PARMLIST): Likewise. + (CALL_DECLARATOR_PARMS): Likewise. + (CALL_DECLARATOR_QUALS): Likewise. + (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise. + (cp_declarator_kind): New type. + (cp_parameter_declarator): Likewise. + (cp_declarator): Likewise. + (cp_error_declarator): Likewise. + (no_parameters): Likewise. + (groktypename): Change prototype. + (start_decl): Likewise. + (start_handler_parms): Likewise. + (get_scope_of_declarator): Likewise. + (start_function): Likewise. + (start_preparsed_function): New function. + (start_function): Change prototype. + (start_method): Likewise. + (grokfield): Likewise. + (grokbitfield): Likewise. + (build_new): Likewise. + (make_pointer_declarator): Remove. + (make_reference_declarator): Likewise. + (make_call_declarator): Likewise. + (set_quals_and_spec): Likewise. + (process_template_parm): Change prototype. + (begin_function_definition): Remove. + (finish_parmlist): Remove. + * decl.c (groktypename): Do not use trees to represent + declarators. + (start_decl): Likewise. + (start_handler_parms): Remove. + (get_scope_of_declarator): Reimplement. + (grokdeclarator): Do not use trees to represent declarators. + (grokparms): Likewise. + (start_function): Likewise. + (start_method): Likewise. + (build_void_list_mode): Do not use TREE_PARMLIST. + * decl.h (grokdeclarator): Change prototype. + * decl2.c (grok_method_quals): Robustify. + (grok_x_components): Do not use trees to represent declarators. + (grokfield): Likewise. + (grokbitfield): Likewise. + (start_objects): Build FUNCTION_DECLs, not declarators. + (start_static_storage_duration_function): Likewise. + * init.c (build_new): Simplify. + * lex.c (make_pointer_declarator): Remove. + (make_reference_declarator): Likewise. + (make_call_declarator): Likewise. + (set_quals_and_spec): Likewise. + * method.c (use_thunk): Use start_preparsed_function. + (synthesize_method): Likewise. + (implicitly_declare_fn): Build FUNCTION_DECLs, not declarators. + * optimize.c (maybe_clone_body): Use start_preparsed_function. + * parser.c (cp_error_declarator): New variable. + (declarator_obstack): Likewise. + (alloc_declarator): New function. + (make_declarator): Likewise. + (make_id_declarator): Likewise. + (make_pointer_declarator): Likewise. + (make_reference_declarator): Likewise. + (make_ptrmem_declarator): Likewise. + (make_call_declarator): Likewise. + (make_array_declarator): Likewise. + (no_parameters): New variable. + (make_parameter_declarator): Likewise. + (cp_parser_check_for_definition_in_return_type): Do not use trees + to represent declarators. + (cp_parser_translation_unit): Likewise. + (cp_parser_new_expression): Likewise. + (cp_parser_new_type_id): Likewise. + (cp_parser_new_declarator_opt): Likewise. + (cp_parser_direct_new_declarator): Likewise. + (cp_parser_condition): Likewise. + (cp_parser_declaration_statement): Likewise. + (cp_parser_declaration): Likewise. + (cp_parser_conversion_type_id): Likewise. + (cp_parser_conversion_declarator_opt): Likewise. + (cp_parser_template_parameter_list): Likewise. + (cp_parser_template_parameter): Likewise. + (cp_parser_explicit_instantiation): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_declarator): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_type_id): Likewise. + (cp_parser_parameter_declaration_clause): Likewise. + (cp_parser_parameter_declaration_list): Likewise. + (cp_parser_parameter_declaration): Likewise. + (cp_parser_member_declaration): Likewise. + (cp_parser_exception_declaration): Likewise. + (cp_parser_check_declarator_template_parameters): Likewise. + (cp_parser_function_definition_from_specifiers_and_declarator): + Likewise. + (cp_parser_save_member_function_body): Likewise. + * pt.c (process_template_parm): Add is_non_type parameter. + (convert_template_argument): Adjust call to groktypename. + (tsubst_call_declarator_parms): Remove use of TREE_PARMLIST. + (tsubst): Do not expect declarators. + (tsubst_copy_and_build): Adjust NEW_EXPR case to handle additional + argument. + (instantiate_decl): Use start_preparsed_function. + * semantics.c (begin_function_definition): Remove. + (finish_parmlist): Remove. + * cp-mudflap.c (mflang_flush_calls): Build FUNCTION_DECLs, not + declarators. + +2004-06-21 Richard Kenner + + * call.c (build_vfield_ref): Add new operand for COMPONENT_REF. + (build_new_method_call): Likewise. + * decl.c (local_variable_p_walkfn): Don't walk into types. + * decl2.c (grok_array_decl): Add new operands for ARRAY_REF. + (build_anon_union_vars): Add new operand for COMPONENT_REF. + * init.c (buld_new): Add new operand for ARRAY_REF. + * method.c (do_build_copy_constructor): New op for COMPONENT_REF. + (do_build_assign_ref): Likewise. + * parser.c (cp_parser_direct_new_declarator): Add new operands + for ARRAY_REF. + (cp_parser_direct_declarator): Likewise. + * pt.c (tsubst): Likewise. + (tsubst_copy, tsubst_copy_and_build): Likewise; also add new operand + for COMPONENT_REF. + * semantics.c (finish_non_static_data_member): Add new operand + for COMPONENT_REF. + * typeck.c (build_class_member_access_expr): Likewise. + (build_class_member_access_expr, finish_class_member_access_expr): + Likewise. + (build_ptrmemfunc_access_expr): Likewise. + (build_array_ref): Add new operands for ARRAY_REF. + * typeck2.c (split_nonconstant_init_1): Likewise; COMPONENT_REF too. + * tree.c (count_trees_r, no_linkage_helper): Don't walk in types. + +2004-06-21 Richard Henderson + + * dump.c (cp_dump_tree): Don't use dump_next_stmt. + * parser.c (cp_parser_jump_statement): Update commentary. + * pt.c (tsubst_expr): Use RETURN_EXPR. + * semantics.c (finish_return_stmt): Likewise. + (finalize_nrv_r): Likewise. + * typeck.c, typeck2.c: Update file start commentary. + +2004-06-21 Richard Henderson + + * semantics.c (finish_expr_stmt): Call verify_sequence_points. + +2004-06-20 Richard Henderson + + * cp-tree.h (add_decl_stmt): Declare. + * pt.c (tsubst_copy): Abort for CLEANUP_POINT_EXPR. + * semantics.c (maybe_cleanup_point_expr): New. + (add_decl_stmt, finish_expr_stmt, finish_return_stmt, + finish_for_expr, finish_switch_cond): Use it. + (finalize_nrv_r): Don't build an EXPR_STMT. Don't frob TREE_CHAIN. + +2004-06-20 Richard Henderson + + * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def. + * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c. + (cp_gimplify_expr): Call it. + (gimplify_cleanup_stmt): Move from c-gimplify.c. + (cp_genericize): New. + * decl.c (finish_function): Call it. + * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT. + (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h. + (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise. + (cp_genericize): Declare. + * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT. + * dump.c (cp_dump_tree): Likewise. + * semantics.c (push_cleanup): Move from c-semantics.c. + +2004-06-20 Zack Weinberg + + * cp-lang.c (has_c_linkage): Implement. + + * cp-tree.h (set_mangled_name_for_decl): Don't prototype. + * decl.c (duplicate_decls): Use COPY_DECL_RTL. + (builtin_function_1): Don't call make_decl_rtl. + (build_cp_library_fn): Don't call set_mangled_name_for_decl. + (grokvardecl): Don't call mangle_decl. + * except.c (nothrow_libfn_p): Look at DECL_NAME, not + DECL_ASSEMBLER_NAME. + * method.c (set_mangled_name_for_decl): Delete. + * name-lookup.c (pushdecl): When a local extern shadows a + file-scope declaration of the same object, give both DECLs the + same DECL_UID. + * typeck.c (cxx_mark_addressable): Don't set TREE_ADDRESSABLE + on DECL_ASSEMBLER_NAME. + +2004-06-19 Richard Henderson + + * cp-gimplify.c: Remove unnecessary prototypes. + (cp_gimplify_stmt): Merge into ... + (cp_gimplify_expr): ... here. Move to end of file. Handle + stmts_are_full_exprs_p frobbing. + * cp-tree.h (cp_gimplify_stmt): Remove. + * pt.c (tsubst_expr): Merge prep_stmt and unify. + * tree.c (init_tree): Don't set lang_gimplify_stmt. + +2004-06-18 Richard Henderson + + PR c++/16034 + * semantics.c (begin_cond): New. + (finish_cond): Rewrite to handle template DECL_STMTs specially. + Assume that non-template decls go land before the conditional. + (simplify_loop_decl_cond): Likewise. + (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt, + finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond, + begin_switch_stmt, finish_switch_cond): Update to match. + +2004-06-17 Jason Merrill + + PR c++/16015 + * semantics.c (simplify_aggr_init_expr): Don't return the slot. + (finish_stmt_expr_expr): Update type after conversions. + (finish_stmt_expr): Wrap initializer in CLEANUP_POINT_EXPR. + Handle void initializer. + * tree.c (build_cplus_new): Make AGGR_INIT_EXPRs void. + +2004-06-17 Geoffrey Keating + + * class.c (build_clone): Don't call defer_fn, let mark_used do it. + * cp-tree.h (defer_fn): Delete. + * decl2.c (defer_fn): Delete. + (finish_file): Simplify deferred_fns loops; check that + only used inline functions get into deferred_fns. + (mark_used): Inline previous contents of defer_fn. + +2004-06-16 Richard Henderson + + * cp-tree.h (COMPOUND_STMT_TRY_BLOCK, COMPOUND_STMT_BODY_BLOCK): Kill. + (BIND_EXPR_TRY_BLOCK, BIND_EXPR_BODY_BLOCK): New. + * cxx-pretty-print.c (pp_cxx_function_definition): Move handling + of CTOR_INITIALIZER ... + (pp_cxx_statement): ... here. + * decl.c (begin_function_body): Don't set COMPOUND_STMT_BODY_BLOCK. + (finish_function): Use alloc_stmt_list to zap entire function. + * parser.c (cp_parser_compound_statement): Update commentary. + * pt.c (tsubst_expr): Use BIND_EXPR instead of COMPOUND_STMT. + * semantics.c (begin_compound_stmt, finish_compound_stmt): Likewise. + (finish_stmt_expr): Don't look through COMPOUND_STMT. + +2004-06-16 Geoffrey Keating + + * pt.c (mark_decl_instantiated): Don't call defer_fn. + +2004-06-16 Richard Henderson + + * parser.c (cp_parser_labeled_statement): Update commentary. + * pt.c (tsubst_expr): Use CASE_LABEL_EXPR. + * tree.c (mark_local_for_remap_r): Likewise. + +2004-06-16 Richard Henderson + + * parser.c (cp_parser_asm_definition): Update commentary. + * pt.c (tsubst_expr): Use ASM_EXPR. + * semantics.c (finish_asm_stmt): Likewise. + +2004-06-16 Richard Henderson + + * decl.c (finish_destructor_body): Use LABEL_EXPR. + * parser.c (cp_parser_statement): Update commentary. + * pt.c (tsubst_expr): Use LABEL_EXPR, GOTO_EXPR. + * semantics.c (finish_goto_stmt, finish_label_stmt): Likewise. + * tree.c (mark_local_for_remap_r): Likewise. + +2004-06-16 Richard Henderson + + PR c++/16012 + * semantics.c (begin_for_stmt, begin_for_stmt): Do put the init + statement in FOR_INIT_STMT for templates. + +2004-06-15 Richard Henderson + + * call.c (initialize_reference): Don't build CLEANUP_STMT here. + * cp-gimplify.c (cp_gimplify_stmt): Remove next_p argument. + (genericize_try_block): Use gimplify_stmt. + (genericize_catch_block, genericize_eh_spec_block): Likewise. + (cp_gimplify_init_expr): Remove STMT_EXPR special case. + (gimplify_must_not_throw_expr): Update voidify_wrapper_expr call. + * cp-lang.c (LANG_HOOKS_TREE_INLINING_TREE_CHAIN_MATTERS_P): Remove. + (cp_tree_chain_matters_p): Remove. + * cp-tree.h (COMPOUND_STMT_TRY_BLOCK): New. + (COMPOUND_STMT_BODY_BLOCK): New. + (STATEMENT_LIST_NO_SCOPE, STATEMENT_LIST_TRY_BLOCK): New. + (EXPR_STMT_STMT_EXPR_RESULT): New. + (building_stmt_tree): Check cur_stmt_list. + (tf_stmt_expr_cmpd, tf_stmt_expr_body): Remove. + (BCS_NO_SCOPE, BCS_TRY_BLOCK, BCS_FN_BODY): New. + * decl.c (poplevel): Use pop_stmt_list for minding cleanups. + (cp_finish_decl): Use push_cleanup. + (start_function, finish_function): Use statement lists. + (finish_stmt): Do nothing. + * except.c (begin_eh_spec_block): Use statement lists. + (check_handlers_1, check_handlers): Likewise. + * init.c (construct_virtual_base): Don't add extra compound stmts. + (build_vec_init): Likewise. + * name-lookup.c (maybe_push_cleanup_level): Use statement lists. + * name-lookup.h (struct cp_binding_level): Add statement_list. + * parser.c (cp_parser_statement): Take the STMT_EXPR node, not a bool. + (cp_parser_labeled_statement, cp_parser_expression_statement, + cp_parser_statement_seq_opt): Likewise. + (cp_parser_compound_statement): Likewise. Take bool for try block. + (cp_parser_selection_statement): Tidy if processing. + (cp_parser_already_scoped_statement): Rewrite to do what it says. + * pt.c (tsubst_copy): Move STMT_EXPR to tsubst_expr. + (tsubst_expr): Rewrite STMT_EXPR processing. Handle STATEMENT_LIST. + Mind COMPOUND_STMT_TRY_BLOCK, EXPR_STMT_STMT_EXPR_RESULT. + * semantics.c (do_poplevel, do_pushlevel): Use statement lists. + (finish_cond): New, rewritten from FINISH_COND. + (simplify_loop_decl_cond): New. + (finish_expr_stmt): Avoid nested EXPR_STMTs. + (begin_if_stmt, finish_if_stmt_cond, finish_then_clause, + begin_else_clause, finish_else_clause, finish_if_stmt, + begin_while_stmt, finish_while_stmt_cond, finish_while_stmt, + begin_do_stmt, finish_do_body, begin_for_stmt, finish_for_init_stmt, + finish_for_cond, finish_for_stmt, begin_switch_stmt, + finish_switch_cond, finish_switch_stmt, begin_try_block, + finish_try_block, finish_cleanup_try_block, finish_function_try_block, + finish_handler_sequence, finish_function_handler_sequence, + begin_handler, finish_handler_parms, finish_handler, + begin_stmt_expr, finish_stmt_expr_expr, finish_stmt_expr): Rewrite + using statement lists. + (begin_compound_stmt): Replace has_no_scope argument with flags. + Update all callers. Use statement lists. + (finish_compound_stmt): Likewise. + (finish_decl_cleanup, finish_eh_cleanup): Use push_cleanup. + (current_scope_stmt_stack): Remove. + (simplify_aggr_init_expr): Don't muck with TREE_CHAIN. + * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): + Rewrite with statement lists. + +2004-06-15 Alexandre Oliva + + * parser.c: Change all assignments of c_lex_string_translate + to true and false to 1 and 0. + (cp_lexer_read_token): Convert type of the translated string. + (cp_parser_skip_to_closing_parentheses): Preserve original + value of c_lex_string_translate, and set it to -1 while + running. + (cp_parser_cache_group): Likewise. + (cp_parser_cache_group_1): Renamed. + (cp_parser_asm_operand_list): Remove redundant setting of + c_lex_string_translate. + (cp_parser_primary_expression) [CPP_STRING, CPP_WSTRING]: + Handle chained strings. + +2004-06-12 Andrew Pinski + + PR c++/14639 + Revert: + 2004-06-02 Andrew Pinski + + * cp-tree.h: Fix typo. + + * cp-tree.h: Include cgraph.h + (DECL_NEEDED_P): Use cgraph_*node on the decl instead of + TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl. + +2004-06-12 Jason Merrill + + PR tree-optimization/14107 + * decl.c (finish_function): Warn about no return in all functions. + +2004-06-15 Paolo Bonzini + + * cp-tree.h (struct language_function): Remove cannot_inline. + * decl.c (save_function_data): cannot_inline is no more. + (cxx_push_function_context): Likewise. + * decl2.c (start_objects, start_static_storage_duration_function): + Reset DECL_INLINE, set DECL_UNINLINABLE. + +2004-06-14 Giovanni Bajo + + PR c++/15967 + * search.c (lookup_field): Propagate the ambiguity list. + (lookup_fnfields): Likewise. + +2004-06-14 Giovanni Bajo + + PR c++/15947 + * parser.c (cp_parser_template_name): Ctors/dtors never need a + template keyword to disambiguate. + +2004-06-14 Mark Mitchell + + PR c++/15096 + * decl.c (grokdeclarator): Ignore pointer-to-members when + computing template depth. + + PR c++/14930 + * name-lookup.c (pushtag): Do not try to put class declarations in + explicit specialization scopes. + +2004-06-11 Andrew Pinski + + * decl.c (grokdeclarator): Do not depend on C99's _Bool's behavior. + +2004-06-11 Mark Mitchell + + PR c++/15862 + * name-lookup.c (unqualified_namespace_lookup): Do not ignore type + bindings for undeclared built-ins. + +2004-06-11 Giovanni Bajo + + * typeck2.c (abstract_virtual_errors): Reword diagnostics, make them + appear at the correct location. + +2004-06-10 Jason Merrill + + PR c++/15875 + Revert: + 2004-06-01 Kriang Lerdsuwanakij + * init.c (build_offset_ref): Build SCOPE_REF with non-null + TREE_TYPE for non-dependent names. + * pt.c (type_dependent_expression_p): Handle SCOPE_REF with + unknown_type_node as its TREE_TYPE. + * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. + * error.c (dump_decl) : Use pp_expression. + (dump_expr) : Likewise. + +2004-06-10 Mark Mitchell + + PR c++/15227 + * parser.c (cp_parser_direct_declarator): Robustify. + + PR c++/15877 + * pt.c (tsubst_copy): Use decl_constant_value on enumeration + constants in non-dependent contexts. + + PR c++/14211 + PR c++/15076 + * typeck.c (build_static_cast): Wrap casts in NON_LVALUE_EXPR when + necessary. + +2004-06-10 Jakub Jelinek + + PR c++/14791 + * decl.c (duplicate_decls): Handle fileptr_type_node arguments + specially. + +2004-06-09 Mark Mitchell + + Revert: + PR c++/15815 + 2004-06-07 Mark Mitchell + * lex.c (handle_pragma_interface): Deprecate. + (handle_pragma_implementation): Likewise. + +2004-06-09 Andrew Pinski + + * g++spec.c (lang_specific_driver): Remove check for -lm + and -lmath when check it see if it was the math library. + +2004-06-08 Giovanni Bajo + + PR c++/7841 + * parser.c (cp_parser_direct_declarator): Reject constructor named + as qualified template-id. + +2004-06-07 Mark Mitchell + + PR c++/15815 + * lex.c (handle_pragma_interface): Deprecate. + (handle_pragma_implementation): Likewise. + +2004-06-07 Mark Mitchell + + PR c++/15766 + * parser.c (cp_parser_iteration_statement): Fix typo in error + message. + + PR c++/14777 + * pt.c (tsubst_default_argument): Do not defer access checks + while substituting into the default argument. + + PR c++/15554 + * pt.c (tsubst_copy): Do not try to substitute for an enumeration + constant in a non-dependent context. + + PR c++/15057 + * except.c (build_throw): Ensure that temp_expr has been + initialized. + +2004-06-06 Roger Sayle + + * cp/cp-tree.h (lvalue_or_else): Add function prototype. + +2004-06-06 Giovanni Bajo + + PR c++/15503 + * parser.c (cp_parser_mem_initializer_id): Gracefully reject + 'typename', and accept 'template'. + +2004-06-03 Andrew Pinski + Jan Hubicka + + PR c++/14639 + * method.c (use_think): Do not mark thunk as referenced. + +2004-06-03 Matt Austern + + PR c++/15428 + * decl2.c (maybe_emit_vtables): If TARGET_WEAK_NOT_IN_ARCHIVE_TOC + is nonzero, and if we see a noninline definition of a key method, + make the vtables nonweak. + +2004-06-02 Matt Austern + + * cp-tree.h (instantiate_decl): new boolean parameter, + undefined_ok. Current behavior is equivalent to its being 0. + * decl2.c (mark_used): Add new argument when calling instantiate_decl + * pt.c (mark_decl_instantiated): Unconditionally make + instantiations explicit unconditionally + (do_decl_instantiation): Don't call SET_DECL_EXPLICIT_INSTANTIATION, + since mark_decl_instantiated now does it. + (instantiate_class_member): New. Instantiate a member of an + explicitly instantiated class template. + (do_type_instantiation): Explicitly instantiate members of an + explicitly instantiated class template. + (instantiate_decl): if undefined_ok is nonzero, and if we're + trying to explicitly instantiated a template with no definition, + change it to an implicit instantiation. + (instantiate_pending_templates): Add new argument to instantiate_decl. + * tree.c (cp_cannot_inline_tree_fn): Likewise. + +2004-06-02 Andrew Pinski + + * cp-tree.h: Fix typo. + + * cp-tree.h: Include cgraph.h + (DECL_NEEDED_P): Use cgraph_*node on the decl instead of + TREE_SYMBOL_REFERENCED on the DECL_ASSEMBLER_NAME of the decl. + +2004-06-01 Jason Merrill + + PR c++/15142 + * call.c (call_builtin_trap): Remove type parm. + (convert_arg_to_ellipsis): Change a non-POD argument to integer type. + (build_x_va_arg): Dereference a null pointer for a non-POD argument. + +2004-06-01 Kriang Lerdsuwanakij + + PR c++/13092 + * init.c (build_offset_ref): Build SCOPE_REF with non-null + TREE_TYPE for non-dependent names. + * pt.c (type_dependent_expression_p): Handle SCOPE_REF with + unknown_type_node as its TREE_TYPE. + * cxx-pretty_print.c (pp_cxx_unqualified_id): Handle BASELINK. + * error.c (dump_decl) : Use pp_expression. + (dump_expr) : Likewise. + +2004-06-01 Richard Henderson + Andrew Pinski + + * lex.c (reswords): Rename "__offsetof" to "__builtin_offsetof". + * parser.c (struct cp_parser): Remove in_offsetof. + (cp_parser_new): Don't set it. + (cp_parser_unary_expression): Don't check it. + (cp_parser_postfix_open_square_expression): Split out from ... + (cp_parser_postfix_expression): ... here. + (cp_parser_postfix_dot_deref_expression): Likewise. + (cp_parser_builtin_offsetof): New. + (cp_parser_primary_expression): Use it. + +2004-06-01 Giovanni Bajo + + PR c++/14932 + * parser.c (cp_parser_postfix_expression): Allow subscript + operator in offsetof. + +2004-05-31 Mark Mitchell + + PR c++/15701 + * friend.c (add_friend): Do not try to perform access checks for + functions from dependent classes. + +2004-05-31 Gabriel Dos Reis + + * cxx-pretty-print.c (pp_cxx_colon_colon): Expor. + (pp_cxx_begin_template_argument_list): Turn into a function. + (pp_cxx_end_template_argument_list): Likewise. + (pp_cxx_separate_with): Define. + (pp_cxx_unqualified_id): Tidy. + (pp_cxx_primary_expression): Likewise. + (pp_cxx_postfix_expression): Likewise. + (pp_cxx_expression): Likewise. + (pp_cxx_simple_type_specifier): Likewise. + (pp_cxx_type_specifier_seq): Likewise. + (pp_cxx_parameter_declaration_clause): Likewise. + (pp_cxx_exception_specification): Likewise. + (pp_cxx_direct_declarator): Likewise. + (pp_cxx_type_id): Likewise. + * cxx-pretty-print.h (pp_cxx_whitespace): Export from + cxx-pretty-print.c. + (pp_cxx_left_paren): Likewise. + (pp_cxx_right_paren): Likewise. + (pp_cxx_left_brace): Likewise. + (pp_cxx_right_brace): Likewise. + (pp_cxx_left_bracket): Likewise. + (pp_cxx_right_bracket): Likewise. + (pp_cxx_dot): Likewise. + (pp_cxx_identifier): Likewise. + (pp_cxx_tree_identifier): Likewise. + (pp_cxx_ampersand): New macro. + (pp_cxx_star): Likewise. + (pp_cxx_arrow): Likewise. + (pp_cxx_semicolon): Likewise. + (pp_cxx_complement): Likewise. + (pp_cxx_begin_template_argument_list): Declaree. + (pp_cxx_end_template_argument_list): Likewise. + (pp_cxx_colon_colon): likewise. + +2004-05-31 Eric Botcazou + + * parser.c (cp_parser_simple_type_specifier): Explicitly test + against NULL_TREE. + +2004-05-31 Kazu Hirata + + * call.c, class.c, cp-tree.def, decl2.c, name-lookup.c, pt.c, + typeck.c: Fix comment formatting. + +2004-05-30 Andrew Pinski + + * cp-lang.c (cp_expand_decl): Remove. + (LANG_HOOKS_EXPAND_DECL): Use c_expand_decl. + +2004-05-30 Andreas Jaeger + + * lang-specs.h: Add missing initializers for .ii. + +2004-05-28 Aldy Hernandez + + * decl.c (cp_make_fname_decl): Free return value from + fname_as_string. + +2004-05-28 Mark Mitchell + + PR c++/15083 + * decl2.c (delete_sanity): Set TREE_SIDE_EFFECTS on a DELETE_EXPR, + even in a templat.e + * init.c (build_new): Likewise. + + PR c++/15640 + * name-lookup.c (arg_assoc): Robustify. + + PR c++/15471 + * typeck.c (unary_complex_lvalue): Use context_for_name_lookup + when determining the scope to use for a pointer to member. + (lookup_anon_field): Give it external linkage. + * cp-tree.h (lookup_anon_field): Declare it. + * expr.c (cplus_expand_constant): Use it. + +2004-05-28 Mark Mitchell + + PR c++/14668 + * parser.c (cp_parser_simple_type_specifier): Call + maybe_note_name_used_in_class. + +2004-05-28 Tom Marshall + + PR c++/15214 + * class.c (finish_struct_1): Warn only if the dtor is non-private or + the class has friends. + +2004-05-27 Adam Nemet + + PR c++/12883 + * decl.c (complete_array_type): Set TYPE_NEEDS_CONSTRUCTING and + TYPE_HAS_NONTRIVIAL_DESTRUCTOR based on the underlying type. + +2004-05-24 Geoffrey Keating + + * method.c (implicitly_declare_fn): Don't call defer_fn; abort + if it might be needed. + * pt.c (mark_decl_instantiated): Only call defer_fn if + the function actually needs processing in finish_file. + * decl2.c (finish_file): Add check that elements in + deferred_fns_used are really needed there. Remove unnecessary + test of DECL_SAVED_TREE. + +2004-05-23 Paolo Bonzini + + * Make-lang.in: No need to specify $(LIBCPP). + +2004-05-23 Mark Mitchell + + PR c++/15044 + * parser.c (cp_parser_class_head): Robustify. + + PR c++/15317 + * parser.c (cp_parser_decl_specifier_seq): Correct error in + comment. + (cp_parser_constructor_declarator_p): Treat attributes + as decl-specifiers. + + PR c++/15329 + * typeck.c (build_unary_op): Do not attempt to resolve casts to + base classes in templates. + +2004-05-23 Mark Mitchell + + PR c++/15165 + * pt.c (instantiate_template): Robustify. + +2004-05-23 Mark Mitchell + + PR c++/15025 + * decl.c (xref_tag): Issue errors about redeclaring template + classes as non-template classes. + +2004-05-23 Mark Mitchell + + PR c++/14821 + * name-lookup.c (supplement_binding): Allow redefinitions of + namespace aliases. + + PR c++/14883 + * parser.c (cp_parser_template_argument): Robustify. + +2004-05-23 Gabriel Dos Reis + + * class.c (alter_access): Use %E format specifier to print an + identifier node. Avoid looking at the IDENTIFIER_POINTER. + (push_lang_context): Likewise. + * decl.c (lookup_label): Likewise. + (grokdeclarator): Likewise. + * parser.c (cp_parser_check_for_invalid_template_id): Likewise. + * pt.c (do_type_instantiation): Likewise. + * tree.c (handle_java_interface_attribute): Likewise. + (handle_com_interface_attribute): Likewise. + (handle_init_priority_attribute): Likewise. + +2004-05-22 Mark Mitchell + + PR c++/15285 + PR c++/15299 + * pt.c (build_non_dependent_expr): Expand the set of tree nodes + recognized as overloaded functions. + +2004-05-22 Mark Mitchell + + PR c++/15507 + * class.c (layout_nonempty_base_or_field): Do not try to avoid + layout conflicts for unions. + + PR c++/15542 + * typeck.c (build_x_unary_op): Instantiate template class + specializations before looking for "operator &". + + PR c++/15427 + * typeck.c (complete_type): Layout non-dependent array types, even + in templates. + + PR c++/15287 + * typeck.c (build_unary_op): Do not optimize "&x[y]" when in a + template. + +2004-05-22 Roger Sayle + + * name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by + returning when TREE_TYPE is error_mark_node. + * typeck.c (require_complete_type): Return error_mark_node if + value's type is an error_mark_node. + +2004-05-20 Andrew Pinski + + * optimize.c (calls_setjmp_r): Remove. + (calls_setjmp_p): Remove. + * cp-tree.c (calls_setjmp_p): Remove. + * decl.c (finish_function): Do not call calls_setjmp_p. + +2004-05-18 Zack Weinberg + + * decl.c (cp_finish_decl): Use mark_decl_referenced. + * decl2.c (maybe_make_one_only): Likewise. + * method.c (use_thunk): Likewise. + +2004-05-18 Jason Merrill + + * class.c (build_base_path): Tidy a bit. + +2004-05-14 Geoffrey Keating + + * name-lookup.c (struct scope_binding): New. + (EMPTY_SCOPE_BINDING): New. + (lookup_using_namespace): Take a scope_binding instead of a + cxx_binding. + (qualified_lookup_using_namespace): Likewise. + (cxx_binding_clear): Delete. + (do_nonmember_using_decl): Use a scope_binding instead of a + cxx_binding. + (lookup_tag): Don't call select_decl. + (ambiguous_decl): Don't return anything (and change callers to match). + Take a scope_binding as the second parameter. + (lookup_namespace_name): Use a scope_binding instead of a + cxx_binding. + (unqualified_namespace_lookup): Likewise. + (lookup_qualified_name): Likewise. + (select_decl): Take a scope_binding instead of a cxx_binding. + Use macros rather than hand-coding tests for type-ness. + +2004-05-13 Diego Novillo + + * cp-gimplify.c: Rename from cp-simplify.c. + * Make-lang.in, optimize.c: Update. + +2004-05-13 Diego Novillo + + Merge from tree-ssa-20020619-branch. See + ChangeLog.tree-ssa for details. + + * Make-lang.in, call.c, class.c, cp-lang.c, cp-tree.def, + cp-tree.h, cvt.c, decl.c, decl2.c, error.c, except.c, + expr.c, init.c, name-lookup.h, optimize.c, parser.c, + pt.c, rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: + Merged. + * cp-mudflap.c: New file. + * cp-simplify.c:: New file. + +2004-05-03 Giovanni Bajo + + PR c++/14389 + * decl2.c (check_classfn): For member templates, compare also the + template parameters to match the declaration. + * cp-tree.h: Adjust declaration of check_classfn. + * decl.c (start_decl, grokfndecl): Adjust callers of check_classfn. + * friend.c (do_friend): Likewise. + * pt.c (tsubst_friend_function): Likewise. + +2004-05-01 Zack Weinberg + + * decl.c (reshape_init): Do not apply TYPE_DOMAIN to a VECTOR_TYPE. + Instead, dig into the representation type to find the array bound. + +2004-04-30 Jason Merrill + + Refer to base members using COMPONENT_REFs where possible. + * class.c (build_simple_base_path): New fn. + (build_base_path): Use it for non-virtual base references. + (layout_class_type): Change base fields to their real type + after layout is done. + * cp-tree.h (IS_FAKE_BASE_TYPE): New macro. + * cp-lang.c (cxx_get_alias_set): Use it. + +2004-04-30 Kazu Hirata + + * class.c, cp-tree.h, decl.c, decl2.c, pt.c, rtti.c: Fix + comment typos. + +2004-04-23 Giovanni Bajo + + PR c++/15064 + * parser.c (cp_parser_postfix_expression): typeid operator cannot be + used in integral constant expressions. + +2004-04-22 Mark Mitchell + + * init.c (build_aggr_init): Fix accidental use of C99 construct in + previous change. + + * class.c (initialize_array): Don't set TREE_HAS_CONSTRUCTOR on + braced initializer. + * cp-tree.h (BRACE_ENCLOSED_INITIALIZER_P): New macro. + * decl.c (reshape_init): Use it. + * init.c (perform_member_init): Remove redundant condition. + (build_aggr_init): Adjust to handle brace-enclosed initializers + correctly. + (expand_default_init): Use BRACE_ENCLOSED_INITIALIZER_P. + + * parser.c (cp_parser_initializer_clause): Do not set + TREE_HAS_CONSTRUCTOR on the initializer. + * rtti.c (tinfo_base_init): Likewise. + (generic_initializer): Likewise. + (ptr_initializer): Likewise. + (ptm_initializer): Likewise. + (class_initializer): Likewise. + (get_pseudo_ti_init): Likewise. + * typeck2.c (digest_init): Use BRACE_ENCLOSED_INITIALIZER_P. + +2004-04-22 Alan Modra + + * name-lookup.c (anonymous_namespace_name): Make static. + +2004-04-19 Roger Sayle + + PR middle-end/14531 + * class.c (build_base_path): Call fold whilst building the NULL + pointer check expression trees. + +2004-04-15 Bryce McKinlay + + * init.c (build_new_1): Don't use type size argument for Java + _Jv_AllocObject call. + +2004-04-09 Danny Smith + + * method.c (make_alias_for_thunk): Remove preprocessor guard on + declaration and definition. + +2004-04-08 Danny Smith + + PR c++/14808 + * method.c (use_thunk): Test TARGET_USE_LOCAL_THUNK_ALIAS_P rather + than ASM_OUTPUT_DEF. + +2004-04-08 Jakub Jelinek + + * decl2.c (mark_used): Don't segfault if cfun != NULL but + current_function_decl == NULL. + +2004-04-05 Nathan Sidwell + + PR c++/3518 + * pt.c (check_cv_quals_for_unify): Ignore bogus CV quals at outer + level. + +2004-04-05 Richard Kenner + + * init.c (decl_constant_value): Don't look at DECL_INITIAL + of PARM_DECL. + * tree.c (bot_manip, build_min): Don't look at TREE_CONSTANT + or TREE_SIDE_EFFECTS of a type. + +2004-04-02 Nathan Sidwell + + PR c++/14007 + * pt.c (check_cv_quals_for_unify): Correct logic for disallowed + cv-qualifier unification. + * tree.c (cp_build_qualified_type_real): Renable DR295 logic. + +2004-04-02 Jan Hubicka + + * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. + * cp-tree.h (cp_update_decl_after_saving): Declare. + * tree.c (cp_update_decl_after_saving): Define. + +2004-04-01 Mark Mitchell + + PR c++/14803 + * typeck.c (get_delta_difference): Call fold before returning the + value. + +2004-04-01 Richard Henderson + + PR c++/14804 + * decl.c (cp_finish_decl): Preserve TREE_READONLY more often. + * typeck2.c (split_nonconstant_init): Clear TREE_READONLY. + +2004-04-01 Mark Mitchell + + PR c++/14810 + * name-lookup.c (maybe_push_cleanup_level): Robustify. + +2004-04-01 Richard Kenner + + * class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly. + +2004-03-31 Richard Kenner + + * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (type_promotes_to): Likewise. + * decl.c (finish_enum): Likewise. + * mangle.c (write_builtin_type): Likewise. + * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise. + * typeck.c (type_after_usual_arithmetic_conversions): Likewise. + (build_binary_op): Likewise. + +2004-03-31 Jan Hubicka + + * tree.h (optimize_function): Kill prototype. + * optimize.c (dump_function, optimize_function, dump_finction): Kill. + * semantics.c (expand_body): Kill. + +2004-03-30 Mark Mitchell + + PR c++/14724 + * decl.c (start_decl_1): Do not decide whether or not to create a + new cleanup level until after the type has been completed. + + PR c++/14763 + * pt.c (tsubst_default_argument): Clear current_function_decl. + +2004-03-30 Zack Weinberg + + * name-lookup.c, parser.c: Use new shorter form of GTY markers. + +2004-03-29 Zack Weinberg + + * error.c (dump_function_name): If T's DECL_LANG_SPECIFIC + is null, just print the literal name and return. + +2004-03-25 Kazu Hirata + + * cxx-pretty-print.c: Fix comment typos. + +2004-03-24 Kazu Hirata + + * cxx-pretty-print.c, cxx-pretty-print.h, decl.h, friend.c: + Update copyright. + +2004-03-23 Ziemowit Laski + + * Make-lang.in (cp/mangle.o): Depend on $(TARGET_H). + * mangle.c (write_type): Add call to 'mangle_fundamental_type' + target hook. + +2004-03-23 Zack Weinberg + + PR 12267, 12391, 12560, 13129, 14114, 14133 + * cp-lang.c (c_reset_state): Delete. + (push_file_scope, pop_file_scope): New stubs. + * parser.c (c_parse_file): Call sorry() here if called more than once. + +2004-03-23 Richard Kenner + + * typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW + for INTEGER_CST. + +2004-03-22 Gabriel Dos Reis + + * cxx-pretty-print.c (pp_cxx_parameter_declaration_clause): Declare. + +2004-03-21 Gabriel Dos Reis + + * error.c (enum pad): Remove. + (dump_qualifiers): Likewise. + (dump_type): Replace dump_qualifiers with pp_cxx_cv_qualifier_seq. + (dump_aggr_type): Likewise. + (dump_type_suffix): Likewise. + (dump_simple_decl): Likewise. + (dump_function_decl): Likewise. + (cv_to_string): Likewise. + (dump_type_prefix): Likewise. Adjust return void. + * cxx-pretty-print.c (pp_cxx_cv_qualifier_seq): Move to + cxx_pretty_print.h. + (pp_cxx_template_keyword_if_needed): Document. + (pp_cxx_qualified_id): Document case FUNCTION_DECL. Tidy. + (pp_cxx_expression): Handle NON_DEPENDENT_EXPR and + MUST_NOT_THROW_EXPR. + +2004-03-21 Mark Mitchell + + PR c++/14616 + * decl.c (cp_finish_decl): Compute the size of arrays declared in + templates, if their type is non-dependent. + +2004-03-19 Mark Mitchell + + * call.c (build_op_delete_call): Do not forget the placement + arguments when iterating through mutiple delete operators. + + * cp-tree.h (svaed_scope): Remove last_parms. + (NEW_DELETE_OPNAME_P): New macro. + (last_function_parms): Remove. + (do_friend): Adjust prototype. + * decl.c (grokparms): Return the PARM_DECLs directly, rather than + using last_function_parms. + (grokfndecl): Take the PARM_DECLs as an argument, rather than + using last_function_parms. + (grokdeclarator): Adjust accordingly. Do not form METHOD_TYPEs + for class-specific operator new and operator delete. + (grok_op_properties): Do not look for allocation functions with + METHOD_TYPEs. + (start_function): Use DECL_ARGUMENTS instead of + last_function_parms. + * decl.h (last_function_parms): Do not declare. + * decl2.c (grokclassfn): Do not use last_function_parms. + * friend.c (do_friend): Remove parmdecls parameter. + * name-lookup.c (push_to_top_level): Do not save last_function_parms. + (pop_from_top_level): Do not restore it. + * pt.c (check_explicit_specialization): Do not adjust + last_function_parms. + + * name-lookup.c (do_local_using_decl): Create a local binding for + types brought in via using declarations. + + * name-lookup.c (lookup_arg_dependent): Handle block-scope + function declarations correctly. + + * semantics.c (finish_id_expression): Correct handling of + conversion operators to dependent types. + + * typeck.c (lookup_destructor): Allow the use of destructors from + base classes. + +2004-03-19 Richard Kenner + + * cxx-pretty-print.c (pp_cxx_unqualified_id): Use + TEMPLATE_TYPE_PARM_INDEX instead of TYPE_FIELDS. + * search.c (dfs_unuse_fields): Add two more TREE_CODES that mean + the field is named TEMPLATE_TYPE_PARM_INDEX. + +2004-03-19 Giovanni Bajo + + PR c++/14545 + * parser.c (cp_parser_functional_cast): A cast to anything + but integral or enumaration type is not an integral constant + expression. + * pt.c (value_dependent_expression_p): Handle cast expressions + without operands (such as "int()"). + +2004-03-18 Mark Mitchell + + * semantics.c (finish_pseudo_destructor_expr): Allow differing + cv-qualification between the type named by the + pseudo-destructor-name and the object-type. + + * search.c (accessible_base_p): Handle non-proper bases. + + * name-lookup.c (do_nonmember_using_decl): If a using declaration + refers to a single overloaded function, set the type of the + function. + * tree.c (lvalue_type): Simplify. + * typeck.c (type_unknown_p): Do not assume all OVERLOADs have an + unknown type. + (build_unary_op): Handle OVERLOADs with known types. + + * decl.c (duplicate_decls): Do not destroy DECL_ARGUMENTS for + function templates. + + * parser.c (cp_parser_postfix_expression): Handle the use of + "typename" in non-dependent contexts. Convert appropriately when + when using a qualified name after "->" or ".". + + * call.c (conditional_conversion): Honor the requirement that some + conversions refer to the original object. + +2004-03-18 Mark Mitchell + + * call.c (build_conditional_expr): Do not call force_rvalue for + operands of void_type when the conditional expression itself has + void type. + * name-lookup.c (pushdecl): Don't consider a declaration of a + function named "main" to be an overload of a type named "main". + * parser.c (cp_parser_template_name): Perform name lookup when the + template name is proceeded by "template" if the qualifying scope + is non-dependent. + * typeck.c (composite_pointer_type_r): Correctly handle + pointer-to-member types. + (build_const_cast): Likewise. + +2004-03-18 Richard Kenner + + * cp-tree.def (TEMPLATE_TYPE_PARM, TYPEOF_TYPE): Update comments. + * cp-tree.h (NEW_EXPR_USE_GLOBAL, DELETE_EXPR_USE_GLOBAL): Add check. + (DELETE_EXPR_USE_VEC, COMPOUND_EXPR_OVERLOADED): Likewise. + (KOENIG_LOOKUP_P, PTRMEM_OK_P, TEMPLATE_TYPE_PARM_INDEX): Likewise. + (TYPENAME_TYPE_FULLNAME): Add check and use type.values. + (TYPEOF_TYPE_EXPR): New macro. + * class.c (finish_struct_bits): Use TYPE_VFIELD and TYPE_METHODS. + * error.c (dump_type): Use TYPEOF_TYPE_EXPR. + * pt.c (tsubst): Likewise. + * semantics.c (finish_typeof): Likewise. + * search.c (dfs_unuse_fields): Handle TYPENAME_TYPE, TYPEOF_TYPE, + and TEMPLATE_TYPE_PARM. + * typeck.c (comptypes): Use TYPE_ORIG_SIZE_TYPE, not TYPE_DOMAIN. + (build_array_ref): Use TYPE_DOMAIN, not TYPE_VALUES. + +2004-03-16 Mark Mitchell + + PR c++/14586 + * cp-tree.h (build_new_op): Change prototype. + (build_x_binary_op): Likewise. + * call.c (build_new_op): Add overloaded_p parameter. + * decl2.c (grok_array_decl): Adjust call to build_new_op. + * parser.c (cp_parser_binary_expression): Note that uses of + overloaded operators prevents an expression from being considered + an integral constant. + * pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or + build_x_binary_op. + * semantics.c (finish_call_expr): Likewise. + * typeck.c (rationalize_conditional_expr): Likewise. + (build_x_indirect_ref): Likewise. + (build_x_binary_op): Likewise. + (build_x_unary_op): Likewise. + (build_x_compound_expr): Likewise. + (build_modify_expr): Likewise. + * typeck2.c (build_x_arrow): Likewise. + +2004-03-15 Kazu Hirata + + * cp-lang.c, ptree.c: Update copyright. + +2004-03-13 Mark Mitchell + + PR c++/14550 + * parser.c (cp_parser_non_integral_constant_expression): Encode + more of the idiom that surrounded calls to this function within + the function itself + (cp_parser_primary_expression): Adjust accordingly. + (cp_parser_postfix_expression): Likewise. + (cp_parser_unary_expression): Likewise. + (cp_parser_cast_expression): Likewise. + (cp_parser_assignment_expression): Likewise. + (cp_parser_expression): Likewise. + (cp_parser_new_expression): Note that new-expressions are not + allowed in integral constant expressions. + (cp_parser_delete_expression): Likewise. + +2004-03-12 Matt Austern + + * decl2.c (maybe_make_one_only): Look at + TARGET_EXPLICIT_INSTANTIATION_ONE_ONLY when deciding whether + to make an explicit instantiation weak. + * method.c (use_thunk): Make sure we call comdat_linkage + when appropriate. + * pt.c (do_type_instantiation): On systems where weak symbols + don't go in a static archive's TOC, explicit instantiation of a + class must imply *explicit* instantiation of its memeber. + +2004-03-11 Kazu Hirata + + * call.c, cp-tree.h, pt.c: Fix comment typos. + +2004-03-10 Mark Mitchell + + PR c++/14510 + * decl.c (xref_tag): Disregard non-type declarations when + looking up a tagged type. + +2004-03-09 Nathan Sidwell + + PR c++/14397 + * call.c (convert_like_real): Build a const qualified temporary, + when testing ctor access. + +2004-03-09 Mark Mitchell + + * call.c (initialize_reference): Fix typo. + +2004-03-09 Giovanni Bajo + + PR c++/14409 + * pt.c (determine_specialization): For member templates, match also + constness. + + PR c++/14448 + * parser.c (cp_parser_initializer_clause): Fold initializer if it is + non-dependent. + * pt.c (tsubst_copy_and_build): Handle NOP_EXPRs. + +2004-03-09 Mark Mitchell + + PR c++/14230 + * call.c (initialize_reference): Handle initializers that are + class-member access expressions applies to rvalues. + +2004-03-09 Mark Mitchell + + PR c++/14432 + * name-lookup.c (supplement_binding): Ignore functions that are + marked DECL_ANTICIPATED. + +2004-03-08 Mark Mitchell + + PR c++/14401 + * class.c (check_field_decls): Complain about non-static data + members of reference type in unions. Propagate + CLASSTYPE_REF_FIELDS_NEED_INIT and + CLASSTYPE_READONLY_FIELDS_NEED_INIT from the types of non-static + data members. + * init.c (perform_member_init): Complain about mbmers with const + type that are not explicitly initialized. + +2004-03-08 Mark Mitchell + + * class.c (check_methods): Don't use IDENTIFIER_ERROR_LOCUS. + * cp-tree.h (DECL_INVALID_OVERRIDER_P): New macro. + (lang_identifier): Remove implicit_decl and error_locus. + (IDENTIFIER_IMPLICIT_DECL): Remove. + (SET_IDENTIFIER_IMPLICTI_DECL): Likewise. + (IDENTIFIER_ERROR_LOCUS): Likewise. + (SET_IDENTIFIER_ERROR_LOCUS): Likewise. + (TYPE_ASSEMBLER_NAME_STRING): Likewise. + (TYPE_ASSEMBLER_NAME_LENGTH): Likewise. + (implicitly_declare): Remove. + * decl.c (warn_extern_redeclared_static): Remove check of + IDENTIFIER_IMPLICIT_DECL. + (duplicate_decls): Don't check IDENTIFIER_ERROR_LOCUS. + (implicitly_declare): Remove. + (grok_ctor_properties): Don't set IDENTIFIER_ERROR_LOCUS. + (start_function): Don't check IDENTIFIER_IMPLICIT_DECL. + (start_method): Don't check IDENTIFIER_ERROR_LOCUS. + * lex.c (unqualified_name_lookup_error): Create a dummy VAR_DECL + in the innermost scope, rather than at namespace scope. + * name-lookup.c (push_local_binding): Give it external linkage. + (pushdecl): Remove dead code. + * name-lookup.h (push_local_binding): Declare it. + * ptree.c (cxx_print_identifier): Don't print + IDENTIFIER_IMPLICIT_DECL or IDENTIFIER_ERROR_LOCUS. + * search.c (check_final_overrider): Use DECL_INVALID_OVERRIDER_P, + not IDENTIFIER_ERROR_LOCUS. + * typeck.c (build_function_call): Remove dead code. + +2004-03-08 Jason Merrill + + PR c++/13170 + * decl.c (xref_tag): Remove attribute handling. + * cp-tree.h: Adjust prototype. + * decl.c, parser.c, rtti.c: Adjust callers. + * parser.c (cp_parser_class_head): Pass back attributes in the + class head. + (cp_parser_class_specifier): Adjust. + +2004-03-08 Matt Austern + + PR debug/14079 + * name-lookup.c (add_decl_to_level): Add extern variables, as well + as static, to static_decls array. + +2004-03-05 Jason Merrill + + * tree.c (list_hash_pieces): s/TYPE_HASH/TREE_HASH/. + +2004-03-04 Geoffrey Keating + + * decl.c (grokfndecl): Update old incorrect comment. + (grokvardecl): Diagnose C++ variables of type with no linkage. + +2004-03-01 Mark Mitchell + + PR c++/14369 + * pt.c (build_non_dependent_expr): Do not create a + NON_DEPENDENT_EXPR for a THROW_EXPR. + +2004-03-01 Gabriel Dos Reis + + PR c++/14369 + * error.c (dump_expr): Handle THROW_EXPR. + +2004-03-01 Mark Mitchell + + PR c++/14360 + * parser.c (cp_parser_postfix_expression): Do not perform Koenig + lookup if ordinary name-lookup finds a non-function. + * pt.c (tsubst_copy_and_build): Likewise. + + PR c++/14361 + * parser.c (cp_parser_late_parsing_default_args): Check that there + are no extra tokens after the end of the default-argument + expression. + +2004-03-01 Mark Mitchell + + PR c++/14324 + * lex.c (retrofit_lang_decl): Treat entities with no linkage as + having C++ linkage for name-mangling purposes. + + PR c++/14260 + * parser.c (cp_parser_direct_declarator): Recognize constructor + declarators that use a template-id to name the class being + constructed. + + PR c++/14337 + * pt.c (tsubst_qualified_id): Handle dependent qualifying scopes. + (tsubst_expr): Do not call tsubst_copy, even when + processing_template_decl. + +2004-03-01 Jeff Law + + * init.c (build_vec_delete_1): Convert 2nd argument to NE_EXPR to + the proper type. + +2004-02-29 Mark Mitchell + + PR c++/14138 + * name-lookup.h (push_scope): Change prototype. + * name-lookup.c (push_scope): Do not reenter the current class + scope. + * decl.c (grokfndecl): Check return code from push_scope before + calling pop_scope. + * decl2.c (check_classfn): Likewise. + * parser.c (cp_parser_conversion_function_id): Likewise. + (cp_parser_init_declarator): Likewise. + (cp_parser_direct_declarator): Likewise. + (cp_parser_class_specifier): Likewise. + (cp_parser_class_head): Likewise. + (cp_parser_lookup_name): Likewise. + (cp_parser_constructor_declarator_p): Likewise. + * pt.c (instantiate_class_template): Likewise. + (resolve_typename_type): Likewise. + +2004-02-29 Mark Mitchell + + PR c++/14267 + * typeck.c (build_modify_expr): Remove more of the cast-as-lvalue + extension. + + PR debug/12103 + * class.c (update_vtable_entry_for_fn): Do not go through + covariance machinery if the type returned by an overrider is the + same as the original. + +2004-02-29 Kazu Hirata + + * call.c: Fix a comment typo. + +2004-02-27 Ziemowit Laski + + * tree.c (pod_type_p): Treat VECTOR_TYPEs as PODs. + +2004-02-26 Mark Mitchell + + PR c++/14278 + * parser.c (cp_parser_parameter_declaration_list): Commit + to fewer tentative parses. + +2004-02-26 Giovanni Bajo + + PR c++/14284 + * pt.c (dependent_type_p_r): A template template parameter is a + dependent type. + +2004-02-26 Giovanni Bajo + + PR c++/14246 + * mangle.c (write_template_arg_literal): Don't rely on identity for + boolean constants. + +2004-02-24 Jason Merrill + + * tree.c (build_exception_variant): Use check_qualified_type. + +2004-02-23 Zack Weinberg + Kazu Hirata + + * decl.c (cxx_init_decl_processing): Don't check + flag_writable_strings. + +2004-02-23 Andrew Pinski + + PR c++/14156 + * typeck.c (maybe_warn_about_returning_address_of_location): + Change check for VAR_DECL to use DECL_P instead. + +2004-02-23 Giovanni Bajo + + PR c++/14250 + * cvt.c (build_expr_type_conversion): Type must be complete before + looking up for conversions. + +2004-02-23 Giovanni Bajo + + PR c++/14143 + * name-lookup.c (arg_assoc_class): Don't look into template + arguments if it is not a primary template. + +2004-02-20 John David Anglin + + PR c++/12007 + * method.c (use_thunk): Always clone function argument tree. + +2004-02-20 Mark Mitchell + + PR c++/14199 + * pt.c (tsubst_copy): Call mark_used for a PARM_DECL. + + PR c++/14173 + * semantics.c (begin_class_definition): Set TYPE_PACKED correctly + for all type variants. + +2004-02-19 Mark Mitchell + + PR c++/13927 + * decl.c (duplicate_decls): Return error_mark_node for invalid + redeclarations. + * name-lookup.c (push_namespace): Ignore the return value from + pushdecl. + * pt.c (push_template_decl_real): Robustify. + + PR c++/14186 + * name-lookup.c (push_class_level_binding): Do not complain about + adding a binding for a member whose name is the same as the + enclosing class if the member is located in a base class of the + current class. + +2004-02-19 Giovanni Bajo + + PR c++/14181 + * parser.c (cp_parser_new_expression): Parse an ill-formed + direct-new-declarator after a parenthesized type-id to emit good + diagnostic. + +2004-02-18 Kazu Hirata + + * cp-tree.def, cvt.c: Update copyright. + +2004-02-17 Mark Mitchell + + PR c++/11326 + * cp-tree.h (abi_version_at_least): Remove. + * mangle.c: Include flags.h. + +2004-02-15 Mark Mitchell + + PR c++/13971 + * call.c (build_conditional_expr): Handle conversions between + class types which result in differently cv-qualified type + variants. + + PR c++/14086 + * class.c (delete_duplicate_fields_1): Remove. + (delete_duplicate_fields): Likewise. + (finish_struct_anon): Remove check for members with the same name + as their enclosing class. + (check_field_decls): Do not call duplicate_fields. + * decl.c (grokdeclarator): Remove check for static data members + with the same name as their enclosing class. + * name-lookup.c (push_class_level_binding): Check for members with + the same name as their enclosing class. + +2004-02-15 Gabriel Dos Reis + + PR c++/14085 + * error.c (dump_decl): Handle TEMPLATE_TYPE_PARM. + +2004-02-14 Kriang Lerdsuwanakij + + PR c++/13635 + * pt.c (push_template_decl_real): Make sure DECL_TI_ARGS of DECL + has full set of arguments. + +2004-02-13 Giovanni Bajo + + PR c++/13927 + * error.c (dump_decl) : Dump as simple declarations. + +2004-02-13 Mark Mitchell + + PR c++/14122 + * cp-tree.h (delete_sanity): Change prototype. + * decl2.c (delete_sanity): Make doing_vec a bool, not an int. + Remove dead code. Adjust code to warn about deleting an array. + * typekc.c (decay_conversion): Use build_address and build_nop. + + PR c++/14108 + * search.c (accessible_p): Do not check access in thunks. + + PR c++/14083 + * call.c (build_conditional_expr): Call force_rvalue on the + non-void operand in the case that one result is a throw-expression + and the other is not. + +2004-02-13 Ian Lance Taylor + + PR c++/9851 + * parser.c (cp_parser_pseudo_destructor_name): Check for errors on + the type name and look ahead for ::~, and bail out early with a + better error message if the parse is going to fail. + +2004-02-12 Mark Mitchell + + * call.c (conversion_kind): New type. + (conversion_rank): Likewise. + (conversion): Likewise. + (CONVERSION_RANK): New macro. + (conversion_obstack): New variable. + (obstack_initialized): Likewise. + (z_candidate): Change type of convs and second_conv. + (candidate_warning): New type. + (IDENTITY_RANK): Remove. + (EXACT_RANK): Likewise. + (PROMO_RANK): Likewise. + (STD_RANK): Likewise. + (PBOOL_RANK): Likewise. + (USER_RANK): Likewise. + (ELLIPSIS_RANK): Likewise. + (BAD_RANK): Likewise. + (ICS_RANK): Likewise. + (ICS_STD_RANK): Likewise. + (ICS_USER_FLAG): Likewise. + (ICS_ELLIPSIS_FLAG): Likewise. + (ICS_THIS_FLAG): Likewise. + (ICS_BAD_FLAG): Likewise. + (NEED_TEMPORARY_P): Likewise. + (CHECK_COPY_CONSTRUCTOR_P): Likewise. + (USER_CONV_CAND): Likewise. + (USER_CONV_FN): Likewise. + (conversion_obstack_alloc): New function. + (alloc_conversion): Likewise. + (validate_conversion_obstack): Likewise. + (alloc_conversions): Likewise. + (build_conv): Adjust to deal with new conversion data structures. + (build_identity_conv): New function. + (build_ambiguous_conv): Likewise. + (standard_conversion): Adjust to deal with new conversion data + structures. + (convert_class_to_reference): Likewise. + (direct_reference_binding): Likewise. + (reference_binding): Likewise. + (implicit_conversion): Likewise. + (add_candidate): Likewise. + (add_function_candidate): Likewise. + (add_conv_candidate): Likewise. + (build_builtin_candidate): Likewise. + (print_z_candidate): Likewise. + (merge_conversion_sequences): Likewise. + (build_user_type_conversion_1): Likewise. + (build_user_type_conversion): Likewise. + (build_new_function_call): Likewise. + (build_object_call): Likewise. + (conditional_conversion): Likewise. + (build_conditional_expr): Likewise. + (build_new_op): Likewise. + (build_op_delete_call): Likewise. + (convert_like_real): Likewise. + (build_over_call): Likewise. + (build_new_method_call): Likewise. + (is_subseq): Likewise. + (maybe_handle_implicit_object): Likewise. + (maybe_handle_ref_bind): Likewise. + (compare_ics): Likewise. + (source_type): Likewise. + (add_warning): Likewise. + (joust): Likewise. + (can_convert_arg): Likewise. + (can_convert_arg_bad): Likewise. + (perform_implicit_conversion): Likewise. + (perform_direct_initialization_if_possible): Likewise. + (initialize_reference): Likewise. + * cp-lang.c (cp_tree_size): Do not handle WRAPPER. + * cp-tree.def (WRAPPER): Likewise. + (IDENTITY_CONV): Remove. + (LVALUE_CONV): Likewise. + (QUAL_CONV): Likewise. + (STD_CONV): Likewise. + (PTR_CONV): Likewise. + (PMEM_CONV): Likewise. + (BASE_CONV): Likewise. + (REF_BIND): Likewise. + (USER_CONV): Likewise. + (AMBIG_CONV): Likewise. + (RVALUE_CONV): Likewise. + * cp-tree.h (tree_wrapper): Remove. + (WRAPPER_ZC): Remove. + (lang_tree_node): Remove wrapper. + (LOOKUP_SPECULATIVELY): Remove. + (build_op_delete_call): Adjust prototype. + (validate_conversion_obstack): Declare. + (build_zc_wrapper): Remove. + * cvt.c (convert_to_reference): Remove dead code. + (ocp_convert): Likewise. + * decl.c (redeclaration_error_message): Correct handling of + templates. + (finish_destructor_body): Do not use LOOKUP_SPECULATIVELY. + (cp_tree_node_structure): Remove WRAPPER case. + * decl2.c (finish_file): Call validate_conversion_obstack. + * init.c (build_new_1): Remove use of LOOKUP_SPECULATIVELY. + (build_op_delete_call): Likewise. + (build_x_delete): Likewise. + (build_delete): Adjust call to build_op_delete_call. + * pt.c (tsubst_friend_declaration): Adjust code to determine + whether or not a friend template is a definition. + (tsubst_decl): Clear DECL_INITIAL for new FUNCTION_DECLs. + * tree.c (build_zc_wrapper): Remove. + +2004-02-12 Zack Weinberg + + * cp-lang.c: Don't define LANG_HOOKS_BUILTIN_TYPE_DECLS. + * cp-tree.h: Don't declare cxx_builtin_type_decls. + * decl.c (builtin_type_decls, cxx_builtin_type_decls): Delete. + (record_builtin_type): Call debug_hooks->type_decl on the TYPE_DECL. + +2004-02-10 Mark Mitchell + + * typeck.c (lookup_destructor): Fix typo in error message. + +2004-02-09 Kazu Hirata + + * call.c, parser.c, tree.c: Fix comment typos. + +2004-02-07 Zack Weinberg + + Bug 13856 + * optimize.c (maybe_clone_body): Don't update DECL_ESTIMATED_INSNS. + * decl.c (duplicate_decls, start_function): Likewise. + +2004-02-07 Zack Weinberg + + * name-lookup.c (pushdecl): Issue shadow warnings directly. + * parser.c (free_parser_stacks): Delete. + +2004-02-07 Kazu Hirata + + * rtti.c: Update copyright. + +2004-02-06 Giovanni Bajo + + PR c++/14033 + * decl.c (require_complete_types_for_parms): Do not insert + error_mark_node in the parameter list. + +2004-02-06 Giovanni Bajo + + PR c++/14028 + * parser.c (cp_parser_enclosed_template_argument_list): Emit straight + error when terminator can not be found. + +2004-02-05 Kelley Cook + + Make-lang.in (po-generated): Delete. + +2004-02-05 Kazu Hirata + + * call.c (type_passed_as): Replace PROMOTE_PROTOTYPES with + targetm.calls.promote_prototypes. + +2004-02-05 Rainer Orth + + PR middle-end/13750 + Revert: + 2004-01-15 Geoffrey Keating + PR pch/13361 + * cp/lex.c (handle_pragma_interface): Duplicate string from tree. + (handle_pragma_implementation): Likewise. + +2004-02-05 Mark Mitchell + + PR c++/13714 + * typeck.c (lookup_destructor): Tweak error message. + +2004-02-05 Jan Hubicka + + * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat + functions. + +2004-02-05 Giovanni Bajo + + PR c++/14008 + * parser.c (cp_parser_diagnose_invalid_typename): Removed parsing + code, only emits the diagnostic now. Added lookup of the identifier + and support for qualified ids. + (cp_parser_parse_and_diagnose_invalid_type_name): New function. + Parse an (invalid) type name as id-expression within a declarator. + (cp_parser_simple_declaration): Use it. + (cp_parser_member_declaration): Likewise. + (cp_parser_make_typename_type): New function. Handle errors through + cp_parser_diagnose_invalid_typename. + (cp_parser_elaborated_type_specifier): Use it. + +2004-02-04 Mark Mitchell + + PR c++/13932 + * call.c (convert_like_real): Use "converting" rather than + "argument" as the descriptive keyword to + dubious_conversion_warnings. + * typeck.c (convert_for_assignment): Do not call + dubious_conversion_warnings. + +2004-02-04 Giovanni Bajo + + PR c++/13086 + * init.c (build_delete): Emit a more informative error message in + case of an incomplete type, and on the correct source line. + +2004-02-04 Kazu Hirata + + * error.c, search.c: Update copyright. + +2004-02-04 Mark Mitchell + + PR c++/9941 + * rtti.c (tinfo_base_init): Use import_export_tinfo to decide the + linkage for the typeinfo name string. + +2004-02-04 Mark Mitchell + + PR c++/13969 + * cp-tree.h (fold_non_dependent_expr): New function. + * parser.c (cp_parser_fold_non_dependent_expr): Remove. + (cp_parser_template_argument): Use fold_non_dependent_expr. + (cp_parser_direct_declarator): Likewise. + * pt.c (fold_non_dependent_expr): New function. + (convert_nontype_argument): Use it. + (tsubst_qualified_id): Simplify. + (tsubst_copy_and_build): Likewise. + +2004-02-04 Mark Mitchell + + * decl.c (cxx_push_function_context): Do not set + current_function_is_thunk. + * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the + actual function. + +2004-02-04 Giovanni Bajo + + PR c++/13997 + * pt.c (more_specialized_class): Increase processing_template_decl + while partial ordering. + +2004-02-03 Mark Mitchell + + PR c++/13925 + * decl.c (start_function): Do not call pushdecl for any + instantiation or specialization of a primary template. + +2004-02-03 Mark Mitchell + + PR c++/13950 + * parser.c (cp_parser_class_name): Robustify. + + PR c++/13970 + * parser.c (cp_parser_cache_group): Do not consume the EOF token. + + PR c++/14002 + * semantics.c (finish_id_expression): Do not return an + IDENTIFIER_NODE when lookup finds a PARM_DECL. + +2004-02-03 Mark Mitchell + + PR c++/13978 + * pt.c (build_non_dependent_expr): Do not build + NON_DEPENDENT_EXPRs for FUNCTION_DECLs or TEMPLATE_DECLs. + + PR c++/13968 + * semantics.c (finish_id_expression): Do not return an + IDENTIFIER_NODE when lookup finds a VAR_DECL. + + PR c++/13975 + * parser.c (cp_parser_simple_declaration): When skipping to the + end of the statement swallow the terminating semicolon. + +2004-02-02 Mark Mitchell + + PR c++/13113 + * init.c (build_offset_ref): Improve error recovery for invalid + uses of non-static member functions. + + PR c++/13854 + * cp-tree.h (cp_build_type_attribute_variant): New function. + * class.c (build_clone): Use cp_build_type_attribute_variant. + * decl.c (duplicate_decls): Likewise. + * pt.c (copy_default_args_to_explicit_spec): Likewise. + (tsubst_function_type): Likewise. + * tree.c (build_exception_variant): Check attributes before + concluding that two types are the same. + (cp_build_type-attribute_variant): New method. + * typeck.c (merge_types): Use cp_build_type_attribute_variant. + + PR c++/13907 + * call.c (convert_class_to_reference): Keep better track of + pedantically invalid user-defined conversions. + +2004-02-01 Giovanni Bajo + + PR c++/13957 + * pt.c (tsubst_qualified_id): Improved error message when a type + is expected but not found. + +2004-01-31 Kazu Hirata + + * class.c: Fix comment typos. + * decl.c: Likewise. + * error.c: Likewise. + * parser.c: Likewise. + * pt.c: Likewise. + * search.c: Likewise. + * typeck.c: Likewise. + +2004-01-30 Richard Henderson + + PR c++/13693 + * method.c (use_thunk): Don't force_target_expr for void thunks. + * tree.c (build_target_expr_with_type): Assert non-void type. + (force_target_expr): Likewise. + +2004-01-30 Michael Matz + + * parser.c (cp_parser_labeled_statement): Accept case ranges. + +2004-01-30 Giovanni Bajo + + DR206 + PR c++/13813 + * decl.c (grokdeclarator): Check immediatly type completeness for + non-dependent types. + +2004-01-30 Giovanni Bajo + + PR c++/13683 + * call.c (convert_arg_to_ellipsis): Don't emit a warning if within + a sizeof expression.block + +2004-01-29 Mark Mitchell + + PR c++/13883 + * mangle.c (write_encoding): Correct encoding of member template + constructors. + +2004-01-28 Giovanni Bajo + + * parser.c (cp_parser_template_id): Parse tentatively `[:' after a + template name as it was `<::' (digraph typo). + (cp_parser_nth_token_starts_template_argument_list_p): New function. + (cp_parser_id_expression): Use it. + (cp_parser_nested_name_specifier_opt): Likewise. + (cp_parser_template_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_lexer_get_preprocessor_token): Use c_lex_with_flags. + +2004-01-28 Mark Mitchell + + PR c++/13791 + * typeck.c (merge_types): Do not merge attributes into + TYPENAME_TYPEs. + + PR c++/13736 + * parser.c (cp_parser_direct_declarator): Do not prevent + backtracking inside a parenthesized declarator. + (cp_parser_parameter_declaration): Fix typo in comment. + +2004-01-28 Jan Hubicka + + * semantics.c (expand_body) Do emit_associated_thunks before + expansion. + +2004-01-27 Devang Patel + + * name-lookup.c: Include "debug.h" + (do_namespace_alias): Invoke debug_hooks to emit debug info + for namespace alias. + (do_local_using_decl): Invoke debug_hooks to emit debug info + for using decl. + (do_class_using_decl): Same. + (do_toplevel_using_decl): Same. + (do_using_directive): Same. + (cp_emit_debug_info_for_using): New function. + * Make-lang.in (cp/parser.o): Depend on debug.h + (cp/name-lookup.o): Same. + +2004-01-26 Kaveh R. Ghazi + + * cp-tree.h (language_function, lang_type_header): Use + BOOL_BITFIELD. + * name-lookup.h (cp_binding_level): Likewise. + +2004-01-26 Mark Mitchell + + PR c++/13663 + * semantics.c (finish_for_expr): Check for unresolved overloaded + functions. + + * class.c (add_method): Just check processing_template_decl to + determine whether or not we are within a template. + * decl2.c (maybe_retrofit_in_chrg): Likewise. + * init.c (decl_constant_value): Check the type of the declaration, + not TREE_READONLY. + * name-lookup.c (maybe_push_to_top_level): Rename to ... + (push_to_top_level): ... this. + * name-lookup.h (maybe_push_to_top_level): Do not declare it. + * pt.c (push_template_decl_real): Reorder condition for speed. + (convert_template_argument): Use dependency-checking functions in + place of uses_template_parms. + (lookup_template_class): Avoid calling uses_template_parms more + than once. + (uses_template_parms): Reimplement, using dependency-checking + functions. + (instantiate_class_template): Use push_to_top_level, not + maybe_push_to_top_level. + (type_unification_real): Simplify. + (type_dependent_expression_p): Handle OFFSET_REFs and + TEMPLATE_DECLs. + (any_dependent_template_arguments_p): Handle multiple levels of + template argument. + * semantics.c (expand_or_defer_fn): Do not check + uses_template_parms for template instantiations. + * typeck.c (comptypes): Avoid calling cp_type_quals. + +2004-01-25 Mark Mitchell + + PR c++/13833 + * call.c (build_over_call): Do not convert arguments when + processing a template. + * pt.c (build_non_dependent_expr): Do not build a + NON_DEPENDENT_EXPR for arithmetic constants. + +2004-01-25 Giovanni Bajo + + PR c++/13810 + * parser.c (cp_parser_type_parameter): When cp_parser_id_expression + returns a TYPE_DECL. no further lookup is required. + * semantics.c (check_template_template_default_arg): A TYPE_DECL + is invalid. Rework to give better diagnostics. + +2004-01-25 Kriang Lerdsuwanakij + + PR c++/13797 + * pt.c (instantiate_class_template): Add an error_mark_node + check. + (tsubst_decl) : Likewise. + +2004-01-23 Andrew Pinski + + PR c++/13701 + * decl.c (finish_function): Move the call to + finish_fname_decls below the call to + finish_eh_spec_block. + +2004-01-21 Kazu Hirata + + * optimize.c, typeck2.c: Update copyright. + +2004-01-21 Kazu Hirata + + * Make-lang.in, call.c, class.c, decl2.c, except.c, expr.c, + init.c, mangle.c, typeck.c: Update copyright. + +2004-01-21 Zdenek Dvorak + + * parser.c (cp_parser_class_specifier): Prevent garbage collection. + +2004-01-20 Kelley Cook + + * Make-lang.in: Replace $(docdir) with doc. + (c++.info, c++.srcinfo): Dummy entry. + (c++.man, c++.srcman): New rules. + (c++.install-man): Revamp rule. + +2004-01-20 Kelley Cook + + * Make-lang.in (CXX_INSTALL_NAME, GXX_INSTALL_NAME, + CXX_TARGET_INSTALL_NAME, GXX_TARGET_INSTALL_NAME): Define via a + immediate $(shell) instead of deferred backquote. + +2004-01-19 Mark Mitchell + + PR c++/13651 + * parser.c (cp_parser_postfix_expression): When encountering + incomplete type on left-hand side of "->" or ".", treat the entire + expression as erroneous. + + PR c++/13592 + * call.c (build_field_call): Remove. + (n_build_method_call): Likewise. + (build_method_call): Likewise. + (build_new_method_call): Do not call build_field_call. + * class.c (n_build_method_call): Remove. + (print_class_statistics): Do not print it. + * cp-tree.h (build_method_call): Remove declaration. + (finish_object_call_expr): Likewise. + (build_new_1): Do not use build_method_call. + * parser.c (cp_parser_postfix_expression): Use finish_call_expr + when the function appearing on the right-hand-side of "." or "->" + is not actually a function. + * pt.c (tsubst_copy_and_build): Likewise. + * semantics.c (finish_object_call_expr): Remove. + +2004-01-18 Mark Mitchell + + PR c++/13710 + * pt.c (tsubst): Use finish_typeof. + +2004-01-18 Jason Merrill + + PR c++/11725 + * except.c (build_throw): In a template, set + current_function_returns_abnormally. + +2004-01-17 Fred Fish + + PR c++/11895 + * decl.c (reshape_init): Handle VECTOR_TYPE like ARRAY_TYPE, + except don't call array_type_nelts() with a VECTOR_TYPE. + +2004-01-16 Jan Hubicka + + * mangle.c (write_mangled_name): Remove inline modifier. + +2004-01-16 Mark Mitchell + + PR c++/13574 + * decl.c (compute_array_index_type): Fix grammar in comment. + * init.c (build_zero_init): Handle zero-sized arrays correctly. + + PR c++/13178 + * call.c (name_as_c_string): Print conversion operator names + correctly. + + PR c++/13478 + * call.c (initialize_reference): Pass -1 for inner parameter to + convert_like_real. + +2004-01-15 Giovanni Bajo + + PR c++/13407 + * parser.c (cp_parser_base_specifier): Check for an invalid + keyword `typename' and emit an user-friendly error message. + +2004-01-15 Geoffrey Keating + + PR pch/13361 + * cp/lex.c (handle_pragma_interface): Duplicate string from tree. + (handle_pragma_implementation): Likewise. + +2004-01-15 Giovanni Bajo + + PR c++/9259 + * typeck.c (build_class_member_access_expr): Allow to access members + of the currently open class. + (finish_class_member_access_expr): Likewise. + +2004-01-15 Alexandre Oliva + + PR c++/13659 + * name-lookup.c (validate_nonmember_using_decl): Take scope and + name by value, instead of computing them. + (do_local_using_decl, do_toplevel_using_decl): Add scope and name + arguments. Pass them to validate_nonmember_using_decl. + * name-lookup.h (do_local_using_decl): Adjust. + (do_toplevel_using_decl): Likewise. + * parser.c (cp_parser_using_declaration): Likewise. + * pt.c (tsubst_expr): Likewise. + +2004-01-15 Alexandre Oliva + + PR c++/13594 + PR c++/13658 + * name-lookup.c (qualified_lookup_using_namespace): Search + strongly-associated namespaces first, and only then try other + namespaces. + +2004-01-15 Kelley Cook + + * Make-lang.in (c++.srcextra): Dummy entry. + +2004-01-15 Giovanni Bajo + + PR c++/8856 + * parser.c (cp_parser_template_name): Don't try to parse a + conversion-function-id, as it cannot be a template-name. + (cp_parser_simple_type_specifier): Check for invalid template-ids + even after a built-in type. + +2004-01-14 Jan Hubicka + + PR c++/12850 + * pt.c (instantiate_decl): Do not increase function_depth. + +2004-01-14 Danny Smith + + PR c++/9021 + PR c++/11005 + * parser.c (cp_parser_elaborated_type_specifier): Warn about + attributes and discard. + * decl.c (xref_tag): Don't overwite existing attributes with + NULL_TREE. + +2004-01-14 Giovanni Bajo + + PR c++/12335 + * parser.c (cp_parser_lookup_name): Return error_mark_node if there + is no destructor while looking up a BIT_NOT_EXPR. + +2004-01-13 Ian Lance Taylor + + * cxxfilt.c: Remove unused file. + +2004-01-14 Jan Hubicka + + Partial fix to PR c++/12850 + * decl2.c (mark_used): Do not proactively instantiate templates + when compiling in unit-at-a-time or not optimizing. + * optimize.c (maybe_clone_body): Do not increase function depth. + +2004-01-13 Giovanni Bajo + + PR c++/13474 + * pt.c (tsubst) : Remove obsolete array index tweaking. + +2004-01-12 Steven Bosscher + + PR c++/13558 + * parser.c (cp_parser_member_declaration): Any non-type is also + not a class or a function. + +2004-01-12 Jason Merrill + + PR c++/12815 + * class.c (build_base_path): Do not mark vtable references as + TREE_CONSTANT. + (build_vtbl_ref_1): Likewise. + +2004-01-12 Richard Henderson + + PR opt/10776 + * typeck2.c (split_nonconstant_init_1, split_nonconstant_init): New. + (store_init_value): Use it. + * decl.c (check_initializer): Expect full initialization code + from store_init_value. + * init.c (expand_aggr_init_1): Likewise. + * decl2.c (maybe_emit_vtables): Abort if runtime init needed. + +2004-01-12 Mark Mitchell + + * class.c (layout_class_type): For non-POD class types, also copy + the DECL_SIZE and DECL_MODE of fields to the base class type. + +2004-01-12 Kriang Lerdsuwanakij + + PR c++/13289 + * pt.c (instantiate_decl): Set DECL_TEMPLATE_INSTANTIATED before + calling regenerate_decl_from_template. + +2004-01-12 Scott Brumbaugh + + PR c++/4100 + * parser.c (cp_parser_decl_specifier_seq): Add check for a friend + decl-specifier occurring along with a class definition. + +2004-01-12 Ian Lance Taylor + + * parser.c (cp_parser_decl_specifier_seq): Add parenthetical + clauses to comments describing declares_class_or_enum. + (cp_parser_type_specifier): Set *declares_class_or_enum to 0, not + false. + +2004-01-12 Jan Hubicka + + * pt.c (for_each_template_parm): Do not check for duplicates. + (for_each_template_parm): Use walk_tree duplicate checking code. + +2004-01-11 Ian Lance Taylor + + PR c++/3478 + * parser.c (cp_parser_decl_specifier_seq): If the first decl_spec + is error_mark_node, don't add any more decl_specs. + (cp_parser_init_declarator): After committing to a declaration, if + the decl_specifiers start with error_mark_node, issue an error and + change the type to "int". + +2004-01-09 Nathanael Nerode + + PR bootstrap/7817 + * Make-lang.in: Copy gcc.1 to g++.1 rather than using .so. + +2004-01-10 Giovanni Bajo + + DR 337 + PR c++/9256 + * pt.c (tsubst): Substitution must fail if we are attempting to + create an array with element type that is an abstract class type. + * decl.c (cp_finish_decl): Strip pointers and array types recursively + before calling abstract_virtuals_error. + +2004-01-09 Alexandre Oliva + + * name-lookup.c (qualified_lookup_using_namespace): Consider + strong using directives even if we've already found a binding. + +2004-01-09 Mark Mitchell + + * cp-tree.h (cxx_expand_expr): Change prototype. + * expr.c (cxx_expand_expr): Add alt_rtl parameter. + +2004-01-08 Giovanni Bajo + + PR c++/12573 + * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by + looking into them recursively. They can be there because of the + new __offsetof__ extension. + +2004-01-07 Zack Weinberg + + * parser.c (cp_parser_save_member_function_body): Mark the + definition static. + +2004-01-05 Mark Mitchell + + PR c++/13057 + * class.c (build_clone): Copy type attributes from the original + function to the clone. + + PR c++/12815 + * class.c (build_vtbl_ref_1): Do not unconditionally mark vtable + references as constant. + + PR c++/12132 + * parser.c (cp_parser_explicit_instantiation): Improve error + recovery. + (cp_parser_require): Improve indication of the error location. + + PR c++/13451 + * parser.c (cp_parser_class_head): Reorder logic to check for + invalid qualification. + +2004-01-04 Mark Mitchell + + PR c++/13157 + * name-lookup.c (lookup_using_namespace): Remove spacesp + parameter. + (unqualified_namespace_lookup): Likewise. + (lookup_qualified_name): Adjust accordingly. + (lookup_name_real): Likewise. + (lookup_arg_dependent): Do not eliminate the namespace of the + functions found by unqualified name lookup unless that is the + current namespace. + +2004-01-04 Andrew Pinski + + * semantics.c (push_deferring_access_checks): Fix format. + (resume_deferring_access_checks): Likewise. + (stop_deferring_access_checks): Likewise. + (pop_deferring_access_checks): Likewise. + (get_deferred_access_checks): Likewise. + (pop_to_parent_deferring_access_checks): Likewise. + (perform_deferred_access_checks): Likewise. + (perform_or_defer_access_check): Likewise. + +2004-01-04 Richard Henderson + + * call.c (build_over_call): Don't create a save_expr of an + aggregate, but rather its address. + +2004-01-04 Mark Mitchell + + PR c++/13529 + * parser.c (cp_parser_postfix_expression): Allow "." to appear in + an offsetof expression. + + * parser.c (cp_parser_parameter_declaration): Fix comment. + + PR c++/12226 + * call.c (CHECK_COPY_CONSTRUCTOR_P): New macro. + (reference_binding): Set it when appropriate. + (build_temp): New function, split out from ... + (convert_like_real): ... here. Honor CHECK_COPY_CONSTRUCTOR_P. + (initialize_reference): Likewise. + + PR c++/13536 + * parser.c (cp_parser): Add in_type_id_in_expr_p. + (cp_parser_new): Initialize it. + (cp_parser_postfix_expression): Set it. + (cp_parser_sizeof_operand): Likewise. + (cp_parser_parameteR_declaration): Do not commit early to tenative + parsers when in_type_id_in_expr_p is set. + +2004-01-03 Kriang Lerdsuwanakij + + PR c++/13094 + * parser.c (cp_parser_template_argument): Don't call + make_unbound_class_template directly. + (cp_parser_lookup_name): Don't extract TEMPLATE_DECL from + UNBOUND_CLASS_TEMPLATE tree node. + +2004-01-02 Richard Sandiford + + PR target/12729 + * method.c (use_thunk): Pass the CALL_EXPR through force_target_expr. + +2004-01-02 Kriang Lerdsuwanakij + + PR c++/13520 + * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): New macro. + (DECL_FUNCTION_TEMPLATE_P): Use it. + (DECL_CLASS_TEMPLATE_P): Likewise. + * parser.c (cp_parser_lookup_name): Add is_template parameter. + (cp_parser_type_parameter): Adjust call to cp_parser_lookup_name. + (cp_parser_template_name): Likewise. + (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_namespace_name): Likewise. + (cp_parser_class_name): Likewise. + (cp_parser_lookup_name_simple): Likewise. diff --git a/gcc/cp/ChangeLog.1 b/gcc/cp/ChangeLog.1 deleted file mode 100644 index 01ef399698c..00000000000 --- a/gcc/cp/ChangeLog.1 +++ /dev/null @@ -1,9451 +0,0 @@ -Sun Nov 26 14:47:42 1995 Richard Kenner - - * Version 2.7.2 released. - -Mon Nov 20 14:05:00 1995 Mike Stump - - * g++.c (pfatal_with_name): Add missing third argument to concat. - -Thu Oct 26 13:59:54 1995 Mike Stump - - * init.c (expand_aggr_init): Handle cv qualifiers on the object's - type. - -Sat Nov 11 08:25:55 1995 Richard Kenner - - * Version 2.7.1 released. - -Thu Nov 2 17:02:47 1995 Jason Merrill - - * call.c (convert_harshness): Handle references to arrays. - -Fri Oct 27 14:20:21 1995 Jason Merrill - - * typeck.c (comp_target_types): Check multi-level pointer - conversions in both directions. - -Tue Oct 17 21:39:05 1995 Jason Merrill - - * parse.y (explicit_instantiation): Fix 'extern template' with no - return type. - -Mon Oct 16 14:35:20 1995 Jason Merrill - - * parse.y (explicit_instantiation): Support automatic instantiation - of constructors. - (named_class_head_*): Support out-of-class definition of nested - types. - -Wed Oct 11 12:20:56 1995 Mike Stump - - * search.c (envelope_add_decl): New routine. Fix so that - methods are hidden in the same way that other members are. - (dfs_pushdecls): Cleanup and move functionality out of line, - into envelope_add_decl. - -Tue Oct 10 15:46:01 1995 Mike Stump - - * typeck.c (mark_addressable): Only call assemble_external if we - have started the output file. - -Tue Oct 10 11:27:18 1995 Jason Merrill - - * decl.c (start_function): Fix earlier cv-quals change. - -Mon Oct 9 23:53:05 1995 Mike Stump - - * parse.y (complex_direct_notype_declarator): Only push the class if - we are not already in the class. - -Mon Oct 9 11:22:03 1995 Doug Evans - - * decl.c (duplicate_decls): Call merge_machine_decl_attributes. - Update olddecl's attributes too. - (grokdeclarator): #if 0 out call to build_decl_attribute_variant. - * typeck.c (common_type): Call merge_machine_type_attributes. - -Fri Oct 6 14:44:27 1995 Mike Stump - - * typeck.c (mark_addressable): Add missing call to - assemble_external. - -Wed Oct 4 15:06:39 1995 Mike Stump - - * decl.c (store_parm_decls): Make sure the unwinder start comes - before the exception specification start. - * except.c (expand_exception_blocks): Make sure the unwinder end - comes after the terminate protected catch clause region and after - the end of the exception specification region. - -Wed Oct 4 12:47:02 1995 Jason Merrill - - * lex.c (real_yylex): Fix identifier case for linemode. - (handle_sysv_pragma): Don't abort when we see a pragma we don't - recognize. - -Tue Oct 3 14:09:46 1995 Mike Stump - - * decl.c (store_parm_decls): Add a call to start_eh_unwinder. - * except.c (init_exception_processing): __throw doesn't take any - arguments. - (expand_builtin_throw): Likewise. Always use Pmode, instead of SImode - for all pointers. Use expand_builtin_return_addr to unwind the - first level off the stack. - (do_unwind): Always use Pmode, instead of SImode for all pointers. - (expand_exception_blocks): Add a call to end_eh_unwinder. - (start_eh_unwinder, end_eh_unwinder): New routines to build machine - independent stack unwinders for function/method calls. - -Mon Oct 2 17:20:42 1995 Mike Stump - - * tree.c (unsave_expr_now): Make sure we process the argument list - of any called functions. Fixes incorrect code generation for - cleanups. - -Mon Oct 2 13:04:16 1995 Mike Stump - - * typeck.c (get_member_function_from_ptrfunc): Save function if it - needs it. Cures core dump on things like (this->*(f()))(). - -Sat Sep 23 22:51:25 1995 Jason Merrill - - * decl.c (start_function): Conform to gcc cv-quals convention (no - expression has a cv-qualified type) in RESULT_DECLs. - * method.c (make_thunk): Likewise. - -Fri Sep 22 10:21:13 1995 Mike Stump - - * decl.c (pushtag): Add in the namespace name for the tag. - -Thu Sep 21 13:11:13 1995 Mike Stump - - * parse.y (maybe_base_class_list, base_class_list, base_class, - base_class_access_list): Make sure we see the typenames for base - classes. - * lex.c (see_typename): Instead of failing to see a typename when - there is no next token, perfer a typename, and get the next token. - -Wed Sep 20 12:35:27 1995 Michael Meissner - - * decl.c (init_decl_processing): Add __builtin_expect. - -Tue Sep 19 16:48:11 1995 Mike Stump - - * cvt.c (cp_convert_to_pointer): Don't allow leftover conversions to - or from pointer to member functions, they must all be handled before - this point. - -Fri Sep 15 17:14:47 1995 Brendan Kehoe - - * init.c (resolve_offset_ref): Fix wording of non-static member - being referenced as a static. - -Fri Sep 15 12:39:11 1995 Jason Merrill - - * typeck.c (build_indirect_ref): Only bash pointer if we actually - call build_expr_type_conversion. - -Thu Sep 14 18:24:56 1995 Jason Merrill - - * cvt.c (build_expr_type_conversion): Handle conversion from - reference. - * typeck.c (build_indirect_ref): Avoid infinite recursion. - -Thu Sep 14 17:23:28 1995 Mike Stump - - * decl.c (expand_start_early_try_stmts): New routine to start a try - block at the start of the function, for function-try-blocks. - * cp-tree.h (expand_start_early_try_stmts): Declare it. - * parse.y (function_try_block): Use it, instead of doing it here, as - we don't want to include rtl.h here, as that conflicts with RETURN - in the parser. - -Wed Sep 13 18:32:24 1995 Mike Stump - - * lex.c (reinit_parse_for_block): Support saving inline - function-try-blocks, uses peekyylex. - * parse.y (eat_saved_input): New rule, permit the parser to see that - END_OF_SAVED_INPUT is ok, as it can see this when parsing the - handlers of a function-try-block. - (fndef): Use it. - (component_decl): Make sure TRY and RETURN can come after fn.def2. - * spew.c (peekyylex): New routine to peek at what will come next. - -Wed Sep 13 16:52:06 1995 Jason Merrill - - * typeck.c (comptypes): Tighten up comparisons of template type - parms. - - * decl.c (duplicate_decls): Turn off whining about virtual functions - redeclared inline for now. - -Wed Sep 13 11:13:40 1995 Mike Stump - - * decl.c (store_in_parms): New routine to put things before we - put base inits. - * cp-tree.h (store_in_parms): Declare it. - * decl.c (store_parm_decls): Use it to makr sure the starting of the - eh spec comes before base inits. - (finish_function): Use sequences instead of the obsolete - reorder_insns. - * parse.y (fndef): Enhance readability and maintainability. Update - to include function_try_block syntax. - (function_try_block): Add. - -Tue Sep 12 17:43:07 1995 Brendan Kehoe - - * call.c (convert_harshness): Use comptypes, not ==, to check if - TYPE and PARMTYPE are equivalent on a function type. - -Tue Sep 12 17:31:33 1995 Douglas Rupp - - * Make-lang.in (cc1plus): Removed unnecessary $(exeext). - -Mon Sep 11 23:24:07 1995 Mike Stump - - * except.c (expand_throw): Never allocate storage for thrown pointer - to objects. - -Mon Sep 11 19:36:45 1995 Mike Stump - - * except.c (expand_start_catch_block): Pointers to objects come - back from catch matching already dereferenced, don't dereference - again. - -Mon Sep 11 15:46:28 1995 Mike Stump - - * except.c (expand_throw): Only decay the throw expression, don't do - any default conversions. This is so that one can throw and catch - characters, and not have them match integers. - -Mon Sep 11 13:46:45 1995 Mike Stump - - * error.c (dump_aggr_type): Deal with anonymous unions that don't - have a TYPE_NAME. - -Fri Sep 8 20:40:27 1995 Brendan Kehoe - - * lex.c (handle_sysv_pragma): Deal with getting a comma from yylex. - -Fri Sep 8 15:51:41 1995 Mike Stump - - * except.c (expand_end_eh_spec): Handle empty EH specifications. - -Fri Sep 8 15:27:22 1995 Mike Stump - - * cp-tree.h (expand_start_eh_spec): Declare new routine. - (expand_end_eh_spec): Likewise. - * decl.c (store_parm_decls): Call expand_start_eh_spec to process - exception specifications. - * except.c (expand_leftover_cleanups): Remove unused parameter. - (expand_end_catch_block): Likewise. - (expand_exception_blocks): Likewise. - (expand_start_eh_spec): New routine to mark the start of an - exception specification region. - (expand_end_eh_spec): New routine to mark the end of an exception - specification region. - (expand_exception_blocks): Call expand_end_eh_spec to process - exception specifications. - -Fri Sep 8 14:40:48 1995 Per Bothner - - * lex.c (do_identifier): Use global binding in preference of - dead for local variable. - -Wed Sep 6 19:32:59 1995 Mike Stump - - * cp-tree.h (build_exception_variant): Remove used first argument. - * decl.c (duplicate_decls): Likewise. - (grokfndecl): Likewise. - (revert_static_member_fn): Likewise. - * decl2.c (grok_method_quals): Likewise. - * tree.c (build_exception_variant): Likewise. - * typeck.c (common_type): Likewise. - * decl2.c (grokclassfn): After changing the type, call - build_exception_variant, if necessary. - -Tue Sep 5 15:56:27 1995 Mike Stump - - * except.c (expand_throw): Run cleanups for the throw expression. - -Wed Aug 30 15:24:38 1995 Stephen L. Favor - - * except.c (expand_builtin_throw): Moved gen_label_rtx calls beyond - the store_parm_decls call which does initialization in the emit_* - code concerning label numbering. - -Thu Aug 31 09:01:07 1995 Mike Stump - - * except.c (expand_internal_throw): Let the frontend be responsible - for managing all frontend EH parameters, the backend routine only - needs to deal with backend values. type and value are no longer - passed to __throw. - (init_exception_processing): Likewise. - (expand_start_all_catch): Likewise. - (expand_end_all_catch): Likewise. - (expand_leftover_cleanups): Likewise. - (expand_end_catch_block): Likewise. - (expand_builtin_throw): Likewise. - (expand_throw): Likewise. - -Tue Aug 29 15:04:36 1995 Jason Merrill - - * cp-tree.h (DECL_REAL_CONTEXT): Give the real declaration context - for a decl. - * decl.c (cp_finish_decl): Use it. - -Tue Aug 29 10:30:27 1995 Mike Stump - - * except.c (expand_internal_throw): Oops, almost forgot type and - value are now trees. - -Mon Aug 28 17:57:45 1995 Brendan Kehoe - - Fix the attribute handling to make sure they get noted before we - create the function's RTL, in case they can affect that. - * decl.c (grokfndecl): New arg ATTRLIST. Run - cplus_decl_attributes before creating the decl's rtl. - (grokdeclarator): New arg ATTRLIST, passed down into grokfndecl. - (shadow_tag, groktypename, start_decl, start_method): Pass a - NULL_TREE to grokdeclarator's new last arg. - * decl2.c (grokfield): New arg ATTRLIST, passed into grokdeclarator. - (grokbitfield, grokoptypename): Pass a NULL_TREE to - grokdeclarator's new last arg. - * except.c (expand_start_catch_block): Likewise. - * pt.c (process_template_parm, end_template_decl, - do_function_instantiation): Likewise. - * cp-tree.h (grokfield): Add arg. - (grokdeclarator): Move the prototype from here... - * decl.h: ...to here. - * lex.c (cons_up_default_function): Pass NULL_TREE to grokfield - ATTRLIST argument. - * parse.y: Create a list for the grokfield arg where appropriate, - and pass it down instead of calling cplus_decl_attributes. - -Mon Aug 28 15:07:24 1995 Mike Stump - - * except.c: Always allow turning on exception handling. Allow cross - compilations to use EH. - -Thu Aug 24 17:39:24 1995 Mike Stump - - * except.c (saved_pc, saved_throw_type, saved_throw_value): Use - trees, instead of rtxs, and don't depend on using special machine - dependent registers. - (expand_internal_throw): Likewise. - (init_exception_processing): Likewise. - (expand_start_all_catch): Likewise. - (expand_end_all_catch): Likewise. - (expand_start_catch_block): Likewise. - (expand_leftover_cleanups): Likewise. - (expand_end_catch_block): Likewise. - (expand_builtin_throw): Likewise. - (expand_throw): Likewise. - -Wed Aug 23 17:25:51 1995 Jason Merrill - - * cvt.c (build_expr_type_conversion): Handle conversions to - reference types. - -Wed Aug 23 15:33:59 1995 Mike Stump - - * except.c (do_unwind): Work around backend bug with -fpic. - -Tue Aug 22 17:20:07 1995 Per Bothner - - * decl2.c (flag_new_for_scope): Add a new mode that follows ANSI - for-scoping, but supports (and warns about) old programs. - Make the new mode (with value 1) the default. - (lang_f_options): The on-value for flag_new_for_scope is now 2. - * cp-tree.h (DECL_DEAD_FOR_LOCAL, DECL_ERROR_REPORTED): New macros - (DECL_SHADOWED_FOR_VAR): Likewise. - * decl.c (struct binding_level): New fields dead_vars_from_for - and is_for_scope. - (note_level_for_for): New function. - (poplevel): Special processing if is_for_scope. - (pushdecl): Warn if for-scope variable shadows local. - * lex.c (do_identifier): Handle old (non-ANSI) for scoping, - and warn if conflicts. - * parse.y (FOR): Call note_level_for_for. - -Mon Aug 21 10:28:31 1995 Jason Merrill - - * decl2.c (import_export_inline): Class interface hackery does not - apply to synthesized methods. - -Sun Aug 20 16:29:00 1995 Mike Stump - - * search.c (virtual_context): Find the right context more often. - Solves a `recoverable compiler error, fixups for virtual function' - problem. - -Sun Aug 20 13:53:24 1995 Mike Stump - - * except.c (expand_start_all_catch): Ensure that we always transfer - control to the right EH handler, by rethrowing the end label on the - region, instead of hoping we are nested and falling through. - (expand_leftover_cleanups): Likewise. - (end_protect): Since we now rethrow the end label, put a - nop after it, so that outer regions are recognized. - * init.c (build_vec_delete_1): New routine to handle most of vector - deleting, all code moved here from build_vec_delete. - (build_array_eh_cleanup): Use build_vec_delete_1 to do all the real - work. - (expand_vec_init): If the array needs partial destructing, setup an - EH region to handle it. - (build_vec_delete): Move lots of code to build_vec_delete_1, use - build_vec_delete_1 to do the grunt work. - -Sat Aug 19 14:25:33 1995 Brendan Kehoe - - Handle decl attributes properly for function definitions without - previous attribute-loaded declarations. - * decl.c (start_function): New arg ATTRS. Add a call to - cplus_decl_attributes with it before we create the RTL. - * cp-tree.h (start_function): Update prototype. - * parse.y (fn.def1): Pass ATTRS into start_function instead of - trying to call cplus_decl_attributes too late. Pass a NULL_TREE - for other use. - * decl2.c (finish_file): Pass NULL_TREE as fourth arg to - start_function. - * method.c (synthesize_method): Likewise. - * except.c (expand_builtin_throw): Likewise for start on __throw. - -Sat Aug 19 13:36:08 1995 Mike Stump - - * class.c (set_rtti_entry): Turn on -fvtable-thunk -frtti support. - This changes -fvtable-thunks vtable layout, so a recompile will be - necessary, if you use -fvtable-thunks. - (get_vtable_entry): Use n, instead of i to be consistent with the - rest of the compiler. - (get_vtable_entry_n): Likewise. - (add_virtual_function): Add a slot for the tdesc, if -fvtable-thunks - are being used. - (finish_struct_1): Likewise. - (skip_rtti_stuff): New routine to collapse similar code from many - different parts of the compiler. I think I got them all. - (modify_one_vtable): Use it. - (fixup_vtable_deltas1): Likewise. - (override_one_vtable): Likewise. - * decl2.c (mark_vtable_entries): Likewise. - * tree.c (debug_binfo): Likewise. - * search.c (expand_upcast_fixups): Likewise. - (get_abstract_virtuals_1): Likewise. Use virtuals, instead of tmp to - consistent with the rest of the compiler. - (get_abstract_virtuals): Likewise. - * cp-tree.h (skip_rtti_stuff): New routine, declare it. - * gc.c (build_headof): Support -fvtable-thunk and -frtti together. - (build_typeid): Likewise. - (build_classof): Remove old style way of doing rtti. Remove support - for `classof' and `headof'. - * gxx.gperf: Likewise. - * hash.h: Likewise. - * parse.y: Likewise. - -Fri Aug 18 17:31:58 1995 Jason Merrill - - * decl.c (start_function): Clear ctor_label and dtor_label. - - * class.c (finish_struct_1): Fix handling of access decls. - -Tue Aug 15 19:21:54 1995 Jason Merrill - - * class.c (finish_struct): Only do minimal processing here, so it - can be used for class template definitions, as well. - (finish_struct_1): New function with the rest of the code. - -Tue Aug 15 09:46:16 1995 Mike Stump - - * class.c (prepare_fresh_vtable): On second though, always build the - offset (see Aug 10 change), unless -fvtable-thunks is given. It - does this by calling the new routine set_rtti_entry. - (finish_struct): Likewise. - (set_rtti_entry): New routine to update the rtti information at the - start of the vtable. - -Mon Aug 14 12:21:22 1995 Brendan Kehoe - - * error.c (dump_decl, case IDENTIFIER_NODE): Only work on a dtor - if it's declared in the C++ language spec. - (dump_function_decl): Likewise. - (dump_function_name): Likewise. - (ident_fndecl): Make sure we got something back from lookup_name. - * decl.c (start_function): Likewise. - -Fri Aug 11 16:52:15 1995 Jason Merrill - - * call.c (build_method_call): Don't call build_new when calling a - constructor without an instance. - -Thu Aug 10 20:00:17 1995 Mike Stump - - * class.c (prepare_fresh_vtable): Always build the offset to the - complete object, as it doesn't cost much. This allows dynamic_cast - to void * to work when -frtti isn't given. - (finish_struct): Likewise. - -Thu Aug 10 16:31:28 1995 Mike Stump - - * except.c (build_eh_type): Split out some functionality to new - routine named build_eh_type_type. - (build_eh_type_type): New routine. - (expand_start_catch_block): Use build_eh_type_type, as we never want - the dynamic type of the catch parameter, just the static type. - Fixes core dumps when -frtti is used and one catchs pointers to - classes. - -Thu Aug 10 14:55:29 1995 Mike Stump - - * except.c (expand_builtin_throw): Since we now use normal calling - conventions for __throw, we have to remove the first layer off the - stack, so that the next context we search for handlers is the outer - context instead of the context that had the call to __throw, if we - don't immediately find the desired context. - -Tue Aug 8 17:44:23 1995 Jason Merrill - - * tree.c (cp_expand_decl_cleanup): Returns int, not tree. - * cp-tree.h: Update. - - * parse.y (template_type_parm): Add support for `typename'. - -Tue Aug 8 12:06:31 1995 Mike Stump - - * except.c (expand_internal_throw): New internal routine to throw a - value. - (expand_end_all_catch, expand_leftover_cleanups): All throwers - changed to use `expand_internal_throw' instead of jumping to throw - label. - (expand_end_catch_block, expand_throw): Likewise. - (throw_label): Removed. - (expand_builtin_throw): Changed so that EH parameters are passed by - normal function call conventions. Completes Aug 4th work. - -Fri Aug 4 17:17:08 1995 Mike Stump - - * cp-tree.h (expand_builtin_throw): Declare it. - * decl2.c (finish_file): Call expand_builtin_throw. - * except.c (make_first_label): Remove. - (init_exception_processing): Don't use a LABEL_REF for throw_label, - instead use a SYMBOL_REF, this is so that we don't use LABEL_REFs in - other functions that don't really appear in those functions. This - solves a problem where cc1plus consumed exponential amounts of - memory when -Wall was used. - (expand_end_all_catch, expand_leftover_cleanups, - expand_end_catch_block, expand_throw): Change all uses of - throw_label to match new style. - (do_unwind): Rename parameter to inner_throw_label, as it is now - different from throw_label. Also, assume that our caller will wrap - the passed label with a LABEL_REF, if needed. - (expand_builtin_throw): Make external, change so that the generated - throw is now a real function. - (expand_exception_blocks): Never generate throw code inside another - function. - -Fri Aug 4 12:20:02 1995 Mike Stump - - * decl.c (grokdeclarator): Move checking of mutable const objects - and mutable static objects down, as we might decide during parsing - to unset staticp or constp (for example, when const is part of the - object being pointed to). - -Thu Aug 3 17:13:43 1995 Mike Stump - - * except.c (output_exception_table_entry): Enhance portability to - weird machines. - (emit_exception_table): Likewise. - -Thu Aug 3 16:41:38 1995 Mike Stump - - * typeck.c (build_ptrmemfunc): Handle casting of pointer to - non-virtual member functions. - -Wed Aug 2 11:58:25 1995 Mike Stump - - * gc.c (build_typeid): Strip cv qualifiers so that const T&, T&, T - and const T all match. - -Wed Aug 2 11:25:33 1995 Mike Stump - - * except.c (build_eh_type): Strip cv qualifiers so that const T&, - T&, T and const T all match. - -Tue Aug 1 14:20:16 1995 Mike Stump - - * except.c: Fix up comments, cleanup code and eliminate exceptNode, - exceptStack, exceptstack, push_except_stmts, pop_except_stmts, - new_except_stack, push_last_insn, pop_last_insn, insn_save_node and - InsnSave. Also, numerous speed improvements, and correctness - improvements. Double faulting in all situations should now be - handled correctly. - (expand_start_all_catch): Instead of having many terminate protected - regions, just have one. - (expand_start_catch_block): No longer have to protect - false_label_rtx, as it isn't used for EH region marking. - (expand_end_catch_block): Expand out EH cleanups here by using - expand_leftover_cleanups. - (expand_end_all_catch): Use sequences instead of playing with insn - links directly. - (expand_exception_blocks): Likewise. Also protect all catch clauses - with one terminate region. - -Mon Jul 31 13:24:30 1995 Jason Merrill - - * method.c (report_type_mismatch): Don't talk about an object - parameter for non-methods. - -Sun Jul 30 13:13:02 1995 Jason Merrill - - * class.c (finish_struct): Catch private and protected members of - anonymous unions here. - * decl2.c (finish_anon_union): And here. - * parse.y: Instead of here. - - * errfn.c (ARGSLIST): Support passing four args. - * error.c (cv_as_string): New function. - (cp_printers): Add it. - * call.c (build_method_call): Report 'const' at end of pseudo-decl. - - * method.c (report_type_mismatch): Deal with a bad_arg of 0. - - * init.c (expand_aggr_init): Handle volatile objects, too. - -Sat Jul 29 13:42:03 1995 Jason Merrill - - * decl.c (struct binding_level): Keep list of incomplete decls. - (print_binding_level): Use list_length to count them. - (pushdecl): Build up the list. - (hack_incomplete_structures): Walk it and prune completed decls. - -Fri Jul 28 15:26:44 1995 Jason Merrill - - * typeck.c (comp_target_types): Don't check const and volatile for - function types. - (comp_ptr_ttypes_real): Likewise. - -Thu Jul 27 15:40:48 1995 Jason Merrill - - * typeck.c (comp_target_types): Fix. - -Thu Jul 27 15:10:48 1995 Mike Stump - - * cp-tree.h (unsave_expr_now, build_unsave_expr, - cp_expand_decl_cleanup): Declare new routines. - * decl.c (cp_finish_decl, store_parm_decls, - hack_incomplete_structures): Change all cals from - expand_decl_cleanup to cp_expand_decl_cleanup. - * gc.c (protect_value_from_gc): Likewise. - * expr.c (cplus_expand_expr): Handle UNSAVE_EXPRs. - * tree.c (unsave_expr): New routine to build an UNSAVE_EXPR. - (unsave_expr_now): Backend routine used by tree expander. - (cp_expand_decl_cleanup): Wrap second argument in an UNSAVE_EXPR to - work around a limitation in the backend. The backend uses the - cleanups multiple times, on disjoint control flows, so we cannot - pass unsaved SAVE_EXPRs to the backend. - * tree.def (UNSAVE_EXPR): New tree code. - * typeck.c (c_expand_return): Move goto/return code up inside - conditional, as we don't always want to do this, we only want to do - this when we don't otherwise finish with this control flow. - -Thu Jul 27 10:38:43 1995 Brendan Kehoe - - * parse.y (typespec): Only complain about typeof if we're not - getting it from a system header. - -Thu Jul 27 10:26:23 1995 Doug Evans - - Clean up prefix attribute handling. - * parse.y (reserved_declspecs): Link prefix attributes with declspecs. - (declmods): Likewise. - (all rules that reference typed_declspecs and declmods): Call - split_specs_attrs or strip_attrs to separate declspecs and attrs. - (lang_extdef): Delete resetting of prefix_attributes. - (template_def, notype_declarator rule): Use NULL_TREE for - prefix_attributes. - (condition): Use NULL_TREE for prefix_attributes. - (setattrs): Deleted. - (nomods_initdcl0): Set prefix_attributes to NULL_TREE. - (component_decl): Delete resetting of prefix_attributes. - (component_decl_1, notype_components rule): Use NULL_TREE for - prefix_attributes. - (simple_stmt): Delete resetting of prefix_attributes. - -Mon Jul 24 13:37:53 1995 Jason Merrill - - * call.c (convert_harshness): Deal with reference conversions before - others. Actually do array->pointer decay. Call comp_target_types - with pointer types rather than their targets. - - * typeck.c (comp_target_types): Avoid assigning D const * to B *. - -Mon Jul 24 08:54:46 1995 Brendan Kehoe - - * pt.c (to_be_restored): Move decl to global scope. - -Sat Jul 22 12:22:11 1995 Jason Merrill - - * decl.c (start_decl): Put back clearing of DECL_IN_AGGR_P. - -Fri Jul 21 17:09:02 1995 Jason Merrill - - * decl.c (grokdeclarator): Downgrade error about 'extern int A::i' - to pedwarn. - - * pt.c (instantiate_template): Also avoid instantiation if the - function has already been declared to be a specialization. - - * decl2.c (check_classfn): Ignore cname argument, and return the - matching function. - - * decl.c (start_decl): Handle declarations of member functions - outside of the class (i.e. specialization declarations). - -Thu Jul 20 10:34:48 1995 Jason Merrill - - * class.c (finish_struct): Don't mess with the type of bitfields. - - * various.c: s/TYPE_POINTER_TO/build_pointer_type/. - -Thu Jul 20 01:43:10 1995 Mike Stump - - * init.c (expand_aggr_init): Assume LOOKUP_ONLYCONVERTING if init - is not a parameter list (TREE_LIST). - (expand_default_init): If LOOKUP_ONLYCONVERTING is set, then set - LOOKUP_NO_CONVERSION so that we don't allow two-level conversions, - but don't set it otherwise. - -Wed Jul 19 20:32:01 1995 Mike Stump - - * init.c (expand_default_init): Don't allow two-level conversions - during construction. - -Wed Jul 19 18:06:37 1995 Mike Stump - - * gc.c (build_headof): The type of dyncasting to a pointer to cv - void, should be pointer to cv void. - -Wed Jul 19 17:25:43 1995 Mike Stump - - * gc.c (build_dynamic_cast): Allow casting in const. - -Wed Jul 19 16:34:27 1995 Mike Stump - - * typeck.c (build_const_cast): If we are passed error_mark_node, - return it. - -Wed Jul 19 15:24:48 1995 Brendan Kehoe - - * class.c (push_nested_class): Make sure TYPE is non-nil. - - * cvt.c (type_promotes_to): Watch for error_mark_node on the - incoming TYPE. - -Wed Jul 19 13:23:12 1995 Gerald Baumgartner - - * cp-tree.h (SIGTABLE_VT_OFF_NAME): Renamed from SIGTABLE_OFFSET_NAME. - (SIGTABLE_VB_OFF_NAME): New macro. - (vt_off_identifier): Renamed from offset_identifier. - (vb_off_identifier): Added extern declaration. - - * decl.c (vt_off_identifier): Renamed from offset identifier. - (vb_off_identifier): New variable to hold the identifier for the - sigtable field vb_off. - (init_decl_processing): Initialize vb_off_identifier. - Renamed vt_off_identifier from offset_identifier. - * sig.c (build_signature_method_call): Renamed offset_identifier and - local variable offset to vt_off_identifier and vt_off, respectively. - * sig.c (build_signature_table_constructor): Renamed offset to vt_off. - - * decl.c (init_decl_processing): Add vb_off field to - sigtable_entry_type. Reorder fields so that pfn gets properly - aligned at a 64 bit boundary on the Alpha. - * sig.c (build_signature_table_constructor): Build the constructor - according to the new layout. Set the vb_off field to -1 for now. - - * decl.c (init_decl_processing): Align sigtable_entry_type on word - boundaries instead of double word boundaries to save space. - -Tue Jul 18 16:58:37 1995 Mike Stump - - * cvt.c (cp_convert): Always call build_cplus_new for a ctor. - -Tue Jul 18 14:24:53 1995 Brendan Kehoe - - * parse.y (opt.component_decl_list): Only forbid private/protected - in anonymous unions. We need to make this know when the type is - defined for an object, to not give the error. - -Mon Jul 17 14:22:44 1995 Brendan Kehoe - - * parse.y (opt.component_decl_list): Don't allow access control - as private or protected for union members. - -Sun Jul 16 14:01:00 1995 Jim Wilson - - * lex.c (check_newline): For 'p' case, move goto skipline line to - before end brace for 'pragma'. - -Fri Jul 7 13:55:58 1995 Mike Stump - - * g++.1: Tiny updates. - -Fri Jul 7 13:05:20 1995 Mike Stump - - * decl.c (cp_finish_decl): Only destruct local static variables if - they are constructed, and only construct the first time control - passes completely through its declaration (if not initialized with a - constant-expression). - (expand_static_init): Likewise. - -Wed Jul 5 14:05:04 1995 Brendan Kehoe - - * typeck.c (comptypes, case OFFSET_REF): If either offset basetype - is a TEMPLATE_TYPE_PARM, give a match. - -Fri Jun 30 15:42:57 1995 Mike Stump - - * method.c (build_overload_value): Handle encoding of null pointer - constants (or any pointer with a constant numeric value) for - templates. - -Fri Jun 30 13:45:51 1995 Brendan Kehoe - - * call.c (convert_harshness): Add QUAL_CODE when we're faced with - const vs non-const for void conversions. - -Fri Jun 30 10:19:52 1995 Mike Stump - - * except.c (expand_start_all_catch): Fix problem with finding an - outer nested try block when there is no code to separate it from an - inner try block. - -Fri Jun 30 02:22:26 1995 Mike Stump - - * search.c (dfs_pushdecls): Consume 2 or 3 orders of magnitude less - memory please when virtual bases are used. - -Thu Jun 29 19:03:47 1995 Mike Stump - - * class.c (build_vbase_path): Avoid testing things that cannot be - null to see if they are null. - * cvt.c (convert_pointer_to_vbase): Remove code that doesn't work. - * decl.c (finish_function): Pass a type into the new - convert_pointer_to_vbase instead of a binfo. - * search.c (convert_pointer_to_vbase): Rewritten to use get_vbase - and convert_pointer_to_real. - (expand_indirect_vtbls_init): Use convert_pointer_to_vbase instead - of the more cryptic call to get_vbase. - -Thu Jun 29 09:35:05 1995 Mike Stump - - * decl.c (BOOL_TYPE_SIZE): Fix broken SLOW_BYTE_ACCESS check. - -Thu Jun 29 03:43:55 1995 Jason Merrill - - * pt.c (instantiate_template): Don't strip 'this' twice. - - * pt.c (coerce_template_parms): Allow null pointer constants. - - * decl.c (revert_static_member_fn): But only if DECL_ARGUMENTS is - set. - -Wed Jun 28 18:39:03 1995 Jason Merrill - - * decl.c (revert_static_member_fn): Also remove 'this' from - DECL_ARGUMENTS. - * decl2.c (check_classfn): Don't revert this function until we get a - match. - -Wed Jun 28 14:07:27 1995 Brendan Kehoe - - * parse.y (component_decl): Clear PREFIX_ATTRIBUTES here. - -Wed Jun 28 11:05:13 1995 Mike Stump - - * decl2.c (finish_file): Handle global vector news. - * init.c (build_new): Encode vector news so that later we will know - how many elements there are. - -Mon Jun 26 13:38:06 1995 Jason Merrill - - * expr.c (cplus_expand_expr): Don't mess with temp slots. - - * decl2.c (warn_if_unknown_interface): Don't crash if tinst_for_decl - returns null. - - * decl2.c (check_classfn): Use revert_static_member_fn. - * decl.c (revert_static_member_fn): Diagnose static member functions - declared const or volatile. - - * decl2.c (grokfield): Check for missing default args here, too. - (check_default_args): Function to do the checking. - * decl.c (pushdecl): Use it. - - * decl.c (pushdecl): Don't warn about shadowing a member of `this' - if there is no `this'. - -Sun Jun 25 11:34:25 1995 Jason Merrill - - * call.c (build_method_call): Downgrade 'called before definition' - to a warning, as it ought to go away after Monterey. - -Sat Jun 24 14:18:42 1995 Jason Merrill - - * pt.c (coerce_template_parms): Don't do extra checking on pointer - to member arguments. - - * class.c (finish_struct): const and reference members don't prevent - a class from being an aggregate. - - * class.c (finish_struct): Signatures are always aggregates. - -Fri Jun 23 17:20:29 1995 Jason Merrill - - * decl2.c (check_classfn): Improve error message. - - * pt.c (tsubst): Handle PROMOTE_PROTOTYPES. - -Thu Jun 22 01:50:42 1995 Jason Merrill - - * typeck.c (comptypes): Don't ignore method quals. - - * class.c (finish_struct): Non-abstract virtuals are always USED. - - * decl.c (build_ptrmemfunc_type): The underlying union type isn't - IS_AGGR_TYPE, either. - * class.c (finish_struct): Use CLASSTYPE_NON_AGGREGATE instead. - * cp-tree.h: Likewise. - - * cp-tree.h (lang_type): Add aggregate. - (CLASSTYPE_AGGREGATE): New macro. - (TYPE_NON_AGGREGATE_CLASS): Likewise. - * class.c (finish_struct): Determine whether a class is an - aggregate. - * decl.c (cp_finish_decl): Check TYPE_NON_AGGREGATE_CLASS instead of - TYPE_NEEDS_CONSTRUCTING. - * typeck2.c (digest_init): Check TYPE_NON_AGGREGATE_CLASS for - subobjects, too. - - * pt.c (tsubst, PARM_TYPE): Propagate DECL_ARTIFICIAL. - - * decl.c (start_function): For pre-parsed functions, layout all of - the parm decls again. - (grokvardecl): TREE_PUBLIC depends on DECL_THIS_EXTERN, not - DECL_EXTERNAL. - - * pt.c (coerce_template_parms): Improve checking for invalid - template parms. - -Wed Jun 21 12:01:16 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Forbid declaration of a static member - with the same name as its enclosing class. - -Mon Jun 19 10:28:14 1995 Jason Merrill - - * decl.c (finish_function): Clear current_class_decl. - - * typeck.c (build_conditional_expr): Use convert (boolean_type_node - instead of truthvalue_conversion. - - * class.c (finish_struct): A data member with the same name as the - class doesn't suppress constructors. - -Fri Jun 16 18:11:39 1995 Gerald Baumgartner - - * decl.c (start_function): If current_class_decl is a signature - pointer, don't dereference it but set C_C_D to current_class_decl. - -Fri Jun 16 17:06:28 1995 Jason Merrill - - * decl.c (duplicate_decls): Complain about virtual functions - redeclared to be inline. - -Fri Jun 16 13:20:38 1995 Mike Stump - - * decl.c (get_unique_name): New routine to name unnamed namespaces. - (push_namespace): Use get_unique_name for naming unnamed namespaces. - -Thu Jun 15 15:00:41 1995 Jason Merrill - - * parse.y: Call cplus_decl_attributes with prefix_attributes where - appropriate. - -Wed Jun 14 19:24:49 1995 Mike Stump - - * search.c (get_vbase): New routine to switch hierarchies from the - CLASSTYPE_VBASECLASSES to the normal one. - (expand_indirect_vtbls_init): Use get_vbase to figure out how we - want to convert to a vbase pointer. - -Mon Jun 12 17:50:30 1995 Jason Merrill - - * pt.c (instantiate_class_template): Add the new instantiation to - template_classes. - (do_pending_expansions): Call instantiate_member_templates on all of - the classes in template_classes. - -Mon Jun 12 12:36:59 1995 Mike Stump - - * decl.c (complete_array_type): Fill in the TYPE_DOMAIN of our - TYPE_MAIN_VARIANT if it is not filled in. - * init.c (build_delete): If the TYPE_DOMAIN is not set, give an - error instead of core dumping. - -Mon Jun 12 10:41:40 1995 Jason Merrill - - * call.c (can_convert): Also check for distance > 0. - (can_convert_arg): Likewise. - (user_harshness): Likewise. - -Fri Jun 9 19:17:21 1995 Jason Merrill - - * g++.c (MATH_LIBRARY): Provide default. - (main): Always link with the math library if we link with libstdc++. - - * decl.c (start_function): Complain about redefinition of a function - even when the pending_inline version is compiled after the other - version. - -Thu Jun 8 15:44:38 1995 Jason Merrill - - * gc.c (build_dynamic_cast): Build up a reference to a parameter of - aggregate type. - -Wed Jun 7 15:31:57 1995 Brendan Kehoe - - * init.c (build_vec_delete): Resolve an offset ref before we try to - use it. - -Wed Jun 7 14:19:32 1995 Jason Merrill - - * typeck.c (build_modify_expr): If the class lacks a constructor or - assignment operator, return error_mark_node. - (common_type): Use build_cplus_array_type. - -Tue Jun 6 09:41:27 1995 Mike Stump - - * class.c (dont_allow_type_definitions): New variable set when types - cannot be defined. - (finish_struct): Use it. - * cp-tree.h (dont_allow_type_definitions): Define it. - * parse.y (primary, handler_seq): Set it. - -Mon Jun 5 18:49:38 1995 Mike Stump - - * method.c (build_opfncall): Use DECL_CHAIN, not TREE_CHAIN for - results from lookup_fnfields. Always give warning/error on bad - code. - -Mon Jun 5 11:39:37 1995 Brendan Kehoe - - * init.c (member_init_ok_or_else): Don't allow initialization of - an ancestor's member from within a constructor. - -Mon Jun 5 11:20:34 1995 Gerald Baumgartner - - * sig.c (build_signature_table_constructor): Use DECL_CONTEXT - instead of DECL_CLASS_CONTEXT for calculating the vfield offset so - abstract virtual functions are handled correctly. - - * sig.c (build_signature_table_constructor): Store the correct - delta in signature table entries. It does not yet work for - classes with virtual base classes as implementations of signatures. - (build_signature_method_call): Add the delta to the object_ptr - before generating the function call. - - * call.c (build_method_call): Make instance_ptr the signature - pointer itself instead of dereferencing the optr. - * sig.c (build_signature_method_call): Dereference the optr for the - direct and virtual calls. - - * sig.c (build_signature_table_constructor): Make the tag for - default implementations -1 instead of 2. - (build_signature_method_call): Change the generated conditional - expression correspondingly. - - * sig.c (build_signature_pointer_constructor): Deleted the sorry - message that said we can't handle multiple inheritance for - implementations of signatures - (build_signature_method_call): Use the offset from the sigtable - entry instead of the vptr field from the signature pointer for - building a virtual function call. - - * class.c (build_vfn_ref): Deleted signature specific code, we don't - call this function anymore from build_signature_method_call. - - * cp-tree.h (SIGNATURE_VPTR_NAME): Deleted. We use the right vptr - field in the object now instead of in the signature pointer/ref. - (build_vptr_ref): Deleted extern declaration. - * sig.c (build_vptr_ref): Deleted. - (build_signature_pointer_or_reference_type): Deleted construction of - the vptr field. - (build_signature_pointer_constructor): Deleted initialization of/ - assignment to the vptr field. - - * sig.c (build_signature_table_constructor): Convert the signature - table entry fields to their correct types. - - * sig.c (build_signature_table_constructor): Don't call digest_init - for the fields of a sigtable entry, it's wasted time. - - * sig.c (build_signature_table_constructor): Correctly set the - offset and index fields of a sigtable entry. Build the constructor - the way digest_init does, digest_init can't handle initializing an - anonymous union inside a struct. - (build_signature_method_call): Use the index field instead of the - delta field to get the vtable index. - - * decl.c (init_decl_processing): Fix number of fields for building - sigtable_entry_type. - - * cp-tree.h (tag_identifier, offset_identifier): Added extern decls. - (SIGTABLE_CODE_NAME): Renamed to SIGTABLE_TAG_NAME. - (SIGTABLE_PFN_NAME): Deleted, we'll use VTABLE_PFN_NAME instead. - * decl.c (tag_identifier, offset_identifier): New variables to - hold the identifiers for the sigtable fields tag and offset. - (init_decl_processing): Initialize these variables. - (init_decl_processing): Use these variables to build the - sigtable_entry_type structure. Rename the code and offset fields - to tag and delta, respectively; add offset and index fields. Changed - types of fields from short_integer_type_node to delta_type_node. - * sig.c (build_signature_table_constructor): Rename code and offset - to tag and delta, respectively. - (build_signature_method_call): Likewise. Use above variables. - -Thu Jun 1 17:03:51 1995 Jason Merrill - - * decl.c (lookup_name_real): Don't try to look anything up in an - erroneous object. - -Fri Jun 2 10:30:14 1995 Mike Stump - - * method.c (build_overload_int): New routine. Break out - functionality from build_overload_value so we can reuse it. - (build_overload_value): Handle pointer to member functions as value - parameters for templates. - (build_overload_identifier): Since template parameters are shared - among all instantiations, we have to substitute in the real types - in TREE_TYPE (parm). - pt.c (coerce_template_parms): Likewise. - (push_template_decls): Likewise. - (grok_template_type): Deleted as template parameters are shared - among all instantiations. - -Wed May 31 19:10:32 1995 Mike Stump - - * decl.c (grokdeclarator): Always give errors on constant overflow - for array indices. - -Wed May 31 11:39:43 1995 Jason Merrill - - * typeck.c (commonparms): Don't abort if simple_cst_equal returns < 0. - (build_c_cast): Don't tack on a NON_LVALUE_EXPR when casting to - reference type. - (build_indirect_ref): Fix check for *&. - -Fri Jun 16 06:54:03 1995 Mike Stump - - * Version 2.7.0 released. - -Fri Jun 16 15:07:29 1995 Richard Kenner - - * Make-lang.in (DEMANGLER_PROG): Add LIBS. - -Thu Jun 15 15:00:41 1995 Jason Merrill - - * decl.c (define_function): Don't set DECL_INTERFACE_KNOWN. - -Wed Jun 7 20:00:31 1995 Mike Stump - - * *.[chy]: Change all callers of finish_decl to cp_finish_decl. - * decl.c (finish_decl): New routine to handle call backs from the - mid end (declare_hidden_char_array). - -Wed Jun 7 19:02:50 1995 Jason Merrill - - * decl.c (start_function): Handle setting C_C_D here. - (set_C_C_D): Removed. - (struct saved_scope): Remove class_decl. - (push_to_top_level): Don't save current_class_decl. - (pop_from_top_level): Don't restore current_class_decl or C_C_D. - (struct cp_function): Add C_C_D. - (push_cp_function_context): Save C_C_D. - (pop_cp_function_context): Restore C_C_D. - -Fri Jun 2 11:05:58 1995 Jason Merrill - - * decl.c (set_C_C_D): New function. suspend_momentary before - building C_C_D. - (pop_from_top_level): Call it. - (start_function): Likewise. - (pop_cp_function_context): Likewise. - - * class.c, cp-tree.h, decl.c, decl2.c, parse.y: Lose all references - to current_vtable_decl, CLASSTYPE_INST_VAR and CLASSTYPE_VTBL_PTR. - - * decl.c (push_cp_function_context): Save current_class_decl. - (pop_cp_function_context): Restore current_class_decl and set C_C_D. - (pop_from_top_level): Don't use CLASSTYPE_INST_VAR to set C_C_D. - (start_function): Likewise. - - * class.c (popclass): Don't mess with current_class_decl, - current_vtable_decl, or C_C_D. - -Mon May 29 12:45:10 1995 Paul Eggert - - * Make-lang.in (c++.mostlyclean): Remove $(DEMANGLER_PROG). - -Wed May 24 15:55:18 1995 Richard Kenner - - * decl.c (duplicate_decls): Check simple_cst_equal result against 0. - * decl2.c (finish_anon_union): Likewise. - * method.c (largest_union_member): Likewise. - -Wed May 24 14:41:11 1995 H.J. Lu - - * Make-lang.in (cxxmain.o): Replace single quotes with backslashes. - -Mon May 22 17:38:48 1995 Richard Kenner - - * Make-lang.in (g++, g++-cross, cc1plus, DEMANGLER_PROG): - Use $@ instead of output name so works even if have .exe. - (cxxmain.o): Use cp if ln -s fails. - (c++.install-man): Use $(exeext) in executable names. - (c++.mostlyclean, stage[1-4]): Use $(objext) in object file names. - * Makefile.in (../cc1plus): Use $(exeext) in name of executable. - -Wed May 24 01:39:03 1995 Jason Merrill - - * call.c (build_method_call): Parms can be null, duh. - -Tue May 23 01:32:09 1995 Jason Merrill - - * call.c (build_method_call): If convert_arguments failed, just bail. - -Fri May 19 10:31:11 1995 Jason Merrill - - * cvt.c (convert_force): Pass LOOKUP_NORMAL to cp_convert. - - * tree.c (copy_to_permanent): Oops. - -Fri May 19 10:01:07 1995 Brendan Kehoe - - * cp-tree.h (break_out_target_exprs): Add decl. - -Thu May 18 13:02:30 1995 Jason Merrill - - * decl.c (start_function): Move *all* interface handling stuff after - the pushdecl. - - * tree.c (mapcar): Renamed from make_deep_copy and generalized. - (perm_manip): Return t if permanent, otherwise 0. - (copy_to_permanent): Use them. - (bot_manip): Helper for break_out_target_exprs. - (break_out_target_exprs): New function. Uses mapcar. - - * typeck.c (convert_arguments): Use it. - - * method.c (hack_identifier): Use convert_from_reference to - dereference a reference. - -Wed May 17 17:54:54 1995 Mike Stump - - * call.c (convert_harshness): Move reference bashing before pointer - to member bashing. - -Wed May 17 16:57:53 1995 Mike Stump - - * cvt.c (convert_to_reference): Only complain, if complaints are - wanted. - * typeck.c (build_function_call_real): Likewise. If - LOOKUP_SPECULATIVELY is set and something won't work, return - NULL_TREE. - * cvt.c (cp_convert): Likewise. Pass flags down to build_method_call. - (convert): Pass LOOKUP_NORMAL to cp_convert. - * typeck.c (convert_for_assignment): Likewise. - (convert_force): Pass LOOKUP_COMPLAIN to cp_convert. - (convert_arguments): Get out early if we get an error_mark_node. - (convert_for_initialization): Use cp_convert instead of convert so - that we can pass flags down. - * cp-tree.h (LOOKUP_SPECULATIVELY): Added documentation. - -Wed May 17 01:43:58 1995 Jason Merrill - - * typeck2.c (store_init_value): Don't take the MAIN_VARIANT of the - decl type. - - * class.c (finish_struct): Don't complain about a class with no - user-defined constructors but with a member that has no default - constructor, as this is OK for aggregates. - - * expr.c (cplus_expand_expr, NEW_EXPR): If this is an explicit - constructor call, mark slot addressable. - -Tue May 16 18:37:51 1995 Douglas Rupp - - * g++.c: Changed WINNT to _WIN32. - -Tue May 16 12:40:16 1995 Jason Merrill - - * lex.c (handle_sysv_pragma): Don't use token_buffer. - -Tue May 16 12:05:26 1995 Mike Stump - - * call.c (resolve_scope_to_name): Add initial semantic support for - namespaces. - * class.c (finish_struct): Likewise. - * cp-tree.h (NAMESPACE_LEVEL): Likewise. - * cvt.c (build_up_reference, convert_to_reference): Likewise. - * decl.c (binding_level::namespace_p, suspend_binding_level): Likewise. - (resume_binding_level, toplevel_bindings_p): Likewise - (namespace_bindings_p, declare_namespace_level): Likewise. - (resume_level, push_namespace, pop_namespace): Likewise. - (pop_everything, pushtag, duplicate_decls, pushdecl): Likewise. - (implicitly_declare, lookup_namespace_name): Likewise. - (lookup_name_real, start_decl, make_temporary_for_reference): Likewise. - (obscure_complex_init, finish_decl, expand_static_init): Likewise. - (grokvardecl, grokdeclarator, parmlist_is_exprlist): Likewise. - (store_parm_decls, hack_incomplete_structures): Likewise. - * decl2.c (get_temp_name, finish_anon_union): Likewise. - (current_namespace, push_namespace, pop_namespace): Likewise. - (do_namespace_alias, do_toplevel_using_decl): Likewise. - (do_class_using_decl): Likewise. - * error.c (dump_decl): Likewise. - * init.c (build_member_call, build_offset_ref): Likewise. - * lex.c (identifier_type): Likewise. - * parse.y (lang_extdef, using_decl, extdef): Likewise. - (component_decl_1, nested_name_specifier_1): Likewise. - * spew.c (yylex): Likewise. - * tree.def (NAMESPACE_DECL): Likewise. - -Tue May 16 11:55:35 1995 Jason Merrill - - * decl.c (push_overloaded_decl): Return the new decl even if it - can't be pushed. - -Tue May 16 11:00:37 1995 Jason Merrill - - * typeck.c (decay_conversion): Split out from default_conversion. - (default_conversion): Call it. - (build_binary_op): Likewise. - (build_binary_op_nodefault): Use decay_conversion for truth ops. - -Mon May 15 12:47:56 1995 Jason Merrill - - * decl.c (warn_extern_redeclared_static): This is a pedwarn. - (duplicate_decls): Always use the old decl's linkage info. Don't - play with linkage of consts. - (pushdecl): Don't play with linkage of consts. - (redeclaration_error_message): Don't complain about an old public - decl and a new non-public decl here. - (grokvardecl): Handle linkage of consts here. - (grokdeclarator): An 'extern inline' is public. Pass constp to - grokvardecl. - (start_function): Wait until after the pushdecl to do some linkage - stuff. - - * decl2.c (import_export_vtable): Make duplicates weak rather than - static if supported. - (import_export_inline): Likewise. - * pt.c (do_pending_expansions): Likewise. - - * class.c (build_vbase_path): flag_assume_nonnull_objects only - affects reference conversion. - - * init.c (emit_base_init): Build up an RTL_EXPR and add it to - rtl_expr_chain. - * decl.c, decl2.c: s/base_init_insns/base_init_expr/. - -Tue May 16 07:06:28 1995 Paul Eggert - - * method.c (numeric_output_need_bar): Renamed from misspelling. - - * typeck.c (build_ptrmemfunc): Fix misspellings in messages. - -Sun May 14 10:26:22 1995 Richard Kenner - - * lang-options.h, lang-specs.h: New files. - -Thu May 11 00:31:48 1995 Jason Merrill - - * typeck.c (default_conversion): Don't check for BLKmode before - pulling out the decl_constant_value. - - * decl.c (start_function): Clear named_labels and shadowed_labels. - - * typeck.c (build_function_call_real): Also synthesize methods here. - -Wed May 10 00:55:59 1995 Jason Merrill - - * decl2.c (finish_file): Synthesize exported methods before the - reconsider loop. - - * parse.y: Move declaration of flag_new_for_scope to file scope. - -Tue May 9 19:10:33 1995 Mike Stump - - * decl2.c: Add flag_new_for_scope for new -ffor-scope flag. - * parse.y (FOR): Conditionalize the pushing and popping of scope for - the for-init-statement upon the new flag_new_for_scope. - * parse.y (try_block): Simplify and use compstmt. - -Mon May 8 12:41:52 1995 Jason Merrill - - * decl.c (define_function): Mark function decl artificial. - -Sun May 7 00:51:28 1995 Jason Merrill - - * parse.y (simple_stmt, FOR): Put back push/pop for condition scope. - - * decl2.c (grokclassfn): DECLs don't have cv-qualified types. - * tree.c (build_cplus_method_type): Likewise. - - * cp-tree.h (SET_DECL_ARTIFICIAL): Just set DECL_ARTIFICIAL to 1. - - * typeck.c (build_function_call_real): If convert_arguments failed, - just bail. - (convert_arguments): If one of the arguments is error_mark_node, - just bail. - -Sat May 6 02:39:41 1995 Jason Merrill - - * decl.c (duplicate_decls): Don't check DECL_NOT_REALLY_EXTERN for - decls that don't include it. - -Fri May 5 14:23:30 1995 Jason Merrill - - * decl.c (duplicate_decls): Decls that have DECL_INTERFACE_KNOWN or - DECL_NOT_REALLY_EXTERN set aren't extern decls. - - * typeck.c (build_indirect_ref): Don't call default_conversion for a - parameter of reference_type. - * cvt.c (convert_from_reference): Just use build_indirect_ref. - - * pt.c (do_type_instantiation): Only instantiate member functions - that actually come from templates. - -Fri May 5 09:46:05 1995 Mike Stump - - * parse.y: Generalized cleanup of poplevels, and compound statements - and compound statements in try blocks. Rewritten `for' rule so that - the scope of variables declared in the for clause is shortened to - span just to the end of the statement, instead of the whole - containing block. - -Fri May 5 00:37:14 1995 Jason Merrill - - * call.c (convert_harshness): Handle pointers to members better. - -Thu May 4 16:00:26 1995 Jason Merrill - - * decl2.c (delete_sanity): Do access control here. - * init.c (build_delete): Instead of here. - - * Make-lang.in: Build c++filt. - -Wed May 3 02:59:53 1995 Jason Merrill - - * decl2.c (cplus_decl_attributes): If we just modified a TYPE_DECL, - update our IDENTIFIER_TYPE_VALUE. - -Fri Apr 28 07:58:41 1995 Jason Merrill - - * lex.c (cons_up_default_function): Fix linkage of #pragma - implemented functions. - -Thu Apr 27 16:56:24 1995 Jason Merrill - - * method.c (build_overload_name): Simplify and fix repeated type - folding. - - * decl.c (grokdeclarator): Prohibit pointers to void or reference - members. - -Thu Apr 27 09:49:07 1995 Mike Stump - - * typeck2.c (process_init_constructor): Make sure initializers are - fully digested. - -Thu Apr 27 01:11:55 1995 Jason Merrill - - * lex.c (cons_up_default_function): Always defer synthesis. - -Thu Apr 27 00:20:37 1995 Jason Merrill - - * decl2.c (mark_inline_for_output): Don't play with pending_inline - stuff. - -Wed Apr 26 17:48:24 1995 Jason Merrill - - * call.c (user_harshness): New function; like build_type_conversion, - but doesn't actually build anything. - (compute_conversion_costs): Use it instead of build_type_conversion. - -Wed Apr 26 17:11:25 1995 Jason Merrill - - * typeck.c (build_function_call_real): Improve error message for - calling a non-function. - - * method.c (hack_identifier): Lose check for calling a data member. - -Wed Apr 26 16:59:13 1995 Mike Stump - - * typeck2.c (build_functional_cast): Remove very old cruft. - Seems like good code is generated without it. - -Wed Apr 26 00:47:16 1995 Jason Merrill - - * method.c (do_build_assign_ref): Fix handling of anonymous unions. - (do_build_copy_constructor): Likewise. - - * parse.y (simple_stmt, SWITCH): Call {push,pop}_switch. - - * decl.c (push_switch): New function. - (pop_switch): Likewise. - (define_case_label): Check for jumping over initialization. - - * call.c (build_method_call): Check for an inline function being - called before its definition has been seen. - * typeck.c (build_function_call_real): Likewise. - - * decl.c (duplicate_decls): Check for a function being redeclared - inline after its address has been taken. - - * typeck.c (build_conditional_expr): Handle related class lvalues. - -Tue Apr 25 13:20:45 1995 Jason Merrill - - * pt.c (do_pending_expansions): Don't expand unused templates. - - * parse.y (component_decl): Accept a lone semicolon. - -Tue Apr 25 00:25:56 1995 Jason Merrill - - * call.c (build_method_call): Don't allow an RTL_EXPR to serve as the - object parameter anymore. - - * expr.c (cplus_expand_expr): Don't create RTL_EXPRs with no insns. - -Mon Apr 24 12:35:48 1995 Jason Merrill - - * parse.y (simple_stmt, decl case): Clear prefix_attributes. - (lang_extdef): Likewise. - - * parse.y (maybe_parmlist): New rule for use in declarators where - this could either be a list of expressions or parameters. Calls - suspend_momentary before deciding which. - (direct_after_type_declarator): Use it. - (complex_direct_notype_declarator): Use it. - - * pt.c (tsubst): Propagate attributes const and noreturn. - - * typeck.c (build_modify_expr): If warn_synth, call build_opfncall - before doing the default thing. - -Thu Apr 27 21:49:36 1995 Doug Evans - - * typeck.c (common_type): Call lookup_attribute instead of - value_member. - -Tue Apr 25 18:07:43 1995 Richard Kenner - - * Make-lang.in: Change "realclean" to "maintainer-clean". - -Sun Apr 23 12:32:38 1995 Mike Stump - - * decl2.c (finish_file): Fix broken linked list handling. - -Fri Apr 21 18:08:43 1995 Jason Merrill - - * class.c (finish_base_struct): Don't set TYPE_HAS_COMPLEX_*_REF - as often. - (finish_struct): Likewise. - - * various: Use TYPE_HAS_TRIVIAL_* instead of TYPE_HAS_COMPLEX_*. - - * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): New macro. - (TYPE_HAS_TRIVIAL_ASSIGN_REF): New macro. - -Fri Apr 21 15:52:22 1995 Jason Merrill - - * typeck.c (c_expand_return): Only expand a returned TARGET_EXPR if - it is of the same type as the return value. - -Fri Apr 21 03:01:46 1995 Jason Merrill - - * decl2.c (finish_file): Reconsider if synthesizing a method wrote - out its assembly. - - * typeck.c (convert_for_initialization): Don't call a trivial copy - constructor. - - * typeck2.c (store_init_value): Only abort if the type has a - non-trivial copy constructor. - - * typeck.c (c_expand_return): If we're returning in a register and - the return value is a TARGET_EXPR, expand it. Only do - expand_aggr_init if we're returning in memory. - (expand_target_expr): Function to expand a TARGET_EXPR. - (build_modify_expr): Use it. - - * tree.c (build_cplus_new): Layout the slot. - - * expr.c (cplus_expand_expr): Use expand_call to expand the call - under a NEW_EXPR, so the target is not discarded. - -Thu Apr 20 14:59:31 1995 Mike Stump - - * gc.c (build_dynamic_cast): Tighten error checking. - -Thu Apr 20 11:23:54 1995 Jason Merrill - - * expr.c (cplus_expand_expr): Only abort if the returned target is - different from what we expected if the type has a non-trivial copy - constructor. - - * decl2.c (cplus_decl_attributes): Attributes applied to a template - really apply to the template's result. - - * tree.c (lvalue_p): Check IS_AGGR_TYPE instead of TREE_ADDRESSABLE - to decide whether to consider a CALL_EXPR an lvalue. - - * class.c (finish_struct_bits): Only set TREE_ADDRESSABLE if the - type has a non-trivial copy constructor. - - * decl.c (start_function): If interface_known, unset - DECL_NOT_REALLY_EXTERN on the function. - -Wed Apr 19 16:53:13 1995 Jason Merrill - - * pt.c (do_function_instantiation): Handle explicit instantiation of - member functions. - (do_type_instantiation): Handle 'inline template class foo', - meaning just spit out the vtable. - - * lex.c (cons_up_default_function): Set DECL_NOT_REALLY_EXTERN on - the consed functions. - - * decl2.c (import_export_inline): Set DECL_INTERFACE_KNOWN. - -Wed Apr 19 16:28:17 1995 Brendan Kehoe - - * call.c, class.c, decl2.c, gc.c, init.c, parse.y, pt.c, search.c, - typeck.c: Include output.h. - -Wed Apr 19 14:57:21 1995 Gerald Baumgartner - - * call.c (build_method_call): Allow a signature member functions to - be called from a default implementation. - -Wed Apr 19 10:21:17 1995 Jason Merrill - - * repo.c (finish_repo): Remember what directory we are in. - - * search.c (expand_upcast_fixups): Don't mess with abort_fndecl. - - * repo.c: Use obstacks instead of fixed-size buffers. Don't spit - out the second copy of the symbol name. Don't remember COLLECT_GCC. - -Wed Apr 19 02:32:40 1995 Mike Stump - - * search.c (virtual_context): New function to get the virtual - context of a function. - (expand_upcast_fixups): New function to generate runtime vtables. - (fixup_virtual_upcast_offsets): Likewise. - (expand_indirect_vtbls_init): Use fixup_virtual_upcast_offsets to - ensure that the this offsets for upcasts from virtual bases into - other virtual bases or non-virtual bases are correct at construction - time and destruction time. - * class.c (fixup_vtable_deltas): Modify to fixup all offsets in all - vtables in all virtual bases, instead of just one vtable in each - virtual base. - (fixup_vtable_deltas1): Likewise. - -Tue Apr 18 03:57:35 1995 Michael Meissner - - * Makefile.in (lex.o): Add dependency on c-pragma.h. - - * lex.c (handle_sysv_pragma): Use NULL_PTR and NULL_TREE as - appropriate, instead of 0. - -Mon Apr 17 12:28:42 1995 Jason Merrill - - * decl.c (pushdecl): Use decls_match, not duplicate_decls, for - comparing local and global decls. - -Fri Apr 14 01:46:52 1995 Jason Merrill - - * typeck.c (convert_arguments): Only prohibit passing to ... of - types with non-trivial copy constructors. - - * repo.c (repo_template_used): Don't try to mess with no id. - -Fri Apr 14 23:32:50 1995 Per Bothner - - * decl.c (duplicate_decls): Use cp_warning_at for redundant-decls. - -Thu Apr 13 15:37:42 1995 Brendan Kehoe - - * cp-tree.h (current_tinst_level): Delete declaration, since it's - static inside pt.c. - - * typeck.c (build_modify_expr): Catch incompatible array assignment. - - * parse.y (attribute_list, attrib): Rewrite actions to feed the - right stuff to decl_attributes. - -Thu Apr 13 11:24:10 1995 Jason Merrill - - * search.c (dfs_debug_mark): Check for magic virtual like - import_export_vtable. - - * typeck.c (build_binary_op_nodefault): Don't call cp_pedwarn with - four args. - -Wed Apr 12 12:02:57 1995 Jason Merrill - - * decl2.c (finish_file): Move prevtable pass before needs_messing_up - decision. - -Tue Apr 11 11:20:27 1995 Jason Merrill - - * decl.c (finish_decl): If we're writing out a static data member of - a class, we want the debug info for that class. - - * gc.c (build_t_desc): Check linkage of a class properly. - - * class.c (finish_struct): Set the 'headof' offset for the main - vtable properly. - (prepare_fresh_vtable): Fix typeinfo pointer here. - (modify_one_vtable): Instead of here. - -Mon Apr 10 12:15:59 1995 Jason Merrill - - * repo.c (repo_get_id): New function to return the interesting - identifier for a repo entity. - (repo_template_used): Use it. - (repo_template_instantiated): Mark the id as chosen. - (init_repo): Record whether or not the id was chosen. - (finish_repo): Note if an id was newly chosen. - - * pt.c (do_function_instantiation): Call repo_template_instantiated. - (do_type_instantiation): Likewise. Don't diagnose multiple - instantiation. - - * decl2.c (finish_file): Use DECL_NOT_REALLY_EXTERN when deciding - whether or not to synthesize a method. - - Undo these changes: - * class.c (finish_vtbls): Build more vtables if flag_rtti is on. - * class.c (modify_all_direct_vtables): Likewise. - * init.c (expand_direct_vtbls_init): Expand more vtables if - flag_rtti is on. - -Sat Apr 8 17:45:41 1995 Mike Stump - - * gc.c (build_headof): Use ptrdiff_type_node instead of - integer_type_node on pointer arithmetic. - -Sat Apr 8 11:57:04 1995 Jason Merrill - - * typeck.c (build_modify_expr): Undo previous change. - -Thu Apr 6 01:23:50 1995 Jason Merrill - - * Makefile.in (compiler): Remove ../cc1plus before rebuilding it. - - * repo.c (get_base_filename): Put the .rpo file in the directory - with the object file, not the source. - - * typeck.c (build_conditional_expr): Handle pmf's better. - - * repo.c (finish_repo): Also use ASM_OUTPUT_LABELREF to print out - the name of the symbol. - -Wed Apr 5 15:24:12 1995 Jason Merrill - - * repo.c (open_repo_file): Make repo filename DOS-compliant. - (*): Also write a new repo file if some previously-used - templates are no longer used. Only remember the identifier. - - * lex.c (cons_up_default_function): If this function belongs to a - template class, call repo_template_used for it. - - * repo.c (repo_template_used): Using a class means using its vtable, - if any. - (finish_repo): Likewise. - - * typeck.c (build_modify_expr): Only wrap TARGET_EXPRs in RTL_EXPRs - if the type has a complex copy constructor. - - * decl2.c (lang_decode_option): -frepo implies - -fno-implicit-templates. - - * decl.c (start_function): Clear current_{base,member}_init_list. - - * lex.c (init_lex): Also unset *_eq if ! flag_operator_names. - -Tue Apr 4 16:11:08 1995 Jason Merrill - - * decl.c (struct cp_function): Add {base,member}_init_list. - (push_cp_function_context): Save current_{base,member}_init_list. - (pop_cp_function_context): Restore them. - -Mon Apr 3 16:55:08 1995 Jason Merrill - - * repo.c (get_base_filename): Take filename parm, fix logic bug. - - * typeck.c (build_compound_expr): Do not warn about a compound expr - in which the first expression has no side effects. - (build_x_compound_expr): Warn here instead. - (build_conditional_expr): Don't warn about a conditional expression - between an enum and the type it promotes to. - - * init.c (build_new): Handle initialization of arrays of builtins - properly. - -Mon Apr 3 15:08:04 1995 Brendan Kehoe - - * repo.c: Include config.h to get definitions of bcopy and rindex - on systems that don't have them (e.g., SVR4). - -Mon Apr 3 14:41:55 1995 Mike Stump - - * decl2.c (finish_table): Pass NULL_TREE instead of init to - finish_decl so that it won't try and do error checking on the - initializer. - -Mon Apr 3 10:45:50 1995 Jason Merrill - - * repo.c (get_base_filename): Analyze COLLECT_GCC_OPTIONS to - determine whether this compile used -c -o. - (open_repo_file): Use get_base_filename. Remove the extension. - (finish_repo): Spit out the values of main_input_filename, - COLLECT_GCC and COLLECT_GCC_OPTIONS. - - * parse.y (structsp): Add TYPENAME_KEYWORD complex_type_name. - -Sun Apr 2 23:43:51 1995 Jason Merrill - - * search.c (compute_access): Don't try to do access control on - nested types. - -Fri Mar 31 10:14:23 1995 Jason Merrill - - * repo.c: New file to handle things repo. - - * pt.c (instantiate_template): Call repo_template_used if the - definition is accessible. - (mark_function_instantiated): Split out from - do_function_instantiation. - (mark_class_instantiated): Split out from do_type_instantiation. - - * parse.y (template_instantiate_once): Call repo_template_used. - - * lex.c (lang_init): Call init_repo. - - * decl2.c: Handle flag_use_repository. - (finish_file): Call finish_repo. - - * decl.c (start_method): Call repo_template_used if this is a - template method. - - * Makefile.in (CXX_OBJS): Add repo.o. - (repo.o): Add dependencies. - - * Make-lang.in (CXX_SRCS): Add repo.c. - - * decl.c (start_function): If DECL_INTERFACE_KNOWN and - DECL_NOT_REALLY_EXTERN are both set, unset DECL_EXTERNAL. - - * typeck.c (build_binary_op_nodefault): Identify the invalid operand - types used. - - * decl.c (duplicate_decls): Propagate DECL_NOT_REALLY_EXTERN. - -Thu Mar 30 17:54:42 1995 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Tidy up use of build_type - and result_type. When checking for comparison between signed - and unsigned, use result_type rather than the (possibly shortened) - type of op0. Also, don't warn about equality comparison of a - signed operand to an unsigned constant that fits in the signed - type. - - * method.c (do_build_copy_constructor): Reverse - current_base_init_list after we've built it up. - -Thu Mar 30 14:35:18 1995 Mike Stump - - * except.c (build_throw): Never warn about the value of throw not - being used. - -Thu Mar 30 13:16:54 1995 Mike Stump - - * except.c (expand_start_catch_block): Check for bad catch parameter - declarations. - -Thu Mar 30 13:06:11 1995 Jason Merrill - - * decl.c (finish_function): Only set DECL_NOT_REALLY_EXTERN if - DECL_EXTERNAL is not already set. - -Thu Mar 30 11:26:24 1995 Mike Stump - - * method.c (emit_thunk): Let poplevel know that the last level is - for a function so it can create a BLOCK_NODE and set DECL_INITIAL. - -Thu Mar 30 11:15:06 1995 Jason Merrill - - * decl2.c (import_export_inline): Don't set DECL_NOT_REALLY_EXTERN - here. - - * decl.c (grokdeclarator): OK, don't abort if we see a decl with - METHOD_TYPE. - (finish_function): Set DECL_EXTERNAL and DECL_NOT_REALLY_EXTERN on - all deferred inlines. - -Wed Mar 29 19:35:02 1995 Jason Merrill - - * cp-tree.h (DECL_THIS_INLINE): New macro. - (DECL_NOT_REALLY_EXTERN): New macro. - (DECL_THIS_STATIC): New macro. - - * decl.c: Lose all references to current_extern_inline. Break - inline semantics into DECL_INLINE for actual inlining and - DECL_THIS_INLINE for the linkage wierdness. Use DECL_THIS_STATIC. - * decl2.c: Use DECL_NOT_REALLY_EXTERN to indicate that we want to - emit an inline here. Associated changes. - * lex.c: Likewise. - * pt.c: Likewise. - * typeck.c: Likewise. - - * call.c (build_method_call): Don't bother trying to handle inlines - specially. - * cvt.c (convert_to_aggr): Likewise. - - * pt.c (do_function_instantiation): Handle instantiation of - public inlines, too. - -Wed Mar 29 16:04:25 1995 Mike Stump - - * except.c (init_exception_processing): Change the interface for - __throw_type_match and add decl for new rtti matching routine - __throw_type_match_rtti. - (build_eh_type): New routine to build a run time descriptor for the - expression given. - (expand_start_catch_block): Update to use new calling convention for - the matcher. - (expand_throw): Update to use build_eh_type. - -Mon Mar 27 07:14:33 1995 Warner Losh - - * g++.c: Removed __NetBSD__ from conditional. - Declare strerror if HAVE_STRERROR is defined; otherwise - declare sys_errlist and sys_nerr. - (my_strerror): New function. - -Tue Mar 28 14:16:35 1995 Jason Merrill - - * search.c (get_binfo): Don't try to be so clever. - - * tree.c (copy_to_permanent): Also suspend_momentary(). - - * cvt.c (cp_convert_to_pointer): Hand off to convert_fn_pointer even - if the types are the same. - - * decl.c (start_function): Handle extern inlines more like C++ says - we should. - - * init.c (build_member_call): Hand constructor calls off to - build_functional_cast. - - * typeck2.c (build_functional_cast): Use DECL_NESTED_TYPENAME to get - the name of the type. - -Tue Mar 28 13:13:56 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Check for the decl returned by - grokfndecl to be null before using build_decl_attribute_variant. - -Mon Mar 27 18:04:41 1995 Brendan Kehoe - - * init.c (build_new): Use build_pointer_type instead of - TYPE_POINTER_TO. - -Fri Mar 24 12:11:24 1995 Jason Merrill - - * typeck.c (build_conditional_expr): Handle pmfs. - (convert_for_assignment): Fix pmf support. - - * cvt.c (convert_fn_ptr): Support !flag_vtable_thunks. - (cp_convert_to_pointer): Handle pmfs. - (cp_convert): Pass pmfs to cp_convert_to_pointer. - - * typeck.c (common_type): Handle inheritance for pmfs. - - * typeck2.c (build_m_component_ref): Do access control. - - * typeck.c (comp_target_types): Check for conversion to void * - before checking trickier conversions. - - * decl.c (duplicate_decls): Propagate DECL_ABSTRACT_VIRTUAL_P. - - * pt.c (push_tinst_level): Complain if template instantiation depth - is greater than max_tinst_depth. - - * typeck.c (common_type): Assume that we can call common_type to - unify the target type of a pointer. - -Thu Mar 23 00:48:44 1995 Jason Merrill - - * decl2.c (finish_file): Don't synthesize methods at - finish_vtable_prevardecl time. Do synthesize methods that are not - used, but are public and not external. - - * cvt.c (build_type_conversion): Only give an error if for_sure. - - * typeck.c (comp_target_types): Only support pointer conversions if - nptrs > 0. - -Wed Mar 22 19:30:15 1995 Brendan Kehoe - - * init.c (build_new): Catch use of an initializer list where it - shouldn't be. - -Wed Mar 22 16:21:07 1995 Jason Merrill - - * init.c (build_new): Wrap alloc_expr in an RTL_EXPR if nelts is - non-constant. - - * decl2.c: temp_name_counter is now public. - - * decl.c (struct cp_function): Add temp_name_counter field. - (push_cp_function_context): Save it. - (pop_cp_function_context): Restore it. - - * typeck.c (common_type): Handle unifying function types, and unify - unmatched things to void* with a compiler_error, rather than - silently like before. - -Wed Mar 22 15:10:34 1995 Mike Stump - - * decl2.c (finish_prevtable_vardecl, finish_vtable_vardecl): Revert - Brendan's last change and fix latent problem that causes TD entries - to not come out when the things that need them has yet to be - expanded. - -Wed Mar 22 15:12:00 1995 Jason Merrill - - * typeck.c (build_binary_op_nodefault, comparison ops): Update type0 - and type1, since we might have changed op0 or op1. - -Wed Mar 22 13:33:45 1995 Jason Merrill - - * typeck.c (common_type): Don't mess up templates. - -Wed Mar 22 04:56:00 1995 Jason Merrill - - * typeck.c (common_type): Handle ptms properly. Also handle - T* -> void*. - (build_binary_op_nodefault): New variable build_type controls what - type is given to the expression when it is created. Set this to - boolean_type_node for comparison ops instead of using result_type. - (comp_target_types): Allow T * -> void *. - - * cvt.c (cp_convert_to_pointer): Do access control when converting - ptms, too. - -Tue Mar 21 17:25:06 1995 Brendan Kehoe - - * parse.y (extern_lang_string): Catch use of linkage specs that - aren't all naming the same language. - - * class.c (finish_struct): Delete accidental duplicate code. - -Tue Mar 21 14:00:57 1995 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Disable pedwarns about - comparing functions and incomplete types. - - * decl.c (finish_function): Only unset current_function_decl if - !nested. - (duplicate_decls): Last change went too far; we only want to stop - checking for value/reference ambiguity. - -Tue Mar 21 01:26:39 1995 Mike Stump - - * gc.c (build_generic_desc): Zap the DECL_SIZE so that we can lay it - out fresh, as the new type may be larger. - -Mon Mar 20 19:01:10 1995 Jason Merrill - - * expr.c (extract_init): Try to expand the RTL for the - initialization and figure out what it will look like so we can avoid - run-time initialization. Disabled for now. - (extract_scalar_init): Helper for scalar initialization. - (extract_aggr_init): Helper for aggregate initialization. - - * decl.c (duplicate_decls): Don't complain about ambiguous - declarations. - (obscure_complex_init): Now returns a tree. Call extract_init if - we're optimizing and this is a toplevel decl. - (finish_decl): Update accordingly. - - * lex.c (check_newline): If we're just changing files (not pushing - or popping), update input_file_stack->name. - -Mon Mar 20 17:55:04 1995 Mike Stump - - * pt.c (type_unification): Only TEMPLATE_DECLs are handled right now - in the transitive unification code. - -Mon Mar 20 16:07:50 1995 Brendan Kehoe - - * decl.c (shadow_tag): Don't allow inline, virtual, or explicit on - non-functions. - (grokdeclarator): Don't allow friends to be defined in local classes. - -Sat Mar 18 04:03:33 1995 Jason Merrill - - * decl2.c (finish_prevtable_vardecl): Use DECL_DECLARED_STATIC - rather than DECL_SAVED_INSNS to decide whether or not this method - was declared inline. - - * method.c (synthesize_method): Turn off DECL_INLINE if - function_cannot_inline_p thinks we're too large. - - * typeck.c (build_indirect_ref): Use build_expr_type_conversion. - -Fri Mar 17 17:47:36 1995 Jason Merrill - - * class.c (instantiate_type): Handle pmfs. - - * typeck.c (convert_for_assignment): Check types when assigning one - pmf to another. - - * decl.c (define_label): Fix logic for printing out the name of the - label in an error message. - - * error.c (dump_expr): Support ARRAY_REF. - -Fri Mar 17 17:43:02 1995 Brendan Kehoe - - * decl2.c (finish_vtable_vardecl): Call build_t_desc here. - (finish_prevtable_vardecl): Instead of here. - -Fri Mar 17 14:40:45 1995 Jason Merrill - - * decl.c (expand_static_init): Also use expand_aggr_init if the - initializer is a TREE_LIST. - (grokdeclarator): Only pedwarn about extra qualification if -pedantic. - - * pt.c (unify): Fix unification of return type. - - * expr.c (fixup_result_decl): Use store_expr, rather than - emit_move_insn, to move the return value into the place where - callers will expect it. - -Thu Mar 16 22:05:25 1995 Jason Merrill - - * init.c (build_offset_ref): Call assmble_external on functions. - * typeck.c (build_component_ref): Likewise. - -Thu Mar 16 20:28:16 1995 Brendan Kehoe - - * decl.c (struct saved_scope): Add members base_init_list and - member_init_list. - (push_to_top_level): Save current_base_init_list and - current_member_init_list to them. - (pop_from_top_level): Put it back. - -Thu Mar 16 19:21:14 1995 Jason Merrill - - * pt.c (instantiate_template): Call assemble_external. - -Thu Mar 16 18:07:54 1995 Brendan Kehoe - - * class.c: Include rtl.h, to get NULL_RTX. - (finish_struct): Also zero out DECL_SAVED_INSNS, to avoid problems - on hosts with different sizes for each part of the union. - * tree.c: Also include rtl.h. - (layout_basetypes): Same change for DECL_SAVED_INSNS. - -Thu Mar 16 13:57:36 1995 Jason Merrill - - * pt.c (unify): Fix array domain unification for 64-bit targets. - - * decl2.c (finish_file): Push bizarre type decl before walking the - vtables the first time. - (walk_vtables): OK, don't set prev to vars if the vardecl_fn messed - with TREE_CHAIN (prev). - - * init.c (emit_base_init): Use convert_pointer_to_real instead of - convert_pointer_to when converting to a direct base. - -Wed Mar 15 20:26:29 1995 Mike Stump - - * pt.c (type_unification): Handle transitive unification better. - -Wed Mar 15 13:56:16 1995 Jason Merrill - - * decl2.c (walk_vtables): Always set prev to vars. - (mark_vtable_entries): Call assemble_external on the vtable entries. - - * class.c (finish_struct): Set the vtable's size to NULL_TREE before - calling layout_decl, so that it gets updated properly. - - Finally re-enable dynamic synthesis. This time it works. - * method.c (synthesize_method): Pass decl_function_context (fndecl) - to {push,pop}_cp_function_context. - * decl.c (push_cp_function_context): Now takes a tree argument. - (pop_cp_function_context): Likewise. - * call.c (build_method_call): Enable synthesis. - * lex.c (cons_up_default_function): Likewise. - -Tue Mar 14 19:14:19 1995 Doug Evans - - * parse.y (setattrs): Chain onto prefix_attributes rather than - setting it. - -Wed Mar 15 13:00:00 1995 Brendan Kehoe - - * decl.c (pushdecl): Check if the type of the VAR_DECL is an - error_mark_node before trying to read TYPE_LANG_SPECIFIC. - -Mon Mar 13 21:00:28 1995 Brendan Kehoe - - * decl.c (grokdeclarator, case ARRAY_REF): Wrap the exp with fold, - and convert the size and integer_one_node to the index type. - -Mon Mar 13 08:01:02 1995 Jason Merrill - - * typeck.c (get_member_function_from_ptrfunc): Save the instance - argument, and tack it onto the front of the COND_EXPR to make the - semantics come out right. Grab the instance argument from - '*instance_ptrptr', rather than having it passed in separately. - - * various: Change various consed-up comparison operations to have - boolean type. Remove the instance argument in calls to - get_member_function_from_ptrfunc. - - * error.c (dump_expr): Dump true and false as "true" and "false". - - * decl2.c (finish_file): Also set DECL_STATIC_FUNCTION_P on the - global init function. - - * decl.c (finish_function): Only set DECL_EXTERNAL here if the - inline function is public. - -Sat Mar 11 00:58:03 1995 Jason Merrill - - * init.c (is_friend): Be more careful about checking - DECL_CLASS_CONTEXT on non-member functions. - - * decl2.c (finish_vtable_vardecl): Don't bother calling - assemble_external here. - (prune_vtable_vardecl): New function that just splices out the - vtable decl from the top-level decls. - (import_export_inline): Unset DECL_EXTERNAL at first. - (finish_file): Don't bother calling assemble_external here. Do - splice out all of the vtables. - -Fri Mar 10 14:42:29 1995 Jason Merrill - - * decl.c (finish_function): If we're not emitting the function yet, - call assemble_external for it. - - * decl2.c (finish_prevtable_vardecl): Don't call mark_vtable_entries - here. - (finish_vtable_vardecl): Don't do the linkage deduction thing here. - Also don't splice out the current vtable if it is unused. - (finish_file): Move the second walk_vtables and the synthesis check - inside the 'reconsider' loop. Move thunk emission after the - 'reconsider' loop. - -Thu Mar 9 16:28:16 1995 Brendan Kehoe - - * pt.c (tsubst): Don't bother calling cp_build_type_variant, since it - was passing bogus values for readonly and volatile from the original - template decl, not the resultant type of the tsubst call. - - * class.c (duplicate_tag_error): Use cp_error_at to point out the - previous definition of the tag. - -Thu Mar 9 10:46:17 1995 Jason Merrill - - * decl.c (start_function): Clear base_init_insns and protect_list. - (struct cp_function): Add base_init_insns field. - (push_cp_function_context): Also save base_init_insns. - (pop_cp_function_context): Also restore base_init_insns. - -Wed Mar 8 13:31:44 1995 Jason Merrill - - * init.c (member_init_ok_or_else): Check for initializing a static - member here. - (emit_base_init): Instead of here. - -Tue Mar 7 16:03:26 1995 Jason Merrill - - * call.c (build_method_call): Disable synthesis as needed. - * lex.c (cons_up_default_function): Likewise. - -Tue Mar 7 10:14:29 1995 Brendan Kehoe - - * parse.y: New rules to allow attributes in a prefix position. - (prefix_attributes): New variable. Pass it into cplus_decl_attributes. - (setattr): New rule. - (reserved_declspecs, declmods): Catch attributes here. - * decl2.c (cplus_decl_attributes): Add PREFIX_ATTRIBUTES argument. - * decl.c (duplicate_decls): Pass DECL_MACHINE_ATTRIBUTES to - descendent typedef. - (grokdeclarator): Added code to support machine attributes. - * Makefile.in (stamp-parse): Expect 5 shift/reduce failures. - -Mon Mar 6 15:07:02 1995 Jason Merrill - - * call.c (build_method_call): Don't synthesize methods outside of a - function. - - Make base initialization more re-entrant so that synthesis on the - fly will work (and, eventually, template instantiation on the fly). - * init.c (sort_member_init): Don't bother with members that can't be - initialized. Reorganize a bit. Don't initialize base members here. - (sort_base_init): New function, like sort_member_init, but for base - classes. Steals some code from emit_base_init. - (emit_base_init): Simplify. Call sort_{member,base}_init before - doing any initialization, so we don't have to save - current_{member,base}_init_list in push_cp_function_context. - (expand_aggr_vbase_init_1): Adjust for sort_base_init. - (expand_aggr_vbase_init): Simplify. - * decl.c (struct cp_function): Add protect_list field. - (push_cp_function_context): Also save protect_list. - (pop_cp_function_context): Also restore protect_list. - * call.c (build_method_call): Enable synthesis at point of call. - * lex.c (cons_up_default_function): Likewise. - - * parse.y: Turn -ansi checks back into -pedantic checks. - - * init.c (build_new): Fix -fcheck-new for array new. - -Sat Mar 4 15:55:42 1995 Fergus Henderson - - * typeck.c (build_compound_expr): warn if left-hand operand of - comma expression has no side-effects. - -Fri Mar 3 15:16:45 1995 Jason Merrill - - * parse.y (primary): Change 'object qualified_id *' rules to 'object - overqualified_id *'. - -Fri Mar 3 12:48:17 1995 Brendan Kehoe - - * parse.y (unary_expr): Catch doing sizeof an overloaded function. - Make the error look the same as the one we issue in c_sizeof. - - * typeck.c (build_binary_op_nodefault): Give an error for trying - to compare a pointer-to-member to `void *'. - -Fri Mar 3 11:28:50 1995 Jason Merrill - - * typeck.c (build_unary_op): Handle bool increment with smoke and - mirrors here, rather than in expand_increment where it belongs, - because Kenner doesn't agree with me. - -Fri Mar 3 00:08:10 1995 Brendan Kehoe - - * decl.c (grokparms): Catch a PARM_DECL being used for a default - argument as well. - -Thu Mar 2 20:05:54 1995 Brendan Kehoe - - * init.c (build_new): Don't allow new on a function type. - - * parse.y (primary): Avoid a crash when seeing if the arg is of - the same type as that given for the typespec in an explicit dtor call. - -Thu Mar 2 00:49:38 1995 Jason Merrill - - * decl.c (finish_function): Change test for calling - mark_inline_for_output. - -Wed Mar 1 11:23:46 1995 Jason Merrill - - * typeck.c (build_modify_expr): Complain if - build_default_binary_type_conversion fails. - - * init.c (expand_default_init): Handle arguments of unknown type - properly. - - * cvt.c (build_expr_type_conversion): Only complain about ambiguity - if 'complain'. - * various: Pass 'complain'. - - * typeck.c (comptypes): Be more picky about comparing UPTs. - -Wed Mar 1 11:03:41 1995 Brendan Kehoe - - * decl.c (grokdeclarator): If declarator is null, say that the - type used has an incomplete type. - -Wed Mar 1 10:06:20 1995 Jason Merrill - - * pt.c (instantiate_template): Copy the template arguments to the - permanent_obstack. Also use simple_cst_equal to compare them when - looking for a previous instantiation. - - * tree.c (make_deep_copy): Support copying INTEGER_TYPEs (assuming - they are array domain types). - -Tue Feb 28 23:24:55 1995 Jason Merrill - - * cp-tree.h: Define WANT_* constants for passing to - build_expr_type_conversion. - * cvt.c (build_expr_type_conversion): New function to build - conversion to one of a group of suitable types. - (build_default_binary_type_conversion): Use it. - * decl2.c (grok_array_decl): Likewise. - * typeck.c (build_unary_op): Likewise. - (build_array_ref): Tidy up a bit. - (build_binary_op): Likewise. - -Tue Feb 28 19:57:31 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Don't allow decl of an argument as `void'. - -Tue Feb 28 17:23:36 1995 Jason Merrill - - * parse.y (typed_declspecs1): Add 'typespec reserved_typespecquals - reserved_declspecs' rule. - - * parse.y (expr_or_declarator): Remove notype_qualified_id rule. - (direct_notype_declarator): Likewise. - (complex_direct_notype_declarator): Add notype_qualified_id rule. - - * lex.c (real_yylex): Handle :> digraph properly. - -Tue Feb 28 12:26:29 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Check if it's a friend, not if it's - non-virtual, that's being initialized. Move the check up to - before FRIENDP would get cleared. Catch an unnamed var/field - being declared void. Say just `field' instead of `structure field' - in the error message. Only go for the operator name if DECLARATOR - is non-null. - -Tue Feb 28 00:08:01 1995 Jason Merrill - - * decl.c (start_function): Complain about abstract return type. - (grokdeclarator): Complain about declaring constructors and - destructors to be const or volatile. Complain about declaring - destructors to be static. - - * pt.c (uses_template_parms): Handle pmfs. - - * decl.c (grokdeclarator): Don't call variable_size for array bounds - that only depend on template constant parameters. - -Mon Feb 27 15:38:16 1995 Brendan Kehoe - - * error.c (dump_decl): Only look to see if it's a vtable if we - actually have a name to check out. - -Mon Feb 27 13:37:53 1995 Jason Merrill - - * cvt.c (convert_to_aggr): Lose misleading shortcut. - -Sun Feb 26 17:27:32 1995 Doug Evans - - * decl.c (set_nested_typename): Always set DECL_IGNORED_P, - not just for dwarf. - -Sun Feb 26 00:10:18 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Don't allow a static member to be - declared `register'. - - * init.c (make_friend_class): Move up to a pedwarn for the warning - about a class declaring friends with itself. - - * decl.c (grokdeclarator): You can't do `volatile friend class foo' - or `inline friend class foo'. Only try to make a friend out of - TYPE if we didn't already reset it to integer_type_node. - -Sat Feb 25 22:32:03 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Don't allow initialization of a - non-virtual function. - - * decl.c (start_function): Do a pedwarn if we're changing `main' - to have an int return type. - -Sat Feb 25 00:02:05 1995 Jason Merrill - - * typeck.c (build_modify_expr): Handle simple assignment from - TARGET_EXPRs by building up an RTL_EXPR to force expansion. Whew. - -Fri Feb 24 18:27:14 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Also don't allow virtual outside of a - class decl for a scope method definition performed at global binding. - - * init.c (build_offset_ref): Don't allow creation of an OFFSET_REF - of a bitfield. - - * decl.c (grokdeclarator): Don't allow a const to be declared mutable. - - * typeck.c (build_binary_op): Return an error_mark_node if either - one of the args turned into an error_mark_node when we tried to - use default_conversion. - - * typeck.c (build_unary_op): Forbid using postfix -- on a bool. - - * decl.c (grokdeclarator): Allow `signed' and `unsigned' to be - used on `__wchar_t'. - -Fri Feb 24 13:59:53 1995 Mike Stump - - * except.c (end_protect_partials): Do it the right way. - -Wed Feb 22 15:42:56 1995 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Upgrade warning about - comparing distinct pointer types to pedwarn. - - * typeck2.c (digest_init): Cope with extra braces. - - * typeck.c (build_binary_op_nodefault): Use tree_int_cst_sgn instead - of INT_CST_LT (..., interger_zero_node). - -Wed Feb 22 14:45:52 1995 Brendan Kehoe - - * except.c [!TRY_NEW_EH] (end_protect_partials): Define dummy - function for systems that don't have EH. - -Tue Feb 21 19:18:31 1995 Jason Merrill - - * call.c (can_convert_arg): Like can_convert, but takes an arg as - well. - - * pt.c (type_unification): Allow implicit conversions for parameters - that do not depend on template parameters. - -Tue Feb 21 18:43:48 1995 Douglas Rupp - - * Make-lang.in, config-lang.in: ($exeext): New macro. - * Make-lang.in: Try a "cp" if "ln" fails. - * cp-tree.h (decl_attributes): Added argument. - * decl2.c (cplus_decl_attribute): Add arg to decl_attributes. - * cp/g++.c: Added #ifdefs for sys/file.h and process.h for NT. - Modified spawnvp to have to correct number of arguments for OS/2, NT. - -Tue Feb 21 18:36:55 1995 Mike Stump - - * decl.c (finish_function): Add calls to end_protect_partials to end - the exception region that protects constructors so that partially - constructed objects can be partially destructed when the constructor - throws an exception. - * init.c (perform_member_init, sort_member_init, emit_base_init): - Added support for partially constructed objects. - * init.c (build_partial_cleanup_for): New routine to do partial - cleanups of a base class. - * decl2.c (finish_file): Move the emitting of the exception table - down, after we emit all code that might have exception regions in - them. - * except.c (end_protect_partials, might_have_exceptions_p): New - routines. - (emit_exception_table): Always output table if called. - * cp-tree.h (protect_list, end_protect_partials, - might_have_exceptions_p, emit_exception_table): Added. - -Tue Feb 21 16:05:59 1995 Brendan Kehoe - - * gc.c (build_typeid): Pass a NULL_TREE, not the bogus, unused - address of a local variable. - * class.c (build_vfn_ref): Only try to build the PLUS_EXPR if we - were given a non-null PTR_TO_INSTPTR. - -Tue Feb 21 01:53:18 1995 Jason Merrill - - * decl.c (duplicate_decls): Always lay out the merged decl. - - * decl2.c (finish_vtable_vardecl): Don't do vtable hack on templates. - (finish_prevtable_vardecl): Likewise. - - * method.c (synthesize_method): Set interface_{unknown,only} - according to the settings for our class, not the file where it comes - from. - -Sat Feb 18 12:26:48 1995 Mike Stump - - * except.c: Handle systems that define __i386__ but not __i386. - -Fri Feb 17 15:31:31 1995 Jason Merrill - - * decl2.c (reparse_decl_as_expr): Support being called without a - type argument. - - * parse.y (primary): Add '(' expr_or_declarator ')'. Adds 4 r/r - conflicts. Sigh. - -Fri Feb 17 12:02:06 1995 Mike Stump - - * parse.y (template_def, fndef, fn.def1, return_init, condition, - initdcl0, initdcl, notype_initdcl0, nomods_initdcl0, - component_decl_1, after_type_component_declarator0, - notype_component_declarator0, after_type_component_declarator, - notype_component_declarator, after_type_component_declarator, - full_parm, maybe_raises, exception_specification_opt): Fix up, - include exception_specification_opt maybeasm maybe_attribute and - maybe_init if missing. Rename maybe_raises to - exception_specification_opt to match draft wording. Use maybe_init - to simplify rules. - -Fri Feb 17 01:54:46 1995 Jason Merrill - - * init.c (build_new): Set TREE_NO_UNUSED_WARNING on COMPOUND_EXPRs - built for news of scalar types. - -Thu Feb 16 17:48:28 1995 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Update code for warning - about signed/unsigned comparisons from C frontend. Realize that the - code in the C frontend is, if anything, even more bogus. Fix it. - (build_binary_op): Undo default_conversion if it wasn't useful. - - * typeck.c (build_unary_op, ADDR_EXPR): Lose bogus special case for - PRE*CREMENT_EXPR. - - * decl2.c (import_export_vtable): Don't try the vtable hack - if the class doesn't have any real non-inline virtual functions. - (finish_vtable_vardecl): Don't bother trying to find a non-inline - virtual function in a non-polymorphic class. - (finish_prevtable_vardecl): Likewise. - - * decl2.c (import_export_vtable): Use and set DECL_INTERFACE_KNOWN. - - * cp-tree.h (DECL_INTERFACE_KNOWN): Use DECL_LANG_FLAG_5. - - * init.c (expand_virtual_init): Always call assemble_external. - - * class.c (build_vfn_ref): Always call assemble_external. - (build_vtable): Always call import_export_vtable. - (prepare_fresh_vtable): Likewise. - (add_virtual_function): Don't bother setting TREE_ADDRESSABLE. - -Thu Feb 16 03:28:49 1995 Jason Merrill - - * class.c (finish_struct): Use TYPE_{MIN,MAX}_VALUE to determine - whether an enumerated type fits in a bitfield. - -Wed Feb 15 15:38:12 1995 Jason Merrill - - * class.c (grow_method): Update method_vec after growing the class - obstack. - -Wed Feb 15 13:42:59 1995 Mike Stump - - * parse.y (handler_seq): Push a level for the catch parameters. - -Wed Feb 15 12:42:57 1995 Jason Merrill - - * init.c (emit_base_init): Update BINFO_INHERITANCE_CHAIN on my - bases, in case they've been clobbered. - -Wed Feb 15 12:07:29 1995 Mike Stump - - * class.c (finish_base_struct): Set up BINFO_INHERITANCE_CHAIN here, - so that one day it will always be valid. - * tree.c (propagate_binfo_offsets, layout_vbasetypes): Likewise. - - * cp-tree.h (copy_binfo): Removed, unused. - * tree.c (copy_binfo): Likewise. - -Wed Feb 15 00:05:30 1995 Jason Merrill - - * init.c (build_new): Save the allocation before calling - expand_vec_init on it. - - * decl.c (finish_enum): The TYPE_PRECISION of the enum type mush - match the TYPE_PRECISION of the underlying type for constant folding - to work. - -Tue Feb 14 15:31:25 1995 Mike Stump - - * except.c (push_eh_entry, expand_start_all_catch, - expand_leftover_cleanups, expand_end_catch_block): Keep track of - the context in which the exception region occurs. - (build_exception_table): If the region was not output, don't output - the entry in the eh table for it. - -Tue Feb 14 02:15:43 1995 Jason Merrill - - * init.c (expand_default_init): Only use a previous constructor call - if it's a call to our constructor. Does the word "Duh" mean - anything to you? - - * decl.c (grokparms): Fine, just don't call - convert_for_initialization at all. OK? Happy now? - -Mon Feb 13 02:23:44 1995 Jason Merrill - - * cp-tree.h (CLASSTYPE_FIRST_CONVERSION): Make sure that the class - method vector has a second element before returning it. - - * decl.c (grokparms): Don't strip REFERENCE_TYPE before calling - convert_for_initialization. - -Sun Feb 12 03:57:06 1995 Jason Merrill - - * typeck.c (build_modify_expr): Compare function name to - constructor_name (current_class_type) instead of current_class_name. - - * decl.c (grokparms): Don't do anything with the return value of - convert_for_initialization. - - * error.c (dump_decl): Also dump_readonly_or_volatile on the decl. - - * decl.c (duplicate_decls): Tweak error message. - - * typeck.c (build_const_cast): Implement checking. - (build_reinterpret_cast): Implement some checking. - - * cp-tree.h (CONV_FORCE_TEMP): Require a new temporary when - converting to the same aggregate type. - (CONV_STATIC_CAST): Include it. - (CONV_C_CAST): Likewise. - * cvt.c (convert_force): Use CONV_C_CAST instead of CONV_OLD_CONVERT. - (cp_convert): Only force a new temporary if CONV_FORCE_TEMP. - -Fri Feb 10 16:18:52 1995 Jason Merrill - - * typeck.c (build_c_cast): Use non_lvalue to tack something on - where necessary. - - * decl.c (auto_function): Now a function. - * except.c (init_exception_processing): terminate, unexpected, - set_terminate, and set_unexpected have C++ linkage. - - * typeck.c (build_unary_op, TRUTH_NOT_EXPR): Use convert instead of - truthvalue_conversion for converting to bool, as it handles - user-defined conversions properly. - (condition_conversion): Likewise. - - * except.c (expand_throw): Don't call convert_to_reference. - Pass the correct parameters to build_new. - - * method.c (do_build_assign_ref): Don't use access control when - converting to a base reference here. - (do_build_copy_constructor): Or here. - - * init.c (build_new): Unset TREE_READONLY on the dereferenced - pointer before assigning to it. - - * decl.c (maybe_build_cleanup): Don't bother stripping const here. - - * decl2.c (delete_sanity): You can now delete pointer to const. - -Fri Feb 10 13:28:38 1995 Jason Merrill - - * decl.c (finish_function): Don't rely on actual parameters being - evaluated left-to-right. - * except.c (expand_end_catch_block): Likewise. - -Fri Feb 10 00:52:04 1995 Jason Merrill - - * tree.c (real_lvalue_p): Like lvalue_p, but class temps aren't - considered lvalues. - * cvt.c (convert_to_reference): Use real_lvalue_p instead of - lvalue_p. - - * cvt.c (build_type_conversion_1): Don't call convert on aggregate - types. - (convert_to_reference): Fix erroneous text substitution. - - * typeck2.c (initializer_constant_valid_p): Update from C frontend. - Add new argument to all callers. - - * typeck.c (convert_arguments): Check for error_mark_node before - trying to do anything with the actual parameter. - - * typeck.c (condition_conversion): Build up a CLEANUP_POINT_EXPR and - fold it. - (bool_truthvalue_conversion): Remove. Fix all callers to call - truthvalue_conversion instead. - (various): Fold CLEANUP_POINT_EXPRs. - - * parse.y (conditions): Call condition_conversion rather than - building up a CLEANUP_POINT_EXPR. - - * pt.c (end_template_decl): Don't warn_if_unknown_interface here - under -falt-external-templates. - -Thu Feb 9 05:24:10 1995 Jason Merrill - - * init.c (build_new): Complain about new of const type without - initializer. Other cleanup. - - * call.c (compute_conversion_costs): Don't call - build_type_conversion with a reference type; convert to the target - type and check its lvaluetude. - * cvt.c (convert_to_reference): Likewise. - - * cvt.c (build_type_conversion_1): There will never be any need to - dereference references here now. - -Thu Feb 9 00:37:47 1995 Mike Stump - - * except.c (expand_builtin_throw): Make sure we only `use' the - value of return_val_rtx. - -Wed Feb 8 15:45:55 1995 Jason Merrill - - * parse.y (structsp): Don't complain about declaring a type being - defined to be a friend. - - * decl2.c (warn_if_unknown_interface): Note the template in question - and the point of instantiation, for -falt-external-templates. - * lex.c (reinit_parse_for_method): Pass the decl to - warn_if_unknown_interface. - * pt.c (instantiate_template): Likewise. - (end_template_decl): Likewise. - - * decl.c (set_nested_typename): Set IDENTIFIER_TYPE_VALUE on the - nested name again, to make local classes work a bit better. - - * typeck.c (build_function_call_real): Dereference reference after - checking for incomplete type. - - * init.c (build_new): Accept new of const and volatile types. - -Wed Feb 8 14:04:16 1995 Jason Merrill - - * decl.c (grokdeclarator): Fix error message. - -Wed Feb 8 03:16:15 1995 Jason Merrill - - * typeck.c (convert_for_initialization): Do bash arrays when - converting to a reference to non-array. - -Tue Feb 7 15:50:33 1995 Jason Merrill - - * cvt.c (cp_convert): Don't call convert_to_reference, or - automatically dereference references. Do pass reference conversions - to cp_convert_to_pointer. - (cp_convert_to_pointer): Support references. - - * call.c (build_method_call): Don't build up a reference to the - parameter here; let build_overload_call handle that. - - * typeck.c (build_c_cast): Call convert_to_reference directly if - converting to a reference type. - * method.c (do_build_copy_constructor): Likewise. - * method.c (do_build_copy_constructor): Likewise. - (do_build_assign_ref): Likewise. - - * call.c (build_method_call): Dereference a returned reference. - * typeck.c (build_function_call_real): Likewise. - - * decl.c (xref_basetypes): Check for unions with basetypes here. - (xref_tag): Instead of here. - - * pt.c (process_template_parm): Template type parm decls are - artificial. - -Mon Feb 6 04:32:09 1995 Jason Merrill - - * parse.y (typed_declspecs): Add missing semicolon. - (do_xref_defn): Resurrect. - (named_class_head_sans_basetype): Move template specialization - definition cases to named_class_head_sans_basetype_defn. - - * decl2.c (grokfield): Call pushdecl_class_level after setting the - TYPE_NAME, not before. - -Sun Feb 5 02:50:45 1995 Jason Merrill - - * call.c (convert_harshness): Don't call sorry here. Don't allow - conversions between function pointer types if pedantic. - - * pt.c (overload_template_name): Pass globalize=1 to xref_tag. - - * lex.c (cons_up_default_function): Use the full name for the return - type of op=. - - * decl.c (set_nested_typename): Don't worry about anonymous types, - as they already have a unique name. - (pushdecl): Remove redundant set_nested_typename - (xref_tag): Split out base handling into xref_basetypes. - - * cp-tree.h (TYPE_INCOMPLETE): New macro; TEMPLATE_TYPE_PARMs are - not considered incomplete even though their definition is unknown. - - * decl.c (xref_defn_tag): Lose. - (xref_tag): xref_next_defn = ! globalize. - (pushdecl): Don't set DECL_NESTED_TYPENAME on artificial decls. The - ones that should have it set will have it set by pushtag. - (pushdecl_class_level): Likewise. - (pushtag): Tidy up a bit. - (set_nested_typename): Push a decl for the nested typename from - here, rather than from xref_defn_tag. - - * parse.y (do_xref): Lose. - (named_class_head): If we see 'class foo:' we know it's a - definition, so don't worry about base lists for non-definitions. - - * pt.c (push_template_decls): Template parm decls are artificial. - - * decl.c (duplicate_decls): Restore check for qualifier - disagreement for non-functions. - (decls_match): Remove check for qualifier disagreement. - -Fri Feb 3 14:58:58 1995 Jason Merrill - - * decl.c (grok_reference_init): Convert initializer from - reference. - * typeck.c (convert_for_initialization): Likewise. - - * decl.c (duplicate_decls): Propagate DECL_NESTED_TYPENAME. - - * cvt.c (cp_convert): Don't convert to the same class type by just - tacking on a NOP_EXPR. - (convert_to_reference): Use comp_target_types instead of comptypes - so that we don't allow conversions two levels down. - -Thu Feb 2 15:07:58 1995 Jason Merrill - - * class.c (build_vbase_path): Bash types to make the backend happy. - * cvt.c (build_up_reference): Bash the types bashed by - build_vbase_path to be reference types instead of pointer types. - (convert_to_reference): Likewise. - - * typeck.c (build_c_cast): Don't strip NOPs if we're converting to a - reference type. - - * parse.y (structsp): Put back error for 'struct B: public A;'. - -Wed Feb 1 23:02:06 1995 Mike Stump - - * except.c: Add support for mips systems that don't define __mips - but do define mips, like Ultrix. - -Wed Feb 1 22:39:07 1995 Mike Stump - - * except.c: Add support for exception handling on the Alpha. - -Wed Feb 1 10:12:14 1995 Mike Stump - - * decl2.c (finish_file): Fix bug in Jan 31st change. - -Tue Jan 31 16:59:15 1995 Gerald Baumgartner - - * sig.c (build_signature_pointer_or_reference_type): Don't set - IS_AGGR_TYPE for signature pointers/reference so expand_default_init - doesn't expect to find a copy constructor. - * call.c (build_method_call): Treat signature pointers/reference - as if IS_AGGR_TYPE were set. - -Tue Jan 31 13:28:56 1995 Mike Stump - - * gc.c (get_typeid): Pawn off error messages to build_t_desc. - (build_t_desc): Inform the user here if they try and build - with -frtti and don't include . - - * decl2.c (finish_prevtable_vardecl): Support rescanning. - (finish_file): Move finish_prevtable_vardecl up to before the global - initializers are done as tdecls are initialized in the global - initializer. Also Pick up any new tdecls or vtables needed by - synthesized methods. - - * class.c (finish_struct): Simplify. We have to do rtti scanning at - end, so we might as well do all of it there. - -Tue Jan 31 05:35:02 1995 Jason Merrill - - * call.c (build_method_call): Fix -fthis-is-variable for 32-bit - targets, too. - -Tue Jan 31 00:11:04 1995 Mike Stump - - * decl2.c (finish_prevtable_vardecl): New routine, mostly split from - finish_vtable_vardecl. It has the first half functionality from - that routine. - * decl2.c (finish_vtable_vardecl): Update to not include stuff not - in finish_prevtable_vardecl. - * decl2.c (finish_file): Call finish_prevtable_vardecl. - * gc.c (build_generic_desc): Allow it to be called when not at the - global binding layer, but behave as if we were. - (build_t_desc): Rearrange a bit so that it really works and is - easier to follow. - * class.c (finish_struct): Don't decide on tdecls here, as we have - to wait until the end of the file in general to decide whether or - not they come out. - -Mon Jan 30 01:00:40 1995 Jason Merrill - - * init.c (build_delete): Check access to operator delete before - calling the destructor. - * method.c (build_opfncall, DELETE_EXPR): build_method is allowed to - return error_mark_node. - * call.c (build_method_call): Use the one-argument op delete even if - it's an error. - - * init.c (build_new): Fix -fthis-is-variable support. - * call.c (build_method_call): Likewise. - - * call.c (convert_harshness): Make conversion from a pointer to bool - worse than conversion to another pointer. - -Sat Jan 28 16:46:10 1995 Jason Merrill - - * init.c (build_new): Check new return value if -fcheck-new. - - * lex.c (check_newline): Clear end_of_file when we're done, too. - -Sat Jan 28 10:38:39 1995 Mike Stump - - * decl2.c (finish_vtable_vardecl): Make rtti TD tables follow - vtables whereever they go. - - * gc.c (build_t_desc): Remove old way of setting it up, as it wasn't - right. - -Sat Jan 28 09:10:44 1995 Mike Stump - - * decl2.c (finish_vtable_vardecl): Now set the - interface/implementation of vtables on the first virtual function, - if one exists, otherwise we use the old method. This is a major win - in terms of cutting down the size of objects and executables in - terms of text space and data space. Now most of the savings that - #pragma interface/implementation gives is automatic in a fair number - of cases. - -Sat Jan 28 04:57:33 1995 Jason Merrill - - * decl.c (grokdeclarator): Discard the template parameters in a - template constructor declaration so that the function is always - named constructor_name (ctype). - - * lex.c (check_newline): Use ungetc to put back the character before - calling HANDLE_PRAGMA. - -Fri Jan 27 17:23:47 1995 Mike Stump - - * decl2.c (check_classfn): If the cname is T and fn_name is T, - make sure we still match them. - -Fri Jan 27 16:32:10 1995 Jason Merrill - - * parse.y: Add END_OF_LINE token. - - * lex.c (check_newline): Set linemode when we see a # directive, and - unset it when we're done. Turn all 'return's into 'goto skipline'. - Fix all uses of '\n', since we won't see it anymore. Put back the - character we read before checking for a sysv or target pragma. - (real_yylex): If we see an EOF in linemode, return END_OF_LINE. - (handle_sysv_pragma): Don't look at the input stream; quit when we - see an END_OF_LINE token. - - * input.c (getch): Return EOF if we're in line mode and at the end - of a line. - (put_back): Don't put back an EOF. - -Thu Jan 26 19:26:34 1995 Mike Stump - - * except.c (expand_throw): Do the newing of the exception object - before we load the type descriptor or the address so that we don't - wipe any of the values out. - -Thu Jan 26 19:20:00 1995 Mike Stump - - * except.c (init_exception_processing): Don't use r12 on the rs6000. - -Tue Jan 24 16:36:31 1995 Jason Merrill - - * decl.c (grokparms): Don't try to build up a reference at this point. - - * typeck2.c (build_functional_cast): Don't assume that a NOP_EXPR - will suffice to convert from integer_zero_node. - -Wed Jan 25 15:02:09 1995 David S. Miller - - * class.c (instantiate_type): Change error message text. - * typeck2.c (store_init_value): Likewise. - -Mon Jan 23 21:57:14 1995 Mike Stump - - * pt.c (tsubst): When we copy a node, don't forget to copy - TREE_CHAIN, we use it later. - -Mon Jan 23 03:33:47 1995 Jason Merrill - - * typeck.c (convert_for_assignment): Initialize variable before use. - -Fri Jan 20 01:17:59 1995 Jason Merrill - - * g++.c (main): Link with both libstdc++ and libg++ if called as - something ending with "g++", otherwise only libstdc++. Move -lm to - the end of the line. - -Thu Jan 19 15:43:11 1995 Jason Merrill - - * call.c (build_method_call): Don't mess with 'this' before calling - compute_conversion_costs. - -Wed Jan 18 15:40:55 1995 Jason Merrill - - * search.c (get_matching_virtual): Give line number for previous - declaration. - - * call.c (convert_harshness): Handle conversions to references - better. - - * cvt.c (build_up_reference): OK, handle {MIN,MAX}_EXPR *properly*. - -Wed Jan 18 15:21:38 1995 Mike Stump - - * class.c (instantiate_type): Use DECL_CHAIN to walk lists instead, - as the TREE_CHAIN for methods will take us to the next differently - named function, DECL_CHAIN won't. - -Wed Jan 18 14:26:59 1995 Jason Merrill - - * tree.c (lvalue_p): Handle {MIN,MAX}_EXPR. - - * decl2.c (lang_decode_option): -Wall implies -Wparentheses. - warn_parentheses defaults to 0. - - * decl.c (grokparms): Put back call to require_instantiated_type. - -Tue Jan 17 19:56:15 1995 Mike Stump - - * except.c (exception_section): Use the data section on the rs6000. - Change calling convention for named_section. - -Wed Jan 17 18:20:57 1994 Fergus Henderson - - * cp-tree.h: Make if (x=0) warn with wall - * parse.y: Make if (x=0) warn with wall - -Tue Jan 17 14:12:00 1995 Jason Merrill - - * decl.c (BOOL_TYPE_SIZE): BITS_PER_WORD if SLOW_BYTE_ACCESS, - BITS_PER_UNIT otherwise. - - * search.c (get_matching_virtual): Don't check the binfo if the - types are the same. - - * cvt.c (cp_convert): Just call truthvalue_conversion to convert to - bool. - -Mon Jan 16 13:28:48 1995 Jason Merrill - - * various: Use boolean_type_node, boolean_true_node, - boolean_false_node. - - * search.c (get_matching_virtual): Allow covariant returns that - don't require pointer adjustment. - - * typeck.c (build_conditional_expr): Don't call default_conversion - on ifexp. - - * cvt.c (build_up_reference): Handle MIN_EXPR and MAX_EXPR. - - * decl.c (grokdeclarator): Upgrade warning about &const to pedwarn. - -Sun Jan 15 22:17:32 1995 David Binderman - - * pt.c (do_function_instantiation): Free targs once we're done. - -Sun Jan 15 22:17:32 1995 Jason Merrill - - * decl.c (BOOL_TYPE_SIZE): Defaults to BITS_PER_WORD. - (init_decl_processing): Use BOOL_TYPE_SIZE instead of CHAR_TYPE_SIZE - for bool. - -Sat Jan 14 05:33:55 1995 Jason Merrill - - * decl2.c (finish_file): We need to mess up if there are any - variables in the list, not just if there is one with a constructor. - -Fri Jan 13 14:42:55 1995 Jason Merrill - - * decl.c (duplicate_decls): Propagate DECL_STATIC_{CON,DE}STRUCTOR. - (finish_function): Handle DECL_STATIC_{CON,DE}STRUCTOR. - (finish_function): Trust rest_of_compilation. - - * decl2.c (finish_file): Also call functions designated as static - constructors/destructors. - - * decl.c (grokdeclarator): Allow access decls of operator functions. - (grokparms): Only do convert_for_initialization if the initializer - has a type. - (duplicate_decls): Put back push_obstacks_nochange call. - - * lex.c (real_yylex): Downgrade complaint about the escape sequence - being too large from pedwarn to warning. - - * decl.c (grokdeclarator): Don't complain about long long in system - headers. - - * lex.c (real_yylex): Handle digraphs. - -Thu Jan 12 12:17:24 1995 Jason Merrill - - * decl.c (init_decl_processing): -f{no-,}strict-prototype only - affects C linkage declarations now. - - * typeck.c (comp_target_types): Grok simple contravariant conversions. - (common_type): t1 and t2 are interchangeable. - - * various: Test return value of comp_target_types differently in - different places; it now returns -1 for a contravariant conversion - (which is fine in symmetric cases). - - (common_type): Prefer long double to double even when - they have the same precision. - - * decl.c (grokparms): Call convert_for_initialization to check - default arguments. - - * init.c (build_new): void_type_node has a size (of 0). - - * decl.c (decls_match): Also check for agreement of TREE_READONLY - and TREE_THIS_VOLATILE. - (push_class_level_binding): Properly handle shadowing of - nested tags by fields. - - * search.c (dfs_pushdecls): Likewise. - - * decl2.c (finish_file): Don't second-guess self-initialization. - - * cvt.c (convert_to_reference): Work with expr directly, rather than - a copy. - - * decl.c (push_overloaded_decl): Only shadow artificial TYPE_DECLs. - - * init.c (add_friend): Downgrade duplicate friend message from - pedwarn to warning. - - * decl.c (duplicate_decls): Push obstacks before calling common_type. - -Thu Jan 12 17:15:21 1995 Michael Ben-Gershon - - * except.c (push_eh_entry): Set LABEL_PRESERVE_P flag for - exception table labels. - (expand_start_all_catch): Likewise. - (expand_leftover_cleanups): Likewise. - (expand_end_catch_block): Likewise. - * except.c (make_first_label): New function. - (expand_start_all_catch): Add a call to make_first_label() before - using a label as a jump destination. - (expand_end_all_catch): Likewise. - (expand_leftover_cleanups): Likewise. - (expand_end_catch_block): Likewise. - (expand_builtin_throw): Likewise. - (expand_throw): Likewise. - * except.c: Add ARM processor support for exception handling. - -Thu Jan 12 12:17:24 1995 Jason Merrill - - (complete_array_type): Copy code from C frontend. - - * lex.c (real_yylex): Don't multiply the length of a wide string - literal by WCHAR_BYTES. - - * decl.c (pushdecl): Check for redeclaration of wchar_t here. - (duplicate_decls): Instead of here. - (define_label): Complain about a label named wchar_t. - (grokdeclarator): Complain about declarations of - operator-function-ids as non-functions. - - * typeck.c (unary_complex_lvalue): Also wrap prefix -- and ++ in - COMPOUND_EXPRs. - (build_unary_op): Wrap unary plus in a NON_LVALUE_EXPR. - - * lex.c (real_yylex): Don't skip whitespace when reading the next - character after ->. - -Wed Jan 11 16:32:49 1995 Mike Stump - - * except.c: Allow cc1plus to be built with native compiler on rs6000. - (expand_start_all_catch): Add assemble_external calls for various - routines we call. - (expand_leftover_cleanups): Likewise. - (expand_start_catch_block): Likewise. - (do_unwind): Likewise. - (expand_builtin_throw): Likewise. - -Wed Jan 11 01:05:42 1995 Jason Merrill - - * decl.c (pushtag): Only look for a previous decl in the current - binding level. Use explicit global scope in DECL_NESTED_TYPENAME. - - * gxx.gperf: Add __signature__ and __sigof__ keywords. - - * decl2.c (lang_decode_option): -ansi does not set flag_no_asm. It - does set flag_no_gnu_keywords and flag_operator_names. - - * lex.c (init_lex): 'overload' is not a keyword unless -traditional. - Unset extension keywords if -fno-gnu-keywords. - Allow operator names ('bitand') if -foperator-names. - Never unset 'asm'; -fno-asm only affects 'typeof'. - - * decl.c (lookup_name_real): The got_object special lookup only - applies to types. - -Tue Jan 10 18:07:51 1995 Jason Merrill - - * spew.c (yylex): Also use DECL_NESTED_TYPENAME if got_object is set. - - * parse.y (primary): Unset got_object after all rules that use the - 'object' nonterminal. - (object): Set got_object. - - * lex.h: Declare got_object. - - * decl.c (lookup_name_real): Also lookup names in the context of an - object specified. - -Tue Jan 10 14:30:30 1995 Mike Stump - - * typeck.c (get_member_function_from_ptrfunc): Use ptrdiff_type_node - for things that have to be added to pointers, not size_type. Cures - problems with pointer to members on Alphas. - (build_binary_op_nodefault): Likewise. - (get_delta_difference_: Likewise. - (build_ptrmemfunc): Likewise. - -Tue Jan 10 01:49:25 1995 Jason Merrill - - * decl.c (pushtag): Stick the new decl in TYPE_NAME before pushing - it. - - * typeck.c (build_component_ref): Don't build up a COMPONENT_REF - when dealing with overloaded member functions; just act like - build_offset_ref. - (commonparms): Remove misleading comment. - - * decl.c (duplicate_decls): Complain about repeated default - arguments here. - (redeclaration_error_message): Instead of here. - (pushdecl): Complain about missing default arguments here. - (grokparms): Instead of here. - (lookup_name_current_level): Also match on DECL_ASSEMBLER_NAME. - (grok_reference_init): Do not complain about missing initializer if - declared 'extern'. - - * search.c (lookup_field): Don't return a TYPE_DECL if there is a - function alternative and want_type is not set. - -Mon Jan 9 18:16:23 1995 Jason Merrill - - * decl.c (pushtag): Don't set TYPE_NAME to an identifier. Do push - the decl when the type has no TYPE_NAME. - (lookup_nested_type): Don't assume that type has TYPE_NAME set. - (lookup_name_real): Call lookup_field with want_type = - prefer_type. - - * search.c (lookup_field): Handle want_type properly in the presence - of fields with the same name. - - * decl.c (set_nested_typename): Set nested name for file-scope types - to include leading ::. - (pushdecl): Set the nested typename if the decl doesn't have one, - rather than if the type's canonical decl doesn't have one. - -Mon Jan 9 03:44:33 1995 Jason Merrill - - * typeck.c (convert_for_assignment): Complain about contravariance - violation here. - (comp_target_types): Instead of here. - (build_unary_op): resolve_offset_ref before checking for a valid - type. - - * spew.c (yylex): Decrement looking_for_typename after we see a - _DEFN. - - * decl.c (pushdecl): Don't install an artificial TYPE_DECL in - IDENTIFIER_LOCAL_VALUE if we already have a decl with that name. - - * typeck.c (convert_for_assignment): Converting pointers to bool - does not need a cast. - -Sun Jan 8 18:16:45 1995 Jason Merrill - - * class.c (instantiate_type): Initialize nsubsts parm. - - * pt.c (do_function_instantiation): Likewise. - -Sat Jan 7 14:37:05 1995 Jason Merrill - - * pt.c (tsubst): Use TREE_STATIC instead of DECL_INLINE && - DECL_SAVED_INSNS to determine whether or not we've seen a definition - of this function. - (instantiate_template): Likewise. - - * call.c (convert_harshness): Allow const reference binding when - called from the overloading code, but not when called from - can_convert (since it isn't a conversion). - (convert_harshness): Put back some disabled code. - -Fri Jan 6 14:10:57 1995 Jason Merrill - - * call.c (convert_harshness): There is no implicit conversion from - void* to other pointer types (unless the parameter is (void*)0). - (convert_harshness): Non-lvalues do not convert to reference types. - - * class.c (finish_struct_methods): Still set - TYPE_HAS_{INT,REAL}_CONVERSION. - - * call.c (can_convert): Don't use aggregate initialization. - - * cp-tree.h: Declare lookup_conversions. - -Thu Jan 5 21:08:00 1995 Mike Stump - - * parse.y (simple_stmt): Fix duplicate case value error messages to - be more readable. - -Wed Jan 4 16:44:19 1995 Jason Merrill - - * cvt.c (build_type_conversion): Total rewrite to use - convert_harshness instead of reproducing conversion logic here. Now - much shorter. - - * call.c (convert_harshness): Support conversions to bool. - (can_convert): Checks whether a conversion is less harsh - than USER_CODE, for build_type_conversion. - - * search.c (add_conversions): Function for passing to dfs_walk which - adds all the type conversion operators in the current type to a list. - (lookup_conversions): Calls dfs_walk with add_conversions and return - the list. - (dfs_walk): Don't require a qfn. - - * cp-tree.h: Lose CLASSTYPE_CONVERSIONS hackery. - (CLASSTYPE_FIRST_CONVERSION): Points to elt 1 of CLASSTYPE_METHOD_VEC. - - * class.c (finish_struct_bits): Lose CLASSTYPE_CONVERSIONS hackery. - (grow_method): A separate function for building onto the growing - method vector. - (finish_struct_methods): Use it. Put all type conversion operators - right after the constructors. Perhaps we should sort the methods - alphabetically? - -Mon Jan 2 14:42:58 1995 Jason Merrill - - * call.c (build_method_call): Lose another misleading shortcut. - -Fri Dec 30 17:57:30 1994 Mike Stump - - * gc.c (build_bltn_desc): Handle bool as a built-in type. - -Fri Dec 30 14:20:21 1994 Mike Stump - - * tree.c (layout_vbasetypes): Ensure that we don't loose alignment - on the complete type because of small virtual bases. - -Fri Dec 30 12:22:29 1994 Mike Stump - - * decl.c (n_incomplete): Bump n_incomplete up to int to match C - front end. - (pushdecl): Also count decls pushed that are of a type being defined - as incomplete things. - * class.c (finish_struct): Move hack_incomplete_structures up to - just after we set it as not being defined, so that the decls we - build for RTTI don't count as incomplete. - -Thu Dec 29 18:20:57 1994 Mike Stump - - * pt.c (tsubst): Fix problem with defining constructors in templated - classes with virtual bases. - -Wed Dec 28 08:31:00 1994 Mike Stump - - * parse.y (TYPEID): Strip top-level cv-qualifiers on typeid - expressions. - * gc.c (build_typeid): Likewise. - -Thu Dec 22 17:26:33 1994 Mike Stump - - * cvt.c (build_up_reference): Fix breakage introduced on Nov 29, - don't assert on complex AGGR inits. - -Thu Dec 22 14:32:31 1994 Mike Stump - - * method.c (build_overload_value): Handle pointer to members as - template arguments. - -Thu Dec 22 13:09:07 1994 Mike Stump - - * typeck.c (unary_complex_lvalue): Don't call sorry if we know how - to do take the address of a data member for a pointer to data - member. - -Thu Dec 22 10:04:19 1994 Mike Stump - - * decl.c (grokdeclarator): Use the typedef name for linkage if the - type doesn't otherwise have a name. - - * decl2.c (grokfield): Likewise. - - * class.c (finish_struct): Since we reuse the TYPE_DECL for the - DECL_NAME of enums, structs and classes, we have to avoid trying to - put it in the TYPE_FIELDS again. - -Wed Dec 21 11:07:05 1994 Mike Stump - - * decl2.c (check_classfn): Ignore this parameter on static functions - when checking to see if we match. - -Tue Dec 20 17:47:02 1994 Mike Stump - - * typeck.c (unary_complex_lvalue): Handle address of non-left most - pointers to members by calling get_delta_difference. - -Mon Dec 19 22:40:53 1994 Mike Stump - - * decl2.c (check_classfn): Don't use decls_match yet, as it modifies - static functions to early. - -Thu Dec 19 22:37:48 1994 Mike Stump - - * method.c (make_thunk): Handle encoding of positive thunk offsets. - -Sat Dec 17 13:29:50 1994 Doug Evans - - * Make-lang.in (.PHONY): Tell GNU make C++ and c++ are phony targets. - -Thu Dec 15 16:32:12 1994 Mike Stump - - * decl2.c (check_classfn): Use decls_match to check if this has - already been declared, as the DECL_ASSEMBLER_NAME may have been - changed via asm("new_name"). - * decl.c (decls_match): Make public. - -Thu Dec 15 15:17:55 1994 Mike Stump - - * *.[chy] (expand_aggr_init): Add fourth argument to handle - distinction between = init and (init) style of initializations. - * *.[chy] (finish_decl): Add fifth argument to handle - distinction between = init and (init) style of initializations. - -Tue Dec 13 19:16:05 1994 Mike Stump - - Fix some random `explicit' bugs. - - * cvt.c (convert_to_reference): Add third parameter to - convert_force. - (convert_force): Likewise. - * call.c (build_method_call): Likewise. - * decl2.c (setup_vtbl_ptr): Likewise. - * init.c (expand_virtual_init): Likewise. - (build_member_call): Likewise. - (build_delete): Likewise. - (build_vbase_delete): Likewise. - * typeck.c (build_component_addr): Likewise. - (build_c_cast): Likewise. - (build_modify_expr): Likewise. - * cp-tree.h (CONV_NONCONVERTING): Likewise. Add so that we can - distinguish the context in which the conversion appears. Add thrid - argument to build_c_cast. - * cvt.c (cp_convert): Pass whether or not we want to consider - non-converting constructors down to build_method_call. - * decl2.c (reparse_absdcl_as_casts): Add third argument to - build_c_cast. - * gc.c (build_m_desc): Likewise. - * init.c (build_new): Likewise. - * parse.y (expr_no_commas): Likewise. - (primary): Likewise. - * typeck.c (build_x_function_call): Likewise. - (build_static_cast): Likewise. - (build_reinterpret_cast): Likewise. - (build_const_cast): Likewise. - (build_c_cast): Likewise. - (build_ptrmemfunc): Likewise. - * typeck2.c (build_functional_cast): Likewise. - * init.c (expand_aggr_init): Added LOOKUP_ONLYCONVERTING to - expand_aggr_init_1 as inits are converted to the destination type. - -Tue Dec 13 16:18:57 1994 Jason Merrill - - * Make-lang.in (cc1plus): Depends on c-pragma.o. - - * Makefile.in (OBJ{DEP,}S): Add ../c-pragma.o. - - * lex.c (check_newline): If the #pragma is not recognized by g++, - try machine-specific ones too. - (handle_sysv_pragma): Copied from c-lex.c. - -Mon Dec 12 23:53:06 1994 Mike Stump - - * except.c (expand_throw): Fix Dec 6th change, build_new likes a - reference better. - -Mon Dec 12 18:01:00 1994 Jason Merrill - - * typeck.c (build_binary_op): Lose checks on TYPE_PTRMEMFUNC_P with - IS_AGGR_TYPE, since now they will not both be set on the same type. - - * pt.c (do_pending_expansions): Don't clear TREE_PUBLIC on - instantiations controlled by -fexternal-templates. - - * decl.c (duplicate_decls): Don't complain about different values of - __attribute__ ((const)) and ((noreturn)). - -Fri Dec 9 18:17:37 1994 Doug Evans - - * Makefile.in (BISONFLAGS): Delete --yacc. - (PARSE_H): Depend on $(PARSE_C), for parallel makes. - (PARSE_C): Undo last patch. - -Fri Dec 2 10:44:36 1994 Mike Stump - - * Makefile.in (BISONFLAGS): Add --yacc so that output winds up in - y.tab.c. - -Thu Dec 8 17:39:46 1994 Jason Merrill - - * decl.c (finish_decl): Don't call obscure_complex_init for decls - of indeterminate size. - -Wed Dec 7 16:49:22 1994 Jason Merrill - - * decl.c (obscure_complex_init): Function to tweak the decl to - prevent expand_decl from tring to initialize it. - (finish_decl): Use it rather than writing the same code in three - different places. - - * parse.y (bad_parm): Stop trying to support parms without types. - -Wed Dec 7 12:06:56 1994 Mike Stump - - * decl2.c (grokfield): Make asm specs on static member functions - work. - -Tue Dec 6 15:43:20 1994 Mike Stump - - * except.c (expand_throw): Make a copy of the thrown object. - -Tue Dec 6 14:16:34 1994 Jason Merrill - - * parse.y: : Has lower precedence than =. - -Tue Dec 6 12:46:17 1994 Mike Stump - - * decl.c (pushdecl): Use DECL_NAME of VAR_DECLs to avoid namespace - manglings. - (grokvardecl): Add namespace into variable name. - -Tue Dec 6 11:26:55 1994 Mike Stump - - * decl2.c (current_namespace_id): New routine to transform a simple - name into a name in a namespace. - * decl.c (grokdeclarator): Use it. - * decl2.c (get_namespace_id): Find the name of the current - namespace. - (push_namespace, pop_namespace): Complete out missing - functionality. - -Mon Dec 5 17:11:51 1994 Jason Merrill - - * class.c (finish_struct): Don't use LONG_LONG_TYPE_SIZE, as it may - not be defined. Fix warning message for enums and restore warning - for non-enums. - - * decl2.c (push_namespace): Dummy function. - (pop_namespace): Likewise. - (do_namespace_alias): Likewise. - (do_using_decl): Likewise. - (do_using_directive): Likewise. - - * parse.y: New token NSNAME for namespace names. - (extdef): Add namespace, using definitions. - (using_decl): New rule for using declarations. - (any_id): New rule for identifiers with any degree of scoping. - (identifier): Add NSNAME. - (notype_identifier): Likewise. - (component_decl): Add using_decl. - (nested_name_specifier): Add NSNAME SCOPE. - - * typeck.c (convert_for_assignment): Handle conversions between - enums and bool. - - * decl.c (duplicate_decls): Only propagate DECL_MAIN_VARIANT on - FUNCTION_DECLs. - -Mon Dec 5 13:03:16 1994 Mike Stump - - * class.c (finish_struct): Give an error if one tries to declare a - bit-field's size greater than a long long, as the backend will dump. - It is not an error to declare an enum bit-field greater than its - precision. Warn if an enum bit-field is too small to hold all - its values. - -Mon Dec 5 11:41:50 1994 Mike Stump - - * typeck.c (convert_for_assignment): Use cp_convert instead of - convert so that we don't get static casts. - -Sun Dec 4 11:59:01 1994 Mike Stump - - * cvt.c (cp_convert): Don't complain about int->enum conversion if - we are doing static casts. - -Fri Dec 2 18:32:41 1994 Mike Stump - - * error.c (dump_expr): Do something more intelligent with SAVE_EXPRs - when dumping expressions in error messages. - -Fri Dec 2 17:04:27 1994 Mike Stump - - * gc.c (build_dynamic_cast): Change interface to libg++, ensure that - the return type is the right type, and make references work. - -Fri Dec 2 16:36:43 1994 Jason Merrill - - * decl.c (poplevel): Don't be confused by function-scope - declarations of non-nested functions. - (duplicate_decls): Propagate DECL_MAIN_VARIANT. - (pushdecl): Use duplicate_decls to copy info from old decl into new - function-scope one rather than doing it here. - - * decl2.c (mark_inline_for_output): Deal with the DECL_MAIN_VARIANT - of this decl, in case this is a function-scope declaration. - - * decl.c (finish_enum): Make sure that the type has the right - precision when we call fixup_*_type. - -Tue Nov 29 19:12:07 1994 Jason Merrill - - * cvt.c (build_up_reference): Strip superfluous NOP_EXPRs; we do - want to build up references to rvalues if possible. - (cp_convert): Stick on a NOP_EXPR when converting to the same type. - -Tue Nov 29 11:28:59 1994 Mike Stump - - * parse.y (maybe_raises): Handle throw (). - * parse.y (ansi_raise_identifier): Grok type-ids in exception - specifications. - * tree.c (build_exception_variant): Use list compare to check if - two exception specifications match. - * decl.c (duplicate_decls, bad_specifiers): Enhance wording on error - messages. - * call.c (build_method_call): Remove TREE_RAISES. - * cvt.c (convert_to_aggr): Likewise. - * typeck.c (build_function_call_real, convert_arguments): Likewise. - * init.c (expand_aggr_init_1): Likewise. - -Tue Nov 29 09:50:39 1994 Mike Stump - - * except.c: Add support for m68k and mips exception handling - support. - -Tue Nov 29 08:48:33 1994 Mike Stump - - * except.c (expand_end_all_catch): Throw into outer context, if we - fall off end of catch handlers. - -Mon Nov 28 16:44:41 1994 Mike Stump - - * Makefile.in: Make is easier to decide where parse.[ch] will be - built. - -Thu Nov 17 20:11:24 1994 Doug Evans - - * cp/Make-lang.in (CXX_INSTALL_NAME): Use program_transform_name. - (GXX_INSTALL_NAME): Likewise. - (CXX_CROSS_NAME): Use program_transform_cross_name. - (GXX_CROSS_NAME): Likewise. - (c++.install-man): Use program_transform_name on g++.1. - (c++.uninstall): Likewise. - -Mon Nov 28 13:53:03 1994 Mike Stump - - * parse.y (THROW): Fix precedence of throw expressions. - -Mon Nov 28 13:15:16 1994 Mike Stump - - * typeck.c (build_unary_op): Allow promotions from bool to int on - unary ~. - -Sun Nov 27 00:16:21 1994 Jason Merrill - - * method.c (build_overload_name): Use DECL_ASSEMBLER_NAME for - classes when appropriate. - (build_overload_nested_name): When dealing with a function context, - use ASM_FORMAT_PRIVATE_NAME to tweak the name of the function to - avoid conflicts between local classes of the same name. - -Wed Nov 23 17:59:42 1994 Mike Stump - - * gxx.gperf, parse.y, lex.h, hash.h, lex.c (init_lex), delc.c - (duplicate_decls, grokdeclarator), cp-tree.h: Add support for - `explicit'. - * cvt.c (convert_to_reference, cp_convert, build_type_conversion_1, - build_type_conversion): Use LOOKUP_ONLYCONVERTING in - build_method_calls so that non-converting constructors are not used. - * call.c (build_method_call): If we shouldn't use a non-converting - constructor, then don't. - -Wed Nov 23 14:46:56 1994 Jason Merrill - - * call.c (build_method_call): Don't try to synthesize methods yet. - -Tue Nov 22 12:45:21 1994 Jason Merrill - - * pt.c (push_template_decls): Create CONST_DECLs for template - constant parameters, not VAR_DECLs. - -Sat Nov 19 15:28:31 1994 Jim Wilson - - * typeck.c (build_binary_op_nodefault): Can shorten shift only if - shift count is less than size in bits of arg0. - -Thu Nov 17 15:30:50 1994 Mike Stump - - * gxx.gperf, hash.h, lex.c (init_lex, real_yylex), parse.y: Add new - ANSI keywords and, and_eq, bitand, bitor, explicit, namespace, not, - not_eq, or, or_eq, typename, using, xor, xor_eq to g++. Still need - to add support for explicit, namespace, typename, and using, support - for the rest is already in. - -Fri Nov 4 19:04:18 1994 Mike Stump - - * gc.c (get_bad_cast_node): New routine to support compile time - throws of bad_cast. - * gc.c (build_dynamic_cast): Support throwing of bad_cast at compile - time. - -Fri Nov 4 11:12:00 1994 Mike Stump - - * except.c: Add hppa support. - -Fri Nov 4 10:50:50 1994 Mike Stump - - * except.c: Add rs6000 support. - -Thu Nov 3 14:24:23 1994 Mike Stump - - * except.c (do_unwind): Add i[34]86 support. - -Thu Nov 3 00:10:46 1994 Jason Merrill - - * pt.c (do_pending_expansions): Unset TREE_PUBLIC on implicit - instantiations. - -Wed Nov 2 15:08:24 1994 Kung Hsu - - * decl.c (finish_function): Emit types used in method parameters - into symbol table. - -Wed Nov 2 15:05:47 1994 Jason Merrill - - * pt.c (process_template_parm): Allow pointer to member function - template parameter types. - (uses_template_parms): Handle pointer to member function - CONSTRUCTORs. - - * g++.c (main): Cast first argument of bzero to (char *). - Pass -lstdc++ instead of -lg++ unless we are invoked as 'g++'. - -Mon Oct 31 14:50:48 1994 Kung Hsu - - * gc.c (build_dynamic_cast): Rewrite to make it work. - * class.c (finish_vtbls): Build more vtables if flag_rtti is on. - * class.c (modify_all_direct_vtables): Likewise. - * init.c (expand_direct_vtbls_init): Expand more vtables if - flag_rtti is on. - * decl.c (init_type_desc): Add default return. - -Tue Oct 25 17:13:09 1994 Kung Hsu - - * tree.c (debug_binfo): Get rid of the initial size entry of - vtable. - * cp-tree.h: Change flag_dossier to flag rtti, define type - descriptor type nodes. - * decl.c (init_type_desc): New function to initialize type - descriptor type nodes. - * decl.c (record_builtin_type): Change flag_dossier to flag_rtti. - * lex.c (init_lex): Likewise. - * decl.c: Change variable flag_dossier to flag_rtti. - * decl.c (duplicate_decls): Get rid initial size entry of vtable. - * decl.c (hack_incomplete_structures): Take out assert 164. - * search.c (get_abstract_virtuals_1): Likewise. - * search.c (dfs_init_vbase_pointers): Change CLASSTYPE_DOSSIER to - CLASSTYPE_RTTI. - * parse.y: Likewise. - * class.c (prepare_fresh_vtable): For virtual bases, get right - offset. - * class.c (add_virtual_function): Change flag_dossier to - flag_rtti. - * class.c (modify_one_vtable): Modify the right rtti entry. - * class.c (override_one_vtable): Get rid of size entry. - * class.c (finish_struct): Change flag_dossier to flag_rtti, and - build extra vtables, build type descriptors for polymorphic - classes. - * gc.c (build_headof): Make headof() works correctly with new - rtti. - * gc.c (build_typeid): Make this function work with new rtti. - * gc.c (get_typeid): Make this function work with new rtti. - * gc.c (build_bltn_desc): New function for new rtti. - * gc.c (build_user_desc): Likewise. - * gc.c (build_class_desc): Ditto. - * gc.c (build_ptr_desc): Ditto. - * gc.c (build_attr_desc): Ditto. - * gc.c (build_func_desc): Ditto. - * gc.c (build_ptmf_desc): Ditto. - * gc.c (build_ptmd_desc): Ditto. - * gc.c (build_t_desc): Ditto. - * gc.c: Comment out old build_t_desc, build_i_desc, build_m_desc. - -Tue Oct 25 13:37:41 1994 Jason Merrill - - * call.c (convert_harshness): Check for TREE_UNSIGNED differences - after checking for integral conversions. - -Wed Nov 30 19:13:50 1994 Mike Stump - - * Version 2.6.3 released. - -Thu Nov 17 10:56:50 1994 Jason Merrill - - * typeck2.c (build_m_component_ref): Check the basetype of the - member pointer against the main variant of the object type. - -Mon Nov 14 14:21:52 1994 Jason Merrill - - * cvt.c (convert_to_reference): Make sure that the original expr - gets its type back when converting a reference. - - * method.c (build_overload_name): Clear numeric_outputed_need_bar here. - (build_decl_overload): Instead of here. - -Tue Nov 8 17:11:24 1994 Jason Merrill - - * cvt.c (cp_convert): Don't build a TARGET_EXPR if we're not in a - function. - - * typeck.c (convert_for_initialization): Handle initialization from - a TARGET_EXPR. - -Sun Nov 6 01:34:24 1994 Jason Merrill - - * pt.c (lookup_nested_type_by_name): Fix list-walking logic. - (tsubst): When replacing a TEMPLATE_TYPE_PARM, propagate - TYPE_READONLY and TYPE_VOLATILE from the argument. - (unify): When unifying with a TEMPLATE_TYPE_PARM, remove cv-quals - present in parm from arg. - (type_unification): Strip REFERENCE_TYPE from the argument type. - (unify): Don't strip REFERENCE_TYPE from the argument type. - -Sat Nov 5 22:42:15 1994 Greg McGary - - * pt.c (do_type_instantiation): Check to see if there's a - IDENTIFIER_TEMPLATE on a class before calling - instantiate_member_templates(). - -Sat Nov 12 06:35:42 1994 Mike Stump - - * Version 2.6.2 released. - -Thu Nov 3 18:48:19 1994 Paul Eggert - - * Makefile.in (spew.o, lex.o, pt.o): - Depend on $(srcdir)/parse.h, not parse.h. - -Tue Nov 1 19:19:41 1994 Mike Stump - - * Version 2.6.1 released. - -Sun Oct 23 13:19:55 1994 Jason Merrill - - * decl2.c: Declare flag_access_control. - (struct lang_f_options): Add access-control. - * expr.c (cplus_expand_expr, NEW_EXPR): Unset flag_access_control - for the call to expand_aggr_init to copy the object out of the - pcc_struct_return slot. - * search.c (compute_access): if (!flag_access_control) return - access_public. - -Fri Oct 21 00:32:54 1994 Jason Merrill - - * lex.c (cons_up_default_function): Don't try to defer method - synthesis now. - - * decl.c (init_decl_processing): Use __pure_virtual for abort_fndecl - instead of abort, since the OSF/1 dynamic linker doesn't like to see - relocation entries for abort. - - * tree.c (array_type_nelts_total): Use sizetype, not - integer_type_node. - (array_type_nelts_top): Likewise. - -Thu Oct 20 15:48:27 1994 Mike Stump - - * decl.c (grokdeclarator): Added handling for catch parameters - (CATCHPARM). - * except.c (expand_start_catch_block): Use the new CATCHPARM context - instead of NORMAL. - * except.c (expand_throw): Don't let convert_to_reference complain - about what we are doing. - -Thu Oct 20 12:55:24 1994 Jim Wilson - - * method.c (emit_thunk): Call instantiate_virtual_regs. - -Wed Oct 19 14:15:33 1994 Mike Stump - - * except.c (expand_exception_blocks): Make sure throw code doesn't - get put in function that won't be output. - -Mon Oct 17 18:03:15 1994 Jason Merrill - - * decl.c (init_decl_processing): Make alloca a builtin. - -Thu Oct 27 21:10:25 1994 Craig Burley - - * g++.c (main): Only decrement "added" and set "library" to - NULL when "library" != NULL (just like 940829 fix). - -Mon Oct 17 15:56:11 1994 Mike Stump - - * except.c (expand_start_catch_block): Make sure the false label - gets onto the permanent obstack, as it is used for the exception - table. - -Fri Oct 14 18:54:48 1994 Mike Stump - - * class.c (modify_one_vtable): Since the DECL_CONTEXT of fndecl can - be set just below, use current_fndecl instead. - -Fri Oct 14 15:12:22 1994 Jason Merrill - - * init.c (expand_aggr_vbase_init_1): Don't call expand_aggr_init_1 - with LOOKUP_SPECULATIVELY. - (expand_default_init): Abort if build_method_call returns NULL_TREE. - - * typeck.c (build_modify_expr): Don't just build a MODIFY_EXPR if - the rhs is a TARGET_EXPR. - - * parse.y (left_curly): Anonymous types are not affected by #pragma - interface/implementation. - - * method.c (synthesize_method): Don't call setup_vtbl_ptr for the - default constructor if it isn't needed. - - * lex.c (cons_up_default_function): Do synthesize methods for - anonymous types if necessary. - -Thu Oct 13 17:44:55 1994 Jason Merrill - - * method.c (build_decl_overload): Set numeric_outputed_need_bar to 0. - -Wed Oct 12 13:27:57 1994 Jason Merrill - - * typeck.c (build_modify_expr): Understand how to copy an aggregate. - - * init.c (expand_default_init): Likewise. Also remove some of the - crufty code that assumes methods will not be synthesized properly. - - * lex.c (cons_up_default_function): If the containing type has no - name, these functions should never need to be called, so just - declare them. - - * lex.c (real_yylex): Use HOST_BITS_PER_WIDE_INT to determine the - bitmask for lexing character constants. - - * call.c (build_method_call): Disable code that tries to do tricky - stuff with a default parameter that is a constructor call, but - actually does other tricky stuff that breaks things. - -Wed Oct 12 16:14:01 1994 Benoit Belley - - * decl.c (finish_enum): Disable code which forces enums to be signed, - since this conflicts with their use as bitfields. type_promotes_to - handles promotion of enums of underlying unsigned types to signed - integer types. - -Wed Oct 12 13:24:03 1994 Jason Merrill - - * cvt.c (type_promotes_to): Also promote enums to long if - appropriate. - - * typeck.c (default_conversion): Don't expect type_promotes_to to - return a main variant. - -Wed Oct 12 12:19:45 1994 Jason Merrill - - * call.c (build_scoped_method_call): Don't lose side effects in the - object expression when calling a non-existent destructor. - -Fri Sep 2 19:05:21 1994 Rohan Lenard - - * call.c (build_scoped_method_call): Remove erroneous error message - when destructor call is written as a scoped call. - -Tue Oct 11 23:48:31 1994 Jason Merrill - - * various: Cast pointer arguments to bzero and bcopy to char *. - -Tue Oct 11 19:34:32 1994 Mike Stump - - * class.c (get_derived_offset): Added a type parameter to limit how - far up the CLASSTYPE_VFIELD_PARENT chain we search. - * class.c (modify_one_vtable, fixup_vtable_deltas): When forming the - offset to put into the vtable for the this parameter, make sure we - don't offset from a parent of the DECL_CONTEXT of the function. - -Tue Oct 11 16:10:52 1994 Jason Merrill - - * pt.c (do_function_instantiation): Set DECL_EXTERNAL and - TREE_STATIC when setting DECL_INTERFACE_KNOWN. - (do_type_instantiation): Likewise. - - * lex.c (cons_up_default_function): Set DECL_INTERFACE_KNOWN, - DECL_EXTERNAL and TREE_STATIC as appropriate. - - * decl2.c (finish_file): Also synthesize methods that don't have - DECL_EXTERNAL set. Set interface_unknown before doing so. - - * decl.c (start_function): If DECL_INTERFACE_KNOWN is set on the - function decl, don't muck with TREE_PUBLIC and DECL_EXTERNAL. - -Mon Oct 10 00:56:53 1994 Jason Merrill - - * lex.c (cons_up_default_function): Mark methods in a template class - as template instances. Store the values of interface_unknown and - interface_only for do_pending_inlines. - (do_pending_inlines): Use them. - - * decl2.c (finish_file): If we haven't seen a definition of a - function declared static, make the decl non-PUBLIC so compile_file - can give an error. - -Sun Oct 9 02:42:29 1994 Jason Merrill - - * method.c (do_build_copy_constructor): Handle anonymous unions. - (do_build_assign_ref): Likewise. - (largest_union_member): Move from lex.c. - -Sat Oct 8 14:59:43 1994 Jason Merrill - - Re-implement g++'s vague linkage independent of TREE_PUBLIC. - * pt.c (instantiate_member_templates): Lose redundant - -fexternal-templates handling. - (tsubst): Set TREE_PUBLIC and DECL_EXTERNAL on new decls. Don't set - TREE_STATIC or DECL_INTERFACE_KNOWN. - (do_pending_expansions): Predicate on DECL_INTERFACE_KNOWN instead - of DECL_EXTERNAL for explicit instantiations. - (do_function_instantiation): Do the new thing. - (do_type_instantiation): Likewise. - (instantiate_template): Deal with member templates defined in a .cc - file with -fexternal-templates. - * except.c (expand_exception_blocks): Use DECL_LINKAGE_KNOWN to - decide whether to stick builtin_throw here. - * decl2.c (import_export_inline): Predicate on DECL_INTERFACE_KNOWN - rather than TREE_PUBLIC. Generally fix rules. - (finish_file): Use DECL_INITIAL to determine whether or not a method - has been synthesized, rather than TREE_ASM_WRITTEN. - * decl.c (warn_extern_redeclared_static): Use DECL_PUBLIC instead of - TREE_PUBLIC. - (pushdecl): Likewise. - (duplicate_decls): Likewise. Deal with DECL_DECLARED_STATIC and - DECL_INTERFACE_KNOWN. - (redeclaration_error_message): Fix checking for conflicting linkage. - (define_function): Set DECL_INTERFACE_KNOWN. - (grokfndecl): Function decls are PUBLIC until we are sure about - their linkage. Set DECL_DECLARED_STATIC as needed. - (start_function): Deal with linkage. Move pushdecl after linkage - magic. - (finish_function): Don't set TREE_ASM_WRITTEN on discarded inlines. - * cp-tree.h (lang_decl_flags): Add interface_known and - declared_static. - (DECL_INTERFACE_KNOWN): New macro. - (DECL_DECLARED_STATIC): New macro. - (DECL_PUBLIC): New macro. - - Clean up bogus use of TREE_PUBLIC. - * class.c (alter_access): Fix mistaken use of TREE_PUBLIC (it - doesn't correspond to TREE_PROTECTED and TREE_PRIVATE). - * init.c (do_friend): Don't arbitrarily set TREE_PUBLIC. - -Wed Oct 5 13:44:41 1994 Jason Merrill - - * call.c (build_overload_call_real): Don't immediately do - array->pointer conversion. - - * pt.c (type_unification): If not passing to a reference, strip - cv-quals. Also handle array->pointer conversion. - -Tue Oct 4 17:45:37 1994 Jason Merrill - - * decl.c (grokdeclarator): Don't warn about applying const to a - const typedef or template type parameter. - - * decl2.c (finish_file): Also synthesize methods after walking the - vtables. Ugly ugly ugly. - -Mon Oct 3 15:02:41 1994 Jason Merrill - - * various: Remove lingering remnants of old exception handling code. - - * decl2.c (finish_file): Synthesize methods before walking the - vtables, so that the vtables get emitted as needed. - - * decl.c (shadow_tag): Remove obsolete code for pushing tags and - dealing with exceptions. - -Mon Oct 3 13:05:27 1994 Ian Lance Taylor - - * Make-lang.in (g++-cross): Depend upon version.o and $(LIBDEPS). - -Mon Oct 3 02:59:28 1994 Jason Merrill - - * decl2.c (finish_file): Fix inline handling. - -Sun Oct 2 00:21:56 1994 Jason Merrill - - * decl.c (grokdeclarator): Handle redundant scope even better. - ({push,pop}_cp_function_context): Take toplev parameter. - - * method.c (synthesize_method): Pass toplev parameter to - {push,pop}_cp_function_context depending on decl_function_context - (fndecl). - - * typeck.c (build_x_unary_op): Unary & on OFFSET_REFs is always the - built-in version. - - * method.c (synthesize_method): Don't be confused by __in_chrg - parameter. - - * class.c (popclass): Set C_C_D like start_function does. - - * decl.c (grokdeclarator): Handle redundant scope better. - - * parse.y (expr_or_declarator): Add '(' expr_or_declarator ')' rule. - (direct_notype_declarator): Likewise. - (complex_direct_notype_declarator): Remove it here. - -Sat Oct 1 21:42:18 1994 Jason Merrill - - * init.c (resolve_offset_ref): Fix types used in resolving .* - expressions. - -Sat Oct 1 15:18:49 1994 Jason Merrill - - Beginnings of work to synthesize methods only when needed. - * call.c (build_method_call): Synthesize methods as necessary - (currently never necessary). - * class.c (popclass): Don't try to set C_C_D here, as it'll end up - on the wrong obstack. - * decl.c (push_cp_function_context): Mostly copied from - push_c_function_context. - (pop_cp_function_context): Similarly. - (finish_function): Reverse order of poplevel and pop_nested_class so - that current_class_decl is restored properly. - (start_function): Likewise. - (finish_function): Add parameter 'nested'. Don't call - permanent_allocation if (nested). - * various: Pass extra parameter to finish_function. - * decl2.c (finish_file): Reorganize end-of-file inline handling, - synthesizing methods as necessary. - * lex.c (cons_up_default_function): Call mark_inline_for_output. - Only synthesize methods immediately if #pragma implementation - (currently disabled). - (do_pending_inlines): Call synthesize_method. - * method.c (synthesize_method): New function; all method synthesis - goes through here. Calls do_build_assign_ref and - do_build_copy_constructor. - (build_default_constructor): Remove. - (build_dtor): Likewise. - (build_assign_ref): Rename to do_build_assign_ref and remove stuff - done by synthesize_method. - (build_copy_constructor): Similarly. - -Thu Sep 29 16:58:52 1994 Mike Stump - - * typeck.c (c_expand_return): Use magic so the backend can fixup the - assignment into the return register, so cleanups won't clobber it. - -Thu Sep 29 13:08:50 1994 Jason Merrill - - * method.c (hack_identifier): Don't call assemble_external for - template decls. - - * decl.c (finish_decl): Also end temporary allocation if the decl in - question has a type of error_mark_node. - -Wed Sep 28 21:45:00 1994 Mike Stump - - * typeck.c (build_modify_expr): When optimizing ?: on lhs, make sure - that if the ?: was a reference type, that the subparts will be also. - -Wed Sep 28 16:14:04 1994 Brendan Kehoe - - * except.c (register_exception_table): Use Pmode, not PTRmode. - -Fri Sep 23 13:54:27 1994 Jason Merrill - - * lex.c (do_pending_inlines): Do method synthesis after the - pending_inlines have been reversed. - -Thu Sep 22 12:53:03 1994 Per Bothner - - * decl2.c (finish_file): Fix Brendan's fix: Only call - register_exception_table if there is a non-empty exception table. - -Thu Sep 22 12:03:46 1994 Brendan Kehoe - - * decl2.c (finish_file): Only do register_exception_table if - -fhandle-exceptions is being used. - -Wed Sep 21 19:01:51 1994 Per Bothner - - * except.c (output_exception_table_entry): Simplify - by using assemble_integer. - (build_exception_table): Change to return a count. - Cleanup to use standard macros, instead of hard-wired - sparc asm format. Don't make __EXCEPTION_TABLE__ global. - (register_exception_table): New function. Generate call to builtin. - * decl2.c (finish_file): Call register_exception_table. - * cp-tree.h (build_exception_table): Fix prototype. - -Wed Sep 21 13:20:42 1994 Brendan Kehoe - - * tree.c (break_out_calls): Don't try to duplicate the DECL_INITIAL. - - * decl2.c (delete_sanity): Give an error at trying to delete a - function. - -Wed Sep 21 11:47:10 1994 Jason Merrill - - * lex.c (cons_up_default_function): Mark synthesized destructors - inline. - - * decl.c (duplicate_decls): Ignore redeclarations of wchar_t as - something other than __wchar_t, complaining if -pedantic and not in - a system header. - -Tue Sep 20 09:43:28 1994 Jason Merrill - - * decl.c (xref_tag): Set up BINFO_INHERITANCE_CHAIN on base binfos - here. - - * typeck.c (build_modify_expr): Require complete type after checking - for error_mark_node. - - * call.c (build_method_call): Print parmtypes when complaining of - ambiguous call. - - * typeck.c (build_modify_expr): Handle assignment to array from - non-array. - - * decl.c (lookup_name_real): Deal with got_scope == error_mark_node. - - * call.c (build_method_call): Don't bother with the exact match. - -Mon Sep 19 00:51:39 1994 Jason Merrill - - * init.c (expand_aggr_init): If we munge the type of the variable, - also munge the type of the initializer. - - * decl.c (grokdeclarator): Use <= when comparing to RID_LAST_MODIFIER. - (init_decl_processing): Push artificial declaration of wchar_t so - people don't have to declare it before they can use it. - - * error.c (cp_line_of): Return lineno in lieu of 0. - - * typeck.c (convert_for_assignment): Handle conversion of pmfs to - int and bool. - (build_component_ref): Fold the COMPONENT_REF in case it can be - reduced. - - * typeck2.c (store_init_value): Don't pedwarn about non-constant - bracketed initializers for automatic variables. - -Sun Sep 18 10:12:12 1994 Jason Merrill - - * error.c (dump_decl): Don't say `typedef enum foo foo'. - - * decl.c (start_decl): Don't set TREE_PUBLIC on template decls just - because they're affected by #pragma i/i. We'll deal with that when - they get instantiated. - - * typeck.c (build_unary_op): Clean up cruft in ADDR_EXPR case. - - * class.c (instantiate_type): Set TREE_CONSTANT on instantiated - ADDR_EXPRs if appropriate. - - * decl.c (build_ptrmemfunc_type): Unset IS_AGGR_TYPE on pmf types. - - * typeck.c (build_ptrmemfunc): Handle &overloaded_method as an - initializer properly. - * typeck2.c (digest_init): Likewise. - - * tree.c (cp_build_type_variant): Like c_build_type_variant, except - it uses build_cplus_array_type. - * *.c: Use cp_build_type_variant instead of c_build_type_variant. - - * pt.c (do_type_instantiation): Don't try to instantiate nested - enums. - -Tue Sep 13 10:56:58 1994 Jason Merrill - - * cvt.c (build_up_reference): Handle preincrement and predecrement - properly. - -Tue Sep 13 09:51:59 1994 Brendan Kehoe - - * decl.c (finish_decl): Only lay out the rtl for DECL if it is, in - fact, static. - -Mon Sep 12 14:40:30 1994 Brendan Kehoe - - * decl.c (finish_decl): Lay out the rtl for DECL before doing - grok_reference_init, in case it's static. - -Mon Sep 12 12:45:38 1994 Jason Merrill - - * class.c (finish_struct): Don't synthesize constructors if the - class has a field with the same name as the class. Don't die on - classes with no constructors or destructors. Don't die if the head - and tail of the class are in different files. - - * decl.c (grokdeclarator): Don't treat a function pointer field - with the same name as the class as a constructor. - -Fri Sep 9 13:17:00 1994 Jason Merrill - - * typeck.c (build_c_cast): Pull constant values out of their - variables here. - - * decl.c (duplicate_decls): Only propagate DECL_CHAIN in - FUNCTION_DECLs and TEMPLATE_DECLs. - -Thu Sep 8 10:07:48 1994 Jason Merrill - - * decl.c (duplicate_decls): Propagate DECL_CHAIN in all DECLs that - have it. - - * pt.c (unify): REALs and INTEGERs only unify with their own genus. - (instantiate_member_templates): Don't muck with DECL_EXTERNAL and - TREE_PUBLIC unless -fexternal-templates. - -Wed Sep 7 13:17:10 1994 Jason Merrill - - * pt.c (do_type_instantiation): Call instantiate_member_templates. - Deal with specializations. - (tsubst): Don't stick the mangled name in DECL_NAME for function - instantiations. Don't push them, either. - - * decl2.c (grokfield): Move code for generating the - DECL_ASSEMBLER_NAME for static members from here. - * method.c (build_static_name): To here. - * decl.c (grokvardecl): Call build_static_name. - (duplicate_decls): Keep old DECL_ASSEMBLER_NAME. - -Mon Sep 5 12:49:18 1994 Jason Merrill - - * call.c (build_method_call): If -Wsynth, warn when selecting - synthesized op= over user-supplied one cfront would select. - * decl2.c (lang_decode_option): Handle -Wsynth. - -Fri Sep 2 15:11:59 1994 Jason Merrill - - * decl.c (finish_enum): Overhaul to fix several bugs. - (start_enum): Disable useless code. - -Thu Sep 1 16:04:54 1994 Jason Merrill - - * typeck.c (c_expand_return): Warn about returning a reference to a - temporary. - (convert_arguments): Increment argument counter when using default - arguments, too. - -Wed Aug 31 14:29:22 1994 Jason Merrill - - * decl.c (finish_decl): If the type of decl is error_mark_node, - don't bother trying to do anything. - - * typeck.c (convert_for_initialization): If the rhs contains a - constructor call, pretend the lhs type needs to be constructed. - - * init.c (expand_default_init): If we stick the object inside the - initializer, mark the initializer used. - -Tue Aug 30 13:50:18 1994 Jason Merrill - - * method.c (build_assign_ref): Return *this; - (build_assign_ref): Fix base assignment order. - (build_copy_constructor): Fix member init order. - -Mon Aug 29 13:54:39 1994 Brendan Kehoe - - * g++.c (main): Remember to clear out SAW_SPECLANG after we see - its argument. - -Sat Aug 27 09:36:03 1994 Jason Merrill - - * method.c (build_copy_constructor): Also copy virtual bases. - -Fri Aug 26 17:05:15 1994 Jason Merrill - - * lex.c (do_pending_inlines): Clear out pending_inlines before doing - any synthesis. Also first set deja_vu on all pending_inlines. - - * method.c (build_assign_ref): Use build_member_call to invoke base - operator=, rather than build_modify_expr. And use - build_reference_type instead of TYPE_REFERENCE_TO. - (build_copy_constructor): Use TYPE_NESTED_NAME to identify the - basetype. - - * decl2.c (grokfield): Don't complain about undefined local class - methods. - - * class.c (finish_struct): Don't try to synthesize methods here. - * lex.c (do_pending_inlines): Instead, synthesize them here. - (init_lex): Initialize synth_obstack. - (cons_up_default_function): Stick synthesis request on - pending_inlines. - -Fri Aug 26 12:24:14 1994 Brendan Kehoe - - * call.c (build_method_call) [PCC_STATIC_STRUCT_RETURN]: Also - accept an RTL_EXPR in what we're about to use for the instance, - since anything which would end up with pcc_struct_return set - inside cplus_expand_expr. - - * cp-tree.h (cons_up_default_function): Note change of prototype. - -Thu Aug 25 23:05:30 1994 Gerald Baumgartner - - * class.c (finish_struct): Undid change from Aug 21 testing - CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING. - * parse.y (left_curly): Likewise, undid change from Aug 21. - * decl.c (xref_tag): Undid change from Aug 21, set - CLASSTYPE_INTERFACE correctly, and added comments. - -Thu Aug 25 00:36:31 1994 Jason Merrill - - Rework approach to synthesized methods; don't go through the parser - anymore. - * class.c (finish_struct): Use new synthesis approach. - * lex.c (cons_up_default_function): Now just creates declaration, - not code. - (largest_union_member): #if 0 out. - (default_assign_ref_body): Likewise. - (default_copy_constructor_body): Likewise. - * method.c (build_default_constructor): New function to synthesize X(). - (build_copy_constructor): Synthesize X(X&). - (build_assign_ref): Synthesize X::operator=(X&). - (build_dtor): Synthesize ~X(). - - * error.c (cp_line_of): If we're dealing with an artificial - TYPE_DECL, look at the type instead. - -Wed Aug 24 11:11:50 1994 Jason Merrill - - * init.c (sort_member_init): Check warn_reorder. - * decl2.c (lang_decode_option): Handle -W{no-,}reorder. - - * cp-tree.h (CLASSTYPE_SOURCE_LINE): New macro. - * error.c (cp_line_of): Use CLASSTYPE_SOURCE_LINE for aggregates. - * class.c (finish_struct): Set CLASSTYPE_SOURCE_LINE. - -Tue Aug 23 09:28:35 1994 Mike Stump - - * error.c (dump_decl): Improve wording, so that error messages - dont't read template<, class foo>... - -Mon Aug 22 15:30:51 1994 Brendan Kehoe - - * parse.y (label_colon): Also match a TYPENAME as a label name, - since they may have declared a class by that name but have also - tried to have a local label under the same name. - - * pt.c (coerce_template_parms): Call cp_error, not cp_error_at, - for the message so they know at what point it was instantiated. - -Sun Aug 21 23:07:35 1994 Gerald Baumgartner - - * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and - CLASSTYPE_VTABLE_NEEDS_WRITING for signatures up to left_curly time. - * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and - CLASSTYPE_VTABLE_NEEDS_WRITING for signatures down to left_curly time. - * parse.y (left_curly): New final resting place for setting - CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING for signatures. - - * class.c (finish_struct): Don't test for function/field name - conflicts in signatures, since all the fields are compiler-constructed. - -Fri Aug 19 14:04:47 1994 Kung Hsu - - * method.c (build_overload_nested_name): In qualified name - mangling, the template with value instantiation will have numeric - at end and may mixed with the name length of next nested level. - Add a '_' in between. - * method.c (build_overload_name): Ditto. - * method.c (build_overload_identifier): Ditto. - -Thu Aug 18 16:24:43 1994 Mike Stump - - * error.c (dump_decl): Handle NULL args. - -Thu Sep 29 16:15:36 1994 Michael I Bushnell - - * g++.c: Rework last change so it's done like collect.c (and - gcc.c). - -Wed Sep 14 10:17:27 1994 Michael I Bushnell - - * g++.c: Include in case `errno' is a macro - as permitted by ANSI C. - -Thu Aug 18 12:48:09 1994 Mike Stump - - * class.c (finish_struct): Move setting of CLASSTYPE_INTERFACE and - CLASSTYPE_VTABLE_NEEDS_WRITING up to left_curly time. - * decl.c (xref_tag): Move setting of CLASSTYPE_INTERFACE and - CLASSTYPE_VTABLE_NEEDS_WRITING down to left_curly time. - * parse.y (left_curly): New final resting place for setting - CLASSTYPE_INTERFACE and CLASSTYPE_VTABLE_NEEDS_WRITING. - -Thu Aug 11 11:32:42 1994 H.J. Lu - - * g++.c (main): Only decrement "added" and set "library" to - NULL when "library" != NULL. - -Sat Aug 13 00:14:52 1994 Jason Merrill - - * decl.c (grokdeclarator): Don't set TREE_PUBLIC on a function decl - just because its class has a known interface. - (decls_match): Deal with new format of template parms. - - * lex.c (cons_up_default_function): Don't play with TREE_PUBLIC and - DECL_EXTERNAL here. - -Fri Aug 12 01:55:15 1994 Jason Merrill - - * decl.c (pushtag): SET_DECL_ARTIFICIAL on gratuitous typedefs. - (xref_defn_tag): Likewise. - (pushdecl): Only allow artificial typedefs to be shadowed. - - * init.c (emit_base_init): Pass the right binfos to - expand_aggr_init_1. - - * class.c (delete_duplicate_fields_1): Make it work right. - (finish_struct): Catch function/field name conflict. - - * decl2.c (check_classfn): Pass the function to cp_error, not just - the name. - - * init.c (sort_member_init): Warn when order of member initializers - does not match order of member declarations. - (emit_base_init): Call expand_aggr_init_1 with LOOKUP_PROTECT. - - * error.c (dump_expr): Handle lists of functions. - - * decl.c (start_function): #pragma interface only affects functions - that would otherwise be static. - (finish_decl): Don't warn about an unused variable if it has both - constructor and destructor, since the 'resource allocation is - initialization' idiom is relatively common. - - * typeck.c (comp_target_types): Don't handle TEMPLATE_TYPE_PARMs. - (comp_target_parms): Likewise. - (compparms): Never consider default parms. - (common_base_type): Don't choose a virtual baseclass if there is a - more derived class in common. - (build_conditional_expr): If pedantic, pedwarn about conversion to - common base in conditional expr. - - * class.c (instantiate_type): Handle template instantiation better. - - * typeck.c (convert_arguments): Don't try to get tricky and convert - to int directly when PROMOTE_PROTOTYPES is set, as it breaks - user-defined conversions. - - * lex.c (check_for_missing_semicolon): Also give error at end of - file. - - * call.c (build_method_call): Don't promote arrays to pointers here. - - * typeck.c (convert_arguments): Don't require the actual parameter - to be of a complete type if the formal parameter is a reference. - -Thu Aug 11 15:21:40 1994 Jason Merrill - - * decl.c (grokdeclarator): Soften 'static' on member function error - to pedwarn. - - * init.c (build_new): Don't automatically save rval. - (build_offset_ref): Do field lookup with proper basetype_path. - -Thu Aug 11 12:46:54 1994 Brendan Kehoe - - * errfn.c (cp_silent): Declare to mark when we should avoid - emitting warnings and errors. - (cp_error): Check it. - (cp_warning): Likewise. - (cp_pedwarn): Likewise. - (cp_compiler_error): Likewise. - (cp_error_at): Likewise. - (cp_warning_at): Likewise. - (cp_pedwarn_at): Likewise. - * call.c (compute_conversion_costs): Set CP_SILENT when we start - out, and make sure we turn it off before we leave. - -Thu Aug 11 00:02:54 1994 Jason Merrill - - * decl2.c (grok_array_decl): Try computing *(A+B) if neither - argument is obviously an array. - -Wed Aug 10 15:32:04 1994 Jason Merrill - - * typeck.c (c_expand_start_case): Do cleanups here. - - * parse.y (xcond): Do bool conversion here, too. - (simple_stmt, SWITCH case): Don't do cleanups here. - - * decl.c (duplicate_decls): Don't treat builtins that have been - explicitly declared specially. - -Tue Aug 9 01:16:09 1994 Jason Merrill - - * tree.c (make_deep_copy): Support copying pointer, reference, - function, array, offset and method types. - - * decl.c (init_decl_processing): Mark exit and abort as - BUILT_IN_NONANSI so that duplicate_decls is kinder about - redeclaration. - (duplicate_decls): Don't give two errors for redeclaring a C - function with the same parms but a different return type. - - * parse.y (paren_cond_or_null): Do cleanup and bool conversion here. - (condition): Instead of here. - (simple_stmt, SWITCH case): Also do cleanup here. - - * decl2.c (finish_anon_union): Only break out FIELD_DECLs. - - * call.c (build_method_call): Don't throw away the side effects of - the object in a call to a non-existent constructor. - * parse.y (primary): Likewise. - - * method.c (build_decl_overload): Oop. - - * decl2.c (lang_decode_option): Deal with flag_no_nonansi_builtin, - warn about uselessness of specifying -fansi-overloading. - - * method.c (build_decl_overload): Treat any non-member new with one - parameter as __builtin_new. - - * decl.c (init_decl_processing): Setup built-in meanings of exit, - _exit and abort. - -Mon Aug 8 15:03:30 1994 Jason Merrill - - * error.c (dump_readonly_or_volatile): Put a space between const and - volatile if both apply. - - * init.c (perform_member_init): Clean up after this initialization. - (emit_base_init): Clean up after each base init, not after all have - been done. - (expand_aggr_vbase_init_1): Clean up after this init. - -Sun Aug 7 14:55:05 1994 Jason Merrill - - * call.c (build_method_call): Deal with destroying references. - - * parse.y (condition): Do bool_truthvalue_conversion here. - (paren_expr_or_null): And here. - (simple_if): Not here. - (simple_stmt): Or here. - -Sat Aug 6 22:29:45 1994 Jason Merrill - - * parse.y (paren_expr_or_null): Wrap the expression in a - CLEANUP_POINT_EXPR. - (condition): Likewise. - -Sat Aug 6 19:46:37 1994 Rohan Lenard - - * call.c (build_scoped_method_call): Fix error message when - destructor call refers to a nonexistent type. - -Sat Apr 16 22:43:30 1993 Gerald Baumgartner - - * lex.h (rid): Deleted RID_RAISES, it's never used. - Moved RID_PUBLIC, RID_PRIVATE, RID_PROTECTED, RID_EXCEPTION, - RID_TEMPLATE and RID_SIGNATURE to the end of the enumeration, - they don't need to be touched in `grokdeclarator.' - (RID_LAST_MODIFIER): Defined macro to be RID_MUTABLE. - - * decl.c (grokdeclarator): Use RID_LAST_MODIFIER instead of - RID_MAX as loop limit for finding declaration specifiers. - -Sat Apr 3 21:59:07 1993 Gerald Baumgartner - - * lex.c (debug_yytranslate): Moved to parse.y since it needs to - access `yytname,' which is static in parse.c. - -Fri Apr 2 23:36:57 1993 Gerald Baumgarnter - - * cp-tree.h (GNU_xref_ref): Fixed typo in extern declaration, it - was `GNU_xref_def' instead of `GNU_xref_ref.' - -Fri Aug 5 14:20:16 1994 Jason Merrill - - * pt.c (do_function_instantiation): Don't set TREE_PUBLIC and - DECL_EXTERNAL on 'extern' instantiations; wait until EOF to do that. - (do_type_instantiation): Likewise. - - * decl2.c (import_export_inline): Decides at EOF what an inline's - linkage should be. - (finish_file): Call it. - - * decl.c (start_function): Don't rely on the settings of TREE_PUBLIC - and DECL_EXTERNAL from do_*_instantiation. Only set - DECL_DEFER_OUTPUT on inlines whose linkage might actually change. - (finish_function): Use DECL_DEFER_OUTPUT to decide which inlines to - mark for later consideration, rather than DECL_FUNCTION_MEMBER_P. - -Fri Aug 5 01:12:20 1994 Mike Stump - - * class.c (get_class_offset_1, get_class_offset): New routine to - find the offset of the class where a virtual function is defined, - from the complete type. - * class.c (modify_one_vtable, fixup_vtable_deltas): Use - get_class_offset instead of virtual_offset as get_class_offset will - always provide the right answer. - * tree.c (virtual_offset): Remove. It only ever worked some of the - time. - -Tue Aug 2 12:44:21 1994 Jason Merrill - - * call.c (build_method_call): Put back unary_complex_lvalue call - that I thought was redundant. - - * typeck.c (c_expand_return): Fix a case I missed before. - -Sun Jul 31 17:54:02 1994 Jason Merrill - - * pt.c (unify): Strip cv-quals from template type arguments (when - 'const T*' is matched to 'const char*', that does not mean that T is - 'const char'). - -Fri Jul 29 01:03:06 1994 Jason Merrill - - * pt.c (do_type_instantiation): Instantiate nested TAGS, not - typedefs. Third time's the charm? - - * parse.y (template_parm): Support default template parms. - * pt.c (process_template_parm): Likewise. - (end_template_parm_list): Likewise. - (coerce_template_parms): Likewise. - (mangle_class_name_for_template): Likewise. - (push_template_decls): Likewise. - (unify): Likewise. - * method.c (build_overload_identifier): Likewise. - * error.c (dump_decl): Likewise. - -Wed Jul 27 17:47:00 1994 Jason Merrill - - * pt.c (do_type_instantiation): Only instantiate nested *classes*. - -Tue Jul 26 13:22:40 1994 Jason Merrill - - * search.c (note_debug_info_needed): Also emit debugging information - for the types of fields. - -Mon Jul 25 00:34:44 1994 Jason Merrill - - * pt.c (lookup_template_class): Pass 'template' to - coerce_template_parms instead of 'in_decl', since it's a more - meaningful context. - - * typeck.c (c_expand_return): Make sure any cleanups for the return - expression get run. - (build_c_cast): Use CONVERT_EXPR for conversion to void. - - * pt.c (do_type_instantiation): Also instantiate nested types. - - * typeck.c (convert_for_assignment): Don't die when comparing - pointers with different levels of indirection. - - * decl.c (grokdeclarator): The sub-call to grokdeclarator for - class-local typedefs sets DECL_ARGUMENTS, so we need to clear it - out. - - * decl2.c (finish_anon_union): Don't die if the union has no - members. - - * decl.c (grokdeclarator): Undo changes to declspecs when we're done - so that 'typedef int foo, bar;' will work. - - * decl2.c (finish_file): Don't call expand_aggr_init for - non-aggregates. - -Mon Jul 25 00:03:10 1994 Teemu Torma - - * decl.c (finish_function): We can't inline constructors and - destructors under some conditions with -fpic, but don't unset - DECL_INLINE. - -Mon Jul 25 00:03:10 1994 Jason Merrill - - * typeck.c (build_object_ref): Make sure 'datum' is a valid object. - -Sun Jul 24 14:19:31 1994 Jason Merrill - - * class.c (finish_struct): Don't set DECL_FIELD_BITPOS on - non-fields. - (finish_struct_methods): Use copy_assignment_arg_p. - - * cvt.c (cp_convert): If expr is an OFFSET_REF, resolve it instead - of giving an error. - - * typeck.c (build_binary_op_nodefault): Don't set result_type if we - don't know how to compare the operands. - - * decl.c (grokdeclarator): Avoid seg fault when someone uses '__op' - as a declarator-id in their program. Like the Linux headers do. - Arrgh. - - * tree.c (lvalue_p): Treat calls to functions returning objects by - value as lvalues again. - - * typeck.c (build_component_addr): Use convert_force to convert the - pointer in case the component type is also a private base class. - - * search.c (get_matching_virtual): Fix bogus warning of overloaded - virtual. - - * pt.c (overload_template_name): Set DECL_ARTIFICIAL on the created - TYPE_DECL to fix bogus shadowing warnings. - -Fri Jul 22 01:15:32 1994 Jason Merrill - - * init.c (expand_aggr_init_1): const and volatile mismatches do not - prevent a TARGET_EXPR from initializing an object directly. - -Tue Jul 19 17:55:37 1994 Jason Merrill - - * cvt.c (build_up_reference): Allow building up references to - `this', don't warn about making references to artificial variables - (like `this'). - - * tree.c (lvalue_p): `this' is not an lvalue. - - * call.c (build_method_call): Accept using a typedef name (or - template type parameter) for explicit destructor calls. - -Thu Jul 14 09:42:23 1994 Mike Stump - - * Version 2.6.0 released. - -Wed Jul 13 03:57:54 1994 Jason Merrill - - * method.c (hack_identifier): Put back old code so lists of - non-functions will be handled properly. - - * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): #if 0 out; this macro is now - defined in the language-independent tree.h. - - * tree.c (count_functions): Avoid bogus warning when compiling this - function. - -Mon Jul 11 18:37:20 1994 Jason Merrill - - * decl.c (grok_reference_init): Always save the initializer of a - reference. - -Fri Jul 8 17:41:46 1994 Mike Stump - - * decl.c (cplus_expand_expr_stmt): Wrap statement expressions inside - CLEANUP_POINT_EXPRs so that the stack slots can be reused. - (disabled for now) - -Fri Jul 8 12:59:38 1994 Jason Merrill - - * method.c (hack_identifier): Fix for new overloading. - - * typeck.c (build_binary_op_nodefault): Don't mess with division by - zero. - -Fri Jul 8 13:20:28 1994 Gerald Baumgartner - - * decl2.c (finish_file): Only call walk_sigtables, if - flag_handle_signatures is turned on, don't waste time otherwise. - -Fri Jul 8 02:27:41 1994 Jason Merrill - - * decl.c (push_overloaded_decl): Don't create overloads of one when - shadowing a class type. - * typeck.c (build_x_function_call): Complain about overloads of one. - - * decl.c (grokdeclarator): Don't try to treat a char* as a tree. - (grokdeclarator): Fix setting of TREE_STATIC. - (start_decl): Clear DECL_IN_AGGR_P after calling duplicate_decls. - -Thu Jul 7 22:20:46 1994 Gerald Baumgartner - - * cp-tree.h (walk_sigtables): Created extern declaration. - * decl2.c (walk_sigtables): Created function, patterned after - walk_vtables, even though we only need it to write out sigtables. - (finish_sigtable_vardecl): Created function. - (finish_vtable_vardecl): Changed 0 to NULL_PTR. - (finish_file): Call walk_sigtables. - - * sig.c (build_signature_table_constructor): Mark class member - function pointed to from signature table entry as addressable. - -Thu Jul 7 13:39:37 1994 Jason Merrill - - * decl.c (start_decl): Check new decl of static member variable - against the declaration in the class here. - (grokvardecl): Instead of here. - - * class.c (prepare_fresh_vtable): Call import_export_vtable if not - -fvtable-thunks. - (build_vtable): Likewise. - - * decl2.c (import_export_vtable): Move logic for deciding the - interface of a template class from here. - (import_export_template): To here. - (finish_vtable_vardecl): Call import_export_template before - import_export_vtable. - -Wed Jul 6 20:25:48 1994 Mike Stump - - * except.c (init_exception_processing): Setup interim_eh_hook to - call lang_interim_eh. - * except.c (do_unwind): Propagate throw object value across - stack unwinding. - * except.c (saved_throw_value): Used to hold the value of the object - being thrown. It is always a reference to the real value. - * except.c (expand_start_catch_block): Add handling for the - value of the exception object. - * except.c (expand_start_catch_block): Add handler for the handler, - so that throws inside the handler go to the outer block. - * except.c (expand_end_catch_block): Likewise. - * parse.y (handler_args): Use parm instead, as the other doesn't yet - handle references correctly. - -Wed Jul 6 17:55:32 1994 Per Bothner - - * decl2.c (mark_vtable_entries): If -ftable-thunks, set the - vtable entry properly to abort. - -Tue Jul 5 14:07:54 1994 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Downgrade division by zero - errors to warnings. - - * call.c (build_overload_call_real): Handle fnname being a list of - functions. - * typeck.c (build_x_function_call): Pass list of functions to - build_overload_call, not just the name. - * tree.c (count_functions): Complain when called for invalid - argument. - - * decl.c (grokdeclarator): Fix settings of TREE_STATIC, TREE_PUBLIC - and DECL_EXTERNAL on static members and initialized const members. - * decl2.c (grokfield): Reflect this change. - -Fri Jul 1 09:35:51 1994 Jason Merrill - - * parse.y (init): ANSI C++ does not forbid { }. - -Thu Jun 30 00:35:22 1994 Jason Merrill - - * decl2.c (lang_decode_option): Set warn_nonvdtor along with -Wall. - warn_nonvdtor defaults to off. - - * class.c (instantiate_type): Use comptypes rather than relying on - types to satisfy ==. - - * decl.c (start_function): Set DECL_DEFER_OUTPUT on all inlines that - might be static. - - * tree.c (build_cplus_new): Never build WITH_CLEANUP_EXPRs. - - * decl.c (grok_reference_init): Deal with ADDR_EXPRs of TARGET_EXPRs. - - * cvt.c (cp_convert): Pass 0 to with_cleanup_p arg of - build_cplus_new. - -Wed Jun 29 22:31:09 1994 Jason Merrill - - * decl2.c (finish_file): Maybe consider static inlines multiple - times, in case they reference each other. - -Tue Jun 28 11:58:38 1994 Gerald Baumgartner - - * class.c (finish_struct): Don't `cons_up_default_function's - for signatures. - (finish_struct): Handle an empty method_vec correctly. - - * decl.c (grokdeclarator): Don't warn about a signature being - empty in a signature pointer declaration if we only saw a - forward declaration of the signature. Changed `warning's into - `cp_warning's. - - * sig.c (build_sigtable): Don't die if a null signature table - constructor is returned. - (build_signature_pointer_constructor): If the signature table - constructor is null, the _sptr field is set to a null pointer - and cast to the appropriate type. Make copies of all null - pointers so that the type null_pointer_node doesn't get changed. - (build_signature_table_constructor): Added comments. - - * sig.c (build_signature_pointer_constructor): Complain if we - try to assign to/initialize a signature pointer/reference of - an undefined signature. - -Mon Jun 27 14:05:16 1994 Gerald Baumgartner - - * typeck2.c (store_init_value): Don't be pedantic about - non-constant initializers of signature tables/pointers/references. - -Fri Jun 24 16:49:41 1994 Gerald Baumgartner - - * decl.c (grokdeclarator): If we are grokking an opaque typedef - in a signature, don't complain about it begin static. - -Wed Jun 29 16:44:45 1994 Mike Stump - - Fixes a problem of the this pointer being wrong in virtual calls to - methods that are not overridden in more derived classes. - - * class.c (fixup_vtable_delta): New routine. It will fixup the - delta entries in vtables, wheever they need updating. - * class.c (finish_struct): Call the new routine for all virtual - bases, as they can have different offsets, than those used in base - classes that we derive our vtable from. - -Tue Jun 28 23:49:28 1994 Jason Merrill - - * typeck.c (build_binary_op): Use the types before default - conversions in the error message. - - * *.c: Use c_build_type_variant instead of build_type_variant where - the type might be an array. - - * call.c (build_method_call): Call build_type_variant and - build_reference_type in the right order. - * decl.c (record_builtin_type): Likewise. - -Wed Jun 29 16:58:53 1994 Jason Merrill - - * call.c (build_method_call): Call build_type_variant and - build_reference_type in the right order. - * decl.c (record_builtin_type): Likewise. - -Tue Jun 28 23:49:28 1994 Jason Merrill - - * typeck.c (build_binary_op): Use the types before default - conversions in the error message. - - * *.c: Use c_build_type_variant instead of build_type_variant where - the type might be an array. - -Sat Jun 25 11:50:54 1994 Jason Merrill - - * cvt.c (convert_to_reference): Try UDC's before doing the - reinterpret_cast thang, though. - -Fri Jun 24 01:24:01 1994 Jason Merrill - - * typeck.c (c_expand_return): Don't USE the return value location - after we've expanded the jump. - - * decl2.c (finish_file): Make sure DECL_SAVED_INSNS is not 0 before - trying to write out an inline. - - * cvt.c (build_up_reference): Also do address adjustment when the - target type uses MI. - (convert_to_reference): Try UDCs only after built-in conversions. - (build_type_conversion_1): Don't play games with the argument to the - method. - (build_type_conversion): #if 0 out code for binding to reference. - -Thu Jun 23 00:22:28 1994 Jason Merrill - - * decl2.c (finish_file): Use TREE_SYMBOL_REFERENCED to decide - whether to emit inlines. - - * decl.c (grokdeclarator): Set explicit_int for decls that just - specify, say, 'long'. - - * init.c (do_friend): Do overload C functions (or call pushdecl, - anyaway). - -Wed Jun 22 13:40:49 1994 Jason Merrill - - * cvt.c (build_up_reference): Don't call readonly_error. - (convert_to_reference): Propagate const and volatile from expr to - its type. - - * tree.c (lvalue_p): Random CALL_EXPRs are not lvalues. - - * cvt.c (build_up_reference): Break out WITH_CLEANUP_EXPR when - creating a temporary. - (convert_to_reference): Lose excessive and incorrect trickiness. - (cp_convert): Call build_cplus_new with with_cleanup_p set. - - * typeck2.c (build_functional_cast): Likewise. - -Tue Jun 21 17:38:38 1994 Jason Merrill - - * decl.c (grokdeclarator): signed, unsigned, long and short all - imply 'int'. - - * decl.c (grokdeclarator): Allow "this is a type" syntax. - (grok_reference_init): Simplify and fix. - -Sun Jun 19 17:08:48 1994 Jason Merrill - - * decl.c (grokdeclarator): pedwarn about a typedef that specifies no - type. - -Sat Jun 18 04:16:50 1994 Jason Merrill - - * decl.c (start_function): Move TREE_PUBLIC and DECL_EXTERNAL - tinkering to after call to pushdecl. - -Fri Jun 17 14:48:28 1994 Jason Merrill - - * call.c (build_method_call): Handle destructors for non-aggregate - types properly. - -Thu Jun 16 16:48:05 1994 Jason Merrill - - * call.c (build_method_call): Make sure that the name given for the - destructor matches the constructor_name of the instance. - - * pt.c (do_function_instantiation): A non-extern instantiation - overrides a later extern one. - (do_type_instantiation): Likewise. - -Wed Jun 15 19:34:54 1994 Jason Merrill - - * init.c (expand_aggr_init): Use TYPE_MAIN_VARIANT to get the - unqualified array type. - - * cp-tree.h (EMPTY_CONSTRUCTOR_P): Tests whether NODE is a - CONSTRUCTOR with no elements. - - * decl.c (various): Lose empty_init_node. - (finish_decl): Use EMPTY_CONSTRUCTOR_P, do the empty CONSTRUCTOR - thing depending on the value of DECL_COMMON instead of - flag_conserve_space, do the empty CONSTRUCTOR thing for types that - don't have constructors, don't treat a real empty CONSTRUCTOR - specially. - - * typeck2.c (process_init_constructor): Don't treat empty_init_node - specially. - -Wed Jun 15 19:05:25 1994 Mike Stump - - * class.c (override_one_vtable): Don't forget to merge in an old - overrider when we wanted to reuse a vtable, but couldn't. - -Wed Jun 15 15:03:16 1994 Jason Merrill - - * decl.c (start_decl): Put statics in common again. - - * decl.c (grokdeclarator): Return NULL_TREE for an error rather than - setting the type to error_mark_node. - - * typeck.c (build_modify_expr): Build up a COMPOUND_EXPR for enum - bitfield assignments. - -Tue Jun 14 12:23:38 1994 Jason Merrill - - * decl.c (grok_op_properties): Const objects can be passed by value. - -Mon Jun 13 03:10:59 1994 Jason Merrill - - * decl2.c (import_export_vtable): Force implicit instantiations to - be interface_only when -fno-implicit-templates. - - * decl.c (duplicate_decls): Redeclaring a class template name is an - error. - - * pt.c (end_template_decl): Call GNU_xref_decl for class templates. - * xref.c (GNU_xref_decl): Support templates. - -Sat Jun 11 17:09:05 1994 Jason Merrill - - * decl.c (grok_op_properties): Split out checking for whether this - function should suppress the default assignment operator. - * decl2.c (grok_function_init): Likewise. - (copy_assignment_arg_p): New function to do just that. - Now considers virtual assignment operators that take a base as an - argument to count as copy assignment operators. - - * search.c (dfs_debug_mark): Lose checks for DWARF_DEBUG and - TREE_ASM_WRITTEN, as they are redundant. - - * pt.c (end_template_decl): Don't try to set DECL_CLASS_CONTEXT on a - decl that has no LANG_SPECIFIC part. - (do_type_instantiation): Force the debugging information for this - type to be emitted. - - * decl.c (start_decl): Clear up uses of various types of templates - (say sorry for static data members, rather than "invalid template"). - (expand_static_init): Fix initialization of static data members of - template classes. - -Fri Jun 10 00:41:19 1994 Jason Merrill - - * decl.c (grokdeclarator): Set DECL_CONTEXT on static data members. - - * g++.c (main): Use -xc++-cpp-output for .i files. - - * pt.c (tsubst): Give meaningful error about declaring template for - a copy constructor which was not declared in the class template. - (do_type_instantiation): Explicit instantiation before the class - template is an error. - (instantiate_template): Don't die if tsubst returns error_mark_node. - -Thu Jun 9 19:04:59 1994 Jason Merrill - - Don't synthesize the copy assignment operator if the one in a base - class is pure virtual. - * cp-tree.h (TYPE_HAS_ABSTRACT_ASSIGN_REF): New macro to indicate - whether the type has a pure virtual copy assignment operator. - * class.c (finish_base_struct): Don't generate the copy assignment - operator if a base class has a pure virtual one. - * decl.c (grok_op_properties): Add disabled code to set - TYPE_HAS_ABSTRACT_ASSIGN_REF with comment pointing to where it is - actually set. - * decl2.c (grok_function_init): Set TYPE_HAS_ABSTRACT_ASSIGN_REF. - - * decl2.c (import_export_vtable): Always treat template - instantiations as if write_virtuals >= 2, and treat implicit - instantiations as external if -fno-implicit-templates. - (finish_file): Output all pending inlines if - flag_keep_inline_functions. - -Wed Jun 8 20:48:02 1994 Mike Stump - - * tree.c (layout_vbasetypes): Align virtual base classes inside - complete objects, so that we don't core dump on machines such as - SPARCs when we access members that require larger than normal - alignments, such as a double. Also, we bump up the total alignment - on the complete type, as necessary. - -Wed Jun 8 16:18:14 1994 Jason Merrill - - * gxxint.texi (Free Store): New section with code for examining - cookie. - (Limitations of g++): Remove operator delete entry, since it is no - longer accurate. Fix access control entry. - - * typeck.c (build_unary_op): Pedwarn about taking the address of or - incrementing a cast to non-reference type. - (build_modify_expr): Use convert instead of convert_force again. - - * search.c (get_base_distance): Use IS_AGGR_TYPE_CODE to check for - class type, not == RECORD_TYPE. - - * decl.c (grokdeclarator): Cope with grokfndecl returning NULL_TREE. - - * typeck2.c (report_case_error): #if 0 out. - * lex.c (real_yylex): Lose RANGE. - * parse.y: Likewise. - -Tue Jun 7 18:17:35 1994 Jason Merrill - - * parse.y (simple_stmt, case ranges): Use ELLIPSIS instead of RANGE. - -Mon Jun 6 19:39:57 1994 Jason Merrill - - * typeck.c (build_c_cast): Don't shortcut conversions to the same - type. Don't replace consts with their values here, since that's now - done in cp_convert. - - * cvt.c (cp_convert): When converting to bool, take - integer_zero_node to false_node and all other INTEGER_CSTs to - true_node. - (build_type_conversion): Don't complain about multiple conversions - to float if we're not really converting. - -Fri Jun 3 02:10:56 1994 Jason Merrill - - Implement 'extern template class A;' syntax for suppressing - specific implicit instantiations. - * cp-tree.h: Update prototypes for do_*_instantiation. - * pt.c (do_pending_expansions): Don't compile 'extern' explicit - instantiations. - (do_function_instantiation): Set DECL_EXTERNAL on 'extern' explicit - instantiations. - (do_type_instantiation): Likewise. - * parse.y (explicit_instantiation): Support 'extern template class - A;' syntax. - * decl.c (start_function): Don't modify the settings of TREE_PUBLIC - and DECL_EXTERNAL on explicit instantiations. - - * cvt.c (cp_convert): Replace constants with their values before - converting. - (cp_convert): Consistently use 'e' instead of 'expr'. - -Thu Jun 2 03:53:30 1994 Jason Merrill - - * typeck2.c (build_x_arrow): Resolve OFFSET_REFs first. - -Wed Jun 1 18:57:35 1994 Jason Merrill - - * typeck2.c (digest_init): Handle initializing a pmf with an - overloaded method. - * typeck.c (build_ptrmemfunc): Handle overloaded methods. - - * decl.c (pushtag): Use build_decl to make TYPE_DECLs. - (xref_defn_tag): Likewise. - * pt.c (process_template_parm): Likewise. - (lookup_template_class): Likewise. - (push_template_decls): Likewise. - (instantiate_class_template): Likewise. - (create_nested_upt): Likewise. - * class.c (finish_struct): Don't try to set DECL_CLASS_CONTEXT on - TYPE_DECLs. - - * typeck.c (convert_arguments): Make sure type is not NULL before - checking its TREE_CODE. - -Wed Jun 1 17:40:39 1994 Mike Stump - - * class.c (get_derived_offset): New routine. - * class.c (finish_base_struct): Make sure we set BINFO_VTABLE and - BINFO_VIRTUALS when we choose a new base class to inherit from. - * class.c (modify_one_vtable): Use get_derived_offset to get the - offset to the most base class subobject that we derived this binfo - from. - * class.c (finish_struct): Move code to calculate the - DECL_FIELD_BITPOS of the vfield up, as we need might need it for - new calls to get_derived_offset in modify_one_vtable. - -Wed Jun 1 16:50:59 1994 Jason Merrill - - * init.c (build_member_call): Use build_pointer_type instead of - TYPE_POINTER_TO. - -Wed Jun 1 11:11:15 1994 Brendan Kehoe - - * decl.c (grokdeclarator): Make sure we have a DNAME set before we - try to use it in an error. - -Wed Jun 1 09:48:49 1994 Mike Stump - - * typeck.c (convert_arguments, convert_for_initialization): Don't - strip NOP_EXPRs, when we are converting to a reference. - -Wed Jun 1 01:11:38 1994 Jason Merrill - - * typeck.c (build_modify_expr): Don't dereference references when - initializing them. - - * decl2.c (grokfield): Don't check for grokdeclarator returning - error_mark_node any more. - - * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. - (start_method): Return void_type_node instead of error_mark_node. - - * typeck.c (build_modify_expr): Resolve offset refs earlier. - -Tue May 31 16:06:58 1994 Jason Merrill - - * call.c (build_method_call): Resolve OFFSET_REFs in the object. - - * typeck.c (build_modify_expr): Dereference references before trying - to assign to them. - - * call.c (build_method_call): Don't confuse type conversion - operators with constructors. - * typeck2.c (build_functional_cast): Just call build_c_cast if there - was only one parameter. - * method.c (build_typename_overload): Don't set - IDENTIFIER_GLOBAL_VALUE on these identifiers. - * decl.c (grok_op_properties): Warn about defining a type conversion - operator that converts to a base class (or reference to it). - * cvt.c (cp_convert): Don't try to use a type conversion operator - when converting to a base class. - (build_type_conversion_1): Don't call constructor_name_full on an - identifier. - * cp-tree.h (DERIVED_FROM_P): Should be self-explanatory. - - * decl.c (start_decl): Don't complain that error_mark_node is an - incomplete type. - (finish_decl): Check for type == error_mark_node. - -Mon May 30 23:38:55 1994 Jason Merrill - - * decl.c (start_function): Set DECL_DEFER_OUTPUT on implicit - instantiations and inline members. - - * spew.c (yylex): Set looking_for_template if the next token is a '<'. - - * lex.h: Declare looking_for_template. - - * decl.c (lookup_name_real): Use looking_for_template to arbitrate - between type and template interpretations of an identifier. - -Sat May 28 04:07:40 1994 Jason Merrill - - * pt.c (instantiate_template): Zero out p if we found a - specialization. - - * decl.c (grokdeclarator): Elucidate warning. - (grokdeclarator): If pedantic AND -ansi, complain about long long. - - Make explicit instantiation work reasonably. It is now appropriate - to deprecate the use of -fexternal-templates. - * pt.c (instantiate_template): Set DECL_TEMPLATE_SPECIALIZATION or - DECL_IMPLICIT_INSTANTIATION on fndecl as appropriate. - (end_template_instantiation): Reflect changes in USE_TEMPLATE - semantics. - (do_pending_expansions): if (!flag_implicit_templates) DECIDE(0); - (do_function_instantiation): Don't set EXPLICIT_INST if - flag_external_templates is set. Do set TREE_PUBLIC and DECL_EXTERN - appropriately otherwise. - (do_type_instantiation): Set interface info for class. Set - TREE_PUBLIC and DECL_EXTERN for methods. Do none of this if - flag_external_templates is set. - * parse.y: Reflect changes in USE_TEMPLATE semantics. - * decl2.c: New flag flag_implicit_templates determines whether or - not implicit instantiations get emitted. This flag currently - defaults to true, and must be true for -fexternal-templates to work. - (finish_file): Consider flag_implement_inlines when - setting DECL_EXTERNAL. Consider flag_implicit_templates when - deciding whether or not to emit a static copy. - * decl.c (start_function): Set TREE_PUBLIC and DECL_EXTERNAL - properly for template instantiations. - (start_method): Set DECL_IMPLICIT_INSTANTIATION on methods of a - template class. - * cp-tree.h (CLASSTYPE_USE_TEMPLATE): Change semantics. - (DECL_USE_TEMPLATE): Parallel macro for FUNCTION and VAR_DECLs. - (various others): Accessor macros for the above. - -Fri May 27 13:57:40 1994 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Division by constant zero is - an error. - -Fri May 27 13:50:15 1994 Mike Stump - - * class.c (override_one_vtable): Don't modify things we don't own. - -Fri May 27 01:42:58 1994 Jason Merrill - - * decl.c (finish_decl): Don't postpone processing the initializer of - a decl with DECL_EXTERNAL set, and do call rest_of_compilation for a - PUBLIC const at toplevel. - (grokdeclarator): pedwarn about initializing non-const or - non-integral statics in the class body. - - * decl.c (pushtag): Don't try to set DECL_CLASS_CONTEXT on a - TYPE_DECL. - - * call.c (convert_harshness): Dereference reference on rhs before - proceeding, properly grok passing const things to non-const - references. - - * typeck.c (build_unary_op): Soften error about taking the address - of main() to a pedwarn. - - * lex.c (default_copy_constructor_body): Unambiguously specify base - classes (i.e. A((const class ::A&)_ctor_arg) ). - (default_assign_ref_body): Likewise. - -Thu May 26 13:13:55 1994 Gerald Baumgartner - - * decl2.c (grokfield): Don't complain about local signature - method declaration without definition. - - * call.c (convert_harshness): If `type' is a signature pointer - and `parmtype' is a pointer to a signature, just return 0. We - don't really convert in this case; it's a result of making the - `this' parameter of a signature method a signature pointer. - - * call.c (build_method_call): Distinguish calling the default copy - constructor of a signature pointer/reference from a signature - member function call. - -Thu May 26 12:56:25 1994 Jason Merrill - - * decl2.c (grokfield): Don't set TREE_PUBLIC on member function - declarations. - - * decl.c (duplicate_decls): A previous function declaration as - static overrides a subsequent non-static definition. - (grokdeclarator): Don't set TREE_PUBLIC on inline method - declarations. - -Wed May 25 14:36:38 1994 Jason Merrill - - * decl.c (grokdeclarator): Handle initialization of static const - members. - (finish_decl): Likewise. - - * decl2.c (grokfield): Allow initialization of static const members - even when pedantic. - - * decl2.c (grokfield): Deal with grokdeclarator returning - error_mark_node. - - * decl.c (grok_ctor_properties): Return 0 for A(A) constructor. - (grokfndecl): Check the return value of grok_ctor_properties. - (start_method): Likewise. - - * parse.y (absdcl): Expand type_quals inline. - -Tue May 24 19:10:32 1994 Jason Merrill - - * decl.c (pushtag): Use IS_AGGR_TYPE rather than checking for a - RECORD_TYPE. - -Tue May 24 18:09:16 1994 Per Bothner - - * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks, - always use "__vt_%s". - * decl2.c (finish_vtable_vardecl): Don't consider abstract virtuals - when looking for a "sentinal" method (to decide on emitting vtables). - * decl2.c (finish_file): Scan all decls for thunks that need - to be emitted. - * decl2.c (finish_vtable_vardecl): Don't bother calling emit_thunk. - * method.c (make_thunk): Use a more meaningful label. If there - exists a matching top-level THUNK_DECL re-use it; otherwise - create a new THUNK_DECL (and declare it). - * method.c (emit_thunk): Make thunk external/public depending - on the underlying method. - -Tue May 24 00:22:04 1994 Jason Merrill - - * pt.c (tsubst): Use lookup_name_nonclass to find guiding decls, not - lookup_name. - - * call.c (build_overload_call_real): Don't immediately pick a - function which matches perfectly. - - * decl.c (grokdeclarator): Use c_build_type_variant for arrays. - (grokdeclarator): Warn about, and throw away, cv-quals attached to a - reference (like 'int &const j'). - - * typeck.c (convert_arguments): Don't mess with i for methods. - * call.c (build_method_call): Pass the function decl to - convert_arguments. - - * typeck.c (comp_ptr_ttypes_real): New function. Implements the - checking for which multi-level pointer conversions are allowed. - (comp_target_types): Call it. - (convert_for_assignment): Check const parity on the ultimate target - type, too. And make those warnings pedwarns. - -Mon May 23 14:11:24 1994 Jason Merrill - - * error.c (dump_char): Use TARGET_* for character constants. - -Mon May 23 13:03:03 1994 Brendan Kehoe - - * tree.c (debug_no_list_hash): Make static. - - * decl.c (decls_match): Say the types don't match if newdecl ends up - with a null type, after we've checked if olddecl does. - (pushdecl): Check if the decls themselves match before looking for - an extern redeclared as static, to avoid inappropriate and incorrect - warnings. - -Fri May 20 14:04:34 1994 Jason Merrill - - * decl.c (grokdeclarator): Make warning about duplicate short, etc. - a pedwarn. - - * typeck.c (build_c_cast): Casting to function or method type is an - error. - - * class.c (finish_struct): Make warning for anonymous class with no - instances a pedwarn. - - * Makefile.in (stamp-parse): Expect a s/r conflict. - - * typeck.c (build_modify_expr): pedwarn about using a non-lvalue - cast as an lvalue. - -Thu May 19 12:08:48 1994 Jason Merrill - - * cvt.c (type_promotes_to): Make sure bool promotes to int rather - than unsigned on platforms where sizeof(char)==sizeof(int). - -Wed May 18 14:27:06 1994 Jason Merrill - - * typeck.c (build_c_cast): Tack on a NOP_EXPR when casting to - another variant. - (build_modify_expr): Don't strip NOP_EXPRs, and don't get tricky - and treat them as lvalues. - - * decl.c (shadow_tag): Do complain about forward declarations of - enums and empty declarations. - * parse.y: Don't complain about forward declarations of enums and - empty declarations. - - * typeck.c (convert_for_assignment): Complain about changing - the signedness of a pointer's target type. - - * parse.y (stmt): Move duplicated code for checking case values from - here. - * decl2.c (check_cp_case_value): To here. And add a call to - constant_expression_warning. - - * typeck.c (convert_for_assignment): Don't complain about assigning - a negative value to bool. - - * decl.c (init_decl_processing): Make bool unsigned. - - * class.c (finish_struct): Allow bool bitfields. - -Wed May 18 12:35:27 1994 Ian Lance Taylor - - * Make-lang.in (c++.install-man): Get g++.1 from $(srcdir)/cp. - -Wed May 18 03:28:35 1994 Jason Merrill - - * cvt.c (build_type_conversion): Lose special handling of - truthvalues. - - * search.c (dfs_pushdecls): Improve shadowing warning. - -Tue May 17 13:34:46 1994 Jason Merrill - - * init.c (build_delete): Throw away const and volatile on `this'. - - * decl.c (finish_enum): Put the constants in TYPE_VALUES again, - rather than the enumerators. - (pushtag): s/cdecl/c_decl/g - -Mon May 16 23:04:01 1994 Stephen R. van den Berg - - * cp/typeck.c (common_type): Attribute merging. - (comp_types): Utilize COMP_TYPE_ATTRIBUTES macro. - - * cp/parse.y: Revamp attribute parsing. - -Mon May 16 01:40:34 1994 Jason Merrill - - * decl.c (shadow_tag): Also check for inappropriate use of auto and - register. - - * method.c (build_overload_name): Clarify that the illegal case is a - pointer or reference to array of unknown bound. - - * error.c (dump_type_prefix): Print references to arrays properly. - - * typeck.c (various): Be more helpful in pointer - comparison diagnostics. - - * tree.c (lvalue_p): MODIFY_EXPRs are lvalues again. Isn't this - fun? - - * parse.y: Also catch an error after valid stmts. - - * search.c (dfs_init_vbase_pointers): Don't abort because `this' is - const. - - * typeck.c (convert_for_initialization): If call to - convert_to_reference generated a diagnostic, print out the parm - number and function decl if any. - - * errfn.c (cp_thing): Check atarg1 to determine whether or not we're - specifying a line, not atarg. - - * tree.c (build_cplus_method_type): Always make `this' const. - - * decl2.c (grokclassfn): If -fthis-is-variable and this function is - a constructor or destructor, make `this' non-const. - - * typeck.c (build_modify_expr): Don't warn specially about - assignment to `this' here anymore, since it will be caught by the - usual machinery. - - * various: Disallow specific GNU extensions (variable-size arrays, - etc.) when flag_ansi is set, not necessarily when pedantic is set, - so that people can compile with -pedantic-errors for tighter const - checking and such without losing desirable extensions. - - * typeck2.c (build_functional_cast): Call build_method_call with - LOOKUP_PROTECT. - (process_init_constructor): Only process FIELD_DECLs. - - * decl.c (finish_decl): Also force static consts with no explicit - initializer that need constructing into the data segment. - - * init.c (build_delete): Undo last patch, as it interferes with - automatic cleanups. - -Sat May 14 01:59:31 1994 Jason Merrill - - * call.c, class.h, cp-tree.h, cvt.c, decl2.c: Lose old overloading - code. - - * init.c (build_delete): pedwarn about using plain delete to delete - an array. - -Fri May 13 16:45:07 1994 Jason Merrill - - * typeck.c (comp_target_types): Be more helpful in contravariance - warnings, and make them pedwarns. - - * decl.c (grokdeclarator): Use decl_context to decide whether or not - this is an access declaration. - - * class.c (finish_struct_bits): Set TYPE_HAS_INT_CONVERSION if it - has a conversion to enum or bool, too. - -Fri May 13 16:31:27 1994 Mike Stump - - * method.c (emit_thunk): Make declaration for - current_call_is_indirect local (needed for hppa). - -Fri May 13 16:16:37 1994 Jason Merrill - - * pt.c (uses_template_parms): Grok BOOLEAN_TYPE. - (tsubst): Likewise. - -Fri May 13 16:23:32 1994 Mike Stump - - * pt.c (tsubst): If there is already a function for this expansion, - use it. - * pt.c (instantiate_template): Likewise. - -Fri May 13 10:30:42 1994 Brendan Kehoe - - * parse.y (implicitly_scoped_stmt, simple_stmt case): Use - kept_level_p for MARK_ENDS argument to expand_end_bindings, to avoid - generating debug info for unemitted symbols on some systems. - - * cp-tree.h (build_static_cast, build_reinterpret_cast, - build_const_cast): Add declarations. - -Fri May 13 09:50:31 1994 Mike Stump - - * search.c (expand_indirect_vtbls_init): Fix breakage from Apr 27 - fix. We now try get_binfo, and if that doesn't find what we want, - we go back to the old method, which still sometimes fails. - -Fri May 13 01:43:18 1994 Jason Merrill - - * parse.y (initdcl): Call cplus_decl_attributes on the right - variable. - * decl2.c (cplus_decl_attributes): Don't call decl_attributes for - void_type_node. - - * typeck.c (build_binary_op_nodefault): Change result_type for - comparison ops to bool. - (build_binary_op): Convert args of && and || to bool. - * cvt.c (build_default_binary_type_conversion): Convert args of && - and || to bool. - (build_default_unary_type_conversion): Convert arg of ! to bool. - (type_promotes_to): bool promotes to int. - -Fri May 13 01:43:18 1994 Mike Stump - - Implement the new builtin `bool' type. - * typeck.c (build_binary_op_nodefault): Convert args of && and || to - bool. - (build_unary_op): Convert arg of ! to bool. - * parse.y: Know true and false. Use bool_truthvalue_conversion. - * method.c (build_overload_value): Know bool. - (build_overload_name): Likewise. - * lex.c (init_lex): Set up RID_BOOL. - * gxx.gperf: Add bool, true, false. - * error.c (*): Know bool. - * decl.c (init_decl_processing): Set up bool, true, false. - * cvt.c (cp_convert): Handle conversion to bool. - (build_type_conversion): Likewise. - * *.c: Accept bool where integers and enums are accepted (use - INTEGRAL_CODE_P macro). - -Thu May 12 19:13:54 1994 Richard Earnshaw - - * g++.c: Use #ifdef for __MSDOS__, not #if. - -Thu May 12 18:05:18 1994 Mike Stump - - * decl2.c (lang_f_options): Handle -fshort-temps. -fshort-temps - gives old behavior , and destroys temporaries earlier. Default - behavior now conforms to the ANSI working paper. - -Thu May 12 14:45:35 1994 Jason Merrill - - * typeck.c (build_modify_expr): Understand MODIFY_EXPR as an lvalue. - Use convert_force to convert the result of a recursive call when we - are dealing with a NOP_EXPR. Don't automatically wrap MODIFY_EXPRs - in COMPOUND_EXPRs any more. - (various): Lose pedantic_lvalue_warning. - (unary_complex_lvalue): Understand MODIFY_EXPR. - - * cvt.c (convert_to_reference): Allow DECL to be error_mark_node if - we don't know what we're initializing. - -Wed May 11 01:59:36 1994 Jason Merrill - - * cvt.c (convert_to_reference): Modify to use convtype parameter. - Only create temporaries when initializing a reference, not when - casting. - (cp_convert): New main function. - (convert): Call cp_convert. - * cvt.c, decl.c, typeck.c: Fix calls to convert_to_reference. - * cp-tree.h (CONV_*): New constants used by conversion code for - selecting conversions to perform. - - * tree.c (lvalue_p): MODIFY_EXPRs are no longer lvalues. - - * typeck.c (build_{static,reinterpret,const_cast): Stubs that just - call build_c_cast. - * parse.y: Add {static,reinterpret,const}_cast. - * gxx.gperf: Likewise. - - * typeck.c (common_type): Allow methods with basetypes of different - UPTs. - (comptypes): Deal with UPTs. - (build_modify_expr): Wrap all MODIFY_EXPRs in a COMPOUND_EXPR. - - * pt.c (end_template_decl): Check for multiple definitions of member - templates. - - * call.c (build_method_call): Complain about calling an abstract - virtual from a constructor. - - * typeck.c (pointer_int_sum): Check for the integer operand being 0 - after checking the validity of the pointer operand. - - * typeck2.c (digest_init): Pedwarn about string initializer being - too long. - -Tue May 10 12:10:28 1994 Jason Merrill - - * decl.c (push_overloaded_decl): Only throw away a builtin if the - decl in question is the artificial one. - - * parse.y (simple_stmt, switch): Use implicitly_scoped_stmt because - expand_{start,end}_case cannot happen in the middle of a block. - - * cvt.c (build_type_conversion_1): Use convert again. - -Tue May 10 11:52:04 1994 Brendan Kehoe - - * typeck2.c (digest_init): Make sure we check for signed and - unsigned chars as well when warning about string initializers. - - * init.c (emit_base_init): Check if there's a DECL_NAME on the - member before trying to do an initialization for it. - -Tue May 10 11:34:37 1994 Mike Stump - - * except.c: Don't do anything useful when cross compiling. - -Tue May 10 03:04:13 1994 Jason Merrill - - * decl.c (duplicate_decls): Fix up handling of builtins yet again. - (push_overloaded_decl): Likewise. - - * cvt.c (convert): Don't look for void type conversion. - -Mon May 9 18:05:41 1994 Jason Merrill - - * init.c (do_friend): Only do a pushdecl for friends, not - pushdecl_top_level. - -Mon May 9 13:36:34 1994 Jim Wilson - - * decl.c (lookup_name_current_level): Put empty statement after - the label OUT to make the code valid C. - -Mon May 9 12:20:57 1994 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Only complain about - comparing void * and a function pointer if void * is smaller. - -Sun May 8 01:29:13 1994 Jason Merrill - - * decl.c (lookup_name_current_level): Move through temporary binding - levels. - - * parse.y (already_scoped_stmt): Revive. - (simple_stmt): Use it again. - - * decl.c (poplevel): Always call poplevel recursively if we're - dealing with a temporary binding level. - -Sat May 7 10:52:28 1994 Mike Stump - - * decl.c (finish_decl): Make sure we run cleanups for initial values - of decls. Cures memory leak. - * decl.c (expand_static_init): Likewise for static variables. - * decl2.c (finish_file): Likewise for globals. - -Sat May 7 03:57:44 1994 Jason Merrill - - * typeck.c (commonparms): Don't complain about redefining default - args. - - * decl.c (duplicate_decls): Don't complain twice about conflicting - function decls. - (decls_match): Don't look at default args. - (redeclaration_error_message): Complain about redefining default - args. - - * call.c (build_overload_call_real): Also deal with guiding - declarations coming BEFORE the template decl. - - * pt.c (unify): Allow different parms to have different - cv-qualifiers. - (unify): Allow trivial conversions on non-template parms. - -Fri May 6 03:53:23 1994 Jason Merrill - - * pt.c (tsubst): Support OFFSET_TYPEs. - (unify): Likewise. - - * decl2.c (finish_decl_parsing): Call push_nested_class with a type. - - * init.c (build_offset_ref): Fix error message. - * search.c (lookup_field): Likewise. - - * call.c (build_scoped_method_call): Pass binfo to - build_method_call. - * typeck.c (build_object_ref): Likewise. - - * typeck2.c (binfo_or_else): Don't return a _TYPE. - - * class.c (finish_struct): Don't complain about re-use of inherited - names or shadowing of type decls. - * decl.c (pushdecl_class_level): Likewise. - - * decl.c (finish_enum): Set the type of all the enums. - - * class.c (finish_struct): Don't get confused by access decls. - - * cp-tree.h (TYPE_MAIN_DECL): New macro to get the _DECL for a - _TYPE. You can stop using TYPE_NAME for that now. - - * parse.y: Lose doing_explicit (check $0 instead). - * gxx.gperf: 'template' now has a RID. - * lex.h (rid): Likewise. - * lex.c (init_lex): Set up the RID for 'template'. - - * parse.y (type_specifier_seq): typed_typespecs or - nonempty_type_quals. Use it. - (handler_args): Fix bogus syntax. - (raise_identifier{,s}, optional_identifier): Lose. - * except.c (expand_start_catch_block): Use grokdeclarator to parse - the catch variable. - (init_exception_processing): The second argument to - __throw_type_match is ptr_type_node. - - Fri May 6 07:18:54 1994 Chip Salzenberg - - [ change propagated from c-decl.c of snapshot 940429 ] - * cp/decl.c (finish_decl): Setting asmspec_tree should not - zero out the old RTL. - -Fri May 6 01:25:38 1994 Mike Stump - - Add alpha exception handling support to the compiler. - Quick and dirty backend in except.c. - - * cp/*: Remove most remnants of old exception handling support. - * decl.c (finish_function): Call expand_exception_blocks to put - the exception hanlding blocks at the end of the function. - * dec.c (hack_incomplete_structures): Make sure expand_decl_cleanup - comes after expand_decl_init. - * except.c: Reimplementation. - * expr.c (cplus_expand_expr): Handle THROW_EXPRs. - * lex.c (init_lex): Always have catch, try and throw be reserved - words, so that we may always parse exception handling. - * parse.y: Cleanup to support new interface into exception handling. - * tree.def (THROW_EXPR): Add. - -Thu May 5 17:35:37 1994 Jason Merrill - - * parse.y (simple_stmt, for loops): Use implicitly_scoped_stmt. - (various): Lose .kindof_pushlevel and partially_scoped_stmt. - -Thu May 5 16:17:27 1994 Kung Hsu - - * parse.y (already_scoped_stmt): Move expand_end_binding() to - fix the unmatched LBB/LBE in stabs. - -Thu May 5 14:36:17 1994 Jason Merrill - - * decl.c (set_nested_typename): Set TREE_MANGLED on the new - identifiers. - (pushdecl): Check TREE_MANGLED. - (xref_tag): Likewise. - * cp-tree.h (TREE_MANGLED): This identifier is a - DECL_NESTED_TYPENAME (named to allow for future use to denote - mangled function names as well). - - Implement inconsistency checking specified in [class.scope0]. - * decl.c (lookup_name_real): Don't set ICV here after all. - (finish_enum): Also set the type of the enumerators themselves. - (build_enumerator): Put the CONST_DECL in the list instead of its - initial value. - (pushdecl_class_level): Check inconsistent use of a name in the - class body. - * class.c (finish_struct): Check inconsistent use of a name in the - class body. Don't set DECL_CONTEXT on types here anymore. - * parse.y (qualified_type_name): Note that the identifier has now - been used (as a type) in the class body. - * lex.c (do_identifier): Note that the identifier has now been used - (as a constant) in the class body. - * error.c (dump_decl): Print type and enum decls better. - -Thu May 5 09:35:35 1994 Brendan Kehoe - - * typeck.c (build_modify_expr): Warn about assignment to `this'. - -Wed May 4 15:55:49 1994 Jason Merrill - - * init.c (build_delete): Use the global operator delete when - requested. - - * decl.c (lookup_name_real): If we find the type we're looking in a - base class while defining a class, set IDENTIFIER_CLASS_VALUE for - the type. - - * class.c (finish_struct): Remove a couple of dependencies on - language linkage. - - * decl.c (pushtag): Classes do nest in extern "C" blocks. - (pushdecl): Only set DECL_NESTED_TYPENAME on the canonical one for - the type. - (pushtag): Remove another dependency on the language linkage. - - * lex.c (cons_up_default_function): Don't set DECL_CLASS_CONTEXT to - a const-qualified type. - - * decl.c (push_overloaded_decl): Throw away built-in decls here. - (duplicate_decls): Instead of here. - -Wed May 4 15:27:40 1994 Per Bothner - - * typeck.c (get_member_function_from_ptrfunc): Do The Right - Thing (I hope) if we're using thunks. - -Wed May 4 13:52:38 1994 Jason Merrill - - * parse.y (specialization): aggr template_type_name ';'. - (named_class_head_sans_basetype): Use it. - (explicit_instantiation): Likewise. - (tmpl.2): Revert. - - * cvt.c (build_type_conversion_1): Use convert_for_initialization, - rather than convert, to do conversions after the UDC. - - * cp-tree.h (SHARED_MEMBER_P): This member is shared between all - instances of the class. - - * search.c (lookup_field): If the entity found by two routes is the - same, it's not ambiguous. - -Wed May 4 12:10:00 1994 Per Bothner - - * decl.c (lookup_name_real): Check for a NULL TREE_VALUE, - to prevent the compiler from crashing ... - -Wed May 4 11:19:45 1994 Jason Merrill - - * call.c (build_method_call): If we don't have an object, check - basetype_path to figure out where to look up the function. - - * typeck.c (convert_for_initialization): Pass TYPE_BINFO (type) to - build_method_call in case exp is NULL_TREE. - -Tue May 3 16:02:53 1994 Per Bothner - - Give a vtable entries a unique named type, for the sake of gdb. - * class.c (build_vtable_entry): The address of a thunk now has - type vtable_entry_type, not ptr_type_node. - * method.c (make_thunk): Fix type of THUNK_DECL. - * class.c (add_virtual_function, override_one_vtable): Use - vfunc_ptr_type_node, instead of ptr_type_node. - * cp-tree.h (vfunc_ptr_type_node): New macro. - * decl.c (init_decl_processing): Make vtable_entry_type - be a unique type of pointer to a unique function type. - -Tue May 3 09:20:44 1994 Jason Merrill - - * parse.y (do_explicit): Sets doing_explicit to 1. - (explicit_instantiation): Use do_explicit rather than TEMPLATE - directly, add "do_explicit error" rule. - (datadef): Set doing_explicit to 0 after an explicit instantiation. - (tmpl.2): Don't instantiate if we see a ';' unless we're doing an - explicit instantiation. - (named_class_head_sans_basetype): Remove aggr template_type_name - ';' again. - -Mon May 2 23:17:21 1994 Jason Merrill - - * search.c (lookup_nested_tag): Lose. - - * decl2.c (grokfield): Set DECL_CONTEXT on TYPE_DECLs. - (lookup_name_nonclass): Lose. - - * decl.c (poplevel_class): Add force parameter. - (lookup_name_real): Fix handling of explicit scoping which specifies - a class currently being defined. Add 'nonclass' argument. - (lookup_name, lookup_name_nonclass): Shells for lookup_name_real. - - * class.c (finish_struct): Don't unset IDENTIFIER_CLASS_VALUEs here. - (popclass): Force clearing of IDENTIFIER_CLASS_VALUEs if we're being - called from finish_struct. - -Mon May 2 19:06:21 1994 Per Bothner - - * decl.c (init_decl_processing), cp-tree.h: Removed memptr_type. - (It seeems redundant, given build_ptrmemfunc_type.) - * typeck.c (get_member_function_from_ptrfunc), gc.c (build_headof, - build_classof): Use vtable_entry_type instead of memptr_type. - * method.c (emit_thunk): Call poplevel with functionbody==0 - to prevent DECL_INITIAL being set to a BLOCK. - -Mon May 2 15:02:11 1994 Jason Merrill - - * parse.y (named_class_head_sans_basetype): Add "aggr - template_type_name ';'" rule for forward declaration of - specializations. - -Mon May 2 15:02:11 1994 Jason Merrill - - * class.c (instantiate_type): Deal with pmf's. - - * Make-lang.in (cc1plus): Don't depend on OBJS or BC_OBJS, since - stamp-objlist does. - - * Makefile.in (../cc1plus): Depend on OBJDEPS. - (OBJDEPS): Dependency version of OBJS. - -Mon May 2 12:51:31 1994 Kung Hsu - - * search.c (dfs_debug_mark): Unmark TYPE_DECL_SUPPRESS_DEBUG, not - DECL_IGNORED_P. - -Fri Apr 29 12:29:56 1994 Jason Merrill - - * class.c (finish_struct): Clear out memory of local tags. And - typedefs. - - * decl2.c (grokclassfn): Don't set DECL_CONTEXT to a cv-qualified - type. - * search.c (get_matching_virtual): Be more helpful in error message. - - * *: Use DECL_ARTIFICIAL (renamed from DECL_SYNTHESIZED). - - * lex.c (default_assign_ref_body): Expect TYPE_NESTED_NAME to work. - (default_copy_constructor_body): Likewise. - - * class.c (finish_struct): Don't gratuitously create multiple decls - for nested classes. - -Thu Apr 28 23:39:38 1994 Jason Merrill - - Avoid clobbering the arg types of other functions when reverting - static member functions. - * decl.c (revert_static_member_fn): Rearrange arguments, don't - require values for 'fn' and 'argtypes', add warning to comment - above. - (decls_match): Rearrange arguments in call to rsmf. - (grok_op_properties): Don't pass values for fn and argtypes. - * pt.c (instantiate_template): Don't pass values for fn and argtypes. - -Thu Apr 28 16:29:11 1994 Doug Evans - - * Make-lang.in (cc1plus): Depend on stamp-objlist. - * Makefile.in (BC_OBJS): Delete. - (OBJS): Cat ../stamp-objlist to get language independent files. - Include ../c-common.o. - (../cc1plus): Delete reference to BC_OBJS. - -Thu Apr 28 02:12:08 1994 Jason Merrill - - * search.c (compute_access): No really, deal with static members - properly. Would I lie to you? - - Implement lexical hiding of function declarations. - * pt.c (tsubst): Use lookup_name to look for function decls to guide - instantiation. - * method.c (build_opfncall): Use lookup_name_nonclass to look for - non-member functions. - * init.c (do_friend): Use lookup_name_nonclass to look for - functions. - * error.c (ident_fndecl): Use lookup_name to look for functions. - * decl2.c (lookup_name_nonclass): New function, skips over - CLASS_VALUE. - * decl.c (struct binding_level): Lose overloads_shadowed field. - (poplevel): Don't deal with overloads_shadowed. - (push_overloaded_decl): Do lexical hiding for functions. - * class.c (instantiate_type): Don't check non-members if we have - members with the same name. - * call.c (build_method_call): Use lookup_name_nonclass instead of - IDENTIFIER_GLOBAL_VALUE to check for non-member functions. - (build_overload_call_real): Likewise. - - * decl.c (duplicate_decls): Check for ambiguous overloads here. - (push_overloaded_decl): Instead of here. - - * decl.c (pushdecl): Back out Chip's last change. - - * decl.c (grok_op_properties): Operators cannot be static members. - - * cp-tree.h (DECL_SYNTHESIZED): DECL_SOURCE_LINE == 0 - (SET_DECL_SYNTHESIZED): DECL_SOURCE_LINE = 0 - * lex.c (cons_up_default_function): Use SET_DECL_SYNTHESIZED. - - * method.c (do_inline_function_hair): Don't put friends of local - classes into global scope, either. - - * typeck2.c (build_functional_cast): Don't look for a function call - interpretation. - -Thu Apr 28 15:19:46 1994 Mike Stump - - * cp-tree.h: Disable use of backend EH. - -Wed Apr 27 21:01:24 1994 Doug Evans - - * Make-lang.in (c++.distdir): mkdir tmp/cp first. - * Makefile.in (INCLUDES): Move definition to same place as - parent makefile. - (ALLOCA): Define. - (OLDAR_FLAGS): Delete. - (OLDCC): Define. - (DIR): Delete. - (CLIB): Define. - (####site): Delete. - (SUBDIR_USE_ALLOCA): Don't use ALLOCA if compiling with gcc. - -Wed Apr 27 19:10:04 1994 Kung Hsu - - * decl.c (xref_tag): Not to use strstr(), it's not available on - all platforms. - -Wed Apr 27 18:10:12 1994 Jason Merrill - - * class.c (finish_struct): Resolve yet another class/pmf confusion. - - * call.c (build_overload_call_real): Don't take the single-function - shortcut if we're dealing with an overloaded operator. - -Wed Apr 27 17:35:37 1994 Mike Stump - - * search.c (get_base_distance): Search the virtual base class - binfos, incase someone wants to convert to a real virtual base - class. - * search.c (expand_indirect_vtbls_init): Use convert_pointer_to_real - instead of convert_pointer_to, as it now will work. - -Wed Apr 27 15:36:49 1994 Jason Merrill - - * cvt.c (convert_to_reference): Don't complain about casting away - const and volatile. - - * typeck.c (build_unary_op): References are too lvalues. - -Wed Apr 27 13:58:05 1994 Mike Stump - - * class.c (override_one_vtable): We have to prepare_fresh_vtable - before we modify it, not after, also, we cannot reuse an old vtable, - once we commit to a new vtable. Implement ambiguous overrides in - virtual bases as abstract. Hack until we make the class - ill-formed. - -Wed Apr 27 01:17:08 1994 Jason Merrill - - * parse.y (unary_expr): Expand new_placement[opt] and - new_initializer[opt] inline. - - * search.c (lookup_fnfields): Don't throw away the inheritance - information here, either. - (compute_access): Handle static members properly. - - * init.c (build_member_call): Always set basetype_path, and pass it - to lookup_fnfields. - - * search.c (lookup_field): Deal properly with the case where - xbasetype is a chain of binfos; don't throw away the inheritance - information. - (compute_access): protected_ok always starts out at 0. - - * init.c (resolve_offset_ref): Don't cast `this' to the base type - until we've got our basetype_path. - - * cp-tree.h (IS_OVERLOAD_TYPE): aggregate or enum. - - * cvt.c (build_up_reference): Use build_pointer_type rather than - TYPE_POINTER_TO. - - * call.c (convert_harshness_ansi): Call type_promotes_to for reals - as well. - - * cvt.c (type_promotes_to): Retain const and volatile, add - float->double promotion. - - * decl.c (grokdeclarator): Don't bash references to arrays into - references to pointers in function parms. Use type_promotes_to. - -Tue Apr 26 23:44:36 1994 Mike Stump - - Finish off Apr 19th work. - - * class.c (finish_struct_bits): Rename has_abstract_virtuals to - might_have_abstract_virtuals. - * class.c (strictly_overrides, override_one_vtable, - merge_overrides): New routines to handle virtual base overrides. - * class.c (finish_struct): Call merge_overrides to handle overrides - in virtual bases. - -Tue Apr 26 12:45:53 1994 Jason Merrill - - * typeck.c (build_function_call): Call build_function_call_real with - LOOKUP_NORMAL. - - * *: Don't deal with TYPE_EXPRs. - - * tree.c (lvalue_p): If the type of the expression is a reference, - it's an lvalue. - - * cvt.c (convert_to_reference): Complain about passing const - lvalues to non-const references. - (convert_from_reference): Don't arbitrarily throw away const and - volatile on the target type. - - * parse.y: Simplify and fix rules for `new'. - - * decl.c (grok_op_properties): operator void is illegal. - -Mon Apr 25 02:36:28 1994 Jason Merrill - - * parse.y (components): Anonymous bitfields can still have declspecs. - - * decl.c (pushdecl): Postpone handling of function templates like we - do C functions. - - * search.c (expand_indirect_vtbls_init): Fix infinite loop when - convert_pointer_to fails. - - * call.c (compute_conversion_costs_ansi): A user-defined conversion - by itself is better than that UDC followed by standard conversions. - Don't treat integers and reals specially. - - * cp-tree.h: Declare flag_ansi. - - * typeck.c (c_expand_return): pedwarn on return in void function - even if the expression is of type void. - (build_c_cast): Don't do as much checking for casts to void. - (build_modify_expr): pedwarn about array assignment if this code - wasn't generated by the compiler. - - * tree.c (lvalue_p): A comma expression is an lvalue if its second - operand is. - - * typeck.c (default_conversion): Move code for promoting enums and - ints from here. - * cvt.c (type_promotes_to): To here. - * call.c (convert_harshness_ansi): Use type_promotes_to. Also fix - promotion semantics for reals. - -Sun Apr 24 16:52:51 1994 Doug Evans - - * Make-lang.in (c++.install-common): Check for g++-cross. - * Makefile.in: Remove Cygnus cruft. - (config.status): Delete. - (RTL_H): Define. - (TREE_H): Use complete pathname, some native makes have minimal - VPATH support. - (*.o): Use complete pathname to headers in parent dir. - (doc, info, dvi): Delete. - -Sun Apr 24 16:52:51 1994 Doug Evans - - * Make-lang.in (c++.install-common): Check for g++-cross. - * Makefile.in: Remove Cygnus cruft. - (config.status): Delete. - (RTL_H): Define. - (TREE_H): Use complete pathname, some native makes have minimal - VPATH support. - (*.o): Use complete pathname to headers in parent dir. - (doc, info, dvi): Delete. - -Sun Apr 24 00:47:49 1994 Jason Merrill - - * decl.c (pushdecl): Avoid redundant warning on redeclaring function - with different return type. - (decls_match): Compare return types strictly. - -Fri Apr 22 12:55:42 1994 Jason Merrill - - * cvt.c (build_type_conversion): Do try to convert through other - pointers. This will fail if the class defines multiple pointer - conversions. - - * error.c (dump_type_prefix): Print out pointers to arrays properly. - (dump_type_suffix): Likewise. (was 'int *[]', now 'int (*)[]') - - * typeck.c (build_unary_op): Disallow ++/-- on pointers to - incomplete type. - - * decl.c (duplicate_decls): Check mismatched TREE_CODES after - checking for shadowing a builtin. If we're redeclaring a builtin - function, bash the old decl to avoid an ambiguous overload. - - * cvt.c (convert_to_reference): Don't force arrays to decay here. - - * tree.c (lvalue_p): A MODIFY_EXPR is an lvalue. - - * decl.c (duplicate_decls): Don't assume that the decls will have - types. - - Mon Apr 18 11:35:32 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940318 snapshot ] - * c-decl.c (pushdecl): Warn if type mismatch with another external decl - in a global scope. - - Fri Apr 22 06:38:56 1994 Chip Salzenberg - - * cp/typeck2.c (signature_error): Use cp_error for "%T". - - Mon Apr 18 11:59:59 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940415 snapshot ] - * cp/decl.c (duplicate_decls, pushdecl, builtin_function): - Use DECL_FUNCTION_CODE instead of DECL_SET_FUNCTION_CODE. - - Mon Apr 18 11:55:18 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940409 snapshot ] - * cp/decl.c (duplicate_decls): Put new type in same obstack as - old ones, or permanent if old ones in different obstacks. - - Mon Apr 18 11:48:49 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940401 snapshot ] - * cp/parse.y (attrib): Handle string args as expressions, - merging the two rules. `mode' attribute now takes a string arg. - Delete the rule for an identifier as arg. - - Mon Apr 18 11:24:00 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940312 snapshot ] - * cp/typeck.c (pointer_int_sum): Multiplication should be done signed. - (pointer_diff): Likewise the division. - - Sun Mar 6 19:43:39 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940304 snapshot ] - * cp/decl.c (finish_decl): Issue warning for large objects, - if requested. - - Sat Feb 19 22:20:32 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940218 snapshot ] - * cp/parse.y (attrib): Handle attribute ((section ("string"))). - * cp/decl.c (duplicate_decls): Merge section name into new decl. - - Tue Feb 8 09:49:17 1994 Chip Salzenberg - - [ cp/* changes propagated from c-* changes in 940206 snapshot ] - * cp/typeck.c (signed_or_unsigned_type): Check for any - INTEGRAL_TYPE_P not just INTEGER_TYPE. - - Mon Dec 6 13:35:31 1993 Norbert Kiesel - - * cp/decl.c (finish_enum): Start from 0 when determining precision - for short enums. - - Fri Dec 3 17:07:58 1993 Ralph Campbell - - * cp/parse.y (unary_expr): Look at $1 for tree_code rather than - casting $$. - - Wed Nov 17 19:22:09 1993 Chip Salzenberg - - * cp/typeck.c (build_binary_op_nodefault): Propagate code - from C front-end to optimize unsigned short division. - (build_conditional_expr): Fix bug in "1 ? 42 : (void *) 8". - - Wed Nov 17 19:17:18 1993 Chip Salzenberg - - * cp/call.c (convert_harshness_ansi): Given an (e.g.) char - constant, prefer 'const char &' to 'int'. - - Wed Feb 3 13:11:48 1993 Chip Salzenberg - - * cp/class.c (finish_struct_methods): Handle multiple - constructors in fn_fields list. - -Fri Apr 22 12:48:10 1994 Kung Hsu - - * class.c (finish_struct): Use TYPE_DECL_SUPPRESS_DEBUG to flag - types not to be dumped in stabs, like types in #pragma interface. - * decl.c (init_decl_processing): Use TYPE_DECL_SUPPRESS_DEBUG to - mark unknown type. - -Fri Apr 22 03:27:26 1994 Doug Evans - - * Language directory reorganization. - See parent makefile. - -Thu Apr 21 18:27:57 1994 Per Bothner - - * cp-tree.h (THUNK_DELTA): It is normally negative, so - use signed .i variant of frame_size rather than unsigned .u. - * cp-tree.h (VTABLE_NAME_FORMAT): If flag_vtable_thunks, - use "VT" rather than "vt" due to binary incompatibility. - * class.c (get_vtable_name): Use strlen of VTABLE_NAME_FORMAT, - rather than sizeof, since it is now an expression. - * class.c (modify_one_vtable): Modify to skip initial element - containing a count of the vtable. - -Thu Apr 21 00:09:02 1994 Jason Merrill - - * lex.c (check_newline): Force interface_unknown on main input file. - - * pt.c (do_pending_expansions): Always emit functions that have been - explicitly instantiated. - (do_function_instantiation): Set DECL_EXPLICITLY_INSTANTIATED. - (do_type_instantiation): Set CLASSTYPE_VTABLE_NEEDS_WRITING and - DECL_EXPLICITLY_INSTANTIATED on all my methods. - * parse.y (explicit_instantiation): Call do_type_instantiation for - types. - * decl2.c (finish_vtable_vardecl): Call import_export_vtable. - * decl.c (start_function): Don't set DECL_EXTERNAL on a function - that has been explicitly instantiated. - * cp-tree.h (DECL_EXPLICITLY_INSTANTIATED): Alias for - DECL_LANG_FLAG_4. - * class.c: Move import_export_vtable to decl2.c, and comment out all - uses. - -Wed Apr 20 16:51:06 1994 Jason Merrill - - * lex.c (process_next_inline): Don't muck with DECL_INLINE. - (do_pending_inlines): Likewise. - -Tue Apr 19 22:25:41 1994 Mike Stump - - Reimplement vtable building, and most vtable pointer setting. - Allows for earier maintenance, easier understandability, and most - importantly, correct semantics. - - * class.c (build_vtable): Removed unneeded - SET_BINFO_VTABLE_PATH_MARKED. - * class.c (prepare_fresh_vtable): Likewise. Added argument. - * class.c (modify_vtable_entry): General cleanup. - * class.c (related_vslot, is_normal, modify_other_vtable_entries, - modify_vtable_entries): Removed. - * class.c (add_virtual_function): General cleanup. - * class.c (finish_base_struct): Setup BINFO_VTABLE and - BINFO_VIRTUALS as early as we can, so that modify_all_vtables can - work. - * class.c (finish_vtbls): New routine, mostly from - unmark_finished_struct. - * class.c (overrides): New routine. - * class.c (modify_one_vtable): New routine, mostly from - modify_other_vtable_entries and modify_vtable_entries. - * class.c (modify_all_direct_vtables, modify_all_indirect_vtables, - modify_all_vtables): New routines. - * class.c (finish_struct): Added arguemnt to prepare_fresh_vtable - call. General cleanup on how pending_hard_virtuals are handled. - General cleanup on modifying vtables. Use finish_vtbls, instead of - unmark_finished_struct. - * cp-tree.h (init_vtbl_ptrs, expand_direct_vtbls_init, - get_first_matching_virtual, get_matching_virtual, - expand_vbase_vtables_init, expand_indirect_vtbls_init): Update. - * cvt.c (convert_pointer_to_real): Cleanup error message. - * decl.c (grokfndecl): General cleanup. - * decl.c (finish_function): Change init_vtbl_ptrs call to - expand_direct_vtbls_init. Change expand_vbase_vtables_init call to - expand_indirect_vtbls_init. - * init.c (expand_virtual_init): Remove unneeded argument. - * init.c (init_vtbl_ptrs): Rename to expand_direct_vtbls_init, added - two arguments to make more general. Made more general. Now can be - used for vtable pointer initialization from virtual bases. - * init.c (emit_base_init): Change expand_vbase_vtables_init call to - expand_indirect_vtbls_init. Change init_vtbl_ptrs call to - expand_direct_vtbls_init. - * init.c (expand_virtual_init): General cleanup. - * init.c (expand_default_init): Change expand_vbase_vtables_init - call to expand_indirect_vtbls_init. - * init.c (expand_recursive_init_1): Change expand_vbase_vtables_init - call to expand_indirect_vtbls_init. - * init.c (expand_recursive_init): Change expand_vbase_vtables_init - call to expand_indirect_vtbls_init. - * search.c (get_first_matching_virtual): Rename to - get_matching_virtual. General cleanup and remove setting of - DECL_CONTEXT. That is now done in a cleaner way in - modify_vtable_entry and add_virtual_function. - * search.c (expand_vbase_vtables_init): Rename to - expand_indirect_vtbls_init. General cleanup. Use - expand_direct_vtbls_init to do hard work. Ensures that _all_ vtable - pointers from virtual bases are set up. - * search.c (bfs_unmark_finished_struct, unmark_finished_struct): - Removed. - - * *.[chy]: Remove support for VTABLE_USES_MASK. - -Tue Apr 19 12:51:59 1994 Jason Merrill - - * cvt.c (convert_to_reference): Use NOP_EXPRs to switch between - reference and pointer types instead of bashing the types directly. - - * call.c (build_overload_call_real): Use the TREE_CODE to determine - whether the function is overloaded or not, rather than - TREE_OVERLOADED. - * *: Remove all uses of TREE_OVERLOADED. - - * decl.c (grokdeclarator): Only complain about initializing const - fields when -ansi or -pedantic. - -Tue Apr 19 12:42:42 1994 Doug Evans - - * cp-tree.h (THUNK_DELTA): frame_size is now a union. - -Mon Apr 18 00:17:13 1994 Jason Merrill - - Do overloading on a block-by-block basis, not function-by-function. - * decl.c: Lose overloads_to_forget. - (struct binding_level): Add overloads_shadowed field. - (poplevel): Restore overloads_shadowed. - (push_overloaded_decl): Use overloads_shadowed instead of - overloads_to_forget. - (finish_function): Don't look at overloads_to_forget. - - Copy enum_overflow logic from c-decl.c. - * decl.c (start_enum): Initialize enum_overflow. - (build_enumerator): Use enum_overflow. Also use current_scope(). - - * search.c (current_scope): Move Brendan's comment from - build_enumerator here. - - * typeck.c (convert_for_assignment): Change warnings to pedwarns for - discarding const/volatile. - -Sat Apr 16 01:18:21 1994 Jason Merrill - - * typeck.c (comp_target_parms): Accept TEMPLATE_TYPE_PARMs on the rhs. - (comp_target_types): Likewise. - - * decl.c (lookup_name): Don't unset got_scope here. - - * spew.c (yylex): Only replace yylval with the TYPE_NESTED_NAME if - got_scope != NULL_TREE. - -Fri Apr 15 16:36:33 1994 Jason Merrill - - Horrible kludge to prevent templates from being instantiated by - their base classes. - * parse.y (template_instantiate_once): Unset TYPE_BEING_DEFINED - before we get to left_curly. - * pt.c (instantiate_class_template): Set TYPE_BEING_DEFINED. - - * error.c (dump_decl): If it's a typedef, print out the name of the - decl, not just the underlying type. - - * decl.c (pushdecl): If the old duplicate decl was a TYPE_DECL, - update the IDENTIFIER_TYPE_VALUE of its name. - - * decl2.c (finish_file): When processing the initializer for a - static member, pretend that the dummy function is a member of the - same class. - -Fri Apr 15 15:56:35 1994 Kung Hsu - - * class.c (build_vtable_entry): Revert Apr 4 change. - * decl2.c (mark_vtable_entries): Replace pure virtual function - decl with abort's. - -Fri Apr 15 13:49:33 1994 Jason Merrill - - * typeck.c (build_conditional_expr): Pedwarn on pointer/integer - mismatch, and don't pedwarn on 0/function pointer mismatch. - - * typeck2.c (digest_init): Lose code for special handling of unions. - (process_init_constructor): Since they're handled just fine here. - Pedwarn on excess elements. - - * decl2.c (grokfield): Complain about local class method declaration - without definition. - -Fri Apr 15 13:19:40 1994 Per Bothner - - * method.c (emit_thunk): Add extern declaration for - current_call_is_indirect (needed for hppa). - -Thu Apr 14 16:12:31 1994 Jason Merrill - - Improve local class support; allow classes in different blocks to - have the same name. - * decl.c (pushtag): Support local classes better. - (pushdecl_nonclass_level): New function for pushing mangled decls of - nested types into the appropriate scope. - (xref_defn_tag): Use pushdecl_nonclass_level instead of - pushdecl_top_level. - (grokfndecl): Don't mess with IDENTIFIER_GLOBAL_VALUE for local - class methods. - * method.c (do_inline_function_hair): Likewise. - - * class.c (finish_struct): It is legal for a class with no - constructors to have nonstatic const and reference members. - -Thu Apr 14 07:15:11 1994 Brendan Kehoe - - * decl.c (push_overloaded_decl): Avoid giving errors about - built-ins, since duplicate_decls will have given warnings/errors - for them. - -Thu Apr 14 03:45:12 1994 Jason Merrill - - * cvt.c (convert_to_reference): Warn about casting pointer type to - reference type when this is probably not what they wanted. - -Wed Apr 13 13:12:35 1994 Per Bothner - - * decl.c (finish_decl): Don't mindlessly set TREE_USED for - static consts any more (toplev.c has now been modified to - not emit warnings if they are unused). - -Wed Apr 13 00:22:35 1994 Jason Merrill - - * decl.c (grok_op_properties): If op new/delete get here with - METHOD_TYPEs, do a revert_static_member_fn. - - * cp-tree.h (IDENTIFIER_CLASS_TYPE_VALUE): Lose. - * init.c (is_aggr_typedef): Don't look at - IDENTIFIER_CLASS_TYPE_VALUE. - (get_aggr_from_typedef): Likewise. - (get_type_value): Likewise. - * call.c (build_scoped_method_call): Don't rely on overloaded - template names having IDENTIFIER_CLASS_VALUE set. - - * parse.y (component_decl_1, fn.def2): Revert rules for - constructors. - (component_decl_1, fn.def2): Use $1 instead of $$, since $$ is being - clobbered. - - * decl.c (start_function): Only warn about `void main()' if pedantic - || warn_return_type. - -Tue Apr 12 02:14:17 1994 Jason Merrill - - Clean up overloading of the template name. - * class.c (pushclass): Overload the template name whenever pushing - into the scope of a template class, not just if it is - uninstantiated. - (popclass): Correspondingly. - * search.c (push_class_decls): Don't overload_template_name. - * pt.c (overload_template_name): Don't set IDENTIFIER_LOCAL_VALUE or - DECL_CONTEXT on things. - * parse.y (left_curly): Don't overload_template_name. - * class.c (finish_struct): Don't undo_template_name_overload. - - * method.c (build_opfncall): Only pass one argument to global op - delete. - - * call.c (build_method_call): Use TYPE_VEC_DELETE_TAKES_SIZE to - decide how many arguments to use for vec delete. - - * decl.c (grok_op_properties): Be consistent in modifying - current_class_type. - (grokdeclarator): Only complain about function decls with no return - type if we're being pedantic. - -Mon Apr 11 00:10:53 1994 Jason Merrill - - Add support for operator new [] and operator delete []. - - * tree.def: Add VEC_NEW_EXPR and VEC_DELETE_EXPR. - * ptree.c (print_lang_type): Indicate vec new/delete. - * parse.y: Support vec new/delete. - * method.c (build_decl_overload): Deal with vec new/delete. - (build_opfncall): Likewise. - * lex.c (init_lex): Set up values of ansi_opname and opname_tab for - vec new/delete. vec new uses "__vn", and vec delete uses "__vd". - * init.c (init_init_processing): Set up BIVN and BIVD. - (do_friend): Don't clean up after mistaken setting of TREE_GETS_NEW, - since it doesn't happen any more. - (build_new): Support vec new. Always call something. - (build_x_delete): Support vec delete. - (build_vec_delete): Lose dtor_dummy argument, add use_global_delete, - and pass it to build_x_delete. - * decl2.c (delete_sanity): Don't change behavior by whether or not - the type has a destructor. Pass use_global_delete to - build_vec_delete. - (coerce_delete_type): Make sure that the type returned has a first - argument of ptr_type_node. - * decl.c (init_decl_processing): Also declare the global vec - new/delete. - (grokdeclarator): Also force vec new/delete to be static. - (grok_op_properties): Note presence of vec new/delete, and play with - their args. If vec delete takes the optional size_t argument, set - TYPE_VEC_DELETE_TAKES_SIZE. - * cp-tree.h (TYPE_GETS_{REG,VEC}_DELETE): New macros to simplify - checking for one delete or the other. - (lang_type): gets_new and gets_delete are now two bits long. The - low bit is for the non-array version. Lose gets_placed_new. - (TYPE_VEC_DELETE_TAKES_SIZE): New macro indicating that the vec - delete defined by this class wants to know how much space it is - deleting. - (TYPE_VEC_NEW_USES_COOKIE): New macro to indicate when vec new must - add a header containing the number of elements in the vector; i.e. - when the elements need to be destroyed or vec delete wants to know - the size. - * class.c (finish_struct_methods): Also check for overloading vec - delete. - * call.c (build_method_call): Also delete second argument for vec - delete. - - * decl.c (grokdeclarator): Correct complaints again. - (grokdeclarator): Fix segfault on null declarator. - (decls_match): Also accept redeclaration with no arguments if both - declarations were in C context. Bash TREE_TYPE (newdecl) here. - (duplicate_decls): Instead of here. - - * parse.y (nested_name_specifier_1): Lose rules for dealing with - syntax errors nicely, since they break parsing of 'const i;'. - - * decl.c (lookup_name): if (got_scope == current_class_type) - val = IDENTIFIER_CLASS_VALUE (name). - - * search.c (lookup_nested_tag): Look in enclosing classes, too. - - * spew.c (yylex): Only look one character ahead when checking for a - SCOPE. - - * lex.c (check_newline): Read first nonwhite char before - incrementing lineno. - - * decl.c (grokdeclarator): Don't claim that typedefs are variables - in warning. - - * parse.y: Divide up uses of unqualified_id into - notype_unqualified_id and unqualified_id, so that TYPENAME can be - used as an identifier after an object. - - * class.c (push_nested_class): Don't push into non-class scope. - - * decl.c (grokdeclarator): If an identifier could be a type - conversion operator, but has no associated type, it's not a type - conversion operator. - - * pt.c (unify): Check for equality of constants better. - - * decl.c (grokdeclarator): Don't complain about access decls. - -Sun Apr 10 02:39:55 1994 Jason Merrill - - * decl.c (grokdeclarator): pedwarn about data definitions without - types here. - - * parse.y (datadef): Don't pedwarn about decls without types here, - since that is valid for functions. - (fn.def2, component_decl): Support constructors with declmods again. - (nomods_initdecls): For decls without any mods, so that we don't try - to get declspecs from some arbitrary $0. - - * search.c (lookup_field): Use cp_error. - - * parse.y (nested_name_specifier_1): Don't check aggr/non-aggr type - here; it breaks destructors for non-aggr types. - - * decl.c (lookup_name): Only look for TYPE_DECLs in base classes of - a type being defined, like the comment says. - If got_scope is not an aggregate, just return NULL_TREE. - - * pt.c (create_nested_upt): Kung's code for creating types nested - within uninstantiated templates now lives here (it used to live in - hack_more_ids). It needs to be expanded. - - * parse.y: Stop calling see_typename so much. - - * decl.c (lookup_name): Deal with TTPs and UPTs. - - * lex.c (real_yylex): Don't set looking_for_typename just because we - saw a 'new'. - (dont_see_typename): #if 0 out. - - * spew.c (yylex): Increment looking_for_typename if the next - character is SCOPE, rather than setting it to 1; this way, the value - from seeing an aggr specifier will not be lost. This kinda relies - on looking_for_typename never being < 0, which is now true. - - * parse.y (nested_name_specifier_1): Accept TEMPLATE_TYPE_PARMs, - too. - (named_class_head_sans_basetype): Accept template types, too. Oops. - -Fri Apr 8 16:39:35 1994 Jason Merrill - - * decl2.c (reparse_decl_as_expr1): Handle SCOPE_REFs. - - * parse.y: Lose START_DECLARATOR. - - * search.c (lookup_nested_tag): New function to scan CLASSTYPE_TAGS - for a class. - - * parse.y: Simplify fn.def2 and component_decl. Support 'enum - A::foo' syntax. Catch invalid scopes better. - - * parse.y, lex.c: Lose TYPENAME_COLON. - - * decl2.c (groktypefield): #if 0 out. - - * decl.c (lookup_name): If the type denoted by got_scope is - currently being defined, look in CLASSTYPE_TAGS rather than FIELDS. - - * class.c (push_nested_class): Don't try to push into - error_mark_node. - -Fri Apr 8 07:26:36 1994 Brendan Kehoe - - * Makefile.in (stamp-parse): Update count of conflicts to 33. - -Thu Apr 7 17:47:53 1994 Jason Merrill - - A saner implementation of nested types that treats template types - no differently from non-template types. There are still some - shortcomings of our system; most notably, it is difficult to look - for a nested type that is hidden by another name, because of the way - we keep track of hidden types. But this shouldn't be a problem for - just about anyone. Perhaps lookup_field should be fixed up a bit. - - * spew.c: Moved handling of nested types/scoping from the lexer - into the parser. Removed variable template_type_seen_before_scope. - Removed functions frob_identifier, hack_more_ids, and various cruft - that was #if 0'd out in the past, reducing the size of the file from - 1146 lines to 450 lines. We can't quite do away with spew.c yet, - though; we still need it for do_aggr () and checking for SCOPE after - the current identifier. And setting lastiddecl. - - * parse.y: Moved handling of nested types/scoping from the lexer - into the parser, using a new global variable `got_scope'. Reduced - the number of states by 53. Implemented all uses of explicit global - scope. Removed terminals SCOPED_TYPENAME and SCOPED_NAME. Removed - nonterminals tmpl.1, scoped_base_class, id_scope, typename_scope, - scoped_typename. Added nonterminals nested_type, - qualified_type_name, complete_type_name, qualified_id, ptr_to_mem, - nested_name_specifier, global_scope, overqualified_id, type_name. - Changed many others. Added 9 new reduce/reduce conflicts, which are - nested type parallels of 9 that were already in the grammar for - non-nested types. Eight of the now 33 conflicts should be removed - in the process of resolving the late binding between variable and - function decls. - - * gxxint.texi (Parser): Update. - - * cp-tree.h (IS_AGGR_TYPE_CODE): Add UNINSTANTIATED_P_TYPE. - - * lex.h: Add decl for got_scope. - - * lex.c (see_typename): Claim to be the lexer when calling - lookup_name. - - * decl.c (lookup_name): When called from the lexer, look at - got_scope and looking_at_typename; otherwise don't. - -Thu Apr 7 22:05:47 1994 Mike Stump - - 31th Cygnus<->FSF merge. - -Thu Apr 7 17:47:53 1994 Jason Merrill - - * decl2.c (mark_vtable_entries): Call this to mark all the - entries in the vtable addressable. - (finish_decl_parsing): Handle SCOPE_REFs. - - * decl.c (decls_match): Always call compparms with strict == 1. - Handle the special case of C function redecl here. - (duplicate_decls): Only keep the old type if the new decl takes no - arguments. - - * typeck.c (compparms): Also allow t1 to be ... if strict == 0. - -Thu Apr 7 16:17:50 1994 Mike Stump - - * class.c (build_vtable_entry): Fix breakage introduced Apr 5 - 17:48:41. - -Wed Apr 6 16:05:10 1994 Per Bothner - - * init.c (build_virtual_init), search.c (build_vbase_vtables_init), - ch-tree.h: Every place these functions were called, the result was - immediately passed to expand_expr_stmt. Reduce redundancy by - calling expand_expr_init *inside* these functions. These - makes for a simpler interface, and we don't have to build - compound expressions. Hence, rename these function to: - expand_virtual_init and expand_vbase_vtables_init respectively. - * init.c, decl.c: Change callers of these functions. - * init.c, cp-tree.h (expand_virtual_init): Make static. - - * decl2.c (finish_file): Check TREE_PUBLIC||TREE_ADDRESSABLE - rather than DECL_SAVED_INSNS before emitting inlines. - -Wed Apr 6 13:06:39 1994 Jason Merrill - - * spew.c (init_spew): #if 0 out stuff used by arbitrate_lookup. - - * decl.c (duplicate_decls): If this is a new declaration of an - extern "C" function, keep the type (for the argtypes). - (redeclaration_error_message): Don't check DECL_LANGUAGE here. - (decls_match): Call compparms with a value of strict dependent on - the value of strict_prototypes for DECL_LANGUAGE (oldecl). - - * typeck.c (compparms): ... is only equivalent to non-promoting - parms if we're not being strict. - - * parse.y (empty_parms): Don't check flag_ansi || pedantic here. - - * decl.c (init_decl_processing): if (flag_ansi || pedantic) - strict_prototypes_lang_c = strict_prototypes_lang_cplusplus; - - * decl2.c (grok_function_init): Don't set DECL_INITIAL on pure - virtuals. - -Tue Apr 5 17:48:41 1994 Per Bothner - - Support for implementing vtables with thunks. - * tree.def (THUNK_DECL): New TREE_CODE. - * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY), tree.c - (fnaddr_from_vtable_entry): Handle flag_vtable_thunks case. - * cp-tree.h (memptr_type): New variable. - * class.c (build_vtable_entry): Build thunk if necessary. - * class.c (build_vfn_ref): If using thunks, don't need - to add delta field from vtable (there is none!). - * decl.c: Add memptr_type as well as vtable_entry_type. - If using thunks, the latter is just ptr_type_node. - * gc.c, typeck.c: Use memptr_typeChange, not vtable_entry_type. - * decl2.c (finish_vtable_vardecl): Handle thunks. - * expr.c (cplus_expand_expr): Support THUNK_DECL. - - * decl.c (grokdeclarator): Set DECL_THIS_EXTERN if "extern". - * decl.c (start_function): Set current_extern_inline based on - DECL_THIS_EXTERN, not TREE_PUBLIC. - * decl.c (finish_function): Call mark_inline_for_output if needed, - - Improve intelligence about when to emit inlines. - * cp-tree.h (lang_decl_flags): New field saved_inline. - * cp-tree.h (DECL_SAVED_INLINE): New macro. - * class.c (add_virtual_function): Don't set TREE_ADDRESSABLE. - * decl.h, decl.c (pending_addressable_inlines): Removed. - * decl2.c (pending_addressable_inlines): Renamed to saved_inlines. - * decl2.c (mark_inline_for_output): Do nothing if - DECL_SAVED_INLINE; otherwise set it (and add to saved_inlines list). - * decl2.c (finish_vtable_vardecl): SET_CLASSTYPE_INTERFACE_KNOWN - and set CLASSTYPE_INTERFACE_ONLY if there is a non-inline virtual. - * decl2.c (finish_file): Writing out inlines later, so we can - also handle the ones needed for vtbales. - * decl2.c (write_vtable_entries, finish_vtable_typedecl): Removed. - - * cp-tree.h, class.c, decl2.c, search.c: Remove -fvtable-hack - and flag_vtable_hack. Use -fvtable-thunks and flag_vtable_thunks - instead. (The rationale is that these optimizations both break binary - compatibility, but should become the default in a future release.) - -Wed Apr 6 10:53:56 1994 Mike Stump - - * class.c (modify_vtable_entries): Never reset the DECL_CONTEXT - of a fndecl, as we might not be from that vfield. - -Tue Apr 5 17:43:35 1994 Kung Hsu - - * class.c (add_virtual_function): Fix bug for pure virtual, so - that DECL_VINDEX of the dummy decl copied won't be error. - (see also Apr 4 change) - -Tue Apr 5 17:23:45 1994 Per Bothner - - * typeck.c (c_expand_return): Before checking that we're not - returning the address of a local, make sure it's a VAR_DECL. - (And don't worry about it being a TREE_LIST.) - -Tue Apr 5 13:26:42 1994 Jason Merrill - - * parse.y (YYDEBUG): Always define. - * lex.c (YYDEBUG): Likewise. - -Mon Apr 4 11:28:17 1994 Kung Hsu - - * class.c (finish_struct): Backup out the change below, put the - new change for the same purpose. The change below breaks code. - - * class.c (finish_struct): If pure virtual, copy node and make - RTL point to abort, then put in virtual table. - * decl2.c (grok_function_iit): Reinstate Mar 31 change. - -Sat Apr 2 03:12:58 1994 Jason Merrill - - * init.c (build_new): pedwarn about newing const and volatile - types. - - * tree.c (get_identifier_list): Only do the special handling - thing if we're dealing with the main variant of the record type. - - * cvt.c (convert_to_reference): When converting between - compatible reference types, use the pointer conversion machinery. - Don't just blindly overwrite the old type. - -Fri Apr 1 17:14:42 1994 Jason Merrill - - * call.c (build_method_call): When looking at global functions, - be sure to use instance_ptr for the first argument, not some version - of it that has been cast to a base class. Also do this before - comparing candidates. - -Thu Mar 31 19:50:35 1994 Jason Merrill - - * call.c (build_method_call): Constructors can be called for - const objects. - -Thu Mar 31 16:20:16 1994 Kung Hsu - - * decl2.c (grok_func_init): Do not abort as rtl for pur virtual - functions. They can be defined somewhere else. - -Sat Jan 23 23:23:26 1994 Stephen R. van den Berg - - * decl.c (init_decl_processing): Declare __builtin_return_address - and __builtin_frame_address for C++ as well. - -Thu Mar 31 12:35:49 1994 Mike Stump - - * typeck2.c (store_init_value): Integral constant variables are - always constant, even when doing -fpic. - -Sat Jan 23 23:23:26 1994 Stephen R. van den Berg - - * decl.c (redeclaration_error_message): Pass the types to - comptypes. - -Wed Mar 30 21:29:25 1994 Mike Stump - - Cures incorrect errors about pure virtuals in a class, when they - have been overridden in a derived class. - - * search.c (get_abstract_virtuals): Reimplement. - * search.c (get_abstract_virtuals_1): New routine. - -Wed Mar 30 14:10:04 1994 Jason Merrill - - * pt.c (push_template_decls): Make the pushed level pseudo - global. - - * parse.y (extdefs): Don't pop everything if the current binding - level is pseudo_global. - - * decl.c (pop_everything): Stop on reaching a pseudo-global - binding level. - - * cp-tree.h (DECL_FUNCTION_MEMBER_P): Change to more reliable test. - - * decl.c (duplicate_decls): Only copy DECL_SOURCE_{FILE_LINE} if - the old decl actually had an initializer. - - * {various}: Clean up gcc -W complaints. - - * cp-tree.h (DECL_FUNCTION_MEMBER_P): Currently defined to be - (DECL_CONTEXT (NODE) != NULL_TREE). - - * parse.y (lang_extdef): Call pop_everything if necessary. - - * decl.c (pop_everything): New function for popping binding - levels left over after a syntax error. - (pushdecl): Use DECL_FUNCTION_MEMBER_P to decide whether or not - a function is a member. - -Wed Mar 30 14:20:50 1994 Mike Stump - - Cures calling a more base base class function, when a more derived - base class member should be called in some MI situations. - - * search.c (make_binfo): Use more the more specialized base - binfos from the binfo given as the second argument to make_binfo, - instead of the unspecialized ones from the TYPE_BINFO. - * class.c (finish_base_struct): Likewise, update callers. - * search.c (dfs_get_vbase_types): Likewise. - * tree.c (propagate_binfo_offsets, layout_vbasetypes): Likewise. - * decl.c (xref_tag): Use NULL_TREE instead of 0. - * lex.c (make_lang_type): Likewise. - -Wed Mar 30 14:10:04 1994 Jason Merrill - - * decl.c (pushdecl): If pushing a C-linkage function, only do a - push_overloaded_decl. - (duplicate_decls): Standard overloading does not shadow built-ins. - -Tue Mar 29 00:54:18 1994 Jason Merrill - - * pt.c (end_template_decl): Don't call push_overloaded_decl. - - * init.c (do_friend): Don't call push_overloaded_decl. - - * decl.c (pushdecl): Call push_overloaded_decl for functions and - function templates. - (duplicate_decls): Functions and function templates are not - duplicates, but don't complain about calling this function to - compare them. - (push_overloaded_decl): Don't deal with linkage. Call - duplicate_decls. - (redeclaration_error_message): Deal with linkage. - - * decl.c (start_function): If push_overloaded_decl returns an - older version of the function, deal with it. - - * decl.c (start_function): Be sure only to push_overloaded_decl - for non-members. - - * decl.c (grokfndecl): Put back clearing of DECL_CHAIN for - methods. - (start_function): Lose broken and redundant code for checking old - decl. - - * init.c (add_friend): Give line numbers of both friend decls - when warning about re-friending. - - * pt.c (tsubst): Use comptypes rather than == to compare the - types of the method as declared and as defined, since default - parameters may be different. - - * call.c (build_method_call): Use brendan's candidate printing - routine. - - * decl.c (start_method): Methods defined in the class body are - inline whether or not it's a template class. - -Mon Mar 28 16:39:26 1994 Jason Merrill - - * parse.y (initdcl0): Add "extern" to current_declspecs if - have_extern_spec && ! used_extern_spcec. - - * tree.c (really_overloaded_fn): A fn with more than one - overload. - - * pt.c (end_template_decl): Use really_overloaded_fn. - - * decl.c (duplicate_decls): When smashing a decl into a previous - definition, keep the old file and line. - Don't deal with overloaded functions. - Lose old code for checking arg types of functions. - Check for overloaded C functions. - (pushdecl): Deal with overloaded functions. - (start_decl): Expect pushdecl to return an appropriate function decl. - (start_function): Likewise. - (push_overloaded_decl): Don't check for overloaded C functions. - - * *.c: Stop using DECL_OVERLOADED, it being archaic. - TREE_OVERLOADED should probably go, too. - -Mon Mar 28 14:00:45 1994 Ron Guilmette - - * typeck.c (comp_target_types): Call comp_target_parms with - strict == 1. - -Sun Mar 27 00:07:45 1994 Jason Merrill - - * parse.y (empty_parms): Don't parse () as (...) in extern "C" - sections if we're compiling with -ansi or -pedantic. - - * decl.c (decls_match): Don't treat (int) and (int&) as matching. - - * decl2.c (grokfield): Don't pedwarn twice about initializing - field. - - * decl.c (push_overloaded_decl): Warn about shadowing - constructor. - (redeclaration_error_message): Don't allow 'int a; int a;' - - * cvt.c (build_up_reference): Only check for valid upcast if - LOOKUP_PROTECT is set, not just any flag. - -Fri Mar 25 01:22:31 1994 Jason Merrill - - * lex.c (check_newline): When we see a #pragma implementation, - also set it for the main input file. - - * init.c (build_new): Convert array size argument to size_t. - - * parse.y (primary): If we're doing a parenthesized type-id, call - groktypename before passing it to build_new. - - * call.c (build_method_call): Deal properly with const and - volatile for instances of reference type. - - * decl.c (store_return_init): Change 'if (pedantic) error' to 'if - (pedantic) pedwarn'. - - * decl.c (grokdeclarator): Don't complain about putting `static' - and `inline' on template function decls. - -Thu Mar 24 23:18:19 1994 Jason Merrill - - * call.c (build_method_call): Preserve const & volatile on - `this'. - -Thu Mar 24 16:21:52 1994 Mike Stump - - * init.c (build_new, build_vec_delete): Use global new and delete - for arrays. - * decl2.c (delete_sanity): Likewise. - -Thu Mar 24 02:10:46 1994 Jason Merrill - - * cvt.c (convert_to_reference): If i is an lvalue, - (int &)i -> *(int*)&i, as per 5.2.8p9 of the latest WP. - (convert_force): Call convert_to_reference with LOOKUP_COMPLAIN. - -Wed Mar 23 17:45:37 1994 Jason Merrill - - * decl.c (duplicate_decls): Also propagate DECL_TEMPLATE_MEMBERS - and DECL_TEMPLATE_INSTANTIATIONS. - - * init.c (build_new): Handle array typedefs properly. - -Wed Mar 23 18:23:33 1994 Mike Stump - - 30th Cygnus<->FSF merge. - -Wed Mar 23 00:46:24 1994 Mike Stump - - * class.c (modify_vtable_entries): Avoid running off the end of the - virtuals list when processing a virtual destructor. - * class.c (get_vtable_entry): Likewise. - -Wed Mar 23 00:23:59 1994 Jason Merrill - - * decl.c (duplicate_decls): If two template decls don't match, - just return 0. - -Tue Mar 22 23:49:41 1994 Jason Merrill - - * typeck.c (convert_for_assignment): Don't pedwarn about - converting function pointer to void *. - -Tue Mar 22 22:23:19 1994 Mike Stump - - Major revamp of pointer to member functions. Cures major - nonfunctionality when used in casts, and MI situations. - - * cvt.c (convert_force): Update call site of build_ptrmemfunc. - * typeck.c (convert_for_assignment): Likewise. - * typeck2.c (digest_init): Likewise. - * typeck2.c (process_init_constructor): Simplify by moving code into - digest_init. - * typeck2.c (digest_init): Do default_conversions on init value, if - we are processing pointer to member functions. - * class.c (get_vfield_offset): Now non-static. Convert bit offset - into byte offset. - * cp-tree.h (get_vfield_offset): Likewise. - * typeck.c (get_member_function_from_ptrfunc): Convert down to right - instance, before fetching vtable pointer. - * typeck.c (get_delta_difference): New routine. - * typeck.c (build_ptrmemfunc): Revamp to handle casting better, also - get vtable pointer out of right subobject. - -Tue Mar 22 17:56:48 1994 Mike Stump - - * search.c (get_binfo): Return NULL instead of aborting, when - passed a UNION_TYPE. - -Tue Mar 22 12:44:54 1994 Jason Merrill - - These patches implement handling of redefinition/redeclaration of - templates. - - * typeck.c (comptypes): Simplify. All TEMPLATE_TYPE_PARMs are - considered compatible. - - * parse.y (template_def): Pass defn argument to end_template_decl. - - * pt.c (end_template_decl): Add defn argument. Check for - redefinition. Simplify. - - * error.c (OB_UNPUT): New macro, to remove mistakes. - (aggr_variety): Subroutine of dump_aggr_type. - - * decl.c (decls_match): Support templates. - (duplicate_decls): No longer static. Don't try to lay out template - decls. - (pushdecl): Simplify. - - * cp-tree.h (DECL_TEMPLATE_MEMBERS): Use DECL_SIZE instead of - DECL_INITIAL. - -Mon Mar 21 11:46:55 1994 Jason Merrill - - * error.c (dump_decl): Support class template decls. - (dump_type): Don't adorn template type parms. - - * decl.c (duplicate_decls): Save DECL_TEMPLATE_INFO from old decl - if it was a definition. - (redeclaration_error_message): Do the cp_error thang, and reject - redefinition of templates. - -Mon Mar 21 19:36:06 1994 Per Bothner - - * decl.c (grokdeclarator): Set TREE_PUBLIC for METHOD_TYPE - in FIELD context, when appropriate. Also, - CLASSTYPE_INTERFACE_ONLY is irrelevant to setting TREE_PUBLIC. - Also, simplify check for bogus return specifiers. - -Mon Mar 21 11:46:55 1994 Jason Merrill - - * parse.y (after_type_declarator1): Expand type_quals. - (notype_declarator1): Likewise. - (absdcl1): Likewise. - -Sat Mar 19 01:05:17 1994 Jason Merrill - - * decl.c (grokdeclarator): Treat class-local typedefs like static - members; i.e. 'typedef int f();' means that f is a function type, - not a method type. - - * parse.y (decl): Change direct_* back to *. - (type_id): Change direct_abstract_declarator to absdcl. - (direct_declarator, direct_initdecls, direct_initdcl0): Remove again. - -Fri Mar 18 12:47:59 1994 Jason Merrill - - These two patches fix crashes on instantiating a template inside a - function with C linkage or containing labels. - - * class.c (current_lang_stacksize): No longer static. - - * decl.c (struct saved_scope): Add lang_base, lang_stack, - lang_name, lang_stacksize, and named_labels. - (push_to_top_level): Save them. - (pop_from_top_level): Restore them. - - * gxxint.texi (Parser): Update. - - These two patches finish moving the task of expr/declarator - ambiguity resolution from the lexer to the parser, and add one more - r/r conflict. START_DECLARATOR can now be nuked. - - * parse.y (decl): Add "direct_" in typespec X rules. - (direct_declarator): New nonterminal for - direct_after_type_declarator and direct_notype_declarator. - (direct_initdecls): Like initdecls, but uses direct_initdcl0. - (direct_initdcl0): Like initdcl0, but uses direct_declarator. - (named_parm): Add typespec direct_declarator rule. - - * spew.c (yylex): #if 0 out START_DECLARATOR insertion. - - These two patches disable some excessive cleverness on the part of - g++; a non-class declaration always hides a class declaration in the - same scope, and g++ was trying to unhide it depending on the - enclosing expression. - - * spew.c (arbitrate_lookup): #if 0 out. - - * decl.c (lookup_name): Never call arbitrate_lookup. - - * parse.y (complex_notype_declarator1): Add '*' - complex_notype_declarator1 and '&' complex_notype_declarator1 rules. - - * parse.y (complex_direct_notype_declarator): Restore id_scope - see_typename TYPENAME rule, remove all other rules beginning with - those tokens. - (notype_unqualified_id): Add '~' see_typename IDENTIFIER rule. - -Thu Mar 17 17:30:01 1994 Jason Merrill - - These changes fix the compiler's handling of the functional cast/ - object declaration ambiguities in section 6.8 of the ARM. They also - add 11 reduce/reduce conflicts. Sigh. - - * parse.y: Add precedence decls for OPERATOR and '~'. - (notype_unqualified_id): New nonterminal, encompasses all of the - ANSI unqualified-id nonterminal except TYPENAMEs. - (expr_or_declarator): New nonterminal to delay parsing of code like - `int (*a)'. - (primary): Use notype_unqualified_id. - (decl): Add typespec initdecls ';' and typespec declarator ';' - rules. - (initdcl0): Deal with the above. - (complex_notype_declarator1): A notype_declarator that is not also - an expr_or_declarator. - (complex_direct_notype_declarator): A direct_notype_declarator that - doesn't conflict with expr_or_declarator. Use - notype_unqualified_id. Remove id_scope see_typename TYPENAME rule. - (functional_cast): New nonterminal, for the three functional cast - rules. So that they can be moved after - complex_direct_notype_declarator. - (see_typename): Don't accept type_quals any more. - - * decl2.c (reparse_decl_as_expr): New function to deal with parse - nodes for code like `int (*a)++;'. - (reparse_decl_as_expr1): Recursive subroutine of the above. - (finish_decl_parsing): New function to deal with parse nodes for - code like `int (*a);'. See the difference? - -Thu Mar 17 12:16:10 1994 Mike Stump - - These changes break binary compatibility in code with classes - that use virtual bases. - - * search.c (dfs_get_vbase_types): Simplify and correct to make - sure virtual bases are initialized in dfs ordering. - * search.c (get_vbase_types): Simplify and make readable. - -Thu Mar 17 12:01:10 1994 Jason Merrill - - * parse.y: s/ typename / type_id /g - -Wed Mar 16 17:42:52 1994 Kung Hsu - - * parse.y (typespec): Add SCOPE TYPENAME for global scoped - type. e.g. ::B x. - - * decl.c (complete_array_type): Fix a bug that in -pendantic - mode even there's no initializer, it will continue to build - default index. - -Wed Mar 16 17:43:07 1994 Jason Merrill - - * parse.y (direct_notype_declarator): Add PTYPENAME rule, remove - all of the scoped PTYPENAME rules. - -Wed Mar 16 16:39:02 1994 Mike Stump - - * init.c (build_offset_ref): The value of A::typedef_name is - always the TYPE_DECL, and never an error. - -Tue Mar 15 20:02:35 1994 Jason Merrill - - * search.c (get_base_distance_recursive): Two binfos can only - represent the same object if they are both via_virtual. - - * class.c (finish_base_struct): Check vbases for ambiguity, too. - - * search.c (get_vbase_types): Accept binfo argument, too. - -Tue Mar 15 19:22:05 1994 Kung Hsu - - * decl.c (complete_array_type): Complete TYPE_DOMAIN of the - initializer also, because back-end requires it. - -Tue Mar 15 15:33:31 1994 Jason Merrill - - * error.c (dump_expr): Support member functions (which show up as - OFFSET_REFs). - -Mon Mar 14 16:24:36 1994 Mike Stump - - * init.c (build_new): Set the return type of multidimensional - news correctly. - -Fri Mar 11 15:35:39 1994 Kung Hsu - - * call.c (build_method_call): If basetype not equal to type - of the instance, use the type of the instance in building - destructor. - -Thu Mar 10 17:07:10 1994 Kung Hsu - - * parse.y (direct_notype_declarator): Add push_nested_type for - 'template_type SCOPED_NAME' rule. - -Tue Mar 8 00:19:58 1994 Jason Merrill - - * parse.y (parm): Add typed_declspec1 {absdcl, epsilon} rules. - -Sat Mar 5 04:47:48 1994 Jason Merrill - - * parse.y (regcast_or_absdcl): New nonterminal to implement late - reduction of constructs like `int ((int)(int)(int))'. - (cast_expr): Use it. - (sub_cast_expr): Everything that can come after a cast. - (typed_declspecs1): typed_declspecs that are not typed_typespecs. - (direct_after_type_declarator): Lose PAREN_STAR_PAREN rule. - (direct_abstract_declarator): Replace '(' parmlist ')' rule with - '(' complex_parmlist ')' and regcast_or_absdcl. - (parmlist): Split - (complex_parmlist): Parmlists that are not also typenames. - (parms_comma): Enabler. - (named_parm): A parm that is not also a typename. Use declarator - rather than dont_see_typename abs_or_notype_decl. Expand - typed_declspecs inline. - (abs_or_notype_decl): Lose. - (dont_see_typename): Comment out. - (bad_parm): Break out abs_or_notype_decl into two rules. - -Fri Mar 4 18:22:39 1994 Jason Merrill - - * decl2.c (reparse_decl_as_casts): New function to change parse - nodes for `(int)(int)(int)' from "function taking int and returning - function taking int and returning function taking int" to "... cast - to int, cast to int, cast to int". - - * decl2.c (reparse_decl_as_expr): Recursive function to change - parse nodes for `A()()' from "function returning function returning - A" to "A().operator()". - - * parse.y (primary): Replace `typespec LEFT_RIGHT' rule with - `typespec fcast_or_absdcl' rule. - (fcast_or_absdcl): New nonterminal to implement late reduction of - constructs like `A()()()()'. - (typename): Replace `typespec absdcl1' rule with - `typespec direct_abstract_declarator' rule. - (direct_abstract_declarator): Replace `LEFT_RIGHT type_quals' rule - with `fcast_or_absdcl type_quals' rule. - -Fri Mar 4 16:18:03 1994 Mike Stump - - * tree.c (lvalue_p): Improve OFFSET_REF handling, so that it - matches Section 5.5. - -Fri Mar 4 14:01:59 1994 Jason Merrill - - * error.c (dump_type_prefix): Don't print basetype twice for - pmfs. - -Fri Mar 4 13:24:33 1994 Mike Stump - - * typeck.c (convert_arguments): Handle setHandler(A::handlerFn) - so that it is like setHandler(&A::handlerFn). Cures an `invalid - lvalue in unary `&''. - -Fri Mar 4 11:15:59 1994 Jason Merrill - - * gxxint.texi (Copying Objects): New section discussing default - op= problems with virtual inheritance. - - * decl2.c (grokoptypename): Just does grokdeclarator and - build_typename_overload, since the parser can't call grokdeclarator - directly. - - * method.c (build_typename_overload): Set IDENTIFIER_GLOBAL_VALUE - and TREE_TYPE on generated identifiers. - - * decl.c (grokdeclarator): Don't deal with TYPE_EXPRs anymore. - - * parse.y (parm): Convert `const char *' to `__opPCc' here. - - * error.c (dump_decl): Say sorry rather than my_friendly_aborting - if we can't figure out what to do. - (dump_type*): Likewise. - - * typeck2.c (build_m_component_ref): 'component' is an expr, not - a decl. Also move the IS_AGGR_TYPE check after the stripping of - REFERENCE_TYPE. - -Fri Mar 4 04:46:05 1994 Mike Stump - - * call.c (build_method_call): Handle b->setHandler(A::handlerFn) - so that it is like b->setHandler(&A::handlerFn). Cures an `invalid - lvalue in unary `&''. - -Thu Mar 3 12:38:15 1994 Jason Merrill - - * parse.y: Add precedence specification for START_DECLARATOR. - (type_quals): Move before primary. - (typename): Move before typed_declspecs, add 'typespec absdcl1' rule. - - * decl2.c (grokoptypename): Lose. - - * decl.c (grokdeclarator): Parse TYPE_EXPRs in the initial scan, - rather than waiting until later. - -Wed Mar 2 14:12:23 1994 Jason Merrill - - * parse.y (unary_expr): Use 'typename' in 'new' rules, rather - than expanding it inline. - (typename): Expand empty option of (former) absdcl inline. - (abs_or_notype_decl): Likewise. - (absdcl): Lose empty rule. - (conversion_declarator): New nonterminal for 'typename' of 'operator - typename'. - (operator_name): Use it instead of absdcl. - - * parse.y: Add precedence declarations for SCOPED_TYPENAME, - TYPEOF, and SIGOF. - (typed_declspecs): Accept typed_typespecs, rather than typespec - directly. Add rules with reserved_typespecquals. - (reserved_declspecs): Don't accept typespecqual_reserved at the - beginning of the list. The typed_declspecs rule will deal with this - omission. - (declmods): Accept nonempty_type_quals, rather than TYPE_QUAL - directly. - - * parse.y (direct_notype_declarator, - direct_after_type_declarator, direct_abstract_declarator): Split up - the declarator1 nonterminals to match the draft standard and avoid - ambiguities. - (new_type_id, new_declarator, direct_new_declarator, - new_member_declarator): New nonterminals to implement the subset of - 'typename' allowed in new expressions. - (unary_expr): Use new_type_id instead of typename. - (after_type_declarator1, absdcl1): Fix semantics of member pointers. - (abs_member_declarator, after_type_member_declarator): Lose. - - * parse.y (absdcl1): Don't require parens around - abs_member_declarator. - (abs_member_declarator): Lose see_typename from rules. - (after_type_member_declarator): Likewise. - - * tree.c (get_identifier_list): New function, containing code - previously duplicated in get_decl_list and list_hash_lookup_or_cons. - (get_decl_list): Use it. - (list_hash_lookup_or_cons): Likewise. - - * parse.y (typed_declspecs, declmods): It's not necessary to hash - the declspecs on class_obstack, so don't. This way typed_typespecs - can reduce to typed_declspecs. - -Wed Mar 2 14:29:18 1994 Jason Merrill - - * cvt.c (build_up_reference): If we aren't checking visibility, - also allow base->derived conversions. - -Mon Feb 28 15:14:29 1994 Per Bothner - - * typeck.c (build_c_cast): Remove bogus hack when converting - to a reference type. - - * cp-tree.h (lang_decl::vbase_init_list, DECL_VBASE_INIT_LIST): - Removed, not used. - (lang_stype::methods, lang_decl::next_method): New fields. - (CLASSTYPE_METHODS, DECL_NEXT_METHOD): New macros. - * decl.c (duplicate_decls): Preserve DECL_NEXT_METHOD. - - * cp-tree.h, decl2.c (flag_vtable_hack): New flag. - * decl2.c (finish_vtable_vardecl): If flag_vtable_hack, - and !CLASSTYPE_INTERFACE_KNOWN, try to use the presence of - a non-inline virtual function to control emitting of vtables. - * class.c (finish_struct): Build CLASSTYPE_METHODS list. - * search.c (build_vbase_vtables_init): Don't assemble_external - (yet) if flag_vtable_hack. - * class.c (build_vfn_ref): Likewise. - -Mon Feb 28 14:54:13 1994 Jason Merrill - - * parse.y (component_decl): Don't include "typed_declspecs - declarator ';'" speedup, since it breaks enums. - -Fri Feb 25 15:43:44 1994 Per Bothner - - * class.c (finish_struct): Minor optimization for building - fn_fields list. - -Fri Feb 25 15:23:42 1994 Jason Merrill - - * decl.c (start_function): Fix detection of function overloading. - -Thu Feb 24 22:26:19 1994 Mike Stump - - * lex.c (check_newline): #pragma interface can take a string - argument, just like #pragma implementation. #pragma implementation - checks for garbage on the line, line #pragma interface does. Main - input files do not auto implement like named files, #pragma - implementation must be used explicitly. - -Thu Feb 24 17:09:01 1994 Jason Merrill - - * parse.y (components): Handle list of one again. - (notype_components): Likewise. - (after_type_declarator1): Take maybe_raises out again. - - * gxxint.texi (Parser): Document additional r/r conflict. - -Wed Feb 23 14:42:55 1994 Jason Merrill - - * gxxint.texi (Parser): Add node. - - * Makefile.in (stamp-parse): Update expected conflict count. - - * parse.y (various): Replace "declmods declarator" with "declmods - notype_declarator". The comment saying that "declmods declarator ';'" - corresponds to "int i;" was wrong; it corresponds to "const i;". - (component_decl): Add "typed_declspecs declarator ';'" rule; this - *does* correspond to "int i;". Change "declmods components" to - "declmods notype_components". - (components): Don't deal with a list of one anymore. - (notype_components): New nonterminal, corresponds to notype_declarator. - ({after_,no}type_component_decl{,0}): More new nonterminals. - ({after_,no}type_declarator): Fold in START_DECLARATOR token. - Eliminates four reduce/reduce conflicts. - - (expr): Depend on nontrivial_exprlist instead of nonnull_exprlist. - (nontrivial_exprlist): New nonterminal: A list of at least two - expr_no_commas's. - (nonnull_exprlist): Depend on nontrival_exprlist. - Eliminates four reduce/reduce conflicts. - - (named_class_head): Move intermediate code block into separate - nonterminal so that we can stick %prec EMPTY on it. - - Add more %prec EMPTY's to eliminate remaining shift/reduce - conflicts. - - (after_type_declarator): Add maybe_raises to fndecl rules. - (after_type_declarator_no_typename): Remove. - For correctness. - - Document remaining reduce/reduce conflicts. - -Tue Feb 22 12:10:32 1994 Jason Merrill - - * search.c (get_base_distance): Only bash BINFO_INHERITANCE_CHAIN - (TYPE_BINFO (type)) if we care about the path. - - * tree.c (lvalue_p): A COND_EXPR is an lvalue if both of the - options are. - -Mon Feb 21 19:59:40 1994 Mike Stump - - * Makefile.in (mostlyclean): lex.c is a source file, don't - remove. - -Sat Feb 19 01:27:14 1994 Jason Merrill - - * parse.y: Eliminate 20 shift/reduce conflicts. - -Fri Feb 18 11:49:42 1994 Jason Merrill - - * pt.c (type_unification): Add subr argument; if set, it means - that we are calling ourselves recursively, so a partial match is OK. - (unify): Support pointers to methods and functions. - (tsubst): Support method pointers. - * decl.c (build_ptrmemfunc_type): No longer static, so that - tsubst can get at it. - - * init.c (is_aggr_typedef): Pretend template type parms are - aggregates. - * decl2.c (build_push_scope): If cname refers to a template type - parm, just grin and nod. - - * call.c (build_overload_call_real): Pass subr argument to - type_unification. - * pt.c (do_function_instantiation): Likewise. - * class.c (instantiate_type): Likewise. - - * search.c (get_base_distance): If BINFO is a binfo, use it and - don't mess with its BINFO_INHERITANCE_CHAIN. - - * cvt.c (convert_to_reference): Fix temporary generation. - If ambiguous, return error_mark_node. - - * init.c (build_new): Put back some necessary code. - -Thu Feb 17 15:39:47 1994 Jason Merrill - - * init.c (build_new): Deal with array types properly. - - * search.c (get_binfo): Become a shell for get_base_distance. - (get_binfo_recursive): Lose. - (get_base_distance_recursive): Find the path to the via_virtual base - that provides the most access. - (get_base_distance): Likewise. - - * parse.y (explicit_instantiation): Syntax is 'template class - A', not 'template A'. - - * typeck.c (convert_for_initialization): Remove bogus warning. - - * parse.y (datadef): Revert patch of Oct 27. - -Thu Feb 17 15:12:29 1994 Per Bothner - - * class.c (build_vfn_ref): Cast delta field to ptrdiff_type_node, - rather than integer_type_node. Does wonders for the Alpha. - -Thu Feb 17 13:36:21 1994 Jason Merrill - - * decl.c (build_ptrmemfunc_type): Make sure that the pmf type - goes onto the same obstack as its target type. - -Wed Feb 16 00:34:46 1994 Jason Merrill - - * cvt.c (convert_to_reference): If converting via constructor - on local level, go back to build_cplus_new approach. - - * tree.c (build_cplus_new): If with_cleanup_p, set cleanup slot - to error_mark_node to prevent expand_expr from building a cleanup - for this variable. - - * lex.c (default_assign_ref_body): Return *this from the memcpy - version, too. - - * decl.c (grok_reference_init): Just return if called with - error_mark_node, don't worry about initializing non-const reference - with temporary. - - * cvt.c (convert_to_reference): Do the right thing for - non-aggregate reference conversions, pedwarn when generating a - non-const reference to a temporary. - - * class.c (finish_struct): TYPE_HAS_COMPLEX_{INIT,ASSIGN}_REF and - TYPE_NEEDS_CONSTRUCTING all depend on TYPE_USES_VIRTUAL_BASECLASSES - again. - -Tue Feb 15 19:47:19 1994 Jason Merrill - - * decl.c (grok_reference_init): Pawn off a lot of the work on - convert_to_reference. Generally do the right thing. - - * cvt.c (convert_to_reference): Conform to the initial comment; - i.e. don't create temps if decl != error_mark_node. Handle - cleanups better for temps that do get created. Don't pretend - that we can use an 'A' to initialize a 'const double &' just by - tacking on a NOP_EXPR. Support LOOKUP_SPECULATIVELY. - - * call.c (build_method_call): Set TREE_HAS_CONSTRUCTOR on - constructor calls. - -Mon Feb 14 14:50:17 1994 Jason Merrill - - * decl.c (grok_reference_init): Make a temporary for initializing - const reference from constant expression. - -Mon Feb 14 11:31:31 1994 Per Bothner - - * cp-tree.h, decl.c (set_identifier_local_value): Deleted function. - * decl.c (pushdecl): Define decl in correct binding_level - (which isn't always the inner_binding_level). - - * cvt.c (build_up_reference): Don't ever call expand_aggr_init. - It's ugly, and I don't think it's the right thing to do. - - * cp-tree.h, class.c, decl.c, decl2.c, sp/search.c: - Remove NEW_CLASS_SCOPING, assuming it is always 1. - * decl.c (pop_decl_level): Removed; manually inlined. - -Sun Feb 13 19:04:56 1994 Jason Merrill - - * class.h (candidate): Add basetypes field. - - * call.c (build_method_call): Do access checking after choosing a - function, not before. - - * Makefile.in (cvt.o, call.o, method.o): Depend on class.h. - (mostlyclean): Remove ../cc1plus. - -Fri Feb 11 11:52:26 1994 Jason Merrill - - * class.c (finish_struct): Don't allow adjusting access to a field - of a base class if a local field has the same name. - - * error.c (dump_type_prefix): Output basetype for METHOD_TYPEs. - -Thu Jan 13 17:55:51 1994 Gnanasekaran Swaminathan - - * cp-tree.h (DESTRUCTOR_NAME_P): Do not confuse AUTO_TEMP names - with destructor names when either NO_DOLLAR_IN_LABEL or - NO_DOT_IN_LABEL are not defined. - - Now `template class A {...}' works. - - * pt.c (grok_template_type): Substitute template parm types - with actual types in complex type as well. - (coerce_template_parms): Update the grok_template_type () - function call. - - * pt.c (tsubst): Traverse method list using DECL_CHAIN. - - * decl.c (grok_op_properties): Allow operator++/-- to have - default arguments. - - * typeck2.c (store_init_value): Don't abort when called to - initialize a type that needs constructing with a CONSTRUCTOR. - - * init.c (expand_aggr_init_1, CONSTRUCTOR case): If - store_init_value fails, build and expand an INIT_EXPR. If - store_init_value succeeds, call expand_decl_init. - -Fri Feb 11 02:49:23 1994 Mike Stump - - * class.c (build_vbase_path): Use complete_type_p instead of - resolves_to_fixed_type_p to determine if the virtual bases are in - their right place for the type of expr. Cures problem of thinking a - virtual base class is one place, when it is in fact someplace else. - -Fri Feb 11 00:26:46 1994 Mike Stump - - * init.c (resolve_offset_ref): Make sure we first convert to - intermediate type, if given, when dealing with members off `this'. - Solves an incorrrect `type `foo' is not a base type for type - `multiple'' when it is infact, a base type. - -Thu Feb 10 21:49:35 1994 Mike Stump - - * class.c (modify_other_vtable_entries): Use get_binfo, instead - of binfo_value. Solves problem with compiler giving a `base class - `B' ambiguous in binfo_value (compiler error)' on complex MI - herarchies, when a virtual function is first defied in a virtual - base class. - -Thu Feb 10 17:19:32 1994 Mike Stump - - * class.c (build_vbase_path): Don't complain about ambiguous - intermediate conversion when converting down to a virtual base - class, even if they might seem to be ambiguous. - -Thu Feb 10 12:18:26 1994 Jason Merrill - - * typeck2.c (build_functional_cast): #if 0 out constructor - inheritance code, improve error messages. - - * class.c (finish_base_struct): Complain about base with only - non-default constructors in derived class with no constructors. - - * decl.c (grokdeclarator): Fix detection of virtual new/delete. - -Wed Feb 9 22:02:32 1994 Mike Stump - - * search.c (build_mi_virtuals, add_mi_virtuals, - report_ambiguous_mi_virtuals): Removed unneeded code. - * class.c (finish_struct_bits): Likewise. - -Wed Feb 9 11:27:17 1994 Jason Merrill - - * pt.c (end_template_instantiation): Push decl before - pop_from_top_level. - - * typeck2.c (build_m_component_ref): Make sure datum is of - aggregate type. - - * init.c (get_type_value): New function, returns - IDENTIFIER_TYPE_VALUE or IDENTIFIER_CLASS_TYPE_VALUE or NULL_TREE. - - * call.c (build_method_call): Don't die on call to destructor for - non-type. - - * decl.c (grokdeclarator): Complain about virtual op new and op - delete, make static virtuals unvirtual instead of unstatic. - - * typeck.c (build_c_cast): Also call default_conversion on - methods. - - * decl.c (grokdeclarator): Don't complain about anonymous - bitfields. - - * parse.y (simple_stmt, for loops): Move the continue point after - the cleanups. - - * class.c (finish_struct): Fix setting of - TYPE_HAS_COMPLEX_INIT_REF. - -Tue Feb 8 13:21:40 1994 Jason Merrill - - * init.c (build_new): Deal with `new double (1)'. - - * class.c (finish_struct): TYPE_HAS_COMPLEX_*_REF are supersets of - TYPE_HAS_REAL_*_REF, but TYPE_HAS_COMPLEX_INIT_REF is independent of - TYPE_NEEDS_CONSTRUCTING. - - * decl.c (duplicate_decls): Propagate access decls. - - * typeck2.c (process_init_constructor): Accept empty_init_node - for initializing unions. - - * class.c, lex.c, cp-tree.h: Use - TYPE_HAS_COMPLEX_ASSIGN_REF where TYPE_HAS_REAL_ASSIGN_REF was used - before, use TYPE_HAS_COMPLEX_INIT_REF for TYPE_NEEDS_CONSTRUCTING in - some places. - - * decl.c (finish_decl): Don't complain about uninitialized const - if it was initialized before. - -Mon Feb 7 18:12:34 1994 Jason Merrill - - * lex.c (default_assign_ref_body): Don't deal with vbases for - now. - - * decl.c (finish_decl): Fix reversed logic for objects and other - things that need to be constructed but have no initializer. - - * class.c (finish_struct): Don't set TYPE_HAS_* flags that are - set by grok_op_properties or finish_decl. - - * decl.c: Don't warn about extern redeclared inline unless - -Wextern-inline is given. - * decl2.c (lang_decode_option): Likewise. - * cp-tree.h: Likewise. - -Mon Feb 7 17:29:24 1994 Per Bothner - - * decl.c (pushdecl_with_scope): Fix thinko. Add forward - declaration. - - * decl.c (pushdecl_with_scope): New function. - * decl.c (pushdecl_top_level): Use new function. - * decl.c (pushtag): Initialize newdecl. - * decl.c (pushtag): Push new type decl into correct scope. - -Mon Feb 7 14:42:03 1994 Jason Merrill - - * call.c, cvt.c, init.c, search.c, cp-tree.h: - Eradicate LOOKUP_PROTECTED_OK. - -Mon Feb 7 13:57:19 1994 Per Bothner - - * decl.c (pushtag, xref_tag), cp-tree.h: Add extra parameter - 'globalize' to signify implicit declarations. - * decl.c (globalize_nested_type, maybe_globalize_type): Removed. - * decl.c (set_identifier_type_value_with_scope): New function. - * decl.c (set_identifier_local_value): Simplify. - * spew.c (yylex, do_addr): Modify to return a _DEFN if a - forward declaration (followed by ';' and not preceded by 'friend'). - * class.c, decl.c, except.c, init.c, parse.y, - pt.c, search.c: Add new argument to calls to xref_tag and - pushtag. - -Mon Feb 7 00:22:59 1994 Jason Merrill - - * cp-tree.h (ACCESSIBLY_UNIQUELY_DERIVED_P): New macro, means what - ACCESSIBLY_DERIVED_FROM_P meant before. - (ACCESSIBLY_DERIVED_FROM_P): Now disregards ambiguity. - - * cvt.c (build_up_reference): Call get_binfo with PROTECT == 1. - - * search.c (get_base_distance_recursive): Members and friends of - a class X can implicitly convert an X* to a pointer to a private or - protected immediate base class of X. - (get_binfo_recursive): Likewise. - (get_base_distance): Ignore ambiguity if PROTECT < 0. - (get_binfo): Lose multiple values of PROTECT. - (compute_access): Protected is OK if the start of the - search is an accessible base class of current_class_type. - - * method.c (build_opfncall): Do check access on operator new here. - - * decl.c (finish_function): Don't check access on operator new - here. - -Sun Feb 6 14:06:58 1994 Jason Merrill - - * decl.c (xref_tag): The base of a derived struct is NOT always - public. Duh. - - * pt.c (do_explicit_instantiation): New function, called from - parser to do explicit function instantiation. - (type_unification): Allow the args list to be terminated with - void_list_node. - (do_pending_expansions): Look at i->interface for non-member - templates. - - * parse.y (datadef): Move explicit_instantiation here. - (structsp): From here. - (datadef): Complain about `int;'. - -Sun Feb 6 12:33:18 1994 Per Bothner - - * pt.c (end_template_instantiation), cp-tree.h: Remove unused - second parameter, and simplify first from a TREE_LIST where - we only care about its TREE_VALUE to just the value (an IDENTIFIER). - * pt.c (instantiate_member_templates): Simplify argument list - from a TREE_LIST to just an IDENTIFIER. - * lex.c (yyprint): PRE_PARSED_CLASS_DECL is now just an IDENTIFIER. - * parse.y (template_instantiate_once): Simplify accordingly. - * decl.c (inner_binding_level): New. Use various places to - simplify. - -Sun Feb 6 02:49:37 1994 Jason Merrill - - * typeck2.c (build_functional_cast): int() -> int(0). - -Sat Feb 5 00:53:21 1994 Jason Merrill - - * class.c (finish_struct): Don't do a bitwise copy for op= if the - class has a virtual function table. - - * typeck.c (convert_for_initialization): Restore warnings about - not using defined op=. Should really be my_friendly_aborts, I - s'pose. - -Fri Feb 4 14:21:00 1994 Jason Merrill - - * class.c (finish_struct): Tidy up conditions for doing bitwise - copies of objects. - - * decl.c (build_default_constructor): #if 0 out. - - * *: Eradicate TYPE_GETS_{ASSIGNMENT,ASSIGN_REF,CONST_ASSIGN_REF, - CONST_INIT_REF}, TYPE_HAS_REAL_CONSTRUCTOR. - - * decl.c (grokdeclarator): Don't return void_type_node for - friends being defined here. - - * init.c (perform_member_init): Only do the init if it's useful. - - * lex.c (default_copy_constructor_body): If we don't need to do - memberwise init, just call __builtin_memcpy. - (default_assign_ref_body): Likewise. - - * decl.c (grokdeclarator): If friendp && virtualp, friendp = 0. - -Fri Feb 4 13:02:56 1994 Mike Stump - - * lex.c (reinit_parse_for_method, cons_up_default_function): - Don't give warn_if_unknown_interface warning when it came from a - system header file. - * pt.c (end_template_decl, instantiate_template): Likewise. - * decl.c (start_decl): Likewise. - -Fri Feb 4 00:41:21 1994 Jason Merrill - - * decl.c (grokdeclarator): Don't try to set TYPE_WAS_ANONYMOUS on - enums. - - * decl2.c (constructor_name_full): Use IS_AGGR_TYPE_CODE instead of - IS_AGGR_TYPE, since we don't know it's a type. - -Thu Feb 3 11:36:46 1994 Jason Merrill - - * decl.c (grokdeclarator): Don't complain about anonymous unions. - - * cp-tree.h (TYPE_WAS_ANONYMOUS): This struct was originally - anonymous, but had a name given to it by a typedef. - - * decl.c (grokdeclarator): When renaming an anonymous struct, set - TYPE_WAS_ANONYMOUS. - - * decl2.c (constructor_name_full): Use TYPE_WAS_ANONYMOUS. - - * cp-tree.h (DECL_UNDEFINED_FRIENDS): #if 0 out. - - * init.c (xref_friend): Don't set up DECL_UNDEFINED_FRIENDS. - (embrace_waiting_friends): Don't use DECL_UNDEFINED_FRIENDS. - - * decl.c (grokdeclarator): Set TYPE_NESTED_NAME properly on nested - anonymous structs that get typedef'd. - - * decl.c (grokdeclarator): Always return void_type_node for - friends. - - * error.c (dump_function_decl): Don't use DECL_CLASS_CONTEXT for - friends. - (dump_function_decl): Don't print out default args for - a function used in an expression. - - * decl.c (grokdeclarator): Give error on abstract declarator used - in an invalid context (i.e. `void (*)();'). - - * error.c (cp_line_of): Support _TYPE nodes. - (cp_file_of): Likewise. - - * cvt.c (build_up_reference): Don't abort if passed a SAVE_EXPR; - it can happen for the RHS of an assignment stmt where the LHS is - a COND_EXPR. - - * init.c (expand_aggr_init_1): Deal with bracketed initializer - lists properly. - - * class.c (finish_struct): Deal with enumerators and typedefs - again. - -Wed Feb 2 11:30:22 1994 Jason Merrill - - * class.c (finish_struct): Tidy up loop over fields. - - * errfn.c (cp_thing): Don't advance twice after a format. - - * class.c (finish_struct): Complain about needing a constructor - if a member has only non-default constructors, and don't try to - generate a default constructor. - - * decl.c (finish_decl): Also do the constructor thing if - TYPE_NEEDS_CONSTRUCTING is set (for arrays). - - * search.c (unuse_fields): New function: mark all fields in this - type unused. - (dfs_unuse_fields): Helper function. - - * class.c (pushclass): If the new class is the same as the old - class, still unuse the fields. - (unuse_fields): Move to search.c. - - * decl.c (grok_op_properties): Add friendp argument. - (grokfndecl): Pass it. - (start_method): Likewise. - - * decl2.c (delete_sanity): Add use_global_delete parameter to catch - ::delete calls. - - * parse.y (unary_expr): Pass new parameter to delete_sanity. - - * lex.c (default_copy_constructor_body): Don't choke if the union - has no fields. - (default_assign_ref_body): Likewise. - - * call.c (compute_conversion_costs_ansi): Do the right thing for - ellipsis matches. - - * decl.c (push_to_top_level): Optimize. - - * decl.c (start_function): Look for the lexical scope of a friend - in DECL_CLASS_CONTEXT. - - * init.c (do_friend): Set DECL_CLASS_CONTEXT on global friends. - -Tue Feb 1 15:59:24 1994 Jason Merrill - - * cp-tree.h (TREE_GETS_PLACED_NEW): New macro. - - * init.c (init_init_processing): Don't assign BIN/BID to the - IDENTIFIER_GLOBAL_VALUEs of their respective operators. - (build_new): Check TREE_GETS_PLACED_NEW. - - * decl.c (grok_op_properties): Don't set TREE_GETS_NEW for a decl of - op new with placement, set TREE_GETS_PLACED_NEW. - - * cp-tree.h (ANON_UNION_P): New macro. Applies to decls. - - * class.c (finish_struct): Don't treat anonymous unions like - other aggregate members. Do synthesize methods for unions without - a name, since they may or may not be "anonymous unions". - - * decl2.c (grok_x_components): Wipe out memory of synthesized methods - in anonymous unions. - - * lex.c (default_copy_constructor_body): Support unions. - (default_assign_ref_body): Likewise. - -Mon Jan 31 12:07:30 1994 Jason Merrill - - * cp-tree.h: Fix documentation of LOOKUP_GLOBAL, add prototypes. - - * error.c (args_as_string): New function (%A), like type_as_string - except NULL_TREE -> "..." - - * call.c (build_overload_call_real): Fix for new overloading. - - * decl.c (grok_op_properties): Set all of the TYPE_OVERLOADS_* flags - here. - - * parse.y (operator_name): Instead of here. - - * typeck2.c (build_functional_cast): Treat a TREE_LIST as a list - of functions. - - * call.c (build_overload_call_real): Support LOOKUP_SPECULATIVELY. - - * method.c (build_opfncall): Don't need to massage return value - any more, call build_overload_call with all flags. - - * typeck.c (build_x_binary_op): Put back speculative call to - build_opfncall. - (build_x_unary_op): Likewise. - (build_x_conditional_expr): Likewise. - -Mon Jan 31 10:00:30 1994 Mike Stump - - * cvt.c (build_type_conversion_1): Change call to pedwarn into - warning, and conditionalize upon warn_cast_qual. - -Fri Jan 28 11:48:15 1994 Jason Merrill - - * search.c (lookup_field): If xbasetype is a binfo, copy it to - avoid clobbering its inheritance info. - - * call.c (build_method_call): Don't overwrite basetype_path with - TYPE_BINFO (inst_ptr_basetype) if they have the same type. - - * search.c (compute_access): Fix handling of protected inheritance - and friendship with the enclosing class. - - * typeck2.c (store_init_value): Allow passing of TREE_CHAIN for - initialization of arbitrary variable. - - * typeck2.c (build_functional_cast): Only try calling a method if - one exists. - - * decl.c (grokdeclarator): Move handling of constructor syntax - initialization into first loop for generality. - (parmlist_is_random): Lose. - - * lex.c (cons_up_default_function): Set TREE_PARMLIST on arguments - to default function. - -Thu Jan 27 19:26:51 1994 Jason Merrill - - * decl.c (grokparms): Abort if we get called with something we don't - expect. - -Thu Jan 27 17:37:25 1994 Mike Stump - - * call.c (build_overload_call_real): Change argument complain to - flags to match style of rest of code. Pass it down to - build_function_call_real as necessary. - * call.c (build_overload_call, build_overload_call_maybe): Change - argument complain to flags to match style of rest of code. - * cp-tree.h (build_function_call_real): Added fourth flags - argument. - * cvt.c (convert_to_reference): Only give warning messages, if - LOOKUP_COMPLAIN is set. - * typeck.c (build_x_function_call): Change simple complain - argument to build_overload_call_maybe and build_overload_call, to - LOOKUP_COMPLAIN to match style of rest of code. - * typeck2.c (build_functional_cast): Likewise. - * typeck.c (build_function_call_real): Add flags, so that we can - not complain, if we don't want to complain. Complain about - arguments, if we are complaining, otherwise don't. - * typeck.c (build_function_call, build_function_call_maybe): - Stick in flags argument. - * typeck.c (build_x_binary_op, build_x_unary_op, - build_x_conditional_expr, build_x_compound_expr): Follow style of - build_x_indirect_ref, as it is more correct and more common. - -Thu Jan 27 14:36:20 1994 Jason Merrill - - * call.c (build_method_call): Don't check for being called with - a pointer. - - * decl2.c (finish_file): Don't play with DECL_CLASS_CONTEXT for the - static initializer function. - - * init.c (build_member_call): Use convert_force here, too. - - * search.c (compute_access): Only treat static members specially - if they are referenced directly. - -Wed Jan 26 18:28:14 1994 Jason Merrill - - * gxxint.texi (Access Control): New node. - - * search.c (current_scope): New function; returns whichever of - current_class_type and current_function_decl is the most nested. - (compute_access): Total overhaul to make it clearer and more - correct. Don't use the cache for now; in the only situation where - it was used before, it gained nothing. This frees up three of the - DECL_LANG_FLAGs for possible other use! - - * cp-tree.h: #if 0 out DECL_PUBLIC & friends. - - * typeck.c (build_component_ref_1): Don't check DECL_PUBLIC. - - * call.c (build_method_call): Use convert_force to cast `this' -- - rely on the access checking for the method itself. - - * init.c (is_friend): Do the nesting thing, handle types. I am - my own friend. - (is_friend_type): Become a shell for is_friend. - (add_friend): Never stick in ctype. - Why are the friendship functions in init.c, anyway? - -Wed Jan 26 17:50:00 1994 Mike Stump - - * cvt.c (build_type_conversion_1): Don't conditionalize call to - pedwarn upon pedantic. - -Wed Jan 26 17:20:46 1994 Mike Stump - - * cvt.c (convert_to_reference): Add 8.4.3 checking so that one - gets a warning if one tries to initialize a non-const & from a - non-lvalue. - * cvt.c (convert_to_reference): Use %P format for argument - numbers in warnings. - -Wed Jan 26 14:35:06 1994 Mike Stump - - * init.c (build_delete): Follow style in call.c to construct the - virtual call to the desctructor, as that code is right. Fixes a - problem of the compiler saying a pointer conversion is ambiguous. - -Wed Jan 26 11:28:14 1994 Jason Merrill - - * cp-tree.h (VTABLE_NAME_P): Change other occurrence of - VTABLE_NAME_FORMAT to VTABLE_NAME. - - * *: s/visibility/access/g - -Tue Jan 25 18:39:12 1994 Jason Merrill - - * typeck.c (build_modify_expr): Don't smash references if INIT_EXPR. - -Tue Jan 25 13:54:29 1994 Mike Stump - - * init.c (build_delete): Back out Jan 17th & 18th pacthes, as - they break libg++. - -Tue Jan 25 13:11:45 1994 Jason Merrill - - * decl.c (duplicate_decls): Fix pointer arithmetic. - -Mon Jan 24 15:50:06 1994 Chip Salzenberg - - [ cp-* changes propagated from c-* changes in 940114 snapshot ] - * cp-parse.y (maybe_attribute): Allow multiple __attribute__ - clauses on a declaration. - -Mon Jan 24 17:06:23 1994 Jason Merrill - - * class.c (finish_struct): Do synthesize methods for anon - structs, just not unions. - -Mon Jan 24 13:50:13 1994 Kung Hsu - - * decl.c (xref_tag): Handle anonymous nested type. - * decl.c (globalize_nested_type): Add no globalize bit check. - * spew.c (hack_more_ids): Templated nested decl not push top - level. - - * parse.y: Get rid of 'goto do_components'. It is much better - for debugging. - - * decl.c (is_anon_name): Get rid of the function and use the - macro ANON_AGGRNAME_P. - * pt.c: Ditto. - -Fri Jan 21 14:06:02 1994 Jason Merrill - - * class.c (finish_struct): Don't synthesize any methods for - anonymous structs/unions. - - * typeck.c (build_modify_expr): Don't treat pmf's as class objects. - -Thu Jan 20 18:56:46 1994 Jason Merrill - - * method.c (build_opfncall): Call build_indirect_ref on - synthesized instance for operator delete. - - * pt.c (type_unification): Don't abort if called with a list of - types in ARGS. - - * class.c (instantiate_type): Deal with function templates. - -Thu Jan 20 16:55:35 1994 Jim Wilson - - * Makefile.in (CC): Default to cc not gcc. - -Thu Jan 20 13:47:54 1994 Jason Merrill - - * typeck.c (build_modify_expr): Call constructor if appropriate. - - * decl.c (push_to_top_level): Clear out class-level bindings cache. - -Wed Jan 19 13:51:22 1994 Jason Merrill - - * call.c (resolve_scope_to_name): Work recursively (previously only - looked down one level). - - * lex.c (do_pending_inlines): If we're still dealing with the last - batch of inlines, don't start working on a new one. - - * Makefile.in (stamp-parse): Update conflict count. - (TAGS): Fix. - - * parse.y (explicit_instantiation): New rule; implements - 'template A' syntax (though not 'template foo(int)' yet). - (structsp): Add explicit_instantiation. - -Tue Jan 18 13:53:05 1994 Jason Merrill - - * class.c (finish_struct, etc.): Simplify decision to synthesize - a destructor. - - * call.c, class.c, cp-tree.h, decl.c, init.c, - ptree.c, search.c, typeck.c, typeck2.c: Nuke - TYPE_NEEDS_CONSTRUCTOR (change all calls to TYPE_NEEDS_CONSTRUCTING). - * init.c (expand_aggr_init_1): Don't try non-constructor methods - of initializing objects. - (build_new): Don't try other methods if the constructor lookup fails. - - * class.c (finish_base_struct): Set cant_have_default_ctor and - cant_synth_copy_ctor properly. - (finish_struct): Likewise. - -Mon Jan 17 13:58:18 1994 Jason Merrill - - * typeck.c (build_modify_expr_1): #if 0 out again. - (build_modify_expr): #if 0 out memberwise init code again. - - * lex.c (default_copy_constructor_body): Be const-correct. - (default_assign_ref_body): Likewise. - - * init.c (perform_member_init): Use TYPE_HAS_CONSTRUCTOR to decide - whether or not to use it, rather than TYPE_NEEDS_CONSTRUCTING. - (expand_aggr_init): Disable silent conversion from initializer list - to list of args for a constructor. - - * class.c (base_info): Lose needs_default_ctor. - (finish_base_struct): Likewise. - (finish_struct): Likewise. - - * decl.c (init_decl_processing): Don't turn off flag_default_inline - just because flag_no_inline is on. - (finish_decl): Use TYPE_HAS_CONSTRUCTOR to decide to use - constructor. - - * class.c (finish_struct): Synthesize default ctor whenever - allowed. - - * Makefile.in (TAGS): Don't try to run etags on cp-parse.y. - -Sat Jan 15 18:34:33 1994 Mike Stump - - * Makefile.in, configure: Handle the C++ front-end in a - subdirectory. - * cp-*: Move C++ front-end to cp/*. - -Fri Jan 14 14:09:37 1994 Jason Merrill - - * cp-typeck.c (build_function_call_real): Modify to match other - instances of taking the address of the function. - - * cp-class.c (finish_struct): Set TYPE_HAS_REAL_CONSTRUCTOR to 1 if - there are non-synthesized constructors. - Only set TYPE_NEEDS_CONSTRUCTOR if TYPE_HAS_REAL_CONSTRUCTOR. - Always generate copy constructor if possible. - - * cp-tree.h (lang_type): Add has_real_constructor bitfield. - (TYPE_HAS_REAL_CONSTRUCTOR): Define. - - * cp-lex.c (default_copy_constructor_body): Use init syntax - for all bases. - - * cp-type2.c (store_init_value): Only give error for initializer list - if TYPE_HAS_REAL_CONSTRUCTOR. - -Thu Jan 13 15:38:29 1994 Jason Merrill - - * cp-tree.h (DECL_SYNTHESIZED): Add defn. - (lang_decl): Add synthesized bitfield to decl_flags. - - * cp-lex.c (cons_up_default_function): Use DECL_SYNTHESIZED to mark - artificial methods, rather than a line # of 0. - -Fri Jan 14 18:25:29 1994 Kung Hsu - - * cp-decl (xref_tag): Fix a bug in conflict type. - * cp-parse.y: Add SCOPED_NAME for uninstantiated template nested - type reference. - * cp-spew.c (yylex): Generated SCOPED_NAME token. - * cp-lex.c (yyprint): Handle SCOPED_NAME. - -Fri Jan 14 17:00:29 1994 Mike Stump - - * cp-decl.c (pushdecl): Revert patch from Jan 11 19:33:03, as it is - not right. - -Thu Jan 13 14:00:35 1994 Kung Hsu - - * cp-decl2.c (grok_x_components): Fix a bug that enum type does not - have type_flags. - -Thu Jan 13 11:39:34 1994 Mike Stump - - Ensure that all vtable pointers are initialized with all the right - values. - - * cp-class.c (is_normal): Changed to reflect new meaning of - CLASSTYPE_VFIELD_PARENT. - * cp-class.c (maybe_fixup_vptrs): Use of - CLASSTYPE_NEEDS_VIRTUAL_REINIT here is misguided. Use - BINFO_MODIFIED instead. - * cp-class.c (finish_struct): Changed to reflect new meaning of - CLASSTYPE_VFIELD_PARENT. - * cp-decl.c (get_binfo_from_vfield): Removed, unneeded now. - * cp-decl.c (finish_function): Use init_vtbl_ptrs, instead of open - coding it here. - * cp-init.c (init_vfields): Changed name to init_vtbl_ptrs, and - re-implement. - * cp-init.c (emit_base_init): Use new name init_vtbl_ptrs. - * cp-tree.h (vfield_parent): Changed to integer. - * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Changed docs to reflect new - meaning. - * cp-tree.h (init_vtbl_ptrs): Added init_vtbl_ptrs. - -Wed Jan 12 18:24:16 1994 Kung Hsu - - * cp-decl.c (xref_tag): Re-implement globalize nested type. - * cp-decl2.c (grok_x_components): Ditto. - * cp-parse.y: Ditto. - * cp-tree.h (lang_type): Add no_globalize bit in type_flags. - -Wed Jan 12 14:08:09 1994 Jason Merrill - - * cp-decl.c (grokdeclarator): Don't set TREE_PUBLIC on friend - decls with a definition attached. - - * cp-typeck.c (build_modify_expr): Undo previous change in the case - of INIT_EXPRs. - -Tue Jan 11 19:33:03 1994 Jason Merrill - - * cp-typeck.c (build_modify_expr): Replace code for generating - assignment semantics for classes with an error. - (build_modify_expr_1): #if 0 out. - - * cp-decl.c (pushdecl): Patch bogus design of pushdecl - behavior for overloaded functions (it doesn't push anything). - - * cp-class.c (finish_struct): When generating default op=, - set TYPE_HAS_ASSIGNMENT. - -Mon Jan 10 18:48:06 1994 Mike Stump - - * cp-cvt.c (convert): Make {double, clashing enum} -> enum - invalid. - * cp-typeck.c (convert_for_assignment): Simplify. - * cp-decl2.c (warn_enum_clash): Removed. - * invoke.texi (-Wenum-clash): Removed. - * toplev.c (-Wenum-clash): Removed. - -Mon Jan 10 17:48:37 1994 Kung Hsu - - * cp-decl.c (finish_decl): Fix incorrect popclass call. - - * cp-decl.c (is_anon_name): New function, check whether the name - is anonymous name generated by compiler. - * cp-decl.c (grokdeclarator): Allow nested SCOPE_REF - * cp-spew.c (hack_more_ids): Handle nested type in template. - * cp-parse.y: Handle nested type reference in uninstantiated - template. - * cp-call.c (build_method_call): Handle uninstantiated template - case. - * cp-pt.c (search_nested_type_in_tmpl): New function, search nested - type in template. - * cp-pt.c (lookup_nested_type_by_name): New function, lookup nested - type by name. - * cp-pt.c (tsubst): Handle nested type search by name. - -Mon Jan 10 14:32:18 1994 Jason Merrill - - * cp-init.c (build_member_call): Propagate qualifiers to new type. - - * cp-call.c (build_method_call): Count functions the new way. - -Fri Jan 7 19:03:26 1994 Jason Merrill - - * cp-decl.c (pushtag): Set DECL_ASSEMBLER_NAME for nested classes, - too. - -Tue Jan 4 16:45:51 1994 Kung Hsu - - * cp-parse.y: Change to handle whether to globalize nested class. - * cp-decl.c (xref_tag, maybe_globalize_type): Likewise. - -Mon Jan 3 22:22:32 1994 Gerald Baumgartner - - * Makefile.in cp-call.c cp-class.c cp-cvt.c cp-decl.c cp-decl2.c - cp-error.c cp-init.c cp-lex.c cp-lex.h cp-method.c cp-parse.y - cp-spew.c cp-tree.c cp-tree.h cp-type2.c cp-typeck.c cp-xref.c - gplus.gperf toplev.c: Incorporated C++ signature extension. - * cp-sig.c: New file, contains most of signature processing. - * cp-hash.h: Regenerated from gplus.gperf. - - * gcc.1 g++.1: Added explanation for the `-fhandle-signatures' - and `-fno-handle-signatures' command line flags. - - * gcc.texi: Changed the last-modification date. - * invoke.texi: Added `-fhandle-signatures' in the list of - C++ language options. Added explanation for this option. - -Tue Dec 28 21:10:03 1993 Mike Stump - - * cp-init.c (expand_vec_init): Remove comptypes test, as it is too - harsh here. - -Tue Dec 28 13:42:22 1993 Mike Stump - - * cp-pt.c (do_pending_expansions): Decide to expand a template - member function, based upon it's class type, not the class type of - the first place it was declared. - -Tue Dec 28 05:42:31 1993 Mike Stump - - * cp-class.c (is_normal): New routine, use to determine when the - given binfo is the normal one. (The one that should have the simple - vtable name.) - * cp-class.c (modify_other_vtable_entries): Use DECL_ASSEMBLER_NAME - to check if two fndecls are `the same'. Sometimes this routine can - modify the main vtable, and normal should be 1, in that case, so use - is_normal() to determine if this is the main vtable for the class. - Don't recurse down virtual bases, as they are shared, and we take - care of them elsewhere. - * cp-class.c (modify_vtable_entries): If we have already updated the - vtable with the new virtual, don't do it again. - * cp-class.c (finish_struct): Set CLASSTYPE_VFIELD_PARENT as - appropriate. Do virtual function overriding in virtual bases, after - normal overriding, so that the base function list in DECL_VINDEX is - not overridden, before we have a chance to run through the list. - Use DECL_ASSEMBLER_NAME to check if two fndecls are `the same'. - Make sure we pass the right address into modify_vtable_entries. - * cp-tree.h (CLASSTYPE_VFIELD_PARENT): New field to indicate which - binfo is the one that has the vtable that we based our vtable on. - -Fri Dec 24 09:40:52 1993 Michael Tiemann - - * cp-typeck.c (c_expand_start_case): Use default_conversion to - convert expression from reference type if necessary. - -Wed Dec 22 17:58:43 1993 Jason Merrill - - * cp-typeck.c (build_unary_op): Make sure that it's a TREE_LIST before - trying to read its TREE_VALUE. - - * cp-class.c (finish_struct_methods): Clear DECL_IN_AGGR_P here. - (finish_struct): Instead of here. - -Tue Dec 21 14:34:25 1993 Brendan Kehoe - - * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't - have TYPE_PTRMEMFUNC_P set before we try to build its - CLASSTYPE_ID_AS_LIST. - (get_decl_list): Likewise, when trying to read it. - - * cp-tree.h (VTABLE_NAME): No def with NO_{DOLLAR,DOT} defined. - (VTABLE_NAME_P): Use it instead of VTABLE_NAME_FORMAT. - -Mon Dec 20 13:35:03 1993 Brendan Kehoe - - * cp-typeck.c (rationalize_conditional_expr): New function. - (unary_complex_lvalue): Use it. - (build_modify_expr): Use it, since trying to do an ADDR_EXPR of it - with build_unary_op won't cut it. Don't wrap the COND_EXPR with a - SAVE_EXPR either. - - * cp-decl2.c (explicit_warn_return_type): Deleted variable. - (lang_decode_option): Set warn_return_type, not explicit_*, for - -Wreturn-type and -Wall. This is what rest_of_compilation uses to - decide if it should go into jump_optimize or not. - * cp-tree.h (explicit_warn_return_type): Deleted. - * cp-decl.c (grokdeclarator): Use warn_return_type, not explicit_*. - (finish_function): Also complain about no return in a non-void fn if - we're being pedantic (don't rely on use of -Wreturn-type). - -Fri Dec 17 15:45:46 1993 Brendan Kehoe - - * cp-decl.c (grokdeclarator): Forbid declaration of a function as - static if it's being done inside another function. - - * cp-search.c (compute_visibility): Check for friendship both ways. - -Fri Dec 17 14:28:25 1993 Jason Merrill - - * cp-cvt.c (build_default_binary_type_conversion): Make error - messages more helpful. - - * cp-error.c (op_as_string): New function, returns "operator ==" - given EQ_EXPR or suchlike. - -Fri Dec 17 13:28:11 1993 Brendan Kehoe - - * cp-call.c (print_n_candidates): New function. - (build_overload_call_real): Use it when we complain about a call - being ambiguous. - -Fri Dec 17 12:41:17 1993 Jason Merrill - - * cp-call.c (build_method_call): Fix checking for static call - context. - - * cp-method.c (build_opfncall): Call build_indirect_ref on argument - to operator new. - - * cp-init.c (build_new): Don't mess with rval when building - indirect ref. - -Thu Dec 16 16:48:05 1993 Kung Hsu - - * cp-lex.c (default_assign_ref_body): Add check when TYPE_NESTED_ - NAME(type) may not be exist. It's not a problem for old compiler. - -Thu Dec 16 14:46:06 1993 Brendan Kehoe - - * cp-tree.h (CLASSTYPE_ALTERS_VISIBILITIES_P): Delete macro, it's - never used for anything. - (struct lang_type, member type_flags): Delete field - `alters_visibility', and up `dummy' by 1. - * cp-class.c (finish_base_struct): Delete code that copies the - setting of CLASSTYPE_ALTERS_VISIBILITIES_P. - (finish_struct): Delete code that sets it. - -Thu Dec 16 14:44:39 1993 Jason Merrill - - * cp-decl.c, cp-init.c, cp-typeck.c: Fix arguments to - build_method_call that I messed up before. - - * cp-search.c (get_base_distance): If protect > 1, allow immediate - private base. - - * cp-class.c (finish_base_struct): Set cant_synth_* correctly. - (finish_struct): Likewise. Well, nigh-correctly; it won't deal - properly with the case where a class contains an object of an - ambiguous base class which has a protected op=. Should be fixed - when the access control code gets overhauled. - (finish_struct_methods): Set TYPE_HAS_NONPUBLIC_* correctly. - -Thu Dec 16 12:17:06 1993 Brendan Kehoe - - * cp-lex.c (real_yylex): Turn the code back on that deals with - __FUNCTION__ and __PRETTY_FUNCTION__. Don't use lookup_name, to - avoid the ambiguity problems that led to it being turned off in the - first place. - - * cp-method.c (hack_identifier): Also check for a TYPE_PTRMEMFUNC_P - to see if something is a method. - -Wed Dec 15 18:35:58 1993 Mike Stump - - * cp-typeck.c (build_modify_expr): Avoid error messages on small - enum bit fields. - * cp-typeck.c (convert_for_assignment): Add missing argument to - cp_warning and cp_pedwarn calls. - -Wed Dec 15 18:25:32 1993 Jason Merrill - - * cp-parse.y (member_init): ANSI C++ doesn't forbid old-style base - initializers; it's just anachronistic. - - * cp-decl.c (finish_decl): Don't require external-linkage arrays - to have a complete type at declaration time when pedantic. - -Tue Dec 14 11:37:23 1993 Jason Merrill - - * cp-decl.c (pushdecl): Don't set DECL_CONTEXT if it's already set. - - * cp-call.c (build_method_call): Don't dereference pointer given - as instance. - - * cp-decl.c (finish_function): Don't pass pointer to - build_method_call. - (finish_function): Likewise. - - * cp-typeck.c (build_x_function_call): Likewise. - - * cp-method.c (build_component_type_expr): Likewise. - - * cp-init.c (build_member_call): Likewise. - (build_new): Likewise. - -Mon Dec 13 18:04:33 1993 Kung Hsu - - * cp-decl.c (xref_tag): Fix regression created by changes made - in Dec. 7 1993. - * cp-decl.c (xref_defn_tag): Fix parallel nested class problem. - -Fri Dec 10 12:40:25 1993 Brendan Kehoe - - * cp-call.c (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print - out the final evaluation of the function, so we can see if ELLIPSIS, - USER, and EVIL were set at the end. - - * cp-call.c (convert_harshness_ansi): When the parm isn't an lvalue, - only go for setting TRIVIAL_CODE if we are dealing with types that - are compatible. - -Thu Dec 9 18:27:22 1993 Mike Stump - - * cp-decl.c (flag_huge_objects): New flag to allow large objects. - * toplev.c (lang_options): Likewise. - * cp-decl2.c (flag_huge_objects, lang_f_options): Likewise. - * cp-decl.c (delta_type_node): New type for delta entries. - * cp-tree.h (delta_type_node): Likewise. - * cp-decl.c (init_decl_processing): Setup delta_type_node. - * cp-decl.c (init_decl_processing, build_ptrmemfunc_type): Use - delta_type_node instead of short_integer_type_node. - * cp-class.c (build_vtable_entry): Likewise. - -Thu Dec 9 16:19:05 1993 Brendan Kehoe - - * cp-tree.h (OPERATOR_TYPENAME_P): Define outside of - NO_{DOLLAR,DOT} macro checks, so it always gets defined. - (VTABLE_NAME_P): Define for NO_DOT && NO_DOLLAR_IN_LABEL. - -Wed Dec 8 17:38:06 1993 Mike Stump - - * cp-decl.c (finish_decl): Make sure things that can go into - "common", do go into common, if -fcommon is given. - -Wed Dec 8 13:01:54 1993 Brendan Kehoe - - * cp-call.c (print_harshness) [DEBUG_MATCHING]: New function. - (compute_conversion_costs_ansi) [DEBUG_MATCHING]: Print out - argument matching diagnostics to make instantly clear what the - compiler is doing. - - * cp-call.c (convert_harshness_ansi): If the parm isn't an lvalue, - then check to see if the penalty was increased due to - signed/unsigned mismatch, and use a TRIVIAL_CODE if it wasn't. - -Tue Dec 7 18:29:14 1993 Kung Hsu - - * cp-decl.c (xref_tag, pushtag): Fix nested class search/resolution - problem. - -Tue Dec 7 16:09:34 1993 Jason Merrill - - * cp-class.c (finish_struct): Before synthesizing methods, if no - methods have yet been declared then set nonprivate_method. Don't - set non_private method after synthesizing a method. - - * cp-lex.c (extract_interface_info): If flag_alt_external_templates - is set, tie emitted code to the location of template instantiation, - rather than definition. - - * cp-tree.h: Declare flag_alt_external_templates. - - * cp-decl2.c (lang_decode_option): Support -falt-external-templates. - - * toplev.c (lang_options): Likewise. - -Mon Oct 4 12:50:02 1993 Chip Salzenberg - - [changes propagated from 930810 snapshot] - * cp-decl.c (init_decl_processing): Make long long available for use - as SIZE_TYPE and PTRDIFF_TYPE. - (finish_decl): Allow file-scope static incomplete array. - (grokdeclarator): Don't pass on const and volatile fron function - value type to function type. - Warn here for volatile fn returning non-void type. - * cp-parse.y (attrib): Accept attributes `volatile' with alias - `noreturn', and `const'. - * cp-typeck.c (default_conversion): Don't lose const and volatile. - (build_binary_op_nodefault): Generate pedantic warning for comparison - of complete pointer type with incomplete pointer type. - (build_c_cast): Be careful that null pointer constant be INTEGER_CST. - -Tue Dec 7 10:46:48 1993 Jason Merrill - - * cp-init.c (expand_vec_init): When creating a temporary for copying - arrays, use the type of the source, not the target. - - * cp-cvt.c (convert): Pass an argument for errtype to - convert_to_reference. - - * cp-error.c (dump_expr, COMPONENT_REF & CALL_EXPR): Deal with - methods, -> and `this'. - -Mon Dec 6 17:12:33 1993 Jason Merrill - - * cp-error.c (parm_as_string): New function; returns `this' or arg - number. Corresponds to %P. - (dump_expr): Deal with method calls. - - * cp-cvt.c (convert_to_reference): Stop using warn_for_assignment. - * cp-typeck.c (convert_for_assignment): Likewise. - (warn_for_assignment): Lose. - -Mon Dec 6 11:33:35 1993 Brendan Kehoe - - * cp-call.c (ideal_candidate_ansi): Delete code that was never - doing anything useful. Instead, sort once, and DO NOT wipe - out any codes with EVIL_CODE, since that's what we use as a - marker for the end of the list of candidates. - - * cp-cvt.c (convert_to_aggr): Make sure to always set H_LEN. - -Mon Dec 6 12:49:17 1993 Jason Merrill - - * cp-init.c (get_aggr_from_typedef): New function, like - is_aggr_typedef but returns the _TYPE. - - * cp-call.c, cp-init.c, cp-method.c: Eradicate err_name. - -Sun Dec 5 18:12:48 1993 Brendan Kehoe - - * cp-lex.c (readescape): Pedwarn when a hex escape is out of range. - -Thu Nov 25 23:50:19 1993 Chip Salzenberg - - Delay language context change until beginning of next decl. - - * cp-lex.h (c_header_level): Removed. - (pending_lang_change): Declared. - * cp-lex.c (c_header_level): Renamed from in_c_header, made static. - (pending_lang_change): Defined. - (check_newline): Rework code that recognizes line number and - filename changes. Instead of pushing and popping lang context, - increment and decrement pending_lang_change. - (do_pending_lang_change): Push and pop lang context according - to value of pending_lang_change. - * cp-parse.y (extdefs): Use lang_extdef instead of extdef. - (extdef): Same as extdef, but call do_pending_lang_change() first. - -Mon Nov 15 15:39:15 1993 Chip Salzenberg - - * cp-typeck.c (build_binary_op_nodefault): Warn for ordered - compare of ptr with 0 only if pedantic in both cases. - -Thu Nov 25 13:31:37 1993 Chip Salzenberg - - Reinstate the below patch, which got lost in the Cygnus merge: - Tue Nov 23 13:59:24 1993 Hallvard B Furuseth (hbf@durin.uio.no) - * cp-parse.y (maybe_type_qual): Don't fail to set $$. - -Wed Nov 17 19:03:30 1993 Chip Salzenberg - - * cp-parse.y (attrib): Allow "ident(ident)" like the C front end. - -Fri Oct 22 20:43:37 1993 Paul Eggert - - * cp-lex.c (real_yylex): Diagnose floating point constants - that are too large. - -Wed Nov 17 19:10:37 1993 Chip Salzenberg - - * cp-type2.c (build_functional_cast): ARM page 16: When a class - and an object, function or enumerator are declared in the same - scope with the same name, the class name is hidden. - -Wed Nov 17 19:07:18 1993 Chip Salzenberg - - * cp-call.c (convert_harshness_ansi): Distinguish float, double, - and long double from each other when overloading. - (compute_conversion_costs_{ansi,old}, build_method_call, - build_overlay_call_real, convert_to_aggr): Always set and - always use H_LEN member of candidate structure. - -Mon Oct 11 23:10:53 1993 Chip Salzenberg - - * cp-decl.c (duplicate_decls): Note redeclarations of library - functions, and generate distinct warnings for them. - -Mon Oct 4 12:26:49 1993 Chip Salzenberg - - Support format warnings in G++. - - * cp-tree.h: Protect against multiple inclusion. - Declare all public functions in c-common.c (copy from c-tree.h). - (STDIO_PROTO): Define. - (warn_format): Declare. - (record_format_info): Remove declaration. - * cp-decl.c (init_decl_processing): Call init_function_format_info. - * cp-decl2.c (lang_decode_option): Make "-Wall" include warn_format. - * cp-typeck.c (build_function_call_real): Call check_function_format. - (record_format_info): Remove -- obsolete stub. - -Sat Jul 24 12:04:29 1993 Chip Salzenberg - - * cp-decl.c (duplicate_decls): Don't warn for non-extern var decl - following an extern one (for -Wredundant-decls). - * cp-parse.y (primary): In statement expression case, if compstmt - returns something other than a BLOCK, return it unchanged. - -Thu Dec 2 20:44:58 1993 Chip Salzenberg - - * cp-decl.c (warn_extern_redeclared_static): New function made - from code extracted from pushdecl. - (duplicate_decls, pushdecl): Call new function. - (lookup_name_current_level): Allow for IDENTIFIER_GLOBAL_VALUE - to be a TREE_LIST when function is declared in 'extern "C" {}'. - -Fri Dec 3 16:01:10 1993 Jason Merrill - - * cp-class.c (duplicate_tag_error): Use cp_error. - (finish_base_struct): Check for ambiguity with direct base, and don't - generate op= or copy ctor if it exists. - -Fri Dec 3 15:32:34 1993 Kung Hsu - - * cp-init.c (expand_member_init): When initializer name is null, - don't try to build it now because emit_base_init will handle it. - -Fri Dec 3 12:28:59 1993 Jason Merrill - - * cp-lex.c (init_lex): Initialize input_filename to "" for - code such as ExceptionHandler::operator=. - -Fri Dec 3 10:32:08 1993 Jason Merrill - - * cp-decl.c (grokdeclarator): Don't try to print out dname when - complaining about arrays of references if decl_context==TYPENAME, - since it will be null. - - * cp-decl2.c: Default to flag_ansi_overloading. - -Thu Dec 2 18:05:56 1993 Kung Hsu - - * cp-call.c (build_method_call): Use binfo from instance if it's - different from binfo (basetype_path) passed from above. - -Wed Nov 17 19:14:29 1993 Chip Salzenberg - - cp-error.c (dump_expr): Use unsigned chars to output a - TREE_REAL_CST in hex. - -Thu Dec 2 11:05:48 1993 Jason Merrill - - * cp-class.c (finish_struct): Fix typo in setting - cant_synth_asn_ref. - - * cp-tree.h (TYPE_NESTED_NAME): New macro, does - DECL_NESTED_TYPENAME (TYPE_NAME (NODE)). - - * cp-lex.c (default_copy_constructor_body): Change - DECL_NAME (TYPE_NAME (btype)) to TYPE_NESTED_NAME (btype). - (default_assign_ref_body): Likewise. - (default_copy_constructor_body): Call operator= explicitly for - base classes that have no constructor. - -Thu Dec 2 10:47:15 1993 Michael Tiemann - - * cp-call.c (build_method_call): If the instance variable is - converted to error_mark_node when we're trying to convert it to the - base type of a method we're looking up, return error_mark_node. - -Thu Dec 2 10:41:16 1993 Torbjorn Granlund - - * cp-typeck.c (build_binary_op_nodefault): In *_DIV_EXPR *_MOD_EXPR - cases, tests for unsigned operands by peeking inside a NOP_EXPR. - -Wed Dec 1 13:33:34 1993 Brendan Kehoe - - * cp-call.c (compute_conversion_costs_ansi): Use the size of struct - harshness_code, not the size of short, for clearing out the - ansi_harshness. - - * cp-call.c (print_candidates): New function. - (build_method_call): When we had some candidates, but didn't get a - usable match, don't report that we got an error with the first - candidate. Instead, say there were no matches, and list the - candidates with print_candidates. In the second pass, make sure we - clear out ever_seen, so we can accurately count the number of - functions that qualified. - -Wed Dec 1 09:53:59 1993 Torbjorn Granlund - - * cp-typeck.c (build_binary_op_nodefault): Shorten for *_MOD_EXPR - only if op1 is known to be != -1. - (build_binary_op_nodefault): Handle *_DIV_EXPR likewise. - -Tue Nov 30 14:07:26 1993 Brendan Kehoe - - * cp-method.c (hack_identifier): If the field itself is private, and - not from a private base class, say so. - -Mon Nov 29 03:00:56 1993 Jason Merrill - - * cp-decl.c (grokdeclarator): Always warn on initialization of - const member. - -Wed Nov 24 00:49:35 1993 Jason Merrill - - * cp-class.c (finish_struct): Set TYPE_GETS_CONST_* properly. - (finish_base_struct): Set cant_synth_asn_ref properly. - - * cp-lex.c (cons_up_default_function): Add section for operator=. - (default_assign_ref_body): New function, mostly cribbed from - default_copy_constructor_body. - - * cp-class.c (base_info): Add members cant_synth_copy_ctor, - cant_synth_asn_ref, no_const_asn_ref. - (finish_base_struct): Update no_const_asn_ref, note that you should - update cant_synth_*, propagate TYPE_GETS_ASSIGN_REF. - (finish_struct): Add decls for cant_synth_*, no_const_asn_ref, and - initialize them properly. Set no_const_asn_ref properly. Set - cant_synth_* in some of the situations where they should be set. - Propagate TYPE_GETS_ASSIGN_REF. Use cant_synth_copy_ctor. Add call - to cons_up_default_function for operator=. - -Tue Nov 23 20:24:58 1993 Mike Stump - - * cp-cvt.c (convert_force): Add code to perform casting of pointer - to member function types. - * cp-typeck.c (build_ptrmemfunc): Add FORCE parameter to indicate - when the conversion should be done, regardless. - * cp-tree.h (build_ptrmemfunc): Likewise. - * cp-type2.c (digest_init): Likewise. - * cp-typeck.c (convert_for_assignment): Likewise. - -Tue Nov 23 18:06:58 1993 Jason Merrill - - * cp-error.c (dump_expr): Do the right thing for variables of - reference type. - - * cp-decl.c (grok_op_properties): Set TYPE_HAS_ASSIGN_REF - and its kin properly. - (xref_tag): Propagate TYPE_GETS_ASSIGN_REF. - -Tue Nov 23 12:26:13 1993 Mike Stump - - * cp-method.c (build_opfncall): Don't count pointer to member - functions as aggregates here, as we don't want to look up methods in - them. The compiler would core dump if we did, as they don't have - normal names. - * cp-typeck.c (build_indirect_ref): Improve wording on error - message. - -Mon Nov 22 14:22:23 1993 Jason Merrill - - * cp-decl.c (grok_op_properties): Allow operator?: with pedwarn - (since it's supported in other compiler bits). - - * cp-method.c (report_type_mismatch): Use cp_error; ignore err_name - argument. - - * cp-error.c (dump_function_decl): Don't print return type for - constructors and destructors. - - * cp-cvt.c (cp_convert_to_pointer): Import code from - convert_to_pointer so we can return error_mark_node in the case of an - error, and to allow more meaningful error messages. - (build_type_conversion): Don't go through void* when trying - to convert to a pointer type. - - * cp-decl.c (grokfndecl): Move call to grok_op_properties back - after grokclassfn so that it's dealing with the right decl. - (grok_op_properties): Don't assert !methodp for op new and op delete. - - * cp-init.c (build_delete): Don't use TYPE_BUILT_IN (there are now - no uses of it in the compiler). - - * cp-call.c (build_scoped_method_call): Fix for destructors of simple - types. - (build_method_call): Likewise. - -Fri Nov 19 12:59:38 1993 Jason Merrill - - * cp-tree.c (count_functions): Abstraction function. - - * cp-call.c (build_overload_call_real): Deal with new overloading - properly, remove dead code. - - * gcc.c (default_compilers): Generate and use .ii files in the - intermediate stage of compiling C++ source. - -Fri Nov 19 11:26:09 1993 Jim Wilson - - * cp-expr.c (cplus_expand_expr): Make call_target a valid memory - address before using it, so it can be later safely compared. - -Fri Nov 12 15:30:27 1993 Jason Merrill - - * cp-pt.c (tsubst): Deal with new overloading. - - * cp-typeck.c (fntype_p): Is the arg function type? - (comp_target_parms): pedwarn on conversion from (anything) to (...). - (build_x_function_call): Deal with new overloading. - - * cp-tree.c (decl_list_length): Deal with new overloading. - (decl_value_member): Like value_member, but for DECL_CHAINs. - - * cp-decl.c (duplicate_decls): Deal with new overloading. - (start_decl): Likewise. - - * cp-class.c (instantiate_type): Deal with new overloading. - - * cp-call.c (convert_harshness_ansi): Deal with new overloading. - (convert_harshness_old): Deal with new overloading. - (build_overload_call_real): Likewise. - -Mon Nov 8 13:50:49 1993 Jason Merrill - - * cp-tree.c (get_unique_fn): New function; returns FUNCTION_DECL - if unambiguous, NULL_TREE otherwise. - (get_first_fn): Returns the first appropriate FUNCTION_DECL. - (is_overloaded_fn): Returns whether or not the passed tree is - a function or list of functions. - - * cp-init.c (init_init_processing): Use `get_first_fn' to find - the FUNCTION_DEFN for new and delete. - - * cp-decl.c (push_overloaded_decl): Use new overloading strategy, cut - code size in half (I spit on special cases). - -Tue Sep 7 20:03:33 1993 Jason Merrill - - * cp-decl.c: Allow references and template type parameters as well diff --git a/gcc/cp/ChangeLog.2 b/gcc/cp/ChangeLog.2 deleted file mode 100644 index c4d6880a00d..00000000000 --- a/gcc/cp/ChangeLog.2 +++ /dev/null @@ -1,20677 +0,0 @@ -1999-12-31 Mark Mitchell - - * cp-tree.h (VF_NORMAL_VALUE): Remove. - * class.c (struct base_info): Remove vfield, vfields, and rtti. - (set_primary_base): New function, split out from ... - (finish_base_struct): ... here. Rename to ... - (determine_primary_base): ... this. Simplify. - (create_vtable_ptr): Tweak accordingly. - (finish_struct_1): Simplify. - - * cp-tree.h (CLASSTYPE_VBASECLASSES): Update documentation. - (CLASSTYPE_N_BASECLASSES): Likewise. - (BINFO_FOR_VBASE): New macro. - (get_vbase_types): Change prototype. - * class.c (build_vbase_path): Use BINFO_FOR_VBASE. - (prepare_fresh_vtable): Likewise. - (finish_vtbls): Likewise. - (get_class_offset_1): Likewise. - (modify_all_indirect_vtables): Likewise. - (build_vbase_pointer_fields): Likewise. - * decl.c (xref_basetypes): Don't set CLASSTYPE_VBASECLASSES here. - * init.c (sort_base_init): Use BINFO_FOR_VBASE. - (expand_member_init): Likewise. - * search.c (get_base_distance): Likewise. - (lookup_field_queue_p): Likewise. - (virtual_context): Likewise. - (get_vbase_types): Don't return a value. Set - CLASSTYPE_VBASECLASSES here. - * typeck.c (get_delta_difference): Use BINFO_FOR_VBASE. - -1999-12-30 Mark Mitchell - - * class.c (fixup_inline_methods): Clear CLASSTYPE_INLINE_FRIENDS. - -1999-12-29 Mark Mitchell - - * class.c (create_vtable_ptr): Put the vtable at the beginning of - the class, not the end, in the new ABI. - * tree.c (propagate_binfo_offsets): Do the right thing for the new - ABI. - -1999-12-29 Mark Mitchell - - * cp-tree.h (lang_type): Add nearly_empty_p. Adjust dummy. - (CLASSTYPE_NEARLY_EMPTY_P): New macro. - * class.c (check_bases): Update CLASSTYPE_NEARLY_EMPTY_P. - (check_field_decls): Likewise. - (check_bases_and_members): Likewise. - -1999-12-28 Mark Mitchell - - * cp-tree.h (do_inline_function_hair): Remove. - * class.c (layout_class_type): New function, split out from - finish_struct_1. - (fixup_pending_inline): Likewise. - (fixup_inline_methods): New function. - * method.c (fixup_pending_inline): Remove. - (do_inline_function_hair): Likewise. - - * decl.c (BOOL_TYPE_SIZE): Bools always have size `1' under the - new ABI. - - * cp-tree.h (lang_type): Replace abstract_virtuals with pure_virtuals. - (CLASSTYPE_ABSTRACT_VIRTUALS): Rename to ... - (CLASSTYPE_PURE_VIRTUALS): ... this. - (lang_decl_flags): Replace abstract_virtual with pure_virtual. - (DECL_ABSTRACT_VIRTUAL_P): Rename to ... - (DECL_PURE_VIRTUAL_P): ... this. - (get_abstract_virtuals): Rename to ... - (get_pure_virtuals): ... this. - * call.c (build_new_method_call): Replace DECL_PURE_VIRTUAL_P with - DECL_ABSTRACT_VIRTUAL_P. Replace CLASSTYPE_ABSTRACT_VIRTUALS with - CLASSTYPE_PURE_VIRTUALS. - * class.c (build_vtable_entry): Likewise. - (finish_struct_bits): Likewise. Call get_pure_virtuals, not - get_abstract_virtuals. - (build_vtbl_initializer): Likewise. - (override_one_vtable): Likewise. - (check_methods): Likewise. - * decl.c (duplicate_decls): Likewise. - (redeclaration_error_message): Likewise. - (lang_mark_tree): Likewise. - * decl2.c (grok_function_init): Likewise. - (import_export_vtable): Likewise. - (import_expor_class): Likewise. - * typeck2.c (abstract_virtuals_error): Likewise. - * xref.c (GNU_xref_member): Likewise. - * search.c (get_abstract_virtuals): Rename to get_pure_virtuals. - -1999-12-26 Zack Weinberg - - * cp-tree.h: Replace ENABLE_CHECKING with ENABLE_TREE_CHECKING - throughout. - -1999-12-26 Mark Mitchell - - * decl.c (store_return_init): Use mode of old RTL generated for - DECL_RESULT, not the mode of DECL_RESULT itself. - * semantics.c (finish_named_return_value): Set DECL_UNINLINABLE - for functions that used named return values. - -1999-12-24 Mark Mitchell - - * semantics.c (expand_body): Use - note_deferral_of_defined_inline_function. - -1999-12-22 Mark Mitchell - - * dump.c (dequeue_and_dump): Handle CTOR_STMTs. - -1999-12-22 Alexandre Oliva - - * error.c (dump_decl): Support named return values. - -1999-12-20 Mark Mitchell - - * cp-tree.h (CLASSTYPE_VFIELD_PARENT): Update comments. - (CLASSTYPE_HAS_PRIMARY_BASE_P): New macro. - (CLASSTYPE_PRIMARY_BINFO): Likewise. - * class.c (check_methods): Don't set TYPE_HAS_COMPLEX_INIT_REF, - TYPE_NEEDS_CONSTRUCTING, and CLASSTYPE_NON_AGGREGATE here. - (check_bases_and_members): Set them here instead. - (create_vtable_ptr): New function, split out from ... - (finish_struct_1): ... here. Use it. Tidy. Use - CLASSTYPE_HAS_PRIMARY_BASE_P and CLASSTYPE_PRIMARY_BINFO. - * search.c (dfs_init_vbase_pointers): Handle seeing TYPE_VFIELD as - the first field in the class. - * tree.c (layout_basetypes): Use CLASSTYPE_N_BASECLASSES. Handle - seeing TYPE_VFIELD as the first field in the class. - - * cp-tree.h (TYPE_VIRTUAL_P): Rename to ... - (TYPE_POLYMORPHIC_P): ... this. - (TYPE_USES_COMPLEX_INHERITANCE): Rename to ... - (TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P): ... this. - (TREE_CALLS_NEW): Remove. - (TREE_MANGLED): Likewise. - * call.c (build_vfield_ref): Use TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P, - and TYPE_POLYMORPHIC_P. - * class.c (check_bases): Likewise. - (finish_base_struct): Likewise. - (finish_struct_bits): Likewise. - (check_for_override): Likewise. - (finish_struct_1): Likewise. - (get_vfield_name): Likewise. - * decl.c (xref_basetypes): Likewise. - * decl2.c (import_export_class): Likewise. - (import_export_decl): Likewise. - * error.c (dump_function_decl): Likewise. - * pt.c (instantiate_class_template): Likewise. - * repo.c (repo_inline_used): Likewise. - * rtti.c (build_headof): Likewise. - (get_tinfo_fn_dynamic): Likewise. - (build_x_typeid): Likewise. - (get_tinfo_var): Likewise. - (build_dynamic_cast_1): Likewise. - (synthesize_tinfo_fn): Likewise. - * search.c (lookup_field_1): Likewise. - (dfs_debug_mark): Likewise. - (maybe_suppress_debug_info): Likewise. - * typeck.c (build_component_ref): Likewise. - (build_component_addr): Likewise. - * typeck2.c (process_init_constructor): Likewise. - -1999-12-20 Nathan Sidwell - - * typeck.c (strip_all_pointer_quals): New static function. - (build_static_cast): Use it. Don't use at_least_as_qualified_p. - -1999-12-16 Mark Mitchell - - * cp-tree.h (cp_tree_index): Add CPTI_DSO_HANDLE. - (dso_handle_node): New macro. - (flag_use_cxa_atexit): New variable. - (declare_global_var): New function. - (start_anon_func): Remove declaration. - (end_anon_func): Likewise. - * decl.c (get_atexit_node): New function, split out from - destroy_local_static. Handle flag_use_cxa_atexit. - (get_dso_handle_node): Likewise. - (start_cleanup_fn): Renamed from start_anon_func. Moved here from - except.c. Handle flag_use_cxa_atexit. - (end_cleanup_fn): Renamed from end_anon_func. Moved here from - except.c. - (declare_global_var): New variable. - (destroy_local_static): Handle flag_use_cxa_atexit. - * decl2.c (flag_use_cxa_atexit): New variable. - (lang_f_options): Likewise. - * except.c (start_anon_func): Remove. - (end_anon_func): Liekwise. - * lang-options.h: Add -fuse-cxa-atexit and -fno-use-cxa-atexit. - * rtti.c (get_tinfo_var): Use declare_global_var. - -1999-12-16 Mark Mitchell - - * class.c (check_field_decls): Don't return a value. - (avoid_overlap): Moved here from tree.c. - (build_base_fields): Likewise. - (check_bases): New function, split out from finish_base_struct. - (check_bases_and_members): New function, split out from - finish_struct_1. - (struct base_info): Remove cant_have_default_ctor, - cant_have_const_ctor, cant_have_asn_ref. - (finish_base_struct): Split semantic analysis into check_bases. - (finish_struct_methods): Fix bogus assertion. - (check_field_decls): Call finish_struct_anon here. - (build_vbase_pointer_fields): Use CLASSTYPE_N_BASECLASSES. - (finish_struct_1): Use check_bases_and_members. Reorganize. - * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. - (build_base_fields): Don't declare. - * tree.c (avoid_overlap): Remove. - (build_base_fields): Likewise. - - * optimize.c (struct inline_data): Remove scope_stmt. - (remap_block): Don't use insert_block_after_note. Don't update - scope_stmt. - (expand_call_inline): Don't update scope_stmt. - (optimize_function): Don't initialize scope_stmt. - * semantics.c (expand_stmt): Set NOTE_BLOCK for newly emitted - NOTE_INSN_BLOCK_BEG/NOTE_INSN_BLOCK_END notes. - -1999-12-15 Mark Mitchell - - * class.c (handle_using_decl): Get TYPE_FIELDS and TYPE_METHODS - out of the class, rather than taking them as parameters. - (build_vbase_pointer_fields): Move here from tree.c. - (build_vtbl_or_vbase_field): New function. - (check_methods): Likewise. - (remove_zero_width_bitfields): Likewise. - (add_virtual_function): Use tree_cons instead of temp_tree_cons. - (delete_duplicate_fields_1): Tidy. Don't delete duplicate - USING_DECLs here. - (finish_struct_methods): Handle the case where there are no - methods here. - (get_basefndecls): Use tree_cons instead of temp_tree_cons. - (check_field_decls): Call delete_duplicate_fields here. - (finish_struct_1): Tidy. Use check_methods and - remove_zero_width_bitfields. - * cp-tree.h (build_vbase_pointer_fields): Remove. - * decl.c (grokdeclarator): Use tree_cons instead of - temp_tree_cons. - * decl2.c (qualified_lookup_using_namespace): Use tree_cons - instead of temp_tree_cons. - * lex.c (cons_up_default_function): Remove dead code. - * method.c (fixup_pending_inline): New function, split out from ... - (do_inline_function_hair): ... here. - * tree.c (build_vbase_pointer_fields): Remove. - -1999-12-15 Jason Merrill - - * tree.c (walk_tree): Walk operand subtrees in forward order. - * optimize.c (expand_call_inline): Likewise. - (optimize_function): Initialize id->scope_stmt to something useful. - (remap_block): Assume id->scope_stmt has a useful value. - -1999-12-15 Nathan Sidwell - - * typeck.c (build_c_cast): Expand warning message. Move pointer - alignment warning to after the cast. Don't warn about pointer - alignment when given a pointer to incomplete. - -1999-12-15 Richard Henderson - - * cp-tree.h (make_aggr_type): Declare. - * lex.c (cp_make_lang_type): Don't SET_IS_AGGR_TYPE. - (make_aggr_type): New. - - * decl.c (build_typename_type, init_decl_processing): Use it. - (build_ptrmemfunc_type, xref_tag): Likewise. - * except.c (call_eh_info): Likewise. - * init.c (init_init_processing): Likewise. - * pt.c (process_template_parm, lookup_template_class): Likewise. - * rtti.c (expand_class_desc): Likewise. - * semantics.c (begin_class_definition, finish_typeof): Likewise. - * tree.c (copy_template_template_parm): Likewise. - -1999-12-15 Jason Merrill - - * cp-tree.def (TEMPLATE_PARM_INDEX): Calculate size using - sizeof (struct tree_common). - -1999-12-14 Jason Merrill - - * optimize.c (expand_call_inline): Set BLOCK_ABSTRACT_ORIGIN on the - outermost block to point to the inlined function decl. - - * error.c (dump_decl): operator==, not operator ==. - (op_to_string): Likewise. - - * decl.c (compute_array_index_type): Handle null name. - - * decl2.c (ambiguous_decl): Fix to match comment. - (lookup_using_namespace): Adjust. - - * decl2.c (import_export_class): Don't ignore dllimport. - -1999-12-14 Mark Mitchell - - * class.c (check_field_decls): Split out from ... - (finish_struct_1): ... here. Use it. Tidy. - - * cp-tree.h (remap_save_expr): Add walk_subtrees parameter. - * optimize.c (copy_body_r): Pass it. - * tree.c (remap_save_expr): Clear walk_subtrees for an - already-handled SAVE_EXPR. - (cp_unsave_r): Pass walk_subtrees to remap_save_expr. - - * dump.c (dequeue_and_dump): Dump DECL_NAMESPACE_ALIAS. - * ir.texi (DECL_NAMESPACE_ALIAS): Document it. - - * error.c (dump_expr): Handle EXPR_WITH_FILE_LOCATION. - -1999-12-14 Mumit Khan - - * class.c (finish_base_struct): Allow multiple COM base classes - as well as non-COM bases as long as it's not the leftmost. - -1999-12-13 Mumit Khan - - * lex.c (saving_parse_to_obstack): New global. - (reinit_parse_for_block): Use. - (reinit_parse_for_expr): Use. - (check_newline): Use. - -1999-12-13 Mark Mitchell - - * optimize.c (initialize_inlined_parameters): Take FN to which the - parameters belong as an argument. - (expand_call_inline): Expand calls into the parameter - initializations before pushing the function onto the list of - functions we are presently expanding. - -1999-12-11 Kaveh R. Ghazi - - * class.c (get_vtable_name): Use a literal format string and - VTABLE_NAME_PREFIX macro instead of VTABLE_NAME_FORMAT. - (prepare_fresh_vtable): Likewise. - - * cp-tree.h (VTABLE_NAME_PREFIX): Define this instead of - VTABLE_NAME_FORMAT. - - * decl.c (make_rtl_for_local_static): Remove unused variable `type'. - - * init.c (build_vec_init): Initialize variable `try_body'. - - * lex.c (yyerror): Don't call a variadic function with a - non-literal format string. - - * optimize.c (optimize_function): Call memset, not bzero. - - * pt.c (for_each_template_parm_r): Add static prototype. - -1999-12-09 Andreas Jaeger - - * except.c (expand_throw): Add static attribute to match - prototype. - - * Makefile.in (semantics.o): Add dependency on output.h. - * semantics.c: Include output.h for declaration of - make_function_rtl. - -1999-12-09 Mark Mitchell - - * decl.c (init_decl_processing): Reenable inlining on trees. - (finish_function): Likewise. - * expr.c (cplus_expand_expr): Don't handle AGGR_INIT_EXPR here. - * semantics.c (simplify_aggr_init_exprs): New function. - (expand_body): Use it. - * tree.c (walk_tree): Special-case TARGET_EXPRs since they - sometimes present the same sub-tree twice. - - * dump.c (dequeue_and_dump): Abbreviate `class' as `cls', not - `csl'. - - * semantics.c (finish_switch_cond): Do conversions here, not ... - * typeck.c (c_expand_start_case): Here. - - * semantics.c (do_poplevel): Remove unused variable. - -1999-12-06 Mark Mitchell - - * tree.c (walk_tree): Don't recurse into DECL_INITIAL or DECL_SIZE - unless we're declaring the variable in question. - -1999-12-06 Mark Mitchell - - * decl.c (init_decl_processing): #if 0 last patch. - (finish_function): Likewise. - -1999-12-05 Mark Mitchell - - * decl.c (init_decl_processing): Set flag_inline_trees if - !flag_no_inline. - - * cp-tree.h (calls_setjmp_p): Declare. - * decl.c (finish_function): Mark functions that call setjmp as - uninlinable. - * optimize.c (calls_setjmp_r): New function. - (calls_setjmp_p): Likewise. - -1999-12-04 Mark Mitchell - - * optimize.c (expand_call_inline): Wrap the expanded call in an - EXPR_WITH_FILE_LOCATION node to get correct line numbers for - inlined functions. - - * optimize.c (inline_data): Remove fns_top. Add scope_stmt. Add - in_target_cleanup_p. - (remap_decl): New function. - (remap_block): Likewise. - (copy_scope_stmt): Likewise. - (copy_body_r): Use remap_decl and copy_scope_stmt. - (copy_body): Use VARRAY_TOP_TREE. - (initialize_inlined_parameters): Likewise. - (declare_return_variable): Likewise. - (inlinable_function_p): Check flag_inline_trees. - (expand_call_inline): Handle SCOPE_STMTs and TARGET_EXPRs - specially. Use VARRAY_PUSH_TREE. Create a BLOCK for the - parameters of the inlined function. - (optimize_function): Prevent recursion into partially complete - functions. - - * cp-tree.def (SCOPE_STMT): Take one operand. - * cp-tree.h (SCOPE_STMT_BLOCK): New macro. - (SCOPE_NULLIFIED_P): Redefine. - (SCOPE_NO_CLEANUPS_P): New macro. - (add_scope_stmt): Change prototype. - * decl.c (poplevel): Tidy. Warn about unused variables here. - Record SCOPE_STMT_BLOCKs. - (finish_function): Keep DECL_INITIAL for functions that might be - inlined. - * ir.texi: Document SCOPE_NO_CLEANUPS_P. - * semantics.c: Include rtl.h. - (add_scope_stmt): Return the new scope statement and, for an - end-of-scope statement, its matching begin statement. Don't set - SCOPE_NULLIFIED_P. - (do_pushlevel): Simplify, now that we are always - function-at-a-time. - (do_poplevel): Likewise. Record SCOPE_STMT_BLOCKs. - (expand_stmt): Don't call expand_start_bindings or - expand_end_bindings for a scope with SCOPE_NO_CLEANUPS_P set. - * tree.c (copy_tree_r): Clear SCOPE_STMT_BLOCK rather than setting - SCOPE_NULLIFIED_P. - * Makefile.in (semantics.o): Depend on RTL_H. - - * decl2.c (pending_statics_used): Make it a macro. - (saved_inlines_used): Likewise. - (finish_static_data_member_decl): Use VARRAY_PUSH_TREE. - (mark_inline_for_output): Likewise. - (ssdf_decls_used): Remove. - (start_static_storage_duration_function): Use VARRAY_PUSH_TREE. - (generate_ctor_or_dtor_function): Adjust accordingly. - -1999-11-24 Geoffrey Keating - Greg McGary - - * decl.c (duplicate_decls): Merge - DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, - DECL_NO_CHECK_MEMORY_USAGE, DECL_NO_LIMIT_STACK. - -1999-12-02 Mike Stump - - * init.c (perform_member_init): Handle parse errors better. - -1999-12-01 Mark Mitchell - - * cp-tree.h (min_tree_cons): Remove. - (scratch_ovl_cons): Likewise. - * decl.c (saveable_obstack): Don't declare. - (duplicate_decls): Tweak error-message. - (initialize_local_var): Explicitly mark the definition as static. - (finish_function): Call permanent_allocation, just so - that the middle-end sees the obstacks it expects. - (mark_cp_function_context): Likewise. - * init.c (build_new): Don't use min_tree_cons. - * lex.c (permanent_obstack): Don't declare. - (current_obstack, saveable_obstack): Likewise. - * spew.c (current_obstack, saveable_obstack): Likewise. - * tree.c (current_obstack, saveable_obstack): Likewise. - (scratch_ovl_cons): Remove. - (build_min_nt): Don't mess with obstacks. - (build_min): Likewise. - (min_tree_cons): Remove - * typeck.c (build_component_ref): Don't use scratch_ovl_cons. - (build_x_function_call): Likewise. - (build_c_cast): Don't use min_tree_cons. - -1999-11-29 Mark Mitchell - - * pt.c (tsubst_decl): Robustify. - -1999-11-27 Mark Mitchell - - * decl2.c (finish_file): Call expand_body for inline functions - that will be written out but that do not yet have RTL. - * semantics.c (expand_body): Do not generate RTL For inline - functions that do not yet need to be written out. - -1999-11-25 Mark Mitchell - - * Make-lang.in (CXX_SRCS): Add optimize.c. - * Makefile.in (CXX_OBJS): Add optimize.o. - (CXX_TREE_H): Add splay-tree.h, system.h, and $(CONFIG_H). - (spew.o, lex.o, decl.o, decl2.o, typeck2.o, typeck.o): Adjust. - (class.o, call.o, friend.o, init.o, method.o, cvt.o): Likewise. - (search.o, tree.o, ptree.o, rtti.o, except.o, expr.o): Likewise. - (xref.o, pt.o, error.o, errfn.o, repo.o, semantics.o): Likewise. - (dump.o): Likewise. - (optimize.o): New target. - * class.c: Don't include splay-tree.h. - * cp-tree.def (CTOR_COMPLETE): Rename to CTOR_STMT. - * cp-tree.h: Include splay-tree.h. - (DECL_UNINLINABLE): New macro. - (CTOR_BEGIN_P, CTOR_END_P): New macros. - (flag_inline_trees): New variable. - (local_variable_p): New function. - (nonstatic_local_decl_p): Likewise. - (optimize_function): Likewise. - (cplus_unsave_expr_now): Remove. - (copy_tree_r): Declare. - (remap_save_expr): Likewise. - * decl.c (local_variable_p): Don't - make it static. - (local_variable_p_walkfn): New function. - (make_rtl_for_local_static): Remove code to try to avoid writing - out static constants. - (emit_local_var): Fix indentation. - (nonstatic_local_decl_p): New function. - (check_default_argument): Use local_variable_p_walkfn, not - local_variable_p, when walking the tree. - (start_function): Set the DECL_CONTEXT for automatically generated - labels. - (finish_constructor_body): Use CTOR_STMT to mark the end of a - constructor. - * decl2.c: Don't include splay-tree.h. - (flag_inline_trees): Define. - * dump.c: Don't include - splay-tree.h. - * except.c (expand_end_catch_block): Fix comment formatting. - (expand_end_eh_spec): Set DECL_CONTEXT on temporary variables. - (expand_throw): Tidy comment. - * init.c (build_vec_delete_1): Use create_temporary_var. - * lex.c (cplus_tree_code_type): Make it static. - (cplus_tree_code_length): Likewise. - (cplus_tree_code_name): Likewise. - * optimize.c: New file. - * semantics.c (finish_goto_stmt): Set DECL_UNLINABLE for functions - with computed gotos. - (setup_vtbl_ptr): Mark the beginnings of constructors with - CTOR_STMT. - (expand_stmt): Handle CTOR_STMT, not CTOR_COMPLETE. - (expand_body): Call optimize_function. Save bodies if we're doing - inlining on trees. - * tree.c: Don't include splay-tree.h. Include insn-config.h and - integrate.h. - (copy_tree_r): Make it public. - (statement_code_p): New function. - (mark_local_for_remap_r): Likewise. - (cp_usave_r): Likewise. - (cp_unsave): Likewise. - (build_cplus_new): Set DECL_CONTEXT for temporary variables. - (walk_tree): Walk into `s' class nodes. Walk statement chains. - (copy_tree_r): Handle 's' class nodes. Restore chains for - statements. Nullify scopes. Don't copy types. - (init_tree): Set lang_unsave to cp_unsave. - (remap_save_expr): Define. - * ir.texi: Document CTOR_STMT. - -1999-11-24 Jason Merrill - - * search.c (note_debug_info_needed): Do perform this optimization - for dwarf2. - (maybe_suppress_debug_info): Likewise. Start by clearing - TYPE_DECL_SUPPRESS_DEBUG. - -1999-11-24 Mark Mitchell - - * pt.c (tsubst_decl): Copy TREE_ASM_WRITTEN for VAR_DECLs. - - * decl2.c (finish_vtable_vardecl): Don't prune vtables here. - -1999-11-23 Kaveh R. Ghazi - - * decl.c (pushdecl, grokdeclarator): Don't call a variadic - function with a non-literal format string. - - * lex.c (do_identifier): Likewise. - - * typeck.c (build_unary_op): Likewise. - -1999-11-23 Mark Mitchell - - * cp-tree.h (DECL_NEEDED_P): Tweak to match documentation. - -1999-11-22 Mark Mitchell - - * cp-tree.def (CTOR_COMPLETE): New tree node. - * decl.c (finish_constructor_body): Add it, to mark the end of the - constructor. - (finish_function): Don't call end_protect_partials here. - * ir.texi (CTOR_COMPLETE): Document it. - * semantics.c (expand_stmt): Handle it. - - * cp-tree.def (FUNCTION_NAME): New tree node. - * cp-tree.h (current_function_name_declared): Tweak documentation. - (lang_decl_flags): Add pretty_function_p, adjust dummy. - (DECL_PRETTY_FUNCTION_P): New macro. - * decl.c (cp_finish_decl): Handle declarations of __FUNCTION__, - etc., in a template function. Use at_function_scope_p instead of - expanding it inline. - * pt.c (tsubst_decl): Handle DECL_PRETTY_FUNCTION_P declarations - specially. - (tsubst): Handle FUNCTION_NAME. - (tsubst_copy): Likewise. - (instantiate_decl): Prevent redeclarations of __PRETTY_FUNCTION__, - etc. in instantiation. - * semantics.c (begin_compound_stmt): Declare __FUNCTION__, etc., - even in template functions. - (setup_vtbl_ptr): Don't declare __PRETTY_FUNCTION in the - conditional scope at the top of a destructor. - - * error.c (dump_function_decl): Use `[ with ... ]' syntax for - specializations too. - -1999-11-22 Nathan Sidwell - - * semantics.c (finish_unary_op_expr): Only set TREE_NEGATED_INT - when actually negative. - - * typeck.c (convert_for_assignment): Expand comment about - strange NULL check, moved from ... - (convert_for_initialization): ... here. Remove unneeded - code. - -1999-11-21 Alexandre Oliva - - * cp-tree.h (build_vec_delete): Remove `auto_delete' argument. - * init.c (build_vec_delete, build_vec_delete_1): Likewise. - Always destruct virtual bases of array components, but never - delete them. - (build_vec_init): Adjust invocations. - (build_delete): Likewise. - * decl2.c (delete_sanity): Likewise. - -1999-11-19 Nathan Sidwell - - * cp-tree.h (grok_method_quals): Return this pointer qualifiers. - * decl.c (grokdeclarator): Adjust calls to grok_method_quals. - * decl2.c (grok_method_quals): Accept `restrict' as applying to - the object pointer. Return such qualifiers. - (grokclassfn): Apply this pointer qualifiers. Cleanup unused - variables. - -1999-11-18 Mark Mitchell - - * except.c (expand_end_catch_block): Fix typo. - (expand_exception_blocks): Simplify. Don't call - expand_leftover_cleanups. - -1999-11-15 Jason Merrill - - * cp-tree.h, decl.c (compute_array_index_type): Make nonstatic. - * pt.c (tsubst, case INTEGER_TYPE): Call it. - Check uses_template_parms. - - * class.c (finish_struct): If we're a local class in a template - function, add a TAG_DEFN. - * pt.c (lookup_template_class): If this is a local class in a - template function, call pushtag. - (tsubst_expr, case TAG_DEFN): Handle classes, too. - - Emit debug info with the vtable. - * search.c (maybe_suppress_debug_info): New function... - * class.c (finish_struct_1): ...split out from here. - * cp-tree.h: Declare it. - * decl2.c (finish_vtable_vardecl): Override TYPE_DECL_SUPPRESS_DEBUG - if we're writing out the vtable. - * decl.c, search.c (dfs_debug_mark, dfs_debug_unmarked_p, - note_debug_info_needed): #if 0 out. - -1999-11-14 Mark Mitchell - - * cp-tree.h (DECL_LOCAL_FUCNTION_P): New macro. - * call.c (equal_functions): Use DECL_LOCAL_FUCNTION_P, not - TREE_PERMANENT. - * decl.c (pushdecl): Set DECL_LOCAL_FUNCTION_P. - * decl2.c (lookup_arg_dependent): Use it. - - * cp-tree.h (cp_finish_decl): Change prototype. - (finish_static_data_member_decl): Likewise. - (push_permanent_obstack): Remove declaration. - (push_expression_obstack): Likewise. - (push_scratch_obstack): Likewise. - (DECL_TEMPLATE_PARM_P): Robustify. - (SET_DECL_TEMPLATE_PARM_P): New macro. - * class.c (add_method): Don't manipulate obstacks. - (finish_vtbls): Likewise. - * cvt.c (build_up_reference): Adjust calls to cp_finish_decl. - * decl.c (binding_for_name): Don't manipulate obstacks. - (maybe_push_to_top_level): Likewise. - (pop_from_top_level): Likewise. - (duplicate_decls): Likewise. - (pushdecl): Likewise. - (implicitly_declare): Likewise. - (build_typename_type): Likewise. - (start_decl): Likewise. - (cp_finish_decl): Likewise. - (finish_decl): Likewise. - (destroy_local_static): Likewise. - (expand_static_init): Likewise. - (complete_array_type): Likewise. - (grokvardecl): Likewise. - (build_ptrmemfnc_type): Likewise. - (grokdeclarator): Likewise. - (xref_tag): Likewise. - (xref_basetypes): Likewise. - (start_enum): Likewise. - (finish_enum): Likewise. - (start_function): Likewise. - (finish_function): Likewise. - (start_method): Adjust call to cp_finish_decl. - * decl2.c (finish_static_data_member_decl): Don't manipulate - obstacks. - (grokfield): Likewise. - (grokbitfield): Likewise. - (get_temp_name): Likewise. - (get_sentry): Likewise. - (fnish_file): Likewise. - (lookup_arg_dependent): Likewise. - * except.c (call_eh_info): Likewise. - (push_eh_info): Likewise. - (do_pop_exception): Likewise. - (initialize_handler_parm): Likewise. - (expand_end_eh_spec): Likewise. - (alloc_eh_object): Likewise. - (expand_throw): Likewise. - * expr.c (extract_scalar_init): Likewise. - * init.c (build_java_class_ref): Likewise. - * lex.c (get_time_identifier): Likewise. - (snarf_defarg): Likewise. - (add_defarg_fn): Likewise. - (is_global): Simplify. - (do_identifier): Don't check TREE_PERMANENT. - * method.c (emit_thunk): Don't manipulate obstacks. - * parse.y (condition): Adjust call to cp_finish_decl. - (primary): Likewise. - (initdcl): Likewise. - (initdcl0_innards): Likewise. - (nomods_initdcl0): Likewise. - * pt.c (push_inline_template_parms_recursive): Use - SET_DECL_TEMPLATE_PARM_P. - (process_template_parm): Likewise. - (lookup_template_class): Don't manipulate obstacks. - (instantiate_class_template): Adjust call to - finish_static_data_member_decl. - (tsubst_decl): Don't manipulate obstacks. - (tsubst_expr): Likewise. - (instantiate_template): Likewise. - (instantiate_decl): Adjust calls to cp_finish_decl. - * rtti.c (call_void_fn): Don't manipulate obstacks. - (get_tinfo_var): Likewise. - (get_tinfo_fn_unused): Likewise. - (build_dynamic_cast_1): Likewise. - (expand_si_desc): Likewise. - (expand_class_desc): Likewise. - (expand_ptr_desc): Likewise. - (expand_attr_desc): Likewise. - (expand_generic_desc): Likewise. - (synthesize_tinfo_fn): Likewise. - * search.c (expand_upcast_fixups): Likewise. - * semantics.c (finish_asm_stmt): Likewise. - (finish_named_return_value): Likewise. - (begin_class_definition): Likewise. - (finish_class_definition): Likewise. - (finish_typeof): Likewise. - * tree.c (build_cplus_method_type): Likewise. - (reverse_path): Likewise. - (copy_template_template_parm): Likewise. - (build_expr_ptr_wrapper): Likewise. - (push_expression_obstack): Remove. - (push_permanent_obstack): Likewise. - * typeck.c (mark_addressable): Likewise. - -1999-11-13 Mark Mitchell - - * call.c (build_conditional_expr): Use build_target_expr_with_type. - (convert_like): Likewise. - (build_over_call): Likewise. - * cp-tree.h (build_target_expr): Remove. - (build_target_expr_with_type): New function. - * cvt.c (build_up_reference): Use get_target_expr. - * decl.c (build_target_expr): Move to ... - * tree.c (build_target_expr): Here. Make it static. - (build_target_expr_with_type): New function. Set DECL_CONTEXT on - the temporary VAR_DECLs. - (get_target_expr): Use it. - -1999-11-13 Jason Merrill - - * decl.c (duplicate_decls): Propagate DECL_DEFER_OUTPUT. - * decl2.c (comdat_linkage): Set DECL_DEFER_OUTPUT. - * rtti.c (get_tinfo_fn_unused): Split out from get_tinfo_fn. - * class.c (set_rtti_entry): Use it. - -1999-11-12 Mark Mitchell - - * decl.c (cplus_expand_expr_stmt): Don't call break_out_cleanups - here. - * semantics.c (finish_expr_stmt): Call it here instead. Move - default_conversion logic to semantic-analysis time. - -1999-11-12 Jason Merrill - - * rtti.c (synthesize_tinfo_fn): Set DECL_DEFER_OUTPUT. - -Fri Nov 12 12:56:32 MST 1999 Diego Novillo - - * init.c (init_init_processing): Re-instated Nov 11 patch after - approval. - -Fri Nov 12 10:42:02 MST 1999 Diego Novillo - - * init.c (init_init_processing): Undo patch from Nov 11, 1999. - Patch had not been approved yet. - -1999-11-12 Mark Mitchell - - * decl.c (compute_array_index_type): New function, split out from - grokdeclarator. - (create_array_type_for_decl): Likewise. - (grokdeclarator): Use them. - - * semantics.c (expand_stmt): Don't suspend_momentary or - resume_momentary. - -Thu Nov 11 12:42:11 MST 1999 Diego Novillo - - * init.c (init_init_processing): Header information for - arrays allocated via `new' should have the same alignment used by - malloc. - -1999-11-10 Mark Mitchell - - * error.c (dump_function_name): Don't crash if given a friend - pseudo-instantiation. - - * cp-tree.h (build_enumerator): Change prototype. - * decl.c (enum_next_value): Remove. - (enum_overflow): Likewise. - (init_decl_processing): Don't register enum_next_value as a root. - (start_enum): Clear TYPE_VALUES for a redefined enum. - (finish_enum): Reset the type of enumeration constants. - (build_enumerator): Fix indentation. Don't copy CONST_DECLs when - we don't need to. Maintain the TYPE_VALUES list and look there - for the previously defined enumeration constant. Let enumeration - constants have the type of their values until the enumeration type - is complete. - * parse.y (enumlist_opt, enumlist, enumerator): Don't return a value. - (structsp): Adjust. - * parse.c: Regenerated. - * pt.c (tsubst_enum): Adjust according to build_enumerator changes. - -Wed Nov 10 12:43:21 1999 Philippe De Muyter - Kaveh R. Ghazi - - * cp-tree.h: Test `GCC_VERSION', not `HAVE_GCC_VERSION'. - -1999-11-09 Mark Mitchell - - * cp-tree.h (language_function): Remove x_last_dtor_insn and - x_last_parm_cleanup_insn. - * decl.c (last_dtor_insn): Remove. - (last_parm_cleanup_insn): Likewise. - (expand_start_early_try_stmts): Don't set them. - (store_parm_decls): Likewise. - (save_function_data): Or save them. - (mark_lang_function): Or mark them. - -1999-11-08 Mark Mitchell - - * decl.c (store_parm_decls): Generate cleanup code at - semantic-analysis time. Destroy objects in the correct order. - -1999-11-07 Mark Mitchell - - * cp-tree.h (begin_new_placement): Remove. - (finish_new_placement): Likewise. - * class.c (finish_struct_1): Don't suspend_momentary or - resume_momentary. - * decl.c (grokdeclarator): Likewise. - (maybe_build_cleanup_1): Likewise. - * except.c (push_eh_cleanup): Likewise. - (build_terminate_handler): Likewise. - * init.c (build_new_1): Likewise. - * parse.y (parse_decl): Change prototype. - (initdecls, notype_initdecls, initdcl): Don't return int. - (initdcl0, notype_initdcl0, initdcl0_innards): Likewise. - (.begin_new_placement): Remove. - (.finish_new_placement): Likewise. - (nonmomentary_expr): Likewise. - (suspend_mom): Likewise. - (condition): Don't suspend_momentary, resume_momentary, or keep - track of need to resume. - (unary_expr): Likewise. - (new_placement): Likewise. - (decl): Likewise. - (structsp): Likewise. - (new_type_id): Likewise. - (maybe_parmlist): Likewise. - (direct_after_type_declaration): Likewise. - (direct_new_declarator): Likewise. - (direct_abstract_declaration): Likewise. - * parse.c: Regenerated. - * pt.c (tsubst_expr): Don't suspend_momentary or resume_momentary. - * semantics.c (begin_new_placement): Remove. - (finish_new_placement): Likewise. - -1999-11-05 Martin v. Löwis - - * cp-tree.h (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK): New macro. - (DECL_TEMPLATE_INFO): Use it. - * decl.c (warn_extern_redeclared_static): Do nothing for - TEMPLATE_DECLs. - * decl2.c (mark_used): Explicitly check for function or variable. - * semantics.c (finish_unary_op_expr): Check whether result is also - an INTEGER_CST. - -1999-11-05 Mark Mitchell - - * Makefile.in (typeck2.o): Depend on output.h. - * typeck2.c: Include output.h. - - * decl.c (flag_ansi): Remove declaration. - - * pt.c (tinst_level_tick): Make it static. - (last_template_error_tick): Likewise. - - * cp-tree.h (mapcar): Remove declaration. - (search_tree): Likewise. - (walk_tree_fn): New typedef. - (walk_tree): New function. - * tree.c (bot_manip): Change prototype. Adjust to be called via - walk_tree. - (bot_replace): Likewise. - (no_linkage_helper): Likewise. - (copy_tree_r): New function. - (search_tree): Rename, and adjust, to become ... - (walk_tree): New function. - (mapcar): Remove. - (target_remap): Remove. - (target_remap_count): Likewise. - (break_out_target_exprs): Use walk_tree. - * decl.c (local_variable_p): Change prototype. - (check_default_argument): Use walk_tree. - * pt.c (for_each_template_parm_r): New function, split out from ... - (for_each_template_parm): Here. Use it, via walk_tree. - -1999-11-03 Mark Mitchell - - * class.c (check_bitfield_decl): New function, split out from - finish_stuct_1. - (check_field_decl): Likewise. Recursively examine members of - anonymous structs. - (finish_struct_1): Use them. - * cp-tree.h (ANON_UNION_TYPE_P): New macro. - -1999-11-02 Mark Mitchell - - * decl.c (grokfndecl): Remove dead code. - - * dump.c (dequeue_and_dump): Fix thinko for catch-clauses. - -1999-11-02 Scott Snyder - - * decl2.c (build_expr_from_tree): Handle REALPART_EXPR and - IMAGPART_EXPR. - * pt.c (tsubst_copy): Likewise. - -1999-11-01 Jason Merrill - - * decl2.c (maybe_make_one_only): Always make things comdat on - ELF targets, too. - -1999-10-31 Mark Mitchell - - * decl.c (finish_function): Call free_after_parsing for functions - we are not immediately turning into RTL. - -1999-10-31 Brendan Kehoe - - * cp-tree.h (flag_dump_translation_unit): Add decl. - -Sat Oct 30 22:42:50 1999 Stephen L Moshier - - * lex.c (yylex): Accept 'f' in mantissa of hex float constant. - -1999-10-30 Mark Mitchell - - * decl.c (pop_cp_function_context): Don't call free on a NULL - pointer. - * semantics.c: Include ggc.h. - (expand_body): Do garbage-collection after processing a template - function. Clear DECL_SAVED_TREE after generating RTL for a - function. - * Makefile.in (semantics.o): Depend on ggc.h. - -1999-10-29 Mark Mitchell - - * cp-tree.h (make_typename_type): Change prototype. - * decl.c (make_typename_type): Only complain if so requested. - * parse.y (nested_name_specifier): Adjust calls. - (typename_sub0): Likewise. - (typename_sub1): Likewise. - * parse.c: Regenerated. - * pt.c (convert_template_argument): Pass complain to - make_typename_type. - (tsubst): Likewise. - -1999-10-28 Mark Mitchell - - * semantics.c (finish_handler): End the scope of the handler - before attaching it to the statement-tree. - -1999-10-28 Ian Lance Taylor - - * rtti.c (build_dynamic_cast_1): Give a better error message for - an attempt to dynamic_cast from a non-polymorphic type. - -1999-10-27 Mark Mitchell - - * cp-tree.h (make_temp_vec): Remove. - (make_scratch_vec): Likewise. - * call.c (add_function_candidate): Use make_tree_vec. - (add_conv_candidate): Likewise. - (build_builtin_candidate): Likewise. - (add_template_candidate_real): Likewise. - * class.c (resolve_address_of_overloaded_function): Likewise. - * decl.c (start_function): Don't fool with the momentary obstack. - (finish_function): Likewise. - * init.c (expand_direct_vtbls_init): Likewise. - (begin_init_stmts): Likewise. - (finish_init_stmts): Likewise. - * pt.c (add_to_template_args): Use make_tree_vec. - (check_explicit_specialization): Likewise. - (coerce_template_parms): Likewise. - (lookup_template_class): Don't fool with the momentary obstack. - (instantiate_class_template): Likewise. - (tsubst_template_arg_vector): Use make_tree_vec. - (tsubst_aggr_type): Don't fool with the momentary obstack. - (tsubst_decl): Likewise. Use make_tree_vec. - (try_one_overload): Likewise. - (try_class_unification): Don't fool with the momentary obstack. - (get_bindings_real): Use make_tree_vec. - (set_mangled_name_for_template_decl): Likewise. - * rtti.c (synthesize_tinfo_fn): Don't fool with the momentary obstack. - * semantics.c (finish_expr_stmt): Likewise. - (finish_do_stmt): Likewise. - (finish_for_expr): Likewise. - (finish_switch_cond): Likewise. - (do_pushlevel): Likewise. - (do_poplevel): Likewise. - * tree.c (make_temp_vec): Remove. - - * dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs. Dump - CLEANUP_P for a TRY_BLOCK. - * ir.texi: Document SAVE_EXPR. - -Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com) - - * call.c (build_over_call): Check that the built-in function is - of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS. - * typeck.c (build_function_call_real): Similarly. - -1999-10-26 Mark Mitchell - - * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call - remember_end_note. - -1999-10-24 Mark Mitchell - - * decl.c (push_overloaded_decl_1): Use pushdecl. - - * decl.c (auto_function): Replace #ifdef'd __inline with just - plain inline. - * lex.c (my_get_run_time): Likeise. - (yyprint): Likewise. - (identifier_type): Likewise. - * method.c (start_squangling): Likewise. - (end_squangling): Likewise. - (icat): Likewise. - (old_backref_index): Likewise. - (flush_repeats): Likewise. - (issue_ktype): Likewise. - * parse.y (empty_parms): Likewise. - * parse.c: Regenerated. - -1999-10-21 Mark Mitchell - - * dump.c (dequeue_and_dump): Replace several uses of - queue_and_dump_index with dump_child. - -1999-10-21 Kaveh R. Ghazi - - * expr.c: Include tm_p.h. - -1999-10-21 Mark Mitchell - - * cp-tree.h (SCOPE_PARTIAL_P): New macro. - (pushlevel_temporary): Remove. - (add_scope_stmt): New function. - * decl.c (pushlevel_temporary): Remove. - (poplevel): Use add_scope_stmt. - (start_decl_1): Likewise. - * semantics.c (add_scope_stmt): New function. - (do_pushlevel): Use it. - (do_poplevel): Use it. - (expand_stmt): Check SCOPE_PARTIAL_P. - - * cp-tree.def (EMPTY_CLASS_EXPR): New tree node. - * call.c (build_call): Use EMPTY_CLASS_EXPR instead of RTL_EXPR. - * expr.c (cplus_expand_expr): Expand it. - * ir.texi: Document EMPTY_CLASS_EXPR. - -1999-10-20 Mark Mitchell - - * cp-tree.h (DECL_NAMESPACE_SCOPE_P): Don't treat template - parameters as having namespace scope. - -1999-10-19 Mark Mitchell - - * method.c (PARM_CAN_BE_ARRAY_TYPE): Remove. - (mangling_flags): New type. - (build_overload_int): Change prototype. - (build_overload_value): Likewise. - (numeric_output_need_bar): Improve comment. - (mangle_expression): New function, broken out from ... - (build_overload_int): Here. - (build_overload_value): Adjust for use of mangling flags. Don't - warn about real-valued template parameters here. Do handle - complex expressions involving real-valued template parameters. - (build_template_parm_names): Encase non-type template parameters - in underscores, if necessary. - (process_overload_item): Remove conditional on - PARM_CAN_BE_ARRAY_TYPE. - -1999-10-17 Mark Mitchell - - * dump.c (dequeue_and_dump): Handle CLEANUP_POINT_EXPR. - - * ir.texi: Clean up documentation of RETURN_INIT. - -1999-10-15 Greg McGary - - * lex.c (lang_init_options): Set flag_bounds_check as "unspecified". - (lang_init): Set default for flag_bounds_check if still "unspecified". - -1999-10-13 Andrew Haley - - * class.c (finish_struct_1): Force alignment of non-bitfields to - BITS_PER_UNIT. - -Wed Oct 13 22:01:35 1999 J"orn Rennecke - - * typeck2.c (process_init_constructor): Handle empty constructors. - -1999-10-13 Jason Merrill - - * decl.c (lang_mark_tree): Mark NAMESPACE_LEVEL. - - * pt.c (tsubst, case INTEGER_TYPE): Be more explicit in zero-size - array error. - -1999-10-13 Mark Mitchell - - * decl.c (make_rtl_for_local_static): Don't create register RTL - for addressable constants. - -1999-10-13 Nathan Sidwell - - * cp-tree.h (build_x_va_arg): Prototype new function. - * call.c (build_x_va_arg): Define it. - * parse.y (unary_expr): Call build_x_va_arg. - - * cp-tree.h (convert_type_from_ellipsis): Prototype new function. - * call.c (convert_type_from_ellipsis): Define it. - * decl.c (init_decl_processing): Set lang_type_promotes_to. - - * tree.c (lvalue_p_1): Accept VA_ARG_EXPR with aggregates. - -1999-10-11 Jason Merrill - - * class.c (fixed_type_or_null): Always set *nonnull. - -1999-10-10 Kaveh R. Ghazi - - * cp-tree.h: Use HAVE_GCC_VERSION instead of explicitly testing - __GNUC__ and __GNUC_MINOR__. - -1999-10-09 Mark Mitchell - - * cp-tree.h (make_rtl_for_local_static): New function. - * decl.c (make_rtl_for_nonlocal_decl): Move code to create RTL for - local statics ... - (make_rtl_for_local_static): Here. - * semantics.c (expand_stmt): Use make_rtl_for_local_static. - -1999-10-08 Kaveh R. Ghazi - - * method.c: Include tm_p.h. - -1999-10-7 Franz Sirl - - * cp-tree.h (cp_make_lake_type): Renamed from make_lang_type. - * lex.c (cp_make_lake_type): Likewise. - * tree.c (init_tree): Init make_lang_type_fn. - -1999-10-07 Mark Mitchell - - * pt.c (tsubst_expr): Set DECL_TEMPLATE_INSTANTIATED for a catch - parameter. - - * semantics.c (expand_stmt): Don't pretend to have asmspecs for - local statics if we don't really have them. - - * ir.texi: Improve documentation for STMT_EXPR. Describe - CLEANUP_POINT_EXPR. - -1999-10-07 Jason Merrill - - * class.c (build_vtable_entry_ref): Use finish_asm_stmt. - -1999-10-07 Greg McGary - - * class.c (finish_struct_1): Use simpler method of - removing elements of a singly-linked list which doesn't - lose for classes without data members. - -1999-10-07 Mark Mitchell - - * friend.c (make_friend_class): Robustify. - - * semantics.c (finish_object_call_expr): Reject calls to template - types. - -1999-10-06 Mark Mitchell - - * dump.c (dequeue_and_dump): Dump all three operands to a COND_EXPR. - - * cp-tree.h (CLASSTYPE_VFIELD): Remove. - * call.c (build_vfield_ref): Use TYPE_VFIELD, not - CLASSTYPE_VFIELD. - * class.c (get_vfield_offset): Likewise. - (finish_base_struct): Likewise. - (modify_one_vtable): Likewise. - (fixup_vtable_deltas): Likewise. - (finish_struct_1): Likewise. - * init.c (expand_virtual_init): Likewise. - * search.c (lookup_field_1): Likewise. - (expand_upcast_fixups): Likewise. - * typeck.c (build_component_ref): Likewise. - (build_binary_op_nodefault): Likewise. - - * dump.c (dqueue_and_dump): Dump TYPE_VFIELD. - * ir.texi: Document TYPE_VFIELD. - -1999-10-06 Brendan Kehoe - - * decl.c (grokdeclarator): Only warn about nonzero arrays if - !in_system_header (linux socketbits.h can give this for - __cmsg_data, which is using a GNU extension). - -1999-10-05 Mark Mitchell - - * decl2.c (start_static_storage_duration_function): Push the - function declaration so it ends up in namespace scope. - - * dump.c (DUMP_CHILDREN): Remove. - (DUMP_BINFO): Adjust. - (struct dump_node_info): Remove dump_children_p. - (queue_and_dump_type): Remove dump_children_p parameter. - (queue): Don't set dump_children_p. - (dump_child): Pass DUMP_NONE, instead of DUMP_CHILDREN, to - queue_and_dump_index. - (dequeue_and_dump): Unconditionally print children. Adjust calls - to functions mentioned above. - (dump_node): Pass DUMP_NONE, instead of DUMP_CHILDREN to queue. - - * ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR. - * dump.c (dequeue_and_dump): Dump them. - - * method.c (synthesize_method): Call setup_vtbl_ptr for destructors. - - * decl.c (start_function): Set current_in_charge_parm for - constructors, too, where appropriate. - * search.c (fixup_all_virtual_upcast_offsets): New function. - (expand_indirect_vtbls_init): Use it. - -1999-10-04 Nathan Sidwell - - * decl2.c (grok_alignof): Don't decay lvalues. - - * init.c (build_new): Remove unused variable. - -1999-10-04 Mark Mitchell - - * cp-tree.h (struct language_function): Remove static_labelno. - (static_labelno): Remove macro. - * method.c (build_overload_nested_name): Make static_labelno - static here. - - * pt.c (instantiate_decl): Use DECL_SAVED_TREE, not DECL_INITIAL, - to decide whether or not a function is defined. - - * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS for - situations where make_node will do it automatically. - * decl.c (grok_reference_init): Likewise. - (expand_static_init): Likewise. - (do_static_initialization): Likewise. - * init.c (perform_member_init): Likewise. - (expand_aggr_init_1): Likewise. - (build_new_1): Likewise. - * method.c (do_build_copy_constructor): Likewise. - (do_build_assign_ref): Likewise. - * search.c (expand_upcast_fixups): Likewise. - * semantics.c (finish_stmt_expr): Likewise. - * typeck.c (build_unary_op): Likewise. - (check_return_expr): Likewise. - -1999-10-04 Jason Merrill - - * init.c (build_vec_delete_1): Fold COND_EXPRs. - -1999-10-03 Mark Mitchell - - * cp-tree.def (VEC_INIT_EXPR): Remove. - * cp-tree.h (struct stmt_tree): New type. - (struct saved_scope): Remove firstobj. Add x_saved_tree, - x_stmt_tree. - (class_cache_firstobj): Remove. - (struct language_function): Remove stmts_are_full_exprs_p, - x_last_tree, and x_last_expr_type. Add x_stmt_tree. - (current_stmt_tree): New macro. - (last_tree): Adjust. - (last_expr_type): Likewise. - (doing_semantic_analysis_p): Simplify. - (stmts_are_full_exprs_p): Adjust. - (begin_tree): Remove prototype. - (end_tree): Likewise. - (begin_stmt_tree): Change prototype. - (finish_stmt_tree): Likewise. - (building_stmt_tree): Simplify. - * decl.c (mark_stmt_tree): New function. - (mark_saved_scope): Use it. - (start_function): Rearrange slightly to call begin_stmt_tree - earlier. - (save_function_data): Tweak. - (finish_function): Adjust call to finish_stmt_tree. - (mark_lang_function): Use mark_stmt_tree. - * expr.c (cplus_expand_expr): Don't handle VEC_INIT_EXPR. - * init.c (build_new_1): Remove creation of VEC_INIT_EXPR. - (build_vec_init): Remove creation of stand-in initializer. - * pt.c (begin_tree): Remove. - (end_tree): Likewise. - * semantics.c (SET_LAST_STMT): New macro. Use it throughout. - (begin_compound_stmt): Handle a compound-statement outside of a - function. - (begin_stmt_expr): Handle a statement-expression outsidef of a - function. - (finish_stmt_expr): Likewise. - (begin_class_definition): Don't call begin_tree. - (finish_inline_definitions): Don't call end_tree. - (begin_stmt_tree): Take a pointer to tree, not a function as input. - (finish_stmt_tree): Likewise. - * tree.c (search_tree): Don't handle VEC_INIT_EXPR. - (mapcar): Likewise. - - * parse.y (simple_stmt): Don't call finish_stmt unnecessarily. - * parse.c: Regenerated. - - * dump.c (dqueue_and_dump): Dump bitfieldness. - - * tree.c (lvalue_p_1): Use DECL_C_BIT_FIELD to check for - bitfields, rather than DECL_BIT_FIELD. - * ir.texi: Document how to tell whether or not a field is a - bitfield. - - * lex.c (make_lang_type): Fix typo in comment. - -1999-10-01 Jason Merrill - - * typeck.c (decay_conversion): Strip cv-quals from non-class rvalues. - -1999-10-01 Mark Mitchell - - * pt.c (tsubst_decl): If the type of a template instantiation is - bogus, so is the whole instantiation. - -1999-09-30 Mark Mitchell - - * decl.c (initialize_local_var): Handle static variables here. - (cp_finish_decl): Tweak handling of function-scope static - variables. - * semantics.c (expand_stmt): Handle DECL_STMTs for static - variables. - - * method.c (emit_thunk): Don't crash when -fsyntax-only. - - * cp-tree.h (lang_decl_flags): Add global_ctor_p and - global_dtor_p. Add init_priority. - (DECL_ACCESS): Adjust accordingly. - (DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P): New macros. - (GLOBAL_INIT_PRIORITY): Likewise. - * decl.c (lang_mark_tree): Adjust accordingly. - (start_objects): Set DECL_GLOBAL_CTOR_P, DECL_GLOBAL_DTOR_P, - and GLOBAL_INIT_PRIORITY. - * dump.c (dequeue_and_dump): Print them. - * ir.texi: Document them. - - * decl2.c (struct priority_info_s): Remove initialization_sequence - and destruction_sequence. - (start_static_storage_duration_function): Return the body of the - function. Convert for function-at-a-time mode. - (generate_inits_for_priority): Remove. - (finish_static_storage_duration_function): Change prototype. - Adjust for function-at-a-time mode. - (do_static_initialization): Likewise. - (do_static_destruction): Likewise. - (do_static_initialization_and_destruction): Remove. - (start_static_initialization_or_destruction): New function. - (finish_static_initialization_or_destruction): Likewise. - (get_priority_info): Don't manipulation initialization_sequence or - destruction_sequence. - (prune_vars_needing_no_initialization): New function. - (write_out_vars): Likewise. - (finish_file): Use the various new functions instead of the old. - -Thu Sep 30 00:13:27 1999 Dirk Zoller - - * cp-tree.h (warn_float_equal): Declare. - * decl2.c (warn_float_equal): Define. - (lang_decode_option): Recognize -W[no-]float-equal. - * typeck.c (build_binary_op_nodefault): Conditionally warn - about equality tests of floating point types. - -1999-09-29 Jason Merrill - - Support normal type_info-based EH mechanisms with -fno-rtti. - * except.c (build_eh_type_type): Remove special -fno-rtti handling. - (build_eh_type_type_ref): Likewise. - (build_eh_type): Remove. - (expand_throw): Call build_eh_type_type, not build_eh_type. - * decl2.c (import_export_decl): Don't associate the tinfo fn with - the vtable if -fno-rtti. - * decl.c (init_decl_processing): Always init_rtti_processing. - - * rtti.c (get_typeid): Don't complain about -fno-rtti. - - * class.c (class_cache_obstack, class_obstack): Remove. - (init_class_processing): Don't initialize class_obstack. - (push_cache_obstack): Remove. - (pushclass): Don't call it. - * cp-tree.h: Remove prototype for push_cache_obstack. - * decl.c (decl_obstack, decl_stack, push_decl_level): Remove. - (pushlevel_class): Don't push_decl_level. - (poplevel_class): Don't pop_stack_level. - (push_class_level_binding): Don't push_cache_obstack. - (init_decl_processing): Don't initialize decl_obstack. - * search.c (push_class_decls): Don't push_cache_obstack. - * tree.c (list_hash_add): Put hash node on permanent_obstack. - (hash_tree_cons): Don't mess with obstacks. - (print_lang_statistics): Don't print stats for class_obstack and - decl_obstack. - -1999-09-29 Mark Mitchell - - * dump.c (dequeue_and_dump): Dump DECL_EXTERNAL. - * ir.texi: Document DECL_EXTERNAL. - - * dump.c (dequeue_and_dump): Improve support for dumping THUNK_DECLs. - * ir.texi: Document THUNK_DECLs. - - * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move here from pt.c. - (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. - (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. - * error.c (dump_template_bindings): Remove unused parameter. - Handle multiple levels of template parameters. - (dump_template_decl): Use `parms', not `args', for template - parameters. Fix thinko. - (dump_function_decl): Use DECL_TEMPLATE_INSTANTIATION. Don't pass - flags to dump_template_bindings. - * pt.c (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Move to cp-tree.h. - (TMPL_ARGS_DEPTH, TMPL_ARGS_LEVEL, SET_TMPL_ARGS_LEVEL): Likewise. - (TMPL_ARG, SET_TMPL_ARG, NUM_TMPL_ARGS, TMPL_PARMS_DEPTH): Likewise. - (tsubst_copy): Clarify variable name. - (most_general_template): Robustify. - -1999-09-29 Nathan Sidwell - - * error.c (dump_template_parms): Don't use TS_PEDANTIC_NAME - to change primary template rendering. - -1999-09-29 Mark Mitchell - - * cp-tree.h (UPT_TEMPLATE): Remove. - (UPT_PARMS): Likewise. - (DECL_NEEDED_P): New macro. - * decl2.c (finish_vtable_vardecl): Use it. - (finish_objects): Don't crash with -fsyntax-only. - (finish_file): Use DECL_NEEDED_P. Don't prune vtables when - -fsyntax-only. - * pt.c (tsubst_friend_function): Remove FIXME that talks about - obstacks. - (tsubst_expr): Correct handling of function try-blocks. - * semantics.c: Include flags.h. - (expand_body): Don't do RTL generation if -fsyntax-only. - * Makefile.in (semantics.o): Depends on flags.h. - -1999-09-28 Gabriel Dos Reis - - * pt.c (most_general_template): Adjust declaration. - - * cp-tree.h: (most_general_template): Declare. - - * error.c (dump_template_value): Rename to ... - (dump_template_argument): This. - (dump_template_argument_list): New function. - (dump_type): Use it. - (dump_template_parameter): New function. - (dump_template_decl): Use it. - (dump_template_bindings): New function. - (dump_function_decl): Use it. Pretty print function template - instantiations. - -1999-09-28 Nathan Sidwell - - * decl.c (grokdeclarator): Distinguish parameter context for - diagnostics. Tidy up missing type diagnostic. - Diagnose `explicit' in one place. Diagnose `mutable' in one place. - -1999-09-28 Mark Mitchell - - * ir.texi: Improve documentation for TARGET_EXPR. - -1999-09-27 Nathan Sidwell - - Augment stringification of trees. - * cp-tree.h (tree_string_flags): New error stringifying enumeration. - (fndecl_as_string, type_as_string_real, args_as_string, - code_as_string, language_as_string, parm_as_string, - op_as_string, assop_as_string, cv_as_string): Remove. - (type_as_string, decl_as_string, expr_as_string): Adjust prototype. - (context_as_string): Declare new function. - * error.c (cp_printers): Move definition. - (OB_UNPUT): Remove. - (OB_END_TEMPLATE_ID): Adjust. - (interesting_scope_p): Remove. - (dump_scope): New static function. - (dump_qualifiers): Adjust prototype, reimplement. - (dump_template_value): Use tree_string_flags. - (dump_type_real): Move back to dump_type. - (dump_type): Adjust prototype. Use tree_string_flags. - (dump_aggr_type): Likewise. Use dump_template_parms. - (dump_type_prefix): Adjust prototype. Use tree_string_flags. - Return pad flag. - (dump_type_suffix): Adjust prototype. Use tree_string_flags. - (dump_simple_decl): Likewise. - (dump_decl): Likewise. Use dump_template_decl. - (dump_template_decl): New static function broken out of dump_decl. - (dump_function_decl): Adjust prototype. Use tree_string_flags. - (dump_parameters): Likewise. Prefix space. - (dump_exception_spec): Adjust prototype. Use tree_string_flags. - (dump_function_name): Likewise. Use dump_template_parms. - (dump_template_parms): New static function broken out of - dump_function_name. - (dump_expr_list): Adjust prototype. Use tree_string_flags. - (dump_expr): Likewise. - (fndecl_as_string): Removed - (type_as_string_real): Removed - (dump_binary_op): Adjust prototype. Use tree_string_flags. - (dump_unary_op): Likewise. - (type_as_string): Likewise. - (expr_as_string): Likewise. - (decl_as_string): Likewise. - (context_as_string): New function. - (lang_decl_name): Adjust. - (decl_to_string): New static print callback. - (expr_to_string): Likewise. - (fndecl_to_string): Likewise. - (code_as_string): Renamed to ... - (code_to_string): ... here. Adjust. - (language_as_string): Renamed to ... - (language_to_string): ... here. Adjust. - (parm_as_string): Renamed to ... - (parm_to_string): ... here. - (op_as_string): Renamed to ... - (op_to_string): ... here. - (assop_as_string): Renamed to ... - (assop_to_string): ... here. - (type_to_string): New static print callback. - (args_as_string): Renamed to ... - (args_to_string): ... here. Adjust. - (cv_as_string): Renamed to ... - (cv_to_string): ... here. Adjust. - * pt.c (mangle_class_name_for_template): Use tree_string_flags. - (print_template_context): Likewise. - -1999-09-26 Mark Mitchell - - * cp-tree.h (expand_throw): Remove prototype. - * except.c (expand_throw): Make it static. Use tree-generation - functions, rather than RTL-generation functions. - (build_throw): Use it. - * expr.c: Include except.h. - (cplus_expand_expr): Don't call expand_throw here. - * Makefile.in (expr.o): Depend on except.h. - * ir.texi: Update documentation for THROW_EXPR. - - * decl.c (start_function): Set x_dont_save_pending_sizes rather - than calling get_pending_sizes. - * init.c (build_new): Don't save and restore - immediate_size_expand; instead, assert that it has the expected - value already. - -1999-09-26 Kaveh R. Ghazi - - * lex.c (compiler_error): Add missing call to va_end(). - -1999-09-25 Mark Mitchell - - * dump.c (dequeue_and_dump): Handle RESULT_DECL. - * ir.texi: Document RESULT_DECL and DECL_RESULT. - - * cp-tree.h (check_return_expr): New function. - * decl.c (finish_constructor_body): New function. - (pushdecl): Put global friend functions in namespace binding - level, not the class binding level. - (finish_destructor_body): Make sure the dtor_label is always - defined. Fix typo in comment. - (finish_function): Move generation of constructor-termination code - to semantic-analysis time. Move generation of implicit `main' - return value to semantic-analysis time. - * semantics.c (finish_return_stmt): Generate goto's to - ctor_label/dtor_label here. Use check_return_expr to do semantic - analysis on the returned expression. - * typeck.c (maybe_warn_about_returning_address_of_local): New - function split out from c_expand_return. - (check_return_expr): Likewise. - (c_expand_return): Just generate the RTL for the return. - -1999-09-24 Mark Mitchell - - * cp-tree.h (CPTI_CLEANUP_TYPE): New macro. - (cleanup_type): Likewise. - (search_tree): Change prototype. - * decl.c (local_variable_p): Adjust for new interface to - search_tree. - (check_default_argument): Likewise. - * error.c (dump_expr): Handle INIT_EXPR. - * except.c (expand_throw): Don't make cleanup_type a local static. - * expr.c (cplus_expand_expr): Don't handle NEW_EXPR. - * init.c (build_new): Call build_new_1 directly, rather than - building a NEW_EXPR. - (build_new_1): Tidy. Don't build a VEC_INIT_EXPR except when - processing file-scope initializers. - * lex.c (init_parse): Add an opname_tab entry for INIT_EXPR. - * tree.c: Include splay-tree.h - (no_linkage_helper): Adjust for new interface to search_tree. - (search_tree): Pass around pointers to tree nodes, rather than the - nodes themselves. Handle VEC_INIT_EXPR. - (no_linkage_check): Adjust for new interface to search_tree. - (mapcar): Handle VEC_INIT_EXPR. - (target_remap): New variable. - (bot_manip): Use it. - (bot_replace): New function. - (break_out_target_exprs): Use it to remap all variables used in a - default argument expression. - * typeck.c (build_modify_expr): Don't crash when outside a - function and presented with an INIT_EXPR assignment - * Makefile.in (tree.o): Depend on splay-tree.h. - -Fri Sep 24 10:48:10 1999 Bernd Schmidt - - * decl.c (duplicate_decls): Use DECL_BUILT_IN_CLASS rather than - DECL_BUILT_IN. - (builtin_function): New arg CLASS. Arg CODE now of type int. All - callers changed. - Set the builtin's DECL_BUILT_IN_CLASS. - -1999-09-24 Mark Mitchell - - * decl.c (pushdecl): Don't make local declarations of extern - variables give the variable a DECL_CONTEXT for the function. - (make_rtl_for_nonlocal_decl): Don't fuss with obstacks. Simplify. - Don't accidentally make RTL for local declarations. - (emit_local_var): Handle declarations with asm-specifiers here. - -1999-09-23 Mark Mitchell - - * ir.texi: Improve documentation for TARGET_EXPRs. Discuss - STMT_IS_FULL_EXPR_P. - - * cp-tree.h (language_function): Add cannot_inline. - * decl.c (start_function): Restore current_function_cannot_inline - from the saved value. - (save_function_data): Save current_function_cannot_inline. - * decl2.c (start_objects): Change prototype. Build the function - in function-at-a-time mode. - (finish_objects): Likewise. - (generate_ctor_or_dtor_function): Adjust accordingly. - - * cp-tree.h (DECL_ANON_UNION_ELEMS): New macro. - * decl2.c (finish_anon_union): Set DECL_ANON_UNION_ELEMS. - Don't call expand_anon_union_decl here - * semantics.c (exapnd_stmt): Call it here, instead. - * typeck.c (mark_addressable): Addressed variables are implicitly - used. - -1999-09-23 Martin v. Löwis - - * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): New macro. - (RECORD_OR_UNION_TYPE_CHECK, LANG_IDENTIFIER_CAST): Likewise. - (DEFARG_NODE_CHECK): Remove; replace with DEFAULT_ARG_CHECK. - * cp-tree.h: Add tree checking macros to various tree access - macros. - * ptree.c (print_lang_decl): Test for function or variable - before accessing template info. - -1999-09-23 Jason Merrill - - * lex.c: Get WCHAR_TYPE_SIZE from wchar_type_node. - * lang-specs.h: If -fshort-wchar, override __WCHAR_TYPE__. - * decl2.c (lang_f_options): Add -fshort-wchar. - * cp-tree.h: Declare flag_short_wchar. - * decl.c (init_decl_processing): If -fshort-wchar, use 'short unsigned - int' for wchar_t. - -1999-09-23 Martin v. Löwis - - * ir.texi: Fix formatting errors and typos. - -1999-09-22 Mark Mitchell - - * ir.texi: Document CLEANUP_STMT, SCOPE_STMT, and START_CATCH_STMT. - - * decl.c (pushdecl): Do create a binding for extern "C" functions, - but not for their DECL_ASSEMBLER_NAMEs. - (lookup_name_current_level): Fix formatting. - (xref_tag): Likewise. - * decl2.c (start_objects): Mark static constructors and - destructors as used. - -1999-09-22 Jason Merrill - - * decl.c (define_case_label): Don't crash if we're not in a switch. - - * decl2.c (lang_decode_option): Don't bother explicitly ignoring flags. - * lang-options.h: Restore -fthis-is-variable. Remove help strings - for unsupported flags. - -1999-09-21 Jason Merrill - - * decl2.c (lang_decode_option): Accept and ignore -finit-priority. - Accept and warn about -fthis-is-variable. - -1999-09-21 Mark Mitchell - - * dump.c (dequeue_and_dump): Handle START_CATCH_STMT, - CLEANUP_STMT, and SCOPE_STMT. - - * decl2.c (lang_decode_option): Adjust, in the wake of recent - changes to option processing. - -1999-09-21 Martin v. Löwis - - * typeck.c (get_member_function_from_ptrfunc): Allow extraction of - function pointer from pmfs with no object given. - (convert_for_assignment): Do not return error when converting - pmfs. - -1999-09-21 Alex Samuel - - * lex.c (internal_filename): New variable. - (INTERNAL_FILENAME): New macro. - (init_parse): Allocate internal_filename and mark as root. Use it - instead of a string constant. - -1999-09-21 Nathan Sidwell - - Reimplement dynamic cast and catch matching. - * cp-tree.h (get_dynamic_cast_base_type): Prototype new function - * search.c (dynamic_cast_base_recurse): New function. - (get_dynamic_cast_base_type): New function for dynamic cast. - * rtti.c (build_dynamic_cast_1): Determine source and target - class relationship. Call __dynamic_cast_2. - * tinfo.h (__user_type_info::upcast): New catch dispatcher. - (__user_type_info::dyncast): New dynamic cast dispatcher. - (__user_type_info::sub_kind): New nested enumeration. - (__user_type_info::contained_p): sub_kind predicate. - (__user_type_info::contained_public_p): Likewise. - (__user_type_info::contained_nonpublic_p): Likewise. - (__user_type_info::contained_nonvirtual_p: Likewise. - (__user_type_info::upcast_result): New nested struct. - (__user_type_info::dyncast_result): New nested struct. - (*::do_upcast): New catch function. - (*::do_dyncast): New dynamic cast function. - (__user_type_info::find_public_subobj): New dynamic cast - helper dispatcher. - (*::do_find_public_subobj): New dynamic cast helper function. - * tinfo.cc (__user_type_info::upcast): Define catch dispatcher. - (__user_type_info::dyncast): Define dynamic cast dispatcher. - (*::do_upcast): Define catch function. - (*::do_dyncast): Define dynamic cast function. - (*::do_find_public_subobj): Define dynamic cast helper function. - * tinfo2.cc (__throw_type_match_rtti_2): Use upcast. - (__dynamic_cast): Backwards compatibility wrapper. Use dyncast. - (__dynamic_cast_2): New dynamic cast runtime. - -1999-09-20 Mark Mitchell - - * cp-tree.h (finish_stmt_expr): Change prototype. - * expr.c (cplus_expand_expr): Adjust call accordingly. - * init.c (finish_init_stmts): Likewise. - * parse.y (primary): Likewise. - * pt.c (tsubst_copy): Likewise. - * semantics.c (finish_stmt_expr): Don't take two parameters. - Don't remove generated BLOCKs from the block-tree. - - Remove support for assigning to `this'. - * NEWS: Note that fact. - * class.c (build_vbase_path): Don't check flag_this_is_variable. - * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): Remove. - (language_function): Remove assigns_this, just_assigned_this, and - x_base_init_expr. Add x_vcalls_possible_p. Add vtbls_set_up_p. - (base_init_expr): Remove. - (current_vcalls_possible_p): New macro. - (vtbls_set_up_p): Likewise. - (emit_base_init): Change prototype. - * decl.c (finish_destructor_body): New function, split out from - finish_function. - (current_function_assigns_this): Remove. - (current_function_just_assigned_this): Likewise. - (start_function): Don't set them. - (finish_function): Don't check them. Don't emit - base-initialization code here. Generate code for destructors when - doing semantic analysis. - (finish_stmt): Don't check current_function_just_assigned_this. - * decl2.c (lang_f_options): Remove this-is-variable. - (lang_decode_option): Likewise. - (grokclassfn): Don't check flag_this_is_variable. - * init.c (emit_base_init): Return the expression generated. - (construct_virtual_bases): Don't push/pop obstacks. Fix - typo. - (build_new_1): Don't check flag_this_is_variable. - (get_temp_regvar): Don't set DECL_REGISTER. - (build_vec_init): Don't call use_variable. - * lang-options.h: Remove "-fthis-is-variable" and - "-fno-this-is-variable". - * pt.c (tsubst_expr): Don't check EXPR_STMT_ASSIGNS_THIS. - * search.c (expand_upcast_fixups): Use finish_expr_stmt, not - expand_expr_stmt. - * semantics.c (finish_expr_stmt_real): Rename to ... - (finish_expr_stmt): This. Remove assigned_this parameter. - (begin_if_stmt): Call do_pushlevel before starting the statement. - (begin_compound_stmt): Don't declare __FUNCTION__ in scope-less - blocks. - (setup_vtbl_ptr): Emit initialization code for bases and members - at semantic-analysis time. Emit code to initialize vtables in - destructors here. - (expand_stmt): Use finish_expr_stmt, not finish_expr_stmt_real. - Don't handle CTOR_INITIALIZER any more. - * typeck.c (build_modify_expr): Don't check for assignments to - this. - (c_expand_return): Don't suggest assigning to `this'. - - * Makefile.in (decl.o): Depend on RTL_H. - (decl2.o): Likewise. - (class.o): Likewise. - (call.o): Likewise. - (method.o): Likewise. - (search.o): Likewise. - (tree.o): Likewise. - (pt.o): Likewise. - - * decl.c (duplicate_decls): When a builtin function is redeclared - as static, make sure it is mangled correctly. - - * ir.texi (CTOR_INITIALIZER): Remove mention. Fix typo. Add - detail about the statement-tree. - -1999-09-20 Nathan Sidwell - - * parse.y (primary): Use build_functional_cast for CV_QUALIFIER. - -1999-09-20 Nick Clifton - - * decl2.c (lang_decode_option): Extend comment. - -Mon Sep 20 10:49:05 1999 Bernd Schmidt - - * typeck.c: Include "tm_p.h". - -1999-09-19 Mark Mitchell - - * ir.texi: New file. - -1999-09-19 Paul Burchard - - * semantics.c (expand_stmt): Initialize return value. - -1999-09-18 Paul Burchard - - * gxxint.texi: G++ now implements namespaces. - -1999-09-18 Mark Mitchell - - * decl.c (pop_label): Don't warn about unused labels more than - once. - * semantics.c (finish_goto_stmt): Always marked used labels as - used. - - * decl.c (layout_var_decl): Change prototype. Call layout_decl - even when the declaration is external. - (cp_finish_decl): Adjust call to layout_var_decl. - * pt.c (tsubst_expr): Make sure to initialize stmt before using it. - -1999-09-18 Martin von Loewis - - * typeck.c (get_member_function_from_ptrfunc): Always consider - virtuality inside member pointer. - -1999-09-17 Mark Mitchell - - Turn on function-at-a-time processing. - * cp-tree.h (doing_semantic_analysis_p): New macro. - (SF_DEFAULT): Define to zero, not SF_EXPAND. - (start_handler_parms): Change prototype. - (expand_start_catch_block): Likewise. - (expand_end_catch_block): Likewise. - (expand_start_eh_spec): Likewise. - (expand_end_eh_spec): Declare. - (finish_handler_parms): Change prototype. - (begin_catch_block): Declare. - (finish_handler): Change prototype. - (do_pushlevel): Declare. - (do_poplevel): Likewise. - * decl.c (pushlevel): Don't create - binding levels when not doing semantic analysis. - (poplevel): Don't pop them. - (pushdecl): Assert that we are never called when not doing - semantic analysis. - (pushdecl_top_level): Use push_to_top_level. - (make_label_decl): Don't fiddle with obstacks. Make RTL For the - label when expanding. - (cp_finish_decl): Only inject for-scope variables when doing - semantic analysis. Add comments. - (start_handler_parms): Return the handler parm. - (start_function): Reorganize. Don't clear DECL_INITIAL if it is - already set. Reinitialize from saved function data if available. - Don't pushlevel when not doing semantic analysis. - (store_parm_decls): Only generate RTL when expanding. Only - pushdecl when doing semantic analysis. Set - current_eh_spec_try_block if appropriate. - (finish_function): Simplify. Use do_pushlevel and do_poplevel. - Combine common code. Don't poplevel when not doing semantic - analysis. - (push_cp_function_context): Don't expand functions without an - explicit call to expand_body. - (mark_lang_function): Make eh_spec_try_block and - x_scope_stmt_stack. - * except.c (expand_end_eh_spec): Don't - declare. - (process_start_catch_block): Likewise. - (push_eh_cleanup): Use finish_decl_cleanup. - (initialize_handler_parm): New function. - (expand_start_catch_block): Use it. - (expand_end_catch_block): Use tree-generation functions, not - RTL-generation functions. - (expand_start_eh_spec): Likewise. - (expand_end_eh_spec): Likewise. - (expand_exception_blocks): Simplify. - (start_anon_func): Use do_pushlevel. - (end_anon_func): Use do_poplvel. Call expand_body for the - function. - * expr.c (do_case): Don't call define_case_label. - * init.c (create_temporary_var): Set DECL_CONTEXT for local - variables. - * method.c (emit_thunk): Call expand_body for the - thunk. - (sythesize_method): Likewise. - * parse.y (handler_args): Give it ttype. - (eat_saved_input): Call expand_body. - (base_init): Use do_pushlevel. - (pending_inline): Call expand_body. - (handler): Adjust calls to finish_handler_parms and - finish_handler. - (handler_args): Don't call expand_start_catch_block. Return the - catch parameter. * pt.c (tsubst_expr): Adjust HANDLER handling. - * parse.c: Regenerated. - * rtti.c (synthesize_tinfo_fn): Call finish_function. - * semantics.c (do_pushlevel): Give it external linkage. Build - SCOPE_STMTs. - (do_poplevel): Likewise. - (finish_case_label): Call define_case_label when doing semantic - analysis. - (finish_goto_stmt): Create RTL for labels. - (finish_function_try_block): Set in_function_try_handler - unconditionally. - (finish_function_handler_sequence): Unset it. - (finish_handler_parms): Use expand_start_catch_block even when - building a statement-tree. - (begin_catch_block): New function. - (finish_handler): Move a little RTL-generation logic here. - (finish_decl_cleanup): Allow cleanups for empty declarations. - (finish_named_return_value): Don't pushdecl when not doing - semantic analysis. - (expand_stmt): Don't do semantic analysis for variable - declarations. Handle START_CATCH_STMT. Call expand_label - directly for a LABEL_STMT. Tweak handling of GOTO_STMT. Adjust - HANDLERs. Handle SCOPE_STMT, CTOR_INITIALIZER, and RETURN_INIT. - (expand_body): Let expand_stmt handle CTOR_INITIALIZER, - RETURN_INIT and function try blocks. - - * cp-tree.h (language_function): Add x_eh_spec_try_block. Add - x_scope_stmt_stack. Add x_in_charge_parm. - (current_eh_spec_try_block): New macro. - (current_scope_stmt_stack): Likewise. - (current_in_charge_parm): Likewise. - * decl.c (start_function): Initialize current_in_charge_parm. - (finish_function): Use current_in_charge_parm rather than looking - up __in_chrg. - * search.c (expand_indirect_vtbls_init): Likewise. - - * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps. - (TRY_BLOCK): Likewise. - (HANDLER): Likewise. - (START_CATCH_STMT): New tree node. - (SCOPE_STMT): Likewise. - * cp-tree.h (SCOPE_BEGIN_P): New macro. - (SCOPE_NULLIFIED_P): Likewise. - (struct lang_decl_flags): Add pending_inline_p. Adjust dummy. - (struct lang_decl): Add saved_language_function. - (DECL_PENDING_INLINE_INFO): Adjust documentation. - (DECL_PENDING_INLINE_P): New macro. - (TYPE_TI_ARGS): Fix typo in comment. - (DECL_SAVED_TREE): Add to documentation. - (DECL_SAVED_FUNCTION_DATA): New macro. - (START_CATCH_TYPE): Likewise. - (SCOPE_END_P): New macro. - (declare_parm_level): Don't declare. - * decl.c (mark_lang_function): New function, split out from - mark_cp_function_context. - (save_function_data): New function. - (declare_parm_level): Remove. - (finish_function): Use save_function_data to squirrel away - important stuff for later use. - (mark_cp_function_context): Use mark_function_data. - (lang_mark_tree): Likewise. - * lex.c (begin_definition_of_inclass_inline): Set - DECL_PENDING_INLINE_P. - (store_pending_inline): Clear it. - * pt.c (tsubst_decl): Likewise. - -1999-09-17 Nathan Sidwell - - * call.c (perform_implicit_conversion): Deal with error_mark_node. - -1999-09-17 Mark Mitchell - - * decl.c (warn_extern_redeclared_static): Don't get confused by - static member functions. - (duplicate_decls): Merge DECL_THIS_STATIC. - - * decl.c (expand_static_init): Make sure assignments to local - statics actually occur. - -1999-09-17 Mark Mitchell - - * cp-tree.h (poplevel_class): Declare. - * class.c (popclass): Use poplevel_class, not poplevel. - * decl.c (poplevel_class): Don't make it static. Don't return a - value. - (poplevel): Don't call poplevel_class; abort in a class - binding level is seen. - * semantics.c (finish_translation_unit): Use pop_everything. - * parse.y (member_init): Allow errors. - (pending_inline): Call finish_function. - * parse.c: Regenerated. - * Makefile.in (CONFLICTS): Adjust. - -1999-09-17 Gabriel Dos Reis - - * error.c: Reduce code duplication. - (dump_template_value): New function. - (dump_type_real): Use it. - (dump_decl): Likewise. - (dump_function_name): Likewise. - (dump_function_decl): Don't be too talkative about function return - type variety. - -1999-09-16 Kaveh R. Ghazi - - * lex.c (init_cpp_parse): Call xcalloc, not malloc/bzero. - - * xref.c (SALLOC): Call xstrdup, not xmalloc/strcpy. - -1999-09-16 Jason Merrill - - * decl2.c (finish_file): Also call check_global_declarations for - the pending_statics list. - -1999-09-15 Jason Merrill - - * lex.c (cp_pragma_implementation): Allow #pragma implementation - in header files. - -1999-09-15 Richard Henderson - - * lex.c (mark_impl_file_chain): Follow the next chain. - -1999-09-15 Mark Mitchell - - * decl.c (warn_extern_redeclared_static): Simplify. Catch - problems with extern "C" functions redeclared as static. - (duplicate_decls): When a builtin is redeclared static, make the - new function have internal linkage. - -1999-09-15 Mark Mitchell - - * decl2.c (build_expr_from_tree): Handle VA_ARG_EXPR. - * pt.c (tsubst_copy): Likewise. - * tree.c (search_tree): Likewise. - (mapcar): Likewise. - -1999-09-15 Kaveh R. Ghazi - - * typeck2.c (ack): Don't declare progname. - -1999-09-14 Alexandre Oliva - - * lex.c (cp_pragma_interface, cp_pragma_implementation): Copy - filenames with ggc_alloc_string. - -1999-09-14 Mark Mitchell - - * decl.c (build_target_expr): Set TREE_SIDE_EFFECTS on the - TARGET_EXPR. - * call.c (build_over_call): Don't set TREE_SIDE_EFFECTS on - the TARGET_EXPR. - * cvt.c (build_up_reference): Likewise. - * tree.c (build_cplus_new): Likewise. - (get_target_expr): Likewise. - -Tue Sep 14 01:45:10 1999 Marc Espie - - * Makefile.in: Prepend $(SHELL) to move-if-change calls. - -1999-09-13 Mark Mitchell - - * cp-tree.h (build_target_expr): New function. - * call.c (build_conditional_expr): Use build_target_expr. - (convert_like): Likewise. - (build_over_call): Likewise. - * cvt.c (build_up_reference): Likewise. - * decl.c (build_cleanup_on_safe_obstack): Fold into ... - (destroy_local_var): Here. - (build_target_expr): New function. - * tree.c (build_cplus_new): Use it. - (get_target_expr): Likewise. - -1999-09-13 Nathan Sidwell - - * typeck.c (expr_sizeof): Don't decay arrays and functions. - Remove misleading comment. - (build_compound_expr): Don't decay arrays. - -1999-09-13 Jason Merrill - - * call.c (build_conditional_expr): Always use a TARGET_EXPR for - class rvalues again. - -Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi - - * Make-lang.in (g++spec.o): Depend on system.h and gcc.h. - - * g++spec.c: Include gcc.h. - (lang_specific_driver): Constify a char*. Call xcalloc, not - xmalloc/bzero. All calls to the function pointer parameter now - explicitly call `fatal'. - -1999-09-12 Mark Mitchell - - * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs. - * cvt.c (ocp_convert): Complete the from and destination types. - Adjust warning about functions always being `true' in conditionals. - * decl.c (duplicate_decls): Don't play funny games with abort. - * error.c (dump_expr): Handle OVERLOADs. - * spew.c (probe_obstack): Remove. - * typeck.c (condition_conversion): Use perform_implicit_conversion. - -1999-09-12 Bernd Schmidt - - * cp-tree.h (auto_function, define_function): Adjust prototypes. - * decl.c (define_function): Lose FUNCTION_CODE arg. All callers - changed. - (auto_function): Likewise, for CODE arg. - Move code to set DECL_BUILT_IN and DECL_FUNCTION_CODE to... - (builtin_function): ... here. - -1999-09-11 Mark Mitchell - - * decl.c (add_decl_to_level): Remove TREE_PERMANENT assertion. - (init_decl_processing): Don't set TREE_PERMANENT for the - error_mark_node. - (start_decl): Don't rebuild non-permanent ARRAY_TYPEs. - (grokdeclarator): Likewise. - (grokparms): Don't check TREE_PERMANENT when building up lists. - * decl2.c (grokfield): Don't assert TREE_PERMANENT. - (mark_inline_for_output): Likewise. - * expr.c (cplus_expand_expr): Don't check TREE_PERMANENT. - * init.c (build_offset_ref): Don't check TREE_PERMANENT. - * lex.c (check_newline): Don't check ggc_p; it is always one. - * pt.c (process_template_parm): Don't check TREE_PERMANENT. - * spew.c (yylex): Don't copy_node or probe_obstacks for - non-permanent CONSTANTs and STRINGs. - * tree.c (build_cplus_array_type_1): Don't fuss with - TREE_PERMANENT on ARRAY_TYPEs. - - * cp-tree.def (CLEANUP_STMT): New node. - * cp-tree.h (language_function): Add name_declared. - (current_function_name_declared): New macro. - (CLEANUP_DECL): New macro. - (CLEANUP_EXPR): Likewise. - (emit_local_var): Likewise. - (finish_decl_cleanup): New function. - * cvt.c (build_up_reference): Simplify. - (ocp_convert): Remove dead code. - * decl.c (start_decl): Remove call to add_decl_stmt. - (grok_reference_init): Adjust, to handle bindings temporaries to - references. Remove dead code. - (initialize_local_var): Don't generate RTL for - declarations here, or build cleanups here. Don't fuss with - obstacks. Replace expand_start_target_temps calls with explicit - setting of stms_are_full_exprs_p. - (destroy_local_var): New function. - (emit_local_var): Likewise. - (cp_finish_decl): Use them, as appropriate. - (start_function): Announce template functions. - (store_parm_decls): Don't call declare_function_name here. - (finish_stmt): Don't start emit base-initialization code when just - building the statement-tree. - * init.c (create_temporary_var): Move add_decl_stmt call ... - (get_temp_regvar): Here. - * pt.c (tsubst_expr): Make DECL_INITIAL look like what - cp_finish_decl would expect. Don't call add_decl_stmt. - * semantics.c (begin_compound_stmt): Call declare_function_name, - if appropriate. - (finish_decl_cleanup): New function. - (expand_stmt): Use emit_local_var to output variables. - (expand_body): Set current_function_name_declared. - -1999-09-10 Mark Mitchell - - * cp-tree.h (finish_cleanup_try_block): New function. - * semantics.c (finish_cleanup_try_block): Add comment. - -Fri Sep 10 10:32:32 1999 Bernd Schmidt - - * cp-tree.h: Delete declarations for all tree nodes now moved to - global_trees. - * decl.c: Delete their definitions. - (SHORT_TYPE_SIZE, INT_TYPE_SIZE, LONG_TYPE_SIZE, LONG_LONG_TYPE_SIZE, - FLOAT_TYPE_SIZE, DOUBLE_TYPE_SIZE, LONG_DOUBLE_TYPE_SIZE): Don't - provide defaults. - (init_decl_processing): Call build_common_tree_nodes and - build_common_tree_nodes_2 instead of building their nodes here. - Don't add gc roots for them. - -1999-09-10 Mark Mitchell - - * cp-tree.h (language_function): Rename expanding_p to - x_expanding_p. Rename named_label_uses to x_named_label_uses. - (expanding_p): Adjust accordingly. - (TREE_VIA_PRIVATE): Fix typo in comment. - (DECL_REFERENCE_SLOT): Remove. - (SET_DECL_REFERENCE_SLOT): Likewise. - * decl.c (named_label_uses): Adjust. Remove chicken comment. - (push_overloaded_decl): Don't truncate the chain of bindings when - adding an overloaded function. - (grok_reference_init): Don't use DECL_REFERENCE_SLOT. - (initialize_local_var): Fix typo in comment. - (store_parm_decls): Don't set DECL_REFERENCE_SLOT. Tidy up. - * decl2.c (start_objects): Make the fact that we are expanding - the generated function right away explicit. - (start_static_storage_duration_function): Likewise. - (finish_file): Fix typo in comment. - * init.c (build_vec_init): Correct bugs in handling cleanups. - * semantics.c (maybe_convert_cond): New function. - (FINISH_COND): Always store the condition, even if there's - a declaration. - (finish_if_stmt_cond): Use maybe_convert_cond. - (finish_while_stmt_cond): Likewise. - (finish_do_stmt): Likewise. - (finish_for_cond): Likewise. - (expand_cond): Adjust. - - * cp-tree.h (FN_TRY_BLOCK_P): New macro. - * init.c (perform_member_init): Remove obstack machinations. - (expand_cleanup_for_base): Likewise. - (finish_init_stmts): Mark the statement-expression as used. - * method.c (emit_thunk): Use tree-generating functions, not - RTL. - (do_build_copy_constructor): Likewise. - (do_build_assign_ref): Likewise. - (synthesize_method): Likewise. Keep track of line numbers. - * pt.c (tsubst_expr): Handle various kinds of try blocks. - * semantics.c (expand_stmts): Remove. - (begin_function_try_block): Set FN_TRY_BLOCK_P. - (finish_function_try_block): Be careful rechaining - function try blocks. - (expand_stmt): Loop through all the statements at a given level. - (exapnd_body): Be careful with line-numbers here too. Prepare for - being called directly from the parser. - - * cp-tree.h (finish_function): Adjust prototype. - * decl.c (finish_function): Return the function compiled. - * pt.c (instantiate_decl): Don't play games with obstacks. - * tree.c (mapcar): Handle OFFSET_REF and BIT_FIELD_REF. - (search_tree): Likewise. - * typeck.c: Fix typo in comment. - * typeck2.c (store_init_value): Add comment. - - * cp-tree.h (CPTI_ATEXIT): New macro. - (atexit_node): Likewise. - * decl.c (destroy_local_static): New function, broken out from ... - (expand_static_init): Here. - - * rtti.c (get_tinfo_var): These should always be global - (expand_si_desc): Use tree, not RTL, functions to generate code. - (expand_class_desc): Likewise. - (expand_ptr_desc): Likewise. - (expand_attr_desc): Likewise. - (expand_generic_desc): Likewise. - (synthesize_tinfo_fn): Likewise. - -1999-09-09 Mark Mitchell - - * semantics.c (RECHAIN_STMTS): Remove `last' parameter. - (RECHAIN_STMTS_FROM_LAST): Remove. Replace all uses with - RECHAIN_STMTS. - (RECHAIN_STMST_FROM_CHAIN): Likewise. - - * parse.y (simple_stmt): Fix typo in last change. - - * cp-tree.h (EXPR_STMT_ASSIGNS_THIS): New macro. - (STMT_IS_FULL_EXPR_P): Likewise. - (STMT_LINENO_FOR_FN_P): Likewise. - (prep_stmt): New function. - (building_stmt_tree): Tweak for safety. - * pt.c (tsubst_expr): Use prep_stmt throughout. - (add_tree): Move it to semantics.c - * semantics.c (add_tree): Move it here. - (finish_expr_stmt_real): New function. - (finish_expr_stmt): Use it. - (finish_if_stmt_cond): Use FINISH_COND. - (finish_while_stmt_cond): Likewise. - (finish_for_cond): Likewise. - (finish_stmt_tree): Tweak line-number handling. - (prep_stmt): New function. - (expand_stmt): Use it. - - * cp-tree.h (begin_switch_stmt): Adjust prototype. - (finish_switch_cond): Likewise. - * parse.y (simple_stmt): Adjust accordingly. - * parse.c: Regenerated. - * pt.c (tsubst_expr): Adjust accordingly. - * semantics.c (expand_cond): New function. - (FINISH_COND): New macro. - (begin_switch_stmt): Build the SWITCH_STMT here. - (finish_switch_stmt_cond): Not here. - (expand_stmt): Adjust calls to begin_switch_stmt and - finish_switch_cond. Use expand_cond throughout. - - * dump.c (dequeue_and_dump): Dump types for constants. - Describe DECL_ARG_TYPE more intuitively. - Handle ARRAY_REF. - - * decl.c (lang_mark_tree): Mark TYPE_LANG_SPECIFIC. - (lang_cleanup_tree): Remove. - * lex.c (make_lang_type): Use ggc_alloc to allocate - TYPE_LANG_SPECIFIC. - - Reorganize per-function data. - * cp-tree.h (saved_scope): Add function_decl, bindings. - (language_function): Rename binding_level to bindings. - (cp_function_chain): Use the current_function, not the - outer_function_chain. - (current_class_ptr): Make it work, even when there's no - current function. - (current_class_ref): Likewise. - (SF_DEFAULT, SF_PRE_PARSED, SF_INCLASS_INLINE, SF_EXPAND): New - macros. - (clear_temp_name): Remove. - * decl.c (check_function_type): New function, broken out from - start_function. - (current_binding_level): Adjust definition. - (pushlevel): Simplify. - (poplevel): Don't use named_label_uses when we're outside - a function scope. - (mark_saved_scope): Mark function_decl and bindings. - (maybe_push_to_top_level): Don't unconditionally push a new - function context. Save bindings and the current_function_decl. - Don't clear named_labels. - (pop_from_top_level): Pop function context if appropriate. - (init_decl_processing): Set init_lang_status and free_lang_status, - rather than save_lang_status and restore_lang_status. - (start_function): Take SF_* flags. Don't clear per-function data. - Reorder and simplify to use new per-function data code. Add - asserts. - (store_parm_decls): Don't call init_function_start here. - (finish_function): Adjust for new handling of per-function data. - (push_cp_function_context): Simplify. - (mark_cp_function_context): Change binding_level to bindings. - * decl2.c (clear_temp_name): Remove. - (start_objects): Use SF flags to start_function. - (start_static_storage_duration_function): Likewise. - * except.c (start_anon_func): Remove redundant calls to - push_function_context_to. Use SF flags to start function. - (end_anon_func): Remove redundant call to pop_function_context - from. - * lex.c (reinit_parse_for_function): Don't initialize per-function - data. - * method.c (emit_thunk): Clear current_function after calling - assemble_end_function. Use SF flags for start_function. - (synthesize_method): Use SF flags for start_function. - * parse.c: Regenerated. - * parse.y (fn.defpen): Likewise. - (pending_inline): Clear current_function, even if something goes - wrong. - * pt.c (instantiate_decl): Use SF flags to start_function. - Don't save and restore expanding_p. - (add_tree): Handle the case where we are outside any function. - (end_tree): Likewise. - * rtti.c (sythesize_tinfo_fn): Use SF flags to start_function. - * semantics.c (begin_function_definition): Likewise. - (expand_body): Likewise. - -1999-09-09 Nathan Sidwell - - * cp-tree.h (convert_to_void): Prototype new function. - (require_complete_type_in_void): Remove prototype. - * cvt.c (convert_to_void): New function. - (ocp_convert): Use convert_to_void. - * decl.c (cplus_expand_expr_stmt): Likewise, for complete - expressions. - * typeck.c (require_complete_type_in_void): Remove function. - (build_compound_expr): Use convert_to_void. - (build_static_cast): Likewise. - (build_c_cast): Likewise. - * semantics.c (finish_expr_stmt): Do not decay full expressions. - - * typeck.c (build_x_compound_expr): Add FIXME. - -1999-09-08 Mark Mitchell - - * cp-tree.h (scratch_tree_cons): Remove. - * call.c: Replace all uses of expr_tree_cons, saveable_tree_cons, - and perm_tree_cons with plain tree_cons. - * class.c: Likewise. - * decl.c: Likewise. - * decl2.c: Likewise. - * except.c: Likewise. - * expr.c: Likewise. - * init.c: Likewise. - * lex.c: Likewise. - * method.c: Likewise. - * parse.y: Likewise. - * pt.c: Likewise. - * repo.c: Likewise. - * rtti.c: Likewise. - * search.c: Likewise. - * typeck.c: Likewise. - * parse.c: Regenerated. - * tree.c (build_srcloc): Simplify. - -1999-09-08 Bruce Korb autogen@linuxbox.com - - * Makefile.in: Give the gperf user a hint about why "gperf -F" fails. - -1999-09-08 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Remove permanent_attr. - Remove next. - (LANG_DECL_PERMANENT): Remove. - * decl.c (duplicate_decls): Don't mess about with obstacks trying - to free memory. - (lang_mark_tree): Mark DECL_LANG_SPECIFIC. - * lex.c (free_lang_decl_chain): Remove. - (build_lang_decl): Don't use obstacks. - (retrofit_lang_decl): Likewise. - (copy_lang_decl): Likewise. - - * cp-tree.h (saved_scope): Remove old_binding_level and - function_decl. Tidy up. - * decl.c (mark_saved_scope): Don't set them. - (maybe_push_to_top_level): Clear memory. - - * decl.c (layout_var_decl): Change prototype. Don't complete - types for external objects. - (check_initializer): Likewise. Tidy. - (initialize_local_var): Complete types here. - (cp_finish_decl): Not here. Reorganize a little. - (grokvardecl): Don't complete types here. - - * decl.c (start_function): Clear last_dtor_insn and - last_parm_cleanup_insn. - (push_cp_function_context): Just copy over a little of - the old context, not all of it. - - * cp-tree.h (copy_to_permanent): Remove. - (permanent_p): Likewise. - * decl.c (building_typename_type): Don't use copy_to_permanent. - (start_decl): Likewise. - (grok_reference_init): Likewise. - (cp_finish_decl): Likewise. - * init.c (build_new_1): Don't use mapcar. - (build_vec_delete_1): Don't use copy_to_permanent. - (build_vec_init): Likewise. - * parse.y (primary): Likewise. - * parse.c: Regenerated. - * pt.c (push_template_decl_real): Don't use copy_to_permanent. - (lookup_template_class): Likewise. - (tsubst_friend_function): Likewise. - (instantiate_class_template): Likewise. - (tsubst_decl): Likewise. - (tsubst): Likewise. - (instantiate_template): Likewise. - (unify): Likewise. - * rtti.c (get_tinfo_fn): Likewise. - (build_dynamic_cast): Likewise. - * semantics.c (finish_if_stmt_cond): Likewise. - (finish_while_stmt_cond): Likewise. - (finish_do_stmt): Likewise. - (finish_for_cond): Likewise. - (finish_for_expr): Likewise. - (finish_cleanup): Likewise. - (add_decl_stmt): Likewise. - (finish_named_return_value): Likewise. - (finish_qualified_call_expr): Likewise. - * tree.c (perm_manip): Remove. - (build_exception_variant): Don't use copy_to_permanent. - (permanent_p): Remove. - (copy_to_permament): Remove. - (build_min_nt): Don't use copy_to_permanent. - (build_min): Likewise. - (min_tree_cons): Likewise. - * typeckc.c (build_static_cast): Likewise. - (build_reinterpret_cast): Likewise. - (build_const_cast): Likewise. - -1999-09-07 Mark Mitchell - - * decl.c (ggc_p): Set it to 1. - (mark_saved_scope): Add prototype. - -1999-09-07 Richard Henderson - - * cp-tree.h (C_PROMOTING_INTEGER_TYPE_P): Delete. - * typeck.c (self_promoting_args_p): Delete. - -1999-09-07 Jason Merrill - - * search.c (binfo_for_vtable): Use CLASSTYPE_VFIELD_PARENT. - (dfs_bfv_queue_p, dfs_bfv_helper, struct bfv_info): Remove. - -1999-09-07 Mark Mitchell - - * Makefile.in (tree.o): Depend on ggc.h. - * class.c (make_method_vec): Remove. - (free_method_vec): Likewise. - (free_method_vecs): Remove. - (add_method): Don't use them. - * cp-tree.def (PTRMEM_CST): Make it longer. - (TEMPLATE_PARM_INDEX): Make it shorter. - * cp-tree.h (BINDING_HAS_LEVEL_P): New macro. - (template_parm_index): Remove RTL field. - (ptrmem_cst): Add RTL field. - (finish_function): Removed parameter. - (process_next_inline): Change prototype. - (init_cplus_unsave): Rename to init_tree. - (binding_init): Remove. - * decl.c (free_binding_nodes): Remove. - (push_binding): Don't use them. Set BINDING_HAS_LEVEL_P. - (pop_binding): Don't use free_binding_nodes. - (free_binding_vecs): Remove. - (store_bindings): Don't use them. - (pop_from_top_level): Likewise. - (lookup_namespace_name): Simplify. - (build_typename_type): Don't use obstack_free. - (unqualified_namespace_lookup): Simplify. - (lookup_name_real): Simplify. - (start_function): Remove comment about leaks. - (finish_function): Removed nested parameter. Call - expand_end_bindings even when building_stmt_tree. - Call ggc_push_context and ggc_pop_context around - rest_of_compilation, if necessary. - (mark_cp_function_context): Handle a NULL language-context. - (lang_mark_false_label_stack): Fix typo. - (lang_mark_tree): Handle CPLUS_BINDING, OVERLOAD, - TEMPLATE_PARM_INDEX. Handle the funny TYPE_LANG_SPECIFIC on - pointer to method types. - (lang_cleanup_tree): Use free to free TYPE_LANG_SPECIFIC. - * decl2.c (finish_objects): Adjust call to finish_function. - (finish_static_store_duration_function): Likewise. - (do_nonmember_using_decl): Remove call to binding_init. - * except.c (end_anon_func): Adjust call to finish_function. - * lex.c (mark_impl_file_chain): New function. - (init_parse): Call init_tree, not init_cplus_unsave. - Add GC roots. - (cp_pramga_interface): Use xmalloc, not permalloc. - (cp_pragma_implementation): Likewise. - (begin_definition_of_inclass_inline): Simplify. - (process_next_inline): Adjust prototype. - (do_scoped_id): Don't call binding_init. - (make_lang_type): Allocate TYPE_LANG_SPECIFIC with xmalloc. - * method.c (emit_thunk): Adjust call to finish_function. - (synthesize_method): Likewise. - * parse.y (%union): Add a new `pi' variant. - (PRE_PARSED_FUNCTION_DECL): Use it. - (fn.defpen): Likewise. - (fndef): Adjust call to finish_function. - * pt.c (instantiate_decl): Likewise. - * rtti.c (syntheisze_tinfo_fn): Likewise. - * semantics.c (expand_body): Likewise. - * tree.c: Include ggc.h. - (mark_list_hash): New function. - (binding_init): Remove. - (init_cplus_unsave): Rename to ... - (init_tree): This. Add GC roots. - -1999-09-05 Mark Mitchell - - Get ready for garbage collection. - * Makefile.in (CXX_TREE_H): Add varray.h - (lex.o): Depend on ggc.h. - (decl.o): Likewise. - (decl2.o): Likewise. - (method.o): Likewise. - (search.o): Likewise. - (pt.o): Likewise. - (repo.o): Likewise. - * class.c: Include ggc.h. - (current_class_name): Remove. - (current_class_type): Likewise. - (current_access_specifier): Likewise. - (previous_class_type): Likewise. - (previous_class_values): Likewise. - (class_cache_firstobj): Likewise. - (current_lang_base): Likewise. - (current_lang_stack): Likewise. - (current_lang_stacksize): Likewise. - (lang_name_c): Likewise. - (lang_name_cplusplus): Likewise. - (lang_name_java): Likewise. - (current_lang_name): Likewise. - (base_layout_decl): Likewise. - (access_default_node): Likewise. - (access_public_node): Likewise. - (access_protected_node): Likewise. - (access_private_node): Likewise. - (access_default_virtual_node): Likewise. - (access_public_virtual_node): Likewise. - (access_protected_virtual_node): Likewise. - (access_private_virtual_node): Likewise. - (signed_zero_node): Likewise. - (init_class_processing): Don't build base_layout_decl. - (push_lang_context): Adjust now that current_lang_base is a varray. - (pop_lang_context): Likewise. - * cp-tree.h: Include varray.h. - (cp_global_trees): Add access_default, access_public, - access_protected, access_private, access_default_virtual, - access_public_virtual, access_protected_virtual, - access_private_virtual, ctor_identifier, delta2_identifier, - delta_identifier, dtor_identifier, in_charge_identifier, - index_identifier, nelts_identifier, this_identifier, - pfn_identifier, pfn_or_delta2_identifier, vptr_identifier, - lang_name_c, lang_name_cplusplus, lang_name_java, - empty_except_spec, null, jclass, minus_one, terminate. - (saved_scope): Move here from decl.c. Define globals in terms of - saved_scope: current_namespace, current_class_name, - current_class_type, current_access_specifier, current_lang_stack, - current_lang_base, current_lang_name, current_function_parms, - current_template_parms, processing_template_decl, - processing_specialization, processing_explicit_instantiation, - previous_class_type, previous_class_values, class_cache_firstobj. - (scope_chain): New variable. - (init_pt): New function. - * decl.c (current_namespace): Remove. - (this_identifier, in_charge_identifier, ctor_identifier): Likewise. - (dtor_identifier, pfn_identifier, index_identifier): Likewise. - (delta_identifier, delta2_identifier): Likewise. - (pfn_or_delta2_identifier, tag_identifier): Likewise - (vt_off_identifier, empty_except_spec, null_node): Likewise. - (current_function_parms, current_lang_base): Remove. - (current_lang_stack, previous_class_values): Remove. - (class_binding_level): Macroize. - (saved_scope): Remove. - (current_saved_scope): Rename to scope_chain. - (mark_saved_scope): Adjust for new scope structure. - (maybe_push_to_top_level): Likewise. - (pop_from_top_level): Likewise. - (duplicate_decls): Adjust now that current_lang_base is a varray. - (build_typename_type): Call ggc_add_tree_hash_table_root. - (init_decl_processing): Call init_pt. Call push_to_top_level to - set up globals. Add GC roots. - (xref_basetypes): Adjust now that current_lang_base is a varray. - * decl.h (this_identifier): Remove. - (in_charge_identifier): Likewise. - * decl2.c: Don't include varray.h. - (current_namespace): Remove. - (init_decl2): Add GC roots. - * except.c (Terminate): Remove. - (init_exception_processing): Use terminate_node instead. - (build_terminate_handler): Likewise. - * init.c (nc_nelts_field_id): Remove. - (minus_one): Likewise. - (init_init_processing): Use minus_one_node and nelts_identifier - instead. Add GC roots. - (jclass_node): Remove. - (build_new_1): Use nelts_identifier. - (build_vec_init): Likewise. - (build_vec_delete): Likewise. - * lex.c: Include ggc.h. - (defarg_fn): Move declaration early. - (defarg_parms): Likewise. - (init_parse): Add GC roots. - (handle_cp_pragma): Remove redundant declaration of - pending_vtables. - * method.c: Include ggc.h. - (btypelist): Make it a varray. All uses changed. - (ktypelist): Likewise. - (init_method): Add GC roots. - * pt.c: Don't include varray.h. Include ggc.h. - (current_template_parms): Remove. - (processing_template_decl): Likewise. - (processing_specialization): Likewise. - (processing_explicit_instantiation): Likewise. - (init_pt): New function. - * repo.c: Include ggc.h. - (init_repo): Add GC roots. - * search.c: Don't include varray.h. - (_vptr_name): Remove. - (lookup_field_1): Use vtpr_identifier instead. - (expand_indirect_vtbls_init): Remove redundant declaration of - in_charge_identifier. - (init_search_processing): Use vptr_identifier. - -1999-09-05 Richard Henderson - Bernd Schmidt - Mark Mitchell - - * Makefile.in (parse.o): Depend on ggc.h. - (decl2.o): Depend on ggc.h. - (init.o): Depend on ggc.h. - * cp-tree.h (init_decl2): Declare. - (cp_parse_init): Likewise. - * decl.c (ggc_p): Define to zero. - (mark_saved_scope): New function. - (init_decl_processing): Call cp_parse_init, and cp_decl2. - Register GC roots. - (expand_static_init): Add GC roots. - * decl2.c: Include ggc.h. - (init_decl2): New function. - * init.c: Include ggc.h. - (init_init_processing): Add GC roots. - * parse.y: Include ggc.h. - (cp_parse_init): New function. - -1999-09-04 Mark Mitchell - - * decl.c (init_decl_processing): Set mark_lang_status. - (lang_mark_false_label_stack): Adjust prototype. - * decl2.c (grok_function_init): Remove extraneous declaration of - abort_fndecl. - - * Make-lang.in (cc1plus): Remove dependency on GGC. - * Makefile.in (OBJS): Don't mention ggc-simple.o. - (OBJDEPS): Don't mention ggc-simple.o. - - * Make-lang.in (cc1plus): Depend on $(GGC). - * Makefile.in (OBJS): Add ggc-simple.o. - (OBJDEPS): Likewise. - * cp-tree.h (language_function): Rename members to `x_' versions; - we now have x_named_labels, x_ctor_label, x_dtor_label, - x_base_init_list, x_member_init_list, x_base_init_expr, - x_current_class_ptr, x_current_class_ref, x_last_tree, - x_last_expr_type, x_last_dtor_insn, x_last_parm_cleanup_insn, and - x_result_rtx. - (dtor_label, ctor_label, current_base_init_list, - current_member_init_list, base_init_expr, current_class_ptr, - current_class_ref, last_tree, last_expr_type): Adjust accordingly. - * decl.c: Include ggc.h. - (last_dtor_insn): Adjust to use x_ names. - (last_parm_cleanup_insn): Likewise. - (original_result_rtx): Likewise. - (named_labels): Likewise. - (mark_binding_level): New function. - (mark_cp_function_context): Likewise. - (mark_false_label_stack): Likewise. - (lang_mark_tree): Likewise. - (lang_cleanup_tree): Likewise. - -1999-09-03 Mark Mitchell - - * Makefile.in (CXX_TREE_H): Include function.h. - (decl.o): Don't depend on function.h. - (decl2.o): Likewise. - (typeck.o): Likewise. - (init.o): Likewise. - (method.o): Likewise. - * cp-tree.h: Include function.h. - (cp_function): Rename to language_function. Remove next. - (cp_function_chain): Make it a macro, not a variable. - (push_cp_function_context): Don't declare. - (pop_cp_function_context): Likewise. - * decl.c: Don't include function.h. - (push_cp_function_context): Make it static. Make it suitable for - a save_lang_status callback. - (pop_cp_function_context): Likewise. - (maybe_push_to_top_level): Call push_function_context_to, not - push_cp_function_context. - (pop_from_top_level): Call pop_function_context_from, not - pop_cp_function_context. - (init_decl_processing): Set save_lang_status and - restore_lang_status. Call push_function_context_to, not - push_cp_function_context. - (cp_function_chain): Remove. - * decl2.c: Don't include function.h. - * except.c: Don't include function.h. - (start_anon_func): Call push_function_context_to, not - push_cp_function_context. - (end_anon_func): Call pop_function_context_from, not - pop_cp_function_context. - * init.c: Don't include function.h. - * lex.c (begin_definition_of_inclass_inline): Call - push_function_context_to, not push_cp_function_context. - (process_next_inline): Call pop_function_context_from, not - pop_cp_function_context. - * method.c: Don't include function.h. - (synthesize_method): Call push_function_context_to, not - push_cp_function_context. Call pop_function_context_from, not - pop_cp_function_context. - * typeck.c: Don't include function.h. - - * decl.c (expand_static_init): Tweak handling of static - initializations for objects without constructors. - -1999-09-03 Nathan Sidwell - - * typeck.c (build_indirect_ref): Reject dereference of pointer to - void. - -1999-09-02 Mark Mitchell - - * cp-tree.h (cp_function): Move here, from decl.c. - (cp_function_chain): Declare. - (dtor_label): New macro, instead of variable. - (ctor_label): Likewise. - (current_base_init_list): Likewise. - (current_member_init_list): Likewise. - (base_init_expr): Likewise. - (current_class_ptr): Likewise. - (current_class_ref): Likewise. - (last_tree): Likewise. - (last_expr_type): Likewise. - (current_function_returns_value): Likewise. - (current_function_returns_null): Likewise. - (current_function_just_assigned_this): Likewise. - (current_function_parms_stored): Likewise. - (temp_name_counter): Likewise. - (static_labelno): Likewise. - (expanding_p): Likewise. - (stmts_are_full_exprs_p): Likewise. - (in_function_try_handler): Likewise. - (lang_type): Remove nested type_flags. All uses changed. - * call.c (ctor_label): Remove. - (dtor_label): Likewise. - * class.c (current_class_ptr): Remove. - (current_class_ref): Likewise. - * decl.c (static_labelno): Remove. - (dtor_label): Likewise. - (last_dtor_insn): New macro, instead of variable. - (last_parm_cleanup_insn): Likewise. - (original_result_rtx): Likewise. - (in_function_try_handler): Remove. - (named_label_uses): New macro, instead of variable. - (named_labels): Likewise. - (current_function_returns_value): Remove. - (current_function_returns_null): Likewise. - (current_function_assigns_this): New macro, instead of variable. - (current_function_just_assigned_this): Likewise. - (current_binding_level): Likewise. - (init_decl_processing): Call push_cp_function_context. - (cp_function): Move to cp-tree.h - (cp_function_chain): Make it global. - (temp_name_counter): Remove. - (push_cp_function_context): Simplify. - (pop_cp_function_context): Likewise. - * decl2.c (temp_name_counter): Remove. - * init_c (current_base_init_list): Likewise. - (current_member_init_list): Likewise. - (base_init_expr): Likewise. - * method.c (static_labelno): Likewise. - * pt.c (last_tree): Likewise. - * semantics.c (expanding_p): Likewise. - (stmts_are_full_exprs_p): Likewise. - (last_expr_type): Likewise. - * typeck.c (dtor_label): Likewise. - (ctor_label): Likewise. - -1999-09-01 Alex Samuel - - * decl2.c (arg_assoc_template_arg): New prototype. New function. - (arg_assoc_class): Use arg_assoc_template_arg for template - arguments. - (arg_assoc): Likewise. - * pt.c (mangle_class_name_for_template): Allow member template - template arguments. - -1999-09-02 Nathan Sidwell - - * call.c (build_conditional_expr): Warn on enum mismatches. - (convert_arg_to_ellipsis): Move non-pod check to after - conversion. - -1999-09-01 Kaveh R. Ghazi - - * gxx.gperf (hash, is_reserved_word): Add prototypes. - - * init.c (build_vec_init): Initialize variable `try_block'. - - * lex.c (init_parse): Call memcpy, not bcopy, to avoid casts. - Likewise for bzero/memset. - (token_getch, token_put_back): Add static prototypes. Remove - `inline' from the definitions. - (retrofit_lang_decl): Call memset, not bzero, to avoid casts. - -1999-09-01 Mark Mitchell - - * cp-tree.h (lang_type): Move align into type_flags. - (CLASSTYPE_ALIGN): Adjust accordingly. - * call.c (direct_reference_binding): Remove misleading comment. - -1999-08-30 Kaveh R. Ghazi - - * parse.y (language_string): Constify. - -1999-08-30 Kaveh R. Ghazi - - * repo.c (getpwd): Don't prototype. - * xref.c (getpwd): Likewise - -1999-08-30 Kaveh R. Ghazi - - * Makefile.in (LIBS, LIBDEPS): Link with & depend on libiberty.a. - Remove hacks for stuff which now comes from libiberty. - -1999-08-30 Jason Merrill - - * cp-tree.h (IS_AGGR_TYPE_2): Fix typo. - -1999-08-30 Mark Mitchell - - * cp-tree.h (begin_init_stmts): Declare. - (finish_init_stmts): Likewise. - * cvt.c (build_up_reference): Wrap the declaration of a temporary - in a statement-expression so that we will see it when expanding - tree structure later. - * init.c (begin_init_stmts): Don't make it static. - (finish_init_stmts): Likewise. - - * cp-tree.h (start_handler_parms): New function. - (expand_start_catch_block): Take only one parameter. - (start_handler_parms): New function. - * decl.c (start_handler_parms): Define it. - * except.c (process_start_catch_block): Take only one parameter. - Don't call grokdeclarator here. - (expand_start_catch_block): Don't call grokdeclarator here, - either. - * parse.y (handler_args): Adjust call to - expand_start_catch_block. Use start_handler_parms. - * pt.c (push_template_decl_real): Make permanent lists have - permanent elements. - (tsubst_expr): Adjust calls to expand_start_catch_block - appropriately. - * semantics.c (expand_stmt): Likewise. - -1999-08-29 Alex Samuel - - * pt.c (push_template_decl_real): Use template declaration from - class type if it exists. - -1999-08-29 Mark Mitchell - - * cp-tree.h (TYPE_NEEDS_CONSTRUCTING): Remove #if 0'd definition. - (maybe_inject_for_scope_var): Declare it. - (initialize_local_var): Likewise. - * decl.c (maybe_inject_for_scope_var): Make it global. - (initialize_local_var): Likewise. Move cleanup handling here, - from cp_finish_decl. - (make_rtl_for_nonlocal_decl): Use - push_obstacks_nochange/pop_obstacks, rather than - end_temporary_allocation/resume_temporary_allocation. - (cp_finish_decl): Try to complete the type of a variable when it - is declared. Move cleanup-handling to initialize_local_var. - (expand_static_init): Use tree-building code, rather than - RTL-building code. - * decl2.c (get_temp_name): Assert non-initializedness of - temporaries. - * init.c (create_temporary_var): Move RTL-assigning code to ... - (get_temp_regvar): Here. - * pt.c (tsbust_expr): Fix indentation. Call cp_finish_decl here. - * semantics.c (expand_stmt): Don't call cp_finish_decl here. Just - call initialize_local_var to generate initialization code. - -1999-08-29 Kaveh R. Ghazi - - * cp-tree.h (fndecl_as_string, type_as_string, - type_as_string_real, args_as_string, decl_as_string, - expr_as_string, code_as_string, language_as_string, - parm_as_string, op_as_string, assop_as_string, cv_as_string, - lang_decl_name, cp_file_of, lang_printable_name): Constify a char*. - - * errfn.c (cp_printer): Likewise. - - * error.c (cp_printer, fndecl_as_string, type_as_string_real, - type_as_string, expr_as_string, decl_as_string, lang_decl_name, - cp_file_of, code_as_string, language_as_string, parm_as_string, - op_as_string, assop_as_string, args_as_string, cv_as_string): - Likewise. - - * tree.c (lang_printable_name): Likewise. - -1999-08-28 Richard Henderson - - * decl2.c (arg_assoc_class): Bail if the class is a builtin type. - -1999-08-28 Mark Mitchell - - * cp-tree.h (strip_array_types): New function. - * decl.c (maybe_deduce_size_from_array_init): New function, split - out from cp_finish_decl. - (layout_var_decl): Likewise. - (maybe_commonize_var): Likewise. - (maybe_inject_for_scope_var): Likewise. - (initialize_local_var): Likewise. - (build_cleanup_on_safe_obstack): Likewise. - (check_initializer): Likewise. - (make_rtl_for_nonlocal_decl): Likewise. - (cp_finish_decl): Use them. - * typeck.c (strip_array_types): New function. - - * cp-tree.def (LABEL_STMT): New tree node. - * cp-tree.h (LABEL_STMT_LABEL): New macro. - (shadow_label): Remove. - (declare_local_label): New function. - (finish_label_decl): Likewise. - * decl.c (make_label_decl): New function, split out from - lookup_label. - (shadowed_labels): Remove. - (binding_level): Add shadowed_labels. - (clear_binding_level): Remove. - (push_binding_level): Just bzero the new binding level. - (pushlevel): Fix indentation. - (pop_label): New function. - (pop_labels): Likewise, split out from poplevel. - (poplevel): Pop local labels. Use pop_labels. - (maybe_push_to_top_level): Don't clear shadowed_labels. - (lookup_label): Use make_label_decl. - (shadow_label): Remove. - (declare_local_label): New function. - (define_label): Simplify. - (start_function): Don't clear shadowed_labels. - (cp_function): Remove shadowed_labels. - (push_cp_function_context): Don't save shadowed_labels. - (pop_cp_function_context): Don't restore it. - * dump.c (dequeue_and_dump): Handle LABEL_STMT. - * parse.y (label_decl): Use finish_label_decl. - * pt.c (tsubst_expr): Handle LABEL_STMTs, and local label - declarations. - * semantics.c (finish_label_stmt): Add a LABEL_STMT when - building_stmt_tree. - (finish_label_decl): New function. - (expand_stmt): Handle LABEL_STMTs and local label declarations. - -1999-08-26 Mark Mitchell - - * decl.c (lookup_label): Build labels on the permanent obstack - when building statement trees. Don't build RTL for labels when - building statement trees. - * semantics.c (finish_goto_stmt): Use LABEL_DECLs even when - building statement trees. - (finish_label_stmt): Likewise. - (expand_stmt): Adjust accordingly. - * pt.c (tsubst_expr); Likewise. - (do_decl_instantiation): Robustify. - - * cp-tree.h (AGGR_INIT_VIA_CTOR_P): New macro. - * tree.c (build_cplus_new): Set it. - * expr.c (cplus_expand_expr): Use it. - * dump.c (deque_and_dump): Handle AGGR_INIT_EXPR. - - * decl.c (store_parm_decls): Reset immediate_size_expand. - (finish_function): Likewise. - - * tree.c (cplus_unsave_expr_now): Don't return a value. - - * semantics.c (do_poplevel): Always initialize the return value. - -1999-08-26 Gavin Romig-Koch - - * cp-tree.h (cplus_unsave_expr_now) : Correct return type. - * tree.h (cplus_unsave_expr_now) : Same. - -1999-08-25 Mark Mitchell - - * decl.c (grokdeclarator): Amend comment. - * except.c (expand_start_catch_block): Call push_template_decl for - catch-block parameters. - * method.c (synthesize_method): Build an empty compound statement - for the body of a constructor. - -1999-08-25 Jason Merrill - - * tree.c (cp_build_qualified_type_real): If we're asking for the - same quals we already have, just return. - -1999-08-25 Mark Mitchell - - * cp-tree.def (SUBOBJECT): New tree node. - * cp-tree.h (CLEANUP_P): New macro. - (SUBOBJECT_CLEANUP): Likewise. - (keep_next_level): Add parameter. - (get_temp_regvar): Don't declare. - (emit_base_init): Remove parameter. - (expand_aggr_init): Rename to build_aggr_init. - (expand_vec_init): Rename to build_vec_init. - (do_pushlevel): Remove. - (do_poplevel): Likewise. - (finish_cleanup): New function. - (finish_subobject): Likewise. - (stmts_are_full_exprs_p): New variable. - * decl.c (keep_next_level): Add parameter. - (cp_finish_decl): Use build_aggr_init, not - expand_aggr_init. Use finish_expr_stmt to expand the code. - (expand_static_init): Use tree-generating, not RTL-generating, - functions to handle the initialization. - (start_function): Remove dead code. Always have a momentary - obstack inside the function, even before hitting the first curly - brace. - (cplus_expand_expr_stmt): Move calls to - expand_{start,end}_target_temps into semantics.c. - (cp_function): Add stmts_are_full_exprs_p. - (push_cp_function_context): Save it. - (pop_cp_function_context): Restore it. - * decl2.c (get_temp_regvar): Move to init.c. - (do_static_initialization): Use build_{aggr,vec}_init. - (do_static_destruction): Fix typo in comment. - * dump.c (dequeue_and_dump): Handle INIT_EXPR. - * except.c (expand_throw): Use create_temporary_var. - * expr.c (cplus_expand_expr): Use build_{aggr,vec}_init. - * init.c (expand_vec_init_try_block): Remove. - (expand_vec_init_catch_clause): Likewise. - (get_temp_regvar): New function. - (begin_init_stmts): Likewise. - (finish_init_stmts): Likewise. - (perform_member_init): Use build_{aggr,vec}_init. Build up tree - structure here. - (emit_base_init): Likewise. Remove unused parameter. - (expand_virtual_init): Likewise. - (expand_cleanup_for_base): Use finish_subobject. - (expand_aggr_vbase_init_1): Simplify. - (construct_virtual_bases): Use tree-generating functions to build - up initialization. - (expand_aggr_init): Likewise. Rename to build_aggr_init. - (expand_default_init): Likewise. - (expand_aggr_init_1): Likewise. - (expand_vec_init): Rename to build_vec_init. - * method.c (do_build_copy_constructor): Use tree-generating - functions. Don't call clear_last_expr. - (do_build_assign_ref): Likewise. - (synthesize_method): Call clear_last_expr here. - * parse.y (base_init): Don't call clear_last_expr here. - (nodecls): Likewise. - * pt.c (tsubst_expr): Handle a TRY_BLOCK with CLEANUP_P set. - * semantics.c (do_pushlevel): Move to here. - (do_poplevel): Likewise. - (stmts_are_full_exprs_p): New variable. - (finish_expr_stmt): Handle logic for temoprary cleanup here. - (finish_for_stmt): Use finish_expr_stmt. - (finish_cleanup): New function. - (finish_function_try_block): Fix indentation. - (finish_subobject): New function. - (setup_vtbl_ptr): Call keep_next_level here. - (finish_stmt_expr): Handle a block with no scope inside the - statement-expression. - (expand_stmt): Handle a TRY_BLOCK with CLEANUP_P set. Handle - SUBOBJECT. - * tree.c (search_tree): Handle INIT_EXPR. - (mapcar): Likewise. - * typeck.c (build_modify_expr): Don't build an RTL_EXPR. - * typeck2.c (store_init_value): Change expand_aggr_init to - build_aggr_init in comment. - -1999-08-25 Mark Mitchell - - * dump.c (dequeue_and_dump): Dump TARGET_EXPRs. - -1999-08-25 Nathan Sidwell - - * decl2.c (handle_class_head): Be graceful about additional - scope qualifiers. Adjust comments to reflect reality. - -1999-08-24 Jason Merrill - - * call.c (build_conditional_expr): Fix typo. - * typeck.c (build_modify_expr, COND_EXPR): Make sure we've got an - lvalue before trying to mess with the sides. - - * error.c (dump_expr, CONVERT_EXPR): Handle (void) properly. - -Mon Aug 23 22:17:20 1999 Mumit Khan - - * g++spec.c (lang_specific_driver): Add room for NULL in arglist. - -1999-08-23 Jason Merrill - - * exception.cc (__cplus_type_matcher): Call __throw_type_match_rtti_2. - Return arbitrary pointer or NULL. - (check_eh_spec): Call __throw_type_match_rtti_2. - * tinfo.h (*::dcast): Return int. Add valp parm. - * tinfo.cc (*::dcast): Likewise. Adjust to allow for null pointers. - * tinfo2.cc (__throw_type_match_rtti_2): Likewise. - (__throw_type_match_rtti): Now just a wrapper. - - * except.c: Lose CatchMatch, FirstExceptionMatch, and Unwind. - (init_exception_processing): Don't initialize them. - -1999-08-23 Paul Burchard - - * decl.c (check_default_argument): Fix typo. - -1999-08-22 Mark Mitchell - - * cp-tree.def (STMT_EXPR): Fix typo in node name. - - * dump.c (dump_next_stmt): New function. - (dequeue_and_dump): Use it. - - * pt.c (tsubst_copy): Make sure to initialize return value for a - STMT_EXPR, even when processing_template_decl. - * semantics.c (finish_stmt_expr): A statement-expression whose - last statement is not an expression-statement has type `void'. - -1999-08-20 Mark Mitchell - - * semantics.c (finish_stmt_expr): Fix typo in comment. - * tree.c (search_tree): Handle EXIT_EXPR, LOOP_EXPR. - (mapcar): Likewise. - * init.c (build_vec_delete_1): Make the children of a permanent - BIND_EXPR permanent. - * pt.c (register_specialization): Don't register a specialization - more than once. - -1999-08-18 Andrew Haley - - * method.c (process_overload_item): Call build_mangled_C9x_name () - for all integer parameter types larger than long long. - -1999-08-19 Mark Mitchell - - * pt.c (redeclare_class_template): Merge default template - arguments in both directions. - - * typeck.c (common_type): Undo 1999-08-18 change. Remove - compiler_error message. - -1999-08-19 Jason Merrill - - * cp-tree.h: Declare flag_use_repository. - * pt.c (do_decl_instantiation): Don't complain about duplicate - instantiation with -frepo. - (do_type_instantiation): Likewise. - - * pt.c (push_template_decl_real): Complain about everything - that isn't a valid template. - - * decl2.c (import_export_decl): If -fnew-abi, class linkage doesn't - affect inlines. - -1999-08-19 Mark Mitchell - - * cp-tree.def (PSEUDO_DTOR_EXPR): New tree code. - * decl2.c (build_expr_from_tree): Handle it. - * error.c (dump_expr): Likewise. - * pt.c (for_each_template_parm): Likewise. - (tsubst_copy): Likewise. - * tree.c (search_tree): Likewise. - * semantics.c (finish_pseudo_destructor_call): Create it. - -1999-08-18 Mark Mitchell - - * search.c (setup_class_bindings): Robustify. - * typeck.c (common_type): Use same_type_p, not pointer equality, - to compare types. - - * cp-tree.h (build_lang_field_decl): Remove. - * class.c (build_vtable): Replace calls to build_lang_field_decl - with build_lang_decl. - (prepare_fresh_vtable): Likewise. - (finish_struct_1): Likewise. - (init_class_processing): Likewise. - * decl.c (push_using_decl): Likewise. - (init_decl_processing): Likewise. - (grokvardecl): Likewise. - (build_ptrmemfunc_type): Likewise. - (grokdeclarator): Likewise. - (build_enumerator): Likewise. - * decl2.c (grok_x_components): Likewise. - (do_class_using_decl): Likewise. - * except.c (call_eh_info): Likewise. - * init.c (init_init_processing): Likewise. - * rtti.c (expand_class_decl): Likewise. - * tree.c (build_base_fields): Likewise. - (build_vbase_pointer_fields): Likewise. - * lex.c (build_lang_decl): Build declarations on the permanent - obstack if we're building statmeent trees. - (retrofit_lang_decl): Handle both the full lang_decl and also the - smaller lang_decl_flags here. - (build_lang_field_decl): Remove. - * pt.c (push_template_decl_real): Issue errors for variable - declarations that are not static members. - -1999-08-18 Richard Henderson - - * tree.c (search_tree): Handle TRUTH_{AND,OR,XOR}_EXPR too. - (mapcar): Likewise. - -1999-08-17 Mark Mitchell - - * cp-tree.h (back_end_hook): New variable. - * decl2.c (back_end_hook): Define it. - (finish_file): If it's non-NULL, call it. - - * decl.c (add_decl_to_level): New function. - (push_local_binding): Use it. - (find_binding): Fix typo in comment. - (pushdecl): Use add_decl_to_level. Put templates on the - corresponding namespace-scope binding levels. - * dump.c (dequeue_and_dump): Print the specializations of a - template. - * pt.c (push_template_decl_real): Don't push a template multiple - times. - -1999-08-17 Mark Mitchell - - * cp-tree.h (CALL_DECLARATOR_PARMS): New macro. - (CALL_DECLARATOR_QUALS): Likewise. - (CALL_DECARATOR_EXCEPTION_SPEC): Likewise. - * decl.c (grokdeclarator): Adjust to use them. - * decl2.c (grokfield): Likewise. - (reparse_absdcl_as_casts): Likewise. - * lex.c (make_call_declarator): Likewise. - (set_quals_and_spec): Likewise. - * pt.c (tsubst): Likewise. - * tree.c (mapcar): Remove special hack to handle third operand of - a CALL_EXPR. - -1999-08-16 Mark Mitchell - - * cp-tree.h (CAN_HAVE_FULL_LANG_DECL_P): New macro. - * class.c (build_vtable): Use build_lang_field_decl to build the - VAR_DECLs for vtables. - (prepare_fresh_vtable): Likewise. - * decl.c (duplicate_decls): Only copy DECL_SAVED_TREE if - CAN_HAVE_FULL_LANG_DECL_P. - (push_using_decl): Use build_lang_decl to build USING_DECLs. - (grokdeclarator): Use build_lang_decl to build TYPE_DECLs. - * lex.c (retrofit_lang_decl): Check CAN_HAVE_FULL_LANG_DECL_P. - (build_lang_field_decl): Likewise. - (copy_lang_decl): Use CAN_HAVE_FULLLANG_DECL_P to decide how much - to copy. - - * cp-tree.def (STMT_EXPR): New tree node. - * cp-tree.h (STMT_EXPR_STMT): New macro. - (store_return_init): Change prototype. - (finish_named_return_value): New function. - (expand_stmt): Likewise. - (expand_body): Likewise. - (begin_stmt_tree): Likewise. - (finish_stmt_tree): Likewise. - (expanding_p): New variable. - (last_expr_type): Likewise. - (building_stmt_tree): New macro. - * decl.c (start_function): Use building_stmt_tree, not - processing_template_decl, where appropriate. - (store_parm_decls): Likewise. - (store_return_init): Move most of the body to semantics.c. - (finish_function): Use building_stmt_tree. - (finish_stmt): Clear last_expr_type here. - (cp_function): Add expanding_p, last_tree, last_expr_type. - (push_cp_function_context): Save them. - (pop_cp_function_context): Restore them. - * decl2.c (setup_vtbl_ptr): Move to semantics.c. - * error.c (dump_expr): Handle STMT_EXPR. - * except.c (expand_start_catch_block): Use building_stmt_tree. - Use add_decl_stmt. - * expr.c (cplus_expand_expr): Handle STMT_EXPR. - (do_case): Move add_tree call to semantics.c. - * parse.y (return_init): Use finish_named_return_value. - (for.init.statement): Use finish_expr_stmt. - * parse.c: Regenerated. - * pt.c (do_pushlevel): Move to semantics.c. - (do_poplevel): Likewise. - (tsubst_copy): Handle STMT_EXPR instead of BIND_EXPR. - (tsubst_expr): Don't expand all the way to RTL here. Handle - RETURN_INIT and CTOR_INITIALIZER. - (instantiate_decl): Call expand_body after tsubst'ing into - DECL_SAVED_TREE. - * semantics.c (expand_stmts): New function. - (expanding_p): New variable. - (last_expr_type): Likewise. - (finish_expr_stmt): Use building_stmt_tree. - (begin_if_stmt): Likewise. - (finish_if_stmt_cond): Likewise. - (finish_then_clause): Likewise. - (begin_else_clause): Likewise. - (finish_else_clause): Likewise. - (begin_while_stmt): Likewise. - (finish_while_stmt_cond): Likewise. - (finish_while_stmt): Likewise. - (finish_do_body): Likewise. - (finish_do_stmt): Likewise. - (finish_return_stmt): Likewise. - (begin_for_stmt): Likewise. - (fnish_for_init_stmt): Likewise. - (finish_for_cond): Likewise. - (finish_for_expr): Likewise. - (finish_for_stmt): Likewise. - (finish_break_stmt): Likewise. - (finish_continue_stmt): Likewise. - (finish_switch_cond): Likewise. - (finish_switch_stmt): Likewise. - (finish_case_label): Call add_tree here if necessary. - (finish_goto_statement): Use building_stmt_tree. - (begin_try_block): Likewise. - (begin_function_try_block): Likewise. - (finish_try_block): Likewise. - (finish_function_try_block): Likewise. - (finish_handler_sequence): Likewise. - (finish_function_handler_sequence): Likewise. - (begin_handler): Likewise. - (finish_handler_parms): Likewise. - (finish_handler): Likewise. - (begin_compound_stmt): Likewise. - (finish_compound_stmt): Likewise. - (finish_asm_stmt): Likewise. - (finish_label_stmt): Likewise. - (finish_named_return_value): New function. - (setup_vtbl_ptr): Moved here from decl2.c. - (do_pushlevel): Moved here from pt.c. - (do_poplevel): Likewise. - (begin_stmt_expr): Use building_stmt_tree. - (finish_stmt_expr): Likewise. Build a STMT_EXPR, not a BIND_EXPR, - when building_stmt_tree. - (begin_stmt_tree): New function. - (finish_stmt_tree): Likewise. - (expand_stmt): Likewise. - (expand_body): Likewise. - * tree.c (build_cplus_method_type): Make sure the argument types - end up on the same obstack as the METHOD_TYPE. - (search_tree): Handle COMPOUND_EXPR, MODIFY_EXPR, - THROW_EXPR, STMT_EXPR. - (mapcar): Break out common cases. Handle COMPOUND_EXPR, - MODIFY_EXPR, THROW_EXPR, STMT_EXPR, RTL_EXPR. Abort, rather than - sorry, if an unsupported node is encountered. - * typeck.c (require_complete_type_in_void): Handle BIND_EXPR. - (c_expand_return): Don't call add_tree here. - -1999-08-15 Mark Mitchell - - * pt.c (check_default_tmpl_args): Don't check in local scopes. - (tsubst_decl): Make sure the declaration is on a saveable - obstack. Clear DECL_DEAD_FOR_LOCAL when making a copy of a local - variable. - (tsubst_expr): Adjust now that DECL_STMTs really contain DECLs. - -1999-08-14 Jason Merrill - - Speed up Koenig lookup. - * decl.c (unqualified_namespace_lookup): Nonstatic. Add spacep parm - to return namespaces we've looked at. - * decl2.c (lookup_using_namespace): Likewise. - (add_function): Don't call ovl_member. - (lookup_arg_dependent): Initialize k.namespaces to the list of - namespaces seen in unqualified lookup. - * call.c (equal_functions): Move here from tree.c. - (joust): Use it to handle duplicate candidates. - * tree.c (ovl_member): Use ==. - -1999-08-13 Mark Mitchell - - * cp-tree.def (DECL_STMT): Make it smaller. - * cp-tree.h (lang_decl_flags): Move saved_tree to ... - (lang_decl): ... here. Add next. - (DECL_SAVED_TREE): Adjust accordingly. - (DECL_IMPLICIT_TYPEDEF_P): New macro. - (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. - (DECL_STMT_DECL): Likewise. - (create_implicit_typedef): New function. - (maybe_push_decl): Likewise. - (tsubst_default_argument): New function. - (at_function_scope_p): Likewise. - (add_decl_stmt): Likewise. - (push_permanent_obstack): Likewise. - * call.c (convert_default_arg): Use tsubst_default_argument. - * class.c (add_method): Use push_permanent_obstack. - (build_self_reference): Create a TEMPLATE_DECL for the - self-reference, if necessary. - * decl.c (pseudo_global_level_p): Only look at the current binding - level. - (push_binding): Use push_permanent_obstack. - (create_implicit_typedef): New function. - (pushtag): Use it. - (duplicate_decls): Use push_permanent_obstack. - (maybe_push_decl): New function. - (start_decl): Use it. Remove dead code. Use add_decl_stmt. - (start_decl_1): Remove dead code. - (cp_finish_decl): Remove DECL_STMT handling here. Don't use - pseudo_global_level_p. - (grokvardecl): Create DECL_LANG_SPECIFIC for a VAR_DECL in a - template. - (grokdeclarator): Likewise, for TYPE_DECLs. Don't use - pseudo_global_level_p. - * decl2.c (grokfield): Call push_template_decl for a TYPE_DECL in - a template. - (get_sentry): Use push_permanent_obstack. - * dump.c (dequeue_and_dump): Enable DECL_STMT. - * except.c (call_eh_info): Use push_permanent_obstack. - (build_eh_type_ref): Likewise. - (do_pop_exception): Likewise. - (expand_eh_spec): Likewise. - (alloc_eh_object): Likewise. - (expand_throw): Likewise. - * init.c (build_java_class_ref): Likewise. - * lex.c (get_time_identifier): Likewise. - (free_lang_decl_chain): Correct type. - (retrofit_lang_decl): Adjust accordingly. - (build_lang_field_decl): Likewise. - * lex.h (free_lang_decl_chain): Likewise. - * parse.y (lang_extdef): Don't use pseudo_global_level_p. - * parse.c: Regenerated. - * pt.c (tsubst_default_arguments): New function. - (retrieve_local_specialization): Likewise. - (register_local_specialization): Likewise. - (push_template_decl_real): Use DECL_IMPLICIT_TYPEDEF_P. Just use - pseudo_global_level_p to determine whether or not a template is - primary. - (lookup_template_class): Likewise. Use create_implicit_typedef. - (instantiate_class_template): Call tsubst_default_arguments for - member functions, if appropriate. - (tsubst_default_argument): New function. - (tsubst_decl): Use it. Change TYPE_DECL handling to match VAR_DECLs. - * search.c (at_function_scope_p): New function. - * semantics.c (finish_asm_stmt): Use push_permanent_obstack. - (finish_label_stmt): Likewise. - (add_decl_stmt): New function. - (begin_class_definition): Likewise. - (finish_typeof): Likewise. - * tree.c (copy_template_template_parm): Likewise. - (copy_to_permanent): Likewise. - (push_permanent_obstack): Define. - (mark_addressable): Use it. - * typeck.c (mark_addressable): Likewise. - -1999-08-13 Gavin Romig-Koch - - * cp-tree.h (init_cplus_unsave): New. - (cplus_unsave_expr_now): New. - * lex.c (init_parse): Call init_cplus_unsave. - * tree.c (init_cplus_unsave): New. - (cplus_unsave_expr_now): New. - -1999-08-13 Mark Mitchell - - * pt.c (tsubst): Back out 1999-08-06 patch. Use fold and - decl_constant_value to simplify array bounds. - -1999-08-11 Jason Merrill - - * lang-options.h: Add -fms-extensions. - * cp-tree.h: Declare flag_ms_extensions. - * decl2.c: Define it. - * class.c (instantiate_type): Don't complain about taking the address - of a bound member function if -fms-extensions. - * typeck.c (build_unary_op): Likewise. - * decl.c (grokdeclarator): Or about implicit int. - * init.c (resolve_offset_ref): Or about implicit '&'. - -1999-08-11 Mark Mitchell - - * cp-tree.h (minimal_parse_mode): Remove. - (finish_label_stmt): New function. - * decl.c (saved_scope): Remove minimal parse mode. - (maybe_push_to_top_level): Don't save it. - (pop_from_top_level): Don't restore it. - (define_label): Split out template-handling code to semantics.c. - (start_decl): Don't use minimal_parse_mode. - (cp_finish_decl): Likewise. - (start_function): Don't increment it. - (store_return_init): Don't use it. - (finish_function): Don't decrement it. - * parse.y (label_colon): Use finish_label_stmt throughout. - * parse.c: Regenerated. - * pt.c (minimal_parse_mode): Don't define it. - (tsubst_expr): Use finish_label_stmt. - * semantics.c (finish_label_stmt): New function. - - * dump.c (queue): Be careful when computing bitmasks. - (dequeue_and_dump): Describe binfos as binfos, not as - vectors. - - * parse.y (pedantic): Give it itype. Adjust usage accordingly - throughout. - * parse.c: Regenerated. - - * Make-lang.in (CXX_SRCS): Remove sig.c. - * Makefile.in (CXX_OBJS): Remove sig.o. - (sig.o): Remove. - * cp-tree.h (CPTI_OPAQUE_TYPE): Remove. - (CPTI_SIGNATURE_TYPE): Likewise. - (CPTI_SIGTABLE_ENTRY_TYPE): Likewise. - (opaque_type_node): Likewise. - (signature_type_node): Likewise. - (sigtable_entry_type): Likewise. - (flag_handle_signatures): Likewise. - (lang_type): Remove is_signature, is_signature_pointer, - is_signature_reference, has_opaque_typedecls, - sigtables_has_been_generated. Adjust dummy. Remove signature, - signature_pointer_to, signature_reference_to. - (IS_SIGNATURE): Remove. - (SET_SIGNATURE): Remove. - (CLEAR_SIGNATURE): Remove. - (IS_SIGNATURE_POINTER): Remove. - (IS_SIGNATURE_REFERENCE): Remove. - (SIGNATURE_HAS_OPAQUE_TYPEDECLS): Remove. - (SIGTABLE_HAS_BEEN_GENERATED): Remove. - (CLASSTYPE_SIGNATURE): Remove. - (SIGNATURE_TYPE): Remove. - (SIGNATURE_METHOD_VEC): Remove. - (SIGNATURE_POINTER_TO): Remove. - (SIGNATURE_REFERENCE_TO): Remove. - (lang_decl_flags): Remove is_default_implementation. Rename - memfunc_pointer_to to saved_tree. - (IS_DEFAULT_IMPLEMENTATION): Remove. - (DECL_MEMFUNC_POINTER_TO): Remove. - (DECL_MEMFUNC_POINTING_TO): Remove. - (DECL_SAVED_TREE): Adjust definition. - (tag_types): Remove signature_type_node. - (SIGNATURE_FIELD_NAME): Remove. - (SIGNATURE_FIELD_NAME_FORMAT): Likewise. - (SIGNATURE_OPTR_NAME): Likewise. - (SIGNATURE_SPTR_NAME): Likewise. - (SIGNATURE_POINTER_NAME): Likewise. - (SIGNATURE_POINTER_NAME_FORMAT): Likewise. - (SIGNATURE_REFERENCE_NAME): Likewise. - (SIGNATURE_REFERNECE_NAME_FORMAT): Likewise. - (SIGTABLE_PTR_TYPE): Likewise. - (SIGTABLE_NAME_FORMAT): Likewise. - (SIGTABLE_NAME_FORMAT_LONG): Likewise. - (SIGTABLE_TAG_NAME): Likewise. - (SIGTABLE_VB_OFF_NAME): Likewise. - (SIGTABLE_VT_OFF_NAME): Likewise. - (finish_base_specifiers): Change prototype. - (build_signature_pointer_type): Remove. - (build_signature_reference_type): Remove. - (build_signature_pointer_constructor): Remove. - (build_signature_method_call): Remove. - (build_optr_ref): Likewise. - (append_signature_fields): Likewise. - (signature_error): Likewise. - * call.c (build_this): Remove signature support. - (build_over_call): Likewise. - (build_new_method_call): Likewise. - * class.c (add_implicitly_declared_members): Likewise. - (finish_struct_1): Likewise. - (finish_struct): Likewise. - * cvt.c (cp_convert_to_pointer): Likewise. - (convert_to_pointer_force): Likewise. - (ocp_convert): Likewise. - * decl.c (sigtable_decl_p): Remove. - (init_decl_processing): Remove support for signatures. - (cp_finish_decl): Likewise. - (grokdeclarator): Likewise. - (grokparms): Likewise. - (xref_tag): Likewise. - (start_function): Likewise. - (start_method): Likewise. - * decl2.c (finish_sigtable_vardecl): Remove. - (flag_handle_signatures): Remove. - (lang_f_options): Remove handle-signatures. - (grokfield): Remove support for signatures. - (grokbitfield): Likewise. - (finish_file): Likewise. - (reparse_absdcl_as_casts): Likewise. - * error.c (dump_type_real): Likewise. - (dump_function_decl): Likewise. - * friend.c (make_friend_class): Likewise. - * gxx.gperf: Remove __signature__, signature, __sigof__, sigof. - * hash.h: Regenerated. - * init.c (build_new_1): Remove support for signatures. - * lang-options.h: Remove -fhandle-signatures, - -fno-handle-signatures. - * lex.c (init_parse): Remove support for signatures. - (yyprint): Likewise. - * lex.h (rid): Remove RID_SIGNATURE. - * method.c (build_decl_overload_real): Remove support for - signatures. - (hack_identifier): Likewise. - * parse.y (base_class): Likewise. - (base_class.1): Likewise. - (access_specifier): Likewise. - * search.c (lookup_member): Likewise. - * semantics.c (finish_qualified_object_call_expr): Likewise. - (finish_template_type_parm): Likewise. - (begin_class_definition): Likewise. - (finish_base_specifier): Likewise. - * sig.c: Remove. - * tree.c (build_cplus_method_type): Remove support for signatures. - * typeck.c (require_complete_type): Likewise. - (c_sizeof): Likewise. - (c_alignof): Likewise. - (build_object_ref): Likewise. - (build_component_ref): Likewise. - (build_indirect_ref): Likewise. - (build_c_cast): Likewise. - (build_modify_expr): Likewise. - (convert_for_initialization): Likewise. - * typeck2.c (signature_error): Remove. - (store_init_value): Remove support for signatures. - (digest_init): Likewise. - (build_x_arrow): Likewise. - (build_functional_cast): Likewise. - * xref.c (GNU_xref_decl): Likewise. - -1999-08-10 Martin v. Loewis - - * lex.c (do_identifier): Remove unnecessary lookup of class field. - -1999-08-09 Martin v. Loewis - - * decl2.c (set_decl_namespace): Do not complain about non-matching - decls if processing a template. - -1999-08-09 Mark Mitchell - - * decl.c (build_ptrmemfunc_type): Handle qualified - pointer-to-member types here. - * tree.c (cp_build_qualified_type_real): Simplify handling here. - -1999-08-09 Kaveh R. Ghazi - - * lex.c (lang_identify): Likewise. - -1999-08-09 Bernd Schmidt - - * Makefile.in: Update dependencies. - * class.c (finish_struct_1): Don't initialize DECL_SAVED_INSNS with - NULL_RTX. - * decl.c: Include "function.h" - (cleanup_label, return_label): Delete declarations. - (store_parm_decls): Don't initialize DECL_SAVED_INSNS with NULL_RTX. - (finish_function): Rename last_parm_insn variable to - fn_last_parm_insn. Don't compare DECL_SAVED_INSNS to NULL_RTX. - * decl2.c: Include "function.h". - (rtl_expr_chain): Delete declaration. - * method.c: Include "function.h" - * tree.c (build_vbase_pointer_fields): Don't initialize - DECL_SAVED_INSNS with NULL_RTX. - * typeck.c: Include "function.h" - -1999-08-09 Jason Merrill - - * semantics.c (begin_function_try_block, finish_function_try_block, - finish_function_handler_sequence): New fns. - * parse.y (function_try_block): Use them. - * pt.c (instantiate_decl): Likewise. - - * cp-tree.h: Declare in_function_try_handler. - * decl.c: Define it. - (start_function): Clear it. - (struct cp_function, push_cp_function_context): Save it. - (pop_cp_function_context): Restore it. - * parse.y (function_try_block): Set and clear it. - * except.c (expand_end_catch_block): Rethrow if we reach the end - of a function-try-block handler in a ctor or dtor. - * typeck.c (c_expand_return): Complain about returning from a - function-try-block handler of a ctor. - - * parse.y (function_try_block): Call end_protect_partials - before expand_start_all_catch. - -1999-08-08 Jason Merrill - - * decl.c (struct binding_level): Add eh_region field. - (push_binding_level): Set it. - (define_label): Complain about jumping into an EH block. - - * ptree.c (print_lang_type): Print the real type of a PMF. - Print what exceptions a fn type throws. - -1999-08-07 Kaveh R. Ghazi - - * class.c (count_fields, add_fields_to_vec): Add static prototype. - - * cp-tree.h (opname_tab, assignop_tab, operator_name_string, - get_id_2, composite_pointer_type, dump_node_to_file): Constify a - char*. - - * decl.c (named_label_list, cp_finish_decl, grokdeclarator): - Constify a char*. - - * decl2.c (finish_static_data_member_decl, grokfield): Constify a - char*. - - * dump.c (queue_and_dump_index, dump_int, dump_string, - dump_string_field, dequeue_and_dump, dump_node_to_file): Constify - a char*. - (dump_stmt): Add static prototype. - - * errfn.c (cp_thing): Constify a char*. - - * error.c (dump_unary_op, dump_binary_op, aggr_variety, - dump_aggr_type, dump_global_iord, dump_decl, dump_function_name, - dump_expr): Constify a char*. - - * lex.c (extend_token_buffer_to, pragma_getc, pragma_ungetc, - read_line_number): Add static prototype. - (opname_tab, assignop_tab, operator_name_string): Constify a char*. - (real_yylex): Move label `letter' into the scope where it is used. - - * method.c (build_mangled_template_parm_index, build_overload_int, - build_decl_overload_real, get_id_2): Constify a char*. - - * search.c (check_final_overrider): Make static. - - * typeck.c (composite_pointer_type): Constify a char*. - -1999-08-06 Jason Merrill - - * pt.c (maybe_get_template_decl_from_type_decl): Make sure that - we're looking at a class. - - * decl.c (lookup_name_real): Set the complain flag if we're - looking for a namespace member. - - * lex.c (real_yylex): We can have a number with no digits. - - * cvt.c (cp_convert_to_pointer): Don't force pmf conversions. - - * search.c (binfo_from_vbase): New fn. - * cp-tree.h: Declare it. - * cvt.c (cp_convert_to_pointer): Use it to diagnose conversion - from pointer to member of virtual base. - * typeck.c (get_delta_difference): Likewise. - -1999-08-06 Alexandre Oliva - - * pt.c (tsubst): Use build_index_type to build in-template array - index type. Fixes g++.oliva/dwarf1.C. - * decl.c (grokdeclarator): Likewise, just for consistency, as it - doesn't seem to trigger the bug without it. - -1999-08-06 Jason Merrill - - * typeck2.c (add_exception_specifier): Use complete_type. - -1999-08-06 Mark Mitchell - - * error.c (dump_expr): Handle EXACT_DIV_EXPR. - (dump_binary_op): Bulletproof. - * lex.c (init_parse): Set opname_tab[EXACT_DIV_EXPR]. - * tree.c (search_tree): Don't enumerate all the nodes of classes - `1', `2', and `<'; handle them generically. Don't be sorry about - "unrecognized tree codes"; just abort. - (no_linkage_check): Don't do linkage checks for templates. - - * tree.c (cp_build_qualified_type_real): Handle - pointer-to-member-function types correctly. - -1999-08-05 Jason Merrill - - * decl.c (pushdecl): Only give an error for shadowing a parm - from *this* function. - -Thu Aug 5 02:40:42 1999 Jeffrey A Law (law@cygnus.com) - - * typeck2.c: Update URLs and mail addresses. - -1999-08-04 Nathan Sidwell - - * cp-tree.h (empty_except_spec): New global var. - (compexcepttypes): Remove prototype. - (comp_except_specs): Prototype new global function. - (add_exception_specifier): Prototype new global function. - * decl.c (empty_except_spec): Define new global var. - (duplicate_decls): Use comp_except_specs, reword error message. - (init_decl_processing): Initialize empty_except_spec. - Adjust build_exception_variant calls. - * parse.y (exception_specification_opt): Use empty_except_spec. - (ansi_raise_identifier): Call check_for_new_type. - (ansi_raise_identifiers): Use add_exception_specifier. - * pt.c (tsubst): Use add_exception_specifier to build exception - specifier. - * search.c (check_final_overrider): New static function, broken - out of get_matching_virtual. Check throw specifiers, reword - diagnostics. - (get_matching_virtual): Use check_final_overrider. - * tree.c (build_exception_variant): Use comp_except_specs. - * typeck.c (compexcepttypes): Remove. - (comp_except_types): New static function, helper for - comp_except_specs. Compare two types as exception specifiers. - (comp_except_specs): New global function, compare two exception - specifiers. - (comptypes): Adjust for comp_except_specs. - * typeck2.c (add_exception_specifier): New global function. - - * class.c (check_for_override): Reword error message. - -1999-08-03 Nathan Sidwell - - * call.c (convert_arg_to_ellipsis): Use pod_type_p. - * cp-tree.h (struct lang_type): Added non_pod_class flag. - (CLASSTYPE_NON_POD_P): New macro to access it. - * class.c (finish_struct_1): Determine non-PODness. - Check for arrays of pointers (-Weffc++). - Remove array inspection duplicated code. - * tree.c (pod_type_p): Detect non-pod non-aggregate types. - Use CLASSTYPE_NON_POD_P. - -1999-08-03 Nathan Sidwell - - * class.c (duplicate_tag_error): Preserve template information. - -1999-08-03 Nathan Sidwell - - * decl.c (start_enum): Show location of previous definition. - * parse.y (enumlist_opt): New reduction. - (structsp): Simplify enum rules to use enumlist_opt. - -1999-08-03 Jason Merrill - - * lex.c (yyprint): Handle PFUNCNAME. - - * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Only - build_expr_from_tree on the args of a TEMPLATE_ID_EXPR. - -1999-08-03 Mumit Khan - - * decl.c (start_decl): Set attributes before duplicate_decls call. - -1999-08-02 Mark Mitchell - - * Make-lang.in (CXX_SRCS): Add dump.c. - * Makefile.in (CXX_OBJS): Add dump.o. - (dump.o): New target. - * cp-tree.h (DECL_CONV_FN_P): Document. - (DECL_OVERLOADED_OPERATOR_P): New function. - (TYPE_PTRMEM_CLASS_TYPE): New macro. - (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. - (PTRMEM_CST_CLASS): Use TYPE_PTRMEM_CLASS_TYPE. - (ASM_VOLATILE_P): New macro. - (STMT_LINENO): Likewise. - (cp_namespace_decls): New function. - (dump_node_to_file): New function. - * decl.c (cp_namespace_decls): New function. - (walk_namespaces_r): Use it. - (wrapup_globals_for_namespace): Likewise. - * decl2.c (flag_dump_translation_unit): New variable. - (lang_decode_option): Handle -fdump-translation-unit. - (finish_file): If flag_dump_translation_unit is set, dump the - translation unit. - * dump.c: New file. - * lang-options.h: Add -fdump-translation-unit. - * pt.c (tsubst_template_parms): Robustify. - (tsubst_decl): Use DECL_OVERLOADED_OPERATOR_P. - (tsubst_expr): Use STMT_LINENO. - * semantics.c (finish_asm_stmt): Eliminate duplicate code. Check - for invalid cv-qualifiers even while building templates. - -1999-08-02 Richard Henderson - - * call.c: Include defaults.h instead of expr.h. - * decl.c: Likewise. - * pt.c: Likewise. - * typeck.c: Include defaults.h. - -1999-08-02 Mark Mitchell - - * lex.c (errorcount, sorrycount): Don't declare. - * repo.c (errorcount, sorrycount): Likewise. - * typeck2.c (errorcount, sorrycount): Likewise. - -1999-08-02 Jakub Jelinek - - * call.c (convert_default_arg, build_over_call): Change all uses of - PROMOTE_PROTOTYPES, so that it tests it as a C expression. - Ensure expr.h is included. - * decl.c (grokparams): Ditto. - * pt.c (tsubst_decl): Ditto. - * typeck.c (convert_arguments): Ditto. - -1999-08-02 Jason Merrill - - * class.c (mark_overriders): Fix order of args to overrides. - (warn_hidden): Likewise. Fix for having virtual and non-virtual - functions with the same name. - -1999-08-02 Richard Henderson - - * cp-tree.h (TYPE_PTRMEMFUNC_P): Check TYPE_LANG_SPECIFIC non-null. - -1999-08-01 Mark Mitchell - - * call.c (build_conditional_expr): Fix typo in comment. - -1999-08-01 Bernd Schmidt - - * decl.c (finish_stmt): Don't declare and test cond_stack, loop_stack, - case_stack; use in_control_zone_p. - * typeck.c (c_expand_return): Likewise. - -1999-07-31 Bernd Schmidt - - * except.c (catch_clauses): Delete declaration. - -1999-07-30 Mark Mitchell - - * call.c (build_conditional_expr): Call convert_from_reference to - avoid reference/non-reference type confusion. Fix typo. - -1999-07-30 Richard Henderson - - * typeck2.c (initializer_constant_valid_p): Moved to c-common.c. - * cp-tree.h (initializer_constant_valid_p): Remove. - -1999-07-28 Mark Mitchell - - * call.c (conditional_conversion): Don't build BASE_CONVs for - conversions between things that have the same type. - (build_conditional_expr): Tweak. - (convert_like): Some BASE_CONVs really do require the generation - of code. - - * init.c (perform_member_init): Don't go through build_modify_expr - for simple initializations. - -1999-07-27 Jason Merrill - - * cp-tree.h (DECL_VIRTUAL_CONTEXT): New macro. - * typeck.c (expand_ptrmemfunc_cst): Calculate delta correctly for - virtual functions and MI. Simplify. - - * method.c: Remove prototype for largest_union_member. - * pt.c (determine_specialization): Fix uninitialized warning. - * lex.c (real_yylex): Likewise. - -1999-07-27 Mark Mitchell - - * class.c (override_one_vtable): Adjust the use of BINFO_VIRTUALS - here too. - - * cp-tree.h (BINFO_VIRTUALS): Document new format. - * class.c (modify_one_vtable): Change prototype accordingly. - (modify_all_vtables): Likewise. - (modify_all_direct_vtables): Likewise. - (modify_all_indirect_vtables): Likewise. - (build_vtable_entry_for_fn): New function. - (set_rtti_entry): Simplify for new BINFO_VIRTUALS format. - (modify_vtable_entry): Likewise. - (add_virtual_function): Likewise. - (build_vtbl_initializer): New function. - (finish_vtbls): Simplify for new BINFO_VIRTUALS format. - (fixup_vtable_deltas1): Likewise. - (fixup_vtable_deltas): Likewise. - (override_one_vtable): Likewise. - (finish_struct_1): Likewise. - - * error.c (dump_expr): Likewise. - * search.c (get_abstract_virtuals_1): Likewise. - (get_abstract_virtuals): Likewise. - (expand_upcast_fixups): Likewise. - * tree.c (debug_binfo): Likewise. - * decl2.c (mark_vtable_entries): Don't bash abstract virtuals to - __pure_virtual here. - -1999-07-26 Mark Mitchell - - * tree.c (build_cplus_new): Adjust call to abstract_virtuals_error - as per 1999-07-26 change. - - * typeck.c (c_sizeof): Don't allow non-static data members. - (expr_sizeof): Likewise. - -1999-07-26 Jason Merrill - - * input.c (feed_input): Only touch lineno and input_filename - if !USE_CPPLIB. Save the old values before setting the new ones. - - * input.c (feed_input): Add file, line parms. - * lex.c (begin_definition_of_inclass_inline, feed_defarg): Adjust. - (real_yylex): Check linemode before input_redirected(). - - * typeck.c (c_expand_return): Downgrade pedwarn about returning NULL - from op new to warning. - -1999-07-26 Mark Mitchell - - * cp-tree.h (ncp_convert): Rename to perform_implicit_conversion. - * call.c: All uses changed. - * typeck.c: Likewise. - -1999-07-26 Nathan Sidwell - - * exception.cc (__cplus_type_matcher): Match __eh_matcher - prototype. - -1999-07-26 Mark Mitchell - - * cp-tree.h (CP_INTEGRAL_TYPE_P): New macro. - (ARITHMETIC_TYPE_P): Adjust definition for standard conformance. - (strip_top_quals): Declare. - (ncp_convert): Likewise. - (type_after_usual_arithmetic_conversions): Likewise. - (composite_pointer_type): Likewise. - * call.c (strip_top_quals): Don't make it static. - (promoted_arithmetic_type_p): New function. - (conditional_conversion): Likewise. - (null_ptr_cst_p): Allow `false' as a NULL pointer constant. - (standard_conversion): Use same_type_p. Don't build BASE_CONVs - for converting a type to itself. - (reference_binding): Honor LOOKUP_NO_TEMP_BIND. - (implicit_conversion): Make sure the from and to types are - complete. - (add_builtin_candidate): Correct handling of ?: operator. - (add_builtin_candidates): Improve documentation. - (build_conditional_expr): New function. - (can_convert): Implement in terms of can_convert_arg. - (ncp_convert): New function. - * typeck.c (type_after_usual_arithmetic_conversions): New - function, split out from common_type. - (composite_pointer_type): New function, split out from - build_conditional_expr. - (common_type): Use type_after_usual_arithmetic_conversions. - Remove redundant attribute merging. - (comptypes): Tidy. Handle COMPLEX_TYPE. - (build_binary_op_nodefault): Use null_ptr_cst_p. - (build_conditional_expr): Remove. - (convert_for_assignment): Use new conversion functions. - - * cp-tree.h (abstract_virtuals_error): Change declaration. - * typeck2.c (abstract_virtuals_error): Check to see if an error - occurred, and return a boolean value accordingly. - (build_functional_cast): Adjust accordingly. - * class.c (finish_struct_1): Likewise. - * cvt.c (ocp_convert): Likewise. - * decl.c (cp_finish_decl): Likewise. - (grokparams): Likewise. - (grok_op_properties): Likewise. - (start_function): Likewise. - * init.c (build_new_1): Likewise. - - * pt.c (unify): Don't get confused by pointers-to-member functions. - - * search.c (build_cplus_new): Robustify. - -1999-07-24 Richard Henderson - - * gxx.gperf (__builtin_va_arg): New. - * parse.y (VA_ARG): New token. - (unary_expr): Recognize it. - -Sun Jul 25 15:24:21 1999 Jeffrey A Law (law@cygnus.com) - - * g++FAQ.texi: Deleted per Joe Buck's request. - * Makefile.in: Corresponding changes. - -1999-07-23 Jason Merrill - - * lex.c: Sync with C frontend. - (whitespace_cr): New fn. - (skip_white_space): Use it. - (init_parse): Reorder. - (yyprint): Support CONSTANT. - (pragma_getc, pragma_ungetc): Bring back. - (read_line_number): Change in_system_header directly. - (handle_generic_pragma, handle_cp_pragma, yyerror): Move up in file. - (parse_float): Update to C version. - (yylex): Handle '$' under the letter case. - Remove looking_for_typename handling. - Support hex floating point constants. - Follow C's lead for choosing type of integer constants. - Rearrange stuff to match C frontend. - (yyungetc, reinit_parse_for_block, yylex): Support indent_level. - * spew.c (yylex): Clear looking_for_typename if we see a TYPESPEC. - -1999-07-23 Mark Mitchell - - * call.c (reference_binding): Tweak. - (mayble_handle_implicit_object): Use direct_reference_binding to - create the right implicit conversion sequence. - -1999-07-22 Mark Mitchell - - * pt.c (convert_nontype_argument): Don't call decl_constant_value - if we're converting to a reference type. - - * call.c (NEED_TEMPORARY_P): New macro. - (standard_conversion): Set it, for derived-to-base conversions. - (reference_related_p): New function. - (reference_compatible_p): Likewise. - (convert_class_to_reference): Likewise. - (direct_reference_binding): Likewise. - (reference_binding): Rework for standards-compliance. - (convert_like): Adjust accordingly. - (maybe_handle_ref_bind): Simplify; the right conversion sequences - are now built up in reference_binding. - (initialize_reference): New function. - * cp-tree.h (ICS_USER_FLAG): Document. - (ICS_THIS_FLAG): Likewise. - (ICS_BAD_FLAG): Likewise. - (NEED_TEMPORARY_P): Likewise. - (cp_lvalue_kind): New type. - (real_lvalue_p): Return it. - * error.c (dump_expr): Provide more accurate representation for - AGGR_INIT_EXPRs. - * init.c (expand_default_init): Do not try to perform implicit - conversions for a brace-enclosed initializer. - * search.c (lookup_conversions): Document. - * tree.c (lvalue_p_1): Return a cp_lvalue_kind. Calculate - appropriately. - (real_lvalue_p): Adjust accordingly. - (lvalue_p): Likewise. - (build_cplus_new): Don't allow the creation of an abstract class. - * typeck.c (convert_for_initialization): Use initialize_reference. - -1999-07-21 Gavin Romig-Koch - - * lex.c (real_yylex) : Correct the test for overflow when lexing - integer literals. - -1999-07-20 Jason Merrill - - * decl.c (warn_extern_redeclared_static): Check DECL_ARTIFICIAL, - not DECL_BUILT_IN, to determine if a function is internally declared. - (duplicate_decls): Likewise. Improve handling of builtins. - (push_overloaded_decl): Remove special handling of builtins. - - * cp-tree.h (ANON_AGGR_TYPE_P): Use CLASS_TYPE_P. - - * decl.c (grokdeclarator): Pull out decl_constant_value in - templates, too. - - * class.c (finish_struct, finish_struct_1): Remove 'warn_anon' parm. - * cp-tree.h, pt.c, semantics.c: Adjust. - * method.c (largest_union_member): Remove. - - * lang-specs.h (c++-cpp-output): Pass -fpreprocessed. - - * lex.c (token_getch, token_put_back): New fns. - (real_yylex): Use them. - - * lex.c (lang_init): Generalize. - (lang_init_options): Tell cpplib this is C++. - (nextchar): Remove. Replace uses with put_back. - (skip_white_space): Handle linemode here. Optimize for cpplib. - (extend_token_buffer_to): New fn. - (extend_token_buffer): Use it. - (read_line_number, check_newline): Just deal with tokens. - (real_yylex): More cpplib optimizations. Simplify. Don't produce - EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here. - * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING. - * parse.y (PAREN_STAR_PAREN): Remove. - * input.c: Don't use the putback machinery with cpplib. - (sub_getch): Fold back into getch. - (getch): Don't handle linemode here. - (feed_input): Unget any text in the token buffer. - - * lex.c (set_typedecl_interface_info, set_vardecl_interface_info, - nextyychar, nextyylval): Remove. - -1999-07-20 Michael Tiemann - Jason Merrill - - * lex.c (indent_level): New variable. - (init_parse): Set cpp_token to CPP_DIRECTIVE. - (consume_string): Make this smart about USE_CPPLIB. - (yyungetc): Use put_back function. - (pragma_getc, pragma_ungetc): Functions deleted. - (check_newline): Rewrite to be intelligent about USE_CPPLIB. - Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and - pragma_ungetc. - (real_yylex): Rewrite to be intelligent about USE_CPPLIB. - Also, clean up cases where we redundantly set token_buffer[0]. - (read_line_number): New fn. - * input.c (feed_input): Use integrated cpplib if USE_CPPLIB. - (end_input): Call cpp_pop_buffer if USE_CPPLIB. - (sub_getch): Conditionalize out code that's not appropriate if - USE_CPPLIB. - (put_back): Rewrite in case USE_CPPLIB is defined. - (input_redirected): Ditto. - -Tue Jul 20 11:24:19 1999 Bernd Schmidt - - * cp-tree.h: Delete lots of declarations of tree nodes; replaced by - c_global_trees and accessor macros defined in c-common.h. - (cp_tree_index): New enumeration. - (cp_global_trees): Declare new array. Add accessor macros for it, and - delete declarations of tree nodes replaced by it. - (builtin_function): Delete macro, add declaration for new function. - Include c-common.h. - * decl.c: Delete definitions for tree nodes that were replaced by - cp_global_trees and c_global_trees. - (init_decl_processing): Call c_common_nodes_and_builtins; delete code - to generate the common builtins here. - (builtin_function): New function. - * decl2.c (abort_fndecl): Delete declaration. - * except.c (expand_builtin_return_address): Delete declaration. - (builtin_return_address_fndecl): Delete variable. - (const_ptr_type_node): Delete declaration. - * lex.c (cons_up_default_function): Delete declaration of - void_list_node. - * parse.y (void_list_node): Delete declaration. - * rtti.c (type_info_type_node, tinfo_fn_id, tinfo_fn_type): - Delete variables. - (const_string_type_node): Delete declaration. - * search.c (abort_fndecl): Delete declaration. - * Makefile.in: Update dependencies. - -1999-07-19 Mark Mitchell - - * pt.c (check_default_tmpl_args): Move test for missing default - arguments here, from ... - (end_template_parm_list): Here. - -1999-07-18 Mark Mitchell - - * decl.c (lookup_nested_type): Remove. - (pushtag): Don't call it. - -Sat Jul 17 23:51:30 1999 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (INTERFACE): Bump to 2. - -1999-07-17 Alexandre Oliva - - * typeck2.c (my_friendly_abort): Updated URL with bug reporting - instructions to gcc.gnu.org. Removed e-mail address. - -1999-07-17 Mark Mitchell - - * pt.c (determine_specialization): Tighten error-checking. - (end_template_parm_list): Likewise. - -1999-07-14 Mark Mitchell - - * pt.c (check_default_tmpl_args): Handle friends defined in the - class just like member functions defined in the class. - -1999-07-09 Michael Tiemann - Jason Merrill - - * cp-tree.h (struct lang_decl): Added field for storing sorted - FIELD_DECLs (used in TYPE_DECLs). - (DECL_PENDING_INLINE_INFO): Adjusted to use 'u' union. - (DECL_SORTED_FIELDS): New macro. - * class.c (method_name_cmp): New function. - (finish_struct_methods): Modified to support sorting and searching - methods. - (finish_struct_anon): Changed code in inner loop to use ELT rather - than UELT (which required an extra indirection for every reference). - (field_decl_cmp): New function to support sorting FIELD_DECLs. - (finish_struct_1): Sort fields. - * search.c (lookup_field_1): Use DECL_SORTED_FIELDS if we have them. - (lookup_fnfields_1): Search sorted methods in METHOD_VEC. - Also, switch to using array indexing rather than a changing pointer. - * ptree.c (print_lang_decl): Handle TYPE_DECLs that have - DECL_SORTED_FIELDS. - -1999-07-09 Jason Merrill - - * decl2.c (reparse_absdcl_as_casts): Don't warn about old-style - casts in system headers or extern "C" blocks. - - * pt.c (do_decl_instantiation): Downgrade duplicate instantiation - errors to pedwarn. - -1999-07-09 Michael Tiemann - - * decl2.c (write_virtuals): Deleted declaration. - * cp-tree.h (write_virtuals): Deleted extern declaration. - * class.c (finish_struct_1): Removed #if 0'd code that mentions - write_virtuals. - * semantics.c (begin_class_definition): Rewrite code to not depend - on write_virtuals. - - * lex.c (cp_pragma_interface): New function. - (cp_pragma_implementation): Likewise. - (handle_cp_pragma): Call them. - - * typeck.c (comptypes): Simplify C code in look_hard. - - * xref.c (PALLOC): Use xcalloc, not calloc. - (SALLOC): Use xmalloc, not malloc. - - * rtti.c (synthesize_tinfo_fn): Add missing call to pop_momentary. - - * search.c (note_debug_info_needed): Don't search if WRITE_SYMBOLS - is NO_DEBUG. - - * decl.c (duplicate_decls): If a redeclaration doesn't match the - initial declaration, then don't save the inline info and by all - means don't mark the function as a builtin function. - - * decl.c (lookup_name_real): Set NONCLASS to 1 if - CURRENT_CLASS_TYPE is 0. - - * class.c (duplicate_tag_error): Set TYPE_NONCOPIED_PARTS to - NULL_TREE. - - * ptree.c (print_lang_type): Added vtable-needs-writing. - -Wed Jul 7 01:26:47 1999 Alexandre Oliva - - * decl2.c (mark_vtable_entries): Fix check for rtti offset. - -1999-07-06 Gavin Romig-Koch - - * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : - Merged into c-common. - -1999-07-05 Dave Brolley - - * lex.c (errorcount): Declare it. - (finish_parse): Update errorcount for when using CPPLIB. - -1999-07-05 Mark Mitchell - - * cp-tree.h (IS_AGGR_TYPE): Include instantiated template template - parameters. - (IMPLICIT_TYPENAME_TYPE_DECL_P): New macro. - * decl.c (push_class_binding): Use it. - (lookup_name_real): Likewise. - -1999-07-02 Gavin Romig-Koch - - * cp-tree.h (widest_integer_literal_type_node, - widest_unsigned_literal_type) : New. - * decl.c (widest_integer_literal_type_node, - widest_unsigned_literal_type) : New. - (init_decl_processing): Handle/use the two new types. - * lex.c (real_yylex): Same. - * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : - Same. - -1999-07-01 Mark Mitchell - - * decl.c (grokdeclarator): Don't give names "for linkage purposes" - to anonymous cv-qualified types. - -1999-07-01 Gavin Romig-Koch - - * lex.c (real_yylex) : Change integer literal overflow handling to - be like c-lex.c. - - * lex.c (real_yylex): Improve 'integer constant out of range' messages. - -1999-06-28 Richard Henderson - - * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. - -1999-06-28 Jason Merrill - - * error.c (dump_type_real): Handle TREE_LIST again. - - * typeck.c (comp_target_parms): Don't complain about - converting from () to (...) if !flag_strict_prototype. - - * decl.c (grokdeclarator): Update the names of all variants when - de-anonymizing. - -1999-06-21 Mark Mitchell - - * init.c (expand_aggr_vbase_init): Rename to - construct_virtual_bases. Conditionalize construction here, - rather than ... - (emit_base_init): Here. - -1999-06-19 Mark Mitchell - - * semantics.c (finish_asm_stmt): Apply decay conversions to - input operands. - - * decl.c (expand_static_init): When building an anonymous function - for use with atexit, compute its body before and after entering - the function. - - * error.c (dump_expr): Handle BIND_EXPR, LOOP_EXPR, and - EXIT_EXPR. - -1999-06-18 Mark Mitchell - - * init.c (expand_aggr_vbase_init): Add flag parameter. - (build_partial_cleanup_for): Remove, inlining into .. - (expand_cleanup_for_base): ... here. Take flag parameter. - (emit_base_init): Pass the in_chrg parameter to - emit_aggr_vbase_init. - (emit_aggr_vbase_init): Pass it to expand_cleanup_for_base. - -1999-06-16 Mark Mitchell - - * decl2.c (import_export_decl): Use same_type_p, rather than - relying on pointer-equality for types. - - * method.c (do_build_copy_constructor): Simplify. - - * call.c (build_method_call): Remove bogus code for two-argument - delete. - * init.c (build_new_1): Expand on comment, and remove dead code. - - * init.c (expand_cleanup_for_base): New function, split out - from ... - (emit_base_init): Here. - (expand_aggr_vbase_init): Use it. - -1999-06-15 Mark Mitchell - - * cp-tree.h (class_cache_firstobj): Declare. - (maybe_push_cache_obstack): Rename to push_cache_obstack. - * class.c (permanent_obstack): Remove declaration. - (class_cache_firstobj): Make it global. - (add_method): Don't use permanent_obstack directly. - (pushclass): Only free the class_cache_obstack if we know how far - back to free it. - (maybe_push_cache_obstack): Rename to push_cache_obstack. - * decl.c: Remove dead comment. - (saved_scope): Add class_cache_firstobj. - (push_to_top_level): Save it. - (pop_from_top_level): Restore it. - (push_class_level_binding): Use push_cache_obstack, not - maybe_push_cache_obstack. - * search.c (push_class_decls): Likewise. - -1999-06-14 Martin von Löwis - - * pt.c (tsubst_friend_function): Push into namespace of friend - function before pushdecl'ing it. - -1999-06-14 Nathan Sidwell - - * call.c (build_new_op): Remove REF_BIND from all operands. - -1999-06-13 Alexandre Oliva - - * init.c (build_new_1): Look up operator delete even if there was - no explicit new placement. - -1999-06-08 Nathan Sidwell - - * except.c (complete_ptr_ref_or_void_ptr_p): New function, broken out - of ... - (build_throw): ... here. Call it. - (process_start_catch_block): Call it. - -1999-06-07 Mark Mitchell - - * search.c (convert_pointer_to_single_level): Reimplement without - using get_binfo. - -1999-06-06 Mark Mitchell - - * method.c (is_back_referenceable_type): Back-reference bools when - not squangling. - -1999-06-07 Dave Brolley - - * lex.c (real_yylex): Replace unused bytes from bad multibyte char. - * input.c (putback_buffer): New structure type. - (putback): Replaces putback_char member. - (putback): Replaces putback_char static variable. - (feed_input): Use putback. - (end_input): Use putback. - (sub_getch): Use putback. - (put_back): Use putback. - -1999-06-05 Mark Mitchell - - * decl.c (grokdeclarator): Fix typo in last change. - -1999-06-04 Jason Merrill - - * semantics.c (finish_if_stmt_cond): Copy cond to permanent_obstack. - (finish_while_stmt_cond, finish_do_stmt, finish_for_cond): Likewise. - -1999-06-04 Nathan Sidwell - - * except.c (build_throw): Check throw expression validity. - -1999-06-03 Mark Mitchell - - * decl.c (grokdeclarator): Don't treat arbitrary types as unsigned - just because flag_signed_bitfields is false. - -1999-06-03 Nathan Sidwell - - * semantics.c (begin_class_definition): Update the struct's - location here ... - * class.c (finish_struct): ... rather than here. - - * decl.c (make_typename_type): Don't rely on uninitialized - variable. - -1999-05-31 Kaveh R. Ghazi - - * Makefile.in (ALL_CFLAGS): Add '-W -Wall'. - -1999-05-31 Mark Mitchell - - * tree.c (build_cplus_array_type_1): Use push_obstacks_nochange - and friends rather than messing with current_obstack directly. - (cp_build_qualified_type_real): Rework ARRAY_TYPE - allocation to match practice throughout the rest of the - compiler. - -1999-05-30 Mark Mitchell - - * lex.c (make_lang_type): Create TYPE_BINFO for - TEMPLATE_TYPE_PARMs just like for non-template types. - - * decl.c (start_decl): Move checks on initialization to ... - (cp_finish_decl): Here. Tidy formatting slightly. - -1999-05-28 Mark Mitchell - - * decl.c (add_binding): Don't complain about a redeclaration of a - semantically identical typedef in a local scope. - -1999-05-28 Nathan Sidwell - - * decl.c (complete_array_type): Allocate off same obstack. Fix - DO_DEFAULT comment to match reality. - - * friend.c (make_friend_class): Fix diagnostic typo. - -1999-05-28 Mark Mitchell - - * decl.c (lookup_namespace_name): Handle getting a - TEMPLATE_ID_EXPR. - (expand_static_init): Don't call pushdecl for implicitly declared - `atexit' used to register destructors. - -1999-05-25 Mark Mitchell - - * class.c (finish_vtbls): Copy BINFO_VIRTUALs before using it to - initialize a vtable. - - * cp-tree.h (NAMESPACE_LEVEL): Reformat. - (lang_decl_flags): Document MEMFUNC_POINTER_TO. Save four bytes - by combining TEMPLATE_INFO and LEVEL into a single union. - (DECL_TEMPLATE_INFO): Reformat. - (DECL_SAVED_TREE): Document. - (DECL_TEMPLATE_INJECT): Remove. - * class.c (finish_struct): Remove code to deal with - DECL_TEMPLATE_INJECT. - - * decl.c (maybe_process_template_type_declaration): Handle all new - types in templates uniformly. - * method.c (bulid_overload_identifier): Use CP_DECL_CONTEXT, not - DECL_CONTEXT. - * pt.c (lookup_template_class): Inject template instantiations of - forward-declarations. - (instantiate_class_template): Remove code processing - DECL_TEMPLATE_INJECT. - - * pt.c (lookup_template_class): Tweak lookup to find member - templates. - - * pt.c (tsubst_expr, case ASM_STMT): Don't tsubst into - ASM_CV_QUAL. - * semantics.c (finish_asm_stmt): Make strings permanent if they're - used in a template. - -1999-05-25 Jason Merrill - - * typeck.c (casts_away_constness, casts_away_constness_r): Strip both - parts of pointer to data member types. - -1999-05-24 Mark Mitchell - - * decl2.c (mark_vtable_entries): Don't make a copy of a function, - and then make it look like `abort'. Just use `abort' instead. - - * typeck.c (build_static_cast): Don't allow static_casts that cast - away constness. - (casts_away_constness_r): New function. - (casts_away_constness): Likewise. - - * decl.c (lookup_tag): Remove code no longer needed after - name-lookup improvements. - * decl2.c (handle_class_head): Make error-recovery more robust. - * friend.c (make_friend_class): Reject templated typename types. - * lex.c (is_global): A template parameter isn't global. - * parse.y (class_head): Robustify. - * parse.c: Regenerated. - -1999-05-22 Mark Mitchell - - * pt.c (for_each_template_parm): Walk into TYPENAME_TYPEs, - INDIRECT_REFs, and COMPONENT_REFs. Handle FIELD_DECLs. - - * cp-tree.h (push_nested_namespace): Declare. - (pop_nested_namespace): Likewise. - * decl.c (push_nested_namespace): New function. - (pop_nested_namespace): Likewise. - * pt.c (instantiate_class_template): Use them. - - * tree.c (mapcar): Handle NON_LVALUE_EXPR. - - * cp-tree.h (cplus_expand_constant): Declare. - * cvt.c (convert_to_pointer): Expand PTRMEM_CSTs when they're - converted from one pointer-to-object type to another. - * expr.c (cplus_expand_constant): Don't make it static. - * typeck.c (build_component_ref): Don't crash when presented with - a component which is a TEMPLATE_DECL. - (build_ptrmemfunc): Tidy. Clarify comment. Make sure that even a - cast from a pointer-to-member constant to its own type does not - result in a valid non-type template argument. - -1999-05-21 Mark Mitchell - Nathan Sidwell - - * Make-lang.in (cc1plus): Make it depend on gxx.gperf. - * cp-tree.h: Fix typo in documentation on pointers-to-members. - (cp_build_qualified_type): Make it a macro. - (cp_build_qualified_type_real): Declare. - * decl.c (grokdeclarator): Remove misleading comment. Avoid - problem with template parameters and restrict-qualification. - * gxx.gperf: Replace NORID with RID_UNUSED throughout. - * hash.h: Regenerated. - * lex.h (rid): Move RID_FIRST_MODIFIER and RID_LAST_MODIFIER into - the enumeration. - (NORID): Remove definition. - * pt.c (tsubst_aggr_type): Use cp_build_qualified_type_real. - (tsubst): Likewise. Remove special handling for FUNCTION_TYPEs. - (fn_type_unification): Check that the function type resulting from - the deduction is legal. - (check_cv_quals_for_unify): Don't handle FUNCTION_TYPEs specially. - (unify): Use cp_build_qualified_type_real. - * tree.c (build_cplus_array_type_1): Handle error_marks as inputs. - (cp_build_qualified_type): Rename to ... - (cp_build_qualified_type_real): Add additional COMPLAIN parameter - and modify appropriately. - - * typeck.c (build_ptrmemfunc): Handle PTRMEM_CSTs carefully to - reveal optimization opportunities. - - * pt.c (tsubst): Don't issue error messages when we're not - complaining, even if we see a qualified function type. - (check_cv_quals_for_unify): Don't allow a qualified function - type. - -1999-05-20 Jason Merrill - - * class.c (instantiate_type): Downgrade errors for object-dependent - memfn refs to pedwarn. - -1999-05-20 Mark Mitchell - - * decl.c (grokdeclarator): Don't treat [] as indicating a - zero-sized array in a typedef. - - * call.c (build_object_call): Don't look at DECL_NAME for a type. - (pt.c): Or CP_TYPE_QUALS for an ERROR_MARK. - (typeck.c): Or TYPE_MAIN_VARIANT for a type. - - * pt.c (for_each_template_parm): Rework to match documentation. - Don't be fooled by a COMPONENT_REF with no TREE_TYPE. - -1999-05-20 Jason Merrill - - * class.c (finish_struct_1): Still check for ANON_AGGR_TYPE_P. - - * class.c (finish_base_struct): Allow non-COM bases for COM classes - except at the leftmost position. - (modify_one_vtable, fixup_vtable_deltas1, override_one_vtable): - Pass the binfo's class, not the most derived, to skip_rtti_stuff. - * search.c (get_abstract_virtuals, expand_upcast_fixups): Likewise. - - * tree.c (lvalue_p_1): A NOP_EXPR can be an lvalue. - (build_cplus_new): Make sure that what we return is of the right type. - -1999-05-20 Mark Mitchell - - * cp-tree.h (make_ptrmem_cst): New function. - * expr.c (cplus_expand_constant): Split out from ... - (cplus_expand_expr): Here. Use cplus_expand_constant. - (init_cplus_expand): Set lang_expand_constant. - * pt.c (convert_nontype_argument): Use make_ptrmem_cst. - - * tree.c (make_ptrmem_cst): Define. - * typeck.c (unary_complex_lvalue): Use make_ptrmem_cst. - * typeck2.c (initializer_constant_valid_p): Use make_ptrmem_cst. - -1999-05-19 Mark Mitchell - - * pt.c (build_template_decl): Copy DECL_NONCONVERTING_P. - - * decl2.c (start_static_storage_duration_function): Fix comment. - (finish_file): Create static storage duration functions lazily. - -1999-05-19 Jason Merrill - - Implement anonymous structs. - * cp-tree.h (ANON_AGGR_TYPE_P): Rename from ANON_UNION_TYPE_P. - * class.c, decl.c, decl2.c, init.c, pt.c, search.c, typeck.c: Adjust. - * class.c (finish_struct_1): Remove redundant check for anon struct. - * decl.c (fixup_anonymous_aggr): Renamed from fixup_anonymous_union. - (check_tag_decl): Check for anonymous struct here. - * decl2.c (build_anon_union_vars): Catch anon struct at file scope. - * init.c (sort_member_init, emit_base_init): Handle getting fields - as well as names in current_member_init_list. - (perform_member_init): Handle getting an anon aggr. - * method.c (do_build_assign_ref): Don't descend into anon aggrs. - (do_build_copy_constructor): Likewise. - -1999-05-19 Mark Mitchell - - * tree.c (cp_build_qualified_type): Don't allow qualified function - types. - -Wed May 19 02:50:53 1999 Arvind Sankar - - * gxxint.texi: Fix typo. - -1999-05-19 Jason Merrill - - * call.c (find_scoped_type, resolve_scope_to_name): Lose. - * class.c (finish_struct_1): Use CLASS_TYPE_P. - * ptree.c (print_lang_type): Likewise. - * typeck.c (build_modify_expr, c_expand_asm_operands): Use - IS_AGGR_TYPE_CODE. - * typeck2.c (digest_init): Likewise. - -1999-05-18 Jason Merrill - - * call.c (joust): Compare the types of the conv ops, not the - target types of the conversions. - -Tue May 18 00:21:34 1999 Zack Weinberg - - * lang-specs.h: Define __GNUC__ and __GNUC_MINOR__ only if -no-gcc - was not given. - -1999-05-17 Mark Mitchell - - * cp-tree.def (TEMPLATE_ID_EXPR): Update documentation. - * decl.c (grokfndecl): Don't allow inline declarations of friend - template specializations, or friend template specializations with - default arguments. - * pt.c (tsubst): Handle substitution into array types that does - not yield a fixed upper bound, even when not processing a - template. - (tsubst_copy): Deal with the fact that the second operand to a - TEMPLATE_ID_EXPR may be NULL_TREE, a TREE_LIST, or a TREE_VEC. - * search.c (marked_pushdecls_p): Don't descend into - TEMPLATE_TYPE_PARMs and the like. - (unmarked_pushdecls_p): Likewise. - - * call.c (build_over_call): Don't throw away - initializations/copies of empty classes; use MODIFY_EXPR and - INIT_EXPR as for non-empty classes. - * class.c (finish_struct_1): Put the padding byte for an empty - class on the TYPE_NONCOPIED_PARTS list for the class. - -1999-05-16 Mark Mitchell - - * decl2.c (build_expr_from_tree): Handle COMPONENT_REFs that - indicate a reference to a field that is a qualified name. - -1999-05-16 Jason Merrill - - * decl2.c (finish_objects): Don't use .?tors.* if we don't have - ASM_OUTPUT_CONSTRUCTOR. - - * friend.c (do_friend): Add attrlist arg. Remove support for - getting a non-decl as 'decl'. - * decl.c (grokfndecl): Remove attrlist arg. Don't set attrs or - rtl. - (grokdeclarator): Adjust. - * cp-tree.h: Adjust. - -1999-05-16 Mark Mitchell - - * cp-tree.h (permanent_p): New function. - * init.c (build_new_1): Use mapcar, not copy_node, to copy a - possibly complex tree node. - * tree.c (mapcar): Adjust comments, and follow coding standards in - conditional. - (permanent_p): New function. - -1999-05-13 Per Bothner - - * class.c (push_lang_context): Turn off DECL_IGNORED_P for - primitive Java types, if we actually see `extern "Java"'. - -1999-05-10 18:21 -0400 Zack Weinberg - - * lang-specs.h: Pass -$ to the preprocessor. - -1999-05-10 Jason Merrill - - * init.c (build_offset_ref): Wrap baselinks in OFFSET_REF, too. - Don't bother wrapping an OFFSET_TYPE around unknown_type_node. - (resolve_offset_ref): Don't handle a raw baselink. - * cvt.c (build_expr_type_conversion): Likewise. - * typeck.c (decay_conversion, build_c_cast, convert_for_assignment, - convert_for_initialization): Likewise. - * class.c (instantiate_type): Handle seeing a baselink under an - OFFSET_REF. - * error.c (dump_expr): Likewise. - * pt.c (for_each_template_parm): Likewise. - (resolve_overloaded_unification): Likewise. - * tree.c (is_overloaded_fn, really_overloaded_fn): Likewise. - * typeck.c (expr_sizeof): Also complain about other permutations - of overloaded functions. - -1999-05-07 Jason Merrill - - * init.c (resolve_offset_ref): Don't return a raw method. - Use BASELINK_P. - * typeck.c (decay_conversion): Don't handle a raw method. - Resolve all OFFSET_REFs. - (get_member_function_from_ptrfunc): 0 is a valid vtable index. - (build_binary_op_nodefault): Handle resolving overloaded fns. Use - same_type_p for pmf bits. Don't use build_binary_op to compare - raw pointers to methods. - (convert_for_assignment): Check for OFFSET_REF, not OFFSET_TYPE, - to decide when to call resolve_offset_ref. - (build_c_cast, convert_for_initialization): Likewise. - * cvt.c (build_expr_type_conversion): Likewise. - -1999-05-06 Nathan Sidwell - - * call.c (build_new_method_call): Use TYPE_MAIN_VARIANT of class. - -1999-05-05 Mark Mitchell - - * decl2.c (start_objects): Don't let static constructors and - destructors get inlined. - - * parse.y (nested_name_specifier): Make sure ordinary types are - complete, just like template types. - * parse.c: Regenerated. - - * pt.c (check_explicit_specialization): Improve error messages. - -1999-05-04 Martin von Löwis - - * typeck.c (string_conv_p): Use same_type_p to check whether we - try to convert between char and wchar_t. - -1999-05-03 Mark Mitchell - - * search.c (lookup_field_r): Set the TREE_TYPE of an ambiguous - lookup to error_mark_node here. - (lookup_member): Revise documentation. Add comments. Don't set - the TREE_TYPE to error_mark_node here, and don't build up an extra - TREE_LIST for ambiguous lookups. - (setup_class_bindings): Adjust accordingly. - (push_class_decls): Revise out-of-date comments. - - * typeck.c (build_const_cast): Tighten checks for legality. - -1999-05-02 Martin von Löwis - - * init.c (build_member_call): Lookup names coming from - namespace-scoped LOOKUP_EXPR. - -1999-05-03 Jim Blandy - - * gxxint.texi: Add documentation for 'I'. - -1999-05-02 Martin von Löwis - - * tinfo.cc (operator==): Qualify type_info with std::. - -1999-05-02 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Remove comdat. Updated dummy. - (DECL_COMDAT): Remove definition. - -1999-05-01 Mark Mitchell - - * decl.c (wrapup_globals_for_namespace): Fix thinko in previous - change. - -1999-04-30 Mark Mitchell - - * class.c (build_vtable): Use build_lang_decl when building - vtables, not just build_decl. - (prepare_fresh_vtable): Likewise. - * decl.c (wrapup_globals_for_namespace): Mark vtables as - DECL_EXTERNAL when calling wrapup_global_declarations. - * decl2.c (priority_info_s): Add initializations_p and - destructions_p members. - (finish_vtable_vardecl): Use TREE_SYMBOL_REFERENCED, not TREE_USED, - when deciding what vtables to write out. - (ssdf_decls): New variable. - (ssdf_decls_used): Likewise. - (start_static_storage_duration_function): Deal with being called - multiple times. Avoid inlining this function. - (generate_inits_for_priority): Deal with reuse of priority map. - (get_priority_info): Clear initializations_p and destructions_p. - (do_static_initialization): Tweak comment. - (do_static_destruction): Likewise. Fix condition on sentries for - destruction. - (generate_ctor_or_dtor_function): Call all of the static storage - duration functions. - (generate_ctor_or_dtor_function_for_priority): Check - initializations_p and destructions_p to see what priorities need - initialization functions. - (finish_file): Rework to generate multiple static storage duration - functions, rather than just one. - - * typeck.c (build_const_cast): Tweak last change to handle - templates correctly. - - * typeck.c (build_const_cast): Disallow use of const_cast to - anything but a pointer or reference type. - -1999-04-30 Nathan Sidwell - - * decl.c (cp_finish_decl): Don't permit arrays of abstract or - signature type. - -1999-04-29 Mark Mitchell - - * decl2.c (do_static_destruction): Remove obsolete FIXME comment. - (finish_file): Indent comments properly. - -1999-04-29 Richard Henderson - - * decl2.c (do_static_initialization): Call do_pending_stack_adjust. - (do_static_destruction): Likewise. - -1999-04-29 Nathan Sidwell - - * cp-tree.h (TYPE_NOTHROW_P): New macro. - * decl2.c (delete_sanity): Warn on deleting void *. - * init.c (build_new_1): Use TYPE_NOTHROW_P. - * typeck.c (c_expand_return): cp_pedwarn on returning NULL from - throwing operator new. - -1999-04-28 Nathan Sidwell - - * cp-tree.h (build_component_addr): Remove prototype. - * typeck.c (build_component_addr): Make static. Remove MSG - argument. - (build_component_addr): Remove MSG parameter, clean up - comment. - (build_x_function_call): Use cp_error. - (build_unary_op): Adjust call of build_component_addr. - -1999-04-28 Mark Mitchell - - * pt.c (tsubst_friend_class): Check for NULL. - -Wed Apr 28 11:42:22 1999 Andreas Schwab - - * search.c (binfo_for_vtable): Initialize bfvi.var. - -1999-04-27 Nathan Sidwell - - * rtti.c (build_x_typeid): Check rtti is enabled. - -1999-04-26 Mark Mitchell - - * search.c (is_subobject_of_p): Make sure we're looking at the - right baseclasses. - -1999-04-26 Marc Espie - - * Make-lang.in (cplib2.ready): Don't depend on phony targets. - -1999-04-23 Mark Mitchell - - * decl2.c (finish_file): Tweak handling of extern inlines so that - they are not unnecessarily put out. - - * search.c (is_subobject_of_p): Handle TEMPLATE_TYPE_PARMs and - such as base classes. - -1999-04-22 Brendan Kehoe - - * tree.c (build_exception_variant): Fix typo: use the chain of U, - not trying V, while cycling through U. - -1999-04-22 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Remove returns_first_arg and - preserves_first_arg. Enlarge dummy accordingly. - (DECL_TINFO_FN_P): New macro. - (SET_DECL_TINFO_FN_P): Likeiwse. - (DECL_RETURNS_FIRST_ARG): Remove. - (DECL_PRESERVES_THIS): Likewise. - (DECL_INIT_PRIORITY): New macro. - (finish_struct_1): Change prototype. - (cat_namespace_levels): Remove prototype. - (vtable_decl_p): New prototype. - (vtype_decl_p): Likewise. - (sigtable_decl_p): Likewise. - (walk_globals_pred): New typedef. - (walk_globals_fn): Likewise. - (walk_globals): New prototype. - (walk_namespaces_fn): New typedef. - (walk_namespaces): New prototype. - (wrapup_globals_for_namespace): Likewise. - (walk_vtables): Remove prototype. - (walk_sigtables): Likewise. - (instantiate_pending_templates): New prototype. - * class.c (finish_struct_1): Don't return a value. - * decl.h (pending_statics): Remove declaration. - * decl.c (walk_namespaces_r): New function. - (walk_globals_r): Likewise. - (vtable_decl_p): Likewise. - (vtype_decl_p): Likewise. - (sigtable_decl_p): Likewise. - (walk_namespaces): Likewise. - (walk_globals_data): New type. - (walk_globals): New function. - (wrapup_globals_for_namespace): Likewise. - (expand_static_init): Remove assertion. Remove redundancy in - conditional. Don't put static data members in static_aggregates - Tidy. - (finish_function): Remove redundancy in conditional. Don't set - DECL_RETURNS_FIRST_ARG. - (cat_namespace_levels): Remove. - * decl2.c: Include splay-tree.h and varray.h. - (priority_info_s): New structure. - (finish_vtable_vardecl): Change prototype. Adjust for new calling - conventions. - (prune_vtable_vardecl): Likewise. - (finish_sigtable_vardecl): Likewise. - (setup_initp): Remove. - (do_dtors): Remove. - (do_ctors): Remove. - (start_static_storage_duration_function): New function. - (generate_inits_for_priority): Likewise. - (finish_static_storage_duration_function): Likewise. - (get_priority_info): Likewise. - (do_static_initialization): Likewise. - (do_static_destruction): Likewise. - (do_static_initialization_and_destruction): Likewise. - (generate_ctor_or_dtor_function): Likewise. - (generate_ctor_and_dtor_functions_for_priority): Likewise. - (pending_statics): Make it a varray. - (pending_statics_used): New variable. - (saved_inlines): Make it a varray. - (saved_inlines_used): New variable. - (finish_static_data_member): Change method of updating - pending_statics. - (mark_inline_for_output): Remove #if 0'd code. Change method of - updating saved_inlines. - (walk_vtables): Remove. - (walk_sigtables): Likewise. - (import_export_decl): Use DECL_TINFO_FN_P. - (pending_templates): Remove declaration. - (maybe_templates): Likewise. - (static_aggregates_initp): Likewise. - (setup_initp): Likewise. - (finish_objects): Simplify. - (INITIALIZE_P_IDENTIFIER): New macro. - (PRIORITY_IDENTIFIER): New macro. - (SSDF_IDENTIFIER): New macro. - (initialize_p_decl): New variable. - (priority_decl): Likewise. - (ssdf_decl): Likewise. - (priority_info_map): Likewise. - (finish_file): Recode output of static intializers and other - file-scope finalization tasks. - * error.c (OB_END_TEMPLATE_ID): New macro. - (dump_type_real): Use it. - (dump_decl): Likewise. - (dump_function_name): Likewise. - * lex.c (set_typedecl_interface_info): Adjust for new walk_globals - interface. - (check_newline): Use walk_globals, not walk_vtables. - * pt.c (pending_tempalte_expansions): Remove. - (set_vardecl_interface_info): Likewise. - (pending_templates): Make static. - (maybe_templates): Likewise. - (instantiate_class_template): Adjust call to finish_struct_1. - (instantiate_pending_templates): New function. - * rtti.c (get_tinfo_fn): Use SET_DECL_TINFO_FN_P. - * tree.c (static_aggregates_initp): Remove. - (cp_valid_lang_attribute): Don't use it; use DECL_INIT_PRIORITY - instead. - * Makefile.in (decl2.o): Depend on varray.h and splay-tree.h. - - * gxx.gperf (RETURN): Rename to RETURN_KEYWORD to avoid clashes - with the RTL code RETURN. - * hash.h: Regenerated. - * lex.c (reinit_parse_for_block): Use RETURN_KEYWORD. - * parse.y: Replace RETURN with RETURN_KEYWORD throughout. - * parse.c: Regenerated. - * pt.c: Include varray.h. Include rtl.h since varray.h requires - it. - (inline_parm_levels): New variable. - (inline_parm_levels_used): Likewise. - (maybe_begin_member_template_processing): Update them. - (maybe_end_member_template_processing): Use them, rather than - guessing how many levels to pop. - - * decl.c (make_typename_type): Tighten error-checking. - -1999-04-20 Mark Mitchell - - * cp-tree.h (build_binary_op): Remove unneeded parameter. - * class.c (build_vrable_entry_ref): Adjust call to - build_binary_op. - * decl.c (expand_static_init): Likewise. - (grokdeclarator): Likewise. - (finish_function): Likewise. - * decl2.c (delete_sanity): Likewise. - (do_dtors): Likewise. - (do_ctors): Likewise. - * error.c (dump_type_suffix): Likewise. - * expr.c (cplus_expand_expr): Likewise. - * init.c (resolve_offset_ref): Likewise. - (build_new): Likewise. - (build_new_1): Likewise. - (build_vec_delete_1): Likewise. - (expand_vec_init_catch_clause): Likewise. - (build_delete): Likewise. - * pt.c (tsubst): Likewise. - * rtti.c (synthesize_tinfo_fn): Likewise. - * search.c (expand_upcast_fixups): Likewise. - (expand_direct_vtbls_init): Likewise. - * typeck.c (get_member_function_from_ptrfunc): Likewise. - (build_binary_op_nodefault): Likewise. - (point_int_sum): Likewise. - (pointer_diff): Likewise. - (build_unary_op): Likewise. - (build_modify_expr): Likewise. - (get_delta_difference): Likewise. - (build_ptrmemfunc): Likewise. - (expand_ptrmemfunc_cst): Likewise. - -1999-04-20 Jason Merrill - - * decl.c (grokfndecl): Always call cplus_decl_attributes. - * decl2.c (grokfield): Pass attrlist to grokdeclarator. - -1999-04-19 Mark Mitchell - - * cp-tree.h (finish_static_data_member_decl): New function. - * decl2.c (finish_static_data_member_decl): Split out from ... - (grokfield): Here. - * pt.c (instantiate_class_template): Use it here instead of - trying to fake it. - (tsubst_decl): Don't set DECL_ASSEMBLER_NAME; - finish_static_data_member_decl will do that. Explicit set - DECL_EXTERNAL to match non-template processing. - -1999-04-18 Mark Mitchell - - * cp-tree.h (finish_class_definition): Add parameter. - * parse.y (structsp): Use it. Don't call pop_scope here. - * parse.c: Regenerated. - * semantics.c (finish_class_definition): Pop it here. - -1999-04-17 Mark Mitchell - - * decl.c (xref_tag): Revise handling of nested template - declarations. - * pt.c (check_explicit_specialization): Tweak handling of friend - templates in template classes. - (tsubst_friend_class): Handle friend declarations for nested - member template classes. - -1999-04-16 Mark Mitchell - - * class.c (finish_struct): Remove unused variable. - (pushclass): Likewise. - (invalidate_class_lookup_cache): Likewise. - * cp-tree.def (TYPENAME_TYPE): Improve documentation. - * decl.c (build_typename_type): Make sure TYPENAME_TYPE_FULLNAME - doesn't get obliterated. - (make_typename_type): Handle template classes correctly. - - * cp-tree.h (TREE_NONLOCAL_FLAG): Remove. - (storetags): Declare. - * class.c (finish_struct): Don't use TREE_NONLOCAL_FLAG. - (pushclass): Likewise. Use storetags to install tag declarations, - not pushtag. - (invalidate_class_lookup_cache): Don't use TREE_NONLOCAL_FLAG. - * decl.c (storetags): Make it global. - (push_class_binding): Set INHERITED_VALUE_BINDING_P for an - implicit typename declaration. - (pushtag): Tidy. Don't use TREE_NONLOCAL_FLAG. - * method.c (hack_identifier): Likewise. - * search.c (lookup_member): Likewise. - - * decl.c (warn_about_implicit_typename_lookup): New function. - (lookup_name_real): Use it. Rework handling of implicit typename - extension. - -1999-04-15 Mark Mitchell - - * cp-tree.h (lookup_nested_field): Remove. - * class.c (push_nested_class): Handle UNION_TYPEs. - (pop_nested_class): Likewise. - * decl.c (lookup_name_real): Don't call lookup_nested_field. - (start_decl): Use push_nested_class, not just pushclass. - (cp_finish_decl): Use pop_nested_class, not just popclass. - * search.c (lookup_nested_field): Remove. - - * cp-tree.h (lang_type): Add documentation. - * decl2.c (handle_class_head): Create template declarations here, - as appropriate. - * parse.y (class_head): Return whether or not we entered a new - scope, as well as the type named. - (named_class_head): Likewise. - (named_complex_class_head_sans_basetype): Likewise. - (structsp): Adjust accordingly. Pop scope when required. - * parse.c: Regenerated. - * pt.c (check_default_tmpl_args): Robustify. - (redeclare_class_template): Likewise. - (instantiate_class_template): An instantiation of an - anonymous union is itself an anonymous union. - * semantics.c (begin_class_definition): Don't create template - declarations here. - -1999-04-15 Jason Merrill - - * parse.y (after_type_declarator_intern): New nonterminal. - (after_type_declarator): Use it. - (direct_after_type_declarator): Likewise. Move above - nonnested_type to fix reduce/reduce conflict resolution. - (declmods): Reducing from just 'attributes' has EMPTY precedence. - * Makefile.in (CONFLICTS): Update. - - * decl.c (define_label): Downgrade error for jumping over a - non-POD decl to pedwarn. - -1999-04-14 Mark Mitchell - - * cp-tree.h (popclass): Change declaration. - (pop_nested_class): Likewise. - (poplevel_class): Remove declaration. - * call.c (convert_default_argument): Pass no arguments to - popclass. - * class.c (finish_struct_1): Likewise. - (finish_struct): Likewise. - (popclass): Remove argument. Simplify code accordingly. - (pop_nested_class): Likewise. - * decl.c (poplevel_class): Declare it here, and make it static. - (poplevel): Handle class scopes. - (poplevel_class): Don't take an rgument. Simplify. - (pop_everything): Pass no arguments to pop_nested_class. - (cp_finish_decl): Pass no arguments to popclass. - (grokdeclarator): Pass no arguments to pop_nested_class. - (finish_function): Likewise. - * decl2.c (grokfield): Likewise. - (pop_scope): Pass no arguments to popclass. - * lex.c (do_pending_defargs): Pass no arguments to pop_nested_class. - * pt.c (instantiate_class_template): Move call to pushclass, and - document. Pass no arguments to popclass. - (regenerate_decl_from_template): Likewise. - -1999-04-14 Jason Merrill - - * typeck.c (build_unary_op): Handle taking the address of a unique - bound non-static member function. - -1999-04-13 Martin von Loewis - - * lang-options.h (-Wdeprecated): New flag. - * decl2.c (warn_deprecated): New flag. - (lang_decode_option): Deprecated this-is-variable, - external-templates, alt-external-templates. - Support -Wdeprecated. - * errfn.c (cp_deprecated): New function. - -1999-04-13 Jason Merrill - - * decl2.c (setup_initp): Compare DECL_ASSEMBLER_NAME instead - of the decls themselves. - - * pt.c (tsubst_function_type): Copy attributes over. - - * tree.c (cp_valid_lang_attribute): New fn. Handle init_priority - and com_interface. - * cp-tree.h: Add prototype. - * decl.c (init_decl_processing): Set valid_lang_attribute. - -1999-04-13 Mark Mitchell - - * class.c (finish_struct_1): Look at the const-ness of the field's - type, not the TREE_READONLY-ness of the declaration. - * method.c (synthesize_method): Likewise. - * pt.c (tsubst_decl): Call c_apply_type_quals_to_decl when - creating new declarations. - -1999-04-13 Mike Stump - - * decl2.c (import_export_decl): Because vtables always reference - virtual functions, even if they are inlined, don't allow - -fno-implement-inlines to not emit them, instead, emit them with - the vtable. - * decl.c (start_function): Likewise. - -1999-04-12 Jason Merrill - - * cp-tree.h (struct lang_type): Add com_interface. - (CLASSTYPE_COM_INTERFACE): New macro. - * class.c (set_rtti_entry): COM interface classes have no RTTI - entries in their vtables; adjust. - (add_virtual_function, finish_base_struct, skip_rtti_stuff, - modify_one_vtable, fixup_vtable_deltas1, override_one_vtable, - finish_struct_1): Likewise. - * decl2.c (mark_vtable_entries): Likewise. - * rtti.c (build_headof, get_tinfo_fn_dynamic): Likewise. - * search.c (get_abstract_virtuals_1, get_abstract_virtuals, - expand_upcast_fixups): Likewise. - * tree.c (debug_binfo): Likewise. - - * cp-tree.h (COMPARE_NO_ATTRIBUTES): New macro. - * typeck.c (comptypes): If we get it, ignore attributes. - * class.c (instantiate_type): Use BASELINK_P. Change complain - parameter to flags; 2 means ignore attributes. - * call.c (build_op_delete_call): Pass it. - - * decl.c (xref_tag): Only complain once about using a typedef-name - with 'struct'. Downgrade to pedwarn. - - * decl.c (grokdeclarator): Allow [] syntax for zero-length array. - - * parse.y (absdcl_intern): New nonterminal. - (absdcl, direct_abstract_declarator): Use it. - - * pt.c (lookup_template_class): Look through implict typename. - -1999-04-11 Mark Mitchell - - * friend.c (add_friend): Deal gracefully with error_mark_node. - * method.c (build_overload_value): Handle pointers-to-members as - template parameters. - - * decl.c (push_binding): Fix typo in comment. - -1999-04-10 Mark Mitchell - - * error.c (dump_type_real): If a typename is a template-id, put - out the template arguments. - (dump_expr): Handle TEMPLATE_ID_EXPR. - * pt.c (lookup_template_class): Now that full arguments are - available everywhere, remove code that tried to guess them. - -1999-04-09 Mark Mitchell - - * decl.c (make_typename_type): Complain if we don't find a type - when trying to make a typename type for a non-template type. - -1999-04-09 Jason Merrill - - * decl.c (start_decl): Pass attributes to grokdeclarator. - (grokdeclarator): Handle attributes on constructor-syntax - initializers. - -1999-04-08 Mark Mitchell - - * error.c (dump_expr): Don't crash on INDIRECT_REFs whose operands - don't have types. - - * search.c (template_self_reference_p): Tweak. - -1999-04-07 Mark Mitchell - - * init.c (build_offset_ref): Don't build yet another weird data - structure to describe overloaded functions. - -1999-04-06 Mark Mitchell - - * cp-tree.h (BASELINK_P): New macro. - (SET_BASELINK_P): Likewise. - * init.c (build_member_call): Remove needless assignment in if - statement. - * search.c (lookup_field_r): Fix handling when we are looking - specifically for a type; these are not hidden by functions and - variables. - (lookup_member): Use SET_BASELINK_P. - * tree.c (is_overloaded_fn): Use BASELINK_P. - (really_overloaed_fn): Likewise. - (get_first_fn): Likewise. - -1999-04-05 Mark Mitchell - - * decl.c (lookup_name_current_level): Tweak, and improve - documentation. - - * class.c (maybe_fixup_vptrs): Remove declaration. - (build_class_init_list): Likewise. - * decl.c (pushdecl_class_level): Call check_template_shadow here - ... - (push_class_level_binding): ... not here. - * search.c (dfs_push_type_decls): Only avoid - template-self-reference TYPE_DECLs if they are from base classes. - -1999-04-04 Mark Mitchell - - * pt.c (check_template_shadow): Don't treat OVERLOADs as _DECL - nodes. Tidy. - -1999-04-03 Jason Merrill - - * class.c (maybe_fixup_vptrs, build_class_init_list): Lose. - (finish_struct_1): Don't call build_class_init_list. - -1999-04-02 Mark Mitchell - - * tinfo.h (__class_type_info): Fix illegal declaration. - - * cp-tree.def (TEMPLATE_ID_EXPR): Update comment. - * cp-tree.h (INHERITED_VALUE_BINDING_P): New macro. - (IDENTIFIER_CLASS_VALUE): Improve documentation. - (is_properly_derived_from): Declare. - (invalidate_class_lookup_cache): Likewise. - (maybe_maybe_note_name_used_in_class): Likewise. - (note_name_declared_in_class): Likewise. - (push_using_decl): Remove duplicate declaration. - (id_in_current_class): Remove declaration. - (push_class_binding): Change prototype. - (clear_identitifer_class_values): Declare. - * call.c (is_properly_derived_from): Make it global. - (build_new_function_call): Be careful about updating candidates. - (build_new_method_call): Handle COMPONENT_REFs. Don't crash when - asked to make illegal calls. - * class.c: Include splay-tree.h. - (class_stack_node): Add names_used slot. - (check_member_decl_is_same_in_complete_scope): Remove. - (add_method): Fix comment. Push the declaration into class - scope. - (finish_struct_1): When popping the class, pop the bindings too. - Remove check for data member/function member conflict. - (finish_struct): Remove calls to - check_member_decl_is_same_in_complete_scope. Change calls to - popclass. - (pushclass): Clear names_used in the class stack entry. - Use invalidate_class_lookup_cache to remove cached entries, rather - than magic values with popclass. Clear IDENTIFIER_CLASS_VALUE - before entering a new class. Remove dead code. Don't mess with - current_function_decl when pushing declarations. - (invalidate_class_lookup_cache): New function, split out from ... - (popclass): Here. Clean up names_used on our way out. - (instantiate_type): Adjust. - (build_self_reference): Don't push the declaration here. - (maybe_note_name_used_in_class): New function. - (note_name_declared_in_class): Likewise. - * decl.c (add_binding): Change prototype. - (find_class_binding_level): New function. - (innermost_nonclass_level): Likewise. - (current_binding_level): Update documentation. - (inner_binding_level): Remove. Replace with current_binding_level - throughout. - (push_binding_level): Remove special handling of - class_binding_level. - (pop_binding_level): Likewise. Use find_class_binding_level. - (suspend_binding_level): Likewise. - (global_bindings_p): Use innermost_nonclass_level. - (toplevel_bindings_p): Likewise. - (namespace_bindings_p): Likewise. - (pseudo_global_level_p): Likewise. - (push_binding): Clear INHERITED_VALUE_BINDING_P. - (add_binding): Check for illegal multiple declarations. Return a - value indicating whether or not the new binding was legal. - (push_local_binding): Skip over class binding levels. Check - return value from add_binding. - (push_class_binding): Set INHERITED_VALUE_BINDING_P. Call - note_name_declared_in_class. - (pushlevel_class): Remove "fake out the rest of the compiler" - code. - (poplevel_class): Reset IDENTIFIER_CLASS_VALUEs. - (clear_identifier_class_values): New function. - (pop_from_top_level): Use it. - (pop_everything): Tweak. - (maybe_process_template_type_declaration): Don't push the - declaration for the template here. - (pushtag): Don't push tag declarations into class scope here. - (pushdecl): Apply DeMorgan's law for readability. - (pushdecl_class_level): Remove special-case code for - TYPE_BEING_DEFINED. Handle OVERLOADs and anonymous unions. - (push_class_level_bindng): Deal with inherited bindings. - (lookup_name_real): Remove special-case code for - TYPE_BEING_DEFINED, and some implicit typename magic. - (grokdeclarator): Handle COMPONENT_REF for a template function. - (build_enumerator): Don't call pushdecl_class_level here. - (id_in_current_class): Remove. - * decl2.c (grokfield): Don't call pushdecl_class_level or - check_template_shadow. - * errfn.c (cp_file_of): Don't declare. - (cp_line_of): Likewise. - * error.c (dump_decl): Handle an OVERLOAD. - (cp_file_of): Likewise. - (cp_line_of): Likewise. - * init.c (build_member_call): Handle a COMPONENT_REF. - * lex.c (do_identifier): Call maybe_note_name_used_in_class, not - pushdecl_class_level. - * method.c (hack_identifier): Build COMPONENT_REFs for references - to member templates as well as member functions. Remove dead - code. - * parse.y (left_curly): Remove. - (nonnested_type): Call maybe_note_name_used_in_class, not - pushdecl_class_level. - * parse.c: Regenerated. - (nested_name_specifier_1): Likewise. - * pt.c (check_explicit_specialization): Adjust, for robustness. - (check_template_shadow): Handle OVERLOADs. - (build_template_decl): Set DECL_CONSTRUCTOR_P on the - TEMPLATE_DECL, if appropriate. - * search.c (envelope_add_decl): Remove. - (dfs_pushdecls): Likewise. - (dfs_compress_decls): Likewise. - (dfs_push_decls): New function. - (dfs_push_type_decls): Likewise. - (setup_class_bindings): Likewise. - (template_self_reference_p): Likewise. - (lookup_field_r): Use it. - (looup_member): Remove old comment. Deal with ambiguity. - (push_class_decls): Use dfs_push_decls and dfs_push_type_decls, - and remove envelope processing. - * semantics.c (begin_class_definition): Let pushclass push - declarations for base classes. - (finish_member_declaration): Push declarations into class scope. - * typeck.c (build_component_ref): Just put an OVERLOAD into the - COMPONENT_REF, not a TREE_LIST of an OVERLOAD. - (build_x_function_call): Deal with OVERLOAD. Handle template-ids. - * Makefile.in (class.o): Depend on splay-tree.h. - -Wed Mar 31 11:30:43 1999 Nathan Sidwell - - * cvt.c (convert_pointer_to_real): Use same_type_p. - * typeck.c (comp_target_types): Use same_type_p. - -1999-03-31 Jason Merrill - - * semantics.c (begin_inline_definitions, - finish_inline_definitions): Rename from finish_default_args and - begin_inline_definitions, respectively, to something that isn't a - total lie. :) - * parse.y (structsp): Adjust. - - * tree.c (hash_tree_cons): Remove obsolete via_* parms. - (list_hash_lookup): Likewise. - (hash_tree_chain): Adjust. - * pt.c (tsubst): Adjust. - (tsubst_arg_types): Use plain hash_tree_cons. - * cp-tree.h (hash_tree_cons_simple): Lose. - * parse.y (declmods, nonempty_cv_qualifiers): Use hash_tree_cons. - -Wed Mar 31 10:48:29 1999 Kaveh R. Ghazi - - * Makefile.in (hash.h): Generate using gperf language 'C', not - 'KR-C', so gperf uses the `const' keyword on strings. - - * gxx.gperf (resword): Const-ify a char*. - -1999-03-30 Jason Merrill - - * cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, - CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES, - CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH, - CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST, - CLASSTYPE_BINFO_AS_LIST): Remove cruft. - * class.c, lex.c, parse.y, ptree.c, search.c, semantics.c, - tree.c: Adjust. - -1999-03-29 Jason Merrill - - * decl2.c (lang_decode_option): Remove -Wsign-promo from -Wall. - -1999-03-28 Jason Merrill - - * pt.c (fn_type_unification): Ignore 'this' parm from conversion ops. - -1999-03-27 Mark Mitchell - - * cp-tree.h (add_friend): Declare. - (add_friends): Likewise. - * friend.c (add_friend): Make it global. Don't add to - DECL_BEFRIENDING_CLASSES if the befriending class is a template. - (add_friends): Make it global. - (make_friend_class): Don't add to DECL_BEFRIENDING_CLASSES if the - befriending class is a template. - * parse.y (component_decl_1): Fix typo in comment. - * parse.c: Regenerated. - * pt.c (instantiate_class_template): Use add_friend and - add_friends rather that duplicating some of their functionality - here. - -1999-03-27 Jason Merrill - - * call.c (build_field_call): Unify 'this' and non-'this' cases. - - * typeck.c (build_indirect_ref): Check for 'this' sooner. - -Fri Mar 26 10:20:34 1999 Kaveh R. Ghazi - - * call.c (op_error): Const-ify a char*. - (add_candidate, source_type, add_warning): Add static prototype. - (print_z_candidates): Const-ify a char*. - - * class.c (resolve_address_of_overloaded_function, - fixed_type_or_null, build_vtable_entry_ref): Add static prototype. - (get_vtable_name, finish_struct_1): Const-ify a char*. - - * cvt.c (convert_to_reference): Likewise. - - * decl.c (redeclaration_error_message, record_builtin_type, - record_unknown_type, member_function_or_else, bad_specifiers): - Likewise. - (find_binding, select_decl, unqualified_namespace_lookup, - lookup_flags, qualify_lookup, record_builtin_java_type, tag_name): - Add static prototype. - (warn_extern_redeclared_static, duplicate_decls, pushdecl, - implicitly_declare, record_builtin_java_type, define_function, - grok_op_properties, tag_name): Const-ify a char*. - - * cp-tree.h (FORMAT_VBASE_NAME): Allow parameter `BUF' to be const. - (define_function, finish_builtin_type): Const-ify a char*. - (cp_error, cp_error_at, cp_warning, cp_warning_at, cp_pedwarn, - cp_pedwarn_at, cp_compiler_error, cp_sprintf): Add prototype args. - (file_name_nondirectory): Const-ify a char*. - (init_filename_times): Don't prototype. - (compiler_error): Prototype. - (yyerror, init_repo): Const-ify a char*. - (build_srcloc): Don't prototype. - (build_x_indirect_ref, build_indirect_ref, build_component_addr): - Const-ify a char*. - (warn_for_assignment): Don't prototype. - (convert_for_initialization, readonly_error, check_for_new_type, - GNU_xref_begin, GNU_xref_file, GNU_xref_ref, GNU_xref_call): - Const-ify a char*. - - * decl2.c (acceptable_java_type, output_vtable_inherit, - setup_initp, start_objects, finish_objects, do_dtors, do_ctors, - merge_functions, decl_namespace, validate_nonmember_using_decl, - do_nonmember_using_decl): Add static prototype. - (lang_f_options): Const-ify a char*. - (finish_builtin_type): Likewise. - (add_function, arg_assoc_namespace, arg_assoc_class): Add static - prototype. - - * errfn.c: Include cp-tree.h. - (cp_thing): Add static prototype. - (compiler_error): Don't protoptype. - (cp_compiler_error): Cast `compiler_error' to `errorfn' before - passing it to `cp_thing'. - - * error.c (interesting_scope_p): Add static prototype. - - * except.c (build_eh_type_type, build_eh_type_type_ref): Const-ify - a char*. - - * init.c (compiler_error): Don't prototype. - (member_init_ok_or_else): Const-ify a char*. - (build_java_class_ref): Add static prototype. - - * lex.c (compiler_error): Don't prototype. - (get_time_identifier, interface_strcmp, extend_token_buffer, - handle_cp_pragma): Const-ify a char*. - (is_global, init_filename_times): Add static prototype. - (file_name_nondirectory, cplus_tree_code_name): Const-ify a char*. - (compiler_error): Change from fixed args to variable args. - (yyerror): Const-ify a char*. - - * parse.y (cond_stmt_keyword): Const-ify a char*. - (parse_decl): Add static prototype. - - * pt.c (template_args_equal, print_template_context): Likewise. - (print_candidates, check_default_tmpl_args): Const-ify a char*. - (instantiate_class_template): Likewise. - - * repo.c (get_base_filename, open_repo_file, init_repo): Likewise. - - * rtti.c (call_void_fn, expand_generic_desc, expand_si_desc, - expand_class_desc, expand_ptr_desc, expand_attr_desc): Likewise. - - * search.c (lookup_field_info, lookup_member): Likewise. - (lookup_member): Cast the first argument of `bzero' to a PTR. - - * sig.c (compiler_error): Don't prototype. - (build_signature_pointer_or_reference_nam): Const-ify a char*. - (get_sigtable_name, build_member_function_pointer): Likewise. - - * tree.c (compiler_error): Don't prototype. - (no_linkage_helper, build_srcloc): Add static prototype. - (build_vbase_pointer_fields): Const-ify a char*. - (__eprintf): Don't unnecessarily handle `const' when !__STDC__. - - * typeck.c (compiler_error): Don't prototype. - (convert_for_assignment): Const-ify a char*. - (comp_cv_target_types): Add static prototype. - (build_x_indirect_ref, build_indirect_ref, convert_arguments, - build_component_addr, build_unary_op, convert_for_initialization): - Const-ify a char*. - - * typeck2.c (ack): Add static prototype and change from fixed args - to variable args. - (readonly_error, check_for_new_type): Const-ify a char*. - - * xref.c (_XREF_FILE, find_file, filename, fctname, declname, - fixname, open_xref_file, classname, GNU_xref_begin): Likewise. - (GNU_xref_file): Likewise. Also use `xmalloc' instead of `malloc'. - (GNU_xref_end_scope, GNU_xref_ref, GNU_xref_decl, GNU_xref_call, - gen_assign, GNU_xref_member): Const-ify a char*. - -1999-03-25 Martin von Löwis - - * gxxint.texi: Remove old discussion on copying virtual bases. - -1999-03-25 Zack Weinberg - - * Make-lang.in: Remove all references to g++.o/g++.c. - Link g++ from gcc.o. - -1999-03-25 Jason Merrill - - * decl2.c (comdat_linkage): Treat vtables like functions. - -1999-03-25 Mark Mitchell - - * pt.c (tsubst_decl): tsubst into DECL_BEFRIENDING_CLASSES. - -1999-03-25 Nathan Sidwell - - * decl.c (init_decl_processing): Add `signed' type as a synonym - for `int'. - -1999-03-25 Jason Merrill - - * typeck.c (common_type): Handle cv-qual unification for pointers - to members. - - * decl.c (unqualified_namespace_lookup): Return error_mark_node - on error. - (lookup_name_real): Set LOOKUP_COMPLAIN when *not* parsing. - * lex.c (do_identifier): If we got error_mark_node, call - lookup_name again. - -1999-03-24 Martin von Löwis - - * class.c (finish_struct_1): Always reset TYPE_FIELDS for empty - classes. - -1999-03-24 Jason Merrill - - * decl.c (lookup_name_real): Do nested field lookup regardless of - TYPE_BEING_DEFINED. - -1999-03-24 Mark Mitchell - - * cp-tree.h (lang_type): Remove has_assignment and - has_real_assignment. Add befriending_classes. - (TYPE_HAS_ASSIGNMENT): Remove. - (TYPE_HAS_REAL_ASSIGNMENT): Likewise. - (CLASSTYPE_BEFRIENDING_CLASSES): New macro. - (lang_decl): Document. - (DECL_BEFRIENDING_CLASSES): New macro. - (FRIEND_NAME): Move declaration to more obvious location. - (FRIEND_DECLS): Likewise. - * class.c (finish_struct_1): Don't use TYPE_HAS_REAL_ASSIGNMENT. - * decl.c (duplicate_decls): Copy DECL_BEFRIENDING_CLASSES. - (fixup_anonymous_union): Don't use TYPE_HAS_ASSIGNMENT. - (grok_op_properties): Likewise. - * friend.c (is_friend): Use FRIEND_NAME and FRIEND_DECLS. - (add_friend): Likewise. Don't do weird things with assignment - operators. Update DECL_BEFRIENDING_CLASSES. - (add_friends): Don't do weird things with assignment operators. - (make_friend_class): Likewise. Update - CLASSTYPE_BEFRIENDING_CLASSES. - * pt.c (instantiate_class_template): Don't set - TYPE_HAS_ASSIGNMENT. - (tsubst_copy): Substitute the TREE_TYPE for more unary - expressions. - * ptree.c (print_lang_type): Don't look at TYPE_HAS_ASSIGNMENT. - * search.c (protected_accessible_p): New function. - (friend_accessible_p): Likewise. - (accessible_p): Use them. - -1999-03-23 Mark Mitchell - - * pt.c (convert_nontype_argument): Don't create things that aren't - PTRMEM_CSTs when applying a qualification conversion to a - PTRMEM_CST. - -1999-03-23 Mark Mitchell - - * Makefile.in (OBJS): Don't mention hash.o. - (OBJDEPS): Likewise. - -1999-03-23 Jason Merrill - - * decl2.c (finish_file): Set at_eof to 2 after expanding ctors. - * decl.c (expand_static_init): Make sure we don't add any after - then. - - * decl.c (cp_finish_decl): Move intelligence about handling - DECL_COMDAT for variables from here... - * decl2.c (comdat_linkage): ...to here. - (maybe_make_one_only): Tweak. - (import_export_decl): Call comdat_linkage for variables, too. - (finish_file): Handle template statics properly. - -1999-03-22 Mark Mitchell - - * cp-tree.h (TYPE_PTRMEMFUNC_P): Use TYPE_PTRMEMFUNC_FLAG. - Document internals of pointer-to-member-functions. - (DELTA2_FROM_PTRMEMFUNC): Make it call delta2_from_ptrmemfunc. - (PFN_FROM_PTRMEMFUNC): Likewise. - (build_type_conversion): Remove unused parameter. - (build_ptrmemfunc1): Declare. - (expand_ptrmemfunc_cst): New function. - (delta2_from_ptrmemfunc): Likewise. - (pfn_from_ptrmemfunc): Likewise. - * cvt.c (cp_convert_to_pointer): Remove unused parameter to - build_type_conversion. Use TYPE_PTRMEM_P for readability. - (convert_to_reference): Remove unused parameter to - build_type_conversion. - (ocp_convert): Likewise. - (build_user_type_conversion): Likewise. - * error.c (dump_expr): Handle NULL pointer-to-member functions. - * expr.c (cplus_expand_expr): Handle PTRMEM_CSTs for functions. - * method.c (build_overload_value): Don't go splitting CONSTRUCTORs - open when handling pointer-to-member functions. - * pt.c (convert_nontype_argument): Clean up error messages. Be - more stringent with pointers-to-members. - * typeck.c (build_ptrmemfunc1): Don't declare. Make it global. - (build_unary_op): Tidy ever-so-slightly. - (build_conditional_expr): Remove extra parameter to - build_type_conversion. - (build_ptrmemfunc): Build PTRMEM_CSTs if we know what function - we're using. - (expand_ptrmemfunc_cst): Define. - (delta2_from_ptrmemfunc): Likewise. - (pfn_from_ptrmemfunc): Likewise. - -1999-03-19 Mark Mitchell - - * init.c (build_member_call): Handle template-id expressions - correctly. - * typeck.c (build_x_function_call): Likewise. - -1999-03-19 Chip Salzenberg - - * friend.c (make_friend_class): Avoid core dump when - not-yet-defined friend type lacks TYPE_LANG_SPECIFIC(). - -1999-03-18 Jason Merrill - - * decl.c (start_function): Suppress normal linkage heuristics - for #pragma interface under MULTIPLE_SYMBOL_SPACES. - -1999-03-19 Alexandre Oliva - - * Make-lang.in: ($(INTL_TARGETS)): Depend on cp/parse.c. - ($(srcdir)/cp/parse.c): Moved from ../Makefile.in. - -1999-03-17 Martin von Löwis - - * parse.y (named_complex_class_head_sans_basetype): - Do not push a scope for error_mark_node. - (maybe_base_class_list): Likewise. - - * decl.c (start_decl): Check for error_mark_node as a type. - Detected by g++.brendan/array-refs.C. - (start_decl_1): Likewise. Detected by g++.bugs/900322_01.C. - (maybe_build_cleanup_1): Likewise. Detected by - g++.jason/incomplete1.C. - - * tree.c (build_dummy_object): Use void_zero_node instead of the - error_mark_node. - (is_dummy_object): Check for such a node. - Detected by g++.bob/inherit1.C - -1999-03-16 Jason Merrill - - * method.c (old_backref_index): Split out... - (flush_repeats): From here. Rename back from try_old_backref. - (build_mangled_name): Put back some old-style repeat handling. - -Mon Mar 15 21:57:16 1999 Kaveh R. Ghazi - - * lex.c: Don't include setjmp.h. - (parse_float): New static function. - (pf_args): New struct. - (real_yylex): Use them in call to `do_float_handler'. - -1999-03-15 Mark Mitchell - - * decl.c (xref_basetypes): Set CLASSTYPE_VBASECLASSES here. - * tree.c (layout_basetypes): Not here. - * search.c (dfs_search): Remove; no longer used. - -1999-03-12 Mark Mitchell - - * decl2.c (validate_nonmember_using_decl): Issue sensible - error-messages on bogus qualifiers. - -1999-03-14 Jason Merrill - - * call.c (add_function_candidate): Fix uninitialized variable. - - * Makefile.in (search.o): Add dependency on varray.h. - -1999-03-13 Jason Merrill - - * decl.c (duplicate_decls): Use same_type_p. - * method.c (try_old_backref): Renamed from flush_repeats. Use - same_type_p. Don't try to handle repeats. Return success. - (is_back_referenceable_type): Return 0 if TYPE_FOR_JAVA. Support - calls from old-style code, too. - (check_ktype): Use same_type_p. - (check_btype): Use same_type_p. Don't pull out TYPE_MAIN_VARIANT. - (build_qualified_name): Simplify logic. - (process_overload_item): Strip typedefs and quals at the top. - (build_mangled_name_for_type_with_Gcode): Remove call to - type_canonical_variant. - (build_mangled_name): Likewise. Remove support for old-style - repeats, which have been disabled since 2.7.2. Don't mess with - TREE_USED. - (build_decl_overload_real): Don't mess with TREE_USED. - -1999-03-13 Nathan Sidwell - - * error.c (cp_printers): Add 'F' escape character. - (dump_type_real): Remove TREE_LIST (fnargs) printing. - Functionality moved to dump_parameters. - (dump_type_suffix): Use dump_parameters and dump_exception_spec. - (dump_function_decl): Extend meaning of V parameter. Use - dump_parameters and dump_exception_spec. - (dump_parameters): New static function. - (dump_exception_spec): New static function. - (fndecl_as_string): Change argument semantics. Use - dump_function_decl directly. - - * sig.c (build_signature_table_constructor): Use cp_error. - -1999-03-13 Martin von Löwis - - * semantics.c (finish_switch_cond): Handle error cases gracefully. - Detected by g++.law/enum5.C. - - * typeck.c (build_modify_expr): Check for errors after resolving - offsets. Detected by g++.brendan/static1.C. - - * decl.c (complete_array_type): Ignore initial_value if it is an - error. Detected by g++.benjamin/17930.C. - - * typeck2.c (process_init_constructor): Return error if one argument - is in error. Detected by g++.benjamin/13478.C. - -1999-03-12 Martin von Löwis - - * decl.c (select_decl): Allow class templates when we need types. - * decl2.c (ambiguous_decl): Likewise. - -1999-03-12 Mark Mitchell - - * lex.c (do_identifier): Correct call to enforce_access. - * search.c (accessible_p): Tweak comment. - -1999-03-10 Mark Mitchell - - * semantics.c (begin_class_definition): Call build_self_reference. - (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs. - - * search.c (assert_canonical_unmarked): Fix typo in prototype. - - * search.c (dfs_canonical_queue): New function. - (dfs_assert_unmarked_p): Likewise. - (assert_canonical_unmarked): Likewise. - (access_in_type): Use it. - (accessible_p): Likewise. Walk the whole tree when umarking. - - * sig.c (build_signature_table_constructor): Use accessible_p - instead of compute_access. - -1999-03-09 Jason Merrill - - * call.c (add_builtin_candidates): Handle overloaded conversion ops. - -1999-03-09 Mark Mitchell - - * cp-tree.h (flag_access_control): Declare. - (TREE_VIA_PPUBLIC): Document. - (DECL_NONSTATIC_MEMBER_P): New macro. - (enforce_access): Return an indication of whether or not access - was permitted. - (build_self_reference): Change prototype. - (compute_access): Replace with ... - (accessible_p): New function. - (dfs_walk): Change prototype. - (dfs_unmark): Likewise. - (markedp): Likewise. - * call.c (enforce_access): Use accessible_p. - * class.c (build_self_reference): Insert the declaration into the - list of members for this type, and make it public. - * decl.c (xref_basetypes): Avoid ill-timed recursion. - * init.c (build_offset_ref): Use lookup_member, not three separate - name-lookups. Call enforce_access rather than checking for - illegal accesses here. - (resolve_offset_ref): Likewise. - * lex.c (do_identifier): Likewise. - * method.c (hack_identifier): Likewise. - * parse.y (self_reference): Remove. - (opt_component_decl_list): Don't use it. - * parse.c: Regenerated. - * pt.c (print_candidates): Generalize to handle lists of - overloaded functions. - (instantiate_class_template): Don't rely on TREE_VIA_PRIVATE; it's - not set. - (get_template_base): Use new calling convention for dfs_walk. - * search.c: Include varray.h. Add prototypes. - (dfs_walk): Accept a data pointer to pass to the work functions. - All callers changed. All work functions changed. - (breadth_first_search): Rename to bfs_walk, and make consistent - with dfs_walk. - (dfs_walk_real): New function. - (canonical_binfo): New function. - (context_for_name_lookup): Likewise. - (shared_marked_p): Likewise. - (shared_unmarked_p): Likewise. - (lokup_field_queue_p): Likewise. - (lookup_field_r): Generalize to handle both functions and fields. - (lookup_field): Just call lookup_member. - (lookup_fnfields): Likewise. - (lookup_member): Move body of lookup_field here and generalize. - (dfs_accessible_queue_p): Likewise. - (dfs_accessible_p): Likewise. - (dfs_access_in_type): Likewise. - (access_in_type): Likewise. - (compute_access): Remove, and replace with ... - (accessible_p): New function. - (vbase_types): Remove. - (vbase_decl_ptr_intermediate): Likewise. - (vbase_decl_ptr): Likewise. - (vbase_init_result): Likewise. - (closed_envelopes): Likewise. - (bvtable): Likewise. - -1999-03-09 Jason Merrill - - * call.c (add_function_candidate): Check for proper number of args - before checking the validity of those args. - -1999-03-06 Jason Merrill - - * cp-tree.h (struct lang_type): Add anon_union field. - (ANON_UNION_TYPE_P): Use it instead of examining type. - (SET_ANON_UNION_TYPE_P): New macro. - * decl.c (check_tag_decl): Use it. - - * search.c (compute_access): Handle non-type contexts earlier, and - handle NULL_TREE. - - * tree.c (build_exception_variant): Use copy_to_permanent. - - * decl2.c (setup_initp): Give statics with no priority the default - priority here. - (do_dtors, do_ctors, finish_file): Remove special handling of - non-prioritized statics. - -1999-03-05 Mark Mitchell - - * cp-tree.h (ANON_UNION_TYPE_P): Robustify. - * decl.c (make_typename_type): Don't issue an error if an - immediate lookup fails; it migt be resolved later. - * friend.c (is_friend): Add comment. - * search.c (breadth_first_search): Add POSTFN and DATA - parameters. Tidy. All callers changed. - (lookup_field_queue_p): New function. - (lookup_field_r): Likewise. - (lookup_field_post): Likewise. - (lookup_field): Use them, via breadth_first_search, instead of - duplicating logic. - (compute_access): Robustify. - (lookup_fnfield_info): New structure. - -1999-03-05 Jason Merrill - - * pt.c (tsubst, case ARRAY_REF): Use tsubst_expr again. - -1999-03-03 Jason Merrill - - * class.c, decl2.c, method.c, pt.c: Add 'static' to make SunOS 4 - cc happy. - - * decl2.c (import_export_class): Also return if - CLASSTYPE_INTERFACE_ONLY is set. - -1999-03-03 Martin von Löwis - - * decl.c (push_overloaded_decl): Only overwrite the old binding if - there was one. - * decl2.c (do_local_using_decl): Fix loop termination. - -1999-03-02 Mark Mitchell - - * cp-tree.h (determine_specialization): Don't declare. - * pt.c (determine_specialization): Make it static. Eliminate - complain parameter. Note that decl is always non-NULL now, and - simplify accordingly. - - * decl.c (maybe_push_to_top_level): Always call - push_cp_function_context. - (pop_from_top_level): Always call pop_cp_function_context. - -1999-02-26 Nathan Sidwell - - * typeck.c (complete_type_or_else): Add VALUE arg, for helpful - diagnostics. - * cp-tree.h (complete_type_or_else): Added VALUE parameter. - * init.c (build_new_1): Extra arg to complete_type_or_else. - (build_delete): Likewise. - * typeck.c (require_complete_type): Likewise. - (pointer_int_sum): Likewise. - (pointer_diff): Likewise. - (build_component_ref): Likewise. - - * typeck2.c (incomplete_type_error): Always use cp_error. - Show declaration of undefined type, if appropriate. - Deal with UNKNOWN_TYPE nodes. - - * typeck.c (require_complete_type): Use TYPE_SIZE as - size_zero_node to mean incomplete type. - (require_complete_type_in_void): New function. - (build_compound_expr): Call complete_type_in_void for LHS. - (build_c_cast): Call complete_type_in_void for void cast. - * cvt.c (ocp_convert): Call complete_type_in_void for void cast. - * decl.c (cplus_expand_expr_stmt): Void expression checks moved to - require_complete_type_in_void. Call it. - * cp-tree.h (require_complete_type_in_void): Prototype new function. - - * typeck.c (convert_arguments): Use alternative format for - function decls. Don't require_complete_type here. Simplify - diagnostic printing. - (convert_for_initialization): Don't require_complete_type on RHS yet. - * call.c (convert_arg_to_ellipsis): Call require_complete_type. - - * call.c (build_over_call): Cope with qualified void return type. - * semantics.c (finish_call_expr): Likewise. - * typeck.c (build_function_call_real): Likewise. - (c_expand_return): Likewise. - * decl2.c (reparse_absdcl_as_expr): Cope with qualified void type. - - * call.c (print_z_candidates): Use alternate print format, to be - consistent with (pt.c) print_candidates. - * method.c (hack_identifier): List candidate members. - * search.c (lookup_field): Build ambiguous list, and show it, if - ambiguous. - -1999-02-26 Mark Mitchell - - * typeck.c (decay_conversion): Don't confuse constant array - variables with their initializers. - - * decl.c (duplicate_decls): Copy DECL_TEMPLATE_INSTANTIATED when - merging decls. - * pt.c (regenerate_decl_from_template): Tweak for clarity. - (instantiate_decl): Mark a decl instantiated before regenerating - it to avoid recursion. - * tree.c (mapcar): Don't call decl_constant_value unless we know - something is TREE_READONLY_DECL_P. - - * class.c (check_for_override): Don't stop checking when we find - the first overridden function. Delete #if 0'd code. - * search.c (get_matching_virtual): Likewise. - -1999-02-25 Richard Henderson - - * lang-specs.h: Define __FAST_MATH__ when appropriate. - -1999-02-24 Mike Stump - - * typeck.c (convert_for_assignment): Allow boolean integral constant - expressions to convert to null pointer. - -1999-02-24 Martin von Loewis - - * decl.c (lookup_namespace_name): Resolve namespace aliases. - - * class.c (push_nested_class): Allow namespaces. - - * decl2.c (set_decl_namespace): Add friendp parameter. - * decl.c (grokfndecl): Pass it. - (grokvardecl): Likewise. - * cp-tree.h: Change declaration. - -1999-02-24 Jason Merrill - - * pt.c (tsubst): Allow an array of explicit size zero. - -1999-02-23 Jason Merrill - - * errfn.c: Change varargs code to look like toplev.c. - - * method.c (process_modifiers): Don't prepend 'U' for char or - wchar_t. - -1999-02-20 Craig Burley - - * Make-lang.in (cplib2.ready): Don't consider updating - cplib2 stuff if the current directory isn't writable, as - it won't work (such as during a `make install'). - -Sun Feb 21 20:38:00 1999 H.J. Lu (hjl@gnu.org) - - * decl2.c (start_objects): Make file scope constructors and - destructors local to the file if ASM_OUTPUT_CONSTRUCTOR and - ASM_OUTPUT_DESTRUCTOR are defined. - -1999-02-19 Mark Mitchell - - * cp-tree.h (CLASSTYPE_METHOD_VEC): Adjust comment. - (fn_type_unification): Adjust prototype. - (lookup_fnfields_1): Declare. - * call.c (add_template_candidate_real): Adjust call to - fn_type_unification. - * class.c (add_method): Don't allow duplicate declarations of - constructors or destructors. - (resolve_address_of_overloaded_function): Remove unused variable. - Adjust call to fn_type_unification. - * decl.c (grokfndecl): Be more robust in the face of illegal - specializations. - * decl2.c (check_classfn): Remove hokey handling of member - templates. - * pt.c (determine_specialization): Improve comments. Adjust to - handle template argument deduction as per the standard. - (check_explicit_specialization): Fix comment spacing. Handle - type-conversion operators correctly. Improve error-recovery. - (fn_type_unification): Remove EXTRA_FN_ARG parameter. - (get_bindings_real): Simplify handling of static members. - * search.c (lookup_fnfields_1): Make it have external linkage. - * typeck.c (compparms): Fix comment. - (build_unary_op): Don't try to figure out which template - specialization is being referred to when when the address-of - operator is used with a template function. - -Thu Feb 18 23:40:01 1999 Kaveh R. Ghazi - - * cp-tree.h (lvalue_or_else): Qualify a char* with the `const' - keyword to match an analogous change at the top level. - - * tree.c (lvalue_or_else): Likewise. - -1999-02-17 Mark Mitchell - - * decl.c (xref_basetypes): Comment. - * pt.c (instantiate_class_template): Use xref_basetypes. - -1999-02-16 Mark Mitchell - - * cp-tree.h (tsubst): Change prototype. - (tsubst_expr): Likewise. - (tsubst_copy): Likewise. - (type_unification): Remove prototype. - * call.c (convert_default_arg): Adjust call to tsubst_expr. - * class.c (resolve_address_of_overloaded_function): Just use - fn_type_unification. - * decl.c (grokdeclarator): Adjust call to tsubst. - * method.c (build_template_parm_names): Likewise. - * pt.c (GTB_VIA_VIRTUAL): New macro. - (GTB_IGNORE_TYPE): Likewise. - (resolve_overloaded_unification): Add `complain' parameter. - (try_one_overload): Likewise. - (tsubst_template_arg_vector): Likewise. - (tsubst_template_parms): Likewise. - (tsubst_aggr_type): Likewise. - (tsubst_arg_types): Likewise. - (tsubst_call_declarator_parms): Likewise. - (unify): Remove explicit_mask. - (type_unification_real): Likewise. - (get_template_base_recursive): Likewise. - (coerce_template_template_parms): Provide prototype. - (tsubst_function_type): Likewise. - (try_class_unification): New function. - All callers changed to use new complain parameter. - (get_template_base): Use try_class_unification. - (unify): Adjust handling of classes derived from template types. - (fn_type_unification): Substitute explicit arguments before - unification. - -1999-02-16 Kriang Lerdsuwanakij - - * decl.c (pushdecl): Remove dead code. - -1999-02-16 Jason Merrill - - * decl2.c (finish_objects): Fix code I missed in previous change. - -1999-02-13 Jason Merrill - - * decl.c (grokfndecl): Return NULL_TREE instead of error_mark_node. - (grokdeclarator): Don't expect error_mark_node from grokfndecl. - - * pt.c (maybe_process_partial_specialization): Complain about - 'template <>' on non-specialization. - -1999-02-10 Jason Merrill - - * decl.c (grokdeclarator): Catch weird declarators. - * decl2.c (finish_file): Don't abort because of namespace parsing - failure. - (check_decl_namespace): Remove. - -1999-02-09 Mark Mitchell - - * cp-tree.h (get_template_base): Don't declare. - (dfs_walk): Declare. - (dfs_unmark): Likewise. - (markedp): Likewise. - * pt.c (unify): Remove duplicate declaration. Pass tparms and - targs to get_template_base. - (get_template_base_recursive): Move here from search.c. Check to - see that the base found can be instantiated to form the desired - type. - (get_template_base): Likewise. - (get_class_bindings): Simplify. - * search.c (get_template_base_recursive): Move to pt.c. - (get_template_base): Likewise. - (markedp): Make it global. - (dfs_walk): Likewise. - (dfs_unmark): Likewise. - -1999-02-07 Jason Merrill - - * pt.c (maybe_process_partial_specialization): Complain about - specialization in wrong namespace. - * tree.c (decl_namespace_context): New fn. - -1999-02-06 Kriang Lerdsuwanakij - - * decl2.c (arg_assoc_type): Handle TEMPLATE_TEMPLATE_PARM. - * pt.c (coerce_template_template_parms): Handle nested - template template parameters. - -Sat Feb 6 18:08:40 1999 Jeffrey A Law (law@cygnus.com) - - * typeck2.c: Update email addresses. - -1999-02-04 Kriang Lerdsuwanakij - - * pt.c (unify): Call coerce_template_parms with the COMPLAIN flag - turned off. - -1999-02-04 Jason Merrill - - * lex.c (retrofit_lang_decl): Split out... - (build_lang_decl): From here. - * decl.c (pushdecl): Call it for functions generated by the middle - end that don't have DECL_LANG_SPECIFIC. - * cp-tree.h: Declare it. - - * decl2.c: Remove flag_init_priority. Always enable initp stuff. - (start_objects, finish_objects): Only use special - init_priority code if the user specified a priority. - (do_ctors, do_dtors): Use DEFAULT_INIT_PRIORITY for the non-initp - objects. - -Wed Feb 3 22:50:17 1999 Marc Espie - - * Make-lang.in (GXX_OBJS): Remove choose-temp.o, pexecute.o and - mkstemp.o. Get them from libiberty now. - (DEMANGLER_PROG): Simlarly, remove getopt.o getopt1.o. - -Tue Feb 2 22:38:48 1999 Theodore Papadopoulo - - * decl2.c (lang_decode_option): Use read_integral_parameter. - -1999-02-01 Mark Mitchell - - * pt.c (tsubst, case TYPENAME_TYPE): Check TYPE_BEING_DEFINED - before calling complete_type_or_else. - -Mon Feb 1 09:49:52 1999 Kaveh R. Ghazi - - * input.c (inline): Don't define, its handled by system.h. - -Sun Jan 31 20:34:29 1999 Zack Weinberg - - * decl2.c: Don't define flag_no_ident here. Don't process - -f(no-)ident here. - * cp-tree.h: Don't declare flag_no_ident here. - * lang-specs.h: Map -Qn to -fno-ident. - -1999-01-28 Jason Merrill - - * cp-tree.h (struct tree_binding): Replace scope field with a union. - (BINDING_SCOPE): Adjust. - * decl.c (BINDING_LEVEL): Adjust. - -1999-01-26 Jason Merrill - - * pt.c (instantiate_class_template): Set up the DECL_INITIAL of - member constants. - - * init.c (expand_member_init): Pull out TYPE_MAIN_VARIANT in - a ctor initializer. - - * tree.c (equal_functions): Fix name in prototype. - - * decl.c (push_local_binding): Add FLAGS argument. - (pushdecl, push_overloaded_decl): Pass it. - * decl2.c (do_local_using_decl): Likewise. - * cp-tree.h: Adjust prototype. - * decl.c (poplevel): Fix logic. - - * decl.c (push_local_binding): Also wrap used decls in a TREE_LIST. - (poplevel): Handle that. Fix logic for removing TREE_LISTs. - (cat_namespace_levels): Don't loop forever. - -1999-01-25 Richard Henderson - - * typeck.c (build_reinterpret_cast): Fix typo in duplicated test. - -1999-01-25 Jason Merrill - - * class.c (resolve_address_of_overloaded_function): Mark the - chosen function used. - - * call.c (build_call): Make sure that a function coming in has - been marked used already. - * decl.c (expand_static_init): Call mark_used instead of - assemble_external. - * except.c (call_eh_info, do_pop_exception, expand_end_eh_spec, - alloc_eh_object, expand_throw): Likewise. - * init.c (build_builtin_delete_call): Likewise. - * rtti.c (call_void_fn, get_tinfo_fn, build_dynamic_cast_1, - expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, - expand_generic_desc): Likewise. - -1999-01-25 Martin von Löwis - - * tree.c (equal_functions): New function. - (ovl_member): Call it. - -1999-01-24 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Fix conversion of 0 to pmf. - -1999-01-25 Martin von Loewis - - * decl.c (decls_match): Return 1 if old and new are identical. - (push_overloaded_decl): Set OVL_USED when PUSH_USING. - -1999-01-24 Jason Merrill - - * decl.c (start_function): Make member functions one_only on windows. - * decl2.c (import_export_decl): Likewise. - - * decl.c (grokdeclarator): Don't complain about implicit int in - a system header. Change same-name field check to not complain in - a system header instead of within extern "C". - -1999-01-21 Mark Mitchell - - * cp-tree.h (PUSH_GLOBAL): New macro. - (PUSH_LOCAL): Likewise. - (PUSH_USING): Likewise. - (namespace_bindings_p): Declare. - (push_overloaded_decl): Likewise. - * decl.c (push_overloaded_decl): Don't make it static. Check for - illegal declarations after using declarations here. - (namespace_bindings_p): Likewise. - (duplicate_decls): Don't consider declarations from different - namespaces to be the same. - (pushdecl): Use symbolic PUSH_ constants in calls to - push_overloaded_decl. - (push_overloaded_decl_1): Likewise. - * decl2.c (validate_nonmember_using_decl): Tweak `std' handling. - (do_nonmember_using_decl): Check for illegal using declarations - after ordinary declarations here. - (do_local_using_decl): Call pushdecl to insert declarations. - -1999-01-21 Jason Merrill - - * decl.c (grokdeclarator): Fix lang_c -> lang_name_c typo. - -1999-01-21 Mark Mitchell - - * tree.c (build_cplus_array_type_1): Don't call build_array_type - for types involving template parameters. - - * cp-tree.h (PARM_DECL_EXPR): Delete. - (convert_default_arg): Change prototype. - (check_default_argument): Declare. - (search_tree): Likewise. - * call.c (convert_default_arg): Take the function to which the - default argument belongs as a parameter, and do any necessary - instantiation here, instead of ... - (build_over_call): Here. - * decl.c (local_variable_p): New function. - (check_default_argument): Likewise, split out and tidied from ... - (grokparms): Here. - * error.c (dump_expr): Don't set PARM_DECL_EXPR. - * pt.c (tsubst_call_declarator_parms): New function. - (for_each_template_parm): Handle ARRAY_REFs. Do the obvious thing - with CALL_EXPRs, rather than trying to be clever. - (tsubst): Use tsubst_call_declarator_parms. - * tree.c (search_tree): Don't make it static. - * typeck.c (convert_arguments): Use new interface to - convert_default_arg. - -1999-01-20 Mark Mitchell - - * error.c (dump_function_decl): Don't print the argument types for - a function when the verbosity level is negative. - - * call.c (build_over_call): Check format attributes at call-time. - - * pt.c (tsubst_copy): Fix comment. - (unify): Don't allow unification with variable-sized arrays. - - * semantics.c (finish_stmt_expr): When processing a template make - the BIND_EXPR long-lived. - -1999-01-19 Jason Merrill - - * decl2.c (finish_vtable_vardecl): Make vtables comdat here. - (import_export_vtable): Not here. - -1999-01-18 Jason Merrill - - * typeck.c (build_component_ref): Wrap an OVERLOAD around a unique - non-static member function. - -1999-01-18 Nathan Sidwell - - * class.c (instantiate_type): Only diagnose illegal address of member - function if complaining. - - * decl.c (lookup_name_real): Remove duplicate code. - -1999-01-18 Jason Merrill - - * tree.c (copy_template_template_parm): Use permanent_obstack. - -1999-01-18 Kriang Lerdsuwanakij - - * pt.c (unify): Remove restrictions on deduction of argument - of template template parameters. - -1999-01-18 Nathan Sidwell - - * rtti.c (build_dynamic_cast_1): Resolve OFFSET_REF exprs. - - * class.c (resolve_address_of_overloaded_function): Show list of - all candidates, when none of them match. - -1999-01-18 Chip Salzenberg - - * typeck.c (comp_ptr_ttypes_reinterpret): Per ANSI, tighten up - definition of 'casting away const' in reinterpret_cast<>. - -1999-01-18 Graham - - * cvt.c: Add include for decl.h, remove extern for - static_aggregates which is now provided by decl.h. - - * Makefile.in (cvt.o): Add dependency for decl.h and missing - dependencies for convert.h and flags.h. - -1999-01-18 Nathan Sidwell - - * decl2.c (do_dtors): Set current location to that of the - decl, for sensible diagnostics and debugging. - (check_classfn): Issue `incomplete type' error, if - class is not defined. - -1999-01-16 Jason Merrill - - * cp-tree.h: Add prototype for bound_pmf_p. - -1999-01-16 Jason Merrill - Manfred Hollstein - - * decl.c (grokdeclarator): Don't make 'main(){}' an error with only - -Wreturn-type. - -1999-01-16 Nathan Sidwell - - * cp-tree.h (struct lang_type): Added has_mutable flag. - (CLASSTYPE_HAS_MUTABLE): New macro to access it. - (TYPE_HAS_MUTABLE_P): New macro to read it. - (cp_has_mutable_p): Prototype for new function. - * class.c (finish_struct_1): Set has_mutable from members. - * decl.c (cp_finish_decl): Clear decl's TREE_READONLY flag, if - it contains a mutable. - * typeck.c (cp_has_mutable_p): New function. - -1999-01-15 Mark Mitchell - - * pt.c (process_template_parm): Ignore top-level qualifiers on - non-type parameters. - - * decl.c (start_function): Use current_function_parms in the call - to require_complete_type_for_parms, not the probably empty - DECL_ARGUMENTS. - -1999-01-14 Jason Merrill - - * semantics.c (finish_asm_stmt): Don't warn about redundant volatile. - - * decl2.c (import_export_class): MULTIPLE_SYMBOL_SPACES only means - that we don't suppress the other copies. - * lex.c (handle_cp_pragma): Likewise. - -1999-01-13 Mark Mitchell - - * decl.c (grokdeclarator): Undo 1998-12-14 change. - * tree.c (build_cplus_array_type_1): Likewise. - * pt.c (instantiate_class_template): Remove misleading comment. - (tsubst_aggr_type): Substitute if there are template parameters, - regardless of whether or not they use template arguments. - (unify): Likewise, but for unification. - -1999-01-12 Richard Henderson - - * cp-tree.h (flag_permissive): Declare extern. - -1999-01-06 Mark Mitchell - - * cp-tree.h (IDENTIFIER_TYPENAME_P): Use OPERATOR_TYPENAME_FORMAT - here. - (lang_type): Add is_partial_instantiation. Decrease width of - dummy. - (PARTIAL_INSTANTIATION_P): New macro. - (OPERATOR_TYPENAME_P): Remove. - * decl.c (unary_op_p): Use IDENTIFIER_TYPENAME_P, not - OPERATOR_TYPENAME_P. - (grok_op_properties): Likewise. - * friend.c (do_friend): Handle friends that are member functions - correctly. - * lex.c (init_parse): Use OPERATOR_TYPENAME_FORMAT. - * pt.c (instantiate_class_template): Rework for clarity. Avoid - leaving TYPE_BEING_DEFINED set in obscure cases. Don't do - any more partial instantiation than is absolutely necessary for - implicit typename. Set PARTIAL_INSTANTIATION_P. - (tsubst_decl): Use IDENTIFIER_TYPENAME_P. - * semantics.c (begin_class_definition): Handle partial - specializations of a type that was previously partially - instantiated. - -Wed Jan 6 03:18:53 1999 Mark Elbrecht - - * Make-lang.in (g++.o): Depend on prefix.h. - -1999-01-04 Jason Merrill - - * tree.c (bound_pmf_p): New fn. - * typeck.c (build_c_cast): Use it. - - * decl.c (grok_op_properties): Use same_type_p. - -Tue Dec 22 15:09:25 1998 Kaveh R. Ghazi - - * Makefile.in (cvt.o): Depend on toplev.h. - - * cp-tree.h (check_template_shadow, pod_type_p): Add prototypes. - - * cvt.c: Include toplev.h. - - * except.c (get_eh_caught, get_eh_handlers): Hide prototypes and - definitions. - - * init.c (expand_vec_init): Initialize variable `itype'. - - * lex.c (yyerror): Cast the argument passed to a ctype function to - an unsigned char. - - * method.c (build_mangled_C9x_name): Wrap prototype and definition - in "HOST_BITS_PER_WIDE_INT >= 64". - - * typeck.c (build_binary_op): Mark parameter `convert_p' with - ATTRIBUTE_UNUSED. - -1998-12-22 Mark Mitchell - - * cp-tree.h (TYPE_RAISES_EXCEPTIONS): Improve documentation. - * tree.c (build_exception_variant): Don't crash on empty throw - specs. - -1998-12-18 DJ Delorie - - * cvt.c (convert_to_reference): Check for both error_mark_node - and NULL_NODE after call to convert_for_initialization. - -1998-12-17 Jason Merrill - - * error.c (interesting_scope_p): New fn. - (dump_simple_decl): Use it. - (dump_expr, case CONSTRUCTOR): Force a & for a PMF. - (dump_expr, case OFFSET_REF): Print ->* if appropriate. - -1998-12-16 Mark Mitchell - - * class.c (resolve_address_of_overloaded_function): Do conversion - to correct type here, rather than ... - (instantiate_type): Here. - - * cp-tree.h (DECL_TEMPLATE_PARM_P): New macro. - (DECL_TEMPLATE_TEMPLATE_PARM_P): Use it. - (decl_template_parm_p): Remove. - * decl.c (pushdecl): Don't set DECL_CONTEXT for a template - parameter. - * lex.c (do_identifier): Use DECL_TEMPLATE_PARM_P. - * pt.c (push_inline_template_parms_recursive): Set it. - (decl_template_parm_p): Remove. - (check_template_shadow): Use DECL_TEMPLATE_PARM_P. - (process_template_parm): Set it. - -Wed Dec 16 16:33:58 1998 Dave Brolley - - * lang-specs.h (default_compilers): Pass -MD, -MMD and -MG to cc1plus - if configured with cpplib. - -1998-12-15 Mark Mitchell - - * decl.c (poplevel): Make sure ns_binding is initialized. - - * decl.c (finish_function): Undo inadvertent change in previous - patch. - -1998-12-14 Mark Mitchell - - * class.c (pushclass): Tweak handling of class-level bindings. - (resolve_address_of_overloaded_function): Update pointer-to-member - handling. - (instantiate_type): Likewise. - * cvt.c (cp_convert_to_pointer): Likewise. - * decl.c (pop_binding): Take the DECL to pop, not just the name. - Deal with `struct stat' hack. - (binding_level): Add to documentation. - (push_binding): Clear BINDING_TYPE. - (add_binding): New function. - (push_local_binding): Use it. - (push_class_binding): Likewise. - (poplevel): Adjust calls to pop_binding. - (poplevel_class): Likewise. - (pushdecl): Adjust handling of TYPE_DECLs; add bindings for hidden - declarations to current binding level. - (push_class_level_binding): Likewise. - (push_overloaded_decl): Adjust handling of OVERLOADs in local - bindings. - (lookup_namespace_name): Don't crash when confronted with a - TEMPLATE_DECL. - (lookup_name_real): Do `struct stat' hack in local binding - contexts. - (build_ptrmemfunc_type): Adjust documentation. - (grokdeclarator): Don't avoid building real array types when - processing templates unless really necessary. - (finish_method): Adjust calls to pop_binding. - * decl2.c (reparse_absdcl_as_expr): Recursively call ourselves, - not reparse_decl_as_expr. - (build_expr_from_tree): Deal with a template-id as the function to - call in a METHOD_CALL_EXPR. - * pt.c (convert_nontype_argument): Tweak pointer-to-member handling. - (maybe_adjust_types_For_deduction): Don't do peculiar things with - METHOD_TYPEs here. - (resolve_overloaded_unification): Handle COMPONENT_REFs. Build - pointer-to-member types where necessary. - * tree.c (build_cplus_array_type_1): Don't avoid building real - array types when processing templates unless really necessary. - (build_exception_variant): Compare the exception lists correctly. - -1998-12-13 Mark Mitchell - - * cp-tree.def (CPLUS_BINDING): Update documentation. - * cp-tree.h (LOCAL_BINDING_P): New macro. - (lang_identifier): Rename local_value to bindings. - (tree_binding): Make `scope' of type `void*', not `tree'. - (BINDING_SCOPE): Update documentation. - (IDENTIFIER_LOCAL_VALUE): Remove. - (IDENTIFIER_CLASS_VALUE): Document. - (IDENTIFIER_BINDING): New macro. - (IDENTIFIER_VALUE): Likewise. - (TIME_IDENTIFIER_TIME): Likewise. - (TIME_IDENTIFIER_FILEINFO): Likewise. - (IMPLICIT_TYPENAME_P): Likewise. - (set_identifier_local_value): Remove. - (push_local_binding): New function. - (push_class_binding): Likewise. - * class.c (pushclass): Update comments; use push_class_binding. - * decl.c (set_identifier_local_value_with_scope): Remove. - (set_identifier_local_value): Likewise. - (push_binding): New function. - (pop_binding): Likewise. - (binding_level): Update documentation. Remove shadowed. - (BINDING_LEVEL): New macro. - (free_binding_nodes): New variable. - (poplevel): Adjust for new name-lookup scheme. Don't mess up - BLOCK_VARs when doing for-scope extension. Remove effectively - dead code. - (pushlevel_class): Tweak formatting. - (poplevel_class): Adjust for new name-lookup scheme. - (print_binding_level): Likewise. - (store_bindings): Likewise. - (pushdecl): Likewise. - (pushdecl_class_level): Likewise. - (push_class_level_binding): Likewise. - (push_overloaded_decl): Update comments. Adjust for new - name-lookup scheme. - (lookup_name_real): Likewise. - (lookup_name_current_level): Likewise. - (cp_finish_decl): Likewise. - (require_complete_types_for_parms): Likewise. Remove misleading - #if 0'd code. - (grok_parms): Likewise. Don't call - require_complete_types_for_parms here. - (grok_ctor_properties): Don't treat templates as copy - constructors. - (grop_op_properties): Or as assignment operators. - (start_function): Document. Adjust for new name-lookup scheme. - (finish_function): Likewise. - * decl2.c (do_local_using_decl): Use push_local_binding. - * lex.c (begin_definition_of_inclass_inline): New function, split - out from ... - (do_pending_inlines): Here, and ... - (process_next_inline): Here. - (get_time_identifier): Use TIME_IDENTIFIER_* macros. - (init_filename_times): Likewise. - (extract_interface_info): Likewise. - (ste_typedecl_interface_info): Likewise. - (check_newline): Likewise. - (dump_time_statistics): Likewise. - (handle_cp_pragma): Likewise. - (do_identifier): Adjust for new name-lookup scheme. - * parse.y (function_try_block): Return ctor_initializer_opt value. - (fndef): Use it. - (fn.defpen): Pass appropriate values to start_function. - (pending_inline): Use functor_try_block value, and pass - appropriate values to finish_function. - * pt.c (is_member_template): Update documentation; remove handling - of FUNCTION_DECLs. As per name, this function should deal only in - TEMPLATE_DECLs. - (decl_template_parm_p): Change name of olddecl parameter to decl. - (check_template_shadow): Adjust for new name-lookup scheme. - (lookup_template_class): Likewise. - (tsubst_decl): Tweak so as not to confuse member templates with - copy constructors and assignment operators. - (unify): Handle UNION_TYPEs. - * ptree.c (print_lang_identifier): Adjust for new name-lookup scheme. - (lang_print_xnode): Adjust for new name-lookup scheme. - * typeck.c (mark_addressable): Likewise. - (c_expand_return): Likewise. - -1998-12-08 Jason Merrill - - * decl.c (grokdeclarator): Allow field with same name as class - in extern "C". - - * decl.c (lookup_name_real): Don't limit field lookup to types. - * class.c (check_member_decl_is_same_in_complete_scope): No error - if icv and x are the same. - * lex.c (do_identifier): Tweak error message. - -1998-12-10 Mark Mitchell - - * decl.c (start_enum): Use push_obstacks, not - end_temporary_allocation. - (finish_enum): Call pop_obstacks. - -1998-12-10 Mark Mitchell - - * class.c (instantiate_type): Return error_mark_node rather than - junk. - -1998-12-09 Mark Mitchell - - * cp-tree.h (most_specialized_instantiation): New function. - (print_candidates): Likewise. - * class.c (validate_lhs): Remove. - (resolve_address_of_overloaded_function): New function, split out - and then substantially reworked, from ... - (instantiate_type): Use it. Simplify. - * cvt.c (convert_to_reference): Complain when caller has indicated - that's the right thing to do. Don't crash if instantiate_type - fails. - * pt.c: Substitute `parameters' for `paramters' throughout. - (print_candidates): Don't make it static. - (most_specialized_instantiation): Split out from ... - (most_specialized): Here. - -Wed Dec 9 15:33:01 1998 Dave Brolley - - * lex.c (lang_init_options): Initialize cpplib. - * decl2.c (parse_options,cpp_initialized): Removed. - (lang_decode_option): Move initialization of cpplib to - lang_init_options. - -1998-12-09 Mark Mitchell - - * decl.c (grokdeclarator): Update the name of the TEMPLATE_DECL, as - well as the TYPE_DECL, when a typedef name is assigned to a - previously anonymous type. - -1998-12-08 Andrew MacLeod - - * cp/except.c (call_eh_info): Use __start_cp_handler instead of - __cp_eh_info for getting the eh info pointer. Add table_index to - field list. - (push_eh_cleanup): Don't increment 'handlers' data field. - (process_start_catch_block): Don't set the 'caught' field. - - * cp/exception.cc (CP_EH_INFO): New macro for getting the - exception info pointer within library routines. - (__cp_eh_info): Use CP_EH_INFO. - (__start_cp_handler): Get exception info pointer, set caught field, - and increment the handlers field. Avoids this being done by handlers. - (__uncatch_exception, __check_eh_spec): Use CP_EH_INFO macro. - (uncaught_exception): Use CP_EH_INFO macro. - -Tue Dec 8 10:48:21 1998 Jeffrey A Law (law@cygnus.com) - - * Make-lang.in (cxxmain.o): Depend on $(DEMANGLE_H), not demangle.h - -Mon Dec 7 17:56:06 1998 Mike Stump - - * lex.c (check_newline): Add support for \ as `natural' - characters in file names in #line to be consistent with #include - handling. We support escape processing in the # 1 "..." version of - the command. See also support in cp/lex.c. - -1998-12-07 Zack Weinberg - - * cp/decl2.c: s/data/opts/ when initializing cpp_reader - structure. - -1998-12-07 Jason Merrill - - * decl.c (build_typename_type): Set DECL_ARTIFICIAL. - - * error.c (dump_simple_decl): Also print namespace context. - (dump_function_decl): Likewise. - - * decl2.c (ambiguous_decl): Don't print old value if it's - error_mark_node. - - * decl.c (lookup_name_real): Fix handling of local types shadowed - by a non-type decl. Remove obsolete code. - * cp-tree.h (DECL_FUNCTION_SCOPE_P): New macro. - - * lang-options.h: Add -fpermissive. - * decl2.c: Likewise. - * cp-tree.h: Add flag_permissive. - * decl.c (init_decl_processing): If neither -fpermissive or -pedantic - were specified, set flag_pedantic_errors. - * call.c (build_over_call): Turn dropped qualifier messages - back into pedwarns. - * cvt.c (convert_to_reference): Likewise. - * typeck.c (convert_for_assignment): Likewise. - -1998-12-05 Jason Merrill - - * decl2.c (coerce_new_type): Use same_type_p. - (coerce_delete_type): Likewise. - - * call.c (check_dtor_name): Return 1, not error_mark_node. - -1998-12-04 Jason Merrill - - * lex.c (handle_cp_pragma): Disable #pragma interface/implementation - if MULTIPLE_SYMBOL_SPACES. - - * pt.c (check_template_shadow): New fn. - * decl2.c (grokfield): Use it. - * decl.c (pushdecl): Likewise. - (pushdecl_class_level): Likewise. - (start_method): Likewise. - (xref_tag): Don't try to use 't' if we're defining. - - * call.c (check_dtor_name): Just return an error_mark_node. - * pt.c (lookup_template_class): Complain about using non-template here. - * parse.y (apparent_template_type): Not here. - - * pt.c (check_explicit_specialization): Complain about specialization - with C linkage. - - * lang-options.h: Add -f{no-,}implicit-inline-templates. - - * pt.c (convert_nontype_argument): Don't assume that any integer - argument is intended to be a constant-expression. - -1998-12-03 Mark Mitchell - - * class.c (handle_using_decl): Fix comment. Don't lookup - constructors in base classes. - (validate_lhs): Fix typo in comment. - * search.c (lookup_field_1): Don't return a USING_DECL. - - * cp-tree.h (DECL_ACCESS): Improve documentation. - - * decl.c (expand_static_init): Don't set the initialization-done - flag until the initialization is done. - -1998-12-02 Mark Mitchell - - * decl2.c (validate_nonmember_using_decl): Complain about using - declarations for class members. - -1998-11-29 Jason Merrill - - * typeck2.c (process_init_constructor): Use same_type_p. - - * decl.c (check_tag_decl): Don't warn about null decl inside a - class. - - * pt.c (unify, case OFFSET_TYPE): Pass down 'strict' rather than - UNIFY_ALLOW_NONE. - (convert_nontype_argument): Use TYPE_PTRMEMFUNC_FN_TYPE. - (resolve_overloaded_unification): Strip baselinks. - -Fri Nov 27 13:07:23 1998 Kaveh R. Ghazi - - * g++spec.c: Don't prototype xmalloc. - -1998-11-25 Jason Merrill - - * except.c (expand_throw): Use TYPE_PTR_P to check for pointers. - - * decl.c (check_tag_decl): Do complain about null friend decl at - file scope. - -1998-11-25 Andreas Schwab - - * lex.c (make_lang_type): Clear the whole struct lang_type, not - only the first multiple of sizeof (int). - -1998-11-24 Jason Merrill - - * decl.c (start_decl): An explicit specialization of a static data - member is only a definition if it has an initializer. - - * except.c (expand_throw): Use cp_finish_decl for the throw temp. - * cvt.c (build_up_reference): Pass DIRECT_BIND down into - cp_finish_decl. - * init.c (expand_default_init): Check for DIRECT_BIND instead of - DECL_ARTIFICIAL. - - * call.c (build_over_call): Use build_decl. - - * except.c (expand_throw): Just use convert, not - build_reinterpret_cast. - - * lex.c (handle_generic_pragma): Use token_buffer. - - * decl.c (check_tag_decl): Don't complain about null friend decl. - -1998-11-24 Dave Pitts - - * Make-lang.in (DEMANGLER_PROG): Move the output arguments to the - first position. - * lex.c (check_newline): Use ISALPHA. - (readescape): Use ISGRAPH. - (yyerror): Use ISGRAPH. - -1998-11-24 Nathan Sidwell - - * search.c (get_abstract_virtuals): Do not use initial - CLASSTYPE_ABSTRACT_VIRTUALS. - * typeck2.c (abstract_virtuals_error): Show location of abstract - declaration. - * call.c (build_new_method_call): Use - CLASSTYPE_ABSTRACT_VIRTUAL, rather than recalculate. - * class.c (finish_struct_bits): Don't bother working out whether - get_abstract_virtuals will do anything, just do it. - -1998-11-24 Graham - - * typeck.c (build_component_ref): Remove unused statement. - -1998-11-24 Jason Merrill - - * class.c (add_method): Catch invalid overloads. - - * class.c (add_method): Build up OVERLOADs properly for conversion ops. - * search.c (lookup_conversions): Handle getting real OVERLOADs. - (add_conversions): Likewise. Revert last change. - * call.c (add_conv_candidate): Pass totype to add_candidate instead - of fn. Don't add a new candidate if the last one was for the same - type. - (print_z_candidates): Handle getting a type as a function. - (joust): If we got two conversion candidates to the same type, - just pick one. - (build_object_call): Lose 'templates'. - (build_user_type_conversion_1): Handle getting real OVERLOADs. - -1998-11-23 Jason Merrill - - * typeck2.c (process_init_constructor): If there are elements - that don't have initializers and they need to have constructors - run, supply them with initializers. - - * class.c (finish_struct_1): A class with a 0-width bitfield is - still empty. - -1998-11-23 Mark Mitchell - - * pt.c (instantiate_class_template): Don't try to figure out what - specialization to use for a partial instantiation. Correct - typos in a couple of comments. Avoid calling uses_template_parms - multiple times. - -1998-11-23 Benjamin Kosnik - - * method.c (process_overload_item): Add call to - build_mangled_C9x_name for intTI_type_nodes. - (build_mangled_C9x_name): Add prototype, define. - * decl.c (init_decl_processing): Add names for - TImode_type_node. - -1998-11-23 Jason Merrill - - * parse.y (named_class_head): Update CLASSTYPE_DECLARED_CLASS. - - * class.c (finish_struct_1): Set things up for 0-width bitfields - like we do for others. - - * decl.c (check_tag_decl): New fn. - (shadow_tag): Split out from here. - * decl2.c (grok_x_components): Call it. - -1998-11-22 Jason Merrill - - * decl.c: Lose warn_about_return_type. - (grokdeclarator): Always complain about implicit int, except for - `main () { ... }'. - - * decl.c (tag_name): New fn. - (xref_tag): Complain about using typedef-name after class-key. - - * init.c (expand_vec_init): Also keep going if from_array. - - * tree.c (is_overloaded_fn): Also handle the output of - build_offset_ref. - - * decl.c (grokdeclarator): Use constructor_name when comparing - field name against enclosing class. - * class.c (finish_struct_anon): Likewise. - -1998-11-22 Mark Mitchell - - * decl.c (poplevel): Remove code to handle KEEP == 2. - (finish_function): Don't confuse BLOCK-order when - processing a destructor. - -1998-11-21 Jason Merrill - - * decl.c (require_complete_types_for_parms): Call layout_decl - after we've completed the type. - -1998-11-21 Martin von Löwis - - * decl2.c (validate_nonmember_using_decl): Allow using templates - from the global namespace. - -1998-11-21 Jason Merrill - - Handle specifying template args to member function templates. - * tree.c (build_overload): Always create an OVERLOAD for a template. - * search.c (add_conversions): Handle finding an OVERLOAD. - * decl2.c (check_classfn): Likewise. - * lex.c (identifier_type): See through a baselink. - * parse.y (do_id): Don't call do_identifier if we got a baselink. - * class.c (instantiate_type, case TREE_LIST): Recurse. - - * decl.c (grokdeclarator): Allow a boolean constant for array - bounds, odd as that sounds. - - * pt.c (unify): Be more strict about non-type parms, except for - array bounds. - (UNIFY_ALLOW_INTEGER): New macro. - -1998-11-19 Manfred Hollstein - - * Make-lang.in (mandir): Replace all uses of $(mandir) by $(man1dir). - -1998-11-19 Jason Merrill - - * semantics.c (begin_class_definition): Call - maybe_process_partial_specialization before push_template_decl. - Don't call push_template_decl for a specialization. - * search.c (lookup_field): Do return a member template class. - * decl2.c (handle_class_head): Handle member template classes. - - * decl.c (grokdeclarator): A parm type need not be complete. - - * pt.c (convert_nontype_argument): Fix thinko. - -1998-11-18 Mark Mitchell - - * cp-tree.h (PTRMEM_CST_CLASS): Fix typo. - (global_delete_fndecl): New variable. - * decl.c (global_delete_fndecl): Define it. - (init_decl_processing): Set it. - * init.c (build_builtin_delete_call): Use it. - * tree.c (mapcar): Recursively call mapcar for the type of EXPR - nodes. - -1998-11-18 Jason Merrill - - * decl.c (cplus_expand_expr_stmt): Always complain about unresolved - type. - - * tree.c (lvalue_p_1): An INDIRECT_REF to a function is an lvalue. - * call.c (build_object_call): Also support references to functions. - * typeck.c (convert_for_initialization): Don't decay a function - if the target is a reference to function. - - * search.c (add_conversions): Get all the overloads from a class. - - * decl.c (grok_ctor_properties): Complain about any constructor - that will take a single arg of the class type by value. - - * typeck2.c (build_functional_cast): Can't create objects of - abstract classes this way. - * cvt.c (ocp_convert): Likewise. - - * decl.c (grokfndecl): Member functions of local classes are not - public. - -1998-11-18 Mark Mitchell - - * Make-lang.in (cc1plus): Add dependency on hash.o. - -1998-11-18 Jason Merrill - - * search.c (get_abstract_virtuals): Complain about virtuals with - no final overrider. - * typeck2.c (abstract_virtuals_error): Remove handling for virtuals - with no final overrider. - * class.c (override_one_vtable): Don't set DECL_ABSTRACT_VIRTUAL_P - on virtuals with no final overrider. - - * lex.c (reinit_parse_for_block): Add a space after the initial ':'. - - * class.c (finish_struct_1): Don't remove zero-width bit-fields until - after layout_type. - - * friend.c (do_friend): Don't set_mangled_name_for_decl. - - * class.c (finish_struct_anon): Complain about non-fields. - * decl2.c (build_anon_union_vars): Likewise. - - * decl.c (grokdeclarator): Normal data members can't have the same - name as the class, either. - * class.c (finish_struct_anon): Neither can members of an - anonymous union. - -1998-11-17 Mark Mitchell - - * cp-tree.h (TYPE_ALIAS_SET): Document language-dependent uses. - (TYPE_BINFO): Likewise. - (IS_AGGR_TYPE): Tweak. - (SET_IS_AGGR_TYPE): New macro. - (CLASS_TYPE_P): Tweak. - (lang_type): Group mark bitfields together. Remove linenum. - (CLASSTYPE_SOURCE_LINE): Remove macro. - (CLASSTYPE_MARKED_N): New macro. - (SET_CLASSTYPE_MARKED_N): Likewise. - (CLEAR_CLASSTYPE_MARKED_N): Likewise. - (CLASS_TYPE_MARKED_*): Use them. - (SET_CLASSTYPE_MARKED_*): Likewise. - (CLEAR_CLASSTYPE_MARKED_*): Likewise. - (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. - (TYPE_TEMPLATE_INFO): Handle TEMPLATE_TEMPLATE_PARMs as well. - (TYPENAME_TYPE_FULLNAME): Use TYPE_BINFO rather than CLASSTYPE_SIZE. - * class.c (class_cache_obstack): New variable. - (class_cache_firstobj): Likewise. - (finish_struct): Don't set CLASSTYPE_SOURCE_LINE. - (pushclass): Free the cache, when appropriate. - (popclass): Tidy. - (maybe_push_cache_obstack): Use class_cache_obstack. - * decl.c (include hash.h). - (typename_hash): New function. - (typename_compare): Likewise. - (build_typename_type): Check the hash table to avoid creating - duplicates. - (build_ptrmemfunc_type): Use SET_IS_AGGR_TYPE. - (grokdeclarator): Use CLASS_TYPE_P. - (xref_basetypes): Likewise. - (start_function): Likewise. Don't put current_class_ref on the - permanent obstack. - * error.c (dump_type_real): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO - and TYPE_TI_ARGS. - * lex.c (note_got_semicolon): Use CLASS_TYPE_P. - (make_lang_type): Don't create TYPE_LANG_SPECIFIC and associated - fields for types other than class types. Do clear TYPE_ALIAS_SET - for types other than class types, though. - * method.c (build_overload_identifier): Use CLASS_TYPE_P and - TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. - * pt.c (process_template_parm): Don't set - CLASSTYPE_GOT_SEMICOLON. - (lookup_template_class): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. - Coerce arguments on the momentary obstack. - (for_each_template_parm): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. - (instantiate_class_template): Calculate template arguments on the - momentary obstack. Tidy. - (tsubst_template_arg_vector): Use make_temp_vec. - (tsubst_aggr_type): Put template arguments on the momentary - obstack. - (tsubst_decl): Likewise. - (tsubst): Copy the array bounds index to the permanent obstack - before building index types. Use new macros. - (unify): Use new macros. - (do_type_instantiation): Likewise. - * search.c (lookup_fnfields_1): Use new macros. - (dfs_pushdecls): Build envelopes on the cache obstack. - (dfs_compress_decls): Use new macros. - (push_class_decls): Build on the cache obstack. - * semantics.c (finish_typeof): Don't set CLASSTYPE_GOT_SEMICOLON. - * sign.c (build_signature_pointer_or_reference_type): Use - SET_IS_AGGR_TYPE. - * tree.c (make_binfo): Check CLASS_TYPE_P. - (copy_template_template_parm): Adjust. - (make_temp_vec): Use push_expression_obstack. - * typeck.c (complete_type): Use new macros. - (comptypes): Likewise. - -1998-11-17 Jason Merrill - - * pt.c (tsubst): Add diagnostics for invalid array, reference - and pointer to member types. - -1998-11-16 Jason Merrill - - * typeck2.c (my_friendly_abort): Don't fatal twice in a row. - - * typeck.c (c_expand_start_case): Use build_expr_type_conversion. - Simplify. - - * parse.y (structsp): Fix cut-and-paste error. - - * init.c (build_new): Complain about non-integral size. - - * parse.y (unary_expr): Complain about defining types in sizeof. - - * typeck.c (expr_sizeof): Complain about sizeof an overloaded fn. - - * rtti.c (build_x_typeid): Complain about typeid without - including . - (get_typeid): Likewise. Complain about typeid of incomplete type. - (get_tinfo_fn_dynamic): Likewise. - (get_typeid_1): Not static anymore. - * except.c (build_eh_type_type): Use get_typeid_1. - - * rtti.c (build_dynamic_cast_1): Give errors for dynamic_cast to - ambiguous or private bases. Fix warning for reference cast. - -1998-11-16 Mark Mitchell - - * cp-tree.h (DECL_TEMPLATE_INSTANTIATED): New macro. - * decl.c (duplicate_decls): Remove special-case code to deal with - template friends, and just do the obvious thing. - * pt.c (register_specialization): Tweak for clarity, and also to - clear DECL_INITIAL for an instantiation before it is merged with a - specialization. - (check_explicit_specialization): Fix indentation. - (tsubst_friend_function): Handle both definitions in friend - declaration and outside friend declarations. - (tsubst_decl): Don't clear DECL_INITIAL for an instantiation. - (regenerate_decl_from_template): Tweak accordingly. - (instantiate_decl): Likewise. - -1998-11-16 Jason Merrill - - * decl.c (cplus_expand_expr_stmt): Promote warning about naked - member function reference to error. - * cvt.c (ocp_convert): Complain about converting an overloaded - function to void. - - * init.c (build_offset_ref): Just return a lone static member - function. - - * decl.c (cp_finish_decl): Only complain about real CONSTRUCTORs, - not internal ones. - - * typeck.c (build_binary_op_nodefault): Improve error handling. - - * decl.c (grokfndecl): Complain about making 'main' a template. - - * typeck.c (string_conv_p): Don't convert from wchar_t[] to char*. - - * call.c (build_method_call): Handle a BIT_NOT_EXPR around a - TYPE_DECL in a template. - -1998-11-15 Jason Merrill - - * typeck2.c (my_friendly_abort): Add URL in the other case, too. - - * decl.c (struct cp_function): Add named_label_uses. - (push_cp_function_context): Save it. - (pop_cp_function_context): Restore it. - (define_label): Also complain about jumping into the scope of - non-POD objects that don't have constructors. - * tree.c (pod_type_p): New fn. - - * pt.c (instantiate_class_template): Clear TYPE_BEING_DEFINED sooner. - * rtti.c (synthesize_tinfo_fn): Call import_export_decl here. - (get_tinfo_fn): Not here. - * repo.c (repo_get_id): Abort if we get called for an incomplete - type. - -1998-11-13 Mark Mitchell - - * except.c (expand_throw): Make sure first argument to - __cp_push_exception is of type `void*' to avoid spurious error - messages. - -1998-11-11 Jason Merrill - - * pt.c (try_one_overload): Take orig_targs again. Only check for - mismatches against them; we don't care what a previous call found. - (resolve_overloaded_unification): Adjust. - - * search.c (lookup_field): Don't return anything for a non-type - field from a dependent type. - * decl.c (grokdeclarator): Resolve SCOPE_REFs of the current class - in an array declarator. - (start_decl): Push into the class before looking for the field. - -1998-11-08 Mark Mitchell - - * method.c (build_overload_value): Handle REFERENCE_TYPE. - -1998-11-08 Martin von Löwis - - * decl.c (grokdeclarator): Allow namespace-scoped members if they - are friends. - -1998-11-08 Jason Merrill - - * pt.c (tsubst_decl): Don't mess with the global value of an - un-mangled DECL_ASSEMBLER_NAME. - -1998-11-03 Christopher Faylor - - * decl.c (init_decl_processing): Remove CYGWIN conditional - since CYGWIN is now able to deal with trapping signals. - -Sat Nov 7 15:48:02 1998 Kaveh R. Ghazi - - * cp-tree.h: Don't include gansidecl.h. - * exception.cc: Include gansidecl.h (since we don't include config.h) - * g++spec.c: Don't include gansidecl.h. - -1998-11-06 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Add defined_in_class. Decrease - size of dummy. - (DECL_DEFINED_IN_CLASS_P): New macro. - (TEMPLATE_PARMS_FOR_INLINE): Document. - (check_static_variable_definition): New function. - * decl.c (cp_finish_decl): Set DECL_DEFINED_IN_CLASS_P, if - appropriate. - (check_static_variable_definition): Split out from ... - (grokdeclarator): Here. - * pt.c (check_default_tmpl_args): New function, split out from ... - (push_template_decl_real): Here. - (instantiate_template): Fix comment. - -1998-11-04 Mark Mitchell - - * cp-tree.h (CP_TYPE_CONST_P): Make {0,1}-valued. - (CP_TYPE_VOLATILE_P): Likewise. - (CP_TYPE_RESTRICT_P): Likewise. - -1998-11-03 Mark Mitchell - - * pt.c (tsubst): Use build_index_type, not build_index_2_type. - -1998-11-02 Jason Merrill - - * class.c (instantiate_type): Be more helpful. - - * decl2.c (import_export_decl): Call import_export_class. - - * cp-tree.h (EMPTY_CONSTRUCTOR_P): Check !TREE_HAS_CONSTRUCTOR. - * decl2.c (build_expr_from_tree): Propagate TREE_HAS_CONSTRUCTOR. - * pt.c (tsubst_copy): Likewise. - -1998-11-02 Mark Mitchell - - * init.c (expand_vec_init): Fix off-by-one error. - -1998-11-02 Alexandre Oliva - - * parse.y (apparent_template_type): New type. - (named_complex_class_head_sans_basetype): Use it. - * Makefile.in (CONFLICTS): One new conflict. - * parse.c: Regenerated. - -1998-11-01 Mark Mitchell - - * cp-tree.h (COMPARE_STRICT): New macro. - (COMPARE_BASE): Likewise. - (COMPARE_RELAXED): Likewise. - (COMPARE_REDECLARATION): Likewise. - (same_type_p): Likewise. - (same_or_base_type_p): Likewise. - * call.c (standard_conversion): Use them, in place of comptypes - with numeric arguments. - (reference_binding): Likewise. - (convert_like): Likewise. - (build_over_call): Likewise. - (is_subseq): Likewise. - (is_properly_derived_from): Likewise. - (compare_ics): Likewise. - (joust): Likewise. - * class.c (delete_duplicate_fields_1): Likewise. - (resolves_to_fixed_type_p): Likewise. - (instantiate_type): Likewise. Remove #if 0'd code. - * decl.c (decls_match): Likewise. Use COMPARE_REDECLARATION here. - (pushdecl): Likewise. - (lookup_name_real): Likewise. - (grokdeclarator): Likewise. Check for illegal array declarations. - (grokparms): Likewise. - (grok_op_properties): Likewise. - * decl2.c (check_classfn): Likewise. - * friend.c (is_friend): Likewise. - (make_friend_class): Likewise. - * init.c (expand_aggr_init): Likewise. - (expand_vec_init): Likewise. - * pt.c (is_member_template_class): Remove declaration. - (is_specialization_of): Use COMPARE_* and new macros. - (comp_template_parms): Likewise. - (convert_nontype_argument): Likewise. - (coerce_template_template_parms): Likewise. - (template_args_equal): Likewise. - (lookup_template_class): Likewise. - (type_unification_real): Likewise. - (unify): Likewise. - (get_bindings_real): Likewise. - * search.c (covariant_return_p): Likewise. - (get_matching_virtual): Likewise. - * sig.c (match_method_types): Likewise. - * tree.c (vec_binfo_member): Likewise. - (cp_tree_equal): Likewise. - * typeck.c (common_type): Likewise. - (comp_array_types): Likewise. Get issues involving unknown array - bounds right. - (comptypes): Update comments. Use new flags. - (comp_target_types): Use new macros. - (compparms): Likewise. - (comp_target_parms): Likewise. - (string_conv_p): Likewise. - (build_component_ref): Likewise. - (build_indirect_ref): Likewise. - (build_conditional_expr): Likewise. - (build_static_cast): Likewise. - (build_reinterpret_cast): Likewise. - (build_const_cast): Likewise. - (build_modify_expr): Likewise. - (convert_for_assignment): Likewise. - (comp_ptr_ttypes_real): Likewise. - (ptr_reasonably_similar): Likewise. - (comp_ptr_ttypes_const): Likewise. - -1998-10-31 Jason Merrill - - * rtti.c (build_dynamic_cast_1): Fix cut-and-paste error. - -1998-10-30 Mark Mitchell - - * decl2.c (delete_sanity): Pass integer_zero_node, not - integer_two_node, to build_vec_delete. - * init.c (build_array_eh_cleanup): Remove. - (expand_vec_init_try_block): New function. - (expand_vec_init_catch_clause): Likewise. - (build_vec_delete_1): Don't deal with case that auto_delete_vec - might be integer_two_node anymore. - (expand_vec_init): Rework for initialization-correctness and - exception-correctness. - * typeck2.c (process_init_constructor): Make mutual exclusivity - of cases more obvious. - -1998-10-29 Jason Merrill - - * decl.c (lookup_name_real): OK, only warn if not lexing. - Simplify suggested fix. - - * cp-tree.h (IDENTIFIER_MARKED): New macro. - * search.c (lookup_conversions): Use breadth_first_search. - (add_conversions): Avoid adding two conversions to the same type. - (breadth_first_search): Work with base binfos, rather - than binfos and base indices. - (get_virtual_destructor): Adjust. - (tree_has_any_destructor_p): Adjust. - (get_matching_virtual): Adjust. - - * pt.c (push_template_decl_real): Generalize check for incorrect - number of template parms. - (is_member_template_class): #if 0. - -1998-10-29 Richard Henderson - - * Makefile.in (cc1plus): Put CXX_OBJS, and thence @extra_cxx_objs@, - last. - -1998-10-28 Zack Weinberg - - * lex.c: Call check_newline from lang_init always. After - calling cpp_start_read, set yy_cur and yy_lim to read from the - cpplib token buffer. - -1998-10-28 Jason Merrill - - * class.c (instantiate_type): Don't consider templates for a normal - match. - - * class.c (finish_struct_1): Don't complain about non-copy - assignment ops in union members. - - * class.c (build_vtable): Don't pass at_eof to import_export_vtable. - (prepare_fresh_vtable): Likewise. - (finish_struct_1): Don't call import_export_class. - * decl2.c (finish_vtable_vardecl): Do import/export stuff. - (finish_prevtable_vardecl): Lose. - (finish_file): Don't call it. - * pt.c (instantiate_class_template): Likewise. - * cp-tree.h: Remove it. - - * init.c (build_delete): Reset TYPE_HAS_DESTRUCTOR here. - * decl.c (finish_function): Not here. - (start_function): Do set DECL_INITIAL. - - * pt.c (push_template_decl_real): Complain about default template - args for enclosing classes. - - * call.c (add_function_candidate): Treat conversion functions - as coming from the argument's class. - * cp-tree.h (DECL_CONV_FN_P): New fn. - (DECL_DESTRUCTOR_P): Also check DECL_LANGUAGE. - * class.c (add_method): Use DECL_CONV_FN_P. - * decl2.c (check_classfn): Likewise. - * error.c (dump_function_name): Likewise. - (dump_function_decl): Likewise. - * pt.c (fn_type_unification): Likewise. - * search.c (add_conversions): Likewise. - -1998-10-27 Jason Merrill - - * lex.c (do_identifier): Also generate LOOKUP_EXPR for RESULT_DECL. - * method.c (hack_identifier): Also check for using RESULT_DECL - from outer context. - -1998-10-27 Mark Mitchell - - * decl.c (grokdeclarator): Use type_quals, rather than constp, - consistently. - -1998-10-27 Jason Merrill - - * call.c (standard_conversion): instantiate_type here. - (reference_binding): And here. - (implicit_conversion): Not here. - (build_op_delete_call): No need to cons up an OVERLOAD. - * cvt.c (cp_convert_to_pointer): instantiate_type here. - (convert_to_reference): And here. - * decl.c (grok_reference_init): Not here. - (grokparms): Or here. - * typeck2.c (digest_init): Or here. - * typeck.c (decay_conversion): Take the address of overloaded - functions, too. - (require_instantiated_type): Lose. - (convert_arguments): Don't handle unknown types here. - (build_c_cast): Likewise. - (build_binary_op): Gut. - (build_conditional_expr): Don't require_instantiated_type. - (build_modify_expr): Likewise. - (build_static_cast): Don't instantiate_type. - (build_reinterpret_cast): Likewise. - (build_const_cast): Likewise. - (convert_for_initialization): Likewise. - (build_ptrmemfunc): Use type_unknown_p. - (convert_for_assignment): Also do default_conversion on overloaded - functions. Hand them off to ocp_convert. - -1998-10-26 Mark Mitchell - - * error.c (dump_decl): Deal with TEMPLATE_DECLs that are - VAR_DECLs. Handle vtables whose DECL_CONTEXT is not a type. - - * class.c (finish_struct_1): Use build_cplus_array_type to build - array types. - * decl.c (init_decl_processing): Likewise. - * except.c (expand_end_eh_spec): Likewise. - * search.c (expand_upcast_fixups): Simplify very slightly. - -1998-10-26 Jason Merrill - - * decl.c (grokdeclarator): Complain about a variable using - constructor syntax coming back null from start_decl. - - * friend.c (make_friend_class): Complain about trying to make - a non-class type a friend. - - * decl.c (grokfndecl): Set DECL_INITIAL for a defn here. - (start_function): Not here. - -1998-10-26 Brendan Kehoe - - * decl.c (grokdeclarator): Disallow `explicit' in a friend declaration. - -1998-10-26 Jason Merrill - - * typeck2.c (process_init_constructor): Only skip anonymous fields - if they are bitfields. - - * cp-tree.def (TYPEOF_TYPE): New code. - * error.c (dump_type_real): Handle it. - * pt.c (tsubst): Likewise. - * tree.c (search_tree): Likewise. - * semantics.c (finish_typeof): New fn. - * parse.y (typespec): Use it. - * cp-tree.h: Declare it. - -1998-10-26 Manfred Hollstein - - * cp-tree.h (FORMAT_VBASE_NAME): Make definition unconditional. - -1998-10-26 Jason Merrill - - * typeck.c (convert_arguments): Don't handle pmf references - specially. - - * init.c (build_member_call): Don't try to convert to the base type - if it's ambiguous or pedantic. - - * typeck2.c (check_for_new_type): Only depend on pedantic for - C-style casts. - -1998-10-25 Mark Mitchell - - * decl.c (grokdeclarator): Set DECL_NONCONVERTING_P for all - non-converting constructors. - -1998-10-24 Martin von Löwis - - * gxxint.texi: Correct documentation for n, N, Q, and B. - -1998-10-23 Martin von Löwis - - * parse.y (condition): Convert VAR_DECL from reference to indirect - reference. - -1998-10-23 Andrew MacLeod - - * exception.cc (__cp_pop_exception): Free the original exception - value, not the potentially coerced one. - -1998-10-23 Mark Mitchell - - * Makefile.in (hash.h): Run gperf when necessary. - - * cp-tree.h (CP_TYPE_READONLY): Remove. - (CP_TYPE_VOLATILE): Likewise. - (CP_TYPE_QUALS): New macro. - (CP_TYPE_CONST_P): Likewise. - (CP_TYPE_VOLATILE_P): Likewise. - (CP_TYPE_RESTRICT_P): Likewise. - (CP_TYPE_CONST_NON_VOLATILE_P): Likewise. - (cp_build_type_variant): Rename to ... - (cp_build_qualified_type): New function. - (c_apply_type_quals_to_decl): Declare. - (SIGNATURE_POINTER_NAME_FORMAT): Modify to allow `restrict'. - (SIGNATURE_REFERENCE_NAME_FORMAT): Likewise. - (cp_type_qual_from_rid): New function. - (compparms): Remove unused parameter. All callers changed. - (cp_type_quals): New function. - (at_least_as_qualified_p): Likewise. - (more_qualified_p): Likewise. - - * call.c (standard_conversion): Replace calls to - cp_build_type_variant with cp_build_qualified_type. Use - CP_TYPE_QUALS to get qualifiers and at_least_as_qualified_p to - compare them. Use CP_TYPE_* macros to check qualifiers. - (reference_binding): Likewise. - (implicit_conversion): Likewise. - (add_builtin_candidates): Likewise. - (build_over_call): Likewise. - * class.c (overrides): Compare all qualifiers, not just `const', - on method declarations. - * cvt.c (convert_to_reference): More CP_TYPE_QUALS conversion, etc. - (convert_pointer_to_real): Likewise. - (type_promotes_to): Likewise. - * decl.c (check_for_uninitialized_const_var): New function. - (init_decl_processing): More CP_TYPE_QUALS conversion, etc. - (cp_finish_decl): Use check_for_uninitialized_const_var. - (grokdeclarator): More CP_TYPE_QUALS conversion, etc. Update to - handle `restrict'. - (grok_ctor_properties): Likewise. - (grok_op_properties): Likewise. - (start_function): Likewise. - (rever_static_member_fn): Likewise. - * decl2.c (grok_method_quals): Likewise. - (grokfield): Likewise. - * error.c (dump_readonly_or_volatile): Rename to ... - (dump_qualifiers): New function. Handle `restrict'. - (dump_type_real): Use it. - (dump_aggr_type): Likewise. - (dump_type_prefix): Likewise. - (dump_type_suffix): Likewise. - (dump_function_decl): Likewise. - (cv_as_string): Likewise. - * gxx.gperf: Add __restrict and __restrict__. - * gxxint.texi: Document `u' as used for `__restrict', and a few - other previously undocumented codes. - * hash.h: Regenerated. - * init.c (expand_aggr_init): More CP_TYPE_QUALS conversion, etc. - (build_member_call): Likewise. - (build_new_1): Likewise. - * lex.c (init_parse): Add entry for RID_RESTRICT. - (cons_up_default_function): More CP_TYPE_QUALS conversion, etc. - (cp_type_qual_from_rid): Define. - * lex.h (enum rid): Add RID_RESTRICT. - * method.c (process_modifiers): Deal with `restrict'. - * parse.y (primary): More CP_TYPE_QUALS conversion, etc. - * parse.c: Regenerated. - * pt.c (convert_nontype_argument): More CP_TYPE_QUALS conversion, etc. - (tsubst_aggr_type): Likewise. - (tsubst): Likewise. - (check_cv_quals_for_unify): Likewise. - (unify): Likewise. - * rtti.c (init_rtti_processing): Likewise. - (build_headof): Likewise. - (get_tinfo_var): Likewise. - (buidl_dynamic_cast_1): Likewise. Fix `volatile' handling. - (expand_class_desc): Likewise. - (expand_attr_desc): Likewise. - (synthesize_tinfo_fn): Likewise. - * search.c (covariant_return_p): Likewise. Fix `volatile' handling. - (get_matching_virtual): Likewise. - (expand_upcast_fixups): Likewise. - * sig.c (build_signature_pointer_or_reference_name): Take - type_quals, not constp and volatilep. - (build_signature_pointer_or_reference_type): Likewise. - (match_method_types): More CP_TYPE_QUALS conversion, etc. - (build_signature_pointer_constructor): Likewise. - (build_signature_method_call): Likewise. - * tree.c (build_cplus_array_type): Likewise. - (cp_build_type_variant): Rename to ... - (cp_build_qualified_type): New function. Deal with `__restrict'. - (canonical_type_variant): More CP_TYPE_QUALS conversion, etc. - (build_exception_variant): Likewise. - (mapcar): Likewise. - * typeck.c (qualif_type): Likewise. - (common_type): Likewise. - (comptypes): Likewise. - (comp_cv_target_types): Likewise. - (at_least_as_qualified_p): Define. - (more_qualified_p): Likewise. - (comp_cv_qualification): More CP_TYPE_QUALS conversion, etc. - (compparms): Likewise. - (inline_conversion): Likewise. - (string_conv_p): Likewise. - (build_component_ref): Likewise. - (build_indirect_ref): Likewise. - (build_array_ref): Likewise. - (build_unary_op): Likewise. - (build_conditional_expr): Likewise. - (build_static_cast): Likewise. - (build_c_cast): Likewise. - (build_modify_expr): Likewise. - (convert_For_assignment): Likewise. - (comp_ptr_ttypes_real): Likewise. - (cp_type_quals): New function. - -1998-10-23 Jason Merrill - - * cp-tree.h (CP_TYPE_READONLY): New macro to handle arrays. - (CP_TYPE_VOLATILE): Likewise. - * decl.c (grokdeclarator): Use them. - * tree.c (canonical_type_variant): Likewise. - -1998-10-22 Martin von Löwis - - * parse.y (named_class_head): Push into class while parsing the - base class list. - * decl2.c (push_scope, pop_scope): New functions. - * cp-tree.h: Declare them. - * init.c (build_new_1): Delay cleanup until end of full expression. - -1998-10-21 Jason Merrill - - * typeck.c (build_component_ref): Use of a type here is an error. - -1998-10-19 Jason Merrill - - Revamp references to member functions. - * method.c (hack_identifier): Call build_component_ref for a - reference to a member function. - * typeck.c (build_component_ref): Only return a single function - if it's static. Otherwise, return a COMPONENT_REF. - (build_x_function_call): Handle a COMPONENT_REF. - (build_unary_op): Handle all unknown-type things. - * decl2.c (arg_assoc): Handle COMPONENT_REF. - * class.c (instantiate_type): Complain if the function we get is a - nonstatic member function. Remove code for finding "compatible" - functions. - * pt.c (tsubst_copy): Handle NOP_EXPR. - * tree.c (build_dummy_object): New fn. - (maybe_dummy_object): New fn. - (is_dummy_object): New fn. - * cp-tree.h: Declare them. - * cvt.c (cp_convert_to_pointer): Use maybe_dummy_object. - * error.c (dump_expr, case OFFSET_REF): Use is_dummy_object. - * init.c (build_member_call): Use maybe_dummy_object and - is_dummy_object. - (build_offset_ref): Use maybe_dummy_object. - (resolve_offset_ref): Use is_dummy_object. - * typeck.c (build_x_function_call): Call build_dummy_object. - (unary_complex_lvalue): Call is_dummy_object. - - * typeck.c (build_component_addr): Make sure field is a field. - - * call.c (build_new_op): Delete obsolete code. - - * pt.c (tsubst, TEMPLATE*PARM*): Abort if we don't have any args. - -1998-10-18 Martin von Löwis - - * decl2.c (validate_nonmember_using_decl): Fix using-directives of - std if std is ignored. - -1998-10-18 Jason Merrill - - * decl.c (grokvardecl): Fix thinko. - - * decl.c (grokdeclarator): Embedded attrs bind to the right, - not the left. - - * parse.y (fn.def2): Fix 'attrs' format. - -1998-10-18 Alastair J. Houghton - - * Makefile.in (CONFLICTS): Update. - * parse.y (expr_or_declarator_intern): New rule. - (expr_or_declarator, direct_notype_declarator, primary, - functional_cast): Use it. - (notype_declarator_intern): New rule. - (notype_declarator, complex_notype_declarator): Use it. - -1998-10-17 Jason Merrill - - * decl.c (grokfndecl): Set DECL_CONTEXT to namespace if appropriate. - (grokvardecl): Likewise. - -Sat Oct 17 23:27:20 1998 Kaveh R. Ghazi - - * class.c (make_method_vec): Cast 1st argument of `bzero' to (PTR). - (add_method): Likewise for arguments 1 & 2 of `bcopy'. - - * decl.c (signal_catch): Mark with ATTRIBUTE_NORETURN. - - * pt.c (process_partial_specialization): Cast 1st argument of - `bzero' to (PTR). - - * tree.c (build_base_fields): Cast `base_align' to (int) when - comparing against one. - -1998-10-16 Mark Mitchell - - * decl.c (lookup_name_real): Handle template parameters for member - templates where said parameters have the same name as the - surrounding class. - - * decl.c (expand_static_init): Build cleanups before entering the - anonymous function used to do them to avoid access-checking - confusion. - - * decl.c (grokfndecl): Add back call to cplus_decl_attributes - accidentally removed by previous change, and make DECL_RTL here. - * class.c (add_method): Don't make DECL_RTL here. - - * pt.c (for_each_template_parm): Don't examine uninstantiated - default arguments. - -1998-10-16 Dave Brolley - - * lex.c (real_yylex): Fix unaligned access of wchar_t. - -1998-10-16 Mark Mitchell - - * class.c (add_method): Fix documentation to reflect previous - changes. Check for duplicate method declarations here. - * decl.c (decls_match): Handle FUNCTION_DECL vs TEMPLATE_DECL - correctly; such things never match. - (grokfndecl): Don't look for duplicate methods here. - * decl2.c (check_classfn): Don't assume names are mangled. - Don't add bogus member function declarations to a class before the - class type is complete. - (grokfield): Reformat error message. - * method.c (set_mangled_name_for_decl): Don't mangle names while - processing_template_decl. - -1998-10-16 Jason Merrill - - * typeck.c (build_indirect_ref): Complain about a pointer to data - member, too. - * typeck2.c (build_m_component_ref): Don't indirect a pointer to - data member. - * init.c (resolve_offset_ref): Don't undo the above. - - * cp-tree.h (DECL_C_BIT_FIELD, SET_DECL_C_BIT_FIELD): New macros. - (struct lang_decl_flags): Add `bitfield'. - * class.c (finish_struct_1): Use DECL_C_BIT_FIELD instead of - DECL_BIT_FIELD. - * decl2.c (grokbitfield, grok_alignof): Likewise. - * init.c (build_offset_ref): Likewise. - * typeck.c (build_component_addr, expr_sizeof): Likewise. - * cvt.c (build_up_reference): Don't crash if taking the address - returns error_mark_node. - - * decl.c (grokfndecl): Also check ctype when checking for ::main(). - -1998-10-15 Jason Merrill - - * decl.c (grokfndecl): ::main and __builtin_* get C linkage. - Do mangling here. - (grokdeclarator): Instead of here. - * friend.c (do_friend): Lose special handling of ::main and - __builtin_*. - * cp-tree.h (DECL_MAIN_P): Check for C linkage. - - * spew.c (yylex): Clear looking_for_typename if we got - 'enum { ... };'. - -1998-10-15 Mark Mitchell - - * class.c (maybe_warn_about_overly_private_class): Improve error - messages for class with only private constructors. - - * cp-tree.def (TYPENAME_TYPE): Add to documentation. - * cp-tree.h (TYPENAME_TYPE_FULLNAME): Document. - (build_typename_type): New function. - * decl.c (build_typename_type): Broken out from ... - (make_typename_type): Use it. - * search.c (lookup_field): Likewise. - -1998-10-14 Benjamin Kosnik - - * pt.c (convert_nontype_argument): Check against type_referred_to. - * decl.c (grokvardecl): Check for declarator name before building - DECL_ASSEMBLER_NAME. - -1998-10-14 Mark Mitchell - - * pt.c (lookup_template_class): Add comment. - (instantiate_class_template): Don't mark the _TYPE node for - member class templates as an instantiation. - -1998-10-14 Jason Merrill - - * decl.c (grokfndecl): Fix my thinko. - -1998-10-13 Jason Merrill - - * tinfo2.cc (fast_compare): Remove. - (before): Just use strcmp. - * tinfo.cc (operator==): Just use strcmp. - -1998-10-13 Klaus-Georg Adams - - * decl.c (grokfndecl): Don't check for linkage in `extern "C"' - declarations. - -1998-10-13 Mark Mitchell - - * cp-tree.h (specializations_of_same_template_p): Remove. - * search.c (get_template_base): Don't use it. - (get_template_base_recursive): Likewise. - * pt.c (specializations_of_same_template_p): Remove. - (unify): Don't use it. - (lookup_template_class): Find the correct parent when setting - CLASSTYPE_TI_TEMPLATE. - -1998-10-12 Jason Merrill - - * tinfo.cc (operator==): Always compare names. - -1998-10-12 Herman ten Brugge - - * decl.c (start_function): Fix cut-and-paste error. - -1998-10-12 Jason Merrill - - * inc/typeinfo: Add #pragma interface. - (operator!=): Just call operator==. - * tinfo.cc: Add #pragma implementation. - (operator==): Move from inc/typeinfo and tinfo2.cc. - Check __COMMON_UNRELIABLE instead of _WIN32. - - * typeck2.c (my_friendly_abort): Add URL. - -1998-10-12 Alastair J. Houghton - - * decl.c (start_method): Added extra parameter for attributes. - * cp-tree.h (start_method): Update prototype. - * parse.y (fn.def2): Update start_method parameter list. - -1998-10-11 Mark Mitchell - - * cp-tree.h (specializations_of_same_template_p): Declare. - * pt.c (specializations_of_same_template_p): New function. - (unify): Use it. - * search.c (get_template_base): Use it. - (get_template_base_recursive): Likewise. - -1998-10-10 Manfred Hollstein - - * decl2.c (start_objects): Add new variable `joiner' and - initialize it properly. - -1998-10-09 Mark Mitchell - - * search.c (expand_upcast_fixups): Tweak to match 1998-10-07 - change to vtable types. - - * cvt.c (ocp_convert): Avoid infinite recursion caused by - 1998-10-03 change. - -1998-10-08 Jason Merrill - - * pt.c (resolve_overloaded_unification): New fn. - (try_one_overload): Likewise. - (unify): Don't fail on unknown type. - (type_unification_real): Likewise. Use resolve_overloaded_unification - to handle an overloaded argument. - (template_args_equal): Split out... - (comp_template_args): From here. - (determine_specialization): Also allow a template with more - parms than were explicitly specified. - * cp-tree.h: Add template_args_equal. - * call.c (resolve_args): Remove TEMPLATE_ID_EXPR code. - -Thu Oct 8 15:58:30 1998 Anthony Green - - * semantics.c (finish_asm_stmt): Revert my 1998-09-28 - change. - -Thu Oct 8 06:00:19 1998 Jeffrey A Law (law@cygnus.com) - - * typeck.c (unsigned_type): Only return TItype nodes when - HOST_BITS_PER_WIDE_INT is >= 64 bits. - (signed_type): Likewise. - * decl.c (intTI_type_node, unsigned_intTI_type_node): Only declare - when HOST_BITS_PER_WIDE_INT is >= 64 bits. - (init_decl_processing): Only create TItype nodes when - HOST_BITS_PER_WIDE_INT is >= 64 bits. - * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Only declare - when HOST_BITS_PER_WIDE_INT is >= 64 bits. - -Wed Oct 7 12:32:44 1998 Kaveh R. Ghazi - - * Makefile.in (hash.h): Add -L KR-C -F ', 0, 0' flags to gperf. - (gxx.gperf): Update comments describing invocation flags. - (hash.h): Regenerate using gperf 2.7.1 (19981006 egcs). - -1998-10-07 Mark Mitchell - - * class.c (finish_struct_1): Add commentary on previous change. - - * cp-tree.h (vtbl_ptr_type_node): New variable. - * class.c (build_vtbl_ref): Don't indirect through the vptr; it's - already of the right type. - (finish_struct_1): Make the vptr be of type vtbl_ptr_type_node. - Simplify code to grow vtable. - * decl.c (vtbl_ptr_type_node): Define. - (init_decl_processing): Initialize it. - -1998-10-06 Mark Mitchell - - * cp-tree.def (PTRMEM_CST): New tree node. - * cp-tree.h (ptrmem_cst): New type. - (lang_type): Remove local_typedecls. - (dummy): Increase to 12 bits from 11. - (CLASSTYPE_LOCAL_TYPEDECLS): Remove. - (PTRMEM_CST_CLASS): New macro. - (PTRMEM_CST_MEMBER): Likewise. - (current_access_specifier): New variable. - (current_class_type): Remove duplicate declaration. - (finish_struct): Change prototype. - (unreverse_member_declarations): New function. - (pushdecl_class_level): Change prototype. - (grok_enum_decls): Remove. - (fixup_anonymous_union): New function. - (grok_x_components): Change prototype. - (tsubst_chain): Remove. - (finish_member_template_decl): Likewise. - (check_explicit_specialization): Fix indentation. - (finish_class_definition): Change prototype. - (finish_member_class_template): Likewise. - (finish_member_declaration): New function. - (check_multiple_declarators): Likewise. - * class.c (class_stack_node_t): New type. - (current_class_base): Remove. - (current_class_stack): Change type. - (current_access_specifier): New variable. - (grow_method): Remove. - (check_member_decl_is_same_in_complete_scope): Break out from - finish_struct. - (make_method_vec): New function. - (free_method_vec): Likewise. - (add_implicitly_declared_members): Break out from finish_struct_1. - (free_method_vecs): New variable. - (add_method): Rework for direct use from parser. - (handle_using_decl): Watch for NULL_TREE while iterating through - CLASSTYPE_METHOD_VEC. - (finish_struct_methods): Don't build CLASSTYPE_METHOD_VEC here; - just do some error-checking. - (warn_hidden): Change iteration through CLASSTYPE_METHOD_VEC. - (finish_struct_1): Simplify. Use add_implicitly_declared_members. - (finish_struct): Change prototype. Simplify; fields and methods - are already set up at this point. - (init_class_processing): Set up current_class_stack. - (pushclass): Save current_access_specifier. - (popclass): Restore it. - (currently_open_class): Simplify. - (build_self_reference): Remove use of CLASSTYPE_LOCAL_TYPEDECLS. - * decl.c (saved_scope): Add access_specifier. - (maybe_push_to_top_level): Save it. - (pop_from_top_level): Restore it. - (maybe_process_template_type_declaration): Use - finish_member_declaration. - (pushtag): Likewise. - (pushdecl_class_level): Don't return a value. - (fixup_anonymous_union): Break out from grok_x_components. - (shadow_tag): Use it. - (xref_tag): Complain about using an elaborated type specifier to - reference a template type parameter or typedef name. - (xref_basetypes): Don't set CLASSTYPE_LOCAL_TYPEDECLS. - (current_local_enum): Remove. - (build_enumerator): Call finish_member_declaration. - (grok_enum_decls): Remove. - * decl2.c (grok_x_components): Simplify. - (check_classfn): Change iteration through CLASSTYPE_METHOD_VEC. - (grokfield): Don't set CLASSTYPE_LOCAL_TYPEDECLS. - (merge_functions): Add to comment. - (arg_assoc_type): Prototype. - (arg_assoc): Pass as many arguments as there are parameters. - * error.c (dump_expr): Handle PTRMEM_CST. Improve handling of - OFFSET_REF. - * expr.c (cpls_expand_expr): Remove dead code. Handle - PTRMEM_CST. - * friend.c (do_friend): Lookup friends when in nested classes. - Change comments. - * init.c (build_offset_ref): Do lookup even for classes that are - only partially defined. - (decl_constant_value): Remove dead code. - * method.c (build_overload_value): Remove hack where by TYPE was - not a TYPE. Handle PTRMEM_CST. - (build_template_parm_names): Don't pass a PARM_DECL where a TYPE - should go. - * parse.y (components, notype_components, component_decl, - component_decl_1, component_declarator, component_declarator0): - Now all are itype rather than ttype. Rework to add members to - classes on the fly. - (typesqpecqual_reserved): Use check_multiple_declarators. - (structsp): Update class to finish_class_definition. - (do_xref_defn): Unsplit into named_class_head. - (access_specifier): Set current_access_specifier. - * pt.c (set_current_access_from_decl): New function. - (finish_member_template_decl): Don't take the parameters. - (comp_template_args): Make more robust. - (lookup_template_class): Don't use current_local_enum. - (for_each_template_parm): Handle PTRMEM_CST. - (instantiate_class_template): Use set_current_access_from_decl, - finish_member_declaration and unreverse_member_declarations. Set - lineno/input_filename before generating implicit member functions. - (type_unification_real): Don't assume back-unification happens - only for the last argument. - (regenerate_decl_from_template): Call pushclass a bit earlier. - (tsubst_chain): Remove. - (tsubst_enum): Use set_current_access_from_decl. - (set_mangled_name_for_template_decl): Fix indentation. - * search.c (lookup_fnfields_1): Change iteration through - CLASSTYPE_METHOD_VEC. - (dfs_pushdecls): Likewise. - (dfs_compress_decls): Likewise. - (add_conversions): Likewise. - * semantics.c (finish_class_definition): Don't take components. - Change call to finish_struct. - (finish_member_declaration): New function. - (finish_member_class_template): Don't take template parameters. - Change call to grok_x_components. Call finish_member_template_decl. - (check_multiple_declarators): New function. - * sig.c (append_signature_fields): Work from the TYPE_METHODS, not - a passed in fieldlist. - * tree.c (search_tree): Handle PTRMEM_CST. - (mapcar): Likewise. - * typeck.c (unary_complex_lvalue): Build PTRMEM_CSTs, not - INTEGER_CSTs, for pointer-to-data members. - - * call.c (resolve_args): Resolve template specializations, if - possible. - -Tue Oct 6 07:57:26 1998 Kaveh R. Ghazi - - * Makefile.in (spew.o): Depend on toplev.h. - - * call.c (compare_ics): Initialize variables `deref_from_type2', - `deref_to_type1' and `deref_to_type2'. - - * except.c (get_eh_type): Hide prototype and definition. - (process_start_catch_block_old): Remove unused static prototype. - - * pt.c (tsubst_decl): Initialize variable `argvec'. - - * spew.c: Include toplev.h. - -1998-10-05 Jason Merrill - - * pt.c (instantiate_decl): Do save and restore file position. - -1998-10-05 Martin von Löwis - - * method.c (build_decl_overload_real): Clear - numeric_output_need_bar after __. - -1998-10-05 Nathan Sidwell - - * call.c (build_new_method_call): Issue 'incomplete type' error, - if class is not defined. - -1998-10-05 Kaveh R. Ghazi - - * call.c (build_object_call): Move declaration of variable - `fn' into the scope where it is used. Don't access variable - `fn' when it is uninitialized, instead use `fns'. - -1998-10-04 Theodore Papadopoulo - - * errfn.c (cp_thing): Print buf as a string not as a printf format - to avoid problems with the operator%. Consequently, `%%' sequences - in format are copied as `%' in buf. - -1998-10-04 Jason Merrill - - * pt.c (pop_tinst_level): Call extract_interface_info. - (instantiate_decl): Don't save and restore file position. - - * decl.c (cp_finish_decl): Make statics in extern inlines and - templates common, if possible and the target doesn't support weak - symbols. - - * decl.c (grokdeclarator): Remove redundant calls to - build_type_variant and some duplicated code. - * sig.c (build_signature_reference_type): Only take the type parm. - (build_signature_pointer_type): Likewise. - * tree.c (build_cplus_method_type): Adjust. - * cp-tree.h: Update. - -1998-10-04 Mark Mitchell - - * call.c (build_over_call): Make pedwarns about dropped qualifiers - into full-fledged errors. - * cvt.c (convert_to_reference): Likewise. - * typeck.c (convert_for_assignment): Likewise. - - * search.c (expand_upcast_vtables): In addition to unsetting - TREE_READONLY, remove top-level const type qualifier. - -1998-10-03 Mark Mitchell - - * class.c (current_class_ptr, current_class_ref): Clarify - documentation. - * cvt.c (ocp_convert): Don't expect fold to remove all trivial - NOP type conversions. - * decl.c (decls_match): Use comptypes directly; ignore - qualifiers on the DECL. - (duplicate_decls): Remove qualifier checks on DECL. - (grokdeclarator): Make the type built up include top-level - qualifiers. - * decl2.c (do_dtors): Fix spelling error. - * error.c (dump_simple_decl): Don't look at qualifiers on the decl - when printing type information. - * init.c (build_new_1): Add documentation. Deal with the fact - that type of allocated memory now contains qualifiers. - * lex.c (is_global): Improve error-recovery. - * sig.c (build_member_function_pointer): Don't cast away const - on fields of sigtable_entry_type. - * tree.c (lvalue_type): Don't look at top-level qualifiers on - expressions. - * typeck.c (decay_conversion): Likewise. - (build_component_ref): Make sure the type of the COMPONENT_REF - contains top-level qualifiers, as appropriate. Improve - error-handling. - (build_indirect_ref): Simplify. Don't strip top-level qualifiers. - (build_array_ref): Likewise. - (build_unary_op): Improve error-recovery. - (unary_complex_lvalue): Make taking the address a bound member - function an error, not a sorry. - (build_conditional_expr): Look at the type qualifiers, not the - qualifiers on the expression itself. - -1998-10-03 Jason Merrill - - * decl2.c (merge_functions): Remove duplicates. - - * decl2.c: Add -f{no-,}implicit-inline-templates. - (import_export_decl): Check it. - - * decl.c (lookup_name_real): Template parms also take precedence - over implicit typename. Only warn if yylex. - - * typeck.c (build_conditional_expr): Only fold if ifexp is an - INTEGER_CST. - - * decl2.c (finish_vtable_vardecl): Check DECL_INTERFACE_KNOWN - instead of linkage. - -1998-10-01 Jason Merrill - - * cp-tree.h (FORMAT_VBASE_NAME): New macro. - * class.c (build_vbase_pointer): Use it. - * rtti.c (expand_class_desc): Likewise. - * tree.c (build_vbase_pointer_fields): Likewise. - -Thu Oct 1 10:43:45 1998 Nick Clifton - - * decl.c (start_decl): Add invocation of - SET_DEFAULT_DECL_ATTRIBUTES, if defined. - (start_function): Add invocation of - SET_DEFAULT_DECL_ATTRIBUTES, if defined. - - * lex.c: Replace occurrences of HANDLE_SYSV_PRAGMA with - HANDLE_GENERIC_PRAGMAS. - -1998-09-28 Anthony Green - - * semantics.c (finish_asm_stmt): Always permit volatile asms. - -1998-09-28 Mark Mitchell - - * decl.c (grokdeclarator): Tighten checks for invalid - destructors. Improve error-messages and error-recovery. - * decl2.c (check_classfn): Don't assume that mangled destructor - names contain type information. - -1998-09-25 Jason Merrill - - * search.c (get_base_distance): Remove assert. - - * decl2.c (build_anon_union_vars): Don't process a field with no - name. - (finish_anon_union): Also complain about local anon unions with no - members. - -1998-09-25 Martin von Löwis - - * decl.c (lookup_namespace_name): If the name is a namespace, - return it immediately. - -Fri Sep 25 11:45:38 1998 Kaveh R. Ghazi - - * cp-tree.h (define_case_label): Remove unused parameter. - (check_java_method): Likewise. - (grokclassfn): Likewise. - (expand_aggr_init): Likewise. - (build_x_delete): Likewise. - (maybe_end_member_template_processing): Likewise. - (unshare_base_binfos): Add prototype. - (string_conv_p): Likewise. - (my_friendly_abort): Mark with ATTRIBUTE_NORETURN. - - * cvt.c (build_up_reference): Remove unused parameter - `checkconst', all callers changed. - (build_type_conversion): Mark parameter `code' with - ATTRIBUTE_UNUSED. - (build_expr_type_conversion): Initialize variable `conv'. - - * decl.c (push_namespace): Initialize variable `d'. - (define_case_label): Remove unused parameter `decl', all callers - changed. - - * decl2.c (lang_decode_option): If !USE_CPPLIB, mark parameter - `argc' with ATTRIBUTE_UNUSED. - (grokclassfn): Remove unused parameter `cname', all callers - changed. - (check_java_method): Likewise for parameter `ctype'. - (copy_assignment_arg_p): Mark parameter `virtualp' with - ATTRIBUTE_UNUSED. - (finish_prevtable_vardecl): Likewise for parameter `prev'. - - * expr.c (extract_init): Likewise for parameters `decl' and `init'. - - * init.c (expand_aggr_init_1): Remove unused parameter - `alias_this', all callers changed. - (expand_aggr_init): Likewise. - (expand_default_init): Likewise. - (build_new_1): Initialize variable `susp'. - (build_x_delete): Remove unused parameter `type', all callers - changed. - - * lex.c (set_typedecl_interface_info): Mark parameter `prev' with - ATTRIBUTE_UNUSED. - (readescape): Use (unsigned) value in shift. - (real_yylex): Likewise. Likewise. Also cast `sizeof' to int when - comparing to a signed quantity. - - * pt.c (maybe_end_member_template_processing): Remove unused - parameter `decl', all callers changed. - (check_explicit_specialization): Add braces around empty body in - an else-statement. - (current_template_args): Initialize variable `args'. - (lookup_template_class): Likewise for variable `prev_local_enum'. - (tsubst_decl): Likewise for variable `r'. - (set_mangled_name_for_template_decl): Initialize variable - `context'. - - * spew.c (scan_tokens): Change type of parameter `n' to unsigned. - Likewise for variable `i'. - (yylex): Initialize variable `trrr'. - - * typeck.c (compparms): Mark variable `strict' with - ATTRIBUTE_UNUSED. - - * xref.c (simplify_type): Cast argument of ctype function to - `unsigned char'. - -1998-09-24 Mark Mitchell - - * cp-tree.h (language_lvalue_valid): Remove. - * decl.c (grokdeclarator): Don't disallow references to functions. - * tree.c (lvalue_p_1): New function, combining duplicated - code from ... - (lvalue_p): Use it. - (real_lvalue_p): Likewise. - * typeck.c (language_lvalue_valid): Remove. - (build_modify_expr): Treat FUNCTION_TYPEs as readonly, even though - they don't have TREE_READONLY set. - * typeck2.c (readonly_error): Add case for FUNCTION_DECLs. - -1998-09-24 Benjamin Kosnik - - * spew.c (yylex): Give diagnostic. - * hash.h (is_reserved_word): Add export. - * gxx.gperf: Likewise. - * lex.h (rid): Add RID_EXPORT. - * lex.c (init_parse): Likewise. - -Tue Sep 22 21:01:19 1998 Gerald Pfeifer - - * friend.c (do_friend): Make warning a full sentence. - -1998-09-22 Mark Mitchell - - * parse.y (component_decl_list): Improve error-recovery. - -1998-09-22 Benjamin Kosnik - - * decl.c (make_typename_type): Move error to point where name - variable can be used by dump_type. - -1998-09-22 Mark Mitchell - - * decl.c (grokfndecl): Improve error-recovery. - * decl2.c (grokfield): Likewise. - * pt.c (finish_member_template_decl): Likewise. - -1998-09-20 Martin von Löwis - - * method.c (hack_identifier): Finding multiple members is always - an error. - -1998-09-21 Per Bothner - - * Make-lang.in (c++-filt): Link libiberty.a after cxxmain.o. - -Mon Sep 21 01:53:05 1998 Felix Lee - - * lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT (). - -1998-09-20 Mark Mitchell - - * class.c (maybe_warn_about_overly_private_class): Reformat. - -1998-09-17 Andrew MacLeod - - * exception.cc (__cplus_type_matcher): Realign some code. - -1998-09-16 Mark Mitchell - - * Make-lang.in (tinfo.o): Use CXXFLAGS when compiling. - (tinfo2.o): Likewise. - (exception.o): Likewise. - (new.o): Likewise. - (opnew.o): Likewise. - (opnewnt.o): Likewise. - (opvnew.o): Likewise. - (opvnewnt.o): Likewise. - (opdel.o): Likewise. - (opdelnt.o): Likewise. - (opvdel.o): Likewise. - (opvdelnt.o): Likewise. - -1998-09-16 Richard Henderson - - * decl.c (init_decl_processing): Kill __builtin_fp and __builtin_sp. - -1998-09-15 Alexandre Oliva - - * call.c (build_field_call): Handle static data members too. - - * typeck.c (comptypes): When comparing pointer types, check - whether referred types match even in strictest modes. - -1998-09-15 Mark Mitchell - - * cp-tree.h: Revert previous change. - (finish_struct_methods): Remove declaration. - * class.c: Revert previous change. - (maybe_warn_about_overly_private_class): New function. - (finish_struct_methods): Declare here, and make static. Remove - unnecessary parameters. Tidy slightly. Use - maybe_warn_about_overly_private_class. - (finish_struct_1): Adjust. Remove check for private constructors, - now done elsewhere. - (finish_struct): Adjust. - -1998-09-15 Andrew MacLeod - - * except.c (expand_start_catch_block): No need to check for new - exception model. - (process_start_catch_block_old): Deleted. - (process_start_catch_block): Add call to start_decl_1(). - (expand_end_catch_block): Add call to end_catch_handler(). - * exception.cc (__cplus_type_matcher): Only check the exception - language if there is an exception table. - -1998-09-15 Andrew MacLeod - - * search.c (expand_indirect_vtbls_init): Mark temporary stack slots - as used to prevent conflicts with virtual function tables. - -1998-09-14 Mark Mitchell - - * cp-tree.h (lang_type): Add has_non_private_static_mem_fn. - (CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN): New macro, to access it. - * class.c (maybe_class_too_private_p): New function. - (finish_struct_methods): Use it. - (finish_struct_1): Likewise. - (finish_struct): Set CLASSTYPE_HAS_NON_PRIVATE_STATIC_MEM_FN if - appropriate. - - * pt.c (check_specialization_scope): Fix spelling error. - (check_explicit_specialization): Remove code to handle explicit - specializations in class scope; they are now correctly diagnosed - as errors. - -1998-09-10 Mark Mitchell - - * decl.c (pushdecl): Don't copy types if the - DECL_ABSTRACT_ORIGIN of the new decl matches the TYPE_NAME of the - type. - -1998-09-09 Kriang Lerdsuwanakij - - * class.c (get_enclosing_class): New function. - (is_base_of_enclosing_class): Likewise. - * cp-tree.h (get_enclosing_class): Declare. - (is_base_of_enclosing_class): Likewise. - * pt.c (coerce_template_parms): Use them. - -1998-09-09 Jason Merrill - - * g++spec.c (lang_specific_driver): Check whether MATH_LIBRARY is - null to decide whether to use it. - - * error.c (dump_type_real): Handle NAMESPACE_DECL. - * parse.y (base_class.1): Avoid crash on error. - -1998-09-08 Martin von Löwis - - * decl.c (make_typename_type): If context is a namespace, the code - is in error. - -1998-09-08 Mumit Khan - - * parse.y (nomods_initdcl0): Set up the parser stack correctly. - -1998-09-08 Mark Mitchell - - * cp-tree.h (anonymous_namespace_name): Declare. - * decl.c: Define it. - (push_namespace): Use anonymous_namespace_name, rather than local - static anon_name. - * error.c (dump_decl): If a namespace is named - anonymous_namespace_name, call it {anonymous}. - - * decl.c (grokparms): Distinguish between references and pointers - in error message. - -1998-09-08 Richard Henderson - Mark Mitchell - - * pt.c (process_partial_specialization): Consistently allocate - and zero tpd.parms based on ntparms. Use tpd2.parms, not - tpd.parms, where appropriate. - -Sun Sep 6 00:00:51 1998 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (INCLUDES): Update after recent toplevel gcc - reorganizations. - -1998-09-05 Mark Mitchell - - * cp-tree.h (TI_PENDING_SPECIALIZATION_FLAG): Remove. - * class.c (finish_struct): Remove hackery to deal with explicit - specializations in class scope. - * decl.c (grokfndecl): Improve error-recovery. - * decl2.c (grokfield): Likewise. - * pt.c (check_specialization_scope): New function. - (begin_specialization): Call it. - (process_partial_specialization): New function, split out from - push_template_decl. Check partial specializations more - stringently. - (push_template_decl): Call it. - (check_explicit_specialization): Don't attempt to handle explicit - specializations in class scope. - (template_parm_data): Document. Add current_arg and - arg_uses_template_parms. - (mark_template_parm): Set it. - (tsubst_arg_types): Remove unused variable. - * semantics.c (begin_class_definition): Tweak. - -1998-09-04 Mark Mitchell - - * inc/typeinfo (type_info::type_info(const char*)): Make - `explicit'. - - * cp-tree.h (hash_tree_cons_simple): New macro. - * pt.c (tsubst_arg_types): New function. Use hash_tree_cons. - (coerce_template_parms): Use make_temp_vec, instead of - make_tree_vec. Document this behavior. - (lookup_template_class): Likewise. - (tsubst, cases METHOD_TYPE, FUNCTION_TYPE): Use tsubst_arg_types. - Remove dead code (and add assertion to check its deadness). Fix - bug w.r.t. exception specifications. - -1998-09-03 Jason Merrill - - * decl2.c (import_export_vtable): Always make artificials comdat. - (import_export_decl): Likewise. - * pt.c (mark_decl_instantiated): Likewise. - -1998-09-03 Mark Mitchell - - * cp-tree.h (finish_globally_qualified_member_call_expr): - Rename to ... - (finish_qualified_call_expr). - * semantics.c: Likewise. - * parse.y (primary): Use it. - * method.c (hack_identifier): Remove redundant code. - - * init.c (resolve_offset_ref): Call convert_from_reference to - handle members of reference type. Improve error recovery. - -1998-09-03 Benjamin Kosnik - - * cp-tree.h: Declare warn_nontemplate_friend. - * decl2.c (lang_decode_option): Set. - * lang-options.h: Add -Wnon-template-friend. - * friend.c (do_friend): Use to toggle non-template function warning. - -1998-09-03 Mark Mitchell - - * decl.c (finish_enum): Don't resolve CONST_DECLs to their - corresponding INTEGER_CSTs when processing_template_decl. - * pt.c (tsubst_enum): Tweak accordingly. - -1998-09-03 Benjamin Kosnik - - * decl.c (pushdecl_class_level): Add warning here. - (pushdecl): Tweak. - -1998-09-02 Jason Merrill - - * cvt.c (convert_pointer_to_real): Tidy. - * search.c (get_base_distance_recursive): Simplify. - (get_base_distance): Likewise. - - * pt.c (unify): Only special-case INTEGER_TYPE if it uses template - parms. - -Wed Sep 02 09:25:29 1998 Nick Clifton - - * lex.c (check_newline): Call HANDLE_PRAGMA before - HANDLE_SYSV_PRAGMA if both are defined. Generate warning messages - if unknown pragmas are encountered. - (handle_sysv_pragma): Interpret return code from - handle_pragma_token (). Return success/failure indication rather - than next unprocessed character. - (pragma_getc): New function: retrieves characters from the - input stream. Defined when HANDLE_PRAGMA is defined. - (pragma_ungetc): New function: replaces characters back into the - input stream. Defined when HANDLE_PRAGMA is defined. - -1998-09-01 Jason Merrill - - * decl2.c (output_vtable_inherit): Use %cDIGIT in the operands. - * class.c (build_vtable_entry_ref): Likewise. - -1998-09-01 Mark Mitchell - - * cp-tree.h (DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION): New macro. - * decl2.c (import_export_decl): Likewise. - * pt.c (instantiate_decl): Use it. - -1998-09-01 Jason Merrill - - * decl.c (lookup_name_real): Also do implicit typename thing for - artificial TYPE_DECLs. - * search.c (lookup_field): Likewise. - (lookup_fnfields, lookup_field): Adjust for implicit typename kludge. - * semantics.c (begin_constructor_declarator): Use enter_scope_of. - (enter_scope_of): Extract type from implicit typename. - (begin_class_definition): Likewise. - * lex.c (identifier_type): Handle implicit typename when checking - for SELFNAME. - - * cp-tree.h: Declare flag_strict_prototype. - * lex.c (do_scoped_id, do_identifier): Don't implicitly_declare if - -fstrict-prototype. - * decl.c (init_decl_processing): If -f{no,-}strict-prototype wasn't - specified, set it to the value of pedantic. - -1998-09-01 Mark Mitchell - - * decl2.c (arg_assoc): Handle template-id expressions as arguments. - -1998-08-31 Mark Mitchell - - * decl.c (finish_enum): Handle member enums of classes declared in - template functions. - - * decl2.c (grok_x_components): Strip attributes before calling - groktypename. - -1998-08-31 Jason Merrill - - * cp-tree.h, decl2.c: Remove support for -fall-virtual, - -fenum-int-equivalence and -fno-nonnull-objects. - * class.c (check_for_override): Remove support for -fall-virtual. - (finish_struct_1): Likewise. - * call.c (build_new_op): Remove support for -fenum-int-equivalence. - * typeck.c (build_binary_op_nodefault): Likewise. - * cvt.c (ocp_convert): Likewise. - * call.c (build_vfield_ref): Remove support for -fno-nonnull-objects. - * class.c (build_vbase_path): Likewise. - -Sun Aug 30 22:16:31 1998 H.J. Lu (hjl@gnu.org) - - * Makefile.in (INTERFACE): New, set to 1. - -1998-08-30 Mark Mitchell - - * error.c (dump_decl): Use CP_DECL_CONTEXT, not DECL_CONTEXT, when - comparing with global_namespace. - (dump_aggr_type): Likewise. - - * decl.c (grokfndecl): Issue error on declaration of friend - templates with explicit template arguments. - - * pt.c (convert_template_argument): New function, split out - from... - (coerce_template_parms): Here. - (tsubst): Attempt better error-recovery. - -1998-08-28 Benjamin Kosnik - - * pt.c (decl_template_parm_p): Add checks for - TEMPLATE_TEMPLATE_PARM. - -1998-08-28 Mark Mitchell - - * lex.c (do_identifier): Fix thinko in previous change. - -1998-08-28 Jason Merrill - - * search.c (dfs_search, binfo_for_vtable, dfs_bfv_helper): New fns. - * decl2.c (output_vtable_inherit): Call binfo_for_vtable. - -1998-08-28 Richard Henderson - - Add support for discarding unused virtual functions. - * lang-options.h: Add -fvtable-gc. - * cp-tree.h: Add flag_vtable_gc. - * decl2.c (output_vtable_inherit): New fn. - (finish_vtable_vardecl): Call it. - * class.c (build_vtable_entry_ref): New fn. - (build_vtbl_ref): Call it. - -1998-08-28 Mark Mitchell - - * cp-tree.h (build_enumerator): Take the enumeration type as a - parameter. - * decl.c (finish_enum): Don't set the TREE_TYPE for the - enumeration constant values if we're processing_template_decls. - Don't set the type for the CONST_DECLs either; that's done in - build_enumerator. - (build_enumerator): Take the enumeration type as a - parameter. - * lex.c (do_identifier): Don't resolve enumeration constants while - processing template declarations, even if they happen to be - TEMPLATE_PARM_INDEXs. - - * parse.y (current_enum_type): New variable. - (primary): Don't allow statement-expression in local classes just - as we don't in global classes. - (structsp): Use current_enum_type. - (enum_list): Likewise. - * pt.c (tsubst_enum): Don't check for NOP_EXPRs introduced by - finish_enum; they no longer occur. - - * cp-tree.h (finish_base_specifier): New function. - * parse.y (base_class): Use it. - * semantics.c (finish_base_specifier): Define it. - - * parse.y (structsp): Warn on use of typename outside of template - declarations. - -1998-08-27 Jason Merrill - - * lex.c (handle_cp_pragma): Remove #pragma vtable. - * lang-options.h: Remove +e options. - * decl2.c (lang_decode_option): Likewise. - (import_export_vtable): Don't check write_virtuals. - (finish_vtable_vardecl, finish_file): Likewise. - * search.c (dfs_debug_mark): Likewise. - * semantics.c (begin_class_definition): Likewise. - * class.c (build_vtable, finish_vtbls, finish_struct_1): Likewise. - - * call.c (build_over_call): Check flag_elide_constructors. - * decl2.c: flag_elide_constructors defaults to 1. - * typeck.c (convert_arguments): Remove return_loc parm. - (build_function_call_real): Adjust. - - * search.c: Tear out all mi_matrix and memoize code. - (lookup_field, lookup_fnfields): Use scratch_tree_cons. - * lang-options.h: Remove documentation for -fhandle-exceptions, - -fmemoize-lookups and -fsave-memoized. - * cp-tree.h: Lose mi_matrix and memoize support. - * decl2.c: Ignore -fmemoize-lookups and -fsave-memoized. - * class.c: Lose struct class_level. - (pushclass, popclass): Lose memoize support. - * init.c (build_offset_ref): Likewise. - - Never change BINFO_INHERITANCE_CHAIN. - * init.c (emit_base_init): Change modification of - BINFO_INHERITANCE_CHAIN to an assert. - * search.c (get_base_distance_recursive): Likewise. - (get_base_distance): Likewise. - (lookup_member): Likewise. - (convert_pointer_to_single_level): Likewise. - (lookup_field): Likewise. Lose setting TREE_VIA_* on TREE_LISTs. - (lookup_fnfields): Likewise. - * tree.c (propagate_binfo_offsets): Don't call unshare_base_binfos. - (unshare_base_binfos): Don't call propagate_binfo_offsets. - (layout_basetypes): Call propagate_binfo_offsets instead of - unshare_base_binfos. - * decl.c (xref_basetypes): Call unshare_base_binfos. - * pt.c (instantiate_class_template): Likewise. - * tree.c (reverse_path): Remove 'copy' parm; always make a - temporary copy. - * class.c (build_vbase_path): Just call it. - * search.c (compute_access): Likewise. Don't re-reverse. - -1998-08-27 Mark Mitchell - - * class.c (build_vbase_path): Use reverse_path. - (finish_base_struct): Move warnings for inaccessible bases to - layout_basetypes. - (modify_one_vtable): Remove check of TREE_USED (binfo). - (fixup_vtable_deltas1): Likewise. - * cp-tree.h (BINFO_INHERITANCE_CHAIN): Document here. - (xref_tag): Remove binfos parameter. - (make_binfo): Remove chain parameter. - (reverse_path): Add copy parameter. - * decl.c (init_decl_processing): Change calls to xref_tag. - (xref_tag): Remove binfos parameter. - (xref_basetypes): Change calls to make_binfo. - * decl2.c (grok_x_components): Change calls to xref_tag. - (handle_class_head): Likewise. - * friend.c (do_friend): Likewise. - * lex.c (make_lang_type): Change calls to make_binfo. - * parse.y (structsp): Change calls to xref_tag. - (named_complex_class_head_sans_basetype): Likewise. - (named_class_head): Likewise. - * rtti.c (init_rtti_processing): Likewise. - * search.c (compute_access): Change calls to reverse_path. - (dfs_get_vbase_types): Change calls to make_binfo. - (get_vbase_types): Remove dead code. - * tree.c (unshare_base_binfos): Change calls to make_binfo. - (layout_basetypes): Warn here about inaccessible bases. - (make_binfo): Remove chain parameter. - (reverse_path): Add copy parameter. - -1998-08-27 Jason Merrill - - * class.c: #if 0 complete_type_p. - * init.c (build_java_class_ref, build_new_1): Remove unused locals. - * method.c (process_overload_item): Likewise. - * typeck.c (comp_target_types): Likewise. - - Stop sharing binfos for indirect virtual bases. - * tree.c (propagate_binfo_offsets): Unshare vbases, too. - (layout_basetypes): Likewise. - (unshare_base_binfos): Copy vbases, too. - * cp-tree.h (BINFO_VIA_PUBLIC, BINFO_BASEINIT_MARKED, - BINFO_VBASE_INIT_MARKED): Remove obsolete macros. - (BINFO_PUSHDECLS_MARKED, SET_BINFO_PUSHDECLS_MARKED, - CLEAR_BINFO_PUSHDECLS_MARKED): New macros. - * search.c (lookup_field, lookup_fnfields, lookup_member): Remove - reference to BINFO_VIA_PUBLIC. - (marked_pushdecls_p, unmarked_pushdecls_p): New fns. - (push_class_decls): Use them. - (dfs_pushdecls): Use SET_BINFO_PUSHDECLS_MARKED. - (dfs_compress_decls): Use CLEAR_BINFO_PUSHDECLS_MARKED. - -1998-08-27 Mark Mitchell - - * decl.c (build_enumerator): Set DECL_CONTEXT for the - CONST_DECLs. - -1998-08-26 Mark Mitchell - - * cp-tree.h (finish_enum): Change prototype. - * decl.c (finish_enum): Use TYPE_VALUES, rather than taking a - VALUES parameter. Don't try to compute mins/maxs if - processing_template_decl. - * parse.y (structsp): Use new calling sequence for finish_enum. - * pt.c (tsubst_enum): Likewise. Take the new type as input. - (lookup_template_class): Remove unused variables. Tweak. - Register enums on instantiation list before substituting - enumeration constants. - (tsubst_decl): Remove unused variables. - (regenerate_decl_from_template): Likewise. - - * decl.c (duplicate_decls): Don't obliterate the - DECL_TEMPLATE_INFO for a template if we're not replacing it with - anything. - - * lex.c (do_identifier): Fix typo in comment. - -Wed Aug 26 10:54:51 1998 Kaveh R. Ghazi - - * errfn.c: Remove stdarg.h/varargs.h. - * tree.c: Likewise. - -1998-08-25 Brendan Kehoe - - * pt.c (tsubst_copy): Only do typename overloading on an - IDENTIFIER_NODE that happens to look like a typename if it actually - has a type for us to use. - -1998-08-25 Jason Merrill - - * typeck.c (comp_cv_target_types): Split out... - (comp_target_types): From here. Don't allow cv-qual changes under - a pointer if nptrs == 0. Fix OFFSET_TYPE handling. - (build_ptrmemfunc): Pass 1 to nptrs. - * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes. - -1998-08-25 Mark Mitchell - - * search.c (dependent_base_p): Don't compare a binfo to - current_class_type; use the TREE_TYPE of the binfo instead. - - * cp-tree.h (CLASS_TYPE_P): Revise definition. - -1998-08-25 Jason Merrill - - * decl.c (duplicate_decls): Don't complain about different - exceptions from an internal decl even if pedantic. - - * typeck.c (convert_for_assignment): Converting from pm of vbase - to derived is an error, not a sorry. - - * call.c (build_over_call): Use convert_pointer_to_real for 'this'. - * class.c (fixed_type_or_null): Rename from - resolves_to_fixed_type_p. Return the dynamic type of the - expression, if fixed, or null. - (resolves_to_fixed_type_p): Use it. Return 0 if the dynamic type - does not match the static type. - (build_vbase_path): Rename 'alias_this' to 'nonnull'. Use - resolves_to_fixed_type_p again. - -1998-08-24 Mark Mitchell - - * pt.c (tsubst_decl): Move special case code for dealing with - tricky friend templates here from ... - (regenerate_decl_from_template): Here. - -1998-08-24 Jason Merrill - - * decl.c (start_decl): Remove redundant linkage check. - -1998-08-24 Gavin Romig-Koch - - * typeck.c (c_expand_return): Handle the case that valtype - is wider than the functions return type. - -1998-08-24 Mark Mitchell - - * cp-tree.h (CLASS_TYPE_P): New macro. - * decl.c (grokdeclarator): Use it instead of IS_AGGR_TYPE. - * pt.c (process_template_parm): Undo previous change. - -1998-08-24 Benjamin Kosnik - - * cp-tree.h: Declare. - * pt.c (decl_template_parm_p): New function. - * decl.c (pushdecl): Check decls for redeclaring template parms. - (xref_tag): Make redeclaration an error, print decl. - * decl2.c (grokfield): Check field_decls for redeclaration as well. - -1998-08-24 Jason Merrill - - * parse.y (primary): Fix up the type of string constants. - -1998-08-24 Mark Mitchell - - * typeck.c (convert_for_initialization): Move check for odd uses - of NULL to avoid duplicate warnings. - -1998-08-24 Jason Merrill - - * tree.c (lvalue_type): Fix for arrays. - * typeck.c (string_conv_p): New fn. - (convert_for_assignment): Use it. - (build_unary_op): Use lvalue_type. - * call.c (standard_conversion, convert_like): Use string_conv_p. - (add_function_candidate): Use lvalue_type. - * cvt.c (convert_to_reference): Likewise. - * decl2.c (lang_decode_option): Ignore -traditional. - * decl.c (init_decl_processing): flag_writable_strings inhibits - flag_const_strings. - -1998-08-24 Andrew MacLeod - - * lang-options.h (lang_options): Add fconst-strings to the list - of valid options. - * decl2.c (lang_f_options, lang_decode_option): Likewise. - -1998-08-24 Nathan Sidwell - - * lex.c (real_yylex): Don't warn about long long constants if - we're allowing long long. - -1998-08-24 Martin von Löwis - - * decl.c (pushdecl): Use IDENTIFIER_NAMESPACE_VALUE instead of - accessing bindings directly. - - * search.c (my_tree_cons): Reimplement. - - * lang-specs.h: Remove __HONOR_STD. - * inc/exception, inc/new, inc/new.h, inc/typeinfo: Likewise. - -1998-08-23 Mark Mitchell - - * decl.c (grokdeclarator): Complain about in-class initialization - of aggregates and/or references. - * pt.c (process_template_parm): Clear IS_AGGR_TYPE for - TEMPLATE_TYPE_PARMs. - - * decl2.c (grok_array_decl): Add comment. - (mark_used): Don't instantiate an explicit instantiation. - * friend.c (make_friend_class): Remove bogus comment. Fix check - for partial specializations. - * pt.c (check_explicit_specialization): Don't - SET_DECL_EXPLICIT_INSTANTIATION here. - (mark_decl_instantiated): Or here. - (do_decl_instantiation): Do it here, instead. Add checks for - duplicate explicit instantiations, etc. Tidy. - (do_type_instantiation): Likewise. - (instantiate_decl): Improve comments. Complain about explicit - instantiations where no definition is available. - - * cp-tree.h (ansi_null_node): Remove. - * call.c (build_over_call): Warn about converting NULL to an - arithmetic type. - * cvt.c (build_expr_type_conversion): Likewise. Use - null_ptr_cst_p instead of expanding it inline. - * decl.c (ansi_null_node): Remove. - (init_decl_processing): Make null_node always have integral type. - * except.c (build_throw): Warn about converting NULL to an - arithmetic type. - * lex.c (init_parse): Remove handling of ansi_null_node. - * pt.c (type_unification_real): Don't convert NULL to void* type. - * typeck.c (build_binary_op_nodefault): Fix NULL warnings. - (convert_for_assignment): Warn about converting NULL to an - arithmetic type. - (convert_for_initialization): Likewise. - -1998-08-20 Jason Merrill - - * tree.c (search_tree, no_linkage_helper, no_linkage_check): New fn. - * pt.c (coerce_template_parms): Use no_linkage_check. - * decl.c (grokvardecl): Likewise. - (grokfndecl): Likewise. Members of anonymous types have no linkage. - - * method.c (process_overload_item): Remove useless code. - -1998-08-20 Per Bothner - - Handle new'ing of Java classes. - * init.c (build_class_classref): New function. - (build_new_1): If type is TYPE_FOR_JAVA: Call _Jv_AllocObject; - constructor does not return this; don't need to exception-protect. - - * pt.c (lookup_template_class): Copy TYPE_FOR_JAVA flag. - * decl2.c (acceptable_java_type): Handle template-derived types. - -1998-08-20 Per Bothner - - * decl2.c (import_export_vtable): Suppress vtables for Java classes. - -1998-08-20 Mark Mitchell - - * decl.c (duplicate_decls): Always merge the old and new patterns - for templates, regardless of whether or not the new one has - DECL_INITIAL. Don't throw away specializations. Merge - DECL_SAVED_TREE. - * pt.c (tsubst_decl): Use the right pattern when calculating the - complete args for a new template instance. - (do_decl_instantiation): Fix typo in comment. - (regenerate_decl_from_template): Deal with tricky friend template - case. - (instantiate_decl): Likewise. - -Thu Aug 20 09:09:45 1998 Jeffrey A Law (law@cygnus.com) - - * init.c (build_builtin_delete_call): Add missing assemble_external - call. - -1998-08-20 Jason Merrill - - * parse.y (notype_unqualified_id): Also accept ~A. - -1998-08-19 Mark Mitchell - - * typeck.c (build_binary_op_nodefault): Warn on use of NULL in - arithmetic. - * except.c (build_throw): Warn when NULL is thrown, even with - -ansi. Use ansi_null_node, rather than integer_zero_node, in the - thrown expression. - - * cp-tree.h (ansi_null_node): New variable. - * decl.c (ansi_null_node): New variable. - (init_decl_processing): Initialize its type. - * lex.c (init_parse): Initialize its value. Use ansi_null_node - for null_node in non-ANSI mode. - * typeck.c (build_binary_op_nodefault): Use ansi_null_node in - place of null_node to avoid spurious errors. - -1998-08-17 Mark Mitchell - - * cp-tree.h (enter_scope_of): New function. - * parse.y (complex_direct_notype_declarator): Use it. - * semantics.c (enter_scope_of): New function. - -1998-08-17 Jason Merrill - - * decl.c (grokparms): No, here. - - * decl.c (grokdeclarator): Catch parm with pointer to array of - unknown bound here... - * method.c (process_overload_item): ...not here. - - * gxxint.texi: Remove obsolete documentation of overloading code. - - * decl.c (finish_enum): Also set TYPE_SIZE_UNIT. - * class.c (finish_struct_bits): Likewise. - - * tree.c (lvalue_type): Fix for arrays. - * typeck.c (build_unary_op): Use lvalue_type. - * call.c (add_function_candidate): Likewise. - * cvt.c (convert_to_reference): Likewise. - - * decl2.c (lang_decode_option): Ignore -traditional. - - * init.c (build_offset_ref): Don't mess with error_mark_node. - * lex.c (do_scoped_id): Use cp_error. - - * rtti.c (get_tinfo_fn): Don't mess with the context for now. - -1998-08-17 Benjamin Kosnik - - * decl.c (grokdeclarator): Allow anonymous types to be cv-qualified. - -Mon Aug 17 10:40:18 1998 Jeffrey A Law (law@cygnus.com) - - * cp-tree.h (set_identifier_local_value): Provide prototype. - - * decl2.c (do_namespace_alias): Remove unused variables `binding' - and `old'. - -Fri Aug 14 16:42:27 1998 Nick Clifton - - * Makefile.in: Rename BBISON to BISON so that it can be properly - inherited from the parent makefile. - -1998-08-13 Jason Merrill - - * lang-options.h: Add -finit-priority. - * decl2.c: Likewise. Check flag_init_priority instead of - USE_INIT_PRIORITY. - - * decl2.c (setup_initp): New fn. - (start_objects, finish_objects, do_ctors): Handle init_priority. - (do_dtors, finish_file): Likewise. - -1998-08-13 Jason Merrill - - * pt.c (tsubst_copy): Hush warning. - - * rtti.c (get_tinfo_fn): Also set DECL_IGNORED_P. - -1998-08-12 Mark Mitchell - - * pt.c (print_template_context): Don't abort when instantiating a - synthesized method. - - * decl.c (grokdeclarator): Issue errors on namespace qualified - declarators in parameter lists or in class scope. - -1998-08-09 Mark Mitchell - - * pt.c (check_explicit_specialization): Don't abort on bogus - explicit instantiations. - -1998-08-07 Mark Mitchell - - * typeck.c (require_complete_type): Use complete_type_or_else. - (complete_type_or_else): Always return NULL_TREE on failure, as - documented. - - * pt.c (tsubst_aggr_type): Prototype. - (tsubst_decl): New function, split out from tsubst. Set - input_filename and lineno as appropriate. - (pop_tinst_level): Restore the file and line number saved in - push_tinst_level. - (instantiate_class_template): Set input_filename and lineno as - appropriate. - (tsubst): Move _DECL processing to tsubst_decl. Make sure the - context for a TYPENAME_TYPE is complete. - - * decl2.c (grokbitfield): Issue errors on bitfields declared with - function type. - (do_dtors): As in do_ctors, pretend to be a member of the same - class as a static data member while generating a call to its - destructor. - - * cvt.c (cp_convert_to_pointer): Handle NULL pointer - conversions, even in complex virtual base class hierarchies. - -1998-08-06 Mark Mitchell - - * cp-tree.h (ENUM_TEMPLATE_INFO): New macro. - (TYPE_TEMPLATE_INFO): Likewise. - (SET_TYPE_TEMPLATE_INFO): Likewise. - (ENUM_TI_TEMPLATE): Likewise. - (ENUM_TI_ARGS): Likewise. - (lookup_nested_type_by_name): Remove. - * decl.c (maybe_process_template_type_declaration): Handle enums. - (start_enum): Don't check for primary-template enum declarations - here. - (finish_enum): Clean up, document. Make sure template enum - constants get the correct type. - (build_enumerator): Copy initializers for template enumerations, - too. - (grok_enum_decls): Document. - * lex.c (do_identifier): Document use of LOOKUP_EXPR a bit - better. Build LOOKUP_EXPRs for local variables, even if they are - TREE_PERMANENT. - * pt.c (tsubst_enum): Remove field_chain parameter. - (template_class_depth): Include the depth of surrounding function - contexts. - (push_template_decl): Check for primary-template enum declarations - here. Deal with enumeration templates. - (lookup_template_class): Likewise. - (for_each_template_parm): Likewise. - (instantiate_class_template): Don't call tsubst_enum directly, - call tsubst instead, to instantiate enums. Deal with all - field_chain issues here, not in tsubst_enum. - (lookup_nested_type_by_name): Remove. - (tsubst_aggr_type): Revise handling of enumeration types. - (tsubst): Likewise. - (tsubst_copy): Likewise. - (tsubst_expr): Call tsubst, not tsubst_enum for TAG_DEFNs. - -1998-08-04 Mark Mitchell - - * decl.c (pushtag): Don't mangle the name of a TYPE_DECL if it - uses template parameters. - * method.c (build_template_parm_names): Use the full set of - template arguments for tsubst'ing. - (build_overload_identifier): Pass the full set of template - arguments to build_template_parm_names, not just the - innermost_args. - * pt.c (TMPL_ARGS_DEPTH): Define using - TMPL_ARGS_HAVE_MULTIPLE_LEVELS, for clarity. - (NUM_TMPL_ARGS): New macro. - (add_outermost_template_args): Deal with the case where the outer - args will be completely discarded. - (coerce_template_parms): Use the full set of template arguments - for tsubst'ing. Simplify. Add some asserts. Improve - error messages. - (lookup_template_class): Pass the full set of template arguments - to coerce_template_parms. - (tsubst): Add assertion. - (do_type_instantiation): Don't instantiate member template - classes. - - * init.c (build_offset_ref): Deal with a TEMPLATE_ID_EXPR whose - name is a LOOKUP_EXPR, rather than an IDENTIFIER_NODE. - -1998-08-03 Jason Merrill - - * method.c (set_mangled_name_for_decl): Change return type to void. - - * decl.c (lookup_name_real): A namespace-level decl takes priority - over implicit typename. Avoid doing the same lookup twice. - - * search.c (dependent_base_p): New fn. - (dfs_pushdecls, dfs_compress_decls): Use it. - - * typeck.c (get_member_function_from_ptrfunc): Don't try to handle - virtual functions if the type doesn't have any. - -1998-08-03 Mark Mitchell - - * decl2.c (grokfield): Don't mangle the name of a TYPE_DECL if it - uses template parameters. - -1998-08-02 Mark Mitchell - - * cp-tree.def (LOOKUP_EXPR): Document. Remove second argument. - * cp-tree.h (DECL_TI_TEMPLATE): Improve documentation. - * lex.c (do_identifier): Don't use a second argument, or a type, - when building LOOKUP_EXPRs. - (do_identifier): Likewise. - (do_scoped_id): Likewise. - * method.c (hack_identifier): Improve error message. - * pt.c (lookup_template_function): Don't needlessly call - copy_to_permanent or build_min. - (tsubst_copy): Remove #if 0'd code. tsubst into LOOKUP_EXPRs if - necessary. - (do_decl_instantiation): Improve error message. - * tree.c (mapcar, case LOOKUP_EXPR): Don't be sorry; make a copy. - (build_min): Copy the type to the permanent obstack, too. - -1998-08-01 Jason Merrill - - * init.c (init_init_processing): Remove BI* handling. - (build_builtin_call): Remove. - (build_builtin_delete_call): New fn. - (build_delete): Use it. - -1998-07-31 Mark Mitchell - - * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): New macro. - (maybe_check_template_type): New function. - * decl.c (maybe_process_template_type_declaration): New function, - split out from pushtag Call maybe_check_template_type. - (pushtag): Use it. Use PROCESSING_REAL_TEMPLATE_DECL_P. - (xref_tag): Use PROCESSING_REAL_TEMPLATE_DECL_P. - * friend.c (do_friend): Use PROCESSING_REAL_TEMPLATE_DECL_P. - * pt.c (template_class_depth_real): Generalization of ... - (template_class_depth): Use it. - (register_specialization): Use duplicate_decls for duplicate - declarations of specializations. - (maybe_check_template_type): New function. - (push_template_decl_real): Fix comment. - (convert_nontype_argument): Likewise. - (lookup_template_class): Likewise. Avoid an infinite loop on - erroneous code. - (tsubst_friend_function): Fix comment. - (tsubst, case FUNCTION_DECL): Deal with a DECL_TI_TEMPLATE that is - an IDENTIFIER_NODE. - * semantics.c (begin_function_definition): Use - reset_specialization to note that template headers don't apply - directly to declarations after the opening curly for a function. - -1998-07-29 Jason Merrill - - * decl.c (push_overloaded_decl): Use current_namespace instead of - DECL_CONTEXT (decl) to determine where we go. - - * decl.c (lookup_name_real): Fix typo. - -1998-07-28 Mark Mitchell - - * friend.c (is_friend): Be lenient with member functions to deal - with nested friends. - -1998-07-28 Jason Merrill - - * class.c (finish_struct_1): Convert integer_zero_node to - ssizetype before passing it to set_rtti_entry. - * typeck2.c (initializer_constant_valid_p): Allow conversion of 0 - of any size to a pointer. - -1998-07-27 Mark Mitchell - - * cp-tree.h (TI_USES_TEMPLATE_PARMS): Remove. - (build_template_decl_overload): Remove. - (set_mangled_name_for_decl): New function. - (innermost_args): Remove is_spec parameter. - (most_specialized, most_specialized_class): Remove declarations. - (lookup_template_class): Add entering_scope parameter. - (maybe_process_partial_specialization): New function. - (finish_template_decl): Likewise. - (finish_template_type): Likewise. - * class.c (finish_struct): Clean up processing of member template - specializations. - * decl.c (pushtag): Fix formatting. - (lookup_tag): Improve handling of pseudo-global levels. - (make_typename_type): Adjust call to lookup_template_class. - (shadow_tag): Use maybe_process_partial_specialization. - (xref_tag): Improve handling of member friends. - (start_function): Call push_nested_class before - push_template_decl. Don't call push_template_decl for - specializations. - * decl2.c (grok_x_components): Don't call xref_tag for - template instantiations. Handle UNION_TYPEs like RECORD_TYPEs. - (grokclassfn): Use set_mangled_name_for_decl. - (arg_assoc_class): Adjust call to innermost_args. - (mark_used): Don't call instantiate_decl for a TEMPLATE_DECL. - * error.c (dump_function_name): Improve printing of template - function names. - * friend.c (is_friend): Don't compare types of decls to determine - friendship, unless flag_guiding_decls. - (make_friend_class): Partial specializations cannot be friends. - (do_friend): Use set_mangled_name_for_decl. Call - push_template_decl_real instead of push_template_decl. - * method.c (build_decl_overload_real): Remove prototype. Give it - external linkage. - (build_overload_identifier): Adjust call to innermost_args. - (build_template_decl_overload): Remove. - (set_mangled_name_for_decl): New function. - * parse.y (.finish_template_type): New non-terminal. - (template_def): Use finish_template_decl. Use template_extdef - instead of extdef. - (template_extdef, template_datadef): New non-terminals, containing - only those rules for things which can be templates. - (datadef): Tidy. - (template_type, self_template_type): Use .finish_template_type. - (named_class_head): Use maybe_process_partial_specialization. - * pt.c (mangle_class_name_for_template): Remove context parameter. - (get_class_bindings): Remove outer_args parameter. - (complete_template_args): Remove. - (add_outermost_template_args): New function. - (register_specialization): Return the specialization. - (unregister_specialization): New function. - (tsubst_template_parms): Likewise. - (most_specialized, most_specialized_class): Prototype here as - static. - (original_template): Rename to most_general_template. - (tsubst_template_parms): New function. - (set_mangled_name_for_template_decl): Likewise. - (TMPL_ARGS_DEPTH): New macro. - (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): Adjust. - (TMPL_ARGS_LEVEL): New macro. - (SET_TMPL_ARGS_LEVEL): Likewise. - (TMPL_ARG): Likewise. - (SET_TMPL_ARG): Likewise. - (TMPL_ARGS_DEPTH): Likewise. - (finish_member_template_decl): Use finish_template_decl. - (maybe_process_partial_specialization): New function, split out - from tsubst. - (inline_needs_template_parms): Use TMPL_PARMS_DEPTH. - (maybe_begin_member_template_processing): Use new macros. - (is_member_template): Likewise. - (is_member_template_class): Likewise. - (add_to_template_args): Likewise. Deal with multiple levels of - args. - (maybe_process_partial_specialization): New function. - (retrieve_specialization): Add consistency check. - (determine_specialization): Return full argument list. - (check_explicit_specialization): Tweak friend handling. Use full - argument lists. Simplify. - (current_template_args): Use new macros. - (push_template_decl_real): Change ill-named mainargs to specargs. - Check that a partial specialization actually specializes at least - one parameter. Improve friend handling. Modify for full - template arguments. - (classtype_mangled_name): Don't mangle the names of - specializations. - (lookup_template_class): Add entering_scope parameter. Use it to - avoid finding a template type when an instantiation is required. - Simplify. Use full template arguments. - (tsubst_friend_function): Use unregister_specialization. Use new - macros. Use full template arguments. - (tsubst_friend_class): Substitute, using tsubst_template_parms, - into the template parameters before passing them to - redeclare_class_template. - (instantiate_class_template): Simplify. Use full template - arguments. Adjust calls to get_class_bindings. Use - SET_IDENTIFIER_TYPE_VALUE where needed. Improve friend handling. - (innermost_args): Use new macros. - (tsubst_aggr_type): New function, split out from tsubst. - (tsubst): Use tsubst_aggr_type, tsubst_template_parms, new calling - conventions for lookup_template_class. Refine handling of partial - instantiations. Remove calls to complete_template_args. - Simplify. Add consistency checks. Use set_mangled_name_for_decl - and set_mangled_name_for_template_decl. - (tsubst_copy): Use tsubst_aggr_type. - (instantiate_template): Use full template arguments. - (more_specialized): Improve formatting. - (more_specialized_class): Adjust calls to get_class_bindings. - (get_bindings_real): Don't call complete_template_args. - (most_specialized): Don't overwrite input; create a new list. - (most_specialized_class): Use most_general_template. - (regenerate_decl_from_template): Use unregister_specialization. - Use full template arguments. - (instantiate_decl): Use full template arguments. - (set_mangled_name_for_template_decl): New function. - * semantics.c (begin_class_definition): Use - maybe_process_partial_specialization. - (finish_member_class_template): New function. - (finish_template_decl): Likewise. - (finish_template_type): Likewise. - (typeck.c): Don't crash after issuing a compiler_error. - * Makefile.in (CONFLICTS): Adjust; we removed a s/r conflict. - -1998-07-27 Jason Merrill - - * typeck2.c (build_functional_cast): Handle default-initialization. - - * call.c (build_over_call): Pass 1 to popclass. - - * parse.y (direct_notype_declarator): Add precedence declaration - to notype_unqualified_id case. - * Makefile.in (EXPECT): Adjust. - - * tree.c (ovl_member): Fix for single function in OVL. - -1998-07-27 Dave Brolley - - * c-lex.c (yylex): Fix boundary conditions in character literal and - string literal loops. - -1998-07-24 Jason Merrill - - * decl.c (lookup_name_real): OK, do return the from_obj value - unless got_object depends on template parms. - - * parse.y (nested_name_specifier_1): Pull out the TYPE_MAIN_VARIANT. - - * pt.c (coerce_template_parms): Also complain about local enums. - - * cp-tree.h: Add prototype for set_identifier_local_value. - * decl.c (set_identifier_local_value_with_scope): Make static, - prototype. - * search.c (covariant_return_p): Likewise. - * except.c (build_terminate_handler, alloc_eh_object): Likewise. - - * call.c (build_method_call): Only pull out the type of a destructor - if it's a template type parm. - * decl.c (lookup_name_real): Never return the from_obj value. - -1998-07-23 Jason Merrill - - * except.c (process_start_catch_block_old): Call start_decl_1 for - catch parm. - * decl.c (start_decl_1): Avoid duplicate error. - - * init.c (expand_default_init): Only perform the initialization if - it will do something. - -1998-07-23 H.J. Lu (hjl@gnu.org) - - * parse.y (base_class): Check for invalid base class. - -1998-07-23 Jason Merrill - - * decl2.c (import_export_template): Fold in... - (import_export_class): ...to here. Handle dllimport/export. - - * class.c (build_vtable): Pass at_eof to import_export_vtable. - (prepare_fresh_vtable): Likewise. - * decl2.c (import_export_class): Split out... - (finish_prevtable_vardecl): From here. - * class.c (finish_struct_1): Call import_export_class if at_eof. - - * decl.c (start_function): #if 0 mysterious code I wrote and have - forgotten why. - * rtti.c (get_tinfo_fn): If this is for a class type, set - DECL_CONTEXT. - -1998-07-22 Jason Merrill - - * inc/exception: Change terminate and unexpected to (). - - * parse.y (named_class_head_sans_basetype_defn): A - named_class_head_sans_basetype followed by '{' or ':' is a defn. - -1998-07-21 Jason Merrill - - * tree.c (canonical_type_variant): New fn to handle arrays. - * cp-tree.h (CANONICAL_TYPE_VARIANT): Remove. - * pt.c (unify, default case): Also fold arg. Fix array bounds case. - * method.c (process_overload_item): Use build_overload_value for - arrays. - -1998-07-20 Dave Brolley - - * lex.c (mbchar.h): #include it. - (GET_ENVIRONMENT): New macro. - (init_parse): Set character set based on LANG environment variable. - (real_yylex): Handle multibyte characters in character literals. - (real_yylex): Handle multibyte characters in string literals. - -1998-07-19 Jason Merrill - - * lex.c (do_identifier): Look for class value even if we don't - have a global value. Do implicit declaration if parsing is 2. - * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig - lookup. - -1998-07-19 Mark Mitchell - - * decl.c (pushtag): Revert previous change. - * pt.c (lookup_template_class): Don't put out debugging - information for types that use template parameters. - - * decl.c (pushtag): Don't put out debugging information for - compiler-generated typedefs. - - * error.c (dump_type_real): Don't crash when presented with - intQI_type_node or the like. - - * semantics.c (finish_translation_unit): Fix spelling error in - comment. - -1998-07-17 Jason Merrill - - * decl.c (lookup_name_real): Pull out single function here. - (select_decl): Not here. - (unqualified_namespace_lookup): Use CP_DECL_CONTEXT. - - * decl.c (qualify_lookup): Tweak again. - - * pt.c (lookup_template_class): Don't mess with the context of the - instantiation. - * decl2.c (current_decl_namespace): Remove special handling for - templates. - - * pt.c (tsubst, case FUNCTION_DECL): Fix getting complete args for - a member template specialization. - - * tree.c (ovl_member): Use decls_match to compare functions. - * decl.c (decls_match): Check the context of a function. - - * parse.y (primary): Use notype_unqualified_id instead of IDENTIFIER - in Koenig lookup support rules. - * semantics.c (finish_call_expr): Handle the new cases. - - * typeck.c (build_x_function_call): Handle overloaded methods. - - * decl.c (grokvardecl): Don't call build_static_name for extern "C". - -1998-07-16 Mark Mitchell - - * semantics.c (finish_object_call_expr): Revert previous change. - * call.c (build_new_method_call): Likewise. Instead, convert - TYPE_DECLs to IDENTIFIERs here, in the presence of templates. - -1998-07-16 Jason Merrill - - * decl.c (qualify_lookup): Handle templates. - - * decl2.c (do_using_directive): Don't pass ancestor. - * decl.c (push_using_directive): Calculate ancestor. - - * decl2.c (do_nonmember_using_decl): Allow for type shadowing. - * decl.c (pushdecl): Move type shadowing handling from here... - (duplicate_decls): ...to here. - * decl.c (set_identifier_local_value_with_scope): New fn. - (pushdecl): Use it. - (set_identifier_local_value, lookup_type_current_level): New fns. - * decl2.c (do_local_using_decl): Handle types and binding level - stuff properly. - - * init.c (build_offset_ref): Don't call mark_used on an OVERLOAD. - * decl.c (select_decl): Extract a lone function from an OVERLOAD. - (lookup_namespace_name): Likewise. - * typeck.c (build_unary_op): Not here anymore. - - * decl2.c (do_class_using_decl): Make sure we get an identifier. - * class.c (handle_using_decl): Ignore TYPE_DECLs. - - * decl.c (qualify_lookup): New fn. - (lookup_name_real): Use it. - -1998-07-16 Martin v. Loewis - - * decl2.c (add_using_namespace): When directly using a namespace - that was indirect before, promote it. - - * cp-tree.h (LOOKUP_PREFER_TYPES, LOOKUP_PREFER_NAMESPACES, - LOOKUP_PREFER_BOTH, LOOKUP_NAMESPACES_ONLY, LOOKUP_TYPES_ONLY, - LOOKUP_QUALIFIERS_ONLY, LOOKUP_TEMPLATES_EXPECTED): New macros. - * decl.c (select_decl): Replace two flag parameters by one. - (unqualified_namespace_lookup): Likewise, pass flag. - (lookup_flags): New function. - (lookup_name_real): Compute flags, pass them. - (lookup_namespace_name): Call with zero-flag. - * decl2.c (ambiguous_decl): Add flag parameter, complain only - according to flags. - (lookup_using_namespace, qualified_lookup_using_namespace): - Add flag parameter, pass them through. - * lex.c (do_scoped_id): Call with zero-flag. - -1998-07-16 Jason Merrill - - * typeck.c (convert_for_assignment): Use comptypes. - -1998-07-16 Mark Mitchell - - * semantics.c (finish_object_call_expr): Move test for the - function called being a TYPE_DECL to ... - * call.c (build_new_method_call): Here. - -1998-07-15 Jason Merrill - - * decl2.c (arg_assoc_class): Also look at template arguments, if any. - (arg_assoc): Handle error_mark_node and multiple levels of TREE_LIST. - - * lex.c (looking_for_typename): Don't initialize. - - * decl2.c (ambiguous_decl): Clarify error message. - - * decl.c (push_using_directive): Iterate over namespaces used - indirectly. - -1998-07-15 Martin v. Löwis - - * decl2.c (add_using_namespace): Iterate over namespaces used - indirectly. - - * decl.c (lookup_name_real): Accept namespace aliases as locals. - (cat_namespace_levels): Ignore aliases. - (duplicate_decls): Ignore duplicate aliases. - * decl2.c (do_namespace_alias): Process block level namespace - aliases. Store alias with pushdecl. Remove odr errors. - * parse.y (namespace_alias): New non-terminal. - (extdef): Use it. - -1998-07-15 Jason Merrill - - * decl2.c (arg_assoc_type): Handle METHOD_TYPE like FUNCTION_TYPE. - Handle TEMPLATE_TYPE_PARM. - (arg_assoc): Rewrite. - - * pt.c (complete_template_args): Don't look at the context unless - we have to. - - * method.c (build_decl_overload_real): Fix namespace handling. - - * typeck.c (build_unary_op): Extract a lone function from an - OVERLOAD. - - * call.c (build_scoped_method_call): Handle getting a namespace - for basetype in a destructor call. - (check_dtor_name): Handle enums. - - * parse.y (using_directive): New nonterminal. - (extdef, simple_stmt): Use it. - -1998-07-14 Martin von Löwis - - * decl2.c (add_function): Move error message ... - (arg_assoc_namespace): ... from here. - -1998-07-14 Jason Merrill - - * parse.y (namespace_qualifier): Fix multiple level handling. - * decl2.c (namespace_ancestor): Use CP_DECL_CONTEXT. - (arg_assoc): Don't skip the first argument of a function. - -Tue Jul 14 20:09:22 1998 Jeffrey A Law (law@cygnus.com) - - * search.c (my_tree_cons): Clean up. - -1998-07-14 Jason Merrill - - * call.c (joust): Don't warn about "confusing" conversions to the - same type. - -1998-07-14 Martin von Löwis - - * class.c (push_nested_class): Complain about namespaces. - * decl.c (start_decl): Enter the object's namespace. - (cp_finish_decl): Leave it. - (grokdeclarator): Likewise. - * decl2.c (check_decl_namespace): New function. - (finish_file): Call it. - * parse.y (complex_direct_notype_declarator): Set complexity - of namespace-qualified ids to -1, enter the namespace. - - * method.c (build_template_decl_overload): Expect _DECL as first - parameter. Put context temporarily into current_namespace. - * pt.c (check_explicit_specialization): Change caller. - (tsubst): Likewise. - - * init.c (build_offset_ref): Call mark_used and - convert_from_reference for namespace members. - -Mon Jul 13 23:25:28 1998 Martin von Löwis - - * search.c (my_tree_cons): The bitfield is at index 2. - -Mon Jul 13 17:21:01 1998 Nick Clifton - - * lang-options.h: Format changed to work with new --help support - in gcc/toplev.c - -1998-07-12 Martin von Löwis - - * decl2.c (build_expr_from_tree): Change calls of do_identifier. - Do Koenig lookup in CALL_EXPR. - (arg_assoc): Handle error_mark. - * lex.c (is_global): New function. - (do_identifier): Expect arguments for Koenig lookup. - * parse.y (primary): Add rules for calls of unqualified function calls. - (do_id): Change call of do_identifier. - * pt.c (finish_stmt_expr): Likewise. - * semantics.c (finish_id_expr): Likewise. - (finish_call_expr): Add integer parameter to indicate - argument-dependent lookup. - - * decl.c (struct binding_level): New field using_directives. - (push_using_decl): Not sorry anymore. - (push_using_directive): New function. - (lookup_tag): Use CP_DECL_CONTEXT to iterate. - (unqualified_namespace_lookup): New function, code from ... - (lookup_name_real): ... here. - * decl2.c (lookup_using_namespace): Pass using list instead of - initial scope. - (validate_nonmember_using_decl): New function. - (do_nonmember_using_decl): New function. - (do_toplevel_using_decl): Use them. - (do_local_using_decl): New function. - (do_using_directive): Support block-level directives. - * parse.y (simple_stmt): Support using declarations and - directives. - (namespace_qualifier, namespace_using_decl): New non-terminals. - - * xref.c (classname): New function. - (GNU_xref_hier): Change class and base parameters to tree. - * decl.c (xref_baseypes): Change caller. - * friend.c (make_friend_class): Likewise. - -1998-07-12 Kriang Lerdsuwanakij - - * typeck.c (comptypes, case TEMPLATE_TEMPLATE_PARM): Add parameter - comparison. - - * pt.c (for_each_template_parm, case TEMPLATE_DECL): If it is a - template template parameter, record its use. - (for_each_template_parm, case TEMPLATE_TEMPLATE_PARM): Traverse - its template arguments if exists. - - * pt.c (coerce_template_template_parms): New function equivalent - to coerce_template_parms when IS_TMPL_PARM is true. - (coerce_template_parms): Use it. Remove the IS_TMPL_PARM parameter, - all callers changed. - - (coerce_template_parms): Access ARGLIST properly when creating a - new vector. Only accept implicit TYPE_DECL as valid argument for - a template template parameter when it is a base class of - current_class_type. Don't display error message when COMPLAIN is - false. - -1998-07-12 Klaus Kaempf (kkaempf@progis.de) - - * repo.c (get_base_filename): Use file_name_nondirectory. - (open_repo_file): Likewise. - * cp-tree.h (file_name_nondirectory): Add prototype. - -1998-07-12 Jason Merrill - - * friend.c (do_friend): Pull the identifier out of declarator. - Use cp_error and friends. - * decl2.c (qualified_lookup_using_namespace): Fix call to - purpose_member. - * decl.c (lookup_name_real): Don't call complete_type on a namespace. - (grokvardecl): Use DECL_CLASS_SCOPE_P. - * cvt.c (convert_pointer_to_real): Check for error_mark_node sooner. - * class.c (warn_hidden): Fix for OVERLOAD. - From grahams@rcp.co.uk: - * cp-tree.h (DEFARG_NODE_CHECK): New macro. - (DEFARG_LENGTH, DEFARG_POINTER): Use it. - -Sun Jul 12 01:20:57 1998 Jeffrey A Law (law@cygnus.com) - - * g++.1 (-traditional): Remove duplicated documentation. - -1998-07-11 Mark Mitchell - - * method.c (flush_repeats): Add nrepeats parameter. - (issue_nrepeats): Likewise. - (is_back_referenceable_type): New function. Don't back-reference - TEMPLATE_TYPE_PARMs as well as simple types like integers. - (build_mangled_name_for_type): Likewise. - (build_mangled_name_for_type_with_Gcode): Likewise. - (lasttype): Remove. - (nrepeats): Likewise. - (Nrepeats): Likewise. - (start_squangling): Don't clear the variables removed above. - (end_squangling): Likewise. - (flush_repeats): Tidy. Use nrepeats parameter rather than - Nrepeats global. - (issue_nrepeats): Likewise, but with nrepeats global. Use - is_backreferenceable_type. - (build_overload_nested_name): Tidy. Add comment. Use - build_mangled_name_for_type. - (build_underscore_int): Comment. - (build_overload_scope_ref): Use build_mangled_name_for_type. - (build_overload_int): Likewise. - (build_template_template_parm_names): Tidy. - (build_template_parm_names): Use build_mangled_name_for_type. - (build_overload_identifier): Add comments. - (build_mangled_name_for_type_with_Gcode): Split out from - build_mangled_name. - (build_mangled_name_for_type): Use it. - (build_mangled_name): Rework to use build_mangled_name_for_type - and to not use global nrepeats/Nrepeats. Tidy. - (process_modifiers): Tidy. - (check_btype): Use is_backreferenceable_type. Add comment. - Rename `node' to `type'. - (process_overload_item): Set numeric_output_need_bar here. - Use build_mangled_name_for_type. Tidy. - (build_decl_overload_real): Tidy. Don't use Nrepeats. Use - build_mangled_name_for_type. - - * pt.c (push_template_decl_real): Don't look at DECL_TEMPLATE_INFO - for TYPE_DECLs. - -1998-07-08 Vladimir N. Makarov - - * cp-tree.h (warn_long_long): Define. - * decl.c (grokdeclarator): Add flag `warn_long_long' as guard for - warning "ANSI C++ does not support `long long'". - * decl2.c (warn_long_long): Define. - (lang_decode_option): Parse -Wlong-long, -Wno-long-long options. - -1998-07-07 Jason Merrill - - * decl.c (xref_tag): Handle attributes between 'class' and name. - * parse.y (aggr): Likewise. - * semantics.c (finish_class_definition): Likewise. - * Makefile.in (EXPECTED): Adjust. - - * cp-tree.h: Declare flag_optional_diags and warn_multichar. - * decl2.c: Define them. - (lang_decode_option): Handle them. - * lang-options.h: Add -foptional-diags. - * class.c (finish_struct): Don't complain about multiple meanings of - name if -fno-optional-diags. - * decl.c (pushdecl_class_level): Likewise. - * lex.c (real_yylex): Check warn_multichar. - -1998-07-06 Jason Merrill - - * decl.c (lookup_tag): Use CP_DECL_CONTEXT. - - * tree.c (make_binfo): Fix length. - -1998-06-30 Benjamin Kosnik - - * decl2.c (lang_decode_option): Remove warn_template_debugging. - * lang-options.h: Likewise. - -Mon Jun 29 20:17:40 1998 Kaveh R. Ghazi - - * except.c (build_eh_type_type_ref): Remove unused variable `susp'. - (process_start_catch_block): Likewise for variables - `false_label_rtx', `call_rtx' and `return_value_rtx'. - -1998-06-29 Brendan Kehoe - - * tree.c (build_srcloc): Make sure we allocate this node on the - permanent obstack. - -Sat Jun 27 23:34:18 1998 Fred Fish - - * g++spec.c (NEED_MATH_LIBRARY): Define to 1 if not already defined. - (lang_specific_driver): Initialize need_math with NEED_MATH_LIBRARY. - (lang_specific_driver): Only add -lm automatically if need_math is - nonzero. - -Sat Jun 27 12:22:56 1998 Jeffrey A Law (law@cygnus.com) - - * Make-lang.in (g++): Depend on mkstemp.o. Link in mkstemp.o - -Sat Jun 27 07:36:09 1998 Kaveh R. Ghazi - - * Makefile.in (EXPR_H): New dependency variable. - (decl2.o): Depend on $(EXPR_H). - (typeck.o): Likewise. - (init.o): Likewise. - (expr.o): Likewise. - -1998-06-25 Benjamin Kosnik - - * decl.c (start_enum): Put local enums on permanent_obstack. - -1998-06-25 Mark Mitchell - - * cp-tree.h (c_get_alias_set): Declare. - * decl.c (init_decl_processing): Set lang_get_alias_set. - -1998-06-25 Andrew MacLeod - - * cp-tree.h (mark_all_runtime_matches): Add function prototype. - * except.c (mark_all_runtime_matches): Set TREE_SYMBOL_REFERENCED - flag for all function decls which are in the exception table. - * exception.cc (__cplus_type_matcher): Check for CATCH_ALL_TYPE match. - * decl2.c (finish_file): Call mark_all_runtime_matches to make sure - code is emitted for any referenced rtti function. - -1998-06-25 Dave Brolley - - * lang-specs.h: Use new | syntax to eliminate - string concatenation. - -1998-06-25 Jason Merrill - - * cp-tree.h (CP_DECL_CONTEXT): New macro. - * decl2.c (is_namespace_ancestor, lookup_using_namespace): Use it. - * method.c (build_overload_nested_name): Likewise. - * sig.c (build_signature_pointer_or_reference_type): Don't set - DECL_CONTEXT. - -1998-06-24 Martin v. Löwis - - Set DECL_CONTEXT for globals to NULL_TREE instead of global_namespace. - * cp-tree.h (FROB_CONTEXT): New macro. - (DECL_MAIN_P): ::main should have a DECL_CONTEXT of NULL_TREE. - * decl.c (namespace_binding): Replace NULL_TREE with - global_namespace. - (set_namespace_binding, pop_namespace, lookup_name_real): Likewise. - * decl2.c (is_namespace_ancestor, lookup_using_namespace): - Likewise. - * decl.c (pushtag): Use FROB_CONTEXT. - (pushdecl, make_typename_type, define_function, grokdeclarator): - Likewise. - * decl2.c (set_decl_namespace, do_namespace_alias): Likewise. - * pt.c (push_template_decl_real, lookup_template_class, tsubst): - Likewise. - * decl2.c (decl_namespace): Return global_namespace if no context. - * method.c (build_overload_nested_name): Expect null as context. - * pt.c (mangle_class_name_for_template): Do nothing for null - contexts. - (lookup_template_class): Allow for null id_context. - -1998-06-25 Richard Henderson - - * method.c (emit_thunk): Set current_function_is_thunk for the - ASM_OUTPUT_MI_THUNK case as well. - -1998-06-23 Andrew MacLeod - - * exception.cc (__cplus_type_matcher): Get a match_info pointer - instead of an exception table entry as a parameter. - -1998-06-23 Andrew MacLeod - - * parse.y (function_try_block): Don't call start_catch_handler. - * except.c (call_eh_info): Remove coerced field from declaration. - (build_eh_type_type_ref): New function to create an address of a - rtti function for the new style exception tables. - (expand_start_catch_block): Split function, this contains the - common part. - (process_start_catch_block_old): New function to perform the rest - of expand_start_catch_block under old style exceptions. - (process_start_catch_block_old): New function to perform the rest - of expand_start_catch_block under new style exceptions. - (expand_end_catch_block): Only pop the false label off the stack under - the old style of exceptions. - * semantics.c (finish_try_block): Don't call start_catch_handler. - * exception.cc (struct cp_eh_info): Add original_value field. - (__cplus_type_matcher): Perform type matching on the original exception - value, and if we have a match, set the current value. - (__cp_push_exception): Set the original exception value. - -1998-06-23 Jason Merrill - - * call.c (joust): Fix confusing conversion warning. - - * call.c (build_op_delete_call): Add placement parm. Check - LOOKUP_SPECULATIVELY. - * cp-tree.h, decl2.c, init.c: Adjust. - * decl.c (finish_function): Use it. - - * pt.c (tsubst): Diagnose creating void fields or variables. - -Mon Jun 22 08:50:26 1998 Kaveh R. Ghazi - - * call.c (build_scoped_method_call): Remove unused variable `tmp'. - - * cp-tree.h (check_dtor_name): Add prototype. - - * init.c (expand_member_init): Remove unused variables - `ptr_type_node', `parm' and `rval'. - - * ptree.c (print_lang_type): Use HOST_WIDE_INT_PRINT_DEC specifier - in call to fprintf. - (lang_print_xnode): Likewise. - - * typeck2.c (enum_name_string): Cast argument to sprintf to long - and use %ld specifier. - - * xref.c (GNU_xref_end_scope): Use HOST_WIDE_INT_PRINT_DEC - specifier in call to fprintf. - (GNU_xref_member): Cast argument to sprintf to int. - -Fri Jun 19 23:22:42 1998 Bruno Haible - - * typeck2.c (pop_init_level): Warn about implicit zero initialization - of struct members. - -Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi - - * cp-tree.h: Prototype function `check_java_method'. - -1998-06-17 Jason Merrill - - * class.c (finish_struct): Make conflicting use of id a pedwarn. - * decl.c (pushdecl_class_level): Likewise. - -1998-06-17 Mark Mitchell - - * pt.c (convert_nontype_argument): Issue an error when presented - with an integer (real) constant that cannot be simplified to an - INT_CST (REAL_CST). - - * cp-tree.h (c_get_alias_set): Remove declaration added in - 1998-06-13 change that should never have been checked in. - -1998-06-17 Jason Merrill - - * typeck.c (build_binary_op_nodefault): Change % in format strings - to %%. - - * decl.c (grokvardecl): Don't build_static_name for decls that - aren't at namespace scope. - - * init.c (perform_member_init): Catch default-initialization of - references. - -1998-06-17 Mark Mitchell - - * errfn.c (cp_thing): Handle the `%%' formatting sequence. - -1998-06-17 Jason Merrill - - * method.c (hack_identifier): Complain about getting a namespace - or class template. - * typeck.c (decay_conversion): Remove check for namespaces. - * typeck2.c (incomplete_type_error): Likewise. - * parse.y (template_arg): Add PTYPENAME expansion. - -1998-06-16 Andrew MacLeod - - * decl.c (grokvardecl): Don't build external assembler names for - TYPENAMEs in other namespaces as there is no declarator. - * error.c (cp_file_of, cp_line_of): Don't extract file or line number - info from DECL_CONTEXT if it is NULL. - -1998-06-16 Jason Merrill - - * call.c (check_dtor_name): Split out. - (build_scoped_method_call): Use it. - (build_method_call): Use it. - * init.c (build_offset_ref): Use it. - - * typeck.c (build_static_cast): Fix handling of pointers to members. - - * decl.c (finish_function): Just return nothing from a constructor. - * typeck.c (c_expand_return): Complain about returning a void - expression from a destructor. - -1998-06-13 Mark Mitchell - - * class.c (alter_access): Accept a BINFO explaining how to get - from the entity whose accessed is being altered to the type doing - the altering. - (handle_using_decl): New function containing code split out from ... - (finish_struct_1): Here. - - * cp-tree.h (complete_type_or_else): Declare. - * init.c (build_new_1, build_delete): Use it. - * typeck.c (require_complete_type): Use complete_type, rather than - expanding it inline. - (complete_type_or_else): New function. - (build_component_ref): Use it. - (pointer_int_sum): Make sure the type pointed to is complete. - (pointer_diff): Likewise. - - * pt.c (for_each_template_parm): Traverse the TYPE_CONTEXT for - types. - - * search.c (get_matching_virtual): Note that member templates - cannot override virtual functions. - -1998-06-12 Brendan Kehoe - - * pt.c (check_explicit_specialization): If DECLARATOR turned into - an error_mark_node from lookup_template_function, return the same. - (determine_specialization): Also make sure TEMPLATE_ID isn't an - error_mark_node, before we try to read its operands. - * decl.c (grokdeclarator): If we got an error_mark_node from - check_explicit_specialization, just return it right back. - -1998-06-12 Mark Mitchell - - * class.c (instantiate_type): Don't treat template-ids that don't - specify any template arguments as equivalent to ordinary - identifiers. Use OFFSET_REF instead of SCOPE_REF to refer to - pointer-to-members for member templates. Tidy slightly. - * cp-tree.def (TEMPLATE_ID_EXPR): Revise documentation. - * init.c (build_offset_ref): Handle template-ids like ordinary - identifiers, for the most part, but store a TEMPLATE_ID_EXPR in the - offset part of the OFFSET_REF. - * typeck.c (build_unary_op): Change check for unknown types to - look for OFFSET_REFs, not SCOPE_REFs. - -1998-06-11 Mark Mitchell - - * pt.c (is_member_template_class): New function. - (push_template_decl_real): Use it. - -1998-06-11 Benjamin Kosnik - - * friend.c (do_friend): Add support for nested classes using - member functions of the enclosing class as friends. - -1998-06-10 Mark Mitchell - - * call.c (convert_default_arg): Make global, not static. - (convert_arg_for_ellipsis): Split out from ... - (build_over_call): Here. - * cp-tree.h (convert_default_arg); Declare. - (convert_arg_to_ellipsis): Likewise. - (do_member_init): Remove. - * init.c (do_member_init): Remove; this code is dead. - (expand_member_init): Remove much of this code; it is dead. - * typeck.c (convert_arguments): Use convert_default_arg and - convert_arg_for_ellipsis, rather than duplicating here. - - * call.c (convert_like): Don't fail silently if - build_user_type_conversion fails. Always return error_mark_node - for failure. - -1998-06-10 Jason Merrill - - * search.c (covariant_return_p): Complain about ambiguous base. - - * typeck.c (build_component_ref): Diagnose ref to nested type. - -1998-06-10 Brendan Kehoe - - * decl.c (grokparms): Check that INIT isn't an error_mark_node - before giving error about invalid type for default arg. - -1998-06-10 Jason Merrill - - * call.c (build_method_call): Fix thinko. - -1998-06-10 Dave Brolley - - * decl2.c (lang_decode_option): New argc/argv interface. - * cp-tree.h (lang_decode_option): New argc/argv interface. - * lang-specs.h (default_compilers): Only call cpp if -E, -M or -MM is - specified for cpplib-enabled compilers. - * lex.c (lang_init): Don't check_newline for cpplib. - (init_parse): Don't initialize cpplib here. - -1998-06-10 Brendan Kehoe - - * typeck.c (build_component_ref): Make sure FIELD has a lang_specific - piece before checking DECL_MUTABLE_P. - -1998-06-10 John Carr - - * tree.c (debug_binfo): Make printf format match arguments. - - * error.c (OB_PUTI): Make printf format match arguments. - -1998-06-10 Jason Merrill - - * init.c (perform_member_init): Handle default-initialization. - - * except.c (build_throw): Handle throwing NULL. - - * typeck.c (build_x_function_call): Use resolve_offset_ref. - - * search.c (compute_access): Only strip an anonymous union - for a FIELD_DECL. - - * call.c (add_builtin_candidates): Tweak. - - * cvt.c (build_expr_type_conversion): Restore code for conversion - from class types. - * decl2.c (delete_sanity): Use it. Clean up. - - * typeck.c (comp_ptr_ttypes_real): Fix cv-qual comparisons. - -1998-06-10 Branko Cibej - - * typeck.c (c_expand_return): Don't warn about void expressions on - return statements in functions returning void. - -1998-06-09 Mark Mitchell - - * pt.c (fn_type_unification): Revise documentation. Tidy. - (type_unification): Likewise. - -1998-06-09 Andrew MacLeod - - * semantics.c (finish_try_block): Rename expand_start_catch, and delete - expand_end_catch. - * parse.y (function_try_block): Rename expand_start_catch, and delete - expand_end_catch. - * except.c (expand_end_eh_spec): Rename expand_start_catch, and delete - expand_end_catch. - -1998-06-09 Jason Merrill - - * search.c (lookup_member): New fn. - * class.c (finish_struct_1): Use it. - * decl.c (lookup_name_real): Use it. - -Mon Jun 8 20:45:52 1998 Kaveh R. Ghazi - - * Makefile.in (decl2.o): Depend on dwarf2out.h and dwarfout.h. - - * cp-tree.h: Add prototype for `maybe_print_template_context' and - `maybe_make_one_only'. - - * decl.c (auto_function): Remove unused variable `decl'. - - * decl2.c: Include dwarf2out.h and dwarfout.h. - - * lex.c: Remove redundant declarations of `set_float_handler' and - `asm_out_file'. - -1998-06-08 Andrew MacLeod - - * except.c (init_exception_processing): Remove NEW_EH_MODEL compile - time flag. Call __cp_eh_info instead of __cp_exception_info. - * exception.cc (struct cp_eh_info): Remove NEW_EH_MODEL flag. - (__cp_exception_info): Return offset into cp_eh_info structure to - match what use to be the start of this structure. - (__cp_eh_info): New function to return a pointer to cp_eh_info struct. - (__cplus_type_matcher, __cp_push_exception): Remove NEW_EH_MODEL - compile time flag. - (__uncatch_exception, __check_eh_spec, std::uncaught_exception): Call - __cp_eh_info instead of __cp_exception_info. - -1998-06-08 Jason Merrill - - * decl.c (cp_finish_decl): Disable inlining of extern inlines - with static variables. - -1998-06-08 Mark Mitchell - - * init.c (build_offset_ref): Correct previous change to use build, - not build_min. - -1998-06-07 Mark Mitchell - - * class.c (instantiate_type): Handle pointer-to-members where the - member is a template. - * init.c (build_offset_ref): Likewise. - * typeck.c (build_unary_op): Likewise. - -1998-06-07 Richard Henderson - - * lex.c (lang_init_options): New function. - (lang_init): Remove flag_exceptions == 2 hack. - -1998-06-05 Jason Merrill - - * search.c (envelope_add_decl): Tweak for implicit typename. - - * call.c (joust): Also warn about confusing conversion op/constructor - overload resolution. - - * spew.c (yylex): Also return the TYPE_DECL if got_object. - Don't clear got_object after '~'. - * call.c (build_scoped_method_call): Tweak destructor handling. - (build_method_call): Likewise. - * pt.c (tsubst_copy, case METHOD_CALL_EXPR): Don't mess with - TYPE_MAIN_VARIANT for destructors. - * semantics.c (finish_object_call_expr): Complain about calling a - TYPE_DECL. - -1998-06-05 Per Bothner - - * g++spec.c (lang_specific_pre_link, lang_specific_extra_ofiles): - Define - update needed by gcc.c change. - -1998-06-05 Jason Merrill - - * error.c (cp_printers): Use 'o' instead of '_' for the null entry. - -1998-06-05 Martin v. Loewis - - * cp-tree.h (DECL_NAMESPACE_ALIAS, ORIGINAL_NAMESPACE): Declare. - * decl.c (lookup_name_real): Add namespaces_only parameter. - If set, return only NAMESPACE_DECLs. - (select_decl): Likewise. - (identifier_type_value): Give additional parameter. - (lookup_name_nonclass): Likewise. - (lookup_name): Likewise. - (find_binding): Skip namespace aliases. - (binding_for_name): Likewise. - (push_namespace): Check for namespace aliases. - (lookup_name_namespace_only): New function. - (begin_only_namespace_names, end_only_namespace_names): New functions. - * decl2.c (set_decl_namespace): Skip namespace aliases. - (do_using_directive): Likewise. - (do_namespace_alias): Produce namespace aliases, fix alias - redeclaration. - * error.c (dump_decl): Support SCOPE_REF. - * parse.y (extdef): Wrap lookup with namespace_only for namespace - aliases and using declarations. - -1998-06-04 Jason Merrill - - * tree.c (really_overloaded_fn): Only see through one TREE_LIST. - - * error.c (dump_expr): Clean up NEW_EXPR case. - -1998-06-04 Martin von Löwis - - Suggested by Brendan Kehoe - * decl2.c (do_toplevel_using_decl): When decl is a TYPE_DECL, - treat it as using ::decl. - - * decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE. - - * tree.c (mapcar): Support NEW_EXPR. - - * error.c (dump_expr): Support NEW_EXPR. - -1998-06-03 Jason Merrill - - * method.c (make_thunk): Use overload machinery to make name. - * search.c (covariant_return_p): New fn. - (get_matching_virtual): Use it. - - * init.c (build_new_1): Fix check for void. - -1998-06-01 Per Bothner - - * cp-tree.h (TYPE_FOR_JAVA): New macro. - * decl.c, cp-tree.h (java_byte_type_node, java_short_type_node, - java_int_type_node, java_long_type_node, java_float_type_node, - java_double_type_node, java_char_type_node, java_boolean_type_node): - New "primitive" types, with predefined names __java_byte etc. - (record_builtin_java_type): New function. - (init_decl_processing): Make Java types with record_builtin_java_type. - (pushtag, grokdeclarator): Set TYPE_FOR_JAVA if in extern "JAVA". - (xref_baseypes): If base class was TYPE_FOR_JAVA, so is this class. - (grokfndecl): Call check_java_method for Java classes. - * method.c (is_java_type): Removed. Replaced with TYPE_FOR_JAVA. - (process_overload_item): Match types against specific - java_XX_type_node types, rather than using is_java_type. - * class.c (finish_struct_1): Don't add default copy constructor - or operator= if TYPE_FOR_JAVA. - (pop_lang_conext): Restore strict_prototyp proper if Java. - * decl2.c (acceptable_java_type, check_java_method): New functions. - * pt.c (instantiate_class_template): Copy TYPE_FOR_JAVA from pattern. - (tsubst): Move common statement after if statement. - * typeck.c (comptypes): If strict, TYPE_FOR_JAVA must match. - -1998-06-01 Jason Merrill - - * pt.c (for_each_template_parm): Use first_rtl_op. - - * tree.c (build_cplus_array_type_1): Also check index_type for - template parms. - -1998-05-31 Jason Merrill - - * pt.c (tsubst): Always copy BINFO_BASETYPES. - -1998-05-29 scott snyder - - * tree.c (layout_basetypes): If we change TYPE_SIZE, change - TYPE_SIZE_UNIT too. - -1998-05-29 Mark Mitchell - - * decl.c (grokdeclarator): Don't complain about in-class - initialization of static consts if we don't really know the type - of the variable. - -1998-05-29 Jason Merrill - - * cp-tree.h (DECL_DESTRUCTOR_P): New macro. - * method.c (build_destructor_name): New fn. - * decl2.c (maybe_retrofit_in_chrg): Split out... - (grokclassfn): From here. Reorganize. - * decl.c (grok_ctor_properties): Make sure ctors for types with - vbases have the in_chrg parm. - * pt.c (instantiate_class_template): Update - TYPE_USES_VIRTUAL_BASECLASSES from tsubsted bases. Don't call - grok_*_properties. - (tsubst): Call grok_ctor_properties and maybe_retrofit_in_chrg. - -1998-05-28 Mark Mitchell - - * pt.c (instantiate_decl): Make test for whether or not static - variables should be instantiated early match its comment. - -1998-05-28 Jason Merrill - - * decl.c (start_decl): Always pedwarn about vacuously redeclaring - a member. - (start_function): Call check_default_args. - * decl2.c (grokfield): Don't call check_default_args. - (check_default_args): Use cp_error_at. - * lex.c (do_pending_defargs): Call check_default_args. - -1998-05-27 Brendan Kehoe - - * call.c (build_method_call): Make sure get_type_value returns - something before we try to use its TYPE_MAIN_VARIANT. - (build_scoped_method_call): Likewise. - -1998-05-27 Jason Merrill - - * typeck2.c (digest_init): Complain about getting a TREE_LIST to - initialize an array. - - * search.c (expand_upcast_fixups): Don't set DECL_CONTEXT and - DECL_VIRTUAL_P. - - * friend.c (do_friend): Clarify template warning. - -1998-05-27 Mark Mitchell - - * decl.c (shadow_label): Don't treat decls as identifiers. - (maybe_push_to_top_level): Clear shadowed_labels. - - * pt.c (instantiate_decl): Reset lineno and filename after calling - regenerate_decl_from_template. - - * decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an - error_mark_node. - -1998-05-27 Kevin Buhr - - * parse.y (base_class): Use is_aggr_type, not IS_AGGR_TYPE. - -1998-05-26 Kriang Lerdsuwanakij - - * pt.c (process_template_parm): Accept TYPENAME_TYPE nodes. - (convert_nontype_argument): Handle cases when nontype template - parameters become classes after substitution. - -1998-05-26 Mark Mitchell - - * friend.c (is_friend): Use comptypes, rather than == to compare - types. Modify for new representation of template friends. - (make_friend_class): Likewise. - * pt.c (tsubst_friend_class): Undo 1998-05-21 change. Tweak. - (instantiate_class_template): Deal with template friends. - - * decl.c (store_parm_decls): Remove redundant call to - expand_main_function. - -1998-05-26 Benjamin Kosnik - - * decl.c (start_decl): Check for DECL_LANG_SPECIFIC before - DECL_USE_TEMPLATE. - -1998-05-26 Per Bothner - - * language_as_string: Handle lang_java. - -1998-05-26 Jason Merrill - - * decl.c (pushdecl): Don't copy the type_decl. - -1998-05-26 Martin v. Löwis - - * class.c (pushclass): Always store TYPE_MAIN_VARIANT in - current_class_type. - * decl.c (grokdeclarator): Put typedefs on the type's obstack. - - * parse.y (complex_direct_notype_declarator): Use $1 to access - scope of notype_qualified_id. - -1998-05-26 Dave Brolley - - * lex.c (parse_options,yy_cur,yy_lim): Add for cpplib. - (init_parse): Initialize cpplib interface. - - * Makefile.in (CXX_OBJS): Make sure dependencies never end with an - empty continuation. - -1998-05-26 Mark Mitchell - - * decl.c (pushtag): Avoid crashing on erroneous input. - -1998-05-25 Martin v. Löwis - - * decl.c (push_namespace): Only produce one unique name for - anonymous namespaces. - (get_unique_name): Remove. - -1998-05-25 Mark Mitchell - - * call.c (tourney): Don't do any extra comparisons. - - * decl2.c (build_anon_union_vars): Don't crash on empty sub-unions. - - * cp-tree.h (processing_template_parmlist): Declare. - * decl.c (pushtag): Don't call push_template_decl when we - shouldn't. - * pt.c (processing_template_parmlist): New variable. - (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): New macro. - (complete_template_args): Use it. - (add_to_template_args): Likewise. - (innermost_args): Likewise. - (tsubst): Likewise. - (begin_template_parm_list): Use processing_template_parmlist. - (end_template_parm_list): Likewise. - - * cp-tree.h (ANON_UNION_TYPE_P): New macro. - * decl.c (grokdeclarator): Use it. - * decl2.c (grok_x_components): Likewise. - * init.c (initializing_context): Likewise. - * method.c (do_build_copy_constructor): Likewise. - (do_build_assign_ref): Likewise. - * search.c (compute_access): Likewise. - * typeck.c (build_component_ref): Likewise. - - * decl.c (grokdeclarator): Don't give a cv-qualified version of an - unnamed type a typedef name "for linkage purposes". - - * pt.c (lookup_template_class): Don't look at - IDENTIFIER_CLASS_VALUE when there's no current_class_type. - - * method.c (build_overload_int): Handle error cases gracefully. - - * pt.c (instantiate_decl): Handle static member variables - correctly. - - * pt.c (tsubst): Use the tsubst'd type when producing new - TEMPLATE_PARM_INDEX nodes. - -1998-05-24 Mark Mitchell - - * tree.c (cp_tree_equal): Handle pointers to member functions. - - * call.c (maybe_handle_implicit_object): Handle QUAL_CONVs. Make - sure the type of the REF_BIND is a reference type. - (maybe_handle_ref_bind, compare_ics): Rename reference_type to - target_type for clarity. - - * parse.y (xcond): Move call to condition_conversion ... - * semantics.c (finish_for_cond): Here. - * parse.c: Regenerated. - -1998-05-24 Jason Merrill - - * decl.c (push_namespace): Namespaces have type void. - * typeck2.c (incomplete_type_error): Complain about namespace - used as expression. - * typeck.c (decay_conversion): Likewise. - -1998-05-24 Martin von Löwis - - * error.c (dump_expr): Support namespaces. - -1998-05-23 Jason Merrill - - * cp-tree.def: Add SRCLOC. - * cp-tree.h: Add struct tree_srcloc and accessor macros. - * tree.c (build_srcloc, build_srcloc_here): New fns. - * pt.c (add_pending_template): Use build_srcloc_here. - (push_tinst_level): Update last_template_error_tick before erroring. - (instantiate_decl): Restore lineno and input_filename before - calling add_pending_template. - * decl2.c (finish_file): Set up lineno and input_filename for - pending templates. - -1998-05-22 Jason Merrill - - * decl.c (lang_print_error_function): New fn. - (init_decl_processing): Set print_error_function to use it. - * errfn.c (cp_thing): Don't call maybe_print_template_context here. - - * call.c (maybe_handle_ref_bind): Propagate ICS_USER_FLAG and - ICS_BAD_FLAG. - - * cvt.c (ocp_convert): Don't set LOOKUP_NO_CONVERSION for - copy-initialization. - - * class.c (build_vtable_entry): Use int_fits_type_p. - (build_vtable): Pass a signed offset to build_vtable_entry. - (prepare_fresh_vtable, modify_one_vtable, fixup_vtable_deltas1, - set_rtti_entry): Likewise. - -1998-05-22 Per Bothner - - * cp-tree.h: Add comments documenting which LANG_FLAGS are used. - (C_TYPE_VARIABLE_SIZE, C_DECL_VARIABLE_SIZE): Removed, not used. - -1998-05-22 Jason Merrill - - * pt.c (print_template_context): Use fprintf instead of cp_error. - - * pt.c (determine_specialization): Just return an error_mark_node. - Also print the decl we want in error messages. If we complain, - return error_mark_node. - (tsubst_friend_function): Set lineno and input_filename so - error messages will be useful. - (instantiate_template): Just return an error_mark_node. - (check_explicit_specialization): Don't mess with a returned - error_mark_node. - - * pt.c (print_template_context): Add new argument. - (maybe_print_template_context): New fn. - (push_tinst_level): Increment tinst_level_tick. - (pop_tinst_level): Likewise. - * errfn.c (cp_thing): Call maybe_print_template_context. Use - xrealloc instead of xmalloc. - - * typeck.c (build_unary_op, CONVERT_EXPR): Propagate TREE_CONSTANT. - -1998-05-21 Jason Merrill - - * pt.c (tsubst_friend_class): Don't call redeclare_class_template - if the template we looked up is the same as the one we already - have. - -Thu May 21 11:54:44 1998 Dave Brolley - - * lex.c: (handle_sysv_pragma): FILE* parameter not used. - (cpp_reader,parse_in): Add for cpplib. - (check_newline): Call handle_sysv_pragma with new interface. - (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line. - - * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib. - (sub_getch): Call GETC for cpplib. - - * cp-tree.h: (get_directive_line): Different prototype for cpplib. - (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line. - - * Makefile.in (CXX_OBJS): Add @extra_cxx_objs@ for cpplib. - -1998-05-21 Jason Merrill - - * decl2.c (maybe_make_one_only): New fn. - (import_export_vtable): Use it. - (import_export_decl): Likewise. - * pt.c (mark_decl_instantiated): Likewise. - -1998-05-21 Mark Mitchell - - * decl2.c (find_representative_member): Rename to ... - (build_anon_union_vars): New function. - (finish_anon_union): Fix stupidity of previous change. - -1998-05-20 Jason Merrill - - * decl.c (grokfndecl): Handle definition of specialization in - friend declaration. - - * error.c (dump_decl): Fix LOOKUP_EXPR handling. - -1998-05-20 Mark Mitchell - - * class.c (delete_duplicate_fields_1): Use DECL_DECLARES_TYPE_P - to look for type declarations. - (finish_struct): Deal with templates on the CLASSTYPE_TAGS list. - * cp-tree.h (DECL_DECLARES_TYPE_P): New macro. - (finish_member_class_template): Declare. - * decl.c (pushtag): Put member class templates on the - CLASSTYPE_TAGS list, just as for ordinary member classes. - (pushdecl_class_level): Use DECL_DECLARES_TYPE_P. - (lookup_tag): Look for IDENTIFIER_CLASS_VALUEs, just as with - IDENTIFIER_NAMESPACE_VALUEs. - * parse.y (component_decl): Move code to ... - * semantics.c (finish_member_class_template): New function. - Don't put member class templates on the list of components for a - class. - * parse.c: Regenerated. - * pt.c (classtype_mangled_name): Don't try DECL_CONTEXT on types. - In fact, don't use DECL_CONTEXT at all here. - -1998-05-20 Martin von Loewis - - * decl.c (record_unknown_type): New function. - (init_decl_processing): Call it for the unknown and global type - nodes. - -1998-05-20 Mark Mitchell - - * decl2.c (find_representative_member): New function. - (finish_anon_union): Use it. - - * cp-tree.h (MAIN_NAME_P): New macro. - (DECL_MAIN_P): Likwise. - * decl.c (pushdecl): Avoid crashing on redefinitions of `main'. - (grokfndecl): Use the new macros. - (grokdeclarator): Likewise. - (start_function): Likewise. - (store_parm_decls): Likewise. - (finsh_function): Likewise. - * friend.c (do_friend): Likewise. - * typeck.c (build_function_call_real): Likewise. - (build_unary_op): Likewise. - -Wed May 20 02:16:01 1998 Jason Merrill - - * decl2.c (start_objects, finish_objects, do_dtors, - do_ctors): Split out from... - (finish_file): ...here. - -Tue May 19 20:36:23 1998 Jason Merrill - - * tree.c (is_overloaded_fn): Don't abort on placeholders from - push_class_decls. - -Tue May 19 15:16:22 1998 Brendan Kehoe - - * class.c (is_empty_class): Return 0 if TYPE is an error_mark_node. - - * error.c (dump_expr): Handle an ARROW_EXPR. - -Tue May 19 15:13:39 1998 Mark Mitchell - - * decl.c (saveable_obstack): Declare. - (pushdecl): Copy TYPE_DECLs to the same obstack as the type they - declare, if necessary. - -Tue May 19 14:50:27 1998 Mark Mitchell - - * call.c (compare_qual): Remove. - (is_subseq): Tweak. - (is_properly_derived_from): New function. - (maybe_handle_ref_bind): Likewise. - (maybe_handle_implicit_object): Likewise. - (compare_ics): Modify substantially to bring into conformance with - the standard. - * cp-tree.h (TYPE_PTRMEMFUNC_OBJECT_TYPE): New macro. - (comp_cv_qualification): Declare. - (comp_cv_qual_signature): Likewise. - * typeck.c (comp_cv_qualification): Likewise. - (comp_cv_qual_signature): Likewise. - -Tue May 19 10:05:02 1998 Kaveh R. Ghazi - - * Makefile.in (parse.o): Depend on toplev.h. - - * class.c (typecode_p): Remove prototype and definition. - - * cp-tree.h (currently_open_class, is_empty_class, member_p): - Add prototype. - - * decl.c (push_overloaded_decl_top_level): Remove prototype and - definition. - - * errfn.c (cp_error): Cast function pointer `error' to (errorfn *) - in call to `cp_thing'. - (cp_warning): Likewise for function pointer `warning'. - - * except.c (do_function_call): Remove prototype and definition. - (call_eh_info): Wrap variable `t1' in macro NEW_EH_MODEL. - - * method.c (is_java_type): Add prototype and make it static. - - * parse.y: Include toplev.h. - - * pt.c (type_unification): Remove unused variable `arg'. - (instantiate_decl): Likewise for `save_ti'. - - * tree.c (propagate_binfo_offsets): Likewise for `base_binfos'. - -Tue May 19 02:43:25 1998 Jason Merrill - - * init.c (build_member_call): Handle template_ids. - * parse.y (primary): Add global_scope template_id. - -Mon May 18 23:22:52 1998 Jason Merrill - - * decl2.c (get_sentry): Use end_temporary_allocation. - Don't declare permanent_obstack. - -Mon May 18 12:28:44 1998 Mark Mitchell - - * parse.y (.finish_new_placement): New non-terminal. - (unary_expr, new_type_id): Use it. - * parse.c: Regenerated. - -Mon May 18 12:20:27 1998 Brendan Kehoe - - * pt.c (redeclare_class_template): Say where the original definition - of the template-parameter's default argument appeared. - -Mon May 18 03:00:57 1998 Jason Merrill - - * call.c (build_over_call): Tweak empty class handling. - - * decl.c (make_typename_type): Use currently_open_class. - - * class.c (instantiate_type): Don't abort on TREE_NONLOCAL_FLAG. - -Mon May 18 01:43:01 1998 Martin v. Loewis - - * decl.c (lookup_name_real): Don't look at IDENTIFIER_LOCAL_VALUE - for a type unless it is one. - - * class.c (finish_struct_1): Use OVL_CURRENT in error message. - -Mon May 18 01:24:08 1998 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (program_transform_name, objdir): Define. - - * Makefile.in (BISON): Use bison from the build tree if it exists. - (FLEX): Likewise. - -Sun May 17 14:52:08 1998 Martin v. Loewis - - * typeck.c (type_unknown_p): Return true for TREE_LIST also. - - * call.c (build_method_call): Use TYPE_MAIN_VARIANT on typedefs. - -Sun May 17 14:51:41 1998 Jason Merrill - - * call.c (build_scoped_method_call): Likewise. - -Sun May 17 13:53:48 1998 Mark Mitchell - - * init.c (build_new_1): Call suspend_momentary around the creation - of values that must be saved for exception handling. - * parse.y (.build_new_placement): New non-terminal. - (unary_expr, new_placement): Use it. - * parse.c: Regenerated. - -Sun May 17 12:32:08 1998 Jason Merrill - - * decl.c (duplicate_decls): Use CANONICAL_TYPE_VARIANT to compare - old and new types. - - * pt.c (tsubst): Make sure that BINFO_TYPE of new binfos is the - canonical type. - - * call.c (build_over_call): Don't use IS_SIGNATURE on a namespace. - -Fri May 15 20:28:00 1998 Jason Merrill - - * decl.c (start_decl): Revert problem change. - - * Makefile.in (CONFLICTS): Fix. - -Fri May 15 15:34:02 1998 Benjamin Kosnik - - * decl.c (duplicate_decls): Clean up, add DECL_DATA_AREA bits. - -Fri May 15 00:46:05 1998 Jason Merrill - - * class.c (finish_struct_1): Use BINFO_SIZE. - - * decl.c (start_decl): Use 'tem'. - -Thu May 14 16:30:47 1998 Andrew MacLeod - - * exception.cc: Include eh-common.h. - (struct cp_eh_info): Add eh_info struct with NEW_EH_MODEL. - (__cplus_type_matcher): First stab at new C++ runtime type matcher. - (__cp_push_exception): Initialize eh_info struct as well. - * except.c: Remove local structs and include eh-common.h. - (init_exception_processing): Set language and version codes. - (call_eh_info): Add presence of eh_info to runtime description of - struct cp_eh_info. - (expand_end_eh_spec): Call start_catch_block() and end_catch_block(). - * semantics.c (finish_try_block): Call start_catch_block() and - end_catch_block(). - * parse.y (function_try_block): Call start_catch_block() and - end_catch_block(). - -Thu May 14 12:27:34 1998 Brendan Kehoe - - * typeck.c (original_type): New function. - (common_type): Use it to get the DECL_ORIGINAL_TYPE for T1 and T2, - to see if they're actually the same. - * cp-tree.h (original_type): Declare. - -Wed May 13 12:54:30 1998 Kaveh R. Ghazi - - * Makefile.in (lex.o): Depend on output.h. - - * call.c (add_function_candidate): Remove unused variable `cand'. - (add_conv_candidate): Likewise. - (build_builtin_candidate): Likewise. - - * cp-tree.h: Add prototype for `types_overlap_p'. - - * decl.c (signal_catch): Mark parameter `sig' with ATTRIBUTE_UNUSED. - - * decl2.c (merge_functions): Remove unused variables `tmp' and - `tempn'. - - * error.c (expr_as_string): Mark parameter `v' with ATTRIBUTE_UNUSED. - (code_as_string): Likewise. - (language_as_string): Likewise. - (parm_as_string): Likewise. - (op_as_string): Likewise. - (assop_as_string): Likewise. - (cv_as_string): Likewise. - - * lex.c: Include output.h. - - * pt.c (type_unification): Cast first argument of `bzero' to a char*. - - * search.c (dfs_no_overlap_yet): Mark parameter `t' with - ATTRIBUTE_UNUSED. - - * tinfo.cc (__class_type_info::dcast): Change the type of variable - `i' from int to size_t. - - * typeck.c (language_lvalue_valid): Mark parameter `exp' with - ATTRIBUTE_UNUSED. - -Tue May 12 21:37:49 1998 Jason Merrill - - * error.c (dump_simple_decl): Use DECL_CLASS_SCOPE_P and/or - DECL_NAMESPACE_SCOPE_P. - (lang_decl_name): Likewise. - * pt.c (tsubst_friend_function, tsubst): Likewise. - * decl.c (pushdecl, redeclaration_error_message, start_decl, - cp_finish_decl, start_function): Likewise. - * class.c (finish_struct_1): Likewise. - * call.c (build_over_call): Likewise. - (compare_ics): Use DERIVED_FROM_P. - -Tue May 12 07:24:18 1998 Mark Mitchell - - * cp-tree.h (CANONICAL_TYPE_VARIANT): New macro. - * method.c (build_mangled_name): Use it. - (build_decl_overload_real): Likewise. - - * error.c (dump_simple_decl): New function, broken out from ... - (dump_decl): Use it. - -Mon May 11 11:38:07 1998 Mark Mitchell - - * ptree.c (lang_print_xnode): Add missing `break'. - - * pt.c (tsubst): Remove duplicate check for IDENTIFIER_NODE. - - * call.c (add_template_candidate): Adjust for changes to - fn_type_unification. - (add_template_candidate_real): Likewise. - (add_template_conv_candidate): Likewise. - (build_user_type_conversion_1): Likewise. - (build_new_function_call): Likewise. - (build_object_call): Likewise. - (build_new_op): Likewise. - (build_new_method_call): Likewise. - * class.c (instantiate_type): Likewise. - * cp-tree.h (unification_kind_t): New type. - (fn_type_unification): Adjust prototype. - (type_unificaiton): Likewise. - * pt.c (UNIFY_ALLOW_NONE): New macro. - (UNIFY_ALLOW_MORE_CV_QUAL): Likewise. - (UNIFY_ALLOW_LESS_CV_QUAL): Likewise. - (UNIFY_ALLOW_DERIVED): Likewise. - (unify): Change prototype. - (maybe_adjust_types_for_deduction): New function. - (check_cv_quals_for_unify): Likewise. - (determine_specialization): Adjust. - (fn_type_unification): Likewise. - (type_unification): Likewise. - (type_unification_real): Likewise. Use - maybe_adjust_types_for_deduction. Fix mishandling of - back-unification of template functions passed as arguments. Pass - appropriate combination of UNIFY_ALLOW_* to unify. - (unify): Remove unused NTPARMS parameter. Use - check_cv_quals_for_unify. Remove bogus code that allowed - too-generous unification in order to adhere more closely to standard. - (get_bindings_real): Adjust. - (get_class_bindings): Likewise. - - * method.c (build_overload_identifier): Only use the innermost - template arguments when mangling. - * pt.c (tsubst_template_argument_vector): New function. - (complete_template_args): Deal with the situation where the - extra_args contain more than one level of arguments. - (lookup_template_class): Deal with member template classes, which - may have more than one level of arguments. - (tsubst): Don't tsbust into the TREE_TYPE of an IDENTIFIER_NODE. - Improve handling of member template classes. Use - DECL_PRIMARY_TEMPLATE instead of inline expansion. Use - tsubst_template_argument_vector where appropriate. - (regenerate_decl_from_template): Break out from ... - (instantiate_decl): Here. - - * lex.c (yyprint): Remove TYPENAME_ELLIPSIS. - * parse.h: Regenerated. - * parse.c: Really regenerated. - - * cp-tree.h (finish_unary_op_expr): New function. - (finish_id_expr): Likewise. - (begin_new_placement): Likewise. - (finish_new_placement): Likewise. - (finish_declarator): Likewise. - (finish_translation_unit): Likewise. - (finish_parmlist): Likewise. - (begin_class_definition): Likewise. - (finish_class_definition): Likewise. - (finish_default_args): Likewise. - (finish_inline_definitions): Likewise. - * parse.y (GCC_ASM_KEYWORD): Remove. - (TYPENAME_ELLIPSIS): Likewise. - * parse.c: Regenerated. - Use new functions in semantics.c in the actions for many rules. - * gxx.gperf (GCC_ASM_KEYWORD): Just use ASM_KEYWORD. - * hash.h: Regenerated. - * semantics.c (finish_expr_stmt): Allow NULL expr. - (finish_unary_op_expr): New function, containing - code previously in parse.y. - (finish_id_expr): Likewise. - (begin_new_placement): Likewise. - (finish_new_placement): Likewise. - (finish_declarator): Likewise. - (finish_translation_unit): Likewise. - (finish_parmlist): Likewise. - (begin_class_definition): Likewise. - (finish_class_definition): Likewise. - (finish_default_args): Likewise. - (finish_inline_definitions): Likewise. - -Sun May 10 23:43:13 1998 Mark Mitchell - - * typeck.c (build_c_cast): Don't decay arrays and functions to - pointer type when converting to a class type. - -Sun May 10 22:53:56 1998 Jason Merrill - - * cp-tree.h (DECL_NAMESPACE_SCOPE_P): New macro. - (DECL_CLASS_SCOPE_P): Likewise. - -Sun May 10 22:48:22 1998 H.J. Lu (hjl@gnu.org) - - * class.c (finish_struct_1): Use OVL_CURRENT on TREE_VEC_ELT. - * decl2.c (constructor_name_full): Likewise. - -Sun May 10 22:48:12 1998 Mike Stump - - * tree.c (mapcar): Add OVERLOAD support. - - * init.c (resolve_offset_ref): We must use basetype_path before we - destroy it with a call to convert_pointer_to. - -Sat May 9 14:44:37 1998 Jason Merrill - - * class.c (currently_open_class): New fn. - * decl.c (lookup_name_real): Use it. - * search.c (lookup_field): Likewise. - -Fri May 8 23:32:42 1998 Martin von Loewis - - * cp-tree.def (OVERLOAD): New node. - * cp-tree.h (BINDING_TYPE, SET_IDENTIFIER_GLOBAL_VALUE, - SET_IDENTIFIER_NAMESPACE_VALUE): Define. - (NAMESPACE_BINDING): Remove. - (IDENTIFIER_GLOBAL_VALUE, IDENTIFIER_NAMESPACE_VALUE): Use - namespace_binding. - (OVL_FUNCTION, OVL_CHAIN, OVL_CURRENT, OVL_NEXT, OVL_USED): - Define. - (tree_overload): New struct. - (IDENTIFIER_TYPE_VALUE): Use identifier_type_value. - (REAL_IDENTIFIER_TYPE_VALUE): Define. - (IDENTIFIER_HAS_TYPE_VALUE): Use IDENTIFIER_TYPE_VALUE. - (lang_decl_flags): Remove in_namespace. - (lang_decl): Remove chain. - (DECL_CHAIN, DECL_NAMESPACE): Remove. - (flag_honor_std): Declare extern. - (identifier_type_value, pushdecl_namespace_level, push_using_decl, - namespace_binding, set_namespace_binding, - lookup_function_nonclass, cat_namespace_levels, - set_decl_namespace, lookup_arg_dependent, binding_init, ovl_cons, - scratch_ovl_cons, ovl_member, build_overload): Declare. - (decl_list_length, get_namespace_id, current_namespace_id, - overloaded_globals_p): Remove. - (lookup_using_namespace, qualified_lookup_using_namespace): Change - return type. - (push_scratch_obstack): New macro. - * call.c (add_function_candidate): Special-case type of OVERLOAD node. - (build_user_conversions_1): Iterate using OVL_NEXT for ctors, - convs, fns. - (build_new_function_call): Iterate using OVL_CHAIN. - Print DECL_NAME in when reporting ambiguities. - (build_object_call): Iterate using OVL_NEXT for fns, convs. - (build_new_op): Call lookup_function_nonclass. - Iterate using OVL_NEXT. - (build_op_delete_call): Change detection of members. - Do not wrap TREE_LIST around fields and single global functions. - (build_over_call): Don't push a class level if the context is a - namespace. - (build_new_method_call): Iterate using OVL_NEXT. - * class.c (add_method): Chain overloaded members using - build_overload. Remove copying of method. - (grow_method): When iterating through the obstack, expect OVERLOAD - nodes. Chain overload members. - (finish_struct_methods): Chain overload members. Unpack OVERLOAD - nodes in call to get_baselinks. - (duplicate_tag_error): Expect OVERLOAD nodes when unchaining. - (finish_struct_1): Iterate over ctor using OVL_NEXT. Handle - fdecls that are OVERLOAD nodes. - (validate_lhs): New function. - (instantiate_type): Do not copy OVERLOAD nodes. Remove dead - code. Use DECL_NAME in error messages. Split code between global - and member function processing. - * decl.c (global_type_node): New static variable. - (in_std): New global. - (struct binding_level): New field usings. - (resume_binding_level): Assert that we are not in a class. - (toplevel_bindings_p): Just check for namespace_p or - pseudo_global. - (resume_level): Remove. - (find_binding): New function. - (binding_for_name): Call it. - (namespace_binding, set_namespace_binding): New functions. - (push_namespace): Associate binding level with new namespace, - resume_binding_level for existing namespace. Remove old code. - Fake std by counting. - (store_bindings): Use REAL_IDENTIFIER_TYPE_VALUE. - (maybe_push_to_top_level): Save current namespace. - (pop_from_top_level): Restore saved namespace. - (pop_namespace): Call suspend_binding_level. Remove old code. - (cat_namespace_levels): New function. - (set_identifier_type_value_with_scope): For namespace bindings, - set BINDING_TYPE, and use global_type_node. - Use REAL_IDENTIFIER_TYPE_VALUE otherwise. - (identifier_type_value): New function. - (pushtag): If no context, use current_namespace. - (duplicate_decls): Don't process DECL_CHAIN. - (pushdecl): Set DECL_CONTEXT to current_namespace, if it is not - already set. Never reset it to NULL_TREE. Lookup global variables - in their namespace. Push overloaded templates if they are on - namespace level. - (pushdecl_namespace_level): New function. - (pushdecl_top_level): Implement using pushdecl_namespace_level. - (pushdecl_using_decl): New function. - (overloaded_globals_p): Remove. - (push_overloaded_decl): Create OVERLOAD nodes, and iterate through - them. Use namespace_binding and set_namespace_value. - (redeclaration_error_message): Complain if the declarations come - from different namespaces. - (lookup_tag): On namespace level, look in the BINDING_TYPE. - (lookup_namespace_name): Pass tree_bindings from stack. Remove - old code. - (select_decl): New function. - (lookup_name_real): Call it for qualified and unqualified lookup. - Pass tree_bindings from the stack. - If prefer_type is 1, also accept namespaces. - (lookup_function_nonclass): New function. - (init_decl_processing): Set the binding level of the global - namespace to global_binding_level. - Build a proper type list for __builtin_apply. - Initialize std_node to "fake std" if flag_honor_std is set. - Initialize global_type_node. - Allocated bad_alloc in namespace std if flag_honor_std. - (define_function): Set the DECL_CONTEXT to the current_namespace. - (start_decl): A namespace is not considered as a context here. If - the DECL_CONTEXT is a namespace, push the decl. - (cp_finish_decl): Check for namespaces used as initializers. - (grokfndecl): Add namespace parameter. Remove processing of - DECL_CHAIN. - (grokvardecl): Add namespace parameter. - (grokdeclarator): Process SCOPEs that are namespaces. For - mangling, temporarily set the DECL_CONTEXT on anonymous structs. - (start_function): Check for contexts that are namespaces. - Set context for declarations that have not been pushed. - (store_parm_decls): Check for ::main only. - (finish_function): Likewise. - (start_method): Check for contexts that are namespaces. - (start_method): Remove DECL_CHAIN processing. - * decl2.c (flag_honor_std): Declare. - (lang_decode_option): Set it if -fhonor-std or -fnew-abi is given. - (decl_namespace_list): New static global. - (grok_x_components): Ignore namespaces as type contexts. - (check_classfn): Expect OVERLOAD nodes. - (grokfield): Remove DECL_CHAIN processing. - (finish_file): Call cat_namespace_levels. - (merge_functions): New function. - (ambiguous_decl): Rewrite. - (lookup_using_namespace): Produce tree_bindings. - (qualified_lookup_using_namespace): Likewise. - (set_decl_namespace, decl_namespace, current_decl_namespace, - push_decl_namespace, pop_decl_namespace): New functions. - (arg_lookup): New struct. - (add_function, arg_assoc_namespace, arg_assoc_class, - arg_assoc_type, arg_assoc_args, arg_assoc, lookup_arg_dependent): - New functions. - (get_namespace_id, current_namespace_id): Remove. - (do_toplevel_using_decl): Rewrite. - (do_class_using_decl): Complain about namespace qualifiers. - (do_using_directive): Sorry if not on namespace level. Complain - about unknown namespaces. - * error.c (dump_aggr_type): Check for namespace contexts. - * except.c (init_exception_processing): Push terminate into std. - * friend.c (is_friend): A namespace is not a context, here. - * init.c (expand_member_init): Remove DECL_CHAIN processing. - (build_offset_ref): Process OVERLOAD nodes. - * lang-specs.h (__HONOR_STD): Define if -fnew-abi or -fhonor-std. - * lex.c (identifier_type): Loop using OVL_CHAIN. - (see_typename): Set looking_for_typename to 2. - (real_yylex): Likewise. - (do_identifier): Expect OVERLOAD nodes instead of TREE_LISTs. - (do_scoped_id): Expect OVERLOAD nodes. - Change calling convention for qualified_lookup_using_namespace. - (build_lang_decl): Don't set in_namespace anymore. - * method.c (typevec_size): New global. - (build_overload_nested_name): Return if global_namespace. - Otherwise, always expect a declaration context. - (build_qualified_name): Likewise. - Make sure we don't write beyond typevec_size. - (build_decl_overload_real): Likewise. - Allocate one extra slot for the namespace. - (hack_identifier): Mark code dead. - Process OVERLOAD and NAMESPACE_DECL nodes. - * parse.y (program): Pop namespaces until in global namespace. - (extdef): In a using-declaration, don't discard the identifier if - there is no declaration. - (left_curly): Ignore type contexts which are namespaces. - (typename_sub2): Use IDENTIFIER_TYPE_VALUE to retrieve the type - used as scope. - * pt.c (template_class_depth): Expect types to be namespaces. - (determine_specialization): Simplify by expecting OVERLOAD nodes. - (push_template_decl): Push into namespace level. - Reset ctx if it is a namespace. - Set DECL_CONTEXT to current_namespace if not set already. - Ignore real contexts that are namespaces. - (mangle_class_name_for_template): Skip global_namespace. - Mangle other namespaces as declarations. - (lookup_template_function): Set type of OVERLOAD nodes to unknown. - (lookup_template_class): Push into namespace of context. - If the context is a namespace, set it to global_namespace. - Use id_context for mangling. - (for_each_template_parm): Handle OVERLOAD and NAMESPACE_DECL nodes. - (tsubst_friend_function): Ignore namespace contexts. - Push into namespace level. - (tsubst): Handle NAMESPACE_DECL nodes. - Remove DECL_CHAIN processing. - (type_unification_real): Recognize OVERLOAD instead of TREE_LIST nodes. - * ptree.c (print_lang_identifier): Print bindings. - (lang_print_xnode): Print OVERLOAD nodes. - * rtti.c (init_rtti_processing): Push type_info into std. - * search.c (lookup_fnfields_here): Expect OVERLOAD nodes. - (lookup_fnfields_1, get_virtuals_named_this, get_matching_virtual, - dfs_debug_mark, dfs_pushdecls, dfs_compress_decls, add_conversions, - lookup_fnfields_here): Likewise. - Process all nodes, instead of going through TREE_CHAIN. - * sig.c (build_signature_pointer_or_reference_type): Set context - to global_namespace. - (build_signature_table_constructor): Expect OVERLOAD nodes. - * spew.c (yylex): Save old setting of looking_for_typename. - * tree.c (decl_list_length): Remove. - (binding_init): New function. - (count_functions): Rewrite. - (is_overloaded_fn): Expect OVERLOAD nodes. - (really_overloaded_fn, get_first_fn, lvalue_type): Likewise. - (ovl_cons, scratch_ovl_cons, build_overload, build_overload_after, - ovl_member): New functions. - * typeck.c (require_complete_type): Expect OVERLOAD nodes. - (type_unknown_p): Likewise. - (require_instantiated_type): Likewise. - (build_component_ref): Declare code dead. - (build_x_function_call): Create and expect OVERLOAD nodes. - (build_function_call_real): Check for ::main only. - (build_unary_op): Likewise. Expect OVERLOAD nodes. - (convert_for_assignment): Check for TREE_LIST before accessing - TREE_VALUE. - * decl.c (duplicate_decls): Check for namespace bindings instead - of global bindings. - (pushdecl, push_overloaded_decl, lookup_tag, lookup_name_real, - lookup_name_current_level, start_decl, xref_tag, - finish_enum): Likewise. - * init.c (build_offset_ref): Likewise. - * search.c (lookup_field): Likewise. - (lookup_fnfields): Likewise. - (dfs_debug_mark): Likewise. - * decl.c (poplevel): Use SET_IDENTIFIER_TYPE_VALUE. - (poplevel_class, pop_from_top_level): Likewise. - * decl2.c (finish_method): Likewise. - * class.c (build_vtable): Use SET_IDENTIFIER_GLOBAL_VALUE. - * decl.c (record_builtin_type): Likewise. - (init_decl_processing, grokfndecl): Likewise. - * lex.c (get_time_identifier, do_identifier, do_scoped_id): Likewise. - (make_lang_type): Likewise. - * parse.y (make_thunk): Likewise. - * pt.c (tsubst): Likewise. - * tree.c (debug_binfo): Likewise. - * exception.cc, new.cc, new1.cc, new2.cc, tinfo.cc, tinfo.h, - tinfo2.cc, inc/new.h: Add std qualifications. - * inc/new: Wrap with namespace std if __HONOR_STD. - * inc/typeinfo: Likewise. - -Fri May 8 00:43:50 1998 Jason Merrill - - * call.c (build_user_type_conversion_1): Handle second_conv - properly for templates. - -Thu May 7 17:09:25 1998 Andrew MacLeod - - * method.c (build_decl_overload_real): Set TREE_USED flag to - zero for build_type_variants nodes as well. - -Wed May 6 19:27:09 1998 Jason Merrill - - * pt.c (tsubst): Don't tsubst the type of an IDENTIFIER_NODE. - -Wed May 6 16:49:48 1998 Jim Wilson - - * Makefile.in (call.o, class.o, decl.o, decl2.o, errfn.o, error.o, - except.o, expr.o, friend.o, init.o, lex.o, method.o, pt.o, repo.o, - rtti.o, search.o, semantics.o, sig.o, tree.o, typeck.o, typeck2.o, - xref.o): Add toplev.h dependencies. - -Wed May 6 16:44:58 1998 Jeffrey A Law (law@cygnus.com) - - * errfn.c (cp_error, cp_warning): Remove declarations for - error and warning respectively. - -Wed May 6 14:28:18 1998 Kaveh R. Ghazi - - * error.c: Convert to using ctype macros defined in system.h. - * method.c: Likewise. - * xref.c: Likewise. - * lex.c: Likewise. Also remove redundant system header stuff. - -Wed May 6 06:36:41 1998 Robert Lipe - - * call.c, class.c, decl.c, decl2.c, errfn.c, error.c, except.c, - expr.c, friend.c, init.c, lex.c, method.c, pt.c, repo.c, rtti.c, - search.c, semantics.c, sig.c, tree.c, typeck.c, typeck2.c, - xref.c: Add include of toplev.h. - -Wed May 6 02:33:39 1998 Jason Merrill - - * tree.c (perm_manip): Also regenerate the RTL of an extern. - (copy_to_permanent): Use end_temporary_allocation. - -Tue May 5 23:54:04 1998 Jason Merrill - - * init.c (expand_vec_init): The initialization of each array - element is a full-expression. - -Tue May 5 18:24:13 1998 Andrew MacLeod - - * method.c (build_mangled_name): Add a call to build_type_variant - to get the right type. - -Tue May 5 01:25:03 1998 Jason Merrill - - * Makefile.in: Add .SUFFIXES. - - * cp-tree.def: Remove NAMESPACE_DECL. - -Sun May 3 01:32:14 1998 Jason Merrill - - * call.c (build_over_call): Do evaluate arg even if it has empty - class type. - * decl.c (start_function): Don't push a member function. - -Thu Apr 30 18:59:23 1998 Jim Wilson - - * Makefile.in (g++FAQ.info): Put -o option before input file. - -Thu Apr 30 13:05:33 1998 Andrew MacLeod - - * gxxint.texi: Add info for squangling codes K and B. - -Tue Apr 28 13:22:01 1998 Mark Mitchell - - * semantics.c (begin_stmt_expr): Avoid duplicating the effect of - the expression in templates. - (finish_stmt_expr): Likewise. - -1998-04-28 Brendan Kehoe - - * decl2.c (ambiguous_decl): Fix NAME parm to be a tree, not int. - -Mon Apr 27 13:58:10 1998 Mark Mitchell - - * decl.c (maybe_push_to_top_level): Always clear - current_template_parms and processing_template_decl. - (pushtag): Remove check of current_class_type and some comments, - since maybe_push_to_top_level no longer creates confusion. - -Sun Apr 26 12:10:18 1998 Mark Mitchell - - * cp-tree.h (CLASSTYPE_IS_TEMPLATE): New macro. - (DECL_CLASS_TEMPLATE_P): Likewise. - (DECL_PRIMARY_TEMPLATE): Likewise. - (PRIMARY_TEMPLATE_P): Use it. - (push_template_decl_real): New function. - (redeclare_class_template): Take new template parameters as - input. - (is_specialization_of): New function. - (comp_template_args): Declare. - * decl.c (pushtag): Handle friend template classes. - (xref_tag): Likewise. Use new calling convention for - redeclare_class_template. - * decl2.c (grok_x_components): Handle friend templates. - * friend.c (is_friend): Use is_specialization_of where - appropriate. Deal with friend class templates. - (make_friend_class): Let a class template be friends with itself. - * pt.c (comp_template_args): Remove declaration. - (tsubst_friend_class): New function. - (push_template_decl_real): New function. - (push_template_decl): Use it. - (redeclare_class_template): Adjust for new calling convention. - (comp_template_args): Give it external linkage. - (instantiate_class_type): Use tsubst_friend_class to deal - with friend templates. - * typeck.c (comptypes): Use comp_template_args, rather than - expanding it inline. - * parse.y (component_decl): Handle a nested template type - like other component type declarations. - - * pt.c (check_explicit_specialization): Handle overloaded - constructors correctly. - - * pt.c (mabybe_get_template_decl_from_type_decl): New function. - (lookup_template_class): Use it. - -Thu Apr 23 21:19:06 1998 Jason Merrill - - * cp-tree.def: Add WRAPPER. USER_CONV now only has two ops. - * cp-tree.h: Add WRAPPER support. - * call.c (add_candidate): Split out from add_*_candidate fns. - (build_over_call): Take the candidate instead of function and args. - Enforce access control here. Emit overload warnings here. - (add_warning): New fn. - (joust): Add WARN parm. If not set, call add_warning instead of - printing a warning. Re-enable some warnings. - (tourney): Pass it. - (convert_like): Adjust. - (build_new_op): Adjust. - (build_new_function_call): Adjust. - (build_user_type_conversion_1): Adjust. - (USER_CONV_FN): Adjust. - * tree.c (build_expr_wrapper, build_expr_ptr_wrapper, - build_int_wrapper): New fns. - -Thu Apr 23 18:27:53 1998 Mark P. Mitchell - - * pt.c (unify): Fix typo in previous change. - -Thu Apr 23 09:32:58 1998 Jason Merrill - - * error.c (dump_type_real): Declare canonical_name. - - * typeck.c (comp_target_types): Fix PMFs. - -Wed Apr 22 13:24:48 1998 Mark Mitchell - - * class.c (finish_struct): Set TREE_PRIVATE and TREE_PROTECTED for - the DECL_RESULTs of a member TEMPLATE_DECL, not just the - TEMPLATE_DECL. - - * pt.c (tsubst): Decrease the template-level of - TEMPLATE_TEMPLATE_PARMS. Likewise for the DECL_INITIAL of a - TEMPLATE_PARM_INDEX. - (template_decl_level): New function. - (unify): Make sure to record unifications for template - parameters, even when the parameters exactly match the arguments. - Combine duplicated code for TEMPLATE_TEMPLATE_PARMs and - TEMPLATE_TYPE_PARMS. Don't try to unify template parameters that - aren't from the level we're currently working on. - -Tue Apr 21 22:00:04 1998 Mark Mitchell - - * errfn.c (cp_thing): Use xrealloc, not xmalloc, to copy memory. - - * decl2.c (check_member_template): Set DECL_IGNORED for member - class templates, too. - - * decl2.c (grokfield): Remangle the name of a member TYPE_DECL. - -Tue Apr 21 18:59:11 1998 Benjamin Kosnik - - * decl.c (duplicate_decls): Only check DECL_FRIEND_P if function. - -Tue Apr 21 14:22:00 1998 Jeffrey A Law (law@cygnus.com) - - * cp-tree.h (intTI_type_node, unsigned_intTI_type_node): Declare. - * decl.c (intTI_type_node, unsigned_intTI_type_node): Define. - (init_decl_processing): Handle TI types. - * typeck.c (unsigned_type, signed_type): Handle TI types. - -Sat Apr 18 15:25:21 1998 Jim Wilson - - * g++spec.c (lang_specific_driver): New argument in_added_libraries. - New local added_libraries. Increment count when add library to - arglist. - -Fri Apr 17 21:25:00 1998 Mark Mitchell - - * cp-tree.h (type_as_string_real): New function. - * pt.c (mangle_class_name_for_template): Use it. - * error.c (dump_aggr_type): Change prototype. - (dump_type_prefix): Likewise. - (dump_type_suffix): Likewise. - (dump_type_real): Convert from dump_type. If desired, the - "canonica" name of a typedef, i.e., the name of the underlying - type, can be printed. - (dump_type): Call dump_type_real. - -Fri Apr 17 14:30:45 1998 Jason Merrill - - * decl2.c (lang_decode_option): -fnew-abi implies -fvtable-thunks. - - * typeck.c (comp_target_types): Tweak pedantic case. - (comp_target_parms): Tweak pedantic case. Clean up somewhat. - Return -1 or 1 instead of 1 or 2. - (compparms): Remove STRICT handling. - (convert_for_assignment): Fix handling of pmfs. - -Fri Apr 17 14:04:16 1998 Mark Mitchell - - * typeck.c (comp_target_types): Handle references like pointers. - (comp_target_parms): Note that return code from comp_target_types - can be negative to indicate failure. - -Fri Apr 17 09:10:52 1998 Andreas Schwab - - * Make-lang.in (c++.all.build): Don't depend on $(DEMANGLER_PROG), - which requires a working target compiler to build. - -Fri Apr 17 08:57:35 1998 Jeffrey A Law (law@cygnus.com) - - * tree.c (avoid_overlap): Add prototype. - - * spew.c (num_tokens): Add prototype. - (nth_noken, add_token, consume_token, debug_yychar): Likewise. - - * search.c (dfs_check_overlap): Add prototype. - (dfs_no_overlap_yet): Likewise. - - * pt.c (original_template): Add prototype. - (inline_needs_template_parms): Likewise. - (push_inline_template_parms_recursive): Likewise. - (retrieve_specialization, register_specialization): Likewise. - (print_candidates, reduce_template_parm_level): Likewise. - (build_template_decl, mark_template_parm): Likewise. - (tsubst_friend_function, get_bindings_real): Likewise. - - * method.c (start_squangling): Add prototype. - (end_squangling, check_ktype, issue_ktype): Likewise. - (build_overloaded_scope_ref, check_btype): Likewise. - (build_mangled_template_parm_index): Likewise. - - * lex.c (init_cpp_parse): Add prototype. - (handle_cp_pragma, handle_sysv_pragma): Likewise. - (reduce_cmp, token_cmp): Likewise. - - * except.c (call_eh_info): Add prototype. - (push_eh_info, get_eh_info, get_eh_value, get_eh_type): Likewise. - (get_eh_caught, get_eh_handlers, do_pop_exception): Likewise. - - * decl2.c (is_namespace_ancestor): Add prototype. - (namespace_ancestor, add_using_namespace): Likewise. - (ambiguous_decl): Likewise. - - * decl.c (indent): Add prototype. - - * call.c (add_template_candidate_real): Add prototype. - -Fri Apr 17 01:57:12 1998 Jason Merrill - - * decl2.c (build_expr_from_tree): Just return a PMF. - -Fri Apr 17 00:45:12 1998 Mark Mitchell - - * typeck2.c (process_init_constructor): Don't strip cv-qualifiers - when doing initializations. - - * pt.c (unify): Use comptypes to compare type args. - -Fri Apr 17 00:24:22 1998 Jason Merrill - - * decl.c (duplicate_decls): Fix check for when it's safe to free - the new decl. - - * pt.c (mangle_class_name_for_template): Don't pass a typedef type - to type_as_string. - -Thu Apr 16 17:47:30 1998 Jeffrey A Law (law@cygnus.com) - - * pt.c (build_template_parm_index): Add prototype. - - * search.c (my_tree_cons): Don't clear words outside the - newly allocated node. - -Wed Apr 15 15:34:44 1998 Dave Brolley - - * lex.c (init_parse): Now returns char* containing the filename. - -Wed Apr 15 13:20:06 1998 John Carr - Jeff Law - - * errfn.c: Rework to avoid problems when HOST_WIDE_INT is longer - than a pointer. - -Sun Apr 12 22:31:19 1998 Richard Kenner - - * cvt.c (cp_convert_to_pointer): Use TYPE_PRECISION. - -Fri Apr 10 12:16:49 1998 Benjamin Kosnik - - * decl.c (duplicate_decls): Don't warn for redundant decls if - friend: let add_friend take care of it. - -Thu Apr 9 02:40:48 1998 Jason Merrill - - * sig.c (build_signature_pointer_constructor): Don't set - TREE_HAS_CONSTRUCTOR for a signature pointer. - * cvt.c (ocp_convert): Don't force a temporary for internal structs. - * init.c (resolve_offset_ref): Warn about implicit & on pmfs - here, too. - * typeck.c (build_unary_op): Only allow taking the address of a - real constructor. - * typeck2.c (digest_init): Simplify. - (store_init_value): Don't pedwarn about using { } for pmfs. - -Thu Apr 9 22:16:57 1998 Per Bothner - - * cp-tree.h (start_decl): Update prototype. - * decl.c (start_decl): Like the C version, new parameters - for the attributes. Call cplus_decl_attributes here, - (pushdecl): Like C version, do build_type_copy if TYPE_DECL, - (grokdeclarator): Pass NULL for new start_decl arguments. - * pt.c (tsubst_expr): Likewise. - * parse.y: Merge cplus_decl_attribute calls into start_decl calls. - * typeck.c (common_type): Check TYPE_MAIN_VARIANT. - * lex.c (build_lang_decl): Add lang_name_java. - * class.c (push_lang_context): Add lang_name_java. - * method.c (build_mangled_name): Check for is_java_type. - -Thu Apr 9 22:16:57 1998 Benjamin Kosnik - - * decl.c (grokdeclarator): Check TYPE_MAIN_VARIANT. - * call.c (build_scoped_method_call): Check for TREE_CODE for - VOID_TYPE instead of type == void_type_node. - (build_method_call): Likewise. - * decl.c (lookup_name_real): Likewise. - (grokdeclarator): Likewise. - (start_decl): Likewise. - (grokparms): Likewise. - (start_function): Likewise. - (finish_function): Likewise. - (start_method): Likewise. - -Thu Apr 9 00:18:44 1998 Dave Brolley (brolley@cygnus.com) - - * lex.c (finput): New variable. - (init_cpp_parse): Renamed from init_parse. - (init_parse): Handle !USE_CPPLIB. Call init_cpp_parse when finished. - (finish_parse): New function. - * cp-tree.h (init_lex, init_parse): Remove declarations. - -Mon Apr 6 02:25:05 1998 Jason Merrill - - * call.c (build_call): Still evaluate the actual argument. - * class.c (is_empty_class): Update for -fnew-abi. - - * decl2.c: -fnew-abi implies -fsquangle. - - * method.c (do_build_assign_ref): Don't do anything to copy - an empty class. - (do_build_copy_constructor): Likewise. - * call.c (build_over_call): Likewise. - -Sat Apr 4 18:43:58 1998 Jason Merrill - - * tree.c (avoid_overlap): Return a value. - -Sat Apr 4 12:52:35 1998 Jeffrey A Law (law@cygnus.com) - - * method.c (check_btype): Add missing argument to xrealloc. - (check_ktype): Likewise. - -Fri Apr 3 02:22:59 1998 Jason Merrill - - Implement empty base optimization. - * class.c (finish_struct_1): Add vbase fields earlier. Set - CLASSTYPE_SIZE of an empty base to 0. Types with bases can be empty. - * search.c (dfs_check_overlap, dfs_no_overlap_yet): New fns. - (types_overlap_p): New fn. - * tree.c (avoid_overlap): New fn. - (build_base_fields): Use it to avoid overlapping empty bases. - * cp-tree.h, decl2.c, lang-options.h: Add -fnew-abi. - - * decl.c (cplus_expand_expr_stmt): Strip unused INDIRECT_REFs. - - Re-implement allocation of base class subobjects. - * tree.c (unshare_base_binfos): New fn. - (layout_basetypes): Use it. Now handles offsets of both virtual and - non-virtual bases, after layout_type. - (layout_vbasetypes): Remove. - (build_base_fields): Generate FIELD_DECLs for each non-virtual base. - (build_vbase_pointer_fields): Split out from old layout_basetypes. - * class.c (finish_base_struct): Lose offset handling code. - Move nonvdtor warning here. Don't mess with t_binfo anymore. - (finish_struct_1): Don't mess with t_binfo anymore. Use fns above. - * cp-tree.h: Adjust. - -Thu Apr 2 14:25:13 1998 Jason Merrill - - * cp-tree.h: Lose CLASSTYPE_VBASE_SIZE, some unused stuff. - * decl.c, decl2.c, pt.c, ptree.c, lex.c: Likewise. - * class.c (duplicate_tag_error): Likewise. - (finish_struct_1): Set CLASSTYPE_SIZE, CLASSTYPE_MODE, CLASSTYPE_ALIGN. - * tree.c (layout_vbasetypes): Update from layout_record, remove - var_size support, use CLASSTYPE_SIZE instead of CLASSTYPE_VBASE_SIZE. - (layout_basetypes): Likewise. - -Wed Apr 1 18:22:25 1998 Jeffrey A Law (law@cygnus.com) - - * class.c, Make sure system.h is included just after config.h. - Delete lingering stdio and errno references too. - * decl.c, errfn.c, parse.y, ptree.c search.c, xref.c: Likewise. - -Wed Apr 1 15:38:36 1998 Jason Merrill - - * friend.c (is_friend): Fix access control for local classes. - - * class.c (is_empty_class): New fn. - * call.c (build_call): Don't pass empty class objects to a function. - -Wed Apr 1 14:58:35 1998 Mark Mitchell - - * call.c (build_over_call): Do name resolution for default - arguments of function templates in the scope of the templates. - -Tue Mar 31 13:43:57 1998 Jeffrey A Law (law@cygnus.com) - - * call.c: Include system.h. Remove includes, declarations and - defines provided by system.h. - * class.c, cvt.c, decl.c, decl2.c, errfn.c error.c: Likewise. - * except.c, expr.c friend.c, g++spec.c, init.c, input.c: Likewise. - * lex.c, parse.y, pt.c, ptree.c repo.c rtti.c, search.c: Likewise. - * semantics.c, sig.c, spew.c, tree.c, typeck.c: Likewise. - * typeck2.c, xref.c: Likewise. - * Makefile.in: Dependencies updated as appropriate. - * Make-lang.in: Likewise. - -Mon Mar 30 12:15:00 1998 Mark Mitchell - - * pt.c (fn_type_unification): Allow incomplete unification without - an immediate error message. - -Mon Mar 30 08:55:42 1998 Jason Merrill - - * tree.c (member_p): New fn. - * decl2.c (finish_file): Only set DECL_STATIC_FUNCTION_P for - initializing class members. - - * cp-tree.def (TEMPLATE_PARM_INDEX): Class 'x'. - * ptree.c (lang_print_xnode): Handle TEMPLATE_PARM_INDEX. - - * call.c (build_method_call): Handle non-scoped destructors, too. - * pt.c (tsubst_copy): Likewise. - - * pt.c (print_template_context): Split out... - (push_tinst_level): ...from here. - - * friend.c (is_friend): Don't pass a type to decl_function_context. - - * typeck.c (convert_for_initialization): Always hand off - conversions to class type. - -Sun Mar 29 20:01:59 1998 Jason Merrill - - * friend.c (is_friend): Local classes have the same access as the - enclosing function. - -Sun Mar 29 00:47:32 1998 Jeffrey A Law (law@cygnus.com) - - * typeck.c (expand_target_expr): Delete dead function. - - * search.c: Put various prototypes inside #ifdef MI_MATRIX. - - * repo.c (save_string): Delete dead function. - - * method.c (thunk_printable_name): Delete dead function. - - * lex.c (yynextch): Delete dead function. - - * expr.c (tree_extract_aggr_init): #if 0 out. - - * except.c (do_unwind): Delete dead function. - (easy_expand_asm): Likewise. - - * cvt.c (build_conversion_type_1): Delete dead function. - - * cp-tree.h (push_expression_obstack): Declare. - - * call.c (source_type): #if 0 out. - - * class.c (alter_access): Remove unused label. Add braces - around empty else clause. - - * lex.c (yyprint): Fix argument to printf. - -Sat Mar 28 17:43:52 1998 Mark Mitchell - - * pt.c (tsubst): Clear TREE_USED for new FUNCTION_DECLs. - - * pt.c (instantiate_class_template): Make sure template - arguments are permanent. - * init.c (resolve_offset_ref): Don't go looking around in - template types. - - * semantics.c: Add routines to handle expressions, and some - declaration processing. - * parse.y: Use them. - (current_class_depth): Move declaration to cp-tree.h. - * parse.c: Regenerated. - * cp-tree.h: Use them. - (current_class_depth): Declare. - * pt.c (tsubst_copy): Use begin_stmt_expr and finish_stmt_expr. - -Fri Mar 27 20:23:18 1998 Mark Mitchell - - * error.c (dump_decl): Be a bit more explicit with template - type arguments, when verbose. - -Fri Mar 27 18:16:40 1998 Jason Merrill - - * inc/exception: Reorder closing braces. - -Fri Mar 27 13:22:18 1998 Mark Mitchell - - * pt.c (redeclare_class_template): New function. - * cp_tree.h (redeclare_class_template): Declare it. - * decl.c (xref_tag): Use it. - -Thu Mar 26 11:16:30 1998 Jason Merrill - - * call.c (build_over_call): Check IS_AGGR_TYPE, not - TYPE_LANG_SPECIFIC. - * typeck.c (convert_arguments): Likewise. - - * decl.c (grokdeclarator): Remove const and volatile from type after - setting constp and volatilep. - - * class.c (finish_struct_1): Don't warn about bool bitfield larger - than one bit. - -Thu Mar 26 10:25:52 1998 Mark Mitchell - - * pt.c (convert_nontype_argument): STRIP_NOPS where appropriate. - -Thu Mar 26 10:24:05 1998 Mark Mitchell - - * call.c (build_object_call): Complain about ambiguous operator(), - rather that crashing. - (build_new_op): Likewise. - (build_op_delete_call): Likewise. - -Thu Mar 26 10:23:24 1998 Mark Mitchell - - * cvt.c (perform_qualification_conversions): Use comp_target_types - instead of comp_ptr_ttypes. - -Wed Mar 25 16:10:50 1998 Mark Mitchell - - * cp-tree.h (enforce_access): Declare. - * call.c (enforce_access): Make it extern, not static. - * class.c (alter_access): Use enforce_access; modify code for ISO - compliance, rather than ARM rules. - -Wed Mar 25 12:10:45 1998 Kriang Lerdsuwanakij - - * cp-tree.h: Fix typo. - -Wed Mar 25 02:01:02 1998 Jason Merrill - - * expr.c (cplus_expand_expr): Only do PCC_STATIC_STRUCT_RETURN thing - if (aggregate_value_p (type)). - - * decl2.c (constructor_name_full): Handle TYPENAME_TYPE. - -Tue Mar 24 16:12:01 1998 Mark Mitchell - - * tree.c (mapcar): When dealing with a DECL, use it's constant - value, if any. - * pt.c (lookup_template_class): Don't mangle the names of template - classes whose arguments are unknown. - - * pt.c (tsubst_expr): Handle GOTO_STMT correctly. - -Tue Mar 24 12:21:55 1998 Benjamin Kosnik - - * decl.c (init_decl_processing): Set TYPE_PRECISON for bools to 1. - -Tue Mar 24 12:21:48 1998 Jim Wilson - - * decl.c (init_decl_processing): Initialize TYPE_MAX_VALUE for - boolean_type_node to 1. - -Tue Mar 24 10:23:47 1998 Mark Mitchell - - * error.c (dump_expr): Remove unused variable `l'. - - * pt.c (for_each_template_parm): New function, created by - converting uses_template_parms. - (tree_fn_t): New typedef. - (uses_template_parms): Use it. - (mark_template_parm): New function. - (push_template_decl): Check that the argument list of a partial - specialization uses all the template parameters. - - * Make-lang.in (c++filt): Don't delete cxxmain.c after we're done - with it; we might want it for debugging. - * cp-tree.h (type_unification): Change interface. - * class.c (finish_struct_1): Skip nested template types, just like - ordinary nested types. - (instantiate_type): Use new interface to type_unification. - * lex.c (init_lex): Add __sz as opname for sizeof. - * method.c (build_overload_scope_ref): New function. - (build_overload_int): Handle complex expressions. Set - numeric_output_need_bar if necessary. - (build_overload_value): Handle non-PARM_DECL nodes; this - routine is now used by build_overload_int. Remove some - assignments to numeric_output_need_bar. Use - build_overload_scope_ref. - (build_qualified_name): Note that some template mangled names end - with digits, and set numeric_output_need_bar appropriately. Use - build_underscore_int. - * pt.c (unify): Change interface. - (type_unification_real): Likewise. - (determine_specialization): Use new interfaces. - (tsubst): Deal gracefully with situations in which the argument - vector is not fully filled. - (fn_type_unification): Use new interfaces. - (type_unification): Likewise. Remove NOP_EXPR hack. - (type_unification_real): Likewise. - (unify): Likewise. Deal with unification of complex expressions. - -Mon Mar 23 12:24:37 1998 Jason Merrill - - * pt.c (complete_template_args): Initialize skip properly. - - * decl.c (make_typename_type): Revert. - (make_implicit_typename): Remove. - (lookup_name_real): Don't call it. Call lookup_field if we see a - TYPE_DECL from a template base. - * search.c (lookup_field): Do implicit typename stuff. - -Sun Mar 22 00:50:42 1998 Nick Clifton - Geoff Noer - - * Makefile.in: Various fixes for building cygwin32 native toolchains. - * Make-lang.in: Likewise. - -Fri Mar 20 18:07:39 1998 Kriang Lerdsuwanakij - - * pt.c (tsubst, TEMPLATE_TEMPLATE_PARM): Simplify. - -Fri Mar 20 10:42:07 1998 Jason Merrill - - * decl.c (make_implicit_typename): Rewrite removed code. - (make_typename_type): Call it if the type we look up comes from - a base that uses template parms. - - * pt.c (complete_template_args): Rewrite. - (tsubst, FUNCTION_DECL): Use it. - -Fri Mar 20 08:12:43 1998 H.J. Lu (hjl@gnu.org) - - * semantics.c (finish_asm_stmt): Fix combine strings. Call - c_expand_asm_operands () if output_operands, input_operands or - clobbers is not NULL_TREE. - -Fri Mar 20 00:10:19 1998 Kriang Lerdsuwanakij - - * pt.c (complete_template_args): New function. - (get_bindings): Deal with specializations of function templates - with return type containing parameters from outer class - templates. - (tsubst, TEMPLATE_TEMPLATE_PARM): When reducing parameter level, - substitute arguments and compose a new type. - -Thu Mar 19 19:01:48 1998 Mark Mitchell - - * pt.c (tsubst): Clear DECL_PENDING_INLINE_INFO for new - FUNCTION_DECLs. - -Thu Mar 19 11:51:58 1998 Jason Merrill - - * decl.c (make_implicit_typename): Lose useless code. - - * call.c (standard_conversion): Handle A* -> const A* properly. - - * pt.c (get_bindings_real): Rename from get_bindings. Add - check_rettype parm. - (get_bindings): Pass 1. - (get_bindings_overload): Pass 0. - -Wed Mar 19 09:08:12 1998 Mark Mitchell - - * pt.c (check_explicit_specialization): When reverting a static - member function, also remove the `this' parameter from - last_function_parms. - -Thu Mar 19 02:27:48 1998 Jason Merrill - - * pt.c (tsubst_copy, CONST_DECL): Don't bother tsubsting - a function context. - - * decl.c (store_bindings): Use free_binding_vecs. - (pop_from_top_level): Likewise. - -Wed Mar 18 12:41:43 1998 Jason Merrill - - * decl.c (make_implicit_typename): Only change the type of a - TYPENAME_TYPE. - -Wed Mar 18 10:09:51 1998 Mark Mitchell - - * semantics.c: New file, containing routines to perform the - semantic phase of parsing. - * parse.y: Use it. - * pt.c (tsubst_expr): Likewise. - * cp-tree.h: Declare the various functions in semantics.c. - Provide macros to access _STMT tree nodes. - * cp-tree.def: Add ASM_STMT tree node. - * Makefile.in, Make-lang.in: Add dependencies on and for - semantics.c. - -Wed Mar 18 00:24:10 1998 Jason Merrill - - * pt.c (push_template_decl): Only check primary templates. - - * pt.c (check_explicit_specialization): Complain about default args - in explicit specialization. - - * parse.y (nomods_initdcl0): Also call cp_finish_decl for a - constructor_declarator. - -Tue Mar 17 14:44:54 1998 Mark Mitchell - - * typeck2.c (build_x_arrow): Don't crash when an aggregate type - has no overloaded operator ->. - - * call.c (build_field_call): Don't crash when presented with a - field that is actually a nested type. - - * decl.c (pushtag): Deal with friend class injection in local - classes. - - * call.c (build_object_call): Don't crash if OBJ is a - pointer-to-member-function. - -Tue Mar 17 11:40:26 1998 Jason Merrill - - * pt.c (push_template_decl): Complain about template with C linkage, - anonymous template class. - -Mon Mar 16 12:10:39 1998 Jason Merrill - - * class.c (pushclass): Only use the mi_matrix stuff #ifdef MI_MATRIX. - * search.c: Likewise. - - * lex.c (do_pending_defargs): Only call - maybe_{begin,end}_member_template_processing for FUNCTION_DECLs. - - * parse.y (initdcl0_innards): Move maybeasm back into initdcl0 et al. - -Mon Mar 16 10:47:22 1998 Mark Mitchell - - * parse.y: Deal with CONSTRUCTORS in new_initializers. - -Mon Mar 16 10:54:21 1998 Mark Mitchell - - * pt.c (tsubst_copy): Deal with BIND_EXPR in a way that more - closely mimics the behavior in parse.y. - (tsubst_expr): Return the resulting BLOCK when making a tsubst'ing - into a compound statement. - -Sun Mar 15 02:07:26 1998 Jason Merrill - - * cp-tree.h (TEMPLATE_PARMS_FOR_INLINE): New macro. - * pt.c (inline_needs_template_parms): New fn. - (original_template): New fn. - (push_inline_template_parms_recursive): New fn. - (maybe_begin_member_template_processing): Use them. - (maybe_end_member_template_processing): Likewise. - (is_member_or_friend_template): Rename to is_member_template. - Member functions of local classes are never member templates. - -Sun Mar 15 01:14:22 1998 Kriang Lerdsuwanakij - - * lex.c (do_identifier): Handle TEMPLATE_DECL that was - added in the class scope to catch redefinition error. - - * pt.c (reduce_template_parm_level): Also copy - the DECL_TEMPLATE_PARMS field. - -Sun Mar 15 10:54:08 1998 Mark Mitchell - - * pt.c (tsubst): Clear TYPE_REFERENCE_TO when creating a - reduced-level template type parameter. - -Sun Mar 15 12:26:02 1998 Manfred Hollstein - - * cp-tree.h (struct lang_decl_flags): Add needs_final_overrider. - (DECL_NEEDS_FINAL_OVERRIDER_P): New macro. - * class.c (override_one_vtable): Set DECL_NEEDS_FINAL_OVERRIDER_P. - * decl.c (duplicate_decls): Propagate it. - * typeck2.c (abstract_virtuals_error): Use two loops to emit - abstract virtual functions and virtual functions which need a - final overrider separately. - -Thu Mar 12 09:39:40 1998 Manfred Hollstein - - * lang-specs.h: Properly put brackets around array elements in - initializer. - - * typeck.c (build_binary_op_nodefault): Correctly place parens around - && and || in expression. - -Thu Mar 12 09:26:04 1998 Manfred Hollstein - - * call.c (default_parm_conversions): Remove prototype definition. - (build_method_call): Remove unused variable result. - - * cvt.c (ocp_convert): Remove unused variable conversion. - - * decl2.c (ambiguous_decl): Add explicit parameter definition for name. - - * except.c (do_unwind): #if 0 definition of unused variables fcall - and next_pc. - - * expr.c (extract_scalar_init): #if 0 prototype and function - definition. - - * init.c (expand_aggr_init_1): Remove unused variable init_type. - (build_new_1): Remove unused variable t. - - * pt.c (instantiate_class_template): Remove unused variable newtag; - cast called function return value to void. - (do_decl_instantiation): Remove unused variables name and fn. - - * tree.c (get_type_decl): Add default return to shut up compiler from - complaining control reaches end of non-void function. - - * typeck.c (build_x_conditional_expr): Remove unused variable rval. - -Thu Mar 12 09:12:15 1998 Manfred Hollstein - - * call.c (default_parm_conversions): Remove prototype definition. - (build_method_call): Remove unused variable result. - (build_over_call): Add default case in enumeration switch. - -Thu Mar 12 08:39:13 1998 Manfred Hollstein - - * decl2.c (lang_decode_option): Change j's type to size_t. - - * tree.c (layout_vbasetypes): record_align and desired_align are of - type unsigned int; const_size and nonvirtual_const_size likewise. - -Wed Mar 11 07:25:20 1998 Mark Mitchell - - * parse.y (new_initializer): Make sure all initializers are - lists. - -Tue Mar 10 07:32:36 1998 Mark Mitchell - - * decl2.c (import_export_decl): Mark tinfo functions for - cv-qualified versions of class types as DECL_NOT_REALLY_EXTERN. - -Fri Mar 6 23:27:35 1998 Jeffrey A Law (law@cygnus.com) - - * method.c: Fix typo. - -Fri Mar 6 10:06:59 1998 Kaveh R. Ghazi - - * method.c: Include "system.h" to get stdlib.h, stdio.h, - ctype.h, string.h, etc. - (issue_nrepeats): Add default case in enumeration switch. - (check_btype): Likewise. - (process_overload_item): Likewise. - - * Makefile.in (method.o): Depend on system.h. - -Wed Mar 4 22:26:53 1998 Andreas Schwab - - * lex.c (do_scoped_id): Fix parenthesizing. - -Wed Mar 4 12:11:53 1998 Michael Tiemann - - * rtti.c (get_tinfo_fn_dynamic): If this function is called an - FLAG_RTTI is unset, initialize type info machinery and continue - with FLAG_RTTI enabled. - (get_typeid): Likewise. - -Wed Mar 4 11:47:55 1998 Jason Merrill - - * typeck.c (unary_complex_lvalue): &D::i has type B::* if i comes - from B. - -Wed Mar 4 11:28:08 1998 Mark Mitchell - - * pt.c (finish_member_template_decl): Deal more gracefully with - invalid declarations. - -Tue Mar 3 01:38:17 1998 Jason Merrill - - * cvt.c, decl.c, decl2.c, init.c, rtti.c, typeck.c, typeck2.c, - cp-tree.h: Clean up more old overloading code, old RTTI code, and - some formatting quirks. - - * call.c, class.c, cp-tree.h, cvt.c, decl.c, init.c, lex.c, - method.c, pt.c, ptree.c, typeck.c: Remove support for - -fno-ansi-overloading and overloading METHOD_CALL_EXPR. - * class.h: Remove. - * Makefile.in: Adjust. - - * pt.c (unify): Don't allow reduced cv-quals when strict. - - * call.c, class.c, pt.c, cp-tree.h: Remove nsubsts parm from - *type_unification* and unify. - -Mon Mar 2 12:11:06 1998 Jason Merrill - - * parse.y (explicit_template_type): Remove TEMPLATE keyword. - (nested_name_specifier): And add it before this use. - (typename_sub0): And this use. Also add use without the keyword. - (typename_sub1): Likewise. - * pt.c (instantiate_class_template): Don't actually instantiate - anything if our type uses template parms. - -Mon Mar 2 11:04:59 1998 Jim Wilson - - * decl.c (start_function): Don't call temporary_allocation for a - nested function. - -Sun Mar 1 21:06:37 1998 Jason Merrill - - * pt.c (instantiate_class_template): Don't mess with friends if - our type uses template parms. - -Sat Feb 28 12:06:44 1998 Jason Merrill - - * parse.y (nested_name_specifier): Use explicit_template_type. - (typename_sub): Allow a template_type, an explicit_template_type, - or an implicit template type at the end. - * lex.c (yyprint): Handle a PTYPENAME being a TEMPLATE_DECL. - * decl.c (make_typename_type): Handle template-id where the name - is a TEMPLATE_DECL. - * call.c (build_scoped_method_call): Handle member template - destructor call. - * pt.c (tsubst_copy, METHOD_CALL_EXPR): Don't assume a member - destructor is represented by the type. - - * cp-tree.h (TYPENAME_TYPE_FULLNAME): New macro. - * parse.y (nested_name_specifier): Add 'template' case. - (explicit_template_type): New rule. - (typename_sub): Use it. - * decl.c (make_typename_type): Handle getting a template-id for NAME. - * pt.c (tsubst): Likewise. - -Fri Feb 27 11:17:50 1998 Jason Merrill - - * pt.c (add_to_template_args): Fix thinko. - (instantiate_class_template): Call it later. - - * pt.c (get_class_bindings): Add outer_args parm. - (most_specialized_class): Likewise. - (instantiate_class_template): Pass it. - (more_specialized_class): Likewise. - (lookup_template_class): Get context from template if none - was specified. - (finish_member_template_decl): Don't do anything with a - partial specialization. - * decl2.c (check_member_template): Use IS_AGGR_TYPE instead of - AGGREGATE_TYPE_P. - * class.c (finish_struct): Member class templates have already been - checked for name clashes. - * decl.c (pushdecl_with_scope): Handle pushing at class level. - -Fri Feb 27 02:25:16 1998 Jason Merrill - - * pt.c (tsubst, TEMPLATE_DECL): Support member class templates. - (tsubst, *_PARM): Support multiple levels of template classes. - (instantiate_class_template): Look up the pattern from the - original template. - (lookup_template_class): Handle getting a template for d1. - (push_template_decl): Correct setting of 'primary'. - (reduce_template_parm_level): Add 'levels' parm. - (finish_member_template_decl): Support member class templates. - (template_class_depth): Handle multiple levels. - * parse.y (component_decl_1, fn.def2): Remove member template case. - (component_decl): Add member template cases. - * decl2.c (check_member_template): We now handle member template - classes. - * decl.c (pushtag): Handle member templates. - * method.c (do_inline_function_hair): Don't touch - IDENTIFIER_GLOBAL_VALUE. - * init.c (build_offset_ref): If name isn't an identifier, just - return it. - * spew.c (yylex): Handle PTYPENAME like TYPENAME. - - * typeck.c (get_delta_difference): Do adjust for conversions to - and from virtual base. - -Wed Feb 25 09:51:29 1998 Jason Merrill - - * typeck.c (get_delta_difference): Give hard error for conversion - from virtual base. - - * cp-tree.h: Tweak formatting. - -Wed Feb 25 00:35:33 1998 Jason Merrill - - * decl.c (push_namespace): Handle redeclaration error. - - * cp-tree.h (IDENTIFIER_NAMESPACE_VALUE): New macro. - (IDENTIFIER_NAMESPACE_BINDINGS): New macro. - (NAMESPACE_BINDING): New macro. - (IDENTIFIER_GLOBAL_VALUE): Use NAMESPACE_BINDING. - * *.c: Use them. - - * pt.c (push_template_decl): Use innermost_args. - - * decl.c (get_unique_name): Tweak from earlier in the name. - -Tue Feb 24 22:15:04 1998 Martin von Loewis - - * cp-tree.def: Add CPLUS_BINDING node. - * cp-tree.h (tree_binding): New struct. - (BINDING_SCOPE, BINDING_VALUE): New macros. - (current_namespace, global_namespace): Declare extern. - (struct lang_decl_flags): New field in_namespace. - (DECL_NAMESPACE_USING, DECL_NAMESPACE_USERS): New macros. - (DECL_NAMESPACE, SET_DECL_NAMESPACE): New macros. - (TREE_INDIRECT_USING): New macro. - * decl2.c (current_namespace, global_namespace): Declare. The - value is a NAMESPACE_DECL now, not a TREE_LIST. - (is_namespace_ancestor, namespace_ancestor): New static functions. - (add_using_namespace, ambiguous_decl): Likewise. - (lookup_using_namespace): New support function for lookup_name. - (qualified_lookup_using_namespace): New support function for - do_scoped_id and lookup_namespace_name. - (get_namespace_id): Mark as obsolete. - (current_namespace_id): Likewise. - (do_namespace_alias): Implement. - (do_using_directive): Implement as call to add_using_namespace. - * decl.c (binding_for_name): New function. - (push_namespace, pop_namespace): Implement. - (push_decl): Don't install a FUNCTION_DECL in the global branch. - (lookup_namespace_name): Implement using qualified lookup. - (lookup_name_real): For global scoping, lookup in - global_namespace. For namespace scoping, lookup in given - namespace. For unscoped lookup, iterate over namespace, - considering using directives. - (init_decl_processing): Initialize global_namespace. - (grokvardecl): Build assembler name as static name for globals. - (grokdeclarator): Remove old namespace mangling. - (xref_tag): When installing a global binding for the - tag, make sure we have an identifier. - * method.c (build_overload_nested_name): Mangle namespaces. - (build_qualified_name): Likewise. - (build_decl_overload_real): Likewise. - * lex.c (build_lang_decl): Set namespace for new declaration to - current_namespace. - (do_scoped_id): Find global names in global or current - namespace, or using qualified namespace lookup, depending on - context. - * init.c (build_member_call): When scope is namespace, use - build_x_function_call instead. - (build_offset_ref): When scope is namespace, collapse processing - to lookup_namespace_name instead. - * error.c (dump_decl): Support NAMESPACE_DECL. - * decl.c (pushdecl): Bind globals to current namespace. - (push_overloaded_decl): Likewise. - (lookup_tag): Likewise. - (lookup_name_current_level): Likewise. - (xref_tag): Likewise. - (start_function): Likewise. - * lex.c (do_identifier): Likewise. - (identifier_typedecl_value): Likewise. - (real_yylex): Likewise. - * method.c (do_inline_function_hair): Likewise. - * parse.y (unscoped): Likewise. - * pt.c (check_explicit_specialization): Likewise. - (lookup_template_class): Likewise. - * rtti.c (call_void_fn): Likewise. - * sig.c (build_sigtable): Likewise. - * ptree.c (lang_print_xnode): New function. - -Tue Feb 24 01:40:24 1998 Jason Merrill - - * pt.c (instantiate_class_template): Don't instantiate if pedantic - and the args use template parms. - - * pt.c (push_tinst_level): If the instantiation uses template parms, - fail silently. - * decl.c (xref_basetypes): Do call complete_type for basetypes - that involve template parameters. - -Tue Feb 24 00:36:43 1998 Jason Merrill - - * typeck2.c (process_init_constructor): Fix labeled init check. - -Mon Feb 23 05:08:55 1998 Jason Merrill - - * pt.c, call.c, decl.c, method.c, cp-tree.h: Remove unused NARGS - argument to tsubst and friends. - - * pt.c (tsubst, FUNCTION_DECL): Tidy. - - * typeck.c (build_x_function_call): Handle static member function - templates like non-templates. Handle friend templates like normal - function templates. - * pt.c (tsubst, *_PARM): Don't use orig_level. - (get_bindings): Don't call add_to_template_args. - (instantiate_template): Likewise. - (tsubst, FUNCTION_DECL): Call add_to_template_args as appropriate. - * ptree.c (print_lang_type): Print index/level for template parms. - -Mon Feb 23 02:52:29 1998 Mark Mitchell - - * Make-lang.in (cc1plus): Note that cc1plus depends on - cp/cp-tree.h and cp/cp-tree.def. - - * cp-tree.def (TEMPLATE_CONST_PARM): Remove. - (TEMPLATE_PARM_INDEX): New tree code, used to indicate a - position in a template parameter list. - * cp-tree.h (template_parm_index): New structure, used as the tree - structure for a TEMPLATE_PARM_INDEX. - (TEMPLATE_PARM_IDX): New macro. - (TEMPLATE_PARM_LEVEL): Likewise. - (TEMPLATE_PARM_DESCENDANTS): Likewise. - (TEMPLATE_PARM_ORIG_LEVEL): Likewise. - (TEMPLATE_PARM_DECL): Likewise. - (TEMPLATE_TYPE_PARM_INDEX): Likewise. - (TEMPLATE_TYPE_ORIG_LEVEL): Likewise. - (TEMPLATE_TYPE_DECL): Likewise. - (TEMPLATE_CONST_IDX): Remove. - (TEMPLATE_CONST_LEVEL): Likewise. - (TEMPLATE_CONST_SET_INFO): Likewise. - (TEMPLATE_TYPE_SET_INFO): Likewise. - (TEMPLATE_TYPE_IDX): Redefine in terms of TEMPLATE_PARM_INDEX - node. - (TEMPLATE_TYPE_LEVEL): Likewise. - * decl.c (decls_match): Call comp_template_parms, rather than - expanding it inline. - (duplicate_decls): If two template declarations are being merged, - then their TEMPLATE_INFOs should be merged as well. - (grokfndecl): Save template-id information when declaring a friend - with explicit template arguments. Pass arguments to - check_explicit_specialization via correct convention; at some - point check_explicit_specialization changed, but these call-sites - did not. - (grokdeclarator): Tidy up slightly. - * decl2.c (check_classfn): Tidy up slightly. Don't assume that - two template functions with the same DECL_ASSEMBLER_NAME the same, - since the names are not yet mangled. - * error.c (dump_decl): Use TEMPLATE_PARM_INDEX instead of - TEMPLATE_CONST_PARM. - (dump_expr): Likewise. Use the TEMPLATE_PARM_DECL to get at the - decl for a non-type parameter, rather than printing `'. - * friend.c (is_friend): Handle TEMPLATE_DECL friends. - (do_friend): Deal with template friends. - * lex.c (do_pending_inlines): Call - maybe_begin_member_template_processing, rather than - conditionally calling begin_member_template_processing. - (process_next_inline): Likewise. Call - maybe_end_member_template_processing, rather than - conditionally calling end_member_template_processing. - (do_pending_defargs): Likewise. - (do_identifier): Use TEMPLATE_PARM_INDEX instead of - TEMPLATE_CONST_PARM. - * method.c (build_mangled_template_parm_index): New function. - (build_overload_value): Use it. - (build_overload_name): Likewise. - * pt.c (finish_member_template_decl): Allow friend declarations. - (template_class_depth): New function. - (is_member_template): Rename, and modify, to become... - (is_member_or_friend_template): New function. - (end_member_template_processing): Rename, and modify, to become... - (maybe_end_member_template_processing). - (build_template_parm_index): New function. - (reduce_template_parm_level): New function. - (process_template_parm): Modify to use build_template_parm_index. - (push_template_decl): Deal with friend templates. - (uses_template_parms): Use TEMPLATE_PARM_INDEX instead of - TEMPLATE_CONST_PARM. - (tsubst_friend_function): New function. - (instantiate_class_template): Generate the DECL_FRIENDLIST - for a new instantiation by using tsubst_friend_function rather - than just tsubst. - (tsubst): Don't tsubst into a type which is a TEMPLATE_DECL. - Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM, and the - appropriate new macros. Use reduce_template_parm_level to - generate lower-level template parameters. Handle tsubst'ing into - TEMPLATE_DECLS that declare TEMPLATE_TEMPLATE_PARMS. Don't forget - to tsubst the DECL_CONTEXT and DECL_CLASS_CONTEXT of newly created - templates. Similarly for the template parameters for a new - template. - (tsubst_copy): Tidy up slightly. Use TEMPLATE_PARM_INDEX instead - of TEMPLATE_CONST_PARM. Handle TYPE_DECLs by tsubsting into them. - (unify): Use TEMPLATE_PARM_INDEX instead of TEMPLATE_CONST_PARM. - (get_bindings): Call add_to_template_args if necessary. - (instantiate_decl): Handle instantiations of friend templates. - * search.c (lookup_field_1): Don't treat the TYPE_FIELDS of a - TEMPLATE_TYPE_PARM as a list of fields; it's not! - * spew.c (yylex): Do a little manual constant propagation to - clarify the code. - -Sun Feb 22 19:53:29 1998 Jeffrey A Law (law@cygnus.com) - - * error.c: Include sys/types.h. - -Thu Feb 19 14:49:09 1998 Jeffrey A Law (law@cygnus.com) - - * method.c (build_mangled_name): Start CPP directives in column zero. - -Thu Feb 19 10:36:48 1998 Jason Merrill - - * typeck2.c (process_init_constructor): Sorry about non-trivial - labeled initializers. - * parse.y (initlist): Re-enable labeled initializers. - -Thu Feb 19 10:15:55 1998 Kriang Lerdsuwanakij - - * pt.c (coerce_template_parms): Add a new parameter, is_tmpl_parm, - all callers changed. Rely on the new parameter instead of arg - being a TREE_LIST when determine whether we are working inside - template template parameter. Clean up is_type test. - -Thu Feb 19 10:04:12 1998 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Preserve TREE_CONSTANT. - * typeck2.c (initializer_constant_valid_p): Allow conversions - between pointers and references. - -1998-02-19 Brendan Kehoe - - * typeck.c (build_unary_op): Only warn about incr/decr a pointer - if pedantic || warn_pointer_arith. - -Thu Feb 19 09:37:21 1998 Kriang Lerdsuwanakij - - * pt.c (unify): Handle TEMPLATE_DECL. - -1998-02-18 Brendan Kehoe - - * cp-tree.h (strip_attrs): Remove decl. - -1998-02-18 Doug Evans - - * decl.c (duplicate_decls): Call merge_machine_decl_attributes. - Update olddecl's attributes too. - (strip_attrs): Remove function. - * typeck.c (common_type): Call merge_machine_type_attributes. - -Tue Feb 17 14:07:52 1998 Mark Mitchell - - * parse.y (initdcl0_innards): New grammar symbol. - (nomods_initdecls, nomods_initdcl0): Change type from itype to - none, since the resulting value is never used. - (parse_decl): New function. - (datadef): Remove redundant actions. - (initdcl0, notype_initdcl0, nomods_initdcl0): Use initdcl0_innards. - * parse.c: Regenerated. - -Tue Feb 17 11:54:16 1998 Jason Merrill - - * parse.y (simple_stmt): Use getdecls() to check for decl. - -Sat Feb 14 11:50:51 1998 Manfred Hollstein - - * Make-lang.in (DEMANGLER_INSTALL_NAME, DEMANGLER_CROSS_NAME): New - macros. - (c++.install-common): Install c++filt properly as native or as cross - variant. - (c++.uninstall): Add c++filt. - -Fri Feb 13 14:55:37 1998 Jason Merrill - - * call.c (standard_conversion): Fix multi-level ptr conversions. - -Fri Feb 13 14:06:22 1998 Mike Stump - - * init.c (build_new): Propagate error_mark_node up. - -Fri Feb 13 13:24:32 1998 Jason Merrill - - * parse.y (simple_stmt): If the condition isn't a declaration, - start the controlled block after the test. - -Fri Feb 13 02:26:10 1998 Andreas Schwab - - * call.c (build_over_call): Convert builtin abs, labs and fabs to - tree-codes. - * decl.c (init_decl_processing): Re-enable abs, labs and fabs as - builtins. - -Fri Feb 13 01:36:42 1998 Jason Merrill - - * call.c (standard_conversion): A BASE_CONV replaces an RVALUE_CONV. - -Fri Feb 13 00:21:59 1998 Jason Merrill - - * cp-tree.h: Add access_protected_virtual_node. - * class.c (init_class_processing): Initialize it. - * decl.c (xref_basetypes): Use it. - * parse.y (base_class_access_list): Likewise. - - * Make-lang.in (DEMANGLER_PROG): Add $(exeext). - (c++.install-common): Install c++filt. - -Thu Feb 12 12:46:51 1998 Benjamin Kosnik - - * decl.c (shadow_tag): Give error for typedef-ing built-in types. - -Wed Feb 11 23:28:05 1998 Mark Mitchell - - * call.c (reference_binding): Use comptypes when comparing - TYPE_MAIN_VARIANTS to handle non-canonical array/index types. - -Wed Feb 11 16:42:04 1998 Mark Mitchell - - * tree.c (is_overloaded_fn): Use really_overloaded_fn. - (really_overloaded_fn): Move check here from is_overloaded_fn. - (get_first_fn): Use really_overloaded_fn and is_overloaded_fn. - -Wed Feb 11 15:54:18 1998 Mark Mitchell - - * typeck.c (build_ptrmemfunc): Type-check pointer-to-member - conversions. - -Mon Feb 9 22:23:31 1998 Mark Mitchell - - * cp-tree.h (push_template_decl): Return the decl passed in, or an - equivalent duplicate. - * decl.c (pushtag): Use the return value from push_template_decl. - (duplicate_decls): When duplicating a template declaration, merge - the DECL_TEMPLATE_RESULTs as well. - (make_implicit_typename): Don't try to dive into typename types to - find a context for making a new implicit typename. - (start_decl): Use the return value from push_template_decl. - (grokdeclarator): Complain about declarations list `const operator - int'. Since we don't correctly handle in-class initializations of - non-static data members, complain about this (now illegal) - practice. Issue an error for initializations of non-const statics - since that is illegal as well, and since we don't handle that case - correctly either. - (start_function): Use the return value from push_template_decl. - (start_method): Likewise. - * decl2.c (grokfield): Likewise. Since the change to - grokdeclarator ensures that all initialized fields are in fact - static, remove a redundant test for TREE_PUBLIC. - * parse.y (initlist): Disable labeled initializers since they do - not work as per the documentation, and since they do not use the - same syntax as the C front end. - * pt.c (push_template_decl): Return the decl passed in, or an - equivalent duplicate. - (lookup_template_class): When searching in a nested context, - use the right arguments. - (uses_template_parms): Handle the DECL_INITIAL for a CONST_DECL. - * typeck.c (build_component_ref): Assign the correct type to the - result of build_vfn_ref. - -Tue Feb 10 23:56:46 1998 Jason Merrill - - * pt.c (convert_nontype_argument): Fix typo. - (check_explicit_specialization): Allow old-style specialization - of class template members. - -Tue Feb 10 20:36:52 1998 Jason Merrill - Manfred Hollstein - - * decl.c (grokdeclarator): Use DECL_USE_TEMPLATE instead - when deciding to override DECL_ASSEMBLER_NAME. - -Tue Feb 10 15:30:55 1998 Andrew MacLeod - - * decl2.c (lang_f_options): Add -fsquangle to option processing list. - * cp-tree.h (flag_do_squangling): Add declaration. - * lang-options.h: Add -fsquangle and -fno-squangle. - * method.c: Add macros and static variables for squangling. - (build_overload_name): Rename to build_mangled_name, add logic for B - compression, and split into process_modifiers and - process_overload_item. - (process_modifiers): New function, to handle constant, reference, - and pointer types. - (process_overload_item): New function, handles issue of type codes. - (build_overload_name): New function, start squangling and call - build_mangled_name. - (ALLOCATE_TYPEVEC, DEALLOCATE_TYPEVEC): Remove macro and expand inline. - (start_squangling): New function to initialize squangling structs. - (end_squangling): New function to destroy squangling structs. - (nrepeats): Rename variable to Nrepeats. - (issue_nrepeats): New function for issuing 'n' type repeats. - (check_ktype): New function to check for type K name compression. - (build_overload_nested_name): Add a check for K name compression. - (build_qualified_name): Add a check for K name compression and don't - use DECL_ASSEMBLER_NAME when squangling is on. - (check_btype): New function, checks for B type compression. - (build_static_name, build_decl_overload_real): Initiate squangling. - (build_typename_overload, build_overload_with_type): Initiate - squangling - -Sun Feb 8 23:47:38 1998 scott snyder - - * method.c (make_thunk): Avoid name buffer overflow. - -Sat Feb 7 16:48:54 1998 Jason Merrill - - * pt.c (instantiate_decl): Call cp_finish_decl for vars even if we - don't define them yet. - - * parse.y (nomods_initdcl0): Add constructor_declarator case. - -Fri Feb 6 21:32:25 1998 Richard Kenner - - * config-lang.in (diff_excludes): Use basename only. - -Thu Feb 5 19:10:40 1998 Jason Merrill - - * tinfo2.cc: Add tinfo for signed char. - -Thu Feb 5 14:38:23 1998 Mike Stump - - * search.c (compute_access): Handle protected constructors in derived - classes as accessible. - -Wed Feb 4 01:26:49 1998 Jason Merrill - - * expr.c (cplus_expand_expr, PCC_STATIC_STRUCT_RETURN code): - Call convert_from_reference sooner. - -Tue Feb 3 23:50:52 1998 Mark Mitchell - - * cvt.c (ocp_convert): Obtain the constant values from constant - decls even if the destination type is the same as the type of the - decl. - - * decl2.c (finish_file): Make sure that static inlines with - definitions are not marked DECL_EXTERNAL before returning. - -Tue Feb 3 22:43:42 1998 Jason Merrill - - * decl.c: Lose arg_looking_for_template. - (lookup_name_real): Likewise. - * parse.y: Lose processing_template_arg, template_arg1. - (primary): Likewise. - * spew.c (yylex): Set lastiddecl for PTYPENAMEs, too. - -Tue Feb 3 22:04:01 1998 Kriang Lerdsuwanakij - - * error.c (dump_decl): Fix type of default arguments for template - template parameters and nontype template parameters. - * parse.y (template_parm): Handle invalid default template - template arguments here. - - * parse.y (template_parm): Use template_arg instead of PTYPENAME - for default template template argument. - * pt.c (coerce_template_parms): Merge default template argument - codes. Can treat RECORD_TYPE as template name if it is implicitly - created. Fix argument index in error message. - * typeck.c (comptypes): Merge template argument comparison codes in - TEMPLATE_TEMPLATE_PARM and RECORD_TYPE. - -Tue Jan 6 01:42:44 1998 Mumit Khan - - * lex.c (file_name_nondirectory): Also check for '/'. - -Mon Feb 2 11:24:22 1998 Mark Mitchell - - * parse.y (primary): Deal with statement-expressions in - templates. - * pt.c (tsubst_copy): Handle BIND_EXPR. - * tree.c (mapcar): Likewise. - - * call.c (add_template_candidate_real): Pass extra parameter to - fn_type_unification. - * cp-tree.h (fn_type_unification): Add parameter. - * pt.c (fn_type_unification): Add additional parameter to deal with - static member functions. - (get_bindings): Deal with static member functions. - - * cp-tree.h (DECL_NONSTATIC_MEMBER_FUNCTION_P): New macro. - (revert_static_member_fn): Declare. - * decl.c (revert_static_member_fn): Remove declaration. Change - linkage from internal to external. - (cp_finish_decl): Deal with virtual functions in classes local to - template functions. - * decl2.c (finish_file): Don't forget to emit increment/decrement - expressions in initializers for file-scope variables. - * parse.y (typename_sub2): If the typename doesn't names a - template, rather than a type, issue an error message. - * pt.c (check_explicit_specialization): Handle specializations of - static member functions. - (coerce_template_parms): Handle offset references to lists of - member functions. - * search.c (note_debug_info_needed): Don't crash when handed a - type which is being defined. - * typeck.c (complete_type): Don't crash when handed NULL_TREE; - that can happen with some illegal code. - -Mon Feb 2 00:57:38 1998 Kaveh R. Ghazi - - * call.c (user_harshness): Initialize `code' to 0. - (build_method_call): Initialize `candidates', `cp' and `len' to 0. - (null_ptr_cst_p): Add parentheses around && within ||. - (standard_conversion): Likewise. - (z_candidate): Likewise. - (build_user_type_conversion_1): Initialize `args' to NULL_TREE. - (build_object_call): Likewise for `mem_args'. - (build_new_op): Likewise for `mem_arglist'. Add `return' from - default case in enumeration switch. - - * class.c (build_vtable_entry): Add explicit braces to avoid - ambiguous `else'. - (build_class_init_list): Likewise. - (finish_struct_1): Initialize `width' to 0. - (instantiate_type): Initialize `name' to NULL_TREE. Add - explicit braces to avoid ambiguous `else'. - - * cvt.c (convert_to_aggr): Add explicit braces to avoid ambiguous - `else'. - - * decl.c (grok_reference_init): Eliminate unused parameter, all - callers changed. - (record_builtin_type): Initialize `tdecl' to NULL_TREE. - (init_decl_processing): Initialize `vb_off_identifier' to NULL_TREE. - (cp_finish_decl): Initialize `ttype' to NULL_TREE. - (grokdeclarator): Add parentheses around && within ||. Add - explicit braces to avoid ambiguous `else'. - (grokparms): Initialize `type' to NULL_TREE. - (xref_tag): Remove unused label `just_return'. - (finish_enum): Initialize `minnode' and `maxnode' to NULL_TREE. - (finish_function): Initialize `cond' and `thenclause' to NULL_TREE. - (hack_incomplete_structures): Add parentheses around assignment - used as truth value. - - * decl2.c (coerce_delete_type): Hide definition of `e3'. - - * error.c: Include . - (dump_expr): Change the type of `i' to size_t. Remove unused - label `error'. - - * except.c (init_exception_processing): Remove unused variable `d'. - (expand_throw): Likewise for `label'. - - * friend.c (add_friends): Add explicit braces to avoid ambiguous - `else'. - - * init.c (sort_member_init): Initialize `last_field' to NULL_TREE. - (sort_base_init): Likewise for `binfo'. - (expand_member_init): Likewise for `rval'. - (build_member_call): Add parentheses around assignment used as - truth value. - (build_offset_ref): Add explicit braces to avoid ambiguous `else'. - (build_new): Initialize `nelts' to NULL_TREE. Initialize - `old_immediate_size_expand' to 0. - (build_new_1): Initialize `nelts' and `alloc_node' to NULL_TREE. - (build_vec_delete_1): Remove unused variable `block'. - (expand_vec_init): Initialize `itype' to NULL_TREE. - - * lex.c: Include if we don't have . Protect - declaration of `index' and `rindex' with autoconf macros. - (reinit_parse_for_expr): Remove unused variables - `look_for_semicolon' and `look_for_lbrac'. - (cons_up_default_function): Initialize `args' to NULL_TREE. - (readescape): Initialize `firstdig' to 0. - (real_yylex): Add parentheses around assignment used as truth value. - - * method.c: Include if we don't have . - Protect declaration of `index' with autoconf macro. - - * parse.y (primary): Add explicit braces to avoid ambiguous `else'. - Initialize `type' to NULL_TREE. - (structsp): Remove unused variable `id'. - - * pt.c (coerce_template_parms): Add explicit braces to avoid - ambiguous `else'. - (lookup_template_class): Initialize `template' to NULL_TREE. - (instantiate_class_template): Remove unused variable `name' and `e'. - (tsubst): Likewise for `i'. Initialize `last' to NULL_TREE. - (do_poplevel): Initialize `saved_warn_unused' to 0. - (type_unification): Remove unused varable `parm'. - (unify): Likewise for `j'. - - * repo.c (init_repo): Add parentheses around assignment used as - truth value. - (finish_repo): Remove unused varable `p'. - - * search.c (get_binfo): Initialize `type' to NULL_TREE. - (get_base_distance): Likewise. - (lookup_field): Initialize `rval_binfo_h', `type', `basetype_path' - and `new_v' to NULL_TREE. - (lookup_fnfields): Likewise for `rval_binfo_h'. - (breadth_first_search): Add parentheses around assignment used as - truth value. - (get_template_base): Initialize `type' to NULL_TREE. - - * sig.c (append_signature_fields): Initialize `last_mfptr' to - NULL_TREE. - (build_signature_table_constructor): Likewise for - `last_rhs_field', `pfn' and `vt_off'. - (build_sigtable): Likewise for `init'. - - * tree.c (break_out_calls): Initialize `t2' to NULL_TREE. - (propagate_binfo_offsets): Likewise for `delta'. - (hash_tree_cons): Initialize hashcode to 0. - (can_free): Likewise for `size'. - (cp_tree_equal): Add explicit braces to avoid ambiguous `else'. - - * typeck.c (convert_sequence): Hide prototype. - (common_type): Add explicit braces to avoid ambiguous `else'. - (comp_target_types): Likewise. - (build_x_function_call): Initialize `ctypeptr' to NULL_TREE. - (build_function_call_real): Add explicit braces to avoid ambiguous - `else'. - (convert_arguments): Initialize `called_thing' to 0. - (convert_for_initialization): Initialize `savew' and `savee' to 0. - - * typeck2.c (incomplete_type_error): Initialize `errmsg' to 0. - (digest_init): Initialize `old_tail_contents' to NULL_TREE. - (build_x_arrow): Likewise for `last_rval'. - - * xref.c (GNU_xref_decl): Initialize `cls' to 0. - -Sun Feb 1 12:45:34 1998 J"orn Rennecke - - * decl.c (init_decl_processing): Use set_sizetype. - * decl2.c (sizetype): Don't declare. - * typeck.c (c_sizeof): Convert result of *_DIV_EXPR to sizetype. - (c_sizeof_nowarn, build_binary_op_nodefault): Likewise. - (build_component_addr, unary_complex_lvalue): Likewise. - * rtti.c (expand_class_desc): Likewise. - * class.c (get_vfield_offset): Likewise. - -Thu Jan 29 10:39:30 1998 Mark Mitchell - - * pt.c (convert_nontype_argument): Move check for is_overloaded_fn - early to avoid bogus error. Handle overloaded function - names provided as template arguments correctly. - (coerce_template_parms): Don't mishandle overloaded functions when - dealing with template template parameters. - (lookup_template_class): Issue an error message, rather than - crashing, when the TYPE_DECL provided is not a template type. - -Wed Jan 28 23:14:44 1998 Jason Merrill - - * class.c (instantiate_type): Don't just return a known type if - it's wrong. - -Wed Jan 28 11:04:07 1998 Mark Mitchell - - * class.c (instantiate_type): Remove handling of FUNCTION_DECL - since that code could never be reached. - - * error.c (dump_decl): Avoid aborting in the midst of printing an - error message about an illegal template declaration. - - * parse.y (structsp): Print an error message, rather than crashing, - when a class-head does not name a class. - - * pt.c (convert_nontype_argument): Allow REAL_TYPE and COMPLEX_TYPE - template arguments as a g++ extension. - - * cp-tree.def (ALIGNOF_EXPR): New tree code. - * decl2.c (grok_alignof): If processing_template_decl, just store - the expression. - * typeck.c (c_alignof): Likewise. - * decl2.c (build_expr_from_tree): Handle ALIGNOF_EXPR. - * error.c (dump_expr): Likewise. - * pt.c (tsubst_copy): Likewise. - * tree.c (cp_tree_equal): Likewise. - * pt.c (uses_template_parms): Correctly determine whether or not a - SIZEOF_EXPR/ALIGNOF_EXPR uses template parameters so that constant - folding can be done. - - * cp-tree.h (grok_enum_decls): Remove type parameter. - * decl.c (grok_enum_decls): Likewise. - * decl2.c (grok_x_components): Call grok_enum_decls - unconditionally, since it will do nothing if there is no - current_local_enum. Use the new calling sequence. - * pt.c (tsubst_enum): Use the new calling sequence for - grok_enum_decls. - - * decl.c (start_function): Make member functions of local classes - in extern inline functions have comdat linkage here... - (grokdeclarator): Rather than here. - -Wed Jan 28 10:55:47 1998 Jason Merrill - - * pt.c (convert_nontype_argument): Use decl_constant_value. - -Tue Jan 27 16:42:21 1998 Mark Mitchell - - * call.c (add_template_candidate_real): New function. - (add_template_candidate): Use it. - (add_template_conv_candidate): Likewise. - (joust): Pass extra argument to more_specialized. - * class.c (instantiate_type): Handle a single FUNCTION_DECL. - (is_local_class): Remove. - (finish_struct): Check TI_PENDING_SPECIALIZATION_FLAG. - * cp-tree.h (is_local_class): Remove. - (perform_array_to_pointer_conversion): Likewise. - (finish_member_template_decl): Add. - (check_explicit_specialization): Return a tree, not an int. - (more_specialized): Take additional argument. - (get_bindings): Likewise. - (TI_PENDING_SPECIALIZATION_FLAG): New macro. - * cvt.c (perform_qualification_conversions): Use comp_ptr_ttypes. - (perform_array_to_pointer_conversion): Remove. - * decl.c (saved_scope): Add processing_specialization, - processing_explicit_instantiation fields. - (maybe_push_to_top_level): Save them. - (pop_from_top_level): Restore them. - (grokfndecl): Use new return value from - check_explicit_specialization. - (start_decl): Don't check flag_guiding_decls before pushing - decls. - (cp_finish_decl): Remove previous (bogus) change. - (grok_declarator): Use decl_function_context rather than - is_local_class. - * decl2.c (finish_file): Pass extra argument to get_bindings. - (build_expr_from_tree): Let build_x_component_ref check - validity of arguments rather than doing it here. - * lex.c (cons_up_default_function): Remove code fooling with - processing_specialization, processing_explicit_instantiation - flags, as that is now done in {maybe_push_top,pop_from}_top_level. - * method.c (build_overload_identifier): Mangle local classes in - template functions correctly. - * parse.y (finish_member_template_decl): Move to pt.c. - * pt.c (finish_member_template_decl): Moved here from parse.y. - (print_candidates): New function. - (determine_specialization): Change interface. Properly look for - most specialized versions of template candidates. - (check_explicit_specialization): Fully process explicit - instantiations. - (push_template_decl): Avoid looking at CLASSTYPE fields in - FUNCTION_DECLS. - (determine_overloaded_function): Remove. - (convert_nontype_argument): Change name from - convert_nontype_parameter. Use determine_overloaded_function - instead of instantiate_type. - (mangle_class_name_for_template): Handle type contexts as well as - function contexts. - (classtype_mangled_name): Likewise. - (lookup_template_class): Likewise. - (tsubst): Likewise. - (more_specialized): Take explicit template arguments as a - parameter. - (most_specialized): Likewise. - (get_bindings): Likewise. Check that return types match before - proclaiming a function a match. - (do_decl_instantiation): Remove code searching for function to - instantiate; that is now done in check_explicit_specialization. - (add_maybe_template): Pass extra argument to get_bindings. - * tree.c (really_overloaded_fn): Use is_overloaded_fn to simplify - implementation. - * typeck.c (build_component_ref): Check for invalid arguments. - -Tue Jan 27 01:44:02 1998 Jason Merrill - - * expr.c (cplus_expand_expr, AGGR_INIT_EXPR): Don't check that - return_target and call_target are equivalent. - - * pt.c (type_unification_real): Just accept function parms that - don't use any template parms. - -Sun Jan 25 03:30:00 1998 Jason Merrill - - * decl.c (cp_finish_decl): When bailing on a comdat variable, also - unset DECL_NOT_REALLY_EXTERN. - - * parse.y (typename_sub*): Fix std::. - -Sat Jan 24 12:13:54 1998 Jason Merrill - - * error.c (dump_decl): Fix type default template args. - (dump_type): Hand TEMPLATE_DECL off to dump_decl. - -Fri Jan 23 18:34:37 1998 Mumit Khan - - * lex.c (DIR_SEPARATOR): Define to be '/' if not already defined. - (file_name_nondirectory): Use. - -Wed Jan 21 10:29:57 1998 Kriang Lerdsuwanakij - - * pt.c (coerce_template_parms): Don't access elements of ARGLIST - that are not really present. Substitute default arguments in - template template arguments. Correctly convert TEMPLATE_DECL to - TEMPLATE_TEMPLATE_PARM. - (comp_template_args): TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM - are no longer treated specially here. - * parse.y (template_template_parm): Fix copy error. - * decl.c (grokdeclarator): Warn about missing `typename' for nested - type created from template template parameters. - * parse.y (bad_parm): Likewise - - * class.c (finish_struct): Handle TEMPLATE_TEMPLATE_PARM. - (push_nested_class): Likewise. - * cp-tree.def (TEMPLATE_TEMPLATE_PARM): New tree code. - * cp-tree.h (DECL_TEMPLATE_TEMPLATE_PARM_P): New macro. - (copy_template_template_parm): Declare. - * decl.c (arg_looking_for_template): New variable. - (lookup_name_real): Handle TEMPLATE_TEMPLATE_PARM. - Try to return TEMPLATE_DECL or TEMPLATE_TEMPLATE_PARM - node if arg_looking_for_template is nonzero. - (pushdecl): Handle TEMPLATE_TEMPLATE_PARM. - (grok_op_properties, xref_tag, xref_basetypes): Likewise. - (grokdeclarator): Handle TEMPLATE_DECL. - * decl2.c (constructor_name_full): Handle TEMPLATE_TEMPLATE_PARM. - * error.c (dump_type): Add TEMPLATE_DECL and TEMPLATE_TEMPLATE_PARM. - (dump_type_prefix, dump_type_suffix): Handle TEMPLATE_TEMPLATE_PARM. - (dump_decl): Handle unnamed template type parameters. - Handle template template parameters. - (dump_function_name): Handle template template parameters. - * init.c (is_aggr_typedef, is_aggr_type, get_aggr_from_typedef): - Handle TEMPLATE_TEMPLATE_PARM. - * method.c (build_template_template_parm_names): New function. - (build_template_parm_names): Handle TEMPLATE_DECL. - (build_overload_nested_name, build_overload_name): - Handle TEMPLATE_TEMPLATE_PARM. - * parse.y (maybe_identifier): New nonterminal. - (template_type_parm): Use it. - (template_template_parm, template_arg1): New nonterminal. - (template_parm): Add template_template_parm rules. - (template_arg): Set processing_template_arg. - (template_arg1): Rules moved from template_arg. - (primary, nonnested_type): Set arg_looking_for_template if we are - processing template arguments. - * pt.c (begin_member_template_processing): Handle TEMPLATE_DECL. - (process_template_parm): Handle template template parameters. - (coerce_template_parms, comp_template_args): Likewise. - (mangle_class_name_for_template, lookup_template_class): Likewise. - (uses_template_parms): Handle TEMPLATE_DECL and - TEMPLATE_TEMPLATE_PARM. - (current_template_args): Handle TEMPLATE_DECL. - (tsubst, tsubst_copy, unify): Handle TEMPLATE_TEMPLATE_PARM. - * search.c (dfs_walk, dfs_record_inheritance): - Handle TEMPLATE_TEMPLATE_PARM. - * tree.c (copy_template_template_parm): New function. - (mapcar): Handle TEMPLATE_TEMPLATE_PARM. - * typeck.c (comptypes): Handle TEMPLATE_TEMPLATE_PARM. - -Mon Jan 19 22:40:03 1998 Mark Mitchell - - * decl.c (start_decl): Don't allow duplicate definitions of static - data members. - - * call.c (build_user_type_conversion_1): Handle user-defined - template conversion operators correctly. - - * decl2.c (build_expr_from_tree): Issue an error message if the - object in a COMPONENT_REF is a TEMPLATE_DECL. - - * typeck.c (incomplete_type_error): Handle TEMPLATE_TYPE_PARMs. - - * class.c (is_local_class): New function. - * cp-tree.h (is_local_class): Declare it. - (last_tree): Likewise. - (begin_tree): Likewise. - (end_tree): Likewise. - (lookup_template_class): Change prototype. - * decl.c (cp_finish_decl): Check for NULL where necessary. - Consider FUNCTION_DECLS to declare objects with top-level binding, - when calling make_decl_rtl. - (grokdeclarator): Give members of local classes internal linkage. - (start_function): Remove declaration of last_tree. - (finish_function): Set flag_keep_inline_functions around call to - rest_of_compilation if we are processing a member function in a - local class. - (start_method): Call push_template_decl for member functions of - local classes in template functions. - * decl2.c (import_export_decl): Don't give external linkage to - instantiations of templates with internal linkage. - * parse.y (last_tree): Remove declaration. - (template_type): Pass extra parameter to lookup_template_class. - (self_template_type): Likewise. - (structsp): Move call to reset_specialization into left_curly. - (left_curly): Call reset_specialization, and begin_tree. - * pt.c (saved_trees): New variable. - (mangle_class_name_for_template): Change prototype. Use - additional function context to name local classes in templates - correctly. - (classtype_mangled_name): Pass the context. - (push_template_decl): Handle local classes and templates, and - member functions for such classes. - (convert_nontype_parameter): Fix handling of pointer-to-member - constants. - (lookup_template_class): Handle local classes in templates. - (tsubst): Likewise. Don't assume that template instantiations - have external linkage; pay attention to the template declaration. - (mark_decl_instantiated): Likewise. - (begin_tree): New function. - (end_tree): Likewise. - - * decl.c (xref_basetypes): Don't call complete_type for basetypes - that involve template parameters; that can lead to infinite - recursion unnecessarily. - - * pt.c (register_specialization): Do not register specializations - that aren't ready to be registered yet. - (check_explicit_specialization): Handle explicit specialization of - constructors and destructors. - (build_template_decl): New function. - (push_template_delc): Handle out-of-class specializations of - member templates. - - * pt.c (check_explicit_specialization): Set up the template - information before registering the specialization. - (coerce_template_parms): Fix thinko. - (tsubst): Handle specializations of member templates correctly. - - * class.c (finish_struct_methods): Remove calls to - check_explicit_specialization from here. - (finish_struct): And insert them here. - * cp-tree.h (perform_qualification_conversions): New function. - (perform_array_to_pointer_conversion): Likewise. - (begin_explicit_instantiation): Likewise. - (end_explicit_instantiation): Likewise. - (determine_specialization): Renamed from - determine_explicit_specialization. - (comp_template_parms): New function. - (processing_explicit_instantiation): New variable. - * cvt.c (perform_qualification_conversions): New function. - (perform_array_to_pointer_conversion): Likewise. - * decl.c (duplicate_decls): Don't consider template functions - alike unless they have the same parameters. Refine handling of - instantiation/specialization mismatches. - (start_decl): Don't call pushdecl for template specializations, - since they don't affect overloading. - (start_function): Likewise. - (grokfndecl): Call check_explicit_specialization a little later. - Don't call duplicate_decls for memberm template specializations. - (grokdeclarator): Don't update template_count for classes that are - themselves specializations. Remove use of `2' as parameter to - grokfndecl since that value isn't used. - * lex.c (cons_up_default_function): Save and restore - processing_explicit_instantiation around calls to grokfield. - * parse.y (finish_member_template_decl): New function. - (component_decl_1): Use it. - (fn.def2): Likewise. - (template_arg_list_opt): New nonterminal. - (template_type): Use it. - (self_template_type): Likewise. - (template_id): Likewise. - (object_template_id): Likewise. - (notype_template_declarator): Likwise. - (begin_explicit_instantiation): Likewise. - (end_explicit_instantiation): Likewise. - (explicit_instantiation): Use them. - * pt.c (coerce_template_parms): Add parameters. - (processing_explicit_instantiation): New variable. - (convert_nontype_parameter): New function. - (determine_overloaded_function): Likewise. - (begin_explicit_instantiation): Likewise. - (end_explicit_instantiation): Likewise. - (retrieve_specialization): Likewise. - (register_specialization): Likewise. - (processing_explicit_specialization): Removed. - (determine_specialization): Handle specializations of member - functions of template class instantiations. - (check_explicit_specialization): Refine to conform to standard. - (comp_template_parms): New function. - (coerce_template_parms): Call convert_nontype_parameter. - (tsubst): Refine handling of member templates. Use - register_specialization. - (instantiate_template): Use retrieve_specialization. - (do_decl_instantiation): Likewise. - (instantiate_decl): Likewise. - (type_unification): Improve handling of explicit template - arguments. - * tree.c (mapcar): Return error_mark_node, rather than aborting, - on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS. - * typeck.c (build_unary_op): Call determine_specialization, rather - than determine_explicit_specialization. - -Mon Jan 19 13:18:51 1998 Jason Merrill - - * cvt.c (build_up_reference): A TARGET_EXPR has side effects. - -Fri Jan 16 11:40:50 1998 Bruno Haible - - * error.c (dump_decl): For enum tags, output the tag, not its value. - -1998-01-13 Brendan Kehoe - - * decl.c (init_decl_processing): Only call init_rtti_processing - FLAG_RTTI is set. - -Mon Jan 12 01:35:18 1998 Jason Merrill - - * init.c (build_new_1): Split out from build_new. - (build_new): Just return a NEW_EXPR. - * expr.c (cplus_expand_expr): Handle NEW_EXPR. - - * decl2.c (get_temp_regvar): Tweak. - - * cp-tree.h (TREE_CALLS_NEW): Comment out. - * class.c (resolves_to_fixed_type_p): Remove use. - * method.c (build_opfncall): Likewise. - * call.c (build_new_op): Likewise. - -Wed Jan 7 23:47:13 1998 Jason Merrill - - * exception.cc (__eh_alloc, __eh_free): New fns. - (__cp_push_exception, __cp_pop_exception): Use them. - (__uncatch_exception): Call terminate here if no exception. - * except.c (build_terminate_handler): New fn. - (expand_start_catch_block): Use it. - (expand_exception_blocks): Likewise. - (alloc_eh_object): New fn. - (expand_throw): Use it. Protect exception init with terminate. - * typeck.c (build_modify_expr): Remove code that ignores trivial - methods. - -Mon Dec 22 11:36:27 1997 Kaveh R. Ghazi - - * call.c (add_builtin_candidate): Add default case in enumeration - switch. - (build_new_op): Likewise. - (convert_like): Likewise. - * cvt.c (build_expr_type_conversion): Likewise. - * tree.c (real_lvalue_p): Likewise. - (lvalue_p): Likewise. - (cp_tree_equal): Likewise. - * typeck.c (comptypes): Likewise. - (build_component_ref): Likewise. - (build_function_call_real): Likewise. - (build_binary_op_nodefault): Likewise. - (build_unary_op): Likewise. - (build_modify_expr): Likewise. - * typeck2.c (initializer_constant_valid_p): Likewise. - -Sun Dec 21 15:59:00 1997 Nick Clifton - - * decl2.c (lang_decode_option): Add support for -Wunknown-pragmas. - -Thu Dec 18 14:51:50 1997 Mark Mitchell - - * pt.c (coerce_template_parms): Make sure to digest_init if - possible. - - * decl.c (duplicate_decls): Make the newdecl virtual if the - olddecl was, just as is done with other attributes of olddecl. - -Thu Dec 18 14:43:19 1997 Jason Merrill - - * typeck.c (unary_complex_lvalue): Ignore op0 when taking the - address of an OFFSET_REF. - - * cp-tree.def: Add AGGR_INIT_EXPR. - * error.c, tree.c, typeck.c: Replace uses of NEW_EXPR with - AGGR_INIT_EXPR where appropriate. - * expr.c (cplus_expand_expr): Likewise. Simplify. - - * decl2.c (finish_file): Remove call to register_exception_table. - -Wed Dec 17 17:08:52 1997 Benjamin Kosnik - - * pt.c (instantiate_class_template): Don't do injection when - processing_template_decl is true, as pollutes current_binding_level - for base classes. - -Wed Dec 17 21:17:39 1997 Peter Schmid - - * pt.c (maybe_fold_nontype_arg): Add prototype. - -Tue Dec 16 10:31:20 1997 Jason Merrill - - * tree.c (mapcar): Handle TRY_CATCH_EXPR et al. - * error.c (dump_expr): Likewise. - -Mon Dec 15 12:22:04 1997 Jason Merrill - - * typeck.c (build_function_call_real): Remove "inline called before - definition" pedwarn. - - * pt.c (coerce_template_parms): Use maybe_fold_nontype_arg. - -Sun Dec 14 22:34:20 1997 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Fix base conversion of pm's. - - * pt.c (type_unification_real): Change __null to type void* with - a warning. - -Sun Dec 14 20:38:35 1997 Mark Mitchell - - * call.c (implicit_conversion): Don't call - build_user_type_conversion_1 with a NULL expr, since it will - crash. - - * pt.c (unify): Don't try to unify array bounds if either array is - unbounded. - -Fri Dec 12 16:09:14 1997 Jason Merrill - - * errfn.c (cp_pedwarn, cp_pedwarn_at, cp_error_at, cp_warning_at): - Replace extern decls with casts. - - * decl.c (expand_start_early_try_stmts): Don't mess with a sequence. - Update last_parm_cleanup_insn. - (store_after_parms): Remove. - * cp-tree.h: Adjust. - -Thu Dec 11 22:18:37 1997 Jason Merrill - - * decl2.c (comdat_linkage): Also set DECL_COMDAT. - (finish_file): Check DECL_COMDAT instead of weak|one_only. - (import_export_vtable): Use make_decl_one_only instead of - comdat_linkage for win32 tweak. - (import_export_decl): Likewise. - * pt.c (mark_decl_instantiated): Likewise. - - * decl2.c (finish_file): Lose handling of templates in pending_statics. - -Thu Dec 11 21:12:09 1997 Jason Merrill - - * decl2.c (finish_file): Lose call to expand_builtin_throw. - * except.c (expand_builtin_throw): Remove. - * cp-tree.h: Remove ptr_ptr_type_node. - * decl.c: Likewise. - -Thu Dec 11 20:43:33 1997 Teemu Torma - - * decl.c (ptr_ptr_type_node): Define. - (init_decl_processing): Initialize it. - * cp-tree.h: Declare it. - * exception.cc (__cp_exception_info): Use __get_eh_info. - (__cp_push_exception): Likewise. - (__cp_pop_exception): Likewise. - - From Scott Snyder : - * except.c (expand_builtin_throw): Use get_saved_pc_ref instead of - saved_pc. - (init_exception_processing): Removed saved_pc initialization. - -Wed Dec 10 11:04:45 1997 Jason Merrill - - * pt.c (instantiate_decl): Defer all templates but inline functions. - -Mon Dec 8 23:17:13 1997 Jason Merrill - - * init.c (expand_vec_init): Don't fold a list of parameters. - - * decl.c (copy_args_p): Handle copy elision for types with virtual - bases. - * call.c (build_over_call): Likewise. - -Sun Dec 7 22:38:12 1997 Mark Mitchell - - * pt.c (lookup_template_function): Copy the template arguments, - not just the list containing them, to the permanent obstack. - -Sun Dec 7 15:53:06 1997 Jason Merrill - - * except.c (expand_start_catch_block): suspend_momentary for the - terminate handler. - - * error.c (dump_decl): Handle LOOKUP_EXPR. - -Sun Dec 7 15:45:07 1997 Mark Mitchell - - * rtti.c (build_dynamic_cast): Copy the cast-to type to the - permanent obstack if we are processing a template decl. - * typeck.c (build_static_cast): Likewise. - (build_const_cast): Likewise. - (build_reinterpret_cast): Likewise. - - * pt.c (coerce_template_parms): Coerce some expressions, even - when processing_template_decl. - -Sun Dec 7 01:46:33 1997 Bruno Haible - - * typeck.c (build_binary_op_nodefault, pointer_diff): Symmetric - handling of pointer difference expressions. - - * typeck.c (comp_target_types): Comparison of function/method types - is independent of nptrs. - -Sun Dec 7 01:40:27 1997 Mark Mitchell - - * pt.c (tsubst): Avoid creating pointer to reference and - reference to reference types. - -Sat Dec 6 01:29:37 1997 Jason Merrill - - * parse.y (do_id): New nonterminal. - (template_id): Use it. - -Fri Dec 5 01:17:34 1997 Jason Merrill - - * parse.y (template_id): do_identifier for PFUNCNAMEs, too. - * spew.c (yylex): Don't do_identifier here. - * decl2.c (build_expr_from_tree): Revert last change. - - * decl2.c (build_expr_from_tree): Expand the name for a method call. - * parse.y (object_template_id): Don't try to take the DECL_NAME. - -Wed Dec 3 20:02:39 1997 Jason Merrill - - * init.c (build_new): Use a TARGET_EXPR instead of SAVE_EXPR for - alloc_expr. - * call.c (build_op_delete_call): Adjust. - - * except.c (expand_end_catch_block): Lose rethrow region. - (expand_start_catch_block): Likewise. - (expand_end_catch_block): Don't expand_leftover_cleanups. - -Wed Dec 3 13:24:04 1997 Benjamin Kosnik - - * pt.c (tsubst): Remove tree_cons call (places redundant info into - DECL_TEMPLATE_INSTANTIATION). - -Wed Dec 3 11:44:52 1997 Jason Merrill - - * tree.c (is_overloaded_fn): Handle getting a fn template. - (really_overloaded_fn): Likewise. - * error.c (dump_decl): Handle TEMPLATE_ID_EXPRs better. - * pt.c (check_explicit_specialization): Tweak. - (determine_explicit_specialization): Tweak. - - * tree.c, cp-tree.h (get_target_expr): New fn. - -Wed Dec 3 08:47:27 1997 Paul Eggert - - * pt.c (check_explicit_specialization): Fix misspelling in - diagnostic: `preceeded'. - * typeck.c (get_delta_difference): Fix misspelling in diagnostic: - `conversiona'. - -1997-12-02 Mark Mitchell - - * pt.c (determine_explicit_specialization): Avoid an internal - error for bad specializations. - - * method.c (build_overload_value): Handle SCOPE_REF. - -Tue Dec 2 19:18:50 1997 Mike Stump - - * class.c (prepare_fresh_vtable): Enable even more complex MI - vtable names. - -Tue Dec 2 01:37:19 1997 Jason Merrill - - * exception.cc (__check_eh_spec): Optimize a bit. - - * exception.cc (__cp_pop_exception): Lose handler arg. - * except.c (do_pop_exception): Likewise. - (push_eh_cleanup): Let the cleanup mechanism supply the handler. - (expand_end_catch_block): Likewise. - -Fri Nov 28 01:58:14 1997 Jason Merrill - - * pt.c (check_explicit_specialization): Complain about using a - template-id for a non-specialization. - -Fri Nov 28 12:35:19 1997 Scott Christley - - * repo.c: Prototype rindex only if needed. - * xref.c: Likewise. - -Fri Nov 28 01:56:35 1997 Bruno Haible - - * error.c (dump_decl): Handle TEMPLATE_ID_EXPR. - -Thu Nov 27 00:59:46 1997 Jason Merrill - - * typeck.c (build_const_cast): Handle references here instead of - handing off to convert_to_reference. - - * except.c: Lose Unexpected, SetTerminate, SetUnexpected, - TerminateFunctionCall. - (init_exception_processing): Likewise. Terminate et al are now - the fns, not ADDR_EXPRs. - (various): Lose redundant assemble_external calls. - (do_unwind): s/BuiltinReturnAddress/builtin_return_address_fndecl/. - - * cp-tree.h (struct lang_decl_flags): Add comdat. - (DECL_COMDAT): New macro. - * decl.c (duplicate_decls): Propagate it. - (cp_finish_decl): Handle it. - * decl2.c (import_export_decl): Just set DECL_COMDAT on VAR_DECLs. - - * class.c: Remove static pending_hard_virtuals. - (add_virtual_function): Take pointers to pending_virtuals - and pending_hard_virtuals. - (finish_struct_1): Pass them. Declare pending_hard_virtuals. - -Wed Nov 26 20:28:49 1997 Jason Merrill - - * decl2.c (import_export_vtable): If we support one_only but not - weak symbols, mark instantiated template vtables one_only. - (import_export_decl): Likewise for tinfo functions. - (finish_vtable_vardecl): Also write out vtables from explicitly - instantiated template classes. - * pt.c (mark_class_instantiated): Revert last change. - - * except.c (expand_throw): Call mark_used on the destructor. - -Wed Nov 26 15:13:48 1997 Jeffrey A Law (law@cygnus.com) - - * lex.c (lang_init): Enable flag_exceptions by default if no - command line switch was specified. - -1997-11-26 Mark Mitchell - - * pt.c (unify): Handle `void' template parameters in - specializations. - -Wed Nov 26 01:11:24 1997 Jason Merrill - - * rtti.c (build_dynamic_cast): Handle template case here. - (build_dynamic_cast_1): Not here. - - * typeck2.c (digest_init): Make copies where appropriate. - - * decl2.c (delete_sanity): resolve_offset_ref. - - * except.c: Call terminate without caching so many bits. - - * except.c (expand_start_catch_block): Fix catching a reference - to pointer. - -Tue Nov 25 11:28:21 1997 Jason Merrill - - * init.c (build_new): Copy size to the saveable obstack. - - * init.c (build_new): Stick a CLEANUP_POINT_EXPR inside the - TRY_CATCH_EXPR for now. - -Mon Nov 24 12:15:55 1997 Jason Merrill - - * typeck.c (mark_addressable): Don't assume a FUNCTION_DECL - has DECL_LANG_SPECIFIC. - - * exception.cc (struct cp_eh_info): Add handlers field. - (__cp_push_exception): Initialize it. - (__cp_pop_exception): Decrement it. Don't pop unless it's 0. - (__throw_bad_exception): Remove. - * except.c (call_eh_info): Add handlers field. - (get_eh_handlers): New fn. - (push_eh_cleanup): Increment handlers. - -Fri Nov 21 12:22:07 1997 Jason Merrill - - * except.c (expand_start_eh_spec): Use the try/catch code. - (expand_end_eh_spec): Likewise. Call __check_eh_spec instead of - doing everything inline. - (init_exception_processing): throw_type_match now takes - const void pointers. - * exception.cc (__check_eh_spec): New fn. - * inc/exception: Neither terminate nor unexpected return. - * decl.c: Make const_ptr_type_node public. - * tinfo2.cc (__throw_type_match_rtti): Take the typeinfos constly. - - * except.c (expand_start_catch_block): We only need the rethrow - region for non-sjlj exceptions. - (expand_end_catch_block): Likewise. Use outer_context_label_stack. - -Thu Nov 20 14:40:17 1997 Jason Merrill - - * Make-lang.in (CXX_LIB2FUNCS): Add new op new and op delete objs. - (various.o): Likewise. - * inc/new: Add placement deletes. Add throw specs for default new. - * new.cc (set_new_handler): Move here from libgcc2. - * new1.cc (new (nothrow)): Catch a bad_alloc thrown from the handler. - (new): Move from libgcc2. Throw bad_alloc. - * new2.cc: Move the rest of the op news and op deletes from libgcc2. - * decl.c (init_decl_processing): Update exception specs on new and - delete. - - * method.c (build_decl_overload_real): Don't mess with global - placement delete. - - * init.c (build_new): Check for null throw spec, not nothrow_t. - - * decl.c (duplicate_decls): Don't complain about different exceptions - from an internal declaration. - - * call.c (build_op_delete_call): Fix check for member fns again. - - * decl2.c (import_export_decl): Interface hackery affects - virtual synthesized methods. - -Wed Nov 19 18:24:14 1997 Jason Merrill - - * decl.c (start_decl): Don't just complain about a mismatched - scope, fix it. - - * decl.c (make_implicit_typename): Handle case where t is not - actually from context. - * tree.c (get_type_decl): Lose identifier case. - * spew.c (yylex): Lose useless call to identifier_typedecl_value. - * parse.y (nonnested_type): Just use lookup_name. - (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE. - -Wed Nov 19 11:45:07 1997 Michael Tiemann - - * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case - T was built in C language context (for example, by - output_func_start_profiler). - -Wed Nov 19 10:39:27 1997 Jason Merrill - - * decl.c (make_implicit_typename): New fn. - (lookup_name_real): Use it. Use current_class_type as the context. - -Mon Nov 17 23:42:03 1997 Bruno Haible - - * pt.c (do_poplevel): Don't prohibit jumps into this contour. - -Mon Nov 17 02:01:28 1997 Jason Merrill - - * friend.c (do_friend): Warn about non-template friends in templates. - - * call.c (build_op_delete_call): Fix handling of inherited delete. - - * search.c (dfs_record_inheritance): Ignore template type parms. - -Sat Nov 15 00:30:51 1997 Jason Merrill - - * call.c (build_new_op): Fix copy error. - (build_op_new_call): New fn. - (build_op_delete_call): New fn. - * cp-tree.h: Declare them. - * init.c (build_new): Use them. Support placement delete. - (build_x_delete): Use build_op_delete_call. - (build_delete): Likewise. - * decl2.c (delete_sanity): Likewise. - (coerce_delete_type): Don't complain about placement delete. - -Thu Nov 13 01:52:36 1997 Jason Merrill - - * call.c (build_new_function_call): Remove unused 'obj' parm. - * cp-tree.h, typeck.c: Adjust. - - * init.c (build_new): Make the cleanup last longer. - (expand_vec_init): Call do_pending_stack_adjust. - -Wed Nov 12 11:04:33 1997 Jason Merrill - - * pt.c (do_type_instantiation): Fix typo. - (mark_class_instantiated): If we support one_only but not weak - symbols, don't mark this as known. - - * init.c (build_new): Handle vec delete in EH cleanup. - -Wed Nov 12 08:11:55 1997 Benjamin Kosnik - - * call.c (build_method_call): Call complete_type before checking - for destructor. - -Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com) - - * decl.c (add_block_current_level): Delete. - * init.c (build_vec_delete_1): Delete build_block and - add_block_current_level calls. - -Wed Nov 12 00:48:16 1997 Jason Merrill - - * init.c (build_new): Handle freeing allocated memory when the - constructor throws. - - * call.c (build_new_method_call): Fix flags arg. - - * pt.c (do_type_instantiation): Don't try to instantiate - member templates. - (mark_decl_instantiated): If we support one_only but not - weak symbols, mark this one_only. - * decl2.c (import_export_vtable): Don't defer handling of vtables - if MULTIPLE_SYMBOL_SPACES. - -Tue Nov 11 12:02:12 1997 Jason Merrill - - * except.c (expand_end_catch_block): Lose call to __sjpopnthrow. - -Tue Nov 11 02:53:44 1997 Jason Merrill - - * except.c (do_pop_exception): Return a value. - -Mon Nov 10 20:25:31 1997 Jason Merrill - - * call.c (build_new_method_call): Handle getting a - TEMPLATE_ID_EXPR around a TEMPLATE_DECL. Don't look for a field - if we got template parms. - * typeck.c (build_x_function_call): Remember the TEMPLATE_ID_EXPR, - not just the args. - * decl2.c (build_expr_from_tree): Tweak last change. - * pt.c (tsubst_copy): Use get_first_fn instead of TREE_VALUE. - (maybe_fold_nontype_arg): Split out from tsubst_copy. - * tree.c (get_first_fn): Just return a TEMPLATE_ID_EXPR. - -Mon Nov 10 20:08:38 1997 Kriang Lerdsuwanakij - - * pt.c (tsubst_copy): Handle explicit template arguments in - function calls. - * typeck.c (build_x_function_call): Likewise. - * decl2.c (build_expr_from_tree): Lookup function name if it - hasn't been done. - - * pt.c (tsubst): Instantiate template functions properly when - template parameter does not appear in function arguments and return - type. - (comp_template_args): Handle member templates required by tsubst. - -Mon Nov 10 20:08:38 1997 Jason Merrill - - * decl.c (grokdeclarator): Tweak conditions for pedwarn in - previous change. - -Mon Nov 10 20:08:29 1997 Bruno Haible - - * pt.c (coerce_template_parms): Tweak error message. - - * decl.c (grokdeclarator): If -Wreturn-type, warn everytime a - return type defaults to `int', even if there are storage-class - specifiers. - -Mon Nov 10 03:04:20 1997 Jason Merrill - - Complete nested exception support. - * except.c (do_pop_exception): Split out... - (push_eh_cleanup): From here. Handle the EH region by hand. - (expand_start_catch_block): Add a new level for the catch parm. - Move the rethrow region outside the two cleanup regions. - Protect the initializer for the catch parm with terminate. - (expand_end_catch_block): Likewise. End the region for the eh_cleanup. - * exception.cc (__cp_pop_exception): Now takes two parms. Handle - popping off the middle of the stack. - * tree.c (lvalue_p, real_lvalue_p): Handle TRY_CATCH_EXPR, - WITH_CLEANUP_EXPR, and UNSAVE_EXPR. - (build_cplus_new): Only wrap CALL_EXPRs. - * init.c (expand_default_init): Handle a TRY_CATCH_EXPR around - the constructor call. - -Sun Nov 9 18:00:26 1997 Richard Kenner - - * Make-lang.in (c++.distdir): Make inc subdirectory. - -Fri Nov 7 11:57:28 1997 Jason Merrill - - * decl2.c (finish_file): Put back some code. - -Thu Nov 6 11:28:14 1997 Jason Merrill - - * decl2.c (finish_file): Remove redundant code. - * method.c (emit_thunk): Don't let the backend defer generic thunks. - -Wed Nov 5 23:52:50 1997 Jason Merrill - - * except.c (call_eh_info): Split out... - (push_eh_info): From here. - (expand_builtin_throw): Use it. - (expand_start_catch_block): Move region start back. - -Tue Nov 4 13:45:10 1997 Doug Evans - - * lex.c (MULTIBYTE_CHARS): #undef if cross compiling. - (real_yylex): Record wide strings using target endianness, not host. - -1997-11-03 Brendan Kehoe - - * repo.c (rindex): Add decl unconditionally. - (get_base_filename, open_repo_file): Don't cast rindex. - * xref.c (rindex): Add decl unconditionally. - (index): Remove unused decl. - (open_xref_file): Don't cast rindex. - -Sun Nov 2 15:04:12 1997 Jason Merrill - - * class.c (build_vbase_path): Propagate the result type properly. - -1997-11-01 Brendan Kehoe - - * except.c (expand_builtin_throw) [!DWARF2_UNWIND_INFO]: Replace - remaining use of saved_throw_type with a call to get_eh_type. - -1997-10-31 Brendan Kehoe - - * lex.c (FILE_NAME_NONDIRECTORY): Delete macro. - (file_name_nondirectory): New function, doing the same as the macro. - (set_typedecl_interface_info): Use it instead of the macro. - (check_newline): Likewise. - (handle_cp_pragma): Likewise. - - * repo.c (get_base_filename): Cast result of rindex to char*. - (open_repo_file): Likewise. - * xref.c (open_xref_file): Likewise. - * error.c (dump_char): Make its arg int, not char. - - * except.c (push_eh_info): Pass the number of fields - 1 down, not - the exact number of fields. - -Fri Oct 31 01:47:57 1997 Jason Merrill - - Support for nested exceptions. - * tinfo2.cc (__is_pointer): New fn. - * exception.cc (struct cp_eh_info): Define. - (__cp_exception_info, __uncatch_exception): New fns. - (__cp_push_exception, __cp_pop_exception): New fns. - * except.c: Lose saved_throw_{type,value,cleanup,in_catch}. - Lose empty_fndecl. - (init_exception_processing): Likewise. __eh_pc is now external. - (push_eh_info): New fn. - (get_eh_{info,value,type,caught}): New fns. - (push_eh_cleanup): Just call __cp_pop_exception. - (expand_start_catch_block): Use push_eh_info. Start the eh region - sooner. - (expand_end_eh_spec): Use push_eh_info. - (expand_throw): Call __cp_push_exception to set up the exception info. - Just pass the destructor or 0 as the cleanup. Call __uncatch_exception - when we rethrow. - (expand_builtin_throw): Don't refer to empty_fndecl. - -Thu Oct 23 02:01:30 1997 Jason Merrill - - * pt.c (instantiate_decl): SET_DECL_IMPLICIT_INSTANTIATION on new decl. - -1997-10-22 Brendan Kehoe - - * method.c (build_template_parm_names, build_decl_overload_real): - Add static to definitions. - * pt.c (add_to_template_args, note_template_header, - processing_explicit_specialization, type_unification_real): Likewise. - ({determine,check}_explicit_specialization): Use a single string for - error messages. - -Mon Oct 20 12:06:34 1997 Jason Merrill - - * except.c (expand_exception_blocks): Call do_pending_stack_adjust. - (expand_end_catch_block): Likewise. - (expand_end_eh_spec): Likewise. - -Mon Oct 20 11:44:20 1997 Mark Mitchell - - * decl.c (duplicate_decls): Handle template specializations - correctly. - * error.c (dump_function_name): Fix printing of specializations of - member functions that are not member templates. - * cp-tree.h (processing_specialization): Make global. - * pt.c (processing_specialization): Likewise. - * lex.c (cons_up_default_function): Save and restore - processing_specialization to avoid confusion. - -Mon Oct 20 10:52:22 1997 Jason Merrill - - * decl.c (init_decl_processing): Give null_node unknown* type. - * typeck.c (comp_target_types): Handle UNKNOWN_TYPE. - (common_type): Likewise. - * error.c (args_as_string): Recognize null_node. - -Sun Oct 19 09:13:01 1997 Richard Kenner - - * typeck.c (rationalize_conditional_expr): Handle {MIN,MAX}_EXPR. - (unary_complex_lvalue): Call it for {MIN,MAX}_EXPR. - - * decl.c (init_decl_processing): Call using_eh_for_cleanups. - - * Make-lang.in (g++): Include prefix.o. - -Thu Oct 16 15:31:09 1997 Judy Goldberg - - * pt.c (determine_explicit_specialization): Initialize "dummy" - to keep Purify quiet. - -Thu Oct 16 00:14:48 1997 Jason Merrill - - * method.c (build_overload_value): Handle TEMPLATE_CONST_PARMs here. - (build_overload_int): Not here. - -Wed Oct 15 00:35:28 1997 Mike Stump - - * class.c (build_type_pathname): Remove. - (prepare_fresh_vtable): Fix problem with complex MI vtable names. - -1997-10-14 Brendan Kehoe - - * parse.y (unary_expr): Give a pedwarn if someone tries to use the - &&label GNU extension. - -Tue Oct 14 12:01:00 1997 Mark Mitchell - - * decl.c (pushtag): Unset DECL_ASSEMBLER_NAME before setting it, - so as to avoid incorrect manglings. - * method.c (build_decl_overload_real): Don't mangle return types - for constructors. - -Tue Oct 14 11:46:14 1997 Jason Merrill - - * cp-tree.h (scratchalloc, build_scratch_list, make_scratch_vec, - scratch_tree_cons): Define as macros for now. - * call.c, class.c, cvt.c, decl.c, decl2.c, except.c, expr.c, init.c, - lex.c, method.c, parse.y, pt.c, rtti.c, search.c, tree.c, typeck.c, - typeck2.c: Use them and the expression_obstack variants. - -Mon Oct 13 17:41:26 1997 Benjamin Kosnik - - * decl.c (store_return_init): Allow classes with explicit ctors to - be used with the named return values extension. - -Fri Oct 10 12:21:11 1997 Jason Merrill - - * pt.c (instantiate_decl): Fix previous change. - -Thu Oct 9 12:08:21 1997 Jason Merrill - - * pt.c (tsubst): Fix thinko. - (instantiate_decl): Really use the original template. - - * call.c (build_new_method_call): Use simple constructor_name for - error messages. - -Wed Oct 8 22:44:42 1997 Jeffrey A Law - - * method.c (build_underscore_int): Don't use ANSI specific - features. - -Wed Oct 8 00:18:22 1997 Jason Merrill - - * decl2.c (finish_prevtable_vardecl): Check DECL_REALLY_EXTERN - for our key method; it might have been inlined by -O3. - -Tue Oct 7 23:00:12 1997 Mark Mitchell - - * decl.c (make_typename_type): Do not try to call lookup_field for - non-aggregate types. - -Tue Oct 7 22:52:10 1997 Jason Merrill - - * typeck.c (build_reinterpret_cast): Tweak. - -Tue Oct 7 22:45:31 1997 Alexandre Oliva - - * typeck.c (build_reinterpret_cast): Converting a void pointer - to function pointer with a reinterpret_cast produces a warning - if -pedantic is issued. - -Tue Oct 7 22:43:43 1997 Bruno Haible - - * typeck.c (c_expand_return): Don't warn about returning a - reference-type variable as a reference. - -Tue Oct 7 21:11:22 1997 Jason Merrill - - * method.c (build_static_name): Fix typo. - -1997-10-07 Brendan Kehoe - - * decl.c (duplicate_decls): Make sure DECL_LANG_SPECIFIC is set on - OLDDECL before we try to do DECL_USE_TEMPLATE. - -Tue Oct 7 00:48:36 1997 Jason Merrill - - * decl.c (duplicate_decls): Don't warn about template instances. - - * typeck.c (mark_addressable): Lose ancient code that unsets - DECL_EXTERNAL. - - * pt.c (do_decl_instantiation): Lose support for instantiating - non-templates. - - * call.c (build_new_function_call): Fix handling of null explicit - template args. - (build_new_method_call): Likewise. - -Mon Oct 6 23:44:34 1997 Mark Mitchell - - * method.c (build_underscore_int): Fix typo. - -1997-10-06 Brendan Kehoe - - * tree.c (print_lang_statistics): #if 0 call to - print_inline_obstack_statistics until its definition is checked in. - -Mon Oct 6 09:27:29 1997 Jason Merrill - - * decl2.c (finish_file): Move dump_tree_statistics to end. - - * pt.c (instantiate_decl): Look for the original template. - (tsubst): Set DECL_IMPLICIT_INSTANTIATION on partial instantiations - of member templates. - -Wed Oct 1 08:41:38 1997 Jason Merrill - - * Makefile.in (g++FAQ.*): New rules. - (CONFLICTS): Update. - * g++FAQ.texi: Moved from libg++. - - * parse.y (PFUNCNAME): Only specify the type once. - -1997-10-01 Brendan Kehoe - - * lex.c (real_yylex): Clean up the code to fully behave the way - the c-lex.c parser does for complex and real numbers. - -Tue Sep 30 08:51:36 1997 Jason Merrill - - * method.c (build_decl_overload_real): Reformat. - -Tue Sep 30 00:18:26 1997 Jason Merrill - - * method.c (synthesize_method): If at_eof, determine our linkage. - -1997-09-29 Paul Eggert - - * lex.c (real_yylex): Treat `$' just like `_', except issue a - diagnostic if !dollars_in_ident or if pedantic. - - * lang-specs.h (@c++): -ansi no longer implies -$. - - * decl2.c (lang_decode_option): - -traditional and -ansi now do not mess with - dollars_in_ident. - -Mon Sep 29 19:57:51 1997 H.J. Lu - - * Makefile.in (parse.o, decl.o): Also depend on - $(srcdir)/../except.h $(srcdir)/../output.h. - (decl2.o): Also depend on $(srcdir)/../expr.h ../insn-codes.h - $(srcdir)/../except.h $(srcdir)/../output.h. - (typeck.o, init.o): Also depend on $(srcdir)/../expr.h - ../insn-codes.h. - - * call.c, cp-tree.h, decl.c, tree.c: Finish prototyping. - - * expr.c (cplus_expand_expr): Make it static. - - * decl2.c, init.c, typeck.c: Include "expr.h". - (expand_expr): Use proper values when calling the function. - -Mon Sep 29 11:05:54 1997 Alexandre Oliva - - * lang-options.h: New -Wold-style-cast flag. - * cp-tree.h (warn_old_style_cast): New variable. - * decl2.c (warn_old_style_cast): Likewise. - (lang_decode_option): Support -Wold-style-cast. - (reparse_absdcl_as_casts): Produce old-style-cast warning. - -Mon Sep 29 09:20:53 1997 Benjamin Kosnik - - * decl.c (cp_finish_decl): Allow expand_aggr_init to set - TREE_USED, reset value based on already_used. - - * init.c (expand_member_init): Revert change. - -Mon Sep 29 08:57:53 1997 Jason Merrill - - * cp-tree.h, decl.c, decl2.c, pt.c: - Lose DECL_C_STATIC and DECL_PUBLIC. Don't pretend statics are public. - - * decl2.c (lang_decode_option): Add missing ;. - -Sat Sep 27 16:22:48 1997 Jason Merrill - - * friend.c (do_friend): Disable injection for all template-derived - decls. - * decl2.c (lang_decode_option): Handle -fguiding-decls. - * parse.y (notype_template_declarator): New nonterminal. - (direct_notype_declarator): Use it. - (complex_direct_notype_declarator): Likewise. - (object_template_id): Accept any kind of identifier after TEMPLATE. - (notype_qualified_id): Don't add template declarators here. - -Sat Sep 27 16:21:58 1997 Mark Mitchell - - * call.c (add_template_candidate): Add explicit_targs parameter. - (build_scoped_method_call): Use it. - (build_overload_call_real): Likewise. - (build_user_type_conversion_1): Likewise. - (build_new_function_call): Likewise. - (build_object_call): Likewise. - (build_new_op): Likewise. - (build_new_method_call): Likewise. - (build_new_function_call): Handle TEMPLATE_ID_EXPR. - (build_new_method_call): Likewise. - - * class.c (finish_struct_methods): Add specialization pass to - determine which methods were specializing which other methods. - (instantiate_type): Handle TEMPLATE_ID_EXPR. - - * cp-tree.def (TEMPLATE_ID_EXPR): New tree code. - - * cp-tree.h (name_mangling_version): New variable. - (flag_guiding_decls): Likewise. - (build_template_decl_overload): New function. - (begin_specialization): Likewise. - (reset_specialization): Likewise. - (end_specialization): Likewise. - (determine_explicit_specialization): Likewise. - (check_explicit_specialization): Likewise. - (lookup_template_function): Likewise. - (fn_type_unification): Add explicit_targs parameter. - (type_unification): Likewise. - - * decl.c (duplicate_decls): Add smarts for explicit - specializations. - (grokdeclarator): Handle TEMPLATE_ID_EXPR, and function - specializations. - (grokfndecl): Call check_explicit_specialization. - - * decl2.c (lang_decode_option): Handle -fname-mangling-version. - (build_expr_from_tree): Handle TEMPLATE_ID_EXPR. - (check_classfn): Handle specializations. - - * error.c (dump_function_name): Print specialization arguments. - - * friend.c (do_friend): Don't call pushdecl for template - instantiations. - - * init.c (build_member_call): Handle TEMPLATE_ID_EXPR. - - * lang-options.h: Add -fname-mangling-version, -fguiding-decls, - and -fno-guiding-decls. - - * lex.c (identifier_type): Return PFUNCNAME for template function - names. - - * method.c (build_decl_overload_real): New function. - (build_template_parm_names): New function. - (build_overload_identifier): Use it. - (build_underscore_int): New function. - (build_overload_int): Use it. Add levels for template - parameters. - (build_overload_name): Likewise. Also, handle TYPENAME_TYPEs. - (build_overload_nested_names): Handle template type parameters. - (build_template_decl_overload): New function. - - * parse.y (YYSTYPE): New ntype member. - (nested_name_specifier): Use it. - (nested_name_specifier_1): Likewise. - (PFUNCNAME): New token. - (template_id, object_template_id): New non-terminals. - (template_parm_list): Note specializations. - (template_def): Likewise. - (structsp): Likewise. - (fn.def2): Handle member template specializations. - (component_decl_1): Likewise. - (direct_notype_declarator): Handle template-ids. - (component_decl_1): Likewise. - (direct_notype_declarator): Handle template-ids. - (primary): Handle TEMPLATE_ID_EXPR, and template-ids. - - * pt.c (processing_specializations): New variable. - (template_header_count): Likewise. - (type_unification_real): New function. - (processing_explicit_specialization): Likewise. - (note_template_header): Likewise. - (is_member_template): Handle specializations. - (end_template_decl): Call reset_specialization. - (push_template_decl): Handle member template specializations. - (tsubst): Likewise. - (tsubst_copy): Handle TEMPLATE_ID_EXPR. - (instantiate_template): Handle specializations. - (instantiate_decl): Likewise. - (fn_type_unification): Handle explicit_targs. - (type_unification): Likewise. Allow incomplete unification - without an error message, if allow_incomplete. - (get_bindings): Use new calling sequence for fn_type_unification. - - * spew.c (yylex): Handle PFUNCNAME. - - * tree.c (is_overloaded_fn): Handle TEMPLATE_ID_EXPR. - (really_overloaded_fn): Likewise. - (get_first_fn): Handle function templates. - - * typeck.c (build_x_function_call): Use really_overloaded_fn. - Handle TEMPLATE_ID_EXPR. - (build_x_unary_op): Likewise. - (build_unary_op): Likewise. - (mark_addressable): Templates whose address is taken are marked - as used. - -1997-09-25 Andreas Schwab - - * decl.c (init_decl_processing): Declare __builtin_constant_p as - accepting any kind of type, not only int. - -Fri Sep 26 00:22:56 1997 Jason Merrill - - * search.c (get_matching_virtual): Notice virtual bases when sorrying - about covariant returns. - - * parse.y (member_init): Also imply typename here. Remove ancient - extension for initializing base members. - -Thu Sep 25 11:11:13 1997 Jason Merrill - - Handle multi-level typenames and implicit typename in base list. - * parse.y (typename_sub{,[0-2]}): New rules. - (structsp, rule TYPENAME_KEYWORD): Use typename_sub. - (nonnested_type): New rule. - (complete_type_name): Use it. - (base_class.1): Use typename_sub and nonnested_type. - (nested_name_specifier): Don't elide std:: here. - * decl.c (make_typename_type): Handle getting a type for NAME. - (lookup_name_real): Turn std:: into :: here. - - Rvalue conversions were removed in London. - * call.c (is_subseq): Don't consider lvalue transformations. - (build_conv): LVALUE_CONV and RVALUE_CONV get IDENTITY_RANK. - (joust): Re-enable ?: kludge. - -1997-09-22 Brendan Kehoe - - * decl.c (start_function): Up warning of no return type to be a - pedwarn. - -Mon Sep 22 14:15:34 1997 Benjamin Kosnik - - * init.c (expand_member_init): Don't set TREE_USED. - * decl.c (cp_finish_decl): Mark decls used if type has TREE_USED - set,don't clear TREE_USED wholesale. - -Sat Sep 20 15:31:00 1997 Jason Merrill - - * call.c (build_over_call): Do require_complete_type before - build_cplus_new. - -Thu Sep 18 16:47:52 1997 Jason Merrill - - * search.c (lookup_field): Call complete_type in all cases. - - * decl.c (finish_function): Just warn about flowing off the end. - -Wed Sep 17 10:31:25 1997 Jason Merrill - - * decl.c (grokparms): Don't bash a permanent list node if we're - in a function. - -1997-09-17 Brendan Kehoe - - * Makefile.in (CONFLICTS): Fix s/r conflict count to 18. - -Tue Sep 16 14:06:56 1997 Jason Merrill - - * call.c (build_new_op): Give better error for syntactically - correct, but semantically invalid, use of undeclared template. - - * call.c (compare_qual): Handle pmfs. - - * decl.c (store_parm_decls): last_parm_cleanup_insn is the insn - after the exception spec. - -Mon Sep 15 11:52:13 1997 Jason Merrill - - * call.c (null_ptr_cst_p): Integer type, not integral type. - - * call.c (joust): Disable warnings until they can be moved to the - right place. - -Fri Sep 12 16:11:13 1997 Per Bothner - - * Makefile.in, config-lang.in: Convert to autoconf. - -Thu Sep 11 17:14:55 1997 Jason Merrill - - * decl.c (lookup_name_real): Add implicit 'typename' to types from - base classes. - - * pt.c (most_specialized_class): Fix typo. - (tsubst): Move constant folding to TREE_VEC case. - -Thu Sep 11 10:08:45 1997 Mark Mitchell - - * pt.c (do_poplevel): Don't warn about unused local variables - while processing_template_decl since we don't always know whether - or not they will need constructing/destructing. - - * pt.c (uses_template_parms): Check the values of an enumeration - type to make sure they don't depend on template parms. - - * decl.c (make_typename_type): Don't lookup the field if the - context uses template parms, even if we're not - processing_template_decl at the moment. - - * pt.c (coerce_template_parms): Avoid looking at the - TYPE_LANG_DECL portion of a typename type, since there won't be - one. - (tsubst): Do constant folding as necessary to make sure that - arguments passed to lookup_template_class really are constants. - -Wed Sep 10 11:21:55 1997 Jason Merrill - - * except.c (expand_builtin_throw): #ifndef DWARF2_UNWIND_INFO. - * decl2.c (finish_file): Only register exception tables if we - need to. - - * decl.c (init_decl_processing): Add __builtin_[fs]p. - -Tue Sep 9 19:49:38 1997 Jason Merrill - - * pt.c (unify): Just return 0 for a TYPENAME_TYPE. - -Tue Sep 9 17:57:25 1997 Mark Mitchell - - * error.c (dump_decl): Avoid crashing when presented with a - uninitialized constant, as can occur with a template parameter. - (dump_expr): Make sure that there are enough levels of - current_template_parms before we start diving through them. - -1997-09-09 Brendan Kehoe - - * typeck.c (build_indirect_ref): Heed FLAG_VOLATILE similar to - c-typeck.c. - -Tue Sep 9 09:36:39 1997 Benjamin Kosnik - - * except.c (expand_throw): Call build_delete for all - exception types, not just objects with destructors. - -Mon Sep 8 02:33:20 1997 Jody Goldberg - - * decl.c (current_local_enum): Remove static. - * pt.c (tsubst_enum): Save and restore value of current_local_enum - in case template is expanded in enum decl. - (instantiate_class_template): Use new tsubst_enum signature. - (tsubst_expr): Likewise. - -Mon Sep 8 01:21:43 1997 Mark Mitchell - - * pt.c (begin_member_template_processing): Take a function as - argument, not a set of template arguments. Use the template - parameters, rather than the arguments. Handle non-type parameters - correctly. Push a binding level for the parameters so that multiple - member templates using the same parameter names can be declared. - (end_member_template_processing): Pop the binding level. - (push_template_decl): Mark member templates as static when - appropriate. - - * lex.c (do_pending_inlines): Pass the function, not its template - arguments, to begin_member_template_processing. - (process_next_inline): Likewise. - (do_pending_defargs): Likewise. - - * error.c (dump_expr): Obtain the correct declaration for a - TEMPLATE_CONST_PARM. - - * call.c (add_template_conv_candidate): New function. - (build_object_call): Handle member templates, as done in the other - build_ functions. - -Sat Sep 6 10:20:27 1997 Mark Mitchell - - * decl.c (replace_defag): Undo previous change. - * lex.c (do_pending_defargs): Deal with member templates. - - * pt.c (is_member_template): Avoid crashing when passed a - non-function argument. - -Fri Sep 5 17:27:38 1997 Jason Merrill - - * class.c (grow_method): Remove check for redeclaration. - -Fri Sep 5 01:37:17 1997 Mark Mitchell - - * cp-tree.h (INNERMOST_TEMPLATE_PARMS): New macro. - (DECL_INNERMOST_TEMPLATE_PARMS): Likewise. - (PRIMARY_TEMPLATE_P): Use it. - * call.c (build_overload_call_real): Use it. - * class.c (instantiate_type): Likewise. - * decl.c (decls_match): Likewise. - * method.c (build_overload_identifier): Likewise. - * pt.c (push_template_decl): Likewise. - (classtype_mangled_name): Likewise. - (lookup_template_class): Likewise. - - * cp-tree.h (DECL_NTPARMS): Change name from DECL_NT_PARMS to - DECL_NTPARMS to conform to usage elsewhere. - * call.c (add_template_candidate): Likewise. - * class.c (instantiate_type): Likewise. - * pt.c (instantiate_template): Likewise. - (get_bindings): Likewise. - - * class.c (grow_method): Use DECL_FUNCTION_TEMPLATE_P instead of - is_member_template. - - * pt.c (unify): Undo changes to allow multiple levels of template - parameters. - (type_unification): Likewise. - (fn_type_unification): Likewise. - (get_class_bindings): Likewise. - * cp-tree.h (Likewise). - - * decl.c (replace_defarg): Check that the type of the default - parameter does not invlove a template type before complaining - about the initialization. - - * error.c (dump_expr): Deal with template constant parameters in - member templates correctly. - - * pt.c (is_member_template): Deal with class specializations - correctly. - (tsubst): Handle "partial instantiation" of member templates - correctly. - -Wed Sep 3 12:30:24 1997 Mark Mitchell - - * pt.c (type_unification): Change calling sequence to allow for - multiple levels of template parameters. - (tsubst_expr): Likewise. - (tsubst): Likewise. - (tsubst_copy): Likewise. - (instantiate_template): Likewise. - (unify): Likewise. - * call.c (build_overload_call_real): Use it. - (add_builtin_candidate): Use it. - (build_new_method_call): Use it. - * class.c (instantiate_type): Use it. - * decl.c (grokdeclarator): Use it. - * decl2.c (finish_file): Use it. - * method.c (build_overload_identifier): Use it. - - * call.c (add_template_candidate): Add additional parameter for - the function return type. Call fn_type_unification istead of - type_unification. - (build_user_type_conversion_1): Handle member templates. - (build_new_function_call): Likewise. - (build_new_op): Likewise. - (build_new_method_call): Likewise. - - * class.c (grow_method): Don't give an error message indicating - that two member templates with the same name are ambiguous. - (finish_struct): Treat member template functions just like member - functions. - - * cp-tree.h (check_member_template): Add declaration. - (begin_member_template_processing): Likewise. - (end_member_template_processing): Likewise. - (fn_type_unification): Likewise. - (is_member_template): Likewise. - (tsubst): Change prototype. - (tsubst_expr): Likewise. - (tsubst_copy): Likewise. - (instantiate_template): Likewise. - (get_bindings): Likewise. - - * decl.c (decls_match): Handle multiple levels of template - parameters. - (pushdecl): Handle template type params just like other type - declarations. - (push_class_level_binding): Return immediately if the - class_binding_level is NULL. - (grokfndecl): If check_classfn() returns a member_template, use - the result of the template, not the template itself. - - * decl2.c (check_member_template): New function. Check to see - that the entity declared to be a member template can be one. - (check_classfn): Allow redeclaration of member template functions - with different types; the new functions can be specializations or - explicit instantiations. - - * error.c (dump_decl): Handle multiple levels of template - parameters. - (dump_function_decl): Update to handle function templates. - - * lex.c (do_pending_inlines): Set up template parameter context - for member templates. - (process_next_inline): Likewise. - - * method.c (build_overload_identifier): Adjust for multiple levels - of template parameters. - - * parse.y (fn.def2): Add member templates. - (component_decl_1): Likewise. - - * pt.c (begin_member_template_processing): New function. - (end_member_template_processing): Likewise. - (is_member_template): Likewise. - (fn_type_unification): Likewise. - (current_template_parms): Return a vector of all the template - parms, not just the innermost level of parms. - (push_template_decl): Deal with the possibility of member - templates. - (lookup_template_class): Likewise. - (uses_template_parms): Likewise. - (tsubst): Modify processing to TEMPLATE_TYPE_PARM and - TEMPLATE_CONST_PARM to deal with multiple levels of template - arguments. Add processing of TEMPLATE_DECL to produce new - TEMPLATE_DECLs from old ones. - (do_decl_instantiation): Handle member templates. - - * search.c (lookup_fnfields_1): Handle member template conversion - operators. - - * tree.c (cp_tree_equal): Check the levels, as well as the - indices, of TEMPLATE_CONST_PARMs. - - * typeck.c (comptypes): Check the levels, as well as the indices, - fo TEMPLATE_TYPE_PARMs. - (build_x_function_call): Treat member templates like member - functions. - -Wed Sep 3 11:09:25 1997 Jason Merrill - - * typeck.c (c_expand_return): Always convert_for_initialization - before checking for returning a pointer to local. - - * pt.c (type_unification): If strict and the function parm doesn't - use template parms, just compare types. - -Wed Sep 3 10:35:49 1997 Klaus Espenlaub - - * method.c (build_overloaded_value): Replace direct call - to the floating point emulator with REAL_VALUE_TO_DECIMAL macro. - -Wed Sep 3 00:02:53 1997 Jason Merrill - - * typeck.c (convert_arguments): Don't arbitrarily choose the first - of a set of overloaded functions. - -Tue Sep 2 12:09:13 1997 Jason Merrill - - * lex.c (real_yylex): Don't elide __FUNCTION__. - - * method.c (build_overload_value): Add in_template parm. - (build_overload_int): Likewise. - (build_overload_identifier): Pass it. - - * decl.c (duplicate_decls): Don't bash a previous template - definition with a redeclaration. - - * pt.c (unify): float doesn't match double. - - * pt.c (do_type_instantiation): Handle getting a _TYPE or a - TYPE_DECL. Handle getting non-template types. - * parse.y (explicit_instantiation): Use typespec instead of - aggr template_type. - -Tue Sep 2 10:27:08 1997 Richard Henderson - - * typeck.c (build_ptrmemfunc1): Clean up ptr->int cast warnings. - -Mon Sep 1 13:19:04 1997 Eugene Mamchits - - * call.c (add_builtin_candidate): Add missing TREE_TYPE. - (compare_ics): Likewise. - -Mon Sep 1 13:19:04 1997 Jason Merrill - - * call.c (joust): Warn about choosing one conversion op over - another because of 'this' argument when the other return type is - better. - (source_type): New fn. - - * call.c (build_new_op): Strip leading REF_BIND from first operand - to builtin operator. - - * decl2.c (mark_vtable_entries): Mark abort_fndecl as used when we - use its RTL. - -Thu Aug 28 09:45:23 1997 Jason Merrill - - * call.c (null_ptr_cst_p): Remove support for (void*)0. - -Wed Aug 27 02:03:34 1997 Jeffrey A Law - - * typeck.c (expand_target_expr): Make definition match declaration. - - * class.c (get_basefndecls): Make definition match declaration. - -Mon Aug 25 14:30:02 1997 Jason Merrill - - * input.c (sub_getch): Eventually give up and release the input file. - - * decl.c (cp_finish_decl): If #p i/i, put inline statics in the - right place. - - * call.c (joust): Tweak message. - -Sat Aug 23 18:02:59 1997 Mark Mitchell - - * error.c (type_as_string): Put const/volatile on template type - parameters where appropriate. - -Sat Aug 23 17:47:22 1997 Jeffrey A Law - - * call.c (strictly_better): Make arguments unsigned ints. - -Thu Aug 21 18:48:44 1997 Jason Merrill - - * lex.c (real_yylex): Refer to __complex instead of complex. - -Thu Aug 21 22:25:46 1997 J"orn Rennecke - - * lex.c (real_yylex): Don't use getc directly. - -Wed Aug 20 17:25:08 1997 Jason Merrill - - * call.c (is_subseq): Don't try to be clever. - -Wed Aug 20 03:13:36 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - * parse.y, pt.c: Include "except.h". - * call.c, class.c, class.h, cp-tree.h, cvt.c, decl.c, decl2.c, - error.c, except.c, expr.c, friend.c, g++spec.c, init.c, input.c, - lex.c, lex.h, method.c, parse.y, pt.c, repo.c, rtti.c, search.c, - sig.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: Finish - prototyping. - -Wed Aug 20 01:34:40 1997 Jason Merrill - - * decl2.c (mark_vtable_entries): Instead of replacing pure - virtuals with a reference to __pure_virtual, copy the decl and - change the RTL. - -Tue Aug 19 02:26:07 1997 Jason Merrill - - * pt.c (lookup_nested_type_by_name): Handle typedef wierdness. - - * typeck2.c (my_friendly_abort): Report bugs to egcs-bugs@cygnus.com. - - * pt.c (instantiate_class_template): Call repo_template_used - before finish_prevtable_vardecl. - - * call.c (is_subseq): New fn. - (compare_ics): Use it. - - * repo.c (finish_repo): Don't crash on no args. - - * parse.y (named_complex_class_head_sans_basetype): Handle - explicit global scope. - * decl2.c (handle_class_head): New fn. - - * pt.c (unify): Add CONST_DECL case. - -Thu Aug 14 10:05:13 1997 Brendan Kehoe - - * rtti.c (permanent_obstack): Fix decl to not be a pointer. - - * cp-tree.h (report_type_mismatch): Add prototype. - * call.c (build_overload_call_real): Remove erroneous fourth - argument to report_type_mismatch. - (build_user_type_conversion_1): Remove erroneous second arg to - tourney. - (build_new_function_call): Likewise. - (build_object_call): Likewise. - (build_new_op): Likewise. - (build_new_method_call): Likewise. - -Wed Aug 13 19:19:25 1997 Jason Merrill - - * error.c (dump_decl): Don't bother processing a function with no - DECL_LANG_SPECIFIC. - - * method.c (emit_thunk): Call init_function_start in the macro case. - -Wed Aug 13 10:46:19 1997 H.J. Lu (hjl@gnu.ai.mit.edu) - - * decl2.c (DEFAULT_VTABLE_THUNKS): Define to be 0 if not - defined and used to set flag_vtable_thunks. - -Tue Aug 12 20:13:57 1997 Jason Merrill - - * parse.y: Don't clear the inlines from their obstack until they've - all been processed. - - * decl.c (duplicate_decls): Don't complain about exception - specification mismatch if flag_exceptions is off. - -Mon Aug 11 15:01:56 1997 Marc Lehmann - - * Make-lang.in (c++.distclean): Remove g++.c on make distclean. - -Sun Aug 10 12:06:09 1997 Paul Eggert - - * cp-tree.h: Replace STDIO_PROTO with PROTO in include files. - * cvt.c, error.c, except.c, expr.c, friend.c, init.c, rtti.c: - Include before include files that formerly used STDIO_PROTO. - - * decl.c, g++spec.c, lex.c, method.c, repo.c: - Include "config.h" first, as per autoconf manual. - -Fri Aug 8 11:47:48 1997 Jason Merrill - - * decl.c (duplicate_decls): Tweak wording. - * lex.c (do_pending_defargs): Don't die if we see a default arg - that isn't a DEFAULT_ARG. - * error.c (dump_expr): Handle DEFAULT_ARG. - - * decl2.c (lang_decode_option): Handle -fhandle-exceptions. - * lang-options.h: Add -fhandle-exceptions. - - * class.c (build_vtable): Vtables are artificial. - (prepare_fresh_vtable): Likewise. - -Wed Aug 6 11:02:36 1997 Jason Merrill - - * cvt.c (ocp_convert): After converting to the target type, set - LOOKUP_NO_CONVERSION. - - * call.c (joust): Warn about potentially confusing promotion rules - with -Wsign-promo. - * cp-tree.h, lang-options.h, decl2.c: Support -Wsign-promo. - -Tue Aug 5 15:15:07 1997 Michael Meissner - - * exception.cc: Declare __terminate_func with noreturn attribute. - -Fri Aug 1 03:18:15 1997 Jason Merrill - - * parse.y: Break out eat_saved_input, handle errors. - (function_try_block): Use compstmt instead of compstmt_or_error. - -Thu Jul 31 17:14:04 1997 Jason Merrill - - * tree.c (build_cplus_new): Don't set TREE_ADDRESSABLE. - -Fri Jul 4 01:45:16 1997 Andreas Schwab - - * Make-lang.in (cplib2.txt, cplib2.ready): Instead of checking for - existence of cc1plus check whether $(LANGUAGES) contains C++. - -Wed Jul 30 13:04:21 1997 Andreas Schwab - - * method.c (do_build_copy_constructor): When copying an anonymous - union member loop around to handle nested anonymous unions. Use - the offset of the member relative to the outer structure, not the - union. - -Tue Jul 29 21:17:29 1997 Jason Merrill - - * call.c (resolve_args): New fn. - (build_new_function_call): Use it. - (build_object_call): Likewise. - (build_new_method_call): Likewise. - -Mon Jul 28 16:02:36 1997 Jason Merrill - - * call.c (build_over_call): tsubst all default parms from templates. - -Wed Jul 23 13:36:25 1997 Jason Merrill - - * decl.c (struct cp_function): Add static_labelno. - (push_cp_function_context): Save it. - (pop_cp_function_context): Restore it. - -Tue Jul 22 14:43:29 1997 Jason Merrill - - * typeck.c (build_component_ref_1): Convert from reference. - -Tue Jul 22 11:06:23 1997 Brendan Kehoe - - * parse.y (current_declspecs, prefix_attributes): Initialize to - NULL_TREE. - - * parse.y (initdcl0): Make sure CURRENT_DECLSPECS is non-nil - before we try to force it to be a TREE_LIST. - (decl): Make sure $1.t is non-nil. - -Sun Jul 20 11:53:07 1997 Jason Merrill - - * pt.c (uses_template_parms): Handle template first-parse codes. - - * decl.c (cp_finish_decl): Only warn about user-defined statics. - -Fri Jul 18 17:56:08 1997 Jason Merrill - - * pt.c (unify): Handle BOOLEAN_TYPE. - - * cp-tree.h: Lose PARM_DEFAULT_FROM_TEMPLATE. - * pt.c (tsubst): Don't set it. - * call.c (build_over_call): Use uses_template_parms. - -Thu Jul 17 18:06:30 1997 Jason Merrill - - * method.c (build_overload_nested_name): Use static_labelno - instead of var_labelno. - (build_qualified_name): New fn. - (build_overload_name): Split out from here. - (build_static_name): Use build_qualified_name. - * decl.c (cp_finish_decl): Statics in extern inline functions - have comdat linkage. - (start_function): Initialize static_labelno. - -Thu Jul 17 11:20:17 1997 Benjamin Kosnik - - * class.c (finish_struct_methods): Add check of warn_ctor_dtor_privacy - before "all member functions in class [] are private". - -Wed Jul 16 23:47:08 1997 Jason Merrill - - * lex.c (do_scoped_id): convert_from_reference. - * init.c (build_offset_ref): Likewise. - -Wed Jul 16 12:34:29 1997 Benjamin Kosnik - - * error.c (dump_expr): Check TREE_OPERAND before dump_expr_list. - -Mon Jul 14 03:23:46 1997 Jason Merrill - - * typeck.c (get_member_function_from_ptrfunc): Promote index - before saving it. - -Sun Jul 13 00:11:52 1997 Jason Merrill - - * tree.c (layout_basetypes): Move non-virtual destructor warning. - * decl.c (xref_basetypes): Remove non-virtual destructor warning. - -Sat Jul 12 12:47:12 1997 Jason Merrill - - * decl.c (grokdeclarator): Call add_defarg_fn for the function - type, too. - * lex.c (add_defarg_fn): Adjust. - (do_pending_defargs): Adjust. Don't skip the first parm. - -Fri Jul 11 01:39:50 1997 Jason Merrill - - * decl.c (build_enumerator): Global enumerators are also readonly. - - * rtti.c (build_dynamic_cast_1): Renamed from build_dynamic_cast. - (build_dynamic_cast): Call it and convert_from_reference. - - * lex.c (add_defarg_fn): New fn. - (snarf_defarg): Don't add to defarg_types. - (do_pending_defargs): Lose defarg_types. All fns we process now - have defargs. - * decl.c (grokfndecl): Call add_defarg_fn. - - * Makefile.in (CONFLICTS): Expect 18 s/r conflicts. - * cp-tree.def: Add DEFAULT_ARG. - * spew.c (yylex): Call snarf_defarg as appropriate. - * parse.y: New tokens DEFARG and DEFARG_MARKER. - (defarg_again, pending_defargs, defarg, defarg1): New rules. - (structsp): Use pending_defargs. - (parms, full_parm): Use defarg. - * lex.c (init_lex): Initialize inline_text_firstobj. - (do_pending_inlines): Never pass the obstack to feed_input. - (process_next_inline): Call end_input instead of restore_pending_input. - (clear_inline_text_obstack, reinit_parse_for_expr, do_pending_defargs, - finish_defarg, feed_defarg, snarf_defarg, maybe_snarf_defarg): New fns. - * input.c (end_input): New fn. - (sub_getch): At the end of some fed input, just keep returning EOF - until someone calls end_input. - Remove 'obstack' field from struct input_source. - * decl.c (grokparms): Handle DEFAULT_ARG. - (replace_defarg): New fn. - * cp-tree.h (DEFARG_LENGTH, DEFARG_POINTER): New macros. - -Wed Jul 9 13:44:12 1997 Jason Merrill - - * call.c (implicit_conversion): If nothing else works, try binding - an rvalue to a reference. - -Wed Jul 9 13:04:38 1997 Geoffrey Noer - - * decl.c (init_decl_processing): Fix Jun 30 patch -- move - ifndef for Cygwin32 to include SIGSEGV. - -Thu Jul 3 01:44:05 1997 Jason Merrill - - * class.c (finish_struct_1): Only complain about pointers without - copy stuff if there are any constructors. - - * rtti.c (build_dynamic_cast): Call complete_type on the types. - - * decl.c (grokfndecl): If the function we chose doesn't actually - match, die. - - * decl2.c (grokclassfn): Don't specify 'const int' for the - artificial destructor parm. - - * pt.c (type_unification): If we are called recursively, nothing - decays. - -Mon Jun 30 17:53:21 1997 Geoffrey Noer - - * decl.c (init_decl_processing): Stop trying to catch signals - other than SIGABRT since the Cygwin32 library doesn't support - them correctly yet. This fixes a situation in which g++ causes - a hang on SIGSEGVs and other such signals in our Win32-hosted - tools. - -Mon Jun 30 14:50:01 1997 Jason Merrill - - * tree.c (mapcar, case CALL_EXPR): Handle all the parse node data. - -Fri Jun 27 15:18:49 1997 Jason Merrill - - * typeck2.c (store_init_value): Always return the value if our - type needs constructing. - - * method.c (hack_identifier): Convert class statics from - reference, too. - -Thu Jun 26 11:44:46 1997 Jason Merrill - - * Make-lang.in (cplib2.ready): Add $(LANGUAGES) dependency. - -Thu Jun 19 16:49:28 1997 Mike Stump - - * typeck.c (c_expand_return): Make sure we clean up temporaries at - the end of return x; - -Thu Jun 19 12:28:43 1997 Brendan Kehoe - - * lex.c (check_for_missing_semicolon): Also check for CV_QUALIFIER. - -Tue Jun 17 18:35:57 1997 Mike Stump - - * except.c (expand_builtin_throw): Add support - -fno-sjlj-exceptions -fPIC exception handling on the SPARC. - -Mon Jun 16 01:24:37 1997 Jason Merrill - - * repo.c (extract_string): Null-terminate. - - * cp-tree.h (TI_SPEC_INFO): New macro. - (CLASSTYPE_TI_SPEC_INFO): New macro. - * pt.c (push_template_decl): Correctly determine # of template parms - for partial specs. - - * call.c (compare_ics): Really fix 'this' conversions. - - * pt.c (do_decl_instantiation): Don't crash on explicit inst of - non-template fn. - - * pt.c (push_template_decl): Complain about mismatch in # of - template parms between a class template and a member template. - -Sun Jun 15 02:38:20 1997 Jason Merrill - - * method.c (synthesize_method): You can't call - function_cannot_inline_p after finish_function. - * decl.c (finish_function): Turn on flag_inline_functions and turn - off DECL_INLINE before handing a synthesized method to the - backend. - -Thu Jun 12 17:35:28 1997 Jason Merrill - - * method.c (synthesize_method): Remove July 30 change to never set - DECL_INLINE if at_eof. - -Thu Jun 12 15:25:08 1997 Mike Stump - - * xref.c (GNU_xref_member): Ensure that the node has a - decl_lang_specific part before checking DECL_FRIEND_P. - -Thu Jun 12 12:36:05 1997 Jason Merrill - - * pt.c (instantiate_class_template): Diagnose non-class types used - as bases. - -Wed Jun 11 17:33:40 1997 Jason Merrill - - * typeck.c (build_conditional_expr): Use convert_for_initialization - instead of convert_and_check. - -Wed Jun 11 12:31:33 1997 Brendan Kehoe - - * parse.y (typespec): Don't pedwarn for typeof. - -Tue Jun 10 00:22:09 1997 Jason Merrill - - * repo.c (finish_repo): Only check changes if we would write a - repo file. - - * call.c (compare_ics): Fix handling of 'this' conversions. - - * pt.c (do_decl_instantiation): Support static data too. Rename - from do_function_instantiation. - * cp-tree.h: Adjust. - * parse.y: Adjust. - - * repo.c (extract_string): New fn. - (get_base_filename): Use it. - (init_repo): Compare old args with current args. - -Mon Jun 9 14:25:30 1997 Mike Stump - - * Makefile.in, Make-lang.in: Protect C-ls with a comment - character, idea from Paul Eggert . - -Mon Jun 9 01:52:03 1997 Jason Merrill - - * typeck.c (c_expand_return): Be more persistent in looking for - returned temps. - - * cvt.c (build_up_reference): Use NOP_EXPR for switching from - pointer to reference. - - * class.c (build_vbase_path): Don't do anything if PATH has no steps. - -Sun Jun 8 03:07:05 1997 Jason Merrill - - * init.c (build_member_call, build_offset_ref): - Use do_scoped_id instead of do_identifier. - - * cvt.c (convert): Remove bogosity. - -Sat Jun 7 20:50:17 1997 Brendan Kehoe - - * cvt.c (build_up_reference): Do checks of ARGTYPE and - TARGET_TYPE before trying to use get_binfo. - -Fri Jun 6 17:36:39 1997 Jason Merrill - - * cvt.c (build_up_reference): Call get_binfo to get access control. - - * decl2.c (import_export_decl): If we don't support weaks, leave - statics undefined. - -Fri Jun 6 15:55:49 1997 Mike Stump - - * except.c (expand_builtin_throw): Add support for machines that - cannot access globals after throw's epilogue when - -fno-sjlj-exceptions is used. - -Thu Jun 5 16:28:43 1997 Jason Merrill - - * parse.y: 'std::' becomes '::'. - * lex.c (real_yylex): Remove 'namespace' warning. - * init.c (build_member_call): Ignore 'std::'. - (build_offset_ref): Likewise. - * decl2.c (do_using_directive): Ignore 'using namespace std;'. - (do_toplevel_using_decl): Ignore 'using std::whatever'. - * decl.c (push_namespace): Just sorry. - (pop_namespace): Nop. - (init_decl_processing): Declare std namespace. - -Tue Jun 3 18:08:23 1997 Jason Merrill - - * search.c (push_class_decls): A name which ambiguously refers to - several instantiations of the same template just refers to the - template. - -Tue Jun 3 12:30:40 1997 Benjamin Kosnik - - * decl.c (build_enumerator): Fix problem with unsigned long - enumerated values being smashed to ints, causing overflow - when computing next enumerated value (for enum values around - MAX_VAL). - -Mon Jun 2 17:40:56 1997 Jason Merrill - - * typeck.c (build_component_ref): Only call mark_used on a decl. - -Thu May 29 15:54:17 1997 Brendan Kehoe - - * typeck.c (build_c_cast): Make the check for a ptr to function - more specific before possible default_conversion call. - -Thu May 29 13:02:06 1997 Mike Stump - - * except.c (expand_exception_blocks): Simplify and fix and make - sure we don't end a region in a sequence, as expand_end_bindings - doesn't like it. - -Wed May 28 17:08:03 1997 Mike Stump - - * except.c (init_exception_processing): Mark terminate as not - returning so that the optimizer can optimize better. - -Tue May 27 19:49:19 1997 Mike Stump - - * cvt.c (convert): Don't do any extra work, if we can avoid it - easily. - -Tue May 27 18:21:47 1997 Mike Stump - - * *.[chy]: Change cp_convert to ocp_convert, change convert to - cp_convert. convert is now reserved for the backend, and doesn't - have the semantics a frontend person should ever want. - -Fri May 23 10:58:31 1997 Jason Merrill - - * lang-specs.h: Define __EXCEPTIONS if exceptions are enabled. - Lose -traditional support. - -Thu May 22 15:41:28 1997 Jason Merrill - - * rtti.c (get_tinfo_var): Use TYPE_PRECISION (sizetype). - - * parse.y (self_reference): Do it for templates, too. - * class.c (pushclass): Don't overload_template_name; the alias - generated by build_self_reference serves the same purpose. - - * tree.c (list_hash): Make static, take more args. - (list_hash_lookup): Likewise. - (list_hash_add): Make static. - (list_hash_canon): Lose. - (hash_tree_cons): Only build a new node if one isn't already in the - hashtable. - (hash_tree_chain): Use hash_tree_cons. - * cp-tree.h: Adjust. - * decl.c (grokfndecl): Just check IDENTIFIER_GLOBAL_VALUE instead - of calling lookup_name. - -Wed May 21 18:24:19 1997 Jason Merrill - - * pt.c (instantiate_class_template): TYPE_VALUES for an enum - doesn't refer to the CONST_DECLs. - -Tue May 20 21:09:32 1997 Bob Manson - - * rtti.c (get_tinfo_var): Either INT_TYPE_SIZE or 32, whichever - is bigger. - (expand_class_desc): Convert the last argument to a sizetype. - -Tue May 20 13:55:57 1997 Brendan Kehoe - - * gxx.gperf (__complex, __complex__, __imag, __imag__, __real, - __real__): Add reswords. - * hash.h: Regenerate. - * lex.h (rid): Add RID_COMPLEX. - (RID_LAST_MODIFIER): Set to RID_COMPLEX. - * lex.c (init_lex): Add building of RID_COMPLEX. - (real_yylex): General cleanup in line with what c-lex.c also has, - sans the cruft for traditional; add handling of SPEC_IMAG, complex - types, and imaginary numeric constants. - * parse.y (REALPART, IMAGPART): Add tokens. - (unary_expr): Add REALPART and IMAGPART rules. - * cp-tree.h (complex_{integer,float,double,long}_type_node): Declare. - * decl.c (complex_{integer,float,double,long}_type_node): Define - types. - (init_decl_processing): Set up the types. - (grokdeclarator): Add handling of RID_COMPLEX. Set and use - DEFAULTED_INT instead of EXPLICIT_INT when we default to int type. - * call.c (build_new_op): Add REALPART_EXPR and IMAGPART_EXPR cases. - * cvt.c (cp_convert): Handle COMPLEX_TYPE. - * error.c (dump_type_prefix, dump_type, dump_type_suffix): Add - COMPLEX_TYPE case. - * method.c (build_overload_name): Add handling of the different - COMPLEX_TYPEs, prefixing them with `J'. - * pt.c (process_template_parm): Don't let them use a COMPLEX_TYPE - as a template parm. - (uses_template_parms, tsubst, unify): Add COMPLEX_TYPE case. - * tree.c (lvalue_p): Add REALPART_EXPR and IMAGPART_EXPR cases. - (mapcar): Handle COMPLEX_CST. - * typeck.c (build_binary_op_nodefault): Handle COMPLEX_TYPE. - (common_type): Add code for complex types. - (build_unary_op): Add REALPART_EXPR and IMAGPART_EXPR cases. - (convert_for_assignment): Likewise. - (mark_addressable): Add REALPART_EXPR and IMAGPART_EXPR cases. - -Mon May 19 12:26:27 1997 Jason Merrill - - * pt.c (tsubst): Don't pass the MINUS_EXPR for an array domain to - tsubst_expr, as it might try to do overload resolution. - -Sat May 17 10:48:31 1997 Jason Merrill - - * pt.c (instantiate_class_template): Oops. - -Fri May 16 14:23:57 1997 Jason Merrill - - * cp-tree.def: Add TAG_DEFN. - * pt.c (tsubst_enum): New fn. - (instantiate_class_template): Use it. - (tsubst_expr): Support TAG_DEFN. - (tsubst): Support local enums. - (tsubst_copy): Likewise. - * decl.c (finish_enum): Likewise. - (start_enum): If this is a local enum, switch to permanent_obstack. - -Wed May 14 19:08:28 1997 Mike Stump - - * decl.c (store_parm_decls): Set last_parm_cleanup_insn here. - (finish_function): Put the base init code for constructors just - after the parm cleanup insns. - (struct cp_function): Add last_parm_cleanup_insn. - (push_cp_function_context): Likewise. - (pop_cp_function_context): Likewise. - -Tue May 13 15:51:20 1997 Jason Merrill - - * pt.c (tsubst_copy): Handle BIT_NOT_EXPR. - -Wed May 7 11:17:59 1997 Brendan Kehoe - - * method.c (emit_thunk) [ASM_OUTPUT_MI_THUNK]: Build up the RTL - for THUNK_FNDECL before we switch to temporary allocation. - -Mon May 5 14:46:53 1997 Jason Merrill - - * call.c (build_new_op): Handle null arg2 for ?:. - -Thu May 1 18:26:37 1997 Mike Stump - - * except.c (expand_exception_blocks): Ensure that we flow through - the end of the exception region for the exception specification. - Move exception region for the exception specification in, so that - it doesn't protect the parm cleanup. Remove some obsolete code. - * decl.c (store_parm_decls): Likewise. - (finish_function): Likewise. - -Tue Apr 29 15:38:54 1997 Jason Merrill - - * init.c (build_new): Fix nothrow handling. - -Tue Apr 29 14:29:50 1997 Brendan Kehoe - - * init.c (emit_base_init): Don't warn about the initialization - list for an artificial member. - -Fri Apr 25 17:47:59 1997 Brendan Kehoe - - * expr.c (do_case): Handle !START case for the error msg. - -Fri Apr 25 11:55:23 1997 Jason Merrill - - * decl2.c, lang-options.h: New option -Weffc++. - * class.c, decl.c, init.c, typeck.c: Move Effective C++ warnings - to -Weffc++. - - * decl2.c (finish_prevtable_vardecl): Change NO_LINKAGE_HEURISTICS - to MULTIPLE_SYMBOL_SPACES. - -Wed Apr 23 18:06:50 1997 Jason Merrill - - * method.c (emit_thunk, generic case): Set current_function_is_thunk. - - * method.c (emit_thunk, macro case): Set up DECL_RESULT. - - * typeck.c (c_expand_return): Don't complain about returning void - to void in an artificial function. - * method.c (make_thunk): Change settings of READONLY/VOLATILE, - don't set DECL_RESULT, set DECL_ARTIFICIAL. - (emit_thunk, generic code): Also set up DECL_LANG_SPECIFIC. - -Wed Apr 23 14:43:06 1997 Mike Stump - - * init.c (init_decl_processing): Add support for setjmp/longjmp based - exception handling. - * except.c (init_exception_processing): Likewise. - (expand_end_catch_block): Likewise. - (expand_exception_blocks): Likewise. - (expand_throw): Likewise. - * exception.cc (__default_terminate): Likewise. - - * init.c (perform_member_init): Use new method of expr level - cleanups, instead of cleanups_this_call and friends. - (emit_base_init): Likewise. - (expand_aggr_vbase_init_1): Likewise. - (expand_vec_init): Likewise. - * decl.c (cp_finish_decl): Likewise. - (expand_static_init): Likewise. - (store_parm_decls): Likewise. - (cplus_expand_expr_stmt): Likewise. - * decl2.c (finish_file): Likewise. - - * Make-lang.in (exception.o): Ok to compile with -O now. - - * decl.c (maybe_build_cleanup_1): We no longer have to unsave, as - we know it will be done later by the backend. - - * decl2.c (lang_f_options): Remove support for short temps. - * lang-options.h: Likewise. - -Wed Apr 23 04:12:06 1997 Jason Merrill - - * tree.c (varargs_function_p): New fn. - * method.c (emit_thunk): Replace broken generic code with code to - generate a heavyweight thunk function. - -Tue Apr 22 02:45:18 1997 Jason Merrill - - * pt.c (process_template_parm): pedwarn about floating-point parms. - - * decl.c (grokdeclarator): inline no longer implies static. - - * spew.c (yylex): Always return the TYPE_DECL if we got a scope. - -Mon Apr 21 15:42:27 1997 Jason Merrill - - * class.c (check_for_override): The signature of an overriding - function is not changed. - - * call.c (build_over_call): Move setting of conv into the loop. - Note: this change, along with the related changes of the 18th thru - the 20th of April, fix an infinite loop problem in conversions. - -Sun Apr 20 16:24:29 1997 Jason Merrill - - * call.c (build_user_type_conversion_1): Really ignore rvalue - conversions when looking for a REFERENCE_TYPE. - - * cvt.c (build_up_reference): Eviscerate, use build_unary_op. - * cp-tree.h (TREE_REFERENCE_EXPR): #if 0. - * typeck.c (decay_conversion): Don't set TREE_REFERENCE_EXPR. - (build_unary_op): Likewise. - * call.c (build_over_call): See through a CONVERT_EXPR around the - ADDR_EXPR for on a temporary. - * typeck.c (c_expand_return): See through a CONVERT_EXPR around - the ADDR_EXPR for a local variable. - -Fri Apr 18 12:11:33 1997 Jason Merrill - - * call.c (build_user_type_conversion_1): If we're trying to - convert to a REFERENCE_TYPE, only consider lvalue conversions. - (build_new_function_call): Print candidates. - (implicit_conversion): Try a temp binding if the lvalue conv is BAD. - (reference_binding): Binding a temporary of a reference-related type - is BAD. - -Thu Apr 17 14:37:22 1997 Brendan Kehoe - - * inc/typeinfo (type_info::before): Add cv-qualifier-seq. - * tinfo2.cc (type_info::before): Likewise. - -Mon Apr 14 12:38:17 1997 Jason Merrill - - * call.c (implicit_conversion): Oops. - -Fri Apr 11 02:18:30 1997 Jason Merrill - - * call.c (implicit_conversion): Try to find a reference conversion - before binding a const reference to a temporary. - -Wed Apr 2 12:51:36 1997 Mike Stump - - * exception.cc (__default_unexpected): Call terminate by default, - so that if the user overrides terminate, the correct function will - be called. - -Wed Mar 19 14:14:45 1997 Mike Stump - - * parse.y (left_curly): Avoid trying to use any fields of - error_mark_node, as there aren't any. - -Thu Mar 13 16:33:22 1997 Jason Merrill - - * lex.c (do_identifier): Avoid breaking on overloaded methods - as default arguments. - -Wed Mar 12 13:55:10 1997 Hans-Peter Nilsson - - * call.c (add_template_candidate): Initialize the variable "dummy". - -Mon Mar 10 15:13:14 1997 Brendan Kehoe - - * decl.c (start_decl): Make sure TYPE isn't an error_mark_node - before we try to use TYPE_SIZE and TREE_CONSTANT on it. - -Fri Mar 7 13:19:36 1997 Brendan Kehoe - - * cp-tree.h (comp_ptr_ttypes, more_specialized): Add decl. - (debug_binfo): Delete decl, not needed. - - * tree.c (fnaddr_from_vtable_entry, function_arg_chain, - promotes_to_aggr_type): Delete fns. - * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY, - SET_FNADDR_FROM_VTABLE_ENTRY, FUNCTION_ARG_CHAIN, - PROMOTES_TO_AGGR_TYPE): Delete alternates to #if 1. - - * decl.c (pending_invalid_xref{,_file,_line}): Delete unused vars. - - * friend.c (is_friend_type): Delete fn. - * cp-tree.h (is_friend_type): Delete decl. - - * decl.c (original_result_rtx, double_ftype_double, - double_ftype_double_double, int_ftype_int, long_ftype_long, - float_ftype_float, ldouble_ftype_ldouble, last_dtor_insn): Make static. - * typeck.c (original_result_rtx, warn_synth): Delete extern decls. - - * decl.c (push_overloaded_decl{,_top_level}): Make static, adding - fwd decls. - * cp-tree.h (push_overloaded_decl{,_top_level}): Delete decls. - - * decl.c (pushdecl_nonclass_level): #if 0, unused. - * cp-tree.h (pushdecl_nonclass_level): #if 0 decl. - - * lex.c (reinit_lang_specific): #if 0, unused. - * cp-tree.h (reinit_lang_specific): #if 0 decl. - - * decl.c (revert_static_member_fn): Make static, adding fwd decl. - * cp-tree.h (revert_static_member_fn): Delete decl. - - * class.c (root_lang_context_p): Delete fn. - * cp-tree.h (root_lang_context_p): Delete decl. - - * decl.c (set_current_level_tags_transparency): #if 0, unused. - * cp-tree.h (set_current_level_tags_transparency): #if 0 decl. - - * lex.c (set_vardecl_interface_info): Make static. - * cp-tree.h (set_vardecl_interface_info): Delete decl. - - * call.c (find_scoped_type): Make static. - * cp-tree.h (find_scoped_type): Delete decl. - - * search.c (convert_pointer_to_vbase): Make static. - * cp-tree.h (convert_pointer_to_vbase): Delete decl. - - * decl.c (const_ptr_type_node): Likewise. - * cp-tree.h (const_ptr_type_node): Delete decl. - - * typeck.c (common_base_type): Make static. - * cp-tree.h (common_base_types): Delete erroneous decl. - - * pt.c (classtype_mangled_name): Make static. - * cp-tree.h (classtype_mangled_name): Delete decl. - - * lex.c (check_newline): Make static. - * cp-tree.h (check_newline): Delete decl. - - * typeck.c (build_x_array_ref): Delete fn, same idea as - grok_array_decl. - * cp-tree.h (build_x_array_ref): Delete decl. - - * lex.c (copy_decl_lang_specific): Delete fn, same idea as - copy_lang_decl. - * cp-tree.h (copy_decl_lang_specific): #if 0 decl. - - * class.c (build_vtable_entry): Make static. - * cp-tree.h (build_vtable_entry): Delete decl. - - * class.c (build_vbase_pointer): Make static. - * cp-tree.h (build_vbase_pointer): Delete decl. - - * sig.c (build_sptr_ref): Add forward decl and make static. - * cp-tree.h (build_sptr_ref): Delete decl. - - * call.c (build_new_method_call): Add forward decl and make static. - * cp-tree.h (build_new_method_call): Delete decl. - - * call.c (build_object_call): Make static. - * class.c (check_for_override, complete_type_p, mark_overriders): - Likewise. - * decl.c (cp_function_chain): Likewise. - * lex.c (set_typedecl_interface_info, reinit_parse_for_block): - Likewise. - * pt.c (comp_template_args, get_class_bindings, push_tinst_level): - Likewise. - * tree.c (build_cplus_array_type_1): Likewise. - * typeck.c (comp_ptr_ttypes_{const,real,reinterpret}): Likewise. - (comp_target_parms): Likewise. - - * init.c (build_builtin_call): Make static. - * cp-tree.h (build_builtin_call): Delete decl. - - * typeck.c (binary_op_error): Delete decl. - * cp-tree.h (binary_op_error): Likewise. - -Thu Mar 6 16:13:52 1997 Brendan Kehoe - - * call.c (build_method_call): Compare against error_mark_node - directly, rather than the ERROR_MARK tree code. - * cvt.c (cp_convert): Likewise. - * decl.c (print_binding_level): Likewise. - (duplicate_decls): Likewise. - (grokdeclarator): Likewise. - (grokdeclarator): Likewise. - * init.c (expand_aggr_init_1): Likewise. - (decl_constant_value): Likewise. - * method.c (build_opfncall): Likewise. - (hack_identifier): Likewise. - * typeck.c (build_modify_expr): Likewise. - - * typeck.c (build_c_cast): Don't decl TYPE as register tree. - -Sun Mar 2 02:54:36 1997 Bruno Haible - - * pt.c (unify): Strip NOP_EXPR wrappers before unifying integer values. - - * pt.c (coerce_template_parms): Add new error message. - - * method.c (build_overload_value): Implement name mangling for - floating-point template arguments. - - * method.c (build_overload_int, icat, dicat): Fix mangling of template - arguments whose absolute value doesn't fit in a signed word. - -Mon Mar 3 12:14:54 1997 Brendan Kehoe - - * friend.c: New file; put all of the friend stuff in here. - * init.c: Instead of here. - * Makefile.in (CXX_OBJS): Add friend.o. - (friend.o): Add dependencies. - * Make-lang.in (CXX_SRCS): Add $(srcdir)/cp/friend.c. - -Sun Mar 2 11:04:43 1997 Jason Merrill - - * call.c (build_scoped_method_call): Complain if the scope isn't a - base. - -Wed Feb 26 11:31:06 1997 Jason Merrill - - * parse.y (left_curly): Don't crash on erroneous type. - - * init.c (build_delete): Fix type of ref. - -Tue Feb 25 12:41:48 1997 Jason Merrill - - * search.c (get_vbase_1): Renamed from get_vbase. - (get_vbase): Wrapper, now non-static. - (convert_pointer_to_vbase): Now static. - - * call.c (build_scoped_method_call): Accept a binfo for BASETYPE. - * init.c (build_delete): Pass one. - (build_partial_cleanup_for): Use build_scoped_method_call. - * decl.c (finish_function): Pass a binfo. - -Mon Feb 24 15:00:12 1997 Jason Merrill - - * call.c (build_over_call): Only synthesize non-trivial copy ctors. - - * typeck.c (build_c_cast): Lose other reference to flag. - - * call.c (build_field_call): Don't look for [cd]tor_identifier. - * decl2.c (delete_sanity): Remove meaningless use of - LOOKUP_HAS_IN_CHARGE. - * decl.c (finish_function): Use build_scoped_method_call instead - of build_delete for running vbase dtors. - * init.c (build_delete): Call overload resolution code instead of - duplicating it badly. - -Thu Feb 20 15:12:15 1997 Jason Merrill - - * call.c (build_over_call): Call mark_used before trying to elide - the call. - - * decl.c (implicitly_declare): Don't set DECL_ARTIFICIAL. - -Wed Feb 19 11:18:53 1997 Brendan Kehoe - - * typeck.c (build_modify_expr): Always pedwarn for a cast to - non-reference used as an lvalue. - -Wed Feb 19 10:35:37 1997 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Convert from 0 to a pmf properly. - -Tue Feb 18 15:40:57 1997 Jason Merrill - - * parse.y (handler): Fix template typo. - -Sun Feb 16 02:12:28 1997 Jason Merrill - - * error.c (lang_decl_name): New fn. - * tree.c (lang_printable_name): Use it. - -Fri Feb 14 16:57:05 1997 Mike Stump - - * g++spec.c: Include config.h so that we can catch bzero #defines - from the config file. - -Tue Feb 11 13:50:48 1997 Mike Stump - - * new1.cc: Include a declaration for malloc, to avoid warning, and - avoid lossing on systems that require one (ones that define malloc - in xm.h). - -Mon Feb 10 22:51:13 1997 Bruno Haible - - * decl2.c (max_tinst_depth): New variable. - (lang_decode_option): Parse "-ftemplate-depth-NN" command line - option. - * pt.c (max_tinst_depth): Variable moved. - * lang-options.h: Declare "-ftemplate-depth-NN" command line option - as legal. - -Fri Feb 7 15:43:34 1997 Jason Merrill - - * decl.c (xref_basetypes): Allow a base class that depends on - template parms to be incomplete. - - * decl2.c (build_expr_from_tree): Support typeid(type). - * rtti.c (get_typeid): Support templates. - (expand_si_desc, expand_class_desc): Fix string length. - (expand_ptr_desc, expand_attr_desc, expand_generic_desc): Likewise. - -Tue Feb 4 11:28:24 1997 Jason Merrill - - * pt.c (unify, case TEMPLATE_CONST_PARM): Use cp_tree_equal. - - * pt.c (tsubst): Put it back for -fno-ansi-overloading. - -Mon Feb 3 18:41:12 1997 Jason Merrill - - * pt.c (tsubst, case FUNCTION_DECL): Lose obsolete code that - smashes together template and non-template decls of the same - signature. - -Thu Jan 30 19:18:00 1997 Jason Merrill - - * pt.c (tsubst): Don't recurse for the type of a TYPENAME_TYPE. - -Wed Jan 29 11:40:35 1997 Brendan Kehoe - - * decl.c (duplicate_decls): Next route, pedwarn about different - exceptions if -pedantic *or* olddecl !DECL_IN_SYSTEM_HEADER. - -Tue Jan 28 20:43:29 1997 Brendan Kehoe - - * cp-tree.h (HAS_DEFAULT_IMPLEMENTATION): Delete macro. - (struct lang_type): Delete has_default_implementation member. - Increase dummy to 21. - * decl.c (start_method): Delete usage. - - * cp-tree.h (build_call, null_ptr_cst_p, in_function_p, - store_after_parms, start_decl_1, auto_function): Add decls. - (get_arglist_len_in_bytes, declare_implicit_exception, - have_exceptions_p, make_type_decl, typedecl_for_tag, - store_in_parms, pop_implicit_try_blocks, push_exception_cleanup, - build_component_type_expr, cplus_exception_name, - {make,clear}_anon_parm_name, dont_see_typename): Removed decls. - * call.c (build_this): Make static. - (is_complete): Likewise. - (implicit_conversion): Likewise. - (reference_binding): Likewise. - (standard_conversion): Likewise. - (strip_top_quals): Likewise. - (non_reference): Likewise. - (build_conv): Likewise. - (user_harshness): Likewise. - (rank_for_ideal): Likewise. - * decl.c (start_decl_1): Delete forward decl. - (push_decl_level): Make static. - (resume_binding_level): Make static. - (namespace_bindings_p): Make static. - (declare_namespace_level): Make static. - (lookup_name_real): Make static. - (duplicate_decls): Make static. Take register off NEWDECL and - OLDDECL parm decls. - * decl2.c (get_sentry): Make static. - (temp_name_p): Delete fn. - * except.c (auto_function): Delete decl. - * lex.c (handle_{cp,sysv}_pragma): Make static. - (handle_sysv_pragma) [HANDLE_SYSV_PRAGMA]: Add forward decl. - * method.c (do_build_{copy_constructor,assign_ref}): Make static. - * pt.c (tsubst_expr_values): Make static. - * rtti.c (combine_strings): Delete decl. - -Tue Jan 28 16:40:40 1997 Jason Merrill - - * pt.c (push_template_decl): Handle getting a typedef. - - * call.c (build_new_function_call): Complain about void arg. - -Tue Jan 28 15:25:09 1997 Brendan Kehoe - - * decl.c (duplicate_decls): Give pedwarn of different exceptions - if -pedantic, instead of olddecl !DECL_IN_SYSTEM_HEADER. - -Mon Jan 27 19:21:29 1997 Mike Stump - - * except.c (expand_throw): Don't expand the cleanup tree here, - since we are not going to write the rtl out. Fixes problem with - -g -O on SPARC. - -Mon Jan 27 16:24:35 1997 Sean McNeil - - * Make-lang.in: Add $(exeext) as necessary. - -Mon Jan 27 13:20:39 1997 Mike Stump - - * parse.y (handler_seq): Must have at least one catch clause. - -Sat Jan 25 12:00:05 1997 Jason Merrill - - * call.c (add_builtin_candidate): Restore ?: hack. - - * decl.c (grok_op_properties): More warnings. - -Sat Jan 25 08:50:03 1997 Brendan Kehoe - - * decl.c (duplicate_decls): On second thought, do it as a pedwarn - still but only if !DECL_IN_SYSTEM_HEADER (olddecl). - - * decl.c (duplicate_decls): Scale back to a warning, and only do - 'em if -pedantic. - -Fri Jan 24 17:52:54 1997 Mike Stump - - * decl.c (duplicate_decls): pedwarn mismatched exception - specifications. - -Thu Jan 23 18:18:54 1997 Mike Stump - - * call.c (build_new_method_call): Don't display the invisible - argument for controlling virtual bases. - -Thu Jan 23 16:48:10 1997 Mike Stump - - * new: Add nothrow new and delete, bad_alloc and throw specifications - for delete. - * decl.c (init_decl_processing): Add throw specification for delete. - * new.cc (nothrow): Define. - * lex.c (real_yylex): Removing warning that throw and friends are - keywords. - * new1.cc (operator new (size_t sz, const nothrow_t&)): Define. - * new2.cc (operator new[] (size_t sz, const nothrow_t&): Define. - * Make-lang.in: Add new{1,2}.{cc,o}. - -Thu Jan 23 16:39:06 1997 Jason Merrill - - * lex.c (cons_up_default_function): Fix return type of synth op=. - - * init.c (emit_base_init): Add warnings for uninitialized members - and bases. - - * decl.c (xref_basetypes): Add warning for non-polymorphic type - with destructor used as base type. - - * decl.c (grok_op_properties): Add warning for op= returning void. - * typeck.c (c_expand_return): Add warning for op= returning anything - other than *this. - - * class.c (finish_struct_1): Add warning for class with pointers - but not copy ctor or copy op=. - - * cp-tree.h (TI_PENDING_TEMPLATE_FLAG): New macro. - * pt.c (add_pending_template): Use it instead of LANG_FLAG_0. - (instantiate_template): If -fexternal-templates, add this - instantiation to pending_templates. - - * decl2.c (copy_assignment_arg_p): Disable old hack to support - Booch components. - -Tue Jan 21 18:32:04 1997 Mike Stump - - * cvt.c (cp_convert): pedwarn enum to pointer conversions. - -Mon Jan 20 17:59:51 1997 Jason Merrill - - * call.c (standard_conversion): Handle getting references. Tack - on RVALUE_CONV here. Do it for non-class types, too. - (reference_binding): Pass references to standard_conversion. - (implicit_conversion): Likewise. - (add_builtin_candidate): Disable one ?: kludge. - (convert_like): Handle RVALUE_CONVs for non-class types. - (joust): Disable the other ?: kludge. - -Mon Jan 20 14:53:13 1997 Brendan Kehoe - - * decl.c (init_decl_processing): Add code to build up common - function types beforehand, to avoid creation then removal of - things already in the hash table. - -Mon Jan 20 14:43:49 1997 Jason Merrill - - * decl.c (finish_function): Also zero out DECL_INCOMING_RTL for - the arguments. - - * error.c (dump_expr, TEMPLATE_CONST_PARM): Don't require - current_template_parms. - -Fri Jan 17 10:25:42 1997 Jason Merrill - - * search.c (lookup_field): Don't return a function, check want_type. - -Thu Jan 16 18:14:35 1997 Brendan Kehoe - - * init.c (build_new): Make sure PLACEMENT has a type. - -Thu Jan 16 17:40:28 1997 Jason Merrill - - * init.c (build_new): Support new (nothrow). - -Wed Jan 15 12:38:14 1997 Jason Merrill - - * pt.c (instantiate_decl): Also do push_to_top_level before setting - up DECL_INITIAL. - - * cp-tree.h (PARM_DEFAULT_FROM_TEMPLATE): New macro. - * pt.c (tsubst): Defer instantiation of default args. - * call.c (build_over_call): Until here. - -Wed Jan 15 10:08:10 1997 Brendan Kehoe - - * search.c (lookup_field): Make sure we have an - IDENTIFIER_CLASS_VALUE before we try to return it. - -Thu Jan 9 07:19:01 1997 Brendan Kehoe - - * call.c (build_method_call): Delete unused var PARM. - (build_overload_call_real): Likewise. - (build_object_call): Delete unused var P. - (build_new_op): Likewise. - * decl.c (builtin_type_tdescs_{arr, len, max}): #if 0 out static - var definitions, which are never used. - (shadow_tag): Delete unused var FN. - * expr.c (cplus_expand_expr): Delete unused var ORIGINAL_TARGET. - * init.c (build_new): Delete unused var ALLOC_TEMP. - * method.c (hack_identifier): Delete unused var CONTEXT. - (do_build_copy_constructor): Delete unused var NAME. - (synthesize_method): Delete unused var BASE. - * pt.c (lookup_template_class): Delete unused var CODE_TYPE_NODE. - * rtti.c (build_headof): Delete unused var VPTR. - (get_typeid): Delete unused var T. - * typeck.c (build_conditional_expr): Delete unused vars ORIG_OP1 - and ORIG_OP2. - (build_ptrmemfunc): Delete unused vars U and NINDEX. - * typeck2.c (build_functional_cast): Delete unused var BINFO. - -Wed Jan 8 13:09:54 1997 Jason Merrill - - * search.c (lookup_field): Use IDENTIFIER_CLASS_VALUE to look up - things in a type being defined. - * decl.c (finish_enum): Reverse the values so that they are in - the correct order. - - * pt.c (instantiate_class_template): Don't initialize - BINFO_BASETYPES until the vector is filled out. - (unify): Don't abort on conflicting bindings, just fail. - (instantiate_decl): Do push_tinst_level before any tsubsting. - - * method.c (build_overload_value): Handle getting a - TEMPLATE_CONST_PARM for a pointer. - -Tue Jan 7 14:00:58 1997 Jason Merrill - - * init.c (expand_member_init): Don't give 'not a base' error for - templates. - - * pt.c (instantiate_decl): Call import_export_decl later. - - * pt.c (instantiate_class_template): Return a value. - - * parse.y (extension): New rule for __extension__. - (extdef, unary_expr, decl, component_decl): Use it. - -Tue Jan 7 09:20:28 1997 Mike Stump - - * class.c (base_binfo): Remove unused base_has_virtual member. - (finish_base_struct): Likewise. - (finish_struct_1): Likewise. - -Tue Dec 31 20:25:50 1996 Mike Stump - - * search.c (expand_upcast_fixups): Fix bogus code generation - problem where the generated code uses the wrong index into the - runtime built vtable on the stack. Old code could clobber random - stack values. - -Tue Dec 31 15:16:56 1996 Mike Stump - - * init.c (perform_member_init): Make sure the partial EH cleanups - live on the function_obstack. - -Fri Dec 27 10:31:40 1996 Paul Eggert - - * Make-lang.in (g++spec.o): Don't use $< with an explicit target; - this isn't portable to some versions of `make' (e.g. Solaris 2.5.1). - -Tue Dec 24 10:24:03 1996 Jeffrey A Law - - * decl.c (grokvardecl): Avoid ANSI style initialization. - -Sun Dec 22 04:22:06 1996 Jason Merrill - - * pt.c (tsubst): Tweak arg types for a FUNCTION_TYPE. - -Fri Dec 20 17:09:25 1996 Jason Merrill - - * pt.c (instantiate_class_template): Call grok_{ctor,op}_properties. - -Fri Dec 20 12:17:12 1996 Brendan Kehoe - - * g++spec.c (lang_specific_driver): Put missing hyphen in front of - arguments we compare against. Start the count of I at 1, not 0, - since argv[0] is still the command. - -Thu Dec 19 11:53:57 1996 Stan Shebs - - * lang-specs.h: Accept .cp as an C++ extension. - -Mon Dec 16 22:43:31 1996 Brendan Kehoe - - * cp-tree.h (ptr_reasonably_similar): Add decl. - -Thu Dec 12 15:00:35 1996 Brendan Kehoe - - * decl.c (grokvardecl): Change SPECBITS parm to be the SPECBITS_IN - pointer. New local SPECBITS with the parm's value. - (grokdeclarator): Pass &specbits down. - - * parse.y (expr_no_commas): Make sure $$ is not an error_mark_node - before we try to do C_SET_EXP_ORIGINAL_CODE on it. - - * search.c (envelope_add_decl): Check that the CLASSTYPE_CID of - CONTEXT is not 0 before we try to use TYPE_DERIVES_FROM. - - * decl.c (cplus_expand_expr_stmt): Only expand the expr if EXP is - not an error_mark_node. - -Sat Dec 7 17:20:22 1996 Jason Merrill - - * cp-tree.h (TYPE_MAIN_DECL): Use TYPE_STUB_DECL. - * *.c: Use TYPE_MAIN_DECL instead of TYPE_NAME where appropriate. - -Fri Dec 6 14:40:09 1996 Jason Merrill - - * decl.c (grokdeclarator): When giving an anonymous struct a name, - replace TYPE_NAME instead of TYPE_IDENTIFIER (so TYPE_STUB_DECL is - not affected). - - * typeck2.c (build_m_component_ref): If component is a pointer - to data member, resolve the OFFSET_REF now. - - * call.c (convert_like): Don't go into infinite recursion. - - * pt.c (coerce_template_parms): Use tsubst_expr for non-type args. - - * class.c (finish_struct_1): Set DECL_ARTIFICIAL on the vptr. - * tree.c (layout_basetypes): And on the vbase ptr. - -Thu Dec 5 02:11:28 1996 Jason Merrill - - * decl.c (BOOL_TYPE_SIZE): Define in terms of POINTER_SIZE or - CHAR_TYPE_SIZE so bool is always the same size as another type. - - * decl.c (pushtag): Set DECL_IGNORED_P for DWARF, too. - -Tue Dec 3 23:18:37 1996 Jason Merrill - - * decl2.c (grok_x_components): Remove synthesized methods from - TYPE_METHODS of an anonymous union, complain about member - functions. - * decl.c (shadow_tag): Wipe out memory of synthesized methods in - anonymous unions. - (finish_function): Just clear the DECL_RTL of our arguments. - -Fri Nov 29 21:54:17 1996 Jason Merrill - - * decl2.c (finish_file): Emit DWARF debugging info for static data - members. - - * pt.c (tsubst): If t is a stub decl, return the stub decl for type. - -Wed Nov 27 14:47:15 1996 Bob Manson - - * typeck.c (build_component_ref): Don't die if COMPONENT isn't a - IDENTIFIER_NODE. - -Wed Nov 27 16:05:19 1996 Michael Meissner - - * Make-lang.in (g++-cross$(exeext)): Fix typo. - -Wed Nov 27 08:14:00 1996 Brendan Kehoe - - Make the g++ driver now be a standalone program, rather than one - that tries to run the gcc driver after munging up the options. - * Make-lang.in (g++.c, g++spec.o): New rules. - (g++.o): New rule, based on gcc.o with -DLANG_SPECIFIC_DRIVER - added. - (g++$(exeext)): New rule, based on xgcc rule. - (g++-cross$(exeext)): Now just copies g++$(exeext) over. - * g++spec.c: New file. - * g++.c: Removed file. - -Tue Nov 26 19:01:09 1996 Mike Stump - - * cvt.c (build_up_reference): Arrange for any temporary values - that have been keep in registers until now to be put into memory. - -Mon Nov 25 15:16:41 1996 Kaveh R. Ghazi - - * Make-lang.in (c++.stage[1234]): Depend upon stage[1-4]-start, so - that make -j3 bootstrap works better. - -Sun Nov 24 02:09:39 1996 Jason Merrill - - * decl.c (pushtag): Do pushdecl for anon tags. - -Thu Nov 21 16:30:24 1996 Jason Merrill - - * typeck.c (c_expand_return): Fix logic. - (unary_complex_lvalue): Avoid unused warning on address of INIT_EXPR. - -Wed Nov 20 18:47:31 1996 Bob Manson - - * g++.c (main): Make sure arglist has a final NULL entry. Add - PEXECUTE_LAST to the flags passed to pexecute, as otherwise - stdin/stdout of the invoked program are redirected to - nowheresville. - -Tue Nov 19 16:12:44 1996 Jason Merrill - - * decl.c (implicitly_declare): Set DECL_ARTIFICIAL. - -Tue Nov 19 15:48:19 1996 Mike Stump - - * init.c (resolve_offset_ref): Handle obj.vfn better. - * typeck.c (build_component_ref): Set TREE_TYPE on result from - build_vfn_ref. - -Tue Nov 19 13:14:33 1996 Mike Stump - - * typeck.c (convert_for_assignment): Also handle anachronistic - implicit conversions from (::*)() to cv void*. - * cvt.c (cp_convert_to_pointer): Likewise. - -Mon Nov 18 17:05:26 1996 Jason Merrill - - * lex.c (handle_cp_pragma): Fix bogus warning. - -Mon Nov 18 16:10:43 1996 Mike Stump - - * cvt.c (cp_convert_to_pointer): Avoid thinking a POINTER_TYPE - (METHOD_TYPE) is a TYPE_PTRMEMFUNC_P. - -Thu Nov 14 23:18:17 1996 Jason Merrill - - * class.c (finish_struct_1): Support DWARF2_DEBUG. - * search.c (dfs_debug_mark): Likewise. - * decl2.c (finish_vtable_vardecl): Likewise. - * decl.c (pushtag, finish_enum): Likewise. - * lex.c (check_newline): Use debug_* instead of calling *out - functions directly. - -Thu Nov 14 15:21:46 1996 Brendan Kehoe - - * Make-lang.in (cplib2.ready): Add else clause to avoid problems - on some picky hosts. - -Wed Nov 13 12:32:07 1996 Jason Merrill - - * class.c (finish_struct_1): A class has a non-trivial copy - constructor if it has virtual functions. - - * cvt.c (cp_convert): Always call a constructor. - - * call.c (reference_binding): Still tack on a REF_BIND - for bad conversions. - (build_user_type_conversion_1): Propagate ICS_BAD_FLAG. - - * typeck.c (convert_arguments): Pass LOOKUP_ONLYCONVERTING. - (c_expand_return): Likewise. - * typeck2.c (digest_init): Likewise for { }. - * init.c (expand_aggr_init_1): Keep the CONSTRUCTOR handling. - * cvt.c (cp_convert): Handle failure better. - -Wed Nov 13 11:51:20 1996 Brendan Kehoe - - * g++.c (main): Also set PEXECUTE_SEARCH, to make the invocation - of GCC be path-relative. - -Wed Nov 13 11:27:16 1996 Michael Meissner - - * Make-lang.in (g++-cross): G++-cross doesn't need version.o, but - it does need choose-temp.o and pexecute.o. - -Wed Nov 13 07:53:38 1996 Brendan Kehoe - - * g++.c (error) [!HAVE_VPRINTF]: Put error back for the only time - that we still use it. - (P_tmpdir, R_OK, W_OK, X_OK) [__MSDOS__]: Delete unnecessary macros. - -Wed Nov 13 02:00:26 1996 Jason Merrill - - * init.c (expand_default_init): Avoid calling constructors to - initialize reference temps. - - * cvt.c (convert_to_reference): Fix. - -Tue Nov 12 19:10:07 1996 Jason Merrill - - * cvt.c (cp_convert): Simplify for flag_ansi_overloading. - (convert_to_reference): Likewise. - * typeck.c (convert_for_initialization): Likewise. - * init.c (expand_default_init): Likewise. - (expand_aggr_init_1): Likewise. - * cp-tree.h (CONV_NONCONVERTING): Lose. - * typeck.c (build_c_cast): Lose allow_nonconverting parm. - * *.c: Adjust. - * call.c (build_user_type_conversion_1): Assume LOOKUP_ONLYCONVERTING. - -Tue Nov 12 16:29:04 1996 Brendan Kehoe - - * pt.c (tsubst_expr): Reverse args to expand_start_catch_block. - -Tue Nov 12 15:26:17 1996 Jason Merrill - - * init.c (expand_aggr_init_1): Don't crash on non-constructor - TARGET_EXPR. - -Tue Nov 12 14:00:50 1996 Brendan Kehoe - - * g++.c: Include gansidecl.h. - (VPROTO, PVPROTO, VA_START): Delete. - (choose_temp_base_try, choose_temp_base, perror_exec, - run_dos) [__MSDOS__]: Delete fns. - (pfatal_with_name): Delete fn. - (temp_filename): Declare like in gcc.c. - (pexecute, pwait, choose_temp_base): Declare from gcc.c. - (error_count, signal_count): Define. - (error): Delete both definitions. - (PEXECUTE_{FIRST,LAST,SEARCH,VERBOSE}): Define from gcc.c. - (pfatal_pexecute): Add fn from gcc.c. - (main): Rename local VERBOSE var to VERBOSE_FLAG. Rewrite the - code to use the pexecute stuff also used by gcc.c. - (MIN_FATAL_STATUS): Define. - * Make-lang.in (g++): Add dependency on and linking with - choose-temp.o and pexecute.o. - - * cp-tree.h: Include gansidecl.h. - (STDIO_PROTO): Delete #undef/#define. - * cvt.c (NULL): Delete #undef/#define. - * expr.c (NULL): Likewise. - * init.c (NULL): Likewise. - * rtti.c (NULL): Likewise. - * xref.c (NULL): Likewise. - - * cp-tree.h (build_user_type_conversion): Add prototype. - * call.c (build_user_type_conversion): Delete prototype. Correct - decl of FLAGS arg to be an int. - * cvt.c (build_user_type_conversion): Likewise. - -Tue Nov 12 12:16:20 1996 Jason Merrill - - * cp-tree.def: Add TRY_BLOCK and HANDLER. - * except.c (expand_start_catch_block): Support templates. - * parse.y (try_block, handler_seq): Likewise. - * pt.c (tsubst_expr): Support TRY_BLOCK and HANDLER. - -Mon Nov 11 13:57:31 1996 Jason Merrill - - * pt.c (current_template_args): New fn. - (push_template_decl): Use it. - * decl.c (grokdeclarator): Use it. - - * decl2.c (build_expr_from_tree): Dereference ref vars. - - * decl.c (grokdeclarator): Generalize handling of TYPENAME_TYPEs in - the decl-specifier-seq. - - * decl.c (grok_op_properties): Don't force the type of a conversion - op to be complete. Don't warn about converting to the same type - for template instantiations. - - * decl2.c (finish_file): Don't call instantiate_decl on synthesized - methods. - -Mon Nov 11 13:20:34 1996 Bob Manson - - * typeck.c (get_delta_difference): Remove previous bogusness. - Don't give errors if force is set. - -Fri Nov 8 17:38:44 1996 Jason Merrill - - * decl2.c (finish_file): Don't emit debug info. - * decl.c (pushdecl): Lose obsolete code. - (grokdeclarator): Still do the long long thing after complaining. - * search.c (note_debug_info_needed): Don't do anything if we're in a - template. - * method.c (synthesize_method): For non-local classes, - push_to_top_level first. - -Fri Nov 8 11:52:28 1996 Bob Manson - - * typeck.c (get_delta_difference): Add no_error parameter. - (build_ptrmemfunc): Call get_delta_difference with no_error set; - we don't want error messages when converting unrelated - pointer-to-member functions. - -Thu Nov 7 11:16:24 1996 Mike Stump - - * error.c (dump_expr): Improve the wording on error messages that - involve pointer to member functions. - -Tue Nov 5 17:12:05 1996 Mike Stump - - * cvt.c (cp_convert_to_pointer): Move code for conversions from - (::*)() to void* or (*)() up a bit, so that we can convert from - METHOD_TYPEs as well. - -Tue Nov 5 14:54:17 1996 Jason Merrill - - * rtti.c (get_tinfo_fn): Make sure 'type' is permanent. - There are no 'member' types. - (get_tinfo_fn_dynamic): Diagnose typeid of overloaded fn. - (build_x_typeid): Handle errors. - -Mon Nov 4 17:43:12 1996 Mike Stump - - * typeck.c (convert_for_assignment): Handle anachronistic implicit - conversions from (::*)() to void* or (*)(). - * cvt.c (cp_convert_to_pointer): Likewise. - (cp_convert_to_pointer_force): Remove cp_convert_to_pointer - conversions from here. - * decl2.c (lang_decode_option): Add -W{no-,}pmf-conversions. - * lang-options.h: Likewise. - * decl2.c (warn_pmf2ptr): Define. - * cp-tree.h: Declare it. - * typeck2.c (digest_init): Allow pmfs down into - convert_for_initialization. - -Sun Nov 3 09:43:00 1996 Jason Merrill - - * typeck.c (c_expand_return): Fix for returning overloaded fn. - -Fri Nov 1 08:53:17 1996 Jason Merrill - - * cp-tree.h (DIRECT_BIND): Change from INDIRECT_BIND. - * decl.c (grok_reference_init): Pass DIRECT_BIND. - * cvt.c (build_up_reference): Don't mark 'this' addressable. Use - DIRECT_BIND. - * call.c (convert_like): Don't pass INDIRECT_BIND. - * typeck.c (convert_arguments): Likewise. - * typeck.c (mark_addressable): Allow &this if flag_this_is_variable. - -Thu Oct 31 17:08:49 1996 Jason Merrill - - * typeck.c (mark_addressable): Support TARGET_EXPR, unify with - similar code in build_up_ref. - * cvt.c (build_up_reference): Drastically simplify. - -Mon Oct 28 12:45:05 1996 Jeffrey A Law - - * typeck.c (signed_or_unsigned_type): If the given type already - as the correct signedness, then just return it. - - * typeck.c ({un,}signed_type): If can't do anything, call - signed_or_unsigned_type. - -Thu Oct 24 14:21:59 1996 Bob Manson - - * decl2.c (copy_assignment_arg_p): Don't buy the farm if - current_class_type is NULL. - -Wed Oct 23 00:43:10 1996 Jason Merrill - - * class.c (finish_struct_1): Avoid empty structs by adding a field - so layout_type gets the mode right. - - * typeck.c (c_expand_return): Drastically simplify. - -Mon Oct 21 22:34:02 1996 Jason Merrill - - * typeck.c (decay_conversion): Handle overloaded methods. - -Fri Oct 18 16:03:48 1996 Jason Merrill - - * call.c (build_over_call): A TARGET_EXPR has side-effects. - -Thu Oct 17 11:31:59 1996 Mike Stump - - * cvt.c (convert_to_pointer_force): Add code to support pointer to - member function to pointer to function conversions. - * init.c (resolve_offset_ref): Add code to allow faked up objects, - ignoring them if they are not used, and giving an error, if they - are needed. - * typeck.c (get_member_function_from_ptrfunc): Fold e1 to improve - code, and so that we can give an error, if we needed an object, - and one was not provided. - (build_c_cast): Don't call default_conversion when we want to - convert to pointer to function from a METHOD_TYPE. - -Mon Oct 14 00:28:51 1996 Jason Merrill - - * Make-lang.in (cplib2.ready): Fix logic. - - * decl.c (shadow_tag): Only complain about non-artificial function - members. - - * class.c (finish_struct_1): Add synthesized methods to TYPE_METHODS. - -Fri Oct 11 16:12:40 1996 Jason Merrill - - * expr.c (cplus_expand_expr): Pre-tweak call_target like - expand_inline_function would. - - * pt.c (mark_decl_instantiated): If extern_p, call - mark_inline_for_output. - -Thu Oct 10 15:58:08 1996 Mike Stump - - * typeck.c (unary_complex_lvalue): Add code to handle intermediate - pmd conversions. - - * typeck.c (get_delta_difference): Fix wording, as we can be used - for pointer to data members. - -Tue Oct 8 12:43:51 1996 Bob Manson - - * pt.c (tsubst): If the function decl isn't a member of this - template, return a copy of the decl (including copying the - lang-specific part) so we don't hose ourselves later. - -Thu Oct 3 16:24:28 1996 Jason Merrill - - * class.c (finish_struct): Remove DWARF-specific tag handling. - * decl.c (pushtag): Likewise. - (finish_function): Always clear DECL_ARGUMENTS on function decls with - no saved RTX. - * decl2.c (finish_file): Emit DWARF debugging info for static data - members. - -Wed Oct 2 21:58:01 1996 Bob Manson - - * decl.c (duplicate_decls): Make sure the old DECL_LANG_SPECIFIC - isn't the same as the new one before we whack it. - -Mon Sep 30 13:38:24 1996 Jason Merrill - - * class.c, cp-tree.h, cvt.c, decl.c, decl2.c, gxx.gperf, hash.h, - lex.c, method.c, parse.y, typeck.c, typeck2.c: Remove - warn_traditional and warn_strict_prototypes; remove ancient - 'overload' code; remove references to flag_traditional. - -Mon Sep 30 12:58:40 1996 Mike Stump - - * input.c (sub_getch): Handle 8-bit characters in string literals. - -Sun Sep 29 03:12:01 1996 Jason Merrill - - * tree.c (mapcar): Handle CONSTRUCTORs. - (copy_to_permanent): Handle expression_obstack properly. - - * Make-lang.in (cplib2.txt): Also depend on the headers. - - * rtti.c (get_tinfo_var): Don't assume that POINTER_SIZE == - INT_TYPE_SIZE. - (expand_class_desc): Use USItype for offset field. - * tinfo.h (struct __class_type_info): Likewise. - - * method.c (build_overload_int): TYPE_PRECISION should be applied - to types. - -Sat Sep 28 14:44:50 1996 Jason Merrill - - * call.c (build_new_op): A COND_EXPR involving void must be a - builtin. - -Fri Sep 27 16:40:30 1996 Jason Merrill - - * typeck.c (build_x_component_ref): New fn. - (build_object_ref): Use it. - * parse.y (primary): Use it. - * decl2.c (build_expr_from_tree): Use it. - * cp-tree.h: Declare it. - - * decl.c (start_decl): Variable-sized arrays cannot be initialized. - * error.c (dump_type_suffix): Handle variable arrays. - -Fri Sep 27 13:14:05 1996 Brendan Kehoe - - * Make-lang.in (exception.o): Put back compiling it with -fPIC. - -Fri Sep 27 03:00:09 1996 Jason Merrill - - * decl.c (lookup_name_real): Don't try to look up anything in a - TYPENAME_TYPE. - - * tinfo2.cc (__throw_type_match_rtti): Oops. - -Thu Sep 26 22:11:05 1996 Brendan Kehoe - - * Make-lang.in (exception.o): Use -fno-PIC for now. - -Thu Sep 26 10:59:00 1996 Jason Merrill - - * rtti.c (build_dynamic_cast): Pass tinfo fns rather than - calling them. - (get_tinfo_fn_dynamic): Extracted from build_typeid. - * tinfo2.cc (__dynamic_cast): Adjust. - - * rtti.c (build_typeid): Use resolves_to_fixed_type_p. - (build_x_typeid): Likewise. - - * parse.y: Call build_x_typeid instead of build_typeid. - * cp-tree.def: Add TYPEID_EXPR. - * pt.c (tsubst_copy): Handle typeid. - * decl2.c (build_expr_from_tree): Likewise. - * rtti.c (build_x_typeid): Throw bad_typeid from here. - (build_typeid): Not here. - * cp-tree.h: Declare build_x_typeid. - -Wed Sep 25 17:26:16 1996 Jason Merrill - - * call.c (convert_like): Pull out constant values. - - * tree.c (mapcar): Use build_cplus_array_type, not build_array_type. - -Wed Sep 25 17:28:53 1996 Michael Meissner - - * decl.c (init_decl_processing): Create short int types before - creating size_t in case a machine description needs to use - unsigned short for size_t. - -Tue Sep 24 18:18:44 1996 Jason Merrill - - * Make-lang.in (exception.o): Turn off pic. - - * tinfo2.cc (__throw_type_match_rtti): Fix cv-variants of the same - type, multi-level ptr conversions. - - * rtti.c (call_void_fn): Renamed and genericized from throw_bad_cast. - (throw_bad_cast): Use it. - (throw_bad_typeid): New fn. - (build_typeid): Throw bad_typeid as needed. - Use build_call. - (synthesize_tinfo_fn): Handle functions and arrays before checking - for cv-quals. - - * Remove .h from standard C++ headers, add new.h, move into inc - subdirectory. - - * exception*: Remove pointer from object, constructors. Add - default exception::what that uses type_info::name. Add - __throw_bad_typeid. - - * init.c (build_new): Don't add a cookie to new (void *) T[2]. - -Mon Sep 23 15:21:53 1996 Jason Merrill - - * Make-lang.in: Building C++ code depends on cc1plus. - -Mon Sep 23 12:38:40 1996 Brendan Kehoe - - * decl.c (struct saved_scope): Declare PROCESSING_TEMPLATE_DECL as - a HOST_WIDE_INT, not a tree. - -Mon Sep 23 12:36:02 1996 Jason Merrill - - * exception.cc: Don't include . - - * Make-lang.in (c++.clean): Remove cplib2.*. - -Mon Sep 23 09:42:19 1996 Doug Evans - - * parse.y (component_decl_1, component_costructor_declarator case): - Pass attributes/prefix_attributes in tree list. - -Mon Sep 23 01:18:50 1996 Jason Merrill - - * tinfo{,2}.cc: #include instead of . - -Sun Sep 22 05:31:22 1996 Jason Merrill - - * lex.c (do_identifier): Don't do deferred lookup in a template - header. - - * typeck2.c (store_init_value): Oops. - - * new.{h,cc}, exception.{h,cc}, typeinfo.h, tinfo{2.cc,.cc,.h}: - New files for C++ lang-support library. - * Make-lang.in (CXX_EXTRA_HEADERS): Define. - (CXX_LIB2FUNCS): Define. - And rules for building the C++ lang-support code. - * config-lang.in (headers): Define. - (lib2funcs): Define. - -Sat Sep 21 19:17:28 1996 Jason Merrill - - * decl2.c (build_expr_from_tree): If CONSTRUCTOR has a type, call - digest_init. - * pt.c (tsubst_copy): Compute type for CONSTRUCTOR. - * typeck2.c (store_init_value): Check for initializing pmf with { } - here. - (process_init_constructor): Not here. - -Thu Sep 19 16:41:07 1996 Jason Merrill - - * pt.c (begin_template_parm_list): Increment - processing_template_decl here. - (end_template_parm_list): Not here. - (process_template_parm): No need to add 1 to it now. - * *.c: Use processing_template_decl instead of current_template_parms - to check for being in a template. - - * pt.c (uses_template_parms): Handle SCOPE_REF. Fix CONSTRUCTOR. - (tsubst_copy): Handle CONSTRUCTOR. - (instantiate_decl): Set up context properly for variables. - * decl2.c (build_expr_from_tree): Handle CONSTRUCTOR. - * class.c (finish_struct): Reverse CLASSTYPE_TAGS. - -Wed Sep 18 13:30:20 1996 Brendan Kehoe - - * lex.c (enum tree_node_kind) [GATHER_STATISTICS]: Put the enum back. - -Wed Sep 18 04:24:07 1996 Jason Merrill - - * method.c (make_thunk): Call comdat_linkage before setting the - TREE_CODE. - - * decl2.c (comdat_linkage): Use make_decl_one_only. - (import_export_decl): Likewise. - * decl.c (init_decl_processing): Check supports_one_only instead of - SUPPORTS_WEAK. - -Sat Sep 14 08:34:41 1996 Jason Merrill - - * decl2.c (grokfield): Tighten checking for access decls. - - * decl.c (make_typename_type): Resolve references to - current_class_type. Set CLASSTYPE_GOT_SEMICOLON. - (lookup_name_real): Types that depend on a template parameter get - an implicit 'typename' unless they're in the current scope. - (start_decl_1): We don't care about incomplete types that depend - on a template parm. - (grokdeclarator): Resolve 'typename's in the type specifier that - refer to members of the current scope. - - * call.c (build_over_call): Remove 'inline called before - definition' diagnostic. - (build_method_call): Likewise. - * decl.c (duplicate_decls): Downgrade 'used before declared - inline' to a warning, only with -Winline. - -Fri Sep 13 17:31:40 1996 Stan Shebs - - * mpw-make.sed: Fix include paths, add @DASH_C_FLAG@ to compile. - -Wed Sep 11 22:38:13 1996 Gerald Baumgartner - - * call.c (build_method_call): When calling a signature - default implementation, as in other cases, let instance_ptr simply - be instance. - -Wed Sep 11 22:14:44 1996 Mike Stump - - * parse.y (simple_stmt): Cleanup and use do_poplevel (). - -Wed Sep 11 22:10:48 1996 Mike Stump - - * except.c (expand_start_catch_block): Add a pushlevel so that -g - works on hppa and SPARC. - -Wed Sep 11 10:18:06 1996 Brendan Kehoe - - * typeck.c (build_indirect_ref): Catch PTR being an error_mark_node. - -Mon Sep 9 19:51:14 1996 Gerald Baumgartner - - * call.c (build_over_call): Check first whether DECL_CONTEXT exists - before testing whether it's a signature. - -Sun Sep 8 16:06:57 1996 Gerald Baumgartner - - * call.c (build_new_method_call): Don't complain about signature - pointers and references not being an aggr type. - (build_this): If a signature pointer or reference was passed in, - just return it. - (build_new_method_call): If instance is a signature pointer, set - basetype to the signature type of instance. - * sig.c (build_signature_method_call): Deleted basetype and - instance parameters, they can be found as the DECL_CONTEXT of - function and as the first argument passed in. - * cp-tree.h: Changed declaration of build_signature_method_call. - * call.c (build_method_call): Deleted first two arguments in call - of build_signature_method_call. - (build_over_call): Added call to build_signature_method_call. - -Thu Sep 5 16:51:28 1996 Jason Merrill - - * typeck.c (build_c_cast): Don't tack a non_lvalue_expr onto a - target_expr. - -Thu Sep 5 10:05:38 1996 Brendan Kehoe - - * cvt.c (convert_to_reference): Use %#T, not %#D, for error. - -Wed Sep 4 17:16:09 1996 Bob Manson - - * except.c (expand_start_try_stmts): Move to except.c in the backend. - (expand_end_try_stmts): Remove. - - * init.c (perform_member_init): Use add_partial_entry () instead - of directly manipulating lists. - (emit_base_init): Likewise. - -Wed Sep 4 12:14:36 1996 Mike Stump - - * except.c (expand_exception_blocks): Always make sure USE and - CLOBBER insns that came at the end still do, the backend relies - upon this. - -Wed Sep 4 07:44:48 1996 Jason Merrill - - * call.c (build_over_call): We can only use a TARGET_EXPR of the - right type. - -Tue Sep 3 19:26:05 1996 Jason Merrill - - * cvt.c (convert_to_reference): Revert last change, don't complain - about temp without target decl. - -Tue Sep 3 10:22:56 1996 Mike Stump - - * decl.c (grokdeclarator): Don't core dump when void() is given. - -Tue Sep 3 02:38:56 1996 Jason Merrill - - * decl.c (copy_args_p): Don't crash. - -Fri Aug 30 14:26:57 1996 Mike Stump - - * pt.c (tsubst): And support template args inside the exception - specification. - - * pt.c (tsubst): Add support for exception specifications in - template functions. - -Fri Aug 30 10:01:55 1996 Mike Stump - - * cp-tree.def (DECL_STMT): Eliminate the throw spec field, only 3 - fields now. - * cp-tree.h (start_decl): Eliminate the throw spec parameter. - (start_function): Likewise. - (start_method): Likewise. - (grokfield): Likewise. - (make_call_declarator): Add throw spec parameter. - (set_quals_and_spec): Add routine. - * lex.c (set_quals_and_spec): Likewise. - * decl.h (grokdeclarator): Eliminate the throw spec parameter. - * decl.c (shadow_tag): Eliminate the throw spec parameter to - grokdeclarator. - (groktypename): Likewise. - (start_decl): Eliminate the throw spec parameter. Eliminate the - throw spec parameter to grokdeclarator. Eliminate the throw spec - field in DECL_STMT. - (cp_finish_decl): Eliminate the throw spec field in DECL_STMT. - (grokfndecl): Remove useless set of raises. - (grokdeclarator): Eliminate the throw spec parameter. Eliminate - the throw spec parameter to start_decl. Pull the throw spec out - of the call declarator. - (grokparms): Eliminate the throw spec parameter to grokdeclarator. - (start_function): Eliminate the throw spec parameter. Eliminate - the throw spec parameter to grokdeclarator. - (start_method): Likewise. - * decl2.c (grokfield): Likewise. - (grokbitfield): Eliminate the throw spec parameter to grokdeclarator. - (grokoptypename): Likewise. - (finish_file): Eliminate the throw spec parameter to - start_function. Add throw spec to make_call_declarator. - * except.c (init_exception_processing): Add throw spec to - make_call_declarator. Eliminate the throw spec parameter to - start_decl. - (expand_start_catch_block): Eliminate the throw spec parameter to - grokdeclarator. - (expand_builtin_throw): Add throw spec to make_call_declarator. - Eliminate the throw spec parameter to start_function. - (start_anon_func): Likewise. - * lex.c (make_call_declarator): Add throw spec parameter. - (set_quals_and_spec): New routine. - (cons_up_default_function): Add throw spec to make_call_declarator. - Eliminate the throw spec parameter to grokfield. - * method.c (synthesize_method): Eliminate the throw spec parameter - to start_function. - * pt.c (process_template_parm): Eliminate the throw spec parameter - to grokdeclarator. - (tsubst): Add throw spec to make_call_declarator. - (tsubst_expr): Eliminate the throw spec parameter to start_decl. - (do_function_instantiation): Eliminate the throw spec parameter to - grokdeclarator. Eliminate the throw spec parameter to - start_function. - * rtti.c (synthesize_tinfo_fn): Eliminate the throw spec parameter - to start_function. - * parse.y (datadef): Remove non-winning optimization. - (decl): Likewise. - (fndef): Remove ambiguous error productions uncovered by grammar - fixing. - (constructor_declarator): Add exception_specification_opt here. - (component_constructor_declarator): Likewise. - (direct_after_type_declarator): Likewise. - (complex_direct_notype_declarator): Likewise. - (direct_abstract_declarator): Likewise. - (fn.def1): Remove exception_specification_opt. - (fn.def2): Likewise. - (condition): Likewise. - (initdcl0): Likewise. - (initdcl): Likewise. - (notype_initdcl0): Likewise. - (nomods_initdcl0): Likewise. - (component_decl_1): Likewise. - (component_declarator): Likewise. - (after_type_component_declarator0): Likewise. - (after_type_component_declarator): Likewise. - (notype_component_declarator): Likewise. - -Wed Aug 28 01:40:30 1996 Jason Merrill - - * call.c (build_over_call): Also use an INIT_EXPR when - initializing anything from an rvalue. - - * call.c (build_over_call): Call stabilize_reference when building - an INIT_EXPR instead of calling the copy ctor. - - * call.c (joust): Extend the previous change to all comparisons. - - * decl2.c, method.c, lex.c: Use MAKE_DECL_ONE_ONLY and - NO_LINKAGE_HEURISTICS. - - * decl2.c (finish_file): Emit any statics that weren't already. - - * typeck.c (build_static_cast): Implement. - * tree.c (build_cplus_new): Handle getting a TARGET_EXPR. - * decl.c (grokparms): Use can_convert_arg instead of - implicit_conversion directly. - (copy_args_p): New fn. - * cvt.c (convert_to_reference): Don't complain about temp with - static_cast. - (build_up_reference): Handle TARGET_EXPRs. - * call.c (build_over_call): Elide unnecessary temps. - (can_convert*): Use new overloading code. - -Tue Aug 27 13:12:21 1996 Jason Merrill - - * call.c: Move TYPE_PTR*_MACROS ... - * cp-tree.h: To here. - * typeck.c (build_reinterpret_cast): Implement. - - * call.c (add_builtin_candidate): Use TYPE_PTROB_P instead of - ptr_complete_ob. - (joust): If we're comparing a function to a builtin and the worst - conversion for the builtin is worse than the worst conversion for the - function, take the function. - - * typeck.c (build_const_cast): Implement. - (comp_ptr_ttypes_const): Like comp_ptr_ttypes, for const_cast. - (comp_ptr_ttypes_reinterpret): Like cpt, for reinterpret_cast. - -Tue Aug 27 13:14:58 1996 Bob Manson - - * rtti.c (build_dynamic_cast): Don't try to dereference exprtype - too early. Make sure we explode if exprtype turns out to be a - NULL_TREE when it shouldn't be. - -Tue Aug 27 10:56:21 1996 Mike Stump - - * cp-tree.h: New routine make_call_declarator. - * lex.c (make_call_declarator): Define it. - * except.c (init_exception_processing): Use it. - (expand_builtin_throw): Likewise. - (start_anon_func): Likewise. - * decl2.c (finish_file): Likewise. - * lex.c (cons_up_default_function): Likewise. - * parse.y: Likewise. - * pt.c (tsubst): Likewise. - -Mon Aug 26 17:40:03 1996 Mike Stump - - * decl2.c (groktypefield): Remove unused code. - -Mon Aug 26 17:00:33 1996 Mike Stump - - * gxx.gperf: Change TYPE_QUAL into CV_QUALIFIER. - * parse.y: Likewise. Change maybe_type_qual into maybe_cv_qualifier. - Change type_quals into cv_qualifiers. Change nonempty_type_quals into - nonempty_cv_qualifiers. - * hash.h: Rebuild. - - * lex.c (make_pointer_declarator): Change type_quals into - cv_qualifiers. - (make_reference_declarator): Likewise. - -Thu Aug 22 01:09:22 1996 Jason Merrill - - * decl.c (start_function): Only check interface_* for templates - with flag_alt_external_templates. - - * call.c (build_new_op): Check for comparison of different enum types. - (build_over_call): Fix arg # output. - - * typeck.c (build_component_ref): Handle pre-found TYPE_DECL. - -Wed Aug 21 00:13:15 1996 Jason Merrill - - * call.c (build_new_op): Check for erroneous args. - - * call.c (build_new_method_call): Add missing args to cp_error. - - * tree.c (error_type): Don't print reference-to-array. - - * typeck.c (convert_for_assignment): Don't say contravariance for - removing const. - -Tue Aug 20 13:23:00 1996 Jason Merrill - - * call.c (build_over_call): Diagnose bad convs for `this'. - - * lex.c (cons_up_default_function): Set DECL_ARTIFICIAL - on _ctor_arg. - - * call.c (convert_like): Handle bad convs. - (build_over_call): Handle bad convs better. - - * decl2.c: -fansi-overloading is now the default. - - * call.c (build_new_method_call): Check for erroneous args. - - * pt.c (instantiate_class_template): Propagate - TYPE_USES_MULTIPLE_INHERITANCE. - -Tue Aug 20 13:09:57 1996 Mike Stump - - * call.c (enforce_access): Add static to routine. - -Sun Aug 18 14:35:54 1996 Jason Merrill - - * call.c (build_user_type_conversion_1): Fix bad handling. - (compare_ics): Likewise. - -Sat Aug 17 21:54:11 1996 Jason Merrill - - * call.c (standard_conversion): Oops. - -Sat Aug 17 16:28:11 1996 Geoffrey Noer - - * g++.c: Update test for win32 (&& ! cygwin32). - -Sat Aug 17 03:45:31 1996 Jason Merrill - - * typeck.c (comp_ptr_ttypes_real): Handle OFFSET_TYPEs properly. - (ptr_reasonably_similar): New fn. - * call.c (BAD_RANK): New rank. - (ICS_BAD_FLAG): New macro. - (standard_conversion): Handle almost-right pointer conversions. - (reference_binding): Handle bad rvalue bindings. - (add_*_candidate): Stuff. - (build_over_call): Pass bad conversions to convert_for_initialization. - (compare_ics): Handle bad convs. - (joust): Likewise. - -Fri Aug 16 15:02:19 1996 Bob Manson - - * init.c (expand_vec_init): Use ptrdiff_type_node instead of - integer_type_node when computing pointer offsets. - -Fri Aug 16 01:28:32 1996 Jason Merrill - - * tree.c (lvalue_type): New fn. - (error_type): New fn. - * call.c (op_error): Use error_type. - (add_conv_candidate): Use lvalue_type. - (add_builtin_candidates): Likewise. - * error.c (args_as_string): Use error_type. - -Thu Aug 15 17:27:13 1996 Jason Merrill - - * pt.c (instantiate_decl): Evaluate DECL_INITIAL of a VAR_DECL here. - (tsubst): Not here. - - * decl.c (init_decl_processing): With -ansi, __null's type is the - signed integral type with the same number of bits as a pointer. - Introduce a new variable null_node for it. - * cp-tree.h: Adjust. - * call.c (null_ptr_cst_p): Adjust. - -Thu Aug 15 17:09:54 1996 Mike Stump - - * except.c (do_unwind): Mark %i7 as used on the SPARC so we can - optimize. - -Thu Aug 15 01:36:49 1996 Jason Merrill - - * decl2.c (import_export_decl): Ignore #pragma interface for tinfo - fns of classes without virtual functions. - - * call.c (add_function_candidate): Handle `this' specially. - (compare_ics): Likewise. - -Tue Aug 13 12:16:10 1996 Jason Merrill - - * typeck.c (build_conditional_expr): Fix handling of __null. - - * decl2.c (comdat_linkage): New fn. - (import_export_vtable): Use it. - (import_export_decl): Use it. - * method.c (make_thunk): Use it. - -Mon Aug 12 00:09:18 1996 Jason Merrill - - * pt.c (end_template_decl): If we don't actually have parms, return. - * parse.y (template_header): Accept 'template <>'. - - * errfn.c: Allow 5 args. - -Sun Aug 11 15:20:58 1996 Jason Merrill - - * tree.c (make_temp_vec): New fn. - * pt.c (push_template_decl): Handle partial specs. - (instantiate_class_template): Likewise. - (more_specialized): Use get_bindings. - (more_specialized_class): New fn. - (get_class_bindings): New fn. - (most_specialized_class): New fn. - (do_function_instantiation): List candidates for ambiguous case. - * decl.c (duplicate_decls): Lose reference to DECL_TEMPLATE_MEMBERS. - (shadow_tag): Call push_template_decl for partial specializations. - * parse.y: Likewise. - * cp-tree.h (DECL_TEMPLATE_SPECIALIZATIONS): Replaces - DECL_TEMPLATE_MEMBERS. - * call.c (print_z_candidates): Reduce duplication. - -Fri Aug 9 14:36:08 1996 Jason Merrill - - * decl2.c (lang_decode_option): Allow -fansi-overloading. - -Thu Aug 8 17:04:18 1996 Jason Merrill - - * pt.c (get_bindings): New fn. - (most_specialized): Likewise. - (do_function_instantiation): Use them. - (add_maybe_template): New fn. - * cp-tree.h (DECL_MAYBE_TEMPLATE): New macro. - * call.c (build_new_op): Handle guiding decls. - (build_new_function_call): Likewise. - * decl2.c (finish_file): Likewise. - - * decl2.c (mark_used): Do synthesis here. - * call.c (build_method_call): Not here. - (build_over_call): Or here. - * typeck.c (build_function_call_real): Or here. - * tree.c (bot_manip): Call mark_used on functions used in default - args. - -Thu Aug 8 17:48:16 1996 Michael Meissner - - * decl2.c (import_export_vtable): Delete code that disabled vtable - heuristic on systems with ASM_OUTPUT_EXTERNAL. - -Wed Aug 7 12:44:11 1996 Jason Merrill - - * typeck.c (build_x_function_call): Handle static call context - better. - - * decl.c (finish_function): Set the DECL_CONTEXT of the result to - the function, not its outer block. - - * call.c (build_field_call): Pass fields on to build_opfncall - regardless of TYPE_OVERLOADS_CALL_EXPR. - (build_method_call): Pass on to build_new_method_call sooner. - - * typeck.c (build_ptrmemfunc): Just return what instantiate_type - gives us. - * class.c (instantiate_type): Don't put a POINTER_TYPE to - METHOD_TYPE on an expression. Also make a copy of rhs instead of - modifying it. - -Tue Aug 6 12:58:46 1996 Jason Merrill - - * call.c (compare_ics): Handle qual_conv after lvalue_conv. - (add_builtin_candidate): Don't take enums for ++. - (build_new_method_call): Handle non-aggregates and field calls. - Move new overloading code from... - * cvt.c: Here. - - * decl.c (grokparms): Don't check default args in templates. - -Mon Aug 5 17:17:06 1996 Jason Merrill - - * cvt.c (build_new_op): Fix args to build_unary_op. - (add_builtin_candidates): Don't call type_promotes_to on float. - - * decl.c (grokparms): Check the type of the default arg. - - * cvt.c (build_new_op): Pass non-overloaded cases on rather than - returning NULL_TREE. - - * typeck.c (build_x_binary_op): Avoid doing extra work. - (build_x_unary_op): Likewise. - (build_x_conditional_expr): Likewise. - * cvt.c (build_over_call): Return. - (add_builtin_candidate): Fix MEMBER_REF. - (build_new_op): Likewise. - -Mon Aug 5 17:07:47 1996 Mike Stump - - * method.c (build_overload_name): Put bug fix into code but leave - disabled for now so we can be bug compatible with older releases - that do repeats incorrectly. In the future, we can enable it. - -Mon Aug 5 13:46:28 1996 Jason Merrill - - * cvt.c (convert_like): Don't call build_cplus_new twice. - - * call.c, cp-tree.h, cvt.c, decl2.c, init.c, method.c, pt.c, typeck.c: - Control new overloading code with -fansi-overloading. - -Sun Aug 4 15:29:11 1996 Jason Merrill - - * cvt.c (build_over_call): Call build_cplus_new. - * call.c (build_method_call): Likewise. - * typeck.c (build_function_call_real): Likewise. - (build_conditional_expr): If both operands are TARGET_EXPRs, wrap - the COND_EXPR in a TARGET_EXPR so they use the same slot. - - * cvt.c (build_up_reference): Propagate INDIRECT_BIND to - recursive calls. - * typeck.c (complete_type): Propagate - TYPE_NEEDS_{CONSTRUCTING,DESTRUCTOR}. - -Sat Aug 3 14:05:07 1996 Jason Merrill - - * cvt.c (joust): More ?: kludging. Sigh. - (build_over_call): Don't try to synthesize global fns. - - * search.c (lookup_conversions): Use binfo marking. - -Sat Aug 3 12:33:42 1996 Bob Manson - - * search.c (build_mi_matrix): Use the correct value of cid - when determining the new mi_size. - -Sat Aug 3 01:27:41 1996 Jason Merrill - - * cvt.c (add_builtin_candidates): Do consider type conversion ops - for the first parms of += et al. - (strip_top_quals): New fn. - (reference_binding): Use it instead of TYPE_MAIN_VARIANT. - (implicit_conversion): Likewise. - (add_builtin_candidates): Be careful about arrays. - (build_new_method_call): Handle vtable optimization. - -Fri Aug 2 01:26:59 1996 Jason Merrill - - * cp-tree.h (LOOKUP_NO_TEMP_BIND): New flag. - * cvt.c (reference_binding): Use it. - (implicit_conversion): Use it. - (add_builtin_candidate, COND_EXPR): Use it. - - * cvt.c (build_new_function_call): Check for error args. - - * typeck.c (comptypes): Just check DERIVED_FROM_P, not UNIQUELY. - - * gxx.gperf: Add __null. - * hash.h: Regenerate. - * lex.h: Add RID_NULL. - * lex.c (init_lex): Create null_pointer_node here, stick it in - RID_NULL. - * decl.c (init_decl_processing): Still set its type here. - * cvt.c (cp_convert_to_pointer): Don't produce null_pointer_node. - (convert_to_pointer_force): Likewise. - (null_ptr_cst_p): Check for null_pointer_node; only accept (void*)0 - if (! pedantic). - * call.c (convert_harshness): Use null_ptr_cst_p. - * typeck.c (convert_for_assignment): Likewise. Don't produce - null_pointer_node. - - * error.c (args_as_string): Handle lists of actual args, too. - * cvt.c (null_ptr_cst): Support (void*)0 for now. - (build_user_type_conversion_1): Improve diagnostics. - (build_new_function_call): Likewise. - (build_object_call): Likewise. - (build_new_method_call): Likewise. Move call before def diagnostic... - (build_over_call): Here. - - * cvt.c (build_new_method_call): Don't complain about no match if - LOOKUP_SPECULATIVELY. - (build_over_call): Fix 'this' for virtual fn. - (build_new_method_call): Add diagnostic. - -Thu Aug 1 16:45:09 1996 Jason Merrill - - * cvt.c (add_function_candidate): Expect 'this' and 'in_chrg' for - constructors to be passed in. - (build_over_call): Likewise. - (build_user_type_conversion_1): Pass them in. - (convert_like): Likewise. - (build_object_call): Handle overloaded conversions. - (build_over_call): Pass the right args to build_vfn_ref. - (standard_conversion): Fix pmf convs. - (joust): Handle comparing statics and non-statics. - (build_new_method_call): New fn. - * call.c (build_method_call): Call it if NEW_OVER. - -Thu Aug 1 16:06:14 1996 Mike Stump - - * lex.c (do_identifier): Don't use %O on IDENTIFIER_OPNAME_Ps, use - %D instead. - -Thu Aug 1 15:24:02 1996 Mike Stump - - * except.c (expand_throw): Use maybe_build_cleanup_and_delete - instead of just maybe_build_cleanup so that we deallocate the - thrown object. - -Thu Aug 1 15:18:00 1996 Brendan Kehoe - - * decl2.c (finish_prevtable_vardecl): Make non-static for pt.c's use. - * cp-tree.h (finish_prevtable_vardecl): Add decl. - -Thu Aug 1 11:53:51 1996 Bob Manson - - * pt.c (instantiate_class_template): Call complete_type. Also, if - we're at the end of the file and we just instantiated a template - class with a vtable, call finish_prevtable_vardecl. - - * error.c (dump_decl): Don't explode (or explode more gracefully - as appropriate) if the object being dumped has a null type. - (dump_expr): Likewise. - - * search.c (build_mi_matrix): Ensure that mi_size is large enough, - by counting the number of nodes that we'll need before allocating - the array. - (lookup_fnfields): Fix comment. - (breadth_first_search): Fix comment. - -Wed Jul 31 09:57:05 1996 Jason Merrill - - * pt.c (instantiate_class_template): Propagate TYPE_PACKED and - TYPE_ALIGN. - * class.c (finish_struct): Call cplus_decl_attributes here. - (finish_struct_1): Not here. - * cp-tree.h: Adjust. - - * pt.c (type_unification): New parameter STRICT. - (unify): If STRICT, don't allow cv addition or base deduction. - * call.c, class.c, cvt.c, cp-tree.h: Adjust. - -Tue Jul 30 13:06:13 1996 Jason Merrill - - * search.c (get_template_base{_recursive}): New fns. - * pt.c (more_specialized): New fn. - (do_function_instantiation): Use it. - (unify): Handle base deduction. - * cvt.c (joust): Use more_specialized. - Don't arbitrarily choose between non-builtin candidates. - (build_over_call): Call require_complete_type. - - * decl.c (start_function): Statics are static even in a #pragma - interface file. - - * decl2.c (import_export_vtable): Disable vtable heuristic on - systems with ASM_OUTPUT_EXTERNAL. - - * cvt.c (compare_ics): Fix comparison of PMEM_CONV and BASE_CONV. - (standard_conversion): No std conv to enum type. - - * cvt.c (standard_conversion): Fix order of args to DERIVED_FROM_P - for ptm's. - - * cvt.c (reference_binding): Bind directly to a base subobject of - a class rvalue. - - * cvt.c (build_new_op): Enforce access control. - -Tue Jul 30 09:22:53 1996 Bob Manson - - * typeck2.c (process_init_constructor): When scanning the - union for a named field, skip things that aren't FIELD_DECLs. - - * method.c (synthesize_method): Don't scan fndecl's rtl if - we're at the end of the file; just assume the function can't - be inlined. - -Mon Jul 29 15:48:30 1996 Jason Merrill - - * cvt.c (build_builtin_candidate): Stick a dummy conversion in if - it failed. - - * cvt.c (build_user_type_conversion_1): Handle overloaded - conversion ops. - - * cvt.c (add_builtin_candidates): Don't consider type conversion - operators for the first parameter of operator=. - -Mon Jul 29 15:33:55 1996 Bob Manson - - * typeck.c (complete_type): Only call layout_type if we're not - expanding a template. - -Mon Jul 29 14:40:38 1996 Jason Merrill - - * cvt.c (compare_ics): Oops. - - * cvt.c (op_error): Oops. - - * cp-tree.def: Add RVALUE_CONV, rename EXACT_CONV to IDENTITY_CONV. - * cvt.c: Add IDENTITY_RANK before others. Use real_lvalue_p. - (build_conv): Use them. - (implicit_conversion): Use them. - (convert_like): Handle them. - (build_new_op): Handle builtin COND_EXPR again. - (add_builtin_candidates): Strip cv-quals. Fix oops. Include enums - in lists of types for COND_EXPR. - (add_builtin_candidate): Add enum candidates for COND_EXPR. - -Mon Jul 29 12:05:40 1996 Bob Manson - - * typeck.c (build_modify_expr): Always attempt to build a call to - the assignment operator, even if we're using a default one. - (convert_for_initialization): Call complete_type. - -Mon Jul 29 11:25:08 1996 Jason Merrill - - * cvt.c (reference_binding): A REF_BIND gets the reference type. - (implicit_conversion): Likewise. - (convert_like): Likewise. - (compare_ics): Likewise. - (compare_qual): Likewise. - (print_z_candidates): Handle no candidates. - (build_new_op): Don't handle builtin COND_EXPR for now. - -Sat Jul 27 11:27:47 1996 Stan Shebs - - * cvt.c (build_builtin_candidate): Init local var in an ANSI way. - -Fri Jul 26 01:07:22 1996 Jason Merrill - - * cvt.c (joust): If the candidates are the same, arbitrarily pick one. - - * cvt.c (build_builtin_candidate): Oops. - (build_new_op): Oops. - - * method.c (build_opfncall): Pass COND_EXPR on. - * cvt.c (build_builtin_candidate): Reorganize, support COND_EXPR. - (add_builtin_candidate{,s}): Likewise. - (add_builtin_candidates): Likewise. - (print_z_candidates, op_error, build_new_op): Likewise. - (type_decays_to): New fn. - * lex.c (init_lex): Just say ?: for COND_EXPR. - -Thu Jul 25 09:33:33 1996 Jason Merrill - - * typeck.c (complete_type): Call layout_type rather than building - a new array type. - - * cvt.c (add_builtin_candidate): Pointer arithmetic candidates - only use ptrdiff_t. - -Wed Jul 24 12:45:08 1996 Jason Merrill - - * cvt.c: Always compile the new overloading code (but don't use it). - (implicit_conversion): Add a BASE_CONV when converting to - the same class type. - (convert_like): Handle BASE_CONV. - -Tue Jul 23 12:46:30 1996 Jason Merrill - - * cvt.c (build_new_op): Support {MAX,MIN}_EXPR. - (add_builtin_candidate): Likewise. - - NEW_OVER changes: - * typeck.c (build_x_function_call): Try an operator function - whenever we call an object of class type. - * method.c (build_opfncall): Pass CALL_EXPRs through. - * cvt.c (implicit_conversion): Do const-ref case first. - (add_conv_candidate, build_object_call, op_error): New fns. - (ptr_complete_ob, TYPE_PTROB_P): void is not an object type. - ({add,build}_builtin_candidate{,s}, print_z_candidates): Display - builtin candidates. - (build_new_op): Handle CALL_EXPR. Don't try to decay void. - Fall back on preincrement handling. Use op_error. - Handle warn_synth. - (convert_like): Pass INDIRECT_BIND. Don't try to do anything with - an error_mark_node. - (build_over_call): Handle PROMOTE_PROTOTYPES and ellipsis promotions - properly. - -Mon Jul 22 16:21:55 1996 Bob Manson - - * pt.c (tsubst_expr): Handle CONTINUE_STMT. - -Mon Jul 22 15:38:58 1996 Mike Stump - - * typeck.c (build_component_ref_1): Use build_component_ref - instead of open coding it here. - -Mon Jul 22 12:18:54 1996 Jason Merrill - - * g++.c (main): Don't link with -lg++. - - NEW_OVER changes: - * cvt.c (convert_to_reference): Don't use convert_from_reference on - result of build_type_conversion. - (cp_convert): Only call build_method_call for ctors if - build_type_conversion failed. - (ptr_complete_ob): New function. - (TYPE_PTR{,OB,MEM}_P): New macros. - ({add,build}_builtin_candidate{,s}): New functions. - (print_z_candidates): Handle builtins. - (build_user_type_conversion_1): Don't use conversion fns for - converting to a base type. - (build_user_type_conversion_1): Set ICS_USER_FLAG on AMBIG_CONVs. - (build_user_type_conversion): Use convert_from_reference. - (build_new_op): New function. - (build_over_call): Fix handling of methods. - (compare_ics): Handle AMBIG_CONV properly. - * typeck2.c: Increment abort count. - * method.c (build_opfncall): Forward most requests to build_new_op. - * cp-tree.h (IS_OVERLOAD_TYPE): Tweak. - -Fri Jul 19 17:59:29 1996 Brendan Kehoe - - * error.c (dump_expr, case CONSTRUCTOR, case CAST_EXPR): Take out - invalid second argument to dump_expr_list. - -Fri Jul 19 14:04:05 1996 Mike Stump - - * decl.c (lookup_name_real): Make sure we do obj->X::i correctly. - -Thu Jul 18 14:48:23 1996 Bob Manson - - * decl2.c (import_export_vtable): ASM_OUTPUT_EXTERNAL, not - ASSEMBLE_EXTERNAL. - -Mon Jul 15 17:48:43 1996 Mike Stump - - * typeck2.c (process_init_constructor): New pedwarn for using { } - to initialize a pointer to member function. - * typeck.c (build_ptrmemfunc1): Avoid use of digest_init so that - we can avoid the new error. - -Mon Jul 15 15:42:03 1996 Mike Stump - - * typeck.c (build_ptrmemfunc1): New function to hide details of - pointer to member functions better. - -Mon Jul 15 14:23:02 1996 Mike Stump - - * init.c (resolve_offset_ref): Resolve OFFSET_REFs that are - methods into the actual method, as we know the implied object is - not used. - -Mon Jul 15 13:08:29 1996 Brendan Kehoe - - * parse.y (maybecomma_warn): Only emit the pedwarn if we're not - inside a system header. - -Fri Jul 12 16:30:05 1996 Bob Manson - - * call.c (build_method_call): Call complete_type on the - instance type. - -Thu Jul 11 17:16:40 1996 Mike Stump - - * typeck.c (build_component_ref): Always build up an OFFSET_REF - for obj_ptr->func so that we can know which object to use in a - method call. - -Wed Jul 10 19:36:37 1996 Mike Stump - - * typeck.c (build_ptrmemfunc): Remove sorry, now we can cast - around things. Also improve maintainability. - -Wed Jul 10 18:20:11 1996 Bob Manson - - * decl.c (grokdeclarator): Check for overflow when evaluating an - array dimension. - -Wed Jul 10 17:26:19 1996 Jason Merrill - - * cvt.c (cp_convert): Don't check for ambiguity with constructor - if NEW_OVER. - - * typeck.c (build_x_function_call): Pass function overload - questions to new overloading code if NEW_OVER. - * init.c (expand_aggr_init_1): Only check for type conversion ops - if we're doing copy-initialization (i.e. LOOKUP_ONLYCONVERTING). - Don't check for ambiguity with constructor if NEW_OVER. - * cvt.c (convert_to_reference): Dereference the result of a type - conversion operator. - (build_conv): Propagate ICS_USER_FLAG. - (implicit_conversion): Call instantiate_type. - Pass LOOKUP_ONLYCONVERTING instead of LOOKUP_NORMAL. - (add_function_candidate): Fix cv-quals on argtype. - (print_z_candidates): New function. - (build_new_function_call): Call it. - (build_user_type_conversion_1): If LOOKUP_ONLYCONVERTING, don't - consider non-converting constructors. - Call print_z_candidates. - Return an AMBIG_CONV for an ambiguous conversion. - (build_user_type_conversion): Handle AMBIG_CONV. - (convert_like): Fix test for building TARGET_EXPR. - Call instantiate_type. - Handle AMBIG_CONV and LVALUE_CONV. - (build_over_call): Handle 0 args and ellipsis. - * cp-tree.def: Add AMBIG_CONV. - -Tue Jul 9 17:48:48 1996 Mike Stump - - * decl.c (lookup_name_real): If we find mem in obj when parsing - `obj->mem', make sure we return the right value. - -Tue Jul 9 16:11:28 1996 Bob Manson - - * search.c (get_base_distance): Call complete_type. - -Tue Jul 9 12:46:34 1996 Mike Stump - - * decl.c (store_bindings): Make static. - -Mon Jul 8 16:42:31 1996 Jason Merrill - - * init.c (expand_aggr_init_1): Don't check type conversions if - NEW_OVER. - - * cvt.c (z_candidate): Put back template field. - (add_function_candidate): Set it. - (add_template_candidate): Likewise. - (joust): Use it. - (compare_qual): Handle references and pointers to members. - (compare_ics): Handle reference bindings. - - * decl.c (duplicate_decls): Propagate DECL_ONE_ONLY. - -Mon Jul 8 16:18:56 1996 Bob Manson - - * call.c (compute_conversion_costs): Call complete_type. - - * tree.c (vec_binfo_member): Use comptypes instead of comparing - pointers, so we can handle template parameters. - -Fri Jul 5 16:51:53 1996 Bob Manson - - * cvt.c (cp_convert_to_pointer): We have to call complete_type - here; let's make it explicit instead of a side effect of an - error check. - -Wed Jul 3 16:29:51 1996 Jason Merrill - - * cvt.c (z_candidate): Remove template field. - (reference_binding): Handle binding to temporary. - (implicit_conversion): Likewise. - (add_function_candidate): Handle artificial constructor parms. - Handle functions with too few parms. - (add_template_candidate): New function. - (build_user_type_conversion_1): Handle constructors. - (convert_like): Likewise. - (build_over_call): Likewise. - (build_new_function_call): Support templates. - (compare_ics): Fix reference, inheritance handling. - -Mon Jul 1 22:58:18 1996 Bob Manson - - * decl.c: Add signed_size_zero_node. - (init_decl_processing): Build it. - * class.c (prepare_fresh_vtable): Use it instead of size_zero_node - when we're trying to make a negative delta. - -Mon Jul 1 17:56:19 1996 Brendan Kehoe - - Stop doing this damn index==strchr variable name confusion. - * class.c (add_virtual_function): Change local var INDEX to be - named IDX. - (add_method): Likewise. - * lex.c (print_parse_statistics): Likewise. - * search.c (make_memoized_table_entry): Likewise. - (lookup_fnfields_here): Likewise. - (lookup_field): Likewise. - (lookup_fnfields): Likewise. - (get_baselinks): Likewise. - * sig.c (build_signature_table_constructor): Likewise. - (build_signature_method_call): Likewise. - * typeck.c (build_x_array_ref): Change INDEX parm to be named IDX. - (get_member_function_from_ptrfunc): Likewise. - (build_ptrmemfunc): Change local var INDEX to be IDX. - (c_expand_start_case): Likewise. - -Sat Jun 29 14:05:46 1996 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Move user-defined type conversion - handling to before extraction of TYPE_PTRMEMFUNC_FN_TYPE. - (convert_to_reference): Use build_type_conversion to convert to - the reference type directly. - (standard_conversion): Fix void* case, non-conversions. - (reference_binding): Fix expr == 0 case, non-conversions. - (convert_like): Support REF_BIND. - (compare_qual): Split out from compare_ics. - (compare_ics): Use it, handle icses with only a qual_conv. - - * init.c (expand_vec_init): Don't crash if decl is NULL. - -Fri Jun 28 11:52:51 1996 Stan Shebs - - * mpw-config.in: New file, configury for Mac MPW. - * mpw-make.sed: New file, makefile editing for MPW. - -Thu Jun 27 15:18:30 1996 Jason Merrill - - * pt.c (instantiate_class_template): Call repo_template_used. - - * search.c (lookup_conversions): Only lookup conversions in - complete types. - -Thu Jun 27 12:59:53 1996 Brendan Kehoe - - * cp-tree.def: Renamed from tree.def, to avoid confusion with - gcc's tree.def. - * cp-tree.h, lex.c: Include cp-tree.def. - * Makefile.in (CXX_TREE_H): Reference cp-tree.def. - -Wed Jun 26 18:29:47 1996 Bob Manson - - * init.c (build_vec_delete_1): Call complete_type. - -Mon Jun 24 17:17:32 1996 Mike Stump - - * except.c (start_anon_func): Make sure anonymous functions are - never external. - -Fri Jun 21 15:10:58 1996 Jason Merrill - - * decl.c (finish_function): If function_depth > 1, set nested. - - * decl2.c (grokbitfield): Revert Bob's change. - * class.c (finish_struct_1): Fix handling of named bitfield widths. - -Thu Jun 20 23:35:38 1996 Jason Merrill - - * pt.c (add_pending_template): Handle types. - (lookup_template_class): With -fexternal-templates, just add the class - to pending_templates instead of instantiating it now. - * decl2.c (finish_file): Handle types in pending_templates. - -Thu Jun 20 14:08:40 1996 Bob Manson - - * decl2.c (grokbitfield): Handle constant decls appropriately. - Give an appropriate error message now instead of spewing core - later. - -Thu Jun 20 13:01:51 1996 Jason Merrill - - * decl2.c: Don't turn on thunks by default for now. - -Wed Jun 19 11:37:04 1996 Jason Merrill - - * typeck.c (complete_type): Handle error_mark_node. - (common_type, OFFSET_TYPE): Handle template_type_parms. - -Tue Jun 18 10:02:15 1996 Jason Merrill - - * pt.c (instantiate_decl): If at_eof, call import_export_decl - regardless of DECL_INLINE. - - * typeck.c (mark_addressable): Set TREE_ADDRESSABLE on CONSTRUCTORs. - - * class.c (finish_struct_bits): Copy TYPE_SIZE. - - * rtti.c (build_dynamic_cast): Support templates. - * tree.def: Support DYNAMIC_CAST_EXPR. - * pt.c (tsubst_copy): Likewise. - * decl2.c (build_expr_from_tree): Likewise. - -Mon Jun 17 15:23:36 1996 Jason Merrill - - * typeck.c (build_static_cast): Support templates. - (build_const_cast): Likewise. - * tree.def: Support CONST/STATIC_CAST_EXPR. - * pt.c (tsubst_copy): Likewise. - * decl2.c (build_expr_from_tree): Likewise. - -Sun Jun 16 12:33:57 1996 Jason Merrill - - * decl2.c (finish_vtable_vardecl): Don't trust - TREE_SYMBOL_REFERENCED for vtables of local classes. - -Fri Jun 14 18:13:36 1996 Jason Merrill - - * pt.c (tsubst_copy): Handle operator T. - -Wed Jun 12 17:52:40 1996 Brendan Kehoe - - * init.c (build_delete): Move creation of PARMS inside test of - TYPE_HAS_DESTRUCTOR, since it's never used outside of that block. - -Tue Jun 11 15:09:18 1996 Bob Manson - - * typeck.c (build_conditional_expr): Don't assume that - the arguments to ?: are always pointers or records. - -Tue Jun 11 13:56:23 1996 Jason Merrill - - * decl2.c (import_export_decl): Still emit static/weak/comdat - copies of inline template functions with -fno-implicit-templates. - -Tue Jun 11 11:42:13 1996 Bob Manson - - * init.c (build_delete): Determine the complete basetype - path to the destructor we're calling. - -Fri Jun 7 15:30:10 1996 Bob Manson - - * decl.c (build_enumerator): Always copy the INTEGER_CST used to - initialize the enum, because we really and truly don't know where - it came from. - (start_enum): Don't copy integer_zero_node because - build_enumerator will do it. - -Fri Jun 7 11:11:09 1996 Jason Merrill - - * decl.c (finish_function): Do access control on base destructors. - - * pt.c (tsubst, case FUNCTION_DECL): Set up - IDENTIFIER_GLOBAL_VALUE for member functions so pushdecl doesn't - hose us. - -Fri Jun 7 10:37:33 1996 Mike Stump - - * cvt.c (build_up_reference): If we have already extended the - lifetime of the temporary, don't try it again. - * typeck.c (c_expand_return): Don't try and convert the return - value twice when we want a reference, once is enough. - -Tue Jun 4 15:41:45 1996 Jason Merrill - - * pt.c (tsubst_expr, case DECL_STMT): Don't pass - LOOKUP_ONLYCONVERTING at all for now. - - * search.c (add_conversions): Put the conversion function in - TREE_VALUE, the basetype in TREE_PURPOSE. - * cvt.c (build_type_conversion): Adjust. - * cvt.c (build_expr_type_conversion): Adjust. - * call.c (user_harshness): Adjust. - -Mon Jun 3 15:30:52 1996 Jason Merrill - - * method.c (emit_thunk): Pretend this is a FUNCTION_DECL for the - backend's benefit. - -Mon Jun 10 18:58:19 1996 Mike Stump - - * except.c (expand_start_catch_block): Add a dummy region, if we - get an error, so that we can avoid core dumping later. - -Fri May 31 14:56:13 1996 Mike Stump - - * cp-tree.h (OFFSET_REF): Remove. - * tree.def (CP_OFFSET_REF): Rename to OFFSET_REF. - * expr.c (cplus_expand_expr): Cleanup callers of expand_expr. - * init.c (expand_aggr_init_1): Likewise. - (build_new): Likewise. - * typeck.c (expand_target_expr): Likewise. - -Fri May 31 14:22:08 1996 Jason Merrill - - * typeck.c (build_modify_expr): Don't use TREE_VALUE on a - TARGET_EXPR. - -Wed May 29 17:04:33 1996 Mike Stump - - * cvt.c (build_up_reference): Redo how and when temporaries are - created. - * decl.c (grok_reference_init): Don't try and be smart about - running cleanups. - -Wed May 29 16:02:08 1996 Mike Stump - - * cvt.c (build_up_reference): Add NULL_TREE to all calls to build - (TARGET_EXPR...), now that it has 4 arguments. - * tree.c (build_cplus_new): Likewise. - -Thu May 23 16:40:30 1996 Jason Merrill - - * error.c (dump_expr, case CAST_EXPR): Handle T() properly. - - * pt.c (instantiate_decl): Don't call push/pop_cp_function_context. - * decl.c (struct saved_scope): Remove named_labels, - {base,member}_init_list. - (maybe_push_to_top_level): Don't set them. Call - push_cp_function_context if appropriate. - (pop_from_top_level): Likewise. - - * method.c (do_build_assign_ref): Remove obsolete check of - TYPE_HAS_ASSIGN_REF (basetype). - - * decl.c (grokfndecl): Diagnose user definition of - implicitly-declared methods. - -Thu May 23 12:13:08 1996 Bob Manson - - * method.c (do_build_copy_constructor): Add code to give - meaningful error messages instead of crashing. - (do_build_assign_ref): Don't synthesize assignment operators for - classes containing reference or const members. - - * class.c (struct base_info): Remove cant_synth_copy_ctor - and cant_synth_asn_ref. - (finish_base_struct): Remove the code that tries to conditionalize - synthesis of copy constructors & assignment operators based on - access permissions. Instead, let it fail when it tries to - synthesize the copy constructor. This will give meaningful error - messages instead of silently generating code to perform a bitcopy. - -Wed May 22 11:45:19 1996 Bob Manson - - * lex.c (real_yylex): Remove old-n-crufty #if 0 code for - determining types for constant values. - - * decl.c (struct named_label_list): Use instead of stuffing - random items into a TREE_LIST node. - (named_label_uses): Use the new struct. - (poplevel): Likewise. - (lookup_label): Likewise. - (define_label): Add an error message to tell the user the line - where the goto is located in addition to the destination of the - goto. - (init_decl_processing): Use NULL instead of NULL_TREE to initialize - named_label_uses. - (finish_function): Likewise. - - (start_decl): Complain about defining a static data member - in a different type from which it was declared. - -Wed May 22 09:33:23 1996 Jason Merrill - - * cvt.c (build_expr_type_conversion): Adjust. - -Tue May 21 11:21:56 1996 Jason Merrill - - * call.c (build_method_call): Always convert 'this' to the - appropriate type. - - * search.c (add_conversions): Put the conversion function in - TREE_VALUE, the type in TREE_PURPOSE. - * cvt.c (build_type_conversion): Adjust. - * call.c (user_harshness): Adjust. - - * method.c (emit_thunk): Call temporary_allocation and - permanent_allocation around the ASM_OUTPUT_MI_THUNK case, too. - - * tree.c (build_cplus_array_type): Handle tweaking of - TYPE_MAIN_VARIANT here. - * typeck.c (common_type): Not here. - - * typeck.c (complete_type): Only try to complete an array type if - it has a domain. - -Mon May 20 14:55:59 1996 Jason Merrill - - * decl.c (grokvardecl): Call complete_type. - (grokdeclarator): Call complete_type for PARM_DECLs. - -Fri May 17 16:41:17 1996 Jason Merrill - - * pt.c (instantiate_class_template): Re-set - CLASSTYPE_GOT_SEMICOLON after calling finish_struct_1. - -Fri May 17 14:56:55 1996 Mike Stump - - * cp-tree.h (cp_expand_decl_cleanup): Remove, the backend is now - smart enough to do it right. - * tree.c (cp_expand_decl_cleanup): Likewise. - * decl.c (cp_finish_decl): Use expand_decl_cleanup instead of - cp_expand_decl_cleanup. - (store_parm_decls): Likewise. - (hack_incomplete_structures): Likewise. - * except.c (push_eh_cleanup): Likewise. - -Fri May 17 13:13:51 1996 Mike Stump - - * expr.c (expand_expr, cond UNSAVE_EXPR): Move from the C++ - frontend to the backend where it belongs. - * tree.c (unsave_expr): Likewise. - (unsave_expr_now): Likewise. - * tree.def (UNSAVE_EXPR): Likewise. - * cp-tree.h (unsave_expr): Likewise. - (unsave_expr_now): Likewise. - -Fri May 17 11:02:41 1996 Mike Stump - - * init.c (emit_base_init): Make sure the partial EH cleanups live - on the function_obstack. - -Thu May 16 15:29:33 1996 Bob Manson - - * expr.c (do_case): Don't try to dereference null TREE_TYPEs - when checking for pointer types. - -Thu May 16 13:38:58 1996 Jason Merrill - - * pt.c (instantiate_class_template): Remove obsolete check for - access declarations. - -Thu May 16 13:34:15 1996 Mike Stump - - * call.c (build_overload_call): Simplify calls to - build_overload_call by removing last parameter. - (build_method_call): Likewise. - * cp-tree.h: Likewise. - * method.c (build_opfncall): Likewise. - * typeck.c (build_x_function_call): Likewise. - -Thu May 16 13:15:43 1996 Mike Stump - - * call.c (default_parm_conversions): Factor out common code. - (build_method_call): Use it. - (build_overload_call_real): Use it. - -Wed May 15 14:46:14 1996 Mike Stump - - * call.c (build_method_call): Allow implicit & on METHOD_TYPEs, - but pedwarn as the code is bogus. - * typeck.c (decay_conversion): Likewise. - (build_function_call_real): Use build_addr_func instead of - default_conversion. Don't allow pointer-to-method functions down - here. - (build_unary_op): Use real pointer-to-member functions instead of - fake ones. - (build_ptrmemfunc): Use build_addr_func instead of build_unary_op. - (convert_for_assignment): Removed some obsolete code. - * decl2.c (reparse_absdcl_as_expr): Pass current_class_ref to - build_x_function_call instead of current_class_ptr. Only call - digest_init once on an initializer, we do this just checking - TREE_TYPE. - (build_expr_from_tree): Pass current_class_ref to - build_x_function_call instead of current_class_ptr. - * init.c (build_member_call): Likewise. - * pase.y: Likewise. - * error.c (dump_expr): Handle OFFSET_REFs better. - * pt.c (unify): Handle pointer-to-member functions better. - * decl.c (finish_function): Clear out current_class_ref just like - we do for current_class_ptr. - - * typeck.c (get_delta_difference): Handle virtual bases better. - -Tue May 14 16:37:37 1996 Jason Merrill - - * sig.c (build_signature_table_constructor): Use the delta for - the original basetype for this virtual function with thunks. - (build_signature_method_call): We still need to adjust 'this' - with thunks. - -Tue May 14 16:27:25 1996 Mike Stump - - * call.c (build_addr_func): New routine. Used to get the `real' - address of a function or a method. Needed to avoid getting a - pointer-to-member function. - (build_call): New routine to build CALL_EXPRs. - (build_method_call): Use it. - * cvt.c (convert_to_aggr): Likewise. - * typeck.c (build_function_call_real): Likewise. - * sig.c (build_signature_table_constructor): Use build_addr_func. - * cp-tree.h (build_call, build_addr_func): Declare them. - -Tue May 14 12:47:47 1996 Mike Stump - - * cp-tree.h (LOOKUP_AGGR): Remove, unused. - * parse.y: Remove uses of LOOKUP_AGGR. - -Tue May 14 12:07:51 1996 Mike Stump - - * *.[chy]: Rename current_class_decl to current_class_ptr, and - C_C_D to current_class_ref. - -Mon May 13 16:55:23 1996 Jason Merrill - - * call.c (convert_harshness): Tighten up pointer conversions. - -Sat May 11 04:33:50 1996 Doug Evans - - * decl2.c (finish_vtable_vardecl): Surround DECL_ONE_ONLY with ifdef. - (finish_file): Likewise. - -Fri May 10 11:09:57 1996 Jason Merrill - - * cvt.c (convert_fn_ptr): We don't use thunks for pmfs. - - * method.c (emit_thunk): Set flag_omit_frame_pointer in default - code. - -Thu May 9 18:18:30 1996 Jason Merrill - - * decl2.c: Turn on thunks by default where supported. - -Tue May 7 20:39:57 1996 Mike Stump - - * cp-tree.h (build_overload_call_maybe): Removed. - * call.c (build_overload_call_real): Invert meaning of last arg to - be require_complete. - (build_overload_call): Likewise. - * typeck.c (build_x_function_call): Use build_overload_call_real - instead of build_overload_call_maybe. - -Mon May 6 01:23:32 1996 Jason Merrill - - * decl2.c (finish_file): Don't try to emit functions that haven't - been compiled. - -Fri May 3 09:30:13 1996 Jason Merrill - - * decl2.c (finish_vtable_vardecl): Oops. - - * decl.c (maybe_push_to_top_level): Do save previous_class_*. - Also store the bindings from previous_class_values. - (pop_from_top_level): Restore them. - -Thu May 2 21:56:49 1996 Jason Merrill - - * decl2.c (finish_vtable_vardecl): Only write out vtable if its - symbol has been referenced. - (finish_file): Re-join synthesis/vtable loop with inline emission - loop, disable inlining when an inline is output. - -Thu May 2 17:20:02 1996 Mike Stump - - * except.c (init_exception_processing): Setup saved_in_catch. - (push_eh_cleanup): Reset __eh_in_catch. - (expand_start_catch_block): Set __eh_in_catch. - -Thu May 2 16:21:17 1996 Mike Stump - - * except.c (push_eh_cleanup): Add tracking for whether or not we - have an active exception object. - (expand_builtin_throw): Use it to make sure a rethrow without an - exception object is caught. - -Thu May 2 11:26:41 1996 Jason Merrill - - * decl.c (maybe_push_to_top_level): Clear out class-level bindings - cache. - -Wed May 1 11:26:52 1996 Jason Merrill - - * decl2.c (finish_file): Also use sentries for vars with - DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be - created). - - * lex.c (handle_cp_pragma): Disable #pragma - interface/implementation if SUPPORTS_ONE_ONLY > 1. - -Tue Apr 30 11:25:46 1996 Jason Merrill - - * method.c (emit_thunk): Wrap default case in - temporary/permanent_allocation. - - * method.c (make_thunk): Use DECL_ONE_ONLY. - (emit_thunk): Call assemble_end_function. - -Mon Apr 29 15:38:29 1996 Jason Merrill - - * decl2.c (import_export_vtable): Use DECL_ONE_ONLY. - (import_export_decl): Likewise. - (finish_prevtable_vardecl): Disable vtable hack if - SUPPORTS_ONE_ONLY > 1. - -Mon Apr 29 14:32:47 1996 Mike Stump - - * typeck.c (build_modify_expr): PREINCREMENT_EXPR and - PREDECREMENT_EXPRs take two arguments, not one. - -Mon Apr 29 00:27:53 1996 Jason Merrill - - * class.c (build_vtable_entry): Don't build thunks for abstract - virtuals. - - * lex.c (real_yylex): Fix handling of __PRETTY_FUNCTION__ like C - frontend. - -Sat Apr 27 16:45:35 1996 Jason Merrill - - * class.c (set_rtti_entry): Use size_zero_node. - (build_vtable): Likewise. - -Sat Apr 27 14:48:57 1996 Jason Merrill - - * class.c (finish_struct_1): Pass size_zero_node to set_rtti_entry. - (prepare_fresh_vtable): Likewise. - -Fri Apr 26 13:14:14 1996 Jason Merrill - - * method.c (emit_thunk): Call mark_used on the target function. - - * call.c (build_method_call): Don't warn about pending templates. - -Thu Apr 25 14:55:44 1996 Jason Merrill - - * decl2.c (finish_file): Fix list walking logic. - - * typeck2.c (check_for_new_type): Only warn if -pedantic. - -Wed Apr 24 15:41:15 1996 Bob Manson - - * class.c (finish_struct_1): Remove old code for - dont_allow_type_definitions. - * cp-tree.h: Likewise. - * spew.c: Make sure cp-tree.h is included before parse.h, so the - definition of flagged_type_tree is found before it is used. - * lex.c: Likewise. - * parse.y: Added the ftype member to the type union, and changed a - number of rules to use it instead of ttype. Added calls to - check_for_new_type() as appropriate. - * typeck2.c (check_for_new_type): New function for checking - if a newly defined type appears in the specified tree. - * cp-tree.h: Add new type flagged_type_tree. Add a prototype - for check_for_new_type(). - -Wed Apr 24 00:36:21 1996 Jason Merrill - - * decl2.c (finish_file): Only use a sentry if the decl is public. - - * pt.c (tsubst_expr, DECL_STMT): If we don't have an initializer, - don't pass LOOKUP_ONLYCONVERTING. - -Tue Apr 23 17:18:47 1996 Bob Manson - - * typeck.c (common_type): Fix the ARRAY_TYPE case so it - properly keeps track of const and volatile type modifiers. - -Tue Apr 23 10:52:56 1996 Jason Merrill - - * tree.c (cp_tree_equal): C++ version of simple_cst_equal. - * pt.c (comp_template_args): Use it. - - * rtti.c (get_tinfo_fn, build_dynamic_cast, expand_*_desc): Call - assemble_external for artificial function decls. - - * decl.c (cp_finish_decl): Oops. - -Mon Apr 22 17:28:27 1996 Jason Merrill - - * decl2.c (import_export_decl): Put static data member templates - into common storage, or make them weak, depending on whether they - are dynamically or statically initialized. - (get_sentry): New function. - (finish_file): Do import_export_decl for static data members before - building the init/fini functions. Don't init/fini a variable that's - EXTERNAL. Use a sentry for variables in common. Fix mismatching - push/pop_temp_slots. - * decl.c (cp_finish_decl): If DECL_NOT_REALLY_EXTERN, do the - expand_static_init thang. - * method.c (get_id_2): New function. - -Mon Apr 22 15:32:45 1996 Bob Manson - - * parse.y (empty_parms): Make sure we use C++-style prototypes - when we're declaring member functions. - -Sun Apr 21 10:08:22 1996 Jason Merrill - - * Makefile.in (CONFLICTS): 16 s/r conflicts. - * parse.y (self_template_type): New nonterminal. - -Thu Apr 18 08:56:54 1996 Jason Merrill - - * decl.c (make_typename_type): Handle getting a TYPE_DECL for a - name. - * parse.y (base_class.1): Allow 'typename foo::bar'. - - * lex.c (check_newline): Remove #pragma code that plays with the - input stream, since we now deal with tokens. Clear nextchar when - we're done. - (handle_cp_pragma): Use real_yylex. - (handle_sysv_pragma): Don't do skipline here. Only call real_yylex - in one place. - - * lex.c (check_for_missing_semicolon): Handle SELFNAME. - - * lex.c (handle_cp_pragma): Fix "#pragma implementation". - -Wed Apr 17 16:51:33 1996 Jason Merrill - - * parse.y: New token SELFNAME for potential constructor. - * spew.c (yylex): Handle it. - * lex.c (identifier_type): Produce it. - - * parse.y (complete_type_name): In :: case, don't push class binding. - (complex_type_name): Likewise. - -Wed Apr 17 15:02:40 1996 Mike Stump - - * typeck.c (build_reinterpret_cast): Handle pointer to member - functions. - -Wed Apr 17 12:28:26 1996 Brendan Kehoe - - * lex.c (handle_cp_pragma): New function, with decl, doing the cc1plus - pragmas. - (check_newline): Put the vtable/unit/implementation/interface pragma - code into handle_cp_pragma, replacing it with a call. - (handle_sysv_pragma): Give int return type, and take FINPUT and TOKEN - args. Get the next token after handling the pragma token. - -Wed Apr 17 10:28:34 1996 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Avoid doing base analysis on pmfs. - (convert_to_pointer_force): Likewise. - - * init.c (build_new): Fix array new without -fcheck-new. - -Tue Apr 16 13:44:58 1996 Jason Merrill - - * cp-tree.h, call.c, class.c, decl.c, parse.y, pt.c, rtti.c, - tree.c: Lose TYPE_NESTED_NAME. - - * parse.y (nested_name_specifier_1): Don't treat non-identifiers - as identifiers. - - * tree.def: Add VEC_INIT_EXPR. - * expr.c (cplus_expand_expr): Handle it. - * init.c (build_new): Use it instead of the RTL_EXPR nastiness and - the extra file-scope symbol nastiness. - -Mon Apr 15 16:21:29 1996 Jason Merrill - - * method.c (make_thunk): Thunks are static. - (emit_thunk): Use ASM_OUTPUT_MI_THUNK if it's defined. - - * decl2.c (mark_vtable_entries): Emit thunks as needed. - (finish_file): Don't emit them here. - -Sun Apr 14 11:34:39 1996 Jason Merrill - - * rtti.c (build_dynamic_cast): Handle null pointers. - (ifnonnull): New function. - -Fri Apr 12 09:08:27 1996 Bob Manson - - * call.c (build_method_call): Remember the original basetype we - were called with. Give an error message instead of trying - (incorrectly) to call a non-static member function through a - non-inherited class. - - * search.c (expand_upcast_fixups): Mark the new fixup as - DECL_ARTIFICIAL. - -Thu Apr 11 03:57:09 1996 Jason Merrill - - * init.c (build_new): Use a TARGET_EXPR for alloc_expr. - - * class.c (set_rtti_entry): Fix for thunks. - - * decl2.c (import_export_decl): Still emit typeinfo fns for - cv-variants of builtin types. - - * rtti.c (expand_class_desc): Set up base_info_type_node here. - (init_rtti_processing): Instead of here. - -Wed Apr 10 14:17:13 1996 Jason Merrill - - * rtti.c (init_rtti_processing): Do init regardless of -frtti. - (build_typeid): Only complain about taking dynamic typeid without - -frtti. - - * decl2.c: flag_rtti defaults to 1. - - * rtti.c (get_tinfo_var): The general class case is now smaller. - (init_rtti_processing): Pack the latter three fields of base_info - into 32 bits. - -Wed Apr 10 13:50:14 1996 Mike Stump - - * init.c (expand_member_init): Don't dump if name is NULL_TREE. - -Wed Apr 10 12:56:02 1996 Mike Stump - - * search.c (make_memoized_table_entry): Undefer the pop, if necessary. - (push_memoized_context): Split out code to undefer pop_type_level to - (clear_memoized_cache): here. - (pop_memoized_context): We can only handle one layer of deferral of - pop_type_level so clear the cache, if there was a previous level. - -Tue Apr 9 23:06:09 1996 Jason Merrill - - * rtti.c (init_rtti_processing): Build up base_info_type_node. - (expand_class_desc): Use one pointer to an array of base_info - structs, passed using a CONSTRUCTOR. - -Tue Apr 9 14:20:57 1996 Mike Stump - - * class.c (build_vbase_path): Remove block extern for - flag_assume_nonnull_objects here. - (build_vfn_ref): Split out functionality into build_vtbl_ref. - (build_vtbl_ref): New routine. - (build_vtable): Set up rtti info here. - (add_virtual_function): Note in CLASSTYPE_RTTI the best - place where we can get the rtti pointers from to avoid having to - search around for a place. - (finish_base_struct): Likewise. - (finish_struct_1): Likewise. Never create totally new vtables - with totally new vtable pointers for rtti. Disable code to layout - vtable pointers better until we want to break binary - compatibility. - * rtti.c (build_headof_sub): New routine to convert down to a - sub-object that has an rtti pointer in the vtable. - (build_headof): Use it. Also, use build_vtbl_ref now to be more - maintainable. - (build_dynamic_cast): Make sure we have saved it, if we need to. - * search.c (dfs_init_vbase_pointers): Disable code that deals with - a more efficient vtable layout, enable later. - * call.c (flag_assume_nonnull_objects): Moved declaration to - * cp-tree.h: here. Declare build_vtbl_ref. - * pt.c (instantiate_class_template): Use NULL_TREE instead of 0 in - function calls that want a tree. - -Tue Apr 9 12:10:26 1996 Jason Merrill - - * rtti.c (build_dynamic_cast): Handle downcasting to X* given - other X subobjects in the most derived type. Ack. - - * rtti.c (build_dynamic_cast): No need to strip cv-quals here, - get_typeid will do it for us. - (get_typeid_1): Break out call-building for expand_*_desc to use. - (get_typeid): Call it. - (expand_*_desc): Likewise. - * decl.c (init_decl_processing): Don't set TYPE_BUILT_IN on char * - and void *. - (init_decl_processing): Lose builtin_type_tdescs lossage. - * decl2.c (finish_vtable_vardecl): Remove obsolete code. - -Mon Apr 8 17:23:23 1996 Bob Manson - - * pt.c (tsubst): When calling set_nested_typename, use - TYPE_NESTED_NAME (current_class_type) instead of - current_class_name. - - * decl.c (pushdecl): Likewise. - (pushdecl_class_level): Likewise. - (grokdeclarator): Use NULL_TREE instead of 0 in the call to - set_nested_typename. - -Sun Apr 7 10:44:31 1996 Jason Merrill - - * rtti.c (synthesize_tinfo_fn): Handle arrays. - - * cp-tree.h (DECL_REALLY_EXTERN): New macro. - -Sat Apr 6 13:56:27 1996 Jason Merrill - - * rtti.c (throw_bad_cast): Use entry point __throw_bad_cast. - (init_rtti_processing): Lose bad_cast_type. - (build_dynamic_cast): Use throw_bad_cast. - - * rtti.c (synthesize_tinfo_fn): Handle enums and pmfs. - - * decl2.c (finish_file): Don't synthesize artificial functions - that are external and not inline. - - * rtti.c (get_tinfo_fn): If at_eof, call import_export_decl. - - * decl2.c (finish_file): Handle having new inlines added to - saved_inlines by synthesis. - - * rtti.c (get_bad_cast_node): Don't require . - -Fri Apr 5 17:02:09 1996 Jason Merrill - - RTTI rewrite to initialize nodes as needed, not require that - users #include , complete functionality and reduce wasted - space. - * rtti.c (init_rtti_processing): New fn. - (build_typeid): The vtable entry is now a function. - (get_tinfo_var): New fn. - (get_tinfo_fn): Likewise. - (get_typeid): Use it. - (build_dynamic_cast): Declare and use entry point __dynamic_cast. - (build_*_desc): Rename to expand_*_desc and rewrite to use entry - points __rtti_*. - (add_uninstantiated_desc, get_def_to_follow, build_t_desc): Lose. - (synthesize_tinfo_fn): New fn. - * method.c (build_t_desc_overload): Lose. - (build_overload_with_type): More generic. - * decl.c (init_decl_processing): Call init_rtti_processing. - * class.c (set_rtti_entry): Use get_tinfo_fn. - * decl2.c (mark_vtable_entries): Mark the rtti function. - (finish_prevtable_vardecl): Don't build_t_desc. - (import_export_decl): Handle tinfo functions. - (finish_file): Likewise. - * typeck.c (inline_conversion): New fn. - (build_function_call_real): Use it. - * cp-tree.h: Add decls. - - * method.c (hack_identifier): Also convert component_refs from - references. - - * lex.c (cons_up_default_function): Use the type, not the name, in - declspecs. - - * decl2.c (import_export_vtable): Fix weak vtables. - -Fri Apr 5 13:30:17 1996 Bob Manson - - * search.c (get_base_distance_recursive): Fix access checks for - protected bases. - -Fri Apr 5 11:02:06 1996 Brendan Kehoe - - * call.c (unary_complex_lvalue): Delete unneeded decl, it's in - cp-tree.h. - (convert_harshness): Add prototypes wrapped by PROTO. - * decl2.c (grok_function_init): Likewise. - (do_toplevel_using_decl): Change to void return type. - * class.c (build_vtable_entry): Remove decl of make_thunk. - (merge_overrides): Fix order of arg definitions. - (finish_vtbls): Likewise. - (fixup_vtable_deltas): Likewise. - (modify_all_direct_vtables): Likewise. - (modify_all_indirect_vtables): Likewise. - * search.c (get_base_distance_recursive): Likewise. - (get_abstract_virtuals_1): Likewise. - (fixup_virtual_upcast_offsets): Likewise. - (lookup_fnfields_1): Add prototypes wrapped by PROTO. - * init.c (perform_member_init): Fix order of arg definitions. - (expand_aggr_init_1): Add prototypes wrapped by PROTO. - * cp-tree.h (make_thunk): Add decl. - (overload_template_name, push_template_decl): Add decls. - (do_toplevel_using_decl): Change to void return type. - (vec_binfo_member): Add decl. - -Thu Apr 4 13:33:10 1996 Brendan Kehoe - - * typeck.c (mark_addressable, convert_for_assignment, - convert_for_initialization, pointer_int_sum, pointer_diff, - unary_complex_lvalue): Add prototypes wrapped by PROTO. - (convert_sequence): #if 0 fn decl, since definition also is. - -Thu Apr 4 11:00:53 1996 Mike Stump - - * rtti.c (build_dynamic_cast): Make sure we strip qualifiers on - cast to pointer types for type searching. - -Wed Apr 3 17:10:57 1996 Brendan Kehoe - - * typeck.c (get_delta_difference): Use cp_error, not error, in the - case where BINFO == 0. - -Wed Apr 3 12:01:02 1996 Mike Stump - - * call.c (build_method_call): Fix wording of error messages so - constructors come out right. - -Tue Apr 2 16:06:59 1996 Bob Manson - - * decl.c (push_overloaded_decl): Don't warn about hidden - constructors when both the type and the function are declared - in a system header file. - -Mon Apr 1 09:03:13 1996 Bob Manson - - * class.c (finish_struct_1): Propagate the TYPE_PACKED - flag for the type to the type's fields. - -Sat Mar 30 12:14:33 1996 Brendan Kehoe - - * parse.y (complex_parmlist, ELLIPSES): Take out ARM-based warning. - -Fri Mar 29 15:51:36 1996 Bob Manson - - * class.c (base_info, finish_base_struct): Replace - needs_virtual_dtor with base_has_virtual. - - (finish_struct_1): Remove the old code that tried to make default - destructors virtual. Use base_has_virtual when checking if we need - to add a vtable entry for the rtti code. - -Fri Mar 29 14:02:36 1996 Jason Merrill - - * pt.c (push_template_decl): Complain about template decl with - inappropriate declaration. - -Fri Mar 29 12:15:35 1996 Bob Manson - - * typeck.c (build_x_unary_op): Remove bogus check for taking - the address of a member function. - -Fri Mar 29 11:56:02 1996 Jason Merrill - - * parse.y (constructor_declarator): Only push the class if - we are not already in the class. - -Fri Mar 29 09:41:02 1996 Jeffrey A. Law - - * method.c (emit_thunk): Remove current_call_is_indirect nonsense. - Add additional argument to INIT_CUMULATIVE_ARGS. - -Thu Mar 28 16:41:39 1996 Jason Merrill - - * decl.c (shadow_tag): Fix error about anon union with methods. - - * parse.y (self_reference): Only generate a self-reference if this - is a non-template class. - (opt.component_decl_list): Only use it if it was generated. - - * parse.y (component_decl_1): Use constructor_declarator. - (fn.def2): Likewise. - (notype_component_declarator0): Likewise. - -Thu Mar 28 15:11:35 1996 Bob Manson - - * typeck.c (build_x_unary_op): Add checks for taking the address - of a TARGET_EXPR or of a member function, and give appropriate - warnings. - -Thu Mar 28 14:49:26 1996 Jason Merrill - - * pt.c (process_template_parm): Allow template type parms to be - used as types for template const parms. - -Wed Mar 27 15:51:19 1996 Mike Stump - - * init.c (expand_vec_init): Ensure the eh cleanups are on the - function_obstack. - -Wed Mar 27 10:14:30 1996 Jason Merrill - - * decl.c (lookup_name_real): Be even more picky about the - ambiguous lookup warning. - (grokdeclarator): Tweak SCOPE_REF constructor declarators here. - * parse.y (constructor_declarator): Rather than here. - - * parse.y (constructor_declarator): New nonterminal. - (fn.def1): Use it. - (explicit_instantiation): Likewise. - -Tue Mar 26 13:41:33 1996 Jason Merrill - - Add implicit declaration of class name at class scope. - * decl.c (lookup_name_real): Restrict pedwarn about ambiguous lookup. - * parse.y (self_reference): New nonterminal. - (opt.component_decl_list): Use it. - (fn.def1): Add nested_name_specifier type_name cases. - * class.c (build_self_reference): New function. - (finish_struct): Handle access_default later, move self-reference - decl to the end. - * pt.c (lookup_template_class): Handle getting a TYPE_DECL. - * cp-tree.h: Adjust. - - * pt.c (do_function_instantiation): Separate handling of member - functions and non-member functions properly. - -Mon Mar 25 14:23:22 1996 Jason Merrill - - * pt.c (process_template_parm): Improve error for 'volatile class K'. - - * class.c (finish_struct_1): Check the right slot for destructors. - - * decl.c (start_enum): Complain about enum templates. - -Mon Mar 25 13:25:31 1996 Mike Stump - - * init.c (resolve_offset_ref): Offset pointers to member data by one. - * typeck.c (unary_complex_lvalue): Likewise. - -Mon Mar 25 13:30:42 1996 Bob Manson - - * typeck.c (c_expand_return): Check for a returned local - array name, similar to the check for an ADDR_EXPR. - -Mon Mar 25 13:07:19 1996 Jason Merrill - - * decl.c (cp_finish_decl): Don't build cleanups for static - variables here. - -Fri Mar 22 17:57:55 1996 Mike Stump - - * typeck.c (build_modify_expr): Fix error messages to be more - accurate. - * cp-tree.h (assop_as_string): Parallel to op_as_string, but for - assignment operators. - * error.c (assop_as_string): Likewise. Add support for `%Q' for - assignment operators. - -Fri Mar 22 13:48:29 1996 Jason Merrill - - * decl.c (grokdeclarator): Call bad_specifiers for typedefs. Also - give an error if initialized. pedwarn about nested type with the - same name as its enclosing class. - - * pt.c (tsubst, case TYPE_DECL): Set DECL_CONTEXT. - - * typeck.c (require_complete_type): Be sure to instantiate the - MAIN_VARIANT of the type. - - * decl2.c (finish_file): Instantiate pending templates before - processing static constructors and destructors. - - * pt.c (instantiate_decl): Don't instantiate functions at toplevel - unless at_eof. - -Fri Mar 22 09:30:17 1996 Bob Manson - - * decl2.c (delete_sanity): If error_mark_node is passed - in as an expression, quit while we're ahead. - - * decl.c (grokdeclarator): Give an error message if `friend' - is combined with any storage class specifiers. - -Wed Mar 20 14:51:55 1996 Jason Merrill - - * parse.y (named_complex_class_head_sans_basetype): Don't crash on - definition of nonexistent nested type. - - * error.c (dump_decl, case TYPE_DECL): Fix decision for whether or - not to say 'typedef'. - -Wed Mar 20 00:11:47 1996 Brendan Kehoe - - * cp-tree.h (struct lang_type): Make search_slot a tree, not a char*. - * search.c (dfs_walk, dfs_init_vbase_pointers, - expand_upcast_fixups): Remove cast of CLASSTYPE_SEARCH_SLOT. - (dfs_find_vbases): Remove cast for CLASSTYPE_SEARCH_SLOT init. - -Tue Mar 19 17:56:03 1996 Jason Merrill - - * except.c (build_throw): Support minimal parse. - * pt.c (tsubst_copy): Support THROW_EXPR. - * decl2.c (build_expr_from_tree): Likewise. - - * pt.c (mangle_class_name_for_template): Always allocate - scratch_firstobj. - -Tue Mar 19 16:34:31 1996 Bob Manson - - * cvt.c (cp_convert_to_pointer): Give an appropriate error - when trying to cast from an incomplete type. - -Tue Mar 19 16:00:33 1996 Jason Merrill - - * pt.c (instantiate_class_template): Don't bother setting up - CLASSTYPE_TAGS explicitly, as the nested types will add - themselves. - -Tue Mar 19 15:48:43 1996 Bob Manson - - * decl.c (shadow_tag): Remove old error check for usage of - an enum without a previous declaration. - (xref_tag): Add error message about usage of enums without a - previous declaration. - -Tue Mar 19 09:21:35 1996 Jason Merrill - - * lex.c (do_identifier): Only do name consistency check if we're - parsing. - - * pt.c (push_template_decl): Don't crash if we get a member defn - that doesn't match. - - * decl.c (xref_tag_from_type): New function to do an xref without - always having to figure out code_type_node. - * cp-tree.h: Declare it. - * pt.c (instantiate_class_template): Use it for friend classes. - (lookup_template_class): Use it. - - * typeck2.c (build_functional_cast): Pull out a single parm before - passing it to build_c_cast. - -Tue Mar 19 09:07:15 1996 Bob Manson - - * expr.c (do_case): Give an error message if a pointer is - given as a case value. - -Mon Mar 18 21:57:54 1996 Jason Merrill - - * typeck.c (build_c_cast): Don't pull single TEMPLATE_DECL out of - an overload list. - - * lex.c (cons_up_default_function): Really, now, interface hackery - does not apply to synthesized methods. - -Mon Mar 18 18:20:57 1996 Mike Stump - - * call.c (build_method_call): Ctors and dtors now have special names - with respect to lookups. - * class.c (add_method): Likewise. - (grow_method): Likewise. - (finish_struct_methods): Likewise. - (warn_hidden): Likewise. - (finish_struct_1): Likewise. - * cvt.c (convert_to_reference): Likewise. - (convert_to_aggr): Likewise. - (cp_convert): Likewise. - * decl2.c (check_classfn): Likewise. - * init.c (expand_member_init): Likewise. - (expand_default_init): Likewise. - (expand_aggr_init_1): Likewise. - (build_offset_ref): Likewise. - (build_new): Likewise. - (build_delete): Likewise. - * lex.c (do_inline_function_hair): Likewise. - * search.c (lookup_field_1): Likewise. - (lookup_fnfields_here): Likewise. - (lookup_field): Likewise. - (lookup_fnfields): Likewise. - (get_virtual_destructor): Likewise. - (dfs_debug_mark): Likewise. - (dfs_pushdecls): Likewise. - (dfs_compress_decls): Likewise. - * tree.c (layout_basetypes): Likewise. - * typeck.c (build_component_ref): Likewise. - (build_x_function_call): Likewise. - (build_modify_expr): Likewise. - (convert_for_initialization): Likewise. - (build_functional_cast): Likewise. - * cp-tree.h (CLASSTYPE_FIRST_CONVERSION): Likewise. - (CTOR_NAME): New. - (DTOR_NAME): New. - * decl.c (ctor_identifier): New. - (dtor_identifier): New. - (init_decl_processing): Set them. - -Mon Mar 18 18:00:51 1996 Mike Stump - - * typeck.c (build_component_ref): Don't get confused by fields whose - context has no type name, like pointer to member functions. - -Mon Mar 18 13:19:03 1996 Jason Merrill - - * decl.c (grokdeclarator): Handle typedef without declarator. - - * pt.c (tsubst): Handle SCOPE_REF in declarator. - - * parse.y (bad_parm): Catch another case of missing `typename'. - - * lex.c (yyprint): Handle TYPE_DECLs. - - * decl.c (start_function): Don't try to be clever. - - * lex.c: Lose compiler_error_with_decl. - * typeck2.c: Lose error_with_aggr_type. - (incomplete_type_error): Use cp_* instead of old functions. - (readonly_error): Likewise. - * typeck.c (convert_arguments): Likewise. - * search.c (lookup_nested_field): Likewise. - * method.c (make_thunk): Likewise. - * decl.c (grokparms): Likewise. - * cp-tree.h: Update. - - * tree.c (min_tree_cons): Call copy_to_permanent for the purpose - and value. - -Mon Mar 18 11:25:52 1996 Bob Manson - - * method.c (build_opfncall): When deleting a pointer to an - array, build a new pointer to the tree past any ARRAY_TYPE - nodes. - -Mon Mar 18 10:11:46 1996 Brendan Kehoe - - * decl.c (lookup_name_real): Initialize local var TYPE to NULL_TREE. - -Fri Mar 15 11:03:57 1996 Jason Merrill - - * pt.c (instantiate_decl): Only call import_export_decl if at_eof - and ! DECL_INLINE. - - * decl.c (finish_function): Don't set nested based on - hack_decl_function_context. - * parse.y (function_try_block): Check for nested function. - (pending_inlines): Likewise. - - * decl2.c (build_expr_from_tree): If a unary op already has a - type, just return it. - - * decl2.c (finish_prevtable_vardecl): Use ADJUST_VTABLE_LINKAGE. - - * decl2.c (walk_vtables): vardecl_fn returns int; return 1 if it does. - (finish_file): Check the return value of walk_vtables. - (finish_prevtable_vardecl): Return int. - (finish_vtable_vardecl): Likewise. - (prune_vtable_vardecl): Likewise. - * lex.c (set_vardecl_interface_info): Likewise. - * cp-tree.h: Adjust return types. - - * class.c (delete_duplicate_fields_1): Don't complain about - duplicate nested types if they're the same type. - (finish_struct): Remove check for duplicate. - * decl2.c (grokfield): Don't check for typedef of anonymous type. - -Thu Mar 14 10:00:19 1996 Jason Merrill - - * cp-tree.h: Lose SIGNATURE_GROKKING_TYPEDEF. - - * decl.c (grokdeclarator): Lose special handling of class-level - typedef. Lose SIGNATURE_GROKKING_TYPEDEF. Set - SIGNATURE_HAS_OPAQUE_TYPEDECLS later. - - * cvt.c (convert_pointer_to_real): Retain cv-quals in conversion. - - * pt.c (tsubst_copy): Strip cv-quals from destructor name types. - - * search.c (compute_access): Fix handling of anonymous union - members. - * class.c (finish_struct_anon): Propagate TREE_{PRIVATE,PROTECTED} - from anonymous unions to their members. - - * typeck.c (build_x_function_call): For static member functions, - hand off to build_member_call. - -Wed Mar 13 14:03:34 1996 Jason Merrill - - * typeck.c (build_component_ref): Handle OFFSET_REFs. - - * init.c (expand_vec_init): Fix init == 0 case. - -Tue Mar 12 14:36:02 1996 Jason Merrill - - * init.c (build_new): pedwarn about init and array new. - (expand_vec_init): Handle lists, use convert_for_initialization. - - * typeck.c (convert_for_initialization): Pass LOOKUP_NO_CONVERSION - when converting to an aggregate type. - * cvt.c (cp_convert): Pass it through. - - * typeck.c (build_conditional_expr): Handle user-defined - conversions to slightly different types. - - * decl.c (grokdeclarator): Force an array type in a parm to be - permanent. - - * decl2.c (do_using_directive): Sorry. - (do_namespace_alias): Likewise. - * lex.c (real_yylex): Warn about using the `namespace' keyword. - -Sun Mar 10 22:26:09 1996 Jason Merrill - - * parse.y (datadef): Move call to note_list_got_semicolon up. - -Fri Mar 8 11:47:26 1996 Mike Stump - - * tree.c (unsave_expr): Don't unsave, UNSAVE_EXPRs. - -Fri Mar 8 11:29:06 1996 Mike Stump - - * decl.c (cp_finish_decl): The exception regions have to be - nested, not overlapping. We start the exception region for a - decl, after it has been fully built, and all temporaries for it - have been cleaned up. - -Thu Mar 7 17:46:06 1996 Mike Stump - - * tree.c (vec_binfo_member): Don't core dump if we have no bases. - -Thu Mar 7 14:11:49 1996 Jason Merrill - - * tree.def: Add RETURN_INIT. - * pt.c (instantiate_decl): Handle RETURN_INIT. - * decl.c (store_return_init): Handle minimal_parse_mode. - - * tree.c (cp_build_type_variant): Just return an error_mark_node. - * decl.c (make_typename_type): Don't try to get the file and line - of an identifier. - * typeck.c (comptypes): Handle TYPENAME_TYPE. - -Wed Mar 6 18:47:50 1996 Per Bothner - - * decl.c (poplevel): Make sure we clear out and restore old local - non-VAR_DECL values by default when they go out of scope. - -Wed Mar 6 09:57:36 1996 Jason Merrill - - * method.c (build_overload_value): Use DECL_ASSEMBLER_NAME in - referring to addresses of variables and functions. - - * error.c (dump_expr): Support SIZEOF_EXPR. - - * init.c (do_friend): Use the return value of check_classfn. - - * typeck.c (convert_arguments): Call complete_type. - - * method.c (hack_identifier): After giving an error, set value to - error_mark_node. - -Tue Mar 5 16:00:15 1996 Jason Merrill - - * tree.c (hack_decl_function_context): Kludge around DECL_CONTEXT - lossage for local classes. - * cp-tree.h: Declare it. - * decl.c (lookup_name_real): Evil, painful hack for local classes. - (grokfndecl): Set DECL_CLASS_CONTEXT and DECL_NO_STATIC_CHAIN here. - Use hack_decl_function_context. - (grokdeclarator): Don't set DECL_NO_STATIC_CHAIN here. - (start_function): Use hack_decl_function_context. - (finish_function): Likewise. - * method.c (synthesize_method): Likewise. - * lex.c (process_next_inline): Likewise. - (do_pending_inlines): Likewise. - * decl2.c (finish_file): Unset DECL_STATIC_FUNCTION_P when we're - done with it. - -Mon Mar 4 22:38:39 1996 Gerald Baumgartner - - * sig.c (build_signature_pointer_or_reference_type): Align - signature pointers/references on 8-byte boundaries so they can be - grabbed 2 words at a time on a SPARC. - -Tue Mar 5 10:21:01 1996 Jason Merrill - - * method.c (hack_identifier): Requiring a static chain is now a - hard error. - * decl.c (grokdeclarator): Set DECL_NO_STATIC_CHAIN on nested - functions. - -Mon Mar 4 20:03:33 1996 Jason Merrill - - * init.c (build_offset_ref): Call complete_type. - - * decl.c (pop_from_top_level): Always pop previous_class_type. - - * parse.y: Handle multiple decls in a for-init-statement. - * pt.c (tsubst_expr): Likewise. - - * pt.c (tsubst): Use tsubst_expr for the second operand of an - ARRAY_REF. - - * decl.c (maybe_push_to_top_level): Don't save previous_class_type. - (poplevel_class): Set it here. - (pop_from_top_level): Pop it here if we're returning to class scope. - * class.c (pushclass): Don't set it here. - - * decl.c (maybe_push_to_top_level): Save current_template_parms, - and clear it if !pseudo. - (pop_from_top_level): Restore it. - - * decl2.c (finish_file): Push the dummy each time we walk the list - of vtables. - - * error.c (dump_expr): Support LOOKUP_EXPR and actually do - something for CAST_EXPR. - -Mon Feb 19 14:49:18 1996 Rusty Russell - - * cvt.c (cp_convert): Warn about implicit conversion of the - address of a function to bool, as it is always true. - -Fri Feb 23 23:06:01 1996 Rusty Russell - - * typeck.c (c_expand_return): Fix warning for local externs returned. - -Mon Mar 4 15:03:11 1996 Jason Merrill - - * tree.c (mapcar): Propagate const and volatile properly. - - * typeck.c (complete_type): Be sure to instantiate the - MAIN_VARIANT of the type. - - * method.c (synthesize_method): Class interface hackery does not - apply to synthesized methods. - -Mon Mar 4 14:05:23 1996 Jason Merrill - - * pt.c (comp_template_args): Use comptypes rather than just - checking for TEMPLATE_TYPE_PARM equivalence. - - * typeck.c (build_x_function_call): Call complete_type before - checking TYPE_OVERLOADS_CALL_EXPR. - -Mon Mar 4 18:48:30 1996 Manfred Hollstein - - * g++.c (main): Check also for new define ALT_LIBM. - -Fri Mar 1 13:09:33 1996 Jason Merrill - - * pt.c (instantiate_class_template): If we don't have a pattern - yet, that's OK. - (coerce_template_parms): If we see a local class, bail. - - * decl.c (grok_reference_init): Make sure there's a type before - checking its code. - - * pt.c (do_function_instantiation): Avoid crashing on invalid decls. - (push_template_decl): Likewise. - - * parse.y (named_class_head): Set - CLASSTYPE_TEMPLATE_SPECIALIZATION here if we have basetypes. - - * decl.c (xref_tag): Diagnose redeclaration of template - type-parameter name. - - * error.c (dump_type): Handle anonymous template type parms. - - * pt.c (instantiate_template): Use TYPE_MAIN_DECL instead of - TYPE_STUB_DECL. - (coerce_template_parms): Likewise. - -Thu Feb 29 16:26:01 1996 Mike Stump - - * class.c (instantiate_type, case {ARRAY,INDIRECT}_REF, - case ADDR_EXPR): Don't modify rhs if a subinstantiation fails. - -Thu Feb 29 08:20:25 1996 Jason Merrill - - * pt.c (instantiate_template): Take the MAIN_VARIANT of the type - before trying to get its STUB_DECL. - (coerce_template_parms): Likewise. - - * parse.y (template_type_parm): If they didn't use 'class', - pretend they did after giving an error. - - * pt.c (coerce_template_parms): Diagnose use of local class. - - * decl.c (grok_reference_init): Use instantiate_type. - - * error.c (dump_expr): Handle TEMPLATE_DECLs. - - * parse.y (named_class_head): Diagnose mismatching types and tags. - - * decl.c (pushdecl): Type decls and class templates clash with - artificial type decls, not hide them. - - * decl.c (redeclaration_error_message): Diagnose redefinition of - templates properly. - (duplicate_decls): Diagnose disallowed overloads for template - functions, too. - - * decl.c (start_decl): Call complete_type before checking for a - destructor. - - * pt.c (tsubst): Use tsubst_expr on the elts of a VEC. - - * decl.c (xref_tag): A TEMPLATE_TYPE_PARM is a match. - -Wed Feb 28 09:28:44 1996 Jason Merrill - - * decl.c (grok_op_properties): Don't check for operator++(int) in - a template. - - * tree.c (perm_manip): Return a copy of variable and function - decls with external linkage. - - * tree.def: Change some of the min tree codes to type "1". - * pt.c (uses_template_parms): Handle 'e's, return 1 for LOOKUP_EXPRs. - * method.c (build_overload_int): Emit something arbitrary for - anything but an INTEGER_CST if we're in a template. - - * decl.c (cp_finish_decl): Call complete_type before deciding - whether or not to lay out the decl. - - * lex.c (do_identifier): Check for DECL_INITIAL before using it. - -Tue Feb 27 16:35:32 1996 Jason Merrill - - * typeck2.c (build_x_arrow): Call complete_type. - - * pt.c (add_pending_template): Broken out. - (lookup_template_class): If -fexternal-templates, call it for all - the methods of implemented types. - (instantiate_class_template): Instead of instantiating them here. - (instantiate_decl): Handle -fexternal-templates earlier. - -Tue Feb 27 15:51:32 1996 Brendan Kehoe - - * search.c, lex.c, decl.c, class.c, cp-tree.h: Don't wrap the - memoized lookup stuff inside GATHER_STATISTICS. - -Tue Feb 27 10:38:08 1996 Jason Merrill - - * decl.c (start_decl): Complain about array of incomplete type - here. - (grokdeclarator): Not here. - - * parse.y (template_parm): Expand full_parm inline so we can set - the rule's precedence. - - * pt.c (tsubst_expr): If we're in a template, just do tsubst_copy. - (tsubst): tsubst_expr the DECL_INITIAL of FIELD_DECLs. - * decl2.c (grokbitfield): Don't check for integer constant here. - * class.c (finish_struct_1): Check here. - - * decl.c (define_label): Make the min decl go on permanent_obstack. - - * pt.c (unify): Don't handle CONST_DECLs. - (uses_template_parms): Don't check DECL_INITIAL on a CONST_DECL. - (tsubst_copy): Likewise. - - * lex.c (do_identifier): Do pull the DECL_INITIAL out of a - CONST_DECL for a template parm. - -Mon Feb 26 12:48:18 1996 Jason Merrill - - * decl.c (grokdeclarator): Complain about array of incomplete type - here. - (start_decl_1): Not here. - - * pt.c (tsubst): Handle pointer-to-function declarators. - - * method.c (hack_identifier): If pedantic, diagnose local class - methods that require a static chain. - - * decl.c (grok_op_properties): No longer static. - * cp-tree.h: Declare it. - * pt.c (tsubst): Call it for operators. - Use tsubst_copy for TREE_VECs. - - * parse.y (template_arg): The expr has precedence like '>'. - -Fri Feb 23 14:51:52 1996 Jason Merrill - - * pt.c (coerce_template_parms): Don't coerce an expression using - template parms. - (uses_template_parms): Also check DECL_INITIAL in CONST_DECLs. - (tsubst): Don't use build_index_2_type if the max_value uses template - parms. - * method.c (build_overload_int): Emit something arbitrary for an - expression using template parms. - - * parse.y (template_close_bracket): New non-terminal to catch use - of '>>' instead of '> >' in template class names. - (template_type): Use it. - * Makefile.in (CONFLICTS): Causes one more r/r conflict. - - * tree.def: Add CAST_EXPR. - * typeck2.c (build_functional_cast): Use CAST_EXPR instead of - CONVERT_EXPR for minimal_parse_mode. - * typeck.c (build_c_cast): Likewise. - * pt.c (tsubst_copy): Likewise. - * decl2.c (build_expr_from_tree): Likewise. - * error.c (dump_expr): Likewise. - -Fri Feb 23 10:36:46 1996 Brendan Kehoe - - * except.c (SetTerminate, SetUnexpected): Put back global vars. - (init_exception_processing): Put back decl/init of - set_unexpected_fndecl and set_terminate_fndecl, needed to get the - fns from libstdc++. - - * decl.c (struct binding_level): Delete ACCEPT_ANY bitfield. - (declare_uninstantiated_type_level, uninstantiated_type_level_p): - Delete unused fns. - * cp-tree.h (declare_uninstantiated_type_level, - uninstantiated_type_level_p): Delete prototypes. - -Thu Feb 22 19:36:15 1996 Jason Merrill - - * pt.c (tsubst_expr): Add default return. - -Thu Feb 22 16:47:24 1996 Brendan Kehoe - - * error.c (fndecl_as_string): Delete unused arg CNAME. - * sig.c (build_signature_table_constructor, - build_signature_method_call): Fix calls. - - * class.c (the_null_vtable_entry): Delete var definition. - (init_class_processing): Delete tree the_null_vtable_entry init. - * decl.c (no_print_{functions, builtins}): Declare as static. - (__tp_desc_type_node): #if 0 var definition. - (init_type_desc): #if 0 init of __tp_desc_type_node. - (vb_off_identifier): Move var decl into init_decl_processing. - (current_function_assigns_this): Declare as static. - (int_ftype_ptr_ptr_int, void_ftype_ptr_int_int): Delete var decls. - (init_decl_processing): Delete init of void_ftype_ptr_ptr_int. - Move decls of string_ftype_ptr_ptr and int_ftype_string_string here. - * decl2.c (delete_sanity): Delete definition/mod of local var ELT_SIZE. - * init.c (BI_header_type, BI_header_size): Declare as static. - * pt.c (template_classes): Delete unused var. - (add_pending_template): Delete decl for non-existent fn. - (lookup_template_class): Delete vars CODE and TAG_CODE. - (instantiate_template): Delete unused var TARGS. - * cp-tree.h (vb_off_identifier, current_function_assigns_this): - Delete decls. - (__tp_desc_type_node): #if 0 var decl. - (fndecl_as_string): Fix prototype. - -Thu Feb 22 15:56:19 1996 Jason Merrill - - * tree.def: Add GOTO_STMT. - * pt.c (tsubst_expr): Support goto and labels. - * decl.c (define_label): Support minimal parsing. - * parse.y (simple_stmt): Likewise. - -Thu Feb 22 15:30:12 1996 Brendan Kehoe - - * xref.c (GNU_xref_member): Only define/set var I if - XREF_SHORT_MEMBER_NAMES is defined, to match when it's actually - used. - (GNU_xref_end_scope): Delete unused fifth arg TRNS. - (GNU_xref_end): Fix call. - * decl.c (poplevel, poplevel_class, finish_method): Fix calls. - * cp-tree.h (GNU_xref_end_scope): Fix prototype. - - * tree.c (build_exception_variant): Delete unused vars I, A, T, - T2, and CNAME. - (layout_vbasetypes): Delete unused var NONVIRTUAL_VAR_SIZE. - (mapcar): Delete unused var CODE. - (build_cplus_new): Delete unused arg WITH_CLEANUP_P. - (break_out_cleanups): Fix call. - (bot_manip): Likewise. - * call.c (build_method_call): Likewise. - * cvt.c (build_up_reference, convert_to_reference, cp_convert): - Likewise. - * typeck.c (unary_complex_lvalue, build_modify_expr, - convert_for_initialization): Likewise. - * typeck2.c (build_functional_cast): Likewise. - * cp-tree.h (build_cplus_new): Fix prototype. - - * repo.c (open_repo_file): Delete unused var Q. - (repo_compile_flags, repo_template_declared, - repo_template_defined, repo_class_defined, repo_inline_used, - repo_vtable_used, repo_tinfo_used): #if 0 unused fns. - (repo_get_id, repo_vtable_used): Declare as static. - * cp-tree.h (mark_{decl,class}_instantiated, finish_repo): Add - prototypes. - -Thu Feb 22 14:53:35 1996 Jason Merrill - - * parse.y (pending_inlines): Add function_try_block case. - - * pt.c (unify): Fix for template const parms. - -Thu Feb 22 13:24:15 1996 Brendan Kehoe - - * lex.c (extract_interface_info): Delete forward decl. - (default_copy_constructor_body, default_assign_ref_body): Delete - decls for non-existent functions. - (synth_firstobj, inline_text_firstobjs): Delete unused vars. - (init_lex): Delete setting them. - (cons_up_default_function): Delete unused vars FUNC_BUF, - FUNC_LEN, and COMPLEX. Delete code setting COMPLEX. Delete old - #if 0'd synth code. - (toplevel, expression_obstack): Delete unused extern decls. - (tree_node_kind): Delete unused enum. - (tree_node_counts, tree_node_sizes): Wrap with #ifdef - GATHER_STATISTICS. - (tree_node_kind_names): Delete unused extern decl. - (synth_obstack): Delete unused var. - (init_lex): Don't set it. - (init_parse): Add decl before use. - (reduce_count): Only define #ifdef GATHER_STATISTICS && REDUCE_LENGTH. - (current_unit_{name, language}): Delete unused vars. - (check_newline): Don't bother setting them, just accept the #pragma. - * cp-tree.h (init_repo, peek_yylex): Add prototypes. - (current_unit_{name, language}): Delete decls. - - * search.c: Wrap all of the memoized functions, macros, and - variables inside #ifdef GATHER_STATISTICS. - (lookup_field, lookup_fnfields): Likewise. - (init_search_processing): Likewise. - (reinit_search_statistics): Wrap whole function. - * lex.c (reinit_lang_specific): Wrap call to reinit_search_statistics. - - * decl.c (finish_function): Only call pop_memoized_context if - GATHER_STATISTICS is defined. - (start_function): Likewise for push_memoized_context. - * class.c (pushclass, popclass): Likewise. - - * cp-tree.h (CLASSTYPE_MTABLE_ENTRY): Move definition from here... - * search.c (CLASSTYPE_MTABLE_ENTRY): ... to here. - - * cvt.c (cp_convert): Delete unused local var FORM. - * cp-tree.h (can_convert, can_convert_arg, real_lvalue_p): Add - prototypes. - -Thu Feb 22 13:19:44 1996 Jason Merrill - - * pt.c (do_poplevel): Oops; really return what we get from - poplevel this time. - -Thu Feb 22 11:41:44 1996 Brendan Kehoe - - * cp-tree.h (is_aggr_type): Add prototype. - - * cp-tree.h ({push,pop}_cp_function_context): Add decls. - * method.c ({push,pop}_cp_function_context): Delete decls. - * except.c (start_eh_unwinder, end_eh_unwinder): Declare as void. - (SetUnexpected, SetTerminate): Delete unused vars. - (init_exception_processing): Don't set SetUnexpected or - SetTerminate. Don't set SET_UNEXPECTED_FNDECL or SET_TERMINATE_FNDECL. - (output_exception_table_entry): Delete unused array LABEL. - (expand_internal_throw): Delete unused var PARAMS. - (expand_start_catch_block): Delete unused var CLEANUP. - (emit_exception_table): Delete unused var EH_NODE_DECL. - (expand_builtin_throw): Delete unused vars UNWIND_AND_THROW and - GOTO_UNWIND_AND_THROW. Don't set them. - (end_eh_unwinder): Add top decl. - (pop_rtl_from_perm): Delete unused decl of PERMANENT_OBSTACK. - (exception_section, push_rtl_perm, do_function_call, - lang_interim_eh, push_eh_cleanup, eh_outer_context, - expand_end_eh_spec, end_eh_unwinder): Declare as static. - (saved_pc, saved_throw_type, saved_throw_value, saved_cleanup, - throw_used): Likewise. - * cp-tree.h (expand_end_eh_spec): Delete prototype. - - * search.c (dfs_mark, dfs_mark_vtable_path, - dfs_unmark_vtable_path, dfs_mark_new_vtable, - dfs_unmark_new_vtable, dfs_clear_search_slot, - dfs_search_slot_nonempty_p, bfs_markedp, bfs_unmarkedp, - bfs_marked_vtable_pathp, bfs_unmarked_vtable_pathp, - bfs_marked_new_vtablep, bfs_unmarked_new_vtablep): #if 0 unused - functions. - (n_fields_searched, n_calls_lookup_field, n_calls_lookup_field_1, - n_calls_lookup_fnfields, n_calls_lookup_fnfields_1, - n_calls_get_base_type, n_outer_fields_searched, n_contexts_saved): - Only define #ifdef GATHER_STATISTICS. - (reinit_search_statistics): Only init some vars if GATHER_STATISTICS - is defined. - (vbase_decl): Delete var definition. - (init_search): Delete old decl. - (init_vbase_pointers): Delete building of VBASE_DECL, since it's - never actually used. - (expand_indirect_vtbls_init): Delete init of VBASE_DECL. - (get_base_distance_recursive): Delete unused fourth arg - BASETYPE_PATH. Fix call . - (get_base_distance): Fix call. - (push_class_decls): Delete unused var ID. - (make_memoized_table_entry): Declare as static. - (breadth_first_search): Declare as static. - (tree_has_any_destructor_p): Declare as static. - (pop_class_decls): Delete unused arg pop_class_decls. - * class.c (popclass): Fix call to pop_class_decls. - * cp-tree.h (make_memoized_table_entry, breadth_first_search, - tree_has_any_destructor_p): Delete prototypes. - - * rtti.c (build_ptmf_desc): Delete unused arg TYPE. - (build_t_desc): Fix call. Delete unused vars ELEMS and TT. - (build_dynamic_cast): Delete unused local vars TMP1 and RETVAL. - (build_user_desc): Delete unused var T. - (build_class_desc): Delete unused vars T and OFF. - (build_t_desc): Delete unused var NAME_STRING. - (build_headof): Make static. - (get_bad_cast_node): Likewise. - (get_def_to_follow): Likewise. - * cp-tree.h (init_type_desc): Add prototype. - (build_headof): Remove prototype. - -Thu Feb 22 00:54:22 1996 Jason Merrill - - * pt.c (tsubst): Only look for matching decls at file scope for - non-member functions. - - * call.c (build_scoped_method_call): Handle scoped destructor - calls in templates. - - * decl.c (*_top_level): Also save previous_class_values. - - * pt.c (tsubst_expr): Support do {} while loops. - * parse.y (simple_stmt): Likewise. - * tree.def: Likewise. - - * method.c (build_overload_identifier): For a class nested in a - template class, don't mangle in the template parms from our - context. - - * lex.c, cp-tree.h: Remove support for template instantiations in - the pending_inlines code. - * pt.c: Remove dead functions and unused arguments. - (uses_template_parms): TYPENAME_TYPEs always use template parms. - * parse.y: Stop passing anything to end_template_decl. - * tree.c (print_lang_statistics): Only print tinst info #ifdef - GATHER_STATISTICS. - -Wed Feb 21 16:57:33 1996 Brendan Kehoe - - * init.c (expand_recursive_init{,_1}): Delete decls. - (sort_member_init): Delete unused var INIT. - (emit_base_init): Delete unused var X. - (build_offset_ref): Delete unused var CNAME. - (sort_member_init): Delete unused var FIELDS_TO_UNMARK. - (emit_base_init): Delete unused local var BASE. Delete extern - decl of IN_CHARGE_IDENTIFIER. - (build_delete): Delete unused local var VIRTUAL_SIZE. - - * init.c (build_vec_delete): Delete unused third arg ELT_SIZE. - (build_delete): Fix call. - * decl2.c (delete_sanity): Likewise. - * cp-tree.h (build_vec_delete): Update prototype. - - * typeck.c (common_base_type): Delete unused var TMP. - (build_binary_op): Delete local var ARGS_SAVE. - (build_array_ref): Delete unused var ITYPE. - (c_expand_return): Delete unused var USE_TEMP. - - * typeck.c (compexcepttypes): Delete unused arg STRICT. - (comptypes): Fix calls. - * decl.c (duplicate_decls): Likewise. - * cp-tree.h (compexcepttypes): Delete extra arg. - - * decl2.c (check_classfn): Delete unused second arg CNAME. - * decl.c (start_decl, grokfndecl): Fix calls. - * init.c (do_friend): Likewise. - * cp-tree.h (check_classfn): Update prototype. - - * cp-tree.h (signature_error, import_export_vtable, - append_signature_fields, id_in_current_class, mark_used, - copy_assignment_arg_p): Add decls. - * decl2.c (mark_used): Delete decl. - - * class.c (n_*): Wrap with #ifdef GATHER_STATISTICS. - - * class.c (get_vtable_entry): Disable unused function. - (doing_hard_virtuals): Delete unused static global var. - (finish_struct_1): Don't init DOING_HARD_VIRTUALS. - (prepare_fresh_vtable): Delete unused vars PATH and RESULT. - (overrides): Delete unused vars RETTYPE and BASE_RETTYPE. - (modify_one_vtable): Delete unused var OLD_RTTI. - (finish_struct_anon): Delete unused vars OFFSET and X. - (finish_struct_bits): Delete unused var METHOD_VEC. - (get_basefndecls): Delete unused var PURPOSE. Delete unused - for-scope local variable METHODS. - - * call.c (user_harshness): Delete unused/unneeded arg PARM. - (ideal_candidate): Delete unused args BASETYPE and PARMS. - (build_method_call): Delete unused args passed into ideal_candidate. - (build_overload_call_real): Likewise. Delete unused var OVERLOAD_NAME. - * cp-tree.h (synthesize_method): Add decl. - - * decl.c (note_level_for_for): Give void return type. - (pushdecl_nonclass_level): Likewise. - (finish_function): Delete unused vars VFIELDS and ALLOCATED_THIS. - (poplevel): Delete unused var IMPLICIT_TRY_BLOCK. - (suspend_binding_level): Delete unused var LEVEL. - (duplicate_decls): Delete unused var CTYPE. - (duplicate_decls): Delete unused var PREVIOUS_C_DECL. - (init_decl_processing): Delete unused vars FLOAT_ENDLINK and - PTR_ENDLINK. - (grokdeclarator): Delete unused var C. - (grokdeclarator): Delete unused var SIZE_VARIES. - (grokparms): Delete unused var SAW_VOID. - (start_function): Delete unused var OLDDECL. - (cplus_expand_expr_stmt): Delete unused var - REMOVE_IMPLICIT_IMMEDIATELY. - - * cp-tree.h (pushdecl_nonclass_level): Fix prototype. - - * Makefile.in (CONFLICTS): Update to 12 shift/reduce. - -Wed Feb 21 00:06:17 1996 Jason Merrill - - * tree.c (build_min): Set TREE_COMPLEXITY to lineno. - (build_min_nt): Likewise. - * pt.c (do_pushlevel): Emit line note. - (do_poplevel): Return what we get from poplevel. - (tsubst_expr): Set lineno from TREE_COMPLEXITY in stmt nodes. - * parse.y: Use do_pushlevel and do_poplevel. - * cp-tree.h: Declare do_poplevel. - - * cp-tree.h: Declare at_eof. - * decl.c (cp_finish_decl): Pass it to rest_of_decl_compilation. - * decl2.c (import_export_decl): Renamed from import_export_inline. - (finish_file): Call it to do interface handling for statics. - * pt.c (tsubst_copy): Call mark_used on variables and functions - used here. - - * decl2.c (finish_file): Don't emit statics we can't generate. - * pt.c (instantiate_decl): Don't set interface on instantiations - we can't generate. - - * cp-tree.h (struct tinst_level): Change 'classname' to 'decl'. - * tree.c (print_lang_statistics): Print max template depth. - * pt.c (push_tinst_level): Dump entire instantiation context. - (instantiate_class_template): Use it and pop_tinst_level. - (instantiate_decl): Likewise. - - * call.c class.c cp-tree.h decl.c decl2.c error.c lex.c method.c - pt.c ptree.c tree.def: Remove all traces of UNINSTANTIATED_P_TYPE. - -Tue Feb 20 18:21:51 1996 Jason Merrill - - * call.c class.c cp-tree.h cvt.c decl.c decl2.c error.c expr.c - init.c lex.c method.c parse.y pt.c repo.c search.c spew.c tree.c - tree.def typeck.c typeck2.c xref.c: Massive, systemic changes for - the new template implementation. - -Tue Feb 20 17:14:29 1996 Brendan Kehoe - - * decl2.c (check_cp_case_value): Use STRIP_TYPE_NOPS. - -Thu Feb 15 18:44:42 1996 Mike Stump - - * decl.c (cp_finish_decl): Delay emitting the debug information for - a typedef that has been installed as the canonical typedef, if the - type has not yet been defined. - -Thu Feb 15 09:39:08 1996 Jason Merrill - - * decl2.c (grokfield): Still call pop_nested_class for access decls. - -Wed Feb 14 17:30:04 1996 Brendan Kehoe - - * decl.c (lookup_label): Call label_rtx. - - * decl.c (make_binding_level): New function. - (pushlevel, pushlevel_class): Call it instead of explicit - duplicate calls to xmalloc. - - * decl.c (init_decl_processing): Delete useless build_pointer_type - call. - - * decl.c (float_ftype_float, ldouble_ftype_ldouble): Add definitions. - (sizet_ftype_string): Delete variable. - (init_decl_processing): Add built-in functions fabsf, fabsl, - sqrtf, sqrtl, sinf, sin, sinl, cosf, cos, cosl. New local - variable strlen_ftype, used for strlen. - -Wed Feb 14 16:21:25 1996 Jason Merrill - - * decl.c (push_to_top_level): Start from current_binding_level - again for now; the stl hacks depend on g++ being broken in this - way, and it'll be fixed in the template rewrite. - - * tree.def: Add USING_DECL. - * decl2.c (do_class_using_decl): Implement. - (grokfield): Pass access decls off to do_class_using_decl instead of - grokdeclarator. - * error.c (dump_decl): Handle USING_DECLs. - * decl.c (grokdeclarator): Remove code for handling access decls. - * class.c (finish_struct_1): Adjust accordingly, treat using-decls - as access decls for now. - (finish_struct): Don't check USING_DECLs for other uses of the name. - - * search.c (get_matching_virtual): Use cp_error_at. - -Wed Feb 14 10:36:58 1996 Brendan Kehoe - - * typeck.c (comptypes): Default COMP_TYPE_ATTRIBUTES to 1, to - match c-typeck.c. - (self_promoting_args_p): Move the check that TYPE is non-nil - before trying to look at its main variant. - (unsigned_type, signed_type): Add checking of DI/SI/HI/QI nodes. - - * cp-tree.h (DECL_WAITING_FRIENDS, SET_DECL_WAITING_FRIENDS): - Delete macros. - * init.c (xref_friend, embrace_waiting_friends): Delete functions. - (do_friend): Delete call to xref_friend. - * class.c (finish_struct_1): Delete call to embrace_waiting_friends. - - * typeck.c (convert_sequence): #if 0 unused function. - - * cp-tree.h (DECL_IN_MEMORY_P): New macro w/ the check that used to - be in decl_in_memory_p. - (decl_in_memory_p): Delete decl. - * expr.c (decl_in_memory_p): Delete fn. - * typeck.c (mark_addressable): Use DECL_IN_MEMORY_P. - - * decl.c (cp_finish_decl): Use DECL_IN_MEMORY_P. - -Tue Feb 13 12:51:21 1996 Jason Merrill - - * class.c (finish_struct_1): Check for a pure-specifier on a - non-virtual function here. - - * decl2.c (grok_function_init): Don't check whether the function - is virtual here. - (grokfield): Don't call check_for_override here. - - * decl.c (push_to_top_level): Start from inner_binding_level, - check class_shadowed in class levels. - -Mon Feb 12 17:46:59 1996 Mike Stump - - * decl.c (resume_level): Ignore things that don't have names, instead - of core dumping. - -Mon Feb 12 15:47:44 1996 Brendan Kehoe - - * decl2.c (grokfield): Set DECL_VINDEX properly for FUNCTION_DECLs. - -Sat Feb 10 17:59:45 1996 Jason Merrill - - * class.c (finish_struct_1): Set DECL_VINDEX properly on a - synthesized dtor. - - * parse.y (complete_type_name): Bind global_scope earlier. - (complex_type_name): Likewise. - (qualified_type_name): Remove. - -Thu Feb 8 15:15:14 1996 Jason Merrill - - * decl.c (grokfndecl): Move code that looks for virtuals in base - classes... - * class.c (check_for_override): ... to a new function. - (finish_struct_1): Call it. - - * cp-tree.h: Declare warn_sign_compare. - - * typeck.c (build_binary_op_nodefault): Check warn_sign_compare - rather than extra_warnings to decide whether to warn about - comparison of signed and unsigned. - - * decl2.c (lang_decode_option): Handle warn_sign_compare. -Wall - implies -Wsign-compare. -Wall doesn't imply -W. - -Wed Feb 7 15:27:57 1996 Mike Stump - - * typeck.c (build_component_ref): Fix to handle anon unions in base - classes as well. - -Wed Feb 7 14:29:12 1996 Brendan Kehoe - - * class.c (resolves_to_fixed_type_p): Delete code dealing with - a WITH_CLEANUP_EXPR, since we don't generate them any more. - * cvt.c (build_up_reference): Likewise. - * decl.c (grok_reference_init): Likewise. - (cp_finish_decl): Likewise. - * error.c (dump_expr): Likewise. - * tree.c (real_lvalue_p): Likewise. - (lvalue_p): Likewise. - (build_cplus_new): Likewise. - (unsave_expr_now): Likewise. - * typeck.c (unary_complex_lvalue, build_modify_expr, - c_expand_return): Likewise. - -Tue Feb 6 13:39:22 1996 Brendan Kehoe - - Make the C++ front-end pay attention to attributes for structures. - * class.c (finish_struct): New argument ATTRIBUTES, passed down into - finish_struct_1. - (finish_struct_1): New argument ATTRIBUTES; call cplus_decl_attributes. - Take out old round_up_size use and setting the DECL_ALIGN possibly - using it. Take out setting of TYPE_ALIGN to round_up_size, which - can override what the attribute set. - * cp-tree.h (finish_struct): Update prototype. - * parse.y (template_instantiate_once): Pass a NULL_TREE for the - attributes to finish_struct. - (structsp): For a CLASS decl, add maybe_attribute to rule and pass that - value down into finish_struct. - * Makefile.in (CONFLICTS): Switch to 7 shift/reduce conflicts. - -Tue Feb 6 13:12:15 1996 Per Bothner - - * decl.c (poplevel): Re-word dead for local handling. - (pushdecl): Remove useless DECL_DEAD_FOR_LOCAL test. - (cp_finish_decl): If is_for_scope, check for duplicates so - we can disable is_for_scope. Otherwise, preserve_temp_slots. - - * lex.c (do_identifier): Use global binding in preference of - dead for local variable. - -Mon Feb 5 17:46:46 1996 Mike Stump - - * init.c (initializing_context): Handle anon union changes, the - context where fields of anon unions can be initialized now has to be - found by walking up the TYPE_CONTEXT chain. - -Fri Feb 2 14:54:04 1996 Doug Evans - - * decl.c (start_decl): #ifdef out code to set DECL_COMMON - if ASM_OUTPUT{,_ALIGNED}_BSS is defined. - (obscure_complex_init): If bss is supported, always set - DECL_INITIAL to error_mark_node. - -Thu Feb 1 16:19:56 1996 Brendan Kehoe - - * init.c (is_friend): Make sure there's a context before we see if - it's an aggr type. - -Thu Feb 1 15:44:53 1996 Mike Stump - - * init.c (is_friend): Classes are not friendly with nested classes. - -Thu Feb 1 15:27:37 1996 Doug Evans - - * lex.c (check_newline): Pass last character read to HANDLE_PRAGMA, - and record its result. - -Thu Feb 1 09:27:01 1996 Mike Stump - - * class.c (finish_struct_anon): Switch around code to not move anon - union elements around, nor mess up their contexts, nor offsets, - instead we now build up the right number of COMPONENT_REFs for all - the anon unions that may be present at build_component_ref time. - * typeck.c (lookup_anon_field): New routine to handle field lookup - on fields without names. We find them, based upon their unique type - instead. - * typeck.c (build_component_ref): Allow FIELD_DECL components. - Handle finding components in anonymous unions, and ensure that a - COMPONENT_REF is built for each level as necessary. - -Tue Jan 30 18:18:23 1996 Mike Stump - - * cvt.c (build_up_reference): Make the INDIRECT_BIND case come after - code that ensures that copy ctors are used if appropriate. - -Tue Jan 30 17:35:14 1996 Brendan Kehoe - - * init.c (build_vec_delete): Only give an error if base isn't an - error_mark_node. - -Mon Jan 29 17:09:06 1996 Mike Stump - - * spew.c (do_aggr): `new struct S;' isn't a forward declaration. - (yylex): If we see `new', keep slurping. - -Thu Jan 25 18:31:36 1996 Mike Stump - - * class.c (finish_struct_1): Move code for handling anon unions... - (finish_struct_anon): to here. Fixup so that we do the offset - calculations right, and so that the fields are physically moved to - the containers's chain. - -Thu Jan 25 18:27:37 1996 Brendan Kehoe - - * decl.c (grokdeclarator): Avoid trying to get an operand off an - identifier node. - -Wed Jan 24 11:25:30 1996 Jim Wilson - - * typeck.c (pointer_int_sum): Use TYPE_PRECISION (sizetype) not - POINTER_SIZE to agree with expr.c. - -Thu Jan 25 13:01:23 1996 Mike Stump - - * search.c (lookup_field): Don't report ambiguities if protect is 0, - instead return NULL_TREE. - -Wed Jan 24 13:01:26 1996 Mike Stump - - * class.c (finish_struct_1): Call warn_hidden if we want warnings - about overloaded virtual functions. - (warn_hidden): New routine to warn of virtual functions that are - hidden by other virtual functions, that are not overridden. - (get_basefndecls): New routine, used by warn_hidden. - (mark_overriders): New routine, used by warn_hidden. - * search.c (get_matching_virtual): Remove old warning that just - isn't very useful. - -Tue Jan 23 12:26:10 1996 Brendan Kehoe - - * decl.c (output_builtin_tdesc_entries): #if 0 the function definition. - - * typeck.c (null_ptr_cst_p): Delete unused fn. - (build_function_call_maybe): Delete unused fn. - - * expr.c (extract_init): #if 0 the code after unconditional return 0 - for now. - - Delete old cadillac code. - * edsel.c: Remove file. - * Make-lang.in (CXX_SRCS): Take edsel.c off the list. - * Makefile.in (CXX_OBJS): Delete edsel.o. - (edsel.o): Delete rule. - * cp-tree.h (flag_cadillac): Delete var decl. - * lang-options.h: Delete "-fcadillac" and "-fno-cadillac". - * decl2.c (flag_cadillac): Delete var definition. - (lang_decode_option): Delete handling of -fcadillac and -fno-cadillac. - (grokfield): Delete code depending on flag_cadillac. - (finish_anon_union): Likewise. - * class.c (finish_struct_1): Likewise. - (pushclass): Likewise. - (popclass): Likewise. - (push_lang_context): Likewise. - (pop_lang_context): Likewise. - * decl.c (init_decl_processing): Likewise. - (start_decl): Likewise. - (cp_finish_decl): Likewise. - (xref_tag): Likewise. - (finish_enum): Likewise. - (start_function): Likewise. - (finish_function): Likewise. - (finish_stmt): Likewise. - * lex.c (lang_init): Likewise. - (check_newline): Likewise. - - * lex.c (do_pending_inlines): Delete synthesized method kludge. - - Delete defunct, ancient garbage collection implementation. - * rtti.c: New file with the RTTI stuff from gc.c. - * gc.c: Removed file (moved the remaining stuff into rtti.c). - * Makefile.in (CXX_OBJS): Replace gc.o with rtti.o. - (rtti.o): New rule, replacing gc.o. - * Make-lang.in (CXX_SRCS): Replace gc.c with rtti.c. - * cp-tree.h: Delete gc-related fn decls. - (DECL_GC_OFFSET): Delete macro. - (flag_gc): Delete extern decl. - * decl.c (current_function_obstack_index): Delete var decl. - (current_function_obstack_usage): Delete var decl. - (start_function): Delete clearing of current_function_obstack_index - and current_function_obstack_usage. - (init_decl_processing): Delete code relying on -fgc. - Delete call to init_gc_processing. - (cp_finish_decl): Delete calls to build_static_gc_entry and - type_needs_gc_entry. Delete gc code setting DECL_GC_OFFSET. - (store_parm_decls): Delete -fgc calls to cp_expand_decl_cleanup - and to expand_expr of a __gc_main call. - (maybe_gc_cleanup): Delete var decl. - (finish_function): Delete call to expand_gc_prologue_and_epilogue. - * decl2.c (flag_gc): Delete var decl. - (lang_f_options): Delete offering of -fgc. - (lang_decode_option): Delete -fgc and -fno-gc handling. - (get_temp_regvar): Delete gc code. - * init.c (build_new): Delete gc code. - * lex.c (init_lex): Delete checking of flag_gc. - - * typeck.c (convert_arguments): Delete gc code. - (build_component_addr): Delete -fgc warning. - (build_modify_expr): Delete gc code. - - * decl2.c (build_push_scope): Delete fn. - * cp-tree.h (build_push_scope): Delete decl. - - * search.c (clear_search_slots): Delete fn. - * cp-tree.h (clear_search_slots): Delete decl. - - * search.c (tree_needs_constructor_p): Delete fn. - * cp-tree.h (tree_needs_constructor_p): Delete decl. - - * tree.c (id_cmp): Delete fn. - - * tree.c (set_fnaddr_from_vtable_entry): Delete fn. - * cp-tree.h (set_fnaddr_from_vtable_entry): Delete decl. - - * tree.c (decl_value_member): Delete fn. - * cp-tree.h (decl_value_member): Delete decl. - - * tree.c (list_hash_lookup_or_cons): Delete fn. - * cp-tree.h (list_hash_lookup_or_cons): Delete decl. - - * method.c (cplus_exception_name): Delete fn. - (EXCEPTION_NAME_{PREFIX, LENGTH}): Delete macros. - - * spew.c (shift_tokens): Delete fn. - -Mon Jan 22 17:49:33 1996 Jason Merrill - - * except.c (init_exception_processing): Pass 1 to needs_pop in calls - to cp_finish_decl. - * parse.y: Likewise. - -Mon Jan 22 17:34:29 1996 Brendan Kehoe - - * tree.c (build_cplus_staticfn_type): Delete function definition; - never used. - * cp-tree.h (build_cplus_staticfn_type): Delete decl. - - * tree.c (virtual_member): Delete function definition; never used. - * cp-tree.h (virtual_member): Delete decl. - -Fri Jan 19 18:03:14 1996 Mike Stump - - * typeck.c (build_component_ref): Handle getting vbase pointers - out of complex multiple inheritance better. - -Fri Jan 19 16:27:40 1996 Mike Stump - - * typeck.c (build_object_ref): Make sure we use the real type, not - any reference type. - -Fri Jan 19 16:01:47 1996 Mike Stump - - * tree.c (build_exception_variant): Don't create new types if we - don't have to, also build new types on the right obstack. - -Fri Jan 19 14:09:44 1996 Jason Merrill - - * decl.c (store_bindings): Split out from push_to_top_level. - (push_to_top_level): Call it for b->type_shadowed on class binding - levels. - -Fri Jan 19 13:53:14 1996 Mike Stump - - * search.c (expand_upcast_fixups): Fix so that offsets stored in - vbase_offsets are always right. Fixes a problem where virtual base - upcasting and downcasting could be wrong during conversions on this - during virtual function dispatch at ctor/dtor time when dynamic - vtable fixups for deltas are needed. This only sounds easier than - it is. :-) - (fixup_virtual_upcast_offsets): Change to reflect new calling - convention for expand_upcast_fixups. - -Fri Jan 19 12:23:08 1996 Brendan Kehoe - - * decl2.c (grokbitfield): Strip the NOPs from WIDTH before we - check that it's usable as the bitfield width. - -Wed Jan 17 21:22:40 1996 Brendan Kehoe - - * decl2.c (grokfield): Call cplus_decl_attributes with the attrlist. - Pass a null tree to grokdeclarator for its ATTRLIST arg, since it's - only ever used for functions in it. - -Wed Jan 17 12:10:38 1996 Jason Merrill - - * parse.y (qualified_type_name): Use the TYPE_DECL, not the type. - (nested_type): Likewise. - (nested_name_specifier): Use lastiddecl. - - * decl.c (grokdeclarator): Adjust accordingly. - * init.c (expand_member_init): Likewise. - * parse.y (base_class): Likewise. - * typeck2.c (build_functional_cast): Likewise. - - * typeck2.c (build_functional_cast): Fill in name after we've - checked for non-aggr type. - -Wed Jan 17 10:18:01 1996 Mike Stump - - * decl2.c (warn_pointer_arith): Default to on. - -Tue Jan 16 12:45:38 1996 Jason Merrill - - * lex.c (is_rid): New function. - * decl.c (grokdeclarator): Diagnose reserved words used as - declarator-ids. - -Tue Jan 16 11:39:40 1996 Jason Merrill - - * tree.c (get_decl_list): Don't lose cv-quals. - - * decl.c (grokdeclarator): Fix SCOPE_REF handling and diagnose - typespecs used as declarator-ids. - -Tue Jan 16 11:09:42 1996 Mike Stump - - * decl.c (poplevel): When popping a level, don't give a warning for - any subblocks that already exist. - -Tue Jan 16 00:25:33 1996 Jason Merrill - - * typeck.c (build_object_ref): Finish what I started. - - * parse.y (qualified_type_name): Don't check TYPE_BUILT_IN. - - * decl2.c (constructor_name_full): Handle TEMPLATE_TYPE_PARMs. - - * decl.c (grokdeclarator): Also accept TEMPLATE_TYPE_PARM as a - scope. - -Mon Jan 15 16:19:32 1996 Jason Merrill - - * decl.c (xref_tag): Handle passing a type in directly. - - * parse.y (qualified_type_name): Pull out the type. - (nested_type): Likewise. - Take types directly instead of as identifiers. - * call.c (build_scoped_method_call): Take types directly instead of - as identifiers. - * decl.c (xref_basetypes): Likewise. - * init.c (expand_member_init): Likewise. - (build_member_call): Likewise. - (build_offset_ref): Likewise. - * typeck2.c (build_scoped_ref): Likewise, remove bogus code. - * method.c (do_build_assign_ref): Likewise. - * decl.c (grokdeclarator): Handle a type appearing as the - declarator-id for constructors. - * method.c (do_build_copy_constructor): current_base_init_list now - uses the types directly, not their names. - * init.c (sort_base_init): Likewise. - (expand_member_init): Likewise. - * init.c (is_aggr_type): New function, like is_aggr_typedef. - -Mon Jan 15 08:45:01 1996 Jeffrey A Law - - * tree.c (layout_basetypes): Call build_lang_field_decl instead - of build_lang_decl if first arg is a FIELD_DECL. - -Thu Jan 11 14:55:07 1996 Brendan Kehoe - - * decl.c (cp_finish_decl): Only clear TREE_USED if DECL_NAME is - non-empty. - * except.c (expand_start_catch_block): Set TREE_USED to avoid - warnings about the catch handler. - -Mon Jan 8 17:35:12 1996 Jason Merrill - - * typeck.c (build_modify_expr): Use a COMPOUND_EXPR instead of - expand_target_expr. - -Thu Jan 4 12:30:32 1996 Brendan Kehoe - - Fix access control to use trees rather than integers. - * class.c (access_{default, public, protected, private, - default_virtual, public_virtual, private_virtual}_node): Add - definitions. - (init_class_processing): Do creation of those nodes. - * cp-tree.h (access_type): Delete enum decl. - (access_{default, public, protected, private, default_virtual, - public_virtual, private_virtual}_node): Add decls. - (compute_access): Change return type. - * search.c (compute_access): Have tree return type, instead of enum. - (lookup_field): Declare THIS_V and NEW_V to be tree nodes. - * lex.c (real_yylex): Use yylval.ttype for giving the value of the - access_* node for each of RID_{PUBLIC, PRIVATE, PROTECTED}. - * parse.y (VISSPEC): Make ttype rather than itype. - (base_class_access_list): Likewise. - * *.[cy]: Change all refs of `access_public' to `access_public_node', - etc. - * call.c (build_method_call): Make ACCESS be a tree. - * class.c (alter_access, finish_struct_1, filter_struct): Likewise. - * cvt.c (convert_to_aggr): Likewise. - * init.c (build_offset_ref, resolve_offset_ref, build_delete): - Likewise. - * method.c (hack_identifier): Likewise. - * typeck.c (build_component_ref_1, build_component_ref): ): Likewise. - -Thu Jan 4 11:02:20 1996 Mike Stump - - * typeck.c (pointer_int_sum, pointer_diff): Make code agree with C - frontend, and make it more consistent with respect to - warn_pointer_arith. - -Tue Jan 2 00:13:38 1996 Rusty Russell - - * decl.c (pushdecl): Check for duplicate parameter names. - -Wed Jan 3 09:25:48 1996 Mike Stump - - * decl.c (expand_static_init): Call assemble_external for atexit. - -Wed Jan 3 07:55:19 1996 Mike Stump - - * except.c (do_unwind): Remove some generated dead code. - (eh_outer_context): New routine, factor out some common code from - expand_builtin_throw and end_eh_unwinder. Add code to do return - address masking for the PA. - (expand_builtin_throw): Use eh_outer_context instead of open coding - it here. - (end_eh_unwinder): Likewise. - -Tue Jan 2 17:00:56 1996 Mike Stump - - * except.c (expand_throw): Call assemble_external for __empty, if we - use it. - -Thu Dec 28 11:13:15 1995 Mike Stump - - * except.c (expand_builtin_throw): Use RETURN_ADDR_OFFSET instead of - NORMAL_RETURN_ADDR_OFFSET. - (end_eh_unwinder): Likewise. - -Wed Dec 27 22:18:16 1995 Mike Stump - - * gc.c (build_dynamic_cast): Make sure we don't cast away const - when dealing with references, and make sure we handle dynamic - casting to a cv qualified reference. - -Thu Dec 21 23:50:35 1995 Mike Stump - - * except.c (struct eh_context): New structure top hold eh context - information. - (push_eh_context): New routine. - (pop_eh_context): Likewise. - * decl.c (push_cp_function_context): Use them. - (pop_cp_function_context): Likewise. - -Wed Dec 20 12:42:51 1995 Jason Merrill - - * decl2.c (finish_file): Also prune uninteresting functions in the - inline emission loop. - -Wed Dec 20 02:32:07 1995 Jeffrey A Law - - * sig.c (build_signature_table_constructor): Mark functions - in the signature as referenced. - -Tue Dec 19 22:36:56 1995 Jason Merrill - - * decl2.c (finish_file): Do all the vtable/synthesis stuff before - the inline emission stuff. - -Mon Dec 18 15:51:33 1995 Jason Merrill - - * cp-tree.h, decl2.c (flag_weak): New flag to control the use of - weak symbols. - * lang-options.h: Add -f{no-,}weak. - * decl.c (init_decl_processing): If the target does not support weak - symbols, don't use them. - * decl2.c, pt.c: s/SUPPORTS_WEAK/flag_weak/. - -Sun Dec 17 21:13:23 1995 Rusty Russell - - * init.c (expand_member_init): warning for base init after members. - -Fri Dec 15 15:32:18 1995 Jason Merrill - - * cvt.c (build_expr_type_conversion): Don't convert to a reference - type. - -Thu Dec 14 16:05:58 1995 Mike Stump - - * method.c (report_type_mismatch): Improve wording for volatile - mismatches. - -Thu Dec 14 14:16:26 1995 Mike Stump - - * init.c (expand_aggr_init_1): Use expand_aggr_init_1 instead of - expand_assignment, as the later doesn't handle things that have - copy constructors well. The compiler would do bitwise copying, - instead of ctor calling in some cases. - -Wed Dec 13 17:05:54 1995 Paul Eggert - - * g++.c (my_strerror): Return "cannot access" if errno is 0. - (pfatal_with_name, perror_exec): Don't assume that - the returned value from my_strerror contains no '%'s. - (concat): Remove. - (sys_nerror): Declare only if HAVE_STRERROR is not defined. - -Wed Dec 13 16:22:38 1995 Jason Merrill - - Lose CLASSTYPE_METHODS/DECL_NEXT_METHOD chain; make - TYPE_METHODS/TREE_CHAIN mean what they used to. - * decl2.c (constructor_name_full): Refer to CLASSTYPE_METHOD_VEC - instead of TYPE_METHODS. - * decl.c (duplicate_decls): Lose references to DECL_NEXT_METHOD. - * tree.c (tree_copy_lang_decl_for_deferred_output): Likewise. - * cp-tree.h (CLASSTYPE_METHODS): Lose. - (CLASSTYPE_METHOD_VEC): Point to lang_spec->methods instead of - TYPE_METHODS. - (struct lang_decl): Lose next_method field. - (DECL_NEXT_METHOD): Lose. - * class.c (finish_struct_methods): Don't mess with TYPE_METHODS. - (finish_struct): Just use TYPE_METHODS; we don't need fn_fields - anymore. - (finish_struct_methods): Don't mess with the TREE_CHAINs in - fn_fields. - - * search.c (add_conversions): Don't use TREE_CHAIN to traverse method - vector. - - * call.c (build_method_call): Synthesize here even when not inlining. - * typeck.c (build_function_call_real): Likewise. - -Wed Dec 13 15:02:39 1995 Ian Lance Taylor - - * cp/lex.c (check_newline): If DBX_DEBUGGING_INFO and write_symbols - == DBX_DEBUG, call dbxout_start_new_source_file and - dbxout_resume_previous_source_file when appropriate. - -Tue Dec 12 20:38:55 1995 Mike Stump - - * except.c (start_anon_func): Push to the top level. - (end_anon_func): Pop from the top level. - -Mon Dec 11 18:56:14 1995 Mike Stump - - * cp-tree.h (build_cleanup): New routine to build cleanups. - * decl.c (expand_static_init): Use build_cleanup to build a cleanup - call at ctor time and use atexit to run it later. - * decl2.c (build_cleanup): New routine, taken from finish_file. - (finish_file): Use build_cleanup instead, and don't put function - local statics in global dtor list. - -Wed Dec 6 14:34:29 1995 Mike Stump - - * except.c (expand_throw): Ensure that we have cleanups, if we try - and expand cleanups. - -Wed Dec 6 11:48:21 1995 Mike Stump - - * except.c (expand_throw): Add logic to manage dynamic cleanups for - the EH object. - (expand_end_catch_block): Use the magic of expand_goto, instead of - emit_jump so that we get the cleanup for any catch clause parameter - and the cleanup for the exception object. Update to reflect label - changes. - (push_eh_cleanup): New routine to register a cleanup for an - exception object. - (empty_fndecl): Used to default cleanup actions to - nothing. - (init_exception_processing): Setup empty_fndecl. Setup - saved_cleanup. - (expand_start_catch_block): Update to reflect label changes. Call - push_eh_object to register the cleanup for the EH object. - (start_anon_func): New routine to start building lambda expressions - from trees. - (end_anon_func): New routine to end them. - (struct labelNode): Change so that we can use tree labels, or rtx - labels. - (saved_cleanup): Object to check for dynamic cleanups for the - exception handling object. - (push_label_entry): Change so that we can use tree labels, or rtx - labels. - (pop_label_entry): Likewise. - (top_label_entry): Likewise. - (expand_start_all_catch): Use tree label instead of rtx label, so - that we can get the magic of expand_goto. - (expand_end_all_catch): Update to reflect label changes. - - * class.c (build_vfn_ref): Remove building_cleanup logic, as we now - use UNSAVE_EXPRs. - * typeck.c (get_member_function_from_ptrfunc): Remove remnants of - building_cleanup logic, as we now use UNSAVE_EXPRs. - * cp-tree.h (unsave_expr): Declare it. - * decl.c (building_cleanup): Remove. - (maybe_build_cleanup): Remove building_cleanup logic, and use - UNSAVE_EXPR instead. - -Sun Dec 3 01:34:58 1995 Mike Stump - - * gc.c (build_t_desc): Update error message to say . - -Thu Nov 30 12:30:05 1995 Brendan Kehoe - - * decl.c (pushdecl): Only warn about shadowing a local variable if - warn_shadow is true. - -Sun Nov 26 16:06:55 1995 Rusty Russell - - * typeck.c (build_binary_op_nodefault): Added warning about - comparisons between different enum types with -Wall, unless - -fenum-int-equiv set. - -Wed Nov 22 15:44:02 1995 Mike Stump - - * class.c (finish_struct_1): Skip down to the inner type in - multidimensional arrays. Ensures ctors will be made for types that - need constructing. - -Wed Nov 22 14:19:22 1995 Mike Stump - - * decl.c (last_dtor_insn): New to track the last compiler generated - insn in a dtor. - (store_parm_decls): Set it. - (finish_function): Use it to see if the dtor is empty. Avoid doing - vtable setup all the time, if we can. - (struct cp_function): Add last_dtor_insn. - (push_cp_function_context): Save it. - (pop_cp_function_context): Restore it. - -Wed Nov 22 11:52:19 1995 Paul Russell - - * typeck.c (build_unary_op): Set TREE_NO_UNUSED_WARNING to avoid - warnings. - -Tue Nov 21 17:15:23 1995 Mike Stump - - * typeck.c (expand_target_expr): Make sure targets get put into the - current temp_slot_level, so that the free_temp_slots call will reuse - them. - -Tue Nov 21 13:32:03 1995 Mike Stump - - * class.c (finish_struct_1): Delay delta fixups for virtual bases - until after we have done the hard virtuals, to avoid a bogus `every - virtual function must have a unique final overrider' for virtual - functions that are only overridden by hard virtuals. - -Thu Nov 9 13:35:30 1995 Jason Merrill - - * pt.c (do_function_instantiation): Don't try to find a file-scope - template for a member function. - -Tue Nov 14 06:20:35 1995 Mike Stump - - * g++.c (main): Add handling of -nodefaultlibs. - -Mon Nov 13 15:45:34 1995 Mike Stump - - * cp-tree.h (INDIRECT_BIND): Add a way for the frontend to - distinguish between direct bindings of reference variables, and - indirect bindings of reference variables. - * cvt.c (build_up_reference): Use it. - * typeck.c (convert_arguments): Use it to indicate this is an - indirect binding. - * decl.c (cp_finish_decl): Ensure that we reuse stack slots as fast - as they are unused. - (expand_static_init): Likewise. - (cplus_expand_expr_stmt): Likewise. - * decl2.c (finish_file): Likewise. - * init.c (perform_member_init): Likewise. - (emit_base_init): Likewise. - (expand_aggr_vbase_init_1): Likewise. - -Fri Nov 10 09:18:09 1995 Brendan Kehoe - - * decl.c (push_namespace): Rewrite to use build_lang_decl, so we - get a DECL_LANG_SPECIFIC node. - * cp-tree.h (lang_decl_flags): Add new member `level'. - (NAMESPACE_LEVEL): Don't use decl.arguments, instead use the - decl_flags level member. - -Mon Nov 6 18:36:13 1995 Brendan Kehoe - - * call.c (build_method_call): Make sure instance has a - TYPE_LANG_SPECIFIC node before we dive into it. - -Sat Nov 4 20:01:52 1995 Jason Molenda - - * method.c (make_thunk): Use TREE_SET_CODE to set thunk's tree code. - -Thu Nov 2 17:56:57 1995 Mike Stump - - * decl.c (duplicate_decls): When smashing decls, smash staticness in - the usual way. - -Thu Nov 2 16:44:02 1995 Mike Stump - - * decl.c (poplevel): Handle the merging of subblocks of cleanups - when finishing blocks that have already been created (usually due to - the fixup goto code). Fixes bad debugging information. - -Wed Nov 1 12:33:53 1995 Jason Merrill - - * method.c (hack_identifier): Don't abort when we get a TREE_LIST - that's not a list of overloaded functions. - -Wed Nov 1 11:38:58 1995 Brendan Kehoe - - * decl2.c (mark_vtable_entries): Check DECL_LANG_SPECIFIC on fn - before trying to use DECL_ABSTRACT_VIRTUAL_P. - -Tue Oct 31 11:56:55 1995 Jason Merrill - - * decl2.c (mark_used): New function for hooking into setting of - TREE_USED on decls. - * call.c (build_method_call): Use it. - * class.c (instantiate_type): Likewise. - * init.c (build_offset_ref): Likewise. Don't call assemble_external - for all like-named functions. - * method.c (hack_identifier): Likewise. - (emit_thunk): Don't call assemble_external. - (make_thunk): Create thunk as a FUNCTION_DECL so that it - gets the right mode and ENCODE_SECTION_INFO works. - - * parse.y: Use mark_used. Pass operator names to do_identifier. - * lex.c (do_identifier): Handle operator names. - - * decl2.c (grokclassfn): Tweak __in_chrg attributes. - -Thu Oct 26 16:45:58 1995 Brendan Kehoe - - * errfn.c: Include stdio.h. - (cp_sprintf): Take out decl of sprintf, and cast sprintf to errorfn*. - -Wed Oct 25 18:58:41 1995 Mike Stump - - * typeck2.c (digest_init): Always convert initializers to the - right type. - -Wed Oct 25 13:25:24 1995 Mike Stump - - * init.c (member_init_ok_or_else): Don't allow member initializers - for indirect members, as it is invalid. - -Wed Oct 25 11:35:28 1995 Brendan Kehoe - - * decl.c (grokdeclarator): Don't allow `friend signed ()'. - -Fri Oct 20 10:30:59 1995 Mike Stump - - * parse.y (for.init.statement): Catch compound statements inside for - initializations, if we're being pedantic. - -Fri Oct 20 10:03:42 1995 Mike Stump - - * decl.c (lookup_tag): Return NULL_TREE if we don't find what we are - looking for. - -Thu Oct 19 14:26:10 1995 Mike Stump - - * error.c (dump_expr): Don't core dump when a boolean expression is - used as a default argument. - -Thu Oct 19 10:36:30 1995 Jason Merrill - - * class.c (finish_struct_bits): Check aggregate_value_p instead of - RETURN_IN_MEMORY. - -Wed Oct 18 18:12:32 1995 Jason Merrill - - * class.c (finish_struct_bits): Also set TREE_ADDRESSABLE on a - BLKmode type that would otherwise be returned in registers. - -Mon Oct 16 12:32:19 1995 Brendan Kehoe - - * g++.c (WITHLIBC): New macro. - (main): Declare saw_libc. Use WITHLIBC if `-lc' was used; set - saw_libc and pass it at the end if it was set. - -Wed Oct 11 16:30:34 1995 Brendan Kehoe - - * parse.y (fn.def1): Call split_specs_attrs in - declmods notype_declarator case. - -See ChangeLog.1 for earlier changes. diff --git a/gcc/cp/ChangeLog.3 b/gcc/cp/ChangeLog.3 deleted file mode 100644 index 57e96f315f5..00000000000 --- a/gcc/cp/ChangeLog.3 +++ /dev/null @@ -1,22648 +0,0 @@ -2003-12-30 Nathan Sidwell - - PR c++/13507 - * decl.c (duplicate_decls): Use build_type_attribute_variant to - merge attributes. - - PR c++/13494 - * tree.c (build_cplus_array_type_1): Only build a minimal array - type for dependent types or domains. - -2003-12-29 Nathan Sidwell - - PR c++/12774 - * typeck.c (comp_array_types): Fold non-dependent domains for - ABI-1. - -2003-12-29 Kriang Lerdsuwanakij - - PR c++/13289 - * semantics.c (finish_id_expression): Only check if the type of - a template argument is integral or enumeration when it is not - dependent. - -2003-12-29 Kriang Lerdsuwanakij - - PR c++/12403 - * parser.c (cp_parser_template_declaration_after_export): Set up - template specialization scope in case of explicit specialization. - -2003-12-28 Mark Mitchell - - PR c++/13081 - * decl.c (duplicate_decls): Preserve inline-ness when redeclaring - a function template. - - PR c++/12613 - * decl.c (reshape_init): Reject GNU colon-style designated - initializers in arrays. - - PR c++/13009 - * call.c (build_special_member_call): Do not assume that we have a - pointer to the complete object in an assignment operator. - -2003-12-28 Roger Sayle - - PR c++/13070 - * decl.c (duplicate_decls): When setting the type of an anticipated - declaration, merge the existing type attributes. - -2003-12-25 Andrew Pinski - - PR c++/13268, c++/13339 - * class.c (add_method): Return early when method is error_mark_node. - * pt.c (tsubst_friend_function): Return early when new_friend is - error_mark_node. - -2003-12-23 Mark Mitchell - - * cp-lang.c (cp_expr_size): Return zero for empty classes. - - * cp-tree.h (warn_if_uknown_interface): Remove unused function. - * decl2.c (warn_if_unknown_interface): Likewise. - -2003-12-23 Nathan Sidwell - - PR c++/13387 - * cp-lang.c (cxx_get_alias_set): Correct logic for a base type. - -2003-12-22 Mark Mitchell - - * decl.c (start_function): Do not check - flag_alt_external_templates or flag_external_templates. - * decl2.c (warn_if_unknown_interface): Likewise. - * lex.c (extract_interface_info): Likewise. - * pt.c (lookup_template_class): Likewise. - - PR c++/12862 - * name-lookup.c (pushdecl): Look up all namespace-scope entities - in their corresponding namespace. - - PR c++/12397 - * typeck.c (finish_class_member_access_expr): Don't tree - IDENTIFIER_NODEs as non-dependent expressions. - -2003-12-22 Andrew Pinski - - PR c++/5050 - * tree.c (cp_start_inlining): Remove. - (cp_end_inlining): Remove. - * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define. - (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define. - * cp-tree.h (cp_start_inlining): Do not declare. - (cp_end_inlining): Do not declare. - -2003-12-22 Mark Mitchell - - PR c++/12479 - * parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;" - pedwarn when not in a system header. - -2003-12-21 Mark Mitchell - - * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE, - CPTI_UNION_TYPE, CPTI_ENUM_TYPE. - (record_type_node): Remove. - (union_type_node): Likewise. - (enum_type_node): Likewise. - * decl.c: Remove mention of above tree nodes in comment. - * lex.c (cxx_init): Do not assign to record_type_node, - union_type_node, or enum_type_node. Simplify handling of - class_type_node. - - PR c++/11554 - * init.c (sort_mem_initializers): Add warning. - -2003-12-21 Kazu Hirata - - * call.c: Fix comment formatting. - * class.c: Likewise. - * cp-tree.h: Likewise. - * cvt.c: Likewise. - * cxx-pretty-print.c: Likewise. - * decl.c: Likewise. - * decl2.c: Likewise. - * error.c: Likewise. - * except.c: Likewise. - * init.c: Likewise. - * name-lookup.c: Likewise. - * parser.c: Likewise. - * pt.c: Likewise. - * rtti.c: Likewise. - * semantics.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - -2003-12-19 Kazu Hirata - - * cvt.c: Remove uses of "register" specifier in - declarations of arguments and local variables. - * decl.c: Likewise. - * decl2.c: Likewise. - * expr.c: Likewise. - * friend.c: Likewise. - * lex.c: Likewise. - * name-lookup.c: Likewise. - * repo.c: Likewise. - * search.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - -2003-12-19 Mark Mitchell - - PR c++/12795 - * name-lookup.c (pushdecl): Do not treated any functions as being - "nested" in C++. - -2003-12-19 Jason Merrill - - PR c++/13371 - * typeck.c (build_modify_expr): Stabilize lhs if we're narrowing. - * cvt.c (convert_to_void): Don't warn about the RHS of a comma - being useless if TREE_NO_UNUSED_WARNING is set. - -2003-12-18 Richard Henderson - - * cp-tree.h (struct lang_type_header): Remove __extension__. - -2003-12-18 Jason Merrill - - PR c++/12253 - * init.c (build_vec_init): Initialization of an element from - an initializer list is also a full-expression. - - * parser.c, pt.c, semantics.c: Rename constant_expression_p - to integral_constant_expression_p. - -2003-12-18 Kriang Lerdsuwanakij - - PR c++/13262 - * pt.c (instantiate_decl): Wrap push_nested_class and - pop_nested_class around cp_finish_decl call for static member - variable. - -2003-12-18 Giovanni Bajo - - PR c++/9154 - * parser.c (cp_parser_template_argument): A type-id followed by '>>' - is just an user typo, and should be accepted as last resort if any - other parsing fails. - (cp_parser_enclosed_template_argument_list): If the argument list is - parsed correctly, but the next token is '>>', emit a diagnostic. - (cp_parser_next_token_ends_template_argument): Accept '>>' as - delimiter of template argument, it will be later detected as a typo. - -2003-12-17 Kelley Cook - - * Make-lang.in: Replace cp/g++.1 with $(docobjdir)/g++.1. - -2003-12-17 Mark Mitchell - - PR c++/10603 - PR c++/12827 - * parser.c (cp_parser_error): Help c_parse_error print good - messages if the next token is a keyword. - (cp_parser_parameter_declaration_list): When resynchronizing after - a bad parameter declaration, stop if a comma is found. - (cp_parser_parameter_declaration): Avoid backtracking. - -2003-12-16 Mark Mitchell - - PR c++/12696 - * decl.c (reshape_init): Recover quickly from errors. - -2003-12-16 Nathan Sidwell - - PR c++/9043 - C++ ABI change: Mangling array indices in templates. - * decl.c (compute_array_index_type): Reorganize for earlier - template errors. Use value_dependent_expression_p for abi-2. - * mangle.c (write_array_type): Check broken mangling for - expression indices on abi-1 - -2003-12-16 Mark Mitchell - - PR c++/12696 - * decl.c (reshape_init): Recover quickly from errors. - - PR c++/13275 - * lex.c (reswords): Add "__offsetof" and "__offsetof__". - * parser.c (cp_parser): Add in_offsetof_p. - (cp_parser_new): Initialize it. - (cp_parser_primary_expression): Handle __offsetof__ (...). - (cp_parser_postfix_expression): Allow casts to pointer type and - uses of "->" in a constant expression if implementing offsetof. - (cp_parser_unary_expression): Allow the use of "&" in a constant - expression if implementing offsetof. - -2003-12-16 Giovanni Bajo - - PR c++/2294 - * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD - if the declaration comes from an using declaration. - -2003-12-16 Giovanni Bajo - - * semantics.c (finish_id_expression): Refactor the code to handle - template parameters, and emit a more informative error message - when they are used within an integral constant expression. - -2003-12-16 Nathan Sidwell - - PR c++/13387 - * class.c (finish_struct_1): Compute mode and alias set for - CLASSTYPE_AS_BASE. - * call.c (build_over_call): Use CLASSTYPE_AS_BASE for trivial - assignment of a class, as necessary. - * cp-lang.c (cxx_get_alias_set): The alias set as a base is the - same as for the complete type. - - PR c++/13242 - C++ ABI change. Mangling template parameters of reference type - * mangle.c (write_template_args): Remove unreachable code. - (write_template_arg): Look through an argument of reference type. - -2003-12-16 Giovanni Bajo - - PR c++/2294 - * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD - if the declaration comes from an using declaration. - -2003-12-15 Mark Mitchell - - PR c++/10926 - * decl2.c (grokfield): Robustify. - - PR c++/11116 - * parser.c (cp_parser_throw_expression): Determine whether or not - an assignment-expression is present by doing one-token lookahead. - - PR c++/13269 - * parser.c (cp_parser_function_definition_after_declarator): Stop - scanning tokens when reaching EOF. - - PR c++/12989 - * typeck.c (cxx_sizeof_or_alignof_expr): Robustify. - - PR c++/13310 - * pt.c (dependent_template_p): Handle OVERLOADs. - -2003-12-15 Mark Mitchell - - PR c++/13243 - PR c++/12573 - * parser.c (cp_parser_postfix_expression): Tighten handling of - integral constant expressions. - (cp_parser_unary_expression): Likewise. - * pt.c (value_dependent_expression_p): Remove handling for - COMPONENT_REFs. - -2003-12-15 Nathan Sidwell - - * class.c (add_method): Disallow destructor for java classes. - * decl.c (xref_basetypes): Check java class inheritance. - * decl2.c (check_java_method): Skip artificial params. - - PR c++/13241 - C++ ABI change. Mangling of symbols in expressions. - * mangle.c (write_mangled_name): Add top_level flag. Rework for - nested and unnested mangling. Deal with abi version 1 and version - 2 differences. - (write_expression): Adjust write_mangled_name call. - (mangle_decl_string): Use write_mangled_name for all non-type decls. - -2003-12-14 Mark Mitchell - - PR c++/10779 - PR c++/12160 - * parser.c (struct cp_parser): Add in_template_argument_list_p. - (cp_parser_error): Use c_parse_error. - (cp_parser_name_lookup_error): New function. - (cp_parser_new): Initialize it. - (cp_parser_declarator): Add parenthesized_p parameter. - (cp_parser_nested_name_specifier_opt): Use - cp_parser_name_lookup_error. - (cp_parser_parenthesized_expression_list): Improve comments. - (cp_parser_condition): Adjust call to cp_parser_declarator. - (cp_parser_template_parameter): Adjust call to - cp_parser_parameter_declaration. - (cp_parser_template_argument_list): Set - in_template_argument_list_p. - (cp_parser_explicit_instantiation): Adjust call to - cp_parser_declarator. - (cp_parser_simple_type_specifier): Remove unncessary code. - (cp_parser_using_declaration): Use cp_parser_name_lookup_error. - (cp_parser_init_declarator): Handle member function definitions. - (cp_parser_direct_declarator): Adjust call to - cp_parser_declarator. - (cp_parser_type_id): Adjust call to cp_parser_declarator. - (cp_parser_parameter_declaration_list): Avoid backtracking where - possible. - (cp_parser_parameter_declaration): Add parenthesized_p parameter. - (cp_parser_function_definition): Remove. - (cp_parser_member_declaration): Do not backtrack to look for - function definitions. - (cp_parser_exception_declaration): Adjust call to - cp_parser_declarator. - (cp_parser_single_declaration): Handle function definitions via - cp_parser_init_declarator. - (cp_parser_save_member_function_body): New function. - -2003-12-14 Kriang Lerdsuwanakij - - PR c++/13106 - * decl.c (finish_function): Check if return type is dependent before - issuing no return statement warning. - -2003-12-12 Nathan Sidwell - - PR c++/13118 - * cp-tree.h (lang_decl_u): Add thunk_alias member. - (THUNK_VIRTUAL_OFFSET): Must be a FUNCTION_DECL. - (THUNK_ALIAS_P): Remove. - (THUNK_ALIAS): Adjust. - * class.c (update_vtable_entry_for_fn): Get the vbase within the - overriding function's return type. - (dump_thunk): Adjust THUNK_ALIAS printing. - (build_vtbl_initializer): Adjust THUNK_ALIAS use. - * method.c (make_thunk): Revert 12881 test change. Clear - THUNK_ALIAS. - (finish_thunk): Adjust THUNK_ALIAS setting. - (use_thunk): Adjust THUNK_ALIAS use. - * semantics.c (emit_associated_thunks): Likewise. - - PR c++/13114, c++/13115 - * class.c (layout_empty_base): Propagate the move of an empty base - to offset zero. - - PR c++/12881 - * method.c (make_thunk): Deal with thunk aliases when searching - for a thunk. Robustify assertion. - -2003-12-11 Nathan Sidwell - - * mangle.c (conv_type_names): Holds IDENTIFIER_NODEs only. - (hash_type): Use TYPE_UID of the identifier's type. - (compare_type): Adjust. - (mangle_conv_op_name_for_type): Store identifier nodes only, use - TYPE_UID has hash value. - -2003-12-10 Mark Mitchell - - * cp-tree.h (DECL_CONV_FN_P): Check that DECL_NAME is non-NULL. - -2003-12-08 Matt Austern - - PR c/13134 - * decl.c (duplicate_decls): Copy visibility flag when appropriate. - -2003-12-09 Giovanni Bajo - - * init.c (build_new_1): Deal with an OVERLOAD set when - looking up for _Jv_AllocObject. - * except.c (build_throw): Likewise for _Jv_Throw. - -2003-12-08 Jason Merrill - - PR c++/11971 - * tree.c (build_local_temp): Split out from build_cplus_new. - (force_target_expr): New fn. - * call.c (call_builtin_trap): Call it. Take a type parm. - (convert_arg_to_ellipsis): Pass it. - (build_x_va_arg): Use call_builtin_trap. - - PR c++/11929 - * call.c (magic_varargs_p): New fn. - (build_over_call): Do no ellipsis conversions for arguments to - functions with magic varargs. - - * name-lookup.c, init.c, except.c: Revert Giovanni's patch from - yesterday. - - Give the anonymous namespace a null DECL_NAME. - * cp-tree.h: Don't declare anonymous_namespace_name. - * decl.c: Don't define it. - * dump.c (cp_dump_tree): Don't check for it. - * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise. - * error.c (dump_decl): Likewise. - * name-lookup.c: Define it here. - (push_namespace): Put it in DECL_ASSEMBLER_NAME instead. - * mangle.c (write_unqualified_name): Adjust. - -2003-12-07 Giovanni Bajo - - PR c++/2294 - * name-lookup.c (push_overloaded_decl): Always construct an - OVERLOAD unless the declaration is a built-in. - (set_namespace_binding): While binding OVERLOADs with only one - declaration, we still need to call supplement_binding. - * init.c (build_new_1): Deal with an OVERLOAD set when - looking up for _Jv_AllocObject. - * except.c (build_throw): Likewise for _Jv_Throw. - -2003-12-06 Mark Mitchell - - PR c++/13323 - * class.c (same_signature_p): Handle conversion operators - correctly. - (check_for_override): Likewise. - -2003-12-06 Kelley Cook - - * Make-lang.in (GXX_CROSS_NAME, CXX_CROSS_NAME): Delete. - (c++.install_common, cp/g++.1, c++.install-man): Adjust for above. - (c++.uninstall): Likewise. - -2003-12-05 Danny Smith - Mark Mitchell - - PR c++/13305 - * parser.c (cp_parser_elaborated_type_specifier): Accept - attributes. - -2003-12-05 Mark Mitchell - - PR c++/13314 - * parser.c (cp_parser_class_specifier): Match push_scope/pop_scope - calls. - (cp_parser_class_head): Likewise. - -2003-12-05 Kriang Lerdsuwanakij - - PR c++/13166 - * parser.c (cp_parser_late_parsing_default_args): Make sure the - context is a class before calling push_nested_class and - pop_nested_class. - -2003-12-03 James E Wilson - - * g++spec.c (lang_specific_driver): Delete USE_LIBUNWIND_EXCEPTIONS - support. - -2003-12-03 Mark Mitchell - - PR c++/9127 - * cp-tree.h (at_namespace_scope_p): New function. - * parser.c (cp_parser_class_head): Handle invalid explicit - specializations. - * search.c (at_namespace_scope_p): New function. - - PR c++/13179 - * semantics.c (finish_handler_parms): Do not call eh_type_info for - types used in templates. - - PR c++/10771 - * parser.c (cp_parser_check_for_invalid_template_id): New - function. - (cp_parser_simple_type_specifier): Use it. - (cp_parser_elaborated_type_specifier): Likewise. - (cp_parser_class_head): Likewise. - -2003-12-02 Giovanni Bajo - - PR c++/10126 - * pt.c (convert_nontype_argument): Handle default conversions - while converting a pointer to member function. - -2003-12-02 Giovanni Bajo - - PR c++/12573 - * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by - looking into them recursively. - -2003-12-02 Richard Henderson - - * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD. - * parser.c (struct cp_token): Likewise. - (struct cp_parser_token_tree_map_node): Likewise. - * lex.c (struct resword): Move const after ENUM_BITFIELD. - -2003-11-30 Mark Mitchell - - PR c++/9849 - * parser.c (cp_lexer_prev_token): New function. - (cp_parser_skip_to_closing_parenthesis): Add consume_paren - parameter. - (cp_parser_nested_name_specifier_opt): Add is_declaration - parameter. - (cp_parser_nested_name_specifier): Likewise. - (cp_parser_class_or_namespace_name): Likewise. - (cp_parser_class_name): Likewise. - (cp_parser_template_id): Likewise. - (cp_parser_template_name): Likewise. - (cp_parser_id_expression): Adjust calls to - cp_parser_nested_name_specifier_op, cp_parser_template_id, - cp_parser_class_name. - (cp_parser_unqualified_id): Likewise. - (cp_parser_postfix_expression): Likewise. - (cp_parser_pseudo_destructor_name): Likewise. - (cp_parser_cast_expression): Likewise. - (cp_parser_mem_initializer_id): Likewise. - (cp_parser_simple_type_specifier): Likewise. - (cp_parser_type_name): Likewise. - (cp_parser_elaborated_type_specifier): Likewise. - (cp_parser_qualified_namespace_specifier): Likewise. - (cp_parser_using_declaration): Likewise. - (cp_parser_using_directive): Likewise. - (cp_parser_ptr_operator): Likewise. - (cp_parser_declarator_id): Likewise. - (cp_parser_class_head): Likewise. - (cp_parser_base_specifier): Likewise. - (cp_parser_constructor_declarator_p): Likewise. - (cp_parser_direct_declarator): Fix typo in comment. - (cp_parser_parenthesized_expression_list): Adjust call to - cp_parser_skip_to_closing_parenthesis. - (cp_parser_selection_statement): Likewise. - -2003-11-23 Kriang Lerdsuwanakij - - PR c++/12924 - * typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR - with OVERLOAD and DECL nodes as the first operand. - -2003-11-22 Kriang Lerdsuwanakij - - * pt.c (tsubst) : Remove erroneous argument to build_nt. - -2003-11-22 Kriang Lerdsuwanakij - - PR c++/5369 - * friend.c (is_friend): Handle member function of a class - template as template friend. - (do_friend): Likewise. - * decl2.c (check_classfn): Add template_header_p parameter. - * decl.c (start_decl): Adjust check_classfn call. - (grokfndecl): Likewise. - * pt.c (is_specialization_of_friend): New function. - (uses_template_parms_level): Likewise. - (push_template_decl_real): Use uses_template_parms_level. - (tsubst_friend_function): Adjust check_classfn call. - * cp-tree.h (check_classfn): Adjust declaration. - (uses_template_parms_level): Add declaration. - (is_specialization_of_friend): Likewise. - -2003-11-21 Mark Mitchell - - PR c++/12515 - * pt.c (build_non_dependent_expr): Handle GNU extension to ?: - operator. - -2003-11-21 Jan Hubicka - - * parser.c (cp_parser_postfix_expression): Initialize 's' to - NULL_TREE. - -2003-11-20 Joseph S. Myers - - * Make-lang.in (c++.extraclean): Delete. - -2003-11-20 Joseph S. Myers - - * Make-lang.in (check-g++, lang_checks): Add. - -2003-11-18 Kriang Lerdsuwanakij - - PR c++/12932 - * class.c (currently_open_derived_class): Check if - current_class_type is NULL_TREE. - * semantics.c (finish_call_expr): Check if - currently_open_derived_class returns NULL_TREE. - * cp-tree.h (DERIVED_FROM_P): Add parenthesis around PARENT - parameter. - -2003-11-17 Jason Merrill - - * init.c (build_new_1): Preevaluate placement args. - * call.c (build_op_delete_call): Don't expose placement args to - overload resolution. - -2003-11-16 Jason Merrill - - * Make-lang.in (c++.tags): Create TAGS.sub files in each directory - and TAGS files that include them for each front end. - -2003-11-15 Bernardo Innocenti - - PR c++/2294 - * name-lookup.c: Revert previous patch for PR c++/2294 to prevent - build failure on libjava. - -2003-11-14 Giovanni Bajo - - PR c++/2294 - * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD - unless the declaration is a built-in. - (set_namespace_binding): While binding OVERLOADs with only one - declaration, we still need to call supplement_binding. - -2003-11-14 Mark Mitchell - - PR c++/12762 - * parser.c (cp_parser_enclosed_template_argument_list): New - function. - (cp_parser_template_id): Use it. - (cp_parser_simple_type_specifier): Recognize invalid template - syntax. - -2003-11-14 Giovanni Bajo - - PR c++/2094 - * pt.c (unify): Add support for PTRMEM_CST and - FIELD_DECL unification. - -2003-11-13 Richard Earnshaw - - * decl.c (grokfndecl): Change OK to type tree. - -2003-11-12 Mark Mitchell - - * tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like - CONSTRUCTOR. - - * decl.c (cp_make_fname_decl): When creating a top-level - __FUNCTION__-like symbol, do register it with pushdecl. - - * decl.c (finish_case_label): Do not check that we are within a - switch statement here. - * parser.c (struct cp_parser): Add in_iteration_statement_p and - in_switch_statement_p. - (cp_parser_new): Initialize them. - (cp_parser_labeled_statement): Check validity of case labels - here. - (cp_parser_selection_statement): Set in_switch_statement_p. - (cp_parser_iteration_statement): Set in_iteration_statement_p. - (cp_parser_jump_statement): Check validity of break/continue - statements here. - - PR c++/12735 - * cp-tree.h (duplicate_decls): Return a tree. - * decl.c (duplicate_decls): Clarify documentation. Return - error_mark_node to indicate a failed redeclaration. - * friend.c (do_friend): Handle that case. - * name-lookup.c (pushdecl): Likewise. - -2003-11-11 Jason Merrill - - * cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro. - * name-lookup.c (parse_using_directive): New fn. - (is_associated_namespace): New fn. - (arg_assoc_namespace): Also check associated namespaces. - * name-lookup.h: Declare new fns. - * pt.c (maybe_process_partial_specialization): Allow - specialization in associated namespace. - * parser.c (cp_parser_using_directive): Accept attributes. Use - parse_using_directive. - -2003-11-10 Richard Henderson - - * cvt.c (convert_to_void): Use void_zero_node after overload failure. - -2003-11-10 Gabriel Dos Reis - - PR c++/12832 - * name-lookup.c (supplement_binding): Gracefully handle names - used at non-class scope prior declaration. - -2003-11-06 Matt Austern - - * decl.c (duplicate_decls): copy DECL_VISIBILITY field. - * method.c (use_thunk): give thunk same visibility as function. - * optimize.c (maybe_clone_body): copy DECL_VISIBILITY field. - -2003-11-05 Kriang Lerdsuwanakij - - PR c++/11616 - * pt.c (instantiate_pending_templates): Save and restore - input_location. - -2003-11-05 Kriang Lerdsuwanakij - - PR c++/2019 - * friend.c (add_friend): Don't display previous declaration in - case of duplicate friend warning. - -2003-11-02 Kriang Lerdsuwanakij - - PR c++/9810 - * call.c (build_over_call): Check access using primary template - if FN is a member function template. - -2003-11-01 Kriang Lerdsuwanakij - - PR c++/12796 - * class.c (handle_using_decl): Set input_location before calling - error_not_base_type. - -2003-10-26 Kriang Lerdsuwanakij - - PR c++/10371 - * semantics.c (finish_non_static_data_member): Handle when - both processing_template_decl and qualifying_scope are true. - -2003-10-24 Kriang Lerdsuwanakij - - PR c++/11076 - * class.c (handle_using_decl): Swap arguments of error_not_base_type. - * parser.c (cp_parser_direct_declarator): Only resolve typename for - namespace scope declarations. - -2003-10-24 Nathan Sidwell - - PR c++/12698, c++/12699, c++/12700, c++/12566 - * cp-tree.h (THUNK_ALIAS_P, THUNK_ALIAS): New. - (debug_class, debug_thunks): New. - * class.c (dump_class_hierarchy_1): New break out from ... - (dump_class_hierarchy): ... here. - (dump_thunk, debug_thunks, debug_class): New. - (update_vtable_entry_for_fn): Add ssizetype casts. Correct - continued search for primary binfo via virtual. - (build_vtbl_initializer): Follow covariant thunk alias. - * method.c (make_thunk): Clear DECL_THUNKS of the thunk. - (finish_thunk): Look for an alias of the covariant thunk and point - to it. - (use_thunk): We should never use an alias. - * semantics.c (emit_associated_thunks): Do not emit aliases. - - PR c++/12566 - * cp-tree.h (cp_fname_init): Add TYPE pointer param. - * decl.c (cp_fname_init): Add TYPE pointer param. Set it. Don't - create an ad-hoc ERROR_MARK. - (cp_make_fname_decl): Adjust. - * pt.c (tsubst_expr): Adjust. - -2003-10-23 Jason Merrill - - PR c++/12726 - * tree.c (build_target_expr_with_type): Don't call force_rvalue - for CONSTRUCTORs. - -2003-10-22 Kazu Hirata - - * call.c: Fix comment formatting. - * class.c: Likewise. - * cxx-pretty-print.c: Likewise. - * init.c: Likewise. - * parser.c: Likewise. - * pt.c: Likewise. - * semantics.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - -2003-10-21 Mark Mitchell - - PR c++/11962 - * typeck.c (build_x_conditional_expr): Handle missing middle - operands in templates. - * mangle.c (write_expression): Issue errors about attempts to - mangle a non-existant middle operator to the ?: operator. - -2003-10-21 Robert Bowdidge - * decl.c (cp_finish_decl): Remove clause intended for asm directives - in struct or class fields: this code is never executed. - -2003-10-22 Kriang Lerdsuwanakij - - * decl.c (start_decl): Exit if push_template_decl returns - error_mark_node. - -2003-10-20 Kazu Hirata - - * ChangeLog: Fix typos. - * call.c: Fix comment typos. - * class.c: Likewise. - * cp-tree.h: Likewise. - * cvt.c: Likewise. - * cxx-pretty-print.c: Likewise. - * decl.c: Likewise. - * decl2.c: Likewise. - * init.c: Likewise. - * mangle.c: Likewise. - * name-lookup.c: Likewise. - * parser.c: Likewise. - * search.c: Likewise. - * semantics.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - -2003-10-20 Jan Hubicka - - * decl.c (start_cleanup_fn): Set DECL_DECLARED_INLINE_P to deffer - the expansion. - -2003-10-20 Mark Mitchell - - * Make-lang.in (c++.install-info): Remove. - -2003-10-20 Jason Merrill - - * class.c (layout_class_type): Set DECL_ARTIFICIAL on padding - field. - -2003-10-20 Kriang Lerdsuwanakij - - PR c++/9781, c++/10583, c++/11862 - * decl.c (cp_finish_decl): Exit immediately if decl is an - error_mark_node. - * pt.c (push_template_decl_real): Return error_mark_node for - invalid template declaration of variable. - -2003-10-18 Kriang Lerdsuwanakij - - PR c++/12495 - * pt.c (lookup_template_class): Handle when current_class_type - is a local class. - -2003-10-17 Kriang Lerdsuwanakij - - PR c++/2513 - * decl.c (make_typename_type): Use dependent_type_p. - (make_unbound_class_template): Likewise. - * pt.c (instantiate_class_template): Increment - processing_template_decl during substitution of template friend - function. Preincrement processing_template_decl rather than - postincrement. - (get_mostly_instantiated_function_type): Increment - processing_template_decl during partial substitution of function - type. - -2003-10-15 Jan Hubicka - - PR c++/12574 - * decl2.c (cxx_callgraph_analyze_expr): Deal with baselink. - -2003-10-14 Jason Merrill - - PR c++/11878 - * tree.c (build_target_expr_with_type): Call force_rvalue for - classes with non-trivial copy ctors. - - PR c++/11063 - * typeck.c (build_modify_expr): Call convert rather than abort. - -2003-10-14 Gabriel Dos Reis - - Breack out decl.c (3/n) - * name-lookup.c: Include flags.h - (lookup_name_current_level): Make static. - (add_decl_to_level): Likewise. - (push_local_binding): Likewise. - (push_overloaded_decl): Likewise. - (lookup_using_namespace): Likewise. - (qualified_lookup_using_namespace): Likewise. - (lookup_type_current_level): Likewise. - (unqualified_namespace_lookup): Likewise. - (namespace_ancestor): Likewise. - (push_using_directive): Likewise. - * decl.c (pushdecl): Move to name-lookup.c. - (pushdecl_top_level_1): Likewise. - (pushdecl_top_level): Likewise. - (pushdecl_top_level_and_finish): Likewise. - (maybe_push_decl): Likewise. - (push_using_decl): Likewise. - (push_overloaded_decl): Likewise. - (make_anon_name): Likewise. - (anon_cnt): Likewise. - (clear_anon_tags): Likewise. - (maybe_inject_for_scope_var): Likewise. - (check_for_out_of_scope_variable): Likewise. - * Make-lang.in (cp/name-lookup.o): Depend on flags.h. - * decl.c (warn_extern_redeclared_static): Export. - * cp-tree.h (warn_extern_redeclared_static): Declare. - -2003-10-14 Nathanael Nerode - - * Make-lang.in: Replace uses of $(target_alias) with - $(target_noncanonical). - -2003-10-13 Volker Reichelt - - * ChangeLog: Add PR number to patch for PR c++/12370. - -2003-10-13 Gabriel Dos Reis - - * name-lookup.h (cxx_scope_find_binding_for_name): Don't export. - (binding_for_name): Likewise. - (cxx_binding_clear): Move to name-lookup.c. - * name-lookup.c (cxx_scope_find_binding_for_name): Now static. - (binding_for_name): Likewise. - * decl2.c (is_ancestor): Move to name-lookup.c - (namespace_ancestor): Likewise. - (add_using_namespace): Likewise. - (ambiguous_decl): Likewise. - (lookup_using_namespace): Likewise. - (qualified_lookup_using_namespace): Likewise. - (set_decl_namespace): Likewise. - (decl_namespace): Likewise. - (current_decl_namespace): Likewise. - (push_decl_namespace): Likewise. - (pop_decl_namespace): Likewise. - (push_scope): Likewise. - (pop_scope): Likewise. - (struct arg_lookup): Likewise. - (arg_assoc): Likewise. - (arg_assoc_args): Likewise. - (arg_assoc_type): Likewise. - (add_function): Likewise. - (arg_assoc_namespace): Likewise. - (arg_assoc_class): Likewise. - (arg_assoc_template_arg): Likewise. - (do_namespace_alias): Likewise. - (validate_nonmember_using_decl): Likewise. - (do_nonmember_using_decl): Likewise. - (do_toplevel_using_decl): Likewise. - (do_local_using_decl): Likewise. - (do_class_using_decl): Likewise. - (do_using_directive): Likewise. - (constructor_name_full): Likewise. - (constructor_name): Likewise. - (constructor_name_p): Likewise. - -2003-10-13 Gabriel Dos Reis - - Break out decl.c (2/n) - * name-lookup.c: Include diagnostic.h - (cxx_binding_free): Make static. - (cxx_binding_make): Likewise. - (binding_table_new): Likewise - (binding_table_free): Likewise. - (binding_table_insert): Likewise. - (binding_table_find_anon_type): Likewise. - (binding_table_reverse_maybe_remap): Likewise. - (supplement_binding): Likewise. - * name-lookup.h (global_scope_name): Declare extern. - (global_type_node): Likewise. - (cxx_binding_free): Don't export. - (cxx_binding_make): Likewise. - (binding_table_new): Likewise. - (binding_table_free): Likewise. - (binding_table_insert): Likewise. - (binding_table_find_anon_type): Likewise. - (binding_table_reverse_maybe_remap): Likewise. - * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) - * decl.c (lookup_namespace_name): Move to name-lookup.c - (select_decl): Likewise. - (unqualified_namespace_lookup): Likewise. - (lookup_qualified_name): Likewise. - (lookup_name_real): Likewise. - (lookup_name_nonclass): Likewise. - (lookup_function_nonclass): Likewise. - (lookup_name): Likewise. - (lookup_name_current_level): Likewise. - (lookup_type_current_level): Likewise. - (lookup_flags): Likewise. - (qualify_lookup): Likewise. - (lookup_tag): Likewise. - (lookup_tag_reverse): Likewise. - (getdecls): Likewise. - (storedecls): Remove. - (cxx_remember_type_decls): Move to name-lookup.c. - (global_bindings_p): Likewise. - (innermost_nonclass_level): Likewise. - (toplevel_bindings_p): Likewise. - (namespace_bindings_p): Likewise. - (kept_level_p): Likewise. - (innermost_scope_kind): Likewise. - (template_parm_scope_p): Likewise. - (push_binding): Likewise. - (push_local_binding): Likewise. - (add_decl_to_level): Likewise. Make extern. - (push_class_binding): Move to name-lookup.c. - (resume_level): Likewise. Rename to resume_scope. - (begin_scope): Move to name-lookup.c. - (indent): Likewise. - (binding_depth): Likewise. - (is_class_level): Likewise. - (cxx_scope_descriptor): Likewise. - (cxx_scope_debug): Likewise. - (namespace_scope_ht_size): Likewise. - (leave_scope): Likewise. - (pushlevel_class): Likewise. - (poplevel_class): Likewise. - (clear_identifier_class_values): Likewise. - (pushdecl_with_scope): Likewise. - (pushdecl_namespace_level): Likewise. - (pushdecl_class_level): Likewise. - (push_class_level_binding): Likewise. - (push_using_directive): Likewise. - (identifier_global_value): Likewise. - (keep_next_level_flag): Likewise. - (keep_next_level): Likewise. - (free_binding_level): Likewise. - (set_class_shadows): Likewise. - (maybe_push_cleanup_level): Likewise. - (cp_namespace_decls): Likewise. - (bt_print_entry): Likewise. - (print_binding_level): Likewise. - (print_other_binding_stack): Likewise. - (print_binding_stack): Likewise. - (push_namespace): Likewise. - (pop_namespace): Likewise. - (push_nested_namespace): Likewise. - (pop_nested_namespace): Likewise. - (cxx_saved_binding_make): Likewise. - (struct cxx_saved_binding_make): Likewise. - (store_bindings): Likewise. - (maybe_push_to_top_level): Likewise. - (push_to_top_level): Likewise. - (pop_from_top_level): Likewise. - (identifier_type_value): Likewise. - (set_identifier_type_value): Likewise. - (set_identifier_type_value_with_scope): Likewise. - (pop_everything): Likewise. - (pushtag): Likewise. - (follow_tag_typedef): Likewise. - (maybe_process_template_type_declaration): Likewise. - (pop_binding): Likewise. - * cp-tree.h: Move corresponding declarations to name-lookup.h - -2003-10-12 Steven Bosscher - - * cvt.c (ocp_convert): Move warning to C common code. - -2003-10-09 Jason Merrill - - PR c++/6392 - * tree.c (build_cplus_array_type): Handle all quals the same. - (cp_build_qualified_type_real): Look through arrays first. - - * tree.c (build_cplus_new): Use build_decl to create a VAR_DECL. - (build_target_expr_with_type): Likewise. - - * pt.c (instantiate_class_template): Sanity check that our - enclosing class has been instantiated. - -2003-10-08 Giovanni Bajo - - * cp_tree.h: Added TFF_NO_FUNCTION_ARGUMENTS. - * error.c (dump_function_decl): Use it to skip the dump of the - arguments. - (dump_expr): When dumping a declaration found within an - expression, always set TFF_NO_FUNCTION_ARGUMENTS - in the flags. - -2003-10-08 Giovanni Bajo - - PR c++/11097 - * pt.c (tsubst_decl): Substitute also the DECL_NAME node of - USING_DECL. - -2003-10-06 Mark Mitchell - - PR c++/10147 - * call.c (initialize_reference): Tweak error message. - * cxx-pretty-print.h (cxx_pretty_printer_flags): Remove - pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope. - * cxx-pretty-print.c (pp_cxx_id_expression): Always display - qualified entities using qualified names. - - PR c++/12337 - * init.c (build_new_1): Make sure that the expression returned is - not an lvalue. - - PR c++/12344, c++/12236, c++/8656 - * decl.c (start_function): Do not ignore attributes embedded in a - function declarator. - -2003-10-06 Mark Mitchell - - * Make-lang.in (c++.info): Remove. - (c++.dvi): Remove. - (c++.generated-manpages): Replace with ... - (generated-manpages): ... this. - -2003-10-03 Gabriel Dos Reis - - * decl.c (struct cp_binding_level): Move to name-lookup.h - (current_binding_level): Likewise. - (class_binding_level): Likewise. - * cp-tree.h (enum scope_kind): Likewise. - -2003-10-03 Gabriel Dos Reis - - * name-lookup.c (binding_entry_free): Nullify name and type - fields. - -2003-10-02 Mark Mitchell - - PR c++/12486 - * typeck.c (finish_class_member_access_expr): Issue diagnostic - on erroneous use of qualified name. - -2003-09-30 Richard Henderson - - PR c++/12370 - * decl.c (duplicate_decls): Copy DECL_SAVED_INSNS too. - -2003-09-30 Kelley Cook - - * g++spec.c: Convert to ISO C90 prototypes. - * parser.c: Likewise. - -2003-09-30 Gabriel Dos Reis - - * decl.c (pop_binding): Don't mess with nullifying binding->scope - here. - * name-lookup.c: Re-format. - (cxx_binding_free): Nullify binding->scope. - -2003-09-29 Jan Hubicka - - PR C++/12047 - * except.c (build_eh_type_type): Call mark_used on the type. - -2003-09-28 Richard Henderson - - * typeck.c (c_expand_asm_operands): Take location_t, instead of - individual file and line. - -2003-09-28 Andreas Jaeger - - * decl.c (cxx_builtin_type_decls): Convert to ISO C90 function - definition. - * init.c (push_base_cleanups): Likewise. - * decl2.c (finish_file): Likewise. - * mangle.c (init_mangle): Likewise. - (dump_substitution_candidates): Likewise. - * search.c: Likewise. - -2003-09-27 Gabriel Dos Reis - - * name-lookup.h (get_global_value_if_present): New function. - (is_typename_at_global_scope): Likewise. - * except.c (do_begin_catch): Use get_global_value_if_present. - (do_end_catch): Likewise. - (do_allocate_exception): Likewise. - (do_free_exception): Likewise. - (build_throw): Likewise. - * parser.c (cp_parser_member_declaration): Likewise. - * rtti.c (throw_bad_cast): Likewise. - (throw_bad_typeid): Likewise. - * decl.c (check_tag_decl): Use is_typename_at_global_scope. - (grokdeclarator): Likewise. - * cp-tree.h (global_namespace): Move to name-lookup.h - * call.c (call_builtin_trap): Tidy. - -2003-09-27 Kriang Lerdsuwanakij - - PR c++/11415 - * parser.c (cp_parser_nested_name_specifier_opt): Issue correct - error message when parser->scope is global_namespace. - -2003-09-27 Gabriel Dos Reis - - * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to - macros BINDING_SCOPE, BINDING_VALUE and BINDING_TYPE. - -2003-09-26 Gabriel Dos Reis - - * decl.c (pop_binding_level, suspend_binding_level, - find_class_binding_level): Merge into leave_scope. Remove. - (leave_scope): New function. - (poplevel): Update. - (poplevel_class): Likewise. - (pop_namespace): Likewise. - -2003-09-25 Kriang Lerdsuwanakij - - PR c++/5655 - * parser.c (cp_parser_check_access_in_redeclaration): New function. - (cp_parser_member_declaration): Use it. - (cp_parser_template_declaration_after_export): Likewise. - -2003-09-22 Gabriel Dos Reis - - * cp-tree.h (scope_kind): Add new enumerator. - (keep_next_level): Change parameter type to bool. - (begin_scope): Change prototype. - (pushlevel): Remove declaration. - * decl.c (push_binding_level): Fold in begin_scope. Remove. - (struct cp_binding_level): Remove tag_tranparent field. Make keep - of bitsize one. - (keep_next_level_flag): Make a bool. - (cxx_scope_descriptor): Update scope names table - (make_cxx_scope): Fold in begin_scope. Remove.. - (namespace_scope_ht_size): New function. - (begin_scope): Change prototype. Return a scope. Tidy. - (kept_level_p): Update. - (pushlevel): Remove. - (maybe_push_cleanup_level): Simplify. - (poplevel): Update for sk_cleanup and keep change. - (print_binding_level): Likewise. - (initial_push_namespace_scope): Fold in begin_scope. Remove. - (push_namespace): Update. - (pushtag): Likewise. - (lookup_tag): Likewise. - (lookup_name_current_level): Likewise. - (lookup_type_current_level): Likewise. - (cxx_init_decl_processing): Likewise. - (start_function): Likewise. - (begin_function_body): Likewise. - (start_method): Likewise. - * pt.c (push_inline_template_parms_recursive): Likewise. - (begin_template_parm_list): Likewise. - (begin_specialization): Likewise. - * semantics.c (do_pushlevel): Likewise. - (begin_compound_stmt): Likewise. - (begin_stmt_expr): Likewise. - -2003-09-21 Richard Henderson - - * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, - method.c, optimize.c, pt.c, semantics.c, tree.c: Revert. - -2003-09-21 Richard Henderson - - * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, - method.c, optimize.c, pt.c, semantics.c, tree.c: Update for - DECL_SOURCE_LOCATION rename and change to const. - -2003-09-20 Richard Henderson - - * decl.c, decl2.c, pt.c: Use %J in diagnostics. - -2003-09-20 Kriang Lerdsuwanakij - - PR c++/157 - * parser.c (cp_parser_direct_declarator): Clear - parser->num_template_parameter_lists when parsing function - parameters. - (cp_parser_constructor_declarator_p): Likewise. - -2003-09-19 Kriang Lerdsuwanakij - - PR c++/495 - * pt.c (tsubst_friend_class): Only use innermost template - arguments for the injected friend class template. - -2003-09-19 Nathan Sidwell - - PR c++/12332 - * pt.c (instantiate_class_template): Increment - processing_template_decl around the tsubst of a template member - function. - -2003-09-19 Gabriel Dos Reis - - * decl.c (cxx_scope_descriptor): Fix thinko. - (struct cp_binding_level): Adjust type of binding_depth field. - -2003-09-18 Danny Smith - - PR c++/12320 - * call.c (type_passed_as): Check for incomplete type. - (convert_for_arg_passing): Likewise. - -2003-09-18 Nathan Sidwell - - PR c++/9848 - * optimize.c (maybe_clone_body): Don't set MARK_USED on parameters - here. - * semantics.c (expand_body): Set it here on the remaining clones. - -2003-09-18 Roger Sayle - - * lex.c (init_operators): Remove operator_name_info for FFS_EXPR. - * class.c (instantiate_type): Remove FFS_EXPR case. - -2003-09-18 Volker Reichelt - - * ChangeLog: Fix recent commit. - -2003-09-18 Volker Reichelt - - * ChangeLog: Add PR number to patch for PR c++/12316. - -2003-09-18 Gabriel Dos Reis - - * error.c (dump_type): Simplify. Use pp_type_specifier_seq for - "C" types. - * cxx-pretty-print.c (pp_cxx_type_specifier_seq): Fix thinko. - -2003-09-17 Richard Henderson - - * semantics.c (expand_body): Don't save/restore input_location. - -2003-09-17 Mark Mitchell - - PR c++/12266 - * cp-tree.h (tsubst_flags_t): Add tf_conv. - * class.c (standard_conversion): Pass tf_conv to - instantiate_type. - (resolve_address_of_overloaded_function): Do not call mark_used - when just checking conversions. - - PR debug/12066 - * cp-lang.c (LANG_HOOKS_BUILTIN_TYPE_DECLS): Define. - * cp-tree.h (cxx_builtin_type_decls): Declare. - * decl.c (builtin_type_decls): New variables. - (cxx_builtin_type_decls): New function. - (record_builtin_type): Add to builtin_type_decls. - -2003-09-17 Richard Henderson - - PR c++/12316 - * semantics.c (expand_or_defer_fn): Inc/dec function_depth. - -2003-09-16 Kriang Lerdsuwanakij - - PR c++/7939 - * typeck.c (comptypes): Don't ICE when its first argument is - error_mark_node. - (compparms): Reverse the arguments of same_type_p. - -2003-09-15 Nathan Sidwell - - PR c++/12184 - * typeck.c (convert_arguments): Return error_mark_node for an - incomplete parameter. Make error message more informative. - -2003-09-12 Mark Mitchell - - PR c++/3907 - * class.c (maybe_note_name_used_in_class): Refine test for whether - or not we are in a class scope. - - * cp-tree.h (language_function): Remove x_expanding_p. - (expanding_p): Remove. - (doing_semantic_analysis_p): Remove. - (scope_kind): Add sk_function_parms, sk_class, - sk_namespace. - (innermost_scope_kind): New method. - * call.c (cxx_type_promotes_to): Use type_decays_to. - * cp-lang.c (LANG_HOOKS_PUSHLEVEL): Redefine. - (LANG_HOOKS_POPLEVEL): Likewise. - * decl.c (cp_binding_level): Remove parm_flag, template_parms_p, - template_spec_p, namespace_p, is_for_scope, is_try_scope, and - is_catch_scope. Add kind and explicit_spec_p. - (cxx_scope_descriptor): Use a lookup table. - (find_class_binding_level): Use "kind" field in binding_level, not - the various flags. - (pop_binding_level): Likewise. - (innermost_nonclass_level): Likewise. - (toplevel_bindings_p): Likewise. - (namespace_bindings_p): Likewise. - (template_parm_scope_p): Likewise. - (innermost_scope_kind): New method. - (current_tmpl_spec_kind): Use "kind" field in binding_level, not - the various flags. - (pushlevel): Remove check for doing_semantic_analysis_p. - (begin_scope): Simplify. - (add_decl_to_level): Use "kind" field in binding_level, not - the various flags. - (push_local_binding): Likewise. - (pop_label): Remove check for doing_semantic_analysis_p. - (poplevel): Use "kind" field in binding_level, not - the various flags. - (set_block): Remove check for doing_semantic_analysis_p. - (pushlevel_class): Use "kind" field in binding_level, not - the various flags. - (poplevel_class): Likewise. - (initial_push_namespace_scope): Likewise. - (maybe_push_to_top_level): Likewise. - (set_identifier_type_value_with_scope): Likewise. - (pop_everything): Likewise. - (maybe_process_template_type_declaration): Likewise. - (pushtag): Likewise. - (pushdecl): Likewise. - (pushdecl_with_scope): Likewise. - (check_previous_goto_1): Likewise. - (define_label): Likewise. - (finish_case_label): Likewise. - (lookup_tag): Likewise. - (unqualified_namespace_lookup): Likewise. - (lookup_name_real): Likewise. - (lookup_name_current_level): Likewise. - (lookup_type_current_level): Likewise. - (record_builtin_type): Likewise. - (cp_make_fname_decl): Likewise. - (maybe_inject_for_scope_var): Likewise. - (cp_finish_decl): Remove check for doing_semantic_analysis_p. - (start_function): Use begin_scope, not pushlevel. - (finish_function): Use "kind" field in binding_level, not - the various flags. - (start_method): Use begin_scope, not pushlevel. - (make_label_decl): Do not check expanding_p. - (save_function-data): Do not set expanding_p. - (cxx_push_function_context): Do not clear expanding_p. - * semantics.c (cxx_expand_function_start): Do not set expanding_p. - -2003-09-14 Mark Mitchell - - * class.c (layout_class_type): Make DECL_MODE match TYPE_MODE for - an bit-field whose width exceeds that of its type. - -2003-09-14 Geoffrey Keating - - * rtti.c (get_tinfo_decl): Set TREE_PUBLIC for typeinfo decls. - -2003-09-14 Kazu Hirata - - * ChangeLog: Follow spelling conventions. - * parser.c: Likewise. - -2003-09-13 Richard Henderson - - * decl2.c (finish_file): Check cgraph_assemble_pending_functions - during relaxation loop. - -2003-09-11 David Edelsohn - - * decl2.c (var_finalized_p): Swap arms of conditional. - -2003-09-10 Nathan Sidwell - - PR c++/11788 - * typeck.c (build_address): If it is a function, mark it used. - (build_unary_op): Do not lose object's side-effects when taking - address of static member function. - * class.c (resolve_address_of_overloaded_function): Use - tsubst_flags_t parameter. Only expect overload sets. Adjust. - (instantiate_type): Adjust flags passing. Do not lose object's - side-effects when taking address of static member function. - -2003-09-11 Richard Henderson - - * semantics.c (expand_or_defer_fn): Update for new - cgraph_finalize_function argument. - -2003-09-10 Richard Henderson - - * decl2.c (cxx_callgraph_analyze_expr): Mark argument unused. - -2003-09-10 Jan Hubicka - - * decl2.c (var_finalized_p): New. - (maybe_emit_vtables, write_out_vars, finish_file): Use it. - -2003-09-10 Richard Henderson - - * decl2.c (cxx_callgraph_analyze_expr): New, from corpse of - mark_member_pointers. - (lower_function): Remove. - * cp-tree.h: Update to match. - * cp-lang.c (LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR): New. - (LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Remove. - -2003-09-09 Richard Henderson - - * semantics.c (expand_or_defer_fn): Update call to - cgraph_finalize_function. - - * semantics.c (expand_or_defer_fn): Use cgraph_finalize_function - always. - - * decl2.c (finish_file): Avoid out-of-bounds array reference - during memmove. - -2003-09-09 Richard Henderson - - * decl2.c (mark_member_pointers): Rename from - mark_member_pointers_and_eh_handlers and don't check eh handlers. - -2003-09-09 Christian Ehrhardt - - PR bootstrap/12168 - * method.c (use_thunk): Clear DECL_RTL of copied nodes. - -2003-09-08 Mark Mitchell - - * cp-lang.c (LANG_HOOKS_REGISTER_BUILTIN_TYPE): Define to - c_register_builtin_type. - - PR c++/11786 - * decl2.c (add_function): Do not complain about seeing the same - non-function twice. - * semantics.c (perform_koenig_lookup): Improve documentation. - - PR c++/5296 - * pt.c (try_one_overload): Add addr_p parameter. - (resolve_overloaded_unification): Pass it. - -2003-09-08 Richard Henderson - - * optimize.c (maybe_clone_body): Inc/dec function_depth. - -2003-09-08 Richard Henderson - - * decl.c (finish_function): Clear current_function_decl. - * decl2.c (mark_used): Don't push/pop gc context. - * optimize.c (optimize_function): Likewise. - * tree.c (cp_cannot_inline_tree_fn): Likewise. - * pt.c (instantiate_decl): Inc/dec function_depth instead. - * semantics.c (expand_body): Update for tree_rest_of_compilation - nested argument. - -2003-09-07 Gabriel Dos Reis - - PR c++/11762 - * error.c (dump_decl): Handle namespace-alias-definition. - * decl.c (warn_extern_redeclared_static): There is no point in - checking changes in storage class specifier for a namespace - declaration. - (duplicate_decls): Tidy diagnostic message. - * cxx-pretty-print.c (pp_cxx_left_brace): New macro. - (pp_cxx_right_brace): Likewise. - (pp_cxx_original_namespace_definition): New function. - (pp_cxx_namespace_alias_definition): Likewise. - (pp_cxx_declaration): Use them. Handle NAMESPACE_DECLs. - -2003-09-07 Jan Hubicka - - * decl2.c (maybe_emit_vtables, write_out_vars, finish_file): - Avoid re-emitting variables in unit-at-a-time mode. - -2003-09-06 Mark Mitchell - - PR c++/11867 - * call.c (standard_conversion): Improve comments. - (perform_direct_initialization): Make sure we return an expression - of the correct type. - * typeck.c (build_static_cast): Check for ambiguity and - accessibility when performing conversions. - -2003-09-06 Gabriel Dos Reis - - * cp-tree.h (add_binding): Remove declaration. - * name-lookup.h (supplement_binding): Declare. - * decl.c (add_binding): Move to name-lookup.c. - (push_local_binding): Adjust. - (push_class_binding): Likewise. - (set_identifier_type_value_with_scope): Likewise. - * name-lookup.c (supplement_binding): Rename from add_binding. - Return a bool. Improve documentation. - (set_namespace_binding): Adjust. - * Make-lang.in (cp/name-lookup.o): Depend on toplev.h - -2003-09-06 Nathan Sidwell - - PR c++/11794 - * class.c (pushclass): Push dependent using decls for nested - classes of templates too. - -2003-09-06 Roger Sayle - - PR c++/11409 - * class.c (resolve_address_of_overloaded_function): When building - list of matching non-template function decls, ignore anticipated - declarations of undeclared or shadowed GCC builtins. - -2003-09-06 Steven Bosscher - - PR c++/11595 - * decl.c (define_label): Remove unreachable timevar pop. - Always return the decl, even if the definition is invalid. - -2003-09-06 Nathan Sidwell - - PR c++/12167 - * parser.c (cp_parser_late_parsing_default_args): Push & pop the - unparsed functions queue. - -2003-09-05 Mark Mitchell - - PR c++/12163 - * call.c (perform_direct_initialization): Correct logic for - direct-initialization of a class type. - - PR c++/12146 - * pt.c (lookup_template_function): Robustify. - -2003-09-05 Nathan Sidwell - - PR c++/11922 - * pt.c (tsubst_qualified_id): Make sure we get a non-type. - (tsubst_expr, tsubst_copy_and_build): Pass false, not zero, as - is_type_p to lookup_qualified_name. - - * semantics.c (finish_call_expr): Refactor some code. - - PR c++/12037 - * cp-tree.h (COMPOUND_EXPR_OVERLOADED): New. - (build_min_non_dep): Declare. - * tree.c (build_min): Propagate TREE_SIDE_EFFECTS. - (build_min_non_dep): New. - * cvt.c (convert_to_void): Don't explicitly copy - TREE_SIDE_EFFECTS, TREE_NO_UNUSED_WARNING. - * call.c (build_new_method_call): Use build_min_non_dep. - * decl2.c (grok_array_decl): Likewise. - (build_offset_ref_call_from_tree): Likewise. - * typeck.c (finish_class_member_access_expr, - build_x_indirect_ref, build_x_binary_op, build_x_unary_op, - build_x_conditional_expr, build_x_compound_expr): Likewise. - (build_static_cast, build_reinterpret_cast, - build_const_cast): Propagate TREE_SIDE_EFFECTS inside a template. - * typeck2.c (build_x_arrow): Use build_min_non_dep. - (build_functional_cast): Propagate TREE_SIDE_EFFECTS inside a - template. - * rtti.c (build_dynamic_cast_1): Set DECL_IS_PURE. - (build_dynamic_cast): Set TREE_SIDE_EFFECTS. - * pt.c (build_non_dependent_expr): Check COMPOUND_EXPR_OVERLOADED. - -2003-09-04 Richard Henderson - - * decl2.c (mark_member_pointers_and_eh_handlers): Update for - change in cgraph_mark_needed_node arguments. - -2003-09-02 Geoffrey Keating - - PR 12161 - * decl2.c (mark_used): Use ggc_push_context/ggc_pop_context. - * tree.c (cp_cannot_inline_tree_fn): Likewise. - -2003-09-04 Nathan Sidwell - - * cp-tree.h (finish_sizeof, finish_alignof): Remove. - (expr_sizeof): Replace with ... - (cxx_sizeof_or_alignof_expr): ... here. - (cxx_sizeof_or_alignof_type): Make complain parameter a bool. - * parser.c (cp_parser_unary_expression): Commonize alignof and - sizeof handling. - * pt.c (tsubst_copy_and_build): Adjust alignof and sizeof - substitution. - * semantics.c (finish_sizeof, finish_alignof): Remove. - * typeck.c (cxx_sizeof_or_alignof_type): Complain parameter - becomes bool. Set TREE_READONLY. - (expr_sizeof): Replace with ... - (cxx_sizeof_or_alignof_expr): ... here. Clear TREE_SIDE_EFFECTS. - -2003-09-04 Mark Mitchell - - Remove cast-as-lvalue extension. - * call.c (build_conditional_expr): Correct formatting. - (convert_like_real): Use lvalue_p, not non_cast_lvalue_p. - (initialize_real): Use real_lvalue_p, not real_non_cast_lvalue_p. - * cp-tree.h (non_cast_lvalue_p): Remove. - (real_non_cast_lvalue_p): Remove. - (non_cast_lvalue_or_else): Remove. - * tree.c (lvalue_p_1): Remove allow_cast_as_lvalue parameter. - (real_lvalue_p): Adjust call to lvalue_p_1. - (non_cast_lvalue_p): Remove. - (non_cast_lvalue_or_else): Remove. - (lvalue_p): Adjust call to lvalue_p_1. - (lvalue_or_else): Simplify. - * typeck.c (build_unary_op): Use lvalue_or_else, not - non_cast_lvalue_or_else. - (build_static_cast): Use real_lvalue_p, not real_non_cast_lvalue_p. - -2003-09-03 DJ Delorie - - * decl.c (finish_function): Pass fndecl to aggregate_value_p. - -2003-09-03 Mark Mitchell - - PR c++/12053 - * class.c (include_empty_classes): Correct logic for ABI version 1. - -2003-09-03 Richard Henderson - - * optimize.c (optimize_function): Push/pop ggc context around - the call to optimize_inline_calls. - -2003-09-02 Scott Brumbaugh - - PR c++/11553 - * parser.c (cp_parser_decl_specifier_seq): Add check for a - duplicate friend decl-specifier. - -2003-09-02 Mark Mitchell - - PR c++/11847 - * pt.c (convert_nontype_argument): Correct representation of - REFERENCE_TYPE expressions. - - PR c++/11808 - * cp-tree.h (KOENIG_LOOKUP_P): New macro. - (finish_call_expr): Change prototype. - * parser.c (cp_parser_postfix_expression): Adjust call to - finish_call_expr. - * pt.c (tsubst_copy_and_build): Use KOENIG_LOOKUP_P. - * semantics.c (finish_call_expr): Add koenig_p parameter. - -2003-09-01 Mark Mitchell - - PR c++/12114 - * cp-tree.h (initialize_reference): Change prototype. - * call.c (initialize_reference): Add cleanup parameter. - * decl.c (grok_reference_init): Likewise. - (check_initializer): Likewise. - (cp_finish_decl): Insert a CLEANUP_STMT if necessary. - (duplicate_decls): When replacing an anticipated builtin, do not - honor TREE_NOTHROW. - * typeck.c (convert_for_initialization): Correct call to - initialize_reference. - - PR c++/11972 - * pt.c (dependent_type_p_r): Pass only the innermost template - arguments to any_dependent_template_arguments_p. - -2003-09-01 Josef Zlomek - - * error.c (dump_expr): Kill BIT_ANDTC_EXPR. - * lex.c (init_operators): Kill BIT_ANDTC_EXPR. - * pt.c (tsubst_copy): Kill BIT_ANDTC_EXPR. - * typeck.c (build_binary_op): Kill BIT_ANDTC_EXPR. - (tsubst_copy_and_build): Kill BIT_ANDTC_EXPR. - -2003-08-29 Mark Mitchell - - PR c++/12093 - * pt.c (build_non_dependent_expr): Do not build a - NON_DEPENDENT_EXPR for a STRING_CST. - - PR c++/11928 - * search.c (add_conversions): Avoid adding two conversion - operators for the same type. - -2003-08-29 Mark Mitchell - - PR c++/6196 - * pt.c (tsubst_copy_and_build): Correct handling of - address-of-label extension. - * semantics.c (finish_goto_stmt): The address of a label must go - through the lvalue-to-rvalue conversion. - -2003-08-29 Richard Henderson - Jason Merrill - - * cp-lang.c (LANG_HOOKS_RTL_EXPAND_START): New. - (LANG_HOOKS_RTL_EXPAND_STMT): New. - * cp-tree.h (cxx_expand_function_start): Declare. - * decl.c (start_function): Use allocate_struct_function. - Move stmts_are_full_exprs_p assertion from expand_body. - Do not free_after_parsing or free_after_compilation. - (cxx_push_function_context): Move code to set struct function - data from genrtl_start_function. - * optimize.c (optimize_function): Don't inc/dec function_depth. - * semantics.c (expand_body): Use tree_rest_of_compilation. - (cxx_expand_function_start): Rename from genrtl_start_function, - omit bits done by tree_rest_of_compilation. - (genrtl_finish_function): Remove. - (clear_decl_rtl): Move to ../tree-optimize.c. - -2003-08-29 Gabriel Dos Reis - - PR c++/11811 - * cxx-pretty-print.c (pp_cxx_canonical_template_parameter): New - function. - * cxx-pretty-print.h: Declare. - * error.c (dump_template_parameter): Use it. - (dump_type): Likewise. - -2003-08-28 Mark Mitchell - - * init.c (decl_constant_value): Deal with COND_EXPR specially. - * call.c (build_conditional_expr): Revert previous patch. - - PR optimization/5079 - * call.c (build_conditional_expr): Use decl_constant_value to - simplify the arguments. - -2003-08-26 Dan Nicolaescu - - * parser.c (struct cp_token): Use enum bitfields. - (CP_TOKEN_BLOCK_NUM_TOKENS): Make sure cp_token_block fits in a - 512B allocation unit. - (cp_parser_token_tree_map_node): Use enum bitfields. - -2003-08-26 Nathan Sidwell - - PR c++/11871 - * decl.c (push_class_level_binding): Correct old_decl value from - my 2003-07-29 reorganization. - - * call.c (build_call): Don't set TREE_SIDE_EFFECTS here. - (build_new_method_call): Add goto finish. - * semantics.c (simplify_aggr_init_exprs_r): Don't set - TREE_SIDE_EFFECTS on a call. - -2003-08-25 Richard Henderson - - * cxx-pretty-print.c (pp_cxx_class_name): Remove unused function. - -2003-08-25 Gabriel Dos Reis - - * cxx-pretty-print.h (pp_cxx_flag_default_argument): New flag. - (cxx_pretty_printer): Adjust base type. - (pp_cxx_function_specifier): Declare. - * cxx-pretty-print.c (pp_cxx_whitespace): New macro. - (pp_cxx_left_paren): Likewise. - (pp_cxx_right_paren): Likewise. - (pp_cxx_dot): Likewise. - (pp_cxx_arrow): Likewise. - (pp_cxx_semicolon): Likewise. - (pp_cxx_identifier): Likewise. - (pp_cxx_cv_qualifier_seq): Likewise. - (pp_cxx_storage_class_specifier): Likewise. - (pp_cxx_expression_list): Likewise. - (pp_cxx_space_for_pointer_operator): Likewise. - (pp_cxx_init_declarator): Likewise. - (pp_cxx_call_argument_list): Likewise. - (pp_cxx_nonconsecutive_character): Tidy. - (pp_cxx_conversion_function_id): New function. - (pp_cxx_template_id): Likewise. - (pp_cxx_template_keyword_if_needed): Likewise. - (pp_cxx_nested_name_specifier): Likewise. - (pp_cxx_unqualified_id): Tidy - (pp_cxx_qualified_id): Handle more nodes. - (pp_cxx_primary_expression): Tidy. - (pp_cxx_postfix_expression): Likewise. - (pp_cxx_new_expression): Tidy. - (pp_cxx_delete_expression): Likewise. - (pp_cxx_cast_expression): New function. - (pp_cxx_pm_expression): Tidy. - (pp_cxx_conditional_expression): Likewise. - (pp_cxx_assignment_operator): New function. - (pp_cxx_assignment_expression): Tidy. - (pp_cxx_expression): New function. - (pp_cxx_function_specifier): Likewise. - (pp_cxx_decl_specifier_seq): Likewise. - (pp_cxx_simple_type_specifier): Tidy. - (pp_cxx_type_specifier_seq): Likewise. - (pp_cxx_ptr_operator): New function. - (pp_cxx_implicit_parameter_type): Likewise. - (pp_cxx_parameter_declaration): Tidy. - (pp_cxx_parameter_declaration_clause): New function. - (pp_cxx_exception_specification): Likewise. - (pp_cxx_direct_declarator): Tidy. - (pp_cxx_declarator): Likewise. - (pp_cxx_ctor_initializer): New function. - (pp_cxx_function_definition): Likewise. - (pp_cxx_abstract_declarator): Tidy. - (pp_cxx_direct_abstract_declarator): Likewise. - (pp_cxx_type_id): Likewise. - (pp_cxx_exception_declaration): New function. - (pp_cxx_statement): Likewise. - (pp_cxx_simple_declaration): Likewise. - (pp_cxx_template_parameter_list): Likewise. - (pp_cxx_template_parameter): Likewise. - (pp_cxx_template_declaration): Likewise. - (pp_cxx_explicit_specialization): Likewise. - (pp_cxx_explicit_instantiation): Likewise. - (pp_cxx_declaration): Tidy. - (pp_cxx_pretty_printer_init): Initialize more fields. - -2003-08-25 Mark Mitchell - - PR c++/8795 - * cp-tree.h (build_cplus_method_type): Remove. - * call.c (standard_conversion): Use build_method_type_directly - instead of build_cplus_method_type. - * class.c (build_clone): Likewise. - (adjust_clone_args): Likewise. - * decl.c (build_ptrmem_type): Likewise. - (grokdeclarator): Likewise. - (check_function_type): Likewise. - * decl2.c (grok_method_quals): Likewise. - (maybe_retrofit_in_chrg): Likewise. - * pt.c (copy_default_args_to_explicit_spec): Likewise. - (tsubst_function_type): Likewise. - (tsubst): Likewise. - * tree.c (build_cplus_method_type): Remove. - * typeck.c (merge_types): Use build_method_type_directly. - -2003-08-23 Kriang Lerdsuwanakij - - PR c++/3765 - * search.c (dfs_access_in_type): Fix typo in comment. - (dfs_accessible_queue_p): Likewise. - (dfs_accessible_p): Only terminate when a friend is found. - (accessible_p): Return immediately if access_in_type allows - access. - -2003-08-23 Kriang Lerdsuwanakij - - PR c++/641, c++/11876 - * friend.c (add_friend): Add complain parameter. - (make_friend_class): Likewise. - (do_friend): Adjust add_friend call. - * decl.c (grokdeclarator): Adjust make_friend_class call. - * parser.c (cp_parser_member_declaration): Likewise. - (cp_parser_template_declaration_after_export): Likewise. - * pt.c (instantiate_class_template): Adjust make_friend_class - and add_friend call. - * cp-tree.h (make_friend_class): Adjust declaration. - (add_friend): Likewise. - -2003-08-21 Jason Merrill - - PR c++/11283 - * call.c (build_conditional_expr): Ignore cv-qual differences for - non-class types. - -2003-08-21 Mark Mitchell - - PR c++/11551 - * parser.c (cp_parser_id_expression): Add declarator_p parameter. - (cp_parser_primary_expression): Adjust call to - cp_parser_id_expression. - (cp_parser_unqualified_id): Complain about the use of - typedef-names in a destructor declarator. - (cp_parser_postfix_expression): Adjust call to - cp_parser_id_expression. - (cp_parser_type_parameter): Likewise. - (cp_parser_template_argument): Likewise. - (cp_parser_declarator_id): Likewise. - - PR c++/11919 - * call.c (standard_conversion): Use same_type_p, not pointer - equality, to compare types. - - PR c++/10762 - * parser.c (cp_parser_using_declaration): Check for invalid uses - of template-ids here... - * decl2.c (do_class_using_decl): ... rather than here. - -2003-08-20 Mark Mitchell - - PR c++/11834 - * pt.c (more_specialized): Bump processing_template_decl. - -2003-08-21 Jason Merrill - - PR c++/11614 - * decl.c (grokdeclarator): Recognize a flexible array based on the - type, not the form of the declarator. - -2003-08-20 Jason Merrill - - * semantics.c (simplify_aggr_init_expr): Split out from - simplify_aggr_init_exprs_r. Convert slot address to match - the return type. - * cp-tree.h: Declare it. - * tree.c (cp_copy_res_decl_for_inlining): Don't clobber the - DECL_NAME of a user variable. - -2003-08-20 Nathan Sidwell - - PR c++/11945 - * pt.c (build_non_dependent_expr): Look inside COND_EXPR and - COMPOUND_EXPR. - * semantics.c (finish_expr_stmt): Always convert to void. - * typeck.c (build_x_compound_exp): Always convert to void. - -2003-08-19 Mark Mitchell - - PR c++/11684 - * cp-tree.h (grok_op_properties): Change prototype. - * decl.c (grok_op_properties): Add complain parameter. - (grokfndecl): Pass it. - * pt.c (tsubst_decl): Adjust accordingly. - - PR c++/10926 - * decl.c (start_method): Return immediately if push_template_decl - does not like the declaration. - * pt.c (push_template_decl_real): Disallow member template - destructors. - - PR c++/11036 - * cp-tree.h (add_binding): Add prototype. - * class.c (add_method): Set TYPE_HAS_DESTRUCTOR if appropriate. - (maybe_warn_about_overly_private_class): Use - CLASSTYPE_DESTRUCTORS. - (pushclass): Adjust call to set_identifier_type_value. - * decl.c (add_binding): Give it external linkage. - (push_local_binding): Adjust call to add_binding. - (push_class_binding): Likewise. - (set_identifier_type_value_with_scope): Change prototype. Use - add_binding for global bindings. - (set_identifier_type_value): Adjust accordingly. - (pushtag): Likewise. - (pushdecl): Use set_identifier_type_value, not - set_identifier_type_value_with_scope. - (pushdecl_namespace_level): Adjust calls to - SET_IDENTIFIER_TYPE_VALUE to pass a DECL. - (pushdecl_class_level): Likewise. - (lookup_tag): Use select_decl. - (select_decl): Improve comment. - (record_builtin_type): Do not call pushdecl. - (cxx_init_decl_processing): Do not call xref_tag for bad_alloc. - (cp_finish_decl): Adjust call to set_identifier_type_value. - (check_elaborated_type_specifier): Improve checks for invalid uses - of typedefs. - (xref_tag): Adjust call to check_elaborated_type_specifier. - * decl2.c (grokclassfn): Do not set TYPE_HAS_DESTRUCTOR. - * name-lookup.c (set_namespace_binding): Use add_binding. - * parser.c (cp_parser_simple_type_specifier): Return a TYPE_DECL, - rather than an IDENTIFIER_NODE, to represent built-in types, if - requested by the caller. - (cp_parser_postfix_expression): Adjust call. - (cp_parser_type_specifier): Likewise. - (cp_parser_elaborated_type_specifier): Adjust call to - check_elaborated_type_specifier. - * typeck2.c (build_functional_cast): Do not perform name lookups. - - PR c++/10717 - * decl.c (expand_static_init): Remove unnecessary code. - -2003-08-19 Andrew Pinski - - PR c++/10538, PR c/5582 - * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define. - -2003-08-19 Kriang Lerdsuwanakij - - PR c++/11174 - * init.c (build_offset_ref): Perform access checking for - pointer to member correctly. - -2003-08-19 Gabriel Dos Reis - - * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTICS): Fix spelling. - -2003-08-18 Nathan Sidwell - - PR c++/11957 - * cp-tree.h (finish_stmt_expr): Add bool parameter. - * init.c (finish_init_stmts): Pass true to finish_stmt_expr. Don't - adjust the stmt_expr here. - (build_vec_init): Use finish_stmt_expr_expr, convert result to - array type. - * parser.c (cp_parser_primar_expression): Adjust finish_stmt_expr - call. - * pt.c (tsubst_copy): Likewise. - * semantics.c (finish_stmt_expr): Add parameter. - - * pt.c (instantiate_class_template): Push to class's scope before - tsubsting base. - -2003-08-17 Jan Hubicka - - PR C++/11702 - * semantics.c (finish_id_expression): Mark all functions as used. - -2003-08-16 Nathan Sidwell - - PR c++/11512 - * cvt.c (convert_to_void): Indicate which side of conditional has - no effects, and rhs of comma operator. Test for no sideeffect - expressions here and always build a convert expr. - * init.c (expand_default_init): Convert the init to void. - * typeck.c (build_x_compound_expr): Do not check for side effects - here. - (build_compound_expr): Do not convert lhs when building a - template. - -2003-08-15 Nathan Sidwell - - * cp-tree.def (NON_DEPENDENT_EXPR): Add operand. - * decl2.c (build_offset_ref_call_from_tree): Use - build_non_dependent_expr. - * error.c (dump_expr) : Dump the operand. - * pt.c (build_non_dependent_expr): Set operand. - -2003-08-14 Jan Hubicka - - * decl2.c (mark_member_pointers): Rename to... - (mark_member_pointers_and_eh_tinfos): ... this one; deal with eh tinfos - (lower_function): Update call. - * except.c (eh_type_info): Break out from ... - (build_eh_type): ... here; tinfo is already used. - (finish_eh_spec_block): Mark tinfos as used. - * semantics.c (finish_handler_params): Mark tinfo as used. - * cp-tree.h (eh_type_info): Declare. - -2003-08-15 Nathan Sidwell - - * pt.c (instantiate_class_template): Set location before - substuting bases. - - * decl.c (make_typename_type): Use my_friendly_assert. - * pt.c (tsubst_aggr_type): Rearrange context substitution. - -2003-08-14 Jan Hubicka - - * method.c (use_thunk): Expand body directly. - -2003-08-12 Mark Mitchell - - PR c++/11703 - * call.c (type_passed_as): Use TYPE_SIZE, not TYPE_PRECISION to - determine whether or not to promote types. - (convert_for_arg_passing): Likewise. - * decl2.c (cp_build_parm_decl): Do not set DECL_ARG_TYPE in - templates. - * pt.c (tsubst_decl): Do not expect it to be set. - - PR c++/9512 - PR c++/10923 - * cp-tree.h (check_elaborated_type_specifier): Declare. - (handle_class_head): Remove. - (note_got_semicolon): Likewise. - (note_list_got_semicolon): Likewise. - (finish_class_definition): Likewise. - * decl.c (check_elaborated_type_specifier): Make it public. - Robustify. - (handle_class_head): Remove. - * parser.c (cp_parser_elaborated_type_specifier): Use - check_elaborated_type_specifier. - (cp_parser_class_specifier): Do not call finish_class_definition. - (cp_parser_class_head): Or handle_class_head. Check for - over-qualified names. - * semantics.c (finish_class_definition): Remove. - - * parser.c (cp_parser_check_for_definition_in_return_type): New - function. - (cp_parser_simple_declaration): Adjust call to - cp_parser_init_declarator. - (cp_parser_decl_specifier_seq): Change type of - declares_class_or_enum parameter. - (cp_parser_explicit_instantiation): Adjust accordingly. - (cp_parser_type_specifier): Change type of - declares_class_or_enum parameter. - (cp_parser_init_declarator): Add declares_class_or_enum - parameter. - (cp_parser_parameter_declaration): Adjust call to - cp_parser_decl_specifier_seq. - (cp_parser_function_definition): Likewise. - (cp_parser_member_declaration): Likewise. - (cp_parser_single_declaration): Likewise. - - * cp-tree.h (lang_type_class): Remove has_call_overloaded, - has_array_ref_overloaded, has_arrow_overloaded, and got_semicolon. - (TYPE_OVERLOADS_CALL_EXPR): Remove. - (TYPE_OVERLOADS_ARRAY_REF): Likewise. - (TYPE_OVERLOADS_ARROW): Likewise. - (CLASSTYPE_GOT_SEMICOLON): Likewise. - * class.c (check_bases): Do not set them. - (finish_struct_1): Likewise. - * decl.c (cp_finish_decl): Do not set CLASSTYPE_GOT_SEMICOLON. - (build_ptrmemfunc_type): Likewise. - (grok_op_properties): Do not set TYPE_OVERLOADS_*. - (start_function): Do not check CLASSTYPE_GOT_SEMICOLON. - * decl2.c (grokfield): Do not set CLASSTYPE_GOT_SEMICOLON. - * lex.c (note_got_semicolon): Remove. - (note_list_got_semicolon): Likewise. - * parser.c (cp_parser_simple_declaration): Do not call - note_list_got_semicolon. - * pt.c (list_eq): Remove. - (lookup_template_class): Do not set CLASSTYPE_GOT_SEMICOLON. - (instantiate_class_template): Do not set TYPE_OVERLOADS*. - (instantiate_class_template): Do not set CLASSTYPE_GOT_SEMICOLON. - * ptree.c (cxx_print_type): Do not print them. - * semantics.c (finish_member_class_template): Do not call - note_list_got_semicolon. - -2003-08-11 Aldy Hernandez - - * call.c (standard_conversion): Opaque pointers interconvert. - - * testsuite/g++.dg/other/opaque-3.C: New. - -2003-08-11 Mark Mitchell - - * typeck.c (merge_types): Handle cv-qualified pointer-to-member - types correctly. - -2003-08-10 Mark Mitchell - - PR c++/11789 - * cp-tree.h (get_vbase): Remove. - (get_vbase_types): Remove. - * init.c (expand_member_init): Correct logic for looking up base - classes. - -2003-08-10 Gabriel Dos Reis - - * error.c (dump_expr): Tidy. - * cxx-pretty-print.c (pp_cxx_nonconsecutive_character): New. - (pp_cxx_begin_template_argument_list): Likewise. - (pp_cxx_end_template_argument_list): Likewise. - (is_destructor_name): Likewise. - (pp_cxx_unqualified_id): Likewise. - (pp_cxx_qualified_id): Likewise. - (pp_cxx_id_expression): Likewise. - (pp_cxx_new_expression): Likewise. - (pp_cxx_delete_expression): Likewise. - (pp_cxx_pm_expression): Likewise. - (pp_cxx_type_specifier): Rework. - (pp_cxx_type_id): Likewise. - (pp_cxx_primary_expression): Likewise. - (pp_cxx_postfix_expression): Likewise. - (pp_cxx_unary_expression): Likewise. - (pp_cxx_multiplicative_expression): Likewise. - (pp_cxx_conditional_expression): Likewise. - (pp_cxx_assignment_expression): Likewise. - (pp_cxx_pretty_printer_init): Tidy. - -2003-08-10 Nathan Sidwell - - * cp-tree.h (TMPL_ARGS_HAVE_MULTIPLE_LEVELS): non-NULL - NODE is always a TREE_VEC of nonzero size. - (NUM_TMPL_ARGS): NODE is always a TREE_VEC. - * decl2.c (arg_assoc): Template args will be a vec. - * error.c (dump_decl) : Call - dump_template_argument_list. - (dump_template_parms): Args will be a vec. - * parser.c (cp_parser_template_argument_list): Produce a - vector, not a list. - * pt.c (coerce_template_parms): Args are always vectors. - (mangle_class_name_for_template): Likewise. - (lookup_template_function): Likewise. - (lookup_template_class): Likewise. - (tsubst_template_args): Likewise. - (tsubst_baselink): Use tsubst_template_args. - (tsubst_qualified_id): Likewise. - (tsubst_copy) : Likewise. - (tsubst_copy_and_build) : Likewise. - (any_dependent_template_args_p): Args are always vectors. - * tree.c (cp_tree_equal): Add TEMPLATE_ID_EXPR case. - - PR c++/11670 - * call.c (convert_like_real): Add rvalue binding error message. - * error.c (dump_expr) : Detect when the no expr is - really a cast. - - PR c++/10530 - * pt.c (dependent_type_p_r): A dependent template-id is a class - type with dependent template arguments, or a bound template - template parameter. - (type_dependent_expression_p): A template function decl cannot - have a dependent context. - -2003-08-07 Kriang Lerdsuwanakij - - PR c++/5767 - * parser.c (cp_parser_class_name): Return immediately when scope - is error_mark_node. - -2003-08-07 Aldy Hernandez - - * cp/Make-lang.in (cp/call.o): Add dependency for target.h. - - * cp/call.c (standard_conversion): Support opaque types. - Include target.h. - (strip_top_quals): Use cp_build_qualified_type instead of - TYPE_MAIN_VARIANT. - - * cp/typeck.c (convert_for_assignment): Support opaque types. - - * testsuite/g++.dg/other/opaque-1.C: New. - - * testsuite/g++.dg/other/opaque-2.C: New. - -2003-08-06 Aldy Hernandez - - * decl.c (grokparms): Use cp_build_qualified_type instead - TYPE_MAIN_VARIANT. - -2003-08-05 Gabriel Dos Reis - - * cxx-pretty-print.h: New file. - * cxx-pretty-print.c: Likewise. - * error.c (scratch_pretty_printer): Change type. - (init_error): Tidy. - (dump_aggr_type): Likewise. - (dump_global_iord): Likewise. - (dump_expr): Likewise. - (dump_char): Remove. - * cp-lang.c (LANG_HOOKS_INITIALIZE_DIAGNOSTITCS): Define. - (cxx_initialize_diagnostics): New function. - * Make-lang.in (CXX_OBJS): Add cp/cxx-pretty-print.o - (CXX_PRETTY_PRINT_H): New variable. - (cp/cxx-pretty-print.o): New rule. - (cp/cp-lang.o): Update dependence. - (cp/error.o): Likewise. - -2003-08-05 Steven Bosscher - - * cp-tree.h (struct lang_decl): Don't include c_lang_decl. - (DECL_DECLARED_INLINE_P): Remove. - * decl2.c (import_export_decl): Only look at DECL_DECLARED_INLINE_P - if decl is a FUNCTION_DECL. This never made sense, but now it is - required to avoid a tree check failure. - * decl.c (grokfndecl): Don't touch DID_INLINE_FUNC. - * optimize.c (maybe_clone_body): Likewise. - -2003-08-04 Roger Sayle - - * decl.c (cxx_insert_default_attributes): Delete. - * cp-tree.h (cxx_insert_default_attributes): Don't prototype. - * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Don't define. - -2003-08-03 Nathan Sidwell - - PR c++/11704 - * pt.c (type_dependent_expression_p): Cope with COMPONENT_REF with - unknown type. - - PR c++/11766 - * typeck.c (comp_ptr_ttypes_real): Don't loop on pointers to - member functions. - -2003-08-02 Nathan Sidwell - - PR c++/9447 - * cp-tree.def (USING_DECL): Document its type. - * class.c (pushclass): If we're entering a template, push any - dependent using decls it has. - * decl2.c (do_class_using_decl): Refactor. Type is NULL iff it is - a dependent scope. - * pt.c (tsubst_decl) : Set type. - (tsubst): Remove USING_DECL checks. - (type_dependent_expression_p): Remove USING_DECL case. - * semantics.c (finish_member_declaration): A USING_DECL's type - indicates whether it is dependent. - -2003-08-02 Nathan Sidwell - - * cp-tree.h (pushclass): Remove unneeded parameter. - * class.c (pushclass): Remove unneeded MODIFY parm. Adjust. - (push_nested_class): Adjust pushclass call. - * pt.c (instantiate_class_template): Likewise. - * semantics.c (begin_class_definition): Likewise. - -2003-08-01 Nathanael Nerode - - * typeck2.c (add_exception_specifier): Use 'bool' where appropriate. - -2003-08-01 Mark Mitchell - - PR c++/11697 - * decl.c (decls_match): Don't ignore the types of template - classes. - - PR c++/11744 - * pt.c (tsubst_copy_and_build): Refine Koenig lookup logic. - -2003-08-01 Kriang Lerdsuwanakij - - PR c++/8442, c++/8806 - * decl.c (qualify_lookup): Accept TEMPLATE_DECL if types are - preferred. - (check_elaborated_type_specifier): Add allow_template_p - parameter. Check tag mismatch and class template. - (xref_tag): Add template_header_p parameter. Add assertion - that name is an IDENTIFIER_NODE. Remove implicit typename - warning. Simplify lookup process if globalize is true. - (cxx_init_decl_processing): Adjust call to xref_tag. - (xref_tag_from_type): Likewise. - * decl2.c (handle_class_head): Likewise. - * parser.c (cp_parser_elaborated_type_specifier, - cp_parser_class_head): Likewise. - * rtti.c (init_rtti_processing, build_dynamic_cast1, - tinfo_base_init, emit_support_tinfos): Likewise. - * class.c (is_base_of_enclosing_class): Remove. - * pt.c (convert_template_argument): Don't accept RECORD_TYPE as - template template argument. - * cp-tree.h (xref_tag): Adjust declaration. - (is_base_of_enclosing_class): Remove. - * NEWS: Document template template argument change. - -2003-08-01 Nathan Sidwell - - * parser.c (cp_parser_init_declarator, - cp_paser_member_declaration): Reformat. - * pt.c (lookup_template_class, type_unification_real, unify, - type_dependent_expression_p): Reformat. - - PR c++/11295 - * cp-tree.h (tubst_flags_t): Add tf_stmt_expr_cmpd, - tf_stmt_expr_body. - (finish_stmt_expr_expr): Declare. - * parser.c (cp_parser_primary_expression): Tell - cp_parser_compount_statement that it is a statement expression. - (cp_parser_statement, cp_parser_labeled_statement, - cp_parser_compound_statement, cp_parser_statement_seq_opt): Add - in_statement_expr_p parameter. - (cp_parser_expression_statement): Likewise. Call - finish_stmt_expr_expr for final expression of a statement - expression. - (cp_parser_for_init_statement, - cp_parser_implicitly_scoped_statement, - cp_parser_already_scoped_statement, cp_parser_function_definition, - cp_parser_try_block, cp_parser_handled): Adjust. - * pt.c (tsubst_copy) : Pass tf_stmt_expr. - (tsubst_expr): Process tf_stmt_expr and tf_stmt_exprs flags. - (tsubst_expr) : Check tf_stmt_exprs flag. - * semantics.c (finish_expr_stmt): Do not deal with statement - expressions. - (begin_stmt_expr): Clear last_expr_type. - (finish_stmt_expr_expr): New. - (finish_stmt_expr): Process the value expression. - - * typeck.c (build_compound_expr): If RHS is a TARGET_EXPR, put the - compound expr inside the target's initializer. - - PR c++/11525 - * parser.c (cp_parser_primary_expression): Do not set - non-constant-p merely because it is a dependent scope. - - PR c++/9447 - * decl2.c (do_class_using_decl): Set type to NULL_TREE. - * semantics.c (finish_expr_stmt): Do not convert to void in a - template. - -2003-07-31 Nathan Sidwell - - * pt.c (coerce_template_parms): Refactor. - (fn_type_unification): Increment processing_template_decl when - tsubsting an incomplete set of explicit args. - - PR c++/11347 - * pt.c (instantiate_class_template): Increment - processing_template_decl around the tsubst of a template member - class. - (tsubst_qualified_id): Assert we do not have a dependent scope. - - * pt.c (coerce_template_template_parms, lookup_template_class, - can_complete_type_without_circularity, instantiate_class_template, - tsubst_decl, unify): Reformat. - -2003-07-31 Jan Hubicka - - * decl2.c (maybe_make_one_only): Use mark_referenced. - * method.c (use_thunk): Likewsie. - -2003-07-30 Jan Hubicka - - * class.c (build_vtable_entry_ref): Kill. - (build_vtbl_ref_1): Do not call build_vtable_entry_ref. - (build_vfn_ref): Do not call build_vtable_entry_ref. - * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Kill. - * cp-tree.h (prepare_assemble_variable): Kill. - * cp-decl.c (prepare_assemble_variable): Kill. - -2003-07-29 Geoffrey Keating - - * parser.c (cp_lexer_new_main): Use c_common_no_more_pch instead - of setting valid_pch by hand. - -2003-07-29 Rainer Orth - - * decl.c (finish_enum): Initialize underlying_type. - -2003-07-29 Nathan Sidwell - - PR c++/9447 - * decl.c (add_binding): Add bval local variable. - (push_class_level_binding): Likewise. Allow a USING_DECL to be - pushed. - * decl2.c (do_class_using_decl): The type of a using decl is - unknown. - * parser.c (cp_parser_postfix_expression): Refactor unqualified-id - function call lookup code. - * pt.c (tsubst): A USING_DECL will have unknown type. - (tsubst_copy_and_build): Allow a using decl. - (type_dependent_expression_p): A USING_DECL will make it - dependent. - * semantics.c (finish_member_declaration): Push a dependent using - declaration. - -2003-07-28 Mark Mitchell - - PR c++/11530 - * parser.c (cp_parser_postfix_expression): Do not call mark_used. - * semantics.c (finish_id_expression): Call mark_used for all - declarations. - -2003-07-28 Mark Mitchell - - PR c++/11667 - * call.c (standard_conversion): Allow all integral->enumeral - conversions, after marking them as bad. - * decl.c (finish_enum): Make sure that all enumerators are - properly converted to the underlying type. - (build_enumerator): Set DECL_CONTEXT for namespace-scope - enumeration types. - * pt.c (tsubst_copy): Adjust handling of CONST_DECLs accordingly. - (tsubst_enum): Tidy. - - * Make-lang.in (typeck.o): Depend on convert.h. - (class.o): Likewise. - (rtti.o): Likewise. - * call.c: Include convert.h. - (convert_arg_to_ellipsis): Use convert_to_real. - * class.c: Include convert.h. - (build_base_path): Use convert_to_integer. - * rtti.c: Include convert.h. - (build_headof): Use convert_to_integer. - * typeck.c: Include convert.h. - (decay_conversion): Use convert_to_integer. - (build_unary_op): Use build_nop. - (get_delta_difference): Use convert_to_integer. - (build_ptrmemfunc): Avoid unnecessary conversions. - -2003-07-28 Jan Hubicka - - * decl2.c (mark_member_pointers): Verify that member pointer points to - the function. - -2003-07-28 Nathan Sidwell - - * cp-tree.h (begin_compound_stmt): No scope arg is a bool. - (finish_compound_stmt): Remove no scope arg. - * decl.c (register_dtor_fn): Adjust begin_compound_stmt and - end_compound_stmt calls. - (expand_static_init, begin_destructor_body, begin_function_body, - finish_function_body): Likewise. - * decl2.c (start_objects, finish_objects, - start_static_storage_duration_function, - finish_static_storage_duration_function): Likewise. - * init.c (begin_init_stmts, finish_init_stmts, - construct_virtual_base, build_vec_init): Likewise. - * method.c (do_build_assign_ref, synthesize_method): Likewise. - * parser.c (cp_parser_compound_statement, - cp_parser_implicitly_scoped_statement, - cp_parser_already_scoped_statement): Likewise. - * pt.c (tsubst_expr): Likewise. - * semantics.c (begin_compound_stmt): No scope arg is a bool. - (finish_compound_stmt): Remove no scope arg. - - * error.c (dump_expr) : A compound expr is - always dyadic. - -2003-07-27 Mark Mitchell - - * call.c (standard_conversion): Tweak handling of - pointer-to-member types. - * pt.c (tsubst): Correctly qualify pointers-to-data member types. - * typeck.c (comp_ptr_ttypes_real): Check qualifiers on - pointer-to-data member types. - -2003-07-27 Nathan Sidwell - - * parser.c (cp_parser_type_parameter): Reformat. - (cp_parser_parameter_declaration): Deprecate default args where - not allowed. - -2003-07-26 Nathan Sidwell - - * cfns.h: Rebuilt. - - * cp-tree.h (begin_init_stmts, finish_init_stmts): Remove. - (begin_global_stmt_expr, finish_global_stmt_expr): Remove. - * init.c (begin_init_stmts): Make static. Return is_global - value. Always call begin_stmt_expr. - (finish_init_stmts): Make static. Add is_global parm. Always - building a stmt tree. - (build_aggr_init): Adjust begin_init_stmts, finish_init_stmts calls. - (build_vec_init): Likewise. Always building a stmt tree. - (expand_default_init): Always building a stmt tree. - (get_temp_regvar): Likewise. - * semantics.c (begin_global_stmt_expr, - finish_global_stmt_expr): Remove. - -2003-07-25 Nathan Sidwell - - * cp-tree.h (build_compound_expr): Take LHS & RHS args. - (build_x_compound_expr_from_list): Declare. - * typeck.c (build_x_compound_expr_from_list): New. - (build_x_compound_expr): Adjust. - (build_compound_expr): Remove unreachable code. Take two - parameters, adjust. - * decl.c (grok_reference_init): Use - build_x_compound_expr_from_list. - (expand_static_init): Adjust build_compound_expr call. - (cxx_maybe_build_cleanup): Likewise. - * init.c (perform_member_init): Use - build_x_compound_expr_from_list. - (build_new_1): Likewise. - (build_vec_delete): Adjust build_compound_expr calls. - (build_vbase_delete): Likewise. - * typeck2.c (store_init_value): Use - build_x_compound_expr_from_list. - (build_functional_cast): Likewise. - -2003-07-25 Nathan Sidwell - - * cp-tree.h (enum tsubst_flags_t): Add tf_user. - * decl.c (make_typename_type): Pass it. - * pt.c (lookup_template_class): Use it. - (resolve_typename_type): Pass it. - * semantics.c (finish_template_type): Pass it. - -2003-07-25 Nathan Sidwell - - PR c++/11617 - * cp-tree.h (qualified_name_lookup_error): Declare. - * pt.c (tsubst_qualified_id): Use qualified_name_lookup_error for - errors. - (tsubst_expr) : Likewise. - (tsubst_copy_and_build) : Likewise. - * semantics.c (qualified_name_lookup_error): New, broken out of ... - (finish_id_expression): ... here. Use it. - -2003-07-25 Falk Hueffner - - * cfns.gperf: Add '%%' delimiter to placate gperf 3.0. - -2003-07-25 Nathan Sidwell - - PR c++/11596 - * pt.c (maybe_fold_nontype_arg, maybe_fold_nontype_args): Remove. - (tsubst_template_arg): New. - (tsubst_template_arg_vector): Rename to ... - (tsubst_template_args): ... this. Accept a TREE_LIST form. Use - tsubst_template_arg. - (coerce_template_parms): Use tsubst_template_arg for default - value. - (tsubst_template_parms): Likewise. - (tsubst_aggr_type): Adjust. - (tsubst_decl): Likewise. - (tsubst): Use tsubst_template_arg for a DOMAIN. Adjust. - (tsubst_copy) : Use tsubst_template_args. - -2003-07-25 Gabriel Dos Reis - - * Make-lang.in (cp/error.o): Depend on DIAGNOSTIC_H. - * error.c: Use the new pretty-printer framework. - -2003-07-24 Per Bothner - - * decl.c (pushdecl_class_level): Don't use push_srcloc/pop_srcloc - which causes errors messages to incorrectly mention included files. - -2003-07-24 Mark Mitchell - - * cp-tree.h (convert_to_base_statically): Declare. - * call.c (build_special_member_call): Convert INSTANCE to the base - type. - * class.c (convert_to_base_statically): New method. - * init.c (construct_virtual_base): Use it. - * method.c (do_build_assign_ref): Fix typo in comment. - -2003-07-24 Jason Merrill - - * decl.c: Just set truthvalue_* to boolean_*. - -2003-07-24 Nathan Sidwell - - * decl.c (reshape_init): Remove unreachable code. - -2003-07-24 Kriang Lerdsuwanakij - - PR c++/11513 - * cp-tree.h (PROCESSING_REAL_TEMPLATE_DECL_P): Use current_scope. - -2003-07-23 Mark Mitchell - - PR c++/11645 - * cp-tree.h (accessible_base_p): Declare. - * call.c (build_over_call): Use it. - * search.c (accessible_base_p): New function, split out from ... - (lookup_base): ... here. - - PR c++/11517 - * call.c (build_conditional_expr): Use perform_implicit_conversion - and error_operand_p. Robustify. - * typeck.c (build_unary_op): Use perform_implicit_conversion. - -2003-07-23 Nathan Sidwell - - PR c++/10953 - * parser.c (cp_parser_nested_name_specifier): Reset scope on - failure. - (cp_parser_elaborated_type_specifier): Likewise. - -2003-07-22 Mark Mitchell - - Eliminate use of POINTER_TYPE for pointers-to-members. - * call.c (standard_conversion): Rework pointer-to-member handling. - Add comments. - (add_builtin_candidate): Likewise. - (resolve_scoped_fn_name): Remove. - (build_conditional_expr): Rework pointer-to-member handling. - (compare_ics): Likewise. - * class.c (check_field_decls): Use TYPE_PTR_P. - * cp-lang.c (cp_var_mod_type_p): Rework pointer-to-member - handling. - * cp-tree.h (SCALAR_TYPE_P): Use TYPE_PTR_TO_MEMBER_P. - (TYPE_PTRMEM_P): Add comment. - (TYPE_PTR_P): Simplify. - (TYPE_PTROB_P): Correct definition. - (TYPE_PTR_TO_MEMBER_P): New macro. - (TYPE_PTRMEM_CLASS_TYPE): Adjust. - (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. - (resolved_scoped_fn_name): Remove declaration. - (build_offset_ref): Change prototype. - (resolve_offset_ref): Remove. - (comp_target_types): Remove. - * cvt.c (cp_convert_to_pointer): Rework pointer-to-member - handling. - (convert_to_reference): Use can_convert. - (ocp_convert): Improve error handling. Rework pointer-to-member - handling. - (perform_qualification_conversions): Rework pointer-to-member - handling. - * decl.c (build_ptrmem_type): Handle functions too. - (create_array_type_for_decl): Remove OFFSET_TYPE error message. - (grokdeclarator): Use OFFSET_TYPE for pointers to data members. - (grokparms): Remove OFFSET_TYPE error message. - * dump.c (cp_dump_tree): Rework pointer-to-member handling. - * error.c (dump_type_prefix): Likewise. - * expr.c (cplus_expand_constant): Use build_nop. - * init.c (build_offset_ref): Add address_p parameter. Fold in - necessary bits from resolve_offset_ref. - (resolve_offset_ref): Remove. - * parser.c (cp_parser_postfix_expression): Remove special case - code for OFFSET_TYPE. - * pt.c (convert_nontype_argument): Rework pointer-to-member - handling. - (convert_template_argument): Likewise. - (unify): Likewise. - (invalid_nontype_parm_type_p): Likewise. - (dependent_type_p_r): Likewise. - * rtti.c (get_tinfo_decl): Remove OFFSET_TYPE special case. - (target_incomplete_p_): Rework pointer-to-member - handling. - (get_pseudo_ti_init): Likewise. - (get_pseudo_ti_desc): Likewise. - * semantics.c (finish_qualified_id_expr): Adjust call to - build_offset_ref. Remove use of resolve_offset_ref. - * tree.c (pod_type_p): Use TYPE_PTR_TO_MEMBER_P. - * typeck.c (target_type): Use TYPE_PTRMEM_P. - (type_unknown_p): Remove obsolete code about the time before - non-dependent expressions were handled correctly. - (qualify_type_recursive): Remove. - (composite_pointer_type_r): New function. - (composite_pointer_type): Use it. - (merge_types): Remove dead comments. - (comp_cv_target_types): Remove. - (comp_target_types): Likewise. - (comp_target_parms): Likewise. - (cxx_sizeof_or_alignof_type): Remove OFFSET_TYPE error. - (build_indirect_ref): Use TYPE_PTR_TO_MEMBER_P. - (build_binary_op): Do not use of comp_target_types. - (pointer_diff): Remove OFFSET_TYPE case. - (build_unary_op): Adjust pointer-to-member handling. - (unary_complex_lvalue): Likewise. - (check_for_casting_away_constness): Add description parameter. - (build_static_cast): Pass it. - (build_reinterpret_cast): Use check_for_casting_away_constness. - (build_const_cast): Adjust pointer-to-member handling. - (build_c_cast): Likewise. - (convert_for_assignment): Remove OFFSET_TYPE error message. - (comp_ptr_ttypes_real): Adjust pointer-to-member handling. - (comp_ptr_ttypes_reinterpret): Remove. - (casts_away_constness_r): Adjust pointer-to-member handling. - (casts_away_constness): Liekwise. - (strip_all_pointer_quals): Remove. - * typeck2.c (digest_init): Adjust pointer-to-member handling. - (build_m_component_ref): Likewise. - -2003-07-22 Wolfgang Bangerth - - * lex.c (unqualified_fn_lookup_error): Mention that the error - message needs to be kept in synch with the manual. - -2003-07-22 Nathan Sidwell - - PR c++/11614 - * decl.c (grokdeclarator): An array member is only a flexible - array member if the field itself is the array. - -2003-07-22 Kriang Lerdsuwanakij - - PR c++/10793 - * decl.c (xref_basetypes): Handle error_mark_node. - -2003-07-22 Nathan Sidwell - - * cp-tree.h (enum cp_lvalue_kind): Add clk_packed. - * tree.c (lvalue_p_1): Set it. - * class.c (check_field): Don't allow non-packed non-POD fields to - be packed. - * call.c (reference_binding): Need a temporary for all bitfield - and packed fields. - (convert_like_real): Check it is ok to make a temporary here. - -2003-07-21 Nathan Sidwell - - * cp-tree.h (hack_identifier): Remove. - * method.c (hack_identifier): Remove. - * semantics.c (finish_id_expression): Expand hack_identifier - here. Simplify. - -2003-07-19 Kaveh R. Ghazi - - * call.c class.c decl.c decl2.c g++spec.c lex.c parser.c pt.c rtti.c - semantics.c typeck.c: Remove unnecessary casts. - -2003-07-18 Nathan Sidwell - - * cp-tree.h (hack_identifier): Remove. - * method.c (hack_identifier): Remove. - * semantics.c (finish_id_expression): Expand hack_identifier - here. Simplify. - -2003-07-18 Nathan Sidwell - - * cp-tree.h (finish_non_static_data_member): Add object param. - * method.c (hack_identifier): Adjust. - * pt.c (tsubst_copy_and_build) : Don't search - again for a FIELD_DECL. - * semantics.c (finish_non_static_data_member): Add object - parameter. Always save the DECL in the COMPONENT_REF. - * call.c (resolve_scoped_fn_name): Adjust. - -2003-07-17 Zack Weinberg - - * pt.c (get_bindings): Make definition consistent with - forward declaration. - -2003-07-17 Kriang Lerdsuwanakij - - PR c++/7809 - * friend.c (add_friend): Check access for member functions - and templates. - -2003-07-17 Gabriel Dos Reis - - PR c++/10668 - * typeck.c (build_class_member_access_expr): Improve diagnostic. - -2003-07-16 Mark Mitchell - - PR c++/11547 - * cp-tree.h (DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P): New - macro. - (DECL_PRETTY_FUNCTION_P): Use VAR_DECL_CHECK. - * decl.c (duplicate_decls): Merge - DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. - * parser.c (cp_parser_postfix_expression): Adjust call to - cp_parser_initializer_list and - cp_parser_parenthesized_expression_list. - (cp_parser_parenthesized_expression_list): Add non_constant_p. - (cp_parser_new_placement): Adjust call to - cp_parser_parenthesized_expression_list. - (cp_parser_direct_new_declarator): Likewise. - (cp_parser_conditional_expression): Remove. - (cp_parser_constant_expression): Parse an assignment-expression, - not a conditional-expression. - (cp_parser_simple_declaration): Resolve expression/declaration - ambiguity more quickly. - (cp_parser_mem_initializer): Adjust call to - cp_parser_parenthesized_expression_list. - (cp_parser_init_declarator): Keep track of whether or not the - initializer is a constant-expression. - (cp_parser_initializer): Add non_constant_p parameter. - (cp_parser_initializer_clause): Likewise. - (cp_parser_initializer_list): Likewise. - (cp_parser_attribute_list): Adjust call to - cp_parser_parenthesized_expression_list. - (cp_parser_functional_cast): Likewise. - * pt.c (tsubst_decl): Copy - DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. - (tsubst_expr): Tweak use of DECL_PRETTY_FUNCTION_P. - * semantics.c (finish_id_expression): Use - DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P. - -2003-07-16 Neil Booth - - * lang-options.h: Remove. - -2003-07-16 Andrew Pinski - - PR c/10962 - * class.c (field_decl_cmp): Remove. - (resort_field_decl_cmp): Remove. - (resort_sorted_fields): Remove. - (add_fields_to_vec): Rename to ... - (add_fields_to_record_type): this. - (finish_struct_1): Change to be using - sorted_fields_type's fields. - * cp-tree.h (lang_decl): In lang_decl_u3 - change sorted_fields to be a pointer to - sorted_fields_type. - (resort_sorted_fields): Remove prototype. - * search.c (lookup_field_1): Change to be using - sorted_fields_type's fields. - -2003-07-16 Kriang Lerdsuwanakij - - PR c++/5421 - * decl.c (grokdeclarator): Handle TEMPLATE_ID_EXPR if friend - is a member of other class. - * friend.c (do_friend): Don't build TEMPLATE_DECL if friend - is a specialization of function template. - -2003-07-16 Gabriel Dos Reis - - PR c++/10903 - * pt.c (convert_nontype_argument): Fix thinko in diagnostic. - Improve. - -2003-07-15 Mark Mitchell - - * cp-tree.def (LOOKUP_EXPR): Remove. - * cp-tree.h (cp_id_kind): Add CP_ID_KIND_UNQUALIFIED_DEPENDENT. - (LOOKUP_EXPR_GLOBAL): Remove. - (get_bindings): Remove. - (is_aggr_type_2): Remove. - * call.c (resolved_scoped_fn_name): Remove support for - LOOKUP_EXPR. - * decl.c (grokfndecl): Likewise. - (grokdeclarator): Likewise. - * error.c (dump_decl): Likewise. - (dump_expr): Likewise. - * friend.c (do_friend): Likewise. - * init.c (build_offset_ref): Likewise. - * lex.c (unqualified_fn_lookup_error): Use pedwarn. Do not create - LOOKUP_EXPRs - * mangle.c (write_expression): Remove support for LOOKUP_EXPR. - * parser.c (cp_parser_postfix_expression): Modify Koenig lookup - test. - * pt.c (get_bindings): Give it internal linkage. - (check_explicit_specialization): Remove support for LOOKUP_EXPR. - (lookup_template_function): Likewise. - (for_each_tempalte_parm_r): Likewise. - (tsubst_decl): Likewise. - (tsubst_qualified_id): Handle template template parameters. - (tsubst_copy): Remove support for LOOKUP_EXPR. - (tsubst_copy_and_build): Likewise. - (most_general_template): Likewise. - (value_dependent_expression_p): Likewise. - (type_dependent_expression_p): Note that IDENTIFIER_NODEs are - always dependent. - * semantics.c (perform_koenig_lookup): Do not create - IDENTIFIER_NODEs. - (finish_fname): Likewise. - (finish_id_expression): Likewise. - * tree.c (is_aggr_type_2): Remove. - -2003-07-16 Gabriel Dos Reis - - PR c++/11531 - * typeck.c (check_return_expr): Fix thinko in diagnostic. - -2003-07-15 Kriang Lerdsuwanakij - - PR c++/10108 - * pt.c (tsubst_decl) : Add a check for - error_mark_node. - -2003-07-14 Mark Mitchell - - PR c++/11509 - * pt.c (dependent_scope_ref_p): New function. - (value_dependent_expression_p): Use it. - (type_dependent_expression_p): Likewise. - - * pt.c (tsubst_friend_function): Use reregister_specialization. - - PR c++/7019 - * cp-tree.h (lookup_qualified_name): Adjust prototype. - * decl.c (lookup_qualified_name): Add complain parameter. Adjust - call to is_aggr_type. - * parser.c (cp_parser_lookup_name): Adjust call to - lookup_qualified_name. - * pt.c (tsubst_qualified_id): Likewise. - (tsubst_copy_and_build): Likewise. - * semantics.c (finish_qualified_id_expr): Deal with erroneous - expressions. - -2003-07-14 Gabriel Dos Reis - - PR c++/11510 - * call.c (op_error): Properly format REALPART_EXPR and - IMAGPART_EXPR. - * error.c (dump_expr): Likewise. - -2003-07-14 Gabriel Dos Reis - - * error.c (dump_expr): Handle EMPTY_CLASS_EXPR. - -2003-07-14 Gabriel Dos Reis - - PR c++/5293 - * call.c (initialize_reference): Improve diagnostic. - -2003-07-14 Kriang Lerdsuwanakij - - PR c++/11154 - * pt.c (more_specialized_class): Add full_args parameter. - (most_specialized_class): Adjust calls to more_specialized_class. - * cp-tree.h (more_specialized_class): Adjust declaration. - -2003-07-14 Dan Nicolaescu - - * lex.c (enum tree_node_kind): Delete. - -2003-07-13 Mark Mitchell - - PR c++/11503 - * cp-tree.h (DECL_SELF_REFERENCE_P): New macro. - (SET_DECL_SELF_REFERENCE_P): Likewise. - * class.c (build_self_reference): Use SET_DECL_SELF_REFERENCE_P. - * pt.c (tsubst_decl): Copy it. - * search.c (lookup_base): Use DECL_SELF_REFERENCE_P. - - * pt.c (reregister_specialization): Fix thinko in previous change. - - * cp-tree.h (cp_id_kind): New type. - (unqualified_name_lookup_error): Change prototype. - (unqualified_fn_lookup_error): New function. - (do_identifier): Remove. - (do_scoped_id): Likewise. - (tsubst_copy_and_build): Change prototype. - (reregister_specialization): New function. - (perform_koenig_lookup): Likewise. - (finish_id_expression): Likewise. - * call.c (build_method_call): Adjust call to - unqualified_name_lookup_error. - * decl.c (duplicate_decls): Use reregister_specialization. - * lex.c (is_global): Remove. - (unqualified_name_lookup_error): Return a value. - (do_identifier): Remove. - (do_scoped_id): Likewise. - (identifier_typedecl_value): Remove. - (unqualified_fn_lookup_error): New function. - * parser.c (cp_parser_id_kind): Remove. - (cp_parser_non_constant_id_expression): Remove. - (cp_parser_primary_expression): Use finish_id_expression. - (cp_parser_class_or_namespace_name): Use cp_id_kind, not - cp_parser_id_kind. - (cp_parser_postfix_expression): Use perform_koenig_lookup. - (cp_parser_template_argument): Use cp_id_kind. - (cp_parser_fold_non_dependent_expr): Adjust call to - tsubst_copy_and_build. - * pt.c (unregister_specialization): Rename to ... - (reregister_specialization): This. - (tsubst_friend_function): Use it. - (maybe_fold_nontype_arg): Adjust call to tsubst_copy_and_build. - (tsubst_qualified_id): Likewise. - (tsubst_expr): Likewise. - (tsubst_copy_and_build): Add function_p parameter. Use - finish_id_expression. Introduce RECUR macro. - (tsubst_non_call_postfix_expression): New function. - (regenerate_decl_from_template): Use reregister_specialization. - * semantics.c (perform_koenig_lookup): New function. - (finish_id_expression): Likewise. - -2003-07-13 Kriang Lerdsuwanakij - - * pt.c (push_access_scope_real): Remove. - (push_access_scope): Move code from push_access_scope_real. - (pop_access_scope): Don't check for TEMPLATE_DECL. - (instantiate_template): Defer access checking during template - substitution. - (regenerate_decl_from_template): Tidy. - -2003-07-11 Nathanael Nerode - - PR c++/11437 - * operators.def: Add definitions for __imag__, __real__. - -2003-07-11 Nathan Sidwell - - PR c++/11050 - * parser.c (cp_parser_expression_list): Rename to ... - (cp_parser_parenthesized_expression_list): ... here. Add attribute - parameter, parse the surounding parentheses. - (cp_parser_skip_to_closing_parenthesis): Add recover and or_comma - parameters. Return int. - (cp_parser_skip_to_closing_parenthesis or comma): Remove. - (cp_parser_postfix_expression): Adjust function call parsing. - (cp_parser_new_placement): Adjust. - (cp_parser_new_initializer): Likewise. - (cp_parser_cast_expression): Likewise. - (cp_parser_selection_statement): Likewise. - (cp_parser_mem_initializer): Likewise. - (cp_parser_asm_definition): Likewise. - (cp_parser_init_declarator): Likewise. - (cp_parser_declarator): Make - cdtor_or_conv_p an int ptr. - (cp_parser_direct_declarator): Likewise. Check for a parameter - list on cdtors & conv functions. - (cp_parser_initializer): Adjust. - (cp_parser_member_declaration): Adjust. - (cp_parser_attribute_list): Move code into - cp_parser_parens_expression_list. - (cp_parser_functional_cast): Adjust. - * pt.c (type_dependent_expression_p): Erroneous expressions are - non-dependent. - -2003-07-11 Geoffrey Keating - - * decl.c (cp_finish_decl): Handle 'used' attribute. - - * cp-lang.c (c_reset_state): New dummy routine. - * cp-tree.h (finish_file): Move prototype to c-common.h. - * parser.c (c_parse_file): Rename from yyparse; don't call finish_file. - -2003-07-11 Mark Mitchell - - PR c++/8327 - * pt.c (tsubst_qualified_id): Implement suggested resolution for - Core Issue 2. - (type_dependent_expression_p): Likewise. - -2003-07-10 Mark Mitchell - - * typeck.c (build_binary_op): Do not warn about signed - vs. unsigned comparisons in the bodies of templates. - - PR c++/9411 - * parser.c (cp_parser_postfix_expression): Check dependency of - functions. - -2003-07-09 Mark Mitchell - - PR c++/10032 - * decl.c (cxx_init_decl_processing): With -pedantic, pedwarns are - still errors. - - PR c++/10527 - * error.c (decl_to_string): Do not print default argument - expressions. - - * cp-tree.h (break_out_calls): Remove declaration. - * tree.c (break_out_calls): Remove. - * typeck.c (build_modify_expr): Avoid invalid sharing of trees. - -2003-07-09 Nathan Sidwell - - PR c++ 9483 - * class.c (check_field_decls): Pass DECL_NAME to constructor_name_p. - * decl2.c (constructor_name_p): Avoid repeated constructor_name - calls. - * decl.c (grokdeclarator): Refactor ctor/dtor detection. - -2003-07-09 Mark Mitchell - - * typeck.c (build_x_unary_op): Take note of the fact that - PREINCREMENT_EXPR and POSTINCREMENT_EXPR are binary operations on - trees. - - * parser.c (cp_parser_primary_expression): Preserve the form of - qualified expressions in templates, even if they are not - dependent. - * pt.c (convert_nontype_argument): Handle non-dependent SCOPE_REFs. - (tsubst_qualified_id): Likewise. - * search.c (accessible_p): Treat everything in the body of a - template as accessible. - -2003-07-08 Mark Mitchell - - * cp-tree.def (NON_DEPENDENT_EXPR): New node. - * cp-tree.h (build_call_from_tree): Remove. - (build_member_call): Likewise. - (dependent_template_arg_p): Remove. - (any_dependent_template_arguments_p): New function. - (dependent_template_id_p): Likewise. - (any_type_dependent_arguments_p): Likewise. - (build_non_dependent_expr): Likewise. - (build_non_dependent_args): Likewise. - (build_x_compound_expr): Adjust prototype. - * call.c (build_new_method_call): Handle non-dependent expressions - correctly. - * decl2.c (grok_array_decl): Likewise. - (build_offset_ref_call_from_tree): Likewise. - (build_call_from_tree): Remove. - * error.c (dump_decl): Handle NON_DEPENDENT_EXPR. - (dump_expr): Likewise. - * init.c (build_member_call): Remove. - * mangle.c (write_expression): Update handling for template-ids. - * parser.c (cp_parser_primary_expression): Use - any_dependent_template_arguments_p. Update constant-expression - handling. - (cp_parser_postfix_expression): Use - any_type_dependent_arguments_p. Simplify call processing. - (cp_parser_unary_expression): Simplify. - (cp_parser_expression): Adjust for changes to - build_x_compound_expr. - (cp_parser_template_argument): Implement standard-conforming - parsing of non-type template arguments. - (cp_parser_direct_declarator): Use - cp_parser_fold_non_dependent_expr. - (cp_parser_fold_non_dependent_expr): New function. - (cp_parser_next_token_ends_template_argument_p): Likewise. - * pt.c (convert_template_argument): Do not call - maybe_fold_nontype_arg. - (tsubst_baselink): Likewise. - (tsubst_copy_and_build): Share common code. Make sizeof/alignof - processing work correctly for non-dependent expressions. Adjust - handling of COMPOUND_EXPR. Simplify call processing. - (value_dependent_expression_p): Deal with functional casts and - sizeof/alignof correctly. - (type_dependent_expression_p): Handle overloaded functions. - (any_type_dependent_arguments_p): New function. - (any_dependent_template_arguments_p): Likewise. - (dependent_template_p): Treat SCOPE_REFs as dependent. - (dependent_template_id_p): Simplify. - (build_non_dependent_expr): New function. - (build_non_dependent_args): Likewise. - * semantics.c (finish_stmt_expr): Don't make dependent - statement-expresions have void type. - (finish_call_expr): Handle non-dependent expressions - correctly. - * tree.c (lvalue_p_1): Treat NON_DEPENDENT_EXPRs as lvalues. - * typeck.c (cxx_sizeof_or_alignof_type): Give the expression - type size_t, even in templates. - (expr_sizeof): Likewise. - (finish_class_member_access_expr): Handle non-dependent expressions - correctly. - (build_x_indirect_ref): Likewise. - (build_x_binary_op): Likewise. - (build_x_unary_op): Likewise. - (build_x_conditional_expr): Likewise. - (build_x_compound_expr): Likewise. - * typeck2.c (build_x_arrow): Likewise. - -2003-07-09 Jan Hubicka - - * cp-lang.c (LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS): New. - * decl.c (duplicate_decls): Use DECL_ESTIMATED_INSNS. - (start_function): Use DECL_ESTIMATED_INSNS. - * optimize.c (maybe_clone_body): Use DECL_ESTIMATED_INSNS. - - * decl2.c (maybe_emit_vtables): Fix marking vtables as needed in - unit-at-a-time - -2003-07-08 Kriang Lerdsuwanakij - - PR c++/11030 - * pt.c (instantiate_class_template): Don't call xref_tag to - inject name when the friend class is a specialization. - -2003-07-07 Mark Mitchell - - * cp-tree.h (build_scoped_method_call): Remove. - (lookup_qualified_name): Remove parameter. - (tsubst_copy_and_build): Declare. - (finish_qualified_object_call_expr): Remove. - (check_accessibility_of_qualified_id): New function. - (finish_qualified_id_expr): Likewise. - (non_reference): Likewise. - (build_expr_from-tree): Remove. - * call.c (non_reference): Remove. - (build_scoped_method_call): Likewise. - (build_method_call): Use error_operand_p. Assert that we are not - processing a template. - (standard_conversion): Use non_reference. - * class.c (build_vtbl_entry_ref): Likewise. - (build_vtbl_ref_1): Likewise. - * cvt.c (build_expr_type_conversion): Use non_reference. - * decl.c (lookup_qualified_name): Remove flags parameter. - (grok_op_properties): Use non_reference. - * decl2.c (grok_array_decl): Likewise. - (build_expr_from_tree): Remove. - (build_offset_ref_call_from_tree): Update comment. - * error.c (parm_to_string): Call reinit_global_formatting_buffer. - * except.c (prepare_eh_types): Use non_reference. - (can_convert_eh): Likewise. - * init.c (build_dtor_call): Avoid using build_method_call. - * mangle.c (write_template_param): Remove misleading comment. - * method.c (locate_copy): Use non_reference. - * parser.c (cp_parser_scope_through_which_access_occurs): Remove. - (cp_parser_primary_expression): Do not create SCOPE_REFs is - non-dependent contexts. - (cp_parser_postfix_expression): Use finish_qualified_id_expr. - (cp_parser_direct_declarator): Use tsubst_copy_and_build, not - build_expr_from_tree. - (cp_parser_lookup_name): Adjust call to lookup_qualified_name. - Use check_accessibility_of_qualified_id. - * pt.c (maybe_fold_nontype_arg): Use tsubst_copy_and_build, not - build_expr_from_tree. - (tsubst_baselink): New function. - (tsubst_qualified_id): Likewise. - (tsubst_copy): Use them. Remove support for METHOD_CALL_EXPR. - (tsubst_expr): Adjust call to lookup_qualified_name. - (tsubst_copy_and_build): Handle SCOPE_REFs specially. Adjust - handling of CALL_EXPRs. - (value_dependent_expression_p): Use INTEGRAL_OR_ENUMERATION_TYPE_P. - * rtti.c (get_tinfo_decl_dynamic): Use non_reference. - * search.c (check_final_overrider): Likewise. - * semantics.c (check_accessibility_of_qualified_id): New function. - (finish_qualified_object_call_expr): Remove. - * typeck.c (target_type): Use non_reference. - (cxx_sizeof_or_alignof_type): Likewise. - (dubious_conversion_warnings): Likewise. - (convert_for_initialization): Likewise. - (non_reference): New function. - -2003-07-07 Kaveh R. Ghazi - - * decl.c (print_binding_level, print_other_binding_stack, - print_binding_stack): Merge uses of HOST_PTR_PRINTF with adjacent - stdio calls. - * ptree.c (cxx_print_decl, cxx_print_binding): Likewise. - -2003-07-07 Andreas Jaeger - - * friend.c: Convert to ISO C90 prototypes. - - * Make-lang.in ($(srcdir)/cp/cfns.h): Use ANSI-C as output - language. - * cfns.h: Regenerate. - - * typeck.c: Convert remaining prototypes to ISO C90. - * search.c: Likewise. - - * decl2.c (build_expr_from_tree): Convert prototype to ISO C90. - * semantics.c (expand_or_defer_fn): Likewise - * mangle.c (discriminator_for_string_literal): Likewise. - * g++spec.c (lang_specific_driver): Likewise. - - * search.c (lookup_base_r): Remove unused variable. - -2003-07-07 Nathan Sidwell - - * semantics.c: (genrtl_try_block) Adjust emit_line_note - calls. - -2003-07-07 Andreas Jaeger - - * search.c (lookup_base_r): Remove unused variable. - -2003-07-06 Michael Chastain - - PR debug/10055 - * lex.c (cxx_init): Call push_srcloc and pop_srcloc rather than - assigning to input_filename directly. - -2003-07-06 Kazu Hirata - - * call.c: Fix comment formatting. - * class.c: Likewise. - * cp-tree.h: Likewise. - * decl.c: Likewise. - * decl2.c: Likewise. - * error.c: Likewise. - * method.c: Likewise. - * name-lookup.c: Likewise. - * parser.c: Likewise. - * pt.c: Likewise. - * rtti.c: Likewise. - * search.c: Likewise. - * typeck.c: Likewise. - -2003-07-06 Mark Mitchell - - PR c++/11345 - * search.c (lookup_base_r): Remove is_non_public and - within_current_scope parameters. Remove other dead code. - (lookup_base): Adjust call to lookup_base_r. - (adjust_result_of_qualified_name_lookup): Improve comment. - * semantics.c (finish_call_expr): Use maybe_dummy_object. - -2003-07-06 Neil Booth - - * cp-lang.c (LANG_HOOKS_HANDLE_FILENAME, - LANG_HOOKS_MISSING_ARGUMENT): Override. - -2003-07-05 Mark Mitchell - - PR c++/11431 - * typeck.c (build_static_cast): Check for reference conversions - earlier. - -2003-07-04 Mark Mitchell - - * cp-tree.h (perform_integral_promotions): Declare. - * call.c (build_addr_func): Use decay_conversion. - (convert_arg_to_ellipsis): Likewise. Remove misleading comment. - (convert_for_arg_passing): Use perform_integral_promotions. - * cvt.c (build_expr_type_conversion): Use decay_conversion. - (type_promotes_to): Do not return a cv-qualified type. - * decl.c (grok_reference_init): Fix formatting. - (get_atexit_node): Use decay_conversion. - (build_enumerator): Use perform_integral_promotions. - * init.c (build_vec_init): Use decay_conversion. - * semantics.c (finish_expr_stmt): Likewise. - (finish_switch_cond): Use perform_integral_promotions. - * typeck.c (default_conversion): Likewise. - (perform_integral_promotions): New function. - (build_indirect_ref): Use decay_conversion. - (build_array_ref): Use perform_integral_promotions. - (convert_arguments): Use decay_conversion. - (build_unary_op): Use perform_integral_promotions. - (build_c_cast): Use decay_conversion. - (build_modify_expr): Likewise. - (convert_for_initialization): Likewise. - * typeck2.c (build_x_arrow): Likewise. - -2003-07-04 Kazu Hirata - - * call.c: Fix comment typos. - * class.c: Likewise. - * cp-tree.h: Likewise. - * cvt.c: Likewise. - * decl2.c: Likewise. - * decl.c: Likewise. - * init.c: Likewise. - * mangle.c: Likewise. - * parser.c: Likewise. - * pt.c: Likewise. - * search.c: Likewise. - * semantics.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - -2003-07-04 Zack Weinberg - - * parser.c (cp_lexer_read_token): No need to handle string - constant concatenation. - -2003-07-03 Kaveh R. Ghazi - - * cp-tree.h (GCC_DIAG_STYLE, ATTRIBUTE_GCC_CXXDIAG): Define. - (cp_error_at, cp_warning_at, cp_pedwarn_at): Mark with - ATTRIBUTE_GCC_CXXDIAG. - -2003-07-03 Mark Mitchell - - * call.c (build_addr_func): Handle bound pointers-to-members. - (build_method_call): Do not call resolve_offset_ref. - (implicit_conversion): Likewise. - (resolve_scoped_fn_name): Use finish_non_static_data_member, not - resolve_offset_ref. - (resolve_args): Do not call resolve_offset_ref. - (build_conditional_expr): Likewise. - (build_new_method_call): Likewise. - * cp-tree.def (OFFSET_REF): Update documentation. - * cvt.c (cp_convert_to_pointer): Update handling of conversions from - pointers to members to pointers. - (ocp_convert): Do not call resolve_offset_ref. - (convert_to_void): Likewise. - (build_expr_type_conversion): Likewise. - * decl2.c (delete_sanity): Likewise. - * init.c (resolve_offset_ref): Simplify greatly. - (build_vec_delete): Do not call resolve_offset_ref. - * parser.c (cp_parser_postfix_expression): Call resolve_offset_ref - if appropriate. - (cp_parser_unary_expression): Use - cp_parser_simple_cast_expression. - (cp_parser_delete_expression): Likewise. - (cp_parser_cast_expression): Likewise. - (cp_parser_pm_expression): Use cp_parser_binary_op. - (cp_parser_simple_cast_expression): New function. - * rtti.c (build_dynamic_cast_1): Do not call resolve_offset_ref. - * semantics.c (finish_increment_expr): Likewise. - (finish_typeof): Likewise. - * tree.c (lvalue_p_1): Do not handle OFFSET_REF. - * typeck.c (require_complete_type): Do not handle OFFSET_REFs. - (decay_conversion): Do not call resolve_offset_ref. - (finish_class_member_access_expr): Likewise. - (convert_arguments): Likewise. - (build_x_binary_op): Handle DOTSTAR_EXPR. - (condition_conversion): Do not call resolve_offset_ref. - (unary_complex_lvalue): Likewise. - (build_static_cast): Likewise. - (build_reinterpret_cast): Likewise. - (build_const_cast): Likewise. - (build_c_cast): Likewise. - (build_modify_expr): Likewise. - (convert_for_assignment): Likewise. - (convert_for_initialization): Likewise. - * typeck2.c (build_x_arrow): Likewise. - (build_m_component_ref): Simplify. - - * call.c (build_scoped_method_call): Use convert_to_void. - (build_method_call): Likewise. - * class.c (check_field_decls): Remove dead code. - * cvt.c (convert_from_reference): Remove OFFSET_TYPE handling. - * decl2.c (grok_array_decl): Remove dead code. - (arg_assoc_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE - as pointer-to-member representation. - * init.c (build_offset_ref): Tidy. - (build_vec_delete_1): Use convert_to_void. - * mangle.c (write_type): Avoid relying on POINTER_TYPE over OFFSET_TYPE - as pointer-to-member representation. - -2003-07-03 Nathan Sidwell - - PR c++/9162 - * decl.c (grokdeclarator): Return friend decls, not - void_type_node. - * decl2.c (grokfield): Alter friend decl check. - * parser.c (struct cp_parser): Document default_arg chain on - unparsed_functions_queue. - (cp_parser_save_default_args): New. - (cp_parser_init_declarator, cp_parser_function_definition, - cp_parser_member_declaration): Call it. - (cp_parser_class_specifier): Remove unused variable. Alter - processing of unparsed_functions_queue. - -2003-07-03 Kaveh R. Ghazi - - * class.c (add_method, check_field_decl): Fix format specifier. - * decl.c (duplicate_decls, pushdecl, check_goto, - fixup_anonymous_aggr, maybe_commonize_var, grokdeclarator, - start_enum): Likewise. - * decl2.c (ambiguous_decl): Likewise. - * pt.c (redeclare_class_template): Likewise. - -2003-07-02 Nathan Sidwell - - PR c++/10219 - * pt.c (type_unification_real): Don't unify exprs of error type. - * tree.c (error_type): Don't die on error_type. - - PR c++/9779 - * decl2.c (arg_assoc_class): Don't die on NULL type. - * typeck.c (type_unknown_p): Don't die on untyped expressions. - -2003-07-01 Mark Mitchell - - PR c++/6949 - * decl2.c (grokfield): Create TEMPLATE_DECLs for methods in local - classes. - -2003-07-01 Kaveh R. Ghazi - - * error.c (locate_error): %P takes an `int', not a `tree'. - -2003-07-02 Jan Hubicka - - * decl2.c (defer_fn): Set DECL_DEFER_OUTPUT. - (finish-file): Do not process function with DECL_DEFER_OUTPUT clear; - clear DECL_DEFER_OUTPUT once function is processed; avoid flags - massaging. - - * cp-tree.h (DECL_NEEDED_P): Support unit-at-a-time - (expand_or_defer_fn): Declare. - (lower_function): Declare. - * decl.c (start_cleanup_fn): Use expand_or_defer_fn. - * decl2.c: Include cgraph.h and varpool.h - (maybe_emit_vtables): Make explicit instantations as needed. - (mark_member_pointers, lower_function): New functions. - (finish_file): Do unit-at-a-time. - * method.c (synthesize_method): Use expand_or_defer_fn. - * optimize.c (maybe_clone_body): Use expand_or_defer_fn. - * parser.c (cp_parser_function_definition_after_decl): Use - expand_or_defer_fn. - * pt.c (instantiate_decl): Likewise. - * semantics.c: Include cgraph.h - (expand_or_defer_fn): Break out from ... - (expand_body): ... here; deal with unit-at-a-time. - * cp-lang.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, - LANG_HOOKS_CALLGRAPH_LOWER_FUNCTION): Define. - -2003-07-01 Mark Mitchell - - * call.c (resolve_scoped_fn_name): Return error_mark_node for - erroneous cases. - -2003-07-01 Mark Mitchell - - PR c++/11149 - * call.c (resolve_scoped_fn_name): Check that the qualifying scope - is a class type. - -2003-07-01 Giovanni Bajo - - PR c++/8046 - * error.c (dump_decl): Handle BIT_NOT_EXPR as - pseudo destructor calls. - -2003-07-01 Nathan Sidwell - - * cp-tree.h (define_label): Replace filename and lineno - arguments with a location_t. - * decl.c (pop_label): Adjust define_label call. - (define_label): Replace filename and lineno arguments with a - location_t. - * semantics.c (finish_label): Adjust define_label call. - -2003-07-01 Mark Mitchell - - PR c++/9559 - * decl2.c (grokfield): Do not build NOP_EXPRs around the - error_mark_node. - -2003-06-30 Neil Booth - - * Make-lang.in: Update. - * cp-lang.c (c_language): Define. - (LANG_HOOKS_INIT_OPTIONS): Use common hook. - * cp-tree.h (cxx_init_options): Remove. - * lex.c: Don't include diagnostic.h. - (cxx_init_options): Remove. - -2003-06-30 Giovanni Bajo - - PR c++/4933 - * error.c (dump_expr): Support correctly the COMPOUND_EXPR - tree generated within a template. Use dump_expr to dump an - expression sizeof. - -2003-06-30 Giovanni Bajo - - * mangle.c (write_expression): Exit gracefully when trying to - mangle a CALL_EXPR. - -2003-06-30 Giovanni Bajo - - PR c++/10750 - * parser.c (cp_parser_primary_expression): A VAR_DECL with a - (value- or type-) dependent expression as DECL_INITIAL is a - valid constant-expression (at parser time). - -2003-06-30 Giovanni Bajo - - PR c++/11106 - * error.c (dump_decl): Call dump_decl to dump the DECL_NAME for a - USING_DECL, instead of print_tree_identifier. - -2003-06-29 Gabriel Dos Reis - - * cp-tree.h (language_to_string): Adjust declaration. - * dump.c (cp_dump_tree): Adjust usage. - * error.c (dump_char): Use output_formatted_scalar. Tidy. - (parm_to_string): Lose unused parameter. Tidy. - (expr_to_string): Likewise. - (code_to_string): Likewise. - (language_to_string): Likewise. - (op_to_string): Likewise. - (assop_to_string): Likewise. - (digit_buffer): Remove. - (dump_type): Format builtin vector type as __vector__. - -2003-06-29 Gabriel Dos Reis - - * error.c (print_integer): Remove. - (dump_type_suffix): Adjust. - (dump_expr): Likewise. - -2003-06-28 Nathan Sidwell - - * error.c (print_instantiation_partial_context): Take a - location_t. - (print_instantiation_full_context): Adjust. - (print_instantiation_context): Adjust. - - * cp-tree.h (cp_line_of, cp_file_of): Remove. - * error.c (cp_line_of, cp_file_of): Merge into ... - (location_of): ... here. Make static, return a location_t. - (cp_error_at, cp_warning_at, cp_pedwarn_at): Adjust. - -2003-06-28 Nathan Sidwell - - PR c++/10784 - * call.c (joust): Move warn_conversion check outwards. - -2003-06-27 Zack Weinberg - - * decl.c (build_typename_type) - * mangle.c (write_template_template_arg) - * parser.c (cp_parser_scope_through_which_access_occurs) - * pt.c (push_access_scope_real, push_access_scope, pop_access_scope) - * repo.c (get_base_filename) - * semantics.c (maybe_convert_cond): - Mark the definition static, matching the forward declaration. - -2003-06-27 Mark Mitchell - - PR c++/10468 - * pt.c (tsubst): Handle qualified TYPEOF_TYPEs correctly. - -2003-06-27 Mark Mitchell - - PR c++/10796 - * decl.c (finish_enum): Implement DR377. - - * decl.c (cp_finish_decl): Don't make variables with reference - type readonly while they are being initialized. - -2003-06-26 Mark Mitchell - - PR c++/11332 - * typeck.c (build_static_cast): Avoid returning expressions with - reference type. - -2003-06-26 Nathan Sidwell - - * call.c (build_op_delete_call): Use strip_array_call. Correct - error message to say 'delete' or 'delete[]'. - -2003-06-26 Giovanni Bajo - - PR c++/8266 - * pt.c (check_explicit_specialization): When looking up a - template function from an identifier outside class-scope, bind - it to CP_DECL_CONTEXT. - -2003-06-25 Mark Mitchell - - PR c++/10990 - * search.c (lookup_base_r): Rely on accessible_p, rather than - trying to emulate that logic here. - - PR c++/10931 - * call.c (convert_like): Pass issue_conversion_warnings. - (convert_like_with_context): Likewise. - (convert_like_real): Add issue_conversion_warnings parameter. - (perform_direct_initialization_if_possible): New function. - * cp-tree.h (perform_direct_initialization_if_possible): Declare it. - * typeck.c (check_for_casting_away_constness): New function. - (build_static_cast): Rewrite. - -2003-06-24 Nathan Sidwell - - * call.c (enforce_access): Assert we get a binfo. - (build_op_delete_call): Pass a binfo to - perform_or_defer_access_check. - * class.c (alter_access): Likewise. - * decl.c (make_typename_type): Likewise. - (make_unbound_class_template): Likewise. - * lex.c (do_identifier): Likewise. - * method.c (hack_identifier): Likewise. - * parser.c (cp_parser_lookup_name): Likewise. - * search.c (lookup_member): Likewise. Move IDENTIFIER_CLASS_VALUE - test. - * semantics.c (finish_non_static_data_member): Likewise. - (perform_or_defer_access_check): Expect a binfo. - * typeck.c (comptypes): Expect types. - - * mangle.c (find_substitution): Don't pass a non-type to same_type_p - * friend.c (make_friend_class): Likewise. - * pt.c (check_default_tmpl_args): Likewise. - (lookup_template_class): Likewise. - -2003-06-24 Jan Hubicka - - * method.c (thunk_labelno): Move outside ifdef block to make garbage - collector happy. - -2003-06-24 Jan Hubicka - - * class.c (build_vtable): Make vtables. - * cp-tree.h (DECL_VTABLE_OR_VTT_P): New macro. - * decl2.c (output_vtable_inherit): Rename to ... - (prepare_assemble_variable): ... this one; change interface. - (maybe_emit_vtables): Do not call output_vtable_inherit. - * cp-lang.c (LANG_HOOKS_PREPARE_ASSEMBLE_VARIABLE): Define. - * cp-tree.h (prepare_assemble_variable): New. - -2003-06-23 Andrew Pinski - - * method.c: add prototype for make_alias_for_thunk. - (thunk_labelno, make_alias_for_thunk): only define - if ASM_OUTPUT_DEF is defined. - -2003-06-23 Jakub Jelinek - - * method.c (thunk_labelno): New variable. - (make_alias_for_thunk): New function. - (use_thunk): Use it if defined ASM_OUTPUT_DEF. Put the thunk - into the same section as the function it is calling. - Include gt-cp-method.h. - * Make-lang.in (gt-cp-method.h): Depend on s-gtype. - (cp/method.o): Depend on gt-cp-method.h. - * config-lang.in (gtfiles): Add $(srcdir)/cp/method.c. - -2003-06-23 Jan Hubicka - - * decl.c (register_dtor_fn): Mark cleanup as used. - * decl2.c (mark_vtable_entries): Skip nops. - * rtti.c (get_tinfo_ptr): Mark tinfo as used. - (build_dynamic_cast_1): Likewise. - (tinfo_base_init): Likewise. - (emit_tinfo_decl): Likewise. - -2003-06-23 Jakub Jelinek - - * mangle.c (hash_type): Val is the TREE_LIST itself, not a pointer - to it. - -2003-06-21 Gabriel Dos Reis - - PR c++/10784 - * call.c (joust): Warn about choosing conversion sequence only if - -Wconversion. - -2003-06-21 Gabriel Dos Reis - - PR c++/10864 - * call.c (op_error): Tidy. - * error.c (dump_expr): Properly format 'T()' when T is an - aggregate type. - -2003-06-21 Gabriel Dos Reis - - PR c++/10915 - * decl.c (grok_op_properties): Warn possible confusing conversion - only if -Wconversion. - -2003-06-20 Mark Mitchell - - PR c++/10749 - * parser.c (cp_parser_class_head): See through dependent names - when parsing a class-head. - - PR c++/10845 - * pt.c (try_class_unification): Correct handling of member class - templates. - -2003-06-20 Nathan Sidwell - - * semantics.c (genrtl_finish_function): Adjust - expand_function_end call. - -2003-06-19 Mark Mitchell - - PR c++/10939 - * pt.c (tsubst_decl): Do not try to substitute into non-dependent - functions. - (value_dependent_expression_p): Correct logic for FUNCTION_DECLs. - - PR c++/9649 - * cp-tree.h (pushdecl_class_level): Change prototype. - (push_class_level_binding): Likewise. - * decl.c (add_binding): Reject duplicate static data members. - (pushdecl_class_level): Return a value indicating whether or not - the binding was valid. - (push_class_level_binding): Likewise. - * semantics.c (finish_member_declaration): Don't keep invalid - declarations. - - PR c++/11041 - * call.c (initialize_reference): Do not use cp_finish_decl to emit - temporary variables. - * cp-tree.h (static_aggregates): Declare. - (pushdecl_top_level_and_finish): Likewise. - * decl.c (pushdecl_top_level_1): New function. - (pushdecl_top_level): Use it. - (pushdecl_top_level_and_finish): New function. - (initialize_local_var): Remove redundant code. - (cp_finish_decl): Remove support for RESULT_DECLs. Don't check - building_stmt_tree. - * decl.h (static_aggregates): Remove. - * decl2.c (get_guard): Use pushdecl_top_level_and_finish. - * rtti.c (get_tinfo_decl): Use pushdecl_top_level_and_finish. - (tinfo_base_init): Likewise. - -2003-06-19 Matt Austern - - PR c++/11228 - * init.c (build_zero_init): Assert that number of array elements - is an integer constant. - (build_default_init) Don't use build_zero_init for arrays with - variable number of elements. - -2003-06-19 Andreas Jaeger - - * cp-tree.h: Remove duplicated declarations. - -2003-06-18 Nathanael Nerode - - * pt.c: Convert to ISO C. - * semantics.c: Convert to ISO C. - -2003-06-18 Nathan Sidwell - - * cp-tree.h (comp_except_specs, compparms, cp_has_mutable_p, - at_least_as_qualified_p, more_qualified_p): Return bool. - * typeck.c: ANSIFY function definitions. - (comp_array_types): Take redeclaration bool parameter. - (comptypes): Rearrange STRICT handling. - (at_least_as_qualified_p, more_qualified_p, - comp_cv_qualification): Cache cv quals. - (compparms): Rearrange loop. - -2003-06-18 Nathan Sidwell - - * cp-tree.h (COMPARE_RELAXED): Rename to ... - (COMPARE_DERIVED): ... here. Adjust comment. - (resolve_typename_type_in_current_instantiation): Remove. - (cp_tree_equal, comptypes): Return a bool. - * cvt.c (convert_to_reference): Adjust comptypes call. - * pt.c (template_args_equal, unify,): Adjust cp_tree_equal call. - (resolve_typename_type_in_current_instantiation): Remove. - * tree.c (cp_tree_equal): Return bool. Cope with TEMPLATE_DECLs and - IDENTIFIER_NODEs. Abort if undeciderable. Adjust recursive - calls. Refactor code. - * typeck.c (comp_array_types): Return bool. Lose callback. - parameter. Adjust cp_tree_equal calls. - (comptypes): Return bool. Adjust strict handling. Remove relaxed - enumeration and java type handling. Deal with typename types here. - Adjust recursive and cp_tree_equals calls. Adjust base and derived - checking. - (comp_target_types): Remove unreachable code. Adjust - same_or_base_type_p calls. - (ptr_reasonably_similar): Adjust base and derived check. - - * typeck.c (maybe_warn_about_returning_address_of_local): Remove - unused calculation. - (check_return_expr): Adjust error messages. - * cp-tree.def (SCOPE_REF): Correct comment. - -2003-06-17 Mark Mitchell - - * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format - string again. - -2003-06-17 Robert Abeles - - * optimize.c (dump_function): Form complete flag name by - prefixing 'fdump-' to string returned by dump_flag_name(). - -2003-06-17 Mark Mitchell - - * mangle.c (mangle_conv_op_name_for_type): Correct sprintf format - string. - -2003-06-17 Jason Merrill - - PR c++/10929 - * decl.c (grokfndecl): Don't mark a function inline for - -finline-functions if it isn't defined. - -2003-06-17 Mark Mitchell - - PR c++/10712 - * class.c (handle_using_decl): Robustify. - - PR c++/11105 - * cp-tree.h (DECL_CONV_FN_TYPE): New method. - * mangle.c (struct globals): Remove internal_mangling_p. - (write_unqualified_name): Use DECL_CONV_FN_TYPE. - (write_template_parm): Don't write out the level number. - (conv_type_names): New variable. - (hash_type): New function. - (compare_type): Likewise. - (mangle_conv_op_name_for_type): Don't try to mangle conversion - operator names. - * search.c (lookup_conversion_operator): New function. - (lookup_fnfields_1): Use it. - -2003-06-17 Andreas Jaeger - - * except.c: Remove duplicate declaration of push_eh_cleanup. - - * call.c: Remove extra declaration of inhibit_warnings. - -2003-06-16 Nathanael Nerode - - 2003-06-16 Jens-Michael Hoffmann - * mangle.c: Convert to ISO C. - -2003-06-16 Kaveh R. Ghazi - - * cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR - macro. - -2003-06-16 Nathanael Nerode - - * tree.c: Convert to ISO C. - -2003-06-16 Kazu Hirata - - * cp-tree.h: Follow spelling conventions. - * mangle.c: Likewise. - * method.c: Likewise. - * parser.c: Likewise. - -2003-06-14 Nathan Sidwell - - * decl.c (start_function): Adjust init_function_start call. - * method.c (use_thunk): Likewise. - * semantics.c (genrtl_start_function): Likewise. - -2003-06-14 Neil Booth - - * Make-lang.in: Remove c-options.o. - -2003-06-13 Nathanael Nerode - - * lex.c: Convert to ISO C. - - 2003-05-19 Jens-Michael Hoffmann - * init.c: removes use of PARAMS macro. Use ISO style function - declarations. (Not copyright-significant change.) - - * rtti.c: Remove PARAMS. - - * typeck2.c: Convert to ISO C. - -2003-06-12 Mark Mitchell - - PR c++/10635 - * typeck.c (build_c_cast): Check that the destination type is - complete. - -2003-06-11 Mark Mitchell - - PR c++/10432 - * cp-tree.h (finish_declarator): Remove. - * decl.c (cp_finish_decl): Make sure to pop_nested_class even for - erroneous declarations. - * semantics.c (finish_declarator): Remove. - -2003-06-11 Roger Sayle - - * decl2.c (generate_ctor_or_dtor_function): Avoid expanding a - global static constructor/destructor if it will be empty, i.e. - either doesn't call any ctors/dtors or only calls pure or const - ctors/dtors. - -2003-06-11 Mark Mitchell - - * mangle.c (tm_p.h): Include it. - * Make-lang.in (cp/mangle.o): Depend on $(TM_P_H). - - PR c++/11131 - * tree.c (cp_cannot_inline_fn): Check for "inline" before - instantiation. - -2003-06-10 Jason Merrill - - PR c++/10968 - * pt.c (mark_decl_instantiated): Clear DECL_COMDAT. - -2003-06-10 Andrew Pinski - - * decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY. - (start_cleanup_cnt): New. - -2003-06-10 Mark Mitchell - - PR c++/11131 - * cp-tree.h (template_for_substitution): Declare. - * decl2.c (mark_used): Use it when figuring out whether or not a - function is inline. - * pt.c (template_for_substitution): Give it external linkage. - * tree.c (cp_cannot_inline_tree_fn): Instantiate as early as - possible. - -2003-06-09 Zack Weinberg - - PR 8861 - * mangle.c (write_real_cst): New function. Implement - ABI-compliant mangling of floating-point literals when - -fabi-version>=2; provide backward compatibility with 3.3 when - -fabi-version=1 (with warning). Clarify commentary. - (write_template_arg_literal): Use write_real_cst. - -2003-06-07 Andreas Jaeger - - * cp/decl.c (xref_tag): Remove undefined macro NONNESTED_CLASSES. - -2003-06-07 Neil Booth - - * cp-lang.c (LANG_HOOKS_DECODE_OPTON): Drop. - (LANG_HOOKS_HANDLE_OPTION): Override. - * cp-tree.h (cxx_init_options): Update. - * lex.c (cxx_init_options): Update. - -2003-06-05 Jan Hubicka - - * Make-lang.in: Add support for stageprofile and stagefeedback - -2003-06-04 J"orn Rennecke - - * decl.c (grokdeclarator): Error_mark_node in, error_mark_node out. - -2003-06-04 Andreas Jaeger - - * g++spec.c (lang_specific_driver): Remove ALT_LIBM usage. - -2003-06-03 Jason Merrill - - * cp/cp-tree.h (CP_AGGREGATE_TYPE_P): Accept vectors. - - * cp/decl.c (reshape_init): Handle vectors. - - * testsuite/g++.dg/init/array10.C: New. - -2003-06-03 Kriang Lerdsuwanakij - - PR c++/10940 - * pt.c (check_explicit_specialization): Check for 'static' - earlier. - -2003-05-31 Diego Novillo - - * class.c (dump_array): Call CONSTRUCTOR_ELTS to access - the operand of a CONSTRUCTOR node. - -2003-05-31 Gabriel Dos Reis - - * decl.c (cp_binding_level::this_entity): Rename from this_class. - (cxx_scope_descriptor): New function. - (cxx_scope_debug): Likewise. - (push_binding_level): Use it. - (pop_binding_level): Likewise. - (suspend_binding_level): Likewise. - (resume_binding_level): Likewise. - (pushlevel_class): Adjust use of this_class. - (pushtag): Likewise. - (lookup_name_real): Likewise. - (global_scope_name): New variable. - (initialize_predefined_identifiers): Initialize it. - (push_namespace): Use it. - (make_cxx_scope): New function. - (pushlevel): Use it. - (pushlevel_class): Likewise. - (push_binding_level): Simplify. Loose the last two arguments. - (make_binding_level): Remove. - (initial_push__namespace_scope): New function. - (push_namespace): Use it. Simplify. - (cxx_init_decl_processing): Likewise. - (declare_namespace_level): Remove. - -2003-05-31 Kriang Lerdsuwanakij - - PR c++/10956 - * pt.c (instantiate_decl): Don't use full template arguments if - we are dealing with specializations. - -2003-05-29 Gabriel Dos Reis - - * decl.c (ENABLE_SCOPE_CHECKING): Rename from DEBUG_BINDING_LEVELS. - (binding_depth): Unconditionally define. - (is_class_level): Likewise. - (indent): Likewise. Take an indenting parameter. - (push_binding_level): Remove conditional definittion. - (pop_binding_level): Likewise. - (suspend_binding_level): Likewise. - (resume_binding_level): Likewise. - (pushlevel): Likewise. - (pushlevel_class): Likewise. - (poplevel_class): Likewise. - (pop_everything): Likewise. - -2003-05-27 Gabriel Dos Reis - - * name-lookup.h (global_scope_p): New macro. - * decl.c (pop_binding_level): Use it. Don't refer directly to - global_binding_level. - (suspend_binding_level): Likewise. - (global_bindings_p): Likewise. - (print_other_binding_stack): Likewise. - (print_binding_stack): Likewise. - (maybe_push_to_top_level): Likewise. - (pushdecl_namespace_level): Likewise. - (cxx_init_decl_processing): Likewise. - (start_decl): Likewise. - (cp_finish_decl): Likewise. - (start_function): Likewise. - (global_binding_level): Remove. - -2003-05-25 Kriang Lerdsuwanakij - - * parser.c (cp_parser_explicit_instantiation): Restore old - access before template instantiation. - -2003-05-23 Geoffrey Keating - - * lang-specs.h: Use -o to specify preprocessor's output file. - Make -no-integrated-cpp work when building PCH files. - -2003-05-23 Kriang Lerdsuwanakij - - PR c++/10682 - * pt.c (instantiate_class_template): Use DECL_ARTIFICIAL to - check for implicitly created typedef to an enum. - -2003-05-21 Jason Merrill - - * init.c (build_vec_delete): Copy the address into a temporary - variable before calling build_vec_delete_1. - * decl2.c (delete_sanity): Don't call stabilize_reference. - -2003-05-21 Nathan Sidwell - - * pt.c (register_specialization): Update the decl's location, - if necessary. - (check_explicit_specialization): Likewise. - -2003-05-20 Kaveh R. Ghazi - - * error.c (dump_expr): Use HOST_WIDE_INT_PRINT_DOUBLE_HEX. - -2003-05-21 Danny Smith - - PR c++/9738 - * decl.c (duplicate_decls): Re-invoke make_decl_rtl - if the old decl had instantiated DECL_RTL. - (Base on Richard Henderson 2003-05-13 patch to c-decl.c). - -2003-05-19 Matt Austern - - * lang-options.h: Document -Wno-invalid-offsetof - * typeck.c (build_class_member_access_expr): Don't complain about - (Foo *)p->x for non-POD Foo if warn_invalid_offset is zero. - -2003-05-18 Andrew Pinski - - * name-lookup.c (free_binding_entry): fix where the GTY markers are. - (binding_entry_make): Make entry->chain NULL after getting an entry. - fix the spelling of chain in a comment. - (binding_table_free): speed up by having temporary variable. - (binding_table_new): set table->chain to be NULL after allocating - a table. - (cxx_binding_make): use gcc_alloc instead of ggc_alloc_cleared and set - binding->previous to NULL after getting an binding for speed. - -2003-05-18 Gabriel Dos Reis - - * cp-tree.h (struct lang_type_class): Replace data member tags - with hash-table nested_udts. - (CLASSTYPE_NESTED_UTDS): Rename from CLASSTYPE_TAGS. - * class.c (unreverse_member_declarations): Don't touch - CLASSTYPE_TAGS. - (pushclass): Use cxx_remember_type_decls. - * decl.c (struct cp_binding_level): Replace data member tags with - hash-table type_decls. - (pop_binding_level): Handle level->type_decls. - (kept_level_p): Adjust. - (poplevel): Remove unused local variable. - (bt_print_entry): New function. - (print_binding_level): Use it. - (push_namespace): Build current_binding_level->type_decls. - (maybe_process_template_type_declaration): Adjust. - (pushtag): Likewise. - (clear_anon_tags): Use binding_table_remove_anonymous_types. - (gettags): Remove. - (cxx_remember_type_decls): Rename from storetags. Adjust. - (lookup_tag): Use binding_table_find_anon_type. Tidy. - (lookup_tag_reverse): Use binding_table_reverse_maybe_remap. - (cxx_init_decl_processing): Build global_binding_level->type_decls. - (store_parm_decls): Remove pointless code. - * name-lookup.c (free_binding_entry): New variable. - (ENTRY_INDEX): New macro. - (struct binding_table_s): New datatype. - (binding_entry_make): New function. - (binding_entry_free): Likewise. - (binding_table_construct): Likewise. - (binding_table_free): Likewise. - (binding_table_new): Likewise. - (binding_table_expand): Likewise. - (binding_table_insert): Likewise. - (binding_table_find): Likewise. - (binding_table_find_anon_type): Likewise. - (binding_table_reverse_maybe_remap): Likewise. - (binding_table_remove_anonymous_types): Likewise. - (binding_table_foreach): Likewise. - * name-lookup.h (binding_table): New type. - (binding_entry): Likewise. - (bt_foreach_proc): Likewise. - (struct binding_entry_s): New datatype. - (SCOPE_DEFAULT_HT_SIZE): New macro. - (CLASS_SCOPE_HT_SIZE): Likewise. - (NAMESPACE_ORDINARY_HT_SIZE): Likewise. - (NAMESPACE_STD_HT_SIZE): Likewise. - (GLOBAL_SCOPE_HT_SIZE): Likewise. - (binding_table_new): Declare. - (binding_table_free): Likewise. - (binding_table_insert): Likewise. - (binding_table_find_anon_type): Likewise. - (binding_table_reverse_maybe_remap): Likewise. - (binding_table_remove_anonymous_types): Likewise. - (binding_table_foreach): Likewise. - (binding_table_find): Likewise. - (cxx_remember_type_decls): Likewise. - * pt.c (bt_instantiate_type_proc): New function. - (do_type_instantiation): Use it. - * search.c (lookup_field_r): Use binding_table_find. - -2003-05-18 Kriang Lerdsuwanakij - - * semantics.c (perform_deferred_access_checks): Don't discard - checked access. - -2003-05-17 Kaveh R. Ghazi - - * error.c (cp_error_at, cp_warning_at, cp_pedwarn_at): Eliminate - libiberty VA_ macros, always use stdarg. - * rtti.c (create_pseudo_type_info): Likewise. - * tree.c (build_min_nt, build_min): Likewise. - -2003-05-16 Kaveh R. Ghazi - - * ptree.c (cxx_print_type, cxx_print_xnode): Use string - concatentation on HOST_WIDE_INT_PRINT_* format specifier to - collapse multiple function calls into one. - * tree.c (debug_binfo): Likewise. - -2003-05-15 Jason Merrill - - PR c++/5388 - * call.c (conditional_conversion): Don't consider implicit - conversions if T2 is a base of T1. - * cp-tree.h (DERIVED_FROM_P, UNIQUELY_DERIVED_FROM_P): Make boolean. - (ACCESSIBLY_UNIQUELY_DERIVED_P, PUBLICLY_UNIQUELY_DERIVED_P): Likewise. - - * parser.c (cp_parser_primary_expression): Convert a static data - member from reference. - -2003-05-15 Mark Mitchell - - * call.c (build_op_delete_call): Avoid creating unnecessary types. - * class.c (instantiate_type): Remove tests for tf_no_attributes. - * cp-tree.h (tsubst_flags_t): Remove tf_no_attributes. - (COMPARE_NO_ATTRIBUTES): Remove. - * typeck.c (comptypes): Do not check COMPARE_NO_ATTRIBUTES. - - PR c++/8385 - * semantics.c (finish_typeof): Refine type-dependency check. - -2003-05-13 Jason Merrill - - * typeck.c (build_modify_expr): Don't always stabilize the lhs and - rhs. Do stabilize the lhs of a MODIFY_EXPR used on the lhs. - -2003-05-11 Kriang Lerdsuwanakij - - * method.c (synthesize_method): Call push/pop_deferring_access_checks. - -2003-05-11 Kriang Lerdsuwanakij - - PR c++/10230, c++/10481 - * semantics.c (finish_non_static_data_member): Handle when the - non-static member is not from a base of the current class type. - -2003-05-11 Kriang Lerdsuwanakij - - PR c++/10552 - * pt.c (tsubst_copy): Handle TEMPLATE_DECL that is a member class - template and has dependent context. - -2003-05-10 Kriang Lerdsuwanakij - - * pt.c (instantiate_decl): Call push/pop_deferring_access_checks. - -2003-05-10 Kriang Lerdsuwanakij - - PR c++/9252 - * cp-tree.h (saved_scope): Remove check_access field. - (tsubst_flags_t): Remove tf_parsing. - * decl.c (maybe_push_to_top_level): Don't initialize - scope_chain->check_access. - (make_typename_type, make_unbound_class_template): Don't use - tf_parsing. - (register_dtor_fn): Use push/pop_deferring_access_checks - instead of scope_chain->check_access. - * method.c (use_thunk): Likewise. - * parser.c (cp_parser_explicit_instantiation - (cp_parser_constructor_declarator_p): Don't call - push/pop_deferring_access_checks here. - (cp_parser_template_argument, cp_parser_class_name): Don't use - tf_parsing. - (yyparse): Check flag_access_control. - * pt.c (instantiate_class_template): Call - push/pop_deferring_access_checks. - * semantics.c (push_deferring_access_checks): Propagate - dk_no_check. - (perform_or_defer_access_check): Make sure basetype_path is - a type before comparison. - * call.c (build_op_delete_call, build_over_call): Use - perform_or_defer_access_check. - * class.c (alter_access): Likewise. - * init.c (build_offset_ref): Likewise. - * lex.c (do_identifier): Likewise. - * method.c (hack_identifier): Likewise. - * search.c (lookup_member): Likewise. - * semantics.c (finish_non_static_data_member): Likewise. - (simplify_aggr_init_exprs_r): Use push/pop_deferring_access_checks - instead of flag_access_control. - -2003-05-10 Kriang Lerdsuwanakij - - PR c++/9554 - * parser.c (cp_parser_class_name): Remove check_access parameter. - All caller adjusted. Update declaration. - (cp_parser_lookup_name): Likewise. - * semantics.c (push_deferring_access_checks): Change parameter type - to enum deferring_kind. All caller adjusted. - (resume_deferring_access_checks): Adjust to use new enum. - (stop_deferring_access_checks): Likewise. - (perform_or_defer_access_check): Likewise. - * cp-tree.h (deferring_kind): New enum. - (deferred_access): Adjust field type. - (push_deferring_access_checks): Update declaration. - -2003-05-09 Kriang Lerdsuwanakij - - PR c++/10555, c++/10576 - * pt.c (lookup_template_class): Handle class template with - multiple levels of parameters when one of the levels contain - errors. - -2003-05-08 Jason Merrill - - * init.c (build_new_1): Don't reuse a TARGET_EXPR in an - expression. Undo some of the recent reorg. - -2003-05-07 Richard Henderson - - PR c++/10570 - * cfns.gperf: Comment out POSIX thread cancellation points, - plus abort and raise. - * cfns.h: Regenerate. - -2003-05-07 Jason Merrill - - * call.c (build_conditional_expr): Don't assume that the folded - expression has result_type. - -2003-05-06 Kriang Lerdsuwanakij - - * typeck.c (build_unary_op): Deal with const qualifier in - invalid pointer-to-member earlier. - -2003-05-05 Jason Merrill - - PR c++/9537 - * call.c (conditional_conversion): Build an RVALUE_CONV if - we're just changing the cv-quals. - (build_conditional_expr): Don't call convert to change - cv-quals. - -2003-05-05 Kriang Lerdsuwanakij - - PR c++/10496 - * typeck.c (build_unary_op): Don't output const qualifier when - output invalid pointer-to-member diagnostics. - -2003-05-05 Kriang Lerdsuwanakij - - * decl.c: Fix typos. - -2003-05-05 Kriang Lerdsuwanakij - - PR c++/4494 - * decl.c (start_function): Use same_type_p to check return type - of main. - -2003-05-03 Zack Weinberg - - PR c/10604 - * cp/typeck.c (build_x_compound_expr): No need to check - extra_warnings as well as warn_unused_value. - -2003-05-03 Kriang Lerdsuwanakij - - PR c++/9364, c++/10553, c++/10586 - * decl.c (make_typename_type): Don't crash on illegal code. - -2003-05-03 Nathan Sidwell - - * class.c (finish_struct): Use location_t and input_location - directly. - * decl.c (make_label_decl): Likewise. - (use_label): Likewise. - * decl2.c (warn_if_unknown_interface): Likewise. - (start_static_initialization_or_destruction): Likewise. - (generate_ctor_or_dtor_function): Likewise. - (finish_file): Likewise. - * error.c (print_instantiation_full_context): Likewise. - * init.c (create_temporary_var): Likewise. - * method.c (synthesize_method): Likewise. - * parser.c (cp_token): Likewise. - (cp_lexer_set_source_position_from_token): Likewise. - (cp_lexer_get_preprocessor_token): Likewise. - (cp_parser_statement): Likewise. - * pt.c (tsubst_friend_function): Likewise. - (instantiate_class_template): Likewise. - (tsubst_decl): Likewise. - (tsubst): Likewise. - (instantiate_decl): Likewise. - * semantics.c (begin_class_definition): Likewise. - (expand_body): Likewise. - -2003-05-01 Nathan Sidwell - - * class.c (finish_struct): Rename lineno to input_line. - * decl.c (push_binding_level, pop_binding_level, - suspend_binding_level, resume_binding_level, make_label_decl, - use_label, start_function): Likewise. - * decl2.c (warn_if_unknown_interface, - start_static_initialization_or_destruction, - generate_ctor_or_dtor_function, finish_file): Likewise. - * error.c (cp_line_of, print_instantiation_full_context, - print_instantiation_context): Likewise. - * except.c (check_handlers_1, check_handlers): Likewise. - * init.c (create_temporary_var): Likewise. - * method.c (use_thunk, synthesize_method): Likewise. - * parser.c (cp_lexer_set_source_position_from_token, - cp_lexer_get_preprocessor_token): Likewise. - * pt.c (push_tinst_level, pop_tinst_level, - tsubst_friend_function, instantiate_class_template, tsubst_decl, - tsubst, tsubst_expr, instantiate_decl): Likewise. - * semantics.c (genrtl_try_block, finish_label_stmt, - begin_class_definition, expand_body, - genrtl_finish_function): Likewise. - * tree.c (build_min_nt, build_min): Likewise. - -2003-05-01 Mark Mitchell - - * decl2.c (comdat_linkage): Don't externalize explicit - instantiations. - -2003-05-01 Kriang Lerdsuwanakij - - PR c++/10554 - * decl2.c (do_class_using_decl): Check if operand 0 of SCOPE_REF - is not NULL. - -2003-05-01 Steven Bosscher - - * cp-tree.h (struct lang_id2): Remove. Move fields from here... - (struct lang_identifier): ... to here. - (LANG_ID_FIELD): Remove. - (SET_LANG_ID): Remove. - (IDENTIFIER_LABEL_VALUE): Adjust for new lang_identifier. - (SET_IDENTIFIER_LABEL_VALUE): Likewise. - (IDENTIFIER_IMPLICIT_DECL): Likewise. - (SET_IDENTIFIERL_IMPLICIT_DECL): Likewise. - (IDENTIFIER_ERROR_LOCUS): Likewise. - (SET_IDENTIFIER_ERROR_LOCUS): Likewise. - -2003-05-01 Kriang Lerdsuwanakij - - PR c++/8772 - * pt.c (convert_template_argument): Correct diagnostic. - -2003-04-30 Kriang Lerdsuwanakij - - PR c++/9432, c++/9528 - * decl2.c (validate_nonmember_using_decl): Handle SCOPE_REF. - -2003-04-30 Garbiel Dos Reis - - * decl.c (check_previous_goto_1): Adjust prototype. - (check_previous_goto): Adjust use. - (check_switch_goto): Likewise. - (use_label): Adjust. - (check_previous_goto_1): Don't use pedwarn_with_file_and_line. - (struct named_label_use_list): Use location_t datatype. - -2003-04-29 Mark Mitchell - - PR c++/10551 - * pt.c (mark_decl_instantiated): Defer all explicit instantiations - that have not yet been written out. - -2003-04-29 Mark Mitchell - - PR c++/10549 - * class.c (layout_class_type): Mark overlong bitfields as having - the maximum size permitted by their type, after layout. - - PR c++/10527 - * error.c (dump_expr): Correctly handling of NEW_EXPR.4 - -2003-04-29 Kriang Lerdsuwanakij - - * call.c (build_operator_new_call): Fix typo. - * lang-options.h: Likewise. - -2003-04-29 Mark Mitchell - - PR c++/10515 - * cp-tree.h (lookup_field_1): Declare it. - * search.c (lookup_field_1): Make it public. - * decl.c (reshape_init): Handle designated initializers. - - * decl.c (maybe_commonize_var): Further tweak support for systems - without weak symbols. - -2003-04-27 Mark Mitchell - - * decl.c (maybe_commonize_var): Fix thinko in last patch. - -2003-04-27 Mark Mitchell - - PR c++/10506 - * method.c (use_thunk): Decrement immediate_size_expand. - - PR c++/10503 - * cp-tree.h (DECL_VAR_MARKED_P): New macro. - (DECL_MAYBE_TEMPLATE): Remove. - * class.c (fixed_type_or_null): Avoid infinite recursion. - - * decl.c (maybe_commonize_var): Make the code match the comments. - * pt.c (instantiate_decl): Move call to import_export_decl. - -2003-04-26 Mark Mitchell - - * decl2.c (finish_file): Fix merge botch. - -2003-04-25 Mark Mitchell - - * decl2.c (finish_file): Don't call import_export_decl for - functions that are not defined. - (handle_class_head): Robustify. - * pt.c (instantiate_decl): Do not call cp_finish_decl for - variables that are not defined. - -2003-04-24 Sylvain Pion - - * call.c (print_z_candidates): Fix off by one error. - -2003-04-24 Nathan Sidwell - - PR c++/10337 - * call.c (joust): Don't warn about conversion ops that are exact - or cv-conversions. Rearrange to avoid multiple type comparisons. - -2003-04-23 Mark Mitchell - - PR c++/10471 - * call.c (build_cxx_call): Robustify. - -2003-04-23 Neil Booth - - * Make-lang.in (lex.o): Remove mbchar.h. - * lex.c (MULTIBYTE_CHARS): Lose. - * parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled - in c-lex.c. - -2003-04-23 Mark Mitchell - - PR c++/9847 - * cp-tree.h (duplicate_tag_error): Remove. - * class.c (duplicate_tag_error): Remove. - * semantics.c (begin_class_definition): Return immediately for a - duplicate class definition. - - PR c++/10451 - * decl.c (grokdeclarator): Correct logic for "mutable" errors. - -2003-04-22 Mark Mitchell - - PR c++/10446 - * search.c (lookup_fnfields_1): Handle empty slots in the method - vector. - - PR c++/10428 - * decl.c (check_elaborated_type_specifier): New function, split - out from ... - (xref_tag): ... here. Use the new function in more places. - - * rtti.c (throw_bad_typeid): Use build_cxx_call. - -2003-04-21 Mark Mitchell - - * call.c (build_over_call): Use build_cxx_call. - (build_cxx_call): New method, split out of build_over_call. - * cp-tree.h (language_function): Add can_throw. - (build_cxx_call): Declare it. - * decl.c (finish_function): If a function does not contain any - calls to functions that can throw an exception, indicate that - fact. - * decl2.c (mark_used): Do not defer the instantiation of - functions, if the current function does not throw. - * optimize.c (maybe_clone_body): Copy TREE_NOTHROW to the clones. - * pt.c (instantiate_decl): Make sure import_export_decl is called - before emitting things. - * rtti.c (throw_bad_cast): Use build_cxx_call. - (build_dynamic_cast_1): Likewise. - * typeck.c (build_function_call): Likewise. - -2003-04-21 Nathan Sidwell - - PR c++/9881 - * typeck.c (build_unary_op): Fold all COMPONENT_REF addr - expressions. Reverts my 2002-08-08 patch. - - * typeck.c (comp_ptr_ttypes_real): Swap final && operands for - cheaper early exit. - -2003-04-20 Nathan Sidwell - - * cp/decl2.c (start_static_storage_duration_function): Take count - arg, don't check if it wraps round. - (generate_ctor_or_dtor_function): Add locus arg, use it. - (generate_ctor_and_dtor_functions_for_priority): Data arg is a - locus. - (finish_file): Set line numbers to past EOF for synthesized - functions. - -2003-04-20 Nathan Sidwell - - PR c++/10405 - * search.c (lookup_field_1): Final scan goes backwards for - types, forwards for non-types. - -2003-04-17 Roger Sayle - - PR c/10375 - * decl.c (duplicate_decls): Preserve "const", "noreturn" and - "nothrow" function attributes. - -2003-04-17 Kriang Lerdsuwanakij - - PR c++/10347 - * pt.c (type_dependent_expression_p): Handle array new. - -2003-04-15 Mark Mitchell - - PR c++/10381 - * parser.c (cp_parser_primary_expression): Reorganize logic for - dealing with name lookup failures. - -2003-04-15 Jason Merrill - - * decl2.c (mark_used): Don't instantiate anything if - skip_evaluation. - -2003-04-14 Ziemowit Laski - - * tree.c (build_cplus_array_type_1): Do not call - uses_template_parms() on a NULL index_type. - -2003-04-13 Roger Sayle - - * decl.c (duplicate_decls): Preserve pure and malloc attributes. - -2003-04-12 Mark Mitchell - - PR c++/10300 - * init.c (build_new_1): Reorganize. - -2003-04-12 Zack Weinberg - - * class.c (initialize_array) - * decl.c (reshape_init) - * decl2.c (build_expr_from_tree) - * init.c (build_zero_init) - * pt.c (tsubst_copy, tsubst_copy_and_build) - * rtti.c (tinfo_base_init, generic_initializer, ptr_initializer) - (ptm_initializer, class_initializer, get_pseudo_ti_init) - * semantics.c (finish_compound_literal) - * typeck.c (build_ptrmemfunc1) - * typeck2.c (store_init_value, process_init_constructor) - (build_functional_cast): Use build_constructor. - -2003-04-12 Zack Weinberg - - * call.c (print_z_candidates): Use gcc_gettext_width, not - strlen, to determine how much padding to use. - -2003-04-10 Zack Weinberg - - * decl.c: Update all calls to shadow_warning. - -2003-04-10 Mark Mitchell - - * class.c (layout_class_type): Correct handling for overlong - bit-fields whose width is the same as an integer type. - -2003-04-06 Zack Weinberg - - * cp-tree.def: Make fourth element for all 'c' and 'x' nodes zero. - * cp-lang.c (cp_tree_size): New function. - (LANG_HOOKS_TREE_SIZE): Override. - - * cp-tree.h (SOURCE_LOCUS, SRCLOC_FILE, SRCLOC_LINE, struct - tree_srcloc, TS_CP_COMMON, TS_CP_SRCLOC): Kill. - (union lang_tree_node): Remove common and srcloc members. - (build_srcloc_here): Don't prototype. - * decl.c (cp_tree_node_structure): Kill SRCLOC case. - * pt.c (pending_templates): Correct comment. - * tree.c (build_srcloc, build_srcloc_here): Kill. - -2003-04-06 Zack Weinberg - - * call.c: Include intl.h. - (print_z_candidate): Always use inform; get rid of errfn - argument. Reorganize so that all the strings get picked up - by xgettext. Note obligation of caller to pass first argument - through gettext. - (print_z_candidates): Update to match. Indent second and - successive candidates by strlen() of translated message. - (joust): Restructure ambiguous-conversion pedwarn so that - translators see a complete sentence. Update calls to - print_z_candidate. - - * Make-lang.in (cp/call.o): Update dependencies. - -2003-04-05 Kaveh R. Ghazi - - * decl.c (set_current_binding_level): Delete, revert last change. - (current_binding_level): Modify to allow it as as lvalue. - -2003-04-04 Kaveh R. Ghazi - - * name-lookup.c (find_binding): Pass appropriate pointer type to - POP_TIMEVAR_AND_RETURN. - -2003-04-03 Kaveh R. Ghazi - - * Make-lang.in (cp-warn): Add $(STRICT_WARN). - * cp-tree.h: Don't insist on having GNUC. - -2003-04-03 Jason Merrill - - * cvt.c (ocp_convert): Only abort if we try to convert an object - of TREE_ADDRESSABLE type. - - * class.c (build_vtable): Set DECL_ALIGN here. - (get_vtable_decl): Not here. - (layout_vtable_decl): Or here. - (create_vtable_ptr): Or here. - (layout_class_type): Or here. - (check_bitfield_decl): Don't mess with field alignment. - -2003-04-03 Kaveh R. Ghazi - - * operators.def (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR, - DEF_ASSN_OPERATOR): Delete spurious semi-colon. - * rtti.c (dfs_class_hint_mark): Likewise. - - * decl.c (push_local_name, push_class_level_binding, - maybe_inject_for_scope_var): Don't use POP_TIMEVAR_AND_RETURN in - functions returning void. - * decl2.c (add_using_namespace): Likewise. - - * decl.c (print_binding_level, print_other_binding_stack, - print_binding_stack): Cast argument of %p specifier to void*. - * ptree.c (cxx_print_decl): Likewise. - - * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK, - VAR_FUNCTION_OR_PARM_DECL_CHECK, - VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK, RECORD_OR_UNION_TYPE_CHECK, - BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK, LANG_TYPE_CLASS_CHECK, - LANG_TYPE_PTRMEM_CHECK, LANG_DECL_U2_CHECK): Add __extension__. - - * decl.c (set_current_binding_level): New macro. Use throughout - when setting the current binding level. - - * cp-tree.h (cp_lvalue_kind, base_access): Delete trailing comma - in enum. - * method.c (mangling_flags): Likewise. - - * cp-tree.h (lang_type_header): Add __extension__ and use - CHAR_BITFIELD for members. - -2003-04-02 Geoffrey Keating - - PR other/9274 - * mangle.c: Include gt-cp-mangle.h. - (subst_identifiers): Mark with GTY. - * config-lang.in (gtfiles): Add cp/mangle.c. - * Make-lang.in: (gt-cp-mangle.h): New rule. - (cp/mangle.o): Depends on gt-cp-mangle.h. - -2003-04-01 Andrew Pinski - - * config-lang.in (gtfiles): Add \$(srcdir)/cp/name-lookup.c - after \$(srcdir)/cp/name-lookup.h. - * name-lookup.c: (cxx_binding_make): Use ggc_alloc_clearedinstead - of ggc_alloc. Include gt-cp-name-lookup.h at the end of the file. - * Make-lang.in: (gt-cp-name-lookup.h): Is generated by gengtype. - (cp/name-lookup.o): Depends on gt-cp-name-lookup.h. - -2003-03-31 Jason Merrill - - PR java/10145 - * class.c (check_field_decl): Don't set DECL_ALIGN. - -2003-03-30 Mark Mitchell - - PR c++/7647 - * decl.c (grokdeclarator): Tidy, slightly. - * search.c (lookup_field_1): Add want_type parameter. - (lookup_field_r): Adjust call to lookup_field_1. - -2003-03-30 Gabriel Dos Reis - - * Make-lang.in (cp/name-lookup.o): Add more dependencies. - -2003-03-30 Gabriel Dos Reis - - * cp-tree.h (binding_for_name: Move to name-lookup.h Adjust - prototype. - (cxx_scope_find_binding_for_name): Likewise. - * decl.c (find_binding: Move to name-lookup.c. - (binding_for_name): Likewise. - (cxx_scope_find_binding_for_name): Likewise. - (BINDING_LEVEL): Remove. - (push_binding): Tidy. - (push_class_binding): Likewise. - (pop_binding): Likewise. - (poplevel): Likewise. - (poplevel_class): Likewise. - (set_identifier_type_value_with_scope): Likewise. - (push_overloaded_decl): Likewise. - (lookup_tag): Likewise. - (unqualified_namespace_lookup): Likewise. - (lookup_name_current_level): Likewise. - (maybe_inject_for_scope_var): Likewise. - (namespace_binding): Move to name-lookup.c. - (set_namespace_binding): Likewise. - * decl2.c (lookup_using_namespace): Tidy. - (qualified_lookup_using_namespace): Likewise. - (do_toplevel_using_decl): Likewise. - * name-lookup.c: Include "timevar.h" - * name-lookup.h (cxx_scope): Declare. - (struct cxx_binding): Lose member "has_level". Adjust "scope" - member declaration. - (BINDING_SCOPE): Adjust definition. - (BINDING_HAS_LEVEL_P): Remove. - -2003-03-30 Gabriel Dos Reis - - * name-lookup.c: New file. - * name-lookup.h: Likewise.. - * decl.c (push_binding): Adjust use cxx_binding_make. - (free_bindings): Move to name-lookup.c - (pop_binding): Use cxx_binding_free. - (binding_for_name): Tidy. - * cp-tree.h: Include "name-lookup.h" - (cxx_binding_make): Move to name-lookup.h - (cxx_binding_clear): Likewise. - (struct cxx_binding): Likewise. - (LOCAL_BINDING_P): Likewise. - (INHERITED_VALUE_BINDING_P): Likewise. - (BINDING_SCOPE): Likewise. - (BINDING_HAS_LEVEL_P): Likewise. - (BINDING_VALUE): Likewise. - (BINDING_TYPE): Likewise. - * config-lang.in (gtfiles): Add cp/name-lookup.h - * Make-lang.in (cp/name-lookup.o): New rule. - (CXX_OBJS): Add cp/name-lookup.o - (CXX_TREE_H): Add cp/name-lookup.h - -2003-03-28 Jason Merrill - - PR c++/10245 - * cvt.c (force_rvalue): New fn. - * call.c (build_conditional_expr): Use it. - * cp-tree.h: Declare it. - -2003-03-28 Mike Stump - - * error.c (dump_expr): Add 0x to printed hex numbers to make - output match source code better. - -2003-03-28 Mark Mitchell - - PR c++/10218 - * decl.c (grokfndecl): Return NULL_TREE for bogus out-of-class - definitions. - - * decl2.c (generate_ctor_or_dtor_function): Tolerate a - non-existant ssdf_decls array. - (finish_file): Call generator_ctor_or_dtor_function when there are - static constructors or destructors and no other static - initializations. - -2003-03-28 Nathan Sidwell - - PR c++/10047 - * decl2.c (finish_file): Don't warn about explicitly instantiated - inline decls. - -2003-03-27 Nathan Sidwell - - PR c++/10224 - * pt.c (lookup_template_class): Only check instantiated args if - they do not contain template parameters. - -2003-03-27 Nathan Sidwell - - PR c++/10158 - * parser.c (cp_parser_function_definition): Set - DECL_INITIALIZED_IN_CLASS for members. - * pt.c (instantiate_decl): Only reduce the template args for - friends that are not defined in class. - -2003-03-25 Jason Merrill - - * call.c (print_z_candidate): Change name of first arg to msgid. - (joust): Add comment for translators. - -2003-03-24 Nathan Sidwell - - PR c++/9898, PR c++/383, DR 322 - * pt.c (maybe_adjust_types_for_deduction) : Look - through reference types on both PARM and ARG. - -2003-03-24 Nathan Sidwell - - PR c++/10119 - * error.c (dump_expr) : Use dump_expr. - * pt.c (maybe_fold_nontype_args): New function. - (tsubst_copy) : Subst any template_id args. - : Break out folding code, call it. - (tsubst_copy_and_build) : Call - maybe_fold_nontype_args. - -2003-03-24 Nathan Sidwell - - PR c++/10026 - * decl2.c (arg_assoc_type) : Don't die. - -2003-03-23 Mark Mitchell - - PR c++/7086 - * typeck.c (cxx_mark_addressable): Adjust call to - gen_mem_addressof or put_var_into_stack. - -2003-03-22 Nathan Sidwell - - PR c++/9978, c++/9708 - * cp-tree.h (instantiate_template): Add tsubst_flags parameter. - * call.c (add_template_candidate_real): Adjust - instantiate_template call. - * class.c (resolve_address_of_overloaded_function): Likewise. - * decl.c (build_enumerator): Set TREE_CONSTANT. - * pt.c (check_instantiated_args): New. - (push_inline_template_parms_recursive): Set TREE_CONSTANT, - TREE_READONLY. - (build_template_parm_index): Copy TREE_CONSTANT, TREE_READONLY. - (reduce_template_parm_level): Likewise. - (process_template_parm): Likewise. - (check_explicit_specialization): Adjust instantiate_template call. - (convert_template_argument): Don't check non-type argument here. - (lookup_template_class): Check them here. - (tsubst_friend_function): Adjust instantiate_template call. - (instantiate_template): Add tsubst_flags parameter, use it. Check - instantiated args. - -2003-03-21 Zack Weinberg - - * decl.c: Update calls to shadow_warning. - -2003-03-21 Nathan Sidwell - - PR c++/9898 - * error.c (dump_decl) [CONST_DECL]: Print ''. - (dump_expr) [CONSTRUCTOR]: Print default ctor as a function call. - -2003-03-20 Mark Mitchell - - * cp/decl2.c (arg_assoc_class): Correct check for namespace-scope - friends. - * cp/pt.c (instantiate_class_template): Fix formatting. - -2003-03-14 Matt Austern - - * cp-tree.h (unemitted_tinfo_decls): Declaration of a new varray. - (unemitted_tinfo_decl_p): Remove. - (emit_tinfo_decl): Change declaration to remove unused parameter. - * decl2.c (finish_file): Change tinfo emission to loop through - unemitted_tinfo_decls array instead of looping through all decls. - * rtti.c (unemitted_tinfo_decl_p): Declare as static, remove - unused second parameter. - (init_rtti_processing): initialize unemitted_tinfo_decls varray. - (get_tinfo_decls): push new tinfo decl on unemitted_tinfo_decls. - (emit_tinfo_decl): remove unused second parameter, add assertion - that decl hasn't already been emitted. - -2003-03-19 Nathanael Nerode - - * dump.c (cp_dump_tree), cp-tree.h (cp_dump_tree): Change return - type from 'int' to 'bool'. Replace 0 and 1 with true and false in - return statements. - -2003-03-19 Jason Merrill - - PR c++/8316, c++/9315, c++/10136 - * call.c (print_z_candidate): Split out from... - (print_z_candidiates): ...here. - (joust): Use it. - -2003-03-17 Roger Sayle - - PR c++/10031 - * decl.c (duplicate_decls): Use the new type when prototyping - anticipated decls, even when the types match. This defines the - exception list for the built-in function. - -2003-03-17 Jason Merrill - - PR c++/10091 - * typeck.c (build_class_member_access_expr): Compare - TYPE_MAIN_VARIANTs. - -2003-03-17 Mark Mitchell - - PR c++/9639 - * parser.c (cp_parser_declarator_id): Clear parser->scope. - -2003-03-16 Jason Merrill - - PR c++/9993 - * decl.c (finish_function): Only allow the NRVO to use variables - declared at function scope. - -2003-03-17 Andreas Jaeger - - * Make-lang.in (cp/TAGS): Remove. - -2003-03-16 Nathan Sidwell - - PR c++/9629 - * cp-tree.h (struct language_function): Add in_base_initializer. - (in_base_initializer): define it. - (expand_member_init): Remove INIT param. - * init.c (expand_member_init): Remove INIT param, return the member. - (emit_mem_initializers): Set in_base_initializer. - * class.c (build_base_path): Check in_base_initializer. - * parser.c (cp_parser_mem_initializer): Set in_base_initializer. - * pt.c (tsubst_initializer_list): Likewise. - -2003-03-16 Gabriel Dos Reis - - * decl.c (binding_for_name): Fix initialization thinko. - -2003-03-15 Gabriel Dos Reis - - Compile-time improvement: 2/n. - * cp-tree.h (struct cxx_binding): New datatype; - (struct lang_identifier): Use it. - (LOCAL_BINDING_P): Adjust definition. - (INHERITED_VALUE_BINDING_P): Likewise. - (BINDING_SCOPE): Likewise. - (BINDING_HAS_LEVEL_P): Likewise. - (BINDING_VALUE): Likewise. - (BINDING_TYPE): Likewise. - (IDENTIFIER_VALUE): Likewise. - (struct tree_binding): Remove. - (TS_CP_BINDING): Likewise. - ((union lang_tree_node): Remove field "binding". - (cxx_binding_clear): New macro. - (binding_for_name): Adjust return type. - (qualified_lookup_using_namespace): Adjust prototype. - (lookup_using_namespace): Adjust prototype. - (cxx_scope_find_binding_for_name): Declare. - * cp-tree.def: Remove CPLUS_BINDING definition. - * decl.c (push_binding): Adjust local variable type. - (add_binding): Likewise. - (push_class_binding): Likewise. - (pop_binding): Likewise. - (poplevel): Likewise. - (poplevel_class): Likewise. - (free_bindings): Adjust type. - (find_binding): Adjust return type, add a third parameter. Remove - non-useful assertion now that we use static typing. - (cxx_scope_find_binding_for_name): New function. - (binding_for_name): Use it. Adjust local variable type. Simplify. - (namespace_binding): Simplify. - (set_namespace_binding): Likewise. - (set_identifier_type_value_with_scope): Adjust local variable type. - (lookup_tag): Don't type-abuse of local variable 'old'. - (lookup_namespace_name): Likewise. Allocate binding on stack. - (select_decl): Adjust prototype. - (unqualified_namespace_lookup): Allocate binding on stack. - Don't type-abuse of local variable 'val'. - (lookup_name_real): Likewise. - (maybe_inject_for_scope_var): Adjust local variable type. - (cp_tree_node_structure): Remove CPLUS_BINDING case label. - (namespace_binding): Adjust logic, simplify. - (BINDING_LEVEL): Adjust definition. - (push_class_level_binding): Adjust local variable type. - (struct cxx_saved_binding): Adjust field 'binding' type. - * decl2.c (ambiguous_decl): Adjust prototype. - (lookup_using_namespace): Adjust local variable type. - (qualified_lookup_using_namespace): Catch type error and correct - ensueing logic error. - (do_nonmember_using_decl): Adjust local variable type. Allocate - temporary cxx_binding on stack. - (do_toplevel_using_decl): Adjust local variable type. - * ptree.c (cxx_print_cxx_binding): New function. - (cxx_print_identifier): Use it. - (cxx_print_xnode): Delete CPLUS_BINDING case label. - -2003-03-15 Roger Sayle - - * tree.c (count_functions): Fix whitespace. - -2003-03-15 Neil Booth - - * Make-lang.in: Update. - -2003-03-15 Kriang Lerdsuwanakij - - PR c++/6440 - * pt.c (maybe_process_partial_specialization): Handle - member class template when enclosing class template is - explicit specialized. - (most_general_template): Stop looking when DECL is already - specialized. - -2003-03-13 Jason Merrill - - PR c++/9420 - * search.c (lookup_conversions): Call complete_type here. - * call.c (implicit_conversion): Not here. - -2003-03-13 Mark Mitchell - - * decl2.c (do_nonmember_using_decl): Correct handling of - simultaneous type/non-type bindings. - - * call.c (initialize_reference): Remove bogus assertion. - * decl.c (build_ptrmemfunc_type): Revert change of 2003-03-09. - -2003-03-12 Andrew Lewycky - - PR c++/7050 - * expr.c (cxx_expand_expr): Return const0_rtx for throw - expressions. - -2003-03-11 Mark Mitchell - - PR c++/9474 - * decl2.c (do_nonmember_using_decl): Do not call duplicate decls - to merge old and new declarations. - -2003-03-12 Alexandre Oliva - - * g++.1: Remove. - * Make-lang.in (c++.generated-manpages): Build cp/g++.1. - (cp/g++.1): Build it from scratch in the build tree. - (c++.install-man): Depend on it. Install it from the build tree. - (c++.mostlyclean): Clean it. - -2003-03-11 Mark Mitchell - - PR c++/9474 - * decl2.c (do_nonmember_using_decl): Do not call duplicate decls - to merge old and new declarations. - - PR c++/9924 - * decl2.c (do_nonmember_using_decl): Ignore anticipated builtins. - -2003-03-11 Jason Merrill - - PR c++/9820 - * search.c (lookup_member): Fix handling of functions in a class - being defined. - -2003-03-11 Mark Mitchell - - PR c++/8700 - * call.c (convert_class_to_reference): Adjust usage of - splice_viable. - (any_viable): Remove. - (splice_viable): Combine with any_viable. - (print_z_candidates): Avoid printing duplicates. - (build_user_type_conversion_1): Adjust usage of splice_viable. - (build_new_function_call): Likewise. - (build_operator_new_call): Likewise. - (build_object_call): Likewise. - (build_conditional_expr): Likewise. - (build_new_op): Likewise. - (build_new_method_call): Likewise. - (joust): Remove spurious comment. - * cp-tree.h (DECL_FRIENDLIST): Correct documentation. - * decl2.c (arg_assoc_class): Simplify. - * friend.c (add_friend): Likewise. - -2003-03-11 Jason Merrill - - PR c++/8660 - * decl2.c (check_classfn): A member template only matches a - member template. - -2003-03-11 Neil Booth - - * Make-lang.in (CXX_C_OBJS): Update. - * lang-specs.h: Don't define __GNUG__ here. - -2003-03-10 Mark Mitchell - - * call.c (perform_overload_resolution): New function. - (build_new_function_call): Use it. - (build_operator_new_call): Likewise. - (add_candidates): Add explicit_targs and template_only parameters. - (build_new_op): Adjust accordingly. - * cp-tree.h (build_operator_new_call): New function. - (build_function_call_real): Remove. - (build_function_call_maybe): Likewise. - * init.c (build_new_1): Use build_operator_new_call. - * typeck.c (build_function_call_real): Rename to ... - (build_function_call): ... this. - -2003-03-10 Devang Patel - - PR c++/9394 - * g++spec.c (lang_specific_driver): Use DEFAULT_WORD_SWTCH_TAKES_ARG. - -2003-03-10 Jason Merrill - - PR c++/9798 - * decl.c (push_using_directive): Push before recursing. - - PR c++/9868, c++/9524 - * call.c (resolve_scoped_fn_name): Handle the case of a function - pointer member. - - * decl2.c (build_offset_ref_call_from_tree): Only mess with 'this' - argument in the pointer-to-member case. - -2003-03-09 Mark Mitchell - - PR c++/9373 - * cp-lang.c (cxx_get_alias_set): Use alias set zero for - pointers to member functions. - - PR c++/8534 - * decl.c (build_ptrmemfunc_type): Do not allow default arguments - in pointer-to-member-function types. - -2003-03-10 Gabriel Dos Reis - - * expr.c (cplus_expand_constant): Use C90 prototype style. - (cxx_expand_expr): Likewise. - -2003-03-09 Kriang Lerdsuwanakij - - PR c++/9970 - * decl.c (duplicate_decls): Only copy DECL_THUNKS for virtual - functions. - -2003-03-08 Geoffrey Keating - - * lang-specs.h (c++-header): Change .pch to .gch. - -2003-03-08 Neil Booth - - * cp-tree.h (cxx_init): Update prototype. - * lex.c (cxx_init): Similarly. - -2003-03-08 Mark Mitchell - - PR c++/9823 - * cp-tree.h (begin_mem_initializers): Remove. - * parser.c (cp_parser_mem_initializer_list): Inline it here. - Do not call finish_mem_initializers if not in a constructor. - (cp_parser_class_head): Fix typo in error message. - * semantics.c (begin_mem_initializers): Remove. - * testsuite/g++.dg/parser/constructor1.C: New test. - - PR c++/9809 - * call.c (add_function_candidate): Skip builtin fuctions that have - not yet been declared. - - PR c++/9982 - * init.c (build_new_1): Correct logic for determining whether or - not to use an array cookie. - - PR c++/9524 - * parser.c (cp_parser_postfix_expression): Call - finish_non_static_data_member, even when processing_template_decl. - - PR c++/9912 - * cp-tree.h (is_ancestor): New function. - (handle_class_head): Change prototype. - * decl2.c (is_namespace_ancestor): Rename to ... - (namespace_anecestor): ... this. - (set_decl_namespace): Adjust accordingly. - (handle_class_head): Remove unnecessary parameters. - * parser.c (cp_parser_class_head): Check that - nested-name-specifiers are used appropriately. - -2003-03-07 Mark Mitchell - - * call.c (reference_binding): Remove REF_IS_VAR parameter. - (implicit_conversion): Adjust call to reference_binding. - (make_temporary_var_for_ref_to_type): Add TYPE parameter. - (initialize_reference): Adjust handling for references bound to - rvalues. - * cp-tree.h (make_temporary_var_for_ref_to_temp): Change - prototype. - (real_non_cast_lvalue_p): New method. - * cvt.c (build_up_reference): Adjust use of - make_temporary_var_for_ref_to_temp. - * tree.c (real_non_cast_lvalue_p): New method. - -2003-03-07 Gabriel Dos Reis - - * except.c (init_exception_processing): Use C90 prototype style. - (cp_protect_cleanup_actions): Likewise. - (prepare_eh_type): Likewise. - (build_eh_type_type): Likewise. - (build_exc_ptr): Likewise. - (do_begin_catch): Likewise. - (dtor_nothrow): Likewise. - (do_end_catch): Likewise. - (push_eh_cleanup): Likewise. - (decl_is_java_type): Likewise. - (choose_personality_routine): Likewise. - (initialize_handler_parm): Likewise. - (expand_start_catch_block): Likewise. - (expand_end_catch_block): Likewise. - (begin_eh_spec_block): Likewise. - (finish_eh_spec_block): Likewise. - (do_allocate_exception): Likewise. - (do_free_exception): Likewise. - (wrap_cleanups_r): Likewise. - (stabilize_throw_expr): Likewise. - (build_throw): Likewise. - (complete_ptr_ref_or_void_ptr_p): Likewise. - (is_admissible_throw_operand): Likewise. - (nothrow_libfn_p): Likewise. - (can_convert_eh): Likewise. - (check_handlers_1): Likewise. - (check_handlers): Likewise. - -2003-03-06 Mark Mitchell - - * call.c (merge_conversion_sequences): New function. - (build_conv): Set ICS_USER_FLAG for USER_CONVs. - (convert_class_to_reference): Correct handling of second - standard conversion sequence in a user-defined conversion - sequence. - (build_user_type_conversion_1): Use merge_conversion_sequences. - * cp-tree.def: Add comments for CONV nodes. - * rtti.c (get_tinfo_decl): Use build_address/build_nop. - -2003-03-07 Gabriel Dos Reis - - * error.c (init_error): Use C90 prototype style. - (dump_scope): Likewise. - (dump_qualifiers): Likewise. - (dump_template_argument): Likewise. - (dump_template_argument_list): Likewise. - (dump_template_parameter): Likewise. - (dump_template_bindings): Likewise. - (dump_type): Likewise. - (dump_typename): Likewise. - (class_key_or_enum): Likewise. - (dump_aggr_type): Likewise. - (dump_type_prefix): Likewise. - (dump_type_suffix): Likewise. - (dump_global_iord): Likewise. - (dump_simple_decl): Likewise. - (dump_decl): Likewise. - (dump_template_decl): Likewise. - (dump_function_decl): Likewise. - (dump_parameters): Likewise. - (dump_exception_spec): Likewise. - (dump_function_name): Likewise. - (dump_template_parms): Likewise. - (dump_char): Likewise. - (dump_expr_list): Likewise. - (dump_expr): Likewise. - (dump_binary_op): Likewise. - (dump_unary_op): Likewise. - (type_as_string): Likewise. - (expr_as_string): Likewise. - (decl_as_string): Likewise. - (context_as_string): Likewise. - (lang_decl_name): Likewise. - (cp_file_of): Likewise. - (cp_line_of): Likewise. - (decl_to_string): Likewise. - (expr_to_string): Likewise. - (fndecl_to_string): Likewise. - (code_to_string): Likewise. - (language_to_string): Likewise. - (parm_to_string): Likewise. - (op_to_string): Likewise. - (type_to_string): Likewise. - (assop_to_string): Likewise. - (args_to_string): Likewise. - (cv_to_string): Likewise. - (cxx_print_error_function): Likewise. - (cp_diagnostic_starter): Likewise. - (cp_diagnostic_finalizer): Likewise. - (cp_print_error_function): Likewise. - (function_category): Likewise. - (print_instantiation_full_context): Likewise. - (print_instantiation_partial_context): Likewise. - (maybe_print_instantiation_context): Likewise. - (print_instantiation_context): Likewise. - (cp_printer): Likewise. - (print_integer): Likewise. - (print_non_consecutive_character): Likewise. - (locate_error): Likewise. - -2003-03-06 Mark Mitchell - - PR c++/9965 - * call.c (reference_binding): Add ref_is_var parameter. - (implicit_conversion): Adjust call to reference_binding. - (initialize_reference): Likewise. - - PR c++/9400 - * decl.c (pushdecl): Don't check for shadowing of DECL_ARTIFICIAL - PARM_DECLs. - - PR c++/9791 - * class.c (get_basefndecls): Use lookup_fnfields_1. - -2003-03-06 Kriang Lerdsuwanakij - - PR c++/9188 - * parser.c (cp_parser_type_parameter): Remove redundant `expect' - in error message. - (cp_parser_single_declaration): Likewise. - -2003-03-05 Jason Merrill - - PR c++/9440 - * call.c (build_conditional_expr): Use convert rather than an - explicit NOP_EXPR. - -2003-03-02 Matt Austern - - * decl.c (cp_binding_level): Add static_decls varray member. - (add_decl_to_level): Add static/inline namespace scope - declarations to static_decls array. - (wrapup_global_for_namespace): Pass static_decls only, instead of - all decls, to wrapup_global_declarations/check_global_declarations. - (push_namespace): Initialize static_decls for ordinary namespaces. - (cxx_init_decl_processing): Initialize static_decls for global - namespace. - -2003-03-05 Mark Mitchell - - * class.c (end_of_class): Correct thinko. - -2003-03-04 Nathanael Nerode - - * config-lang.in: Replace ${libstdcxx_version} by its value. - -2003-03-04 Gabriel Dos Reis - - * cp-tree.h (cxx_saved_binding): Declare. - (struct saved_scope): Adjust type of field 'old_binding'. - * decl.c (cxx_saved_binding_make): New macro. - (struct cxx_saved_binding): Define. - (store_bindings): Adjust prototype. Use cxx_saved_binding to save - C++ bindings. - (maybe_push_to_top_level): Adjust local variable type. - (pop_from_top_level): Likewise. - -2003-03-04 Tom Tromey - - * Make-lang.in (c++.tags): New target. - -2003-03-04 Neil Booth - - * Make-lang.in: Update. - -2003-03-03 Jason Merrill - - * decl.c (finish_enum): Do set the type in a template. Simplify. - * pt.c (tsubst_enum, tsubst_copy): Revert last patch. - -2003-03-03 Mark Mitchell - - PR c++/9878 - * call.c (convert_class_to_reference): Correct conversion - sequences. - (reference_binding): Add ref_bound_directly_to_rvalue_p parameter. - (implicit_conversion): Adjust call to reference_binding. - (add_candidate): Change type of candidates parameter. - (add_function_candidate): Likewise. - (add_conv_candidate): Likewise. - (build_builtin_candidate): Likewise. - (add_builtin_candidate): Likewise. - (add_builtin_candidates): Likewise. - (add_template_candidate_real): Likewise. - (add_template_candidate): Likewise. - (add_template_conv_candidate): Likewise. - (build_user_type_conversion_1): Adjust accordingly. - (build_object_call): Likewise. - (build_conditional_expr): Likewise. - (add_candidates): Likewise. - (build_new_op): Likewise. - (convert_like_real): Use USER_CONV_CAND. Use build_nop. - (build_new_method_call): Adjust calls to add_function_candidate. - (make_temporary_var_for_ref_to_temp): New function. - (initialize_reference): Add decl parameter. - * class.c (build_rtti_vtbl_entries): Use build_address and - build_nop. - * cp-tree.h (initialize_reference): Change prototype. - (make_temporary_var_for_ref_to_temp): New function. - (build_type_conversion): Change prototype. - (build_address): New function. - (build_nop): Likewise. - * cvt.c (cp_convert_to_pointer): Adjust call to - build_type_conversion. Avoid indicating redundant NOP_EXPRs. - Use build_nop. - (convert_to_pointer_force): Use build_nop. - (build_up_reference): Use make_temporary_var_for_ref_to_temp. - (convert_to_reference): Adjust call to build_type_conversion. - (ocp_convert): Likewise. - (build_type_conversion): Remove for_sure parameter. - * decl.c (grok_reference_init): Use initialize_reference. - * typeck.c (build_address): New function. - (build_nop): Likewise. - (build_unary_op): Use them. - (build_ptrmemfunc): Tidy slightly. - (convert_for_initialization): Adjust call to - initialize_reference. - * typeck2.c (store_init_value): Remove #if 0'd code. - -2003-03-03 Jason Merrill - - * decl.c (start_function): Clear DECL_NUM_STMTS. - - * class.c (get_vtable_decl): Use vtbl_type_node. - (build_primary_vtable): Check for it. - -2003-03-02 Aldy Hernandez - - * decl.c (check_initializer): Check for vector_opaque_p. - -2003-03-02 Ashif Harji - - * lang-specs.h (default_compilers): Add -no-integrated-cpp flag to - invoke an external cpp during compilation. - -2003-03-01 Gabriel Dos Reis - - * decl.c (duplicate_decls): Convert use of warning_with_decl() to - that of warning(). - (start_decl): Likewise. - (start_function): Likewise. - -2003-03-01 Neil Booth - - * Make-lang.in (CXX_C_OBJS): Update. - -2003-02-28 Mark Mitchell - - PR c++/9892 - * pt.c (instantiate_decl): Clear DECL_RTL for a VAR_DECL when - instantiating it. - -2003-02-28 Aldy Hernandez - - * parser.c (cp_parser_init_declarator): Revert opaque - vector_opaque_p change. - Do not include target.h. - -2003-02-28 Mark Mitchell - - PR c++/9879 - * cp-tree.h (build_zero_init): Add parameter. - * decl.c (cp_finish_decl): Adjust call. - * init.c (build_zero_init): Add nelts parameter. Adjust recursive - calls. - (build_default_init): Add nelts parameter. Adjust calls to - build_zero_init. - (build_new_1): Adjust call to build_default_init. - * typeck2.c (process_init_constructor): Adjust call to build_zero_init. - -2003-02-26 Devang Patel - - * decl.c (finish_enum): Merge two 'for' loops. Copy value node if - required. Postpone enum setting for template decls. - (build_enumerator): Delay copying value node until finish_enum - (). Remove #if 0'ed code. - * pt.c (tsubst_enum): Set TREE_TYPE and copy value node. - (tsubst_copy): Add check for enum type. - -2003-02-25 Mark Mitchell - - PR c++/9683 - * decl2.c (prune_vars_needing_no_initialization): Do not throw - away initializations for DECL_EXTERNAL VAR_DECLs. - (finish_file): Adjust accordingly. - * pt.c (instantiate_decl): Do not defer VAR_DECLs. - -2003-02-24 Gabriel Dos Reis - - * decl.c (add_binding): Time TV_NAME_LOOKUP. - (push_class_binding): Likewise. - (set_namespace_binding): Likewise. - -2003-02-24 Mark Mitchell - - PR c++/9836 - * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): Do not skip from - specializations back to the main template. - * parser.c (cp_parser_diagnose_invalid_type_name):Adjust use. - * pt.c (resolve_typename_type): Likewise. - -2003-02-24 Jeffrey D. Oldham - - PR c++/9778 - * pt.c (tsubst_copy_and_build): For a templated function inside a - scope, process template arguments. - -2003-02-24 Kriang Lerdsuwanakij - - PR c++/9602 - * typeck2.c (abstract_virtuals_error): Don't check when - TYPE is still template parameter dependent. - -2003-02-23 Mark Mitchell - - PR c++/5333 - * cp-tree.h (CLASSTYPE_PRIMARY_TEMPLATE): New macro. - * parser.c (cp_parser_diagnose_invalid_type_name): Use it. - * pt.c (instantiate_class_template): Don't try to instantiate - dependent types. - (resolve_typename_type): Use CLASSTYPE_PRIMARY_TEMPLATE. - -2003-02-21 Mark Mitchell - - PR c++/9749 - * decl.c (grokdeclarator): Do not allow parameters with variably - modified types. - -2003-02-21 Nathan Sidwell - - * search.c (grow_bfs_bases): Remove. Fold into ... - (bfs_walk): ... here, fix fencepost error. Fix merge lossage - in previous patch. - -2003-02-20 Mark Mitchell - - PR c++/9729 - * mangle.c (mangle_conv_op_name_for_type): Issue an error message - when the G++ 3.2 ABI prevents correct compilation. - -2003-02-20 Nathan Sidwell - - Change base class access representation. Share virtual base - binfos. - * cp/call.c (build_special_member_call): Remove binfo_for_vbase - call. - * cp/class.c (build_base_path): Likewise. - (build_primary_vtable): Adjust BINFO_NEW_VTABLE_MARKED use. - (build_secondary_vtable): Remove FOR_TYPE arg. Adjust. - (make_new_vtable): Adjust. - (force_canonical_binfo_r): Delete. - (force_canonical_binfo): Delete. - (mark_primary_virtual_base): Delete. - (dfs_unshared_virtual_bases): Delete. - (mark_primary_bases): Adjust. - (maybe_warn_about_overly_private_class): Adjust. - (dfs_base_derived_from): Delete. - (base_derived_from): Follow the inheritance chain. - (struct find_final_overrider_data): Add vpath member. - (dfs_find_final_overrider): Adjust. - (dfs_find_final_overrider_q, dfs_find_final_overrider_post): New. - (find_final_overrider): Adjust. - (update_vtable_entry_for_fn): Adjust. - (modify_all_vtables): Adjust. - (walk_subobject_offsets): Adjust. - (layout_nonempty_base_or_field): Adjust. - (layout_empty_base): Remove last parameter. Adjust. - (build_base_field): Adjust. - (build_base_fields): Adjust. - (propagate_binfo_offsets): Remove last parameter. Adjust. - (dfs_set_offset_for_unshared_vbases): Delete. - (layout_virtual_bases): Adjust. - (finish_struct_1): Adjust. - (init_class_processing): Don't init access nodes. - (dfs_get_primary_binfo): Delete. - (get_primary_binfo): Adjust. - (dump_class_hierarchy_r): Remove most derived arg, add IGO - parameter. Adjust. - (dump_class_hierarchy): Adjust. - (finish_vtbls): Adjust. - (get_original_base): Delete. - (build_vtt_inits): Adjust. - (dfs_build_secondary_vptr_vtt_inits): Adjust. - (dfs_ctor_vtable_bases_queue_p): Adjust. - (build_ctor_vtbl_group): Adjust. - (dfs_accumulate_vtbl_inits): Adjust. - (build_vtbl_initializer): Adjust. - (build_vbase_offset_vtbl_entries): Adjust. - (add_vcall_offset_vtbl_entries_1): Adjust. - * cp/cp-tree.h (CPTI_ACCESS_*): Remove. - (access_*_node): Remove. - (CANONICAL_BINFO): Delete. - (BINFO_UNSHARED_MARKED): Remove. - (BINFO_MARKED): Set LANG_FLAG_0 directly. - (SET_BINFO_MARKED, CLEAR_BINFO_MARKED): Delete. - (BINFO_VTABLE_PATH_MARKED): Set LANG_FLAG_3 directly. - (SET_BINFO_VTABLE_PATH_MARKED, CLEAR_BINFO_VTABLE_PATH_MARKED): - Delete. - (BINFO_NEW_VTABLE_MARKED): Set LANG_FLAG_4 directly. - (SET_BINFO_NEW_VTABLE_MARKED): Adjust. - (SET_BINFO_PUSHDECLS_MARKED, CLEAR_BINFO_PUSHDECLS_MARKED): - Delete. - (BINFO_DEPENDENT_BASE_P): New. - (dfs_walk, dfs_walk_real): Queue function takes derived binfo and - index. - (markedp, unmarkedp): Adjust. - (dfs_unmarked_real_bases_queue_p, dfs_marked_real_bases_queue_p, - dfs_skip_vbases, marked_vtable_pathp, unmarked_vtable_pathp, - find_vbase_instance, binfo_for_vbase): Delete. - (copied_binfo, original_binfo): Declare. - (finish_base_specifier): Add virtual_p arg. - (unshare_base_binfos): Delete. - (copy_base_binfos): Declare. - (reverse_path): Delete. - * cp/decl.c (xref_basetypes): Access and virtuality passed - differently. Don't copy direct base binfos here. Call - copy_base_binfos. - * cp/init.c (dfs_initialize_vtbl_ptrs): Adjust. - (initialize_vtbl_ptrs): Adjust. - (expand_member_init): Adjust. - * cp/parser.c (cp_parser_base_specifier): Adjust. - * cp/pt.c (instantiate_class_template): Adjust. - (get_template_base_recursive): Adjust. - * cp/rtti.c (get_pseudo_ti_init): Adjust. - (get_pseudo_ti_desc): Adjust. - * cp/tree.c (unshare_base_binfos): Rename to ... - (copy_base_binfos): ... here, reimplement. - (make_binfo): Set BINFO_DEPENDENT_BASE_P. - (reverse_path): Remove. - * cp/typeck.c (get_delta_difference): Adjust error messages. - * cp/semantics.c (finish_base_specifier): Add virtual arg, adjust. - * cp/search.c (lookup_base_r): Adjust. - (dynamic_cast_base_recurse): Adjust. - (canonical_binfo): Remove. - (dfs_canonical_queue): Remove. - (dfs_assert_unmarked_p): Remove. - (assert_canonical_unmarked): Remove. - (shared_marked_p, shared_unmarked_p): Remove. - (BINFO_ACCESS, SET_BINFO_ACCESS): Use TREE_PUBLIC & TREE_PRIVATE. - (dfs_access_in_type): Adjust. - (access_in_type): Adjust. - (dfs_accessible_queue_p): Adjust. - (dfs_accessible_p): Adjust. - (is_subobject_of_p_1, is_subobject_of_p): Remove. - (struct lookup_field_info): Remove from_dep_base_p field. - (lookup_field_queue_p): Adjust, test BINFO_DEPENDENT_BASE_P. - (lookup_field_r): Remove dependent base code. - (lookup_member): Likewise. - (dfs_walk, dfs_walk_real): Add access arg to queue fn. - (dfs_unmarked_real_bases_queue_p): Remove. - (dfs_marked_real_bases_queue_p): Remove. - (dfs_skip_vbases): Remove. - (dfs_get_pure_virtuals): Adjust. - (markedp, unmarkedp): Adjust. - (marked_vtable_pathp, unmarked_vtable_pathp): Remove. - (marked_pushdecls_p, unmarked_pushdecls_p): Adjust. - (dfs_unmark): Adjust. - (dfs_get_vbase_types):Remove. - (dfs_build_inheritance_graph_order): Remove. - (get_vbase_types): Remove - (dfs_find_vbase_instance): Remove. - (find_vbase_instance): Remove. - (dfs_debug_unmarkedp): Adjust. - (dependent_base_p): Remove. - (dfs_push_type_decls): Adjust. - (dfs_push_decls): Adjust. - (dfs_no_overlap_yet): Adjust. - (copied_binfo): New function. - (original_binfo): New function. - (binfo_for_vbase): Remove. - -2003-02-18 Zack Weinberg - - * cp/search.c (grow_bfs_bases): New subroutine of bfs_walk. - (bfs_walk): Rewritten using circular queue of BINFO_BASETYPES - vectors, for speed. - -2003-02-18 Mark Mitchell - - PR c++/9704 - * class.c (layout_class_type): In the 3.2 ABI, take into account - trailing bit fields when computing CLASSTYPE_SIZE_UNIT. - -2003-02-18 Matt Austern - - * cp/cp-lang.c: Change lang hooks so that final_write_globals does - nothing for C++. - * cp/decl.c (wrapup_globals_for_namespace): Remove special - handling of global namespace. - -2003-02-18 Geoffrey Keating - - * cp-tree.h (rid_to_yy): Delete. - (C_RID_YYCODE): Delete. - (finish_file): Delete redundant declaration. - -2003-02-18 Jason Merrill - - PR c++/9623 - * decl.c (reshape_init): Don't mess with initializer labels. - - PR c++/9485 - * parser.c (cp_parser_postfix_expression): Set idk properly for - object->scope::member. - -2003-02-18 Ben Elliston - - PR other/7350 - * decl.c (duplicate_decls): Fix typo in comment. - -2003-02-17 Michael Elizabeth Chastain - - PR debug/9717 - * class.c (build_base_field): Mark fields for base classes with - DECL_IGNORED_P. - -2003-02-17 Kriang Lerdsuwanakij - - PR c++/9457 - * pt.c (tsubst_copy_and_build) [CONSTRUCTOR]: Substitute - CONSTRUCTOR_ELTS only once. - -2003-02-16 Kriang Lerdsuwanakij - - PR c++/9459 - * error.c (dump_type_prefix): Handle TYPEOF_TYPE. - (dump_type_suffix): Likewise. - -2003-02-14 Nathan Sidwell - - * search.c: ANSIfy function declarations and definitions. - * cp-tree.h (lookup_field, lookup_member): Last parameter is a bool. - * call.c (build_method_call, resolve_scoped_fn_name, - build_java_interface_fn_ref): Adjust lookup_field, lookup_member - calls. - * class.c (handle_using_decl): Likewise. - * decl.c (make_typename_type, make_unmound_class_template, - start_decl, compute_array_index_type): Likewise. - * decl2.c (build_expr_from_tree, build_call_from_tree): Likewise. - * init.c (expand_member_init, build_member_call): Likewise. - * pt.c (tsubst_copy, tsubst_copy_and_build, do_decl_instantiation, - resolve_typename_type): Likewise. - * typeck.c (lookup_destructor, finish_class_member_access_exprm - build_prememfunc_access_expr): Likewise. - -2003-02-13 Gabriel Dos Reis - - * decl2.c: Include "timevar.h". - (namespace_ancestor): Time name lookup. - (add_using_namespace): Likewise. - (lookup_using_namespace): Likewise. - (qualified_lookup_using_namespace): Likewise. - (decl_namespace): Likewise. - (lookup_arg_dependent): Likewise. - * lex.c (do_identifier): Likewise. - (do_scoped_id): Likewise. - * pt.c (lookup_template_class): Likewise. - -2003-02-14 Andrew Pinski - - * decl.c: (define_label): Fix warning for return 0 instead of NULL. - -2003-02-13 Gabriel Dos Reis - - * decl.c: Include "timevar.h". - (poplevel): Time name lookup. - (find_binding): Likewise. - (push_namespace): Likewise. - (pop_nested_namespace): Likewise. - (store_bindings): Likewise. - (maybe_push_to_top_level): Likewise. - (pop_from_top_level): Likewise. - (push_local_name): Likewise. - (pushtag): Likewise. - (pushdecl): Likewise. - (pushdecl_with_scope): Likewise. - (pushdecl_namespace_level): Likewise. - (pushdecl_top_level): Likewise. - (pushdecl_class_level): Likewise. - (push_class_level_binding): Likewise. - (push_using_decl): Likewise. - (push_using_directive): Likewise. - (push_overloaded_decl): Likewise. - (lookup_label): Likewise. - (define_label): Likewise. - (lookup_tag): Likewise. - (lookup_tag_reverse): Likewise. - (lookup_namespace_name): Likewise. - (select_decl): Likewise. - (unqualified_namespace_lookup): Likewise. - (lookup_name_real): Likewise. - (lookup_name_current_level): Likewise. - (lookup_type_current_level): Likewise. - (maybe_inject_for_scope_var): Likewise. - (xref_tag): Likewise. - - * Make-lang.in (cp/decl.o): Add dependency on timevar.h - -2003-02-12 Phil Edwards - - * decl.c (build_enumerator): Remove unneeded test. - -2003-02-09 Dan Nicolaescu - - * cp-tree.h (struct lang_type_header): Make all fields unsigned - char. - -2003-02-03 Mark Mitchell - - PR c++/7129 - * call.c (z_candidate): Add args. - (convert_class_to_reference): Set it. - (implicit_conversion): Tidy. - (add_candidate): Add args parameter. - (add_function_candidate): Adjust call to add_candidate. - (add_conv_candidate): Likewise. - (build_builtin_candidate): Likewise. - (build_user_type_conversion_1): Eliminate wasteful tree_cons - usage. - (build_new_function_call): Likewise. - (build_object_call): Likewise. - (add_candidates): New function. - (build_new_op): Use it. - (covert_like_real): Adjust call to build_over_call. - (build_over_call): Remove args parameter. - * operators.def: Add ?=. - -2003-02-01 Richard Sandiford - - * typeck.c (build_indirect_ref): Don't check flag_volatile. - -2003-01-31 Kriang Lerdsuwanakij - - PR c++/8849 - * pt.c (resolve_overloaded_unification): Handle FUNCTION_DECL. - -2003-01-31 Nathan Sidwell - - * cp-tree.h (BINFO_SUBVTT_INDEX, BINFO_VPTR_INDEX, - BINFO_PRIMARY_BASE_OF): Use BINFO_ELTS. - (BINFO_LANG_ELTS): New #define. - * tree.c (make_binfo): Use BINFO_LANG_ELTS. - -2003-01-30 Geoffrey Keating - - * cp/Make-lang.in: Remove -Wno-error from cp/decl.o. - -2003-01-30 Mark Mitchell - - * class.c (check_field_decls): Only check C_TYPE_FIELDS_READONLY - for class types. - * cp-tree.h (C_TYPE_FIELDS_READONLY): Use a lang-specific bit - rather than TYPE_LANG_FLAG_0. - (TYPE_BUILT_IN): Remove. - (TYPE_DEPENDENT_P): New macro. - (TYPE_DEPENDENT_P_VALID): Likewise. - (lang_type_class): Add fields_readonly. - * decl.c (record_builtin_type): Don't set TYPE_BUILT_IN. - * pt.c (dependent_type_p_r): New function, split out from ... - (dependent_type_p): ... here. Memoize results. - * search.c (dependent_base_p): Use dependent_type_p, not - uses_template_parms. - * typeck.c (build_modify_expr): Only check C_TYPE_FIELDS_READONLY - for class types. - -2003-01-29 Mark Mitchell - - * call.c (build_field_call): Use build_new_op, not build_opfncall. - (prep_operand): New function. - (build_new_op): Use it. Remove dead code. - * class.c (pushclass): Change "modify" parameter type from int to - bool. - (currently_open_class): Use same_type_p, not pointer equality. - (push_nested_class): Adjust calls to pushclass, remove modify - parameter. - * cp-tree.h (INTEGRAL_OR_ENUMERATION_TYPE_P): New macro. - (pushclass): Change prototype. - (push_nested_class): Likewise. - (grokoptypename): Remove. - (build_opfncall): Remove. - (value_dependent_expression_p): Declare. - (resolve_typename_type): Likewise. - (resolve_typename_type_in_current_instantiation): Likewise. - (enter_scope_of): Remove. - (tsubst): Remove. - (tsubst_expr): Likewise. - (tsubst_copy): Likewise. - (tsubst_copy_and_build): Likewise. - * decl.c (warn_about_implicit_typename_lookup): Remove. - (finish_case_label): Return error_mark_node for erroneous labels. - (start_decl): Adjust calls to push_nested_class. - (grokfndecl): Call push_scope/pop_scope around call to - duplicate_decls. - (grokdeclarator): Do not call tsubst. - (start_function): Adjust calls to push_nested_class. - * decl2.c (grok_array_decl): Use build_new_op, not build_opfncall. - (check_classfn): Use push_scope/pop_scope around type comparisions. - (grokoptypename): Remove. - (push_sscope): Adjust call to push_nested_class. - * error.c (dump_type): Show cv-qualification of typename types. - * init.c (build_member_call): Use build_new_op, not - build_opfncall. - * method.c (build_opfncall): Remove. - * parser.c (cp_parser): Add allow_non_constant_expression_p and - non_constant_expression_p. - (cp_parser_constant_expression): Adjust prototype. - (cp_parser_resolve_typename_type): Remove. - (cp_parser_non_constant_expression): New function. - (cp_parser_non_constant_id_expression): Likewise. - (cp_parser_new): Set allow_non_constant_expression_p and - non_constant_expression_p. - (cp_parser_primary_expression): Reject `this' and `va_arg' in - constant-expressions. Note that dependent names aren't really - constant. - (cp_parser_postfix_expression): Reject conversions to non-integral - types in constant-expressions. Neither are increments or - decrements. - (cp_parser_unary_expression): Reject increments and decrements in - constant-expressions. - (cp_parser_direct_new_declarator): Adjust call to - cp_parser_constant_expression. - (cp_parser_cast_expression): Reject conversions to non-integral - types in constant-expressions. - (cp_parser_assignment_expression): Rejects assignments in - constant-expressions. - (cp_parser_expression): Reject commas in constant-expressions. - (cp_parser_labeled_statement): Adjust call to - cp_parser_constant_expression. - (cp_parser_direct_declarator): Simplify array bounds, even in - templates, when they are non-dependent. Use - resolve_typename_type, not cp_parser_resolve_typename_type. - (cp_parser_class_head): Use resolve_typename_type, not - cp_parser_resolve_typename_type. - (cp_parser_member_declaration): Adjust call to - cp_parser_constant_expression. - (cp_parser_constant_initializer): Likewise. - (cp_parser_constructor_declarator): Use resolve_typename_type, not - cp_parser_resolve_typename_type. - (cp_parser_late_parsing_default_args): Adjust call to - push_nested_class. - * pt.c (tsubst): Give it internal linkage. - (tsubst_expr): Likewise. - (tsubst_copy): Likewise. - (tsubst_copy_and_build): Likewise. - (push_access_scope_real): Likewise. - (tsubst_friend_class): Likewise. - (instantiate_class_template): Adjust call to pushclass. - (value_dependent_expression_p): Give it external linkage. - Robustify. - (resolve_typename_type): New function. - * semantics.c (finish_call_expr): Use build_new_op, not - build_opfncall. - (begin_constructor_declarator): Remove. - (begin_class_definition): Adjust call to pushclass. - (enter_scope_of): Remove. - * typeck.c (comptypes): Resolve typename types as appropriate. - (build_x_indirect_ref): Use build_new_op, not build_opfncall. - (build_x_compound_expr): Likewise. - (build_modify_expr): Likewise. - (build_x_modify_expr): Likewise. - * typeck2.c (build_x_arrow): Likewise. - -2003-01-29 Fariborz Jahanian - - * pt.c (last_pending_template) Declare GTY(). - -2003-01-29 Kriang Lerdsuwanakij - - PR c++/8591 - * parser.c (cp_parser_elaborated_type_specifier): Convert - TEMPLATE_DECL to TYPE_DECL only when processing template friends. - (cp_parser_maybe_treat_template_as_class): Remove redundant tests. - -2003-01-28 Nathan Sidwell - - PR c++/9437 - * pt.c (unify): Don't unify '*T' with 'U C::*'. - - PR c++/3902 - * parser.c (cp_parser_decl_specifier_seq): Cannot have constructor - inside a declarator. - -2003-01-27 Nathan Sidwell - - * class.c (update_vtable_entry_for_fn): Add index parameter. - Generate vcall thunk for covariant overriding from a virtual - primary base. - (dfs_modify_vtables): Adjust. - -2003-01-25 Nathan Sidwell - - PR c++/9403 - * parser.c (cp_parser_class_or_namespace_name): Reject duplicate - template keyword. - (cp_parser_base_specifier): Look for and consume a - TEMPLATE keyword. Replace switch with array index. - - PR c++/795 - * semantics.c (finish_non_static_data_member): Remember the - field's type even in a template. - - PR c++/9415 - * pt.c (tsubst_copy_and_build, CALL_EXPR): BASELINK exprs are - already scoped. - - PR c++/8545 - * parser.c (cp_parser_cast_expression): Be more tentative. - -2003-01-25 Kriang Lerdsuwanakij - - * cp-tree.h (flagged_type_tree_s): Remove. - (check_for_new_type): Likewise. - * typeck2.c (check_for_new_type): Likewise. - -2003-01-23 Nathanael Nerode - - * dump.c: ANSIfy function declarations and definitions. - - * cp-tree.h, decl.h: Get rid of PARAMS. Again. - -2003-01-22 Mark Mitchell - - PR c++/9354 - * init.c (build_new): Set the type of the new-expression, even - when processing_templte_decl. - - PR c++/9216 - * parser.c (cp_parser_primary_expression): Improve error message - for templates used in an expression context. - - PR c++/8696 - * parser.c (cp_parser_decl_specifier_seq): Commit to tentative - parse when encountering "typedef". - -2003-01-22 Nathanael Nerode - - * class.c, parser.c: ANSIfy function definitions and declarations. - -2003-01-22 Mark Mitchell - - PR c++/9328 - * error.c (dump_decl): For an OVERLOAD, just print the name of the - function; it doesn't make sense to try to print its type. - * semantics.c (finish_typeof): Issue errors about invalid uses. - - PR c++/9298 - * parser.c (cp_parser_consume_semicolon_at_end_of_statement): New - function. - (cp_parser_expression_statement): Use it. - (cp_parser_explicit_instantiation): Likewise. - * pt.c (do_decl_instantiation): Improve error handling logic. - -2003-01-22 Mark Mitchell - - PR c++/9384 - * parser.c (cp_parser_using_declaration): Issue error messages - about name resolution failures here. - - PR c++/9388 - * class.c (currently_open_derived_class): Use dependent_type_p. - * cp-tree.h (dependent_type_p): New function. - (dependent_template_arg_p): Likewise. - (dependent_template_p): Likewise. - (type_dependent_expression_p): Likewise. - * parser.c (cp_parser_dependent_type_p): Remove. - (cp_parser_value_dependent_type_p): Likewise. - (cp_parser_type_dependent_expression_p): Likewise. - (cp_parser_dependent_template_arg_p): Likewise. - (cp_parser_dependent_template_id_p): Likewise. - (cp_parser_dependent_template_p): Likewise. - (cp_parser_diagnose_invalid_type_name): Replace - cp_parser_dependent_type_p with dependent_type_p, etc. - (cp_parser_primary_expresion): Likewise. - (cp_parser_nested_name_specifier_opt): Likewise. - (cp_parser_postfix_expression): Likewise. - (cp_parser_unary_expression): Likewise. - (cp_parser_template_name): Likewise. - (cp_parser_class_name): Likewise. - (cp_parser_lookup_name): Likewise. - * pt.c (dependent_type_p): New function. - (value_dependent_expression_p): Likewise. - (type_dependent_expression_p): Likewise. - (dependent_template_arg_p): Likewise. - (dependent_template_id_p): Likewise. - (dependent_template_p): Likewise. - - PR c++/9285 - PR c++/9294 - * parser.c (cp_parser_simple_declaration): Return quickly when - encountering errors. - -2003-01-21 Kaveh R. Ghazi - - Make-lang.in (cp/decl.o-warn): Add -Wno-error. - -2003-01-17 Jason Merrill - - PR c++/9167, c++/9358 - * decl.c (require_complete_types_for_parms): Also update DECL_ARG_TYPE. - -2003-01-17 Jason Merrill - - PR c++/9342 - * call.c (build_conditional_expr): Always do lvalue-rvalue - conversion. - -2003-01-17 Mark Mitchell - - PR c++/9294 - * cp-tree.def (BASELINK): Make it class 'x', not class 'e'. - * cp-tree.h (BASELINK_BINFO): Adjust. - (BASELINK_FUNCTIONS): Likewise. - (BASELINK_ACCESS_BINFO): Likewise. - (tree_baselink): New structure. - (cp_tree_node_structure_enum): Add TS_CP_BASELINK. - (lang_tree_node): Add baselink. - * decl.c (cp_tree_node_structure): Add BASELINK case. - * search.c (build_baselink): Adjust. - * tree.c (cp_walk_subtrees): Add BASELINK case. Remove BASELINK_P - test from TREE_LIST case. - - PR c++/9272 - * parser.c (cp_parser_constructor_declarator_p): Do not assume - that a constructor cannot be declared outside of its own class. - - * parser.c (cp_parser_resolve_typename_type): If the scope cannot - be resolved, neither can the qualified name. - - * rtti.c (get_pseudo_ti_desc): Fix thinko. - -2003-01-16 Jason Merrill - - PR c++/8564 - * init.c (build_vec_init): Re-add maxindex parm. - (perform_member_init, build_aggr_init): Pass it. - (build_new_1): Pass it. Use an incomplete array type for full_type. - * typeck.c (build_modify_expr): Pass it. - * cp-tree.h: Adjust. - -2003-01-16 Jeffrey D. Oldham - - * cp-tree.h (tsubst_copy_and_build): New declaration. - * pt.c (tsubst_copy): Remove 'build_expr_from_tree' from comment. - (tsubst_expr): Use 'tsubst_copy_and_build'. Update initial comment. - (tsubst_copy_and_build): New function. - -2003-01-16 Mark Mitchell - - * cp-tree.h (lang_type_class): Remove is_partial_instantiation. - (PARTIAL_INSTANTIATION_P): Remove. - (IMPLICIT_TYPENAME_P): Likewise. - (IMPLICIT_TYPENAME_TYPE_DECL_P): Likewise. - (build_typename_type): Remove declaration. - (parmlist_is_exprlist): Likewise. - * decl.c (build_typename_type): Make it static, remove third - parameter. - (push_class_binding): Don't do implicit typename stuff. - (make_typename_type): Likewise. - (lookup_name_real): Likewise. - (grokdeclarator): Don't try to convert declarations into - initializations. Don't do implicit typename stuff. - (parmlist_is_exprlist): Remove. - (xref_basetypes): Simplify. - * decl2.c (grokfield): Don't try to convert declarations into - initializations. - (build_anon_union_vars): Do this while processing templates, too. - (finish_anon_union): Likewise. - * error.c (dump_type): Remove implicit typename handling. - * parser.c (cp_parser_diagnose_invalid_type_name): New method. - (cp_parser_primary_expression): Correct handling of names not - found by unqualified name lookup in templates. - (cp_parser_nested_name_specifier_opt): Avoid checking dependency - of types when possible. - (cp_parser_simple_declaration): Complain intelligently about some - invalid declarations. - (cp_parser_member_declaration): Likewise. - (cp_parser_constructor_declarator_p): Don't check when we're in a - function scope. - * pt.c (instantiate_class_template): Remove - PARTIAL_INSTANTIATION_P gunk. - * search.c (lookup_field_r): Don't build implicit typenames. - (marked_pushdecls_p): Don't enter dependent base types. - (unmarked_pushdecls_p): Likewise. - * semantics.c (begin_class_definition): Remove implicit typename - stuff. - -2003-01-16 Nathan Sidwell - - PR c++/9212 - * parser.c (cp_parser_direct_declarator): If accepting either - abstract or named, the name must be an unqualified-id. - -2003-01-16 Kaveh R. Ghazi - - * class.c (layout_virtual_bases): Avoid signed/unsigned warning. - -2003-01-14 Kaveh R. Ghazi - - * decl2.c (check_classfn): Fix uninitialized warning. - (build_anon_union_vars): Likewise. - * pt.c (tsubst_copy): Likewise. - -2003-01-14 Jeffrey D. Oldham - - Further conform g++'s __vmi_class_type_info to the C++ ABI - specification. - * rtti.c (dfs_class_hint_mark): Do not set hints not specified by - the specification. - (class_hint_flags): Likewise. - -2003-01-14 Kriang Lerdsuwanakij - - * config-lang.in: Add semantics.c to gtfiles. - * cp-tree.h (flagged_type_tree_s): Remove lookups field. - (saved_scope): Likewise. - (type_lookups): Remove. - (deferred_access): New structure. - (type_access_control): Remove. - (save_type_access_control): Likewise. - (reset_type_access_control): Likewise. - (decl_type_access_control): Likewise. - (push_deferring_access_checks): Declare. - (resume_deferring_access_checks): Likewise. - (stop_deferring_access_checks): Likewise. - (pop_deferring_access_checks): Likewise. - (get_deferred_access_checks): Likewise. - (pop_to_parent_deferring_access_checks): Likewise. - (perform_deferred_access_checks): Likewise. - (perform_or_defer_access_check): Likewise. - * decl.c (make_typename_type): Use perform_or_defer_access_check. - (make_unbound_class_template): Likewise. - (grokdeclarator): Don't call decl_type_access_control. - * parser.c (cp_parser_context): Remove deferred_access_checks - and deferring_access_checks_p fields. - (cp_parser_context_new): Adjust. - (cp_parser): Remove access_checks_lists. - (cp_parser_defer_access_check): Remove. - (cp_parser_start_deferring_access_checks): Remove. - (cp_parser_stop_deferring_access_checks): Remove. - (cp_parser_perform_deferred_access_checks): Remove. - (cp_parser_nested_name_specifier_opt): Use new deferred access - functions. - (cp_parser_simple_declaration): Likewise. - (cp_parser_template_id): Likewise. - (cp_parser_function_definition): Likewise. - (cp_parser_class_specifier): Likewise. - (cp_parser_lookup_name): Likewise. - (cp_parser_single_declaration): Likewise. - (cp_parser_pre_parsed_nested_name_specifier): Likewise. - (cp_parser_parse_tentatively): Likewise. - (cp_parser_parse_definitely): Likewise. - (yyparse): Likewise. - (cp_parser_init_declarator): Remove access_checks parameter. - Use new deferred access functions. - (cp_parser_function_definition_from_specifiers_and_declarator): - Likewise. - (cp_parser_class_head): Remove deferring_access_checks_p and - saved_access_checks parameters. Use new deferred access functions. - (cp_parser_member_specification_opt): Don't call - reset_type_access_control. - * search.c (type_access_control): Remove. - * semantics.c: Include "gt-cp-semantics.h". - (deferred_type_access_control): Remove. - (deferred_access_stack): New variable. - (deferred_access_free_list): Likewise. - (push_deferring_access_checks): New function. - (resume_deferring_access_checks): Likewise. - (stop_deferring_access_checks): Likewise. - (pop_deferring_access_checks): Likewise. - (get_deferred_access_checks): Likewise. - (pop_to_parent_deferring_access_checks): Likewise. - (perform_deferred_access_checks): New function, adapted from - cp_parser_perform_deferred_access_checks. - (perform_or_defer_access_check): New function, adapted from - cp_parser_defer_access_check. - (current_type_lookups): Remove. - (deferred_type_access_control): Likewise. - (decl_type_access_control): Likewise. - (save_type_access_control): Likewise. - (reset_type_access_control): Likewise. - (begin_function_definition): Adjust. - (begin_class_definiton): Likewise. - -2003-01-13 Jason Merrill - - PR c++/8748 - * class.c (build_base_path): Take the address before calling save_expr. - - * call.c (build_user_type_conversion_1): Do set ICS_BAD_FLAG if - all the ambiguous conversions are bad. - - * class.c (maybe_warn_about_overly_private_class): Don't stop - searching when we find a nonprivate method. - - * typeck.c (build_class_member_access_expr): Use unary_complex_lvalue. - -2003-01-12 Mark Mitchell - - * cp-tree.h (get_arglist_len_in_bytes): Remove. - - PR c++/9264 - * parser.c (cp_parser_elaborated_type_specifier): Handle erroneous - typeame types more robustly. - -2003-01-11 Phil Edwards - - * parser.c: Fix comment typos. - -2003-01-10 Mark Mitchell - - PR c++/9099 - * parser.c (cp_parser_scope_through_which_access_occurs): Handle - an object_type which is not a class type. - -2003-01-10 Geoffrey Keating - - * parser.c (cp_parser_late_parsing_for_member): Don't cast to void. - (cp_parser_late_parsing_default_args): Likewise. - -2003-01-10 Nathanael Nerode - - * cfns.gperf: ANSIfy function declarations. - * cfns.h: Regenerate. - * cp-tree.h: ANSIfy function declarations. - -2003-01-10 Mark Mitchell - - * cp-tree.h (reparse_absdcl_as_expr): Remove. - (reparse_absdcl_as_casts): Likewise. - (reparse_decl_as_expr): Likewise. - (finish_decl_parsing): Likewise. - * decl2.c (reparse_absdcl_as_expr): Remove. - (reparse_absdcl_as_casts): Likewise. - (repase_decl_as_expr): Likewise. - (finish_decl_parsing): Likewise. - - PR c++/9128 - PR c++/9153 - PR c++/9171 - * parser.c (cp_parser_pre_parsed_nested_name_specifier): New - function. - (cp_parser_nested_name_specifier_opt): Correct the - check_dependency_p false. - (cp_parser_postfix_expression): Fix formatting. - (cp_parser_decl_specifier_seq): Avoid looking for constructor - declarators when possible. - (cp_parser_template_id): Avoid performing name-lookup when - possible. - (cp_parser_class_head): Do not count specializations when counting - levels of templates. - (cp_parser_constructor_declarator_p): Return immediately if - there's no chance that the tokens form a constructor declarator. - * rtti.c (throw_bad_typeid): Add comment. Do not return an - expression with reference type. - (get_tinfo_decl_dynamic): Do not return an expression with - reference type. - (build_typeid): Add comment. Do not return an expression with - reference type. - * typeck.c (build_class_member_access_expr): Improve handling of - conditionals and comma-expressions as objects. - -2003-01-09 Nathanael Nerode - - * cfns.gperf: ANSIfy function declarations. - * cfns.h: Regenerate. - * cp-tree.h: ANSIfy function declarations. - * parser.c: ANSIfy function declarations & definitions. - - * decl.c (bad_specifiers): Fix parameter order error I introduced. - -2003-01-09 Geoffrey Keating - - Merge from pch-branch: - - 2003-01-09 Geoffrey Keating - - Merge to tag pch-merge-20030102: - - * semantics.c (finish_translation_unit): Don't call finish_file. - * parser.c: Don't include ggc.h. - (cp_lexer_new_main): Rename from cp_lexer_new, only create main lexer, - read first token here. Don't allow PCH files after the first - token is read. - (cp_lexer_new_from_tokens): Duplicate functionality from cp_lexer_new. - (cp_lexer_get_preprocessor_token): Allow LEXER to be NULL. - (cp_parser_new): Call cp_lexer_new_main before allocating GCed memory. - (cp_parser_late_parsing_for_member): Don't duplicate call to - cp_lexer_set_source_position_from_token. - (cp_parser_late_parsing_default_args): Likewise. - (yyparse): Call finish_file after clearing the_parser. - - 2002-12-11 Geoffrey Keating - - * Make-lang.in: Remove $(GGC_H) from all dependencies. - (CXX_TREE_H): Add $(GGC_H). - * class.c: Don't include ggc.h. - (field_decl_cmp): Make parameters be 'const void *' to match qsort. - (method_name_cmp): Likewise. - (resort_data): New variable. - (resort_field_decl_cmp): New. - (resort_method_name_cmp): New. - (resort_sorted_fields): New. - (resort_type_method_vec): New. - (finish_struct_methods): Delete cast. - (finish_struct_1): Delete cast. - * cp-tree.h: Include ggc.h. - (struct lang_type_class): Add reorder attribute to field `methods'. - (union lang_decl_u3): Add reorder attribute to field `sorted_fields'. - (resort_sorted_fields): New prototype. - (resort_type_method_vec): New prototype. - * call.c: Don't include ggc.h. - * decl.c: Likewise. - * decl2.c: Likewise. - * init.c: Likewise. - * lex.c: Likewise. - * method.c: Likewise. - * optimize.c: Likewise. - * parse.y: Likewise. - * pt.c: Likewise. - * repo.c: Likewise. - * search.c: Likewise. - * semantics.c: Likewise. - * spew.c: Likewise. - * tree.c: Likewise. - - * lang-specs.h: Remove comment. - - 2002-12-03 Geoffrey Keating - - * cp-tree.h (struct operator_name_info_t): Mark for GTY machinery. - (operator_name_info): Mark to be saved for PCH, specify size. - (assignment_operator_name_info): Likewise. - - 2002-11-19 Geoffrey Keating - - * decl.c (anon_cnt): Mark to be saved for PCH. - - 2002-10-25 Geoffrey Keating - - * lex.c (init_reswords): Delete now-untrue comment. - Allocate ridpointers using GGC. - - 2002-10-04 Geoffrey Keating - - * cp-tree.h (union lang_decl_u2): Add tags to all fields. - - * g++spec.c (lang_specific_driver): Don't include standard - libraries in `added'. - - 2002-08-27 Geoffrey Keating - - * decl2.c (finish_file): Call c_common_write_pch. - * Make-lang.in (CXX_C_OBJS): Add c-pch.o. - - 2002-08-17 Geoffrey Keating - - * g++spec.c (lang_specific_driver): Treat .h files as C++ header - files when using g++. - * lang-specs.h: Handle compiling C++ header files. - -2003-01-09 Jakub Jelinek - - * decl.c (start_decl): Only check DECL_THREAD_LOCAL for VAR_DECLs. - -2003-01-09 Kriang Lerdsuwanakij - - * pt.c (push_access_scope_real): Call push_to_top_level for - function in namespace scope. - (pop_access_scope): Call pop_from_top_level for function in - namespace scope. - -2003-01-09 Jakub Jelinek - - * decl.c (start_decl): Don't set DECL_COMMON for __thread variables. - -2003-01-09 Christian Cornelssen - - * Make-lang.in (c++.install-common, c++.install-man, - c++.uninstall): Prepend $(DESTDIR) to destination paths in - all (un)installation commands. - (c++.install-common): Rewrite $(LN) commands to support - DESTDIR with "ln" as well as with "ln -s". - -2003-01-08 Jason Merrill - - * parser.c (cp_parser_primary_expression): See through explicitly - scoped ALIAS_DECLs, too. - -2003-01-08 Nathanael Nerode - - * decl.c: Remove some #if 0 code. - - * decl.c: ANSIfy function declarations. - -2003-01-07 Mark Mitchell - - * parser.c (cp_parser_asm_definition): Correct handling of omitted - operands. - -2003-01-08 Kriang Lerdsuwanakij - - PR c++/9030 - * decl.c (make_typename_type): Check access only when tf_error. - (make_unbound_class_template): Likewise. - * pt.c (saved_access_scope): New variable. - (push_access_scope_real): New function. - (push_access_scope): Likewise. - (pop_access_scope): Likewise. - (tsubst_default_argument): Use them. - (instantiate_template): Likewise. - (regenerate_decl_from_template): Likewise. - (instantiate_decl): Likewise. - (get_mostly_instantiated_function_type): Likewise. - -2003-01-07 Nathanael Nerode - - * tree.c: Delete bogus #if 0 code. - -2003-01-07 Andreas Schwab - - * class.c (layout_class_type): Don't use - PCC_BITFIELD_TYPE_MATTERS if not defined. - -2003-01-06 Mark Mitchell - - PR c++/9165 - * decl2.c (build_cleanup): Mark the object as used. - - * pt.c (retrieve_local_specialization): Revert 2003-01-05 change. - (hash_local_specialization): New function. - (register_local_specialization): Revert 2003-01-05 change. - (instantiate_decl): Use hash_local_specialization when creating - the local_specializations table. - - * decl2.c (mark_used): Do not synthesize thunks. - - * class.c (layout_class_type): Correct handling of unnamed - bitfields wider than their types. - - PR c++/9189 - * parser.c (cp_parser): Remove default_arg_types. Update - documentation for unparsed_functions_queues. - (cp_parser_late_parsing_default_args): Take a FUNCTION_DECL as the - parameter. - (cp_parser_new): Don't set parser->default_arg_types. - (cp_parser_function_definition): Adjust usage of - unparsed_funtions_queues. - (cp_parser_class_specifier): Don't mess with - parser->default_arg_types. Handle default argument processing in - a separate phase from function body processing. - (cp_parser_template_declaration_after_export): Adjust usage of - unparsed_functions_queues. - (cp_parser_late_parsing_for_member): Do not handle default - arguments. - -2003-01-06 Nathan Sidwell - - PR c++/9109 - * parser.c (cp_parser_declarator_kind): New enum. - (cp_parser_declarator): Adjust. - (cp_parser_direct_declarator): Adjust. Allow for either named or - abstract declarator. Prefer abstract, if possible. Allow - parenthesized function name. - (cp_parser_condition): Adjust cp_parser_declarator call. - (cp_parser_explicit_instantiation): Likewise. - (cp_parser_init_declarator): Likewise. - (cp_parser_type_id): Likewise. - (cp_parser_function_definition): Likewise. - (cp_parser_member_declaration): Likewise. - (cp_parser_parameter_declaration): Use cp_parser_declarator to do - the tentative parsing. - (cp_parser_exception_declaration): Likewise. - -2003-01-05 Mark Mitchell - - * parser.c (cp_parser_template_parameter): Adjust call to - cp_parser_parameter_declaration. - (cp_parser_parameter_declaration_list): Likewise. - (cp_parser_parameter_declaration): Replace - greater_than_is_operator_p with template_parm_p parameter. Do not - cache tokens for template default arguments. - - * pt.c (retrieve_local_specialization): Use htab_find, not - htab_find_with_hash. - (register_local_specialization): Use htab_find_slot, not - htab_find_slot_with_hash. - (instantiate_decl): Pass a hash function to htab_create. - -2003-01-04 Kaveh R. Ghazi - - * parser.c (cp_parser_binary_expression, - cp_parser_multiplicative_expression, - cp_parser_additive_expression, cp_parser_shift_expression, - cp_parser_relational_expression, cp_parser_equality_expression, - cp_parser_and_expression, cp_parser_exclusive_or_expression, - cp_parser_inclusive_or_expression, - cp_parser_logical_and_expression, cp_parser_logical_or_expression, - cp_parser_binary_expression): Const-ify. - -2003-01-04 Mark Mitchell - - * method.c (use_thunk): Disable access control while building the - body of the thunk. - -2003-01-03 Nathanael Nerode - - * cvt.c, decl.c, decl2.c: This is the C++ front end, not the C - front end. - -2003-01-03 Matt Austern - - * cp-tree.h (struct lang_type_class): add field for key method - (cp_global_trees): rename dynamic_classes to keyed_classes - (key_method): add definition - * class.c (finish_struct_1): compute class's key method, and add - the class to keyed_classes list if there is no key method. - * decl.c (finish_function): add class to keyed_classes list if we - see a definition of the class's key method. - * pt.c (instantiate_class_template): add template specialization - of a dynamic class to keyed_classes list. - * decl2.c (key_method): remove - (finish_file): iterate only through keyed_classes list when - deciding whether to emit vtables, remove class from its list after - we do the emission. - -2003-01-02 Jason Merrill - - * call.c (build_conditional_expr): Stabilize lvalues properly. - * cvt.c (ocp_convert): Don't build NOP_EXPRs of class type. - * tree.c (lvalue_p_1): Don't allow sloppy NOP_EXPRs as lvalues. - Don't allow CALL_EXPR or VA_ARG_EXPR, either. - - * call.c (convert_like_real): Call decl_constant_value for an - IDENTITY_CONV even if there are no more conversions. - - * cvt.c (build_up_reference): Don't push unnamed temps. - - * decl2.c (do_namespace_alias): Namespace aliases are DECL_EXTERNAL. - - * dump.c (cp_dump_tree): Don't try to dump class-specific fields - for a backend struct. - - * except.c (wrap_cleanups_r, build_throw): Make - MUST_NOT_THROW_EXPRs void. - * init.c (expand_default_init): Update to handle MUST_NOT_THROW_EXPR. - - * init.c (build_vec_delete_1): Pre-evaluate the base address. - - * init.c (get_temp_regvar): Simplify logic. - - * tree.c (cp_copy_res_decl_for_inlining): Only do debug tweaks if - our replacement is a decl. - - * decl.c (cp_make_fname_decl): Push the decls inside the - outermost scope. - -2003-01-03 Nathan Sidwell - - PR c++/45, c++/3784 - * tree.c (cp_tree_equal, TEMPLATE_PARM_INDEX): The types must be - the same too. - -2003-01-03 Graham Stott - - * parser.c (struct cp_parser): Add access_checks_lists field - (cp_parser_simple_declaration): Use. - (cp_parser_init_declarator): Likewise. - -2003-01-02 Mark Mitchell - - * parser.c (cp_parser_declaration): Accept the __extension__ - keyword before the declaration. - - PR c++/2843 - * parser.c (cp_parser_parameter_declaration): Allow attributes to - appear after the declarator. - - * call.c (build_new_method_call): Fix typo in message format - string. - -2003-01-02 Mark Mitchell - - * parser.c (cp_lexer_next_token_is): Declare it inline. - (cp_lexer_set_source_position_from_token): Likewise. - (cp_lexer_debugging_p): Likewise. - (cp_parser_parsing_tentatively): Likewise. - (cp_parser_nested_name_specifier_opt): Reduce the number of calls - to the cp_lexer_peek_token. - - * parser.c (cp_parser_sizeof_operand): Do not evaluate the - expression. - -2003-01-02 Steven Bosscher - - * cp/except.c, cp/expr.c, cp/friend.c, cp/g++spec.c, - cp/lang-options.h, cp/lang-specs.h, cp/lex.h, cp/ptree.c, - cp/repo.c: Fix copyright years. - -2003-01-01 Neil Booth - - * lex.c: Remove superfluous include of cpplib.h. - (CONSTRAINT): Define without conditions. - (init_cp_pragma): Use c_register_pragma. - -2002-12-31 Neil Booth - - * .cvsignore: Remove. - -2002-12-31 Steven Bosscher - - * call.c, class.c, cp-lang.c, cp-tree.h, cvt.c, dump.c, error.c, - except.c, expr.c friend.c, g++spec.c, init.c, lang-options.h, - lang-specs.h, lex.c, mangle.c, method.c, optimize.c, parser.c, - pt.c, ptree.c, repo.c, rtti.c, search.c, semantics.c, tree.c, - typeck.c, typeck2.c: Replace "GNU CC" with "GCC" in the - copyright header. - * lex.h: parse.y is dead, so don't mention it. Also replace the - copyright header with the default GNU copyright header. - -2002-12-31 Mark Mitchell - - * cp-tree.h (LOOKUP_TEMPLATES_EXPECTED): Remove. - (lookup_name_namespace_only): Likewise. - (begin_only_namespace_names): Likewise. - (end_only_namespace_names): Likewise. - * decl.c (only_namespace_names): Remove. - (qualify_lookup): Do not check LOOKUP_TEMPLATES_EXPECTED. - (lookup_name_real): Do not check only_namespace_names. - (lookup_name_namespace_only): Remove. - (begin_only_namespace_names): Likewise. - (end_only_namespace_names): Likewise. - * parser.c (cp_parser_nested_name_specifier_opt): Handle erroneous - nested-name-specifiers more gracefully. - (cp_parser_class_or_namespace_name): Avoid looking up namespace - names when they cannot possibly appear. - (cp_parser_template_name): Adjust call to cp_parser_lookup_name. - (cp_parser_elaborated_type_specifier): Likewise. - (cp_parser_namespace_name): Only look for namespace names. - (cp_parser_lookup_name): Add is_namespace parameter. - (cp_parser_lookup_name_simple): Adjust call to - cp_parser_lookup_name. - - * parser.c (cp_parser_dependent_type_p): Fix thinko. - -2002-12-31 Neil Booth - - * .cvsignore: Update. - -2002-12-31 Nathan Sidwell - - * class.c (modify_vtable_entry): Remove unused variable. - (get_vcall_index): Always expect a non-thunk. - (update_vtable_entry_for_fn): Combine covariant adjustments, when - overriding a thunk. Pass get_vcall_index a non-thunk. - - * decl2.c (finish_file): Mark undefined inlines as extern. - -2002-12-31 Mark Mitchell - - * cp-tree.def (RETURN_INIT): Remove. - * cp-tree.h (DECL_IN_MEMORY_P): Remove. - (scope_kind): Add sk_block, sk_try, sk_catch, sk_for. - (note_level_for_for): Remove. - (note_level_for_try): Likewise. - (note_level_for_catch): Likewise. - (finish_named_return_value): Likewise. - (do_pushlevel): Change prototype. - (pending_lang_change): Remove. - * decl.c (begin_scope): Handle sk_block, sk_try, sk_catch, - sk_for. - (note_level_for_for): Remove. - (note_level_for_try): Likewise. - (note_level_for_catch): Likewise. - (maybe_inject_for_scope_var): Remove use of DECL_IN_MEMORY_P. - * parser.c (cp_parser_context_free_list): Make it "deletable". - (cp_parser_template_argument): Remove misleading comment. - * pt.c (tsubst_expr): Remove RETURN_INIT code. - * semantics.c (genrtl_named_return_value): Remove. - (do_pushlevel): Take a scope kind as an argument. - (begin_if_stmt): Adjust. - (begin_while_stmt): Likewise. - (begin_for_stmt): Likewise. - (finish_for_init_stmt): Likewise. - (begin_switch_stmt): Likewise. - (begin_handler): Likewise. - (begin_compound_stmt): Likewise. - (finish_named_return_value): Remove. - (cp_expand_stmt): Remove RETURN_INIT case. - * tree.c (cp_statement_code_p): Remove RETURN_INIT case. - -2002-12-31 Mark Mitchell - - PR c++/9112 - * parser.c (cp_parser_direct_declarator): Handle erroneous - parenthesized declarators correctly. - -2002-12-31 Gabriel Dos Reis - - * cp-tree.h (pending_lang_change): Declare. - -2002-12-30 Mark Mitchell - - * parser.c (cp_parser_context_free_list): New variable. - (cp_parser_context_new): Use it. - (cp_parser_error): Check return code from - cp_parser_simulate_error. - (cp_parser_simulate_error): Return a value. - (cp_parser_id_expression): Optimize common case. - (cp_parser_class_name): Likewise. - (cp_parser_class_specifier): Adjust call to - cp_parser_late_parsing_default_args. - (cp_parser_lookup_name): Optimize common case. - (cp_parser_late_parsing_for_member): Adjust call to - cp_parser_late_parsing_default_args. - (cp_parser_late_parsing_default_args): Add scope parameter. - (cp_parser_require): Avoid creating the error message unless it's - needed. - (cp_parser_parse_definitely): Place free'd contexts on the free - list. - - * parser.c (cp_parser_declaration_seq_opt): Handle pending_lang_change. - -2002-12-30 David Edelsohn - - * parser.c (cp_parser_parameter_declaration_clause): Treat system - header as extern "C" if NO_IMPLICIT_EXTERN_C undefined. - -2002-12-30 Nathanael Nerode - - * config-lang.in, Make-lang.in, operators.def, cp-tree.def: - GCC, not GNU CC. - -2002-12-30 Mark Mitchell - - * parse.y: Remove. - * spew.c: Likewise. - * Make-lang.in (gt-cp-spew.h): Remove. - * cp-tree.h (do_pending_lang_change): Remove. - (do_identifier): Change prototype. - (finish_id_expr): Remove. - * decl.c (lookup_name_real): Remove yylex variable. - * decl2.c (build_expr_from_tree): Adjust call to do_identifier. - * lex.c (init_cpp_parse): Remove. - (reduce_cmp): Likewise. - (token_cmp): Likewise. - (yychar): Likewise. - (lastiddecl): Likewise. - (token_count): Likewise. - (reduce_count): Likewise. - (yyhook): Likewise. - (print_parse_statistics): Likewise. - (do_pending_lang_change): Likewise. - (do_identifier): Remove parsing parameter. - * lex.h (lastiddecl): Remove. - (looking_for_typename): Remove. - (looking_for_template): Likewise. - (pending_lang_change): Likewise. - (yylex): Likewise. - * semantics.c (finish_id_expr): Remove. - - * decl.c (grokdeclarator): Diagnost "extern thread" and "static - thread" correctly. - -2002-12-30 Nathanael Nerode - - * decl.c, decl2.c, decl.h: GCC, not GNU CC. This is the C++ front - end, not the C front end. - -2002-12-30 Nathan Sidwell - - * cp-tree.h (THUNK_TARGET): New macro. - (THUNK_VIRTUAL_OFFSET): For result thunks it is always a binfo. - (finish_thunk): Remove offset parms. - * class.c (find_final_overrider): Look through thunks. - (get_vcall_index): Use THUNK_TARGET. - (update_vtable_entry_for_fn): Look through thunks. Set covariant - fixed offset here. Adjust finish_thunk call. - (build_vtbl_initializer): Adjust finish_thunk calls. - * mangle.c (mangle_call_offset): Remove superfluous if. - (mangle_thunk): Adjust. - * method.c (make_thunk): Adjust. - (finish_thunk): Adjust. - (thunk_adjust): Remove assert. - (use_thunk): Use THUNK_TARGET - * dump1.c (cp_dump_tree): Adjust thunk dumping. - - PR c++/9054 - * class.c (layout_class_type): Set TYPE_CONTEXT of type for base. - * dump.c (cp_dump_tree, RECORD_TYPE): Deal with type for base types. - -2002-12-28 Gabriel Dos Reis - - Remove traditional C constructs 4/n. - * decl2.c (grok_method_quals, warn_if_unknown_interface, - grok_x_components, cp_build_parm_decl, build_artificial_parm, - maybe_retrofit_in_chrg, grokclassfn, grok_array_decl, - delete_sanity, check_member_template, check_java_method, - check_classfn, finish_static_data_member_decl, grokfield, - grokbitfield, grokoptypename, grok_function_init, - cplus_decl_attributes, constructor_name, defer_fn, - build_anon_union_vars, finish_anon_union, coerce_new_type, - coerce_delete_type, comdat_linkage, maybe_make_one_only, - key_method, import_export_vtable, import_export_class, - output_vtable_inherit, import_export_decl, import_export_tinfo, - build_cleanup, get_guard, get_guard_bits, get_guard_cond, - set_guard, start_objects, finish_objects, - start_static_storage_duration_function, - finish_static_storage_duration_function, get_priority_info, - start_static_initialization_or_destruction, - finish_static_initialization_or_destruction, - do_static_initialization, do_static_destruction, - prune_vars_needing_no_initialization, write_out_vars, - reparse_decl_as_expr, finish_decl_parsing, namespace_ancestor, - add_using_namespace, merge_functions, ambiguous_decl, - lookup_using_namespace, lookup_using_namespace, - qualified_lookup_using_namespace, set_decl_namespace, - decl_namespace, current_decl_namespace, push_decl_namespace, - pop_decl_namespace, push_scope, pop_scope, add_function, - arg_assoc_namespace, arg_assoc_template_arg, arg_assoc, - lookup_arg_dependent, do_namespace_alias, - validate_nonmember_using_decl, do_nonmember_using_decl, - do_toplevel_using_decl, do_local_using_decl, - do_class_using_decl, do_using_directive, check_default_args, - mark_used, handle_class_head): Use C90 prototypings. Use booleans. - * parser.c (cp_parser_class_head): Use booleanss. - * decl.c (walk_globals, walk_vtables): Likewise. - * cp-tree.h (walk_globals_pred, walk_globals_fn, walk_vtables, - walk_globals): Change return type from 'int' to 'bool'. - * rtti.c (init_rtti_processing, build_headof, throw_bad_cast - throw_bad_typeid, get_tinfo_decl_dynamic, typeid_ok_p, - build_typeid, tinfo_name, get_tinfo_decl, get_tinfo_ptr, - get_typeid, ifnonnull, build_dynamic_cast_1, build_dynamic_cast, - qualifier_flags, tinfo_base_init, generic_initializer, - ptr_initializer, dfs_class_hint_mark, ptm_initializer, - dfs_class_hint_unmark, class_hint_flags, class_initializer, - typeinfo_in_lib_p, get_pseudo_ti_init, create_pseudo_type_info, - get_pseudo_ti_desc, create_tinfo_types, emit_support_tinfos, - unemitted_tinfo_decl_p, emit_tinfo_decl): Likewise. - * repo.c (repo_compile_flags, repo_template_declared, - repo_template_defined, repo_class_defined, repo_get_id, - repo_template_used, repo_vtable_used, repo_inline_used, - repo_tinfo_used, repo_template_instantiated, extract_string, - open_repo_file, afgets, init_repo, reopen_repo_file_for_write, - finish_repo): Likewise. - * ptree.c (cxx_print_decl, cxx_print_type, cxx_print_identifier, - cxx_print_xnode): Likewise.. - * cp-lang.c (ok_to_generate_alias_set_for_type, cxx_get_alias_set, - cxx_warn_unused_global_decl, cp_expr_size): Likewise. - * cxxfilt.c (demangle_it, print_demangler_list, usage, - standard_symbol_characters, hp_symbol_characters, main, fatal): - Likewise. - (strip_underscore): Change type from 'int' to 'bool'. - (main): Use boolean constants. - -2002-12-28 Gabriel Dos Reis - - Remove traditional C constructs 3/n. - * cvt.c (cp_convert_to_pointer, convert_to_pointer_force, - build_up_reference, warn_ref_binding, convert_to_reference, - convert_from_reference, convert_lvalue, cp_convert, ocp_convert, - convert_to_void, convert, convert_force, build_type_conversion, - build_expr_type_conversion, type_promotes_to, - perform_qualification_conversions): Use C90 prototyping style. - * decl2.c (grok_array_decl): Use boolean constant. - (delete_sanity): Likewise. - * typeck.c (build_unary_op): Likewise. - * semantics.c (finish_switch_cond): Likewise. - * parser.c (cp_parser_direct_new_declarator): Likewise. - * init.c (build_new): Likewise. - -2002-12-27 Mark Mitchell - - * Make-lang.in (po-generated): Remove parse.c. - (CXX_OBJS): Remove parse.o and spew.o. Add parser.o. - ($(srcdir)/cp/parse.h): Remove target. - ($(srcdir)/cp/parse.c): Likewise. - (gt-cp-parse.h): Likewise. - (gt-cp-parser.h): New target. - (c++.distclean): Do not remove parse.output. - (c++.maintainer-clean): Do not remove parse.c or parse.h. - (cp/spew.o): Remove target. - (cp/lex.o): Adjust dependencies. - (cp/pt.o): Likewise. - (cp/parse.o): Likewise. - (cp/TAGS): Do not mention parse.c. - (cp/parser.o): New target. - * NEWS: Mention the new parser. - * call.c (build_scoped_method_call): Simplify. - (build_method_call): Likewise. - (build_new_function_call): Adjust calls to add_function_candidate - and add_template_candidate. - (build_new_op): Improve handling of erroroneous operands. - (convert_default_arg): Remove circular argument processing. - (name_as_c_string): New function. - (build_new_method_call): Use it. - (perform_implicit_conversion): Use error_operand_p. - * class.c (finish_struct_anon): Use constructor_name_p. - (check_field_decls): Likewise. - (pop_nested_class): Use OVL_NEXT, not OVL_CHAIN. - (resolve_address_of_overloaded_function): Likewise. - (instantiate_type): Tweak pointer-to-member handling. - (get_primary_binfo): Remove incorrect assertion. - * config-lang.in (gtfiles): Add parser.c, remove parse.c. - * cp-tree.h (DEFARG_TOKENS): New macro. - (default_arg): New structure. - (cp_tree_node_structure_enum): Add TS_CP_DEFAULT_ARG. - (lang_tree_node): Add default_arg. - (cp_tree_index): Add CPTI_TYPE_INFO_REF_TYPE. - (type_info_ref_type): New macro. - (saved_scope): Make processing_explicit_instantiation a boolean. - (check_access): New field. - (unparsed_text): Remove. - (language_function): Remove unparsed_inlines. - (error_operand_p): New macro. - (lang_decl): Adjust pending_inline_info. - (DEFARG_POINTER): Remove. - (tag_types): Add typenames. - (lookup_ualified_name): Declare. - (lookup_name_real): Likewise. - (shadow_tag): Adjust prototype. - (get_scope_of_declarator): Declare it. - (process_next_inline): Remove it. - (check_for_missing_semicolon): Likewise. - (maybe_get_template_decl_from_type_decl): Declare it. - (finish_label_stmt): Adjust prototype. - (finish_non_static_data_meber): Declare it. - (finish_pseudo_destructor_call_expr): Rename to ... - (finish_pseudo_destructor_expr): ... this. - (finish_compound_literal): Declare it. - (begin_inline_definitions): Remove it. - (init_spew): Remove. - (peekyylex): Likewise. - (arbitrate_lookup): Likewise. - (frob_opname): Likewise. - (maybe_snarf_defarg): Likewise. - (add_defarg_fn): Likewise. - (do_pending_defargs): Likewise. - (done_pending_defargs): Likewise. - (unprocessed_defarg_fn): Likewise. - (replace_defarg): Likewise. - (end_input): Likewise. - (get_overloaded_fn): Likewise. - * cvt.c (convert_to_reference): Improve error handling. - * decl.c (lookup_name_real): Do not declare it static. - (maybe_push_to_top_level): Set check_access. - (identifier_type_value): Adjust call to lookup_name_real. - (lookup_qualified_name): New method. - (lookup_name_real): Remove special-case parsing code. - (lookup_name-nonclass): Adjust call to lookup_name_real. - (lookup_name_namespace_only): Likewise. - (lookup_name): Likewise. - (check_tag_decl): Return the type declared. - (shadow_tag): Likewise. - (register_dtor_fn): Tweak check_access. - (grokfndecl): Use constructor_name_p. - (get_scope_of_declarator): New function. - (grokdeclarator): Obscure tweaks for slightly different declarator - representations. - (start_method): Return error_mark_node to indicate failure. - (cp_tree_node_structure_enum): Use TS_CP_DEFAULT_ARG for DEFAULT_ARGs. - * decl2.c (constructor_name_full): Simplify. - (constructor_name): Use it. - (build_expr_from_tree): Adjust for changes to do new parser. - (push_scope): Improve robustness. - (validate_nonmember_using_decl): Process declarations, not names. - (do_class_using_decl): Likewise. - (handle_class_head): Do not mess with CLASSTYPE_DECLARED_CLASS - here. - * error.c (dump_expr): Handle IDENTIFIER_NODEs and BASELINKs. - * expr.c (cxx_expand_expr): Handle BASELINKs. - * init.c (member_init_ok_or_else): Issue more errors. - (build_offset_ref): Tweak handling of FUNCTION_DECLs. - * lex.c: Do not include parse.h. - (yypring): Do not declare. - (yylval): Likewise. - (make_reference_declarator): Remove error-generating code. - (rid_to_yy): Remove. - (cxx_init): Do not call init_spew. - (yypring): Remove. - (check_for_missing_semicolon): Remove. - * lex.h (got_scope): Remove. - (got_object): Remove. - * method.c (hack_identifier): Use finish_non_static_data_member. - (implicitly_declare_fn): Adjust use of constructor_name. - * parser.c: New file. - * pt.c (parse.h): Do not include it. - (maybe_get_template_decl_from_template): Do not declare it. - (finish_member_template_decl): Tweak. - (begin_explicit_instantiation): Adjust for - processing_explicit_instantiation being boolean. - (end_explicit_instantiation): Likewise. - (maybe_process_partial_specialization): Tighten specialization - test. - (retrieve_local_specialization): Adjust ue of hash table. - (eq_local_specializations): New function. - (register_local_specialization): Likewise. - (push_template_decl_real): Remove unnecessary test. - (maybe_get_template_decl_from_type_decl): Don't make it static. - (for_each_template_parm_r): Handle TYPEOF_TYPE. - (tsubst_copy): Use retrieive_local_specialization to handle - PARM_DECL. Adjust handling of CONST_DECLs. Handle BASELINKs. - Handle COMPONENT_REFs with pseudo-destructor-expressions. - Simplify handling of CALL_EXPR and METHOD_CALL_EXPR. - (tsubst_expr): Pass decls, not names, to do_local_using_decl. - (unify): Tweak handling of CONST_DECLs. - (regenerate_decl_from_template): Use push_nested_class. - (template_for_substitution): New funciton. - (instantiate_decl): Use it. Register parameters as local - specializations. - * rtti.c (init_rtti_processing): Set type_info_ref_type. - (build_typeid): Use it. - (get_typeid): Likeise. - * search.c (accessible_p): Use check_access, not - flag_access_control. - (adjust_result_of_qualified_name_lookup): Pay attention to the - context_class. - * semantics.c (finish_asm_stmt): Adjust error handling. - (finish_label_stmt): Return the statement. - (finish_non_static_data_member): New function. - (finish_class_expr): Handle BASELINKs. - (finish_call_expr): Handle PSEUDO_DTOR_EXPR. - (finish_object_call_expr): Simplify handling during templates. - (finish_pseudo_destructor_call_expr): Rename to ... - (finish_pseudo_dtor_expr): ... this. - (finish_compound_literal): New function. - (begin_inline_definitions): Remove. - (finish_sizeof): Remove special template handling. - * spew.c: Do not include parse.h. - * tree.c (get_overloaded_fn): Remove. - * typeck.c (build_class_member_access_expr): Handle - PSEUDO_DTOR_EXPR. Adjust handling of static member functions. - (lookup_destructor): New function. - (finish_class_member_access_expr): Use it. - (convert_arguments): Simplify. - (build_unary_op): Handle BASELINKs. - -2002-12-26 Nathan Sidwell - - PR c++/4803 - * decl2.c (mark_used): Defer inline functions. - (finish_file): Merge deferred_fns loops. Check all used - inline functions have a definition. - * method.c (make_thunk): Thunks are not inline. - - PR c++/5116, c++/764 - * call.c (build_new_op): Make sure template class operands are - instantiated. - -2002-12-24 Nathan Sidwell - - PR C++/7964 - * cp-tree.h (resolve_scoped_fn_name): Prototype. - * call.c (resolve_scoped_fn_name): New function. Deal with - more template expansion. Broken out of ... - * parse.y (parse_finish_call_expr): ... here. Call it. - * decl2.c (build_expr_from_tree, CALL_EXPR): Use - resolve_scoped_fn_name and build_call_from_tree. - - PR c++/9053 - * decl.c (duplicate_decls): Templates may be disambiguated by - return type. - - PR c++/8702 - * decl2.c (check_classfn): Use lookup_fnfield_1. List all - conversion operators on failure. - -2002-12-23 Gabriel Dos Reis - - Remove traditional C constructs 2/n. - * call.c (tourney, build_field_call, equal_functions, joust, - compare_ics, build_over_call, build_java_interface_fn_ref, - convert_like_real, op_error, build_object_call, resolve_args, - build_vfield_ref, check_dtor_name, build_scoped_method_call, - build_addr_func, build_call, build_method_call, null_ptr_cst_p, - sufficient_parms_p, build_conv, non_reference, strip_top_quals, - standard_conversion, reference_related_p, - reference_compatible_p, convert_class_to_reference, - direct_reference_binding, reference_binding, - ,implicit_conversion, is_complete, promoted_arithmetic_type_p, - add_template_conv_candidate, any_viable, any_strictly_viable, - build_this, splice_viable, print_z_candidates, - build_user_type_conversion, build_new_function_call, - conditional_conversion, build_conditional_expr, build_new_op, - build_op_delete_call, enforce_access, call_builtin_trap, - convert_arg_to_ellipsis, build_x_va_arg, cxx_type_promotes_to, - convert_default_arg, type_passed_as, convert_for_arg_passing, - in_charge_arg_for_name, is_properly_derived_from, - maybe_handle_implicit_object, maybe_handle_ref_bind, - source_type, add_warning, can_convert, can_convert_arg, - perform_implicit_conversion, can_convert_arg_bad, - initialize_reference, add_conv_candidate, - add_template_candidate_real, add_template_candidate): Ansify. - -2002-12-22 Nathan Sidwell - - PR c++/8572 - * cp-tree.h (grokoptypename): Add SCOPE parameter. - * decl2.c (grokoptypename): Add SCOPE parameter. tsubst the type - if in a template scope. - * parse.y (unoperator): Return the scope. - (operator_name): Adjust grokoptypename call. - -2002-12-22 Kriang Lerdsuwanakij - - * cp-tree.h (make_unbound_class_template): Use tsubst_flags_t. - * decl.c (make_unbound_class_template): Adjust. Check for tf_error. - * pt.c (tsubst) [OFFSET_TYPE]: Check for tf_error. - -2002-12-20 Kazu Hirata - - * ChangeLog: Fix a typo. - * class.c: Fix comment typos. - * cp-tree.h: Likewise. - -2002-12-18 Jason Merrill - - Handle anonymous unions at the tree level. - C++ ABI change: Mangle anonymous unions using the name of their - first named field (by depth-first search). Should not cause - binary compatibility problems, though, as the compiler previously - didn't emit anything for affected unions. - * cp-tree.def (ALIAS_DECL): New tree code. - * decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the - first field, not the largest. - (finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME, - push the decl, and write it out at namespace scope. - * decl.c (lookup_name_real): See through an ALIAS_DECL. - (pushdecl): Add namespace bindings for ALIAS_DECLs. - * rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name - of a decl which doesn't have one. - * typeck.c (build_class_member_access_expr): Don't recurse if - we already have the type we want. - -2002-12-18 Kriang Lerdsuwanakij - - PR c++/8099 - * friend.c (make_friend_class): Allow partial specialization - when declaration is not a template friend. - -2002-12-18 Kriang Lerdsuwanakij - - PR c++/3663 - * pt.c (lookup_template_class): Copy TREE_PRIVATE and - TREE_PROTECTED to created decl nodes. - -2002-12-18 Mark Mitchell - - * class.c (build_base_field): Do not set DECL_PACKED on the - FIELD_DECL. - -2002-12-18 Gabriel Dos Reis - - * cp-tree.h (struct tree_srcloc): Use location_t. - (SOURCE_LOCUS): New. - (SRCLOC_FILE, SRCLOC_LINE): Adjust. - -2002-12-17 Jason Merrill - - * decl.c (finish_function): Also complain about no return in - templates. - * semantics.c (finish_return_stmt): Also call check_return_expr in - templates. - * typeck.c (check_return_expr): In a template, just remember that we - saw a return. - -2002-12-16 Jason Merrill - - * semantics.c (simplify_aggr_init_exprs_r): Don't change the type - of the CALL_EXPR. - - * semantics.c (do_pushlevel): Call pushlevel after adding the - SCOPE_STMT. - (do_poplevel): Call poplevel before adding the SCOPE_STMT. - * parse.y (function_body): Go back to using compstmt. - * decl.c (pushdecl): Skip another level to get to the parms level. - - * call.c (build_new_method_call): Use is_dummy_object to determine - whether or not to evaluate the object parameter to a static member - function. - -2002-12-14 Jason Merrill - - * semantics.c (simplify_aggr_init_exprs_r): Also prepend the - return slot for normal functions. Set CALL_EXPR_HAS_RETURN_SLOT_ADDR. - * tree.c (build_cplus_new): If the type isn't TREE_ADDRESSABLE, - don't bother with an AGGR_INIT_EXPR. - (cp_copy_res_decl_for_inlining): If the type isn't TREE_ADDRESSABLE, - just generate a new decl normally. Take return slot parm. - * cp-tree.h: Adjust prototype. - -2002-12-13 Gabriel Dos Reis - - PR C++/8031 - * cvt.c (convert_to_pointer_force): Don't try comparing against - erronous type. - -2002-12-13 Geoffrey Keating - - * cp-tree.h: Have the multiple-include guards around - the entire file. - -2002-12-10 David Edelsohn - - * cp/spew.c (feed_input): Change limit to last_pos and pos to cur_pos - for SPEW_DEBUG. - (snarf_method): Same. - (snarf_defarg): Same. - -2002-12-10 Mark Mitchell - - PR c++/8372 - * pt.c (tsubst_copy): Handle destructor names more correctly. - -2002-12-10 Matt Austern - - * cp-tree.h: get rid of needs_virtual_reinit bit. - -2002-12-09 Mark Mitchell - - * NEWS: Document removal of in-class initialization extension for - static data members of non-arithmetic, non-enumeration type. - * decl.c (check_static_variable_definition): Do not allow that - extension. - * decl2.c (grokfield): Do not call digest_init when processing - templates. - -2002-12-05 Kaveh R. Ghazi - - * error.c (dump_expr): Fix format specifier warning. - -2002-12-04 Geoffrey Keating - - * class.c (finish_struct_1): Correct comment. - * cp-tree.c (DECL_SORTED_FIELDS): Likewise. - -2002-12-04 Gabriel Dos Reis - - PR C++/8799 - * error.c (dump_expr): Don't ever try to dump a non-existent - expression. - -2002-12-03 Nathan Sidwell - - Implement covariant returns. - * cp-tree.h (IS_AGGR_TYPE_2): Remove. - (struct lang_decl_flags): Add this_thunk_p flag. - Rename vcall_offset to virtual_offset. - (struct lang_decl): Rename delta to fixed_offset. - (DECL_THIS_THUNK_P, DECL_RESULT_THUNK_P): New #defines. - (SET_DECL_THUNK_P): Add THIS_ADJUSTING arg. - (THUNK_DELTA, THUNK_VCALL_OFFSET): Rename to ... - (THUNK_FIXED_OFFSET, THUNK_VIRTUAL_OFFSET): ... here. - (make_thunk): Add this_adjusting arg. - (finish_thunk): Declare. - (mangle_thunk): Add this_adjusting arg. - * class.c (get_vcall_index): Use base function for lookup. - (update_vtable_entry_for_fn): Generate covariant thunk. - (finish_struct_1): Set DECL_VINDEX to NULL for thunks. - (build_vtbl_initializer): Use base function for lookup. - Finish covariant thunk here. Adjust thunk generation. - * dump.c (cp_dump_tree): Simplify DECL_GLOBAL_[CD]TOR_P handling. - Adjust thunk dumping. - * mangle.c (mangle_call_offset): New function. - (mangle_thunk): Adjust for covariant thunks. - * method.c (make_thunk): Adjust. Do not set name here. - (finish_thunk): New function. Set name here. - (use_thunk): Generate covariant thunks too. - (thunk_adjust): New function. - * search.c (covariant_return_p): Remove. Fold into ... - (check_final_overrider): ... here. Simplify. - * semantics.c (emit_associated_thunks): Walk covariant thunk lists. - -2002-12-03 Jason Merrill - - PR c++/8674 - * call.c (build_over_call): Check specifically for TARGET_EXPR - when eliding. - - PR c++/8461, c++/8625 - * call.c (convert_for_arg_passing): Don't mess with error_mark_node. - (cp_convert_parm_for_inlining): Remove. - * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): - Remove. - * cp-tree.h (ADDR_IS_INVISIREF): Remove. - * except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code. - - * call.c (build_user_type_conversion_1): Don't set ICS_BAD_FLAG on - an ambiguous conversion. - -2002-12-03 Mark Mitchell - - PR c++/8688 - * decl.c (reshape_init): Handle erroneous initializers. - -2002-12-02 Mark Mitchell - - PR c++/8720 - * spew.c (remove_last_token): Make sure that last_chunk is set - correctly. - - PR c++/8615 - * error.c (dump_expr): Handle character constants with - TREE_OVERFLOW set. - -2002-12-02 Kriang Lerdsuwanakij - - DR 180 - * decl.c (grokdeclarator): Require class-key for all friend class. - Output the correct type and context in the error message. - -2002-12-01 Mark Mitchell - - PR c++/5919 - * pt.c (unify): Use variably_modified_type_p to test validity of - template argument types. - - PR c++/8727 - * cp-tree.h (lang_type_class): Add typeinfo_var. - (CLASSTYPE_TYPEINFO_VAR): New macro. - * rtti.c (get_tinfo_decl): Use it. - - PR c++/8663 - * init.c (expand_member_init): Always get the main variant of a - base class. - -2002-12-01 Mark Mitchell - - PR c++/8332 - PR c++/8493 - * decl.c (cxx_init_decl_processing): Use size_type_node, not - c_size_type_node. - * decl2.c (coerce_new_type): Likewise. - * except.c (do_allocate_exception): Likewise. - -2002-11-30 Zack Weinberg - - * call.c, class.c, cp-lang.c, cvt.c, cxxfilt.c, decl.c, decl2.c, - dump.c, error.c, except.c, expr.c, friend.c, g++spec.c, init.c, - lex.c, mangle.c, method.c, optimize.c, parse.y, pt.c, ptree.c, - repo.c, rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, - typeck2.c: Include coretypes.h and tm.h. - * Make-lang.in: Update dependencies. - -2002-11-30 Mark Mitchell - - PR c++/8227 - * decl.c (layout_var_decl): Deal gracefully with erroneous types. - (check_initializer): Validate the type of the initialized - variable, even if the initializer is absent. - * typeck.c (cp_type_quals): Deal gracefully with erroneous types. - - PR c++/8214 - * typeck.c (convert_for_assignment): Do not use - decl_constant_value on the operand. - - PR c++/8511 - * pt.c (instantiate_decl): Handle template friends defined outside - of the class correctly. - -2002-11-29 Joe Buck - - * parse.y (class_head_defn): Set CLASSTYPE_DECLARED_CLASS for - anonymous structs. - -2002-11-29 Mark Mitchell - - * class.c (walk_subobject_offsets): Recur on binfos as well as on - types. - (layout_nonempty_base_or_field): Pass it a binfo when processing a - base class. - (layout_empty_base): Likewise. - (build_base_field): Likewise. - -2002-11-27 Mark Mitchell - - * class.c (build_base_field): Make sure we get the canonical base - when descending through primary bases. - -2002-11-26 Geoffrey Keating - - * decl.c (check_initializer): Don't error on initialisation of - a scalar with a brace-enclosed expression. - -2002-11-26 Nathan Sidwell - - * cp-tree.h (DECL_LANG_FLAG_4): Document more uses. - (template_parms_equal): Remove prototype. - * typeck.c (buuld_indirect_ref): Reformat. - -2002-11-25 Jason Merrill - - * init.c (build_vec_init): Use a FOR_STMT instead of an IF_STMT - and a DO_STMT. - -2002-11-25 Mark Mitchell - - * tree.c (cp_build_qualified_type_real): Correct handling of - array types. - * class.c (walk_subobject_offsets): Fix thinko. - (build_base_field): Record offsets of empty bases in primary - virtual bases. - (layout_class_type): Record offsets of empty bases in fields. - - * search.c (is_subobject_of_p_1): Fix thinko. - (lookup_field_queue_p): Likewise. - -2002-11-24 Mark Mitchell - - * class.c (layout_class_type): Reuse tail padding when laying out - virtual bases. - -2002-11-22 Mark Mitchell - - * rtti.c (qualifier_flags): Fix thinko. - -2002-11-21 Gabriel Dos Reis - - Remove traditional C constructs 1/n. - * cp-tree.h (init_method, set_mangled_name_for_decl, - build_opfncall, hack_identifier, make_thunk, use_thunk, - synthesize_method, implicitly_declare_fn, - skip_artificial_parms_for, optimize_function, calls_setjmp_p, - maybe_clone_body): Remove use of PARAMS. - - * method.c (do_build_assign_ref, do_build_copy_constructor, - synthesize_exception_spec, locate_dtor, locate_ctor, locate_copy): - Likewise. - (synthesize_method): Use 'bool' type and constants instead of - 'int'. - (locate_copy): Likewise. - (implicitly_declare_fn): Likewise. - - * optimize.c (calls_setjmp_r, update_cloned_parm, dump_function): - Remove old-style declaration. - (maybe_clone_body): Use 'bool' type and constants. - -2002-11-21 Glen Nakamura - - PR c++/8342 - * typeck.c (get_member_function_from_ptrfunc): Make sure that a - SAVE_EXPR for instance_ptr doesn't get evaluated first inside one - of the branches of a COND_EXPR. - -2002-11-19 Mark Mitchell - - * pt.c (for_each_template_parm): Free allocated memory. - * search.c (is_subobject_of_p_1): New function. - (is_subobject_of_p): Avoid walking virtual bases multiple times. - -2002-11-19 Jason Thorpe - - * g++spec.c (lang_specific_spec_functions): New. - -2002-11-15 Kazu Hirata - - * ChangeLog: Follow spelling conventions. - * class.c: Likewise. - * decl2.c: Likewise. - -2002-11-14 Zack Weinberg - - * search.c (dfs_push_decls): Do not try to reorder elements - 3..n of method_vec if method_vec has only two elements. - Reverse order of two tests to avoid accessing unallocated - memory. - -2002-11-14 Mark Mitchell - - * class.c (dfs_find_final_overrider): Adjust so that the most - derived object is a binfo, rather than a class type. - (find_final_overrider): Likewise. - (add_vcall_offset_vtbl_entries_1): Simplify accordingly. - (add_vcall_offset): Likewise. - -2002-11-09 Kriang Lerdsuwanakij - - PR c++/8389 - * pt.c (instantiate_template): Push class scope for member - functions. - (get_mostly_instantiated_function_type): Likewise. Don't call - tsubst on context. Remove CONTEXTP and TPARMSP parameters. - * cp-tree.h (get_mostly_instantiated_function_type): Adjust. - * mangle.c (write_encoding, write_unqualified_name): Adjust. - -2002-11-07 Mark Mitchell - - * class.c (add_vcall_offset_vtbl_entries_1): Correct ordering of - vcall offfsets. Split out ... - (add_vcall_offset): ... new function. - - PR c++/8338 - * pt.c (for_each_template_parm): Add htab parameter. - (process_partial_specialization): Adjust call. - (push_template_decl_real): Likewise. - (pair_fn_data): Add visited. - (for_each_template_parm_r): Avoid walking duplicates more than - once. - (uses_template_parms): Adjust call to for_each_template_parm. - -2002-11-07 Mark Mitchell - - * class.c (add_implicitly_declared_members): Put implicitly - declared functions at the end of TYPE_METHODs when -fabi-version - is at least 2. - -2002-11-05 Geoffrey Keating - - * decl2.c (finish_file): Correct spelling. - -2002-11-03 Mark Mitchell - - * call.c (build_special_member_call): Do not try to lookup VTTs by - name. - * class.c (vtbl_init_data): Add generate_vcall_entries. - (get_vtable_decl): Do not look up virtual tables by name. - (copy_virtuals): Do not use BV_USE_VCALL_INDEX_P. - (set_primary_base): Do not set CLASSTYPE_RTTI. - (determine_primary_base): Likewise. - (get_matching_virtual): Remove. - (get_vcall_index): New function. - (update_vtable_entry_for_fn): Do not try to use virtual thunks - when they are not required. Assign vcall indices at this point. - (finish_struct_1): Do not set CLASSTYPE_NEEDS_VIRTUAL_REINIT. - Do update dynamic_classes. - (build_vtt): Do not add VTTs to the symbol table. - (build_ctor_vtbl_group): Likewise. - (build_vtbl_initializer): Simplify handling of vcall indices. - (build_vcall_offset_vtbl_entries): Pretend to build vcall offsets - for the most derived class. - (add_vcall_offset_vtbl_entries_1): But do not actually add them to - the vtable. - * cp-tree.h (dynamic_classes): New macro. - (lang_type_class): Remove rtti. Add vtables. Add vcall_indices. - (CLASSTYPE_RTTI): Remove. - (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Remove. - (CLASSTYPE_VCALL_INDICES): New macro. - (CLASSTYPE_VTABLES): Likewise. - (BV_USE_VCALL_INDEX_P): Remove. - (build_vtable_path): Remove. - * decl2.c (finish_vtable_vardecl): Remove. - (key_method): Remove #if 0'd code. - (finish_vtable_vardecl): Rename to ... - (maybe_emit_vtables): ... this. - (finish_file): Use it. - * search.c (look_for_overrides_here): Update comment. - -2002-11-01 Zack Weinberg - - PR c/7353 redux - * decl2.c (grokfield): Reject TYPE_DECLs with initializers. - -2002-10-30 Jason Merrill - - PR c++/8186 - * cp-tree.h (ADDR_IS_INVISIREF): New macro. - * call.c (convert_for_arg_passing): Set it. - * except.c (stabilize_throw_expr): Recurse for such an arg. - -2002-10-31 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Remove init_priority. - (lang_decl): Add delta. - (GLOBAL_INIT_PRIORITY): Remove. - (THUNK_DELTA): Revise definition. - * decl2.c (start_objects): Don't set GLOBAL_INIT_PRIORITY. - * dump.c (cp_dump_tree): Don't dump it. - -2002-10-30 Mark Mitchell - - PR c++/8160 - * typeck2.c (process_init_constructor): Call complete_array_type. - - PR c++/8149 - * decl.c (make_typename_type): Issue errors about invalid results. - -2002-10-30 Kriang Lerdsuwanakij - - Core issue 287, PR c++/7639 - * cp-tree.h (lang_type_class): Add decl_list field. - (CLASSTYPE_DECL_LIST): New macro. - (maybe_add_class_template_decl_list): Add declaration. - * class.c (duplicate_tag_error): Initialize CLASSTYPE_DECL_LIST. - (unreverse_member_declarations): Reverse CLASSTYPE_DECL_LIST. - (maybe_add_class_template_decl_list): New function. - (add_implicitly_declared_members): Use it. - * decl.c (maybe_process_template_type_declaration): Likewise. - (pushtag): Likewise. - * friend.c (add_friend): Likewise. - (make_friend_class): Likewise. - * semantics.c (finish_member_declaration): Likewise. - (begin_class_definition): Initialize CLASSTYPE_DECL_LIST. - * pt.c (instantiate_class_template): Use CLASSTYPE_DECL_LIST - to process members and friends in the order of declaration. - -2002-10-29 Mark Mitchell - - PR c++/8287 - * decl.c (finish_destructor_body): Create the label to jump to - when returning from a destructor here. - (finish_function_body): Rather than here. - -2002-10-25 Zack Weinberg - - PR c++/7266 - * decl.c (grokdeclarator): Check that TREE_OPERAND 0 of a - SCOPE_REF is not null before dereferencing it. - -2002-10-25 Mark Mitchell - - * call.c (build_over_call): Use DECL_CONTEXT, not - DECL_VIRTUAL_CONTEXT. - * class.c (modify_vtable_entry): Don't mess with - DECL_VIRTUAL_CONTEXT. - (set_vindex): Remove. - (set_primary_base): Remove vfuns_p parameter. - (determine_primary_base): Likewise. - (modify_all_vtables): Likewise. - (layout_class_type): Likewise. Adjust calls to other functions - accordingly. - (finish_struct_1): Adjust calls to modified functions. Set - DECL_VINDEX here. - * cp-tree.h (lang_type_class): Remove vsize. - (CLASSTYPE_VSIZE): Remove. - (lang_decl): Remove thunks. - (DECL_THUNKS): Adjust. - (DECL_VIRTUAL_CONTEXT): Remove. - (duplicate_decls): Don't copy it. - * pt.c (build_template_decl): Don't set it. - (tsubst_decl): Likewise. - * typeck.c (expand_ptrmemfunc_cst): Don't use it. - - * class.c (build_vtbl_initializer): Don't use build_vtable_entry. - (build_vtable_entry): Remove. - * cp-tree.h (BINFO_VIRTUALS): Expand documentation. - (lang_decl): Add thunks. - (DECL_THUNKS): New macro. - * decl.c (duplicate_decls): Copy it. - * method.c (make_thunk): Simplify, and add thunks to DECL_THUNKS. - * semantics.c (emit_associated_thunks): Simplify. - -2002-10-24 David Edelsohn - - PR c++/7228 - * cp-tree.h (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Check that - lang_type structure exists before accessing field. - (SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT): New macro. - (CLASSTYPE_REF_FIELDS_NEED_INIT): Similar. - (SET_CLASSTYPE_REF_FIELDS_NEED_INIT): New macro. - * class.c (check_field_decls): Use new macros. - * typeck2.c (process_init_constructor): Remove redundant check for - existence of lang_type structure. - -2002-10-24 Mark Mitchell - - * class.c (end_of_base): New method. - (end_of_class): Use it. Check indirect virtual bases. - - * class.c (check_field_decls): Fix typo. - -2002-10-23 Mark Mitchell - - PR c++/8067 - * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and - related variables. - - PR c++/7679 - * spew.c (next_token): Do not return an endless stream of - END_OF_SAVED_INPUT tokens. - (snarf_method): Add three END_OF_SAVED_INPUT tokens to the end of - the cached token stream. - (snarf_defarg): Likewise. - -2002-10-23 Zack Weinberg - - * cp-lang.c (cp_var_mod_type_p): New: C++ hook for - variably_modified_type_p. - * cp-tree.h: Remove prototype of variably_modified_type_p. - * tree.c (variably_modified_type_p): Remove; now implemented - in language-independent code. - -2002-10-22 Mark Mitchell - - PR c++/6579 - * spew.c (snarf_parenthesized_expression): New function. - (snarf_block): Use it. - -2002-10-22 Richard Henderson - - * method.c (use_thunk): Always compute vcall_value; assert that - it is not zero. Use can_output_mi_thunk; use output_mi_thunk - for vcall thunks as well. - -2002-10-21 Mark Mitchell - - * class.c (empty_base_at_nonzero_offset_p): New function. - (layout_nonempty_base_or_field): Do not check for conflicts when - laying out a virtual base using the GCC 3.2 ABI. - (build_base_field): Correct checking for presence of empty classes - at nonzero offsets when clearing CLASSTYPE_NEARLY_EMPTY_P. - - * class.c (include_empty_classes): Use normalize_rli. - (layout_class_type): Likewise. - - * decl.c (reshape_init): Tweak handling of character arrays. - - PR c++/8218 - * cp-tree.h (lang_type_class): Add contains_empty_class_p. - (CLASSTYPE_CONTAINS_EMPTY_CLASS_P): New macro. - * class.c (check_bases): Update CLASSTYPE_CONTAINS_EMPTY_CLASS_P. - (check_field_decls): Likewise. - (layout_class_type): Likewise. - (finish_struct_1): Initialize it. - (walk_subobject_offsets): Use it to prune searches. - -2002-10-20 Mark Mitchell - - * method.c (use_thunk): Compute the vcall index as a HOST_WIDE_INT. - * optimize.c (optimize_function): Replace ASM_OUTPUT_MI_THUNK with - TARGET_ASM_OUTPUT_MI_THUNK in comments. - -2002-10-18 Zack Weinberg - - * decl.c (start_decl): Point users of the old initialized- - typedef extension at __typeof__. - -2002-10-18 Mark Mitchell - - * Make-lang.in (method.o): Depend on TARGET_H. - * method.c (target.h): Include it. - (use_thunk): Use target hooks. Use vcall thunks, if available. - -2002-10-18 Mark Mitchell - - * class.c (base_derived_from): Make sure return value is a bool. - -2002-10-18 Mark Mitchell - - * class.c (find_final_overrider_data_s): Remove overriding_fn and - overriding_base. - (dfs_base_derived_from): New function. - (base_derived_from): Likewise. - (dfs_find_final_overrider): Use base_derived_from. - (find_final_overrider): Adjust. - -2002-10-18 Jason Merrill - - PR c++/8080 - * semantics.c (finish_for_cond, finish_while_cond): Don't mess - with condition decls in a template. - -2002-10-17 Nathan Sidwell - - * class.c (add_method): Compare template parms too. - -2002-10-17 Mark Mitchell - - PR c++/7584 - * class.c (handle_using_decl): Allow the declaration used to be - from an ambiguous base. - - * pt.c (convert_template_argument): Revert this change: - 2002-10-16 Mark Mitchell - * pt.c (convert_template_argument): Do not fold non-type - template rguments when inside a template. - - * init.c (expand_default_init): Handle brace-enclosed initializers - correctly. - -2002-10-16 Mark Mitchell - - * mangle.c (write_expression): Correct handling of enumeration - constants. - (write_template_arg): Likewise. - * pt.c (convert_template_argument): Do not fold non-type template - arguments when inside a template. - - PR c++/7478 - * cvt.c (convert_to_reference): Allow references as the incoming - type. - -2002-10-16 Mark Mitchell - - PR c++/7524 - * method.c (do_build_assign_ref): Use cp_build_qualified_type, not - build_qualified_type. - -2002-10-15 Richard Henderson - - * error.c (dump_expr): Use real_to_decimal directly, and with - the new arguments. - -2002-10-15 Mark Mitchell - - * decl.c (reshape_init): Fix typo. - - * cp-tree.h (operator_name_info_t): Add arity. - * lex.c (init_operators): Initialize it. - * mangle.c (write_conversion_operator_name): New function. - (write_unqualified_name): Use it. - (write_template_args): Accept template arguments as a TREE_LIST. - (write_expression): Adjust handling of qualified names to match - specification. - -2002-10-15 Jason Merrill - - * call.c (call_builtin_trap): New fn. - (convert_arg_to_ellipsis): Use it. Downgrade error to warning. - (build_call): Don't set current_function_returns_abnormally outside - a function. - -2002-10-14 Mark Mitchell - - * class.c (check_field_decls): Remove empty_p parameter. Instead, - clear CLASSTYPE_EMPTY_P. - (build_base_field): Likewise. - (build_base_fields): Likewise. - (check_bases_and_members): Likewise. - (create_vtbl_ptr): Likewise. - (layout_class_type): Likewise. Ensure that empty classes have - size zero when used as base classes in the 3.2 ABI. - (finish_struct_1): Initialize CLASSTYPE_EMPTY_P and - CLASSTYPE_NEARLY_EMPTY_P. Adjust calls to avoid passing empty_p - parameter. - (is_empty_class): Correct definition when using post-3.2 ABI. - * cp-tree.h (lang_type_class): Add empty_p. - (CLASSTYPE_EMPTY_P): New macro. - -2002-10-12 Nathan Sidwell - - * init.c (build_delete): Do not apply save_expr for arrays. - (build_vec_delete): Likewise. - -2002-10-14 Mark Mitchell - - * decl.c (layout_var_decl): Call layout_decl even for variables - whose type is an array with unspecified bounds. - - PR c++/7176 - * lex.c (do_identifier): Add another option for the parsing - parameter. - * parse.y (do_id): Use it. - -2002-10-11 Gabriel Dos Reis - - PRs C++/6803, C++/7721 and C++/7803 - * decl.c (grokdeclarator): Gracefully handle template-name as - decl-specifier. - -2002-10-11 Jason Molenda - - * init.c (build_field_list): Provide uses_unions_p with a default - value. - -2002-10-11 Mark Mitchell - - PR c++/5661 - * cp-tree.h (variably_modified_type_p): New function. - (grokdeclarator) Tighten check for variably modified types as - fields. - * pt.c (convert_template_argument): Do not allow variably modified - types as template arguments. - * tree.c (variably_modified_type_p): New function. - - * NEWS: Document removal of "new X = ..." extension. - * class.c (initialize_array): Set TREE_HAS_CONSTRUCTOR on - brace-enclosed initializers. - * cp-tree.h (CP_AGGREGATE_TYPE_P): New macro. - (initialize_local_var): Remove declaration. - (expand_static_init): Likewise. - * decl.c (next_initializable_field): New function. - (reshape_init): Likewise. - (check_initializer): Use them. Build dynamic initializer for - aggregates here too. - (initialize_local_var): Simplify, and incorporate cleanup - insertion code as well. - (destroy_local_var): Remove. - (cp_finish_decl): Tidy. - (expand_static_init): Fold checks for whether or not a variable - needs initialization into this function. Simplify. - * decl2.c (do_static_initialization): Simplify. - * init.c (build_init): Do not set TREE_SIDE_EFFECTS when it will - be done for us automatically. - (expand_default_init): Handle brace-enclosed initializers - correctly. - (expand_aggr_init_1): Remove RTL-generation code. - (build_vec_init): Remove "new X = ..." support. - * parse.y (new_initializer): Likewise. - * rtti.c (get_pseudo_ti_init): Set TREE_HAS_CONSTRUCTOR on - brace-enclosed initializer. - (create_pseudo_type_info): Likewise. - * typeck2.c (store_init_value): Don't try to handle digest_init - being called more than once. - (digest_init): Tidy handling of brace-enclosed initializers. - -2002-10-10 Kaveh R. Ghazi - - * decl.c (typename_hash): Use htab_hash_pointer. - -2002-10-10 Jim Wilson - - * decl.c (duplicate_decls): Don't call decl_attributes. - -2002-10-09 Zack Weinberg - - PR c/7353 - * decl.c (start_decl): Unconditionally issue error for - 'typedef foo = bar'. - (cp_finish_decl): Remove special case for TYPE_DECL with initializer. - (grokdeclarator): Remove redundant error for 'typedef foo = bar'. - -2002-10-09 Kaveh R. Ghazi - - * decl2.c (prune_vtable_vardecl): Delete unused function. - -2002-10-03 Mark Mitchell - - PR c++/7754 - * decl2.c (finish_anon_union): Do not expand anonymous unions when - procesing template functions. - * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable - type. Call layout_decl. - (tsubst_expr, case DECL_STMT): Handle anonymous unions. - -2002-10-07 Richard Henderson - - * decl2.c, pt.c: Revert c++/7754 fix. - -2002-10-05 Kriang Lerdsuwanakij - - PR c++/7804 - * error.c (dump_expr) [REAL_CST]: Output in decimal format. - -2002-10-03 Mark Mitchell - - PR c++/7931 - * pt.c (for_each_template_parm_r): Handle BASELINKs. - - PR c++/7754 - * decl2.c (finish_anon_union): Do not expand anonymous unions when - procesing template functions. - * pt.c (tsubst_decl, case VAR_DECL): Try to complete the variable - type. Call layout_decl. - (tsubst_expr, case DECL_STMT): Handle anonymous unions. - -2002-10-03 Mark Mitchell - - PR c++/8006 - * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Handle instances of template - template parameters. - (globals): Add entity and need_abi_warning. - (decl_is_template_id): Use TYPE_TEMPLATE_INFO, not - CLASSTYPE_TEMPLATE_INFO. - (is_std_substitution): Use CLASSTYPE_TI_TEMPLATE, not - TYPE_TI_TEMPLATE. - (write_prefix): Handle typename types correctly. - (write_template_prefix): Handle template template parameters - correctly. - (start_mangling): Add entity parameter. - (finish_mangling): Warn about names whose mangling will change. - (mangle_decl_string): Adjust. - (mangle_type_string): Likewise. - (mangle_special_for_type): Likewise. - (mangle_ctor_vtbl_for_type): Likewise. - (mangle_thunk): Likewise. - (mangle_guard_variable): Likewise. - (mangle_ref_init_variable): Likewise. - -2002-10-02 Mark Mitchell - - PR c++/7188. - * cp-tree.def (CTOR_INITIALIZER): Use one slot, not two. - * cp-tree.h (emit_base_init): Rename to .... - (emit_mem_initializers): ... this. - (expand_member_init): Change prototype. - * init.c (perform_member_init): Compute explicit, rather than - requiring it as a parameter. - (sort_member_init): Rename to ... - (sort_mem_initializers): ... this. Process bases and data members - together. - (sort_base_init): Remove. - (emit_base_init): Rename to ... - (emit_mem_initializers): ... this. - (expand_aggr_vbase_init_1): Remove. - (construct_virtual_bases): Rename to ... - (construct_virtual_base): ... this. - (expand_member_init): Rework handling of base initializers. - * method.c (do_build_copy_constructor): Use - finish_mem_initializers. - * parse.y (member_init): Adjust calls to expand_member_init. - * pt.c (tsubst_expr): Simplify CTOR_INITIALIZER case. - (tsubst_initializer_list): Use expand_member_init. - * semantics.c (finish_mem_intiailizers): Simplify. - -2002-10-02 Matt Austern - * decl.c (walk_vtables_r): Fixed typo that caused result to - never get a nonzero value. - -2002-10-02 Roger Sayle - - PR optimization/6627 - * cp-tree.h (enum ptrmemfunc_vbit_where_t): Delete definition - from here, and move it to tree.h. - * decl.c (cxx_init_decl_processing): If storing the vbit - in function pointers, ensure that force_align_functions_log - is atleast one. - -2002-10-02 Matt Austern - - * class.c (check_field_decls): Changed warning about const member - variables so that it doesn't get issued for a class aggregate. - -2002-10-01 Mark Mitchell - - * decl.c (cp_finish_decl): Make sure array types are laid out, - even if the array bounds are unknown. - -2002-10-01 Steve Ellcey - - * class.c (build_vtbl_initializer): Change build_c_cast - to build1. - -2002-10-01 Mark Mitchell - - * decl.c (cp_finish_decl): Make sure array types are laid out, - even if the array bounds are unknown. - - * decl.c (cp_finish_decl): Correct check for dynamic - initialization of thread-local storage. - -2002-09-30 Nathan Sidwell - - * tree.c (really_overloaded_fn): TEMPLATE_ID_EXPRs are also - overloaded. - -2002-09-30 Steve Ellcey - - * class.c (build_vtbl_initializer): Add cast. - (add_vcall_offset_vtbl_entries_1): - Use TARGET_VTABLE_DATA_ENTRY_DISTANCE for offset. - -2002-09-30 Mark Mitchell - - * class.c (walk_subobject_offsets): Correct the calculation of - offsets for virtual bases. Correct the counting of array - elements. - (layout_nonempty_base_or_field): Simplify. Correct the - calculation of offsets to be propagated through the binfo - hierarchy. - (build_base_field): Avoid creating a FIELD_DECL for empty bases. - Add the FIELD_DECL to TYPE_FIELDS. - (build_base_fields): Adjust accordingly. - (layout_virtual_bases): Use build_base_field. - (end_of_class): Return a tree, not an integer. - (warn_about_ambiguous_direct_bases): Rename to ... - (warn_about_ambiguous_bases): ... this. - (include_empty_classes): New function. - (layout_class_type): Create an alternative version of the type to - be used when as a base class type. Do not call - finish_record_layout until we are done laying out the class. - * cp-tree.h (lang_type_class): Remove size, size_unit. Add - as_base. - (CLASSTYPE_SIZE): Reimplement. - (CLASSTYPE_SIZE_UNIT): Likewise. - (CLASSTYPE_ALIGN): Likweise. - (CLASSTYPE_USER_ALIGN): Likewise. - (CLASSTYPE_AS_BASE): New macro. - (DECL_INITIALIZED_P): Likewise. - (extract_init): Remove prototype. - (build_forced_zero_init): Rename to ... - (build_zero_init): ... this. - (force_store_init_value): Remove. - * decl.c (obscure_complex_init): Remove. - (duplicate_decls): Copy DECL_INITIALIZED_P. - (check_initializer): Do not leave junk in DECL_INITIAL. - (cp_finish_decl): Handle zero-initialization of entities with - static storage duration. - * expr.c (extract_init): Remove. - * init.c (build_forced_zero_init): Remove. - (build_zero_init): New function. - (build_default_init): Use it. - (build_field_list): Skip FIELD_DECLs for base subobjects. - (push_base_cleanups): Likewise. - * method.c (do_build_assign_ref): Likewise. - (synthesize_exception_spec): Likewise. - * pt.c (tsubst_decl): Clear DECL_INITIALIZED_P. - (regenerate_decl_from_template): To not set DECL_INITIAL for a - static data member whose initialization took place in its class. - (instantiate_decl): Do not pass an initializer to cp_finish_decl - in that situation. - * search.c (dfs_push_decls): Skip FIELD_DECLs for base subobjects. - (dfs_unuse_fields): Likewise. - * tree.c (pod_type_p): Handle error_mark_node. - (zero_init_p): Likewise. - * typeck.c (lookup_anon_field): Skip FIELD_DECLs for base - subobjects. - * typeck2.c (store_init_value): Remove #if 0'd code. - (force_store_init_value): Remove. - (process_init_constructor): Use build_zero_init. - -2002-09-29 Nathan Sidwell - - PR c++/7788 - * rtti.c (unemitted_tinfo_decl_p): Check it has a field. - -2002-09-29 Kazu Hirata - - * cp-tree.h: Fix comment typos. - * decl.c: Likewise. - * pt.c: Likewise. - -2002-09-25 Mark Mitchell - - * cp/class.c (contains_empty_class_p): New method. - (walk_subobject_offsets): Correct computation of field offset. - (layout_empty_base): Correct placement of emtpy base classes. - (layout_class_type): Warn about ABI changes. - -2002-09-23 Mark Mitchell - - * cp/class.c (layout_virtual_bases): Do not round the size of the - type to a multiple of the alignment before laying out virtual bases. - (layout_class_type): Correct handling of bit-fields that are wider - than their type inside unions. Round the size of the type to a - even number of bytes when computing the size without virtual - bases. - * cp/cp-tree.h (abi_version_at_least): New macro. - -2002-09-21 Kazu Hirata - - * ChangeLog: Follow spelling conventions. - * ChangeLog.2: Likewise. - * call.c: Likewise. - * class.c: Likewise. - * cp-tree.h: Likewise. - * cvt.c: Likewise. - * decl.c: Likewise. - * decl2.c: Likewise. - * except.c: Likewise. - * friend.c: Likewise. - * g++spec.c: Likewise. - * init.c: Likewise. - * lex.c: Likewise. - * mangle.c: Likewise. - * method.c: Likewise. - * operators.def: Likewise. - * optimize.c: Likewise. - * pt.c: Likewise. - * rtti.c: Likewise. - * search.c: Likewise. - * semantics.c: Likewise. - * spew.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - -2002-09-18 Devang Patel - - * cp/cp-tree.h: New prototype for walk_vtabls(). - * cp/decl.c (walk_vtables_r): New function. - (struct cp_binding_level): Add new members, namespaces, - names_size and vtables. - (add_decl_to_level): Add decl in namespaces or vtables - chain, if conditions match. - (walk_vtables): New function. - (walk_namespaces_r): Travers separate namespace chain - for namespace decls. - (wrapup_globals_for_namespace): Use names_size instead - of list_length(). - * cp/decl2.c (finish_file): Use walk_vtables() instead of - walk_globals() to walk vtable decls. - -2002-09-18 Nathan Sidwell - - * decl.c (grokdeclarator): Use assert, not internal_error. Don't - ICE with invalid pointers & references. - -2002-09-17 Zack Weinberg - - * Make-lang.in: Remove all references to the demangler. - * cxxfilt.c: Moved to binutils. - -2002-09-16 Nathan Sidwell - - PR c++/7718 - * pt.c (tsubst_decl): Remove assert. - - Remove DR 295 implementation. - * pt.c (check_cv_quals_for_unify): Disable function & method cases. - * tree.c (cp_build_qualified_type_real): Likewise. Don't warn - about ignoring volatile qualifiers. - - * search.c (lookup_member): Correct documentation. - -2002-09-16 Geoffrey Keating - - * cp-tree.h (union lang_tree_node): Add chain_next option. - -2002-09-16 Nathan Sidwell - - * parse.y (parse_finish_call_expr): Check lookup_member result. - - PR c++/7015 - * semantic.c (finish_asm_stmt): Fix operand/output_operands - thinko. - * typeck.c (c_expand_asm_operands): Protect from error_mark_node. - -2002-09-15 Nathan Sidwell - - PR c++/7919 - * call.c (build_over_call): Convert this pointer for fns found by - using decls. - -2002-09-15 Kazu Hirata - - * ChangeLog: Follow spelling conventions. - * ChangeLog.1: Likewise. - -2002-09-14 Nathan Sidwell - - PR c++/7768 - * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P. - -2002-09-14 Kazu Hirata - - * error.c: Fix comment formatting. - * except.c: Likewise. - * expr.c: Likewise. - * friend.c: Likewise. - * g++spec.c: Likewise. - * init.c: Likewise. - * lex.c: Likewise. - * mangle.c: Likewise. - * method.c: Likewise. - * optimize.c: Likewise. - * pt.c: Likewise. - * rtti.c: Likewise. - * search.c: Likewise. - * semantics.c: Likewise. - * spew.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - -2002-09-13 Matt Austern - - PR C++/7828 - * cp/cp-tree.h, cp/tree.c: New function non_cast_lvalue_p. - * cp/call.c: Change call-by-const-reference mechanism to use - non_cast_lvalue_p when deciding whether the create a temporary. - We need a temporary when passing, e.g. (long) x by const ref. - -2002-09-13 Nathan Sidwell - - * pt.c (unify, ARRAY_TYPE): Element type can be more qualified. - -2002-09-13 Kazu Hirata - - * decl.c: Fix comment formatting. - * decl2.c: Likewise. - -2002-09-12 Kazu Hirata - - * call.c: Fix comment formatting. - * class.c: Likewise. - * cp-lang.c: Likewise. - * cp-tree.h: Likewise. - * cvt.c: Likewise. - -2002-09-11 Zack Weinberg - - * Make-lang.in: Build cp/cxxfilt.o from $(srcdir)/cp/cxxfilt.c, - and c++filt from cxxfilt.o + version.o + $(LIBDEPS). - * cxxfilt.c: New file: split from libiberty/cplus-dem.c, with - minor adjustments (use version_string, eliminate yet another - duplicate of xmalloc) - -2002-09-08 Kaveh R. Ghazi - - * cp-tree.h (require_complete_eh_spec_types): Add prototype. - -2002-09-05 Jason Merrill - - * typeck2.c (add_exception_specifier): Only pedwarn for an - incomplete type. - (require_complete_eh_spec_types): New fn. - (cxx_incomplete_type_diagnostic): Also support pedwarning. - * typeck.c (complete_type_or_diagnostic): Likewise. - * call.c (build_call): Call require_complete_eh_spec_types. - * rtti.c (get_pseudo_ti_desc): Give an error rather than aborting - on an incomplete type. - -2002-09-04 Jakub Jelinek - - * decl.c (start_cleanup_fn): Clear interface_only before - start_function, restore it afterwards. - -2002-09-02 Nathan Sidwell - - * cp-tree.h (finish_builtin_type): Remove. - * decl2.c (finish_builtin_type): Move to common code. - * decl.c (build_ptrmemfunc_type): Adjust. - * rtti.c (create_pseudo_type_info): Adjust. - (create_tinfo_types): Adjust. - -2002-08-31 Jason Merrill - - * cp-lang.c (cp_expr_size): Allow initialization from a - CONSTRUCTOR. - -2002-08-30 Richard Henderson - - PR opt/7515 - * tree.c: Include target.h. - (cp_cannot_inline_tree_fn): Don't auto-inline functions that - don't bind locally. - * Makefile.in (tree.o): Update. - -2002-08-27 Mark Mitchell - - * class.c (layout_virtual_bases): Warn about bugs in G++ that - result in incorrect object layouts. - (layout_class_type): Likewise. - -2002-08-24 Matt Austern - - * tree.c (lvalue_p_1): Add argument for whether casts of lvalues - are allowable. - (real_lvalue_p): Update caller. - (lvalue_p): Ditto. - (non_cast_lvalue_or_else): New. - * tree.h: Declare it. - * typeck.c (build_unary_op): Use non_cast_lvalue_or_else. - -2002-08-22 Mark Mitchell - - * typeck.c (build_class_member_access_expr): Handle COMPOUND_EXPR - and COND_EXPR specially; fix error message output. - -2002-08-22 Jason Merrill - - * pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR. - * semantics.c (nullify_returns_r): Likewise. - -2002-08-17 Gabriel Dos Reis - - Fix PR/7621 - * typeck.c (finish_class_member_access_expr): Diagnose cases where - name lookup finds nothing. - -2002-08-15 Jason Merrill - - * semantics.c (finish_then_clause): Remove redundant assignment. - (finish_if_stmt, begin_switch_stmt, finish_switch_stmt): Move the - extra binding level outside the if/switch statement. - (finish_while_cond, finish_for_cond): Rewrite complex condition - into the loop body. - -2002-08-15 Alexandre Oliva - - * parse.y (sizeof, alignof, typeof): New non-terminals to - increment skip_evaluation. Replace terminals with them and - decrement skip_evaluation at the end of rules using them. - * decl2.c (mark_used): Don't assemble_external if - skipping evaluation. - -2002-08-15 Gabriel Dos Reis - - Fix PR/7504 - * parse.y (parse_finish_call_expr): Handle incomplete - type used to name a scope. - -2002-08-15 Nathan Sidwell - - PR c++/7598 - * typeck.c (build_unary_op): Fold offsetof idiom. Fixes - regression caused by my 2002-08-08 patch. - -2002-08-13 Mark Mitchell - - * decl.c (pushdecl_class_level): Honor requests to bind names to - OVERLOADs. - -2002-08-11 Kaveh R. Ghazi - - * decl2.c (build_call_from_tree): Fix uninitialized variable. - * parse.y (parse_finish_call_expr): Likewise. - * repo.c (old_args, old_dir, old_main): Const-ify. - -2002-08-11 Gabriel Dos Reis - - * decl.c (duplicate_decls): Replace DECL_SOURCE_FILE - DECL_SOURCE_LINE with DECL_SOURCE_LOCATION. - * optimize.c (maybe_clone_body): Likewise. - * pt.c (tsubst_enum): Likewise. - (lookup_template_class): Likewise. - * tree.c (cp_copy_res_decl_for_inlining): Likewise. - -2002-08-10 Neil Booth - - * lang-specs.h: Remove -ansi. - -2002-08-10 Nathan Sidwell - - * tree.c (maybe_dummy_object): Replace // with /* */ - -2002-08-09 Mark Mitchell - - * call.c (standard_conversion): Use build_ptrmem_type. - * cp-tree.h (build_ptrmem_type): New function. - (adjust_result_of_qualified_name_lookup): Likewise. - * decl.c (grokvardecl): Do not look for OFFSET_TYPEs to indicate - static data members. - (build_ptrmem_type): New function. - (grokdeclarator): Do not use build_offset_type when encountering a - qualified name. - * parse.y (parse_finish_call_expr): Use - adjust_result_of_qualified_name_lookup. - * search.c (adjust_result_of_qualified_name_lookup): New function. - * typeck.c (qualify_type_recursive): Use TYPE_PTRMEM_* rather than - accessing OFFSET_TYPEs directly. - -2002-08-08 Mike Stump - - * call.c (add_builtin_candidate): legal -> valid, illegal -> invalid. - (type_decays_to): Likewise. - * class.c (find_final_overrider): Likewise. - (maybe_note_name_used_in_class): Likewise. - * decl.c (current_tmpl_spec_kind): Likewise. - (add_binding): Likewise. - (push_class_binding): Likewise. - (duplicate_decls): Likewise. - (layout_var_decl): Likewise. - (grokfndecl): Likewise. - (grokdeclarator): Likewise. - (check_default_argument): Likewise. - * decl2.c (handle_class_head): Likewise. - * error.c (dump_template_decl): Likewise. - * init.c (build_offset_ref): Likewise. - * pt.c (check_specialization_scope): Likewise. - (determine_specialization): Likewise. - (check_explicit_specialization): Likewise. - (maybe_check_template_type): Likewise. - (process_partial_specialization): Likewise. - (check_default_tmpl_args): Likewise. - (push_template_decl_real): Likewise. - (convert_template_argument): Likewise. - (try_class_unification): Likewise. - (get_bindings_real): Likewise. - (do_decl_instantiation): Likewise. - * semantics.c (begin_function_definition): Likewise. - (finish_member_declaration): Likewise. - (check_multiple_declarators): Likewise. - * typeck.c (comp_array_types): Likewise. - (comptypes): Likewise. - (expr_sizeof): Likewise. - (build_binary_op): Likewise. - (dubious_conversion_warnings): Likewise. - (check_return_expr): Likewise. - -2002-08-08 Mark Mitchell - - * typeck.c (build_class_member_access_expr): Do not return - error_mark_node when no error has occurred. - -2002-08-08 Nathan Sidwell - - * typeck.c (build_component_addr): Remove. - (build_unary_op): Just check it's not a bitfield, and then build - an ADDR_EXPR. - -2002-08-08 Nathan Sidwell - - * class.c (convert_to_base): Correct check for error_mark_node. - (create_vtable_ptr): Remove unused VFUNS_P parm. - -2002-08-08 Nathan Sidwell - - * cp/Make-lang.in (c++.mostlyclean): Remove coverage files. - -2002-08-07 Mark Mitchell - - Rework build_component_ref. - * call.c (build_vfield_ref): Do not go through build_component_ref. - (build_field_call): Use build_class_member_access_expr. - (build_user_type_conversion_1): Use BASELINK_FUNCTIONS. - (build_object_call): Likewise. - * class.c (convert_to_base): New function. - (type_requires_array_cookie): Use BASELINK_FUNCTIONS. - (instantiate_type): Handle BASELINKs. - * cp-tree.def (BASELINK): New tree code. - * cp-tree.h (BASELINK_P): Reimplement. - (SET_BASELINK_P): Remove. - (BASELINK_BINFO): Reimplement. - (BASELINK_FUNCTIONS): Likewise. - (BASELINK_ACCESS_BINFO): Likewise. - (BASELINK_OPTYPE): Likewise. - (convert_to_base): New function. - (name_p): Likewise. - (build_object_ref): Remove. - (build_component_ref_1): Likewise. - (build_component_ref): Likewise. - (build_x_component_ref): Likewise. - (build_class_member_access_expr): New function. - (finish_class_member_access_expr): Likewise. - (build_ptrmemfunc_access_expr): Likewise. - * decl.c (grokdeclarator): Handle BASELINKs. - * decl2. (build_expr_from_tree): Handle COMPONENT_REFs by using - finish_class_member_access_expr. - (arg_assoc): Handle BASELINKs. - (do_class_using_decl): Likewise. - * error.c (dump_decl): Likewise. - (dump_expr): Use build_ptrmemfunc_access_expr. - * except.c (dtor_nothrow): Use CLASSTYPE_DESTRUCTORS to find - destructors. - (build_throw): Use BASELINK_FUNCTIONS. - * init.c (perform_member_init): Use - build_class_member_access_expr. - (build_offset_ref): Handle BASELINKs. Use - build_class_member_access_expr. - * method.c (hack_identifier): Likewise. - * parse.y (do_id): Use BASELINK, not TREE_LIST. - (primary): Remove uses of build_object_ref. - * pt.c (lookup_template_function): Handle BASELINKs. - (resolve_overloaded_unification): Likewise. - * search.c (build_baselink): Build a BASELINK, not a TREE_LIST. - (lookup_field): Use BASELINK, not TREE_LIST. - (lookup_fnfiels): Likewise. - (setup_class_bindings): Likewise. - * semantics.c (finish_object_call_expr): Do not use - build_method_call when we already know what function is being - called. - * spew.c (identifier_type): Use BASELINK, not TREE_LIST. - * tree.c (really_overloaded_fn): Use OVL_CHAIN for OVERLOADs, not - TREE_CHAIN. - (name_p): New function. - * typeck.c (build_object_ref): Remove. - (build_component_ref_1): Likewise. - (build_x_component_ref): Likewise. - (build_class_member_access_expr): New function. - (finish_class_member_access_expr): Likewise. - (build_ptrmemfunc_access_expr): Likewise. - (get_member_function_from_ptrfunc): Use - build_ptrmemfunc_access_expr. - (build_binary_op): Likewise. - (build_unary_op): Likewise. - (build_ptrmemfunc): Likewise. - (pfn_from_ptrmemfunc): Likewise. - * typeck2.c (build_m_component_ref): Adjust comment. - -2002-08-07 Neil Booth - - * Make-lang.in (CXX_C_OBJS): Update. - * cp-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. - * cp-tree.h (cxx_decode_option): Remove. - * decl2.c (compare_options, lang_f_options, unsupported_options, - cxx_decode_option): Remove. - -2002-08-06 Gabriel Dos Reis - - * typeck.c (build_x_unary_op): Handle pointer-to-member. - -2002-08-05 Geoffrey Keating - - * class.c: Don't include obstack.h. - (popclass): - * decl2.c: Delete bogus comment. - * error.c: Don't include obstack.h. - * except.c: Likewise. - (dump_type): Correct comment. - * method.c: Don't include obstack.h. - * tree.c: Likewise. - -2002-08-04 Gabriel Dos Reis - - Fix PR/2213 - * cvt.c (cp_convert_to_pointer): Reject conversions from integral - expressions to pointer-to-data-member of pointer-to-member-functions. - -2002-08-04 Geoffrey Keating - - * cvt.c (ocp_convert): Delete obsolete code. - * parse.y (permanent_obstack): Delete declaration. - * pt.c (permanent_obstack): Delete declaration. - * repo.c (permanent_obstack): Delete declaration. - (open_repo_file): Use xmalloc instead of permanent_obstack. - (init_repo): Use xstrdup instead of permanent_obstack. - -2002-08-04 Nathan Sidwell - - * cp-tree.h (VF_DERIVED_VALUE): Remove. - * class.c (finish_struct_1): Use VF_BINFO_VALUE not VF_DERIVED_VALUE. - -2002-08-03 Nathan Sidwell - - PR 7470. - C++ ABI change - vfunc ordering. - * class.c (add_virtual_function): Remove. - (dfs_modify_all_vtables): Take list of all declared - virtuals. Assign all that are not in primary base. - (check_for_override): Adjust comments. - (create_vtable_ptr): Take single list of virtuals. Build chain - of declared virtuals here. - (layout_class_type): Take single list of virtuals. Adjust. - (finish_struct_1): Keep virtuals on single list. Adjust. - -2002-08-02 Mark Mitchell - - * init.c (build_member_call): Use build_new_method_call, not - build_method_call. - -2002-08-02 Krister Walfridsson - - * Make-lang.in (spew.o, lex.o, pt.o): Add path to parse.h dependencies. - -2002-08-02 Mark Mitchell - - * call.c (build_method_call): Issue a more helpful error message - about ambiguous method names. - -2002-08-02 Nathan Sidwell - - * tree.c (build_shared_int_cst): Make cache file scope, and - GTY it. - -2002-08-02 Jason Merrill - - * cp-lang.c (LANG_HOOKS_EXPR_SIZE): Define. - (cp_expr_size): New fn. - * call.c (build_over_call): Lose empty class hackery. - (convert_arg_to_ellipsis): Promote non-POD warning to error. - * typeck.c (build_modify_expr): Don't use save_expr on an lvalue. - - * semantics.c (expand_body): Do tree optimization in the function - context, too. - -2002-08-01 Neil Booth - - * cp-tree.h: Move all warning and flag declarations to c-common.h. - * decl.c: Move all warning and flag variables to c-common.c. - * decl2.c: Move all warning and flag variables to c-common.c. - * lex.c (flag_digraphs): Remove. - (warn_traditional): Now in c-common.c. - -2002-07-31 Mark Mitchell - - * call.c (build_field_call): Do not look up the field by name. - (build_method_call): Simplify. - (struct z_candidate): Add access_path and conversion_path. Remove - basetype_path. - (convert_class_to_reference): Adjust use of - add_function_candidate. - (add_candidate): Add conversion_path argument. - (add_function_candidate): Use it. - (add_conv_dndidate): Likewise. - (build_builtin_candidate): Likewise. - (add_template_candidate_real): Add conversion_path argument. - (add_template_conv_candidate): Likewise. - (add_template_candidate): Likewise. - (build_user_type_conversion_1): Use it. - (build_new_function_call): Remove name lookup code. Adjust use of - add_template_candidate and add_function_candidate. - (build_new_op): Likewise. - (convert_like_real): Use build_special_member_call. - (build_over_call): Use cand->conversion_path. - (build_special_member_call): New method. - (build_new_method_call): Remove name lookup code. - * cp-tree.def (OFFSET_REF): Update documentation. - (TEMPLATE_ID_EXPR): Likewise. - * cp-tree.h (BASELINK_ACCESS_BINFO): New macro. - (BASELINK_OPTYPE): Likewise. - (build_new_method_call): Adjust prototype. - (build_special_member_call): New method. - (build_baselink): New method. - (build_offset_ref_call_from_tree): Likewise. - (build_call_from_tree): Likewise. - (finish_qualified_call_expr): Remove. - (finish_call_expr): Adjust prototype. - (build_x_function_call): Remove. - * cvt.c (ocp_convert): Use build_special_member_call. - * decl2.c (reparse_absdcl_as_expr): Use finish_call_expr. - (build_expr_from_tree): Adjust handling for TEMPLATE_ID_EXPR and - CALL_EXPR. - (build_offset_ref_call_from_tree): New function. - (build_call_from_tree): Likewise. - * init.c (expand_cleanup): Use build_special_member_call. - (expand_default_init): Likewise. - (build_member_call): Use finish_call_expr. - (build_new_1): Use build_special_member_call. - (push_base_cleanups): Likewise. - * method.c (do_build_assign_ref): Likewise. - * parse.y (template_id): Do not pass a COMPONENT_REF to - lookup_template_function. - (primary): Use parse_finish_call_epxr, not finish_call_expr. - (parse_finish_call_expr): New function. - * pt.c (lookup_template_function): Add assertions. - * search.c (lookup_base): Allow T to be a binfo. - (build_baselink): New function. - (lookup_member): Use it. - * semantics.c (finish_call_expr): Do not do name lookup. - (finish_object_call_expr): Remove #if 0'd code. - (finish_qualified_call_expr): Remove. - * typeck.c (build_x_function_call): Remove. - (build_static_case): Use build_special_member_call. - * typeck2.c (build_functional_cast): Likewise. - -2002-07-30 Franz Sirl - - * lang-specs.h: Remove __GXX_ABI_VERSION, moved to gcc.c. - -2002-07-30 Gabriel Dos Reis - - * cp-tree.h (VF_DERIVED_VALUE): Restore from previous deletion. - -2002-07-30 Nathan Sidwell - - * cp-tree.h (CLASSTYPE_VFIELDS, VF_*, BV_*): Add more - documentation. - -2002-07-29 Alan Modra - - * cp-tree.h: Comment typo fix. - -2002-07-29 Richard Earnshaw - - * spew.c (space_for_token): Allocate zeroed memory for a new token - chunk. - -2002-07-27 Roger Sayle - - * decl.c (builtin_function_1): No need to explicitly mark - BUILT_IN_RETURN and BUILT_IN_EH_RETURN as noreturn. - -2002-07-27 Roger Sayle - - * decl2.c (cxx_decode_option): Support -fno-builtin-foo. - -2002-07-26 Jason Merrill - - * call.c (build_over_call): Likewise. - (cp_convert_parm_for_inlining): New fn. - (convert_for_arg_passing): New fn. - (convert_default_arg, build_over_call): Use it. - (type_passed_as): New fn. - * pt.c (tsubst_decl): Use it. - * decl2.c (cp_build_parm_decl): New fn. - (build_artificial_parm): Use it. - (start_static_storage_duration_function): Likewise. - * decl.c (start_cleanup_fn, grokdeclarater): Likewise. - (grokparms): Don't mess with DECL_ARG_TYPE. - * typeck.c (convert_arguments): Use convert_for_arg_passing. - * cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING): - Define. - * cp-tree.h: Declare new fns. - -2002-07-26 Neil Booth - - * cp-tree.h (flag_operator_names): Remove. - * decl2.c (flag_operator_names): Remove. - (lang_f_options): Remove operator-names. - * lex.c (D_OPNAME): Remove. - (reswords): Remove operator names. - (rid_to_yy): Remove operator names. - (init_reswords): No need to handle D_OPNAME. - * spew.c (read_process_identifier): There are no operator - names. - -2002-07-26 Jason Merrill - - * dump.c (cp_dump_tree): Call c_dump_tree. - * Make-lang.in (CXX_C_OBJS): Add c-dump.o. - -2002-07-25 Neil Booth - - * error.c (print_whitespace): Remove. - * g++spec.c (LIBUNWIND): Move. - * mangle.c (mangled_position, write_signed_number): Remove. - -2002-07-25 Neil Booth - - * decl2.c (cxx_decode_option): Similarly. - -2002-07-25 Gabriel Dos Reis - - * cp-tree.h (cxx_sizeof_nowarn): Now a macro. - (cxx_sizeof_or_alignof_type): Take a third argument. - (cxx_sizeof): Adjust definition. - (cxx_alignof): Likewise. - * init.c (build_delete): Use cxx_sizeof_nowarn to reflect reality. - * typeck.c (cxx_sizeof_or_alignof_type): Take a third argument for - complaining. - (c_sizeof_nowarn): Remove definition. - (build_unary_op): Use cxx_sizeof_nowarn. - -2002-07-24 Geoffrey Keating - - * tree.c (cp_build_qualified_type_real): When copying - pointer-to-method types, unshare the record that holds - the cached pointer-to-member-function type. - -2002-07-23 Neil Booth - - * cp-tree.h (FILE_FUNCTION_PREFIX_LEN): Remove. - -2002-07-23 Gabriel Dos Reis - - Fix PR/7363: - * typeck.c (cxx_sizeof_or_alignof_type): New function. - (c_sizeof): Remove definition. - (expr_sizeof): Use cxx_sizeof. - * decl2.c (build_expr_from_tree): Use cxx_sizeof_or_alignof_type. - * decl.c (finish_destructor_body): Use cxx_sizeof. - * semantics.c (finish_alignof): Likewise. - (finish_alignof): Use cxx_alignof. - * cp-tree.h (cxx_sizeof, cxx_alignof): New macros. - (cxx_sizeof_or_alignof_type): Declare. - (my_friendly_assert): Move to ../c-common.h. - -2002-07-23 Neil Booth - - * class.c, method.c, pt.c, search.c: Don't define obstack macros. - -2002-07-22 Kriang Lerdsuwanakij - - PR c++/7347, c++/7348 - * cp-tree.h (tsubst_flags_t): Add tf_parsing. - * decl.c (make_typename_type): Use it. - (make_unbound_class_template): Likewise. - (lookup_name_real): Don't call type_access_control if scope is - template parameter dependent. - * parse.y (template_arg): Call make_unbound_class_template with - tf_parsing set. - (nest_name_specifier): Call make_typename_type with tf_parsing set. - (typename_sub0): Likewise. - (typename_sub1): Likewise. - (instantiate_decl): Push class scope. - * pt.c (regenerate_decl_from_template): Call pushclass and popclass - for both static variable and member function template. - (instantiate_decl) Call pushclass and popclass when tsubst'ing type - and arguments. - * search.c (type_access_control): Do type access for TEMPLATE_DECL - too. - -2002-07-20 Roger Sayle - - * decl2.c (cxx_decode_option): Simplify -fhandle-exceptions - test by using positive_option. Make whitespace consistent. - -2002-07-20 Gabriel Dos Reis - - * spew.c (struct unparsed_test): Replace 'filename' and 'lineno' - members with 'locus'. Adjust use throughout. - (struct feed): Likewise. - (alloc_unparsed_test): Change prototype, take a 'const location_t *'. - Adjust use. - (snarf_defarg): Use error(), not error_with_file_and_line(). - -2002-07-19 Chris Demetriou - - * lang-specs.h (@c++): Include "%2" (cc1plus_spec) wherever - cpp_options is included. - -2002-07-17 Kriang Lerdsuwanakij - - PR c++/2862, c++/2863 - * pt.c (determine_specialization): Compare the length of - TYPE_ARG_TYPES. Tidy. - -2002-07-17 Kriang Lerdsuwanakij - - PR c++/3797 - * decl.c (duplicate_decls): Don't propagate inlining parameters from - olddecl to newdecl when newdecl is a specialization of the - instantiation olddecl. - -2002-07-17 Kriang Lerdsuwanakij - - PR c++/4802, c++/5387 - * decl.c (make_typename_type): Use enforce_access. - -2002-07-17 Scott Snyder - - PR c++/7320 - * rtti.c (get_tinfo_decl): Set DECL_COMDAT. - -2002-07-12 Mark Mitchell - - * class.c (add_method): Correct handling of conversion operators. - -2002-07-11 Mark Mitchell - - PR c++/7224 - * class.c (add_method): Simplify. - -2002-07-11 Jason Merrill - - PR c++/7279 - * tree.c (cp_copy_res_decl_for_inlining): Also copy - TREE_ADDRESSABLE. - -2002-07-10 Graham Stott - - * pt.c (template_parm_this_level_p, push_template_decl_real): - Pass depth as int pointer. - -2002-07-11 Tim Josling - - Remove front end hard coding from gengtype.c. - - * config-lang.in (gtfiles): Add files needed for this front end. - -2002-07-10 Mark Mitchell - - * cp-tree.h (unqualified_name_lookup_error): Declare it. - (begin_function_definition): Adjust prototype. - * lex.c (unqualified_name_lookup_error): New function, split out - from ... - (do_identifier): ... here. - * parse.y (parse_begin_function_definition): New function. - (fn.def1): Use it. - * semantics.c (begin_function_definition): Accept decl-specifiers - and attributes as separate parameters. - -2002-07-10 Jason Merrill - - PR c++/6255 - * decl.c (lookup_name_real): Build a new TYPENAME_TYPE rather than - modifying the old one. - -2002-07-09 Mark Mitchell - - * cp-tree.h (constructor_name_p): Declare it. - (check_template_template_default_arg): Likewise. - * class.c (handle_using_decl): Use constructor_name_p. - * decl.c (grokdeclarator): Likewise. - * decl2.c (constructor_name_p): Define it. - * init.c (build_member_call): Use constructor_name_p. - * parse.y (template_parm): Use check_template_template_default_arg. - * pt.c (check_explicit_specialization): Use constructor_name_p. - * semantics.c (check_template_template_default_arg): New function. - -2002-07-08 Kriang Lerdsuwanakij - - * pt.c (can_complete_type_without_circularity): Add static to - function definition. - -2002-07-08 Mark Mitchell - - * cp-tree.h (have_extern_spec): Declare it - * decl.c (have_extern_spec): Define it. - (start_decl): Eliminate use of used_extern_spec. - (start_function): Likewise. - * parse.y (have_extern_spec): Remove declaration. - (used_extern_spec): Likewise. - (frob_specs): Eliminate use of used_extern_spec. - (.hush_warning): Likewise. - -2002-07-07 Mark Mitchell - - * Make-lang.in (cp/parse.o): Depend on decl.h. - * cp-tree.h (do_decl_instantiation): Change prototype. - * parse.y: Include decl.h. - (parse_decl_instantiation): New function. - (explicit_instantiation): Use it. - * pt.c (do_decl_instantiation): Accept a DECL, not a DECLARATOR - and DECLSPECS. - -2002-07-07 Roger Sayle - - * error.c (dump_function_name): Use DECL_TEMPLATE_RESULT for - constructor and destructor tests when passed a TEMPLATE_DECL. - -2002-07-05 Jason Merrill - - * cvt.c (cp_convert_to_pointer): Call force_fit_type for null - pointers. - - PR optimization/7145 - * tree.c (cp_copy_res_decl_for_inlining): Also copy DECL_INITIAL. - -2002-07-05 Nathan Sidwell - - Repair damage on weak-impared targets caused by my previous patch. - * cp-tree.h (import_export_tinfo): Add parameter. - * decl2.c (import_export_tinfo): Add parameter, post adjust - DECL_COMDAT. - * rtti.c (emit_tinfo_decl): DECL_COMDAT is (nearly) always setup by - import_export_tinfo. - -2002-07-03 Kriang Lerdsuwanakij - - PR c++/6944 - * init.c (build_aggr_init): Remove qualifiers of init before calling - build_vec_init. - (build_vec_init): Flatten multi-dimensional array during cleanup. - (build_vec_delete_1): Abort if the type of each element is array. - -2002-07-03 Graham Stott - - * pt.c (instantiate_class_template): Fix typo. - -2002-07-02 Kriang Lerdsuwanakij - - * typeck2.c (cxx_incomplete_type_diagnostic): Fix typo caused - by CVS conflict in my last patch. - -2002-07-02 Kriang Lerdsuwanakij - - PR c++/6716 - * pt.c (can_complete_type_without_circularity): New function. - (instantiate_class_template): Use it. - * typeck2.c (cxx_incomplete_type_diagnostic): Improve error - message due to incomplete fields. - -2002-07-01 Mark Mitchell - - PR c++/7112 - * mangle.c (write_expression): Add mangling for sizeof when - applied to a type. - * operators.def: Remove stale comment. - -2002-06-30 Nathan Sidwell - - * cp-tree.h (CPTI_TINFO_DECL_TYPE): Replace with ... - (CPTI_TYPE_INFO_PTR_TYPE): ... this. - (tinfo_decl_type): Replace with ... - (type_info_ptr_type): ... this. - (import_export_tinfo): Declare. - (tinfo_decl_p): Rename to ... - (unemitted_tinfo_decl_p): ... this. - * decl2.c (import_export_decl): Break out tinfo handling into ... - (import_export_tinfo): ... here. New function. - (finish_file): Adjust. - * rtti.c (TINFO_REAL_NAME): New macro. - (init_rtti_processing): Create the tinfo types. - (get_tinfo_decl_dynamic): Use type_info_ptr_type, get_tinfo_ptr. - (get_tinfo_decl): Adjust. - (get_tinfo_ptr): New function. - (get_type_id): Use it. - (tinfo_base_init): Create vtable decl here, if it doesn't exist. - (ptr_initializer): Use get_tinfo_ptr. - (ptm_initializer): Likewise. - (synthesize_tinfo_var): Break into ... - (get_pseudo_ti_init): ... this. Just create the initializer. - (get_pseudo_ti_desc): .. and this. - (create_real_tinfo_var): Remove. - (create_pseudo_type_info): Don't create the vtable decl here. - (get_vmi_pseudo_type_info): Remove. - (create_tinfo_types): Adjust. - (tinfo_decl_p): Rename to ... - (unemitted_tinfo_decl_p): ... here. Adjust. - (emit_tinfo_decl): Adjust. Create the initializer. - -2002-06-27 Mark Mitchell - - PR c++/6695 - * pt.c (tsubst_friend_class): Substitute into the context of the - friend before using it. - -2002-06-26 Mark Mitchell - - * cp-tree.h (xref_tag): Change prototype. - (handle_class_head): Likewise. - (build_x_component_ref): Likewise. - * decl.c (cxx_init_decl_processing): Adjust call to xref_tag. - (xref_tag): Take attributes as a separate parameter. - (xref_tag_from_type): Adjust call to xref_tag. - * decl2.c (build_expr_from_tree): Adjust call to - build_x_component_ref. - (handle_class_head): Take attributes as a separate parameter. - * parse.y (parse_xref_tag): New function. - (parse_handle_class_head): Likewise. - (primary): Use parse_xref_tag. - (class_head_decl): Use parse_handle_class_head. - (class_head_defn): Likewise. - * rtti.c (init_rtti_processing): Adjust call to xref_tag. - (build_dynamic_cast_1): Likewise. - (create_pseudo_type_info): Likewise. - (emit_support_tinfos): Likewise. - * typeck.c (build_object_ref): Adjust call to - build_x_component_ref. - (build_x_component_ref): Remove protect parameter. - -2002-06-25 Mark Mitchell - - * call.c (build_op_delete_call): Use BASELINK_FUNCTIONS. - * class.c (handle_using_decl): Likewise. - (instantiate_type): Likewise. - * cp-tree.h (BASELINK_FUNCTIONS): New macro. - (xref_basetypes): Change prototype. - (begin_mem_initializers): New function. - (get_overloaded_fn): Likewise. - * decl.c (xref_basetypes): Simplify. - * error.c (dump_expr): Use BASELINK_FUNCTIONS. - * init.c (build_offset_ref): Likewise. - * parse.y (base_init): Use begin_mem_initializers(). - (structsp): Adjust call to xref_basetypes. - * pt.c (determine_specialization): Use BASELINK_FUNCTIONS. - (instantiate_class_template): Adjust call to xref_basetypes. - * semantics.c (begin_mem_initializers): New function. - * tree.c (is_overloaded_fn): Use BASELINK_FUNCTIONS. - (really_overloaded_fn): Likewise. - (get_overloaded_fn): New function.' - (get_first_fn): USe BASELINK_FUNCTIONS. - -2002-06-24 Mark Mitchell - - * cp-tree.h (SCALAR_TYPE_P): New macro. - (check_for_out_of_scope_variable): New function. - (at_class_scope_p): Likewise. - (finish_fname): Likewise. - * class.c (finish_struct): Use at_function_scope_p. - * decl.c (check_for_out_of_scope_variable): New function, split - out from do_identifier. - (finish_enum): Use at_function_scope_p. - * lex.c (do_identifier): Use check_for_out_of_scope_variable. - * parse.y (VAR_FUNC_NAME): Give it . Use finish_fname. - (primary): Use at_function_scope_p. - * search.c (at_class_scope_p): New function. - * semantics.c (finish_fname): Likewise. - (check_multiple_declarators): Use at_function_scope_p. - -2002-06-23 Mark Mitchell - - * parse.y (parse_scoped_id): New function. - (primary): Use it. - * cp-tree.h (do_scoped_id): Adjust declaration. - * lex.c (do_scoped_id): Remove call to yylex. - * decl2.c (build_expr_from_tree): Adjust use of do_scoped_id. - * typeck2.c (add_exception_specifier): Use tree_cons, rather than - expanding it inline. - -2002-06-23 Matt Thomas - - * decl.c (finish_function): Change "#ifdef VMS_TARGET" to - "#if VMS_TARGET". - -2002-06-21 Kaveh R. Ghazi - - * mangle.c (integer_type_codes): Const-ify. - -2002-06-20 Richard Henderson - - PR c++/6747 - * typeck.c (mark_addressable): Don't test TREE_ADDRESSABLE early. - Call put_var_into_stack. - -2002-06-20 Kaveh R. Ghazi - - * spew.c (remove_last_token): Use ARRAY_SIZE in lieu of explicit - array size calculation. - -2002-06-20 Kriang Lerdsuwanakij - - PR c++/6892 - * pt.c (tsubst_expr): Handle FILE_STMT. - -2002-06-20 Kriang Lerdsuwanakij - - PR c++/6723 - * pt.c (lookup_template_class): Don't build complete argument of - BOUND_TEMPLATE_TEMPLATE_PARM if appeared as a default template - argument. - -2002-06-19 Akim Demaille - - * parse.y (TYPENAME): Rename as tTYPENAME to avoid the clash with - decl.h's TYPENAME. - * spew.c, lex.c: Adjust. - * parse.y (explicit_instantiation): Add empty action to override - the default $$ = $1 where it introduces a type clash. - -2002-06-14 Jason Merrill - - * semantics.c (begin_for_stmt): Push the 'for' scope before - adding the FOR_STMT. - - C++ ABI changes. - * class.c (build_base_field): Set DECL_PACKED. - (layout_class_type): Don't use tail padding of PODs. - * mangle.c (write_unqualified_name): Fix template conversion op - mangling. - -2002-06-16 Richard Henderson - - PR opt/6793 - * tree.c (cp_cannot_inline_tree_fn): Don't short-circuit test - after template instantiation. - -2002-06-16 Richard Henderson - - * cp-tree.h, decl2.c (flag_ms_extensions): Move to c-common. - -2002-06-15 Gabriel Dos Reis - - * cp-tree.h (compiler_error): Remove declaration. - * lex.c (compiler_error): Remove definition. - -2002-06-14 Steve Ellcey - - * g++spec.c (LIBUNWIND): New. - (lang_specific_driver): Add it if USE_UNWIND_EXCEPTIONS is set. - -2002-06-13 Jessica Han - - * class.c (build_vtable): Use TARGET_VTABLE_ENTRY_ALIGN. - (build_vtbl_initializer): Honor TARGET_VTABLE_DATA_ENTRY_DISTANCE. - (build_vbase_offset_vtbl_entries): Likewise. - * rtti.c (build_headof): Likewise. - (get_tinfo_decl_dynamic): Likewise. - (create_pseudo_type_info): Likewise. - -2002-06-12 Stan Shebs - - * mpw-config.in: Remove file, no longer used. - * mpw-make.sed: Ditto. - -2002-06-07 Zack Weinberg - - * decl2.c: Update call to cpp_handle_option. - -2002-06-07 H.J. Lu (hjl@gnu.org) - - * decl2.c (flag_use_cxa_atexit): Set to DEFAULT_USE_CXA_ATEXIT. - -2002-06-06 Gabriel Dos Reis - - * error.c (cp_error_at): Fix typo. - -2002-06-04 Gabriel Dos Reis - - * error.c (cp_diagnostic_starter): Adjust call. - (maybe_print_instantiation_context): Change prototype to take a - 'diagnostic_info *'. - (print_instantiation_full_context): Likewise. - (print_instantiation_partial_context): Likewise. - (cp_diagnostic_starter): Likewise. - (cp_diagnostic_finalizer): Likewise. - (cp_print_error_function): Likewise. - (cp_printer): Take a secondary parameter as a 'text_info *'. - Remove output_state savings. Adjust calls. - -2002-06-03 Geoffrey Keating - - * pt.c (inline_parm_levels): Mark for GC. - - * mangle.c (start_mangling): Allocate G.substitutions here... - (init_mangle): ... rather than here. - (finish_mangling): Clear the varray pointer when done with it. - * spew.c (yylexstring): Don't use VARRAY_FREE. - * search.c (bfs_walk): Don't use VARRAY_FREE. - * decl2.c (pending_statics): Use gengtype to mark. - (deferred_fns): Likewise. - (ssdf_decls): Likewise. - (init_decl2): Delete. - * decl.c (pop_from_top_level): Don't use VARRAY_FREE. - (cxx_init_decl_processing): Don't call init_decl2. - (cxx_pop_function_context): Don't use VARRAY_FREE. - * cp-tree.h (struct saved_scope): No need for special marking - of varrays. - (struct language_function): Likewise. - (local_classes): Use gengtype to mark. - (init_decl2): Delete prototype. - * class.c (init_class_processing): Don't use - ggc_add_tree_varray_root. - (build_vtbl_initializer): Don't use VARRAY_FREE. - - * decl.c (typename_compare): Don't use same_type_p. - - * decl.c: Include hashtab.h instead of hash.h. - (typename_hash): Update to use htab_h. - (typename_compare): Likewise. - (typename_htab): Use gengtype to mark. - (build_typename_type): Update to use htab_h. - * Make-lang.in (cp/decl.o): Use HASHTAB_H instead of hash.h. - - * Make-lang.in (gt-cp-tree.h): New rule. - (cp/tree.o): Depend on gt-cp-tree.h. - * config-lang.in (gtfiles): Add cp/tree.c. - * tree.c: Include gt-cp-tree.h. - (list_hash_table): Use gengtype to mark. - (init_tree): Use gengtype to mark trees. - - * Make-lang.in (cp/decl.o): Add debug.h dependency. - * call.c (struct z_candidate): Use gengtype. - (USER_CONV_CAND): Use WRAPPER_ZC. - (convert_class_to_reference): Use build_zc_wrapper. - (build_type_conversion_1): Likewise. - (build_over_call): Use WRAPPER_ZC. - (add_warning): Use build_zc_wrapper. - * cp-lang.c (LANG_HOOKS_MARK_TREE): Delete. - * cp-tree.h (struct lang_identifier): Use gengtype. - (struct template_parm_index_s): Likewise. - (struct ptrmem_cst): Likewise. - (struct tree_binding): Likewise. - (struct tree_overload): Likewise. - (struct tree_srcloc): Likewise. - (struct tree_wrapper): Likewise. Also modify to have a pointer - to struct z_candidate rather than void. - (enum cp_tree_node_structure_enum): New. - (union lang_tree_node): New. - (cxx_mark_tree): Delete prototype. - (cp_tree_node_structure): New prototype. - (build_ptr_wrapper): Delete prototype. - (build_int_wrapper): Delete prototype. - (build_zc_wrapper): New prototype. - * decl.c: Include debug.h - (cxx_mark_tree): Delete. - (cp_tree_node_structure): New. - * tree.c (build_ptr_wrapper): Delete. - (build_int_wrapper): Delete. - (build_zc_wrapper): New. - - * cp-tree.h [! ENABLE_TREE_CHECKING] (LANG_TYPE_PTRMEM_CHECK): - Correct typo. Patch from k_fukui@highway.ne.jp. - - * semantics.c (current_stmt_tree): Update for change to - struct language_function. - (finish_mem_initializers): Likewise. - * decl.c (cxx_init_decl_processing): Don't set mark_lang_status. - * cp-tree.h (struct language_function): Rename from - cp_language_function. Change all uses. - (cp_function_chain): Don't need to cast. - - * class.c (duplicate_tag_error): Reset discriminator. - (check_bases_and_members): Update for data structure changes. - * cp-tree.h (struct lang_id2): Use gengtype. - (flagged_type_tree): Likewise. - (SET_LANG_ID): Use GGC on struct lang_id2. - (struct cp_language_function): Use gengtype. Remove field - 'x_vcalls_possible_p'. - (current_vcalls_possible_p): Delete. - (struct lang_type_header): New. - (struct lang_type_class): Rename from struct lang_type. Include - struct lang_type_header. - (struct lang_type_ptrmem): New. - (struct lang_type): New. - (LANG_TYPE_CLASS_CHECK): New. Use it in all the appropriate macros. - (LANG_TYPE_PTRMEM_CHECK): New. Use it in all the appropriate macros. - (TYPE_SET_PTRMEMFUNC_TYPE): Set discriminator, update for changes. - (struct lang_decl_flags): Use gengtype. Add discriminators. - (struct lang_decl): Use gengtype. Add and use discriminators. - Update the macros that reference moved fields. - (LANG_DECL_U2_CHECK): New function. Use it when appropriate. - (SET_DECL_THUNK_P): Set discriminator too. - (clear_inline_text_obstack): Delete prototype. - (finish_inline_definitions): Delete prototype. - (mark_pending_inlines): Delete prototype. - (lang_check_failed): New prototype. - * decl.c (struct named_label_use_list): Use gengtype. - (struct named_label_list): Likewise. - (mark_binding_level): Delete. - (mark_named_label_lists): Delete. - (push_local_name): Set discriminator on DECL_LANG_SPECIFIC. - (cxx_init_decl_processing): Use generated marker routine. - (begin_destructor_body): Delete dead set to - current_vcalls_possible_p. - (mark_lang_function): Delete. - (mark_cp_function_context): Delete. - (lang_mark_tree): Use generated marker routines. - * decl2.c (start_objects): Set discriminator when setting - GLOBAL_INIT_PRIORITY. - * lex.c (retrofit_lang_decl): Set discriminators. - (copy_lang_type): Update for changes to lang_type structure. - (cp_make_lang_type): Set discriminator. - * parse.y: Use gengtype on YYLVAL. Don't use dots in identifiers. - * search.c: Include ggc.h. - * semantics.c (anon_aggr_type_p): Use the macro, don't hand-code it. - (finish_inline_definitions): Delete. - * spew.c (struct token): Use gengtype. - (struct token_chunk): New. - (struct unparsed_text): Use gengtype. Store tokens in chunks. - (struct feed): Use gengtype. - (feed_obstack): Delete. - (feed): Mark as GC root. - (pending_inlines): Mark as GC root. - (pending_inlines_tail): Likewise. - (processing_these_inlines): Likewise. - (token_obstack): Make static. - (first_token): Likewise. - (init_spew): Don't initialize deleted things; use gengtype for roots. - (clear_inline_text_obstack): Delete. - (feed_input): Use GC for struct feed. Update for changes to - struct unparsed_text. - (mark_pending_inlines): Delete. - (next_token): Rename from add_token. Change all callers. Update - for changes to struct unparsed_text. - (space_for_token): New. - (remove_last_token): New. - (alloc_unparsed_text): New. - (snarf_block): Take an unparsed_text. Update for changes to struct - unparsed_text. - (snarf_method): Update for changes to struct unparsed_text. - (snarf_defarg): Update for changes to struct unparsed_text. - * tree.c (lang_check_failed): New. - - * Make-lang.in (gt-cp-call.h gt-cp-decl2.h gt-cp-parse.h - gt-cp-pt.h gt-cp-repo.h gt-cp-spew.h): New rules. - (cp/spew.o): Add dependency on gt-.h. - (cp/decl2.o): Add dependency on gt-.h. - (cp/call.o): Add dependency on gt-.h. - (cp/pt.o): Add dependency on gt-.h. - (cp/repo.o): Add dependency on gt-.h. - (cp/parse.o): Add dependency on gt-.h. - * call.c: Use gengtype for roots. - * config-lang.in (gtfiles): Add cp-tree.h decl.h lex.h call.c - decl2.c parse.y pt.c repo.c spew.c. - * cp-tree.h: Use gengtype for roots. - (struct saved_scope): Use GGC, gengtype. - (cp_parse_init): Delete prototype. - (init_pt): Delete prototype. - * decl.c: Use gengtype for roots. - (mark_saved_scope): Delete. - (cxx_init_decl_processing): Don't call deleted initilisation - routines. - (signed_size_zero_node): Delete, unused. - * decl.h: Use gengtype for roots. - * decl2.c: Use gengtype for roots. - * lex.h: Use gengtype for roots. - * parse.y: Use gengtype for roots. - (cp_parse_init): Delete. - * pt.c: Use gengtype for roots. - (init_pt): Delete. - * repo.c: Use gengtype for roots. - * spew.c: Use gengtype for roots. - - * Make-lang.in: Allow for filename changes. Add gtype-cp.h. - (cp/decl.o): Add dependency on gtype-cp.h. - * decl.c: Remove use of add_deletable_root, use GTY marker instead. - Include gtype-cp.h. Allow for filename changes. - - * Make-lang.in (cp/gt-decl.h): Generate using gengtype. - (cp/decl.o): Add cp/gt-decl.h dependency. - * config-lang.in (gtfiles): New. - * tree.h: Rename struct binding_level to struct cp_binding_level. - * decl.c: Rename struct binding_level to struct cp_binding_level. - Include cp/gt-decl.h. - (struct cp_binding_level): Use gengtype. - (make_binding_level): Use GGC on struct cp_binding_level. - (mark_binding_level): Use gt_ggc_m_cp_binding_level. - (cxx_init_decl_processing): Mark free_binding_level as - deletable. - - * decl.c (mark_cp_function_context): Update calling sequence. - - * decl.c (start_function): Don't free 'struct - cp_language_function'. - (pop_cp_function_context): Likewise. - (save_function_data): Allocate it using GC. - * semantics.c (genrtl_start_function): Don't free 'struct - cp_language_function'. - -2002-05-31 Matthew Woodcraft - - * lang-specs.h: Use cpp_debug_options. - -2002-05-28 Zack Weinberg - - * mangle.c, tree.c: Include real.h. - * Make-lang.in: Update dependency lists. - -2002-05-25 Neil Booth - - * lex.c: Don't include c-lex.h. - * parse.y, spew.c: Don't include c-lex.h; include c-pragma.h. - -2002-05-23 Neil Booth - - * spew.c (yyungetc, snarf_block): Remove indent_level handling. - -2002-05-22 Richard Henderson - - * decl.c (obscure_complex_init): Check for VAR_DECL - before using DECL_THREAD_LOCAL. - -2002-05-22 Richard Henderson - - * decl.c (check_tag_decl): Handle RID_THREAD. - (obscure_complex_init): Reject run-time init of tls. - (grokvardecl, grokdeclarator): Handle RID_THREAD. - * lex.c (reswords): Add __thread. - (rid_to_yy): Map RID_THREAD to SCSPEC. - -2002-05-22 Neil Booth - - * cp-lang.c (LANG_HOOKS_POST_OPTIONS): Use c_common_post_options. - * cp-tree.h (cxx_post_options): Kill. - * cp-lex.c (cxx_post_options): Kill. - -2002-05-21 Richard Henderson - - * lex.c (rid_to_yy): Add RID_THREAD. - -2002-05-21 Alexandre Oliva - - * init.c (build_vec_init): Test for trivial copy-assignment when - copy-assigning arrays. - -2002-05-20 Andreas Jaeger - - * init.c (build_default_init): Remove unused variable. - -2002-05-20 Alexandre Oliva - - * call.c (any_strictly_viable): New. - (build_new_op): Use it for COMPOUND_EXPR and ADDR_EXPRs. - -2002-05-19 Kriang Lerdsuwanakij - - * error.c (dump_type) [TYPEOF_TYPE]: Fix parenthesis printing. - -2002-05-19 Kriang Lerdsuwanakij - - PR c++/186, DR 259 - * pt.c (do_decl_instantiation): Don't complain explicit - instantiation after explicit specialization. - (do_type_instantiation): Likewise. - -2002-05-19 Alexandre Oliva - - * cp-tree.h (complete_type_or_diagnostic): Changed prototype, - renamed from... - (complete_type_or_else): ... this. Redefined as macro. - (cxx_incomplete_type_diagnostic): Declare. - (cxx_incomplete_type_error): Define as macro. - * init.c (build_delete): Warn about incomplete types other than - void, and use the built-in operator delete for them. - * typeck.c (complete_type_or_diagnostic): Renamed from - complete_type_or_else. Added warn_only argument, passed to... - * typeck2.c (cxx_incomplete_type_diagnostic): ... this. Print - warnings or errors depending on new warn_only argument. Renamed - from... - (cxx_incomplete_type_error): ... this. New implementation in - terms of cxx_incomplete_type_diagnostic. - -2002-05-18 Jason Merrill - - PR c++/6611 - * decl2.c (import_export_decl): If we clear - DECL_NOT_REALLY_EXTERN, make sure DECL_EXTERNAL is set. - -2002-05-15 Kriang Lerdsuwanakij - - PR c++/6620 - * pt.c (verify_class_unification): Don't check if PARM is template - parameter dependent. Simplify. - (unify) [TEMPLATE_PARM_INDEX]: Handle when ARG is a template - parameter dependent expression. - -2002-05-14 Jason Merrill - - * rtti.c (get_tinfo_decl): Don't call comdat_linkage. - Do set DECL_COMDAT. - (synthesize_tinfo_var): Take the public decl. - (create_real_tinfo_var): Likewise. Check DECL_COMDAT. - (emit_tinfo_decl): Adjust. Call import_export_decl. - * decl2.c (import_export_decl): Simplify tinfo decl handling. - -2002-05-14 Alexandre Oliva - - * cp-tree.h (struct lang_type): Added non_zero_init. - (CLASSTYPE_NON_ZERO_INIT_P): New macro. - (zero_init_p, force_store_init_value, build_forced_zero_init): Declare. - * class.c (check_field_decls): Test non_zero_init. - * cvt.c (convert_to_pointer_force): Use cp_convert_to_pointer for - zero-to-NULL conversions. - * decl.c (obscure_complex_init): Don't reset DECL_INITIAL of a - type that needs zero-initialization without zeros. - (check_initializer_decl): Compute zero-initializer for types - that require a non-trivial one. - * init.c (build_forced_zero_init): New function. - (build_default_init): Use it. - * tree.c (zero_init_p): New function. - * typeck2.c (force_store_init_value): New function. - (process_init_constructor): Create non-trivial zero-initializers - for array members and class fields. - -2002-05-14 Neil Booth - - * lang-specs.h: Remove redundant -lang-c++. - -2002-05-13 Jason Merrill - - * class.c (build_vtbl_ref_1): Use fixed_type_or_null. - (fixed_type_or_null): See through reference vars. - (build_base_path): Vtable contents are constant. - * typeck.c (get_member_function_from_ptrfunc): Likewise. - -2002-05-12 Jason Merrill - - * cp-lang.c (ok_to_generate_alias_set_for_type): Backend-created - structs are safe. - -2002-05-09 Neil Booth - - * cp-tree.h (flag_ansi): Remove. - * decl2.c (flag_ansi): Remove. - (cxx_decode_option): Set flag_iso and flag_undef. - -2002-05-09 Jason Merrill - - * typeck.c (get_member_function_from_ptrfunc): Reorganize. - Use subtraction rather than a bitmask to get the index. - * cvt.c (cp_convert_to_pointer): Bail on an error_mark_node. - - * pt.c (tsubst_expr) [ASM_STMT]: Copy ASM_INPUT_P. - -2002-05-07 Neil Booth - - * Make-lang.in (decl2.o): Update. - * cp-tree.h (warn_multichar): Remove. - * decl2.c: Include c-common.h. - (warn_multichar): Remove. - -2002-05-03 Jason Merrill - - * tree.c (build_cplus_array_type): Only const and volatile get - special handling. - - * decl.c (BOOL_TYPE_SIZE): Move default to defaults.h. - -2002-04-30 Mark Mitchell - - ABI change, returning simple classes from functions. - * class.c (finish_struct_bits): Only mark TREE_ADDRESSABLE if - TYPE_HAS_TRIVIAL_INIT_REF is false or - TYPE_HAS_NONTRIVIAL_DESTRUCTOR is true. - -2002-04-30 Jason Merrill - - PR debug/6436 - * decl.c (grokdeclarator): Don't override TYPE_NAME of an - anonymous class with a typedef if there are attributes. - -2002-04-29 Paul Eggert - - * parse.y (nomods_initdcl0): Replace $3 with $$. - -2002-04-29 Jakub Jelinek - - PR c++/6477 - * decl.c (follow_tag_typedef): Check if TYPE_NAME (original) is - non-NULL first. - -2002-04-29 Mark Mitchell - - PR c++/6492 - * pt.c (tsubst_friend_class): If the friend has an explicit scope, - enter that scope before name lookup. - - PR c++/6486 - * method.c (do_build_copy_constructor): Avoid building - cv-qualified reference types. - -2002-04-29 Nathan Sidwell - - PR c++/5719 - * decl.c (grok_op_properties): Assignment ops don't have to return - by value. operator% should. - -2002-04-28 Franz Sirl - - PR c/6343 - * decl.c (duplicate_decls): Call merge_weak. - -2002-04-26 Richard Henderson - - * parse.y (malloced_yyss, malloced_yyvs): New. - (yyoverflow): Re-add. Set them. - (free_parser_stacks): New. - -2002-04-26 Mark Mitchell - - PR c++/6497 - * method.c (do_build_assign_ref): Pass a derivation to - build_method_call when calling base class assignment operators. - -2002-04-26 Richard Henderson - - * parse.y (yyoverflow): Revert. - -2002-04-26 Richard Henderson - - PR c/3581 - * parse.y (string): Remove. Update all uses to use STRING - instead, and not call combine_strings. - * rtti.c (tinfo_name): Use fix_string_type. - * semantics.c (finish_asm_stmt): Don't call combine_strings. - * spew.c (yylexstring): New. - (read_token): Use it. - -2002-04-25 Richard Henderson - - PR c/2161 - * parse.y (yyoverflow): New. - -2002-04-25 Jason Merrill - - PR c++/5607 - * search.c (check_final_overrider): No longer static. - * class.c (update_vtable_entry_for_fn): Call it. - * cp-tree.h: Adjust. - -2002-04-25 Neil Booth - - * cp-lang.c (LANG_HOOKS_SET_YYDEBUG): Remove. - * cp-tree.h (cxx_set_yydebug): Die. - * lex.c (YYDEBUG): Get from c-lex.h. - (cxx_set_yydebug): Remove. - * parse.y: Include c-lex.h. - (YYDEBUG): Get from c-lex.h. - -2002-04-24 Mark Mitchell - - PR c++/6438. - * cvt.c (convert_to_void): Don't unconditionally make COND_EXPRs - void. - -2002-04-24 Neil Booth - - * cp-lang.c (LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, - LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, LANG_HOOKS_ATTRIBUTE_TABLE): - Redefine. - * cp-tree.h (cp_attribute_table): Rename. - * decl.c (lang_attribute_table): Remove declaration. - (cxx_init_decl_processing): Don't set it. - * tree.c (cp_attribute_table): Rename. - -2002-04-24 Jason Merrill - - PR c++/6331 - * method.c (do_build_copy_constructor): Use cp_build_qualified_type. - * typeck.c (build_modify_expr): Allow arrays to differ in cv-quals. - The pedwarn for array assignment is now unconditional. - * tree.c (build_cplus_array_type_1): Still process simple array types - normally in templates. - - PR c++/6395 - * decl.c (make_rtl_for_nonlocal_decl): Don't mess with #pragma i/i - stuff for comdats. - -2002-04-23 Jakub Jelinek - - * parse.y (check_class_key): Allow KEY to be union/enum/struct/class - node with attributes. - -2002-2-23 David O'Brien - - * g++spec.c (MATH_LIBRARY_PROFILE, LIBSTDCXX_PROFILE): Add. - Use MATH_LIBRARY_PROFILE and LIBSTDCXX_PROFILE if profile flag given. - -2002-04-23 Mark Mitchell - - PR c++/6256: - * pt.c (tsubst_friend_class): Handle templates with explicit - nested names. - - PR c++/6331: - * typeck.c (merge_types): Remember the cv-qualification of pointer - types when merging them. - -2002-04-20 Neil Booth - - * cp-lang.c (LANG_HOOKS_FUNCTION_INIT, - LANG_HOOKS_FUNCTION_FREE, LANG_HOOKS_FUNCTION_MARK): Redefine. - * cp-tree.h (cxx_push_function_context, cxx_pop_function_context, - cxx_mark_function_context): New. - * decl.c (push_cp_function_context, pop_cp_function_context, - mark_cp_function_context): Rename for consistency. - (cxx_init_decl_processing): Don't set old hooks. - -2002-04-19 Neil Booth - - * call.c (convert_type_from_ellipsis): Rename, update. - * cp-lang.c (LANG_HOOKS_TYPE_PROMOTES_TO): Redefine. - * cp-tree.h (convert_type_from_ellipsis): Rename. - * decl.c (cxx_init_decl_processing): Don't set hook. - -2002-04-18 Neil Booth - - * call.c (build_new_method_call): Update. - * cp-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine. - * cp-tree.h (cxx_incomplete_type_error): New. - * decl.c (grokdeclarator, grokparms): Update. - * decl2.c (check_classfn): Update. - * pt.c (tsubst): Update. - * typeck.c (complete_type_or_else, expr_sizeof, - decay_conversion): Update. - * typeck2.c (incomplete_type_error): Rename. - (add_exception_specifier): Update. - -2002-04-18 Jason Merrill - - PR c++/5658 - * search.c (setup_class_bindings): A class template qualifies as a - type binding. - -2002-04-17 Jakub Jelinek - - PR c++/6316 - * decl2.c (finish_file): Clear DECL_EXTERNAL in a separate loop - before expanding. - -2002-04-16 Mark Mitchell - - * init.c (begin_init_stmts): Remove commented out code. - (finish_init_stmts): Set STMT_EXPR_NO_SCOPE. - * semantics.c (begin_gobal_stmt_expr): Adjust call to - expand_start_stmt_expr. - -2002-04-15 Mark Mitchell - - * decl.c (register_dtor_fn): Pass the address of dso_handle, not - dso_handle itself, to __cxa_atexit. - -2002-04-15 Gabriel Dos Reis - - * error.c (cxx_print_error_function): Adjust call to macros. - -2002-04-14 Jakub Jelinek - - * class.c (layout_virtual_bases): Do all dsize computation on trees. - -2002-04-14 Jason Merrill - - * typeck.c (get_member_function_from_ptrfunc): Don't do - gratuitious division and multiplication on - ptrmemfunc_vbit_in_delta targets. - -2002-04-12 Mark Mitchell - - PR c++/5373. - * semantics.c (finish_expr_stmt): Remember the type of the - expression before any conversions are performed. - -2002-04-12 Mark Mitchell - - PR c++/5189. - * call.c (add_template_candidate_real): Do not treat member - templates as copy constructors. - -2002-04-12 Mark Mitchell - - * decl.c (duplicate_decls): Do not copy the RTL for a variable - declaration if the old variable had an incomplete type and the new - variable does not. - (complete_vars): Do not call layout_decl for completed variables. - -2002-04-12 Richard Sandiford - - * decl.c (duplicate_decls): Don't try to unify an implicit typedef - with an explicit one. - (follow_tag_typedef): New. - (lookup_tag): Use it to extract the tag of an explicit typedef. - (xref_tag): Likewise. - -2002-04-11 Andrew Haley - - * typeck.c (type_after_usual_arithmetic_conversions): - If two types have the same variant, return immediately. - When two floating-point operands are the same precision: - convert to float if one of the operands is float; - if neither operand is one of the standard types, return the type - of the first operand. - -2002-04-10 Nathan Sidwell - - PR c++/5507 - * decl.c (make_typename_type): Remove implicit typenameness. - -2002-04-09 Jason Merrill - - PR optimization/6189 - * semantics.c (genrtl_start_function): Don't free - DECL_SAVED_FUNCTION_DATA for inline functions. - - * init.c (build_member_call): For now, don't convert to - intermediate base if it would cause an error. - -2002-04-08 Paolo Carlini - - * parse.y (namespace_qualifier, maybe_identifier, - begin_explicit_instantiation, end_explicit_instantiation, - apparent_template_type, .finish_template_type, - do_id, maybe_init, defarg_again, component_decl_1): - Add ending ';', in accordance with POSIX. - -2002-04-06 Mark Mitchell - - PR c++/5571 - * class.c (layout_class_type): Remember incomplete static - variables. - (finish_struct_1): Call complete_vars, not - hack_incomplete_structures. - * cp-tree.h (hack_incomplete_structures): Rename to ... - (complete_vars): ... this. - (struct saved_scope): Remove incomplete. - (namespace_scope_incomplete): Remove. - * decl.c (struct binding_level): Remove incomplete. - (incomplete_vars): New variable. - (mark_binding_level): Don't mark incomplete. - (print_binding_level): Don't print it. - (mark_saved_scope): Don't mark incomplete. - (pushdecl): Use maybe_register_incopmlete_var. - (cxx_init_decl_processing): Register incomplete_vars for GC. - (start_decl_1): Clarify error message. - (hack_incomplete_vars): Remove. - (maybe_register_incomplete_var): New function. - (complete_vars): Likewise. - -2002-04-06 Jason Merrill - - PR c++/4934 - * error.c (dump_expr) [CONVERT_EXPR]: Make sure TREE_TYPE (t) is - set before checking it. - - PR c++/525 - * init.c (build_member_call): Use build_scoped_ref. - (resolve_offset_ref): Likewise. - * call.c (build_scoped_method_call): Likewise. - * tree.c (maybe_dummy_object): Kludge around current_class_type being - wrong. - * typeck2.c (build_scoped_ref): Return the binfo via binfo_p parm. - * cp-tree.h: Adjust. - - * init.c (push_base_cleanups): Just use build_scoped_method_call. - - PR c++/6179 - * method.c (implicitly_declare_fn): Pass unqualified type to - synthesize_exception_spec. - -2002-04-04 Neil Booth - - * cp-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Redefine. - * cvt.c: Update comment. - * init.c (expand_cleanup_for_base): Update. - * semantics.c (finish_parenthesized_expr): Update. - * typeck.c (cp_truthvalue_conversion): Update. - -2002-04-04 Jason Merrill - - * semantics.c (finish_eh_cleanup): New fn. - * cp-tree.h: Add prototype. - * init.c (perform_member_init, expand_cleanup_for_base): Use - finish_eh_cleanup. - * cp-tree.def (SUBOBJECT, CTOR_STMT): Remove. - * cp-tree.h: Remove references. - * decl.c (begin_constructor_body, end_constructor_body): Likewise. - * dump.c (cp_dump_tree): Likewise. - * pt.c (tsubst_expr): Likewise. - * semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove. - (cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT. - * tree.c (cp_statement_code_p): Likewise. - - * init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup. - - PR c++/5636 - * semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on - cleanup for nrv. - - PR c++/5104 - * typeck.c (comptypes) [FUNCTION_TYPE]: Don't compare exception - specifiers. - [METHOD_TYPE]: Use same code as FUNCTION_TYPE. - -2002-04-03 Richard Henderson - - * cp-lang.c (cxx_warn_unused_global_decl): New. - (LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL): New. - -2002-04-03 Neil Booth - - * cp-lang.c (LANG_HOOKS_SET_DECL_ASSEMBLER_NAME): Redefine. - * tree.c (init_tree): Don't set hook. - -2002-04-03 Roger Sayle - - PR c++/5998: - * decl.c (duplicate_decls): Don't mess with assembler names when - redeclaring builtin functions as static. - -2002-04-01 Neil Booth - - * call.c (build_addr_func): Update. - * class.c (resolve_address_of_overloaded_function): Update. - * cp-lang.c (LANG_HOOKS_MARK_ADDRESSABLE): Redefine. - * cp-tree.h (cxx_mark_addressable): New. - * decl.c (register_dtor_fn, cxx_maybe_build_cleanup): Update. - * decl2.c (build_cleanup): Update. - * except.c (build_throw): Update. - * init.c (resolve_offset_ref): Update. - * pt.c (convert_nontype_argument): Update. - * semantics.c (finish_asm_stmt, simplify_affr_init_exprs_r): Update. - * typeck.c (decay_conversion, build_array_ref, build_unary_op, - unary_complex_lvalue): Update. - (mark_addressable): Rename. - -2002-04-01 Roger Sayle - - PR c++/5998: - * decl.c (duplicate_decls): Overwrite the RTL when (and only - when) overwriting a built-in function. Don't use COPY_DECL_RTL, - but follow the SET_DECL_RTL idiom used elsewhere in the function. - -2002-04-01 Neil Booth - - * cp-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, - LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. - * decl.c (grokdeclarator): Update. - * mangle.c (write_integer_cst): Update. - * typeck.c (build_binary_op): Update. - -2002-03-31 Neil Booth - - * cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Redefine. - * lex.c (cxx_init): Don't set hook. - -2002-03-31 Neil Booth - - * Make-lang.in (error.o): Update. - * cp-lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine. - * cp-tree.h (struct diagnostic_context): Predeclare. - (cxx_print_error_function): New. - * error.c: Include langhooks-def.h. - (lang_print_error_function): Rename. Update. - (init_error): Don't set hook. - -2002-03-29 Neil Booth - - * cp-lang.c (LANG_HOOKS_TYPE_FOR_MODE, LANG_HOOKS_TYPE_FOR_SIZE): - Redefine. - * cvt.c (cp_convert_to_pointer, type_promotes_to): Use new hooks. - * decl.c (finish_enum): Similarly. - * error.c (dump_type): Similarly. - * lex.c (cxx_init): Similarly. - * mangle.c (write_builtin_type): Similarly. - * typeck.c (comptypes): Similarly. - -2002-03-28 Roger Sayle - - PR c++/5998: - * decl.c (cxx_init_decl_processing): Re-enable built-in functions - in the g++ front-end. - (duplicate_decl): Allow redefinition of anticipated built-ins. - Fix inlining problem by over-writing the old DECL_RTL. - (lookup_namespace_name): Fail to find an identifier in the - specified namespace if its still anticipated. - (builtin_function_1): New function split out from builtin_function - to create a builtin in the current namespace with given context. - (builtin_function): Call builtin_function_1 to define the - appropriate builtins in both the std and global namespaces. - (select_decl): Don't test for anticipated decls here. - (unqualified_namespace_lookup): Instead ignore them whilst - searching through scopes and namespaces. - * decl2.c (do_nonmember_using_decl): If a using declaration - specifies an anticipated built-in function, mark it as no longer - anticipated in that scope. - (ambiguous_decl): Avoid resolving to an anticipated decl. - * lex.c (do_scoped_id): Fail to find an identifier in the global - namespace if its still anticipated. - -2002-03-29 Neil Booth - - * cp-lang.c (LANG_HOOKS_MAKE_TYPE): Redefine. - * cp-tree.h (cp_make_lang_type): Rename. - * lex.c (cp_make_lang_type): Rename. - (make_aggr_type): Update. - * tree.c (init_tree): Don't set make_lang_type_fn. - -2002-03-29 Jakub Jelinek - - PR c++/6073 - * class.c (finish_struct_1): Update static field's DECL_MODE even - if its type is a variant of t. - -2002-03-27 Neil Booth - - * cp-lang.c (LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES): Redefine. - * cp-tree.h (cxx_insert_default_attributes): New. - * decl.c (insert_default_attributes): Rename. - -2002-03-27 Mark Mitchell - - PR c++/4884 - * call.c (build_op_delete_call): Allow for the fact the placement - may be a COMPOUND_EXPR. - -2002-03-27 Neil Booth - - * cp-lang.c (LANG_HOOKS_EXPAND_EXPR): Redefine. - * cp-tree.h (init_cplus_expand): Remove. - (cxx_expand_expr): New. - * expr.c (cplus_expand_expr): Rename cxx_expand_expr, - fix prototype. - (init_cplus_expand): Remove. - * lex.c (cxx_init): Don't call init_cplus_expand. - -2002-03-26 Mark Mitchell - - PR c++/4884. - * init.c (build_new_1): Allow for the fact the result of - build_function_call may be a COMPOUND_EXPR. - -2002-03-26 Nathan Sidwell - - PR c++/5682 - * cp-tree.h (BINFO_PRIMARY_P): Explain meaning better. - (dfs_skip_nonprimary_vbases_unmarkedp): Remove. - (dfs_skip_nonprimary_vbases_markedp): Remove. - * search.c (get_shared_vbase_if_not_primary): Remove. - (dfs_skip_nonprimary_vbases_unmarkedp): Remove. - (dfs_skip_nonprimary_vbases_markedp): Remove. - (dfs_unmarked_real_bases_queue_p): Just get the canonical binfo. - (dfs_marked_real_bases_queue_p): Likewise. - -2002-03-26 Neil Booth - - * cp-lang.c (LANG_HOOKS_MARK_TREE): Redefine. - * cp-tree.h (cxx_mark_tree): New. - * decl.c (lang_mark_tree): Rename cxx_mark_tree. - -2002-03-25 Neil Booth - - * cp-tree.h (cxx_maybe_build_cleanup): New. - * decl.c (destroy_local_var, hack_incomplete_structures): Update. - (maybe_build_cleanup): Rename cxx_maybe_build_cleanup. - * tree.c (build_target_expr): Update. - * cp-lang.c (LANG_HOOKS_MAYBE_BUILD_CLEANUP): Redefine. - -2002-03-24 Neil Booth - - * decl2.c (cxx_decode_option): Handle -E. - * lang-specs.h (default_compilers): Preprocess with cc1plus. - * lex.c (cxx_init): Exit quickly if c_common_init returns NULL. - -2002-03-23 Jakub Jelinek - - PR c++/6037 - * decl.c (start_enum): Don't set TREE_ADDRESSABLE on TREE_LIST node. - -2002-03-23 Gabriel Dos Reis - - * error.c (dump_type): Be careful about implicit typenames. - -2002-03-21 Gabriel Dos Reis - - PR C++/3656 - * semantics.c (finish_base_specifier): Handle erronous base - classes. - -2002-03-22 Zack Weinberg - - * error.c: Always use REAL_VALUE_TO_DECIMAL; don't test - REAL_IS_NOT_DOUBLE. - -2002-03-22 Jeff Knaggs - - * typeck.c (get_member_function_from_ptrfunc): Scale idx down to - an index into the vtable_entry array regardless of - TARGET_PTRMEMFUNC_VBIT_LOCATION. - -2002-03-21 Aldy Hernandez - - * tree.c (cp_cannot_inline_tree_fn): Same. - -2002-03-21 Neil Booth - - * cp-tree.h (pushdecl, pushlevel, poplevel, set_block, - insert_block, getdecls, global_bindings_p): New. - -2002-03-20 Nathan Sidwell - - PR c++/4361 - * mangle.c (struct globals) Add internal_mangling_p member. - (write_template_param): Do internal mangling, if needed. - (mangle_conv_op_name_for_type): Request internal mangling. - -2002-03-20 Jason Merrill - - PR c++/2136 - * init.c (build_delete): Check access for a member op delete here. - * decl2.c (delete_sanity): Not here. - -2002-03-19 Jason Merrill - - PR c++/5118 - * class.c (get_vfield_name): Use the constructor_name. - -2002-03-20 Neil Booth - - * cp-lang.c (LANG_HOOKS_DECL_PRINTABLE_NAME): Redefine. - * cp-tree.h (lang_printable_name): Rename. - * error.c (lang_decl_name): Use new hook. - * lex.c (cxx_init): Remove old hook. - * pt.c (tsubst_decl): Use new hook. - * tree.c (lang_printable_name): Rename. - -2002-03-18 Eric Botcazou - - PR c++/3882 - * pt.c (tsubst_decl): Move __PRETTY_FUNCTION__ handling... - (tsubst_expr) [DECL_STMT]: ...here. And substitute the initializer - only after recording the declaration. - -2002-03-18 Jason Merrill - - PR c++/2039 - * init.c (resolve_offset_ref): Hand off to build_component_ref. - - PR c++/4222, c++/5995 - * call.c (build_over_call): Fix empty class logic. - - PR c++/3870 - * cp-tree.h (struct saved_scope): Add last_parms field. - * decl.c (maybe_push_to_top_level): Save last_function_parms. - (pop_from_top_level): Restore it. - - PR c++/4377 - * mangle.c (write_expression): Strip NOP_EXPRs sooner. Also strip - NON_LVALUE_EXPRs. - - PR c++/4003 - * pt.c (tsubst_friend_function): Use decl_namespace_context. - - PR c++/3948 -- C++ ABI change, followup to 2001-12-18 patch. - * class.c (finish_struct_bits): Also set TREE_ADDRESSABLE for a - type with a nontrivial destructor. - -2002-03-17 Jason Merrill - - PR c++/4460 - * class.c (build_base_path): Virtual base layout is fixed in - in-charge [cd]tors. - -2002-03-17 Neil Booth - - * cp-lang.c (LANG_HOOKS_PARSE_FILE): Redefine. - * parse.y (yyparse): Remove macro. - -2002-03-17 Jason Merrill - - PR c++/5757 - * init.c (build_new_1): Pass the right pointer to op delete. - -2002-03-16 Nathan Sidwell - - PR c++/4361 - * cp-tree.h (CLASSTYPE_METHOD_VEC): Document where templated - conversion operators go. - (struct lang_decl_flags): Add template_conv_p and unused - bitfields. - (DECL_TEMPLATE_CONV_FN_P): New macro. - * call.c (build_user_type_conversion_1): Don't check second type - conversion of overload set first. - * class.c (add_method): Make sure templated conversion operators - all end up on slot 2. - * lex.c (do_identifier): A conversion operator token might be - satisfied by a templated conversion operator. - * pt.c (check_explicit_specialization): Use - CLASSTYPE_FIRST_CONVERSION_SLOT. - (template_parm_this_level_p): New function. - (push_template_decl_real): Determine DECL_TEMPLATE_CONV_FN_P. - * search.c (lookup_fnfields_1): Template conversions will be on - the first slot. - * typeck.c (build_component_ref): Preserve the type of an - conversion operator name on the overload type. - (build_x_function_call): Retrieve the conversion operator name. - -2002-03-15 Richard Henderson - - * init.c (build_new_1): Use size_binop instead of cp_build_binary_op. - -2002-03-15 Mark Mitchell - - * cp-tree.h (CLEANUP_DECL): Remove. - (CLEANUP_EXPR): Likewise. - * decl.c (destroy_local_var): Simplify. - (maybe_build_cleanup): Tidy. - * dump.c (cp_dump_tree): Remove handling of CLEANUP_STMT. - * semantics.c (cp_expand_stmt): Likewise. - * cp/tree.c (cp_statement_code_p): Likewise. - -2002-03-15 Jason Merrill - - PR c++/5857 - * decl.c (duplicate_decls): Use merge_types instead of common_type. - * typeck.c (common_type): Just hand off to - type_after_usual_arithmetic_conversions and - composite_pointer_type. - (merge_types): New fn. - (commonparms): Use it instead of common_type. - (type_after_usual_arithmetic_conversions): Also handle COMPLEX_TYPE. - (composite_pointer_type): Also handle attributes. - * cp-tree.h: Declare merge_types. - - * decl.c (make_rtl_for_nonlocal_decl): Also defer COMDAT - variables. - * decl2.c (maybe_make_one_only): Also mark the decl as needed. - -2002-03-14 Richard Henderson - - * decl.c: Include c-pragma.h. - (start_decl, start_function): Invoke maybe_apply_pragma_weak. - * Make-lang.in: Update dependencies. - -2002-03-14 Jakub Jelinek - - PR c++/5908 - * call.c (build_over_call): Set TREE_NO_UNUSED_WARNING too. - * cvt.c (convert_to_void): Preserve TREE_NO_UNUSED_WARNING. - -2002-03-12 Richard Sandiford - - * mangle.c (write_builtin_type): Handle 128-bit integers even if - they are not a standard integer type. - -2002-03-12 Richard Sandiford - - * cp-tree.h (init_init_processing): Remove declaration. - * init.c (BI_header_type, init_init_processing): Remove old ABI stuff. - * decl.c (cxx_init_decl_processing): Don't call init_init_processing. - -2002-03-12 Kaveh R. Ghazi - - * cp-lang.c (tree_code_type, tree_code_length, tree_code_name): - Define. - * decl.c (duplicate_decls): Use TREE_CODE_LENGTH, not - tree_code_length. - * lex.c (cplus_tree_code_type, cplus_tree_code_length, - cplus_tree_code_name): Delete. - (cxx_init): Don't call add_c_tree_codes, instead set - lang_unsafe_for_reeval. Don't try to copy into the various - tree_code arrays. - -2002-03-12 Nathan Sidwell - - PR c++/5659 - * decl.c (xref_tag): Don't set CLASSTYPE_DECLARED_CLASS here. - * decl2.c (handle_class_head): Set CLASSTYPE_DECLARED_CLASS for - definitions. - -2002-03-11 Nathan Sidwell - - Revert 2001-03-26 Nathan Sidwell , - DR209 is now not a defect. - * cp-tree.h (skip_type_access_control): Remove. - * decl.c (grokdeclarator): Do type access control for friend - declarations. - * semantics.c (decl_type_access_control): Don't reset - current_type_lookups. - (save_type_access_control): Always save the lookups. - (skip_type_access_control): Remove. - (finish_class_definition): Don't change type_lookups. - -2002-03-11 Nathan Sidwell - - Revert 2000-12-01 Nathan Sidwell , - It is incorrect. - * typeck.c (build_static_cast): Compare non-qualified types - with pointer to member conversions. - -2002-03-11 Dan Nicolaescu - Daniel Berlin - - * cp-lang.c (ok_to_generate_alias_set_for_type): New function. - (cxx_get_alias_set): Use it. - -2002-03-10 Kaveh R. Ghazi - - * cp-tree.h (stabilize_expr): Prototype. - -2002-03-08 Craig Rodrigues - - * cp-tree.h (CLEAR_BINFO_MARKED): Make both parts of - conditional return void. - -2002-03-08 Neil Booth - - * cp-lang.c (LANG_HOOKS_UNSAVE): Redefine. - * cp-tree.h (cxx_unsave): New. - * tree.c (cp_unsave): Rename cxx_unsave, update prototype. - (init_tree): Update. - -2002-03-03 Kaveh R. Ghazi - - * decl.c (cxx_init_decl_processing): Use ARRAY_SIZE in lieu of - explicit sizeof/sizeof. - * decl2.c (cxx_decode_option): Likewise. - * lex.c (init_reswords, REDUCE_LENGTH, TOKEN_LENGTH): Likewise. - -2002-03-02 Nathan Sidwell - - PR c++/775 - * decl.c (lookup_tag): Only reject enum/class mismatch, not - class/union mismatch. - * parse.y (check_class_key): New function. - (structsp): Call it. - -2002-03-01 Michael Matz - - * typeck.c (cp_pointer_int_sum): Complete inner type which is - used later by size_in_bytes(). - -2002-03-01 Phil Edwards - - * cp-tree.h: Require __GNUC__ to be #defined. - (build_init): Add missing prototype. - -2002-03-01 Jason Merrill - - * except.c: Don't include decl.h or obstack.h. Do include - tree-inline.h. - (build_throw): Destroy temporaries from the thrown - expression before calling __cxa_throw. Construct a thrown - temporary directly into the exception object. - (stabilize_throw_expr): New function. - (wrap_cleanups_r): New function. - * tree.c (stabilize_expr): New function. - * init.c (build_init): New function. - * Make-lang.in (cp/except.o): Adjust .h deps. - -2002-02-28 Jason Merrill - - * search.c (lookup_base_r): Don't clear is_non_public just because - we found a friendly scope. - - * decl.c (finish_function): Only warn about missing return - statement with -Wreturn-type. - -2002-02-28 Neil Booth - - * class.c (build_clone): Update. - * cp-lang.c (LANG_HOOKS_DUP_LANG_SPECIFIC_DECL): Redefine. - * cp-tree.h (cxx_dup_lang_specific_decl): New. - * lex.c (copy_lang_decl): Rename cxx_dup_lang_specific_decl. - (copy_decl): Update. - * method.c (make_thunk): Update. - -2002-02-27 Zack Weinberg - - * decl2.c: Delete traditional-mode-related code copied from - the C front end but not used, or used only to permit the - compiler to link. - -2002-02-24 Craig Rodrigues - - PR c++/4093 - * cp-tree.h (SET_BINFO_MARKED): Cast false part of condition - to void. - -2002-02-22 Jakub Jelinek - - PR other/5746 - * semantics.c (finish_switch_cond): Don't call get_unwidened - if error_mark_node. - -2002-02-22 Nathan Sidwell - - PR c++/2645, DR 295 - * cp-tree.h (tsubst_flags_t): Add tf_ignore_bad_quals, - tf_keep_type_decl. - (make_typename_type): Use tsubst_flags_t. - * decl.c (make_typename_type): Adjust. Return non-artificial - TYPE_DECLs, if required. - (grokdeclarator): Simplify CVR qualification handling. Allow bad - qualifiers on typedef types. - * decl2.c (handle_class_head): Adjust make_typename_type call. - * parse.y (nested_name_specifier): Likewise. - (typename_sub0): Likewise. - (typename_sub1): Likewise. - * pt.c (convert_template_argument): Adjust make_typename_type - return value. - (tsubst): Adjust cp_build_qualified_type_real calls. - (check_cv_quals_for_unify): Cope with allowing bad qualifications - on template type parms. - (instantiate_decl): Recheck substitutions to give warnings on bad - qualifications. - * tree.c (cp_build_qualified_type_real): Use tf_allow_bad_quals. - -2002-02-21 Aldy Hernandez - - * cp/decl.c (duplicate_decls): Merge always_inline attribute. - - * cp/tree.c (cp_cannot_inline_tree_fn): Do not inline at -O0 - unless DECL_ALWAYS_INLINE. - -2002-02-20 Jakub Jelinek - - * typeck.c (cp_pointer_int_sum): Renamed from - pointer_int_sum, call pointer_int_sum. - -2002-02-20 Jakub Jelinek - - * decl.c (duplicate_decls): Return 0 if issued error about - redeclaration. - -2002-02-19 Jason Merrill - - ABI change: Mangle `void (A::*)() const' as - M1AKFvvE, not MK1AFvvE. - * mangle.c (write_function_type): Write cv-quals for member - function type here. - (write_pointer_to_member_type): Not here. - -2002-02-18 Jason Merrill - - * pt.c (do_type_instantiation): Don't pedwarn if in_system_header. - (do_decl_instantiation): Likewise. - -2002-02-17 Craig Rodrigues - - PR c++/5685 - * decl.c (duplicate_decls): Make warning unconditional - if duplicate default argument declarations are present. - -2002-02-17 Jakub Jelinek - - * typeck.c (build_binary_op) [BIT_XOR_EXPR]: Remove explicit - shortening. - -2002-02-15 Nathan Sidwell - - * decl.c (grokdeclarator): Set typedef_decl for all TYPE_DECLs, - remove incorrect comment. Move #if 0'd code to common path. Use - IMPLICIT_TYPENAME_P. Simplify & reformat ARRAY_TYPE duplication. - -2002-02-13 Jason Merrill - - * decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns. - (finish_function): Don't warn if current_function_returns_null. - - * typeck2.c (digest_init): Do handle values of vector type. - - * typeck2.c (digest_init, process_init_constructor): Treat vectors - like arrays. - -2002-02-11 Jason Merrill - - * parse.y (reserved_declspecs): Don't handle attributes. - (reserved_typespecquals): Handle them here. - * Make-lang.in (parse.c): Adjust expected conflicts. - -2002-02-08 Jakub Jelinek - - * parse.y (primary, primary_no_id): Use compstmt_or_stmtexpr - instead of compstmt. - (compstmt_or_stmtexpr): Renamed from compstmt. - (compstmt): In addition to compstmt_or_stmtexpr clear last_expr_type. - -2002-02-07 Nathan Sidwell - - Rename instantiate_type_flags to tsubst_flags_t & expand use. - * cp-tree.h (instantiate_type_flags): Rename to ... - (tsubst_flags_t): ... here. Rename itf_complain to tf_error, - add tf_warning flag. - (instantiate_type): Adjust prototype. - (tsubst, tsubst_expr, tsubst_copy, lookup_template_class, - do_type_instantiation, cp_build_qualified_type_real): Likewise. - cp_build_qualified_type: Adjust. - * class.c (instantiate_type): Adjust parameter. Rename itf_* to - tf_*. - * call.c (standard_conversion): Rename itf_* to tf_*. - (reference_binding): Likewise. - (convert_like_real): Likewise. - * cvt.c (cp_convert_to_pointer): Likewise. - (convert_to_reference): Likewise. - * decl.c (lookup_namespace_name): Use tf_* flags. - (make_typename_type): Likewise. - (grokdeclarator): Likewise. - * pt.c (convert_nontype_argument): Adjust COMPLAIN usage. - (coerce_template_template_parms, convert_template_argument, - coerce_template_parms, maybe_get_template_decl_from_type_decl, - lookup_template_class, tsubst_friend_function, tsubst_friend_class, - instantiate_class_template, tsubst_template_arg_vector, - tsubst_template_parms, tsubst_aggr_type, tsubst_default_argument, - tsubst_decl, tsubst_arg_types, tsubst_function_type, - tsubst_call_declarator_parms, tsubst, tsubst_copy, tsubst_expr, - instantiate_template, fn_type_unification, - resolve_overloaded_unification, verify_class_unification, - unify, get_bindings_real, do_type_instantiation, - regenerate_decl_from_template, instantiate_decl, - tsubst_initializer_list, tsubst_enum, - get_mostly_instantiated_function_type, - invalid_nontype_parm_type_p): Likewise. - * tree.c (cp_build_qualified_type_real): Likewise. - * typeck.c (build_binary_op): Rename itf_* to tf_*. - (build_ptrmemfunc): Likewise. - (convert_for_assignment): Likewise. - -2002-02-07 Nathan Sidwell - - PR c++/109 - * decl.c (grokdeclarator): Allow friend declarations from - dependent types. - * decl2.c (handle_class_head): Don't push into template parm contexts. - * pt.c (push_template_decl_real): Template parm contexts are never - being defined. - -2002-02-05 Alexandre Oliva - - * class.c: Include target.h. - (check_bitfield_decl): Disregard EMPTY_FIELD_BOUNDARY, - BITFIELDS_NBYTES_LIMITED and PCC_BITFIELD_TYPE_MATTERS for MS - bit-field layout. - * Make-lang.in: Adjust deps. - -2002-02-05 Jason Merrill - - * error.c (dump_type): Be more helpful about VECTOR_TYPE. - -2002-02-04 Jakub Jelinek - - * semantics.c (begin_switch_stmt): Clear SWITCH_TYPE. - (finish_switch_cond): Set SWITCH_TYPE. - -2002-02-04 Richard Henderson - - * method.c (use_thunk): Always initialize the block tree. Reindent. - * semantics.c (expand_body): Emit thunks after function, not before. - -2002-02-04 Jason Merrill - - * decl.c (start_function): Call cplus_decl_attributes immediately - after grokdeclarator. - - * decl.c (start_function): Combine DECL_RESULT handling code. - -2002-02-03 Jason Merrill - - * xref.c: Remove. - * Make-lang.in (CXX_OBJS): Remove cp/xref.o - (cp/xref.o): Remove dependencies. - * class.c (finish_struct_1, check_methods): Don't call xref fns. - (finish_struct_1): Likewise. - * friend.c (make_friend_class): Likewise. - * lex.c (cxx_init, cxx_finish, extract_interface_info): Likewise. - * spew.c (read_process_identifier): Likewise. - -2002-02-01 Jason Merrill - - PR c++/4872 - * decl.c (finish_function): Warn about a non-void function with - no return statement and no abnormal exit. - * cp-tree.h (struct cp_language_function): Add returns_abnormally. - (current_function_returns_abnormally): New macro. - * call.c (build_call): Set it. - - * typeck.c (build_component_ref): Always complain about offsetof - constructs on non-PODs. Only make it an error for members of - virtual bases. - - * error.c (dump_scope): Don't add TFF_DECL_SPECIFIERS. - (dump_function_decl): Always dump parms. - - * decl2.c (finish_static_data_member_decl): Complain about a local - class with a static data member. - - PR c++/4286 - * search.c (lookup_field_1): Don't xref a static data member - just because we looked it up. - -2002-01-31 Jason Merrill - - * Make-lang.in (parse.c): Handle .output file. - - PR c++/3395 - * decl.c (xref_tag): Remember early attributes in TYPE_ATTRIBUTES, - not TREE_TYPE. - * semantics.c (finish_class_definition): Adjust. - - Allow attributes in parms and casts. - * parse.y (named_parm): Don't strip attrs. - (declmods): Remove 'attributes' production. - (nonempty_cv_qualifiers): Accept attributes. - (ATTRIBUTE): Give precedence. - * decl.c (groktypename): Handle attributes. - (grokparms): Likewise. - -2002-01-29 Jakub Jelinek - - * decl2.c (cxx_decode_option): Pass 0 as last argument to - cpp_handle_option. - * lang-specs.h: Use cpp_unique_options instead of cpp_options - when used together with cc1_options. - -2002-01-29 Nathan Sidwell - - PR c++/5132 - * typeck2.c (digest_init): Make sure non-array core type is - instantiated. - * decl2.c (reparse_absdcl_as_casts): Just store the type in the - constructor, rather than build a new one. - (build_expr_from_tree, CONSTRUCTOR case): Be careful with the - PURPOSE of constructor elts. - -2002-01-23 Zack Weinberg - - * Make-lang.in (parse.c): Adjust expected number of - shift-reduce conflicts. - (decl.o): Depend on diagnostic.h. - * decl.c: Include diagnostic.h. - (grokdeclarator): Check for null pointer. - (finish_function): Don't abort when - current_binding_level->parm_flag != 1, if errors have - occurred; throw away the statement tree and extra binding - levels, and continue. - * lex.c (note_list_got_semicolon): Check for null pointer. - * method.c (hack_identifier): Just return error_mark_node if - value is error_mark_node. - * parse.y (primary: TYPEID(type_id)): No need to use - TYPE_MAIN_VARIANT here. - (handler_seq): Accept an empty list of catch clauses and - generate a fake handler block to avoid later crashes. - (ansi_raise_identifier): Accept the error token too. - * semantics.c (begin_class_definition, - finish_class_definition): Check for error_mark_node. - -2002-01-23 Zack Weinberg - - * typeck2.c (friendly_abort): Delete definition. - * cp-tree.h (friendly_abort): Don't prototype. - (my_friendly_assert): Use fancy_abort. - -2002-01-23 Craig Rodrigues - - * cp-tree.h (my_friendly_abort): Remove. - -2002-01-23 Jakub Jelinek - - * spew.c (pending_inlines, pending_inlines_tail, - processing_these_inlines): Make static. - (mark_pending_inlines): Remove static. - (begin_parsing_inclass_inline): If in function, save pi - for GC to cp_function_chain->unparsed_inlines instead. - (process_next_inline): Likewise. - * cp-tree.h (struct cp_language_function): Add unparsed_inlines. - (mark_pending_inlines): Add prototype. - * decl.c (spew_debug): Remove unused extern. - (mark_lang_function): Call mark_pending_inlines. - -2002-01-23 Craig Rodrigues - - * call.c, class.c, decl.c, decl2.c, error.c, expr.c, friend.c, - init.c, lex.c, mangle.c, method.c, pt.c, repo.c, rtti.c, search.c, - semantics.c, spew.c, tree.c, typeck.c, typeck2.c, xref.c: - Change my_fancy_abort() to abort(). - -2002-01-23 Jason Merrill - - PR c++/5453 - * class.c (fixed_type_or_null): Fix thinko. - - PR c++/3331 - * init.c (resolve_offset_ref): Use build_indirect_ref. - - * decl2.c (grokclassfn): Don't set DECL_REGISTER on 'this'. - -2002-01-22 Jason Merrill - - * parse.y (function_body): Suppress the block for the outermost - curly braces. - * decl.c (pushdecl): Don't try to skip it. - (begin_function_body): Keep the block we create, not the next one. - * init.c (emit_base_init): Don't mess with keep_next_level. - - * class.c (build_base_path): Tweak formatting. - -2002-01-19 Nathan Sidwell - - Fix regression introduced with patch for c++/775 - * parse.y (class_head_defn): Check for template specializations - with a different class-key. - -2002-01-17 Jason Merrill - - * decl.c (begin_constructor_body, begin_destructor_body): New fns. - (begin_function_body): Call them and keep_next_level. - * init.c (emit_base_init): Call keep_next_level. - * semantics.c (setup_vtbl_ptr): Lose. - * cp-tree.h (struct cp_language_function): Remove vtbls_set_up_p. - (vtbls_set_up_p): Lose. - * pt.c (tsubst_expr, CTOR_INITIALIZER): Call emit_base_init. - * method.c (do_build_copy_constructor): Likewise. - (synthesize_method): Call finish_mem_initializers. - * parse.y (nodecls): Likewise. - - * error.c (dump_type_suffix): Print the exception specs before - recursing. - (dump_function_decl): Here, too. - - * cp-tree.h (TMPL_PARMS_DEPTH): Cast to signed HOST_WIDE_INT. - -2002-01-10 Ira Ruben - - PR c++/907 - * decl.c (start_method): Handle attrlist. - -2002-01-10 Jakub Jelinek - - * decl2.c (max_tinst_depth): Increase default limit to 500. - -2002-01-10 Graham Stott - - * spew.c (YYCHAR): Uppercase macro parameter and add - parenthesis. - (YYCODE): Likewise. - (NAME): Uppercase macro parameter. - -2002-01-09 Graham Stott - - * decl.h (grokdeclarator): Wrap long line. - - * semantics.c (FINISH_COND): Uppercase macro paramaters and - add parenthesis. - -2002-01-08 Graham Stott - - * xref.c (FILE_NAME_ABSOLUTE_P): Add parenthesis. - (PALLOC): Uppercase macro parameter and whitespace. - (SALLOC): Uppercase macro parameter. - (SFREE): Uppercase macros parameter, add parenthese and - whitespace. - (STREQL): Uppercase macro parameter and whitespace. - (STRNEQ): Likewise. - (STRLSS): Likewise. - (STRLEQ): Likewise. - (STRGTR): Likewise. - (STRGEQ): Likewise. - - * call.c (convert_like): Add parenthesis and wrap. - (convert_like_with_context): Likewise. - (ICS_RANK): Whitespace. - (NEED_TEMPORARY_P): Remove parenthesis. - - * class.c (VTT_TOP_LEVEL_P): Uppercase macro parameter and - whitespace. - (VTT_MARKED_BINFO_P): Likewise. - - * decl.c (BINDING_LEVEL): Add parenthesis. - (DEF_OPERATOR): Likewise. - - * mangle.c (MANGLE_TRACE): Add parenthesis. - (MANGLE_TRACE_TREE): Likewise. - (write_signed_number): Likewise. - (write_unsigned_number): Likewise. - - * pt.c (ccat): Uppercase macro parameter. - (cat): Likewise - - * search.c (SET_BINFO_ACCESS): Add parenthesis. - -2002-01-07 Jason Merrill - - * decl2.c (coerce_new_type): Downgrade error for size_t mismatch - to pedwarn. - - PR c++/3536 - * method.c (make_thunk): If !flag_weak, give the thunk the - function's linkage. - (use_thunk): Here, too. - -2002-01-07 Graham Stott - - * error.c: Update copyright date. - (print_scope_operator): Add parenthesis. - (print_left_paren): Likewise. - (print_right_paren): Likewise. - (print_left_bracket): Likewise. - (print_right_bracket): Likewise. - (print_template_argument_list_start): Likewise. - (print_template_argument_list_end): Likewise. - (print_non_consecutive_character): Likewise. - (print_tree_identifier): Likewise. - (print_identifier): Likewise. - (NEXT_CODE): Uppercase macro parameter. - (ident_fndecl): Delete unused. - (GLOBAL_THING): Likewise. - -2002-01-06 Graham Stott - - * cp-tree.h (VAR_OR_FUNCTION_DECL_CHECK): Add parenthesis. - (VAR_FUNCTION_OR_PARM_DECL_CHECK): Likewise. - (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK) Likewise. - (RECORD_OR_UNION_TYPE_CHECK): Likewise. - (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Likewise. - (C_IS_RESERVED_WORD): Uppercase macro parameter. - (C_RID_YYCODE) Likewise. - (ptrmem_cst): Use rtx. - (LOCAL_BINDING_P): Add whitespace. - (INHERITED_VALUE_BINDING_P): Likewise. - (BINDING_SCOPE): Wrap long line. - (BINDING_HAS_LEVEL_P): Remove parenthesis. - (BINDING_VALUE): Wrap long line. - (BINDING_TYPE): Whitespace. - (IDENTIFIER_GLOBAL_VALUE): Add parenthesis. - (SET_IDENTIFIER_GLOBAL_VALUE): Likewise. - (IDENTIFIER_NAMESPACE_VALUE): Likewise. - (SET_IDENTIFIER_NAMESPACE_VALUE: Likewise. - (same_type_p): Uppercase macro parameters. - (same_type_ignoring_top_level_qualifiers_p): Likewise. - (OVL_FUNCTION): Wrap long line. - (OVL_CHAIN): Whitespace. - (OVL_CURRENT): Add parenthesis and whitespace. - (OVL_NEXT): Whitespace. - (OVL_USED): Likewise. - (IDENTIFIER_TYPE_VALUE): Likewise. - (REAL_IDENTIFIER_TYPE_VALUE): Remove parenthesis. - (SET_IDENTIFIER_TYPE_VALUE): Add parenthesis and whitespace. - (LANG_ID_FIELD): Whitespace. - (SET_LANG_ID(NODE,VALUE,NAME): Likewise. - (IDENTIFIER_LABEL_VALUE): Whitespace and wrap. - (SET_IDENTIFIER_LABEL_VALUE): Whitespace. - (IDENTIFIER_IMPLICIT_DECL): Whitespace and wrap. - (SET_IDENTIFIER_IMPLICIT_DECL); Whitespace. - (IDENTIFIER_ERROR_LOCUS): Whitespace and wrap. - (SET_IDENTIFIER_ERROR_LOCUS); Whitespace. - (IDENTIFIER_VIRTUAL_P): Likewise. - (IDENTIFIER_OPNAME_P): Likewise. - (IDENTIFIER_TYPENAME_P): Remove parenthesis. - (C_TYPE_FIELDS_READONLY): Uppercase macro parameters. - (C_SET_EXP_ORIGINAL_CODE): Likewise. - (TYPE_ASSEMBLER_NAME_STRING): Wrap long line. - (TYPE_ASSEMBLER_NAME_LENGTH): Likewise. - (IS_AGGR_TYPE): Uppercase macro parameter. - (CLASS_TYPE_P): Likewise. - (IS_AGGR_TYPE_CODE): Uppercase macro parameter and parenthesis. - (IS_AGGR_TYPE_2): Whitespace. - (TAGGED_TYPE_P): Uppercase macro parameter. - (TYPE_BUILT_IN): Whitespace. - (TYPE_FOR_JAVA): Likewise. - (FUNCTION_ARG_CHAIN): Remove parenthesis. - (FUNCTION_FIRST_USER_PARMTYPE): Add parenthesis. - (FUNCTION_FIRST_USER_PARAM): Likewise. - (PROMOTES_TO_AGGR_TYPE): Whitespace. - (DERIVED_FROM_P): Add parenthesis and wrap. - (UNIQUELY_DERIVED_FROM_P): Likewise. - (ACCESSIBLY_UNIQUELY_DERIVED_P): Likewise. - (PUBLICLY_UNIQUELY_DERIVED_P): Likewise. - (CLASSTYPE_USE_TEMPLATE): Whitespace. - (CLASSTYPE_INLINE_FRIENDS): Remove parenthesis. - (TYPE_GETS_DELETE): Add parenthesis. - (TYPE_HAS_CONVERSION): Add parenthesis and wrap. - (TYPE_HAS_ASSIGN_REF): Likewise, - (TYPE_HAS_CONST_ASSIGN_REF): Likewise. - (TYPE_HAS_INIT_REF): Likewise. - (TYPE_HAS_CONST_INIT_REF): Likewise. - (TYPE_BEING_DEFINED): Likewise. - (TYPE_LANG_SPECIFIC): Likewise. - (CLASSTYPE_RTTI): Likewise. - (TYPE_OVERLOADS_CALL_EXPR): Likewise. - (TYPE_OVERLOADS_ARRAY_REF): Likewise. - (TYPE_OVERLOADS_ARROW): Likewise. - (TYPE_USES_MULTIPLE_INHERITANCE): Likewise. - (TYPE_USES_VIRTUAL_BASECLASSES): Add parenthesis. - (CLASSTYPE_METHOD_VEC): Likewise. - (CLASSTYPE_MARKED_N): Likewise. - (CLASSTYPE_MARKED): Likewise. - (CLASSTYPE_MARKED2): Likewise. - (CLASSTYPE_MARKED3): Likewise. - (CLASSTYPE_MARKED4): Likewise. - (CLASSTYPE_MARKED5): Likewise. - (CLASSTYPE_MARKED6): Likewise. - (SET_CLASSTYPE_MARKED): Whitespace. - (CLEAR_CLASSTYPE_MARKED): Likewise. - (SET_CLASSTYPE_MARKED2): Likewise. - (CLEAR_CLASSTYPE_MARKED2): Likewise. - (SET_CLASSTYPE_MARKED3): Likewise. - (CLEAR_CLASSTYPE_MARKED3): Likewise. - (SET_CLASSTYPE_MARKED4): Likewise. - (CLEAR_CLASSTYPE_MARKED4): Likewise. - (SET_CLASSTYPE_MARKED5): Likewise. - (CLEAR_CLASSTYPE_MARKED5): Likewise. - (SET_CLASSTYPE_MARKED6): Likewise. - (CLEAR_CLASSTYPE_MARKED6): Likewise. - (CLASSTYPE_TAGS): Likewise. - (CLASSTYPE_VSIZE): Likewise. - (CLASSTYPE_VBASECLASSES): Likewise. - (CANONICAL_BINFO): Add parenthesis. - (CLASSTYPE_SIZE(NODE): Likewise. - (CLASSTYPE_SIZE_UNIT): Likewise. - (CLASSTYPE_ALIGN(NODE): Likewise. - (CLASSTYPE_USER_ALIGN): Likewise. - (TYPE_JAVA_INTERFACE): Likewise. - (CLASSTYPE_PURE_VIRTUALS): Likewise. - (CLASSTYPE_NEEDS_VIRTUAL_REINIT): Whitespace and wrap. - (TYPE_HAS_DEFAULT_CONSTRUCTOR): Likewise. - (CLASSTYPE_HAS_MUTABLE): Likewise. - (CLASSTYPE_FRIEND_CLASSES): Likewise. Likewise. - (CLASSTYPE_DECLARED_CLASS): Whitespace and wrap. - (CLASSTYPE_READONLY_FIELDS_NEED_INIT): Likewise. - (CLASSTYPE_REF_FIELDS_NEED_INIT): Likewise. - (CLASSTYPE_INTERFACE_ONLY): Likewise. - (CLASSTYPE_INTERFACE_KNOWN): Likewise. - (CLASSTYPE_INTERFACE_UNKNOWN): Likewise. - (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. - (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. - (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. - (CLASSTYPE_DEBUG_REQUESTED): Whitespace and wrap. - (BINFO_UNSHARED_MARKED): Whitespace. - (BINFO_MARKED): Whitespace and wrap. - (SET_BINFO_MARKED): Likewise. - (CLEAR_BINFO_MARKED): Likewise. - (BINFO_VTABLE_PATH_MARKED): Likewise. - (SET_BINFO_VTABLE_PATH_MARKED): Likewise. - (CLEAR_BINFO_VTABLE_PATH_MARKED): Likewise. - (BINFO_SUBVTT_INDEX): Remove parenthesis. - (BINFO_VPTR_INDEX): Likewise. - (BINFO_PRIMARY_BASE_OF): Likewise, - (CLASSTYPE_VFIELDS): Whitespace. - (VF_DERIVED_VALUE): Wrap long line. - (NAMESPACE_LEVEL): Whitespace. - (CAN_HAVE_FULL_LANG_DECL_P): Remove parenthesis. - (DEFARG_POINTER): Whitespace. - (DECL_NEEDED_P): Remove parenthesis. - (DECL_LANGUAGE): Whitespace. - (SET_DECL_LANGUAGE): Add parenthesis. - (DECL_CONSTRUCTOR_P): Whitespace and wrap. - (DECL_OVERLOADED_OPERATOR_P): Remove parenthesis. - (DECL_IN_AGGR_P): Whitespace. - (DECL_FRIEND_P): Likewise. - (DECL_BEFRIENDING_CLASSES): Likewise. - (DECL_STATIC_FUNCTION_P): Whitespace and wrap. - (DECL_NONCONVERTING_P): Whitespace. - (DECL_PURE_VIRTUAL_P): Likewise. - (DECL_NEEDS_FINAL_OVERRIDER_P): Likewise. - (DECL_PENDING_INLINE_INFO): Whitespace. - (DECL_SORTED_FIELDS): Likewise. - (DECL_DEFERRED_FN): Likewise. - (DECL_TEMPLATE_INFO): Likewise. - (CLASSTYPE_TEMPLATE_INFO): Whitespace and wrap. - (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO); Likewise. - (SET_TYPE_TEMPLATE_INFO): Add parenthesis. - (TMPL_ARGS_LEVEL): Likewise. - (SET_TMPL_ARGS_LEVEL): Likewise. - (INNERMOST_TEMPLATE_PARMS): Whitespace. - (C_TYPEDEF_EXPLICITLY_SIGNED): Uppercase macro parameter. - (INTEGRAL_CODE_P(CODE): Add parenthesis. - (CP_INTEGRAL_TYPE_P): Remove parenthesis. - (TYPE_HAS_CONSTRUCTOR): Whitespace. - (TREE_HAS_CONSTRUCTOR): Likewise. - (TYPE_HAS_DESTRUCTOR): Likewise. - (TYPE_HAS_REAL_ASSIGN_REF): Likewise. - (TYPE_HAS_COMPLEX_ASSIGN_REF): Likewise. - (TYPE_HAS_ABSTRACT_ASSIGN_REF): Likewise. - (TYPE_HAS_COMPLEX_INIT_REF): Likewise. - (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): Likewise. - (TYPE_PTRMEMFUNC_P): Likewise. - (TYPE_PTRMEMFUNC_FLAG): Likewise. - (TYPE_GET_PTRMEMFUNC_TYPE): Likewise. - (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. - (TYPE_PTRMEM_CLASS_TYPE): Remove parenthesis. - (TYPE_PTRMEM_POINTED_TO_TYPE): Likewise. - (DECL_ACCESS): Whitespace. - (DECL_GLOBAL_CTOR_P): Remove parenthesis. - (DECL_GLOBAL_DTOR_P): Likewise. - (GLOBAL_INIT_PRIORITY): Likewise. - (DECL_TEMPLATE_PARMS): Likewise. - (DECL_TEMPLATE_RESULT): Likewise. - (DECL_TEMPLATE_INSTANTIATIONS): Likewise. - (DECL_TEMPLATE_SPECIALIZATIONS): Likewise. - (DECL_IMPLICIT_TYPEDEF_P): Remove parenthesis. - (SET_DECL_IMPLICIT_TYPEDEF_P): Likewise. - (PRIMARY_TEMPLATE_P): Add parenthesis. - (DECL_USE_TEMPLATE): Whitespace. - (CLASSTYPE_IMPLICIT_INSTANTIATION): Likewise. - (SET_CLASSTYPE_IMPLICIT_INSTANTIATION): Likewise. - (CLASSTYPE_EXPLICIT_INSTANTIATION): Likewise. - (SET_CLASSTYPE_EXPLICIT_INSTANTIATION): Likewise. - (CALL_DECLARATOR_PARMS): Remove parenthesis. - (CALL_DECLARATOR_QUALS): Likewise. - (CALL_DECLARATOR_EXCEPTION_SPEC): Likewise. - (TEMP_NAME_P): Wrap. - (VFIELD_NAME_P): Likewise. - (B_SET): Uppercase macro parameters and add parenthesis. - (B_CLR): Likewise. - (B_TST): Likewise. - (LOOKUP_NAMESPACES_ONLY): Uppercase macro parameters. - (LOOKUP_TYPES_ONLY): Uppercase macro parameters. - (LOOKUP_QUALIFIERS_ONLY): Uppercase macro parameters. - (same_or_base_type_p): Likewise. - (cp_deprecated): Likewise. - -2002-01-05 Richard Henderson - - * semantics.c (expand_body): Revert last change. - -2002-01-04 Jason Merrill - - PR c++/4122 - * class.c (update_vtable_entry_for_fn): Set delta to zero for a - lost primary. - - * class.c (build_vtbl_initializer): Check for a lost primary - before calculating the vtable entry to throw away. - -2002-01-02 Jason Merrill - - * semantics.c (expand_body): Call outlining_inline_function when - emitting an inline function out of line. - -2002-01-02 Nathan Sidwell - - PR c++/5116, c++/764 reversion - * call.c (build_new_op): Revert the instantiations. They are - incorrect. - -2002-01-02 Nathan Sidwell - - PR c++/5089 - * decl2.c (reparse_absdcl_as_casts): Don't warn about casts to void. - -2002-01-02 Nathan Sidwell - - PR c++/3716 - * pt.c (tsubst_aggr_type): Move pmf handling into tsubst. - (tsubst, case POINTER_TYPE): Handle pmfs here. - (tsubst, case OFFSET_TYPE): Check it is not an offset to - reference. If it is offset to FUNCTION_TYPE, create a METHOD_TYPE. - -2002-01-02 Nathan Sidwell - - PR c++/35 - * cp-tree.h (DECL_LANG_FLAG_0): Used for PARM_DECL too. - (DECL_TEMPLATE_PARM_P): A PARM_DECL might be one too. - * pt.c (process_template_parm): SET_DECL_TEMPLATE_PARM_P on the - PARM_DECL. - (tsubst_template_parms): Break up loop statements. - (tsubst_decl, case PARM_DECL): Copy DECL_TEMPLATE_PARM_P. Template - parm PARM_DECLs don't get promoted. - -2002-01-02 Nathan Sidwell - - PR c++/5123 - * typeck.c (build_component_ref): Cope with a TEMPLATE_ID_EXPR. - (build_x_function_call): Cope with a COMPONENT_REF containing a - TEMPLATE_ID_EXPR. - -2002-01-02 Nathan Sidwell - - PR c++/5213 - * pt.c (convert_template_argument): Be more careful determining - when RECORD_TYPE templates are or are not templates. - -2002-01-02 Nathan Sidwell - - PR c++/775 - * cp-tree.h (handle_class_head): Adjust prototype. - * decl2.c (handle_class_head): Add DEFN_P and NEW_TYPE_P - parameters. Use for all class heads. - * parse.y (named_class_head_sans_basetype, named_class_head, - named_complex_class_head_sans_basetype, - named_class_head_sans_basetype_defn, - unnamed_class_head): Remove. - (class_head, class_head_apparent_template): Recognize class heads - (class_head_decl, class_head_defn): New reductions. Process class - heads. - (structsp): Adjust class definition and class declaration - reductions. - (maybe_base_class_list): Give diagnostic on empty list. - -2002-01-02 Nathan Sidwell - - PR c++/4379 - * typeck.c (build_x_unary_op): Don't destroy the OFFSET_REF on a - single non-static member. - (unary_complex_lvalue): If it cannot be a pointer to member, don't - make it so. Check it is not pointer to reference. - -2002-01-02 Nathan Sidwell - - PR c++/5132 - * decl2.c (reparse_absdcl_as_casts): Don't digest_init if we - are processing a template decl. - -2002-01-02 Nathan Sidwell - - PR c++/5116, c++/764 - * call.c (build_new_op): Make sure template class operands are - instantiated. Simplify arglist construction. - -2001-12-29 Nathan Sidwell - - * call.c (build_user_type_conversion_1): Use my_friendly_assert - rather than if ... abort. - * cvt.c (convert_to_reference): Likewise. - * semantics.c (setup_vtbl_ptr): Likewise. - * pt.c (lookup_template_class): Comment typo. - -2001-12-29 Nathan Sidwell - - PR c++/5125 - * pt.c (push_template_decl_real): Make sure DECL has - DECL_LANG_SPECIFIC. - -2001-12-29 Nathan Sidwell - - PR c++/335 - * init.c (resolve_offset_ref): Copy cv qualifiers of this pointer - for non-reference fields. - * typeck.c (require_complete_type): Use resolve_offset_ref). - -2001-12-26 Nathan Sidwell - - PR c++/196 - * parse.y (bad_parm): Better diagnostic when given a SCOPE_REF. - -2001-12-24 Nathan Sidwell - - PR c++/160 - * typeck.c (build_modify_expr): Remove old unreachable code & tidy - up. Don't stabilize_references when initializing a reference. - -2001-12-23 Kaveh R. Ghazi - - * decl2.c (lang_f_options): Const-ify. - -2001-12-20 Joseph S. Myers - - * config-lang.in (diff_excludes): Remove. - -2001-12-19 Nathan Sidwell - - PR c++/90 - * typeck.c (build_function_call_real): Use original function - expression for errors. - -2001-12-18 Jason Merrill - - PR c++/3242 - * class.c (add_method): Do compare 'this' quals when trying to match a - used function. Don't defer to another used function. - -2001-12-18 Nathan Sidwell - - * pt.c (instantiate_clone): Remove, fold into ... - (instantiate_template): ... here. Simplify by removing mutual - recursion. - * typeck2.c (build_m_component_ref): Don't cv qualify the function - pointed to by a pointer to function. - * class.c (delete_duplicate_fields_1): Typo. - -2001-12-18 Jason Merrill - - C++ ABI change: destroy value arguments in caller. - * semantics.c (genrtl_start_function, genrtl_finish_function): Don't - create an extra binding level for the parameters. - * decl.c (store_parm_decls): Don't do parameter cleanups. - -2001-12-18 Nathan Sidwell - - * call.c (build_new_method_call): Use '%#V'. - * error.c (cv_to_string): Use V parameter to determine padding. - -2001-12-18 Joseph S. Myers - - * call.c, decl2.c, init.c: Use "built-in" and "bit-field" - spellings in messages. - -2001-12-17 Zack Weinberg - - * cp-tree.h: Delete #defines for cp_error, cp_warning, - cp_pedwarn, and cp_compiler_error. - * call.c, class.c, cp-tree.h, cvt.c, decl.c, decl2.c, error.c, - except.c, friend.c, init.c, lex.c, method.c, parse.y, pt.c, - rtti.c, search.c, semantics.c, spew.c, tree.c, typeck.c, - typeck2.c: Change calls to the above macros to use their - language-independent equivalents: error, warning, pedwarn, and - internal_error respectively. - -2001-12-16 Neil Booth - - * decl2.c (finish_file): Remove back_end_hook. - -2001-12-16 Joseph S. Myers - - * ChangeLog.1, ChangeLog.2, ChangeLog, NEWS, call.c, class.c, - cp-tree.h, decl.c, decl2.c, except.c, operators.def, optimize.c, - pt.c, rtti.c, semantics.c, typeck.c: Fix spelling errors. - -2001-12-15 Joseph S. Myers - - * lang-options.h: Use American spelling in messages. - -2001-12-13 Jason Merrill - - * Make-lang.in (parse.h): Separate rule, just depend on parse.c. - - Use cleanups to run base and member destructors. - * init.c (push_base_cleanups): New function, split out from... - (build_delete): ...here. Lose !TYPE_HAS_DESTRUCTOR code. - * decl.c (finish_destructor_body): Move vbase destruction code to - push_base_cleanups. - (begin_function_body, finish_function_body): New fns. - (finish_function): Move [cd]tor handling and call_poplevel to - finish_function_body. - (pushdecl): Skip the new level. - * semantics.c (genrtl_try_block): Don't call end_protect_partials. - (setup_vtbl_ptr): Call push_base_cleanups. - * method.c (synthesize_method): Call {begin,end}_function_body. - * pt.c (tsubst_expr): Handle COMPOUND_STMT_BODY_BLOCK. - * cp-tree.h: Declare new fns. - * parse.y (function_body, .begin_function_body): New nonterminals. - (fndef, pending_inline, function_try_block): Use function_body. - (ctor_initializer_opt, function_try_block): No longer has a value. - (base_init): Remove .set_base_init token. - (.set_base_init, compstmt_or_error): Remove. - * Make-lang.in (parse.c): Expect two fewer s/r conflicts. - - * optimize.c (maybe_clone_body): Fix parameter updating. - -2001-12-12 Jason Merrill - - * decl.c (store_parm_decls): Remove parms_have_cleanups cruft. - * semantics.c (genrtl_start_function): Don't pass - parms_have_cleanups or push an extra binding level. - (genrtl_finish_function): Lose cleanup_label cruft. - - * cp-tree.h (struct cp_language_function): Remove x_ctor_label. - (ctor_label): Remove. - * semantics.c (finish_return_stmt): Lose ctor_label support. - * decl.c (finish_constructor_body, mark_lang_function): Likewise. - * typeck.c (check_return_expr): Check DECL_DESTRUCTOR_P, not - dtor_label. - - * call.c (build_new_method_call): Let resolves_to_fixed_type_p - check for [cd]tors. - * class.c (fixed_type_or_null, case INDIRECT_REF): Fix. - - * decl.c (finish_function): Check VMS_TARGET, not VMS. - - * decl.c (start_cleanup_fn): Remove redundant pushlevel. - (end_cleanup_fn): And poplevel. - - * semantics.c (setup_vtbl_ptr): Always build a CTOR_INITIALIZER - if we're in a template. - -2001-12-12 Jakub Jelinek - - * cp-tree.h (DESTRUCTOR_DECL_PREFIX, DESTRUCTOR_NAME_P, - ANON_PARMNAME_FORMAT, ANON_PARMNAME_P, DESTRUCTOR_NAME_FORMAT, - THIS_NAME_P): Delete. - * spew.c (read_process_identifier): Remove DESTRUCTOR_NAME_P, - THIS_NAME_P and ANON_PARMNAME_P tests from warning about clash - with internal naming scheme. - * error.c (dump_decl): Remove DESTRUCTOR_NAME_P use. - -2001-12-12 Nathan Sidwell - - * decl.c (grokdeclarator): Deprecated implicit typename use. - -2001-12-11 Nathan Sidwell - - PR g++/51 - * parse.y (frob_specs): Indicate it is a language linkage which - contained the extern. - * decl.c (grokdeclarator): Allow extern language linkage with - other specifiers. - -2001-12-10 Nathan Sidwell - - PR g++/72 - * decl.c (add_binding): Don't reject duplicate typedefs involving - template parameters. - -2001-12-10 Neil Booth - - * parse.y, semantics.c: Similarly. - -2001-12-09 Nathan Sidwell - - PR g++/87 - * cp-tree.h (DECL_COPY_CONSTRUCTOR_P): Use copy_fn_p. - (copy_args_p): Rename to ... - (copy_fn_p): ... here. - (grok_special_member_properties): New function. - (grok_op_properties): Lose VIRTUALP parameter. - (copy_assignment_arg_p): Remove. - * call.c (build_over_call): Use copy_fn_p. - * decl.c (grokfndecl): Reformat. Adjust call to - grok_op_properties. - (copy_args_p): Rename to ... - (copy_fn_p): ... here. Reject template functions. Check for pass - by value. - (grok_special_member_properties): Remember special functions. - (grok_ctor_properties): Don't remember them here, just check. - (grok_op_properties): Likewise. - (start_method): Call grok_special_member_properties. - * decl2.c (grokfield): Likewise. - (copy_assignment_arg_p): Remove. - (grok_function_init): Don't remember abstract assignment here. - * pt.c (instantiate_class_template): Call - grok_special_member_properties. - (tsubst_decl): Adjust grok_op_properties call. - -2001-12-08 Aldy Hernandez - - * lex.c (rid_to_yy): Add RID_CHOOSE_EXPR and - RID_TYPES_COMPATIBLE_P. - -2001-12-08 John David Anglin - - * semantics.c (simplify_aggr_init_exprs_r): Add DIRECT_BIND flag in - call to build_aggr_init. - * cp-tree.h (DIRECT_BIND): Document new use of DIRECT_BIND. - -2001-12-08 Neil Booth - - * parse.y: Replace uses of the string non-terminal with STRING. - Don't perform string concatentaion here. - (string): Remove non-terminal. - * semantics.c (finish_asm_stmt): Don't concatenate strings here. - -2001-12-05 Jason Merrill - - * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Define. - (LANG_HOOKS_TREE_INLINING_END_INLINING): Define. - * tree.c (cp_start_inlining, cp_end_inlining): New fns. - * pt.c (push_tinst_level): No longer static. - * cp-tree.h: Declare them. - - * init.c (resolve_offset_ref): Don't check access for the base - conversion to access a FIELD_DECL. - - * cp-tree.h (TYPE_REFFN_P): New macro. - * decl.c (bad_specifiers): Check it, too. - - * rtti.c (create_pseudo_type_info): Set CLASSTYPE_INTERFACE_ONLY - on the __*_type_info type if we haven't seen a definition. - -2001-12-05 Neil Booth - - * decl.c: Include c-common.h. - (shadow_warning): Move to c-common.c. - -2001-12-05 Richard Kenner - - * decl.c (duplicate_decls): Don't copy DECL_NO_CHECK_MEMORY_USAGE. - -2001-12-04 Nathan Sidwell - - * pt.c (end_template_parm_list): Clear TREE_CHAIN of each parm. - -2001-12-04 Nathan Sidwell - - PR g++/164 - * init.c (sort_base_init): Allow binfos to be directly specified. - * method.c (do_build_copy_constructor): Explicitly convert to the - base instance. - (do_build_assign_ref): Likewise. - -2001-12-03 Hans-Peter Nilsson - - * decl.c (xref_basetypes): Don't use C99 construct in tag_code - declaration and initialization. - -2001-12-03 Neil Booth - - * typeck2.c: Remove leading capital from diagnostic messages, as - per GNU coding standards. - -2001-12-03 Mumit Khan - - PR c++/3394 - * decl.c (xref_basetypes): Handle attributes between - 'class' and name. - -2001-12-03 Nathan Sidwell - - PR g++/3381 - * parse.y (named_complex_class_head_sans_basetype): Add new - reduction. - * Make-lang.in (parse.c): Adjust expected conflict count. - -2001-12-03 Jason Merrill - - * class.c (finish_vtbls): Fill in BINFO_VPTR_FIELD in the - immediate binfos for our virtual bases. - -2001-12-02 Neil Booth - - * call.c (build_java_interface_fn_ref): Similarly. - * except.c (is_admissible_throw_operand): Similarly. - * init.c (build_java_class_ref): Similarly. - * xref.c (open_xref_file): Similarly. - -2001-12-01 Neil Booth - - * class.c (finish_struct): Remove trailing periods from messages. - * decl.c (check_tag_decl): Similarly. - * lex.c (cxx_set_yydebug): Similarly. - * typeck2.c (friendly_abort): Similarly. - -2001-11-29 Mark Mitchell - - PR c++/3048 - * cp-tree.h (ovl_member): Remove. - * decl2.c (merge_functions): Handle extern "C" functions - specially. - * tree.c (ovl_member): Remove. - -2001-11-29 Mark Mitchell - - PR c++/4842 - * class.c (get_basefndecls): Take an IDENTIFIER_NODE, not a - FUNCTION_DECL, as input. - (mark_overriders): Remove. - (warn_hidden): Rework for the new ABI. - -2001-11-29 Mark Mitchell - - PR c++/3471 - * call.c (convert_like_real): Do not build additional temporaries - for rvalues of class type. - -2001-11-28 Nathan Sidwell - - * cp-tree.h (UNIQUELY_DERIVED_FROM_P): Use lookup base. - (ACCESSIBLY_UNIQUELY_DERIVED_FROM_P): Likewise. - (PUBLICLY_UNIQUELY_DERIVED_FROM_P: Likewise. - (DERIVED_FROM_P): Likewise. - (enum base_access): Renumber, add ba_quiet bit mask. - (get_binfo): Remove. - (get_base_distance): Remove. - (binfo_value): Remove. - (ACCESSIBLY_DERIVED_FROM_P): Remove. - * call.c (standard_conversion): Use lookup_base. - * class.c (strictly_overrides): Likewise. - (layout_virtual_bases): Likewise. - (warn_about_ambiguous_direct_bases): Likewise. - (is_base_of_enclosing_class): Likewise. - (add_vcall_offset_vtbl_entries_1): Likewise. - * cvt.c (build_up_reference): Adjust comment. - * init.c (build_member_call): Reformat. - * search.c (get_binfo): Remove. - (get_base_distance_recursive): Remove. - (get_base_distance): Remove. - (lookup_base_r): Tweak. - (lookup_base): Add ba_quiet control. Complete the types here. - (covariant_return_p): Use lookup_base. - * tree.c (binfo_value): Remove. - (maybe_dummy_object): Use lookup_base. - * typeck.c (build_static_cast): Use lookup_base. - (get_delta_difference): Likewise. - * typeck2.c (binfo_or_else): Use lookup_base. - (build_scoped_ref): Add back error_mark_check. - (build_m_component_ref): Use lookup_base. - -2001-11-29 Joseph S. Myers - - * Make-lang.in (c++.generated-manpages): New dummy target. - -2001-11-27 Richard Kenner - - * Make-lang.in (cp-lang.o): Depends on c-common.h. - * cp-lang.c (c-common.h): Include. - (LANG_HOOKS_EXPAND_CONSTANT, LANG_HOOKS_SAFE_FROM_P): New hooks. - * decl.c (cxx_init_decl_processing): Don't set lang_safe_from_p. - * expr.c (init_cplus_expand): Don't set lang_expand_constant. - -2001-11-26 Neil Booth - - * decl2.c (c_language): Move to c-common.c. - * lex.c (cxx_post_options, cxx_init_options): Use c-common.c - functions. - (cxx_init): Update. - -2001-11-26 Jason Merrill - - * call.c (joust): Remove COND_EXPR hack. - -2001-11-25 Aldy Hernandez - - * search.c (lookup_base_r): Declare bk in variable declaration - space. - -2001-11-25 Nathan Sidwell - - PR g++/3145 - * class.c (build_vbase_pointer): Remove. - (build_vbase_path): Remove. - (build_base_path): New function. - * cp-tree.h (base_access, base_kind): New enumerations. - (build_base_path): Declare. - (convert_pointer_to_real): Remove. - (convert_pointer_to): Remove. - (lookup_base): Declare. - (convert_pointer_to_vbase): Remove. - * call.c (build_scoped_method_call): Use lookup_base & - build_base_path instead of convert_pointer_to_real, - get_base_distance & get_binfo. - (build_over_call): Likewise. - * cvt.c (cp_convert_to_pointer): Likewise. - (convert_to_pointer_force): Likewise. - (build_up_reference): Likewise. - (convert_pointer_to_real): Remove. - (convert_pointer_to): Remove. - * init.c (dfs_initialize_vtbl_ptrs): Use build_base_path - instead of convert_pointer_to_vbase & build_vbase_path. - (emit_base_init): Use build_base_path instead of - convert_pointer_to_real. - (expand_virtual_init): Lose unrequired conversions. - (resolve_offset_ref): Use lookup_base and build_base_path - instead of convert_pointer_to. - * rtti.c (build_dynamic_cast_1): Use lookup_base & - build_base_path instead of get_base_distance & build_vbase_path. - * search.c (get_vbase_1): Remove. - (get_vbase): Remove. - (convert_pointer_to_vbase): Remove. - (lookup_base_r): New function. - (lookup_base): New function. - * typeck.c (require_complete_type): Use lookup_base & - build_base_path instead of convert_pointer_to. - (build_component_ref): Likewise. - (build_x_function_call): Likewise. - (get_member_function_from_ptrfunc): Likewise. - (build_component_addr): Likewise. - * typeck2.c (build_scoped_ref): Likewise. - -2001-11-22 Bryce McKinlay - - * cp-tree.h (CP_TYPE_QUALS): Removed. - * decl.c (cxx_init_decl_processing): Don't set lang_dump_tree. - * cp-lang.c: Set LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN and - LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN. - * dump.c (cp_dump_tree): Use void* dump_info argument to match - lang-hooks prototype. - * call.c, cp-tree.h, cvt.c, decl.c, init.c, mangle.c, method.c, pt.c, - rtti.c, semantics.c, tree.c, typeck.c, typeck2.c: All references to - CP_TYPE_QUALS changed to cp_type_quals. - * Make-lang.in: References to c-dump.h changed to tree-dump.h. - (CXX_C_OBJS): Remove c-dump.o. - -2001-11-21 Mark Mitchell - - PR c++/3637 - * pt.c (lookup_template_class): Ensure that all specializations - are registered on the list corresponding to the most general - template. - -2001-11-20 Mark Mitchell - - * call.c (non_reference): Add documentation. - (convert_class_to_reference): Do not strip reference types - from conversion operators. - (maybe_handle_ref_bind): Simplify. - (compare_ics): Correct handling of references. - -2001-11-19 John Wilkinson - - * dump.c (dump_op): New function. - (cp_dump_tree): Dump CLASSTYPE_TEMPLATE_SPECIALIZATION. Use - dump_op. Dump DECL_MUTABLE, access and staticness for VAR_DECLs. - DECL_PURE_VIRTUAL_P, DECL_VIRTUAL_P, - -2001-11-19 Mark Mitchell - - PR4629 - * semantics.c (finish_sizeof): Make sure that expression created - while processing a template do not have a type. - (finish_alignof): Likewise. - * typeck.c (c_sizeof): Likewise. - (expr_sizeof): Likewise. - -2001-11-18 Neil Booth - - * lex.c (cxx_finish): Call c_common_finish. - (finish_parse): Remove. - -2001-11-17 Kriang Lerdsuwanakij - - * decl.c (create_array_type_for_decl): Check if NAME is NULL_TREE - when displaying error message about missing array bounds. - -2001-11-17 Kriang Lerdsuwanakij - - * mangle.c (write_expression): Handle CAST_EXPR, STATIC_CAST_EXPR, - CONST_CAST_EXPR. - * operators.def: Add CAST_EXPR, STATIC_CAST_EXPR, CONST_CAST_EXPR. - -2001-11-16 Neil Booth - - * cp-tree.h (print_class_statistics): Restore. - -2001-11-15 Jason Merrill - - * method.c (use_thunk): Don't emit debugging information for thunks. - - * parse.y: Add ... IDENTIFIER SCOPE and ... PTYPENAME SCOPE expansions. - * decl.c (make_typename_type): Handle getting a class template. - * search.c (lookup_field_r): A class template is good enough for - want_type. - - * call.c (convert_like_real): Only use cp_convert for the bad part. - (standard_conversion): Also allow bad int->enum. - * typeck.c (ptr_reasonably_similar): Also allow functions to - interconvert. Pointers to same-size integers are reasonably - similar. - - * cvt.c (convert_to_void): If we build a new COND_EXPR, always - give it void type. - -2001-11-15 Nathan Sidwell - - PR g++/3154 - * init.c (sort_base_init): Remove unreachable code. - (expand_member_init): Adjust comment to reflect reality. Simplify - and remove unreachable code. - -2001-11-15 Neil Booth - - * cp-tree.h (init_reswords, cxx_init_decl_processing): New. - (cxx_init): Update prototype. - * decl.c (init_decl_processing): Rename. Move null node init - to its creation time. - * lex.c (cxx_init_options): Update. - (cxx_init): Combine with old init_parse; also call - cxx_init_decl_processing. - -2001-11-14 Richard Sandiford - - * decl.c (check_initializer): Try to complete the type of an - array element before checking whether it's complete. Don't - complain about arrays with complete element types but an - unknown size. - (cp_finish_decl): Build the hierarchical constructor before - calling maybe_deduce_size_from_array_init. - -2001-11-14 Joseph S. Myers - - * Make-lang.in: Change all uses of $(manext) to $(man1ext). - -2001-11-13 Nathan Sidwell - - PR g++/4206 - * parse.y (already_scoped_stmt): Remove. - (simple_stmt, WHILE & FOR): Use implicitly_scoped_stmt. - -2001-11-12 H.J. Lu - - * cvt.c (ocp_convert): Don't warn the address of a weak - function is always `true'. - -2001-11-09 Neil Booth - - * cp-lang.c (LANG_HOOKS_PRINT_DECL, LANG_HOOKS_PRINT_TYPE, - LANG_HOOKS_PRINT_STATISTICS, LANG_HOOKS_PRINT_XNODE, - LANG_HOOKS_PRINT_IDENTIFIER, LANG_HOOKS_SET_YYDEBUG): Override. - * cp-tree.h (print_class_statistics): Remove. - (cxx_print_statistics, cxx_print_xnode, cxx_print_decl, cxx_print_type, - cxx_print_identifier, cxx_set_yydebug): New. - * lex.c (set_yydebug): Rename c_set_yydebug. - * ptree.c (print_lang_decl, print_lang_type, print_lang_identifier, - lang_print_xnode): Rename. - * tree.c (print_lang_statistics): Rename. - -2001-11-09 Kaveh R. Ghazi - - * class.c (dump_array): Fix format specifier warning. - -2001-11-09 Neil Booth - - * cp-lang.c (LANG_HOOKS_NAME): Override. - (struct lang_hooks): Constify. - * lex.c (cxx_init_options): Update. - (lang_identify): Remove. - * parse.y (language_string): Remove. - -2001-11-08 Andreas Franck - - * Make-lang.in (CXX_INSTALL_NAME, GXX_CROSS_NAME, - DEMANGLER_CROSS_NAME): Handle program_transform_name the way - suggested by autoconf. - (GXX_TARGET_INSTALL_NAME, CXX_TARGET_INSTALL_NAME): Define. - (c++.install-common): Use the transformed target alias names. - -2001-11-06 Neil Booth - - * Make-lang.in: Update. - * cp-lang.c: Include langhooks-def.h. - -2001-11-04 Kriang Lerdsuwanakij - - * pt.c (tsubst_copy): Call tsubst for TYPEOF_EXPR. - -2001-11-03 Kaveh R. Ghazi - - * lex.c (copy_lang_type): Add static prototype. - -2001-11-02 Kriang Lerdsuwanakij - - * pt.c (unify): Handle SCOPE_REF. - -2001-11-01 Jakub Jelinek - - * tree.c (cp_copy_res_decl_for_inlining): Adjust - DECL_ABSTRACT_ORIGIN for the return variable. - -2001-10-31 Zack Weinberg - - * Make-lang.in: Replace $(INTL_TARGETS) with po-generated. - -2001-10-28 Joseph S. Myers - - * ChangeLog.1, ChangeLog.2, ChangeLog, class.c, decl2.c, search.c, - semantics.c, spew.c: Fix spelling errors. - -2001-10-27 Kriang Lerdsuwanakij - - * decl2.c (validate_nonmember_using_decl): Handle NAMESPACE_DECL. - -2001-10-25 Zack Weinberg - - * cp-lang.c: Redefine LANG_HOOKS_CLEAR_BINDING_STACK to - pop_everything. - -2001-10-23 Richard Kenner - - * cp-lang.c (cxx_get_alias_set): New function. - Point LANG_HOOKS_GET_ALIAS_SET to it. - -2001-10-23 Kriang Lerdsuwanakij - - * cp-tree.def (UNBOUND_CLASS_TEMPLATE): New tree node. - * cp-tree.h (make_unbound_class_template): Prototype new function. - * decl.c (make_unbound_class_template): New function. - * decl2.c (arg_assoc_template_arg): Handle UNBOUND_CLASS_TEMPLATE. - * error.c (dump_type): Likewise. - * mangle.c (write_type): Likewise. - * parse.y (template_parm): Likewise. - (template_argument): Use make_unbound_class_template. - * pt.c (convert_template_argument): Handle UNBOUND_CLASS_TEMPLATE. - (tsubst): Likewise. - (tsubst_copy): Likewise. - (unify): Likewise. - * tree.c (walk_tree): Likewise. - * typeck.c (comptypes): Likewise. - -2001-10-21 Kaveh R. Ghazi - - * xref.c (GNU_xref_member): Use safe-ctype macros and/or fold - extra calls into fewer ones. - -2001-10-18 Alexandre Oliva - - * decl.c (duplicate_decls): Propagate DECL_UNINLINABLE. - Warn when merging inline with attribute noinline. - (start_decl, start_function): Warn if inline and attribute - noinline appear in the same declaration. - -2001-10-16 H.J. Lu - - * cp-tree.h (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): Defined - for tree checking disabled. - -2001-10-16 Hans-Peter Nilsson - - * cp-tree.h (VFIELD_NAME_FORMAT) [NO_DOLLAR_IN_LABEL && - NO_DOT_IN_LABEL]: Adjust to match VFIELD_NAME. - -2001-10-15 Richard Sandiford - - * pt.c (UNIFY_ALLOW_MAX_CORRECTION): Define. - (unify): Only handle MINUS_EXPR specially if the above flag is set - and the subtracted constant is 1. Clear the flag on recursive calls. - Set it when unifying the maximum value in an INTEGER_TYPE's range. - -2001-10-15 Richard Sandiford - - * decl.c (bad_specifiers): Don't allow exception specifications - on any typedefs. - -2001-10-14 Neil Booth - - * cp/lex.c (init_cp_pragma): Similarly. - -2001-10-13 Kriang Lerdsuwanakij - - * pt.c (lookup_template_class): Build complete template arguments - for BOUND_TEMPLATE_TEMPLATE_PARM. - -2001-10-12 Kriang Lerdsuwanakij - - * cp-tree.h (TYPE_BINFO): Update comment. - (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK): New macro. - (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Use template_info. - (TYPENAME_TYPE_FULLNAME): Use TYPE_FIELDS. - (copy_type): Prototype new function. - * lex.c (copy_lang_decl): Gather tree node statistics. - (copy_lang_type): New function. - (copy_type): Likewise. - (cp_make_lang_type): Create lang_type for - BOUND_TEMPLATE_TEMPLATE_PARM. Set TYPE_BINFO for TYPENAME_TYPE - and BOUND_TEMPLATE_TEMPLATE_PARM. - * pt.c (tsubst): Use copy_type instead of copy_node. - * search.c (lookup_field_1): Ignore TYPENAME_TYPE. - -2001-10-12 Kriang Lerdsuwanakij - - * pt.c (determine_specialization): Ignore functions without - DECL_TEMPLATE_INFO. - -2001-10-12 Nathan Sidwell - - PR g++/4476 - * typeck2.c (abstract_virtuals_error): Ignore incomplete classes. - -2001-10-11 Jason Merrill - - * typeck2.c (store_init_value): Don't re-digest a bracketed - initializer. - - * class.c (finish_struct_anon): Use TYPE_ANONYMOUS_P instead of - ANON_AGGR_TYPE_P. - -2001-10-11 Richard Henderson - - * class.c (build_vtable_entry_ref): Create a VTABLE_REF instead - of an asm statement. - (build_vtbl_ref_1): Split out from build_vtbl_ref. - (build_vfn_ref): Use it to handle vtable descriptors before - calling build_vtable_entry_ref. - * decl2.c (output_vtable_inherit): Use assemble_vtable_inherit. - -2001-10-10 Richard Henderson - - * parse.y (asm_operand): Allow named operands. - * semantics.c (finish_asm_stmt): Tweek for changed location - of the operand constraint. - -2001-10-09 Jason Merrill - - * call.c (standard_conversion): Add bad conversion between - integers and pointers. - (convert_like_real): Don't use convert_for_initialization for bad - conversions; complain here and use cp_convert. - (build_over_call): Don't handle bad conversions specially. - (perform_implicit_conversion): Allow bad conversions. - (can_convert_arg_bad): New fn. - * cp-tree.h: Declare it. - * typeck.c (convert_for_assignment): Use it. - (ptr_reasonably_similar): Any target type is similar to void. - -2001-10-08 Alexandre Oliva - - * Make-lang.in (CXX_OBJS): Added cp-lang.o. - (cp/cp-lang.o): New rule. - * cp-tree.h: Declare hooks. - * tree.c: Make hooks non-static. - (init_tree): Don't initialize hooks here. - * lex.c: Likewise. Move definition of lang_hooks to... - * cp-lang.c: ... new file. - -2001-10-08 Richard Henderson - - * cp-tree.h (struct lang_decl_flags): Remove declared_inline. - (DECL_DECLARED_INLINE_P): Use the bit in struct c_lang_decl. - -2001-10-07 Kaveh R. Ghazi - - * class.c (build_vtable_entry_ref): Const-ify. - * decl.c (predefined_identifier, - initialize_predefined_identifiers): Likewise. - * init.c (build_new_1): Likewise. - * lex.c (cplus_tree_code_type, cplus_tree_code_length, resword): - Likewise. - -2001-10-05 Alexandre Oliva - - * optimize.c (struct inline_data): Moved to ../tree-inline.c. - (INSNS_PER_STMT): Likewise. - (remap_decl, remap_block, copy_scopy_stmt, copy_body_r): Likewise. - (copy_body, initialize_inlined_parameters): Likewise. - (declare_return_variable, inlinable_function_p): Likewise. - (expand_call_inline, expand_calls_inline): Likewise. - (optimize_inline_calls, clone_body): Likewise. - * tree.c (walk_tree): Moved to ../tree-inline.c. - (walk_tree_without_duplicates): Likewise. - (copy_tree_r, remap_save_expr): Likewise. - -2001-10-04 Alexandre Oliva - - * Make-lang.in (cp/decl.o, cp/tree.o): Depend on tree-inline.h. - (cp/pt.o, cp/semantics.o, cp/optimize.o): Likewise. - * cp-tree.h (lang_decl): Moved inlined_fns to tree_decl. - (TREE_READONLY_DECL_P, DECL_INLINED_FNS): Moved to ../tree.h. - (flag_inline_trees): Moved declaration to ../tree-inline.h. - (walk_tree): Moved declaration to ../tree-inline.h. - (walk_tree_without_duplicates, copy_tree_r): Likewise. - (remap_save_expr): Likewise. - * decl.c: Include tree-inline.h. - (lang_mark_tree): Don't mark inlined_fns. - * decl2.c (flag_inline_trees): Moved defn to ../tree-inline.c. - * optimize.c: Include tree-inline.h. - (optimize_inline_calls): Move declaration to ../tree.h, as - non-static. - (remap_decl): Use language-independent constructs and hooks. - (remap_block, copy_body_r, declare_return_variable): Likewise. - (inlinable_function_p): Likewise. Don't test for - DECL_LANG_SPECIFIC before DECL_INLINED_FNS as inlined_fns is - no longer language-specific. - (optimize_inline_calls): Likewise. Make it non-static. Moved - call of dump_function to... - (optimize_function): Here... - (clone_body): New function, extracted from... - (maybe_clone_body): ... here. Build decl_map locally and pass - it on to clone_body. - * pt.c, semantics.c: Include tree-inline.h. - * tree.c: Likewise. - (cp_walk_subtrees): New language-specific hook for tree inlining. - (cp_cannot_inline_tree_fn, cp_add_pending_fn_decls, - cp_is_overload_p, cp_auto_var_in_fn_p, - cp_copy_res_decl_for_inlining): Likewise. - (walk_tree): Move language-specific constructs into... - (cp_walk_subtrees): this new function. - (copy_tree_r): Use language-independent constructs and hooks. - (init_tree): Initialize tree inlining hooks. - (remap_save_expr): Adjust prototype so that the declaration - does not require the definition of splay_tree. - -2001-10-03 John David Anglin - - * rtti.c (get_tinfo_decl): Call typeinfo_in_lib_p with the type used - to build the declaration instead of the declaration itself. - -2001-10-02 Jason Merrill - - * decl2.c (cxx_decode_option): Add 'else'. - - * spew.c (end_input): No longer static. - * cp-tree.h: Declare it. - * parse.y (datadef): Add "error END_OF_SAVED_INPUT" expansion. - -2001-10-02 Joseph S. Myers - - * call.c (build_over_call), typeck.c (build_function_call_real): - Pass type attributes to check_function_format rather than name or - assembler name. Don't require there to be a name or assembler - name to check formats. - -2001-10-02 Joseph S. Myers - - * decl.c (init_decl_processing): Don't call - init_function_format_info. Initialize lang_attribute_table - earlier. - (builtin_function): Call decl_attributes. - (insert_default_attributes): New. - -2001-10-01 Jason Merrill - - * decl.c (grokdeclarator): Copy array typedef handling from C - frontend. - - * decl.c (grokdeclarator): Copy too-large array handling from C - frontend. - -2001-09-29 Alexandre Oliva - - * config-lang.in (target_libs): Added target-gperf, so that we - don't try to build it if C++ is disabled. - -2001-09-23 Zack Weinberg - - * Make-lang.in (CXX_OBJS): Take out cp/errfn.o. - (cp/errfn.o): Delete rule. - (cp/error.o): Depend on flags.h. - * errfn.c: Delete file. - * cp-tree.h: Declare warn_deprecated. Remove definitions of - TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, - and TFF_TEMPLATE_DEFAULT_ARGUMENTS. #define cp_error, cp_warning, - cp_pedwarn, and cp_compiler_error to error, warning, pedwarn, and - internal_error respectively. Make cp_deprecated into a macro. - Don't define cp_printer typedef or declare cp_printers. - * error.c: Include flags.h. - Delete: struct tree_formatting_info, print_function_argument_list, - print_declaration, print_expression, print_function_declaration, - print_function_parameter, print_type_id, print_cv_qualifier_seq, - print_type_specifier_seq, print_simple_type_specifier, - print_elaborated_type_specifier, print_rest_of_abstract_declarator, - print_parameter_declaration_clause, print_exception_specification, - print_nested_name_specifier, and definition of cp_printers. - (locate_error): New function. - (cp_error_at, cp_warning_at, cp_pedwarn_at): Moved here and - rewritten in terms of locate_error and diagnostic.c. - (cp_tree_printer): Rename cp_printer; wire up to *_to_string - instead of deleted print_* routines. Handle %C, %L, %O, %Q also. - (init_error): Adjust to match. - -2001-09-22 Richard Kenner - - * Make-lang.in (CXX_C_OBJS): Add attribs.o. - -2001-09-21 Richard Henderson - - * class.c (set_vindex): Mind TARGET_VTABLE_USES_DESCRIPTORS. - (build_vtbl_initializer): Likewise. - (build_vfn_ref): New. - * cp-tree.h: Declare it. - * call.c (build_over_call): Use it. - * decl2.c (mark_vtable_entries): Mark FDESC_EXPR. - * typeck.c (get_member_function_from_ptrfunc): Mind descriptors. - -2001-09-21 J"orn Rennecke - - * decl.c (grokdeclarator): Use C syntax for attr_flags declaration. - -2001-09-21 Joseph S. Myers - - Table-driven attributes. - * decl.c: Rename DECL_MACHINE_ATTRIBUTES to DECL_ATTRIBUTES. - * decl2.c (cplus_decl_attributes): Only take one attributes - parameter. - * cp-tree.c (cplus_decl_attributes): Update prototype. - * class.c (finish_struct), decl.c (start_decl, start_function), - decl2.c (grokfield), friend.c (do_friend), parse.y - (parse_bitfield): Update calls to cplus_decl_attributes. - * decl.c (grokdeclarator): Take a pointer to a single ordinary - attribute list. - * decl.h (grokdeclarator): Update prototype. - * decl2.c (grokfield): Take a single ordinary attribute list. - * friend.c (do_friend): Likewise. - * decl.c (shadow_tag, groktypename, start_decl, - start_handler_parms, grokdeclarator, grokparms, start_function, - start_method), decl2.c (grokfield, grokbitfield, grokoptypename), - parse.y (parse_field, parse_bitfield, component_decl_1), pt.c - (process_template_parm, do_decl_instantiation): Pass single - ordinary attribute lists around. - * decl.c (grokdeclarator): Correct handling of nested attributes. - Revert the patch - 1998-10-18 Jason Merrill - * decl.c (grokdeclarator): Embedded attrs bind to the right, - not the left. - . - * cp-tree.h (cp_valid_lang_attribute): Remove declaration - (cp_attribute_table): Declare. - * decl.c (valid_lang_attribute): Don't define. - (lang_attribute_table): Define. - (init_decl_processing): Initialize lang_attribute_table instead of - valid_lang_attribute. - * tree.c (cp_valid_lang_attribute): Remove. - (handle_java_interface_attribute, handle_com_interface_attribute, - handle_init_priority_attribute): New functions. - (cp_attribute_table): New array. - * decl2.c (import_export_class): Don't use - targetm.valid_type_attribute. - -2001-09-15 Gabriel Dos Reis - - * Make-lang.in (cp/error.o): Depend on real.h - * error.c: #include "real.h" - -2001-09-15 Kaveh R. Ghazi - - * mangle.c (mangle_conv_op_name_for_type): Use concat in lieu of - xmalloc/strcpy/strcat. - -2001-09-13 Kaveh R. Ghazi - - * decl.c (warn_extern_redeclared_static, cp_make_fname_decl): - Const-ification. - * pt.c (tsubst_decl): Likewise. - -2001-09-12 Kaveh R. Ghazi - - * decl2.c (lang_f_options): Const-ification. - * lex.c (cplus_tree_code_name): Likewise. - * spew.c (yyerror): Likewise. - -2001-09-06 Nathan Sidwell - - PR c++/3986 - * class.c (force_canonical_binfo_r): Check & move an indirect - primary base first. - (force_canonical_binfo): Check that it's not already - canonical. - (mark_primary_virtual_base): Remove BINFO parameter. - (mark_primary_bases): Adjust, set BINFO_LOST_PRIMARY_P here. - -2001-09-06 Nathan Sidwell - - Remove TYPE_NONCOPIED_PARTS. - * cp-tree.h (CLASSTYPE_INLINE_FRIENDS): Map onto - CLASSTYPE_PURE_VIRTUALS. - (TYPE_RAISES_EXCEPTIONS): Map onto TYPE_BINFO. - * class.c (duplicate_tag_error): Remove TYPE_NONCOPIED_PARTS. - (layout_class_type): Don't call fixup_inline_methods here ... - (finish_struct_1): ... call it here. - -2001-09-04 Mark Mitchell - - * decl.c (duplicate_decls): Remove code deadling with - DECL_SAVED_INSNS. - * decl2.c (finish_file): Likewise. - * pt.c (instantiate_decl): Likewise. - * semantics.c (expand_body): Don't defer local functions if - they wouldn't be deferred for some other reason. Don't - generate RTL for functions that will not be emitted. - (genrtl_start_function): Remove code deadling with - DECL_SAVED_INSNS. - (genrtl_finish_function): Likewise. - -2001-09-04 Nathan Sidwell - - PR c++/4203 - * call.c (build_over_call): Do not optimize any empty base - construction. - -2001-08-31 Kriang Lerdsuwanakij - - * error.c (dump_template_decl): Output template parameters - together with their specifiers. - Output `class' prefix for template template parameter. - (dump_decl): Fix formatting. - -2001-08-30 Kurt Garloff - - * optimize.c (inlinable_function_p): Allow only smaller single - functions. Halve inline limit after reaching recursive limit. - -2001-08-30 Joern Rennecke - Jason Merrill - - * class.c (build_vtable_entry_ref): Subtract in char*, not - ptrdiff_t. - -2001-08-23 Jason Merrill - - * tree.c (cp_build_qualified_type_real): Use get_qualified_type. - (build_cplus_array_type): Use cp_build_qualified_type, not - TYPE_MAIN_VARIANT, to get an unqualified version. - - * decl2.c (grok_alignof): Lose. - (build_expr_from_tree): Use expr_sizeof and c_alignof_expr. - * typeck.c (c_alignof): Lose. - * semantics.c (finish_sizeof, finish_alignof): New. - * parse.y: Use them. - * cp-tree.h: Declare them. - -2001-08-22 Jason Merrill - - * pt.c (tsubst_expr): Hand off to the TREE_CHAIN of a statement. - Don't loop in COMPOUND_STMT, FOR_STMT or TRY_BLOCK. - * tree.c (cp_statement_code_p): A TAG_DEFN is a statement. - -2001-08-19 Jakub Jelinek - - * typeck2.c (add_exception_specifier): Only require complete type if - not in processing template declaration. - -2001-08-18 Kaveh R. Ghazi - - * decl.c: Cast argument to size_t, not HOST_WIDE_INT, in calls to - GNU_xref_start_scope and GNU_xref_end_scope. - - * tree.c (TYPE_HASH): Moved to ../tree.h. - -2001-08-16 Mark Mitchell - - * cvt.c (convert_to_void): Preserve TREE_SIDE_EFFECTS - on COMPOUND_EXPRs. - -2001-08-14 Richard Henderson - - * class.c, cp-tree.h (build_vfn_ref): Remove. - * call.c, rtti.c: Replace all refernces with build_vtbl_ref. - -2001-08-13 Mark Mitchell - - * call.c (build_over_call): Mark COMPOUND_EXPRs generated for - empty class assignment as having side-effects to avoid - spurious warnings. - -2001-08-13 Zack Weinberg - - * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. - * except.c: Include libfuncs.h. - -2001-08-11 Gabriel Dos Reis - - * decl.c (grokdeclarator): Clarify diagnostic message. - -2001-08-13 Kriang Lerdsuwanakij - - * decl2.c (do_nonmember_using_decl): Replace using directive - with using declaration in the error message. - -2001-08-11 Kriang Lerdsuwanakij - - * pt.c (maybe_fold_nontype_arg): Use TREE_TYPE of ARG as the - criterion to avoid rebuilding expression tree instead of - processing_template_decl. - -2001-08-07 Jason Merrill - - Support named return value optimization for inlines, too. - * decl.c (finish_function): Nullify returns here. - * semantics.c (genrtl_start_function): Not here. - (cp_expand_stmt): Don't mess with CLEANUP_STMTs. - (nullify_returns_r): No longer static. Just clear RETURN_EXPR. - Also nullify the CLEANUP_STMT for the nrv. - * cp-tree.h: Declare it. - * optimize.c (declare_return_variable): Replace the nrv with the - return variable. - * typeck.c (check_return_expr): Be more flexible on alignment check. - Ignore cv-quals when checking for a matching type. - -2001-08-09 Richard Henderson - - * decl2.c (finish_objects): Use target hooks instead of - assemble_constructor and assemble_destructor. - -2001-08-08 John David Anglin - - * g++spec.c (lang_specific_driver): Quote argument after `-Xlinker'. - -2001-08-07 Nathan Sidwell - - PR c++/3820 - Stop using TYPE_NONCOPIED_PARTS. - * call.c (build_over_call): Be careful when copy constructing - or assigning to an empty class. - * class.c (check_bases_and_members): It has a - COMPLEX_ASSIGN_REF if it has a vptr. - (layout_class_type): Don't add empty class padding to - TYPE_NONCOPIED_PARTS. - (finish_struct_1): Don't add the VFIELD either. - * cp-tree.h (TYPE_HAS_TRIVIAL_INIT_REF): Mention _copy_ - initialization. - -2001-08-07 Jason Merrill - - * tree.c (walk_tree): Walk siblings even if !walk_subtrees. - -2001-08-06 Richard Henderson - - * decl2.c (finish_objects): Pass a symbol_ref and priority to - assemble_{constructor,destructor}. Remove priority handling. - -2001-08-05 Gabriel Dos Reis - - Don't allow template-id in using-declaration. - * decl2.c (validate_nonmember_using_decl): Handle template-ids. - (do_class_using_decl): Likewise. - -2001-08-04 Neil Booth - - * cp/spew.c (read_token): No need to pop buffers. - -2001-08-02 Stan Shebs - - * cp-tree.h (FNADDR_FROM_VTABLE_ENTRY): Remove, no longer used. - (fnaddr_from_vtable_entry): Remove decl. - * method.c (use_thunk): Update comment. - -2001-08-01 Andrew Cagney - - * repo.c (get_base_filename): Change return value to const char - pointer. - -2001-08-02 Nathan Sidwell - - Kill -fhonor-std. - * NEWS: Document. - * cp-tree.h (flag_honor_std): Remove. - (CPTI_FAKE_STD): Remove. - (std_node): Remove comment about it being NULL. - (fake_std_node): Remove. - * decl.c (in_fake_std): Remove. - (walk_namespaces_r): Remove fake_std_node check. - (push_namespace): Remove in_fake_std code. - (pop_namespace): Likewise. - (lookup_name_real): Remove fake_std_node check. - (init_decl_processing): Always create std_node. Always add - std:: things there. - (builtin_function): Always put non '_' fns in std. - * decl2.c (flag_honor_std): Remove. - (lang_f_options): Remove honor-std. - (unsupported_options): Add honor-std. - (set_decl_namespace): Remove fake_std_node check. - (validate_nonmember_using_decl): Likewise. - (do_using_directive): Likewise. - (handle_class_head): Likewise. - * dump.c (cp_dump_tree): Likewise. - * except.c (init_exception_processing): Adjust. - * init.c (build_member_call): Remove fake_std_node check. - (build_offset_ref): Likewise. - * lang-options.h: Remove -fhonor-std, -fno-honor-std. - * rtti.c (init_rtti_processing): Adjust. - -2001-07-31 Alexandre Petit-Bianco - - * tree.c (cp_tree_equal): WITH_CLEANUP_EXPR node to use its second - operand while calling cp_tree_equal. - -2001-07-31 Nathan Sidwell - - The 3.0 ABI no longer has vbase pointer fields. - * cp-tree.h (VBASE_NAME, VBASE_NAME_FORMAT, VBASE_NAME_P, - FORMAT_VBASE_NAME): Remove. - * method.c (do_build_copy_constructor): Adjust. - (do_build_assign_ref): Adjust. - * search.c (lookup_field_r): Adjust. - * typeck.c (build_component_ref): Adjust. - - The 3.0 ABI always has a vtable pointer at the start of every - polymorphic class. - * rtti.c (build_headof_sub): Remove. - (build_headof): Adjust. - (get_tinfo_decl_dynamic): No need to check flag_rtti - here. Adjust. - (create_real_tinfo_var): Explain why we need a hidden name. - -2001-07-31 Nathan Sidwell - - PR c++/3631 - * class.c (update_vtable_entry_for_fn): The fixed adjustment - of a virtual thunk should be from declaring base. - -2001-07-31 Nathan Sidwell - - * class.c (dfs_ctor_vtable_bases_queue_p): Always walk into - the shared virtual base, so preserving inheritance graph order. - -2001-07-30 Andreas Jaeger - - * decl2.c: Remove unused var global_temp_name_counter. - -2001-07-28 Richard Henderson - - * method.c (pending_inlines): Remove. - -2001-07-27 Nathan Sidwell - - * class.c (mark_primary_virtual_base): Don't adjust base - offsets here. - (dfs_unshared_virtual_bases): Adjust them here. - (mark_primary_bases): Explain why we adjust at the end. - -2001-07-27 Nathan Sidwell - - * class.c (finish_struct_1): When copying the primary base's - VFIELD, make sure we find it is at offset zero. - -2001-07-26 Kriang Lerdsuwanakij - - * pt.c (tsubst_template_parms): Call maybe_fold_nontype_arg and - tsubst_expr for default template arguments. - -2001-07-26 Nathan Sidwell - - PR c++/3621 - * spew.c (yylex): Only copy the token's lineno, if it is - nonzero. - -2001-07-26 Nathan Sidwell - - PR c++/3624 - * call.c (resolve_args): Simplify, call - convert_from_reference. - (build_new_op): Resolve and convert from reference ARG1 - earlier. Adjust ARG2 & ARG3 resolve and conversion. - -2001-07-26 Nathan Sidwell - - * decl.c (last_function_parm_tags): Remove. - (current_function_parm_tags): Remove. - (init_decl_processing): Adjust. - (start_function): Adjust. - (store_parm_decls): Adjust. - - PR c++/3152 - * decl.c (grokdeclarator): Detect when a function typedef is - declaring a function, and create last_function_parms correctly. - -2001-07-25 Jason Merrill - - * call.c (joust): Only prefer a non-builtin candidate to a builtin - one if they have the same signature. - - * cvt.c (build_up_reference): Take DECL parm. Check TREE_STATIC on - it rather than toplevel_bindings_p. Give it a mangled name if static. - (convert_to_reference): Adjust. - * decl2.c (get_temp_name): Lose. - * mangle.c (mangle_ref_init_variable): New fn. - (mangle_guard_variable): Strip the ref-init header. - * cp-tree.h: Adjust. - * decl.c (cp_finish_decl): Add the DECL_STMT after processing the - initializer. - (grok_reference_init): Always use DECL_INITIAL. - -2001-07-25 Nathan Sidwell - - PR c++/3416 - * call.c (build_conditional_expr): Recheck args after - conversions. - * cp-tree.h (build_conditional_expr): Move to correct file. - * typeck.c (decay_conversion): Diagnose any unknown types - reaching here. - (build_binary_op): Don't do initial decay or default - conversions on overloaded functions. - (build_static_cast): Don't do a decay conversion here. - -2001-07-25 Nathan Sidwell - - PR c++/3543 - * typeck.c (condition_conversion): Resolve an OFFSET_REF. - * expr.c (cplus_expand_expr): An OFFSET_REF should never get here. - -2001-07-25 Nathan Sidwell - - * class.c (build_vtbl_or_vbase_field): Remove, move into ... - (create_vtbl_ptr): ... here. - -2001-07-25 Nathan Sidwell - - * class.c (build_vbase_offset_vbtl_entries): Look for - non-primary base of which we are a sub vtable. - -2001-07-24 Phil Edwards - - * semantics.c (finish_this_expr): Remove unused code. - -2001-07-24 Nathan Sidwell - - Simplify rtti, now we've only one ABI. - * cp-tree.h (cp_tree_index): Remove CPTI_TINFO_DECL_ID, - CPTI_TINFO_VAR_ID. - (tinfo_decl_id, tinfo_var_id): Remove. - (get_typeid_1): Remove. - * rtti.c - (init_rtti_processing): Remove tinfo_decl_id & tinfo_var_id. - (typeid_ok_p): New function. - (build_type_id): Call typeid_ok_p. Don't call tinfo_from_decl. - (get_tinfo_decl): Remove old abi documentation. - (tinfo_from_decl): Remove. - (get_type_id): Call typeid_ok_p. Absorb get_typeid_1. - (get_typeid_1): Remove. - (get_base_offset): Remove. - (synthesize_tinfo_var): Absorb get_base_offset. - (create_real_tinfo_var): Don't use tinfo_decl_id. - -2001-07-23 Graham Stott - - * cp/class.c (type_requires_array_cookie): Fix use of uninitialized - variable has_two_argument_delete_p. - -2001-07-21 Nathan Sidwell - - Remove flag_vtable_thunk. It is always on for the 3.0 ABI. - * cp-tree.h (CPTI_DELTA2_IDENTIFIER): Remove. - (CPTI_INDEX_IDENTIFIER): Remove. - (CPT_PFN_OR_DELTA2_IDENTIFIER): Remove. - (delta2_identifier): Remove. - (index_identifier): Remove. - (pfn_or_delta2_identifier): Remove. - (flag_vtable_thunks): Remove. - (VTABLE_DELTA2_NAME): Remove. - (VTABLE_INDEX_NAME): Remove. - (FNADDR_FROM_VTABLE_ENTRY): Adjust. - (vfunc_ptr_type_node): Adjust. - (VTABLE_NAME_PREFIX): Adjust. - (build_vfn_ref): Lose first parameter. - (fixup_all_virtual_upcast_offsets): Remove. - * decl.c (initialize_predefined_identifiers): Remove - delta2_identifier, index_identifier, pfn_or_delta2_identifier. - (init_decl_processing): Remove no-vtable-thunk code. - * decl2.c (flag_vtable_thunks): Remove. - (mark_vtable_entries): Remove no-vtable-thunk code. - * error.c (dump_decl): Remove no-vtable-thunk code. - (dump_expr): Adjust ptr to member function code. - * init.c (initialize_vtable_ptrs): Remove no-vtable-thunk - code. - * rtti.c (build_headof): Remove no-vtable-thunk code. - (get_tinfo_decl_dynamic): Adjust build_vfn_ref call. - * search.c (get_base_distance): Remove expand_upcast_fixups case. - (virtual_context) Remove. - (expand_upcast_fixups): Remove. - (fixup_virtual_upcast_offsets): Remove. - (fixup_all_virtual_upcast_offsets): Remove. - * typeck.c (get_member_function_from_ptrfunc): Remove - no-vtable-thunk code. - * call.c (build_over_call): Adjust call to build_vfn_ref. - * class.c (build_vfn_ref): Lose first parameter. Remove - no-vtable-thunk code. - (build_rtti_vtbl_entries): Remove no-vtable-thunk code. - (build_vtable_entry): Remove no-vtable-thunk code. - -2001-07-20 Nathan Sidwell - - Remove old-abi remnants. Remove comments about old abi - behavior. Remove references to 'new-abi' in comments. - * cp-tree.h: Adjust comments. - (vbase_offsets_in_vtable_p): Delete. - (vcall_offsets_in_vtable_p): Delete. - (vptrs_present_everywhere_p): Delete. - (all_overridden_vfuns_in_vtables_p): Delete. - (merge_primary_and_secondary_vtables_p): Delete. - (TYPE_CONTAINS_VPTR_P): Adjust. - (VTT_NAME_PREFIX): Remove. - (CTOR_VTBL_NAME_PREFIX): Remove. - (init_vbase_pointers): Remove. - * class.c: Adjust coments. - (build_vbase_pointer_fields): Delete. - (build_vbase_pointer): Remove old-abi code. - (build_secondary_vtable): Likewise. - (modify_all_vtables): Likewise. - (create_vtable_ptr): Likewise. - (layout_class_type): Likewise. - (finish_struct_1): Likewise. - (finish_vtbls): Likewise. - (dfs_finish_vtbls): Delete. - (build_vbase_offset_vtbl_entries): Remove old-abi code. - * cvt.c: Adjust comments. - * decl.c: Adjust comments. - * decl2.c: Adjust comments. - * init.c: Adjust comments. - (construct_virtual_bases): Remove old-abi code. - * lang-specs.h: Remove -fno-new-abi. - * mangle.c: Adjust comments. - * rtti.c: Adjust comments. - (get_base_offset): Remove old-abi-code. - * search.c: Adjust comments. - (dfs_init_vbase_pointers): Remove. - (dfs_vtable_path_unmark): Remove. - (init_vbase_pointers): Remove. - * semantics.c: Adjust comments. - (emit_associated_thunks): Remove old-abi code. - * typeck.c: Adjust comments. - -2001-07-20 Daniel Berlin - - * Make-lang.in (cp/optimize.o): Depend on $(PARAMS_H), not - params.h. - -2001-07-19 Mark Mitchell - - * class.c (finish_struct_anon): Forbid nested classes. - -2001-07-19 Neil Booth - - * decl2.c: Don't include dwarfout.h and dwarf2out.h. - * optimize.c: Include debug.h. - (maybe_clone_body): Use debug hook. - * semantics.c: Include debug.h. - (expand_body): Use debug hook. - -2001-07-19 Neil Booth - - * spew.c (read_token, yyerror): Remove CPP_INT, CPP_FLOAT cases. - -2001-07-18 Mark Mitchell - - * class.c (type_requires_array_cookie): New function. - (check_methods): Don't try to figure out whether the type needs a - cookie here. - (check_bases_and_members): Set TYPE_VEC_NEW_USES_COOKIE here. - * cp-tree.h (TYPE_VEC_DELETE_TAKES_SIZE): Remove. - (TYPE_VEC_NEW_USES_COOKIE): Reimplement. - * pt.c (instantiate_class_template): Don't set - TYPE_VEC_DELETE_TAKES_SIZE. - * NEWS: Document ABI changes from GCC 3.0. - -2001-07-18 Xavier Delacour , - Gerald Pfeifer - - * NEWS (Changes in GCC 3.0): Fix typo. - -2001-07-13 Joseph S. Myers - - * decl2.c (cplus_decl_attributes): Take a pointer to the node to - which attributes are to be attached, and a flags argument. Update - call to decl_attributes. - (grokfield): Update call to decl_attributes. - * class.c (finish_struct): Update call to cplus_decl_attributes. - * cp-tree.h (cplus_decl_attributes): Update prototype. - * decl.c (start_decl, grokdeclarator, start_function): Update - calls to decl_attributes and cplus_decl_attributes. - * friend.c (do_friend): Update call to cplus_decl_attributes. - * parse.y (parse_bitfield): Update call to cplus_decl_attributes. - -2001-07-12 Mark Mitchell - - * decl.c (make_rtl_for_nonlocal_decl): Set DECL_C_HARD_REGISTER - for `register' variables with an asm-specification. - -2001-07-11 Mark Mitchell - - * semantics.c (finish_asm_stmt): Mark the output operands - to an asm addressable, if necessary. - -2001-07-11 Ben Elliston - - * Revert this change -- there is a subtle bug. - - PR c++/80 - * decl.c (finish_enum): New "attributes" argument; pass it to - cplus_decl_attributes. Use a narrower type if the enum is packed. - * cp-tree.h (finish_enum): Adjust prototype. - * parse.y (enum_head): New non-terminal. - (structsp): Use it. Enums now may be preceded or followed by - optional attributes -- pass their chained tree to finish_enum(). - * pt.c (tsubst_enum): Pass NULL_TREE for the new argument. - -2001-07-10 Mark Mitchell - - * pt.c (tsubst_decl): Set DECL_CONTEXT for namespace-scope - variables. - -2001-07-10 Jason Merrill - - * semantics.c (cp_expand_stmt): Fix for null - current_function_return_value. - -2001-07-10 Jan van Male - - * call.c (build_op_delete_call): Initialize fn. - (convert_like_real): Delete conditional. - (joust): Initialize *w and *l. - * class.c: Add prototype for binfo_ctor_vtable. - (get_primary_binfo): Initialize result. - * init.c (build_java_class_ref): Initialize name. - -2001-07-09 Erik Rozendaal - - * typeck.c (unary_complex_lvalue): Do not duplicate the - argument to modify, pre-, or post-increment when used as an - lvalue and when the argument has side-effects. - -2001-07-08 Joseph S. Myers - - * decl.c (start_decl): Don't call SET_DEFAULT_DECL_ATTRIBUTES. - (start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. Call - cplus_decl_attributes even if attrs is NULL. - * friend.c (do_friend): Don't call SET_DEFAULT_DECL_ATTRIBUTES. - -2001-07-08 Joseph S. Myers - - * decl.c (grokdeclarator), decl2.c (cplus_decl_attributes): Update - calls to decl_attributes. - -2001-07-06 Ira Ruben - - * cp-tree.def (TEMPLATE_DECL): Update comment. DECL_RESULT should - be DECL_TEMPLATE_RESULT. - -2001-07-05 Kriang Lerdsuwanakij - - * cp-tree.h (copy_template_template_parm): Rename to ... - (bind_template_template_parm): ... here. - * tree.c (copy_template_template_parm): Rename to ... - (bind_template_template_parm): ... here. Remove the case when - NEWARGS is NULL_TREE. - (copy_tree_r): Don't copy TEMPLATE_TEMPLATE_PARM and - BOUND_TEMPLATE_TEMPLATE_PARM. - * pt.c (lookup_template_class): Adjust. - -2001-07-05 Jason Merrill - - * cvt.c (convert_lvalue): New fn. - * cp-tree.h: Declare it. - * method.c (do_build_assign_ref): Use it. - (do_build_copy_constructor): Convert parm to base types - before calling base constructors. - - * typeck.c (check_return_expr): Check DECL_ALIGN instead of - DECL_USER_ALIGN. Check flag_elide_constructors instead of - optimize. - * semantics.c (cp_expand_stmt): Don't destroy the named return value. - -2001-07-02 Nathan Sidwell - - * optimize.c (optimize_inline_calls): New function, broken out - of ... - (optimize_function): ... here. Call it. Don't inline if it is - a thunk. - (dump_function): Print name of dump flag causing this dump. - * semantics.c (expand_body): Move thunk inline check to - optimize_function. - -2001-06-29 Joseph S. Myers - - * typeck.c (COMP_TYPE_ATTRIBUTES): Don't define. - (comptypes): Use target.comp_type_attributes. - -2001-06-29 Nathan Sidwell - - * cp-tree.h (flag_dump_class_layout): Remove unneeded declaration. - -2001-06-28 Gabriel Dos Reis - - * error.c (lang_print_error_function): Add a `diagnostic_context *' - parameter. Tweak. - -2001-06-27 Neil Booth - - * decl2.c (import_export_class): Update. - -2001-06-26 Gabriel Dos Reis - - * error.c (init_error): Adjust settings. - -2001-06-26 Gabriel Dos Reis - - * error.c (init_error): Adjust settings. - -2001-06-19 Richard Sandiford - - * except.c (initialize_handler_parm): Expect __cxa_begin_catch to - return pointers to data members by reference rather than by value. - -2001-06-18 Jason Merrill - - Implement the Named Return Value optimization. - * cp-tree.h (struct cp_language_function): Add x_return_value. - (current_function_return_value): Now a macro. - * decl.c: Don't define it. - (define_label, finish_case_label): Don't clear it. - (init_decl_processing): Don't register it with GC. - * semantics.c (genrtl_finish_function): Don't check it for - no_return_label. Copy the RTL from the return value to - current_function_return_value and walk, calling... - (nullify_returns_r): ...this new fn. - * typeck.c (check_return_expr): Set current_function_return_value. - -2001-06-15 Jason Merrill - - * class.c (dfs_accumulate_vtbl_inits): Just point to the base we're - sharing a ctor vtable with. Merge code for cases 1 and 2. - (binfo_ctor_vtable): New fn. - (build_vtt_inits, dfs_build_secondary_vptr_vtt_inits): Use it. - -2001-06-14 Jason Merrill - - * class.c (dfs_find_final_overrider): Fix logic. - - * class.c (update_vtable_entry_for_fn): Uncomment optimization to use - virtual thunk instead of non-virtual. - (get_matching_virtual): Uncomment. - - * pt.c (unify): Don't recurse between the POINTER_TYPE and the - OFFSET_TYPE. If we're adding cv-quals, the extra ones would be on - PARM, not ARG. - -2001-06-14 Nathan Sidwell - - * class.c (dfs_accumulate_vtbl_inits): For case 2 & 3, make sure - we've not emerged from the hierarchy of RTTI_BINFO on reaching - a non-virtual base. - -2001-06-13 Mark Mitchell - - * NEWS: Update release number. - -2001-06-12 Nathan Sidwell - - PR c++/3130, c++/3131, c++/3132 - * cp-tree.h (BINFO_UNSHARED_MARKED): New #define. - * class.c (force_canonical_binfo_r): Move - BINFO_UNSHARED_MARKED, BINFO_LOST_PRIMARY_P. Don't move - virtual bases unless they're primary and what they're primary - too has been moved. - (dfs_unshared_virtual_bases): Use BINFO_UNSHARED_MARKED. Cope - with morally virtual bases. Duplicate BINFO_LOST_PRIMARY_P and - BINFO_PRIMARY_BASE_OF. Clear BINFO_VTABLE for all but the most - derived binfo. - (mark_primary_bases): Use BINFO_UNSHARED_MARKED. - (layout_nonempty_base_or_field): Add most derived type - parameter. Adjust. - (layout_empty_base): Likewise. - (build_base_field): Likewise. - (build_base_fields): Likewise. - (propagate_binfo_offsets): Add most derived type - parameter. Skip non canonical virtual bases too. - (dfs_set_offset_for_unshared_vbases): Don't skip primary - bases. Do skip canonical bases. - (layout_virtual_bases): Adjust. - (layout_class_type): Adjust. - (dfs_get_primary_binfo): Build list of virtual primary base - candidates. - (get_primary_binfo): Check that the shared virtual primary - base candidate was found first. - (accumulate_vtbl_inits): Don't do anything for non-vptr - containing binfos. For case 1 primary virtual bases, keep - checking that we've not emerged from the hierarchy of RTTI_BINFO. - -2001-06-12 Nathan Sidwell - - PR c++/3089 - * class.c (dfs_accumulate_vtbl_inits): Always walk down the - hierarchy looking for primary bases for a ctor - vtable. Recursively call oneself, if we meet our primary via - this route and haven't met it yet via inheritance graph order. - -2001-06-11 Mark Mitchell - - * lang-options.h: Emit documentation for -fno-honor-std, not - -fhonor-std. - -2001-06-10 Alexandre Oliva - - * typeck.c (get_member_function_from_ptrfunc) [vbit_in_delta]: - Don't clobber delta. - (expand_ptrmemfunc_cst) [ptrmemfunc_vbit_in_delta]: Adjust pfn. - -2001-06-10 Mark Mitchell - Gabriel Dos Reis - - * Make-lang.in (cp/call.o): Depend on diagnostic.h - (cp/typeck.o): Depend on diagnostic.h - (cp/typeck2.o): Depend on diagnostic.h - (cp/repo.o): Depend on dignostic.h - * typeck.c: #include diagnostic.h - (convert_for_initialization): Remove extern declaration for - warningcount and errorcount. - - * call.c: #include diagnostic.h - (convert_like_real): Remove extern declaration for warnincount and - errorcount. - - * repo.c: #include diagnostic.h - * typeck2.c: #include diagnostic.h - -2001-06-08 Nathan Sidwell - - * decl.c (duplicate_decls): Fix DECL_TEMPLATE_RESULT thinko - in previous change. - -2001-06-08 Nathan Sidwell - - PR c++/2929 - * friend.c (do_friend): Use push_decl_namespace for classes at - namespace scope. - -2001-06-08 Nathan Sidwell - Jason Merrill - - PR c++/3061 - * class.c (build_secondary_vtable): Use assert, rather than an error - message. - (dfs_fixup_binfo_vtbls): BINFO_VTABLE might be NULL. - (dfs_accumulate_vtbl_inits): A lost primary virtual base may - be between ORIG_BINFO and RTTI_BINFO, but neither of them. - Don't set BINFO_VTABLE for a primary virtual base. - -2001-06-07 Mark Mitchell - - * decl.c (duplicate_decls): Update source position information - when a template function is defined. - -2001-06-07 Phil Edwards - - * lang-specs.h: Move -D_GNU_SOURCE to config/linux.h. - -2001-06-07 Nathan Sidwell - - PR c++/2914 - * decl.c (pushtag): Don't push into a complete type's scope. - -2001-06-06 Jason Merrill - - * cp-tree.h (THUNK_GENERATE_WITH_VTABLE_P): Lose. - (struct lang_decl_flags): Lose generate_with_vtable_p. - (BV_GENERATE_THUNK_WITH_VTABLE_P): Lose. - * class.c (copy_virtuals): Adjust. - * decl2.c (mark_vtable_entries): Adjust. - * method.c (make_thunk, build_vtable_entry): Adjust. - * class.c (update_vtable_entry_for_fn): Only look as far as the - first defining class. - (build_vtbl_initializer): Put nothing in the slot for a function only - defined in a lost primary virtual base. - (add_vcall_offset_vtbl_entries_1): Use the same code for - the lost primary case and the normal case. - (dfs_unshared_virtual_bases): Don't lose a non-virtual primary base. - (get_vfield_offset, get_derived_offset): Lose. - (dfs_find_final_overrider): Use look_for_overrides_here. - (get_matching_virtual): New fn. - * semantics.c (emit_associated_thunks): Check BV_USE_VCALL_INDEX_P, - not BV_VCALL_INDEX. - * search.c (look_for_overrides_here): Split out from... - (look_for_overrides_r): Here. - - * class.c (find_final_overrider): Return error_mark_node on error. - - * decl2.c (key_method): #if 0 accidental change. - -2001-06-06 John David Anglin - - * call.c (convert_default_arg): Use INTEGRAL_TYPE_P. - (build_over_call): Likewise. - * decl.c (grokparms): Likewise. - * pt.c (tsubst_decl): Likewise. - * typeck.c (convert_arguments): Likewise. - -2001-06-05 Mark Mitchell - - * semantics.c (begin_class_definition): Robustify. - - * pt.c (instantiate_decl): Tell the repository code about the - clones, not the cloned functions. - * repo.c (repo_template_used): Explicitly instantiate the cloned - function, not the clones. - -2001-06-05 Nathan Sidwell - - * call.c (build_user_type_conversion_1): Set ICS_USER_FLAG and - ICS_BAD_FLAG on created conversion. - (compare_ics): Break out rank. - -2001-06-05 Nathan Sidwell - - * decl.c (xref_tag): Remove extraneous %s on dependent name - lookup warning. - -2001-06-05 Nathan Sidwell - - * class.c (layout_vtable_decl): Fix off by one error on - build_index_type. - (build_vtt): Likewise. - (build_ctor_vtbl_group): Likewise. - -2001-06-05 Nathan Sidwell - - * class.c (maybe_indent_hierarchy): New function. - (dump_class_hierarchy_r): Add flags. Dump extra binfo - information, if enabled. Use maybe_indent_hierarchy. Adjust - output format. - (dump_class_hierarchy): Adjust prototype. Adjust output format. - (dump_array, dump_vtable, dump_vtt): New functions. - (finish_struct_1): Adjust hierarchy dumping. - (initialize_vtable): Call dump_vtable. - (build_vtt): Call dump_vtt. - (build_ctor_vtbl_group): Call dump_vtable. - * decl2.c (flag_dump_class_layout): Remove. - (cxx_decode_option): Remove dump translation unit - and dump class hierarchy check. Call dump_switch_p. - (finish_file): Adjust dumping. - (dump.c): Only dump base classes if not TDF_SLIM. - Only dump namespace members if not TDF_SLIM. - * optimize.c (dump_function): New function. - (optimize_function): Call dump_function. - * semantics.c (expand_body): Use dump_enabled_p. - -2001-06-01 Nathan Sidwell - - PR g++/2936 - Part missed from first commit - * decl2.c (finish_anon_union): Copy context. - -2001-05-30 Nathan Sidwell - - PR g++/2936 - * optimize.c (remap_decl): Remap anonymous aggregate members too. - -2001-05-26 Nathan Sidwell - - PR g++/2823 - * semantics.c (expand_body): Don't optimize thunks. - -2001-05-25 Sam TH - - * cp-tree.h lex.h: Fix header include guards. - -2001-05-25 Mark Mitchell - - * decl.c (init_decl_processing): Tweak. - -2001-05-24 Mark Mitchell - - * decl.c (duplicate_decls): Tidy. - (init_decl_processing): Always set flag_no_builtin. - -2001-05-24 Nathan Sidwell - - PR c++/2184 - * decl2.c (do_local_using_decl): Push the decls, even in a - template. - -2001-05-22 Mark Mitchell - - * optimize.c (initialize_inlined_parameters): Don't set - TREE_READONLY for a VAR_DECL taking the place of an inlined - PARM_DECL. - -2001-05-22 Jason Merrill - - * class.c, cp-tree.h, rtti.c: Remove com_interface attribute support. - * tree.c (cp_valid_lang_attribute): Warn about use of com_interface - attribute. - -2001-05-22 Joseph S. Myers - - * parse.y: Refer to compound literals as such, not as - constructor-expressions. - -2001-05-21 Mark Mitchell - - * call.c (build_op_delete_call): Ignore exception-specifications - when looking for matching delete operators. - * init.c (build_new_1): Compute whether or not the allocation - function used is a placement allocation function or not, and - communicate this information to build_op_delete_call. - -2001-05-21 Jason Merrill - - * class.c (build_vtable_entry_ref): Lose vtbl parm. Fix for new abi. - (build_vtbl_ref): Adjust. - (dfs_accumulate_vtbl_inits): Set TREE_CONSTANT on the vtable address. - * decl2.c (lang_f_options): Remove huge-objects, vtable-thunks. - Re-add vtable-gc. - (unsupported_options): Correspondingly. - - * decl2.c (maybe_make_one_only): Check flag_weak, not - supports_one_only(). - - * cp-tree.def (START_CATCH_STMT): Lose. - * dump.c (cp_dump_tree): Don't dump it. Do dump HANDLER_PARMS. - * tree.c (cp_statement_code_p): Don't case it. - * semantics.c (cp_expand_stmt): Likewise. - * cp-tree.h (START_CATCH_TYPE): Lose. - (HANDLER_TYPE): New. - * except.c (expand_start_catch_block): Don't start any blocks. - Return the type. - (expand_end_catch_block): Don't end any blocks. - * parse.y (handler): Don't pass anything from finish_handler_parms - to finish_handler. - * pt.c (tsubst_expr): Likewise. - * semantics.c (begin_handler): Call note_level_for_catch here. - (finish_handler_parms): Don't return anything. - (genrtl_catch_block, begin_catch_block): Lose. - (genrtl_handler): Call expand_start_catch here. - -2001-05-18 Jason Merrill - - * class.c (build_vtable): Set DECL_ASSEMBLER_NAME for vtables here. - (get_vtable_decl, build_vtt): Not here. - -2001-05-20 Nathan Sidwell - - PR c++/2781 - * optimize.c (update_cloned_parm): Copy addressability and other - flags. - -2001-05-20 Kriang Lerdsuwanakij - - * pt.c (determine_specialization): Ignore artificial functions. - -2001-05-20 Neil Booth - - * cp-tree.h (struct lang_identifier, C_RID_YYCODE): Update. - (C_RID_CODE): Remove. - * lex.c (cxx_init_options): Call set_identifier_size. Update. - (init_parse): Don't do it here. - -2001-05-18 Diego Novillo - - * decl2.c (finish_objects): Use the original SYMBOL_REF from the - function declaration to avoid stripping the symbol's attributes. - -2001-05-18 Nathan Sidwell - - * decl.c (pushdecl): Adjust error string. - (xref_tag): Adjust friend class injection warning. Remove the - inherited name from the class shadowed scope. - -2001-05-17 Mark Mitchell - - * except.c (cp_protect_cleanup_actions): New function. - (init_exception_processing): Don't set protect_cleanup_actions - here. Do set lang_protect_cleanup_actions. - -2001-05-16 Nathan Sidwell - - * spew.c (read_token): Call yyerror on all unexpected tokens. - -2001-05-16 Nathan Sidwell - - * init.c (member_init_ok_or_else): Take a tree rather than - string for name. - (expand_member_init): Adjust. - -2001-05-14 Nick Clifton - - * decl.c (duplicate_decls): Suppress warning about duplicate - decls if the first decl is a friend. - -2001-05-12 Zack Weinberg - - * except.c (choose_personality_routine): Export. Add - explanatory comment. Take an enum languages, not a boolean. - (initialize_handler_parm): Adjust to match. - * cp-tree.h: Prototype choose_personality_routine. - * lex.c (handle_pragma_java_exceptions): New function. - (init_cp_pragma): Register #pragma GCC java_exceptions. - -2001-05-12 Neil Booth - - * method.c (build_mangled_C99_name): Remove unused prototype. - -2001-05-12 Alexandre Oliva - - * cp-tree.h (ptrmemfunc_vbit_where_t): Declare type. - * typeck.c (get_member_function_from_ptrfunc, - build_ptrmemfunc, expand_ptrmemfunc_cst): Take - TARGET_PTRMEMFUNC_VBIT_LOCATION into account. - - Reverted Geoff Keating's 2001-05-03's patch. - -2001-05-11 Ira Ruben - - * cp/cp-tree.h (C_EXP_ORIGINAL_CODE): Delete; declared in c-common.h. - -2001-05-11 Neil Booth - - * cp-tree.h (finish_label_expr, lookup_label): Delete. - * parse.y: Update for '&&'; don't issue warning here. - * semantics.c (finish_label_expr): Delete. - -2001-05-07 Mark Mitchell - - * splay-tree.h (splay_tree_max): New function. - (splay_tree_min): Likewise. - -2001-05-03 Geoffrey Keating - - * cp-tree.h (enum cp_tree_index): Add CPTI_PFN_VFLAG_IDENTIFIER. - (pfn_vflag_identifier): Define. - Update comment about layout of pointer functions. - (build_ptrmemfunc1): Update prototype. - (expand_ptrmemfunc_cst): Update prototype. - * decl.c (initialize_predefined_identifiers): Initialize - pfn_vflag_identifier. - (build_ptrmemfunc_type): When FUNCTION_BOUNDARY < 16, add - an extra field to the type. - * expr.c (cplus_expand_constant): Pass 'flag' between - expand_ptrmemfunc_cst and build_ptrmemfunc1. - * typeck.c (get_member_function_from_ptrfunc): When - FUNCTION_BOUNDARY < 16, look at additional field to determine - if a pointer-to-member is a real pointer or a vtable offset. - (build_ptrmemfunc1): Add new parameter to contain extra field. - (build_ptrmemfunc): Pass the extra field around. - (expand_ptrmemfunc_cst): Add new parameter to return extra field. - (pfn_from_ptrmemfunc): Ignore the extra field. - -2001-05-03 Mark Mitchell - - * cp-tree.h (flag_inline_trees): Update documentation. - * decl.c (init_decl_processing): Adjust handling of - flag_inline_functions and flag_inline_trees to support -O3. - (grokfndecl): Set DECL_INLINE on all functions if that's what - the user requested. - (save_function_data): Clear DECL_INLINE in - current_function_cannot_inline is non-NULL. - * decl2.c (flag_inline_trees): Update documentation. - -2001-05-03 Nathan Sidwell - - * dump.c (cp_dump_tree, USING_STMT case): New case. - * tree.c (cp_statement_code_p): Add USING_STMT. - * decl2.c (do_using_directive): Add the using directive statement. - - * tree.c (walk_tree): Reformat an if block. - -2001-05-02 Mark Mitchell - - * decl.c (compute_array_index_type): Don't try to do anything with - the indices when processing a template. - -2001-05-02 Kaveh R. Ghazi - - * call.c: NULL_PTR -> NULL. - * class.c: Likewise. - * cvt.c: Likewise. - * decl.c: Likewise. - * decl2.c: Likewise. - * except.c: Likewise. - * init.c: Likewise. - * rtti.c: Likewise. - * search.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - -2001-05-02 Mark Mitchell - - * decl2.c (do_using_directive): Revert previous patch. - -2001-05-01 Nathan Sidwell - - * cp-tree.def (USING_STMT): New statement node. - * cp-tree.h (USING_STMT_NAMESPACE): New macro. - * decl2.c (do_using_directive): Add USING_STMT to statement - tree. Don't emit errors when processing template decl. - * pt.c (tsubst_expr, USING_STMT case): New case. - * semantics.c (cp_expand_stmt, USING_STMT case): New case. - -2001-05-01 Nathan Sidwell - - * call.c (build_new_op): Convert args from reference here. - (build_conditional_expr): Don't convert here. - -2001-05-01 Nathan Sidwell - - * spew.c (last_token_id): New static variable. - (read_token): Set it here. - (yyerror): Use it here. - -2001-04-30 Richard Henderson - - * cvt.c: Downcase C_PROMOTING_INTEGER_TYPE_P invocations. - * decl.c: Likewise. - -2001-04-30 Mark Mitchell - - * gxxint.texi: Remove. - * Make-lang.in: Remove all traces of gxxint.texi. - -2001-04-30 Mark P Mitchell - - * decl2.c (start_static_initialization_or_destruction): Correct - logic to handle the -fno-use-cxa-atexit case. - -2001-04-30 Mark Mitchell - - * optimize.c (update_cloned_parm): New function. - (maybe_clone_body): Use it. Update the `this' parameter too. - -2001-04-29 Joseph S. Myers - - * decl2.c (unsupported_options): Add new-abi. - * lang-options.h: Remove no longer supported options. - -2001-04-27 Nathan Sidwell - - * except.c (can_convert_eh): Don't check template parms, - typename types etc. - -2001-04-27 Nathan Sidwell - - * optimize.c (maybe_clone_body): Copy parameter names and locations. - -2001-04-27 Nathan Sidwell - - * cp-tree.h (adjust_clone_args): Prototype new function. - * class.c (adjust_clone_args): New function. - * decl.c (start_function): Call it for in charge ctors. - -2001-04-26 Mark Mitchell - - * method.c (use_thunk): Make sure that thunks really are emitted - when requested. - -2001-04-26 Nathan Sidwell - - * mangle.c (write_chars): New macro. - (hwint_to_ascii): New function - (write_number): Use it. - (write_integer_cst): Deal with really big numbers. - -2001-04-25 Mark Mitchell - - * optimize.c (maybe_clone_body): Copy TREE_PUBLIC before emitting - the clone. - -2001-04-25 Nathan Sidwell - - * decl.c (grokdeclarator): Set context of namespace scope - TYPE_DECLS. - -2001-04-24 Zack Weinberg - - * cp/optimize.c: Include hashtab.h. - (struct inline_data): Add tree_pruner. - (expand_call_inline, expand_calls_inline): Use it when calling - walk_tree. - (optimize_function): Initialize and free tree_pruner. - -2001-04-24 Nathan Sidwell - - Lazy __FUNCTION__ generation. - * cp-tree.def (FUNCTION_NAME): Remove. - * cp-tree.h (function_name_declared_p): Remove. - (cp_fname_init): Prototype. - * decl.c (init_decl_processing): Don't generate __FUNCTION__ et al ids, - don't call declare_function_name. Call start_fname_decls. - (cp_make_fname_decl): Adjust parameters. Generate the name. Don't - clobber the line number. - (cp_fname_init): New function. - (start_function): Call start_fname_decls. - (finish_function): Call finish_fname_decls. - * lex.c (reswords): Add slots for __FUNCTION__ et al. - (rid_to_yy): Add mappings for __FUNCTION__ et al. - * optimize.c (maybe_clone_body): Remove function_name_declared_p. - * parse.y (VAR_FUNC_NAME): New token. - (primary): Add VAR_FUNC_NAME. - * pt.c (tsubst_decl): Adjust a DECL_PRETTY_FUNCTION_P's - generation. - (tsubst, FUNCTION_NAME case): Remove. - (tsubst_copy, FUNCTION_NAME case): Remove. - (tsubst_expr, DECL_STMT case): Be careful with a - DECL_PRETTY_FUNCTION_P. - (instantiate_decl): Remove function_name_declared_p. - * semantics.c (begin_compound_statement): Don't call - declare_function_name here. - (setup_vtbl_ptr). Don't save & restore function_name_declared_p. - (finish_translation_unit): Call finish_fname_decls. - (expand_body): Remove function_name_declared_p. - * typeck2.c (digest_init): Allow any ERROR_MARK. - -2001-04-24 Nathan Sidwell - - * pt.c (tsubst_decl): Use VOID_TYPE_P. - * semantics.c: Fix some typos. - -2001-04-23 Phil Edwards - - * cp/decl2.c (flag_honor_std): Always initialize to 1. - -2001-04-22 Kaveh R. Ghazi - - * xref.c (GNU_xref_file): Use concat in lieu of xmalloc/sprintf. - -2001-04-23 Jason Merrill - - * except.c (build_throw): Wrap the initialization of the exception - object in a MUST_NOT_THROW_EXPR. - (do_free_exception): #if 0. - -2001-04-20 Mark Mitchell - - * cp-tree.h (finish_enum): Change prototype. - * decl.c (finish_enum): Reorganize. - * parse.y (structsp): Adjust calls to finish_enum. - -2001-04-20 Nathan Sidwell - - * tree.c (cp_tree_equal): Adjust final switch formatting. Add - 't' case. - -2001-04-20 Nathan Sidwell - - * class.c (dfs_unshared_virtual_bases): Add ATTRIBUTE_UNUSED. - (layout_empty_base): Return at end flag. - (build_base_field): Likewise. - (build_base_fields): Likewise. - (layout_virtual_bases): Don't add 1 to eoc value. - (end_of_class): Use full size for empty bases. - (layout_class_type): Clear CLASSNEARLY_EMPTY_P if we appended - empty bases. Don't add 1 to eoc value. Only add trailing padding - if we're an empty class with no empty bases. - (dump_class_hierarchy): Dump size and alignment. - -2001-04-20 Jakub Jelinek - - * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and - ICS_BAD_FLAG. - -2001-04-20 Jakub Jelinek - - * search.c (lookup_field_r): If looking for type and non-TYPE_DECL - is found, look first if name does not match the structure name. - -2001-04-19 Mark Mitchell - - * cp-tree.h (DECL_LANGUAGE): Don't assume DECL_LANG_SPECIFIC is - set. - (SET_DECL_LANGUAGE): New macro. - * decl.c (duplicate_decls): Use SET_DECL_LANGUAGE. - (pushdecl): Likewise. - (build_library_fn_1): Likewise. - (build_cp_library_fn): Likewise. - (grokfndecl): Likewise. - (grokvardecl): Mark `extern "C"' variables as having C linkage. - * decl2.c (grokclassfn): Use SET_DECL_LANGUAGE. - * lex.c (retrofit_lang_decl): Likewise. - * mangle.c (mangle_decl_string): Don't mangle the names of - variables declared with C language linkage. - * semantics.c (finish_member_declaration): Use SET_DECL_LANGUAGE. - -2001-04-18 John David Anglin - - * semantics.c (simplify_aggr_init_exprs_r): Don't restore - flag_access_control from uninitialized storage. - -2001-04-15 Mark Mitchell - - * cp-tree.h (TYPE_PTRMEM_CLASS_TYPE): Improve documentation. - * mangle.c (write_pointer_to_member_type): Fix mangling of - pointers to cv-qualified member function types. - - * init.c (build_delete): Create a SAVE_EXPR for the address if - we're going to use it more than once. - -2001-04-13 Mark Mitchell - - * cp-tree.h (DELTA2_FROM_PTRMEMFUNC): Remove. - (expand_ptremfunc_cst): Change prototype. - (delta2_from_ptrmemfunc): Remove. - * expr.c (cplus_expand_constant): Adjust call to - expand_ptrmemfunc_cst. - * typeck.c (build_ptrmemfunc1): Simplify. - (build_ptrmemfunc): Make sure that casting a PTRMEM_CST still - results in a constant. - (expand_ptrmemfunc_cst): Remove idx and delta2 parameters. - (delta2_from_ptrmemfunc): Remove. - (pfn_from_ptrmemfunc): Adjust call to expand_ptrmemfunc_cst. - -2001-04-12 Jason Merrill - - * cp-tree.h (decl_namespace_list): New macro. - (struct saved_scope): Add decl_ns_list. - * decl.c (mark_saved_scope): Mark it. - * decl2.c: Lose static decl_namespace_list. - (init_decl2): Don't save it. - -2001-04-12 Kaveh R. Ghazi - - * cp-tree.h (warn_return_type, yylex): Delete redundant - declarations. - - * decl.c (current_class_depth, global_namespace): Likewise. - - * decl2.c (current_class_depth, flag_gnu_xref): Likewise - - * repo.c (flag_use_repository): Likewise. - -2001-04-12 Kaveh R. Ghazi - - * cp-tree.h (pedantic, convert, global_bindings_p, insert_block, - set_block, pushdecl, getdecls, gettags, init_decl_processing, - maybe_build_cleanup, copy_lang_decl, prep_stmt, lvalue_p, - lvalue_or_else, print_lang_statistics, comp_target_types, - unsigned_type, signed_type, signed_or_unsigned_type, - build_function_call, mark_addressable, incomplete_type_error): - Delete redundant declarations. - -2001-04-11 Jason Merrill - - * cp-tree.h (TYPE_LINKAGE_IDENTIFIER): New macro. - (TYPE_ANONYMOUS_P): New macro. - (TAGGED_TYPE_P): New macro. - * decl.c (check_tag_decl): Use TYPE_ANONYMOUS_P. - (grokfndecl, grokvardecl, grokdeclarator): Likewise. - * tree.c (no_linkage_helper): Likewise. - * semantics.c (begin_class_definition): Likewise. - * pt.c (convert_template_argument): Likewise. - * lex.c (check_for_missing_semicolon): Likewise. - -2001-04-12 Nathan Sidwell - - * class.c (dfs_unshared_virtual_bases): New function. - (mark_primary_bases): Call it. - (check_bases): Ignore virtual bases when determining - nearly-emptiness. - -2001-04-12 Nathan Sidwell - - * method.c (make_thunk): Clear DECL_CLONED_FUNCTION. - -2001-04-11 Mark Mitchell - - * optimize.c (maybe_clone_body): Copy DECL_NUM_STMTS from the - cloned function to the clone. - -2001-04-11 Kaveh R. Ghazi - - * Make-lang.in (cp/semantics.o): Depend on $(EXPR_H). - - * semantics.c: Include expr.h. - -2001-04-11 Nathan Sidwell - - * method.c (implicitly_declare_fn): Commonize code for copy ctor - and assignment op. Set TREE_USED for parameter. - -2001-04-10 Mark Mitchell - - * class.c (find_final_overrider_data): Add `candidates'. - (dfs_find_final_overrider): Don't issue error messages - prematurely. - (find_final_overrider): Issue error messages here. - (build_base_field): Don't warn about amgibuous direct bases here. - (warn_about_ambiguous_direct_bases): New function. - (layout_class_type): Use it. - -2001-04-10 Richard Henderson - - * typeck.c (build_array_ref): Push the array reference inside - COMPOUND_EXPR and COND_EXPR. - -2001-04-05 Mark Mitchell - - * cp-tree.h (DECL_THIS_INLINE): Rename to DECL_DECLARED_INLINE_P. - * decl.c (duplicate_decls): Adjust accordingly. - (maybe_commonize_var): Likewise. - (grokfndecl): Likewise. - (start_function): Likewise. - (start_method): Likewise. - * decl2.c (key_method): Likewise. - (import_export_decl): Likewise. - * method.c (implicitly_declare_fn): Likewise. - * optimize.c (maybe_clone_body): Likewise. - -2001-04-05 Benjamin Kosnik - - * lang-specs.h: Add __DEPRECATED. - -2001-04-05 J"orn Rennecke - - * search.c (get_dynamic_cast_base_type): When building a new - constant, set its type to ssizetype. - -2001-04-04 Jakub Jelinek - - * optimize.c (expand_call_inline): Only add newly inlined statements - into inlined_stmts. - -2001-04-03 Mark Mitchell - - * cp-tree.h (OPERATOR_ASSIGN_FORMAT): Remove. - (OPERATOR_FORMAT): Likewise. - (OPERATOR_TYPENAME_FORMAT): Likewise. - * operators.def: Remove old name-mangling information. - * decl.c (grok_op_properties): Adjust accordingly. - * lex.c (init_operators): Likewise. - * rtti.c (get_tinfo_decl): Issue error messages about types that - have variable size. - -2001-04-03 Mark Mitchell - - * decl2.c (import_export_decl): Don't call import_export_class - when processing an inline member function. - * semantics.c (expand_body): Call import_export_decl before - emitting inline functions. - -2001-03-28 Richard Henderson - - IA-64 ABI Exception Handling: - * cp-tree.def (EH_SPEC_BLOCK): New. - (MUST_NOT_THROW_EXPR): New. - * cp-tree.h: Update changed function declarations. - (CPTI_PUSH_EXCEPTION_IDENTIFIER): Remove. - (CPTI_CALL_UNEXPECTED): New. - (struct cp_language_function): Rename x_eh_spec_try_block - to x_eh_spec_block. - (EH_SPEC_STMTS, EH_SPEC_RAISES): New. - * decl.c (current_binding_level): If no current function - bindings, revert to scope_chain. - (initialize_predefined_identifiers): Remove __cp_push_exception. - (store_parm_decls): Use begin_eh_spec_block. - (finish_function): Use finish_eh_spec_block. - (mark_lang_function): Update for name changes. - * decl2.c (finish_file): No mark_all_runtime_matches. - * dump.c (cp_dump_tree): Handle new tree codes. - * error.c (dump_expr) [BIND_EXPR]: Fix typo. - * except.c (catch_language_init, catch_language): Remove. - (init_exception_processing): Don't set language code. - Initialize call_unexpected_node, protect_cleanup_actions, - eh_personality_libfunc, lang_eh_runtime_type. - (call_eh_info, push_eh_info, get_eh_info, get_eh_value): Remove. - (get_eh_type, get_eh_caught, get_eh_handlers): Remove. - (prepare_eh_type): Split out type canonicalizations ... - (build_eh_type_type): ... from here. - (build_eh_type_type_ref): Remove. - (mark_all_runtime_matches): Remove. - (build_exc_ptr): New. - (do_begin_catch, do_end_catch): New. - (do_pop_exception): Remove. - (build_terminate_handler): Remove. - (choose_personality_routine): Split out language choice from ... - (initialize_handler_parm): ... here. - Use MUST_NOT_THROW_EXPR. - (expand_start_catch_block): Use do_begin_catch. Simplify Java - exception object handling. - (expand_start_eh_spec, expand_end_eh_spec): Remove. - (expand_exception_blocks, alloc_eh_object): Remove. - (begin_eh_spec_block, finish_eh_spec_block): New. - (do_allocate_exception, do_free_exception): New. - (expand_throw): Merge into ... - (build_throw): ... here. Update for abi. - * expr.c (cplus_expand_expr): No expand_internal_throw. - Handle MUST_NOT_THROW_EXPR. - * pt.c (tsubst_expr): Handle EH_SPEC_BLOCK. - * semantics.c (*) Update for except.h name changes. - (genrtl_try_block): No protect_with_terminate. - (genrtl_eh_spec_block): New. - (genrtl_handler): Don't emit the goto here. - (cp_expand_stmt): Handle EH_SPEC_BLOCK. - (genrtl_finish_function): Don't expand_exception_blocks. - * tree.c (cp_statement_code_p): Handle EH_SPEC_BLOCK. - -2001-03-28 Richard Henderson - - * decl.c (struct named_label_list): Rename eh_region to - in_try_scope, add in_catch_scope. - (struct binding_level): Rename eh_region to is_try_scope, - add is_catch_scope. - (note_level_for_try): Rename from note_level_for_eh. - (note_level_for_catch): New. - (poplevel): Copy both is_try_scope and is_catch_scope to - the named_label_list struct. - (check_previous_goto_1): Don't check for catch block via - DECL_ARTIFICIAL; use in_try_scope instead. - (check_goto): Likewise. - * cp-tree.h (note_level_for_try, note_level_for_catch): Declare. - * except.c (expand_start_catch_block): Call note_level_for_catch. - * semantics.c (begin_compound_stmt): Update for note_level_for_try. - -2001-03-27 Richard Henderson - - * except.c: Use USING_SJLJ_EXCEPTIONS instead of - exceptions_via_longjmp. - -2001-03-27 Phil Edwards - - * pt.c (check_default_tmpl_args): Make error messages clearer. - -2001-03-26 Phil Edwards - - * error.c: Also undefine 'A' macro used for cp_printers definition. - -2001-03-27 Kaveh R. Ghazi - - * Make-lang.in: Depend on $(SYSTEM_H), not system.h. - -2001-03-26 Mike Yang - Mark Mitchell - - * dump.c (dump_access): New function. - (cp_dump_tree): Use it. Dump basetype information for class - types. - -2001-03-26 Mark Mitchell - - * Makefile.in (optimize.o): Depend on params.h. - (duplicate_decls): Copy DECL_NUM_STMTS, not DECL_FRAME_SIZE. - (init_decl_processing): Set flag_no_inline when doing - inlining-on-trees. - * optimize.c: Include params.h. - (struct inline_data): Improve documentation of FNS. Add - FIRST_INLINED_FN, INLINED_STMTS, and CLONING_P. - (INSNS_PER_STMT): New macro. - (remap_block): Use CLONING_P. - (inlinable_function_p): Don't inline big functions. - (expand_call_inline): Keep track of how much inlining we've done. - (optimize_function): Set FIRST_INLINED_FN. - (maybe_clone_body): Set CLONING_P. - * semantics.c (simplify_aggr_init_exprs_r): Fix typing problems in - tree nodes. - (genrtl_finish_function): Clear DECL_DEFER_OUTPUT before calling - rest_of_compilation. Clear DECL_RTL for local variables - afterwards. - (clear_decl_rtl): New function. - -2001-03-26 Nathan Sidwell - - Implement DR 209 - * cp-tree.h (skip_type_access_control, - reset_type_access_control): Prototype. - * decl.c (grokdeclarator): Access of friends is not checked. - * parse.y (component_decl_list): Reset type access control. - * semantics.c (decl_type_access_control): Clear - current_type_lookups. - (save_type_access_control): Don't save if not deferring. - (skip_type_access_control, reset_type_access_control): New - functions. - (begin_class_definition): Do type access control for basetypes. - Start deferred access control. - (finish_class_definition): Resume immediate access control if - this is a local class. - -2001-03-25 Kaveh R. Ghazi - - * class.c (add_method): Use memcpy/memmove, not bcopy. - - * decl.c (duplicate_decls): Likewise. - -2001-03-23 Jakub Jelinek - - * mangle.c (write_discriminator): Use `_0' for discriminator 1, - not `_'. - -2001-03-23 Jakub Jelinek - - * decl.c (local_names): Define. - (push_local_name): New. - (grok_reference_init): Return init if initializing static reference - variable with non-constant instead of emitting it. - Move expand_static_init call to cp_finish_decl. - (layout_var_decl): Call push_local_name. - (maybe_commonize_var): Allow inlining functions even if they have - static local variables, use comdat_linkage for them if flag_weak. - (check_initializer): Call obscure_complex_init if - grok_reference_init returned nonzero. - (save_function_data): Clear x_local_names. - (pop_cp_function_context): Free x_local_names. - (mark_inlined_fns): Remove. - (mark_lang_function): Mark x_local_names. - (lang_mark_tree): Don't mark DECL_ACCESS for DECL_DISCRIMINATOR_P. - Mark inlined_fns as tree, remove call to mark_inlined_fns. - * class.c (alter_access): Ensure DECL_ACCESS is never set if - DECL_DISCRIMINATOR_P. - * cp-tree.h (cp_language_function): Add x_local_names. - (lang_decl_flags): Add discriminator into u2. - (lang_decl_inlined_fns): Remove. - (lang_decl): inlined_fns is now a TREE_VEC. - (DECL_DISCRIMINATOR_P, DECL_DISCRIMINATOR): Define. - * optimize.c (inlinable_function_p): DECL_INLINED_FNS is now a - TREE_VEC, not a custom structure. - (optimize_function): Likewise. - * mangle.c (discriminator_for_local_entity): Discriminate among - VAR_DECL local entities. - * search.c (dfs_access_in_type): If DECL_DISCRIMINATOR_P, DECL_ACCESS - is not valid. - -2001-03-22 Bryce McKinlay - - Add support for Java interface method calls. - * cp-tree.h (struct lang_type): Add java_interface flag. - (TYPE_JAVA_INTERFACE): New macro. - * tree.c (cp_valid_lang_attribute): Handle "java_interface" attribute - by setting TYPE_JAVA_INTERFACE. - * call.c (java_iface_lookup_fn): New static. - (build_over_call): If calling a method declared in a - TYPE_JAVA_INTERFACE, call build_java_interface_fn_ref to generate the - expression which resolves the function address. - (build_java_interface_fn_ref): New function. - -2001-03-22 Richard Henderson - - * Make-lang.in (cp/except.o): Don't depend on insn-flags.h. - * except.c: Don't include it. - -2001-03-22 Gerald Pfeifer - based on an idea from Joe Buck - - * parse.y (bad_decl, template_arg_list_ignore, arg_list_ignore): - New nonterminals. - (data_def, component_decl): Add reductions to bad_decl. - -2001-03-22 Jakub Jelinek - - * method.c (do_build_assign_ref): Don't use build_modify_expr for - anonymous aggregates, since they don't have assignment operator - method. - * decl.c (fixup_anonymous_aggr): Disallow ctors, dtors and copy - assignment operators for anonymous structure fields. - -2001-03-21 Jason Merrill - - * pt.c (instantiate_decl): Abort if we see a member constant - instantiation that doesn't already have its initializer. - Downgrade explicit instantiation without definition to pedwarn. - - * cp-tree.h (DECL_TINFO_FN_P, SET_DECL_TINFO_FN_P): Remove. - * class.c (build_vtable_entry): Don't check DECL_TINFO_FN_P. - (import_export_decl): Check tinfo_decl_p, not DECL_TINFO_FN_P. - - * cp-tree.h (CLASSTYPE_VTABLE_NEEDS_WRITING): Remove. - (pending_vtables): Remove. - * decl2.c (pending_vtables): Remove. - (import_export_vtable): Use CLASSTYPE_INTERFACE_ONLY, not - CLASSTYPE_VTABLE_NEEDS_WRITING. - (import_export_class): Likewise. - (init_decl2): Don't mark pending_vtables. - * lex.c (handle_pragma_vtable): Just sorry. - * pt.c (instantiate_class_template): Don't mess with - CLASSTYPE_VTABLE_NEEDS_WRITING. - (mark_class_instantiated): Likewise. - * ptree.c (print_lang_type): Don't print it. - * semantics.c (begin_class_definition): Don't set it. - - * pt.c (template_tail): Replace with last_pending_template. - (maybe_templates, maybe_template_tail): Remove. - (add_pending_template): Adjust. - (instantiate_pending_templates): Adjust. - - * cp-tree.h (struct saved_scope): Remove lang_stack field. - (current_lang_stack): Remove. - * decl.c (maybe_push_to_top_level): Don't initialize it. - (duplicate_decls): Use current_lang_depth. - (xref_basetypes): Likewise. - * class.c (current_lang_depth): New fn. - (push_lang_context): Use more varray functionality. - (pop_lang_context): Likewise. - - * error.c (GLOBAL_THING): Always use '__'. - -2001-03-21 Mark Mitchell - - * class.c (build_clone): Clear DECL_ASSEMBLER_NAME. - - * mangle.c (mangle_decl_string): Mangle the names of overloaded - operators, even when they have `extern "C"' linkage. - -2001-03-19 Mark Mitchell - - * class.c (get_vtable_decl): Use SET_DECL_ASSEMBLER_NAME, - COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME - where it's not necessary. - (add_method): Remove optimization involving comparison of - DECL_ASSEMBLER_NAME. - (build_vtbl_or_vbase_field): Use SET_DECL_ASSEMBLER_NAME, - COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME - where it's not necessary. - (check_methods): Likewise. - (build_clone): Likewise. - (built_vtt): Likewise. - * cp-tree.h (DECL_NEEDED_P): Likewise. - * decl.c (pushtag): Likewise. - (duplicate_decls): Likewise. - (pushdecl): Likewise. - (builtin_function): Likewise. - (build_library_fn_1): Set DECL_LANGUAGE for library functions. - (build_cp_library_fn): Likewise. - (maybe_commonize_var): Use SET_DECL_ASSEMBLER_NAME, - COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME - where it's not necessary. - (make_rtl_for_nonlocal_decl): Likewise. - (cp_finish_decl): Likewise. - (grokfndecl): Likewise. - (grokvardecl): Likewise. - (grokdeclarator): Likewise. - (start_function): Likewise. - (cp_missing_return_ok_p): Likewise. - * decl2.c (grokclassfn): Likewise. - (check_classfn): Likewise. - (finish_static_data_member_decl): Likewise. - (grokfield): Likewise. - * error.c (GLOBAL_IORD_P): Remove. - (dump_global_iord): Improve output. - (dump_decl): Avoid using DECL_ASSEMBLER_NAME. - * except.c (nothrow_libfn_p): Summarily reject any function not in - namespace-scope. - * init.c (build_java_class_ref): Don't explicitly set - DECL_ASSEMBLER_NAME after calling mangle_decl. - * mangle.c (mangle_decl_string): Handle extern "C" functions. - (mangle_decl): Set the DECL_ASSEMBLER_NAME for the decl. - * method.c (set_mangled_name_for_decl): Don't explicitly set - DECL_ASSEMBLER_NAME after calling mangle_decl. - (make_thunk): Explicitly set the DECL_ASSEMBLER_NAME and - IDENTIFIER_GLOBAL_VALUE for the thunk. - * pt.c (set_mangled_name_for_template_decl): Remove. - (check_explicit_specialization): Don't use it. - (looup_template_class): Don't set DECL_ASSEMBLER_NAME. - (tsubst_friend_function): Likewise. - (tsubst_decl): Likewise. - (regenerate_decl_from_template): Use COPY_DECL_ASSEMBLER_NAME. - * rtti.c (get_tinfo_decl): Use SET_DECL_ASSEMBLER_NAME, - COPY_DECL_ASSEMBLER_NAME, etc. Don't set DECL_ASSEMBLER_NAME - where it's not necessary. - (tinfo_base_init): Likewise. - (create_real_tinfo_var): Likewise. - * search.c (looup_field_1): Likewise. - * semantics.c (finish_named_return_value): Likewise. - * tree.c (init_tree): Set lang_set_decl_assembler_name. - -2001-03-15 Gabriel Dos Reis - - Correct semantics restrictions checking in throw-expression. - * except.c (is_admissible_throw_operand): New function. - (build_throw): Use it. - -2001-03-14 Mark Mitchell - - * decl.c (cp_make_fnname_decl): Set DECL_IGNORED_P on __FUNCTION__ - and its ilk. - -2001-03-14 Mark Mitchell - - * class.c (build_clone): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. - * cp-tree.h (DECL_IN_MEMORY_P): Likewise. - * decl.c (duplicate_decls): Likewise. - (builtin_function): Likewise. - (build_library_fn): Likewise. - (build_cp_library_fn): Likewise. - (check_initializer): Likewise. - (cp_finish_decl): Likewise. - * decl2.c (grokfield): Likewise. - (grok_function_init): Remove #if 0'd code. - (finish_anon_union): Use COPY_DECL_RTL, DECL_RTL_SET_P, etc. - * friend.c (do_friend): Likewise. - * init.c (get_temp_regvar): Likewise. - * method.c (make_thunk): Likewise. - * pt.c (tsubst_friend_function): Likewise. - (tsubst_decl): Likewise. - (regenerate_decl_from_template): Likewise. - * semantics.c (genrtl_named_return_value): Likewise. - (expand_body): Likewise. - (genrtl_finish_function): Likewise. - * tree.c (cp_tree_equal): Likewise. - -2001-03-12 Nathan Sidwell - - * call.c (convert_like_real): Add extra semantics to INNER - parameter. Don't convert to temporary if a user conversion - gives us an lvalue that we're about to bind to a reference. - Set INNER to indicate pending reference binding on recursive - calls. - -2001-03-10 Neil Booth - - * cp/lex.c: Delete duplicate pending_lang_change. - -2001-03-10 Neil Booth - - * cp/lex.c (handle_pragma_interface, handle_pragma_implementation): - Similarly. - * cp/repo.c (get_base_filename, open_repo_file): Similarly. - * cp/cp-tree.h: Remove file_name_nondirectory prototype. - -2001-03-09 Zack Weinberg - - * Make-lang.in: Add dependencies on $(TM_P_H) as appropriate. - -2001-03-08 Stan Shebs - - * cp-tree.h (set_identifier_local_value): Remove unused decl. - -2001-03-06 Zack Weinberg - - * spew.c: Remove references to CPP_OSTRING. - -2001-03-06 Andrew Haley - - * typeck.c (convert_arguments): Check that we have an fndecl. - -2001-03-05 Andrew Haley - - * typeck.c (convert_arguments): Don't do ellipsis conversion for - __built_in_constant_p. - -2001-03-02 Nathan Sidwell - - * typeck.c (build_static_cast): Allow enum to enum conversions - as per DR 128. - -2001-03-02 Nathan Sidwell - - * class.c (check_field_decls): Pointers to member do not a - non-pod struct make, as per DR 148. - -2001-03-02 Nathan Sidwell - - * call.c (joust): cp_pedwarn when using gnu extension concerning - worst conversion sequences. - -2001-03-01 Zack Weinberg - - * decl.c: Replace all uses of 'boolean' with 'bool'. - -2001-03-01 Zack Weinberg - - * lang-specs.h: Add zero initializer for cpp_spec field to - all array elements that need one. Don't put an #ifdef inside - the initializer list; set a default for CPLUSPLUS_CPP_SPEC and - use it. - -2001-03-01 Nathan Sidwell - - Implement using decls inside template functions. - * decl2.c (validate_nonmember_using_decl): Don't special case - fake_std_node in the global namespace. Don't reject early when - processing a template. - (do_local_using_decl): Add to statement tree. Don't do further - processing when building a template. - * pt.c (tsubst_expr, DECL_STMT case): Deal with USING_DECLs. - -2001-03-01 Nathan Sidwell - - * decl2.c (do_nonmember_using_decl): Don't complain if we find - same function. Do complain about ambiguating extern "C" - declarations. - -2001-02-28 Nathan Sidwell - - Remove floating point and complex type template constant parms. - * pt.c (convert_nontype_argument): Remove REAL_TYPE and - COMPLEX_TYPE extensions. - (invalid_nontype_parm_type_p): Likewise. - -2001-02-27 Jeffrey Oldham - - * except.c (call_eh_info): Revert "match_function"'s type. - -2001-02-27 Nathan Sidwell - - Fix ctor vtable vcall offsets. - * class.c (struct vtbl_init_data_s): Add rtti_binfo member. - (build_rtt_vtbl_entries): Lose RTTI_BINFO parameter. - (get_matching_base): Remove. - (get_original_base): New function. - (build_vtbl_initializer): Initialize vid.rtti_binfo. - Use a virtual thunk for a ctor vtable with an index - (add_vcall_offset_vtbl_entries_1): Check if binfo has lost a - primary base within a constructor vtable. Only set - BV_VCALL_INDEX when not a constructor vtable. Adjust vcall offset - when primary base has been lost. - * cp-tree.h (BINFO_VIRTUALS): Remove ambiguity from comment. - -2001-02-26 Jeffrey Oldham - - * call.c (joust): Ensure more_specialized()'s argument length - parameter has correct value for constructors. - -2001-02-26 Nathan Sidwell - - * except.c (call_eh_info): Cleanup generation of cp_eh_info struct. - - * decl.c (mark_inlined_fns): Prototype. - -2001-02-22 Mark Mitchell - - * spew.c (yylex): Correct handling of friends. - -2001-02-22 Mark Mitchell - - * mangle.c (write_encoding): Pass write_function_type the - FUNCTION_DECL for the function being encoded. - (write_function_type): Pass it along to write_bare_function_type. - (write_bare_function_type): Pass it along to write_method_parms. - (write_method_parms): Don't mangle the compiler-generated - parameters to a constructor or destructor. - -2001-02-22 Andreas Jaeger - - * optimize.c: Include toplev.h for - note_deferral_of_defined_inline_function prototype. - -2001-02-22 Jakub Jelinek - - * cp-tree.h (struct lang_decl_inlined_fns): New. - (struct lang_decls): Add inlined_fns. - (DECL_INLINED_FNS): New macro. - * optimize.c (struct inline_data): Add inlined_fns. - (declare_return_variable): Use VARRAY_ACTIVE_SIZE macro. - (inlinable_function_p): Likewise, fix typo in comment, - function is not inlinable if it already inlined function currently - being optimized. - (expand_call_inline): Add fn to inlined_fns if necessary. - (optimize_function): Initialize inlined_fns. - Save inlined_fns into DECL_INLINED_FNS after expanding inlines. - * decl.c (mark_inlined_fns): New function. - (lang_mark_tree): Call it. - -2001-02-21 Jason Merrill - - * cp-tree.h (struct lang_decl_flags): Remove uninlinable flag. - (DECL_UNINLINABLE): Move to middle-end. - - * class.c (clone_function_decl): Set DECL_ABSTRACT on original fn. - * decl.c (duplicate_decls): Preserve DECL_ABSTRACT. - * class.c (build_clone): Set DECL_ABSTRACT_ORIGIN for the clone. - * optimize.c (maybe_clone_body): Set DECL_ABSTRACT_ORIGIN for the - parms and outer BLOCK. note_deferral_of_defined_inline_function. - - * method.c (implicitly_declare_fn): Don't set DECL_ARTIFICIAL on - second parm of op=. - -2001-02-19 Mark Mitchell - - * decl2.c (set_decl_namespace): Allow explicit instantiations in - any namespace. - -2001-02-18 Kriang Lerdsuwanakij - - * optimize.c (expand_call_inline): Don't walk subtrees of type - nodes. - -2001-02-18 Mark Mitchell - - * class.c (add_vcall_offset_vtbl_entries_1): Only add one entry - for a destructor. - -2001-02-18 Jason Merrill - - Do put the VTT parameter in DECL_ARGUMENTS. - * cp-tree.h (struct cp_language_function): Add x_vtt_parm. - (current_vtt_parm): New macro. - (struct lang_decl_flags): Add has_vtt_parm_p, remove vtt_parm. - (DECL_HAS_VTT_PARM_P): New macro. - (DECL_VTT_PARM): Remove. - (FUNCTION_FIRST_USER_PARMTYPE, FUNCTION_FIRST_USER_PARM): New macros. - * decl.c (duplicate_decls): Only copy the operator code if - appropriate. - (start_function): Set current_vtt_parm. - (lang_mark_tree): Don't mark vtt_parm. - * decl2.c (maybe_retrofit_in_chrg): Do add the VTT parm to - DECL_ARGUMENTS. Set DECL_HAS_VTT_PARM_P. - * class.c (build_clone): Maybe remove the VTT parm. - * optimize.c (maybe_clone_body): Set up the VTT parm. - * pt.c (copy_default_args_to_explicit_spec): Preserve the VTT parm. - * call.c (build_over_call): Just allow the VTT arg. - * method.c (make_thunk): Don't set DECL_VTT_PARM. - (do_build_copy_constructor): Use FUNCTION_FIRST_USER_PARM. - (synthesize_method): Use FUNCTION_FIRST_USER_PARMTYPE. - * decl.c (grokdeclarator, copy_args_p, grok_ctor_properties): Likewise. - * error.c (dump_function_decl): Likewise. - * call.c (build_user_type_conversion_1, convert_like_real): Abort - if we try to call a constructor with in-charge or VTT parms. - * method.c (skip_artificial_parms_for): New fn. - * call.c (add_function_candidate, build_over_call): Call it. - * call.c (build_new_method_call): Use current_vtt_parm. - * init.c (expand_virtual_init): Likewise. - * class.c (same_signature_p): No longer static. - * cp-tree.h: Declare it. - * search.c (look_for_overrides_r): Use it. - -2001-02-17 Mark Mitchell - - * cp-tree.h (new_abi_rtti_p): Remove. - (name_mangling_version): Likewise. - (flag_do_squangling): Likewise. - * class.c (build_rtti_vtbl_entries): Remove old ABI support. - * decl.c (grokfndecl): Likewise. - * decl2.c (name_mangling_version): Remove. - (flag_do_squangling): Likewise. - (lang_f_options): Remove `squangle'. - (unsupported_options): Add `squangle'. - (cxx_decode_option): Issue a warning about uses of - -fname-mangling-version. - (finish_file): Remove old ABI support. - * pt.c (check_explicit_specialization): Likewise. - (tsubst_decl): Likewise. - * rtti.c (init_rtti_processing): Likewise. - (build_headof): Likewise. - (get_tinfo_decl_dynamic): Likewise. - (tinfo_from_decl): Likewise. - (build_dynamic_cast_1): Likewise. - (synthesize_tinfo_var): Likewise. - * init.c (build_new): Allow enumeration types for the array-bounds - in a direct-new-declarator. - - * semantics.c (finish_typeof): Resolve OFFSET_REFs. - - * pt.c (check_explicit_specialization): Copy TREE_PRIVATE and - TREE_PROTECTED from the template being specialized. - -2001-02-17 Jason Merrill - - * decl2.c (build_artificial_parm): Set TREE_READONLY. - - * decl.c (bad_specifiers): Allow throw specs on things with - pointer-to-function or -member-function type. - * init.c (build_default_init): Don't use a CONSTRUCTOR to initialize - a pmf. - -2001-02-17 Mark Mitchell - - * call.c (check_dtor_name): Handle template names correctly. - -2001-02-16 Jason Merrill - - * cp-tree.h (DECL_USE_VTT_PARM): Remove. - * decl2.c (maybe_retrofit_in_chrg): Don't create it. - * optimize.c (maybe_clone_body): Don't substitute it. - * call.c (build_new_method_call): Check in_chrg instead. - * init.c (expand_virtual_init): Likewise. - -2001-02-16 Gabriel Dos Reis - - * decl.c (check_tag_decl): Make sure a typedef for an anonymous - class-type introduces at least a type-name. - -2001-02-16 Jakub Jelinek - - * call.c (convert_like_real): Create a temporary for non-lvalue. - -2001-02-16 Jeffrey Oldham - - * cp-tree.h: Fix typos in comments. - -2001-02-16 Jason Merrill - - * optimize.c (remap_block): If we're compiling a clone, pass the - new block to insert_block. - -2001-02-16 Mark Mitchell - - * semantics.c (finish_asm_stmt): Robustify. - -2001-02-15 Mark Mitchell - - * pt.c (push_template_decl_real): Don't remangle the name of a - class template. - -2001-02-15 Jim Meyering - - * Make-lang.in (c++.install-common): Depend on installdirs. - (c++.install-info): Likewise. - (c++.install-man): Likewise. - -2001-02-15 Mark Mitchell - - * typeck2.c (build_m_component_ref): Robustify. - -2001-02-15 Alexandre Oliva - - * friend.c (do_friend): Don't take the nested [template] class - into account when deciding whether to warn about the friend - function not referring to a template function. - -2001-02-14 Jakub Jelinek - - * typeck.c (build_unary_op): Clarify error message. - -2001-02-08 Aldy Hernandez - - * parse.y (component_constructor_declarator): allow optional - parentheses around constructor class name. - -2001-02-14 Nathan Sidwell - - * cp-tree.h (setup_vtbl_ptr): Move prototype to semantics.c - section. - * init.c (emit_base_init): Remove incorrect comment about - virtual bases. - * method.c (make_thunk): Fix comment alignment. - -2001-02-14 Nathan Sidwell - - Kill remnants of this is variable. - * cp-tree.h (flag_this_is_variable): Remove. - * decl2.c (flag_this_is_variable): Remove. - * class.c (fixed_type_or_null): Add cdtor parm. Adjust. - (build_vbase_path): The path is non-static, even in a cdtor. - (resolves_to_fixed_type_p): Add additional return value. - * search.c (init_vbase_pointers): Adjust. - * tree.c (lvalue_p_1): Adjust. - * typeck.c (mark_addressable): Adjust. - -2001-02-14 Nathan Sidwell - - * pt.c (unify): Don't check cv quals of array types. - -2001-02-14 Nathan Sidwell - - * tree.c (cp_build_qualified_type_real): Use CP_TYPE_QUALS to - check whether we already have the type. - -2001-02-13 Mark Mitchell - - * cp-tree.h (CLASSTYPE_DESTRUCTORS): Fix typo in comment. - * call.c (build_op_delete_call): Simplify to remove duplicate - code. - * class.c (clone_function_decl): Don't build the deleting variant - of a non-virtual destructor. - * decl.c (finish_destructor_body): Don't call delete if this is a - non-virtual destructor. - * init.c (build_delete): Explicitly call `operator delete' when - deleting an object with a non-virtual destructor. - -2001-02-13 Jason Merrill - - * lang-specs.h: Add more __EXCEPTIONS. - -2001-02-12 Nathan Sidwell - - * typeck2.c (process_init_constructor): Check - TREE_HAS_CONSTRUCTOR before issuing missing init warning. - -2001-02-12 Nathan Sidwell - - * pt.c (maybe_adjust_types_for_deduction, DEDUCE_ORDER case): - Remove spurious information in comment. Allow further - adjustments of REFERENCE_TYPE args. - -2001-02-12 Nathan Sidwell - - * errfn.c (cp_deprecated): Tweak diagnostic text. - * parse.y (new_initializer): Deprecate initializer lists - extension. - -2001-02-12 Mark Mitchell - - Remove old ABI support. - -2001-02-11 Mark Mitchell - - * decl2.c (flag_vtable_thunks): Always set it to 1. - (flag_new_abi): Likewise. - * lang-specs.h: Remove conditional on ENABLE_NEW_GXX_ABI. - - * Makefile.in (g++spec.o): Fix typo. - -2001-02-09 Jason Merrill - - * lang-specs.h: Restore definition of __EXCEPTIONS. - -2001-02-08 Jason Merrill - - * search.c (shared_member_p): New function. - (lookup_field_r): Use it. - * cp-tree.h (SHARED_MEMBER_P): Remove. - - * method.c (process_overload_item): Handle template-dependent array - bounds. - * pt.c (type_unification_real): If we end up with undeduced nontype - parms, try again. - - * decl.c (lookup_name_real): Tweak warning to refer to decls, not - types. - - * typeck2.c (friendly_abort): Don't say anything if we have - earlier errors or sorries. - - * decl.c (check_tag_decl): Notice attempts to redefine bool and - wchar_t. Ignore if in_system_header. - - * decl.c (maybe_push_cleanup_level): New fn... - (start_decl_1): ...split out from here. - * cvt.c (build_up_reference): Use it. - * cp-tree.h: Declare it. - -2001-02-07 Mark Mitchell - - * lang-specs.h: Use CPLUSPLUS_CPP_SPEC for the preprocessor - spec. - -2001-02-06 Nathan Sidwell - - * pt.c (lookup_template_class): Make sure it's a primary - template or template_template_parm when called from the parser. - (instantiate_template_class): Add assertion. - -2001-02-05 Alexandre Oliva - - * method.c (build_mangled_name) [old abi]: Protect flush_repeats() - from error_mark_node. - -2001-02-05 Nathan Sidwell - - Fix specification and implementation bugs in V3 ABI - construction vtables. - * cp-tree.h (flag_dump_class_layout): New flag. - (BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P): Remove. - (BINFO_LOST_PRIMARY_P): New flag. - (SET_BINFO_NEW_VTABLE_MARKED): Adjust asserts. - (BINFO_PRIMARY_MARKED_P): Rename to ... - (BINFO_PRIMARY_P): ... here. - (binfo_via_virtual): New prototype. - * decl2.c (flag_dump_class_layout): New flag. - (cxx_decode_option): Set it. Adjust -fdump-translation-unit to - use `=' as a file name separator. - * init.c (dfs_initialize_vtbl_ptrs): Walk into virtual primary - bases. - (build_vtbl_address): If this is a virtual primary base, then - get the vtbl of what it is ultimately primary for. - * search.c (dfs_skip_nonprimary_vbases_unmarkedp): Adjust - for BINFO_PRIMARY_P. - (dfs_skip_nonprimary_vbases_markedp): Likewise. - (get_shared_vbase_if_not_primary): Likewise. - (dfs_get_pure_virtuals): Likewise. - (expand_upcast_fixups): Likewise. - (fixup_virtual_upcast_offsets): Likewise. - (dfs_find_vbase_instance): Likewise. - (find_vbase_instance): Likewise. - (binfo_from_vbase): Adjust comment to reflect reality. - (binfo_via_virtual): New function. - * class.c (VTT_TOP_LEVEL_P, VTT_MARKED_BINFO_P): New macros - for binfo walking during VTT construction. - (dfs_mark_primary_bases): Remove. - (force_canonical_binfo_r): New function. - (force_canonical_binfo): New function. - (mark_primary_virtual_base): New function. - (mark_primary_bases): Walk in inheritance graph order, use - mark_primary_virtual_base. - (determine_primary_base): Use some more intermediate variables. - (dfs_find_final_overrider): Don't check for overriding along a - virtual path. - (dfs_modify_vtables): Walk into primary virtual bases too. - (walk_subobject_offsets): Adjust for BINFO_PRIMARY_P. - (build_base_fields): Likewise. - (dfs_set_offset_for_unshared_vbases): Likewise. - (layout_virtual_bases): Likewise. - (end_of_class): Likewise. - (finish_struct_1): Call dump_class_hierarchy, if requested. - (dfs_get_primary_binfo): Use BINFO_TYPE for binfos. - (dump_class_hierarchy_r): Add stream parameter. Emit more information. - (dump_class_hierarchy): Add file parameter. Append to file, if - required. - (finish_vtbls): Adjust accumulate_vtbl_inits call. - Use canonical base for virtual bases. - (build_vtt): Add more comments. Adjust build_vtt_inits call. - (build_vtt_inits): Remove VIRTUAL_VTTS_P parm. - Only set BINFO_VPTR_INDEX on top level. Use VTT_TOP_LEVEL_P, - VTT_MARKED_BINFO_P for binfo walking. Use canonical vbase for - virtual VTTs. - (dfs_build_secondary_vptr_vtt_inits): Extract VTT_TOP_LEVEL_P - from DATA. We want virtual primary bases and all bases via virtual. - Only set BINFO_VPTR_INDEX for top level. Look up from a primary - virtual base when not a construction vtable. - (dfs_ctor_vtable_bases_queue_p): New DFS predicate. - (build_ctor_vtbl_group): Adjust accumulate_vtbl_inits call. - Use canonical bases when processing virtual bases. - (accumulate_vtbl_inits): We're interested in any base via a - virtual path. - (dfs_accumulate_vtbl_inits): If this is a primary virtual base - within a construction vtable, determine what is being overridden. - (build_vtbl_initializer): Add more comments - (add_vcall_offset_vtbl_entries_1): Adjust comment. - (build_rtti_vtbl_entries): Check if the base has lost its - primary. - -2001-02-05 Mark Mitchell - - * Makefile.in (g++spec.o): Adjust use of DRIVER_DEFINES. - -2001-02-04 Richard Kenner - - * decl.c (pushdecl): Call abort instead of fatal. - * except.c (decl_is_java_type): Call fatal_error instead of fatal. - * init.c (build_new_1): Likewise. - (build_java_class_ref): Call internal_error and fatal_error, not fatal. - * decl.c (build_typename_type): hash_table_init now returns void. - decl.c (init_decl_processing): Make an error non-fatal. - -2001-02-04 Mark Mitchell - - * cp-tree.h (CLASSTYPE_INTERFACE_UNKNOWN): Fix formatting. - Document. - (CLASSTYPE_INTERFACE_KNOWN): Likewise. - (SET_CLASSTYPE_INTERFACE_UNKNOWN_X): Likewise. - (SET_CLASSTYPE_INTERFACE_UNKNOWN): Likewise. - (SET_CLASSTYPE_INTERFACE_KNOWN): Likewise. - * decl.c (maybe_commonize_var): Use the new name-mangling where - appropriate. - * decl2.c (comdat_linkage): Enhance comments. Make all - compiler-generated things static, if COMDAT is not available. - (get_tinfo_decl): Do not make typeinfo objects that belong in the - library COMDAT. - (tinfo_base_init): Use the correct mangled name for typeinfo - strings, and push them into the global scope. - (typeinfo_in_lib_p): New function. - (synthesize_tinfo_var): Use it. - (create_real_tinfo_var): Likewise. - -2001-02-03 Jakub Jelinek - - * decl.c (push_class_binding): Use context_for_name_lookup instead - of CP_DECL_CONTEXT. - * search.c (context_for_name_lookup): Remove static. Check for NULL - context in the loop. - * cp-tree.h (context_for_name_lookup): Add prototype. - -2001-02-02 Jakub Jelinek - - * cp-tree.h (build_expr_ptr_wrapper, can_free): Remove. - * tree.c (build_expr_ptr_wrapper, can_free, permanent_obstack): - Remove. - * call.c (convert_class_to_reference, build_user_type_conversion_1, - add_warning): Change build_expr_ptr_wrapper to build_ptr_wrapper. - -2001-02-02 Mark Mitchell - - * Make-lang.in (g++spec.o): Add DRIVER_DEFINES to the list - of macros used when compiling g++spec.c. - * g++spec.c (lang_specific_driver): Link with the shared - libgcc by default. - -2001-01-29 Joseph S. Myers - - * decl2.c (build_expr_from_tree), lex.c (make_pointer_declarator, - make_reference_declarator, make_call_declarator), method.c - (implicitly_declare_fn), parse.y (namespace_using_decl, - notype_unqualified_id, expr_or_declarator, new_type_id, - after_type_declarator, direct_after_type_declarator, - notype_declarator, complex_notype_declarator, - complex_direct_notype_declarator, qualified_id, - notype_qualified_id, overqualified_id, direct_new_declarator, - absdcl, direct_abstract_declarator, conversion_declarator), pt.c - (tsubst), semantics.c (begin_constructor_declarator): Use build_nt - instead of build_parse_node. - -2001-01-28 Kaveh R. Ghazi - - * cp-tree.h (cp_tree_index): Delete CPTI_MINUS_ONE. - (minus_one_node): Moved to top level gcc directory. Renamed - to integer_minus_one_node. - - * init.c (init_init_processing): Don't set minus_one_node. - (build_vec_init): Use integer_minus_one_node. - - * rtti.c (get_tinfo_decl_dynamic): Likewise. - -2001-01-28 Jakub Jelinek - - * optimize.c (copy_body_r): If MODIFY_EXPR has both arguments - identical and they would be replaced with constant, remove - MODIFY_EXPR from the tree. - -2001-01-27 Kaveh R. Ghazi - - * Make-lang.in: Remove all dependencies on defaults.h. - * call.c: Don't include defaults.h. - * decl.c: Likewise. - * decl2.c: Likewise. - * except.c: Likewise. - * pt.c: Likewise. - * rtti.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - -2001-01-25 Jakub Jelinek - - * mangle.c (write_mangled_name, write_encoding): Mangle overloaded - operators even in "C" linkage. - * method.c (set_mangled_name_for_decl): Likewise. - * decl.c (grokfndecl): Call set_mangled_name_for_decl even for - overloaded operators in "C" linkage. - -2001-01-24 Nathan Sidwell - - * pt.c (tsubst_decl): Remove IN_DECL parameter. - (tsubst_arg_types): Check parameter is not void. - (tsubst): Adjust tsubst_decl call. - -2001-01-24 Nathan Sidwell - - * call.c (add_builtin_candidate): Quote std properly, from - previous change. - -2001-01-23 Kriang Lerdsuwanakij - - * pt.c (check_explicit_specialization): Clone constructors and - destructors. - -2001-01-23 Nathan Sidwell - - * decl.c (grokdeclarator): Don't presume DECL_LANG_SPECIFIC - indicates anything special about template depth. Make sure we - only count the user visible template classes. - -2001-01-23 Nathan Sidwell - - * call.c (build_conv): Typo in comment. - (add_builtin_candidate): Add more explanation. - Remove extra test for ENUMERAL_TYPE in {PRE,POST}INCREMENT_EXPR. - Allow ENUMERAL_TYPEs for relops and eqops. Add both candidates - when we have enumeral types. - (add_builtin_candidates): Add more explanation. Add ENUMERAL_TYPE - candidates for relops and eqops. - (joust): Simplify control flow. Allow a non-template user - function to hide a builtin. - -2001-01-22 Nathan Sidwell - - * cp-tree.h (unification_kind_t): Add DEDUCE_ORDER. - (more_specialized): Add deduction parameter. - * call.c (joust): Adjust more_specialized call. - * pt.c (UNIFY_ALLOW_OUTER_MORE_CV_QUAL, - UNIFY_ALLOW_OUTER_LESS_CV_QUAL): New unify flags. - (get_bindings_order): Remove. - (get_bindings_real): Add DEDUCE parameter. - (maybe_adjust_types_for_deduction): Return extra unify flags. Do - REFERENCE_TYPE jig for DEDUCE_ORDER. - (type_unification_real): Deal with DEDUCE_ORDER. Use result of - maybe_adjust_types_for_deduction. - (more_specialized): Add DEDUCE parameter. Call get_bindings_real - directly. - (try_one_overload): Use result of maybe_adjust_types_for_deduction. - (check_cv_quals_for_unify): Use new unify qualifier flags. - (unify): Clear new unify qualifier flags. - (get_bindings_real): Add DEDUCE parameter. - (get_bindings): Adjust call to get_bindings_real. - (get_bindings_overload): Likewise. - (most_specialized_instantiation): Adjust call to - more_specialized. - -2001-01-19 Jason Merrill - - * decl2.c (flag_vtable_thunks): Also depend on ENABLE_NEW_GXX_ABI. - - * decl.c (init_decl_processing): Just force -fvtable-thunks on if - -fnew-abi. - -2001-01-19 Ute Pelkmann - - * decl2.c (arg_assoc_class): Fix double iteration logic. - -2001-01-19 Jason Merrill - - * init.c (build_delete): Always call convert_force to strip cv-quals. - - * decl2.c (flag_new_abi): Depend on ENABLE_NEW_GXX_ABI. - * lang-specs.h: Default ABI depends on ENABLE_NEW_GXX_ABI. - * g++spec.c: Don't look at ENABLE_NEW_GXX_ABI. - -2001-01-19 Nathan Sidwell - - * search.c (get_vbase_1): Count only virtual bases. - -2001-01-19 Nathan Sidwell - - * class.c (duplicate_tag_error): Robustify flag clearing. - -2001-01-19 Nathan Sidwell - - * cp-tree.h (lookup_template_class): Add complain parm. - * decl.c (lookup_namespace_name): Adjust call to - lookup_template_class. - (make_typename_type): Likewise. - * semantics.c (finish_template_type): Likewise. - * pt.c (lookup_template_class): Add complain parm. Adjust. - (tsubst_aggr_type): Pass COMPLAIN down to lookup_template_class. - (tsubst): Likewise. - -2001-01-19 Nathan Sidwell - - * pt.c (copy_default_args_to_explicit_spec): Preserve - object's CV quals. Reorganize. - -2001-01-18 Nathan Sidwell - - * typeck.c (build_modify_expr): Say `initialization' for - INIT_EXPRs. - * init.c (build_default_init): Convert to enumeral type, if - needed. - -2001-01-18 Jakub Jelinek - - * parse.y (nomods_initdcl0): Properly set things up for - initdcl0_innards. - -2001-01-18 Nathan Sidwell - - * pt.c (UNIFY_ALLOW_OUTER_LEVEL): New unify flag. - (type_unification_real): Set it. - (unify): Use it. - -2001-01-18 Nathan Sidwell - - * decl.c (finish_destructor_body): Convert to vbase pointer here. - -2001-01-18 Nathan Sidwell - - * semantics.c (begin_class_definition): Check we're not inside a - template parm list. - -2001-01-18 Nathan Sidwell - - * tree.c (walk_tree, TREE_LIST): Don't walk the TREE_PURPOSE of - BASELINK_P. - -2001-01-16 Kriang Lerdsuwanakij - - * typeck.c (build_function_call_real): Call fold on the CALL_EXPR. - * call.c (build_over_call): Add comment. - -2001-01-16 Daniel Berlin - - * cvt.c (ocp_convert): Handle vector type conversion - * typeck2.c (digest_init): Handle vector type initializations - -2001-01-16 Phil Edwards - - * g++spec.c: Don't add libraries needlessly if -fsyntax-only - was given. - -2001-01-15 Nathan Sidwell - - * pt.c (check_nontype_parm): Rename to ... - (invalid_nontype_parm_type_p): ... here. - (process_template_parm): Adjust. - (convert_template_argument): Adjust. - -2001-01-15 Nathan Sidwell - - * pt.c (check_nontype_parm): New function. - (process_template_parm): Use it. - (convert_template_argument): Use it. - (convert_nontype_argument, RECORD_TYPE): Assert it's a ptr to - member. - -2001-01-14 Jeffrey Oldham - - * tree.c: Add defaults.h - (cp_valid_lang_attribute): Incorporate SUPPORTS_INIT_PRIORITY. - * Make-lang.in (cp/tree.o): Add defaults.h. - -2001-01-13 Joseph S. Myers - - * Make-lang.in (CXX_C_OBJS): Add c-format.o. - -2001-01-13 Joseph S. Myers - - * g++.1: Change to be ".so man1/gcc.1". - -2001-01-13 Joseph S. Myers - - * Make-lang.in (c++.info, c++.install-info): Build and install g++ - internals info. - (c++.uninstall, c++.maintainer-clean): Remove g++ internals info. - ($(srcdir)/cp/g++int.info): New target. - * gxxint.texi: Add info directory entry. Use @@ in email address. - * .cvsignore: Update. - -2001-01-12 Nathan Sidwell - - * typeck.c (build_c_cast): Do template processing earlier. - Always pedwarn on array casts. - -2001-01-12 Nathan Sidwell - - * friend.c (make_friend_class): Make sure a templated class is - actually a template. - -2001-01-11 Nathan Sidwell - - * decl2.c (get_guard): Set linkage from guarded decl. - -2001-01-11 Nathan Sidwell - - * call.c (convert_default_arg): Check for unprocessed - DEFAULT_ARG. - * cp-tree.h (replace_defarg): Move to spew.c. - (maybe_snarf_defarg, add_defarg_fn, do_pending_defargs): Move to - spew.c, which is where they really are. - (done_pending_defargs): Declare. - (unprocessed_defarg_fn): Declare. - * decl.c (replace_defarg): Move to spew.c - * parse.y (structsp): Call done_pending_defargs. - * spew.c (defarg_fns): Rearrange list structure. - (defarg_fnsdone): New static variable. - (defarg_depfns): New static variable. - (init_spew): Adjust. - (add_defarg_fn): Store the type in TREE_TYPE. - (do_pending_defargs): Detect and deal with ordering constraints - and circularity. - (done_pending_defargs): New function. - (unprocessed_defarg_fn): New function. - (replace_defarg): Moved from decl.c. Robustify. Don't save - if circularity detected. - -2001-01-11 Nathan Sidwell - - * pt.c (unify): Check array has a domain, before checking - whether it is variable sized. - -2001-01-11 Nathan Sidwell - - * decl.c (grokparms): Unobfuscate and get correct diagnostic for - parameters with pointers to arrays of unknown bound. - -2001-01-11 Nathan Sidwell - - * parse.y (template_parm_header, template_spec_header): New - reductions. Split out from ... - (template_header): ... here. Use them. - (template_template_parm): Use template_parm_header. - * semantics.c (finish_template_template_parm): Add assert. - -2001-01-10 Mark Mitchell - - * mangle.c (write_builtin_type): Fix thinko. - - * pt.c (copy_default_args_to_explicit_spec_1): New function. - (copy_default_args_to_explicit_spec): Likewise. - (check_explicit_specialization): Use it. - - * class.c (finish_struct_1): Remove last argument in call to - make_decl_rtl; use make_function_rtl instead of make_decl_rtl. - * decl.c (builtin_function): Likewise. - (build_cp_library_fn): Likewise. - (check_initializer): Likewise. - (make_rtl_for_nonlocal_decl): Likewise. - (cp_finish_decl): Likewise. - (start_function): Likewise. - * decl2.c (finish_anon_union): Likewise. - * friend.c (do_friend): Likewise. - * init.c (build_java_class_ref): Likewise. - * method.c (make_thunk): Likewise. - * pt.c (tsubst_friend_function): Likewise. - * semantics.c (expand_body): Likewise. - -2001-01-10 Mark Mitchell - - * cp-tree.h (DECL_CLONED_FUNCTION_P): Avoid wild reads by not - looking at DECL_CLONED_FUNCTION for non-functions. - -2001-01-10 Nathan Sidwell - - * error.c (dump_template_parameter): Use parm to determine how - to print default value. - -2001-01-10 Nathan Sidwell - - * class.c (duplicate_tag_error): Clear more flags. - -2001-01-10 Nathan Sidwell - - * call.c (build_new_method_call): Use binfo_for_vbase. - -2001-01-10 Joseph S. Myers - - * cp-tree.h (flag_cond_mismatch): Don't declare. - * decl2.c (flag_cond_mismatch): Don't define. - (lang_f_options): Remove cond-mismatch. - (unsupported_options): Add cond-mismatch. - -2001-01-09 Nathan Sidwell - - * class.c (handle_using_decl): Reject using of constructor name - of sourcing class. Allow injecting of a method with same name as - nested class. Fixup error messages. - -2001-01-09 Joseph S. Myers - - * decl2.c (lang_decode_option): Handle -Wformat=2. - -2001-01-08 Nathan Sidwell - - * cp-tree.h (lang_decl_flags): Rename defined_in_class to - initialized_in_class. - (DECL_DEFINED_IN_CLASS_P): Rename to ... - (DECL_INITIALIZED_IN_CLASS_P): ... here, to reflect true meaning. - * decl.c (duplicate_decls): Preseve DECL_INITIALIZED_IN_CLASS_P. - (cp_finish_decl): Adjust for DECL_INITIALIZED_IN_CLASS_P. - * pt.c (check_default_tmpl_args): Adjust for - DECL_INITIALIZED_IN_CLASS_P. - (instantiate_class_template): Likewise. - (instantiate_decl): Check DECL_INITIALIZED_IN_CLASS_P. - - * class.c (finish_struct): Constify saved_filename. - -2001-01-08 Nathan Sidwell - - * class.c (duplicate_tag_error): Adjust diagnostic. - (finish_struct): Locally set location to start of struct. - * decl.c (fixup_anonymous_aggr): Use cp_error_at. - -2001-01-08 Nathan Sidwell - - * decl.c (struct binding_level): Adjust class_shadowed comments - to reflect reality. - (push_class_level_binding): Adjust comments to reflect reality. - Set IDENTIFIER_CLASS_VALUE when replacing an existing binding. - Don't set TREE_VALUE on the class_shadowed list. - -2001-01-07 Alexandre Petit-Bianco - - * decl2.c (acceptable_java_type): Allow references too. - * init.c (build_java_class_ref): When using the new ABI, search - `class$' and have it mangled with `mangle_decl.' - * mangle.c (write_java_integer_type_codes): New function. - (write_builtin_type): Detect and mangle Java integer and real - types. - -2001-01-07 Mark Mitchell - - * decl2.c (grokfield): Don't accept `asm' specifiers for - non-static data members. - -2001-01-07 Kaveh R. Ghazi - - * expr.c (cplus_expand_expr): Don't reset `target'. - -2001-01-07 Neil Booth - - * cp/decl2.c (cxx_post_options): Call cpp_post_options. - -2001-01-05 Nathan Sidwell - - * parse.y (template_datadef): Check for error_mark_node. - -2001-01-05 Nathan Sidwell - - * cp-tree.def (DEFAULT_ARG): Make `x' class. - -2001-01-04 Joseph S. Myers - - * decl.c (SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE): Don't define. - (record_builtin_type): Make non-static. - (flag_short_double): Don't declare. - (init_decl_processing): Remove the creation of many tree nodes now - in c_common_nodes_and_builtins. - (build_void_list_node): New function. - * decl2.c (flag_short_double, flag_short_wchar): Don't define. - * cp-tree.h (flag_short_wchar): Don't declare. - -2001-01-04 Mark Mitchell - - * call.c (build_conv): Don't use build1 for USER_CONV. - * pt.c (tsubst_copy): Or for PREINCREMENT_EXPR and similar nodes. - -2001-01-03 Joseph S. Myers - - * lex.c (lang_init): Call c_common_lang_init. - -2001-01-03 Nathan Sidwell - - * search.c (lookup_fnfields_here): Remove. - (look_for_overrides_r): Use lookup_fnfields_1. - Ignore functions from using declarations. - -2001-01-03 Nathan Sidwell - - Implement exceptions specifiers for implicit member functions. - * cp-tree.h (merge_exceptions_specifiers): Declare new function. - * method.c (synthesize_exception_spec): New function. - (locate_dtor, locate_ctor, locate_copy): New functions. - (implicitly_declare_fn): Generate the exception spec too. - * search.c (check_final_overrider): Check artificial functions - too. - * typeck2.c (merge_exception_specifiers): New function. - -2001-01-03 Jason Merrill - - * init.c (build_default_init): New fn. - (perform_member_init): Split out from here. - (build_new_1): Use it. Simplify initialization logic. - (build_vec_init): Take an array, rather than a pointer and maxindex. - Speed up simple initializations. Don't clean up if we're assigning. - * cp-tree.h: Adjust. - * decl2.c (do_static_initialization): Remove TREE_VEC case. - * parse.y (new_initializer): Return void_zero_node for (). - * typeck.c (build_modify_expr): Handle getting a CONSTRUCTOR. - * typeck2.c (digest_init): Only complain about user-written - CONSTRUCTORs. - -2000-12-22 Mike Stump - - * decl2.c: (max_tinst_depth): Increase to 50. - -2001-01-02 Mark Mitchell - - * class.c (invalidate_class_lookup_cache): Zero the - previous_class_values. - * cp-tree.h (TMPL_PARMS_DEPTH): Use TREE_INT_CST_LOW, not - TREE_INT_CST_HIGH. - (CLASSTYPE_TEMPLATE_LEVEL): Likewise. - * decl.c (free_bindings): New variable. - (push_binding): Don't create a new binding if we have one on the - free list. - (pop_binding): Put old bindings on the free list. - (init_decl_processing): Use size_int, not build_int_2. - Register free_bindings as a GC root. - (cp_make_fname_decl): Use size_int, not build_int_2. - (push_inline_template_parms_recursive): Likewise. - (end_template_parm_list): Likewise. - (for_each_template_parm): Do not use walk_tree_without_duplicates. - (tsubst_template_parms): Use size_int, not build_int_2. - (tsubst): Likewise. - * rtti.c (get_vmi_pseudo_type_info): Likewise. - -2001-01-02 Richard Henderson - - * parse.y (asm): Set ASM_INPUT_P. - -2001-01-02 Jason Merrill - - * tree.c (cp_valid_lang_attribute): Don't set CLASSTYPE_COM_INTERFACE - for v3 ABI. - - * typeck.c (cp_truthvalue_conversion): New fn. - * cvt.c (ocp_convert): Use it. - - * cp-tree.h: Lose c-common.c decls. - - * typeck.c (build_unary_op): Restore old &a.f diagnostic code. - * cvt.c (convert_to_void): Use type_unknown_p. - - * typeck.c (strip_all_pointer_quals): Also strip quals from - pointer-to-member types. - - * Make-lang.in (cp/TAGS): Use --no-globals. Ignore parse.c, and treat - parse.y as C. - - * call.c (build_new_method_call): Do evaluate the object parameter - when accessing a static member. - * typeck.c (build_component_ref): Likewise. - -2001-01-02 Andreas Jaeger - - * decl.c (cp_missing_noreturn_ok_p): New. - (init_decl_processing): Set lang_missing_noreturn_ok_p. - -2000-12-29 Jakub Jelinek - - * decl.c (init_decl_processing): Fix sign of wchar_type_node. - -2000-12-29 Mark Mitchell - - * class.c (pushclass): Remove #if 0'd code. - * cp-tree.h (overload_template_name): Remove. - * decl.c (store_bindings): Simplify. - (pop_from_top_level): Likewise. - * pt.c (overload_template_name): Remove. - (instantiate_decl): Don't call push_to_top_level if it's not - needed. - -2000-12-28 Mark Mitchell - - * pt.c (register_local_specialization): Don't return a value. - (lookup_template_class): Use move-to-front heuristic when looking - up template instantiations. - (instantiate_decl): Only push_to_top_level when we're actually - going to instantiate the template. - -2000-12-29 Hans-Peter Nilsson - - * search.c (binfo_for_vtable): Return least derived class, not - most. Handle secondary vtables. - -2000-12-22 Jason Merrill - - * pt.c (more_specialized): Don't optimize len==0. - (fn_type_unification): If we're adding the return type, increase len. - - * typeck.c (build_binary_op): Fix pmf comparison logic. - - * call.c (joust): Use DECL_NONSTATIC_MEMBER_FUNCTION_P, not - DECL_STATIC_FUNCTION_P. - - * semantics.c (genrtl_finish_function): Don't try to jump to - return_label unless it exists. - - In partial ordering for a call, ignore parms for which we don't have - a real argument. - * call.c (joust): Pass len to more_specialized. - (add_template_candidate_real): Strip 'this', pass len. - * pt.c (more_specialized): Pass len down. Lose explicit_args parm. - (get_bindings_order): New fn. Pass len down. - (get_bindings_real): Strip 'this', pass len. - (fn_type_unification): Likewise. - (type_unification_real): Succeed after checking 'len' args. - (most_specialized_instantiation): Lose explicit_args parm. - * class.c (resolve_address_of_overloaded_function): Strip 'this', - pass len. - -2000-12-21 Jason Merrill - - * pt.c (tsubst_decl): A FUNCTION_DECL has DECL_RESULT, not - DECL_TEMPLATE_RESULT. - - * search.c (lookup_field_r): Call lookup_fnfields_1, not - lookup_fnfields_here. - - * parse.y (typename_sub2): Return the TYPE_DECL, not the type. - - * call.c (build_object_call): Also allow conversions that return - reference to pointer to function. - (add_conv_candidate): Handle totype being ref to ptr to fn. - (build_field_call): Also allow members of type reference to function. - Lose support for calling pointer to METHOD_TYPE fields. - - * error.c (dump_expr): Handle *_CAST_EXPR. - - * typeck2.c (build_scoped_ref): Always convert to the naming class. - - * tree.c (break_out_cleanups): Lose. - * cp-tree.h: Remove prototype. - * typeck.c (build_component_ref): Don't break_out_cleanups. - (build_compound_expr): Likewise. - * semantics.c (finish_expr_stmt): Likewise. - -2000-12-20 Richard Henderson - - * cp-tree.h: Update declarations. - * decl.c (finish_case_label): Return the new stmt node. - * semantics.c (finish_goto_stmt): Likewise. - (finish_expr_stmt, finish_return_stmt): Likewise. - (finish_break_stmt, finish_continue_stmt): Likewise. - (finish_asm_stmt): Likewise. - * parse.y (already_scoped_stmt): Set STMT_LINENO. - (compstmt, implicitly_scoped_stmt, stmt): Likewise. - (simple_if, simple_stmt): Return the new stmt node. - (save_lineno): New. - -2000-12-18 Joseph S. Myers - - * cp-tree.h: Don't declare warn_long_long. - -2000-12-15 Kriang Lerdsuwanakij - - * tree.c (no_linkage_helper): Use CLASS_TYPE_P instead of - IS_AGGR_TYPE. - -2000-12-15 Kriang Lerdsuwanakij - - * pt.c (unify): Handle when both ARG and PARM are - BOUND_TEMPLATE_TEMPLATE_PARM. - -2000-12-15 Kriang Lerdsuwanakij - - * pt.c (reduce_template_parm_level): Set DECL_ARTIFICIAL and - DECL_TEMPLATE_PARM_P. - -2000-12-15 Jason Merrill - - * init.c (build_new_1): Reorganize. Now with 100% fewer SAVE_EXPRs! - - * init.c (build_new_1): Don't strip quals from type. - - * decl.c (pushdecl): Don't check for linkage on a non-decl. - - * call.c (build_op_delete_call): See through ARRAY_TYPEs. - - * call.c (build_new_function_call): Lose space before paren in - error message. - (build_new_method_call): Likewise. - - * typeck2.c (build_m_component_ref): Propagate quals from datum. - -2000-12-14 Kriang Lerdsuwanakij - - * pt.c (check_explicit_specialization): Propagate default - function arguments to explicit specializations. - -2000-12-13 DJ Delorie - - * typeck.c (build_binary_op): Do signed/unsigned warnings for >? - and - - * error.c (dump_function_name): Don't let the user see __comp_ctor. - - Clean up copy-initialization in overloading code. - * call.c (build_user_type_conversion_1): Die if we are asked to - convert to the same or a base type. - (implicit_conversion): Avoid doing so. Lose reference binding code. - (convert_like_real): Treat BASE_CONV and RVALUE_CONV as implicit - direct-initialization. Also do direct-init part of copy-init. - (build_user_type_conversion): Don't provide context to convert_like. - * cvt.c (ocp_convert): build_user_type_conversion will now provide - the constructor call for copy-init. - - * pt.c (tsubst_decl): Call clone_function_decl here if this is an - instantiation of a member template. - (do_decl_instantiation): Not here. - -2000-12-07 Nathan Sidwell - - * class.c (check_field_decls): Don't special case anonymous - fields in error messages. - (note_name_declared_in_class): Use %D on diagnostic. - - * tree.c (pod_type_p): Use strip_array_types. - (cp_valid_lang_attribute): Likewise. - * typeck.c (cp_type_quals): Strip arrays separately, to avoid - multiple evaluations. - (cp_has_mutable_p): Use strip_array_types. - -2000-12-07 Nathan Sidwell - - * cp-tree.h (sufficient_parms_p): Declare new function. - * call.c (sufficient_parms_p): New function, broken out of ... - (add_function_candidate): ... here. Use it. - (add_conv_candidate): Use it. - * decl.c (grok_ctor_properties): Use it. - -2000-12-07 Jakub Jelinek - - * optimize.c (copy_body_r): Set STMT_IS_FULL_EXPR_P on EXPR_STMT. - -2000-12-07 Joseph S. Myers - - * decl2.c (lang_decode_option): Handle -Wformat-security. - -2000-12-06 Kriang Lerdsuwanakij - - * pt.c (verify_class_unification): New function. - (get_class_bindings): Use it. - (try_class_unification): Tidy. - (unify): Handle when argument of a template-id is not - template parameter dependent. - (template_args_equal): Handle when TREE_CODE's do not match. - -2000-12-06 Alexandre Oliva - - * lang-specs.h (c++): When invoking the stand-alone preprocessor - for -save-temps, pass all relevant -Defines to it, and then don't - pass them to cc1plus. - -2000-12-05 Will Cohen - - * decl.c (finish_case_label): Cleared - more_cleanups_ok in surrounding function scopes. - (define_label): Likewise. - -2000-12-05 Nathan Sidwell - - * cp-tree.h (IDENTIFIER_VIRTUAL_P): Document. - (get_matching_virtual): Remove. - (look_for_overrides): Declare new function. - * decl.c (grokfndecl): Don't set IDENTIFIER_VIRTUAL_P or - DECL_VINDEX here. - * class.c (check_for_override): Move base class iteration code - to look_for_overrides. - * search.c (next_baselink): Remove. - (get_virtuals_named_this): Remove. - (get_virtual_destructor): Remove. - (tree_has_any_destructors_p): Remove. - (struct gvnt_info): Remove. - (check_final_overrider): Remove `virtual' from error messages. - (get_matching_virtuals): Remove. Move functionality to ... - (look_for_overrides): ... here, and ... - (look_for_overrides_r): ... here. Set DECL_VIRTUAL_P, if found - to be overriding. - -2000-12-05 Nathan Sidwell - - * typeck.c (get_delta_difference): If via a virtual base, - return zero. - * cvt.c (cp_convert_to_pointer): If via a virtual base, do no - adjustment. - -2000-12-04 Richard Henderson - - * error.c (dump_tree): Use output_add_string not OB_PUTS. - -2000-12-04 Jason Merrill - - * mangle.c (write_type): Mangle VECTOR_TYPE with "U8__vector". - (write_builtin_type): Pass intSI_type_node and the like through - type_for_mode. - * method.c (process_overload_item): Mangle VECTOR_TYPEs with 'o'. - Pass intSI_type_node and the like through type_for_mode. - * decl2.c (arg_assoc_type): Handle VECTOR_TYPE like COMPLEX_TYPE. - * pt.c (tsubst, unify): Likewise. - * tree.c (walk_tree): Likewise. - * error.c (dump_type): Likewise. - (dump_type_prefix, dump_type_suffix): Don't bother with VECTOR_TYPE. - - * Make-lang.in: Tweak top comment for emacs. - (cp/TAGS): Restore. - - * except.c (expand_throw): Use push_throw_library_fn for _Jv_Throw. - - * class.c (clone_function_decl): Robustify. - -2000-12-04 Michael Matz - - * decl.c (store_bindings): Only search in the non modified - old_bindings for duplicates. - -2000-12-04 Nathan Sidwell - - * error.c (dump_function_decl): Use DECL_VIRTUAL_P, not - TYPE_POLYMORPHIC_P. - - * typeck.c (build_static_cast): Remove unused variable. - -2000-12-01 Kriang Lerdsuwanakij - - * pt.c: Fix typo in comment. - -2000-12-01 Joseph S. Myers - - * decl2.c (warn_format): Remove definition. - (lang_decode_option): Handle -Wformat-nonliteral, - -Wno-format-extra-args and -Wno-format-y2k. Use set_Wformat. - -2000-12-01 Joseph S. Myers - - * decl.c (WINT_TYPE, INTMAX_TYPE, UINTMAX_TYPE): Don't define. - (init_decl_processing): Don't create string_type_node, - const_string_type_node, wint_type_node, intmax_type_node, - uintmax_type_node, default_function_type, ptrdiff_type_node and - unsigned_ptrdiff_type_node. Adjust position of call to - c_common_nodes_and_builtins. - (identifier_global_value): New function. - -2000-12-01 Nathan Sidwell - - * call.c (standard_conversion): Reject pointer to member - conversions from ambiguous, inaccessible or virtual bases. - * typeck.c (build_static_cast): Don't check pointers to members - specially. - -2000-11-30 Nathan Sidwell - - * method.c (do_build_copy_constructor): Preserve cv - qualifications when accessing source object members. - (do_build_assign_ref): Likewise. Remove separate diagnostics for - unnamed fields. - -2000-11-30 Nathan Sidwell - - * method.c (do_build_assign_ref): Construct appropriately - CV-qualified base reference. Don't allow const casts in base - conversion. - -2000-11-30 Nathan Sidwell - - * call.c (build_over_call): Use VOID_TYPE_P. Don't die on - incomplete return type. - -2000-11-28 Nathan Sidwell - - * parse.y (base_class.1): Produce a _TYPE not a _DECL. - * semantics.c (finish_base_specifier): Accept a _TYPE not a - _DECL. - -2000-11-28 Nathan Sidwell - - * spew.c (yyerror): Cope if yylval.ttype is NULL. - -2000-11-28 Nathan Sidwell - - * decl.c (grokdeclarator): Diagnose undefined template contexts. - -2000-11-28 Nathan Sidwell - - * decl.c (grokdeclarator): Do type access control on friend - class. - -2000-11-27 Nathan Sidwell - - * decl.c (grokfndecl): Undo COMPONENT_REF damage caused by - bison parser ickiness. - * pt.c (tsubst_friend_function): Enter namespace scope when - tsubsting the function name. - * cp-tree.h (DECL_TI_TEMPLATE): Update comment to reflect reality. - -2000-11-27 Nathan Sidwell - - * cp-tree.h (binfo_from_vbase): Return the virtual base's binfo. - * cvt.c (cp_convert_to_pointer): Add force parameter. - Allow conversions via virtual base if forced. - (convert_to_pointer_force): Adjust call to cp_convert_to_pointer. - (ocp_convert): Likewise. - * search.c (binfo_from_vbase): Return the virtual base's binfo. - * typeck.c (get_delta_difference): Adjust handling of virtual - bases. - -2000-11-26 Mark Mitchell - - * tree.c (struct list_hash): Remove. - (list_hash_table): Make it be an htab. - (struct list_proxy): New type. - (list_hash_eq): New function. - (list_hash_pieces): Renamed from ... - (list_hash): ... this. - (list_hash_lookup): Remove. - (list_hash_add): Remove. - (hash_tree_cons): Use the generic hashtable. - (mark_list_hash): Remove. - (init_tree): Create the hashtable. - -2000-11-25 Joseph S. Myers - - * method.c (build_mangled_C9x_name): Rename to - build_mangled_C99_name. Change C9X references in comments to - refer to C99. - -2000-11-24 Nathan Sidwell - - * parse.y (unary_expr): Move VA_ARG from here ... - (primary): ... to here. - -2000-11-24 Nathan Sidwell - - * semantics.c (finish_id_expr): If type is error_mark, return - error_mark. - -2000-11-23 Nathan Sidwell - - * pt.c (lookup_template_class): Simplify loop exit constructs. - Cope when there is no partial instantiation of a template - template member. - -2000-11-23 J"orn Rennecke - - * Make-lang.in (g++spec.o, cxxmain.o): Depend on $(CONFIG_H). - -2000-11-22 Mark Mitchell - - * mangle.c (mangle_conv_op_name_for_type): Don't use `__op' - prefix. - - * pt.c (do_decl_instantiate): Explicitly clone constructors and - destructors that haven't already been cloned. - -2000-11-20 Richard Henderson - - * parse.y (yyparse_1): Rename the parser entry point. - -2000-11-20 Alex Samuel - - * mangle.c (write_name): Use for names directly in - function scope. - (write_unscoped_name): Accept names directly in function scope. - -2000-11-20 Nathan Sidwell - - * lex.c (rid_to_yy, RID_EXPORT): Make unique keyword. - * parse.y (extdef): Add EXPORT reduction. - * spew.c (yylex): Don't skip export here. - -2000-11-19 Mark Mitchell - - * decl.c (init_decl_processing): Correct name of pure virtual - function under the new ABI. - * rtti.c (throw_bad_cast): Likewise, for bad cast function. - (throw_bad_typeid): Likewise for bad typeid function. - -2000-11-18 Mark Mitchell - - * decl.c (grokparms): Don't even function types of `void' type, - either. - * mangle.c (write_type): Don't crash when confronted with the - error_mark_node. - - * decl.c (grokparms): Don't create parameters of `void' type. - -2000-11-17 Zack Weinberg - - * lex.c (mark_impl_file_chain): Delete. - (init_parse): Remove call to ggc_add_string_root. No need to - ggc_strdup a string constant. Do not add impl_file_chain to GC - roots. - (handle_pragma_implementation): No need to ggc_strdup main_filename. - -2000-11-17 Nathan Sidwell - - * pt.c (tsubst_expr, DECL_STMT): Instantiate decl's type. - -2000-11-17 Nathan Sidwell - - * cp-tree.h (PARMLIST_ELLIPSIS_P): New macro. - * decl.c (grokdeclarator): Don't reject void parms here. - (require_complete_types_for_parms): Simplify, use - complete_type_or_else. - (grokparms): Remove bitrot. Remove funcdef parm. - Deal with ellipsis parm lists here. - * semantics.c (finish_parmlist): Don't append void_list_node - here. Set PARMLIST_ELLIPSIS_P. - -2000-11-17 Nathan Sidwell - - * typeck2.c (incomplete_type_error): Reorganize to avoid - excessive diagnostics. - -2000-11-16 Zack Weinberg - - * lex.c (struct impl_files, internal_filename): Constify a char *. - -2000-11-16 Mark Mitchell - - * mangle.c (write_special_name_constructor): Don't generate - assembler junk when confronted with an old-style constructor. - (write_special_name_destructor): Likewise. - (mangle_decl_string): Do it here instead. - -2000-11-16 Nathan Sidwell - - * call.c (op_error): Make error messages clearer. - -2000-11-15 Mark Mitchell - - * decl.c (wrapup_globals_for_namespace): Don't mark things - TREE_ASM_WRITTEN when they're not. - -2000-11-15 Jason Merrill - - * typeck2.c (friendly_abort): Uncount the error before handing - off to fancy_abort. - -2000-11-15 Nathan Sidwell - - * typeck.c (lookup_anon_field): Cope with qv qualifiers. - -2000-11-14 Mark Mitchell - - * class.c (build_vtbl_initializer): Fix typo in comment. - * typeck.c (expr_sizeof): Don't crash on errors. - -2000-11-14 Jim Wilson - - * lang-specs.h: Add %2 after %(cc1_options). - -2000-11-14 Richard Henderson - - * typeck.c (c_sizeof): Be strict about casting result value - back to c_size_type_node. - (expr_sizeof, c_sizeof_nowarn, c_alignof): Likewise. - -2000-11-13 Joseph S. Myers - - * typeck.c (build_unary_op): Use boolean_increment from - c-common.c, moving the relevant code there. - -2000-11-11 Jason Merrill - - * typeck.c (mark_addressable): Don't call put_var_into_stack. - - * decl.c (maybe_commonize_var): Set DECL_UNINLINABLE for statics - in inlines. - -2000-11-10 Kaveh R. Ghazi - - * decl.c (grokdeclarator, save_function_data): Use memcpy, not bcopy. - * lex.c (copy_lang_decl): Likewise. - -2000-11-09 Mark Mitchell - - * dump.c (cp_dump_tree): Don't dump function bodies here. - - * Make-lang.in (CXX_C_OBJS): Add c-dump.o. - (dump.o): Update dependency list. - * cp-tree.h (DECL_MAYBE_TEMPLATE): Remove. - (flag_dump_translation_unit): Likewise. - (CP_TYPE_QUALS): Adjust definition. - (DECL_C_BIT_FIELD): Remove. - (SET_DECL_C_BIT_FIELD): Likewise. - (CLEAR_DECL_C_BIT_FIELD): Likewise. - (add_maybe_template): Likewise. - (strip_array_types): Likewise. - (dump_node_to_file): Likewise. - (cp_dump_tree): New function. - * decl.c (init_decl_processing): Set lang_dump_tree. - * decl2.c (flag_dump_translation_unit): Remove. - * dump.c: Move most of it to ../c-dump.c. - (cp_dump_tree): New function. - * pt.c (add_maybe_template): Remove. - * typeck.c (strip_array_types): Likewise. - -2000-11-07 Eric Christopher - - * decl.c (init_decl_processing): Change definition of - __wchar_t to wchar_t. Remove artificial declaration of - wchar_t. - * lex.c: Change instances of __wchar_t to wchar_t. - -2000-11-09 Nathan Sidwell - - * lex.c (do_identifier): Don't lookup_name for operators. - * parse.y (operator): Save looking_for_typename. - (unoperator): Restore it. - * spew.c (frob_opname): Use nth_token for lookahead. - -2000-11-08 Nathan Sidwell - - * decl.c (grok_op_properties): Always use coerce_new_type and - coerce_delete_type. - * decl2.c (coerce_new_type): Use c_size_type_node. Preserve - exception specification. Tidy up. - (coerce_delete_type): Preserve exception specification. Tidy up. - -2000-11-07 Joseph S. Myers - - * class.c (duplicate_tag_error, build_vtbl_initializer), decl.c - (push_binding_level), error.c (cp_tree_printer), pt.c - (process_partial_specialization, tsubst_template_arg_vector), - search.c (lookup_member): Use memset () instead of bzero (). - -2000-11-07 Nathan Sidwell - - * decl.c (build_ptrmemfunc_type): Allow error_mark_node. - -2000-11-05 Joseph S. Myers - - * Make-lang.in (c++.distdir): Remove. - -2000-11-04 Mark Mitchell - - * decl2.c (do_nonmember_using_decl): Allow `extern "C"' - declarations from different namespaces to be combined. - -2000-11-03 Zack Weinberg - - * decl.c: Include tm_p.h. - -2000-11-03 Joseph S. Myers - - * tree.c (cp_tree_equal): Use memcmp () instead of bcmp (). - -2000-11-02 Joseph S. Myers - - * dump.c (dequeue_and_dump), lex.c (interface_strcmp), method.c - (build_overload_value), repo.c (open_repo_file), xref.c - (open_xref_file): Use strchr () and strrchr () instead of index () - and rindex (). - -2000-11-01 Bernd Schmidt - - * call.c (build_over_call): Call fold on the CALL_EXPR. - -2000-11-01 Gabriel Dos Reis - - * error.c (dump_template_decl): Separate template hearders with - space not comma. - -2000-10-31 Gabriel Dos Reis - - * error.c: Move TFF_ macros into cp-tree.h. Throughout, replace - TS_* flags with corresponding TFF_*. Adjust prototypes of - functions (which used to take a tree_string_flags) to take an int. - - * cp-tree.h (enum tree_string_flags): Remove - (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, - TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPEDEF, TFF_DECL_SPECIFIERS, - TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, - TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, - TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, - TFF_TEMPLATE_NAME, TFF_EXPR_IN_PARENS, TFF_SCOPE): New macros. - (type_as_string, decl_as_string, expr_as_string, - context_as_string): Adjust prototype. - - * class.c (dump_class_hierarchy_r): Use TFF_PLAIN_IDENTIFIER - instead of TS_PLAIN. - - * pt.c (mangle_class_name_for_template): Use TFF_CHASE_TYPEDEF - instead of TF_CHASE_TYPEDEFS. Use TFF_PLAIN_IDENTIFIER instead of - plain `0'. - -2000-10-30 Mark Mitchell - - * cp-tree.h (DECL_EXTERNAL_LINKAGE_P): New macro. - (linkage_kind): New enumeration. - (decl_linkage): New function. - * decl2.c (comdat_linkage): Extend comment. - * error.c (dump_function_decl): Print the arguments used to - instantiate a template, even when not printing the type of the - function. - * pt.c (convert_nontype_argument): Use DECL_EXTERNAL_LINKAGE_P, - not TREE_PUBLIC, to test for external linkage. - * tree.c (decl_linkage): New function. - -2000-10-28 Mark Mitchell - - * pt.c (instantiate_decl): Always instantiate static data members - initialized in-class. - -2000-10-27 Zack Weinberg - - * Make-lang.in: Move all build rules here from Makefile.in, - adapt to new context. Wrap all rules that change the current - directory in parentheses. Expunge all references to $(P). - When one command depends on another and they're run all at - once, use && to separate them, not ;. Add OUTPUT_OPTION to - all object-file generation rules. Delete obsolete variables. - - * Makefile.in: Delete. - * config-lang.in: Delete outputs= line. - -2000-10-26 Gabriel Dos Reis - - * error.c (dump_function_decl): Print no space between - `ptr-operator' the `type-specifier' of the return type. - (dump_type_prefix): Make sure we put space at the appropriate - place. - -2000-10-23 Jason Merrill - - * call.c (equal_functions): Also call decls_match for extern "C" fns. - -2000-10-22 Jason Merrill - - * call.c (build_conditional_expr): Use ocp_convert to force - rvalue conversion. - -2000-10-22 Mark Mitchell - - * call.c (standard_conversion): Use RVALUE_CONVs for all - expressions that satisfy lvalue_p, not just those that satisfy - real_lvalue_p. - - * optimize.c (copy_body_r): Don't treat CALL_EXPRs specially. - - * typeck.c (c_sizeof): Return an expression of `size_t' type, - not one with TYPE_IS_SIZETYPE set. - (dubious_conversion_warnings): Remove special-case code. - -2000-10-21 Geoffrey Keating - - * decl2.c (arg_assoc_type): Handle VECTOR_TYPE. - * error.c (dump_type): Handle VECTOR_TYPE like POINTER_TYPE. - (dump_type_prefix): Print vector-of-int as 'int vector'. - (dump_type_suffix): Handle VECTOR_TYPE like POINTER_TYPE. - * tree.c (walk_tree): Handle VECTOR_TYPE. - - * decl.c (init_decl_processing): Call MD_INIT_BUILTINS. - -2000-10-21 Jason Merrill - - * parse.y (operator): Set got_object from got_scope. - Set looking_for_typename. - * decl.c (lookup_name_real): Clear val after setting from_obj. - Reorganize diagnostic. - -2000-10-20 Jason Merrill - - * tree.c (walk_tree): Don't walk into default args. - - * error.c (dump_expr): Use host_integerp. - -2000-10-20 David Edelsohn - - * typeck2.c (abstract_virtuals_error): Use "because" instead of - "since" in error message. - -2000-10-20 Richard Kenner - - * typeck.c (dubious_conversion_warning): Suppress if TYPE_IS_SIZETYPE. - -2000-10-20 Jeffrey Oldham - - * decl.c (revert_static_member_fn): Fixed typo. - -2000-10-19 Mark Mitchell - - * class.c (subobject_offset_fn): New type. - (dfs_record_base_offsets): Remove. - (record_base_offsets): Likewise. - (dfs_search_base_offsets): Likewise. - (record_subobject_offset): New function. - (check_subobject_offset): Likewise. - (walk_subobject_offsets): Likewise. - (record_subobject_offsets): Likewise. - (layout_conflict_p): Reimplement. - (layout_nonempty_base_or_field): Correct handling of type - conflicts during layout. - (layout_empty_base): Likewise. - (build_base_field): Adjust to handle new representation of empty - base offset table. - (build_base_fields): Likewise. - (layout_virtual_bases): Likewise. - (splay_tree_compare_integer_csts): New function. - (layout_class_type): Use a splay_tree, rather than a varray, to - represent the offsets of empty bases. - - * cp-tree.h (DECL_ANTICIPATED): Don't require a FUNCTION_DECL. - * decl.c (select_decl): Don't return declarations that are - DECL_ANTICIPATED. - -2000-10-18 Mark Mitchell - - * cp-tree.h (cp_tree_index): Add CPTI_FAKE_STD. - (fake_std_node): New macro. - * decl.c (in_std): Rename to ... - (in_fake_std): ... this. - (flag_no_builtin): Remove. - (flag_no_nonansi_builtin): Likewise. - (walk_namespaces_r): Use fake_std_node. - (push_namespace): Use std_identifier. - (pop_namespace): Use in_fake_std. - (lookup_name_real): Use fake_std_node. - (init_decl_processing): When -fhonor-std, create the `std' - namespace. Don't create a dummy fake_std_node in that case. - Adjust call to c_common_nodes_and_builtins. Use std_identifier. - (builtin_function): Put builtins whose names don't begin - with `_' in the std namespace. - * decl2.c (flag_no_builtin): Remove. - (flag_no_nonansi_builtin): Likewise. - (set_decl_namespace): Use fake_std_node. - (validate_nonmember_using_decl): Likewise. - (do_using_directive): Likewise. - (handle_class_head): Likewise. - * dump.c (dequeue_and_dump): Likewise. - * except.c (init_exception_processing): Use std_identifier. - * init.c (build_member_call): Use fake_std_node. - * rtti.c (init_rtti_processing): Use std_identifier. - -2000-10-17 Mark Mitchell - - * cp-tree.h (back_end_hook): Remove declaration. - * decl2.c (back_end_hook): Remove definition. - - * dump.c (dequeue_and_dump): Dump TREE_USED. - -2000-10-17 Brad Lucier - - * spew.c (snarf_defarg): Cast 2nd arg to obstack_blank to (int). - -2000-10-17 Joseph S. Myers - - * decl.c (WINT_TYPE): Define. - (init_decl_processing): Create types unsigned_ptrdiff_type_node, - c_size_type_node, signed_size_type_node and wint_type_node. - -2000-10-17 Joseph S. Myers - - * decl2.c (warn_missing_format_attribute): New variable. - (lang_decode_option): Decode -Wmissing-format-attribute. - -2000-10-16 Mark Mitchell - - * typeck.c (qualify_type): Remove. - (composite_pointer_type): Fix handling of conversions to `cv void*'. - -2000-10-14 Kaveh R. Ghazi - - * Makefile.in (parse.c, parse.h): Fix think-o in last patch. - -2000-10-13 Kaveh R. Ghazi - - * Makefile.in (parse.c, parse.h): Create atomically. - -2000-10-12 Mark Mitchell - - * class.c (current_obstack): Remove. - * decl.c (ggc_p): Remove. - (start_decl): Don't use decl_tree_cons. - (grokdeclarator): Don't use build_decl_list. - (start_function): Don't use decl_tree_cons. - (finish_function): Don't mess with obstacks. - * decl2.c (grok_x_components): Don't use build_decl_list. - * lex.c (make_call_declarator): Don't call decl_tree_cons. - (implicitly_declare_fn): Don't call build_decl_list. - * parse.y (frob_specs): Don't call build_decl_list or - decl_tree_cons. - (expr_or_declarator_intern): Don't call decl_tree_cons. - (primary): Don't call build_decl_list. - (fcast_or_absdcl): Likewise. - (typed_declspecs): Don't call decl_tree_cons. - (reserved_declspecs): Don't call build_decl_list. - (declmods): Likewise. - (reserved_typespecquals): Likewise. - (aggr): Likewise. - (new_type_id): Likewise. - (cv_qualifiers): Likewise. - (after_type_declarator_intern): Likewise. - (notype_declarator_intern): Likewise. - (absdcl_intern): Likewise. - (named_parm): Likewise. - * pt.c (most_specialized_class): Likewise. - * repo.c (temporary_obstack): Make it a structure, not a pointer. - (init_repo): Initialize it. - * search.c (current_obstack): Remove. - * typeck2.c (add_exception_specifier): Don't call build_decl_list. - -2000-10-09 Richard Henderson - - * Make-lang.in (CXX_EXTRA_HEADERS): Remove. - (c++ language support bits for libgcc): Remove. - (c++.clean): Remove cplib2.txt cleanup. - * config-lang.in (headers, lib2funcs): Remove. - - * exception.cc, new.cc, new1.cc, new2.cc: Remove files. - * tinfo.cc, tinfo.h, tinfo2.cc, vec.cc: Remove files. - * inc/cxxabi.h, inc/exception, inc/new: Remove files. - * inc/new.h, inc/typeinfo: Remove files. - -2000-10-08 Joseph S. Myers - - * decl.c (INTMAX_TYPE, UINTMAX_TYPE): Define if not already - defined. - (init_decl_processing): Initialize intmax_type_node and - uintmax_type_node. - -2000-10-06 Richard Henderson - - * cp-tree.h (struct cp_language_function): Remove x_result_rtx. - (original_result_rtx): Remove. - * decl.c (save_function_data): Don't clear x_result_rtx. - (mark_lang_function): Don't mark it either. - * expr.c (fixup_result_decl): Remove. - * semantics.c (genrtl_named_return_value): Frob the return decl - before calling emit_local_var. - (genrtl_finish_function): Don't call fixup_result_decl. - Always emit the jump to return_label. - -2000-10-06 Nathan Sidwell - - * pt.c (lookup_template_class): Set current access for enum. - (tsubst_enum): Set file & line for enum decl. - - * spew.c (yylex): Remove unused variable. - -2000-10-05 Richard Henderson - - * semantics.c (genrtl_finish_function): Don't init or check - can_reach_end; remove noreturn and return value checks. - -2000-10-05 Tom Tromey - - * init.c (build_java_class_ref): Use `build_static_name' with a - suffix, not a prefix, to build the class object's name. - -2000-10-05 Nathan Sidwell - - * cp-tree.h (access_kind): Fix comment typo. - * decl2.c (grokfield): Fix diagnostic typo. - * semantics.c (finish_template_type): Fix comment typo. - (finish_qualified_object_call_expr): Likewise. - -2000-10-05 Nathan Sidwell - - * pt.c (tsubst_expr, DECL_STMT case): Don't process if - tsubsting fails. - -2000-10-05 Nathan Sidwell - - * spew.c (frob_id): New static function. - (frob_opname): Use it. - (yylex): Use it. - -2000-10-01 Mark Mitchell - - * decl.c (lang_mark_false_label_stack): Remove. - * lex.c (cp_mang_lang_type): Use ggc_alloc_cleared. - -2000-09-30 Joseph S. Myers - - * gxxint.texi: Use @email for formatting email addresses. - -2000-09-29 Gabriel Dos Reis - - * error.c: Remove direct obstack manipulation. Replace with - output_buffer-based formatting. Adjust calls to removed macros. - (obstack_chunk_alloc, obstack_chunk_free): Remove. - (OB_INIT, OB_PUTC, OB_PUTC2, OB_PUTS, OB_PUTID, OB_PUTCP, - OB_FINISH, OB_PUTI, OB_END_TEMPLATE): Likewise. - -2000-09-24 Mark Mitchell - - * ir.texi: Move to ../c-tree.texi. - -2000-09-20 Jason Merrill - - * decl2.c (get_guard): Check DECL_FUNCTION_SCOPE_P. - -2000-09-21 Andreas Jaeger - - * errfn.c: Move declaration of cp_printer and cp_printers to ... - * cp-tree.h: ... here. - - * error.c: Remove declaration of cp_printer. - -2000-09-20 Mark Mitchell - - * tree.c (mark_local_for_remap_r): Handle CASE_LABELs. - -2000-09-20 Hans-Peter Nilsson - - * except.c: Delete #if 0:d EXCEPTION_SECTION_ASM_OP-default and - users. - -2000-09-18 Mark Mitchell - - * decl.c (start_function): Robustify. - -2000-09-18 Kaveh R. Ghazi - - * cp-tree.h (check_function_format): Accept a `status' parameter. - - * call.c, typeck.c: Updates calls to `check_function_format'. - -2000-09-17 Geoffrey Keating - - * decl2.c (handle_class_head): Always push some scope even - in the error case. - -2000-09-16 Mark Mitchell - - * cp-tree.h (struct cp_language_function): Remove - x_scope_stmt_stack and name_declared. - (current_scope_stmt_stack): Remove. - (function_name_declared_p): New macro. - (struct lang_decl_flags): Use c_lang_decl as a base class. - (context): Remove. - (struct lang_decl): Replace saved_tree with context. - (DECL_FRIEND_CONTEXT): Adjust accordingly. - (SET_DECL_FRIEND_CONTEXT): Likewise. - (DECL_VIRTUAL_CONTEXT): Likewise. - (DECL_SAVED_TREE): Remove. - (C_DECLARED_LABEL_FLAG): Likewise. - (cplus_expand_expr_stmt): Don't declare. - (add_decl_stmt): Likewise. - (add_scope_stmt): Likewise. - * decl.c (mark_stmt_tree): Remove. - (case_compare): Likewise. - (finish_case_label): Use c_add_case_label. - (init_decl_processing): Set more language-specific hooks. - (build_enumerator): Fix typo in comment. - (cplus_expand_expr_stmt): Remove. - (mark_lang_function): Use mark_c_language_function. - (lang_mark_tree): Use c_mark_lang_decl. - * decl2.c: Change order of inclusion. - * except.c: Likewise. - * expr.c (cplus_expand_expr): Remove handling of STMT_EXPR. Fall - back on c_expand_expr. - * friend.c: Include expr.h. - * init.c: Change order of inclusion. - * Makefile.in: Update dependencies. - * lex.h (free_lang_decl_chain): Remove. - * optimize.c (maybe_clone_body): Use function_name_declared_p. - * pt.c (build_template_decl): Don't copy DECL_VIRTUAL_CONTEXT if - it doesn't exist. - (instantiate_decl): Use function_name_declared_p. - * semantics.c (lang_expand_expr_stmt): Remove. - (set_current_function_name_declared): Likewise. - (current_function_name_declared): Likewise. - (begin_compound_stmt): Use function_name_declared_p. - (add_decl_stmt): Remove. - (setup_vtbl_ptr): Use function_name_declared_p. - (add_scope_stmt): Remove. - (current_scope_stmt_stack): New function. - (cp_expand_stmt): Don't handle SCOPE_STMTs. - (expand_body): Use function_name_declared_p. - * tree.c (cp_statement_code_p): Don't include SCOPE_STMT. - * typeck.c: Change order of includes. - (convert_sequence): Remove. - -2000-09-14 Joseph S. Myers - - * lex.c (reswords): Add _Complex. - -2000-09-14 Richard Kenner - - * Make-lang.in (cplib2.txt): Depend on cp/Makefile. - -2000-09-13 J. David Anglin - - * init.c (begin_init_stmts): Don't use // comments. - -2000-09-12 Jason Merrill - - * decl.c (maybe_deduce_size_from_array_init): Set do_default for - all non-extern arrays. - - * decl.c (grokdeclarator): Complain about 'friend T' for implicit - typenames, too. Downgrade complaint to pedwarn. - (xref_tag): Warn about surprising behavior of 'friend struct T'. - * decl2.c (handle_class_head): Generate a TYPENAME_TYPE for - 'class This::Inherited'. - -2000-09-12 Mark Mitchell - - * decl.c (finish_case_label): Given the LABEL_DECL a - DECL_CONTEXT. - -2000-09-12 Gabriel Dos Reis - - * error.c (TFF_PLAIN_IDENTIFIER, TFF_NAMESPACE_SCOPE, - TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, TFF_CHASE_TYPDEF, - TFF_DECL_SPECIFIERS, TFF_CLASS_KEY_OR_ENUM, TFF_RETURN_TYPE, - TFF_FUNCTION_DEFAULT_ARGUMENTS, TFF_EXCEPTION_SPECIFICATION, - TFF_TEMPLATE_HEADER, TFF_TEMPLATE_DEFAULT_ARGUMENTS, TFF_SCOPE): - New macros. - (sorry_for_unsupported_tree, print_scope_operator, - print_left_paren, print_right_paren, print_left_bracket, - print_right_bracket, print_whitespace): Likewise. - (aggr_variety): Rename to class_key_or_enum. - (print_type): Rename to print_type_id. - (print_type_specifier_seq, print_simple_type_specifier, - print_elaborated_type_specifier, - print_rest_of_abstract_declarator, - print_parameter_declaration_clause, print_exception_specification, - print_nested_name_specifier, print_template_id, - typedef_original_name, print_template_argument_list_start, - print_template_argument_list_end): New functions. - -2000-09-11 Gabriel Dos Reis - - * ir.texi: Add more documentation. - -2000-09-11 Mark Mitchell - - * cp-tree.h (struct saved_scope): Remove x_function_parms. - (current_function_parms): Don't define. - (struct cp_language_function): Remove parms_stored. - (current_function_just_assigned_this): Don't define. - (current_function_parms_stored): Likewise. - (static_ctors): Declare. - (static_dtors): Likewise. - (SF_EXPAND): Don't define. - (expand_start_early_try_stmts): Remove declaration. - (store_parm_decls): Likewise. - * decl.c (static_ctors): Don't declare. - (static_dtors): Likewise. - (struct binding_level): Remove this_block. - (poplevel): Remove dead code. - (set_block): Likewise. - (mark_binding_level): Don't mark this_block. - (mark_saved_scope): Don't mark x_function_parms. - (init_decl_processing): Don't add current_function_parms as a GC - root. - (check_function_type): Change prototype. - (start_function): Remove RTL-generation code. - (expand_start_early_try_stmts): Remove. - (store_parm_decls): Give it internal linkage. Remove - RTL-generation code. - (finish_function): Remove RTL-generation code. - * decl2.c (static_ctors): Fix formatting. - (static_dtors): Likewise. - * method.c (use_thunk): Don't call store_parm_decls. - (synthesize_method): Likewise. - * optimize.c (maybe_clone_body): Likewise. - * parse.y (fn.def2): Likewise. - (.set_base_init): Likewise. - (nodecls): Likewise. - * pt.c (instantiate_decl): Likewise. - * rtti.c (synthesize_tinfo_fn): Likewise. - * semantics.c (genrtl_try_block): Simplify. - (expand_body): Use genrtl_start_function and - genrtl_finish_function. - (genrtl_start_function): New function. - (genrtl_finish_function): Likewise. - -2000-09-11 Nathan Sidwell - - * error.c (cp_tree_printer, case 'P'): Append break. - -2000-09-11 Nathan Sidwell - - * cp-tree.h (frob_opname): Declare. - * parse.y (saved_scopes): New static variable. - (cp_parse_init): Adjust. - (do_id): If lastiddecl is NULL, do do_identifier. - (operator): Save scope information. - (unoperator): New reduction. Restore scope information. - (operator_name): Append unoperator. Call frob_opname. - * spew.c (frob_opname): Define. - -2000-09-10 Zack Weinberg - - * decl.c, rtti.c: Include defaults.h if not already included. - Don't define the *_TYPE_SIZE macros. - -2000-09-09 Mark Mitchell - - * cp-tree.h (push_switch): Change prototype. - (check_cp_case_value): Remove declaration. - (decl_constant_value): Likewise. - * decl.c (struct cp_switch): Add switch_stmt and cases. - (case_compare): New function. - (push_switch): Set switch_stmt. Initialize cases. - (pop_switch): Clean up cases. - (define_case_label): Rename to ... - (finish_case_label): ... this. Do semantic analysis for case - labels here. - (start_function): Correct comment. - * decl2.c (check_cp_case_value): Remove. - * expr.c (do_case): Remove. - * pt.c (tsubst_expr): Adjust call to finish_case_label. - * semantics.c (genrtl_do_poplevel): Remove declaration. - (RECHAIN_STMTS): Remove. - (finish_break_stmt): Use build_break_stmt. - (finish_continue_stmt): Use build_continue_stmt. - (finish_switch_cond): Adjust condition here, rater than in - c_expand_start_case. - (finish_case_label): Remove. - * typeck.c (c_expand_return): Remove. - (c_expand_start_case): Likewise. - -2000-09-07 Gabriel Dos Reis - - * ir.texi: Document type nodes. - -2000-09-06 Mark Mitchell - - * cp-tree.h (init_cp_semantics): Declare. - (genrtl_try_block): Don't declare. - (genrtl_handler): Likewise. - (genrtl_catch_block): Likewise. - (genrtl_ctor_stmt): Likewise. - (genrtl_subobject): Likewise. - (genrtl_do_poplevel): Likewise. - (genrtl_named_return_value): Likewise. - * lex.c (init_parse): Call init_cp_semantics. - * semantics.c (genrtl_try_block): Give it internal linkage. - (genrtl_handler): Likewise. - (genrtl_catch_block): Likewise. - (genrtl_ctor_stmt): Likewise. - (genrtl_subobject): Likewise. - (genrtl_do_poplevel): Likewise. - (genrtl_named_return_value): Likewise. - (lang_expand_stmt): Rename to ... - (cp_expand_stmt): ... this. Only handle C++-specific nodes. - (init_cp_semantics): Define. - - * decl.c (initialize_local_var): Remove RTL-generating code. - * semantics.c (genrtl_try_block): Fix formatting. - - Move statement-tree facilities from C++ to C front-end. - * cp-tree.h (cp_tree_index): Remove CPTI_VOID_ZERO. - (void_zero_node): Remove. - (stmt_tree): Likewise. - (scope_chain): Adjust. - (language_function): Rename to cp_language_function. - (cp_function_chain): Adjust. - (current_stmt_tree): Remove. - (last_tree): Likewise. - (last_expr_type): Likewise. - (struct lang_decl): Adjust. - (STMT_IS_FULL_EXPR_P): Remove. - (add_tree): Remove. - (begin_stmt_tree): Likewise. - (finish_stmt_tree): Likewise. - (walk_tree_fn): Likewise. - (walk_stmt_tree): Likewise. - * class.c (finish_struct): Replace use of add_tree with add_stmt. - * decl.c (mark_stmt_tree): Adjust type. - (init_decl_processing): Don't build void_zero_node. - (initialize_local_var): Adjust usage of current_stmt_tree. - (finish_enum): Use add_stmt, not add_tree. - (save_function_data): Adjust use of language_function. - (finish_constructor_body): Use add_stmt, not add_tree. - (finish_destructor_body): Likewise. - (push_cp_function_context): Adjust use of language_function. - (pop_cp_function_context): Likewise. - (mark_lang_function): Likewise. - (mark_cp_function_context): Likewise. - * init.c (build_aggr_init): Adjust use of current_stmt_tree. - (build_vec_init): Likewise. - * semantics.c (SET_LAST_STMT): Remove. - (RECHAIN_STMTS): Don't use it. - (stmts_are_full_exprs_p): Adjust use of current_stmt_tree. - (current_stmt_tree): Define. - (add_tree): Remove. - (finish_goto_stmt): Use add_stmt, not add_tree. - (finish_expr_stmt): Likewise. - (begin_if_stmt): Likewise. - (finish_then_clause): Likewise. - (begin_while_stmt): Likewise. - (begin_do_stmt): Likewise. - (finish_return_stmt): Likewise. - (begin_for_stmt): Likewise. - (finish_break_stmt): Likewise. - (finish_continue_stmt): Likewise. - (begin_switch_stmt): Likewise. - (finish_case_label): Likewise. - (begin_try_block): Likewise. - (begin_function_try_block): Likewise. - (begin_handler): Likewise. - (begin_catch_block): Likewise. - (begin_compound_stmt): Likewise. - (begin_asm_stmt): Likewise. - (finish_asm_stmt): Likewise. - (finish_label_stmt): Likewise. - (add_decl_stmt): Likewise. - (finish_subobject): Likewise. - (finish_decl_cleanup): Likewise. - (finish_named_return_value): Likewise. - (setup_vtbl_ptr): Likewise. - (add_scope_stmt): Likewise. - (finish_stmt_expr): Likewise. - (prune_unused_decls): Remove. - (begin_stmt_tree): Likewise. - (finish_stmt_tree): Likewise. - (prep_stmt): Adjust use of current_stmt_tree. - (lang_expand_stmt): Likewise. - * tree.c (statement_code_p): Remove. - (cp_statement_code_p): New function. - (walk_stmt_tree): Remove. - (init_tree): Set lang_statement_code_p. - -2000-09-06 Zack Weinberg - - Integrated preprocessor. - - * Make-lang.in, Makefile.in: Remove all references to input.c, - gxx.gperf, and hash.h. Add ../c-lex.o to C_OBJS. - * gxx.gperf, hash.h, input.c: Delete. - * lang-specs.h: Pass -lang-c++ to cc1plus so cpplib is - initialized properly. - - * class.c (fixup_pending_inline): Take a tree, not a - struct pending_inline *. All callers changed. - (init_class_processing): Set RID_PUBLIC, RID_PRIVATE, - RID_PROTECTED entries in ridpointers[] array here. - * decl.c (duplicate_decls): Do not refer to struct - pending_inline. - (record_builtin_type, init_decl_processing): Use RID_MAX not - CP_RID_MAX. - (grokdeclarator): Use C_IS_RESERVED_WORD. - * decl2.c (lang_decode_option): Ignore -lang-c++ for sake of - cpplib. - (grok_x_components): Do not inspect pending_inlines chain. - - * cp-tree.h (struct lang_identifier): Add rid_code entry. - (C_IS_RESERVED_WORD, C_RID_CODE, C_RID_YYCODE): New. - (flag_no_gnu_keywords, flag_operator_names, rid_to_yy): Declare. - (DEFARG_LENGTH, struct pending_inline, TIME_IDENTIFIER_TIME, - TIME_IDENTIFIER_FILEINFO): Kill. - Update prototypes. - * lex.h: Expunge cp_rid. Rewrite RIDBIT macros to use just a - single 32-bit word. - * parse.y: Call do_pending_inlines unconditionally. - reinit_parse_for_method is now snarf_method. fn.defpen is no - longer necessary. Remove unnecessary annotation on - SCOPE. Do not refer to end_of_file or struct pending_inline. - * semantics.c (begin_inline_definitions): Call - do_pending_inlines unconditionally. - - * lex.c: Remove all code now shared with C front end. - Initialize cpplib properly if USE_CPPLIB. Put reserved words - into the get_identifier table. Rewrite pragma handling to - work with the registry. Move code to save tokens for later - processing to spew.c. - - * spew.c: Rewrite everything in terms of token streams instead - of text. Move routines here from lex.c / input.c as - appropriate. GC-mark trees hanging off the pending inlines - chain. - -2000-09-06 Mark Mitchell - - * NEWS: Mention that the named return value extension has been - deprecated. - * cp-tree.h (original_result_rtx): Define. - (TREE_REFERENCE_EXPR): Remove. - (DECL_VPARENT): Likewise. - (pushdecl_nonclass_level): Likewise. - (store_return_init): Likewise. - (reinit_lang_specific): Likewise. - (genrtl_named_return_value): Change prototype. - * decl.c (original_result_rtx): Remove. - (cp_finish_decl): Don't build DECL_STMTs for RESULT_DECLs. - Do not generate RTL for local variables here. - (store_return_init): Remove. - * semantics.c (genrtl_named_return_value): Simplify. Fold in - store_return_init. - (finish_named_return_value): Adjust accordingly. Warn that this - extension is deprecated. - (lang_expand_stmt): Adjust call to genrtl_named_return_value. - -2000-09-06 Nathan Sidwell - - * pt.c (type_unification_real): Replace switch with if. - (unify): Tsubst non-type parms before comparing. - -2000-09-06 Nathan Sidwell - - * error.c (dump_typename): New function, broken out of ... - (dump_type): ... here. Use it. - * typeck.c (same_type_p): Use cp_tree_equal for TYPENAME_TYPE. - -2000-09-06 Nathan Sidwell - - * init.c (build_offset_ref): Deal with namespace scoped - TEMPLATE_ID_EXPRs. - -2000-09-06 Nathan Sidwell - - * class.c (resolve_address_of_overloaded_function): Add - explanation message. - * decl.c (define_case_label): Reformat explanation. - * decl2.c (finish_static_data_member_decl): Likewise. - (grokfield): Likewise. - * friend.c (do_friend): Likewise. - -2000-09-05 Zack Weinberg - - * tree.c (walk_tree): Expose tail recursion. - (walk_stmt_tree): New function. - * cp-tree.h: Prototype walk_stmt_tree. - * semantics.c (prune_unused_decls): Operate on SCOPE_STMTs not - the BLOCKs directly. If a BLOCK has no variables after - pruning, discard it. - (finish_stmt_tree): Use walk_stmt_tree. No need to save and - restore the line number. - -2000-09-05 Mark Mitchell - - * Makefile.in (CXX_TREE_H): Add dependency on HTAB_H. - (pt.o): Remove dependency on HTAB_H. - * cp-tree.h: Include hashtab.h. - (walk_tree): Change prototype. - (walk_tree_without_duplicates): New function. - * decl.c (check_default_argument): Use it. - * optimize.c (remap_decl): Adjust calls to walk_tree. - (copy_body): Likewise. - (expand_calls_inline): Likewise. - (calls_setjmp_p): Use walk_tree_without_duplicates. - * pt.c: Don't include hashtab.h. - (for_each_template_parm): Use walk_tree_without_duplicates. - * semantics.c (finish-stmt_tree): Likewise. - (expand_body): Likewise. - * tree.c (walk_tree): Add additional parameter. - (walk_tree_without_duplicates): New function. - (count_trees): Use it. - (verify_stmt_tree): Adjust call to walk_tree. - (find_tree): Use walk_tree_without_duplicates. - (no_linkage_check): Likewise. - (break_out_target_exprs): Adjust call to walk_tree. - (cp_unsave): Likewise. - -2000-09-04 Kriang Lerdsuwanakij - - * cp-tree.def (BOUND_TEMPLATE_TEMPLATE_PARM): New tree code. - (TEMPLATE_TEMPLATE_PARM): Adjust comment. - * cp-tree.h (TYPE_BINFO): Adjust comment. - (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. - (TEMPLATE_TYPE_PARM_INDEX): Likewise. - (IS_AGGR_TYPE): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. - (TYPE_TEMPLATE_INFO): Likewise. - (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): Likewise. - * class.c (push_nested_class): Likewise. - * decl.c (lookup_name_real): Likewise. - (grokdeclarator): Likewise. - (grok_op_properties): Likewise. - (xref_tag): Likewise. - (xref_basetypes): Likewise. - * decl2.c (constructor_name_full): Likewise. - (arg_assoc_template_arg): Add TEMPLATE_TEMPLATE_PARM case. - (arg_assoc_type): Use BOUND_TEMPLATE_TEMPLATE_PARM instead. - * error.c (dump_type): Split TEMPLATE_TEMPLATE_PARM case. - (dump_type_prefix): Add BOUND_TEMPLATE_TEMPLATE_PARM. - (dump_type_suffix): Likewise. - * init.c (is_aggr_type): Use BOUND_TEMPLATE_TEMPLATE_PARM - instead. - (get_aggr_from_typedef): Likewise. - * mangle.c (write_type): Split TEMPLATE_TEMPLATE_PARM case. - (write_expression): Add BOUND_TEMPLATE_TEMPLATE_PARM. - (write_template_parm): Likewise. - (write_template_template_parm): Check tree code instead of - using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. - * method.c (build_overload_nested_name): Add - BOUND_TEMPLATE_TEMPLATE_PARM. - (process_overload_item): Split TEMPLATE_TEMPLATE_PARM case. - * parse.y (bad_parm): Add BOUND_TEMPLATE_TEMPLATE_PARM. - * pt.c (convert_template_argument): Check tree code instead of - using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. - (for_each_template_parm_r): Split TEMPLATE_TEMPLATE_PARM case. - (for_each_template_parm): Adjust comment. - (tsubst): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. - (tsubst_copy): Add BOUND_TEMPLATE_TEMPLATE_PARM. - (unify): Add BOUND_TEMPLATE_TEMPLATE_PARM. Reorganize. Use - template_args_equal to compare template template parameter cases. - * ptree.c (print_lang_type): Add BOUND_TEMPLATE_TEMPLATE_PARM. - * search.c (lookup_field_1): Use BOUND_TEMPLATE_TEMPLATE_PARM - instead. - * tree.c (copy_template_template_parm): Decide whether to create - a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM node. - (walk_tree): Add BOUND_TEMPLATE_TEMPLATE_PARM. - (copy_tree_r): Likewise. - * typeck.c (comptypes): Likewise. Check tree code instead of - using TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. - -2000-09-04 Mark Elbrecht - - * decl.c (finish_function): Move the code for handling functions - marked with the constructor and destructor attributes inside the - expand_p block. - -2000-09-04 Nathan Sidwell - - * init.c (resolve_offset_ref): Deal with TEMPLATE_ID_EXPR. - -2000-09-04 Nathan Sidwell - - * pt.c (lookup_template_class): Remove abort. - * tree.c (get_type_decl): Allow error_mark_node. - -2000-09-04 Nathan Sidwell - - * decl2.c (arg_assoc): Deal with COMPONENT_REFs inside - TEMPLATE_ID_EXPRs. - -2000-09-03 Mark Mitchell - - * operators.def (ALIGNOF_EXPR, MAX_EXPR, MIN_EXPR): Change - new ABI mangling. - -2000-09-01 Nathan Sidwell - - * parse.y (named_class_head): Check for TYPENAME_TYPE. Simplify - union tag mismatch error reporting. - -2000-09-01 Nathan Sidwell - - * call.c (build_scoped_method_call): Check it is not a namespace. - -2000-08-30 Jason Merrill - - * cp-tree.h (LOCAL_CLASS_P): Use decl_function_context. - - * tree.c (bot_manip): Check TREE_CONSTANT rather than - !TREE_SIDE_EFFECTS. Call break_out_target_exprs and - build_target_expr_with_type for the non-AGGR_INIT_EXPR case. - - * decl.c (start_function): Always call make_function_rtl. - -2000-08-29 Zack Weinberg - - * semantics.c (prune_unused_decls): New function. - (finish_stmt_tree): Call it via walk_tree. - -2000-08-29 Zack Weinberg - - * class.c (build_secondary_vtable): Constify a char *. - * decl.c (init_decl_processing): Initialize function_id_node, - pretty_function_id_node, and func_id_node. - * input.c (struct input_source): Constify 'str'. - (feed_input): Constify first argument. - * mangle.c (write_identifier): Constify argument. - * pt.c (mangle_class_name_for_template): Constify argument. - -2000-08-29 Mark Mitchell - - * typeck.c (mark_addressable): Remove code that pokes around in - RTL. - -2000-08-28 Jason Merrill - - * lex.c (file_name_nondirectory): Move to toplev.c. - - * cp-tree.h (LOCAL_CLASS_P): New macro. - * class.c (finish_struct_1): Use it. - -2000-08-27 Alex Samuel - - * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Remove unexplained voodoo. - (write_encoding): Pass another argument to write_name. - (write_name): Add ignore_local_scope parameter. Fix handling of - local names. - (write_nested_name): Use write_unqualified_name. - (write_prefix): Likewise. Skip out on FUNCTION_DECLs. - (write_template_prefix): Use write_unqualified_name. - (write_component): Remove. - (write_local_name): Add parameter. Use direct local entity to - discriminator calculation. - (write_class_enum_type): Pass another argument to write_name. - (write_template_template_arg): Likewise. - (make_guard_variable): Likewise. - -2000-08-27 Jason Merrill - - * decl.c (pushdecl): Matching decls for local externs are found in - the current level. Propagate linkage information from previous - declarations. - -2000-08-26 Gabriel Dos Reis - - * ir.texi (Expressions): Fix typo. - -2000-08-25 Greg McGary - - * tree.c (init_tree): Use ARRAY_SIZE. - -2000-08-25 Gabriel Dos Reis - - * error.c (cp_tree_printer): Rework. - -2000-08-25 Mark Mitchell - - * Make-lang.in (CXX_LIB2FUNCS): Remove cp-demangle.o and - dyn-string.o. - (CXX_LIB2SRCS): Remove cp-demangle.c and dyn-string.c. - (cp-demangle.o): Remove target. - (dyn-string.o): Likewise. - - * decl.c (grokfndecl): Require that `main' return an `int'. - * mangle.c (write_encoding): Don't mangle return types for - conversion functions. - -2000-08-25 Gabriel Dos Reis - - * error.c (tree_formatting_info): New data type. - (tree_being_formatted): New macro. - (tree_formatting_flags): Likewise. - (put_whitespace): Likewise. - (print_tree_identifier): Likewise. - (print_identifier): Likewise. - (cp_tree_printer, print_function_argument_list, print_declaration, - print_expression, print_function_declaration, - print_function_parameter, print_type, print_cv_qualifier): New - functions. - (init_error): Initialize lang_printer. - -2000-08-24 Jason Merrill - - * typeck.c (build_ptrmemfunc): Just reinterpret if there's no - adjustment necessary. - -2000-08-24 Greg McGary - - * cp-tree.h (MAIN_NAME_P): Remove macro. - -2000-08-24 Gabriel Dos Reis - - * error.c (print_instantiation_context): Don't forget to flush the - buffer. - -2000-08-23 Jason Merrill - - * typeck.c (build_ptrmemfunc): Save the input pmf. - - * method.c (process_modifiers): Use same_type_p. - -2000-08-23 Mark Mitchell - - * cp-tree.h (DECL_CLONED_FUNCTION_P): Check DECL_LANG_SPECIFIC. - * mangle.c (write_function_type): Change prototype. - (write_encoding): Don't mangle return types for - constructors or destructors. - (write_type): Adjust call to write_function_type. - * pt.c (instantiate_template): Instantiate alternate entry points - when instantiating the main function. - -2000-08-23 Gabriel Dos Reis - - * error.c (cp_print_error_function): Don't use embedded '\n' in - output_printf. - -2000-08-23 Gabriel Dos Reis - - * decl.c (init_decl_processing): Remove bogus initialization. - * error.c (lang_print_error_function): Restore here. - (init_error): Initialize print_error_function. - -2000-08-22 Theodore Papadopoulo - - * decl2.c (arg_assoc): Revert my 2000-08-11 change. - -2000-08-22 Gabriel Dos Reis - - * Makefile.in (error.o): Depends on diagnostic.h - - * cp-tree.h (problematic_instantiation_changed, - record_last_problematic_instantiation, current_instantiation, - print_instantiation_context): Declare. - (maybe_print_template_context): Remove. - - * decl.c (init_decl_processing): Set print_error_function to NULL. - (lang_print_error_function): Remove, since we're using a new - machinery. - - * error.c: #include diagnostic.h - (function_category): New function. - (cp_diagnostic_starter): Likewise. - (cp_diagnostic_finalizer): Likewise. - (cp_print_error_function): Likewise. - (maybe_print_instantiation_context): Likewise. - (print_instantiation_full_context): Likewise. - (print_instantiation_partial_context): Likewise. - (print_instantiation_context): Define. - (init_error): Initialize diagnostic pager and finalizer. - - * pt.c (problematic_instantiation_changed): Define. - (record_last_problematic_instantiation): Likewise. - (current_instantiation): Likewise. - (maybe_print_template_context): Remove. - (print_template_context): Likewise. - (current_tinst_level): Make static to reflect Brendan Kehoe's - change of 1995-04-13. - (push_tinst_level): Call print_instantiation_context. - -2000-08-21 Nix - - * lang-specs.h: Do not process -o or run the assembler if - -fsyntax-only. - -2000-08-21 Joseph S. Myers - - * decl.c (flag_hosted, flag_noniso_default_format_attributes): New - variables. - * decl2.c (lang_decode_option): Disable gettext attributes for - -ansi. - -2000-08-21 Gabriel Dos Reis - - * lex.c (lang_init_options): Default diagnostic message maximum - length to 80, when line-wrapping. - -2000-08-20 Mark Mitchell - - * class.c (build_vtbl_initializer): Clear the entire - vtbl_init_data. Start keeping track of the functions for which we - have created vcall offsets here. - (dfs_build_vcall_offset_vtbl_entries): Remove. - (build_vcall_offset_vtbl_entries): Reimplement. - (add_vcall_offset_vtbl_entries_r): New function. - (add_vcall_offset_vtbl_entries_1): Likewise. Tweak logic for - computing when vcall offsets are necessary. - -2000-08-18 Nathan Sidwell - - * decl.c (member_function_or_else): Use cp_error ... %T. - (grokdeclarator): Likewise. - (start_method): Likewise. - * friend.c (make_friend_class): Use cp_pedwarn ... %T. - -2000-08-18 Nathan Sidwell - - * decl2.c (grokfield): Set CLASSTYPE_GOT_SEMICOLON on class - TYPE_DECLs. - -2000-08-18 Nathan Sidwell - - * cp-tree.h (PTRMEM_OK_P): New macro. - (itf_ptrmem_ok): New enumeration value. - * class.c (resolve_address_of_overloaded_function): Add PTRMEM - argument. Diagnose implicit pointer to member. - (instantiate_type): Don't diagnose implicit pointer to member - here. Pass itf_ptrmem_ok if ok. Adjust calls to - resolve_address_of_overloaded_function. - * init.c (build_offset_ref): Set PTRMEM_OK_P. - (resolve_offset_ref): Don't diagnose implicit pointer to member here. - * semantics.c (finish_parenthesized_expr): Clear OFFSET_REFs here. - * typeck.c (build_x_unary_op): Calculate PTRMEM_OK_P. - (build_unary_op): Deal with single non-static member in - microsoft-land. - -2000-08-18 Nathan Sidwell - - * decl2.c (arg_assoc_type): Cope with TYPENAME_TYPE. - -2000-08-18 Nathan Sidwell - - * cp-tree.h (enum_name_string): Remove prototype. - (report_case_error): Remove prototype. - * cp/typeck2.c (enum_name_string): Remove. - (report_case_error): Remove. - * error.c (dump_expr): Deal with enum values directly. - Correctly negate integer constant. - -2000-08-17 Nathan Sidwell - - * inc/cxxabi.h (__cxa_vec_new2, __cxa_vec_new3): Declare. - (__cxa_vec_delete2, __cxa_vec_delete3): Declare. - * vec.cc (__cxa_vec_new2, __cxa_vec_new3): Implement. - (__cxa_vec_delete2, __cxa_vec_delete3): Implement. - (__cxa_vec_new): Use __cxa_vec_new2. - (__cxa_vec_delete): Use __cxa_vec_delete2. - -2000-08-17 Nathan Sidwell - - * vec.cc (__cxa_vec_new): Set "C" linkage. - (__cxa_vec_ctor): Likewise. - (__cxa_vec_cctor): Likewise. - (__cxa_vec_dtor): Likewise. - (__cxa_vec_delete): Likewise. - * inc/cxxabi.h (__cxa_vec_new): Set "C" linkage. - (__cxa_vec_ctor): Likewise. - (__cxa_vec_cctor): Likewise. - (__cxa_vec_dtor): Likewise. - (__cxa_vec_delete): Likewise. - -2000-08-17 Nathan Sidwell - - * class.c (instantiate_type): Reinstate local variable - deleted in previous change. - - * cvt.c (cp_convert_to_pointer): Pass itf_complain, not - itf_no_attributes. - -2000-08-17 Nathan Sidwell - - * cp-tree.h (instantiate_type_flags): New enumeration. - (instantiate_type): Change parameter. - * class.c (instantiate_type): Adjust prototype. Adjust. - * call.c (standard_conversion): Adjust instantiate_type call. - (reference_binding): Likewise. - (build_op_delete_call): Likewise. - (convert_like_real): Likewise. - * cvt.c (cp_convert_to_pointer): Likewise. - (convert_to_reference): Likewise. - * pt.c (convert_nontype_argument): Likewise. - * typeck.c (build_binary_op): Likewise. - (build_ptrmemfunc): Likewise. - (convert_for_assignment): Likewise. - -2000-08-17 Nathan Sidwell - - * cp-tree.h (CPTR_AGGR_TAG): New global tree node. - (current_aggr): Define. - * decl.c (grokdeclarator): Make sure a friend class is an - elaborated type specifier. - * parse.y (current_aggr): Remove static definition. - (cp_parse_init): Adjust. - (structsp): Clear and restore current_aggr. - (component_decl_list): Clear current_aggr. - - * error.c (dump_type, case TYPENAME_TYPE): Don't emit the - aggregate tag on the typename's context. - - * pt.c (tsubst_friend_class): Return error_mark_node, if - parms becomes NULL. - (instantiate_class_template): Ignore error_mark_node friend types. - -2000-08-14 Nathan Sidwell - - * cvt.c (warn_ref_binding): New static function, broken out of ... - (convert_to_reference): ... here. Use it. - -2000-08-11 Kriang Lerdsuwanakij - - * parse.y (template_arg): Add rule for template qualified with - global scope. - -2000-08-11 Theodore Papadopoulo - - * decl2.c (add_function): Reorganize. - (arg_assoc): Do not consider function template decls. - -2000-08-11 Jason Merrill - - * decl.c (lookup_name_real): Don't forget the TYPENAME_TYPE we're - looking inside. - -2000-08-11 Nathan Sidwell - - * cp-tree.h (resolve_scope_to_name): Remove unused prototype. - (lookup_nested_tag): Likewise. - - * decl2.c (grokfield): Fix comment to reflect many types of _DECLs - can be produced. - -2000-08-11 Nathan Sidwell - - * parse.y (named_complex_class_head_sans_basetype): Remove - always true if. - -2000-08-11 Nathan Sidwell - - * decl2.c (build_expr_from_tree, case METHOD_CALL_EXPR): Build - explicit TEMPLATE_ID_EXPR args. - (build_expr_from_tree, case CALL_EXPR): Likewise. - -2000-08-11 Nathan Sidwell - - * decl.c (check_tag_decl): Diagnose typename's which don't - declare anything. - -2000-08-10 Nathan Sidwell - - * init.c (build_aggr_init): Reject bogus array initializers - early. - -2000-08-09 Nathan Sidwell - - * rtti.c (build_dynamic_cast_1): Set "C" linkage for new abi - runtime. - * cp/tinfo.cc (__dynamic_cast): Likewise. - * cp/inc/cxxabi.h (__dynamic_cast): Likewise. - -2000-08-09 Nathan Sidwell - - * cvt.c (convert_to_pointer_force): Fix error message when - attempting to cast from ambiguous base. - -2000-08-08 Jason Merrill - - * pt.c (tsubst_aggr_type): Bail if creating the argvec fails. - (tsubst_template_arg_vector): Likewise. - - * decl2.c (build_anon_union_vars): Choose the largest field; don't - assume that one will be as large as the union. - -2000-08-07 Kazu Hirata - - * cp-tree.h (CLASSTYPE_HAS_PRIMARY_BASE_P): Fix a comment typo. - * decl.c (pop_labels): Likewise. - -2000-08-04 Jeffrey Oldham - - * inc/cxxabi.h (__pbase_type_info): Changed member names to match - specifications. - (__pointer_to_member_type_info): Likewise. - (__base_class_info): Likewise. - (__class_type_info): Likewise. - (__si_class_type_info): Likewise. - (__vmi_class_type_info): Likewise. - * tinfo.cc (__si_class_type_info::__do_find_public_src): - Changed member names to match specifications. - (__vmi_class_type_info::__do_find_public_src): Likewise. - (__si_class_type_info::__do_dyncast): Likewise. - (__vmi_class_type_info::__do_dyncast): Likewise. - (__si_class_type_info::__do_upcast): Likewise. - (__vmi_class_type_info::__do_upcast): Likewise. - * tinfo2.cc (__pbase_type_info::__do_catch): Likewise. - (__pbase_type_info::__pointer_catch): Likewise. - (__pointer_type_info::__pointer_catch): Likewise. - (__pointer_to_member_type_info::__pointer_catch): Likewise. - -2000-08-04 Zack Weinberg - - * Make-lang.in (cc1plus): Depend on $(BACKEND), not stamp-objlist. - * Makefile.in: Add C_OBJS, BACKEND; delete OBJS, OBJDEPS. - (cc1plus): Link with $(BACKEND) and $(C_OBJS). - -2000-08-04 Mark Mitchell - - * cp-tree.h (add_method): Change prototype. - * class.c (add_method): Remove FIELDS parameter. Add ERROR_P. - Don't double the size of the method vector in the error case. - (handle_using_decl): Adjust call to add_method. - (add_implicitly_declared_members): Likewise. - (clone_function_decl): Likewise. - * decl2.c (check_classfn): Likewise. - * semantics.c (finish_member_declaration): Likewise. - -2000-08-04 Joseph S. Myers - - * decl.c (flag_isoc94): New variable. - -2000-08-02 Jason Merrill - - * pt.c (do_type_instantiation): Add complain parm; don't complain - if called recursively. - * cp-tree.h, parse.y: Adjust. - -2000-08-02 Zack Weinberg - - * decl2.c: Silently ignore -Wstrict-prototypes; warn about - -Wno-strict-prototypes. - - * g++spec.c: Adjust type of second argument to - lang_specific_driver, and update code as necessary. - - * cp-tree.h: Don't prototype min_precision here. - (my_friendly_assert): Cast expression to void. - * semantics.c (do_poplevel): Initialize scope_stmts. - -2000-08-02 Mark Mitchell - - * cp-tree.h (DECL_NEEDED_P): Tweak. - -2000-07-28 Jason Merrill - - * lang-specs.h: Use %i in rule for .ii files. - -2000-07-31 Zack Weinberg - - * lang-specs.h: Rename cpp to cpp0 and/or tradcpp to tradcpp0. - -2000-07-30 Mark Mitchell - - Allow indirect primary bases. - * cp-tree.h (struct lang_type): Remove vfield_parent. Add - primary_base. - (CLASSTYPE_VFIELD_PARENT): Remove. - (CLASSTYPE_PRIMARY_BINFO): Reimplement. - (BINFO_PRIMARY_BINFO): Remove. - (CLASSTYPE_HAS_PRIMARY_BASE_P): Reimplement. - (BINFO_VBASE_PRIMARY_P): Likewise. - (BINFO_PRIMARY_BASE_OF): New macro. - (BINFO_INDIRECT_PRIMARY_P): Likewise. - (get_primary_binfo): New function. - * decl.c (lang_mark_tree): Make lang_type::primary_base. - * class.c (vcall_offset_data_s): Rename to ... - (vtbl_init_data_s): ... this. Rename primary_p to primary_vtbl_p, - and add ctor_vtbl_p. - (get_derived_offset): Use get_primary_binfo. - (dfs_mark_primary_bases): Adjust handling of virtual primary - bases. - (mark_primary_bases): Likewise. - (set_primary_base): Take a binfo, not an integer, as a - representation of the primary base. - (indirect_primary_base_p): Remove. - (determine_primary_base): Adjust for indirect primary bases. - (dfs_find_final_overrider): Fix typo in coment. - (update_vtable_entry_for_fn): Use get_primary_binfo. - (layout_nonempty_base_or_field): Tweak. - (build_base_fields): Adjust for new primary base semantics. - (dfs_propagate_binfo_offsets): Remove. - (propagate_binfo_offsets): Rewrite. - (dfs_set_offset_for_shared_vbases): Remove. - (layout_virtual_bases): Don't use it. - (layout_class_type): Set CLASSTYPE_SIZE correctly under the new - ABI. - (finish_struct_1): Set CLASSTYPE_PRIMARY_BINFO, not - CLASSTYPE_VFIELD_PARENT. - (dfs_get_primary_binfo): New function. - (get_primary_binfo): Likewise. - (dump_class_hierarchy_r): Tweak printing of primary bases. - (build_vtbl_initializer): Fix typo in comments. Use - vtbl_init_data. - (build_vcall_and_vbase_vtbl_entries): Likewise. - (build_vbaes_offset_vtbl_entries): Likewise. - (dfs_build_vcall_offset_vtbl_entries): Adjust setting of - BV_VCALL_INDEX to handle indirect primary bases. - (build_vcall_offset_vtbl_entries): Use vtbl_init_data. - (build_rtti_vtbl_entries): Likewise. - * search.c (get_shared_vbase_if_not_primary): Tweak. - (find_vbase_instance): Likewise. - (binfo_for_vtable): Simplify. - * tree.c (unshare_base_binfos): Clear BINFO_PRIMARY_BASE_OF. - (make_binfo): Make it have 11 entries. - -2000-07-30 Alex Samuel - - * mangle.c (DECL_TEMPLATE_ID_P): Remove. - (CLASSTYEP_TEMPLATE_ID_P): Check template info, and context when - ascertaining primaryness. - (G): Remove template_args. - (decl_is_template_id): New function. - (write_encoding): Use decl_is_template_id. - (write_name): Likewise. Handle type_decls. Get main variant of - type decls. - (write_nested_name): Likewise. - (write_prefix): Likewise. - (write_template_prefix): Likewise. - (write_special_name_constructor): Remove defunct production from - comment. - (write_bare_function_type): Remove comment about absent parameter. - (write_template_template_arg): Add missing grammar production to - comment. - -2000-07-27 Jason Merrill - - * decl.c (duplicate_decls): If common_type produces a non-typedef - type for a typedef, just use the old type. - -2000-07-27 Mark Mitchell - - * cp-tree.h (function_depth): Declare. - (verify_stmt_tree): Likewise. - (find_tree): Likewise. - * decl.c (function_depth): Give it external linkage. - * optimize.c (optimize_function): Increment and decrement it. - * tree.c (verify_stmt_tree_r): New function. - (verify_stmt_tree): Likewise. - (find_tree_r): Likewise. - (find_tree): Likewise. - -2000-07-27 Jason Merrill - - * pt.c (for_each_template_parm_r, case RECORD_TYPE): Use - TYPE_PTRMEMFUNC_P. - * cp-tree.h (TYPE_TEMPLATE_INFO): Check for TYPE_LANG_SPECIFIC. - -2000-07-26 Mark Mitchell - - * decl.c (start_cleanup_fn): Mark the function as `inline'. - * decl2.c (get_guard): Call cp_finish_decl, not - rest_of_decl_compilation, for local guards. - * lex.c (do_identifier): Remove unused variable. - -2000-07-26 Marc Espie - - * parse.y: Add missing ';'. - -2000-07-26 Mark Mitchell - - * parse.y (empty_parms): Use `()', not `(...)', when in the scope - of `extern "C++"'. - -2000-07-25 Nathan Sidwell - - Kill strict_prototype. Backwards compatibility only for - non NO_IMPLICIT_EXTERN_C systems. - * cp-tree.h (flag_strict_prototype): Remove. - (strict_prototype): Remove. - (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. - * decl.c (maybe_push_to_top_level): Adjust. - (pop_from_top_level): Adjust. - (decls_match): Only allow sloppy parm matching for ancient - system headers. - (init_decl_processing): Adjust. - (grokdeclarator): Adjust. - * decl2.c (flag_strict_prototype): Remove. - (strict_prototype): Remove. - (strict_prototypes_lang_c, strict_prototypes_lang_cplusplus): Remove. - (lang_f_options): Remove "strict-prototype". - (unsupported-options): Add "strict-prototype". - * lex.c (do_identifier): Adjust. - (do_scoped_id): Adjust. - * parse.y (empty_parms): Adjust. - * class.c (push_lang_context): Adjust. - (pop_lang_context): Adjust. - * typeck.c (comp_target_parms): Adjust. - -2000-07-25 Nathan Sidwell - - * decl.c (poplevel): Deal with anonymous variables at for scope. - (maybe_inject_for_scope_var): Likewise. - -2000-07-25 Zack Weinberg - - * decl.c: Remove all signal handling code, now done in toplev.c. - -2000-07-23 Mark Mitchell - - * decl.c (make_rtl_for_nonlocal_decl): Rework. - - * pt.c (lookup_template_class): Ensure that TYPE_CONTEXT is set - correctly. - -2000-07-20 Zack Weinberg - - * cp-tree.h: Use __FUNCTION__ not __PRETTY_FUNCTION__. - Define my_friendly_assert and my_friendly_abort as macros - which may call friendly_abort. Prototype friendly abort, not - my_friendly_abort or my_friendly_assert. - * decl.c (signal_catch): Report the signal caught in the error - message. Call fatal directly. - * typeck2.c (ack, my_friendly_assert): Delete. - (my_friendly_abort): Rename to friendly_abort. Expect file, - line, and function parameters. Report the abort code, then - call fancy_abort. Do not mask an abort if errors have - already occurred. - -2000-07-18 Nathan Sidwell - - * typeck.c (comp_target_parms): Remove obsolete parameter. - (comp_target_types): Adjust. - -2000-07-17 Jason Merrill - - * typeck.c (mark_addressable): Never set TREE_USED. - * call.c (build_call): Don't abort on calls to library functions - that have been declared normally. - - * typeck.c (build_binary_op): Fix grammar in warning. - - * exception.cc (__eh_free): Fix prototype. - - * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR. - - * decl.c (pushdecl): Handle seeing an OVERLOAD in - IDENTIFIER_NAMESPACE_VALUE. - -2000-07-16 Mark Mitchell - - * cp-tree.h (THUNK_VCALL_OFFSET): Update documentation. - * method.c (use_thunk): Correct handling of vcall offsets. - -2000-07-14 Zack Weinberg - - * .cvsignore: parse.h and parse.c have no cp- prefix. - -2000-07-13 Mark Mitchell - - * .cvsignore: New file. - -2000-07-13 Zack Weinberg - - * lang-specs.h: Use the new named specs. Remove unnecessary braces. - -2000-07-12 Mark Mitchell - - * Makefile.in ($(PARSE_H)): Depend directly on parse.y. - * parse.c: Remove. - * parse.h: Likewise. - -2000-07-11 Mark Mitchell - - * class.c (layout_class_type): Add pointers to virtual bases after - base classes under the old ABI. - -2000-07-10 Benjamin Chelf - - * semantics.c (finish_for_stmt): Remove call to emit_line_note. - (finish_continue_stmt): Likewise. - (begin_for_stmt): Remove call to note_level_for_for. - (finish_goto_stmt): Change call from build_min_nt - to build_stmt. - (finish_expr_stmt): Likewise. - (begin_if_stmt): Likewise. - (begin_while_stmt): Likewise. - (finish_while_stmt): Likewise. - (finish_return_stmt): Likewise. - (begin_for_stmt): Likewise. - (finish_for_stmt): Likewise. - (finish_break_stmt): Likewise. - (begin_switch_stmt): Likewise. - (finish_case_label): Likewise. - (genrtl_try_block): Likewise. - (begin_try_block): Likewise. - (begin_handler): Likewise. - (begin_compound_stmt): Likewise. - (finish_asm_stmt): Likewise. - (finish_label_stmt): Likewise. - (add_decl_stmt): Likewise. - (finish_subobject): Likewise. - (finish_decl_cleanup): Likewise. - (finish_named_return_value): Likewise. - (setup_vtbl_ptr): Likewise. - (add_scope_stmt): Likewise. - * decl.c (finish_constructor_body): Likewise. - (finish_destructor_body): Likewise. - * optimize.c (copy_body_r): Likewise. - (initialize_inlined_parameters): Likewise. - (declare_return_variable): Likewise. - (expand_call_inline): Likewise. - -2000-07-10 Jakub Jelinek - - * semantics.c (expand_body): Sync interface information - at the end of function body expansion. - -2000-07-09 Jason Merrill - - * init.c (build_new_1): Bail early if the call to new fails. - - * decl.c (compute_array_index_type): Check specifically for - an INTEGER_CST, not just TREE_CONSTANT. - - * decl.c (duplicate_decls): Don't call duplicate_decls on - the DECL_TEMPLATE_RESULT. - (decls_match): Return 0 if the DECL_TEMPLATE_RESULTs have different - codes. - - * error.c (dump_template_bindings): Don't crash if we had an - invalid argument list. - - * typeck.c (c_expand_start_case): Do narrowing here. - * semantics.c (finish_switch_cond): Not here. - -2000-07-09 Hidvegi Zoli - - * parse.y (asm_clobbers): Do string concatenation. - -2000-07-09 Mark Mitchell - - * decl.c (pushtag): Don't put local classes in template functions - on the local_classes list. - -2000-07-04 Scott Snyder - - * decl2.c (get_guard): Add missing return for old ABI local - variable case. - -2000-07-09 Mark Mitchell - - * cp-tree.h (char_type_p): New function. - * decl.c (init_decl_processing): Don't initialize - signed_wchar_type_node or unsigned_wchar_type_node. - (complete_array_type): Handle brace-enclosed string-constants. - * rtti.c (emit_support_tinfos): Remove #if 0'd code. - * tree.c (char_type_p): New function. - * typeck2.c (digest_init): Use char_type_p. - -2000-07-06 Nathan Sidwell - - * pt.c (tsubst): Don't layout type, if it's error_mark. - -2000-07-06 Nathan Sidwell - - * pt.c (instantiate_pending_templates): Reset template level. - -2000-07-05 Jason Merrill - - * call.c (joust): Don't complain about `operator char *()' beating - `operator const char *() const'. - -2000-07-04 scott snyder - Jason Merrill - - * repo.c (repo_get_id): Handle the case where a class with virtual - bases has a null TYPE_BINFO_VTABLE. - -2000-07-04 Kevin Buhr - Jason Merrill - - * parse.y (member_init): Just pass in the type. - * init.c (expand_member_init): Handle getting a type. - -2000-07-04 Martin v. Löwis - Jason Merrill - - * decl.c (finish_function): Warn if a function has no return - statement. - Suggested by Andrew Koenig. - * typeck.c (check_return_expr): Do set current_function_returns_value - if we got an error_mark_node. - -2000-07-03 Nathan Sidwell - - * decl2.c (push_decl_namespace): Push the original namespace. - -2000-07-03 Nathan Sidwell - - * pt.c (instantiate_class_template): Set CLASSTYPE_VBASECLASSES. - * semantics.c (begin_class_definition): Clear it. - -2000-07-02 Benjamin Chelf - - * cp-tree.h (genrtl_goto_stmt): Remove declaration. - (genrtl_expr_stmt): Likewise. - (genrtl_decl_stmt): Likewise. - (genrtl_if_stmt): Likewise. - (genrtl_while_stmt): Likewise. - (genrtl_do_stmt): Likewise. - (genrtl_return_stmt): Likewise. - (genrtl_for_stmt): Likewise. - (genrtl_break_stmt): Likewise. - (genrtl_continue_stmt): Likewise. - (genrtl_scope_stmt): Likewise. - (genrtl_switch_stmt): Likewise. - (genrtl_case_label): Likewise. - (genrtl_begin_compound_stmt): Likewise. - (genrtl_finish_compound_stmt): Likewise. - (genrtl_compound_stmt): Likewise. - (genrtl_asm_stmt): Likewise. - - * init.c (begin_init_stmts): Remove call to - genrtl_begin_compound_stmt. - (finish_init_stmts): Remove call to genrtl_finish_compound_stmt. - - * semantics.c (lang_expand_stmt): Changed call to - genrtl_compound_stmt to ignore return value. - -2000-07-02 Mark Mitchell - - * mangle.c (canonicalize_for_substitution): Return the canonical - variant of a type. - - * decl.c (duplicate_decls): Preserve DECL_ORIGINAL_TYPE for a - TYPE_DECL. - * typeck.c (commonparms): Remove obstack manipulations. - -2000-07-01 Benjamin Chelf - - * Make-lang.in (cc1plus$(exeext)): Added c-semantics.o. - - * Makefile.in (OBJS): Added ../c-semantics.o. - (OBJDEPS): Likewise. - - * cp-tree.h (TREE_LANG_FLAG_?): Moved common documentation to - ../c-common.h. - (struct stmt_tree): Added comment. - (current_function_name_declared): Removed. - (stmts_are_full_exprs_p): Likewise. - (genrtl_do_pushlevel): Likewise. - (genrtl_clear_out_block): Likewise. - (COMPOUND_STMT_NO_SCOPE): Moved to ../c-common.h. - (DECL_ANON_UNION_ELEMS): Likewise. - (emit_local_var): Likewise. - (make_rtl_for_local_static): Likewise. - (do_case): Likewise. - (expand_stmt): Likewise. - (genrtl_decl_cleanup): Likewise. - (c_expand_asm_operands): Likewise. - (c_expand_return): Likewise. - (c_expand_start_case): Likewise. - - * decl.c (make_rtl_for_local_static): Moved to c-semantics.c. - (emit_local_var): Likewise. - (initialize_local_var): Change reference to - stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). - Change reference to stmts_are_full_exprs_p to - current_stmt_tree->stmts_are_full_exprs_p. - (push_cp_function_context): Likewise. - - * expect.c (expand_throw): Change reference to - stmts_are_full_exprs_p. - - * init.c (build_aggr_init): Change reference to - stmts_are_full_exprs_p. - (build_vec_init): Likewise. - - * optimize.c (maybe_clone_body): Change reference to - current_function_name_declared to - cp_function_chain->name_declared. - - * pt.c (instantiate_decl): Change reference to - current_function_name_declared to - cp_function_chain->name_declared. - - * semantics.c (expand_cond): Moved declaration to c-common.h. - (genrtl_do_pushlevel): Moved to c-semantics.c. - (genrtl_clear_out_block): Likewise. - (genrtl_goto_stmt): Likewise. - (genrtl_expr_stmt): Likewise. - (genrtl_decl_stmt): Likewise. - (gerntl_if_stmt): Likewise. - (genrtl_while_stmt): Likewise. - (genrtl_do_stmt): Likewise. - (genrtl_return_stmt): Likewise. - (genrtl_for_stmt): Likewise. - (genrtl_break_stmt): Likewise. - (genrtl_continue_stmt): Likewise. - (genrtl_scope_stmt): Likewise. - (genrtl_switch_stmt): Likewise. - (genrtl_case_label): Likewise. - (genrtl_begin_compound_stmt): Likewise. - (genrtl_finish_compound_stmt): Likewise. - (genrtl_compound_stmt): Likewise. - (genrtl_asm_stmt): Likewise. - (genrtl_decl_cleanup): Likewise. - (expand_cond): Likewise. - (expand_stmt): Renamed to ... - (lang_expand_stmt): ... this. - (lang_expand_expr_stmt): Initialize. - (set_current_function_name_declared): Likewise. - (stmts_are_full_exprs_p): Likewise. - (current_function_name_declared): Likewise. - (anon_aggr_type_p): Likewise. - (do_poplevel): Change reference to - stmts_are_full_exprs_p to call to stmts_are_full_exprs_p(). - Change reference to stmts_are_full_exprs_p to - current_stmt_tree->stmts_are_full_exprs_p. - (add_tree): Likewise. - (finish_expr_stmt): Likewise. - (prep_stmt): Likewise. - (lang_expand_stmt): Likewise. - (begin_compound_stmt): Change reference to - current_function_name_declared to - cp_function_chain->name_declared and call to - current_function_name_declared(). - (setup_vtbl_ptr): Likewise. - (genrtl_do_poplevel): Removed. - -2000-06-30 Jason Merrill - - * init.c (init_init_processing): Go back to aligning like - double_type_node for old ABI. - (get_cookie_size): Make cookie larger if we get a type that needs - more alignment. - (build_vec_delete): Call it. - - * typeck.c (qualify_type_recursive): New fn. - (composite_pointer_type): Use it. - (build_binary_op): Use composite_pointer_type. - -2000-06-24 Carlos O'Ryan - Jason Merrill - - * typeck.c (check_return_expr): Don't complain about returning - NULL from operator new if -fcheck-new. - * cp-tree.h: Declare flag_check_new here. - * init.c: Not here. - -2000-06-28 Alex Samuel - - * mangle.c (find_substitution): Use same_type_p. - (write_encoding): Don't check for substitutions. - -2000-06-30 Nathan Sidwell - - * parse.y (expr_no_comma_rangle): New non-terminal. - (template_parm): Use it for default parameter case. - (template_arg): Use it. - (expr_no_commas): Remove commented out undefined extensions. - * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. - * parse.h, parse.c: Rebuilt. - -2000-06-30 Mark Mitchell - - * semantics.c (genrtl_asm_stmt): Don't decay input operands here. - (finish_asm_stmt): Do it here, instead. - - * cp-tree.h (ridpointers): Don't declare. - * decl.c (record_builtin_type): Use CP_RID_MAX instead of RID_MAX. - (record_builtin_java_type): Likewise. - (init_decl_processing): Likewise. - * lex.c: Move inclusion of lex.h. - (ridpointers): Don't define. - (init_parse): Initialize ripdointers. Use CP_RID_MAX instead of - RID_MAX. - * lex.h (enum rid): Rename to ... - (enum cp_rid): ... this. - (ridpointers): Don't declare. - * parse.y: Move inclusion of lex.h. - * parse.c: Regenerated. - * spew.c: Move inclusion of lex.h. - - * cp-tree.h (struct language_function): Remove temp_name_counter. - (temp_name_counter): Remove. - (get_temp_name): Change prototype. - (get_guard): New function. - (get_guard_cond): Likewise. - (set_guard): Likewise. - * cvt.c (build_up_reference): Adjust call to get_temp_name. - * decl.c (expand_static_init): Use get_guard and friends to - implement guard variables. - * decl2.c (get_temp_name): Assume that the variables created are - always static. - (get_sentry): Rename to ... - (get_guard): ... this. Implement new ABI guard variables. - (get_guard_bits): New function. - (get_guard_cond): Likewise. - (set_guard): Likewise. - (start_static_initialization_or_destruction): Use them. - (do_static_initialization): Replace sentry with guard throughout. - (do_static_destruction): Likewise. - * init.c (create_temporary_var): Add comment. - -2000-06-28 Alex Samuel - - * mangle.c (find_substitution): Use same_type_p. - (write_encoding): Don't check for substitutions. - -2000-06-30 Nathan Sidwell - - * parse.y (expr_no_comma_rangle): New non-terminal. - (template_parm): Use it for default parameter case. - (template_arg): Use it. - (expr_no_commas): Remove commented out undefined extensions. - * Makefile.in (CONFLICTS): Adjust to 33 s/r & 48 r/r. - * parse.h, parse.c: Rebuilt. - -2000-06-29 Mark Mitchell - - * cp-tree.h (flag_const_strings): Remove. - (warn_parentheses): Likewise. - (warn_format): Likewise. - (common_type): Likewise. - (default_conversion): Likewise. - (build_binary_op): Likewise. - (cp_build_binary_op): New macro. - * call.c (build_new_op): Use cp_build_binary_op instead of - build_binary_op. - * class.c (build_vtable_entry_ref): Likewise. - * decl.c (expand_static_init): Likewise. - (compute_array_index_type): Likewise. - (build_enumerator): Likewise. - * decl2.c (delete_sanity): Likewise. - (start_static_initialization_or_destruction): Likewise. - * error.c (dump_type_suffix): Likewise. - * init.c (resolve_offset_ref): Likewise. - (build_new): Likewise. - (build_new_1): Likewise. - (build_vec_delete_1): Likewise. - (build_vec_init): Likewise. - (build_delete): Likewise. - * rtti.c (synthesize_tinfo_fn): Likewise. - (synthesize_tinfo_var): Likewise. - * search.c (expand_upcast_fixups): Likewise. - (fixup_all_virtual_upcast_offsets): Likewise. - * typeck.c (build_array_ref): Likewise. - (get_member_function_from_ptrfunc): Likewise. - (build_binary_op): Add parameter. - (pointer_int_sum): Use cp_build_binary_op. - (pointer_diff): Likewise. - (build_modify_expr): Likewise. - (get_delta_difference): Likewise. - (build_ptrmemfunc): Likewise. - -2000-06-29 Nathan Sidwell - - * cp-tree.h (SET_DECL_ARTIFICIAL): Remove. - * decl.c (create_implicit_typedef): Adjust. - * decl2.c (build_artificial_parm): Adjust. - * method.c (implicitly_declare_fn): Adjust. - * pt.c (push_inline_template_parms_recursive): Adjust. - (process_template_parm): Adjust. - (overloaded_template_name): Adjust. - * semantics.c (finish_template_template_parm): Adjust. - -2000-06-28 Mark Mitchell - - * cp-tree.h (CLEAR_BINFO_NEW_VTABLE_MARKED): Remove. - * class.c (update_vtable_entry_for_fn): Correct logic for deciding - where to emit thunks. - (build_vtt): Adjust call to build_vtt_inits. - (build_vtt_inits): Add parameter to indicate whether or not - sub-VTTs for virtual bases should be included. Adjust handling of - construction vtables. - (get_matching_base): New function. - (dfs_build_vtt_inits): Rename to ... - (dfs_build_secondary_vptr_vtt_inits): Adjust handling of - construction vtables. - (dfs_fixup_binfo_vtbls): Likewise. - (build_ctor_vtbl_groups): Build construction vtables for virtual - bases, too. - (accumulate_vtbl_inits): Tweak logic for deciding whether or not - to build construction vtbls. - (dfs_accumulate_vtbl_inits): Adjust handling of - construction vtables. - - * pt.c (tsubst, case TEMPLATE_TEMPLATE_PARM): Handle cv-qualified - types correctly. - -2000-06-27 Mark Mitchell - - * decl.c (grokfndecl): Set DECL_CONTEXT for static functions too. - -2000-06-26 Nathan Sidwell - - * search.c (hides): Remove. - (is_subobject_of_p): Add most_derived parameter. Use - CANONICAL_BINFO. - (lookup_field_queue_p): Adjust. - (lookup_field_r): Adjust. - -2000-06-26 Nathan Sidwell - - * decl2.c (handle_class_head): Bash typedefs to the type's main - decl. - -2000-06-25 Mark Mitchell - - * cp-tree.h (genrtl_begin_stmt_expr): Rename to ... - (begin_global_stmt_expr): ... this. - (genrtl_finish_stmt_expr): Rename to ... - (finish_global_stmt_expr): ... this. - * init.c (begin_init_stmts): Adjust calls. - (finish_init_stmts): Likewise. - * semantics.c (genrtl_begin_stmt_expr): Rename to ... - (begin_global_stmt_expr): ... this. - (genrtl_finish_stmt_expr): Rename to ... - (finish_global_stmt_expr): ... this. - -2000-06-25 Theodore Papadopoulo - - * search.c (lookup_member): Fix typo in comment. - -2000-06-24 Jason Merrill - - * decl.c (pushdecl): Don't set DECL_CONTEXT from current_namespace. - (push_namespace): Set DECL_CONTEXT for a new NAMESPACE_DECL. - -2000-06-24 Martin v. Löwis - - * parse.y (complex_direct_notype_declarator): Support global_scope. - * Makefile.in: Adjust conflict count. - -2000-06-23 Kriang Lerdsuwanakij - - * parse.y (template_arg): Convert TEMPLATE_DECL - that is a template template parameter to - TEMPLATE_TEMPLATE_PARM here. - - * cp-tree.def (TEMPLATE_TEMPLATE_PARM): Adjust comment. - * cp-tree.h (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL): New macro. - (copy_template_template_parm): Adjust prototype. - * decl.c (grokdeclarator): Remove dead code. - * pt.c (process_template_parm): Tidy. - (lookup_template_class): Construct nodes in - copy_template_template_parm. - (tsubst): Pass TEMPLATE_DECL rather than IDENTIFIER_NODE to - lookup_template_class. Use TYPE_TI_TEMPLATE. - * tree.c (copy_template_template_parm): Add NEWARGS - parameter. - (mapcar): Adjust call to copy_template_template_parm. - * typeck.c (comptypes): Use TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL. - * method.c (build_template_template_parm_names): Change error - code to avoid compilation warning. - - * gxxint.texi: Document template template parameter - name mangling. - -2000-06-21 Alex Samuel - - * Make-lang.in (CXX_LIB2FUNCS): Add cp-demangle.o and dyn-string.o. - (CXX_LIB2SRCS): Add cp-demangle.c and dyn-string.c. - (cp-demangle.o): New rule. - (dyn-string.o): Likewise. - * inc/cxxabi.h (__cxa_demangle): New declaration. - -2000-06-22 Mark Mitchell - - * cp-tree.h (BV_USE_VCALL_INDEX_P): New macro. - (BV_GENERATE_THUNK_WITH_VTABLE_P): Likewise. - (lang_decl_flags): Add generate_with_vtable_p. Make vcall_offset - a tree, not an int. - (THUNK_GENERATE_WITH_VTABLE_P): New macro. - (make_thunk): Change prototype. - (emit_thunk): Rename to use_thunk. - (mangle_thunk): Change prototype. - * class.c (get_derived_offset): Simplify. - (copy_virtuals): Clear BV_USE_VCALL_INDEX_P and - BV_GENERATE_THUNK_WITH_VTABLE_P. - (build_primary_vtable): Simplify. - (add_virtual_function): Use BV_FN, rather than TREE_VALUE. - (dfs_find_base): Remove. - (update_vtable_entry_for_fn): Correct bug in finding the base - where a virtual function was first declared. Figure out whether - or not to emit a vcall-thunk with the vtables in which it appears. - Correct logic for deciding whether to use an ordinary thunk, or a - vcall thunk. - (finish_struct_1): Remove unnecssary code. - (build_vtbl_initializer): Use ssize_int for the running counter of - negative indices. - (build_vtbl_initializer): Only use vcall thunks where necessary. - Mark thunks as needing to be emitted with their vtables, or not. - (build_vbase_offset_vtbl_entries): Adjust for use of ssize_int in - indices. Use size_binop. - (dfs_build_vcall_offset_vtbl_entries): Don't rely on - BINFO_PRIMARY_MARKED_P here. Use BV_FN consistently. Use - size_binop. - (build_rtti_vtbl_entries): Adjust call to build_vtable_entry. - (build_vtable_entry): Mark thunks as needing to be emitted with - their vtables, or not. - * decl.c (lang_mark_tree): Mark the vcall_offset in a thunk. - * decl2.c (mark_vtable_entries): Use use_thunk instead of - emit_thunk. - * dump.c (dequeue_and_dump): Remove dead code. Dump new thunk - information. - * error.c (dump_expr): Use BV_FN. - * mangle.c (mangle_thunk): Adjust now that vcall_offset is a tree, - not an int. - * method.c (make_thunk): Likewise. - (emit_thunk): Rename to use_thunk. Allow callers to decide - whether or not to actually emit the thunk. Adjust for changes in - representation of vcall offsets. - * search.c (dfs_get_pure_virtuals): Use BV_FN. - * semantics.c (emit_associated_thunks): New function. - (expand_body): Use it. - * ir.texi: Adjust descriptions of thunks. - -2000-06-22 Jason Merrill - - * pt.c (tsubst_decl, case FUNCTION_DECL): Clear DECL_SAVED_TREE. - (tsubst_friend_function): Copy it here. - - * decl.c (grok_op_properties): Fix typo. - - * decl2.c (delete_sanity): Clarify warning, avoid failure on - deleting void*. - - * pt.c (check_explicit_specialization): Clarify error. - - * decl.c (pushdecl): Also pull out one of the FUNCTION_DECLs from - an old OVERLOAD when we're declaring a non-function. - (pushdecl, destroy_local_var): Check for error_mark_node. - (warn_extern_redeclared_static): Also bail early if - we're a CONST_DECL. - (push_overloaded_decl): Ignore an old error_mark_node. - -2000-06-22 Nathan Sidwell - - * call.c (build_x_va_arg): Check if in a template decl. - * pt.c (tsubst_copy, case VA_ARG_EXPR): Use build_x_va_arg. - -2000-06-20 Alexandre Petit-Bianco - - * class.c (push_lang_context): TYPE_NAME gets you to the Java - types DECLs. - * decl.c (check_goto): Computed gotos assumed OK. - -2000-06-20 Jason Merrill - - * pt.c (tsubst_decl, case TYPE_DECL): Fix test for TYPE_DECLs - for which we don't need to look for instantiations. - -2000-06-21 Nathan Sidwell - - * parse.y (program): Always call finish_translation_unit. - * parse.c, parse.h: Rebuilt. - -2000-06-20 Zack Weinberg - - * method.c: Don't include hard-reg-set.h. - -2000-06-20 Nathan Sidwell - - * rtti.c (get_base_offset): Cope when vbase field is in a base. - -2000-06-20 Nathan Sidwell - - * call.c (build_conditional_expr): Use VOID_TYPE_P. - * cvt.c (cp_convert_to_pointer): Likewise. - (convert_to_void): Likewise. - * error.c (dump_expr): Likewise. - * except.c (complete_ptr_ref_or_void_ptr_p): Likewise. - * init.c (build_delete): Likewise. - * method.c (emit_thunk): Likewise. - * optmize.c (declare_return_variable): Likewise. - * rtti.c (get_tinfo_decl_dynamic): Likewise. - (get_typeid): Likewise. - (build_dynamic_cast_1): Likewise. - * typeck.c (composite_pointer_type): Likewise. - (common_type): Likewise. - (build_indirect_ref): Likewise. - (build_binary_op): Likewise. - (build_x_compound_expr): Likewise. - (check_return_expr): Likewise. - * typeck2.c (add_exception_specifier): Likewise. - - * mangle.c (write_method_parms): Use direct comparison for end - of parmlist. - -2000-06-19 Benjamin Chelf - - * cp-tree.h (genrtl_try_block): Declare function. - (genrtl_handler): Likewise. - (genrtl_catch_block): Likewise. - (genrtl_ctor_stmt): Likewise. - (genrtl_subobject): Likewise. - (genrtl_decl_cleanup): Likewise. - (genrtl_do_poplevel): Likewise. - (genrtl_do_pushlevel): Likewise. - (genrtl_clear_out_block): Likewise. - (genrtl_goto_stmt): Likewise. - (genrtl_expr_stmt): Likewise. - (genrtl_decl_stmt): Likewise. - (genrtl_if_stmt): Likewise. - (genrtl_while_stmt): Likewise. - (genrtl_do_stmt): Likewise. - (genrtl_return_stmt): Likewise. - (genrtl_for_stmt): Likewise. - (genrtl_break_stmt): Likewise. - (genrtl_continue_stmt): Likewise. - (genrtl_scope_stmt): Likewise. - (genrtl_switch_stmt): Likewise. - (genrtl_case_label): Likewise. - (genrtl_begin_compound_stmt): Likewise. - (genrtl_finish_compound_stmt): Likewise. - (genrtl_compound_stmt): Likewise. - (genrtl_asm_stmt): Likewise. - (genrtl_named_return_value): Likewise. - (genrtl_begin_stmt_expr): Likewise. - (genrtl_finish_stmt_expr): Likewise. - (finish_for_stmt): Removed first argument. - (finish_switch_stmt): Likewise. - - * semantics.c (genrtl_try_block): Define function. - (genrtl_handler): Likewise. - (genrtl_catch_block): Likewise. - (genrtl_ctor_stmt): Likewise. - (genrtl_subobject): Likewise. - (genrtl_decl_cleanup): Likewise. - (genrtl_do_poplevel): Likewise. - (genrtl_do_pushlevel): Likewise. - (genrtl_clear_out_block): Likewise. - (genrtl_goto_stmt): Likewise. - (genrtl_expr_stmt): Likewise. - (genrtl_decl_stmt): Likewise. - (genrtl_if_stmt): Likewise. - (genrtl_while_stmt): Likewise. - (genrtl_do_stmt): Likewise. - (genrtl_return_stmt): Likewise. - (genrtl_for_stmt): Likewise. - (genrtl_break_stmt): Likewise. - (genrtl_continue_stmt): Likewise. - (genrtl_scope_stmt): Likewise. - (genrtl_switch_stmt): Likewise. - (genrtl_case_label): Likewise. - (genrtl_begin_compound_stmt): Likewise. - (genrtl_finish_compound_stmt): Likewise. - (genrtl_compound_stmt): Likewise. - (genrtl_asm_stmt): Likewise. - (genrtl_named_return_value): Likewise. - (genrtl_begin_stmt_expr): Likewise. - (genrtl_finish_stmt_expr): Likewise. - (finish_for_stmt): Removed first argument and generate rtl - specific code. - (finish_switch_stmt): Likewise. - (do_poplevel): Removed generate rtl specific code. - (do_pushlevel): Likewise. - (add_tree): Likewise. - (finish_goto_stmt): Likewise. - (finish_expr_stmt): Likewise. - (begin_if_stmt): Likewise. - (finish_if_stmt_cond): Likewise. - (finish_then_clause): Likewise. - (begin_else_clause): Likewise. - (finish_else_clause): Likewise. - (finish_if_stmt): Likewise. - (clear_out_block): Likewise. - (begin_while_stmt): Likewise. - (finish_while_stmt_cond): Likewise. - (finish_while_stmt): Likewise. - (begin_do_stmt): Likewise. - (finish_do_body): Likewise. - (finish_do_stmt): Likewise. - (finish_return_stmt): Likewise. - (begin_for_stmt): Likewise. - (finish_for_init_stmt): Likewise. - (finish_for_cond): Likewise. - (finish_for_expr): Likewise. - (finish_break_stmt): Likewise. - (finish_continue_stmt): Likewise. - (begin_switch_stmt): Likewise. - (finish_switch_cond): Likewise. - (finish_case_label): Likewise. - (begin_try_block): Likewise. - (begin_function_try_block): Likewise. - (finish_try_block): Likewise. - (finish_cleanup_try_block): Likewise. - (finish_cleanup): Likewise. - (finish_function_try_block): Likewise. - (finish_handler_sequence): Likewise. - (finish_function_handler_sequence): Likewise. - (begin_handler): Likewise. - (finish_handler_parms): Likewise. - (begin_catch_block): Likewise. - (finish_handler): Likewise. - (begin_compound_stmt): Likewise. - (finish_compound_stmt): Likewise. - (finish_asm_stmt): Likewise. - (finish_label_stmt): Likewise. - (finish_label_decl): Likewise. - (finish_subobject): Likewise. - (finish_decl_cleanup): Likewise. - (finish_named_return_value): Likewise. - (begin_stmt_expr): Likewise. - (finish_stmt_expr): Likewise. - - * decl.c (initialize_local_var): Changed call to finish_expr_stmt - to call genrtl_expr_stmt when appropriate. - - * init.c (begin_init_stmts): Changed calls to begin_stmt_expr and - begin_compound_expr to call genrtl_begin_stmt_expr and - genrtl_begin_compound_expr when appropriate. - (finish_init_stmts): Changed calls to finish_compound_expr and - finish_stmt_expr to call genrtl_finish_compound_expr and - genrtl_finish_stmt_expr when appropriate. - (expand_default_init): Changed call to finish_expr_stmt to call - genrtl_expr_stmt when appropriate. - (build_vec_init): Likewise. - - * parse.y (simple_stmt): Removed first argument from call to - finish_for_stmt. Removed first argument from call to - finish_switch_stmt. - - * parse.c: Regenerated. - - * pt.c (tsubst_expr): Removed first argument from call to - finish_for_stmt. Removed first argument from call to - finish_switch_stmt. - -2000-06-16 Benjamin Chelf - - * cp-tree.h (enum cplus_tree_code): Changed __DUMMY to - CP_DUMMY_TREE_CODE. Remove #include "c-common.def". - - * lex.c (cplus_tree_code_type[]): Removed #include "c-common.def". - (cplus_tree_code_length[]): Likewise. - (cplus_tree_code_name[]): Likewise. - (init_parse): Added call to add_c_tree_codes. Changed - LAST_AND_UNUSED_TREE_CODE to LAST_C_TREE_CODE. - -2000-06-16 Mark Mitchell - - * cp-tree.h (finish_mem_initializers): Declare. - (count_trees): Likewise. - * parse.y (base_init): Use finish_mem_initializers. - * semantics.c (finish_mem_initializers): New function. - - * tree.c (count_trees_r): Prototype. Use DATA parameter to store - the number of trees. - (n_trees): Remove. - (count_trees): Don't use it. - -2000-06-15 Jason Merrill - - * tree.c (count_trees): New debugging function. - - * typeck.c (build_x_function_call): Use DECL_FUNCTION_TEMPLATE_P. - * init.c (build_member_call): Pull out the name of a DECL. - - * Makefile.in (semantics.o, pt.o): Depend on TIMEVAR_H. - * semantics.c (expand_body): Push to TV_INTEGRATION here. - * optimize.c (optimize_function): Not here. - * pt.c (instantiate_decl): Push to TV_PARSE. - -2000-06-15 Mark Mitchell - - * cp-tree.h (struct language_function): Remove x_base_init_list - and x_member_init_list. - (current_base_init_list): Remove. - (current_member_init_list): Likewise. - (setup_vtbl_ptr): Change prototype. - (emit_base_init): Likewise. - (expand_member_init): Likewise. - (reinit_parse_for_function): Remove. - * decl.c (save_function_data): Don't clear x_base_init_list and - x_member_init_list. - (mark_language_function): Don't mark them. - * init.c (perform_member_init): Tweak comment. - (sort_member_init): Take the list of initializers as an argument. - (sort_base_init): Likewise. - (emit_base_init): Likewise. - (expand_member_init): Return the initializer. Don't use global - variables. - * lex.c (reinit_parse_for_function): Remove. - * method.c (build_template_parm_names): Correct substitution. - (do_build_copy_constructor): Don't use current_member_init_list - and current_base_init_list. - (synthesize_method): Likewise. - * parse.y (base_init): Split mem-initializers into - base-initializers and field-initializers. - (member_init_list): Build up the list here. - (member_init): Return the initializer. - (fn.depfn): Don't use reinit_parse_for_function. - * parse.c: Regenerated. - * pt.c (convert_nontype_argument): Don't make an ADDR_EXPR of the - ERROR_MARK. - (tsubst_expr): Don't use current_member_init_list - and current_base_init_list. - (tsubst_expr_values): Rename to ... - (tsubst_initializer_list): ... this. Use convert_from_reference. - * semantics.c (setup_vtbl_ptr): Don't use current_member_init_list - and current_base_init_list. - (begin_function_definition): Don't call reinit_parse_for_function. - - * dump.c (dequeue_and_dump): Use TREE_VEC_LENGTH with vectors. - - * error.c (dump_expr): Handle ADDR_EXPRs with REFERENCE_TYPE - correctly. - - * cp-tree.h (DECL_PENDING_INLINE_P): Relax checking. - -2000-06-14 Benjamin Chelf - - * cp-tree.h (IF_COND): Move to c-common.h. - (THEN_CLAUSE): Likewise. - (ELSE_CLAUSE): Likewise. - (WHILE_COND): Likewise. - (WHILE_BODY): Likewise. - (DO_COND): Likewise. - (DO_BODY): Likewise. - (RETURN_EXPR): Likewise. - (EXPR_STMT_EXPR): Likewise. - (FOR_INIT_STMT): Likewise. - (FOR_COND): Likewise. - (FOR_EXPR): Likewise. - (FOR_BODY): Likewise. - (SWITCH_COND): Likewise. - (SWITCH_BODY): Likewise. - (CASE_LOW): Likewise. - (CASE_HIGH): Likewise. - (GOTO_DESTINATION): Likewise. - (COMPOUND_BODY): Likewise. - (ASM_CV_QUAL): Likewise. - (ASM_STRING): Likewise. - (ASM_OUTPUTS): Likewise. - (ASM_INPUTS): Likewise. - (ASM_CLOBBERS): Likewise. - (DECL_STMT_DECL): Likewise. - (STMT_EXPR_STMT): Likewise. - (LABEL_STMT_LABEL): Likewise. - (SCOPE_BEGIN_P): Likewise. - (SCOPE_END_P): Likewise. - (SCOPE_STMT_BLOCK): Likewise. - (SCOPE_NULLIFIED_P): Likewise. - (SCOPE_NO_CLEANUPS_P): Likewise. - (SCOPE_PARTIAL_P): Likewise. - (ASM_VOLATILE_P): Likewise. - (STMT_LINENO): Likewise. - (STMT_LINENO_FOR_FN_P): Likewise. - - * cp-tree.def: Removed SRCLOC, SIZEOF_EXPR, ARROW_EXPR, - ALIGNOF_EXPR, EXPR_STMT, COMPOUND_STMT, DECL_STMT, IF_STMT, - FOR_STMT, WHILE_STMT, DO_STMT, RETURN_STMT, BREAK_STMT, - CONTINUE_STMT, SWITCH_STMT, GOTO_STMT, LABEL_STMT, ASM_STMT, - SCOPE_STMT, CASE_LABEL, STMT_EXPR. - - * Makefile.in (CXX_TREE_H): Added $(srcdir)/../c-common.def. - - * Make-lang.in (CXX_SRCS): Added $(srcdir)/c-common.def. - (cc1plus$(exeext)): Added $(srcdir)/c-common.def. - - * lex.c (cplus_tree_code_type[]): Added '#include "c-common.def"'. - (cplus_tree_code_length[]): Added '#include "c-common.def"'. - (cplus_tree_code_name[]): Added '#include "c-common.def"'. - -2000-06-14 Mark Mitchell - - * cp-tree.h (BINFO_OVERRIDE_ALONG_VIRTUAL_PATH): New macro. - * class.c (dfs_find_final_overrider): Set it appropriately. - (dfs_built_vtt_inits): Check BINFO_OVERRIDE_ALONG_VIRTUAL_PATH to - avoid unneeded secondary vptrs. - -2000-06-13 Jakub Jelinek - - * class.c (build_secondary_vtable): Set DECL_USER_ALIGN. - (check_bitfield_decl, check_field_decl): Likewise. - (build_vtbl_or_vbase_field, build_base_field): Likewise. - (layout_class_type): Set DECL_USER_ALIGN resp. CLASSTYPE_USER_ALIGN. - * decl.c (record_unknown_type): Set TYPE_USER_ALIGN. - (xfer_tag, finish_enum): Likewise. - * decl2.c (finish_builtin_type): Likewise. - * init.c (init_init_processing): Likewise. - * pt.c (instantiate_class_template): Likewise. - * rtti.c (get_tinfo_decl, synthesize_tinfo_fn): Set DECL_USER_ALIGN. - * cp-tree.h (struct lang_type): Add user_align member. - (CLASSTYPE_USER_ALIGN): Define. - -2000-06-13 Maciej W. Rozycki - - * Make-lang.in (c++.install-common): Install g++-cross in - $(gcc_tooldir)/bin as g++ and c++; g++ in $(bindir) as - $(target_alias)-g++ and $(target_alias)-c++. - -2000-06-12 Mark Mitchell - - * class.c (vcall_offset_data_s): Add last_init and fns. - (overrides): Rename to same_signature_p. - (dfs_find_final_overrider): Adjust accordingly. - (mark_overriders): Likewise. - (warn_hidden): Likewise. - (build_vtbl_initializer): Reorganize machinery for building things - at negative offsets. - (build_vcall_and_vbase_vtbl_entries): Likewise. - (build_vbase_offset_vtbl_entries): Likewise. - (dfs_build_vcall_offset_vtbl_entries): Correct order of vcall - offset entries. Do not create two entries for functions with the - same signature. - (build_vcall_offset_vtbl_entries): Initialize vod->fns. - (build_rtti_vtbl_entries): Reorganize machinery for building things - at negative offsets. - - * optimize.c (expand_call_inline): Don't recurse into the code - used to initialize the parameters more than once. - -2000-06-11 Mark Mitchell - - * mangle.c (NESTED_TEMPLATE_MATCH): Fix typo in comment. - (is_std_substitution): Don't check CLASSTYPE_USE_TEMPLATE here. - (find_substitution): Only use the `Sa' substitution for - std::allocator, not instantiations of it. - (write_template_prefix): Move comment. Only use a TREE_LIST to - represent substitutions for a member template. - (write_array_type): Mangle array dimensions correctly. - * optimize.c (maybe_clone_body): Copy more information from the - cloned function. - * pt.c (regenerate_decl_from_template): Preserve DECL_USE_TEMPLATE - on the regenerated declaration. - -2000-06-11 Chip Salzenberg - Mark Mitchell - - * class.c (build_vtable): Clarify comment. - (build_ctor_vtbl_group): Pass the most derived type to - build_vtable. - -2000-06-11 Kaveh R. Ghazi - - * decl2.c (compare_options): Don't needlessly cast away const-ness. - -2000-06-10 Mark Mitchell - - * decl.c (add_binding): Handle duplicate declarations of external - variables. - -2000-06-09 Chip Salzenberg - Mark Mitchell - - * mangle.c (write_number): Take an unsigned HOST_WIDE_INT as an - argument. - (write_signed_number): New macro. - (write_unsigned_number): Likewise. - (write_source_name): Use them. - (write_number): Handle signed and unsigned values. - (write_integer_cst): Use tree_int_cst_sgn, and use - write_unsigned_number or write_signed_number as appropriate. - (write_discriminator): Use write_unsigned_number or - write_signed_number as appropriate. - (write_template_arg_literal): Likewise. - (write_array_type): Use tree_low_cst. - (write_template_parm): Use write_unsigned_number or - write_signed_number as appropriate. - (write_substitution): Adjust call to write_number. - (write_type): Get the TYPE_MAIN_VARIANT before mangling it. - (write_expression): Handle non-type template arguments of - reference type correctly. - (mangle_thunk): Use write_signed_number. - -2000-06-09 Chip Salzenberg - - * mangle.c (find_substition): Don't mangle objects with typename - substitutions (e.g. "cin" as "Si"). - -2000-06-09 Zack Weinberg - - * call.c (add_candidate): Use ggc_alloc_cleared. - * decl.c (lookup_label): Likewise. - * lex.c (retrofit_lang_decl): Likewise. - -2000-06-09 Jason Merrill - - * semantics.c (expand_body): Push to TV_EXPAND. - * optimize.c (optimize_function): Push to TV_INTEGRATION. - * decl.c (start_function): Always call announce_function. - - * tinfo2.cc: Just declare abort. - -2000-06-09 Gabriel Dos Reis - - * lex.c (DEF_OPERATOR): Say `operator@' -not- `operator @' - whenever @ is a symbolic name. - -2000-06-08 Jakub Jelinek - - * method.c (make_thunk): Clear DECL_VTT_PARM in thunk. - -2000-06-07 Mark Mitchell - - * decl.c (pushdecl): Look up functions by DECL_NAME, not - DECL_ASSEMBLER_NAME. - -2000-06-06 Mark Mitchell - - * decl2.c (c_language): Define. - -2000-06-06 Gabriel Dos Reis - - * lex.c (lang_init_options): Tweak. - - * decl2.c: Remove #inclusion of diagnostic.h - (lang_decode_option): Move diagnostic formatting options to - toplevel. - - * lang-options.h: Remove documentation for diagnostic options. - - * Makefile.in (lex.o): Depends upon diagnostic.h - -2000-06-06 Mark Mitchell - - * decl.c (redeclaration_error_message): If two TEMPLATE_DECLs have - the same DECL_RESULT, it's not a redefinition. - * pt.c (tsubst_decl): Remove code to handle illegal - specializations. - -2000-06-06 Nathan Sidwell - - * exception.cc: (__eh_alloc, __eh_free): Moved to libgcc2.c - -2000-06-05 Jason Merrill - - * search.c (maybe_suppress_debug_info): Don't check - CLASSTYPE_INTERFACE_ONLY if CLASSTYPE_INTERFACE_KNOWN isn't set. - - * pt.c (mark_decl_instantiated): Do SET_DECL_EXPLICIT_INSTANTIATION - here if extern_p. - - Remember instantiation context in deferred instantiations. - * cp-tree.h (struct tinst_level): Remove. - (TINST_DECL, TINST_LINE, TINST_FILE): New macros. - * pt.c (current_tinst_level): Now a tree. - (print_template_context, push_tinst_level, pop_tinst_level, - tinst_for_decl): Adjust. - (reopen_tinst_level): New fn. - (init_pt): Register current_tinst_level as a root. - (add_pending_template): Put current_tinst_level in TREE_PURPOSE - of the pending templates list. - (instantiate_pending_templates): Adjust. Call reopen_tinst_level. - * lex.c (extract_interface_info): Adjust. - * decl2.c (warn_if_unknown_interface): Adjust. - -2000-06-05 Mark Mitchell - - * class.c (indirect_primary_base_p): New function. - (determine_primary_base): Use it. - -2000-06-05 Nathan Sidwell - - Update new-abi dynamic cast algorithm. - * tinfo.cc (__class_type_info::__dyncast_result): Add - whole_details. Adjust constructor. - (__vmi_class_type_info::__do_dyncast): Adjust for vmi_flags. - Avoid unnecessary searching. - (__dynamic_cast): Adjust for __dyncast_result::whole_details. - -2000-06-05 Richard Kenner - - * decl.c (init_decl_processing): Don't call record_component_aliases. - * tree.c (build_cplus_array_type_1): Likewise. - -2000-06-04 Mark Mitchell - - * ir.texi: Correct typo. - * mangle.c (write_expression): Handle non-type template arguments - with reference type. - * method.c (build_overload_value): Likewise. - * pt.c (convert_nontype_argument): Explicitly represent conversion - to a reference with an ADDR_EXPR. - (unify): Always unify arguments in left-to-right order. - -2000-06-03 Alex Samuel - Mark Mitchell - - * Make-lang.in (CXX_SRCS): Add mangle.c. - * Makefile.in (CXX_OBJS): Add mangle.o. - (mangle.o): New rule. - - * class.c (local_classes): New variable. - * class.c (get_vtable_name): Use mangle_vtable_for_type for new ABI. - (get_vtt_name): Use mangle_vtt_name for new ABI. - (init_class_processing): Initialize local_classes. - (build_ctor_vtbl_group): Use mangle_ctor_vtbl_for_type for new ABI. - * cp-tree.h (cp_tree_index): Add CPTI_STD_IDENTIFIER. - (std_identifier): New macro. - (DECL_VOLATILE_MEMFUNC_P): New macro. - (DECL_NAMESPACE_STD_P): Likewise. - (local_classes): Declare. - (get_mostly_instantiated_function_type): Declare. - (init_mangle): Declare. - (mangle_decl): Likewise. - (mangle_type_string): Likewise. - (mangle_type): Likewise. - (mangle_typeinfo_for_type): Likewise. - (mangle_typeinfo_string_for_type): Likewise. - (mangle_vtbl_for_type): Likewise. - (mangle_vtt_for_type): Likewise. - (mangle_ctor_vtbl_for_type): Likewise. - (mangle_thunk): Likewise. - (mangle_conv_op_name_for_type): Likewise. - (mangle_guard_variable): Likewise. - * decl.c (pushtag): Keep track of local classes. - (initialize_predefined_identifiers): Initialize std_identifier. - (init_decl_processing): Use std_identifier. - (start_decl): Don't treat instantiations as specializations. - (grokdeclarator): Likewise. - (grokvardecl): Call mangle_decl for new ABI. Only set mangled - name for fully-instantiated templates. - * decl2.c (grokclassfn): Use set_mangled_name_for_decl for - destructors with the new ABI. - (finish_static_data_member_decl): Use mangle_decl under the new ABI. - (grokfield): Use mangle_type for new ABI. - (grokoptypename): Use mangle_conv_op_for_type for new ABI. - (get_sentry): Use mangle_guard_variable for new ABI. - (start_static_initialization_or_destruction): Likewise. - * expr.c (extract_aggr_init): Remove. - (extract_scalar_init): Likewise. - (extract_init): Remove #if 0'd code. - * mangle.c: New function. - * method.c (build_mangled_name): Assert not flag_new_abi. - (build_static_name): Likewise. - (build_decl_overload_real): Likewise. - (build_typename_overload): Likewise. - (build_overload_with_type): Likewise. - (build_overload_name): Likewise. - (get_ctor_vtbl_name): Likewise. - (start_squangling): Likewise. - (get_id_2): Likewise. - (set_mangled_name_for_decl): Call mangle_decl for new ABI. - (init_method): Call init_mangle for new ABI. - (make_thunk): Call mangle_thunk for new ABI. - * operators.def: Correct new ABI manglings for the `%' operator. - Add `::' operator. - * pt.c (build_template_decl): Copy DECL_OVERLOADED_OPERATOR_P and - DECL_ASSIGNMENT_OPERATOR_P to the TEMPLATE_DECL. - (lookup_template_class): Call mangle_decl for new ABI. - (get_mostly_instantiated_function_type): New function. - (set_mangled_name_for_template_decl): Use it. - (tsubst_decl): Use set_mangled_name_for_decl for destructors with - the new ABI. Use mangle_conv_op_name_for_type for instantiated - conversion op names. - * rtti.c (tinfo_name): Call mangle_type_string for new ABI. - (get_tinfo_decl): Call mangle_typeinfo_for_type for new ABI. - (tinfo_base_init): Likewise. Mangle typeinfo string name with - mangle_typeinfo_string_for_type. - -2000-06-03 Mark Mitchell - - * cp-tree.h (TMPL_ARGS_LEVEL): Clarify comment. - (INNERMOST_TEMPLATE_ARGS): New macro. - (innermost_args): Remove. - (get_innermost_template_args): New function. - * decl2.c (arg_assoc_class): Use INNERMOST_TEMPLATE_ARGS. - * error.c (dump_function_decl): Be caution when using - most_general_template. - * method.c (build_template_parm_names): Use - INNERMOST_TEMPLATE_ARGS. - * pt.c (add_to_template_args): Tidy comment - (get_innermost_template_args): New function. - (check_explicit_specialization): Clear DECL_INITIAL for a new - specialization. - (process_partial_specialization): Use INNERMOST_TEMPLATE_ARGS. - Tidy. - (push_template_decl): Always register specializations of the most - general template. - (convert_template_argument): Use INNERMOST_TEMPLATE_ARGS. - (coerce_template_parms): Likewise. - (lookup_template_class): Likewise. - (innermost_args): Remove. - (tsubst_decl): Use INNERMOST_TEMPLATE_ARGS. - (tsubst_decl): Handle tricky specializations. Use - get_innermost_template_args. - (instantiate_template): Simplify handling of partial - instantiations. - (get_class_bindings): Use INNERMOST_TEMPLATE_ARGS. - (most_general_template): Reimplement, in a more straightforward - manner. - (regenerate_decl_from_template): Tweak formatting. Use - TMPL_ARGS_DEPTH for clarity. - (set_mangled_name_for_template_decl): Use INNERMOST_ARGS. - - * dump.c (dequeue_and_dump): Dump information about thunks. - -2000-06-01 Richard Henderson - - * decl.c (init_decl_processing): Set lang_get_alias_set first thing. - -2000-06-01 Richard Henderson - - * decl2.c (unsupported_options): Fix typo, make const. - (lang_decode_option): Fix bsearch argument order. - -2000-06-01 Mark Mitchell - - * init.c (resolve_offset_ref): Remove check for TREE_ADDRESSABLE - on FIELD_DECLs. - -2000-05-31 Richard Kenner - - * cp-tree.h (c_get_alias_set): Deleted. - * Makefile.in (decl.o): Include ../expr.h. - * decl.c (expr.h): Include. - (init_decl_processing): Call record_component_aliases for arrays. - (grokdeclarator): Likewise. - Set TREE_ADDRESSABLE for fields that aren't bitfields. - * tree.c (build_cplus_array_type_1): Call record_component_aliases. - -2000-05-31 Mark Mitchell - - Remove guiding declaration support. - * cp/cp-tree.h (flag_dump_translation_unit): Make it const. - (flag_guiding_decls): Remove. - * call.c (build_user_type_conversion_1): Remove support for - guiding decls. - (build_new_function_call): Likewise. - (build_new_op): Likewise. - (build_new_method_call): Likewise. - * decl.c (start_function): Likewise. - * friend.c (is_friend): Likewise. - (do_friend): Likewise. - * decl2.c ((flag_dump_translation_unit): Make it const. - (flag_guiding_decls): Remove. - (unsupported_options): New variable - (compare_options): New function. - (lang_decode_option): Use them. - - * decl.c (build_cp_library_fn): Set DECL_CONTEXT. - - * method.c (mangle_expression): Adjust test for legal expression - operators. - - * pt.c (instantiate_decl): Save and restore the local - specializations list. - -2000-05-30 Jason Merrill - - * decl.c (grok_reference_init): Pass LOOKUP_ONLYCONVERTING. - -2000-05-30 Mark Mitchell - - * call.c (add_template_candidate_real): Handle member template - constructors for classes with virtual bases. - (build_user_type_conversion_1): Use in_charge_arg_for_name. - (build_new_method_call): Use DECL_NONSTATIC_MEMBER_FUNCTION_P. - - * ir.texi: Update thunk documentation. - - * call.c (joust): Fix handling of overloaded builtin operators. - -2000-05-30 Zack Weinberg - - * cp-tree.h (DECL_ANTICIPATED): New macro. - Document new use of DECL_LANG_FLAG_7. - * decl.c (builtin_function): Set DECL_ANTICIPATED on builtins - in the user namespace. - * lex.c (do_identifier): If the identifier's declaration has - DECL_ANTICIPATED on, it has not yet been declared. But do not - replace it with an ordinary implicit declaration. - - * tinfo2.cc: Include stdlib.h. - -2000-05-29 Mark Mitchell - - * cp-tree.h (CLASSTYPE_ALIGN_UNIT): New macro. - * class.c (layout_empty_base): Use CLASSTYPE_ALIGN_UNIT, not - CLASSTYPE_ALIGN. - -2000-05-28 Gabriel Dos Reis - - * decl2.c (lang_decode_option): Use skip_leading_substring instead - of plain strncmp. - -2000-05-28 Alexandre Oliva - - * operators.def (?): this. Fixed. - -2000-05-27 Alex Samuel - Mark Mitchell - - * cp-tree.h (ansi_opname): Make it a macro. - (ansi_assopname): Likewise. - (struct lang_decl_flags): Add assignment_operator_p. - (struct lang_decl): Add operator_code. - (DECL_VTT_PARM): Adjust. - (DECL_OVERLOADED_OPERATOR_P): Return the operator_code for an - overloaded operator. - (SET_OVERLOADED_OPERATOR_CODE): New macro. - (DECL_ASSIGNMENT_OPERATOR_P): New macro. - (DECL_ARRAY_DELETE_OPERATOR_P): Adjust. - (opname_tab): Remove. - (assignop_tab): Likewise. - (operator_name_info_t): New type. - (operator_name_info): New variable. - (assignment_operator_name_info): Likewise. - (build_cp_library_fn): Remove declaration. - (push_cp_library_fn): Likewise. - (operator_name_string): Likewise. - (build_decl_overload): Likewise. - * call.c (print_z_candidates): Simplify. - (build_object_call): Adjust usage of ansi_opname. Use - DECL_OVERLOADED_OPERATOR_P. - (op_error): Adjust operator name lookup. - (build_conditional_expr): Adjust usage of ansi_opname. - (build_new_op): Likewise. - (build_op_delete_call): Likewise. - (build_over_call): Likewise. - (joust): Use DECL_OVERLOADED_OPERATOR_P. - * decl.c (duplicate_decls): Copy operator_code. - (init_decl_processing): Adjust parameters to push_cp_library_fn. - (builtin_function): Adjust parameters to build_library_fn_1. - (build_library_fn_1): Accept an overloaded operator code. - (build_library_fn): Pass ERROR_MARK. - (build_cp_library_fn): Accept an overloaded operator code. - (push_cp_library_fn): Likewise. - (grokfndecl): Tweak. - (grokdeclarator): Simplify code to compute names of overloaded - operators. Adjust use of ansi_opname. - (ambi_op_p): Work on tree_codes, not identifiers. - (unary_op_p): Likewise. - (grok_op_properties): Likewise. - (start_function): Use DECL_OVERLOADED_OPERATOR_P. - (lang_mark_tree): Don't try to mark the operator_code. - * decl2.c (grok_function_init): Use DECL_OVERLOADED_OPERATOR_P. - * error.c (dump_decl): Remove special handling for operator - names. - (dump_function_name): Likewise. - (dump_expr): Adjust name lookup of operators. - (op_to_string): Simplify. - (assop_to_string): Likewise. - * init.c (build_new_1): Adjust use of ansi_opname. - * lex.c (opname_tab): Remove. - (assignop_tab): Likewise. - (ansi_opname): Likewise. - (ansi_assopname): Likewise. - (operator_name_string): Likewise. - (reinit_lang_specific): Likewise. - (operator_name_info): New variable. - (assignment_operator_name_info): Likewise. - (init_operators): New function. - (init_parse): Use it. - (do_identifier): Adjust use of ansi_opname. - * method.c (mangle_expression): Don't use ansi_opname for - mangling. - (build_decl_overload_real): Use DECL_OVERLOADED_OPERATOR_P. - (build_decl_overload): Remove. - (build_typename_overload): Use OPERATOR_TYPENAME_FORMAT directly. - (do_build_assign_ref): Adjust use of ansi_opname. - (synthesize_method): Likewise. - (implicitly_declare_fn): Likewise. - * operators.def: New file. - * parse.y (operator): Adjust use of ansi_opname. - * pt.c (tsubst_decl): Use IDENTIFIER_OPNAME_P. - (set_mangled_name_for_template_decl): Don't play games with - current_namespace. - (special_function_p): Adjust use of ansi_opname. - * typeck.c (check_return_expr): Likewise. - * Make-lang.in (cc1plus): Depend on operators.def. - * Makefile.in (lex.o): Likewise. - (decl.o): Likewise. - -2000-05-27 Zack Weinberg - - * Make-lang.in (cplib2.ready): Eradicate. - -2000-05-27 Richard Kenner - - * method.c (mangle_expression): Use TREE_CODE_LENGTH. - * tree.c (break_out_calls, build_min_nt): Use TREE_CODE_LENGTH. - (built_min, cp_tree_equal): Likewise. - -2000-05-26 Mark Mitchell - - * class.c (layout_nonempty_base_or_field): Replace - `record_layout_info' with `record_layout_info_s'. - -2000-05-26 Jason Merrill - - Fix goto checking. - * cp-tree.h (struct language_function): x_named_labels is now - a struct named_label_list*. - * decl.c (struct named_label_use_list): Renamed from... - (struct named_label_list): ...this. New struct. - (push_binding_level): Don't set eh_region. - (note_level_for_eh): New fn. - (pop_label): Take label and old value directly. - (pop_labels): Adjust for new named_labels format. - (lookup_label): Likewise. - (poplevel): Note characteristics of a binding level containing a - named label. Mess with named label lists earlier. - (mark_named_label_lists): New fn. - (mark_lang_function): Call it. - (use_label): New fn, split out from... - (make_label_decl): ...here. Don't call it. - (decl_jump_unsafe, check_previous_goto, check_previous_goto_1, - check_previous_gotos): New fns, split out from... - (define_label): ...here. - (check_switch_goto): New fn. - (define_case_label): Call it. - (check_goto): New fn. - * semantics.c (finish_goto_stmt): Call it and use_label. - (begin_compound_stmt): If we're a try block, call note_level_for_eh. - (expand_stmt): Never pass 1 as DONT_JUMP_IN to expand_end_bindings. - -2000-05-26 Mark Mitchell - - * class.c (build_vtable_entry_ref): Correct usage of - get_vtbl_decl_for_binfo. - - * decl2.c (grokclassfn): Set DECL_LANGUAGE here. - * method.c (implicitly_declare_fn): Not here. - -2000-05-26 Nathan Sidwell - - * cp-tree.h (CPTI_PTMD_DESC_TYPE): Rename to ... - (CPTI_PTMD_DESC_TYPE): ... here. - (ptmd_desc_type_node): Rename to ... - (ptm_desc_type_node): ... here. - * decl.c: Likewise. - * rtti.c (ptmd_initializer): Rename to ... - (ptm_initializer): ... here. - (sythesize_tinfo_var): Adjust. Deal with pointer to member - function. - (create_tinfo_types): Adjust. - -2000-05-25 Mark Mitchell - - Finish implementation of VTTs. - * cp-tree.h (cp_tree_index): Add CPTI_VTT_PARM_TYPE and - CPTI_VTT_PARM_IDENTIFIER. - (vtt_parm_identifier): New macro. - (vtt_parm_type): Likewise. - (BINFO_SUBVTT_INDEX): Likewise. - (BINFO_VPTR_INDEX): Likewise. - (struct lang_decl): Add vtt_parm. - (DECL_VTT_PARM): New macro. - (DECL_USE_VTT_PARM): Likewise. - (DECL_NEEDS_VTT_PARM_P): Likewise. - (get_vtt_name): Declare. - (build_artificial_parm): Likewise. - (fixup_all_virtual_upcast_offsets): Likewise. - (expand_indirect_vtbls_init): Remove. - * call.c (build_new_method_call): Pass the vtt to subobject - constructors and destructors. - * class.c (get_vtt_name): Give it external linkage. - (build_clone): Handle the magic VTT parameters for clones. - (clone_function_decl): Fix typo in comment. - (build_vtt): Keep track of the indices in the VTTs where various - entities are stored. - (build_vtt_inits): Likewise. - (dfs_build_vtt_inits): Likewise. - (build_ctor_vtbl_group): Tweak type of construction vtables. - (dfs_accumulate_vtbl_inits): Build vtables for all bases, even - primary bases, when building construction vtables. - * decl.c (duplicate_decls): Handle DECL_VTT_PARM. - (initialize_predefined_identifiers): Add vtt_parm_identifier. - (init_decl_processing): Initialize vtt_parm_type. - (grokfndecl): Use DECL_OVERLOADED_OPERATOR_P. - (lang_mark_tree): Make vtt_parm. - * decl2.c (build_artificial_parm): New function. - (maybe_retrofit_in_chrg): Use it. Add VTT parameters. - (grokclassfn): Use build_artificial_parm. - * init.c (initialize_vtbl_ptrs): Call - fixup_all_virtual_upcast_offsets directly. - (perform_member_init): Use the complete subobject destructor for - member cleanups. - (build_vtbl_address): New function. - (expand_virtual_init): Handle VTTs. - * optimize (maybe_clone_body): Likewise. - * search.c (fixup_all_virtual_upcast_offsets): Give it external - linkage. - (expand_indirect_vtbls_init): Remove. - * semantics.c (setup_vtbl_ptr): Fix typos in comment. - * tree.c (make_binfo): Make them bigger. - -2000-05-25 Nathan Sidwell - - * inc/cxxabi.h (__pbase_type_info): Define, based on - __pointer_type_info. - (__pointer_type_info): Derive from __pbase_type_info. Adjust. - (__pointer_to_member_type_info): Likewise. - * tinfo2.cc (__pbase_type_info::~__pbase_type_info): Implement. - (__pointer_to_member_type_info::__is_pointer_p): Remove. - (__pointer_type_info::__do_catch): Rename to ... - (__pbase_type_info::__do_catch): ... here. Adjust. - (__pbase_type_info::__pointer_catch): Implement. - (__pointer_type_info::__pointer_catch): Adjust. - (__pointer_to_member_type_info::__pointer_catch): Adjust. - -2000-05-25 Nathan Sidwell - - * tinfo.h (__user_type_info::contained_virtual_p): New - predicate. - * tinfo.cc (__user_type_info::do_upcast): Fix bug with diamond - shaped hierarchy. - (__vmi_class_type_info::__do_upcast): Fix bug with NULL pointer to - diamond shaped hierarchy. Add early out for mixed diamond and - duplicate shaped hierarchy. - -2000-05-24 Mark Mitchell - - * cp-tree.h (build_delete): Change prototype. - (build_vec_delete): Likewise. - * call.c (build_scoped_method_call): Use special_function_kind - values to indicate the kind of destruction to be done. - (build_method_call): Likewise. - * decl.c (finish_destructor_body): Likewise. - (maybe_build_cleanup_1): Likewise. Rename to ... - (maybe_build_cleanup): ... this. - * decl2.c (delete_sanity): Use special_function_kind - values to indicate the kind of destruction to be done. - (build_cleanup): Likewise. - * init.c (perform_member_init): Likewise. - (build_vec_delete_1): Likewise. - (build_dtor_call): Simplify. - (build_delete): Use special_function_kind - values to indicate the kind of destruction to be done. - (build_vbase_delete): Likewise. - (build_vec_delete): Likewise. - - * init.c (sort_member_init): Fix typo in error message generation - code. - -2000-05-15 Donald Lindsay - - * semantics.c (begin_class_definition): make the packed - attribute be sensitive to the "-fpack-struct" command line flag - -2000-05-24 Nathan Sidwell - - Update new-abi upcast algorithm. - * inc/cxxabi.h (__class_type_info::__do_upcast): Change - prototype and meaning of return value. - (__si_class_type_info::__do_upcast): Likewise. - (__vmi_class_type_info::__do_upcast): Likewise. - * tinfo.cc (__class_type_info::__upcast_result): Replace - whole2dst with part2dst. Adjust ctor. - (__class_type_info::__do_upcast): Adjust call of worker function. - (__class_type_info::__do_upcast): Adjust. - (__si_class_type_info::__do_upcast): Adjust. Use parent's - __do_upcast. - (__vmi_class_type_info::__do_upcast): Likewise. Fix private - virtual base in diamond hierarchy bug. - -2000-05-23 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable - and bitfield to tinfo_fn_p. - (DECL_TINFO_FN_P): Adjust. - (SET_DECL_TINFO_FN_P): Likewise. - (DECL_MUTABLE_P): Likewise. - (DECL_C_BIT_FIELD): Likewise. - (SET_DECL_C_BIT_FIELD): Likewise. - (CLEAR_DECL_C_BIT_FIELD): Likewise. - (DECL_UNINLINABLE): Likewise. - * class.c (alter_access): Call retrofit_lang_decl if ncessary. - (handle_using_decl): Remove assertion. - (build_vtbl_or_vbase_field): Use build_decl, not build_lang_decl, - to build FIELD_DECLs. - (build_base_field): Likewise. - (layout_class_type): Likewise. - * decl.c (init_decl_processing): Likewise. - (build_ptrmemfunc_type): Likewise. - (grokdeclarator): Likewise. - * decl2.c (grok_x_components): Likewise. - * except.c (call_eh_info): Likewise. - * init.c (init_init_processing): Likewise. - * rtti.c (expand_class_desc): Likewise. - (create_pseudo_type_info): Likewise. - (get_vmi_pseudo_type_info): Likewise. - (create_tinfo_types): Likewise. - * ptree.c (print_lang_decl): Adjust. - * typeck.c (build_component_ref): Don't check DECL_LANG_SPECIFIC - before checking DECL_MUTABLE_P. - - * decl2.c (maybe_retrofit_in_chrg): Don't create in-charge - parameters for template functions. - * pt.c (tsubst_decl): Make sure we call maybe_retrofit_in_chrg for - destructors as well as constructors. - -2000-05-22 Mark Mitchell - - * class.c (build_ctor_vtbl_group): Set inits. - * optimize.c (maybe_clone_body): Set DECL_INLINE and - DECL_THIS_INLINE appropriately for clones. - - * cp-tree.h (IDENTIFIER_TYPENAME_P): Use a flag, not strncmp. - (DECL_CONV_FN_P): Simplify. - (DECL_OPERATOR): Remove. - (language_to_string): Declare. - * decl.c (duplicate_decls): Fix typo in comment. - (grokdeclarator): Adjust use of IDENTIFIER_TYPENAME_P. - (grok_op_properties): Use DECL_CONV_FN_P instead of - IDENTIFIER_TYPENAME_P. - * dump.c (dequeue_and_dump): Dump the language linkage of - declarations. - * error.c (language_to_string): Give it external linkage. - * method.c (build_typename_overload): Set IDENTIFIER_TYPENAME_P. - (implicitly_declare_fn): Set DECL_LANGUAGE. - * pt.c (check_explicit_specialization): Use DECL_CONV_FN_P, not - IDENTIFIER_TYPENAME_P. - (tsubst_decl): Likewise. - (tsubst_copy): Adjust use of IDENTIFIER_TYPENAME_P. - * semantics.c (finish_member_declaration): Don't mark members of - classes declared in an extern "C" region as extern "C". - -2000-05-22 Martin v. Löwis - - * decl2.c (qualified_lookup_using_namespace): Look through - namespace aliases. - - * decl.c (push_using_decl): Return the old decl on namespace level. - -2000-05-21 Mark Mitchell - - * cp-tree.h (SET_BINFO_NEW_VTABLE_MARKED): Add sanity checks. - (VTT_NAME_PREFIX): New macro. - (CTOR_VTBL_NAME_PREFIX): Likewise. - (get_ctor_vtbl_name): New function. - * class.c (get_vtable_name): Simplify. - (get_vtt_name): New function. - (get_vtable_decl): Don't set IDENTIFIER_GLOBAL_VALUE. - (dfs_mark_primary_bases): Update the CLASSTYPE_VBASECLASSES list - when a virtual base becomes primary. - (finish_struct_1): Set CLASSTYPE_VFIELDS a little earlier. Build - VTTs. - (finish_vtbls): Adjust calls to accumulate_vtbl_inits to pass in - additional parameters. - (dfs_finish_vtbls): Don't clear BINFO_NEW_VTABLE_MARKED. - (initialize_array): New function. - (build_vtt): Likewise. - (build_vtt_inits): Likewise. - (dfs_build_vtt_inits): Likewise. - (dfs_fixup_binfo_vtbls): Likewise. - (build_ctor_vtbl_group): Likewise. - (initialize_vtable): Use initialize_array. - (accumulate_vtbl_inits): Reimplement to handle construction - vtables. - (dfs_accumulate_vtbl_inits): Likewise. - (bulid_vtbl_initializer): Adjust parameter name. - * method.c (build_typename_overload): Remove #if 0'd code. - (get_ctor_vtbl_name): New function. - * search.c (dfs_walk_real): Use BINFO_N_BASETYPES. - (init_vbase_pointers): Don't mess with the TREE_CHAIN of a binfo. - - * cp-tree.h (struct lang_type): Remove search_slot. - (CLASSTYPE_SEARCH_SLOT): Remove. - (emit_base_init): Change prototype. - (initialize_vtbl_ptrs): Likewise. - (expand_indirect_vtbls_init): Likewise. - (clear_search_slots): Remove. - * decl.c (lang_mark_tree): Don't mark search_slot. - * init.c (initialize_vtbl_ptrs): Simplify. - (emit_base_init): Likewise. - * search.c (struct vbase_info): Document decl_ptr. - (convert_pointer_to_single_level): Remove. - (dfs_find_vbases): Remove. - (dfs_init_base_pointers): Simplify. - (dfs_clear_vbase_slots): Remove. - (dfs_vtable_path_unmark): New function. - (init_vbase_pointers): Simplify. - (expand_upcast_fixups): Don't rely on CLASSTYPE_SEARCH_SLOT. - (expand_indirect_vtbls_init): Simplify. Don't call - mark_all_temps_used. - * semantics.c (setup_vtbl_ptr): Adjust calls to emit_base_init and - initialize_vtbl_ptrs. - -2000-05-20 Zack Weinberg - - * except.c: Add static prototypes. - -2000-05-20 H.J. Lu - - * Make-lang.in (cplib2.ready): Also depend on cc1plus$(exeext). - -2000-05-19 Mark Mitchell - - Don't create a separate copy of virtual bases for the - CLASSTYPE_VBASECLASSES list. - * cp-tree.h (CLASSTYPE_VBASECLASSES): Change documentation. - (BINFO_FOR_VBASE): Remove. - (CANONICAL_BINFO): Adjust. - (binfo_for_vbase): New function. - * class.c (build_vbase_pointer_fields): Use binfo_for_vbase - instead of BINFO_FOR_VBASE. - (build_vbase_pointer): Likewise. - (build_secondary_vtable): Likewise. - (dfs_mark_primary_bases): Likewise. - (mark_primary_bases): Likewise. - (layout_nonempty_base_or_field): Likewise. - (dfs_set_offset_for_shared_vbases): Likewise. - (dfs_set_offset_for_unshared_vbases): Likewise. - (layout_virtual_bases): Likewise. Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - (dump_class_hierarchy_r): Use binfo_for_vbase - instead of BINFO_FOR_VBASE. - (dump_class_hierarchy): Likewise. - (finish_vtbls): Likewise. - (build_vtbl_initializer): Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - (build_vbase_offset_vtbl_entries): Use binfo_for_vbase. - * decl.c (finish_destructor_body): Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - * init.c (sort_base_init): Use binfo_for_vbase. - (construct_virtual_bases): Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - (expand_member_init): Use binfo_for_vbase. - (build_vbase_delete): Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - * method.c (do_build_copy_constructor): Likewise. - * rtti.c (get_base_offset): Use binfo_for_vbase. - (expand_class_desc): Remove #if 0'd code. - * search.c (struct vbase_info): Remove vbase_types. - (get_base_distance): Use binfo_for_vbase. - (lookup_field_queue_p): Use CANONICAL_BINFO. - (get_shared_vbase_if_not_primary): Use binfo_for_vbase. - (get_pure_virtuals): Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - (dfs_find_vbases): Use binfo_for_vbase. - (dfs_init_vbase_pointers): Likewise. - (init_vbase_pointers): Don't initialize vi.vbase_types. - (virtual_context): Use binfo_for_vbase. - (fixup_all_virtual_upcast_offsets): Adjust for changes to the - CLASSTYPE_VBASECLASSES list. - (expand_indirect_vtbls_init): Simplify. - (dfs_get_vbase_types): Don't replicate virtual bases. - (find_vbase_instance): Use binfo_for_vbase. - (binfo_for_vbase): New function. - * typeck.c (get_delta_difference): Use binfo_for_vbase. - -2000-05-17 Mark Mitchell - - * decl2.c (finish_anon_union): Generalize error messages to handle - anonymous structures. - * init.c (perform_member_init): Remove `name' parameter. - (build_field_list): New function. - (sort_member_init): Handle anonymous union initialization order - correctly. Check for multiple initializations of the same union. - (emit_base_init): Don't look up fields by name here. - (expand_member_init): Record the result of name lookup for future - reference. - * typeck.c (build_component_ref): Fix formatting. - -2000-05-17 Andrew Cagney - - * decl.c (pop_label): Replace warn_unused with warn_unused_label. - * typeck.c (build_x_compound_expr): Replace warn_unused with - warn_unused_value. - - * decl2.c (lang_decode_option): Update -Wall unused flags by - calling set_Wunused. - -2000-05-16 Mark Mitchell - - * cp-treeh (BINFO_NEW_VTABLE_MARKED): Update documentation. - * init.c (dfs_vtable_path_unmark): Remove. - * search.c (marked_new_vtable_p): Likewise. - (unmarked_new_vtable_p): Likewise. - (dfs_search_slot_nonempty_p): Likewise. - (dfs_mark): Likewise. - (dfs_vtable_path_unmark): Likewise. - (dfs_find_vbases): Don't set BINFO_NEW_VTABLE_MARKED. - (dfs_int_vbase_pointers): Don't clear BINFO_VTABLE_PATH_MARKED. - (dfs_init_vbase_pointers): Remove special-case new ABI code. - (dfs_clear_vbase_slots): Don't clear BINFO_NEW_VTABLE_MARKED. - (init_vbase_pointers): Simplify. - (expand_indirect_vtbls_init): Likewise. - - * class.c (copy_virtuals): New function. - (build_primary_table): Use it. - (build_secondary_vtable): Likewise. - (modify_vtable_entry): Use NULL_TREE, not integer_zero_node, to - indicate that no vcall offset is required. - (add_virtual_function): Likewise. - (modify_all_vtables): Likewise. - (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. - (dfs_accumulate_vtbl_inits): Likewise. - (build_vtbl_initializer): Make changes to handle construction - vtables. - (dfs_build_vcall_offset_vtbl_entries): Likewise. - (build_rtti_vtbl_entries): Likewise. - (build_vtable_entries): Handle a NULL vcall_index. - -2000-05-15 Gabriel Dos Reis - - * decl2.c (lang_decode_option): Fix thinko. - -2000-05-14 Jason Merrill - - * except.c (check_handlers): New fn. - * cp-tree.h: Declare it. - * semantics.c (finish_handler_sequence): Call it. - (finish_function_handler_sequence): Likewise. - (finish_handler_parms): Set TREE_TYPE on the handler. - * cp-tree.h (PUBLICLY_UNIQUELY_DERIVED_P): New macro. - * search.c (get_base_distance_recursive): If protect>1, ignore - special access. - (get_base_distance): Don't reduce watch_access. - -2000-05-13 Gabriel Dos Reis - - * lex.c: #include diagnostic.h. - (lang_init_options): Set default prefixing rules. - - * lang-options.h: Add -fdiagnostics-show-location=. - - * decl2.c: #include diagnostic.h. - (lang_decode_option): Handle -fdiagnostics-show-location=. - -2000-05-12 Nathan Sidwell - - * tinfo.cc: Revert my 2000-05-08 and 2000-05-07 changes. - * vec.cc: Revert my 2000-05-07 change. - -2000-05-11 Jason Merrill - - * class.c (check_field_decls): Complain about non-static data - members with same name as class in class with constructor. - -2000-05-10 Jason Merrill - - * decl.c (grokdeclarator): Allow non-static data members with - same name as class. - -2000-05-09 Zack Weinberg - - * cp-tree.h: Constify tree_srcloc.filename, tinst_level.file, - and pending_inline.filename. Update prototypes. - * decl.c (define_label): Constify filename parameter. - * decl2.c (warn_if_unknown_interface): Constify local char *. - * input.c Constify input_source.filename. Don't declare - input_filename or lineno. Constify filename parameter to feed_input. - * lex.c (init_parse): Constify parameter and return value. - (cp_pragma_interface, cp_pragma_implementation): Constify - filename argument. - (reinit_parse_for_method, reinit_parse_for_block, - reinit_parse_for_expr, feed_defarg, handle_cp_pragma): - Constify local char *. - * pt.c: Don't declare lineno or input_filename. - (print_template_context, tsubst_friend_function, tsubst_decl, - tsubst, instantiate_decl): Constify local char *. - * semantics.c (expand_body): Constify local char *. - * tree.c (build_srcloc): Constify filename parameter. - * typeck.c (c_expand_asm_operands): Constify filename - parameter. - -2000-05-08 Nathan Sidwell - - * tinfo.cc (__dynamic_cast): Use a reinterpret_cast. Fix - offsetof expansion. - -2000-05-08 Branko Cibej - - * inc/cxxabi.h: Fix typos in comment. - (__base_class_info::__offset): Use a static_cast. - -2000-05-07 Nathan Sidwell - - * inc/cxxabi.h: Use __SIZE_TYPE_ and __PTRDIFF_TYPE__ in place - of std::size_t and std::ptrdiff_t respectively. - * tinfo.cc: Likewise. - * vec.cc: Likewise. - -2000-05-06 Richard Henderson - - * typeck.c (build_c_cast): Don't warn integer->pointer size - mismatch for constants. - -2000-05-06 Nathan Sidwell - - * rtti.c (ptmd_initializer): Set non-public, if class is - incomplete. - - * inc/cxxabi.h (__dynamic_cast): Explicitly say extern "C++". - (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, - __cxa_vec_delete): Likewise. - * tinfo.cc (__dynamic_cast): Likewise. - * vec.cc (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, - __cxa_vec_delete): Likewise. - -2000-05-04 Mark Mitchell - - * cp-tree.h (DELTA_FROM_VTABLE_ENTRY): Remove. - (SET_FNADDR_FROM_VTABLE_ENTRY): Likewise. - (lang_decl_flags): Add vcall_offset. - (THUNK_VCALL_OFFSET): Use it. - * decl.c (lang_mark_tree): Don't mark DECL_ACCESS for a thunk. - * method.c (make_thunk): Create the lang_decl here, not in - emit_thunk. - (emit_thunk): Make generic thunks into ordinary functions once - they have been fed to expand_body. - * semantics.c (expand_body): Set current_function_is_thunk here. - -2000-05-04 Kaveh R. Ghazi - - * class.c (update_vtable_entry_for_fn): Prototype. - - * pt.c (tsubst_decl): Initialize variables `argvec', `gen_tmpl' - and `tmpl'. - - * search.c (dfs_build_inheritance_graph_order): Prototype. - -2000-05-04 Mark Mitchell - - * cp-tree.h (special_function_kind): Add various kinds of - destructors. - (special_function_p): New function. - * class.c (overrides): Don't let one kind of destructor override - another. - * decl2.c (mark_used): Use DECL_NON_THUNK_FUNCTION_P when deciding - whether or not to instantiate a template. - * tree.c (special_function_p): Define. - -2000-05-03 Mark Mitchell - - * cp-tree.def (THUNK_DECL): Remove. - * cp-tree.h (DECL_THUNK_P): New macro. - (DECL_NON_THUNK_FUNCTION_P): Likewise. - (DECL_EXTERN_C_FUNCTION_P): Likewise. - (SET_DECL_THUNK_P): Likewise. - (DELTA_FROM_VTABLE_ENTRY): Use DECL_THUNK_P. - (FNADDR_FROM_VTABLE_ENTRY): Likewise. - (DECL_MAIN_P): Use DECL_EXTERN_C_FUNCTION_P. - * decl.c (decls_match): Use DECL_EXTERN_C_P. - (duplicate_decls): Likewise. - (pushdecl): Likewise. Adjust thunk handling. - (grokfndecl): Use DECL_EXTERN_C_P. - * decl2.c (mark_vtable_entries): Use DECL_THUNK_P. - * dump.c (dequeue_and_dump): Remove THUNK_DECL handling. - * except.c (nothrow_libfn_p): Use DECL_EXTERN_C_P. - * expr.c (cplus_expand_expr): Remove THUNK_DECL handling. - * method.c (make_thunk): Use SET_DECL_THUNK_P. Set - DECL_NO_STATIC_CHAIN. - (emit_thunk): Don't play games with TREE_CODE on thunks. Don't - set DECL_DESTRUCTOR_P or DECL_CONSTRUCTOR_P on a thunk. - * search.c (covariant_return_p): Remove THUNK_DECL handling. - * ir.texi: Update. - -2000-05-01 Jason Merrill - - * tree.c (walk_tree): Set lineno. - -2000-05-01 Mark Mitchell - - * exception.cc: Update license notice. - * new.cc: Likewise. - * new1.cc: Likewise. - * new2.cc: Likewise. - * tinfo.cc: Likewise. - * tinfo2.cc: Likewise. - * vec.cc: Likewise. - * inc/cxxabi.h: Likewise. - * inc/exception: Likewise. - * inc/new: Likewise. - * inc/new.h: Likewise. - * inc/typeinfo: Likewise. - -2000-05-01 Jason Merrill - - * tree.c (build_target_expr_with_type): If we already have a - TARGET_EXPR, just return it. - - * optimize.c (initialize_inlined_parameters): Don't generate an - EXPR_STMT if we can just use DECL_INITIAL. - * decl.c (emit_local_var): Only make the initialization a - full-expression if stmts_are_full_exprs_p. - -2000-05-01 Mark Mitchell - - * cp-tree.h (same_type_ignoring_top_level_qualifiers_p): New - macro. - * call.c (standard_conversion): Use it. - (direct_reference_binding): Likewise. - (build_over_call): Likewise. - (is_properly_derived_from): Likewise. - (compare_ics): Likewise. - * class.c (resolves_to_fixed_type_p): Likewise. - * optimize.c (declare_return_variable): Likewise. - * pt.c (is_specialization_of): Likewise. - (unify): Likewise. - * typeck.c (comp_target_parms): Likeiwse. - (build_static_cast): Likewise. - (build_reinterpret_cast): Likewise. - (build_const_cast): Likewise. - (comp_ptr_ttypes_real): Likewise. - (comp_ptr_ttypes_const): Likewise. - * typeck2.c (process_init_constructor): Likewise. - -2000-04-30 Scott Snyder - - * decl.c (finish_destructor_body): Use the base destructor when - destroying virtual bases. - -2000-04-30 Mark Mitchell - - * expr.c (cplus_expand_expr): Preserve temporaries when expanding - STMT_EXPRs. - * optimize.c (struct inline_data): Add target_exprs field. - (declare_return_variable): When a function returns an aggregate, - use the variable declared in the TARGET_EXPR as the remapped - DECL_RESULT. - (expand_call_inline): Update the pending target_exprs stack. - (optimize_function): Initialize the stack. - - * decl2.c (finish_file): Fix typo in comment. - - * method.c (emit_thunk): Don't try to return a `void' value. - - * optimize.c (initialize_inlined_parameters): If the parameter is - addressable, we need to make a new VAR_DECL, even if the - initializer is constant. - -2000-04-28 Cosmin Truta - - * decl.c (grok_op_properties): Add an extra check of argtypes. - -2000-04-27 Mark Mitchell - - * optimize.c (copy_body_r): Use STRIP_TYPE_NOPS when copying - variables. - (initialize_inlined_parameters): Try to avoid creating new - VAR_DECLs. - -2000-04-27 Alex Samuel - - * lex.c (my_get_run_time): Remove. - (init_filename_times): Use get_run_time instead of my_get_run_time. - (check_newline): Likewise. - (dump_time_statistics): Likewise. - * decl2.c (finish_file): Push and pop timevar TV_VARCONST instead - of computing elapsed time explicitly. - -2000-04-26 Mark Mitchell - - * cp-tree.h (TREE_READONLY_DECL_P): Use DECL_P. - * init.c (decl_constant_value): Check TREE_READONLY_DECL_P. - * call.c (convert_like_real): Don't test TREE_READONLY_DECL_P - before calling decl_constant_value. - * class.c (check_bitfield_decl): Likewise. - * cvt.c (ocp_convert): Likewise. - (convert): Likewise. - * decl.c (compute_array_index_type): Likewise. - (build_enumerator): Likewise. - * decl2.c (check_cp_case_value): Likewise. - * pt.c (convert_nontype_argument): Likewise. - (tsubst): Likewise. - * typeck.c (decay_conversion): Likewise. - (build_compound_expr): Likewise. - (build_reinterpret_cast): Likewise. - (build_c_cast): Likewise. - (convert_for_assignment): Likewise. - -2000-04-26 Jason Merrill - - * decl.c (finish_function): Don't play games with DECL_INLINE. - -2000-04-25 Gabriel Dos Reis - - * ir.texi: Correct typo. - -2000-04-25 Martin v. Löwis - - * decl.c (grokdeclarator): Reject VLAs as members. - -2000-04-24 Gabriel Dos Reis - - * call.c (standard_conversion): Accept conversion between - COMPLEX_TYPEs. - - * cvt.c (ocp_convert): Handle conversion to COMPLEX_TYPE. - -2000-04-24 Zack Weinberg - - * decl2.c (finish_file): Remove double setup for accounting - compile time. - -2000-04-24 Robert Lipe - - * cp-tree.h (lang_type): Member `language' now ENUM_BITFIELD. - -2000-04-23 Benjamin Kosnik - - * new.cc (set_new_handler): Needs to be in std::. - -2000-04-23 Mark Mitchell - - * cp-tree.h (lang_decl): Remove pretty_function_p. - (DECL_PRETTY_FUNCTION_P): Use TREE_LANG_FLAG_0, not a bit in the - language-specific node. - * decl.c (cp_make_fname_decl): Use build_decl, not - build_lang_decl, to build the variables. - (grokvardecl): Don't call build_lang_decl for local variables in - templates. - (grokdeclarator): Don't call build_lang_decl for local type - declarations in templates. - * lex.c (retrofit_lang_decl): Use ggc_alloc_obj to allocated - zero'd memory, rather than calling memset. - * pt.c: Include hashtab.h. - (local_specializations): New variable. - (retrieve_local_specialization): Use it. - (register_local_specialization): Likewise. - (tsubst_decl): Don't assume local variables have - DECL_LANG_SPECIFIC. - (instantiate_decl): Set up local_specializations. - * Makefile.in (HTAB_H): New variable. - -2000-04-23 Richard Henderson - - * typeck.c (c_expand_asm_operands): Restore the original - contents of the output list. - -2000-04-22 Gabriel Dos Reis - - * ir.texi: Document complex number representation. - -2000-04-20 Nathan Sidwell - - * rtti.c (init_rtti_processing): Set tinfo_var_id in new-abi. - (target_incomplete_p): New function. - (tinfo_base_init): Create comdat NTBS name variable. - (ptr_initializer): Add non_public parameter. Calculate it. - (ptmd_initializer): Likewise. - (synthesize_tinfo_var): Adjust. Emit incomplete class tinfo. - (create_real_tinfo_var): Add non_public parameter. Use it. - Push proxy into global namespace. - * inc/cxxabi.h (__pointer_type_info::incomplete_class_mask): - New enumeration. - * inc/typeinfo (type_info::before, type_info::operator==): - Compare __name addresses. - - * tinfo2.cc: Remove new-abi builtins comment. - -2000-04-20 Jason Merrill - - * typeck.c (build_x_function_call): Resolve an OFFSET_REF. - - * call.c (joust): Exit early if we get the same function, too. - - * decl2.c (key_method): Return NULL_TREE for template classes. - (import_export_class): Don't need to check for template classes. - -2000-04-18 Zack Weinberg - - * lex.c: Remove references to cccp.c. - -2000-04-18 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Remove const_memfunc and - volatile_memfunc. Add destructor_attr. Adjust dummy. - (DECL_DESTRUCTOR_P): Use destructor_attr. - (DECL_CONST_MEMFUNC_P): Reimplement. - (DECL_VOLATILE_MEMFUNC_P): Remove. - * class.c (finish_struct_methods): Use CLASSTYPE_DESTRUCTORS. - (overrides): Use DECL_DESTRUCTOR_P. - (check_for_override): Likewise. - * decl.c (start_function): Likewise. - * decl2.c (grokfclassfn): Likewise. - (check_classfn): Likewise. - (grok_function_init): Likewise. - -2000-04-17 Mark Mitchell - - * decl2.c (grokfield): Issue error on illegal data member - declaration. - -2000-04-17 Mark P Mitchell - - * method.c (make_thunk): Set DECL_CONTEXT for a THUNK_DECL. - -2000-04-16 Mark Mitchell - - * class.c (build_vtable_entry): Don't build thunks for type-info - functions. - -2000-04-16 Jason Merrill - - * decl.c (decls_match): Allow a redeclaration of a builtin to - specify args while the builtin did not. - -2000-04-15 Mark Mitchell - - * cp-tree.def (THUNK_DECL): Add to documentation. - * cp-tree.h (flag_huge_objects): Declare. - * class.c (modify_vtable_entry): Tidy. - (update_vtable_entry_for_fn): Split out from dfs_modify_vtables. - Calculate delta appropriately for the new ABI. - (dfs_modify_vtables): Use it. - (modify_all_vtables): Fix thinko in code to add overriding copies - of functions to primary vtables. - (build_clone): Fix typo in comment. - (clone_function_decl): Correct order of destructors in vtable. - (build_vbase_offset_vtbl_entries): Adjust comment. - (dfs_vcall_offset_queue_p): Remove. - (dfs_build_vcall_offset_vtbl_entries): Update BV_VCALL_INDEX. - (build_vcall_offset_vtbl_entries): Juse use dfs_skip_vbases. - (build_vtable_entry): Correct check for pure virtual functions. - Don't declare flag_huge_objects. - * decl.c (flag_huge_objects): Remove declaration. - * method.c (make_thunk): Tweak mangling for vcall offset thunks. - Use int_size_in_bytes. - (emit_thunk): Handle vcall offset thunks. - -2000-04-15 Richard Kenner - - * decl2.c (parse_time, varconst_time): Delete declarations. - (finish_file): Delete LINENO declaration. - START_TIME and THIS_TIME now long. - -2000-04-13 Nathan Sidwell - - * class.c (build_base_field): Reformat comment. - - * inc/cxxabi.h (stddef.h): Comment inclusion. - (__base_class_info::__offset): Comment shift. - -2000-04-12 Mark Mitchell - - * cp-tree.h (IDENTIFIER_CTOR_OR_DTOR_P): New macro. - (cp_tree_index): Add CPTI_PUSH_EXCEPTION_IDENTIFIER. - (cp_push_exception_identifier): New macro. - (DECL_COMPLETE_DESTRUCTOR_P): New macro. - (DECL_BASE_DESTRUCTOR_P): Likewise. - (DECL_DELETING_DESTRUCTOR_P): Likewise. - (get_vtbl_decl_for_binfo): Fix formatting. - (in_charge_arg_for_name): New macro. - (maybe_build_cleanup_and_delete): Remove declaration. - * call.c (build_field_call): Use IDENTIFIER_CTOR_OR_DTOR_P. - (in_charge_arg_for_name): New function. - (build_new_method_call): Use it. Handle cloned destructors. - (build_clone): Don't make the base constructor virtual. - Automatically defer generated functions. - (clone_function_decl): Handle destructors, too. - (clone_constructors_and_destructors): Likewise. - (create_vtable_ptr): Don't create a vtable entry for a cloned - function. - * decl.c (predefined_identifier): Add ctor_or_dtor_p. - (initialize_predefined_identifiers): Update appropriately. - (finish_destructor_body): Simplify. - (maybe_build_cleanup_and_delete): Remove. - * except.c (expand_throw): Handle new-ABI destructors. - * init.c (expand_cleanup_for_base): Use base_dtor_identifier. - (build_dtor_call): New function. - (build_delete): Use it. Simplify. - * optimize.c (maybe_clone_body): Handle destructors. - * search.c (lookup_field_queue_p): Use IDENTIFIER_CTOR_OR_DTOR_P. - - * exception.cc (cleanup_fn): New typedef. - (CALL_CLEANUP): New macro. - (cp_eh_info): Use them. - (__cp_push_exception): Likewise. - (__cp_pop_exception): Likewise. - -2000-04-11 Mark Mitchell - - * cp-tree.h (cp_tree_index): Add CPTI_DTOR_IDENTIFIER. - (complete_dtor_identifier): New macro. - (CLASSTYPE_FIRST_CONVERSION): Remove. - (CLASSTYPE_CONSTRUCTOR_SLOT): New macro. - (CLASSTYPE_DESTRUCTOR_SLOT): Likewise. - (CLASSTYPE_FIRST_CONVERSION_SLOT): Likewise. - (CLASSTYPE_CONSTRUCTORS): Likewise. - (CLASSTYPE_DESTRUCTORS): Likewise. - (lang_decl): Add cloned_function. - (DECL_COMPLETE_CONSTRUCTOR_P): New macro. - (DECL_BASE_CONSTRUCTOR_P): Likewise. - (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P): Likewise. - (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P): Likewise. - (DECL_CLONED_FUNCTION_P): Likewise. - (DECL_CLONED_FUNCTION): Likewise. - (clone_function_decl): Declare. - (maybe_clone_body): Likewise. - * call.c (build_user_type_conversion_1): Call complete object - constructors in the new ABI. - (build_new_method_call): Don't add in-charge parameters under the - new ABI. - * class.c (add_method): Use DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P, - DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P, CLASSTYPE_CONSTRUCTOR_SLOT, and - CLASSTYPE_DESTRUCTOR_SLOT. - (build_clone): New function. - (clone_function_decl): Likewise. - (clone_constructors_and_destructors): Likewise. - (check_bases_and_members): Use it. - * decl.c (iniitialize_predefined_identifiers): Initialize - complete_dtor_identifier. - (finish_function): Don't add extra code to a clone. - (lang_mark_tree): Mark cloned_function. - * decl2.c (mark_used): Don't bother trying to instantiate things - we synthesized. - * dump.c (dequeue_and_dump): Don't dump CP_DECL_CONTEXT twice. - * method.c (set_mangled_name_for_decl): Don't treat clones as - constructors. - (synthesize_method): Sythesize cloned functions, not the clones. - * optimize.c (inline_data): Update comment on ret_label. - (remap_block): Don't assume DECL_INITIAL exists. - (copy_body_r): Allow ret_label to be NULL. - (maybe_clone_body): Define. - * pt.c (tsubst_decl): Handle clones. - (instantiate_clone): New function. - (instantiate_template): Use it. - (set_mangled_name_for_template_decl): Don't treat clones as - constructors. - * search.c (lookup_fnfields_1): Use CLASSTYPE_CONSTRUCTOR_SLOT, - CLASSTYPE_DESTRUCTOR_SLOT, and CLASSTYPE_FIRST_CONVERSION_SLOT. - * semantics.c (expand_body): Clone function bodies as necessary. - - * optimize.c (remap_decl): Avoid sharing structure for arrays - whose size is only known at run-time. - * tree.c (copy_tree_r): Don't copy PARM_DECLs. - - * cp-tree.h (lang_decl_flags): Rename constructor_for_vbase_attr - to has_in_charge_parm_p. - (DECL_CONSTRUCTOR_FOR_VBASE_P): Rename to ... - (DECL_HAS_IN_CHARGE_PARM_P): ... this. - (DECL_COPY_CONSTRUCTOR_P): New macro. - * call.c (add_function_candidate): Use DECL_HAS_IN_CHARGE_PARM_P. - (build_user_type_conversion_1): Likewise. - (convert_like_real): Likewise. - (build_over_call): Likeiwse. Use DECL_COPY_CONSTRUCTOR_P. - * decl.c (grokdeclarator): Use DECL_HAS_IN_CHARGE_PARM_P. - (copy_args_p): Likewise. - (grok_ctor_properties): Likewise. - (start_function): Likewise. - * decl2.c (maybe_retrofit_in_charge): Likewise. Set it. - * error.c (dump_function_decl): Use DECL_HAS_IN_CHARGE_PARM_P. - * init.c (emit_base_init): Use DECL_COPY_CONSTRUCTOR_P. - * method.c (do_build_copy_constructor): Use - DECL_HAS_IN_CHARGE_PARM_P. - (synthesize_method): Likewise. - * pt.c (instantiate_template): Remove goto. - * tree.c (build_cplus_method_type): Remove mention of obstacks in - comment. - - * cp-tre.h (finish_function): Change prototype. - * decl.c (end_cleanup_fn): Adjust caller. - (finish_function): Take only one parameter. - * decl2.c (finish_objects): Adjust caller. - (finish_static_storage_duration_function): Likewise. - * method.c (emit_thunk): Likewise. - * parse.y: Likewise. - * parse.c: Regenerated. - * pt.c (instantiate_decl): Likewise. - * rtti.c (synthesize_tinfo_fn): Likewise. - * semantics.c (expand_body): Likewise. - - * cp-tree.h (copy_decl): New function. - * class.c (finish_struct_1): Use it. - * lex.c (copy_decl): Define it. - * pt.c (tsubst_decl): Likewise. - * tree.c (copy_template_template_parm): Likewise. - - * cp-tree.h (lang_type): Remove has_nonpublic_ctor and - has_nonpublic_assign_ref. - (TYPE_HAS_NONPUBLIC_CTOR): Don't declare. - (TYPE_HAS_NONPUBLIC_ASSIGN_REF): Likewise. - * class.c (finish_struct_methods): Don't set - TYPE_HAS_NONPUBLIC_CTOR or TYPE_HAS_NONPUBLIC_ASSIGN_REF. - (interface_only): Don't declare. - (interface_unknown): Likewise. - -2000-04-11 Martin v. Löwis - - * tree.h (HAVE_TEMPLATES): Remove definition. - * lang-options.h (-fthis-is-variable): Remove documentation. - -2000-04-10 Jason Merrill - - * class.c (instantiate_type): Handle object-relative template-id. - - * semantics.c (finish_expr_stmt): Call convert_to_void here. - * decl.c (cplus_expand_expr_stmt): Not here. - - * rtti.c (build_dynamic_cast_1): Call non_lvalue. - Initialize exprtype earlier. - - * parse.y (fn.def1): Check for defining types in return types. - - * decl.c (check_tag_decl): Notice extra fundamental types. - Diagnose empty decls in classes, too. - - * decl.c (grokdeclarator): Don't override an anonymous name if no - declarator was given. - - * cvt.c (convert_to_void): Call resolve_offset_ref. - - * typeck.c (build_x_function_call): Abort if we get an OFFSET_REF. - - * decl2.c (decl_namespace): Handle getting a type. - - * typeck.c (build_c_cast): Re-enable warning for cast between - pointer and integer of different size. - -2000-04-10 Nathan Sidwell - - * inc/cxxabi.h (__pointer_type_info): Add restrict and - incomplete flags. - (__pointer_type_info::__pointer_catch): New virtual function. - (__pointer_to_member_type_info): Derive from - __pointer_type_info. Adjust. - (__pointer_to_member_type_info::__do_catch): Remove. - (__pointer_to_member_type_info::__is_pointer_p): Declare. - (__pointer_to_member_type_info::__pointer_catch): Declare. - * rtti.c (qualifier_flags): Add restrict flag. - (ptmd_initializer): Reorder members. - (create_tinfo_types): Expand comments. Reorder - ptmd_desc_type_node members. - * tinfo2.cc (__pointer_to_member_type_info::__is_pointer_p): - Implement. - (__pointer_type_info::__do_catch): Move specific code into - __pointer_catch. Call it. - (__pointer_type_info::__pointer_catch): Non-pointer-to-member - specific catch checking. Fix void conversion check. - (__pointer_to_member_type_info::__do_catch): Remove. - (__pointer_to_member_type_info::__pointer_catch): Implement. - -2000-04-10 Martin v. Löwis - - * lex.c (init_parse): Remove traces of classof and headof. - * decl2.c (flag_operator_names): Default to 1. - (lang_decode_option): Do not set it for -ansi. - -2000-04-09 Mark Mitchell - - * cp-tree.h (struct lang_decl): Remove main_decl_variant. - (DECL_MAIN_VARIANT): Remove. - * decl.c (duplicate_decls): Don't set it. - (start_function): Likewise. - (lang_mark_tree): Don't mark it. - * decl2.c (defer_fn): Don't use it. - * lex.c (retrofit_lang_decl): Don't set it. - * pt.c (tsubst_decl): Likewise. - * ptree.c (print_lang_decl): Don't print it. - * typeck.c (mark_addressable): Don't use it. - -2000-04-09 Nathan Sidwell - - * vec.cc: Include and . - (__cxa_vec_ctor): Use __cxa_vec_dtor for cleanup. - (__cxa_vec_dtor): Catch dtor exceptions, and rethrow or - terminate. - (__cxa_vec_delete): Catch dtor exceptions. - -2000-04-09 Nathan Sidwell - - Prepend __ to implementation defined names. - * inc/typeinfo (type_info): Rename _name to __name. - (type_info::type_info): Rename parameter. - (type_info::operator==, type_info::operator!=, - type_info::before): Likewise. - (type_info::is_pointer_p, type_info::is_function_p, - type_info::do_catch, type_info::do_upcast): Prepend __. Rename - parameters. - * inc/cxxabi.h - (__fundamental_type_info::__fundamental_type_info) Rename parameters. - (__pointer_type_info::__pointer_type_info): Likewise. - (__pointer_type_info::is_pointer_p, - __pointer_type_info::do_catch): Prepend __. Rename parameters. - (__array_type_info::__array_type_info): Rename parameters. - (__function_type_info::__function_type_info): Likewise. - (__function_type_info::is_function_p): Prepend __. - (__enum_type_info::__enum_type_info): Rename parameters. - (__pointer_to_member_type_info::__pointer_to_member_type_info): - Likewise. - (__pointer_to_member_type_info::do_catch): Prepend __. Rename - parameters. - (__base_class_info::is_virtual_p, is_public_p, offset): Prepend __. - (__class_type_info::__class_type_info): Rename parameters. - (__class_type_info::sub_kind): Prepend __. Adjust member names. - (__class_type_info::upcast_result, - __class_type_info::dyncast_result): Prepend __. Move definition - into tinfo.cc. - (__class_type_info::do_upcast, __class_type_info::do_catch, - __class_type_info::find_public_src, - __class_type_info::do_dyncast, - __class_type_info::do_find_public_src): Prepend __. Rename - parameters. - (__si_class_type_info::__si_class_type_info): Rename parameters. - (__si_class_type_info::do_upcast, __si_class_type_info::do_dyncast, - __si_class_type_info::do_find_public_src): Prepent __. Rename - parameters. - (__vmi_class_type_info::__vmi_class_type_info): Rename parameters. - (__vmi_class_type_info::do_upcast, __vmi_class_type_info::do_dyncast, - __vmi_class_type_info::do_find_public_src): Prepent __. Rename - parameters. - (__dynamic_cast): Rename parameters. - * tinfo.cc (type_info::is_pointer_p, type_info::is_function_p, - type_info::do_catch, type_info::do_upcast): Prepend __. - (contained_p, public_p, virtual_p, contained_public_p, - contained_nonpublic_p, contained_nonvirtual_p): Adjust. - (__class_type_info::do_catch, - __class_type_info::do_upcast): Prepend __. Adjust. - (__class_type_info::__upcast_result, - __class_type_info::__dyncast_result): Move from inc/cxxabi.h. - Adjust. - (__class_type_info::find_public_src): Prepend __. Adjust. - (__class_type_info::do_find_public_src, - __si_class_type_info::do_find_public_src, - __vmi_class_type_info::do_find_public_src): Likewise. - (__class_type_info::do_dyncast, - __si_class_type_info::do_dyncast, - __vmi_class_type_info::do_dyncast): Likewise. - (__class_type_info::do_upcast, - __si_class_type_info::do_upcast, - __vmi_class_type_info::do_upcast): Likewise. - (__dynamic_cast): Adjust. - * tinfo2.cc (__pointer_type_info::is_pointer_p): Prepend __. - (__function_type_info::is_function_p): Likewise. - (__pointer_type_info::do_catch): Likewise. Adjust. - (__pointer_to_member_type_info::do_catch): Likewise. Adjust. - (__throw_type_match_rtti_2): Adjust. - (__is_pointer): Adjust. - -2000-04-08 Mark Mitchell - - * cp-tree.h (cp_tree_index): Add CPTI_COMPLETE_CTOR_IDENTIFIER. - (complete_ctor_identifier): New macro. - (special_function_kind): Add sfk_copy_constructor and - sfk_assignment_operator. - (LOOKUP_HAS_IN_CHARGE): Remove. - (cons_up_default_function): Rename to ... - (implicitly_declare_fn): ... this. - * call.c (build_new_method_call): Add in-charge parameters for - constructors here. - * class.c (add_implicitly_declared_members): Change parameter name - from cant_have_assignment to cant_have_const_assignment. - Replace calls to cons_up_default_function to implicitly_declare_fn. - * cvt.c (ocp_convert): Use complete_ctor_identifier. - * decl.c (initialize_predefined_identifiers): Initialize it. - (start_function): Use DECL_CONSTRUCTOR_FOR_VBASE_P instead of - complex expression. - * init.c (expand_default_init): Don't calculate the in-charge - parameter here. - (build_new_1): Likewise. - * lex.c (cons_up_default_function): Move to method.c. - * method.c (synthesize_method): Use DECL_DESTRUCTOR_P. - (implicitly_declare_fn): New function. - * typeck.c (build_static_cast): Use complete_ctor_identifier. - (build_modify_expr): Likewise. - * typeck2.c (build_functional_cast): Likewise. - - Under the new ABI, constructors don't return `this'. - * cp-tree.h (warn_reorder): Declare. - (special_function_kind): New enum. - (global_base_init_list): Remove declaration. - (emit_base_init): Don't return a value. - (check_base_init): Don't declare. - (is_aggr_typedef): Likewise. - * decl.c (check_special_function_return_type): New function. - (return_types): Remove. - (grokdeclarator): Use check_special_function_return_type. - (start_function): Don't initialize ctor_label under the new ABI. - (finish_construtor_body): Don't create a corresponding LABEL_STMT. - * init.c (begin_init_stmts): Move to top of file. - (finish_init_stmts): Likewise. - (warn_reorder): Don't declare. - (emit_base_init): Don't create a STMT_EXPR here. Don't return a - value. - (check_base_init): Remove. - (is_aggr_typedef): Likewise. - (build_new_1): Don't use the return value of a constructor. - * semantics.c (setup_vtbl_ptr): Don't use the return value - of emit_base_init. - * typeck.c (check_return_expr): Don't magically convert return - statements into `return this' in constructors under the new ABI. - - * cp-tree.h (cp_tree_index): Add CPTI_BASE_CTOR_IDENTIFIER, - CPTI_BASE_DTOR_IDENTIFIER, and CPTI_DELETING_DTOR_IDENTIFIER. - (base_ctor_identifier): New macro. - (base_dtor_identifier): Likewise. - (deleting_dtor_identifier): Likewise. - * decl.c: Don't include obstack.h. - (obstack_chunk_alloc): Don't define. - (obstack_chunk_free): Likewise. - (struct predefined_identifier): New type. - (initialize_predefined_identifiers): New function. - (init_decl_processing): Use it. - (debug_temp_inits): Remove. - (start_method): Don't call preserve_data. - (hack_incomplete_structures): Update comment. - * init.c (init_init_processing): Don't initialize - nelts_identifier. - (build_offset_rf): Remove dead code. - (build_delete): Use CLASSTYPE_N_BASECLASSES. - * search.c (init_search_processing): Don't initialize - vptr_identifier. - -2000-04-08 Kaveh R. Ghazi - - * typeck.c (build_binary_op): Call `tree_expr_nonnegative_p' to elide - some sign_compare warnings. - -2000-04-07 Nathan Sidwell - - Rename abi::__vmi_class_type_info members. - * inc/cxxabi.h (__vmi_class_type_info): Rename details, n_bases, - base_list, detail_masks members to vmi_flags, vmi_base_count, - vmi_bases and vmi_flags_masks respectively. - (__vmi_class_type_info::vmi_flags_masks): Rename - details_unknown_mask to flags_unknown_mask. - * tinfo.cc (__class_type_info::do_upcast): Adjust. - (__vmi_class_type_info::do_find_public_src): Adjust. - (__vmi_class_type_info::do_dyncast): Adjust. - (__vmi_class_type_info::do_upcast): Adjust. - -2000-04-07 Nathan Sidwell - - * tinfo.cc (convert_to_base): New function. - (get_vbase_offset): Remove. Move into convert_to_base. - (__vmi_class_type_info::do_find_public_src): Adjust. - (__vmi_class_type_info::do_dyncast): Adjust. - (__vmi_class_type_info::do_upcast): Adjust. - -2000-04-06 Jason Merrill - - * tinfo.cc (operator=): Use __builtin_strcmp. - * tinfo2.cc (before): Likewise. - -2000-04-06 Mark Mitchell - - * cp-tree.h (lang_decl_flags): Rename saved_inline to deferred. - (DECL_SAVED_INLINE): Rename to ... - (DECL_DEFERRED_FN): ... this. - (in_function_p): Remove declaration. - (mark_inline_for_output): Rename to ... - (defer_fn): ... this. - * decl.c (finish_function): Adjust call to mark_inline_for_output. - (in_function_p): Remove definition. - * decl2.c (saved_inlines): Rename to ... - (deferred_fns): ... this. - (saved_inlines_used): Rename to ... - (deferred_fns_used): ... this. - (mark_inline_for_output): Rename to ... - (defer_fn): ... this. - (finish_file): Adjust accordingly. - (init_decl2): Likewise. - * lex.c (cons_up_default_function): Likewise. - * pt.c (mark_decl_instantiated): Likewise. - (instantiate_decl): Don't set DECL_DEFER_OUTPUT under any - circumstances. - * rtti.c (get_tinfo_decl): Adjust call to mark_inline_for_output. - * semantics.c (expand_body): Defer more functions. - -2000-04-06 Nathan Sidwell - - * vec.cc: New file. - * Make-lang.in (CXX_LIB2FUNCS): Add it. - (vec.o): Build it. - * inc/cxxabi.h (__cxa_vec_new, __cxa_vec_ctor, __cxa_vec_dtor, - __cxa_vec_delete): Declare. - -2000-04-06 Nathan Sidwell - - * rtti.c (dfs_class_hint_mark): New static function. - (dfs_class_hint_unmark): New static function. - (class_hint_flags): Use them. - -2000-04-05 Benjamin Kosnik - - * decl2.c: Make flag_honor_std dependent on ENABLE_STD_NAMESPACE. - -2000-04-05 Mark Mitchell - - * cp-tree.h (instantiate_decl): Change prototype. - * decl2.c (mark_used): Adjust call. - * optimize.c (inlinable_function_p): Adjust handling of templates. - * pt.c (do_decl_instantiation): Adjust call to instantiate_decl. - (do_type_instantiation): Likewise. - (instantiate_decl): Defer more templates. - (instantiate_pending_templates): Adjust logic to handle inline - friend functions. - - * Makefile.in (GGC_H): New variable. Use it throughout in place - of ggc.h. - - * call.c: Don't include obstack.h. Include ggc.h. - (obstack_chunk_alloc): Don't define. - (obstack_chunk_free): Likewise. - (add_candidate): Allocate the z_candidate with ggc_alloc_obj. - * decl.c (push_switch): Use xmalloc to allocate the cp_switch. - (pop_switch): Free it. - - * decl2.c (grokclassfn): Set TREE_READONLY for PARM_DECLs. - - * dump.c (dequeue_and_dump): Don't try to print the bit_position - if we don't have a DECL_FIELD_OFFSET. - -Wed Apr 5 15:12:18 MET DST 2000 Jan Hubicka - - * optimize.c (calls_setjmp_r): Use setjmp_call_p instead of - special_function_p. - -2000-04-04 Kaveh R. Ghazi - - * cfns.gperf (hash, libc_name_p): Prototype. - - * rtti.c (build_dynamic_cast_1): Constification. - - * search.c (dfs_debug_unmarkedp, dfs_debug_mark): Unhide prototypes. - - * semantics.c (deferred_type_access_control): Prototype. - -2000-04-04 Mark Mitchell - - Correct many new ABI issues regarding vbase and vcall offset - layout. - * cp-tree.h (BINFO_VTABLE): Document. - (struct lang_type): Tweak formatting. - (BINFO_PRIMARY_BINFO): Add to documentation. - (CLASSTYPE_VSIZE): Fix typo in comment. - (CLASSTYPE_VBASECLASSES): Update documentation. - (BINFO_VBASE_MARKED): Remove. - (SET_BINFO_VBASE_MARKED): Likewise. - (CLEAR_BINFO_VBASE_MARKED): Likewise. - (BINFO_FIELDS_MARKED): Remove. - (SET_BINFO_FIELDS_MARKED): Likewise. - (CLEAR_BINFO_FIELDS_MARKED): Likewise. - (enum access_kind): New enumeration. - (num_extra_vtbl_entries): Remove declaration. - (size_extra_vtbl_entries): Likewise. - (get_vtbl_decl_for_binfo): New function. - (dfs_vbase_unmark): Remove declaration. - (mark_primary_bases): Likewise. - * class.c (SAME_FN): Remove. - (struct vcall_offset_data_s): Move definition. - (build_vbase_pointer): Use `build', not `build_binary_op', to - access the vbase pointer under the new ABI. - (build_vtable_entry_ref): Use get_vtbl_decl_for_binfo. - (build_primary_vtable): Likewise. - (dfs_mark_primary_bases): Move here from search.c. - (mark_primary_bases): Likewise. - (determine_primary_bases): Under the new ABI, don't make a base - class a primary base just because we don't yet have any virtual - functions. - (layout_vtable_decl): Use get_vtbl_decl_for_binfo. - (num_vfun_entries): Remove. - (dfs_count_virtuals): Likewise. - (num_extra_vtbl_entries): Likewise. - (size_extra_vtbl_entries): Likewise. - (layout_virtual_bases): Iterate in inheritance graph order under - the new ABI. - (finish_struct_1): Use TYPE_VFIELD, not CLASSTYPE_VSIZE, to - indicate that a vfield is present. - (init_class_processing): Initialize access_public_node, etc., from - ak_public, etc. - (get_vtbl_decl_for_binfo): New function. - (dump_class_hierarchy_r): Likewise. - (dump_class_hierarchy): Use it. - (finish_vtbls): Build the vtbls in inheritance graph order. - (dfs_finish_vtbls): Adjust call to build_vtbl_initializer. - (initialize_vtable): Use get_vtbl_decl_for_binfo. - (accumulate_vtbl_inits): Add comments explaining why a pre-order - walk is required. - (dfs_accumulate_vtbl_inits): Set BINFO_VTABLE to the location - where the vptr points, even for primary vtables. - (build_vtbl_initializer): Adjust handling of vbase and vcall - offsets. - (build_vcall_and_vbase_vtable_entries): New function. - (dfs_build_vbase_offset_vtbl_entries): Remove. - (build_vbase_offset_vtbl_entries): Reimplement. - (dfs_build_vcall_offset_vtbl_entries): Don't include virtuals that - were already handled in a primary base class vtable. - (build_vcall_offset_vtbl_entries): Adjust. - (build_rtti_vtbl_entries): Adjust. - * decl2.c (output_vtable_inherit): Use get_vtbl_decl_for_binfo. - * init.c (expand_virtual_init): Simplify. - * repo.c (repo_get_id): Use get_vtbl_decl_for_binfo. - * rtti.c (create_pseudo_type_info): Adjust calculation of vptr. - * search.c (BINFO_ACCESS): New macro. - (SET_BINFO_ACCESS): Likewise. - (dfs_access_in_type): Manipulate access_kinds, not access nodes. - (access_in_type): Likewise. - (dfs_accessible_p): Likewise. - (protected_accessible_p): Likewise. - (lookup_fnfields_1): Adjust documentation. - (dfs_mark_primary_bases): Move to class.c - (mark_primary_bases): Likewise. - (dfs_vbase_unmark): Remove. - (virtual_context): Use BINFO_FOR_VBASE. - (dfs_get_vbase_types): Simplify. - (dfs_build_inheritance_graph_order): New function. - (get_vbase_types): Use it. - * tree.c (debug_binfo): Use get_vtbl_decl_for_binfo. - - * tinfo.cc (get_vbase_offset): New function. - (__vmi_class_type_info::do_find_public_src): Use it. - (__vmi_class_type_info::do_dyncast): Likewise. - (__vmi_class_type_info::do_upcast): Likewise. - -2000-04-03 Zack Weinberg - - * lang-specs.h: Pass -fno-show-column to the preprocessor. - -2000-03-30 Nathan Sidwell - - * rtti.c (class_hint_flags): Rename flags. - (class_initializer): Remove flags. - (synthesize_tinfo_var): Combine offset and flags. Add flags - for __vmi_class_type_info. - (create_tinfo_types): Remove flags from __class_type_info and - __si_class_type_info. Merge flags and offset from - base_class_type_info. - * inc/cxxabi.h (__base_class_info): Merge offset and vmi_flags. - (__base_class_info::is_virtual_p): Adjust. - (__base_class_info::is_public_p): Adjust. - (__base_class_info::offset): New accessor. - (__class_type_info::details): Remove member. - (__class_type_info::__class_type_info): Lose details. - (__class_type_info::detail_masks): Remove. - (__si_class_type_info::__si_class_type_info): Lose details. - (__vmi_class_type_info::details): New member. - (__vmi_class_type_info::__vmi_class_type_info): Adjust. - (__vmi_class_type_info::detail_masks): New member. - * tinfo.cc (__class_type_info::do_upcast): Initialize result - with unknown_details_mask. - (__vmi_class_type_info::do_find_public_src): Adjust - (__vmi_class_type_info::do_dyncast): Adjust. - (__vmi_class_type_info::do_upcast): Set result details, if - needed. Adjust. - (__dynamic_cast): Temporarily #if out optimization. - -2000-03-29 Nathan Sidwell - - * rtti.c (get_tinfo_decl): Mark used. - (emit_tinfo_decl): Don't optimize polymorphic type_info. Only - mark as dealt with, if we output it. - -2000-03-28 Mark Mitchell - - * class.c: Reorganize to put virtual function table initialization - machinery at the end of the file. - -2000-03-28 Jason Merrill - - * class.c (finish_struct): Use bitsize_zero_node. - * pt.c (instantiate_class_template): Likewise. - -2000-03-28 Mark Mitchell - - Put RTTI entries at negative offsets in new ABI. - * class.c (dfs_build_vbase_offset_vtbl_entries): Put the first - vbase offset at index -3, not -1. - (build_vtabe_offset_vtbl_entries): Use unmarked_vtable_pathp, not - dfs_vtable_path_unmarked_real_bases_queue_p to walk bases. - (dfs_build_vcall_offset_vtbl_entries): Don't use skip_rtti_stuff. - (build_rtti_vtbl_entries): New function. - (set_rtti_entry): Remove. - (build_primary_vtable): Don't use it. - (build_secondary_vtable): Likewise. - (start_vtable): Remove. - (first_vfun_index): New function. - (set_vindex): Likewise. - (add_virtual_function): Don't call start_vtable. Do call - set_vindex. - (set_primary_base): Rename parameter. - (determine_primary_base): Likewise. - (num_vfun_entries): Don't use skip_rtti_stuff. - (num_extra_vtbl_entries): Include RTTI information. - (build_vtbl_initializer): Use build_rtti_vtbl_entries. - (skip_rtti_stuff): Remove. - (dfs_modify_vtables): Don't use it. - (modify_all_vtables): Don't use start_vtable. Do use set_vindex. - (layout_nonempty_base_or_field): Update size handling. - (create_vtable_ptr): Tweak. - (layout_class_type): Adjust parameter names. - (finish_struct_1): Simplify. - * cp-tree.h (CLASSTYPE_VSIZE): Tweak documentation. - (skip_rtti_stuff): Remove. - (first_vfun_index): New function. - (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. - (dfs_vtable_path_marked_real_bases_queue_p): Remove. - (marked_vtable_pathp): Declare. - (unmarked_vtable_pathp): Likewise. - * error.c (dump_expr): Use first_vfun_index to calculate vtable - offsets. - * rtti.c (build_headof): Look for RTTI at negative offsets. - (get_tinfo_decl_dynamic): Likewise. - (tinfo_base_init): Don't take the address of the TINFO_VTABLE_DECL - here. - (create_pseudo_type_info): Do it here instead. Adjust so that - vptr points at first virtual function. - * search.c (marked_vtable_pathp): Make it global. - (unmarked_vtable_pathp): Likewise. - (dfs_vtable_path_unmarked_real_bases_queue_p): Remove. - (dfs_vtable_path_marked_real_bases_queue_p): Likewise. - (dfs_get_pure_virtuals): Don't use skip_rtti_stuff. - (get_pure_virtuals): Likewise. - (expand_upcast_fixups): Likewise. - * tree.c (debug_binfo): Likewise. - * tinfo.cc (__dynamic_cast): Look for vtable_prefix at appropriate - negative offset. - -2000-03-26 Richard Kenner - - * class.c (check_field_decl): Fix typo. - (build_vtbl_or_vbase_field): Don't clear DECL_SAVED_INSNS. - (check_methods): Likewise. - (check_field_decls): Likewise. - Use DECL_CONTEXT, not DECL_FIELD_CONTEXT. - * cp-tree.h (DECL_SHADOWED_FOR_VAR, DECL_TEMPLATE_RESULT): - Use DECL_RESULT_FLD, not DECL_RESULT. - * decl.c (xref_tag): Use DECL_TEMPLATE_RESULT. - * lex.c (identifier_type): Likewise. - * pt.c (determine_specialization, lookup_template_class): Likewise. - (tsubst_friend_function, tsubst_decl, instantiate_template): Likewise. - (resolve_overloaded_unification, more_specialized): Likewise. - * semantics.c (finish_member_declaration): Likewise. - * typeck.c (build_x_function_call): Likewise. - -2000-03-26 Mark Mitchell - - * class.c (layout_empty_base): Handle empty bases with non-byte - alignment. - (build_base_field): Likewise. - (layout_virtual_bases): Likewise. - - * class.c (finish_struct_1): Fix typo in this change: - - Sat Mar 25 09:12:10 2000 Richard Kenner - -2000-03-25 Mark Mitchell - - * decl.c (grokdeclarator): Count partial specializations when - keeping track of how many template classes have been seen. - - * dump.c (dequeue_and_dump): Dump DECL_TEMPLATE_RESULT. - -2000-03-25 Richard Kenner - - * class.c (build_vbase_pointer_fields): layout_field now place_field. - (get_vfield_offset): Use byte_position. - (set_rtti_entry): Set OFFSET to ssizetype zero. - (get_binfo_offset_as_int): Deleted. - (dfs_record_base_offsets): Use tree_low_cst. - (dfs_search_base_offsets): Likewise. - (layout_nonempty_base_or_field): Reflect changes in RLI format - and call byte_position. - (layout_empty_base): Convert offset to ssizetype. - (build_base_field): use rli_size_unit_so_far. - (dfs_propagate_binfo_offsets): Do computation in proper type. - (layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets. - (layout_class_type): Reflect changes in RLI names and fields. - (finish_struct_1): Set DECL_FIELD_OFFSET. - * dump.c (dequeue_and_dump): Call bit_position. - * expr.c (cplus_expand_constant): Use byte_position. - * rtti.c (expand_class_desc): Use bitsize_one_node. - * typeck.c (build_component_addr): Use byte_position and don't - special case for zero offset. - -2000-03-24 Nathan Sidwell - - * decl.c (vtype_decl_p): Use TYPE_POLYMORPHIC_P. - - * rtti.c (get_tinfo_decl): Set comdat linkage on new-abi - tinfo object. - (emit_tinfo_decl): Only emit polymorphic tinfo's when emitting - vtable. - -2000-03-20 Theodore Papadopoulo - - * call.c (check_dtor_name, build_new_method_call): Use TYPE_P and - DECL_P macros. - * decl.c (push_class_binding, poplevel, pushtag, lookup_namespace_name, - make_typename_type, check_initializer, cp_finish_decl, - xref_tag): Likewise. - * decl2.c (grokfield, build_expr_from_tree, build_expr_from_tree, - decl_namespace, arg_assoc_template_arg, arg_assoc, - validate_nonmember_using_decl, do_class_using_decl): Likewise. - * error.c (dump_template_argument, dump_expr, cp_file_of, cp_line_of, - args_to_string): Likewise. - * friend.c (is_friend): Likewise. - * lex.c (note_got_semicolon, note_list_got_semicolon, - is_global): Likewise. - * method.c (build_overload_nested_name, build_overload_value, - build_qualified_name, build_qualified_name, hack_identifier): Likewise. - * parse.y (typename_sub, typename_sub1): Likewise. - * pt.c (push_inline_template_parms_recursive, check_template_shadow, - process_partial_specialization, convert_template_argument, - template_args_equal, add_pending_template, lookup_template_class, - for_each_template_parm_r, maybe_fold_nontype_arg, - tsubst, instantiate_template, type_unification_real, unify, - instantiate_pending_templates, set_mangled_name_for_template_decl): - Likewise. - * repo.c (repo_get_id, repo_template_used): Likewise. - * search.c (lookup_field_1): Likewise. - * tree.c (walk_tree, get_type_decl, cp_tree_equal, member_p): Likewise. - * xref.c (classname): Likewise. - -2000-03-22 Mark Mitchell - - * cp-tree.h (BINFO_FOR_VBASE): Adjust documentation. - (CANONICAL_BINFO): New macro. - (BINFO_NEW_VTABLE_MARKED): Use it. - (SET_BINFO_NEW_VTABLE_MARKED): Likewise. - (CLEAR_BINFO_NEW_VTABLE_MARKED): Likewise. - * class.c (dfs_build_vbase_offset_vtbl_entries): Use BINFO_TYPE, - not TREE_TYPE. - (build_primary_vtable): Adjust usage of BINFO_NEW_VTABLE_MARKED. - (build_secondary_vtable): Likewise. - (dfs_finish_vtbls): Likewise. - (dfs_accumulate_vtbl_inits): Likewise. - (accumulate_vtbl_inits): New function. - (finish_vtbls): Make sure that virtual bases come after - non-virtual bases in the vtable group. - (record_base_offsets): Don't save and restore TREE_VIA_VIRTUAL. - (finish_struct_1): Adjust usage of BINFO_NEW_VTABLE_MARKED. - * search.c (struct vbase_info): Move definition. - (marked_new_vtable_p): Adjust usage of BINFO_NEW_VTABLE_MARKED. - (unmarked_new_vtable_p): Likewise. - (dfs_mark_vtable_path): Remove. - (dfs_mark_new_vtable): Remove. - (dfs_unmark_new_vtable): Likewise. - (dfs_clear_search_slot): Likewise. - (dfs_find_vbases): Adjust usage of BINFO_NEW_VTABLE_MARKED. - (dfs_clear_vbase_slots): Likewise. - (init_vbase_pointers): LIkewise. - -2000-03-22 Jason Merrill - - * typeck.c (type_after_usual_arithmetic_conversions): Prefer a - SIZETYPE to a non-SIZETYPE. - -2000-03-21 Mark Mitchell - - * class.c (layout_virtual_bases): Adjust names in conditionally - compiled code. - - * class.c (record_base_offsets): New function. - (layout_conflict_p): Likewise. - (layout_nonempty_base_or_field): Use it. - (layout_empty_base): New function. - (build_base_field): Use it. - (build_base_fields): Update comment. - (layout_virtual_bases): Fold in a little code form - layout_basetypes. Use layout_empty_base. - (layout_basetypes): Remove. - (end_of_class): New function. - (layout_class_type): Use it. Adjust. - - * cp-tree.h (CLASSTYPE_VBASECLASSES): Fix typo in comment. - (fntype_p): Remove. - * search.c (dfs_skip_nonprimary_vbases_unmarkedp): Fix typo in - comment. - (dfs_skip_nonprimary_vbases_markedp): Likewise. - * typeck.c (fntype_p): Remove. - - * cp-tree.h (TI_SPEC_INFO): Remove. - (CLASSTYPE_TI_SPEC_INFO): Likewise. - * pt.c (process_partial_specialization): Likewise. - - * class.c (build_base_field): Fix thinko in computation of binfo - offsets. - - * tree.c (mark_local_for_remap_p): Mark variables declared in - TARGET_EXPRs as well. - -2000-03-21 Nathan Sidwell - - * typeck.c (require_complete_type, complete_type, - complete_type_or_else, c_sizeof, c_sizeof_nowarn, - build_array_ref, convert_arguments, pointer_diff, - build_x_unary_op, build_unary_op, build_c_cast, - build_modify_expr): Use COMPLETE_TYPE_P etc. - * call.c (is_complete, convert_like_real, - build_new_method_call): Likewise. - * class.c (build_vbase_pointer_fields, check_bases, - build_base_field, finish_struct_1, pushclass): Likewise. - * cvt.c (cp_convert_to_pointer, convert_to_void): Likewise. - * decl.c (maybe_process_template_type_declaration, pushtag, - pushdecl, redeclaration_error_message, start_decl, start_decl_1, - layout_var_decl, check_initializer, cp_finish_decl, - grokdeclarator, require_complete_types_for_parms, - grok_op_properties, xref_tag, xref_basetypes, - check_function_type): Likewise. - * decl2.c (check_classfn, reparse_absdcl_as_casts): Likewise. - * friend.c (do_friend): Likewise. - * init.c (build_offset_ref): Likewise. - * parse.y (structsp): Likewise. - * pt.c (maybe_process_partial_specialization, - tsubst_friend_function, instantiate_class_template, tsubst, - do_type_instantiation, instantiate_pending_templates): Likewise. - * repo.c (repo_get_id): Likewise. - * rtti.c (build_typeid, get_typeid, build_dynamic_cast_1, - synthesize_tinfo_var, emit_support_tinfos): Likewise. - * search.c (lookup_fnfields_1, lookup_conversions): Likewise. - * semantics.c (begin_class_definition): Likewise. - * tree.c (build_cplus_method_type): Likewise. - * typeck2.c (digest_init, build_functional_cast, - add_exception_specifier): Likewise. - * parse.h, parse.c: Regenerated. - -2000-03-21 Nathan Sidwell - - * inc/cxxabi.h: New header file. Define new-abi entry points. - (__pointer_type_info::target): Rename member to ... - (__pointer_type_info::type): ... here. - (__base_class_info::type): Rename member to ... - (__base_class_info::base): ... here. - * Make-lang.in (CXX_EXTRA_HEADERS): Add cxxabi.h - * cp-tree.h (CPTI_ABI): New global tree enumeration. - (abi_node): New global tree node. - * decl.c (abi_node): Document. - (init_decl_processing): Initialize abi_node. - * rtti.c (build_dynamic_cast_1): Use abi_node for new-abi. - (get_vmi_pseudo_type_info): Likewise. - (create_tinfo_types): Likewise. - (emit_support_tinfos): Likewise. - * tinfo.h (cxxabi.h): Include for new-abi. - Move rtti class definitions to new header file. - * tinfo.cc (abi): Use the namespace. - (std): Move new abi rtti classes from here ... - (__cxxabiv1): ... to here. - * tinfo2.cc (cxxabi.h): Include for new-abi. - Move rtti class definitions to new header file. - (std): Move new abi rtti classes from here ... - (__cxxabiv1): ... to here. - * inc/typeinfo (__class_type_info): Move into __cxxabiv1 - namespace. - -2000-03-20 Jed Wing - Jason Merrill - - * method.c (build_overload_int): Use host_integerp. - -2000-03-20 Theodore Papadopoulo - - * init.c (build_offset_ref): Handle the case of a templated member - function. - -2000-03-19 Martin v. Löwis - - * except.c (expand_exception_blocks): Clear catch_clauses_last. - -2000-03-18 Mark Mitchell - - * cp-tree.h (CLEAR_DECL_C_BIT_FIELD): New macro. - * class.c (check_bitfield_decl): Turn illegal bitfields into - non-bitfields. - (dfs_propagate_binfo_offsets): Adjust for new size_binop - semantics. - (dfs_offset_for_unshared_vbases): Likewise. - * cvt.c (cp_convert_to_pointer): Convert NULL to a - pointer-to-member correctly under the new ABI. - * expr.c (cplus_expand_constant): Don't use cp_convert when - turning an offset into a pointer-to-member. - * init.c (resolve_offset_ref): Don't adjust pointers-to-members - when dereferencing them under the new ABI. - * typeck.c (get_member_function_from_ptrfunc): Tweak calculation - of pointers-to-members under the new ABI. - - * class.c (check_bitfield_decl): Remove restriction on really long - bitfields. - (layout_class_type): Implement new ABI handling of bitfields - longer than their types. - -2000-03-18 Martin v. Löwis - - * parse.y (extdefs): Call ggc_collect. - * parse.c: Regenerated. - -2000-03-18 Nathan Sidwell - - * class.c (build_base_field): Use TYPE_ALIGN to examine a type. - (note_name_declared_in_class): Use OVL_CURRENT to get at a - potential overload. - -2000-03-17 Richard Kenner - - * class.c (build_vbase_path): Use integer_zerop. - (build_vtable_entry): Use tree_low_cst. - (get_vfield_offset): Use bit_position. - (dfs_modify_vtables): New variable vindex_val; `i' is HOST_WIDE_INT. - Use tree_low_cst. - (check_bitfield_decl): Set DECL_SIZE using convert. - (build_base_field): Set DECL_SIZE and DECL_SIZE_UNIT using size_binop. - (layout_virtual_bases): DSIZE is unsigned HOST_WIDE_INT. - Use tree_low_cst. - (finish_struct_1): Use bit_position. - (dump_class_hierarchy): Use tree_low_cst. - * cp-tree.h (min_precision): Add declaration. - * decl.c (xref_tag, xref_basetypes): Use tree_low_cst. - * error.c (dump_type_suffix): Use host_integerp and tree_low_cst. - (dump_expr): Use integer_zerop, host_integerp, and tree_low_cst. - * expr.c (cplus_expand_constant): Use bit_position. - * init.c (build_vec_init): Use host_integerp and tree_low_cst. - * rtti.c (get_base_offset): Use bit_position. - * typeck.c (build_binary_op): Use integer_zerop, compare_tree_int, - host_integerp, and tree_low_cst. - (pointer_int_sum): Use integer_zerop. - (build_component_addr): Use bit_position. - -2000-03-17 Nathan Sidwell - - * typeck.c (require_complete_type): Don't assume size_zero_node. - (complete_type_or_else): Likewise. - -2000-03-16 Steven Grady - Jason Merrill - - * rtti.c (build_dynamic_cast_1): Improve diagnostics. - -2000-03-16 Nathan Sidwell - - * decl2.c (grokfield): Bail out if type is error_mark_node. - -2000-03-15 Nathan Sidwell - - * tinfo2.cc (__ptr_to_member_data): Rename to ... - (__pointer_to_member_data): ... here. Adjust. - * rtti.c (create_tinfo_types): Adjust. - -2000-03-15 Nathan Sidwell - - * cp-tree.h (CPTI_REF_DESC_TYPE, ref_desc_type_node): Remove. - * decl.c (ref_desc_type_node): Undocument. - * rtti.c (ptr_ref_initializer): Rename to ... - (ptr_initializer): ... here. Adjust comments. - (ptmd_initializer): Fix comment thinko. - (synthesize_tinfo_var): Remove REFERENCE_TYPE case. - (create_tinfo_types): Remove ref_desc_type_node init. - * tinfo2.cc (__reference_type_info): Remove. - -2000-03-15 Nathan Sidwell - - * decl.c (cp_finish_decl): Remove obsolete comment. - - * typeck.c (build_ptrmemfunc1): Kill uninitialized warning. - -2000-03-14 Mark Mitchell - - * cp-tree.h: Tweak documentation. - * class.c (build_vbase_pointer_fields): Layout the fields, too. - (avoid_overlap): Remove. - (get_binfo_offset_as_int): New function. - (dfs_serach_base_offsets): Likewise. - (layout_nonempty_base_or_field): Likewise. - (build_base_field): Layout fields here. Avoid placing two objects - of the same type at the same address, under the new ABI. - (build_base_fields): Adjust accordingly. - (create_vtable_ptr): Return the new field, but don't attach it to - TYPE_FIELDS. - (remove_base_field): Remove. - (remove_base_fields): Remove. - (layout_basetypes): Adjust accordingly. - (layout_class_type): Call layout_field for each field, rather than - just making a wholesale call to layout_type. - -2000-03-14 Jeff Sturm - - * except.c (expand_throw): Fix typo in _Jv_Sjlj_Throw. - -2000-03-13 Jason Merrill - - * decl.c (grokfndecl): Set TREE_NOTHROW if TYPE_NOTHROW_P. - - * except.c (dtor_nothrow): New fn. - (do_pop_exception): Use it. Take type parm. - (push_eh_cleanup): Take type parm. - (expand_start_catch_block): Pass it. - (build_eh_type_type_ref): Accept null type. - -2000-03-12 Mark Mitchell - - * cp-tree.h (revert_static_member_fn): Change prototype. - * decl.c (grokfndecl): Adjust call to revert_static_member_fn. - (grok_op_properties): Likewise. - (start_function): Likewise. - (revert_static_member_fn): Simplify. - * pt.c (check_explicit_specialization): Adjust call to - revert_static_member_fn. - -2000-03-11 Mark Mitchell - - * cp-tree.h (scope_kind): New type. - (tmpl_spec_kind): Likewise. - (declare_pseudo_global_level): Remove. - (pseudo_global_level_p): Rename to template_parm_scope_p. - (pushlevel): Remove declaration. - (begin_scope): New function. - (finish_scope): Likewise. - (current_tmpl_spec_kind): Likewise. - * decl.c (struct binding_level): Shorten parm_flag to 2 bits. - Shorten keep to 2 bits. Rename pseudo_global to template_parms_p. - Add template_spec_p. - (toplevel_bindings_p): Adjust. - (declare_pseudo_global_level): Remove. - (pseudo_global_level_p): Rename to template_parm_scope_p. - (current_tmpl_spec_kind): New function. - (begin_scope): Likewise. - (finish_scope): Likewise. - (maybe_push_to_top_level): Adjust. - (maybe_process_template_type_declaration): Likewise. - (pushtag): Likewise. - (pushdecl_nonclass_level): Likewise. - (lookup_tag): Likewise. - (grokfndecl): Handle member template specializations. Share - constructor and non-constructor code. - * decl2.c (check_classfn): Handle member template specializations. - * pt.c (begin_template_parm_list): Use begin_scope. - (begin_specialization): Likewise. - (end_specialization): Likewise. - (check_explicit_specialization): Use current_tmpl_spec_kind. - Handle member template specializations. - (end_template_decl): Use finish_scope. Remove call to - get_pending_sizes. - (push_template_decl_real): Remove bogus error message. - (tsubst_decl): Fix typo in code contained in comment. - (instantiate_template): Handle member template specializations. - (most_general_template): Likewise. - -2000-03-11 Gabriel Dos Reis - - * lex.c (whitespace_cr): Compress consecutive calls to warning(). - (do_identifier): Ditto for error(). - - * pt.c (convert_nontype_argument): Ditto for cp_error(). - (convert_template_argument): Ditto for cp_pedwarn(). - -2000-03-11 Jason Merrill - - * exception.cc (__check_null_eh_spec): New fn. - * except.c (expand_end_eh_spec): Call it if the spec is throw(). - -2000-03-10 Jason Merrill - - * decl.c (push_throw_library_fn): Take the FUNCTION_TYPE. - * except.c (expand_end_eh_spec): Add the return type. - * rtti.c (throw_bad_cast): Add the parmtypes. - (throw_bad_typeid): Likewise. - - * semantics.c (expand_stmt): Only leave out rtl for unused - artificials, and set DECL_IGNORED_P on them as well. - * decl.c (wrapup_globals_for_namespace): Likewise. - -2000-03-09 Nathan Sidwell - - * decl.c (maybe_commonize_var): Skip all artificial decls. - * pt.c (tsubst_decl): Don't copy TREE_ASM_WRITTEN. - -2000-03-10 Jason Merrill - - * lang-options.h, decl2.c: Add -fno-enforce-eh-specs. - * cp-tree.h: Declare flag_enforce_eh_specs. - * decl.c (store_parm_decls, finish_function): Check it. - - C library functions don't throw. - * Makefile.in (cfns.h): New target. - (except.o): Depend on it. - * Make-lang.in (cc1plus): Depend on cfns.gperf. - * cfns.gperf: New file. - * cfns.h: Generated. - * except.c: Include it. - (nothrow_libfn_p): New fn. - * decl.c (grokfndecl): Use it. - * cp-tree.h: Declare it. - - * decl.c (push_overloaded_decl_1, auto_function, - define_function): Lose. - (build_library_fn_1): New static fn. - (builtin_function): Use it. - (get_atexit_node): Use build_library_fn_ptr. - (build_library_fn, build_cp_library_fn, build_library_fn_ptr, - build_cp_library_fn_ptr, push_library_fn, push_cp_library_fn, - push_void_library_fn, push_throw_library_fn): New fns. - * cp-tree.h: Declare them. - (cp_tree_index): Remove CPTI_BAD_CAST, CPTI_BAD_TYPEID. - (throw_bad_cast_node, throw_bad_typeid_node): Lose. - * except.c (init_exception_processing, call_eh_info, do_pop_exception, - (expand_end_eh_spec, alloc_eh_object, expand_throw): Use above fns. - * rtti.c (build_runtime_decl): Lose. - (throw_bad_cast, throw_bad_typeid, get_tinfo_decl, - build_dynamic_cast_1, expand_si_desc, expand_class_desc, - expand_ptr_desc, expand_attr_desc, expand_generic_desc): Use above fns. - - * call.c (build_call): Remove result_type parm. - Call mark_used on unused artificial fns. - * init.c, method.c, typeck.c, except.c, rtti.c: Adjust. - -2000-03-09 Jason Merrill - - * call.c (build_call): Set TREE_NOTHROW on the CALL_EXPR as - appropriate. - * decl.c (define_function): Set TREE_NOTHROW on the FUNCTION_DECL. - * except.c (call_eh_info, alloc_eh_object, expand_throw): Set - TREE_NOTHROW or TREE_THIS_VOLATILE on the function as appropriate. - * rtti.c (build_runtime_decl, get_tinfo_decl, build_dynamic_cast_1, - expand_si_desc, expand_class_desc, expand_ptr_desc, expand_attr_desc, - expand_generic_desc): Likewise. - -2000-03-08 Nathan Sidwell - - * exception.cc (__cp_pop_exception): Cleanup the original object. - -2000-03-08 Nathan Sidwell - - * decl.c (grok_op_properties): Merge conversion to void warning - with other silly op warnings. - -2000-03-08 Jason Merrill - - * typeck2.c (process_init_constructor): Set TREE_PURPOSE of - array CONSTRUCTOR elements. Don't use expr_tree_cons. - -2000-03-08 Nathan Sidwell - - * decl.c (cp_make_fname_decl): New function. - (wrapup_globals_for_namespace): Don't emit unused static vars. - (init_decl_processing): Remove comment about use of - array_domain_type. Set make_fname_decl. - (cp_finish_decl): Remove __FUNCTION__ nadgering. - * semantics.c (begin_compound_stmt): Remove - current_function_name_declared flagging. - (expand_stmt): Don't emit unused local statics. - * typeck.c (decay_conversion): Don't treat __FUNCTION__ decls - specially. - -2000-03-08 Nathan Sidwell - - * typeck.c (convert_for_assignment): Don't look at array - initializer. - * call.c (convert_like_real): Likewise. - -2000-03-07 Jason Merrill - - Add initial support for '\uNNNN' specifier. - * lex.c (read_ucs): New fn. - (readescape, skip_white_space): Call it. - (is_extended_char, is_extended_char_1): New fns. - (utf8_extend_token): New fn, #if 0'd out. - (real_yylex): Treat extended chars like letters. - - * search.c (note_debug_info_needed): Walk the bases even if we - weren't deferring the type itself. - -2000-03-07 Kaveh R. Ghazi - - * decl2.c (finish_objects): Constify a char*. - - * method.c (emit_thunk): Likewise. - -2000-03-06 Nathan Sidwell - - * typeck.c (dubious_conversion_warnings): Look through - REFERENCE_TYPE. - -2000-03-06 Richard Kenner - - * class.c (dfs_modify_vtables): I is now unsigned. - (check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int. - (build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT. - * error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned. - * init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT. - * method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned. - * typeck.c (build_binary_op, case TRUNC_DIV_EXPR): - Call integer_all_onesp. - * typeck2.c (process_init_constructor): Use compare_tree_int. - - * lang-specs.h (as): Don't call if -syntax-only. - -2000-03-06 Mark Mitchell - - * expr.c (cplus_expand_expr, case STMT_EXPR): Don't set - RTL_EXPR_HAS_NO_SCOPE after all. - -2000-03-05 Mark Mitchell - - * expr.c (cplus_expand_expr, case STMT_EXPR): Use - expand_start_stmt_expr and expand_end_stmt_expr directly. Set - RTL_EXPR_HAS_NO_SCOPE. - - * pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG a little - later. - - * dump.c (dequeue_and_dump): Dump SCOPE_NO_CLEANUPS_P. - -2000-03-05 Nathan Sidwell - - * call.c (convert_like): Macrofy. - (convert_like_with_context): New macro. - (convert_like_real): Renamed from convert_like. Add calling - context parameters, for diagnostics. Add recursive flag. Call - dubious_conversion_warnings for outer conversion. - (build_user_type_conversion): Use convert_like_with_context. - (build_over_call): Likewise. Don't warn about dubious - conversions here. Adjust convert_default_arg calls. - (convert_default_arg): Add context parameters for diagnostics. - Pass through to convert_like_with_context. - * cp-tree.h (convert_default_arg): Add context parameters. - (dubious_conversion_warnings): Prototype new function. - * typeck.c (convert_arguments): Adjust convert_default_arg call. - (dubious_conversion_warnings): New function, broken - out of convert_for_assignment. - (convert_for_assignment): Adjust. - -2000-03-03 Jason Merrill - - * decl2.c (key_method): Break out from... - (import_export_vtable, import_export_class): ...here. - - * decl.c (finish_function): Don't mess with flag_keep_inline_functions. - * decl2.c (finish_vtable_vardecl): Don't check decl_function_context. - - * search.c (note_debug_info_needed, dfs_debug_mark, - dfs_debug_unmarkedp): Uncomment. Adjust for new scheme. - * decl2.c (finish_vtable_vardecl): Call note_debug_info_needed. - -2000-03-03 Nathan Sidwell - - * decl.c (cp_finish_decl): Remove obsolete obstack comments, fix - typos. - -2000-03-02 Mark Mitchell - - * cp-tree.h (TYPE_NEEDS_DESTRUCTOR): Rename to ... - (TYPE_HAS_NONTRIVIAL_DESTRUCTOR): ... this. - (TYPE_HAS_TRIVIAL_DESTRUCTOR): New macro. - (lang_type): Split gets_new into has_new and has_array_new. - (TYPE_VEC_NEW_USES_COOKIE): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. - (TYPE_GETS_NEW): Split into ... - (TYPE_HAS_NEW_OPERATOR): ... this, and ... - (TYPE_HAS_ARRAY_NEW_OPERATOR): ... this. - (DECL_ARRAY_DELETE_OPERATOR_P): New macro - (build_op_new_call): Don't declare. - (build_new_1): Likewise. - * call.c (build_op_new_call): Remove. - * class.c (check_bases): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR - instead of TYPE_NEEDS_DESTRUCTOR. - (finish_struct_bits): Likewise. - (add_implicitly_declared_members): Likewise. - (check_field_decl): Likewise. - (check_methods): Set TYPE_VEC_DELETE_TAKES_SIZE here, and set it - correctly under the new ABI. - * decl.c (start_decl_1): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR - instead of TYPE_NEEDS_DESTRUCTOR. - (initialize_local_var): Likewise. - (destroy_local_var): Likewise. - (cp_finish_decl): Likewise. - (register_dtor_fn): Likewise. - (grok_op_properties): Set TYPE_HAS_NEW_OPERATOR and - TYPE_HAS_ARRAY_NEW_OPERATOR, not TYPE_HAS_NEW. Don't set - TYPE_VEC_DELETE_TAKES_SIZE here. - (xref_basetypes): Set TYPE_HAS_NEW_OPERATOR and - TYPE_HAS_ARRAY_NEW_OPERATOR, not TYPE_HAS_NEW. - (store_parm_decls): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. - (finish_destructor_body): Likewise. - (maybe_build_cleanup_1): Likewise. - * decl2.c (do_static_destruction): Likewise. - * init.c (build_new_1): Make it static. - (perform_member_init): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. - (expand_cleanup_for_base): Likewise. - (get_cookie_size): New function. - (build_new_1): Handle array-new cookies correctly under the new - ABI. - (build_vec_delete_1): Likewise. - (build_vec_init): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. - (build_delete): Likewise. - (build_vec_delete): Handle array-new cookies correctly under the new - ABI. - * lex.c (do_identifier): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. - * pt.c (instantiate_class_template): Set TYPE_HAS_NEW_OPERATOR and - TYPE_HAS_ARRAY_NEW_OPERATOR. - * ptree.c (print_lang_type): Check them. - * search.c (context_for_name_lookup): Fix typo in comment. - (tree_has_any_destructor_p): Use TYPE_HAS_NONTRIVIAL_DESTRUCTOR. - * tree.c (break_out_cleanups): Likewise. - (build_cplus_array_test_1): Likewise. - (cp_build_qualified_type_real): Likewise. - * typeck.c (complete_type): Likewise. - - * g++spec.c (lang_specific_driver): Add -fnew-abi at the start of - the command-line, not the end. - -2000-03-01 Jason Merrill - - * pt.c (instantiate_decl): Clear TI_PENDING_TEMPLATE_FLAG. - -2000-03-02 Tom Tromey - - * cp-tree.h (build_java_class_ref): Declare. - * init.c (build_java_class_ref): No longer static. - * except.c (expand_throw): Generate a Java-style `throw' if the - thrown object is a "Java" object. - (initialize_handler_parm): Generate a Java-style lookup of - exception info if the caught object is a "Java" object. - (catch_language, catch_language_init): New globals. - (decl_is_java_type): New function. - (expand_start_catch_block): Don't call push_eh_info() or - push_eh_cleanup() when handling a Java-style "catch". Pass Java - class reference to build_catch_block. - -2000-03-02 Richard Kenner - - * typeck.c (comptypes): Treat sizetype like its language equivalent. - -2000-03-01 Bernd Schmidt - - * typeck.c (maybe_warn_about_returning_address_of_local): Reorganize - to merge reference/pointer code and fix incorrect warnings. - -2000-02-29 Jason Merrill - - * search.c (protected_accessible_p): Use context_for_name_lookup. - - * init.c (construct_virtual_bases): Fix thinko. - * typeck.c (expand_ptrmemfunc_cst): Fix thinko. - -2000-03-01 Martin von Loewis - - * decl.c (current_function_decl): Move to toplev.c. - -2000-02-29 Nathan Sidwell - - * pt.c (fn_type_unification): Unify return type, whenever - provided. - (get_bindings_real): Only pass return type when necessary. - Remove explicit return type check. - * class.c (resolve_address_of_overloaded_function): Pass desired - return type to fn_type_unification. - -2000-02-28 Richard Kenner - - * class.c (build_vtbl_or_vbase_field, check_methods): Don't clear - DECL_FIELD_SIZE. - (check_bitfield_decl, check_field_decls): Set DECL_SIZE, not - DECL_FIELD_SIZE. - * rtti.c (expand_class_desc): Likewise. - * cp-tree.h (DECL_INIT_PRIORITY): Use underlying union name. - (THUNK_VCALL_OFFSET): Likewise. - (THUNK_DELTA): Reflect changes in ../tree.h. - -2000-02-28 Jason Merrill - - * search.c (protected_accessible_p): Also allow the access if - the member is public in DERIVED. Lose TYPE parm. - (friend_accessible_p): Lose TYPE parm. - (accessible_p): Adjust. - -2000-02-27 Richard Kenner - - * class.c (dfs_build_vtable_offset_vtbl_entries): Don't use size_binop - on things that are not sizes; ssize_binop deleted. - Call size_diffop when appropriate. - (dfs_build_vcall_offset_vtbl_entries): Likewise. - (build_primary_vtable, build_secondary_vtable): Likewise. - (dfs_set_offset_for_unshared_vbases, dfs_modify_vtables): Likewise. - Variable I is HOST_WIDE_INT. - (get_vfield_offset): Pass proper types to size_binop. - (size_extra_vtbl_entries, layout_virtual_bases): Likewise. - (finish_struct_1): Likewise. - (skip_rtti_stuff): Arg N is now pointer to signed. - (layout_class_type): Use size_zero_node. - * cp-tree.h (skip_rtti_stuff): Arg N is pointer to signed. - * cvt.c (cp_convert_to_pointer): Pass proper types to size_binop. - * decl.c (complete_arry_type): Pass proper types to size_binop. - (xref_basetypes): BINFO_OFFSET is sizetype. - * error.c (dump_expr): Don't use size_binop non-sizes. - * expr.c (cplus_expand_constant): Pass proper types to size_binop. - * init.c (construct_virtual_bases): Fix type error. - (build_vec_delete_1): Pass proper type to size_binop and don't - fold result. - * lex.c (cp_make_lang_type): BINFO_OFFSET is sizetype. - * rtti.c (get_base_offset): Pass proper type to size_binop. - * search.c (dfs_find_vbases): Fix type error. - (expand_upcast_fixups): Arg to skip_rtti_stuff is pointer to signed. - (dfs_get_vbase_types): BINFO_OFFSET is sizetype. - * tree.c (debug_binfo): Variable N is signed. - Use HOST_WIDE_INT_PRINT_DEC. - * typeck.c (comptypes): sizetype is same as equivalent integer type. - (c_sizeof, c_sizeof_nowarn, expr_sizeof): Use TYPE_SIZE_UNIT, - size_one_node and size_zero_node. - (c_alignof): Use size_one_node. - (build_component_addr): Pass proper types to size_binop. - (expand_ptrmemfunc_cst): Don't use size_binop on non-sizes. - -2000-02-26 Jason Merrill - - Implement class scope using-declarations for functions. - * class.c (handle_using_decl): Call add_method for used functions. - Use IDENTIFIER_CLASS_VALUE to check for conflicts. - (add_method): Used functions are hidden by local functions. - (check_bases_and_members): Handle using-decls before finalizing - CLASSTYPE_METHOD_VEC. - * call.c (add_function_candidate): Add ctype parm; if nonzero, - override the type of 'this' accordingly. - (add_template_candidate, add_template_candidate_real): Add ctype parm. - (convert_class_to_reference, build_user_type_conversion_1, - build_new_function_call, build_object_call, build_new_op, - build_new_method_call): Pass ctype parm. - - * search.c (lookup_member): Put rval_binfo, not basetype_path, in - the baselink. - * call.c (convert_class_to_reference, build_user_type_conversion_1, - build_new_function_call, build_object_call, build_new_op, - build_new_method_call, build_op_delete_call): Don't get basetype_path - from a baselink. - * typeck.c (build_component_ref): Likewise. - * init.c (build_offset_ref): Likewise. - (resolve_offset_ref): Don't call enforce_access. - Call build_scoped_ref. - * typeck2.c (build_scoped_ref): Simplify. Do nothing if it - would cause an error or if -pedantic. - * class.c (alter_access): Lose binfo parm. - -2000-02-26 Mark Mitchell - - * semantics.c (simplify_aggr_init_exprs_p): Don't walk into - types. - -2000-02-25 Alfred Minarik - - * rtti.c (get_vmi_pseudo_type_info): Move __vmi_class_type_info - pseudo_type_info creation into the std namespace - -2000-02-26 Mark Mitchell - - * cp-tree.h (DECL_NEEDED_P): Tweak to correct usage before EOF. - (import_export_class): Remove declaration. - * decl2.c (import_export_class): Make it static. - * dump.c (dequeue_and_dump): Handle PREDECREMENT_EXPR, - PREINCREMENT_EXPR, POSTDECREMENT_EXPR, POSTINCREMENT_EXPR, - EXPR_WITH_FILE_LOCATION. - * lex.c (check_newline): Tweak filename/lineno setting. - * semantics.c (begin_while_stmt): Fix typo in comment. - -2000-02-26 Richard Kenner - - * lang-options.h (-fmessage-length=): Add missing option. - - * Make-lang.in (CXX_SRCS): Add .h files and sort list. - -2000-02-26 Zack Weinberg - - * Make-lang.in: Delete refs to LIBGCC2_DEPS. - -2000-02-25 Jim Wilson - - * optimize.c (expand_call_inline): Emit the return label before - evaluating the return value. - -2000-02-24 Mark Mitchell - - * lex.c (check_newline): Use push_srcloc and pop_srcloc, rather - than duplicating functionality here. - * optimize.c: Include input.h. - (expand_call_inline): Use push_srcloc and pop_srcloc. - * parse.y (maybe_cv_qualifier): Remove calls to emit_line_note. - * parse.c: Regenerated. - * Makefile.in (lex.o): Depend on input.h. - (optimize.o): Likewise. - -2000-02-24 Nathan Sidwell - - * decl.c (grokdeclarator): Diagnose qualifiers on non-member - function type, rather than ICE. - -2000-02-23 Jason Merrill - - * decl.c (grokdeclarator): Call decl_type_access_control. - * parse.y (parse_end_decl): Don't call decl_type_access_control if - decl is null. - -2000-02-23 Nathan Sidwell - - * decl.c (decls_match): Remove obsolete static member nadgering. - -2000-02-21 Martin v. Löwis - - * decl.c (grokdeclarator): Change ANSI to ISO. - * lex.c (consume_string, readescape, do_identifier): Likewise. - (parse_float, real_yylex): Likewise. - * parse.y (paren_expr_or_null, paren_cond_or_null): Likewise. - (unary_expr, new_initializer, cast_expr, primary, primary_no_id, - new_type_id, maybe_label_decls, simple_stmt, - for.init.statement): Likewise. - * pt.c (do_decl_instantiation, do_type_instantiation): Likewise. - * semantics.c (finish_named_return_value): Likewise. - * parse.c: Regenerate. - -2000-02-21 Mark Mitchell - - * cp-tree.h (CPTI_VTABLE_INDEX_TYPE): New macro. - (CPTI_CLASS_STAR_TYPE): Remove. - (vtable_index_type): Likewise. - (class_star_type_node): Remove. - (TYPE_PTRMEMFUNC_FN_TYPE): Adjust for the new ABI. - (build_binary_op_nodefault): Remove. - * call.c (build_new_op): Use build_binary_op instead of - build_binary_op_nodefault. - * decl.c (init_decl_processing): Remove class_star_type_node - initialization. Make delta_type_node ptrdiff_type_node under the - new ABI. Initialize vtable_index_type. - (build_ptrmemfunc_type): Build different structures for the new - ABI. - (build_enumerator): Use build_binary_op instead of - build_binary_op_nodefault. - * method.c (build_overload_value): Mangle pointers-to-members - appropriately under the new ABI. - * typeck.c (build_array_ref): Use build_binary_op instead of - build_binary_op_nodefault. - (get_member_function_from_ptrfunc): Adjust for the new ABI. - (build_binary_op_nodefault): Rename to ... - (build_binary_op): ... this. Remove old version. Adjust for - pointer-to-member comparisons under the new ABI. - (build_ptrmemfunc1): Remove dead code. Adjust for the new ABI. - (build_ptrmemfunc): Adjust for the new ABI. - (expand_ptrmemfunc_cst): Likewise. - (delta2_from_ptrmemfunc): Assert that we're not using the new ABI. - (pfn_from_ptrmemfunc): Adjust for the new ABI. - -2000-02-21 Gabriel Dos Reis - - * call.c (build_object_call): Compress consecutive calls to - cp_error. - (build_conditional_expr): Say 'ISO C++' not 'ANSI C++'. - (build_op_delete_call): Adjust message formatting. - - * class.c (check_bases): Compress consecutive calls to - cp_pedwarn. - (finish_struct_anon): Say 'ISO C++'. - - * decl.c (start_decl): Same here. - (grok_reference_init): Likewise. - (grokfndecl): Correct message formatting. - (grokfndecl): Improve diagnostic. - (check_static_variable_definition): Likewise. Say 'ISO C++' - (compute_array_index_type): Say 'ISO C++' - (create_array_type_for_decl): Compress consecutive calls to - cp_error. - (grokdeclarator): Say 'ISO C++' - (grok_op_properties): Likewise. - - * decl2.c (delete_sanity): Clairify diagnostic. - (check_member_template): Same here. - (grok_function_init): Use consistent terminology. - - * expr.c (do_case): Say 'ISO C++' - - * friend.c (do_friend): Compress consecutive calls to warning. - -2000-02-20 Mark Mitchell - - * cp-tree.h (merge_primary_and_secondary_vtables_p): New macro. - * class.c (build_secondary_vtable): Reorganize. Don't create a - new vtable under the new ABI. - (layout_vtable_decl): Don't add num_extra_vtbl_entries when - computing the size. - (build_vtbl_initializer): Don't return a CONSTRUCTOR; just return - the initializing elements. - (initialize_vtable): New function. - (dfs_finish_vtbls): Use it. - (dfs_accumulate_vtbl_inits): New function. - (finish_vtbls): Merge primary and secondary vtables under the new - ABI. - (finish_struct_1): Remove redundant call to layout_vtable_decl. - * init.c (expand_virtual_init): Deal with BINFO_VTABLEs that - aren't VAR_DECLs. - - * class.c (build_vtable): New function, split out from ... - (get_vtable_decl): ... here, and ... - (build_secondary_vtable): ... here. - - * pt.c (tsubst_decl): Fix formatting. - -2000-02-19 Richard Kenner - - * class.c (build_primary_vtable, layout_vtable_decl): Likewise. - (avoid_overlap, build_base_field): Likewise. - (build_base_field, build_base_fields, is_empty_class): - Test DECL_SIZE with integer_zero. - (layout_class_type): Set CLASSTYPE_SIZE_UNIT. - * cp-tree.h (struct lang_type): New field size_unit. - (CLASSTYPE_SIZE_UNIT): New macro. - * decl.c (init_decl_processing): Set DECL_SIZE_UNIT. - (cp_finish_decl): Delete -Wlarger-than processing. - * optimize.c (remap_decl): Walk DECL_SIZE_UNIT. - * pt.c (tsubst_decl): Set DECL_SIZE_UNIT. - * tree.c (make_binfo): binfo vector is one entry longer. - (walk_tree): Walk DECL_SIZE_UNIT. - -2000-02-19 Mark Mitchell - - * class.c (dfs_build_vcall_offset_vtbl_entries): Fix typo in - comment. - (build_vtable_entry): Don't assume all vtable entries are - functions. - (build_vtbl_initializer): Adjust accordingly. - (get_vtable_decl): Fix formatting. - -2000-02-18 Jason Merrill - - * semantics.c (deferred_type_access_control): Walk the entire - type_lookups list. - (save_type_access_control): Rename from - initial_deferred_type_access_control. Just remember the value. - (decl_type_access_control): New fn. - (begin_function_definition): Use deferred_type_access_control, after - we've started the function. Set type_lookups to error_mark_node. - * parse.y (frob_specs, fn.def1): Adjust. - (parse_decl0, parse_field, parse_field0, parse_bitfield): New fns. - (parse_end_decl, parse_bitfield0, parse_method): New fns. - (fn.def2, initdcl, initdcl0_innards, nomods_initdcl0): Use them. - (after_type_component_declarator0): Likewise. - (after_type_component_declarator): Likewise. - (notype_component_declarator): Likewise. - * cp-tree.h: Adjust. - - * decl.c (redeclaration_error_message): Allow redeclaration of - namespace-scope decls. - -2000-02-18 Martin von Loewis - - * typeck2.c (my_friendly_abort): Use GCCBUGURL. - -2000-02-17 Mark Mitchell - - * class.c (add_method): Don't set DECL_VIRTUAL_CONTEXT. - * decl2.c (grokclassfn): Likewise. - - * ir.texi: Document DECL_TEMPLATE_INSTANTIATIONS. - - * decl2.c (lang_decode_option): Don't set default message length - here. - * lex.c (lang_init_options): Set it here. - -2000-02-16 Mark Mitchell - - Make DECL_CONTEXT mean the class in which a member function was - declared, even for a virtual function. - * cp-tree.h (DECL_CLASS_CONTEXT): Adjust. - (DECL_FRIEND_CONTEXT): New macro. - (DECL_REAL_CONTEXT): Remove. - (SET_DECL_FRIEND_CONTEXT): Likewise. - (DECL_VIRTUAL_CONTEXT): Adjust. - (DECL_CLASS_SCOPE_P): Use TYPE_P. - (add_friends): Remove. - (hack_decl_function_context): Likewise. - * call.c (build_new_function_call): Replace DECL_REAL_CONTEXT with - CP_DECL_CONTEXT. - (build_over_call): Fix indentation. Use DECL_CONTEXT - instead of DECL_CLASS_CONTEXT. - * class.c (dfs_build_vcall_offset_vtbl_entries): Likewise. - (add_method): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. - (strictly_overrides): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. - (build_vtbl_or_vbase_field): Don't set DECL_CLASS_CONTEXT. - (build_base_field): Likewise. - (finish_struct_1): Likewise. - (build_self_reference): Likewise. - * decl.c (push_class_binding): Use CP_DECL_CONTEXT, not - DECL_REAL_CONTEXT. - (pushtag): Use decl_function_context, not - hack_decl_function_context. - (decls_match): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. - (duplicate_decls): Use DECL_VIRTUAL_CONTEXT. - (pushdecl): Remove bogus code. - (start_decl): Use DECL_CONTEXT rather than DECL_CLASS_CONTEXT. - (cp_finish_decl): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. - (grokfndecl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. - Use decl_function_context, nothack_decl_function_context. - (grokvardecl): Don't set DECL_CLASS_CONTEXT. - (grokdeclarator): Likewise. Use decl_function_context, not - hack_decl_function_context. - (copy_args_p): Document. Don't use DECL_CLASS_CONTEXT. - (start_function): Use DECL_FRIEND_CONTEXT, not - DECL_CLASS_CONTEXT. Use decl_function_context, not - hack_decl_function_context. - (finish_function): Use decl_function_context, not - hack_decl_function_context. - (maybe_retrofit_in_chrg): Use DECL_CONTEXT, not - DECL_CLASS_CONTEXT. - (grokclassfn): Set DECL_VIRTUAL_CONTEXT, not DECL_CONTEXT. - (finish_static_data_member_decl): Don't set DECL_CLASS_CONTEXT. - (grokfield): Likewise. - (finish_builtin_type): Likewise. - (finish_vtable_vardec): Use decl_function_context, not - hack_decl_function_context. - (import_export_decl): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. - (start_static_initialization_or_destruction): Likewise. - (finish_static_initialization_or_destruction): Likewise. - (mark_used): Adjust logic for deciding when to synthesize methods. - * dump.c (dequeue_and_dump): Use CP_DECL_CONTEXT, not - DECL_REAL_CONTEXT. - * error.c (dump_function_decl): Use DECL_CONTEXT, not - DECL_CLASS_CONTEXT. - * friend.c (is_friend): Likewise. - (add_friends): Remove. - (do_friend): Use SET_DECL_FRIEND_CONTEXT. - * lex.c (begin_definition_of_inclass_inline): Use - decl_function_context, not hack_decl_function_context. - (process_next_inline): Likewise. - (do_identifier): Use CP_DECL_CONTEXT, not DECL_REAL_CONTEXT. - * method.c (set_mangled_name_for_decl): Use DECL_CONTEXT, not - DECL_CLASSS_CONTEXT. - (hack_identifier): Likewise. - (synthesize_method): Use decl_function_context, not - hack_decl_function_context. - * pt.c (template_class_depth_real): Use CP_DECL_CONTEXT, not - DECL_REAL_CONTEXT. - (is_member_template): Use decl_function_context, not - hack_decl_function_context. Use DECL_CONTEXT, not - DECL_CLASS_CONTEXT. - (build_template_decl): Set DECL_VIRTUAL_CONTEXT, not - DECL_CLASS_CONTEXT. - (check_default_tmpl_args): Use CP_DECL_CONTEXT, not - DECL_REAL_CONTEXT. - (push_template_decl_real): Likewise. - (instantiate_class_template): Don't call add_friends. - (tsubst_default_argument): Use DECL_CONTEXT, not - DECL_REAL_CONTEXT. - (tsubst_decl): Set DECL_VIRTUAL_CONTEXT, not DECL_CLASS_CONTEXT. - Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. - (set_meangled_name_for_template_decl): Use DECL_CONTEXT, not - DECL_CLASS_CONTEXT. - * repo.c (repo_inline_used): Likewise. - * search.c (current_scope): Adjust for new _CONTEXT macros. - (context_for_name_lookup): Use CP_DECL_CONTEXT, not - DECL_REAL_CONTEXT. - (friend_accessible_p): Use DECL_CONTEXT, not DECL_CLASS_CONTEXT. - (lookup_fnfields_here):Likewise. - (check_final_overrider): Likewise. - (init_vbase_pointers): Likewise. - (virtual_context): Likewise. - * semantics.c (finish_member_declaration): Just set DECL_CONTEXT. - (expand_body): Use decl_function_context, not - hack_decl_function_context. - * tree.c (hack_decl_function_context): Remove. - * typeck.c (build_x_function_call): Use DECL_CONTEXT, not - DECL_CLASS_CONTEXT. - * typeck2.c (error_not_base_type): Likewise. - -2000-02-15 Jason Merrill - - * decl.c (xref_tag): Don't SET_IDENTIFIER_NAMESPACE_VALUE. - -2000-02-16 Kaveh R. Ghazi - - * Make-lang.in (g++spec.o): Depend on $(GCC_H), not gcc.h. - -2000-02-15 Jonathan Larmour - - * lang-specs.h: Add new __GNUC_PATCHLEVEL__ define to default spec. - -2000-01-16 Gabriel Dos Reis - - * decl2.c (lang_decode_option): Enable automatic line wrapping. - -2000-02-13 Jason Merrill - - * parse.y (frob_specs): Split out... - (parse_decl): From here. - (fn.def2): Call initial_deferred_type_access_control. - (after_type_component_declarator0): Call frob_specs. - (notype_component_declarator0): Likewise. - * search.c (friend_accessible_p): Nested classes are friends of their - enclosing classes. - -2000-02-10 Mark Mitchell - - * ir.texi (ADDR_EXPR): Document the fact that an ADDR_EXPR can be - used to create an implicit temporary. - - * class.c (dfs_modify_vtables): Tweak calculation of functions to - override. - -2000-02-08 Nathan Sidwell - - * typeck.c (strip_all_pointer_quals): Use TYPE_MAIN_VARIANT, to - strip array element qualifiers too. - -2000-02-07 Mark Mitchell - - * decl.c (store_parm_decls): Don't build cleanups for parameters - while processing_template_decl. - -2000-02-07 Jason Merrill - - * cp-tree.h (struct saved_scope): Add incomplete field. - (namespace_scope_incomplete): New macro. - * decl.c (pushdecl): Use it. - (hack_incomplete_structures): Use it. See through artificial - binding levels. - (mark_saved_scope): Mark it. - - Implement access control for nested types. - * search.c (type_access_control): New fn. - (accessible_p): Now we do perform access control for types. - * semantics.c (deferred_type_access_control): New fn. - (initial_deferred_type_access_control): New fn. - (begin_function_definition): Call it. Add lookups parm. - * decl.c (struct binding_level): Add this_class field. - (pushlevel_class): Set it. - (mark_binding_level): Mark it. - (lookup_name_real): Use it. Call type_access_control. - (mark_saved_scope): Mark lookups field. - * cp-tree.h (flagged_type_tree): Add lookups field. - (struct saved_scope): Add lookups field. - (type_lookups): New macro. - * parse.y (declmods): Now . - (parse_decl): Add lookups parm. Call - initial_deferred_type_access_control. - (lang_extdef): Clear type_lookups. - (typed_declspecs, declmods, typespec): Set lookups field. - (initdcl): Call deferred_type_access_control. - (fn.def1, fn.def2, typed_declspecs1, initdcl0_innards, nomods_initdcl0, - component_decl_1, named_parm): Adjust. - * friend.c (is_friend): Nested classes are friends of their - enclosing classes. - - * class.c (currently_open_derived_class): New fn. - * method.c (hack_identifier): Use it. - - * lex.c (do_identifier): Remove obsolete code. - - * parse.y (typed_typespecs): Propagate new_type_flag properly. - -2000-02-05 Zack Weinberg - - * tinfo.h: Remove apostrophes from C++ comment (xgettext - thinks this file is plain C). - -2000-02-05 Kaveh R. Ghazi - - * Makefile.in (call.o): Depend on $(EXPR_H). - - * call.c: Include "expr.h". - - * class.c (dump_class_hierarchy): Add prototype. - - * search.c (dfs_get_pure_virtuals): Likewise. - -2000-02-1 Ulrich Drepper - - * parse.y (simple_stmt): Allow :: token in asm parameter list. - * parse.c: Rebuilt. - -2000-01-31 Jim Wilson - - * class.c (build_vtbl_or_vbase_field): New parameter fcontext. - Store it in DECL_FCONTEXT. - (build_vbase_pointer_fields, create_vtable_ptr): Fix callers. - -2000-01-31 Jason Merrill - - * tinfo.h (old abi): #include "tconfig.h". - * tinfo.cc (convert_to_base): Move into old abi section. - -2000-01-31 Mark Mitchell - - * cp-tree.h (BINFO_VIRTUALS): Tweak documentation. - (CLASSTYPE_PRIMARY_BINFO): Use BINFO_PRIMARY_BINFO. - (BINFO_PRIMARY_BINFO): New macro. - (BF_DELTA): Rename to ... - (BV_DELTA): ... this. - (BF_VCALL_INDEX): Rename to ... - (BV_VCALL_INDEX): ... this. - (BF_FN): Rename to ... - (BV_FN): ... this. - * class.c (build_vbase_path): Adjust for changes to reverse_path. - (set_rtti_entry): Rename BF_ macros to BV_ variants. - (modify_vtable_entry): Simplify. - (add_virtual_function): Rename BF_ macros to BV_ variants. - (build_vtable_initializer): Likewise. - (get_class_offset_1): Remove. - (dfs_get_class_offset): Likewise. - (get_class_offset): Likewise. - (dfs_find_final_overrider): New function. - (find_final_overrider): Likewise. - (modify_one_vtable): Remove. - (dfs_find_base): New function. - (dfs_modify_vtables): Fold modify_one_vtable in here. Use - find_final_overrider. - (modify_all_vtables): Adjust. Set BV_VCALL_INDEX on new - virtuals. - (dfs_fixup_vtable_deltas): Remove. - (override_one_vtable): Remove. - (merge_overrides): Likewise. - (layout_virtual_bases): Make sure BINFO_OFFSET is set right for - unreal chilren of virtual bases. - (finish_struct_1): Don't use merge_overrides. Don't use - dfs_fixup_vtable_deltas. - * tree.c (reverse_path): Return a TREE_LIST, not a chain of - BINFOs. - -2000-01-31 Herman A.J. ten Brugge - Jason Merrill - - * tinfo.h: Rename USItype to myint32, depend on BITS_PER_UNIT. - -2000-01-31 Alfred Minarik - - * exception.cc (__throw_bad_typeid): Add missing std::. - -2000-01-31 Kaveh R. Ghazi - - * cp-tree.h (make_thunk): PROTO -> PARAMS. - -2000-01-31 Nathan Sidwell - - * cp-tree.h (new_abi_rtti_p): Use flag_new_abi. - - Runtime support for new-abi rtti. - * inc/typeinfo (type_info::operator!=): Define in class. - (type_info::before, type_info::name, type_info::operator==, - type_info::operator!=): Define new ABI implementations. - (type_info::is_pointer_p, type_info::is_function_p): Declare - new virtual functions. - (type_info::do_catch, type_info::do_upcast): Likewise. - - * tinfo.h (__base_class_info): Define new class. - (__class_type_info): Likewise. - (__si_class_type_info): Likewise. - (__vmi_class_type_info): Likewise. - (__dynamic_cast): Prototype. - - * tinfo.cc: Conditionalize old and new rtti mechanisms. - (type_info::is_pointer_p): Define new function. - (type_info::is_function_p): Likewise. - (type_info::do_catch): Likewise. - (type_info::do_upcast): Likewise. - (vtable_prefix): New structure for vtable access. - (adjust_pointer): Define new template function. - (contained_p, public_p, virtual_p, contained_public_p, - contained_nonpublic_p, contained_nonvirtual_p): Define new - functions. - (nonvirtual_base_type): New local variable. - (__class_type_info::~__class_type_info): Define. - (__si_class_type_info::~__si_class_type_info): Likewise. - (__vmi_class_type_info::~__vmi_class_type_info): Likewise. - (__class_type_info::do_catch): Define new function. - (__class_type_info::do_upcast): Likewise. - (__class_type_info::find_public_src): Likewise. - (__class_type_info::do_find_public_src): Likewise. - (__si_class_type_info::do_find_public_src): Likewise. - (__vmi_class_type_info::do_find_public_src): Likewise. - (__class_type_info::do_dyncast): Likewise. - (__si_class_type_info::do_dyncast): Likewise. - (__vmi_class_type_info::do_dyncast): Likewise. - (__class_type_info::do_upcast): Likewise. - (__si_class_type_info::do_upcast): Likewise. - (__vmi_class_type_info::do_upcast): Likewise. - (__dynamic_cast): Likewise. - - * tinfo2.cc (__fundamental_type_info): Define new class. - (__pointer_type_info): Likewise. - (__reference_type_info): Likewise. - (__array_type_info): Likewise. - (__function_type_info): Likewise. - (__enum_type_info): Likewise. - (__ptr_to_member_type_info): Likewise. - (__fundamental_type_info::~__fundamental_type_info): Define. - (__pointer_type_info::~__pointer_type_info): Likewise. - (__reference_type_info::~__reference_type_info): Likewise. - (__array_type_info::~__array_type_info): Likewise. - (__function_type_info::~__function_type_info): Likewise. - (__enum_type_info::~__enum_type_info): Likewise. - (__ptr_to_member_type_info::~__ptr_to_member_type_info): Likewise. - (__pointer_type_info::do_catch): Define new function. - (__ptr_to_member_type_info::do_catch): Define new function. - - (__throw_type_match_rtti_2): Use new ABI interface, if enabled. - (__is_pointer): Likewise. - - * exception.cc (__cplus_type_matcher): Deal with new-abi rtti. - -2000-01-30 Mark Mitchell - - * cp/class.c (build_vtable): Rename to build_primary_vtable. - (prepare_fresh_vtable): Rename to build_secondary_vtable. - (make_new_vtable): New function. - (modify_vtable_entry): Handle generation of new vtables correctly. - (modify_one_vtable): Remove unused parameter. - (dfs_fixup_vtable_deltas): Likewise. - (override_one_vtable): Use build_secondary_vtable. - (finish_struct_1): Use build_primary_vtable and - build_secondary_vtable. - -2000-01-28 Ulrich Drepper - - * cp/decl.c: Adjust variable names, comments, help strings. - -2000-01-29 Nathan Sidwell - - * new2.cc (operator delete[]): Use operator delete, don't assume - implementation. - -2000-01-29 Nathan Sidwell - - * class.c (build_vtbl_initializer): Add argument to - build_vtable_entry call. - -2000-01-27 Mark Mitchell - - * cp-tree.def (THUNK_DECL): Discuss vcall indices. - * cp-tree.h (BINFO_VIRTUALS): Update documentation. - (BF_DELTA): New macro. - (BF_VCALL_INDEX): Likewise. - (BF_FN): Likewise. - (THUNK_VCALL_OFFSET): Likewise. - (make_thunk): Change prototype. - * class.c (build_vtable_entry): Integrate - build_vtable_entry_for_fn. Handle vcall indices. - (build_vtable_entry_for_fn): Remove. - (set_rtti_entry): Handle vcall indices. Use BF_DELTA, - BF_VCALL_INDEX, BF_FN. - (modify_vtable_entry): Integrate common code from - modify_one_vtable and dfs_fixup_vtable_deltas. - (add_virtual_function): Set BF_VCALL_INDEX. - (build_vtbl_initializer): Simplify. Use BF_DELTA, BF_VCALL_INDEX, - and BF_FN. - (modify_one_vtable): Simplify. - (dfs_fixup_vtable_deltas): Likewise. - (override_one_vtable): Use BF_DELTA, BF_VCALL_INDEX, BF_FN. - * method.c (make_thunk): Handle vcall indices. - -2000-01-28 Nathan Sidwell - - Compiler side new abi rtti (not enabled). - * cp-tree.h (new_abi_rtti_p): New macro. - (emit_support_tinfos): Prototype new function. - (tinfo_decl_p): Likewise. - (emit_tinfo_decl): Likwise. - * rtti.c (TINFO_PSEUDO_TYPE, TINFO_VTABLE_DECL): New accessor - macros. - (doing_runtime): New local static. - (init_rtti_processing): Add new-abi initializer. - (get_tinfo_decl): Add new-abi logic. - (tinfo_from_decl): Likewise. - (build_dynamic_cast_1): Likewise. - (qualifier_flags): New static function. - (tinfo_base_init): Likewise. - (generic_initializer): Likewise. - (ptr_ref_initializer): Likewise. - (ptmd_initializer): Likewise. - (class_hint_flags): Likewise. - (class_initializer): Likewise. - (synthesize_tinfo_var): Likewise. - (create_real_tinfo_var): Likewise. - (create_pseudo_type_info): Likewise. - (get_vmi_pseudo_type_info): Likewise. - (create_tinfo_types): Likewise. - (emit_support_tinfos): New global function. - (tinfo_decl_p): New global predicate. - (emit_tinfo_decl): New global function. - * class.c (set_rtti_entry): Generalize for old and new rtti. - (build_vtbl_initializer): Likewise. - * decl2.c (finish_file): Likewise. - -2000-01-27 Jim Wilson - - * optimize.c (remap_decl): Add walk_tree calls for DECL_SIZE (t) - and TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (t))). - -2000-01-27 Mike Stump - - * decl.c (pushdecl): Fix up shadow warnings with respect to implicit - for scopes. - -2000-01-26 Jason Merrill - - * pt.c (unify): Use fold, not maybe_fold_nontype_arg. - -2000-01-26 J"orn Rennecke - - * optimize.c (calls_setjmp_r): Supply new argument - to special_function_p. - -2000-01-26 Kaveh R. Ghazi - - * call.c: PROTO -> PARAMS. - * class.c: Likewise. - * cp-tree.h: Likewise. - * cvt.c: Likewise. - * decl.c: Likewise. - * decl.h: Likewise. - * decl2.c: Likewise. - * dump.c: Likewise. - * errfn.c: Likewise. - * error.c: Likewise. - * except.c: Likewise. - * expr.c: Likewise. - * init.c: Likewise. - * input.c: Likewise. - * lex.c: Likewise. - * lex.h: Likewise. - * method.c: Likewise. - * optimize.c: Likewise. - * parse.y: Likewise. - * pt.c: Likewise. - * repo.c: Likewise. - * rtti.c: Likewise. - * search.c: Likewise. - * semantics.c: Likewise. - * spew.c: Likewise. - * tree.c: Likewise. - * typeck.c: Likewise. - * typeck2.c: Likewise. - * xref.c: Likewise. - -2000-01-25 Richard Henderson - - * typeck.c (build_binary_op_nodefault): Remove UNNE_EXPR. - -2000-01-25 Mark Mitchell - - * cp-tree.h (vcall_offset_in_vtable_p): New macro. - * class.c (build_vbase_offset_vtbl_entries): Fix typo in commment. - (struct vcall_offset_data_s): New type. - (dfs_vcall_offset_queue_p): New function. - (dfs_build_vcall_offset_vtbl_entries): Likewise. - (build_vcall_offset_vtbl_entries): Likewise. - (layout_vtable_decl): Likewise. - (num_vfun_entries): Likewise. - (num_extra_vtbl_entries): Add the entries for vcall offsets. - (build_vtbl_initializer): Likewise. - (dfs_finish_vtabls): Use layout_vtable_decl. - (modify_one_vtables): Always duplicate vtables under the new ABI. - (finish_struct_1): Use layout_vtable_decl. - -2000-01-25 Kaveh R. Ghazi - - * decl.c (member_function_or_else): Change third arg from a format - specifier to an `enum overload_flags'. Callers changed. - -2000-01-25 Gabriel Dos Reis - - * typeck.c (composite_pointer_type, c_sizeof, expr_sizeof, - build_binary_op_nodefault, build_unary_op, build_reinterpret_cast, - build_const_cast, get_delta_difference, check_return_expr): Avoid - ANSI string concatenation usage. - -2000-01-24 Mark Mitchell - - * class.c (layout_class_type): Put the fields required to make a - class non-empty at the end, not the beginning, of the TYPE_FIELDs - list. - -2000-01-24 Jason Merrill - - * pt.c (maybe_fold_nontype_arg): Do nothing if we're not in a - template. - - * decl2.c (mark_used): Do instantiate inlines that have been - explicitly instantiated. - -2000-01-24 Richard Henderson - - * call.c (build_over_call): Use expand_tree_builtin. - * typeck.c (build_function_call_real): Likewise. - (build_binary_op_nodefault): Handle unordered compares. - -2000-01-24 Nathan Sidwell - - * cp-tree.h (CPTI_BAD_CAST, CPTI_BAD_TYPEID, CPTI_DCAST): New - cp_tree_index values. - (throw_bad_cast_node, throw_bad_typeid_node, dynamic_cast_node): - New global node #defines for them. - * rtti.c (call_void_fn): Replace with ... - (build_runtime_decl): ... new static function. - (throw_bad_cast): Use throw_bad_cast_node and build_runtime_decl. - (throw_bad_typeid): Use throw_bad_typeid_node and build_runtime_decl. - (build_dynamic_cast_1): Always produce correctly typed result. - Explicitly produce type_info addresses. Use dynamic_cast_node. - * exception.cc (__throw_bad_cast): Return `void *'. - (__throw_bad_typeid): Return `const type_info &'. - -2000-01-24 Nathan Sidwell - - * cp-tree.h (get_vtable_decl): Prototype new function. - * class.c (get_vtable_decl): New function. Broken out from ... - (build_vtable): ... here. Use it. - * decl2.c (finish_vtable_vardecl): Ignore dummy vtables created - by get_vtable_decl. - -2000-01-24 Nathan Sidwell - - * cp-tree.h (CPTI_TP_DESC_TYPE, CPTI_ACCESS_MODE_TYPE, - CPTI_USER_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_ATTR_DESC_TYPE, - CPTI_PTMF_DESC_TYPE): Remove cp_tree_index enumerations. - (CPTI_TI_DESC_TYPE, CPTI_REF_DESC_TYPE, CPTI_ARY_DESC_TYPE, - CPTI_ENUM_DESC_TYPE, CPTI_CLASS_DESC_TYPE, CPTI_SI_CLASS_DESC_TYPE, - CPTI_VMI_CLASS_DESC_TYPE, CPTI_BASE_DESC_TYPE): New enumerations. - (CPTI_TINFO_FN_ID, CPTI_TINFO_FN_TYPE): Rename to ... - (CPTI_TINFO_DECL_ID, CPTI_TINFO_DECL_TYPE): ... here. - (CPTI_TINFO_VAR_ID): New enumeration. - (__tp_desc_type_node, __access_mode_type_node, - __bltn_desc_type_node, __user_desc_type_node, - __class_desc_type_node, __ptr_desc_type_node, - __attr_desc_type_node, __func_desc_type_node, - __ptmf_desc_type_node, __ptmd_desc_type_node): Remove #defines. - (ti_desc_type_node, bltn_desc_type_node, ptr_desc_type_node, - ref_desc_type_node, ary_desc_type_node, func_desc_type_node, - enum_desc_type_node, class_desc_type_node, - si_class_desc_type_node, vmi_class_desc_type_node, - ptmd_desc_type_node, base_desc_type_node): New #defines. - (tinfo_fn_id, tinfo_fn_type): Rename to ... - (tinfo_decl_id, tinfo_decl_type): ... here. Adjust. - (tinfo_var_id): New enumeration. - (DECL_TINFO_FN_P): Augment comment. - * decl.c (cp_global_trees): Adjust documentation. - * rtti.c (init_rtti_processing): Adjust for tinfo_decl_id, - tinfo_decl_type and tinfo_var_id. - (get_tinfo_decl_dynamic): Adjust for tinfo_decl_type. - (build_typeid): Remove unused variable. - (get_tinfo_var): Use tinfo_var_id. - (tinfo_name): New static function. - (get_tinfo_decl): Adjust for tinfo_decl_id and tinfo_decl_type. - (tinfo_from_decl): Likewise. - (get_base_offset): New static function, broken out of - expand_class_desc. - (expand_si_desc): Use tinfo_name. - (expand_class_desc): Likewise. Lose local static variable. - Use base_desc_type_node. Use get_base_offset. - (expand_ptr_desc): Use tinfo_name. - (expand_attr_desc): Likewise. - (expand_generic_desc): Likewise. - - * tinfo.cc (__GXX_ABI_VERSION): Test value and existence. - * tinfo.h (__GXX_ABI_VERSION): Test value and existence. - -2000-01-23 Mark Mitchell - - * cp-tree.h (__eprintf): Remove declaration. - * tree.c (__eprintf): Remove definition. - -2000-01-23 Zack Weinberg - Mark Mitchell - - * cp-tree.h (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N, - CLEAR_CLASSTYPE_MARKED_N): Avoid signed vs. unsigned warnings. - -2000-01-23 Brad Lucier - - * class.c (dump_class_hierarchy): Print HOST_WIDE_INT properly. - -2000-01-23 Mark Mitchell - - * cp-tree.h (register_dtor_fn): New function. - * decl.c (destroy_local_static): Rename to ... - (register_dtor_fn): ... this. Give it external linkage. - (expand_static_init): Use it. - * decl2.c (do_static_initialization): Likewise, if using - __cxa_atexit. - (do_static_destruction): Check that __cxa_atexit is not in use. - (finish_file): Don't call do_static_destruction if using - __cxa_atexit. - - * typeck.c (convert_arguments): Restore two-message error - reporting. - -2000-01-20 Nathan Sidwell - - Remap dynamic cast hint values to be consistent across ABIs. - * search.c (dynamic_cast_base_recurse): Remap generated value. - (get_dynamic_cast_base_type): Adjust documentation. - * tinfo.h (__user_type_info::dyncast): Likewise. - (__user_type_info::find_public_subobj): Remap BOFF meaning. - * tinfo.cc (__si_type_info::do_dyncast): Remap BOFF meaning. - (__class_type_info::do_dyncast): Likewise. - (__class_type_info::do_find_public_subobj): Likewise. - * tinfo2.cc (__dynamic_cast): Remap BOFF parameter. - -2000-01-19 Gabriel Dos Reis - - * typeck.c (build_unary_op): Use cp_pedwarn, not pedwarn. - - * typeck2.c (incomplete_type_error): Restore previous - cp_error and cp_error_at call sequence. - -2000-01-20 Brad Lucier - - * class.c (dump_class_hierarchy): Make format agree with argument; - cast pointer to unsigned long and print with %lx. - -2000-01-19 Gabriel Dos Reis - - * decl2.c (lang_decode_option): Set default line-wrap length to 72. - - * typeck.c (composite_pointer_type, common_type, - comp_target_parms, c_sizeof, expr_sizeof, build_array_ref, - build_function_call_real, convert_arguments, - build_binary_op_nodefault, pointer_int_sum, pointer_diff, - build_unary_op, mark_addressable, build_compound_expr, - build_static_cast, build_reinterpret_cast, build_const_cast, - build_c_cast, build_modify_expr, get_delta_difference, - build_ptrmemfunc, check_return_expr): Replace 'ANSI C++' with - 'ISO C++'. Fusion consecutive calls to diagnostic message routines - into a single one. - * typeck2.c (readonly_error, abstract_virtuals_error, - process_init_constructor, check_for_new_type): Likewise. - -2000-01-19 Mark Mitchell - - * tree.c (bot_manip): Set DECL_CONTEXT for newly created - VAR_DECLs. - -2000-01-18 Nathan Sidwell - - * cp-tree.h (get_tinfo_fn_dynamic): Remove prototype. - (build_x_typeid): Likewise. - (get_tinfo_fn): Likewise. - (get_tinfo_fn_unused): Rename to ... - (get_tinfo_decl): ... here. - * rtti.c (build_headof): Replace logic error with assertion. - (get_tinfo_fn_dynamic): Rename to ... - (get_tinfo_decl_dynamic): ... here. Make static. Use - complete_type_or_else. - (build_x_typeid): Move into ... - (build_typeid): ... here. Adjust call to - get_tinfo_decl_dynamic. Use tinfo_from_decl. Simplify - throw_bad_typeid expression. - (get_tinfo_fn_unused): Rename to ... - (get_tinfo_decl): ... here. Adjust comment. - (get_tinfo_fn): Delete. - (tinfo_from_decl): New static function. - (get_typeid_1): Call get_tinfo_decl and tinfo_from_decl. - (get_typeid): Use complete_type_or_else. - (build_dynamic_cast_1): Adjust calls to - get_tinfo_decl_dynamic. Simplify throw_bad_cast expression. - * parse.y (primary): Adjust call to build_typeid. - * except.c (build_eh_type_type_ref): Adjust call to - get_tinfo_decl. Mark as used. - * class.c (set_rtti_entry): Adjust call to get_tinfo_decl. - * decl2.c (build_expr_from_tree): Adjust call to build_typeid. - * parse.c: Regenerated. - -2000-01-17 Mark Mitchell - - * class.c (fixed_type_or_null): Don't clear NONNULL. Document - calling convention. - (resolves_to_fixed_type_p): Document calling convention. - * rtti.c (build_x_typeid): Initialize NONNULL. - - * cp-tree.h (build_shared_int_cst): New function. - * call.c (build_over_call): Use DECL_VIRTUAL_CONTEXT, for clarity. - * class.c (modify_vtable_entry): Likewise. - (add_virtual_function): Split out code to generated shared - INTEGER_CSTs to build_share_int_cst. - (modify_all_vtables): Handle all the overridden functions here. - Add overridden functions from non-primary virtual bases to the - primary vtable. - (finish_struct_1): Adjust call to modify_all_vtables. Add - overridden functions from non-primary bases to the vtable. - * tree.c (build_shared_int_cst): New function. - - * cp-tree.h (scratchalloc): Remove. - (build_scratch_list): Likewise. - * call.c (convert_class_to_reference): Replace build_scratch_list - and build_expr_list with build_tree_list. - (add_candidate): Replace scratchalloc with expralloc. Note memory - leak. - (build_user_type_conversion_1): Replace build_scratch_list - and build_expr_list with build_tree_list. - (build_new_op): Likewise. - (build_op_delete_call): Likewise. - (convert_like): Likewise. - * cvt.c (ocp_convert): Likewise. - * decl.c (start_decl): Likewise. - (start_function): Likewise. - (finish_destructor_body): Likewise. - (maybe_build_cleanup_1): Likewise. - * decl2.c (reparse_decl_as_expr): Likewise. - * init.c (perform_member_init): Likewise. - (expand_cleanup_for_base): Likewise. - (build_builtin_delete_call): Likewise. - (build_new_1): Likewise. - (build_delete): Likewise. - * method.c (do_build_assign_ref): Likewise. - * parse.y (already_scoped_stmt): Likewise. - (nontrivial_exprlist): Likewise. - (net_initializer): Likewise. - (initlist): Likewise. - * parse.c: Regenerated. - * rtti.c (build_x_typeid): Likewise. - (build_dynamic_cast_1): Likewise. - * typeck.c (build_x_compound_expr): Likewise. - (build_static_cast): Likewise. - (build_modify_expr): Likewise. - - * cp-tree.h (DECL_VINDEX): Add documentation. - * class.c (build_vtable_entry): Likewise. - (start_vtable): Add comment. - (add_virtual_function): Replace pending_hard_virtuals with - overridden_virtuals and pending_virtuals with new_virtuals. - Replace redundant assignments with assertions. - (check_for_override): Add comment. - (check_bases_and_members): Replace pending_hard_virtuals with - overridden_virtuals and pending_virtuals with new_virtuals. - (create_vtbl_ptr): Likewise. - (layout_class_type): Likewise. - (finish_struct_1): Likewise. Add comments. - -2000-01-16 Mark Mitchell - - * class.c (finish_struct_1): Replace redundant code with - assertions. - - * cp-tree.h (flag_new_abi): Move. - (flag_use_cxa_atexit): Likewise. - (flag_honor_std): Likewise. - (flag_rtti): Likewise. - (vbase_offsets_in_vtable_p): Define. - (vptrs_present_everywhere_p): Likewise. - (TYPE_CONTAINS_VPTR_P): Likewise. - (dfs_walk_real): Declare. - * class.c (build_vbase_pointer_fields): Check - vbase_offsets_in_vtable_p. - (dfs_build_vbase_offset_vtbl_entries): Record the vbase indices in - BINFO_VPTR_FIELD. - (build_vbase_offset_vtbl_entries): Simplify. - (build_vbase_offset_vtbl_entries): Adjust. - (build_vbase_pointer): Add ability to look up vbase offsets in - vtable. - (start_vtable): New function. - (add_virtual_function): Use it. - (determine_primary_base): Use TYPE_CONTAINS_VPTR_P. - (num_extra_vtbl_entries): Use vbase_offsets_in_vtable_p. - (build_vtbl_initializer): Take the type of the complete object as - input. Use it to correctly calculate vbase offsets. - (dfs_finish_vtbls): Pass the complete type to - build_vtbl_initializer. - (check_bases_and_members): Use TYPE_CONTAINS_VPTR_P. - (create_vtable_ptr): Create a vtable even if there are no - new virtual functions, under the new ABI. - (finish_struct_1): Likewise. - (get_vfield_name): Use TYPE_CONTAINS_VPTR_P. - * decl.c (exapnd_static_init): Remove call to - preserve_initializer. - * decl2.c (mark_vtable_entries): Tweak to handle vbase offsets in - vtables. - * init.c (initialize_vtbl_ptrs): Initialize them in pre-order. - (expand_virtual_init): Use vbase_offsets_in_vtable_p. - (construct_virtual_bases): Don't initialize virtual base pointers - under the new ABI. - (build_aggr_init): Clean up comment. - (expand_aggr_init_1): Likewise. - * rtti.c (expand_class_desc): Store the virtual function table - index where the vbase offset lives in the offset field. - * search.c (dfs_walk_real): Make it global. - (dfs_debug_mark): Use TYPE_CONTAINS_VPTR_P. - * tree.c (make_binfo): Don't clear BINFO_VPTR_FIELD. - - * tinfo.h (USItype): Make it signed under the new ABI. - * tinfo.cc (convert_to_base): New function. Encapsulate base - conversion logic here. - (__class_type_info::do_upcast): Use it. - (__class_type_info::do_dyncast): Likewise. - (__class_type_info::do_find_public_subobj): Likewise. - - * init.c (construct_virtual_bases): Don't look up the addresses of - virtual bases at run-time. - - * class.c (build_vbase_pointer): Relocate. - (build_vbase_pointer_fields): Likewise. - (dfs_build_vbase_offset_vtbl_entries): Likewise. - (build_vbase_offset_vtbl_entries): Likewise. - - * decl.c (init_decl_processing): Complain if -fnew-abi - -fno-vtable-thunks is used. - - * decl2.c (lang_decode_option): Don't couple flag_honor_std to - flag_new_abi. - -2000-01-15 Mark Mitchell - - * cp-tree.h (num_extra_vtbl_entries): New function. - (size_extra_vtbl_entries): Likewise. - (dfs_vtable_path_unmark): Likewise. - (dfs_vtable_path_unmarked_real_bases_queue_p): Likewise. - (dfs_vtable_path_marked_real_bases_queue_p): Likewise. - * class.c (num_extra_vtbl_entries): New function. - (size_extra_vtbl_entries): Likewise. - (dfs_build_vbase_offset_vtbl_entries): New function. - (build_vbase_offset_vtbl_entries): Likewise. - (build_vtbl_initializer): Use it. - (finish_struct_1): Adjust vtable sizes (using - num_extra_vtbl_entries). - * expr.c (cplus_expand_expr): Assert that the DECL_RTL for a - THUNK_DECL is non-NULL before expanding it. - * init.c (expand_virtual_init): Adjust the vtable pointer by - size_extra_vtbl_entries before storing it. - * search.c (get_shared_vase_if_not_primary): Adjust prototype. - Handle TREE_LIST parameters here, not in the dfs_* functions. - (dfs_unmarked_real_bases_queue_p): Adjust. - (dfs_marked_real_bases_queue_p): Likewise. - (dfs_vtable_path_unmarked_real_bases_queue_p): New function. - (dfs_vtable_path_marked_real_bases_queue_p): New function. - (dfs_vtable_path_unmark): Likewise. - -2000-01-14 Mark Mitchell - - * optimize.c (copy_body_r): Clear the operand three of a - TARGET_EXPR when copying it. - -2000-01-14 Martin v. Löwis - - * method.c (build_decl_overload_real): Check whether we are in :: - before returning __builtin_new/delete. - -2000-01-13 Mark Mitchell - - * pt.c (tsubst_friend_function): Improve comment. - (instantiate_decl): Avoid crashing when a "nested" function is - instantiated from the top level. - - * dump.c (dqeueue_and_dump): Dump - DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION. - -2000-01-13 Kaveh R. Ghazi - - * call.c: If GATHER_STATISTICS, declare `n_build_method_call'. - -2000-01-13 Nathan Sidwell - - * g++spec.c (lang_specific_driver): Add -fnew-abi if - ENABLE_NEW_GXX_ABI defined. - * Make-lang.in (tinfo.o, tinfo2.o, exception.o, new.o, - opnew.o, opnewnt.o, opvnew.o, opvnewnt.o, opdel.o, opdelnt.o, - opvdel.o, opvdelnt.o): Use GXX_ABI_FLAG switch. - -2000-01-12 Mark Mitchell - - * decl.c (start_cleanup_fn): Call pushdecl. - - * call.c (convert_class_to_reference): Fix typos. - (build_conditional_expr): Handle errors gracefully. - * class.c (push_nested_class): Likewise. - * cp-tree.h (VAR_FUNCTION_OR_PARM_DECL_CHECK): New macro. - (DECL_THIS_EXTERN): Use it. - (DECL_THIS_STATIC): Likewise. - * cvt.c (convert_to_void): Handle errors gracefully. - (build_expr_type_conversion): Likewise. - * decl.c (maybe_push_decl): Likewise. - (start_decl_1): Likewise. - (require_complete_types_for_parms): Likewise. - * parse.y (structsp): Likewise. - (base_class): Likewise. - * parse.c: Regenerated. - * pt.c (finish_member_template_decl): Likewise. - * typeck.c (decay_conversion): Likewise. - - * cp-tree.h (dfs_skip_vbases): New function. - (find_vbase_instance): Likewise. - * class.c (determine_primary_base): Allow a nearly empty base to - serve as a primary base class under the new ABI. - (get_class_offset_1): Rename to ... - (dfs_get_class_offset): ... this. Simplify. Don't issue error - messages here. - (get_class_offset): Use it. Issue error messages here. - (dfs_modify_vtables): Rely on dfs_unmarked_real_bases_queue_p to - find the right copies of virtual bases. - (fixup_vtable_deltas1): Rename to ... - (dfs_fixup_vtable_deltas): ... this. Adjust to handle virtual - bases as primary bases. - (fixup_vtable_deltas): Remove. - (override_one_vtable): Handle virtual bases as primary bases. - (merge_overrides): Likewise. - (finish_struct_1): Likewise. - (dump_class_hierarchy): Dump primary-ness of bases as well. - * search.c (mark_primary_bases): Use a pre-order traversal to - handle primary virtual bases. - (dfs_skip_vbases): New fiunction. - (expand_upcast_fixups): Adjust to handle primary virtual bases. - (fixup_virtual_upcast_offsets): Likewise. - (fixup_all_virtual_upcast_offsets): Likewise. - (dfs_find_vbase_instances): New function. - (find_vbase_instance): Likewise. - -2000-01-11 Mumit Khan - - * lex.c (DIR_SEPARATOR): Delete macro. - -2000-01-12 Gabriel Dos Reis - - * decl2.c (lang_decode_option): Handle automatic line wrapping - option. - -2000-01-11 Mark Mitchell - - * friend.c (do_friend): Don't resolve scopes when processing - template declarations, even if the qualifying scope doesn't - involve template parameters. - -2000-01-10 Mark Mitchell - - * class.c (dfs_modify_vtables_queue_p): Remove. - (modify_all_vtables): Use dfs_unmarked_real_bases_queue_p - and dfs_marked_real_bases_queue_p instead of - dfs_modify_vtables_queue_p. - - * class.c (build_vbase_path): Simplify. - (dfs_propagate_binfo_offsets): New function. - (propagate_binfo_offsets): Use it. - (remove_base_field): Simplify. - (dfs_set_offset_for_vbases): Remove. - (dfs_set_offset_for_shared_vbases): New function. - (dfs_set_offset_for_unshared_vbases): Likewise. - (layout_virtual_bases): Use them. - (layout_basetypes): Don't call propagate_binfo_offsets. - * search.c (dfs_get_vbase_types): Clone completely fresh binfos - for the vbases. - - * class.c (build_base_field): New function, split out from ... - (build_base_fields): ... here. Use it. Allocate primary bases - first, under the new ABI. - (get_vtable_entry): Remove. - (remove_base_field): New function, split out from ... - (remove_base_fields): ... here. Adjust since primary bases come - first under the new ABI. - - * cp-tree.h (expand_direct_vtbls_init): Remove declaration. - (initialize_vtbl_ptrs): New function. - (expand_indirect_vtbls_init): Change prototype. - (convert_pointer_to_vbase): Declare. - * init.c (expand_direct_vtbls_init): Remove. - (dfs_initialize_vtbl_ptrs): New function. - (initialize_vtbl_ptrs): Likewise. - (emit_base_init): Use initialize_vtbl_ptrs. - * search.c (convert_pointer_to_vbase): Make it global. - (expand_indirect_vtbls_init): Remove vtable initialization code. - * semantics.c (setup_vtbl_ptr): Use initialize_vtbl_ptrs. - - * class.c (dfs_finish_vtbls): New function. - (finish_vtbls): Use it. - (dump_class_hierarchy): New function. - - * cp-tree.h (BINFO_PRIMARY_MARKED_P): Change definition. - (BINFO_VBASE_PRIMARY_P): New macro. - (BINFO_VIRTUALS): Add to documentation. - (SET_BINFO_PRIMARY_MARKED_P): Remove. - (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. - (dfs_mark_primary_bases_queue_p): Likewise. - (dfs_unmarked_real_bases_queue_p): New function. - (dfs_marked_real_bases_queue_p): Likewise. - * search.c (dfs_mark_primary_bases): Adjust. - (mark_primary_bases): Likewise. - (get_shared_vbase_if_not_primary): New function. - (dfs_unmarked_real_bases_queue_p): Likewise. - (dfs_marked_real_bases_queue_p): Likewise. - (dfs_get_pure_virtuals): Simplify. - (get_pure_virtuals): Likewise. - -2000-01-10 Kaveh R. Ghazi - - * lex.c: Include tm_p.h. - -2000-01-07 Nathan Sidwell - - * lang-specs.h (__GXX_ABI_VERSION): New preprocessor macro. - -2000-01-06 Jason Merrill - - * decl2.c (comdat_linkage): Don't set DECL_DEFER_OUTPUT. - * pt.c (instantiate_decl): Defer comdat templates that might not be - needed. - - * cp-tree.h (DECL_NEEDED_P): Also true if !DECL_COMDAT. - * decl2.c (finish_vtable_vardecl): Don't check !DECL_COMDAT. - (finish_file): Likewise. - - * decl2.c (import_export_class): Undo 12/14 change. - - * error.c (dump_decl): operator new, not operatornew. - - * class.c (field_decl_cmp): A nontype is "greater" than a type. - * search.c (lookup_field_1): Look for the last field with the - desired name. - -2000-01-05 Nathan Sidwell - - * decl2.c (lookup_arg_dependent): Deal with FNS not being a - FUNCTION_DECL. - -2000-01-05 Nathan Sidwell - - * typeck.c (build_static_cast): Don't strip target qualifiers - when casting from a class. - -2000-01-04 Kaveh R. Ghazi - - * class.c (warn_hidden): Initialize variable `fndecl'. - -2000-01-03 Ulrich Drepper - - * decl.c (flag_isoc9x): New variable to be able to use code in - c-common.c. For now always zero. - -2000-01-03 Mark Mitchell - - * cp-tree.h (CLASSTYPE_VBASECLASSES): Improve documentation. - * class.c (layout_basetypes): Don't set BINFO_INHERITANCE_CHAIN - or unshare_base_binfos for virtual bases here. - * search.c (dfs_get_vbase_types): Do it here. - (get_vbase_types): Adjust. - -2000-01-02 Mark Mitchell - - * cp-tree.h (CLASSTYPE_VFIELDS): Move definition. - (BINFO_PRIMARY_MARKED_P): Use flag 5. - (SET_BINFO_PRIMARY_MARKED_P): Likewise. - (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. - (unmark_primary_bases): Remove declaration. - (unmarkedp): Declare. - (dfs_vbase_unmark): Likewise. - * class.c (determine_primary_base): Return immediately if there - are no base classes. Call mark_primary_bases here. - (modify_all_direct_vtables): Remove. - (modify_all_indirect_vtables): Remove. - (dfs_modify_vtables_queue_p): New function. - (dfs_modify_vtables): New function. - (modify_all_vtables): Use them. - (build_base_fields): Build FIELD_DECLs for primary virtual base - classes. - (create_vtable_ptr): Don't call determine_primary_base here. - (dfs_mark_primary_bases_and_set_vbase_offsets): Rename to ... - (dfs_set_offset_for_vbases): ... this. - (layout_virtual_bases): Use it. - (layout_class_type): Call determine_primary_base here. - * search.c (unmarkedp): Make it global. - (shared_marked_p): Simplify. - (shared_unmarked_p): Likewise. - (dfs_primary_bases_queue_p): Remove. - (dfs_unmark_primary_bases): Likewise. - (unmark_primary_bases): Likewise. - (mark_primary_bases): Simplify. - (get_pure_virtuals): Don't call mark_primary_bases here. - (dfs_vbase_unmark): New function. - (get_vbase_types): Simplify. - - * class.c (struct base_info): Remove. - (determine_primary_base): Take has_virtual_p rather than a - base_info as input. Don't calculate max_has_virtual. - (finish_struct_bits): Remove max_has_virtual argument. - (create_vtable_ptr): Remove max_has_virtual_p argument. - (layout_virtual_bases): Remove max argument. - (layout_basetypes): Likewise. - (layout_class_type): Remove max_has_virtual_p argument. - (finish_struct_1): Remove max_has_virtual. - - * cp-tree.h (dfs_mark_primary_bases_queue_p): New function. - (layout_basetypes): Remove. - * class.c (propagate_binfo_offsets): Moved here from tree.c. - Update to handle primary virtual bases. - (remove_base_fields): New function, split out from - layout_basetypes. - (dfs_mark_primary_bases_and_set_vbase_offsets): New function. - (layout_virtual_bases): New function, split out from - layout_basetypes. Update to handle primary virtual bases. - (layout_basetypes): Moved here from tree.c. Use - remove_base_fields and layout_virtual_bases. - * search.c (dfs_mark_primary_bases_queue_p): New function. - (mark_primary_bases): Use it. - * tree.c (CEIL): Remove. - (propagate_binfo_offsets): Remove. - (layout_basetypes): Remove. - -2000-01-01 Mark Mitchell - - * cp-tree.h (CLASSTYPE_N_BASECLASSES): Use BINFO_N_BASETYPES. - (BINFO_PRIMARY_MARKED_P): New macro. - (SET_BINFO_PRIMARY_MARKED_P): Likewise. - (CLEAR_BINFO_PRIMARY_MARKED_P): Likewise. - (mark_primary_bases): New function. - (unmark_primary_bases): Likewise. - * search.c (get_abstract_virtuals_1): Remove. - (dfs_mark_primary_bases): New function. - (mark_primary_bases): Likewise. - (dfs_unmark_primary_bases): Likewise. - (unmark_primary_bases): Likewise. - (dfs_get_pure_virtuals): Likewise. - -2000-01-01 Mark Mitchell - - * cp-tree.h (skip_rtti_stuff): Adjust prototype. - * class.c (skip_rtti_stuff): Reorganize parameters and return value. - (modify_one_vtable): Adjust. - (fixup_vtable_deltas1): Likewise. - (override_one_vtable): Likewise. - * search.c (get_abstract_virtuals_1): Likewise. - (get_pure_virtuals): Likewise. - (expand_upcast_fixups): Likewise. - * tree.c (debug_binfo): Likewise. - - * class.c (build_vtable): Don't return a value. Don't rebuild - vtables for bases that have already been handled. - (prepare_fresh_vtable): Don't rebuild vtables for bases that have - already been handled. - (modify_one_vtable): Adjust accordingly. - (fixup_vtable_deltas1): Likewise. - (finish_struct_1): Likewise. - -2000-01-01 Martin v. Löwis - - * call.c (build_new_method_call): Also check destructors. - -See ChangeLog.2 for earlier changes. diff --git a/gcc/cp/ChangeLog.egcs b/gcc/cp/ChangeLog.egcs deleted file mode 100644 index ddefd5c52fe..00000000000 --- a/gcc/cp/ChangeLog.egcs +++ /dev/null @@ -1,4 +0,0 @@ -Wed Sep 10 16:39:26 1997 Jim Wilson - - * Make-lang.in (LN, LN_S): New macros, use where appropriate. - diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 00075b30a9f..9b33211e6f1 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -91,9 +91,18 @@ CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS) # Use strict warnings for this front end. cp-warn = $(STRICT_WARN) -cc1plus$(exeext): $(CXX_OBJS) $(BACKEND) $(LIBDEPS) +cc1plus-dummy$(exeext): $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ - $(CXX_OBJS) $(BACKEND) $(LIBS) + $(CXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) + +cc1plus-checksum.c : cc1plus-dummy$(exeext) build/genchecksum$(exeext) + build/genchecksum$(exeext) cc1plus-dummy$(exeext) > $@ + +cc1plus-checksum.o : cc1plus-checksum.c + +cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ + $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) # Special build rules. $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf @@ -243,7 +252,8 @@ cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_ diagnostic.h gt-cp-typeck2.h cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) toplev.h \ diagnostic.h convert.h c-common.h -cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H) convert.h +cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(TARGET_H) \ + convert.h $(CGRAPH_H) cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) $(EXPR_H) \ diagnostic.h intl.h gt-cp-call.h convert.h target.h cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) toplev.h $(EXPR_H) @@ -254,14 +264,14 @@ cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(RTL_H) $(EXPR_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) 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 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 \ +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 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) diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 5737e4fc0a1..e40e61f0aae 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2187,7 +2187,7 @@ add_template_candidate_real (struct z_candidate **candidates, tree tmpl, i = fn_type_unification (tmpl, explicit_targs, targs, args_without_in_chrg, - return_type, strict, -1); + return_type, strict); if (i != 0) return NULL; @@ -3402,14 +3402,14 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3) if (TREE_CODE (arg2_type) == ENUMERAL_TYPE && TREE_CODE (arg3_type) == ENUMERAL_TYPE) - warning ("enumeral mismatch in conditional expression: %qT vs %qT", + warning (0, "enumeral mismatch in conditional expression: %qT vs %qT", arg2_type, arg3_type); else if (extra_warnings && ((TREE_CODE (arg2_type) == ENUMERAL_TYPE && !same_type_p (arg3_type, type_promotes_to (arg2_type))) || (TREE_CODE (arg3_type) == ENUMERAL_TYPE && !same_type_p (arg2_type, type_promotes_to (arg3_type))))) - warning ("enumeral and non-enumeral type in conditional expression"); + warning (0, "enumeral and non-enumeral type in conditional expression"); arg2 = perform_implicit_conversion (result_type, arg2); arg3 = perform_implicit_conversion (result_type, arg3); @@ -3750,20 +3750,6 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, if (overloaded_p) *overloaded_p = true; - if (warn_synth - && fnname == ansi_assopname (NOP_EXPR) - && DECL_ARTIFICIAL (cand->fn) - && candidates->next - && ! candidates->next->next) - { - warning ("using synthesized %q#D for copy assignment", - cand->fn); - cp_warning_at (" where cfront would use %q#D", - cand == candidates - ? candidates->next->fn - : candidates->fn); - } - result = build_over_call (cand, LOOKUP_NORMAL); } else @@ -3790,7 +3776,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, && (TYPE_MAIN_VARIANT (TREE_TYPE (arg1)) != TYPE_MAIN_VARIANT (TREE_TYPE (arg2)))) { - warning ("comparison between %q#T and %q#T", + warning (0, "comparison between %q#T and %q#T", TREE_TYPE (arg1), TREE_TYPE (arg2)); } break; @@ -4111,7 +4097,7 @@ build_temp (tree expr, tree type, int flags, build_tree_list (NULL_TREE, expr), type, flags); if (warningcount > savew) - *diagnostic_fn = warning; + *diagnostic_fn = warning0; else if (errorcount > savee) *diagnostic_fn = error; else @@ -4174,10 +4160,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (ARITHMETIC_TYPE_P (t) && expr == null_node) { if (fn) - warning ("passing NULL to non-pointer argument %P of %qD", + warning (0, "passing NULL to non-pointer argument %P of %qD", argnum, fn); else - warning ("converting to non-pointer type %qT from NULL", t); + warning (0, "converting to non-pointer type %qT from NULL", t); } /* Warn about assigning a floating-point type to an integer type. */ @@ -4185,10 +4171,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, && TREE_CODE (t) == INTEGER_TYPE) { if (fn) - warning ("passing %qT for argument %P to %qD", + warning (0, "passing %qT for argument %P to %qD", TREE_TYPE (expr), argnum, fn); else - warning ("converting to %qT from %qT", t, TREE_TYPE (expr)); + warning (0, "converting to %qT from %qT", t, TREE_TYPE (expr)); } /* And warn about assigning a negative value to an unsigned variable. */ @@ -4197,10 +4183,10 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum, if (TREE_CODE (expr) == INTEGER_CST && TREE_NEGATED_INT (expr)) { if (fn) - warning ("passing negative value %qE for argument %P to %qD", + warning (0, "passing negative value %qE for argument %P to %qD", expr, argnum, fn); else - warning ("converting negative value %qE to %qT", expr, t); + warning (0, "converting negative value %qE to %qT", expr, t); } overflow_warning (expr); @@ -4457,7 +4443,7 @@ convert_arg_to_ellipsis (tree arg) there is no need to emit a warning, since the expression won't be evaluated. We keep the builtin_trap just as a safety check. */ if (!skip_evaluation) - warning ("cannot pass objects of non-POD type %q#T through %<...%>; " + warning (0, "cannot pass objects of non-POD type %q#T through %<...%>; " "call will abort at runtime", TREE_TYPE (arg)); arg = call_builtin_trap (); arg = build2 (COMPOUND_EXPR, integer_type_node, arg, @@ -4483,7 +4469,7 @@ build_x_va_arg (tree expr, tree type) if (! pod_type_p (type)) { /* Undefined behavior [expr.call] 5.2.2/7. */ - warning ("cannot receive objects of non-POD type %q#T through %<...%>; " + warning (0, "cannot receive objects of non-POD type %q#T through %<...%>; " "call will abort at runtime", type); expr = convert (build_pointer_type (type), null_node); expr = build2 (COMPOUND_EXPR, TREE_TYPE (expr), @@ -5398,7 +5384,7 @@ build_new_method_call (tree instance, tree fns, tree args, || DECL_DESTRUCTOR_P (current_function_decl))) /* This is not an error, it is runtime undefined behavior. */ - warning ((DECL_CONSTRUCTOR_P (current_function_decl) ? + warning (0, (DECL_CONSTRUCTOR_P (current_function_decl) ? "abstract virtual %q#D called from constructor" : "abstract virtual %q#D called from destructor"), cand->fn); @@ -6011,9 +5997,9 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) if (warn) { - warning ("passing %qT chooses %qT over %qT", + warning (0, "passing %qT chooses %qT over %qT", type, type1, type2); - warning (" in call to %qD", w->fn); + warning (0, " in call to %qD", w->fn); } else add_warning (w, l); @@ -6070,10 +6056,10 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) tree source = source_type (w->convs[0]); if (! DECL_CONSTRUCTOR_P (w->fn)) source = TREE_TYPE (source); - warning ("choosing %qD over %qD", w->fn, l->fn); - warning (" for conversion from %qT to %qT", + warning (0, "choosing %qD over %qD", w->fn, l->fn); + warning (0, " for conversion from %qT to %qT", source, w->second_conv->type); - warning (" because conversion sequence for the argument is better"); + warning (0, " because conversion sequence for the argument is better"); } else add_warning (w, l); @@ -6098,10 +6084,9 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) if (cand1->template_decl && cand2->template_decl) { - winner = more_specialized + winner = more_specialized_fn (TI_TEMPLATE (cand1->template_decl), TI_TEMPLATE (cand2->template_decl), - DEDUCE_ORDER, /* Tell the deduction code how many real function arguments we saw, not counting the implicit 'this' argument. But, add_function_candidate() suppresses the "this" argument diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 89346d6cf4a..b70fb1f2165 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -35,6 +35,7 @@ Boston, MA 02111-1307, USA. */ #include "toplev.h" #include "target.h" #include "convert.h" +#include "cgraph.h" /* The number of nested classes being processed. If we are not in the scope of any class, this is zero. */ @@ -79,7 +80,7 @@ typedef struct vtbl_init_data_s tree vbase; /* The functions in vbase for which we have already provided vcall offsets. */ - varray_type fns; + VEC(tree,gc) *fns; /* The vtable index of the next vcall or vbase offset. */ tree index; /* Nonzero if we are building the initializer for the primary @@ -103,7 +104,7 @@ static class_stack_node_t current_class_stack; /* An array of all local classes present in this translation unit, in declaration order. */ -varray_type local_classes; +VEC(tree,gc) *local_classes; static tree get_vfield_name (tree); static void finish_struct_anon (tree); @@ -296,8 +297,8 @@ build_base_path (enum tree_code code, if (null_test) { tree zero = cp_convert (TREE_TYPE (expr), integer_zero_node); - null_test = fold (build2 (NE_EXPR, boolean_type_node, - expr, zero)); + null_test = fold_build2 (NE_EXPR, boolean_type_node, + expr, zero); } /* If this is a simple base reference, express it as a COMPONENT_REF. */ @@ -388,9 +389,9 @@ build_base_path (enum tree_code code, out: if (null_test) - expr = fold (build3 (COND_EXPR, target_type, null_test, expr, - fold (build1 (NOP_EXPR, target_type, - integer_zero_node)))); + expr = fold_build3 (COND_EXPR, target_type, null_test, expr, + fold_build1 (NOP_EXPR, target_type, + integer_zero_node)); return expr; } @@ -887,7 +888,7 @@ add_method (tree type, tree method) tree overload; bool template_conv_p = false; bool conv_p; - VEC(tree) *method_vec; + VEC(tree,gc) *method_vec; bool complete_p; bool insert_p = false; tree current_fns; @@ -909,7 +910,7 @@ add_method (tree type, tree method) allocate at least two (for constructors and destructors), and we're going to end up with an assignment operator at some point as well. */ - method_vec = VEC_alloc (tree, 8); + method_vec = VEC_alloc (tree, gc, 8); /* Create slots for constructors and destructors. */ VEC_quick_push (tree, method_vec, NULL_TREE); VEC_quick_push (tree, method_vec, NULL_TREE); @@ -1052,7 +1053,7 @@ add_method (tree type, tree method) { /* We only expect to add few methods in the COMPLETE_P case, so just make room for one more method in that case. */ - if (VEC_reserve (tree, method_vec, complete_p ? 1 : -1)) + if (VEC_reserve (tree, gc, method_vec, complete_p ? -1 : 1)) CLASSTYPE_METHOD_VEC (type) = method_vec; if (slot == VEC_length (tree, method_vec)) VEC_quick_push (tree, method_vec, overload); @@ -1234,7 +1235,7 @@ check_bases (tree t, here because the case of virtual functions but non-virtual dtor is handled in finish_struct_1. */ if (warn_ecpp && ! TYPE_POLYMORPHIC_P (basetype)) - warning ("base class %q#T has a non-virtual destructor", basetype); + warning (0, "base class %q#T has a non-virtual destructor", basetype); /* If the base class doesn't have copy constructors or assignment operators that take const references, then the @@ -1548,7 +1549,7 @@ maybe_warn_about_overly_private_class (tree t) } if (!has_nonprivate_method) { - warning ("all member functions in class %qT are private", t); + warning (0, "all member functions in class %qT are private", t); return; } } @@ -1559,7 +1560,7 @@ maybe_warn_about_overly_private_class (tree t) fn = CLASSTYPE_DESTRUCTORS (t); if (fn && TREE_PRIVATE (fn)) { - warning ("%q#T only defines a private destructor and has no friends", + warning (0, "%q#T only defines a private destructor and has no friends", t); return; } @@ -1599,7 +1600,7 @@ maybe_warn_about_overly_private_class (tree t) if (nonprivate_ctor == 0) { - warning ("%q#T only defines private constructors and has no friends", + warning (0, "%q#T only defines private constructors and has no friends", t); return; } @@ -1663,7 +1664,7 @@ resort_type_method_vec (void* obj, gt_pointer_operator new_value, void* cookie) { - VEC(tree) *method_vec = (VEC(tree) *) obj; + VEC(tree,gc) *method_vec = (VEC(tree,gc) *) obj; int len = VEC_length (tree, method_vec); size_t slot; tree fn; @@ -1695,7 +1696,7 @@ static void finish_struct_methods (tree t) { tree fn_fields; - VEC(tree) *method_vec; + VEC(tree,gc) *method_vec; int slot, len; method_vec = CLASSTYPE_METHOD_VEC (t); @@ -1814,7 +1815,7 @@ typedef struct find_final_overrider_data_s { /* The candidate overriders. */ tree candidates; /* Path to most derived. */ - VEC (tree) *path; + VEC(tree,heap) *path; } find_final_overrider_data; /* Add the overrider along the current path to FFOD->CANDIDATES. @@ -1873,7 +1874,7 @@ dfs_find_final_overrider_pre (tree binfo, void *data) if (binfo == ffod->declaring_base) dfs_find_final_overrider_1 (binfo, ffod, VEC_length (tree, ffod->path)); - VEC_safe_push (tree, ffod->path, binfo); + VEC_safe_push (tree, heap, ffod->path, binfo); return NULL_TREE; } @@ -1922,12 +1923,12 @@ find_final_overrider (tree derived, tree binfo, tree fn) ffod.fn = fn; ffod.declaring_base = binfo; ffod.candidates = NULL_TREE; - ffod.path = VEC_alloc (tree, 30); + ffod.path = VEC_alloc (tree, heap, 30); dfs_walk_all (derived, dfs_find_final_overrider_pre, dfs_find_final_overrider_post, &ffod); - VEC_free (tree, ffod.path); + VEC_free (tree, heap, ffod.path); /* If there was no winner, issue an error message. */ if (!ffod.candidates || TREE_CHAIN (ffod.candidates)) @@ -1946,7 +1947,7 @@ find_final_overrider (tree derived, tree binfo, tree fn) static tree get_vcall_index (tree fn, tree type) { - VEC (tree_pair_s) *indices = CLASSTYPE_VCALL_INDICES (type); + VEC(tree_pair_s,gc) *indices = CLASSTYPE_VCALL_INDICES (type); tree_pair_p p; unsigned ix; @@ -2350,7 +2351,7 @@ check_for_override (tree decl, tree ctype) void warn_hidden (tree t) { - VEC(tree) *method_vec = CLASSTYPE_METHOD_VEC (t); + VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (t); tree fns; size_t i; @@ -3035,16 +3036,16 @@ check_field_decls (tree t, tree *access_decls, && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) && !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t))) { - warning ("%q#T has pointer data members", t); + warning (0, "%q#T has pointer data members", t); if (! TYPE_HAS_INIT_REF (t)) { - warning (" but does not override %<%T(const %T&)%>", t, t); + warning (0, " but does not override %<%T(const %T&)%>", t, t); if (! TYPE_HAS_ASSIGN_REF (t)) - warning (" or %", t); + warning (0, " or %", t); } else if (! TYPE_HAS_ASSIGN_REF (t)) - warning (" but does not override %", t); + warning (0, " but does not override %", t); } @@ -3200,7 +3201,7 @@ walk_subobject_offsets (tree type, if (abi_version_at_least (2) && CLASSTYPE_VBASECLASSES (type)) { unsigned ix; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; /* Iterate through the virtual base classes of TYPE. In G++ 3.2, we included virtual bases in the direct base class @@ -3477,7 +3478,7 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets) propagate_binfo_offsets (binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo))); else if (warn_abi) - warning ("offset of empty base %qT may not be ABI-compliant and may" + warning (0, "offset of empty base %qT may not be ABI-compliant and may" "change in a future version of GCC", BINFO_TYPE (binfo)); } @@ -3589,7 +3590,7 @@ build_base_field (record_layout_info rli, tree binfo, if (abi_version_at_least (2)) CLASSTYPE_NEARLY_EMPTY_P (t) = 0; else if (warn_abi) - warning ("class %qT will be considered nearly empty in a " + warning (0, "class %qT will be considered nearly empty in a " "future version of GCC", t); } } @@ -3678,7 +3679,7 @@ check_methods (tree t) { TYPE_POLYMORPHIC_P (t) = 1; if (DECL_PURE_VIRTUAL_P (x)) - VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x); + VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); } /* All user-declared destructors are non-trivial. */ if (DECL_DESTRUCTOR_P (x)) @@ -4202,7 +4203,7 @@ static void fixup_inline_methods (tree type) { tree method = TYPE_METHODS (type); - VEC (tree) *friends; + VEC(tree,gc) *friends; unsigned ix; if (method && TREE_CODE (method) == TREE_VEC) @@ -4334,7 +4335,7 @@ layout_virtual_bases (record_layout_info rli, splay_tree offsets) CLASSTYPE_ALIGN (basetype)), bitsize_unit_node), BINFO_OFFSET (vbase)))) - warning ("offset of virtual base %qT is not ABI-compliant and " + warning (0, "offset of virtual base %qT is not ABI-compliant and " "may change in a future version of GCC", basetype); @@ -4370,7 +4371,7 @@ static tree end_of_class (tree t, int include_virtuals_p) { tree result = size_zero_node; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; tree binfo; tree base_binfo; tree offset; @@ -4417,7 +4418,7 @@ static void warn_about_ambiguous_bases (tree t) { int i; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; tree basetype; tree binfo; tree base_binfo; @@ -4433,7 +4434,7 @@ warn_about_ambiguous_bases (tree t) basetype = BINFO_TYPE (base_binfo); if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) - warning ("direct base %qT inaccessible in %qT due to ambiguity", + warning (0, "direct base %qT inaccessible in %qT due to ambiguity", basetype, t); } @@ -4445,7 +4446,7 @@ warn_about_ambiguous_bases (tree t) basetype = BINFO_TYPE (binfo); if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) - warning ("virtual base %qT inaccessible in %qT due to ambiguity", + warning (0, "virtual base %qT inaccessible in %qT due to ambiguity", basetype, t); } } @@ -4622,7 +4623,7 @@ layout_class_type (tree t, tree *virtuals_p) else { if (warn_abi && TREE_CODE (t) == UNION_TYPE) - warning ("size assigned to %qT may not be " + warning (0, "size assigned to %qT may not be " "ABI-compliant and may change in a future " "version of GCC", t); @@ -4661,7 +4662,7 @@ layout_class_type (tree t, tree *virtuals_p) && DECL_MODE (field) != TYPE_MODE (type)) /* Versions of G++ before G++ 3.4 did not reset the DECL_MODE. */ - warning ("the offset of %qD may not be ABI-compliant and may " + warning (0, "the offset of %qD may not be ABI-compliant and may " "change in a future version of GCC", field); } else @@ -4754,7 +4755,7 @@ layout_class_type (tree t, tree *virtuals_p) TYPE_SIZE (base_t) = bitsize_zero_node; TYPE_SIZE_UNIT (base_t) = size_zero_node; if (warn_abi && !integer_zerop (rli_size_unit_so_far (rli))) - warning ("layout of classes derived from empty class %qT " + warning (0, "layout of classes derived from empty class %qT " "may change in a future version of GCC", t); } @@ -5045,7 +5046,7 @@ finish_struct_1 (tree t) && (!TREE_PRIVATE (dtor) || CLASSTYPE_FRIEND_CLASSES (t) || DECL_FRIENDLIST (TYPE_MAIN_DECL (t))))) - warning ("%q#T has virtual functions but non-virtual destructor", + warning (0, "%q#T has virtual functions but non-virtual destructor", t); } @@ -5129,7 +5130,7 @@ finish_struct (tree t, tree attributes) CLASSTYPE_PURE_VIRTUALS (t) = NULL; for (x = TYPE_METHODS (t); x; x = TREE_CHAIN (x)) if (DECL_PURE_VIRTUAL_P (x)) - VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (t), x); + VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x); complete_vars (t); } else @@ -5323,7 +5324,7 @@ init_class_processing (void) current_class_stack_size = 10; current_class_stack = xmalloc (current_class_stack_size * sizeof (struct class_stack_node)); - VARRAY_TREE_INIT (local_classes, 8, "local_classes"); + local_classes = VEC_alloc (tree, gc, 8); ridpointers[(int) RID_PUBLIC] = access_public_node; ridpointers[(int) RID_PRIVATE] = access_private_node; @@ -5522,7 +5523,7 @@ pop_nested_class (void) int current_lang_depth (void) { - return VARRAY_ACTIVE_SIZE (current_lang_base); + return VEC_length (tree, current_lang_base); } /* Set global variables CURRENT_LANG_NAME to appropriate value @@ -5531,7 +5532,7 @@ current_lang_depth (void) void push_lang_context (tree name) { - VARRAY_PUSH_TREE (current_lang_base, current_lang_name); + VEC_safe_push (tree, gc, current_lang_base, current_lang_name); if (name == lang_name_cplusplus) { @@ -5566,8 +5567,7 @@ push_lang_context (tree name) void pop_lang_context (void) { - current_lang_name = VARRAY_TOP_TREE (current_lang_base); - VARRAY_POP (current_lang_base); + current_lang_name = VEC_pop (tree, current_lang_base); } /* Type instantiation routines. */ @@ -5733,7 +5733,7 @@ resolve_address_of_overloaded_function (tree target_type, targs = make_tree_vec (DECL_NTPARMS (fn)); if (fn_type_unification (fn, explicit_targs, targs, target_arg_types, target_ret_type, - DEDUCE_EXACT, -1) != 0) + DEDUCE_EXACT)) /* Argument deduction failed. */ continue; @@ -7130,7 +7130,7 @@ build_vtbl_initializer (tree binfo, vtbl_init_data vid; unsigned ix; tree vbinfo; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; /* Initialize VID. */ memset (&vid, 0, sizeof (vid)); @@ -7150,7 +7150,7 @@ build_vtbl_initializer (tree binfo, /* Create an array for keeping track of the functions we've processed. When we see multiple functions with the same signature, we share the vcall offsets. */ - VARRAY_TREE_INIT (vid.fns, 32, "fns"); + vid.fns = VEC_alloc (tree, gc, 32); /* Add the vcall and vbase offset entries. */ build_vcall_and_vbase_vtbl_entries (binfo, &vid); @@ -7406,9 +7406,9 @@ build_vbase_offset_vtbl_entries (tree binfo, vtbl_init_data* vid) *vid->last_init = build_tree_list (NULL_TREE, - fold (build1 (NOP_EXPR, - vtable_entry_type, - delta))); + fold_build1 (NOP_EXPR, + vtable_entry_type, + delta)); vid->last_init = &TREE_CHAIN (*vid->last_init); } } @@ -7575,16 +7575,14 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) { size_t i; tree vcall_offset; + tree derived_entry; /* If there is already an entry for a function with the same signature as FN, then we do not need a second vcall offset. Check the list of functions already present in the derived class vtable. */ - for (i = 0; i < VARRAY_ACTIVE_SIZE (vid->fns); ++i) + for (i = 0; VEC_iterate (tree, vid->fns, i, derived_entry); ++i) { - tree derived_entry; - - derived_entry = VARRAY_TREE (vid->fns, i); if (same_signature_p (derived_entry, orig_fn) /* We only use one vcall offset for virtual destructors, even though there are two virtual table entries. */ @@ -7598,7 +7596,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) offset. */ if (vid->binfo == TYPE_BINFO (vid->derived)) { - tree_pair_p elt = VEC_safe_push (tree_pair_s, + tree_pair_p elt = VEC_safe_push (tree_pair_s, gc, CLASSTYPE_VCALL_INDICES (vid->derived), NULL); elt->purpose = orig_fn; @@ -7611,7 +7609,7 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) ssize_int (TARGET_VTABLE_DATA_ENTRY_DISTANCE)); /* Keep track of this function. */ - VARRAY_PUSH_TREE (vid->fns, orig_fn); + VEC_safe_push (tree, gc, vid->fns, orig_fn); if (vid->generate_vcall_entries) { @@ -7633,8 +7631,8 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid) BINFO_OFFSET from vid->binfo. */ vcall_offset = size_diffop (BINFO_OFFSET (base), BINFO_OFFSET (vid->binfo)); - vcall_offset = fold (build1 (NOP_EXPR, vtable_entry_type, - vcall_offset)); + vcall_offset = fold_build1 (NOP_EXPR, vtable_entry_type, + vcall_offset); } /* Add the initializer to the vtable. */ *vid->last_init = build_tree_list (NULL_TREE, vcall_offset); @@ -7719,6 +7717,8 @@ cp_fold_obj_type_ref (tree ref, tree known_type) DECL_VINDEX (fndecl))); #endif + cgraph_node (fndecl)->local.vtable_method = true; + return build_address (fndecl); } diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c index 413a9338010..fc8c1af2d21 100644 --- a/gcc/cp/cp-gimplify.c +++ b/gcc/cp/cp-gimplify.c @@ -1,6 +1,6 @@ /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jason Merrill This file is part of GCC. @@ -31,6 +31,101 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "tree-gimple.h" #include "hashtab.h" #include "pointer-set.h" +#include "flags.h" + +/* Local declarations. */ + +enum bc_t { bc_break = 0, bc_continue = 1 }; + +static struct cp_gimplify_ctx +{ + /* Stack of labels which are targets for "break" or "continue", + linked through TREE_CHAIN. */ + tree current_label[2]; +} *ctxp; + +static void +push_context (void) +{ + gcc_assert (!ctxp); + ctxp = ((struct cp_gimplify_ctx *) + xcalloc (1, sizeof (struct cp_gimplify_ctx))); +} + +static void +pop_context (void) +{ + gcc_assert (ctxp + && !ctxp->current_label[0] + && !ctxp->current_label[1]); + free (ctxp); + ctxp = NULL; +} + +/* Begin a scope which can be exited by a break or continue statement. BC + indicates which. + + Just creates a label and pushes it into the current context. */ + +static tree +begin_bc_block (enum bc_t bc) +{ + tree label = create_artificial_label (); + TREE_CHAIN (label) = ctxp->current_label[bc]; + ctxp->current_label[bc] = label; + return label; +} + +/* Finish a scope which can be exited by a break or continue statement. + LABEL was returned from the most recent call to begin_bc_block. BODY is + an expression for the contents of the scope. + + If we saw a break (or continue) in the scope, append a LABEL_EXPR to + body. Otherwise, just forget the label. */ + +static tree +finish_bc_block (enum bc_t bc, tree label, tree body) +{ + gcc_assert (label == ctxp->current_label[bc]); + + if (TREE_USED (label)) + { + tree t, sl = NULL; + + t = build1 (LABEL_EXPR, void_type_node, label); + + append_to_statement_list (body, &sl); + append_to_statement_list (t, &sl); + body = sl; + } + + ctxp->current_label[bc] = TREE_CHAIN (label); + TREE_CHAIN (label) = NULL_TREE; + return body; +} + +/* Build a GOTO_EXPR to represent a break or continue statement. BC + indicates which. */ + +static tree +build_bc_goto (enum bc_t bc) +{ + tree label = ctxp->current_label[bc]; + + if (label == NULL_TREE) + { + if (bc == bc_break) + error ("break statement not within loop or switch"); + else + error ("continue statement not within loop or switch"); + + return NULL_TREE; + } + + /* Mark the label used for finish_bc_block. */ + TREE_USED (label) = 1; + return build1 (GOTO_EXPR, void_type_node, label); +} /* Genericize a TRY_BLOCK. */ @@ -106,6 +201,179 @@ gimplify_if_stmt (tree *stmt_p) *stmt_p = stmt; } +/* Build a generic representation of one of the C loop forms. COND is the + loop condition or NULL_TREE. BODY is the (possibly compound) statement + controlled by the loop. INCR is the increment expression of a for-loop, + or NULL_TREE. COND_IS_FIRST indicates whether the condition is + evaluated before the loop body as in while and for loops, or after the + loop body as in do-while loops. */ + +static tree +gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first) +{ + tree top, entry, exit, cont_block, break_block, stmt_list, t; + location_t stmt_locus; + + stmt_locus = input_location; + stmt_list = NULL_TREE; + entry = NULL_TREE; + + break_block = begin_bc_block (bc_break); + cont_block = begin_bc_block (bc_continue); + + /* If condition is zero don't generate a loop construct. */ + if (cond && integer_zerop (cond)) + { + top = NULL_TREE; + exit = NULL_TREE; + if (cond_is_first) + { + t = build_bc_goto (bc_break); + append_to_statement_list (t, &stmt_list); + } + } + else + { + /* If we use a LOOP_EXPR here, we have to feed the whole thing + back through the main gimplifier to lower it. Given that we + have to gimplify the loop body NOW so that we can resolve + break/continue stmts, seems easier to just expand to gotos. */ + top = build1 (LABEL_EXPR, void_type_node, NULL_TREE); + + /* If we have an exit condition, then we build an IF with gotos either + out of the loop, or to the top of it. If there's no exit condition, + then we just build a jump back to the top. */ + exit = build_and_jump (&LABEL_EXPR_LABEL (top)); + if (cond && !integer_nonzerop (cond)) + { + t = build_bc_goto (bc_break); + exit = build3 (COND_EXPR, void_type_node, cond, exit, t); + exit = fold (exit); + gimplify_stmt (&exit); + + if (cond_is_first) + { + if (incr) + { + entry = build1 (LABEL_EXPR, void_type_node, NULL_TREE); + t = build_and_jump (&LABEL_EXPR_LABEL (entry)); + } + else + t = build_bc_goto (bc_continue); + append_to_statement_list (t, &stmt_list); + } + } + } + + gimplify_stmt (&body); + gimplify_stmt (&incr); + + body = finish_bc_block (bc_continue, cont_block, body); + + append_to_statement_list (top, &stmt_list); + append_to_statement_list (body, &stmt_list); + append_to_statement_list (incr, &stmt_list); + append_to_statement_list (entry, &stmt_list); + append_to_statement_list (exit, &stmt_list); + + annotate_all_with_locus (&stmt_list, stmt_locus); + + return finish_bc_block (bc_break, break_block, stmt_list); +} + +/* Gimplify a FOR_STMT node. Move the stuff in the for-init-stmt into the + prequeue and hand off to gimplify_cp_loop. */ + +static void +gimplify_for_stmt (tree *stmt_p, tree *pre_p) +{ + tree stmt = *stmt_p; + + if (FOR_INIT_STMT (stmt)) + gimplify_and_add (FOR_INIT_STMT (stmt), pre_p); + + *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt), + FOR_EXPR (stmt), 1); +} + +/* Gimplify a WHILE_STMT node. */ + +static void +gimplify_while_stmt (tree *stmt_p) +{ + tree stmt = *stmt_p; + *stmt_p = gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt), + NULL_TREE, 1); +} + +/* Gimplify a DO_STMT node. */ + +static void +gimplify_do_stmt (tree *stmt_p) +{ + tree stmt = *stmt_p; + *stmt_p = gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt), + NULL_TREE, 0); +} + +/* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */ + +static void +gimplify_switch_stmt (tree *stmt_p) +{ + tree stmt = *stmt_p; + tree break_block, body; + location_t stmt_locus = input_location; + + break_block = begin_bc_block (bc_break); + + body = SWITCH_STMT_BODY (stmt); + if (!body) + body = build_empty_stmt (); + + *stmt_p = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt), + SWITCH_STMT_COND (stmt), body, NULL_TREE); + SET_EXPR_LOCATION (*stmt_p, stmt_locus); + gimplify_stmt (stmt_p); + + *stmt_p = finish_bc_block (bc_break, break_block, *stmt_p); +} + +/* Gimplify an EXPR_STMT node. */ + +static void +gimplify_expr_stmt (tree *stmt_p) +{ + tree stmt = EXPR_STMT_EXPR (*stmt_p); + + if (stmt == error_mark_node) + stmt = NULL; + + /* Gimplification of a statement expression will nullify the + statement if all its side effects are moved to *PRE_P and *POST_P. + + In this case we will not want to emit the gimplified statement. + However, we may still want to emit a warning, so we do that before + gimplification. */ + if (stmt && (extra_warnings || warn_unused_value)) + { + if (!TREE_SIDE_EFFECTS (stmt)) + { + if (!IS_EMPTY_STMT (stmt) + && !VOID_TYPE_P (TREE_TYPE (stmt)) + && !TREE_NO_WARNING (stmt)) + warning (0, "statement with no effect"); + } + else if (warn_unused_value) + warn_if_unused_value (stmt, input_location); + } + + if (stmt == NULL_TREE) + stmt = alloc_stmt_list (); + + *stmt_p = stmt; +} + /* Gimplify initialization from an AGGR_INIT_EXPR. */ static void @@ -254,6 +522,41 @@ cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p) ret = GS_OK; break; + case FOR_STMT: + gimplify_for_stmt (expr_p, pre_p); + ret = GS_ALL_DONE; + break; + + case WHILE_STMT: + gimplify_while_stmt (expr_p); + ret = GS_ALL_DONE; + break; + + case DO_STMT: + gimplify_do_stmt (expr_p); + ret = GS_ALL_DONE; + break; + + case SWITCH_STMT: + gimplify_switch_stmt (expr_p); + ret = GS_ALL_DONE; + break; + + case CONTINUE_STMT: + *expr_p = build_bc_goto (bc_continue); + ret = GS_ALL_DONE; + break; + + case BREAK_STMT: + *expr_p = build_bc_goto (bc_break); + ret = GS_ALL_DONE; + break; + + case EXPR_STMT: + gimplify_expr_stmt (expr_p); + ret = GS_OK; + break; + default: ret = c_gimplify_expr (expr_p, pre_p, post_p); break; @@ -369,5 +672,7 @@ cp_genericize (tree fndecl) pointer_set_destroy (p_set); /* Do everything else. */ + push_context (); c_genericize (fndecl); + pop_context (); } diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 210a383e461..ca27351b02a 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -22,16 +22,6 @@ 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); - /* In cp/cp-lang.c and objcp/objcp-lang.c. */ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, @@ -71,8 +61,6 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, #define LANG_HOOKS_PARSE_FILE c_common_parse_file #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL cxx_dup_lang_specific_decl -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME #define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME mangle_decl #undef LANG_HOOKS_MARK_ADDRESSABLE diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 1abc77bfcad..705517a2e4a 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -2,7 +2,7 @@ additional tree codes used in the GNU C++ compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, - 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -31,10 +31,8 @@ Boston, MA 02111-1307, USA. */ BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m'). The expression is a pointer-to-member if its address is taken, - but simply denotes a member of the object if its address isnot - taken. In the latter case, resolve_offset_ref is used to - convert it to a representation of the member referred to by the - OFFSET_REF. + but simply denotes a member of the object if its address is not + taken. This form is only used during the parsing phase; once semantic analysis has taken place they are eliminated. @@ -206,7 +204,7 @@ DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0) DEFTREECODE (USING_DECL, "using_decl", tcc_declaration, 0) /* A using directive. The operand is USING_STMT_NAMESPACE. */ -DEFTREECODE (USING_STMT, "using_directive", tcc_expression, 1) +DEFTREECODE (USING_STMT, "using_directive", tcc_statement, 1) /* An un-parsed default argument. Looks like an IDENTIFIER_NODE. */ DEFTREECODE (DEFAULT_ARG, "default_arg", tcc_exceptional, 0) @@ -260,15 +258,15 @@ DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", tcc_expression, 1) setup_vtbl_pointer (and appears in all functions, not just ctors). */ DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", tcc_expression, 1) -DEFTREECODE (TRY_BLOCK, "try_block", tcc_expression, 2) +DEFTREECODE (TRY_BLOCK, "try_block", tcc_statement, 2) -DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", tcc_expression, 2) +DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", tcc_statement, 2) /* A HANDLER wraps a catch handler for the HANDLER_TYPE. If this is CATCH_ALL_TYPE, then the handler catches all types. The declaration of the catch variable is in HANDLER_PARMS, and the body block in HANDLER_BODY. */ -DEFTREECODE (HANDLER, "handler", tcc_expression, 2) +DEFTREECODE (HANDLER, "handler", tcc_statement, 2) /* A MUST_NOT_THROW_EXPR wraps an expression that may not throw, and must call terminate if it does. */ @@ -277,13 +275,39 @@ DEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", tcc_expression, 1) /* A CLEANUP_STMT marks the point at which a declaration is fully constructed. The CLEANUP_EXPR is run on behalf of CLEANUP_DECL when CLEANUP_BODY completes. */ -DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_expression, 3) +DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_statement, 3) /* Represents an 'if' statement. The operands are IF_COND, THEN_CLAUSE, and ELSE_CLAUSE, respectively. */ /* ??? It is currently still necessary to distinguish between IF_STMT and COND_EXPR for the benefit of templates. */ -DEFTREECODE (IF_STMT, "if_stmt", tcc_expression, 3) +DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 3) + +/* Used to represent a `for' statement. The operands are + FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */ +DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 4) + +/* Used to represent a 'while' statement. The operands are WHILE_COND + and WHILE_BODY, respectively. */ +DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2) + +/* Used to represent a 'do' statement. The operands are DO_BODY and + DO_COND, respectively. */ +DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2) + +/* Used to represent a 'break' statement. */ +DEFTREECODE (BREAK_STMT, "break_stmt", tcc_statement, 0) + +/* Used to represent a 'continue' statement. */ +DEFTREECODE (CONTINUE_STMT, "continue_stmt", tcc_statement, 0) + +/* Used to represent a 'switch' statement. The operands are + SWITCH_STMT_COND, SWITCH_STMT_BODY and SWITCH_STMT_TYPE, respectively. */ +DEFTREECODE (SWITCH_STMT, "switch_stmt", tcc_statement, 3) + +/* Used to represent an expression statement. Use `EXPR_STMT_EXPR' to + obtain the expression. */ +DEFTREECODE (EXPR_STMT, "expr_stmt", tcc_expression, 1) DEFTREECODE (TAG_DEFN, "tag_defn", tcc_expression, 0) @@ -291,6 +315,7 @@ DEFTREECODE (TAG_DEFN, "tag_defn", tcc_expression, 0) TINST_DECL contains the original DECL node. TINST_LOCATION contains the location where the template is instantiated. + TINST_IN_SYSTEM_HEADER_P is true if the location is in a system header. A stack of template instantiation nodes is kept through the TREE_CHAIN fields of these nodes. */ @@ -300,6 +325,21 @@ DEFTREECODE (TINST_LEVEL, "TINST_LEVEL", tcc_exceptional, 0) /* Represents an 'offsetof' expression during template expansion. */ DEFTREECODE (OFFSETOF_EXPR, "offsetof_expr", tcc_expression, 1) +/* Represents a 'sizeof' expression during template expansion. */ +DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_unary, 1) + +/* Represents the -> operator during template expansion. */ +DEFTREECODE (ARROW_EXPR, "arrow_expr", tcc_expression, 1) + +/* Represents an '__alignof__' expression during template + expansion. */ +DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_unary, 1) + +/* A STMT_EXPR represents a statement-expression during template + expansion. This is the GCC extension { ( ... ) }. The + STMT_EXPR_STMT is the statement given by the expression. */ +DEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1) + /* Local variables: mode:c diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 466d4dd8e8c..1a2399b878f 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -47,6 +47,7 @@ struct diagnostic_context; KOENIG_LOOKUP_P (in CALL_EXPR) STATEMENT_LIST_NO_SCOPE (in STATEMENT_LIST). EXPR_STMT_STMT_EXPR_RESULT (in EXPR_STMT) + STMT_EXPR_NO_SCOPE (in STMT_EXPR) BIND_EXPR_TRY_BLOCK (in BIND_EXPR) TYPENAME_IS_ENUM_P (in TYPENAME_TYPE) REFERENCE_REF_P (in INDIRECT_EXPR) @@ -221,6 +222,7 @@ struct tinst_level_s GTY(()) struct tree_common common; tree decl; location_t locus; + int in_system_header_p; }; typedef struct tinst_level_s * tinst_level_t; @@ -261,6 +263,10 @@ typedef struct ptrmem_cst * ptrmem_cst_t; #define EXPR_STMT_STMT_EXPR_RESULT(NODE) \ TREE_LANG_FLAG_0 (EXPR_STMT_CHECK (NODE)) +/* Nonzero if this statement-expression does not have an associated scope. */ +#define STMT_EXPR_NO_SCOPE(NODE) \ + TREE_LANG_FLAG_0 (STMT_EXPR_CHECK (NODE)) + /* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual sense of `same'. */ #define same_type_p(TYPE1, TYPE2) \ @@ -512,7 +518,6 @@ enum cp_tree_index CPTI_LANG_NAME_JAVA, CPTI_EMPTY_EXCEPT_SPEC, - CPTI_NULL, CPTI_JCLASS, CPTI_TERMINATE, CPTI_CALL_UNEXPECTED, @@ -608,9 +613,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; /* Exception specifier used for throw(). */ #define empty_except_spec cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC] -/* The node for `__null'. */ -#define null_node cp_global_trees[CPTI_NULL] - /* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */ #define jclass_node cp_global_trees[CPTI_JCLASS] @@ -650,14 +652,14 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX]; struct saved_scope GTY(()) { - VEC(cxx_saved_binding) *old_bindings; + VEC(cxx_saved_binding,gc) *old_bindings; tree old_namespace; tree decl_ns_list; tree class_name; tree class_type; tree access_specifier; tree function_decl; - varray_type lang_base; + VEC(tree,gc) *lang_base; tree lang_name; tree template_parms; struct cp_binding_level *x_previous_class_level; @@ -748,7 +750,7 @@ struct language_function GTY(()) struct named_label_use_list *x_named_label_uses; struct named_label_list *x_named_labels; struct cp_binding_level *bindings; - varray_type x_local_names; + VEC(tree,gc) *x_local_names; }; /* The current C++-specific per-function global variables. */ @@ -841,10 +843,10 @@ enum cplus_tree_code { }; #undef DEFTREECODE -#define cp_stmt_codes \ - CTOR_INITIALIZER, TRY_BLOCK, HANDLER, \ - EH_SPEC_BLOCK, USING_STMT, TAG_DEFN, \ - IF_STMT, CLEANUP_STMT +/* TRUE if a tree code represents a statement. */ +extern bool statement_code_p[MAX_TREE_CODES]; + +#define STATEMENT_CODE_P(CODE) statement_code_p[(int) (CODE)] enum languages { lang_c, lang_cplusplus, lang_java }; @@ -965,7 +967,8 @@ typedef struct tree_pair_s GTY (()) tree value; } tree_pair_s; typedef tree_pair_s *tree_pair_p; -DEF_VEC_GC_O (tree_pair_s); +DEF_VEC_O (tree_pair_s); +DEF_VEC_ALLOC_O (tree_pair_s,gc); /* This is a few header flags for 'struct lang_type'. Actually, all but the first are used only for lang_type_class; they @@ -1025,7 +1028,7 @@ struct lang_type_class GTY(()) unsigned diamond_shaped : 1; unsigned repeated_base : 1; unsigned being_defined : 1; - unsigned redefined : 1; + unsigned java_interface : 1; unsigned debug_requested : 1; unsigned fields_readonly : 1; @@ -1041,7 +1044,6 @@ struct lang_type_class GTY(()) unsigned has_complex_init_ref : 1; unsigned has_complex_assign_ref : 1; unsigned non_aggregate : 1; - unsigned java_interface : 1; /* When adding a flag here, consider whether or not it ought to apply to a template instance if it applies to the template. If @@ -1050,18 +1052,18 @@ struct lang_type_class GTY(()) /* There are some bits left to fill out a 32-bit word. Keep track of this by updating the size of this bitfield whenever you add or remove a flag. */ - unsigned dummy : 11; + unsigned dummy : 12; tree primary_base; - VEC (tree_pair_s) *vcall_indices; + VEC(tree_pair_s,gc) *vcall_indices; tree vtables; tree typeinfo_var; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; binding_table nested_udts; tree as_base; - VEC (tree) *pure_virtuals; + VEC(tree,gc) *pure_virtuals; tree friend_classes; - VEC (tree) * GTY((reorder ("resort_type_method_vec"))) methods; + VEC(tree,gc) * GTY((reorder ("resort_type_method_vec"))) methods; tree key_method; tree decl_list; tree template_info; @@ -1184,9 +1186,6 @@ struct lang_type GTY(()) /* Nonzero means that this type is being defined. I.e., the left brace starting the definition of this type has been seen. */ #define TYPE_BEING_DEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->being_defined) -/* Nonzero means that this type has been redefined. In this case, if - convenient, don't reprocess any methods that appear in its redefinition. */ -#define TYPE_REDEFINED(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->redefined) /* Mark bits for repeated base checks. */ #define TYPE_MARKED_P(NODE) TREE_LANG_FLAG_6 (TYPE_CHECK (NODE)) @@ -1453,17 +1452,6 @@ struct lang_type GTY(()) #define CLASSTYPE_TYPEINFO_VAR(NODE) \ (LANG_TYPE_CLASS_CHECK (NODE)->typeinfo_var) -/* Accessor macros for the vfield slots in structures. */ - -/* Get the BINFO that introduced this vtable into the hierarchy (will - be NULL for those created at this level, or from a primary - hierarchy). */ -#define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE) - -/* Get the TYPE that introduced this vtable into the hierarchy (always - non-NULL). */ -#define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE) - /* Accessor macros for the BINFO_VIRTUALS list. */ /* The number of bytes by which to adjust the `this' pointer when @@ -1793,10 +1781,6 @@ struct lang_decl GTY(()) #define DECL_HAS_IN_CHARGE_PARM_P(NODE) \ (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_in_charge_parm_p) -/* Nonzero if NODE is an overloaded `operator delete[]' function. */ -#define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \ - (DECL_OVERLOADED_OPERATOR_P (NODE) == VEC_DELETE_EXPR) - /* Nonzero for _DECL means that this decl appears in (or will appear in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for detecting circularity in case members are multiply defined. In the @@ -2154,11 +2138,6 @@ struct lang_decl GTY(()) #define TMPL_ARG(ARGS, LEVEL, IDX) \ (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX)) -/* Set the IDXth element in the LEVELth level of ARGS to VAL. This - macro does not work with single-level argument vectors. */ -#define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL) \ - (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL)) - /* Given a single level of template arguments in NODE, return the number of arguments. */ #define NUM_TMPL_ARGS(NODE) \ @@ -2200,10 +2179,6 @@ struct lang_decl GTY(()) #define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE)) #define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE)) #define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE)) -#define ENUM_TI_TEMPLATE(NODE) \ - TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE)) -#define ENUM_TI_ARGS(NODE) \ - TI_ARGS (ENUM_TEMPLATE_INFO (NODE)) /* For a template instantiation TYPE, returns the TYPE corresponding to the primary template. Otherwise returns TYPE itself. */ @@ -2776,9 +2751,6 @@ struct lang_decl GTY(()) /* Returns nonzero if NODE is a primary template. */ #define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == (NODE)) -#define CLASSTYPE_TEMPLATE_LEVEL(NODE) \ - (TREE_INT_CST_LOW (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE)))) - /* Indicates whether or not (and how) a template was expanded for this FUNCTION_DECL or VAR_DECL. 0=normal declaration, e.g. int min (int, int); @@ -2947,6 +2919,35 @@ struct lang_decl GTY(()) #define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1) #define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2) +/* WHILE_STMT accessors. These give access to the condition of the + while statement and the body of the while statement, respectively. */ +#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0) +#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1) + +/* DO_STMT accessors. These give access to the condition of the do + statement and the body of the do statement, respectively. */ +#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0) +#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1) + +/* FOR_STMT accessors. These give access to the init statement, + condition, update expression, and body of the for statement, + respectively. */ +#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0) +#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1) +#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2) +#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3) + +#define SWITCH_STMT_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0) +#define SWITCH_STMT_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1) +#define SWITCH_STMT_TYPE(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2) + +/* STMT_EXPR accessor. */ +#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0) + +/* EXPR_STMT accessor. This gives the expression associated with an + expression statement. */ +#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0) + /* An enumeration of the kind of tags that C++ accepts. */ enum tag_types { none_type = 0, /* Not a tag type. */ @@ -3112,8 +3113,7 @@ extern int function_depth; typedef enum unification_kind_t { DEDUCE_CALL, DEDUCE_CONV, - DEDUCE_EXACT, - DEDUCE_ORDER + DEDUCE_EXACT } unification_kind_t; /* Macros for operating on a template instantiation level node. */ @@ -3122,6 +3122,8 @@ typedef enum unification_kind_t { (((tinst_level_t) TINST_LEVEL_CHECK (NODE))->decl) #define TINST_LOCATION(NODE) \ (((tinst_level_t) TINST_LEVEL_CHECK (NODE))->locus) +#define TINST_IN_SYSTEM_HEADER_P(NODE) \ + (((tinst_level_t) TINST_LEVEL_CHECK (NODE))->in_system_header_p) /* in class.c */ @@ -3129,7 +3131,7 @@ extern int current_class_depth; /* An array of all local classes present in this translation unit, in declaration order. */ -extern GTY(()) varray_type local_classes; +extern GTY(()) VEC(tree,gc) *local_classes; /* Here's where we control how name mangling takes place. */ @@ -3147,17 +3149,10 @@ extern GTY(()) varray_type local_classes; #define JOINER '$' -#define VPTR_NAME "$v" -#define THROW_NAME "$eh_throw" -#define AUTO_VTABLE_NAME "__vtbl$me__" #define AUTO_TEMP_NAME "_$tmp_" -#define AUTO_TEMP_FORMAT "_$tmp_%d" -#define VTABLE_BASE "$vb" -#define VTABLE_NAME_PREFIX "__vt_" #define VFIELD_BASE "$vf" #define VFIELD_NAME "_vptr$" #define VFIELD_NAME_FORMAT "_vptr$%s" -#define STATIC_NAME_FORMAT "_%s$%s" #define ANON_AGGRNAME_FORMAT "$_%d" #else /* NO_DOLLAR_IN_LABEL */ @@ -3166,36 +3161,21 @@ extern GTY(()) varray_type local_classes; #define JOINER '.' -#define VPTR_NAME ".v" -#define THROW_NAME ".eh_throw" -#define AUTO_VTABLE_NAME "__vtbl.me__" #define AUTO_TEMP_NAME "_.tmp_" -#define AUTO_TEMP_FORMAT "_.tmp_%d" -#define VTABLE_BASE ".vb" -#define VTABLE_NAME_PREFIX "__vt_" #define VFIELD_BASE ".vf" #define VFIELD_NAME "_vptr." #define VFIELD_NAME_FORMAT "_vptr.%s" -#define STATIC_NAME_FORMAT "_%s.%s" #define ANON_AGGRNAME_FORMAT "._%d" #else /* NO_DOT_IN_LABEL */ -#define VPTR_NAME "__vptr" -#define VPTR_NAME_P(ID_NODE) \ - (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1)) -#define THROW_NAME "__eh_throw" #define IN_CHARGE_NAME "__in_chrg" -#define AUTO_VTABLE_NAME "__vtbl_me__" #define AUTO_TEMP_NAME "__tmp_" #define TEMP_NAME_P(ID_NODE) \ (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \ sizeof (AUTO_TEMP_NAME) - 1)) -#define AUTO_TEMP_FORMAT "__tmp_%d" -#define VTABLE_BASE "__vtb" #define VTABLE_NAME "__vt_" -#define VTABLE_NAME_PREFIX "__vt_" #define VTABLE_NAME_P(ID_NODE) \ (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \ sizeof (VTABLE_NAME) - 1)) @@ -3205,7 +3185,6 @@ extern GTY(()) varray_type local_classes; (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \ sizeof (VFIELD_NAME) - 1)) #define VFIELD_NAME_FORMAT "__vptr_%s" -#define STATIC_NAME_FORMAT "__static_%s_%s" #define ANON_AGGRNAME_PREFIX "__anon_" #define ANON_AGGRNAME_P(ID_NODE) \ @@ -3224,13 +3203,8 @@ extern GTY(()) varray_type local_classes; #define VTABLE_DELTA_NAME "__delta" #define VTABLE_PFN_NAME "__pfn" -#define EXCEPTION_CLEANUP_NAME "exception cleanup" - #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) -#define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ - && IDENTIFIER_POINTER (ID_NODE)[1] == 'v') - #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \ && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) @@ -3272,11 +3246,6 @@ extern GTY(()) tree static_dtors; enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; -/* Some macros for char-based bitfields. */ -#define B_SET(A,X) ((A)[(X)>>3] |= (1 << ((X)&7))) -#define B_CLR(A,X) ((A)[(X)>>3] &= ~(1 << ((X)&7))) -#define B_TST(A,X) ((A)[(X)>>3] & (1 << ((X)&7))) - /* These are uses as bits in flags passed to build_new_method_call to control its error reporting behavior. @@ -3285,8 +3254,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; matching the arguments is found. LOOKUP_NORMAL is just a combination of these two. LOOKUP_NONVIRTUAL means make a direct call to the member function found - LOOKUP_GLOBAL means search through the space of overloaded functions, - as well as the space of member functions. LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried. DIRECT_BIND means that if a temporary is created, it should be created so that it lives as long as the current variable bindings; otherwise it @@ -3310,16 +3277,15 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; #define LOOKUP_COMPLAIN (1 << 1) #define LOOKUP_NORMAL (LOOKUP_PROTECT | LOOKUP_COMPLAIN) #define LOOKUP_NONVIRTUAL (1 << 2) -#define LOOKUP_GLOBAL (1 << 3) -#define LOOKUP_ONLYCONVERTING (1 << 4) -#define DIRECT_BIND (1 << 5) -#define LOOKUP_NO_CONVERSION (1 << 6) -#define LOOKUP_DESTRUCTOR (1 << 7) -#define LOOKUP_NO_TEMP_BIND (1 << 8) -#define LOOKUP_PREFER_TYPES (1 << 9) -#define LOOKUP_PREFER_NAMESPACES (1 << 10) +#define LOOKUP_ONLYCONVERTING (1 << 3) +#define DIRECT_BIND (1 << 4) +#define LOOKUP_NO_CONVERSION (1 << 5) +#define LOOKUP_DESTRUCTOR (1 << 6) +#define LOOKUP_NO_TEMP_BIND (1 << 7) +#define LOOKUP_PREFER_TYPES (1 << 8) +#define LOOKUP_PREFER_NAMESPACES (1 << 9) #define LOOKUP_PREFER_BOTH (LOOKUP_PREFER_TYPES | LOOKUP_PREFER_NAMESPACES) -#define LOOKUP_CONSTRUCTOR_CALLABLE (1 << 11) +#define LOOKUP_CONSTRUCTOR_CALLABLE (1 << 10) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) @@ -3344,7 +3310,6 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; #define CONV_PRIVATE 16 /* #define CONV_NONCONVERTING 32 */ #define CONV_FORCE_TEMP 64 -#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP) #define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ | CONV_REINTERPRET) #define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ @@ -3787,7 +3752,7 @@ extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, extern void start_decl_1 (tree); extern void cp_finish_decl (tree, tree, tree, int); extern void finish_decl (tree, tree, tree); -extern int complete_array_type (tree, tree, int); +extern int cp_complete_array_type (tree *, tree, bool); extern tree build_ptrmemfunc_type (tree); extern tree build_ptrmem_type (tree, tree); /* the grokdeclarator prototype is in decl.h */ @@ -3879,14 +3844,6 @@ extern void mark_needed (tree); extern bool decl_needed_p (tree); extern void note_vague_linkage_fn (tree); -/* XXX Not i18n clean. */ -#define cp_deprecated(STR) \ - do { \ - if (warn_deprecated) \ - warning ("%s is deprecated, please see the documentation for details", \ - (STR)); \ - } while (0) - /* in error.c */ extern void init_error (void); extern const char *type_as_string (tree, int); @@ -3996,9 +3953,9 @@ extern int uses_template_parms (tree); extern int uses_template_parms_level (tree, int); extern tree instantiate_class_template (tree); extern tree instantiate_template (tree, tree, tsubst_flags_t); -extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t, int); +extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t); extern void mark_decl_instantiated (tree, int); -extern int more_specialized (tree, tree, int, int); +extern int more_specialized_fn (tree, tree, int); extern void mark_class_instantiated (tree, int); extern void do_decl_instantiation (tree, tree); extern void do_type_instantiation (tree, tree, tsubst_flags_t); @@ -4047,7 +4004,7 @@ extern void finish_repo (void); /* in rtti.c */ /* A vector of all tinfo decls that haven't been emitted yet. */ -extern GTY(()) VEC(tree) *unemitted_tinfo_decls; +extern GTY(()) VEC(tree,gc) *unemitted_tinfo_decls; extern void init_rtti_processing (void); extern tree build_typeid (tree); @@ -4106,6 +4063,7 @@ 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); +extern tree do_poplevel (tree); extern void add_decl_expr (tree); extern tree finish_expr_stmt (tree); extern tree begin_if_stmt (void); @@ -4245,7 +4203,6 @@ extern tree build_dummy_object (tree); extern tree maybe_dummy_object (tree, tree *); extern int is_dummy_object (tree); extern const struct attribute_spec cxx_attribute_table[]; -extern tree make_tinst_level (tree, location_t); extern tree make_ptrmem_cst (tree, tree); extern tree cp_build_type_attribute_variant (tree, tree); extern tree cp_build_qualified_type_real (tree, int, tsubst_flags_t); @@ -4283,7 +4240,7 @@ extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool); #define cxx_sizeof_nowarn(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, false) extern tree inline_conversion (tree); extern tree decay_conversion (tree); -extern tree perform_integral_promotions (tree); +extern tree default_conversion (tree); extern tree build_class_member_access_expr (tree, tree, tree, bool); extern tree finish_class_member_access_expr (tree, tree); extern tree build_x_indirect_ref (tree, const char *); @@ -4323,7 +4280,6 @@ extern tree check_return_expr (tree); #define cp_build_binary_op(code, arg1, arg2) \ build_binary_op(code, arg1, arg2, 1) #define cxx_sizeof(T) cxx_sizeof_or_alignof_type (T, SIZEOF_EXPR, true) -#define cxx_alignof(T) cxx_sizeof_or_alignof_type (T, ALIGNOF_EXPR, true) extern tree build_ptrmemfunc_access_expr (tree, tree); extern tree build_address (tree); extern tree build_nop (tree, tree); @@ -4332,6 +4288,8 @@ extern tree lookup_anon_field (tree, tree); extern bool invalid_nonstatic_memfn_p (tree); extern tree convert_member_func_to_ptr (tree, tree); extern tree convert_ptrmem (tree, tree, bool, bool); +extern int lvalue_or_else (tree, enum lvalue_use); +extern int lvalue_p (tree); /* in typeck2.c */ extern void require_complete_eh_spec_types (tree, tree); @@ -4372,6 +4330,16 @@ extern tree mangle_ref_init_variable (tree); /* in dump.c */ extern bool cp_dump_tree (void *, tree); +/* 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); + /* in cp-gimplify.c */ extern int cp_gimplify_expr (tree *, tree *, tree *); extern void cp_genericize (tree); diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 32dc96d10c6..5150fcf5548 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -194,7 +194,7 @@ cp_convert_to_pointer (tree type, tree expr, bool force) if (bk == bk_via_virtual) { if (force) - warning ("pointer to member cast from %qT to %qT is via" + warning (0, "pointer to member cast from %qT to %qT is via" " virtual base", intype, type); else { @@ -512,7 +512,7 @@ convert_to_reference (tree reftype, tree expr, int convtype, if (TREE_CODE (intype) == POINTER_TYPE && (comptypes (TREE_TYPE (intype), type, COMPARE_BASE | COMPARE_DERIVED))) - warning ("casting %qT to %qT does not dereference pointer", + warning (0, "casting %qT to %qT does not dereference pointer", intype, reftype); rval = build_unary_op (ADDR_EXPR, expr, 0); @@ -854,10 +854,10 @@ convert_to_void (tree expr, const char *implicit) int is_complete = COMPLETE_TYPE_P (complete_type (type)); if (is_volatile && !is_complete) - warning ("object of incomplete type %qT will not be accessed in %s", + warning (0, "object of incomplete type %qT will not be accessed in %s", type, implicit ? implicit : "void context"); else if (is_reference && is_volatile) - warning ("object of type %qT will not be accessed in %s", + warning (0, "object of type %qT will not be accessed in %s", TREE_TYPE (TREE_OPERAND (expr, 0)), implicit ? implicit : "void context"); if (is_reference || !is_volatile || !is_complete) @@ -873,7 +873,7 @@ convert_to_void (tree expr, const char *implicit) int is_complete = COMPLETE_TYPE_P (complete_type (type)); if (TYPE_VOLATILE (type) && !is_complete) - warning ("object %qE of incomplete type %qT will not be accessed in %s", + warning (0, "object %qE of incomplete type %qT will not be accessed in %s", expr, type, implicit ? implicit : "void context"); break; } @@ -895,7 +895,7 @@ convert_to_void (tree expr, const char *implicit) } else if (implicit && probe == expr && is_overloaded_fn (probe)) /* Only warn when there is no &. */ - warning ("%s is a reference, not call, to function %qE", + warning (0, "%s is a reference, not call, to function %qE", implicit, expr); } @@ -906,7 +906,7 @@ convert_to_void (tree expr, const char *implicit) /* The middle end does not warn about expressions that have been explicitly cast to void, so we must do so here. */ if (!TREE_SIDE_EFFECTS (expr)) - warning ("%s has no effect", implicit); + warning (0, "%s has no effect", implicit); else { tree e; @@ -938,7 +938,7 @@ convert_to_void (tree expr, const char *implicit) || code == PREINCREMENT_EXPR || code == POSTDECREMENT_EXPR || code == POSTINCREMENT_EXPR))) - warning ("value computed is not used"); + warning (0, "value computed is not used"); } } expr = build1 (CONVERT_EXPR, void_type_node, expr); @@ -1046,7 +1046,7 @@ build_expr_type_conversion (int desires, tree expr, bool complain) if (expr == null_node && (desires & WANT_INT) && !(desires & WANT_NULL)) - warning ("converting NULL to non-pointer type"); + warning (0, "converting NULL to non-pointer type"); basetype = TREE_TYPE (expr); diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index e799a8c9a54..0ad1e9a4025 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -345,6 +345,12 @@ pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) pp_cxx_unqualified_id (pp, t); break; + case STMT_EXPR: + pp_cxx_left_paren (pp); + pp_cxx_statement (pp, STMT_EXPR_STMT (t)); + pp_cxx_right_paren (pp); + break; + default: pp_c_primary_expression (pp_c_base (pp), t); break; @@ -490,6 +496,11 @@ pp_cxx_postfix_expression (cxx_pretty_printer *pp, tree t) pp_cxx_unqualified_id (pp, TREE_OPERAND (t, 2)); break; + case ARROW_EXPR: + pp_cxx_postfix_expression (pp, TREE_OPERAND (t, 0)); + pp_cxx_arrow (pp); + break; + default: pp_c_postfix_expression (pp_c_base (pp), t); break; @@ -615,6 +626,20 @@ pp_cxx_unary_expression (cxx_pretty_printer *pp, tree t) pp_cxx_delete_expression (pp, t); break; + case SIZEOF_EXPR: + case ALIGNOF_EXPR: + pp_cxx_identifier (pp, code == SIZEOF_EXPR ? "sizeof" : "__alignof__"); + pp_cxx_whitespace (pp); + if (TYPE_P (TREE_OPERAND (t, 0))) + { + pp_cxx_left_paren (pp); + pp_cxx_type_id (pp, TREE_OPERAND (t, 0)); + pp_cxx_right_paren (pp); + } + else + pp_unary_expression (pp, TREE_OPERAND (t, 0)); + break; + default: pp_c_unary_expression (pp_c_base (pp), t); break; @@ -844,6 +869,7 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case TEMPLATE_TYPE_PARM: case TEMPLATE_PARM_INDEX: case TEMPLATE_TEMPLATE_PARM: + case STMT_EXPR: pp_cxx_primary_expression (pp, t); break; @@ -859,6 +885,7 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) case TYPEID_EXPR: case PSEUDO_DTOR_EXPR: case AGGR_INIT_EXPR: + case ARROW_EXPR: pp_cxx_postfix_expression (pp, t); break; @@ -872,6 +899,11 @@ pp_cxx_expression (cxx_pretty_printer *pp, tree t) pp_cxx_delete_expression (pp, t); break; + case SIZEOF_EXPR: + case ALIGNOF_EXPR: + pp_cxx_unary_expression (pp, t); + break; + case CAST_EXPR: pp_cxx_cast_expression (pp, t); break; @@ -1551,6 +1583,92 @@ pp_cxx_statement (cxx_pretty_printer *pp, tree t) } break; + case SWITCH_STMT: + pp_cxx_identifier (pp, "switch"); + pp_space (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, SWITCH_STMT_COND (t)); + pp_cxx_right_paren (pp); + pp_indentation (pp) += 3; + pp_needs_newline (pp) = true; + pp_cxx_statement (pp, SWITCH_STMT_BODY (t)); + pp_newline_and_indent (pp, -3); + break; + + /* iteration-statement: + while ( expression ) statement + do statement while ( expression ) ; + for ( expression(opt) ; expression(opt) ; expression(opt) ) statement + for ( declaration expression(opt) ; expression(opt) ) statement */ + case WHILE_STMT: + pp_cxx_identifier (pp, "while"); + pp_space (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, WHILE_COND (t)); + pp_cxx_right_paren (pp); + pp_newline_and_indent (pp, 3); + pp_cxx_statement (pp, WHILE_BODY (t)); + pp_indentation (pp) -= 3; + pp_needs_newline (pp) = true; + break; + + case DO_STMT: + pp_cxx_identifier (pp, "do"); + pp_newline_and_indent (pp, 3); + pp_cxx_statement (pp, DO_BODY (t)); + pp_newline_and_indent (pp, -3); + pp_cxx_identifier (pp, "while"); + pp_space (pp); + pp_cxx_left_paren (pp); + pp_cxx_expression (pp, DO_COND (t)); + pp_cxx_right_paren (pp); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = true; + break; + + case FOR_STMT: + pp_cxx_identifier (pp, "for"); + pp_space (pp); + pp_cxx_left_paren (pp); + if (FOR_INIT_STMT (t)) + pp_cxx_statement (pp, FOR_INIT_STMT (t)); + else + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = false; + pp_cxx_whitespace (pp); + if (FOR_COND (t)) + pp_cxx_expression (pp, FOR_COND (t)); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = false; + pp_cxx_whitespace (pp); + if (FOR_EXPR (t)) + pp_cxx_expression (pp, FOR_EXPR (t)); + pp_cxx_right_paren (pp); + pp_newline_and_indent (pp, 3); + pp_cxx_statement (pp, FOR_BODY (t)); + pp_indentation (pp) -= 3; + pp_needs_newline (pp) = true; + break; + + /* jump-statement: + goto identifier; + continue ; + return expression(opt) ; */ + case BREAK_STMT: + case CONTINUE_STMT: + pp_identifier (pp, TREE_CODE (t) == BREAK_STMT ? "break" : "continue"); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = true; + break; + + /* expression-statement: + expression(opt) ; */ + case EXPR_STMT: + pp_cxx_expression (pp, EXPR_STMT_EXPR (t)); + pp_cxx_semicolon (pp); + pp_needs_newline (pp) = true; + break; + case CLEANUP_STMT: pp_cxx_identifier (pp, "try"); pp_newline_and_indent (pp, 2); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d91b6ff302c..eb8db9121c8 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -419,19 +419,32 @@ objc_mark_locals_volatile (void *enclosing_blk) struct cp_binding_level *scope; for (scope = current_binding_level; - scope && scope != enclosing_blk && scope->kind == sk_block; + scope && scope != enclosing_blk; scope = scope->level_chain) { tree decl; for (decl = scope->names; decl; decl = TREE_CHAIN (decl)) { - if (TREE_CODE (decl) == VAR_DECL) + /* Do not mess with variables that are 'static' or (already) + 'volatile'. */ + if (!TREE_THIS_VOLATILE (decl) && !TREE_STATIC (decl) + && (TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL)) { - DECL_REGISTER (decl) = 0; - TREE_THIS_VOLATILE (decl) = 1; + TREE_TYPE (decl) + = build_qualified_type (TREE_TYPE (decl), + (TYPE_QUALS (TREE_TYPE (decl)) + | TYPE_QUAL_VOLATILE)); + TREE_THIS_VOLATILE (decl) = 1; + TREE_SIDE_EFFECTS (decl) = 1; + DECL_REGISTER (decl) = 0; } - } + } + + /* Do not climb up past the current function. */ + if (scope->kind == sk_function_parms) + break; } } @@ -565,7 +578,7 @@ poplevel (int keep, int reverse, int functionbody) && ! TREE_USED (decl) && ! DECL_IN_SYSTEM_HEADER (decl) && DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl)) - warning ("%Junused variable %qD", decl, decl); + warning (0, "%Junused variable %qD", decl, decl); /* Remove declarations for all the DECLs in this level. */ for (link = decls; link; link = TREE_CHAIN (link)) @@ -786,9 +799,9 @@ int wrapup_globals_for_namespace (tree namespace, void* data) { struct cp_binding_level *level = NAMESPACE_LEVEL (namespace); - varray_type statics = level->static_decls; - tree *vec = &VARRAY_TREE (statics, 0); - int len = VARRAY_ACTIVE_SIZE (statics); + VEC(tree,gc) *statics = level->static_decls; + tree *vec = VEC_address (tree, statics); + int len = VEC_length (tree, statics); int last_time = (data != 0); if (last_time) @@ -832,15 +845,13 @@ push_local_name (tree decl) tree t, name; timevar_push (TV_NAME_LOOKUP); - if (!local_names) - VARRAY_TREE_INIT (local_names, 8, "local_names"); name = DECL_NAME (decl); - nelts = VARRAY_ACTIVE_SIZE (local_names); + nelts = VEC_length (tree, local_names); for (i = 0; i < nelts; i++) { - t = VARRAY_TREE (local_names, i); + t = VEC_index (tree, local_names, i); if (DECL_NAME (t) == name) { if (!DECL_LANG_SPECIFIC (decl)) @@ -851,13 +862,13 @@ push_local_name (tree decl) else DECL_DISCRIMINATOR (decl) = 1; - VARRAY_TREE (local_names, i) = decl; + VEC_replace (tree, local_names, i, decl); timevar_pop (TV_NAME_LOOKUP); return; } } - VARRAY_PUSH_TREE (local_names, decl); + VEC_safe_push (tree, gc, local_names, decl); timevar_pop (TV_NAME_LOOKUP); } @@ -948,6 +959,12 @@ decls_match (tree newdecl, tree olddecl) } else { + /* Need to check scope for variable declaration (VAR_DECL). + For typedef (TYPE_DECL), scope is ignored. */ + if (TREE_CODE (newdecl) == VAR_DECL + && CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl)) + return 0; + if (TREE_TYPE (newdecl) == error_mark_node) types_match = TREE_TYPE (olddecl) == error_mark_node; else if (TREE_TYPE (olddecl) == NULL_TREE) @@ -1049,17 +1066,17 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_UNINLINABLE (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warning ("%Jfunction %qD redeclared as inline", newdecl, newdecl); - warning ("%Jprevious declaration of %qD with attribute noinline", + warning (0, "%Jfunction %qD redeclared as inline", newdecl, newdecl); + warning (0, "%Jprevious declaration of %qD with attribute noinline", olddecl, olddecl); } else if (DECL_DECLARED_INLINE_P (olddecl) && DECL_UNINLINABLE (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warning ("%Jfunction %qD redeclared with attribute noinline", + warning (0, "%Jfunction %qD redeclared with attribute noinline", newdecl, newdecl); - warning ("%Jprevious declaration of %qD was inline", + warning (0, "%Jprevious declaration of %qD was inline", olddecl, olddecl); } } @@ -1080,7 +1097,7 @@ duplicate_decls (tree newdecl, tree olddecl) if (! TREE_PUBLIC (newdecl)) { if (warn_shadow) - warning ("shadowing %s function %q#D", + warning (0, "shadowing %s function %q#D", DECL_BUILT_IN (olddecl) ? "built-in" : "library", olddecl); /* Discard the old built-in function. */ @@ -1089,7 +1106,7 @@ duplicate_decls (tree newdecl, tree olddecl) /* If the built-in is not ansi, then programs can override it even globally without an error. */ else if (! DECL_BUILT_IN (olddecl)) - warning ("library function %q#D redeclared as non-function %q#D", + warning (0, "library function %q#D redeclared as non-function %q#D", olddecl, newdecl); else { @@ -1146,12 +1163,12 @@ duplicate_decls (tree newdecl, tree olddecl) if (TREE_PUBLIC (newdecl)) { - warning ("new declaration %q#D", newdecl); - warning ("ambiguates built-in declaration %q#D", + warning (0, "new declaration %q#D", newdecl); + warning (0, "ambiguates built-in declaration %q#D", olddecl); } else if (warn_shadow) - warning ("shadowing %s function %q#D", + warning (0, "shadowing %s function %q#D", DECL_BUILT_IN (olddecl) ? "built-in" : "library", olddecl); } @@ -1357,7 +1374,7 @@ duplicate_decls (tree newdecl, tree olddecl) { /* Prototype decl follows defn w/o prototype. */ cp_warning_at ("prototype for %q#D", newdecl); - warning ("%Jfollows non-prototype definition here", olddecl); + warning (0, "%Jfollows non-prototype definition here", olddecl); } else if (TREE_CODE (olddecl) == FUNCTION_DECL && DECL_LANGUAGE (newdecl) != DECL_LANGUAGE (olddecl)) @@ -1412,8 +1429,8 @@ duplicate_decls (tree newdecl, tree olddecl) && ! DECL_DECLARED_INLINE_P (olddecl) && TREE_ADDRESSABLE (olddecl) && warn_inline) { - warning ("%q#D was used before it was declared inline", newdecl); - warning ("%Jprevious non-inline declaration here", olddecl); + warning (0, "%q#D was used before it was declared inline", newdecl); + warning (0, "%Jprevious non-inline declaration here", olddecl); } } } @@ -1465,7 +1482,7 @@ duplicate_decls (tree newdecl, tree olddecl) /* Don't warn about friends, let add_friend take care of it. */ && ! (DECL_FRIEND_P (newdecl) || DECL_FRIEND_P (olddecl))) { - warning ("redundant redeclaration of %qD in same scope", newdecl); + warning (0, "redundant redeclaration of %qD in same scope", newdecl); cp_warning_at ("previous declaration of %qD", olddecl); } } @@ -1800,9 +1817,9 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) { - warning ("%J%qD: visibility attribute ignored because it", + warning (0, "%J%qD: visibility attribute ignored because it", newdecl, newdecl); - warning ("%Jconflicts with previous declaration here", olddecl); + warning (0, "%Jconflicts with previous declaration here", olddecl); } /* Choose the declaration which specified visibility. */ if (DECL_VISIBILITY_SPECIFIED (olddecl)) @@ -2363,9 +2380,16 @@ void pop_switch (void) { struct cp_switch *cs = switch_stack; + location_t switch_location; /* Emit warnings as needed. */ - c_do_switch_warnings (cs->cases, cs->switch_stmt); + if (EXPR_HAS_LOCATION (cs->switch_stmt)) + switch_location = EXPR_LOCATION (cs->switch_stmt); + else + switch_location = input_location; + c_do_switch_warnings (cs->cases, switch_location, + SWITCH_STMT_TYPE (cs->switch_stmt), + SWITCH_STMT_COND (cs->switch_stmt)); splay_tree_delete (cs->cases); switch_stack = switch_stack->next; @@ -3210,7 +3234,6 @@ build_library_fn_1 (tree name, enum tree_code operator_code, tree type) DECL_EXTERNAL (fn) = 1; TREE_PUBLIC (fn) = 1; DECL_ARTIFICIAL (fn) = 1; - TREE_NOTHROW (fn) = 1; SET_OVERLOADED_OPERATOR_CODE (fn, operator_code); SET_DECL_LANGUAGE (fn, lang_c); /* Runtime library routines are, by definition, available in an @@ -3227,7 +3250,9 @@ build_library_fn_1 (tree name, enum tree_code operator_code, tree type) tree build_library_fn (tree name, tree type) { - return build_library_fn_1 (name, ERROR_MARK, type); + tree fn = build_library_fn_1 (name, ERROR_MARK, type); + TREE_NOTHROW (fn) = 1; + return fn; } /* Returns the _DECL for a library function with C++ linkage. */ @@ -3632,7 +3657,7 @@ start_decl (const cp_declarator *declarator, { if (! toplevel_bindings_p () && DECL_EXTERNAL (decl)) - warning ("declaration of %q#D has % and is initialized", + warning (0, "declaration of %q#D has % and is initialized", decl); DECL_EXTERNAL (decl) = 0; if (toplevel_bindings_p ()) @@ -3648,14 +3673,13 @@ start_decl (const cp_declarator *declarator, cplus_decl_attributes (&decl, attributes, 0); /* If #pragma weak was used, mark the decl weak now. */ - if (global_scope_p (current_binding_level)) - maybe_apply_pragma_weak (decl); + maybe_apply_pragma_weak (decl); if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl) && DECL_UNINLINABLE (decl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (decl))) - warning ("%Jinline function %qD given attribute noinline", decl, decl); + warning (0, "%Jinline function %qD given attribute noinline", decl, decl); if (context && COMPLETE_TYPE_P (complete_type (context))) { @@ -3907,7 +3931,8 @@ maybe_deduce_size_from_array_init (tree decl, tree init) But let's leave it here to ease the eventual merge. */ int do_default = !DECL_EXTERNAL (decl); tree initializer = init ? init : DECL_INITIAL (decl); - int failure = complete_array_type (type, initializer, do_default); + int failure = cp_complete_array_type (&TREE_TYPE (decl), initializer, + do_default); if (failure == 1) error ("initializer fails to determine size of %qD", decl); @@ -3927,6 +3952,8 @@ maybe_deduce_size_from_array_init (tree decl, tree init) if (failure == 3) error ("zero-size array %qD", decl); + cp_apply_type_quals_to_decl (cp_type_quals (TREE_TYPE (decl)), decl); + layout_decl (decl, 0); } } @@ -4039,7 +4066,7 @@ maybe_commonize_var (tree decl) cp_warning_at ("sorry: semantics of inline function static " "data %q#D are wrong (you'll wind up " "with multiple copies)", decl); - warning ("%J you can work around this by removing " + warning (0, "%J you can work around this by removing " "the initializer", decl); } @@ -4353,7 +4380,7 @@ reshape_init (tree type, tree *initp) if (brace_enclosed_p) error ("too many initializers for %qT", type); else if (warn_missing_braces && !string_init_p) - warning ("missing braces around initializer"); + warning (0, "missing braces around initializer"); } return new_init; @@ -4493,7 +4520,7 @@ check_initializer (tree decl, tree init, int flags, tree *cleanup) && DECL_INITIAL (decl) && TREE_CODE (DECL_INITIAL (decl)) == STRING_CST && PAREN_STRING_LITERAL_P (DECL_INITIAL (decl))) - warning ("array %qD initialized by parenthesized string literal %qE", + warning (0, "array %qD initialized by parenthesized string literal %qE", decl, DECL_INITIAL (decl)); init = NULL; } @@ -4530,6 +4557,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) { int toplev = toplevel_bindings_p (); int defer_p; + const char *filename; /* Set the DECL_ASSEMBLER_NAME for the object. */ if (asmspec) @@ -4579,17 +4607,19 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec) /* We try to defer namespace-scope static constants so that they are not emitted into the object file unnecessarily. */ + filename = input_filename; if (!DECL_VIRTUAL_P (decl) && TREE_READONLY (decl) && DECL_INITIAL (decl) != NULL_TREE && DECL_INITIAL (decl) != error_mark_node + && filename != NULL && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl)) && toplev && !TREE_PUBLIC (decl)) { /* Fool with the linkage of static consts according to #pragma interface. */ - struct c_fileinfo *finfo = get_fileinfo (lbasename (input_filename)); + struct c_fileinfo *finfo = get_fileinfo (lbasename (filename)); if (!finfo->interface_unknown && !TREE_PUBLIC (decl)) { TREE_PUBLIC (decl) = 1; @@ -4767,7 +4797,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) && IS_AGGR_TYPE (type) && DECL_NAME (decl)) { if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) - warning ("shadowing previous type declaration of %q#D", decl); + warning (0, "shadowing previous type declaration of %q#D", decl); set_identifier_type_value (DECL_NAME (decl), decl); } @@ -4982,6 +5012,7 @@ get_atexit_node (void) tree fn_type; tree fn_ptr_type; const char *name; + bool use_aeabi_atexit; if (atexit_node) return atexit_node; @@ -4995,6 +5026,7 @@ get_atexit_node (void) We build up the argument types and then then function type itself. */ + use_aeabi_atexit = targetm.cxx.use_aeabi_atexit (); /* First, build the pointer-to-function type for the first argument. */ arg_types = tree_cons (NULL_TREE, ptr_type_node, void_list_node); @@ -5002,12 +5034,23 @@ get_atexit_node (void) fn_ptr_type = build_pointer_type (fn_type); /* Then, build the rest of the argument types. */ arg_types = tree_cons (NULL_TREE, ptr_type_node, void_list_node); - arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); - arg_types = tree_cons (NULL_TREE, fn_ptr_type, arg_types); + if (use_aeabi_atexit) + { + arg_types = tree_cons (NULL_TREE, fn_ptr_type, arg_types); + arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); + } + else + { + arg_types = tree_cons (NULL_TREE, ptr_type_node, arg_types); + arg_types = tree_cons (NULL_TREE, fn_ptr_type, arg_types); + } /* And the final __cxa_atexit type. */ fn_type = build_function_type (integer_type_node, arg_types); fn_ptr_type = build_pointer_type (fn_type); - name = "__cxa_atexit"; + if (use_aeabi_atexit) + name = "__aeabi_atexit"; + else + name = "__cxa_atexit"; } else { @@ -5168,8 +5211,16 @@ register_dtor_fn (tree decl) args = tree_cons (NULL_TREE, build_unary_op (ADDR_EXPR, get_dso_handle_node (), 0), NULL_TREE); - args = tree_cons (NULL_TREE, null_pointer_node, args); - args = tree_cons (NULL_TREE, cleanup, args); + if (targetm.cxx.use_aeabi_atexit ()) + { + args = tree_cons (NULL_TREE, cleanup, args); + args = tree_cons (NULL_TREE, null_pointer_node, args); + } + else + { + args = tree_cons (NULL_TREE, null_pointer_node, args); + args = tree_cons (NULL_TREE, cleanup, args); + } } else args = tree_cons (NULL_TREE, cleanup, NULL_TREE); @@ -5279,15 +5330,15 @@ expand_static_init (tree decl, tree init) flag = TARGET_EXPR_SLOT (begin); TARGET_EXPR_CLEANUP (begin) - = build (COND_EXPR, void_type_node, flag, - void_zero_node, - build_call (abort_fn, guard_addr_list)); + = build3 (COND_EXPR, void_type_node, flag, + void_zero_node, + build_call (abort_fn, guard_addr_list)); CLEANUP_EH_ONLY (begin) = 1; /* Do the initialization itself. */ init = add_stmt_to_compound (begin, init); init = add_stmt_to_compound - (init, build (MODIFY_EXPR, void_type_node, flag, boolean_true_node)); + (init, build2 (MODIFY_EXPR, void_type_node, flag, boolean_true_node)); init = add_stmt_to_compound (init, build_call (release_fn, guard_addr_list)); } @@ -5325,102 +5376,41 @@ expand_static_init (tree decl, tree init) 3 if the initializer list is empty (in pedantic mode). */ int -complete_array_type (tree type, tree initial_value, int do_default) +cp_complete_array_type (tree *ptype, tree initial_value, bool do_default) { - tree maxindex = NULL_TREE; - int value = 0; + int failure; + tree type, elt_type; if (initial_value) { /* An array of character type can be initialized from a brace-enclosed string constant. */ - if (char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (type))) + if (char_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (*ptype))) && TREE_CODE (initial_value) == CONSTRUCTOR && CONSTRUCTOR_ELTS (initial_value) && (TREE_CODE (TREE_VALUE (CONSTRUCTOR_ELTS (initial_value))) == STRING_CST) && TREE_CHAIN (CONSTRUCTOR_ELTS (initial_value)) == NULL_TREE) initial_value = TREE_VALUE (CONSTRUCTOR_ELTS (initial_value)); - - /* Note MAXINDEX is really the maximum index, one less than the - size. */ - if (TREE_CODE (initial_value) == STRING_CST) - { - int eltsize - = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value))); - maxindex = build_int_cst (NULL_TREE, - (TREE_STRING_LENGTH (initial_value) - / eltsize) - 1); - } - else if (TREE_CODE (initial_value) == CONSTRUCTOR) - { - tree elts = CONSTRUCTOR_ELTS (initial_value); - - maxindex = ssize_int (-1); - for (; elts; elts = TREE_CHAIN (elts)) - { - if (TREE_PURPOSE (elts)) - maxindex = TREE_PURPOSE (elts); - else - maxindex = size_binop (PLUS_EXPR, maxindex, ssize_int (1)); - } - - if (pedantic && tree_int_cst_equal (maxindex, ssize_int (-1))) - value = 3; - } - else - { - /* Make an error message unless that happened already. */ - if (initial_value != error_mark_node) - value = 1; - else - initial_value = NULL_TREE; - - /* Prevent further error messages. */ - maxindex = build_int_cst (NULL_TREE, 0); - } } - if (!maxindex) - { - if (do_default) - maxindex = build_int_cst (NULL_TREE, 0); - value = 2; - } + failure = complete_array_type (ptype, initial_value, do_default); - if (maxindex) + /* We can create the array before the element type is complete, which + means that we didn't have these two bits set in the original type + either. In completing the type, we are expected to propagate these + bits. See also complete_type which does the same thing for arrays + of fixed size. */ + type = *ptype; + if (TYPE_DOMAIN (type)) { - tree itype; - tree domain; - tree elt_type; - - domain = build_index_type (maxindex); - TYPE_DOMAIN (type) = domain; - - if (initial_value) - itype = TREE_TYPE (initial_value); - else - itype = NULL; - if (itype && !TYPE_DOMAIN (itype)) - TYPE_DOMAIN (itype) = domain; - /* The type of the main variant should never be used for arrays - of different sizes. It should only ever be completed with the - size of the array. */ - if (! TYPE_DOMAIN (TYPE_MAIN_VARIANT (type))) - TYPE_DOMAIN (TYPE_MAIN_VARIANT (type)) = domain; - elt_type = TREE_TYPE (type); - TYPE_NEEDS_CONSTRUCTING (type) - = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (elt_type)); + TYPE_NEEDS_CONSTRUCTING (type) = TYPE_NEEDS_CONSTRUCTING (elt_type); TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type) - = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (elt_type)); + = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (elt_type); } - /* Lay out the type now that we can get the real answer. */ - - layout_type (type); - - return value; + return failure; } /* Return zero if something is declared to be a member of type @@ -5930,7 +5920,7 @@ grokvardecl (tree type, no linkage can only be used to declare extern "C" entities. Since it's not always an error in the ISO C++ 90 Standard, we only issue a warning. */ - warning ("non-local variable %q#D uses anonymous type", + warning (0, "non-local variable %q#D uses anonymous type", decl); if (DECL_ORIGINAL_TYPE (TYPE_NAME (t))) cp_warning_at ("%q#D does not refer to the unqualified " @@ -5939,7 +5929,7 @@ grokvardecl (tree type, } } else - warning ("non-local variable %q#D uses local type %qT", decl, t); + warning (0, "non-local variable %q#D uses local type %qT", decl, t); } } else @@ -6773,7 +6763,7 @@ grokdeclarator (const cp_declarator *declarator, else if (pedantic || ! is_main) pedwarn ("ISO C++ forbids declaration of %qs with no type", name); else if (warn_return_type) - warning ("ISO C++ forbids declaration of %qs with no type", name); + warning (0, "ISO C++ forbids declaration of %qs with no type", name); type = integer_type_node; } @@ -7012,30 +7002,7 @@ grokdeclarator (const cp_declarator *declarator, else { if (decl_context == FIELD) - { - tree tmp = NULL_TREE; - int op = 0; - - if (declarator) - { - /* Avoid trying to get an operand off an identifier node. */ - if (declarator->kind != cdk_id) - tmp = declarator->declarator->u.id.unqualified_name; - else - tmp = declarator->u.id.unqualified_name; - op = IDENTIFIER_OPNAME_P (tmp); - if (IDENTIFIER_TYPENAME_P (tmp)) - { - if (is_typename_at_global_scope (tmp)) - name = IDENTIFIER_POINTER (tmp); - else - name = ""; - } - } - error ("storage class specified for %s %qs", - op ? "member operator" : "field", - name); - } + error ("storage class specified for %qs", name); else { if (decl_context == PARM || decl_context == CATCHPARM) @@ -7058,7 +7025,7 @@ grokdeclarator (const cp_declarator *declarator, /* It's common practice (and completely valid) to have a const be initialized and declared extern. */ if (!(type_quals & TYPE_QUAL_CONST)) - warning ("%qs initialized and declared %", name); + warning (0, "%qs initialized and declared %", name); } else error ("%qs has both % and initializer", name); @@ -7113,9 +7080,7 @@ grokdeclarator (const cp_declarator *declarator, /* Determine the type of the entity declared by recurring on the declarator. */ - for (; - declarator && declarator->kind != cdk_id; - declarator = declarator->declarator) + for (; declarator; declarator = declarator->declarator) { const cp_declarator *inner_declarator; tree attrs; @@ -7123,8 +7088,6 @@ grokdeclarator (const cp_declarator *declarator, if (type == error_mark_node) return error_mark_node; - inner_declarator = declarator->declarator; - attrs = declarator->attributes; if (attrs) { @@ -7142,6 +7105,11 @@ grokdeclarator (const cp_declarator *declarator, attr_flags); } + if (declarator->kind == cdk_id) + break; + + inner_declarator = declarator->declarator; + switch (declarator->kind) { case cdk_array: @@ -7997,7 +7965,7 @@ grokdeclarator (const cp_declarator *declarator, { /* Friends are treated specially. */ if (ctype == current_class_type) - warning ("member functions are implicitly friends of their class"); + warning (0, "member functions are implicitly friends of their class"); else if (decl && DECL_NAME (decl)) { if (template_class_depth (current_class_type) == 0) @@ -8821,7 +8789,7 @@ grok_op_properties (tree decl, int friendp, bool complain) what = "a base class"; if (what && warn_conversion) - warning ("conversion to %s%s will never use a type " + warning (0, "conversion to %s%s will never use a type " "conversion operator", ref ? "a reference to " : "", what); } @@ -8913,13 +8881,13 @@ grok_op_properties (tree decl, int friendp, bool complain) if (TREE_CODE (ret) != REFERENCE_TYPE || !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)), arg)) - warning ("prefix %qD should return %qT", decl, + warning (0, "prefix %qD should return %qT", decl, build_reference_type (arg)); } else { if (!same_type_p (TYPE_MAIN_VARIANT (ret), arg)) - warning ("postfix %qD should return %qT", decl, arg); + warning (0, "postfix %qD should return %qT", decl, arg); } } } @@ -8948,7 +8916,7 @@ grok_op_properties (tree decl, int friendp, bool complain) && (operator_code == TRUTH_ANDIF_EXPR || operator_code == TRUTH_ORIF_EXPR || operator_code == COMPOUND_EXPR)) - warning ("user-defined %qD always evaluates both arguments", + warning (0, "user-defined %qD always evaluates both arguments", decl); } @@ -8962,7 +8930,7 @@ grok_op_properties (tree decl, int friendp, bool complain) || operator_code == MULT_EXPR || operator_code == TRUNC_MOD_EXPR) && TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE) - warning ("%qD should return by value", decl); + warning (0, "%qD should return by value", decl); /* [over.oper]/8 */ for (; argtypes && argtypes != void_list_node; @@ -9387,7 +9355,7 @@ xref_basetypes (tree ref, tree base_list) if (max_bases) { - BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, max_bases); + BINFO_BASE_ACCESSES (binfo) = VEC_alloc (tree, gc, max_bases); /* An aggregate cannot have baseclasses. */ CLASSTYPE_NON_AGGREGATE (ref) = 1; @@ -9403,7 +9371,7 @@ xref_basetypes (tree ref, tree base_list) if (max_vbases) { - CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, max_vbases); + CLASSTYPE_VBASECLASSES (ref) = VEC_alloc (tree, gc, max_vbases); if (TYPE_FOR_JAVA (ref)) error ("Java class %qT cannot have virtual bases", ref); @@ -9950,7 +9918,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) if (DECL_DECLARED_INLINE_P (decl1) && lookup_attribute ("noinline", attrs)) - warning ("%Jinline function %qD given attribute noinline", decl1, decl1); + warning (0, "%Jinline function %qD given attribute noinline", decl1, decl1); if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl1)) /* This is a constructor, we must ensure that any default args @@ -9987,7 +9955,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) if (warn_ecpp && DECL_OVERLOADED_OPERATOR_P (decl1) == NOP_EXPR && TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE) - warning ("% should return a reference to %<*this%>"); + warning (0, "% should return a reference to %<*this%>"); /* Make the init_value nonzero so pushdecl knows this is not tentative. error_mark_node is replaced below (in poplevel) with the BLOCK. */ @@ -10003,7 +9971,12 @@ start_preparsed_function (tree decl1, tree attrs, int flags) class scope, current_class_type will be NULL_TREE until set above by push_nested_class.) */ if (processing_template_decl) - decl1 = push_template_decl (decl1); + { + /* FIXME: Handle error_mark_node more gracefully. */ + tree newdecl1 = push_template_decl (decl1); + if (newdecl1 != error_mark_node) + decl1 = newdecl1; + } /* We are now in the scope of the function being defined. */ current_function_decl = decl1; @@ -10715,7 +10688,7 @@ finish_function (int flags) /* Structor return values (if any) are set by the compiler. */ && !DECL_CONSTRUCTOR_P (fndecl) && !DECL_DESTRUCTOR_P (fndecl)) - warning ("no return statement in function returning non-void"); + warning (0, "no return statement in function returning non-void"); /* Store the end of the function, so that we get good line number info for the epilogue. */ @@ -10908,7 +10881,7 @@ finish_method (tree decl) for String.cc in libg++. */ if (DECL_FRIEND_P (fndecl)) { - VEC_safe_push (tree, CLASSTYPE_INLINE_FRIENDS (current_class_type), + VEC_safe_push (tree, gc, CLASSTYPE_INLINE_FRIENDS (current_class_type), fndecl); decl = void_type_node; } diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 474e04e2faa..970c6381cc6 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -86,19 +86,11 @@ static tree get_guard_bits (tree); /* A list of static class variables. This is needed, because a static class variable can be declared inside the class without an initializer, and then initialized, statically, outside the class. */ -static GTY(()) varray_type pending_statics; -#define pending_statics_used \ - (pending_statics ? pending_statics->elements_used : 0) +static GTY(()) VEC(tree,gc) *pending_statics; /* A list of functions which were declared inline, but which we may need to emit outline anyway. */ -static GTY(()) varray_type deferred_fns; -#define deferred_fns_used \ - (deferred_fns ? deferred_fns->elements_used : 0) - -/* Flag used when debugging spew.c */ - -extern int spew_debug; +static GTY(()) VEC(tree,gc) *deferred_fns; /* Nonzero if we're done parsing and into end-of-file activities. */ @@ -420,7 +412,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) /* An array can't have been allocated by new, so complain. */ if (TREE_CODE (exp) == VAR_DECL && TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE) - warning ("deleting array %q#D", exp); + warning (0, "deleting array %q#D", exp); t = build_expr_type_conversion (WANT_POINTER, exp, true); @@ -446,7 +438,7 @@ delete_sanity (tree exp, tree size, bool doing_vec, int use_global_delete) /* Deleting ptr to void is undefined behavior [expr.delete/3]. */ if (TREE_CODE (TREE_TYPE (type)) == VOID_TYPE) { - warning ("deleting %qT is undefined", type); + warning (0, "deleting %qT is undefined", type); doing_vec = 0; } @@ -622,7 +614,7 @@ check_classfn (tree ctype, tree function, tree template_parms) ix = class_method_index_for_fn (complete_type (ctype), function); if (ix >= 0) { - VEC(tree) *methods = CLASSTYPE_METHOD_VEC (ctype); + VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (ctype); tree fndecls, fndecl = 0; bool is_conv_op; tree pushed_scope; @@ -732,9 +724,7 @@ note_vague_linkage_fn (tree decl) { DECL_DEFERRED_FN (decl) = 1; DECL_DEFER_OUTPUT (decl) = 1; - if (!deferred_fns) - VARRAY_TREE_INIT (deferred_fns, 32, "deferred_fns"); - VARRAY_PUSH_TREE (deferred_fns, decl); + VEC_safe_push (tree, gc, deferred_fns, decl); } } @@ -743,9 +733,7 @@ note_vague_linkage_fn (tree decl) static void note_vague_linkage_var (tree var) { - if (!pending_statics) - VARRAY_TREE_INIT (pending_statics, 32, "pending_statics"); - VARRAY_PUSH_TREE (pending_statics, var); + VEC_safe_push (tree, gc, pending_statics, var); } /* We have just processed the DECL, which is a static data member. @@ -1168,7 +1156,7 @@ finish_anon_union (tree anon_union_decl) main_decl = build_anon_union_vars (type, anon_union_decl); if (main_decl == NULL_TREE) { - warning ("anonymous union with no members"); + warning (0, "anonymous union with no members"); return; } @@ -1636,28 +1624,19 @@ determine_visibility (tree decl) && DECL_DECLARED_INLINE_P (decl) && visibility_options.inlines_hidden) { - DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; - DECL_VISIBILITY_SPECIFIED (decl) = 1; + /* Don't change it if it has been set explicitly by user. */ + if (!DECL_VISIBILITY_SPECIFIED (decl)) + { + DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN; + DECL_VISIBILITY_SPECIFIED (decl) = 1; + } } else if (CLASSTYPE_VISIBILITY_SPECIFIED (class_type)) { DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type); DECL_VISIBILITY_SPECIFIED (decl) = 1; } - /* If no explicit visibility information has been provided for - this class, some targets require that class data be - exported. */ - else if (TREE_CODE (decl) == VAR_DECL - && targetm.cxx.export_class_data () - && (DECL_TINFO_P (decl) - || (DECL_VTABLE_OR_VTT_P (decl) - /* Construction virtual tables are not emitted - because they cannot be referred to from other - object files; their name is not standardized by - the ABI. */ - && !DECL_CONSTRUCTION_VTABLE_P (decl)))) - DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; - else + else if (!DECL_VISIBILITY_SPECIFIED (decl)) { DECL_VISIBILITY (decl) = CLASSTYPE_VISIBILITY (class_type); DECL_VISIBILITY_SPECIFIED (decl) = 0; @@ -1683,6 +1662,7 @@ import_export_decl (tree decl) int emit_p; bool comdat_p; bool import_p; + tree class_type = NULL_TREE; if (DECL_INTERFACE_KNOWN (decl)) return; @@ -1773,39 +1753,62 @@ import_export_decl (tree decl) ; else if (TREE_CODE (decl) == VAR_DECL && DECL_VTABLE_OR_VTT_P (decl)) { - tree type = DECL_CONTEXT (decl); - import_export_class (type); - if (TYPE_FOR_JAVA (type)) + class_type = DECL_CONTEXT (decl); + import_export_class (class_type); + if (TYPE_FOR_JAVA (class_type)) import_p = true; - else if (CLASSTYPE_INTERFACE_KNOWN (type) - && CLASSTYPE_INTERFACE_ONLY (type)) + else if (CLASSTYPE_INTERFACE_KNOWN (class_type) + && CLASSTYPE_INTERFACE_ONLY (class_type)) import_p = true; - else if (TARGET_WEAK_NOT_IN_ARCHIVE_TOC - && !CLASSTYPE_USE_TEMPLATE (type) - && CLASSTYPE_KEY_METHOD (type) - && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type))) + else if ((!flag_weak || TARGET_WEAK_NOT_IN_ARCHIVE_TOC) + && !CLASSTYPE_USE_TEMPLATE (class_type) + && CLASSTYPE_KEY_METHOD (class_type) + && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))) /* The ABI requires that all virtual tables be emitted with COMDAT linkage. However, on systems where COMDAT symbols don't show up in the table of contents for a static - archive, the linker will report errors about undefined - symbols because it will not see the virtual table - definition. Therefore, in the case that we know that the - virtual table will be emitted in only one translation - unit, we make the virtual table an ordinary definition - with external linkage. */ + archive, or on systems without weak symbols (where we + approximate COMDAT linkage by using internal linkage), the + linker will report errors about undefined symbols because + it will not see the virtual table definition. Therefore, + in the case that we know that the virtual table will be + emitted in only one translation unit, we make the virtual + table an ordinary definition with external linkage. */ DECL_EXTERNAL (decl) = 0; - else if (CLASSTYPE_INTERFACE_KNOWN (type)) + else if (CLASSTYPE_INTERFACE_KNOWN (class_type)) { - /* TYPE is being exported from this translation unit, so DECL - should be defined here. The ABI requires COMDAT - linkage. Normally, we only emit COMDAT things when they - are needed; make sure that we realize that this entity is - indeed needed. */ - comdat_p = true; - mark_needed (decl); + /* CLASS_TYPE is being exported from this translation unit, + so DECL should be defined here. */ + if (!flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type)) + /* If a class is declared in a header with the "extern + template" extension, then it will not be instantiated, + even in translation units that would normally require + it. Often such classes are explicitly instantiated in + one translation unit. Therefore, the explicit + instantiation must be made visible to other translation + units. */ + DECL_EXTERNAL (decl) = 0; + else + { + /* The generic C++ ABI says that class data is always + COMDAT, even if there is a key function. Some + variants (e.g., the ARM EABI) says that class data + only has COMDAT linkage if the the class data might + be emitted in more than one translation unit. */ + if (!CLASSTYPE_KEY_METHOD (class_type) + || targetm.cxx.class_data_always_comdat ()) + { + /* The ABI requires COMDAT linkage. Normally, we + only emit COMDAT things when they are needed; + make sure that we realize that this entity is + indeed needed. */ + comdat_p = true; + mark_needed (decl); + } + } } else if (!flag_implicit_templates - && CLASSTYPE_IMPLICIT_INSTANTIATION (type)) + && CLASSTYPE_IMPLICIT_INSTANTIATION (class_type)) import_p = true; else comdat_p = true; @@ -1815,6 +1818,7 @@ import_export_decl (tree decl) tree type = TREE_TYPE (DECL_NAME (decl)); if (CLASS_TYPE_P (type)) { + class_type = type; import_export_class (type); if (CLASSTYPE_INTERFACE_KNOWN (type) && TYPE_POLYMORPHIC_P (type) @@ -1827,10 +1831,19 @@ import_export_decl (tree decl) import_p = true; else { - comdat_p = true; if (CLASSTYPE_INTERFACE_KNOWN (type) && !CLASSTYPE_INTERFACE_ONLY (type)) - mark_needed (decl); + { + comdat_p = targetm.cxx.class_data_always_comdat (); + mark_needed (decl); + if (!flag_weak) + { + comdat_p = false; + DECL_EXTERNAL (decl) = 0; + } + } + else + comdat_p = true; } } else @@ -1895,6 +1908,21 @@ import_export_decl (tree decl) comdat_linkage (decl); } + /* Give the target a chance to override the visibility associated + with DECL. */ + if (TREE_CODE (decl) == VAR_DECL + && (DECL_TINFO_P (decl) + || (DECL_VTABLE_OR_VTT_P (decl) + /* Construction virtual tables are not exported because + they cannot be referred to from other object files; + their name is not standardized by the ABI. */ + && !DECL_CONSTRUCTION_VTABLE_P (decl))) + && TREE_PUBLIC (decl) + && !DECL_REALLY_EXTERN (decl) + && DECL_VISIBILITY_SPECIFIED (decl) + && (!class_type || !CLASSTYPE_VISIBILITY_SPECIFIED (class_type))) + targetm.cxx.determine_class_data_visibility (decl); + DECL_INTERFACE_KNOWN (decl) = 1; } @@ -2110,6 +2138,7 @@ finish_objects (int method_type, int initp, tree body) if (targetm.have_ctors_dtors) { rtx fnsym = XEXP (DECL_RTL (fn), 0); + cgraph_mark_needed_node (cgraph_node (fn)); if (method_type == 'I') (* targetm.asm_out.constructor) (fnsym, initp); else @@ -2138,7 +2167,7 @@ static GTY(()) tree ssdf_decl; /* All the static storage duration functions created in this translation unit. */ -static GTY(()) varray_type ssdf_decls; +static GTY(()) VEC(tree,gc) *ssdf_decls; /* A map from priority levels to information about that priority level. There may be many such levels, so efficient lookup is @@ -2186,7 +2215,7 @@ start_static_storage_duration_function (unsigned count) static constructors and destructors. */ if (!ssdf_decls) { - VARRAY_TREE_INIT (ssdf_decls, 32, "ssdf_decls"); + ssdf_decls = VEC_alloc (tree, gc, 32); /* Take this opportunity to initialize the map from priority numbers to information about that priority level. */ @@ -2202,7 +2231,7 @@ start_static_storage_duration_function (unsigned count) get_priority_info (DEFAULT_INIT_PRIORITY); } - VARRAY_PUSH_TREE (ssdf_decls, ssdf_decl); + VEC_safe_push (tree, gc, ssdf_decls, ssdf_decl); /* Create the argument list. */ initialize_p_decl = cp_build_parm_decl @@ -2576,28 +2605,34 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority, global constructors and destructors. */ body = NULL_TREE; + /* 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); + } + /* Call the static storage duration function with appropriate arguments. */ - if (ssdf_decls) - for (i = 0; i < ssdf_decls->elements_used; ++i) - { - fndecl = VARRAY_TREE (ssdf_decls, i); - - /* Calls to pure or const functions will expand to nothing. */ - if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE))) - { - if (! body) - body = start_objects (function_key, priority); - - arguments = tree_cons (NULL_TREE, - build_int_cst (NULL_TREE, priority), - NULL_TREE); - arguments = tree_cons (NULL_TREE, - build_int_cst (NULL_TREE, constructor_p), - arguments); - finish_expr_stmt (build_function_call (fndecl, arguments)); - } - } + for (i = 0; VEC_iterate (tree, ssdf_decls, i, fndecl); ++i) + { + /* Calls to pure or const functions will expand to nothing. */ + if (! (flags_from_decl_or_type (fndecl) & (ECF_CONST | ECF_PURE))) + { + if (! body) + body = start_objects (function_key, priority); + + arguments = tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, priority), + NULL_TREE); + arguments = tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, constructor_p), + arguments); + finish_expr_stmt (build_function_call (fndecl, arguments)); + } + } /* If we're generating code for the DEFAULT_INIT_PRIORITY, throw in calls to any functions marked with attributes indicating that @@ -2710,6 +2745,7 @@ cp_finish_file (void) location_t locus; unsigned ssdf_count = 0; int retries = 0; + tree decl; locus = input_location; at_eof = 1; @@ -2752,6 +2788,7 @@ cp_finish_file (void) do { tree t; + tree decl; reconsider = false; @@ -2873,10 +2910,8 @@ cp_finish_file (void) /* Go through the set of inline functions whose bodies have not been emitted yet. If out-of-line copies of these functions are required, emit them. */ - for (i = 0; i < deferred_fns_used; ++i) + for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) { - tree decl = VARRAY_TREE (deferred_fns, i); - /* Does it need synthesizing? */ if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl) && (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl))) @@ -2940,9 +2975,8 @@ cp_finish_file (void) reconsider = true; /* Static data members are just like namespace-scope globals. */ - for (i = 0; i < pending_statics_used; ++i) + for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i) { - tree decl = VARRAY_TREE (pending_statics, i); if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)) continue; import_export_decl (decl); @@ -2951,17 +2985,9 @@ cp_finish_file (void) if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl)) DECL_EXTERNAL (decl) = 0; } - if (pending_statics - && wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0), - pending_statics_used)) - reconsider = true; - - /* Ask the back end to emit functions and variables that are - enqueued. These emissions may result in marking more entities - as needed. */ - if (cgraph_assemble_pending_functions ()) - reconsider = true; - if (cgraph_varpool_assemble_pending_decls ()) + if (VEC_length (tree, pending_statics) != 0 + && wrapup_global_declarations (VEC_address (tree, pending_statics), + VEC_length (tree, pending_statics))) reconsider = true; retries++; @@ -2969,10 +2995,8 @@ cp_finish_file (void) while (reconsider); /* All used inline functions must have a definition at this point. */ - for (i = 0; i < deferred_fns_used; ++i) + for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) { - tree decl = VARRAY_TREE (deferred_fns, i); - if (/* Check online inline functions that were actually used. */ TREE_USED (decl) && DECL_DECLARED_INLINE_P (decl) /* But not defined. */ @@ -3034,9 +3058,9 @@ cp_finish_file (void) /* Now, issue warnings about static, but not defined, functions, etc., and emit debugging information. */ walk_namespaces (wrapup_globals_for_namespace, /*data=*/&reconsider); - if (pending_statics) - check_global_declarations (&VARRAY_TREE (pending_statics, 0), - pending_statics_used); + if (VEC_length (tree, pending_statics) != 0) + check_global_declarations (VEC_address (tree, pending_statics), + VEC_length (tree, pending_statics)); finish_repo (); diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c index 357435f1dcd..6b93045e02f 100644 --- a/gcc/cp/dump.c +++ b/gcc/cp/dump.c @@ -1,5 +1,6 @@ /* Tree-dumping functionality for intermediate representation. - Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Written by Mark Mitchell This file is part of GCC. @@ -423,6 +424,46 @@ cp_dump_tree (void* dump_info, tree t) dump_child ("else", ELSE_CLAUSE (t)); break; + case BREAK_STMT: + case CONTINUE_STMT: + dump_stmt (di, t); + break; + + case DO_STMT: + dump_stmt (di, t); + dump_child ("body", DO_BODY (t)); + dump_child ("cond", DO_COND (t)); + break; + + case FOR_STMT: + dump_stmt (di, t); + dump_child ("init", FOR_INIT_STMT (t)); + dump_child ("cond", FOR_COND (t)); + dump_child ("expr", FOR_EXPR (t)); + dump_child ("body", FOR_BODY (t)); + break; + + case SWITCH_STMT: + dump_stmt (di, t); + dump_child ("cond", SWITCH_STMT_COND (t)); + dump_child ("body", SWITCH_STMT_BODY (t)); + break; + + case WHILE_STMT: + dump_stmt (di, t); + dump_child ("cond", WHILE_COND (t)); + dump_child ("body", WHILE_BODY (t)); + break; + + case STMT_EXPR: + dump_child ("stmt", STMT_EXPR_STMT (t)); + break; + + case EXPR_STMT: + dump_stmt (di, t); + dump_child ("expr", EXPR_STMT_EXPR (t)); + break; + default: break; } diff --git a/gcc/cp/error.c b/gcc/cp/error.c index c53e0328cd0..1748fe0aa69 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1413,9 +1413,9 @@ dump_expr (tree t, int flags) if (TREE_CODE (type) == ARRAY_REF) type = build_cplus_array_type (TREE_OPERAND (type, 0), - build_index_type (fold (build2 (MINUS_EXPR, integer_type_node, - TREE_OPERAND (type, 1), - integer_one_node)))); + build_index_type (fold_build2 (MINUS_EXPR, integer_type_node, + TREE_OPERAND (type, 1), + integer_one_node))); dump_type (type, flags); if (init) { diff --git a/gcc/cp/except.c b/gcc/cp/except.c index ef4fb2193b5..60db762924e 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -599,7 +599,7 @@ build_throw (tree exp) } if (exp == null_node) - warning ("throwing NULL, which has integral, not pointer type"); + warning (0, "throwing NULL, which has integral, not pointer type"); if (exp != NULL_TREE) { @@ -918,9 +918,9 @@ check_handlers_1 (tree master, tree_stmt_iterator i) tree handler = tsi_stmt (i); if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler))) { - warning ("%Hexception of type %qT will be caught", + warning (0, "%Hexception of type %qT will be caught", EXPR_LOCUS (handler), TREE_TYPE (handler)); - warning ("%H by earlier handler for %qT", + warning (0, "%H by earlier handler for %qT", EXPR_LOCUS (master), type); break; } diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 8203dbb3b6f..3f7a2606246 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -1,5 +1,5 @@ /* Help friends in C++. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -149,7 +149,7 @@ add_friend (tree type, tree decl, bool complain) if (decl == TREE_VALUE (friends)) { if (complain) - warning ("%qD is already a friend of class %qT", + warning (0, "%qD is already a friend of class %qT", decl, type); return; } @@ -361,7 +361,7 @@ make_friend_class (tree type, tree friend_type, bool complain) if (friend_type == probe) { if (complain) - warning ("%qD is already a friend of %qT", probe, type); + warning (0, "%qD is already a friend of %qT", probe, type); break; } } @@ -370,7 +370,7 @@ make_friend_class (tree type, tree friend_type, bool complain) if (same_type_p (probe, friend_type)) { if (complain) - warning ("%qT is already a friend of %qT", probe, type); + warning (0, "%qT is already a friend of %qT", probe, type); break; } } @@ -550,11 +550,11 @@ do_friend (tree ctype, tree declarator, tree decl, if (warn) { static int explained; - warning ("friend declaration %q#D declares a non-template " + warning (0, "friend declaration %q#D declares a non-template " "function", decl); if (! explained) { - warning ("(if this is not what you intended, make sure " + warning (0, "(if this is not what you intended, make sure " "the function template has already been declared " "and add <> after the function name here) " "-Wno-non-template-friend disables this warning"); diff --git a/gcc/cp/init.c b/gcc/cp/init.c index c526bb14511..99891cb2922 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -222,8 +222,8 @@ build_zero_init (tree type, tree nelts, bool static_storage_p) /* Iterate over the array elements, building initializations. */ inits = NULL_TREE; if (nelts) - max_index = fold (build2 (MINUS_EXPR, TREE_TYPE (nelts), - nelts, integer_one_node)); + max_index = fold_build2 (MINUS_EXPR, TREE_TYPE (nelts), + nelts, integer_one_node); else max_index = array_type_nelts (type); gcc_assert (TREE_CODE (max_index) == INTEGER_CST); @@ -323,7 +323,7 @@ perform_member_init (tree member, tree init) /* Effective C++ rule 12 requires that all data members be initialized. */ if (warn_ecpp && !explicit && TREE_CODE (type) != ARRAY_TYPE) - warning ("%J%qD should be initialized in the member initialization " + warning (0, "%J%qD should be initialized in the member initialization " "list", current_function_decl, member); if (init == void_type_node) @@ -370,7 +370,7 @@ perform_member_init (tree member, tree init) { init = build_default_init (type, /*nelts=*/NULL_TREE); if (TREE_CODE (type) == REFERENCE_TYPE) - warning ("%Jdefault-initialization of %q#D, " + warning (0, "%Jdefault-initialization of %q#D, " "which has reference type", current_function_decl, member); } @@ -465,7 +465,7 @@ sort_mem_initializers (tree t, tree mem_inits) tree base, binfo, base_binfo; tree sorted_inits; tree next_subobject; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; int i; int uses_unions_p; @@ -525,13 +525,13 @@ sort_mem_initializers (tree t, tree mem_inits) cp_warning_at ("%qD will be initialized after", TREE_PURPOSE (next_subobject)); else - warning ("base %qT will be initialized after", + warning (0, "base %qT will be initialized after", TREE_PURPOSE (next_subobject)); if (TREE_CODE (subobject) == FIELD_DECL) cp_warning_at (" %q#D", subobject); else - warning (" base %qT", subobject); - warning ("%J when initialized here", current_function_decl); + warning (0, " base %qT", subobject); + warning (0, "%J when initialized here", current_function_decl); } /* Look again, from the beginning of the list. */ @@ -655,6 +655,11 @@ sort_mem_initializers (tree t, tree mem_inits) void emit_mem_initializers (tree mem_inits) { + /* We will already have issued an error message about the fact that + the type is incomplete. */ + if (!COMPLETE_TYPE_P (current_class_type)) + return; + /* Sort the mem-initializers into the order in which the initializations should be performed. */ mem_inits = sort_mem_initializers (current_class_type, mem_inits); @@ -674,7 +679,7 @@ emit_mem_initializers (tree mem_inits) if (extra_warnings && !arguments && DECL_COPY_CONSTRUCTOR_P (current_function_decl) && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject))) - warning ("%Jbase class %q#T should be explicitly initialized in the " + warning (0, "%Jbase class %q#T should be explicitly initialized in the " "copy constructor", current_function_decl, BINFO_TYPE (subobject)); @@ -821,9 +826,9 @@ expand_cleanup_for_base (tree binfo, tree flag) binfo, LOOKUP_NORMAL | LOOKUP_NONVIRTUAL); if (flag) - expr = fold (build3 (COND_EXPR, void_type_node, - c_common_truthvalue_conversion (flag), - expr, integer_zero_node)); + expr = fold_build3 (COND_EXPR, void_type_node, + c_common_truthvalue_conversion (flag), + expr, integer_zero_node); finish_eh_cleanup (expr); } @@ -1546,9 +1551,6 @@ build_offset_ref (tree type, tree name, bool address_p) return member; } - /* In member functions, the form `type::name' is no longer - equivalent to `this->type::name', at least not until - resolve_offset_ref. */ member = build2 (OFFSET_REF, TREE_TYPE (member), decl, member); PTRMEM_OK_P (member) = 1; return member; @@ -1643,7 +1645,7 @@ build_new (tree placement, tree type, tree nelts, tree init, pedwarn ("size in array new must have integral type"); nelts = save_expr (cp_convert (sizetype, nelts)); if (nelts == integer_zero_node) - warning ("zero size array reserves no space"); + warning (0, "zero size array reserves no space"); } /* ``A reference cannot be created by the new operator. A reference @@ -2236,9 +2238,9 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, tbase = create_temporary_var (ptype); tbase_init = build_modify_expr (tbase, NOP_EXPR, - fold (build2 (PLUS_EXPR, ptype, - base, - virtual_size))); + fold_build2 (PLUS_EXPR, ptype, + base, + virtual_size)); DECL_REGISTER (tbase) = 1; controller = build3 (BIND_EXPR, void_type_node, tbase, NULL_TREE, NULL_TREE); @@ -2303,11 +2305,11 @@ build_vec_delete_1 (tree base, tree maxindex, tree type, body = integer_zero_node; /* Outermost wrapper: If pointer is null, punt. */ - body = fold (build3 (COND_EXPR, void_type_node, - fold (build2 (NE_EXPR, boolean_type_node, base, - convert (TREE_TYPE (base), - integer_zero_node))), - body, integer_zero_node)); + body = fold_build3 (COND_EXPR, void_type_node, + fold_build2 (NE_EXPR, boolean_type_node, base, + convert (TREE_TYPE (base), + integer_zero_node)), + body, integer_zero_node); body = build1 (NOP_EXPR, void_type_node, body); if (controller) @@ -2733,7 +2735,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, complete_type (type); if (!COMPLETE_TYPE_P (type)) { - warning ("possible problem detected in invocation of " + warning (0, "possible problem detected in invocation of " "delete operator:"); cxx_incomplete_type_diagnostic (addr, type, 1); inform ("neither the destructor nor the class-specific " @@ -2865,7 +2867,7 @@ push_base_cleanups (void) int i; tree member; tree expr; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; /* Run destructors for all virtual baseclasses. */ if (CLASSTYPE_VBASECLASSES (current_class_type)) diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 6074fef9ea1..21fe2a13581 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -1,6 +1,6 @@ /* Separate lexical analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -175,6 +175,7 @@ struct resword _true_. */ #define D_EXT 0x01 /* GCC extension */ #define D_ASM 0x02 /* in C99, but has a switch to turn it off */ +#define D_OBJC 0x04 /* Objective C++ only */ CONSTRAINT(ridbits_fit, RID_LAST_MODIFIER < sizeof(unsigned long) * CHAR_BIT); @@ -279,6 +280,31 @@ static const struct resword reswords[] = { "wchar_t", RID_WCHAR, 0 }, { "while", RID_WHILE, 0 }, + /* 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 }, }; void @@ -287,6 +313,7 @@ init_reswords (void) unsigned int i; tree id; int mask = ((flag_no_asm ? D_ASM : 0) + | D_OBJC | (flag_no_gnu_keywords ? D_EXT : 0)); ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree)); @@ -312,6 +339,10 @@ init_cp_pragma (void) c_register_pragma ("GCC", "java_exceptions", handle_pragma_java_exceptions); } +/* TRUE if a code represents a statement. */ + +bool statement_code_p[MAX_TREE_CODES]; + /* Initialize the C++ front end. This function is very sensitive to the exact order that things are done here. It would be nice if the initialization done by this routine were moved to its subroutines, @@ -319,12 +350,18 @@ init_cp_pragma (void) bool cxx_init (void) { + unsigned int i; static const enum tree_code stmt_codes[] = { - c_common_stmt_codes, - cp_stmt_codes + CTOR_INITIALIZER, TRY_BLOCK, HANDLER, + EH_SPEC_BLOCK, USING_STMT, TAG_DEFN, + IF_STMT, CLEANUP_STMT, FOR_STMT, + WHILE_STMT, DO_STMT, BREAK_STMT, + CONTINUE_STMT, SWITCH_STMT, EXPR_STMT }; - INIT_STATEMENT_CODES (stmt_codes); + memset (&statement_code_p, 0, sizeof (statement_code_p)); + for (i = 0; i < ARRAY_SIZE (stmt_codes); i++) + statement_code_p[stmt_codes[i]] = true; /* We cannot just assign to input_filename because it has already been initialized and will be used later as an N_BINCL for stabs+ @@ -348,11 +385,6 @@ cxx_init (void) cxx_init_decl_processing (); - /* Create the built-in __null node. It is important that this is - not shared. */ - null_node = make_node (INTEGER_CST); - TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0); - /* The fact that G++ uses COMDAT for many entities (inline functions, template instantiations, virtual tables, etc.) mean that it is fundamentally unreliable to try to make decisions @@ -433,7 +465,7 @@ parse_strconst_pragma (const char* name, int opt) { result = x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma %s", name); + warning (0, "junk at end of #pragma %s", name); return result; } @@ -527,7 +559,7 @@ handle_pragma_implementation (cpp_reader* dfile ATTRIBUTE_UNUSED ) cookie (if any) of the filename, but this requires completing the --enable-mapped-location project first. See PR 17577. */ if (cpp_included (parse_in, filename)) - warning ("#pragma implementation for %qs appears after " + warning (0, "#pragma implementation for %qs appears after " "file is included", filename); #endif } @@ -552,7 +584,7 @@ handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED ) { tree x; if (c_lex (&x) != CPP_EOF) - warning ("junk at end of #pragma GCC java_exceptions"); + warning (0, "junk at end of #pragma GCC java_exceptions"); choose_personality_routine (lang_java); } diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 1d49490a81d..a2fefd0c238 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1,5 +1,6 @@ /* Name mangling for the 3.0 C++ ABI. - Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Written by Alex Samuel This file is part of GCC. @@ -96,7 +97,7 @@ typedef struct globals GTY(()) { /* An array of the current substitution candidates, in the order we've seen them. */ - varray_type substitutions; + VEC(tree,gc) *substitutions; /* The entity that is being mangled. */ tree GTY ((skip)) entity; @@ -345,11 +346,11 @@ static void dump_substitution_candidates (void) { unsigned i; + tree el; fprintf (stderr, " ++ substitutions "); - for (i = 0; i < VARRAY_ACTIVE_SIZE (G.substitutions); ++i) + for (i = 0; VEC_iterate (tree, G.substitutions, i, el); ++i) { - tree el = VARRAY_TREE (G.substitutions, i); const char *name = "???"; if (i > 0) @@ -413,10 +414,10 @@ add_substitution (tree node) /* Make sure NODE isn't already a candidate. */ { int i; - for (i = VARRAY_ACTIVE_SIZE (G.substitutions); --i >= 0; ) + tree candidate; + + for (i = 0; VEC_iterate (tree, G.substitutions, i, candidate); i++) { - const tree candidate = VARRAY_TREE (G.substitutions, i); - gcc_assert (!(DECL_P (node) && node == candidate)); gcc_assert (!(TYPE_P (node) && TYPE_P (candidate) && same_type_p (node, candidate))); @@ -425,7 +426,7 @@ add_substitution (tree node) #endif /* ENABLE_CHECKING */ /* Put the decl onto the varray of substitution candidates. */ - VARRAY_PUSH_TREE (G.substitutions, node); + VEC_safe_push (tree, gc, G.substitutions, node); if (DEBUG_MANGLE) dump_substitution_candidates (); @@ -528,7 +529,7 @@ static int find_substitution (tree node) { int i; - const int size = VARRAY_ACTIVE_SIZE (G.substitutions); + const int size = VEC_length (tree, G.substitutions); tree decl; tree type; @@ -637,7 +638,7 @@ find_substitution (tree node) operation. */ for (i = 0; i < size; ++i) { - tree candidate = VARRAY_TREE (G.substitutions, i); + tree candidate = VEC_index (tree, G.substitutions, i); /* NODE is a matched to a candidate if it's the same decl node or if it's the same type. */ if (decl == candidate @@ -1249,16 +1250,16 @@ write_integer_cst (const tree cst) if (sign < 0) { write_char ('n'); - n = fold (build1 (NEGATE_EXPR, type, n)); + n = fold_build1 (NEGATE_EXPR, type, n); } do { - tree d = fold (build2 (FLOOR_DIV_EXPR, type, n, base)); - tree tmp = fold (build2 (MULT_EXPR, type, d, base)); + tree d = fold_build2 (FLOOR_DIV_EXPR, type, n, base); + tree tmp = fold_build2 (MULT_EXPR, type, d, base); unsigned c; done = integer_zerop (d); - tmp = fold (build2 (MINUS_EXPR, type, n, tmp)); + tmp = fold_build2 (MINUS_EXPR, type, n, tmp); c = hwint_to_ascii (TREE_INT_CST_LOW (tmp), 10, ptr, done ? 1 : chunk_digits); ptr -= c; @@ -1436,7 +1437,7 @@ discriminator_for_local_entity (tree entity) { /* Scan the list of local classes. */ entity = TREE_TYPE (entity); - for (type = &VARRAY_TREE (local_classes, 0); *type != entity; ++type) + for (type = VEC_address (tree, local_classes); *type != entity; ++type) if (TYPE_IDENTIFIER (*type) == TYPE_IDENTIFIER (entity) && TYPE_CONTEXT (*type) == TYPE_CONTEXT (entity)) ++discriminator; @@ -1757,15 +1758,34 @@ write_builtin_type (tree type) { tree t = c_common_type_for_mode (TYPE_MODE (type), TYPE_UNSIGNED (type)); - if (type == t) + if (type != t) { - gcc_assert (TYPE_PRECISION (type) == 128); - write_char (TYPE_UNSIGNED (type) ? 'o' : 'n'); + type = t; + goto iagain; } + + if (TYPE_PRECISION (type) == 128) + write_char (TYPE_UNSIGNED (type) ? 'o' : 'n'); else { - type = t; - goto iagain; + /* Allow for cases where TYPE is not one of the shared + integer type nodes and write a "vendor extended builtin + type" with a name the form intN or uintN, respectively. + Situations like this can happen if you have an + __attribute__((__mode__(__SI__))) type and use exotic + switches like '-mint8' on AVR. Of course, this is + undefined by the C++ ABI (and '-mint8' is not even + Standard C conforming), but when using such special + options you're pretty much in nowhere land anyway. */ + const char *prefix; + char prec[11]; /* up to ten digits for an unsigned */ + + prefix = TYPE_UNSIGNED (type) ? "uint" : "int"; + sprintf (prec, "%u", (unsigned) TYPE_PRECISION (type)); + write_char ('u'); /* "vendor extended builtin type" */ + write_unsigned_number (strlen (prefix) + strlen (prec)); + write_string (prefix); + write_string (prec); } } } @@ -2479,12 +2499,12 @@ static inline const char * finish_mangling (const bool warn) { if (warn_abi && warn && G.need_abi_warning) - warning ("the mangled name of %qD will change in a future " + warning (0, "the mangled name of %qD will change in a future " "version of GCC", G.entity); /* Clear all the substitutions. */ - VARRAY_CLEAR (G.substitutions); + VEC_truncate (tree, G.substitutions, 0); /* Null-terminate the string. */ write_char ('\0'); @@ -2499,7 +2519,7 @@ init_mangle (void) { gcc_obstack_init (&name_obstack); name_base = obstack_alloc (&name_obstack, 0); - VARRAY_TREE_INIT (G.substitutions, 1, "mangling substitutions"); + G.substitutions = NULL; /* Cache these identifiers for quick comparison when checking for standard substitutions. */ diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 7a99c262471..9470cd5997d 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -36,6 +36,7 @@ Boston, MA 02111-1307, USA. */ #include "toplev.h" #include "tm_p.h" #include "target.h" +#include "tree-pass.h" /* Various flags to control the mangling process. */ @@ -220,8 +221,8 @@ thunk_adjust (tree ptr, bool this_adjusting, { if (this_adjusting) /* Adjust the pointer by the constant. */ - ptr = fold (build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, - ssize_int (fixed_offset))); + ptr = fold_build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, + ssize_int (fixed_offset)); /* If there's a virtual offset, look up that value in the vtable and adjust the pointer again. */ @@ -242,13 +243,13 @@ thunk_adjust (tree ptr, bool this_adjusting, /* Get the offset itself. */ vtable = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (vtable)), vtable); /* Adjust the `this' pointer. */ - ptr = fold (build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, vtable)); + ptr = fold_build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, vtable); } if (!this_adjusting) /* Adjust the pointer by the constant. */ - ptr = fold (build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, - ssize_int (fixed_offset))); + ptr = fold_build2 (PLUS_EXPR, TREE_TYPE (ptr), ptr, + ssize_int (fixed_offset)); return ptr; } @@ -470,10 +471,27 @@ use_thunk (tree thunk_fndecl, bool emit_p) finish_expr_stmt (t); else { - t = force_target_expr (TREE_TYPE (t), t); if (!this_adjusting) - t = thunk_adjust (t, /*this_adjusting=*/0, - fixed_offset, virtual_offset); + { + tree cond = NULL_TREE; + + if (TREE_CODE (TREE_TYPE (t)) == POINTER_TYPE) + { + /* If the return type is a pointer, we need to + protect against NULL. We know there will be an + adjustment, because that's why we're emitting a + thunk. */ + t = save_expr (t); + cond = cp_convert (boolean_type_node, t); + } + + t = thunk_adjust (t, /*this_adjusting=*/0, + fixed_offset, virtual_offset); + if (cond) + t = build3 (COND_EXPR, TREE_TYPE (t), cond, t, + cp_convert (TREE_TYPE (t), integer_zero_node)); + } + t = force_target_expr (TREE_TYPE (t), t); finish_return_stmt (t); } @@ -487,7 +505,9 @@ use_thunk (tree thunk_fndecl, bool emit_p) /* Re-enable access control. */ pop_deferring_access_checks (); - expand_body (finish_function (0)); + thunk_fndecl = finish_function (0); + tree_lowering_passes (thunk_fndecl); + expand_body (thunk_fndecl); } pop_from_top_level (); @@ -520,7 +540,7 @@ do_build_copy_constructor (tree fndecl) int cvquals = cp_type_quals (TREE_TYPE (parm)); int i; tree binfo, base_binfo; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; /* Initialize all the base-classes with the parameter converted to their type so that we get their copy constructor and not @@ -1079,7 +1099,7 @@ lazily_declare_fn (special_function_kind sfk, tree type) TYPE_METHODS list, which cause the destructor to be emitted in an incorrect location in the vtable. */ if (warn_abi && DECL_VIRTUAL_P (fn)) - warning ("vtable layout for class %qT may not be ABI-compliant" + warning (0, "vtable layout for class %qT may not be ABI-compliant" "and may change in a future version of GCC due to " "implicit virtual destructor", type); diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index fda7d345b1f..0bb8888e8a3 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -306,7 +306,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope) { cp_class_binding *old_base; old_base = VEC_index (cp_class_binding, scope->class_shadowed, 0); - if (VEC_reserve (cp_class_binding, scope->class_shadowed, -1)) + if (VEC_reserve (cp_class_binding, gc, scope->class_shadowed, 1)) { /* Fixup the current bindings, as they might have moved. */ size_t i; @@ -325,7 +325,7 @@ new_class_binding (tree name, tree value, tree type, cxx_scope *scope) cb = VEC_quick_push (cp_class_binding, scope->class_shadowed, NULL); } else - cb = VEC_safe_push (cp_class_binding, scope->class_shadowed, NULL); + cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL); cb->identifier = name; binding = &cb->base; @@ -546,7 +546,7 @@ add_decl_to_level (tree decl, cxx_scope *b) && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))) || (TREE_CODE (decl) == FUNCTION_DECL && (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl)))) - VARRAY_PUSH_TREE (b->static_decls, decl); + VEC_safe_push (tree, gc, b->static_decls, decl); } } @@ -894,7 +894,7 @@ pushdecl (tree x) /* OK */; else { - warning ("extern declaration of %q#D doesn't match", x); + warning (0, "extern declaration of %q#D doesn't match", x); cp_warning_at ("global declaration %q#D", oldglobal); } } @@ -938,8 +938,8 @@ pushdecl (tree x) if (warn_shadow && !err) { - warning ("declaration of %q#D shadows a parameter", x); - warning ("%Jshadowed declaration is here", oldlocal); + warning (0, "declaration of %q#D shadows a parameter", x); + warning (0, "%Jshadowed declaration is here", oldlocal); } } @@ -963,22 +963,22 @@ pushdecl (tree x) if (member && !TREE_STATIC (member)) { /* Location of previous decl is not useful in this case. */ - warning ("declaration of %qD shadows a member of 'this'", + warning (0, "declaration of %qD shadows a member of 'this'", x); } else if (oldlocal != NULL_TREE && TREE_CODE (oldlocal) == VAR_DECL) { - warning ("declaration of %qD shadows a previous local", x); - warning ("%Jshadowed declaration is here", oldlocal); + warning (0, "declaration of %qD shadows a previous local", x); + warning (0, "%Jshadowed declaration is here", oldlocal); } else if (oldglobal != NULL_TREE && TREE_CODE (oldglobal) == VAR_DECL) /* XXX shadow warnings in outer-more namespaces */ { - warning ("declaration of %qD shadows a global declaration", + warning (0, "declaration of %qD shadows a global declaration", x); - warning ("%Jshadowed declaration is here", oldglobal); + warning (0, "%Jshadowed declaration is here", oldglobal); } } } @@ -1092,7 +1092,7 @@ check_for_out_of_scope_variable (tree decl) { if (!DECL_ERROR_REPORTED (decl)) { - warning ("name lookup of %qD changed", DECL_NAME (decl)); + warning (0, "name lookup of %qD changed", DECL_NAME (decl)); cp_warning_at (" matches this %qD under ISO standard rules", shadowed); cp_warning_at (" matches this %qD under old rules", decl); @@ -1264,11 +1264,11 @@ begin_scope (scope_kind kind, tree entity) case sk_namespace: NAMESPACE_LEVEL (entity) = scope; - VARRAY_TREE_INIT (scope->static_decls, - DECL_NAME (entity) == std_identifier - || DECL_NAME (entity) == global_scope_name - ? 200 : 10, - "Static declarations"); + scope->static_decls = + VEC_alloc (tree, gc, + DECL_NAME (entity) == std_identifier + || DECL_NAME (entity) == global_scope_name + ? 200 : 10); break; default: @@ -1861,7 +1861,7 @@ push_overloaded_decl (tree decl, int flags) if (IS_AGGR_TYPE (t) && warn_shadow && (! DECL_IN_SYSTEM_HEADER (decl) || ! DECL_IN_SYSTEM_HEADER (old))) - warning ("%q#D hides constructor for %q#T", decl, t); + warning (0, "%q#D hides constructor for %q#T", decl, t); old = NULL_TREE; } else if (is_overloaded_fn (old)) @@ -1883,6 +1883,13 @@ push_overloaded_decl (tree decl, int flags) if (duplicate_decls (decl, fn) == fn) POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, fn); } + + /* We don't overload implicit built-ins. duplicate_decls() + may fail to merge the decls if the new decl is e.g. a + template function. */ + if (TREE_CODE (old) == FUNCTION_DECL + && DECL_ANTICIPATED (old)) + old = NULL; } else if (old == error_mark_node) /* Ignore the undefined symbol marker. */ @@ -3200,7 +3207,7 @@ parse_using_directive (tree namespace, tree attribs) DECL_NAMESPACE_ASSOCIATIONS (namespace)); } else - warning ("%qD attribute directive ignored", name); + warning (0, "%qD attribute directive ignored", name); } } @@ -4694,7 +4701,7 @@ pushtag (tree name, tree type, tag_scope scope) if (TYPE_CONTEXT (type) && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL && !processing_template_decl) - VARRAY_PUSH_TREE (local_classes, type); + VEC_safe_push (tree, gc, local_classes, type); } if (b->kind == sk_class && !COMPLETE_TYPE_P (current_class_type)) @@ -4741,7 +4748,7 @@ struct saved_scope *scope_chain; *OLD_BINDINGS. */ static void -store_binding (tree id, VEC(cxx_saved_binding) **old_bindings) +store_binding (tree id, VEC(cxx_saved_binding,gc) **old_bindings) { cxx_saved_binding *saved; @@ -4753,7 +4760,7 @@ store_binding (tree id, VEC(cxx_saved_binding) **old_bindings) IDENTIFIER_MARKED (id) = 1; - saved = VEC_safe_push (cxx_saved_binding, *old_bindings, NULL); + saved = VEC_safe_push (cxx_saved_binding, gc, *old_bindings, NULL); saved->identifier = id; saved->binding = IDENTIFIER_BINDING (id); saved->real_type_value = REAL_IDENTIFIER_TYPE_VALUE (id); @@ -4761,7 +4768,7 @@ store_binding (tree id, VEC(cxx_saved_binding) **old_bindings) } static void -store_bindings (tree names, VEC(cxx_saved_binding) **old_bindings) +store_bindings (tree names, VEC(cxx_saved_binding,gc) **old_bindings) { tree t; @@ -4784,8 +4791,8 @@ store_bindings (tree names, VEC(cxx_saved_binding) **old_bindings) objects, rather than a TREE_LIST. */ static void -store_class_bindings (VEC(cp_class_binding) *names, - VEC(cxx_saved_binding) **old_bindings) +store_class_bindings (VEC(cp_class_binding,gc) *names, + VEC(cxx_saved_binding,gc) **old_bindings) { size_t i; cp_class_binding *cb; @@ -4857,7 +4864,7 @@ push_to_top_level (void) scope_chain = s; current_function_decl = NULL_TREE; - VARRAY_TREE_INIT (current_lang_base, 10, "current_lang_base"); + current_lang_base = VEC_alloc (tree, gc, 10); current_lang_name = lang_name_cplusplus; current_namespace = global_namespace; timevar_pop (TV_NAME_LOOKUP); diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index 451e6ecffa3..19bcec0eba6 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -89,7 +89,8 @@ typedef struct cxx_saved_binding GTY(()) tree real_type_value; } cxx_saved_binding; -DEF_VEC_GC_O(cxx_saved_binding); +DEF_VEC_O(cxx_saved_binding); +DEF_VEC_ALLOC_O(cxx_saved_binding,gc); extern tree identifier_type_value (tree); extern void set_identifier_type_value (tree, tree); @@ -145,7 +146,8 @@ typedef struct cp_class_binding GTY(()) tree identifier; } cp_class_binding; -DEF_VEC_GC_O(cp_class_binding); +DEF_VEC_O(cp_class_binding); +DEF_VEC_ALLOC_O(cp_class_binding,gc); /* For each binding contour we allocate a binding_level structure which records the names defined in that contour. @@ -186,7 +188,7 @@ struct cp_binding_level GTY(()) tree namespaces; /* An array of static functions and variables (for namespaces only) */ - varray_type static_decls; + VEC(tree,gc) *static_decls; /* A chain of VTABLE_DECL nodes. */ tree vtables; @@ -200,7 +202,7 @@ struct cp_binding_level GTY(()) /* For the binding level corresponding to a class, the entities declared in the class or its base classes. */ - VEC(cp_class_binding) *class_shadowed; + VEC(cp_class_binding,gc) *class_shadowed; /* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and is used for all binding levels. The TREE_PURPOSE is the name of diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 2b6c03ba4a9..b0dee735c48 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -36,6 +36,7 @@ #include "toplev.h" #include "output.h" #include "target.h" +#include "c-common.h" /* The lexer. */ @@ -66,7 +67,8 @@ typedef struct cp_token GTY (()) /* We use a stack of token pointer for saving token sets. */ typedef struct cp_token *cp_token_position; -DEF_VEC_MALLOC_P (cp_token_position); +DEF_VEC_P (cp_token_position); +DEF_VEC_ALLOC_P (cp_token_position,heap); static const cp_token eof_token = { @@ -104,7 +106,7 @@ typedef struct cp_lexer GTY (()) called. The top entry is the most recent position at which we began saving tokens. If the stack is non-empty, we are saving tokens. */ - VEC (cp_token_position) *GTY ((skip)) saved_tokens; + VEC(cp_token_position,heap) *GTY ((skip)) saved_tokens; /* True if we should output debugging information. */ bool debugging_p; @@ -260,7 +262,8 @@ cp_lexer_new_main (void) /* Initially we are not debugging. */ lexer->debugging_p = false; #endif /* ENABLE_CHECKING */ - lexer->saved_tokens = VEC_alloc (cp_token_position, CP_SAVED_TOKEN_STACK); + lexer->saved_tokens = VEC_alloc (cp_token_position, heap, + CP_SAVED_TOKEN_STACK); /* Create the buffer. */ alloc = CP_LEXER_BUFFER_SIZE; @@ -314,7 +317,8 @@ cp_lexer_new_from_tokens (cp_token_cache *cache) lexer->next_token = first == last ? (cp_token *)&eof_token : first; lexer->last_token = last; - lexer->saved_tokens = VEC_alloc (cp_token_position, CP_SAVED_TOKEN_STACK); + lexer->saved_tokens = VEC_alloc (cp_token_position, heap, + CP_SAVED_TOKEN_STACK); #ifdef ENABLE_CHECKING /* Initially we are not debugging. */ @@ -332,7 +336,7 @@ cp_lexer_destroy (cp_lexer *lexer) { if (lexer->buffer) ggc_free (lexer->buffer); - VEC_free (cp_token_position, lexer->saved_tokens); + VEC_free (cp_token_position, heap, lexer->saved_tokens); ggc_free (lexer); } @@ -405,6 +409,23 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED , mapped to `const'. */ token->value = ridpointers[token->keyword]; } + /* 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); + } + } else token->keyword = RID_MAX; } @@ -621,7 +642,8 @@ cp_lexer_save_tokens (cp_lexer* lexer) if (cp_lexer_debugging_p (lexer)) fprintf (cp_lexer_debug_stream, "cp_lexer: saving tokens\n"); - VEC_safe_push (cp_token_position, lexer->saved_tokens, lexer->next_token); + VEC_safe_push (cp_token_position, heap, + lexer->saved_tokens, lexer->next_token); } /* Commit to the portion of the token stream most recently saved. */ @@ -1510,7 +1532,7 @@ static tree cp_parser_declarator_id static tree cp_parser_type_id (cp_parser *); static void cp_parser_type_specifier_seq - (cp_parser *, cp_decl_specifier_seq *); + (cp_parser *, bool, cp_decl_specifier_seq *); static cp_parameter_declarator *cp_parser_parameter_declaration_clause (cp_parser *); static cp_parameter_declarator *cp_parser_parameter_declaration_list @@ -1638,6 +1660,35 @@ static bool cp_parser_extension_opt static void cp_parser_label_declaration (cp_parser *); +/* 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 bool cp_parser_objc_selector_p + (enum cpp_ttype); +static tree cp_parser_objc_selector + (cp_parser *); +static tree cp_parser_objc_protocol_refs_opt + (cp_parser *); +static void cp_parser_objc_declaration + (cp_parser *); +static tree cp_parser_objc_statement + (cp_parser *); + /* Utility Routines */ static tree cp_parser_lookup_name @@ -1787,6 +1838,16 @@ cp_parser_is_keyword (cp_token* token, enum rid keyword) return token->keyword == keyword; } +/* A minimum or maximum operator has been seen. As these are + deprecated, issue a warning. */ + +static inline void +cp_parser_warn_min_max (void) +{ + if (warn_deprecated && !in_system_header) + warning (0, "minimum/maximum operators are deprecated"); +} + /* If not parsing tentatively, issue a diagnostic of the form FILE:LINE: MESSAGE before TOKEN where TOKEN is the next token in the input stream. MESSAGE @@ -1995,7 +2056,8 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, tree scope, tree id) template struct B : public A { X x; }; The user should have said "typename A::X". */ - if (processing_template_decl && current_class_type) + if (processing_template_decl && current_class_type + && TYPE_BINFO (current_class_type)) { tree b; @@ -2637,6 +2699,11 @@ cp_parser_translation_unit (cp_parser* parser) ( compound-statement ) __builtin_va_arg ( assignment-expression , type-id ) + Objective-C++ Extension: + + primary-expression: + objc-expression + literal: __null @@ -2863,6 +2930,12 @@ cp_parser_primary_expression (cp_parser *parser, case RID_OFFSETOF: return cp_parser_builtin_offsetof (parser); + /* Objective-C++ expressions. */ + case RID_AT_ENCODE: + case RID_AT_PROTOCOL: + case RID_AT_SELECTOR: + return cp_parser_objc_expression (parser); + default: cp_parser_error (parser, "expected primary-expression"); return error_mark_node; @@ -2911,6 +2984,11 @@ cp_parser_primary_expression (cp_parser *parser, been issued. */ if (ambiguous_p) return error_mark_node; + + /* In Objective-C++, an instance variable (ivar) may be preferred + to whatever cp_parser_lookup_name() found. */ + decl = objc_lookup_ivar (decl, id_expression); + /* If name lookup gives us a SCOPE_REF, then the qualifying scope was dependent. Just propagate the name. */ @@ -2961,6 +3039,11 @@ cp_parser_primary_expression (cp_parser *parser, /* Anything else is an error. */ default: + /* ...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); + cp_parser_error (parser, "expected primary-expression"); return error_mark_node; } @@ -3860,18 +3943,22 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p) bool template_p = false; tree id; tree type; + tree scope; /* Consume the `typename' token. */ cp_lexer_consume_token (parser->lexer); /* Look for the optional `::' operator. */ cp_parser_global_scope_opt (parser, /*current_scope_valid_p=*/false); - /* Look for the nested-name-specifier. */ - cp_parser_nested_name_specifier (parser, - /*typename_keyword_p=*/true, - /*check_dependency_p=*/true, - /*type_p=*/true, - /*is_declaration=*/true); + /* Look for the nested-name-specifier. In case of error here, + consume the trailing id to avoid subsequent error messages + for usual cases. */ + scope = cp_parser_nested_name_specifier (parser, + /*typename_keyword_p=*/true, + /*check_dependency_p=*/true, + /*type_p=*/true, + /*is_declaration=*/true); + /* Look for the optional `template' keyword. */ template_p = cp_parser_optional_template_keyword (parser); /* We don't know whether we're looking at a template-id or an @@ -3884,9 +3971,13 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p) /* If that didn't work, try an identifier. */ if (!cp_parser_parse_definitely (parser)) id = cp_parser_identifier (parser); + + /* Don't process id if nested name specifier is invalid. */ + if (scope == error_mark_node) + return error_mark_node; /* If we look up a template-id in a non-dependent qualifying scope, there's no need to create a dependent type. */ - if (TREE_CODE (id) == TYPE_DECL + else if (TREE_CODE (id) == TYPE_DECL && !dependent_type_p (parser->scope)) type = TREE_TYPE (id); /* Create a TYPENAME_TYPE to represent the type to which the @@ -4954,7 +5045,8 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) parser->type_definition_forbidden_message = "types may not be defined in a new-type-id"; /* Parse the type-specifier-seq. */ - cp_parser_type_specifier_seq (parser, &type_specifier_seq); + cp_parser_type_specifier_seq (parser, /*is_condition=*/false, + &type_specifier_seq); /* Restore the old message. */ parser->type_definition_forbidden_message = saved_message; /* Parse the new-declarator. */ @@ -5273,7 +5365,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p) && !in_system_header && !VOID_TYPE_P (type) && current_lang_name != lang_name_c) - warning ("use of old-style cast"); + warning (0, "use of old-style cast"); /* Only type conversions to integral or enumeration types can be used in constant-expressions. */ @@ -5392,6 +5484,9 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p) { /* Get an operator token. */ token = cp_lexer_peek_token (parser->lexer); + if (token->type == CPP_MIN || token->type == CPP_MAX) + cp_parser_warn_min_max (); + new_prec = TOKEN_PRECEDENCE (token); /* Popping an entry off the stack means we completed a subexpression: @@ -5647,10 +5742,12 @@ cp_parser_assignment_operator_opt (cp_parser* parser) case CPP_MIN_EQ: op = MIN_EXPR; + cp_parser_warn_min_max (); break; case CPP_MAX_EQ: op = MAX_EXPR; + cp_parser_warn_min_max (); break; default: @@ -5925,6 +6022,15 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr) statement = cp_parser_jump_statement (parser); break; + /* 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; + case RID_TRY: statement = cp_parser_try_block (parser); break; @@ -6281,7 +6387,8 @@ cp_parser_condition (cp_parser* parser) parser->type_definition_forbidden_message = "types may not be defined in conditions"; /* Parse the type-specifier-seq. */ - cp_parser_type_specifier_seq (parser, &type_specifiers); + cp_parser_type_specifier_seq (parser, /*is_condition==*/true, + &type_specifiers); /* Restore the saved message. */ parser->type_definition_forbidden_message = saved_message; /* If all is well, we might be looking at a declaration. */ @@ -6826,6 +6933,9 @@ cp_parser_declaration (cp_parser* parser) /* An unnamed namespace definition. */ || token2.type == CPP_OPEN_BRACE)) cp_parser_namespace_definition (parser); + /* Objective-C++ declaration/definition. */ + else if (c_dialect_objc () && OBJC_IS_AT_KEYWORD (token1.keyword)) + cp_parser_objc_declaration (parser); /* We must have either a block declaration or a function definition. */ else @@ -7540,7 +7650,8 @@ cp_parser_conversion_type_id (cp_parser* parser) /* Parse the attributes. */ attributes = cp_parser_attributes_opt (parser); /* Parse the type-specifiers. */ - cp_parser_type_specifier_seq (parser, &type_specifiers); + cp_parser_type_specifier_seq (parser, /*is_condition=*/false, + &type_specifiers); /* If that didn't work, stop. */ if (type_specifiers.type == error_mark_node) return error_mark_node; @@ -8030,18 +8141,22 @@ cp_parser_operator (cp_parser* parser) /* Extensions. */ case CPP_MIN: id = ansi_opname (MIN_EXPR); + cp_parser_warn_min_max (); break; case CPP_MAX: id = ansi_opname (MAX_EXPR); + cp_parser_warn_min_max (); break; case CPP_MIN_EQ: id = ansi_assopname (MIN_EXPR); + cp_parser_warn_min_max (); break; case CPP_MAX_EQ: id = ansi_assopname (MAX_EXPR); + cp_parser_warn_min_max (); break; default: @@ -8093,7 +8208,7 @@ cp_parser_template_declaration (cp_parser* parser, bool member_p) /* Consume the `export' token. */ cp_lexer_consume_token (parser->lexer); /* Warn that we do not support `export'. */ - warning ("keyword % not implemented, and will be ignored"); + warning (0, "keyword % not implemented, and will be ignored"); } cp_parser_template_declaration_after_export (parser, member_p); @@ -8703,6 +8818,8 @@ cp_parser_template_name (cp_parser* parser, ; else { + tree fn = NULL_TREE; + /* The standard does not explicitly indicate whether a name that names a set of overloaded declarations, some of which are templates, is a template-name. However, such a name should @@ -8710,16 +8827,13 @@ cp_parser_template_name (cp_parser* parser, template-id for the overloaded templates. */ fns = BASELINK_P (decl) ? BASELINK_FUNCTIONS (decl) : decl; if (TREE_CODE (fns) == OVERLOAD) - { - tree fn; + for (fn = fns; fn; fn = OVL_NEXT (fn)) + if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL) + break; - for (fn = fns; fn; fn = OVL_NEXT (fn)) - if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL) - break; - } - else + if (!fn) { - /* Otherwise, the name does not name a template. */ + /* The name does not name a template. */ cp_parser_error (parser, "expected template-name"); return error_mark_node; } @@ -9562,7 +9676,26 @@ 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)); + { + /* 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-qualified version. */ + if (decl_specs) + decl_specs->type = qual_type; + + return qual_type; + } + + cp_parser_check_for_invalid_template_id (parser, TREE_TYPE (type)); + } return type; } @@ -9608,6 +9741,17 @@ cp_parser_type_name (cp_parser* parser) /* Look up the type-name. */ type_decl = cp_parser_lookup_name_simple (parser, identifier); + + 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); + } + /* Issue an error if we did not find a type-name. */ if (TREE_CODE (type_decl) != TYPE_DECL) { @@ -9880,7 +10024,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, /* Warn about attributes. They are ignored. */ if (attributes) - warning ("type attributes are honored only at type definition"); + warning (0, "type attributes are honored only at type definition"); type = xref_tag (tag_type, identifier, ts, parser->num_template_parameter_lists); @@ -10725,7 +10869,7 @@ cp_parser_init_declarator (cp_parser* parser, attributes -- but ignores them. */ if (cp_parser_allow_gnu_extensions_p (parser) && is_parenthesized_init) if (cp_parser_attributes_opt (parser)) - warning ("attributes after parenthesized initializer ignored"); + warning (0, "attributes after parenthesized initializer ignored"); /* For an in-class declaration, use `grokfield' to create the declaration. */ @@ -11476,7 +11620,8 @@ cp_parser_type_id (cp_parser* parser) cp_declarator *abstract_declarator; /* Parse the type-specifier-seq. */ - cp_parser_type_specifier_seq (parser, &type_specifier_seq); + cp_parser_type_specifier_seq (parser, /*is_condition=*/false, + &type_specifier_seq); if (type_specifier_seq.type == error_mark_node) return error_mark_node; @@ -11504,13 +11649,18 @@ cp_parser_type_id (cp_parser* parser) type-specifier-seq: attributes type-specifier-seq [opt] + If IS_CONDITION is true, we are at the start of a "condition", + e.g., we've just seen "if (". + Sets *TYPE_SPECIFIER_SEQ to represent the sequence. */ static void cp_parser_type_specifier_seq (cp_parser* parser, + bool is_condition, cp_decl_specifier_seq *type_specifier_seq) { bool seen_type_specifier = false; + cp_parser_flags flags = CP_PARSER_FLAGS_OPTIONAL; /* Clear the TYPE_SPECIFIER_SEQ. */ clear_decl_specs (type_specifier_seq); @@ -11519,6 +11669,7 @@ cp_parser_type_specifier_seq (cp_parser* parser, while (true) { tree type_specifier; + bool is_cv_qualifier; /* Check for attributes first. */ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ATTRIBUTE)) @@ -11531,25 +11682,45 @@ cp_parser_type_specifier_seq (cp_parser* parser, /* Look for the type-specifier. */ type_specifier = cp_parser_type_specifier (parser, - CP_PARSER_FLAGS_OPTIONAL, + flags, type_specifier_seq, /*is_declaration=*/false, NULL, - NULL); - /* If the first type-specifier could not be found, this is not a - type-specifier-seq at all. */ - if (!seen_type_specifier && !type_specifier) + &is_cv_qualifier); + if (!type_specifier) { - cp_parser_error (parser, "expected type-specifier"); - type_specifier_seq->type = error_mark_node; - return; + /* If the first type-specifier could not be found, this is not a + type-specifier-seq at all. */ + if (!seen_type_specifier) + { + cp_parser_error (parser, "expected type-specifier"); + type_specifier_seq->type = error_mark_node; + return; + } + /* If subsequent type-specifiers could not be found, the + type-specifier-seq is complete. */ + break; } - /* If subsequent type-specifiers could not be found, the - type-specifier-seq is complete. */ - else if (seen_type_specifier && !type_specifier) - break; seen_type_specifier = true; + /* The standard says that a condition can be: + + type-specifier-seq declarator = assignment-expression + + However, given: + + struct S {}; + if (int S = ...) + + we should treat the "S" as a declarator, not as a + type-specifier. The standard doesn't say that explicitly for + type-specifier-seq, but it does say that for + decl-specifier-seq in an ordinary declaration. Perhaps it + would be clearer just to allow a decl-specifier-seq here, and + then add a semantic restriction that if any decl-specifiers + that are not type-specifiers appear, the program is invalid. */ + if (is_condition && !is_cv_qualifier) + flags |= CP_PARSER_FLAGS_NO_USER_DEFINED_TYPES; } return; @@ -11687,7 +11858,10 @@ 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)) + || cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS) + /* These are for Objective-C++ */ + || cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON) + || cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)) /* The parameter-declaration-list is complete. */ break; else if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) @@ -11975,7 +12149,7 @@ cp_parser_parameter_declaration (cp_parser *parser, if (!parser->default_arg_ok_p) { if (!flag_pedantic_errors) - warning ("deprecated use of default argument for parameter of non-function"); + warning (0, "deprecated use of default argument for parameter of non-function"); else { error ("default arguments are only permitted for function parameters"); @@ -12849,7 +13023,8 @@ cp_parser_class_head (cp_parser* parser, { error ("redefinition of %q#T", type); cp_error_at ("previous definition of %q#T", type); - type = error_mark_node; + type = NULL_TREE; + goto done; } /* We will have entered the scope containing the class; the names of @@ -13029,6 +13204,22 @@ cp_parser_member_declaration (cp_parser* parser) return; } + /* 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; + } + /* Parse the decl-specifier-seq. */ cp_parser_decl_specifier_seq (parser, CP_PARSER_FLAGS_OPTIONAL, @@ -13802,7 +13993,8 @@ cp_parser_exception_declaration (cp_parser* parser) = "types may not be defined in exception-declarations"; /* Parse the type-specifier-seq. */ - cp_parser_type_specifier_seq (parser, &type_specifiers); + cp_parser_type_specifier_seq (parser, /*is_condition=*/false, + &type_specifiers); /* If it's a `)', then there is no declarator. */ if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN)) declarator = NULL; @@ -15989,7 +16181,1109 @@ cp_parser_allow_gnu_extensions_p (cp_parser* parser) { return parser->allow_gnu_extensions_p; } + +/* 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; +} + +/* Parse a Objective-C visibility specification. */ + +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); +} + +/* Parse an Objective-C method type. */ + +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); +} + +/* Parse an Objective-C protocol qualifier. */ + +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; +} + +/* Parse an Objective-C typename. */ + +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; +} + +/* Check to see if TYPE refers to an Objective-C selector name. */ + +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); +} + +/* Parse an Objective-C selector. */ + +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; + } +} + +/* Parse an Objective-C params list. */ + +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; +} + +/* Parse the non-keyword Objective-C params. */ + +static tree +cp_parser_objc_method_tail_params_opt (cp_parser* parser, bool *ellipsisp) +{ + tree params = make_node (TREE_LIST); + cp_token *token = cp_lexer_peek_token (parser->lexer); + *ellipsisp = false; /* 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 '...'. */ + *ellipsisp = true; + 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; +} + +/* Parse a linkage specification, a pragma, an extra semicolon or a block. */ + +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); +} + +/* Parse a method signature. */ + +static tree +cp_parser_objc_method_signature (cp_parser* parser) +{ + tree rettype, kwdparms, optparms; + bool ellipsis = false; + + 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, &ellipsis); + + return objc_build_method_signature (rettype, kwdparms, optparms, ellipsis); +} + +/* Pars an Objective-C method prototype list. */ + +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 (); +} + +/* Parse an Objective-C method definition list. */ + +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 (); +} + +/* Parse Objective-C ivars. */ + +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); +} + +/* Parse an Objective-C protocol declaration. */ + +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 forward 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); + } +} + +/* Parse an Objective-C superclass or category. */ + +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, "`)'"); + } +} + +/* Parse an Objective-C class interface. */ + +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); +} + +/* Parse an Objective-C class implementation. */ + +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); +} + +/* Consume the @end token and finish off the implementation. */ + +static void +cp_parser_objc_end_implementation (cp_parser* parser) +{ + cp_lexer_consume_token (parser->lexer); /* Eat '@end'. */ + objc_finish_implementation (); +} + +/* Parse an Objective-C declaration. */ + +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); +} + +/* Parse an Objective-C statement. */ + +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; +} /* The parser. */ diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 77ca2b9fc04..f5e3f8a7a32 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -34,7 +34,9 @@ Boston, MA 02111-1307, USA. */ #include "tree.h" #include "pointer-set.h" #include "flags.h" +#include "c-common.h" #include "cp-tree.h" +#include "cp-objcp-common.h" #include "tree-inline.h" #include "decl.h" #include "output.h" @@ -86,7 +88,6 @@ static htab_t local_specializations; #define UNIFY_ALLOW_OUTER_LEVEL 16 #define UNIFY_ALLOW_OUTER_MORE_CV_QUAL 32 #define UNIFY_ALLOW_OUTER_LESS_CV_QUAL 64 -#define UNIFY_ALLOW_MAX_CORRECTION 128 static void push_access_scope (tree); static void pop_access_scope (tree); @@ -108,13 +109,12 @@ static tree add_outermost_template_args (tree, tree); static bool check_instantiated_args (tree, tree, tsubst_flags_t); static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*); static int type_unification_real (tree, tree, tree, tree, - int, unification_kind_t, int, int); + int, unification_kind_t, int); static void note_template_header (int); static tree convert_nontype_argument_function (tree, tree); static tree convert_nontype_argument (tree, tree); static tree convert_template_argument (tree, tree, tree, tsubst_flags_t, int, tree); -static tree get_bindings_overload (tree, tree, tree); static int for_each_template_parm (tree, tree_fn_t, void*, struct pointer_set_t*); static tree build_template_parm_index (int, int, int, tree, tree); @@ -128,8 +128,7 @@ static int template_parm_this_level_p (tree, void *); static tree tsubst_friend_function (tree, tree); static tree tsubst_friend_class (tree, tree); static int can_complete_type_without_circularity (tree); -static tree get_bindings (tree, tree, tree); -static tree get_bindings_real (tree, tree, tree, int, int, int); +static tree get_bindings (tree, tree, tree, bool); static int template_decl_level (tree); static int check_cv_quals_for_unify (int, tree, tree); static tree tsubst_template_arg (tree, tree, tsubst_flags_t, tree); @@ -421,7 +420,7 @@ maybe_begin_member_template_processing (tree decl) ++inline_parm_levels_used; } -/* Undo the effects of begin_member_template_processing. */ +/* Undo the effects of maybe_begin_member_template_processing. */ void maybe_end_member_template_processing (void) @@ -825,7 +824,7 @@ retrieve_specialization (tree tmpl, tree args, { tree class_template; tree class_specialization; - VEC(tree) *methods; + VEC(tree,gc) *methods; tree fns; int idx; @@ -1433,7 +1432,7 @@ determine_specialization (tree template_id, /* See whether this function might be a specialization of this template. */ - targs = get_bindings (fn, decl, explicit_targs); + targs = get_bindings (fn, decl, explicit_targs, /*check_ret=*/true); if (!targs) /* We cannot deduce template arguments that when used to @@ -1532,7 +1531,7 @@ determine_specialization (tree template_id, tree tmpl = most_specialized (templates, decl, explicit_targs); if (tmpl && tmpl != error_mark_node) { - targs = get_bindings (tmpl, decl, explicit_targs); + targs = get_bindings (tmpl, decl, explicit_targs, /*check_ret=*/true); templates = tree_cons (targs, tmpl, NULL_TREE); } } @@ -1970,7 +1969,7 @@ check_explicit_specialization (tree declarator, } else { - VEC(tree) *methods; + VEC(tree,gc) *methods; tree ovl; /* For a type-conversion operator, we cannot do a @@ -3612,7 +3611,7 @@ convert_nontype_argument (tree type, tree expr) if (!expr || expr == error_mark_node) return expr; - expr = build_nop(type, build_address (expr)); + expr = build_nop (type, build_address (expr)); } /* [temp.arg.nontype]/5, bullet 6 @@ -4027,7 +4026,24 @@ 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); + { + 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 *') 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); + } else if (TREE_CODE (ot) == TREE_VEC || TYPE_P (ot)) return 0; else @@ -4611,6 +4627,8 @@ lookup_template_class (tree d1, = TREE_PRIVATE (TYPE_STUB_DECL (template_type)); TREE_PROTECTED (type_decl) = TREE_PROTECTED (TYPE_STUB_DECL (template_type)); + DECL_IN_SYSTEM_HEADER (type_decl) + = DECL_IN_SYSTEM_HEADER (template); /* Set up the template information. We have to figure out which template is the immediate parent if this is a full @@ -5003,7 +5021,10 @@ push_tinst_level (tree d) return 0; } - new = make_tinst_level (d, input_location); + new = make_node (TINST_LEVEL); + TINST_DECL (new) = d; + TINST_LOCATION (new) = input_location; + TINST_IN_SYSTEM_HEADER_P (new) = in_system_header; TREE_CHAIN (new) = current_tinst_level; current_tinst_level = new; @@ -5028,6 +5049,7 @@ pop_tinst_level (void) /* Restore the filename and line number stashed away when we started this instantiation. */ input_location = TINST_LOCATION (old); + in_system_header = TINST_IN_SYSTEM_HEADER_P (old); current_tinst_level = TREE_CHAIN (old); --tinst_depth; ++tinst_level_tick; @@ -5506,7 +5528,9 @@ instantiate_class_template (tree type) /* Set the input location to the template definition. This is needed if tsubsting causes an error. */ - input_location = DECL_SOURCE_LOCATION (TYPE_NAME (pattern)); + typedecl = TYPE_MAIN_DECL (type); + input_location = DECL_SOURCE_LOCATION (typedecl); + in_system_header = DECL_IN_SYSTEM_HEADER (typedecl); TYPE_HAS_CONSTRUCTOR (type) = TYPE_HAS_CONSTRUCTOR (pattern); TYPE_HAS_NEW_OPERATOR (type) = TYPE_HAS_NEW_OPERATOR (pattern); @@ -5845,7 +5869,6 @@ instantiate_class_template (tree type) the class itself. This puts error messages involving generated implicit functions at a predictable point, and the same point that would be used for non-template classes. */ - typedecl = TYPE_MAIN_DECL (type); input_location = DECL_SOURCE_LOCATION (typedecl); unreverse_member_declarations (type); @@ -7342,7 +7365,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) if (e1 == error_mark_node || e2 == error_mark_node) return error_mark_node; - return fold (build2 (TREE_CODE (t), TREE_TYPE (t), e1, e2)); + return fold_build2 (TREE_CODE (t), TREE_TYPE (t), e1, e2); } case NEGATE_EXPR: @@ -7352,7 +7375,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) if (e == error_mark_node) return error_mark_node; - return fold (build1 (TREE_CODE (t), TREE_TYPE (t), e)); + return fold_build1 (TREE_CODE (t), TREE_TYPE (t), e); } case TYPENAME_TYPE: @@ -8876,6 +8899,14 @@ tsubst_copy_and_build (tree t, return t; default: + /* 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; + } return tsubst_copy (t, args, complain, in_decl); } @@ -9062,18 +9093,7 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain) We are deducing arguments when doing an explicit instantiation as in [temp.explicit], when determining an explicit specialization as in [temp.expl.spec], or when taking the address of a function - template, as in [temp.deduct.funcaddr]. - - DEDUCE_ORDER: - We are deducing arguments when calculating the partial - ordering between specializations of function or class - templates, as in [temp.func.order] and [temp.class.order]. - - LEN is the number of parms to consider before returning success, or -1 - for all. This is used in partial ordering to avoid comparing parms for - which no actual argument was passed, since they are not considered in - overload resolution (and are explicitly excluded from consideration in - partial ordering in [temp.func.order]/6). */ + template, as in [temp.deduct.funcaddr]. */ int fn_type_unification (tree fn, @@ -9081,8 +9101,7 @@ fn_type_unification (tree fn, tree targs, tree args, tree return_type, - unification_kind_t strict, - int len) + unification_kind_t strict) { tree parms; tree fntype; @@ -9153,8 +9172,6 @@ fn_type_unification (tree fn, /* We've been given a return type to match, prepend it. */ parms = tree_cons (NULL_TREE, TREE_TYPE (fntype), parms); args = tree_cons (NULL_TREE, return_type, args); - if (len >= 0) - ++len; } /* We allow incomplete unification without an error message here @@ -9163,7 +9180,7 @@ fn_type_unification (tree fn, event. */ result = type_unification_real (DECL_INNERMOST_TEMPLATE_PARMS (fn), targs, parms, args, /*subr=*/0, - strict, /*allow_incomplete*/1, len); + strict, /*allow_incomplete*/1); if (result == 0) /* All is well so far. Now, check: @@ -9216,28 +9233,6 @@ maybe_adjust_types_for_deduction (unification_kind_t strict, /* There is nothing to do in this case. */ return 0; - case DEDUCE_ORDER: - /* DR 214. [temp.func.order] is underspecified, and leads to no - ordering between things like `T *' and `T const &' for `U *'. - The former has T=U and the latter T=U*. The former looks more - specialized and John Spicer considers it well-formed (the EDG - compiler accepts it). - - John also confirms that deduction should proceed as in a function - call. Which implies the usual ARG and PARM conversions as DEDUCE_CALL. - However, in ordering, ARG can have REFERENCE_TYPE, but no argument - to an actual call can have such a type. - - If both ARG and PARM are REFERENCE_TYPE, we change neither. - If only ARG is a REFERENCE_TYPE, we look through that and then - proceed as with DEDUCE_CALL (which could further convert it). */ - if (TREE_CODE (*arg) == REFERENCE_TYPE) - { - if (TREE_CODE (*parm) == REFERENCE_TYPE) - return 0; - *arg = TREE_TYPE (*arg); - } - break; default: gcc_unreachable (); } @@ -9302,8 +9297,7 @@ type_unification_real (tree tparms, tree xargs, int subr, unification_kind_t strict, - int allow_incomplete, - int xlen) + int allow_incomplete) { tree parm, arg; int i; @@ -9311,7 +9305,6 @@ type_unification_real (tree tparms, int sub_strict; int saw_undeduced = 0; tree parms, args; - int len; gcc_assert (TREE_CODE (tparms) == TREE_VEC); gcc_assert (xparms == NULL_TREE || TREE_CODE (xparms) == TREE_LIST); @@ -9333,26 +9326,16 @@ type_unification_real (tree tparms, sub_strict = UNIFY_ALLOW_NONE; break; - case DEDUCE_ORDER: - sub_strict = UNIFY_ALLOW_NONE; - break; - default: gcc_unreachable (); } - if (xlen == 0) - return 0; - again: parms = xparms; args = xargs; - len = xlen; - while (parms - && parms != void_list_node - && args - && args != void_list_node) + while (parms && parms != void_list_node + && args && args != void_list_node) { parm = TREE_VALUE (parms); parms = TREE_CHAIN (parms); @@ -9379,7 +9362,7 @@ type_unification_real (tree tparms, else type = arg; - if (strict == DEDUCE_EXACT || strict == DEDUCE_ORDER) + if (strict == DEDUCE_EXACT) { if (same_type_p (parm, type)) continue; @@ -9424,25 +9407,20 @@ type_unification_real (tree tparms, if (unify (tparms, targs, parm, arg, arg_strict)) return 1; } - - /* Are we done with the interesting parms? */ - if (--len == 0) - goto done; } + /* Fail if we've reached the end of the parm list, and more args are present, and the parm list isn't variadic. */ if (args && args != void_list_node && parms == void_list_node) return 1; /* Fail if parms are left and they don't have default values. */ - if (parms - && parms != void_list_node + if (parms && parms != void_list_node && TREE_PURPOSE (parms) == NULL_TREE) return 1; - done: if (!subr) for (i = 0; i < ntparms; i++) - if (TREE_VEC_ELT (targs, i) == NULL_TREE) + if (!TREE_VEC_ELT (targs, i)) { tree tparm = TREE_VALUE (TREE_VEC_ELT (tparms, i)); @@ -9459,6 +9437,7 @@ type_unification_real (tree tparms, error ("incomplete type unification"); return 2; } + return 0; } @@ -9516,8 +9495,8 @@ resolve_overloaded_unification (tree tparms, if (TREE_CODE (fn) != TEMPLATE_DECL) continue; - subargs = get_bindings_overload (fn, DECL_TEMPLATE_RESULT (fn), - expl_subargs); + subargs = get_bindings (fn, DECL_TEMPLATE_RESULT (fn), + expl_subargs, /*check_ret=*/false); if (subargs) { elem = tsubst (TREE_TYPE (fn), subargs, tf_none, NULL_TREE); @@ -9614,17 +9593,14 @@ try_one_overload (tree tparms, tree elt = TREE_VEC_ELT (tempargs, i); tree oldelt = TREE_VEC_ELT (orig_targs, i); - if (elt == NULL_TREE) - continue; + if (!elt) + /*NOP*/; else if (uses_template_parms (elt)) - { - /* Since we're unifying against ourselves, we will fill in template - args used in the function parm list with our own template parms. - Discard them. */ - TREE_VEC_ELT (tempargs, i) = NULL_TREE; - continue; - } - else if (oldelt && ! template_args_equal (oldelt, elt)) + /* Since we're unifying against ourselves, we will fill in + template args used in the function parm list with our own + template parms. Discard them. */ + TREE_VEC_ELT (tempargs, i) = NULL_TREE; + else if (oldelt && !template_args_equal (oldelt, elt)) return 0; } @@ -10158,10 +10134,10 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) not an integer constant. */ if (TREE_CODE (parm_max) == MINUS_EXPR) { - arg_max = fold (build2 (PLUS_EXPR, - integer_type_node, - arg_max, - TREE_OPERAND (parm_max, 1))); + arg_max = fold_build2 (PLUS_EXPR, + integer_type_node, + arg_max, + TREE_OPERAND (parm_max, 1)); parm_max = TREE_OPERAND (parm_max, 0); } @@ -10285,7 +10261,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict) return 1; return type_unification_real (tparms, targs, TYPE_ARG_TYPES (parm), TYPE_ARG_TYPES (arg), 1, - DEDUCE_EXACT, 0, -1); + DEDUCE_EXACT, 0); case OFFSET_TYPE: /* Unify a pointer to member with a pointer to member function, which @@ -10426,36 +10402,164 @@ mark_decl_instantiated (tree result, int extern_p) /* Given two function templates PAT1 and PAT2, return: - DEDUCE should be DEDUCE_EXACT or DEDUCE_ORDER. - 1 if PAT1 is more specialized than PAT2 as described in [temp.func.order]. -1 if PAT2 is more specialized than PAT1. 0 if neither is more specialized. - LEN is passed through to fn_type_unification. */ + LEN indicates the number of parameters we should consider + (defaulted parameters should not be considered). + + The 1998 std underspecified function template partial ordering, and + DR214 addresses the issue. We take pairs of arguments, one from + each of the templates, and deduce them against each other. One of + the templates will be more specialized if all the *other* + template's arguments deduce against its arguments and at least one + of its arguments *does* *not* deduce against the other template's + corresponding argument. Deduction is done as for class templates. + The arguments used in deduction have reference and top level cv + qualifiers removed. Iff both arguments were originally reference + types *and* deduction succeeds in both directions, the template + with the more cv-qualified argument wins for that pairing (if + neither is more cv-qualified, they both are equal). Unlike regular + deduction, after all the arguments have been deduced in this way, + we do *not* verify the deduced template argument values can be + substituted into non-deduced contexts, nor do we have to verify + that all template arguments have been deduced. */ int -more_specialized (tree pat1, tree pat2, int deduce, int len) -{ - tree targs; - int winner = 0; +more_specialized_fn (tree pat1, tree pat2, int len) +{ + tree decl1 = DECL_TEMPLATE_RESULT (pat1); + tree decl2 = DECL_TEMPLATE_RESULT (pat2); + tree targs1 = make_tree_vec (DECL_NTPARMS (pat1)); + tree targs2 = make_tree_vec (DECL_NTPARMS (pat2)); + tree tparms1 = DECL_INNERMOST_TEMPLATE_PARMS (pat1); + tree tparms2 = DECL_INNERMOST_TEMPLATE_PARMS (pat2); + tree args1 = TYPE_ARG_TYPES (TREE_TYPE (decl1)); + tree args2 = TYPE_ARG_TYPES (TREE_TYPE (decl2)); + int better1 = 0; + int better2 = 0; + + /* If only one is a member function, they are unordered. */ + if (DECL_FUNCTION_MEMBER_P (decl1) != DECL_FUNCTION_MEMBER_P (decl2)) + return 0; + + /* Don't consider 'this' parameter. */ + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl1)) + args1 = TREE_CHAIN (args1); + if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl2)) + args2 = TREE_CHAIN (args2); + + /* If only one is a conversion operator, they are unordered. */ + if (DECL_CONV_FN_P (decl1) != DECL_CONV_FN_P (decl2)) + return 0; + + /* Consider the return type for a conversion function */ + if (DECL_CONV_FN_P (decl1)) + { + args1 = tree_cons (NULL_TREE, TREE_TYPE (TREE_TYPE (decl1)), args1); + args2 = tree_cons (NULL_TREE, TREE_TYPE (TREE_TYPE (decl2)), args2); + len++; + } + + processing_template_decl++; + + while (len--) + { + tree arg1 = TREE_VALUE (args1); + tree arg2 = TREE_VALUE (args2); + int deduce1, deduce2; + int quals1 = -1; + int quals2 = -1; - /* If template argument deduction succeeds, we substitute the - resulting arguments into non-deduced contexts. While doing that, - we must be aware that we may encounter dependent types. */ - ++processing_template_decl; - targs = get_bindings_real (pat1, DECL_TEMPLATE_RESULT (pat2), - NULL_TREE, 0, deduce, len); - if (targs) - --winner; + if (TREE_CODE (arg1) == REFERENCE_TYPE) + { + arg1 = TREE_TYPE (arg1); + quals1 = cp_type_quals (arg1); + } + + if (TREE_CODE (arg2) == REFERENCE_TYPE) + { + arg2 = TREE_TYPE (arg2); + quals2 = cp_type_quals (arg2); + } - targs = get_bindings_real (pat2, DECL_TEMPLATE_RESULT (pat1), - NULL_TREE, 0, deduce, len); - if (targs) - ++winner; - --processing_template_decl; + if ((quals1 < 0) != (quals2 < 0)) + { + /* Only of the args is a reference, see if we should apply + array/function pointer decay to it. This is not part of + DR214, but is, IMHO, consistent with the deduction rules + for the function call itself, and with our earlier + implementation of the underspecified partial ordering + rules. (nathan). */ + if (quals1 >= 0) + { + switch (TREE_CODE (arg1)) + { + case ARRAY_TYPE: + arg1 = TREE_TYPE (arg1); + /* FALLTHROUGH. */ + case FUNCTION_TYPE: + arg1 = build_pointer_type (arg1); + break; + + default: + break; + } + } + else + { + switch (TREE_CODE (arg2)) + { + case ARRAY_TYPE: + arg2 = TREE_TYPE (arg2); + /* FALLTHROUGH. */ + case FUNCTION_TYPE: + arg2 = build_pointer_type (arg2); + break; + + default: + break; + } + } + } + + arg1 = TYPE_MAIN_VARIANT (arg1); + arg2 = TYPE_MAIN_VARIANT (arg2); + + deduce1 = !unify (tparms1, targs1, arg1, arg2, UNIFY_ALLOW_NONE); + deduce2 = !unify (tparms2, targs2, arg2, arg1, UNIFY_ALLOW_NONE); + + if (!deduce1) + better2 = -1; + if (!deduce2) + better1 = -1; + if (better1 < 0 && better2 < 0) + /* We've failed to deduce something in either direction. + These must be unordered. */ + break; + + if (deduce1 && deduce2 && quals1 >= 0 && quals2 >= 0) + { + /* Deduces in both directions, see if quals can + disambiguate. Pretend the worse one failed to deduce. */ + if ((quals1 & quals2) == quals2) + deduce1 = 0; + if ((quals1 & quals2) == quals1) + deduce2 = 0; + } + if (deduce1 && !deduce2 && !better2) + better2 = 1; + if (deduce2 && !deduce1 && !better1) + better1 = 1; + + args1 = TREE_CHAIN (args1); + args2 = TREE_CHAIN (args2); + } - return winner; + processing_template_decl--; + + return (better1 > 0) - (better2 > 0); } /* Given two class template specialization list nodes PAT1 and PAT2, return: @@ -10494,23 +10598,17 @@ more_specialized_class (tree pat1, tree pat2, tree full_args) /* Return the template arguments that will produce the function signature DECL from the function template FN, with the explicit template - arguments EXPLICIT_ARGS. If CHECK_RETTYPE is 1, the return type must + arguments EXPLICIT_ARGS. If CHECK_RETTYPE is true, the return type must also match. Return NULL_TREE if no satisfactory arguments could be - found. DEDUCE and LEN are passed through to fn_type_unification. */ + found. */ static tree -get_bindings_real (tree fn, - tree decl, - tree explicit_args, - int check_rettype, - int deduce, - int len) +get_bindings (tree fn, tree decl, tree explicit_args, bool check_rettype) { int ntparms = DECL_NTPARMS (fn); tree targs = make_tree_vec (ntparms); tree decl_type; tree decl_arg_types; - int i; /* Substitute the explicit template arguments into the type of DECL. The call to fn_type_unification will handle substitution into the @@ -10544,35 +10642,16 @@ get_bindings_real (tree fn, if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)) decl_arg_types = TREE_CHAIN (decl_arg_types); - i = fn_type_unification (fn, explicit_args, targs, + if (fn_type_unification (fn, explicit_args, targs, decl_arg_types, (check_rettype || DECL_CONV_FN_P (fn) ? TREE_TYPE (decl_type) : NULL_TREE), - deduce, len); - - if (i != 0) + DEDUCE_EXACT)) return NULL_TREE; return targs; } -/* For most uses, we want to check the return type. */ - -static tree -get_bindings (tree fn, tree decl, tree explicit_args) -{ - return get_bindings_real (fn, decl, explicit_args, 1, DEDUCE_EXACT, -1); -} - -/* But for resolve_overloaded_unification, we only care about the parameter - types. */ - -static tree -get_bindings_overload (tree fn, tree decl, tree explicit_args) -{ - return get_bindings_real (fn, decl, explicit_args, 0, DEDUCE_EXACT, -1); -} - /* Return the innermost template arguments that, when applied to a template specialization whose innermost template parameters are TPARMS, and whose specialization arguments are PARMS, yield the @@ -10619,37 +10698,56 @@ tree most_specialized_instantiation (tree instantiations) { tree fn, champ; - int fate; if (!instantiations) return NULL_TREE; - + + ++processing_template_decl; + champ = instantiations; for (fn = TREE_CHAIN (instantiations); fn; fn = TREE_CHAIN (fn)) { - fate = more_specialized (TREE_VALUE (champ), TREE_VALUE (fn), - DEDUCE_EXACT, -1); - if (fate == 1) - ; - else + int fate = 0; + + if (get_bindings (TREE_VALUE (champ), + DECL_TEMPLATE_RESULT (TREE_VALUE (fn)), + NULL_TREE, /*check_ret=*/false)) + fate--; + + if (get_bindings (TREE_VALUE (fn), + DECL_TEMPLATE_RESULT (TREE_VALUE (champ)), + NULL_TREE, /*check_ret=*/false)) + fate++; + + if (fate != 1) { - if (fate == 0) - { - fn = TREE_CHAIN (fn); - if (! fn) - return error_mark_node; - } + if (!fate) + /* Equally specialized, move to next function. If there + is no next function, nothing's most specialized. */ + fn = TREE_CHAIN (fn); champ = fn; } } - - for (fn = instantiations; fn && fn != champ; fn = TREE_CHAIN (fn)) - { - fate = more_specialized (TREE_VALUE (champ), TREE_VALUE (fn), - DEDUCE_EXACT, -1); - if (fate != 1) - return error_mark_node; - } + + if (champ) + /* Now verify that champ is better than everything earlier in the + instantiation list. */ + for (fn = instantiations; fn != champ; fn = TREE_CHAIN (fn)) + if (get_bindings (TREE_VALUE (champ), + DECL_TEMPLATE_RESULT (TREE_VALUE (fn)), + NULL_TREE, /*check_ret=*/false) + || !get_bindings (TREE_VALUE (fn), + DECL_TEMPLATE_RESULT (TREE_VALUE (champ)), + NULL_TREE, /*check_ret=*/false)) + { + champ = NULL_TREE; + break; + } + + processing_template_decl--; + + if (!champ) + return error_mark_node; return TREE_PURPOSE (champ) ? TREE_PURPOSE (champ) : TREE_VALUE (champ); } @@ -10668,7 +10766,7 @@ most_specialized (tree fns, tree decl, tree explicit_args) { tree candidate = TREE_VALUE (fn); - args = get_bindings (candidate, decl, explicit_args); + args = get_bindings (candidate, decl, explicit_args, /*check_ret=*/true); if (args) candidates = tree_cons (NULL_TREE, candidate, candidates); } @@ -11125,6 +11223,7 @@ regenerate_decl_from_template (tree decl, tree tmpl) while (decl_parm) { tree parm_type; + tree attributes; if (DECL_NAME (decl_parm) != DECL_NAME (pattern_parm)) DECL_NAME (decl_parm) = DECL_NAME (pattern_parm); @@ -11133,6 +11232,12 @@ regenerate_decl_from_template (tree decl, tree tmpl) parm_type = type_decays_to (parm_type); if (!same_type_p (TREE_TYPE (decl_parm), parm_type)) TREE_TYPE (decl_parm) = parm_type; + attributes = DECL_ATTRIBUTES (pattern_parm); + if (DECL_ATTRIBUTES (decl_parm) != attributes) + { + DECL_ATTRIBUTES (decl_parm) = attributes; + cplus_decl_attributes (&decl_parm, attributes, /*flags=*/0); + } decl_parm = TREE_CHAIN (decl_parm); pattern_parm = TREE_CHAIN (pattern_parm); } @@ -11518,6 +11623,7 @@ instantiate_pending_templates (int retries) tree last = NULL_TREE; int reconsider; location_t saved_loc = input_location; + int saved_in_system_header = in_system_header; /* Instantiating templates may trigger vtable generation. This in turn may require further template instantiations. We place a limit here @@ -11602,6 +11708,7 @@ instantiate_pending_templates (int retries) while (reconsider); input_location = saved_loc; + in_system_header = saved_in_system_header; } /* Substitute ARGVEC into T, which is a list of initializers for @@ -12333,7 +12440,8 @@ dependent_template_id_p (tree tmpl, tree args) TYPENAME_TYPE corresponds. Returns ERROR_MARK_NODE if no such TYPE can be found. Note that this function peers inside uninstantiated templates and therefore should be used only in extremely limited - situations. */ + situations. ONLY_CURRENT_P restricts this peering to the currently + open classes hierarchy (which is required when comparing types). */ tree resolve_typename_type (tree type, bool only_current_p) @@ -12424,10 +12532,7 @@ build_non_dependent_expr (tree expr) types. */ inner_expr = (TREE_CODE (expr) == ADDR_EXPR ? TREE_OPERAND (expr, 0) : expr); - if (TREE_CODE (inner_expr) == OVERLOAD - || TREE_CODE (inner_expr) == FUNCTION_DECL - || TREE_CODE (inner_expr) == TEMPLATE_DECL - || TREE_CODE (inner_expr) == TEMPLATE_ID_EXPR + if (is_overloaded_fn (inner_expr) || TREE_CODE (inner_expr) == OFFSET_REF) return expr; /* There is no need to return a proxy for a variable. */ diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index 6675980bd56..370ecec2ea0 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -1,5 +1,5 @@ /* Code to maintain a C++ template repository. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com) @@ -109,7 +109,7 @@ get_base_filename (const char *filename) if (p && ! compiling) { - warning ("-frepo must be used with -c"); + warning (0, "-frepo must be used with -c"); flag_use_repository = 0; return NULL; } diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 45f0b087a87..bff6c952b9a 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -75,7 +75,7 @@ Boston, MA 02111-1307, USA. */ #define TINFO_REAL_NAME(NODE) TREE_PURPOSE (NODE) /* A vector of all tinfo decls that haven't yet been emitted. */ -VEC (tree) *unemitted_tinfo_decls; +VEC(tree,gc) *unemitted_tinfo_decls; static tree build_headof (tree); static tree ifnonnull (tree, tree); @@ -119,7 +119,7 @@ init_rtti_processing (void) = build_qualified_type (type_info_type, TYPE_QUAL_CONST); type_info_ptr_type = build_pointer_type (const_type_info_type_node); - unemitted_tinfo_decls = VEC_alloc (tree, 124); + unemitted_tinfo_decls = VEC_alloc (tree, gc, 124); create_tinfo_types (); } @@ -364,7 +364,7 @@ get_tinfo_decl (tree type) pushdecl_top_level_and_finish (d, NULL_TREE); /* Add decl to the global array of tinfo decls. */ - VEC_safe_push (tree, unemitted_tinfo_decls, d); + VEC_safe_push (tree, gc, unemitted_tinfo_decls, d); } return d; @@ -419,7 +419,8 @@ static tree ifnonnull (tree test, tree result) { return build3 (COND_EXPR, TREE_TYPE (result), - build2 (EQ_EXPR, boolean_type_node, test, integer_zero_node), + build2 (EQ_EXPR, boolean_type_node, test, + cp_convert (TREE_TYPE (test), integer_zero_node)), cp_convert (TREE_TYPE (result), integer_zero_node), result); } @@ -567,7 +568,7 @@ build_dynamic_cast_1 (tree type, tree expr) && TREE_CODE (TREE_TYPE (old_expr)) == RECORD_TYPE) { tree expr = throw_bad_cast (); - warning ("dynamic_cast of %q#D to %q#T can never succeed", + warning (0, "dynamic_cast of %q#D to %q#T can never succeed", old_expr, type); /* Bash it to the expected type. */ TREE_TYPE (expr) = type; @@ -581,7 +582,7 @@ build_dynamic_cast_1 (tree type, tree expr) if (TREE_CODE (op) == VAR_DECL && TREE_CODE (TREE_TYPE (op)) == RECORD_TYPE) { - warning ("dynamic_cast of %q#D to %q#T can never succeed", + warning (0, "dynamic_cast of %q#D to %q#T can never succeed", op, type); retval = build_int_cst (type, 0); return retval; @@ -1003,7 +1004,7 @@ get_pseudo_ti_init (tree type, tree var_desc) | (CLASSTYPE_DIAMOND_SHAPED_P (type) << 1)); tree binfo = TYPE_BINFO (type); int nbases = BINFO_N_BASE_BINFOS (binfo); - VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo); + VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo); tree base_inits = NULL_TREE; int ix; @@ -1152,7 +1153,7 @@ get_pseudo_ti_desc (tree type) else { tree binfo = TYPE_BINFO (type); - VEC (tree) *base_accesses = BINFO_BASE_ACCESSES (binfo); + VEC(tree,gc) *base_accesses = BINFO_BASE_ACCESSES (binfo); tree base_binfo = BINFO_BASE_BINFO (binfo, 0); int num_bases = BINFO_N_BASE_BINFOS (binfo); diff --git a/gcc/cp/search.c b/gcc/cp/search.c index f6a9b577dfc..45668a14a94 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -641,7 +641,7 @@ dfs_access_in_type (tree binfo, void *data) { int i; tree base_binfo; - VEC (tree) *accesses; + VEC(tree,gc) *accesses; /* Otherwise, scan our baseclasses, and pick the most favorable access. */ @@ -1314,7 +1314,7 @@ lookup_conversion_operator (tree class_type, tree type) { int i; tree fn; - VEC(tree) *methods = CLASSTYPE_METHOD_VEC (class_type); + VEC(tree,gc) *methods = CLASSTYPE_METHOD_VEC (class_type); for (i = CLASSTYPE_FIRST_CONVERSION_SLOT; VEC_iterate (tree, methods, i, fn); ++i) @@ -1345,7 +1345,7 @@ lookup_conversion_operator (tree class_type, tree type) int lookup_fnfields_1 (tree type, tree name) { - VEC(tree) *method_vec; + VEC(tree,gc) *method_vec; tree fn; tree tmp; size_t i; @@ -1658,7 +1658,7 @@ dfs_walk_once (tree binfo, tree (*pre_fn) (tree, void *), /* We are at the top of the hierarchy, and can use the CLASSTYPE_VBASECLASSES list for unmarking the virtual bases. */ - VEC (tree) *vbases; + VEC(tree,gc) *vbases; unsigned ix; tree base_binfo; @@ -1766,7 +1766,7 @@ dfs_walk_once_accessible (tree binfo, bool friends_p, /* We are at the top of the hierarchy, and can use the CLASSTYPE_VBASECLASSES list for unmarking the virtual bases. */ - VEC (tree) *vbases; + VEC(tree,gc) *vbases; unsigned ix; tree base_binfo; @@ -2000,7 +2000,7 @@ dfs_get_pure_virtuals (tree binfo, void *data) virtuals; virtuals = TREE_CHAIN (virtuals)) if (DECL_PURE_VIRTUAL_P (BV_FN (virtuals))) - VEC_safe_push (tree, CLASSTYPE_PURE_VIRTUALS (type), + VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (type), BV_FN (virtuals)); } @@ -2270,7 +2270,7 @@ lookup_conversions_r (tree binfo, tree child_tpl_convs = NULL_TREE; unsigned i; tree base_binfo; - VEC(tree) *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo)); + VEC(tree,gc) *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo)); tree conv; /* If we have no conversion operators, then don't look. */ @@ -2523,7 +2523,7 @@ binfo_for_vbase (tree base, tree t) { unsigned ix; tree binfo; - VEC (tree) *vbases; + VEC(tree,gc) *vbases; for (vbases = CLASSTYPE_VBASECLASSES (t), ix = 0; VEC_iterate (tree, vbases, ix, binfo); ix++) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 15762cb7883..6955291d536 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -139,10 +139,11 @@ typedef struct deferred_access GTY(()) enum deferring_kind deferring_access_checks_kind; } deferred_access; -DEF_VEC_GC_O (deferred_access); +DEF_VEC_O (deferred_access); +DEF_VEC_ALLOC_O (deferred_access,gc); /* Data for deferred access checking. */ -static GTY(()) VEC (deferred_access) *deferred_access_stack; +static GTY(()) VEC(deferred_access,gc) *deferred_access_stack; static GTY(()) unsigned deferred_access_no_check; /* Save the current deferred access states and start deferred @@ -159,7 +160,7 @@ push_deferring_access_checks (deferring_kind deferring) { deferred_access *ptr; - ptr = VEC_safe_push (deferred_access, deferred_access_stack, NULL); + ptr = VEC_safe_push (deferred_access, gc, deferred_access_stack, NULL); ptr->deferred_access_checks = NULL_TREE; ptr->deferring_access_checks_kind = deferring; } @@ -400,7 +401,7 @@ anon_aggr_type_p (tree node) /* Finish a scope. */ -static tree +tree do_poplevel (tree stmt_list) { tree block = NULL; @@ -834,7 +835,7 @@ finish_for_stmt (tree for_stmt) tree finish_break_stmt (void) { - return add_stmt (build_break_stmt ()); + return add_stmt (build_stmt (BREAK_STMT)); } /* Finish a continue-statement. */ @@ -842,7 +843,7 @@ finish_break_stmt (void) tree finish_continue_stmt (void) { - return add_stmt (build_continue_stmt ()); + return add_stmt (build_stmt (CONTINUE_STMT)); } /* Begin a switch-statement. Returns a new SWITCH_STMT if @@ -1523,6 +1524,9 @@ finish_stmt_expr_expr (tree expr, tree stmt_expr) { tree result = NULL_TREE; + if (error_operand_p (expr)) + return error_mark_node; + if (expr) { if (!processing_template_decl && !VOID_TYPE_P (TREE_TYPE (expr))) @@ -1830,8 +1834,17 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) ? LOOKUP_NONVIRTUAL : 0)); } else if (is_overloaded_fn (fn)) - /* A call to a namespace-scope function. */ - result = build_new_function_call (fn, args); + { + /* If the function is an overloaded builtin, resolve it. */ + if (TREE_CODE (fn) == FUNCTION_DECL + && (DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL + || DECL_BUILT_IN_CLASS (fn) == BUILT_IN_MD)) + result = resolve_overloaded_builtin (fn, args); + + if (!result) + /* A call to a namespace-scope function. */ + result = build_new_function_call (fn, args); + } else if (TREE_CODE (fn) == PSEUDO_DTOR_EXPR) { if (args) @@ -1848,6 +1861,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p) have an overloaded `operator ()'. */ result = build_new_op (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE, /*overloaded_p=*/NULL); + if (!result) /* A call where the function is unknown. */ result = build_function_call (fn, args); @@ -1993,7 +2007,8 @@ finish_compound_literal (tree type, tree initializer_list) implies that the array has two elements. */ if (TREE_CODE (type) == ARRAY_TYPE && !COMPLETE_TYPE_P (type)) - complete_array_type (type, compound_literal, 1); + cp_complete_array_type (&TREE_TYPE (compound_literal), + compound_literal, 1); } return compound_literal; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 321ba4bdbc7..114275cd419 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA. */ #include "insn-config.h" #include "integrate.h" #include "tree-inline.h" +#include "debug.h" #include "target.h" static tree bot_manip (tree *, int *, void *); @@ -111,6 +112,7 @@ lvalue_p_1 (tree ref, case STRING_CST: return clk_ordinary; + case CONST_DECL: case VAR_DECL: if (TREE_READONLY (ref) && ! TREE_STATIC (ref) && DECL_LANG_SPECIFIC (ref) @@ -1112,9 +1114,9 @@ cxx_print_statistics (void) tree array_type_nelts_top (tree type) { - return fold (build2 (PLUS_EXPR, sizetype, - array_type_nelts (type), - integer_one_node)); + return fold_build2 (PLUS_EXPR, sizetype, + array_type_nelts (type), + integer_one_node); } /* Return, as an INTEGER_CST node, the number of elements for TYPE @@ -1129,7 +1131,7 @@ array_type_nelts_total (tree type) while (TREE_CODE (type) == ARRAY_TYPE) { tree n = array_type_nelts_top (type); - sz = fold (build2 (MULT_EXPR, sizetype, sz, n)); + sz = fold_build2 (MULT_EXPR, sizetype, sz, n); type = TREE_TYPE (type); } return sz; @@ -1459,6 +1461,7 @@ cp_tree_equal (tree t1, tree t2) case FUNCTION_DECL: case TEMPLATE_DECL: case IDENTIFIER_NODE: + case SSA_NAME: return false; case BASELINK: @@ -1766,12 +1769,12 @@ handle_com_interface_attribute (tree* node, || !CLASS_TYPE_P (*node) || *node != TYPE_MAIN_VARIANT (*node)) { - warning ("%qE attribute can only be applied to class definitions", name); + warning (0, "%qE attribute can only be applied to class definitions", name); return NULL_TREE; } if (!warned++) - warning ("%qE is obsolete; g++ vtables are now COM-compatible by default", + warning (0, "%qE is obsolete; g++ vtables are now COM-compatible by default", name); return NULL_TREE; @@ -1834,7 +1837,7 @@ handle_init_priority_attribute (tree* node, if (pri <= MAX_RESERVED_INIT_PRIORITY) { warning - ("requested init_priority is reserved for internal use"); + (0, "requested init_priority is reserved for internal use"); } if (SUPPORTS_INIT_PRIORITY) @@ -1850,17 +1853,6 @@ handle_init_priority_attribute (tree* node, } } -/* Return a new TINST_LEVEL for DECL at location locus. */ -tree -make_tinst_level (tree decl, location_t locus) -{ - tree tinst_level = make_node (TINST_LEVEL); - TREE_CHAIN (tinst_level) = NULL_TREE; - TINST_DECL (tinst_level) = decl; - TINST_LOCATION (tinst_level) = locus; - return tinst_level; -} - /* Return a new PTRMEM_CST of the indicated TYPE. The MEMBER is the thing pointed to by the constant. */ @@ -2256,7 +2248,10 @@ stabilize_init (tree init, tree *initp) if (TREE_CODE (t) == COND_EXPR) return false; - stabilize_call (t, initp); + /* The TARGET_EXPR might be initializing via bitwise copy from + another variable; leave that alone. */ + if (TREE_SIDE_EFFECTS (t)) + stabilize_call (t, initp); } return true; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 1639b54532b..319e8ad6e35 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -514,10 +514,12 @@ 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)) + if (DERIVED_FROM_P (class1, class2) || + (c_dialect_objc () && objc_comptypes (class1, class2, 0) == 1)) t2 = (build_pointer_type (cp_build_qualified_type (class1, TYPE_QUALS (class2)))); - else if (DERIVED_FROM_P (class2, class1)) + else if (DERIVED_FROM_P (class2, class1) || + (c_dialect_objc () && objc_comptypes (class2, class1, 0) == 1)) t1 = (build_pointer_type (cp_build_qualified_type (class2, TYPE_QUALS (class1)))); else @@ -905,8 +907,6 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration) bool comptypes (tree t1, tree t2, int strict) { - int retval; - if (t1 == t2) return true; @@ -969,9 +969,7 @@ comptypes (tree t1, tree t2, int strict) && TYPE_MAIN_VARIANT (t1) == TYPE_MAIN_VARIANT (t2)) return true; - if (!(*targetm.comp_type_attributes) (t1, t2)) - return false; - + /* Compare the types. Break out if they could be the same. */ switch (TREE_CODE (t1)) { case TEMPLATE_TEMPLATE_PARM: @@ -984,7 +982,7 @@ comptypes (tree t1, tree t2, int strict) DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t2)))) return false; if (TREE_CODE (t1) == TEMPLATE_TEMPLATE_PARM) - return true; + break; /* Don't check inheritance. */ strict = COMPARE_STRICT; /* Fall through. */ @@ -995,18 +993,17 @@ comptypes (tree t1, tree t2, int strict) && (TYPE_TI_TEMPLATE (t1) == TYPE_TI_TEMPLATE (t2) || TREE_CODE (t1) == BOUND_TEMPLATE_TEMPLATE_PARM) && comp_template_args (TYPE_TI_ARGS (t1), TYPE_TI_ARGS (t2))) - return true; + break; if ((strict & COMPARE_BASE) && DERIVED_FROM_P (t1, t2)) - return true; + break; else if ((strict & COMPARE_DERIVED) && DERIVED_FROM_P (t2, t1)) - return true; + break; - /* We may be dealing with Objective-C instances... */ + /* We may be dealing with Objective-C instances. */ if (TREE_CODE (t1) == RECORD_TYPE - && ((retval = objc_comptypes (t1, t2, 0)) >= 0)) - return retval; - /* ...but fall through if we are not. */ + && objc_comptypes (t1, t2, 0) > 0) + break; return false; @@ -1014,51 +1011,72 @@ comptypes (tree t1, tree t2, int strict) if (!comptypes (TYPE_OFFSET_BASETYPE (t1), TYPE_OFFSET_BASETYPE (t2), strict & ~COMPARE_REDECLARATION)) return false; - return same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)); + if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) + return false; + break; case POINTER_TYPE: case REFERENCE_TYPE: - return TYPE_MODE (t1) == TYPE_MODE (t2) - && TYPE_REF_CAN_ALIAS_ALL (t1) == TYPE_REF_CAN_ALIAS_ALL (t2) - && same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)); + if (TYPE_MODE (t1) != TYPE_MODE (t2) + || TYPE_REF_CAN_ALIAS_ALL (t1) != TYPE_REF_CAN_ALIAS_ALL (t2) + || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) + return false; + break; case METHOD_TYPE: case FUNCTION_TYPE: if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) return false; - return compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2)); + if (!compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2))) + return false; + break; case ARRAY_TYPE: /* Target types must match incl. qualifiers. */ - return comp_array_types (t1, t2, !!(strict & COMPARE_REDECLARATION)); + if (!comp_array_types (t1, t2, !!(strict & COMPARE_REDECLARATION))) + return false; + break; case TEMPLATE_TYPE_PARM: - return (TEMPLATE_TYPE_IDX (t1) == TEMPLATE_TYPE_IDX (t2) - && TEMPLATE_TYPE_LEVEL (t1) == TEMPLATE_TYPE_LEVEL (t2)); + if (TEMPLATE_TYPE_IDX (t1) != TEMPLATE_TYPE_IDX (t2) + || TEMPLATE_TYPE_LEVEL (t1) != TEMPLATE_TYPE_LEVEL (t2)) + return false; + break; case TYPENAME_TYPE: if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1), TYPENAME_TYPE_FULLNAME (t2))) return false; - return same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2)); + if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2))) + return false; + break; case UNBOUND_CLASS_TEMPLATE: if (!cp_tree_equal (TYPE_IDENTIFIER (t1), TYPE_IDENTIFIER (t2))) return false; - return same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2)); + if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2))) + return false; + break; case COMPLEX_TYPE: - return same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)); + if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) + return false; + break; case VECTOR_TYPE: - return TYPE_VECTOR_SUBPARTS (t1) == TYPE_VECTOR_SUBPARTS (t2) - && same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)); + if (TYPE_VECTOR_SUBPARTS (t1) != TYPE_VECTOR_SUBPARTS (t2) + || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))) + return false; break; default: - break; + return false; } - return false; + + /* If we get here, we know that from a target independent POV the + types are the same. Make sure the target attributes are also + the same. */ + return targetm.comp_type_attributes (t1, t2); } /* Returns 1 if TYPE1 is at least as qualified as TYPE2. */ @@ -1205,7 +1223,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain) if (type == error_mark_node) return error_mark_node; - if (processing_template_decl) + if (dependent_type_p (type)) { value = build_min (op, size_type_node, type); TREE_READONLY (value) = 1; @@ -1224,7 +1242,9 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain) value = size_one_node; } else - value = c_sizeof_or_alignof_type (complete_type (type), op, complain); + value = c_sizeof_or_alignof_type (complete_type (type), + op == SIZEOF_EXPR, + complain); return value; } @@ -1462,7 +1482,7 @@ string_conv_p (tree totype, tree exp, int warn) /* This warning is not very useful, as it complains about printf. */ if (warn && warn_write_strings) - warning ("deprecated conversion from string constant to %qT'", totype); + warning (0, "deprecated conversion from string constant to %qT'", totype); return 1; } @@ -1680,9 +1700,9 @@ build_class_member_access_expr (tree object, tree member, && !DECL_FIELD_IS_BASE (member) && !skip_evaluation) { - warning ("invalid access to non-static data member %qD of NULL object", + warning (0, "invalid access to non-static data member %qD of NULL object", member); - warning ("(perhaps the % macro was used incorrectly)"); + warning (0, "(perhaps the % macro was used incorrectly)"); } /* If MEMBER is from an anonymous aggregate, we have converted @@ -1831,6 +1851,10 @@ finish_class_member_access_expr (tree object, tree name) if (object == error_mark_node || name == error_mark_node) return error_mark_node; + /* If OBJECT is an ObjC class instance, we must obey ObjC access rules. */ + if (!objc_is_public (object, name)) + return error_mark_node; + object_type = TREE_TYPE (object); if (processing_template_decl) @@ -1995,8 +2019,8 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name) /*want_type=*/false); member_type = cp_build_qualified_type (TREE_TYPE (member), cp_type_quals (ptrmem_type)); - return fold (build3 (COMPONENT_REF, member_type, - ptrmem, member, NULL_TREE)); + return fold_build3 (COMPONENT_REF, member_type, + ptrmem, member, NULL_TREE); } /* Given an expression PTR for a pointer, return an expression @@ -2156,7 +2180,7 @@ build_array_ref (tree array, tree idx) must have done so deliberately. */ if (warn_char_subscripts && TYPE_MAIN_VARIANT (TREE_TYPE (idx)) == char_type_node) - warning ("array subscript has type %"); + warning (0, "array subscript has type %"); if (!INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (idx))) { @@ -2208,7 +2232,7 @@ build_array_ref (tree array, tree idx) while (TREE_CODE (foo) == COMPONENT_REF) foo = TREE_OPERAND (foo, 0); if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo)) - warning ("subscripting array declared %"); + warning (0, "subscripting array declared %"); } type = TREE_TYPE (TREE_TYPE (array)); @@ -2343,7 +2367,7 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function) vtbl = build_indirect_ref (vtbl, NULL); /* Finally, extract the function pointer from the vtable. */ - e2 = fold (build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, idx)); + e2 = fold_build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, idx); e2 = build_indirect_ref (e2, NULL); TREE_CONSTANT (e2) = 1; TREE_INVARIANT (e2) = 1; @@ -2377,6 +2401,10 @@ build_function_call (tree function, tree params) int is_method; tree original = function; + /* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF + expressions, like those used for ObjC messenger dispatches. */ + function = objc_rewrite_function_call (function, params); + /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. Strip such NOP_EXPRs, since FUNCTION is used in non-lvalue context. */ if (TREE_CODE (function) == NOP_EXPR @@ -2836,9 +2864,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, || code1 == COMPLEX_TYPE || code1 == VECTOR_TYPE)) { if (TREE_CODE (op1) == INTEGER_CST && integer_zerop (op1)) - warning ("division by zero in %<%E / 0%>", op0); + warning (0, "division by zero in %<%E / 0%>", op0); else if (TREE_CODE (op1) == REAL_CST && real_zerop (op1)) - warning ("division by zero in %<%E / 0.%>", op0); + warning (0, "division by zero in %<%E / 0.%>", op0); if (code0 == COMPLEX_TYPE || code0 == VECTOR_TYPE) code0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0))); @@ -2872,9 +2900,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case TRUNC_MOD_EXPR: case FLOOR_MOD_EXPR: if (code1 == INTEGER_TYPE && integer_zerop (op1)) - warning ("division by zero in %<%E %% 0%>", op0); + warning (0, "division by zero in %<%E %% 0%>", op0); else if (code1 == REAL_TYPE && real_zerop (op1)) - warning ("division by zero in %<%E %% 0.%>", op0); + warning (0, "division by zero in %<%E %% 0.%>", op0); if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) { @@ -2908,13 +2936,13 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST) { if (tree_int_cst_lt (op1, integer_zero_node)) - warning ("right shift count is negative"); + warning (0, "right shift count is negative"); else { if (! integer_zerop (op1)) short_shift = 1; if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("right shift count >= width of type"); + warning (0, "right shift count >= width of type"); } } /* Convert the shift-count to an integer, regardless of @@ -2933,9 +2961,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST) { if (tree_int_cst_lt (op1, integer_zero_node)) - warning ("left shift count is negative"); + warning (0, "left shift count is negative"); else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("left shift count >= width of type"); + warning (0, "left shift count >= width of type"); } /* Convert the shift-count to an integer, regardless of size of value being shifted. */ @@ -2954,10 +2982,10 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, if (TREE_CODE (op1) == INTEGER_CST) { if (tree_int_cst_lt (op1, integer_zero_node)) - warning ("%s rotate count is negative", + warning (0, "%s rotate count is negative", (code == LROTATE_EXPR) ? "left" : "right"); else if (compare_tree_int (op1, TYPE_PRECISION (type0)) >= 0) - warning ("%s rotate count >= width of type", + warning (0, "%s rotate count >= width of type", (code == LROTATE_EXPR) ? "left" : "right"); } /* Convert the shift-count to an integer, regardless of @@ -2970,7 +2998,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, case EQ_EXPR: case NE_EXPR: if (warn_float_equal && (code0 == REAL_TYPE || code1 == REAL_TYPE)) - warning ("comparing floating point with == or != is unsafe"); + warning (0, "comparing floating point with == or != is unsafe"); build_type = boolean_type_node; if ((code0 == INTEGER_TYPE || code0 == REAL_TYPE @@ -3297,7 +3325,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, && TYPE_MAIN_VARIANT (TREE_TYPE (orig_op0)) != TYPE_MAIN_VARIANT (TREE_TYPE (orig_op1))) { - warning ("comparison between types %q#T and %q#T", + warning (0, "comparison between types %q#T and %q#T", TREE_TYPE (orig_op0), TREE_TYPE (orig_op1)); } @@ -3333,7 +3361,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, (result_type))))) /* OK */; else - warning ("comparison between signed and unsigned integer expressions"); + warning (0, "comparison between signed and unsigned integer expressions"); /* Warn if two unsigned values are being compared in a size larger than their original size, and one (and only one) is the @@ -3377,7 +3405,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, { mask = (~ (HOST_WIDE_INT) 0) << bits; if ((mask & constant) != mask) - warning ("comparison of promoted ~unsigned with constant"); + warning (0, "comparison of promoted ~unsigned with constant"); } } else if (unsignedp0 && unsignedp1 @@ -3385,7 +3413,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, < TYPE_PRECISION (result_type)) && (TYPE_PRECISION (TREE_TYPE (primop1)) < TYPE_PRECISION (result_type))) - warning ("comparison of promoted ~unsigned with unsigned"); + warning (0, "comparison of promoted ~unsigned with unsigned"); } } } @@ -3412,7 +3440,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, performed. Note that pointer-difference and pointer-addition have already been handled above, and so we don't end up here in that case. */ - warning ("NULL used in arithmetic"); + warning (0, "NULL used in arithmetic"); if (! converted) { @@ -3575,7 +3603,7 @@ build_x_unary_op (enum tree_code code, tree xarg) } } else if (TREE_CODE (xarg) == TARGET_EXPR) - warning ("taking address of temporary"); + warning (0, "taking address of temporary"); exp = build_unary_op (ADDR_EXPR, xarg, 0); } @@ -4010,6 +4038,29 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) arg = OVL_CURRENT (arg); break; + case OFFSET_REF: + /* Turn a reference to a non-static data member into a + pointer-to-member. */ + { + tree type; + tree t; + + if (!PTRMEM_OK_P (arg)) + return build_unary_op (code, arg, 0); + + t = TREE_OPERAND (arg, 1); + if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE) + { + error ("cannot create pointer to reference member %qD", t); + return error_mark_node; + } + + type = build_ptrmem_type (context_for_name_lookup (t), + TREE_TYPE (t)); + t = make_ptrmem_cst (type, TREE_OPERAND (arg, 1)); + return t; + } + default: break; } @@ -4066,15 +4117,10 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert) } else { + tree object = TREE_OPERAND (arg, 0); tree field = TREE_OPERAND (arg, 1); - tree rval = build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0), 0); - tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (rval)), - decl_type_context (field), - ba_check, NULL); - - rval = build_base_path (PLUS_EXPR, rval, binfo, 1); - - TREE_OPERAND (arg, 0) = build_indirect_ref (rval, NULL); + gcc_assert (same_type_ignoring_top_level_qualifiers_p + (TREE_TYPE (object), decl_type_context (field))); addr = build_address (arg); } @@ -4166,52 +4212,7 @@ unary_complex_lvalue (enum tree_code code, tree arg) if (TREE_CODE (TREE_TYPE (arg)) == FUNCTION_TYPE || TREE_CODE (TREE_TYPE (arg)) == METHOD_TYPE || TREE_CODE (arg) == OFFSET_REF) - { - tree t; - - gcc_assert (TREE_CODE (arg) != SCOPE_REF); - - if (TREE_CODE (arg) != OFFSET_REF) - return 0; - - t = TREE_OPERAND (arg, 1); - - /* Check all this code for right semantics. */ - if (TREE_CODE (t) == FUNCTION_DECL) - { - if (DECL_DESTRUCTOR_P (t)) - error ("taking address of destructor"); - return build_unary_op (ADDR_EXPR, t, 0); - } - if (TREE_CODE (t) == VAR_DECL) - return build_unary_op (ADDR_EXPR, t, 0); - else - { - tree type; - - if (TREE_OPERAND (arg, 0) - && ! is_dummy_object (TREE_OPERAND (arg, 0)) - && TREE_CODE (t) != FIELD_DECL) - { - error ("taking address of bound pointer-to-member expression"); - return error_mark_node; - } - if (!PTRMEM_OK_P (arg)) - return build_unary_op (code, arg, 0); - - if (TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE) - { - error ("cannot create pointer to reference member %qD", t); - return error_mark_node; - } - - type = build_ptrmem_type (context_for_name_lookup (t), - TREE_TYPE (t)); - t = make_ptrmem_cst (type, TREE_OPERAND (arg, 1)); - return t; - } - } - + return NULL_TREE; /* We permit compiler to make function calls returning objects of aggregate type look like lvalues. */ @@ -4292,7 +4293,7 @@ cxx_mark_addressable (tree exp) } else if (extra_warnings) warning - ("address requested for %qD, which is declared %", x); + (0, "address requested for %qD, which is declared %", x); } TREE_ADDRESSABLE (x) = 1; return true; @@ -4496,7 +4497,7 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, { /* C-style casts are allowed to cast away constness. With WARN_CAST_QUAL, we still want to issue a warning. */ - diag_fn = warn_cast_qual ? warning : NULL; + diag_fn = warn_cast_qual ? warning0 : NULL; desc = "cast"; } else @@ -4608,13 +4609,15 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p, promotions, floating point promotion, integral conversions, floating point conversions, floating-integral conversions, pointer conversions, and pointer to member conversions. */ - if ((ARITHMETIC_TYPE_P (type) && ARITHMETIC_TYPE_P (intype)) - /* DR 128 - - A value of integral _or enumeration_ type can be explicitly - converted to an enumeration type. */ - || (INTEGRAL_OR_ENUMERATION_TYPE_P (type) - && INTEGRAL_OR_ENUMERATION_TYPE_P (intype))) + /* DR 128 + + A value of integral _or enumeration_ type can be explicitly + converted to an enumeration type. */ + /* The effect of all that is that any conversion between any two + types which are integral, floating, or enumeration types can be + performed. */ + if ((INTEGRAL_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type)) + && (INTEGRAL_TYPE_P (intype) || SCALAR_FLOAT_TYPE_P (intype))) { expr = ocp_convert (type, expr, CONV_C_CAST, LOOKUP_NORMAL); @@ -4809,7 +4812,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, if (TYPE_PTR_P (intype) && (comptypes (TREE_TYPE (intype), TREE_TYPE (type), COMPARE_BASE | COMPARE_DERIVED))) - warning ("casting %qT to %qT does not dereference pointer", + warning (0, "casting %qT to %qT does not dereference pointer", intype, type); expr = build_unary_op (ADDR_EXPR, expr, 0); @@ -4881,7 +4884,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, && COMPLETE_TYPE_P (TREE_TYPE (type)) && COMPLETE_TYPE_P (TREE_TYPE (intype)) && TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (intype))) - warning ("cast from %qT to %qT increases required alignment of " + warning (0, "cast from %qT to %qT increases required alignment of " "target type", intype, type); @@ -4895,7 +4898,7 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p, where possible, and it is necessary in some cases. DR 195 addresses this issue, but as of 2004/10/26 is still in drafting. */ - warning ("ISO C++ forbids casting between pointer-to-function and pointer-to-object"); + warning (0, "ISO C++ forbids casting between pointer-to-function and pointer-to-object"); return fold_if_not_in_template (build_nop (type, expr)); } else if (TREE_CODE (type) == VECTOR_TYPE) @@ -5448,6 +5451,14 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) if (newrhs == error_mark_node) return error_mark_node; + if (c_dialect_objc () && flag_objc_gc) + { + result = objc_generate_write_barrier (lhs, modifycode, newrhs); + + if (result) + return result; + } + result = build2 (modifycode == NOP_EXPR ? MODIFY_EXPR : INIT_EXPR, lhstype, lhs, newrhs); @@ -5537,7 +5548,7 @@ get_delta_difference (tree from, tree to, virt_binfo = binfo_from_vbase (binfo); if (virt_binfo) /* This is a reinterpret cast, we choose to do nothing. */ - warning ("pointer to member cast via virtual base %qT", + warning (0, "pointer to member cast via virtual base %qT", BINFO_TYPE (virt_binfo)); else result = size_diffop (size_zero_node, BINFO_OFFSET (binfo)); @@ -5553,7 +5564,7 @@ get_delta_difference (tree from, tree to, { /* This is a reinterpret cast, we choose to do nothing. */ if (allow_inverse_p) - warning ("pointer to member cast via virtual base %qT", + warning (0, "pointer to member cast via virtual base %qT", BINFO_TYPE (virt_binfo)); else error ("pointer to member conversion via virtual base %qT", @@ -5683,7 +5694,10 @@ build_ptrmemfunc (tree type, tree pfn, int force, bool c_cast_p) return instantiate_type (type, pfn, tf_error | tf_warning); fn = TREE_OPERAND (pfn, 0); - gcc_assert (TREE_CODE (fn) == FUNCTION_DECL); + gcc_assert (TREE_CODE (fn) == FUNCTION_DECL + /* In a template, we will have preserved the + OFFSET_REF. */ + || (processing_template_decl && TREE_CODE (fn) == OFFSET_REF)); return make_ptrmem_cst (to_type, fn); } @@ -5972,14 +5986,14 @@ maybe_warn_about_returning_address_of_local (tree retval) if (TREE_CODE (whats_returned) == AGGR_INIT_EXPR || TREE_CODE (whats_returned) == TARGET_EXPR) { - warning ("returning reference to temporary"); + warning (0, "returning reference to temporary"); return; } if (TREE_CODE (whats_returned) == VAR_DECL && DECL_NAME (whats_returned) && TEMP_NAME_P (DECL_NAME (whats_returned))) { - warning ("reference to non-lvalue returned"); + warning (0, "reference to non-lvalue returned"); return; } } @@ -6018,7 +6032,7 @@ check_return_expr (tree retval) (This is a G++ extension, used to get better code for functions that call the `volatile' function.) */ if (TREE_THIS_VOLATILE (current_function_decl)) - warning ("function declared % has a % statement"); + warning (0, "function declared % has a % statement"); /* Check for various simple errors. */ if (DECL_DESTRUCTOR_P (current_function_decl)) @@ -6106,7 +6120,7 @@ check_return_expr (tree retval) && !TYPE_NOTHROW_P (TREE_TYPE (current_function_decl)) && ! flag_check_new && null_ptr_cst_p (retval)) - warning ("% must not return NULL unless it is " + warning (0, "% must not return NULL unless it is " "declared % (or -fcheck-new is in effect)"); /* Effective C++ rule 15. See also start_function. */ @@ -6132,7 +6146,7 @@ check_return_expr (tree retval) } if (warn) - warning ("% should return a reference to %<*this%>"); + warning (0, "% should return a reference to %<*this%>"); } /* The fabled Named Return Value optimization, as per [class.copy]/15: @@ -6513,3 +6527,19 @@ non_reference (tree t) t = TREE_TYPE (t); return t; } + + +/* 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. */ + +int +lvalue_or_else (tree ref, enum lvalue_use use) +{ + int win = lvalue_p (ref); + + if (!win) + lvalue_error (use); + + return win; +} diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index 8017af3dd25..37eb023324a 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -235,7 +235,7 @@ complete_type_check_abstract (tree type) int abstract_virtuals_error (tree decl, tree type) { - VEC (tree) *pure; + VEC(tree,gc) *pure; /* This function applies only to classes. Any other entity can never be abstract. */ @@ -352,7 +352,7 @@ cxx_incomplete_type_diagnostic (tree value, tree type, int diag_type) if (diag_type == 1) { - p_msg = warning; + p_msg = warning0; p_msg_at = cp_warning_at; } else if (diag_type == 2) @@ -839,7 +839,7 @@ process_init_constructor (tree type, tree init, tree* elts) if (elts) { if (warn_missing_braces) - warning ("aggregate has a partly bracketed initializer"); + warning (0, "aggregate has a partly bracketed initializer"); tail = *elts; } else @@ -1005,7 +1005,7 @@ process_init_constructor (tree type, tree init, tree* elts) /* Warn when some struct elements are implicitly initialized. */ if (warn_missing_field_initializers && (!init || BRACE_ENCLOSED_INITIALIZER_P (init))) - warning ("missing initializer for member %qD", field); + warning (0, "missing initializer for member %qD", field); } else { @@ -1020,7 +1020,7 @@ process_init_constructor (tree type, tree init, tree* elts) to zero. */ if (warn_missing_field_initializers && (!init || BRACE_ENCLOSED_INITIALIZER_P (init))) - warning ("missing initializer for member %qD", field); + warning (0, "missing initializer for member %qD", field); if (! zero_init_p (TREE_TYPE (field))) next1 = build_zero_init (TREE_TYPE (field), @@ -1123,7 +1123,7 @@ process_init_constructor (tree type, tree init, tree* elts) result = build_constructor (type, nreverse (members)); if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type) == NULL_TREE) - complete_array_type (type, result, /*do_default=*/0); + cp_complete_array_type (&TREE_TYPE (result), result, /*do_default=*/0); if (init) TREE_HAS_CONSTRUCTOR (result) = TREE_HAS_CONSTRUCTOR (init); if (allconstant) diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c index 0e362f3a91f..97ac69ad022 100644 --- a/gcc/crtstuff.c +++ b/gcc/crtstuff.c @@ -1,7 +1,7 @@ /* Specialized bits of code needed to support construction and destruction of file-scope objects in C++ code. Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com). This file is part of GCC. @@ -51,14 +51,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA This file must be compiled with gcc. */ -/* It is incorrect to include config.h here, because this file is being - compiled for the target, and hence definitions concerning only the host - do not apply. */ - +/* Target machine header files require this define. */ #define IN_LIBGCC2 -/* We include auto-host.h here to get HAVE_GAS_HIDDEN. This is - supposedly valid even though this is a "target" file. */ +/* FIXME: Including auto-host is incorrect, but until we have + identified the set of defines that need to go into auto-target.h, + this will have to do. */ #include "auto-host.h" #include "tconfig.h" #include "tsystem.h" @@ -211,7 +209,7 @@ STATIC void *__JCR_LIST__[] = { }; #endif /* JCR_SECTION_NAME */ -#ifdef INIT_SECTION_ASM_OP +#if defined(INIT_SECTION_ASM_OP) || defined(INIT_ARRAY_SECTION_ASM_OP) #ifdef OBJECT_FORMAT_ELF @@ -256,9 +254,11 @@ extern void __cxa_finalize (void *) TARGET_ATTRIBUTE_WEAK; static void __attribute__((used)) __do_global_dtors_aux (void) { +#ifndef FINI_ARRAY_SECTION_ASM_OP static func_ptr *p = __DTOR_LIST__ + 1; - static _Bool completed; func_ptr f; +#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */ + static _Bool completed; if (__builtin_expect (completed, 0)) return; @@ -268,11 +268,16 @@ __do_global_dtors_aux (void) __cxa_finalize (__dso_handle); #endif +#ifdef FINI_ARRAY_SECTION_ASM_OP + /* If we are using .fini_array then destructors will be run via that + mechanism. */ +#else /* !defined (FINI_ARRAY_SECTION_ASM_OP) */ while ((f = *p)) { p++; f (); } +#endif /* !defined(FINI_ARRAY_SECTION_ASM_OP) */ #ifdef USE_EH_FRAME_REGISTRY #ifdef CRT_GET_RFIB_DATA @@ -290,7 +295,13 @@ __do_global_dtors_aux (void) } /* Stick a call to __do_global_dtors_aux into the .fini section. */ +#ifdef FINI_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (FINI_SECTION_ASM_OP, __do_global_dtors_aux) +#else /* !defined(FINI_SECTION_ASM_OP) */ +static func_ptr __do_global_dtors_aux_fini_array_entry[] + __attribute__ ((__unused__, section(".fini_array"))) + = { __do_global_dtors_aux }; +#endif /* !defined(FINI_SECTION_ASM_OP) */ #if defined(USE_EH_FRAME_REGISTRY) || defined(JCR_SECTION_NAME) /* Stick a call to __register_frame_info into the .init section. For some @@ -324,7 +335,13 @@ frame_dummy (void) #endif /* JCR_SECTION_NAME */ } +#ifdef INIT_SECTION_ASM_OP CRT_CALL_STATIC_FUNCTION (INIT_SECTION_ASM_OP, frame_dummy) +#else /* defined(INIT_SECTION_ASM_OP) */ +static func_ptr __frame_dummy_init_array_entry[] + __attribute__ ((__unused__, section(".init_array"))) + = { frame_dummy }; +#endif /* !defined(INIT_SECTION_ASM_OP) */ #endif /* USE_EH_FRAME_REGISTRY || JCR_SECTION_NAME */ #else /* OBJECT_FORMAT_ELF */ @@ -480,7 +497,11 @@ STATIC void *__JCR_END__[1] = { 0 }; #endif /* JCR_SECTION_NAME */ -#ifdef INIT_SECTION_ASM_OP +#ifdef INIT_ARRAY_SECTION_ASM_OP + +/* If we are using .init_array, there is nothing to do. */ + +#elif defined(INIT_SECTION_ASM_OP) #ifdef OBJECT_FORMAT_ELF static void __attribute__((used)) diff --git a/gcc/cse.c b/gcc/cse.c index fd5e21ac2ee..4eb4c3528e0 100644 --- a/gcc/cse.c +++ b/gcc/cse.c @@ -1234,7 +1234,24 @@ insert_regs (rtx x, struct table_elt *classp, int modified) if (REG_P (classp->exp) && GET_MODE (classp->exp) == GET_MODE (x)) { - make_regs_eqv (regno, REGNO (classp->exp)); + unsigned c_regno = REGNO (classp->exp); + + gcc_assert (REGNO_QTY_VALID_P (c_regno)); + + /* Suppose that 5 is hard reg and 100 and 101 are + pseudos. Consider + + (set (reg:si 100) (reg:si 5)) + (set (reg:si 5) (reg:si 100)) + (set (reg:di 101) (reg:di 5)) + + We would now set REG_QTY (101) = REG_QTY (5), but the + entry for 5 is in SImode. When we use this later in + copy propagation, we get the register in wrong mode. */ + if (qty_table[REG_QTY (c_regno)].mode != GET_MODE (x)) + continue; + + make_regs_eqv (regno, c_regno); return 1; } @@ -3791,7 +3808,7 @@ fold_rtx (rtx x, rtx insn) /* It's not safe to substitute the operand of a conversion operator with a constant, as the conversion's identity - depends upon the mode of it's operand. This optimization + depends upon the mode of its operand. This optimization is handled by the call to simplify_unary_operation. */ if (GET_RTX_CLASS (code) == RTX_UNARY && GET_MODE (replacements[j]) != mode_arg0 @@ -4344,47 +4361,6 @@ equiv_constant (rtx x) return 0; } -/* Assuming that X is an rtx (e.g., MEM, REG or SUBREG) for a fixed-point - number, return an rtx (MEM, SUBREG, or CONST_INT) that refers to the - least-significant part of X. - MODE specifies how big a part of X to return. - - If the requested operation cannot be done, 0 is returned. - - This is similar to gen_lowpart_general in emit-rtl.c. */ - -rtx -gen_lowpart_if_possible (enum machine_mode mode, rtx x) -{ - rtx result = gen_lowpart_common (mode, x); - - if (result) - return result; - else if (MEM_P (x)) - { - /* This is the only other case we handle. */ - int offset = 0; - rtx new; - - if (WORDS_BIG_ENDIAN) - offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD) - - MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD)); - if (BYTES_BIG_ENDIAN) - /* Adjust the address so that the address-after-the-data is - unchanged. */ - offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode)) - - MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x)))); - - new = adjust_address_nv (x, mode, offset); - if (! memory_address_p (mode, XEXP (new, 0))) - return 0; - - return new; - } - else - return 0; -} - /* Given INSN, a jump insn, PATH_TAKEN indicates if we are following the "taken" branch. It will be zero if not. @@ -5558,9 +5534,10 @@ cse_insn (rtx insn, rtx libcall_insn) else if (constant_pool_entries_cost && CONSTANT_P (trial) - /* Reject cases that will abort in decode_rtx_const. - On the alpha when simplifying a switch, we get - (const (truncate (minus (label_ref) (label_ref)))). */ + /* Reject cases that will cause decode_rtx_const to + die. On the alpha when simplifying a switch, we + get (const (truncate (minus (label_ref) + (label_ref)))). */ && ! (GET_CODE (trial) == CONST && GET_CODE (XEXP (trial, 0)) == TRUNCATE) /* Likewise on IA-64, except without the truncate. */ diff --git a/gcc/cselib.c b/gcc/cselib.c index 351d22d4110..b7a8963da77 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -50,7 +50,6 @@ static struct elt_loc_list *new_elt_loc_list (struct elt_loc_list *, rtx); static void unchain_one_value (cselib_val *); static void unchain_one_elt_list (struct elt_list **); static void unchain_one_elt_loc_list (struct elt_loc_list **); -static void clear_table (void); static int discard_useless_locs (void **, void *); static int discard_useless_values (void **, void *); static void remove_useless_values (void); @@ -106,11 +105,11 @@ static unsigned int reg_values_size; #define REG_VALUES(i) reg_values[i] /* The largest number of hard regs used by any entry added to the - REG_VALUES table. Cleared on each clear_table() invocation. */ + REG_VALUES table. Cleared on each cselib_clear_table() invocation. */ static unsigned int max_value_regs; /* Here the set of indices I with REG_VALUES(I) != 0 is saved. This is used - in clear_table() for fast emptying. */ + in cselib_clear_table() for fast emptying. */ static unsigned int *used_regs; static unsigned int n_used_regs; @@ -200,8 +199,8 @@ unchain_one_value (cselib_val *v) initialization. If CLEAR_ALL isn't set, then only clear the entries which are known to have been used. */ -static void -clear_table (void) +void +cselib_clear_table (void) { unsigned int i; @@ -1362,7 +1361,7 @@ cselib_process_insn (rtx insn) { if (find_reg_note (insn, REG_RETVAL, NULL)) cselib_current_insn_in_libcall = false; - clear_table (); + cselib_clear_table (); return; } @@ -1464,7 +1463,7 @@ cselib_finish (void) free_alloc_pool (elt_loc_list_pool); free_alloc_pool (cselib_val_pool); free_alloc_pool (value_pool); - clear_table (); + cselib_clear_table (); htab_delete (hash_table); free (used_regs); used_regs = 0; diff --git a/gcc/cselib.h b/gcc/cselib.h index 1aff2514f30..a6ff9e43871 100644 --- a/gcc/cselib.h +++ b/gcc/cselib.h @@ -1,6 +1,6 @@ /* Common subexpression elimination for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2003, 2004 Free Software Foundation, Inc. + 1999, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -64,6 +64,7 @@ struct elt_list GTY(()) extern cselib_val *cselib_lookup (rtx, enum machine_mode, int); extern void cselib_init (bool record_memory); +extern void cselib_clear_table (void); extern void cselib_finish (void); extern void cselib_process_insn (rtx); extern enum machine_mode cselib_reg_set_mode (rtx); diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 6383d48d0e9..a4a036bb51f 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -241,13 +241,6 @@ static GTY(()) int scope_labelno; static GTY(()) int dbxout_source_line_counter; -/* Nonzero if we have actually used any of the GDB extensions - to the debugging format. The idea is that we use them for the - first time only if there's a strong reason, but once we have done that, - we use them whenever convenient. */ - -static GTY(()) int have_used_extensions = 0; - /* Number for the next N_SOL filename stabs label. The number 0 is reserved for the N_SO filename stabs label. */ @@ -275,7 +268,7 @@ static int pending_bincls = 0; static const char *base_input_file; #ifdef DEBUG_SYMS_TEXT -#define FORCE_TEXT function_section (current_function_decl); +#define FORCE_TEXT current_function_section (current_function_decl); #else #define FORCE_TEXT #endif @@ -378,7 +371,9 @@ const struct gcc_debug_hooks dbx_debug_hooks = debug_nothing_tree, /* outlining_inline_function */ debug_nothing_rtx, /* label */ dbxout_handle_pch, /* handle_pch */ - debug_nothing_rtx /* var_location */ + debug_nothing_rtx, /* var_location */ + debug_nothing_void, /* switch_text_section */ + 0 /* start_end_main_source_file */ }; #endif /* DBX_DEBUGGING_INFO */ @@ -408,7 +403,9 @@ const struct gcc_debug_hooks xcoff_debug_hooks = debug_nothing_tree, /* outlining_inline_function */ debug_nothing_rtx, /* label */ dbxout_handle_pch, /* handle_pch */ - debug_nothing_rtx /* var_location */ + debug_nothing_rtx, /* var_location */ + debug_nothing_void, /* switch_text_section */ + 0 /* start_end_main_source_file */ }; #endif /* XCOFF_DEBUGGING_INFO */ @@ -932,9 +929,22 @@ dbxout_function_end (tree decl) #ifdef DBX_OUTPUT_NFUN DBX_OUTPUT_NFUN (asm_out_file, lscope_label_name, current_function_decl); #else - dbxout_begin_empty_stabs (N_FUN); - dbxout_stab_value_label_diff (lscope_label_name, - XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); + if (flag_reorder_blocks_and_partition) + { + dbxout_begin_empty_stabs (N_FUN); + dbxout_stab_value_label_diff (cfun->hot_section_end_label, + cfun->hot_section_label); + dbxout_begin_empty_stabs (N_FUN); + dbxout_stab_value_label_diff (cfun->cold_section_end_label, + cfun->cold_section_label); + } + else + { + dbxout_begin_empty_stabs (N_FUN); + dbxout_stab_value_label_diff (lscope_label_name, + XSTR (XEXP (DECL_RTL (current_function_decl), + 0), 0)); + } #endif @@ -961,6 +971,8 @@ get_lang_number (void) return N_SO_PASCAL; else if (strcmp (language_string, "GNU Objective-C") == 0) return N_SO_OBJC; + else if (strcmp (language_string, "GNU Objective-C++") == 0) + return N_SO_OBJCPLUS; else return 0; @@ -1388,14 +1400,14 @@ dbxout_type_fields (tree type) /* Omit here local type decls until we know how to support them. */ if (TREE_CODE (tem) == TYPE_DECL + /* Omit here the nameless fields that are used to skip bits. */ + || DECL_IGNORED_P (tem) /* Omit fields whose position or size are variable or too large to represent. */ || (TREE_CODE (tem) == FIELD_DECL && (! host_integerp (bit_position (tem), 0) || ! DECL_SIZE (tem) - || ! host_integerp (DECL_SIZE (tem), 1))) - /* Omit here the nameless fields that are used to skip bits. */ - || DECL_IGNORED_P (tem)) + || ! host_integerp (DECL_SIZE (tem), 1)))) continue; else if (TREE_CODE (tem) != CONST_DECL) @@ -1413,7 +1425,6 @@ dbxout_type_fields (tree type) && (TREE_PRIVATE (tem) || TREE_PROTECTED (tem) || TREE_CODE (tem) != FIELD_DECL)) { - have_used_extensions = 1; stabstr_C ('/'); stabstr_C (DECL_ACCESSIBILITY_CHAR (tem)); } @@ -1428,7 +1439,6 @@ dbxout_type_fields (tree type) { tree name = DECL_ASSEMBLER_NAME (tem); - have_used_extensions = 1; stabstr_C (':'); stabstr_I (name); stabstr_C (';'); @@ -1636,11 +1646,15 @@ dbxout_type (tree type, int full) tree tem; tree main_variant; static int anonymous_type_number = 0; + bool vector_type = false; if (TREE_CODE (type) == VECTOR_TYPE) - /* The frontend feeds us a representation for the vector as a struct - containing an array. Pull out the array type. */ - type = TREE_TYPE (TYPE_FIELDS (TYPE_DEBUG_REPRESENTATION_TYPE (type))); + { + /* The frontend feeds us a representation for the vector as a struct + containing an array. Pull out the array type. */ + type = TREE_TYPE (TYPE_FIELDS (TYPE_DEBUG_REPRESENTATION_TYPE (type))); + vector_type = true; + } /* If there was an input error and we don't really have a type, avoid crashing and write something that is at least valid @@ -1839,7 +1853,6 @@ dbxout_type (tree type, int full) if (use_gnu_debug_info_extensions && TYPE_PRECISION (type) != TYPE_PRECISION (integer_type_node)) { - have_used_extensions = 1; stabstr_S ("@s"); stabstr_D (TYPE_PRECISION (type)); stabstr_C (';'); @@ -1856,7 +1869,6 @@ dbxout_type (tree type, int full) if (use_gnu_debug_info_extensions && TYPE_PRECISION (type) != TYPE_PRECISION (integer_type_node)) { - have_used_extensions = 1; stabstr_S ("@s"); stabstr_D (TYPE_PRECISION (type)); stabstr_C (';'); @@ -1903,7 +1915,6 @@ dbxout_type (tree type, int full) case CHAR_TYPE: if (use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_S ("@s"); stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type)); stabstr_S (";-20;"); @@ -1921,7 +1932,6 @@ dbxout_type (tree type, int full) case BOOLEAN_TYPE: if (use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_S ("@s"); stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type)); stabstr_S (";-16;"); @@ -1930,11 +1940,6 @@ dbxout_type (tree type, int full) stabstr_S ("eFalse:0,True:1,;"); break; - case FILE_TYPE: - stabstr_C ('d'); - dbxout_type (TREE_TYPE (type), 0); - break; - case COMPLEX_TYPE: /* Differs from the REAL_TYPE by its new data type number. R3 is NF_COMPLEX. We don't try to use any of the other NF_* @@ -1972,7 +1977,6 @@ dbxout_type (tree type, int full) /* Make arrays of packed bits look like bitstrings for chill. */ if (TYPE_PACKED (type) && use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_S ("@s"); stabstr_D (BITS_PER_UNIT * int_size_in_bytes (type)); stabstr_S (";@S;S"); @@ -1980,6 +1984,9 @@ dbxout_type (tree type, int full) break; } + if (use_gnu_debug_info_extensions && vector_type) + stabstr_S ("@V;"); + /* Output "a" followed by a range type definition for the index type of the array followed by a reference to the target-type. @@ -1988,7 +1995,6 @@ dbxout_type (tree type, int full) different from an array of characters. */ if (TYPE_STRING_FLAG (type) && use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_S ("@S;"); } tem = TYPE_DOMAIN (type); @@ -2052,13 +2058,12 @@ dbxout_type (tree type, int full) { int i; tree child; - VEC (tree) *accesses = BINFO_BASE_ACCESSES (binfo); + VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo); if (use_gnu_debug_info_extensions) { if (BINFO_N_BASE_BINFOS (binfo)) { - have_used_extensions = 1; stabstr_C ('!'); stabstr_U (BINFO_N_BASE_BINFOS (binfo)); stabstr_C (','); @@ -2071,7 +2076,6 @@ dbxout_type (tree type, int full) if (use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_C (BINFO_VIRTUAL_P (child) ? '1' : '0'); stabstr_C (access == access_public_node ? '2' : access == access_protected_node @@ -2116,7 +2120,6 @@ dbxout_type (tree type, int full) dbxout_type_fields (type); if (use_gnu_debug_info_extensions && TYPE_METHODS (type) != NULL_TREE) { - have_used_extensions = 1; dbxout_type_methods (type); } @@ -2126,7 +2129,6 @@ dbxout_type (tree type, int full) /* Avoid the ~ if we don't really need it--it confuses dbx. */ && TYPE_VFIELD (type)) { - have_used_extensions = 1; /* We need to write out info about what field this class uses as its "main" vtable pointer field, because if this @@ -2157,7 +2159,6 @@ dbxout_type (tree type, int full) if (use_gnu_debug_info_extensions && TYPE_PRECISION (type) != TYPE_PRECISION (integer_type_node)) { - have_used_extensions = 1; stabstr_S ("@s"); stabstr_D (TYPE_PRECISION (type)); stabstr_C (';'); @@ -2193,7 +2194,6 @@ dbxout_type (tree type, int full) case METHOD_TYPE: if (use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_C ('#'); /* Write the argument types out longhand. */ @@ -2211,7 +2211,6 @@ dbxout_type (tree type, int full) case OFFSET_TYPE: if (use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_C ('@'); dbxout_type (TYPE_OFFSET_BASETYPE (type), 0); stabstr_C (','); @@ -2225,7 +2224,6 @@ dbxout_type (tree type, int full) case REFERENCE_TYPE: if (use_gnu_debug_info_extensions) { - have_used_extensions = 1; stabstr_C ('&'); } else @@ -2349,7 +2347,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) DBXOUT_DECR_NESTING_AND_RETURN (0); /* If we are to generate only the symbols actually used then such - symbol nodees are flagged with TREE_USED. Ignore any that + symbol nodes are flagged with TREE_USED. Ignore any that aren't flaged as TREE_USED. */ if (flag_debug_only_used_symbols @@ -2501,7 +2499,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) || TREE_CODE (type) == UNION_TYPE || TREE_CODE (type) == QUAL_UNION_TYPE) && TYPE_NAME (type) == decl - && !(use_gnu_debug_info_extensions && have_used_extensions) + && !use_gnu_debug_info_extensions && !TREE_ASM_WRITTEN (TYPE_NAME (type)) /* Distinguish the implicit typedefs of C++ from explicit ones that might be found in C. */ @@ -2527,11 +2525,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) dbxout_begin_complex_stabs (); - /* Output leading class/struct qualifiers. - ??? why not set have_used_extensions here ... because - then the test of it below would always be true, I - guess. But it's not clear to me why we shouldn't do - that always in extended mode. */ + /* Output leading class/struct qualifiers. */ if (use_gnu_debug_info_extensions) dbxout_class_name_qualifiers (decl); @@ -2548,7 +2542,7 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) from explicit ones that might be found in C. */ && DECL_ARTIFICIAL (decl)) { - if (use_gnu_debug_info_extensions && have_used_extensions) + if (use_gnu_debug_info_extensions) { stabstr_C ('T'); TREE_ASM_WRITTEN (TYPE_NAME (type)) = 1; diff --git a/gcc/ddg.c b/gcc/ddg.c index a54a87c0744..ea65835a324 100644 --- a/gcc/ddg.c +++ b/gcc/ddg.c @@ -1,5 +1,5 @@ /* DDG - Data Dependence Graph implementation. - Copyright (C) 2004 + Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by Ayal Zaks and Mustafa Hagog @@ -187,6 +187,8 @@ create_ddg_dependence (ddg_ptr g, ddg_node_ptr src_node, else free (e); } + else if (t == ANTI_DEP && dt == REG_DEP) + free (e); /* We can fix broken anti register deps using reg-moves. */ else add_edge_to_ddg (g, e); } diff --git a/gcc/debug.c b/gcc/debug.c index 812920604ba..e34b7b9f61b 100644 --- a/gcc/debug.c +++ b/gcc/debug.c @@ -1,5 +1,5 @@ /* Do-nothing debug hooks for GCC. - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 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 @@ -47,7 +47,9 @@ const struct gcc_debug_hooks do_nothing_debug_hooks = debug_nothing_tree, /* outlining_inline_function */ debug_nothing_rtx, /* label */ debug_nothing_int, /* handle_pch */ - debug_nothing_rtx /* var_location */ + debug_nothing_rtx, /* var_location */ + debug_nothing_void, /* switch_text_section */ + 0 /* start_end_main_source_file */ }; /* This file contains implementations of each debug hook that do diff --git a/gcc/debug.h b/gcc/debug.h index 547b7f68eab..5b4074b1294 100644 --- a/gcc/debug.h +++ b/gcc/debug.h @@ -1,5 +1,5 @@ /* Debug hooks for GCC. - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 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 @@ -119,6 +119,14 @@ struct gcc_debug_hooks /* Called from final_scan_insn for any NOTE_INSN_VAR_LOCATION note. */ void (* var_location) (rtx); + + /* Called from final_scan_insn if there is a switch between hot and cold + text sections. */ + void (* switch_text_section) (void); + + /* This is 1 if the debug writer wants to see start and end commands for the + main source files, and 0 otherwise. */ + int start_end_main_source_file; }; extern const struct gcc_debug_hooks *debug_hooks; diff --git a/gcc/defaults.h b/gcc/defaults.h index 28a0d83adb6..e4ef7f36246 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -702,8 +702,10 @@ do { fputs (integer_asm_op (POINTER_SIZE / BITS_PER_UNIT, TRUE), FILE); \ #define HAS_LONG_UNCOND_BRANCH 0 #endif +/* By default, only attempt to parallelize bitwise operations, and + possibly adds/subtracts using bit-twiddling. */ #ifndef UNITS_PER_SIMD_WORD -#define UNITS_PER_SIMD_WORD 0 +#define UNITS_PER_SIMD_WORD UNITS_PER_WORD #endif /* Determine whether __cxa_atexit, rather than atexit, is used to diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 39b46fc7aef..e48133299af 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -40,6 +40,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "diagnostic.h" #include "langhooks.h" #include "langhooks-def.h" +#include "opts.h" /* Prototypes. */ @@ -101,6 +102,7 @@ diagnostic_initialize (diagnostic_context *context) memset (context->diagnostic_count, 0, sizeof context->diagnostic_count); context->issue_warnings_are_errors_message = true; context->warning_as_error_requested = false; + context->show_option_requested = false; context->abort_on_error = false; context->internal_error = NULL; diagnostic_starter (context) = default_diagnostic_starter; @@ -120,6 +122,7 @@ diagnostic_set_info (diagnostic_info *diagnostic, const char *msgid, diagnostic->message.format_spec = _(msgid); diagnostic->location = location; diagnostic->kind = kind; + diagnostic->option_index = 0; } /* Return a malloc'd string describing a location. The caller is @@ -141,7 +144,7 @@ diagnostic_build_prefix (diagnostic_info *diagnostic) (s.file == NULL ? build_message_string ("%s: %s", progname, text) #ifdef USE_MAPPED_LOCATION - : s.column != 0 + : flag_show_column && s.column != 0 ? build_message_string ("%s:%d:%d: %s", s.file, s.line, s.column, text) #endif : build_message_string ("%s:%d: %s", s.file, s.line, text)); @@ -329,10 +332,21 @@ diagnostic_report_diagnostic (diagnostic_context *context, error_recursion (context); } + if (diagnostic->option_index + && ! option_enabled (diagnostic->option_index)) + return; + context->lock++; if (diagnostic_count_diagnostic (context, diagnostic)) { + const char *saved_format_spec = diagnostic->message.format_spec; + + if (context->show_option_requested && diagnostic->option_index) + diagnostic->message.format_spec + = ACONCAT ((diagnostic->message.format_spec, + " [", cl_options[diagnostic->option_index].opt_text, "]", NULL)); + pp_prepare_to_format (context->printer, &diagnostic->message, &diagnostic->location); (*diagnostic_starter (context)) (context, diagnostic); @@ -340,6 +354,7 @@ diagnostic_report_diagnostic (diagnostic_context *context, (*diagnostic_finalizer (context)) (context, diagnostic); pp_flush (context->printer); diagnostic_action_after_output (context, diagnostic); + diagnostic->message.format_spec = saved_format_spec; } context->lock--; @@ -412,7 +427,21 @@ inform (const char *msgid, ...) /* A warning. Use this for code which is correct according to the relevant language specification but is likely to be buggy anyway. */ void -warning (const char *msgid, ...) +warning (int opt, const char *msgid, ...) +{ + diagnostic_info diagnostic; + va_list ap; + + va_start (ap, msgid); + diagnostic_set_info (&diagnostic, msgid, &ap, input_location, DK_WARNING); + diagnostic.option_index = opt; + + report_diagnostic (&diagnostic); + va_end (ap); +} + +void +warning0 (const char *msgid, ...) { diagnostic_info diagnostic; va_list ap; diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index a9fe623ae78..5bbb135ac34 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -43,6 +43,8 @@ typedef struct location_t location; /* The kind of diagnostic it is about. */ diagnostic_t kind; + /* Which OPT_* directly controls this diagnostic. */ + int option_index; } diagnostic_info; #define pedantic_error_kind() (flag_pedantic_errors ? DK_ERROR : DK_WARNING) @@ -71,6 +73,10 @@ struct diagnostic_context /* True if it has been requested that warnings be treated as errors. */ bool warning_as_error_requested; + /* True if we should print the command line option which controls + each diagnostic, if known. */ + bool show_option_requested; + /* True if we should raise a SIGABRT on errors. */ bool abort_on_error; diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi index 79160f805a3..beee30fb0f7 100644 --- a/gcc/doc/contrib.texi +++ b/gcc/doc/contrib.texi @@ -279,7 +279,7 @@ feeding the gcc.gnu.org box and saving its users tons of spam. Fred Fish for BeOS support and Ada fixes. @item -Ivan Fontes Garcia for the Portugese translation of the GCJ FAQ@. +Ivan Fontes Garcia for the Portuguese translation of the GCJ FAQ@. @item Peter Gerwinski for various bug fixes and the Pascal front end. @@ -317,6 +317,9 @@ the support for System V Release 4. He has also worked heavily on the Intel 386 and 860 support. @item +Mostafa Hagog for Swing Modulo Scheduling (SMS) and post reload GCSE@. + +@item Bruno Haible for improvements in the runtime overhead for EH, new warnings and assorted bug fixes. @@ -975,6 +978,9 @@ description for the Tron architecture (specifically, the Gmicro). Kevin Zachmann helped port GCC to the Tahoe. @item +Ayal Zaks for Swing Modulo Scheduling (SMS). + +@item Xiaoqiang Zhang for work on gfortran. @item diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index e6a7dcd06eb..e9c64078e1a 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -2081,11 +2081,31 @@ respectively. They exist to make the standard header given numerical limits work correctly. You should not use these macros directly; instead, include the appropriate headers. +@item __DEPRECATED +This macro is defined, with value 1, when compiling a C++ source file +with warnings about deprecated constructs enabled. These warnings are +enabled by default, but can be disabled with @option{-Wno-deprecated}. + +@item __EXCEPTIONS +This macro is defined, with value 1, when compiling a C++ source file +with exceptions enabled. If @option{-fno-exceptions} was used when +compiling the file, then this macro will not be defined. + @item __USING_SJLJ_EXCEPTIONS__ This macro is defined, with value 1, if the compiler uses the old mechanism based on @code{setjmp} and @code{longjmp} for exception handling. +@item __GXX_WEAK__ +This macro is defined when compiling a C++ source file. It has the +value 1 if the compiler will use weak symbols, COMDAT sections, or +other similar techniques to collapse symbols with ``vague linkage'' +that are defined in multiple translation units. If the compiler will +not collapse such symbols, this macro is defined with value 0. In +general, user code should not need to make use of this macro; the +purpose of this macro is to ease implementation of the C++ runtime +library provided with G++. + @item __NEXT_RUNTIME__ This macro is defined, with value 1, if (and only if) the NeXT runtime (as in @option{-fnext-runtime}) is in use for Objective-C@. If the GNU @@ -3352,18 +3372,15 @@ current file to be treated as if it came from a system header. @chapter Other Directives @findex #ident +@findex #sccs The @samp{#ident} directive takes one argument, a string constant. On some systems, that string constant is copied into a special segment of -the object file. On other systems, the directive is ignored. +the object file. On other systems, the directive is ignored. The +@samp{#sccs} directive is a synonym for @samp{#ident}. -This directive is not part of the C standard, but it is not an official -GNU extension either. We believe it came from System V@. - -@findex #sccs -The @samp{#sccs} directive is recognized, because it appears in the -header files of some systems. It is a very old, obscure, extension -which we did not invent, and we have been unable to find any -documentation of what it should do, so GCC simply ignores it. +These directives are not part of the C standard, but they are not +official GNU extensions either. What historical information we have +been able to find, suggests they originated with System V@. @cindex null directive The @dfn{null directive} consists of a @samp{#} followed by a newline, @@ -3764,8 +3781,8 @@ character set may be controlled by the user, with the The C and C++ standards allow identifiers to be composed of @samp{_} and the alphanumeric characters. C++ and C99 also allow universal -character names (not implemented in GCC), and C99 further permits -implementation-defined characters. +character names, and C99 further permits implementation-defined +characters. GCC allows the @samp{$} character in identifiers as an extension for most targets. This is true regardless of the @option{std=} switch, @@ -4045,7 +4062,7 @@ they generally represent bugs in the snapshots. @item -I- deprecated -This option has been deprecated in 3.5. @option{-iquote} is meant to +This option has been deprecated in 4.0. @option{-iquote} is meant to replace the need for this option. @item Order of evaluation of @samp{#} and @samp{##} operators diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi index c6376c635d7..80bbe50e690 100644 --- a/gcc/doc/cppopts.texi +++ b/gcc/doc/cppopts.texi @@ -1,4 +1,4 @@ -@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004 +@c Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005 @c Free Software Foundation, Inc. @c This is part of the CPP and GCC manuals. @c For copying conditions, see the file gcc.texi. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 057bdfa9fa2..c714c54b495 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -70,6 +70,7 @@ extensions, accepted by GCC in C89 mode and in C++. * Return Address:: Getting the return or frame address of a function. * Vector Extensions:: Using vector instructions through built-in functions. * Offsetof:: Special syntax for implementing @code{offsetof}. +* Atomic Builtins:: Built-in functions for atomic memory access. * Other Builtins:: Other built-in functions. * Target Builtins:: Built-in functions specific to particular targets. * Target Format Checks:: Format checks specific to particular targets. @@ -187,6 +188,29 @@ work with C++. (Note that some versions of the GNU C Library contained header files using statement-expression that lead to precisely this bug.) +Jumping into a statement expression with @code{goto} or using a +@code{switch} statement outside the statement expression with a +@code{case} or @code{default} label inside the statement expression is +not permitted. Jumping into a statement expression with a computed +@code{goto} (@pxref{Labels as Values}) yields undefined behavior. +Jumping out of a statement expression is permitted, but if the +statement expression is part of a larger expression then it is +unspecified which other subexpressions of that expression have been +evaluated except where the language definition requires certain +subexpressions to be evaluated before or after the statement +expression. In any case, as with a function call the evaluation of a +statement expression is not interleaved with the evaluation of other +parts of the containing expression. For example, + +@smallexample + foo (), ((@{ bar1 (); goto a; 0; @}) + bar2 ()), baz(); +@end smallexample + +@noindent +will call @code{foo} and @code{bar1} and will not call @code{baz} but +may or may not call @code{bar2}. If @code{bar2} is called, it will be +called after @code{foo} and before @code{bar1} + @node Local Labels @section Locally Declared Labels @cindex local labels @@ -1701,6 +1725,13 @@ on data in the eight bit data area. Note the eight bit data area is limited to You must use GAS and GLD from GNU binutils version 2.7 or later for this attribute to work correctly. +@item exception_handler +@cindex exception handler functions on the Blackfin processor +Use this attribute on the Blackfin to indicate that the specified function +is an exception handler. The compiler will generate function entry and +exit sequences suitable for use in an exception handler when this +attribute is present. + @item far @cindex functions which handle memory bank switching On 68HC11 and 68HC12 the @code{far} attribute causes the compiler to @@ -1849,8 +1880,8 @@ that 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. -Note, interrupt handlers for the m68k, H8/300, H8/300H, H8S, and SH processors -can be specified via the @code{interrupt_handler} attribute. +Note, interrupt handlers for the Blackfin, m68k, H8/300, H8/300H, H8S, and +SH processors can be specified via the @code{interrupt_handler} attribute. Note, on the AVR, interrupts will be enabled inside the function. @@ -1864,11 +1895,17 @@ void f () __attribute__ ((interrupt ("IRQ"))); Permissible values for this parameter are: IRQ, FIQ, SWI, ABORT and UNDEF@. @item interrupt_handler -@cindex interrupt handler functions on the m68k, H8/300 and SH processors -Use this attribute on the m68k, H8/300, H8/300H, H8S, and SH to indicate that -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. +@cindex interrupt handler functions on the Blackfin, m68k, H8/300 and SH processors +Use this attribute on the Blackfin, m68k, H8/300, H8/300H, H8S, and SH to +indicate that 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. + +@item kspisusp +@cindex User stack pointer in interrupts on the Blackfin +When used together with @code{interrupt_handler}, @code{exception_handler} +or @code{nmi_handler}, code will be generated to load the stack pointer +from the USP register in the function prologue. @item long_call/short_call @cindex indirect calls on ARM @@ -1948,6 +1985,19 @@ use the normal calling convention based on @code{jsr} and @code{rts}. This attribute can be used to cancel the effect of the @option{-mlong-calls} option. +@item nesting +@cindex Allow nesting in an interrupt handler on the Blackfin processor. +Use this attribute together with @code{interrupt_handler}, +@code{exception_handler} or @code{nmi_handler} to indicate that the function +entry code should enable nested interrupts or exceptions. + +@item nmi_handler +@cindex NMI handler functions on the Blackfin processor +Use this attribute on the Blackfin to indicate that the specified function +is an NMI handler. The compiler will generate function entry and +exit sequences suitable for use in an NMI handler when this +attribute is present. + @item no_instrument_function @cindex @code{no_instrument_function} function attribute @opindex finstrument-functions @@ -2102,8 +2152,8 @@ The @code{longjmp}-like counterpart of such function, if any, might need to be marked with the @code{noreturn} attribute. @item saveall -@cindex save all registers on the H8/300, H8/300H, and H8S -Use this attribute on the H8/300, H8/300H, and H8S to indicate that +@cindex save all registers on the Blackfin, H8/300, H8/300H, and H8S +Use this attribute on the Blackfin, H8/300, H8/300H, and H8S to indicate that all registers except the stack pointer should be saved in the prologue regardless of whether they are used or not. @@ -2977,6 +3027,26 @@ struct S __attribute__ ((vector_size (16))) foo; is invalid even if the size of the structure is the same as the size of the @code{int}. +@item selectany +The @code{selectany} attribute causes an initialized global variable to +have link-once semantics. When multiple definitions of the variable are +encountered by the linker, the first is selected and the remainder are +discarded. Following usage by the Microsoft compiler, the linker is told +@emph{not} to warn about size or content differences of the multiple +definitions. + +Although the primary usage of this attribute is for POD types, the +attribute can also be applied to global C++ objects that are initialized +by a constructor. In this case, the static initialization and destruction +code for the object is emitted in each translation defining the object, +but the calls to the constructor and destructor are protected by a +link-once guard variable. + +The @code{selectany} attribute is only available on Microsoft Windows +targets. You can use @code{__declspec (selectany)} as a synonym for +@code{__attribute__ ((selectany))} for compatibility with other +compilers. + @item weak The @code{weak} attribute is described in @xref{Function Attributes}. @@ -3183,7 +3253,7 @@ struct my_unpacked_struct int i; @}; -struct my_packed_struct __attribute__ ((__packed__)) +struct __attribute__ ((__packed__)) my_packed_struct @{ char c; int i; @@ -4512,6 +4582,132 @@ is a suitable definition of the @code{offsetof} macro. In C++, @var{type} may be dependent. In either case, @var{member} may consist of a single identifier, or a sequence of member accesses and array references. +@node Atomic Builtins +@section Built-in functions for atomic memory access + +The following builtins are intended to be compatible with those described +in the @cite{Intel Itanium Processor-specific Application Binary Interface}, +section 7.4. As such, they depart from the normal GCC practice of using +the ``__builtin_'' prefix, and further that they are overloaded such that +they work on multiple types. + +The definition given in the Intel documentation allows only for the use of +the types @code{int}, @code{long}, @code{long long} as well as their unsigned +counterparts. GCC will allow any integral scalar or pointer type that is +1, 2, 4 or 8 bytes in length. + +Not all operations are supported by all target processors. If a particular +operation cannot be implemented on the target processor, a warning will be +generated and a call an external function will be generated. The external +function will carry the same name as the builtin, with an additional suffix +@samp{_@var{n}} where @var{n} is the size of the data type. + +@c ??? Should we have a mechanism to suppress this warning? This is almost +@c useful for implementing the operation under the control of an external +@c mutex. + +In most cases, these builtins are considered a @dfn{full barrier}. That is, +no memory operand will be moved across the operation, either forward or +backward. Further, instructions will be issued as necessary to prevent the +processor from speculating loads across the operation and from queuing stores +after the operation. + +All of the routines are are described in the Intel documentation to take +``an optional list of variables protected by the memory barrier''. It's +not clear what is meant by that; it could mean that @emph{only} the +following variables are protected, or it could mean that these variables +should in addition be protected. At present GCC ignores this list and +protects all variables which are globally accessible. If in the future +we make some use of this list, an empty list will continue to mean all +globally accessible variables. + +@table @code +@item @var{type} __sync_fetch_and_add (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_fetch_and_sub (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_fetch_and_or (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_fetch_and_and (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_fetch_and_xor (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_fetch_and_nand (@var{type} *ptr, @var{type} value, ...) +@findex __sync_fetch_and_add +@findex __sync_fetch_and_sub +@findex __sync_fetch_and_or +@findex __sync_fetch_and_and +@findex __sync_fetch_and_xor +@findex __sync_fetch_and_nand +These builtins perform the operation suggested by the name, and +returns the value that had previously been in memory. That is, + +@smallexample +@{ tmp = *ptr; *ptr @var{op}= value; return tmp; @} +@{ tmp = *ptr; *ptr = ~tmp & value; return tmp; @} // nand +@end smallexample + +@item @var{type} __sync_add_and_fetch (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_sub_and_fetch (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_or_and_fetch (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_and_and_fetch (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_xor_and_fetch (@var{type} *ptr, @var{type} value, ...) +@itemx @var{type} __sync_nand_and_fetch (@var{type} *ptr, @var{type} value, ...) +@findex __sync_add_and_fetch +@findex __sync_sub_and_fetch +@findex __sync_or_and_fetch +@findex __sync_and_and_fetch +@findex __sync_xor_and_fetch +@findex __sync_nand_and_fetch +These builtins perform the operation suggested by the name, and +return the new value. That is, + +@smallexample +@{ *ptr @var{op}= value; return *ptr; @} +@{ *ptr = ~*ptr & value; return *ptr; @} // nand +@end smallexample + +@item bool __sync_bool_compare_and_swap (@var{type} *ptr, @var{type} oldval @var{type} newval, ...) +@itemx @var{type} __sync_val_compare_and_swap (@var{type} *ptr, @var{type} oldval @var{type} newval, ...) +@findex __sync_bool_compare_and_swap +@findex __sync_val_compare_and_swap +These builtins perform an atomic compare and swap. That is, if the current +value of @code{*@var{ptr}} is @var{oldval}, then write @var{newval} into +@code{*@var{ptr}}. + +The ``bool'' version returns true if the comparison is successful and +@var{newval} was written. The ``val'' version returns the contents +of @code{*@var{ptr}} before the operation. + +@item __sync_synchronize (...) +@findex __sync_synchronize +This builtin issues a full memory barrier. + +@item @var{type} __sync_lock_test_and_set (@var{type} *ptr, @var{type} value, ...) +@findex __sync_lock_test_and_set +This builtin, as described by Intel, is not a traditional test-and-set +operation, but rather an atomic exchange operation. It writes @var{value} +into @code{*@var{ptr}}, and returns the previous contents of +@code{*@var{ptr}}. + +Many targets have only minimal support for such locks, and do not support +a full exchange operation. In this case, a target may support reduced +functionality here by which the @emph{only} valid value to store is the +immediate constant 1. The exact value actually stored in @code{*@var{ptr}} +is implementation defined. + +This builtin is not a full barrier, but rather an @dfn{acquire barrier}. +This means that references after the builtin cannot move to (or be +speculated to) before the builtin, but previous memory stores may not +be globally visible yet, and previous memory loads may not yet be +satisfied. + +@item void __sync_lock_release (@var{type} *ptr, ...) +@findex __sync_lock_release +This builtin releases the lock acquired by @code{__sync_lock_test_and_set}. +Normally this means writing the constant 0 to @code{*@var{ptr}}. + +This builtin is not a full barrier, but rather a @dfn{release barrier}. +This means that all previous memory stores are globally visible, and all +previous memory loads have been satisfied, but following memory reads +are not prevented from being speculated to before the barrier. +@end table + @node Other Builtins @section Other built-in functions provided by GCC @cindex built-in functions @@ -4837,6 +5033,8 @@ identifier, or a sequence of member accesses and array references. @findex sqrtl @findex sscanf @findex stpcpy +@findex stpncpy +@findex strcasecmp @findex strcat @findex strchr @findex strcmp @@ -4846,9 +5044,11 @@ identifier, or a sequence of member accesses and array references. @findex strfmon @findex strftime @findex strlen +@findex strncasecmp @findex strncat @findex strncmp @findex strncpy +@findex strndup @findex strpbrk @findex strrchr @findex strspn @@ -4920,9 +5120,10 @@ Outside strict ISO C mode (@option{-ansi}, @option{-std=c89} or @code{scalb}, @code{signbit}, @code{signbitf}, @code{signbitl}, @code{significandf}, @code{significandl}, @code{significand}, @code{sincosf}, @code{sincosl}, @code{sincos}, @code{stpcpy}, -@code{strdup}, @code{strfmon}, @code{toascii}, @code{y0f}, @code{y0l}, -@code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, @code{ynl} and -@code{yn} +@code{stpncpy}, @code{strcasecmp}, @code{strdup}, @code{strfmon}, +@code{strncasecmp}, @code{strndup}, @code{toascii}, @code{y0f}, +@code{y0l}, @code{y0}, @code{y1f}, @code{y1l}, @code{y1}, @code{ynf}, +@code{ynl} and @code{yn} may be handled as built-in functions. All these functions have corresponding versions prefixed with @code{__builtin_}, which may be used even in strict C89 @@ -5261,11 +5462,11 @@ type is @code{long double}. @deftypefn {Built-in Function} double __builtin_inf (void) Similar to @code{__builtin_huge_val}, except a warning is generated if the target floating-point format does not support infinities. -This function is suitable for implementing the ISO C99 macro @code{INFINITY}. @end deftypefn @deftypefn {Built-in Function} float __builtin_inff (void) Similar to @code{__builtin_inf}, except the return type is @code{float}. +This function is suitable for implementing the ISO C99 macro @code{INFINITY}. @end deftypefn @deftypefn {Built-in Function} {long double} __builtin_infl (void) @@ -9130,7 +9331,6 @@ test specifically for GNU C++ (@pxref{Common Predefined Macros,, Predefined Macros,cpp,The GNU C Preprocessor}). @menu -* Min and Max:: C++ Minimum and maximum operators. * Volatiles:: What constitutes an access to a volatile object. * Restricted Pointers:: C99 restricted pointers and references. * Vague Linkage:: Where G++ puts inlines, vtables and such. @@ -9147,51 +9347,6 @@ Predefined Macros,cpp,The GNU C Preprocessor}). * Backwards Compatibility:: Compatibilities with earlier definitions of C++. @end menu -@node Min and Max -@section Minimum and Maximum Operators in C++ - -It is very convenient to have operators which return the ``minimum'' or the -``maximum'' of two arguments. In GNU C++ (but not in GNU C), - -@table @code -@item @var{a} ? @var{b} -@findex >? -@cindex maximum operator -is the @dfn{maximum}, returning the larger of the numeric values @var{a} -and @var{b}. -@end table - -These operations are not primitive in ordinary C++, since you can -use a macro to return the minimum of two things in C++, as in the -following example. - -@smallexample -#define MIN(X,Y) ((X) < (Y) ? : (X) : (Y)) -@end smallexample - -@noindent -You might then use @w{@samp{int min = MIN (i, j);}} to set @var{min} to -the minimum value of variables @var{i} and @var{j}. - -However, side effects in @code{X} or @code{Y} may cause unintended -behavior. For example, @code{MIN (i++, j++)} will fail, incrementing -the smaller counter twice. The GNU C @code{typeof} extension allows you -to write safe macros that avoid this kind of problem (@pxref{Typeof}). -However, writing @code{MIN} and @code{MAX} as macros also forces you to -use function-call notation for a fundamental arithmetic operation. -Using GNU C++ extensions, you can write @w{@samp{int min = i ?} are built into the compiler, they properly -handle expressions with side-effects; @w{@samp{int min = i++ ?}) and +their compound forms (@samp{?=}) have been deprecated +and will be removed in a future version. Code using these operators +should be modified to use @code{std::min} and @code{std::max} instead. + The named return value extension has been deprecated, and is now removed from G++. diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi index 3278a4b5a97..d932ab94ae8 100644 --- a/gcc/doc/gcov.texi +++ b/gcc/doc/gcov.texi @@ -42,6 +42,7 @@ test code coverage in your programs. * Invoking Gcov:: How to use gcov. * Gcov and Optimization:: Using gcov with GCC optimization. * Gcov Data Files:: The files used by gcov. +* Cross-profiling:: Data file relocation. @end menu @node Gcov Intro @@ -207,7 +208,7 @@ option is not supplied, it defaults to the current directory. @item -u @itemx --unconditional-branches -When branch counts are given, include those of unconditional branches. +When branch probabilities are given, include those of unconditional branches. Unconditional branches are normally not interesting. @end table @@ -232,9 +233,27 @@ program source code. The format is Additional block information may succeed each line, when requested by command line option. The @var{execution_count} is @samp{-} for lines -containing no code and @samp{#####} for lines which were never -executed. Some lines of information at the start have @var{line_number} -of zero. +containing no code and @samp{#####} for lines which were never executed. +Some lines of information at the start have @var{line_number} of zero. + +The preamble lines are of the form + +@smallexample +-:0:@var{tag}:@var{value} +@end smallexample + +The ordering and number of these preamble lines will be augmented as +@command{gcov} development progresses --- do not rely on them remaining +unchanged. Use @var{tag} to locate a particular preamble line. + +The additional block information is of the form + +@smallexample +@var{tag} @var{information} +@end smallexample + +The @var{information} is human readable, but designed to be simple +enough for machine parsing too. When printing percentages, 0% and 100% are only printed when the values are @emph{exactly} 0% and 100% respectively. Other values which would @@ -278,7 +297,6 @@ Here is a sample: -: 1:#include -: 2: -: 3:int main (void) -function main called 1 returned 1 blocks executed 75% 1: 4:@{ 1: 5: int i, total; -: 6: @@ -307,7 +325,6 @@ counts, and the output looks like this: -: 1:#include -: 2: -: 3:int main (void) -function main called 1 returned 1 blocks executed 75% 1: 4:@{ 1: 4-block 0 1: 5: int i, total; @@ -390,6 +407,10 @@ call 0 called 1 returned 100% -: 17:@} @end smallexample +For each function, a line is printed showing how many times the function +is called, how many times it returns and what percentage of the +function's blocks were executed. + For each basic block, a line is printed after the last line of the basic block describing the branch or call that ends the basic block. There can be multiple branches and calls listed for a single source line if there @@ -511,3 +532,42 @@ information. The full details of the file format is specified in @file{gcov-io.h}, and functions provided in that header file should be used to access the coverage files. + +@node Cross-profiling +@section Data file relocation to support cross-profiling + +Running the program will cause profile output to be generated. For each +source file compiled with @option{-fprofile-arcs}, an accompanying @file{.gcda} +file will be placed in the object file directory. That implicitly requires +running the program on the same system as it was built or having the same +absolute directory structure on the target system. The program will try +to create the needed directory structure, if it is not already present. + +To support cross-profiling, a program compiled with @option{-fprofile-arcs} +can relocate the data files based on two environment variables: + +@itemize @bullet +@item +GCOV_PREFIX contains the prefix to add to the absolute paths +in the object file. Prefix must be absolute as well, otherwise its +value is ignored. The default is no prefix. + +@item +GCOV_PREFIX_STRIP indicates the how many initial directory names to strip off +the hardwired absolute paths. Default value is 0. + +@emph{Note:} GCOV_PREFIX_STRIP has no effect if GCOV_PREFIX is undefined, empty +or non-absolute. +@end itemize + +For example, if the object file @file{/user/build/foo.o} was built with +@option{-fprofile-arcs}, the final executable will try to create the data file +@file{/user/build/foo.gcda} when running on the target system. This will +fail if the corresponding directory does not exist and it is unable to create +it. This can be overcome by, for example, setting the environment as +@samp{GCOV_PREFIX=/target/run} and @samp{GCOV_PREFIX_STRIP=1}. Such a +setting will name the data file @file{/target/run/build/foo.gcda}. + +You must move the data files to the expected directory tree in order to +use them for profile directed optimizations (@option{--use-profile}), or to +use the the @command{gcov} tool. diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 0a629a73f29..80a655b8948 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -442,7 +442,7 @@ Please refer to the @uref{http://gcc.gnu.org/releases.html,,releases web page} for information on how to obtain GCC@. The full distribution includes the C, C++, Objective-C, Fortran 77, Fortran -(in case of GCC 3.5 and later), Java, and Ada (in case of GCC 3.1 and later) +(in case of GCC 4.0 and later), Java, and Ada (in case of GCC 3.1 and later) compilers. The full distribution also includes runtime libraries for C++, Objective-C, Fortran 77, Fortran, and Java. In GCC 3.0 and later versions, GNU compiler testsuites are also included in the full distribution. @@ -973,12 +973,6 @@ systems that support conditional traps). Division by zero checks use the break instruction. @end table -@item --enable-altivec -Specify that the target supports AltiVec vector enhancements. This -option will adjust the ABI for AltiVec enhancements, as well as generate -AltiVec code when appropriate. This option is only available for -PowerPC systems. - @item --enable-__cxa_atexit Define if you want to use __cxa_atexit, rather than atexit, to register C++ destructors for local statics and global objects. @@ -1041,6 +1035,13 @@ particularly useful if you intend to use several versions of GCC in parallel. This is currently supported by @samp{libgfortran}, @samp{libjava}, @samp{libmudflap}, @samp{libstdc++}, and @samp{libobjc}. +@item --with-java-home=@var{dirname} +This @samp{libjava} option overrides the default value of the +@samp{java.home} system property. It is also used to set +@samp{sun.boot.class.path} to @file{@var{dirname}/lib/rt.jar}. By +default @samp{java.home} is set to @file{@var{prefix}} and +@samp{sun.boot.class.path} to +@file{@var{datadir}/java/libgcj-@var{version}.jar}. @item --enable-languages=@var{lang1},@var{lang2},@dots{} Specify that only a particular subset of compilers and @@ -1051,13 +1052,15 @@ their runtime libraries should be built. For a list of valid values for grep language= */config-lang.in @end smallexample Currently, you can use any of the following: -@code{ada}, @code{c}, @code{c++}, @code{f77}, @code{f95}, @code{java}, -@code{objc}, @code{obj-c++}. -Building the Ada compiler has special requirements, see below.@* -If you do not pass this flag, all languages available in the @file{gcc} -sub-tree will be configured. Re-defining @code{LANGUAGES} when calling -@samp{make bootstrap} @strong{does not} work anymore, as those -language sub-directories might not have been configured! +@code{all}, @code{ada}, @code{c}, @code{c++}, @code{f95}, @code{java}, +@code{objc}, @code{obj-c++}, @code{treelang}. +Building the Ada compiler has special requirements, see below. +If you do not pass this flag, or specify the option @code{all}, then all +default languages available in the @file{gcc} sub-tree will be configured. +Ada, Objective-C++, and treelang are not default languages; the rest are. +Re-defining @code{LANGUAGES} when calling @samp{make bootstrap} +@strong{does not} work anymore, as those language sub-directories might +not have been configured! @item --disable-libada Specify that the run-time libraries and tools used by GNAT should not @@ -1105,29 +1108,29 @@ controlled by the Makefiles. @item --enable-checking @itemx --enable-checking=@var{list} -When you specify this option, the compiler is built to perform checking -of tree node types when referencing fields of that node, and some other -internal consistency checks. This does not change the generated code, -but adds error checking within the compiler. This will slow down the -compiler and may only work properly if you are building the compiler -with GCC@. This is on by default when building from CVS or snapshots, -but off for releases. More control over the checks may be had by -specifying @var{list}; the categories of checks available are -@samp{release}, @samp{assert}, @samp{misc}, @samp{tree}, @samp{gc}, -@samp{rtl}, @samp{rtlflag}, @samp{fold}, @samp{gcac} and -@samp{valgrind}. The @samp{release} category enables only those checks -suitable for release builds, currently this is just @samp{assert}. The -check @samp{valgrind} requires the external @command{valgrind} -simulator, available from @uref{http://valgrind.kde.org/}. The checks -@samp{rtl}, @samp{gcac} and @samp{valgrind} are very expensive. The -default when @var{list} is not specified is -@samp{assert,misc,tree,gc,rtlflag}. That is also the default for -development builds, when @samp{--enable-checking} is not specified. For -release builds the default, when @samp{--enable-checking} is not given, -is @samp{release}. To disable all checking, @samp{--disable-checking} -must be explicitly requested. Disabling assertions will make the -compiler slightly faster but increase the risk of undetected internal -errors causing wrong code to be generated. +When you specify this option, the compiler is built to perform internal +consistency checks of the requested complexity. This does not change the +generated code, but adds error checking within the compiler. This will +slow down the compiler and may only work properly if you are building +the compiler with GCC@. This is @samp{yes} by default when building +from CVS or snapshots, but @samp{release} for releases. More control +over the checks may be had by specifying @var{list}. The categories of +checks available are @samp{yes} (most common checks +@samp{assert,misc,tree,gc,rtlflag,runtime}), @samp{no} (no checks at +all), @samp{all} (all but @samp{valgrind}), @samp{release} (cheapest +checks @samp{assert,runtime}) or @samp{none} (same as @samp{no}). +Individual checks can be enabled with these flags @samp{assert}, +@samp{fold}, @samp{gc}, @samp{gcac} @samp{misc}, @samp{rtl}, +@samp{rtlflag}, @samp{runtime}, @samp{tree}, and @samp{valgrind}. + +The @samp{valgrind} check requires the external @command{valgrind} +simulator, available from @uref{http://valgrind.kde.org/}. The +@samp{rtl}, @samp{gcac} and @samp{valgrind} checks are very expensive. +To disable all checking, @samp{--disable-checking} or +@samp{--enable-checking=none} must be explicitly requested. Disabling +assertions will make the compiler and runtime slightly faster but +increase the risk of undetected internal errors causing wrong code to be +generated. @item --enable-coverage @itemx --enable-coverage=@var{level} @@ -1829,7 +1832,7 @@ testsuite at @file{libjava/testsuite/libjava.mauve/mauve}, or by specifying the location of that tree when invoking @samp{make}, as in @samp{make MAUVEDIR=~/mauve check}. -@uref{http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html,,Jacks} +@uref{http://sources.redhat.com/mauve/,,Jacks} is a free testsuite that tests Java compiler front ends. This suite can be run as part of libgcj testing by placing the Jacks tree within the libjava testsuite at @file{libjava/testsuite/libjava.jacks/jacks}. @@ -2025,8 +2028,8 @@ Free Software Foundation}, though such manuals may not be for the most recent version of GCC@. If you would like to generate online HTML documentation, do @samp{cd -@var{objdir}; make html} and HTML will be generated for the manuals in -@file{@var{objdir}/HTML}. +@var{objdir}; make html} and HTML will be generated for the gcc manuals in +@file{@var{objdir}/gcc/HTML}. @html
@@ -2166,59 +2169,61 @@ GNU Compiler Collection on your machine. @ifhtml @itemize @item -@uref{#alpha*-*-*,,alpha*-*-*} +@uref{#alpha-x-x,,alpha*-*-*} @item -@uref{#alpha*-dec-osf*,,alpha*-dec-osf*} +@uref{#alpha-dec-osf,,alpha*-dec-osf*} @item -@uref{#alphaev5-cray-unicosmk*,,alphaev5-cray-unicosmk*} +@uref{#alphaev5-cray-unicosmk,,alphaev5-cray-unicosmk*} @item -@uref{#arc-*-elf,,arc-*-elf} +@uref{#arc-x-elf,,arc-*-elf} @item -@uref{#arm-*-elf,,arm-*-elf} -@uref{#arm-*-coff,,arm-*-coff} -@uref{#arm-*-aout,,arm-*-aout} +@uref{#arm-x-elf,,arm-*-elf} +@uref{#arm-x-coff,,arm-*-coff} +@uref{#arm-x-aout,,arm-*-aout} @item -@uref{#xscale-*-*,,xscale-*-*} +@uref{#xscale-x-x,,xscale-*-*} @item @uref{#avr,,avr} @item +@uref{#bfin,,Blackfin} +@item @uref{#c4x,,c4x} @item @uref{#dos,,DOS} @item -@uref{#*-*-freebsd*,,*-*-freebsd*} +@uref{#x-x-freebsd,,*-*-freebsd*} @item @uref{#h8300-hms,,h8300-hms} @item -@uref{#hppa*-hp-hpux*,,hppa*-hp-hpux*} +@uref{#hppa-hp-hpux,,hppa*-hp-hpux*} @item -@uref{#hppa*-hp-hpux10,,hppa*-hp-hpux10} +@uref{#hppa-hp-hpux10,,hppa*-hp-hpux10} @item -@uref{#hppa*-hp-hpux11,,hppa*-hp-hpux11} +@uref{#hppa-hp-hpux11,,hppa*-hp-hpux11} @item -@uref{#*-*-linux-gnu,,*-*-linux-gnu} +@uref{#x-x-linux-gnu,,*-*-linux-gnu} @item -@uref{#ix86-*-linux*aout,,i?86-*-linux*aout} +@uref{#ix86-x-linuxaout,,i?86-*-linux*aout} @item -@uref{#ix86-*-linux*,,i?86-*-linux*} +@uref{#ix86-x-linux,,i?86-*-linux*} @item -@uref{#ix86-*-sco3.2v5*,,i?86-*-sco3.2v5*} +@uref{#ix86-x-sco32v5,,i?86-*-sco3.2v5*} @item -@uref{#ix86-*-udk,,i?86-*-udk} +@uref{#ix86-x-solaris210,,i?86-*-solaris2.10} @item -@uref{#ix86-*-esix,,i?86-*-esix} +@uref{#ix86-x-udk,,i?86-*-udk} @item -@uref{#ia64-*-linux,,ia64-*-linux} +@uref{#ia64-x-linux,,ia64-*-linux} @item -@uref{#ia64-*-hpux*,,ia64-*-hpux*} +@uref{#ia64-x-hpux,,ia64-*-hpux*} @item -@uref{#*-ibm-aix*,,*-ibm-aix*} +@uref{#x-ibm-aix,,*-ibm-aix*} @item -@uref{#ip2k-*-elf,,ip2k-*-elf} +@uref{#ip2k-x-elf,,ip2k-*-elf} @item -@uref{#iq2000-*-elf,,iq2000-*-elf} +@uref{#iq2000-x-elf,,iq2000-*-elf} @item -@uref{#m32r-*-elf,,m32r-*-elf} +@uref{#m32r-x-elf,,m32r-*-elf} @item @uref{#m6811-elf,,m6811-elf} @item @@ -2226,63 +2231,61 @@ GNU Compiler Collection on your machine. @item @uref{#m68k-hp-hpux,,m68k-hp-hpux} @item -@uref{#mips-*-*,,mips-*-*} +@uref{#mips-x-x,,mips-*-*} @item @uref{#mips-sgi-irix5,,mips-sgi-irix5} @item @uref{#mips-sgi-irix6,,mips-sgi-irix6} @item -@uref{#powerpc*-*-*,,powerpc*-*-*, powerpc-*-sysv4} -@item -@uref{#powerpc-*-darwin*,,powerpc-*-darwin*} +@uref{#powerpc-x-x,,powerpc*-*-*, powerpc-*-sysv4} @item -@uref{#powerpc-*-elf,,powerpc-*-elf, powerpc-*-sysv4} +@uref{#powerpc-x-darwin,,powerpc-*-darwin*} @item -@uref{#powerpc-*-linux-gnu*,,powerpc-*-linux-gnu*} +@uref{#powerpc-x-elf,,powerpc-*-elf, powerpc-*-sysv4} @item -@uref{#powerpc-*-netbsd*,,powerpc-*-netbsd*} +@uref{#powerpc-x-linux-gnu,,powerpc*-*-linux-gnu*} @item -@uref{#powerpc-*-eabiaix,,powerpc-*-eabiaix} +@uref{#powerpc-x-netbsd,,powerpc-*-netbsd*} @item -@uref{#powerpc-*-eabisim,,powerpc-*-eabisim} +@uref{#powerpc-x-eabisim,,powerpc-*-eabisim} @item -@uref{#powerpc-*-eabi,,powerpc-*-eabi} +@uref{#powerpc-x-eabi,,powerpc-*-eabi} @item -@uref{#powerpcle-*-elf,,powerpcle-*-elf, powerpcle-*-sysv4} +@uref{#powerpcle-x-elf,,powerpcle-*-elf, powerpcle-*-sysv4} @item -@uref{#powerpcle-*-eabisim,,powerpcle-*-eabisim} +@uref{#powerpcle-x-eabisim,,powerpcle-*-eabisim} @item -@uref{#powerpcle-*-eabi,,powerpcle-*-eabi} +@uref{#powerpcle-x-eabi,,powerpcle-*-eabi} @item -@uref{#s390-*-linux*,,s390-*-linux*} +@uref{#s390-x-linux,,s390-*-linux*} @item -@uref{#s390x-*-linux*,,s390x-*-linux*} +@uref{#s390x-x-linux,,s390x-*-linux*} @item -@uref{#s390x-ibm-tpf*,,s390x-ibm-tpf*} +@uref{#s390x-ibm-tpf,,s390x-ibm-tpf*} @item -@uref{#*-*-solaris2*,,*-*-solaris2*} +@uref{#x-x-solaris2,,*-*-solaris2*} @item -@uref{#sparc-sun-solaris2*,,sparc-sun-solaris2*} +@uref{#sparc-sun-solaris2,,sparc-sun-solaris2*} @item -@uref{#sparc-sun-solaris2.7,,sparc-sun-solaris2.7} +@uref{#sparc-sun-solaris27,,sparc-sun-solaris2.7} @item -@uref{#sparc-*-linux*,,sparc-*-linux*} +@uref{#sparc-x-linux,,sparc-*-linux*} @item -@uref{#sparc64-*-solaris2*,,sparc64-*-solaris2*} +@uref{#sparc64-x-solaris2,,sparc64-*-solaris2*} @item -@uref{#sparcv9-*-solaris2*,,sparcv9-*-solaris2*} +@uref{#sparcv9-x-solaris2,,sparcv9-*-solaris2*} @item -@uref{#*-*-sysv*,,*-*-sysv*} +@uref{#x-x-sysv,,*-*-sysv*} @item @uref{#vax-dec-ultrix,,vax-dec-ultrix} @item -@uref{#*-*-vxworks*,,*-*-vxworks*} +@uref{#x-x-vxworks,,*-*-vxworks*} @item -@uref{#x86_64-*-*,,x86_64-*-*, amd64-*-*} +@uref{#x86-64-x-x,,x86_64-*-*, amd64-*-*} @item -@uref{#xtensa-*-elf,,xtensa-*-elf} +@uref{#xtensa-x-elf,,xtensa-*-elf} @item -@uref{#xtensa-*-linux*,,xtensa-*-linux*} +@uref{#xtensa-x-linux,,xtensa-*-linux*} @item @uref{#windows,,Microsoft Windows} @item @@ -2293,7 +2296,7 @@ GNU Compiler Collection on your machine. @itemize @item -@uref{#elf_targets,,all ELF targets} (SVR4, Solaris 2, etc.) +@uref{#elf,,all ELF targets} (SVR4, Solaris 2, etc.) @end itemize @end ifhtml @@ -2302,7 +2305,7 @@ GNU Compiler Collection on your machine.
@end html -@heading @anchor{alpha*-*-*}alpha*-*-* +@heading @anchor{alpha-x-x}alpha*-*-* This section contains general configuration information for all alpha-based platforms using ELF (in particular, ignore this section for @@ -2317,7 +2320,7 @@ shared libraries. @html
@end html -@heading @anchor{alpha*-dec-osf*}alpha*-dec-osf* +@heading @anchor{alpha-dec-osf}alpha*-dec-osf* Systems using processors that implement the DEC Alpha architecture and are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq Tru64 UNIX) operating system, for example the DEC Alpha AXP systems. @@ -2398,7 +2401,7 @@ provide a fix shortly. @html
@end html -@heading @anchor{alphaev5-cray-unicosmk*}alphaev5-cray-unicosmk* +@heading @anchor{alphaev5-cray-unicosmk}alphaev5-cray-unicosmk* Cray T3E systems running Unicos/Mk. This port is incomplete and has many known bugs. We hope to improve the @@ -2425,15 +2428,15 @@ failure. @html
@end html -@heading @anchor{arc-*-elf}arc-*-elf +@heading @anchor{arc-x-elf}arc-*-elf Argonaut ARC processor. This configuration is intended for embedded systems. @html
@end html -@heading @anchor{arm-*-elf}arm-*-elf -@heading @anchor{xscale-*-*}xscale-*-* +@heading @anchor{arm-x-elf}arm-*-elf +@heading @anchor{xscale-x-x}xscale-*-* ARM-family processors. Subtargets that use the ELF object format require GNU binutils 2.13 or newer. Such subtargets include: @code{arm-*-freebsd}, @code{arm-*-netbsdelf}, @code{arm-*-*linux}, @@ -2442,7 +2445,7 @@ require GNU binutils 2.13 or newer. Such subtargets include: @html
@end html -@heading @anchor{arm-*-coff}arm-*-coff +@heading @anchor{arm-x-coff}arm-*-coff ARM-family processors. Note that there are two different varieties of PE format subtarget supported: @code{arm-wince-pe} and @code{arm-pe} as well as a standard COFF target @code{arm-*-coff}. @@ -2450,7 +2453,7 @@ of PE format subtarget supported: @code{arm-wince-pe} and @html
@end html -@heading @anchor{arm-*-aout}arm-*-aout +@heading @anchor{arm-x-aout}arm-*-aout ARM-family processors. These targets support the AOUT file format: @code{arm-*-aout}, @code{arm-*-netbsd}. @@ -2496,6 +2499,23 @@ indicates that you should upgrade to a newer version of the binutils. @html
@end html +@heading @anchor{bfin}Blackfin + +The Blackfin processor, an Analog Devices DSP. +@ifnothtml +@xref{Blackfin Options,, Blackfin Options, gcc, Using and Porting the GNU +Compiler Collection (GCC)}, +@end ifnothtml +@ifhtml +See ``Blackfin Options'' in the main manual +@end ifhtml + +More information, and a version of binutils with support for this processor, +is available at @uref{http://blackfin.uclinux.org} + +@html +
+@end html @heading @anchor{c4x}c4x Texas Instruments TMS320C3x and TMS320C4x Floating Point Digital Signal @@ -2576,7 +2596,7 @@ and includes all the necessary compilation tools and libraries. @html
@end html -@heading @anchor{*-*-freebsd*}*-*-freebsd* +@heading @anchor{x-x-freebsd}*-*-freebsd* The version of binutils installed in @file{/usr/bin} probably works with this release of GCC@. However, on FreeBSD 4, bootstrapping against the @@ -2637,7 +2657,7 @@ longer a multiple of 2 bytes. @html
@end html -@heading @anchor{hppa*-hp-hpux*}hppa*-hp-hpux* +@heading @anchor{hppa-hp-hpux}hppa*-hp-hpux* Support for HP-UX version 9 and older was discontinued in GCC 3.4. We @emph{highly} recommend using gas/binutils on all hppa platforms; @@ -2665,7 +2685,7 @@ configuring if you want a model other than PROCESSOR_8000. The macro TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different default scheduling model is desired. -As of GCC 3.5, GCC uses the UNIX 95 namespace for HP-UX 10.10 +As of GCC 4.0, GCC uses the UNIX 95 namespace for HP-UX 10.10 through 11.00, and the UNIX 98 namespace for HP-UX 11.11 and later. This namespace change might cause problems when bootstrapping with an earlier version of GCC or the HP compiler as essentially the same @@ -2680,7 +2700,7 @@ More specific information to @samp{hppa*-hp-hpux*} targets follows. @html
@end html -@heading @anchor{hppa*-hp-hpux10}hppa*-hp-hpux10 +@heading @anchor{hppa-hp-hpux10}hppa*-hp-hpux10 For hpux10.20, we @emph{highly} recommend you pick up the latest sed patch @code{PHCO_19798} from HP@. HP has two sites which provide patches free of @@ -2706,10 +2726,10 @@ the 3-stage comparison test to fail during a @samp{make bootstrap}. You should be able to continue by saying @samp{make all} after getting the failure from @samp{make bootstrap}. -GCC 3.5 requires CVS binutils as of April 28, 2004 or later. Earlier +GCC 4.0 requires CVS binutils as of April 28, 2004 or later. Earlier versions require binutils 2.8 or later. -The C++ ABI has changed incompatibly in GCC 3.5. COMDAT subspaces are +The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are used for one-only code and data. This resolves many of the previous problems in using C++ on this target. However, the ABI is not compatible with the one implemented under HP-UX 11 using secondary definitions. @@ -2717,7 +2737,7 @@ with the one implemented under HP-UX 11 using secondary definitions. @html
@end html -@heading @anchor{hppa*-hp-hpux11}hppa*-hp-hpux11 +@heading @anchor{hppa-hp-hpux11}hppa*-hp-hpux11 GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot be used to compile GCC 3.0 and up. @@ -2782,7 +2802,7 @@ This has been been reported to sometimes occur in unified builds of binutils and GCC@. GCC 3.0 through 3.2 require binutils 2.11 or above. GCC 3.3 through -GCC 3.5 require binutils 2.14 or later. +GCC 4.0 require binutils 2.14 or later. Although the HP assembler can be used for an initial build, it shouldn't be used with any languages other than C and perhaps Fortran due to its @@ -2849,7 +2869,7 @@ This port still is undergoing significant development. @html
@end html -@heading @anchor{*-*-linux-gnu}*-*-linux-gnu +@heading @anchor{x-x-linux-gnu}*-*-linux-gnu Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present in glibc 2.2.5 and later. More information is available in the @@ -2858,14 +2878,14 @@ libstdc++-v3 documentation. @html
@end html -@heading @anchor{ix86-*-linux*aout}i?86-*-linux*aout +@heading @anchor{ix86-x-linuxaout}i?86-*-linux*aout Use this configuration to generate @file{a.out} binaries on Linux-based GNU systems. This configuration is being superseded. @html
@end html -@heading @anchor{ix86-*-linux*}i?86-*-linux* +@heading @anchor{ix86-x-linux}i?86-*-linux* As of GCC 3.3, binutils 2.13.1 or later is required for this platform. See @uref{http://gcc.gnu.org/PR10877,,bug 10877} for more information. @@ -2877,7 +2897,7 @@ found on @uref{http://www.bitwizard.nl/sig11/,,www.bitwizard.nl}. @html
@end html -@heading @anchor{ix86-*-sco3.2v5*}i?86-*-sco3.2v5* +@heading @anchor{ix86-x-sco32v5}i?86-*-sco3.2v5* Use this for the SCO OpenServer Release 5 family of operating systems. Unlike earlier versions of GCC, the ability to generate COFF with this @@ -2921,7 +2941,19 @@ GCC, version 2.95.3. It is useful for bootstrapping this version. @html
@end html -@heading @anchor{ix86-*-udk}i?86-*-udk +@heading @anchor{ix86-x-solaris210}i?86-*-solaris2.10 +Use this for Solaris 10 or later on x86 and x86-64 systems. This +configuration is supported by GCC 4.0 and later versions only. + +It is recommended that you configure GCC to use the GNU assembler in +@file{/usr/sfw/bin/gas} but the Sun linker, using the options +@option{--with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld +--with-ld=/usr/ccs/bin/ld}. + +@html +
+@end html +@heading @anchor{ix86-x-udk}i?86-*-udk This target emulates the SCO Universal Development Kit and requires that package be installed. (If it is installed, you will have a @@ -2957,7 +2989,7 @@ have installed. @html
@end html -@heading @anchor{ia64-*-linux}ia64-*-linux +@heading @anchor{ia64-x-linux}ia64-*-linux IA-64 processor (also known as IPF, or Itanium Processor Family) running GNU/Linux. @@ -2977,7 +3009,7 @@ more major ABI changes are expected. @html
@end html -@heading @anchor{ia64-*-hpux*}ia64-*-hpux* +@heading @anchor{ia64-x-hpux}ia64-*-hpux* Building GCC on this target requires the GNU Assembler. The bundled HP assembler will not work. To prevent GCC from using the wrong assembler, the option @option{--with-gnu-as} may be necessary. @@ -2992,12 +3024,16 @@ removed and the system libunwind library will always be used.
@end html -@heading @anchor{*-ibm-aix*}*-ibm-aix* +@heading @anchor{x-ibm-aix}*-ibm-aix* Support for AIX version 3 and older was discontinued in GCC 3.4. AIX Make frequently has problems with GCC makefiles. GNU Make 3.79.1 or newer is recommended to build on this platform. +``out of memory'' bootstrap failures may indicate a problem with +process resource limits (ulimit). Hard limits are configured in the +@file{/etc/security/limits} system configuration file. + To speed up the configuration phases of bootstrapping and installing GCC, one may use GNU Bash instead of AIX @command{/bin/sh}, e.g., @@ -3117,7 +3153,7 @@ switch and using the configure option @option{--with-cpu-@var{cpu_type}}. @html
@end html -@heading @anchor{ip2k-*-elf}ip2k-*-elf +@heading @anchor{ip2k-x-elf}ip2k-*-elf Ubicom IP2022 micro controller. This configuration is intended for embedded systems. There are no standard Unix configurations. @@ -3127,14 +3163,14 @@ Use @samp{configure --target=ip2k-elf --enable-languages=c} to configure GCC@. @html
@end html -@heading @anchor{iq2000-*-elf}iq2000-*-elf +@heading @anchor{iq2000-x-elf}iq2000-*-elf Vitesse IQ2000 processors. These are used in embedded applications. There are no standard Unix configurations. @html
@end html -@heading @anchor{m32r-*-elf}m32r-*-elf +@heading @anchor{m32r-x-elf}m32r-*-elf Renesas M32R processor. This configuration is intended for embedded systems. @@ -3208,7 +3244,7 @@ to look like: @html
@end html -@heading @anchor{mips-*-*}mips-*-* +@heading @anchor{mips-x-x}mips-*-* If on a MIPS system you get an error message saying ``does not have gp sections for all it's [sic] sectons [sic]'', don't worry about it. This happens whenever you use GAS with the MIPS linker, but there is not @@ -3354,7 +3390,7 @@ information about using GCC on IRIX platforms. @html
@end html -@heading @anchor{powerpc*-*-*}powerpc-*-* +@heading @anchor{powerpc-x-x}powerpc-*-* You can specify a default version for the @option{-mcpu=@var{cpu_type}} switch by using the configure option @option{--with-cpu-@var{cpu_type}}. @@ -3362,7 +3398,7 @@ switch by using the configure option @option{--with-cpu-@var{cpu_type}}. @html
@end html -@heading @anchor{powerpc-*-darwin*}powerpc-*-darwin* +@heading @anchor{powerpc-x-darwin}powerpc-*-darwin* PowerPC running Darwin (Mac OS X kernel). Pre-installed versions of Mac OS X may not include any developer tools, @@ -3380,22 +3416,22 @@ are generally for backwards compatibility and best avoided. @html
@end html -@heading @anchor{powerpc-*-elf}powerpc-*-elf, powerpc-*-sysv4 +@heading @anchor{powerpc-x-elf}powerpc-*-elf, powerpc-*-sysv4 PowerPC system in big endian mode, running System V.4. @html
@end html -@heading @anchor{powerpc-*-linux-gnu*}powerpc-*-linux-gnu* +@heading @anchor{powerpc-x-linux-gnu}powerpc*-*-linux-gnu* You will need -@uref{ftp://ftp.kernel.org/pub/linux/devel/binutils,,binutils 2.13.90.0.10} +@uref{ftp://ftp.kernel.org/pub/linux/devel/binutils,,binutils 2.15} or newer for a working GCC@. @html
@end html -@heading @anchor{powerpc-*-netbsd*}powerpc-*-netbsd* +@heading @anchor{powerpc-x-netbsd}powerpc-*-netbsd* PowerPC system in big endian mode running NetBSD@. To build the documentation you will need Texinfo version 4.2 (NetBSD 1.5.1 included Texinfo version 3.12). @@ -3403,51 +3439,51 @@ Texinfo version 3.12). @html
@end html -@heading @anchor{powerpc-*-eabisim}powerpc-*-eabisim +@heading @anchor{powerpc-x-eabisim}powerpc-*-eabisim Embedded PowerPC system in big endian mode for use in running under the PSIM simulator. @html
@end html -@heading @anchor{powerpc-*-eabi}powerpc-*-eabi +@heading @anchor{powerpc-x-eabi}powerpc-*-eabi Embedded PowerPC system in big endian mode. @html
@end html -@heading @anchor{powerpcle-*-elf}powerpcle-*-elf, powerpcle-*-sysv4 +@heading @anchor{powerpcle-x-elf}powerpcle-*-elf, powerpcle-*-sysv4 PowerPC system in little endian mode, running System V.4. @html
@end html -@heading @anchor{powerpcle-*-eabisim}powerpcle-*-eabisim +@heading @anchor{powerpcle-x-eabisim}powerpcle-*-eabisim Embedded PowerPC system in little endian mode for use in running under the PSIM simulator. @html
@end html -@heading @anchor{powerpcle-*-eabi}powerpcle-*-eabi +@heading @anchor{powerpcle-x-eabi}powerpcle-*-eabi Embedded PowerPC system in little endian mode. @html
@end html -@heading @anchor{s390-*-linux*}s390-*-linux* +@heading @anchor{s390-x-linux}s390-*-linux* S/390 system running GNU/Linux for S/390@. @html
@end html -@heading @anchor{s390x-*-linux*}s390x-*-linux* +@heading @anchor{s390x-x-linux}s390x-*-linux* zSeries system (64-bit) running GNU/Linux for zSeries@. @html
@end html -@heading @anchor{s390x-ibm-tpf*}s390x-ibm-tpf* +@heading @anchor{s390x-ibm-tpf}s390x-ibm-tpf* zSeries system (64-bit) running TPF@. This platform is supported as cross-compilation target only. @@ -3458,7 +3494,7 @@ supported as cross-compilation target only. @c with 2.0 until 2.6, 7, 8, etc. Solaris 1 was a marketing name for @c SunOS 4 releases which we don't use to avoid confusion. Solaris @c alone is too unspecific and must be avoided. -@heading @anchor{*-*-solaris2*}*-*-solaris2* +@heading @anchor{x-x-solaris2}*-*-solaris2* Sun does not ship a C compiler with Solaris 2. To bootstrap and install GCC you first have to install a pre-built compiler, see the @@ -3542,7 +3578,7 @@ SPARC, 117172-11 or newer for Intel) that address this problem. @html
@end html -@heading @anchor{sparc-sun-solaris2*}sparc-sun-solaris2* +@heading @anchor{sparc-sun-solaris2}sparc-sun-solaris2* When GCC is configured to use binutils 2.11.2 or later the binaries produced are smaller than the ones produced using Sun's native tools; @@ -3613,7 +3649,7 @@ or later system, the canonical target triplet must be specified as the @html
@end html -@heading @anchor{sparc-sun-solaris2.7}sparc-sun-solaris2.7 +@heading @anchor{sparc-sun-solaris27}sparc-sun-solaris2.7 Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8 @@ -3664,7 +3700,7 @@ This bug has been fixed in the final 5.0 version of the assembler. @html
@end html -@heading @anchor{sparc-*-linux*}sparc-*-linux* +@heading @anchor{sparc-x-linux}sparc-*-linux* GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4 or newer on this platform. All earlier binutils and glibc @@ -3674,7 +3710,7 @@ releases mishandled unaligned relocations on @code{sparc-*-*} targets. @html
@end html -@heading @anchor{sparc64-*-solaris2*}sparc64-*-solaris2* +@heading @anchor{sparc64-x-solaris2}sparc64-*-solaris2* The following compiler flags must be specified in the configure step in order to bootstrap this target with the Sun compiler: @@ -3689,14 +3725,14 @@ specifies the SPARC-V9 architecture to the Sun linker and assembler. @html
@end html -@heading @anchor{sparcv9-*-solaris2*}sparcv9-*-solaris2* +@heading @anchor{sparcv9-x-solaris2}sparcv9-*-solaris2* This is a synonym for sparc64-*-solaris2*. @html
@end html -@heading @anchor{#*-*-sysv*}*-*-sysv* +@heading @anchor{x-x-sysv}*-*-sysv* On System V release 3, you may get this error message while linking: @@ -3737,7 +3773,7 @@ in some cases (for example, when @code{alloca} is used). @html
@end html -@heading @anchor{*-*-vxworks*}*-*-vxworks* +@heading @anchor{x-x-vxworks}*-*-vxworks* Support for VxWorks is in flux. At present GCC supports @emph{only} the very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC@. We welcome patches for other architectures supported by VxWorks 5.5. @@ -3772,7 +3808,7 @@ VxWorks will incorporate this module.) @html
@end html -@heading @anchor{x86_64-*-*}x86_64-*-*, amd64-*-* +@heading @anchor{x86-64-x-x}x86_64-*-*, amd64-*-* GCC supports the x86-64 architecture implemented by the AMD64 processor (amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD@. @@ -3782,7 +3818,7 @@ both 64-bit x86-64 and 32-bit x86 code (via the @option{-m32} switch). @html
@end html -@heading @anchor{xtensa-*-elf}xtensa-*-elf +@heading @anchor{xtensa-x-elf}xtensa-*-elf This target is intended for embedded Xtensa systems using the @samp{newlib} C library. It uses ELF but does not support shared @@ -3800,7 +3836,7 @@ which you can use to replace the default header file. @html
@end html -@heading @anchor{xtensa-*-linux*}xtensa-*-linux* +@heading @anchor{xtensa-x-linux}xtensa-*-linux* This target is for Xtensa systems running GNU/Linux. It supports ELF shared objects and the GNU C library (glibc). It also generates @@ -3885,7 +3921,7 @@ current GCC) is to be found in the GCC texinfo manual. @html
@end html -@heading @anchor{elf_targets}all ELF targets (SVR4, Solaris 2, etc.) +@heading @anchor{elf}all ELF targets (SVR4, Solaris 2, etc.) C++ support is significantly better on ELF targets if you use the @uref{./configure.html#with-gnu-ld,,GNU linker}; duplicate copies of diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 2e08c4f3cdb..1a96988ced2 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -185,10 +185,10 @@ in the following sections. -fno-default-inline -fvisibility-inlines-hidden @gol -Wabi -Wctor-dtor-privacy @gol -Wnon-virtual-dtor -Wreorder @gol --Weffc++ -Wno-deprecated @gol +-Weffc++ -Wno-deprecated -Wstrict-null-sentinel @gol -Wno-non-template-friend -Wold-style-cast @gol -Woverloaded-virtual -Wno-pmf-conversions @gol --Wsign-promo -Wsynth} +-Wsign-promo} @item Objective-C and Objective-C++ Language Options @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling @@ -197,16 +197,23 @@ Objective-C and Objective-C++ Dialects}. -fconstant-string-class=@var{class-name} @gol -fgnu-runtime -fnext-runtime @gol -fno-nil-receivers @gol +-fobjc-call-cxx-cdtors @gol +-fobjc-direct-dispatch @gol -fobjc-exceptions @gol +-fobjc-gc @gol -freplace-objc-classes @gol -fzero-link @gol -gen-decls @gol --Wno-protocol -Wselector -Wundeclared-selector} +-Wassign-intercept @gol +-Wno-protocol -Wselector @gol +-Wstrict-selector-match @gol +-Wundeclared-selector} @item Language Independent Options @xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}. @gccoptlist{-fmessage-length=@var{n} @gol --fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}} +-fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}} @gol +-fdiagnostics-show-options @item Warning Options @xref{Warning Options,,Options to Request or Suppress Warnings}. @@ -221,13 +228,15 @@ Objective-C and Objective-C++ Dialects}. -Wformat-security -Wformat-y2k @gol -Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol -Wimport -Wno-import -Winit-self -Winline @gol +-Wno-int-to-pointer-cast @gol -Wno-invalid-offsetof -Winvalid-pch @gol -Wlarger-than-@var{len} -Wlong-long @gol -Wmain -Wmissing-braces -Wmissing-field-initializers @gol -Wmissing-format-attribute -Wmissing-include-dirs @gol -Wmissing-noreturn @gol -Wno-multichar -Wnonnull -Wpacked -Wpadded @gol --Wparentheses -Wpointer-arith -Wredundant-decls @gol +-Wparentheses -Wpointer-arith -Wno-pointer-to-int-cast @gol +-Wredundant-decls @gol -Wreturn-type -Wsequence-point -Wshadow @gol -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 @gol -Wswitch -Wswitch-default -Wswitch-enum @gol @@ -269,6 +278,7 @@ Objective-C and Objective-C++ Dialects}. -fdump-tree-salias @gol -fdump-tree-fre@r{[}-@var{n}@r{]} @gol -ftree-vectorizer-verbose=@var{n} @gol +-fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol -feliminate-unused-debug-symbols -fmem-report -fprofile-arcs -ftree-based-profiling @gol -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol @@ -288,7 +298,7 @@ Objective-C and Objective-C++ Dialects}. -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol -fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol -fcaller-saves -fcprop-registers -fcse-follow-jumps @gol --fcse-follow-jumps -fcse-skip-blocks -fcx-limited-range -fdata-sections @gol +-fcse-skip-blocks -fcx-limited-range -fdata-sections @gol -fdelayed-branch -fdelete-null-pointer-checks @gol -fexpensive-optimizations -ffast-math -ffloat-store @gol -fforce-addr -fforce-mem -ffunction-sections @gol @@ -323,7 +333,8 @@ Objective-C and Objective-C++ Dialects}. -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink @gol -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol --ftree-salias @gol +-ftree-salias -fweb @gol +-ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop @gol --param @var{name}=@var{value} -O -O0 -O1 -O2 -O3 -Os} @@ -401,6 +412,11 @@ Objective-C and Objective-C++ Dialects}. @gccoptlist{-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol -mcall-prologues -mno-tablejump -mtiny-stack -mint8} +@emph{Blackfin Options} +@gccoptlist{-momit-leaf-frame-pointer -mno-omit-leaf-frame-pointer -mcsync @gol +-mno-csync -mlow-64k -mno-low64k -mid-shared-library @gol +-mno-id-shared-library -mshared-library-id=@var{n} @gol} + @emph{CRIS Options} @gccoptlist{-mcpu=@var{cpu} -march=@var{cpu} -mtune=@var{cpu} @gol -mmax-stack-frame=@var{n} -melinux-stacksize=@var{n} @gol @@ -550,7 +566,7 @@ Objective-C and Objective-C++ Dialects}. -mxgot -mno-xgot -mgp32 -mgp64 -mfp32 -mfp64 @gol -mhard-float -msoft-float -msingle-float -mdouble-float @gol -mpaired-single -mips3d @gol --mint64 -mlong64 -mlong32 -msym32 -mno-sym32 @gol +-mlong64 -mlong32 -msym32 -mno-sym32 @gol -G@var{num} -membedded-data -mno-embedded-data @gol -muninit-const-in-rodata -mno-uninit-const-in-rodata @gol -msplit-addresses -mno-split-addresses @gol @@ -620,10 +636,12 @@ See RS/6000 and PowerPC Options. -minsert-sched-nops=@var{scheme} @gol -mcall-sysv -mcall-netbsd @gol -maix-struct-return -msvr4-struct-return @gol --mabi=altivec -mabi=no-altivec @gol --mabi=spe -mabi=no-spe @gol +-mabi=@var{abi-type} @gol +-misel -mno-isel @gol -misel=yes -misel=no @gol +-mspe -mno-spe @gol -mspe=yes -mspe=no @gol +-mvrsave -mno-vrsave @gol -mfloat-gprs=yes -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol -mprototype -mno-prototype @gol -msim -mmvme -mads -myellowknife -memb -msdata @gol @@ -648,7 +666,10 @@ See RS/6000 and PowerPC Options. -mb -ml -mdalign -mrelax @gol -mbigtable -mfmovd -mhitachi -mrenesas -mno-renesas -mnomacsave @gol -mieee -misize -mpadstruct -mspace @gol --mprefergot -musermode} +-mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol +-mdivsi3_libfunc=@var{name} @gol +-madjust-unroll -mindexed-addressing -mgettrcost=@var{number} -mpt-fixed @gol + -minvalid-symbols} @emph{SPARC Options} @gccoptlist{-mcpu=@var{cpu-type} @gol @@ -801,6 +822,13 @@ 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@. +@item @var{file}.mm +@itemx @var{file}.M +Objective-C++ source code which must be preprocessed. + +@item @var{file}.mii +Objective-C++ source code which should not be preprocessed. + @item @var{file}.hh @itemx @var{file}.H C++ header file to be turned into a precompiled header. @@ -1732,6 +1760,14 @@ to filter out those warnings. @opindex Wno-deprecated Do not warn about usage of deprecated features. @xref{Deprecated Features}. +@item -Wstrict-null-sentinel @r{(C++ only)} +@opindex Wstrict-null-sentinel +Warn also about the use of an uncasted @code{NULL} as sentinel. When +compiling only with GCC this is a valid sentinel, as @code{NULL} is defined +to @code{__null}. Although it is a null pointer constant not a null pointer, +it is guaranteed to of the same size as a pointer. But this use is +not portable across different compilers. + @item -Wno-non-template-friend @r{(C++ only)} @opindex Wno-non-template-friend Disable warnings when non-templatized friend functions are declared @@ -1794,13 +1830,6 @@ enumerated type to a signed type, over a conversion to an unsigned type of the same size. Previous versions of G++ would try to preserve unsignedness, but the standard mandates the current behavior. -@item -Wsynth @r{(C++ only)} -@opindex Wsynth -@cindex warning for synthesized methods -@cindex synthesized methods, warning -Warn when G++'s synthesis behavior does not match that of cfront. For -instance: - @smallexample struct A @{ operator int (); @@ -1881,6 +1910,35 @@ 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. +@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. + +@item -fobjc-direct-dispatch +@opindex fobjc-direct-dispatch +Allow fast jumps to the message dispatcher. On Darwin this is +accomplished via the comm page. + @item -fobjc-exceptions @opindex fobjc-exceptions Enable syntactic support for structured exception handling in Objective-C, @@ -1973,6 +2031,10 @@ Unlike Java, Objective-C does not allow for entire methods to be marked @code{@@synchronized} blocks is allowed, and will cause the guarding object to be unlocked properly. +@item -fobjc-gc +@opindex fobjc-gc +Enable garbage collection (GC) in Objective-C and Objective-C++ programs. + @item -freplace-objc-classes @opindex freplace-objc-classes Emit a special marker instructing @command{ld(1)} not to statically link in @@ -1999,6 +2061,11 @@ for individual class implementations to be modified during program execution. Dump interface declarations for all classes seen in the source file to a file named @file{@var{sourcename}.decl}. +@item -Wassign-intercept +@opindex Wassign-intercept +Warn whenever an Objective-C assignment is being intercepted by the +garbage collector. + @item -Wno-protocol @opindex Wno-protocol If a class is declared to implement a protocol, a warning is issued for @@ -2022,6 +2089,15 @@ 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. +@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. + @item -Wundeclared-selector @opindex Wundeclared-selector Warn if a @code{@@selector(@dots{})} expression referring to an @@ -2080,6 +2156,13 @@ messages reporter to emit the same source location information (as prefix) for physical lines that result from the process of breaking a message which is too long to fit on a single line. +@item -fdiagnostics-show-options +@opindex fdiagnostics-show-options +This option instructs the diagnostic machinery to add text to each +diagnostic emitted, which indicates which command line option directly +controls that diagnostic, when such an option is known to the +diagnostic machinery. + @end table @node Warning Options @@ -2542,11 +2625,13 @@ get these warnings. If you want to warn about code which uses the uninitialized value of the variable in its own initializer, use the @option{-Winit-self} option. -These warnings occur only for variables that are candidates for -register allocation. Therefore, they do not occur for a variable that -is declared @code{volatile}, or whose address is taken, or whose size -is other than 1, 2, 4 or 8 bytes. Also, they do not occur for -structures, unions or arrays, even when they are in registers. +These warnings occur for individual uninitialized or clobbered +elements of structure, union or array variables as well as for +variables which are uninitialized or clobbered as a whole. They do +not occur for variables or elements declared @code{volatile}. Because +these warnings depend on optimization, the exact variables or elements +for which there are warnings will depend on the precise optimization +options and version of GCC used. Note that there may be no warning about a variable that is used only to compute a value that itself is never used, because such @@ -3159,7 +3244,7 @@ inline functions declared in system headers. The compiler uses a variety of heuristics to determine whether or not to inline a function. For example, the compiler takes into account -the size of the function being inlined and the the amount of inlining +the size of the function being inlined and the amount of inlining that has already been done in the current function. Therefore, seemingly insignificant changes in the source program can cause the warnings produced by @option{-Winline} to appear or disappear. @@ -3179,6 +3264,16 @@ warning about it. The restrictions on @samp{offsetof} may be relaxed in a future version of the C++ standard. +@item -Wno-int-to-pointer-cast @r{(C only)} +@opindex Wno-int-to-pointer-cast +Suppress warnings from casts to pointer type of an integer of a +different size. + +@item -Wno-pointer-to-int-cast @r{(C only)} +@opindex Wno-pointer-to-int-cast +Suppress warnings from casts from a pointer to an integer type of a +different size. + @item -Winvalid-pch @opindex Winvalid-pch Warn if a precompiled header (@pxref{Precompiled Headers}) is found in @@ -3392,6 +3487,7 @@ explicitly specified and it is not the final executable, otherwise it is the basename of the source file. In both cases any suffix is removed (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}). +@xref{Cross-profiling}. @cindex @command{gcov} @item --coverage @@ -3520,7 +3616,7 @@ conversion, to the file @file{@var{file}.18.ce2}. @opindex fdump-rtl-btl @opindex fdump-rtl-dbr @option{-dd} and @option{-fdump-rtl-btl} enable dumping after branch -target load optimization, to to @file{@var{file}.31.btl}. @option{-dd} +target load optimization, to @file{@var{file}.31.btl}. @option{-dd} and @option{-fdump-rtl-dbr} enable dumping after delayed branch scheduling, to @file{@var{file}.36.dbr}. @@ -3751,8 +3847,8 @@ numbers and line number note output. This makes it more feasible to use diff on debugging dumps for compiler invocations with different options, in particular with and without @option{-g}. -@item -fdump-translation-unit @r{(C and C++ only)} -@itemx -fdump-translation-unit-@var{options} @r{(C and C++ only)} +@item -fdump-translation-unit @r{(C++ only)} +@itemx -fdump-translation-unit-@var{options} @r{(C++ only)} @opindex fdump-translation-unit Dump a representation of the tree structure for the entire translation unit to a file. The file name is made by appending @file{.tu} to the @@ -3881,6 +3977,11 @@ appending @file{.alias} to the source file name. Dump each function after CCP@. The file name is made by appending @file{.ccp} to the source file name. +@item storeccp +@opindex fdump-tree-storeccp +Dump each function after STORE-CCP. The file name is made by appending +@file{.storeccp} to the source file name. + @item pre @opindex fdump-tree-pre Dump trees after partial redundancy elimination. The file name is made @@ -3891,6 +3992,16 @@ by appending @file{.pre} to the source file name. Dump trees after full redundancy elimination. The file name is made by appending @file{.fre} to the source file name. +@item copyprop +@opindex fdump-tree-copyprop +Dump trees after copy propagation. The file name is made +by appending @file{.copyprop} to the source file name. + +@item store_copyprop +@opindex fdump-tree-store_copyprop +Dump trees after store copy-propagation. The file name is made +by appending @file{.store_copyprop} to the source file name. + @item dce @opindex fdump-tree-dce Dump each function after dead code elimination. The file name is made by @@ -4158,10 +4269,10 @@ compilation time. -fif-conversion2 @gol -ftree-ccp @gol -ftree-dce @gol --ftree-dom @gol +-ftree-dominator-opts @gol -ftree-dse @gol -ftree-ter @gol --ftree-live_range_split @gol +-ftree-lrs @gol -ftree-sra @gol -ftree-copyrename @gol -ftree-fre @gol @@ -4747,6 +4858,17 @@ that are computed on all paths leading to the redundant computation. This analysis faster than PRE, though it exposes fewer redundancies. This flag is enabled by default at @option{-O} and higher. +@item -ftree-copy-prop +Perform copy propagation on trees. This pass eliminates unnecessary +copy operations. This flag is enabled by default at @option{-O} and +higher. + +@item -ftree-store-copy-prop +Perform copy propagation of memory loads and stores. This pass +eliminates unnecessary copy operations in memory references +(structures, global variables, arrays, etc). This flag is enabled by +default at @option{-O2} and higher. + @item -ftree-salias Perform structural alias analysis on trees. This flag is enabled by default at @option{-O} and higher. @@ -4756,8 +4878,15 @@ Perform forward store motion on trees. This flag is enabled by default at @option{-O} and higher. @item -ftree-ccp -Perform sparse conditional constant propagation (CCP) on trees. This flag -is enabled by default at @option{-O} and higher. +Perform sparse conditional constant propagation (CCP) on trees. This +pass only operates on local scalar variables and is enabled by default +at @option{-O} and higher. + +@item -ftree-store-ccp +Perform sparse conditional constant propagation (CCP) on trees. This +pass operates on both local scalar variables and memory stores and +loads (global variables, structures, arrays, etc). This flag is +enabled by default at @option{-O2} and higher. @item -ftree-dce Perform dead code elimination (DCE) on trees. This flag is enabled by @@ -4781,15 +4910,15 @@ at @option{-O} and higher. Perform linear loop transformations on tree. This flag can improve cache performance and allow further loop optimizations to take place. -@item -ftree-lim -Perform loop invariant motion on trees. This pass moves only invartiants that -would be hard to handle on rtl level (function calls, operations that expand to +@item -ftree-loop-im +Perform loop invariant motion on trees. This pass moves only invariants that +would be hard to handle at RTL level (function calls, operations that expand to nontrivial sequences of insns). With @option{-funswitch-loops} it also moves operands of conditions that are invariant out of the loop, so that we can use just trivial invariantness analysis in loop unswitching. The pass also includes store motion. -@item -fivcanon +@item -ftree-loop-ivcanon Create a canonical counter for number of iterations in the loop for that determining number of iterations requires complicated analysis. Later optimizations then may determine the number easily. Useful especially @@ -5447,6 +5576,11 @@ In each case, the @var{value} is an integer. The allowable choices for @var{name} are given in the following table: @table @gcctabopt +@item salias-max-implicit-fields +The maximum number of fields in a variable without direct +structure accesses for which structure aliasing will consider trying +to track each field. The default is 5 + @item sra-max-structure-size The maximum structure size, in bytes, at which the scalar replacement of aggregates (SRA) optimization will perform block copies. The @@ -5518,7 +5652,7 @@ This number sets the maximum number of instructions (counted in GCC's internal representation) in a single function that the tree inliner will consider for inlining. This only affects functions declared inline and methods implemented in a class declaration (C++). -The default value is 500. +The default value is 450. @item max-inline-insns-auto When you use @option{-finline-functions} (included in @option{-O3}), @@ -5526,7 +5660,7 @@ a lot of functions that would otherwise not be considered for inlining by the compiler will be investigated. To those functions, a different (more restrictive) limit compared to functions declared inline can be applied. -The default value is 120. +The default value is 90. @item large-function-insns The limit specifying really large functions. For functions larger than this @@ -5535,7 +5669,7 @@ limit after inlining inlining is constrained by to avoid extreme compilation time caused by non-linear algorithms used by the backend. This parameter is ignored when @option{-funit-at-a-time} is not used. -The default value is 3000. +The default value is 2700. @item large-function-growth Specifies maximal growth of large function caused by inlining in percents. @@ -5558,7 +5692,7 @@ For functions declared inline @option{--param max-inline-insns-recursive} is taken into acount. For function not declared inline, recursive inlining happens only when @option{-finline-functions} (included in @option{-O3}) is enabled and @option{--param max-inline-insns-recursive-auto} is used. The -default value is 500. +default value is 450. @item max-inline-recursive-depth @itemx max-inline-recursive-depth-auto @@ -5568,7 +5702,16 @@ For functions declared inline @option{--param max-inline-recursive-depth} is taken into acount. For function not declared inline, recursive inlining happens only when @option{-finline-functions} (included in @option{-O3}) is enabled and @option{--param max-inline-recursive-depth-auto} is used. The -default value is 500. +default value is 450. + +@item inline-call-cost +Specify cost of call instruction relative to simple arithmetics operations +(having cost of 1). Increasing this cost disqualifies inlining of non-leaf +functions and at the same time increases size of leaf function that is believed to +reduce function size by being inlined. In effect it increases amount of +inlining for code having large abstraction penalty (many functions that just +pass the arguments to other functions) and decrease inlining for code with low +abstraction penalty. The default value is 16. @item max-unrolled-insns The maximum number of instructions that a loop should have if that loop @@ -5621,6 +5764,10 @@ If number of candidates in the set is smaller than this value, we always try to remove unnecessary ivs from the set during its optimization when a new iv is added to the set. +@item scev-max-expr-size +Bound on size of expressions used in the scalar evolutions analyzer. +Large expressions slow the analyzer. + @item max-iterations-to-track The maximum number of iterations of a loop the brute force algorithm @@ -5764,6 +5911,18 @@ Small integer constants can use a shared data structure, reducing the compiler's memory usage and increasing its speed. This sets the maximum value of a shared integer constant's. The default value is 256. +@item min-virtual-mappings +Specifies the minimum number of virtual mappings in the incremental +SSA updater that should be registered to trigger the virtual mappings +heuristic defined by virtual-mappings-ratio. The default value is +100. + +@item virtual-mappings-ratio +If the number of virtual mappings is virtual-mappings-ratio bigger +than the number of virtual symbols to be updated, then the incremental +SSA updater switches to a full update for those symbols. The default +ratio is 3. + @end table @end table @@ -6728,6 +6887,7 @@ that macro, which enables you to change the defaults. * ARC Options:: * ARM Options:: * AVR Options:: +* Blackfin Options:: * CRIS Options:: * Darwin Options:: * DEC Alpha Options:: @@ -7179,6 +7339,57 @@ comply to the C standards, but it will provide you with smaller code size. @end table +@node Blackfin Options +@subsection Blackfin Options +@cindex Blackfin Options + +@table @gcctabopt +@item -momit-leaf-frame-pointer +@opindex momit-leaf-frame-pointer +Don't keep the frame pointer in a register for leaf functions. This +avoids the instructions to save, set up and restore frame pointers and +makes an extra register available in leaf functions. The option +@option{-fomit-frame-pointer} removes the frame pointer for all functions +which might make debugging harder. + +@item -mcsync +@opindex mcsync +When enabled, the compiler will ensure that the generated code does not +contain speculative loads after jump instructions. This option is enabled +by default. + +@item -mno-csync +@opindex mno-csync +Don't generate extra code to prevent speculative loads from occurring. + +@item -mlow-64k +@opindex mlow-64k +When enabled, the compiler is free to take advantage of the knowledge that +the entire program fits into the low 64k of memory. + +@item -mno-low-64k +@opindex mno-low-64k +Assume that the program is arbitrarily large. This is the default. + +@item -mid-shared-library +@opindex mid-shared-library +Generate code that supports shared libraries via the library ID method. +This allows for execute in place and shared libraries in an environment +without virtual memory management. This option implies @option{-fPIC}. + +@item -mno-id-shared-library +@opindex mno-id-shared-library +Generate code that doesn't assume ID based shared libraries are being used. +This is the default. + +@item -mshared-library-id=n +@opindex mshared-library-id +Specified the identification number of the ID based shared library being +compiled. Specifying a value of 0 will generate more compact code, specifying +other values will force the allocation of that number to the current +library but is no more space or time efficient than omitting this option. +@end table + @node CRIS Options @subsection CRIS Options @cindex CRIS Options @@ -7342,7 +7553,7 @@ The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or that GCC is targetting, like @option{-mcpu} or @option{-march}. The @option{-force_cpusubtype_ALL} option can be used to override this. -The Darwin tools vary in their behaviour when presented with an ISA +The Darwin tools vary in their behavior when presented with an ISA mismatch. The assembler, @file{as}, will only permit instructions to be used that are valid for the subtype of the file it is generating, so you cannot put 64-bit instructions in an @samp{ppc750} object file. @@ -9712,14 +9923,6 @@ support to be enabled. Use (do not use) the MIPS-3D ASE@. @xref{MIPS-3D Built-in Functions}. The option @option{-mips3d} implies @option{-mpaired-single}. -@item -mint64 -@opindex mint64 -Force @code{int} and @code{long} types to be 64 bits wide. See -@option{-mlong32} for an explanation of the default and the way -that the pointer size is determined. - -This option has been deprecated and will be removed in a future release. - @item -mlong64 @opindex mlong64 Force @code{long} types to be 64 bits wide. See @option{-mlong32} for @@ -9777,7 +9980,7 @@ This option is only meaningful in conjunction with @option{-membedded-data}. @opindex msplit-addresses @opindex mno-split-addresses Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler -relocation operators. This option has been superceded by +relocation operators. This option has been superseded by @option{-mexplicit-relocs} but is retained for backwards compatibility. @item -mexplicit-relocs @@ -10450,7 +10653,7 @@ Supported values for @var{cpu_type} are @samp{401}, @samp{403}, @samp{860}, @samp{970}, @samp{8540}, @samp{common}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{powerpc}, @samp{powerpc64}, -@samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64a}. +@samp{rios}, @samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64}. @option{-mcpu=common} selects a completely generic processor. Code generated under this option will run on any POWER or PowerPC processor. @@ -10506,6 +10709,12 @@ the AltiVec instruction set. You may also need to set @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI enhancements. +@item -mvrsave +@item -mno-vrsave +@opindex mvrsave +@opindex mno-vrsave +Generate VRSAVE instructions when generating AltiVec code. + @item -mabi=spe @opindex mabi=spe Extend the current ABI with SPE ABI extensions. This does not change @@ -10516,17 +10725,27 @@ ABI@. @opindex mabi=no-spe Disable Booke SPE ABI extensions for the current ABI@. -@item -misel=@var{yes/no} -@itemx -misel +@item -misel +@itemx -mno-isel @opindex misel +@opindex mno-isel This switch enables or disables the generation of ISEL instructions. -@item -mspe=@var{yes/no} -@itemx -mspe +@item -misel=@var{yes/no} +This switch has been deprecated. Use @option{-misel} and +@option{-mno-isel} instead. + +@item -mspe +@itemx -mno-isel @opindex mspe +@opindex mno-spe This switch enables or disables the generation of SPE simd instructions. +@item -mspe=@var{yes/no} +This option has been deprecated. Use @option{-mspe} and +@option{-mno-spe} instead. + @item -mfloat-gprs=@var{yes/single/double/no} @itemx -mfloat-gprs @opindex mfloat-gprs @@ -10843,15 +11062,11 @@ Return all structures in memory (as specified by the AIX ABI)@. Return structures smaller than 8 bytes in registers (as specified by the SVR4 ABI)@. -@item -mabi=altivec -@opindex mabi=altivec -Extend the current ABI with AltiVec ABI extensions. This does not -change the default ABI, instead it adds the AltiVec ABI extensions to -the current ABI@. - -@item -mabi=no-altivec -@opindex mabi=no-altivec -Disable AltiVec ABI extensions for the current ABI@. +@item -mabi=@var{abi-type} +@opindex mabi +Extend the current ABI with a particular extension, or remove such extension. +Valid values are @var{altivec}, @var{no-altivec}, @var{spe}, +@var{no-spe}@. @item -mprototype @itemx -mno-prototype @@ -11317,6 +11532,11 @@ Mark the @code{MAC} register as call-clobbered, even if @item -mieee @opindex mieee Increase IEEE-compliance of floating-point code. +At the moment, this is equivalent to @option{-fno-finite-math-only}. +When generating 16 bit SH opcodes, getting IEEE-conforming results for +comparisons of NANs / infinities incurs extra overhead in every +floating point comparison, therefore the default is set to +@option{-ffinite-math-only}. @item -misize @opindex misize @@ -11342,6 +11562,107 @@ Generate a library function call to invalidate instruction cache entries, after fixing up a trampoline. This library function call doesn't assume it can write to the whole memory address space. This is the default when the target is @code{sh-*-linux*}. + +@item -multcost=@var{number} +@opindex multcost=@var{number} +Set the cost to assume for a multiply insn. + +@item -mdiv=@var{strategy} +@opindex mdiv=@var{strategy} +Set the division strategy to use for SHmedia code. @var{strategy} must be +one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call, +inv:call2, inv:fp . +"fp" performs the operation in floating point. This has a very high latency, +but needs only a few instructions, so it might be a good choice if +your code has enough easily exploitable ILP to allow the compiler to +schedule the floating point instructions together with other instructions. +Division by zero causes a floating point exception. +"inv" uses integer operations to calculate the inverse of the divisor, +and then multiplies the dividend with the inverse. This strategy allows +cse and hoisting of the inverse calculation. Division by zero calculates +an unspecified result, but does not trap. +"inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities +have been found, or if the entire operation has been hoisted to the same +place, the last stages of the inverse calculation are intertwined with the +final multiply to reduce the overall latency, at the expense of using a few +more instructions, and thus offering fewer scheduling opportunities with +other code. +"call" calls a library function that usually implements the inv:minlat +strategy. +This gives high code density for m5-*media-nofpu compilations. +"call2" uses a different entry point of the same library function, where it +assumes that a pointer to a lookup table has already been set up, which +exposes the pointer load to cse / code hoisting optimizations. +"inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial +code generation, but if the code stays unoptimized, revert to the "call", +"call2", or "fp" strategies, respectively. Note that the +potentially-trapping side effect of division by zero is carried by a +separate instruction, so it is possible that all the integer instructions +are hoisted out, but the marker for the side effect stays where it is. +A recombination to fp operations or a call is not possible in that case. +"inv20u" and "inv20l" are variants of the "inv:minlat" strategy. In the case +that the inverse calculation was nor separated from the multiply, they speed +up division where the dividend fits into 20 bits (plus sign where applicable), +by inserting a test to skip a number of operations in this case; this test +slows down the case of larger dividends. inv20u assumes the case of a such +a small dividend to be unlikely, and inv20l assumes it to be likely. + +@item -mdivsi3_libfunc=@var{name} +@opindex mdivsi3_libfunc=@var{name} +Set the name of the library function used for 32 bit signed division to +@var{name}. This only affect the name used in the call and inv:call +division strategies, and the compiler will still expect the same +sets of input/output/clobbered registers as if this option was not present. + +@item -madjust-unroll +@opindex madjust-unroll +Throttle unrolling to avoid thrashing target registers. +This option only has an effect if the gcc code base supports the +TARGET_ADJUST_UNROLL_MAX target hook. + +@item -mindexed-addressing +@opindex mindexed-addressing +Enable the use of the indexed addressing mode for SHmedia32/SHcompact. +This is only safe if the hardware and/or OS implement 32 bit wrap-around +semantics for the indexed addressing mode. The architecture allows the +implementation of processors with 64 bit MMU, which the OS could use to +get 32 bit addressing, but since no current hardware implementation supports +this or any other way to make the indexed addressing mode safe to use in +the 32 bit ABI, the default is -mno-indexed-addressing. + +@item -mgettrcost=@var{number} +@opindex mgettrcost=@var{number} +Set the cost assumed for the gettr instruction to @var{number}. +The default is 2 if @option{-mpt-fixed} is in effect, 100 otherwise. + +@item -mpt-fixed +@opindex mpt-fixed +Assume pt* instructions won't trap. This will generally generate better +scheduled code, but is unsafe on current hardware. The current architecture +definition says that ptabs and ptrel trap when the target anded with 3 is 3. +This has the unintentional effect of making it unsafe to schedule ptabs / +ptrel before a branch, or hoist it out of a loop. For example, +__do_global_ctors, a part of libgcc that runs constructors at program +startup, calls functions in a list which is delimited by -1. With the +-mpt-fixed option, the ptabs will be done before testing against -1. +That means that all the constructors will be run a bit quicker, but when +the loop comes to the end of the list, the program crashes because ptabs +loads -1 into a target register. Since this option is unsafe for any +hardware implementing the current architecture specification, the default +is -mno-pt-fixed. Unless the user specifies a specific cost with +@option{-mgettrcost}, -mno-pt-fixed also implies @option{-mgettrcost=100}; +this deters register allocation using target registers for storing +ordinary integers. + +@item -minvalid-symbols +@opindex minvalid-symbols +Assume symbols might be invalid. Ordinary function symbols generated by +the compiler will always be valid to load with movi/shori/ptabs or +movi/shori/ptrel, but with assembler and/or linker tricks it is possible +to generate symbols that will cause ptabs / ptrel to trap. +This option is only meaningful when @option{-mno-pt-fixed} is in effect. +It will then prevent cross-basic-block cse, hoisting and most scheduling +of symbol loads. The default is @option{-mno-invalid-symbols}. @end table @node SPARC Options @@ -11544,7 +11865,7 @@ on SPARC-V9 processors in 64-bit environments: @item -mlittle-endian @opindex mlittle-endian Generate code for a processor running in little-endian mode. It is only -available for a few configurations and most notably not on Solaris. +available for a few configurations and most notably not on Solaris and Linux. @item -m32 @itemx -m64 @@ -12620,13 +12941,6 @@ build the project. To make builds faster, GCC allows users to `precompile' a header file; then, if builds can use the precompiled header file they will be much faster. -@strong{Caution:} There are a few known situations where GCC will -crash when trying to use a precompiled header. If you have trouble -with a precompiled header, you should remove the precompiled header -and compile without it. In addition, please use GCC's on-line -defect-tracking system to report any problems you encounter with -precompiled headers. @xref{Bugs}. - To create a precompiled header file, simply compile it as you would any other file, if necessary using the @option{-x} option to make the driver treat it as a C or C++ header file. You will probably want to use a @@ -12691,16 +13005,14 @@ the current compilation. You can't use a C precompiled header for a C++ compilation. @item -The precompiled header file must be produced by the same compiler -version and configuration as the current compilation is using. -The easiest way to guarantee this is to use the same compiler binary -for creating and using precompiled headers. +The precompiled header file must have been produced by the same compiler +binary as the current compilation is using. @item Any macros defined before the precompiled header is included must either be defined in the same way as when the precompiled header was generated, or must not affect the precompiled header, which usually -means that the they don't appear in the precompiled header at all. +means that they don't appear in the precompiled header at all. The @option{-D} option is one way to define a macro before a precompiled header is included; using a @code{#define} can also do it. @@ -12731,7 +13043,10 @@ which options are safe to change and which are not; the safest choice is to use exactly the same options when generating and using the precompiled header. The following are known to be safe: -@gccoptlist{-fpreprocessed -pedantic-errors} +@gccoptlist{-fpreprocessed +-fsched-interblock -fsched-spec -fsched-spec-load -fsched-spec-load-dangerous +-fsched-verbose= -fschedule-insns +-pedantic-errors} @end itemize diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index d3312f75bc5..4feab32698e 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -1681,7 +1681,7 @@ A memory reference suitable for VFP load/store insns (reg+constant offset) A memory reference suitable for iWMMXt load/store instructions. @item Uq -A memory reference suitable for for the ARMv4 ldrsb instruction. +A memory reference suitable for the ARMv4 ldrsb instruction. @item AVR family---@file{avr.h} @table @code @@ -2069,6 +2069,102 @@ range of 1 to 2047. @end table +@item Blackfin family---@file{bfin.h} +@table @code +@item a +P register + +@item d +D register + +@item z +A call clobbered P register. + +@item D +Even-numbered D register + +@item W +Odd-numbered D register + +@item e +Accumulator register. + +@item A +Even-numbered accumulator register. + +@item B +Odd-numbered accumulator register. + +@item b +I register + +@item B +B register + +@item f +M register + +@item c +Registers used for circular buffering, i.e. I, B, or L registers. + +@item C +The CC register. + +@item x +Any D, P, B, M, I or L register. + +@item y +Additional registers typically used only in prologues and epilogues: RETS, +RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP. + +@item w +Any register except accumulators or CC. + +@item Ksh +Signed 16 bit integer (in the range -32768 to 32767) + +@item Kuh +Unsigned 16 bit integer (in the range 0 to 65535) + +@item Ks7 +Signed 7 bit integer (in the range -64 to 63) + +@item Ku7 +Unsigned 7 bit integer (in the range 0 to 127) + +@item Ku5 +Unsigned 5 bit integer (in the range 0 to 31) + +@item Ks4 +Signed 4 bit integer (in the range -8 to 7) + +@item Ks3 +Signed 3 bit integer (in the range -3 to 4) + +@item Ku3 +Unsigned 3 bit integer (in the range 0 to 7) + +@item P@var{n} +Constant @var{n}, where @var{n} is a single-digit constant in the range 0 to 4. + +@item M1 +Constant 255. + +@item M2 +Constant 65535. + +@item J +An integer constant with exactly a single bit set. + +@item L +An integer constant with all bits set except exactly one. + +@item H + +@item Q +Any SYMBOL_REF. +@end table + @item IP2K---@file{ip2k.h} @table @code @item a @@ -3840,6 +3936,153 @@ respectively, a low or moderate degree of temporal locality. Targets that do not support write prefetches or locality hints can ignore the values of operands 1 and 2. +@cindex @code{memory_barrier} instruction pattern +@item @samp{memory_barrier} + +If the target memory model is not fully synchronous, then this pattern +should be defined to an instruction that orders both loads and stores +before the instruction with respect to loads and stores after the instruction. +This pattern has no operands. + +@cindex @code{sync_compare_and_swap@var{mode}} instruction pattern +@item @samp{sync_compare_and_swap@var{mode}} + +This pattern, if defined, emits code for an atomic compare-and-swap +operation. Operand 1 is the memory on which the atomic operation is +performed. Operand 2 is the ``old'' value to be compared against the +current contents of the memory location. Operand 3 is the ``new'' value +to store in the memory if the compare succeeds. Operand 0 is the result +of the operation; it should contain the contents of the memory +before the operation. If the compare succeeds, this should obviously be +a copy of operand 2. + +This pattern must show that both operand 0 and operand 1 are modified. + +This pattern must issue any memory barrier instructions such that all +memory operations before the atomic operation occur before the atomic +operation and all memory operations after the atomic operation occur +after the atomic operation. + +@cindex @code{sync_compare_and_swap_cc@var{mode}} instruction pattern +@item @samp{sync_compare_and_swap_cc@var{mode}} + +This pattern is just like @code{sync_compare_and_swap@var{mode}}, except +it should act as if compare part of the compare-and-swap were issued via +@code{cmp@var{m}}. This comparison will only be used with @code{EQ} and +@code{NE} branches and @code{setcc} operations. + +Some targets do expose the success or failure of the compare-and-swap +operation via the status flags. Ideally we wouldn't need a separate +named pattern in order to take advantage of this, but the combine pass +does not handle patterns with multiple sets, which is required by +definition for @code{sync_compare_and_swap@var{mode}}. + +@cindex @code{sync_add@var{mode}} instruction pattern +@cindex @code{sync_sub@var{mode}} instruction pattern +@cindex @code{sync_ior@var{mode}} instruction pattern +@cindex @code{sync_and@var{mode}} instruction pattern +@cindex @code{sync_xor@var{mode}} instruction pattern +@cindex @code{sync_nand@var{mode}} instruction pattern +@item @samp{sync_add@var{mode}}, @samp{sync_sub@var{mode}} +@itemx @samp{sync_ior@var{mode}}, @samp{sync_and@var{mode}} +@itemx @samp{sync_xor@var{mode}}, @samp{sync_nand@var{mode}} + +These patterns emit code for an atomic operation on memory. +Operand 0 is the memory on which the atomic operation is performed. +Operand 1 is the second operand to the binary operator. + +The ``nand'' operation is @code{op0 & ~op1}. + +This pattern must issue any memory barrier instructions such that all +memory operations before the atomic operation occur before the atomic +operation and all memory operations after the atomic operation occur +after the atomic operation. + +If these patterns are not defined, the operation will be constructed +from a compare-and-swap operation, if defined. + +@cindex @code{sync_old_add@var{mode}} instruction pattern +@cindex @code{sync_old_sub@var{mode}} instruction pattern +@cindex @code{sync_old_ior@var{mode}} instruction pattern +@cindex @code{sync_old_and@var{mode}} instruction pattern +@cindex @code{sync_old_xor@var{mode}} instruction pattern +@cindex @code{sync_old_nand@var{mode}} instruction pattern +@item @samp{sync_old_add@var{mode}}, @samp{sync_old_sub@var{mode}} +@itemx @samp{sync_old_ior@var{mode}}, @samp{sync_old_and@var{mode}} +@itemx @samp{sync_old_xor@var{mode}}, @samp{sync_old_nand@var{mode}} + +These patterns are emit code for an atomic operation on memory, +and return the value that the memory contained before the operation. +Operand 0 is the result value, operand 1 is the memory on which the +atomic operation is performed, and operand 2 is the second operand +to the binary operator. + +This pattern must issue any memory barrier instructions such that all +memory operations before the atomic operation occur before the atomic +operation and all memory operations after the atomic operation occur +after the atomic operation. + +If these patterns are not defined, the operation will be constructed +from a compare-and-swap operation, if defined. + +@cindex @code{sync_new_add@var{mode}} instruction pattern +@cindex @code{sync_new_sub@var{mode}} instruction pattern +@cindex @code{sync_new_ior@var{mode}} instruction pattern +@cindex @code{sync_new_and@var{mode}} instruction pattern +@cindex @code{sync_new_xor@var{mode}} instruction pattern +@cindex @code{sync_new_nand@var{mode}} instruction pattern +@item @samp{sync_new_add@var{mode}}, @samp{sync_new_sub@var{mode}} +@itemx @samp{sync_new_ior@var{mode}}, @samp{sync_new_and@var{mode}} +@itemx @samp{sync_new_xor@var{mode}}, @samp{sync_new_nand@var{mode}} + +These patterns are like their @code{sync_old_@var{op}} counterparts, +except that they return the value that exists in the memory location +after the operation, rather than before the operation. + +@cindex @code{sync_lock_test_and_set@var{mode}} instruction pattern +@item @samp{sync_lock_test_and_set@var{mode}} + +This pattern takes two forms, based on the capabilities of the target. +In either case, operand 0 is the result of the operand, operand 1 is +the memory on which the atomic operation is performed, and operand 2 +is the value to set in the lock. + +In the ideal case, this operation is an atomic exchange operation, in +which the previous value in memory operand is copied into the result +operand, and the value operand is stored in the memory operand. + +For less capable targets, any value operand that is not the constant 1 +should be rejected with @code{FAIL}. In this case the target may use +an atomic test-and-set bit operation. The result operand should contain +1 if the bit was previously set and 0 if the bit was previously clear. +The true contents of the memory operand are implementation defined. + +This pattern must issue any memory barrier instructions such that the +pattern as a whole acts as an acquire barrier, that is all memory +operations after the pattern do not occur until the lock is acquired. + +If this pattern is not defined, the operation will be constructed from +a compare-and-swap operation, if defined. + +@cindex @code{sync_lock_release@var{mode}} instruction pattern +@item @samp{sync_lock_release@var{mode}} + +This pattern, if defined, releases a lock set by +@code{sync_lock_test_and_set@var{mode}}. Operand 0 is the memory +that contains the lock; operand 1 is the value to store in the lock. + +If the target doesn't implement full semantics for +@code{sync_lock_test_and_set@var{mode}}, any value operand which is not +the constant 0 should be rejected with @code{FAIL}, and the true contents +of the memory operand are implementation defined. + +This pattern must issue any memory barrier instructions such that the +pattern as a whole acts as a release barrier, that is the lock is +released only after all previous memory operations have completed. + +If this pattern is not defined, then a @code{memory_barrier} pattern +will be emitted, followed by a store of the value to the memory operand. + @end table @end ifset @@ -6111,7 +6354,7 @@ can be used for @acronym{RISC} processors, too. separated by commas. @var{patterns} is a string giving patterns of functional units -separated by comma. Currently pattern is is one unit or units +separated by comma. Currently pattern is one unit or units separated by white-spaces. The first construction (@samp{exclusion_set}) means that each @@ -6232,9 +6475,7 @@ the treatment of operator @samp{|} in the regular expressions. The usual treatment of the operator is to try the first alternative and, if the reservation is not possible, the second alternative. The nondeterministic treatment means trying all alternatives, some of them -may be rejected by reservations in the subsequent insns. You can not -query functional unit reservations in nondeterministic automaton -states. +may be rejected by reservations in the subsequent insns. @item @dfn{progress} means output of a progress bar showing how many states @@ -6477,7 +6718,7 @@ rtx-based construct, such as a @code{define_insn}, @menu * Defining Mode Macros:: Defining a new mode macro. -* String Substitutions:: Combining mode macros with string substitutions +* Substitutions:: Combining mode macros with substitutions * Examples:: Examples @end menu @@ -6523,14 +6764,15 @@ but that the @code{:SI} expansion has no such constraint. Macros are applied in the order they are defined. This can be significant if two macros are used in a construct that requires -string substitutions. @xref{String Substitutions}. +substitutions. @xref{Substitutions}. -@node String Substitutions -@subsubsection String Substitution in Mode Macros +@node Substitutions +@subsubsection Substitution in Mode Macros @findex define_mode_attr If an @file{.md} file construct uses mode macros, each version of the -construct will often need slightly different strings. For example: +construct will often need slightly different strings or modes. For +example: @itemize @bullet @item @@ -6541,6 +6783,11 @@ appropriate mode name for @var{m}. @item When a @code{define_insn} defines several instruction patterns, each instruction will often use a different assembler mnemonic. + +@item +When a @code{define_insn} requires operands with different modes, +using a macro for one of the operand modes usually requires a specific +mode for the other operand(s). @end itemize GCC supports such variations through a system of ``mode attributes''. @@ -6555,12 +6802,12 @@ upper case. You can define other attributes using: where @var{name} is the name of the attribute and @var{valuei} is the value associated with @var{modei}. -When GCC replaces some @var{:macro} with @var{:mode}, it will -scan each string in the pattern for sequences of the form -@code{<@var{macro}:@var{attr}>}, where @var{attr} is the name of -a mode attribute. If the attribute is defined for @var{mode}, the -whole @code{<...>} sequence will be replaced by the appropriate -attribute value. +When GCC replaces some @var{:macro} with @var{:mode}, it will scan +each string and mode in the pattern for sequences of the form +@code{<@var{macro}:@var{attr}>}, where @var{attr} is the name of a +mode attribute. If the attribute is defined for @var{mode}, the whole +@code{<...>} sequence will be replaced by the appropriate attribute +value. For example, suppose an @file{.md} file has: @@ -6574,6 +6821,15 @@ If one of the patterns that uses @code{:P} contains the string will use @code{"lw\t%0,%1"} and the @code{DI} version will use @code{"ld\t%0,%1"}. +Here is an example of using an attribute for a mode: + +@smallexample +(define_mode_macro LONG [SI DI]) +(define_mode_attr SHORT [(SI "HI") (DI "SI")]) +(define_insn ... + (sign_extend:LONG (match_operand: ...)) ...) +@end smallexample + The @code{@var{macro}:} prefix may be omitted, in which case the substitution will be attempted for every macro expansion. diff --git a/gcc/doc/options.texi b/gcc/doc/options.texi index 138ebdb838d..307a325e5de 100644 --- a/gcc/doc/options.texi +++ b/gcc/doc/options.texi @@ -25,15 +25,17 @@ blank lines. Comments may appear on their own line anywhere within the file and are preceded by semicolons. Whitespace is allowed before the semicolon. -The files can contain two types of record: language definitions and -option definitions. +The files can contain the following types of record: -A language definition record has two fields: the string -@samp{Language} and the name of the language. Once a language has -been declared in this way, it can be used as an option property. +@itemize @bullet +@item +A language definition record.  These records have two fields: the +string @samp{Language} and the name of the language.  Once a language +has been declared in this way, it can be used as an option property. @xref{Option properties}. -An option definition record has the following fields: +@item +An option definition record.  These records have the following fields: @enumerate @item @@ -59,6 +61,21 @@ used instead of the option's name and the text to the right of the tab forms the help text. This allows you to elaborate on what type of argument the option takes. +@item +A target mask record.  These records have one field of the form +@samp{Mask(@var{x})}.  The options-processing script will automatically +allocate a bit in @code{target_flags} (@pxref{Run-time Target}) for +each mask name @var{x} and set the macro @code{MASK_@var{x}} to the +appropriate bitmask.  It will also declare a @code{TARGET_@var{x}} +macro that has the value 1 when bit @code{MASK_@var{x}} is set and +0 otherwise. + +They are primarily intended to declare target masks that are not +associated with user options, either because these masks represent +internal switches or because the options are not available on all +configurations and yet the masks always need to be defined. +@end itemize + @node Option properties @section Option properties @@ -137,13 +154,20 @@ The variable specified by the @code{Var} property should be statically initialized to @var{value}. @item Mask(@var{name}) -The option is associated with a bit in the @code{target_flags} variable -(@pxref{Run-time Target}) and is active when that bit is set. +The option is associated with a bit in the @code{target_flags} +variable (@pxref{Run-time Target}) and is active when that bit is set. +You may also specify @code{Var} to select a variable other than +@code{target_flags}. -The options-processing script will automatically allocate a unique -bit for the option and set the macro @code{MASK_@var{name}} to the -appropriate bitmask. It will also declare a @code{TARGET_@var{name}} -macro that has the value 1 when the option is active and 0 otherwise. +The options-processing script will automatically allocate a unique bit +for the option. If the option is attached to @samp{target_flags}, +the script will set the macro @code{MASK_@var{name}} to the appropriate +bitmask. It will also declare a @code{TARGET_@var{name}} macro that has +the value 1 when the option is active and 0 otherwise. If you use @code{Var} +to attach the option to a different variable, the associated macros are +called @code{OPTION_MASK_@var{name}} and @code{OPTION_@var{name}} respectively. + +You can disable automatic bit allocation using @code{MaskExists}. @item InverseMask(@var{othername}) @itemx InverseMask(@var{othername}, @var{thisname}) @@ -152,10 +176,26 @@ The option is the inverse of another option that has the the options-processing script will declare a @code{TARGET_@var{thisname}} macro that is 1 when the option is active and 0 otherwise. +@item MaskExists +The mask specified by the @code{Mask} property already exists. +No @code{MASK} or @code{TARGET} definitions should be added to +@file{options.h} in response to this option record. + +The main purpose of this property is to support synonymous options. +The first option should use @samp{Mask(@var{name})} and the others +should use @samp{Mask(@var{name}) MaskExists}. + @item Report The state of the option should be printed by @option{-fverbose-asm}. @item Undocumented The option is deliberately missing documentation and should not be included in the @option{--help} output. + +@item Condition(@var{cond}) +The option should only be accepted if preprocessor condition +@var{cond} is true. Note that any C declarations associated with the +option will be present even if @var{cond} is false; @var{cond} simply +controls whether the option is accepted and whether it is printed in +the @option{--help} output. @end table diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi index fd4e323d90a..ad6110e7312 100644 --- a/gcc/doc/passes.texi +++ b/gcc/doc/passes.texi @@ -354,7 +354,7 @@ This pass transforms tail recursion into a loop. It is located in This pass sinks stores and assignments down the flowgraph closer to it's use point. The pass is located in @file{tree-ssa-sink.c} and is -described by @code{pass_sink_code} +described by @code{pass_sink_code}. @item Partial redundancy elimination @@ -362,6 +362,12 @@ This pass eliminates partially redundant computations, as well as performing load motion. The pass is located in @file{tree-ssa-pre.c} and is described by @code{pass_pre}. +Just before partial redundancy elimination, if +@option{-funsafe-math-optimizations} is on, GCC tries to convert +divisions to multiplications by the reciprocal. The pass is located +in @file{tree-ssa-math-opts.c} and is described by +@code{pass_cse_reciprocal}. + @item Loop optimization The main driver of the pass is placed in @file{tree-ssa-loop.c} @@ -399,6 +405,19 @@ The optimizations also use various utility functions contained in @file{tree-ssa-loop-manip.c}, @file{cfgloop.c}, @file{cfgloopanal.c} and @file{cfgloopmanip.c}. +Vectorization. This pass transforms loops to operate on vector types +instead of scalar types. Data parallelism across loop iterations is exploited +to group data elements from consecutive iterations into a vector and operate +on them in parallel. Depending on available target support the loop is +conceptually unrolled by a factor @code{VF} (vectorization factor), which is +the number of elements operated upon in parallel in each iteration, and the +@code{VF} copies of each scalar operation are fused to form a vector operation. +Additional loop transformations such as peeling and versioning may take place +to align the number of iterations, and to align the memory accesses in the loop. +The pass is implemented in @file{tree-vectorizer.c} (the main driver and general +utilities), @file{tree-vect-analyze.c} and @file{tree-vect-transform.c}. +Analysis of data references is in @file{tree-data-ref.c}. + @item Tree level if-conversion for vectorizer This pass applies if-conversion to simple loops to help vectorizer. diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi index 2e7bca7ec1e..f917c85e016 100644 --- a/gcc/doc/rtl.texi +++ b/gcc/doc/rtl.texi @@ -1390,7 +1390,7 @@ The @code{symbol_ref} contains a mode, which is usually @code{Pmode}. Usually that is the only mode for which a symbol is directly valid. @findex label_ref -@item (label_ref @var{label}) +@item (label_ref:@var{mode} @var{label}) Represents the value of an assembler label for code. It contains one operand, an expression, which must be a @code{code_label} or a @code{note} of type @code{NOTE_INSN_DELETED_LABEL} that appears in the instruction @@ -1399,6 +1399,9 @@ sequence to identify the place where the label should go. The reason for using a distinct expression type for code label references is so that jump optimization can distinguish them. +The @code{label_ref} contains a mode, which is usually @code{Pmode}. +Usually that is the only mode for which a label is directly valid. + @item (const:@var{m} @var{exp}) Represents a constant that is the result of an assembly-time arithmetic computation. The operand, @var{exp}, is an expression that @@ -3517,7 +3520,7 @@ on these machines should have a body which is a @code{parallel} that contains both the @code{call} expression and @code{clobber} expressions that indicate which registers are destroyed. Similarly, if the call instruction requires some register other than the stack -pointer that is not explicitly mentioned it its RTL, a @code{use} +pointer that is not explicitly mentioned in its RTL, a @code{use} subexpression should mention that register. Functions that are called are assumed to modify all registers listed in diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 128322d7768..2d1e519c438 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1059,6 +1059,22 @@ The GCC testsuite defines the following directives to be used within @code{dg-final}. @table @code +@item cleanup-coverage-files +Removes coverage data files generated for this test. + +@item cleanup-repo-files +Removes files generated for this test for @option{-frepo}. + +@item cleanup-rtl-dump @var{suffix} +Removes RTL dump files generated for this test. + +@item cleanup-tree-dump @var{suffix} +Removes tree dump files matching @var{suffix} which were generated for +this test. + +@item cleanup-saved-temps +Removes files for the current test which were kept for @option{--save-temps}. + @item scan-file @var{filename} @var{regexp} [@{ target/xfail @var{selector} @}] Passes if @var{regexp} matches text in @var{filename}. @@ -1272,10 +1288,10 @@ failures for a test run against the list of expected failures in Update this file when adding new failing tests to Mauve, or when fixing bugs in libgcj that had caused Mauve test failures. -The @uref{http://oss.software.ibm.com/developerworks/opensource/jacks/,, +The @uref{http://sources.redhat.com/mauve/,, Jacks} project provides a testsuite for Java compilers that can be used to test changes that affect the GCJ front end. This testsuite is run as -part of Java testing by placing the Jacks tree within the the libjava +part of Java testing by placing the Jacks tree within the libjava testsuite sources at @file{libjava/testsuite/libjava.jacks/jacks}. We encourage developers to contribute test cases to Mauve and Jacks. diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index aa5c929f048..9e755aaf8af 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -1076,7 +1076,8 @@ largest value that @code{BITS_PER_WORD} can have at run-time. @end defmac @defmac UNITS_PER_WORD -Number of storage units in a word; normally 4. +Number of storage units in a word; normally the size of a general-purpose +register, a power of two from 1 or 8. @end defmac @defmac MIN_UNITS_PER_WORD @@ -1085,6 +1086,13 @@ Minimum number of units in a word. If this is undefined, the default is smallest value that @code{UNITS_PER_WORD} can have at run-time. @end defmac +@defmac UNITS_PER_SIMD_WORD +Number of units in the vectors that the vectorizer can produce. +The default is equal to @code{UNITS_PER_WORD}, because the vectorizer +can do some transformations even in absence of specialized @acronym{SIMD} +hardware. +@end defmac + @defmac POINTER_SIZE Width of a pointer, in bits. You must specify a value no wider than the width of @code{Pmode}. If it is not equal to the width of @code{Pmode}, @@ -4866,7 +4874,7 @@ This macro should evaluate to @code{true} if the integer comparison functions (like @code{__cmpdi2}) return 0 to indicate that the first operand is smaller than the second, 1 to indicate that they are equal, and 2 to indicate that the first operand is greater than the second. -If this macro evalutes to @code{false} the comparison functions return +If this macro evaluates to @code{false} the comparison functions return @minus{}1, 0, and 1 instead of 0, 1, and 2. If the target uses the routines in @file{libgcc.a}, you do not need to define this macro. @end defmac @@ -5566,7 +5574,7 @@ used to set a chunk of memory to a constant value, or whether some other mechanism will be used. Used by @code{__builtin_memset} when storing values other than constant zero and by @code{__builtin_strcpy} when when called with a constant source string. -Defaults to to 1 if @code{move_by_pieces_ninsns} returns less +Defaults to 1 if @code{move_by_pieces_ninsns} returns less than @code{MOVE_RATIO}. @end defmac @@ -6011,6 +6019,22 @@ finalization code. If not defined, GCC will assume such a section does not exist. @end defmac +@defmac INIT_ARRAY_SECTION_ASM_OP +If defined, a C expression whose value is a string, including spacing, +containing the assembler operation to identify the following data as +part of the @code{.init_array} (or equivalent) section. If not +defined, GCC will assume such a section does not exist. Do not define +both this macro and @code{INIT_SECTION_ASM_OP}. +@end defmac + +@defmac FINI_ARRAY_SECTION_ASM_OP +If defined, a C expression whose value is a string, including spacing, +containing the assembler operation to identify the following data as +part of the @code{.fini_array} (or equivalent) section. If not +defined, GCC will assume such a section does not exist. Do not define +both this macro and @code{FINI_SECTION_ASM_OP}. +@end defmac + @defmac CRT_CALL_STATIC_FUNCTION (@var{section_op}, @var{function}) If defined, an ASM statement that switches to a different section via @var{section_op}, calls @var{function}, and switches back to @@ -8718,12 +8742,27 @@ some variants of the ABI, an inline function can never be the key method. The default is to return @code{true}. @end deftypefn -@deftypefn {Target Hook} bool TARGET_CXX_EXPORT_CLASS_DATA (void) -If this hook returns false (the default), then virtual tables and RTTI -data structures will have the ELF visibility of their containing -class. If this hook returns true, then these data structures will -have ELF ``default'' visibility, independently of the visibility of -the containing class. +@deftypefn {Target Hook} void TARGET_CXX_DETERMINE_CLASS_DATA_VISIBILITY (tree @var{decl}) +@var{decl} is a virtual table, virtual table table, typeinfo object, +or other similar implicit class data object that will be emitted with +external linkage in this translation unit. No ELF visibility has been +explicitly specified. If the target needs to specify a visibility +other than that of the containing class, use this hook to set +@code{DECL_VISIBILITY} and @code{DECL_VISIBILITY_SPECIFIED}. +@end deftypefn + +@deftypefn {Target Hook} bool TARGET_CXX_CLASS_DATA_ALWAYS_COMDAT (void) +This hook returns true (the default) if virtual tables and other +similar implicit class data objects are always COMDAT if they have +external linkage. If this hook returns false, then class data for +classes whose virtual table will be emitted in only one translation +unit will not be COMDAT. +@end deftypefn + +@deftypefn {Target Hook} bool TARGET_CXX_USE_AEABI_ATEXIT (void) +This hook returns true if @code{__aeabi_atexit} (as defined by the ARM EABI) +should be used to register static destructors when @option{-fuse-cxa-atexit} +is in effect. The default is to return false to use @code{__cxa_atexit}. @end deftypefn @node Misc @@ -9252,7 +9291,7 @@ arguments of @samp{#pragma pack}. @defmac TARGET_DEFAULT_PACK_STRUCT If your target requires a structure packing default other than 0 (meaning -the machine default), define this macro the the necessary value (in bytes). +the machine default), define this macro to the necessary value (in bytes). This must be a value that would also valid to be used with @samp{#pragma pack()} (that is, a small power of two). @end defmac @@ -9314,11 +9353,15 @@ from shared libraries (DLLs). You need not define this macro if it would always evaluate to zero. @end defmac -@deftypefn {Target Hook} tree TARGET_MD_ASM_CLOBBERS (tree @var{clobbers}) +@deftypefn {Target Hook} tree TARGET_MD_ASM_CLOBBERS (tree @var{outputs}, tree @var{inputs}, tree @var{clobbers}) This target hook should add to @var{clobbers} @code{STRING_CST} trees for -any hard regs the port wishes to automatically clobber for all asms. +any hard regs the port wishes to automatically clobber for an asm. It should return the result of the last @code{tree_cons} used to add a -clobber. +clobber. The @var{outputs}, @var{inputs} and @var{clobber} lists are the +corresponding parameters to the asm and may be inspected to avoid +clobbering a register that is an input or output of the asm. You can use +@code{decl_overlaps_hard_reg_set_p}, declared in @file{tree.h}, to test +for overlap with regards to asm-declared registers. @end deftypefn @defmac MATH_LIBRARY @@ -9446,13 +9489,26 @@ ignored. This function should return the result of the call to the built-in function. @end deftypefn -@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{exp}, bool @var{ignore}) +@deftypefn {Target Hook} tree TARGET_RESOLVE_OVERLOADED_BUILTIN (tree @var{fndecl}, tree @var{arglist}) -Expand a call to a machine specific built-in function that was set up by -@samp{TARGET_INIT_BUILTINS}. @var{exp} is the expression for the -function call; the result is another tree containing a simplified -expression for the call's result. If @var{ignore} is true the -value will be ignored. +Select a replacement for a machine specific built-in function that +was set up by @samp{TARGET_INIT_BUILTINS}. This is done +@emph{before} regular type checking, and so allows the target to +implement a crude form of function overloading. @var{fndecl} is the +declaration of the built-in function. @var{arglist} is the list of +arguments passed to the built-in function. The result is a +complete expression that implements the operation, usually +another @code{CALL_EXPR}. +@end deftypefn + +@deftypefn {Target Hook} tree TARGET_FOLD_BUILTIN (tree @var{fndecl}, tree @var{arglist}, bool @var{ignore}) + +Fold a call to a machine specific built-in function that was set up by +@samp{TARGET_INIT_BUILTINS}. @var{fndecl} is the declaration of the +built-in function. @var{arglist} is the list of arguments passed to +the built-in function. The result is another tree containing a +simplified expression for the call's result. If @var{ignore} is true +the value will be ignored. @end deftypefn @defmac MD_CAN_REDIRECT_BRANCH (@var{branch1}, @var{branch2}) diff --git a/gcc/doc/tree-ssa.texi b/gcc/doc/tree-ssa.texi index 4679912fa9a..cbceb37073c 100644 --- a/gcc/doc/tree-ssa.texi +++ b/gcc/doc/tree-ssa.texi @@ -83,8 +83,7 @@ perfectly happy to take it as input and spit out GIMPLE@. GIMPLE is a simplified subset of GENERIC for use in optimization. The particular subset chosen (and the name) was heavily influenced by the -SIMPLE IL used by the McCAT compiler project at McGill University -(@uref{http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html}), +SIMPLE IL used by the McCAT compiler project at McGill University, though we have made some different choices. For one thing, SIMPLE doesn't support @code{goto}; a production compiler can't afford that kind of restriction. @@ -685,7 +684,7 @@ void f() The optimizers need to associate attributes with statements and variables during the optimization process. For instance, we need to -know what basic block does a statement belong to or whether a variable +know what basic block a statement belongs to or whether a variable has aliases. All these attributes are stored in data structures called annotations which are then linked to the field @code{ann} in @code{struct tree_common}. @@ -700,15 +699,14 @@ Annotations are defined and documented in @file{tree-flow.h}. @cindex operands @cindex virtual operands @cindex real operands -@findex get_stmt_operands -@findex modify_stmt +@findex update_stmt Almost every GIMPLE statement will contain a reference to a variable or memory location. Since statements come in different shapes and sizes, their operands are going to be located at various spots inside the statement's tree. To facilitate access to the statement's -operands, they are organized into arrays associated inside each -statement's annotation. Each element in an operand array is a pointer +operands, they are organized into lists associated inside each +statement's annotation. Each element in an operand list is a pointer to a @code{VAR_DECL}, @code{PARM_DECL} or @code{SSA_NAME} tree node. This provides a very convenient way of examining and replacing operands. @@ -812,96 +810,58 @@ function is converted into SSA form. This will be used to link all the non-killing definitions to prevent optimizations from making incorrect assumptions about them. -Operands are collected by @file{tree-ssa-operands.c}. They are stored -inside each statement's annotation and can be accessed with -@code{DEF_OPS}, @code{USE_OPS}, @code{V_MAY_DEF_OPS}, -@code{V_MUST_DEF_OPS} and @code{VUSE_OPS}. The following are all the -accessor macros available to access USE operands. To access all the -other operand arrays, just change the name accordingly. Note that -this interface to the operands is deprecated, and is slated for -removal in a future version of gcc. The preferred interface is the -operand iterator interface. Unless you need to discover the number of -operands of a given type on a statement, you are strongly urged not to -use this interface. - -@defmac USE_OPS (@var{ann}) -Returns the array of operands used by the statement with annotation -@var{ann}. -@end defmac +Operands are updated as soon as the statement is finished via a call +to @code{update_stmt}. If statement elements are changed via +@code{SET_USE} or @code{SET_DEF}, then no further action is required +(ie, those macros take care of updating the statement). If changes +are made by manipulating the statement's tree directly, then a call +must be made to @code{update_stmt} when complete. Calling one of the +@code{bsi_insert} routines or @code{bsi_replace} performs an implicit +call to @code{update_stmt}. -@defmac STMT_USE_OPS (@var{stmt}) -Alternate version of USE_OPS that takes the statement @var{stmt} as -input. -@end defmac - -@defmac NUM_USES (@var{ops}) -Return the number of USE operands in array @var{ops}. -@end defmac +@subsection Operand Iterators And Access Routines +@cindex Operand Iterators +@cindex Operand Access Routines -@defmac USE_OP_PTR (@var{ops}, @var{i}) -Return a pointer to the @var{i}th operand in array @var{ops}. -@end defmac +Operands are collected by @file{tree-ssa-operands.c}. They are stored +inside each statement's annotation and can be accessed through either the +operand iterators or an access routine. -@defmac USE_OP (@var{ops}, @var{i}) -Return the @var{i}th operand in array @var{ops}. -@end defmac +The following access routines are available for examining operands: -The following function shows how to print all the operands of a given -statement: +@enumerate +@item @code{SINGLE_SSA_@{USE,DEF,TREE@}_OPERAND}: These accessors will return +NULL unless there is exactly one operand matching the specified flags. If +there is exactly one operand, the operand is returned as either a @code{tree}, +@code{def_operand_p}, or @code{use_operand_p}. @smallexample -void -print_ops (tree stmt) -@{ - vuse_optype vuses; - v_may_def_optype v_may_defs; - v_must_def_optype v_must_defs; - def_optype defs; - use_optype uses; - stmt_ann_t ann; - size_t i; - - get_stmt_operands (stmt); - ann = stmt_ann (stmt); - - defs = DEF_OPS (ann); - for (i = 0; i < NUM_DEFS (defs); i++) - print_generic_expr (stderr, DEF_OP (defs, i), 0); - - uses = USE_OPS (ann); - for (i = 0; i < NUM_USES (uses); i++) - print_generic_expr (stderr, USE_OP (uses, i), 0); - - v_may_defs = V_MAY_DEF_OPS (ann); - for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++) - @{ - print_generic_expr (stderr, V_MAY_DEF_OP (v_may_defs, i), 0); - print_generic_expr (stderr, V_MAY_DEF_RESULT (v_may_defs, i), 0); - @} +tree t = SINGLE_SSA_TREE_OPERAND (stmt, flags); +use_operand_p u = SINGLE_SSA_USE_OPERAND (stmt, SSA_ALL_VIRTUAL_USES); +def_operand_p d = SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_ALL_DEFS); +@end smallexample - v_must_defs = V_MUST_DEF_OPS (ann); - for (i = 0; i < NUM_V_MUST_DEFS (v_must_defs); i++) - print_generic_expr (stderr, V_MUST_DEF_OP (v_must_defs, i), 0); +@item @code{ZERO_SSA_OPERANDS}: This macro returns true if there are no +operands matching the specified flags. - vuses = VUSE_OPS (ann); - for (i = 0; i < NUM_VUSES (vuses); i++) - print_generic_expr (stderr, VUSE_OP (vuses, i), 0); -@} +@smallexample +if (ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)) + return; @end smallexample -To collect the operands, you first need to call -@code{get_stmt_operands}. Since that is a potentially expensive -operation, statements are only scanned if they have been marked -modified by a call to @code{modify_stmt}. So, if your pass replaces -operands in a statement, make sure to call @code{modify_stmt}. +@item @code{NUM_SSA_OPERANDS}: This macro Returns the number of operands +matching 'flags'. This actually executes a loop to perform the count, so +only use this if it is really needed. + +@smallexample +int count = NUM_SSA_OPERANDS (stmt, flags) +@end smallexample +@end enumerate -@subsection Operand Iterators -@cindex Operand Iterators -There is an alternative to iterating over the operands in a statement. -It is especially useful when you wish to perform the same operation on -more than one type of operand. The previous example could be -rewritten as follows: +If you wish to iterate over some or all operands, use the +@code{FOR_EACH_SSA_@{USE,DEF,TREE@}_OPERAND} iterator. For example, to print +all the operands for a statement: @smallexample void @@ -910,13 +870,14 @@ print_ops (tree stmt) ssa_op_iter; tree var; - get_stmt_operands (stmt); FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_OPERANDS) - print_generic_expr (stderr, var, 0); + print_generic_expr (stderr, var, TDF_SLIM); @} @end smallexample +How to choose the appropriate iterator: + @enumerate @item Determine whether you are need to see the operand pointers, or just the trees, and choose the appropriate macro: @@ -967,7 +928,7 @@ So if you want to look at the use pointers for all the @code{USE} and @} @end smallexample -The @code{_TREE_} macro is basically the same as the @code{USE} and +The @code{TREE} macro is basically the same as the @code{USE} and @code{DEF} macros, only with the use or def dereferenced via @code{USE_FROM_PTR (use_p)} and @code{DEF_FROM_PTR (def_p)}. Since we aren't using operand pointers, use and defs flags can be mixed. @@ -1003,7 +964,7 @@ this one. @code{V_MUST_DEF}s are broken into two flags, one for the @code{DEF} portion (@code{SSA_OP_VMUSTDEF}) and one for the kill portion -(@code{SSA_OP_VMUSTDEFKILL}). If all you want to look at are the +(@code{SSA_OP_VMUSTKILL}). If all you want to look at are the @code{V_MUST_DEF}s together, there is a fourth iterator macro for this, which returns both a def_operand_p and a use_operand_p for each @code{V_MUST_DEF} in the statement. Note that you don't need any flags for @@ -1024,6 +985,134 @@ this one. There are many examples in the code as well, as well as the documentation in @file{tree-ssa-operands.h}. +There are also a couple of variants on the stmt iterators regarding PHI +nodes. + +@code{FOR_EACH_PHI_ARG} Works exactly like +@code{FOR_EACH_SSA_USE_OPERAND}, except it works over @code{PHI} arguments +instead of statement operands. + +@smallexample +/* Look at every virtual PHI use. */ +FOR_EACH_PHI_ARG (use_p, phi_stmt, iter, SSA_OP_VIRTUAL_USES) +@{ + my_code; +@} + +/* Look at every real PHI use. */ +FOR_EACH_PHI_ARG (use_p, phi_stmt, iter, SSA_OP_USES) + my_code; + +/* Look at every every PHI use. */ +FOR_EACH_PHI_ARG (use_p, phi_stmt, iter, SSA_OP_ALL_USES) + my_code; +@end smallexample + +@code{FOR_EACH_PHI_OR_STMT_@{USE,DEF@}} works exactly like +@code{FOR_EACH_SSA_@{USE,DEF@}_OPERAND}, except it will function on +either a statement or a @code{PHI} node. These should be used when it is +appropriate but they are not quite as efficient as the individual +@code{FOR_EACH_PHI} and @code{FOR_EACH_SSA} routines. + +@smallexample +FOR_EACH_PHI_OR_STMT_USE (use_operand_p, stmt, iter, flags) + @{ + my_code; + @} + +FOR_EACH_PHI_OR_STMT_DEF (def_operand_p, phi, iter, flags) + @{ + my_code; + @} +@end smallexample + +@subsection Immediate Uses +@cindex Immediate Uses + +Immediate use information is now always available. Using the immediate use +iterators, you may examine every use of any @code{SSA_NAME}. For instance, +to change each use of @code{ssa_var} to @code{ssa_var2}: + +@smallexample + use_operand_p imm_use_p; + imm_use_iterator iterator; + tree ssa_var + + FOR_EACH_IMM_USE_SAFE (imm_use_p, iterator, ssa_var) + SET_USE (imm_use_p, ssa_var_2); +@end smallexample + +There are 2 iterators which can be used. @code{FOR_EACH_IMM_USE_FAST} is used +when the immediate uses are not changed, ie. you are looking at the uses, but +not setting them. + +If they do get changed, then care must be taken that things are not changed +under the iterators, so use the @code{FOR_EACH_IMM_USE_SAFE} iterator. It +attempts to preserve the sanity of the use list by moving an iterator element +through the use list, preventing insertions and deletions in the list from +resulting in invalid pointers. This is a little slower since it adds a +placeholder element and moves it through the list. This element must be +also be removed if the loop is terminated early. A macro +(@code{BREAK_FROM SAFE_IMM_USE}) is provided for this: + +@smallexample + FOR_EACH_IMM_USE_SAFE (use_p, iter, var) + @{ + if (var == last_var) + BREAK_FROM_SAFE_IMM_USE (iter); + else + SET_USE (use_p, var2); + @} +@end smallexample + +There are checks in @code{verify_ssa} which verify that the immediate use list +is up to date, as well as checking that an optimization didn't break from the +loop without using this macro. It is safe to simply 'break'; from a +@code{FOR_EACH_IMM_USE_FAST} traverse. + +Some useful functions and macros: +@enumerate +@item @code{has_zero_uses (ssa_var)} : Returns true if there are no uses of +@code{ssa_var}. +@item @code{has_single_use (ssa_var)} : Returns true if there is only a +single use of @code{ssa_var}. +@item @code{single_imm_use (ssa_var, use_operand_p *ptr, tree *stmt)} : +Returns true if there is only a single use of @code{ssa_var}, and also returns +the use pointer and statement it occurs in in the second and third parameters. +@item @code{num_imm_uses (ssa_var)} : Returns the number of immediate uses of +@code{ssa_var}. It is better not to use this if possible since it simply +utilizes a loop to count the uses. +@item @code{PHI_ARG_INDEX_FROM_USE (use_p)} : Given a use within a @code{PHI} +node, return the index number for the use. An assert is triggered if the use +isn't located in a @code{PHI} node. +@item @code{USE_STMT (use_p)} : Return the statement a use occurs in. +@end enumerate + +Note that uses are not put into an immediate use list until their statement is +actually inserted into the instruction stream via a @code{bsi_*} routine. + +It is also still possible to utilize lazy updating of statements, but this +should be used only when absolutely required. Both alias analysis and the +dominator optimizations currently do this. + +When lazy updating is being used, the immediate use information is out of date +and cannot be used reliably. Lazy updating is achieved by simply marking +statements modified via calls to @code{mark_stmt_modified} instead of +@code{update_stmt}. When lazy updating is no longer required, all the +modified statements must have @code{update_stmt} called in order to bring them +up to date. This must be done before the optimization is finished, or +@code{verify_ssa} will trigger an abort. + +This is done with a simple loop over the instruction stream: +@smallexample + block_stmt_iterator bsi; + basic_block bb; + FOR_EACH_BB (bb) + @{ + for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi)) + update_stmt_if_modified (bsi_stmt (bsi)); + @} +@end smallexample @node SSA @section Static Single Assignment @@ -1111,18 +1200,129 @@ Returns the @code{SSA_NAME} for the @var{i}th argument of @var{phi}. @subsection Preserving the SSA form -@findex vars_to_rename +@findex update_ssa @cindex preserving SSA form Some optimization passes make changes to the function that invalidate the SSA property. This can happen when a pass has -added new variables or changed the program so that variables that -were previously aliased aren't anymore. - -Whenever something like this happens, the affected variables must -be renamed into SSA form again. To do this, you should mark the -new variables in the global bitmap @code{vars_to_rename}. Once -your pass has finished, the pass manager will invoke the SSA -renamer to put the program into SSA once more. +added new symbols or changed the program so that variables that +were previously aliased aren't anymore. Whenever something like this +happens, the affected symbols must be renamed into SSA form again. +Transformations that emit new code or replicate existing statements +will also need to update the SSA form@. + +Since GCC implements two different SSA forms for register and virtual +variables, keeping the SSA form up to date depends on whether you are +updating register or virtual names. In both cases, the general idea +behind incremental SSA updates is similar: when new SSA names are +created, they typically are meant to replace other existing names in +the program@. + +For instance, given the following code: + +@smallexample + 1 L0: + 2 x_1 = PHI (0, x_5) + 3 if (x_1 < 10) + 4 if (x_1 > 7) + 5 y_2 = 0 + 6 else + 7 y_3 = x_1 + x_7 + 8 endif + 9 x_5 = x_1 + 1 + 10 goto L0; + 11 endif +@end smallexample + +Suppose that we insert new names @code{x_10} and @code{x_11} (lines +@code{4} and @code{8})@. + +@smallexample + 1 L0: + 2 x_1 = PHI (0, x_5) + 3 if (x_1 < 10) + 4 x_10 = ... + 5 if (x_1 > 7) + 6 y_2 = 0 + 7 else + 8 x_11 = ... + 9 y_3 = x_1 + x_7 + 10 endif + 11 x_5 = x_1 + 1 + 12 goto L0; + 13 endif +@end smallexample + +We want to replace all the uses of @code{x_1} with the new definitions +of @code{x_10} and @code{x_11}. Note that the only uses that should +be replaced are those at lines @code{5}, @code{9} and @code{11}. +Also, the use of @code{x_7} at line @code{9} should @emph{not} be +replaced (this is why we cannot just mark symbol @code{x} for +renaming)@. + +Additionally, we may need to insert a PHI node at line @code{11} +because that is a merge point for @code{x_10} and @code{x_11}. So the +use of @code{x_1} at line @code{11} will be replaced with the new PHI +node. The insertion of PHI nodes is optional. They are not strictly +necessary to preserve the SSA form, and depending on what the caller +inserted, they may not even be useful for the optimizers@. + +Updating the SSA form is a two step process. First, the pass has to +identify which names need to be updated and/or which symbols need to +be renamed into SSA form for the first time. When new names are +introduced to replace existing names in the program, the mapping +between the old and the new names are registered by calling +@code{register_new_name_mapping} (note that if your pass creates new +code by duplicating basic blocks, the call to @code{tree_duplicate_bb} +will set up the necessary mappings automatically). On the other hand, +if your pass exposes a new symbol that should be put in SSA form for +the first time, the new symbol should be registered with +@code{mark_sym_for_renaming}. + +After the replacement mappings have been registered and new symbols +marked for renaming, a call to @code{update_ssa} makes the registered +changes. This can be done with an explicit call or by creating +@code{TODO} flags in the @code{tree_opt_pass} structure for your pass. +There are several @code{TODO} flags that control the behaviour of +@code{update_ssa}: + +@itemize @bullet +@item @code{TODO_update_ssa}. Update the SSA form inserting PHI nodes + for newly exposed symbols and virtual names marked for updating. + When updating real names, only insert PHI nodes for a real name + @code{O_j} in blocks reached by all the new and old definitions for + @code{O_j}. If the iterated dominance frontier for @code{O_j} + is not pruned, we may end up inserting PHI nodes in blocks that + have one or more edges with no incoming definition for + @code{O_j}. This would lead to uninitialized warnings for + @code{O_j}'s symbol@. + +@item @code{TODO_update_ssa_no_phi}. Update the SSA form without + inserting any new PHI nodes at all. This is used by passes that + have either inserted all the PHI nodes themselves or passes that + need only to patch use-def and def-def chains for virtuals + (e.g., DCE)@. + + +@item @code{TODO_update_ssa_full_phi}. Insert PHI nodes everywhere + they are needed. No prunning of the IDF is done. This is used + by passes that need the PHI nodes for @code{O_j} even if it + means that some arguments will come from the default definition + of @code{O_j}'s symbol (e.g., @code{pass_linear_transform})@. + + WARNING: If you need to use this flag, chances are that your + pass may be doing something wrong. Inserting PHI nodes for an + old name where not all edges carry a new replacement may lead to + silent codegen errors or spurious uninitialized warnings@. + +@item @code{TODO_update_ssa_only_virtuals}. Passes that update the + SSA form on their own may want to delegate the updating of + virtual names to the generic updater. Since FUD chains are + easier to maintain, this simplifies the work they need to do. + NOTE: If this flag is used, any OLD->NEW mappings for real names + are explicitly destroyed and only the symbols marked for + renaming are processed@. +@end itemize + @subsection Examining @code{SSA_NAME} nodes @cindex examining SSA_NAMEs diff --git a/gcc/dojump.c b/gcc/dojump.c index 3c9d88a548b..87efb170f26 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -207,14 +207,6 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) do_jump (TREE_OPERAND (exp, 0), if_false_label, if_true_label); break; - case MINUS_EXPR: - /* Nonzero iff operands of minus differ. */ - do_compare_and_jump (build2 (NE_EXPR, TREE_TYPE (exp), - TREE_OPERAND (exp, 0), - TREE_OPERAND (exp, 1)), - NE, NE, if_false_label, if_true_label); - break; - case BIT_AND_EXPR: /* fold_single_bit_test() converts (X & (1 << C)) into (X >> C) & 1. See if the former is preferred for jump tests and restore it @@ -369,6 +361,12 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) break; } + case MINUS_EXPR: + /* Nonzero iff operands of minus differ. */ + exp = build2 (NE_EXPR, TREE_TYPE (exp), + TREE_OPERAND (exp, 0), + TREE_OPERAND (exp, 1)); + /* FALLTHRU */ case NE_EXPR: { tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0)); @@ -504,8 +502,8 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label) if (if_true_label == 0) drop_through_label = if_true_label = gen_label_rtx (); - cmp0 = fold (build2 (tcode1, TREE_TYPE (exp), op0, op1)); - cmp1 = fold (build2 (tcode2, TREE_TYPE (exp), op0, op1)); + cmp0 = fold_build2 (tcode1, TREE_TYPE (exp), op0, op1); + cmp1 = fold_build2 (tcode2, TREE_TYPE (exp), op0, op1); do_jump (cmp0, 0, if_true_label); do_jump (cmp1, if_false_label, if_true_label); } diff --git a/gcc/dominance.c b/gcc/dominance.c index f001c680243..ce977e292fe 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -30,7 +30,7 @@ The algorithm computes this dominator tree implicitly by computing for each block its immediate dominator. We use tree balancing and path - compression, so its the O(e*a(e,v)) variant, where a(e,v) is the very + compression, so it's the O(e*a(e,v)) variant, where a(e,v) is the very slowly growing functional inverse of the Ackerman function. */ #include "config.h" @@ -372,7 +372,7 @@ calc_dfs_tree (struct dom_info *di, enum cdi_direction reverse) di->nodes = di->dfsnum - 1; - /* This aborts e.g. when there is _no_ path from ENTRY to EXIT at all. */ + /* Make sure there is a path from ENTRY to EXIT at all. */ gcc_assert (di->nodes == (unsigned int) n_basic_blocks + 1); } @@ -659,11 +659,11 @@ free_dominance_info (enum cdi_direction dir) FOR_ALL_BB (bb) { - delete_from_dominance_info (dir, bb); + et_free_tree_force (bb->dom[dir]); + bb->dom[dir] = NULL; } - /* If there are any nodes left, something is wrong. */ - gcc_assert (!n_bbs_in_dom_tree[dir]); + n_bbs_in_dom_tree[dir] = 0; dom_computed[dir] = DOM_NONE; } @@ -797,6 +797,27 @@ nearest_common_dominator (enum cdi_direction dir, basic_block bb1, basic_block b return et_nca (bb1->dom[dir], bb2->dom[dir])->data; } + +/* Find the nearest common dominator for the basic blocks in BLOCKS, + using dominance direction DIR. */ + +basic_block +nearest_common_dominator_for_set (enum cdi_direction dir, bitmap blocks) +{ + unsigned i, first; + bitmap_iterator bi; + basic_block dom; + + first = bitmap_first_set_bit (blocks); + dom = BASIC_BLOCK (first); + EXECUTE_IF_SET_IN_BITMAP (blocks, 0, i, bi) + if (dom != BASIC_BLOCK (i)) + dom = nearest_common_dominator (dir, dom, BASIC_BLOCK (i)); + + return dom; +} + + /* Return TRUE in case BB1 is dominated by BB2. */ bool dominated_by_p (enum cdi_direction dir, basic_block bb1, basic_block bb2) diff --git a/gcc/domwalk.c b/gcc/domwalk.c index 15b1dff82db..2713e04c097 100644 --- a/gcc/domwalk.c +++ b/gcc/domwalk.c @@ -1,5 +1,5 @@ /* Generic dominator tree walker - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -145,6 +145,14 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) void *bd = NULL; basic_block dest; block_stmt_iterator bsi; + bool is_interesting; + + /* If block BB is not interesting to the caller, then none of the + callbacks that walk the statements in BB are going to be + executed. */ + is_interesting = bb->index < 0 + || walk_data->interesting_blocks == NULL + || TEST_BIT (walk_data->interesting_blocks, bb->index); /* Callback to initialize the local data structure. */ if (walk_data->initialize_block_local_data) @@ -179,7 +187,7 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) (*walk_data->before_dom_children_before_stmts) (walk_data, bb); /* Statement walk before walking dominator children. */ - if (walk_data->before_dom_children_walk_stmts) + if (is_interesting && walk_data->before_dom_children_walk_stmts) { if (walk_data->walk_stmts_backward) for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi)) @@ -211,7 +219,7 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb) (*walk_data->after_dom_children_before_stmts) (walk_data, bb); /* Statement walk after walking dominator children. */ - if (walk_data->after_dom_children_walk_stmts) + if (is_interesting && walk_data->after_dom_children_walk_stmts) { if (walk_data->walk_stmts_backward) for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi)) diff --git a/gcc/domwalk.h b/gcc/domwalk.h index fbf549bbd98..bf16229b488 100644 --- a/gcc/domwalk.h +++ b/gcc/domwalk.h @@ -1,5 +1,5 @@ /* Generic dominator tree walker - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Diego Novillo This file is part of GCC. @@ -105,6 +105,14 @@ struct dom_walk_data /* Stack of available block local structures. */ varray_type free_block_data; + + /* Interesting blocks to process. If this field is not NULL, this + set is used to determine which blocks to walk. If we encounter + block I in the dominator traversal, but block I is not present in + INTERESTING_BLOCKS, then none of the callback functions are + invoked on it. This is useful when a particular traversal wants + to filter out non-interesting blocks from the dominator tree. */ + sbitmap interesting_blocks; }; void walk_dominator_tree (struct dom_walk_data *, basic_block); diff --git a/gcc/dummy-checksum.c b/gcc/dummy-checksum.c new file mode 100644 index 00000000000..81190a6ca15 --- /dev/null +++ b/gcc/dummy-checksum.c @@ -0,0 +1 @@ +const unsigned char executable_checksum[16] = { 0 }; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 5157ae358bc..32711c7227c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -170,21 +170,25 @@ default_eh_frame_section (void) #endif } +DEF_VEC_P(rtx); +DEF_VEC_ALLOC_P(rtx,gc); + /* Array of RTXes referenced by the debugging information, which therefore must be kept around forever. */ -static GTY(()) varray_type used_rtx_varray; +static GTY(()) VEC(rtx,gc) *used_rtx_array; /* A pointer to the base of a list of incomplete types which might be - completed at some later time. incomplete_types_list needs to be a VARRAY - because we want to tell the garbage collector about it. */ -static GTY(()) varray_type incomplete_types; + completed at some later time. incomplete_types_list needs to be a + VEC(tree,gc) because we want to tell the garbage collector about + it. */ +static GTY(()) VEC(tree,gc) *incomplete_types; /* A pointer to the base of a table of references to declaration scopes. This table is a display which tracks the nesting of declaration scopes at the current scope and containing scopes. This table is used to find the proper place to define type declaration DIE's. */ -static GTY(()) varray_type decl_scope_table; +static GTY(()) VEC(tree,gc) *decl_scope_table; /* How to start an assembler comment. */ #ifndef ASM_COMMENT_START @@ -253,6 +257,11 @@ typedef struct dw_fde_struct GTY(()) const char *dw_fde_begin; const char *dw_fde_current_label; const char *dw_fde_end; + const char *dw_fde_hot_section_label; + const char *dw_fde_hot_section_end_label; + const char *dw_fde_unlikely_section_label; + const char *dw_fde_unlikely_section_end_label; + bool dw_fde_switched_sections; dw_cfi_ref dw_fde_cfi; unsigned funcdef_number; unsigned all_throwers_are_sibcalls : 1; @@ -1477,7 +1486,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label) src = SET_SRC (expr); dest = SET_DEST (expr); - if (GET_CODE (src) == REG) + if (REG_P (src)) { rtx rsi = reg_saved_in (src); if (rsi) @@ -2069,6 +2078,7 @@ output_call_frame_info (int for_eh) int fde_encoding = DW_EH_PE_absptr; int per_encoding = DW_EH_PE_absptr; int lsda_encoding = DW_EH_PE_absptr; + int return_reg; /* Don't emit a CIE if there won't be any FDEs. */ if (fde_table_in_use == 0) @@ -2207,10 +2217,11 @@ output_call_frame_info (int for_eh) dw2_asm_output_data_sleb128 (DWARF_CIE_DATA_ALIGNMENT, "CIE Data Alignment Factor"); + return_reg = DWARF2_FRAME_REG_OUT (DWARF_FRAME_RETURN_COLUMN, for_eh); if (DW_CIE_VERSION == 1) - dw2_asm_output_data (1, DWARF_FRAME_RETURN_COLUMN, "CIE RA Column"); + dw2_asm_output_data (1, return_reg, "CIE RA Column"); else - dw2_asm_output_data_uleb128 (DWARF_FRAME_RETURN_COLUMN, "CIE RA Column"); + dw2_asm_output_data_uleb128 (return_reg, "CIE RA Column"); if (augmentation[0]) { @@ -2273,17 +2284,57 @@ output_call_frame_info (int for_eh) dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref, "FDE initial location"); - dw2_asm_output_delta (size_of_encoded_value (fde_encoding), - fde->dw_fde_end, fde->dw_fde_begin, - "FDE address range"); + if (fde->dw_fde_switched_sections) + { + rtx sym_ref2 = gen_rtx_SYMBOL_REF (Pmode, + fde->dw_fde_unlikely_section_label); + rtx sym_ref3= gen_rtx_SYMBOL_REF (Pmode, + fde->dw_fde_hot_section_label); + SYMBOL_REF_FLAGS (sym_ref2) |= SYMBOL_FLAG_LOCAL; + SYMBOL_REF_FLAGS (sym_ref3) |= SYMBOL_FLAG_LOCAL; + dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref3, + "FDE initial location"); + dw2_asm_output_delta (size_of_encoded_value (fde_encoding), + fde->dw_fde_hot_section_end_label, + fde->dw_fde_hot_section_label, + "FDE address range"); + dw2_asm_output_encoded_addr_rtx (fde_encoding, sym_ref2, + "FDE initial location"); + dw2_asm_output_delta (size_of_encoded_value (fde_encoding), + fde->dw_fde_unlikely_section_end_label, + fde->dw_fde_unlikely_section_label, + "FDE address range"); + } + else + dw2_asm_output_delta (size_of_encoded_value (fde_encoding), + fde->dw_fde_end, fde->dw_fde_begin, + "FDE address range"); } else { dw2_asm_output_addr (DWARF2_ADDR_SIZE, fde->dw_fde_begin, "FDE initial location"); - dw2_asm_output_delta (DWARF2_ADDR_SIZE, - fde->dw_fde_end, fde->dw_fde_begin, - "FDE address range"); + if (fde->dw_fde_switched_sections) + { + dw2_asm_output_addr (DWARF2_ADDR_SIZE, + fde->dw_fde_hot_section_label, + "FDE initial location"); + dw2_asm_output_delta (DWARF2_ADDR_SIZE, + fde->dw_fde_hot_section_end_label, + fde->dw_fde_hot_section_label, + "FDE address range"); + dw2_asm_output_addr (DWARF2_ADDR_SIZE, + fde->dw_fde_unlikely_section_label, + "FDE initial location"); + dw2_asm_output_delta (DWARF2_ADDR_SIZE, + fde->dw_fde_unlikely_section_end_label, + fde->dw_fde_unlikely_section_label, + "FDE address range"); + } + else + dw2_asm_output_delta (DWARF2_ADDR_SIZE, + fde->dw_fde_end, fde->dw_fde_begin, + "FDE address range"); } if (augmentation[0]) @@ -2409,6 +2460,11 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, fde->decl = current_function_decl; fde->dw_fde_begin = dup_label; fde->dw_fde_current_label = NULL; + fde->dw_fde_hot_section_label = NULL; + fde->dw_fde_hot_section_end_label = NULL; + fde->dw_fde_unlikely_section_label = NULL; + fde->dw_fde_unlikely_section_end_label = NULL; + fde->dw_fde_switched_sections = false; fde->dw_fde_end = NULL; fde->dw_fde_cfi = NULL; fde->funcdef_number = current_function_funcdef_no; @@ -2468,7 +2524,12 @@ void dwarf2out_frame_finish (void) { /* Output call frame information. */ - if (write_symbols == DWARF2_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG) + if (write_symbols == DWARF2_DEBUG + || write_symbols == VMS_AND_DWARF2_DEBUG +#ifdef DWARF2_FRAME_INFO + || DWARF2_FRAME_INFO +#endif + ) output_call_frame_info (0); #ifndef TARGET_UNWIND_INFO @@ -3413,6 +3474,7 @@ static void dwarf2out_imported_module_or_decl (tree, tree); static void dwarf2out_abstract_function (tree); static void dwarf2out_var_location (rtx); static void dwarf2out_begin_function (tree); +static void dwarf2out_switch_text_section (void); /* The debug hooks structure. */ @@ -3444,7 +3506,9 @@ const struct gcc_debug_hooks dwarf2_debug_hooks = dwarf2out_abstract_function, /* outlining_inline_function */ debug_nothing_rtx, /* label */ debug_nothing_int, /* handle_pch */ - dwarf2out_var_location + dwarf2out_var_location, + dwarf2out_switch_text_section, + 1 /* start_end_main_source_file */ }; #endif @@ -3645,6 +3709,7 @@ struct var_loc_node GTY ((chain_next ("%h.next"))) { rtx GTY (()) var_loc_note; const char * GTY (()) label; + const char * GTY (()) section_label; struct var_loc_node * GTY (()) next; }; @@ -3778,9 +3843,6 @@ static int is_tagged_type (tree); static const char *dwarf_tag_name (unsigned); static const char *dwarf_attr_name (unsigned); static const char *dwarf_form_name (unsigned); -#if 0 -static const char *dwarf_type_encoding_name (unsigned); -#endif static tree decl_ultimate_origin (tree); static tree block_ultimate_origin (tree); static tree decl_class_context (tree); @@ -4066,6 +4128,9 @@ static int maybe_emit_file (int); #ifndef TEXT_SECTION_LABEL #define TEXT_SECTION_LABEL "Ltext" #endif +#ifndef COLD_TEXT_SECTION_LABEL +#define COLD_TEXT_SECTION_LABEL "Ltext_cold" +#endif #ifndef DEBUG_LINE_SECTION_LABEL #define DEBUG_LINE_SECTION_LABEL "Ldebug_line" #endif @@ -4093,6 +4158,8 @@ static int maybe_emit_file (int); static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char text_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; +static char cold_text_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; +static char cold_end_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char abbrev_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char debug_info_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; static char debug_line_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -4103,6 +4170,9 @@ static char ranges_section_label[2 * MAX_ARTIFICIAL_LABEL_BYTES]; #ifndef TEXT_END_LABEL #define TEXT_END_LABEL "Letext" #endif +#ifndef COLD_END_LABEL +#define COLD_END_LABEL "Letext_cold" +#endif #ifndef BLOCK_BEGIN_LABEL #define BLOCK_BEGIN_LABEL "LBB" #endif @@ -4548,36 +4618,6 @@ dwarf_form_name (unsigned int form) return "DW_FORM_"; } } - -/* Convert a DWARF type code into its string name. */ - -#if 0 -static const char * -dwarf_type_encoding_name (unsigned enc) -{ - switch (enc) - { - case DW_ATE_address: - return "DW_ATE_address"; - case DW_ATE_boolean: - return "DW_ATE_boolean"; - case DW_ATE_complex_float: - return "DW_ATE_complex_float"; - case DW_ATE_float: - return "DW_ATE_float"; - case DW_ATE_signed: - return "DW_ATE_signed"; - case DW_ATE_signed_char: - return "DW_ATE_signed_char"; - case DW_ATE_unsigned: - return "DW_ATE_unsigned"; - case DW_ATE_unsigned_char: - return "DW_ATE_unsigned_char"; - default: - return "DW_ATE_"; - } -} -#endif /* Determine the "ultimate origin" of a decl. The decl may be an inlined instance of an inlined instance of a decl which is local to an inline @@ -6769,6 +6809,22 @@ add_loc_descr_to_loc_list (dw_loc_list_ref *list_head, dw_loc_descr_ref descr, *d = new_loc_list (descr, begin, end, section, 0); } +static void +dwarf2out_switch_text_section (void) +{ + dw_fde_ref fde; + + gcc_assert (cfun); + + fde = &fde_table[fde_table_in_use - 1]; + fde->dw_fde_switched_sections = true; + fde->dw_fde_hot_section_label = cfun->hot_section_label; + fde->dw_fde_hot_section_end_label = cfun->hot_section_end_label; + fde->dw_fde_unlikely_section_label = cfun->cold_section_label; + fde->dw_fde_unlikely_section_end_label = cfun->cold_section_end_label; + separate_line_info_table_in_use++; +} + /* Output the location list given to us. */ static void @@ -7197,6 +7253,13 @@ output_aranges (void) dw2_asm_output_addr (DWARF2_ADDR_SIZE, text_section_label, "Address"); dw2_asm_output_delta (DWARF2_ADDR_SIZE, text_end_label, text_section_label, "Length"); + if (flag_reorder_blocks_and_partition) + { + dw2_asm_output_addr (DWARF2_ADDR_SIZE, cold_text_section_label, + "Address"); + dw2_asm_output_delta (DWARF2_ADDR_SIZE, cold_end_label, + cold_text_section_label, "Length"); + } for (i = 0; i < arange_table_in_use; i++) { @@ -7675,7 +7738,14 @@ output_line_info (void) a series of state machine operations. */ current_file = 1; current_line = 1; - strcpy (prev_line_label, text_section_label); + + if (cfun + && (last_text_section == in_unlikely_executed_text + || (last_text_section == in_named + && last_text_section_name == cfun->unlikely_text_section_name))) + strcpy (prev_line_label, cfun->cold_section_label); + else + strcpy (prev_line_label, text_section_label); for (lt_index = 1; lt_index < line_info_table_in_use; ++lt_index) { dw_line_info_ref line_info = &line_info_table[lt_index]; @@ -8048,7 +8118,6 @@ is_base_type (tree type) case METHOD_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: - case FILE_TYPE: case OFFSET_TYPE: case LANG_TYPE: case VECTOR_TYPE: @@ -8613,7 +8682,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode, bool can_use_fbreg) mem_loc_result = new_loc_descr (DW_OP_addr, 0, 0); mem_loc_result->dw_loc_oprnd1.val_class = dw_val_class_addr; mem_loc_result->dw_loc_oprnd1.v.val_addr = rtl; - VARRAY_PUSH_RTX (used_rtx_varray, rtl); + VEC_safe_push (rtx, gc, used_rtx_array, rtl); break; case PRE_MODIFY: @@ -9219,7 +9288,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address) #ifdef ENABLE_CHECKING /* Otherwise this is a generic code; we should just lists all of - these explicitly. Aborting means we forgot one. */ + these explicitly. We forgot one. */ gcc_unreachable (); #else /* In a release build, we want to degrade gracefully: better to @@ -9705,7 +9774,7 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) case LABEL_REF: case CONST: add_AT_addr (die, DW_AT_const_value, rtl); - VARRAY_PUSH_RTX (used_rtx_varray, rtl); + VEC_safe_push (rtx, gc, used_rtx_array, rtl); break; case PLUS: @@ -9729,6 +9798,53 @@ add_const_value_attribute (dw_die_ref die, rtx rtl) } +/* Generate an RTL constant from a decl initializer INIT with decl type TYPE, + for use in a later add_const_value_attribute call. */ + +static rtx +rtl_for_decl_init (tree init, tree type) +{ + rtx rtl = NULL_RTX; + + /* If a variable is initialized with a string constant without embedded + zeros, build CONST_STRING. */ + if (TREE_CODE (init) == STRING_CST && TREE_CODE (type) == ARRAY_TYPE) + { + tree enttype = TREE_TYPE (type); + tree domain = TYPE_DOMAIN (type); + enum machine_mode mode = TYPE_MODE (enttype); + + if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) == 1 + && domain + && integer_zerop (TYPE_MIN_VALUE (domain)) + && compare_tree_int (TYPE_MAX_VALUE (domain), + TREE_STRING_LENGTH (init) - 1) == 0 + && ((size_t) TREE_STRING_LENGTH (init) + == strlen (TREE_STRING_POINTER (init)) + 1)) + rtl = gen_rtx_CONST_STRING (VOIDmode, + ggc_strdup (TREE_STRING_POINTER (init))); + } + /* If the initializer is something that we know will expand into an + immediate RTL constant, expand it now. Expanding anything else + tends to produce unresolved symbols; see debug/5770 and c++/6381. */ + /* Aggregate, vector, and complex types may contain constructors that may + result in code being generated when expand_expr is called, so we can't + handle them here. Integer and float are useful and safe types to handle + here. */ + else if ((INTEGRAL_TYPE_P (type) || SCALAR_FLOAT_TYPE_P (type)) + && initializer_constant_valid_p (init, type) == null_pointer_node) + { + rtl = expand_expr (init, NULL_RTX, VOIDmode, EXPAND_INITIALIZER); + + /* If expand_expr returns a MEM, it wasn't immediate. */ + gcc_assert (!rtl || !MEM_P (rtl)); + } + + return rtl; +} + +/* Generate RTL for the variable DECL to represent its location. */ + static rtx rtl_for_decl_location (tree decl) { @@ -9924,40 +10040,7 @@ rtl_for_decl_location (tree decl) and will have been substituted directly into all expressions that use it. C does not have such a concept, but C++ and other languages do. */ else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl)) - { - /* If a variable is initialized with a string constant without embedded - zeros, build CONST_STRING. */ - if (TREE_CODE (DECL_INITIAL (decl)) == STRING_CST - && TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) - { - tree arrtype = TREE_TYPE (decl); - tree enttype = TREE_TYPE (arrtype); - tree domain = TYPE_DOMAIN (arrtype); - tree init = DECL_INITIAL (decl); - enum machine_mode mode = TYPE_MODE (enttype); - - if (GET_MODE_CLASS (mode) == MODE_INT && GET_MODE_SIZE (mode) == 1 - && domain - && integer_zerop (TYPE_MIN_VALUE (domain)) - && compare_tree_int (TYPE_MAX_VALUE (domain), - TREE_STRING_LENGTH (init) - 1) == 0 - && ((size_t) TREE_STRING_LENGTH (init) - == strlen (TREE_STRING_POINTER (init)) + 1)) - rtl = gen_rtx_CONST_STRING (VOIDmode, - ggc_strdup (TREE_STRING_POINTER (init))); - } - /* If the initializer is something that we know will expand into an - immediate RTL constant, expand it now. Expanding anything else - tends to produce unresolved symbols; see debug/5770 and c++/6381. */ - else if (TREE_CODE (DECL_INITIAL (decl)) == INTEGER_CST - || TREE_CODE (DECL_INITIAL (decl)) == REAL_CST) - { - rtl = expand_expr (DECL_INITIAL (decl), NULL_RTX, VOIDmode, - EXPAND_INITIALIZER); - /* If expand_expr returns a MEM, it wasn't immediate. */ - gcc_assert (!rtl || !MEM_P (rtl)); - } - } + rtl = rtl_for_decl_init (DECL_INITIAL (decl), TREE_TYPE (decl)); if (rtl) rtl = targetm.delegitimize_address (rtl); @@ -10034,7 +10117,6 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, dw_loc_list_ref list; rtx varloc; - /* We need to figure out what section we should use as the base for the address ranges where a given location is valid. 1. If this particular DECL has a section associated with it, @@ -10056,6 +10138,12 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl, tree sectree = DECL_SECTION_NAME (current_function_decl); secname = TREE_STRING_POINTER (sectree); } + else if (cfun + && (last_text_section == in_unlikely_executed_text + || (last_text_section == in_named + && last_text_section_name == + cfun->unlikely_text_section_name))) + secname = cfun->cold_section_label; else secname = text_section_label; @@ -10155,27 +10243,16 @@ tree_add_const_value_attribute (dw_die_ref var_die, tree decl) { tree init = DECL_INITIAL (decl); tree type = TREE_TYPE (decl); + rtx rtl; - if (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl) && init - && initializer_constant_valid_p (init, type) == null_pointer_node) + if (TREE_READONLY (decl) && ! TREE_THIS_VOLATILE (decl) && init) /* OK */; else return; - switch (TREE_CODE (type)) - { - case INTEGER_TYPE: - if (host_integerp (init, 0)) - add_AT_unsigned (var_die, DW_AT_const_value, - tree_low_cst (init, 0)); - else - add_AT_long_long (var_die, DW_AT_const_value, - TREE_INT_CST_HIGH (init), - TREE_INT_CST_LOW (init)); - break; - - default:; - } + rtl = rtl_for_decl_init (init, type); + if (rtl) + add_const_value_attribute (var_die, rtl); } /* Generate a DW_AT_name attribute given some string value to be included as @@ -10498,11 +10575,7 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin) if (TYPE_P (fn)) fn = TYPE_STUB_DECL (fn); - /* TYPE_STUB_DECL may have given us a NULL, which decl_function_context - won't like. */ - if (fn) - fn = decl_function_context (fn); - + fn = decl_function_context (fn); if (fn) dwarf2out_abstract_function (fn); } @@ -10516,7 +10589,7 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin) trees (in the case of java, they simply have no block tree, in some other languages). For these functions, there is nothing we can really do to output correct debug info for inlined functions in all cases. Rather - than abort, we'll just produce deficient debug info now, in that we will + than die, we'll just produce deficient debug info now, in that we will have variables without a proper abstract origin. In the future, when all functions are lowered, we should re-add a gcc_assert (origin_die) here. */ @@ -10589,7 +10662,7 @@ add_name_and_src_coords_attributes (dw_die_ref die, tree decl) { add_AT_addr (die, DW_AT_VMS_rtnbeg_pd_address, XEXP (DECL_RTL (decl), 0)); - VARRAY_PUSH_RTX (used_rtx_varray, XEXP (DECL_RTL (decl), 0)); + VEC_safe_push (tree, gc, used_rtx_array, XEXP (DECL_RTL (decl), 0)); } #endif } @@ -10599,7 +10672,7 @@ add_name_and_src_coords_attributes (dw_die_ref die, tree decl) static void push_decl_scope (tree scope) { - VARRAY_PUSH_TREE (decl_scope_table, scope); + VEC_safe_push (tree, gc, decl_scope_table, scope); } /* Pop a declaration scope. */ @@ -10607,9 +10680,7 @@ push_decl_scope (tree scope) static inline void pop_decl_scope (void) { - gcc_assert (VARRAY_ACTIVE_SIZE (decl_scope_table) > 0); - - VARRAY_POP (decl_scope_table); + VEC_pop (tree, decl_scope_table); } /* Return the DIE for the scope that immediately contains this type. @@ -10652,8 +10723,8 @@ scope_die_for (tree t, dw_die_ref context_die) /* For types, we can just look up the appropriate DIE. But first we check to see if we're in the middle of emitting it so we know where the new DIE should go. */ - for (i = VARRAY_ACTIVE_SIZE (decl_scope_table) - 1; i >= 0; --i) - if (VARRAY_TREE (decl_scope_table, i) == containing_scope) + for (i = VEC_length (tree, decl_scope_table) - 1; i >= 0; --i) + if (VEC_index (tree, decl_scope_table, i) == containing_scope) break; if (i < 0) @@ -10909,8 +10980,8 @@ retry_incomplete_types (void) { int i; - for (i = VARRAY_ACTIVE_SIZE (incomplete_types) - 1; i >= 0; i--) - gen_type_die (VARRAY_TREE (incomplete_types, i), comp_unit_die); + for (i = VEC_length (tree, incomplete_types) - 1; i >= 0; i--) + gen_type_die (VEC_index (tree, incomplete_types, i), comp_unit_die); } /* Generate a DIE to represent an inlined instance of an enumeration type. */ @@ -11152,13 +11223,27 @@ gen_type_die_for_member (tree type, tree member, dw_die_ref context_die) if (TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type)) && ! lookup_decl_die (member)) { + dw_die_ref type_die; gcc_assert (!decl_ultimate_origin (member)); push_decl_scope (type); + type_die = lookup_type_die (type); if (TREE_CODE (member) == FUNCTION_DECL) - gen_subprogram_die (member, lookup_type_die (type)); + gen_subprogram_die (member, type_die); + else if (TREE_CODE (member) == FIELD_DECL) + { + /* Ignore the nameless fields that are used to skip bits but handle + C++ anonymous unions and structs. */ + if (DECL_NAME (member) != NULL_TREE + || TREE_CODE (TREE_TYPE (member)) == UNION_TYPE + || TREE_CODE (TREE_TYPE (member)) == RECORD_TYPE) + { + gen_type_die (member_declared_type (member), type_die); + gen_field_die (member, type_die); + } + } else - gen_variable_die (member, lookup_type_die (type)); + gen_variable_die (member, type_die); pop_decl_scope (); } @@ -11362,15 +11447,33 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) if (!old_die || !get_AT (old_die, DW_AT_inline)) equate_decl_number_to_die (decl, subr_die); - ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_BEGIN_LABEL, - current_function_funcdef_no); - add_AT_lbl_id (subr_die, DW_AT_low_pc, label_id); - ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_END_LABEL, - current_function_funcdef_no); - add_AT_lbl_id (subr_die, DW_AT_high_pc, label_id); - - add_pubname (decl, subr_die); - add_arange (decl, subr_die); + if (!flag_reorder_blocks_and_partition) + { + ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_BEGIN_LABEL, + current_function_funcdef_no); + add_AT_lbl_id (subr_die, DW_AT_low_pc, label_id); + ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_END_LABEL, + current_function_funcdef_no); + add_AT_lbl_id (subr_die, DW_AT_high_pc, label_id); + + add_pubname (decl, subr_die); + add_arange (decl, subr_die); + } + else + { /* Do nothing for now; maybe need to duplicate die, one for + hot section and ond for cold section, then use the hot/cold + section begin/end labels to generate the aranges... */ + /* + add_AT_lbl_id (subr_die, DW_AT_low_pc, hot_section_label); + add_AT_lbl_id (subr_die, DW_AT_high_pc, hot_section_end_label); + add_AT_lbl_id (subr_die, DW_AT_lo_user, unlikely_section_label); + add_AT_lbl_id (subr_die, DW_AT_hi_user, cold_section_end_label); + + add_pubname (decl, subr_die); + add_arange (decl, subr_die); + add_arange (decl, subr_die); + */ + } #ifdef MIPS_DEBUGGING_INFO /* Add a reference to the FDE for this routine. */ @@ -11516,8 +11619,13 @@ gen_variable_die (tree decl, dw_die_ref context_die) copy decls and set the DECL_ABSTRACT flag on them instead of sharing them. - ??? Duplicated blocks have been rewritten to use .debug_ranges. */ - else if (old_die && TREE_STATIC (decl) + ??? Duplicated blocks have been rewritten to use .debug_ranges. + + ??? The declare_in_namespace support causes us to get two DIEs for one + variable, both of which are declarations. We want to avoid considering + one to be a specification, so we must test that this DIE is not a + declaration. */ + else if (old_die && TREE_STATIC (decl) && ! declaration && get_AT_flag (old_die, DW_AT_declaration) == 1) { /* This is a definition of a C++ class level static. */ @@ -11611,41 +11719,49 @@ gen_label_die (tree decl, dw_die_ref context_die) } } -/* Generate a DIE for a lexical block. */ +/* A helper function for gen_lexical_block_die and gen_inlined_subroutine_die. + Add low_pc and high_pc attributes to the DIE for a block STMT. */ -static void -gen_lexical_block_die (tree stmt, dw_die_ref context_die, int depth) +static inline void +add_high_low_attributes (tree stmt, dw_die_ref die) { - dw_die_ref stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); char label[MAX_ARTIFICIAL_LABEL_BYTES]; - if (! BLOCK_ABSTRACT (stmt)) + if (BLOCK_FRAGMENT_CHAIN (stmt)) { - if (BLOCK_FRAGMENT_CHAIN (stmt)) - { - tree chain; + tree chain; - add_AT_range_list (stmt_die, DW_AT_ranges, add_ranges (stmt)); + add_AT_range_list (die, DW_AT_ranges, add_ranges (stmt)); - chain = BLOCK_FRAGMENT_CHAIN (stmt); - do - { - add_ranges (chain); - chain = BLOCK_FRAGMENT_CHAIN (chain); - } - while (chain); - add_ranges (NULL); - } - else + chain = BLOCK_FRAGMENT_CHAIN (stmt); + do { - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (stmt_die, DW_AT_low_pc, label); - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_END_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (stmt_die, DW_AT_high_pc, label); + add_ranges (chain); + chain = BLOCK_FRAGMENT_CHAIN (chain); } + while (chain); + add_ranges (NULL); } + else + { + ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, + BLOCK_NUMBER (stmt)); + add_AT_lbl_id (die, DW_AT_low_pc, label); + ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_END_LABEL, + BLOCK_NUMBER (stmt)); + add_AT_lbl_id (die, DW_AT_high_pc, label); + } +} + +/* Generate a DIE for a lexical block. */ + +static void +gen_lexical_block_die (tree stmt, dw_die_ref context_die, int depth) +{ + dw_die_ref stmt_die = new_die (DW_TAG_lexical_block, context_die, stmt); + + if (! BLOCK_ABSTRACT (stmt)) + add_high_low_attributes (stmt, stmt_die); decls_for_scope (stmt, stmt_die, depth); } @@ -11667,15 +11783,10 @@ gen_inlined_subroutine_die (tree stmt, dw_die_ref context_die, int depth) { dw_die_ref subr_die = new_die (DW_TAG_inlined_subroutine, context_die, stmt); - char label[MAX_ARTIFICIAL_LABEL_BYTES]; add_abstract_origin_attribute (subr_die, decl); - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_BEGIN_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (subr_die, DW_AT_low_pc, label); - ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_END_LABEL, - BLOCK_NUMBER (stmt)); - add_AT_lbl_id (subr_die, DW_AT_high_pc, label); + add_high_low_attributes (stmt, subr_die); + decls_for_scope (stmt, subr_die, depth); current_function_has_inlines = 1; } @@ -11897,7 +12008,7 @@ gen_member_die (tree type, dw_die_ref context_die) /* First output info about the base classes. */ if (binfo) { - VEC (tree) *accesses = BINFO_BASE_ACCESSES (binfo); + VEC(tree,gc) *accesses = BINFO_BASE_ACCESSES (binfo); int i; tree base; @@ -12016,7 +12127,7 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die) /* We don't need to do this for function-local types. */ if (TYPE_STUB_DECL (type) && ! decl_function_context (TYPE_STUB_DECL (type))) - VARRAY_PUSH_TREE (incomplete_types, type); + VEC_safe_push (tree, gc, incomplete_types, type); } } @@ -12142,12 +12253,6 @@ gen_type_die (tree type, dw_die_ref context_die) gen_ptr_to_mbr_type_die (type, context_die); break; - case FILE_TYPE: - gen_type_die (TREE_TYPE (type), context_die); - /* No way to represent these in Dwarf yet! */ - gcc_unreachable (); - break; - case FUNCTION_TYPE: /* Force out return type (in case it wasn't forced out already). */ gen_type_die (TREE_TYPE (type), context_die); @@ -12439,7 +12544,7 @@ is_redundant_typedef (tree decl) return 0; } -/* Returns the DIE for decl or aborts. */ +/* Returns the DIE for decl. A DIE will always be returned. */ static dw_die_ref force_decl_die (tree decl) @@ -12492,8 +12597,7 @@ force_decl_die (tree decl) gcc_unreachable (); } - /* See if we can find the die for this deci now. - If not then abort. */ + /* We should be able to find the DIE now. */ if (!decl_die) decl_die = lookup_decl_die (decl); gcc_assert (decl_die); @@ -12502,7 +12606,7 @@ force_decl_die (tree decl) return decl_die; } -/* Returns the DIE for decl or aborts. */ +/* Returns the DIE for TYPE. A DIE is always returned. */ static dw_die_ref force_type_die (tree type) @@ -12557,6 +12661,12 @@ declare_in_namespace (tree thing, dw_die_ref context_die) if (debug_info_level <= DINFO_LEVEL_TERSE) return; + /* If this decl is from an inlined function, then don't try to emit it in its + namespace, as we will get confused. It would have already been emitted + when the abstract instance of the inline function was emitted anyways. */ + if (DECL_P (thing) && DECL_ABSTRACT_ORIGIN (thing)) + return; + ns_context = setup_namespace_context (thing, context_die); if (ns_context != context_die) @@ -12844,7 +12954,29 @@ dwarf2out_imported_module_or_decl (tree decl, tree context) if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == CONST_DECL) at_import_die = force_type_die (TREE_TYPE (decl)); else - at_import_die = force_decl_die (decl); + { + at_import_die = lookup_decl_die (decl); + if (!at_import_die) + { + /* If we're trying to avoid duplicate debug info, we may not have + emitted the member decl for this field. Emit it now. */ + if (TREE_CODE (decl) == FIELD_DECL) + { + tree type = DECL_CONTEXT (decl); + dw_die_ref type_context_die; + + if (TYPE_CONTEXT (type)) + if (TYPE_P (TYPE_CONTEXT (type))) + type_context_die = force_type_die (TYPE_CONTEXT (type)); + else + type_context_die = force_decl_die (TYPE_CONTEXT (type)); + else + type_context_die = comp_unit_die; + gen_type_die_for_member (type, decl, type_context_die); + } + at_import_die = force_decl_die (decl); + } + } /* OK, now we have DIEs for decl as well as scope. Emit imported die. */ if (TREE_CODE (decl) == NAMESPACE_DECL) @@ -12981,7 +13113,7 @@ static void dwarf2out_begin_block (unsigned int line ATTRIBUTE_UNUSED, unsigned int blocknum) { - function_section (current_function_decl); + current_function_section (current_function_decl); ASM_OUTPUT_DEBUG_LABEL (asm_out_file, BLOCK_BEGIN_LABEL, blocknum); } @@ -12991,7 +13123,7 @@ dwarf2out_begin_block (unsigned int line ATTRIBUTE_UNUSED, static void dwarf2out_end_block (unsigned int line ATTRIBUTE_UNUSED, unsigned int blocknum) { - function_section (current_function_decl); + current_function_section (current_function_decl); ASM_OUTPUT_DEBUG_LABEL (asm_out_file, BLOCK_END_LABEL, blocknum); } @@ -13057,6 +13189,14 @@ lookup_filename (const char *file_name) VARRAY_PUSH_CHAR_PTR (file_table, save_file_name); VARRAY_PUSH_UINT (file_table_emitted, 0); + /* If the assembler is emitting the file table, and we aren't eliminating + unused debug types, then we must emit .file here. If we are eliminating + unused debug types, then this will be done by the maybe_emit_file call in + prune_unused_types_walk_attribs. */ + + if (DWARF2_ASM_LINE_DEBUG_INFO && ! flag_eliminate_unused_debug_types) + maybe_emit_file (i); + return i; } @@ -13132,6 +13272,14 @@ dwarf2out_var_location (rtx loc_note) newloc->var_loc_note = loc_note; newloc->next = NULL; + if (cfun + && (last_text_section == in_unlikely_executed_text + || (last_text_section == in_named + && last_text_section_name == cfun->unlikely_text_section_name))) + newloc->section_label = cfun->cold_section_label; + else + newloc->section_label = text_section_label; + last_insn = loc_note; last_label = newloc->label; decl = NOTE_VAR_LOCATION_DECL (loc_note); @@ -13162,7 +13310,7 @@ dwarf2out_source_line (unsigned int line, const char *filename) if (debug_info_level >= DINFO_LEVEL_NORMAL && line != 0) { - function_section (current_function_decl); + current_function_section (current_function_decl); /* If requested, emit something human-readable. */ if (flag_debug_asm) @@ -13333,7 +13481,7 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED) decl_loc_table_eq, NULL); /* Allocate the initial hunk of the decl_scope_table. */ - VARRAY_TREE_INIT (decl_scope_table, 256, "decl_scope_table"); + decl_scope_table = VEC_alloc (tree, gc, 256); /* Allocate the initial hunk of the abbrev_die_table. */ abbrev_die_table = ggc_alloc_cleared (ABBREV_DIE_TABLE_INCREMENT @@ -13358,14 +13506,17 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED) in this value in dwarf2out_finish. */ comp_unit_die = gen_compile_unit_die (NULL); - VARRAY_TREE_INIT (incomplete_types, 64, "incomplete_types"); + incomplete_types = VEC_alloc (tree, gc, 64); - VARRAY_RTX_INIT (used_rtx_varray, 32, "used_rtx_varray"); + used_rtx_array = VEC_alloc (rtx, gc, 32); ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0); ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label, DEBUG_ABBREV_SECTION_LABEL, 0); ASM_GENERATE_INTERNAL_LABEL (text_section_label, TEXT_SECTION_LABEL, 0); + ASM_GENERATE_INTERNAL_LABEL (cold_text_section_label, + COLD_TEXT_SECTION_LABEL, 0); + ASM_GENERATE_INTERNAL_LABEL (cold_end_label, COLD_END_LABEL, 0); ASM_GENERATE_INTERNAL_LABEL (debug_info_section_label, DEBUG_INFO_SECTION_LABEL, 0); @@ -13390,6 +13541,11 @@ dwarf2out_init (const char *filename ATTRIBUTE_UNUSED) text_section (); ASM_OUTPUT_LABEL (asm_out_file, text_section_label); + if (flag_reorder_blocks_and_partition) + { + unlikely_text_section (); + ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label); + } } /* A helper function for dwarf2out_finish called through @@ -13721,6 +13877,11 @@ dwarf2out_finish (const char *filename) /* Output a terminator label for the .text section. */ text_section (); targetm.asm_out.internal_label (asm_out_file, TEXT_END_LABEL, 0); + if (flag_reorder_blocks_and_partition) + { + unlikely_text_section (); + targetm.asm_out.internal_label (asm_out_file, COLD_END_LABEL, 0); + } /* Output the source line correspondence table. We must do this even if there is no line information. Otherwise, on an empty diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 947fdf6449b..1565ca20d18 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -1330,9 +1330,10 @@ operand_subword (rtx op, unsigned int offset, int validate_address, enum machine return simplify_gen_subreg (word_mode, op, mode, (offset * UNITS_PER_WORD)); } -/* Similar to `operand_subword', but never return 0. If we can't extract - the required subword, put OP into a register and try again. If that fails, - abort. We always validate the address in this case. +/* Similar to `operand_subword', but never return 0. If we can't + extract the required subword, put OP into a register and try again. + The second attempt must succeed. We always validate the address in + this case. MODE is the mode of OP, in case it is CONST_INT. */ @@ -1360,38 +1361,6 @@ operand_subword_force (rtx op, unsigned int offset, enum machine_mode mode) return result; } -/* Given a compare instruction, swap the operands. - A test instruction is changed into a compare of 0 against the operand. */ - -void -reverse_comparison (rtx insn) -{ - rtx body = PATTERN (insn); - rtx comp; - - if (GET_CODE (body) == SET) - comp = SET_SRC (body); - else - comp = SET_SRC (XVECEXP (body, 0, 0)); - - if (GET_CODE (comp) == COMPARE) - { - rtx op0 = XEXP (comp, 0); - rtx op1 = XEXP (comp, 1); - XEXP (comp, 0) = op1; - XEXP (comp, 1) = op0; - } - else - { - rtx new = gen_rtx_COMPARE (VOIDmode, - CONST0_RTX (GET_MODE (comp)), comp); - if (GET_CODE (body) == SET) - SET_SRC (body) = new; - else - SET_SRC (XVECEXP (body, 0, 0)) = new; - } -} - /* Within a MEM_EXPR, we care about either (1) a component ref of a decl, or (2) a component ref of something variable. Represent the later with a NULL expression. */ @@ -1610,8 +1579,8 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp, index, then convert to sizetype and multiply by the size of the array element. */ if (! integer_zerop (low_bound)) - index = fold (build2 (MINUS_EXPR, TREE_TYPE (index), - index, low_bound)); + index = fold_build2 (MINUS_EXPR, TREE_TYPE (index), + index, low_bound); off_tree = size_binop (PLUS_EXPR, size_binop (MULT_EXPR, convert (sizetype, @@ -2728,7 +2697,7 @@ get_first_nonnote_insn (void) continue; else { - if (GET_CODE (insn) == INSN + if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) insn = XVECEXP (PATTERN (insn), 0, 0); } @@ -2754,7 +2723,7 @@ get_last_nonnote_insn (void) continue; else { - if (GET_CODE (insn) == INSN + if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) insn = XVECEXP (PATTERN (insn), 0, XVECLEN (PATTERN (insn), 0) - 1); @@ -3297,7 +3266,7 @@ make_insn_raw (rtx pattern) || (GET_CODE (insn) == SET && SET_DEST (insn) == pc_rtx))) { - warning ("ICE: emit_insn used where emit_jump_insn needed:\n"); + warning (0, "ICE: emit_insn used where emit_jump_insn needed:\n"); debug_rtx (insn); } #endif diff --git a/gcc/errors.c b/gcc/errors.c index 6889c736efd..856b50edf51 100644 --- a/gcc/errors.c +++ b/gcc/errors.c @@ -1,5 +1,5 @@ /* Basic error reporting routines. - Copyright (C) 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -42,7 +42,7 @@ int have_error = 0; /* Print a warning message - output produced, but there may be problems. */ void -warning (const char *format, ...) +warning (int opt ATTRIBUTE_UNUSED, const char *format, ...) { va_list ap; diff --git a/gcc/errors.h b/gcc/errors.h index 03b94cafcad..9aa87e72852 100644 --- a/gcc/errors.h +++ b/gcc/errors.h @@ -1,5 +1,5 @@ /* Basic error reporting routines. - Copyright (C) 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -30,7 +30,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifndef GCC_ERRORS_H #define GCC_ERRORS_H -extern void warning (const char *, ...); +extern void warning (int, const char *, ...); extern void error (const char *, ...); extern void fatal (const char *, ...) ATTRIBUTE_NORETURN; extern void internal_error (const char *, ...) ATTRIBUTE_NORETURN; diff --git a/gcc/et-forest.c b/gcc/et-forest.c index 7fbbb77312c..928a0c0e5df 100644 --- a/gcc/et-forest.c +++ b/gcc/et-forest.c @@ -1,6 +1,6 @@ /* ET-trees data structure implementation. Contributed by Pavel Nejedly - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the libiberty library. Libiberty is free software; you can redistribute it and/or @@ -499,6 +499,15 @@ et_free_tree (struct et_node *t) pool_free (et_nodes, t); } +/* Releases et tree T without maintaining other nodes. */ + +void +et_free_tree_force (struct et_node *t) +{ + pool_free (et_occurrences, t->rightmost_occ); + pool_free (et_nodes, t); +} + /* Sets father of et tree T to FATHER. */ void diff --git a/gcc/et-forest.h b/gcc/et-forest.h index 2f2c260e8d8..17ce6090a55 100644 --- a/gcc/et-forest.h +++ b/gcc/et-forest.h @@ -1,5 +1,5 @@ /* Et-forest data structure implementation. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 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 @@ -73,6 +73,7 @@ struct et_node struct et_node *et_new_tree (void *data); void et_free_tree (struct et_node *); +void et_free_tree_force (struct et_node *); void et_set_father (struct et_node *, struct et_node *); void et_split (struct et_node *); struct et_node *et_nca (struct et_node *, struct et_node *); diff --git a/gcc/except.c b/gcc/except.c index d774bf3fa25..9f1bfe926af 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -74,6 +74,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "target.h" #include "langhooks.h" #include "cgraph.h" +#include "diagnostic.h" /* Provide defaults for stuff that may not be defined when using sjlj exceptions. */ @@ -177,14 +178,12 @@ struct eh_region GTY(()) /* Retain the cleanup expression even after expansion so that we can match up fixup regions. */ struct eh_region_u_cleanup { - tree exp; struct eh_region *prev_try; } GTY ((tag ("ERT_CLEANUP"))) cleanup; /* The real region (by expression and by pointer) that fixup code should live in. */ struct eh_region_u_fixup { - tree cleanup_exp; struct eh_region *real_region; bool resolved; } GTY ((tag ("ERT_FIXUP"))) fixup; @@ -235,7 +234,7 @@ struct eh_status GTY(()) int built_landing_pads; int last_region_number; - varray_type ttype_data; + VEC(tree,gc) *ttype_data; varray_type ehspec_data; varray_type action_record_data; @@ -252,6 +251,8 @@ struct eh_status GTY(()) rtx sjlj_fc; rtx sjlj_exit_after; + + htab_t GTY((param_is (struct throw_stmt_node))) throw_stmt_table; }; @@ -852,6 +853,148 @@ current_function_has_exception_handlers (void) return false; } +static struct eh_region * +duplicate_eh_region_1 (struct eh_region *o) +{ + struct eh_region *n = ggc_alloc_cleared (sizeof (struct eh_region)); + + *n = *o; + + n->region_number = o->region_number + cfun->eh->last_region_number; + gcc_assert (!o->aka); + + return n; +} + +static void +duplicate_eh_region_2 (struct eh_region *o, struct eh_region **n_array, + struct eh_region *prev_try) +{ + struct eh_region *n = n_array[o->region_number]; + + switch (n->type) + { + case ERT_TRY: + if (o->u.try.catch) + n->u.try.catch = n_array[o->u.try.catch->region_number]; + if (o->u.try.last_catch) + n->u.try.last_catch = n_array[o->u.try.last_catch->region_number]; + break; + + case ERT_CATCH: + if (o->u.catch.next_catch) + n->u.catch.next_catch = n_array[o->u.catch.next_catch->region_number]; + if (o->u.catch.prev_catch) + n->u.catch.prev_catch = n_array[o->u.catch.prev_catch->region_number]; + break; + + case ERT_CLEANUP: + if (o->u.cleanup.prev_try) + n->u.cleanup.prev_try = n_array[o->u.cleanup.prev_try->region_number]; + else + n->u.cleanup.prev_try = prev_try; + break; + + default: + break; + } + + if (o->outer) + n->outer = n_array[o->outer->region_number]; + if (o->inner) + n->inner = n_array[o->inner->region_number]; + if (o->next_peer) + n->next_peer = n_array[o->next_peer->region_number]; +} + +/* Duplicate the EH regions of IFUN into current function, root the tree in + OUTER_REGION and remap labels using MAP callback. */ +int +duplicate_eh_regions (struct function *ifun, duplicate_eh_regions_map map, + void *data, int outer_region) +{ + int ifun_last_region_number = ifun->eh->last_region_number; + struct eh_region **n_array, *root, *cur, *prev_try; + int i; + + if (ifun_last_region_number == 0 || !ifun->eh->region_tree) + return 0; + + n_array = xcalloc (ifun_last_region_number + 1, sizeof (*n_array)); + + /* Search for the containing ERT_TRY region to fix up + the prev_try short-cuts for ERT_CLEANUP regions. */ + prev_try = NULL; + if (outer_region > 0) + for (prev_try = cfun->eh->region_array[outer_region]; + prev_try && prev_try->type != ERT_TRY; + prev_try = prev_try->outer) + ; + + for (i = 1; i <= ifun_last_region_number; ++i) + { + cur = ifun->eh->region_array[i]; + if (!cur || cur->region_number != i) + continue; + n_array[i] = duplicate_eh_region_1 (cur); + if (cur->tree_label) + { + tree newlabel = map (cur->tree_label, data); + n_array[i]->tree_label = newlabel; + } + else + n_array[i]->tree_label = NULL; + } + for (i = 1; i <= ifun_last_region_number; ++i) + { + cur = ifun->eh->region_array[i]; + if (!cur || cur->region_number != i) + continue; + duplicate_eh_region_2 (cur, n_array, prev_try); + } + + root = n_array[ifun->eh->region_tree->region_number]; + gcc_assert (root->outer == NULL); + if (outer_region > 0) + { + struct eh_region *cur = cfun->eh->region_array[outer_region]; + struct eh_region *p = cur->inner; + + if (p) + { + while (p->next_peer) + p = p->next_peer; + p->next_peer = root; + } + else + cur->inner = root; + for (i = 1; i <= ifun_last_region_number; ++i) + if (n_array[i] && n_array[i]->outer == NULL) + n_array[i]->outer = cur; + } + else + { + struct eh_region *p = cfun->eh->region_tree; + if (p) + { + while (p->next_peer) + p = p->next_peer; + p->next_peer = root; + } + else + cfun->eh->region_tree = root; + } + + free (n_array); + + i = cfun->eh->last_region_number; + cfun->eh->last_region_number = i + ifun_last_region_number; + + collect_eh_region_array (); + + return i; +} + static int t2r_eq (const void *pentry, const void *pdata) { @@ -967,10 +1110,10 @@ add_ttypes_entry (htab_t ttypes_hash, tree type) n = xmalloc (sizeof (*n)); n->t = type; - n->filter = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + 1; + n->filter = VEC_length (tree, cfun->eh->ttype_data) + 1; *slot = n; - VARRAY_PUSH_TREE (cfun->eh->ttype_data, type); + VEC_safe_push (tree, gc, cfun->eh->ttype_data, type); } return n->filter; @@ -1020,7 +1163,7 @@ assign_filter_values (void) int i; htab_t ttypes, ehspec; - VARRAY_TREE_INIT (cfun->eh->ttype_data, 16, "ttype_data"); + cfun->eh->ttype_data = VEC_alloc (tree, gc, 16); VARRAY_UCHAR_INIT (cfun->eh->ehspec_data, 64, "ehspec_data"); ttypes = htab_create (31, ttypes_filter_hash, ttypes_filter_eq, free); @@ -2272,8 +2415,13 @@ reachable_next_level (struct eh_region *region, tree type_thrown, /* Here we end our search, since no exceptions may propagate. If we've touched down at some landing pad previous, then the explicit function call we generated may be used. Otherwise - the call is made by the runtime. */ - if (info && info->saw_any_handlers) + the call is made by the runtime. + + Before inlining, do not perform this optimization. We may + inline a subroutine that contains handlers, and that will + change the value of saw_any_handlers. */ + + if ((info && info->saw_any_handlers) || !cfun->after_inlining) { add_reachable_handler (info, region, region); return RNL_CAUGHT; @@ -3258,7 +3406,7 @@ output_function_exception_table (void) targetm.asm_out.exception_section (); #endif - have_tt_data = (VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) > 0 + have_tt_data = (VEC_length (tree, cfun->eh->ttype_data) > 0 || VARRAY_ACTIVE_SIZE (cfun->eh->ehspec_data) > 0); /* Indicate the format of the @TType entries. */ @@ -3321,7 +3469,7 @@ output_function_exception_table (void) after_disp = (1 + size_of_uleb128 (call_site_len) + call_site_len + VARRAY_ACTIVE_SIZE (cfun->eh->action_record_data) - + (VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) + + (VEC_length (tree, cfun->eh->ttype_data) * tt_format_size)); disp = after_disp; @@ -3383,10 +3531,10 @@ output_function_exception_table (void) if (have_tt_data) assemble_align (tt_format_size * BITS_PER_UNIT); - i = VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data); + i = VEC_length (tree, cfun->eh->ttype_data); while (i-- > 0) { - tree type = VARRAY_TREE (cfun->eh->ttype_data, i); + tree type = VEC_index (tree, cfun->eh->ttype_data, i); rtx value; if (type == NULL_TREE) @@ -3434,7 +3582,151 @@ output_function_exception_table (void) dw2_asm_output_data (1, VARRAY_UCHAR (cfun->eh->ehspec_data, i), (i ? NULL : "Exception specification table")); - function_section (current_function_decl); + current_function_section (current_function_decl); +} + +void +set_eh_throw_stmt_table (struct function *fun, struct htab *table) +{ + fun->eh->throw_stmt_table = table; +} + +htab_t +get_eh_throw_stmt_table (struct function *fun) +{ + return fun->eh->throw_stmt_table; } +/* Dump EH information to OUT. */ +void +dump_eh_tree (FILE *out, struct function *fun) +{ + struct eh_region *i; + int depth = 0; + static const char * const type_name[] = {"unknown", "cleanup", "try", "catch", + "allowed_exceptions", "must_not_throw", + "throw", "fixup"}; + + i = fun->eh->region_tree; + if (! i) + return; + + fprintf (out, "Eh tree:\n"); + while (1) + { + fprintf (out, " %*s %i %s", depth * 2, "", + i->region_number, type_name [(int)i->type]); + if (i->tree_label) + { + fprintf (out, " tree_label:"); + print_generic_expr (out, i->tree_label, 0); + } + fprintf (out, "\n"); + /* If there are sub-regions, process them. */ + if (i->inner) + i = i->inner, depth++; + /* If there are peers, process them. */ + else if (i->next_peer) + i = i->next_peer; + /* Otherwise, step back up the tree to the next peer. */ + else + { + do { + i = i->outer; + depth--; + if (i == NULL) + return; + } while (i->next_peer == NULL); + i = i->next_peer; + } + } +} + +/* Verify some basic invariants on EH datastructures. Could be extended to + catch more. */ +void +verify_eh_tree (struct function *fun) +{ + struct eh_region *i, *outer = NULL; + bool err = false; + int nvisited = 0; + int count = 0; + int j; + int depth = 0; + + i = fun->eh->region_tree; + if (! i) + return; + for (j = fun->eh->last_region_number; j > 0; --j) + if (fun->eh->region_array[j]) + { + count++; + if (fun->eh->region_array[j]->region_number != j) + { + error ("region_array is corrupted for region %i", i->region_number); + err = true; + } + } + + while (1) + { + if (fun->eh->region_array[i->region_number] != i) + { + error ("region_array is corrupted for region %i", i->region_number); + err = true; + } + if (i->outer != outer) + { + error ("outer block of region %i is wrong", i->region_number); + err = true; + } + if (i->may_contain_throw && outer && !outer->may_contain_throw) + { + error ("region %i may contain throw and is contained in region that may not", + i->region_number); + err = true; + } + if (depth < 0) + { + error ("negative nesting depth of region %i", i->region_number); + err = true; + } + nvisited ++; + /* If there are sub-regions, process them. */ + if (i->inner) + outer = i, i = i->inner, depth++; + /* If there are peers, process them. */ + else if (i->next_peer) + i = i->next_peer; + /* Otherwise, step back up the tree to the next peer. */ + else + { + do { + i = i->outer; + depth--; + if (i == NULL) + { + if (depth != -1) + { + error ("Tree list ends on depth %i", depth + 1); + err = true; + } + if (count != nvisited) + { + error ("array does not match the region tree"); + err = true; + } + if (err) + { + dump_eh_tree (stderr, fun); + internal_error ("verify_eh_tree failed."); + } + return; + } + outer = i->outer; + } while (i->next_peer == NULL); + i = i->next_peer; + } + } +} #include "gt-except.h" diff --git a/gcc/except.h b/gcc/except.h index 05a3417832b..9526b865909 100644 --- a/gcc/except.h +++ b/gcc/except.h @@ -81,6 +81,8 @@ extern void expand_eh_return (void); extern rtx expand_builtin_extend_pointer (tree); extern rtx get_exception_pointer (struct function *); extern rtx get_exception_filter (struct function *); +typedef tree (*duplicate_eh_regions_map) (tree, void *); +extern int duplicate_eh_regions (struct function *, duplicate_eh_regions_map, void *, int); extern void sjlj_emit_function_exit_after (rtx); @@ -101,9 +103,15 @@ extern void foreach_reachable_handler (int, bool, extern void collect_eh_region_array (void); extern void expand_resx_expr (tree); +extern void verify_eh_tree (struct function *); +extern void dump_eh_tree (FILE *, struct function *); /* tree-eh.c */ +extern void add_stmt_to_eh_region_fn (struct function *, tree, int); +extern bool remove_stmt_from_eh_region_fn (struct function *, tree); +extern int lookup_stmt_eh_region_fn (struct function *, tree); extern int lookup_stmt_eh_region (tree); +extern bool verify_eh_edges (tree); /* If non-NULL, this is a function that returns an expression to be executed if an unhandled exception is propagated out of a cleanup @@ -155,3 +163,12 @@ extern tree (*lang_eh_runtime_type) (tree); #else # define USING_SJLJ_EXCEPTIONS MUST_USE_SJLJ_EXCEPTIONS #endif + +struct throw_stmt_node GTY(()) +{ + tree stmt; + int region_nr; +}; + +extern struct htab *get_eh_throw_stmt_table (struct function *); +extern void set_eh_throw_stmt_table (struct function *, struct htab *); diff --git a/gcc/explow.c b/gcc/explow.c index c1cd34cddc8..fed0872d406 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -313,6 +313,7 @@ convert_memory_address (enum machine_mode to_mode ATTRIBUTE_UNUSED, rtx x) { #ifndef POINTERS_EXTEND_UNSIGNED + gcc_assert (GET_MODE (x) == to_mode || GET_MODE (x) == VOIDmode); return x; #else /* defined(POINTERS_EXTEND_UNSIGNED) */ enum machine_mode from_mode; @@ -1017,83 +1018,6 @@ update_nonlocal_goto_save_area (void) emit_stack_save (SAVE_NONLOCAL, &r_save, NULL_RTX); } -#ifdef SETJMP_VIA_SAVE_AREA -/* Optimize RTL generated by allocate_dynamic_stack_space for targets - where SETJMP_VIA_SAVE_AREA is true. The problem is that on these - platforms, the dynamic stack space used can corrupt the original - frame, thus causing a crash if a longjmp unwinds to it. */ - -void -optimize_save_area_alloca (void) -{ - rtx insn; - - for (insn = get_insns (); insn; insn = NEXT_INSN(insn)) - { - rtx note; - - if (!NONJUMP_INSN_P (insn)) - continue; - - for (note = REG_NOTES (insn); note; note = XEXP (note, 1)) - { - if (REG_NOTE_KIND (note) != REG_SAVE_AREA) - continue; - - if (!current_function_calls_setjmp) - { - rtx pat = PATTERN (insn); - - /* If we do not see the note in a pattern matching - these precise characteristics, we did something - entirely wrong in allocate_dynamic_stack_space. - - Note, one way this could happen is if SETJMP_VIA_SAVE_AREA - was defined on a machine where stacks grow towards higher - addresses. - - Right now only supported port with stack that grow upward - is the HPPA and it does not define SETJMP_VIA_SAVE_AREA. */ - gcc_assert (GET_CODE (pat) == SET - && SET_DEST (pat) == stack_pointer_rtx - && GET_CODE (SET_SRC (pat)) == MINUS - && XEXP (SET_SRC (pat), 0) == stack_pointer_rtx); - - /* This will now be transformed into a (set REG REG) - so we can just blow away all the other notes. */ - XEXP (SET_SRC (pat), 1) = XEXP (note, 0); - REG_NOTES (insn) = NULL_RTX; - } - else - { - /* setjmp was called, we must remove the REG_SAVE_AREA - note so that later passes do not get confused by its - presence. */ - if (note == REG_NOTES (insn)) - { - REG_NOTES (insn) = XEXP (note, 1); - } - else - { - rtx srch; - - for (srch = REG_NOTES (insn); srch; srch = XEXP (srch, 1)) - if (XEXP (srch, 1) == note) - break; - - gcc_assert (srch); - - XEXP (srch, 1) = XEXP (note, 1); - } - } - /* Once we've seen the note of interest, we need not look at - the rest of them. */ - break; - } - } -} -#endif /* SETJMP_VIA_SAVE_AREA */ - /* Return an rtx representing the address of an area of memory dynamically pushed on the stack. This region of memory is always aligned to a multiple of BIGGEST_ALIGNMENT. @@ -1108,10 +1032,6 @@ optimize_save_area_alloca (void) rtx allocate_dynamic_stack_space (rtx size, rtx target, int known_align) { -#ifdef SETJMP_VIA_SAVE_AREA - rtx setjmpless_size = NULL_RTX; -#endif - /* If we're asking for zero bytes, it doesn't matter what we point to since we can't dereference it. But return a reasonable address anyway. */ @@ -1160,51 +1080,47 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) avoid clobbering the reg save area. Note that the offset of virtual_incoming_args_rtx includes the preallocated stack args space. It would be no problem to clobber that, but it's on the wrong side - of the old save area. */ - { - rtx dynamic_offset - = expand_binop (Pmode, sub_optab, virtual_stack_dynamic_rtx, - stack_pointer_rtx, NULL_RTX, 1, OPTAB_LIB_WIDEN); + of the old save area. + + What used to happen is that, since we did not know for sure + whether setjmp() was invoked until after RTL generation, we + would use reg notes to store the "optimized" size and fix things + up later. These days we know this information before we ever + start building RTL so the reg notes are unnecessary. */ + if (!current_function_calls_setjmp) + { + int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT; - if (!current_function_calls_setjmp) - { - int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT; - - /* See optimize_save_area_alloca to understand what is being - set up here. */ - - /* ??? Code below assumes that the save area needs maximal - alignment. This constraint may be too strong. */ - gcc_assert (PREFERRED_STACK_BOUNDARY == BIGGEST_ALIGNMENT); - - if (GET_CODE (size) == CONST_INT) - { - HOST_WIDE_INT new = INTVAL (size) / align * align; - - if (INTVAL (size) != new) - setjmpless_size = GEN_INT (new); - else - setjmpless_size = size; - } - else - { - /* Since we know overflow is not possible, we avoid using - CEIL_DIV_EXPR and use TRUNC_DIV_EXPR instead. */ - setjmpless_size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, - GEN_INT (align), NULL_RTX, 1); - setjmpless_size = expand_mult (Pmode, setjmpless_size, - GEN_INT (align), NULL_RTX, 1); - } - /* Our optimization works based upon being able to perform a simple - transformation of this RTL into a (set REG REG) so make sure things - did in fact end up in a REG. */ - if (!register_operand (setjmpless_size, Pmode)) - setjmpless_size = force_reg (Pmode, setjmpless_size); - } + /* ??? Code below assumes that the save area needs maximal + alignment. This constraint may be too strong. */ + gcc_assert (PREFERRED_STACK_BOUNDARY == BIGGEST_ALIGNMENT); - size = expand_binop (Pmode, add_optab, size, dynamic_offset, - NULL_RTX, 1, OPTAB_LIB_WIDEN); - } + if (GET_CODE (size) == CONST_INT) + { + HOST_WIDE_INT new = INTVAL (size) / align * align; + + if (INTVAL (size) != new) + size = GEN_INT (new); + } + else + { + /* Since we know overflow is not possible, we avoid using + CEIL_DIV_EXPR and use TRUNC_DIV_EXPR instead. */ + size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, + GEN_INT (align), NULL_RTX, 1); + size = expand_mult (Pmode, size, + GEN_INT (align), NULL_RTX, 1); + } + } + else + { + rtx dynamic_offset + = expand_binop (Pmode, sub_optab, virtual_stack_dynamic_rtx, + stack_pointer_rtx, NULL_RTX, 1, OPTAB_LIB_WIDEN); + + size = expand_binop (Pmode, add_optab, size, dynamic_offset, + NULL_RTX, 1, OPTAB_LIB_WIDEN); + } #endif /* SETJMP_VIA_SAVE_AREA */ /* Round the size to a multiple of the required stack alignment. @@ -1304,16 +1220,6 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) } anti_adjust_stack (size); -#ifdef SETJMP_VIA_SAVE_AREA - if (setjmpless_size != NULL_RTX) - { - rtx note_target = get_last_insn (); - - REG_NOTES (note_target) - = gen_rtx_EXPR_LIST (REG_SAVE_AREA, setjmpless_size, - REG_NOTES (note_target)); - } -#endif /* SETJMP_VIA_SAVE_AREA */ #ifdef STACK_GROWS_DOWNWARD emit_move_insn (target, virtual_stack_dynamic_rtx); @@ -1525,8 +1431,8 @@ hard_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, enum machine_mode tmpmode; /* int_size_in_bytes can return -1. We don't need a check here - since the value of bytes will be large enough that no mode - will match and we will abort later in this function. */ + since the value of bytes will then be large enough that no + mode will match anyway. */ for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT); tmpmode != VOIDmode; diff --git a/gcc/expmed.c b/gcc/expmed.c index 093791e148a..c814233d24c 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -544,8 +544,8 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, /* This is the mode we must force value to, so that there will be enough subwords to extract. Note that fieldmode will often (always?) be VOIDmode, because that is what store_field uses to indicate that this - is a bit field, but passing VOIDmode to operand_subword_force will - result in an abort. */ + is a bit field, but passing VOIDmode to operand_subword_force + is not allowed. */ fieldmode = GET_MODE (value); if (fieldmode == VOIDmode) fieldmode = smallest_mode_for_size (nwords * BITS_PER_WORD, MODE_INT); @@ -582,10 +582,10 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize, { if (!REG_P (op0)) { - /* Since this is a destination (lvalue), we can't copy it to a - pseudo. We can trivially remove a SUBREG that does not - change the size of the operand. Such a SUBREG may have been - added above. Otherwise, abort. */ + /* Since this is a destination (lvalue), we can't copy + it to a pseudo. We can remove a SUBREG that does not + change the size of the operand. Such a SUBREG may + have been added above. */ gcc_assert (GET_CODE (op0) == SUBREG && (GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (GET_MODE (SUBREG_REG (op0))))); @@ -2232,9 +2232,9 @@ expand_shift (enum tree_code code, enum machine_mode mode, rtx shifted, tree type = TREE_TYPE (amount); tree new_amount = make_tree (type, op1); tree other_amount - = fold (build2 (MINUS_EXPR, type, - build_int_cst (type, GET_MODE_BITSIZE (mode)), - amount)); + = fold_build2 (MINUS_EXPR, type, + build_int_cst (type, GET_MODE_BITSIZE (mode)), + amount); shifted = force_reg (mode, shifted); @@ -3835,8 +3835,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, || optab2->handlers[compute_mode].libfunc) break; - /* If we still couldn't find a mode, use MODE, but we'll probably abort - in expand_binop. */ + /* If we still couldn't find a mode, use MODE, but expand_binop will + probably die. */ if (compute_mode == VOIDmode) compute_mode = mode; @@ -4890,23 +4890,23 @@ make_tree (tree type, rtx x) } case PLUS: - return fold (build2 (PLUS_EXPR, type, make_tree (type, XEXP (x, 0)), - make_tree (type, XEXP (x, 1)))); + return fold_build2 (PLUS_EXPR, type, make_tree (type, XEXP (x, 0)), + make_tree (type, XEXP (x, 1))); case MINUS: - return fold (build2 (MINUS_EXPR, type, make_tree (type, XEXP (x, 0)), - make_tree (type, XEXP (x, 1)))); + return fold_build2 (MINUS_EXPR, type, make_tree (type, XEXP (x, 0)), + make_tree (type, XEXP (x, 1))); case NEG: - return fold (build1 (NEGATE_EXPR, type, make_tree (type, XEXP (x, 0)))); + return fold_build1 (NEGATE_EXPR, type, make_tree (type, XEXP (x, 0))); case MULT: - return fold (build2 (MULT_EXPR, type, make_tree (type, XEXP (x, 0)), - make_tree (type, XEXP (x, 1)))); + return fold_build2 (MULT_EXPR, type, make_tree (type, XEXP (x, 0)), + make_tree (type, XEXP (x, 1))); case ASHIFT: - return fold (build2 (LSHIFT_EXPR, type, make_tree (type, XEXP (x, 0)), - make_tree (type, XEXP (x, 1)))); + return fold_build2 (LSHIFT_EXPR, type, make_tree (type, XEXP (x, 0)), + make_tree (type, XEXP (x, 1))); case LSHIFTRT: t = lang_hooks.types.unsigned_type (type); @@ -4986,11 +4986,11 @@ const_mult_add_overflow_p (rtx x, rtx mult, rtx add, add_type = (GET_MODE (add) == VOIDmode ? mult_type : lang_hooks.types.type_for_mode (GET_MODE (add), unsignedp)); - result = fold (build2 (PLUS_EXPR, mult_type, - fold (build2 (MULT_EXPR, mult_type, - make_tree (mult_type, x), - make_tree (mult_type, mult))), - make_tree (add_type, add))); + result = fold_build2 (PLUS_EXPR, mult_type, + fold_build2 (MULT_EXPR, mult_type, + make_tree (mult_type, x), + make_tree (mult_type, mult)), + make_tree (add_type, add)); return TREE_CONSTANT_OVERFLOW (result); } @@ -5011,11 +5011,11 @@ expand_mult_add (rtx x, rtx target, rtx mult, rtx add, enum machine_mode mode, tree add_type = (GET_MODE (add) == VOIDmode ? type: lang_hooks.types.type_for_mode (GET_MODE (add), unsignedp)); - tree result = fold (build2 (PLUS_EXPR, type, - fold (build2 (MULT_EXPR, type, - make_tree (type, x), - make_tree (type, mult))), - make_tree (add_type, add))); + tree result = fold_build2 (PLUS_EXPR, type, + fold_build2 (MULT_EXPR, type, + make_tree (type, x), + make_tree (type, mult)), + make_tree (add_type, add)); return expand_expr (result, target, VOIDmode, 0); } @@ -5538,9 +5538,9 @@ emit_store_flag_force (rtx target, enum rtx_code code, rtx op0, rtx op1, The algorithm is based on the code in expr.c:do_jump. - Note that this does not perform a general comparison. Only variants - generated within expmed.c are correctly handled, others abort (but could - be handled if needed). */ + Note that this does not perform a general comparison. Only + variants generated within expmed.c are correctly handled, others + could be handled if needed. */ static void do_cmp_and_jump (rtx arg1, rtx arg2, enum rtx_code op, enum machine_mode mode, diff --git a/gcc/expr.c b/gcc/expr.c index 9e08315531f..459c248f420 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -126,7 +126,7 @@ static void move_by_pieces_1 (rtx (*) (rtx, ...), enum machine_mode, struct move_by_pieces *); static bool block_move_libcall_safe_for_call_parm (void); static bool emit_block_move_via_movmem (rtx, rtx, rtx, unsigned); -static rtx emit_block_move_via_libcall (rtx, rtx, rtx); +static rtx emit_block_move_via_libcall (rtx, rtx, rtx, bool); static tree emit_block_move_libcall_fn (int); static void emit_block_move_via_loop (rtx, rtx, rtx, unsigned); static rtx clear_by_pieces_1 (void *, HOST_WIDE_INT, enum machine_mode); @@ -135,7 +135,7 @@ static void store_by_pieces_1 (struct store_by_pieces *, unsigned int); static void store_by_pieces_2 (rtx (*) (rtx, ...), enum machine_mode, struct store_by_pieces *); static bool clear_storage_via_clrmem (rtx, rtx, unsigned); -static rtx clear_storage_via_libcall (rtx, rtx); +static rtx clear_storage_via_libcall (rtx, rtx, bool); static tree clear_storage_libcall_fn (int); static rtx compress_float_constant (rtx, rtx); static rtx get_subtarget (rtx); @@ -208,6 +208,30 @@ enum insn_code clrmem_optab[NUM_MACHINE_MODES]; enum insn_code cmpstr_optab[NUM_MACHINE_MODES]; enum insn_code cmpmem_optab[NUM_MACHINE_MODES]; +/* Synchronization primitives. */ +enum insn_code sync_add_optab[NUM_MACHINE_MODES]; +enum insn_code sync_sub_optab[NUM_MACHINE_MODES]; +enum insn_code sync_ior_optab[NUM_MACHINE_MODES]; +enum insn_code sync_and_optab[NUM_MACHINE_MODES]; +enum insn_code sync_xor_optab[NUM_MACHINE_MODES]; +enum insn_code sync_nand_optab[NUM_MACHINE_MODES]; +enum insn_code sync_old_add_optab[NUM_MACHINE_MODES]; +enum insn_code sync_old_sub_optab[NUM_MACHINE_MODES]; +enum insn_code sync_old_ior_optab[NUM_MACHINE_MODES]; +enum insn_code sync_old_and_optab[NUM_MACHINE_MODES]; +enum insn_code sync_old_xor_optab[NUM_MACHINE_MODES]; +enum insn_code sync_old_nand_optab[NUM_MACHINE_MODES]; +enum insn_code sync_new_add_optab[NUM_MACHINE_MODES]; +enum insn_code sync_new_sub_optab[NUM_MACHINE_MODES]; +enum insn_code sync_new_ior_optab[NUM_MACHINE_MODES]; +enum insn_code sync_new_and_optab[NUM_MACHINE_MODES]; +enum insn_code sync_new_xor_optab[NUM_MACHINE_MODES]; +enum insn_code sync_new_nand_optab[NUM_MACHINE_MODES]; +enum insn_code sync_compare_and_swap[NUM_MACHINE_MODES]; +enum insn_code sync_compare_and_swap_cc[NUM_MACHINE_MODES]; +enum insn_code sync_lock_test_and_set[NUM_MACHINE_MODES]; +enum insn_code sync_lock_release[NUM_MACHINE_MODES]; + /* SLOW_UNALIGNED_ACCESS is nonzero if unaligned accesses are very slow. */ #ifndef SLOW_UNALIGNED_ACCESS @@ -1124,6 +1148,7 @@ emit_block_move (rtx x, rtx y, rtx size, enum block_op_methods method) switch (method) { case BLOCK_OP_NORMAL: + case BLOCK_OP_TAILCALL: may_use_call = true; break; @@ -1172,7 +1197,8 @@ emit_block_move (rtx x, rtx y, rtx size, enum block_op_methods method) else if (emit_block_move_via_movmem (x, y, size, align)) ; else if (may_use_call) - retval = emit_block_move_via_libcall (x, y, size); + retval = emit_block_move_via_libcall (x, y, size, + method == BLOCK_OP_TAILCALL); else emit_block_move_via_loop (x, y, size, align); @@ -1301,7 +1327,7 @@ emit_block_move_via_movmem (rtx x, rtx y, rtx size, unsigned int align) Return the return value from memcpy, 0 otherwise. */ static rtx -emit_block_move_via_libcall (rtx dst, rtx src, rtx size) +emit_block_move_via_libcall (rtx dst, rtx src, rtx size, bool tailcall) { rtx dst_addr, src_addr; tree call_expr, arg_list, fn, src_tree, dst_tree, size_tree; @@ -1343,6 +1369,7 @@ emit_block_move_via_libcall (rtx dst, rtx src, rtx size) call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn); call_expr = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)), call_expr, arg_list, NULL_TREE); + CALL_EXPR_TAILCALL (call_expr) = tailcall; retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0); @@ -2403,11 +2430,13 @@ store_by_pieces_2 (rtx (*genfun) (rtx, ...), enum machine_mode mode, its length in bytes. */ rtx -clear_storage (rtx object, rtx size) +clear_storage (rtx object, rtx size, enum block_op_methods method) { enum machine_mode mode = GET_MODE (object); unsigned int align; + gcc_assert (method == BLOCK_OP_NORMAL || method == BLOCK_OP_TAILCALL); + /* If OBJECT is not BLKmode and SIZE is the same size as its mode, just move a zero. Otherwise, do this a piece at a time. */ if (mode != BLKmode @@ -2444,7 +2473,8 @@ clear_storage (rtx object, rtx size) else if (clear_storage_via_clrmem (object, size, align)) ; else - return clear_storage_via_libcall (object, size); + return clear_storage_via_libcall (object, size, + method == BLOCK_OP_TAILCALL); return NULL; } @@ -2509,7 +2539,7 @@ clear_storage_via_clrmem (rtx object, rtx size, unsigned int align) Return the return value of memset, 0 otherwise. */ static rtx -clear_storage_via_libcall (rtx object, rtx size) +clear_storage_via_libcall (rtx object, rtx size, bool tailcall) { tree call_expr, arg_list, fn, object_tree, size_tree; enum machine_mode size_mode; @@ -2542,6 +2572,7 @@ clear_storage_via_libcall (rtx object, rtx size) call_expr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (fn)), fn); call_expr = build3 (CALL_EXPR, TREE_TYPE (TREE_TYPE (fn)), call_expr, arg_list, NULL_TREE); + CALL_EXPR_TAILCALL (call_expr) = tailcall; retval = expand_expr (call_expr, NULL_RTX, VOIDmode, 0); @@ -2626,7 +2657,7 @@ write_complex_part (rtx cplx, rtx val, bool imag_p) the original object if it spans an even number of hard regs. This special case is important for SCmode on 64-bit platforms where the natural size of floating-point regs is 32-bit. */ - || (GET_CODE (cplx) == REG + || (REG_P (cplx) && REGNO (cplx) < FIRST_PSEUDO_REGISTER && hard_regno_nregs[REGNO (cplx)][cmode] % 2 == 0) /* For MEMs we always try to make a "subreg", that is to adjust @@ -2686,7 +2717,7 @@ read_complex_part (rtx cplx, bool imag_p) the original object if it spans an even number of hard regs. This special case is important for SCmode on 64-bit platforms where the natural size of floating-point regs is 32-bit. */ - || (GET_CODE (cplx) == REG + || (REG_P (cplx) && REGNO (cplx) < FIRST_PSEUDO_REGISTER && hard_regno_nregs[REGNO (cplx)][cmode] % 2 == 0) /* For MEMs we always try to make a "subreg", that is to adjust @@ -2996,8 +3027,8 @@ emit_move_multi_word (enum machine_mode mode, rtx x, rtx y) rtx ypart = operand_subword (y, i, 1, mode); /* If we can't get a part of Y, put Y into memory if it is a - constant. Otherwise, force it into a register. If we still - can't get a part of Y, abort. */ + constant. Otherwise, force it into a register. Then we must + be able to get a part of Y. */ if (ypart == 0 && CONSTANT_P (y)) { y = force_const_mem (mode, y); @@ -3520,7 +3551,7 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, int not_stack; /* # bytes of start of argument that we must make space for but need not store. */ - int offset = partial % (PARM_BOUNDARY / BITS_PER_WORD); + int offset = partial % (PARM_BOUNDARY / BITS_PER_UNIT); int args_offset = INTVAL (args_so_far); int skip; @@ -3538,8 +3569,9 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size, offset = 0; /* Now NOT_STACK gets the number of words that we don't need to - allocate on the stack. */ + allocate on the stack. Convert OFFSET to words too. */ not_stack = (partial - offset) / UNITS_PER_WORD; + offset /= UNITS_PER_WORD; /* If the partial register-part of the arg counts in its stack size, skip the part of stack space corresponding to the registers. @@ -4197,10 +4229,10 @@ store_expr (tree exp, rtx target, int call_param_p) but TARGET is not valid memory reference, TEMP will differ from TARGET although it is really the same location. */ && !(alt_rtl && rtx_equal_p (alt_rtl, target)) - /* If there's nothing to copy, don't bother. Don't call expr_size - unless necessary, because some front-ends (C++) expr_size-hook - aborts on objects that are not supposed to be bit-copied or - bit-initialized. */ + /* If there's nothing to copy, don't bother. Don't call + expr_size unless necessary, because some front-ends (C++) + expr_size-hook must not be given objects that are not + supposed to be bit-copied or bit-initialized. */ && expr_size (exp) != const0_rtx) { if (GET_MODE (temp) != GET_MODE (target) @@ -4280,7 +4312,7 @@ store_expr (tree exp, rtx target, int call_param_p) } if (size != const0_rtx) - clear_storage (target, size); + clear_storage (target, size, BLOCK_OP_NORMAL); if (label) emit_label (label); @@ -4522,7 +4554,6 @@ count_type_elements (tree type) case VOID_TYPE: case METHOD_TYPE: - case FILE_TYPE: case FUNCTION_TYPE: case LANG_TYPE: default: @@ -4635,7 +4666,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) && ! CONSTRUCTOR_ELTS (exp)) /* If the constructor is empty, clear the union. */ { - clear_storage (target, expr_size (exp)); + clear_storage (target, expr_size (exp), BLOCK_OP_NORMAL); cleared = 1; } @@ -4663,7 +4694,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) || ((HOST_WIDE_INT) GET_MODE_SIZE (GET_MODE (target)) == size))) { - clear_storage (target, GEN_INT (size)); + clear_storage (target, GEN_INT (size), BLOCK_OP_NORMAL); cleared = 1; } @@ -4759,9 +4790,9 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) if (BYTES_BIG_ENDIAN) value - = fold (build2 (LSHIFT_EXPR, type, value, - build_int_cst (NULL_TREE, - BITS_PER_WORD - bitsize))); + = fold_build2 (LSHIFT_EXPR, type, value, + build_int_cst (NULL_TREE, + BITS_PER_WORD - bitsize)); bitsize = BITS_PER_WORD; mode = word_mode; } @@ -4863,7 +4894,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) if (REG_P (target)) emit_move_insn (target, CONST0_RTX (GET_MODE (target))); else - clear_storage (target, GEN_INT (size)); + clear_storage (target, GEN_INT (size), BLOCK_OP_NORMAL); cleared = 1; } @@ -4962,8 +4993,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) /* Assign value to element index. */ position = convert (ssizetype, - fold (build2 (MINUS_EXPR, TREE_TYPE (index), - index, TYPE_MIN_VALUE (domain)))); + fold_build2 (MINUS_EXPR, TREE_TYPE (index), + index, TYPE_MIN_VALUE (domain))); position = size_binop (MULT_EXPR, position, convert (ssizetype, TYPE_SIZE_UNIT (elttype))); @@ -5005,10 +5036,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) if (minelt) index = fold_convert (ssizetype, - fold (build2 (MINUS_EXPR, - TREE_TYPE (index), - index, - TYPE_MIN_VALUE (domain)))); + fold_build2 (MINUS_EXPR, + TREE_TYPE (index), + index, + TYPE_MIN_VALUE (domain))); position = size_binop (MULT_EXPR, index, convert (ssizetype, @@ -5108,7 +5139,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size) if (REG_P (target)) emit_move_insn (target, CONST0_RTX (GET_MODE (target))); else - clear_storage (target, GEN_INT (size)); + clear_storage (target, GEN_INT (size), BLOCK_OP_NORMAL); cleared = 1; } @@ -5461,8 +5492,8 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize, index, then convert to sizetype and multiply by the size of the array element. */ if (! integer_zerop (low_bound)) - index = fold (build2 (MINUS_EXPR, TREE_TYPE (index), - index, low_bound)); + index = fold_build2 (MINUS_EXPR, TREE_TYPE (index), + index, low_bound); offset = size_binop (PLUS_EXPR, offset, size_binop (MULT_EXPR, @@ -6189,7 +6220,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, /* If the DECL isn't in memory, then the DECL wasn't properly marked TREE_ADDRESSABLE, which will be either a front-end or a tree optimizer bug. */ - gcc_assert (GET_CODE (result) == MEM); + gcc_assert (MEM_P (result)); result = XEXP (result, 0); /* ??? Is this needed anymore? */ @@ -7775,18 +7806,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, return expand_divmod (0, code, mode, op0, op1, target, unsignedp); case RDIV_EXPR: - /* Emit a/b as a*(1/b). Later we may manage CSE the reciprocal saving - expensive divide. If not, combine will rebuild the original - computation. */ - if (flag_unsafe_math_optimizations && optimize && !optimize_size - && TREE_CODE (type) == REAL_TYPE - && !real_onep (TREE_OPERAND (exp, 0))) - return expand_expr (build2 (MULT_EXPR, type, TREE_OPERAND (exp, 0), - build2 (RDIV_EXPR, type, - build_real (type, dconst1), - TREE_OPERAND (exp, 1))), - target, tmode, modifier); - goto binop; case TRUNC_MOD_EXPR: @@ -8317,8 +8336,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, op2 = expand_expr (oprnd2, NULL_RTX, VOIDmode, 0); temp = expand_ternary_op (mode, this_optab, op0, op1, op2, target, unsignedp); - if (temp == 0) - abort (); + gcc_assert (temp); return temp; } @@ -8948,9 +8966,9 @@ try_tablejump (tree index_type, tree index_expr, tree minval, tree range, if (! HAVE_tablejump) return 0; - index_expr = fold (build2 (MINUS_EXPR, index_type, - convert (index_type, index_expr), - convert (index_type, minval))); + index_expr = fold_build2 (MINUS_EXPR, index_type, + convert (index_type, index_expr), + convert (index_type, minval)); index = expand_expr (index_expr, NULL_RTX, VOIDmode, 0); do_pending_stack_adjust (); diff --git a/gcc/expr.h b/gcc/expr.h index b624413e080..267daf0119f 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -310,6 +310,11 @@ int can_conditionally_move_p (enum machine_mode mode); rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, enum machine_mode, rtx, rtx, enum machine_mode, int); +rtx expand_val_compare_and_swap (rtx, rtx, rtx, rtx); +rtx expand_bool_compare_and_swap (rtx, rtx, rtx, rtx); +rtx expand_sync_operation (rtx, rtx, enum rtx_code); +rtx expand_sync_fetch_operation (rtx, rtx, enum rtx_code, bool, rtx); +rtx expand_sync_lock_test_and_set (rtx, rtx, rtx); /* Functions from expmed.c: */ @@ -362,7 +367,9 @@ enum block_op_methods { BLOCK_OP_NORMAL, BLOCK_OP_NO_LIBCALL, - BLOCK_OP_CALL_PARM + BLOCK_OP_CALL_PARM, + /* Like BLOCK_OP_NORMAL, but the libcall can be tail call optimized. */ + BLOCK_OP_TAILCALL }; extern void init_block_move_fn (const char *); @@ -414,7 +421,7 @@ extern void use_group_regs (rtx *, rtx); /* Write zeros through the storage of OBJECT. If OBJECT has BLKmode, SIZE is its length in bytes. */ -extern rtx clear_storage (rtx, rtx); +extern rtx clear_storage (rtx, rtx, enum block_op_methods); /* Determine whether the LEN bytes can be moved by using several move instructions. Return nonzero if a call to move_by_pieces should diff --git a/gcc/final.c b/gcc/final.c index bf5771aebfb..2e8a7a8d6df 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1,6 +1,7 @@ /* Convert RTL to assembler code and output it, for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, - 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GCC. @@ -135,7 +136,7 @@ static const char *last_filename; extern int length_unit_log; /* This is defined in insn-attrtab.c. */ /* Nonzero while outputting an `asm' with operands. - This means that inconsistencies are the user's fault, so don't abort. + This means that inconsistencies are the user's fault, so don't die. The precise value is the insn being output, to pass to error_for_asm. */ rtx this_is_asm_operands; @@ -787,7 +788,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) label_align = xrealloc (label_align, n_labels * sizeof (struct label_alignment)); - /* Range of labels grows monotonically in the function. Abort here + /* Range of labels grows monotonically in the function. Failing here means that the initialization of array got lost. */ gcc_assert (n_old_labels <= n_labels); @@ -835,7 +836,7 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) max_log = log; max_skip = LABEL_ALIGN_MAX_SKIP; } - next = NEXT_INSN (insn); + next = next_nonnote_insn (insn); /* ADDR_VECs only take room if read-only data goes into the text section. */ if (JUMP_TABLES_IN_TEXT_SECTION || !HAVE_READONLY_DATA_SECTION) @@ -952,8 +953,8 @@ shorten_branches (rtx first ATTRIBUTE_UNUSED) if (min_align > LABEL_TO_ALIGNMENT (lab)) min_align = LABEL_TO_ALIGNMENT (lab); } - XEXP (pat, 2) = gen_rtx_LABEL_REF (VOIDmode, min_lab); - XEXP (pat, 3) = gen_rtx_LABEL_REF (VOIDmode, max_lab); + XEXP (pat, 2) = gen_rtx_LABEL_REF (Pmode, min_lab); + XEXP (pat, 3) = gen_rtx_LABEL_REF (Pmode, max_lab); insn_shuid = INSN_SHUID (insn); rel = INSN_SHUID (XEXP (XEXP (pat, 0), 0)); memset (&flags, 0, sizeof (flags)); @@ -1425,7 +1426,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED) assemble_integer (const0_rtx, LONG_TYPE_SIZE / BITS_PER_UNIT, align, 1); } - function_section (current_function_decl); + current_function_section (current_function_decl); #if defined(ASM_OUTPUT_REG_PUSH) if (sval && svrtx != NULL_RTX && REG_P (svrtx)) @@ -1490,18 +1491,10 @@ final_end_function (void) } /* Output assembler code for some insns: all or part of a function. - For description of args, see `final_start_function', above. - - PRESCAN is 1 if we are not really outputting, - just scanning as if we were outputting. - Prescanning deletes and rearranges insns just like ordinary output. - PRESCAN is -2 if we are outputting after having prescanned. - In this case, don't try to delete or rearrange insns - because that has already been done. - Prescanning is done only on certain machines. */ + For description of args, see `final_start_function', above. */ void -final (rtx first, FILE *file, int optimize, int prescan) +final (rtx first, FILE *file, int optimize) { rtx insn; int max_uid = 0; @@ -1573,7 +1566,7 @@ final (rtx first, FILE *file, int optimize, int prescan) insn_current_address = INSN_ADDRESSES (INSN_UID (insn)); #endif /* HAVE_ATTR_length */ - insn = final_scan_insn (insn, file, optimize, prescan, 0, &seen); + insn = final_scan_insn (insn, file, optimize, 0, &seen); } } @@ -1626,35 +1619,6 @@ output_alternate_entry_point (FILE *file, rtx insn) } } -/* Return boolean indicating if there is a NOTE_INSN_UNLIKELY_EXECUTED_CODE - note in the instruction chain (going forward) between the current - instruction, and the next 'executable' instruction. */ - -bool -scan_ahead_for_unlikely_executed_note (rtx insn) -{ - rtx temp; - int bb_note_count = 0; - - for (temp = insn; temp; temp = NEXT_INSN (temp)) - { - if (NOTE_P (temp) - && NOTE_LINE_NUMBER (temp) == NOTE_INSN_UNLIKELY_EXECUTED_CODE) - return true; - if (NOTE_P (temp) - && NOTE_LINE_NUMBER (temp) == NOTE_INSN_BASIC_BLOCK) - { - bb_note_count++; - if (bb_note_count > 1) - return false; - } - if (INSN_P (temp)) - return false; - } - - return false; -} - /* The final scan for one insn, INSN. Args are same as in `final', except that INSN is the insn being scanned. @@ -1671,12 +1635,12 @@ scan_ahead_for_unlikely_executed_note (rtx insn) rtx final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, - int prescan, int nopeepholes ATTRIBUTE_UNUSED, - int *seen) + int nopeepholes ATTRIBUTE_UNUSED, int *seen) { #ifdef HAVE_cc0 rtx set; #endif + rtx next; insn_counter++; @@ -1688,9 +1652,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, switch (GET_CODE (insn)) { case NOTE: - if (prescan > 0) - break; - switch (NOTE_LINE_NUMBER (insn)) { case NOTE_INSN_DELETED: @@ -1701,30 +1662,27 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, case NOTE_INSN_EXPECTED_VALUE: break; - case NOTE_INSN_UNLIKELY_EXECUTED_CODE: + case NOTE_INSN_SWITCH_TEXT_SECTIONS: /* The presence of this note indicates that this basic block belongs in the "cold" section of the .o file. If we are not already writing to the cold section we need to change to it. */ - - unlikely_text_section (); + + if (last_text_section == in_text) + { + (*debug_hooks->switch_text_section) (); + unlikely_text_section (); + } + else + { + (*debug_hooks->switch_text_section) (); + text_section (); + } break; case NOTE_INSN_BASIC_BLOCK: - /* If we are performing the optimization that partitions - basic blocks into hot & cold sections of the .o file, - then at the start of each new basic block, before - beginning to write code for the basic block, we need to - check to see whether the basic block belongs in the hot - or cold section of the .o file, and change the section we - are writing to appropriately. */ - - if (flag_reorder_blocks_and_partition - && !scan_ahead_for_unlikely_executed_note (insn)) - function_section (current_function_decl); - #ifdef TARGET_UNWIND_INFO targetm.asm_out.unwind_emit (asm_out_file, insn); #endif @@ -1902,40 +1860,20 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, } } #endif - if (prescan > 0) - break; if (LABEL_NAME (insn)) (*debug_hooks->label) (insn); - /* If we are doing the optimization that partitions hot & cold - basic blocks into separate sections of the .o file, we need - to ensure the jump table ends up in the correct section... */ - - if (flag_reorder_blocks_and_partition - && targetm.have_named_sections) - { - rtx tmp_table, tmp_label; - if (LABEL_P (insn) - && tablejump_p (NEXT_INSN (insn), &tmp_label, &tmp_table)) - { - /* Do nothing; Do NOT change the current section. */ - } - else if (scan_ahead_for_unlikely_executed_note (insn)) - unlikely_text_section (); - else if (in_unlikely_text_section ()) - function_section (current_function_decl); - } - if (app_on) { fputs (ASM_APP_OFF, file); app_on = 0; } - if (NEXT_INSN (insn) != 0 - && JUMP_P (NEXT_INSN (insn))) + + next = next_nonnote_insn (insn); + if (next != 0 && JUMP_P (next)) { - rtx nextbody = PATTERN (NEXT_INSN (insn)); + rtx nextbody = PATTERN (next); /* If this label is followed by a jump-table, make sure we put the label in the read-only section. Also @@ -1956,18 +1894,18 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, targetm.asm_out.function_rodata_section (current_function_decl); #ifdef ADDR_VEC_ALIGN - log_align = ADDR_VEC_ALIGN (NEXT_INSN (insn)); + log_align = ADDR_VEC_ALIGN (next); #else log_align = exact_log2 (BIGGEST_ALIGNMENT / BITS_PER_UNIT); #endif ASM_OUTPUT_ALIGN (file, log_align); } else - function_section (current_function_decl); + current_function_section (current_function_decl); #ifdef ASM_OUTPUT_CASE_LABEL ASM_OUTPUT_CASE_LABEL (file, "L", CODE_LABEL_NUMBER (insn), - NEXT_INSN (insn)); + next); #else targetm.asm_out.internal_label (file, "L", CODE_LABEL_NUMBER (insn)); #endif @@ -2019,8 +1957,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, int vlen, idx; #endif - if (prescan > 0) - break; + if (! JUMP_TABLES_IN_TEXT_SECTION) + targetm.asm_out.function_rodata_section (current_function_decl); + else + current_function_section (current_function_decl); if (app_on) { @@ -2078,7 +2018,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, #endif #endif - function_section (current_function_decl); + current_function_section (current_function_decl); break; } @@ -2095,8 +2035,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* There's no telling what that did to the condition codes. */ CC_STATUS_INIT; - if (prescan > 0) - break; if (string[0]) { @@ -2119,12 +2057,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* There's no telling what that did to the condition codes. */ CC_STATUS_INIT; - if (prescan > 0) - break; /* Get out the operand values. */ string = decode_asm_operands (body, ops, NULL, NULL, NULL); - /* Inhibit aborts on what would otherwise be compiler bugs. */ + /* Inhibit dieing on what would otherwise be compiler bugs. */ insn_noperands = noperands; this_is_asm_operands = insn; @@ -2147,7 +2083,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, break; } - if (prescan <= 0 && app_on) + if (app_on) { fputs (ASM_APP_OFF, file); app_on = 0; @@ -2157,10 +2093,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, { /* A delayed-branch sequence */ int i; - rtx next; - if (prescan > 0) - break; final_sequence = body; /* Record the delay slots' frame information before the branch. @@ -2176,7 +2109,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, thought unnecessary. If that happens, cancel this sequence and cause that insn to be restored. */ - next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, prescan, 1, seen); + next = final_scan_insn (XVECEXP (body, 0, 0), file, 0, 1, seen); if (next != XVECEXP (body, 0, 1)) { final_sequence = 0; @@ -2190,7 +2123,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, /* We loop in case any instruction in a delay slot gets split. */ do - insn = final_scan_insn (insn, file, 0, prescan, 1, seen); + insn = final_scan_insn (insn, file, 0, 1, seen); while (insn != next); } #ifdef DBR_OUTPUT_SEQEND @@ -2261,20 +2194,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, } #endif -#ifndef STACK_REGS - /* Don't bother outputting obvious no-ops, even without -O. - This optimization is fast and doesn't interfere with debugging. - Don't do this if the insn is in a delay slot, since this - will cause an improper number of delay insns to be written. */ - if (final_sequence == 0 - && prescan >= 0 - && NONJUMP_INSN_P (insn) && GET_CODE (body) == SET - && REG_P (SET_SRC (body)) - && REG_P (SET_DEST (body)) - && REGNO (SET_SRC (body)) == REGNO (SET_DEST (body))) - break; -#endif - #ifdef HAVE_cc0 /* If this is a conditional branch, maybe modify it if the cc's are in a nonstandard state @@ -2287,10 +2206,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, && SET_DEST (body) == pc_rtx && GET_CODE (SET_SRC (body)) == IF_THEN_ELSE && COMPARISON_P (XEXP (SET_SRC (body), 0)) - && XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx - /* This is done during prescan; it is not done again - in final scan when prescan has been done. */ - && prescan >= 0) + && XEXP (XEXP (SET_SRC (body), 0), 0) == cc0_rtx) { /* This function may alter the contents of its argument and clear some of the cc_status.flags bits. @@ -2394,10 +2310,12 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, for (note = NEXT_INSN (insn); note != next; note = NEXT_INSN (note)) - final_scan_insn (note, file, optimize, prescan, nopeepholes, seen); + final_scan_insn (note, file, optimize, nopeepholes, seen); - /* In case this is prescan, put the notes - in proper position for later rescan. */ + /* Put the notes in the proper position for a later + rescan. For example, the SH target can do this + when generating a far jump in a delayed branch + sequence. */ note = NEXT_INSN (insn); PREV_INSN (note) = prev; NEXT_INSN (prev) = note; @@ -2510,9 +2428,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, return new; } - if (prescan > 0) - break; - #ifdef TARGET_UNWIND_INFO /* ??? This will put the directives in the wrong place if get_insn_template outputs assembly directly. However calling it @@ -2632,11 +2547,10 @@ alter_subreg (rtx *xp) if (new != 0) *xp = new; - else + else if (REG_P (y)) { /* Simplify_subreg can't handle some REG cases, but we have to. */ unsigned int regno = subreg_regno (x); - gcc_assert (REG_P (y)); *xp = gen_rtx_REG_offset (y, GET_MODE (x), regno, SUBREG_BYTE (x)); } } @@ -3221,8 +3135,7 @@ output_operand (rtx x, int code ATTRIBUTE_UNUSED) if (x && GET_CODE (x) == SUBREG) x = alter_subreg (&x); - /* If X is a pseudo-register, abort now rather than writing trash to the - assembler file. */ + /* X must not be a pseudo reg. */ gcc_assert (!x || !REG_P (x) || REGNO (x) < FIRST_PSEUDO_REGISTER); PRINT_OPERAND (asm_out_file, x, code); diff --git a/gcc/flow.c b/gcc/flow.c index c58fd499e3e..9eae74b4ad0 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -273,7 +273,7 @@ static int ndead; (remember, we are walking backward). This can be computed as current pbi->insn_num - reg_deaths[regno]. At the end of processing each basic block, the remaining live registers - are inspected and liferanges are increased same way so liverange of global + are inspected and live ranges are increased same way so liverange of global registers are computed correctly. The array is maintained clear for dead registers, so it can be safely reused @@ -760,6 +760,9 @@ free_basic_block_vars (void) } n_basic_blocks = 0; last_basic_block = 0; + n_edges = 0; + + label_to_block_map = NULL; ENTRY_BLOCK_PTR->aux = NULL; ENTRY_BLOCK_PTR->global_live_at_end = NULL; @@ -1689,8 +1692,12 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn) fatal_insn ("Attempt to delete prologue/epilogue insn:", insn); /* Record sets. Do this even for dead instructions, since they - would have killed the values if they hadn't been deleted. */ + would have killed the values if they hadn't been deleted. To + be consistent, we also have to emit a clobber when we delete + an insn that clobbers a live register. */ + pbi->flags |= PROP_DEAD_INSN; mark_set_regs (pbi, PATTERN (insn), insn); + pbi->flags &= ~PROP_DEAD_INSN; /* CC0 is now known to be dead. Either this insn used it, in which case it doesn't anymore, or clobbered it, @@ -1795,7 +1802,6 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn) } else { - rtx note; /* Any regs live at the time of a call instruction must not go in a register clobbered by calls. Find all regs now live and record this for them. */ @@ -1870,10 +1876,6 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn) /* Record uses. */ if (! insn_is_dead) mark_used_regs (pbi, PATTERN (insn), NULL_RTX, insn); - if ((flags & PROP_EQUAL_NOTES) - && ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) - || (note = find_reg_note (insn, REG_EQUIV, NULL_RTX)))) - mark_used_regs (pbi, XEXP (note, 0), NULL_RTX, insn); /* Sometimes we may have inserted something before INSN (such as a move) when we make an auto-inc. So ensure we will scan those insns. */ @@ -2530,7 +2532,8 @@ invalidate_mems_from_autoinc (rtx *px, void *data) return 0; } -/* EXP is a REG. Remove any dependent entries from pbi->mem_set_list. */ +/* EXP is a REG or MEM. Remove any dependent entries from + pbi->mem_set_list. */ static void invalidate_mems_from_set (struct propagate_block_info *pbi, rtx exp) @@ -2542,7 +2545,12 @@ invalidate_mems_from_set (struct propagate_block_info *pbi, rtx exp) while (temp) { next = XEXP (temp, 1); - if (reg_overlap_mentioned_p (exp, XEXP (temp, 0))) + if ((REG_P (exp) && reg_overlap_mentioned_p (exp, XEXP (temp, 0))) + /* When we get an EXP that is a mem here, we want to check if EXP + overlaps the *address* of any of the mems in the list (i.e. not + whether the mems actually overlap; that's done elsewhere). */ + || (MEM_P (exp) + && reg_overlap_mentioned_p (exp, XEXP (XEXP (temp, 0), 0)))) { /* Splice this entry out of the list. */ if (prev) @@ -2748,11 +2756,12 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c break; } - /* If this set is a MEM, then it kills any aliased writes. + /* If this set is a MEM, then it kills any aliased writes and any + other MEMs which use it. If this set is a REG, then it kills any MEMs which use the reg. */ if (optimize && (flags & PROP_SCAN_DEAD_STORES)) { - if (REG_P (reg)) + if (REG_P (reg) || MEM_P (reg)) invalidate_mems_from_set (pbi, reg); /* If the memory reference had embedded side effects (autoincrement @@ -2955,6 +2964,8 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c } CLEAR_REGNO_REG_SET (pbi->reg_live, i); } + if (flags & PROP_DEAD_INSN) + emit_insn_after (gen_rtx_CLOBBER (VOIDmode, reg), insn); } } else if (REG_P (reg)) @@ -4329,9 +4340,10 @@ void recompute_reg_usage (void) { allocate_reg_life_data (); - /* distribute_notes in combiner fails to convert some of the REG_UNUSED notes - to REG_DEAD notes. This causes CHECK_DEAD_NOTES in sched1 to abort. To - solve this update the DEATH_NOTES here. */ + /* distribute_notes in combiner fails to convert some of the + REG_UNUSED notes to REG_DEAD notes. This causes CHECK_DEAD_NOTES + in sched1 to die. To solve this update the DEATH_NOTES + here. */ update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_REG_INFO | PROP_DEATH_NOTES); } diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 13e91530cb0..050d45c6069 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -133,8 +133,6 @@ static bool reorder_operands_p (tree, tree); static tree fold_negate_const (tree, tree); static tree fold_not_const (tree, tree); static tree fold_relational_const (enum tree_code, tree, tree, tree); -static tree fold_relational_hi_lo (enum tree_code *, const tree, - tree *, tree *); static bool tree_expr_nonzero_p (tree); /* We know that A1 + B1 = SUM1, using 2's complement arithmetic and ignoring @@ -833,6 +831,33 @@ div_and_round_double (enum tree_code code, int uns, add_double (lnum_orig, hnum_orig, *lrem, *hrem, lrem, hrem); return overflow; } + +/* If ARG2 divides ARG1 with zero remainder, carries out the division + of type CODE and returns the quotient. + Otherwise returns NULL_TREE. */ + +static tree +div_if_zero_remainder (enum tree_code code, tree arg1, tree arg2) +{ + unsigned HOST_WIDE_INT int1l, int2l; + HOST_WIDE_INT int1h, int2h; + unsigned HOST_WIDE_INT quol, reml; + HOST_WIDE_INT quoh, remh; + tree type = TREE_TYPE (arg1); + int uns = TYPE_UNSIGNED (type); + + int1l = TREE_INT_CST_LOW (arg1); + int1h = TREE_INT_CST_HIGH (arg1); + int2l = TREE_INT_CST_LOW (arg2); + int2h = TREE_INT_CST_HIGH (arg2); + + div_and_round_double (code, uns, int1l, int1h, int2l, int2h, + &quol, &quoh, &reml, &remh); + if (remh != 0 || reml != 0) + return NULL_TREE; + + return build_int_cst_wide (type, quol, quoh); +} /* Return true if built-in mathematical function specified by CODE preserves the sign of it argument, i.e. -f(x) == f(-x). */ @@ -1044,8 +1069,8 @@ negate_expr (tree t) TREE_OPERAND (t, 1))) { tem = negate_expr (TREE_OPERAND (t, 1)); - tem = fold (build2 (MINUS_EXPR, TREE_TYPE (t), - tem, TREE_OPERAND (t, 0))); + tem = fold_build2 (MINUS_EXPR, TREE_TYPE (t), + tem, TREE_OPERAND (t, 0)); return fold_convert (type, tem); } @@ -1053,8 +1078,8 @@ negate_expr (tree t) if (negate_expr_p (TREE_OPERAND (t, 0))) { tem = negate_expr (TREE_OPERAND (t, 0)); - tem = fold (build2 (MINUS_EXPR, TREE_TYPE (t), - tem, TREE_OPERAND (t, 1))); + tem = fold_build2 (MINUS_EXPR, TREE_TYPE (t), + tem, TREE_OPERAND (t, 1)); return fold_convert (type, tem); } } @@ -1065,9 +1090,9 @@ negate_expr (tree t) if ((! FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations) && reorder_operands_p (TREE_OPERAND (t, 0), TREE_OPERAND (t, 1))) return fold_convert (type, - fold (build2 (MINUS_EXPR, TREE_TYPE (t), - TREE_OPERAND (t, 1), - TREE_OPERAND (t, 0)))); + fold_build2 (MINUS_EXPR, TREE_TYPE (t), + TREE_OPERAND (t, 1), + TREE_OPERAND (t, 0))); break; case MULT_EXPR: @@ -1082,15 +1107,15 @@ negate_expr (tree t) tem = TREE_OPERAND (t, 1); if (negate_expr_p (tem)) return fold_convert (type, - fold (build2 (TREE_CODE (t), TREE_TYPE (t), - TREE_OPERAND (t, 0), - negate_expr (tem)))); + fold_build2 (TREE_CODE (t), TREE_TYPE (t), + TREE_OPERAND (t, 0), + negate_expr (tem))); tem = TREE_OPERAND (t, 0); if (negate_expr_p (tem)) return fold_convert (type, - fold (build2 (TREE_CODE (t), TREE_TYPE (t), - negate_expr (tem), - TREE_OPERAND (t, 1)))); + fold_build2 (TREE_CODE (t), TREE_TYPE (t), + negate_expr (tem), + TREE_OPERAND (t, 1))); } break; @@ -1131,7 +1156,7 @@ negate_expr (tree t) ? lang_hooks.types.signed_type (type) : lang_hooks.types.unsigned_type (type); tree temp = fold_convert (ntype, TREE_OPERAND (t, 0)); - temp = fold (build2 (RSHIFT_EXPR, ntype, temp, op1)); + temp = fold_build2 (RSHIFT_EXPR, ntype, temp, op1); return fold_convert (type, temp); } } @@ -1141,7 +1166,7 @@ negate_expr (tree t) break; } - tem = fold (build1 (NEGATE_EXPR, TREE_TYPE (t), t)); + tem = fold_build1 (NEGATE_EXPR, TREE_TYPE (t), t); return fold_convert (type, tem); } @@ -1279,8 +1304,8 @@ associate_trees (tree t1, tree t2, enum tree_code code, tree type) fold_convert (type, t2)); } - return fold (build2 (code, type, fold_convert (type, t1), - fold_convert (type, t2))); + return fold_build2 (code, type, fold_convert (type, t1), + fold_convert (type, t2)); } /* Combine two integer constants ARG1 and ARG2 under operation CODE @@ -1654,7 +1679,7 @@ size_binop (enum tree_code code, tree arg0, tree arg1) if (arg0 == error_mark_node || arg1 == error_mark_node) return error_mark_node; - return fold (build2 (code, type, arg0, arg1)); + return fold_build2 (code, type, arg0, arg1); } /* Given two values, either both of sizetype or both of bitsizetype, @@ -1896,7 +1921,7 @@ fold_convert (tree type, tree arg) if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (orig) || lang_hooks.types_compatible_p (TYPE_MAIN_VARIANT (type), TYPE_MAIN_VARIANT (orig))) - return fold (build1 (NOP_EXPR, type, arg)); + return fold_build1 (NOP_EXPR, type, arg); switch (TREE_CODE (type)) { @@ -1911,15 +1936,15 @@ fold_convert (tree type, tree arg) } if (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig) || TREE_CODE (orig) == OFFSET_TYPE) - return fold (build1 (NOP_EXPR, type, arg)); + return fold_build1 (NOP_EXPR, type, arg); if (TREE_CODE (orig) == COMPLEX_TYPE) { - tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg)); + tem = fold_build1 (REALPART_EXPR, TREE_TYPE (orig), arg); return fold_convert (type, tem); } gcc_assert (TREE_CODE (orig) == VECTOR_TYPE && tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))); - return fold (build1 (NOP_EXPR, type, arg)); + return fold_build1 (NOP_EXPR, type, arg); case REAL_TYPE: if (TREE_CODE (arg) == INTEGER_CST) @@ -1940,14 +1965,14 @@ fold_convert (tree type, tree arg) case INTEGER_TYPE: case CHAR_TYPE: case BOOLEAN_TYPE: case ENUMERAL_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: - return fold (build1 (FLOAT_EXPR, type, arg)); + return fold_build1 (FLOAT_EXPR, type, arg); case REAL_TYPE: - return fold (build1 (flag_float_store ? CONVERT_EXPR : NOP_EXPR, - type, arg)); + return fold_build1 (flag_float_store ? CONVERT_EXPR : NOP_EXPR, + type, arg); case COMPLEX_TYPE: - tem = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg)); + tem = fold_build1 (REALPART_EXPR, TREE_TYPE (orig), arg); return fold_convert (type, tem); default: @@ -1972,15 +1997,15 @@ fold_convert (tree type, tree arg) { rpart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 0)); ipart = fold_convert (TREE_TYPE (type), TREE_OPERAND (arg, 1)); - return fold (build2 (COMPLEX_EXPR, type, rpart, ipart)); + return fold_build2 (COMPLEX_EXPR, type, rpart, ipart); } arg = save_expr (arg); - rpart = fold (build1 (REALPART_EXPR, TREE_TYPE (orig), arg)); - ipart = fold (build1 (IMAGPART_EXPR, TREE_TYPE (orig), arg)); + rpart = fold_build1 (REALPART_EXPR, TREE_TYPE (orig), arg); + ipart = fold_build1 (IMAGPART_EXPR, TREE_TYPE (orig), arg); rpart = fold_convert (TREE_TYPE (type), rpart); ipart = fold_convert (TREE_TYPE (type), ipart); - return fold (build2 (COMPLEX_EXPR, type, rpart, ipart)); + return fold_build2 (COMPLEX_EXPR, type, rpart, ipart); } default: @@ -1993,26 +2018,22 @@ fold_convert (tree type, tree arg) gcc_assert (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))); gcc_assert (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig) || TREE_CODE (orig) == VECTOR_TYPE); - return fold (build1 (NOP_EXPR, type, arg)); + return fold_build1 (NOP_EXPR, type, arg); case VOID_TYPE: - return fold (build1 (CONVERT_EXPR, type, fold_ignored_result (arg))); + return fold_build1 (CONVERT_EXPR, type, fold_ignored_result (arg)); default: gcc_unreachable (); } } -/* Return an expr equal to X but certainly not valid as an lvalue. */ +/* Return false if expr can be assumed not to be an value, true + otherwise. */ -tree -non_lvalue (tree x) +static bool +maybe_lvalue_p (tree x) { - /* While we are in GIMPLE, NON_LVALUE_EXPR doesn't mean anything to - us. */ - if (in_gimple_form) - return x; - /* We only need to wrap lvalue tree codes. */ switch (TREE_CODE (x)) { @@ -2052,8 +2073,24 @@ non_lvalue (tree x) /* Assume the worst for front-end tree codes. */ if ((int)TREE_CODE (x) >= NUM_TREE_CODES) break; - return x; + return false; } + + return true; +} + +/* Return an expr equal to X but certainly not valid as an lvalue. */ + +tree +non_lvalue (tree x) +{ + /* While we are in GIMPLE, NON_LVALUE_EXPR doesn't mean anything to + us. */ + if (in_gimple_form) + return x; + + if (! maybe_lvalue_p (x)) + return x; return build1 (NON_LVALUE_EXPR, TREE_TYPE (x), x); } @@ -2309,8 +2346,8 @@ combine_comparisons (enum tree_code code, enum tree_code lcode, else if (compcode == COMPCODE_FALSE) return constant_boolean_node (false, truth_type); else - return fold (build2 (compcode_to_comparison (compcode), - truth_type, ll_arg, lr_arg)); + return fold_build2 (compcode_to_comparison (compcode), + truth_type, ll_arg, lr_arg); } /* Return nonzero if CODE is a tree code that represents a truth value. */ @@ -2779,16 +2816,16 @@ eval_subst (tree arg, tree old0, tree new0, tree old1, tree new1) switch (class) { case tcc_unary: - return fold (build1 (code, type, - eval_subst (TREE_OPERAND (arg, 0), - old0, new0, old1, new1))); + return fold_build1 (code, type, + eval_subst (TREE_OPERAND (arg, 0), + old0, new0, old1, new1)); case tcc_binary: - return fold (build2 (code, type, - eval_subst (TREE_OPERAND (arg, 0), - old0, new0, old1, new1), - eval_subst (TREE_OPERAND (arg, 1), - old0, new0, old1, new1))); + return fold_build2 (code, type, + eval_subst (TREE_OPERAND (arg, 0), + old0, new0, old1, new1), + eval_subst (TREE_OPERAND (arg, 1), + old0, new0, old1, new1)); case tcc_expression: switch (code) @@ -2800,13 +2837,13 @@ eval_subst (tree arg, tree old0, tree new0, tree old1, tree new1) return eval_subst (TREE_OPERAND (arg, 1), old0, new0, old1, new1); case COND_EXPR: - return fold (build3 (code, type, - eval_subst (TREE_OPERAND (arg, 0), - old0, new0, old1, new1), - eval_subst (TREE_OPERAND (arg, 1), - old0, new0, old1, new1), - eval_subst (TREE_OPERAND (arg, 2), - old0, new0, old1, new1))); + return fold_build3 (code, type, + eval_subst (TREE_OPERAND (arg, 0), + old0, new0, old1, new1), + eval_subst (TREE_OPERAND (arg, 1), + old0, new0, old1, new1), + eval_subst (TREE_OPERAND (arg, 2), + old0, new0, old1, new1)); default: break; } @@ -2831,7 +2868,7 @@ eval_subst (tree arg, tree old0, tree new0, tree old1, tree new1) else if (arg1 == old1 || operand_equal_p (arg1, old1, 0)) arg1 = new1; - return fold (build2 (code, type, arg0, arg1)); + return fold_build2 (code, type, arg0, arg1); } default: @@ -3063,8 +3100,48 @@ distribute_bit_expr (enum tree_code code, tree type, tree arg0, tree arg1) else return 0; - return fold (build2 (TREE_CODE (arg0), type, common, - fold (build2 (code, type, left, right)))); + return fold_build2 (TREE_CODE (arg0), type, common, + fold_build2 (code, type, left, right)); +} + +/* Knowing that ARG0 and ARG1 are both RDIV_EXPRs, simplify a binary operation + with code CODE. This optimization is unsafe. */ +static tree +distribute_real_division (enum tree_code code, tree type, tree arg0, tree arg1) +{ + bool mul0 = TREE_CODE (arg0) == MULT_EXPR; + bool mul1 = TREE_CODE (arg1) == MULT_EXPR; + + /* (A / C) +- (B / C) -> (A +- B) / C. */ + if (mul0 == mul1 + && operand_equal_p (TREE_OPERAND (arg0, 1), + TREE_OPERAND (arg1, 1), 0)) + return fold_build2 (mul0 ? MULT_EXPR : RDIV_EXPR, type, + fold_build2 (code, type, + TREE_OPERAND (arg0, 0), + TREE_OPERAND (arg1, 0)), + TREE_OPERAND (arg0, 1)); + + /* (A / C1) +- (A / C2) -> A * (1 / C1 +- 1 / C2). */ + if (operand_equal_p (TREE_OPERAND (arg0, 0), + TREE_OPERAND (arg1, 0), 0) + && TREE_CODE (TREE_OPERAND (arg0, 1)) == REAL_CST + && TREE_CODE (TREE_OPERAND (arg1, 1)) == REAL_CST) + { + REAL_VALUE_TYPE r0, r1; + r0 = TREE_REAL_CST (TREE_OPERAND (arg0, 1)); + r1 = TREE_REAL_CST (TREE_OPERAND (arg1, 1)); + if (!mul0) + real_arithmetic (&r0, RDIV_EXPR, &dconst1, &r0); + if (!mul1) + real_arithmetic (&r1, RDIV_EXPR, &dconst1, &r1); + real_arithmetic (&r0, code, &r0, &r1); + return fold_build2 (MULT_EXPR, type, + TREE_OPERAND (arg0, 0), + build_real (type, r0)); + } + + return NULL_TREE; } /* Return a BIT_FIELD_REF of type TYPE to refer to BITSIZE bits of INNER @@ -3216,7 +3293,7 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type, fold_convert (unsigned_type, rhs), size_int (lbitsize), 0))) { - warning ("comparison is always %d due to width of bit-field", + warning (0, "comparison is always %d due to width of bit-field", code == NE_EXPR); return constant_boolean_node (code == NE_EXPR, compare_type); } @@ -3227,7 +3304,7 @@ optimize_bit_field_compare (enum tree_code code, tree compare_type, size_int (lbitsize - 1), 0); if (! integer_zerop (tem) && ! integer_all_onesp (tem)) { - warning ("comparison is always %d due to width of bit-field", + warning (0, "comparison is always %d due to width of bit-field", code == NE_EXPR); return constant_boolean_node (code == NE_EXPR, compare_type); } @@ -3345,8 +3422,8 @@ decode_field_reference (tree exp, HOST_WIDE_INT *pbitsize, /* Merge it with the mask we found in the BIT_AND_EXPR, if any. */ if (and_mask != 0) - mask = fold (build2 (BIT_AND_EXPR, unsigned_type, - fold_convert (unsigned_type, and_mask), mask)); + mask = fold_build2 (BIT_AND_EXPR, unsigned_type, + fold_convert (unsigned_type, and_mask), mask); *pmask = mask; *pand_mask = and_mask; @@ -3508,8 +3585,8 @@ range_binop (enum tree_code code, tree type, tree arg0, int upper0_p, if (arg0 != 0 && arg1 != 0) { - tem = fold (build2 (code, type != 0 ? type : TREE_TYPE (arg0), - arg0, fold_convert (TREE_TYPE (arg0), arg1))); + tem = fold_build2 (code, type != 0 ? type : TREE_TYPE (arg0), + arg0, fold_convert (TREE_TYPE (arg0), arg1)); STRIP_NOPS (tem); return TREE_CODE (tem) == INTEGER_CST ? tem : 0; } @@ -3768,11 +3845,11 @@ make_range (tree exp, int *pin_p, tree *plow, tree *phigh) : TYPE_MAX_VALUE (arg0_type); if (TYPE_PRECISION (exp_type) == TYPE_PRECISION (arg0_type)) - high_positive = fold (build2 (RSHIFT_EXPR, arg0_type, - fold_convert (arg0_type, - high_positive), - fold_convert (arg0_type, - integer_one_node))); + high_positive = fold_build2 (RSHIFT_EXPR, arg0_type, + fold_convert (arg0_type, + high_positive), + fold_convert (arg0_type, + integer_one_node)); /* If the low bound is specified, "and" the range with the range for which the original unsigned value will be @@ -3852,13 +3929,13 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high) return fold_convert (type, integer_one_node); if (low == 0) - return fold (build2 (LE_EXPR, type, exp, high)); + return fold_build2 (LE_EXPR, type, exp, high); if (high == 0) - return fold (build2 (GE_EXPR, type, exp, low)); + return fold_build2 (GE_EXPR, type, exp, low); if (operand_equal_p (low, high, 0)) - return fold (build2 (EQ_EXPR, type, exp, low)); + return fold_build2 (EQ_EXPR, type, exp, low); if (integer_zerop (low)) { @@ -3897,8 +3974,8 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high) etype = lang_hooks.types.signed_type (etype); exp = fold_convert (etype, exp); } - return fold (build2 (GT_EXPR, type, exp, - fold_convert (etype, integer_zero_node))); + return fold_build2 (GT_EXPR, type, exp, + fold_convert (etype, integer_zero_node)); } } @@ -3936,7 +4013,7 @@ build_range_check (tree type, tree exp, int in_p, tree low, tree high) if (value != 0 && ! TREE_OVERFLOW (value)) return build_range_check (type, - fold (build2 (MINUS_EXPR, etype, exp, low)), + fold_build2 (MINUS_EXPR, etype, exp, low), 1, fold_convert (etype, integer_zero_node), value); @@ -4187,8 +4264,16 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) if ((FLOAT_TYPE_P (TREE_TYPE (arg01)) ? real_zerop (arg01) : integer_zerop (arg01)) - && TREE_CODE (arg2) == NEGATE_EXPR - && operand_equal_p (TREE_OPERAND (arg2, 0), arg1, 0)) + && ((TREE_CODE (arg2) == NEGATE_EXPR + && operand_equal_p (TREE_OPERAND (arg2, 0), arg1, 0)) + /* In the case that A is of the form X-Y, '-A' (arg2) may + have already been folded to Y-X, check for that. */ + || (TREE_CODE (arg1) == MINUS_EXPR + && TREE_CODE (arg2) == MINUS_EXPR + && operand_equal_p (TREE_OPERAND (arg1, 0), + TREE_OPERAND (arg2, 1), 0) + && operand_equal_p (TREE_OPERAND (arg1, 1), + TREE_OPERAND (arg2, 0), 0)))) switch (comp_code) { case EQ_EXPR: @@ -4208,7 +4293,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) if (TYPE_UNSIGNED (TREE_TYPE (arg1))) arg1 = fold_convert (lang_hooks.types.signed_type (TREE_TYPE (arg1)), arg1); - tem = fold (build1 (ABS_EXPR, TREE_TYPE (arg1), arg1)); + tem = fold_build1 (ABS_EXPR, TREE_TYPE (arg1), arg1); return pedantic_non_lvalue (fold_convert (type, tem)); case UNLE_EXPR: case UNLT_EXPR: @@ -4219,7 +4304,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) if (TYPE_UNSIGNED (TREE_TYPE (arg1))) arg1 = fold_convert (lang_hooks.types.signed_type (TREE_TYPE (arg1)), arg1); - tem = fold (build1 (ABS_EXPR, TREE_TYPE (arg1), arg1)); + tem = fold_build1 (ABS_EXPR, TREE_TYPE (arg1), arg1); return negate_expr (fold_convert (type, tem)); default: gcc_assert (TREE_CODE_CLASS (comp_code) == tcc_comparison); @@ -4265,7 +4350,13 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) a number and A is not. The conditions in the original expressions will be false, so all four give B. The min() and max() versions would give a NaN instead. */ - if (operand_equal_for_comparison_p (arg01, arg2, arg00)) + if (operand_equal_for_comparison_p (arg01, arg2, arg00) + /* Avoid these transformations if the COND_EXPR may be used + as an lvalue in the C++ front-end. PR c++/19199. */ + && (in_gimple_form + || strcmp (lang_hooks.name, "GNU C++") != 0 + || ! maybe_lvalue_p (arg1) + || ! maybe_lvalue_p (arg2))) { tree comp_op0 = arg00; tree comp_op1 = arg01; @@ -4298,8 +4389,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) comp_op0 = fold_convert (comp_type, comp_op0); comp_op1 = fold_convert (comp_type, comp_op1); tem = (comp_code == LE_EXPR || comp_code == UNLE_EXPR) - ? fold (build2 (MIN_EXPR, comp_type, comp_op0, comp_op1)) - : fold (build2 (MIN_EXPR, comp_type, comp_op1, comp_op0)); + ? fold_build2 (MIN_EXPR, comp_type, comp_op0, comp_op1) + : fold_build2 (MIN_EXPR, comp_type, comp_op1, comp_op0); return pedantic_non_lvalue (fold_convert (type, tem)); } break; @@ -4312,8 +4403,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) comp_op0 = fold_convert (comp_type, comp_op0); comp_op1 = fold_convert (comp_type, comp_op1); tem = (comp_code == GE_EXPR || comp_code == UNGE_EXPR) - ? fold (build2 (MAX_EXPR, comp_type, comp_op0, comp_op1)) - : fold (build2 (MAX_EXPR, comp_type, comp_op1, comp_op0)); + ? fold_build2 (MAX_EXPR, comp_type, comp_op0, comp_op1) + : fold_build2 (MAX_EXPR, comp_type, comp_op1, comp_op0); return pedantic_non_lvalue (fold_convert (type, tem)); } break; @@ -4345,7 +4436,7 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) case EQ_EXPR: /* We can replace A with C1 in this case. */ arg1 = fold_convert (type, arg01); - return fold (build3 (COND_EXPR, type, arg0, arg1, arg2)); + return fold_build3 (COND_EXPR, type, arg0, arg1, arg2); case LT_EXPR: /* If C1 is C2 + 1, this is min(A, C2). */ @@ -4355,8 +4446,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) const_binop (PLUS_EXPR, arg2, integer_one_node, 0), OEP_ONLY_CONST)) - return pedantic_non_lvalue (fold (build2 (MIN_EXPR, - type, arg1, arg2))); + return pedantic_non_lvalue (fold_build2 (MIN_EXPR, + type, arg1, arg2)); break; case LE_EXPR: @@ -4367,8 +4458,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) const_binop (MINUS_EXPR, arg2, integer_one_node, 0), OEP_ONLY_CONST)) - return pedantic_non_lvalue (fold (build2 (MIN_EXPR, - type, arg1, arg2))); + return pedantic_non_lvalue (fold_build2 (MIN_EXPR, + type, arg1, arg2)); break; case GT_EXPR: @@ -4379,8 +4470,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) const_binop (MINUS_EXPR, arg2, integer_one_node, 0), OEP_ONLY_CONST)) - return pedantic_non_lvalue (fold (build2 (MAX_EXPR, - type, arg1, arg2))); + return pedantic_non_lvalue (fold_build2 (MAX_EXPR, + type, arg1, arg2)); break; case GE_EXPR: @@ -4391,8 +4482,8 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2) const_binop (PLUS_EXPR, arg2, integer_one_node, 0), OEP_ONLY_CONST)) - return pedantic_non_lvalue (fold (build2 (MAX_EXPR, - type, arg1, arg2))); + return pedantic_non_lvalue (fold_build2 (MAX_EXPR, + type, arg1, arg2)); break; case NE_EXPR: break; @@ -4780,11 +4871,11 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs) l_const = unextend (l_const, ll_bitsize, ll_unsignedp, ll_and_mask); l_const = const_binop (LSHIFT_EXPR, l_const, size_int (xll_bitpos), 0); if (! integer_zerop (const_binop (BIT_AND_EXPR, l_const, - fold (build1 (BIT_NOT_EXPR, - lntype, ll_mask)), + fold_build1 (BIT_NOT_EXPR, + lntype, ll_mask), 0))) { - warning ("comparison is always %d", wanted_code == NE_EXPR); + warning (0, "comparison is always %d", wanted_code == NE_EXPR); return constant_boolean_node (wanted_code == NE_EXPR, truth_type); } @@ -4795,11 +4886,11 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs) r_const = unextend (r_const, rl_bitsize, rl_unsignedp, rl_and_mask); r_const = const_binop (LSHIFT_EXPR, r_const, size_int (xrl_bitpos), 0); if (! integer_zerop (const_binop (BIT_AND_EXPR, r_const, - fold (build1 (BIT_NOT_EXPR, - lntype, rl_mask)), + fold_build1 (BIT_NOT_EXPR, + lntype, rl_mask), 0))) { - warning ("comparison is always %d", wanted_code == NE_EXPR); + warning (0, "comparison is always %d", wanted_code == NE_EXPR); return constant_boolean_node (wanted_code == NE_EXPR, truth_type); } @@ -4928,12 +5019,12 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs) { if (wanted_code == NE_EXPR) { - warning ("% of unmatched not-equal tests is always 1"); + warning (0, "% of unmatched not-equal tests is always 1"); return constant_boolean_node (true, truth_type); } else { - warning ("% of mutually exclusive equal-tests is always 0"); + warning (0, "% of mutually exclusive equal-tests is always 0"); return constant_boolean_node (false, truth_type); } } @@ -5002,20 +5093,20 @@ optimize_minmax_comparison (enum tree_code code, tree type, tree op0, tree op1) case GE_EXPR: return - fold (build2 (TRUTH_ORIF_EXPR, type, - optimize_minmax_comparison - (EQ_EXPR, type, arg0, comp_const), - optimize_minmax_comparison - (GT_EXPR, type, arg0, comp_const))); + fold_build2 (TRUTH_ORIF_EXPR, type, + optimize_minmax_comparison + (EQ_EXPR, type, arg0, comp_const), + optimize_minmax_comparison + (GT_EXPR, type, arg0, comp_const)); case EQ_EXPR: if (op_code == MAX_EXPR && consts_equal) /* MAX (X, 0) == 0 -> X <= 0 */ - return fold (build2 (LE_EXPR, type, inner, comp_const)); + return fold_build2 (LE_EXPR, type, inner, comp_const); else if (op_code == MAX_EXPR && consts_lt) /* MAX (X, 0) == 5 -> X == 5 */ - return fold (build2 (EQ_EXPR, type, inner, comp_const)); + return fold_build2 (EQ_EXPR, type, inner, comp_const); else if (op_code == MAX_EXPR) /* MAX (X, 0) == -1 -> false */ @@ -5023,7 +5114,7 @@ optimize_minmax_comparison (enum tree_code code, tree type, tree op0, tree op1) else if (consts_equal) /* MIN (X, 0) == 0 -> X >= 0 */ - return fold (build2 (GE_EXPR, type, inner, comp_const)); + return fold_build2 (GE_EXPR, type, inner, comp_const); else if (consts_lt) /* MIN (X, 0) == 5 -> false */ @@ -5031,13 +5122,13 @@ optimize_minmax_comparison (enum tree_code code, tree type, tree op0, tree op1) else /* MIN (X, 0) == -1 -> X == -1 */ - return fold (build2 (EQ_EXPR, type, inner, comp_const)); + return fold_build2 (EQ_EXPR, type, inner, comp_const); case GT_EXPR: if (op_code == MAX_EXPR && (consts_equal || consts_lt)) /* MAX (X, 0) > 0 -> X > 0 MAX (X, 0) > 5 -> X > 5 */ - return fold (build2 (GT_EXPR, type, inner, comp_const)); + return fold_build2 (GT_EXPR, type, inner, comp_const); else if (op_code == MAX_EXPR) /* MAX (X, 0) > -1 -> true */ @@ -5050,7 +5141,7 @@ optimize_minmax_comparison (enum tree_code code, tree type, tree op0, tree op1) else /* MIN (X, 0) > -1 -> X > -1 */ - return fold (build2 (GT_EXPR, type, inner, comp_const)); + return fold_build2 (GT_EXPR, type, inner, comp_const); default: return NULL_TREE; @@ -5175,7 +5266,7 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) tree cstype = (*lang_hooks.types.signed_type) (ctype); if ((t1 = extract_muldiv (op0, c, code, cstype)) != 0) { - t1 = fold (build1 (tcode, cstype, fold_convert (cstype, t1))); + t1 = fold_build1 (tcode, cstype, fold_convert (cstype, t1)); return fold_convert (ctype, t1); } break; @@ -5183,7 +5274,7 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) /* FALLTHROUGH */ case NEGATE_EXPR: if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0) - return fold (build1 (tcode, ctype, fold_convert (ctype, t1))); + return fold_build1 (tcode, ctype, fold_convert (ctype, t1)); break; case MIN_EXPR: case MAX_EXPR: @@ -5199,8 +5290,8 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) if (tree_int_cst_sgn (c) < 0) tcode = (tcode == MIN_EXPR ? MAX_EXPR : MIN_EXPR); - return fold (build2 (tcode, ctype, fold_convert (ctype, t1), - fold_convert (ctype, t2))); + return fold_build2 (tcode, ctype, fold_convert (ctype, t1), + fold_convert (ctype, t2)); } break; @@ -5241,8 +5332,8 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) are divisible by c. */ || (multiple_of_p (ctype, op0, c) && multiple_of_p (ctype, op1, c)))) - return fold (build2 (tcode, ctype, fold_convert (ctype, t1), - fold_convert (ctype, t2))); + return fold_build2 (tcode, ctype, fold_convert (ctype, t1), + fold_convert (ctype, t2)); /* If this was a subtraction, negate OP1 and set it to be an addition. This simplifies the logic below. */ @@ -5292,17 +5383,17 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) /* If we were able to eliminate our operation from the first side, apply our operation to the second side and reform the PLUS. */ if (t1 != 0 && (TREE_CODE (t1) != code || code == MULT_EXPR)) - return fold (build2 (tcode, ctype, fold_convert (ctype, t1), op1)); + return fold_build2 (tcode, ctype, fold_convert (ctype, t1), op1); /* The last case is if we are a multiply. In that case, we can apply the distributive law to commute the multiply and addition if the multiplication of the constants doesn't overflow. */ if (code == MULT_EXPR) - return fold (build2 (tcode, ctype, - fold (build2 (code, ctype, - fold_convert (ctype, op0), - fold_convert (ctype, c))), - op1)); + return fold_build2 (tcode, ctype, + fold_build2 (code, ctype, + fold_convert (ctype, op0), + fold_convert (ctype, c)), + op1); break; @@ -5324,12 +5415,12 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) do something only if the second operand is a constant. */ if (same_p && (t1 = extract_muldiv (op0, c, code, wide_type)) != 0) - return fold (build2 (tcode, ctype, fold_convert (ctype, t1), - fold_convert (ctype, op1))); + return fold_build2 (tcode, ctype, fold_convert (ctype, t1), + fold_convert (ctype, op1)); else if (tcode == MULT_EXPR && code == MULT_EXPR && (t1 = extract_muldiv (op1, c, code, wide_type)) != 0) - return fold (build2 (tcode, ctype, fold_convert (ctype, op0), - fold_convert (ctype, t1))); + return fold_build2 (tcode, ctype, fold_convert (ctype, op0), + fold_convert (ctype, t1)); else if (TREE_CODE (op1) != INTEGER_CST) return 0; @@ -5339,7 +5430,7 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) && 0 != (t1 = const_binop (MULT_EXPR, fold_convert (ctype, op1), fold_convert (ctype, c), 0)) && ! TREE_OVERFLOW (t1)) - return fold (build2 (tcode, ctype, fold_convert (ctype, op0), t1)); + return fold_build2 (tcode, ctype, fold_convert (ctype, op0), t1); /* If these operations "cancel" each other, we have the main optimizations of this pass, which occur when either constant is a @@ -5358,15 +5449,15 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type) && code != FLOOR_MOD_EXPR && code != ROUND_MOD_EXPR))) { if (integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c, 0))) - return fold (build2 (tcode, ctype, fold_convert (ctype, op0), - fold_convert (ctype, - const_binop (TRUNC_DIV_EXPR, - op1, c, 0)))); + return fold_build2 (tcode, ctype, fold_convert (ctype, op0), + fold_convert (ctype, + const_binop (TRUNC_DIV_EXPR, + op1, c, 0))); else if (integer_zerop (const_binop (TRUNC_MOD_EXPR, c, op1, 0))) - return fold (build2 (code, ctype, fold_convert (ctype, op0), - fold_convert (ctype, - const_binop (TRUNC_DIV_EXPR, - c, op1, 0)))); + return fold_build2 (code, ctype, fold_convert (ctype, op0), + fold_convert (ctype, + const_binop (TRUNC_DIV_EXPR, + c, op1, 0))); } break; @@ -5493,17 +5584,21 @@ fold_binary_op_with_conditional_arg (enum tree_code code, if (lhs == 0) { true_value = fold_convert (cond_type, true_value); - lhs = fold (cond_first_p ? build2 (code, type, true_value, arg) - : build2 (code, type, arg, true_value)); + if (cond_first_p) + lhs = fold_build2 (code, type, true_value, arg); + else + lhs = fold_build2 (code, type, arg, true_value); } if (rhs == 0) { false_value = fold_convert (cond_type, false_value); - rhs = fold (cond_first_p ? build2 (code, type, false_value, arg) - : build2 (code, type, arg, false_value)); + if (cond_first_p) + rhs = fold_build2 (code, type, false_value, arg); + else + rhs = fold_build2 (code, type, arg, false_value); } - test = fold (build3 (COND_EXPR, type, test, lhs, rhs)); + test = fold_build3 (COND_EXPR, type, test, lhs, rhs); return fold_convert (type, test); } @@ -5581,8 +5676,8 @@ fold_mathfn_compare (enum built_in_function fcode, enum tree_code code, return omit_one_operand (type, integer_one_node, arg); /* sqrt(x) > y is the same as x >= 0, if y is negative. */ - return fold (build2 (GE_EXPR, type, arg, - build_real (TREE_TYPE (arg), dconst0))); + return fold_build2 (GE_EXPR, type, arg, + build_real (TREE_TYPE (arg), dconst0)); } else if (code == GT_EXPR || code == GE_EXPR) { @@ -5595,8 +5690,8 @@ fold_mathfn_compare (enum built_in_function fcode, enum tree_code code, { /* sqrt(x) > y is x == +Inf, when y is very large. */ if (HONOR_INFINITIES (mode)) - return fold (build2 (EQ_EXPR, type, arg, - build_real (TREE_TYPE (arg), c2))); + return fold_build2 (EQ_EXPR, type, arg, + build_real (TREE_TYPE (arg), c2)); /* sqrt(x) > y is always false, when y is very large and we don't care about infinities. */ @@ -5604,8 +5699,8 @@ fold_mathfn_compare (enum built_in_function fcode, enum tree_code code, } /* sqrt(x) > c is the same as x > c*c. */ - return fold (build2 (code, type, arg, - build_real (TREE_TYPE (arg), c2))); + return fold_build2 (code, type, arg, + build_real (TREE_TYPE (arg), c2)); } else if (code == LT_EXPR || code == LE_EXPR) { @@ -5624,14 +5719,14 @@ fold_mathfn_compare (enum built_in_function fcode, enum tree_code code, /* sqrt(x) < y is x != +Inf when y is very large and we don't care about NaNs. */ if (! HONOR_NANS (mode)) - return fold (build2 (NE_EXPR, type, arg, - build_real (TREE_TYPE (arg), c2))); + return fold_build2 (NE_EXPR, type, arg, + build_real (TREE_TYPE (arg), c2)); /* sqrt(x) < y is x >= 0 when y is very large and we don't care about Infinities. */ if (! HONOR_INFINITIES (mode)) - return fold (build2 (GE_EXPR, type, arg, - build_real (TREE_TYPE (arg), dconst0))); + return fold_build2 (GE_EXPR, type, arg, + build_real (TREE_TYPE (arg), dconst0)); /* sqrt(x) < y is x >= 0 && x != +Inf, when y is large. */ if (lang_hooks.decls.global_bindings_p () != 0 @@ -5639,32 +5734,32 @@ fold_mathfn_compare (enum built_in_function fcode, enum tree_code code, return NULL_TREE; arg = save_expr (arg); - return fold (build2 (TRUTH_ANDIF_EXPR, type, - fold (build2 (GE_EXPR, type, arg, - build_real (TREE_TYPE (arg), - dconst0))), - fold (build2 (NE_EXPR, type, arg, - build_real (TREE_TYPE (arg), - c2))))); + return fold_build2 (TRUTH_ANDIF_EXPR, type, + fold_build2 (GE_EXPR, type, arg, + build_real (TREE_TYPE (arg), + dconst0)), + fold_build2 (NE_EXPR, type, arg, + build_real (TREE_TYPE (arg), + c2))); } /* sqrt(x) < c is the same as x < c*c, if we ignore NaNs. */ if (! HONOR_NANS (mode)) - return fold (build2 (code, type, arg, - build_real (TREE_TYPE (arg), c2))); + return fold_build2 (code, type, arg, + build_real (TREE_TYPE (arg), c2)); /* sqrt(x) < c is the same as x >= 0 && x < c*c. */ if (lang_hooks.decls.global_bindings_p () == 0 && ! CONTAINS_PLACEHOLDER_P (arg)) { arg = save_expr (arg); - return fold (build2 (TRUTH_ANDIF_EXPR, type, - fold (build2 (GE_EXPR, type, arg, - build_real (TREE_TYPE (arg), - dconst0))), - fold (build2 (code, type, arg, - build_real (TREE_TYPE (arg), - c2))))); + return fold_build2 (TRUTH_ANDIF_EXPR, type, + fold_build2 (GE_EXPR, type, arg, + build_real (TREE_TYPE (arg), + dconst0)), + fold_build2 (code, type, arg, + build_real (TREE_TYPE (arg), + c2))); } } } @@ -5715,7 +5810,7 @@ fold_inf_compare (enum tree_code code, tree type, tree arg0, tree arg1) && ! CONTAINS_PLACEHOLDER_P (arg0)) { arg0 = save_expr (arg0); - return fold (build2 (EQ_EXPR, type, arg0, arg0)); + return fold_build2 (EQ_EXPR, type, arg0, arg0); } break; @@ -5723,30 +5818,30 @@ fold_inf_compare (enum tree_code code, tree type, tree arg0, tree arg1) case GE_EXPR: /* x == +Inf and x >= +Inf are always equal to x > DBL_MAX. */ real_maxval (&max, neg, mode); - return fold (build2 (neg ? LT_EXPR : GT_EXPR, type, - arg0, build_real (TREE_TYPE (arg0), max))); + return fold_build2 (neg ? LT_EXPR : GT_EXPR, type, + arg0, build_real (TREE_TYPE (arg0), max)); case LT_EXPR: /* x < +Inf is always equal to x <= DBL_MAX. */ real_maxval (&max, neg, mode); - return fold (build2 (neg ? GE_EXPR : LE_EXPR, type, - arg0, build_real (TREE_TYPE (arg0), max))); + return fold_build2 (neg ? GE_EXPR : LE_EXPR, type, + arg0, build_real (TREE_TYPE (arg0), max)); case NE_EXPR: /* x != +Inf is always equal to !(x > DBL_MAX). */ real_maxval (&max, neg, mode); if (! HONOR_NANS (mode)) - return fold (build2 (neg ? GE_EXPR : LE_EXPR, type, - arg0, build_real (TREE_TYPE (arg0), max))); + return fold_build2 (neg ? GE_EXPR : LE_EXPR, type, + arg0, build_real (TREE_TYPE (arg0), max)); /* The transformation below creates non-gimple code and thus is not appropriate if we are in gimple form. */ if (in_gimple_form) return NULL_TREE; - temp = fold (build2 (neg ? LT_EXPR : GT_EXPR, type, - arg0, build_real (TREE_TYPE (arg0), max))); - return fold (build1 (TRUTH_NOT_EXPR, type, temp)); + temp = fold_build2 (neg ? LT_EXPR : GT_EXPR, type, + arg0, build_real (TREE_TYPE (arg0), max)); + return fold_build1 (TRUTH_NOT_EXPR, type, temp); default: break; @@ -5858,39 +5953,39 @@ fold_div_compare (enum tree_code code, tree type, tree arg0, tree arg1) if (TREE_OVERFLOW (lo) && TREE_OVERFLOW (hi)) return omit_one_operand (type, integer_zero_node, arg00); if (TREE_OVERFLOW (hi)) - return fold (build2 (GE_EXPR, type, arg00, lo)); + return fold_build2 (GE_EXPR, type, arg00, lo); if (TREE_OVERFLOW (lo)) - return fold (build2 (LE_EXPR, type, arg00, hi)); + return fold_build2 (LE_EXPR, type, arg00, hi); return build_range_check (type, arg00, 1, lo, hi); case NE_EXPR: if (TREE_OVERFLOW (lo) && TREE_OVERFLOW (hi)) return omit_one_operand (type, integer_one_node, arg00); if (TREE_OVERFLOW (hi)) - return fold (build2 (LT_EXPR, type, arg00, lo)); + return fold_build2 (LT_EXPR, type, arg00, lo); if (TREE_OVERFLOW (lo)) - return fold (build2 (GT_EXPR, type, arg00, hi)); + return fold_build2 (GT_EXPR, type, arg00, hi); return build_range_check (type, arg00, 0, lo, hi); case LT_EXPR: if (TREE_OVERFLOW (lo)) return omit_one_operand (type, integer_zero_node, arg00); - return fold (build2 (LT_EXPR, type, arg00, lo)); + return fold_build2 (LT_EXPR, type, arg00, lo); case LE_EXPR: if (TREE_OVERFLOW (hi)) return omit_one_operand (type, integer_one_node, arg00); - return fold (build2 (LE_EXPR, type, arg00, hi)); + return fold_build2 (LE_EXPR, type, arg00, hi); case GT_EXPR: if (TREE_OVERFLOW (hi)) return omit_one_operand (type, integer_zero_node, arg00); - return fold (build2 (GT_EXPR, type, arg00, hi)); + return fold_build2 (GT_EXPR, type, arg00, hi); case GE_EXPR: if (TREE_OVERFLOW (lo)) return omit_one_operand (type, integer_one_node, arg00); - return fold (build2 (GE_EXPR, type, arg00, lo)); + return fold_build2 (GE_EXPR, type, arg00, lo); default: break; @@ -5901,6 +5996,40 @@ fold_div_compare (enum tree_code code, tree type, tree arg0, tree arg1) /* If CODE with arguments ARG0 and ARG1 represents a single bit + equality/inequality test, then return a simplified form of the test + using a sign testing. Otherwise return NULL. TYPE is the desired + result type. */ + +static tree +fold_single_bit_test_into_sign_test (enum tree_code code, tree arg0, tree arg1, + tree result_type) +{ + /* If this is testing a single bit, we can optimize the test. */ + if ((code == NE_EXPR || code == EQ_EXPR) + && TREE_CODE (arg0) == BIT_AND_EXPR && integer_zerop (arg1) + && integer_pow2p (TREE_OPERAND (arg0, 1))) + { + /* If we have (A & C) != 0 where C is the sign bit of A, convert + this into A < 0. Similarly for (A & C) == 0 into A >= 0. */ + tree arg00 = sign_bit_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg0, 1)); + + if (arg00 != NULL_TREE + /* This is only a win if casting to a signed type is cheap, + i.e. when arg00's type is not a partial mode. */ + && TYPE_PRECISION (TREE_TYPE (arg00)) + == GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg00)))) + { + tree stype = lang_hooks.types.signed_type (TREE_TYPE (arg00)); + return fold_build2 (code == EQ_EXPR ? GE_EXPR : LT_EXPR, + result_type, fold_convert (stype, arg00), + fold_convert (stype, integer_zero_node)); + } + } + + return NULL_TREE; +} + +/* If CODE with arguments ARG0 and ARG1 represents a single bit equality/inequality test, then return a simplified form of the test using shifts and logical operations. Otherwise return NULL. TYPE is the desired result type. */ @@ -5920,22 +6049,14 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1, enum machine_mode operand_mode = TYPE_MODE (type); int ops_unsigned; tree signed_type, unsigned_type, intermediate_type; - tree arg00; + tree tem; - /* If we have (A & C) != 0 where C is the sign bit of A, convert - this into A < 0. Similarly for (A & C) == 0 into A >= 0. */ - arg00 = sign_bit_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg0, 1)); - if (arg00 != NULL_TREE - /* This is only a win if casting to a signed type is cheap, - i.e. when arg00's type is not a partial mode. */ - && TYPE_PRECISION (TREE_TYPE (arg00)) - == GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg00)))) - { - tree stype = lang_hooks.types.signed_type (TREE_TYPE (arg00)); - return fold (build2 (code == EQ_EXPR ? GE_EXPR : LT_EXPR, - result_type, fold_convert (stype, arg00), - fold_convert (stype, integer_zero_node))); - } + /* First, see if we can fold the single bit test into a sign-bit + test. */ + tem = fold_single_bit_test_into_sign_test (code, arg0, arg1, + result_type); + if (tem) + return tem; /* Otherwise we have (A & C) != 0 where C is a single bit, convert that into ((A >> C2) & 1). Where C2 = log2(C). @@ -5974,8 +6095,8 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1, inner, size_int (bitnum)); if (code == EQ_EXPR) - inner = fold (build2 (BIT_XOR_EXPR, intermediate_type, - inner, integer_one_node)); + inner = fold_build2 (BIT_XOR_EXPR, intermediate_type, + inner, integer_one_node); /* Put the AND last so it can combine with more things. */ inner = build2 (BIT_AND_EXPR, intermediate_type, @@ -6074,6 +6195,15 @@ fold_widened_comparison (enum tree_code code, tree type, tree arg0, tree arg1) return NULL_TREE; shorter_type = TREE_TYPE (arg0_unw); +#ifdef HAVE_canonicalize_funcptr_for_compare + /* Disable this optimization if we're casting a function pointer + type on targets that require function pointer canonicalization. */ + if (HAVE_canonicalize_funcptr_for_compare + && TREE_CODE (shorter_type) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (shorter_type)) == FUNCTION_TYPE) + return NULL_TREE; +#endif + if (TYPE_PRECISION (TREE_TYPE (arg0)) <= TYPE_PRECISION (shorter_type)) return NULL_TREE; @@ -6086,10 +6216,11 @@ fold_widened_comparison (enum tree_code code, tree type, tree arg0, tree arg1) || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type)) && (TREE_TYPE (arg1_unw) == shorter_type || (TREE_CODE (arg1_unw) == INTEGER_CST - && TREE_CODE (shorter_type) == INTEGER_TYPE + && (TREE_CODE (shorter_type) == INTEGER_TYPE + || TREE_CODE (shorter_type) == BOOLEAN_TYPE) && int_fits_type_p (arg1_unw, shorter_type)))) - return fold (build (code, type, arg0_unw, - fold_convert (shorter_type, arg1_unw))); + return fold_build2 (code, type, arg0_unw, + fold_convert (shorter_type, arg1_unw)); if (TREE_CODE (arg1_unw) != INTEGER_CST) return NULL_TREE; @@ -6156,6 +6287,15 @@ fold_sign_changed_comparison (enum tree_code code, tree type, arg0_inner = TREE_OPERAND (arg0, 0); inner_type = TREE_TYPE (arg0_inner); +#ifdef HAVE_canonicalize_funcptr_for_compare + /* Disable this optimization if we're casting a function pointer + type on targets that require function pointer canonicalization. */ + if (HAVE_canonicalize_funcptr_for_compare + && TREE_CODE (inner_type) == POINTER_TYPE + && TREE_CODE (TREE_TYPE (inner_type)) == FUNCTION_TYPE) + return NULL_TREE; +#endif + if (TYPE_PRECISION (inner_type) != TYPE_PRECISION (outer_type)) return NULL_TREE; @@ -6182,59 +6322,84 @@ fold_sign_changed_comparison (enum tree_code code, tree type, else arg1 = fold_convert (inner_type, arg1); - return fold (build2 (code, type, arg0_inner, arg1)); + return fold_build2 (code, type, arg0_inner, arg1); } /* Tries to replace &a[idx] CODE s * delta with &a[idx CODE delta], if s is - step of the array. ADDR is the address. MULT is the multiplicative expression. + step of the array. Reconstructs s and delta in the case of s * delta + being an integer constant (and thus already folded). + ADDR is the address. MULT is the multiplicative expression. If the function succeeds, the new address expression is returned. Otherwise NULL_TREE is returned. */ static tree -try_move_mult_to_index (enum tree_code code, tree addr, tree mult) +try_move_mult_to_index (enum tree_code code, tree addr, tree op1) { tree s, delta, step; - tree arg0 = TREE_OPERAND (mult, 0), arg1 = TREE_OPERAND (mult, 1); tree ref = TREE_OPERAND (addr, 0), pref; tree ret, pos; tree itype; - STRIP_NOPS (arg0); - STRIP_NOPS (arg1); - - if (TREE_CODE (arg0) == INTEGER_CST) + /* Canonicalize op1 into a possibly non-constant delta + and an INTEGER_CST s. */ + if (TREE_CODE (op1) == MULT_EXPR) { - s = arg0; - delta = arg1; + tree arg0 = TREE_OPERAND (op1, 0), arg1 = TREE_OPERAND (op1, 1); + + STRIP_NOPS (arg0); + STRIP_NOPS (arg1); + + if (TREE_CODE (arg0) == INTEGER_CST) + { + s = arg0; + delta = arg1; + } + else if (TREE_CODE (arg1) == INTEGER_CST) + { + s = arg1; + delta = arg0; + } + else + return NULL_TREE; } - else if (TREE_CODE (arg1) == INTEGER_CST) + else if (TREE_CODE (op1) == INTEGER_CST) { - s = arg1; - delta = arg0; + delta = op1; + s = NULL_TREE; } else - return NULL_TREE; + { + /* Simulate we are delta * 1. */ + delta = op1; + s = integer_one_node; + } for (;; ref = TREE_OPERAND (ref, 0)) { if (TREE_CODE (ref) == ARRAY_REF) { - step = array_ref_element_size (ref); - - if (TREE_CODE (step) != INTEGER_CST) + itype = TYPE_DOMAIN (TREE_TYPE (TREE_OPERAND (ref, 0))); + if (! itype) continue; - itype = TREE_TYPE (step); - - /* If the type sizes do not match, we might run into problems - when one of them would overflow. */ - if (TYPE_PRECISION (itype) != TYPE_PRECISION (TREE_TYPE (s))) + step = array_ref_element_size (ref); + if (TREE_CODE (step) != INTEGER_CST) continue; - if (!operand_equal_p (step, fold_convert (itype, s), 0)) - continue; + if (s) + { + if (! tree_int_cst_equal (step, s)) + continue; + } + else + { + /* Try if delta is a multiple of step. */ + tree tmp = div_if_zero_remainder (EXACT_DIV_EXPR, delta, step); + if (! tmp) + continue; + delta = tmp; + } - delta = fold_convert (itype, delta); break; } @@ -6256,9 +6421,10 @@ try_move_mult_to_index (enum tree_code code, tree addr, tree mult) pos = TREE_OPERAND (pos, 0); } - TREE_OPERAND (pos, 1) = fold (build2 (code, itype, - TREE_OPERAND (pos, 1), - delta)); + TREE_OPERAND (pos, 1) = fold_build2 (code, itype, + fold_convert (itype, + TREE_OPERAND (pos, 1)), + fold_convert (itype, delta)); return build1 (ADDR_EXPR, TREE_TYPE (addr), ret); } @@ -6301,11 +6467,11 @@ fold_to_nonsharp_ineq_using_bound (tree ineq, tree bound) if (TREE_TYPE (a1) != typea) return NULL_TREE; - diff = fold (build2 (MINUS_EXPR, typea, a1, a)); + diff = fold_build2 (MINUS_EXPR, typea, a1, a); if (!integer_onep (diff)) return NULL_TREE; - return fold (build2 (GE_EXPR, type, a, y)); + return fold_build2 (GE_EXPR, type, a, y); } /* Fold complex addition when both components are accessible by parts. @@ -6333,10 +6499,10 @@ fold_complex_add (tree type, tree ac, tree bc, enum tree_code code) inner_type = TREE_TYPE (type); - rr = fold (build2 (code, inner_type, ar, br)); - ri = fold (build2 (code, inner_type, ai, bi)); + rr = fold_build2 (code, inner_type, ar, br); + ri = fold_build2 (code, inner_type, ai, bi); - return fold (build2 (COMPLEX_EXPR, type, rr, ri)); + return fold_build2 (COMPLEX_EXPR, type, rr, ri); } /* Perform some simplifications of complex multiplication when one or more @@ -6409,51 +6575,51 @@ fold_complex_mult_parts (tree type, tree ar, tree ai, tree br, tree bi) } else if (ai0 && bi0) { - rr = fold (build2 (MULT_EXPR, inner_type, ar, br)); + rr = fold_build2 (MULT_EXPR, inner_type, ar, br); ri = zero; } else if (ai0 && br0) { rr = zero; - ri = fold (build2 (MULT_EXPR, inner_type, ar, bi)); + ri = fold_build2 (MULT_EXPR, inner_type, ar, bi); } else if (ar0 && bi0) { rr = zero; - ri = fold (build2 (MULT_EXPR, inner_type, ai, br)); + ri = fold_build2 (MULT_EXPR, inner_type, ai, br); } else if (ar0 && br0) { - rr = fold (build2 (MULT_EXPR, inner_type, ai, bi)); - rr = fold (build1 (NEGATE_EXPR, inner_type, rr)); + rr = fold_build2 (MULT_EXPR, inner_type, ai, bi); + rr = fold_build1 (NEGATE_EXPR, inner_type, rr); ri = zero; } else if (bi0) { - rr = fold (build2 (MULT_EXPR, inner_type, ar, br)); - ri = fold (build2 (MULT_EXPR, inner_type, ai, br)); + rr = fold_build2 (MULT_EXPR, inner_type, ar, br); + ri = fold_build2 (MULT_EXPR, inner_type, ai, br); } else if (ai0) { - rr = fold (build2 (MULT_EXPR, inner_type, ar, br)); - ri = fold (build2 (MULT_EXPR, inner_type, ar, bi)); + rr = fold_build2 (MULT_EXPR, inner_type, ar, br); + ri = fold_build2 (MULT_EXPR, inner_type, ar, bi); } else if (br0) { - rr = fold (build2 (MULT_EXPR, inner_type, ai, bi)); - rr = fold (build1 (NEGATE_EXPR, inner_type, rr)); - ri = fold (build2 (MULT_EXPR, inner_type, ar, bi)); + rr = fold_build2 (MULT_EXPR, inner_type, ai, bi); + rr = fold_build1 (NEGATE_EXPR, inner_type, rr); + ri = fold_build2 (MULT_EXPR, inner_type, ar, bi); } else if (ar0) { - rr = fold (build2 (MULT_EXPR, inner_type, ai, bi)); - rr = fold (build1 (NEGATE_EXPR, inner_type, rr)); - ri = fold (build2 (MULT_EXPR, inner_type, ai, br)); + rr = fold_build2 (MULT_EXPR, inner_type, ai, bi); + rr = fold_build1 (NEGATE_EXPR, inner_type, rr); + ri = fold_build2 (MULT_EXPR, inner_type, ai, br); } else return NULL; - return fold (build2 (COMPLEX_EXPR, type, rr, ri)); + return fold_build2 (COMPLEX_EXPR, type, rr, ri); } static tree @@ -6544,40 +6710,40 @@ fold_complex_div_parts (tree type, tree ar, tree ai, tree br, tree bi, if (ai0 && bi0) { - rr = fold (build2 (code, inner_type, ar, br)); + rr = fold_build2 (code, inner_type, ar, br); ri = zero; } else if (ai0 && br0) { rr = zero; - ri = fold (build2 (code, inner_type, ar, bi)); - ri = fold (build1 (NEGATE_EXPR, inner_type, ri)); + ri = fold_build2 (code, inner_type, ar, bi); + ri = fold_build1 (NEGATE_EXPR, inner_type, ri); } else if (ar0 && bi0) { rr = zero; - ri = fold (build2 (code, inner_type, ai, br)); + ri = fold_build2 (code, inner_type, ai, br); } else if (ar0 && br0) { - rr = fold (build2 (code, inner_type, ai, bi)); + rr = fold_build2 (code, inner_type, ai, bi); ri = zero; } else if (bi0) { - rr = fold (build2 (code, inner_type, ar, br)); - ri = fold (build2 (code, inner_type, ai, br)); + rr = fold_build2 (code, inner_type, ar, br); + ri = fold_build2 (code, inner_type, ai, br); } else if (br0) { - rr = fold (build2 (code, inner_type, ai, bi)); - ri = fold (build2 (code, inner_type, ar, bi)); - ri = fold (build1 (NEGATE_EXPR, inner_type, ri)); + rr = fold_build2 (code, inner_type, ai, bi); + ri = fold_build2 (code, inner_type, ar, bi); + ri = fold_build1 (NEGATE_EXPR, inner_type, ri); } else return NULL; - return fold (build2 (COMPLEX_EXPR, type, rr, ri)); + return fold_build2 (COMPLEX_EXPR, type, rr, ri); } static tree @@ -6602,11 +6768,11 @@ fold_complex_div (tree type, tree ac, tree bc, enum tree_code code) return fold_complex_div_parts (type, ar, ai, br, bi, code); } -/* Fold a unary expression EXPR. Return the folded expression if - folding is successful. Otherwise, return the original - expression. */ +/* Fold a unary expression of code CODE and type TYPE with operand + OP0. Return the folded expression if folding is successful. + Otherwise, return NULL_TREE. */ -static tree +tree fold_unary (enum tree_code code, tree type, tree op0) { tree tem; @@ -6645,17 +6811,17 @@ fold_unary (enum tree_code code, tree type, tree op0) { if (TREE_CODE (arg0) == COMPOUND_EXPR) return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), - fold (build1 (code, type, TREE_OPERAND (arg0, 1)))); + fold_build1 (code, type, TREE_OPERAND (arg0, 1))); else if (TREE_CODE (arg0) == COND_EXPR) { tree arg01 = TREE_OPERAND (arg0, 1); tree arg02 = TREE_OPERAND (arg0, 2); if (! VOID_TYPE_P (TREE_TYPE (arg01))) - arg01 = fold (build1 (code, type, arg01)); + arg01 = fold_build1 (code, type, arg01); if (! VOID_TYPE_P (TREE_TYPE (arg02))) - arg02 = fold (build1 (code, type, arg02)); - tem = fold (build3 (COND_EXPR, type, TREE_OPERAND (arg0, 0), - arg01, arg02)); + arg02 = fold_build1 (code, type, arg02); + tem = fold_build3 (COND_EXPR, type, TREE_OPERAND (arg0, 0), + arg01, arg02); /* If this was a conversion, and all we did was to move into inside the COND_EXPR, bring it back out. But leave it if @@ -6698,11 +6864,11 @@ fold_unary (enum tree_code code, tree type, tree op0) return arg0; } else if (TREE_CODE (type) != INTEGER_TYPE) - return fold (build3 (COND_EXPR, type, arg0, - fold (build1 (code, type, - integer_one_node)), - fold (build1 (code, type, - integer_zero_node)))); + return fold_build3 (COND_EXPR, type, arg0, + fold_build1 (code, type, + integer_one_node), + fold_build1 (code, type, + integer_zero_node)); } } @@ -6727,16 +6893,19 @@ fold_unary (enum tree_code code, tree type, tree op0) int inside_int = INTEGRAL_TYPE_P (inside_type); int inside_ptr = POINTER_TYPE_P (inside_type); int inside_float = FLOAT_TYPE_P (inside_type); + int inside_vec = TREE_CODE (inside_type) == VECTOR_TYPE; unsigned int inside_prec = TYPE_PRECISION (inside_type); int inside_unsignedp = TYPE_UNSIGNED (inside_type); int inter_int = INTEGRAL_TYPE_P (inter_type); int inter_ptr = POINTER_TYPE_P (inter_type); int inter_float = FLOAT_TYPE_P (inter_type); + int inter_vec = TREE_CODE (inter_type) == VECTOR_TYPE; unsigned int inter_prec = TYPE_PRECISION (inter_type); int inter_unsignedp = TYPE_UNSIGNED (inter_type); int final_int = INTEGRAL_TYPE_P (type); int final_ptr = POINTER_TYPE_P (type); int final_float = FLOAT_TYPE_P (type); + int final_vec = TREE_CODE (type) == VECTOR_TYPE; unsigned int final_prec = TYPE_PRECISION (type); int final_unsignedp = TYPE_UNSIGNED (type); @@ -6747,7 +6916,7 @@ fold_unary (enum tree_code code, tree type, tree op0) if (TYPE_MAIN_VARIANT (inside_type) == TYPE_MAIN_VARIANT (type) && ((inter_int && final_int) || (inter_float && final_float)) && inter_prec >= final_prec) - return fold (build1 (code, type, TREE_OPERAND (op0, 0))); + return fold_build1 (code, type, TREE_OPERAND (op0, 0)); /* Likewise, if the intermediate and final types are either both float or both integer, we don't need the middle conversion if @@ -6756,23 +6925,27 @@ fold_unary (enum tree_code code, tree type, tree op0) since then we sometimes need the inner conversion. Likewise if the outer has a precision not equal to the size of its mode. */ if ((((inter_int || inter_ptr) && (inside_int || inside_ptr)) - || (inter_float && inside_float)) + || (inter_float && inside_float) + || (inter_vec && inside_vec)) && inter_prec >= inside_prec - && (inter_float || inter_unsignedp == inside_unsignedp) + && (inter_float || inter_vec + || inter_unsignedp == inside_unsignedp) && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) && TYPE_MODE (type) == TYPE_MODE (inter_type)) - && ! final_ptr) - return fold (build1 (code, type, TREE_OPERAND (op0, 0))); + && ! final_ptr + && (! final_vec || inter_prec == inside_prec)) + return fold_build1 (code, type, TREE_OPERAND (op0, 0)); /* If we have a sign-extension of a zero-extended value, we can replace that by a single zero-extension. */ if (inside_int && inter_int && final_int && inside_prec < inter_prec && inter_prec < final_prec && inside_unsignedp && !inter_unsignedp) - return fold (build1 (code, type, TREE_OPERAND (op0, 0))); + return fold_build1 (code, type, TREE_OPERAND (op0, 0)); /* Two conversions in a row are not needed unless: - some conversion is floating-point (overstrict for now), or + - some conversion is a vector (overstrict for now), or - the intermediate type is narrower than both initial and final, or - the intermediate type and innermost type differ in signedness, @@ -6782,6 +6955,7 @@ fold_unary (enum tree_code code, tree type, tree op0) - the final type is a pointer type and the precisions of the initial and intermediate types differ. */ if (! inside_float && ! inter_float && ! final_float + && ! inside_vec && ! inter_vec && ! final_vec && (inter_prec > inside_prec || inter_prec > final_prec) && ! (inside_int && inter_int && inter_unsignedp != inside_unsignedp @@ -6793,7 +6967,7 @@ fold_unary (enum tree_code code, tree type, tree op0) && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) && TYPE_MODE (type) == TYPE_MODE (inter_type)) && ! final_ptr) - return fold (build1 (code, type, TREE_OPERAND (op0, 0))); + return fold_build1 (code, type, TREE_OPERAND (op0, 0)); } if (TREE_CODE (op0) == MODIFY_EXPR @@ -6804,9 +6978,9 @@ fold_unary (enum tree_code code, tree type, tree op0) { /* Don't leave an assignment inside a conversion unless assigning a bitfield. */ - tem = build1 (code, type, TREE_OPERAND (op0, 1)); + tem = fold_build1 (code, type, TREE_OPERAND (op0, 1)); /* First do the assignment, then return converted constant. */ - tem = build2 (COMPOUND_EXPR, TREE_TYPE (tem), op0, fold (tem)); + tem = build2 (COMPOUND_EXPR, TREE_TYPE (tem), op0, tem); TREE_NO_WARNING (tem) = 1; TREE_USED (tem) = 1; return tem; @@ -6856,8 +7030,8 @@ fold_unary (enum tree_code code, tree type, tree op0) TREE_INT_CST_HIGH (and1)); tem = force_fit_type (tem, 0, TREE_OVERFLOW (and1), TREE_CONSTANT_OVERFLOW (and1)); - return fold (build2 (BIT_AND_EXPR, type, - fold_convert (type, and0), tem)); + return fold_build2 (BIT_AND_EXPR, type, + fold_convert (type, and0), tem); } } @@ -6894,24 +7068,24 @@ fold_unary (enum tree_code code, tree type, tree op0) return fold_convert (type, negate_expr (arg0)); /* Convert - (~A) to A + 1. */ if (INTEGRAL_TYPE_P (type) && TREE_CODE (arg0) == BIT_NOT_EXPR) - return fold (build2 (PLUS_EXPR, type, TREE_OPERAND (arg0, 0), - build_int_cst (type, 1))); + return fold_build2 (PLUS_EXPR, type, TREE_OPERAND (arg0, 0), + build_int_cst (type, 1)); return NULL_TREE; case ABS_EXPR: if (TREE_CODE (arg0) == INTEGER_CST || TREE_CODE (arg0) == REAL_CST) return fold_abs_const (arg0, type); else if (TREE_CODE (arg0) == NEGATE_EXPR) - return fold (build1 (ABS_EXPR, type, TREE_OPERAND (arg0, 0))); + return fold_build1 (ABS_EXPR, type, TREE_OPERAND (arg0, 0)); /* Convert fabs((double)float) into (double)fabsf(float). */ else if (TREE_CODE (arg0) == NOP_EXPR && TREE_CODE (type) == REAL_TYPE) { tree targ0 = strip_float_extensions (arg0); if (targ0 != arg0) - return fold_convert (type, fold (build1 (ABS_EXPR, - TREE_TYPE (targ0), - targ0))); + return fold_convert (type, fold_build1 (ABS_EXPR, + TREE_TYPE (targ0), + targ0)); } else if (tree_expr_nonnegative_p (arg0)) return arg0; @@ -6921,7 +7095,7 @@ fold_unary (enum tree_code code, tree type, tree op0) { tem = fold_strip_sign_ops (arg0); if (tem) - return fold (build1 (ABS_EXPR, type, fold_convert (type, tem))); + return fold_build1 (ABS_EXPR, type, fold_convert (type, tem)); } return NULL_TREE; @@ -6936,11 +7110,11 @@ fold_unary (enum tree_code code, tree type, tree op0) return build_complex (type, TREE_REALPART (arg0), negate_expr (TREE_IMAGPART (arg0))); else if (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) - return fold (build2 (TREE_CODE (arg0), type, - fold (build1 (CONJ_EXPR, type, - TREE_OPERAND (arg0, 0))), - fold (build1 (CONJ_EXPR, type, - TREE_OPERAND (arg0, 1))))); + return fold_build2 (TREE_CODE (arg0), type, + fold_build1 (CONJ_EXPR, type, + TREE_OPERAND (arg0, 0)), + fold_build1 (CONJ_EXPR, type, + TREE_OPERAND (arg0, 1))); else if (TREE_CODE (arg0) == CONJ_EXPR) return TREE_OPERAND (arg0, 0); return NULL_TREE; @@ -6952,15 +7126,29 @@ fold_unary (enum tree_code code, tree type, tree op0) return TREE_OPERAND (arg0, 0); /* Convert ~ (-A) to A - 1. */ else if (INTEGRAL_TYPE_P (type) && TREE_CODE (arg0) == NEGATE_EXPR) - return fold (build2 (MINUS_EXPR, type, TREE_OPERAND (arg0, 0), - build_int_cst (type, 1))); + return fold_build2 (MINUS_EXPR, type, TREE_OPERAND (arg0, 0), + build_int_cst (type, 1)); /* Convert ~ (A - 1) or ~ (A + -1) to -A. */ else if (INTEGRAL_TYPE_P (type) && ((TREE_CODE (arg0) == MINUS_EXPR && integer_onep (TREE_OPERAND (arg0, 1))) || (TREE_CODE (arg0) == PLUS_EXPR && integer_all_onesp (TREE_OPERAND (arg0, 1))))) - return fold (build1 (NEGATE_EXPR, type, TREE_OPERAND (arg0, 0))); + return fold_build1 (NEGATE_EXPR, type, TREE_OPERAND (arg0, 0)); + /* Convert ~(X ^ Y) to ~X ^ Y or X ^ ~Y if ~X or ~Y simplify. */ + else if (TREE_CODE (arg0) == BIT_XOR_EXPR + && (tem = fold_unary (BIT_NOT_EXPR, type, + fold_convert (type, + TREE_OPERAND (arg0, 0))))) + return fold_build2 (BIT_XOR_EXPR, type, tem, + fold_convert (type, TREE_OPERAND (arg0, 1))); + else if (TREE_CODE (arg0) == BIT_XOR_EXPR + && (tem = fold_unary (BIT_NOT_EXPR, type, + fold_convert (type, + TREE_OPERAND (arg0, 1))))) + return fold_build2 (BIT_XOR_EXPR, type, + fold_convert (type, TREE_OPERAND (arg0, 0)), tem); + return NULL_TREE; case TRUTH_NOT_EXPR: @@ -6987,11 +7175,11 @@ fold_unary (enum tree_code code, tree type, tree op0) else if (TREE_CODE (arg0) == COMPLEX_CST) return TREE_REALPART (arg0); else if (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) - return fold (build2 (TREE_CODE (arg0), type, - fold (build1 (REALPART_EXPR, type, - TREE_OPERAND (arg0, 0))), - fold (build1 (REALPART_EXPR, type, - TREE_OPERAND (arg0, 1))))); + return fold_build2 (TREE_CODE (arg0), type, + fold_build1 (REALPART_EXPR, type, + TREE_OPERAND (arg0, 0)), + fold_build1 (REALPART_EXPR, type, + TREE_OPERAND (arg0, 1))); return NULL_TREE; case IMAGPART_EXPR: @@ -7003,11 +7191,11 @@ fold_unary (enum tree_code code, tree type, tree op0) else if (TREE_CODE (arg0) == COMPLEX_CST) return TREE_IMAGPART (arg0); else if (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) - return fold (build2 (TREE_CODE (arg0), type, - fold (build1 (IMAGPART_EXPR, type, - TREE_OPERAND (arg0, 0))), - fold (build1 (IMAGPART_EXPR, type, - TREE_OPERAND (arg0, 1))))); + return fold_build2 (TREE_CODE (arg0), type, + fold_build1 (IMAGPART_EXPR, type, + TREE_OPERAND (arg0, 0)), + fold_build1 (IMAGPART_EXPR, type, + TREE_OPERAND (arg0, 1))); return NULL_TREE; default: @@ -7015,11 +7203,11 @@ fold_unary (enum tree_code code, tree type, tree op0) } /* switch (code) */ } -/* Fold a binary expression EXPR. Return the folded expression if - folding is successful. Otherwise, return the original - expression. */ +/* Fold a binary expression of code CODE and type TYPE with operands + OP0 and OP1. Return the folded expression if folding is + successful. Otherwise, return NULL_TREE. */ -static tree +tree fold_binary (enum tree_code code, tree type, tree op0, tree op1) { tree t1 = NULL_TREE; @@ -7107,7 +7295,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) to ARG1 to reduce the number of tests below. */ if (commutative_tree_code (code) && tree_swap_operands_p (arg0, arg1, true)) - return fold (build2 (code, type, op1, op0)); + return fold_build2 (code, type, op1, op0); /* Now WINS is set as described above, ARG0 is the first operand of EXPR, @@ -7138,38 +7326,39 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) || (TREE_CODE (arg0) == BIT_AND_EXPR && integer_onep (TREE_OPERAND (arg0, 1))))))) { - tem = fold (build2 (code == BIT_AND_EXPR ? TRUTH_AND_EXPR - : code == BIT_IOR_EXPR ? TRUTH_OR_EXPR - : TRUTH_XOR_EXPR, - type, fold_convert (boolean_type_node, arg0), - fold_convert (boolean_type_node, arg1))); + tem = fold_build2 (code == BIT_AND_EXPR ? TRUTH_AND_EXPR + : code == BIT_IOR_EXPR ? TRUTH_OR_EXPR + : TRUTH_XOR_EXPR, + boolean_type_node, + fold_convert (boolean_type_node, arg0), + fold_convert (boolean_type_node, arg1)); if (code == EQ_EXPR) tem = invert_truthvalue (tem); - return tem; + return fold_convert (type, tem); } if (TREE_CODE_CLASS (code) == tcc_comparison && TREE_CODE (arg0) == COMPOUND_EXPR) return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), - fold (build2 (code, type, TREE_OPERAND (arg0, 1), arg1))); + fold_build2 (code, type, TREE_OPERAND (arg0, 1), arg1)); else if (TREE_CODE_CLASS (code) == tcc_comparison && TREE_CODE (arg1) == COMPOUND_EXPR) return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0), - fold (build2 (code, type, arg0, TREE_OPERAND (arg1, 1)))); + fold_build2 (code, type, arg0, TREE_OPERAND (arg1, 1))); else if (TREE_CODE_CLASS (code) == tcc_binary || TREE_CODE_CLASS (code) == tcc_comparison) { if (TREE_CODE (arg0) == COMPOUND_EXPR) return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg0, 0), - fold (build2 (code, type, TREE_OPERAND (arg0, 1), - arg1))); + fold_build2 (code, type, TREE_OPERAND (arg0, 1), + arg1)); if (TREE_CODE (arg1) == COMPOUND_EXPR && reorder_operands_p (arg0, TREE_OPERAND (arg1, 0))) return build2 (COMPOUND_EXPR, type, TREE_OPERAND (arg1, 0), - fold (build2 (code, type, - arg0, TREE_OPERAND (arg1, 1)))); + fold_build2 (code, type, + arg0, TREE_OPERAND (arg1, 1))); if (TREE_CODE (arg0) == COND_EXPR || COMPARISON_CLASS_P (arg0)) { @@ -7195,16 +7384,20 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) case PLUS_EXPR: /* A + (-B) -> A - B */ if (TREE_CODE (arg1) == NEGATE_EXPR) - return fold (build2 (MINUS_EXPR, type, arg0, TREE_OPERAND (arg1, 0))); + return fold_build2 (MINUS_EXPR, type, + fold_convert (type, arg0), + fold_convert (type, TREE_OPERAND (arg1, 0))); /* (-A) + B -> B - A */ if (TREE_CODE (arg0) == NEGATE_EXPR && reorder_operands_p (TREE_OPERAND (arg0, 0), arg1)) - return fold (build2 (MINUS_EXPR, type, arg1, TREE_OPERAND (arg0, 0))); + return fold_build2 (MINUS_EXPR, type, + fold_convert (type, arg1), + fold_convert (type, TREE_OPERAND (arg0, 0))); /* Convert ~A + 1 to -A. */ if (INTEGRAL_TYPE_P (type) && TREE_CODE (arg0) == BIT_NOT_EXPR && integer_onep (arg1)) - return fold (build1 (NEGATE_EXPR, type, TREE_OPERAND (arg0, 0))); + return fold_build1 (NEGATE_EXPR, type, TREE_OPERAND (arg0, 0)); if (TREE_CODE (type) == COMPLEX_TYPE) { @@ -7259,19 +7452,19 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (TREE_CODE (parg0) == MULT_EXPR && TREE_CODE (parg1) != MULT_EXPR) - return fold (build2 (pcode, type, - fold (build2 (PLUS_EXPR, type, - fold_convert (type, parg0), - fold_convert (type, marg))), - fold_convert (type, parg1))); + return fold_build2 (pcode, type, + fold_build2 (PLUS_EXPR, type, + fold_convert (type, parg0), + fold_convert (type, marg)), + fold_convert (type, parg1)); if (TREE_CODE (parg0) != MULT_EXPR && TREE_CODE (parg1) == MULT_EXPR) - return fold (build2 (PLUS_EXPR, type, - fold_convert (type, parg0), - fold (build2 (pcode, type, - fold_convert (type, marg), - fold_convert (type, - parg1))))); + return fold_build2 (PLUS_EXPR, type, + fold_convert (type, parg0), + fold_build2 (pcode, type, + fold_convert (type, marg), + fold_convert (type, + parg1))); } if (TREE_CODE (arg0) == MULT_EXPR && TREE_CODE (arg1) == MULT_EXPR) @@ -7322,34 +7515,32 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (exact_log2 (int11) > 0 && int01 % int11 == 0) { - alt0 = fold (build2 (MULT_EXPR, type, arg00, - build_int_cst (NULL_TREE, - int01 / int11))); + alt0 = fold_build2 (MULT_EXPR, type, arg00, + build_int_cst (NULL_TREE, + int01 / int11)); alt1 = arg10; same = arg11; } } if (same) - return fold (build2 (MULT_EXPR, type, - fold (build2 (PLUS_EXPR, type, - fold_convert (type, alt0), - fold_convert (type, alt1))), - same)); + return fold_build2 (MULT_EXPR, type, + fold_build2 (PLUS_EXPR, type, + fold_convert (type, alt0), + fold_convert (type, alt1)), + fold_convert (type, same)); } /* Try replacing &a[i1] + c * i2 with &a[i1 + i2], if c is step of the array. Loop optimizer sometimes produce this type of expressions. */ - if (TREE_CODE (arg0) == ADDR_EXPR - && TREE_CODE (arg1) == MULT_EXPR) + if (TREE_CODE (arg0) == ADDR_EXPR) { tem = try_move_mult_to_index (PLUS_EXPR, arg0, arg1); if (tem) return fold_convert (type, fold (tem)); } - else if (TREE_CODE (arg1) == ADDR_EXPR - && TREE_CODE (arg0) == MULT_EXPR) + else if (TREE_CODE (arg1) == ADDR_EXPR) { tem = try_move_mult_to_index (PLUS_EXPR, arg1, arg0); if (tem) @@ -7372,16 +7563,22 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { tem = fold_negate_const (arg1, type); if (!TREE_OVERFLOW (arg1) || !flag_trapping_math) - return fold (build2 (MINUS_EXPR, type, - fold_convert (type, arg0), - fold_convert (type, tem))); + return fold_build2 (MINUS_EXPR, type, + fold_convert (type, arg0), + fold_convert (type, tem)); } + if (flag_unsafe_math_optimizations + && (TREE_CODE (arg0) == RDIV_EXPR || TREE_CODE (arg0) == MULT_EXPR) + && (TREE_CODE (arg1) == RDIV_EXPR || TREE_CODE (arg1) == MULT_EXPR) + && (tem = distribute_real_division (code, type, arg0, arg1))) + return tem; + /* Convert x+x into x*2.0. */ if (operand_equal_p (arg0, arg1, 0) && SCALAR_FLOAT_TYPE_P (type)) - return fold (build2 (MULT_EXPR, type, arg0, - build_real (type, dconst2))); + return fold_build2 (MULT_EXPR, type, arg0, + build_real (type, dconst2)); /* Convert x*c+x into x*(c+1). */ if (flag_unsafe_math_optimizations @@ -7394,8 +7591,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) c = TREE_REAL_CST (TREE_OPERAND (arg0, 1)); real_arithmetic (&c, PLUS_EXPR, &c, &dconst1); - return fold (build2 (MULT_EXPR, type, arg1, - build_real (type, c))); + return fold_build2 (MULT_EXPR, type, arg1, + build_real (type, c)); } /* Convert x+x*c into x*(c+1). */ @@ -7409,8 +7606,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) c = TREE_REAL_CST (TREE_OPERAND (arg1, 1)); real_arithmetic (&c, PLUS_EXPR, &c, &dconst1); - return fold (build2 (MULT_EXPR, type, arg0, - build_real (type, c))); + return fold_build2 (MULT_EXPR, type, arg0, + build_real (type, c)); } /* Convert x*c1+x*c2 into x*(c1+c2). */ @@ -7429,9 +7626,9 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) c1 = TREE_REAL_CST (TREE_OPERAND (arg0, 1)); c2 = TREE_REAL_CST (TREE_OPERAND (arg1, 1)); real_arithmetic (&c1, PLUS_EXPR, &c1, &c2); - return fold (build2 (MULT_EXPR, type, - TREE_OPERAND (arg0, 0), - build_real (type, c1))); + return fold_build2 (MULT_EXPR, type, + TREE_OPERAND (arg0, 0), + build_real (type, c1)); } /* Convert a + (b*c + d*e) into (a + b*c) + d*e. */ if (flag_unsafe_math_optimizations @@ -7444,8 +7641,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && TREE_CODE (tree10) == MULT_EXPR) { tree tree0; - tree0 = fold (build2 (PLUS_EXPR, type, arg0, tree10)); - return fold (build2 (PLUS_EXPR, type, tree0, tree11)); + tree0 = fold_build2 (PLUS_EXPR, type, arg0, tree10); + return fold_build2 (PLUS_EXPR, type, tree0, tree11); } } /* Convert (b*c + d*e) + a into b*c + (d*e +a). */ @@ -7459,8 +7656,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && TREE_CODE (tree00) == MULT_EXPR) { tree tree0; - tree0 = fold (build2 (PLUS_EXPR, type, tree01, arg1)); - return fold (build2 (PLUS_EXPR, type, tree00, tree0)); + tree0 = fold_build2 (PLUS_EXPR, type, tree01, arg1); + return fold_build2 (PLUS_EXPR, type, tree00, tree0); } } } @@ -7634,25 +7831,25 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) case MINUS_EXPR: /* A - (-B) -> A + B */ if (TREE_CODE (arg1) == NEGATE_EXPR) - return fold (build2 (PLUS_EXPR, type, arg0, TREE_OPERAND (arg1, 0))); + return fold_build2 (PLUS_EXPR, type, arg0, TREE_OPERAND (arg1, 0)); /* (-A) - B -> (-B) - A where B is easily negated and we can swap. */ if (TREE_CODE (arg0) == NEGATE_EXPR && (FLOAT_TYPE_P (type) || (INTEGRAL_TYPE_P (type) && flag_wrapv && !flag_trapv)) && negate_expr_p (arg1) && reorder_operands_p (arg0, arg1)) - return fold (build2 (MINUS_EXPR, type, negate_expr (arg1), - TREE_OPERAND (arg0, 0))); + return fold_build2 (MINUS_EXPR, type, negate_expr (arg1), + TREE_OPERAND (arg0, 0)); /* Convert -A - 1 to ~A. */ if (INTEGRAL_TYPE_P (type) && TREE_CODE (arg0) == NEGATE_EXPR && integer_onep (arg1)) - return fold (build1 (BIT_NOT_EXPR, type, TREE_OPERAND (arg0, 0))); + return fold_build1 (BIT_NOT_EXPR, type, TREE_OPERAND (arg0, 0)); /* Convert -1 - A to ~A. */ if (INTEGRAL_TYPE_P (type) && integer_all_onesp (arg0)) - return fold (build1 (BIT_NOT_EXPR, type, arg1)); + return fold_build1 (BIT_NOT_EXPR, type, arg1); if (TREE_CODE (type) == COMPLEX_TYPE) { @@ -7673,15 +7870,15 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && TREE_CODE (arg1) == BIT_AND_EXPR) { if (operand_equal_p (arg0, TREE_OPERAND (arg1, 1), 0)) - return fold (build2 (BIT_AND_EXPR, type, - fold (build1 (BIT_NOT_EXPR, type, - TREE_OPERAND (arg1, 0))), - arg0)); + return fold_build2 (BIT_AND_EXPR, type, + fold_build1 (BIT_NOT_EXPR, type, + TREE_OPERAND (arg1, 0)), + arg0); if (operand_equal_p (arg0, TREE_OPERAND (arg1, 0), 0)) - return fold (build2 (BIT_AND_EXPR, type, - fold (build1 (BIT_NOT_EXPR, type, - TREE_OPERAND (arg1, 1))), - arg0)); + return fold_build2 (BIT_AND_EXPR, type, + fold_build1 (BIT_NOT_EXPR, type, + TREE_OPERAND (arg1, 1)), + arg0); } /* Fold (A & ~B) - (A & B) into (A ^ B) - B, where B is @@ -7693,13 +7890,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { tree mask0 = TREE_OPERAND (arg0, 1); tree mask1 = TREE_OPERAND (arg1, 1); - tree tem = fold (build1 (BIT_NOT_EXPR, type, mask0)); + tree tem = fold_build1 (BIT_NOT_EXPR, type, mask0); if (operand_equal_p (tem, mask1, 0)) { - tem = fold (build2 (BIT_XOR_EXPR, type, - TREE_OPERAND (arg0, 0), mask1)); - return fold (build2 (MINUS_EXPR, type, tem, mask1)); + tem = fold_build2 (BIT_XOR_EXPR, type, + TREE_OPERAND (arg0, 0), mask1); + return fold_build2 (MINUS_EXPR, type, tem, mask1); } } } @@ -7731,7 +7928,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && (TREE_CODE (arg1) != REAL_CST || REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg1)))) || (INTEGRAL_TYPE_P (type) && flag_wrapv && !flag_trapv))) - return fold (build2 (PLUS_EXPR, type, arg0, negate_expr (arg1))); + return fold_build2 (PLUS_EXPR, type, arg0, negate_expr (arg1)); /* Try folding difference of addresses. */ { @@ -7742,18 +7939,44 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && ptr_difference_const (arg0, arg1, &diff)) return build_int_cst_type (type, diff); } - + + /* Fold &a[i] - &a[j] to i-j. */ + if (TREE_CODE (arg0) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg0, 0)) == ARRAY_REF + && TREE_CODE (arg1) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg1, 0)) == ARRAY_REF) + { + tree aref0 = TREE_OPERAND (arg0, 0); + tree aref1 = TREE_OPERAND (arg1, 0); + if (operand_equal_p (TREE_OPERAND (aref0, 0), + TREE_OPERAND (aref1, 0), 0)) + { + tree op0 = fold_convert (type, TREE_OPERAND (aref0, 1)); + tree op1 = fold_convert (type, TREE_OPERAND (aref1, 1)); + tree esz = array_ref_element_size (aref0); + tree diff = build2 (MINUS_EXPR, type, op0, op1); + return fold_build2 (MULT_EXPR, type, diff, + fold_convert (type, esz)); + + } + } + /* Try replacing &a[i1] - c * i2 with &a[i1 - i2], if c is step of the array. Loop optimizer sometimes produce this type of expressions. */ - if (TREE_CODE (arg0) == ADDR_EXPR - && TREE_CODE (arg1) == MULT_EXPR) + if (TREE_CODE (arg0) == ADDR_EXPR) { tem = try_move_mult_to_index (MINUS_EXPR, arg0, arg1); if (tem) return fold_convert (type, fold (tem)); } + if (flag_unsafe_math_optimizations + && (TREE_CODE (arg0) == RDIV_EXPR || TREE_CODE (arg0) == MULT_EXPR) + && (TREE_CODE (arg1) == RDIV_EXPR || TREE_CODE (arg1) == MULT_EXPR) + && (tem = distribute_real_division (code, type, arg0, arg1))) + return tem; + if (TREE_CODE (arg0) == MULT_EXPR && TREE_CODE (arg1) == MULT_EXPR && (!FLOAT_TYPE_P (type) || flag_unsafe_math_optimizations)) @@ -7761,19 +7984,19 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* (A * C) - (B * C) -> (A-B) * C. */ if (operand_equal_p (TREE_OPERAND (arg0, 1), TREE_OPERAND (arg1, 1), 0)) - return fold (build2 (MULT_EXPR, type, - fold (build2 (MINUS_EXPR, type, - TREE_OPERAND (arg0, 0), - TREE_OPERAND (arg1, 0))), - TREE_OPERAND (arg0, 1))); + return fold_build2 (MULT_EXPR, type, + fold_build2 (MINUS_EXPR, type, + TREE_OPERAND (arg0, 0), + TREE_OPERAND (arg1, 0)), + TREE_OPERAND (arg0, 1)); /* (A * C1) - (A * C2) -> A * (C1-C2). */ if (operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1, 0), 0)) - return fold (build2 (MULT_EXPR, type, - TREE_OPERAND (arg0, 0), - fold (build2 (MINUS_EXPR, type, - TREE_OPERAND (arg0, 1), - TREE_OPERAND (arg1, 1))))); + return fold_build2 (MULT_EXPR, type, + TREE_OPERAND (arg0, 0), + fold_build2 (MINUS_EXPR, type, + TREE_OPERAND (arg0, 1), + TREE_OPERAND (arg1, 1))); } goto associate; @@ -7781,13 +8004,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) case MULT_EXPR: /* (-A) * (-B) -> A * B */ if (TREE_CODE (arg0) == NEGATE_EXPR && negate_expr_p (arg1)) - return fold (build2 (MULT_EXPR, type, - TREE_OPERAND (arg0, 0), - negate_expr (arg1))); + return fold_build2 (MULT_EXPR, type, + TREE_OPERAND (arg0, 0), + negate_expr (arg1)); if (TREE_CODE (arg1) == NEGATE_EXPR && negate_expr_p (arg0)) - return fold (build2 (MULT_EXPR, type, - negate_expr (arg0), - TREE_OPERAND (arg1, 0))); + return fold_build2 (MULT_EXPR, type, + negate_expr (arg0), + TREE_OPERAND (arg1, 0)); if (TREE_CODE (type) == COMPLEX_TYPE) { @@ -7809,12 +8032,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* (a * (1 << b)) is (a << b) */ if (TREE_CODE (arg1) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg1, 0))) - return fold (build2 (LSHIFT_EXPR, type, arg0, - TREE_OPERAND (arg1, 1))); + return fold_build2 (LSHIFT_EXPR, type, arg0, + TREE_OPERAND (arg1, 1)); if (TREE_CODE (arg0) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg0, 0))) - return fold (build2 (LSHIFT_EXPR, type, arg1, - TREE_OPERAND (arg0, 1))); + return fold_build2 (LSHIFT_EXPR, type, arg1, + TREE_OPERAND (arg0, 1)); if (TREE_CODE (arg1) == INTEGER_CST && 0 != (tem = extract_muldiv (op0, @@ -7852,8 +8075,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) tree tem = const_binop (MULT_EXPR, TREE_OPERAND (arg0, 0), arg1, 0); if (tem) - return fold (build2 (RDIV_EXPR, type, tem, - TREE_OPERAND (arg0, 1))); + return fold_build2 (RDIV_EXPR, type, tem, + TREE_OPERAND (arg0, 1)); } /* Strip sign operations from X in X*X, i.e. -Y*-Y -> Y*Y. */ @@ -7863,7 +8086,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (tem != NULL_TREE) { tem = fold_convert (type, tem); - return fold (build2 (MULT_EXPR, type, tem, tem)); + return fold_build2 (MULT_EXPR, type, tem, tem); } } @@ -7887,7 +8110,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* Optimize root(x)*root(y) as root(x*y). */ rootfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0); - arg = fold (build2 (MULT_EXPR, type, arg00, arg10)); + arg = fold_build2 (MULT_EXPR, type, arg00, arg10); arglist = build_tree_list (NULL_TREE, arg); return build_function_call_expr (rootfn, arglist); } @@ -7896,10 +8119,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (fcode0 == fcode1 && BUILTIN_EXPONENT_P (fcode0)) { tree expfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0); - tree arg = build2 (PLUS_EXPR, type, - TREE_VALUE (TREE_OPERAND (arg0, 1)), - TREE_VALUE (TREE_OPERAND (arg1, 1))); - tree arglist = build_tree_list (NULL_TREE, fold (arg)); + tree arg = fold_build2 (PLUS_EXPR, type, + TREE_VALUE (TREE_OPERAND (arg0, 1)), + TREE_VALUE (TREE_OPERAND (arg1, 1))); + tree arglist = build_tree_list (NULL_TREE, arg); return build_function_call_expr (expfn, arglist); } @@ -7919,8 +8142,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (operand_equal_p (arg01, arg11, 0)) { tree powfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0); - tree arg = build2 (MULT_EXPR, type, arg00, arg10); - tree arglist = tree_cons (NULL_TREE, fold (arg), + tree arg = fold_build2 (MULT_EXPR, type, arg00, arg10); + tree arglist = tree_cons (NULL_TREE, arg, build_tree_list (NULL_TREE, arg01)); return build_function_call_expr (powfn, arglist); @@ -7930,7 +8153,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (operand_equal_p (arg00, arg10, 0)) { tree powfn = TREE_OPERAND (TREE_OPERAND (arg0, 0), 0); - tree arg = fold (build2 (PLUS_EXPR, type, arg01, arg11)); + tree arg = fold_build2 (PLUS_EXPR, type, arg01, arg11); tree arglist = tree_cons (NULL_TREE, arg00, build_tree_list (NULL_TREE, arg)); @@ -8063,10 +8286,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (TREE_CODE (arg0) == BIT_NOT_EXPR && TREE_CODE (arg1) == BIT_NOT_EXPR) { - return fold (build1 (BIT_NOT_EXPR, type, - build2 (BIT_AND_EXPR, type, - TREE_OPERAND (arg0, 0), - TREE_OPERAND (arg1, 0)))); + return fold_build1 (BIT_NOT_EXPR, type, + build2 (BIT_AND_EXPR, type, + TREE_OPERAND (arg0, 0), + TREE_OPERAND (arg1, 0))); } /* See if this can be simplified into a rotate first. If that @@ -8077,7 +8300,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (integer_zerop (arg1)) return non_lvalue (fold_convert (type, arg0)); if (integer_all_onesp (arg1)) - return fold (build1 (BIT_NOT_EXPR, type, arg0)); + return fold_build1 (BIT_NOT_EXPR, type, arg0); if (operand_equal_p (arg0, arg1, 0)) return omit_one_operand (type, integer_zero_node, arg0); @@ -8115,6 +8338,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) goto bit_ior; } + /* Convert ~X ^ ~Y to X ^ Y. */ + if (TREE_CODE (arg0) == BIT_NOT_EXPR + && TREE_CODE (arg1) == BIT_NOT_EXPR) + return fold_build2 (code, type, + fold_convert (type, TREE_OPERAND (arg0, 0)), + fold_convert (type, TREE_OPERAND (arg1, 0))); + /* See if this can be simplified into a rotate first. If that is unsuccessful continue in the association code. */ goto bit_rotate; @@ -8162,10 +8392,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (TREE_CODE (arg0) == BIT_NOT_EXPR && TREE_CODE (arg1) == BIT_NOT_EXPR) { - return fold (build1 (BIT_NOT_EXPR, type, - build2 (BIT_IOR_EXPR, type, - TREE_OPERAND (arg0, 0), - TREE_OPERAND (arg1, 0)))); + return fold_build1 (BIT_NOT_EXPR, type, + build2 (BIT_IOR_EXPR, type, + TREE_OPERAND (arg0, 0), + TREE_OPERAND (arg1, 0))); } goto associate; @@ -8180,13 +8410,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* (-A) / (-B) -> A / B */ if (TREE_CODE (arg0) == NEGATE_EXPR && negate_expr_p (arg1)) - return fold (build2 (RDIV_EXPR, type, - TREE_OPERAND (arg0, 0), - negate_expr (arg1))); + return fold_build2 (RDIV_EXPR, type, + TREE_OPERAND (arg0, 0), + negate_expr (arg1)); if (TREE_CODE (arg1) == NEGATE_EXPR && negate_expr_p (arg0)) - return fold (build2 (RDIV_EXPR, type, - negate_expr (arg0), - TREE_OPERAND (arg1, 0))); + return fold_build2 (RDIV_EXPR, type, + negate_expr (arg0), + TREE_OPERAND (arg1, 0)); /* In IEEE floating point, x/1 is not equivalent to x for snans. */ if (!HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg0))) @@ -8208,7 +8438,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (flag_unsafe_math_optimizations && 0 != (tem = const_binop (code, build_real (type, dconst1), arg1, 0))) - return fold (build2 (MULT_EXPR, type, arg0, tem)); + return fold_build2 (MULT_EXPR, type, arg0, tem); /* Find the reciprocal if optimizing and the result is exact. */ if (optimize) { @@ -8217,24 +8447,24 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (exact_real_inverse (TYPE_MODE(TREE_TYPE(arg0)), &r)) { tem = build_real (type, r); - return fold (build2 (MULT_EXPR, type, arg0, tem)); + return fold_build2 (MULT_EXPR, type, arg0, tem); } } } /* Convert A/B/C to A/(B*C). */ if (flag_unsafe_math_optimizations && TREE_CODE (arg0) == RDIV_EXPR) - return fold (build2 (RDIV_EXPR, type, TREE_OPERAND (arg0, 0), - fold (build2 (MULT_EXPR, type, - TREE_OPERAND (arg0, 1), arg1)))); + return fold_build2 (RDIV_EXPR, type, TREE_OPERAND (arg0, 0), + fold_build2 (MULT_EXPR, type, + TREE_OPERAND (arg0, 1), arg1)); /* Convert A/(B/C) to (A/B)*C. */ if (flag_unsafe_math_optimizations && TREE_CODE (arg1) == RDIV_EXPR) - return fold (build2 (MULT_EXPR, type, - fold (build2 (RDIV_EXPR, type, arg0, - TREE_OPERAND (arg1, 0))), - TREE_OPERAND (arg1, 1))); + return fold_build2 (MULT_EXPR, type, + fold_build2 (RDIV_EXPR, type, arg0, + TREE_OPERAND (arg1, 0)), + TREE_OPERAND (arg1, 1)); /* Convert C1/(X*C2) into (C1/C2)/X. */ if (flag_unsafe_math_optimizations @@ -8245,8 +8475,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) tree tem = const_binop (RDIV_EXPR, arg0, TREE_OPERAND (arg1, 1), 0); if (tem) - return fold (build2 (RDIV_EXPR, type, tem, - TREE_OPERAND (arg1, 0))); + return fold_build2 (RDIV_EXPR, type, tem, + TREE_OPERAND (arg1, 0)); } if (TREE_CODE (type) == COMPLEX_TYPE) @@ -8267,7 +8497,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) tree arglist = build_tree_list (NULL_TREE, fold_convert (type, arg)); arg1 = build_function_call_expr (expfn, arglist); - return fold (build2 (MULT_EXPR, type, arg0, arg1)); + return fold_build2 (MULT_EXPR, type, arg0, arg1); } /* Optimize x/pow(y,z) into x*pow(y,-z). */ @@ -8282,7 +8512,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) tree arglist = tree_cons(NULL_TREE, arg10, build_tree_list (NULL_TREE, neg11)); arg1 = build_function_call_expr (powfn, arglist); - return fold (build2 (MULT_EXPR, type, arg0, arg1)); + return fold_build2 (MULT_EXPR, type, arg0, arg1); } } @@ -8318,8 +8548,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { tree tmp = TREE_OPERAND (arg0, 1); tmp = build_function_call_expr (tanfn, tmp); - return fold (build2 (RDIV_EXPR, type, - build_real (type, dconst1), tmp)); + return fold_build2 (RDIV_EXPR, type, + build_real (type, dconst1), tmp); } } @@ -8373,7 +8603,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) after the last round to changes to the DIV code in expmed.c. */ if ((code == CEIL_DIV_EXPR || code == FLOOR_DIV_EXPR) && multiple_of_p (type, arg0, arg1)) - return fold (build2 (EXACT_DIV_EXPR, type, arg0, arg1)); + return fold_build2 (EXACT_DIV_EXPR, type, arg0, arg1); if (TREE_CODE (arg1) == INTEGER_CST && 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE))) @@ -8437,28 +8667,29 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) } mask = build_int_cst_wide (type, low, high); - return fold (build2 (BIT_AND_EXPR, type, - fold_convert (type, arg0), mask)); + return fold_build2 (BIT_AND_EXPR, type, + fold_convert (type, arg0), mask); } /* X % -C is the same as X % C. */ if (code == TRUNC_MOD_EXPR && !TYPE_UNSIGNED (type) && TREE_CODE (arg1) == INTEGER_CST + && !TREE_CONSTANT_OVERFLOW (arg1) && TREE_INT_CST_HIGH (arg1) < 0 && !flag_trapv /* Avoid this transformation if C is INT_MIN, i.e. C == -C. */ && !sign_bit_p (arg1, arg1)) - return fold (build2 (code, type, fold_convert (type, arg0), - fold_convert (type, negate_expr (arg1)))); + return fold_build2 (code, type, fold_convert (type, arg0), + fold_convert (type, negate_expr (arg1))); /* X % -Y is the same as X % Y. */ if (code == TRUNC_MOD_EXPR && !TYPE_UNSIGNED (type) && TREE_CODE (arg1) == NEGATE_EXPR && !flag_trapv) - return fold (build2 (code, type, fold_convert (type, arg0), - fold_convert (type, TREE_OPERAND (arg1, 0)))); + return fold_build2 (code, type, fold_convert (type, arg0), + fold_convert (type, TREE_OPERAND (arg1, 0))); if (TREE_CODE (arg1) == INTEGER_CST && 0 != (tem = extract_muldiv (op0, arg1, code, NULL_TREE))) @@ -8497,7 +8728,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) GET_MODE_BITSIZE (TYPE_MODE (type))); tem = fold_convert (TREE_TYPE (arg1), tem); tem = const_binop (MINUS_EXPR, tem, arg1, 0); - return fold (build2 (RROTATE_EXPR, type, arg0, tem)); + return fold_build2 (RROTATE_EXPR, type, arg0, tem); } /* If we have a rotate of a bit operation with the rotate count and @@ -8508,11 +8739,11 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) || TREE_CODE (arg0) == BIT_IOR_EXPR || TREE_CODE (arg0) == BIT_XOR_EXPR) && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST) - return fold (build2 (TREE_CODE (arg0), type, - fold (build2 (code, type, - TREE_OPERAND (arg0, 0), arg1)), - fold (build2 (code, type, - TREE_OPERAND (arg0, 1), arg1)))); + return fold_build2 (TREE_CODE (arg0), type, + fold_build2 (code, type, + TREE_OPERAND (arg0, 0), arg1), + fold_build2 (code, type, + TREE_OPERAND (arg0, 1), arg1)); /* Two consecutive rotates adding up to the width of the mode can be ignored. */ @@ -8587,11 +8818,11 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { tem = fold_to_nonsharp_ineq_using_bound (arg0, arg1); if (tem) - return fold (build2 (code, type, tem, arg1)); + return fold_build2 (code, type, tem, arg1); tem = fold_to_nonsharp_ineq_using_bound (arg1, arg0); if (tem) - return fold (build2 (code, type, arg0, tem)); + return fold_build2 (code, type, arg0, tem); } truth_andor: @@ -8622,23 +8853,23 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) || code == TRUTH_OR_EXPR)); if (operand_equal_p (a00, a10, 0)) - return fold (build2 (TREE_CODE (arg0), type, a00, - fold (build2 (code, type, a01, a11)))); + return fold_build2 (TREE_CODE (arg0), type, a00, + fold_build2 (code, type, a01, a11)); else if (commutative && operand_equal_p (a00, a11, 0)) - return fold (build2 (TREE_CODE (arg0), type, a00, - fold (build2 (code, type, a01, a10)))); + return fold_build2 (TREE_CODE (arg0), type, a00, + fold_build2 (code, type, a01, a10)); else if (commutative && operand_equal_p (a01, a10, 0)) - return fold (build2 (TREE_CODE (arg0), type, a01, - fold (build2 (code, type, a00, a11)))); + return fold_build2 (TREE_CODE (arg0), type, a01, + fold_build2 (code, type, a00, a11)); /* This case if tricky because we must either have commutative operators or else A10 must not have side-effects. */ else if ((commutative || ! TREE_SIDE_EFFECTS (a10)) && operand_equal_p (a01, a11, 0)) - return fold (build2 (TREE_CODE (arg0), type, - fold (build2 (code, type, a00, a10)), - a01)); + return fold_build2 (TREE_CODE (arg0), type, + fold_build2 (code, type, a00, a10), + a01); } /* See if we can build a range comparison. */ @@ -8651,7 +8882,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (TREE_CODE (arg0) == code && 0 != (tem = fold_truthop (code, type, TREE_OPERAND (arg0, 1), arg1))) - return fold (build2 (code, type, TREE_OPERAND (arg0, 0), tem)); + return fold_build2 (code, type, TREE_OPERAND (arg0, 0), tem); if ((tem = fold_truthop (code, type, arg0, arg1)) != 0) return tem; @@ -8699,7 +8930,14 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return non_lvalue (fold_convert (type, arg0)); /* If the second arg is constant true, this is a logical inversion. */ if (integer_onep (arg1)) - return non_lvalue (fold_convert (type, invert_truthvalue (arg0))); + { + /* Only call invert_truthvalue if operand is a truth value. */ + if (TREE_CODE (TREE_TYPE (arg0)) != BOOLEAN_TYPE) + tem = fold_build1 (TRUTH_NOT_EXPR, TREE_TYPE (arg0), arg0); + else + tem = invert_truthvalue (arg0); + return non_lvalue (fold_convert (type, tem)); + } /* Identical arguments cancel to zero. */ if (operand_equal_p (arg0, arg1, 0)) return omit_one_operand (type, integer_zero_node, arg0); @@ -8721,10 +8959,20 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) case LT_EXPR: case GT_EXPR: case LE_EXPR: - case GE_EXPR: + case GE_EXPR: /* If one arg is a real or integer constant, put it last. */ if (tree_swap_operands_p (arg0, arg1, true)) - return fold (build2 (swap_tree_comparison (code), type, arg1, arg0)); + return fold_build2 (swap_tree_comparison (code), type, op1, op0); + + /* bool_var != 0 becomes bool_var. */ + if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_zerop (arg1) + && code == NE_EXPR) + return non_lvalue (fold_convert (type, arg0)); + + /* bool_var == 1 becomes bool_var. */ + if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_onep (arg1) + && code == EQ_EXPR) + return non_lvalue (fold_convert (type, arg0)); /* If this is an equality comparison of the address of a non-weak object against zero, then we know the result. */ @@ -8778,7 +9026,78 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) offset1 = build_int_cst (TREE_TYPE (offset0), 0); if (TREE_TYPE (offset0) == TREE_TYPE (offset1)) - return fold (build2 (code, type, offset0, offset1)); + return fold_build2 (code, type, offset0, offset1); + } + } + + /* Transform comparisons of the form X +- C CMP X. */ + if ((code != EQ_EXPR && code != NE_EXPR) + && (TREE_CODE (arg0) == PLUS_EXPR || TREE_CODE (arg0) == MINUS_EXPR) + && operand_equal_p (TREE_OPERAND (arg0, 0), arg1, 0) + && ((TREE_CODE (TREE_OPERAND (arg0, 1)) == REAL_CST + && !HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg0)))) + || (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST + && !TYPE_UNSIGNED (TREE_TYPE (arg1)) + && !(flag_wrapv || flag_trapv)))) + { + tree arg01 = TREE_OPERAND (arg0, 1); + enum tree_code code0 = TREE_CODE (arg0); + int is_positive; + + if (TREE_CODE (arg01) == REAL_CST) + is_positive = REAL_VALUE_NEGATIVE (TREE_REAL_CST (arg01)) ? -1 : 1; + else + is_positive = tree_int_cst_sgn (arg01); + + /* (X - c) > X becomes false. */ + if (code == GT_EXPR + && ((code0 == MINUS_EXPR && is_positive >= 0) + || (code0 == PLUS_EXPR && is_positive <= 0))) + return constant_boolean_node (0, type); + + /* Likewise (X + c) < X becomes false. */ + if (code == LT_EXPR + && ((code0 == PLUS_EXPR && is_positive >= 0) + || (code0 == MINUS_EXPR && is_positive <= 0))) + return constant_boolean_node (0, type); + + /* Convert (X - c) <= X to true. */ + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg1))) + && code == LE_EXPR + && ((code0 == MINUS_EXPR && is_positive >= 0) + || (code0 == PLUS_EXPR && is_positive <= 0))) + return constant_boolean_node (1, type); + + /* Convert (X + c) >= X to true. */ + if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (arg1))) + && code == GE_EXPR + && ((code0 == PLUS_EXPR && is_positive >= 0) + || (code0 == MINUS_EXPR && is_positive <= 0))) + return constant_boolean_node (1, type); + + if (TREE_CODE (arg01) == INTEGER_CST) + { + /* Convert X + c > X and X - c < X to true for integers. */ + if (code == GT_EXPR + && ((code0 == PLUS_EXPR && is_positive > 0) + || (code0 == MINUS_EXPR && is_positive < 0))) + return constant_boolean_node (1, type); + + if (code == LT_EXPR + && ((code0 == MINUS_EXPR && is_positive > 0) + || (code0 == PLUS_EXPR && is_positive < 0))) + return constant_boolean_node (1, type); + + /* Convert X + c <= X and X - c >= X to false for integers. */ + if (code == LE_EXPR + && ((code0 == PLUS_EXPR && is_positive > 0) + || (code0 == MINUS_EXPR && is_positive < 0))) + return constant_boolean_node (0, type); + + if (code == GE_EXPR + && ((code0 == MINUS_EXPR && is_positive > 0) + || (code0 == PLUS_EXPR && is_positive < 0))) + return constant_boolean_node (0, type); } } @@ -8793,14 +9112,14 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* Fold (double)float1 CMP (double)float2 into float1 CMP float2. */ if (TYPE_PRECISION (newtype) < TYPE_PRECISION (TREE_TYPE (arg0))) - return fold (build2 (code, type, fold_convert (newtype, targ0), - fold_convert (newtype, targ1))); + return fold_build2 (code, type, fold_convert (newtype, targ0), + fold_convert (newtype, targ1)); /* (-a) CMP (-b) -> b CMP a */ if (TREE_CODE (arg0) == NEGATE_EXPR && TREE_CODE (arg1) == NEGATE_EXPR) - return fold (build2 (code, type, TREE_OPERAND (arg1, 0), - TREE_OPERAND (arg0, 0))); + return fold_build2 (code, type, TREE_OPERAND (arg1, 0), + TREE_OPERAND (arg0, 0)); if (TREE_CODE (arg1) == REAL_CST) { @@ -8810,16 +9129,16 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* (-a) CMP CST -> a swap(CMP) (-CST) */ if (TREE_CODE (arg0) == NEGATE_EXPR) return - fold (build2 (swap_tree_comparison (code), type, - TREE_OPERAND (arg0, 0), - build_real (TREE_TYPE (arg1), - REAL_VALUE_NEGATE (cst)))); + fold_build2 (swap_tree_comparison (code), type, + TREE_OPERAND (arg0, 0), + build_real (TREE_TYPE (arg1), + REAL_VALUE_NEGATE (cst))); /* IEEE doesn't distinguish +0 and -0 in comparisons. */ /* a CMP (-0) -> a CMP 0 */ if (REAL_VALUE_MINUS_ZERO (cst)) - return fold (build2 (code, type, arg0, - build_real (TREE_TYPE (arg1), dconst0))); + return fold_build2 (code, type, arg0, + build_real (TREE_TYPE (arg1), dconst0)); /* x != NaN is always true, other ops are always false. */ if (REAL_VALUE_ISNAN (cst) @@ -8851,7 +9170,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ? MINUS_EXPR : PLUS_EXPR, arg1, TREE_OPERAND (arg0, 1), 0)) && ! TREE_CONSTANT_OVERFLOW (tem)) - return fold (build2 (code, type, TREE_OPERAND (arg0, 0), tem)); + return fold_build2 (code, type, TREE_OPERAND (arg0, 0), tem); /* Likewise, we can simplify a comparison of a real constant with a MINUS_EXPR whose first operand is also a real constant, i.e. @@ -8863,8 +9182,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && 0 != (tem = const_binop (MINUS_EXPR, TREE_OPERAND (arg0, 0), arg1, 0)) && ! TREE_CONSTANT_OVERFLOW (tem)) - return fold (build2 (swap_tree_comparison (code), type, - TREE_OPERAND (arg0, 1), tem)); + return fold_build2 (swap_tree_comparison (code), type, + TREE_OPERAND (arg0, 1), tem); /* Fold comparisons against built-in math functions. */ if (TREE_CODE (arg1) == REAL_CST @@ -8898,16 +9217,16 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (TREE_CODE (arg0) == POSTINCREMENT_EXPR) { - newconst = fold (build2 (PLUS_EXPR, TREE_TYPE (arg0), - arg1, TREE_OPERAND (arg0, 1))); + newconst = fold_build2 (PLUS_EXPR, TREE_TYPE (arg0), + arg1, TREE_OPERAND (arg0, 1)); varop = build2 (PREINCREMENT_EXPR, TREE_TYPE (arg0), TREE_OPERAND (arg0, 0), TREE_OPERAND (arg0, 1)); } else { - newconst = fold (build2 (MINUS_EXPR, TREE_TYPE (arg0), - arg1, TREE_OPERAND (arg0, 1))); + newconst = fold_build2 (MINUS_EXPR, TREE_TYPE (arg0), + arg1, TREE_OPERAND (arg0, 1)); varop = build2 (PREDECREMENT_EXPR, TREE_TYPE (arg0), TREE_OPERAND (arg0, 0), TREE_OPERAND (arg0, 1)); @@ -8928,8 +9247,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) /* First check whether the comparison would come out always the same. If we don't do that we would change the meaning with the masking. */ - folded_compare = fold (build2 (code, type, - TREE_OPERAND (varop, 0), arg1)); + folded_compare = fold_build2 (code, type, + TREE_OPERAND (varop, 0), arg1); if (integer_zerop (folded_compare) || integer_onep (folded_compare)) return omit_one_operand (type, folded_compare, varop); @@ -8937,13 +9256,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) shift = build_int_cst (NULL_TREE, TYPE_PRECISION (TREE_TYPE (varop)) - size); shift = fold_convert (TREE_TYPE (varop), shift); - newconst = fold (build2 (LSHIFT_EXPR, TREE_TYPE (varop), - newconst, shift)); - newconst = fold (build2 (RSHIFT_EXPR, TREE_TYPE (varop), - newconst, shift)); + newconst = fold_build2 (LSHIFT_EXPR, TREE_TYPE (varop), + newconst, shift); + newconst = fold_build2 (RSHIFT_EXPR, TREE_TYPE (varop), + newconst, shift); } - return fold (build2 (code, type, varop, newconst)); + return fold_build2 (code, type, varop, newconst); } /* Change X >= C to X > (C - 1) and X < C to X <= (C - 1) if C > 0. @@ -8957,11 +9276,11 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { case GE_EXPR: arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0); - return fold (build2 (GT_EXPR, type, arg0, arg1)); + return fold_build2 (GT_EXPR, type, arg0, arg1); case LT_EXPR: arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0); - return fold (build2 (LE_EXPR, type, arg0, arg1)); + return fold_build2 (LE_EXPR, type, arg0, arg1); default: break; @@ -8969,10 +9288,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) } /* Comparisons with the highest or lowest possible integer of - the specified size will have known values. - - This is quite similar to fold_relational_hi_lo, however, - attempts to share the code have been nothing but trouble. */ + the specified size will have known values. */ { int width = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (arg1))); @@ -9035,13 +9351,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return omit_one_operand (type, integer_zero_node, arg0); case GE_EXPR: - return fold (build2 (EQ_EXPR, type, arg0, arg1)); + return fold_build2 (EQ_EXPR, type, arg0, arg1); case LE_EXPR: return omit_one_operand (type, integer_one_node, arg0); case LT_EXPR: - return fold (build2 (NE_EXPR, type, arg0, arg1)); + return fold_build2 (NE_EXPR, type, arg0, arg1); /* The GE_EXPR and LT_EXPR cases above are not normally reached because of previous transformations. */ @@ -9056,10 +9372,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { case GT_EXPR: arg1 = const_binop (PLUS_EXPR, arg1, integer_one_node, 0); - return fold (build2 (EQ_EXPR, type, arg0, arg1)); + return fold_build2 (EQ_EXPR, type, arg0, arg1); case LE_EXPR: arg1 = const_binop (PLUS_EXPR, arg1, integer_one_node, 0); - return fold (build2 (NE_EXPR, type, arg0, arg1)); + return fold_build2 (NE_EXPR, type, arg0, arg1); default: break; } @@ -9072,13 +9388,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return omit_one_operand (type, integer_zero_node, arg0); case LE_EXPR: - return fold (build2 (EQ_EXPR, type, arg0, arg1)); + return fold_build2 (EQ_EXPR, type, arg0, arg1); case GE_EXPR: return omit_one_operand (type, integer_one_node, arg0); case GT_EXPR: - return fold (build2 (NE_EXPR, type, arg0, arg1)); + return fold_build2 (NE_EXPR, type, arg0, arg1); default: break; @@ -9090,10 +9406,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) { case GE_EXPR: arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0); - return fold (build2 (NE_EXPR, type, arg0, arg1)); + return fold_build2 (NE_EXPR, type, arg0, arg1); case LT_EXPR: arg1 = const_binop (MINUS_EXPR, arg1, integer_one_node, 0); - return fold (build2 (EQ_EXPR, type, arg0, arg1)); + return fold_build2 (EQ_EXPR, type, arg0, arg1); default: break; } @@ -9133,7 +9449,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ? MINUS_EXPR : PLUS_EXPR, arg1, TREE_OPERAND (arg0, 1), 0)) && ! TREE_CONSTANT_OVERFLOW (tem)) - return fold (build2 (code, type, TREE_OPERAND (arg0, 0), tem)); + return fold_build2 (code, type, TREE_OPERAND (arg0, 0), tem); /* Similarly for a NEGATE_EXPR. */ else if ((code == EQ_EXPR || code == NE_EXPR) @@ -9142,14 +9458,14 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && 0 != (tem = negate_expr (arg1)) && TREE_CODE (tem) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (tem)) - return fold (build2 (code, type, TREE_OPERAND (arg0, 0), tem)); + return fold_build2 (code, type, TREE_OPERAND (arg0, 0), tem); /* If we have X - Y == 0, we can convert that to X == Y and similarly for !=. Don't do this for ordered comparisons due to overflow. */ else if ((code == NE_EXPR || code == EQ_EXPR) && integer_zerop (arg1) && TREE_CODE (arg0) == MINUS_EXPR) - return fold (build2 (code, type, - TREE_OPERAND (arg0, 0), TREE_OPERAND (arg0, 1))); + return fold_build2 (code, type, + TREE_OPERAND (arg0, 0), TREE_OPERAND (arg0, 1)); else if (TREE_CODE (TREE_TYPE (arg0)) == INTEGER_TYPE && (TREE_CODE (arg0) == NOP_EXPR @@ -9193,11 +9509,11 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && (0 != (tem = negate_expr (arg1))) && TREE_CODE (tem) == INTEGER_CST && ! TREE_CONSTANT_OVERFLOW (tem)) - return fold (build2 (TRUTH_ANDIF_EXPR, type, - build2 (GE_EXPR, type, - TREE_OPERAND (arg0, 0), tem), - build2 (LE_EXPR, type, - TREE_OPERAND (arg0, 0), arg1))); + return fold_build2 (TRUTH_ANDIF_EXPR, type, + build2 (GE_EXPR, type, + TREE_OPERAND (arg0, 0), tem), + build2 (LE_EXPR, type, + TREE_OPERAND (arg0, 0), arg1)); /* Convert ABS_EXPR >= 0 to true. */ else if (code == GE_EXPR @@ -9217,7 +9533,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) else if ((code == EQ_EXPR || code == NE_EXPR) && TREE_CODE (arg0) == ABS_EXPR && (integer_zerop (arg1) || real_zerop (arg1))) - return fold (build2 (code, type, TREE_OPERAND (arg0, 0), arg1)); + return fold_build2 (code, type, TREE_OPERAND (arg0, 0), arg1); /* If this is an EQ or NE comparison with zero and ARG0 is (1 << foo) & bar, convert it to (bar >> foo) & 1. Both require @@ -9232,23 +9548,23 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (TREE_CODE (arg00) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (arg00, 0))) return - fold (build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg00), - arg01, TREE_OPERAND (arg00, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1)); + fold_build2 (code, type, + build2 (BIT_AND_EXPR, TREE_TYPE (arg0), + build2 (RSHIFT_EXPR, TREE_TYPE (arg00), + arg01, TREE_OPERAND (arg00, 1)), + fold_convert (TREE_TYPE (arg0), + integer_one_node)), + arg1); else if (TREE_CODE (TREE_OPERAND (arg0, 1)) == LSHIFT_EXPR && integer_onep (TREE_OPERAND (TREE_OPERAND (arg0, 1), 0))) return - fold (build2 (code, type, - build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - build2 (RSHIFT_EXPR, TREE_TYPE (arg01), - arg00, TREE_OPERAND (arg01, 1)), - fold_convert (TREE_TYPE (arg0), - integer_one_node)), - arg1)); + fold_build2 (code, type, + build2 (BIT_AND_EXPR, TREE_TYPE (arg0), + build2 (RSHIFT_EXPR, TREE_TYPE (arg01), + arg00, TREE_OPERAND (arg01, 1)), + fold_convert (TREE_TYPE (arg0), + integer_one_node)), + arg1); } /* If this is an NE or EQ comparison of zero against the result of a @@ -9264,14 +9580,14 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && integer_pow2p (TREE_OPERAND (arg0, 1))) { tree newtype = lang_hooks.types.unsigned_type (TREE_TYPE (arg0)); - tree newmod = fold (build2 (TREE_CODE (arg0), newtype, - fold_convert (newtype, - TREE_OPERAND (arg0, 0)), - fold_convert (newtype, - TREE_OPERAND (arg0, 1)))); + tree newmod = fold_build2 (TREE_CODE (arg0), newtype, + fold_convert (newtype, + TREE_OPERAND (arg0, 0)), + fold_convert (newtype, + TREE_OPERAND (arg0, 1))); - return fold (build2 (code, type, newmod, - fold_convert (newtype, arg1))); + return fold_build2 (code, type, newmod, + fold_convert (newtype, arg1)); } /* If this is an NE comparison of zero with an AND of one, remove the @@ -9287,13 +9603,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && TREE_CODE (arg0) == BIT_AND_EXPR && integer_pow2p (TREE_OPERAND (arg0, 1)) && operand_equal_p (TREE_OPERAND (arg0, 1), arg1, 0)) - return fold (build2 (code == EQ_EXPR ? NE_EXPR : EQ_EXPR, type, - arg0, fold_convert (TREE_TYPE (arg0), - integer_zero_node))); + return fold_build2 (code == EQ_EXPR ? NE_EXPR : EQ_EXPR, type, + arg0, fold_convert (TREE_TYPE (arg0), + integer_zero_node)); - /* If we have (A & C) != 0 or (A & C) == 0 and C is a power of - 2, then fold the expression into shifts and logical operations. */ - tem = fold_single_bit_test (code, arg0, arg1, type); + /* If we have (A & C) != 0 or (A & C) == 0 and C is the sign + bit, then fold the expression into A < 0 or A >= 0. */ + tem = fold_single_bit_test_into_sign_test (code, arg0, arg1, type); if (tem) return tem; @@ -9304,11 +9620,11 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST) { - tree notc = fold (build1 (BIT_NOT_EXPR, - TREE_TYPE (TREE_OPERAND (arg0, 1)), - TREE_OPERAND (arg0, 1))); - tree dandnotc = fold (build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - arg1, notc)); + tree notc = fold_build1 (BIT_NOT_EXPR, + TREE_TYPE (TREE_OPERAND (arg0, 1)), + TREE_OPERAND (arg0, 1)); + tree dandnotc = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), + arg1, notc); tree rslt = code == EQ_EXPR ? integer_zero_node : integer_one_node; if (integer_nonzerop (dandnotc)) return omit_one_operand (type, rslt, arg0); @@ -9321,9 +9637,9 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && TREE_CODE (arg1) == INTEGER_CST && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST) { - tree notd = fold (build1 (BIT_NOT_EXPR, TREE_TYPE (arg1), arg1)); - tree candnotd = fold (build2 (BIT_AND_EXPR, TREE_TYPE (arg0), - TREE_OPERAND (arg0, 1), notd)); + tree notd = fold_build1 (BIT_NOT_EXPR, TREE_TYPE (arg1), arg1); + tree candnotd = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0), + TREE_OPERAND (arg0, 1), notd); tree rslt = code == EQ_EXPR ? integer_zero_node : integer_one_node; if (integer_nonzerop (candnotd)) return omit_one_operand (type, rslt, arg0); @@ -9371,7 +9687,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) if (! FLOAT_TYPE_P (TREE_TYPE (arg0)) || ! HONOR_NANS (TYPE_MODE (TREE_TYPE (arg0)))) return constant_boolean_node (1, type); - return fold (build2 (EQ_EXPR, type, arg0, arg1)); + return fold_build2 (EQ_EXPR, type, arg0, arg1); case NE_EXPR: /* For NE, we can only do this simplification if integer @@ -9425,20 +9741,20 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) was the same as ARG1. */ tree high_result - = fold (build2 (code, type, - eval_subst (arg0, cval1, maxval, - cval2, minval), - arg1)); + = fold_build2 (code, type, + eval_subst (arg0, cval1, maxval, + cval2, minval), + arg1); tree equal_result - = fold (build2 (code, type, - eval_subst (arg0, cval1, maxval, - cval2, maxval), - arg1)); + = fold_build2 (code, type, + eval_subst (arg0, cval1, maxval, + cval2, maxval), + arg1); tree low_result - = fold (build2 (code, type, - eval_subst (arg0, cval1, minval, - cval2, maxval), - arg1)); + = fold_build2 (code, type, + eval_subst (arg0, cval1, minval, + cval2, maxval), + arg1); /* All three of these results should be 0 or 1. Confirm they are. Then use those values to select the proper code @@ -9483,11 +9799,10 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return omit_one_operand (type, integer_one_node, arg0); } - tem = build2 (code, type, cval1, cval2); if (save_p) - return save_expr (tem); + return save_expr (build2 (code, type, cval1, cval2)); else - return fold (tem); + return fold_build2 (code, type, cval1, cval2); } } } @@ -9506,6 +9821,27 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return t1; } + /* Fold a comparison of the address of COMPONENT_REFs with the same + type and component to a comparison of the address of the base + object. In short, &x->a OP &y->a to x OP y and + &x->a OP &y.a to x OP &y */ + if (TREE_CODE (arg0) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg0, 0)) == COMPONENT_REF + && TREE_CODE (arg1) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (arg1, 0)) == COMPONENT_REF) + { + tree cref0 = TREE_OPERAND (arg0, 0); + tree cref1 = TREE_OPERAND (arg1, 0); + if (TREE_OPERAND (cref0, 1) == TREE_OPERAND (cref1, 1)) + { + tree op0 = TREE_OPERAND (cref0, 0); + tree op1 = TREE_OPERAND (cref1, 0); + return fold_build2 (code, type, + build_fold_addr_expr (op0), + build_fold_addr_expr (op1)); + } + } + /* If this is a comparison of complex values and either or both sides are a COMPLEX_EXPR or COMPLEX_CST, it is best to split up the comparisons and join them with a TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR. @@ -9522,16 +9858,16 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) arg0 = save_expr (arg0); arg1 = save_expr (arg1); - real0 = fold (build1 (REALPART_EXPR, subtype, arg0)); - imag0 = fold (build1 (IMAGPART_EXPR, subtype, arg0)); - real1 = fold (build1 (REALPART_EXPR, subtype, arg1)); - imag1 = fold (build1 (IMAGPART_EXPR, subtype, arg1)); + real0 = fold_build1 (REALPART_EXPR, subtype, arg0); + imag0 = fold_build1 (IMAGPART_EXPR, subtype, arg0); + real1 = fold_build1 (REALPART_EXPR, subtype, arg1); + imag1 = fold_build1 (IMAGPART_EXPR, subtype, arg1); - return fold (build2 ((code == EQ_EXPR ? TRUTH_ANDIF_EXPR - : TRUTH_ORIF_EXPR), - type, - fold (build2 (code, type, real0, real1)), - fold (build2 (code, type, imag0, imag1)))); + return fold_build2 ((code == EQ_EXPR ? TRUTH_ANDIF_EXPR + : TRUTH_ORIF_EXPR), + type, + fold_build2 (code, type, real0, real1), + fold_build2 (code, type, imag0, imag1)); } /* Optimize comparisons of strlen vs zero to a compare of the @@ -9553,11 +9889,11 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) && (arglist = TREE_OPERAND (arg0, 1)) && TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) == POINTER_TYPE && ! TREE_CHAIN (arglist)) - return fold (build2 (code, type, - build1 (INDIRECT_REF, char_type_node, - TREE_VALUE (arglist)), - fold_convert (char_type_node, - integer_zero_node))); + return fold_build2 (code, type, + build1 (INDIRECT_REF, char_type_node, + TREE_VALUE (arglist)), + fold_convert (char_type_node, + integer_zero_node)); } /* We can fold X/C1 op C2 where C1 and C2 are integer constants @@ -9641,8 +9977,8 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) newtype = TREE_TYPE (targ1); if (TYPE_PRECISION (newtype) < TYPE_PRECISION (TREE_TYPE (arg0))) - return fold (build2 (code, type, fold_convert (newtype, targ0), - fold_convert (newtype, targ1))); + return fold_build2 (code, type, fold_convert (newtype, targ0), + fold_convert (newtype, targ1)); } return NULL_TREE; @@ -9662,33 +9998,60 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) return build_complex (type, arg0, arg1); return NULL_TREE; + case ASSERT_EXPR: + /* An ASSERT_EXPR should never be passed to fold_binary. */ + gcc_unreachable (); + default: return NULL_TREE; } /* switch (code) */ } -/* Fold a ternary expression EXPR. Return the folded expression if - folding is successful. Otherwise, return the original - expression. */ +/* Callback for walk_tree, looking for LABEL_EXPR. + Returns tree TP if it is LABEL_EXPR. Otherwise it returns NULL_TREE. + Do not check the sub-tree of GOTO_EXPR. */ static tree -fold_ternary (tree expr) +contains_label_1 (tree *tp, + int *walk_subtrees, + void *data ATTRIBUTE_UNUSED) +{ + switch (TREE_CODE (*tp)) + { + case LABEL_EXPR: + return *tp; + case GOTO_EXPR: + *walk_subtrees = 0; + /* no break */ + default: + return NULL_TREE; + } +} + +/* Checks whether the sub-tree ST contains a label LABEL_EXPR which is + accessible from outside the sub-tree. Returns NULL_TREE if no + addressable label is found. */ + +static bool +contains_label_p (tree st) +{ + return (walk_tree (&st, contains_label_1 , NULL, NULL) != NULL_TREE); +} + +/* Fold a ternary expression of code CODE and type TYPE with operands + OP0, OP1, and OP2. Return the folded expression if folding is + successful. Otherwise, return NULL_TREE. */ + +tree +fold_ternary (enum tree_code code, tree type, tree op0, tree op1, tree op2) { - const tree t = expr; - const tree type = TREE_TYPE (expr); tree tem; - tree op0, op1, op2; tree arg0 = NULL_TREE, arg1 = NULL_TREE; - enum tree_code code = TREE_CODE (t); enum tree_code_class kind = TREE_CODE_CLASS (code); gcc_assert (IS_EXPR_CODE_CLASS (kind) && TREE_CODE_LENGTH (code) == 3); - op0 = TREE_OPERAND (t, 0); - op1 = TREE_OPERAND (t, 1); - op2 = TREE_OPERAND (t, 2); - /* Strip any conversions that don't change the mode. This is safe for every expression, except for a comparison expression because its signedness is derived from its operands. So, in the latter @@ -9728,12 +10091,16 @@ fold_ternary (tree expr) so all simple results must be passed through pedantic_non_lvalue. */ if (TREE_CODE (arg0) == INTEGER_CST) { + tree unused_op = integer_zerop (arg0) ? op1 : op2; tem = integer_zerop (arg0) ? op2 : op1; /* Only optimize constant conditions when the selected branch has the same type as the COND_EXPR. This avoids optimizing - away "c ? x : throw", where the throw has a void type. */ - if (! VOID_TYPE_P (TREE_TYPE (tem)) - || VOID_TYPE_P (type)) + away "c ? x : throw", where the throw has a void type. + Avoid throwing away that operand which contains label. */ + if ((!TREE_SIDE_EFFECTS (unused_op) + || !contains_label_p (unused_op)) + && (! VOID_TYPE_P (TREE_TYPE (tem)) + || VOID_TYPE_P (type))) return pedantic_non_lvalue (tem); return NULL_TREE; } @@ -9781,7 +10148,7 @@ fold_ternary (tree expr) tem = invert_truthvalue (arg0); if (TREE_CODE (tem) != TRUTH_NOT_EXPR) - return fold (build3 (code, type, tem, op2, op1)); + return fold_build3 (code, type, tem, op2, op1); } /* Convert A ? 1 : 0 to simply A. */ @@ -9807,8 +10174,8 @@ fold_ternary (tree expr) && integer_zerop (TREE_OPERAND (arg0, 1)) && integer_zerop (op2) && (tem = sign_bit_p (TREE_OPERAND (arg0, 0), arg1))) - return fold_convert (type, fold (build2 (BIT_AND_EXPR, - TREE_TYPE (tem), tem, arg1))); + return fold_convert (type, fold_build2 (BIT_AND_EXPR, + TREE_TYPE (tem), tem, arg1)); /* (A >> N) & 1 ? (1 << N) : 0 is simply A & (1 << N). A & 1 was already handled above. */ @@ -9823,8 +10190,8 @@ fold_ternary (tree expr) && TREE_CODE (TREE_OPERAND (tem, 1)) == INTEGER_CST && (unsigned HOST_WIDE_INT) tree_log2 (arg1) == TREE_INT_CST_LOW (TREE_OPERAND (tem, 1))) - return fold (build2 (BIT_AND_EXPR, type, - TREE_OPERAND (tem, 0), arg1)); + return fold_build2 (BIT_AND_EXPR, type, + TREE_OPERAND (tem, 0), arg1); } /* A & N ? N : 0 is simply A & N if N is a power of two. This @@ -9845,7 +10212,7 @@ fold_ternary (tree expr) if (integer_zerop (op2) && truth_value_p (TREE_CODE (arg0)) && truth_value_p (TREE_CODE (arg1))) - return fold (build2 (TRUTH_ANDIF_EXPR, type, arg0, arg1)); + return fold_build2 (TRUTH_ANDIF_EXPR, type, arg0, arg1); /* Convert A ? B : 1 into !A || B if A and B are truth values. */ if (integer_onep (op2) @@ -9855,7 +10222,7 @@ fold_ternary (tree expr) /* Only perform transformation if ARG0 is easily inverted. */ tem = invert_truthvalue (arg0); if (TREE_CODE (tem) != TRUTH_NOT_EXPR) - return fold (build2 (TRUTH_ORIF_EXPR, type, tem, arg1)); + return fold_build2 (TRUTH_ORIF_EXPR, type, tem, arg1); } /* Convert A ? 0 : B into !A && B if A and B are truth values. */ @@ -9866,14 +10233,14 @@ fold_ternary (tree expr) /* Only perform transformation if ARG0 is easily inverted. */ tem = invert_truthvalue (arg0); if (TREE_CODE (tem) != TRUTH_NOT_EXPR) - return fold (build2 (TRUTH_ANDIF_EXPR, type, tem, op2)); + return fold_build2 (TRUTH_ANDIF_EXPR, type, tem, op2); } /* Convert A ? 1 : B into A || B if A and B are truth values. */ if (integer_onep (arg1) && truth_value_p (TREE_CODE (arg0)) && truth_value_p (TREE_CODE (op2))) - return fold (build2 (TRUTH_ORIF_EXPR, type, arg0, op2)); + return fold_build2 (TRUTH_ORIF_EXPR, type, arg0, op2); return NULL_TREE; @@ -9883,7 +10250,9 @@ fold_ternary (tree expr) && TREE_CODE (TREE_OPERAND (op0, 0)) == FUNCTION_DECL && DECL_BUILT_IN (TREE_OPERAND (op0, 0))) { - tree tmp = fold_builtin (t, false); + tree fndecl = TREE_OPERAND (op0, 0); + tree arglist = op1; + tree tmp = fold_builtin (fndecl, arglist, false); if (tmp) return tmp; } @@ -9922,7 +10291,7 @@ fold (tree expr) if (IS_EXPR_CODE_CLASS (kind)) { tree type = TREE_TYPE (t); - tree op0, op1; + tree op0, op1, op2; switch (TREE_CODE_LENGTH (code)) { @@ -9936,7 +10305,10 @@ fold (tree expr) tem = fold_binary (code, type, op0, op1); return tem ? tem : expr; case 3: - tem = fold_ternary (expr); + op0 = TREE_OPERAND (t, 0); + op1 = TREE_OPERAND (t, 1); + op2 = TREE_OPERAND (t, 2); + tem = fold_ternary (code, type, op0, op1, op2); return tem ? tem : expr; default: break; @@ -10145,6 +10517,51 @@ fold_checksum_tree (tree expr, struct md5_ctx *ctx, htab_t ht) #endif +/* Fold a unary tree expression with code CODE of type TYPE with an + operand OP0. Return a folded expression if successful. Otherwise, + return a tree expression with code CODE of type TYPE with an + operand OP0. */ + +tree +fold_build1 (enum tree_code code, tree type, tree op0) +{ + tree tem = fold_unary (code, type, op0); + if (tem) + return tem; + + return build1 (code, type, op0); +} + +/* Fold a binary tree expression with code CODE of type TYPE with + operands OP0 and OP1. Return a folded expression if successful. + Otherwise, return a tree expression with code CODE of type TYPE + with operands OP0 and OP1. */ + +tree +fold_build2 (enum tree_code code, tree type, tree op0, tree op1) +{ + tree tem = fold_binary (code, type, op0, op1); + if (tem) + return tem; + + return build2 (code, type, op0, op1); +} + +/* Fold a ternary tree expression with code CODE of type TYPE with + operands OP0, OP1, and OP2. Return a folded expression if + successful. Otherwise, return a tree expression with code CODE of + type TYPE with operands OP0, OP1, and OP2. */ + +tree +fold_build3 (enum tree_code code, tree type, tree op0, tree op1, tree op2) +{ + tree tem = fold_ternary (code, type, op0, op1, op2); + if (tem) + return tem; + + return build3 (code, type, op0, op1, op2); +} + /* Perform constant folding and related simplification of initializer expression EXPR. This behaves identically to "fold" but ignores potential run-time traps and exceptions that fold must preserve. */ @@ -10501,7 +10918,11 @@ tree_expr_nonnegative_p (tree t) CASE_BUILTIN_F (BUILT_IN_EXPM1) CASE_BUILTIN_F (BUILT_IN_FLOOR) CASE_BUILTIN_F (BUILT_IN_FMOD) + CASE_BUILTIN_F (BUILT_IN_LCEIL) CASE_BUILTIN_F (BUILT_IN_LDEXP) + CASE_BUILTIN_F (BUILT_IN_LFLOOR) + CASE_BUILTIN_F (BUILT_IN_LLCEIL) + CASE_BUILTIN_F (BUILT_IN_LLFLOOR) CASE_BUILTIN_F (BUILT_IN_LLRINT) CASE_BUILTIN_F (BUILT_IN_LLROUND) CASE_BUILTIN_F (BUILT_IN_LRINT) @@ -10669,447 +11090,19 @@ tree_expr_nonzero_p (tree t) return false; } -/* See if we are applying CODE, a relational to the highest or lowest - possible integer of TYPE. If so, then the result is a compile - time constant. */ - -static tree -fold_relational_hi_lo (enum tree_code *code_p, const tree type, tree *op0_p, - tree *op1_p) -{ - tree op0 = *op0_p; - tree op1 = *op1_p; - enum tree_code code = *code_p; - int width = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (op1))); - - if (TREE_CODE (op1) == INTEGER_CST - && ! TREE_CONSTANT_OVERFLOW (op1) - && width <= HOST_BITS_PER_WIDE_INT - && (INTEGRAL_TYPE_P (TREE_TYPE (op1)) - || POINTER_TYPE_P (TREE_TYPE (op1)))) - { - unsigned HOST_WIDE_INT signed_max; - unsigned HOST_WIDE_INT max, min; - - signed_max = ((unsigned HOST_WIDE_INT) 1 << (width - 1)) - 1; - - if (TYPE_UNSIGNED (TREE_TYPE (op1))) - { - max = ((unsigned HOST_WIDE_INT) 2 << (width - 1)) - 1; - min = 0; - } - else - { - max = signed_max; - min = ((unsigned HOST_WIDE_INT) -1 << (width - 1)); - } - - if (TREE_INT_CST_HIGH (op1) == 0 - && TREE_INT_CST_LOW (op1) == max) - switch (code) - { - case GT_EXPR: - return omit_one_operand (type, integer_zero_node, op0); - - case GE_EXPR: - *code_p = EQ_EXPR; - break; - case LE_EXPR: - return omit_one_operand (type, integer_one_node, op0); - - case LT_EXPR: - *code_p = NE_EXPR; - break; - - /* The GE_EXPR and LT_EXPR cases above are not normally - reached because of previous transformations. */ - - default: - break; - } - else if (TREE_INT_CST_HIGH (op1) == 0 - && TREE_INT_CST_LOW (op1) == max - 1) - switch (code) - { - case GT_EXPR: - *code_p = EQ_EXPR; - *op1_p = const_binop (PLUS_EXPR, op1, integer_one_node, 0); - break; - case LE_EXPR: - *code_p = NE_EXPR; - *op1_p = const_binop (PLUS_EXPR, op1, integer_one_node, 0); - break; - default: - break; - } - else if (TREE_INT_CST_HIGH (op1) == (min ? -1 : 0) - && TREE_INT_CST_LOW (op1) == min) - switch (code) - { - case LT_EXPR: - return omit_one_operand (type, integer_zero_node, op0); - - case LE_EXPR: - *code_p = EQ_EXPR; - break; - - case GE_EXPR: - return omit_one_operand (type, integer_one_node, op0); - - case GT_EXPR: - *code_p = NE_EXPR; - break; - - default: - break; - } - else if (TREE_INT_CST_HIGH (op1) == (min ? -1 : 0) - && TREE_INT_CST_LOW (op1) == min + 1) - switch (code) - { - case GE_EXPR: - *code_p = NE_EXPR; - *op1_p = const_binop (MINUS_EXPR, op1, integer_one_node, 0); - break; - case LT_EXPR: - *code_p = EQ_EXPR; - *op1_p = const_binop (MINUS_EXPR, op1, integer_one_node, 0); - break; - default: - break; - } - - else if (TREE_INT_CST_HIGH (op1) == 0 - && TREE_INT_CST_LOW (op1) == signed_max - && TYPE_UNSIGNED (TREE_TYPE (op1)) - /* signed_type does not work on pointer types. */ - && INTEGRAL_TYPE_P (TREE_TYPE (op1))) - { - /* The following case also applies to X < signed_max+1 - and X >= signed_max+1 because previous transformations. */ - if (code == LE_EXPR || code == GT_EXPR) - { - tree st0, st1, exp, retval; - st0 = lang_hooks.types.signed_type (TREE_TYPE (op0)); - st1 = lang_hooks.types.signed_type (TREE_TYPE (op1)); - - exp = build2 (code == LE_EXPR ? GE_EXPR: LT_EXPR, - type, - fold_convert (st0, op0), - fold_convert (st1, integer_zero_node)); - - retval = fold_binary_to_constant (TREE_CODE (exp), - TREE_TYPE (exp), - TREE_OPERAND (exp, 0), - TREE_OPERAND (exp, 1)); - - /* If we are in gimple form, then returning EXP would create - non-gimple expressions. Clearing it is safe and insures - we do not allow a non-gimple expression to escape. */ - if (in_gimple_form) - exp = NULL; - - return (retval ? retval : exp); - } - } - } - - return NULL_TREE; -} - - /* Given the components of a binary expression CODE, TYPE, OP0 and OP1, attempt to fold the expression to a constant without modifying TYPE, OP0 or OP1. If the expression could be simplified to a constant, then return the constant. If the expression would not be simplified to a - constant, then return NULL_TREE. - - Note this is primarily designed to be called after gimplification - of the tree structures and when at least one operand is a constant. - As a result of those simplifying assumptions this routine is far - simpler than the generic fold routine. */ + constant, then return NULL_TREE. */ tree fold_binary_to_constant (enum tree_code code, tree type, tree op0, tree op1) { - int wins = 1; - tree subop0; - tree subop1; - tree tem; - - /* If this is a commutative operation, and ARG0 is a constant, move it - to ARG1 to reduce the number of tests below. */ - if (commutative_tree_code (code) - && (TREE_CODE (op0) == INTEGER_CST || TREE_CODE (op0) == REAL_CST)) - { - tem = op0; - op0 = op1; - op1 = tem; - } - - /* If either operand is a complex type, extract its real component. */ - if (TREE_CODE (op0) == COMPLEX_CST) - subop0 = TREE_REALPART (op0); - else - subop0 = op0; - - if (TREE_CODE (op1) == COMPLEX_CST) - subop1 = TREE_REALPART (op1); - else - subop1 = op1; - - /* Note if either argument is not a real or integer constant. - With a few exceptions, simplification is limited to cases - where both arguments are constants. */ - if ((TREE_CODE (subop0) != INTEGER_CST - && TREE_CODE (subop0) != REAL_CST) - || (TREE_CODE (subop1) != INTEGER_CST - && TREE_CODE (subop1) != REAL_CST)) - wins = 0; - - switch (code) - { - case PLUS_EXPR: - /* (plus (address) (const_int)) is a constant. */ - if (TREE_CODE (op0) == PLUS_EXPR - && TREE_CODE (op1) == INTEGER_CST - && (TREE_CODE (TREE_OPERAND (op0, 0)) == ADDR_EXPR - || (TREE_CODE (TREE_OPERAND (op0, 0)) == NOP_EXPR - && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (op0, 0), 0)) - == ADDR_EXPR))) - && TREE_CODE (TREE_OPERAND (op0, 1)) == INTEGER_CST) - { - return build2 (PLUS_EXPR, type, TREE_OPERAND (op0, 0), - const_binop (PLUS_EXPR, op1, - TREE_OPERAND (op0, 1), 0)); - } - case BIT_XOR_EXPR: - - binary: - if (!wins) - return NULL_TREE; - - /* Both arguments are constants. Simplify. */ - tem = const_binop (code, op0, op1, 0); - if (tem != NULL_TREE) - { - /* The return value should always have the same type as - the original expression. */ - if (TREE_TYPE (tem) != type) - tem = fold_convert (type, tem); - - return tem; - } - return NULL_TREE; - - case MINUS_EXPR: - /* Fold &x - &x. This can happen from &x.foo - &x. - This is unsafe for certain floats even in non-IEEE formats. - In IEEE, it is unsafe because it does wrong for NaNs. - Also note that operand_equal_p is always false if an - operand is volatile. */ - if (! FLOAT_TYPE_P (type) && operand_equal_p (op0, op1, 0)) - return fold_convert (type, integer_zero_node); - - goto binary; - - case MULT_EXPR: - case BIT_AND_EXPR: - /* Special case multiplication or bitwise AND where one argument - is zero. */ - if (! FLOAT_TYPE_P (type) && integer_zerop (op1)) - return omit_one_operand (type, op1, op0); - else - if (!HONOR_NANS (TYPE_MODE (TREE_TYPE (op0))) - && !HONOR_SIGNED_ZEROS (TYPE_MODE (TREE_TYPE (op0))) - && real_zerop (op1)) - return omit_one_operand (type, op1, op0); - - goto binary; - - case BIT_IOR_EXPR: - /* Special case when we know the result will be all ones. */ - if (integer_all_onesp (op1)) - return omit_one_operand (type, op1, op0); - - goto binary; - - case TRUNC_DIV_EXPR: - case ROUND_DIV_EXPR: - case FLOOR_DIV_EXPR: - case CEIL_DIV_EXPR: - case EXACT_DIV_EXPR: - case TRUNC_MOD_EXPR: - case ROUND_MOD_EXPR: - case FLOOR_MOD_EXPR: - case CEIL_MOD_EXPR: - case RDIV_EXPR: - /* Division by zero is undefined. */ - if (integer_zerop (op1)) - return NULL_TREE; - - if (TREE_CODE (op1) == REAL_CST - && !MODE_HAS_INFINITIES (TYPE_MODE (TREE_TYPE (op1))) - && real_zerop (op1)) - return NULL_TREE; - - goto binary; - - case MIN_EXPR: - if (INTEGRAL_TYPE_P (type) - && operand_equal_p (op1, TYPE_MIN_VALUE (type), OEP_ONLY_CONST)) - return omit_one_operand (type, op1, op0); - - goto binary; - - case MAX_EXPR: - if (INTEGRAL_TYPE_P (type) - && TYPE_MAX_VALUE (type) - && operand_equal_p (op1, TYPE_MAX_VALUE (type), OEP_ONLY_CONST)) - return omit_one_operand (type, op1, op0); - - goto binary; - - case RSHIFT_EXPR: - /* Optimize -1 >> x for arithmetic right shifts. */ - if (integer_all_onesp (op0) && ! TYPE_UNSIGNED (type)) - return omit_one_operand (type, op0, op1); - /* ... fall through ... */ - - case LSHIFT_EXPR: - if (integer_zerop (op0)) - return omit_one_operand (type, op0, op1); - - /* Since negative shift count is not well-defined, don't - try to compute it in the compiler. */ - if (TREE_CODE (op1) == INTEGER_CST && tree_int_cst_sgn (op1) < 0) - return NULL_TREE; - - goto binary; - - case LROTATE_EXPR: - case RROTATE_EXPR: - /* -1 rotated either direction by any amount is still -1. */ - if (integer_all_onesp (op0)) - return omit_one_operand (type, op0, op1); - - /* 0 rotated either direction by any amount is still zero. */ - if (integer_zerop (op0)) - return omit_one_operand (type, op0, op1); - - goto binary; - - case COMPLEX_EXPR: - if (wins) - return build_complex (type, op0, op1); - return NULL_TREE; - - case LT_EXPR: - case LE_EXPR: - case GT_EXPR: - case GE_EXPR: - case EQ_EXPR: - case NE_EXPR: - /* If one arg is a real or integer constant, put it last. */ - if ((TREE_CODE (op0) == INTEGER_CST - && TREE_CODE (op1) != INTEGER_CST) - || (TREE_CODE (op0) == REAL_CST - && TREE_CODE (op0) != REAL_CST)) - { - tree temp; - - temp = op0; - op0 = op1; - op1 = temp; - code = swap_tree_comparison (code); - } - - /* Change X >= C to X > (C - 1) and X < C to X <= (C - 1) if C > 0. - This transformation affects the cases which are handled in later - optimizations involving comparisons with non-negative constants. */ - if (TREE_CODE (op1) == INTEGER_CST - && TREE_CODE (op0) != INTEGER_CST - && tree_int_cst_sgn (op1) > 0) - { - switch (code) - { - case GE_EXPR: - code = GT_EXPR; - op1 = const_binop (MINUS_EXPR, op1, integer_one_node, 0); - break; - - case LT_EXPR: - code = LE_EXPR; - op1 = const_binop (MINUS_EXPR, op1, integer_one_node, 0); - break; - - default: - break; - } - } - - tem = fold_relational_hi_lo (&code, type, &op0, &op1); - if (tem) - return tem; - - /* Fall through. */ - - case ORDERED_EXPR: - case UNORDERED_EXPR: - case UNLT_EXPR: - case UNLE_EXPR: - case UNGT_EXPR: - case UNGE_EXPR: - case UNEQ_EXPR: - case LTGT_EXPR: - if (!wins) - return NULL_TREE; - - return fold_relational_const (code, type, op0, op1); - - case RANGE_EXPR: - /* This could probably be handled. */ - return NULL_TREE; - - case TRUTH_AND_EXPR: - /* If second arg is constant zero, result is zero, but first arg - must be evaluated. */ - if (integer_zerop (op1)) - return omit_one_operand (type, op1, op0); - /* Likewise for first arg, but note that only the TRUTH_AND_EXPR - case will be handled here. */ - if (integer_zerop (op0)) - return omit_one_operand (type, op0, op1); - if (TREE_CODE (op0) == INTEGER_CST && TREE_CODE (op1) == INTEGER_CST) - return constant_boolean_node (true, type); - return NULL_TREE; - - case TRUTH_OR_EXPR: - /* If second arg is constant true, result is true, but we must - evaluate first arg. */ - if (TREE_CODE (op1) == INTEGER_CST && ! integer_zerop (op1)) - return omit_one_operand (type, op1, op0); - /* Likewise for first arg, but note this only occurs here for - TRUTH_OR_EXPR. */ - if (TREE_CODE (op0) == INTEGER_CST && ! integer_zerop (op0)) - return omit_one_operand (type, op0, op1); - if (TREE_CODE (op0) == INTEGER_CST && TREE_CODE (op1) == INTEGER_CST) - return constant_boolean_node (false, type); - return NULL_TREE; - - case TRUTH_XOR_EXPR: - if (TREE_CODE (op0) == INTEGER_CST && TREE_CODE (op1) == INTEGER_CST) - { - int x = ! integer_zerop (op0) ^ ! integer_zerop (op1); - return constant_boolean_node (x, type); - } - return NULL_TREE; - - default: - return NULL_TREE; - } + tree tem = fold_binary (code, type, op0, op1); + return (tem && TREE_CONSTANT (tem)) ? tem : NULL_TREE; } /* Given the components of a unary expression CODE, TYPE and OP0, @@ -11118,81 +11111,13 @@ fold_binary_to_constant (enum tree_code code, tree type, tree op0, tree op1) If the expression could be simplified to a constant, then return the constant. If the expression would not be simplified to a - constant, then return NULL_TREE. - - Note this is primarily designed to be called after gimplification - of the tree structures and when op0 is a constant. As a result - of those simplifying assumptions this routine is far simpler than - the generic fold routine. */ + constant, then return NULL_TREE. */ tree fold_unary_to_constant (enum tree_code code, tree type, tree op0) { - /* Make sure we have a suitable constant argument. */ - if (code == NOP_EXPR || code == FLOAT_EXPR || code == CONVERT_EXPR) - { - tree subop; - - if (TREE_CODE (op0) == COMPLEX_CST) - subop = TREE_REALPART (op0); - else - subop = op0; - - if (TREE_CODE (subop) != INTEGER_CST && TREE_CODE (subop) != REAL_CST) - return NULL_TREE; - } - - switch (code) - { - case NOP_EXPR: - case FLOAT_EXPR: - case CONVERT_EXPR: - case FIX_TRUNC_EXPR: - case FIX_FLOOR_EXPR: - case FIX_CEIL_EXPR: - case FIX_ROUND_EXPR: - return fold_convert_const (code, type, op0); - - case NEGATE_EXPR: - if (TREE_CODE (op0) == INTEGER_CST || TREE_CODE (op0) == REAL_CST) - return fold_negate_const (op0, type); - else - return NULL_TREE; - - case ABS_EXPR: - if (TREE_CODE (op0) == INTEGER_CST || TREE_CODE (op0) == REAL_CST) - return fold_abs_const (op0, type); - else - return NULL_TREE; - - case BIT_NOT_EXPR: - if (TREE_CODE (op0) == INTEGER_CST) - return fold_not_const (op0, type); - else - return NULL_TREE; - - case REALPART_EXPR: - if (TREE_CODE (op0) == COMPLEX_CST) - return TREE_REALPART (op0); - else - return NULL_TREE; - - case IMAGPART_EXPR: - if (TREE_CODE (op0) == COMPLEX_CST) - return TREE_IMAGPART (op0); - else - return NULL_TREE; - - case CONJ_EXPR: - if (TREE_CODE (op0) == COMPLEX_CST - && TREE_CODE (TREE_TYPE (op0)) == COMPLEX_TYPE) - return build_complex (type, TREE_REALPART (op0), - negate_expr (TREE_IMAGPART (op0))); - return NULL_TREE; - - default: - return NULL_TREE; - } + tree tem = fold_unary (code, type, op0); + return (tem && TREE_CONSTANT (tem)) ? tem : NULL_TREE; } /* If EXP represents referencing an element in a constant string @@ -11796,7 +11721,7 @@ ptr_difference_const (tree e1, tree e2, HOST_WIDE_INT *diff) if (type != TREE_TYPE (toffset2)) toffset2 = fold_convert (type, toffset2); - tdiff = fold (build2 (MINUS_EXPR, type, toffset1, toffset2)); + tdiff = fold_build2 (MINUS_EXPR, type, toffset1, toffset2); if (!host_integerp (tdiff, 0)) return false; @@ -11838,9 +11763,9 @@ fold_strip_sign_ops (tree exp) arg0 = fold_strip_sign_ops (TREE_OPERAND (exp, 0)); arg1 = fold_strip_sign_ops (TREE_OPERAND (exp, 1)); if (arg0 != NULL_TREE || arg1 != NULL_TREE) - return fold (build2 (TREE_CODE (exp), TREE_TYPE (exp), - arg0 ? arg0 : TREE_OPERAND (exp, 0), - arg1 ? arg1 : TREE_OPERAND (exp, 1))); + return fold_build2 (TREE_CODE (exp), TREE_TYPE (exp), + arg0 ? arg0 : TREE_OPERAND (exp, 0), + arg1 ? arg1 : TREE_OPERAND (exp, 1)); break; default: diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 314d79f2ef7..87e10472d98 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,527 @@ +2005-05-18 Thomas Koenig + + PR libfortran/21127 + * fortran/iresolve.c (gfc_resolve_reshape): Add + gfc_type_letter (BT_COMPLEX) for complex to + to resolved function name. + +2005-05-18 Erik Edelmann + + * array.c (gfc_match_array_constructor): Support [ ... ] + style array constructors. + +2005-05-18 Tobias Schl"uter + + * f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_TRUNC + and BUILT_IN_TRUNCF instead of BUILT_IN_FLOOR and BUILT_IN_FLOORF. + * trans-intrinsic.c (build_fix_expr): Change 'op' argument + to correct enum type. + (gfc_conv_intrinsic_aint): Likewise. Clarify comment in front of + function. Add default case to switch, deal with FIX_TRUNC_EXPR + instead of FIX_FLOOR_EXPR. + +2005-05-18 Feng Wang + + PR fortran/20954 + * trans-const.c (gfc_conv_const_charlen): Use gfc_charlen_type_node to + build character length. + +2005-05-17 Zdenek Dvorak + + * trans-types.c (gfc_array_range_type): New variable. + (gfc_init_types): Initialize gfc_array_range_type. + (gfc_get_array_type_bounds): Use gfc_array_range_type. + +2005-05-17 Jakub Jelinek + + PR fortran/15080 + * trans-stmt.c (generate_loop_for_temp_to_lhs): Remove SIZE and COUNT2 + arguments. If LSS is gfc_ss_terminator, increment COUNT1 by 1, instead + of incrementing COUNT2 and using COUNT1+COUNT2 increment COUNT1 and use + just that as index. + (generate_loop_for_rhs_to_temp): Likewise. + (compute_overall_iter_number): Add INNER_SIZE_BODY argument. + It non-NULL, add it to body. + (allocate_temp_for_forall_nest_1): New function, split from + allocate_temp_for_forall_nest. + (allocate_temp_for_forall_nest): Add INNER_SIZE_BODY argument, + propagate it down to compute_overall_iter_number. Use + allocate_temp_for_forall_nest_1. + (gfc_trans_assign_need_temp): Remove COUNT2. Call + compute_inner_temp_size into a new stmtblock_t. Adjust calls to + allocate_temp_for_forall_nest, generate_loop_for_rhs_to_temp + and generate_loop_for_temp_to_lhs. + (gfc_trans_pointer_assign_need_temp): Adjust calls to + allocate_temp_for_forall_nest. + (gfc_evaluate_where_mask): Call compute_inner_temp_size into a new + stmtblock_t. Call compute_overall_iter_number just once, then + allocate_temp_for_forall_nest_1 twice with the same size. + Initialize mask indexes if nested_forall_info != NULL. + (gfc_trans_where_2): Initialize mask indexes before calling + gfc_trans_nested_forall_loop. + +2005-05-15 Feng Wang + Jerry DeLisle + + PR fortran/17432 + * trans-stmt.c (gfc_trans_label_assign): fix pointer type, to + resolve ICE on assign of format label. + * trans-io.c (set_string): add fold-convert to properly + handle assigned format label in write. + +2005-05-13 Paul Brook + + * trans-stmt.c (gfc_trans_forall_1): Fix comment typo. + +2005-05-12 Tobias Schl"uter + + * trans-types.c (gfc_is_nodesc_array): Remove redundant check. + +2005-05-11 Tobias Schl"uter + + PR fortran/21260 + * io.c (check_format): Look for literal characters inside + hollerith constant. + +2005-05-11 Tobias Schl"uter + + * resolve.c (resolve_symbol): Copy 'pointer' and 'dimension' + attribute from result symbol to function symbol. + * trans-expr.c (gfc_conv_function_call): Look at sym->attr.dimension + instead of sym->result->attr.dimension. + +2005-05-10 Tobias Schl"uter + + PR fortran/20178 + * gfortran.h (gfc_option): Add flag_f2c. + * invoke.texi: Document '-ff2c' command line option. Adapt + documentation for '-fno-second-underscore' and '-fno-underscoring'. + * lang.opt (ff2c): New entry. + * options.c (gfc-init_options): Set default calling convention + to -fno-f2c. Mark -fsecond-underscore unset. + (gfc_post_options): Set -fsecond-underscore if not explicitly set + by user. + (handle_options): Set gfc_option.flag_f2c according to requested + calling convention. + * trans-decl.c (gfc_get_extern_function_decl): Use special f2c + intrinsics where necessary. + (gfc_trans_deferred_vars): Change todo error to assertion. + * trans-expr.c (gfc_conv_variable): Dereference access + to hidden result argument. + (gfc_conv_function_call): Add hidden result argument to argument + list if f2c calling conventions requested. Slightly restructure + tests. Convert result of default REAL function to requested type + if f2c calling conventions are used. Dereference COMPLEX result + if f2c cc are used. + * trans-types.c (gfc_sym_type): Return double for default REAL + function if f2c cc are used. + (gfc_return_by_reference): Slightly restructure logic. Return + COMPLEX by reference depending on calling conventions. + (gfc_get_function_type): Correctly make hidden result argument a + pass-by-reference argument for COMPLEX. Remove old code which does + this for derived types. + +2005-05-09 Tobias Schl"uter + + * match.c (gfc_match_return): Only require space after keyword when + it is obligatory. Only give stdwarn to after matching is successful. + * dump-parse-tree.c (gfc_show_symbol): Deal with alternate returns. + +2005-05-08 Kazu Hirata + + * intrinsic.texi: Fix typos. + +2005-05-07 Steven G. Kargl + + * intrinsic.texi: Document ASSOCIATED and ATAN2. Update Bessel function + description to include information about scalar arguments. + +2005-05-03 Kazu Hirata + + * Make-lang.in, dump-parse-tree.c, invoke.texi, lang.opt, + match.h, trans-array.h: Update copyright. + +2005-04-29 Tom Tromey + + * f95-lang.c (poplevel): Updated for change to build_block. + +2005-04-29 Jakub Jelinek + + PR fortran/13082 + PR fortran/18824 + * trans-expr.c (gfc_conv_variable): Handle return values in functions + with alternate entry points. + * resolve.c (resolve_entries): Remove unnecessary string termination + after snprintf. Set result of entry master. + If all entries have the same type, set entry master's type + to that common type, otherwise set mixed_entry_master attribute. + * trans-types.c (gfc_get_mixed_entry_union): New function. + (gfc_get_function_type): Use it for mixed_entry_master functions. + * gfortran.h (symbol_attribute): Add mixed_entry_master bit. + * decl.c (gfc_match_entry): Set entry->result properly for + function ENTRY. + * trans-decl.c (gfc_get_symbol_decl): For entry_master, skip over + __entry argument. + (build_entry_thunks): Handle return values in entry thunks. + Clear BT_CHARACTER's ts.cl->backend_decl, so that it is not + shared between multiple contexts. + (gfc_get_fake_result_decl): Use DECL_ARGUMENTS from + current_function_decl instead of sym->backend_decl. Skip over + entry master's entry id argument. For mixed_entry_master entries or + their results, return a COMPONENT_REF of the fake result. + (gfc_trans_deferred_vars): Don't warn about missing return value if + at least one entry point uses RESULT. + (gfc_generate_function_code): For entry master returning + CHARACTER, copy ts.cl->backend_decl to all entry result syms. + * trans-array.c (gfc_trans_dummy_array_bias): Don't consider return + values optional just because they are in entry master. + +2005-04-29 Francois-Xavier Coudert + + * gfortran.h (gfc_namespace): Add seen_implicit_none field, + Tobias forgot this in previous commit. + +2005-04-29 Paul Brook + + * trans-expr.c (gfc_conv_expr_present): Fix broken assert. Update + comment. + +2005-04-29 Tobias Schl"uter + + * gfortran.h (gfc_namespace): Add seen_implicit_none field. + * symbol.c (gfc_set_implicit_none): Give error if there's a previous + IMPLICIT NONE, set seen_implicit_none. + (gfc_merge_new_implicit): Error if there's an IMPLICIT NONE statement. + +2005-04-28 Tobias Schl"uter + + * gfortran.h (gfc_gsymbol): Make name a const char *. + * symbol.c (gfc_get_gsymbol): Allocate gsymbol name via + gfc_get_string. + +2005-04-28 Francois-Xavier Coudert + + PR fortran/20865 + * resolve.c (resolve_actual_arglist): Issue an error if a statement + functions is used as actual argument. + +2005-04-27 Francois-Xavier Coudert + + PR fortran/21177 + * interface.c (compare_parameter): Ignore type for EXPR_NULL + only if type is BT_UNKNOWN. + +2005-04-25 Paul Brook + Steven G. Kargl + + PR fortran/20879 + * check.c (gfc_check_ichar_iachar): New function. + * instinsic.h (gfc_check_ichar_iachar): Add prototype. + * intrinsic.c (add_functions): Use it. + * primary.c (match_varspec, gfc_match_rvalue): Clear incorrect + character expression lengths. + +2005-04-24 Tobias Schl"uter + + PR fortran/20059 + * trans-common.c (translate_common): Cast offset and + common_segment->offset to type int for warning message. + +2005-04-23 DJ Delorie + + * trans-decl.c: Adjust warning() callers. + +2005-04-23 Tobias Schl"uter + + * trans-const.c (gfc_conv_mpfr_to_tree): Use hexadecimal string as + intermediate representation. Fix typo in comment. + +2005-04-21 Steven G. Kargl + + * trans-const.c (gfc_conv_mpfr_to_tree): Remove unneeded computation; + simplify logic; Add a gcc_assert. + +2005-04-19 Steven G. Kargl + + * trans-const.c (gfc_conv_mpz_to_tree): Fix comment. + +2005-04-19 Arnaud Desitter + Steven G. Kargl + + * invoke.texi: Update -Waliasing description + +2005-04-19 Francois-Xavier Coudert + + PR fortran/16861 + * resolve.c (resolve_variable): If e->symtree is not set, this + ought to be a FAILURE, and not a segfault. + +2005-04-17 Paul Thomas + + PR fortran/17472 + PR fortran/18209 + PR fortran/18396 + PR fortran/19467 + PR fortran/19657 + * fortran/trans-io.c (gfc_build_io_library_fndecls): Create + declaration for st_set_nml_var and st_set_nml_var_dim. Remove + declarations of old namelist functions. + (build_dt): Simplified call to transfer_namelist_element. + (nml_get_addr_expr): Generates address expression for start of + object data. New function. + (nml_full_name): Qualified name for derived type components. New + function. + (transfer_namelist_element): Modified for calls to new functions + and improved derived type handling. + +2005-04-17 Richard Guenther + + * scanner.c (gfc_next_char_literal): Reset truncation flag + for lines ending in a comment for both fixed and free form. + (load_line): Do not set truncated flag if only truncating + the EOL marker. + +2005-04-15 Richard Guenther + + PR fortran/14569 + * gfortran.h (gfc_linebuf): Add truncated field. + * parse.c (next_statement): Handle warning for truncated + lines. + * scanner.c (load_line): Return if line was truncated. + No longer warn for truncated lines. Remove unused parameters. + (load_file): Store load_line return value to linebuf. + (gfc_error_recovery): Do not advance line at the end. + +2005-04-14 Steven G. Kargl + + * gfortran.h (gfc_real_info): Add subnormal struct member. + * arith.c (gfc_arith_init_1): Set it. + (gfc_check_real_range): Use it. + * simplify.c (gfc_simplify_nearest): Fix nearest(0.,1.). + +2005-04-12 Kazu Hirata + + * simplify.c: Fix a comment typo. + +2005-04-11 Richard Sandiford + + * lang.opt: Refer to the GCC internals documentation instead of c.opt. + +2005-04-11 Tobias Schl"uter + + * simplify.c (gfc_simplify_nearest): Overhaul. + +2005-04-10 Kazu Hirata + + * interface.c: Fix a comment typo. + +2005-04-10 Francois-Xavier Coudert + + * match.c (match_arithmetic_if): Arithmetic IF is obsolete in + Fortran 95. + +2005-04-09 Steven G. Kargl + + * simplify.c (gfc_simplify_anint): Use mpfr_round() + (gfc_simplify_dnint): ditto. + (gfc_simplify_nint): ditto. + +2005-04-09 Andrew Pinski + + PR fortran/13257 + * io.c (check_format): Allow an optional comma + between descriptors. + +2005-04-09 Francois-Xavier Coudert + + * match.c (match_arithmetic_if): Remove gfc_ prefix and correct + comment according to GNU coding style. + (gfc_match_if): Remove gfc_ prefix in call to + match_arithmetic_if. + +2005-04-08 Diego Novillo + + * match.c (gfc_match_arithmetic_if): Declare static. + +2005-04-08 Francois-Xavier Coudert + + PR fortran/17229 + * match.c (gfc_match_arithmetic_if): New function to match an + arithmetic IF statement. + (gfc_match_if): Use gfc_match_arithmetic_if to match an + arithmetic IF statement embedded in a simple IF statement. + +2005-04-07 Steven G. Kargl + + * simplify.c (gfc_simplify_exponent): Fix exponent(tiny(x)) + +2005-04-06 Steven G. Kargl + + * invoke.texi: Remove documentation of -std=f90 + +2005-04-06 Tobias Schl"uter + + * expr.c (gfc_check_assign): Don't allow NULL as rhs in a + non-pointer assignment. + +2005-04-05 Feng Wang + + PR fortran/15959 + PR fortran/20713 + + * array.c (resolve_character_array_constructor): New function. Set + constant character array's character length. + (gfc_resolve_array_constructor): Use it. + * decl.c (add_init_expr_to_sym): Set symbol and initializer character + length. + (gfc_set_constant_character_len): New function. Set constant character + expression according the given length. + * match.h (gfc_set_constant_character_len): Add prototype. + +2005-04-04 Francois-Xavier Coudert + + * intrinsic.texi: BES?? functions are not in the f95 standard. + +2005-04-03 Francois-Xavier Coudert + + * intrinsic.texi: Document COS, EXP, LOG, LOG10, SIN, SQRT, TAN. + +2005-04-03 Francois-Xavier Coudert + + * intrinsic.texi: Document BESJ0, BESJ1, BESJN, BESY0, BESY1, + BESYN, ATAN, COSH, ERF, ERC, SINH, TANH. + +2005-04-02 Steven G. Kargl + + * intrinsic.texi: Document ALLOCATED, ANINT, ANY, ASIN; fix typos + +2005-04-01 Kazu Hirata + + * decl.c, f95-lang.c, interface.c, module.c, trans-stmt.c, + trans.h: Fix comment typos. + +2005-03-29 Steven G. Kargl + + * gfortran.h (option_t): Change d8, i8, r8 to flag_default_double, + flag_default_integer, flag_default_real + * invoke.texi: Update documentation + * lang.opt: Remove d8, i8, r8 definitions; Add fdefault-double-8 + fdefault-integer-8, and fdefault-real-8 definitions. + * options.c (gfc_init_options): Set option defaults + (gfc_handle_option): Handle command line options. + * trans-types.c (gfc_init_kinds): Use options. + +2005-03-29 Keith Besaw + + * f95-lang.c (builtin_function): Process the attrs parameter + and apply the "const" attribute to the builtin if found. + +2005-03-27 Steven G. Kargl + + * intrinsic.texi: Document AIMAG, AINT, ALL + +2005-03-26 Steven G. Kargl + + * arith.c (check_result): Fix illogical logic. + +2005-03-26 Canqun Yang + + * trans-common.c (create_common): Build RECORD_NODE for common blocks + contain no equivalence objects. + (add_equivalences): New argument saw_equiv. + (trans_common): New local variable saw_equiv. + (finish_equivalences): Add a local variable dummy, Always pass true + for the 3rd parameter to create_common. + +2005-03-25 Steven G. Kargl + + * intrinsic.texi: Fix "make dvi" + +2005-03-24 Steven G. Kargl + + * intrinsic.texi: New file. + * gfortran.texi: Include it; white space change; fix typo. + +2005-03-23 Joseph S. Myers + + * f95-lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-23 Steven Bosscher + + * convert.c (convert): Replace fold (buildN (...)) with fold_buildN. + * trans-array.c (gfc_trans_allocate_array_storage, + gfc_trans_allocate_temp_array gfc_trans_array_constructor_value, + gfc_conv_array_index_ref, gfc_trans_array_bound_check, + gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref, + gfc_conv_array_ref, gfc_trans_preloop_setup, gfc_conv_ss_startstride, + gfc_conv_loop_setup, gfc_array_init_size, gfc_trans_array_bounds, + gfc_trans_auto_array_allocation, gfc_trans_dummy_array_bias, + gfc_conv_expr_descriptor): Likewise. + * trans-expr.c (gfc_conv_powi, gfc_conv_string_tmp, + gfc_conv_concat_op, gfc_conv_expr_op): Likewise. + * trans-intrinsic.c (build_round_expr, gfc_conv_intrinsic_bound, + gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_sign, + gfc_conv_intrinsic_minmaxloc, gfc_conv_intrinsic_minmaxval, + gfc_conv_intrinsic_btest, gfc_conv_intrinsic_bitop, + gfc_conv_intrinsic_singlebitop, gfc_conv_intrinsic_ibits, + gfc_conv_intrinsic_ishft, gfc_conv_intrinsic_ishftc, + gfc_conv_intrinsic_merge, prepare_arg_info, + gfc_conv_intrinsic_rrspacing, gfc_conv_intrinsic_repeat): Likewise. + * trans-stmt.c (gfc_trans_simple_do, gfc_trans_do, gfc_trans_do_while, + gfc_trans_forall_loop, gfc_do_allocate, generate_loop_for_temp_to_lhs, + generate_loop_for_rhs_to_temp, compute_inner_temp_size, + allocate_temp_for_forall_nest, gfc_trans_pointer_assign_need_temp, + gfc_trans_forall_1, gfc_evaluate_where_mask, gfc_trans_where_assign): + Likewise. + * trans-types.c (gfc_get_dtype, gfc_get_array_type_bounds): Likewise. + * trans.c (gfc_add_modify_expr): Likewise. + +2005-03-22 Francois-Xavier Coudert + + * check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill, + gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub, + gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename, + gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror, + gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub, + gfc_check_perror): new functions to check newly implemented + g77 intrinsics. + * gfortran.h: adding symbols for new intrinsics. + * intrinsic.c (add_functions): adding new intrinsics. + (add_subroutines): adding new intrinsics. + * intrinsic.h: prototype for all checking and resolving + functions. + * iresolve.c (gfc_resolve_chdir, gfc_resolve_chdir_sub, + gfc_resolve_hostnm, gfc_resolve_ierrno, gfc_resolve_kill, + gfc_resolve_link, gfc_resolve_rename, gfc_resolve_symlnk, + gfc_resolve_time, gfc_resolve_time8, gfc_resolve_rename_sub, + gfc_resolve_kill_sub, gfc_resolve_link_sub, + gfc_resolve_symlnk_sub, gfc_resolve_sleep_sub, + gfc_resolve_gerror, gfc_resolve_getlog, gfc_resolve_hostnm_sub, + gfc_resolve_perror): new functions to resolve intrinsics. + * trans-intrinsic.c (gfc_conv_intrinsic_function): add case + for new symbols. + +2005-03-19 Tobias Schl"uter + + * dump-parse-tree.c (gfc_show_expr): Dump name of namespace + in which the variable is declared. + + PR fortran/18525 + * resolve.c (was_declared): Also check for dummy attribute. + +2005-03-19 Tobias Schl"uter + + * gfortran.h (arith): Remove ARITH_0TO0. + * arith.c (gfc_arith_error): Remove handling of ARITH_0TO0. + (gfc_arith_power): Remove special casing of zero to integral + power zero. + +2005-03-18 Kaveh R. Ghazi + + * Make-lang.in (fortran-warn): Remove -Wno-error. + (expr.o-warn, resolve.o-warn, simplify.o-warn, + trans-common.o-warn): Specify -Wno-error. + 2005-03-17 Tobias Schl"uter * trans-array.c (gfc_trans_static_array_pointer, diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in index 84199737858..3775c8585b5 100644 --- a/gcc/fortran/Make-lang.in +++ b/gcc/fortran/Make-lang.in @@ -1,6 +1,6 @@ # -*- makefile -*- # Top level makefile fragment for GNU gfortran, the GNU Fortran 95 compiler. -# Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. # Contributed by Paul Brook @@ -49,7 +49,14 @@ GFORTRAN_CROSS_NAME := $(shell echo gfortran|sed '$(program_transform_cross_name #^L # Use strict warnings for this front end. -fortran-warn = $(STRICT_WARN) -Wno-error +fortran-warn = $(STRICT_WARN) + +# These files get warnings from an inline function in GMP saying: +# "control may reach end of non-void function '__gmpz_get_ui' being inlined" +fortran/expr.o-warn = -Wno-error +fortran/resolve.o-warn = -Wno-error +fortran/simplify.o-warn = -Wno-error +fortran/trans-common.o-warn = -Wno-error # These are the groups of object files we have. The F95_PARSER_OBJS are # all the front end files, the F95_OBJS are the files for the translation diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 9bcfa0a007d..ef19217ae04 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -152,9 +152,6 @@ gfc_arith_error (arith code) case ARITH_DIV0: p = "Division by zero"; break; - case ARITH_0TO0: - p = "Indeterminate form 0 ** 0"; - break; case ARITH_INCOMMENSURATE: p = "Array operands are incommensurate"; break; @@ -262,6 +259,14 @@ gfc_arith_init_1 (void) mpfr_init (real_info->tiny); mpfr_set (real_info->tiny, b, GFC_RND_MODE); + /* subnormal (x) = b**(emin - digit + 1) */ + mpfr_set_ui (b, real_info->radix, GFC_RND_MODE); + mpfr_pow_si (b, b, real_info->min_exponent - real_info->digits + 1, + GFC_RND_MODE); + + mpfr_init (real_info->subnormal); + mpfr_set (real_info->subnormal, b, GFC_RND_MODE); + /* epsilon(x) = b**(1-p) */ mpfr_set_ui (b, real_info->radix, GFC_RND_MODE); mpfr_pow_si (b, b, 1 - real_info->digits, GFC_RND_MODE); @@ -377,7 +382,7 @@ gfc_check_real_range (mpfr_t p, int kind) retval = ARITH_OK; else if (mpfr_cmp (q, gfc_real_kinds[i].huge) > 0) retval = ARITH_OVERFLOW; - else if (mpfr_cmp (q, gfc_real_kinds[i].tiny) < 0) + else if (mpfr_cmp (q, gfc_real_kinds[i].subnormal) < 0) retval = ARITH_UNDERFLOW; else retval = ARITH_OK; @@ -555,21 +560,27 @@ gfc_range_check (gfc_expr * e) static arith check_result (arith rc, gfc_expr * x, gfc_expr * r, gfc_expr ** rp) { - if (rc != ARITH_OK) - gfc_free_expr (r); - else - { - if (rc == ARITH_UNDERFLOW && gfc_option.warn_underflow) - gfc_warning ("%s at %L", gfc_arith_error (rc), &x->where); + arith val = rc; - if (rc == ARITH_ASYMMETRIC) - gfc_warning ("%s at %L", gfc_arith_error (rc), &x->where); + if (val == ARITH_UNDERFLOW) + { + if (gfc_option.warn_underflow) + gfc_warning ("%s at %L", gfc_arith_error (val), &x->where); + val = ARITH_OK; + } - rc = ARITH_OK; - *rp = r; + if (val == ARITH_ASYMMETRIC) + { + gfc_warning ("%s at %L", gfc_arith_error (val), &x->where); + val = ARITH_OK; } - return rc; + if (val != ARITH_OK) + gfc_free_expr (r); + else + *rp = r; + + return val; } @@ -918,33 +929,23 @@ gfc_arith_power (gfc_expr * op1, gfc_expr * op2, gfc_expr ** resultp) result = gfc_constant_result (op1->ts.type, op1->ts.kind, &op1->where); if (power == 0) - { /* Handle something to the zeroth power */ + { + /* Handle something to the zeroth power. Since we're dealing + with integral exponents, there is no ambiguity in the + limiting procedure used to determine the value of 0**0. */ switch (op1->ts.type) { case BT_INTEGER: - if (mpz_sgn (op1->value.integer) == 0) - rc = ARITH_0TO0; - else - mpz_set_ui (result->value.integer, 1); + mpz_set_ui (result->value.integer, 1); break; case BT_REAL: - if (mpfr_sgn (op1->value.real) == 0) - rc = ARITH_0TO0; - else - mpfr_set_ui (result->value.real, 1, GFC_RND_MODE); + mpfr_set_ui (result->value.real, 1, GFC_RND_MODE); break; case BT_COMPLEX: - if (mpfr_sgn (op1->value.complex.r) == 0 - && mpfr_sgn (op1->value.complex.i) == 0) - rc = ARITH_0TO0; - else - { - mpfr_set_ui (result->value.complex.r, 1, GFC_RND_MODE); - mpfr_set_ui (result->value.complex.i, 0, GFC_RND_MODE); - } - + mpfr_set_ui (result->value.complex.r, 1, GFC_RND_MODE); + mpfr_set_ui (result->value.complex.i, 0, GFC_RND_MODE); break; default: diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 4f4f19b100b..f6284408567 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -866,14 +866,27 @@ gfc_match_array_constructor (gfc_expr ** result) gfc_expr *expr; locus where; match m; + const char *end_delim; if (gfc_match (" (/") == MATCH_NO) - return MATCH_NO; + { + if (gfc_match (" [") == MATCH_NO) + return MATCH_NO; + else + { + if (gfc_notify_std (GFC_STD_F2003, "New in Fortran 2003: [...] " + "style array constructors at %C") == FAILURE) + return MATCH_ERROR; + end_delim = " ]"; + } + } + else + end_delim = " /)"; where = gfc_current_locus; head = tail = NULL; - if (gfc_match (" /)") == MATCH_YES) + if (gfc_match (end_delim) == MATCH_YES) goto empty; /* Special case */ for (;;) @@ -895,7 +908,7 @@ gfc_match_array_constructor (gfc_expr ** result) break; } - if (gfc_match (" /)") == MATCH_NO) + if (gfc_match (end_delim) == MATCH_NO) goto syntax; empty: @@ -1499,9 +1512,45 @@ resolve_array_list (gfc_constructor * p) return t; } +/* Resolve character array constructor. If it is a constant character array and + not specified character length, update character length to the maximum of + its element constructors' length. */ + +static void +resolve_character_array_constructor (gfc_expr * expr) +{ + gfc_constructor * p; + int max_length; + + gcc_assert (expr->expr_type == EXPR_ARRAY); + gcc_assert (expr->ts.type == BT_CHARACTER); + + max_length = -1; + + if (expr->ts.cl == NULL || expr->ts.cl->length == NULL) + { + /* Find the maximum length of the elements. Do nothing for variable array + constructor. */ + for (p = expr->value.constructor; p; p = p->next) + if (p->expr->expr_type == EXPR_CONSTANT) + max_length = MAX (p->expr->value.character.length, max_length); + else + return; + + if (max_length != -1) + { + /* Update the character length of the array constructor. */ + if (expr->ts.cl == NULL) + expr->ts.cl = gfc_get_charlen (); + expr->ts.cl->length = gfc_int_expr (max_length); + /* Update the element constructors. */ + for (p = expr->value.constructor; p; p = p->next) + gfc_set_constant_character_len (max_length, p->expr); + } + } +} -/* Resolve all of the expressions in an array list. - TODO: String lengths. */ +/* Resolve all of the expressions in an array list. */ try gfc_resolve_array_constructor (gfc_expr * expr) @@ -1511,6 +1560,8 @@ gfc_resolve_array_constructor (gfc_expr * expr) t = resolve_array_list (expr->value.constructor); if (t == SUCCESS) t = gfc_check_constructor_type (expr); + if (t == SUCCESS && expr->ts.type == BT_CHARACTER) + resolve_character_array_constructor (expr); return t; } diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 7a971f20038..7a27d04c13f 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -575,6 +575,35 @@ gfc_check_char (gfc_expr * i, gfc_expr * kind) try +gfc_check_chdir (gfc_expr * dir) +{ + if (type_check (dir, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_chdir_sub (gfc_expr * dir, gfc_expr * status) +{ + if (type_check (dir, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (status == NULL) + return SUCCESS; + + if (type_check (status, 1, BT_INTEGER) == FAILURE) + return FAILURE; + + if (scalar_check (status, 1) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_cmplx (gfc_expr * x, gfc_expr * y, gfc_expr * kind) { if (numeric_check (x, 0) == FAILURE) @@ -893,6 +922,64 @@ gfc_check_ibset (gfc_expr * i, gfc_expr * pos) try +gfc_check_ichar_iachar (gfc_expr * c) +{ + int i; + + if (type_check (c, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + /* Check that the argument is length one. Non-constant lengths + can't be checked here, so assume thay are ok. */ + if (c->ts.cl && c->ts.cl->length) + { + /* If we already have a length for this expression then use it. */ + if (c->ts.cl->length->expr_type != EXPR_CONSTANT) + return SUCCESS; + i = mpz_get_si (c->ts.cl->length->value.integer); + } + else if (c->expr_type == EXPR_VARIABLE || c->expr_type == EXPR_SUBSTRING) + { + gfc_expr *start; + gfc_expr *end; + gfc_ref *ref; + + /* Substring references don't have the charlength set. */ + ref = c->ref; + while (ref && ref->type != REF_SUBSTRING) + ref = ref->next; + + gcc_assert (ref == NULL || ref->type == REF_SUBSTRING); + + if (!ref) + return SUCCESS; + + start = ref->u.ss.start; + end = ref->u.ss.end; + + gcc_assert (start); + if (end == NULL || end->expr_type != EXPR_CONSTANT + || start->expr_type != EXPR_CONSTANT) + return SUCCESS; + + i = mpz_get_si (end->value.integer) + 1 + - mpz_get_si (start->value.integer); + } + else + return SUCCESS; + + if (i != 1) + { + gfc_error ("Argument of %s at %L must be of length one", + gfc_current_intrinsic, &c->where); + return FAILURE; + } + + return SUCCESS; +} + + +try gfc_check_idnint (gfc_expr * a) { if (double_check (a, 0) == FAILURE) @@ -1008,6 +1095,41 @@ gfc_check_ishftc (gfc_expr * i, gfc_expr * shift, gfc_expr * size) try +gfc_check_kill (gfc_expr * pid, gfc_expr * sig) +{ + if (type_check (pid, 0, BT_INTEGER) == FAILURE) + return FAILURE; + + if (type_check (sig, 1, BT_INTEGER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_kill_sub (gfc_expr * pid, gfc_expr * sig, gfc_expr * status) +{ + if (type_check (pid, 0, BT_INTEGER) == FAILURE) + return FAILURE; + + if (type_check (sig, 1, BT_INTEGER) == FAILURE) + return FAILURE; + + if (status == NULL) + return SUCCESS; + + if (type_check (status, 2, BT_INTEGER) == FAILURE) + return FAILURE; + + if (scalar_check (status, 2) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_kind (gfc_expr * x) { if (x->ts.type == BT_DERIVED) @@ -1039,6 +1161,76 @@ gfc_check_lbound (gfc_expr * array, gfc_expr * dim) try +gfc_check_link (gfc_expr * path1, gfc_expr * path2) +{ + if (type_check (path1, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (type_check (path2, 1, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_link_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status) +{ + if (type_check (path1, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (type_check (path2, 1, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (status == NULL) + return SUCCESS; + + if (type_check (status, 2, BT_INTEGER) == FAILURE) + return FAILURE; + + if (scalar_check (status, 2) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_symlnk (gfc_expr * path1, gfc_expr * path2) +{ + if (type_check (path1, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (type_check (path2, 1, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_symlnk_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status) +{ + if (type_check (path1, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (type_check (path2, 1, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (status == NULL) + return SUCCESS; + + if (type_check (status, 2, BT_INTEGER) == FAILURE) + return FAILURE; + + if (scalar_check (status, 2) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_logical (gfc_expr * a, gfc_expr * kind) { if (type_check (a, 0, BT_LOGICAL) == FAILURE) @@ -1454,6 +1646,41 @@ gfc_check_real (gfc_expr * a, gfc_expr * kind) try +gfc_check_rename (gfc_expr * path1, gfc_expr * path2) +{ + if (type_check (path1, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (type_check (path2, 1, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_rename_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status) +{ + if (type_check (path1, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (type_check (path2, 1, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (status == NULL) + return SUCCESS; + + if (type_check (status, 2, BT_INTEGER) == FAILURE) + return FAILURE; + + if (scalar_check (status, 2) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_repeat (gfc_expr * x, gfc_expr * y) { if (type_check (x, 0, BT_CHARACTER) == FAILURE) @@ -1658,6 +1885,19 @@ gfc_check_size (gfc_expr * array, gfc_expr * dim) try +gfc_check_sleep_sub (gfc_expr * seconds) +{ + if (type_check (seconds, 0, BT_INTEGER) == FAILURE) + return FAILURE; + + if (scalar_check (seconds, 0) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_spread (gfc_expr * source, gfc_expr * dim, gfc_expr * ncopies) { if (source->rank >= GFC_MAX_DIMENSIONS) @@ -2234,6 +2474,16 @@ gfc_check_etime_sub (gfc_expr * values, gfc_expr * time) try +gfc_check_gerror (gfc_expr * msg) +{ + if (type_check (msg, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_getcwd_sub (gfc_expr * cwd, gfc_expr * status) { if (type_check (cwd, 0, BT_CHARACTER) == FAILURE) @@ -2253,6 +2503,16 @@ gfc_check_getcwd_sub (gfc_expr * cwd, gfc_expr * status) try +gfc_check_getlog (gfc_expr * msg) +{ + if (type_check (msg, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_exit (gfc_expr * status) { if (status == NULL) @@ -2285,6 +2545,45 @@ gfc_check_flush (gfc_expr * unit) try +gfc_check_hostnm (gfc_expr * name) +{ + if (type_check (name, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_hostnm_sub (gfc_expr * name, gfc_expr * status) +{ + if (type_check (name, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + if (status == NULL) + return SUCCESS; + + if (scalar_check (status, 1) == FAILURE) + return FAILURE; + + if (type_check (status, 1, BT_INTEGER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try +gfc_check_perror (gfc_expr * string) +{ + if (type_check (string, 0, BT_CHARACTER) == FAILURE) + return FAILURE; + + return SUCCESS; +} + + +try gfc_check_umask (gfc_expr * mask) { if (type_check (mask, 0, BT_INTEGER) == FAILURE) diff --git a/gcc/fortran/convert.c b/gcc/fortran/convert.c index 9759f057f50..a0298f22784 100644 --- a/gcc/fortran/convert.c +++ b/gcc/fortran/convert.c @@ -81,7 +81,7 @@ convert (tree type, tree expr) return expr; if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr))) - return fold (build1 (NOP_EXPR, type, expr)); + return fold_build1 (NOP_EXPR, type, expr); if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK) return error_mark_node; if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE) @@ -106,9 +106,9 @@ convert (tree type, tree expr) /* If we have a NOP_EXPR, we must fold it here to avoid infinite recursion between fold () and convert (). */ if (TREE_CODE (e) == NOP_EXPR) - return fold (build1 (NOP_EXPR, type, TREE_OPERAND (e, 0))); + return fold_build1 (NOP_EXPR, type, TREE_OPERAND (e, 0)); else - return fold (build1 (NOP_EXPR, type, e)); + return fold_build1 (NOP_EXPR, type, e); } if (code == POINTER_TYPE || code == REFERENCE_TYPE) return fold (convert_to_pointer (type, e)); diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 45978c04ddf..2b763d296ab 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -401,7 +401,7 @@ match_old_style_init (const char *name) /* Match the stuff following a DATA statement. If ERROR_FLAG is set, we are matching a DATA statement and are therefore issuing an error if we encounter something unexpected, if not, we're trying to match - an old-style intialization expression of the form INTEGER I /2/. */ + an old-style initialization expression of the form INTEGER I /2/. */ match gfc_match_data (void) @@ -646,6 +646,30 @@ build_sym (const char *name, gfc_charlen * cl, return SUCCESS; } +/* Set character constant to the given length. The constant will be padded or + truncated. */ + +void +gfc_set_constant_character_len (int len, gfc_expr * expr) +{ + char * s; + int slen; + + gcc_assert (expr->expr_type == EXPR_CONSTANT); + gcc_assert (expr->ts.type == BT_CHARACTER && expr->ts.kind == 1); + + slen = expr->value.character.length; + if (len != slen) + { + s = gfc_getmem (len); + memcpy (s, expr->value.character.string, MIN (len, slen)); + if (len > slen) + memset (&s[slen], ' ', len - slen); + gfc_free (expr->value.character.string); + expr->value.character.string = s; + expr->value.character.length = len; + } +} /* Function called by variable_decl() that adds an initialization expression to a symbol. */ @@ -711,6 +735,35 @@ add_init_expr_to_sym (const char *name, gfc_expr ** initp, && gfc_check_assign_symbol (sym, init) == FAILURE) return FAILURE; + if (sym->ts.type == BT_CHARACTER && sym->ts.cl) + { + /* Update symbol character length according initializer. */ + if (sym->ts.cl->length == NULL) + { + if (init->expr_type == EXPR_CONSTANT) + sym->ts.cl->length = + gfc_int_expr (init->value.character.length); + else if (init->expr_type == EXPR_ARRAY) + sym->ts.cl->length = gfc_copy_expr (init->ts.cl->length); + } + /* Update initializer character length according symbol. */ + else if (sym->ts.cl->length->expr_type == EXPR_CONSTANT) + { + int len = mpz_get_si (sym->ts.cl->length->value.integer); + gfc_constructor * p; + + if (init->expr_type == EXPR_CONSTANT) + gfc_set_constant_character_len (len, init); + else if (init->expr_type == EXPR_ARRAY) + { + gfc_free_expr (init->ts.cl->length); + init->ts.cl->length = gfc_copy_expr (sym->ts.cl->length); + for (p = init->value.constructor; p; p = p->next) + gfc_set_constant_character_len (len, p->expr); + } + } + } + /* Add initializer. Make sure we keep the ranks sane. */ if (sym->attr.dimension && init->rank == 0) init->rank = sym->as->rank; @@ -896,7 +949,7 @@ variable_decl (void) /* OK, we've successfully matched the declaration. Now put the symbol in the current namespace, because it might be used in the - optional intialization expression for this symbol, e.g. this is + optional initialization expression for this symbol, e.g. this is perfectly legal: integer, parameter :: i = huge(i) @@ -2354,8 +2407,7 @@ gfc_match_entry (void) || gfc_add_function (&entry->attr, entry->name, NULL) == FAILURE) return MATCH_ERROR; - entry->result = proc->result; - + entry->result = entry; } else { @@ -2370,6 +2422,8 @@ gfc_match_entry (void) || gfc_add_function (&entry->attr, result->name, NULL) == FAILURE) return MATCH_ERROR; + + entry->result = result; } if (proc->attr.recursive && result == NULL) diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c index f8df9dabb12..70f91e4a528 100644 --- a/gcc/fortran/dump-parse-tree.c +++ b/gcc/fortran/dump-parse-tree.c @@ -1,5 +1,5 @@ /* Parse tree dumper - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Steven Bosscher This file is part of GCC. @@ -409,6 +409,8 @@ gfc_show_expr (gfc_expr * p) break; case EXPR_VARIABLE: + if (p->symtree->n.sym->ns && p->symtree->n.sym->ns->proc_name) + gfc_status ("%s:", p->symtree->n.sym->ns->proc_name->name); gfc_status ("%s", p->symtree->n.sym->name); gfc_show_ref (p->ref); break; @@ -663,7 +665,12 @@ gfc_show_symbol (gfc_symbol * sym) gfc_status ("Formal arglist:"); for (formal = sym->formal; formal; formal = formal->next) - gfc_status (" %s", formal->sym->name); + { + if (formal->sym != NULL) + gfc_status (" %s", formal->sym->name); + else + gfc_status (" [Alt Return]"); + } } if (sym->formal_ns) diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index f4a4b589b1f..d0c99e335a0 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -1789,11 +1789,12 @@ gfc_check_assign (gfc_expr * lvalue, gfc_expr * rvalue, int conform) return FAILURE; } - /* This is a guaranteed segfault and possibly a typo: p = NULL() - instead of p => NULL() */ - if (rvalue->expr_type == EXPR_NULL) - gfc_warning ("NULL appears on right-hand side in assignment at %L", - &rvalue->where); + if (rvalue->expr_type == EXPR_NULL) + { + gfc_error ("NULL appears on right-hand side in assignment at %L", + &rvalue->where); + return FAILURE; + } /* This is possibly a typo: x = f() instead of x => f() */ if (gfc_option.warn_surprising diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index 7f04b7ca261..ced6799589d 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -114,7 +114,6 @@ static void gfc_expand_function (tree); #undef LANG_HOOKS_POST_OPTIONS #undef LANG_HOOKS_PRINT_IDENTIFIER #undef LANG_HOOKS_PARSE_FILE -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION #undef LANG_HOOKS_MARK_ADDRESSABLE #undef LANG_HOOKS_TYPE_FOR_MODE #undef LANG_HOOKS_TYPE_FOR_SIZE @@ -133,7 +132,6 @@ static void gfc_expand_function (tree); #define LANG_HOOKS_POST_OPTIONS gfc_post_options #define LANG_HOOKS_PRINT_IDENTIFIER gfc_print_identifier #define LANG_HOOKS_PARSE_FILE gfc_be_parse_file -#define LANG_HOOKS_TRUTHVALUE_CONVERSION gfc_truthvalue_conversion #define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable #define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode #define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size @@ -422,7 +420,7 @@ poplevel (int keep, int reverse, int functionbody) binding level is a function body, or if there are any nested blocks then create a BLOCK node to record them for the life of this function. */ if (keep || functionbody) - block_node = build_block (keep ? decl_chain : 0, 0, subblock_chain, 0, 0); + block_node = build_block (keep ? decl_chain : 0, subblock_chain, 0, 0); /* Record the BLOCK node just built as the subblock its enclosing scope. */ for (subblock_node = subblock_chain; subblock_node; @@ -506,7 +504,7 @@ pushdecl (tree decl) TREE_CHAIN (decl) = current_binding_level->names; current_binding_level->names = decl; - /* For the declartion of a type, set its name if it is not already set. */ + /* For the declaration of a type, set its name if it is not already set. */ if (TREE_CODE (decl) == TYPE_DECL && TYPE_NAME (TREE_TYPE (decl)) == 0) { @@ -682,7 +680,7 @@ builtin_function (const char *name, int function_code, enum built_in_class class, const char *library_name, - tree attrs ATTRIBUTE_UNUSED) + tree attrs) { tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); DECL_EXTERNAL (decl) = 1; @@ -693,6 +691,17 @@ builtin_function (const char *name, pushdecl (decl); DECL_BUILT_IN_CLASS (decl) = class; DECL_FUNCTION_CODE (decl) = function_code; + + /* Possibly apply some default attributes to this built-in function. */ + if (attrs) + { + /* FORNOW the only supported attribute is "const". If others need + to be supported then see the more general solution in procedure + builtin_function in c-decl.c */ + if (lookup_attribute ( "const", attrs )) + TREE_READONLY (decl) = 1; + } + return decl; } @@ -781,15 +790,15 @@ gfc_init_builtin_functions (void) /* We define these separately as the fortran versions have different semantics (they return an integer type) */ - gfc_define_builtin ("__builtin_floor", mfunc_double[0], - BUILT_IN_FLOOR, "floor", true); - gfc_define_builtin ("__builtin_floorf", mfunc_float[0], - BUILT_IN_FLOORF, "floorf", true); gfc_define_builtin ("__builtin_round", mfunc_double[0], BUILT_IN_ROUND, "round", true); gfc_define_builtin ("__builtin_roundf", mfunc_float[0], BUILT_IN_ROUNDF, "roundf", true); - + gfc_define_builtin ("__builtin_trunc", mfunc_double[0], + BUILT_IN_TRUNC, "trunc", true); + gfc_define_builtin ("__builtin_truncf", mfunc_float[0], + BUILT_IN_TRUNCF, "truncf", true); + gfc_define_builtin ("__builtin_cabs", func_cdouble_double, BUILT_IN_CABS, "cabs", true); gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 8be1eb6f252..d17f388212c 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -181,7 +181,7 @@ extern mstring intrinsic_operators[]; /* Arithmetic results. */ typedef enum { ARITH_OK = 1, ARITH_OVERFLOW, ARITH_UNDERFLOW, ARITH_NAN, - ARITH_DIV0, ARITH_0TO0, ARITH_INCOMMENSURATE, ARITH_ASYMMETRIC + ARITH_DIV0, ARITH_INCOMMENSURATE, ARITH_ASYMMETRIC } arith; @@ -292,6 +292,7 @@ enum gfc_generic_isym_id GFC_ISYM_BTEST, GFC_ISYM_CEILING, GFC_ISYM_CHAR, + GFC_ISYM_CHDIR, GFC_ISYM_CMPLX, GFC_ISYM_COMMAND_ARGUMENT_COUNT, GFC_ISYM_CONJG, @@ -317,6 +318,7 @@ enum gfc_generic_isym_id GFC_ISYM_GETGID, GFC_ISYM_GETPID, GFC_ISYM_GETUID, + GFC_ISYM_HOSTNM, GFC_ISYM_IACHAR, GFC_ISYM_IAND, GFC_ISYM_IARGC, @@ -325,15 +327,18 @@ enum gfc_generic_isym_id GFC_ISYM_IBSET, GFC_ISYM_ICHAR, GFC_ISYM_IEOR, + GFC_ISYM_IERRNO, GFC_ISYM_INDEX, GFC_ISYM_INT, GFC_ISYM_IOR, GFC_ISYM_IRAND, GFC_ISYM_ISHFT, GFC_ISYM_ISHFTC, + GFC_ISYM_KILL, GFC_ISYM_LBOUND, GFC_ISYM_LEN, GFC_ISYM_LEN_TRIM, + GFC_ISYM_LINK, GFC_ISYM_LGE, GFC_ISYM_LGT, GFC_ISYM_LLE, @@ -359,6 +364,7 @@ enum gfc_generic_isym_id GFC_ISYM_PRODUCT, GFC_ISYM_RAND, GFC_ISYM_REAL, + GFC_ISYM_RENAME, GFC_ISYM_REPEAT, GFC_ISYM_RESHAPE, GFC_ISYM_RRSPACING, @@ -378,9 +384,12 @@ enum gfc_generic_isym_id GFC_ISYM_SR_KIND, GFC_ISYM_STAT, GFC_ISYM_SUM, + GFC_ISYM_SYMLNK, GFC_ISYM_SYSTEM, GFC_ISYM_TAN, GFC_ISYM_TANH, + GFC_ISYM_TIME, + GFC_ISYM_TIME8, GFC_ISYM_TRANSFER, GFC_ISYM_TRANSPOSE, GFC_ISYM_TRIM, @@ -422,6 +431,9 @@ typedef struct /* Set if this is the master function for a procedure with multiple entry points. */ unsigned entry_master:1; + /* Set if this is the master function for a function with multiple + entry points where characteristics of the entry points differ. */ + unsigned mixed_entry_master:1; /* Set if a function must always be referenced by an explicit interface. */ unsigned always_explicit:1; @@ -472,6 +484,8 @@ typedef struct gfc_linebuf struct gfc_file *file; struct gfc_linebuf *next; + int truncated; + char line[1]; } gfc_linebuf; @@ -806,7 +820,7 @@ typedef struct gfc_namespace gfc_charlen *cl_list; - int save_all, seen_save; + int save_all, seen_save, seen_implicit_none; /* Normally we don't need to refcount namespaces. However when we read a module containing a function with multiple entry points, this @@ -831,7 +845,7 @@ typedef struct gfc_gsymbol { BBT_HEADER(gfc_gsymbol); - char name[GFC_MAX_SYMBOL_LEN+1]; + const char *name; enum { GSYM_UNKNOWN=1, GSYM_PROGRAM, GSYM_FUNCTION, GSYM_SUBROUTINE, GSYM_MODULE, GSYM_COMMON, GSYM_BLOCK_DATA } type; @@ -1137,7 +1151,7 @@ extern gfc_logical_info gfc_logical_kinds[]; typedef struct { - mpfr_t epsilon, huge, tiny; + mpfr_t epsilon, huge, tiny, subnormal; int kind, radix, digits, min_exponent, max_exponent; int range, precision; @@ -1393,6 +1407,9 @@ typedef struct int warn_surprising; int warn_unused_labels; + int flag_default_double; + int flag_default_integer; + int flag_default_real; int flag_dollar_ok; int flag_underscoring; int flag_second_underscore; @@ -1402,11 +1419,10 @@ typedef struct int flag_no_backend; int flag_pack_derived; int flag_repack_arrays; + int flag_f2c; int q_kind; - int r8; - int i8; - int d8; + int warn_std; int allow_std; int warn_nonstd_intrinsics; diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index c3242f7b5a3..67867bc6c08 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -109,25 +109,31 @@ the GNU Fortran 95 compiler. You can find in this manual how to invoke @ifset DEVELOPMENT @emph{Warning:} This document, and the compiler it describes, are still -under development. While efforts are made too keep it up-to-date it might +under development. While efforts are made to keep it up-to-date, it might not accurately reflect the status of the most recent @command{gfortran}. @end ifset +@comment +@comment When you add a new menu item, please keep the right hand +@comment aligned to the same column. Do not use tabs. This provides +@comment better formatting. +@comment @menu -* Copying:: GNU General Public License says - how you can copy and share GNU Fortran. +* Copying:: GNU General Public License says + how you can copy and share GNU Fortran. * GNU Free Documentation License:: - How you can copy and share this manual. -* Funding:: How to help assure continued work for free software. -* Getting Started:: What you should know about @command{gfortran}. -* GFORTRAN and GCC:: You can compile Fortran, C, or other programs. -* GFORTRAN and G77:: Why we choose to start from scratch. + How you can copy and share this manual. +* Funding:: How to help assure continued work for free software. +* Getting Started:: What you should know about @command{gfortran}. +* GFORTRAN and GCC:: You can compile Fortran, C, or other programs. +* GFORTRAN and G77:: Why we chose to start from scratch. * Invoking GFORTRAN:: Command options supported by @command{gfortran}. -* Project Status:: Status of @command{gfortran}, Roadmap, proposed extensions. -* Contributing:: Helping you can help. -* Standards:: Standards supported by @command{gfortran} -* Extensions:: Language extensions implemented by @command{gfortran} -* Index:: Index of this documentation. +* Project Status:: Status of @command{gfortran}, roadmap, proposed extensions. +* Contributing:: How you can help. +* Standards:: Standards supported by @command{gfortran} +* Extensions:: Language extensions implemented by @command{gfortran} +* Intrinsic Procedures:: Intrinsic procedures supported by @command{gfortran} +* Index:: Index of this documentation. @end menu @@ -369,7 +375,6 @@ because it was expected to be easier to maintain code we develop ourselves than to do a major overhaul of @command{g77} first, and then build a Fortran 95 compiler out of it. - @include invoke.texi @c --------------------------------------------------------------------- @@ -454,7 +459,6 @@ Usable with bugs: @itemize @minus @item Formatted sequential ('T' edit descriptor, and others) -@item Namelist (can read a namelist that it writes, but not free-form) @end itemize Not recommended: @@ -569,9 +573,6 @@ Set precision for fp units that support it (i387). Variables for setting fp rounding mode. @item -Support old style namelists ending in $end or &end. - -@item Variable to fill uninitialized variables with a user-defined bit pattern. @@ -622,6 +623,7 @@ meaning. @menu * Old-style kind specifications:: * Old-style variable initialization:: +* Extensions to namelist:: @end menu @node Old-style kind specifications @@ -670,6 +672,55 @@ Examples of standard conforming code equivalent to the above example, are: DATA i,j,x /1,2,3*0.,1./ @end smallexample +@node Extensions to namelist +@section Extensions to namelist +@cindex Namelist + +@command{gfortran} fully supports the fortran95 standard for namelist io +including array qualifiers, substrings and fully qualified derived types. +The output from a namelist write is compatible with namelist read. The +output has all names in upper case and indentation to column 1 after the +namelist name. Two extensions are permitted: + +Old-style use of $ instead of & +@smallexample +$MYNML + X(:)%Y(2) = 1.0 2.0 3.0 + CH(1:4) = "abcd" +$END +@end smallexample + +It should be noticed that the default terminator is / rather than &END. + +Querying of the namelist when inputting from stdin. After at least +one space, entering ? sends to stdout the namelist name and the names of +the variables in the namelist: +@smallexample +? + +&mynml + x + x%y + ch +&end +@end smallexample + +Entering =? outputs the namelist to stdout, as if WRITE (*,NML = mynml) +had been called: +@smallexample +=? + +&MYNML + X(1)%Y= 0.000000 , 1.000000 , 0.000000 , + X(2)%Y= 0.000000 , 2.000000 , 0.000000 , + X(3)%Y= 0.000000 , 3.000000 , 0.000000 , + CH=abcd, / +@end smallexample + +To aid this dialog, when input is from stdin, errors produce send their +messages to stderr and execution continues, even if IOSTAT is set. + +@include intrinsic.texi @c --------------------------------------------------------------------- @c Contributing @c --------------------------------------------------------------------- diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index ecbf9a27aac..5b848bc0a20 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -41,7 +41,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA Generic interfaces: The generic name points to a linked list of symbols. Each symbol - has an explicit interface. Each explicit interface has it's own + has an explicit interface. Each explicit interface has its own namespace containing the arguments. Module procedures are symbols in which the interface is added later when the module procedure is parsed. @@ -763,7 +763,7 @@ operator_correspondence (gfc_formal_arglist * f1, gfc_formal_arglist * f2) /* Perform the correspondence test in rule 2 of section 14.1.2.3. - Returns zero if no argument is found that satisifes rule 2, nonzero + Returns zero if no argument is found that satisfies rule 2, nonzero otherwise. This test is also not symmetric in f1 and f2 and must be called @@ -1096,7 +1096,7 @@ compare_parameter (gfc_symbol * formal, gfc_expr * actual, return compare_interfaces (formal, actual->symtree->n.sym, 0); } - if (actual->expr_type != EXPR_NULL + if ((actual->expr_type != EXPR_NULL || actual->ts.type != BT_UNKNOWN) && !gfc_compare_types (&formal->ts, &actual->ts)) return 0; diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index ebf5cb2edda..0b50cdcaa11 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -1092,6 +1092,12 @@ add_functions (void) make_generic ("char", GFC_ISYM_CHAR, GFC_STD_F77); + add_sym_1 ("chdir", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_chdir, NULL, gfc_resolve_chdir, + a, BT_CHARACTER, dc, REQUIRED); + + make_generic ("chdir", GFC_ISYM_CHDIR, GFC_STD_GNU); + add_sym_3 ("cmplx", 1, 1, BT_COMPLEX, dz, GFC_STD_F77, gfc_check_cmplx, gfc_simplify_cmplx, gfc_resolve_cmplx, x, BT_UNKNOWN, dr, REQUIRED, y, BT_UNKNOWN, dr, OPTIONAL, @@ -1323,6 +1329,12 @@ add_functions (void) make_generic ("getuid", GFC_ISYM_GETUID, GFC_STD_GNU); + add_sym_1 ("hostnm", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_hostnm, NULL, gfc_resolve_hostnm, + a, BT_CHARACTER, dc, REQUIRED); + + make_generic ("hostnm", GFC_ISYM_HOSTNM, GFC_STD_GNU); + add_sym_1 ("huge", 0, 1, BT_REAL, dr, GFC_STD_F95, gfc_check_huge, gfc_simplify_huge, NULL, x, BT_UNKNOWN, dr, REQUIRED); @@ -1330,7 +1342,7 @@ add_functions (void) make_generic ("huge", GFC_ISYM_NONE, GFC_STD_F95); add_sym_1 ("iachar", 1, 1, BT_INTEGER, di, GFC_STD_F95, - NULL, gfc_simplify_iachar, NULL, + gfc_check_ichar_iachar, gfc_simplify_iachar, NULL, c, BT_CHARACTER, dc, REQUIRED); make_generic ("iachar", GFC_ISYM_IACHAR, GFC_STD_F95); @@ -1372,7 +1384,7 @@ add_functions (void) make_generic ("ibset", GFC_ISYM_IBSET, GFC_STD_F95); add_sym_1 ("ichar", 1, 0, BT_INTEGER, di, GFC_STD_F77, - NULL, gfc_simplify_ichar, gfc_resolve_ichar, + gfc_check_ichar_iachar, gfc_simplify_ichar, gfc_resolve_ichar, c, BT_CHARACTER, dc, REQUIRED); make_generic ("ichar", GFC_ISYM_ICHAR, GFC_STD_F77); @@ -1383,6 +1395,11 @@ add_functions (void) make_generic ("ieor", GFC_ISYM_IEOR, GFC_STD_F95); + add_sym_0 ("ierrno", 1, 0, BT_INTEGER, di, GFC_STD_GNU, + NULL, NULL, gfc_resolve_ierrno); + + make_generic ("ierrno", GFC_ISYM_IERRNO, GFC_STD_GNU); + add_sym_3 ("index", 1, 1, BT_INTEGER, di, GFC_STD_F77, gfc_check_index, gfc_simplify_index, NULL, stg, BT_CHARACTER, dc, REQUIRED, ssg, BT_CHARACTER, dc, REQUIRED, @@ -1430,6 +1447,12 @@ add_functions (void) make_generic ("ishftc", GFC_ISYM_ISHFTC, GFC_STD_F95); + add_sym_2 ("kill", 1, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_kill, NULL, gfc_resolve_kill, + a, BT_INTEGER, di, REQUIRED, b, BT_INTEGER, di, REQUIRED); + + make_generic ("kill", GFC_ISYM_KILL, GFC_STD_GNU); + add_sym_1 ("kind", 0, 1, BT_INTEGER, di, GFC_STD_F95, gfc_check_kind, gfc_simplify_kind, NULL, x, BT_REAL, dr, REQUIRED); @@ -1452,6 +1475,8 @@ add_functions (void) NULL, gfc_simplify_len_trim, gfc_resolve_len_trim, stg, BT_CHARACTER, dc, REQUIRED); + make_alias ("lnblnk", GFC_STD_GNU); + make_generic ("len_trim", GFC_ISYM_LEN_TRIM, GFC_STD_F95); add_sym_2 ("lge", 1, 0, BT_LOGICAL, dl, GFC_STD_F77, @@ -1478,6 +1503,12 @@ add_functions (void) make_generic ("llt", GFC_ISYM_LLT, GFC_STD_F77); + add_sym_2 ("link", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_link, NULL, gfc_resolve_link, + a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED); + + make_generic ("link", GFC_ISYM_LINK, GFC_STD_GNU); + add_sym_1 ("log", 1, 1, BT_REAL, dr, GFC_STD_F77, gfc_check_fn_rc, gfc_simplify_log, gfc_resolve_log, x, BT_REAL, dr, REQUIRED); @@ -1744,6 +1775,12 @@ add_functions (void) make_generic ("real", GFC_ISYM_REAL, GFC_STD_F77); + add_sym_2 ("rename", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_rename, NULL, gfc_resolve_rename, + a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED); + + make_generic ("rename", GFC_ISYM_RENAME, GFC_STD_GNU); + add_sym_2 ("repeat", 0, 1, BT_CHARACTER, dc, GFC_STD_F95, gfc_check_repeat, gfc_simplify_repeat, gfc_resolve_repeat, stg, BT_CHARACTER, dc, REQUIRED, n, BT_INTEGER, di, REQUIRED); @@ -1904,6 +1941,12 @@ add_functions (void) make_generic ("sum", GFC_ISYM_SUM, GFC_STD_F95); + add_sym_2 ("symlnk", 0, 1, BT_INTEGER, di, GFC_STD_GNU, + gfc_check_symlnk, NULL, gfc_resolve_symlnk, + a, BT_CHARACTER, dc, REQUIRED, b, BT_CHARACTER, dc, REQUIRED); + + make_generic ("symlnk", GFC_ISYM_SYMLNK, GFC_STD_GNU); + add_sym_1 ("system", 1, 1, BT_INTEGER, di, GFC_STD_GNU, NULL, NULL, NULL, c, BT_CHARACTER, dc, REQUIRED); @@ -1930,6 +1973,16 @@ add_functions (void) make_generic ("tanh", GFC_ISYM_TANH, GFC_STD_F77); + add_sym_0 ("time", 1, 0, BT_INTEGER, di, GFC_STD_GNU, + NULL, NULL, gfc_resolve_time); + + make_generic ("time", GFC_ISYM_TIME, GFC_STD_GNU); + + add_sym_0 ("time8", 1, 0, BT_INTEGER, di, GFC_STD_GNU, + NULL, NULL, gfc_resolve_time8); + + make_generic ("time8", GFC_ISYM_TIME8, GFC_STD_GNU); + add_sym_1 ("tiny", 0, 1, BT_REAL, dr, GFC_STD_F95, gfc_check_x, gfc_simplify_tiny, NULL, x, BT_REAL, dr, REQUIRED); @@ -2024,6 +2077,10 @@ add_subroutines (void) gfc_check_second_sub, NULL, gfc_resolve_second_sub, tm, BT_REAL, dr, REQUIRED); + add_sym_2s ("chdir", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_chdir_sub, NULL, gfc_resolve_chdir_sub, + name, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + add_sym_4s ("date_and_time", 0, 1, BT_UNKNOWN, 0, GFC_STD_F95, gfc_check_date_and_time, NULL, NULL, dt, BT_CHARACTER, dc, OPTIONAL, tm, BT_CHARACTER, dc, OPTIONAL, @@ -2038,6 +2095,10 @@ add_subroutines (void) gfc_check_etime_sub, NULL, gfc_resolve_etime_sub, vl, BT_REAL, 4, REQUIRED, tm, BT_REAL, 4, REQUIRED); + add_sym_1s ("gerror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_gerror, NULL, gfc_resolve_gerror, c, BT_CHARACTER, + dc, REQUIRED); + add_sym_2s ("getcwd", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_getcwd_sub, NULL, gfc_resolve_getcwd_sub, c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); @@ -2050,6 +2111,10 @@ add_subroutines (void) NULL, NULL, gfc_resolve_getarg, c, BT_INTEGER, di, REQUIRED, vl, BT_CHARACTER, dc, REQUIRED); + add_sym_1s ("getlog", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_getlog, NULL, gfc_resolve_getlog, c, BT_CHARACTER, + dc, REQUIRED); + /* F2003 commandline routines. */ add_sym_3s ("get_command", 0, 1, BT_UNKNOWN, 0, GFC_STD_F2003, @@ -2098,6 +2163,32 @@ add_subroutines (void) gfc_check_flush, NULL, gfc_resolve_flush, c, BT_INTEGER, di, OPTIONAL); + add_sym_2s ("hostnm", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_hostnm_sub, NULL, gfc_resolve_hostnm_sub, + c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + + add_sym_3s ("kill", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_kill_sub, + NULL, gfc_resolve_kill_sub, c, BT_INTEGER, di, REQUIRED, + val, BT_INTEGER, di, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + + add_sym_3s ("link", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_link_sub, NULL, gfc_resolve_link_sub, + name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER, + dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + + add_sym_1s ("perror", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_perror, NULL, gfc_resolve_perror, + c, BT_CHARACTER, dc, REQUIRED); + + add_sym_3s ("rename", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_rename_sub, NULL, gfc_resolve_rename_sub, + name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER, + dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + + add_sym_1s ("sleep", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_sleep_sub, NULL, gfc_resolve_sleep_sub, + val, BT_CHARACTER, dc, REQUIRED); + add_sym_3s ("fstat", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, gfc_check_fstat_sub, NULL, gfc_resolve_fstat_sub, ut, BT_INTEGER, di, REQUIRED, vl, BT_INTEGER, di, REQUIRED, @@ -2108,6 +2199,11 @@ add_subroutines (void) name, BT_CHARACTER, dc, REQUIRED, vl, BT_INTEGER, di, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + add_sym_3s ("symlnk", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, + gfc_check_symlnk_sub, NULL, gfc_resolve_symlnk_sub, + name, BT_CHARACTER, dc, REQUIRED, val, BT_CHARACTER, + dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); + add_sym_2s ("system", 0, 1, BT_UNKNOWN, 0, GFC_STD_GNU, NULL, NULL, gfc_resolve_system_sub, c, BT_CHARACTER, dc, REQUIRED, st, BT_INTEGER, di, OPTIONAL); diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h index 3f5fcba3736..15171d1aa14 100644 --- a/gcc/fortran/intrinsic.h +++ b/gcc/fortran/intrinsic.h @@ -40,6 +40,7 @@ try gfc_check_atan2 (gfc_expr *, gfc_expr *); try gfc_check_besn (gfc_expr *, gfc_expr *); try gfc_check_btest (gfc_expr *, gfc_expr *); try gfc_check_char (gfc_expr *, gfc_expr *); +try gfc_check_chdir (gfc_expr *); try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_count (gfc_expr *, gfc_expr *); try gfc_check_cshift (gfc_expr *, gfc_expr *, gfc_expr *); @@ -55,12 +56,14 @@ try gfc_check_fn_r (gfc_expr *); try gfc_check_fn_rc (gfc_expr *); try gfc_check_fnum (gfc_expr *); try gfc_check_g77_math1 (gfc_expr *); +try gfc_check_hostnm (gfc_expr *); try gfc_check_huge (gfc_expr *); try gfc_check_i (gfc_expr *); try gfc_check_iand (gfc_expr *, gfc_expr *); try gfc_check_ibclr (gfc_expr *, gfc_expr *); try gfc_check_ibits (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_ibset (gfc_expr *, gfc_expr *); +try gfc_check_ichar_iachar (gfc_expr *); try gfc_check_idnint (gfc_expr *); try gfc_check_ieor (gfc_expr *, gfc_expr *); try gfc_check_index (gfc_expr *, gfc_expr *, gfc_expr *); @@ -69,8 +72,10 @@ try gfc_check_ior (gfc_expr *, gfc_expr *); try gfc_check_irand (gfc_expr *); try gfc_check_ishft (gfc_expr *, gfc_expr *); try gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_kill (gfc_expr *, gfc_expr *); try gfc_check_kind (gfc_expr *); try gfc_check_lbound (gfc_expr *, gfc_expr *); +try gfc_check_link (gfc_expr *, gfc_expr *); try gfc_check_logical (gfc_expr *, gfc_expr *); try gfc_check_min_max (gfc_actual_arglist *); try gfc_check_min_max_integer (gfc_actual_arglist *); @@ -90,6 +95,7 @@ try gfc_check_radix (gfc_expr *); try gfc_check_rand (gfc_expr *); try gfc_check_range (gfc_expr *); try gfc_check_real (gfc_expr *, gfc_expr *); +try gfc_check_rename (gfc_expr *, gfc_expr *); try gfc_check_repeat (gfc_expr *, gfc_expr *); try gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_scale (gfc_expr *, gfc_expr *); @@ -105,6 +111,7 @@ try gfc_check_spread (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_srand (gfc_expr *); try gfc_check_stat (gfc_expr *, gfc_expr *); try gfc_check_sum (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_symlnk (gfc_expr *, gfc_expr *); try gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_transpose (gfc_expr *); try gfc_check_trim (gfc_expr *); @@ -117,18 +124,28 @@ try gfc_check_x (gfc_expr *); /* Intrinsic subroutines. */ +try gfc_check_chdir_sub (gfc_expr *, gfc_expr *); try gfc_check_cpu_time (gfc_expr *); try gfc_check_system_clock (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_date_and_time (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_exit (gfc_expr *); try gfc_check_flush (gfc_expr *); try gfc_check_fstat_sub (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_gerror (gfc_expr *); +try gfc_check_getlog (gfc_expr *); try gfc_check_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_random_number (gfc_expr *); try gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_etime_sub (gfc_expr *, gfc_expr *); try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *); +try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *); +try gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_perror (gfc_expr *); +try gfc_check_rename_sub (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_link_sub (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_symlnk_sub (gfc_expr *, gfc_expr *, gfc_expr *); +try gfc_check_sleep_sub (gfc_expr *); try gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *); try gfc_check_system_sub (gfc_expr *, gfc_expr *); try gfc_check_umask_sub (gfc_expr *, gfc_expr *); @@ -256,6 +273,7 @@ void gfc_resolve_besn (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_btest (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ceiling (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_char (gfc_expr *, gfc_expr *, gfc_expr *); +void gfc_resolve_chdir (gfc_expr *, gfc_expr *); void gfc_resolve_cmplx (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_dcmplx (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_conjg (gfc_expr *, gfc_expr *); @@ -281,10 +299,12 @@ void gfc_resolve_getcwd (gfc_expr *, gfc_expr *); void gfc_resolve_getgid (gfc_expr *); void gfc_resolve_getpid (gfc_expr *); void gfc_resolve_getuid (gfc_expr *); +void gfc_resolve_hostnm (gfc_expr *, gfc_expr *); void gfc_resolve_iand (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ibclr (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ibits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ibset (gfc_expr *, gfc_expr *, gfc_expr *); +void gfc_resolve_ierrno (gfc_expr *); void gfc_resolve_ieor (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ichar (gfc_expr *, gfc_expr *); void gfc_resolve_idnint (gfc_expr *, gfc_expr *); @@ -292,9 +312,11 @@ void gfc_resolve_int (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ior (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ishft (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_ishftc (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); +void gfc_resolve_kill (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_lbound (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_len (gfc_expr *, gfc_expr *); void gfc_resolve_len_trim (gfc_expr *, gfc_expr *); +void gfc_resolve_link (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_log (gfc_expr *, gfc_expr *); void gfc_resolve_log10 (gfc_expr *, gfc_expr *); void gfc_resolve_logical (gfc_expr *, gfc_expr *, gfc_expr *); @@ -314,6 +336,7 @@ void gfc_resolve_not (gfc_expr *, gfc_expr *); void gfc_resolve_pack (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_product (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_real (gfc_expr *, gfc_expr *, gfc_expr *); +void gfc_resolve_rename (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_repeat (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); @@ -332,9 +355,12 @@ void gfc_resolve_sqrt (gfc_expr *, gfc_expr *); void gfc_resolve_stat (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_srand (gfc_code *); void gfc_resolve_sum (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); +void gfc_resolve_symlnk (gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_system (gfc_expr *, gfc_expr *); void gfc_resolve_tan (gfc_expr *, gfc_expr *); void gfc_resolve_tanh (gfc_expr *, gfc_expr *); +void gfc_resolve_time (gfc_expr *); +void gfc_resolve_time8 (gfc_expr *); void gfc_resolve_transfer (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); void gfc_resolve_transpose (gfc_expr *, gfc_expr *); void gfc_resolve_trim (gfc_expr *, gfc_expr *); @@ -346,17 +372,27 @@ void gfc_resolve_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *); /* Intrinsic subroutine resolution. */ +void gfc_resolve_chdir_sub (gfc_code *); void gfc_resolve_cpu_time (gfc_code *); void gfc_resolve_exit (gfc_code *); void gfc_resolve_flush (gfc_code *); void gfc_resolve_fstat_sub (gfc_code *); +void gfc_resolve_gerror (gfc_code *); void gfc_resolve_getarg (gfc_code *); void gfc_resolve_getcwd_sub (gfc_code *); +void gfc_resolve_getlog (gfc_code *); void gfc_resolve_get_command (gfc_code *); void gfc_resolve_get_command_argument (gfc_code *); void gfc_resolve_get_environment_variable (gfc_code *); +void gfc_resolve_hostnm_sub (gfc_code *); +void gfc_resolve_kill_sub (gfc_code *); void gfc_resolve_mvbits (gfc_code *); +void gfc_resolve_perror (gfc_code *); void gfc_resolve_random_number (gfc_code *); +void gfc_resolve_rename_sub (gfc_code *); +void gfc_resolve_link_sub (gfc_code *); +void gfc_resolve_symlnk_sub (gfc_code *); +void gfc_resolve_sleep_sub (gfc_code *); void gfc_resolve_stat_sub (gfc_code *); void gfc_resolve_system_clock (gfc_code *); void gfc_resolve_system_sub (gfc_code *); diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi new file mode 100644 index 00000000000..ad09185bd45 --- /dev/null +++ b/gcc/fortran/intrinsic.texi @@ -0,0 +1,2028 @@ +@ignore +Copyright (C) 2005 +Free Software Foundation, Inc. +This is part of the GFORTRAN manual. +For copying conditions, see the file gfortran.texi. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with the +Invariant Sections being ``GNU General Public License'' and ``Funding +Free Software'', the Front-Cover texts being (a) (see below), and with +the Back-Cover Texts being (b) (see below). A copy of the license is +included in the gfdl(7) man page. + + +Some basic guidelines for editing this document: + + (1) The intrinsic procedures are to be listed in alphabetical order. + (2) The generic name is to be use. + (3) The specific names are included in the function index and in a + table at the end of the node (See ABS entry). + (4) Try to maintain the same style for each entry. + + +@end ignore + +@node Intrinsic Procedures +@chapter Intrinsic Procedures +@cindex Intrinsic Procedures + +This portion of the document is incomplete and undergoing massive expansion +and editing. All contributions and corrections are strongly encouraged. + +@menu +* Introduction: Introduction +* @code{ABORT}: ABORT, Abort the program +* @code{ABS}: ABS, Absolute value +* @code{ACHAR}: ACHAR, Character in @acronym{ASCII} collating sequence +* @code{ACOS}: ACOS, Arccosine function +* @code{ADJUSTL}: ADJUSTL, Left adjust a string +* @code{ADJUSTR}: ADJUSTR, Right adjust a string +* @code{AIMAG}: AIMAG, Imaginary part of complex number +* @code{AINT}: AINT, Truncate to a whole number +* @code{ALL}: ALL, Determine if all values are true +* @code{ALLOCATED}: ALLOCATED, Status of allocatable entity +* @code{ANINT}: ANINT, Nearest whole number +* @code{ANY}: ANY, Determine if any values are true +* @code{ASIN}: ASIN, Arcsine function +* @code{ASSOCIATED}: ASSOCIATED, Status of a pointer or pointer/target pair +* @code{ATAN}: ATAN, Arctangent function +* @code{ATAN2}: ATAN2, Arctangent function +* @code{BESJ0}: BESJ0, Bessel function of the first kind of order 0 +* @code{BESJ1}: BESJ1, Bessel function of the first kind of order 1 +* @code{BESJN}: BESJN, Bessel function of the first kind +* @code{BESY0}: BESY0, Bessel function of the second kind of order 0 +* @code{BESY1}: BESY1, Bessel function of the second kind of order 1 +* @code{BESYN}: BESYN, Bessel function of the second kind +* @code{COS}: COS, Cosine function +* @code{COSH}: COSH, Hyperbolic cosine function +* @code{ERF}: ERF, Error function +* @code{ERFC}: ERFC, Complementary error function +* @code{EXP}: EXP, Cosine function +* @code{LOG}: LOG, Logarithm function +* @code{LOG10}: LOG10, Base 10 logarithm function +* @code{SQRT}: SQRT, Square-root function +* @code{SIN}: SIN, Sine function +* @code{SINH}: SINH, Hyperbolic sine function +* @code{TAN}: TAN, Tangent function +* @code{TANH}: TANH, Hyperbolic tangent function +@end menu + +@node Introduction +@section Introduction to intrinsic procedures + +Gfortran provides a rich set of intrinsic procedures that includes all +the intrinsic procedures required by the Fortran 95 standard, a set of +intrinsic procedures for backwards compatibility with Gnu Fortran 77 +(i.e., @command{g77}), and a small selection of intrinsic procedures +from the Fortran 2003 standard. Any description here, which conflicts with a +description in either the Fortran 95 standard or the Fortran 2003 standard, +is unintentional and the standard(s) should be considered authoritative. + +The enumeration of the @code{KIND} type parameter is processor defined in +the Fortran 95 standard. Gfortran defines the default integer type and +default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)}, +respectively. The standard mandates that both data types shall have +another kind, which have more precision. On typical target architectures +supports by @command{gfortran}, this kind type parameter is @code{KIND=8}. +Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent. +In the description of generic intrinsic procedures, the kind type parameter +will be specified by @code{KIND=*}, and in the description of specific +names for an intrinsic procedure the kind type parameter will be explicitly +given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}). Finally, for +brevity the optional @code{KIND=} syntax will be omitted. + +Many of the intrinsics procedures take one or more optional arguments. +This document follows the convention used in the Fortran 95 standard, +and denotes such arguments by square brackets. + +@command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options, +which can be used to restrict the set of intrinsic procedures to a +given standard. By default, @command{gfortran} sets the @option{-std=gnu} +option, and so all intrinsic procedures describe here are accepted. There +is one caveat. For a select group of intrinsic procedures, @command{g77} +implemented both a function and a subroutine. Both classes +have been implemented in @command{gfortran} for backwards compatibility +with @command{g77}. It is noted here that these functions and subroutines +cannot be intermixed in a given subprogram. In the descriptions that follow, +the applicable option(s) is noted. + + + +@node ABORT +@section @code{ABORT} --- Abort the program +@findex @code{ABORT} +@cindex abort + +@table @asis +@item @emph{Description}: +@code{ABORT} causes immediate termination of the program. On operating +systems that support a core dump, @code{ABORT} will produce a core dump, +which is suitable for debugging purposes. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +non-elemental subroutine + +@item @emph{Syntax}: +@code{CALL ABORT} + +@item @emph{Return value}: +Does not return. + +@item @emph{Example}: +@smallexample +program test_abort + integer :: i = 1, j = 2 + if (i /= j) call abort +end program test_abort +@end smallexample +@end table + + + +@node ABS +@section @code{ABS} --- Absolute value +@findex @code{ABS} intrinsic +@findex @code{CABS} intrinsic +@findex @code{DABS} intrinsic +@findex @code{IABS} intrinsic +@findex @code{ZABS} intrinsic +@findex @code{CDABS} intrinsic +@cindex absolute value + +@table @asis +@item @emph{Description}: +@code{ABS(X)} computes the absolute value of @code{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ABS(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)}, +@code{REAL(*)}, or @code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of the same type and +kind as the argument except the return value is @code{REAL(*)} for a +@code{COMPLEX(*)} argument. + +@item @emph{Example}: +@smallexample +program test_abs + integer :: i = -1 + real :: x = -1.e0 + complex :: z = (-1.e0,0.e0) + i = abs(i) + x = abs(x) + x = abs(z) +end program test_abs +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{CABS(Z)} @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)} @tab f95, gnu +@item @code{DABS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{IABS(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu +@item @code{ZABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu +@item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu +@end multitable +@end table + + + +@node ACHAR +@section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence +@findex @code{ACHAR} intrinsic +@cindex @acronym{ASCII} collating sequence + +@table @asis +@item @emph{Description}: +@code{ACHAR(I)} returns the character located at position @code{I} +in the @acronym{ASCII} collating sequence. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{C = ACHAR(I)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{I} @tab The type shall be an @code{INTEGER(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{CHARACTER} with a length of one. The +kind type parameter is the same as @code{KIND('A')}. + +@item @emph{Example}: +@smallexample +program test_achar + character c + c = achar(32) +end program test_achar +@end smallexample +@end table + + + +@node ACOS +@section @code{ACOS} --- Arccosine function +@findex @code{ACOS} intrinsic +@findex @code{DACOS} intrinsic +@cindex arccosine + +@table @asis +@item @emph{Description}: +@code{ACOS(X)} computes the arccosine of its @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ACOS(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and a magnitude that is +less than one. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and it lies in the +range @math{ 0 \leq \arccos (x) \leq \pi}. The kind type +parameter is the same as @var{X}. + +@item @emph{Example}: +@smallexample +program test_acos + real(8) :: x = 0.866_8 + x = achar(x) +end program test_acos +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + + +@node ADJUSTL +@section @code{ADJUSTL} --- Left adjust a string +@findex @code{ADJUSTL} intrinsic +@cindex adjust string + +@table @asis +@item @emph{Description}: +@code{ADJUSTL(STR)} will left adjust a string by removing leading spaces. +Spaces are inserted at the end of the string as needed. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{STR = ADJUSTL(STR)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{STR} @tab The type shall be @code{CHARACTER}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{CHARACTER} where leading spaces +are removed and the same number of spaces are inserted on the end +of @var{STR}. + +@item @emph{Example}: +@smallexample +program test_adjustl + character(len=20) :: str = ' gfortran' + str = adjustl(str) + print *, str +end program test_adjustl +@end smallexample +@end table + + +@node ADJUSTR +@section @code{ADJUSTR} --- Right adjust a string +@findex @code{ADJUSTR} intrinsic +@cindex adjust string + +@table @asis +@item @emph{Description}: +@code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces. +Spaces are inserted at the start of the string as needed. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{STR = ADJUSTR(STR)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{STR} @tab The type shall be @code{CHARACTER}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{CHARACTER} where trailing spaces +are removed and the same number of spaces are inserted at the start +of @var{STR}. + +@item @emph{Example}: +@smallexample +program test_adjustr + character(len=20) :: str = 'gfortran' + str = adjustr(str) + print *, str +end program test_adjustr +@end smallexample +@end table + + +@node AIMAG +@section @code{AIMAG} --- Imaginary part of complex number +@findex @code{AIMAG} intrinsic +@findex @code{DIMAG} intrinsic +@cindex Imaginary part + +@table @asis +@item @emph{Description}: +@code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = AIMAG(Z)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type real with the +kind type parameter of the argument. + +@item @emph{Example}: +@smallexample +program test_aimag + complex(4) z4 + complex(8) z8 + z4 = cmplx(1.e0_4, 0.e0_4) + z8 = cmplx(0.e0_8, 1.e0_8) + print *, aimag(z4), dimag(z8) +end program test_aimag +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node AINT +@section @code{AINT} --- Imaginary part of complex number +@findex @code{AINT} intrinsic +@findex @code{DINT} intrinsic +@cindex whole number + +@table @asis +@item @emph{Description}: +@code{AINT(X [, KIND])} truncates its argument to a whole number. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = AINT(X)} @* +@code{X = AINT(X, KIND)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type of the argument shall be @code{REAL(*)}. +@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer +initialization expression. +@end multitable + +@item @emph{Return value}: +The return value is of type real with the kind type parameter of the +argument if the optional @var{KIND} is absence; otherwise, the kind +type parameter will be given by @var{KIND}. If the magnitude of +@var{X} is less than one, then @code{AINT(X)} returns zero. If the +magnitude is equal to or greater than one, then it returns the largest +whole number that does not exceed its magnitude. The sign is the same +as the sign of @var{X}. + +@item @emph{Example}: +@smallexample +program test_aint + real(4) x4 + real(8) x8 + x4 = 1.234E0_4 + x8 = 4.321_8 + print *, aint(x4), dint(x8) + x8 = aint(x4,8) +end program test_aint +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node ALL +@section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true +@findex @code{ALL} intrinsic +@cindex true values + +@table @asis +@item @emph{Description}: +@code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK} +in the array along dimension @var{DIM}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +transformational function + +@item @emph{Syntax}: +@code{L = ALL(MASK)} @* +@code{L = ALL(MASK, DIM)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and +it shall not be scalar. +@item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer +with a value that lies between one and the rank of @var{MASK}. +@end multitable + +@item @emph{Return value}: +@code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where +the kind type parameter is the same as the kind type parameter of +@var{MASK}. If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns +an array with the rank of @var{MASK} minus 1. The shape is determined from +the shape of @var{MASK} where the @var{DIM} dimension is elided. + +@table @asis +@item (A) +@code{ALL(MASK)} is true if all elements of @var{MASK} are true. +It also is true if @var{MASK} has zero size; otherwise, it is false. +@item (B) +If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent +to @code{ALL(MASK)}. If the rank is greater than one, then @code{ALL(MASK,DIM)} +is determined by applying @code{ALL} to the array sections. +@end table + +@item @emph{Example}: +@smallexample +program test_all + logical l + l = all((/.true., .true., .true./)) + print *, l + call section + contains + subroutine section + integer a(2,3), b(2,3) + a = 1 + b = 1 + b(2,2) = 2 + print *, all(a .eq. b, 1) + print *, all(a .eq. b, 2) + end subroutine section +end program test_all +@end smallexample +@end table + + + +@node ALLOCATED +@section @code{ALLOCATED} --- Status of an allocatable entity +@findex @code{ALLOCATED} intrinsic +@cindex allocation status + +@table @asis +@item @emph{Description}: +@code{ALLOCATED(X)} checks the status of wether @var{X} is allocated. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +inquiry function + +@item @emph{Syntax}: +@code{L = ALLOCATED(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The argument shall be an @code{ALLOCATABLE} array. +@end multitable + +@item @emph{Return value}: +The return value is a scalar @code{LOGICAL} with the default logical +kind type parameter. If @var{X} is allocated, @code{ALLOCATED(X)} +is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} + +@item @emph{Example}: +@smallexample +program test_allocated + integer :: i = 4 + real(4), allocatable :: x(:) + if (allocated(x) .eqv. .false.) allocate(x(i) +end program test_allocated +@end smallexample +@end table + + +@node ANINT +@section @code{ANINT} --- Imaginary part of complex number +@findex @code{ANINT} intrinsic +@findex @code{DNINT} intrinsic +@cindex whole number + +@table @asis +@item @emph{Description}: +@code{ANINT(X [, KIND])} rounds its argument to the nearest whole number. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ANINT(X)} @* +@code{X = ANINT(X, KIND)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type of the argument shall be @code{REAL(*)}. +@item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer +initialization expression. +@end multitable + +@item @emph{Return value}: +The return value is of type real with the kind type parameter of the +argument if the optional @var{KIND} is absence; otherwise, the kind +type parameter will be given by @var{KIND}. If @var{X} is greater than +zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}. If @var{X} is +less than or equal to zero, then return @code{AINT(X-0.5)}. + +@item @emph{Example}: +@smallexample +program test_anint + real(4) x4 + real(8) x8 + x4 = 1.234E0_4 + x8 = 4.321_8 + print *, anint(x4), dnint(x8) + x8 = anint(x4,8) +end program test_anint +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node ANY +@section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true +@findex @code{ANY} intrinsic +@cindex true values + +@table @asis +@item @emph{Description}: +@code{ANY(MASK [, DIM])} determines if any of the values is true in @var{MASK} +in the array along dimension @var{DIM}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +transformational function + +@item @emph{Syntax}: +@code{L = ANY(MASK)} @* +@code{L = ANY(MASK, DIM)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and +it shall not be scalar. +@item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer +with a value that lies between one and the rank of @var{MASK}. +@end multitable + +@item @emph{Return value}: +@code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where +the kind type parameter is the same as the kind type parameter of +@var{MASK}. If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns +an array with the rank of @var{MASK} minus 1. The shape is determined from +the shape of @var{MASK} where the @var{DIM} dimension is elided. + +@table @asis +@item (A) +@code{ANY(MASK)} is true if any element of @var{MASK} is true; +otherwise, it is false. It also is false if @var{MASK} has zero size. +@item (B) +If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent +to @code{ANY(MASK)}. If the rank is greater than one, then @code{ANY(MASK,DIM)} +is determined by applying @code{ANY} to the array sections. +@end table + +@item @emph{Example}: +@smallexample +program test_any + logical l + l = any((/.true., .true., .true./)) + print *, l + call section + contains + subroutine section + integer a(2,3), b(2,3) + a = 1 + b = 1 + b(2,2) = 2 + print *, any(a .eq. b, 1) + print *, any(a .eq. b, 2) + end subroutine section +end program test_any +@end smallexample +@end table + + +@node ASIN +@section @code{ASIN} --- Arcsine function +@findex @code{ASIN} intrinsic +@findex @code{DASIN} intrinsic +@cindex arcsine + +@table @asis +@item @emph{Description}: +@code{ASIN(X)} computes the arcsine of its @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ASIN(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and a magnitude that is +less than one. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and it lies in the +range @math{-\pi / 2 \leq \arccos (x) \leq \pi / 2}. The kind type +parameter is the same as @var{X}. + +@item @emph{Example}: +@smallexample +program test_asin + real(8) :: x = 0.866_8 + x = asin(x) +end program test_asin +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DASIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node ASSOCIATED +@section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair +@findex @code{ASSOCIATED} intrinsic +@cindex pointer status + +@table @asis +@item @emph{Description}: +@code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR} +or if @var{PTR} is associated with the target @var{TGT}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +inquiry function + +@item @emph{Syntax}: +@code{L = ASSOCIATED(PTR)} @* +@code{L = ASSOCIATED(PTR [, TGT])} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and +it can be of any type. +@item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or +a @code{TARGET}. It must have the same type, kind type parameter, and +array rank as @var{PTR}. +@end multitable +The status of neither @var{PTR} nor @var{TGT} can be undefined. + +@item @emph{Return value}: +@code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}. +There are several cases: +@table @asis +@item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)} +is true if @var{PTR} is associated with a target; otherwise, it returns false. +@item (B) If @var{TGT} is present and a scalar target, the result is true if +@var{TGT} +is not a 0 sized storage sequence and the target associated with @var{PTR} +occupies the same storage units. If @var{PTR} is disassociated, then the +result is false. +@item (C) If @var{TGT} is present and an array target, the result is true if +@var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are +arrays whose elements are not 0 sized storage sequences, and @var{TGT} and +@var{PTR} occupy the same storage units in array element order. +As in case(B), the result is false, if @var{PTR} is disassociated. +@item (D) If @var{TGT} is present and an scalar pointer, the result is true if +target associated with @var{PTR} and the target associated with @var{TGT} +are not 0 sized storage sequences and occupy the same storage units. +The result is false, if either @var{TGT} or @var{PTR} is disassociated. +@item (E) If @var{TGT} is present and an array pointer, the result is true if +target associated with @var{PTR} and the target associated with @var{TGT} +have the same shape, are not 0 sized arrays, are arrays whose elements are +not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same +storage units in array element order. +The result is false, if either @var{TGT} or @var{PTR} is disassociated. +@end table + +@item @emph{Example}: +@smallexample +program test_associated + implicit none + real, target :: tgt(2) = (/1., 2./) + real, pointer :: ptr(:) + ptr => tgt + if (associated(ptr) .eqv. .false.) call abort + if (associated(ptr,tgt) .eqv. .false.) call abort +end program test_associated +@end smallexample +@end table + + +@node ATAN +@section @code{ATAN} --- Arctangent function +@findex @code{ATAN} intrinsic +@findex @code{DATAN} intrinsic +@cindex arctangent + +@table @asis +@item @emph{Description}: +@code{ATAN(X)} computes the arctangent of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ATAN(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and it lies in the +range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}. + +@item @emph{Example}: +@smallexample +program test_atan + real(8) :: x = 2.866_8 + x = atan(x) +end program test_atan +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DATAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node ATAN2 +@section @code{ATAN2} --- Arctangent function +@findex @code{ATAN2} intrinsic +@findex @code{DATAN2} intrinsic +@cindex arctangent + +@table @asis +@item @emph{Description}: +@code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ATAN2(Y,X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{Y} @tab The type shall be @code{REAL(*)}. +@item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}. +If @var{Y} is zero, then @var{X} must be nonzero. +@end multitable + +@item @emph{Return value}: +The return value has the same type and kind type parameter as @var{Y}. +It is the principle value of the complex number @math{X + i Y}. If +@var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}. +The sign is positive if @var{Y} is positive. If @var{Y} is zero, then +the return value is zero if @var{X} is positive and @math{\pi} if @var{X} +is negative. Finally, if @var{X} is zero, then the magnitude of the result +is @math{\pi/2}. + +@item @emph{Example}: +@smallexample +program test_atan2 + real(4) :: x = 1.e0_4, y = 0.5e0_4 + x = atan2(y,x) +end program test_atan2 +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node BESJ0 +@section @code{BESJ0} --- Bessel function of the first kind of order 0 +@findex @code{BESJ0} intrinsic +@findex @code{DBESJ0} intrinsic +@cindex Bessel + +@table @asis +@item @emph{Description}: +@code{BESJ0(X)} computes the Bessel function of the first kind of order 0 +of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = BESJ0(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and it lies in the +range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}. + +@item @emph{Example}: +@smallexample +program test_besj0 + real(8) :: x = 0.0_8 + x = besj0(x) +end program test_besj0 +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DBESJ0(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu +@end multitable +@end table + + + +@node BESJ1 +@section @code{BESJ1} --- Bessel function of the first kind of order 1 +@findex @code{BESJ1} intrinsic +@findex @code{DBESJ1} intrinsic +@cindex Bessel + +@table @asis +@item @emph{Description}: +@code{BESJ1(X)} computes the Bessel function of the first kind of order 1 +of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = BESJ1(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and it lies in the +range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }. + +@item @emph{Example}: +@smallexample +program test_besj1 + real(8) :: x = 1.0_8 + x = besj1(x) +end program test_besj1 +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DBESJ1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu +@end multitable +@end table + + + +@node BESJN +@section @code{BESJN} --- Bessel function of the first kind +@findex @code{BESJN} intrinsic +@findex @code{DBESJN} intrinsic +@cindex Bessel + +@table @asis +@item @emph{Description}: +@code{BESJN(N, X)} computes the Bessel function of the first kind of order +@var{N} of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{Y = BESJN(N, X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{N} @tab The type shall be an @code{INTEGER(*)}, and it shall be scalar. +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type @code{REAL(*)}. + +@item @emph{Example}: +@smallexample +program test_besjn + real(8) :: x = 1.0_8 + x = besjn(5,x) +end program test_besjn +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab gnu +@item @tab @code{REAL(8) X} @tab @tab +@end multitable +@end table + + + +@node BESY0 +@section @code{BESY0} --- Bessel function of the second kind of order 0 +@findex @code{BESY0} intrinsic +@findex @code{DBESY0} intrinsic +@cindex Bessel + +@table @asis +@item @emph{Description}: +@code{BESY0(X)} computes the Bessel function of the second kind of order 0 +of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = BESY0(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type @code{REAL(*)}. + +@item @emph{Example}: +@smallexample +program test_besy0 + real(8) :: x = 0.0_8 + x = besy0(x) +end program test_besy0 +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DBESY0(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu +@end multitable +@end table + + + +@node BESY1 +@section @code{BESY1} --- Bessel function of the second kind of order 1 +@findex @code{BESY1} intrinsic +@findex @code{DBESY1} intrinsic +@cindex Bessel + +@table @asis +@item @emph{Description}: +@code{BESY1(X)} computes the Bessel function of the second kind of order 1 +of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = BESY1(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type @code{REAL(*)}. + +@item @emph{Example}: +@smallexample +program test_besy1 + real(8) :: x = 1.0_8 + x = besy1(x) +end program test_besy1 +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DBESY1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu +@end multitable +@end table + + + +@node BESYN +@section @code{BESYN} --- Bessel function of the second kind +@findex @code{BESYN} intrinsic +@findex @code{DBESYN} intrinsic +@cindex Bessel + +@table @asis +@item @emph{Description}: +@code{BESYN(N, X)} computes the Bessel function of the second kind of order +@var{N} of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{Y = BESYN(N, X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{N} @tab The type shall be an @code{INTEGER(*)}, and it shall be scalar. +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type @code{REAL(*)}. + +@item @emph{Example}: +@smallexample +program test_besyn + real(8) :: x = 1.0_8 + x = besyn(5,x) +end program test_besyn +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab gnu +@item @tab @code{REAL(8) X} @tab @tab +@end multitable +@end table + + +@node COS +@section @code{COS} --- Cosine function +@findex @code{COS} intrinsic +@findex @code{DCOS} intrinsic +@findex @code{ZCOS} intrinsic +@findex @code{CDCOS} intrinsic +@cindex cosine + +@table @asis +@item @emph{Description}: +@code{COS(X)} computes the cosine of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = COS(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)} or +@code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value has same type and kind than @var{X}. + +@item @emph{Example}: +@smallexample +program test_cos + real :: x = 0.0 + x = cos(x) +end program test_cos +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DCOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{CCOS(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu +@item @code{ZCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item @code{CDCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@end multitable +@end table + + +@node COSH +@section @code{COSH} --- Hyperbolic cosine function +@findex @code{COSH} intrinsic +@findex @code{DCOSH} intrinsic +@cindex hyperbolic cosine + +@table @asis +@item @emph{Description}: +@code{COSH(X)} computes the hyperbolic cosine of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = COSH(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and it is positive +(@math{ \cosh (x) \geq 0 }. + +@item @emph{Example}: +@smallexample +program test_cosh + real(8) :: x = 1.0_8 + x = cosh(x) +end program test_cosh +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DCOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node ERF +@section @code{ERF} --- Error function +@findex @code{ERF} intrinsic +@cindex error function + +@table @asis +@item @emph{Description}: +@code{ERF(X)} computes the error function of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ERF(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type @code{REAL(*)} and it is positive +(@math{ - 1 \leq erf (x) \leq 1 }. + +@item @emph{Example}: +@smallexample +program test_erf + real(8) :: x = 0.17_8 + x = erf(x) +end program test_erf +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DERF(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu +@end multitable +@end table + + + +@node ERFC +@section @code{ERFC} --- Error function +@findex @code{ERFC} intrinsic +@cindex error function + +@table @asis +@item @emph{Description}: +@code{ERFC(X)} computes the complementary error function of @var{X}. + +@item @emph{Option}: +gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = ERFC(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}, and it shall be scalar. +@end multitable + +@item @emph{Return value}: +The return value is a scalar of type @code{REAL(*)} and it is positive +(@math{ 0 \leq erfc (x) \leq 2 }. + +@item @emph{Example}: +@smallexample +program test_erfc + real(8) :: x = 0.17_8 + x = erfc(x) +end program test_erfc +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DERFC(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu +@end multitable +@end table + + + +@node EXP +@section @code{EXP} --- Exponential function +@findex @code{EXP} intrinsic +@findex @code{DEXP} intrinsic +@findex @code{ZEXP} intrinsic +@findex @code{CDEXP} intrinsic +@cindex exponential + +@table @asis +@item @emph{Description}: +@code{EXP(X)} computes the base @math{e} exponential of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = EXP(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)} or +@code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value has same type and kind than @var{X}. + +@item @emph{Example}: +@smallexample +program test_exp + real :: x = 1.0 + x = exp(x) +end program test_exp +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DEXP(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{CEXP(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu +@item @code{ZEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item @code{CDEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@end multitable +@end table + + +@node LOG +@section @code{LOG} --- Logarithm function +@findex @code{LOG} intrinsic +@findex @code{ALOG} intrinsic +@findex @code{DLOG} intrinsic +@findex @code{CLOG} intrinsic +@findex @code{ZLOG} intrinsic +@findex @code{CDLOG} intrinsic +@cindex logarithm + +@table @asis +@item @emph{Description}: +@code{LOG(X)} computes the logarithm of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = LOG(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)} or +@code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}. +The kind type parameter is the same as @var{X}. + +@item @emph{Example}: +@smallexample +program test_log + real(8) :: x = 1.0_8 + complex :: z = (1.0, 2.0) + x = log(x) + z = log(z) +end program test_log +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{ALOG(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu +@item @code{DLOG(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{CLOG(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu +@item @code{ZLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item @code{CDLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@end multitable +@end table + + + +@node LOG10 +@section @code{LOG10} --- Base 10 logarithm function +@findex @code{LOG10} intrinsic +@findex @code{ALOG10} intrinsic +@findex @code{DLOG10} intrinsic +@cindex logarithm + +@table @asis +@item @emph{Description}: +@code{LOG10(X)} computes the base 10 logarithm of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = LOG10(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)} or +@code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}. +The kind type parameter is the same as @var{X}. + +@item @emph{Example}: +@smallexample +program test_log10 + real(8) :: x = 10.0_8 + x = log10(x) +end program test_log10 +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{ALOG10(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu +@item @code{DLOG10(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + + +@node SIN +@section @code{SIN} --- Sine function +@findex @code{SIN} intrinsic +@findex @code{DSIN} intrinsic +@findex @code{ZSIN} intrinsic +@findex @code{CDSIN} intrinsic +@cindex sine + +@table @asis +@item @emph{Description}: +@code{SIN(X)} computes the sine of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = SIN(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)} or +@code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value has same type and king than @var{X}. + +@item @emph{Example}: +@smallexample +program test_sin + real :: x = 0.0 + x = sin(x) +end program test_sin +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu +@item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@end multitable +@end table + + + + +@node SINH +@section @code{SINH} --- Hyperbolic sine function +@findex @code{SINH} intrinsic +@findex @code{DSINH} intrinsic +@cindex hyperbolic sine + +@table @asis +@item @emph{Description}: +@code{SINH(X)} computes the hyperbolic sine of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = SINH(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)}. + +@item @emph{Example}: +@smallexample +program test_sinh + real(8) :: x = - 1.0_8 + x = sinh(x) +end program test_sinh +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DSINH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + + +@node SQRT +@section @code{SQRT} --- Square-root function +@findex @code{SQRT} intrinsic +@findex @code{DSQRT} intrinsic +@findex @code{CSQRT} intrinsic +@findex @code{ZSQRT} intrinsic +@findex @code{CDSQRT} intrinsic +@cindex square-root + +@table @asis +@item @emph{Description}: +@code{SQRT(X)} computes the square root of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = SQRT(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)} or +@code{COMPLEX(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}. +The kind type parameter is the same as @var{X}. + +@item @emph{Example}: +@smallexample +program test_sqrt + real(8) :: x = 2.0_8 + complex :: z = (1.0, 2.0) + x = sqrt(x) + z = sqrt(z) +end program test_sqrt +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DSQRT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@item @code{CSQRT(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu +@item @code{ZSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu +@end multitable +@end table + + + +@node TAN +@section @code{TAN} --- Tangent function +@findex @code{TAN} intrinsic +@findex @code{DTAN} intrinsic +@cindex tangent + +@table @asis +@item @emph{Description}: +@code{TAN(X)} computes the tangent of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = TAN(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)}. The kind type parameter is +the same as @var{X}. + +@item @emph{Example}: +@smallexample +program test_tan + real(8) :: x = 0.165_8 + x = tan(x) +end program test_tan +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + +@node TANH +@section @code{TANH} --- Hyperbolic tangent function +@findex @code{TANH} intrinsic +@findex @code{DTANH} intrinsic +@cindex hyperbolic tangent + +@table @asis +@item @emph{Description}: +@code{TANH(X)} computes the hyperbolic tangent of @var{X}. + +@item @emph{Option}: +f95, gnu + +@item @emph{Type}: +elemental function + +@item @emph{Syntax}: +@code{X = TANH(X)} + +@item @emph{Arguments}: +@multitable @columnfractions .15 .80 +@item @var{X} @tab The type shall be an @code{REAL(*)}. +@end multitable + +@item @emph{Return value}: +The return value is of type @code{REAL(*)} and lies in the range +@math{ - 1 \leq tanh(x) \leq 1 }. + +@item @emph{Example}: +@smallexample +program test_tanh + real(8) :: x = 2.1_8 + x = tanh(x) +end program test_tanh +@end smallexample + +@item @emph{Specific names}: +@multitable @columnfractions .24 .24 .24 .24 +@item Name @tab Argument @tab Return type @tab Option +@item @code{DTANH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu +@end multitable +@end table + + + + + +@comment gen bit_size +@comment +@comment gen btest +@comment +@comment gen ceiling +@comment +@comment gen char +@comment +@comment gen cmplx +@comment +@comment gen command_argument_count +@comment +@comment gen conjg +@comment dconjg +@comment +@comment gen count +@comment +@comment sub cpu_time +@comment +@comment gen cshift +@comment +@comment sub date_and_time +@comment +@comment gen dble +@comment dfloat +@comment +@comment gen dcmplx +@comment +@comment gen digits +@comment +@comment gen dim +@comment idim +@comment ddim +@comment +@comment gen dot_product +@comment +@comment gen dprod +@comment +@comment gen dreal +@comment +@comment sub dtime +@comment +@comment gen eoshift +@comment +@comment gen epsilon +@comment +@comment gen etime +@comment sub etime +@comment +@comment sub exit +@comment +@comment gen exponent +@comment +@comment gen floor +@comment +@comment sub flush +@comment +@comment gen fnum +@comment +@comment gen fraction +@comment +@comment gen fstat +@comment sub fstat +@comment +@comment sub getarg +@comment +@comment gen getcwd +@comment sub getcwd +@comment +@comment sub getenv +@comment +@comment gen getgid +@comment +@comment gen getpid +@comment +@comment gen getuid +@comment +@comment sub get_command +@comment +@comment sub get_command_argument +@comment +@comment sub get_environment_variable +@comment +@comment gen huge +@comment +@comment gen iachar +@comment +@comment gen iand +@comment +@comment gen iargc +@comment +@comment gen ibclr +@comment +@comment gen ibits +@comment +@comment gen ibset +@comment +@comment gen ichar +@comment +@comment gen ieor +@comment +@comment gen index +@comment +@comment gen int +@comment ifix +@comment idint +@comment +@comment gen ior +@comment +@comment gen irand +@comment +@comment gen ishft +@comment +@comment gen ishftc +@comment +@comment gen kind +@comment +@comment gen lbound +@comment +@comment gen len +@comment +@comment gen len_trim +@comment +@comment gen lge +@comment +@comment gen lgt +@comment +@comment gen lle +@comment +@comment gen llt +@comment +@comment gen logical +@comment +@comment gen matmul +@comment +@comment gen max +@comment max0 +@comment amax0 +@comment amax1 +@comment max1 +@comment dmax1 +@comment +@comment gen maxexponent +@comment +@comment gen maxloc +@comment +@comment gen maxval +@comment +@comment gen merge +@comment +@comment gen min +@comment min0 +@comment amin0 +@comment amin1 +@comment min1 +@comment dmin1 +@comment +@comment gen minexponent +@comment +@comment gen minloc +@comment +@comment gen minval +@comment +@comment gen mod +@comment amod +@comment dmod +@comment +@comment gen modulo +@comment +@comment sub mvbits +@comment +@comment gen nearest +@comment +@comment gen nint +@comment idnint +@comment +@comment gen not +@comment +@comment gen null +@comment +@comment gen pack +@comment +@comment gen precision +@comment +@comment gen present +@comment +@comment gen product +@comment +@comment gen radix +@comment +@comment gen rand +@comment ran +@comment +@comment sub random_number +@comment +@comment sub random_seed +@comment +@comment gen range +@comment +@comment gen real +@comment float +@comment sngl +@comment +@comment gen repeat +@comment +@comment gen reshape +@comment +@comment gen rrspacing +@comment +@comment gen scale +@comment +@comment gen scan +@comment +@comment gen second +@comment sub second +@comment +@comment gen selected_int_kind +@comment +@comment gen selected_real_kind +@comment +@comment gen set_exponent +@comment +@comment gen shape +@comment +@comment gen sign +@comment isign +@comment dsign +@comment +@comment gen size +@comment +@comment gen spacing +@comment +@comment gen spread +@comment +@comment sub srand +@comment +@comment gen stat +@comment sub stat +@comment +@comment gen sum +@comment +@comment gen system +@comment sub system +@comment +@comment sub system_clock +@comment +@comment gen tiny +@comment +@comment gen transfer +@comment +@comment gen transpose +@comment +@comment gen trim +@comment +@comment gen ubound +@comment +@comment gen umask +@comment sub umask +@comment +@comment gen unlink +@comment sub unlink +@comment +@comment gen unpack +@comment +@comment gen verify + diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 376e9cc3101..996556fb5bc 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -1,11 +1,11 @@ -@c Copyright (C) 2004 +@c Copyright (C) 2004, 2005 @c Free Software Foundation, Inc. @c This is part of the GFORTRAN manual. @c For copying conditions, see the file gfortran.texi. @ignore @c man begin COPYRIGHT -Copyright @copyright{} 2004 +Copyright @copyright{} 2004, 2005 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document @@ -119,7 +119,7 @@ by type. Explanations are in the following sections. -fdollar-ok -fimplicit-none -fmax-identifier-length @gol -std=@var{std} -ffixed-line-length-@var{n} -ffixed-line-length-none @gol --i8 -r8 -d8} +-fdefault-double-8 -fdefault-integer-8 -fdefault-real-8 } @item Warning Options @xref{Warning Options,,Options to Request or Suppress Warnings}. @@ -143,7 +143,7 @@ by type. Explanations are in the following sections. @item Code Generation Options @xref{Code Gen Options,,Options for Code Generation Conventions}. @gccoptlist{ --fno-underscoring -fno-second-underscore @gol +-ff2c -fno-underscoring -fsecond-underscore @gol -fbounds-check -fmax-stack-var-size=@var{n} @gol -fpackderived -frepack-arrays} @end table @@ -183,6 +183,23 @@ Specify the layout used by the the source file. The free form layout was introduced in Fortran 90. Fixed form was traditionally used in older Fortran programs. +@cindex option, -fdefault-double-8 +@cindex -fdefault-double-8, option +@item -fdefault-double-8 +Set the "DOUBLE PRECISION" type to an 8 byte wide. + +@cindex option, -fdefault-integer-8 +@cindex -fdefault-integer-8, option +@item -fdefault-integer-8 +Set the default integer and logical types to an 8 byte wide type. +Do nothing if this is already the default. + +@cindex option, -fdefault-real-8 +@cindex -fdefault-real-8, option +@item -fdefault-real-8 +Set the default real type to an 8 byte wide type. +Do nothing if this is already the default. + @cindex -fdollar-ok option @cindex options, -fdollar-ok @item -fdollar-ok @@ -231,24 +248,7 @@ Specify that no implicit typing is allowed, unless overridden by explicit @cindex option, -std=@var{std} @item -std=@var{std} Conform to the specified standard. Allowed values for @var{std} are -@samp{gnu}, @samp{f95} and @samp{f90}. - -@cindex option, -i8 -@cindex -i8, option -@cindex option, -r8 -@cindex -r8, option -@cindex option, -d8 -@cindex -d8, option -@item -i8 -@item -r8 -@item -d8 -The @option{-i8} and @option{-r8} options set the default @code{INTEGER} -and @code{REAL} kinds to @code{KIND=8}. The @option{-d8} option is -equivalent to specifying both @option{-i8} and @option{-r8}. - -When @option{-r8} is specified, the @code{DOUBLE PRECISION} kind is set -to @code{KIND=16} if the target supports a 16 byte floating point format. -If no such format exists, the @code{DOUBLE PRECISION} kind is unchanged. +@samp{gnu} and @samp{f95}. @end table @@ -329,12 +329,22 @@ This currently includes @option{-Wunused-labels}, @option{-Waliasing}, @cindex options, -Waliasing @item -Waliasing @cindex aliasing -Warn about possible aliasing of dummy arguments. The following example -will trigger the warning as it would be illegal to @code{bar} to -modify either parameter. +Warn about possible aliasing of dummy arguments. Specifically, it warns +if the same actual argument is associated with a dummy argument with +@code{intent(in)} and a dummy argument with @code{intent(out)} in a call +with an explicit interface. + +The following example will trigger the warning. @smallexample - INTEGER A - CALL BAR(A,A) + interface + subroutine bar(a,b) + integer, intent(in) :: a + integer, intent(out) :: b + end subroutine + end interface + integer :: a + + call bar(a,a) @end smallexample @@ -508,8 +518,43 @@ it. @table @gcctabopt -@cindex -fno-underscoring option -@cindex options, -fno-underscoring +@cindex @option{-ff2c} option +@cindex options, @option{-ff2c} +@item -ff2c +@cindex calling convention +@cindex @command{f2c} calling convention +@cindex @command{g77} calling convention +@cindex libf2c calling convention +Generate code designed to be compatible with code generated +by @command{g77} and @command{f2c}. + +The calling conventions used by @command{g77} (originally implemented +in @command{f2c}) require functions that return type +default @code{REAL} to actually return the C type @code{double}, and +functions that return type @code{COMPLEX} to return the values via an +extra argument in the calling sequence that points to where to +store the return value. Under the default GNU calling conventions, such +functions simply return their results as they would in GNU +C -- default @code{REAL} functions return the C type @code{float}, and +@code{COMPLEX} functions return the GNU C type @code{complex}. +Additionally, this option implies the @option{-fsecond-underscore} +option, unless @option{-fno-second-underscore} is explicitly requested. + +This does not affect the generation of code that interfaces with +the @command{libgfortran} library. + +@emph{Caution:} It is not a good idea to mix Fortran code compiled +with @code{-ff2c} with code compiled with the default @code{-fno-f2c} +calling conventions as, calling @code{COMPLEX} or default @code{REAL} +functions between program parts which were compiled with different +calling conventions will break at execution time. + +@emph{Caution:} This will break code which passes intrinsic functions +of type default @code{REAL} or @code{COMPLEX} as actual arguments, as +the library implementations use the @command{-fno-f2c} calling conventions. + +@cindex @option{-fno-underscoring option} +@cindex options, @option{-fno-underscoring} @item -fno-underscoring @cindex underscore @cindex symbol names, underscores @@ -518,16 +563,17 @@ it. Do not transform names of entities specified in the Fortran source file by appending underscores to them. -With @option{-funderscoring} in effect, @command{gfortran} appends two -underscores to names with underscores and one underscore to external names -with no underscores. (@command{gfortran} also appends two underscores to -internal names with underscores to avoid naming collisions with external -names. The @option{-fno-second-underscore} option disables appending of the -second underscore in all cases.) +With @option{-funderscoring} in effect, @command{gfortran} appends one +underscore to external names with no underscores. This is done to ensure compatibility with code produced by many -UNIX Fortran compilers, including @command{f2c} which perform the -same transformations. +UNIX Fortran compilers. + +@emph{Caution}: The default behavior of @command{gfortran} is +incompatible with @command{f2c} and @command{g77}, please use the +@option{-ff2c} and @option{-fsecond-underscore} options if you want +object files compiled with @option{gfortran} to be compatible with +object code created with these tools. Use of @option{-fno-underscoring} is not recommended unless you are experimenting with issues such as integration of (GNU) Fortran into @@ -583,22 +629,31 @@ in the source, even if the names as seen by the linker are mangled to prevent accidental linking between procedures with incompatible interfaces. -@cindex -fno-second-underscore option -@cindex options, -fno-second-underscore -@item -fno-second-underscore +@cindex @option{-fsecond-underscore option} +@cindex options, @option{-fsecond-underscore} +@item -fsecond-underscore @cindex underscore @cindex symbol names, underscores @cindex transforming symbol names @cindex symbol names, transforming -Do not append a second underscore to names of entities specified -in the Fortran source file. +@cindex @command{f2c} calling convention +@cindex @command{g77} calling convention +@cindex libf2c calling convention +By default, @command{gfortran} appends an underscore to external +names. If this option is used @command{gfortran} appends two +underscores to names with underscores and one underscore to external names +with no underscores. (@command{gfortran} also appends two underscores to +internal names with underscores to avoid naming collisions with external +names. This option has no effect if @option{-fno-underscoring} is -in effect. +in effect. It is implied by the @option{-ff2c} option. Otherwise, with this option, an external name such as @samp{MAX_COUNT} is implemented as a reference to the link-time external symbol -@samp{max_count_}, instead of @samp{max_count__}. +@samp{max_count__}, instead of @samp{max_count_}. This is required +for compatibility with @command{g77} and @command{f2c}, and is implied +by use of the @option{-ff2c} option. @cindex -fbounds-check option diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 12650f90f24..8dab5f59afd 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -433,6 +433,7 @@ check_format (void) format_item: /* In this state, the next thing has to be a format item. */ t = format_lex (); +format_item_1: switch (t) { case FMT_POSINT: @@ -641,7 +642,7 @@ data_desc: { while(repeat >0) { - next_char(0); + next_char(1); repeat -- ; } } @@ -701,8 +702,10 @@ between_desc: goto syntax; default: - error = "Missing comma"; - goto syntax; + if (gfc_notify_std (GFC_STD_GNU, "Extension: Missing comma at %C") + == FAILURE) + return FAILURE; + goto format_item_1; } optional_comma: diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index 9a30b7df2e1..e9392871fef 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -253,6 +253,31 @@ gfc_resolve_char (gfc_expr * f, gfc_expr * a, gfc_expr * kind) void +gfc_resolve_chdir (gfc_expr * f, gfc_expr * d ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_default_integer_kind; + f->value.function.name = gfc_get_string (PREFIX("chdir_i%d"), f->ts.kind); +} + + +void +gfc_resolve_chdir_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->expr != NULL) + kind = c->ext.actual->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("chdir_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + +void gfc_resolve_cmplx (gfc_expr * f, gfc_expr * x, gfc_expr * y, gfc_expr * kind) { f->ts.type = BT_COMPLEX; @@ -533,6 +558,14 @@ gfc_resolve_getuid (gfc_expr * f) } void +gfc_resolve_hostnm (gfc_expr * f, gfc_expr * n ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = 4; + f->value.function.name = gfc_get_string (PREFIX ("hostnm")); +} + +void gfc_resolve_iand (gfc_expr * f, gfc_expr * i, gfc_expr * j) { /* If the kind of i and j are different, then g77 cross-promoted the @@ -596,6 +629,15 @@ gfc_resolve_idnint (gfc_expr * f, gfc_expr * a) void +gfc_resolve_ierrno (gfc_expr * f) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_default_integer_kind; + f->value.function.name = gfc_get_string (PREFIX("ierrno_i%d"), f->ts.kind); +} + + +void gfc_resolve_ieor (gfc_expr * f, gfc_expr * i, gfc_expr * j) { /* If the kind of i and j are different, then g77 cross-promoted the @@ -670,6 +712,17 @@ gfc_resolve_ishftc (gfc_expr * f, gfc_expr * i, gfc_expr * shift, void +gfc_resolve_kill (gfc_expr * f, ATTRIBUTE_UNUSED gfc_expr * p, + ATTRIBUTE_UNUSED gfc_expr * s) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_default_integer_kind; + + f->value.function.name = gfc_get_string (PREFIX("kill_i%d"), f->ts.kind); +} + + +void gfc_resolve_lbound (gfc_expr * f, gfc_expr * array, gfc_expr * dim) { @@ -708,6 +761,16 @@ gfc_resolve_len_trim (gfc_expr * f, gfc_expr * string) void +gfc_resolve_link (gfc_expr * f, gfc_expr * p1 ATTRIBUTE_UNUSED, + gfc_expr * p2 ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_default_integer_kind; + f->value.function.name = gfc_get_string (PREFIX("link_i%d"), f->ts.kind); +} + + +void gfc_resolve_log (gfc_expr * f, gfc_expr * x) { f->ts = x->ts; @@ -1019,6 +1082,16 @@ gfc_resolve_real (gfc_expr * f, gfc_expr * a, gfc_expr * kind) void +gfc_resolve_rename (gfc_expr * f, gfc_expr * p1 ATTRIBUTE_UNUSED, + gfc_expr * p2 ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_default_integer_kind; + f->value.function.name = gfc_get_string (PREFIX("rename_i%d"), f->ts.kind); +} + + +void gfc_resolve_repeat (gfc_expr * f, gfc_expr * string, gfc_expr * ncopies ATTRIBUTE_UNUSED) { @@ -1064,8 +1137,14 @@ gfc_resolve_reshape (gfc_expr * f, gfc_expr * source, gfc_expr * shape, case 4: case 8: /* case 16: */ - f->value.function.name = - gfc_get_string (PREFIX("reshape_%d"), source->ts.kind); + if (source->ts.type == BT_COMPLEX) + f->value.function.name = + gfc_get_string (PREFIX("reshape_%c%d"), + gfc_type_letter (BT_COMPLEX), source->ts.kind); + else + f->value.function.name = + gfc_get_string (PREFIX("reshape_%d"), source->ts.kind); + break; default: @@ -1275,6 +1354,16 @@ gfc_resolve_sum (gfc_expr * f, gfc_expr * array, gfc_expr * dim, } +void +gfc_resolve_symlnk (gfc_expr * f, gfc_expr * p1 ATTRIBUTE_UNUSED, + gfc_expr * p2 ATTRIBUTE_UNUSED) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = gfc_default_integer_kind; + f->value.function.name = gfc_get_string (PREFIX("symlnk_i%d"), f->ts.kind); +} + + /* Resolve the g77 compatibility function SYSTEM. */ void @@ -1305,6 +1394,24 @@ gfc_resolve_tanh (gfc_expr * f, gfc_expr * x) void +gfc_resolve_time (gfc_expr * f) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = 4; + f->value.function.name = gfc_get_string (PREFIX("time_func")); +} + + +void +gfc_resolve_time8 (gfc_expr * f) +{ + f->ts.type = BT_INTEGER; + f->ts.kind = 8; + f->value.function.name = gfc_get_string (PREFIX("time8_func")); +} + + +void gfc_resolve_transfer (gfc_expr * f, gfc_expr * source ATTRIBUTE_UNUSED, gfc_expr * mold, gfc_expr * size) { @@ -1490,6 +1597,70 @@ gfc_resolve_random_number (gfc_code * c ATTRIBUTE_UNUSED) } +void +gfc_resolve_rename_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->next->expr != NULL) + kind = c->ext.actual->next->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("rename_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + +void +gfc_resolve_kill_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->next->expr != NULL) + kind = c->ext.actual->next->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("kill_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + +void +gfc_resolve_link_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->next->expr != NULL) + kind = c->ext.actual->next->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("link_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + +void +gfc_resolve_symlnk_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->next->expr != NULL) + kind = c->ext.actual->next->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("symlnk_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + /* G77 compatibility subroutines etime() and dtime(). */ void @@ -1514,6 +1685,22 @@ gfc_resolve_second_sub (gfc_code * c) } +void +gfc_resolve_sleep_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->expr != NULL) + kind = c->ext.actual->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("sleep_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + /* G77 compatibility function srand(). */ void @@ -1665,6 +1852,43 @@ gfc_resolve_flush (gfc_code * c) c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); } + +void +gfc_resolve_gerror (gfc_code * c) +{ + c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("gerror")); +} + + +void +gfc_resolve_getlog (gfc_code * c) +{ + c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("getlog")); +} + + +void +gfc_resolve_hostnm_sub (gfc_code * c) +{ + const char *name; + int kind; + + if (c->ext.actual->next->expr != NULL) + kind = c->ext.actual->next->expr->ts.kind; + else + kind = gfc_default_integer_kind; + + name = gfc_get_string (PREFIX("hostnm_i%d_sub"), kind); + c->resolved_sym = gfc_get_intrinsic_sub_symbol (name); +} + + +void +gfc_resolve_perror (gfc_code * c) +{ + c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX ("perror_sub")); +} + /* Resolve the STAT and FSTAT intrinsic subroutines. */ void diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt index 976a2b436d2..d1ca5f02ebd 100644 --- a/gcc/fortran/lang.opt +++ b/gcc/fortran/lang.opt @@ -1,5 +1,5 @@ ; Options for the Fortran 95 front end. -; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -18,7 +18,7 @@ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA ; 02111-1307, USA. -; See c.opt for a description of this file's format. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -69,9 +69,17 @@ Wunused-labels F95 Warn when a label is unused -d8 -F95 RejectNegative -Set the default real and integer kinds to double precision +fdefault-double-8 +F95 +Set the default double precision kind to an 8 byte wide type + +fdefault-integer-8 +F95 +Set the default integer kind to an 8 byte wide type + +fdefault-real-8 +F95 +Set the default real kind to an 8 byte wide type fdollar-ok F95 @@ -81,6 +89,10 @@ fdump-parse-tree F95 Display the code tree after parsing. +ff2c +F95 +Use f2c calling convention. + ffixed-form F95 Assume that the source file is fixed form @@ -133,18 +145,10 @@ frepack-arrays F95 Copy array sections into a contiguous block on procedure entry -i8 -F95 -Set the default integer kind to double precision - qkind= F95 RejectNegative Joined UInteger -qkind= Set the kind for a real with the 'q' exponent to 'n' -r8 -F95 -Set the default real kind to double precision - std=f95 F95 Conform to the ISO Fortran 95 standard. diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index f433db52c5d..741e1a30607 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -899,6 +899,43 @@ cleanup: } +/* We try to match an easy arithmetic IF statement. This only happens + when just after having encountered a simple IF statement. This code + is really duplicate with parts of the gfc_match_if code, but this is + *much* easier. */ +static match +match_arithmetic_if (void) +{ + gfc_st_label *l1, *l2, *l3; + gfc_expr *expr; + match m; + + m = gfc_match (" ( %e ) %l , %l , %l%t", &expr, &l1, &l2, &l3); + if (m != MATCH_YES) + return m; + + if (gfc_reference_st_label (l1, ST_LABEL_TARGET) == FAILURE + || gfc_reference_st_label (l2, ST_LABEL_TARGET) == FAILURE + || gfc_reference_st_label (l3, ST_LABEL_TARGET) == FAILURE) + { + gfc_free_expr (expr); + return MATCH_ERROR; + } + + if (gfc_notify_std (GFC_STD_F95_DEL, + "Obsolete: arithmetic IF statement at %C") == FAILURE) + return MATCH_ERROR; + + new_st.op = EXEC_ARITHMETIC_IF; + new_st.expr = expr; + new_st.label = l1; + new_st.label2 = l2; + new_st.label3 = l3; + + return MATCH_YES; +} + + /* The IF statement is a bit of a pain. First of all, there are three forms of it, the simple IF, the IF that starts a block and the arithmetic IF. @@ -960,6 +997,11 @@ gfc_match_if (gfc_statement * if_type) gfc_free_expr (expr); return MATCH_ERROR; } + + if (gfc_notify_std (GFC_STD_F95_DEL, + "Obsolete: arithmetic IF statement at %C") + == FAILURE) + return MATCH_ERROR; new_st.op = EXEC_ARITHMETIC_IF; new_st.expr = expr; @@ -1036,6 +1078,7 @@ gfc_match_if (gfc_statement * if_type) match ("exit", gfc_match_exit, ST_EXIT) match ("forall", match_simple_forall, ST_FORALL) match ("go to", gfc_match_goto, ST_GOTO) + match ("if", match_arithmetic_if, ST_ARITHMETIC_IF) match ("inquire", gfc_match_inquire, ST_INQUIRE) match ("nullify", gfc_match_nullify, ST_NULLIFY) match ("open", gfc_match_open, ST_OPEN) @@ -1940,12 +1983,7 @@ gfc_match_return (void) gfc_expr *e; match m; gfc_compile_state s; - - gfc_enclosing_unit (&s); - if (s == COMP_PROGRAM - && gfc_notify_std (GFC_STD_GNU, "Extension: RETURN statement in " - "main program at %C") == FAILURE) - return MATCH_ERROR; + int c; e = NULL; if (gfc_match_eos () == MATCH_YES) @@ -1958,7 +1996,18 @@ gfc_match_return (void) goto cleanup; } - m = gfc_match ("% %e%t", &e); + if (gfc_current_form == FORM_FREE) + { + /* The following are valid, so we can't require a blank after the + RETURN keyword: + return+1 + return(1) */ + c = gfc_peek_char (); + if (ISALPHA (c) || ISDIGIT (c)) + return MATCH_NO; + } + + m = gfc_match (" %e%t", &e); if (m == MATCH_YES) goto done; if (m == MATCH_ERROR) @@ -1971,6 +2020,12 @@ cleanup: return MATCH_ERROR; done: + gfc_enclosing_unit (&s); + if (s == COMP_PROGRAM + && gfc_notify_std (GFC_STD_GNU, "Extension: RETURN statement in " + "main program at %C") == FAILURE) + return MATCH_ERROR; + new_st.op = EXEC_RETURN; new_st.expr = e; diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h index 1d46e85960c..f146c5c3fe6 100644 --- a/gcc/fortran/match.h +++ b/gcc/fortran/match.h @@ -1,5 +1,5 @@ /* All matcher functions. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2005 Free Software Foundation, Inc. Contributed by Steven Bosscher This file is part of GCC. @@ -108,6 +108,8 @@ match gfc_match_derived_decl (void); match gfc_match_implicit_none (void); match gfc_match_implicit (void); +void gfc_set_constant_character_len (int, gfc_expr *); + /* Matchers for attribute declarations */ match gfc_match_allocatable (void); match gfc_match_dimension (void); diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 4b69b738db1..7aa91cb1c33 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -1280,7 +1280,7 @@ mio_name (int t, const mstring * m) return t; } -/* Specialisation of mio_name. */ +/* Specialization of mio_name. */ #define DECL_MIO_NAME(TYPE) \ static inline TYPE \ @@ -1424,7 +1424,7 @@ static const mstring attr_bits[] = minit (NULL, -1) }; -/* Specialisation of mio_name. */ +/* Specialization of mio_name. */ DECL_MIO_NAME(ab_attribute) DECL_MIO_NAME(ar_type) DECL_MIO_NAME(array_type) diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c index 35964003785..2603caa67a8 100644 --- a/gcc/fortran/options.c +++ b/gcc/fortran/options.c @@ -57,9 +57,13 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.warn_surprising = 0; gfc_option.warn_unused_labels = 0; + gfc_option.flag_default_double = 0; + gfc_option.flag_default_integer = 0; + gfc_option.flag_default_real = 0; gfc_option.flag_dollar_ok = 0; gfc_option.flag_underscoring = 1; - gfc_option.flag_second_underscore = 1; + gfc_option.flag_f2c = 0; + gfc_option.flag_second_underscore = -1; gfc_option.flag_implicit_none = 0; gfc_option.flag_max_stack_var_size = 32768; gfc_option.flag_module_access_private = 0; @@ -68,9 +72,6 @@ gfc_init_options (unsigned int argc ATTRIBUTE_UNUSED, gfc_option.flag_repack_arrays = 0; gfc_option.q_kind = gfc_default_double_kind; - gfc_option.i8 = 0; - gfc_option.r8 = 0; - gfc_option.d8 = 0; flag_argument_noalias = 2; flag_errno_math = 0; @@ -113,6 +114,12 @@ gfc_post_options (const char **pfilename) if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0) gfc_option.warn_std |= GFC_STD_GNU; + /* If the user didn't explicitly specify -f(no)-second-underscore we + use it if we're trying to be compatible with f2c, and not + otherwise. */ + if (gfc_option.flag_second_underscore == -1) + gfc_option.flag_second_underscore = gfc_option.flag_f2c; + return false; } @@ -214,6 +221,10 @@ gfc_handle_option (size_t scode, const char *arg, int value) gfc_option.warn_unused_labels = value; break; + case OPT_ff2c: + gfc_option.flag_f2c = value; + break; + case OPT_fdollar_ok: gfc_option.flag_dollar_ok = value; break; @@ -285,16 +296,16 @@ gfc_handle_option (size_t scode, const char *arg, int value) gfc_option.q_kind = value; break; - case OPT_i8: - gfc_option.i8 = value; + case OPT_fdefault_integer_8: + gfc_option.flag_default_integer = value; break; - case OPT_r8: - gfc_option.r8 = value; + case OPT_fdefault_real_8: + gfc_option.flag_default_real = value; break; - case OPT_d8: - gfc_option.d8 = value; + case OPT_fdefault_double_8: + gfc_option.flag_default_double = value; break; case OPT_I: diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index a3f0ac19539..94bf6d0d28d 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -479,7 +479,13 @@ next_statement (void) gfc_buffer_error (1); if (gfc_at_eol ()) - gfc_advance_line (); + { + if (gfc_option.warn_line_truncation + && gfc_current_locus.lb->truncated) + gfc_warning_now ("Line truncated at %C"); + + gfc_advance_line (); + } gfc_skip_comments (); diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 992bc5f0af7..38f9939201f 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1516,6 +1516,9 @@ check_substring: if (primary->expr_type == EXPR_CONSTANT) primary->expr_type = EXPR_SUBSTRING; + if (substring) + primary->ts.cl = NULL; + break; case MATCH_NO: @@ -1989,6 +1992,8 @@ gfc_match_rvalue (gfc_expr ** result) } e->ts = sym->ts; + if (e->ref) + e->ts.cl = NULL; m = MATCH_YES; break; } diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 730f4fb1fed..5f7a76a57a4 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -360,7 +360,6 @@ resolve_entries (gfc_namespace * ns) out what is going on. */ snprintf (name, GFC_MAX_SYMBOL_LEN, "master.%d.%s", master_count++, ns->proc_name->name); - name[GFC_MAX_SYMBOL_LEN] = '\0'; gfc_get_ha_symbol (name, &proc); gcc_assert (proc != NULL); @@ -369,8 +368,88 @@ resolve_entries (gfc_namespace * ns) gfc_add_subroutine (&proc->attr, proc->name, NULL); else { + gfc_symbol *sym; + gfc_typespec *ts, *fts; + gfc_add_function (&proc->attr, proc->name, NULL); - gfc_internal_error ("TODO: Functions with alternate entry points"); + proc->result = proc; + fts = &ns->entries->sym->result->ts; + if (fts->type == BT_UNKNOWN) + fts = gfc_get_default_type (ns->entries->sym->result, NULL); + for (el = ns->entries->next; el; el = el->next) + { + ts = &el->sym->result->ts; + if (ts->type == BT_UNKNOWN) + ts = gfc_get_default_type (el->sym->result, NULL); + if (! gfc_compare_types (ts, fts) + || (el->sym->result->attr.dimension + != ns->entries->sym->result->attr.dimension) + || (el->sym->result->attr.pointer + != ns->entries->sym->result->attr.pointer)) + break; + } + + if (el == NULL) + { + sym = ns->entries->sym->result; + /* All result types the same. */ + proc->ts = *fts; + if (sym->attr.dimension) + gfc_set_array_spec (proc, gfc_copy_array_spec (sym->as), NULL); + if (sym->attr.pointer) + gfc_add_pointer (&proc->attr, NULL); + } + else + { + /* Otherwise the result will be passed through an union by + reference. */ + proc->attr.mixed_entry_master = 1; + for (el = ns->entries; el; el = el->next) + { + sym = el->sym->result; + if (sym->attr.dimension) + gfc_error ("%s result %s can't be an array in FUNCTION %s at %L", + el == ns->entries ? "FUNCTION" : "ENTRY", sym->name, + ns->entries->sym->name, &sym->declared_at); + else if (sym->attr.pointer) + gfc_error ("%s result %s can't be a POINTER in FUNCTION %s at %L", + el == ns->entries ? "FUNCTION" : "ENTRY", sym->name, + ns->entries->sym->name, &sym->declared_at); + else + { + ts = &sym->ts; + if (ts->type == BT_UNKNOWN) + ts = gfc_get_default_type (sym, NULL); + switch (ts->type) + { + case BT_INTEGER: + if (ts->kind == gfc_default_integer_kind) + sym = NULL; + break; + case BT_REAL: + if (ts->kind == gfc_default_real_kind + || ts->kind == gfc_default_double_kind) + sym = NULL; + break; + case BT_COMPLEX: + if (ts->kind == gfc_default_complex_kind) + sym = NULL; + break; + case BT_LOGICAL: + if (ts->kind == gfc_default_logical_kind) + sym = NULL; + break; + default: + break; + } + if (sym) + gfc_error ("%s result %s can't be of type %s in FUNCTION %s at %L", + el == ns->entries ? "FUNCTION" : "ENTRY", sym->name, + gfc_typename (ts), ns->entries->sym->name, + &sym->declared_at); + } + } + } } proc->attr.access = ACCESS_PRIVATE; proc->attr.entry_master = 1; @@ -481,7 +560,7 @@ was_declared (gfc_symbol * sym) if (!a.implicit_type && sym->ts.type != BT_UNKNOWN) return 1; - if (a.allocatable || a.dimension || a.external || a.intrinsic + if (a.allocatable || a.dimension || a.dummy || a.external || a.intrinsic || a.optional || a.pointer || a.save || a.target || a.access != ACCESS_UNKNOWN || a.intent != INTENT_UNKNOWN) return 1; @@ -604,6 +683,12 @@ resolve_actual_arglist (gfc_actual_arglist * arg) || sym->attr.external) { + if (sym->attr.proc == PROC_ST_FUNCTION) + { + gfc_error ("Statement function '%s' at %L is not allowed as an " + "actual argument", sym->name, &e->where); + } + /* If the symbol is the function that names the current (or parent) scope, then we really have a variable reference. */ @@ -2111,6 +2196,9 @@ resolve_variable (gfc_expr * e) if (e->ref && resolve_ref (e) == FAILURE) return FAILURE; + if (e->symtree == NULL) + return FAILURE; + sym = e->symtree->n.sym; if (sym->attr.flavor == FL_PROCEDURE && !sym->attr.function) { @@ -3973,6 +4061,8 @@ resolve_symbol (gfc_symbol * sym) sym->ts = sym->result->ts; sym->as = gfc_copy_array_spec (sym->result->as); + sym->attr.dimension = sym->result->attr.dimension; + sym->attr.pointer = sym->result->attr.pointer; } } } diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index cab85f4dcfa..69fa3a1e186 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -458,6 +458,9 @@ restart: } while (c != '\n'); + /* Avoid truncation warnings for comment ending lines. */ + gfc_current_locus.lb->truncated = 0; + goto done; } @@ -525,6 +528,9 @@ restart: c = next_char (); } while (c != '\n'); + + /* Avoid truncation warnings for comment ending lines. */ + gfc_current_locus.lb->truncated = 0; } if (c != '\n') @@ -631,21 +637,17 @@ gfc_error_recovery (void) if (c == delim) break; if (c == '\n') - goto done; + return; if (c == '\\') { c = next_char (); if (c == '\n') - goto done; + return; } } if (gfc_at_eof ()) break; } - -done: - if (c == '\n') - gfc_advance_line (); } @@ -677,12 +679,14 @@ gfc_gobble_whitespace (void) need be. In fixed mode, we expand a tab that occurs within the statement label region to expand to spaces that leave the next character in - the source region. */ + the source region. + load_line returns wether the line was truncated. */ -static void -load_line (FILE * input, char **pbuf, char *filename, int linenum) +static int +load_line (FILE * input, char **pbuf) { - int c, maxlen, i, trunc_flag, preprocessor_flag; + int c, maxlen, i, preprocessor_flag; + int trunc_flag = 0; static int buflen = 0; char *buffer; @@ -760,22 +764,13 @@ load_line (FILE * input, char **pbuf, char *filename, int linenum) else if (i >= buflen) { /* Truncate the rest of the line. */ - trunc_flag = 1; - for (;;) { c = fgetc (input); if (c == '\n' || c == EOF) break; - if (gfc_option.warn_line_truncation - && trunc_flag - && !gfc_is_whitespace (c)) - { - gfc_warning_now ("%s:%d: Line is being truncated", - filename, linenum); - trunc_flag = 0; - } + trunc_flag = 1; } ungetc ('\n', input); @@ -791,6 +786,8 @@ load_line (FILE * input, char **pbuf, char *filename, int linenum) *buffer++ = ' '; *buffer = '\0'; + + return trunc_flag; } @@ -1034,7 +1031,7 @@ load_file (char *filename, bool initial) for (;;) { - load_line (input, &line, filename, current_file->line); + int trunc = load_line (input, &line); len = strlen (line); if (feof (input) && len == 0) @@ -1066,6 +1063,7 @@ load_file (char *filename, bool initial) b->linenum = current_file->line++; #endif b->file = current_file; + b->truncated = trunc; strcpy (b->line, line); if (line_head == NULL) diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index c2117148839..fa6c2c6aa7c 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -409,9 +409,8 @@ gfc_simplify_dint (gfc_expr * e) gfc_expr * gfc_simplify_anint (gfc_expr * e, gfc_expr * k) { - gfc_expr *rtrunc, *result; - int kind, cmp; - mpfr_t half; + gfc_expr *result; + int kind; kind = get_kind (BT_REAL, k, "ANINT", e->ts.kind); if (kind == -1) @@ -422,29 +421,7 @@ gfc_simplify_anint (gfc_expr * e, gfc_expr * k) result = gfc_constant_result (e->ts.type, kind, &e->where); - rtrunc = gfc_copy_expr (e); - - cmp = mpfr_cmp_ui (e->value.real, 0); - - gfc_set_model_kind (kind); - mpfr_init (half); - mpfr_set_str (half, "0.5", 10, GFC_RND_MODE); - - if (cmp > 0) - { - mpfr_add (rtrunc->value.real, e->value.real, half, GFC_RND_MODE); - mpfr_trunc (result->value.real, rtrunc->value.real); - } - else if (cmp < 0) - { - mpfr_sub (rtrunc->value.real, e->value.real, half, GFC_RND_MODE); - mpfr_trunc (result->value.real, rtrunc->value.real); - } - else - mpfr_set_ui (result->value.real, 0, GFC_RND_MODE); - - gfc_free_expr (rtrunc); - mpfr_clear (half); + mpfr_round (result->value.real, e->value.real); return range_check (result, "ANINT"); } @@ -453,39 +430,14 @@ gfc_simplify_anint (gfc_expr * e, gfc_expr * k) gfc_expr * gfc_simplify_dnint (gfc_expr * e) { - gfc_expr *rtrunc, *result; - int cmp; - mpfr_t half; + gfc_expr *result; if (e->expr_type != EXPR_CONSTANT) return NULL; - result = - gfc_constant_result (BT_REAL, gfc_default_double_kind, &e->where); - - rtrunc = gfc_copy_expr (e); - - cmp = mpfr_cmp_ui (e->value.real, 0); - - gfc_set_model_kind (gfc_default_double_kind); - mpfr_init (half); - mpfr_set_str (half, "0.5", 10, GFC_RND_MODE); - - if (cmp > 0) - { - mpfr_add (rtrunc->value.real, e->value.real, half, GFC_RND_MODE); - mpfr_trunc (result->value.real, rtrunc->value.real); - } - else if (cmp < 0) - { - mpfr_sub (rtrunc->value.real, e->value.real, half, GFC_RND_MODE); - mpfr_trunc (result->value.real, rtrunc->value.real); - } - else - mpfr_set_ui (result->value.real, 0, GFC_RND_MODE); + result = gfc_constant_result (BT_REAL, gfc_default_double_kind, &e->where); - gfc_free_expr (rtrunc); - mpfr_clear (half); + mpfr_round (result->value.real, e->value.real); return range_check (result, "DNINT"); } @@ -967,6 +919,7 @@ gfc_simplify_exp (gfc_expr * x) gfc_expr * gfc_simplify_exponent (gfc_expr * x) { + int i; mpfr_t tmp; gfc_expr *result; @@ -991,6 +944,12 @@ gfc_simplify_exponent (gfc_expr * x) gfc_mpfr_to_mpz (result->value.integer, tmp); + /* The model number for tiny(x) is b**(emin - 1) where b is the base and emin + is the smallest exponent value. So, we need to add 1 if x is tiny(x). */ + i = gfc_validate_kind (x->ts.type, x->ts.kind, false); + if (mpfr_cmp (x->value.real, gfc_real_kinds[i].tiny) == 0) + mpz_add_ui (result->value.integer,result->value.integer, 1); + mpfr_clear (tmp); return range_check (result, "EXPONENT"); @@ -2304,64 +2263,71 @@ gfc_expr * gfc_simplify_nearest (gfc_expr * x, gfc_expr * s) { gfc_expr *result; - float rval; - double val, eps; - int p, i, k, match_float; - - /* FIXME: This implementation is dopey and probably not quite right, - but it's a start. */ + mpfr_t tmp; + int direction, sgn; - if (x->expr_type != EXPR_CONSTANT) + if (x->expr_type != EXPR_CONSTANT || s->expr_type != EXPR_CONSTANT) return NULL; - k = gfc_validate_kind (x->ts.type, x->ts.kind, false); - - result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); + gfc_set_model_kind (x->ts.kind); + result = gfc_copy_expr (x); - val = mpfr_get_d (x->value.real, GFC_RND_MODE); - p = gfc_real_kinds[k].digits; + direction = mpfr_sgn (s->value.real); - eps = 1.; - for (i = 1; i < p; ++i) + if (direction == 0) { - eps = eps / 2.; + gfc_error ("Second argument of NEAREST at %L may not be zero", + &s->where); + gfc_free (result); + return &gfc_bad_expr; } - /* TODO we should make sure that 'float' matches kind 4 */ - match_float = gfc_real_kinds[k].kind == 4; - if (mpfr_cmp_ui (s->value.real, 0) > 0) + /* TODO: Use mpfr_nextabove and mpfr_nextbelow once we move to a + newer version of mpfr. */ + + sgn = mpfr_sgn (x->value.real); + + if (sgn == 0) { - if (match_float) - { - rval = (float) val; - rval = rval + eps; - mpfr_set_d (result->value.real, rval, GFC_RND_MODE); - } + int k = gfc_validate_kind (BT_REAL, x->ts.kind, 0); + + if (direction > 0) + mpfr_add (result->value.real, + x->value.real, gfc_real_kinds[k].subnormal, GFC_RND_MODE); else - { - val = val + eps; - mpfr_set_d (result->value.real, val, GFC_RND_MODE); - } + mpfr_sub (result->value.real, + x->value.real, gfc_real_kinds[k].subnormal, GFC_RND_MODE); } - else if (mpfr_cmp_ui (s->value.real, 0) < 0) + else { - if (match_float) + if (sgn < 0) { - rval = (float) val; - rval = rval - eps; - mpfr_set_d (result->value.real, rval, GFC_RND_MODE); + direction = -direction; + mpfr_neg (result->value.real, result->value.real, GFC_RND_MODE); } + + if (direction > 0) + mpfr_add_one_ulp (result->value.real, GFC_RND_MODE); else { - val = val - eps; - mpfr_set_d (result->value.real, val, GFC_RND_MODE); + /* In this case the exponent can shrink, which makes us skip + over one number because we subtract one ulp with the + larger exponent. Thus we need to compensate for this. */ + mpfr_init_set (tmp, result->value.real, GFC_RND_MODE); + + mpfr_sub_one_ulp (result->value.real, GFC_RND_MODE); + mpfr_add_one_ulp (result->value.real, GFC_RND_MODE); + + /* If we're back to where we started, the spacing is one + ulp, and we get the correct result by subtracting. */ + if (mpfr_cmp (tmp, result->value.real) == 0) + mpfr_sub_one_ulp (result->value.real, GFC_RND_MODE); + + mpfr_clear (tmp); } - } - else - { - gfc_error ("Invalid second argument of NEAREST at %L", &s->where); - gfc_free (result); - return &gfc_bad_expr; + + if (sgn < 0) + mpfr_neg (result->value.real, result->value.real, GFC_RND_MODE); } return range_check (result, "NEAREST"); @@ -2371,9 +2337,8 @@ gfc_simplify_nearest (gfc_expr * x, gfc_expr * s) static gfc_expr * simplify_nint (const char *name, gfc_expr * e, gfc_expr * k) { - gfc_expr *rtrunc, *itrunc, *result; - int kind, cmp; - mpfr_t half; + gfc_expr *itrunc, *result; + int kind; kind = get_kind (BT_INTEGER, k, name, gfc_default_integer_kind); if (kind == -1) @@ -2384,33 +2349,13 @@ simplify_nint (const char *name, gfc_expr * e, gfc_expr * k) result = gfc_constant_result (BT_INTEGER, kind, &e->where); - rtrunc = gfc_copy_expr (e); itrunc = gfc_copy_expr (e); - cmp = mpfr_cmp_ui (e->value.real, 0); - - gfc_set_model (e->value.real); - mpfr_init (half); - mpfr_set_str (half, "0.5", 10, GFC_RND_MODE); - - if (cmp > 0) - { - mpfr_add (rtrunc->value.real, e->value.real, half, GFC_RND_MODE); - mpfr_trunc (itrunc->value.real, rtrunc->value.real); - } - else if (cmp < 0) - { - mpfr_sub (rtrunc->value.real, e->value.real, half, GFC_RND_MODE); - mpfr_trunc (itrunc->value.real, rtrunc->value.real); - } - else - mpfr_set_ui (itrunc->value.real, 0, GFC_RND_MODE); + mpfr_round(itrunc->value.real, e->value.real); gfc_mpfr_to_mpz (result->value.integer, itrunc->value.real); gfc_free_expr (itrunc); - gfc_free_expr (rtrunc); - mpfr_clear (half); return range_check (result, name); } diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 26e3f003442..5fb9f53db87 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -106,6 +106,14 @@ gfc_set_implicit_none (void) { int i; + if (gfc_current_ns->seen_implicit_none) + { + gfc_error ("Duplicate IMPLICIT NONE statement at %C"); + return; + } + + gfc_current_ns->seen_implicit_none = 1; + for (i = 0; i < GFC_LETTERS; i++) { gfc_clear_ts (&gfc_current_ns->default_type[i]); @@ -160,6 +168,12 @@ gfc_merge_new_implicit (gfc_typespec * ts) { int i; + if (gfc_current_ns->seen_implicit_none) + { + gfc_error ("Cannot specify IMPLICIT at %C after IMPLICIT NONE"); + return FAILURE; + } + for (i = 0; i < GFC_LETTERS; i++) { if (new_flag[i]) @@ -2410,7 +2424,7 @@ gfc_get_gsymbol (const char *name) s = gfc_getmem (sizeof (gfc_gsymbol)); s->type = GSYM_UNKNOWN; - strcpy (s->name, name); + s->name = gfc_get_string (name); gfc_insert_bbt (&gfc_gsym_root, s, gsym_compare); diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index b53f8629fd1..87e37ea6308 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -429,8 +429,8 @@ gfc_trans_allocate_array_storage (gfc_loopinfo * loop, gfc_ss_info * info, if (onstack) { /* Make a temporary variable to hold the data. */ - tmp = fold (build2 (MINUS_EXPR, TREE_TYPE (nelem), nelem, - integer_one_node)); + tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (nelem), nelem, + integer_one_node); tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp); tmp = build_array_type (gfc_get_element_type (TREE_TYPE (desc)), @@ -508,8 +508,8 @@ gfc_trans_allocate_temp_array (gfc_loopinfo * loop, gfc_ss_info * info, { /* Callee allocated arrays may not have a known bound yet. */ if (loop->to[n]) - loop->to[n] = fold (build2 (MINUS_EXPR, gfc_array_index_type, - loop->to[n], loop->from[n])); + loop->to[n] = fold_build2 (MINUS_EXPR, gfc_array_index_type, + loop->to[n], loop->from[n]); loop->from[n] = gfc_index_zero_node; } @@ -569,18 +569,18 @@ gfc_trans_allocate_temp_array (gfc_loopinfo * loop, gfc_ss_info * info, tmp = gfc_conv_descriptor_ubound (desc, gfc_rank_cst[n]); gfc_add_modify_expr (&loop->pre, tmp, loop->to[n]); - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - loop->to[n], gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + loop->to[n], gfc_index_one_node); - size = fold (build2 (MULT_EXPR, gfc_array_index_type, size, tmp)); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp); size = gfc_evaluate_now (size, &loop->pre); } /* Get the size of the array. */ nelem = size; if (size) - size = fold (build2 (MULT_EXPR, gfc_array_index_type, size, - TYPE_SIZE_UNIT (gfc_get_element_type (type)))); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, + TYPE_SIZE_UNIT (gfc_get_element_type (type))); gfc_trans_allocate_array_storage (loop, info, size, nelem); @@ -765,8 +765,8 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, gfc_trans_array_ctor_element (&body, pointer, *poffset, &se, c->expr); - *poffset = fold (build2 (PLUS_EXPR, gfc_array_index_type, - *poffset, gfc_index_one_node)); + *poffset = fold_build2 (PLUS_EXPR, gfc_array_index_type, + *poffset, gfc_index_one_node); } else { @@ -832,8 +832,8 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type, tmp); gfc_add_expr_to_block (&body, tmp); - *poffset = fold (build2 (PLUS_EXPR, gfc_array_index_type, - *poffset, bound)); + *poffset = fold_build2 (PLUS_EXPR, gfc_array_index_type, + *poffset, bound); } if (!INTEGER_CST_P (*poffset)) { @@ -1399,9 +1399,9 @@ gfc_conv_array_index_ref (gfc_se * se, tree pointer, tree * indices, { /* index = index + stride[n]*indices[n] */ tmp = gfc_conv_array_stride (se->expr, n); - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, indices[n], tmp)); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, indices[n], tmp); - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, index, tmp)); + index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, tmp); } /* Result = data[index]. */ @@ -1429,11 +1429,11 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n) index = gfc_evaluate_now (index, &se->pre); /* Check lower bound. */ tmp = gfc_conv_array_lbound (descriptor, n); - fault = fold (build2 (LT_EXPR, boolean_type_node, index, tmp)); + fault = fold_build2 (LT_EXPR, boolean_type_node, index, tmp); /* Check upper bound. */ tmp = gfc_conv_array_ubound (descriptor, n); - cond = fold (build2 (GT_EXPR, boolean_type_node, index, tmp)); - fault = fold (build2 (TRUTH_OR_EXPR, boolean_type_node, fault, cond)); + cond = fold_build2 (GT_EXPR, boolean_type_node, index, tmp); + fault = fold_build2 (TRUTH_OR_EXPR, boolean_type_node, fault, cond); gfc_trans_runtime_check (fault, gfc_strconst_fault, &se->pre); @@ -1528,10 +1528,10 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i, /* Multiply the loop variable by the stride and delta. */ index = se->loop->loopvar[i]; - index = fold (build2 (MULT_EXPR, gfc_array_index_type, index, - info->stride[i])); - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, index, - info->delta[i])); + index = fold_build2 (MULT_EXPR, gfc_array_index_type, index, + info->stride[i]); + index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, + info->delta[i]); if (ar->dimen_type[dim] == DIMEN_VECTOR) { @@ -1552,12 +1552,12 @@ gfc_conv_array_index_offset (gfc_se * se, gfc_ss_info * info, int dim, int i, gcc_assert (se->loop); index = se->loop->loopvar[se->loop->order[i]]; if (!integer_zerop (info->delta[i])) - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, - index, info->delta[i])); + index = fold_build2 (PLUS_EXPR, gfc_array_index_type, + index, info->delta[i]); } /* Multiply by the stride. */ - index = fold (build2 (MULT_EXPR, gfc_array_index_type, index, stride)); + index = fold_build2 (MULT_EXPR, gfc_array_index_type, index, stride); return index; } @@ -1583,7 +1583,7 @@ gfc_conv_scalarized_array_ref (gfc_se * se, gfc_array_ref * ar) info->stride0); /* Add the offset for this dimension to the stored offset for all other dimensions. */ - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, index, info->offset)); + index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, info->offset); tmp = gfc_build_indirect_ref (info->data); se->expr = gfc_build_array_ref (tmp, index); @@ -1643,25 +1643,25 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar) indexse.expr = gfc_evaluate_now (indexse.expr, &se->pre); tmp = gfc_conv_array_lbound (se->expr, n); - cond = fold (build2 (LT_EXPR, boolean_type_node, - indexse.expr, tmp)); + cond = fold_build2 (LT_EXPR, boolean_type_node, + indexse.expr, tmp); fault = - fold (build2 (TRUTH_OR_EXPR, boolean_type_node, fault, cond)); + fold_build2 (TRUTH_OR_EXPR, boolean_type_node, fault, cond); tmp = gfc_conv_array_ubound (se->expr, n); - cond = fold (build2 (GT_EXPR, boolean_type_node, - indexse.expr, tmp)); + cond = fold_build2 (GT_EXPR, boolean_type_node, + indexse.expr, tmp); fault = - fold (build2 (TRUTH_OR_EXPR, boolean_type_node, fault, cond)); + fold_build2 (TRUTH_OR_EXPR, boolean_type_node, fault, cond); } /* Multiply the index by the stride. */ stride = gfc_conv_array_stride (se->expr, n); - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, indexse.expr, - stride)); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, indexse.expr, + stride); /* And add it to the total. */ - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, index, tmp)); + index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, tmp); } if (flag_bounds_check) @@ -1669,7 +1669,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar) tmp = gfc_conv_array_offset (se->expr); if (!integer_zerop (tmp)) - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, index, tmp)); + index = fold_build2 (PLUS_EXPR, gfc_array_index_type, index, tmp); /* Access the calculated element. */ tmp = gfc_conv_array_data (se->expr); @@ -1730,8 +1730,8 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, stride); gfc_add_block_to_block (pblock, &se.pre); - info->offset = fold (build2 (PLUS_EXPR, gfc_array_index_type, - info->offset, index)); + info->offset = fold_build2 (PLUS_EXPR, gfc_array_index_type, + info->offset, index); info->offset = gfc_evaluate_now (info->offset, pblock); } @@ -1769,8 +1769,8 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, index = gfc_conv_array_index_offset (&se, info, info->dim[i], i, ar, stride); gfc_add_block_to_block (pblock, &se.pre); - info->offset = fold (build2 (PLUS_EXPR, gfc_array_index_type, - info->offset, index)); + info->offset = fold_build2 (PLUS_EXPR, gfc_array_index_type, + info->offset, index); info->offset = gfc_evaluate_now (info->offset, pblock); } @@ -2168,28 +2168,28 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop) /* Check lower bound. */ bound = gfc_conv_array_lbound (desc, dim); tmp = info->start[n]; - tmp = fold (build2 (LT_EXPR, boolean_type_node, tmp, bound)); - fault = fold (build2 (TRUTH_OR_EXPR, boolean_type_node, fault, - tmp)); + tmp = fold_build2 (LT_EXPR, boolean_type_node, tmp, bound); + fault = fold_build2 (TRUTH_OR_EXPR, boolean_type_node, fault, + tmp); /* Check the upper bound. */ bound = gfc_conv_array_ubound (desc, dim); end = gfc_conv_section_upper_bound (ss, n, &block); - tmp = fold (build2 (GT_EXPR, boolean_type_node, end, bound)); - fault = fold (build2 (TRUTH_OR_EXPR, boolean_type_node, fault, - tmp)); + tmp = fold_build2 (GT_EXPR, boolean_type_node, end, bound); + fault = fold_build2 (TRUTH_OR_EXPR, boolean_type_node, fault, + tmp); /* Check the section sizes match. */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, end, - info->start[n])); - tmp = fold (build2 (FLOOR_DIV_EXPR, gfc_array_index_type, tmp, - info->stride[n])); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, end, + info->start[n]); + tmp = fold_build2 (FLOOR_DIV_EXPR, gfc_array_index_type, tmp, + info->stride[n]); /* We remember the size of the first section, and check all the others against this. */ if (size[n]) { tmp = - fold (build2 (NE_EXPR, boolean_type_node, tmp, size[n])); + fold_build2 (NE_EXPR, boolean_type_node, tmp, size[n]); fault = build2 (TRUTH_OR_EXPR, boolean_type_node, fault, tmp); } @@ -2467,10 +2467,10 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) /* To = from + (size - 1) * stride. */ tmp = gfc_conv_mpz_to_tree (i, gfc_index_integer_kind); if (!integer_onep (info->stride[n])) - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, - tmp, info->stride[n])); - loop->to[n] = fold (build2 (PLUS_EXPR, gfc_array_index_type, - loop->from[n], tmp)); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, + tmp, info->stride[n]); + loop->to[n] = fold_build2 (PLUS_EXPR, gfc_array_index_type, + loop->from[n], tmp); } else { @@ -2508,10 +2508,10 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) with start = 0, this simplifies to last = end / step; for (i = 0; i<=last; i++){...}; */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - loop->to[n], loop->from[n])); - tmp = fold (build2 (TRUNC_DIV_EXPR, gfc_array_index_type, - tmp, info->stride[n])); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + loop->to[n], loop->from[n]); + tmp = fold_build2 (TRUNC_DIV_EXPR, gfc_array_index_type, + tmp, info->stride[n]); loop->to[n] = gfc_evaluate_now (tmp, &loop->pre); /* Make the loop variable start at 0. */ loop->from[n] = gfc_index_zero_node; @@ -2563,12 +2563,12 @@ gfc_conv_loop_setup (gfc_loopinfo * loop) { /* Calculate the offset relative to the loop variable. First multiply by the stride. */ - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, - loop->from[n], info->stride[n])); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, + loop->from[n], info->stride[n]); /* Then subtract this from our starting value. */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - info->start[n], tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + info->start[n], tmp); info->delta[n] = gfc_evaluate_now (tmp, &loop->pre); } @@ -2650,8 +2650,8 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, gfc_add_modify_expr (pblock, tmp, se.expr); /* Work out the offset for this component. */ - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, se.expr, stride)); - offset = fold (build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp)); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, se.expr, stride); + offset = fold_build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp); /* Start the calculation for the size of this dimension. */ size = build2 (MINUS_EXPR, gfc_array_index_type, @@ -2671,17 +2671,17 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset, gfc_add_modify_expr (pblock, tmp, stride); /* Calculate the size of this dimension. */ - size = fold (build2 (PLUS_EXPR, gfc_array_index_type, se.expr, size)); + size = fold_build2 (PLUS_EXPR, gfc_array_index_type, se.expr, size); /* Multiply the stride by the number of elements in this dimension. */ - stride = fold (build2 (MULT_EXPR, gfc_array_index_type, stride, size)); + stride = fold_build2 (MULT_EXPR, gfc_array_index_type, stride, size); stride = gfc_evaluate_now (stride, pblock); } /* The stride is the number of elements in the array, so multiply by the size of an element to get the total size. */ tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type)); - size = fold (build2 (MULT_EXPR, gfc_array_index_type, stride, tmp)); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, stride, tmp); if (poffset != NULL) { @@ -2957,8 +2957,8 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset, gfc_add_modify_expr (pblock, ubound, se.expr); } /* The offset of this dimension. offset = offset - lbound * stride. */ - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, lbound, size)); - offset = fold (build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp)); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, lbound, size); + offset = fold_build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp); /* The size of this dimension, and the stride of the next. */ if (dim + 1 < as->rank) @@ -2969,10 +2969,10 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset, if (ubound != NULL_TREE && !(stride && INTEGER_CST_P (stride))) { /* Calculate stride = size * (ubound + 1 - lbound). */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - gfc_index_one_node, lbound)); - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, ubound, tmp)); - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, size, tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + gfc_index_one_node, lbound); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, ubound, tmp); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp); if (stride) gfc_add_modify_expr (pblock, stride, tmp); else @@ -3045,7 +3045,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) /* The size is the number of elements in the array, so multiply by the size of an element to get the total size. */ tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type)); - size = fold (build2 (MULT_EXPR, gfc_array_index_type, size, tmp)); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp); /* Allocate memory to hold the data. */ tmp = gfc_chainon_list (NULL_TREE, size); @@ -3203,7 +3203,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) partial = gfc_create_var (boolean_type_node, "partial"); TREE_USED (partial) = 1; tmp = gfc_conv_descriptor_stride (dumdesc, gfc_rank_cst[0]); - tmp = fold (build2 (EQ_EXPR, boolean_type_node, tmp, integer_one_node)); + tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, integer_one_node); gfc_add_modify_expr (&block, partial, tmp); } else @@ -3304,11 +3304,11 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) { /* Check (ubound(a) - lbound(a) == ubound(b) - lbound(b)). */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - ubound, lbound)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + ubound, lbound); stride = build2 (MINUS_EXPR, gfc_array_index_type, dubound, dlbound); - tmp = fold (build2 (NE_EXPR, gfc_array_index_type, tmp, stride)); + tmp = fold_build2 (NE_EXPR, gfc_array_index_type, tmp, stride); gfc_trans_runtime_check (tmp, gfc_strconst_bounds, &block); } } @@ -3317,12 +3317,12 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) /* For assumed shape arrays move the upper bound by the same amount as the lower bound. */ tmp = build2 (MINUS_EXPR, gfc_array_index_type, dubound, dlbound); - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, tmp, lbound)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, lbound); gfc_add_modify_expr (&block, ubound, tmp); } /* The offset of this dimension. offset = offset - lbound * stride. */ - tmp = fold (build2 (MULT_EXPR, gfc_array_index_type, lbound, stride)); - offset = fold (build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp)); + tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, lbound, stride); + offset = fold_build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp); /* The size of this dimension, and the stride of the next. */ if (n + 1 < sym->as->rank) @@ -3343,12 +3343,12 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) else { /* Calculate stride = size * (ubound + 1 - lbound). */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - gfc_index_one_node, lbound)); - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - ubound, tmp)); - size = fold (build2 (MULT_EXPR, gfc_array_index_type, - size, tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + gfc_index_one_node, lbound); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + ubound, tmp); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, + size, tmp); stmt_packed = size; } @@ -3373,7 +3373,9 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body) /* Only do the entry/initialization code if the arg is present. */ dumdesc = GFC_DECL_SAVED_DESCRIPTOR (tmpdesc); - optional_arg = sym->attr.optional || sym->ns->proc_name->attr.entry_master; + optional_arg = (sym->attr.optional + || (sym->ns->proc_name->attr.entry_master + && sym->attr.dummy)); if (optional_arg) { tmp = gfc_conv_expr_present (sym); @@ -3759,10 +3761,10 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) } tmp = gfc_conv_array_lbound (desc, n); - tmp = fold (build2 (MINUS_EXPR, TREE_TYPE (tmp), start, tmp)); + tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (tmp), start, tmp); - tmp = fold (build2 (MULT_EXPR, TREE_TYPE (tmp), tmp, stride)); - offset = fold (build2 (PLUS_EXPR, TREE_TYPE (tmp), offset, tmp)); + tmp = fold_build2 (MULT_EXPR, TREE_TYPE (tmp), tmp, stride); + offset = fold_build2 (PLUS_EXPR, TREE_TYPE (tmp), offset, tmp); if (info->ref->u.ar.dimen_type[n] == DIMEN_ELEMENT) { @@ -3779,9 +3781,9 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) if (!integer_onep (from)) { /* Make sure the new section starts at 1. */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - gfc_index_one_node, from)); - to = fold (build2 (PLUS_EXPR, gfc_array_index_type, to, tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + gfc_index_one_node, from); + to = fold_build2 (PLUS_EXPR, gfc_array_index_type, to, tmp); from = gfc_index_one_node; } tmp = gfc_conv_descriptor_lbound (parm, gfc_rank_cst[dim]); @@ -3793,12 +3795,12 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss) /* Multiply the stride by the section stride to get the total stride. */ - stride = fold (build2 (MULT_EXPR, gfc_array_index_type, - stride, info->stride[dim])); + stride = fold_build2 (MULT_EXPR, gfc_array_index_type, + stride, info->stride[dim]); if (se->direct_byref) - base = fold (build2 (MINUS_EXPR, TREE_TYPE (base), - base, stride)); + base = fold_build2 (MINUS_EXPR, TREE_TYPE (base), + base, stride); /* Store the new stride. */ tmp = gfc_conv_descriptor_stride (parm, gfc_rank_cst[dim]); diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index c8db6e745e2..d164fe34940 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -379,7 +379,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init) backend declarations for all of the elements. */ static void -create_common (gfc_common_head *com, segment_info * head) +create_common (gfc_common_head *com, segment_info * head, bool saw_equiv) { segment_info *s, *next_s; tree union_type; @@ -388,8 +388,16 @@ create_common (gfc_common_head *com, segment_info * head) tree decl; bool is_init = false; - /* Declare the variables inside the common block. */ - union_type = make_node (UNION_TYPE); + /* Declare the variables inside the common block. + If the current common block contains any equivalence object, then + make a UNION_TYPE node, otherwise RECORD_TYPE. This will let the + alias analyzer work well when there is no address overlapping for + common variables in the current common block. */ + if (saw_equiv) + union_type = make_node (UNION_TYPE); + else + union_type = make_node (RECORD_TYPE); + rli = start_record_layout (union_type); field_link = &TYPE_FIELDS (union_type); @@ -703,7 +711,7 @@ find_equivalence (segment_info *n) segment list multiple times to include indirect equivalences. */ static void -add_equivalences (void) +add_equivalences (bool *saw_equiv) { segment_info *f; bool more; @@ -718,6 +726,8 @@ add_equivalences (void) { f->sym->equiv_built = 1; more = find_equivalence (f); + if (more) + *saw_equiv = true; } } } @@ -788,10 +798,12 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) HOST_WIDE_INT current_offset; unsigned HOST_WIDE_INT align; unsigned HOST_WIDE_INT max_align; + bool saw_equiv; common_segment = NULL; current_offset = 0; max_align = 1; + saw_equiv = false; /* Add symbols to the segment. */ for (sym = var_list; sym; sym = sym->common_next) @@ -821,7 +833,7 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) /* Add all objects directly or indirectly equivalenced with this symbol. */ - add_equivalences (); + add_equivalences (&saw_equiv); if (current_segment->offset < 0) gfc_error ("The equivalence set for '%s' cause an invalid " @@ -836,7 +848,7 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) requirements. Insert padding immediately before this segment. */ gfc_warning ("Padding of %d bytes required before '%s' in " - "COMMON '%s' at %L", offset, s->sym->name, + "COMMON '%s' at %L", (int)offset, s->sym->name, common->name, &common->where); } else @@ -862,10 +874,10 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) if (common_segment->offset != 0) { gfc_warning ("COMMON '%s' at %L requires %d bytes of padding at start", - common->name, &common->where, common_segment->offset); + common->name, &common->where, (int)common_segment->offset); } - create_common (common, common_segment); + create_common (common, common_segment, saw_equiv); } @@ -878,6 +890,7 @@ finish_equivalences (gfc_namespace *ns) gfc_symbol *sym; HOST_WIDE_INT offset; unsigned HOST_WIDE_INT align; + bool dummy; for (z = ns->equiv; z; z = z->next) for (y = z->eq; y; y = y->eq) @@ -888,7 +901,7 @@ finish_equivalences (gfc_namespace *ns) current_segment = get_segment_info (sym, 0); /* All objects directly or indirectly equivalenced with this symbol. */ - add_equivalences (); + add_equivalences (&dummy); /* Align the block. */ offset = align_segment (&align); @@ -899,7 +912,7 @@ finish_equivalences (gfc_namespace *ns) apply_segment_offset (current_segment, offset); /* Create the decl. */ - create_common (NULL, current_segment); + create_common (NULL, current_segment, true); break; } } diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c index 84a62e89e3b..57c34d7dd1b 100644 --- a/gcc/fortran/trans-const.c +++ b/gcc/fortran/trans-const.c @@ -141,6 +141,8 @@ gfc_conv_const_charlen (gfc_charlen * cl) { cl->backend_decl = gfc_conv_mpz_to_tree (cl->length->value.integer, cl->length->ts.kind); + cl->backend_decl = fold_convert (gfc_charlen_type_node, + cl->backend_decl); } } @@ -183,9 +185,9 @@ gfc_conv_mpz_to_tree (mpz_t i, int kind) size_t count; /* Since we know that the value is not zero (mpz_fits_slong_p), - we know that at one word will be written, but we don't know + we know that at least one word will be written, but we don't know about the second. It's quicker to zero the second word before - that conditionally clear it later. */ + than conditionally clear it later. */ words[1] = 0; /* Extract the absolute value into words. */ @@ -221,57 +223,32 @@ gfc_conv_mpfr_to_tree (mpfr_t f, int kind) tree res; tree type; mp_exp_t exp; - char *p; - char *q; + char *p, *q; int n; - int edigits; - for (n = 0; gfc_real_kinds[n].kind != 0; n++) - { - if (gfc_real_kinds[n].kind == kind) - break; - } - gcc_assert (gfc_real_kinds[n].kind); + n = gfc_validate_kind (BT_REAL, kind, false); - n = MAX (abs (gfc_real_kinds[n].min_exponent), - abs (gfc_real_kinds[n].max_exponent)); + gcc_assert (gfc_real_kinds[n].radix == 2); - edigits = 1; - while (n > 0) - { - n = n / 10; - edigits += 3; - } - - if (kind == gfc_default_double_kind) - p = mpfr_get_str (NULL, &exp, 10, 17, f, GFC_RND_MODE); - else - p = mpfr_get_str (NULL, &exp, 10, 8, f, GFC_RND_MODE); + /* mpfr chooses too small a number of hexadecimal digits if the + number of binary digits is not divisible by four, therefore we + have to explicitly request a sufficient number of digits here. */ + p = mpfr_get_str (NULL, &exp, 16, gfc_real_kinds[n].digits / 4 + 1, + f, GFC_RND_MODE); + /* REAL_VALUE_ATOF expects the exponent for mantissa * 2**exp, + mpfr_get_str returns the exponent for mantissa * 16**exp, adjust + for that. */ + exp *= 4; - /* We also have one minus sign, "e", "." and a null terminator. */ - q = (char *) gfc_getmem (strlen (p) + edigits + 4); + /* The additional 12 characters add space for the sprintf below. + This leaves 6 digits for the exponent which is certainly enough. */ + q = (char *) gfc_getmem (strlen (p) + 12); - if (p[0]) - { - if (p[0] == '-') - { - strcpy (&q[2], &p[1]); - q[0] = '-'; - q[1] = '.'; - } - else - { - strcpy (&q[1], p); - q[0] = '.'; - } - strcat (q, "e"); - sprintf (&q[strlen (q)], "%d", (int) exp); - } + if (p[0] == '-') + sprintf (q, "-0x.%sp%d", &p[1], (int) exp); else - { - strcpy (q, "0"); - } + sprintf (q, "0x.%sp%d", p, (int) exp); type = gfc_get_real_type (kind); res = build_real (type, REAL_VALUE_ATOF (q, TYPE_MODE (type))); diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 08dd72af697..3d89effb7c2 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -736,6 +736,10 @@ gfc_get_symbol_decl (gfc_symbol * sym) { sym->backend_decl = DECL_ARGUMENTS (sym->ns->proc_name->backend_decl); + /* For entry master function skip over the __entry + argument. */ + if (sym->ns->proc_name->attr.entry_master) + sym->backend_decl = TREE_CHAIN (sym->backend_decl); } /* Dummy variables should already have been created. */ @@ -897,7 +901,7 @@ gfc_get_extern_function_decl (gfc_symbol * sym) gfc_expr e; gfc_intrinsic_sym *isym; gfc_expr argexpr; - char s[GFC_MAX_SYMBOL_LEN]; + char s[GFC_MAX_SYMBOL_LEN + 13]; /* "f2c_specific" and '\0'. */ tree name; tree mangled_name; @@ -933,7 +937,18 @@ gfc_get_extern_function_decl (gfc_symbol * sym) gcc_assert (isym->formal->next->next == NULL); isym->resolve.f2 (&e, &argexpr, NULL); } - sprintf (s, "specific%s", e.value.function.name); + + if (gfc_option.flag_f2c + && ((e.ts.type == BT_REAL && e.ts.kind == gfc_default_real_kind) + || e.ts.type == BT_COMPLEX)) + { + /* Specific which needs a different implementation if f2c + calling conventions are used. */ + sprintf (s, "f2c_specific%s", e.value.function.name); + } + else + sprintf (s, "specific%s", e.value.function.name); + name = get_identifier (s); mangled_name = name; } @@ -1371,12 +1386,24 @@ build_entry_thunks (gfc_namespace * ns) args = tree_cons (NULL_TREE, tmp, NULL_TREE); string_args = NULL_TREE; - /* TODO: Pass return by reference parameters. */ - if (ns->proc_name->attr.function) - gfc_todo_error ("Functons with multiple entry points"); - + if (thunk_sym->attr.function) + { + if (gfc_return_by_reference (ns->proc_name)) + { + tree ref = DECL_ARGUMENTS (current_function_decl); + args = tree_cons (NULL_TREE, ref, args); + if (ns->proc_name->ts.type == BT_CHARACTER) + args = tree_cons (NULL_TREE, TREE_CHAIN (ref), + args); + } + } + for (formal = ns->proc_name->formal; formal; formal = formal->next) { + /* Ignore alternate returns. */ + if (formal->sym == NULL) + continue; + /* We don't have a clever way of identifying arguments, so resort to a brute-force search. */ for (thunk_formal = thunk_sym->formal; @@ -1415,7 +1442,47 @@ build_entry_thunks (gfc_namespace * ns) args = chainon (args, nreverse (string_args)); tmp = ns->proc_name->backend_decl; tmp = gfc_build_function_call (tmp, args); - /* TODO: function return value. */ + if (ns->proc_name->attr.mixed_entry_master) + { + tree union_decl, field; + tree master_type = TREE_TYPE (ns->proc_name->backend_decl); + + union_decl = build_decl (VAR_DECL, get_identifier ("__result"), + TREE_TYPE (master_type)); + DECL_ARTIFICIAL (union_decl) = 1; + DECL_EXTERNAL (union_decl) = 0; + TREE_PUBLIC (union_decl) = 0; + TREE_USED (union_decl) = 1; + layout_decl (union_decl, 0); + pushdecl (union_decl); + + DECL_CONTEXT (union_decl) = current_function_decl; + tmp = build2 (MODIFY_EXPR, + TREE_TYPE (union_decl), + union_decl, tmp); + gfc_add_expr_to_block (&body, tmp); + + for (field = TYPE_FIELDS (TREE_TYPE (union_decl)); + field; field = TREE_CHAIN (field)) + if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), + thunk_sym->result->name) == 0) + break; + gcc_assert (field != NULL_TREE); + tmp = build3 (COMPONENT_REF, TREE_TYPE (field), union_decl, field, + NULL_TREE); + tmp = build2 (MODIFY_EXPR, + TREE_TYPE (DECL_RESULT (current_function_decl)), + DECL_RESULT (current_function_decl), tmp); + tmp = build1_v (RETURN_EXPR, tmp); + } + else if (TREE_TYPE (DECL_RESULT (current_function_decl)) + != void_type_node) + { + tmp = build2 (MODIFY_EXPR, + TREE_TYPE (DECL_RESULT (current_function_decl)), + DECL_RESULT (current_function_decl), tmp); + tmp = build1_v (RETURN_EXPR, tmp); + } gfc_add_expr_to_block (&body, tmp); /* Finish off this function and send it for code generation. */ @@ -1444,10 +1511,19 @@ build_entry_thunks (gfc_namespace * ns) points and the master function. Clear them so that they are recreated for each function. */ for (formal = thunk_sym->formal; formal; formal = formal->next) + if (formal->sym != NULL) /* Ignore alternate returns. */ + { + formal->sym->backend_decl = NULL_TREE; + if (formal->sym->ts.type == BT_CHARACTER) + formal->sym->ts.cl->backend_decl = NULL_TREE; + } + + if (thunk_sym->attr.function) { - formal->sym->backend_decl = NULL_TREE; - if (formal->sym->ts.type == BT_CHARACTER) - formal->sym->ts.cl->backend_decl = NULL_TREE; + if (thunk_sym->ts.type == BT_CHARACTER) + thunk_sym->ts.cl->backend_decl = NULL_TREE; + if (thunk_sym->result->ts.type == BT_CHARACTER) + thunk_sym->result->ts.cl->backend_decl = NULL_TREE; } } @@ -1482,6 +1558,29 @@ gfc_get_fake_result_decl (gfc_symbol * sym) char name[GFC_MAX_SYMBOL_LEN + 10]; + if (sym + && sym->ns->proc_name->backend_decl == current_function_decl + && sym->ns->proc_name->attr.mixed_entry_master + && sym != sym->ns->proc_name) + { + decl = gfc_get_fake_result_decl (sym->ns->proc_name); + if (decl) + { + tree field; + + for (field = TYPE_FIELDS (TREE_TYPE (decl)); + field; field = TREE_CHAIN (field)) + if (strcmp (IDENTIFIER_POINTER (DECL_NAME (field)), + sym->name) == 0) + break; + + gcc_assert (field != NULL_TREE); + decl = build3 (COMPONENT_REF, TREE_TYPE (field), decl, field, + NULL_TREE); + } + return decl; + } + if (current_fake_result_decl != NULL_TREE) return current_fake_result_decl; @@ -1499,7 +1598,11 @@ gfc_get_fake_result_decl (gfc_symbol * sym) if (gfc_return_by_reference (sym)) { - decl = DECL_ARGUMENTS (sym->backend_decl); + decl = DECL_ARGUMENTS (current_function_decl); + + if (sym->ns->proc_name->backend_decl == current_function_decl + && sym->ns->proc_name->attr.entry_master) + decl = TREE_CHAIN (decl); TREE_USED (decl) = 1; if (sym->as) @@ -1916,11 +2019,17 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody) { if (!current_fake_result_decl) { - warning ("Function does not return a value"); - return fnbody; + gfc_entry_list *el = NULL; + if (proc_sym->attr.entry_master) + { + for (el = proc_sym->ns->entries; el; el = el->next) + if (el->sym != el->sym->result) + break; + } + if (el == NULL) + warning (0, "Function does not return a value"); } - - if (proc_sym->as) + else if (proc_sym->as) { fnbody = gfc_trans_dummy_array_bias (proc_sym, current_fake_result_decl, @@ -1932,7 +2041,8 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody) fnbody = gfc_trans_dummy_character (proc_sym->ts.cl, fnbody); } else - gfc_todo_error ("Deferred non-array return by reference"); + gcc_assert (gfc_option.flag_f2c + && proc_sym->ts.type == BT_COMPLEX); } for (sym = proc_sym->tlink; sym != proc_sym; sym = sym->tlink) @@ -2111,12 +2221,12 @@ generate_local_decl (gfc_symbol * sym) if (sym->attr.referenced) gfc_get_symbol_decl (sym); else if (sym->attr.dummy && warn_unused_parameter) - warning ("unused parameter %qs", sym->name); + warning (0, "unused parameter %qs", sym->name); /* Warn for unused variables, but not if they're inside a common block or are use-associated. */ else if (warn_unused_variable && !(sym->attr.in_common || sym->attr.use_assoc)) - warning ("unused variable %qs", sym->name); + warning (0, "unused variable %qs", sym->name); } } @@ -2206,6 +2316,19 @@ gfc_generate_function_code (gfc_namespace * ns) gfc_generate_contained_functions (ns); + if (ns->entries && ns->proc_name->ts.type == BT_CHARACTER) + { + /* Copy length backend_decls to all entry point result + symbols. */ + gfc_entry_list *el; + tree backend_decl; + + gfc_conv_const_charlen (ns->proc_name->ts.cl); + backend_decl = ns->proc_name->result->ts.cl->backend_decl; + for (el = ns->entries; el; el = el->next) + el->sym->result->ts.cl->backend_decl = backend_decl; + } + /* Translate COMMON blocks. */ gfc_trans_common (ns); @@ -2257,7 +2380,7 @@ gfc_generate_function_code (gfc_namespace * ns) result = sym->result->backend_decl; if (result == NULL_TREE) - warning ("Function return value not set"); + warning (0, "Function return value not set"); else { /* Set the return value to the dummy result variable. */ diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index b79d0743dec..52a532d2408 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -115,14 +115,15 @@ gfc_make_safe_expr (gfc_se * se) } -/* Return an expression which determines if a dummy parameter is present. */ +/* Return an expression which determines if a dummy parameter is present. + Also used for arguments to procedures with multiple entry points. */ tree gfc_conv_expr_present (gfc_symbol * sym) { tree decl; - gcc_assert (sym->attr.dummy && sym->attr.optional); + gcc_assert (sym->attr.dummy); decl = gfc_get_symbol_decl (sym); if (TREE_CODE (decl) != PARM_DECL) @@ -308,11 +309,43 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) } else { + tree se_expr = NULL_TREE; + se->expr = gfc_get_symbol_decl (sym); + /* Special case for assigning the return value of a function. + Self recursive functions must have an explicit return value. */ + if (se->expr == current_function_decl && sym->attr.function + && (sym->result == sym)) + se_expr = gfc_get_fake_result_decl (sym); + + /* Similarly for alternate entry points. */ + else if (sym->attr.function && sym->attr.entry + && (sym->result == sym) + && sym->ns->proc_name->backend_decl == current_function_decl) + { + gfc_entry_list *el = NULL; + + for (el = sym->ns->entries; el; el = el->next) + if (sym == el->sym) + { + se_expr = gfc_get_fake_result_decl (sym); + break; + } + } + + else if (sym->attr.result + && sym->ns->proc_name->backend_decl == current_function_decl + && sym->ns->proc_name->attr.entry_master + && !gfc_return_by_reference (sym->ns->proc_name)) + se_expr = gfc_get_fake_result_decl (sym); + + if (se_expr) + se->expr = se_expr; + /* Procedure actual arguments. */ - if (sym->attr.flavor == FL_PROCEDURE - && se->expr != current_function_decl) + else if (sym->attr.flavor == FL_PROCEDURE + && se->expr != current_function_decl) { gcc_assert (se->want_pointer); if (!sym->attr.dummy) @@ -323,20 +356,19 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) return; } - /* Special case for assigning the return value of a function. - Self recursive functions must have an explicit return value. */ - if (se->expr == current_function_decl && sym->attr.function - && (sym->result == sym)) - { - se->expr = gfc_get_fake_result_decl (sym); - } - /* Dereference scalar dummy variables. */ if (sym->attr.dummy && sym->ts.type != BT_CHARACTER && !sym->attr.dimension) se->expr = gfc_build_indirect_ref (se->expr); + /* Dereference scalar hidden result. */ + if (gfc_option.flag_f2c + && (sym->attr.function || sym->attr.result) + && sym->ts.type == BT_COMPLEX + && !sym->attr.dimension) + se->expr = gfc_build_indirect_ref (se->expr); + /* Dereference pointer variables. */ if ((sym->attr.pointer || sym->attr.allocatable) && (sym->attr.dummy @@ -513,7 +545,7 @@ gfc_conv_powi (gfc_se * se, int n, tree * tmpvar) op1 = op0; } - tmp = fold (build2 (MULT_EXPR, TREE_TYPE (op0), op0, op1)); + tmp = fold_build2 (MULT_EXPR, TREE_TYPE (op0), op0, op1); tmp = gfc_evaluate_now (tmp, &se->pre); if (n < POWI_TABLE_SIZE) @@ -738,9 +770,8 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len) if (gfc_can_put_var_on_stack (len)) { /* Create a temporary variable to hold the result. */ - tmp = fold (build2 (MINUS_EXPR, gfc_charlen_type_node, len, - convert (gfc_charlen_type_node, - integer_one_node))); + tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, len, + convert (gfc_charlen_type_node, integer_one_node)); tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp); tmp = build_array_type (gfc_character1_type_node, tmp); var = gfc_create_var (tmp, "str"); @@ -797,8 +828,8 @@ gfc_conv_concat_op (gfc_se * se, gfc_expr * expr) len = TYPE_MAX_VALUE (TYPE_DOMAIN (type)); if (len == NULL_TREE) { - len = fold (build2 (PLUS_EXPR, TREE_TYPE (lse.string_length), - lse.string_length, rse.string_length)); + len = fold_build2 (PLUS_EXPR, TREE_TYPE (lse.string_length), + lse.string_length, rse.string_length); } type = build_pointer_type (type); @@ -990,11 +1021,11 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr) if (lop) { /* The result of logical ops is always boolean_type_node. */ - tmp = fold (build2 (code, type, lse.expr, rse.expr)); + tmp = fold_build2 (code, type, lse.expr, rse.expr); se->expr = convert (type, tmp); } else - se->expr = fold (build2 (code, type, lse.expr, rse.expr)); + se->expr = fold_build2 (code, type, lse.expr, rse.expr); /* Add the post blocks. */ gfc_add_block_to_block (&se->post, &rse.post); @@ -1114,7 +1145,13 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, convert (gfc_charlen_type_node, len)); } else - gcc_unreachable (); + { + gcc_assert (gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX); + + type = gfc_get_complex_type (sym->ts.kind); + var = gfc_build_addr_expr (NULL, gfc_create_var (type, "cmplx")); + arglist = gfc_chainon_list (arglist, var); + } } formal = sym->formal; @@ -1216,14 +1253,25 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, se->expr = build3 (CALL_EXPR, TREE_TYPE (fntype), se->expr, arglist, NULL_TREE); + if (sym->result) + sym = sym->result; + /* If we have a pointer function, but we don't want a pointer, e.g. something like x = f() where f is pointer valued, we have to dereference the result. */ - if (!se->want_pointer && !byref - && (sym->attr.pointer || (sym->result && sym->result->attr.pointer))) + if (!se->want_pointer && !byref && sym->attr.pointer) se->expr = gfc_build_indirect_ref (se->expr); + /* f2c calling conventions require a scalar default real function to + return a double precision result. Convert this back to default + real. We only care about the cases that can happen in Fortran 77. + */ + if (gfc_option.flag_f2c && sym->ts.type == BT_REAL + && sym->ts.kind == gfc_default_real_kind + && !sym->attr.always_explicit) + se->expr = fold_convert (gfc_get_real_type (sym->ts.kind), se->expr); + /* A pure function may still have side-effects - it may modify its parameters. */ TREE_SIDE_EFFECTS (se->expr) = 1; @@ -1240,7 +1288,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, if (!se->direct_byref) { - if (sym->result->attr.dimension) + if (sym->attr.dimension) { if (flag_bounds_check) { @@ -1258,7 +1306,10 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, se->string_length = len; } else - gcc_unreachable (); + { + gcc_assert (sym->ts.type == BT_COMPLEX && gfc_option.flag_f2c); + se->expr = gfc_build_indirect_ref (var); + } } } } diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index f24db5fe7f9..97f00dc441a 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -264,11 +264,11 @@ build_round_expr (stmtblock_t * pblock, tree arg, tree type) neg = build_real (argtype, r); tmp = gfc_build_const (argtype, integer_zero_node); - cond = fold (build2 (GT_EXPR, boolean_type_node, arg, tmp)); + cond = fold_build2 (GT_EXPR, boolean_type_node, arg, tmp); - tmp = fold (build3 (COND_EXPR, argtype, cond, pos, neg)); - tmp = fold (build2 (PLUS_EXPR, argtype, arg, tmp)); - return fold (build1 (FIX_TRUNC_EXPR, type, tmp)); + tmp = fold_build3 (COND_EXPR, argtype, cond, pos, neg); + tmp = fold_build2 (PLUS_EXPR, argtype, arg, tmp); + return fold_build1 (FIX_TRUNC_EXPR, type, tmp); } @@ -277,7 +277,8 @@ build_round_expr (stmtblock_t * pblock, tree arg, tree type) however the RTL expander only actually supports FIX_TRUNC_EXPR. */ static tree -build_fix_expr (stmtblock_t * pblock, tree arg, tree type, int op) +build_fix_expr (stmtblock_t * pblock, tree arg, tree type, + enum tree_code op) { switch (op) { @@ -300,14 +301,15 @@ build_fix_expr (stmtblock_t * pblock, tree arg, tree type, int op) /* Round a real value using the specified rounding mode. We use a temporary integer of that same kind size as the result. - Values larger than can be represented by this kind are unchanged, as - will not be accurate enough to represent the rounding. + Values larger than those that can be represented by this kind are + unchanged, as thay will not be accurate enough to represent the + rounding. huge = HUGE (KIND (a)) aint (a) = ((a > huge) || (a < -huge)) ? a : (real)(int)a */ static void -gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, int op) +gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, enum tree_code op) { tree type; tree itype; @@ -337,17 +339,21 @@ gfc_conv_intrinsic_aint (gfc_se * se, gfc_expr * expr, int op) } break; - case FIX_FLOOR_EXPR: + case FIX_TRUNC_EXPR: switch (kind) { case 4: - n = BUILT_IN_FLOORF; + n = BUILT_IN_TRUNCF; break; case 8: - n = BUILT_IN_FLOOR; + n = BUILT_IN_TRUNC; break; } + break; + + default: + gcc_unreachable (); } /* Evaluate the argument. */ @@ -645,8 +651,8 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) gcc_assert (se->ss->expr == expr); gfc_advance_se_ss_chain (se); bound = se->loop->loopvar[0]; - bound = fold (build2 (MINUS_EXPR, gfc_array_index_type, bound, - se->loop->from[0])); + bound = fold_build2 (MINUS_EXPR, gfc_array_index_type, bound, + se->loop->from[0]); } else { @@ -657,8 +663,8 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) gfc_add_block_to_block (&se->pre, &argse.pre); bound = argse.expr; /* Convert from one based to zero based. */ - bound = fold (build2 (MINUS_EXPR, gfc_array_index_type, bound, - gfc_index_one_node)); + bound = fold_build2 (MINUS_EXPR, gfc_array_index_type, bound, + gfc_index_one_node); } /* TODO: don't re-evaluate the descriptor on each iteration. */ @@ -683,11 +689,11 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper) if (flag_bounds_check) { bound = gfc_evaluate_now (bound, &se->pre); - cond = fold (build2 (LT_EXPR, boolean_type_node, - bound, build_int_cst (TREE_TYPE (bound), 0))); + cond = fold_build2 (LT_EXPR, boolean_type_node, + bound, build_int_cst (TREE_TYPE (bound), 0)); tmp = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc))]; - tmp = fold (build2 (GE_EXPR, boolean_type_node, bound, tmp)); - cond = fold(build2 (TRUTH_ORIF_EXPR, boolean_type_node, cond, tmp)); + tmp = fold_build2 (GE_EXPR, boolean_type_node, bound, tmp); + cond = fold_build2 (TRUTH_ORIF_EXPR, boolean_type_node, cond, tmp); gfc_trans_runtime_check (cond, gfc_strconst_fault, &se->pre); } } @@ -765,7 +771,7 @@ gfc_conv_intrinsic_cmplx (gfc_se * se, gfc_expr * expr, int both) else imag = build_real_from_int_cst (TREE_TYPE (type), integer_zero_node); - se->expr = fold (build2 (COMPLEX_EXPR, type, real, imag)); + se->expr = fold_build2 (COMPLEX_EXPR, type, real, imag); } /* Remainder function MOD(A, P) = A - INT(A / P) * P @@ -903,11 +909,11 @@ gfc_conv_intrinsic_sign (gfc_se * se, gfc_expr * expr) type = TREE_TYPE (arg); zero = gfc_build_const (type, integer_zero_node); - testa = fold (build2 (GE_EXPR, boolean_type_node, arg, zero)); - testb = fold (build2 (GE_EXPR, boolean_type_node, arg2, zero)); - tmp = fold (build2 (TRUTH_XOR_EXPR, boolean_type_node, testa, testb)); - se->expr = fold (build3 (COND_EXPR, type, tmp, - build1 (NEGATE_EXPR, type, arg), arg)); + testa = fold_build2 (GE_EXPR, boolean_type_node, arg, zero); + testb = fold_build2 (GE_EXPR, boolean_type_node, arg2, zero); + tmp = fold_build2 (TRUTH_XOR_EXPR, boolean_type_node, testa, testb); + se->expr = fold_build3 (COND_EXPR, type, tmp, + build1 (NEGATE_EXPR, type, arg), arg); } @@ -1433,7 +1439,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) /* Most negative(+HUGE) for maxval, most negative (-HUGE) for minval. */ if (op == GT_EXPR) - tmp = fold (build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp)); + tmp = fold_build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp); gfc_add_modify_expr (&se->pre, limit, tmp); /* Initialize the scalarizer. */ @@ -1452,12 +1458,12 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) size we need to return zero. Otherwise use the first element of the array, in case all elements are equal to the limit. i.e. pos = (ubound >= lbound) ? lbound, lbound - 1; */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - loop.from[0], gfc_index_one_node)); - cond = fold (build2 (GE_EXPR, boolean_type_node, - loop.to[0], loop.from[0])); - tmp = fold (build3 (COND_EXPR, gfc_array_index_type, cond, - loop.from[0], tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + loop.from[0], gfc_index_one_node); + cond = fold_build2 (GE_EXPR, boolean_type_node, + loop.to[0], loop.from[0]); + tmp = fold_build3 (COND_EXPR, gfc_array_index_type, cond, + loop.from[0], tmp); gfc_add_modify_expr (&loop.pre, pos, tmp); gfc_mark_ss_chain_used (arrayss, 1); @@ -1521,9 +1527,9 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op) gfc_cleanup_loop (&loop); /* Return a value in the range 1..SIZE(array). */ - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, loop.from[0], - gfc_index_one_node)); - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, pos, tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, loop.from[0], + gfc_index_one_node); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, pos, tmp); /* And convert to the required type. */ se->expr = convert (type, tmp); } @@ -1573,7 +1579,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op) /* Most negative(-HUGE) for maxval, most positive (-HUGE) for minval. */ if (op == GT_EXPR) - tmp = fold (build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp)); + tmp = fold_build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp); gfc_add_modify_expr (&se->pre, limit, tmp); /* Walk the arguments. */ @@ -1670,8 +1676,8 @@ gfc_conv_intrinsic_btest (gfc_se * se, gfc_expr * expr) tmp = build2 (LSHIFT_EXPR, type, build_int_cst (type, 1), arg2); tmp = build2 (BIT_AND_EXPR, type, arg, tmp); - tmp = fold (build2 (NE_EXPR, boolean_type_node, tmp, - build_int_cst (type, 0))); + tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp, + build_int_cst (type, 0)); type = gfc_typenode_for_spec (&expr->ts); se->expr = convert (type, tmp); } @@ -1689,7 +1695,7 @@ gfc_conv_intrinsic_bitop (gfc_se * se, gfc_expr * expr, int op) arg = TREE_VALUE (arg); type = TREE_TYPE (arg); - se->expr = fold (build2 (op, type, arg, arg2)); + se->expr = fold_build2 (op, type, arg, arg2); } /* Bitwise not. */ @@ -1719,15 +1725,15 @@ gfc_conv_intrinsic_singlebitop (gfc_se * se, gfc_expr * expr, int set) arg = TREE_VALUE (arg); type = TREE_TYPE (arg); - tmp = fold (build2 (LSHIFT_EXPR, type, build_int_cst (type, 1), arg2)); + tmp = fold_build2 (LSHIFT_EXPR, type, build_int_cst (type, 1), arg2); if (set) op = BIT_IOR_EXPR; else { op = BIT_AND_EXPR; - tmp = fold (build1 (BIT_NOT_EXPR, type, tmp)); + tmp = fold_build1 (BIT_NOT_EXPR, type, tmp); } - se->expr = fold (build2 (op, type, arg, tmp)); + se->expr = fold_build2 (op, type, arg, tmp); } /* Extract a sequence of bits. @@ -1755,7 +1761,7 @@ gfc_conv_intrinsic_ibits (gfc_se * se, gfc_expr * expr) tmp = build2 (RSHIFT_EXPR, type, arg, arg2); - se->expr = fold (build2 (BIT_AND_EXPR, type, tmp, mask)); + se->expr = fold_build2 (BIT_AND_EXPR, type, tmp, mask); } /* ISHFT (I, SHIFT) = (abs (shift) >= BIT_SIZE (i)) @@ -1782,10 +1788,10 @@ gfc_conv_intrinsic_ishft (gfc_se * se, gfc_expr * expr) type = TREE_TYPE (arg); utype = gfc_unsigned_type (type); - width = fold (build1 (ABS_EXPR, TREE_TYPE (arg2), arg2)); + width = fold_build1 (ABS_EXPR, TREE_TYPE (arg2), arg2); /* Left shift if positive. */ - lshift = fold (build2 (LSHIFT_EXPR, type, arg, width)); + lshift = fold_build2 (LSHIFT_EXPR, type, arg, width); /* Right shift if negative. We convert to an unsigned type because we want a logical shift. @@ -1795,18 +1801,18 @@ gfc_conv_intrinsic_ishft (gfc_se * se, gfc_expr * expr) rshift = fold_convert (type, build2 (RSHIFT_EXPR, utype, convert (utype, arg), width)); - tmp = fold (build2 (GE_EXPR, boolean_type_node, arg2, - build_int_cst (TREE_TYPE (arg2), 0))); - tmp = fold (build3 (COND_EXPR, type, tmp, lshift, rshift)); + tmp = fold_build2 (GE_EXPR, boolean_type_node, arg2, + build_int_cst (TREE_TYPE (arg2), 0)); + tmp = fold_build3 (COND_EXPR, type, tmp, lshift, rshift); /* The Fortran standard allows shift widths <= BIT_SIZE(I), whereas gcc requires a shift width < BIT_SIZE(I), so we have to catch this special case. */ num_bits = build_int_cst (TREE_TYPE (arg2), TYPE_PRECISION (type)); - cond = fold (build2 (GE_EXPR, boolean_type_node, width, num_bits)); + cond = fold_build2 (GE_EXPR, boolean_type_node, width, num_bits); - se->expr = fold (build3 (COND_EXPR, type, cond, - build_int_cst (type, 0), tmp)); + se->expr = fold_build3 (COND_EXPR, type, cond, + build_int_cst (type, 0), tmp); } /* Circular shift. AKA rotate or barrel shift. */ @@ -1872,19 +1878,19 @@ gfc_conv_intrinsic_ishftc (gfc_se * se, gfc_expr * expr) type = TREE_TYPE (arg); /* Rotate left if positive. */ - lrot = fold (build2 (LROTATE_EXPR, type, arg, arg2)); + lrot = fold_build2 (LROTATE_EXPR, type, arg, arg2); /* Rotate right if negative. */ - tmp = fold (build1 (NEGATE_EXPR, TREE_TYPE (arg2), arg2)); - rrot = fold (build2 (RROTATE_EXPR, type, arg, tmp)); + tmp = fold_build1 (NEGATE_EXPR, TREE_TYPE (arg2), arg2); + rrot = fold_build2 (RROTATE_EXPR, type, arg, tmp); zero = build_int_cst (TREE_TYPE (arg2), 0); - tmp = fold (build2 (GT_EXPR, boolean_type_node, arg2, zero)); - rrot = fold (build3 (COND_EXPR, type, tmp, lrot, rrot)); + tmp = fold_build2 (GT_EXPR, boolean_type_node, arg2, zero); + rrot = fold_build3 (COND_EXPR, type, tmp, lrot, rrot); /* Do nothing if shift == 0. */ - tmp = fold (build2 (EQ_EXPR, boolean_type_node, arg2, zero)); - se->expr = fold (build3 (COND_EXPR, type, tmp, arg, rrot)); + tmp = fold_build2 (EQ_EXPR, boolean_type_node, arg2, zero); + se->expr = fold_build3 (COND_EXPR, type, tmp, arg, rrot); } /* The length of a character string. */ @@ -2037,7 +2043,7 @@ gfc_conv_intrinsic_merge (gfc_se * se, gfc_expr * expr) se->string_length = len; } type = TREE_TYPE (tsource); - se->expr = fold (build3 (COND_EXPR, type, mask, tsource, fsource)); + se->expr = fold_build3 (COND_EXPR, type, mask, tsource, fsource); } @@ -2374,18 +2380,18 @@ prepare_arg_info (gfc_se * se, gfc_expr * expr, rcs->fdigits = convert (masktype, tmp); wbits = build_int_cst (NULL_TREE, TYPE_PRECISION (rcs->type) - 1); wbits = convert (masktype, wbits); - rcs->edigits = fold (build2 (MINUS_EXPR, masktype, wbits, tmp)); + rcs->edigits = fold_build2 (MINUS_EXPR, masktype, wbits, tmp); /* Form masks for exponent/fraction/sign */ one = gfc_build_const (masktype, integer_one_node); - rcs->smask = fold (build2 (LSHIFT_EXPR, masktype, one, wbits)); - rcs->f1 = fold (build2 (LSHIFT_EXPR, masktype, one, rcs->fdigits)); - rcs->emask = fold (build2 (MINUS_EXPR, masktype, rcs->smask, rcs->f1)); - rcs->fmask = fold (build2 (MINUS_EXPR, masktype, rcs->f1, one)); + rcs->smask = fold_build2 (LSHIFT_EXPR, masktype, one, wbits); + rcs->f1 = fold_build2 (LSHIFT_EXPR, masktype, one, rcs->fdigits); + rcs->emask = fold_build2 (MINUS_EXPR, masktype, rcs->smask, rcs->f1); + rcs->fmask = fold_build2 (MINUS_EXPR, masktype, rcs->f1, one); /* Form bias. */ - tmp = fold (build2 (MINUS_EXPR, masktype, rcs->edigits, one)); - tmp = fold (build2 (LSHIFT_EXPR, masktype, one, tmp)); - rcs->bias = fold (build2 (MINUS_EXPR, masktype, tmp ,one)); + tmp = fold_build2 (MINUS_EXPR, masktype, rcs->edigits, one); + tmp = fold_build2 (LSHIFT_EXPR, masktype, one, tmp); + rcs->bias = fold_build2 (MINUS_EXPR, masktype, tmp ,one); if (all) { @@ -2510,7 +2516,7 @@ gfc_conv_intrinsic_rrspacing (gfc_se * se, gfc_expr * expr) fraction = rcs.frac; one = gfc_build_const (masktype, integer_one_node); zero = gfc_build_const (masktype, integer_zero_node); - t2 = fold (build2 (PLUS_EXPR, masktype, rcs.edigits, one)); + t2 = fold_build2 (PLUS_EXPR, masktype, rcs.edigits, one); t1 = call_builtin_clz (masktype, fraction); tmp = build2 (PLUS_EXPR, masktype, t1, one); @@ -2519,8 +2525,8 @@ gfc_conv_intrinsic_rrspacing (gfc_se * se, gfc_expr * expr) cond = build2 (EQ_EXPR, boolean_type_node, rcs.expn, zero); fraction = build3 (COND_EXPR, masktype, cond, tmp, fraction); - tmp = fold (build2 (PLUS_EXPR, masktype, rcs.bias, fdigits)); - tmp = fold (build2 (LSHIFT_EXPR, masktype, tmp, fdigits)); + tmp = fold_build2 (PLUS_EXPR, masktype, rcs.bias, fdigits); + tmp = fold_build2 (LSHIFT_EXPR, masktype, tmp, fdigits); tmp = build2 (BIT_IOR_EXPR, masktype, tmp, fraction); cond2 = build2 (EQ_EXPR, boolean_type_node, rcs.frac, zero); @@ -2634,7 +2640,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr) len = TREE_VALUE (args); tmp = gfc_advance_chain (args, 2); ncopies = TREE_VALUE (tmp); - len = fold (build2 (MULT_EXPR, gfc_int4_type_node, len, ncopies)); + len = fold_build2 (MULT_EXPR, gfc_int4_type_node, len, ncopies); type = gfc_get_character_type (expr->ts.kind, expr->ts.cl); var = gfc_conv_string_tmp (se, build_pointer_type (type), len); @@ -2977,6 +2983,7 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr) gfc_conv_intrinsic_bound (se, expr, 1); break; + case GFC_ISYM_CHDIR: case GFC_ISYM_DOT_PRODUCT: case GFC_ISYM_ETIME: case GFC_ISYM_FNUM: @@ -2985,12 +2992,20 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr) case GFC_ISYM_GETGID: case GFC_ISYM_GETPID: case GFC_ISYM_GETUID: + case GFC_ISYM_HOSTNM: + case GFC_ISYM_KILL: + case GFC_ISYM_IERRNO: case GFC_ISYM_IRAND: + case GFC_ISYM_LINK: case GFC_ISYM_MATMUL: case GFC_ISYM_RAND: + case GFC_ISYM_RENAME: case GFC_ISYM_SECOND: case GFC_ISYM_STAT: + case GFC_ISYM_SYMLNK: case GFC_ISYM_SYSTEM: + case GFC_ISYM_TIME: + case GFC_ISYM_TIME8: case GFC_ISYM_UMASK: case GFC_ISYM_UNLINK: gfc_conv_intrinsic_funcall (se, expr); diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c index 416932173de..a8f8ce8d461 100644 --- a/gcc/fortran/trans-io.c +++ b/gcc/fortran/trans-io.c @@ -125,11 +125,8 @@ static GTY(()) tree iocall_iolength_done; static GTY(()) tree iocall_rewind; static GTY(()) tree iocall_backspace; static GTY(()) tree iocall_endfile; -static GTY(()) tree iocall_set_nml_val_int; -static GTY(()) tree iocall_set_nml_val_float; -static GTY(()) tree iocall_set_nml_val_char; -static GTY(()) tree iocall_set_nml_val_complex; -static GTY(()) tree iocall_set_nml_val_log; +static GTY(()) tree iocall_set_nml_val; +static GTY(()) tree iocall_set_nml_val_dim; /* Variable for keeping track of what the last data transfer statement was. Used for deciding which subroutine to call when the data @@ -314,34 +311,19 @@ gfc_build_io_library_fndecls (void) gfc_build_library_function_decl (get_identifier (PREFIX("st_iolength_done")), gfc_int4_type_node, 0); - iocall_set_nml_val_int = - gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_int")), - void_type_node, 4, - pvoid_type_node, pvoid_type_node, - gfc_int4_type_node,gfc_int4_type_node); - iocall_set_nml_val_float = - gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_float")), - void_type_node, 4, - pvoid_type_node, pvoid_type_node, - gfc_int4_type_node,gfc_int4_type_node); - iocall_set_nml_val_char = - gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_char")), + iocall_set_nml_val = + gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var")), void_type_node, 5, pvoid_type_node, pvoid_type_node, - gfc_int4_type_node, gfc_int4_type_node, - gfc_charlen_type_node); - iocall_set_nml_val_complex = - gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_complex")), - void_type_node, 4, - pvoid_type_node, pvoid_type_node, - gfc_int4_type_node,gfc_int4_type_node); - iocall_set_nml_val_log = - gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_log")), - void_type_node, 4, - pvoid_type_node, pvoid_type_node, - gfc_int4_type_node,gfc_int4_type_node); + gfc_int4_type_node, gfc_charlen_type_node, + gfc_int4_type_node); + iocall_set_nml_val_dim = + gfc_build_library_function_decl (get_identifier (PREFIX("st_set_nml_var_dim")), + void_type_node, 4, + gfc_int4_type_node, gfc_int4_type_node, + gfc_int4_type_node, gfc_int4_type_node); } @@ -412,7 +394,8 @@ set_string (stmtblock_t * block, stmtblock_t * postblock, tree var, tmp = build2 (LE_EXPR, boolean_type_node, tmp, convert (TREE_TYPE (tmp), integer_minus_one_node)); gfc_trans_runtime_check (tmp, msg, &se.pre); - gfc_add_modify_expr (&se.pre, io, GFC_DECL_ASSIGN_ADDR (se.expr)); + gfc_add_modify_expr (&se.pre, io, + fold_convert (TREE_TYPE (io), GFC_DECL_ASSIGN_ADDR (se.expr))); gfc_add_modify_expr (&se.pre, len, GFC_DECL_STRING_LEN (se.expr)); } else @@ -815,11 +798,11 @@ gfc_trans_inquire (gfc_code * code) return gfc_finish_block (&block); } - static gfc_expr * gfc_new_nml_name_expr (const char * name) { gfc_expr * nml_name; + nml_name = gfc_get_expr(); nml_name->ref = NULL; nml_name->expr_type = EXPR_CONSTANT; @@ -832,114 +815,229 @@ gfc_new_nml_name_expr (const char * name) return nml_name; } -static gfc_expr * -get_new_var_expr(gfc_symbol * sym) +/* nml_full_name builds up the fully qualified name of a + derived type component. */ + +static char* +nml_full_name (const char* var_name, const char* cmp_name) { - gfc_expr * nml_var; - - nml_var = gfc_get_expr(); - nml_var->expr_type = EXPR_VARIABLE; - nml_var->ts = sym->ts; - if (sym->as) - nml_var->rank = sym->as->rank; - nml_var->symtree = (gfc_symtree *)gfc_getmem (sizeof (gfc_symtree)); - nml_var->symtree->n.sym = sym; - nml_var->where = sym->declared_at; - sym->attr.referenced = 1; - - return nml_var; + int full_name_length; + char * full_name; + + full_name_length = strlen (var_name) + strlen (cmp_name) + 1; + full_name = (char*)gfc_getmem (full_name_length + 1); + strcpy (full_name, var_name); + full_name = strcat (full_name, "%"); + full_name = strcat (full_name, cmp_name); + return full_name; } -/* For a scalar variable STRING whose address is ADDR_EXPR, generate a - call to iocall_set_nml_val. For derived type variable, recursively - generate calls to iocall_set_nml_val for each leaf field. The leafs - have no names -- their STRING field is null, and are interpreted by - the run-time library as having only the value, as in the example: +/* nml_get_addr_expr builds an address expression from the + gfc_symbol or gfc_component backend_decl's. An offset is + provided so that the address of an element of an array of + derived types is returned. This is used in the runtime to + determine that span of the derived type. */ + +static tree +nml_get_addr_expr (gfc_symbol * sym, gfc_component * c, + tree base_addr) +{ + tree decl = NULL_TREE; + tree tmp; + tree itmp; + int array_flagged; + int dummy_arg_flagged; + + if (sym) + { + sym->attr.referenced = 1; + decl = gfc_get_symbol_decl (sym); + } + else + decl = c->backend_decl; + + gcc_assert (decl && ((TREE_CODE (decl) == FIELD_DECL + || TREE_CODE (decl) == VAR_DECL + || TREE_CODE (decl) == PARM_DECL) + || TREE_CODE (decl) == COMPONENT_REF)); + + tmp = decl; + + /* Build indirect reference, if dummy argument. */ + + dummy_arg_flagged = POINTER_TYPE_P (TREE_TYPE(tmp)); - &foo bzz=1,2,3,4,5/ + itmp = (dummy_arg_flagged) ? gfc_build_indirect_ref (tmp) : tmp; - Note that the first output field appears after the name of the - variable, not of the field name. This causes a little complication - documented below. */ + /* If an array, set flag and use indirect ref. if built. */ + + array_flagged = (TREE_CODE (TREE_TYPE (itmp)) == ARRAY_TYPE + && !TYPE_STRING_FLAG (TREE_TYPE (itmp))); + + if (array_flagged) + tmp = itmp; + + /* Treat the component of a derived type, using base_addr for + the derived type. */ + + if (TREE_CODE (decl) == FIELD_DECL) + tmp = build3 (COMPONENT_REF, TREE_TYPE (tmp), + base_addr, tmp, NULL_TREE); + + /* If we have a derived type component, a reference to the first + element of the array is built. This is done so that base_addr, + used in the build of the component reference, always points to + a RECORD_TYPE. */ + + if (array_flagged) + tmp = gfc_build_array_ref (tmp, gfc_index_zero_node); + + /* Now build the address expression. */ + + tmp = gfc_build_addr_expr (NULL, tmp); + + /* If scalar dummy, resolve indirect reference now. */ + + if (dummy_arg_flagged && !array_flagged) + tmp = gfc_build_indirect_ref (tmp); + + gcc_assert (tmp && POINTER_TYPE_P (TREE_TYPE (tmp))); + + return tmp; +} + +/* For an object VAR_NAME whose base address is BASE_ADDR, generate a + call to iocall_set_nml_val. For derived type variable, recursively + generate calls to iocall_set_nml_val for each component. */ + +#define NML_FIRST_ARG(a) args = gfc_chainon_list (NULL_TREE, a) +#define NML_ADD_ARG(a) args = gfc_chainon_list (args, a) +#define IARG(i) build_int_cst (gfc_array_index_type, i) static void -transfer_namelist_element (stmtblock_t * block, gfc_typespec * ts, tree addr_expr, - tree string, tree string_length) +transfer_namelist_element (stmtblock_t * block, const char * var_name, + gfc_symbol * sym, gfc_component * c, + tree base_addr) { - tree tmp, args, arg2; - tree expr; + gfc_typespec * ts = NULL; + gfc_array_spec * as = NULL; + tree addr_expr = NULL; + tree dt = NULL; + tree string; + tree tmp; + tree args; + tree dtype; + int n_dim; + int itype; + int rank = 0; - gcc_assert (POINTER_TYPE_P (TREE_TYPE (addr_expr))); + gcc_assert (sym || c); - if (ts->type == BT_DERIVED) - { - gfc_component *c; - expr = gfc_build_indirect_ref (addr_expr); + /* Build the namelist object name. */ - for (c = ts->derived->components; c; c = c->next) - { - tree field = c->backend_decl; - gcc_assert (field && TREE_CODE (field) == FIELD_DECL); - tmp = build3 (COMPONENT_REF, TREE_TYPE (field), - expr, field, NULL_TREE); + string = gfc_build_cstring_const (var_name); + string = gfc_build_addr_expr (pchar_type_node, string); - if (c->dimension) - gfc_todo_error ("NAMELIST IO of array in derived type"); - if (!c->pointer) - tmp = gfc_build_addr_expr (NULL, tmp); - transfer_namelist_element (block, &c->ts, tmp, string, string_length); - - /* The first output field bears the name of the topmost - derived type variable. All other fields are anonymous - and appear with nulls in their string and string_length - fields. After the first use, we set string and - string_length to null. */ - string = null_pointer_node; - string_length = integer_zero_node; - } + /* Build ts, as and data address using symbol or component. */ - return; - } + ts = (sym) ? &sym->ts : &c->ts; + as = (sym) ? sym->as : c->as; - args = gfc_chainon_list (NULL_TREE, addr_expr); - args = gfc_chainon_list (args, string); - args = gfc_chainon_list (args, string_length); - arg2 = build_int_cst (gfc_array_index_type, ts->kind); - args = gfc_chainon_list (args,arg2); + addr_expr = nml_get_addr_expr (sym, c, base_addr); - switch (ts->type) + if (as) + rank = as->rank; + + if (rank) { - case BT_INTEGER: - tmp = gfc_build_function_call (iocall_set_nml_val_int, args); - break; + dt = TREE_TYPE ((sym) ? sym->backend_decl : c->backend_decl); + dtype = gfc_get_dtype (dt); + } + else + { + itype = GFC_DTYPE_UNKNOWN; - case BT_CHARACTER: - expr = gfc_build_indirect_ref (addr_expr); - gcc_assert (TREE_CODE (TREE_TYPE (expr)) == ARRAY_TYPE); - args = gfc_chainon_list (args, - TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (expr)))); - tmp = gfc_build_function_call (iocall_set_nml_val_char, args); - break; + switch (ts->type) - case BT_REAL: - tmp = gfc_build_function_call (iocall_set_nml_val_float, args); - break; + { + case BT_INTEGER: + itype = GFC_DTYPE_INTEGER; + break; + case BT_LOGICAL: + itype = GFC_DTYPE_LOGICAL; + break; + case BT_REAL: + itype = GFC_DTYPE_REAL; + break; + case BT_COMPLEX: + itype = GFC_DTYPE_COMPLEX; + break; + case BT_DERIVED: + itype = GFC_DTYPE_DERIVED; + break; + case BT_CHARACTER: + itype = GFC_DTYPE_CHARACTER; + break; + default: + gcc_unreachable (); + } - case BT_LOGICAL: - tmp = gfc_build_function_call (iocall_set_nml_val_log, args); - break; + dtype = IARG (itype << GFC_DTYPE_TYPE_SHIFT); + } - case BT_COMPLEX: - tmp = gfc_build_function_call (iocall_set_nml_val_complex, args); - break; + /* Build up the arguments for the transfer call. + The call for the scalar part transfers: + (address, name, type, kind or string_length, dtype) */ - default : - internal_error ("Bad namelist IO basetype (%d)", ts->type); - } + NML_FIRST_ARG (addr_expr); + NML_ADD_ARG (string); + NML_ADD_ARG (IARG (ts->kind)); + + if (ts->type == BT_CHARACTER) + NML_ADD_ARG (ts->cl->backend_decl); + else + NML_ADD_ARG (convert (gfc_charlen_type_node, integer_zero_node)); + NML_ADD_ARG (dtype); + tmp = gfc_build_function_call (iocall_set_nml_val, args); gfc_add_expr_to_block (block, tmp); + + /* If the object is an array, transfer rank times: + (null pointer, name, stride, lbound, ubound) */ + + for ( n_dim = 0 ; n_dim < rank ; n_dim++ ) + { + NML_FIRST_ARG (IARG (n_dim)); + NML_ADD_ARG (GFC_TYPE_ARRAY_STRIDE (dt, n_dim)); + NML_ADD_ARG (GFC_TYPE_ARRAY_LBOUND (dt, n_dim)); + NML_ADD_ARG (GFC_TYPE_ARRAY_UBOUND (dt, n_dim)); + tmp = gfc_build_function_call (iocall_set_nml_val_dim, args); + gfc_add_expr_to_block (block, tmp); + } + + if (ts->type == BT_DERIVED) + { + gfc_component *cmp; + + /* Provide the RECORD_TYPE to build component references. */ + + tree expr = gfc_build_indirect_ref (addr_expr); + + for (cmp = ts->derived->components; cmp; cmp = cmp->next) + { + char *full_name = nml_full_name (var_name, cmp->name); + transfer_namelist_element (block, + full_name, + NULL, cmp, expr); + gfc_free (full_name); + } + } } +#undef IARG +#undef NML_ADD_ARG +#undef NML_FIRST_ARG + /* Create a data transfer statement. Not all of the fields are valid for both reading and writing, but improper use has been filtered out by now. */ @@ -950,9 +1048,8 @@ build_dt (tree * function, gfc_code * code) stmtblock_t block, post_block; gfc_dt *dt; tree tmp; - gfc_expr *nmlname, *nmlvar; + gfc_expr *nmlname; gfc_namelist *nml; - gfc_se se,se2; gfc_init_block (&block); gfc_init_block (&post_block); @@ -1010,30 +1107,20 @@ build_dt (tree * function, gfc_code * code) if (dt->namelist) { - if (dt->format_expr || dt->format_label) - fatal_error("A format cannot be specified with a namelist"); - - nmlname = gfc_new_nml_name_expr(dt->namelist->name); - - set_string (&block, &post_block, ioparm_namelist_name, - ioparm_namelist_name_len, nmlname); - - if (last_dt == READ) - set_flag (&block, ioparm_namelist_read_mode); - - for (nml = dt->namelist->namelist; nml; nml = nml->next) - { - gfc_init_se (&se, NULL); - gfc_init_se (&se2, NULL); - nmlvar = get_new_var_expr (nml->sym); - nmlname = gfc_new_nml_name_expr (nml->sym->name); - gfc_conv_expr_reference (&se2, nmlname); - gfc_conv_expr_reference (&se, nmlvar); - gfc_evaluate_now (se.expr, &se.pre); - - transfer_namelist_element (&block, &nml->sym->ts, se.expr, - se2.expr, se2.string_length); - } + if (dt->format_expr || dt->format_label) + gfc_internal_error ("build_dt: format with namelist"); + + nmlname = gfc_new_nml_name_expr(dt->namelist->name); + + set_string (&block, &post_block, ioparm_namelist_name, + ioparm_namelist_name_len, nmlname); + + if (last_dt == READ) + set_flag (&block, ioparm_namelist_read_mode); + + for (nml = dt->namelist->namelist; nml; nml = nml->next) + transfer_namelist_element (&block, nml->sym->name, nml->sym, + NULL, NULL); } tmp = gfc_build_function_call (*function, NULL_TREE); diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 524412725ab..d3e86dd9d9d 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -129,7 +129,7 @@ gfc_trans_label_assign (gfc_code * code) label_len = code->label->format->value.character.length; len_tree = build_int_cst (NULL_TREE, label_len); label_tree = gfc_build_string_const (label_len + 1, label_str); - label_tree = gfc_build_addr_expr (pchar_type_node, label_tree); + label_tree = gfc_build_addr_expr (pvoid_type_node, label_tree); } gfc_add_modify_expr (&se.pre, len, len_tree); @@ -587,9 +587,9 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar, /* Only execute the loop if the number of iterations is positive. */ if (tree_int_cst_sgn (step) > 0) - cond = fold (build2 (LE_EXPR, boolean_type_node, dovar, to)); + cond = fold_build2 (LE_EXPR, boolean_type_node, dovar, to); else - cond = fold (build2 (GE_EXPR, boolean_type_node, dovar, to)); + cond = fold_build2 (GE_EXPR, boolean_type_node, dovar, to); tmp = build3_v (COND_EXPR, cond, tmp, build_empty_stmt ()); gfc_add_expr_to_block (pblock, tmp); @@ -685,11 +685,11 @@ gfc_trans_do (gfc_code * code) /* Initialize loop count. This code is executed before we enter the loop body. We generate: count = (to + step - from) / step. */ - tmp = fold (build2 (MINUS_EXPR, type, step, from)); - tmp = fold (build2 (PLUS_EXPR, type, to, tmp)); + tmp = fold_build2 (MINUS_EXPR, type, step, from); + tmp = fold_build2 (PLUS_EXPR, type, to, tmp); if (TREE_CODE (type) == INTEGER_TYPE) { - tmp = fold (build2 (TRUNC_DIV_EXPR, type, tmp, step)); + tmp = fold_build2 (TRUNC_DIV_EXPR, type, tmp, step); count = gfc_create_var (type, "count"); } else @@ -697,8 +697,8 @@ gfc_trans_do (gfc_code * code) /* TODO: We could use the same width as the real type. This would probably cause more problems that it solves when we implement "long double" types. */ - tmp = fold (build2 (RDIV_EXPR, type, tmp, step)); - tmp = fold (build1 (FIX_TRUNC_EXPR, gfc_array_index_type, tmp)); + tmp = fold_build2 (RDIV_EXPR, type, tmp, step); + tmp = fold_build1 (FIX_TRUNC_EXPR, gfc_array_index_type, tmp); count = gfc_create_var (gfc_array_index_type, "count"); } gfc_add_modify_expr (&block, count, tmp); @@ -810,7 +810,7 @@ gfc_trans_do_while (gfc_code * code) gfc_init_se (&cond, NULL); gfc_conv_expr_val (&cond, code->expr); gfc_add_block_to_block (&block, &cond.pre); - cond.expr = fold (build1 (TRUTH_NOT_EXPR, boolean_type_node, cond.expr)); + cond.expr = fold_build1 (TRUTH_NOT_EXPR, boolean_type_node, cond.expr); /* Build "IF (! cond) GOTO exit_label". */ tmp = build1_v (GOTO_EXPR, exit_label); @@ -1388,9 +1388,9 @@ gfc_trans_forall_loop (forall_info *forall_tmp, int nvar, tree body, int mask_fl gfc_add_modify_expr (&block, var, start); /* Initialize the loop counter. */ - tmp = fold (build2 (MINUS_EXPR, TREE_TYPE (var), step, start)); - tmp = fold (build2 (PLUS_EXPR, TREE_TYPE (var), end, tmp)); - tmp = fold (build2 (TRUNC_DIV_EXPR, TREE_TYPE (var), tmp, step)); + tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (var), step, start); + tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (var), end, tmp); + tmp = fold_build2 (TRUNC_DIV_EXPR, TREE_TYPE (var), tmp, step); gfc_add_modify_expr (&block, count, tmp); /* The loop expression. */ @@ -1479,8 +1479,8 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, if (INTEGER_CST_P (size)) { - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, size, - gfc_index_one_node)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, size, + gfc_index_one_node); } else tmp = NULL_TREE; @@ -1516,15 +1516,14 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock, /* Generate codes to copy the temporary to the actual lhs. */ static tree -generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, - tree count3, tree count1, tree count2, tree wheremask) +generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree count3, + tree count1, tree wheremask) { gfc_ss *lss; gfc_se lse, rse; stmtblock_t block, body; gfc_loopinfo loop1; tree tmp, tmp2; - tree index; tree wheremaskexpr; /* Walk the lhs. */ @@ -1548,8 +1547,10 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, gfc_add_block_to_block (&block, &lse.post); /* Increment the count1. */ - tmp = fold (build2 (PLUS_EXPR, TREE_TYPE (count1), count1, size)); + tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (count1), count1, + gfc_index_one_node); gfc_add_modify_expr (&block, count1, tmp); + tmp = gfc_finish_block (&block); } else @@ -1569,8 +1570,6 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, gfc_conv_loop_setup (&loop1); gfc_mark_ss_chain_used (lss, 1); - /* Initialize count2. */ - gfc_add_modify_expr (&block, count2, gfc_index_zero_node); /* Start the scalarized loop body. */ gfc_start_scalarized_body (&loop1, &body); @@ -1581,11 +1580,7 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, /* Form the expression of the temporary. */ if (lss != gfc_ss_terminator) - { - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count1, count2)); - rse.expr = gfc_build_array_ref (tmp1, index); - } + rse.expr = gfc_build_array_ref (tmp1, count1); /* Translate expr. */ gfc_conv_expr (&lse, expr); @@ -1596,31 +1591,31 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, if (wheremask) { wheremaskexpr = gfc_build_array_ref (wheremask, count3); - tmp2 = TREE_CHAIN (wheremask); - while (tmp2) - { - tmp1 = gfc_build_array_ref (tmp2, count3); - wheremaskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1), + tmp2 = TREE_CHAIN (wheremask); + while (tmp2) + { + tmp1 = gfc_build_array_ref (tmp2, count3); + wheremaskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1), wheremaskexpr, tmp1); - tmp2 = TREE_CHAIN (tmp2); - } - tmp = build3_v (COND_EXPR, wheremaskexpr, tmp, build_empty_stmt ()); + tmp2 = TREE_CHAIN (tmp2); + } + tmp = build3_v (COND_EXPR, wheremaskexpr, tmp, build_empty_stmt ()); } gfc_add_expr_to_block (&body, tmp); - /* Increment count2. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count2, gfc_index_one_node)); - gfc_add_modify_expr (&body, count2, tmp); + /* Increment count1. */ + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count1, gfc_index_one_node); + gfc_add_modify_expr (&body, count1, tmp); /* Increment count3. */ if (count3) - { - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count3, gfc_index_one_node)); - gfc_add_modify_expr (&body, count3, tmp); - } + { + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count3, gfc_index_one_node); + gfc_add_modify_expr (&body, count3, tmp); + } /* Generate the copying loops. */ gfc_trans_scalarizing_loops (&loop1, &body); @@ -1628,9 +1623,6 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, gfc_add_block_to_block (&block, &loop1.post); gfc_cleanup_loop (&loop1); - /* Increment count1. */ - tmp = fold (build2 (PLUS_EXPR, TREE_TYPE (count1), count1, size)); - gfc_add_modify_expr (&block, count1, tmp); tmp = gfc_finish_block (&block); } return tmp; @@ -1642,15 +1634,15 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree size, not be freed. */ static tree -generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size, - tree count3, tree count1, tree count2, - gfc_ss *lss, gfc_ss *rss, tree wheremask) +generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree count3, + tree count1, gfc_ss *lss, gfc_ss *rss, + tree wheremask) { stmtblock_t block, body1; gfc_loopinfo loop; gfc_se lse; gfc_se rse; - tree tmp, tmp2, index; + tree tmp, tmp2; tree wheremaskexpr; gfc_start_block (&block); @@ -1666,9 +1658,6 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size, } else { - /* Initialize count2. */ - gfc_add_modify_expr (&block, count2, gfc_index_zero_node); - /* Initialize the loop. */ gfc_init_loopinfo (&loop); @@ -1689,8 +1678,7 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size, gfc_conv_expr (&rse, expr2); /* Form the expression of the temporary. */ - index = fold (build2 (PLUS_EXPR, gfc_array_index_type, count1, count2)); - lse.expr = gfc_build_array_ref (tmp1, index); + lse.expr = gfc_build_array_ref (tmp1, count1); } /* Use the scalar assignment. */ @@ -1702,12 +1690,12 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size, wheremaskexpr = gfc_build_array_ref (wheremask, count3); tmp2 = TREE_CHAIN (wheremask); while (tmp2) - { - tmp1 = gfc_build_array_ref (tmp2, count3); - wheremaskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1), + { + tmp1 = gfc_build_array_ref (tmp2, count3); + wheremaskexpr = build2 (TRUTH_AND_EXPR, TREE_TYPE (tmp1), wheremaskexpr, tmp1); - tmp2 = TREE_CHAIN (tmp2); - } + tmp2 = TREE_CHAIN (tmp2); + } tmp = build3_v (COND_EXPR, wheremaskexpr, tmp, build_empty_stmt ()); } @@ -1716,21 +1704,26 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size, if (lss == gfc_ss_terminator) { gfc_add_block_to_block (&block, &body1); + + /* Increment count1. */ + tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (count1), count1, + gfc_index_one_node); + gfc_add_modify_expr (&block, count1, tmp); } else { - /* Increment count2. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count2, gfc_index_one_node)); - gfc_add_modify_expr (&body1, count2, tmp); + /* Increment count1. */ + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count1, gfc_index_one_node); + gfc_add_modify_expr (&body1, count1, tmp); /* Increment count3. */ if (count3) - { - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count3, gfc_index_one_node)); - gfc_add_modify_expr (&body1, count3, tmp); - } + { + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count3, gfc_index_one_node); + gfc_add_modify_expr (&body1, count3, tmp); + } /* Generate the copying loops. */ gfc_trans_scalarizing_loops (&loop, &body1); @@ -1740,11 +1733,8 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree size, gfc_cleanup_loop (&loop); /* TODO: Reuse lss and rss when copying temp->lhs. Need to be careful - as tree nodes in SS may not be valid in different scope. */ + as tree nodes in SS may not be valid in different scope. */ } - /* Increment count1. */ - tmp = fold (build2 (PLUS_EXPR, TREE_TYPE (count1), count1, size)); - gfc_add_modify_expr (&block, count1, tmp); tmp = gfc_finish_block (&block); return tmp; @@ -1800,11 +1790,11 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2, /* Figure out how many elements we need. */ for (i = 0; i < loop.dimen; i++) { - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, - gfc_index_one_node, loop.from[i])); - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - tmp, loop.to[i])); - size = fold (build2 (MULT_EXPR, gfc_array_index_type, size, tmp)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, + gfc_index_one_node, loop.from[i]); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + tmp, loop.to[i]); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp); } gfc_add_block_to_block (pblock, &loop.pre); size = gfc_evaluate_now (size, pblock); @@ -1822,7 +1812,7 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2, static tree compute_overall_iter_number (forall_info *nested_forall_info, tree inner_size, - stmtblock_t *block) + stmtblock_t *inner_size_body, stmtblock_t *block) { tree tmp, number; stmtblock_t body; @@ -1832,6 +1822,8 @@ compute_overall_iter_number (forall_info *nested_forall_info, tree inner_size, gfc_add_modify_expr (block, number, gfc_index_zero_node); gfc_start_block (&body); + if (inner_size_body) + gfc_add_block_to_block (&body, inner_size_body); if (nested_forall_info) tmp = build2 (PLUS_EXPR, gfc_array_index_type, number, inner_size); @@ -1850,25 +1842,20 @@ compute_overall_iter_number (forall_info *nested_forall_info, tree inner_size, } -/* Allocate temporary for forall construct according to the information in - nested_forall_info. INNER_SIZE is the size of temporary needed in the - assignment inside forall. PTEMP1 is returned for space free. */ +/* Allocate temporary for forall construct. SIZE is the size of temporary + needed. PTEMP1 is returned for space free. */ static tree -allocate_temp_for_forall_nest (forall_info * nested_forall_info, tree type, - tree inner_size, stmtblock_t * block, - tree * ptemp1) +allocate_temp_for_forall_nest_1 (tree type, tree size, stmtblock_t * block, + tree * ptemp1) { tree unit; tree temp1; tree tmp; - tree bytesize, size; - - /* Calculate the total size of temporary needed in forall construct. */ - size = compute_overall_iter_number (nested_forall_info, inner_size, block); + tree bytesize; unit = TYPE_SIZE_UNIT (type); - bytesize = fold (build2 (MULT_EXPR, gfc_array_index_type, size, unit)); + bytesize = fold_build2 (MULT_EXPR, gfc_array_index_type, size, unit); *ptemp1 = NULL; temp1 = gfc_do_allocate (bytesize, size, ptemp1, block, type); @@ -1882,7 +1869,56 @@ allocate_temp_for_forall_nest (forall_info * nested_forall_info, tree type, } -/* Handle assignments inside forall which need temporary. */ +/* Allocate temporary for forall construct according to the information in + nested_forall_info. INNER_SIZE is the size of temporary needed in the + assignment inside forall. PTEMP1 is returned for space free. */ + +static tree +allocate_temp_for_forall_nest (forall_info * nested_forall_info, tree type, + tree inner_size, stmtblock_t * inner_size_body, + stmtblock_t * block, tree * ptemp1) +{ + tree size; + + /* Calculate the total size of temporary needed in forall construct. */ + size = compute_overall_iter_number (nested_forall_info, inner_size, + inner_size_body, block); + + return allocate_temp_for_forall_nest_1 (type, size, block, ptemp1); +} + + +/* Handle assignments inside forall which need temporary. + + forall (i=start:end:stride; maskexpr) + e = f + end forall + (where e,f are arbitrary expressions possibly involving i + and there is a dependency between e and f) + Translates to: + masktmp(:) = maskexpr(:) + + maskindex = 0; + count1 = 0; + num = 0; + for (i = start; i <= end; i += stride) + num += SIZE (f) + count1 = 0; + ALLOCATE (tmp(num)) + for (i = start; i <= end; i += stride) + { + if (masktmp[maskindex++]) + tmp[count1++] = f + } + maskindex = 0; + count1 = 0; + for (i = start; i <= end; i += stride) + { + if (masktmp[maskindex++]) + e = tmp[count1++] + } + DEALLOCATE (tmp) + */ static void gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask, forall_info * nested_forall_info, @@ -1891,17 +1927,16 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask, tree type; tree inner_size; gfc_ss *lss, *rss; - tree count, count1, count2; + tree count, count1; tree tmp, tmp1; tree ptemp1; tree mask, maskindex; forall_info *forall_tmp; + stmtblock_t inner_size_body; - /* Create vars. count1 is the current iterator number of the nested forall. - count2 is the current iterator number of the inner loops needed in the - assignment. */ + /* Create vars. count1 is the current iterator number of the nested + forall. */ count1 = gfc_create_var (gfc_array_index_type, "count1"); - count2 = gfc_create_var (gfc_array_index_type, "count2"); /* Count is the wheremask index. */ if (wheremask) @@ -1917,15 +1952,17 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask, /* Calculate the size of temporary needed in the assignment. Return loop, lss and rss which are used in function generate_loop_for_rhs_to_temp(). */ - inner_size = compute_inner_temp_size (expr1, expr2, block, &lss, &rss); + gfc_init_block (&inner_size_body); + inner_size = compute_inner_temp_size (expr1, expr2, &inner_size_body, + &lss, &rss); /* The type of LHS. Used in function allocate_temp_for_forall_nest */ type = gfc_typenode_for_spec (&expr1->ts); /* Allocate temporary for nested forall construct according to the information in nested_forall_info and inner_size. */ - tmp1 = allocate_temp_for_forall_nest (nested_forall_info, type, - inner_size, block, &ptemp1); + tmp1 = allocate_temp_for_forall_nest (nested_forall_info, type, inner_size, + &inner_size_body, block, &ptemp1); /* Initialize the maskindexes. */ forall_tmp = nested_forall_info; @@ -1939,8 +1976,8 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask, } /* Generate codes to copy rhs to the temporary . */ - tmp = generate_loop_for_rhs_to_temp (expr2, tmp1, inner_size, count, - count1, count2, lss, rss, wheremask); + tmp = generate_loop_for_rhs_to_temp (expr2, tmp1, count, count1, lss, rss, + wheremask); /* Generate body and loops according to the information in nested_forall_info. */ @@ -1966,8 +2003,7 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, tree wheremask, gfc_add_modify_expr (block, count, gfc_index_zero_node); /* Generate codes to copy the temporary to lhs. */ - tmp = generate_loop_for_temp_to_lhs (expr1, tmp1, inner_size, count, - count1, count2, wheremask); + tmp = generate_loop_for_temp_to_lhs (expr1, tmp1, count, count1, wheremask); /* Generate body and loops according to the information in nested_forall_info. */ @@ -2020,8 +2056,8 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, /* Allocate temporary for nested forall construct according to the information in nested_forall_info and inner_size. */ - tmp1 = allocate_temp_for_forall_nest (nested_forall_info, - type, inner_size, block, &ptemp1); + tmp1 = allocate_temp_for_forall_nest (nested_forall_info, type, + inner_size, NULL, block, &ptemp1); gfc_start_block (&body); gfc_init_se (&lse, NULL); lse.expr = gfc_build_array_ref (tmp1, count); @@ -2033,8 +2069,8 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, gfc_add_block_to_block (&body, &rse.post); /* Increment count. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count, gfc_index_one_node); gfc_add_modify_expr (&body, count, tmp); tmp = gfc_finish_block (&body); @@ -2078,8 +2114,8 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, gfc_add_modify_expr (&body, lse.expr, rse.expr); gfc_add_block_to_block (&body, &lse.post); /* Increment count. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count, gfc_index_one_node); gfc_add_modify_expr (&body, count, tmp); tmp = gfc_finish_block (&body); @@ -2110,7 +2146,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, /* Allocate temporary for nested forall construct. */ tmp1 = allocate_temp_for_forall_nest (nested_forall_info, parmtype, - inner_size, block, &ptemp1); + inner_size, NULL, block, &ptemp1); gfc_start_block (&body); gfc_init_se (&lse, NULL); lse.expr = gfc_build_array_ref (tmp1, count); @@ -2122,8 +2158,8 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, gfc_add_block_to_block (&body, &lse.post); /* Increment count. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count, gfc_index_one_node); gfc_add_modify_expr (&body, count, tmp); tmp = gfc_finish_block (&body); @@ -2167,8 +2203,8 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, gfc_add_block_to_block (&body, &lse.post); /* Increment count. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count, gfc_index_one_node); gfc_add_modify_expr (&body, count, tmp); tmp = gfc_finish_block (&body); @@ -2201,7 +2237,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, end forall (where e,f,g,h are arbitrary expressions possibly involving i) Translates to: - count = ((end + 1 - start) / staride) + count = ((end + 1 - start) / stride) masktmp(:) = maskexpr(:) maskindex = 0; @@ -2214,7 +2250,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2, for (i = start; i <= end; i += stride) { if (masktmp[maskindex++]) - e = f + g = h } Note that this code only works when there are no dependencies. @@ -2345,14 +2381,14 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) lenvar = NULL_TREE; /* size = (end + step - start) / step. */ - tmp = fold (build2 (MINUS_EXPR, TREE_TYPE (start[n]), - step[n], start[n])); - tmp = fold (build2 (PLUS_EXPR, TREE_TYPE (end[n]), end[n], tmp)); + tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (start[n]), + step[n], start[n]); + tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (end[n]), end[n], tmp); - tmp = fold (build2 (FLOOR_DIV_EXPR, TREE_TYPE (tmp), tmp, step[n])); + tmp = fold_build2 (FLOOR_DIV_EXPR, TREE_TYPE (tmp), tmp, step[n]); tmp = convert (gfc_array_index_type, tmp); - size = fold (build2 (MULT_EXPR, gfc_array_index_type, size, tmp)); + size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp); } /* Record the nvar and size of current forall level. */ @@ -2376,8 +2412,8 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) if (code->expr) { /* Allocate the mask temporary. */ - bytesize = fold (build2 (MULT_EXPR, gfc_array_index_type, size, - TYPE_SIZE_UNIT (boolean_type_node))); + bytesize = fold_build2 (MULT_EXPR, gfc_array_index_type, size, + TYPE_SIZE_UNIT (boolean_type_node)); mask = gfc_do_allocate (bytesize, size, &pmask, &block, boolean_type_node); @@ -2435,7 +2471,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info) case EXEC_ASSIGN: /* A scalar or array assignment. */ need_temp = gfc_check_dependency (c->expr, c->expr2, varexpr, nvar); - /* Teporaries due to array assignment data dependencies introduce + /* Temporaries due to array assignment data dependencies introduce no end of problems. */ if (need_temp) gfc_trans_assign_need_temp (c->expr, c->expr2, NULL, @@ -2567,8 +2603,8 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, gfc_ss *lss, *rss; gfc_loopinfo loop; tree ptemp1, ntmp, ptemp2; - tree inner_size; - stmtblock_t body, body1; + tree inner_size, size; + stmtblock_t body, body1, inner_size_body; gfc_se lse, rse; tree count; tree tmpexpr; @@ -2576,11 +2612,16 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, gfc_init_loopinfo (&loop); /* Calculate the size of temporary needed by the mask-expr. */ - inner_size = compute_inner_temp_size (me, me, block, &lss, &rss); + gfc_init_block (&inner_size_body); + inner_size = compute_inner_temp_size (me, me, &inner_size_body, &lss, &rss); + + /* Calculate the total size of temporary needed. */ + size = compute_overall_iter_number (nested_forall_info, inner_size, + &inner_size_body, block); /* Allocate temporary for where mask. */ - tmp = allocate_temp_for_forall_nest (nested_forall_info, boolean_type_node, - inner_size, block, &ptemp1); + tmp = allocate_temp_for_forall_nest_1 (boolean_type_node, size, block, + &ptemp1); /* Record the temporary address in order to free it later. */ if (ptemp1) { @@ -2592,8 +2633,8 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, } /* Allocate temporary for !mask. */ - ntmp = allocate_temp_for_forall_nest (nested_forall_info, boolean_type_node, - inner_size, block, &ptemp2); + ntmp = allocate_temp_for_forall_nest_1 (boolean_type_node, size, block, + &ptemp2); /* Record the temporary in order to free it later. */ if (ptemp2) { @@ -2658,8 +2699,8 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, else { /* Increment count. */ - tmp1 = fold (build2 (PLUS_EXPR, gfc_array_index_type, count, - gfc_index_one_node)); + tmp1 = fold_build2 (PLUS_EXPR, gfc_array_index_type, count, + gfc_index_one_node); gfc_add_modify_expr (&body1, count, tmp1); /* Generate the copying loops. */ @@ -2676,8 +2717,22 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info, tmp1 = gfc_finish_block (&body); /* If the WHERE construct is inside FORALL, fill the full temporary. */ if (nested_forall_info != NULL) - tmp1 = gfc_trans_nested_forall_loop (nested_forall_info, tmp1, 1, 1); + { + forall_info *forall_tmp; + tree maskindex; + /* Initialize the maskindexes. */ + forall_tmp = nested_forall_info; + while (forall_tmp != NULL) + { + maskindex = forall_tmp->maskindex; + if (forall_tmp->mask) + gfc_add_modify_expr (block, maskindex, gfc_index_zero_node); + forall_tmp = forall_tmp->next_nest; + } + + tmp1 = gfc_trans_nested_forall_loop (nested_forall_info, tmp1, 1, 1); + } gfc_add_expr_to_block (block, tmp1); @@ -2825,8 +2880,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, if (lss == gfc_ss_terminator) { /* Increment count1. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count1, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count1, gfc_index_one_node); gfc_add_modify_expr (&body, count1, tmp); /* Use the scalar assignment as is. */ @@ -2841,8 +2896,8 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, { /* Increment count1 before finish the main body of a scalarized expression. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count1, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count1, gfc_index_one_node); gfc_add_modify_expr (&body, count1, tmp); gfc_trans_scalarized_loop_boundary (&loop, &body); @@ -2884,15 +2939,15 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2, tree mask, gfc_add_expr_to_block (&body, tmp); /* Increment count2. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count2, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count2, gfc_index_one_node); gfc_add_modify_expr (&body, count2, tmp); } else { /* Increment count1. */ - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, - count1, gfc_index_one_node)); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, + count1, gfc_index_one_node); gfc_add_modify_expr (&body, count1, tmp); } @@ -2998,6 +3053,9 @@ gfc_trans_where_2 (gfc_code * code, tree mask, tree pmask, nested_forall_info, block); else { + forall_info *forall_tmp; + tree maskindex; + /* Variables to control maskexpr. */ count1 = gfc_create_var (gfc_array_index_type, "count1"); count2 = gfc_create_var (gfc_array_index_type, "count2"); @@ -3006,6 +3064,18 @@ gfc_trans_where_2 (gfc_code * code, tree mask, tree pmask, tmp = gfc_trans_where_assign (expr1, expr2, mask, count1, count2); + + /* Initialize the maskindexes. */ + forall_tmp = nested_forall_info; + while (forall_tmp != NULL) + { + maskindex = forall_tmp->maskindex; + if (forall_tmp->mask) + gfc_add_modify_expr (block, maskindex, + gfc_index_zero_node); + forall_tmp = forall_tmp->next_nest; + } + tmp = gfc_trans_nested_forall_loop (nested_forall_info, tmp, 1, 1); gfc_add_expr_to_block (block, tmp); diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 3ac068c0f11..a70784cbf3c 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -50,6 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA static tree gfc_get_derived_type (gfc_symbol * derived); tree gfc_array_index_type; +tree gfc_array_range_type; tree pvoid_type_node; tree ppvoid_type_node; tree pchar_type_node; @@ -187,10 +188,10 @@ gfc_init_kinds (void) /* Choose the default integer kind. We choose 4 unless the user directs us otherwise. */ - if (gfc_option.i8) + if (gfc_option.flag_default_integer) { if (!saw_i8) - fatal_error ("integer kind=8 not available for -i8 option"); + fatal_error ("integer kind=8 not available for -fdefault-integer-8 option"); gfc_default_integer_kind = 8; } else if (saw_i4) @@ -199,10 +200,10 @@ gfc_init_kinds (void) gfc_default_integer_kind = gfc_integer_kinds[i_index - 1].kind; /* Choose the default real kind. Again, we choose 4 when possible. */ - if (gfc_option.r8) + if (gfc_option.flag_default_real) { if (!saw_r8) - fatal_error ("real kind=8 not available for -r8 option"); + fatal_error ("real kind=8 not available for -fdefault-real-8 option"); gfc_default_real_kind = 8; } else if (saw_r4) @@ -210,9 +211,16 @@ gfc_init_kinds (void) else gfc_default_real_kind = gfc_real_kinds[0].kind; - /* Choose the default double kind. If -r8 is specified, we use kind=16, - if it's available, otherwise we do not change anything. */ - if (gfc_option.r8 && saw_r16) + /* Choose the default double kind. If -fdefault-real and -fdefault-double + are specified, we use kind=8, if it's available. If -fdefault-real is + specified without -fdefault-double, we use kind=16, if it's available. + Otherwise we do not change anything. */ + if (gfc_option.flag_default_double && !gfc_option.flag_default_real) + fatal_error ("Use of -fdefault-double-8 requires -fdefault-real-8"); + + if (gfc_option.flag_default_real && gfc_option.flag_default_double && saw_r8) + gfc_default_double_kind = 8; + else if (gfc_option.flag_default_real && saw_r16) gfc_default_double_kind = 16; else if (saw_r4 && saw_r8) gfc_default_double_kind = 8; @@ -521,6 +529,12 @@ gfc_init_types (void) pchar_type_node = build_pointer_type (gfc_character1_type_node); gfc_array_index_type = gfc_get_int_type (gfc_index_integer_kind); + /* We cannot use gfc_index_zero_node in definition of gfc_array_range_type, + since this function is called before gfc_init_constants. */ + gfc_array_range_type + = build_range_type (gfc_array_index_type, + build_int_cst (gfc_array_index_type, 0), + NULL_TREE); /* The maximum array element size that can be handled is determined by the number of bits available to store this field in the array @@ -778,9 +792,6 @@ gfc_is_nodesc_array (gfc_symbol * sym) if (sym->attr.result || sym->attr.function) return 0; - if (sym->attr.pointer || sym->attr.allocatable) - return 0; - gcc_assert (sym->as->type == AS_EXPLICIT); return 1; @@ -926,8 +937,8 @@ gfc_get_dtype (tree type) if (size && !INTEGER_CST_P (size)) { tmp = build_int_cst (gfc_array_index_type, GFC_DTYPE_SIZE_SHIFT); - tmp = fold (build2 (LSHIFT_EXPR, gfc_array_index_type, size, tmp)); - dtype = fold (build2 (PLUS_EXPR, gfc_array_index_type, tmp, dtype)); + tmp = fold_build2 (LSHIFT_EXPR, gfc_array_index_type, size, tmp); + dtype = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, dtype); } /* If we don't know the size we leave it as zero. This should never happen for anything that is actually used. */ @@ -1160,11 +1171,11 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound, if (upper != NULL_TREE && lower != NULL_TREE && stride != NULL_TREE) { - tmp = fold (build2 (MINUS_EXPR, gfc_array_index_type, upper, lower)); - tmp = fold (build2 (PLUS_EXPR, gfc_array_index_type, tmp, - gfc_index_one_node)); + tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, upper, lower); + tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, + gfc_index_one_node); stride = - fold (build2 (MULT_EXPR, gfc_array_index_type, tmp, stride)); + fold_build2 (MULT_EXPR, gfc_array_index_type, tmp, stride); /* Check the folding worked. */ gcc_assert (INTEGER_CST_P (stride)); } @@ -1178,9 +1189,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound, /* We define data as an unknown size array. Much better than doing pointer arithmetic. */ arraytype = - build_array_type (etype, - build_range_type (gfc_array_index_type, - gfc_index_zero_node, NULL_TREE)); + build_array_type (etype, gfc_array_range_type); arraytype = build_pointer_type (arraytype); GFC_TYPE_ARRAY_DATAPTR_TYPE (fat_type) = arraytype; @@ -1265,6 +1274,18 @@ gfc_sym_type (gfc_symbol * sym) sym = sym->result; type = gfc_typenode_for_spec (&sym->ts); + if (gfc_option.flag_f2c + && sym->attr.function + && sym->ts.type == BT_REAL + && sym->ts.kind == gfc_default_real_kind + && !sym->attr.always_explicit) + { + /* Special case: f2c calling conventions require that (scalar) + default REAL functions return the C type double instead. */ + sym->ts.kind = gfc_default_double_kind; + type = gfc_typenode_for_spec (&sym->ts); + sym->ts.kind = gfc_default_real_kind; + } if (sym->attr.dummy && !sym->attr.function) byref = 1; @@ -1446,22 +1467,76 @@ gfc_get_derived_type (gfc_symbol * derived) int gfc_return_by_reference (gfc_symbol * sym) { + gfc_symbol *result; + if (!sym->attr.function) return 0; - if (sym->result) - sym = sym->result; + result = sym->result ? sym->result : sym; - if (sym->attr.dimension) + if (result->attr.dimension) return 1; - if (sym->ts.type == BT_CHARACTER) + if (result->ts.type == BT_CHARACTER) return 1; - /* Possibly return complex numbers by reference for g77 compatibility. */ + /* Possibly return complex numbers by reference for g77 compatibility. + We don't do this for calls to intrinsics (as the library uses the + -fno-f2c calling convention), nor for calls to functions which always + require an explicit interface, as no compatibility problems can + arise there. */ + if (gfc_option.flag_f2c + && result->ts.type == BT_COMPLEX + && !sym->attr.intrinsic && !sym->attr.always_explicit) + return 1; + return 0; } +static tree +gfc_get_mixed_entry_union (gfc_namespace *ns) +{ + tree type; + tree decl; + tree fieldlist; + char name[GFC_MAX_SYMBOL_LEN + 1]; + gfc_entry_list *el, *el2; + + gcc_assert (ns->proc_name->attr.mixed_entry_master); + gcc_assert (memcmp (ns->proc_name->name, "master.", 7) == 0); + + snprintf (name, GFC_MAX_SYMBOL_LEN, "munion.%s", ns->proc_name->name + 7); + + /* Build the type node. */ + type = make_node (UNION_TYPE); + + TYPE_NAME (type) = get_identifier (name); + fieldlist = NULL; + + for (el = ns->entries; el; el = el->next) + { + /* Search for duplicates. */ + for (el2 = ns->entries; el2 != el; el2 = el2->next) + if (el2->sym->result == el->sym->result) + break; + + if (el == el2) + { + decl = build_decl (FIELD_DECL, + get_identifier (el->sym->result->name), + gfc_sym_type (el->sym->result)); + DECL_CONTEXT (decl) = type; + fieldlist = chainon (fieldlist, decl); + } + } + + /* Finish off the type. */ + TYPE_FIELDS (type) = fieldlist; + + gfc_finish_type (type); + return type; +} + tree gfc_get_function_type (gfc_symbol * sym) { @@ -1500,7 +1575,7 @@ gfc_get_function_type (gfc_symbol * sym) gfc_conv_const_charlen (arg->ts.cl); type = gfc_sym_type (arg); - if (arg->ts.type == BT_DERIVED + if (arg->ts.type == BT_COMPLEX || arg->attr.dimension || arg->ts.type == BT_CHARACTER) type = build_reference_type (type); @@ -1564,6 +1639,8 @@ gfc_get_function_type (gfc_symbol * sym) type = integer_type_node; else if (!sym->attr.function || gfc_return_by_reference (sym)) type = void_type_node; + else if (sym->attr.mixed_entry_master) + type = gfc_get_mixed_entry_union (sym->ns); else type = gfc_sym_type (sym); diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c index 8c9d342c5c2..70630cbecab 100644 --- a/gcc/fortran/trans.c +++ b/gcc/fortran/trans.c @@ -152,7 +152,7 @@ gfc_add_modify_expr (stmtblock_t * pblock, tree lhs, tree rhs) || AGGREGATE_TYPE_P (TREE_TYPE (lhs))); #endif - tmp = fold (build2_v (MODIFY_EXPR, lhs, rhs)); + tmp = fold_build2 (MODIFY_EXPR, void_type_node, lhs, rhs); gfc_add_expr_to_block (pblock, tmp); } diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 712c530aaee..d44c67d6d48 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -272,7 +272,7 @@ void gfc_conv_string_parameter (gfc_se * se); tree gfc_chainon_list (tree, tree); /* When using the gfc_conv_* make sure you understand what they do, i.e. - when a POST chain may be created, and what the retured expression may be + when a POST chain may be created, and what the returned expression may be used for. Note that character strings have special handling. This should not be a problem as most statements/operations only deal with numeric/logical types. */ @@ -332,7 +332,7 @@ void gfc_add_modify_expr (stmtblock_t *, tree, tree); /* Initialize a statement block. */ void gfc_init_block (stmtblock_t *); -/* Start a new satement block. Like gfc_init_block but also starts a new +/* Start a new statement block. Like gfc_init_block but also starts a new variable scope. */ void gfc_start_block (stmtblock_t *); /* Finish a statement block. Also closes the scope if the block was created @@ -396,7 +396,7 @@ void gfc_restore_sym (gfc_symbol *, gfc_saved_var *); /* Returns true if a variable of specified size should go on the stack. */ int gfc_can_put_var_on_stack (tree); -/* Allocate the lang-spcific part of a decl node. */ +/* Allocate the lang-specific part of a decl node. */ void gfc_allocate_lang_decl (tree); /* Advance along a TREE_CHAIN. */ diff --git a/gcc/function.c b/gcc/function.c index 9db8ae08952..2e2152da498 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -189,14 +189,9 @@ struct temp_slot GTY(()) static rtx assign_stack_local_1 (enum machine_mode, HOST_WIDE_INT, int, struct function *); static struct temp_slot *find_temp_slot_from_address (rtx); -static void instantiate_decls (tree, int); -static void instantiate_decls_1 (tree, int); -static void instantiate_decl (rtx, HOST_WIDE_INT, int); -static rtx instantiate_new_reg (rtx, HOST_WIDE_INT *); -static int instantiate_virtual_regs_1 (rtx *, rtx, int); static void pad_to_arg_alignment (struct args_size *, int, struct args_size *); static void pad_below (struct args_size *, enum machine_mode, tree); -static void reorder_blocks_1 (rtx, tree, varray_type *); +static void reorder_blocks_1 (rtx, tree, VEC(tree,heap) **); static void reorder_fix_fragments (tree); static int all_blocks (tree, tree *); static tree *get_block_vector (tree, int *); @@ -214,7 +209,6 @@ static rtx keep_stack_depressed (rtx); static void prepare_function_start (tree); static void do_clobber_return_reg (rtx, void *); static void do_use_return_reg (rtx, void *); -static void instantiate_virtual_regs_lossage (rtx); static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED; /* Pointer to chain of `struct function' for containing functions. */ @@ -242,21 +236,10 @@ find_function_data (tree decl) variables. */ void -push_function_context_to (tree context) +push_function_context_to (tree context ATTRIBUTE_UNUSED) { struct function *p; - if (context) - { - if (context == current_function_decl) - cfun->contains_functions = 1; - else - { - struct function *containing = find_function_data (context); - containing->contains_functions = 1; - } - } - if (cfun == 0) init_dummy_function_start (); p = cfun; @@ -328,6 +311,7 @@ free_after_compilation (struct function *f) f->emit = NULL; f->varasm = NULL; f->machine = NULL; + f->cfg = NULL; f->x_avail_temp_slots = NULL; f->x_used_temp_slots = NULL; @@ -588,13 +572,13 @@ make_slot_available (struct temp_slot *temp) free_temp_slots. Automatic variables for a block are allocated with this flag. KEEP values of 2 or 3 were needed respectively for variables whose lifetime is controlled by CLEANUP_POINT_EXPRs - or for SAVE_EXPRs, but they are now unused and will abort. + or for SAVE_EXPRs, but they are now unused. TYPE is the type that will be used for the stack slot. */ rtx -assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, int keep, - tree type) +assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size, + int keep, tree type) { unsigned int align; struct temp_slot *p, *best_p = 0, *selected = NULL, **pp; @@ -825,7 +809,7 @@ assign_temp (tree type_or_decl, int keep, int memory_required, /* The size of the temporary may be too large to fit into an integer. */ /* ??? Not sure this should happen except for user silliness, so limit this to things that aren't compiler-generated temporaries. The - rest of the time we'll abort in assign_stack_temp_for_type. */ + rest of the time we'll die in assign_stack_temp_for_type. */ if (decl && size == -1 && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST) { @@ -1227,184 +1211,6 @@ static int cfa_offset; #endif -/* Pass through the INSNS of function FNDECL and convert virtual register - references to hard register references. */ - -void -instantiate_virtual_regs (void) -{ - rtx insn; - - /* Compute the offsets to use for this function. */ - in_arg_offset = FIRST_PARM_OFFSET (current_function_decl); - var_offset = STARTING_FRAME_OFFSET; - dynamic_offset = STACK_DYNAMIC_OFFSET (current_function_decl); - out_arg_offset = STACK_POINTER_OFFSET; - cfa_offset = ARG_POINTER_CFA_OFFSET (current_function_decl); - - /* Scan all variables and parameters of this function. For each that is - in memory, instantiate all virtual registers if the result is a valid - address. If not, we do it later. That will handle most uses of virtual - regs on many machines. */ - instantiate_decls (current_function_decl, 1); - - /* Initialize recognition, indicating that volatile is OK. */ - init_recog (); - - /* Scan through all the insns, instantiating every virtual register still - present. */ - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) - if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN - || GET_CODE (insn) == CALL_INSN) - { - instantiate_virtual_regs_1 (&PATTERN (insn), insn, 1); - if (INSN_DELETED_P (insn)) - continue; - instantiate_virtual_regs_1 (®_NOTES (insn), NULL_RTX, 0); - /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */ - if (GET_CODE (insn) == CALL_INSN) - instantiate_virtual_regs_1 (&CALL_INSN_FUNCTION_USAGE (insn), - NULL_RTX, 0); - - /* Past this point all ASM statements should match. Verify that - to avoid failures later in the compilation process. */ - if (asm_noperands (PATTERN (insn)) >= 0 - && ! check_asm_operands (PATTERN (insn))) - instantiate_virtual_regs_lossage (insn); - } - - /* Now instantiate the remaining register equivalences for debugging info. - These will not be valid addresses. */ - instantiate_decls (current_function_decl, 0); - - /* Indicate that, from now on, assign_stack_local should use - frame_pointer_rtx. */ - virtuals_instantiated = 1; -} - -/* Scan all decls in FNDECL (both variables and parameters) and instantiate - all virtual registers in their DECL_RTL's. - - If VALID_ONLY, do this only if the resulting address is still valid. - Otherwise, always do it. */ - -static void -instantiate_decls (tree fndecl, int valid_only) -{ - tree decl; - - /* Process all parameters of the function. */ - for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl)) - { - HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (decl)); - HOST_WIDE_INT size_rtl; - - instantiate_decl (DECL_RTL (decl), size, valid_only); - - /* If the parameter was promoted, then the incoming RTL mode may be - larger than the declared type size. We must use the larger of - the two sizes. */ - size_rtl = GET_MODE_SIZE (GET_MODE (DECL_INCOMING_RTL (decl))); - size = MAX (size_rtl, size); - instantiate_decl (DECL_INCOMING_RTL (decl), size, valid_only); - } - - /* Now process all variables defined in the function or its subblocks. */ - instantiate_decls_1 (DECL_INITIAL (fndecl), valid_only); -} - -/* Subroutine of instantiate_decls: Process all decls in the given - BLOCK node and all its subblocks. */ - -static void -instantiate_decls_1 (tree let, int valid_only) -{ - tree t; - - for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t)) - if (DECL_RTL_SET_P (t)) - instantiate_decl (DECL_RTL (t), - int_size_in_bytes (TREE_TYPE (t)), - valid_only); - - /* Process all subblocks. */ - for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t)) - instantiate_decls_1 (t, valid_only); -} - -/* Subroutine of the preceding procedures: Given RTL representing a - decl and the size of the object, do any instantiation required. - - If VALID_ONLY is nonzero, it means that the RTL should only be - changed if the new address is valid. */ - -static void -instantiate_decl (rtx x, HOST_WIDE_INT size, int valid_only) -{ - enum machine_mode mode; - rtx addr; - - if (x == 0) - return; - - /* If this is a CONCAT, recurse for the pieces. */ - if (GET_CODE (x) == CONCAT) - { - instantiate_decl (XEXP (x, 0), size / 2, valid_only); - instantiate_decl (XEXP (x, 1), size / 2, valid_only); - return; - } - - /* If this is not a MEM, no need to do anything. Similarly if the - address is a constant or a register that is not a virtual register. */ - if (!MEM_P (x)) - return; - - addr = XEXP (x, 0); - if (CONSTANT_P (addr) - || (REG_P (addr) - && (REGNO (addr) < FIRST_VIRTUAL_REGISTER - || REGNO (addr) > LAST_VIRTUAL_REGISTER))) - return; - - /* If we should only do this if the address is valid, copy the address. - We need to do this so we can undo any changes that might make the - address invalid. This copy is unfortunate, but probably can't be - avoided. */ - - if (valid_only) - addr = copy_rtx (addr); - - instantiate_virtual_regs_1 (&addr, NULL_RTX, 0); - - if (valid_only && size >= 0) - { - unsigned HOST_WIDE_INT decl_size = size; - - /* Now verify that the resulting address is valid for every integer or - floating-point mode up to and including SIZE bytes long. We do this - since the object might be accessed in any mode and frame addresses - are shared. */ - - for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); - mode != VOIDmode && GET_MODE_SIZE (mode) <= decl_size; - mode = GET_MODE_WIDER_MODE (mode)) - if (! memory_address_p (mode, addr)) - return; - - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode && GET_MODE_SIZE (mode) <= decl_size; - mode = GET_MODE_WIDER_MODE (mode)) - if (! memory_address_p (mode, addr)) - return; - } - - /* Put back the address now that we have updated it and we either know - it is valid or we don't care whether it is valid. */ - - XEXP (x, 0) = addr; -} - /* Given a piece of RTX and a pointer to a HOST_WIDE_INT, if the RTX is a virtual register, return the equivalent hard register and set the offset indirectly through the pointer. Otherwise, return 0. */ @@ -1426,410 +1232,428 @@ instantiate_new_reg (rtx x, HOST_WIDE_INT *poffset) else if (x == virtual_cfa_rtx) new = arg_pointer_rtx, offset = cfa_offset; else - return 0; + return NULL_RTX; *poffset = offset; return new; } - -/* Called when instantiate_virtual_regs has failed to update the instruction. - Usually this means that non-matching instruction has been emit, however for - asm statements it may be the problem in the constraints. */ -static void -instantiate_virtual_regs_lossage (rtx insn) +/* A subroutine of instantiate_virtual_regs, called via for_each_rtx. + Instantiate any virtual registers present inside of *LOC. The expression + is simplified, as much as possible, but is not to be considered "valid" + in any sense implied by the target. If any change is made, set CHANGED + to true. */ + +static int +instantiate_virtual_regs_in_rtx (rtx *loc, void *data) { - gcc_assert (asm_noperands (PATTERN (insn)) >= 0); - error_for_asm (insn, "impossible constraint in %"); - delete_insn (insn); -} -/* Given a pointer to a piece of rtx and an optional pointer to the - containing object, instantiate any virtual registers present in it. + HOST_WIDE_INT offset; + bool *changed = (bool *) data; + rtx x, new; - If EXTRA_INSNS, we always do the replacement and generate - any extra insns before OBJECT. If it zero, we do nothing if replacement - is not valid. + x = *loc; + if (x == 0) + return 0; - Return 1 if we either had nothing to do or if we were able to do the - needed replacement. Return 0 otherwise; we only return zero if - EXTRA_INSNS is zero. + switch (GET_CODE (x)) + { + case REG: + new = instantiate_new_reg (x, &offset); + if (new) + { + *loc = plus_constant (new, offset); + if (changed) + *changed = true; + } + return -1; - We first try some simple transformations to avoid the creation of extra - pseudos. */ + case PLUS: + new = instantiate_new_reg (XEXP (x, 0), &offset); + if (new) + { + new = plus_constant (new, offset); + *loc = simplify_gen_binary (PLUS, GET_MODE (x), new, XEXP (x, 1)); + if (changed) + *changed = true; + return -1; + } + + /* FIXME -- from old code */ + /* If we have (plus (subreg (virtual-reg)) (const_int)), we know + we can commute the PLUS and SUBREG because pointers into the + frame are well-behaved. */ + break; + + default: + break; + } + + return 0; +} + +/* A subroutine of instantiate_virtual_regs_in_insn. Return true if X + matches the predicate for insn CODE operand OPERAND. */ static int -instantiate_virtual_regs_1 (rtx *loc, rtx object, int extra_insns) +safe_insn_predicate (int code, int operand, rtx x) { - rtx x; - RTX_CODE code; - rtx new = 0; - HOST_WIDE_INT offset = 0; - rtx temp; - rtx seq; - int i, j; - const char *fmt; + const struct insn_operand_data *op_data; - /* Re-start here to avoid recursion in common cases. */ - restart: + if (code < 0) + return true; - x = *loc; - if (x == 0) - return 1; + op_data = &insn_data[code].operand[operand]; + if (op_data->predicate == NULL) + return true; - /* We may have detected and deleted invalid asm statements. */ - if (object && INSN_P (object) && INSN_DELETED_P (object)) - return 1; + return op_data->predicate (x, op_data->mode); +} - code = GET_CODE (x); +/* A subroutine of instantiate_virtual_regs. Instantiate any virtual + registers present inside of insn. The result will be a valid insn. */ - /* Check for some special cases. */ - switch (code) - { - case CONST_INT: - case CONST_DOUBLE: - case CONST_VECTOR: - case CONST: - case SYMBOL_REF: - case CODE_LABEL: - case PC: - case CC0: - case ASM_INPUT: - case ADDR_VEC: - case ADDR_DIFF_VEC: - case RETURN: - return 1; +static void +instantiate_virtual_regs_in_insn (rtx insn) +{ + HOST_WIDE_INT offset; + int insn_code, i; + bool any_change = false; + rtx set, new, x, seq; - case SET: - /* We are allowed to set the virtual registers. This means that - the actual register should receive the source minus the - appropriate offset. This is used, for example, in the handling - of non-local gotos. */ - if ((new = instantiate_new_reg (SET_DEST (x), &offset)) != 0) + /* There are some special cases to be handled first. */ + set = single_set (insn); + if (set) + { + /* We're allowed to assign to a virtual register. This is interpreted + to mean that the underlying register gets assigned the inverse + transformation. This is used, for example, in the handling of + non-local gotos. */ + new = instantiate_new_reg (SET_DEST (set), &offset); + if (new) { - rtx src = SET_SRC (x); - - /* We are setting the register, not using it, so the relevant - offset is the negative of the offset to use were we using - the register. */ - offset = - offset; - instantiate_virtual_regs_1 (&src, NULL_RTX, 0); + start_sequence (); - /* The only valid sources here are PLUS or REG. Just do - the simplest possible thing to handle them. */ - if (!REG_P (src) && GET_CODE (src) != PLUS) - { - instantiate_virtual_regs_lossage (object); - return 1; - } + for_each_rtx (&SET_SRC (set), instantiate_virtual_regs_in_rtx, NULL); + x = simplify_gen_binary (PLUS, GET_MODE (new), SET_SRC (set), + GEN_INT (-offset)); + x = force_operand (x, new); + if (x != new) + emit_move_insn (new, x); - start_sequence (); - if (!REG_P (src)) - temp = force_operand (src, NULL_RTX); - else - temp = src; - temp = force_operand (plus_constant (temp, offset), NULL_RTX); seq = get_insns (); end_sequence (); - emit_insn_before (seq, object); - SET_DEST (x) = new; + emit_insn_before (seq, insn); + delete_insn (insn); + return; + } - if (! validate_change (object, &SET_SRC (x), temp, 0) - || ! extra_insns) - instantiate_virtual_regs_lossage (object); + /* Handle a straight copy from a virtual register by generating a + new add insn. The difference between this and falling through + to the generic case is avoiding a new pseudo and eliminating a + move insn in the initial rtl stream. */ + new = instantiate_new_reg (SET_SRC (set), &offset); + if (new && offset != 0 + && REG_P (SET_DEST (set)) + && REGNO (SET_DEST (set)) > LAST_VIRTUAL_REGISTER) + { + start_sequence (); - return 1; - } + x = expand_simple_binop (GET_MODE (SET_DEST (set)), PLUS, + new, GEN_INT (offset), SET_DEST (set), + 1, OPTAB_LIB_WIDEN); + if (x != SET_DEST (set)) + emit_move_insn (SET_DEST (set), x); - instantiate_virtual_regs_1 (&SET_DEST (x), object, extra_insns); - loc = &SET_SRC (x); - goto restart; + seq = get_insns (); + end_sequence (); - case PLUS: - /* Handle special case of virtual register plus constant. */ - if (CONSTANT_P (XEXP (x, 1))) + emit_insn_before (seq, insn); + delete_insn (insn); + return; + } + + extract_insn (insn); + insn_code = INSN_CODE (insn); + + /* Handle a plus involving a virtual register by determining if the + operands remain valid if they're modified in place. */ + if (GET_CODE (SET_SRC (set)) == PLUS + && recog_data.n_operands >= 3 + && recog_data.operand_loc[1] == &XEXP (SET_SRC (set), 0) + && recog_data.operand_loc[2] == &XEXP (SET_SRC (set), 1) + && GET_CODE (recog_data.operand[2]) == CONST_INT + && (new = instantiate_new_reg (recog_data.operand[1], &offset))) { - rtx old, new_offset; + offset += INTVAL (recog_data.operand[2]); - /* Check for (plus (plus VIRT foo) (const_int)) first. */ - if (GET_CODE (XEXP (x, 0)) == PLUS) + /* If the sum is zero, then replace with a plain move. */ + if (offset == 0 + && REG_P (SET_DEST (set)) + && REGNO (SET_DEST (set)) > LAST_VIRTUAL_REGISTER) { - if ((new = instantiate_new_reg (XEXP (XEXP (x, 0), 0), &offset))) - { - instantiate_virtual_regs_1 (&XEXP (XEXP (x, 0), 1), object, - extra_insns); - new = gen_rtx_PLUS (Pmode, new, XEXP (XEXP (x, 0), 1)); - } - else - { - loc = &XEXP (x, 0); - goto restart; - } + start_sequence (); + emit_move_insn (SET_DEST (set), new); + seq = get_insns (); + end_sequence (); + + emit_insn_before (seq, insn); + delete_insn (insn); + return; } -#ifdef POINTERS_EXTEND_UNSIGNED - /* If we have (plus (subreg (virtual-reg)) (const_int)), we know - we can commute the PLUS and SUBREG because pointers into the - frame are well-behaved. */ - else if (GET_CODE (XEXP (x, 0)) == SUBREG && GET_MODE (x) == ptr_mode - && GET_CODE (XEXP (x, 1)) == CONST_INT - && 0 != (new - = instantiate_new_reg (SUBREG_REG (XEXP (x, 0)), - &offset)) - && validate_change (object, loc, - plus_constant (gen_lowpart (ptr_mode, - new), - offset - + INTVAL (XEXP (x, 1))), - 0)) - return 1; -#endif - else if ((new = instantiate_new_reg (XEXP (x, 0), &offset)) == 0) + x = gen_int_mode (offset, recog_data.operand_mode[2]); + + /* Using validate_change and apply_change_group here leaves + recog_data in an invalid state. Since we know exactly what + we want to check, do those two by hand. */ + if (safe_insn_predicate (insn_code, 1, new) + && safe_insn_predicate (insn_code, 2, x)) { - /* We know the second operand is a constant. Unless the - first operand is a REG (which has been already checked), - it needs to be checked. */ - if (!REG_P (XEXP (x, 0))) - { - loc = &XEXP (x, 0); - goto restart; - } - return 1; + *recog_data.operand_loc[1] = recog_data.operand[1] = new; + *recog_data.operand_loc[2] = recog_data.operand[2] = x; + any_change = true; + + /* Fall through into the regular operand fixup loop in + order to take care of operands other than 1 and 2. */ } + } + } + else + { + extract_insn (insn); + insn_code = INSN_CODE (insn); + } - new_offset = plus_constant (XEXP (x, 1), offset); + /* In the general case, we expect virtual registers to appear only in + operands, and then only as either bare registers or inside memories. */ + for (i = 0; i < recog_data.n_operands; ++i) + { + x = recog_data.operand[i]; + switch (GET_CODE (x)) + { + case MEM: + { + rtx addr = XEXP (x, 0); + bool changed = false; - /* If the new constant is zero, try to replace the sum with just - the register. */ - if (new_offset == const0_rtx - && validate_change (object, loc, new, 0)) - return 1; + for_each_rtx (&addr, instantiate_virtual_regs_in_rtx, &changed); + if (!changed) + continue; - /* Next try to replace the register and new offset. - There are two changes to validate here and we can't assume that - in the case of old offset equals new just changing the register - will yield a valid insn. In the interests of a little efficiency, - however, we only call validate change once (we don't queue up the - changes and then call apply_change_group). */ + start_sequence (); + x = replace_equiv_address (x, addr); + seq = get_insns (); + end_sequence (); + if (seq) + emit_insn_before (seq, insn); + } + break; - old = XEXP (x, 0); - if (offset == 0 - ? ! validate_change (object, &XEXP (x, 0), new, 0) - : (XEXP (x, 0) = new, - ! validate_change (object, &XEXP (x, 1), new_offset, 0))) + case REG: + new = instantiate_new_reg (x, &offset); + if (new == NULL) + continue; + if (offset == 0) + x = new; + else { - if (! extra_insns) - { - XEXP (x, 0) = old; - return 0; - } - - /* Otherwise copy the new constant into a register and replace - constant with that register. */ - temp = gen_reg_rtx (Pmode); - XEXP (x, 0) = new; - if (validate_change (object, &XEXP (x, 1), temp, 0)) - emit_insn_before (gen_move_insn (temp, new_offset), object); - else - { - /* If that didn't work, replace this expression with a - register containing the sum. */ - - XEXP (x, 0) = old; - new = gen_rtx_PLUS (Pmode, new, new_offset); + start_sequence (); - start_sequence (); - temp = force_operand (new, NULL_RTX); - seq = get_insns (); - end_sequence (); + /* Careful, special mode predicates may have stuff in + insn_data[insn_code].operand[i].mode that isn't useful + to us for computing a new value. */ + /* ??? Recognize address_operand and/or "p" constraints + to see if (plus new offset) is a valid before we put + this through expand_simple_binop. */ + x = expand_simple_binop (GET_MODE (x), PLUS, new, + GEN_INT (offset), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + seq = get_insns (); + end_sequence (); + emit_insn_before (seq, insn); + } + break; - emit_insn_before (seq, object); - if (! validate_change (object, loc, temp, 0) - && ! validate_replace_rtx (x, temp, object)) - { - instantiate_virtual_regs_lossage (object); - return 1; - } - } + case SUBREG: + new = instantiate_new_reg (SUBREG_REG (x), &offset); + if (new == NULL) + continue; + if (offset != 0) + { + start_sequence (); + new = expand_simple_binop (GET_MODE (new), PLUS, new, + GEN_INT (offset), NULL_RTX, + 1, OPTAB_LIB_WIDEN); + seq = get_insns (); + end_sequence (); + emit_insn_before (seq, insn); } + x = simplify_gen_subreg (recog_data.operand_mode[i], new, + GET_MODE (new), SUBREG_BYTE (x)); + break; - return 1; + default: + continue; } - /* Fall through to generic two-operand expression case. */ - case EXPR_LIST: - case CALL: - case COMPARE: - case MINUS: - case MULT: - case DIV: case UDIV: - case MOD: case UMOD: - case AND: case IOR: case XOR: - case ROTATERT: case ROTATE: - case ASHIFTRT: case LSHIFTRT: case ASHIFT: - case NE: case EQ: - case GE: case GT: case GEU: case GTU: - case LE: case LT: case LEU: case LTU: - if (XEXP (x, 1) && ! CONSTANT_P (XEXP (x, 1))) - instantiate_virtual_regs_1 (&XEXP (x, 1), object, extra_insns); - loc = &XEXP (x, 0); - goto restart; - - case MEM: - /* Most cases of MEM that convert to valid addresses have already been - handled by our scan of decls. The only special handling we - need here is to make a copy of the rtx to ensure it isn't being - shared if we have to change it to a pseudo. - - If the rtx is a simple reference to an address via a virtual register, - it can potentially be shared. In such cases, first try to make it - a valid address, which can also be shared. Otherwise, copy it and - proceed normally. - - First check for common cases that need no processing. These are - usually due to instantiation already being done on a previous instance - of a shared rtx. */ - - temp = XEXP (x, 0); - if (CONSTANT_ADDRESS_P (temp) -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM - || temp == arg_pointer_rtx -#endif -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || temp == hard_frame_pointer_rtx -#endif - || temp == frame_pointer_rtx) - return 1; - - if (GET_CODE (temp) == PLUS - && CONSTANT_ADDRESS_P (XEXP (temp, 1)) - && (XEXP (temp, 0) == frame_pointer_rtx -#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM - || XEXP (temp, 0) == hard_frame_pointer_rtx -#endif -#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM - || XEXP (temp, 0) == arg_pointer_rtx -#endif - )) - return 1; - - if (temp == virtual_stack_vars_rtx - || temp == virtual_incoming_args_rtx - || (GET_CODE (temp) == PLUS - && CONSTANT_ADDRESS_P (XEXP (temp, 1)) - && (XEXP (temp, 0) == virtual_stack_vars_rtx - || XEXP (temp, 0) == virtual_incoming_args_rtx))) + /* At this point, X contains the new value for the operand. + Validate the new value vs the insn predicate. Note that + asm insns will have insn_code -1 here. */ + if (!safe_insn_predicate (insn_code, i, x)) + x = force_reg (insn_data[insn_code].operand[i].mode, x); + + *recog_data.operand_loc[i] = recog_data.operand[i] = x; + any_change = true; + } + + if (any_change) + { + /* Propagate operand changes into the duplicates. */ + for (i = 0; i < recog_data.n_dups; ++i) + *recog_data.dup_loc[i] + = recog_data.operand[(unsigned)recog_data.dup_num[i]]; + + /* Force re-recognition of the instruction for validation. */ + INSN_CODE (insn) = -1; + } + + if (asm_noperands (PATTERN (insn)) >= 0) + { + if (!check_asm_operands (PATTERN (insn))) { - /* This MEM may be shared. If the substitution can be done without - the need to generate new pseudos, we want to do it in place - so all copies of the shared rtx benefit. The call below will - only make substitutions if the resulting address is still - valid. - - Note that we cannot pass X as the object in the recursive call - since the insn being processed may not allow all valid - addresses. However, if we were not passed on object, we can - only modify X without copying it if X will have a valid - address. - - ??? Also note that this can still lose if OBJECT is an insn that - has less restrictions on an address that some other insn. - In that case, we will modify the shared address. This case - doesn't seem very likely, though. One case where this could - happen is in the case of a USE or CLOBBER reference, but we - take care of that below. */ - - if (instantiate_virtual_regs_1 (&XEXP (x, 0), - object ? object : x, 0)) - return 1; - - /* Otherwise make a copy and process that copy. We copy the entire - RTL expression since it might be a PLUS which could also be - shared. */ - *loc = x = copy_rtx (x); + error_for_asm (insn, "impossible constraint in %"); + delete_insn (insn); } + } + else + { + if (recog_memoized (insn) < 0) + fatal_insn_not_found (insn); + } +} - /* Fall through to generic unary operation case. */ - case PREFETCH: - case SUBREG: - case STRICT_LOW_PART: - case NEG: case NOT: - case PRE_DEC: case PRE_INC: case POST_DEC: case POST_INC: - case SIGN_EXTEND: case ZERO_EXTEND: - case TRUNCATE: case FLOAT_EXTEND: case FLOAT_TRUNCATE: - case FLOAT: case FIX: - case UNSIGNED_FIX: case UNSIGNED_FLOAT: - case ABS: - case SQRT: - case FFS: - case CLZ: case CTZ: - case POPCOUNT: case PARITY: - /* These case either have just one operand or we know that we need not - check the rest of the operands. */ - loc = &XEXP (x, 0); - goto restart; - - case USE: - case CLOBBER: - /* If the operand is a MEM, see if the change is a valid MEM. If not, - go ahead and make the invalid one, but do it to a copy. For a REG, - just make the recursive call, since there's no chance of a problem. */ - - if ((MEM_P (XEXP (x, 0)) - && instantiate_virtual_regs_1 (&XEXP (XEXP (x, 0), 0), XEXP (x, 0), - 0)) - || (REG_P (XEXP (x, 0)) - && instantiate_virtual_regs_1 (&XEXP (x, 0), object, 0))) - return 1; - - XEXP (x, 0) = copy_rtx (XEXP (x, 0)); - loc = &XEXP (x, 0); - goto restart; +/* Subroutine of instantiate_decls. Given RTL representing a decl, + do any instantiation required. */ - case REG: - /* Try to replace with a PLUS. If that doesn't work, compute the sum - in front of this insn and substitute the temporary. */ - if ((new = instantiate_new_reg (x, &offset)) != 0) - { - temp = plus_constant (new, offset); - if (!validate_change (object, loc, temp, 0)) - { - if (! extra_insns) - return 0; +static void +instantiate_decl (rtx x) +{ + rtx addr; - start_sequence (); - temp = force_operand (temp, NULL_RTX); - seq = get_insns (); - end_sequence (); + if (x == 0) + return; - emit_insn_before (seq, object); - if (! validate_change (object, loc, temp, 0) - && ! validate_replace_rtx (x, temp, object)) - instantiate_virtual_regs_lossage (object); - } - } + /* If this is a CONCAT, recurse for the pieces. */ + if (GET_CODE (x) == CONCAT) + { + instantiate_decl (XEXP (x, 0)); + instantiate_decl (XEXP (x, 1)); + return; + } - return 1; + /* If this is not a MEM, no need to do anything. Similarly if the + address is a constant or a register that is not a virtual register. */ + if (!MEM_P (x)) + return; - default: - break; + addr = XEXP (x, 0); + if (CONSTANT_P (addr) + || (REG_P (addr) + && (REGNO (addr) < FIRST_VIRTUAL_REGISTER + || REGNO (addr) > LAST_VIRTUAL_REGISTER))) + return; + + for_each_rtx (&XEXP (x, 0), instantiate_virtual_regs_in_rtx, NULL); +} + +/* Subroutine of instantiate_decls: Process all decls in the given + BLOCK node and all its subblocks. */ + +static void +instantiate_decls_1 (tree let) +{ + tree t; + + for (t = BLOCK_VARS (let); t; t = TREE_CHAIN (t)) + if (DECL_RTL_SET_P (t)) + instantiate_decl (DECL_RTL (t)); + + /* Process all subblocks. */ + for (t = BLOCK_SUBBLOCKS (let); t; t = TREE_CHAIN (t)) + instantiate_decls_1 (t); +} + +/* Scan all decls in FNDECL (both variables and parameters) and instantiate + all virtual registers in their DECL_RTL's. */ + +static void +instantiate_decls (tree fndecl) +{ + tree decl; + + /* Process all parameters of the function. */ + for (decl = DECL_ARGUMENTS (fndecl); decl; decl = TREE_CHAIN (decl)) + { + instantiate_decl (DECL_RTL (decl)); + instantiate_decl (DECL_INCOMING_RTL (decl)); } - /* Scan all subexpressions. */ - fmt = GET_RTX_FORMAT (code); - for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) - if (*fmt == 'e') + /* Now process all variables defined in the function or its subblocks. */ + instantiate_decls_1 (DECL_INITIAL (fndecl)); +} + +/* Pass through the INSNS of function FNDECL and convert virtual register + references to hard register references. */ + +void +instantiate_virtual_regs (void) +{ + rtx insn; + + /* Compute the offsets to use for this function. */ + in_arg_offset = FIRST_PARM_OFFSET (current_function_decl); + var_offset = STARTING_FRAME_OFFSET; + dynamic_offset = STACK_DYNAMIC_OFFSET (current_function_decl); + out_arg_offset = STACK_POINTER_OFFSET; + cfa_offset = ARG_POINTER_CFA_OFFSET (current_function_decl); + + /* Initialize recognition, indicating that volatile is OK. */ + init_recog (); + + /* Scan through all the insns, instantiating every virtual register still + present. */ + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if (INSN_P (insn)) { - if (!instantiate_virtual_regs_1 (&XEXP (x, i), object, extra_insns)) - return 0; + /* These patterns in the instruction stream can never be recognized. + Fortunately, they shouldn't contain virtual registers either. */ + if (GET_CODE (PATTERN (insn)) == USE + || GET_CODE (PATTERN (insn)) == CLOBBER + || GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC + || GET_CODE (PATTERN (insn)) == ASM_INPUT) + continue; + + instantiate_virtual_regs_in_insn (insn); + + if (INSN_DELETED_P (insn)) + continue; + + for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL); + + /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */ + if (GET_CODE (insn) == CALL_INSN) + for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn), + instantiate_virtual_regs_in_rtx, NULL); } - else if (*fmt == 'E') - for (j = 0; j < XVECLEN (x, i); j++) - if (! instantiate_virtual_regs_1 (&XVECEXP (x, i, j), object, - extra_insns)) - return 0; - return 1; + /* Instantiate the virtual registers in the DECLs for debugging purposes. */ + instantiate_decls (current_function_decl); + + /* Indicate that, from now on, assign_stack_local should use + frame_pointer_rtx. */ + virtuals_instantiated = 1; } /* Return 1 if EXP is an aggregate type (or a value with aggregate type). @@ -3611,7 +3435,7 @@ setjmp_vars_warning (tree block) && DECL_RTL_SET_P (decl) && REG_P (DECL_RTL (decl)) && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl)))) - warning ("%Jvariable %qD might be clobbered by %" + warning (0, "%Jvariable %qD might be clobbered by %" " or %", decl, decl); } @@ -3632,7 +3456,7 @@ setjmp_args_warning (void) if (DECL_RTL (decl) != 0 && REG_P (DECL_RTL (decl)) && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl)))) - warning ("%Jargument %qD might be clobbered by % or %", + warning (0, "%Jargument %qD might be clobbered by % or %", decl, decl); } @@ -3647,12 +3471,12 @@ void reorder_blocks (void) { tree block = DECL_INITIAL (current_function_decl); - varray_type block_stack; + VEC(tree,heap) *block_stack; if (block == NULL_TREE) return; - VARRAY_TREE_INIT (block_stack, 10, "block_stack"); + block_stack = VEC_alloc (tree, heap, 10); /* Reset the TREE_ASM_WRITTEN bit for all blocks. */ clear_block_marks (block); @@ -3667,6 +3491,8 @@ reorder_blocks (void) /* Remove deleted blocks from the block fragment chains. */ reorder_fix_fragments (block); + + VEC_free (tree, heap, block_stack); } /* Helper function for reorder_blocks. Reset TREE_ASM_WRITTEN. */ @@ -3683,7 +3509,7 @@ clear_block_marks (tree block) } static void -reorder_blocks_1 (rtx insns, tree current_block, varray_type *p_block_stack) +reorder_blocks_1 (rtx insns, tree current_block, VEC(tree,heap) **p_block_stack) { rtx insn; @@ -3726,12 +3552,11 @@ reorder_blocks_1 (rtx insns, tree current_block, varray_type *p_block_stack) BLOCK_SUBBLOCKS (current_block) = block; current_block = block; } - VARRAY_PUSH_TREE (*p_block_stack, block); + VEC_safe_push (tree, heap, *p_block_stack, block); } else if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END) { - NOTE_BLOCK (insn) = VARRAY_TOP_TREE (*p_block_stack); - VARRAY_POP (*p_block_stack); + NOTE_BLOCK (insn) = VEC_pop (tree, *p_block_stack); BLOCK_SUBBLOCKS (current_block) = blocks_nreverse (BLOCK_SUBBLOCKS (current_block)); current_block = BLOCK_SUPERCONTEXT (current_block); @@ -3955,6 +3780,10 @@ allocate_struct_function (tree fndecl) && TYPE_ARG_TYPES (fntype) != 0 && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) != void_type_node)); + + /* Assume all registers in stdarg functions need to be saved. */ + cfun->va_list_gpr_size = VA_LIST_MAX_GPR_SIZE; + cfun->va_list_fpr_size = VA_LIST_MAX_FPR_SIZE; } /* Reset cfun, and other non-struct-function variables to defaults as @@ -4021,9 +3850,8 @@ init_function_start (tree subr) /* Warn if this value is an aggregate type, regardless of which calling convention we are using for it. */ - if (warn_aggregate_return - && AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr)))) - warning ("function returns an aggregate"); + if (AGGREGATE_TYPE_P (TREE_TYPE (DECL_RESULT (subr)))) + warning (OPT_Waggregate_return, "function returns an aggregate"); } /* Make sure all values used by the optimization passes have sane @@ -4039,13 +3867,6 @@ init_function_for_compilation (void) VARRAY_GROW (sibcall_epilogue, 0); } -/* Expand a call to __main at the beginning of a possible main function. */ - -#if defined(INIT_SECTION_ASM_OP) && !defined(INVOKE__main) -#undef HAS_INIT_SECTION -#define HAS_INIT_SECTION -#endif - void expand_main_function (void) { @@ -4085,7 +3906,10 @@ expand_main_function (void) } #endif -#ifndef HAS_INIT_SECTION +#if (defined(INVOKE__main) \ + || (!defined(HAS_INIT_SECTION) \ + && !defined(INIT_SECTION_ASM_OP) \ + && !defined(INIT_ARRAY_SECTION_ASM_OP))) emit_library_call (init_one_libfunc (NAME__MAIN), LCT_NORMAL, VOIDmode, 0); #endif } @@ -4346,7 +4170,7 @@ do_warn_unused_parameter (tree fn) decl; decl = TREE_CHAIN (decl)) if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL && DECL_NAME (decl) && !DECL_ARTIFICIAL (decl)) - warning ("%Junused parameter %qD", decl, decl); + warning (0, "%Junused parameter %qD", decl, decl); } static GTY(()) rtx initial_trampoline; @@ -4718,34 +4542,35 @@ emit_return_into_block (basic_block bb, rtx line_note) #if defined(HAVE_epilogue) && defined(INCOMING_RETURN_ADDR_RTX) -/* These functions convert the epilogue into a variant that does not modify the - stack pointer. This is used in cases where a function returns an object - whose size is not known until it is computed. The called function leaves the - object on the stack, leaves the stack depressed, and returns a pointer to - the object. - - What we need to do is track all modifications and references to the stack - pointer, deleting the modifications and changing the references to point to - the location the stack pointer would have pointed to had the modifications - taken place. - - These functions need to be portable so we need to make as few assumptions - about the epilogue as we can. However, the epilogue basically contains - three things: instructions to reset the stack pointer, instructions to - reload registers, possibly including the frame pointer, and an - instruction to return to the caller. - - If we can't be sure of what a relevant epilogue insn is doing, we abort. - We also make no attempt to validate the insns we make since if they are - invalid, we probably can't do anything valid. The intent is that these - routines get "smarter" as more and more machines start to use them and - they try operating on different epilogues. - - We use the following structure to track what the part of the epilogue that - we've already processed has done. We keep two copies of the SP equivalence, - one for use during the insn we are processing and one for use in the next - insn. The difference is because one part of a PARALLEL may adjust SP - and the other may use it. */ +/* These functions convert the epilogue into a variant that does not + modify the stack pointer. This is used in cases where a function + returns an object whose size is not known until it is computed. + The called function leaves the object on the stack, leaves the + stack depressed, and returns a pointer to the object. + + What we need to do is track all modifications and references to the + stack pointer, deleting the modifications and changing the + references to point to the location the stack pointer would have + pointed to had the modifications taken place. + + These functions need to be portable so we need to make as few + assumptions about the epilogue as we can. However, the epilogue + basically contains three things: instructions to reset the stack + pointer, instructions to reload registers, possibly including the + frame pointer, and an instruction to return to the caller. + + We must be sure of what a relevant epilogue insn is doing. We also + make no attempt to validate the insns we make since if they are + invalid, we probably can't do anything valid. The intent is that + these routines get "smarter" as more and more machines start to use + them and they try operating on different epilogues. + + We use the following structure to track what the part of the + epilogue that we've already processed has done. We keep two copies + of the SP equivalence, one for use during the insn we are + processing and one for use in the next insn. The difference is + because one part of a PARALLEL may adjust SP and the other may use + it. */ struct epi_info { @@ -4963,7 +4788,7 @@ static void handle_epilogue_set (rtx set, struct epi_info *p) { /* First handle the case where we are setting SP. Record what it is being - set from. If unknown, abort. */ + set from, which we must be able to determine */ if (reg_set_p (stack_pointer_rtx, set)) { gcc_assert (SET_DEST (set) == stack_pointer_rtx); @@ -4998,14 +4823,14 @@ handle_epilogue_set (rtx set, struct epi_info *p) return; } - /* Next handle the case where we are setting SP's equivalent register. - If we already have a value to set it to, abort. We could update, but - there seems little point in handling that case. Note that we have - to allow for the case where we are setting the register set in - the previous part of a PARALLEL inside a single insn. But use the - old offset for any updates within this insn. We must allow for the case - where the register is being set in a different (usually wider) mode than - Pmode). */ + /* Next handle the case where we are setting SP's equivalent + register. We must not already have a value to set it to. We + could update, but there seems little point in handling that case. + Note that we have to allow for the case where we are setting the + register set in the previous part of a PARALLEL inside a single + insn. But use the old offset for any updates within this insn. + We must allow for the case where the register is being set in a + different (usually wider) mode than Pmode). */ else if (p->new_sp_equiv_reg != 0 && reg_set_p (p->new_sp_equiv_reg, set)) { gcc_assert (!p->equiv_reg_src diff --git a/gcc/function.h b/gcc/function.h index 6444554189f..da435b17c22 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -162,15 +162,20 @@ struct expr_status GTY(()) struct function GTY(()) { struct eh_status *eh; + struct eh_status *saved_eh; struct expr_status *expr; struct emit_status *emit; struct varasm_status *varasm; + /* The control flow graph for this function. */ + struct control_flow_graph *cfg; + struct control_flow_graph *saved_cfg; + bool after_inlining; + /* For tree-optimize.c. */ /* Saved tree and arguments during tree optimization. Used later for inlining */ - tree saved_tree; tree saved_args; tree saved_static_chain_decl; @@ -349,6 +354,20 @@ struct function GTY(()) /* The variables unexpanded so far. */ tree unexpanded_var_list; + /* Assembly labels for the hot and cold text sections, to + be used by debugger functions for determining the size of text + sections. */ + + const char *hot_section_label; + const char *cold_section_label; + const char *hot_section_end_label; + const char *cold_section_end_label; + + /* String to be used for name of cold text sections, via + targetm.asm_out.named_section. */ + + const char *unlikely_text_section_name; + /* Collected bit flags. */ /* Nonzero if function being compiled needs to be given an address @@ -380,9 +399,6 @@ struct function GTY(()) function. */ unsigned int has_nonlocal_goto : 1; - /* Nonzero if function being compiled contains nested functions. */ - unsigned int contains_functions : 1; - /* Nonzero if the current function is a thunk, i.e., a lightweight function implemented by the output_mi_thunk hook) that just adjusts one of its arguments and forwards to another @@ -396,10 +412,6 @@ struct function GTY(()) can throw. */ unsigned int all_throwers_are_sibcalls : 1; - /* Nonzero if instrumentation calls for function entry and exit should be - generated. */ - unsigned int instrument_entry_exit : 1; - /* Nonzero if profiling code should be generated. */ unsigned int profile : 1; @@ -430,8 +442,22 @@ struct function GTY(()) /* Nonzero if code to initialize arg_pointer_save_area has been emitted. */ unsigned int arg_pointer_save_area_init : 1; + + /* Number of units of general registers that need saving in stdarg + function. What unit is depends on the backend, either it is number + of bytes, or it can be number of registers. */ + unsigned int va_list_gpr_size : 8; + + /* Number of units of floating point registers that need saving in stdarg + function. */ + unsigned int va_list_fpr_size : 8; }; +/* If va_list_[gf]pr_size is set to this, it means we don't know how + many units need to be saved. */ +#define VA_LIST_MAX_GPR_SIZE 255 +#define VA_LIST_MAX_FPR_SIZE 255 + /* The function currently being compiled. */ extern GTY(()) struct function *cfun; @@ -452,7 +478,6 @@ extern int trampolines_created; #define current_function_calls_setjmp (cfun->calls_setjmp) #define current_function_calls_alloca (cfun->calls_alloca) #define current_function_calls_eh_return (cfun->calls_eh_return) -#define current_function_contains_functions (cfun->contains_functions) #define current_function_is_thunk (cfun->is_thunk) #define current_function_args_info (cfun->args_info) #define current_function_args_size (cfun->args_size) @@ -462,7 +487,6 @@ extern int trampolines_created; #define current_function_stdarg (cfun->stdarg) #define current_function_internal_arg_pointer (cfun->internal_arg_pointer) #define current_function_return_rtx (cfun->return_rtx) -#define current_function_instrument_entry_exit (cfun->instrument_entry_exit) #define current_function_profile (cfun->profile) #define current_function_funcdef_no (cfun->funcdef_no) #define current_function_limit_stack (cfun->limit_stack) @@ -482,7 +506,6 @@ extern int trampolines_created; #define used_temp_slots (cfun->x_used_temp_slots) #define avail_temp_slots (cfun->x_avail_temp_slots) #define temp_slot_level (cfun->x_temp_slot_level) -#define nonlocal_labels (cfun->x_nonlocal_labels) #define nonlocal_goto_handler_labels (cfun->x_nonlocal_goto_handler_labels) /* Given a function decl for a containing function, diff --git a/gcc/gcc.c b/gcc/gcc.c index eda3fa49f53..0820bd7cac0 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -59,7 +59,7 @@ compilation is specified by a string called a "spec". */ 4. If the argument takes an argument, e.g., `--baz argument1', modify either DEFAULT_SWITCH_TAKES_ARG or - DEFAULT_WORD_SWITCH_TAKES_ARG in this file. Omit the first `-' + DEFAULT_WORD_SWITCH_TAKES_ARG in gcc.h. Omit the first `-' from `--baz'. 5. Document the option in this file's display_help(). If the @@ -86,13 +86,6 @@ compilation is specified by a string called a "spec". */ #include "gcc.h" #include "flags.h" -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif -#if defined (HAVE_DECL_GETRUSAGE) && !HAVE_DECL_GETRUSAGE -extern int getrusage (int, struct rusage *); -#endif - /* By default there is no special suffix for target executables. */ /* FIXME: when autoconf is fixed, remove the host check - dj */ #if defined(TARGET_EXECUTABLE_SUFFIX) && defined(HOST_EXECUTABLE_SUFFIX) @@ -283,12 +276,6 @@ static struct obstack obstack; static struct obstack collect_obstack; -/* These structs are used to collect resource usage information for - subprocesses. */ -#ifdef HAVE_GETRUSAGE -static struct rusage rus, prus; -#endif - /* Forward declaration for prototypes. */ struct path_prefix; struct prefix_list; @@ -341,7 +328,6 @@ static int default_arg (const char *, int); static void set_multilib_dir (void); static void print_multilib_info (void); static void perror_with_name (const char *); -static void pfatal_pexecute (const char *, const char *) ATTRIBUTE_NORETURN; static void notice (const char *, ...) ATTRIBUTE_PRINTF_1; static void display_help (void); static void add_preprocessor_option (const char *, int); @@ -473,6 +459,8 @@ or with constant text in a single argument. %l process LINK_SPEC as a spec. %L process LIB_SPEC as a spec. %G process LIBGCC_SPEC as a spec. + %R Output the concatenation of target_system_root and + target_sysroot_suffix. %S process STARTFILE_SPEC as a spec. A capital S is actually used here. %E process ENDFILE_SPEC as a spec. A capital E is actually used here. %C process CPP_SPEC as a spec. @@ -714,6 +702,10 @@ proper position among the other output files. */ # define STARTFILE_PREFIX_SPEC "" #endif +#ifndef SYSROOT_SPEC +# define SYSROOT_SPEC "--sysroot=%R" +#endif + #ifndef SYSROOT_SUFFIX_SPEC # define SYSROOT_SUFFIX_SPEC "" #endif @@ -741,6 +733,7 @@ static const char *linker_name_spec = LINKER_NAME; static const char *link_command_spec = LINK_COMMAND_SPEC; static const char *link_libgcc_spec = LINK_LIBGCC_SPEC; static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC; +static const char *sysroot_spec = SYSROOT_SPEC; static const char *sysroot_suffix_spec = SYSROOT_SUFFIX_SPEC; static const char *sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC; @@ -955,7 +948,7 @@ static const struct compiler default_compilers[] = cc1 %(cpp_unique_options) %(cc1_options)}}\ %{!fsyntax-only:%(invoke_as)}}}}}}", 0, 1, 1}, {"-", - "%{!E:%e-E required when input is from standard input}\ + "%{!E:%e-E or -x required when input is from standard input}\ %(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)", 0, 0, 0}, {".h", "@c-header", 0, 0, 0}, {"@c-header", @@ -1545,6 +1538,7 @@ static struct spec_list static_specs[] = INIT_STATIC_SPEC ("md_startfile_prefix", &md_startfile_prefix), INIT_STATIC_SPEC ("md_startfile_prefix_1", &md_startfile_prefix_1), INIT_STATIC_SPEC ("startfile_prefix_spec", &startfile_prefix_spec), + INIT_STATIC_SPEC ("sysroot_spec", &sysroot_spec), INIT_STATIC_SPEC ("sysroot_suffix_spec", &sysroot_suffix_spec), INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec), }; @@ -2653,11 +2647,11 @@ execute (void) int i; int n_commands; /* # of command. */ char *string; + struct pex_obj *pex; struct command { const char *prog; /* program name. */ const char **argv; /* vector of args. */ - int pid; /* pid of process for this command. */ }; struct command *commands; /* each command buffer with above info. */ @@ -2790,24 +2784,32 @@ execute (void) /* Run each piped subprocess. */ + pex = pex_init (PEX_USE_PIPES | (report_times ? PEX_RECORD_TIMES : 0), + programname, temp_filename); + if (pex == NULL) + pfatal_with_name (_("pex_init failed")); + for (i = 0; i < n_commands; i++) { - char *errmsg_fmt, *errmsg_arg; + const char *errmsg; + int err; const char *string = commands[i].argv[0]; - /* 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, - programname, temp_filename, - &errmsg_fmt, &errmsg_arg, - ((i == 0 ? PEXECUTE_FIRST : 0) - | (i + 1 == n_commands ? PEXECUTE_LAST : 0) - | (string == commands[i].prog - ? PEXECUTE_SEARCH : 0) - | (verbose_flag ? PEXECUTE_VERBOSE : 0))); - - if (commands[i].pid == -1) - pfatal_pexecute (errmsg_fmt, errmsg_arg); + errmsg = pex_run (pex, + ((i + 1 == n_commands ? PEX_LAST : 0) + | (string == commands[i].prog ? PEX_SEARCH : 0)), + string, (char * const *) commands[i].argv, + NULL, NULL, &err); + if (errmsg != NULL) + { + if (err == 0) + fatal (errmsg); + else + { + errno = err; + pfatal_with_name (errmsg); + } + } if (string != commands[i].prog) free ((void *) string); @@ -2815,88 +2817,76 @@ execute (void) execution_count++; - /* Wait for all the subprocesses to finish. - We don't care what order they finish in; - we know that N_COMMANDS waits will get them all. - Ignore subprocesses that we don't know about, - since they can be spawned by the process that exec'ed us. */ + /* Wait for all the subprocesses to finish. */ { + int *statuses; + struct pex_time *times = NULL; int ret_code = 0; -#ifdef HAVE_GETRUSAGE - struct timeval d; - double ut = 0.0, st = 0.0; -#endif - for (i = 0; i < n_commands;) + statuses = alloca (n_commands * sizeof (int)); + if (!pex_get_status (pex, n_commands, statuses)) + pfatal_with_name (_("failed to get exit status")); + + if (report_times) { - int j; - int status; - int pid; + times = alloca (n_commands * sizeof (struct pex_time)); + if (!pex_get_times (pex, n_commands, times)) + pfatal_with_name (_("failed to get process times")); + } - pid = pwait (commands[i].pid, &status, 0); - gcc_assert (pid >= 0); + pex_free (pex); -#ifdef HAVE_GETRUSAGE - if (report_times) - { - /* getrusage returns the total resource usage of all children - up to now. Copy the previous values into prus, get the - current statistics, then take the difference. */ - - prus = rus; - getrusage (RUSAGE_CHILDREN, &rus); - d.tv_sec = rus.ru_utime.tv_sec - prus.ru_utime.tv_sec; - d.tv_usec = rus.ru_utime.tv_usec - prus.ru_utime.tv_usec; - ut = (double) d.tv_sec + (double) d.tv_usec / 1.0e6; - - d.tv_sec = rus.ru_stime.tv_sec - prus.ru_stime.tv_sec; - d.tv_usec = rus.ru_stime.tv_usec - prus.ru_stime.tv_usec; - st = (double) d.tv_sec + (double) d.tv_usec / 1.0e6; - } -#endif + for (i = 0; i < n_commands; ++i) + { + int status = statuses[i]; - for (j = 0; j < n_commands; j++) - if (commands[j].pid == pid) - { - i++; - if (WIFSIGNALED (status)) - { + if (WIFSIGNALED (status)) + { #ifdef SIGPIPE - /* SIGPIPE is a special case. It happens in -pipe mode - when the compiler dies before the preprocessor is - done, or the assembler dies before the compiler is - done. There's generally been an error already, and - this is just fallout. So don't generate another error - unless we would otherwise have succeeded. */ - if (WTERMSIG (status) == SIGPIPE - && (signal_count || greatest_status >= MIN_FATAL_STATUS)) - ; - else + /* SIGPIPE is a special case. It happens in -pipe mode + when the compiler dies before the preprocessor is done, + or the assembler dies before the compiler is done. + There's generally been an error already, and this is + just fallout. So don't generate another error unless + we would otherwise have succeeded. */ + if (WTERMSIG (status) == SIGPIPE + && (signal_count || greatest_status >= MIN_FATAL_STATUS)) + ; + else #endif - fatal ("\ + fatal ("\ Internal error: %s (program %s)\n\ Please submit a full bug report.\n\ See %s for instructions.", - strsignal (WTERMSIG (status)), commands[j].prog, - bug_report_url); - signal_count++; - ret_code = -1; - } - else if (WIFEXITED (status) - && WEXITSTATUS (status) >= MIN_FATAL_STATUS) - { - if (WEXITSTATUS (status) > greatest_status) - greatest_status = WEXITSTATUS (status); - ret_code = -1; - } -#ifdef HAVE_GETRUSAGE - if (report_times && ut + st != 0) - notice ("# %s %.2f %.2f\n", commands[j].prog, ut, st); -#endif - break; - } + strsignal (WTERMSIG (status)), commands[i].prog, + bug_report_url); + signal_count++; + ret_code = -1; + } + else if (WIFEXITED (status) + && WEXITSTATUS (status) >= MIN_FATAL_STATUS) + { + if (WEXITSTATUS (status) > greatest_status) + greatest_status = WEXITSTATUS (status); + ret_code = -1; + } + + if (report_times) + { + struct pex_time *pt = ×[i]; + double ut, st; + + ut = ((double) pt->user_seconds + + (double) pt->user_microseconds / 1.0e6); + st = ((double) pt->system_seconds + + (double) pt->system_microseconds / 1.0e6); + + if (ut + st != 0) + notice ("# %s %.2f %.2f\n", commands[i].prog, ut, st); + } } + return ret_code; } } @@ -3773,16 +3763,11 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" } } - if ((save_temps_flag || report_times) && use_pipes) + if (save_temps_flag && use_pipes) { /* -save-temps overrides -pipe, so that temp files are produced */ if (save_temps_flag) error ("warning: -pipe ignored because -save-temps specified"); - /* -time overrides -pipe because we can't get correct stats when - multiple children are running at once. */ - else if (report_times) - error ("warning: -pipe ignored because -time specified"); - use_pipes = 0; } @@ -3956,16 +3941,12 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n" infiles[n_infiles].language = "*"; infiles[n_infiles++].name = argv[++i]; } + /* Xassembler and Xpreprocessor were already handled in the first argv + scan, so all we need to do here is ignore them and their argument. */ else if (strcmp (argv[i], "-Xassembler") == 0) - { - infiles[n_infiles].language = "*"; - infiles[n_infiles++].name = argv[++i]; - } + i++; else if (strcmp (argv[i], "-Xpreprocessor") == 0) - { - infiles[n_infiles].language = "*"; - infiles[n_infiles++].name = argv[++i]; - } + i++; else if (strcmp (argv[i], "-l") == 0) { /* POSIX allows separation of -l and the lib arg; canonicalize by concatenating -l with its arg */ @@ -4381,6 +4362,7 @@ do_spec_path (struct prefix_list *pl, const char *option, static size_t bufsize = 0; static char *buffer; int idx; + bool multilib_p = false; /* Used on systems which record the specified -L dirs and use them to search for dynamic linking. */ @@ -4403,6 +4385,7 @@ do_spec_path (struct prefix_list *pl, const char *option, strcat (buffer, machine_suffix); if (is_directory (buffer, dir_for_machine_suffix, 1)) { + multilib_p = true; do_spec_1 (option, separate_options, NULL); if (separate_options) do_spec_1 (" ", 0, NULL); @@ -4416,6 +4399,7 @@ do_spec_path (struct prefix_list *pl, const char *option, { if (is_directory (pl->prefix, dir_for_no_suffix, 1)) { + multilib_p = true; do_spec_1 (option, separate_options, NULL); if (separate_options) do_spec_1 (" ", 0, NULL); @@ -4426,7 +4410,7 @@ do_spec_path (struct prefix_list *pl, const char *option, } } - if (only_subdir) + if (only_subdir || multilib_p) return; if (machine_suffix) @@ -6014,6 +5998,9 @@ main (int argc, const char **argv) GCC_DRIVER_HOST_INITIALIZATION; #endif + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); if (signal (SIGINT, SIG_IGN) != SIG_IGN) @@ -6164,6 +6151,19 @@ main (int argc, const char **argv) target_sysroot_suffix = xstrdup (argbuf[argbuf_index -1]); } +#ifdef HAVE_LD_SYSROOT + /* Pass the --sysroot option to the linker, if it supports that. If + there is a sysroot_suffix_spec, it has already been processed by + this point, so target_system_root really is the system root we + should be using. */ + if (target_system_root) + { + obstack_grow (&obstack, "%(sysroot_spec) ", strlen ("%(sysroot_spec) ")); + obstack_grow0 (&obstack, link_spec, strlen (link_spec)); + set_spec ("link", obstack_finish (&obstack)); + } +#endif + /* Process sysroot_hdrs_suffix_spec. */ if (*sysroot_hdrs_suffix_spec != 0 && do_spec_2 (sysroot_hdrs_suffix_spec) == 0) @@ -6188,10 +6188,6 @@ main (int argc, const char **argv) startfile_prefix_spec exclusively. */ else if (*cross_compile == '0' || target_system_root) { - if (*md_exec_prefix) - add_sysrooted_prefix (&startfile_prefixes, md_exec_prefix, "GCC", - PREFIX_PRIORITY_LAST, 0, 1); - if (*md_startfile_prefix) add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix, "GCC", PREFIX_PRIORITY_LAST, 0, 1); @@ -6709,24 +6705,6 @@ perror_with_name (const char *name) error ("%s: %s", name, xstrerror (errno)); } -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 = xmalloc (strlen (errmsg_fmt) + strlen (errmsg_arg)); - sprintf (msg, errmsg_fmt, errmsg_arg); - errmsg_fmt = msg; - - errno = save_errno; - } - - pfatal_with_name (errmsg_fmt); -} - /* Output an error message and exit. */ void diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c index 859fdb73310..1081b5eb44b 100644 --- a/gcc/gcov-dump.c +++ b/gcc/gcov-dump.c @@ -1,5 +1,5 @@ /* Dump a gcov file, for debugging use. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Nathan Sidwell Gcov is free software; you can redistribute it and/or modify @@ -77,6 +77,9 @@ main (int argc ATTRIBUTE_UNUSED, char **argv) { int opt; + /* Unlock the stdio streams. */ + unlock_std_streams (); + while ((opt = getopt_long (argc, argv, "hlpv", options, NULL)) != -1) { switch (opt) diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c index 640a55a976f..fdaf93b0744 100644 --- a/gcc/gcov-io.c +++ b/gcc/gcov-io.c @@ -1,5 +1,5 @@ /* File format for coverage information - Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Bob Manson . Completely remangled by Nathan Sidwell . @@ -74,7 +74,7 @@ gcov_open (const char *name, int mode) s_flock.l_pid = getpid (); #endif - GCOV_CHECK (!gcov_var.file); + gcc_assert (!gcov_var.file); gcov_var.start = 0; gcov_var.offset = gcov_var.length = 0; gcov_var.overread = -1u; @@ -221,14 +221,14 @@ gcov_write_words (unsigned words) { gcov_unsigned_t *result; - GCOV_CHECK_WRITING (); + gcc_assert (gcov_var.mode < 0); #if IN_LIBGCOV if (gcov_var.offset >= GCOV_BLOCK_SIZE) { gcov_write_block (GCOV_BLOCK_SIZE); if (gcov_var.offset) { - GCOV_CHECK (gcov_var.offset == 1); + gcc_assert (gcov_var.offset == 1); memcpy (gcov_var.buffer, gcov_var.buffer + GCOV_BLOCK_SIZE, 4); } } @@ -323,9 +323,9 @@ gcov_write_length (gcov_position_t position) gcov_unsigned_t length; gcov_unsigned_t *buffer; - GCOV_CHECK_WRITING (); - GCOV_CHECK (position + 2 <= gcov_var.start + gcov_var.offset); - GCOV_CHECK (position >= gcov_var.start); + gcc_assert (gcov_var.mode < 0); + gcc_assert (position + 2 <= gcov_var.start + gcov_var.offset); + gcc_assert (position >= gcov_var.start); offset = position - gcov_var.start; length = gcov_var.offset - offset - 2; buffer = (gcov_unsigned_t *) &gcov_var.buffer[offset]; @@ -380,14 +380,14 @@ gcov_read_words (unsigned words) const gcov_unsigned_t *result; unsigned excess = gcov_var.length - gcov_var.offset; - GCOV_CHECK_READING (); + gcc_assert (gcov_var.mode > 0); if (excess < words) { gcov_var.start += gcov_var.offset; #if IN_LIBGCOV if (excess) { - GCOV_CHECK (excess == 1); + gcc_assert (excess == 1); memcpy (gcov_var.buffer, gcov_var.buffer + gcov_var.offset, 4); } #else @@ -396,7 +396,7 @@ gcov_read_words (unsigned words) gcov_var.offset = 0; gcov_var.length = excess; #if IN_LIBGCOV - GCOV_CHECK (!gcov_var.length || gcov_var.length == 1); + gcc_assert (!gcov_var.length || gcov_var.length == 1); excess = GCOV_BLOCK_SIZE; #else if (gcov_var.length + words > gcov_var.alloc) @@ -494,7 +494,7 @@ gcov_read_summary (struct gcov_summary *summary) GCOV_LINKAGE void gcov_sync (gcov_position_t base, gcov_unsigned_t length) { - GCOV_CHECK_READING (); + gcc_assert (gcov_var.mode > 0); base += length; if (base - gcov_var.start <= gcov_var.length) gcov_var.offset = base - gcov_var.start; @@ -513,7 +513,7 @@ gcov_sync (gcov_position_t base, gcov_unsigned_t length) GCOV_LINKAGE void gcov_seek (gcov_position_t base) { - GCOV_CHECK_WRITING (); + gcc_assert (gcov_var.mode < 0); if (gcov_var.offset) gcov_write_block (gcov_var.offset); fseek (gcov_var.file, base << 2, SEEK_SET); diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index eaa23adcb47..76c0c9f06dd 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -1,6 +1,6 @@ /* File format for coverage information Copyright (C) 1996, 1997, 1998, 2000, 2002, - 2003, 2004 Free Software Foundation, Inc. + 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Bob Manson . Completely remangled by Nathan Sidwell . @@ -214,11 +214,7 @@ typedef HOST_WIDEST_INT gcov_type; #include #endif #else /*!IN_GCOV */ -#if LONG_LONG_TYPE_SIZE > 32 -#define GCOV_TYPE_NODE intDI_type_node -#else -#define GCOV_TYPE_NODE intSI_type_node -#endif +#define GCOV_TYPE_SIZE (LONG_LONG_TYPE_SIZE > 32 ? 64 : 32) #endif #if defined (HOST_HAS_F_SETLKW) @@ -229,11 +225,15 @@ typedef HOST_WIDEST_INT gcov_type; #endif /* !IN_LIBGCOV */ -/* In gcov we want function linkage to be static. In libgcov we need - these functions to be extern, so prefix them with __gcov. In the - compiler we want it extern, so that they can be accessed from - elsewhere. */ +/* In gcov we want function linkage to be static. In the compiler we want + it extern, so that they can be accessed from elsewhere. In libgcov we + need these functions to be extern, so prefix them with __gcov. In + libgcov they must also be hidden so that the instance in the executable + is not also used in a DSO. */ #if IN_LIBGCOV + +#include "tconfig.h" + #define gcov_var __gcov_var #define gcov_open __gcov_open #define gcov_close __gcov_close @@ -253,6 +253,16 @@ typedef HOST_WIDEST_INT gcov_type; #pragma GCC poison gcov_write_string gcov_write_tag gcov_write_length #pragma GCC poison gcov_read_string gcov_sync gcov_time gcov_magic +#ifdef HAVE_GAS_HIDDEN +#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden"))) +#else +#define ATTRIBUTE_HIDDEN +#endif + +#else + +#define ATTRIBUTE_HIDDEN + #endif #ifndef GCOV_LINKAGE @@ -432,30 +442,36 @@ struct gcov_info }; /* Register a new object file module. */ -extern void __gcov_init (struct gcov_info *); +extern void __gcov_init (struct gcov_info *) ATTRIBUTE_HIDDEN; /* Called before fork, to avoid double counting. */ -extern void __gcov_flush (void); +extern void __gcov_flush (void) ATTRIBUTE_HIDDEN; /* The merge function that just sums the counters. */ -extern void __gcov_merge_add (gcov_type *, unsigned); +extern void __gcov_merge_add (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function to choose the most common value. */ -extern void __gcov_merge_single (gcov_type *, unsigned); +extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; /* The merge function to choose the most common difference between consecutive values. */ -extern void __gcov_merge_delta (gcov_type *, unsigned); +extern void __gcov_merge_delta (gcov_type *, unsigned) ATTRIBUTE_HIDDEN; + +/* The profiler functions. */ +extern void __gcov_interval_profiler (gcov_type *, gcov_type, int, unsigned); +extern void __gcov_pow2_profiler (gcov_type *, gcov_type); +extern void __gcov_one_value_profiler (gcov_type *, gcov_type); #ifndef inhibit_libc /* The wrappers around some library functions.. */ extern pid_t __gcov_fork (void); -extern int __gcov_execl (const char *, const char *, ...); -extern int __gcov_execlp (const char *, const char *, ...); -extern int __gcov_execle (const char *, const char *, ...); -extern int __gcov_execv (const char *, char *const []); -extern int __gcov_execvp (const char *, char *const []); -extern int __gcov_execve (const char *, char *const [], char *const []); +extern int __gcov_execl (const char *, const char *, ...) ATTRIBUTE_HIDDEN; +extern int __gcov_execlp (const char *, const char *, ...) ATTRIBUTE_HIDDEN; +extern int __gcov_execle (const char *, const char *, ...) ATTRIBUTE_HIDDEN; +extern int __gcov_execv (const char *, char *const []) ATTRIBUTE_HIDDEN; +extern int __gcov_execvp (const char *, char *const []) ATTRIBUTE_HIDDEN; +extern int __gcov_execve (const char *, char *const [], char *const []) + ATTRIBUTE_HIDDEN; #endif #endif /* IN_LIBGCOV */ @@ -487,7 +503,7 @@ GCOV_LINKAGE struct gcov_var size_t alloc; gcov_unsigned_t *buffer; #endif -} gcov_var; +} gcov_var ATTRIBUTE_HIDDEN; /* Functions for reading and writing gcov files. In libgcov you can open the file for reading then writing. Elsewhere you can open the @@ -499,29 +515,31 @@ GCOV_LINKAGE struct gcov_var functions for writing. Your file may become corrupted if you break these invariants. */ #if IN_LIBGCOV -GCOV_LINKAGE int gcov_open (const char */*name*/); +GCOV_LINKAGE int gcov_open (const char */*name*/) ATTRIBUTE_HIDDEN; #else GCOV_LINKAGE int gcov_open (const char */*name*/, int /*direction*/); GCOV_LINKAGE int gcov_magic (gcov_unsigned_t, gcov_unsigned_t); #endif -GCOV_LINKAGE int gcov_close (void); +GCOV_LINKAGE int gcov_close (void) ATTRIBUTE_HIDDEN; /* Available everywhere. */ static gcov_position_t gcov_position (void); static int gcov_is_error (void); -GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned (void); -GCOV_LINKAGE gcov_type gcov_read_counter (void); -GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *); +GCOV_LINKAGE gcov_unsigned_t gcov_read_unsigned (void) ATTRIBUTE_HIDDEN; +GCOV_LINKAGE gcov_type gcov_read_counter (void) ATTRIBUTE_HIDDEN; +GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN; #if IN_LIBGCOV /* Available only in libgcov */ -GCOV_LINKAGE void gcov_write_counter (gcov_type); -GCOV_LINKAGE void gcov_write_tag_length (gcov_unsigned_t, gcov_unsigned_t); +GCOV_LINKAGE void gcov_write_counter (gcov_type) ATTRIBUTE_HIDDEN; +GCOV_LINKAGE void gcov_write_tag_length (gcov_unsigned_t, gcov_unsigned_t) + ATTRIBUTE_HIDDEN; GCOV_LINKAGE void gcov_write_summary (gcov_unsigned_t /*tag*/, - const struct gcov_summary *); + const struct gcov_summary *) + ATTRIBUTE_HIDDEN; static void gcov_rewrite (void); -GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/); +GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/) ATTRIBUTE_HIDDEN; #else /* Available outside libgcov */ GCOV_LINKAGE const char *gcov_read_string (void); @@ -531,7 +549,7 @@ GCOV_LINKAGE void gcov_sync (gcov_position_t /*base*/, #if !IN_GCOV /* Available outside gcov */ -GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t); +GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t) ATTRIBUTE_HIDDEN; #endif #if !IN_GCOV && !IN_LIBGCOV @@ -546,26 +564,12 @@ GCOV_LINKAGE void gcov_write_length (gcov_position_t /*position*/); GCOV_LINKAGE time_t gcov_time (void); #endif -/* Make sure the library is used correctly. */ -#if IN_LIBGCOV -#if ENABLE_CHECKING -#define GCOV_CHECK(EXPR) (!(EXPR) ? abort (), 0 : 0) -#else -/* Include EXPR, so that unused variable warnings do not occur. */ -#define GCOV_CHECK(EXPR) ((void)(0 && (EXPR))) -#endif -#else -#define GCOV_CHECK(EXPR) gcc_assert (EXPR) -#endif -#define GCOV_CHECK_READING() GCOV_CHECK(gcov_var.mode > 0) -#define GCOV_CHECK_WRITING() GCOV_CHECK(gcov_var.mode < 0) - /* Save the current position in the gcov file. */ static inline gcov_position_t gcov_position (void) { - GCOV_CHECK_READING (); + gcc_assert (gcov_var.mode > 0); return gcov_var.start + gcov_var.offset; } @@ -583,7 +587,7 @@ gcov_is_error (void) static inline void gcov_rewrite (void) { - GCOV_CHECK_READING (); + gcc_assert (gcov_var.mode > 0); gcov_var.mode = -1; gcov_var.start = 0; gcov_var.offset = 0; diff --git a/gcc/gcov.c b/gcc/gcov.c index ee4d6b9aa80..984721a058b 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -1,7 +1,7 @@ /* Gcov.c: prepend line execution counts and branch probabilities to a source file. Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by James E. Wilson of Cygnus Support. Mangled by Bob Manson of Cygnus Support. Mangled further by Nathan Sidwell @@ -347,6 +347,9 @@ main (int argc, char **argv) { int argno; + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); argno = process_args (argc, argv); @@ -1774,7 +1777,7 @@ output_lines (FILE *gcov_file, const source_t *src) const line_t *line; /* current line info ptr. */ char string[STRING_SIZE]; /* line buffer. */ char const *retval = ""; /* status of source file reading. */ - function_t *fn = src->functions; + function_t *fn = NULL; fprintf (gcov_file, "%9s:%5d:Source:%s\n", "-", 0, src->name); fprintf (gcov_file, "%9s:%5d:Graph:%s\n", "-", 0, bbg_file_name); @@ -1803,6 +1806,9 @@ output_lines (FILE *gcov_file, const source_t *src) } } + if (flag_branches) + fn = src->functions; + for (line_num = 1, line = &src->lines[line_num]; line_num < src->num_lines; line_num++, line++) { @@ -1810,11 +1816,11 @@ output_lines (FILE *gcov_file, const source_t *src) { arc_t *arc = fn->blocks[fn->num_blocks - 1].pred; gcov_type return_count = fn->blocks[fn->num_blocks - 1].count; - + for (; arc; arc = arc->pred_next) if (arc->fake) return_count -= arc->count; - + fprintf (gcov_file, "function %s", fn->name); fprintf (gcov_file, " called %s", format_gcov (fn->blocks[0].count, 0, -1)); diff --git a/gcc/gcse.c b/gcc/gcse.c index 467a50aa706..3cd1268df02 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -522,13 +522,13 @@ static void *gmalloc (size_t) ATTRIBUTE_MALLOC; static void *gcalloc (size_t, size_t) ATTRIBUTE_MALLOC; static void *grealloc (void *, size_t); static void *gcse_alloc (unsigned long); -static void alloc_gcse_mem (rtx); +static void alloc_gcse_mem (void); static void free_gcse_mem (void); static void alloc_reg_set_mem (int); static void free_reg_set_mem (void); static void record_one_set (int, rtx); static void record_set_info (rtx, rtx, void *); -static void compute_sets (rtx); +static void compute_sets (void); static void hash_scan_insn (rtx, struct hash_table *, int); static void hash_scan_set (rtx, rtx, struct hash_table *); static void hash_scan_clobber (rtx, rtx, struct hash_table *); @@ -578,8 +578,8 @@ static void canon_list_insert (rtx, rtx, void *); static int cprop_insn (rtx, int); static int cprop (int); static void find_implicit_sets (void); -static int one_cprop_pass (int, int, int); -static bool constprop_register (rtx, rtx, rtx, int); +static int one_cprop_pass (int, bool, bool); +static bool constprop_register (rtx, rtx, rtx, bool); static struct expr *find_bypass_set (int, int); static bool reg_killed_on_edge (rtx, edge); static int bypass_block (basic_block, rtx, rtx); @@ -645,9 +645,9 @@ static void clear_modify_mem_tables (void); static void free_modify_mem_tables (void); static rtx gcse_emit_move_after (rtx, rtx, rtx); static void local_cprop_find_used_regs (rtx *, void *); -static bool do_local_cprop (rtx, rtx, int, rtx*); +static bool do_local_cprop (rtx, rtx, bool, rtx*); static bool adjust_libcall_notes (rtx, rtx, rtx, rtx*); -static void local_cprop_pass (int); +static void local_cprop_pass (bool); static bool is_too_expensive (const char *); @@ -656,7 +656,7 @@ static bool is_too_expensive (const char *); change is mode. */ int -gcse_main (rtx f, FILE *file) +gcse_main (rtx f ATTRIBUTE_UNUSED, FILE *file) { int changed, pass; /* Bytes used at start of pass. */ @@ -704,7 +704,7 @@ gcse_main (rtx f, FILE *file) information about memory sets when we build the hash tables. */ alloc_reg_set_mem (max_gcse_regno); - compute_sets (f); + compute_sets (); pass = 0; initial_bytes_used = bytes_used; @@ -724,12 +724,12 @@ gcse_main (rtx f, FILE *file) /* Each pass may create new registers, so recalculate each time. */ max_gcse_regno = max_reg_num (); - alloc_gcse_mem (f); + alloc_gcse_mem (); /* Don't allow constant propagation to modify jumps during this pass. */ timevar_push (TV_CPROP1); - changed = one_cprop_pass (pass + 1, 0, 0); + changed = one_cprop_pass (pass + 1, false, false); timevar_pop (TV_CPROP1); if (optimize_size) @@ -749,7 +749,7 @@ gcse_main (rtx f, FILE *file) } free_reg_set_mem (); alloc_reg_set_mem (max_reg_num ()); - compute_sets (f); + compute_sets (); run_jump_opt_after_gcse = 1; timevar_pop (TV_PRE); } @@ -771,7 +771,7 @@ gcse_main (rtx f, FILE *file) { timevar_push (TV_HOIST); max_gcse_regno = max_reg_num (); - alloc_gcse_mem (f); + alloc_gcse_mem (); changed |= one_code_hoisting_pass (); free_gcse_mem (); @@ -794,10 +794,10 @@ gcse_main (rtx f, FILE *file) conditional jumps. */ max_gcse_regno = max_reg_num (); - alloc_gcse_mem (f); + alloc_gcse_mem (); /* This time, go ahead and allow cprop to alter jumps. */ timevar_push (TV_CPROP2); - one_cprop_pass (pass + 1, 1, 0); + one_cprop_pass (pass + 1, true, false); timevar_pop (TV_CPROP2); free_gcse_mem (); @@ -923,32 +923,39 @@ gcse_alloc (unsigned long size) This is called at the start of each pass. */ static void -alloc_gcse_mem (rtx f) +alloc_gcse_mem (void) { int i; + basic_block bb; rtx insn; /* Find the largest UID and create a mapping from UIDs to CUIDs. CUIDs are like UIDs except they increase monotonically, have no gaps, - and only apply to real insns. */ + and only apply to real insns. + (Actually, there are gaps, for insn that are not inside a basic block. + but we should never see those anyway, so this is OK.) */ max_uid = get_max_uid (); uid_cuid = gcalloc (max_uid + 1, sizeof (int)); - for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) - { - if (INSN_P (insn)) - uid_cuid[INSN_UID (insn)] = i++; - else - uid_cuid[INSN_UID (insn)] = i; - } + i = 0; + FOR_EACH_BB (bb) + FOR_BB_INSNS (bb, insn) + { + if (INSN_P (insn)) + uid_cuid[INSN_UID (insn)] = i++; + else + uid_cuid[INSN_UID (insn)] = i; + } /* Create a table mapping cuids to insns. */ max_cuid = i; cuid_insn = gcalloc (max_cuid + 1, sizeof (rtx)); - for (insn = f, i = 0; insn; insn = NEXT_INSN (insn)) - if (INSN_P (insn)) - CUID_INSN (i++) = insn; + i = 0; + FOR_EACH_BB (bb) + FOR_BB_INSNS (bb, insn) + if (INSN_P (insn)) + CUID_INSN (i++) = insn; /* Allocate vars to track sets of regs. */ reg_set_bitmap = BITMAP_ALLOC (NULL); @@ -1141,13 +1148,15 @@ record_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED, void *data) `reg_set_table' for further documentation. */ static void -compute_sets (rtx f) +compute_sets (void) { + basic_block bb; rtx insn; - for (insn = f; insn != 0; insn = NEXT_INSN (insn)) - if (INSN_P (insn)) - note_stores (PATTERN (insn), record_set_info, insn); + FOR_EACH_BB (bb) + FOR_BB_INSNS (bb, insn) + if (INSN_P (insn)) + note_stores (PATTERN (insn), record_set_info, insn); } /* Hash table support. */ @@ -2038,9 +2047,7 @@ compute_hash_table_work (struct hash_table *table) ??? hard-reg reg_set_in_block computation could be moved to compute_sets since they currently don't change. */ - for (insn = BB_HEAD (current_bb); - insn && insn != NEXT_INSN (BB_END (current_bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (current_bb, insn) { if (! INSN_P (insn)) continue; @@ -2064,10 +2071,8 @@ compute_hash_table_work (struct hash_table *table) BB_HEAD (current_bb), table); /* The next pass builds the hash table. */ - - for (insn = BB_HEAD (current_bb), in_libcall_block = 0; - insn && insn != NEXT_INSN (BB_END (current_bb)); - insn = NEXT_INSN (insn)) + in_libcall_block = 0; + FOR_BB_INSNS (current_bb, insn) if (INSN_P (insn)) { if (find_reg_note (insn, REG_LIBCALL, NULL_RTX)) @@ -2852,7 +2857,7 @@ cprop_jump (basic_block bb, rtx setcc, rtx jump, rtx from, rtx src) } static bool -constprop_register (rtx insn, rtx from, rtx to, int alter_jumps) +constprop_register (rtx insn, rtx from, rtx to, bool alter_jumps) { rtx sset; @@ -3030,7 +3035,7 @@ local_cprop_find_used_regs (rtx *xptr, void *data) their REG_EQUAL notes need updating. */ static bool -do_local_cprop (rtx x, rtx insn, int alter_jumps, rtx *libcall_sp) +do_local_cprop (rtx x, rtx insn, bool alter_jumps, rtx *libcall_sp) { rtx newreg = NULL, newcnst = NULL; @@ -3148,9 +3153,14 @@ adjust_libcall_notes (rtx oldreg, rtx newval, rtx insn, rtx *libcall_sp) #define MAX_NESTED_LIBCALLS 9 +/* Do local const/copy propagation (i.e. within each basic block). + If ALTER_JUMPS is true, allow propagating into jump insns, which + could modify the CFG. */ + static void -local_cprop_pass (int alter_jumps) +local_cprop_pass (bool alter_jumps) { + basic_block bb; rtx insn; struct reg_use *reg_used; rtx libcall_stack[MAX_NESTED_LIBCALLS + 1], *libcall_sp; @@ -3159,51 +3169,62 @@ local_cprop_pass (int alter_jumps) cselib_init (false); libcall_sp = &libcall_stack[MAX_NESTED_LIBCALLS]; *libcall_sp = 0; - for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + FOR_EACH_BB (bb) { - if (INSN_P (insn)) + FOR_BB_INSNS (bb, insn) { - rtx note = find_reg_note (insn, REG_LIBCALL, NULL_RTX); - - if (note) - { - gcc_assert (libcall_sp != libcall_stack); - *--libcall_sp = XEXP (note, 0); - } - note = find_reg_note (insn, REG_RETVAL, NULL_RTX); - if (note) - libcall_sp++; - note = find_reg_equal_equiv_note (insn); - do + if (INSN_P (insn)) { - reg_use_count = 0; - note_uses (&PATTERN (insn), local_cprop_find_used_regs, NULL); - if (note) - local_cprop_find_used_regs (&XEXP (note, 0), NULL); + rtx note = find_reg_note (insn, REG_LIBCALL, NULL_RTX); - for (reg_used = ®_use_table[0]; reg_use_count > 0; - reg_used++, reg_use_count--) - if (do_local_cprop (reg_used->reg_rtx, insn, alter_jumps, - libcall_sp)) - { - changed = true; + if (note) + { + gcc_assert (libcall_sp != libcall_stack); + *--libcall_sp = XEXP (note, 0); + } + note = find_reg_note (insn, REG_RETVAL, NULL_RTX); + if (note) + libcall_sp++; + note = find_reg_equal_equiv_note (insn); + do + { + reg_use_count = 0; + note_uses (&PATTERN (insn), local_cprop_find_used_regs, + NULL); + if (note) + local_cprop_find_used_regs (&XEXP (note, 0), NULL); + + for (reg_used = ®_use_table[0]; reg_use_count > 0; + reg_used++, reg_use_count--) + if (do_local_cprop (reg_used->reg_rtx, insn, alter_jumps, + libcall_sp)) + { + changed = true; + break; + } + if (INSN_DELETED_P (insn)) break; - } - if (INSN_DELETED_P (insn)) - break; + } + while (reg_use_count); } - while (reg_use_count); + cselib_process_insn (insn); } - cselib_process_insn (insn); + + /* Forget everything at the end of a basic block. Make sure we are + not inside a libcall, they should never cross basic blocks. */ + cselib_clear_table (); + gcc_assert (libcall_sp == &libcall_stack[MAX_NESTED_LIBCALLS]); } + cselib_finish (); + /* Global analysis may get into infinite loops for unreachable blocks. */ if (changed && alter_jumps) { delete_unreachable_blocks (); free_reg_set_mem (); alloc_reg_set_mem (max_reg_num ()); - compute_sets (get_insns ()); + compute_sets (); } } @@ -3232,9 +3253,7 @@ cprop (int alter_jumps) start of the block]. */ reset_opr_set_tables (); - for (insn = BB_HEAD (bb); - insn != NULL && insn != NEXT_INSN (BB_END (bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (bb, insn) if (INSN_P (insn)) { changed |= cprop_insn (insn, alter_jumps); @@ -3260,7 +3279,7 @@ cprop (int alter_jumps) settle for the condition variable in the jump instruction being integral. We prefer to be able to record the value of a user variable, rather than the value of a temporary used in a condition. This could be solved by - recording the value of *every* register scaned by canonicalize_condition, + recording the value of *every* register scanned by canonicalize_condition, but this would require some code reorganization. */ rtx @@ -3358,7 +3377,7 @@ find_implicit_sets (void) perform conditional jump bypassing optimizations. */ static int -one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps) +one_cprop_pass (int pass, bool cprop_jumps, bool bypass_jumps) { int changed = 0; @@ -3396,7 +3415,7 @@ one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps) { fprintf (gcse_file, "CPROP of %s, pass %d: %d bytes needed, ", current_function_name (), pass, bytes_used); - fprintf (gcse_file, "%d local const props, %d local copy props\n\n", + fprintf (gcse_file, "%d local const props, %d local copy props, ", local_const_prop_count, local_copy_prop_count); fprintf (gcse_file, "%d global const props, %d global copy props\n\n", global_const_prop_count, global_copy_prop_count); @@ -3665,9 +3684,7 @@ bypass_conditional_jumps (void) if (!single_pred_p (bb)) { setcc = NULL_RTX; - for (insn = BB_HEAD (bb); - insn != NULL && insn != NEXT_INSN (BB_END (bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (bb, insn) if (NONJUMP_INSN_P (insn)) { if (setcc) @@ -5221,9 +5238,7 @@ compute_ld_motion_mems (void) FOR_EACH_BB (bb) { - for (insn = BB_HEAD (bb); - insn && insn != NEXT_INSN (BB_END (bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (bb, insn) { if (INSN_P (insn)) { @@ -5678,9 +5693,7 @@ compute_store_table (void) /* First compute the registers set in this block. */ regvec = last_set_in; - for (insn = BB_HEAD (bb); - insn != NEXT_INSN (BB_END (bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (bb, insn) { if (! INSN_P (insn)) continue; @@ -5703,9 +5716,7 @@ compute_store_table (void) /* Now find the stores. */ memset (already_set, 0, sizeof (int) * max_gcse_regno); regvec = already_set; - for (insn = BB_HEAD (bb); - insn != NEXT_INSN (BB_END (bb)); - insn = NEXT_INSN (insn)) + FOR_BB_INSNS (bb, insn) { if (! INSN_P (insn)) continue; @@ -6477,11 +6488,11 @@ bypass_jumps (FILE *file) information about memory sets when we build the hash tables. */ alloc_reg_set_mem (max_gcse_regno); - compute_sets (get_insns ()); + compute_sets (); max_gcse_regno = max_reg_num (); - alloc_gcse_mem (get_insns ()); - changed = one_cprop_pass (MAX_GCSE_PASSES + 2, 1, 1); + alloc_gcse_mem (); + changed = one_cprop_pass (MAX_GCSE_PASSES + 2, true, true); free_gcse_mem (); if (file) @@ -6519,7 +6530,7 @@ is_too_expensive (const char *pass) if (n_edges > 20000 + n_basic_blocks * 4) { if (warn_disabled_optimization) - warning ("%s: %d basic blocks and %d edges/basic block", + warning (0, "%s: %d basic blocks and %d edges/basic block", pass, n_basic_blocks, n_edges / n_basic_blocks); return true; @@ -6532,7 +6543,7 @@ is_too_expensive (const char *pass) * sizeof (SBITMAP_ELT_TYPE)) > MAX_GCSE_MEMORY) { if (warn_disabled_optimization) - warning ("%s: %d basic blocks and %d registers", + warning (0, "%s: %d basic blocks and %d registers", pass, n_basic_blocks, max_reg_num ()); return true; diff --git a/gcc/gen-protos.c b/gcc/gen-protos.c index b8fa31bfe1c..6cf15d9d6e7 100644 --- a/gcc/gen-protos.c +++ b/gcc/gen-protos.c @@ -1,6 +1,6 @@ /* gen-protos.c - massages a list of prototypes, for use by fixproto. Copyright (C) 1993, 1994, 1995, 1996, 1998, - 1999, 2003, 2004 Free Software Foundation, Inc. + 1999, 2003, 2004, 2005 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 @@ -139,6 +139,9 @@ main (int argc ATTRIBUTE_UNUSED, char **argv) while (i > 0 && argv[0][i-1] != '/') --i; progname = &argv[0][i]; + /* Unlock the stdio streams. */ + unlock_std_streams (); + INIT_SSTRING (&linebuf); fprintf (outf, "struct fn_decl std_protos[] = {\n"); diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index 744c951bd47..793841befcb 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -90,14 +90,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA `in_struct' (ATTR_CURR_SIMPLIFIED_P): This rtx is fully simplified for the insn code currently being processed (see optimize_attrs). `return_val' (ATTR_PERMANENT_P): This rtx is permanent and unique - (see attr_rtx). - `volatil' (ATTR_EQ_ATTR_P): During simplify_by_exploding the value of an - EQ_ATTR rtx is true if !volatil and false if volatil. */ + (see attr_rtx). */ #define ATTR_IND_SIMPLIFIED_P(RTX) (RTX_FLAG((RTX), unchanging)) #define ATTR_CURR_SIMPLIFIED_P(RTX) (RTX_FLAG((RTX), in_struct)) #define ATTR_PERMANENT_P(RTX) (RTX_FLAG((RTX), return_val)) -#define ATTR_EQ_ATTR_P(RTX) (RTX_FLAG((RTX), volatil)) #if 0 #define strcmp_check(S1, S2) ((S1) == (S2) \ @@ -184,15 +181,11 @@ struct attr_desc struct attr_value *default_val; /* Default value for this attribute. */ int lineno : 24; /* Line number. */ unsigned is_numeric : 1; /* Values of this attribute are numeric. */ - unsigned negative_ok : 1; /* Allow negative numeric values. */ - unsigned unsigned_p : 1; /* Make the output function unsigned int. */ unsigned is_const : 1; /* Attribute value constant for each run. */ unsigned is_special : 1; /* Don't call `write_attr_set'. */ unsigned static_p : 1; /* Make the output function static. */ }; -#define NULL_ATTR (struct attr_desc *) NULL - /* Structure for each DEFINE_DELAY. */ struct delay_desc @@ -735,7 +728,6 @@ attr_copy_rtx (rtx orig) ATTR_IND_SIMPLIFIED_P (copy) = ATTR_IND_SIMPLIFIED_P (orig); ATTR_CURR_SIMPLIFIED_P (copy) = ATTR_CURR_SIMPLIFIED_P (orig); ATTR_PERMANENT_P (copy) = ATTR_PERMANENT_P (orig); - ATTR_EQ_ATTR_P (copy) = ATTR_EQ_ATTR_P (orig); format_ptr = GET_RTX_FORMAT (GET_CODE (copy)); @@ -967,7 +959,7 @@ check_attr_value (rtx exp, struct attr_desc *attr) break; } - if (INTVAL (exp) < 0 && ! attr->negative_ok) + if (INTVAL (exp) < 0) { message_with_line (attr->lineno, "negative numeric value specified for attribute %s", @@ -984,8 +976,6 @@ check_attr_value (rtx exp, struct attr_desc *attr) if (attr == 0 || attr->is_numeric) { p = XSTR (exp, 0); - if (attr && attr->negative_ok && *p == '-') - p++; for (; *p; p++) if (! ISDIGIT (*p)) { @@ -1088,8 +1078,7 @@ check_attr_value (rtx exp, struct attr_desc *attr) have_error = 1; } else if (attr - && (attr->is_numeric != attr2->is_numeric - || (! attr->negative_ok && attr2->negative_ok))) + && attr->is_numeric != attr2->is_numeric) { message_with_line (attr->lineno, "numeric attribute mismatch calling `%s' from `%s'", @@ -3716,8 +3705,6 @@ write_attr_get (struct attr_desc *attr) printf ("static "); if (!attr->is_numeric) printf ("enum attr_%s\n", attr->name); - else if (attr->unsigned_p) - printf ("unsigned int\n"); else printf ("int\n"); @@ -3965,8 +3952,6 @@ write_expr_attr_cache (rtx p, struct attr_desc *attr) if (!attr->is_numeric) printf (" enum attr_%s ", attr->name); - else if (attr->unsigned_p) - printf (" unsigned int "); else printf (" int "); @@ -4278,8 +4263,8 @@ find_attr (const char **name_p, int create) attr = oballoc (sizeof (struct attr_desc)); attr->name = DEF_ATTR_STRING (name); attr->first_value = attr->default_val = NULL; - attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0; - attr->unsigned_p = attr->static_p = 0; + attr->is_numeric = attr->is_const = attr->is_special = 0; + attr->static_p = 0; attr->next = attrs[index]; attrs[index] = attr; @@ -4301,8 +4286,6 @@ make_internal_attr (const char *name, rtx value, int special) attr->is_numeric = 1; attr->is_const = 0; attr->is_special = (special & ATTR_SPECIAL) != 0; - attr->negative_ok = (special & ATTR_NEGATIVE_OK) != 0; - attr->unsigned_p = (special & ATTR_UNSIGNED) != 0; attr->static_p = (special & ATTR_STATIC) != 0; attr->default_val = get_attr_value (value, attr, -2); } diff --git a/gcc/genattrtab.h b/gcc/genattrtab.h index 1af43c0a191..1ba321a2a5e 100644 --- a/gcc/genattrtab.h +++ b/gcc/genattrtab.h @@ -1,5 +1,5 @@ /* External definitions of source files of genattrtab. - Copyright (C) 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -51,8 +51,4 @@ extern void write_automata (void); /* Flags for make_internal_attr's `special' parameter. */ #define ATTR_NONE 0 #define ATTR_SPECIAL (1 << 0) -#define ATTR_NEGATIVE_OK (1 << 1) -#define ATTR_UNSIGNED (1 << 2) -#define ATTR_FUNC_UNITS (1 << 3) -#define ATTR_BLOCKAGE (1 << 4) -#define ATTR_STATIC (1 << 5) +#define ATTR_STATIC (1 << 1) diff --git a/gcc/genautomata.c b/gcc/genautomata.c index e54cbbdaece..51e2f416a3a 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -2724,7 +2724,7 @@ add_presence_absence (unit_set_el_t dest_list, } else warning - ("unit `%s' excludes and requires presence of `%s'", + (0, "unit `%s' excludes and requires presence of `%s'", dst->unit_decl->name, unit->name); } } @@ -2744,7 +2744,7 @@ add_presence_absence (unit_set_el_t dest_list, } else warning - ("unit `%s' requires absence and presence of `%s'", + (0, "unit `%s' requires absence and presence of `%s'", dst->unit_decl->name, unit->name); } if (no_error_flag) @@ -2826,7 +2826,7 @@ process_decls (void) error ("repeated declaration of automaton `%s'", DECL_AUTOMATON (decl)->name); else - warning ("repeated declaration of automaton `%s'", + warning (0, "repeated declaration of automaton `%s'", DECL_AUTOMATON (decl)->name); } } @@ -2946,7 +2946,7 @@ process_decls (void) DECL_BYPASS (decl)->in_insn_name); else warning - ("the same bypass `%s - %s' is already defined", + (0, "the same bypass `%s - %s' is already defined", DECL_BYPASS (decl)->out_insn_name, DECL_BYPASS (decl)->in_insn_name); } @@ -3056,7 +3056,7 @@ check_automaton_usage (void) if (!w_flag) error ("automaton `%s' is not used", DECL_AUTOMATON (decl)->name); else - warning ("automaton `%s' is not used", + warning (0, "automaton `%s' is not used", DECL_AUTOMATON (decl)->name); } } @@ -3170,14 +3170,14 @@ check_usage (void) if (!w_flag) error ("unit `%s' is not used", DECL_UNIT (decl)->name); else - warning ("unit `%s' is not used", DECL_UNIT (decl)->name); + warning (0, "unit `%s' is not used", DECL_UNIT (decl)->name); } else if (decl->mode == dm_reserv && !DECL_RESERV (decl)->reserv_is_used) { if (!w_flag) error ("reservation `%s' is not used", DECL_RESERV (decl)->name); else - warning ("reservation `%s' is not used", DECL_RESERV (decl)->name); + warning (0, "reservation `%s' is not used", DECL_RESERV (decl)->name); } } } @@ -6120,15 +6120,19 @@ copy_equiv_class (vla_ptr_t *to, const vla_ptr_t *from) static int first_cycle_unit_presence (state_t state, int unit_num) { - int presence_p; + alt_state_t alt_state; if (state->component_states == NULL) - presence_p = test_unit_reserv (state->reservs, 0, unit_num); + return test_unit_reserv (state->reservs, 0, unit_num); else - presence_p - = test_unit_reserv (state->component_states->state->reservs, - 0, unit_num); - return presence_p; + { + for (alt_state = state->component_states; + alt_state != NULL; + alt_state = alt_state->next_sorted_alt_state) + if (test_unit_reserv (alt_state->state->reservs, 0, unit_num)) + return true; + } + return false; } /* The function returns nonzero value if STATE is not equivalent to @@ -9814,7 +9818,7 @@ check_automata_insn_issues (void) reserv_ainsn->insn_reserv_decl->name); else warning - ("Automaton `%s': Insn `%s' will never be issued", + (0, "Automaton `%s': Insn `%s' will never be issued", automaton->corresponding_automaton_decl->name, reserv_ainsn->insn_reserv_decl->name); } @@ -9824,7 +9828,7 @@ check_automata_insn_issues (void) error ("Insn `%s' will never be issued", reserv_ainsn->insn_reserv_decl->name); else - warning ("Insn `%s' will never be issued", + warning (0, "Insn `%s' will never be issued", reserv_ainsn->insn_reserv_decl->name); } } diff --git a/gcc/genchecksum.c b/gcc/genchecksum.c new file mode 100644 index 00000000000..465a4f6032b --- /dev/null +++ b/gcc/genchecksum.c @@ -0,0 +1,77 @@ +/* Generate checksums of executables for PCH validation + Copyright (C) 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 "bconfig.h" +#include "system.h" +#include "md5.h" + +static void +usage (void) +{ + fputs ("Usage: genchecksums \n", stderr); +} + +static void +dosum (const char *file) +{ + FILE *f; + unsigned char result[16]; + int i; + + f = fopen (file, "rb"); + if (!f) + { + fprintf (stderr, "opening %s: %s\n", file, xstrerror (errno)); + exit (1); + } + + /* Some executable formats have timestamps in the first 16 bytes, yuck. */ + if (fseek (f, 16, SEEK_SET) != 0) + { + fprintf (stderr, "seeking in %s: %s\n", file, xstrerror (errno)); + exit (1); + } + + if (md5_stream (f, result) != 0 + || fclose (f) != 0) + { + fprintf (stderr, "reading %s: %s\n", file, xstrerror (errno)); + exit (1); + } + + fputs ("const unsigned char executable_checksum[16] = { ", stdout); + for (i = 0; i < 16; i++) + printf ("%#02x%s", result[i], i == 15 ? " };\n" : ", "); +} + +int +main (int argc, char ** argv) +{ + if (argc != 2) + { + usage (); + return 1; + } + + dosum (argv[1]); + + return 0; +} diff --git a/gcc/genextract.c b/gcc/genextract.c index b6006052403..20100160a63 100644 --- a/gcc/genextract.c +++ b/gcc/genextract.c @@ -1,5 +1,6 @@ /* Generate code from machine description to extract operands from insn as rtl. - Copyright (C) 1987, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2003, 2004 + Copyright (C) 1987, 1991, 1992, 1993, 1997, 1998, 1999, 2000, 2003, + 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -475,9 +476,9 @@ from the machine description file `md'. */\n\n"); printf (" break;\n\n"); } - /* This should never be reached. Note that we would also reach this abort - if we tried to extract something whose INSN_CODE was a DEFINE_EXPAND or - DEFINE_SPLIT, but that is correct. */ + /* This should never be reached. Note that we would also reach here + if we tried to extract something whose INSN_CODE was a + DEFINE_EXPAND or DEFINE_SPLIT, but that is correct. */ printf (" default:\n gcc_unreachable ();\n"); printf (" }\n}\n"); diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l index 096af89a8e3..f844a5eef10 100644 --- a/gcc/gengtype-lex.l +++ b/gcc/gengtype-lex.l @@ -33,8 +33,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define YY_INPUT(BUF,RESULT,SIZE) ((RESULT) = macro_input (BUF,SIZE)) static unsigned macro_input (char *buffer, unsigned); -static void push_macro_expansion (const char *, unsigned, - const char *, unsigned); +static const char *push_macro_expansion (const char *, unsigned, + const char *, unsigned); +static char *mangle_macro_name (const char *, unsigned, + const char *, unsigned); static void update_lineno (const char *l, size_t len); struct fileloc lexer_line; @@ -237,33 +239,40 @@ ITYPE {IWORD}({WS}{IWORD})* return ENT_YACCUNION; } -^"DEF_VEC_"[[:alnum:]_]*{WS}?"("{WS}?{ID}{WS}?")" { +^"DEF_VEC_"[[:alnum:]_]*{WS}?"("{WS}?{ID}{WS}?(","{WS}?{ID}{WS}?)*")" { char *macro, *arg; unsigned macro_len, arg_len; char *ptr = yytext; + const char *additional; type_p t; - /* Locate the macro and argument strings. */ - macro = ptr; - while (*ptr != '(' && !ISSPACE (*ptr)) - ptr++; - macro_len = ptr - macro; - while (*ptr == '(' || ISSPACE (*ptr)) - ptr++; - arg = ptr; - while (*ptr != ')' && !ISSPACE (*ptr)) - ptr++; - arg_len = ptr - arg; + /* Find the macro name. */ + for (macro = ptr; *ptr != '(' && !ISSPACE (*ptr); ptr++) + continue; + for (macro_len = ptr - macro; !(ISALNUM (*ptr) || *ptr == '_'); ptr++) + continue; - /* Push the macro for later expansion. */ - push_macro_expansion (macro, macro_len, arg, arg_len); + /* Find the argument(s). */ + for (arg = ptr; *ptr != ')'; ptr++) + continue; + arg_len = ptr - arg; /* Create the struct and typedef. */ - ptr = (char *) xmemdup ("VEC_", 4, 4 + arg_len + 1); - memcpy (&ptr[4], arg, arg_len); - ptr[4 + arg_len] = 0; + ptr = mangle_macro_name ("VEC", 3, arg, arg_len); + t = find_structure (ptr, 0); do_typedef (ptr, t, &lexer_line); + + /* Push the macro for later expansion. */ + additional = push_macro_expansion (macro, macro_len, arg, arg_len); + + if (additional) + { + ptr = mangle_macro_name (ptr, strlen (ptr), + additional, strlen (additional)); + t = find_structure (ptr, 0); + do_typedef (ptr, t, &lexer_line); + } } { @@ -299,24 +308,23 @@ ITYPE {IWORD}({WS}{IWORD})* return SCALAR; } -"VEC"{WS}?"("{WS}?{ID}{WS}?")" { +"VEC"{WS}?"("{WS}?{ID}{WS}?(","{WS}?{ID}{WS}?)*")" { char *macro, *arg; unsigned macro_len, arg_len; char *ptr = yytext; - macro = ptr; - while (*ptr != '(' && !ISSPACE (*ptr)) /* )*/ - ptr++; - macro_len = ptr - macro; - while (*ptr == '(' || ISSPACE (*ptr)) - ptr++; - arg = ptr; - while (*ptr != ')' && !ISSPACE (*ptr)) - ptr++; + /* Find the macro name */ + for (macro = ptr; *ptr != '(' && !ISSPACE (*ptr); ptr++) + continue; + for (macro_len = ptr - macro; !(ISALNUM(*ptr) || *ptr == '_'); ptr++) + continue; + + /* Find the arguments. */ + for (arg = ptr; *ptr != ')'; ptr++) + continue; arg_len = ptr - arg; - ptr = (char *) xmemdup (macro, macro_len, macro_len + arg_len + 2); - ptr[macro_len] = '_'; - memcpy (&ptr[macro_len+1], arg, arg_len); + + ptr = mangle_macro_name (macro, macro_len, arg, arg_len); yylval.s = ptr; return ID; } @@ -411,14 +419,43 @@ ITYPE {IWORD}({WS}{IWORD})* /* Deal with the expansion caused by the DEF_VEC_x macros. */ -typedef struct macro +/* Mangle a macro and argument list as done by cpp concatenation in + the compiler proper. */ +static char * +mangle_macro_name (const char *macro, unsigned macro_len, + const char *arg, unsigned arg_len) +{ + char *ptr = (char *) xmemdup (macro, macro_len, macro_len + arg_len + 2); + + /* Now copy and concatenate each argument */ + while (arg_len) + { + ptr[macro_len++] = '_'; + for (; arg_len && (ISALNUM(*arg) || *arg == '_'); arg_len--) + ptr[macro_len++] = *arg++; + for (; arg_len && !(ISALNUM(*arg) || *arg == '_'); arg_len--) + arg++; + } + ptr[macro_len] = 0; + + return ptr; +} + +typedef struct macro_def { const char *name; const char *expansion; + const char *additional; +} macro_def_t; + +typedef struct macro +{ + const macro_def_t *def; struct macro *next; + const char *args[10]; } macro_t; -static const macro_t macro_defs[] = +static const macro_def_t macro_defs[] = { #define IN_GENGTYPE 1 #include "vec.h" @@ -427,11 +464,12 @@ static const macro_t macro_defs[] = /* Chain of macro expansions to do at end of scanning. */ static macro_t *macro_expns; +static macro_t *macro_expns_end; /* Push macro NAME (NAME_LEN) with argument ARG (ARG_LEN) onto the expansion queue. We ensure NAME is known at this point. */ -static void +static const char * push_macro_expansion (const char *name, unsigned name_len, const char *arg, unsigned arg_len) { @@ -442,15 +480,51 @@ push_macro_expansion (const char *name, unsigned name_len, && !memcmp (name, macro_defs[ix].name, name_len)) { macro_t *expansion = XNEW (macro_t); - - expansion->next = macro_expns; - expansion->name = (char *) xmemdup (arg, arg_len, arg_len+1); - expansion->expansion = macro_defs[ix].expansion; - macro_expns = expansion; - return; + char *args; + unsigned argno, last_arg; + + expansion->def = ¯o_defs[ix]; + expansion->next = NULL; + args = (char *) xmemdup (arg, arg_len, arg_len+1); + args[arg_len] = 0; + for (argno = 0; *args;) + { + expansion->args[argno++] = args; + while (*args && (ISALNUM (*args) || *args == '_')) + args++; + if (argno == 1) + expansion->args[argno++] = "base"; + if (!*args) + break; + *args++ = 0; + while (*args && !(ISALNUM (*args) || *args == '_')) + args++; + } + last_arg = argno; + for (; argno != 10; argno++) + expansion->args[argno] = NULL; + if (macro_expns_end) + macro_expns_end->next = expansion; + else + macro_expns = expansion; + macro_expns_end = expansion; + if (macro_defs[ix].additional) + { + macro_t *expn2 = XNEW (macro_t); + memcpy (expn2, expansion, sizeof (*expn2)); + expansion = expn2; + expansion->def += 1; + expansion->args[last_arg++] = macro_defs[ix].additional; + macro_expns_end->next = expansion; + macro_expns_end = expansion; + } + if (last_arg > 2 && strcmp (expansion->args[last_arg - 1], "heap")) + expansion->args[last_arg++] = "GTY (())"; + return macro_defs[ix].additional; } error_at_line (&lexer_line, "unrecognized macro `%.*s(%.*s)'", name_len, name, arg_len, arg); + return NULL; } /* Attempt to read some input. Use fread until we're at the end of @@ -472,15 +546,30 @@ macro_input (char *buffer, unsigned size) const char *expn; unsigned len; - for (expn = macro_expns->expansion; *expn; expn++) + for (expn = macro_expns->def->expansion; *expn; expn++) { if (*expn == '#') { + int argno; + + argno = expn[1] - '0'; + expn += 1; + + /* Remove inserted space? */ if (buffer[result-1] == ' ' && buffer[result-2] == '_') result--; - len = strlen (macro_expns->name); - memcpy (&buffer[result], macro_expns->name, len); - result += len; + + /* Insert the argument value */ + if (macro_expns->args[argno]) + { + len = strlen (macro_expns->args[argno]); + memcpy (&buffer[result], macro_expns->args[argno], len); + result += len; + } + + /* Skip next space? */ + if (expn[1] == ' ' && expn[2] == '_') + expn++; } else { @@ -492,6 +581,8 @@ macro_input (char *buffer, unsigned size) if (result > size) YY_FATAL_ERROR ("buffer too small to expand macro"); macro_expns = macro_expns->next; + if (!macro_expns) + macro_expns_end = NULL; } return result; } diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 0ff0c116e62..519ff7258d2 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -1088,7 +1088,7 @@ open_base_files (void) "hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h", "optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h", "tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h", - NULL + "except.h", NULL }; const char *const *ifp; outf_p gtype_desc_c; @@ -1238,6 +1238,15 @@ 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"; + 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"; 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"; @@ -1976,6 +1985,25 @@ write_types_process_field (type_p f, const struct walk_type_data *d) } } +/* A subroutine of write_func_for_structure. Write the enum tag for S. */ + +static void +output_type_enum (outf_p of, type_p s) +{ + if (s->kind == TYPE_PARAM_STRUCT && s->u.s.line.file != NULL) + { + oprintf (of, ", gt_e_"); + output_mangled_typename (of, s); + } + else if (UNION_OR_STRUCT_P (s) && s->u.s.line.file != NULL) + { + oprintf (of, ", gt_ggc_e_"); + output_mangled_typename (of, s); + } + else + oprintf (of, ", gt_types_enum_last"); +} + /* For S, a structure that's part of ORIG_S, and using parameters PARAM, write out a routine that: - Takes a parameter, a void * but actually of type *S @@ -2050,21 +2078,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param, { oprintf (d.of, ", x, gt_%s_", wtd->param_prefix); output_mangled_typename (d.of, orig_s); - - if (orig_s->u.p->kind == TYPE_PARAM_STRUCT - && orig_s->u.p->u.s.line.file != NULL) - { - oprintf (d.of, ", gt_e_"); - output_mangled_typename (d.of, orig_s); - } - else if (UNION_OR_STRUCT_P (orig_s) - && orig_s->u.s.line.file != NULL) - { - oprintf (d.of, ", gt_ggc_e_"); - output_mangled_typename (d.of, orig_s); - } - else - oprintf (d.of, ", gt_types_enum_last"); + output_type_enum (d.of, orig_s); } oprintf (d.of, "))\n"); } @@ -2075,21 +2089,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param, { oprintf (d.of, ", xlimit, gt_%s_", wtd->param_prefix); output_mangled_typename (d.of, orig_s); - - if (orig_s->u.p->kind == TYPE_PARAM_STRUCT - && orig_s->u.p->u.s.line.file != NULL) - { - oprintf (d.of, ", gt_e_"); - output_mangled_typename (d.of, orig_s); - } - else if (UNION_OR_STRUCT_P (orig_s) - && orig_s->u.s.line.file != NULL) - { - oprintf (d.of, ", gt_ggc_e_"); - output_mangled_typename (d.of, orig_s); - } - else - oprintf (d.of, ", gt_types_enum_last"); + output_type_enum (d.of, orig_s); } oprintf (d.of, "))\n"); oprintf (d.of, " xlimit = ("); @@ -2115,21 +2115,7 @@ write_func_for_structure (type_p orig_s, type_p s, type_p *param, { oprintf (d.of, ", xprev, gt_%s_", wtd->param_prefix); output_mangled_typename (d.of, orig_s); - - if (orig_s->u.p->kind == TYPE_PARAM_STRUCT - && orig_s->u.p->u.s.line.file != NULL) - { - oprintf (d.of, ", gt_e_"); - output_mangled_typename (d.of, orig_s); - } - else if (UNION_OR_STRUCT_P (orig_s) - && orig_s->u.s.line.file != NULL) - { - oprintf (d.of, ", gt_ggc_e_"); - output_mangled_typename (d.of, orig_s); - } - else - oprintf (d.of, ", gt_types_enum_last"); + output_type_enum (d.of, orig_s); } oprintf (d.of, ");\n"); oprintf (d.of, " }\n"); diff --git a/gcc/genopinit.c b/gcc/genopinit.c index e52ca068984..d58f8811812 100644 --- a/gcc/genopinit.c +++ b/gcc/genopinit.c @@ -119,11 +119,14 @@ static const char * const optabs[] = "copysign_optab->handlers[$A].insn_code = CODE_FOR_$(copysign$F$a3$)", "sqrt_optab->handlers[$A].insn_code = CODE_FOR_$(sqrt$a2$)", "floor_optab->handlers[$A].insn_code = CODE_FOR_$(floor$a2$)", + "lfloor_optab->handlers[$A].insn_code = CODE_FOR_$(lfloor$a2$)", "ceil_optab->handlers[$A].insn_code = CODE_FOR_$(ceil$a2$)", + "lceil_optab->handlers[$A].insn_code = CODE_FOR_$(lceil$a2$)", "round_optab->handlers[$A].insn_code = CODE_FOR_$(round$a2$)", "btrunc_optab->handlers[$A].insn_code = CODE_FOR_$(btrunc$a2$)", "nearbyint_optab->handlers[$A].insn_code = CODE_FOR_$(nearbyint$a2$)", "rint_optab->handlers[$A].insn_code = CODE_FOR_$(rint$a2$)", + "lrint_optab->handlers[$A].insn_code = CODE_FOR_$(lrint$a2$)", "sincos_optab->handlers[$A].insn_code = CODE_FOR_$(sincos$a3$)", "sin_optab->handlers[$A].insn_code = CODE_FOR_$(sin$a2$)", "asin_optab->handlers[$A].insn_code = CODE_FOR_$(asin$a2$)", @@ -168,12 +171,35 @@ static const char * const optabs[] = "clrmem_optab[$A] = CODE_FOR_$(clrmem$a$)", "cmpstr_optab[$A] = CODE_FOR_$(cmpstr$a$)", "cmpmem_optab[$A] = CODE_FOR_$(cmpmem$a$)", + "sync_add_optab[$A] = CODE_FOR_$(sync_add$I$a$)", + "sync_sub_optab[$A] = CODE_FOR_$(sync_sub$I$a$)", + "sync_ior_optab[$A] = CODE_FOR_$(sync_ior$I$a$)", + "sync_and_optab[$A] = CODE_FOR_$(sync_and$I$a$)", + "sync_xor_optab[$A] = CODE_FOR_$(sync_xor$I$a$)", + "sync_nand_optab[$A] = CODE_FOR_$(sync_nand$I$a$)", + "sync_old_add_optab[$A] = CODE_FOR_$(sync_old_add$I$a$)", + "sync_old_sub_optab[$A] = CODE_FOR_$(sync_old_sub$I$a$)", + "sync_old_ior_optab[$A] = CODE_FOR_$(sync_old_ior$I$a$)", + "sync_old_and_optab[$A] = CODE_FOR_$(sync_old_and$I$a$)", + "sync_old_xor_optab[$A] = CODE_FOR_$(sync_old_xor$I$a$)", + "sync_old_nand_optab[$A] = CODE_FOR_$(sync_old_nand$I$a$)", + "sync_new_add_optab[$A] = CODE_FOR_$(sync_new_add$I$a$)", + "sync_new_sub_optab[$A] = CODE_FOR_$(sync_new_sub$I$a$)", + "sync_new_ior_optab[$A] = CODE_FOR_$(sync_new_ior$I$a$)", + "sync_new_and_optab[$A] = CODE_FOR_$(sync_new_and$I$a$)", + "sync_new_xor_optab[$A] = CODE_FOR_$(sync_new_xor$I$a$)", + "sync_new_nand_optab[$A] = CODE_FOR_$(sync_new_nand$I$a$)", + "sync_compare_and_swap[$A] = CODE_FOR_$(sync_compare_and_swap$I$a$)", + "sync_compare_and_swap_cc[$A] = CODE_FOR_$(sync_compare_and_swap_cc$I$a$)", + "sync_lock_test_and_set[$A] = CODE_FOR_$(sync_lock_test_and_set$I$a$)", + "sync_lock_release[$A] = CODE_FOR_$(sync_lock_release$I$a$)", "vec_set_optab->handlers[$A].insn_code = CODE_FOR_$(vec_set$a$)", "vec_extract_optab->handlers[$A].insn_code = CODE_FOR_$(vec_extract$a$)", "vec_init_optab->handlers[$A].insn_code = CODE_FOR_$(vec_init$a$)", "vec_realign_load_optab->handlers[$A].insn_code = CODE_FOR_$(vec_realign_load_$a$)", "vcond_gen_code[$A] = CODE_FOR_$(vcond$a$)", - "vcondu_gen_code[$A] = CODE_FOR_$(vcondu$a$)" }; + "vcondu_gen_code[$A] = CODE_FOR_$(vcondu$a$)" +}; static void gen_insn (rtx); diff --git a/gcc/gensupport.c b/gcc/gensupport.c index dbf0aab6922..d6034ef2ad8 100644 --- a/gcc/gensupport.c +++ b/gcc/gensupport.c @@ -906,6 +906,9 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *)) char *lastsl; rtx desc; + /* Unlock the stdio streams. */ + unlock_std_streams (); + for (i = 1; i < argc; i++) { if (argv[i][0] != '-') diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index c97b84eff03..15f22c9f7f4 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -1203,6 +1203,9 @@ ggc_alloc_stat (size_t size MEM_STAT_DECL) information is used in deciding when to collect. */ G.allocated += object_size; + /* For timevar statistics. */ + timevar_ggc_mem_total += object_size; + #ifdef GATHER_STATISTICS { size_t overhead = object_size - size; diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c index 8cc94e0b9e4..e3c72679d51 100644 --- a/gcc/ggc-zone.c +++ b/gcc/ggc-zone.c @@ -1228,6 +1228,8 @@ ggc_alloc_zone_stat (size_t orig_size, struct alloc_zone *zone /* Keep track of how many bytes are being allocated. This information is used in deciding when to collect. */ zone->allocated += size; + + timevar_ggc_mem_total += (size + CHUNK_OVERHEAD); #ifdef GATHER_STATISTICS ggc_record_overhead (orig_size, size - orig_size, result PASS_MEM_STAT); @@ -1274,16 +1276,16 @@ ggc_alloc_typed_stat (enum gt_types_enum gte, size_t size switch (gte) { case gt_ggc_e_14lang_tree_node: - return ggc_alloc_zone_stat (size, &tree_zone PASS_MEM_STAT); + return ggc_alloc_zone_pass_stat (size, &tree_zone); case gt_ggc_e_7rtx_def: - return ggc_alloc_zone_stat (size, &rtl_zone PASS_MEM_STAT); + return ggc_alloc_zone_pass_stat (size, &rtl_zone); case gt_ggc_e_9rtvec_def: - return ggc_alloc_zone_stat (size, &rtl_zone PASS_MEM_STAT); + return ggc_alloc_zone_pass_stat (size, &rtl_zone); default: - return ggc_alloc_zone_stat (size, &main_zone PASS_MEM_STAT); + return ggc_alloc_zone_pass_stat (size, &main_zone); } } @@ -1292,7 +1294,7 @@ ggc_alloc_typed_stat (enum gt_types_enum gte, size_t size void * ggc_alloc_stat (size_t size MEM_STAT_DECL) { - return ggc_alloc_zone_stat (size, &main_zone PASS_MEM_STAT); + return ggc_alloc_zone_pass_stat (size, &main_zone); } /* Poison the chunk. */ diff --git a/gcc/ggc.h b/gcc/ggc.h index f6fad495b15..57107ffdfc1 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -313,15 +313,11 @@ extern struct alloc_zone tree_id_zone; /* Allocate an object into the specified allocation zone. */ extern void *ggc_alloc_zone_stat (size_t, struct alloc_zone * MEM_STAT_DECL); # define ggc_alloc_zone(s,z) ggc_alloc_zone_stat (s,z MEM_STAT_INFO) - +# define ggc_alloc_zone_pass_stat(s,z) ggc_alloc_zone_stat (s,z PASS_MEM_STAT) #else # define ggc_alloc_zone(s, z) ggc_alloc (s) -# ifdef GATHER_STATISTICS -# define ggc_alloc_zone_stat(s, z, n, l, f) ggc_alloc_stat (s, n, l, f) -# else -# define ggc_alloc_zone_stat(s, z) ggc_alloc_stat (s) -# endif +# define ggc_alloc_zone_pass_stat(s, z) ggc_alloc_stat (s PASS_MEM_STAT) #endif diff --git a/gcc/gimplify.c b/gcc/gimplify.c index f16ff201694..1b91b186d6e 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -606,7 +606,7 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data) || TREE_CODE_CLASS (code) == tcc_constant || code == SAVE_EXPR || code == TARGET_EXPR /* We can't do anything sensible with a BLOCK used as an expression, - but we also can't abort when we see it because of non-expression + but we also can't just die when we see it because of non-expression uses. So just avert our eyes and cross our fingers. Silly Java. */ || code == BLOCK) *walk_subtrees = 0; @@ -930,7 +930,7 @@ gimplify_return_expr (tree stmt, tree *pre_p) returned in registers. If we're returning values in registers, then we don't want to extend the lifetime of the RESULT_DECL, particularly across another call. In addition, for those aggregates for which - hard_function_value generates a PARALLEL, we'll abort during normal + hard_function_value generates a PARALLEL, we'll die during normal expansion of structure assignments; there's special code in expand_return to handle this case that does not exist in expand_expr. */ if (!result_decl @@ -1421,16 +1421,13 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, tree *post_p, fallback_t fallback) { tree *p; - varray_type stack; + VEC(tree,heap) *stack; enum gimplify_status ret = GS_OK, tret; int i; /* Create a stack of the subexpressions so later we can walk them in - order from inner to outer. - - This array is very memory consuming. Don't even think of making - it VARRAY_TREE. */ - VARRAY_GENERIC_PTR_NOGC_INIT (stack, 10, "stack"); + order from inner to outer. */ + stack = VEC_alloc (tree, heap, 10); /* We can handle anything that get_inner_reference can deal with. */ for (p = expr_p; ; p = &TREE_OPERAND (*p, 0)) @@ -1440,10 +1437,10 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, *p = fold_indirect_ref (*p); if (!handled_component_p (*p)) break; - VARRAY_PUSH_GENERIC_PTR_NOGC (stack, *p); + VEC_safe_push (tree, heap, stack, *p); } - gcc_assert (VARRAY_ACTIVE_SIZE (stack)); + gcc_assert (VEC_length (tree, stack)); /* Now STACK is a stack of pointers to all the refs we've walked through and P points to the innermost expression. @@ -1457,9 +1454,9 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, So we do this in three steps. First we deal with the annotations for any variables in the components, then we gimplify the base, then we gimplify any indices, from left to right. */ - for (i = VARRAY_ACTIVE_SIZE (stack) - 1; i >= 0; i--) + for (i = VEC_length (tree, stack) - 1; i >= 0; i--) { - tree t = VARRAY_GENERIC_PTR_NOGC (stack, i); + tree t = VEC_index (tree, stack, i); if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF) { @@ -1527,9 +1524,9 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, /* And finally, the indices and operands to BIT_FIELD_REF. During this loop we also remove any useless conversions. */ - for (; VARRAY_ACTIVE_SIZE (stack) > 0; ) + for (; VEC_length (tree, stack) > 0; ) { - tree t = VARRAY_TOP_TREE (stack); + tree t = VEC_pop (tree, stack); if (TREE_CODE (t) == ARRAY_REF || TREE_CODE (t) == ARRAY_RANGE_REF) { @@ -1565,7 +1562,6 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, set which would have caused all the outer expressions in EXPR_P leading to P to also have had TREE_SIDE_EFFECTS set. */ recalculate_side_effects (t); - VARRAY_POP (stack); } tret = gimplify_expr (p, pre_p, post_p, is_gimple_min_lval, fallback); @@ -1578,7 +1574,7 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, ret = MIN (ret, GS_OK); } - VARRAY_FREE (stack); + VEC_free (tree, heap, stack); return ret; } @@ -1744,7 +1740,9 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value) decl = get_callee_fndecl (*expr_p); if (decl && DECL_BUILT_IN (decl)) { - tree new = fold_builtin (*expr_p, !want_value); + tree fndecl = get_callee_fndecl (*expr_p); + tree arglist = TREE_OPERAND (*expr_p, 1); + tree new = fold_builtin (fndecl, arglist, !want_value); if (new && new != *expr_p) { @@ -1758,8 +1756,6 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value) if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START) { - tree arglist = TREE_OPERAND (*expr_p, 1); - if (!arglist || !TREE_CHAIN (arglist)) { error ("too few arguments to function %"); @@ -1802,7 +1798,9 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value) /* Try this again in case gimplification exposed something. */ if (ret != GS_ERROR && decl && DECL_BUILT_IN (decl)) { - tree new = fold_builtin (*expr_p, !want_value); + tree fndecl = get_callee_fndecl (*expr_p); + tree arglist = TREE_OPERAND (*expr_p, 1); + tree new = fold_builtin (fndecl, arglist, !want_value); if (new && new != *expr_p) { @@ -2071,10 +2069,6 @@ gimple_boolify (tree expr) if (TREE_CODE (type) == BOOLEAN_TYPE) return expr; - /* If this is the predicate of a COND_EXPR, it might not even be a - truthvalue yet. */ - expr = lang_hooks.truthvalue_conversion (expr); - switch (TREE_CODE (expr)) { case TRUTH_AND_EXPR: @@ -2895,7 +2889,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p, ??? What about code that pulls out the temp and uses it elsewhere? I think that such code never uses the TARGET_EXPR as - an initializer. If I'm wrong, we'll abort because the temp won't + an initializer. If I'm wrong, we'll die because the temp won't have any RTL. In that case, I guess we'll need to replace references somehow. */ tree init = TARGET_EXPR_INITIAL (*from_p); @@ -3231,6 +3225,9 @@ gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p) builtins like __builtin_va_end). */ /* Caution: the silent array decomposition semantics we allow for ADDR_EXPR means we can't always discard the pair. */ + /* Gimplification of the ADDR_EXPR operand may drop + cv-qualification conversions, so make sure we add them if + needed. */ { tree op00 = TREE_OPERAND (op0, 0); tree t_expr = TREE_TYPE (expr); @@ -3240,9 +3237,9 @@ gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p) { #ifdef ENABLE_CHECKING tree t_op0 = TREE_TYPE (op0); - gcc_assert (TREE_CODE (t_op0) == ARRAY_TYPE - && POINTER_TYPE_P (t_expr) - && cpt_same_type (TREE_TYPE (t_op0), + gcc_assert (POINTER_TYPE_P (t_expr) + && cpt_same_type (TREE_CODE (t_op0) == ARRAY_TYPE + ? TREE_TYPE (t_op0) : t_op0, TREE_TYPE (t_expr)) && POINTER_TYPE_P (t_op00) && cpt_same_type (t_op0, TREE_TYPE (t_op00))); @@ -3812,10 +3809,28 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, case COND_EXPR: ret = gimplify_cond_expr (expr_p, pre_p, post_p, NULL_TREE, fallback); + /* C99 code may assign to an array in a structure value of a + conditional expression, and this has undefined behavior + only on execution, so create a temporary if an lvalue is + required. */ + if (fallback == fb_lvalue) + { + *expr_p = get_initialized_tmp_var (*expr_p, pre_p, post_p); + lang_hooks.mark_addressable (*expr_p); + } break; case CALL_EXPR: ret = gimplify_call_expr (expr_p, pre_p, fallback != fb_none); + /* C99 code may assign to an array in a structure returned + from a function, and this has undefined behavior only on + execution, so create a temporary if an lvalue is + required. */ + if (fallback == fb_lvalue) + { + *expr_p = get_initialized_tmp_var (*expr_p, pre_p, post_p); + lang_hooks.mark_addressable (*expr_p); + } break; case TREE_LIST: @@ -4310,7 +4325,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p, #endif gcc_assert (fallback & fb_mayfail); /* If this is an asm statement, and the user asked for the - impossible, don't abort. Fail and let gimplify_asm_expr + impossible, don't die. Fail and let gimplify_asm_expr issue an error. */ ret = GS_ERROR; goto out; @@ -4412,7 +4427,7 @@ gimplify_one_sizepos (tree *expr_p, tree *stmt_p) { /* We don't do anything if the value isn't there, is constant, or contains A PLACEHOLDER_EXPR. We also don't want to do anything if it's already - a VAR_DECL. If it's a VAR_DECL from another function, the gimplfier + a VAR_DECL. If it's a VAR_DECL from another function, the gimplifier will want to replace it with a new variable, but that will cause problems if this type is from outside the function. It's OK to have that here. */ if (*expr_p == NULL_TREE || TREE_CONSTANT (*expr_p) @@ -4643,7 +4658,7 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var) gimple_test_f = simple ? is_gimple_val : is_gimple_reg_rhs; push_gimplify_context (); - gimplify_ctxp->into_ssa = true; + gimplify_ctxp->into_ssa = in_ssa_p; if (var) expr = build (MODIFY_EXPR, TREE_TYPE (var), var, expr); @@ -4652,12 +4667,31 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var) gimple_test_f, fb_rvalue); gcc_assert (ret != GS_ERROR); - for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) - add_referenced_tmp_var (t); + if (referenced_vars) + { + for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t)) + add_referenced_tmp_var (t); + } pop_gimplify_context (NULL); return expr; } +/* Invokes force_gimple_operand for EXPR with parameters SIMPLE_P and VAR. If + some statements are produced, emits them before BSI. */ + +tree +force_gimple_operand_bsi (block_stmt_iterator *bsi, tree expr, + bool simple_p, tree var) +{ + tree stmts; + + expr = force_gimple_operand (expr, &stmts, simple_p, var); + if (stmts) + bsi_insert_before (bsi, stmts, BSI_SAME_STMT); + + return expr; +} + #include "gt-gimplify.h" diff --git a/gcc/global.c b/gcc/global.c index eb965b9b234..34fcc1dd9e8 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -2083,7 +2083,10 @@ mark_reg_change (rtx reg, rtx setter, void *data) /* Classes of registers which could be early clobbered in the current insn. */ -static varray_type earlyclobber_regclass; +DEF_VEC_P(int); +DEF_VEC_ALLOC_P(int,heap); + +static VEC(int,heap) *earlyclobber_regclass; /* This function finds and stores register classes that could be early clobbered in INSN. If any earlyclobber classes are found, the function @@ -2097,7 +2100,7 @@ check_earlyclobber (rtx insn) extract_insn (insn); - VARRAY_POP_ALL (earlyclobber_regclass); + VEC_truncate (int, earlyclobber_regclass, 0); for (opno = 0; opno < recog_data.n_operands; opno++) { char c; @@ -2134,13 +2137,23 @@ check_earlyclobber (rtx insn) case ',': if (amp_p && class != NO_REGS) { + int rc; + found = true; - for (i = VARRAY_ACTIVE_SIZE (earlyclobber_regclass) - 1; - i >= 0; i--) - if (VARRAY_INT (earlyclobber_regclass, i) == (int) class) - break; - if (i < 0) - VARRAY_PUSH_INT (earlyclobber_regclass, (int) class); + for (i = 0; + VEC_iterate (int, earlyclobber_regclass, i, rc); + i++) + { + if (rc == (int) class) + goto found_rc; + } + + /* We use VEC_quick_push here because + earlyclobber_regclass holds no more than + N_REG_CLASSES elements. */ + VEC_quick_push (int, earlyclobber_regclass, (int) class); + found_rc: + ; } amp_p = false; @@ -2177,25 +2190,26 @@ mark_reg_use_for_earlyclobber (rtx *x, void *data ATTRIBUTE_UNUSED) basic_block bb = data; struct bb_info *bb_info = BB_INFO (bb); - if (GET_CODE (*x) == REG && REGNO (*x) >= FIRST_PSEUDO_REGISTER) + if (REG_P (*x) && REGNO (*x) >= FIRST_PSEUDO_REGISTER) { + int rc; + regno = REGNO (*x); if (bitmap_bit_p (bb_info->killed, regno) || bitmap_bit_p (bb_info->avloc, regno)) return 0; pref_class = reg_preferred_class (regno); alt_class = reg_alternate_class (regno); - for (i = VARRAY_ACTIVE_SIZE (earlyclobber_regclass) - 1; i >= 0; i--) - if (reg_classes_intersect_p (VARRAY_INT (earlyclobber_regclass, i), - pref_class) - || (VARRAY_INT (earlyclobber_regclass, i) != NO_REGS - && reg_classes_intersect_p (VARRAY_INT (earlyclobber_regclass, - i), - alt_class))) - { - bitmap_set_bit (bb_info->earlyclobber, regno); - break; - } + for (i = 0; VEC_iterate (int, earlyclobber_regclass, i, rc); i++) + { + if (reg_classes_intersect_p (rc, pref_class) + || (rc != NO_REGS + && reg_classes_intersect_p (rc, alt_class))) + { + bitmap_set_bit (bb_info->earlyclobber, regno); + break; + } + } } return 0; } @@ -2217,8 +2231,9 @@ calculate_local_reg_bb_info (void) basic_block bb; rtx insn, bound; - VARRAY_INT_INIT (earlyclobber_regclass, 20, - "classes of registers early clobbered in an insn"); + /* We know that earlyclobber_regclass holds no more than + N_REG_CLASSES elements. See check_earlyclobber. */ + earlyclobber_regclass = VEC_alloc (int, heap, N_REG_CLASSES); FOR_EACH_BB (bb) { bound = NEXT_INSN (BB_END (bb)); @@ -2230,6 +2245,7 @@ calculate_local_reg_bb_info (void) note_uses (&PATTERN (insn), mark_reg_use_for_earlyclobber_1, bb); } } + VEC_free (int, heap, earlyclobber_regclass); } /* The function sets up reverse post-order number of each basic @@ -2261,6 +2277,9 @@ rpost_cmp (const void *bb1, const void *bb2) /* Temporary bitmap used for live_pavin, live_pavout calculation. */ static bitmap temp_bitmap; +DEF_VEC_P(basic_block); +DEF_VEC_ALLOC_P(basic_block,heap); + /* The function calculates partial register availability according to the following equations: @@ -2276,22 +2295,22 @@ calculate_reg_pav (void) basic_block bb, succ; edge e; int i, nel; - varray_type bbs, new_bbs, temp; + VEC(basic_block,heap) *bbs, *new_bbs, *temp; basic_block *bb_array; sbitmap wset; - VARRAY_BB_INIT (bbs, n_basic_blocks, "basic blocks"); - VARRAY_BB_INIT (new_bbs, n_basic_blocks, "basic blocks for the next iter."); + bbs = VEC_alloc (basic_block, heap, n_basic_blocks); + new_bbs = VEC_alloc (basic_block, heap, n_basic_blocks); temp_bitmap = BITMAP_ALLOC (NULL); FOR_EACH_BB (bb) { - VARRAY_PUSH_BB (bbs, bb); + VEC_quick_push (basic_block, bbs, bb); } wset = sbitmap_alloc (n_basic_blocks + 1); - while (VARRAY_ACTIVE_SIZE (bbs)) + while (VEC_length (basic_block, bbs)) { - bb_array = &VARRAY_BB (bbs, 0); - nel = VARRAY_ACTIVE_SIZE (bbs); + bb_array = VEC_address (basic_block, bbs); + nel = VEC_length (basic_block, bbs); qsort (bb_array, nel, sizeof (basic_block), rpost_cmp); sbitmap_zero (wset); for (i = 0; i < nel; i++) @@ -2325,7 +2344,7 @@ calculate_reg_pav (void) && !TEST_BIT (wset, succ->index)) { SET_BIT (wset, succ->index); - VARRAY_PUSH_BB (new_bbs, succ); + VEC_quick_push (basic_block, new_bbs, succ); } } } @@ -2333,10 +2352,12 @@ calculate_reg_pav (void) temp = bbs; bbs = new_bbs; new_bbs = temp; - VARRAY_POP_ALL (new_bbs); + VEC_truncate (basic_block, new_bbs, 0); } sbitmap_free (wset); BITMAP_FREE (temp_bitmap); + VEC_free (basic_block, heap, new_bbs); + VEC_free (basic_block, heap, bbs); } /* The function modifies partial availability information for two diff --git a/gcc/gthr-posix.c b/gcc/gthr-posix.c index c74f3cecea9..dd7ad48d261 100644 --- a/gcc/gthr-posix.c +++ b/gcc/gthr-posix.c @@ -1,6 +1,6 @@ /* POSIX threads dummy routines for systems without weak definitions. */ /* Compile this one with gcc. */ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -75,6 +75,12 @@ pthread_create (pthread_t *thread ATTRIBUTE_UNUSED, } int +pthread_cancel(pthread_t thread ATTRIBUTE_UNUSED) +{ + return 0; +} + +int pthread_mutex_lock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED) { return 0; @@ -93,6 +99,25 @@ pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED) } int +pthread_mutexattr_init (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED) +{ + return 0; +} + +int +pthread_mutexattr_settype (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED, + int type ATTRIBUTE_UNUSED) +{ + return 0; +} + +int +pthread_mutexattr_destroy (pthread_mutexattr_t *attr ATTRIBUTE_UNUSED) +{ + return 0; +} + +int pthread_cond_broadcast (pthread_cond_t *cond ATTRIBUTE_UNUSED) { return 0; diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h index 4e81598cf86..5e17360dfcd 100644 --- a/gcc/gthr-win32.h +++ b/gcc/gthr-win32.h @@ -1,6 +1,8 @@ /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ -/* Copyright (C) 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. + +/* Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. Contributed by Mumit Khan . This file is part of GCC. @@ -71,7 +73,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifdef _LIBOBJC /* This is necessary to prevent windef.h (included from windows.h) from - defining it's own BOOL as a typedef. */ + defining its own BOOL as a typedef. */ #ifndef __OBJC__ #define __OBJC__ #endif diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 6a2ac54691f..87de24e3770 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -179,7 +179,7 @@ fix_sched_param (const char *param, const char *val) if (!strcmp (param, "verbose")) sched_verbose_param = atoi (val); else - warning ("fix_sched_param: unknown param: %s", param); + warning (0, "fix_sched_param: unknown param: %s", param); } struct haifa_insn_data *h_i_d; @@ -753,8 +753,7 @@ queue_insn (rtx insn, int n_cycles) HAIFA_INLINE static rtx * ready_lastpos (struct ready_list *ready) { - if (ready->n_ready == 0) - abort (); + gcc_assert (ready->n_ready); return ready->vec + ready->first - ready->n_ready + 1; } @@ -782,8 +781,8 @@ HAIFA_INLINE static rtx ready_remove_first (struct ready_list *ready) { rtx t; - if (ready->n_ready == 0) - abort (); + + gcc_assert (ready->n_ready); t = ready->vec[ready->first--]; ready->n_ready--; /* If the queue becomes empty, reset it. */ @@ -803,10 +802,8 @@ ready_remove_first (struct ready_list *ready) HAIFA_INLINE static rtx ready_element (struct ready_list *ready, int index) { -#ifdef ENABLE_CHECKING - if (ready->n_ready == 0 || index >= ready->n_ready) - abort (); -#endif + gcc_assert (ready->n_ready && index < ready->n_ready); + return ready->vec[ready->first - index]; } @@ -822,8 +819,7 @@ ready_remove (struct ready_list *ready, int index) if (index == 0) return ready_remove_first (ready); - if (ready->n_ready == 0 || index >= ready->n_ready) - abort (); + gcc_assert (ready->n_ready && index < ready->n_ready); t = ready->vec[ready->first - index]; ready->n_ready--; for (i = index; i < ready->n_ready; i++) @@ -1105,12 +1101,7 @@ rm_line_notes (rtx head, rtx tail) prev = insn; insn = unlink_line_notes (insn, next_tail); - if (prev == tail) - abort (); - if (prev == head) - abort (); - if (insn == next_tail) - abort (); + gcc_assert (prev != tail && prev != head && insn != next_tail); } } } @@ -1289,12 +1280,7 @@ rm_other_notes (rtx head, rtx tail) insn = unlink_other_notes (insn, next_tail); - if (prev == tail) - abort (); - if (prev == head) - abort (); - if (insn == next_tail) - abort (); + gcc_assert (prev != tail && prev != head && insn != next_tail); } } } @@ -1868,18 +1854,19 @@ schedule_block (int b, int rgn_n_insns) and caused problems because schedule_block and compute_forward_dependences had different notions of what the "head" insn was. */ - if (head == tail && (! INSN_P (head))) - abort (); + gcc_assert (head != tail || INSN_P (head)); /* Debug info. */ if (sched_verbose) { - fprintf (sched_dump, ";; ======================================================\n"); + fprintf (sched_dump, + ";; ======================================================\n"); fprintf (sched_dump, ";; -- basic block %d from %d to %d -- %s reload\n", b, INSN_UID (head), INSN_UID (tail), (reload_completed ? "after" : "before")); - fprintf (sched_dump, ";; ======================================================\n"); + fprintf (sched_dump, + ";; ======================================================\n"); fprintf (sched_dump, "\n"); } @@ -1938,8 +1925,7 @@ schedule_block (int b, int rgn_n_insns) list. */ queue_to_ready (&ready); - if (ready.n_ready == 0) - abort (); + gcc_assert (ready.n_ready); if (sched_verbose >= 2) { @@ -2122,8 +2108,7 @@ schedule_block (int b, int rgn_n_insns) /* Sanity check -- queue must be empty now. Meaningless if region has multiple bbs. */ - if (current_sched_info->queue_must_finish_empty && q_size != 0) - abort (); + gcc_assert (!current_sched_info->queue_must_finish_empty || !q_size); /* Update head/tail boundaries. */ head = NEXT_INSN (prev_head); diff --git a/gcc/hooks.c b/gcc/hooks.c index fc59b97bd6c..6e6e7c70321 100644 --- a/gcc/hooks.c +++ b/gcc/hooks.c @@ -1,5 +1,5 @@ /* General-purpose hooks. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 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 @@ -228,11 +228,12 @@ hook_rtx_tree_int_null (tree a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED) return NULL; } -/* Generic hook that takes a tree and returns it as is. */ +/* Generic hook that takes three trees and returns the last one as is. */ tree -hook_tree_tree_identity (tree a) +hook_tree_tree_tree_tree_3rd_identity (tree a ATTRIBUTE_UNUSED, + tree b ATTRIBUTE_UNUSED, tree c) { - return a; + return c; } /* Generic hook that takes a tree and returns a NULL string. */ @@ -243,7 +244,8 @@ hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED) } tree -hook_tree_tree_bool_null (tree t ATTRIBUTE_UNUSED, bool ignore ATTRIBUTE_UNUSED) +hook_tree_tree_tree_bool_null (tree t0 ATTRIBUTE_UNUSED, tree t1 ATTRIBUTE_UNUSED, + bool ignore ATTRIBUTE_UNUSED) { return NULL; } diff --git a/gcc/hooks.h b/gcc/hooks.h index a4a38041f25..b799a8c0709 100644 --- a/gcc/hooks.h +++ b/gcc/hooks.h @@ -1,5 +1,5 @@ /* General-purpose hooks. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 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 @@ -62,7 +62,7 @@ extern bool hook_bool_tree_tree_false (tree, tree); extern rtx hook_rtx_rtx_identity (rtx); 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 tree hook_tree_tree_tree_tree_3rd_identity (tree, tree, tree); extern const char *hook_constcharptr_tree_null (tree); -extern tree hook_tree_tree_bool_null (tree, bool); +extern tree hook_tree_tree_tree_bool_null (tree, tree, bool); #endif diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index b0df6dae3ac..be02aaa7d24 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -66,7 +66,6 @@ #define MAX_CONDITIONAL_EXECUTE (BRANCH_COST + 1) #endif -#define NULL_EDGE ((edge) NULL) #define NULL_BLOCK ((basic_block) NULL) /* # of IF-THEN or IF-THEN-ELSE blocks we looked at */ @@ -270,8 +269,7 @@ cond_exec_process_insns (ce_if_block_t *ce_info ATTRIBUTE_UNUSED, if (NOTE_P (insn)) goto insn_done; - if (!NONJUMP_INSN_P (insn) && !CALL_P (insn)) - abort (); + gcc_assert(NONJUMP_INSN_P (insn) || CALL_P (insn)); /* Remove USE insns that get in the way. */ if (reload_completed && GET_CODE (PATTERN (insn)) == USE) @@ -1983,6 +1981,14 @@ noce_process_if_block (struct ce_if_block * ce_info) if (side_effects_p (x)) return FALSE; + /* If x is a read-only memory, then the program is valid only if we + avoid the store into it. If there are stores on both the THEN and + ELSE arms, then we can go ahead with the conversion; either the + program is broken, or the condition is always false such that the + other memory is selected. */ + if (!set_b && MEM_P (x) && MEM_READONLY_P (x)) + return FALSE; + b = (set_b ? SET_SRC (set_b) : x); /* Only operate on register destinations, and even then avoid extending @@ -2229,30 +2235,21 @@ merge_if_block (struct ce_if_block * ce_info) /* The outgoing edge for the current COMBO block should already be correct. Verify this. */ if (EDGE_COUNT (combo_bb->succs) == 0) - { - if (find_reg_note (last, REG_NORETURN, NULL)) - ; - else if (NONJUMP_INSN_P (last) - && GET_CODE (PATTERN (last)) == TRAP_IF - && TRAP_CONDITION (PATTERN (last)) == const_true_rtx) - ; - else - abort (); - } + gcc_assert (find_reg_note (last, REG_NORETURN, NULL) + || (NONJUMP_INSN_P (last) + && GET_CODE (PATTERN (last)) == TRAP_IF + && (TRAP_CONDITION (PATTERN (last)) + == const_true_rtx))); + else /* There should still be something at the end of the THEN or ELSE blocks taking us to our final destination. */ - else if (JUMP_P (last)) - ; - else if (EDGE_SUCC (combo_bb, 0)->dest == EXIT_BLOCK_PTR - && CALL_P (last) - && SIBLING_CALL_P (last)) - ; - else if ((EDGE_SUCC (combo_bb, 0)->flags & EDGE_EH) - && can_throw_internal (last)) - ; - else - abort (); + gcc_assert (JUMP_P (last) + || (EDGE_SUCC (combo_bb, 0)->dest == EXIT_BLOCK_PTR + && CALL_P (last) + && SIBLING_CALL_P (last)) + || ((EDGE_SUCC (combo_bb, 0)->flags & EDGE_EH) + && can_throw_internal (last))); } /* The JOIN block may have had quite a number of other predecessors too. @@ -2260,7 +2257,7 @@ merge_if_block (struct ce_if_block * ce_info) have only one remaining edge from our if-then-else diamond. If there is more than one remaining edge, it must come from elsewhere. There may be zero incoming edges if the THEN block didn't actually join - back up (as with a call to abort). */ + back up (as with a call to a non-return function). */ else if (EDGE_COUNT (join_bb->preds) < 2 && join_bb != EXIT_BLOCK_PTR) { @@ -2627,7 +2624,7 @@ find_if_block (struct ce_if_block * ce_info) we checked the FALLTHRU flag, those are already adjacent to the last IF block. */ /* ??? As an enhancement, move the ELSE block. Have to deal with - BLOCK notes, if by no other means than aborting the merge if they + BLOCK notes, if by no other means than backing out the merge if they exist. Sticky enough I don't want to think about it now. */ next = then_bb; if (else_bb && (next = next->next_bb) != else_bb) @@ -2865,12 +2862,13 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && ((BB_END (then_bb) - && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX)) - || (BB_END (else_bb) - && find_reg_note (BB_END (else_bb), REG_CROSSING_JUMP, - NULL_RTX)))) + if ((BB_END (then_bb) + && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX)) + || (BB_END (test_bb) + && find_reg_note (BB_END (test_bb), REG_CROSSING_JUMP, NULL_RTX)) + || (BB_END (else_bb) + && find_reg_note (BB_END (else_bb), REG_CROSSING_JUMP, + NULL_RTX))) return FALSE; /* THEN has one successor. */ @@ -2970,12 +2968,13 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge) partition boundaries). See the comments at the top of bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */ - if (flag_reorder_blocks_and_partition - && ((BB_END (then_bb) - && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX)) - || (BB_END (else_bb) - && find_reg_note (BB_END (else_bb), REG_CROSSING_JUMP, - NULL_RTX)))) + if ((BB_END (then_bb) + && find_reg_note (BB_END (then_bb), REG_CROSSING_JUMP, NULL_RTX)) + || (BB_END (test_bb) + && find_reg_note (BB_END (test_bb), REG_CROSSING_JUMP, NULL_RTX)) + || (BB_END (else_bb) + && find_reg_note (BB_END (else_bb), REG_CROSSING_JUMP, + NULL_RTX))) return FALSE; /* ELSE has one successor. */ diff --git a/gcc/insn-notes.def b/gcc/insn-notes.def index 3894dda3128..f3bbd379393 100644 --- a/gcc/insn-notes.def +++ b/gcc/insn-notes.def @@ -1,5 +1,5 @@ /* Insn note definitions. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -88,9 +88,8 @@ INSN_NOTE (EXPECTED_VALUE) now included in every insn. */ INSN_NOTE (BASIC_BLOCK) -/* Record that the current basic block is unlikely to be executed and - should be moved to the UNLIKELY_EXECUTED_TEXT_SECTION. FIXME: Make - this a bit on the basic block structure. */ -INSN_NOTE (UNLIKELY_EXECUTED_CODE) +/* Mark the inflection point in the instruction stream where we switch + between hot and cold text sections. */ +INSN_NOTE (SWITCH_TEXT_SECTIONS) #undef INSN_NOTE diff --git a/gcc/integrate.c b/gcc/integrate.c index 135bd1d38b8..0f5cfcf1544 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -1,6 +1,6 @@ /* Procedure integration for GCC. Copyright (C) 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. @@ -50,7 +50,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define CEIL_ROUND(VALUE,ALIGN) (((VALUE) + (ALIGN) - 1) & ~((ALIGN)- 1)) -/* Private type used by {get/has}_func_hard_reg_initial_val. */ +/* Private type used by {get/has}_hard_reg_initial_val. */ typedef struct initial_value_pair GTY(()) { rtx hard_reg; rtx pseudo; @@ -121,6 +121,7 @@ copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn) if (TREE_CODE (copy) == LABEL_DECL) { TREE_ADDRESSABLE (copy) = 0; + LABEL_DECL_UID (copy) = -1; } } @@ -293,38 +294,27 @@ get_hard_reg_initial_reg (struct function *fun, rtx reg) return NULL_RTX; } -static rtx -has_func_hard_reg_initial_val (struct function *fun, rtx reg) -{ - struct initial_value_struct *ivs = fun->hard_reg_initial_vals; - int i; - - if (ivs == 0) - return NULL_RTX; - - for (i = 0; i < ivs->num_entries; i++) - if (rtx_equal_p (ivs->entries[i].hard_reg, reg)) - return ivs->entries[i].pseudo; - - return NULL_RTX; -} +/* Make sure that there's a pseudo register of mode MODE that stores the + initial value of hard register REGNO. Return an rtx for such a pseudo. */ -static rtx -get_func_hard_reg_initial_val (struct function *fun, rtx reg) +rtx +get_hard_reg_initial_val (enum machine_mode mode, unsigned int regno) { - struct initial_value_struct *ivs = fun->hard_reg_initial_vals; - rtx rv = has_func_hard_reg_initial_val (fun, reg); + struct initial_value_struct *ivs; + rtx rv; + rv = has_hard_reg_initial_val (mode, regno); if (rv) return rv; + ivs = cfun->hard_reg_initial_vals; if (ivs == 0) { - fun->hard_reg_initial_vals = ggc_alloc (sizeof (initial_value_struct)); - ivs = fun->hard_reg_initial_vals; + ivs = ggc_alloc (sizeof (initial_value_struct)); ivs->num_entries = 0; ivs->max_entries = 5; ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair)); + cfun->hard_reg_initial_vals = ivs; } if (ivs->num_entries >= ivs->max_entries) @@ -335,22 +325,30 @@ get_func_hard_reg_initial_val (struct function *fun, rtx reg) * sizeof (initial_value_pair)); } - ivs->entries[ivs->num_entries].hard_reg = reg; - ivs->entries[ivs->num_entries].pseudo = gen_reg_rtx (GET_MODE (reg)); + ivs->entries[ivs->num_entries].hard_reg = gen_rtx_REG (mode, regno); + ivs->entries[ivs->num_entries].pseudo = gen_reg_rtx (mode); return ivs->entries[ivs->num_entries++].pseudo; } -rtx -get_hard_reg_initial_val (enum machine_mode mode, int regno) -{ - return get_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno)); -} +/* See if get_hard_reg_initial_val has been used to create a pseudo + for the initial value of hard register REGNO in mode MODE. Return + the associated pseudo if so, otherwise return NULL. */ rtx -has_hard_reg_initial_val (enum machine_mode mode, int regno) +has_hard_reg_initial_val (enum machine_mode mode, unsigned int regno) { - return has_func_hard_reg_initial_val (cfun, gen_rtx_REG (mode, regno)); + struct initial_value_struct *ivs; + int i; + + ivs = cfun->hard_reg_initial_vals; + if (ivs != 0) + for (i = 0; i < ivs->num_entries; i++) + if (GET_MODE (ivs->entries[i].hard_reg) == mode + && REGNO (ivs->entries[i].hard_reg) == regno) + return ivs->entries[i].pseudo; + + return NULL_RTX; } void @@ -389,18 +387,31 @@ allocate_initial_values (rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED) int regno = REGNO (ivs->entries[i].pseudo); rtx x = ALLOCATE_INITIAL_VALUE (ivs->entries[i].hard_reg); - if (x == NULL_RTX || REG_N_SETS (REGNO (ivs->entries[i].pseudo)) > 1) - ; /* Do nothing. */ - else if (MEM_P (x)) - reg_equiv_memory_loc[regno] = x; - else if (REG_P (x)) + if (x && REG_N_SETS (REGNO (ivs->entries[i].pseudo)) <= 1) { - reg_renumber[regno] = REGNO (x); - /* Poke the regno right into regno_reg_rtx - so that even fixed regs are accepted. */ - REGNO (ivs->entries[i].pseudo) = REGNO (x); + if (MEM_P (x)) + reg_equiv_memory_loc[regno] = x; + else + { + basic_block bb; + int new_regno; + + gcc_assert (REG_P (x)); + new_regno = REGNO (x); + reg_renumber[regno] = new_regno; + /* Poke the regno right into regno_reg_rtx so that even + fixed regs are accepted. */ + REGNO (ivs->entries[i].pseudo) = new_regno; + /* Update global register liveness information. */ + FOR_EACH_BB (bb) + { + if (REGNO_REG_SET_P(bb->global_live_at_start, regno)) + SET_REGNO_REG_SET (bb->global_live_at_start, new_regno); + if (REGNO_REG_SET_P(bb->global_live_at_end, regno)) + SET_REGNO_REG_SET (bb->global_live_at_end, new_regno); + } + } } - else abort (); } #endif } diff --git a/gcc/integrate.h b/gcc/integrate.h index 74d3f9d03dd..fce69efb67c 100644 --- a/gcc/integrate.h +++ b/gcc/integrate.h @@ -1,5 +1,5 @@ /* Function integration definitions for GCC - Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1990, 1995, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -21,12 +21,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "varray.h" -/* Return a pseudo that corresponds to the value in the specified hard - reg as of the start of the function (for inlined functions, the - value at the start of the parent function). */ -extern rtx get_hard_reg_initial_val (enum machine_mode, int); -/* Likewise, but for common cases. */ -extern rtx has_hard_reg_initial_val (enum machine_mode, int); +extern rtx get_hard_reg_initial_val (enum machine_mode, unsigned int); +extern rtx has_hard_reg_initial_val (enum machine_mode, unsigned int); /* If a pseudo represents an initial hard reg (or expression), return it, else return NULL_RTX. */ extern rtx get_hard_reg_initial_reg (struct function *, rtx); diff --git a/gcc/intl.c b/gcc/intl.c index e5aa941021f..7046ae84cd6 100644 --- a/gcc/intl.c +++ b/gcc/intl.c @@ -1,5 +1,5 @@ /* Message translation utilities. - Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c new file mode 100644 index 00000000000..79150d2ba9a --- /dev/null +++ b/gcc/ipa-inline.c @@ -0,0 +1,740 @@ +/* Inlining decision heuristics. + Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Contributed by Jan Hubicka + +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. */ + +/* Inlining decision heuristics + + We separate inlining decisions from the inliner itself and store it + inside callgraph as so called inline plan. Refer to cgraph.c + documentation about particular representation of inline plans in the + callgraph. + + There are three major parts of this file: + + cgraph_mark_inline implementation + + This function allows to mark given call inline and performs necessary + modifications of cgraph (production of the clones and updating overall + statistics) + + inlining heuristics limits + + These functions allow to check that particular inlining is allowed + by the limits specified by user (allowed function growth, overall unit + growth and so on). + + inlining heuristics + + This is implementation of IPA pass aiming to get as much of benefit + from inlining obeying the limits checked above. + + The implementation of particular heuristics is separated from + the rest of code to make it easier to replace it with more complicated + implementation in the future. The rest of inlining code acts as a + library aimed to modify the callgraph and verify that the parameters + on code size growth fits. + + To mark given call inline, use cgraph_mark_inline function, the + verification is performed by cgraph_default_inline_p and + cgraph_check_inline_limits. + + The heuristics implements simple knapsack style algorithm ordering + all functions by their "profitability" (estimated by code size growth) + and inlining them in priority order. + + cgraph_decide_inlining implements heuristics taking whole callgraph + into account, while cgraph_decide_inlining_incrementally considers + only one function at a time and is used in non-unit-at-a-time mode. */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "tree.h" +#include "tree-inline.h" +#include "langhooks.h" +#include "flags.h" +#include "cgraph.h" +#include "diagnostic.h" +#include "timevar.h" +#include "params.h" +#include "fibheap.h" +#include "intl.h" +#include "tree-pass.h" + +/* Statistics we collect about inlining algorithm. */ +static int ncalls_inlined; +static int nfunctions_inlined; +static int initial_insns; +static int overall_insns; + +/* Estimate size of the function after inlining WHAT into TO. */ + +static int +cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to, + struct cgraph_node *what) +{ + tree fndecl = what->decl; + tree arg; + int call_insns = PARAM_VALUE (PARAM_INLINE_CALL_COST); + for (arg = DECL_ARGUMENTS (fndecl); arg; arg = TREE_CHAIN (arg)) + call_insns += estimate_move_cost (TREE_TYPE (arg)); + return (what->global.insns - call_insns) * times + to->global.insns; +} + +/* E is expected to be an edge being inlined. Clone destination node of + the edge and redirect it to the new clone. + DUPLICATE is used for bookkeeping on whether we are actually creating new + clones or re-using node originally representing out-of-line function call. + */ +void +cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate) +{ + struct cgraph_node *n; + + /* We may eliminate the need for out-of-line copy to be output. In that + case just go ahead and re-use it. */ + if (!e->callee->callers->next_caller + && (!e->callee->needed || DECL_EXTERNAL (e->callee->decl)) + && duplicate + && flag_unit_at_a_time) + { + gcc_assert (!e->callee->global.inlined_to); + if (!DECL_EXTERNAL (e->callee->decl)) + overall_insns -= e->callee->global.insns, nfunctions_inlined++; + duplicate = 0; + } + else if (duplicate) + { + n = cgraph_clone_node (e->callee, e->count, e->loop_nest); + cgraph_redirect_edge_callee (e, n); + } + + if (e->caller->global.inlined_to) + e->callee->global.inlined_to = e->caller->global.inlined_to; + else + e->callee->global.inlined_to = e->caller; + + /* Recursively clone all bodies. */ + for (e = e->callee->callees; e; e = e->next_callee) + if (!e->inline_failed) + cgraph_clone_inlined_nodes (e, duplicate); +} + +/* Mark edge E as inlined and update callgraph accordingly. */ + +void +cgraph_mark_inline_edge (struct cgraph_edge *e) +{ + int old_insns = 0, new_insns = 0; + struct cgraph_node *to = NULL, *what; + + gcc_assert (e->inline_failed); + e->inline_failed = NULL; + + if (!e->callee->global.inlined && flag_unit_at_a_time) + DECL_POSSIBLY_INLINED (e->callee->decl) = true; + e->callee->global.inlined = true; + + cgraph_clone_inlined_nodes (e, true); + + what = e->callee; + + /* Now update size of caller and all functions caller is inlined into. */ + for (;e && !e->inline_failed; e = e->caller->callers) + { + old_insns = e->caller->global.insns; + new_insns = cgraph_estimate_size_after_inlining (1, e->caller, + what); + gcc_assert (new_insns >= 0); + to = e->caller; + to->global.insns = new_insns; + } + gcc_assert (what->global.inlined_to == to); + if (new_insns > old_insns) + overall_insns += new_insns - old_insns; + ncalls_inlined++; +} + +/* Mark all calls of EDGE->CALLEE inlined into EDGE->CALLER. + Return following unredirected edge in the list of callers + of EDGE->CALLEE */ + +static struct cgraph_edge * +cgraph_mark_inline (struct cgraph_edge *edge) +{ + struct cgraph_node *to = edge->caller; + struct cgraph_node *what = edge->callee; + struct cgraph_edge *e, *next; + int times = 0; + + /* Look for all calls, mark them inline and clone recursively + all inlined functions. */ + for (e = what->callers; e; e = next) + { + next = e->next_caller; + if (e->caller == to && e->inline_failed) + { + cgraph_mark_inline_edge (e); + if (e == edge) + edge = next; + times++; + } + } + gcc_assert (times); + return edge; +} + +/* Estimate the growth caused by inlining NODE into all callees. */ + +static int +cgraph_estimate_growth (struct cgraph_node *node) +{ + int growth = 0; + struct cgraph_edge *e; + + for (e = node->callers; e; e = e->next_caller) + if (e->inline_failed) + growth += (cgraph_estimate_size_after_inlining (1, e->caller, node) + - e->caller->global.insns); + + /* ??? Wrong for self recursive functions or cases where we decide to not + inline for different reasons, but it is not big deal as in that case + we will keep the body around, but we will also avoid some inlining. */ + if (!node->needed && !DECL_EXTERNAL (node->decl)) + growth -= node->global.insns; + + return growth; +} + +/* Return false when inlining WHAT into TO is not good idea + as it would cause too large growth of function bodies. */ + +static bool +cgraph_check_inline_limits (struct cgraph_node *to, struct cgraph_node *what, + const char **reason) +{ + int times = 0; + struct cgraph_edge *e; + int newsize; + int limit; + + if (to->global.inlined_to) + to = to->global.inlined_to; + + for (e = to->callees; e; e = e->next_callee) + if (e->callee == what) + times++; + + /* When inlining large function body called once into small function, + take the inlined function as base for limiting the growth. */ + if (to->local.self_insns > what->local.self_insns) + limit = to->local.self_insns; + else + limit = what->local.self_insns; + + limit += limit * PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH) / 100; + + newsize = cgraph_estimate_size_after_inlining (times, to, what); + if (newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS) + && newsize > limit) + { + if (reason) + *reason = N_("--param large-function-growth limit reached"); + return false; + } + return true; +} + +/* Return true when function N is small enough to be inlined. */ + +bool +cgraph_default_inline_p (struct cgraph_node *n) +{ + if (!DECL_INLINE (n->decl) || !DECL_SAVED_TREE (n->decl)) + return false; + if (DECL_DECLARED_INLINE_P (n->decl)) + return n->global.insns < MAX_INLINE_INSNS_SINGLE; + else + return n->global.insns < MAX_INLINE_INSNS_AUTO; +} + +/* Return true when inlining WHAT would create recursive inlining. + We call recursive inlining all cases where same function appears more than + once in the single recursion nest path in the inline graph. */ + +static bool +cgraph_recursive_inlining_p (struct cgraph_node *to, + struct cgraph_node *what, + const char **reason) +{ + bool recursive; + if (to->global.inlined_to) + recursive = what->decl == to->global.inlined_to->decl; + else + recursive = what->decl == to->decl; + /* Marking recursive function inline has sane semantic and thus we should + not warn on it. */ + if (recursive && reason) + *reason = (what->local.disregard_inline_limits + ? N_("recursive inlining") : ""); + return recursive; +} + +/* Recompute heap nodes for each of callees. */ +static void +update_callee_keys (fibheap_t heap, struct fibnode **heap_node, + struct cgraph_node *node) +{ + struct cgraph_edge *e; + + for (e = node->callees; e; e = e->next_callee) + if (e->inline_failed && heap_node[e->callee->uid]) + fibheap_replace_key (heap, heap_node[e->callee->uid], + cgraph_estimate_growth (e->callee)); + else if (!e->inline_failed) + update_callee_keys (heap, heap_node, e->callee); +} + +/* Enqueue all recursive calls from NODE into queue linked via aux pointers + in between FIRST and LAST. WHERE is used for bookkeeping while looking + int calls inlined within NODE. */ +static void +lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where, + struct cgraph_edge **first, struct cgraph_edge **last) +{ + struct cgraph_edge *e; + for (e = where->callees; e; e = e->next_callee) + if (e->callee == node) + { + if (!*first) + *first = e; + else + (*last)->aux = e; + *last = e; + } + for (e = where->callees; e; e = e->next_callee) + if (!e->inline_failed) + lookup_recursive_calls (node, e->callee, first, last); +} + +/* Decide on recursive inlining: in the case function has recursive calls, + inline until body size reaches given argument. */ +static void +cgraph_decide_recursive_inlining (struct cgraph_node *node) +{ + int limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO); + int max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO); + struct cgraph_edge *first_call = NULL, *last_call = NULL; + struct cgraph_edge *last_in_current_depth; + struct cgraph_edge *e; + struct cgraph_node *master_clone; + int depth = 0; + int n = 0; + + if (DECL_DECLARED_INLINE_P (node->decl)) + { + limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE); + max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH); + } + + /* Make sure that function is small enough to be considered for inlining. */ + if (!max_depth + || cgraph_estimate_size_after_inlining (1, node, node) >= limit) + return; + lookup_recursive_calls (node, node, &first_call, &last_call); + if (!first_call) + return; + + if (dump_file) + fprintf (dump_file, + "\nPerforming recursive inlining on %s\n", + cgraph_node_name (node)); + + /* We need original clone to copy around. */ + master_clone = cgraph_clone_node (node, 0, 1); + master_clone->needed = true; + for (e = master_clone->callees; e; e = e->next_callee) + if (!e->inline_failed) + cgraph_clone_inlined_nodes (e, true); + + /* Do the inlining and update list of recursive call during process. */ + last_in_current_depth = last_call; + while (first_call + && cgraph_estimate_size_after_inlining (1, node, master_clone) <= limit) + { + struct cgraph_edge *curr = first_call; + + first_call = first_call->aux; + curr->aux = NULL; + + cgraph_redirect_edge_callee (curr, master_clone); + cgraph_mark_inline_edge (curr); + lookup_recursive_calls (node, curr->callee, &first_call, &last_call); + + if (last_in_current_depth + && ++depth >= max_depth) + break; + n++; + } + + /* Cleanup queue pointers. */ + while (first_call) + { + struct cgraph_edge *next = first_call->aux; + first_call->aux = NULL; + first_call = next; + } + if (dump_file) + fprintf (dump_file, + "\n Inlined %i times, body grown from %i to %i insns\n", n, + master_clone->global.insns, node->global.insns); + + /* Remove master clone we used for inlining. We rely that clones inlined + into master clone gets queued just before master clone so we don't + need recursion. */ + for (node = cgraph_nodes; node != master_clone; + node = node->next) + if (node->global.inlined_to == master_clone) + cgraph_remove_node (node); + cgraph_remove_node (master_clone); +} + +/* Set inline_failed for all callers of given function to REASON. */ + +static void +cgraph_set_inline_failed (struct cgraph_node *node, const char *reason) +{ + struct cgraph_edge *e; + + if (dump_file) + fprintf (dump_file, "Inlining failed: %s\n", reason); + for (e = node->callers; e; e = e->next_caller) + if (e->inline_failed) + e->inline_failed = reason; +} + +/* We use greedy algorithm for inlining of small functions: + All inline candidates are put into prioritized heap based on estimated + growth of the overall number of instructions and then update the estimates. + + INLINED and INLINED_CALEES are just pointers to arrays large enough + to be passed to cgraph_inlined_into and cgraph_inlined_callees. */ + +static void +cgraph_decide_inlining_of_small_functions (void) +{ + struct cgraph_node *node; + fibheap_t heap = fibheap_new (); + struct fibnode **heap_node = + xcalloc (cgraph_max_uid, sizeof (struct fibnode *)); + int max_insns = ((HOST_WIDEST_INT) initial_insns + * (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100); + + /* Put all inline candidates into the heap. */ + + for (node = cgraph_nodes; node; node = node->next) + { + if (!node->local.inlinable || !node->callers + || node->local.disregard_inline_limits) + continue; + + if (!cgraph_default_inline_p (node)) + { + cgraph_set_inline_failed (node, + N_("--param max-inline-insns-single limit reached")); + continue; + } + heap_node[node->uid] = + fibheap_insert (heap, cgraph_estimate_growth (node), node); + } + + if (dump_file) + fprintf (dump_file, "\nDeciding on smaller functions:\n"); + while (overall_insns <= max_insns && (node = fibheap_extract_min (heap))) + { + struct cgraph_edge *e, *next; + int old_insns = overall_insns; + + heap_node[node->uid] = NULL; + if (dump_file) + fprintf (dump_file, + "\nConsidering %s with %i insns\n" + " Estimated growth is %+i insns.\n", + cgraph_node_name (node), node->global.insns, + cgraph_estimate_growth (node)); + if (!cgraph_default_inline_p (node)) + { + cgraph_set_inline_failed (node, + N_("--param max-inline-insns-single limit reached after inlining into the callee")); + continue; + } + for (e = node->callers; e; e = next) + { + next = e->next_caller; + if (e->inline_failed) + { + struct cgraph_node *where; + + if (cgraph_recursive_inlining_p (e->caller, e->callee, + &e->inline_failed) + || !cgraph_check_inline_limits (e->caller, e->callee, + &e->inline_failed)) + { + if (dump_file) + fprintf (dump_file, " Not inlining into %s:%s.\n", + cgraph_node_name (e->caller), e->inline_failed); + continue; + } + next = cgraph_mark_inline (e); + where = e->caller; + if (where->global.inlined_to) + where = where->global.inlined_to; + + if (heap_node[where->uid]) + fibheap_replace_key (heap, heap_node[where->uid], + cgraph_estimate_growth (where)); + + if (dump_file) + fprintf (dump_file, + " Inlined into %s which now has %i insns.\n", + cgraph_node_name (e->caller), + e->caller->global.insns); + } + } + + cgraph_decide_recursive_inlining (node); + + /* Similarly all functions called by the function we just inlined + are now called more times; update keys. */ + update_callee_keys (heap, heap_node, node); + + if (dump_file) + fprintf (dump_file, + " Inlined for a net change of %+i insns.\n", + overall_insns - old_insns); + } + while ((node = fibheap_extract_min (heap)) != NULL) + if (!node->local.disregard_inline_limits) + cgraph_set_inline_failed (node, N_("--param inline-unit-growth limit reached")); + fibheap_delete (heap); + free (heap_node); +} + +/* Decide on the inlining. We do so in the topological order to avoid + expenses on updating data structures. */ + +static void +cgraph_decide_inlining (void) +{ + struct cgraph_node *node; + int nnodes; + struct cgraph_node **order = + xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); + int old_insns = 0; + int i; + + for (node = cgraph_nodes; node; node = node->next) + initial_insns += node->local.self_insns; + overall_insns = initial_insns; + + nnodes = cgraph_postorder (order); + + if (dump_file) + fprintf (dump_file, + "\nDeciding on inlining. Starting with %i insns.\n", + initial_insns); + + for (node = cgraph_nodes; node; node = node->next) + node->aux = 0; + + if (dump_file) + fprintf (dump_file, "\nInlining always_inline functions:\n"); + + /* In the first pass mark all always_inline edges. Do this with a priority + so none of our later choices will make this impossible. */ + for (i = nnodes - 1; i >= 0; i--) + { + struct cgraph_edge *e, *next; + + node = order[i]; + + if (!node->local.disregard_inline_limits) + continue; + if (dump_file) + fprintf (dump_file, + "\nConsidering %s %i insns (always inline)\n", + cgraph_node_name (node), node->global.insns); + old_insns = overall_insns; + for (e = node->callers; e; e = next) + { + next = e->next_caller; + if (!e->inline_failed) + continue; + if (cgraph_recursive_inlining_p (e->caller, e->callee, + &e->inline_failed)) + continue; + cgraph_mark_inline_edge (e); + if (dump_file) + fprintf (dump_file, + " Inlined into %s which now has %i insns.\n", + cgraph_node_name (e->caller), + e->caller->global.insns); + } + if (dump_file) + fprintf (dump_file, + " Inlined for a net change of %+i insns.\n", + overall_insns - old_insns); + } + + if (!flag_really_no_inline) + { + cgraph_decide_inlining_of_small_functions (); + + if (dump_file) + fprintf (dump_file, "\nDeciding on functions called once:\n"); + + /* And finally decide what functions are called once. */ + + for (i = nnodes - 1; i >= 0; i--) + { + node = order[i]; + + if (node->callers && !node->callers->next_caller && !node->needed + && node->local.inlinable && node->callers->inline_failed + && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl)) + { + bool ok = true; + struct cgraph_node *node1; + + /* Verify that we won't duplicate the caller. */ + for (node1 = node->callers->caller; + node1->callers && !node1->callers->inline_failed + && ok; node1 = node1->callers->caller) + if (node1->callers->next_caller || node1->needed) + ok = false; + if (ok) + { + if (dump_file) + fprintf (dump_file, + "\nConsidering %s %i insns.\n" + " Called once from %s %i insns.\n", + cgraph_node_name (node), node->global.insns, + cgraph_node_name (node->callers->caller), + node->callers->caller->global.insns); + + old_insns = overall_insns; + + if (cgraph_check_inline_limits (node->callers->caller, node, + NULL)) + { + cgraph_mark_inline (node->callers); + if (dump_file) + fprintf (dump_file, + " Inlined into %s which now has %i insns" + " for a net change of %+i insns.\n", + cgraph_node_name (node->callers->caller), + node->callers->caller->global.insns, + overall_insns - old_insns); + } + else + { + if (dump_file) + fprintf (dump_file, + " Inline limit reached, not inlined.\n"); + } + } + } + } + } + + /* We will never output extern functions we didn't inline. + ??? Perhaps we can prevent accounting of growth of external + inline functions. */ + cgraph_remove_unreachable_nodes (false, dump_file); + + if (dump_file) + fprintf (dump_file, + "\nInlined %i calls, eliminated %i functions, " + "%i insns turned to %i insns.\n\n", + ncalls_inlined, nfunctions_inlined, initial_insns, + overall_insns); + free (order); +} + +/* Decide on the inlining. We do so in the topological order to avoid + expenses on updating data structures. */ + +void +cgraph_decide_inlining_incrementally (struct cgraph_node *node) +{ + struct cgraph_edge *e; + + /* First of all look for always inline functions. */ + for (e = node->callees; e; e = e->next_callee) + if (e->callee->local.disregard_inline_limits + && e->inline_failed + && !cgraph_recursive_inlining_p (node, e->callee, &e->inline_failed) + /* ??? It is possible that renaming variable removed the function body + in duplicate_decls. See gcc.c-torture/compile/20011119-2.c */ + && DECL_SAVED_TREE (e->callee->decl)) + cgraph_mark_inline (e); + + /* Now do the automatic inlining. */ + if (!flag_really_no_inline) + for (e = node->callees; e; e = e->next_callee) + if (e->callee->local.inlinable + && e->inline_failed + && !e->callee->local.disregard_inline_limits + && !cgraph_recursive_inlining_p (node, e->callee, &e->inline_failed) + && cgraph_check_inline_limits (node, e->callee, &e->inline_failed) + && DECL_SAVED_TREE (e->callee->decl)) + { + if (cgraph_default_inline_p (e->callee)) + cgraph_mark_inline (e); + else + e->inline_failed + = N_("--param max-inline-insns-single limit reached"); + } +} + +/* When inlining shall be performed. */ +static bool +cgraph_gate_inlining (void) +{ + return flag_inline_trees; +} + +struct tree_opt_pass pass_ipa_inline = +{ + "inline", /* name */ + cgraph_gate_inlining, /* gate */ + cgraph_decide_inlining, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_INTEGRATION, /* tv_id */ + 0, /* properties_required */ + PROP_trees, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_cgraph | TODO_dump_func, /* todo_flags_finish */ + 0 /* letter */ +}; diff --git a/gcc/ipa.c b/gcc/ipa.c new file mode 100644 index 00000000000..fe1055dc12b --- /dev/null +++ b/gcc/ipa.c @@ -0,0 +1,207 @@ +/* Basic IPA optimizations and utilities. + Copyright (C) 2003, 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 "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "cgraph.h" + +/* Fill array order with all nodes with output flag set in the reverse + topological order. */ + +int +cgraph_postorder (struct cgraph_node **order) +{ + struct cgraph_node *node, *node2; + int stack_size = 0; + int order_pos = 0; + struct cgraph_edge *edge, last; + + struct cgraph_node **stack = + xcalloc (cgraph_n_nodes, sizeof (struct cgraph_node *)); + + /* We have to deal with cycles nicely, so use a depth first traversal + output algorithm. Ignore the fact that some functions won't need + to be output and put them into order as well, so we get dependencies + right through intline functions. */ + for (node = cgraph_nodes; node; node = node->next) + node->aux = NULL; + for (node = cgraph_nodes; node; node = node->next) + if (!node->aux) + { + node2 = node; + if (!node->callers) + node->aux = &last; + else + node->aux = node->callers; + while (node2) + { + while (node2->aux != &last) + { + edge = node2->aux; + if (edge->next_caller) + node2->aux = edge->next_caller; + else + node2->aux = &last; + if (!edge->caller->aux) + { + if (!edge->caller->callers) + edge->caller->aux = &last; + else + edge->caller->aux = edge->caller->callers; + stack[stack_size++] = node2; + node2 = edge->caller; + break; + } + } + if (node2->aux == &last) + { + order[order_pos++] = node2; + if (stack_size) + node2 = stack[--stack_size]; + else + node2 = NULL; + } + } + } + free (stack); + return order_pos; +} + +/* Perform reachability analysis and reclaim all unreachable nodes. + If BEFORE_INLINING_P is true this function is called before inlining + decisions has been made. If BEFORE_INLINING_P is false this function also + removes unneeded bodies of extern inline functions. */ + +bool +cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *dump_file) +{ + struct cgraph_node *first = (void *) 1; + struct cgraph_node *node; + bool changed = false; + int insns = 0; + +#ifdef ENABLE_CHECKING + verify_cgraph (); +#endif + if (dump_file) + fprintf (dump_file, "\nReclaiming functions:"); +#ifdef ENABLE_CHECKING + for (node = cgraph_nodes; node; node = node->next) + gcc_assert (!node->aux); +#endif + for (node = cgraph_nodes; node; node = node->next) + if (node->needed && !node->global.inlined_to + && ((!DECL_EXTERNAL (node->decl)) + || !node->analyzed + || before_inlining_p)) + { + node->aux = first; + first = node; + } + else + gcc_assert (!node->aux); + + /* Perform reachability analysis. As a special case do not consider + extern inline functions not inlined as live because we won't output + them at all. */ + while (first != (void *) 1) + { + struct cgraph_edge *e; + node = first; + first = first->aux; + + for (e = node->callees; e; e = e->next_callee) + if (!e->callee->aux + && node->analyzed + && (!e->inline_failed || !e->callee->analyzed + || (!DECL_EXTERNAL (e->callee->decl)) + || before_inlining_p)) + { + e->callee->aux = first; + first = e->callee; + } + } + + /* Remove unreachable nodes. Extern inline functions need special care; + Unreachable extern inline functions shall be removed. + Reachable extern inline functions we never inlined shall get their bodies + eliminated. + Reachable extern inline functions we sometimes inlined will be turned into + unanalyzed nodes so they look like for true extern functions to the rest + of code. Body of such functions is released via remove_node once the + inline clones are eliminated. */ + for (node = cgraph_nodes; node; node = node->next) + { + if (!node->aux) + { + int local_insns; + tree decl = node->decl; + + node->global.inlined_to = NULL; + if (DECL_STRUCT_FUNCTION (decl)) + local_insns = node->local.self_insns; + else + local_insns = 0; + if (dump_file) + fprintf (dump_file, " %s", cgraph_node_name (node)); + if (!node->analyzed || !DECL_EXTERNAL (node->decl) + || before_inlining_p) + cgraph_remove_node (node); + else + { + struct cgraph_edge *e; + + for (e = node->callers; e; e = e->next_caller) + if (e->caller->aux) + break; + if (e || node->needed) + { + struct cgraph_node *clone; + + for (clone = node->next_clone; clone; + clone = clone->next_clone) + if (clone->aux) + break; + if (!clone) + { + DECL_SAVED_TREE (node->decl) = NULL; + DECL_STRUCT_FUNCTION (node->decl) = NULL; + DECL_INITIAL (node->decl) = error_mark_node; + node->analyzed = false; + } + cgraph_node_remove_callees (node); + node->analyzed = false; + } + else + cgraph_remove_node (node); + } + if (!DECL_SAVED_TREE (decl)) + insns += local_insns; + changed = true; + } + } + for (node = cgraph_nodes; node; node = node->next) + node->aux = NULL; + if (dump_file) + fprintf (dump_file, "\nReclaimed %i insns", insns); + return changed; +} diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index cd374a2d8e9..9cfbe0a5165 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,267 @@ +2005-05-19 Paolo Bonzini + + PR java/17845 + + * parse.y (register_package, package_list): Remove. + (package_declaration): Do not call register_package. + (do_resolve_class): Do not use package_list. + +2005-05-15 Gerald Pfeifer + + * jcf-write.c (generate_bytecode_insns) : Remove + unused variable. + +2005-05-15 Tom Tromey + + PR java/21519: + * jcf-write.c (generate_bytecode_insns) : Don't call + NOTE_PUSH. + +2005-05-12 Aaron Luchko + + * gcj.texi: Add '-verify', '-noverify', and '-verifyremote'. + +2005-05-11 Tom Tromey + + * gcj.texi (Code Generation): Document -fbootstrap-classes. + * decl.c (GCJ_BOOTSTRAP_LOADER_ADDITION): New macro. + (parse_version): Use it. + * lang.opt (-fbootstrap-classes): New option. + +2005-05-10 Paolo Bonzini + + PR java/21436 + * class.c (maybe_layout_super_class): Look for imports in this_class. + * parse.h (ctxp_for_generation_last): New. + (do_resolve_class): Add a parameter. + * parse.y (ctxp_for_generation_last): New. + (java_pop_parser_context): Add at end of list. + (find_in_imports, find_in_imports_on_demand): Look in ctxp + if the TYPE_IMPORT_LIST or respectively the TYPE_IMPORT_DEMAND_LIST of + the given type are NULL. + (do_resolve_class): Look into the imports of the new second parameter. + Adjust recursive calls. + (resolve_class, resolve_inner_class, find_as_inner_class): Adjust + calls to do_resolve_class. + (create_class): Set the TYPE_IMPORT_LIST and TYPE_IMPORT_DEMAND_LIST. + (java_complete_class): Do not do that here. + +2005-05-03 Thomas Fitzsimmons + + PR java/20309 + * Make-lang.in (java): Add gjnih. + (JAVA_TARGET_INDEPENDENT_BIN_TOOLS): Likewise. + (GJNIH_OBJS): New variable. + (gjnih$(exeext)): New target. + (JAVA_MANFILES): Add gjnih.1. + (java.uninstall): Add gjnih.1. + (java.mostlyclean): Add gjnih. + (java.maintainer-clean): Add gjnih.1. + (java/gjavah-jni.o): New target. + (.INTERMEDIATE): Add gjnih.pod. + (gjnih.pod): New target. + * config-lang.in (stagestuff): Add gjnih. + * gcj.texi (Top): Add gjnih node. + (Invoking gcjh): Add descriptions of -force, -old, -trace, -J and + -bootclasspath options. + (Invoking gjnih): New node. + * gjavah.c Initialize flag_jni to 1 if JNI_DEFAULT is defined. + (TOOLNAME): New macro. + (error): Replace hard-coded gcjh with TOOLNAME. + (process_file): Likewise. + (usage): Likewise. + (version): Likewise. + (help): Likewise. Add help output for -force, -old, -trace and -J + options. + (OPT_FORCE, OPT_OLD, OPT_TRACE): New macros. + (options): Add force, old, trace and J fields. + (main): Handle -force, -old, -trace and -J options. + +2005-05-03 Tom Tromey + + PR java/21245: + * gjavah.c (main): Unlink output file on error. + +2005-05-03 Kazu Hirata + + * constants.c, jvgenmain.c, lang.opt, resource.c: Update + copyright. + +2005-04-29 Tom Tromey + + * expr.c (build_jni_stub): Updated for change to build_block. + +2005-04-29 Andrew Pinski + + * expr.c (force_evaluation_order): Declare 'saved' earlier. + +2005-04-28 Andrew Haley + + PR java/19285 + * java-tree.h (soft_resolvepoolentry_node): New. + (alloc_constant_fieldref): Declare. + * expr.c (expand_java_field_op): Don't call class_init for + accesses to static fields with indirect dispatch. + * builtins.c (initialize_builtins): Add "__builtin_expect". + * decl.c (soft_resolvepoolentry_node): New variable. + (java_init_decl_processing): Create a decl for + "_Jv_ResolvePoolEntry". + * class.c (build_fieldref_cache_entry): New function. + (build_static_field_ref): Rewrite for indirect dispatch. + * constants.c (find_name_and_type_constant_tree): New function. + (alloc_constant_fieldref): Likewise. + (build_constants_constructor): Handle CONSTANT_Fieldref and + CONSTANT_NameAndType. + + PR java/21115 + * expr.c (force_evaluation_order): Convert outgoing args smaller + than integer. + +2005-04-27 Bryce McKinlay + + * gcj.texi (libgcj Runtime Properties): Remove obsolete + gnu.gcj.runtime.NameFinder.* system properties. Update documentation + for gnu.gcj.runtime.NameFinder.use_addr2line and gnu.gcj.progname. + +2005-04-25 Kaveh R. Ghazi + + * gjavah.c, jcf-dump.c, jv-scan.c, jvgenmain.c: Replace calls + to `unlock_stream' with `unlock_std_streams'. + +2005-04-25 Jakub Jelinek + + * Make-lang.in (java/decl.o, java/resource.o): Depend on $(EXPR_H) + instead of just expr.h. + +2005-04-24 Kaveh R. Ghazi + + * gjavah.c (main): Unlock the stdio streams. + * jcf-dump.c (main): Likewise. + * jv-scan.c (main): Likewise. + * jvgenmain.c (main): Likewise. + +2005-04-23 DJ Delorie + + * class.c, decl.c, expr.c, jcf-io.c, jcf-parse.c, jv-scan.c, + parse.y: Adjust warning() callers. + +2005-04-21 Bryce McKinlay + + * gcj.texi (Object fields): Change "Integer" to "Int" in example + contructor. + +2005-04-20 Bryce McKinlay + + * gcj.texi: Fix typos and bogus example. + +2005-04-19 Kazu Hirata + + * except.c: Fix a comment typo. + +2005-04-19 Julian Brown + + * decl.c (finish_method): Revert patch from 2005-04-13 for breaking + indirect dispatch with PIC. + +2005-04-18 Andrew Haley + + * java-except.h (struct eh_range.handler): Remove unused field. + (handle_nested_ranges): Remove function declaration. + (sanity_check_exception_range): Add function declaration. + * verify.c (verify_jvm_instructions): Remove call to + handle_nested_ranges. + * verify-glue.c (verify_jvm_instructions_new): Call + sanity_check_exception_range. + * except.c (link_handler, eh_range_freelist, link_handler, + handle_nested_ranges): Remove. + (add_handler): Rewrite. + (sanity_check_exception_range): New function. + (print_ranges): New function. + +2005-04-13 Julian Brown + + * decl.c (finish_method): Give methods once-only linkage. + +2005-04-11 Richard Sandiford + + * lang.opt: Refer to the GCC internals documentation instead of c.opt. + +2005-04-07 Kaveh R. Ghazi + + * java-tree.h: Don't use PARAMS(). + +2005-04-07 Per Bothner + + * class.c (push_class): By default, suppress debug output. + (finish_class): Enable debug output for classes we're emitting. + +2005-04-07 Andrew Haley + + * gcj.texi: Correct gcj-dbtool instructions. + +2005-04-04 Kazu Hirata + + * gcj.texi: Fix a typo. + * lang.c: Fix a comment typo. + +2005-04-01 Thomas Fitzsimmons + + * gcj.texi (Invoking gij): Add descriptions of new -X options. + Mention recognized-and-ignored compatibility options. + (Memory allocation): Add descriptions of JvMalloc, JvRealloc and + JvFree. + (About CNI): Add Memory allocation section. + +2005-04-01 Tom Tromey + + * decl.c (java_init_decl_processing): Fix types of + _Jv_MonitorEnter, _Jv_MonitorExit, _Jv_AllocObject, + _Jv_AllocObjectNoFinalizer, _Jv_Throw, _Jv_NewPrimArray, + _Jv_JNI_PopSystemFrame, _Jv_divI, _Jv_remI, _Jv_divJ, _Jv_remJ. + +2005-03-31 Jan Hubicka + + * Make-lang.in (class.o, decl.o): Depend on cgraph.h. + * class.c: Include cgraph.h + (make_local_functoin_alias): Mark aslias as needed. + * resource.c: Include cgraph.h + (compile_resource_data): Go via cgraph interface. + +2005-03-30 Ian Lance Taylor + + * parse.y (maybe_yank_clinit): Don't crash if bbody is NULL. + +2005-03-30 Tom Tromey + + * jcf-dump.c (HANDLE_INNERCLASSES_ATTRIBUTE): Handle cases where + inner_class_info_index==0 or outer_class_info_index==0. + +2005-03-29 Tom Tromey + + * gcj.texi (libgcj Runtime Properties): Document + gnu.gcj.runtime.endorsed.dirs. + +2005-03-24 Anthony Green + + * gcj.texi (Invoking gcj-dbtool): Document new LIBDIR option to + 'gcj-dbtool -p'. + +2005-03-23 Tom Tromey + + * decl.c (GCJ_CURRENT_BC_ABI_VERSION): New define. + (parse_version): Use it. + +2005-03-23 Joseph S. Myers + + * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove. + +2005-03-18 Andrew Haley + + PR java/20522 + * decl.c (update_aliases): Don't update variables that are about + to die. + (maybe_poplevels): Add comment. + 2005-03-17 Bryce McKinlay PR java/20502 @@ -15231,7 +15495,7 @@ (CLASS_P): Moved around. (java_parse_abort_on_error): Macro moved from jcf-parse.c * jcf-parse.c (java_parse_abort_on_error): Macro moved to - java-parse.h + java-tree.h (jcf_parse_source): Changed leading comment. Removed unnecessary fclose and CLASS_FROM_SOURCE_P marking. (parse_source_file): New local variables remember_for_generation diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in index a6d201379d9..17aa70a7a94 100644 --- a/gcc/java/Make-lang.in +++ b/gcc/java/Make-lang.in @@ -49,11 +49,12 @@ GCJ = gcj # Define the names for selecting java in LANGUAGES. java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) \ - gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext) + gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext) \ + gjnih$(exeext) # Define the name of target independent tools to be installed in $(bindir) # Names are subject to changes -JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump +JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh gjnih jv-scan jcf-dump # Tell GNU make to ignore these if they exist. .PHONY: java @@ -112,6 +113,10 @@ GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ java/win32-host.o java/zextract.o version.o errors.o ggc-none.o \ intl.o +GJNIH_OBJS = java/gjavah-jni.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ + java/win32-host.o java/zextract.o version.o errors.o \ + ggc-none.o intl.o + JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o intl.o JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \ @@ -138,6 +143,10 @@ gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS) rm -f $@ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJH_OBJS) $(CPPLIBS) $(ZLIB) $(LIBS) +gjnih$(exeext): $(GJNIH_OBJS) $(LIBDEPS) + rm -f $@ + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GJNIH_OBJS) $(CPPLIBS) $(ZLIB) $(LIBS) + jv-scan$(exeext): $(JVSCAN_OBJS) $(LIBDEPS) rm -f $@ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JVSCAN_OBJS) $(LIBICONV) $(LIBS) @@ -175,7 +184,7 @@ dvi:: doc/gcj.dvi html:: $(htmldir)/java/index.html JAVA_MANFILES = doc/gcj.1 doc/gcjh.1 doc/jv-scan.1 doc/jcf-dump.1 doc/gij.1 \ doc/jv-convert.1 doc/grmic.1 doc/grmiregistry.1 \ - doc/gcj-dbtool.1 + doc/gcj-dbtool.1 doc/gjnih.1 java.man: $(JAVA_MANFILES) @@ -231,6 +240,7 @@ java.uninstall: -rm -rf $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext) -rm -rf $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/gcjh$(man1ext) + -rm -rf $(DESTDIR)$(man1dir)/gjnih$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/jv-scan$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/jcf-dump$(man1ext) -rm -rf $(DESTDIR)$(man1dir)/gij$(man1ext) @@ -248,13 +258,14 @@ java.mostlyclean: -rm -f java/parse.c java/parse-scan.c -rm -f java/*$(objext) $(DEMANGLER_PROG) -rm -f java/*$(coverageexts) - -rm -f jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext) s-java + -rm -f jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) \ + gjnih$(exeext) jv-scan$(exeext) jcf-dump$(exeext) s-java java.clean: java.distclean: -rm -f java/config.status java/Makefile -rm -f java/parse.output java/y.tab.c java.maintainer-clean: - -rm -f $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 + -rm -f $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 $(docobjdir)/gjnih.1 -rm -f $(docobjdir)/jv-scan.1 $(docobjdir)/jcf-dump.1 -rm -f $(docobjdir)/gij.1 -rm -f $(docobjdir)/jv-convert.1 @@ -299,13 +310,13 @@ java/check-init.o: java/check-init.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \ coretypes.h $(TM_H) toplev.h java/class.o: java/class.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(JAVA_TREE_H) $(RTL_H) java/jcf.h java/parse.h toplev.h output.h $(GGC_H) \ - $(TARGET_H) function.h gt-java-class.h + $(TARGET_H) function.h gt-java-class.h cgraph.h java/constants.o: java/constants.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-constants.h java/decl.o: java/decl.c $(CONFIG_H) $(JAVA_TREE_H) $(RTL_H) java/jcf.h \ - toplev.h flags.h $(SYSTEM_H) coretypes.h $(TM_H) function.h expr.h \ + toplev.h flags.h $(SYSTEM_H) coretypes.h $(TM_H) function.h $(EXPR_H) \ libfuncs.h except.h java/java-except.h $(GGC_H) real.h gt-java-decl.h \ - target.h + target.h cgraph.h java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h real.h \ $(RTL_H) java/javaop.h java/java-opcodes.h except.h java/java-except.h \ toplev.h $(SYSTEM_H) coretypes.h $(TM_H) function.h @@ -334,7 +345,7 @@ java/mangle_name.o: java/mangle_name.c $(CONFIG_H) java/jcf.h $(JAVA_TREE_H) \ $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(GGC_H) java/resource.o: java/resource.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(JAVA_TREE_H) $(RTL_H) java/jcf.h java/parse.h toplev.h output.h $(GGC_H) \ - $(TARGET_H) function.h gt-java-resource.h expr.h + $(TARGET_H) function.h gt-java-resource.h $(EXPR_H) java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \ java/convert.h toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) real.h java/win32-host.o: java/win32-host.c $(CONFIG_H) $(SYSTEM_H) coretypes.h java/jcf.h @@ -370,6 +381,14 @@ java/jcf-path.o: java/jcf-path.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ -DDEFAULT_TARGET_VERSION=\"$(version)\" \ $(srcdir)/java/jcf-path.c $(OUTPUT_OPTION) +# create gjnih's object +java/gjavah-jni.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(JAVA_TREE_H) \ + java/gjavah.c java/jcf-reader.c java/jcf.h java/javaop.h version.h $(GGC_H) \ + intl.h + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(ZLIBINC) \ + -DJNI_DEFAULT=1 \ + $(srcdir)/java/gjavah.c $(OUTPUT_OPTION) + TEXI_JAVA_FILES = java/gcj.texi $(docdir)/include/fdl.texi \ $(docdir)/include/gpl.texi $(docdir)/include/gcc-common.texi \ gcc-vers.texi @@ -390,12 +409,14 @@ $(htmldir)/java/index.html: $(TEXI_JAVA_FILES) $(TEXI2HTML) -I $(docdir)/include -I $(srcdir)/java -o $(@D) $< .INTERMEDIATE: gcj.pod gcjh.pod jv-scan.pod jcf-dump.pod gij.pod \ - jv-convert.pod grmic.pod grmiregistry.pod gcj-dbtool.pod + jv-convert.pod grmic.pod grmiregistry.pod gcj-dbtool.pod gjnih.pod gcj.pod: java/gcj.texi -$(TEXI2POD) -D gcj < $< > $@ gcjh.pod: java/gcj.texi -$(TEXI2POD) -D gcjh < $< > $@ +gjnih.pod: java/gcj.texi + -$(TEXI2POD) -D gjnih < $< > $@ jv-scan.pod: java/gcj.texi -$(TEXI2POD) -D jv-scan < $< > $@ jcf-dump.pod: java/gcj.texi diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c index f4a8efb2a1b..dcfff1c1ef5 100644 --- a/gcc/java/builtins.c +++ b/gcc/java/builtins.c @@ -161,6 +161,7 @@ initialize_builtins (void) { tree double_ftype_double, double_ftype_double_double; tree float_ftype_float, float_ftype_float_float; + tree boolean_ftype_boolean_boolean; tree t; int i; @@ -216,7 +217,14 @@ initialize_builtins (void) double_ftype_double, "_ZN4java4lang4Math4sqrtEd"); define_builtin (BUILT_IN_TAN, "__builtin_tan", double_ftype_double, "_ZN4java4lang4Math3tanEd"); - + + t = tree_cons (NULL_TREE, boolean_type_node, end_params_node); + t = tree_cons (NULL_TREE, boolean_type_node, t); + boolean_ftype_boolean_boolean = build_function_type (boolean_type_node, t); + define_builtin (BUILT_IN_EXPECT, "__builtin_expect", + boolean_ftype_boolean_boolean, + "__builtin_expect"); + build_common_builtin_nodes (); } diff --git a/gcc/java/class.c b/gcc/java/class.c index 5e2e535dbc9..9ab88570d03 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -45,6 +45,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "except.h" #include "cgraph.h" #include "tree-iterator.h" +#include "cgraph.h" /* DOS brain-damage */ #ifndef O_BINARY @@ -422,6 +423,7 @@ push_class (tree class_type, tree class_name) #endif CLASS_P (class_type) = 1; decl = build_decl (TYPE_DECL, class_name, class_type); + TYPE_DECL_SUPPRESS_DEBUG (decl) = 1; /* dbxout needs a DECL_SIZE if in gstabs mode */ DECL_SIZE (decl) = integer_zero_node; @@ -786,9 +788,9 @@ void set_constant_value (tree field, tree constant) { if (field == NULL_TREE) - warning ("misplaced ConstantValue attribute (not in any field)"); + warning (0, "misplaced ConstantValue attribute (not in any field)"); else if (DECL_INITIAL (field) != NULL_TREE) - warning ("duplicate ConstantValue attribute for field '%s'", + warning (0, "duplicate ConstantValue attribute for field '%s'", IDENTIFIER_POINTER (DECL_NAME (field))); else { @@ -910,6 +912,7 @@ build_utf8_ref (tree name) layout_decl (decl, 0); pushdecl (decl); rest_of_decl_compilation (decl, global_bindings_p (), 0); + cgraph_varpool_mark_needed_node (cgraph_varpool_node (decl)); utf8_decl_list = decl; make_decl_rtl (decl); ref = build1 (ADDR_EXPR, utf8const_ptr_type, decl); @@ -1034,6 +1037,31 @@ build_class_ref (tree type) return build_indirect_class_ref (type); } +/* Create a local statically allocated variable that will hold a + pointer to a static field. */ + +static tree +build_fieldref_cache_entry (int index, tree fdecl ATTRIBUTE_UNUSED) +{ + tree decl, decl_name; + const char *name = IDENTIFIER_POINTER (mangled_classname ("_cpool_", output_class)); + char *buf = alloca (strlen (name) + 20); + sprintf (buf, "%s_%d_ref", name, index); + decl_name = get_identifier (buf); + decl = IDENTIFIER_GLOBAL_VALUE (decl_name); + if (decl == NULL_TREE) + { + decl = build_decl (VAR_DECL, decl_name, ptr_type_node); + TREE_STATIC (decl) = 1; + TREE_PUBLIC (decl) = 0; + DECL_EXTERNAL (decl) = 0; + DECL_ARTIFICIAL (decl) = 1; + make_decl_rtl (decl); + pushdecl_top_level (decl); + } + return decl; +} + tree build_static_field_ref (tree fdecl) { @@ -1059,59 +1087,47 @@ build_static_field_ref (tree fdecl) DECL_EXTERNAL (fdecl) = 1; make_decl_rtl (fdecl); } - return fdecl; } - - if (flag_indirect_dispatch) + else { - tree table_index - = build_int_cst (NULL_TREE, get_symbol_table_index - (fdecl, &TYPE_ATABLE_METHODS (output_class))); - tree field_address - = build4 (ARRAY_REF, - TREE_TYPE (TREE_TYPE (TYPE_ATABLE_DECL (output_class))), - TYPE_ATABLE_DECL (output_class), table_index, - NULL_TREE, NULL_TREE); - field_address = convert (build_pointer_type (TREE_TYPE (fdecl)), - field_address); - return fold (build1 (INDIRECT_REF, TREE_TYPE (fdecl), - field_address)); - } - else - { - /* Compile as: - *(FTYPE*)build_class_ref(FCLASS)->fields[INDEX].info.addr */ - tree ref = build_class_ref (fclass); - tree fld; - int field_index = 0; - ref = build1 (INDIRECT_REF, class_type_node, ref); - ref = build3 (COMPONENT_REF, field_ptr_type_node, ref, - lookup_field (&class_type_node, fields_ident), - NULL_TREE); - - for (fld = TYPE_FIELDS (fclass); ; fld = TREE_CHAIN (fld)) - { - if (fld == fdecl) - break; - if (fld == NULL_TREE) - fatal_error ("field '%s' not found in class", - IDENTIFIER_POINTER (DECL_NAME (fdecl))); - if (FIELD_STATIC (fld)) - field_index++; - } - field_index *= int_size_in_bytes (field_type_node); - ref = fold (build2 (PLUS_EXPR, field_ptr_type_node, - ref, build_int_cst (NULL_TREE, field_index))); - ref = build1 (INDIRECT_REF, field_type_node, ref); - ref = build3 (COMPONENT_REF, field_info_union_node, - ref, lookup_field (&field_type_node, info_ident), - NULL_TREE); - ref = build3 (COMPONENT_REF, ptr_type_node, - ref, TREE_CHAIN (TYPE_FIELDS (field_info_union_node)), - NULL_TREE); - ref = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (fdecl)), ref); - return fold (build1 (INDIRECT_REF, TREE_TYPE(fdecl), ref)); - } + /* Generate a CONSTANT_FieldRef for FDECL in the constant pool + and a class local static variable CACHE_ENTRY, then + + *(fdecl **)((__builtin_expect (cache_entry == null, false)) + ? cache_entry = _Jv_ResolvePoolEntry (output_class, cpool_index) + : cache_entry) + + This can mostly be optimized away, so that the usual path is a + load followed by a test and branch. _Jv_ResolvePoolEntry is + only called once for each constant pool entry. + + There is an optimization that we don't do: at the start of a + method, create a local copy of CACHE_ENTRY and use that instead. + + */ + + int cpool_index = alloc_constant_fieldref (output_class, fdecl); + tree cache_entry = build_fieldref_cache_entry (cpool_index, fdecl); + tree test + = build3 (CALL_EXPR, boolean_type_node, + build_address_of (built_in_decls[BUILT_IN_EXPECT]), + tree_cons (NULL_TREE, build2 (EQ_EXPR, boolean_type_node, + cache_entry, null_pointer_node), + build_tree_list (NULL_TREE, boolean_false_node)), + NULL_TREE); + tree cpool_index_cst = build_int_cst (NULL_TREE, cpool_index); + tree init + = build3 (CALL_EXPR, ptr_type_node, + build_address_of (soft_resolvepoolentry_node), + tree_cons (NULL_TREE, build_class_ref (output_class), + build_tree_list (NULL_TREE, cpool_index_cst)), + NULL_TREE); + init = build2 (MODIFY_EXPR, ptr_type_node, cache_entry, init); + init = build3 (COND_EXPR, ptr_type_node, test, init, cache_entry); + init = fold_convert (build_pointer_type (TREE_TYPE (fdecl)), init); + fdecl = build1 (INDIRECT_REF, TREE_TYPE (fdecl), init); + } + return fdecl; } int @@ -1414,7 +1430,7 @@ get_dispatch_table (tree type, tree this_class_addr) if (METHOD_ABSTRACT (method)) { if (! abstract_p) - warning ("%Jabstract method in non-abstract class", method); + warning (0, "%Jabstract method in non-abstract class", method); if (TARGET_VTABLE_USES_DESCRIPTORS) for (j = 0; j < TARGET_VTABLE_USES_DESCRIPTORS; ++j) @@ -1904,6 +1920,7 @@ finish_class (void) java_expand_catch_classes (current_class); current_function_decl = NULL_TREE; + TYPE_DECL_SUPPRESS_DEBUG (TYPE_NAME (current_class)) = 0; make_class_data (current_class); register_class (); rest_of_decl_compilation (TYPE_NAME (current_class), 1, 0); @@ -2068,7 +2085,7 @@ maybe_layout_super_class (tree super_class, tree this_class) DECL_SOURCE_LINE (this_decl), 0); #endif } - super_class = do_resolve_class (NULL_TREE, /* FIXME? */ + super_class = do_resolve_class (NULL_TREE, this_class, super_class, NULL_TREE, this_wrap); if (!super_class) return NULL_TREE; /* FIXME, NULL_TREE not checked by caller. */ @@ -2436,8 +2453,11 @@ emit_register_classes (tree *list_p) named_section_flags (JCR_SECTION_NAME, SECTION_WRITE); assemble_align (POINTER_SIZE); for (t = registered_class; t; t = TREE_CHAIN (t)) - assemble_integer (XEXP (DECL_RTL (t), 0), - POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); + { + mark_decl_referenced (t); + assemble_integer (XEXP (DECL_RTL (t), 0), + POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); + } #else /* A target has defined TARGET_USE_JCR_SECTION, but doesn't have a JCR_SECTION_NAME. */ diff --git a/gcc/java/config-lang.in b/gcc/java/config-lang.in index 41c5f915a71..2216c6b2318 100644 --- a/gcc/java/config-lang.in +++ b/gcc/java/config-lang.in @@ -34,7 +34,7 @@ language="java" compilers="jc1\$(exeext) jvgenmain\$(exeext)" -stagestuff="jc1\$(exeext) gcj\$(exeext) jvgenmain\$(exeext) gcjh\$(exeext) jv-scan\$(exeext) jcf-dump\$(exeext)" +stagestuff="jc1\$(exeext) gcj\$(exeext) jvgenmain\$(exeext) gcjh\$(exeext) gjnih\$(exeext) jv-scan\$(exeext) jcf-dump\$(exeext)" gtfiles="\$(srcdir)/java/java-tree.h \$(srcdir)/java/jcf.h \$(srcdir)/java/lex.h \$(srcdir)/java/parse.h \$(srcdir)/java/builtins.c \$(srcdir)/java/class.c \$(srcdir)/java/constants.c \$(srcdir)/java/decl.c \$(srcdir)/java/expr.c \$(srcdir)/java/jcf-parse.c \$(srcdir)/java/jcf-write.c \$(srcdir)/java/lang.c \$(srcdir)/java/mangle.c \$(srcdir)/java/parse.y \$(srcdir)/java/resource.c" diff --git a/gcc/java/constants.c b/gcc/java/constants.c index a5d9622bdab..99e156f3034 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -1,5 +1,5 @@ /* Handle the constant pool of the Java(TM) Virtual Machine. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -356,6 +356,41 @@ alloc_name_constant (int tag, tree name) return find_tree_constant (outgoing_cpool, tag, name); } +/* Create a constant pool entry for a name_and_type. This one has '.' + rather than '/' because it isn't going into a class file, it's + going into a compiled object. We don't use the '/' separator in + compiled objects. */ + +static int +find_name_and_type_constant_tree (CPool *cpool, tree name, tree type) +{ + int name_index = find_utf8_constant (cpool, name); + int type_index + = find_utf8_constant (cpool, + identifier_subst (build_java_signature (type), + "", '/', '.', "")); + return find_constant1 (cpool, CONSTANT_NameAndType, + (name_index << 16) | type_index); +} + +/* Look for a field ref that matches DECL in the constant pool of + CLASS. + Return the index of the entry. */ + +int +alloc_constant_fieldref (tree class, tree decl) +{ + CPool *outgoing_cpool = cpool_for_class (class); + int class_index + = find_tree_constant (outgoing_cpool, CONSTANT_Class, + DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl)))); + int name_type_index + = find_name_and_type_constant_tree (outgoing_cpool, DECL_NAME (decl), + TREE_TYPE (decl)); + return find_constant1 (outgoing_cpool, CONSTANT_Fieldref, + (class_index << 16) | name_type_index); +} + /* Build an identifier for the internal name of reference type TYPE. */ tree @@ -442,14 +477,33 @@ build_constants_constructor (void) tree data_list = NULL_TREE; int i; for (i = outgoing_cpool->count; --i > 0; ) - { - tags_list - = tree_cons (NULL_TREE, get_tag_node (outgoing_cpool->tags[i]), - tags_list); - data_list - = tree_cons (NULL_TREE, build_utf8_ref (outgoing_cpool->data[i].t), - data_list); - } + switch (outgoing_cpool->tags[i]) + { + case CONSTANT_Fieldref: + case CONSTANT_NameAndType: + { + jword temp = outgoing_cpool->data[i].w; + + tags_list + = tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, outgoing_cpool->tags[i]), + tags_list); + data_list + = tree_cons (NULL_TREE, + fold_convert (ptr_type_node, + (build_int_cst (NULL_TREE, temp))), + data_list); + } + break; + default: + tags_list + = tree_cons (NULL_TREE, get_tag_node (outgoing_cpool->tags[i]), + tags_list); + data_list + = tree_cons (NULL_TREE, build_utf8_ref (outgoing_cpool->data[i].t), + data_list); + break; + } if (outgoing_cpool->count > 0) { tree data_decl, tags_decl, tags_type; @@ -461,7 +515,7 @@ build_constants_constructor (void) data_list = tree_cons (NULL_TREE, null_pointer_node, data_list); data_decl = build_constant_data_ref (); - TREE_TYPE (data_decl) = build_array_type (ptr_type_node, index_type), + TREE_TYPE (data_decl) = build_array_type (ptr_type_node, index_type); DECL_INITIAL (data_decl) = build_constructor (TREE_TYPE (data_decl), data_list); DECL_SIZE (data_decl) = TYPE_SIZE (TREE_TYPE (data_decl)); diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 720b6322c99..a74e5186b7d 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -64,6 +64,17 @@ static void parse_version (void); /* Used when computing the ABI version. */ #define GCJ_BINARYCOMPAT_ADDITION 5 +/* Used when defining a class that should be loaded by the bootstrap + loader. */ +#define GCJ_BOOTSTRAP_LOADER_ADDITION 1 + +/* The version of the BC ABI that we generate. At the moment we are + compatible with what shipped in GCC 4.0. This must be kept in sync + with parse_version(), libgcj, and reality (if the BC format + changes, this must change. */ +#define GCJ_CURRENT_BC_ABI_VERSION \ + (4 * 10000 + 0 * 10 + GCJ_BINARYCOMPAT_ADDITION) + /* The ABI version number. */ tree gcj_abi_version; @@ -97,6 +108,9 @@ static int uniq; static GTY(()) tree pending_local_decls; +/* The decl for "_Jv_ResolvePoolEntry". */ +tree soft_resolvepoolentry_node; + #if defined(DEBUG_JAVA_BINDING_LEVELS) int binding_depth = 0; int is_class_level = 0; @@ -149,7 +163,10 @@ update_aliases (tree decl, int index, int pc) && LOCAL_SLOT_P (tmp) == 0 && (pc == -1 || (pc >= DECL_LOCAL_START_PC (tmp) - && pc <= DECL_LOCAL_END_PC (tmp))) + && pc < DECL_LOCAL_END_PC (tmp))) + /* This test is < (rather than <=) because there's no point + updating an alias that's about to die at the end of this + instruction. */ && (tmp_type == decl_type || (INTEGRAL_TYPE_P (tmp_type) && INTEGRAL_TYPE_P (decl_type) @@ -606,7 +623,9 @@ parse_version (void) (objects generated by different version of gcj), but will probably always require strict matching for ordinary ABI. */ if (flag_indirect_dispatch) - abi_version += GCJ_BINARYCOMPAT_ADDITION; + abi_version = GCJ_CURRENT_BC_ABI_VERSION; + if (flag_bootstrap_classes) + abi_version += GCJ_BOOTSTRAP_LOADER_ADDITION; gcj_abi_version = build_int_cstu (ptr_type_node, abi_version); } @@ -989,8 +1008,7 @@ java_init_decl_processing (void) endlink = end_params_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE); - t = tree_cons (NULL_TREE, class_ptr_type, - tree_cons (NULL_TREE, int_type_node, endlink)); + t = tree_cons (NULL_TREE, class_ptr_type, endlink); alloc_object_node = builtin_function ("_Jv_AllocObject", build_function_type (ptr_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); @@ -1006,33 +1024,41 @@ java_init_decl_processing (void) build_function_type (void_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); - + t = tree_cons (NULL_TREE, class_ptr_type, + tree_cons (NULL_TREE, int_type_node, endlink)); + soft_resolvepoolentry_node + = builtin_function ("_Jv_ResolvePoolEntry", + build_function_type (ptr_type_node, t), + 0,NOT_BUILT_IN, NULL, NULL_TREE); + DECL_IS_PURE (soft_resolvepoolentry_node) = 1; throw_node = builtin_function ("_Jv_Throw", - build_function_type (ptr_type_node, t), + build_function_type (void_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); /* Mark throw_nodes as `noreturn' functions with side effects. */ TREE_THIS_VOLATILE (throw_node) = 1; TREE_SIDE_EFFECTS (throw_node) = 1; - t = build_function_type (int_type_node, endlink); + t = build_function_type (void_type_node, tree_cons (NULL_TREE, ptr_type_node, + endlink)); soft_monitorenter_node = builtin_function ("_Jv_MonitorEnter", t, 0, NOT_BUILT_IN, NULL, NULL_TREE); soft_monitorexit_node = builtin_function ("_Jv_MonitorExit", t, 0, NOT_BUILT_IN, NULL, NULL_TREE); - - t = tree_cons (NULL_TREE, int_type_node, + + t = tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, int_type_node, endlink)); soft_newarray_node = builtin_function ("_Jv_NewPrimArray", - build_function_type(ptr_type_node, t), + build_function_type (ptr_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); DECL_IS_MALLOC (soft_newarray_node) = 1; t = tree_cons (NULL_TREE, int_type_node, tree_cons (NULL_TREE, class_ptr_type, - tree_cons (NULL_TREE, object_ptr_type_node, endlink))); + tree_cons (NULL_TREE, object_ptr_type_node, + endlink))); soft_anewarray_node = builtin_function ("_Jv_NewObjectArray", build_function_type (ptr_type_node, t), @@ -1118,9 +1144,11 @@ java_init_decl_processing (void) 0, NOT_BUILT_IN, NULL, NULL_TREE); soft_jnipopsystemframe_node = builtin_function ("_Jv_JNI_PopSystemFrame", - build_function_type (ptr_type_node, t), + build_function_type (void_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); + t = tree_cons (NULL_TREE, int_type_node, + tree_cons (NULL_TREE, int_type_node, endlink)); soft_idiv_node = builtin_function ("_Jv_divI", build_function_type (int_type_node, t), @@ -1131,6 +1159,8 @@ java_init_decl_processing (void) build_function_type (int_type_node, t), 0, NOT_BUILT_IN, NULL, NULL_TREE); + t = tree_cons (NULL_TREE, long_type_node, + tree_cons (NULL_TREE, long_type_node, endlink)); soft_ldiv_node = builtin_function ("_Jv_divJ", build_function_type (long_type_node, t), @@ -1331,7 +1361,7 @@ pushdecl (tree x) warnstring = "declaration of %qs shadows global declaration"; if (warnstring) - warning (warnstring, IDENTIFIER_POINTER (name)); + warning (0, warnstring, IDENTIFIER_POINTER (name)); } #endif @@ -1634,7 +1664,7 @@ poplevel (int keep, int reverse, int functionbody) define_label (input_location, DECL_NAME (label)); } else if (warn_unused[UNUSED_LABEL] && !TREE_USED (label)) - warning ("%Jlabel '%D' defined but not used", label, label); + warning (0, "%Jlabel '%D' defined but not used", label, label); IDENTIFIER_LABEL_VALUE (DECL_NAME (label)) = 0; /* Put the labels into the "variables" of the @@ -1741,6 +1771,12 @@ maybe_poplevels (int pc) current_pc = pc; #endif + /* FIXME: I'm pretty sure that this is wrong. Variable scopes are + inclusive, so a variable is live if pc == end_pc. Here, we + terminate a range if the current pc is equal to the end of the + range, and this is *before* we have generated code for the + instruction at end_pc. We're closing a binding level one + instruction too early.*/ while (current_binding_level->end_pc <= pc) poplevel (1, 0, 0); } @@ -1756,7 +1792,7 @@ force_poplevels (int start_pc) while (current_binding_level->start_pc > start_pc) { if (pedantic && current_binding_level->start_pc > start_pc) - warning ("%JIn %D: overlapped variable and exception ranges at %d", + warning (0, "%JIn %D: overlapped variable and exception ranges at %d", current_function_decl, current_function_decl, current_binding_level->start_pc); poplevel (1, 0, 0); @@ -1820,7 +1856,7 @@ give_name_to_locals (JCF *jcf) DECL_NAME (decl) = name; SET_DECL_ASSEMBLER_NAME (decl, name); if (TREE_CODE (decl) != PARM_DECL || TREE_TYPE (decl) != type) - warning ("bad type in parameter debug info"); + warning (0, "bad type in parameter debug info"); } else { @@ -1829,7 +1865,7 @@ give_name_to_locals (JCF *jcf) tree decl = build_decl (VAR_DECL, name, type); if (end_pc > DECL_CODE_LENGTH (current_function_decl)) { - warning ("%Jbad PC range for debug info for local '%D'", + warning (0, "%Jbad PC range for debug info for local '%D'", decl, decl); end_pc = DECL_CODE_LENGTH (current_function_decl); } diff --git a/gcc/java/except.c b/gcc/java/except.c index 6735b598311..6a336bf5889 100644 --- a/gcc/java/except.c +++ b/gcc/java/except.c @@ -1,5 +1,5 @@ /* Handle exceptions for GNU compiler for the Java(TM) language. - Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -42,7 +42,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ static void expand_start_java_handler (struct eh_range *); static struct eh_range *find_handler_in_range (int, struct eh_range *, struct eh_range *); -static void link_handler (struct eh_range *, struct eh_range *); static void check_start_handlers (struct eh_range *, int); static void free_eh_ranges (struct eh_range *range); @@ -50,8 +49,6 @@ struct eh_range *current_method_handlers; struct eh_range *current_try_block = NULL; -struct eh_range *eh_range_freelist = NULL; - /* These variables are used to speed up find_handler. */ static int cache_range_start, cache_range_end; @@ -62,12 +59,60 @@ static struct eh_range *cache_next_child; struct eh_range whole_range; +/* Check the invariants of the structure we're using to contain + exception regions. Either returns true or fails an assertion + check. */ + +bool +sanity_check_exception_range (struct eh_range *range) +{ + struct eh_range *ptr = range->first_child; + for (; ptr; ptr = ptr->next_sibling) + { + gcc_assert (ptr->outer == range + && ptr->end_pc > ptr->start_pc); + if (ptr->next_sibling) + gcc_assert (ptr->next_sibling->start_pc >= ptr->end_pc); + gcc_assert (ptr->start_pc >= ptr->outer->start_pc + && ptr->end_pc <= ptr->outer->end_pc); + (void) sanity_check_exception_range (ptr); + } + return true; +} + #if defined(DEBUG_JAVA_BINDING_LEVELS) -extern int binding_depth; extern int is_class_level; extern int current_pc; -extern void indent (); +extern int binding_depth; +extern void indent (void); +static void +print_ranges (struct eh_range *range) +{ + if (! range) + return; + struct eh_range *child = range->first_child; + + indent (); + fprintf (stderr, "handler pc %d --> %d ", range->start_pc, range->end_pc); + + tree handler = range->handlers; + for ( ; handler != NULL_TREE; handler = TREE_CHAIN (handler)) + { + tree type = TREE_PURPOSE (handler); + if (type == NULL) + type = throwable_type_node; + fprintf (stderr, " type=%s ", IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))); + } + fprintf (stderr, "\n"); + + int saved = binding_depth; + binding_depth++; + print_ranges (child); + binding_depth = saved; + + print_ranges (range->next_sibling); +} #endif /* Search for the most specific eh_range containing PC. @@ -117,114 +162,6 @@ find_handler (int pc) return find_handler_in_range (pc, h, cache_next_child); } -/* Recursive helper routine for check_nested_ranges. */ - -static void -link_handler (struct eh_range *range, struct eh_range *outer) -{ - struct eh_range **ptr; - - if (range->start_pc == outer->start_pc && range->end_pc == outer->end_pc) - { - outer->handlers = chainon (outer->handlers, range->handlers); - return; - } - - /* If the new range completely encloses the `outer' range, then insert it - between the outer range and its parent. */ - if (range->start_pc <= outer->start_pc && range->end_pc >= outer->end_pc) - { - range->outer = outer->outer; - range->next_sibling = NULL; - range->first_child = outer; - { - struct eh_range *p = outer; - struct eh_range **pr = &(outer->outer->first_child); - while (*pr != outer) - pr = &(*pr)->next_sibling; - *pr = range; - - while (p) - { - p->outer = range; - p = p->next_sibling; - } - } - return; - } - - /* Handle overlapping ranges by splitting the new range. */ - if (range->start_pc < outer->start_pc || range->end_pc > outer->end_pc) - { - struct eh_range *h = xmalloc (sizeof (struct eh_range)); - if (range->start_pc < outer->start_pc) - { - h->start_pc = range->start_pc; - h->end_pc = outer->start_pc; - range->start_pc = outer->start_pc; - } - else - { - h->start_pc = outer->end_pc; - h->end_pc = range->end_pc; - range->end_pc = outer->end_pc; - } - h->first_child = NULL; - h->outer = NULL; - h->handlers = build_tree_list (TREE_PURPOSE (range->handlers), - TREE_VALUE (range->handlers)); - h->next_sibling = NULL; - h->expanded = 0; - h->stmt = NULL; - /* Restart both from the top to avoid having to make this - function smart about reentrancy. */ - link_handler (h, &whole_range); - link_handler (range, &whole_range); - return; - } - - ptr = &outer->first_child; - for (;; ptr = &(*ptr)->next_sibling) - { - if (*ptr == NULL || range->end_pc <= (*ptr)->start_pc) - { - range->next_sibling = *ptr; - range->first_child = NULL; - range->outer = outer; - *ptr = range; - return; - } - else if (range->start_pc < (*ptr)->end_pc) - { - link_handler (range, *ptr); - return; - } - /* end_pc > (*ptr)->start_pc && start_pc >= (*ptr)->end_pc. */ - } -} - -/* The first pass of exception range processing (calling add_handler) - constructs a linked list of exception ranges. We turn this into - the data structure expected by the rest of the code, and also - ensure that exception ranges are properly nested. */ - -void -handle_nested_ranges (void) -{ - struct eh_range *ptr, *next; - - ptr = whole_range.first_child; - whole_range.first_child = NULL; - for (; ptr; ptr = next) - { - next = ptr->next_sibling; - ptr->next_sibling = NULL; - link_handler (ptr, &whole_range); - } -} - -/* Free RANGE as well as its children and siblings. */ - static void free_eh_ranges (struct eh_range *range) { @@ -252,55 +189,166 @@ method_init_exceptions (void) cache_range_start = 0xFFFFFF; } -/* Add an exception range. If we already have an exception range - which has the same handler and label, and the new range overlaps - that one, then we simply extend the existing range. Some bytecode - obfuscators generate seemingly nonoverlapping exception ranges - which, when coalesced, do in fact nest correctly. - - This constructs an ordinary linked list which check_nested_ranges() - later turns into the data structure we actually want. +/* Split an exception range into two at PC. The sub-ranges that + belong to the range are split and distributed between the two new + ranges. */ + +static void +split_range (struct eh_range *range, int pc) +{ + struct eh_range *ptr; + struct eh_range **first_child, **second_child; + struct eh_range *h; + + /* First, split all the sub-ranges. */ + for (ptr = range->first_child; ptr; ptr = ptr->next_sibling) + { + if (pc > ptr->start_pc + && pc < ptr->end_pc) + { + split_range (ptr, pc); + } + } + + /* Create a new range. */ + h = xmalloc (sizeof (struct eh_range)); + + h->start_pc = pc; + h->end_pc = range->end_pc; + h->next_sibling = range->next_sibling; + range->next_sibling = h; + range->end_pc = pc; + h->handlers = build_tree_list (TREE_PURPOSE (range->handlers), + TREE_VALUE (range->handlers)); + h->next_sibling = NULL; + h->expanded = 0; + h->stmt = NULL; + h->outer = range->outer; + h->first_child = NULL; + + ptr = range->first_child; + first_child = &range->first_child; + second_child = &h->first_child; + + /* Distribute the sub-ranges between the two new ranges. */ + for (ptr = range->first_child; ptr; ptr = ptr->next_sibling) + { + if (ptr->start_pc < pc) + { + *first_child = ptr; + ptr->outer = range; + first_child = &ptr->next_sibling; + } + else + { + *second_child = ptr; + ptr->outer = h; + second_child = &ptr->next_sibling; + } + } + *first_child = NULL; + *second_child = NULL; +} + + +/* Add an exception range. + + There are some missed optimization opportunities here. For + example, some bytecode obfuscators generate seemingly + nonoverlapping exception ranges which, when coalesced, do in fact + nest correctly. We could merge these, but we'd have to fix up all + the enclosed regions first and perhaps create a new range anyway if + it overlapped existing ranges. - We expect the input to come in order of increasing START_PC. This - function doesn't attempt to detect the case where two previously - added disjoint ranges could be coalesced by a new range; that is - what the sorting counteracts. */ + Also, we don't attempt to detect the case where two previously + added disjoint ranges could be coalesced by a new range. */ -void +void add_handler (int start_pc, int end_pc, tree handler, tree type) { - struct eh_range *ptr, *prev = NULL, *h; + struct eh_range *ptr, *h; + struct eh_range **first_child, **prev; + /* First, split all the existing ranges that we need to enclose. */ for (ptr = whole_range.first_child; ptr; ptr = ptr->next_sibling) { - if (start_pc >= ptr->start_pc - && start_pc <= ptr->end_pc - && TREE_PURPOSE (ptr->handlers) == type - && TREE_VALUE (ptr->handlers) == handler) + if (start_pc > ptr->start_pc + && start_pc < ptr->end_pc) + { + split_range (ptr, start_pc); + } + + if (end_pc > ptr->start_pc + && end_pc < ptr->end_pc) { - /* Already found an overlapping range, so coalesce. */ - ptr->end_pc = MAX (ptr->end_pc, end_pc); - return; + split_range (ptr, end_pc); } - prev = ptr; + + if (ptr->start_pc >= end_pc) + break; } + /* Create the new range. */ h = xmalloc (sizeof (struct eh_range)); + first_child = &h->first_child; + h->start_pc = start_pc; h->end_pc = end_pc; h->first_child = NULL; - h->outer = NULL; + h->outer = NULL_EH_RANGE; h->handlers = build_tree_list (type, handler); h->next_sibling = NULL; h->expanded = 0; h->stmt = NULL; - if (prev == NULL) - whole_range.first_child = h; - else - prev->next_sibling = h; -} + /* Find every range at the top level that will be a sub-range of the + range we're inserting and make it so. */ + { + struct eh_range **prev = &whole_range.first_child; + for (ptr = *prev; ptr;) + { + struct eh_range *next = ptr->next_sibling; + + if (ptr->start_pc >= end_pc) + break; + if (ptr->start_pc < start_pc) + { + prev = &ptr->next_sibling; + } + else if (ptr->start_pc >= start_pc + && ptr->start_pc < end_pc) + { + *prev = next; + *first_child = ptr; + first_child = &ptr->next_sibling; + ptr->outer = h; + ptr->next_sibling = NULL; + } + + ptr = next; + } + } + + /* Find the right place to insert the new range. */ + prev = &whole_range.first_child; + for (ptr = *prev; ptr; prev = &ptr->next_sibling, ptr = ptr->next_sibling) + { + gcc_assert (ptr->outer == NULL_EH_RANGE); + if (ptr->start_pc >= start_pc) + break; + } + + /* And insert it there. */ + *prev = h; + if (ptr) + { + h->next_sibling = ptr; + h->outer = ptr->outer; + } +} + + /* if there are any handlers for this range, issue start of region */ static void expand_start_java_handler (struct eh_range *range) diff --git a/gcc/java/expr.c b/gcc/java/expr.c index ee67c223cb5..3a4002bbb87 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -373,7 +373,7 @@ pop_type_0 (tree type, char **messagep) && t == object_ptr_type_node) { if (type != ptr_type_node) - warning ("need to insert runtime check for %s", + warning (0, "need to insert runtime check for %s", xstrdup (lang_printable_name (type, 0))); return type; } @@ -502,7 +502,7 @@ can_widen_reference_to (tree source_type, tree target_type) source_type, target_type); if (!quiet_flag) - warning ("assert: %s is assign compatible with %s", + warning (0, "assert: %s is assign compatible with %s", xstrdup (lang_printable_name (target_type, 0)), xstrdup (lang_printable_name (source_type, 0))); /* Punt everything to runtime. */ @@ -549,7 +549,7 @@ can_widen_reference_to (tree source_type, tree target_type) if (TYPE_DUMMY (source_type) || TYPE_DUMMY (target_type)) { if (! quiet_flag) - warning ("assert: %s is assign compatible with %s", + warning (0, "assert: %s is assign compatible with %s", xstrdup (lang_printable_name (target_type, 0)), xstrdup (lang_printable_name (source_type, 0))); return 1; @@ -2513,8 +2513,7 @@ build_jni_stub (tree method) method_args = DECL_ARGUMENTS (method); else method_args = BLOCK_EXPR_DECLS (DECL_FUNCTION_BODY (method)); - block = build_block (env_var, NULL_TREE, NULL_TREE, - method_args, NULL_TREE); + block = build_block (env_var, NULL_TREE, method_args, NULL_TREE); TREE_SIDE_EFFECTS (block) = 1; /* When compiling from source we don't set the type of the block, because that will prevent patch_return from ever being run. */ @@ -2715,7 +2714,8 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index) } field_ref = build_field_ref (field_ref, self_type, field_name); - if (is_static) + if (is_static + && ! flag_indirect_dispatch) field_ref = build_class_init (self_type, field_ref); if (is_putting) { @@ -2728,7 +2728,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index) else if (FIELD_STATIC (field_decl)) { if (!DECL_CLINIT_P (current_function_decl)) - warning ("%Jassignment to final static field %qD not in " + warning (0, "%Jassignment to final static field %qD not in " "class initializer", field_decl, field_decl); } @@ -2737,7 +2737,7 @@ expand_java_field_op (int is_static, int is_putting, int field_ref_index) tree cfndecl_name = DECL_NAME (current_function_decl); if (! DECL_CONSTRUCTOR_P (current_function_decl) && !ID_FINIT_P (cfndecl_name)) - warning ("%Jassignment to final field '%D' not in constructor", + warning (0, "%Jassignment to final field '%D' not in constructor", field_decl, field_decl); } } @@ -2927,7 +2927,7 @@ expand_byte_code (JCF *jcf, tree method) int pc = GET_u2 (linenumber_pointer); linenumber_pointer += 4; if (pc >= length) - warning ("invalid PC in line number table"); + warning (0, "invalid PC in line number table"); else { if ((instruction_bits[pc] & BCODE_HAS_LINENUMBER) != 0) @@ -2983,7 +2983,7 @@ expand_byte_code (JCF *jcf, tree method) { /* We've just reached the end of a region of dead code. */ if (extra_warnings) - warning ("unreachable bytecode from %d to before %d", + warning (0, "unreachable bytecode from %d to before %d", dead_code_index, PC); dead_code_index = -1; } @@ -3025,7 +3025,7 @@ expand_byte_code (JCF *jcf, tree method) { /* We've just reached the end of a region of dead code. */ if (extra_warnings) - warning ("unreachable bytecode from %d to the end of the method", + warning (0, "unreachable bytecode from %d to the end of the method", dead_code_index); } } @@ -3484,7 +3484,8 @@ maybe_adjust_start_pc (struct JCF *jcf, int code_offset, For method invocation, we modify the arguments so that a left-to-right order evaluation is performed. Saved expressions will, in CALL_EXPR order, be reused when the call will be expanded. -*/ + + We also promote outgoing args if needed. */ tree force_evaluation_order (tree node) @@ -3518,7 +3519,17 @@ force_evaluation_order (tree node) /* This reverses the evaluation order. This is a desired effect. */ for (cmp = NULL_TREE; arg; arg = TREE_CHAIN (arg)) { - tree saved = save_expr (force_evaluation_order (TREE_VALUE (arg))); + /* Promote types smaller than integer. This is required by + some ABIs. */ + tree type = TREE_TYPE (TREE_VALUE (arg)); + tree saved; + if (targetm.calls.promote_prototypes (type) + && INTEGRAL_TYPE_P (type) + && INT_CST_LT_UNSIGNED (TYPE_SIZE (type), + TYPE_SIZE (integer_type_node))) + TREE_VALUE (arg) = fold_convert (integer_type_node, TREE_VALUE (arg)); + + saved = save_expr (force_evaluation_order (TREE_VALUE (arg))); cmp = (cmp == NULL_TREE ? saved : build2 (COMPOUND_EXPR, void_type_node, cmp, saved)); TREE_VALUE (arg) = saved; diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi index ffa54a88df8..28316bf21d4 100644 --- a/gcc/java/gcj.texi +++ b/gcc/java/gcj.texi @@ -59,6 +59,8 @@ man page gfdl(7). @direntry * gcjh: (gcj)Invoking gcjh. Generate header files from Java class files +* gjnih: (gcj)Invoking gjnih. + Generate JNI header files from Java class files * jv-scan: (gcj)Invoking jv-scan. Print information about Java source files * jcf-dump: (gcj)Invoking jcf-dump. @@ -111,6 +113,7 @@ files and object files, and it can read both Java source code and * Invoking gcj:: Compiler options supported by @command{gcj} * Compatibility:: Compatibility between gcj and other tools for Java * Invoking gcjh:: Generate header files from class files +* Invoking gjnih:: Generate JNI header files from class files * Invoking jv-scan:: Print information about source files * Invoking jcf-dump:: Print information about class files * Invoking gij:: Interpreting Java bytecodes @@ -145,7 +148,7 @@ gcj [@option{-I}@var{dir}@dots{}] [@option{-d} @var{dir}@dots{}] @var{sourcefile}@dots{} @c man end @c man begin SEEALSO gcj -gcc(1), gcjh(1), gij(1), jv-scan(1), jcf-dump(1), gfdl(7), +gcc(1), gcjh(1), gjnih(1), gij(1), jv-scan(1), jcf-dump(1), gfdl(7), and the Info entries for @file{gcj} and @file{gcc}. @c man end @end ignore @@ -512,6 +515,15 @@ ABI. These restrictions will be lifted in some future release. However, if you compile CNI code with the standard ABI, you can call it from code built with the binary compatibility ABI. +@item -fbootstrap-classes +This option can be use to tell @code{libgcj} that the compiled classes +should be loaded by the bootstrap loader, not the system class loader. +By default, if you compile a class and link it into an executable, it +will be treated as if it was loaded using the system class loader. +This is convenient, as it means that things like +@code{Class.forName()} will search @samp{CLASSPATH} to find the +desired class. + @end table @@ -673,9 +685,11 @@ required native methods. @ignore @c man begin SYNOPSIS gcjh gcjh [@option{-stubs}] [@option{-jni}] + [@option{-force}] [@option{-old}] [@option{-trace}] [@option{-J} @var{option}] [@option{-add} @var{text}] [@option{-append} @var{text}] [@option{-friend} @var{text}] [@option{-preprend} @var{text}] [@option{--classpath}=@var{path}] [@option{--CLASSPATH}=@var{path}] + [@option{--bootclasspath}=@var{path}] [@option{-I}@var{dir}@dots{}] [@option{-d} @var{dir}@dots{}] [@option{-o} @var{file}] [@option{-td} @var{dir}] [@option{-M}] [@option{-MM}] [@option{-MD}] [@option{-MMD}] @@ -701,6 +715,18 @@ By default the stub file will be named after the class, with a suffix of This tells @code{gcjh} to generate a JNI header or stub. By default, CNI headers are generated. +@item -force +This option forces @code{gcjh} to write the output file. + +@item -old +This option is accepted but ignored for compatibility. + +@item -trace +This option is accepted but ignored for compatibility. + +@item -J @var{option} +This option is accepted but ignored for compatibility. + @item -add @var{text} Inserts @var{text} into the class body. This is ignored in JNI mode. @@ -718,6 +744,7 @@ This is ignored in JNI mode. @item --classpath=@var{path} @itemx --CLASSPATH=@var{path} +@itemx --bootclasspath=@var{path} @itemx -I@var{directory} @itemx -d @var{directory} @itemx -o @var{file} @@ -757,6 +784,120 @@ All remaining options are considered to be names of classes. @c man end +@node Invoking gjnih +@chapter Invoking gjnih + +@c man title gjnih generate JNI header files from Java class files + +@c man begin DESCRIPTION gjnih + +The @code{gjnih} program is used to generate JNI header files from class +files. Running it is equivalent to running @code{gcjh -jni}. + +@c man end + +@ignore +@c man begin SYNOPSIS gjnih +gjnih [@option{-stubs}] [@option{-jni}] + [@option{-force}] [@option{-old}] [@option{-trace}] [@option{-J} @var{option}] + [@option{-add} @var{text}] [@option{-append} @var{text}] [@option{-friend} @var{text}] + [@option{-preprend} @var{text}] + [@option{--classpath}=@var{path}] [@option{--CLASSPATH}=@var{path}] + [@option{--bootclasspath}=@var{path}] + [@option{-I}@var{dir}@dots{}] [@option{-d} @var{dir}@dots{}] + [@option{-o} @var{file}] [@option{-td} @var{dir}] + [@option{-M}] [@option{-MM}] [@option{-MD}] [@option{-MMD}] + [@option{--version}] [@option{--help}] [@option{-v}] [@option{--verbose}] + @var{classname}@dots{} +@c man end +@c man begin SEEALSO gjnih +gcc(1), gcj(1), gcjh(1), gij(1), jv-scan(1), jcf-dump(1), gfdl(7), +and the Info entries for @file{gcj} and @file{gcc}. +@c man end +@end ignore + +@c man begin OPTIONS gjnih + +@table @gcctabopt +@item -stubs +This causes @code{gjnih} to generate stub files instead of header files. +By default the stub file will be named after the class, with a suffix of +@samp{.c}. + +@item -jni +This option specifies the default behavior which is to generate a JNI +header or stub. + +@item -force +This option forces @code{gjnih} to write the output file. + +@item -old +This option is accepted but ignored for compatibility. + +@item -trace +This option is accepted but ignored for compatibility. + +@item -J @var{option} +This option is accepted but ignored for compatibility. + +@item -add @var{text} +Inserts @var{text} into the class body. This is ignored in by +@code{gjnih}. + +@item -append @var{text} +Inserts @var{text} into the header file after the class declaration. +This is ignored in by @code{gjnih}. + +@item -friend @var{text} +Inserts @var{text} into the class as a @code{friend} declaration. +This is ignored by @code{gjnih}. + +@item -prepend @var{text} +Inserts @var{text} into the header file before the class declaration. +This is ignored in by @code{gjnih}. + +@item --classpath=@var{path} +@itemx --CLASSPATH=@var{path} +@itemx --bootclasspath=@var{path} +@itemx -I@var{directory} +@itemx -d @var{directory} +@itemx -o @var{file} +These options are all identical to the corresponding @command{gcj} options. + +@item -o @var{file} +Sets the output file name. This cannot be used if there is more than +one class on the command line. + +@item -td @var{directory} +Sets the name of the directory to use for temporary files. + +@item -M +Print all dependencies to stdout; suppress ordinary output. + +@item -MM +Print non-system dependencies to stdout; suppress ordinary output. + +@item -MD +Print all dependencies to stdout. + +@item -MMD +Print non-system dependencies to stdout. + +@item --help +Print help about @code{gjnih} and exit. No further processing is done. + +@item --version +Print version information for @code{gjnih} and exit. No further +processing is done. + +@item -v, --verbose +Print extra information while running. +@end table + +All remaining options are considered to be names of classes. + +@c man end + @node Invoking jv-scan @chapter Invoking jv-scan @@ -949,16 +1090,31 @@ be retrieved at runtime using the @code{java.lang.System.getProperty} method. @item -ms=@var{number} -This sets the initial heap size. +Equivalent to @code{-Xms}. @item -mx=@var{number} -This sets the maximum heap size. +Equivalent to @code{-Xmx}. + +@item -noverify +Do not verify compliance of bytecode with the VM specification. In addition, +this option disables type verification which is otherwise performed on BC-ABI +compiled code. @item -X @itemx -X@var{argument} Supplying @code{-X} by itself will cause @code{gij} to list all the -supported @code{-X} options. Currently there are none. Unrecognized -@code{-X} options are ignored, for compatibility with other runtimes. +supported @code{-X} options. Currently these options are supported: + +@table @gcctabopt +@item -Xms@var{size} +Set the initial heap size. + +@item -Xmx@var{size} +Set the maximum heap size. +@end table + +Unrecognized @code{-X} options are ignored, for compatibility with +other runtimes. @item -jar This indicates that the name passed to @code{gij} should be interpreted @@ -971,6 +1127,9 @@ Print help, then exit. @item --showversion Print version number and continue. +@item --fullversion +Print detailed version information, then exit. + @item --version Print version number, then exit. @@ -979,6 +1138,13 @@ Print version number, then exit. Each time a class is initialized, print a short message on standard error. @end table +@code{gij} also recognizes and ignores the following options, for +compatibility with existing application launch scripts: +@code{-client}, @code{-server}, @code{-hotspot}, @code{-jrockit}, +@code{-agentlib}, @code{-agentpath}, @code{-debug}, @code{-d32}, +@code{-d64}, @code{-javaagent}, @code{-noclassgc}, @code{-verify}, +and @code{-verifyremote}. + @c man end @node Invoking gcj-dbtool @@ -990,9 +1156,9 @@ Each time a class is initialized, print a short message on standard error. @c man begin SYNOPSIS gcj-dbtool gcj-dbtool @option{OPTION} @var{DBFILE} [@option{MORE}] @dots{} -gcj-dbtool [@option{-n}] [@option{-a}] [@option{-f}] - [@option{-t}] [@option{-l}] [@option{-p}] - [@option{-v}] [@option{--version}] [@option{--help}] +gcj-dbtool [@option{-0}] [@option{-}] [@option{-n}] [@option{-a}] [@option{-f}] + [@option{-t}] [@option{-l}] [@option{-p} [@var{LIBDIR}]] + [@option{-v}] [@option{-m}] [@option{--version}] [@option{--help}] @c man end @c man begin SEEALSO gij @@ -1037,6 +1203,18 @@ corresponding shared library. The @option{-a} option will verify that @var{LIB} exists before adding it to the database; @option{-f} skips this check. +@item [@option{-}][@option{-0}] -m @var{DBFILE} @var{DBFILE},[@var{DBFILE}] +Merge a number of databases. The output database overwrites any +existing database. To add databases into an existing database, +include the destination in the list of sources. + +If @option{-} or @option{-0} are used, the list of files to read is +taken from standard input instead of the command line. For +@option{-0}, Input filenames are terminated by a null character +instead of by whitespace. Useful when arguments might contain white +space. The GNU find -print0 option produces input suitable for this +mode. + @item -t @var{DBFILE} Test a database. @@ -1045,7 +1223,9 @@ List the contents of a database. @item -p Print the name of the default database. If there is no default -database, this prints a blank line. +database, this prints a blank line. If @var{LIBDIR} is specified, use +it instead of the default library directory component of the database +name. @item --help Print a help message, then exit. @@ -1248,6 +1428,7 @@ alternative to the standard JNI (Java Native Interface). * Objects and Classes:: C++ and Java classes. * Class Initialization:: How objects are initialized. * Object allocation:: How to create Java objects in C++. +* Memory allocation:: How to allocate and free memory. * Arrays:: Dealing with Java arrays in C++. * Methods:: Java methods in C++. * Strings:: Information about Java Strings. @@ -1512,7 +1693,7 @@ management, but this is invisible to the application, and the reference to the object points to the dispatch table pointer.) The fields are laid out in the same order, alignment, and size as in -C++. Specifically, 8-bite and 16-bit native types (@code{byte}, +C++. Specifically, 8-bit and 16-bit native types (@code{byte}, @code{short}, @code{char}, and @code{boolean}) are @emph{not} widened to 32 bits. Note that the Java VM does extend 8-bit and 16-bit types to 32 bits when on the VM stack or temporary registers. @@ -1525,8 +1706,8 @@ way. For example, given the following Java class: public class Int @{ public int i; - public Integer (int i) @{ this.i = i; @} - public static zero = new Integer(0); + public Int (int i) @{ this.i = i; @} + public static Int zero = new Int(0); @} @end example @@ -1596,7 +1777,7 @@ it is safe to leave it out). Accessing a static field also requires the class of the field to be initialized. The Java compiler will generate code -to call @code{Jv_InitClass} before getting or setting the field. +to call @code{JvInitClass} before getting or setting the field. However, the C++ compiler will not generate this extra code, so it is your responsibility to make sure the class is initialized before you access a static field from C++. @@ -1628,6 +1809,27 @@ java::util::Hashtable *ht = new java::util::Hashtable(120); @end example +@node Memory allocation +@section Memory allocation + +When allocating memory in @acronym{CNI} methods it is best to handle +out-of-memory conditions by throwing a Java exception. These +functions are provided for that purpose: + +@deftypefun void* JvMalloc (jsize @var{size}) +Calls malloc. Throws @code{java.lang.OutOfMemoryError} if allocation +fails. +@end deftypefun + +@deftypefun void* JvRealloc (void* @var{ptr}, jsize @var{size}) +Calls realloc. Throws @code{java.lang.OutOfMemoryError} if +reallocation fails. +@end deftypefun + +@deftypefun void JvFree (void* @var{ptr}) +Calls free. +@end deftypefun + @node Arrays @section Arrays @@ -2478,32 +2680,18 @@ try to load a class @code{java.net.[impl.prefix]DatagramSocketImpl} instead of the normal @code{java.net.PlainDatagramSocketImpl}. @item gnu.gcj.progname -The name that was used to invoked the program. - -@item gnu.gcj.runtime.NameFinder.demangle -Whether names in a stack trace should be demangled. Defaults to @code{true}. - -@item gnu.gcj.runtime.NameFinder.sanitize -Whether calls to initialize exceptions and starting the runtime system -should be removed from the stack trace. Only done when names are -demangled. Defaults to @code{true}. - -@item gnu.gcj.runtime.NameFinder.remove_unknown -Whether calls to unknown functions (class and method names are unknown) -should be removed from the stack trace. Only done when the stack is -sanitized. Ignored if this means no stack trace information would be -available anymore. Defaults to @code{true}. - -@item gnu.gcj.runtime.NameFinder.remove_interpreter -Whether runtime interpreter calls (methods in the @code{_Jv_InterpMethod} class -and functions starting with @samp{ffi_}) should be removed from the stack -trace. Only done when the stack is sanitized. Defaults to @code{true}. - +The class or binary name that was used to invoke the program. This will be +the name of the "main" class in the case where the @code{gij} front end is +used, or the program binary name in the case where an application is compiled +to a native binary. @item gnu.gcj.runtime.NameFinder.use_addr2line -Whether an external process (@command{addr2line} or @command{addr2name.awk}) -should be used as fallback to convert the addresses to function names when -the runtime is unable to do it through @code{dladdr}. +Whether an external process, @command{addr2line}, should be used to determine +line number information when tracing the stack. Setting this to @code{false} +may suppress line numbers when printing stack traces and when using +the java.util.logging infrastructure. However, performance may improve +significantly for applications that print stack traces or make logging calls +frequently. @item gnu.gcj.runtime.VMClassLoader.library_control This controls how shared libraries are automatically loaded by the @@ -2513,6 +2701,15 @@ search is done for each requested class. If this property is set to tried again. If this property is set to @samp{never}, then lookups are never done. For more information, @xref{Extensions}. +@item gnu.gcj.runtime.endorsed.dirs +This is like the standard @code{java.endorsed.dirs}, property, but +specifies some extra directories which are searched after the standard +endorsed directories. This is primarily useful for telling +@code{libgcj} about additional libraries which are ordinarily +incorporated into the JDK, and which should be loaded by the bootstrap +class loader, but which are not yet part of @code{libgcj} itself for +some reason. + @item gnu.gcj.jit.compiler @c FIXME we should probably have a whole node on this... This is the full path to @command{gcj} executable which should be diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index ca38b9e92f9..d25dab8d0f7 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -53,8 +53,16 @@ FILE *out = NULL; /* Nonzero on failure. */ static int found_error = 0; +#ifdef JNI_DEFAULT +#define TOOLNAME "gjnih" + /* Nonzero if we're generating JNI output. */ +int flag_jni = 1; +#else +#define TOOLNAME "gcjh" + int flag_jni = 0; +#endif /* When nonzero, warn when source file is newer than matching class file. */ @@ -266,7 +274,7 @@ error (const char *msgid, ...) va_start (ap, msgid); - fprintf (stderr, "gcjh: "); + fprintf (stderr, TOOLNAME ": "); vfprintf (stderr, _(msgid), ap); va_end (ap); fprintf (stderr, "\n"); @@ -2093,11 +2101,11 @@ process_file (JCF *jcf, FILE *out) cstart, mode, cend); else { - fprintf (out, "%s This file was created by `gcjh -stubs%s'.%s\n\ + fprintf (out, "%s This file was created by `" TOOLNAME " -stubs%s'.%s\n\ %s\n\ %s This file is intended to give you a head start on implementing native\n\ %s methods using %s.\n\ -%s Be aware: running `gcjh -stubs %s' once more for this class may\n\ +%s Be aware: running `" TOOLNAME " -stubs %s' once more for this class may\n\ %s overwrite any edits you have made to this file.%s\n\n", cstart, jflag, mode, cstart2, @@ -2299,6 +2307,9 @@ process_file (JCF *jcf, FILE *out) #define OPT_MG LONG_OPT (12) #define OPT_MD LONG_OPT (13) #define OPT_MMD LONG_OPT (14) +#define OPT_FORCE LONG_OPT (15) +#define OPT_OLD LONG_OPT (16) +#define OPT_TRACE LONG_OPT (17) static const struct option options[] = { @@ -2321,23 +2332,33 @@ static const struct option options[] = { "MD", no_argument, NULL, OPT_MD }, { "MMD", no_argument, NULL, OPT_MMD }, { "jni", no_argument, &flag_jni, 1 }, + { "force", no_argument, NULL, OPT_FORCE }, + /* If the output file should be named "ld" then a space is needed + between -o and its argument, ld. */ + { "old", no_argument, NULL, OPT_OLD }, + { "trace", no_argument, NULL, OPT_TRACE }, + { NULL, required_argument, NULL, 'J' }, { NULL, no_argument, NULL, 0 } }; static void usage (void) { - fprintf (stderr, _("Try 'gcjh --help' for more information.\n")); + fprintf (stderr, _("Try '" TOOLNAME " --help' for more information.\n")); exit (1); } static void help (void) { - printf (_("Usage: gcjh [OPTION]... CLASS...\n\n")); - printf (_("Generate C++ header files from .class files\n\n")); + printf (_("Usage: " TOOLNAME " [OPTION]... CLASS...\n\n")); + printf (_("Generate C or C++ header files from .class files\n\n")); printf (_(" -stubs Generate an implementation stub file\n")); printf (_(" -jni Generate a JNI header or stub\n")); + printf (_(" -force Always overwrite output files\n")); + printf (_(" -old Unused compatibility option\n")); + printf (_(" -trace Unused compatibility option\n")); + printf (_(" -J OPTION Unused compatibility option\n")); printf ("\n"); printf (_(" -add TEXT Insert TEXT into class body\n")); printf (_(" -append TEXT Insert TEXT after class declaration\n")); @@ -2372,7 +2393,7 @@ help (void) static void version (void) { - printf ("gcjh (GCC) %s\n\n", version_string); + printf (TOOLNAME " (GCC) %s\n\n", version_string); printf ("Copyright %s 2004 Free Software Foundation, Inc.\n", _("(C)")); printf (_("This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n")); @@ -2387,6 +2408,10 @@ main (int argc, char** argv) char *output_file = NULL; int emit_dependencies = 0, suppress_output = 0; int opt; + int local_found_error; + + /* Unlock the stdio streams. */ + unlock_std_streams (); gcc_init_libintl (); @@ -2400,7 +2425,7 @@ main (int argc, char** argv) /* We use getopt_long_only to allow single `-' long options. For some of our options this is more natural. */ - while ((opt = getopt_long_only (argc, argv, "I:d:o:v", options, NULL)) != -1) + while ((opt = getopt_long_only (argc, argv, "J:I:d:o:v", options, NULL)) != -1) { switch (opt) { @@ -2498,6 +2523,19 @@ main (int argc, char** argv) jcf_dependency_init (0); break; + case OPT_FORCE: + break; + + case OPT_OLD: + break; + + case OPT_TRACE: + break; + + case 'J': + /* Ignore -J options. */ + break; + default: usage (); break; @@ -2518,12 +2556,18 @@ main (int argc, char** argv) exit (1); } + local_found_error = 0; for (argi = optind; argi < argc; argi++) { char *classname = argv[argi]; - char *current_output_file; + char *current_output_file = NULL; const char *classfile_name; + /* We reset the error state here so that we can detect errors + that occur when processing this file, so the output can be + unlinked if need be. */ + found_error = 0; + if (verbose) printf (_("Processing %s\n"), classname); if (! output_file) @@ -2599,13 +2643,22 @@ main (int argc, char** argv) free_method_name_list (); process_file (&jcf, out); JCF_FINISH (&jcf); + + /* If we found an error and we're writing to a real file, + delete it. */ + if (found_error && ! suppress_output && current_output_file != NULL + && strcmp (current_output_file, "-")) + unlink (current_output_file); + if (current_output_file != output_file) free (current_output_file); jcf_dependency_write (); + + local_found_error |= found_error; } if (out != NULL && out != stdout) fclose (out); - return found_error; + return local_found_error; } diff --git a/gcc/java/java-except.h b/gcc/java/java-except.h index a45e650ffb8..7c26cab4407 100644 --- a/gcc/java/java-except.h +++ b/gcc/java/java-except.h @@ -54,8 +54,6 @@ struct eh_range /* The TRY_CATCH_EXPR for this EH range. */ tree stmt; - - tree handler; }; /* A dummy range that represents the entire method. */ @@ -67,5 +65,5 @@ extern struct eh_range * find_handler (int); extern void method_init_exceptions (void); extern void maybe_start_try (int, int); extern void add_handler (int, int, tree, tree); -extern void handle_nested_ranges (void); extern void expand_end_java_handler (struct eh_range *); +extern bool sanity_check_exception_range (struct eh_range *); diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 6a392a8daf9..a55e9ab476b 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -686,6 +686,9 @@ extern GTY(()) tree java_global_trees[JTI_MAX]; #define wfl_operator \ java_global_trees[JTI_WFL_OPERATOR] +/* The decl for "_Jv_ResolvePoolEntry". */ +extern GTY(()) tree soft_resolvepoolentry_node; + extern const char *cyclic_inheritance_report; struct lang_identifier GTY(()) @@ -1285,6 +1288,7 @@ extern tree get_method_index (tree decl); extern void make_class_data (tree); extern void register_class (void); extern int alloc_name_constant (int, tree); +extern int alloc_constant_fieldref (tree, tree); extern void emit_register_classes (tree *); extern tree emit_symbol_table (tree, tree, tree, tree, tree, int); extern void lang_init_source (int); @@ -1883,8 +1887,8 @@ enum #define EXPR_WFL_LINECOL(NODE) ((NODE)->exp.locus) #define EXPR_WFL_FILENAME(NODE) EXPR_FILENAME (NODE) #define EXPR_WFL_LINENO(NODE) EXPR_LINENO (NODE) -extern tree build_expr_wfl PARAMS ((tree, source_location)); -extern tree expr_add_location PARAMS ((tree, source_location, bool)); +extern tree build_expr_wfl (tree, source_location); +extern tree expr_add_location (tree, source_location, bool); #define build_unknown_wfl(NODE) build_expr_wfl(NODE, UNKNOWN_LOCATION) #else #define EXPR_WFL_LINECOL(NODE) (EXPR_CHECK (NODE)->exp.complexity) @@ -1899,12 +1903,12 @@ extern tree expr_add_location PARAMS ((tree, source_location, bool)); #define EXPR_WFL_SET_LINECOL(NODE, LINE, COL) \ (EXPR_WFL_LINECOL(NODE) = ((LINE) << 12) | ((COL) & 0xfff)) -extern tree build_expr_wfl PARAMS ((tree, const char *, int, int)); +extern tree build_expr_wfl (tree, const char *, int, int); #define build_unknown_wfl(NODE) build_expr_wfl(NODE, NULL, 0, 0) #endif -extern void java_genericize PARAMS ((tree)); -extern int java_gimplify_expr PARAMS ((tree *, tree *, tree *)); +extern void java_genericize (tree); +extern int java_gimplify_expr (tree *, tree *, tree *); extern tree extract_field_decl (tree); diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index c3fd9f1bf4d..a273d0be82e 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -65,7 +65,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include #include -/* Outout file. */ +/* Output file. */ FILE *out; /* Name of output file, if NULL if stdout. */ char *output_file = NULL; @@ -320,8 +320,12 @@ utf8_equal_string (JCF *jcf, int index, const char * value) if (flag_print_class_info) \ { \ fprintf (out, "\n inner: "); \ - print_constant_terse_with_index (out, jcf, \ - inner_class_info_index, CONSTANT_Class); \ + if (inner_class_info_index == 0) \ + fprintf (out, " (no inner info index)"); \ + else \ + print_constant_terse_with_index (out, jcf, \ + inner_class_info_index, \ + CONSTANT_Class); \ if (inner_name_index == 0) \ fprintf (out, " (anonymous)"); \ else if (verbose || flag_print_constant_pool) \ @@ -334,12 +338,16 @@ utf8_equal_string (JCF *jcf, int index, const char * value) fprintf (out, ", access flags: 0x%x", inner_class_access_flags); \ print_access_flags (out, inner_class_access_flags, 'c'); \ fprintf (out, ", outer class: "); \ - print_constant_terse_with_index (out, jcf, \ - outer_class_info_index, CONSTANT_Class); \ + if (outer_class_info_index == 0) \ + fprintf (out, "(not a member)"); \ + else \ + print_constant_terse_with_index (out, jcf, \ + outer_class_info_index, \ + CONSTANT_Class); \ } \ } \ - if (flag_print_class_info) \ - fputc ('\n', out); \ + if (flag_print_class_info) \ + fputc ('\n', out); \ } #define HANDLE_SOURCEDEBUGEXTENSION_ATTRIBUTE(LENGTH) \ @@ -932,6 +940,9 @@ main (int argc, char** argv) JCF jcf[1]; int argi, opt; + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); if (argc <= 1) diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index 534c45b3448..49d64f07bb8 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -533,7 +533,7 @@ find_class (const char *classname, int classname_length, JCF *jcf, if (! java && ! class && java_buf.st_mtime > class_buf.st_mtime) { if (flag_newer) - warning ("source file for class %qs is newer than its matching class file. Source file %qs used instead", classname, java_buffer); + warning (0, "source file for class %qs is newer than its matching class file. Source file %qs used instead", classname, java_buffer); class = -1; } diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 2af480d806a..ccf6d34d357 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -717,8 +717,8 @@ load_class (tree class_or_name, int verbose) { /* This is just a diagnostic during testing, not a real problem. */ if (!quiet_flag) - warning("cannot find file for class %s", - IDENTIFIER_POINTER (saved)); + warning (0, "cannot find file for class %s", + IDENTIFIER_POINTER (saved)); /* Fake it. */ if (TREE_CODE (class_or_name) == RECORD_TYPE) @@ -833,7 +833,7 @@ duplicate_class_warning (const char *filename) warn_loc.file = filename; warn_loc.line = 0; #endif - warning ("%Hduplicate class will only be compiled once", &warn_loc); + warning (0, "%Hduplicate class will only be compiled once", &warn_loc); } static void @@ -1154,7 +1154,7 @@ java_parse_file (int set_yydebug ATTRIBUTE_UNUSED) free (file_list); if (filename_count == 0) - warning ("no input file specified"); + warning (0, "no input file specified"); if (resource_name) { diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c index 87790408d13..6f1516d5a1a 100644 --- a/gcc/java/jcf-write.c +++ b/gcc/java/jcf-write.c @@ -2233,9 +2233,7 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state) } else { - tree type = TREE_TYPE (exp); emit_load (arg, state); - NOTE_PUSH (TYPE_IS_WIDE (type) ? 2 : 1); } break; case CONVERT_EXPR: diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c index a3726fd2ff9..a283328847e 100644 --- a/gcc/java/jv-scan.c +++ b/gcc/java/jv-scan.c @@ -42,7 +42,8 @@ Boston, MA 02111-1307, USA. */ extern void fatal_error (const char *msgid, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; -void warning (const char *msgid, ...) ATTRIBUTE_PRINTF_1; +void warning (int opt, const char *msgid, ...) ATTRIBUTE_PRINTF_2; +void warning0 (const char *msgid, ...) ATTRIBUTE_PRINTF_1; void report (void); static void usage (void) ATTRIBUTE_NORETURN; @@ -146,6 +147,9 @@ main (int argc, char **argv) /* Default for output */ out = stdout; + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); /* Process options first. We use getopt_long and not @@ -256,7 +260,18 @@ fatal_error (const char *msgid, ...) } void -warning (const char *msgid, ...) +warning (int opt ATTRIBUTE_UNUSED, const char *msgid, ...) +{ + va_list ap; + va_start (ap, msgid); + fprintf (stderr, _("%s: warning: "), exec_name); + vfprintf (stderr, _(msgid), ap); + fputc ('\n', stderr); + va_end (ap); +} + +void +warning0 (const char *msgid, ...) { va_list ap; va_start (ap, msgid); diff --git a/gcc/java/jvgenmain.c b/gcc/java/jvgenmain.c index 1e228a16191..40f32fe8fcd 100644 --- a/gcc/java/jvgenmain.c +++ b/gcc/java/jvgenmain.c @@ -1,5 +1,5 @@ /* Program to generate "main" a Java(TM) class containing a main method. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -58,6 +58,9 @@ main (int argc, char **argv) const char *mangled_classname; int i, last_arg; + /* Unlock the stdio streams. */ + unlock_std_streams (); + gcc_init_libintl (); if (argc < 2) diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 67bc0e48e1e..e0d2672b2a5 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -172,8 +172,6 @@ struct language_function GTY(()) #define LANG_HOOKS_PARSE_FILE java_parse_file #undef LANG_HOOKS_MARK_ADDRESSABLE #define LANG_HOOKS_MARK_ADDRESSABLE java_mark_addressable -#undef LANG_HOOKS_TRUTHVALUE_CONVERSION -#define LANG_HOOKS_TRUTHVALUE_CONVERSION java_truthvalue_conversion #undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL #define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL java_dup_lang_specific_decl #undef LANG_HOOKS_DECL_PRINTABLE_NAME @@ -803,7 +801,7 @@ merge_init_test_initialization (void **entry, void *x) does this by setting the DECL_INITIAL of the init_test_decl for that class, and no initializations are emitted for that class. - However, what if the method that is suppoed to do the initialization + However, what if the method that is supposed to do the initialization is itself inlined in the caller? When expanding the called method we'll assume that the class initialization has already been done, because the DECL_INITIAL of the init_test_decl is set. diff --git a/gcc/java/lang.opt b/gcc/java/lang.opt index 0e4ffcfd994..0142915824f 100644 --- a/gcc/java/lang.opt +++ b/gcc/java/lang.opt @@ -1,5 +1,5 @@ ; Options for the Java front end. -; Copyright (C) 2003 Free Software Foundation, Inc. +; Copyright (C) 2003, 2005 Free Software Foundation, Inc. ; ; This file is part of GCC. ; @@ -18,7 +18,7 @@ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA ; 02111-1307, USA. -; See c.opt for a description of this file's format. +; See the GCC internals manual for a description of this file's format. ; Please try to keep this file in ASCII collating order. @@ -176,5 +176,9 @@ fuse-divide-subroutine Java Var(flag_use_divide_subroutine) Init(1) Call a library routine to do integer divisions +fbootstrap-classes +Java Var(flag_bootstrap_classes) +Generated should be loaded by bootstrap loader + version Java diff --git a/gcc/java/parse.h b/gcc/java/parse.h index 5948348895a..232eead9862 100644 --- a/gcc/java/parse.h +++ b/gcc/java/parse.h @@ -937,7 +937,7 @@ void java_layout_classes (void); void java_reorder_fields (void); tree java_method_add_stmt (tree, tree); int java_report_errors (void); -extern tree do_resolve_class (tree, tree, tree, tree); +extern tree do_resolve_class (tree, tree, tree, tree, tree); #endif char *java_get_line_col (const char *, int, int); extern void reset_report (void); @@ -960,5 +960,6 @@ extern void java_finish_classes (void); extern GTY(()) struct parser_ctxt *ctxp; extern GTY(()) struct parser_ctxt *ctxp_for_generation; +extern GTY(()) struct parser_ctxt *ctxp_for_generation_last; #endif /* ! GCC_JAVA_PARSE_H */ diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 9569f95d085..e90fc426e5d 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -113,7 +113,6 @@ static int find_in_imports_on_demand (tree, tree); static void find_in_imports (tree, tree); static void check_inner_class_access (tree, tree, tree); static int check_pkg_class_access (tree, tree, bool, tree); -static void register_package (tree); static tree resolve_package (tree, tree *, tree *); static tree resolve_class (tree, tree, tree, tree); static void declare_local_variables (int, tree, tree); @@ -361,6 +360,7 @@ struct parser_ctxt *ctxp; /* List of things that were analyzed for which code will be generated */ struct parser_ctxt *ctxp_for_generation = NULL; +struct parser_ctxt *ctxp_for_generation_last = NULL; /* binop_lookup maps token to tree_code. It is used where binary operations are involved and required by the parser. RDIV_EXPR @@ -407,9 +407,6 @@ static GTY(()) tree current_static_block; /* The generated `write_parm_value$' identifier. */ static GTY(()) tree wpv_id; -/* The list of all packages we've seen so far */ -static GTY(()) tree package_list; - /* Hold THIS for the scope of the current method decl. */ static GTY(()) tree current_this; @@ -737,7 +734,6 @@ package_declaration: PACKAGE_TK name SC_TK { ctxp->package = EXPR_WFL_NODE ($2); - register_package (ctxp->package); } | PACKAGE_TK error {yyerror ("Missing name"); RECOVER;} @@ -2765,8 +2761,12 @@ java_pop_parser_context (int generate) do is to just update a list of class names. */ if (generate) { - ctxp->next = ctxp_for_generation; - ctxp_for_generation = ctxp; + if (ctxp_for_generation_last == NULL) + ctxp_for_generation = ctxp; + else + ctxp_for_generation_last->next = ctxp; + ctxp->next = NULL; + ctxp_for_generation_last = ctxp; } /* And restore those of the previous context */ @@ -3106,7 +3106,7 @@ yyerror (const char *msgid) code_from_source, strlen (code_from_source)); remainder = obstack_finish (&temporary_obstack); if (do_warning) - warning ("%s.\n%s", msgid, remainder); + warning (0, "%s.\n%s", msgid, remainder); else error ("%s.\n%s", msgid, remainder); @@ -3706,7 +3706,7 @@ resolve_inner_class (htab_t circularity_hash, tree cl, tree *enclosing, break; if (TREE_CODE (local_super) == POINTER_TYPE) - local_super = do_resolve_class (NULL, local_super, NULL, NULL); + local_super = do_resolve_class (NULL, NULL, local_super, NULL, NULL); else local_super = TYPE_NAME (local_super); @@ -3768,7 +3768,7 @@ find_as_inner_class (tree enclosing, tree name, tree cl) acc = merge_qualified_name (acc, EXPR_WFL_NODE (TREE_PURPOSE (qual))); BUILD_PTR_FROM_NAME (ptr, acc); - decl = do_resolve_class (NULL_TREE, ptr, NULL_TREE, cl); + decl = do_resolve_class (NULL_TREE, NULL_TREE, ptr, NULL_TREE, cl); } /* A NULL qual and a decl means that the search ended @@ -4177,6 +4177,12 @@ create_class (int flags, tree id, tree super, tree interfaces) virtual function table in java.lang.object. */ TYPE_VFIELD (TREE_TYPE (decl)) = TYPE_VFIELD (object_type_node); + /* We keep the compilation unit imports in the class so that + they can be used later to resolve type dependencies that + aren't necessary to solve now. */ + TYPE_IMPORT_LIST (TREE_TYPE (decl)) = ctxp->import_list; + TYPE_IMPORT_DEMAND_LIST (TREE_TYPE (decl)) = ctxp->import_demand_list; + /* Add the private this$ field, Replicate final locals still in scope as private final fields mangled like val$. This does not occur for top level (static) inner classes. */ @@ -5683,12 +5689,6 @@ java_complete_class (void) { jdep *dep; - /* We keep the compilation unit imports in the class so that - they can be used later to resolve type dependencies that - aren't necessary to solve now. */ - TYPE_IMPORT_LIST (TREE_TYPE (cclass)) = ctxp->import_list; - TYPE_IMPORT_DEMAND_LIST (TREE_TYPE (cclass)) = ctxp->import_demand_list; - for (dep = CLASSD_FIRST (cclassd); dep; dep = JDEP_CHAIN (dep)) { tree decl; @@ -5839,7 +5839,7 @@ resolve_class (tree enclosing, tree class_type, tree decl, tree cl) WFL_STRIP_BRACKET (cl, cl); /* 2- Resolve the bare type */ - if (!(resolved_type_decl = do_resolve_class (enclosing, class_type, + if (!(resolved_type_decl = do_resolve_class (enclosing, NULL_TREE, class_type, decl, cl))) return NULL_TREE; resolved_type = TREE_TYPE (resolved_type_decl); @@ -5862,7 +5862,8 @@ resolve_class (tree enclosing, tree class_type, tree decl, tree cl) and (but it doesn't really matter) qualify_and_find. */ tree -do_resolve_class (tree enclosing, tree class_type, tree decl, tree cl) +do_resolve_class (tree enclosing, tree import_type, tree class_type, tree decl, + tree cl) { tree new_class_decl = NULL_TREE, super = NULL_TREE; tree saved_enclosing_type = enclosing ? TREE_TYPE (enclosing) : NULL_TREE; @@ -5879,7 +5880,7 @@ do_resolve_class (tree enclosing, tree class_type, tree decl, tree cl) if (split_qualified_name (&left, &right, TYPE_NAME (class_type)) == 0) { BUILD_PTR_FROM_NAME (left_type, left); - q = do_resolve_class (enclosing, left_type, decl, cl); + q = do_resolve_class (enclosing, import_type, left_type, decl, cl); if (q) { enclosing = q; @@ -5924,8 +5925,11 @@ do_resolve_class (tree enclosing, tree class_type, tree decl, tree cl) return new_class_decl; } - /* 1- Check for the type in single imports. This will change - TYPE_NAME() if something relevant is found */ + /* 1- Check for the type in single imports. Look at enclosing classes and, + if we're laying out a superclass, at the import list for the subclass. + This will change TYPE_NAME() if something relevant is found. */ + if (import_type && TYPE_IMPORT_LIST (import_type)) + find_in_imports (import_type, class_type); find_in_imports (saved_enclosing_type, class_type); /* 2- And check for the type in the current compilation unit */ @@ -5947,30 +5951,20 @@ do_resolve_class (tree enclosing, tree class_type, tree decl, tree cl) /* 4- Check the import on demands. Don't allow bar.baz to be imported from foo.* */ if (!QUALIFIED_P (TYPE_NAME (class_type))) - if (find_in_imports_on_demand (saved_enclosing_type, class_type)) - return NULL_TREE; + { + if (import_type + && TYPE_IMPORT_DEMAND_LIST (import_type) + && find_in_imports_on_demand (import_type, class_type)) + return NULL_TREE; + if (find_in_imports_on_demand (saved_enclosing_type, class_type)) + return NULL_TREE; + } /* If found in find_in_imports_on_demand, the type has already been loaded. */ if ((new_class_decl = IDENTIFIER_CLASS_VALUE (TYPE_NAME (class_type)))) return new_class_decl; - /* 5- Try with a name qualified with the package name we've seen so far */ - if (!QUALIFIED_P (TYPE_NAME (class_type))) - { - tree package; - - /* If there is a current package (ctxp->package), it's the first - element of package_list and we can skip it. */ - for (package = (ctxp->package ? - TREE_CHAIN (package_list) : package_list); - package; package = TREE_CHAIN (package)) - if ((new_class_decl = qualify_and_find (class_type, - TREE_PURPOSE (package), - TYPE_NAME (class_type)))) - return new_class_decl; - } - /* 5- Check another compilation unit that bears the name of type */ load_class (TYPE_NAME (class_type), 0); @@ -6970,8 +6964,12 @@ process_imports (void) static void find_in_imports (tree enclosing_type, tree class_type) { - tree import = (enclosing_type ? TYPE_IMPORT_LIST (enclosing_type) : - ctxp->import_list); + tree import; + if (enclosing_type && TYPE_IMPORT_LIST (enclosing_type)) + import = TYPE_IMPORT_LIST (enclosing_type); + else + import = ctxp->import_list; + while (import) { if (TREE_VALUE (import) == TYPE_NAME (class_type)) @@ -7129,12 +7127,16 @@ static int find_in_imports_on_demand (tree enclosing_type, tree class_type) { tree class_type_name = TYPE_NAME (class_type); - tree import = (enclosing_type ? TYPE_IMPORT_DEMAND_LIST (enclosing_type) : - ctxp->import_demand_list); tree cl = NULL_TREE; int seen_once = -1; /* -1 when not set, 1 if seen once, >1 otherwise. */ int to_return = -1; /* -1 when not set, 0 or 1 otherwise */ tree node; + tree import; + + if (enclosing_type && TYPE_IMPORT_DEMAND_LIST (enclosing_type)) + import = TYPE_IMPORT_DEMAND_LIST (enclosing_type); + else + import = ctxp->import_demand_list; for (; import; import = TREE_CHAIN (import)) { @@ -7224,27 +7226,6 @@ find_in_imports_on_demand (tree enclosing_type, tree class_type) return (seen_once < 0 ? 0 : seen_once); /* It's ok not to have found */ } -/* Add package NAME to the list of packages encountered so far. To - speed up class lookup in do_resolve_class, we make sure a - particular package is added only once. */ - -static void -register_package (tree name) -{ - static htab_t pht; - void **e; - - if (pht == NULL) - pht = htab_create (50, htab_hash_pointer, htab_eq_pointer, NULL); - - e = htab_find_slot (pht, name, INSERT); - if (*e == NULL) - { - package_list = chainon (package_list, build_tree_list (name, NULL)); - *e = name; - } -} - static tree resolve_package (tree pkg, tree *next, tree *type_name) { @@ -8091,7 +8072,7 @@ maybe_yank_clinit (tree mdecl) /* Now we analyze the method body and look for something that isn't a MODIFY_EXPR */ - if (!IS_EMPTY_STMT (bbody) && analyze_clinit_body (type, bbody)) + if (bbody && !IS_EMPTY_STMT (bbody) && analyze_clinit_body (type, bbody)) return 0; /* Get rid of in the class' list of methods */ diff --git a/gcc/java/resource.c b/gcc/java/resource.c index 7f7d72abe8e..c8fe0fba711 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -1,5 +1,5 @@ /* Functions related to building resource files. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -42,6 +42,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "target.h" #include "expr.h" #include "tree-iterator.h" +#include "cgraph.h" /* DOS brain-damage */ #ifndef O_BINARY @@ -93,7 +94,7 @@ compile_resource_data (const char *name, const char *buffer, int length) pushdecl (decl); rest_of_decl_compilation (decl, global_bindings_p (), 0); make_decl_rtl (decl); - assemble_variable (decl, 1, 0, 0); + cgraph_varpool_finalize_decl (decl); resources = tree_cons (NULL_TREE, decl, resources); } diff --git a/gcc/java/verify-glue.c b/gcc/java/verify-glue.c index b1664ba991a..b8eed71736e 100644 --- a/gcc/java/verify-glue.c +++ b/gcc/java/verify-glue.c @@ -487,7 +487,7 @@ verify_jvm_instructions_new (JCF *jcf, const unsigned char *byte_ops, instruction_bits[handler_pc] |= BCODE_EXCEPTION_TARGET; } - handle_nested_ranges (); + gcc_assert (sanity_check_exception_range (&whole_range)); method.method = current_function_decl; method.signature = build_java_signature (TREE_TYPE (current_function_decl)); diff --git a/gcc/java/verify.c b/gcc/java/verify.c index f81936d7b6e..6f947834189 100644 --- a/gcc/java/verify.c +++ b/gcc/java/verify.c @@ -491,7 +491,6 @@ verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length) } free (starts); - handle_nested_ranges (); for (PC = 0;;) { diff --git a/gcc/jump.c b/gcc/jump.c index a120300fc09..8cfe3b9bcfd 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -209,7 +209,7 @@ mark_all_labels (rtx f) { /* But a LABEL_REF around the REG_LABEL note, so that we can canonicalize it. */ - rtx label_ref = gen_rtx_LABEL_REF (VOIDmode, + rtx label_ref = gen_rtx_LABEL_REF (Pmode, XEXP (label_note, 0)); mark_jump_label (label_ref, insn, 0); @@ -449,6 +449,20 @@ reversed_comparison_code (rtx comparison, rtx insn) XEXP (comparison, 0), XEXP (comparison, 1), insn); } + +/* Return comparison with reversed code of EXP. + Return NULL_RTX in case we fail to do the reversal. */ +rtx +reversed_comparison (rtx exp, enum machine_mode mode) +{ + enum rtx_code reversed_code = reversed_comparison_code (exp, NULL_RTX); + if (reversed_code == UNKNOWN) + return NULL_RTX; + else + return simplify_gen_relational (reversed_code, mode, VOIDmode, + XEXP (exp, 0), XEXP (exp, 1)); +} + /* Given an rtx-code for a comparison, return the code for the negated comparison. If no such code exists, return UNKNOWN. @@ -497,7 +511,7 @@ reverse_condition (enum rtx_code code) return UNKNOWN; default: - abort (); + gcc_unreachable (); } } @@ -540,7 +554,7 @@ reverse_condition_maybe_unordered (enum rtx_code code) return LTGT; default: - abort (); + gcc_unreachable (); } } @@ -586,7 +600,7 @@ swap_condition (enum rtx_code code) return UNLE; default: - abort (); + gcc_unreachable (); } } @@ -617,7 +631,7 @@ unsigned_condition (enum rtx_code code) return LEU; default: - abort (); + gcc_unreachable (); } } @@ -646,7 +660,7 @@ signed_condition (enum rtx_code code) return LE; default: - abort (); + gcc_unreachable (); } } @@ -1095,8 +1109,7 @@ mark_jump_label (rtx x, rtx insn, int in_mem) && NOTE_LINE_NUMBER (label) == NOTE_INSN_DELETED_LABEL) break; - if (!LABEL_P (label)) - abort (); + gcc_assert (LABEL_P (label)); /* Ignore references to labels of containing functions. */ if (LABEL_REF_NONLOCAL_P (x)) @@ -1530,7 +1543,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn) { rtx n; if (nlabel) - n = gen_rtx_LABEL_REF (VOIDmode, nlabel); + n = gen_rtx_LABEL_REF (Pmode, nlabel); else n = gen_rtx_RETURN (VOIDmode); @@ -1541,7 +1554,7 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn) else if (code == RETURN && olabel == 0) { if (nlabel) - x = gen_rtx_LABEL_REF (VOIDmode, nlabel); + x = gen_rtx_LABEL_REF (Pmode, nlabel); else x = gen_rtx_RETURN (VOIDmode); if (loc == &PATTERN (insn)) @@ -1709,10 +1722,13 @@ invert_jump_1 (rtx jump, rtx nlabel) { rtx x = pc_set (jump); int ochanges; + int ok; ochanges = num_validated_changes (); - if (!x || !invert_exp_1 (SET_SRC (x), jump)) - abort (); + gcc_assert (x); + ok = invert_exp_1 (SET_SRC (x), jump); + gcc_assert (ok); + if (num_validated_changes () == ochanges) return 0; @@ -1927,7 +1943,7 @@ rtx_renumbered_equal_p (rtx x, rtx y) break; default: - abort (); + gcc_unreachable (); } } return 1; @@ -1962,9 +1978,8 @@ true_regnum (rtx x) unsigned int reg_or_subregno (rtx reg) { - if (REG_P (reg)) - return REGNO (reg); if (GET_CODE (reg) == SUBREG) - return REGNO (SUBREG_REG (reg)); - abort (); + reg = SUBREG_REG (reg); + gcc_assert (REG_P (reg)); + return REGNO (reg); } diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c index 80e1ef86d0f..940f7470afe 100644 --- a/gcc/lambda-code.c +++ b/gcc/lambda-code.c @@ -115,12 +115,13 @@ Fourier-Motzkin elimination is used to compute the bounds of the base space of the lattice. */ - -DEF_VEC_GC_P(int); +DEF_VEC_P(int); +DEF_VEC_ALLOC_P(int,heap); static bool perfect_nestify (struct loops *, - struct loop *, VEC (tree) *, - VEC (tree) *, VEC (int) *, VEC (tree) *); + struct loop *, VEC(tree,heap) *, + VEC(tree,heap) *, VEC(int,heap) *, + VEC(tree,heap) *); /* Lattice stuff that is internal to the code generation algorithm. */ typedef struct @@ -489,7 +490,7 @@ lcm (int a, int b) } /* Perform Fourier-Motzkin elimination to calculate the bounds of the - auxillary nest. + auxiliary nest. Fourier-Motzkin is a way of reducing systems of linear inequalities so that it is easy to calculate the answer and bounds. A sketch of how it works: @@ -683,7 +684,7 @@ lambda_compute_auxillary_space (lambda_loopnest nest, /* Unfortunately, we can't know the number of constraints we'll have ahead of time, but this should be enough even in ridiculous loop nest - cases. We abort if we go over this limit. */ + cases. We must not go over this limit. */ A = lambda_matrix_new (128, depth); B = lambda_matrix_new (128, invariants); a = lambda_vector_new (128); @@ -800,7 +801,7 @@ lambda_compute_auxillary_space (lambda_loopnest nest, /* Compute the loop bounds for the target space, using the bounds of the auxiliary nest AUXILLARY_NEST, and the triangular matrix H. The target space loop bounds are computed by multiplying the triangular - matrix H by the auxillary nest, to get the new loop bounds. The sign of + matrix H by the auxiliary nest, to get the new loop bounds. The sign of the loop steps (positive or negative) is then used to swap the bounds if the loop counts downwards. Return the target loopnest. */ @@ -1057,8 +1058,8 @@ lambda_compute_step_signs (lambda_trans_matrix trans, lambda_vector stepsigns) 2. Composing the dense base with the specified transformation (TRANS) 3. Decomposing the combined transformation into a lower triangular portion, and a unimodular portion. - 4. Computing the auxillary nest using the unimodular portion. - 5. Computing the target nest using the auxillary nest and the lower + 4. Computing the auxiliary nest using the unimodular portion. + 5. Computing the target nest using the auxiliary nest and the lower triangular portion. */ lambda_loopnest @@ -1152,8 +1153,8 @@ lambda_loopnest_transform (lambda_loopnest nest, lambda_trans_matrix trans) static lambda_linear_expression gcc_tree_to_linear_expression (int depth, tree expr, - VEC(tree) *outerinductionvars, - VEC(tree) *invariants, int extra) + VEC(tree,heap) *outerinductionvars, + VEC(tree,heap) *invariants, int extra) { lambda_linear_expression lle = NULL; switch (TREE_CODE (expr)) @@ -1248,12 +1249,12 @@ invariant_in_loop_and_outer_loops (struct loop *loop, tree op) static lambda_loop gcc_loop_to_lambda_loop (struct loop *loop, int depth, - VEC (tree) ** invariants, + VEC(tree,heap) ** invariants, tree * ourinductionvar, - VEC (tree) * outerinductionvars, - VEC (tree) ** lboundvars, - VEC (tree) ** uboundvars, - VEC (int) ** steps) + VEC(tree,heap) * outerinductionvars, + VEC(tree,heap) ** lboundvars, + VEC(tree,heap) ** uboundvars, + VEC(int,heap) ** steps) { tree phi; tree exit_cond; @@ -1265,7 +1266,6 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth, int stepint; int extra = 0; tree lboundvar, uboundvar, uboundresult; - use_optype uses; /* Find out induction var and exit condition. */ inductionvar = find_induction_var_from_exit_cond (loop); @@ -1294,10 +1294,8 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth, phi = SSA_NAME_DEF_STMT (inductionvar); if (TREE_CODE (phi) != PHI_NODE) { - get_stmt_operands (phi); - uses = STMT_USE_OPS (phi); - - if (!uses) + phi = SINGLE_SSA_TREE_OPERAND (phi, SSA_OP_USE); + if (!phi) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -1307,7 +1305,6 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth, return NULL; } - phi = USE_OP (uses, 0); phi = SSA_NAME_DEF_STMT (phi); if (TREE_CODE (phi) != PHI_NODE) { @@ -1402,12 +1399,13 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth, return NULL; } /* One part of the test may be a loop invariant tree. */ + VEC_reserve (tree, heap, *invariants, 1); if (TREE_CODE (TREE_OPERAND (test, 1)) == SSA_NAME && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 1))) - VEC_safe_push (tree, *invariants, TREE_OPERAND (test, 1)); + VEC_quick_push (tree, *invariants, TREE_OPERAND (test, 1)); else if (TREE_CODE (TREE_OPERAND (test, 0)) == SSA_NAME && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 0))) - VEC_safe_push (tree, *invariants, TREE_OPERAND (test, 0)); + VEC_quick_push (tree, *invariants, TREE_OPERAND (test, 0)); /* The non-induction variable part of the test is the upper bound variable. */ @@ -1439,9 +1437,9 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth, *invariants, extra); uboundresult = build (PLUS_EXPR, TREE_TYPE (uboundvar), uboundvar, build_int_cst (TREE_TYPE (uboundvar), extra)); - VEC_safe_push (tree, *uboundvars, uboundresult); - VEC_safe_push (tree, *lboundvars, lboundvar); - VEC_safe_push (int, *steps, stepint); + VEC_safe_push (tree, heap, *uboundvars, uboundresult); + VEC_safe_push (tree, heap, *lboundvars, lboundvar); + VEC_safe_push (int, heap, *steps, stepint); if (!ubound) { if (dump_file && (dump_flags & TDF_DETAILS)) @@ -1489,7 +1487,9 @@ find_induction_var_from_exit_cond (struct loop *loop) return ivarop; } -DEF_VEC_GC_P(lambda_loop); +DEF_VEC_P(lambda_loop); +DEF_VEC_ALLOC_P(lambda_loop,heap); + /* Generate a lambda loopnest from a gcc loopnest LOOP_NEST. Return the new loop nest. INDUCTIONVARS is a pointer to an array of induction variables for the @@ -1500,18 +1500,18 @@ DEF_VEC_GC_P(lambda_loop); lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loops *currloops, struct loop * loop_nest, - VEC (tree) **inductionvars, - VEC (tree) **invariants, + VEC(tree,heap) **inductionvars, + VEC(tree,heap) **invariants, bool need_perfect_nest) { - lambda_loopnest ret; + lambda_loopnest ret = NULL; struct loop *temp; int depth = 0; size_t i; - VEC (lambda_loop) *loops = NULL; - VEC (tree) *uboundvars = NULL; - VEC (tree) *lboundvars = NULL; - VEC (int) *steps = NULL; + VEC(lambda_loop,heap) *loops = NULL; + VEC(tree,heap) *uboundvars = NULL; + VEC(tree,heap) *lboundvars = NULL; + VEC(int,heap) *steps = NULL; lambda_loop newloop; tree inductionvar = NULL; @@ -1525,8 +1525,8 @@ gcc_loopnest_to_lambda_loopnest (struct loops *currloops, &steps); if (!newloop) return NULL; - VEC_safe_push (tree, *inductionvars, inductionvar); - VEC_safe_push (lambda_loop, loops, newloop); + VEC_safe_push (tree, heap, *inductionvars, inductionvar); + VEC_safe_push (lambda_loop, heap, loops, newloop); temp = temp->inner; } if (need_perfect_nest) @@ -1535,23 +1535,26 @@ gcc_loopnest_to_lambda_loopnest (struct loops *currloops, lboundvars, uboundvars, steps, *inductionvars)) { if (dump_file) - fprintf (dump_file, "Not a perfect loop nest and couldn't convert to one.\n"); - return NULL; + fprintf (dump_file, + "Not a perfect loop nest and couldn't convert to one.\n"); + goto fail; } else if (dump_file) - fprintf (dump_file, "Successfully converted loop nest to perfect loop nest.\n"); - - + fprintf (dump_file, + "Successfully converted loop nest to perfect loop nest.\n"); } ret = lambda_loopnest_new (depth, 2 * depth); for (i = 0; VEC_iterate (lambda_loop, loops, i, newloop); i++) LN_LOOPS (ret)[i] = newloop; - + fail: + VEC_free (lambda_loop, heap, loops); + VEC_free (tree, heap, uboundvars); + VEC_free (tree, heap, lboundvars); + VEC_free (int, heap, steps); + return ret; - } - /* Convert a lambda body vector LBV to a gcc tree, and return the new tree. STMTS_TO_INSERT is a pointer to a tree where the statements we need to be inserted for us are stored. INDUCTION_VARS is the array of induction @@ -1560,8 +1563,8 @@ gcc_loopnest_to_lambda_loopnest (struct loops *currloops, static tree lbv_to_gcc_expression (lambda_body_vector lbv, - tree type, VEC (tree) *induction_vars, - tree * stmts_to_insert) + tree type, VEC(tree,heap) *induction_vars, + tree *stmts_to_insert) { tree stmts, stmt, resvar, name; tree iv; @@ -1643,16 +1646,17 @@ static tree lle_to_gcc_expression (lambda_linear_expression lle, lambda_linear_expression offset, tree type, - VEC(tree) *induction_vars, - VEC(tree) *invariants, - enum tree_code wrap, tree * stmts_to_insert) + VEC(tree,heap) *induction_vars, + VEC(tree,heap) *invariants, + enum tree_code wrap, tree *stmts_to_insert) { tree stmts, stmt, resvar, name; size_t i; tree_stmt_iterator tsi; tree iv, invar; - VEC(tree) *results = NULL; + VEC(tree,heap) *results = NULL; + gcc_assert (wrap == MAX_EXPR || wrap == MIN_EXPR); name = NULL_TREE; /* Create a statement list and a linear expression temporary. */ stmts = alloc_stmt_list (); @@ -1785,16 +1789,10 @@ lle_to_gcc_expression (lambda_linear_expression lle, /* Handle any denominator that occurs. */ if (LLE_DENOMINATOR (lle) != 1) { - if (wrap == MAX_EXPR) - stmt = build (MODIFY_EXPR, void_type_node, resvar, - build (CEIL_DIV_EXPR, type, name, - build_int_cst (type, LLE_DENOMINATOR (lle)))); - else if (wrap == MIN_EXPR) - stmt = build (MODIFY_EXPR, void_type_node, resvar, - build (FLOOR_DIV_EXPR, type, name, - build_int_cst (type, LLE_DENOMINATOR (lle)))); - else - gcc_unreachable(); + stmt = build_int_cst (type, LLE_DENOMINATOR (lle)); + stmt = build (wrap == MAX_EXPR ? CEIL_DIV_EXPR : FLOOR_DIV_EXPR, + type, name, stmt); + stmt = build (MODIFY_EXPR, void_type_node, resvar, stmt); /* name = {ceil, floor}(name/denominator) */ name = make_ssa_name (resvar, stmt); @@ -1802,7 +1800,7 @@ lle_to_gcc_expression (lambda_linear_expression lle, tsi = tsi_last (stmts); tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING); } - VEC_safe_push (tree, results, name); + VEC_safe_push (tree, heap, results, name); } /* Again, out of laziness, we don't handle this case yet. It's not @@ -1822,6 +1820,8 @@ lle_to_gcc_expression (lambda_linear_expression lle, tsi_link_after (&tsi, stmt, TSI_CONTINUE_LINKING); } + VEC_free (tree, heap, results); + *stmts_to_insert = stmts; return name; } @@ -1840,16 +1840,15 @@ lle_to_gcc_expression (lambda_linear_expression lle, void lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, - VEC(tree) *old_ivs, - VEC(tree) *invariants, + VEC(tree,heap) *old_ivs, + VEC(tree,heap) *invariants, lambda_loopnest new_loopnest, lambda_trans_matrix transform) { - struct loop *temp; size_t i = 0; size_t depth = 0; - VEC(tree) *new_ivs = NULL; + VEC(tree,heap) *new_ivs = NULL; tree oldiv; block_stmt_iterator bsi; @@ -1874,6 +1873,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, lambda_linear_expression offset; tree type; bool insert_after; + tree inc_stmt; oldiv = VEC_index (tree, old_ivs, i); type = TREE_TYPE (oldiv); @@ -1883,7 +1883,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, ivvar = create_tmp_var (type, "lnivtmp"); add_referenced_tmp_var (ivvar); - VEC_safe_push (tree, new_ivs, ivvar); + VEC_safe_push (tree, heap, new_ivs, ivvar); newloop = LN_LOOPS (new_loopnest)[i]; @@ -1922,7 +1922,20 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, create_iv (newlowerbound, build_int_cst (type, LL_STEP (newloop)), ivvar, temp, &bsi, insert_after, &ivvar, - &ivvarinced); + NULL); + + /* Unfortunately, the incremented ivvar that create_iv inserted may not + dominate the block containing the exit condition. + So we simply create our own incremented iv to use in the new exit + test, and let redundancy elimination sort it out. */ + inc_stmt = build (PLUS_EXPR, type, + ivvar, build_int_cst (type, LL_STEP (newloop))); + inc_stmt = build (MODIFY_EXPR, void_type_node, SSA_NAME_VAR (ivvar), + inc_stmt); + ivvarinced = make_ssa_name (SSA_NAME_VAR (ivvar), inc_stmt); + TREE_OPERAND (inc_stmt, 0) = ivvarinced; + bsi = bsi_for_stmt (exitcond); + bsi_insert_before (&bsi, inc_stmt, BSI_SAME_STMT); /* Replace the exit condition with the new upper bound comparison. */ @@ -1939,7 +1952,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, COND_EXPR_COND (exitcond) = build (testtype, boolean_type_node, newupperbound, ivvarinced); - modify_stmt (exitcond); + update_stmt (exitcond); VEC_replace (tree, new_ivs, i, ivvar); i++; @@ -1951,11 +1964,20 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, for (i = 0; VEC_iterate (tree, old_ivs, i, oldiv); i++) { - int j; - dataflow_t imm = get_immediate_uses (SSA_NAME_DEF_STMT (oldiv)); - for (j = 0; j < num_immediate_uses (imm); j++) + imm_use_iterator imm_iter; + use_operand_p imm_use; + tree oldiv_def; + tree oldiv_stmt = SSA_NAME_DEF_STMT (oldiv); + + if (TREE_CODE (oldiv_stmt) == PHI_NODE) + oldiv_def = PHI_RESULT (oldiv_stmt); + else + oldiv_def = SINGLE_SSA_TREE_OPERAND (oldiv_stmt, SSA_OP_DEF); + gcc_assert (oldiv_def != NULL_TREE); + + FOR_EACH_IMM_USE_SAFE (imm_use, imm_iter, oldiv_def) { - tree stmt = immediate_use (imm, j); + tree stmt = USE_STMT (imm_use); use_operand_p use_p; ssa_op_iter iter; gcc_assert (TREE_CODE (stmt) != PHI_NODE); @@ -1980,15 +2002,15 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest, expression. */ bsi_insert_before (&bsi, stmts, BSI_SAME_STMT); propagate_value (use_p, newiv); - modify_stmt (stmt); + update_stmt (stmt); } } } } + VEC_free (tree, heap, new_ivs); } - /* Returns true when the vector V is lexicographically positive, in other words, when the first nonzero element is positive. */ @@ -2043,16 +2065,11 @@ phi_loop_edge_uses_def (struct loop *loop, tree phi, tree def) static bool stmt_uses_phi_result (tree stmt, tree phi_result) { - use_optype uses = STMT_USE_OPS (stmt); + tree use = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_USE); /* This is conservatively true, because we only want SIMPLE bumpers of the form x +- constant for our pass. */ - if (NUM_USES (uses) != 1) - return false; - if (USE_OP (uses, 0) == phi_result) - return true; - - return false; + return (use == phi_result); } /* STMT is a bumper stmt for LOOP if the version it defines is used in the @@ -2066,17 +2083,16 @@ stmt_is_bumper_for_loop (struct loop *loop, tree stmt) { tree use; tree def; - def_optype defs = STMT_DEF_OPS (stmt); - dataflow_t imm; - int i; + imm_use_iterator iter; + use_operand_p use_p; - if (NUM_DEFS (defs) != 1) + def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF); + if (!def) return false; - def = DEF_OP (defs, 0); - imm = get_immediate_uses (stmt); - for (i = 0; i < num_immediate_uses (imm); i++) + + FOR_EACH_IMM_USE_FAST (use_p, iter, def) { - use = immediate_use (imm, i); + use = USE_STMT (use_p); if (TREE_CODE (use) == PHI_NODE) { if (phi_loop_edge_uses_def (loop, use, def)) @@ -2154,12 +2170,13 @@ perfect_nest_p (struct loop *loop) static void replace_uses_of_x_with_y (tree stmt, tree x, tree y) { - use_optype uses = STMT_USE_OPS (stmt); - size_t i; - for (i = 0; i < NUM_USES (uses); i++) + ssa_op_iter iter; + use_operand_p use_p; + + FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE) { - if (USE_OP (uses, i) == x) - SET_USE_OP (uses, i, y); + if (USE_FROM_PTR (use_p) == x) + SET_USE (use_p, y); } } @@ -2168,11 +2185,12 @@ replace_uses_of_x_with_y (tree stmt, tree x, tree y) static bool stmt_uses_op (tree stmt, tree op) { - use_optype uses = STMT_USE_OPS (stmt); - size_t i; - for (i = 0; i < NUM_USES (uses); i++) + ssa_op_iter iter; + tree use; + + FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE) { - if (USE_OP (uses, i) == op) + if (use == op) return true; } return false; @@ -2185,7 +2203,7 @@ stmt_uses_op (tree stmt, tree op) static bool can_convert_to_perfect_nest (struct loop *loop, - VEC (tree) *loopivs) + VEC(tree,heap) *loopivs) { basic_block *bbs; tree exit_condition, phi; @@ -2209,30 +2227,26 @@ can_convert_to_perfect_nest (struct loop *loop, { size_t j; tree stmt = bsi_stmt (bsi); + tree iv; + if (stmt == exit_condition || not_interesting_stmt (stmt) || stmt_is_bumper_for_loop (loop, stmt)) continue; /* If the statement uses inner loop ivs, we == screwed. */ - for (j = 1; j < VEC_length (tree, loopivs); j++) - if (stmt_uses_op (stmt, VEC_index (tree, loopivs, j))) - { - free (bbs); - return false; - } + for (j = 1; VEC_iterate (tree, loopivs, j, iv); j++) + if (stmt_uses_op (stmt, iv)) + goto fail; /* If the bb of a statement we care about isn't dominated by the header of the inner loop, then we are also screwed. */ if (!dominated_by_p (CDI_DOMINATORS, bb_for_stmt (stmt), loop->inner->header)) - { - free (bbs); - return false; - } + goto fail; } } - } + } /* We also need to make sure the loop exit only has simple copy phis in it, otherwise we don't know how to transform it into a perfect nest right @@ -2241,9 +2255,14 @@ can_convert_to_perfect_nest (struct loop *loop, for (phi = phi_nodes (exitdest); phi; phi = PHI_CHAIN (phi)) if (PHI_NUM_ARGS (phi) != 1) - return false; - + goto fail; + + free (bbs); return true; + + fail: + free (bbs); + return false; } /* Transform the loop nest into a perfect nest, if possible. @@ -2285,10 +2304,10 @@ can_convert_to_perfect_nest (struct loop *loop, static bool perfect_nestify (struct loops *loops, struct loop *loop, - VEC (tree) *lbounds, - VEC (tree) *ubounds, - VEC (int) *steps, - VEC (tree) *loopivs) + VEC(tree,heap) *lbounds, + VEC(tree,heap) *ubounds, + VEC(int,heap) *steps, + VEC(tree,heap) *loopivs) { basic_block *bbs; tree exit_condition; @@ -2303,7 +2322,7 @@ perfect_nestify (struct loops *loops, tree uboundvar; tree stmt; tree oldivvar, ivvar, ivvarinced; - VEC (tree) *phis = NULL; + VEC(tree,heap) *phis = NULL; if (!can_convert_to_perfect_nest (loop, loopivs)) return false; @@ -2317,8 +2336,9 @@ perfect_nestify (struct loops *loops, /* Push the exit phi nodes that we are moving. */ for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi)) { - VEC_safe_push (tree, phis, PHI_RESULT (phi)); - VEC_safe_push (tree, phis, PHI_ARG_DEF (phi, 0)); + VEC_reserve (tree, heap, phis, 2); + VEC_quick_push (tree, phis, PHI_RESULT (phi)); + VEC_quick_push (tree, phis, PHI_ARG_DEF (phi, 0)); } e = redirect_edge_and_branch (single_succ_edge (preheaderbb), headerbb); @@ -2339,8 +2359,9 @@ perfect_nestify (struct loops *loops, phiname = VEC_pop (tree, phis); phi = create_phi_node (phiname, preheaderbb); add_phi_arg (phi, def, single_pred_edge (preheaderbb)); - } + } flush_pending_stmts (e); + VEC_free (tree, heap, phis); bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb); latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb); @@ -2366,7 +2387,6 @@ perfect_nestify (struct loops *loops, add_bb_to_loop (latchbb, newloop); add_bb_to_loop (bodybb, newloop); add_bb_to_loop (headerbb, newloop); - add_bb_to_loop (preheaderbb, olddest->loop_father); set_immediate_dominator (CDI_DOMINATORS, bodybb, headerbb); set_immediate_dominator (CDI_DOMINATORS, headerbb, preheaderbb); set_immediate_dominator (CDI_DOMINATORS, preheaderbb, @@ -2416,7 +2436,9 @@ perfect_nestify (struct loops *loops, incremented when we do. */ for (bsi = bsi_start (bbs[i]); !bsi_end_p (bsi);) { - tree stmt = bsi_stmt (bsi); + ssa_op_iter i; + tree n, stmt = bsi_stmt (bsi); + if (stmt == exit_condition || not_interesting_stmt (stmt) || stmt_is_bumper_for_loop (loop, stmt)) @@ -2424,11 +2446,19 @@ perfect_nestify (struct loops *loops, bsi_next (&bsi); continue; } + replace_uses_of_x_with_y (stmt, oldivvar, ivvar); bsi_move_before (&bsi, &tobsi); + + /* If the statement has any virtual operands, they may + need to be rewired because the original loop may + still reference them. */ + FOR_EACH_SSA_TREE_OPERAND (n, stmt, i, SSA_OP_ALL_VIRTUALS) + mark_sym_for_renaming (SSA_NAME_VAR (n)); } } } + free (bbs); return perfect_nest_p (loop); } @@ -2455,11 +2485,8 @@ lambda_transform_legal_p (lambda_trans_matrix trans, lambda_vector distres; struct data_dependence_relation *ddr; -#if defined ENABLE_CHECKING - if (LTM_COLSIZE (trans) != nb_loops - || LTM_ROWSIZE (trans) != nb_loops) - abort (); -#endif + gcc_assert (LTM_COLSIZE (trans) == nb_loops + && LTM_ROWSIZE (trans) == nb_loops); /* When there is an unknown relation in the dependence_relations, we know that it is no worth looking at this loop nest: give up. */ diff --git a/gcc/lambda-mat.c b/gcc/lambda-mat.c index 8aa3c12a70a..cdd033079bc 100644 --- a/gcc/lambda-mat.c +++ b/gcc/lambda-mat.c @@ -1,5 +1,5 @@ /* Integer matrix math routines - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Daniel Berlin . This file is part of GCC. @@ -401,9 +401,8 @@ lambda_matrix_inverse_hard (lambda_matrix mat, lambda_matrix inv, int n) row = temp[j]; diagonal = row[j]; - /* If the matrix is singular, abort. */ - if (diagonal == 0) - abort (); + /* The matrix must not be singular. */ + gcc_assert (diagonal); determinant = determinant * diagonal; diff --git a/gcc/lambda.h b/gcc/lambda.h index 98fe6bd1ca6..aaf40dc09d3 100644 --- a/gcc/lambda.h +++ b/gcc/lambda.h @@ -1,5 +1,5 @@ /* Lambda matrix and vector interface. - Copyright (C) 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Daniel Berlin This file is part of GCC. @@ -196,13 +196,12 @@ lambda_body_vector lambda_body_vector_compute_new (lambda_trans_matrix, void print_lambda_body_vector (FILE *, lambda_body_vector); lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loops *, struct loop *, - VEC(tree) **, - VEC(tree) **, + VEC(tree,heap) **, + VEC(tree,heap) **, bool); -void lambda_loopnest_to_gcc_loopnest (struct loop *, VEC(tree) *, - VEC(tree) *, - lambda_loopnest, - lambda_trans_matrix); +void lambda_loopnest_to_gcc_loopnest (struct loop *, + VEC(tree,heap) *, VEC(tree,heap) *, + lambda_loopnest, lambda_trans_matrix); static inline void lambda_vector_negate (lambda_vector, lambda_vector, int); @@ -326,19 +325,15 @@ lambda_vector_min_nz (lambda_vector vec1, int n, int start) { int j; int min = -1; -#ifdef ENABLE_CHECKING - if (start > n) - abort (); -#endif + + gcc_assert (start <= n); for (j = start; j < n; j++) { if (vec1[j]) if (min < 0 || vec1[j] < vec1[min]) min = j; } - - if (min < 0) - abort (); + gcc_assert (min >= 0); return min; } diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index fc6decaaf85..67ea0f325dc 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -267,7 +267,6 @@ extern tree lhd_make_node (enum tree_code); LANG_HOOKS_EXPAND_CONSTANT, \ LANG_HOOKS_EXPAND_EXPR, \ LANG_HOOKS_EXPAND_DECL, \ - LANG_HOOKS_TRUTHVALUE_CONVERSION, \ LANG_HOOKS_SAFE_FROM_P, \ LANG_HOOKS_FINISH_INCOMPLETE_DECL, \ LANG_HOOKS_MARK_ADDRESSABLE, \ diff --git a/gcc/langhooks.c b/gcc/langhooks.c index 12119a88fa1..94e08e6f8cb 100644 --- a/gcc/langhooks.c +++ b/gcc/langhooks.c @@ -158,37 +158,31 @@ lhd_set_decl_assembler_name (tree decl) DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and VAR_DECLs for variables with static storage duration need a real DECL_ASSEMBLER_NAME. */ - if (TREE_CODE (decl) == FUNCTION_DECL - || (TREE_CODE (decl) == VAR_DECL - && (TREE_STATIC (decl) - || DECL_EXTERNAL (decl) - || TREE_PUBLIC (decl)))) + gcc_assert (TREE_CODE (decl) == FUNCTION_DECL + || (TREE_CODE (decl) == VAR_DECL + && (TREE_STATIC (decl) + || DECL_EXTERNAL (decl) + || TREE_PUBLIC (decl)))); + + /* By default, assume the name to use in assembly code is the same + as that used in the source language. (That's correct for C, and + GCC used to set DECL_ASSEMBLER_NAME to the same value as + DECL_NAME in build_decl, so this choice provides backwards + compatibility with existing front-ends. + + Can't use just the variable's own name for a variable whose scope + is less than the whole compilation. Concatenate a distinguishing + number - we use the DECL_UID. */ + if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE) + SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl)); + else { - /* By default, assume the name to use in assembly code is the - same as that used in the source language. (That's correct - for C, and GCC used to set DECL_ASSEMBLER_NAME to the same - value as DECL_NAME in build_decl, so this choice provides - backwards compatibility with existing front-ends. - - Can't use just the variable's own name for a variable whose - scope is less than the whole compilation. Concatenate a - distinguishing number - we use the DECL_UID. */ - if (TREE_PUBLIC (decl) || DECL_CONTEXT (decl) == NULL_TREE) - SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl)); - else - { - const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); - char *label; - - ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl)); - SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label)); - } + const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); + char *label; + + ASM_FORMAT_PRIVATE_NAME (label, name, DECL_UID (decl)); + SET_DECL_ASSEMBLER_NAME (decl, get_identifier (label)); } - else - /* Nobody should ever be asking for the DECL_ASSEMBLER_NAME of - these DECLs -- unless they're in language-dependent code, in - which case set_decl_assembler_name hook should handle things. */ - abort (); } /* By default we always allow bit-field based optimizations. */ @@ -202,7 +196,7 @@ lhd_can_use_bit_fields_p (void) tree lhd_type_promotes_to (tree ARG_UNUSED (type)) { - abort (); + gcc_unreachable (); } /* Registration of machine- or os-specific builtin types. */ @@ -216,10 +210,8 @@ lhd_register_builtin_type (tree ARG_UNUSED (type), void lhd_incomplete_type_error (tree ARG_UNUSED (value), tree type) { - if (TREE_CODE (type) == ERROR_MARK) - return; - - abort (); + gcc_assert (TREE_CODE (type) == ERROR_MARK); + return; } /* Provide a default routine for alias sets that always returns -1. This @@ -248,7 +240,7 @@ lhd_expand_expr (tree ARG_UNUSED (t), rtx ARG_UNUSED (r), int ARG_UNUSED (em), rtx * ARG_UNUSED (a)) { - abort (); + gcc_unreachable (); } /* The default language-specific function for expanding a decl. After @@ -288,10 +280,10 @@ lhd_types_compatible_p (tree x, tree y) handle language-specific tree codes, as well as language-specific information associated to common tree codes. If a tree node is completely handled within this function, it should set *SUBTREES to - 0, so that generic handling isn't attempted. For language-specific - tree codes, generic handling would abort(), so make sure it is set - properly. Both SUBTREES and *SUBTREES is guaranteed to be nonzero - when the function is called. */ + 0, so that generic handling isn't attempted. The generic handling + cannot deal with language-specific tree codes, so make sure it is + set properly. Both SUBTREES and *SUBTREES is guaranteed to be + nonzero when the function is called. */ tree lhd_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED, @@ -444,8 +436,7 @@ lhd_gimplify_expr (tree *expr_p ATTRIBUTE_UNUSED, tree *pre_p ATTRIBUTE_UNUSED, size_t lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED) { - abort (); - return 0; + gcc_unreachable (); } /* Return true if decl, which is a function decl, may be called by a diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 97b8f5e1ce4..e10592c9871 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -120,7 +120,7 @@ struct lang_hooks_for_types /* Given a type, apply default promotions to unnamed function arguments and return the new type. Return the same type if no change. Required by any language that supports variadic - arguments. The default hook aborts. */ + arguments. The default hook dies. */ tree (*type_promotes_to) (tree); /* Register TYPE as a builtin type with the indicated NAME. The @@ -207,7 +207,7 @@ struct lang_hooks /* Determines the size of any language-specific tcc_constant or tcc_exceptional nodes. Since it is called from make_node, the - only information available is the tree code. Expected to abort + only information available is the tree code. Expected to die on unrecognized codes. */ size_t (*tree_size) (enum tree_code); @@ -277,19 +277,6 @@ struct lang_hooks 1 if handled, 0 otherwise. */ int (*expand_decl) (tree); - /* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical - operation. - - This preparation consists of taking the ordinary representation - of an expression expr and producing a valid tree boolean - expression describing whether expr is nonzero. We could simply - always do build_binary_op (NE_EXPR, expr, integer_zero_node, 1), - but we optimize comparisons, &&, ||, and !. - - The result should be an expression of boolean type (if not an - error_mark_node). */ - tree (*truthvalue_conversion) (tree); - /* Hook called by safe_from_p for language-specific tree codes. It is up to the language front-end to install a hook if it has any such codes that safe_from_p needs to know about. Since same_from_p will diff --git a/gcc/lcm.c b/gcc/lcm.c index 4f2f4062ce6..210e4d600b1 100644 --- a/gcc/lcm.c +++ b/gcc/lcm.c @@ -1000,7 +1000,7 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes) insert the final mode switch before the return value copy to its hard register. */ if (EDGE_COUNT (EXIT_BLOCK_PTR->preds) == 1 - && GET_CODE ((last_insn = BB_END (src_bb))) == INSN + && NONJUMP_INSN_P ((last_insn = BB_END (src_bb))) && GET_CODE (PATTERN (last_insn)) == USE && GET_CODE ((ret_reg = XEXP (PATTERN (last_insn), 0))) == REG) { @@ -1101,23 +1101,27 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes) last_insn = return_copy; } while (nregs); + /* If we didn't see a full return value copy, verify that there is a plausible reason for this. If some, but not all of the return register is likely spilled, we can expect that there is a copy for the likely spilled part. */ - if (nregs - && ! forced_late_switch - && ! short_block - && CLASS_LIKELY_SPILLED_P (REGNO_REG_CLASS (ret_start)) - && nregs == hard_regno_nregs[ret_start][GET_MODE (ret_reg)] - /* For multi-hard-register floating point values, - sometimes the likely-spilled part is ordinarily copied - first, then the other part is set with an arithmetic - operation. This doesn't actually cause reload failures, - so let it pass. */ - && (GET_MODE_CLASS (GET_MODE (ret_reg)) == MODE_INT - || nregs == 1)) - abort (); + gcc_assert (!nregs + || forced_late_switch + || short_block + || !(CLASS_LIKELY_SPILLED_P + (REGNO_REG_CLASS (ret_start))) + || (nregs + != hard_regno_nregs[ret_start][GET_MODE (ret_reg)]) + /* For multi-hard-register floating point + values, sometimes the likely-spilled part + is ordinarily copied first, then the other + part is set with an arithmetic operation. + This doesn't actually cause reload + failures, so let it pass. */ + || (GET_MODE_CLASS (GET_MODE (ret_reg)) != MODE_INT + && nregs != 1)); + if (INSN_P (last_insn)) { before_return_copy @@ -1370,21 +1374,23 @@ optimize_mode_switching (FILE *file) emited = true; if (JUMP_P (BB_END (src_bb))) emit_insn_before (mode_set, BB_END (src_bb)); - /* It doesn't make sense to switch to normal mode - after a CALL_INSN, so we're going to abort if we - find one. The cases in which a CALL_INSN may - have an abnormal edge are sibcalls and EH edges. - In the case of sibcalls, the dest basic-block is - the EXIT_BLOCK, that runs in normal mode; it is - assumed that a sibcall insn requires normal mode - itself, so no mode switch would be required after - the call (it wouldn't make sense, anyway). In - the case of EH edges, EH entry points also start - in normal mode, so a similar reasoning applies. */ - else if (NONJUMP_INSN_P (BB_END (src_bb))) - emit_insn_after (mode_set, BB_END (src_bb)); else - abort (); + { + /* It doesn't make sense to switch to normal + mode after a CALL_INSN. The cases in which a + CALL_INSN may have an abnormal edge are + sibcalls and EH edges. In the case of + sibcalls, the dest basic-block is the + EXIT_BLOCK, that runs in normal mode; it is + assumed that a sibcall insn requires normal + mode itself, so no mode switch would be + required after the call (it wouldn't make + sense, anyway). In the case of EH edges, EH + entry points also start in normal mode, so a + similar reasoning applies. */ + gcc_assert (NONJUMP_INSN_P (BB_END (src_bb))); + emit_insn_after (mode_set, BB_END (src_bb)); + } bb_info[j][src_bb->index].computing = mode; RESET_BIT (transp[src_bb->index], j); } diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 68623c37122..a303d0bce25 100644 --- a/gcc/libgcc2.c +++ b/gcc/libgcc2.c @@ -29,24 +29,11 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* We include auto-host.h here to get HAVE_GAS_HIDDEN. This is - supposedly valid even though this is a "target" file. */ -#include "auto-host.h" - -/* It is incorrect to include config.h here, because this file is being - compiled for the target, and hence definitions concerning only the host - do not apply. */ #include "tconfig.h" #include "tsystem.h" #include "coretypes.h" #include "tm.h" -/* Don't use `fancy_abort' here even if config.h says to use it. */ -#ifdef abort -#undef abort -#endif - #ifdef HAVE_GAS_HIDDEN #define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden"))) #else @@ -1256,7 +1243,7 @@ __fixdfdi (DFtype a) } #endif -#ifdef L_fixunssfdi +#if defined(L_fixunssfdi) && LIBGCC2_HAS_SF_MODE DWtype __fixunssfDI (SFtype a) { @@ -1320,7 +1307,7 @@ __fixunssfDI (SFtype a) } #endif -#ifdef L_fixsfdi +#if defined(L_fixsfdi) && LIBGCC2_HAS_SF_MODE DWtype __fixsfdi (SFtype a) { @@ -1363,7 +1350,7 @@ __floatdidf (DWtype u) } #endif -#ifdef L_floatdisf +#if defined(L_floatdisf) && LIBGCC2_HAS_SF_MODE #define DI_SIZE (W_TYPE_SIZE * 2) #define SF_SIZE FLT_MANT_DIG @@ -1495,7 +1482,7 @@ __fixunsdfSI (DFtype a) } #endif -#ifdef L_fixunssfsi +#if defined(L_fixunssfsi) && LIBGCC2_HAS_SF_MODE /* Reenable the normal types, in case limits.h needs them. */ #undef char #undef short @@ -1520,7 +1507,7 @@ __fixunssfSI (SFtype a) /* Integer power helper used from __builtin_powi for non-constant exponents. */ -#if defined(L_powisf2) \ +#if (defined(L_powisf2) && LIBGCC2_HAS_SF_MODE) \ || (defined(L_powidf2) && LIBGCC2_HAS_DF_MODE) \ || (defined(L_powixf2) && LIBGCC2_HAS_XF_MODE) \ || (defined(L_powitf2) && LIBGCC2_HAS_TF_MODE) @@ -1538,10 +1525,12 @@ __fixunssfSI (SFtype a) # define NAME __powitf2 # endif +#undef int +#undef unsigned TYPE -NAME (TYPE x, Wtype m) +NAME (TYPE x, int m) { - UWtype n = m < 0 ? -m : m; + unsigned int n = m < 0 ? -m : m; TYPE y = n % 2 ? x : 1; while (n >>= 1) { @@ -1554,7 +1543,7 @@ NAME (TYPE x, Wtype m) #endif -#if defined(L_mulsc3) || defined(L_divsc3) \ +#if ((defined(L_mulsc3) || defined(L_divsc3)) && LIBGCC2_HAS_SF_MODE) \ || ((defined(L_muldc3) || defined(L_divdc3)) && LIBGCC2_HAS_DF_MODE) \ || ((defined(L_mulxc3) || defined(L_divxc3)) && LIBGCC2_HAS_XF_MODE) \ || ((defined(L_multc3) || defined(L_divtc3)) && LIBGCC2_HAS_TF_MODE) @@ -1903,6 +1892,7 @@ TRANSFER_FROM_TRAMPOLINE #ifdef L__main #include "gbl-ctors.h" + /* Some systems use __main in a way incompatible with its use in gcc, in these cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to give the same symbol without quotes for an alternative entry point. You @@ -1912,7 +1902,7 @@ TRANSFER_FROM_TRAMPOLINE #define SYMBOL__MAIN __main #endif -#ifdef INIT_SECTION_ASM_OP +#if defined (INIT_SECTION_ASM_OP) || defined (INIT_ARRAY_SECTION_ASM_OP) #undef HAS_INIT_SECTION #define HAS_INIT_SECTION #endif diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h index d1df220f9dd..cc4c13f7902 100644 --- a/gcc/libgcc2.h +++ b/gcc/libgcc2.h @@ -58,17 +58,25 @@ extern short int __get_eh_table_version (struct exception_descriptor *); #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE LONG_DOUBLE_TYPE_SIZE #endif +#ifndef LIBGCC2_HAS_SF_MODE +#define LIBGCC2_HAS_SF_MODE (BITS_PER_UNIT == 8) +#endif + #ifndef LIBGCC2_HAS_DF_MODE #define LIBGCC2_HAS_DF_MODE \ - (LIBGCC2_DOUBLE_TYPE_SIZE == 64 || LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64) + (BITS_PER_UNIT == 8 \ + && (LIBGCC2_DOUBLE_TYPE_SIZE == 64 \ + || LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 64)) #endif #ifndef LIBGCC2_HAS_XF_MODE -#define LIBGCC2_HAS_XF_MODE (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80) +#define LIBGCC2_HAS_XF_MODE \ + (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 80) #endif #ifndef LIBGCC2_HAS_TF_MODE -#define LIBGCC2_HAS_TF_MODE (LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128) +#define LIBGCC2_HAS_TF_MODE \ + (BITS_PER_UNIT == 8 && LIBGCC2_LONG_DOUBLE_TYPE_SIZE == 128) #endif #ifndef MIN_UNITS_PER_WORD @@ -104,11 +112,10 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); #endif #endif -#if BITS_PER_UNIT == 8 - +#if LIBGCC2_HAS_SF_MODE typedef float SFtype __attribute__ ((mode (SF))); typedef _Complex float SCtype __attribute__ ((mode (SC))); - +#endif #if LIBGCC2_HAS_DF_MODE typedef float DFtype __attribute__ ((mode (DF))); typedef _Complex float DCtype __attribute__ ((mode (DC))); @@ -122,29 +129,6 @@ typedef float TFtype __attribute__ ((mode (TF))); typedef _Complex float TCtype __attribute__ ((mode (TC))); #endif -#else /* BITS_PER_UNIT != 8 */ - -/* On dsp's there are usually qf/hf/tqf modes used instead of the above. - For now we don't support them in libgcc2.c. */ - -#undef L_fixdfdi -#undef L_fixsfdi -#undef L_fixtfdi -#undef L_fixunsdfdi -#undef L_fixunsdfsi -#undef L_fixunssfdi -#undef L_fixunssfsi -#undef L_fixunstfdi -#undef L_fixunsxfdi -#undef L_fixunsxfsi -#undef L_fixxfdi -#undef L_floatdidf -#undef L_floatdisf -#undef L_floatditf -#undef L_floatdixf - -#endif /* BITS_PER_UNIT != 8 */ - typedef int word_type __attribute__ ((mode (__word__))); /* Make sure that we don't accidentally use any normal C language built-in @@ -330,21 +314,22 @@ extern SItype __mulvsi3 (SItype, SItype); extern SItype __negvsi2 (SItype); #endif /* COMPAT_SIMODE_TRAPPING_ARITHMETIC */ -#if BITS_PER_UNIT == 8 +#undef int +#if LIBGCC2_HAS_SF_MODE extern DWtype __fixsfdi (SFtype); extern SFtype __floatdisf (DWtype); extern UWtype __fixunssfSI (SFtype); extern DWtype __fixunssfDI (SFtype); -extern SFtype __powisf2 (SFtype, Wtype); +extern SFtype __powisf2 (SFtype, int); extern SCtype __divsc3 (SFtype, SFtype, SFtype, SFtype); extern SCtype __mulsc3 (SFtype, SFtype, SFtype, SFtype); - +#endif #if LIBGCC2_HAS_DF_MODE extern DWtype __fixdfdi (DFtype); extern DFtype __floatdidf (DWtype); extern UWtype __fixunsdfSI (DFtype); extern DWtype __fixunsdfDI (DFtype); -extern DFtype __powidf2 (DFtype, Wtype); +extern DFtype __powidf2 (DFtype, int); extern DCtype __divdc3 (DFtype, DFtype, DFtype, DFtype); extern DCtype __muldc3 (DFtype, DFtype, DFtype, DFtype); #endif @@ -354,7 +339,7 @@ extern DWtype __fixxfdi (XFtype); extern DWtype __fixunsxfDI (XFtype); extern XFtype __floatdixf (DWtype); extern UWtype __fixunsxfSI (XFtype); -extern XFtype __powixf2 (XFtype, Wtype); +extern XFtype __powixf2 (XFtype, int); extern XCtype __divxc3 (XFtype, XFtype, XFtype, XFtype); extern XCtype __mulxc3 (XFtype, XFtype, XFtype, XFtype); #endif @@ -363,11 +348,11 @@ extern XCtype __mulxc3 (XFtype, XFtype, XFtype, XFtype); extern DWtype __fixunstfDI (TFtype); extern DWtype __fixtfdi (TFtype); extern TFtype __floatditf (DWtype); -extern TFtype __powitf2 (TFtype, Wtype); +extern TFtype __powitf2 (TFtype, int); extern TCtype __divtc3 (TFtype, TFtype, TFtype, TFtype); extern TCtype __multc3 (TFtype, TFtype, TFtype, TFtype); #endif -#endif /* BITS_PER_UNIT == 8 */ +#define int bogus_type /* DWstructs are pairs of Wtype values in the order determined by LIBGCC2_WORDS_BIG_ENDIAN. */ diff --git a/gcc/libgcov.c b/gcc/libgcov.c index 49cf3c7004c..3731a9ec9b7 100644 --- a/gcc/libgcov.c +++ b/gcc/libgcov.c @@ -1,7 +1,7 @@ /* Routines required for instrumenting a program. */ /* Compile this one with gcc. */ /* Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -29,10 +29,6 @@ along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* It is incorrect to include config.h here, because this file is being - compiled for the target, and hence definitions concerning only the host - do not apply. */ - #include "tconfig.h" #include "tsystem.h" #include "coretypes.h" @@ -92,8 +88,49 @@ static struct gcov_info *gcov_list; object file included in multiple programs. */ static gcov_unsigned_t gcov_crc32; +/* Size of the longest file name. */ +static size_t gcov_max_filename = 0; + +/* Make sure path component of the given FILENAME exists, create + missing directories. FILENAME must be writable. + Returns zero on success, or -1 if an error occurred. */ + +static int +create_file_directory (char *filename) +{ + char *s; + + for (s = filename + 1; *s != '\0'; s++) + if (IS_DIR_SEPARATOR(*s)) + { + char sep = *s; + *s = '\0'; + + /* Try to make directory if it doesn't already exist. */ + if (access (filename, F_OK) == -1 + && mkdir (filename, 0755) == -1 + /* The directory might have been made by another process. */ + && errno != EEXIST) + { + fprintf (stderr, "profiling:%s:Cannot create directory\n", + filename); + *s = sep; + return -1; + }; + + *s = sep; + }; + return 0; +} + +/* Check if VERSION of the info block PTR matches libgcov one. + Return 1 on success, or zero in case of versions mismatch. + If FILENAME is not NULL, its value used for reporting purposes + instead of value from the info block. */ + static int -gcov_version (struct gcov_info *ptr, gcov_unsigned_t version) +gcov_version (struct gcov_info *ptr, gcov_unsigned_t version, + const char *filename) { if (version != GCOV_VERSION) { @@ -104,7 +141,7 @@ gcov_version (struct gcov_info *ptr, gcov_unsigned_t version) fprintf (stderr, "profiling:%s:Version mismatch - expected %.4s got %.4s\n", - ptr->filename, e, v); + filename? filename : ptr->filename, e, v); return 0; } return 1; @@ -127,6 +164,10 @@ gcov_exit (void) const struct gcov_ctr_info *ci_ptr; unsigned t_ix; gcov_unsigned_t c_num; + const char *gcov_prefix; + int gcov_prefix_strip = 0; + size_t prefix_length; + char *gi_filename, *gi_filename_up; memset (&all, 0, sizeof (all)); /* Find the totals for this execution. */ @@ -151,6 +192,35 @@ gcov_exit (void) } } + /* Get file name relocation prefix. Non-absolute values are ignored. */ + gcov_prefix = getenv("GCOV_PREFIX"); + if (gcov_prefix && IS_ABSOLUTE_PATH (gcov_prefix)) + { + /* Check if the level of dirs to strip off specified. */ + char *tmp = getenv("GCOV_PREFIX_STRIP"); + if (tmp) + { + gcov_prefix_strip = atoi (tmp); + /* Do not consider negative values. */ + if (gcov_prefix_strip < 0) + gcov_prefix_strip = 0; + } + + prefix_length = strlen(gcov_prefix); + + /* Remove an unnecessary trailing '/' */ + if (IS_DIR_SEPARATOR (gcov_prefix[prefix_length - 1])) + prefix_length--; + } + else + prefix_length = 0; + + /* Allocate and initialize the filename scratch space. */ + gi_filename = alloca (prefix_length + gcov_max_filename + 1); + if (prefix_length) + memcpy (gi_filename, gcov_prefix, prefix_length); + gi_filename_up = gi_filename + prefix_length; + /* Now merge each file. */ for (gi_ptr = gcov_list; gi_ptr; gi_ptr = gi_ptr->next) { @@ -169,6 +239,28 @@ gcov_exit (void) memset (&this_object, 0, sizeof (this_object)); memset (&object, 0, sizeof (object)); + /* Build relocated filename, stripping off leading + directories from the initial filename if requested. */ + if (gcov_prefix_strip > 0) + { + int level = 0; + const char *fname = gi_ptr->filename; + const char *s; + + /* Skip selected directory levels. */ + for (s = fname + 1; (*s != '\0') && (level < gcov_prefix_strip); s++) + if (IS_DIR_SEPARATOR(*s)) + { + fname = s; + level++; + }; + + /* Update complete filename with stripped original. */ + strcpy (gi_filename_up, fname); + } + else + strcpy (gi_filename_up, gi_ptr->filename); + /* Totals for this object file. */ ci_ptr = gi_ptr->counts; for (t_ix = 0; t_ix < GCOV_COUNTERS_SUMMABLE; t_ix++) @@ -205,10 +297,20 @@ gcov_exit (void) fi_stride &= ~(__alignof__ (struct gcov_fn_info) - 1); } - if (!gcov_open (gi_ptr->filename)) + if (!gcov_open (gi_filename)) { - fprintf (stderr, "profiling:%s:Cannot open\n", gi_ptr->filename); - continue; + /* Open failed likely due to missed directory. + Create directory and retry to open file. */ + if (create_file_directory (gi_filename)) + { + fprintf (stderr, "profiling:%s:Skip\n", gi_filename); + continue; + } + if (!gcov_open (gi_filename)) + { + fprintf (stderr, "profiling:%s:Cannot open\n", gi_filename); + continue; + } } tag = gcov_read_unsigned (); @@ -218,11 +320,11 @@ gcov_exit (void) if (tag != GCOV_DATA_MAGIC) { fprintf (stderr, "profiling:%s:Not a gcov data file\n", - gi_ptr->filename); + gi_filename); goto read_fatal; } length = gcov_read_unsigned (); - if (!gcov_version (gi_ptr, length)) + if (!gcov_version (gi_ptr, length, gi_filename)) goto read_fatal; length = gcov_read_unsigned (); @@ -246,7 +348,7 @@ gcov_exit (void) { read_mismatch:; fprintf (stderr, "profiling:%s:Merge mismatch for %s\n", - gi_ptr->filename, + gi_filename, f_ix + 1 ? "function" : "summaries"); goto read_fatal; } @@ -305,7 +407,7 @@ gcov_exit (void) read_error:; fprintf (stderr, error < 0 ? "profiling:%s:Overflow merging\n" - : "profiling:%s:Error merging\n", gi_ptr->filename); + : "profiling:%s:Error merging\n", gi_filename); read_fatal:; gcov_close (); @@ -356,7 +458,7 @@ gcov_exit (void) && memcmp (cs_all, cs_prg, sizeof (*cs_all))) { fprintf (stderr, "profiling:%s:Invocation mismatch - some data files may have been removed%s", - gi_ptr->filename, GCOV_LOCKED + gi_filename, GCOV_LOCKED ? "" : " or concurrent update without locking support"); all.checksum = ~0u; } @@ -421,7 +523,7 @@ gcov_exit (void) fprintf (stderr, error < 0 ? "profiling:%s:Overflow writing\n" : "profiling:%s:Error writing\n", - gi_ptr->filename); + gi_filename); } } @@ -433,11 +535,16 @@ __gcov_init (struct gcov_info *info) { if (!info->version) return; - if (gcov_version (info, info->version)) + if (gcov_version (info, info->version, 0)) { const char *ptr = info->filename; gcov_unsigned_t crc32 = gcov_crc32; - + size_t filename_length = strlen(info->filename); + + /* Refresh the longest file name information */ + if (filename_length > gcov_max_filename) + gcov_max_filename = filename_length; + do { unsigned ix; @@ -519,7 +626,7 @@ __gcov_merge_single (gcov_type *counters, unsigned n_counters) unsigned i, n_measures; gcov_type value, counter, all; - GCOV_CHECK (!(n_counters % 3)); + gcc_assert (!(n_counters % 3)); n_measures = n_counters / 3; for (i = 0; i < n_measures; i++, counters += 3) { @@ -558,7 +665,7 @@ __gcov_merge_delta (gcov_type *counters, unsigned n_counters) unsigned i, n_measures; gcov_type last, value, counter, all; - GCOV_CHECK (!(n_counters % 4)); + gcc_assert (!(n_counters % 4)); n_measures = n_counters / 4; for (i = 0; i < n_measures; i++, counters += 4) { @@ -581,6 +688,67 @@ __gcov_merge_delta (gcov_type *counters, unsigned n_counters) } #endif /* L_gcov_merge_delta */ +#ifdef L_gcov_interval_profiler +/* If VALUE is in interval , then increases the + corresponding counter in COUNTERS. If the VALUE is above or below + the interval, COUNTERS[STEPS] or COUNTERS[STEPS + 1] is increased + instead. */ + +void +__gcov_interval_profiler (gcov_type *counters, gcov_type value, + int start, unsigned steps) +{ + gcov_type delta = value - start; + if (delta < 0) + counters[steps + 1]++; + else if (delta >= steps) + counters[steps]++; + else + counters[delta]++; +} +#endif + +#ifdef L_gcov_pow2_profiler +/* If VALUE is a power of two, COUNTERS[1] is incremented. Otherwise + COUNTERS[0] is incremented. */ + +void +__gcov_pow2_profiler (gcov_type *counters, gcov_type value) +{ + if (value & (value - 1)) + counters[0]++; + else + counters[1]++; +} +#endif + +#ifdef L_gcov_one_value_profiler +/* Tries to determine the most common value among its inputs. Checks if the + value stored in COUNTERS[0] matches VALUE. If this is the case, COUNTERS[1] + is incremented. If this is not the case and COUNTERS[1] is not zero, + COUNTERS[1] is decremented. Otherwise COUNTERS[1] is set to one and + VALUE is stored to COUNTERS[0]. This algorithm guarantees that if this + function is called more than 50% of the time with one value, this value + will be in COUNTERS[0] in the end. + + In any case, COUNTERS[2] is incremented. */ + +void +__gcov_one_value_profiler (gcov_type *counters, gcov_type value) +{ + if (value == counters[0]) + counters[1]++; + else if (counters[1] == 0) + { + counters[1] = 1; + counters[0] = value; + } + else + counters[1]--; + counters[2]++; +} +#endif + #ifdef L_gcov_fork /* A wrapper for the fork function. Flushes the accumulated profiling data, so that they are not counted twice. */ diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 10117da8adb..1cbc489e668 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -1,6 +1,6 @@ /* Allocate registers within a basic block, for GNU compiler. Copyright (C) 1987, 1988, 1991, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -1032,9 +1032,8 @@ update_equiv_regs (void) once and used once. (If it were only set, but not used, flow would have deleted the setting insns.) Hence there can only be one insn in reg_equiv[REGNO].init_insns. */ - if (reg_equiv[regno].init_insns == NULL_RTX - || XEXP (reg_equiv[regno].init_insns, 1) != NULL_RTX) - abort (); + gcc_assert (reg_equiv[regno].init_insns + && !XEXP (reg_equiv[regno].init_insns, 1)); equiv_insn = XEXP (reg_equiv[regno].init_insns, 0); /* We may not move instructions that can throw, since @@ -1089,8 +1088,9 @@ update_equiv_regs (void) REG_NOTES (new_insn) = REG_NOTES (equiv_insn); REG_NOTES (equiv_insn) = 0; - /* Make sure this insn is recognized before reload begins, - otherwise eliminate_regs_in_insn will abort. */ + /* Make sure this insn is recognized before + reload begins, otherwise + eliminate_regs_in_insn will die. */ INSN_CODE (new_insn) = INSN_CODE (equiv_insn); delete_insn (equiv_insn); @@ -1196,8 +1196,10 @@ block_alloc (int b) while (1) { if (!NOTE_P (insn)) - if (++insn_count > max_uid) - abort (); + { + ++insn_count; + gcc_assert (insn_count <= max_uid); + } if (insn == BB_HEAD (BASIC_BLOCK (b))) break; insn = PREV_INSN (insn); @@ -2117,8 +2119,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, #endif /* Validate our parameters. */ - if (born_index < 0 || born_index > dead_index) - abort (); + gcc_assert (born_index >= 0 && born_index <= dead_index); /* Don't let a pseudo live in a reg across a function call if we might get a nonlocal goto. */ diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c index 8968b10ab7e..c6ef37e84d6 100644 --- a/gcc/loop-doloop.c +++ b/gcc/loop-doloop.c @@ -299,21 +299,17 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, { case NE: /* Currently only NE tests against zero and one are supported. */ - if (XEXP (condition, 1) == const1_rtx) + noloop = XEXP (condition, 1); + if (noloop != const0_rtx) { + gcc_assert (noloop == const1_rtx); increment_count = true; - noloop = const1_rtx; } - else if (XEXP (condition, 1) == const0_rtx) - noloop = const0_rtx; - else - abort (); break; case GE: /* Currently only GE tests against zero are supported. */ - if (XEXP (condition, 1) != const0_rtx) - abort (); + gcc_assert (XEXP (condition, 1) == const0_rtx); noloop = constm1_rtx; @@ -330,7 +326,7 @@ doloop_modify (struct loop *loop, struct niter_desc *desc, /* Abort if an invalid doloop pattern has been generated. */ default: - abort (); + gcc_unreachable (); } if (increment_count) diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index 92e9d3614f0..34140ef34f9 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -118,9 +118,14 @@ struct invariant static unsigned actual_stamp; +typedef struct invariant *invariant_p; + +DEF_VEC_P(invariant_p); +DEF_VEC_ALLOC_P(invariant_p, heap); + /* The invariants. */ -static varray_type invariants; +static VEC(invariant_p,heap) *invariants; /* Test for possibility of invariantness of X. */ @@ -332,10 +337,10 @@ create_new_invariant (struct def *def, rtx insn, bitmap depends_on, inv->stamp = 0; inv->insn = insn; - inv->invno = VARRAY_ACTIVE_SIZE (invariants); + inv->invno = VEC_length (invariant_p, invariants); if (def) def->invno = inv->invno; - VARRAY_PUSH_GENERIC_PTR_NOGC (invariants, inv); + VEC_safe_push (invariant_p, heap, invariants, inv); if (dump_file) { @@ -355,8 +360,7 @@ record_use (struct def *def, rtx *use, rtx insn) if (GET_CODE (*use) == SUBREG) use = &SUBREG_REG (*use); - if (!REG_P (*use)) - abort (); + gcc_assert (REG_P (*use)); u->pos = use; u->insn = insn; @@ -428,7 +432,7 @@ find_invariant_insn (rtx insn, bool always_reached, bool always_executed, return; dest = SET_DEST (set); - if (GET_CODE (dest) != REG + if (!REG_P (dest) || HARD_REGISTER_P (dest)) simple = false; @@ -615,7 +619,7 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed) EXECUTE_IF_SET_IN_BITMAP (inv->depends_on, 0, depno, bi) { - dep = VARRAY_GENERIC_PTR_NOGC (invariants, depno); + dep = VEC_index (invariant_p, invariants, depno); get_inv_cost (dep, &acomp_cost, &aregs_needed); @@ -674,9 +678,8 @@ best_gain_for_invariant (struct invariant **best, unsigned *regs_needed, int gain = 0, again; unsigned aregs_needed, invno; - for (invno = 0; invno < VARRAY_ACTIVE_SIZE (invariants); invno++) + for (invno = 0; VEC_iterate (invariant_p, invariants, invno, inv); invno++) { - inv = VARRAY_GENERIC_PTR_NOGC (invariants, invno); if (inv->move) continue; @@ -698,7 +701,7 @@ best_gain_for_invariant (struct invariant **best, unsigned *regs_needed, static void set_move_mark (unsigned invno) { - struct invariant *inv = VARRAY_GENERIC_PTR_NOGC (invariants, invno); + struct invariant *inv = VEC_index (invariant_p, invariants, invno); bitmap_iterator bi; if (inv->move) @@ -722,7 +725,7 @@ find_invariants_to_move (struct df *df) unsigned i, regs_used, n_inv_uses, regs_needed = 0, new_regs; struct invariant *inv = NULL; - if (!VARRAY_ACTIVE_SIZE (invariants)) + if (!VEC_length (invariant_p, invariants)) return; /* Now something slightly more involved. First estimate the number of used @@ -742,9 +745,8 @@ find_invariants_to_move (struct df *df) } } - for (i = 0; i < VARRAY_ACTIVE_SIZE (invariants); i++) + for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++) { - inv = VARRAY_GENERIC_PTR_NOGC (invariants, i); if (inv->def) n_inv_uses += inv->def->n_uses; } @@ -763,7 +765,7 @@ find_invariants_to_move (struct df *df) static void move_invariant_reg (struct loop *loop, unsigned invno, struct df *df) { - struct invariant *inv = VARRAY_GENERIC_PTR_NOGC (invariants, invno); + struct invariant *inv = VEC_index (invariant_p, invariants, invno); unsigned i; basic_block preheader = loop_preheader_edge (loop)->src; rtx reg, set; @@ -817,9 +819,8 @@ move_invariants (struct loop *loop, struct df *df) struct invariant *inv; unsigned i; - for (i = 0; i < VARRAY_ACTIVE_SIZE (invariants); i++) + for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++) { - inv = VARRAY_GENERIC_PTR_NOGC (invariants, i); if (inv->move) move_invariant_reg (loop, i, df); } @@ -832,8 +833,7 @@ init_inv_motion_data (void) { actual_stamp = 1; - if (!invariants) - VARRAY_GENERIC_PTR_NOGC_INIT (invariants, 100, "invariants"); + invariants = VEC_alloc (invariant_p, heap, 100); } /* Frees the data allocated by invariant motion. DF is the dataflow @@ -860,13 +860,12 @@ free_inv_motion_data (struct df *df) DF_REF_DATA (df->defs[i]) = NULL; } - for (i = 0; i < VARRAY_ACTIVE_SIZE (invariants); i++) + for (i = 0; VEC_iterate (invariant_p, invariants, i, inv); i++) { - inv = VARRAY_GENERIC_PTR_NOGC (invariants, i); BITMAP_FREE (inv->depends_on); free (inv); } - VARRAY_POP_ALL (invariants); + VEC_free (invariant_p, heap, invariants); } /* Move the invariants out of the LOOP. DF is the dataflow object. */ diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c index 55faf4a7097..bacf8382b7f 100644 --- a/gcc/loop-iv.c +++ b/gcc/loop-iv.c @@ -793,16 +793,15 @@ get_biv_step_1 (rtx insn, rtx reg, case SIGN_EXTEND: case ZERO_EXTEND: - if (GET_MODE (op0) != *inner_mode - || *extend != UNKNOWN - || *outer_step != const0_rtx) - abort (); + gcc_assert (GET_MODE (op0) == *inner_mode + && *extend == UNKNOWN + && *outer_step == const0_rtx); *extend = code; break; default: - abort (); + gcc_unreachable (); } return true; @@ -826,17 +825,8 @@ get_biv_step (rtx reg, rtx *inner_step, enum machine_mode *inner_mode, outer_step)) return false; - if (*inner_mode != *outer_mode - && *extend == UNKNOWN) - abort (); - - if (*inner_mode == *outer_mode - && *extend != UNKNOWN) - abort (); - - if (*inner_mode == *outer_mode - && *outer_step != const0_rtx) - abort (); + gcc_assert ((*inner_mode == *outer_mode) != (*extend != UNKNOWN)); + gcc_assert (*inner_mode != *outer_mode || *outer_step == const0_rtx); return true; } @@ -1085,8 +1075,7 @@ iv_analyze (rtx insn, rtx def, struct rtx_iv *iv) mby = XEXP (rhs, 1); if (!CONSTANT_P (mby)) { - if (!CONSTANT_P (op0)) - abort (); + gcc_assert (CONSTANT_P (op0)); tmp = op0; op0 = mby; mby = tmp; @@ -1094,14 +1083,13 @@ iv_analyze (rtx insn, rtx def, struct rtx_iv *iv) break; case ASHIFT: - if (CONSTANT_P (XEXP (rhs, 0))) - abort (); + gcc_assert (!CONSTANT_P (XEXP (rhs, 0))); op0 = XEXP (rhs, 0); mby = XEXP (rhs, 1); break; default: - abort (); + gcc_unreachable (); } amode = GET_MODE (rhs); @@ -1210,8 +1198,7 @@ get_iv_value (struct rtx_iv *iv, rtx iteration) /* We would need to generate some if_then_else patterns, and so far it is not needed anywhere. */ - if (iv->first_special) - abort (); + gcc_assert (!iv->first_special); if (iv->step != const0_rtx && iteration != const0_rtx) val = simplify_gen_binary (PLUS, iv->extend_mode, iv->base, @@ -1547,8 +1534,7 @@ canon_condition (rtx cond) mode = GET_MODE (op0); if (mode == VOIDmode) mode = GET_MODE (op1); - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); if (GET_CODE (op1) == CONST_INT && GET_MODE_CLASS (mode) != MODE_CC @@ -1677,20 +1663,23 @@ simplify_using_condition (rtx cond, rtx *expr, regset altered) static void eliminate_implied_condition (enum rtx_code op, rtx a, rtx *b) { - if (op == AND) + switch (op) { + case AND: /* If A implies *B, we may replace *B by true. */ if (implies_p (a, *b)) *b = const_true_rtx; - } - else if (op == IOR) - { + break; + + case IOR: /* If *B implies A, we may replace *B by false. */ if (implies_p (*b, a)) *b = const0_rtx; + break; + + default: + gcc_unreachable (); } - else - abort (); } /* Eliminates the conditions in TAIL that are implied by HEAD. OP is the @@ -1731,19 +1720,22 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr) eliminate_implied_conditions (op, &head, tail); - if (op == AND) + switch (op) { + case AND: neutral = const_true_rtx; aggr = const0_rtx; - } - else if (op == IOR) - { + break; + + case IOR: neutral = const0_rtx; aggr = const_true_rtx; - } - else - abort (); + break; + default: + gcc_unreachable (); + } + simplify_using_initial_values (loop, UNKNOWN, &head); if (head == aggr) { @@ -1770,8 +1762,7 @@ simplify_using_initial_values (struct loop *loop, enum rtx_code op, rtx *expr) return; } - if (op != UNKNOWN) - abort (); + gcc_assert (op == UNKNOWN); e = loop_preheader_edge (loop); if (e->src == ENTRY_BLOCK_PTR) @@ -1873,7 +1864,7 @@ shorten_into_mode (struct rtx_iv *iv, enum machine_mode mode, break; default: - abort (); + gcc_unreachable (); } iv->mode = mode; @@ -1931,7 +1922,7 @@ canonicalize_iv_subregs (struct rtx_iv *iv0, struct rtx_iv *iv1, break; default: - abort (); + gcc_unreachable (); } /* Values of both variables should be computed in the same mode. These @@ -2031,15 +2022,13 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, desc->niter_max = 0; cond = GET_CODE (condition); - if (!COMPARISON_P (condition)) - abort (); + gcc_assert (COMPARISON_P (condition)); mode = GET_MODE (XEXP (condition, 0)); if (mode == VOIDmode) mode = GET_MODE (XEXP (condition, 1)); /* The constant comparisons should be folded. */ - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); /* We only handle integers or pointers. */ if (GET_MODE_CLASS (mode) != MODE_INT @@ -2159,7 +2148,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, assumption = simplify_gen_relational (EQ, SImode, mode, tmp, mode_mmax); if (assumption == const_true_rtx) - goto zero_iter; + goto zero_iter_simplify; iv0.base = simplify_gen_binary (PLUS, comp_mode, iv0.base, const1_rtx); } @@ -2169,7 +2158,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, assumption = simplify_gen_relational (EQ, SImode, mode, tmp, mode_mmin); if (assumption == const_true_rtx) - goto zero_iter; + goto zero_iter_simplify; iv1.base = simplify_gen_binary (PLUS, comp_mode, iv1.base, constm1_rtx); } @@ -2196,7 +2185,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, { desc->infinite = alloc_EXPR_LIST (0, const_true_rtx, NULL_RTX); - return; + /* Fill in the remaining fields somehow. */ + goto zero_iter_simplify; } } else @@ -2206,7 +2196,8 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, { desc->infinite = alloc_EXPR_LIST (0, const_true_rtx, NULL_RTX); - return; + /* Fill in the remaining fields somehow. */ + goto zero_iter_simplify; } } } @@ -2317,7 +2308,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, assumption = simplify_gen_relational (reverse_condition (cond), SImode, mode, tmp0, tmp1); if (assumption == const_true_rtx) - goto zero_iter; + goto zero_iter_simplify; else if (assumption != const0_rtx) desc->noloop_assumptions = alloc_EXPR_LIST (0, assumption, desc->noloop_assumptions); @@ -2460,7 +2451,7 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, delta = simplify_gen_binary (MINUS, mode, tmp1, delta); } if (assumption == const_true_rtx) - goto zero_iter; + goto zero_iter_simplify; else if (assumption != const0_rtx) desc->noloop_assumptions = alloc_EXPR_LIST (0, assumption, desc->noloop_assumptions); @@ -2528,16 +2519,26 @@ iv_number_of_iterations (struct loop *loop, rtx insn, rtx condition, return; -fail: - desc->simple_p = false; - return; +zero_iter_simplify: + /* Simplify the assumptions. */ + simplify_using_initial_values (loop, AND, &desc->assumptions); + if (desc->assumptions + && XEXP (desc->assumptions, 0) == const0_rtx) + goto fail; + simplify_using_initial_values (loop, IOR, &desc->infinite); + /* Fallthru. */ zero_iter: desc->const_iter = true; desc->niter = 0; desc->niter_max = 0; + desc->noloop_assumptions = NULL_RTX; desc->niter_expr = const0_rtx; return; + +fail: + desc->simple_p = false; + return; } /* Checks whether E is a simple exit from LOOP and stores its description @@ -2614,12 +2615,21 @@ find_simple_exit (struct loop *loop, struct niter_desc *desc) if (!act.simple_p) continue; - /* Prefer constant iterations; the less the better. */ if (!any) any = true; - else if (!act.const_iter - || (desc->const_iter && act.niter >= desc->niter)) - continue; + else + { + /* Prefer constant iterations; the less the better. */ + if (!act.const_iter + || (desc->const_iter && act.niter >= desc->niter)) + continue; + + /* Also if the actual exit may be infinite, while the old one + not, prefer the old one. */ + if (act.infinite && !desc->infinite) + continue; + } + *desc = act; } } diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c index 0112961ce53..68512d02a5a 100644 --- a/gcc/loop-unroll.c +++ b/gcc/loop-unroll.c @@ -85,13 +85,16 @@ struct iv_to_split XEXP (XEXP (single_set, loc[0]), loc[1]). */ }; +DEF_VEC_P(rtx); +DEF_VEC_ALLOC_P(rtx,heap); + /* Information about accumulators to expand. */ struct var_to_expand { rtx insn; /* The insn in that the variable expansion occurs. */ rtx reg; /* The accumulator which is expanded. */ - varray_type var_expansions; /* The copies of the accumulator which is expanded. */ + VEC(rtx,heap) *var_expansions; /* The copies of the accumulator which is expanded. */ enum rtx_code op; /* The type of the accumulation - addition, subtraction or multiplication. */ int expansion_count; /* Count the number of expansions generated so far. */ @@ -372,6 +375,7 @@ decide_peel_once_rolling (struct loop *loop, int flags ATTRIBUTE_UNUSED) /* Check number of iterations. */ if (!desc->simple_p || desc->assumptions + || desc->infinite || !desc->const_iter || desc->niter != 0) { @@ -441,7 +445,8 @@ decide_peel_completely (struct loop *loop, int flags ATTRIBUTE_UNUSED) /* Check number of iterations. */ if (!desc->simple_p || desc->assumptions - || !desc->const_iter) + || !desc->const_iter + || desc->infinite) { if (dump_file) fprintf (dump_file, @@ -495,6 +500,8 @@ peel_loop_completely (struct loops *loops, struct loop *loop) if (npeel) { + bool ok; + wont_exit = sbitmap_alloc (npeel + 1); sbitmap_ones (wont_exit); RESET_BIT (wont_exit, 0); @@ -508,11 +515,12 @@ peel_loop_completely (struct loops *loops, struct loop *loop) opt_info = analyze_insns_in_loop (loop); opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), - loops, npeel, - wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + loops, npeel, + wont_exit, desc->out_edge, + remove_edges, &n_remove_edges, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); free (wont_exit); @@ -670,6 +678,7 @@ unroll_loop_constant_iterations (struct loops *loops, struct loop *loop) struct niter_desc *desc = get_simple_loop_desc (loop); bool exit_at_end = loop_exit_at_end_p (loop); struct opt_info *opt_info = NULL; + bool ok; niter = desc->niter; @@ -704,12 +713,12 @@ unroll_loop_constant_iterations (struct loops *loops, struct loop *loop) if (exit_mod) { opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), loops, exit_mod, wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); if (opt_info && exit_mod > 1) apply_opt_in_copies (opt_info, exit_mod, false, false); @@ -740,11 +749,12 @@ unroll_loop_constant_iterations (struct loops *loops, struct loop *loop) RESET_BIT (wont_exit, 1); opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), - loops, exit_mod + 1, - wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + loops, exit_mod + 1, + wont_exit, desc->out_edge, + remove_edges, &n_remove_edges, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); if (opt_info && exit_mod > 0) apply_opt_in_copies (opt_info, exit_mod + 1, false, false); @@ -763,11 +773,12 @@ unroll_loop_constant_iterations (struct loops *loops, struct loop *loop) /* Now unroll the loop. */ opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), - loops, max_unroll, - wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), + loops, max_unroll, + wont_exit, desc->out_edge, + remove_edges, &n_remove_edges, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); if (opt_info) { @@ -935,6 +946,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) struct niter_desc *desc = get_simple_loop_desc (loop); bool exit_at_end = loop_exit_at_end_p (loop); struct opt_info *opt_info = NULL; + bool ok; if (flag_split_ivs_in_unroller || flag_variable_expansion_in_unroller) @@ -1013,11 +1025,12 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) && !desc->noloop_assumptions) SET_BIT (wont_exit, 1); ezc_swtch = loop_preheader_edge (loop)->src; - if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), - loops, 1, - wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + loops, 1, + wont_exit, desc->out_edge, + remove_edges, &n_remove_edges, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); /* Record the place where switch will be built for preconditioning. */ swtch = loop_split_edge_with (loop_preheader_edge (loop), @@ -1029,11 +1042,12 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) sbitmap_zero (wont_exit); if (i != n_peel - 1 || !last_may_exit) SET_BIT (wont_exit, 1); - if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), - loops, 1, - wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + loops, 1, + wont_exit, desc->out_edge, + remove_edges, &n_remove_edges, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); /* Create item for switch. */ j = n_peel - i - (extra_zero_check ? 0 : 1); @@ -1041,7 +1055,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) preheader = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); branch_code = compare_and_jump_seq (copy_rtx (niter), GEN_INT (j), EQ, - block_label (preheader), p, NULL_RTX); + block_label (preheader), p, + NULL_RTX); swtch = loop_split_edge_with (single_pred_edge (swtch), branch_code); set_immediate_dominator (CDI_DOMINATORS, preheader, swtch); @@ -1058,7 +1073,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) swtch = ezc_swtch; preheader = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX); branch_code = compare_and_jump_seq (copy_rtx (niter), const0_rtx, EQ, - block_label (preheader), p, NULL_RTX); + block_label (preheader), p, + NULL_RTX); swtch = loop_split_edge_with (single_succ_edge (swtch), branch_code); set_immediate_dominator (CDI_DOMINATORS, preheader, swtch); @@ -1077,11 +1093,12 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) RESET_BIT (wont_exit, may_exit_copy); opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), - loops, max_unroll, - wont_exit, desc->out_edge, remove_edges, &n_remove_edges, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), + loops, max_unroll, + wont_exit, desc->out_edge, + remove_edges, &n_remove_edges, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); if (opt_info) { @@ -1094,7 +1111,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) if (exit_at_end) { basic_block exit_block = desc->in_edge->src->rbi->copy; - /* Find a new in and out edge; they are in the last copy we have made. */ + /* Find a new in and out edge; they are in the last copy we have + made. */ if (EDGE_SUCC (exit_block, 0)->dest == desc->out_edge->dest) { @@ -1119,7 +1137,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop) the correct new number of iterations is this: */ gcc_assert (!desc->const_iter); desc->niter_expr = - simplify_gen_binary (UDIV, desc->mode, old_niter, GEN_INT (max_unroll + 1)); + simplify_gen_binary (UDIV, desc->mode, old_niter, + GEN_INT (max_unroll + 1)); desc->niter_max /= max_unroll + 1; if (exit_at_end) { @@ -1242,6 +1261,7 @@ peel_loop_simple (struct loops *loops, struct loop *loop) unsigned npeel = loop->lpt_decision.times; struct niter_desc *desc = get_simple_loop_desc (loop); struct opt_info *opt_info = NULL; + bool ok; if (flag_split_ivs_in_unroller && npeel > 1) opt_info = analyze_insns_in_loop (loop); @@ -1251,10 +1271,11 @@ peel_loop_simple (struct loops *loops, struct loop *loop) opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), - loops, npeel, wont_exit, NULL, NULL, NULL, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop), + loops, npeel, wont_exit, + NULL, NULL, + NULL, DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); free (wont_exit); @@ -1387,6 +1408,7 @@ unroll_loop_stupid (struct loops *loops, struct loop *loop) unsigned nunroll = loop->lpt_decision.times; struct niter_desc *desc = get_simple_loop_desc (loop); struct opt_info *opt_info = NULL; + bool ok; if (flag_split_ivs_in_unroller || flag_variable_expansion_in_unroller) @@ -1397,10 +1419,11 @@ unroll_loop_stupid (struct loops *loops, struct loop *loop) sbitmap_zero (wont_exit); opt_info_start_duplication (opt_info); - if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), - loops, nunroll, wont_exit, NULL, NULL, NULL, - DLTHE_FLAG_UPDATE_FREQ)) - abort (); + ok = duplicate_loop_to_header_edge (loop, loop_latch_edge (loop), + loops, nunroll, wont_exit, + NULL, NULL, NULL, + DLTHE_FLAG_UPDATE_FREQ); + gcc_assert (ok); if (opt_info) { @@ -1560,7 +1583,7 @@ analyze_insn_to_expand_var (struct loop *loop, rtx insn) /* Record the accumulator to expand. */ ves = xmalloc (sizeof (struct var_to_expand)); ves->insn = insn; - VARRAY_RTX_INIT (ves->var_expansions, 1, "var_expansions"); + ves->var_expansions = VEC_alloc (rtx, heap, 1); ves->reg = copy_rtx (dest); ves->op = GET_CODE (src); ves->expansion_count = 0; @@ -1599,6 +1622,7 @@ analyze_iv_to_split_insn (rtx insn) rtx set, dest; struct rtx_iv iv; struct iv_to_split *ivts; + bool ok; /* For now we just split the basic induction variables. Later this may be extended for example by selecting also addresses of memory references. */ @@ -1613,8 +1637,8 @@ analyze_iv_to_split_insn (rtx insn) if (!biv_p (insn, dest)) return NULL; - if (!iv_analyze (insn, dest, &iv)) - abort (); + ok = iv_analyze (insn, dest, &iv); + gcc_assert (ok); if (iv.step == const0_rtx || iv.mode != iv.extend_mode) @@ -1640,14 +1664,14 @@ static struct opt_info * analyze_insns_in_loop (struct loop *loop) { basic_block *body, bb; - unsigned i, n_edges = 0; + unsigned i, num_edges = 0; struct opt_info *opt_info = xcalloc (1, sizeof (struct opt_info)); rtx insn; struct iv_to_split *ivts = NULL; struct var_to_expand *ves = NULL; PTR *slot1; PTR *slot2; - edge *edges = get_loop_exit_edges (loop, &n_edges); + edge *edges = get_loop_exit_edges (loop, &num_edges); bool can_apply = false; iv_analysis_loop_init (loop); @@ -1667,7 +1691,7 @@ analyze_insns_in_loop (struct loop *loop) else opt_info->loop_preheader = loop_preheader_edge (loop)->src; - if (n_edges == 1 + if (num_edges == 1 && !(edges[0]->flags & EDGE_COMPLEX)) { opt_info->loop_exit = loop_split_edge_with (edges[0], NULL_RTX); @@ -1870,9 +1894,9 @@ get_expansion (struct var_to_expand *ve) if (ve->reuse_expansion == 0) reg = ve->reg; else - reg = VARRAY_RTX (ve->var_expansions, ve->reuse_expansion - 1); + reg = VEC_index (rtx, ve->var_expansions, ve->reuse_expansion - 1); - if (VARRAY_ACTIVE_SIZE (ve->var_expansions) == (unsigned) ve->reuse_expansion) + if (VEC_length (rtx, ve->var_expansions) == (unsigned) ve->reuse_expansion) ve->reuse_expansion = 0; else ve->reuse_expansion++; @@ -1891,8 +1915,7 @@ expand_var_during_unrolling (struct var_to_expand *ve, rtx insn) bool really_new_expansion = false; set = single_set (insn); - if (!set) - abort (); + gcc_assert (set); /* Generate a new register only if the expansion limit has not been reached. Else reuse an already existing expansion. */ @@ -1910,7 +1933,7 @@ expand_var_during_unrolling (struct var_to_expand *ve, rtx insn) if (apply_change_group ()) if (really_new_expansion) { - VARRAY_PUSH_RTX (ve->var_expansions, new_reg); + VEC_safe_push (rtx, heap, ve->var_expansions, new_reg); ve->expansion_count++; } } @@ -1928,21 +1951,19 @@ insert_var_expansion_initialization (void **slot, void *place_p) rtx seq, var, zero_init, insn; unsigned i; - if (VARRAY_ACTIVE_SIZE (ve->var_expansions) == 0) + if (VEC_length (rtx, ve->var_expansions) == 0) return 1; start_sequence (); if (ve->op == PLUS || ve->op == MINUS) - for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++) + for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++) { - var = VARRAY_RTX (ve->var_expansions, i); zero_init = CONST0_RTX (GET_MODE (var)); emit_move_insn (var, zero_init); } else if (ve->op == MULT) - for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++) + for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++) { - var = VARRAY_RTX (ve->var_expansions, i); zero_init = CONST1_RTX (GET_MODE (var)); emit_move_insn (var, zero_init); } @@ -1973,21 +1994,19 @@ combine_var_copies_in_loop_exit (void **slot, void *place_p) rtx expr, seq, var, insn; unsigned i; - if (VARRAY_ACTIVE_SIZE (ve->var_expansions) == 0) + if (VEC_length (rtx, ve->var_expansions) == 0) return 1; start_sequence (); if (ve->op == PLUS || ve->op == MINUS) - for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++) + for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++) { - var = VARRAY_RTX (ve->var_expansions, i); sum = simplify_gen_binary (PLUS, GET_MODE (ve->reg), var, sum); } else if (ve->op == MULT) - for (i = 0; i < VARRAY_ACTIVE_SIZE (ve->var_expansions); i++) + for (i = 0; VEC_iterate (rtx, ve->var_expansions, i, var); i++) { - var = VARRAY_RTX (ve->var_expansions, i); sum = simplify_gen_binary (MULT, GET_MODE (ve->reg), var, sum); } @@ -2148,7 +2167,7 @@ release_var_copies (void **slot, void *data ATTRIBUTE_UNUSED) { struct var_to_expand *ve = *slot; - VARRAY_CLEAR (ve->var_expansions); + VEC_free (rtx, heap, ve->var_expansions); /* Continue traversing the hash table. */ return 1; diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c index bb014bde465..ef4e5b8c2d4 100644 --- a/gcc/loop-unswitch.c +++ b/gcc/loop-unswitch.c @@ -104,13 +104,11 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob, { /* A hack -- there seems to be no easy generic way how to make a conditional jump from a ccmode comparison. */ - if (!cinsn) - abort (); + gcc_assert (cinsn); cond = XEXP (SET_SRC (pc_set (cinsn)), 0); - if (GET_CODE (cond) != comp - || !rtx_equal_p (op0, XEXP (cond, 0)) - || !rtx_equal_p (op1, XEXP (cond, 1))) - abort (); + gcc_assert (GET_CODE (cond) == comp); + gcc_assert (rtx_equal_p (op0, XEXP (cond, 0))); + gcc_assert (rtx_equal_p (op1, XEXP (cond, 1))); emit_jump_insn (copy_insn (PATTERN (cinsn))); jump = get_last_insn (); JUMP_LABEL (jump) = JUMP_LABEL (cinsn); @@ -119,8 +117,7 @@ compare_and_jump_seq (rtx op0, rtx op1, enum rtx_code comp, rtx label, int prob, } else { - if (cinsn) - abort (); + gcc_assert (!cinsn); op0 = force_operand (op0, NULL_RTX); op1 = force_operand (op1, NULL_RTX); @@ -226,11 +223,11 @@ may_unswitch_on (basic_block bb, struct loop *loop, rtx *cinsn) if (at != BB_END (bb)) return NULL_RTX; - *cinsn = BB_END (bb); if (!rtx_equal_p (op[0], XEXP (test, 0)) || !rtx_equal_p (op[1], XEXP (test, 1))) return NULL_RTX; + *cinsn = BB_END (bb); return test; } @@ -269,7 +266,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, basic_block *bbs; struct loop *nloop; unsigned i; - rtx cond, rcond = NULL_RTX, conds, rconds, acond, cinsn = NULL_RTX; + rtx cond, rcond = NULL_RTX, conds, rconds, acond, cinsn; int repeat; edge e; @@ -324,6 +321,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, do { repeat = 0; + cinsn = NULL_RTX; /* Find a bb to unswitch on. */ bbs = get_loop_body (loop); @@ -380,8 +378,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop, /* Unswitch the loop on this condition. */ nloop = unswitch_loop (loops, loop, bbs[i], cond, cinsn); - if (!nloop) - abort (); + gcc_assert (nloop); /* Invoke itself on modified loops. */ unswitch_single_loop (loops, nloop, rconds, num + 1); @@ -413,18 +410,12 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on, rtx seq; /* Some sanity checking. */ - if (!flow_bb_inside_loop_p (loop, unswitch_on)) - abort (); - if (EDGE_COUNT (unswitch_on->succs) != 2) - abort (); - if (!just_once_each_iteration_p (loop, unswitch_on)) - abort (); - if (loop->inner) - abort (); - if (!flow_bb_inside_loop_p (loop, EDGE_SUCC (unswitch_on, 0)->dest)) - abort (); - if (!flow_bb_inside_loop_p (loop, EDGE_SUCC (unswitch_on, 1)->dest)) - abort (); + gcc_assert (flow_bb_inside_loop_p (loop, unswitch_on)); + gcc_assert (EDGE_COUNT (unswitch_on->succs) == 2); + gcc_assert (just_once_each_iteration_p (loop, unswitch_on)); + gcc_assert (!loop->inner); + gcc_assert (flow_bb_inside_loop_p (loop, EDGE_SUCC (unswitch_on, 0)->dest)); + gcc_assert (flow_bb_inside_loop_p (loop, EDGE_SUCC (unswitch_on, 1)->dest)); entry = loop_preheader_edge (loop); diff --git a/gcc/loop.c b/gcc/loop.c index 2b765c821d8..eaa1bd931b7 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -83,8 +83,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA of an insn added during loop, since these don't have LUIDs. */ #define INSN_LUID(INSN) \ - (INSN_UID (INSN) < max_uid_for_loop ? uid_luid[INSN_UID (INSN)] \ - : (abort (), -1)) + (gcc_assert (INSN_UID (INSN) < max_uid_for_loop), uid_luid[INSN_UID (INSN)]) #define REGNO_FIRST_LUID(REGNO) \ (REGNO_FIRST_UID (REGNO) < max_uid_for_loop \ @@ -425,7 +424,7 @@ struct loop_info #ifndef HAVE_prefetch #define HAVE_prefetch 0 #define CODE_FOR_prefetch 0 -#define gen_prefetch(a,b,c) (abort(), NULL_RTX) +#define gen_prefetch(a,b,c) (gcc_unreachable (), NULL_RTX) #endif /* Give up the prefetch optimizations once we exceed a given threshold. @@ -869,8 +868,7 @@ loop_optimize (rtx f, FILE *dumpfile, int flags) /* See if we went too far. Note that get_max_uid already returns one more that the maximum uid of all insn. */ - if (get_max_uid () > max_uid_for_loop) - abort (); + gcc_assert (get_max_uid () <= max_uid_for_loop); /* Now reset it to the actual size we need. See above. */ max_uid_for_loop = get_max_uid (); @@ -2117,7 +2115,7 @@ rtx_equal_for_loop_p (rtx x, rtx y, struct loop_movables *movables, contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. */ default: - abort (); + gcc_unreachable (); } } return 1; @@ -2310,21 +2308,26 @@ move_movables (struct loop *loop, struct loop_movables *movables, for (count = m->consec; count >= 0; count--) { - /* If this is the first insn of a library call sequence, - something is very wrong. */ - if (!NOTE_P (p) - && (temp = find_reg_note (p, REG_LIBCALL, NULL_RTX))) - abort (); - - /* If this is the last insn of a libcall sequence, then - delete every insn in the sequence except the last. - The last insn is handled in the normal manner. */ - if (!NOTE_P (p) - && (temp = find_reg_note (p, REG_RETVAL, NULL_RTX))) + if (!NOTE_P (p)) { - temp = XEXP (temp, 0); - while (temp != p) - temp = delete_insn (temp); + /* If this is the first insn of a library + call sequence, something is very + wrong. */ + gcc_assert (!find_reg_note + (p, REG_LIBCALL, NULL_RTX)); + + /* If this is the last insn of a libcall + sequence, then delete every insn in the + sequence except the last. The last insn + is handled in the normal manner. */ + temp = find_reg_note (p, REG_RETVAL, NULL_RTX); + + if (temp) + { + temp = XEXP (temp, 0); + while (temp != p) + temp = delete_insn (temp); + } } temp = p; @@ -2488,8 +2491,7 @@ move_movables (struct loop *loop, struct loop_movables *movables, << GET_MODE_BITSIZE (m->savemode))) - 1), reg, 1, OPTAB_LIB_WIDEN); - if (tem == 0) - abort (); + gcc_assert (tem); if (tem != reg) emit_move_insn (reg, tem); sequence = get_insns (); @@ -2777,8 +2779,7 @@ replace_call_address (rtx x, rtx reg, rtx addr) case MEM: /* If this MEM uses a reg other than the one we expected, something is wrong. */ - if (XEXP (x, 0) != reg) - abort (); + gcc_assert (XEXP (x, 0) == reg); XEXP (x, 0) = addr; return; @@ -3091,8 +3092,7 @@ find_and_verify_loops (rtx f, struct loops *loops) break; case NOTE_INSN_LOOP_END: - if (! current_loop) - abort (); + gcc_assert (current_loop); current_loop->end = insn; current_loop = current_loop->outer; @@ -3280,6 +3280,7 @@ find_and_verify_loops (rtx f, struct loops *loops) if (invert_jump (p, new_label, 1)) { rtx q, r; + bool only_notes; /* If no suitable BARRIER was found, create a suitable one before TARGET. Since TARGET is a fall through @@ -3304,8 +3305,10 @@ find_and_verify_loops (rtx f, struct loops *loops) /* Include the BARRIER after INSN and copy the block after LOC. */ - if (squeeze_notes (&new_label, &last_insn_to_move)) - abort (); + only_notes = squeeze_notes (&new_label, + &last_insn_to_move); + gcc_assert (!only_notes); + reorder_insns (new_label, last_insn_to_move, loc); /* All those insns are now in TARGET_LOOP. */ @@ -3340,8 +3343,7 @@ find_and_verify_loops (rtx f, struct loops *loops) /* If we didn't find it, then something is wrong. */ - if (! r) - abort (); + gcc_assert (r); } /* P is now a jump outside the loop, so it must be put @@ -4038,7 +4040,7 @@ rtx_equal_for_prefetch_p (rtx x, rtx y) contain anything but integers and other rtx's, except for within LABEL_REFs and SYMBOL_REFs. */ default: - abort (); + gcc_unreachable (); } } return 1; @@ -4655,12 +4657,18 @@ for_each_insn_in_loop (struct loop *loop, loop_insn_callback fncall) int not_every_iteration = 0; int maybe_multiple = 0; int past_loop_latch = 0; + bool exit_test_is_entry = false; rtx p; - /* If loop_scan_start points to the loop exit test, we have to be wary of - subversive use of gotos inside expression statements. */ + /* If loop_scan_start points to the loop exit test, the loop body + cannot be counted on running on every iteration, and we have to + be wary of subversive use of gotos inside expression + statements. */ if (prev_nonnote_insn (loop->scan_start) != prev_nonnote_insn (loop->start)) - maybe_multiple = back_branch_in_range_p (loop, loop->scan_start); + { + exit_test_is_entry = true; + maybe_multiple = back_branch_in_range_p (loop, loop->scan_start); + } /* Scan through loop and update NOT_EVERY_ITERATION and MAYBE_MULTIPLE. */ for (p = next_insn_in_loop (loop, loop->scan_start); @@ -4718,10 +4726,12 @@ for_each_insn_in_loop (struct loop *loop, loop_insn_callback fncall) beginning, don't set not_every_iteration for that. This can be any kind of jump, since we want to know if insns will be executed if the loop is executed. */ - && !(JUMP_LABEL (p) == loop->top - && ((NEXT_INSN (NEXT_INSN (p)) == loop->end - && any_uncondjump_p (p)) - || (NEXT_INSN (p) == loop->end && any_condjump_p (p))))) + && (exit_test_is_entry + || !(JUMP_LABEL (p) == loop->top + && ((NEXT_INSN (NEXT_INSN (p)) == loop->end + && any_uncondjump_p (p)) + || (NEXT_INSN (p) == loop->end + && any_condjump_p (p)))))) { rtx label = 0; @@ -4964,10 +4974,9 @@ fold_rtx_mult_add (rtx mult1, rtx mult2, rtx add1, enum machine_mode mode) /* The modes must all be the same. This should always be true. For now, check to make sure. */ - if ((GET_MODE (mult1) != mode && GET_MODE (mult1) != VOIDmode) - || (GET_MODE (mult2) != mode && GET_MODE (mult2) != VOIDmode) - || (GET_MODE (add1) != mode && GET_MODE (add1) != VOIDmode)) - abort (); + gcc_assert (GET_MODE (mult1) == mode || GET_MODE (mult1) == VOIDmode); + gcc_assert (GET_MODE (mult2) == mode || GET_MODE (mult2) == VOIDmode); + gcc_assert (GET_MODE (add1) == mode || GET_MODE (add1) == VOIDmode); /* Ensure that if at least one of mult1/mult2 are constant, then mult2 will be a constant. */ @@ -5065,7 +5074,7 @@ reg_dead_after_loop (const struct loop *loop, rtx reg) /* HACK: Must also search the loop fall through exit, create a label_ref here which points to the loop->end, and append the loop_number_exit_labels list to it. */ - label = gen_rtx_LABEL_REF (VOIDmode, loop->end); + label = gen_rtx_LABEL_REF (Pmode, loop->end); LABEL_NEXTREF (label) = loop->exit_labels; for (; label; label = LABEL_NEXTREF (label)) @@ -5470,9 +5479,40 @@ loop_givs_rescan (struct loop *loop, struct iv_class *bl, rtx *reg_map) mark_reg_pointer (v->new_reg, 0); if (v->giv_type == DEST_ADDR) - /* Store reduced reg as the address in the memref where we found - this giv. */ - validate_change (v->insn, v->location, v->new_reg, 0); + { + /* Store reduced reg as the address in the memref where we found + this giv. */ + if (validate_change_maybe_volatile (v->insn, v->location, + v->new_reg)) + /* Yay, it worked! */; + /* Not replaceable; emit an insn to set the original + giv reg from the reduced giv. */ + else if (REG_P (*v->location)) + loop_insn_emit_before (loop, 0, v->insn, + gen_move_insn (*v->location, + v->new_reg)); + else if (GET_CODE (*v->location) == PLUS + && REG_P (XEXP (*v->location, 0)) + && CONSTANT_P (XEXP (*v->location, 1))) + loop_insn_emit_before (loop, 0, v->insn, + gen_move_insn (XEXP (*v->location, 0), + gen_rtx_MINUS + (GET_MODE (*v->location), + v->new_reg, + XEXP (*v->location, 1)))); + else + { + /* If it wasn't a reg, create a pseudo and use that. */ + rtx reg, seq; + start_sequence (); + reg = force_reg (v->mode, *v->location); + seq = get_insns (); + end_sequence (); + loop_insn_emit_before (loop, 0, v->insn, seq); + if (!validate_change_maybe_volatile (v->insn, v->location, reg)) + gcc_unreachable (); + } + } else if (v->replaceable) { reg_map[REGNO (v->dest_reg)] = v->new_reg; @@ -5802,9 +5842,8 @@ loop_iterations (struct loop *loop) will propagate a new pseudo into the old iteration register but this will be marked by having the REG_USERVAR_P bit set. */ - if ((unsigned) REGNO (iteration_var) >= ivs->n_regs - && ! REG_USERVAR_P (iteration_var)) - abort (); + gcc_assert ((unsigned) REGNO (iteration_var) < ivs->n_regs + || REG_USERVAR_P (iteration_var)); /* Determine the initial value of the iteration variable, and the amount that it is incremented each loop. Use the tables constructed by @@ -5861,8 +5900,7 @@ loop_iterations (struct loop *loop) if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == BASIC_INDUCT) { - if (REGNO (iteration_var) >= ivs->n_regs) - abort (); + gcc_assert (REGNO (iteration_var) < ivs->n_regs); /* Grab initial value, only useful if it is a constant. */ bl = REG_IV_CLASS (ivs, REGNO (iteration_var)); @@ -5883,8 +5921,7 @@ loop_iterations (struct loop *loop) struct induction *v = REG_IV_INFO (ivs, REGNO (iteration_var)); rtx biv_initial_value; - if (REGNO (v->src_reg) >= ivs->n_regs) - abort (); + gcc_assert (REGNO (v->src_reg) < ivs->n_regs); if (!v->always_executed || v->maybe_multiple) { @@ -5991,7 +6028,7 @@ loop_iterations (struct loop *loop) compare_dir = 0; break; default: - abort (); + gcc_unreachable (); } /* If the comparison value is an invariant register, then try to find @@ -6243,18 +6280,17 @@ loop_iterations (struct loop *loop) unsigned, because they can be as large as 2^n - 1. */ inc = INTVAL (increment); + gcc_assert (inc); if (inc > 0) { abs_diff = INTVAL (final_value) - INTVAL (initial_value); abs_inc = inc; } - else if (inc < 0) + else { abs_diff = INTVAL (initial_value) - INTVAL (final_value); abs_inc = -inc; } - else - abort (); /* Given that iteration_var is going to iterate over its own mode, not HOST_WIDE_INT, disregard higher bits that might have come @@ -6964,19 +7000,15 @@ record_giv (const struct loop *loop, struct induction *v, rtx insn, /* Add the giv to the class of givs computed from one biv. */ bl = REG_IV_CLASS (ivs, REGNO (src_reg)); - if (bl) - { - v->next_iv = bl->giv; - bl->giv = v; - /* Don't count DEST_ADDR. This is supposed to count the number of - insns that calculate givs. */ - if (type == DEST_REG) - bl->giv_count++; - bl->total_benefit += benefit; - } - else - /* Fatal error, biv missing for this giv? */ - abort (); + gcc_assert (bl); + v->next_iv = bl->giv; + bl->giv = v; + + /* Don't count DEST_ADDR. This is supposed to count the number of + insns that calculate givs. */ + if (type == DEST_REG) + bl->giv_count++; + bl->total_benefit += benefit; if (type == DEST_ADDR) { @@ -7191,8 +7223,7 @@ final_giv_value (const struct loop *loop, struct induction *v) } /* Replaceable giv's should never reach here. */ - if (v->replaceable) - abort (); + gcc_assert (!v->replaceable); /* Check to see if the biv is dead at all loop exits. */ if (reg_dead_after_loop (loop, v->dest_reg)) @@ -7621,9 +7652,9 @@ basic_induction_var (const struct loop *loop, rtx x, enum machine_mode mode, case CONST_INT: case SYMBOL_REF: case CONST: - /* convert_modes aborts if we try to convert to or from CCmode, so just + /* convert_modes dies if we try to convert to or from CCmode, so just exclude that case. It is very unlikely that a condition code value - would be a useful iterator anyways. convert_modes aborts if we try to + would be a useful iterator anyways. convert_modes dies if we try to convert a float mode to non-float or vice versa too. */ if (loop->level == 1 && GET_MODE_CLASS (mode) == GET_MODE_CLASS (GET_MODE (dest_reg)) @@ -7756,7 +7787,7 @@ general_induction_var (const struct loop *loop, rtx x, rtx *src_reg, break; default: - abort (); + gcc_unreachable (); } /* Remove any enclosing USE from ADD_VAL and MULT_VAL (there will be @@ -7875,7 +7906,7 @@ simplify_giv_expr (const struct loop *loop, rtx x, rtx *ext_val, int *benefit) ext_val, benefit); default: - abort (); + gcc_unreachable (); } /* Each argument must be either REG, PLUS, or MULT. Convert REG to @@ -8016,7 +8047,7 @@ simplify_giv_expr (const struct loop *loop, rtx x, rtx *ext_val, int *benefit) ext_val, benefit); default: - abort (); + gcc_unreachable (); } case ASHIFT: @@ -8775,7 +8806,7 @@ extension_within_bounds_p (const struct loop *loop, struct iv_class *bl, break; default: - abort (); + gcc_unreachable (); } return ((!signedp || biv_fits_mode_p (loop, bl, incr, mode, false)) @@ -8904,7 +8935,7 @@ combine_givs (struct loop_regs *regs, struct iv_class *bl) /* If a DEST_REG GIV is used only once, do not allow it to combine with anything, for in doing so we will gain nothing that cannot be had by simply letting the GIV with which we would have combined - to be reduced on its own. The losage shows up in particular with + to be reduced on its own. The lossage shows up in particular with DEST_ADDR targets on hosts with reg+reg addressing, though it can be seen elsewhere as well. */ if (g1->giv_type == DEST_REG @@ -11112,8 +11143,7 @@ try_copy_prop (const struct loop *loop, rtx replacement, unsigned int regno) && REG_P (SET_DEST (set)) && REGNO (SET_DEST (set)) == regno) { - if (init_insn) - abort (); + gcc_assert (!init_insn); init_insn = insn; if (REGNO_FIRST_UID (regno) == INSN_UID (insn)) @@ -11146,8 +11176,7 @@ try_copy_prop (const struct loop *loop, rtx replacement, unsigned int regno) } } } - if (! init_insn) - abort (); + gcc_assert (init_insn); if (apply_change_group ()) { if (loop_dump_stream) @@ -11648,7 +11677,7 @@ loop_giv_dump (const struct induction *v, FILE *file, int verbose) fprintf (file, " ext tr"); break; default: - abort (); + gcc_unreachable (); } } diff --git a/gcc/machmode.def b/gcc/machmode.def index 5e45efc0180..7e4898628e4 100644 --- a/gcc/machmode.def +++ b/gcc/machmode.def @@ -1,6 +1,6 @@ /* This file contains the definitions and documentation for the machine modes used in the GNU compiler. - Copyright (C) 1987, 1992, 1994, 1997, 1998, 2000, 2003, 2004 + Copyright (C) 1987, 1992, 1994, 1997, 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -41,7 +41,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA A CLASS argument must be one of the constants defined in mode-classes.def, less the leading MODE_ prefix; some statements - that take CLASS arguments have restructions on which classes are + that take CLASS arguments have restrictions on which classes are acceptable. For instance, INT. A MODE argument must be the printable name of a machine mode, diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index 4adc662a5c2..49ae0773d99 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -3,7 +3,7 @@ in the form of comments (the mips assembler does not support assembly access to debug information). Copyright (C) 1991, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Meissner (meissner@cygnus.com). This file is part of GCC. @@ -1746,7 +1746,7 @@ add_string (varray_t *vp, shash_t **hash_tbl, const char *start, /* Add a local symbol. The symbol string starts at STR_START and the - first byte after it is makred by STR_END_P1. The symbol has type + first byte after it is marked by STR_END_P1. The symbol has type TYPE and storage class STORAGE and value VALUE. INDX is an index to local/aux. symbols. */ @@ -2358,7 +2358,7 @@ initialize_init_file (void) init_file.fdr.fMerge = 1; init_file.fdr.glevel = GLEVEL_2; -#ifdef HOST_WORDS_BIG_ENDIAN +#ifdef WORDS_BIG_ENDIAN init_file.fdr.fBigendian = 1; #endif @@ -4438,7 +4438,7 @@ copy_object (void) - /* Abort if the symbol table is not last. */ + /* The symbol table should be last. */ if (max_file_offset != (unsigned long) stat_buf.st_size) fatal ("symbol table is not last (symbol table ends at %ld, .o ends at %ld", max_file_offset, @@ -4940,7 +4940,7 @@ pfatal_with_name (const char *msg) } -/* Procedure to abort with an out of bounds error message. It has +/* Procedure to die with an out of bounds error message. It has type int, so it can be used with an ?: expression within the ORIG_xxx macros, but the function never returns. */ diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh index 70d9a23d92d..8fd9de29419 100644 --- a/gcc/mkconfig.sh +++ b/gcc/mkconfig.sh @@ -54,7 +54,7 @@ for def in $DEFINES; do echo "#endif" >> ${output}T done -# The first entry in HEADERS may be auto-host.h or auto-build.h; +# The first entry in HEADERS may be auto-FOO.h ; # it wants to be included even when not -DIN_GCC. if [ -n "$HEADERS" ]; then set $HEADERS @@ -72,17 +72,11 @@ if [ -n "$HEADERS" ]; then fi fi -# If this is tconfig.h, now define USED_FOR_TARGET. If this is tm.h, -# now include insn-constants.h and insn-flags.h only if IN_GCC is -# defined but neither GENERATOR_FILE nor USED_FOR_TARGET is defined. -# (Much of this is temporary.) +# If this is tm.h, now include insn-constants.h and insn-flags.h only +# if IN_GCC is defined but neither GENERATOR_FILE nor USED_FOR_TARGET +# is defined. (Much of this is temporary.) case $output in - tconfig.h ) - cat >> ${output}T <> ${output}T <ii - 1) / (ps)->ii) -#define CFG_HOOKS cfg_layout_rtl_cfg_hooks - /* A single instruction in the partial schedule. */ struct ps_insn { @@ -145,16 +143,31 @@ struct partial_schedule ddg_ptr g; /* The DDG of the insns in the partial schedule. */ }; +/* We use this to record all the register replacements we do in + the kernel so we can undo SMS if it is not profitable. */ +struct undo_replace_buff_elem +{ + rtx insn; + rtx orig_reg; + rtx new_reg; + struct undo_replace_buff_elem *next; +}; + -static partial_schedule_ptr create_partial_schedule (int ii, ddg_ptr, int history); -static void free_partial_schedule (partial_schedule_ptr); -static void reset_partial_schedule (partial_schedule_ptr, int new_ii); + +partial_schedule_ptr create_partial_schedule (int ii, ddg_ptr, int history); +void free_partial_schedule (partial_schedule_ptr); +void reset_partial_schedule (partial_schedule_ptr, int new_ii); void print_partial_schedule (partial_schedule_ptr, FILE *); +static int kernel_number_of_cycles (rtx first_insn, rtx last_insn); static ps_insn_ptr ps_add_node_check_conflicts (partial_schedule_ptr, ddg_node_ptr node, int cycle, sbitmap must_precede, sbitmap must_follow); static void rotate_partial_schedule (partial_schedule_ptr, int); +void set_row_column_for_ps (partial_schedule_ptr); +static bool ps_unschedule_node (partial_schedule_ptr, ddg_node_ptr ); + /* This page defines constants and structures for the modulo scheduling driver. */ @@ -174,12 +187,11 @@ static void set_node_sched_params (ddg_ptr); static partial_schedule_ptr sms_schedule_by_order (ddg_ptr, int, int, int *, FILE*); static void permute_partial_schedule (partial_schedule_ptr ps, rtx last); -static void generate_prolog_epilog (partial_schedule_ptr, rtx, rtx, int); +static void generate_prolog_epilog (partial_schedule_ptr ,struct loop * loop, rtx); static void duplicate_insns_of_cycles (partial_schedule_ptr ps, int from_stage, int to_stage, int is_prolog); - #define SCHED_ASAP(x) (((node_sched_params_ptr)(x)->aux.info)->asap) #define SCHED_TIME(x) (((node_sched_params_ptr)(x)->aux.info)->time) #define SCHED_FIRST_REG_MOVE(x) \ @@ -337,6 +349,10 @@ const_iteration_count (rtx count_reg, basic_block pre_header, { rtx insn; rtx head, tail; + + if (! pre_header) + return NULL_RTX; + get_block_head_tail (pre_header->index, &head, &tail); for (insn = tail; insn != PREV_INSN (head); insn = PREV_INSN (insn)) @@ -399,6 +415,8 @@ print_node_sched_params (FILE * dump_file, int num_nodes) { int i; + if (! dump_file) + return; for (i = 0; i < num_nodes; i++) { node_sched_params_ptr nsp = &node_sched_params[i]; @@ -441,20 +459,24 @@ calculate_maxii (ddg_ptr g) return maxii; } - -/* Given the partial schedule, generate register moves when the length - of the register live range is more than ii; the number of moves is - determined according to the following equation: - SCHED_TIME (use) - SCHED_TIME (def) { 1 broken loop-carried - nreg_moves = ----------------------------------- - { dependence. - ii { 0 if not. - This handles the modulo-variable-expansions (mve's) needed for the ps. */ -static void +/* + Breaking intra-loop register anti-dependences: + Each intra-loop register anti-dependence implies a cross-iteration true + dependence of distance 1. Therefore, we can remove such false dependencies + and figure out if the partial schedule broke them by checking if (for a + true-dependence of distance 1): SCHED_TIME (def) < SCHED_TIME (use) and + if so generate a register move. The number of such moves is equal to: + SCHED_TIME (use) - SCHED_TIME (def) { 0 broken + nreg_moves = ----------------------------------- + 1 - { dependence. + ii { 1 if not. +*/ +static struct undo_replace_buff_elem * generate_reg_moves (partial_schedule_ptr ps) { ddg_ptr g = ps->g; int ii = ps->ii; int i; + struct undo_replace_buff_elem *reg_move_replaces = NULL; for (i = 0; i < g->num_nodes; i++) { @@ -472,6 +494,9 @@ generate_reg_moves (partial_schedule_ptr ps) { int nreg_moves4e = (SCHED_TIME (e->dest) - SCHED_TIME (e->src)) / ii; + if (e->distance == 1) + nreg_moves4e = (SCHED_TIME (e->dest) - SCHED_TIME (e->src) + ii) / ii; + /* If dest precedes src in the schedule of the kernel, then dest will read before src writes and we can save one reg_copy. */ if (SCHED_ROW (e->dest) == SCHED_ROW (e->src) @@ -495,6 +520,9 @@ generate_reg_moves (partial_schedule_ptr ps) { int dest_copy = (SCHED_TIME (e->dest) - SCHED_TIME (e->src)) / ii; + if (e->distance == 1) + dest_copy = (SCHED_TIME (e->dest) - SCHED_TIME (e->src) + ii) / ii; + if (SCHED_ROW (e->dest) == SCHED_ROW (e->src) && SCHED_COLUMN (e->dest) < SCHED_COLUMN (e->src)) dest_copy--; @@ -521,11 +549,77 @@ generate_reg_moves (partial_schedule_ptr ps) SCHED_FIRST_REG_MOVE (u) = reg_move; EXECUTE_IF_SET_IN_SBITMAP (uses_of_defs[i_reg_move], 0, i_use, - replace_rtx (g->nodes[i_use].insn, old_reg, new_reg)); + { + struct undo_replace_buff_elem *rep; + + rep = (struct undo_replace_buff_elem *) + xcalloc (1, sizeof (struct undo_replace_buff_elem)); + rep->insn = g->nodes[i_use].insn; + rep->orig_reg = old_reg; + rep->new_reg = new_reg; + + if (! reg_move_replaces) + reg_move_replaces = rep; + else + { + rep->next = reg_move_replaces; + reg_move_replaces = rep; + } + + replace_rtx (g->nodes[i_use].insn, old_reg, new_reg); + }); prev_reg = new_reg; } } + return reg_move_replaces; +} + +/* We call this when we want to undo the SMS schedule for a given loop. + One of the things that we do is to delete the register moves generated + for the sake of SMS; this function deletes the register move instructions + recorded in the undo buffer. */ +static void +undo_generate_reg_moves (partial_schedule_ptr ps, + struct undo_replace_buff_elem *reg_move_replaces) +{ + int i,j; + + for (i = 0; i < ps->g->num_nodes; i++) + { + ddg_node_ptr u = &ps->g->nodes[i]; + rtx prev; + rtx crr = SCHED_FIRST_REG_MOVE (u); + + for (j = 0; j < SCHED_NREG_MOVES (u); j++) + { + prev = PREV_INSN (crr); + delete_insn (crr); + crr = prev; + } + } + + while (reg_move_replaces) + { + struct undo_replace_buff_elem *rep = reg_move_replaces; + + reg_move_replaces = reg_move_replaces->next; + replace_rtx (rep->insn, rep->new_reg, rep->orig_reg); + } +} + +/* Free memory allocated for the undo buffer. */ +static void +free_undo_replace_buff (struct undo_replace_buff_elem *reg_move_replaces) +{ + + while (reg_move_replaces) + { + struct undo_replace_buff_elem *rep = reg_move_replaces; + + reg_move_replaces = reg_move_replaces->next; + free (rep); + } } /* Bump the SCHED_TIMEs of all nodes to start from zero. Set the values @@ -538,13 +632,13 @@ normalize_sched_times (partial_schedule_ptr ps) int amount = PS_MIN_CYCLE (ps); int ii = ps->ii; - for (i = 0; i < g->num_nodes; i++) + /* Don't include the closing branch assuming that it is the last node. */ + for (i = 0; i < g->num_nodes - 1; i++) { ddg_node_ptr u = &g->nodes[i]; int normalized_time = SCHED_TIME (u) - amount; - if (normalized_time < 0) - abort (); + gcc_assert (normalized_time >= 0); SCHED_TIME (u) = normalized_time; SCHED_ROW (u) = normalized_time % ii; @@ -585,6 +679,25 @@ permute_partial_schedule (partial_schedule_ptr ps, rtx last) PREV_INSN (last)); } +/* As part of undoing SMS we return to the original ordering of the + instructions inside the loop kernel. Given the partial schedule PS, this + function returns the ordering of the instruction according to their CUID + in the DDG (PS->G), which is the original order of the instruction before + performing SMS. */ +static void +undo_permute_partial_schedule (partial_schedule_ptr ps, rtx last) +{ + int i; + + for (i = 0 ; i < ps->g->num_nodes; i++) + if (last == ps->g->nodes[i].insn + || last == ps->g->nodes[i].first_note) + break; + else if (PREV_INSN (last) != ps->g->nodes[i].insn) + reorder_insns_nobb (ps->g->nodes[i].first_note, ps->g->nodes[i].insn, + PREV_INSN (last)); +} + /* Used to generate the prologue & epilogue. Duplicate the subset of nodes whose stages are between FROM_STAGE and TO_STAGE (inclusive of both), together with a prefix/suffix of their reg_moves. */ @@ -607,7 +720,7 @@ duplicate_insns_of_cycles (partial_schedule_ptr ps, int from_stage, /* SCHED_STAGE (u_node) >= from_stage == 0. Generate increasing number of reg_moves starting with the second occurrence of u_node, which is generated if its SCHED_STAGE <= to_stage. */ - i_reg_moves = to_stage - SCHED_STAGE (u_node); + i_reg_moves = to_stage - SCHED_STAGE (u_node) + 1; i_reg_moves = MAX (i_reg_moves, 0); i_reg_moves = MIN (i_reg_moves, SCHED_NREG_MOVES (u_node)); @@ -641,7 +754,6 @@ duplicate_insns_of_cycles (partial_schedule_ptr ps, int from_stage, for (j = 0; j < i_reg_moves; j++, reg_move = NEXT_INSN (reg_move)) emit_insn (copy_rtx (PATTERN (reg_move))); - if (SCHED_STAGE (u_node) >= from_stage && SCHED_STAGE (u_node) <= to_stage) duplicate_insn_chain (u_node->first_note, u_node->insn); @@ -651,39 +763,27 @@ duplicate_insns_of_cycles (partial_schedule_ptr ps, int from_stage, /* Generate the instructions (including reg_moves) for prolog & epilog. */ static void -generate_prolog_epilog (partial_schedule_ptr ps, rtx orig_loop_beg, - rtx orig_loop_end, int unknown_count) +generate_prolog_epilog (partial_schedule_ptr ps, struct loop * loop, rtx count_reg) { int i; int last_stage = PS_STAGE_COUNT (ps) - 1; edge e; - rtx c_reg = NULL_RTX; - rtx cmp = NULL_RTX; - rtx precond_jump = NULL_RTX; - rtx precond_exit_label = NULL_RTX; - rtx precond_exit_label_insn = NULL_RTX; - rtx last_epilog_insn = NULL_RTX; - rtx loop_exit_label = NULL_RTX; - rtx loop_exit_label_insn = NULL_RTX; - rtx orig_loop_bct = NULL_RTX; - - /* Loop header edge. */ - e = EDGE_PRED (ps->g->bb, 0); - if (e->src == ps->g->bb) - e = EDGE_PRED (ps->g->bb, 1); /* Generate the prolog, inserting its insns on the loop-entry edge. */ start_sequence (); - /* This is the place where we want to insert the precondition. */ - if (unknown_count) - precond_jump = emit_note (NOTE_INSN_DELETED); + if (count_reg) + /* Generate a subtract instruction at the beginning of the prolog to + adjust the loop count by STAGE_COUNT. */ + emit_insn (gen_sub2_insn (count_reg, GEN_INT (last_stage))); for (i = 0; i < last_stage; i++) duplicate_insns_of_cycles (ps, 0, i, 1); - /* No need to call insert_insn_on_edge; we prepared the sequence. */ - e->insns.r = get_insns (); + /* Put the prolog , on the one and only entry edge. */ + e = loop_preheader_edge (loop); + loop_split_edge_with(e , get_insns()); + end_sequence (); /* Generate the epilog, inserting its insns on the loop-exit edge. */ @@ -692,107 +792,179 @@ generate_prolog_epilog (partial_schedule_ptr ps, rtx orig_loop_beg, for (i = 0; i < last_stage; i++) duplicate_insns_of_cycles (ps, i + 1, last_stage, 0); - last_epilog_insn = emit_note (NOTE_INSN_DELETED); + /* Put the epilogue on the one and only one exit edge. */ + gcc_assert (loop->single_exit); + e = loop->single_exit; + loop_split_edge_with(e , get_insns()); + end_sequence (); +} - /* Emit the label where to put the original loop code. */ - if (unknown_count) +/* Return the line note insn preceding INSN, for debugging. Taken from + emit-rtl.c. */ +static rtx +find_line_note (rtx insn) +{ + for (; insn; insn = PREV_INSN (insn)) + if (NOTE_P (insn) + && NOTE_LINE_NUMBER (insn) >= 0) + break; + + return insn; +} + +/* Return true if all the BBs of the loop are empty except the + loop header. */ +static bool +loop_single_full_bb_p (struct loop *loop) +{ + unsigned i; + basic_block *bbs = get_loop_body (loop); + + for (i = 0; i < loop->num_nodes ; i++) { - rtx label, cond; + rtx head, tail; + bool empty_bb = true; + + if (bbs[i] == loop->header) + continue; - precond_exit_label = gen_label_rtx (); - precond_exit_label_insn = emit_label (precond_exit_label); + /* Make sure that basic blocks other than the header + have only notes labels or jumps. */ + get_block_head_tail (bbs[i]->index, &head, &tail); + for (; head != NEXT_INSN (tail); head = NEXT_INSN (head)) + { + if (NOTE_P (head) || LABEL_P (head) + || (INSN_P (head) && JUMP_P (head))) + continue; + empty_bb = false; + break; + } - /* Put the original loop code. */ - reorder_insns_nobb (orig_loop_beg, orig_loop_end, precond_exit_label_insn); + if (! empty_bb) + { + free (bbs); + return false; + } + } + free (bbs); + return true; +} - /* Change the label of the BCT to be the PRECOND_EXIT_LABEL. */ - orig_loop_bct = get_last_insn (); - c_reg = doloop_register_get (orig_loop_bct, &cmp); - label = XEXP (SET_SRC (cmp), 1); - cond = XEXP (SET_SRC (cmp), 0); +/* A simple loop from SMS point of view; it is a loop that is composed of + either a single basic block or two BBs - a header and a latch. */ +#define SIMPLE_SMS_LOOP_P(loop) ((loop->num_nodes < 3 ) \ + && (EDGE_COUNT (loop->latch->preds) == 1) \ + && (EDGE_COUNT (loop->latch->succs) == 1)) - if (! c_reg || GET_CODE (cond) != NE) - abort (); +/* Return true if the loop is in its canonical form and false if not. + i.e. SIMPLE_SMS_LOOP_P and have one preheader block, and single exit. */ +static bool +loop_canon_p (struct loop *loop, FILE *dump_file) +{ - XEXP (label, 0) = precond_exit_label; - JUMP_LABEL (orig_loop_bct) = precond_exit_label_insn; - LABEL_NUSES (precond_exit_label_insn)++; + if (loop->inner || ! loop->outer) + return false; + + if (!loop->single_exit) + { + if (dump_file) + { + rtx line_note = find_line_note (BB_END (loop->header)); - /* Generate the loop exit label. */ - loop_exit_label = gen_label_rtx (); - loop_exit_label_insn = emit_label (loop_exit_label); + fprintf (dump_file, "SMS loop many exits "); + if (line_note) + { + expanded_location xloc; + NOTE_EXPANDED_LOCATION (xloc, line_note); + fprintf (stats_file, " %s %d (file, line)\n", + xloc.file, xloc.line); + } + } + return false; } - e = EDGE_SUCC (ps->g->bb, 0); - if (e->dest == ps->g->bb) - e = EDGE_SUCC (ps->g->bb, 1); + if (! SIMPLE_SMS_LOOP_P (loop) && ! loop_single_full_bb_p (loop)) + { + if (dump_file) + { + rtx line_note = find_line_note (BB_END (loop->header)); - e->insns.r = get_insns (); - end_sequence (); + fprintf (dump_file, "SMS loop many BBs. "); + if (line_note) + { + expanded_location xloc; + NOTE_EXPANDED_LOCATION (xloc, line_note); + fprintf (stats_file, " %s %d (file, line)\n", + xloc.file, xloc.line); + } + } + return false; + } - commit_edge_insertions (); + return true; +} + +/* If there are more than one entry for the loop, + make it one by splitting the first entry edge and + redirecting the others to the new BB. */ +static void +canon_loop (struct loop *loop) +{ + edge e; + edge_iterator i; - if (unknown_count) + /* Avoid annoying special cases of edges going to exit + block. */ + FOR_EACH_EDGE (e, i, EXIT_BLOCK_PTR->preds) + if ((e->flags & EDGE_FALLTHRU) && (EDGE_COUNT (e->src->succs) > 1)) + loop_split_edge_with (e, NULL_RTX); + + if (loop->latch == loop->header + || EDGE_COUNT (loop->latch->succs) > 1) { - rtx precond_insns, epilog_jump, insert_after_insn; - basic_block loop_exit_bb = BLOCK_FOR_INSN (loop_exit_label_insn); - basic_block epilog_bb = BLOCK_FOR_INSN (last_epilog_insn); - basic_block precond_bb = BLOCK_FOR_INSN (precond_jump); - basic_block orig_loop_bb = BLOCK_FOR_INSN (precond_exit_label_insn); - edge epilog_exit_edge = single_succ_edge (epilog_bb); - - /* Do loop preconditioning to take care of cases were the loop count is - less than the stage count. Update the CFG properly. */ - insert_after_insn = precond_jump; - start_sequence (); - c_reg = doloop_register_get (ps->g->closing_branch->insn, &cmp); - emit_cmp_and_jump_insns (c_reg, GEN_INT (PS_STAGE_COUNT (ps)), LT, NULL, - GET_MODE (c_reg), 1, precond_exit_label); - precond_insns = get_insns (); - precond_jump = get_last_insn (); - end_sequence (); - reorder_insns (precond_insns, precond_jump, insert_after_insn); - - /* Generate a subtract instruction at the beginning of the prolog to - adjust the loop count by STAGE_COUNT. */ - emit_insn_after (gen_sub2_insn (c_reg, GEN_INT (PS_STAGE_COUNT (ps) - 1)), - precond_jump); - update_bb_for_insn (precond_bb); - delete_insn (insert_after_insn); - - /* Update label info for the precondition jump. */ - JUMP_LABEL (precond_jump) = precond_exit_label_insn; - LABEL_NUSES (precond_exit_label_insn)++; - - /* Update the CFG. */ - split_block (precond_bb, precond_jump); - make_edge (precond_bb, orig_loop_bb, 0); - - /* Add a jump at end of the epilog to the LOOP_EXIT_LABEL to jump over the - original loop copy and update the CFG. */ - epilog_jump = emit_jump_insn_after (gen_jump (loop_exit_label), - last_epilog_insn); - delete_insn (last_epilog_insn); - JUMP_LABEL (epilog_jump) = loop_exit_label_insn; - LABEL_NUSES (loop_exit_label_insn)++; - - redirect_edge_succ (epilog_exit_edge, loop_exit_bb); - epilog_exit_edge->flags &= ~EDGE_FALLTHRU; - emit_barrier_after (BB_END (epilog_bb)); + FOR_EACH_EDGE (e, i, loop->header->preds) + if (e->src == loop->latch) + break; + loop_split_edge_with (e, NULL_RTX); } } -/* Return the line note insn preceding INSN, for debugging. Taken from - emit-rtl.c. */ -static rtx -find_line_note (rtx insn) +/* Build the loop information without loop + canonization, the loop canonization will + be performed if the loop is SMSable. */ +static struct loops * +build_loops_structure (FILE *dumpfile) { - for (; insn; insn = PREV_INSN (insn)) - if (NOTE_P (insn) - && NOTE_LINE_NUMBER (insn) >= 0) - break; + struct loops *loops = xcalloc (1, sizeof (struct loops)); - return insn; + /* Find the loops. */ + + if (flow_loops_find (loops) <= 1) + { + /* No loops. */ + flow_loops_free (loops); + free (loops); + + return NULL; + } + + /* Not going to update these. */ + free (loops->cfg.rc_order); + loops->cfg.rc_order = NULL; + free (loops->cfg.dfs_order); + loops->cfg.dfs_order = NULL; + + create_preheaders (loops, CP_SIMPLE_PREHEADERS); + mark_single_exit_loops (loops); + /* Dump loops. */ + flow_loops_dump (loops, dumpfile, NULL, 1); + +#ifdef ENABLE_CHECKING + verify_dominators (CDI_DOMINATORS); + verify_loop_structure (loops); +#endif + + return loops; } /* Main entry point, perform SMS scheduling on the loops of the function @@ -803,13 +975,22 @@ sms_schedule (FILE *dump_file) static int passes = 0; rtx insn; ddg_ptr *g_arr, g; - basic_block bb, pre_header = NULL; int * node_order; int maxii; - int i; + unsigned i,num_loops; partial_schedule_ptr ps; - int max_bb_index = last_basic_block; struct df *df; + struct loops *loops; + basic_block bb = NULL; + /* vars to the versioning only if needed*/ + struct loop * nloop; + basic_block condition_bb = NULL; + edge latch_edge; + gcov_type trip_count = 0; + + if (! (loops = build_loops_structure (dump_file))) + return; /* There is no loops to schedule. */ + stats_file = dump_file; @@ -819,7 +1000,7 @@ sms_schedule (FILE *dump_file) int temp = reload_completed; reload_completed = 1; - issue_rate = (*targetm.sched.issue_rate) (); + issue_rate = targetm.sched.issue_rate (); reload_completed = temp; } else @@ -833,58 +1014,47 @@ sms_schedule (FILE *dump_file) df = df_init (); df_analyze (df, 0, DF_ALL); - /* Allocate memory to hold the DDG array. */ - g_arr = xcalloc (max_bb_index, sizeof (ddg_ptr)); + /* Allocate memory to hold the DDG array one entry for each loop. + We use loop->num as index into this array. */ + g_arr = xcalloc (loops->num, sizeof (ddg_ptr)); + /* Build DDGs for all the relevant loops and hold them in G_ARR - indexed by the loop BB index. */ - FOR_EACH_BB (bb) + indexed by the loop index. */ + for (i = 0; i < loops->num; i++) { rtx head, tail; rtx count_reg, comp; - edge e, pre_header_edge; - - if (bb->index < 0) - continue; - - /* Check if bb has two successors, one being itself. */ - if (EDGE_COUNT (bb->succs) != 2) - continue; - - if (EDGE_SUCC (bb, 0)->dest != bb && EDGE_SUCC (bb, 1)->dest != bb) - continue; + struct loop *loop = loops->parray[i]; - if ((EDGE_SUCC (bb, 0)->flags & EDGE_COMPLEX) - || (EDGE_SUCC (bb, 1)->flags & EDGE_COMPLEX)) - continue; + /* For debugging. */ + if ((passes++ > MAX_SMS_LOOP_NUMBER) && (MAX_SMS_LOOP_NUMBER != -1)) + { + if (dump_file) + fprintf (dump_file, "SMS reached MAX_PASSES... \n"); - /* Check if bb has two predecessors, one being itself. */ - if (EDGE_COUNT (bb->preds) != 2) - continue; + break; + } - if (EDGE_PRED (bb, 0)->src != bb && EDGE_PRED (bb, 1)->src != bb) - continue; + if (! loop_canon_p (loop, dump_file)) + continue; - if ((EDGE_PRED (bb, 0)->flags & EDGE_COMPLEX) - || (EDGE_PRED (bb, 1)->flags & EDGE_COMPLEX)) + if (! loop_single_full_bb_p (loop)) continue; - /* For debugging. */ - if ((passes++ > MAX_SMS_LOOP_NUMBER) && (MAX_SMS_LOOP_NUMBER != -1)) - { - if (dump_file) - fprintf (dump_file, "SMS reached MAX_PASSES... \n"); - break; - } + bb = loop->header; get_block_head_tail (bb->index, &head, &tail); - pre_header_edge = EDGE_PRED (bb, 0); - if (EDGE_PRED (bb, 0)->src != bb) - pre_header_edge = EDGE_PRED (bb, 1); + latch_edge = loop_latch_edge (loop); + gcc_assert (loop->single_exit); + if (loop->single_exit->count) + trip_count = latch_edge->count / loop->single_exit->count; /* Perfrom SMS only on loops that their average count is above threshold. */ - if (bb->count < pre_header_edge->count * SMS_LOOP_AVERAGE_COUNT_THRESHOLD) - { + + if ( latch_edge->count + && (latch_edge->count < loop->single_exit->count * SMS_LOOP_AVERAGE_COUNT_THRESHOLD)) + { if (stats_file) { rtx line_note = find_line_note (tail); @@ -903,10 +1073,10 @@ sms_schedule (FILE *dump_file) fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) bb->count); fprintf (stats_file, "\n"); - fprintf (stats_file, "SMS preheader-count "); - fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, - (HOST_WIDEST_INT) pre_header_edge->count); - fprintf (stats_file, "\n"); + fprintf (stats_file, "SMS trip-count "); + fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, + (HOST_WIDEST_INT) trip_count); + fprintf (stats_file, "\n"); fprintf (stats_file, "SMS profile-sum-max "); fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) profile_info->sum_max); @@ -920,12 +1090,6 @@ sms_schedule (FILE *dump_file) if ( !(count_reg = doloop_register_get (tail, &comp))) continue; - e = EDGE_PRED (bb, 0); - if (e->src == bb) - pre_header = EDGE_PRED (bb, 1)->src; - else - pre_header = e->src; - /* Don't handle BBs with calls or barriers, or !single_set insns. */ for (insn = head; insn != NEXT_INSN (tail); insn = NEXT_INSN (insn)) if (CALL_P (insn) @@ -957,21 +1121,23 @@ sms_schedule (FILE *dump_file) continue; } - g_arr[bb->index] = g; + g_arr[i] = g; } /* Release Data Flow analysis data structures. */ df_finish (df); + /* We don't want to perform SMS on new loops - created by versioning. */ + num_loops = loops->num; /* Go over the built DDGs and perfrom SMS for each one of them. */ - for (i = 0; i < max_bb_index; i++) + for (i = 0; i < num_loops; i++) { rtx head, tail; rtx count_reg, count_init, comp; - edge pre_header_edge; int mii, rec_mii; - int stage_count = 0; + unsigned stage_count = 0; HOST_WIDEST_INT loop_count = 0; + struct loop *loop = loops->parray[i]; if (! (g = g_arr[i])) continue; @@ -979,11 +1145,12 @@ sms_schedule (FILE *dump_file) if (dump_file) print_ddg (dump_file, g); - get_block_head_tail (g->bb->index, &head, &tail); + get_block_head_tail (loop->header->index, &head, &tail); - pre_header_edge = EDGE_PRED (g->bb, 0); - if (EDGE_PRED (g->bb, 0)->src != g->bb) - pre_header_edge = EDGE_PRED (g->bb, 1); + latch_edge = loop_latch_edge (loop); + gcc_assert (loop->single_exit); + if (loop->single_exit->count) + trip_count = latch_edge->count / loop->single_exit->count; if (stats_file) { @@ -1003,10 +1170,6 @@ sms_schedule (FILE *dump_file) fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) bb->count); fprintf (stats_file, "\n"); - fprintf (stats_file, "SMS preheader-count "); - fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, - (HOST_WIDEST_INT) pre_header_edge->count); - fprintf (stats_file, "\n"); fprintf (stats_file, "SMS profile-sum-max "); fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) profile_info->sum_max); @@ -1018,17 +1181,25 @@ sms_schedule (FILE *dump_file) fprintf (stats_file, "SMS num-stores %d\n", g->num_stores); } - /* Make sure this is a doloop. */ - if ( !(count_reg = doloop_register_get (tail, &comp))) - abort (); - /* This should be NULL_RTX if the count is unknown at compile time. */ - count_init = const_iteration_count (count_reg, pre_header, &loop_count); + /* In case of th loop have doloop register it gets special + handling. */ + count_init = NULL_RTX; + if ((count_reg = doloop_register_get (tail, &comp))) + { + basic_block pre_header; + + pre_header = loop_preheader_edge (loop)->src; + count_init = const_iteration_count (count_reg, pre_header, + &loop_count); + } + gcc_assert (count_reg); if (stats_file && count_init) { fprintf (stats_file, "SMS const-doloop "); - fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, loop_count); + fprintf (stats_file, HOST_WIDEST_INT_PRINT_DEC, + loop_count); fprintf (stats_file, "\n"); } @@ -1052,46 +1223,40 @@ sms_schedule (FILE *dump_file) if (ps) stage_count = PS_STAGE_COUNT (ps); - if (stage_count == 0 || (count_init && (stage_count > loop_count))) + /* Stage count of 1 means that there is no interleaving between + iterations, let the scheduling passes do the job. */ + if (stage_count < 1 + || (count_init && (loop_count <= stage_count)) + || (flag_branch_probabilities && (trip_count <= stage_count))) { if (dump_file) - fprintf (dump_file, "SMS failed... \n"); - if (stats_file) - fprintf (stats_file, "SMS sched-failed %d\n", stage_count); + { + fprintf (dump_file, "SMS failed... \n"); + fprintf (dump_file, "SMS sched-failed (stage-count=%d, loop-count=", stage_count); + fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC, loop_count); + fprintf (dump_file, ", trip-count="); + fprintf (dump_file, HOST_WIDEST_INT_PRINT_DEC, trip_count); + fprintf (dump_file, ")\n"); + } + continue; } else { - rtx orig_loop_beg = NULL_RTX; - rtx orig_loop_end = NULL_RTX; + int orig_cycles = kernel_number_of_cycles (BB_HEAD (g->bb), BB_END (g->bb)); + int new_cycles; + struct undo_replace_buff_elem *reg_move_replaces; if (stats_file) { fprintf (stats_file, "SMS succeeded %d %d (with ii, sc)\n", ps->ii, stage_count); - print_partial_schedule (ps, dump_file); - fprintf (dump_file, + print_partial_schedule (ps, stats_file); + fprintf (stats_file, "SMS Branch (%d) will later be scheduled at cycle %d.\n", g->closing_branch->cuid, PS_MIN_CYCLE (ps) - 1); } - /* Save the original loop if we want to do loop preconditioning in - case the BCT count is not known. */ - if (! count_init) - { - int i; - - start_sequence (); - /* Copy the original loop code before modifying it - - so we can use it later. */ - for (i = 0; i < ps->g->num_nodes; i++) - duplicate_insn_chain (ps->g->nodes[i].first_note, - ps->g->nodes[i].insn); - - orig_loop_beg = get_insns (); - orig_loop_end = get_last_insn (); - end_sequence (); - } /* Set the stage boundaries. If the DDG is built with closing_branch_deps, the closing_branch was scheduled and should appear in the last (ii-1) row. Otherwise, we are free to schedule the branch, and we let nodes @@ -1101,26 +1266,66 @@ sms_schedule (FILE *dump_file) rotate_partial_schedule (ps, PS_MIN_CYCLE (ps)); set_columns_for_ps (ps); + /* Generate the kernel just to be able to measure its cycles. */ permute_partial_schedule (ps, g->closing_branch->first_note); + reg_move_replaces = generate_reg_moves (ps); - /* Mark this loop as software pipelined so the later - scheduling passes doesn't touch it. */ - if (! flag_resched_modulo_sched) - g->bb->flags |= BB_DISABLE_SCHEDULE; + /* Get the number of cycles the new kernel expect to execute in. */ + new_cycles = kernel_number_of_cycles (BB_HEAD (g->bb), BB_END (g->bb)); - generate_reg_moves (ps); - if (dump_file) - print_node_sched_params (dump_file, g->num_nodes); + /* Get back to the original loop so we can do loop versioning. */ + undo_permute_partial_schedule (ps, g->closing_branch->first_note); + if (reg_move_replaces) + undo_generate_reg_moves (ps, reg_move_replaces); - /* Set new iteration count of loop kernel. */ - if (count_init) - SET_SRC (single_set (count_init)) = GEN_INT (loop_count - - stage_count + 1); + if ( new_cycles >= orig_cycles) + { + /* SMS is not profitable so undo the permutation and reg move generation + and return the kernel to its original state. */ + if (dump_file) + fprintf (dump_file, "Undoing SMS becuase it is not profitable.\n"); - /* Generate prolog and epilog. */ - generate_prolog_epilog (ps, orig_loop_beg, orig_loop_end, - count_init ? 0 : 1); + } + else + { + canon_loop (loop); + + /* case the BCT count is not known , Do loop-versioning */ + if (count_reg && ! count_init) + { + rtx comp_rtx = gen_rtx_fmt_ee (GT, VOIDmode, count_reg, + GEN_INT(stage_count)); + + nloop = loop_version (loops, loop, comp_rtx, &condition_bb); + } + + /* Set new iteration count of loop kernel. */ + if (count_reg && count_init) + SET_SRC (single_set (count_init)) = GEN_INT (loop_count + - stage_count + 1); + + /* Now apply the scheduled kernel to the RTL of the loop. */ + permute_partial_schedule (ps, g->closing_branch->first_note); + + /* Mark this loop as software pipelined so the later + scheduling passes doesn't touch it. */ + if (! flag_resched_modulo_sched) + g->bb->flags |= BB_DISABLE_SCHEDULE; + /* The life-info is not valid any more. */ + g->bb->flags |= BB_DIRTY; + + reg_move_replaces = generate_reg_moves (ps); + if (dump_file) + print_node_sched_params (dump_file, g->num_nodes); + /* Generate prolog and epilog. */ + if (count_reg && !count_init) + generate_prolog_epilog (ps, loop, count_reg); + else + generate_prolog_epilog (ps, loop, NULL_RTX); + } + free_undo_replace_buff (reg_move_replaces); } + free_partial_schedule (ps); free (node_sched_params); free (node_order); @@ -1129,6 +1334,7 @@ sms_schedule (FILE *dump_file) /* Release scheduler data, needed until now because of DFA. */ sched_finish (); + loop_optimizer_finalize (loops, dump_file); } /* The SMS scheduling algorithm itself @@ -1207,6 +1413,140 @@ sms_schedule (FILE *dump_file) set to 0 to save compile time. */ #define DFA_HISTORY SMS_DFA_HISTORY +/* Given the partial schedule PS, this function calculates and returns the + cycles in which we can schedule the node with the given index I. + NOTE: Here we do the backtracking in SMS, in some special cases. We have + noticed that there are several cases in which we fail to SMS the loop + because the sched window of a node is empty due to tight data-deps. In + such cases we want to unschedule some of the predecessors/successors + until we get non-empty scheduling window. It returns -1 if the + scheduling window is empty and zero otherwise. */ + +static int +get_sched_window (partial_schedule_ptr ps, int *nodes_order, int i, + sbitmap sched_nodes, int ii, int *start_p, int *step_p, int *end_p) +{ + int start, step, end; + ddg_edge_ptr e; + int u = nodes_order [i]; + ddg_node_ptr u_node = &ps->g->nodes[u]; + sbitmap psp = sbitmap_alloc (ps->g->num_nodes); + sbitmap pss = sbitmap_alloc (ps->g->num_nodes); + sbitmap u_node_preds = NODE_PREDECESSORS (u_node); + sbitmap u_node_succs = NODE_SUCCESSORS (u_node); + int psp_not_empty; + int pss_not_empty; + + /* 1. compute sched window for u (start, end, step). */ + sbitmap_zero (psp); + sbitmap_zero (pss); + psp_not_empty = sbitmap_a_and_b_cg (psp, u_node_preds, sched_nodes); + pss_not_empty = sbitmap_a_and_b_cg (pss, u_node_succs, sched_nodes); + + if (psp_not_empty && !pss_not_empty) + { + int early_start = INT_MIN; + + end = INT_MAX; + for (e = u_node->in; e != 0; e = e->next_in) + { + ddg_node_ptr v_node = e->src; + if (TEST_BIT (sched_nodes, v_node->cuid)) + { + int node_st = SCHED_TIME (v_node) + + e->latency - (e->distance * ii); + + early_start = MAX (early_start, node_st); + + if (e->data_type == MEM_DEP) + end = MIN (end, SCHED_TIME (v_node) + ii - 1); + } + } + start = early_start; + end = MIN (end, early_start + ii); + step = 1; + } + + else if (!psp_not_empty && pss_not_empty) + { + int late_start = INT_MAX; + + end = INT_MIN; + for (e = u_node->out; e != 0; e = e->next_out) + { + ddg_node_ptr v_node = e->dest; + if (TEST_BIT (sched_nodes, v_node->cuid)) + { + late_start = MIN (late_start, + SCHED_TIME (v_node) - e->latency + + (e->distance * ii)); + if (e->data_type == MEM_DEP) + end = MAX (end, SCHED_TIME (v_node) - ii + 1); + } + } + start = late_start; + end = MAX (end, late_start - ii); + step = -1; + } + + else if (psp_not_empty && pss_not_empty) + { + int early_start = INT_MIN; + int late_start = INT_MAX; + + start = INT_MIN; + end = INT_MAX; + for (e = u_node->in; e != 0; e = e->next_in) + { + ddg_node_ptr v_node = e->src; + + if (TEST_BIT (sched_nodes, v_node->cuid)) + { + early_start = MAX (early_start, + SCHED_TIME (v_node) + e->latency + - (e->distance * ii)); + if (e->data_type == MEM_DEP) + end = MIN (end, SCHED_TIME (v_node) + ii - 1); + } + } + for (e = u_node->out; e != 0; e = e->next_out) + { + ddg_node_ptr v_node = e->dest; + + if (TEST_BIT (sched_nodes, v_node->cuid)) + { + late_start = MIN (late_start, + SCHED_TIME (v_node) - e->latency + + (e->distance * ii)); + if (e->data_type == MEM_DEP) + start = MAX (start, SCHED_TIME (v_node) - ii + 1); + } + } + start = MAX (start, early_start); + end = MIN (end, MIN (early_start + ii, late_start + 1)); + step = 1; + } + else /* psp is empty && pss is empty. */ + { + start = SCHED_ASAP (u_node); + end = start + ii; + step = 1; + } + + *start_p = start; + *step_p = step; + *end_p = end; + sbitmap_free (psp); + sbitmap_free (pss); + + if ((start >= end && step == 1) || (start <= end && step == -1)) + return -1; + else + return 0; +} + +/* This function implements the scheduling algorithm for SMS according to the + above algorithm. */ static partial_schedule_ptr sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order, FILE *dump_file) { @@ -1219,126 +1559,70 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order, FILE *du sbitmap sched_nodes = sbitmap_alloc (num_nodes); sbitmap must_precede = sbitmap_alloc (num_nodes); sbitmap must_follow = sbitmap_alloc (num_nodes); + sbitmap tobe_scheduled = sbitmap_alloc (num_nodes); partial_schedule_ptr ps = create_partial_schedule (ii, g, DFA_HISTORY); - while (try_again_with_larger_ii && ii < maxii) + sbitmap_ones (tobe_scheduled); + sbitmap_zero (sched_nodes); + + while ((! sbitmap_equal (tobe_scheduled, sched_nodes) + || try_again_with_larger_ii ) && ii < maxii) { + int j; + bool unscheduled_nodes = false; + if (dump_file) fprintf(dump_file, "Starting with ii=%d\n", ii); - try_again_with_larger_ii = false; - sbitmap_zero (sched_nodes); + if (try_again_with_larger_ii) + { + try_again_with_larger_ii = false; + sbitmap_zero (sched_nodes); + } for (i = 0; i < num_nodes; i++) { int u = nodes_order[i]; - ddg_node_ptr u_node = &g->nodes[u]; - sbitmap u_node_preds = NODE_PREDECESSORS (u_node); - sbitmap u_node_succs = NODE_SUCCESSORS (u_node); - int psp_not_empty; - int pss_not_empty; + ddg_node_ptr u_node = &ps->g->nodes[u]; rtx insn = u_node->insn; if (!INSN_P (insn)) - continue; - - if (JUMP_P (insn)) /* Closing branch handled later. */ - continue; - - /* 1. compute sched window for u (start, end, step). */ - psp_not_empty = sbitmap_any_common_bits (u_node_preds, sched_nodes); - pss_not_empty = sbitmap_any_common_bits (u_node_succs, sched_nodes); - - if (psp_not_empty && !pss_not_empty) { - int early_start = 0; - - end = INT_MAX; - for (e = u_node->in; e != 0; e = e->next_in) - { - ddg_node_ptr v_node = e->src; - if (TEST_BIT (sched_nodes, v_node->cuid)) - { - int node_st = SCHED_TIME (v_node) - + e->latency - (e->distance * ii); - - early_start = MAX (early_start, node_st); - - if (e->data_type == MEM_DEP) - end = MIN (end, SCHED_TIME (v_node) + ii - 1); - } - } - start = early_start; - end = MIN (end, early_start + ii); - step = 1; + RESET_BIT (tobe_scheduled, u); + continue; } - else if (!psp_not_empty && pss_not_empty) + if (JUMP_P (insn)) /* Closing branch handled later. */ { - int late_start = INT_MAX; - - end = INT_MIN; - for (e = u_node->out; e != 0; e = e->next_out) - { - ddg_node_ptr v_node = e->dest; - if (TEST_BIT (sched_nodes, v_node->cuid)) - { - late_start = MIN (late_start, - SCHED_TIME (v_node) - e->latency - + (e->distance * ii)); - if (e->data_type == MEM_DEP) - end = MAX (end, SCHED_TIME (v_node) - ii + 1); - } - } - start = late_start; - end = MAX (end, late_start - ii); - step = -1; + RESET_BIT (tobe_scheduled, u); + continue; } - else if (psp_not_empty && pss_not_empty) - { - int early_start = 0; - int late_start = INT_MAX; + if (TEST_BIT (sched_nodes, u)) + continue; - start = INT_MIN; - end = INT_MAX; - for (e = u_node->in; e != 0; e = e->next_in) - { - ddg_node_ptr v_node = e->src; - - if (TEST_BIT (sched_nodes, v_node->cuid)) - { - early_start = MAX (early_start, - SCHED_TIME (v_node) + e->latency - - (e->distance * ii)); - if (e->data_type == MEM_DEP) - end = MIN (end, SCHED_TIME (v_node) + ii - 1); - } - } - for (e = u_node->out; e != 0; e = e->next_out) + /* Try to get non-empty scheduling window. */ + j = i; + while (get_sched_window (ps, nodes_order, i, sched_nodes, ii, &start, &step, &end) < 0 + && j > 0) + { + unscheduled_nodes = true; + if (TEST_BIT (NODE_PREDECESSORS (u_node), nodes_order[j - 1]) + || TEST_BIT (NODE_SUCCESSORS (u_node), nodes_order[j - 1])) { - ddg_node_ptr v_node = e->dest; - - if (TEST_BIT (sched_nodes, v_node->cuid)) - { - late_start = MIN (late_start, - SCHED_TIME (v_node) - e->latency - + (e->distance * ii)); - if (e->data_type == MEM_DEP) - start = MAX (start, SCHED_TIME (v_node) - ii + 1); - } + ps_unschedule_node (ps, &ps->g->nodes[nodes_order[j - 1]]); + RESET_BIT (sched_nodes, nodes_order [j - 1]); } - start = MAX (start, early_start); - end = MIN (end, MIN (early_start + ii, late_start + 1)); - step = 1; + j--; } - else /* psp is empty && pss is empty. */ + if (j < 0) { - start = SCHED_ASAP (u_node); - end = start + ii; - step = 1; + /* ??? Try backtracking instead of immediately ii++? */ + ii++; + try_again_with_larger_ii = true; + reset_partial_schedule (ps, ii); + break; } - /* 2. Try scheduling u in window. */ if (dump_file) fprintf(dump_file, "Trying to schedule node %d in (%d .. %d) step %d\n", @@ -1388,6 +1672,9 @@ sms_schedule_by_order (ddg_ptr g, int mii, int maxii, int *nodes_order, FILE *du reset_partial_schedule (ps, ii); break; } + if (unscheduled_nodes) + break; + /* ??? If (success), check register pressure estimates. */ } /* Continue with next node. */ } /* While try_again_with_larger_ii. */ @@ -1445,8 +1732,7 @@ check_nodes_order (int *node_order, int num_nodes) { int u = node_order[i]; - if (u >= num_nodes || u < 0 || TEST_BIT (tmp, u)) - abort (); + gcc_assert (u < num_nodes && u >= 0 && !TEST_BIT (tmp, u)); SET_BIT (tmp, u); } @@ -1774,7 +2060,7 @@ order_nodes_in_scc (ddg_ptr g, sbitmap nodes_ordered, sbitmap scc, modulo scheduling. */ /* Create a partial schedule and allocate a memory to hold II rows. */ -static partial_schedule_ptr +partial_schedule_ptr create_partial_schedule (int ii, ddg_ptr g, int history) { partial_schedule_ptr ps = (partial_schedule_ptr) @@ -1810,7 +2096,7 @@ free_ps_insns (partial_schedule_ptr ps) } /* Free all the memory allocated to the partial schedule. */ -static void +void free_partial_schedule (partial_schedule_ptr ps) { if (!ps) @@ -1822,7 +2108,7 @@ free_partial_schedule (partial_schedule_ptr ps) /* Clear the rows array with its PS_INSNs, and create a new one with NEW_II rows. */ -static void +void reset_partial_schedule (partial_schedule_ptr ps, int new_ii) { if (!ps) @@ -1877,7 +2163,7 @@ create_ps_insn (ddg_node_ptr node, int rest_count, int cycle) /* Removes the given PS_INSN from the partial schedule. Returns false if the node is not found in the partial schedule, else returns true. */ -static int +static bool remove_node_from_ps (partial_schedule_ptr ps, ps_insn_ptr ps_i) { int row; @@ -2056,13 +2342,65 @@ advance_one_cycle (void) { if (targetm.sched.dfa_pre_cycle_insn) state_transition (curr_state, - (*targetm.sched.dfa_pre_cycle_insn) ()); + targetm.sched.dfa_pre_cycle_insn ()); state_transition (curr_state, NULL); if (targetm.sched.dfa_post_cycle_insn) state_transition (curr_state, - (*targetm.sched.dfa_post_cycle_insn) ()); + targetm.sched.dfa_post_cycle_insn ()); +} + +/* Given the kernel of a loop (from FIRST_INSN to LAST_INSN), finds + the number of cycles according to DFA that the kernel fits in, + we use this to check if we done well with SMS after we add + register moves. In some cases register moves overhead makes + it even worse than the original loop. We want SMS to be performed + when it gives less cycles after register moves are added. */ +static int +kernel_number_of_cycles (rtx first_insn, rtx last_insn) +{ + int cycles = 0; + rtx insn; + int can_issue_more = issue_rate; + + state_reset (curr_state); + + for (insn = first_insn; + insn != NULL_RTX && insn != last_insn; + insn = NEXT_INSN (insn)) + { + if (! INSN_P (insn) || GET_CODE (PATTERN (insn)) == USE) + continue; + + /* Check if there is room for the current insn. */ + if (!can_issue_more || state_dead_lock_p (curr_state)) + { + cycles ++; + advance_one_cycle (); + can_issue_more = issue_rate; + } + + /* Update the DFA state and return with failure if the DFA found + recource conflicts. */ + if (state_transition (curr_state, insn) >= 0) + { + cycles ++; + advance_one_cycle (); + can_issue_more = issue_rate; + } + + if (targetm.sched.variable_issue) + can_issue_more = + targetm.sched.variable_issue (sched_dump, sched_verbose, + insn, can_issue_more); + /* A naked CLOBBER or USE generates no instruction, so don't + let them consume issue slots. */ + else if (GET_CODE (PATTERN (insn)) != USE + && GET_CODE (PATTERN (insn)) != CLOBBER) + can_issue_more--; + } + return cycles; } /* Checks if PS has resource conflicts according to DFA, starting from @@ -2102,8 +2440,8 @@ ps_has_conflicts (partial_schedule_ptr ps, int from, int to) if (targetm.sched.variable_issue) can_issue_more = - (*targetm.sched.variable_issue) (sched_dump, sched_verbose, - insn, can_issue_more); + targetm.sched.variable_issue (sched_dump, sched_verbose, + insn, can_issue_more); /* A naked CLOBBER or USE generates no instruction, so don't let them consume issue slots. */ else if (GET_CODE (PATTERN (insn)) != USE @@ -2122,7 +2460,7 @@ ps_has_conflicts (partial_schedule_ptr ps, int from, int to) is returned. Bit N is set in MUST_PRECEDE/MUST_FOLLOW if the node with cuid N must be come before/after (respectively) the node pointed to by PS_I when scheduled in the same cycle. */ -static ps_insn_ptr +ps_insn_ptr ps_add_node_check_conflicts (partial_schedule_ptr ps, ddg_node_ptr n, int c, sbitmap must_precede, sbitmap must_follow) @@ -2167,7 +2505,7 @@ ps_add_node_check_conflicts (partial_schedule_ptr ps, ddg_node_ptr n, /* Rotate the rows of PS such that insns scheduled at time START_CYCLE will appear in row 0. Updates max/min_cycles. */ -static void +void rotate_partial_schedule (partial_schedule_ptr ps, int start_cycle) { int i, row, backward_rotates; @@ -2193,4 +2531,25 @@ rotate_partial_schedule (partial_schedule_ptr ps, int start_cycle) ps->min_cycle -= start_cycle; } +/* Remove the node N from the partial schedule PS; because we restart the DFA + each time we want to check for resource conflicts; this is equivalent to + unscheduling the node N. */ +static bool +ps_unschedule_node (partial_schedule_ptr ps, ddg_node_ptr n) +{ + ps_insn_ptr ps_i; + int row = SMODULO (SCHED_TIME (n), ps->ii); + + if (row < 0 || row > ps->ii) + return false; + + for (ps_i = ps->rows[row]; + ps_i && ps_i->node != n; + ps_i = ps_i->next_in_row); + if (!ps_i) + return false; + + return remove_node_from_ps (ps, ps_i); +} #endif /* INSN_SCHEDULING*/ + diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 49e73af4960..00e650283b7 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,159 @@ +2005-05-18 Geoffrey Keating + + * Make-lang.in (cc1obj-dummy): New. + (cc1obj-checksum.c): New. + (cc1obj-checksum.o): New. + (cc1obj): Add cc1obj-checksum.o. + +2005-05-18 Mike Stump + + PR objc/21641 + * objc-act.c (struct interface_tuple): Mark it up for GC. + (interface_htab): It is really a struct interface_tuple. + +2005-05-17 Mike Stump + + Yet more Objective-C++... + + * objc-act.c (objc_finish_try_stmt): Add return value. + (objc_build_synchronized): Likewise. + + * objc-act.c (objc_is_gcable_type): Add. + (objc_substitute_decl): Add. + (objc_build_ivar_assignment): Add. + (objc_build_global_assignment): Add. + (objc_build_strong_cast_assignment): Add. + (objc_is_ivar_reference_p): Add. + (objc_is_global_reference_p): Add. + (objc_generate_write_barrier): Add. + (objc_rewrite_function_call): Add. + (objc_gimplify_expr): Add Objective-C++ support. + * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. + (SIZEOF_OBJC_TYPE_LANG_SPECIFIC): Add. + (INIT_TYPE_OBJC_INFO): Add Objective-C++ support. + (DUP_TYPE_OBJC_INFO): Likewise. + (struct imp_entry): Add field has_cxx_cdtors. + (struct imp_entry *imp_list): Add OCTI_UMSG_FAST_DECL, + OCTI_METH_LIST_TEMPL, OCTI_METH_PROTO_LIST_TEMPL, + OCTI_IVAR_LIST_TEMPL, OCTI_ASSIGN_IVAR_DECL, + OCTI_ASSIGN_IVAR_FAST_DECL, OCTI_ASSIGN_GLOBAL_DECL, + OCTI_ASSIGN_STRONGCAST_DECL. + (umsg_fast_decl): Add. + (objc_assign_ivar_decl): Add. + (objc_assign_ivar_fast_decl): Add. + (objc_assign_global_decl): Add. + (objc_assign_strong_cast_decl): Add. + (objc_method_list_ptr): Add. + (objc_method_proto_list_ptr): Add. + (objc_ivar_list_ptr): Add. + + * objc-act.c (should_call_super_dealloc): Add. + (OBJC_VERSION): Bump to 6. + (objc_is_gcable_type): Add. + (objc_substitute_decl): Add. + (objc_build_ivar_assignment): Add. + (objc_build_global_assignment): Add. + (objc_build_strong_cast_assignment): Add. + (objc_is_gcable_p): Add. + (objc_is_ivar_reference_p): Add. + (objc_is_global_reference_p): Add. + (generate_shared_structures): Add flags parameter. + (objc_generate_cxx_ctor_or_dtor): Add. + (objc_generate_cxx_cdtors): Add. + (add_class): Add name parameter. + (objc_types_share_size_and_alignment): Add. + (comp_proto_with_proto): Add strict parameter. + (CLS_HAS_CXX_STRUCTORS): Add. + (TAG_ASSIGNIVAR): Add. + (TAG_ASSIGNGLOBAL): Add. + (TAG_ASSIGNSTRONGCAST): Add. + (TAG_MSGSEND_FAST): Add. + (TAG_ASSIGNIVAR_FAST): Add. + (TAG_CXX_CONSTRUCT): Add. + (TAG_CXX_DESTRUCT): Add. + (OBJC_LOOKUP_CLASS): Add. + (OBJC_LOOKUP_NO_SUPER): Add. + (objc_finish_file): Add pch support. + (objc_finish_implementation): Add Objective-C++ support. + (synth_module_prologue): Likewise. + (synth_module_prologue): Add fast dispatching. + (objc_get_class_reference): Add Objective-C++ support. + (objc_generate_write_barrier): Likewise. + (next_sjlj_build_enter_and_setjmp): Likewise. + (objc_begin_try_stmt): Likewise. + (build_next_objc_exception_stuff): Add fast ivar support. + (build_private_template): Mark the record as used so debug + information is generated. + (build_protocol_template): Add Objective-C++ support. + (objc_method_parm_type) Likewise. + (objc_generate_cxx_ctor_or_dtor): Likewise. + (objc_generate_cxx_cdtors): Likewise. + (build_protocol_initializer): Likewise. + (build_category_template): Likewise. + (build_class_template): Likewise. + (build_method_list_template): Likewise. + (build_category_initializer): Likewise. + (build_shared_structure_initializer): Likewise. + (objc_finish_message_expr): Likewise. + (build_objc_method_call): Add fast dispatch support. + (lookup_method_static): Add support to end search at superclasses. + (add_method_to_hash_list): Add strict parameter to + comp_proto_with_proto. + (objc_add_method): Likewise. + (objc_add_method): Also set the interface_value. + (add_instance_variable): Add Objective-C++ support. + (objc_is_public): Likewise. + (start_class): Likewise. + (continue_class): Likewise. + (encode_aggregate_within): Likewise. + (start_method_def): Likewise. + (objc_start_function): Clear current_function_returns_value + and current_function_returns_null. + (really_start_method): Add Objective-C++ support. + (objc_finish_method_definition): Add warning for missing + [super dealloc]. + (finish_objc): Add Objective-C++ support. + (generate_objc_image_info): Likewise. + (objc_lookup_ivar): Likewise. + * objc-act.h (TYPE_HAS_OBJC_INFO): Likewise. + (INIT_TYPE_OBJC_INFO): Likewise. + (DUP_TYPE_OBJC_INFO): Likewise. + +2005-04-23 DJ Delorie + + * objc-act.c: Adjust warning() callers. + +2005-04-21 Roger Sayle + + * objc-act.h (METHOD_ADD_ARGS_ELLIPSIS_P): New macro for accessing + this field of an objc method decl. + * objc-act.c (build_method_decl): Take an additional "ellipsis" + argument, and set METHOD_ADD_ARGS_ELLIPSIS_P as appropriate. + (objc_build_method_signature): Accept additional "ellipsis" + argument and pass it to build_method_decl. + (get_arg_type_list, start_method_def, gen_method_decl): Use + the new METHOD_ADD_ARGS_ELLIPSIS_P instead of examining the + TREE_OVERFLOW field of a TREE_LIST node. + +2005-04-20 Joseph S. Myers + + PR c/12913 + * objc-act.c (objc_start_function): Create stack level for context + of identifiers with variably modified type. + +2005-03-30 Joseph S. Myers + + PR c/772 + PR c/17913 + * objc-act.c (objc_start_function): Push context on + label_context_stack. + +2005-03-23 Joseph S. Myers + + * objc-act.c (next_sjlj_build_enter_and_setjmp, + next_sjlj_build_catch_list, next_sjlj_build_try_catch_finally): + Call c_common_truthvalue_conversion. + 2005-02-25 Joseph S. Myers * Make-lang.in (objc/objc-parse.o-warn, objc/objc-parse.o, diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in index 56fad72b149..4c1698abe5f 100644 --- a/gcc/objc/Make-lang.in +++ b/gcc/objc/Make-lang.in @@ -50,9 +50,20 @@ objc-warn = $(STRICT_WARN) # Language-specific object files for Objective C. OBJC_OBJS = objc/objc-lang.o objc/objc-act.o -cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS) +cc1obj-dummy$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o $(BACKEND) $(LIBDEPS) $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ - $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBS) + $(OBJC_OBJS) $(C_AND_OBJC_OBJS) dummy-checksum.o \ + $(BACKEND) $(LIBS) + +cc1obj-checksum.c : cc1obj-dummy$(exeext) build/genchecksum$(exeext) + build/genchecksum$(exeext) cc1obj-dummy$(exeext) > $@ + +cc1obj-checksum.o : cc1obj-checksum.c + +cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ + $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o \ + $(BACKEND) $(LIBS) # Objective C language specific files. @@ -60,13 +71,13 @@ 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 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 objc.srcextra: diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index e6201afbad5..92eaa63b0e0 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -77,6 +77,8 @@ Boston, MA 02111-1307, USA. */ #define OBJC_VOID_AT_END void_list_node +static unsigned int should_call_super_dealloc = 0; + /* 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 +128,7 @@ char *util_firstobj; the module (file) was compiled for, and is recorded in the module descriptor. */ -#define OBJC_VERSION (flag_next_runtime ? 5 : 8) +#define OBJC_VERSION (flag_next_runtime ? 6 : 8) #define PROTOCOL_VERSION 2 /* (Decide if these can ever be validly changed.) */ @@ -142,15 +144,9 @@ static void finish_objc (void); /* Code generation. */ -static void synth_module_prologue (void); static tree objc_build_constructor (tree, tree); -static void build_module_descriptor (void); -static void build_module_initializer_routine (void); -static tree init_module_descriptor (tree); static tree build_objc_method_call (int, tree, tree, tree, tree); -static void generate_strings (void); static tree get_proto_encoding (tree); -static void build_selector_translation_table (void); static tree lookup_interface (tree); static tree objc_add_static_instance (tree, tree); @@ -164,60 +160,38 @@ static void objc_start_function (tree, tree, tree, tree); static void objc_start_function (tree, tree, tree, struct c_arg_info *); #endif static tree start_protocol (enum tree_code, tree, tree); -static tree build_method_decl (enum tree_code, tree, tree, tree); +static tree build_method_decl (enum tree_code, tree, tree, tree, bool); static tree objc_add_method (tree, tree, int); static tree add_instance_variable (tree, int, tree); static tree build_ivar_reference (tree); static tree is_ivar (tree, tree); -static int is_private (tree); -static tree get_super_receiver (void); static void build_objc_exception_stuff (void); static void build_next_objc_exception_stuff (void); -static tree build_ivar_template (void); -static tree build_method_template (void); -static void build_private_template (tree); static void build_class_template (void); static void build_selector_template (void); static void build_category_template (void); -static tree lookup_method_in_hash_lists (tree, int); static void build_super_template (void); -static tree build_category_initializer (tree, tree, tree, tree, tree, tree); static tree build_protocol_initializer (tree, tree, tree, tree, tree); -static void synth_forward_declarations (void); -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); static tree generate_protocol_list (tree); static void build_protocol_reference (tree); -static tree build_keyword_selector (tree); -static const char *synth_id_with_class_suffix (const char *, tree); +#ifdef OBJCPLUS +static void objc_generate_cxx_cdtors (void); +#endif -static void generate_static_references (void); -static int check_methods_accessible (tree, tree, int); -static void encode_aggregate_within (tree, int, int, int, int); -static const char *objc_demangle (const char *); +static const char *synth_id_with_class_suffix (const char *, tree); /* Hash tables to manage the global pool of method prototypes. */ hash *nst_method_hash_list = 0; hash *cls_method_hash_list = 0; -static size_t hash_func (tree); -static void hash_init (void); -static void hash_enter (hash *, tree); static hash hash_lookup (hash *, tree); -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); -static void add_category (tree, tree); -static inline tree lookup_category (tree, tree); enum string_section { @@ -227,26 +201,17 @@ enum string_section }; static tree add_objc_string (tree, enum string_section); -static tree get_objc_string_decl (tree, enum string_section); static tree build_objc_string_decl (enum string_section); -static tree build_selector_reference_decl (void); static void build_selector_table_decl (void); /* Protocol additions. */ -static tree add_protocol (tree); static tree lookup_protocol (tree); -static void check_protocol_recursively (tree, tree); static tree lookup_and_install_protocols (tree); /* Type encoding. */ static void encode_type_qualifiers (tree); -static void encode_pointer (tree, int, int); -static void encode_array (tree, int, int); -static void encode_aggregate (tree, int, int); -static void encode_next_bitfield (int); -static void encode_gnu_bitfield (int, tree, int); static void encode_type (tree, int, int); static void encode_field_decl (tree, int, int); @@ -255,76 +220,28 @@ static void really_start_method (tree, tree); #else 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); -static tree get_arg_type_list (tree, int, int); +static int comp_proto_with_proto (tree, tree, int); static void objc_push_parm (tree); #ifdef OBJCPLUS static tree objc_get_parm_info (int); #else static struct c_arg_info *objc_get_parm_info (int); #endif -static void synth_self_and_ucmd_args (void); /* Utilities for debugging and error diagnostics. */ static void warn_with_method (const char *, int, tree); -static void error_with_ivar (const char *, tree); static char *gen_type_name (tree); static char *gen_type_name_0 (tree); static char *gen_method_decl (tree); static char *gen_declaration (tree); -static void dump_interface (FILE *, tree); /* Everything else. */ -static tree lookup_method_in_protocol_list (tree, tree, int); -static tree lookup_protocol_in_reflist (tree, tree); -static tree start_var_decl (tree, const char *); -static void finish_var_decl (tree, tree); static tree create_field_decl (tree, const char *); -static tree setup_string_decl (void); -static int check_string_class_template (void); -static tree my_build_string (int, const char *); -static void build_objc_symtab_template (void); -static tree init_def_list (tree); -static tree init_objc_symtab (tree); -static tree build_metadata_decl (const char *, tree); -static void forward_declare_categories (void); -static void generate_objc_symtab_decl (void); -static tree build_selector (tree); -static tree build_typed_selector_reference (tree, tree); -static tree build_selector_reference (tree); -static tree build_class_reference_decl (void); static void add_class_reference (tree); static void build_protocol_template (void); -static tree build_descriptor_table_initializer (tree, tree); -static tree build_method_prototype_list_template (tree, int); -static tree build_method_prototype_template (void); -static tree objc_method_parm_type (tree); -static int objc_encoded_type_size (tree); static tree encode_method_prototype (tree); -static tree generate_descriptor_table (tree, const char *, int, tree, tree); -static void generate_method_descriptors (tree); -static void generate_protocol_references (tree); -static void generate_protocols (void); -static void check_ivars (tree, tree); -static tree build_ivar_list_template (tree, int); -static tree build_method_list_template (tree, int); -static tree build_ivar_list_initializer (tree, tree); -static tree generate_ivars_list (tree, const char *, int, tree); -static tree build_dispatch_table_initializer (tree, tree); -static tree generate_dispatch_table (tree, const char *, int, tree); -static tree build_shared_structure_initializer (tree, tree, tree, tree, - tree, int, tree, tree, tree); -static void generate_category (tree); -static tree adjust_type_for_id_default (tree); -static tree check_duplicates (hash, int, int); -static tree receiver_is_class_object (tree, int, int); -static int check_methods (tree, tree, int); -static int conforms_to_protocol (tree, tree); -static void check_protocol (tree, const char *, const char *); -static void check_protocols (tree, const char *, const char *); static void generate_classref_translation_entry (tree); static void handle_class_ref (tree); static void generate_struct_by_value_array (void) @@ -378,6 +295,7 @@ static const char *default_constant_string_class_name; /* Runtime metadata flags. */ #define CLS_FACTORY 0x0001L #define CLS_META 0x0002L +#define CLS_HAS_CXX_STRUCTORS 0x2000L #define OBJC_MODIFIER_STATIC 0x00000001 #define OBJC_MODIFIER_FINAL 0x00000002 @@ -405,11 +323,28 @@ static const char *default_constant_string_class_name; #define TAG_SETJMP "_setjmp" #define UTAG_EXCDATA "_objc_exception_data" +#define TAG_ASSIGNIVAR "objc_assign_ivar" +#define TAG_ASSIGNGLOBAL "objc_assign_global" +#define TAG_ASSIGNSTRONGCAST "objc_assign_strongCast" + +/* 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 TAG_CXX_CONSTRUCT ".cxx_construct" +#define TAG_CXX_DESTRUCT ".cxx_destruct" + /* GNU-specific tags. */ #define TAG_EXECCLASS "__objc_exec_class" #define TAG_GNUINIT "__objc_gnu_init" +/* Flags for lookup_method_static(). */ +#define OBJC_LOOKUP_CLASS 1 /* Look for class methods. */ +#define OBJC_LOOKUP_NO_SUPER 2 /* Do not examine superclasses. */ + /* The OCTI_... enumeration itself is in objc/objc-act.h. */ tree objc_global_trees[OCTI_MAX]; @@ -453,9 +388,6 @@ struct string_descriptor GTY(()) static GTY((param_is (struct string_descriptor))) htab_t string_htab; -static hashval_t string_hash (const void *); -static int string_eq (const void *, const void *); - FILE *gen_declaration_file; /* Tells "encode_pointer/encode_aggregate" whether we are generating @@ -596,8 +528,8 @@ objc_finish_file (void) #endif /* 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 (); if (gen_declaration_file) @@ -746,6 +678,11 @@ objc_continue_implementation (void) void objc_finish_implementation (void) { +#ifdef OBJCPLUS + if (flag_objc_call_cxx_cdtors) + objc_generate_cxx_cdtors (); +#endif + if (objc_implementation_context) { finish_class (objc_implementation_context); @@ -753,7 +690,7 @@ objc_finish_implementation (void) objc_implementation_context = NULL_TREE; } else - warning ("%<@end%> must appear in an @implementation context"); + warning (0, "%<@end%> must appear in an @implementation context"); } void @@ -771,9 +708,11 @@ objc_set_method_type (enum tree_code type) } tree -objc_build_method_signature (tree rettype, tree selector, tree optparms) +objc_build_method_signature (tree rettype, tree selector, + tree optparms, bool ellipsis) { - return build_method_decl (objc_inherit_code, rettype, selector, optparms); + return build_method_decl (objc_inherit_code, rettype, selector, + optparms, ellipsis); } void @@ -922,7 +861,7 @@ objc_comptypes (tree lhs, tree rhs, int reflexive) if (!rproto) warning - ("object does not conform to the %qs protocol", + (0, "object does not conform to the %qs protocol", IDENTIFIER_POINTER (PROTOCOL_NAME (p))); } return 1; @@ -1012,7 +951,7 @@ objc_comptypes (tree lhs, tree rhs, int reflexive) } if (!rproto) - warning ("class %qs does not implement the %qs protocol", + warning (0, "class %qs does not implement the %qs protocol", IDENTIFIER_POINTER (OBJC_TYPE_NAME (TREE_TYPE (rhs))), IDENTIFIER_POINTER (PROTOCOL_NAME (p))); } @@ -1089,7 +1028,7 @@ objc_comptypes (tree lhs, tree rhs, int reflexive) } if (!lproto) - warning ("class %qs does not implement the %qs protocol", + warning (0, "class %qs does not implement the %qs protocol", IDENTIFIER_POINTER (OBJC_TYPE_NAME (TREE_TYPE (lhs))), IDENTIFIER_POINTER (PROTOCOL_NAME (p))); @@ -1439,6 +1378,17 @@ synth_module_prologue (void) objc_super_type = build_pointer_type (xref_tag (RECORD_TYPE, get_identifier (TAG_SUPER))); + /* 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))); + if (flag_next_runtime) { /* NB: In order to call one of the ..._stret (struct-returning) @@ -1468,6 +1418,21 @@ synth_module_prologue (void) type, 0, NOT_BUILT_IN, NULL, NULL_TREE); + /* id objc_msgSend_Fast (id, SEL, ...) + __attribute__ ((hard_coded_address (OFFS_MSGSEND_FAST))); */ +#ifdef OFFS_MSGSEND_FAST + 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 + /* No direct dispatch availible. */ + umsg_fast_decl = umsg_decl; +#endif + /* id objc_msgSendSuper (struct objc_super *, SEL, ...); */ /* id objc_msgSendSuper_stret (struct objc_super *, SEL, ...); */ type @@ -2371,7 +2336,7 @@ build_selector_translation_table (void) loc = &DECL_SOURCE_LOCATION (TREE_PURPOSE (chain)); else loc = &input_location; - warning ("%Hcreating selector for nonexistent method %qE", + warning (0, "%Hcreating selector for nonexistent method %qE", loc, TREE_VALUE (chain)); } } @@ -2548,17 +2513,24 @@ tree objc_get_class_reference (tree ident) { tree orig_ident; + 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); + { + /* The type must exist in the global namespace. */ + if (DECL_CONTEXT (ident) && DECL_CONTEXT (ident) != global_namespace) + local_scope = true; + + ident = DECL_NAME (ident); + } #endif orig_ident = ident; - if (!(ident = objc_is_class_name (ident))) + if (local_scope || !(ident = objc_is_class_name (ident))) { error ("%qs is not an Objective-C class name or alias", IDENTIFIER_POINTER (orig_ident)); @@ -2680,9 +2652,9 @@ objc_declare_alias (tree alias_ident, tree class_ident) #endif /* OBJCPLUS */ if (!(underlying_class = objc_is_class_name (class_ident))) - warning ("cannot find class %qs", IDENTIFIER_POINTER (class_ident)); + warning (0, "cannot find class %qs", IDENTIFIER_POINTER (class_ident)); else if (objc_is_class_name (alias_ident)) - warning ("class %qs already exists", IDENTIFIER_POINTER (alias_ident)); + warning (0, "class %qs already exists", IDENTIFIER_POINTER (alias_ident)); else alias_chain = tree_cons (underlying_class, alias_ident, alias_chain); } @@ -2806,21 +2778,321 @@ objc_is_object_ptr (tree type) return ret; } +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 -lookup_interface (tree ident) +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 chain; + 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 (0, "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 (0, "strong-cast may possibly be needed"); + } + + goto exit_point; + } + + if (modifycode != NOP_EXPR) + goto invalid_pointer_arithmetic; + + if (warn_assign_intercept) + warning (0, "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 (0, "pointer arithmetic for garbage-collected objects not allowed"); + + goto exit_point; + } + + if (warn_assign_intercept) + warning (0, "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; +} + +struct interface_tuple GTY(()) +{ + tree id; + tree class_name; +}; + +static GTY ((param_is (struct interface_tuple))) htab_t interface_htab; + +static hashval_t +hash_interface (const void *p) +{ + const struct interface_tuple *d = p; + return htab_hash_pointer (d->id); +} + +static int +eq_interface (const void *p1, const void *p2) +{ + const struct interface_tuple *d = p1; + return d->id == p2; +} + +static tree +lookup_interface (tree ident) +{ #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; + + if (ident == NULL_TREE || TREE_CODE (ident) != IDENTIFIER_NODE) + return NULL_TREE; + + { + struct interface_tuple **slot; + tree i = NULL_TREE; + + if (interface_htab) + { + slot = (struct interface_tuple **) + htab_find_slot_with_hash (interface_htab, ident, + htab_hash_pointer (ident), + NO_INSERT); + if (slot && *slot) + i = (*slot)->class_name; + } + return i; + } } /* Implement @defs () within struct bodies. */ @@ -2943,7 +3215,7 @@ objc_init_exceptions (void) /* On Darwin, ObjC exceptions require a sufficiently recent version of the runtime, so the user must ask for them explicitly. */ if (!flag_objc_exceptions) - warning ("use %<-fobjc-exceptions%> to enable Objective-C " + warning (0, "use %<-fobjc-exceptions%> to enable Objective-C " "exception syntax"); } #ifndef OBJCPLUS @@ -3014,12 +3286,20 @@ 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); +#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 + t = convert (ptr_type_node, t); +#else t = convert (ptr_type_node, t); +#endif t = tree_cons (NULL, t, NULL); sj = build_function_call (objc_setjmp_decl, t); cond = build (COMPOUND_EXPR, TREE_TYPE (sj), enter, sj); - cond = lang_hooks.truthvalue_conversion (cond); + cond = c_common_truthvalue_conversion (cond); return build (COND_EXPR, void_type_node, cond, NULL, NULL); } @@ -3086,7 +3366,7 @@ next_sjlj_build_catch_list (void) t = objc_get_class_reference (OBJC_TYPE_NAME (TREE_TYPE (type))); args = tree_cons (NULL, t, args); t = build_function_call (objc_exception_match_decl, args); - cond = lang_hooks.truthvalue_conversion (t); + cond = c_common_truthvalue_conversion (t); } t = build (COND_EXPR, void_type_node, cond, body, NULL); SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt)); @@ -3208,7 +3488,7 @@ next_sjlj_build_try_catch_finally (void) /* Build the complete FINALLY statement list. */ t = next_sjlj_build_try_exit (); t = build_stmt (COND_EXPR, - lang_hooks.truthvalue_conversion (rethrow_decl), + c_common_truthvalue_conversion (rethrow_decl), NULL, t); SET_EXPR_LOCATION (t, cur_try_context->finally_locus); append_to_statement_list (t, &TREE_OPERAND (try_fin, 1)); @@ -3219,7 +3499,7 @@ next_sjlj_build_try_catch_finally (void) t = tree_cons (NULL, rethrow_decl, NULL); t = build_function_call (objc_exception_throw_decl, t); t = build_stmt (COND_EXPR, - lang_hooks.truthvalue_conversion (rethrow_decl), + c_common_truthvalue_conversion (rethrow_decl), t, NULL); SET_EXPR_LOCATION (t, cur_try_context->end_finally_locus); append_to_statement_list (t, &TREE_OPERAND (try_fin, 1)); @@ -3241,6 +3521,9 @@ objc_begin_try_stmt (location_t try_locus, tree body) cur_try_context = c; objc_init_exceptions (); + + if (flag_objc_sjlj_exceptions) + objc_mark_locals_volatile (NULL); } /* Called just after parsing "@catch (parm)". Open a binding level, @@ -3288,9 +3571,9 @@ objc_begin_catch_clause (tree decl) continue; if (!t || objc_comptypes (TREE_TYPE (t), TREE_TYPE (type), 0) == 1) { - warning ("exception of type %<%T%> will be caught", + warning (0, "exception of type %<%T%> will be caught", TREE_TYPE (type)); - warning ("%H by earlier handler for %<%T%>", + warning (0, "%H by earlier handler for %<%T%>", EXPR_LOCUS (stmt), TREE_TYPE (t ? t : objc_object_type)); break; } @@ -3336,7 +3619,7 @@ objc_build_finally_clause (location_t finally_locus, tree body) /* Called to finalize a @try construct. */ -void +tree objc_finish_try_stmt (void) { struct objc_try_context *c = cur_try_context; @@ -3374,6 +3657,7 @@ objc_finish_try_stmt (void) cur_try_context = c->outer; free (c); + return stmt; } tree @@ -3405,7 +3689,7 @@ objc_build_throw_stmt (tree throw_expr) return add_stmt (build_function_call (objc_exception_throw_decl, args)); } -void +tree objc_build_synchronized (location_t start_locus, tree mutex, tree body) { tree args, call; @@ -3425,7 +3709,7 @@ 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 (); + return objc_finish_try_stmt (); } @@ -3507,6 +3791,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); + + /* 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 OFFS_ASSIGNIVAR_FAST + 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 + /* Default to slower ivar method. */ + 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); } static void @@ -3554,6 +3876,11 @@ build_private_template (tree class) INIT_TYPE_OBJC_INFO (record); TYPE_OBJC_INTERFACE (record) = class; CLASS_STATIC_TEMPLATE (class) = record; + + /* 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; } } @@ -3593,19 +3920,13 @@ 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))), + /* struct _objc__method_prototype_list *instance_methods; */ + field_decl = create_field_decl (objc_method_proto_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_PROTOTYPE_LIST))), + /* struct _objc__method_prototype_list *class_methods; */ + field_decl = create_field_decl (objc_method_proto_list_ptr, "class_methods"); chainon (field_decl_chain, field_decl); @@ -3706,7 +4027,7 @@ 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); + return type; } static int @@ -3884,6 +4205,136 @@ generate_protocol_references (tree plist) } } +/* 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), + false)); + 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 + /* 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 +4468,8 @@ 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); + expr = convert (objc_method_proto_list_ptr, + build_unary_op (ADDR_EXPR, instance_methods, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -4025,7 +4477,8 @@ 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); + expr = convert (objc_method_proto_list_ptr, + build_unary_op (ADDR_EXPR, class_methods, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -4057,18 +4510,12 @@ 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))), + 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))), + field_decl = create_field_decl (objc_method_list_ptr, "class_methods"); chainon (field_decl_chain, field_decl); @@ -4170,18 +4617,12 @@ 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))), + 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))), + field_decl = create_field_decl (objc_method_list_ptr, "methods"); chainon (field_decl_chain, field_decl); @@ -4432,10 +4873,7 @@ 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))), + field_decl = create_field_decl (objc_method_proto_list_ptr, "method_next"); field_decl_chain = field_decl; @@ -4834,14 +5272,16 @@ 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); + expr = convert (objc_method_list_ptr, + build_unary_op (ADDR_EXPR, instance_methods, 0)); 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); + expr = convert (objc_method_list_ptr, + build_unary_op (ADDR_EXPR, class_methods, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -4917,7 +5357,8 @@ 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); + expr = convert (objc_ivar_list_ptr, + build_unary_op (ADDR_EXPR, ivar_list, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -4926,7 +5367,8 @@ 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); + expr = convert (objc_method_list_ptr, + build_unary_op (ADDR_EXPR, dispatch_table, 0)); initlist = tree_cons (NULL_TREE, expr, initlist); } @@ -5021,7 +5463,7 @@ generate_category (tree cat) static struct objc_class _OBJC_CLASS_Foo={ ... }; */ static void -generate_shared_structures (void) +generate_shared_structures (int cls_flags) { tree sc_spec, decl_specs, decl; tree name_expr, super_expr, root_expr; @@ -5112,7 +5554,7 @@ generate_shared_structures (void) convert (integer_type_node, TYPE_SIZE_UNIT (CLASS_STATIC_TEMPLATE (implementation_template))), - 1 /*CLS_FACTORY*/, + 1 /*CLS_FACTORY*/ | cls_flags, UOBJC_INSTANCE_METHODS_decl, UOBJC_INSTANCE_VARIABLES_decl, protocol_decl); @@ -5263,7 +5705,7 @@ build_keyword_selector (tree selector) static tree build_method_decl (enum tree_code code, tree ret_type, tree selector, - tree add_args) + tree add_args, bool ellipsis) { tree method_decl; @@ -5280,6 +5722,7 @@ build_method_decl (enum tree_code code, tree ret_type, tree selector, METHOD_SEL_NAME (method_decl) = build_keyword_selector (selector); METHOD_SEL_ARGS (method_decl) = selector; METHOD_ADD_ARGS (method_decl) = add_args; + METHOD_ADD_ARGS_ELLIPSIS_P (method_decl) = ellipsis; } else { @@ -5347,7 +5790,7 @@ get_arg_type_list (tree meth, int context, int superflag) chainon (arglist, build_tree_list (NULL_TREE, arg_type)); } - if (!TREE_OVERFLOW (METHOD_ADD_ARGS (meth))) + if (!METHOD_ADD_ARGS_ELLIPSIS_P (meth)) goto lack_of_ellipsis; } else @@ -5374,7 +5817,21 @@ check_duplicates (hash hsh, int methods, int is_class) different types. */ attr loop; - warning ("multiple %s named %<%c%s%> found", + /* 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: + warning (0, "multiple %s named %<%c%s%> found", methods ? "methods" : "selectors", (is_class ? '+' : '-'), IDENTIFIER_POINTER (METHOD_SEL_NAME (meth))); @@ -5584,6 +6041,10 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) || (TREE_CODE (receiver) == COMPOUND_EXPR && !IS_SUPER (rtype))); + /* If we are calling [super dealloc], reset our warning flag. */ + if (super && !strcmp ("dealloc", IDENTIFIER_POINTER (sel_name))) + should_call_super_dealloc = 0; + /* If the receiver is a class object, retrieve the corresponding @interface, if one exists. */ class_tree = receiver_is_class_object (receiver, self, super); @@ -5612,18 +6073,13 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) /* If receiver is of type `id' or `Class' (or if the @interface for a class is not visible), we shall be satisfied with the existence of any instance or class method. */ - if (!rtype || objc_is_id (rtype)) + if (objc_is_id (rtype)) { - if (!rtype) - rtype = xref_tag (RECORD_TYPE, class_tree); - else - { - class_tree = (IS_CLASS (rtype) ? objc_class_name : NULL_TREE); - rprotos = (TYPE_HAS_OBJC_INFO (TREE_TYPE (rtype)) - ? TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (rtype)) - : NULL_TREE); - rtype = NULL_TREE; - } + class_tree = (IS_CLASS (rtype) ? objc_class_name : NULL_TREE); + rprotos = (TYPE_HAS_OBJC_INFO (TREE_TYPE (rtype)) + ? TYPE_OBJC_PROTOCOL_LIST (TREE_TYPE (rtype)) + : NULL_TREE); + rtype = NULL_TREE; if (rprotos) { @@ -5642,13 +6098,13 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) = lookup_method_in_protocol_list (rprotos, sel_name, 0); if (method_prototype) - warning ("found %<-%s%> instead of %<+%s%> in protocol(s)", + warning (0, "found %<-%s%> instead of %<+%s%> in protocol(s)", IDENTIFIER_POINTER (sel_name), IDENTIFIER_POINTER (sel_name)); } } } - else + else if (rtype) { tree orig_rtype = rtype, saved_rtype; @@ -5670,7 +6126,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) more intelligent about which methods the receiver will understand. */ if (!rtype || TREE_CODE (rtype) == IDENTIFIER_NODE) - rtype = saved_rtype; + rtype = NULL_TREE; else if (TREE_CODE (rtype) == CLASS_INTERFACE_TYPE || TREE_CODE (rtype) == CLASS_IMPLEMENTATION_TYPE) { @@ -5701,7 +6157,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) } else { - warning ("invalid receiver type %qs", + warning (0, "invalid receiver type %qs", gen_type_name (orig_rtype)); /* After issuing the "invalid receiver" warning, perform method lookup as if we were messaging 'id'. */ @@ -5716,7 +6172,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) if (!method_prototype) { if (rprotos) - warning ("%<%c%s%> not found in protocol(s)", + warning (0, "%<%c%s%> not found in protocol(s)", (class_tree ? '+' : '-'), IDENTIFIER_POINTER (sel_name)); @@ -5730,7 +6186,7 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) static bool warn_missing_methods = false; if (rtype) - warning ("%qs may not respond to %<%c%s%>", + warning (0, "%qs may not respond to %<%c%s%>", IDENTIFIER_POINTER (OBJC_TYPE_NAME (rtype)), (class_tree ? '+' : '-'), IDENTIFIER_POINTER (sel_name)); @@ -5738,15 +6194,15 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params) then we have failed to find _any_ instance or class method, respectively. */ else - warning ("no %<%c%s%> method found", + warning (0, "no %<%c%s%> method found", (class_tree ? '+' : '-'), IDENTIFIER_POINTER (sel_name)); if (!warn_missing_methods) { - warning ("(Messages without a matching method signature"); - warning ("will be assumed to return % and accept"); - warning ("%<...%> as arguments.)"); + warning (0, "(Messages without a matching method signature"); + warning (0, "will be assumed to return % and accept"); + warning (0, "%<...%> as arguments.)"); warn_missing_methods = true; } } @@ -5785,7 +6241,9 @@ 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 + ? (flag_objc_direct_dispatch + ? umsg_fast_decl + : umsg_decl) : umsg_nonnil_decl)); tree rcv_p = (super_flag ? objc_super_type : objc_object_type); @@ -5977,7 +6435,7 @@ objc_build_selector_expr (tree selnamelist) /* If still not found, print out a warning. */ if (!hsh) { - warning ("undeclared selector %qs", IDENTIFIER_POINTER (selname)); + warning (0, "undeclared selector %qs", IDENTIFIER_POINTER (selname)); } } @@ -6019,7 +6477,7 @@ build_ivar_reference (tree id) to an instance variable. It's better to catch the cases where this is done unknowingly than to support the above paradigm. */ - warning ("instance variable %qs accessed in class method", + warning (0, "instance variable %qs accessed in class method", IDENTIFIER_POINTER (id)); self_decl = convert (objc_instance_type, self_decl); /* cast */ } @@ -6122,11 +6580,23 @@ lookup_method (tree mchain, tree method) return NULL_TREE; } +/* 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) { tree meth = NULL_TREE, root_inter = NULL_TREE; tree inter = interface; + int is_class = (flags & OBJC_LOOKUP_CLASS); + int no_superclasses = (flags & OBJC_LOOKUP_NO_SUPER); while (inter) { @@ -6163,6 +6633,10 @@ lookup_method_static (tree interface, tree ident, int is_class) return meth; } + /* If we were instructed not to look in superclasses, don't. */ + if (no_superclasses) + return NULL_TREE; + /* Failing that, climb up the inheritance hierarchy. */ root_inter = inter; inter = lookup_interface (CLASS_SUPER_NAME (inter)); @@ -6192,9 +6666,9 @@ 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); + 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); + already_there |= comp_proto_with_proto (method, loop->value, 1); if (!already_there) hash_add_attr (hsh, method); } @@ -6230,7 +6704,7 @@ 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)) + && !comp_proto_with_proto (method, mth, 1)) error ("duplicate declaration of method %<%c%s%>", is_class ? '+' : '-', IDENTIFIER_POINTER (METHOD_SEL_NAME (mth))); @@ -6260,11 +6734,27 @@ objc_add_method (tree class, tree method, int is_class) } static tree -add_class (tree class) +add_class (tree class_name, tree name) { + struct interface_tuple **slot; + /* Put interfaces on list in reverse order. */ - TREE_CHAIN (class) = interface_chain; - interface_chain = class; + TREE_CHAIN (class_name) = interface_chain; + interface_chain = class_name; + + if (interface_htab == NULL) + interface_htab = htab_create_ggc (31, hash_interface, eq_interface, NULL); + slot = (struct interface_tuple **) + htab_find_slot_with_hash (interface_htab, name, + htab_hash_pointer (name), + INSERT); + if (!*slot) + { + *slot = (struct interface_tuple *) ggc_alloc_cleared (sizeof (struct interface_tuple)); + (*slot)->id = name; + } + (*slot)->class_name = class_name; + return interface_chain; } @@ -6276,7 +6766,7 @@ add_category (tree class, tree category) if (cat) { - warning ("duplicate interface declaration for category %<%s(%s)%>", + warning (0, "duplicate interface declaration for category %<%s(%s)%>", IDENTIFIER_POINTER (CLASS_NAME (class)), IDENTIFIER_POINTER (CLASS_SUPER_NAME (category))); } @@ -6320,27 +6810,65 @@ 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))) + /* 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 (0, "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 (0, "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 (0, "type `%s' has a user-defined constructor", type_name); + if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type)) + warning (0, "type `%s' has a user-defined destructor", type_name); + + if (!warn_cxx_ivars) + { + warning (0, "C++ constructors and destructors will not " + "be invoked for Objective-C fields"); + warn_cxx_ivars = true; + } + } } #endif @@ -6397,21 +6925,22 @@ int objc_is_public (tree expr, tree identifier) { tree basetype = TREE_TYPE (expr); - enum tree_code code = TREE_CODE (basetype); 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))) { if (TREE_PUBLIC (decl)) return 1; @@ -6439,7 +6968,7 @@ objc_is_public (tree expr, tree identifier) non-@public ivars. We will let this slide for now... */ if (!objc_method_context) { - warning ("instance variable %qs is %s; " + warning (0, "instance variable %qs is %s; " "this will be a hard error in the future", IDENTIFIER_POINTER (identifier), TREE_PRIVATE (decl) ? "@private" : "@protected"); @@ -6452,12 +6981,6 @@ 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 %"); - } } return 1; @@ -6478,16 +7001,16 @@ check_methods (tree chain, tree list, int mtype) { if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE) - warning ("incomplete implementation of class %qs", + warning (0, "incomplete implementation of class %qs", IDENTIFIER_POINTER (CLASS_NAME (objc_implementation_context))); else if (TREE_CODE (objc_implementation_context) == CATEGORY_IMPLEMENTATION_TYPE) - warning ("incomplete implementation of category %qs", + warning (0, "incomplete implementation of category %qs", IDENTIFIER_POINTER (CLASS_SUPER_NAME (objc_implementation_context))); first = 0; } - warning ("method definition for %<%c%s%> not found", + warning (0, "method definition for %<%c%s%> not found", mtype, IDENTIFIER_POINTER (METHOD_SEL_NAME (chain))); } @@ -6566,17 +7089,17 @@ check_methods_accessible (tree chain, tree context, int mtype) { if (TREE_CODE (objc_implementation_context) == CLASS_IMPLEMENTATION_TYPE) - warning ("incomplete implementation of class %qs", + warning (0, "incomplete implementation of class %qs", IDENTIFIER_POINTER (CLASS_NAME (objc_implementation_context))); else if (TREE_CODE (objc_implementation_context) == CATEGORY_IMPLEMENTATION_TYPE) - warning ("incomplete implementation of category %qs", + warning (0, "incomplete implementation of category %qs", IDENTIFIER_POINTER (CLASS_SUPER_NAME (objc_implementation_context))); first = 0; } - warning ("method definition for %<%c%s%> not found", + warning (0, "method definition for %<%c%s%> not found", mtype, IDENTIFIER_POINTER (METHOD_SEL_NAME (chain))); } @@ -6617,7 +7140,7 @@ check_protocol (tree p, const char *type, const char *name) } if (!f1 || !f2) - warning ("%s %qs does not fully implement the %qs protocol", + warning (0, "%s %qs does not fully implement the %qs protocol", type, name, IDENTIFIER_POINTER (PROTOCOL_NAME (p))); } @@ -6675,7 +7198,7 @@ start_class (enum tree_code code, tree class_name, tree super_name, if (objc_implementation_context) { - warning ("%<@end%> missing in implementation context"); + warning (0, "%<@end%> missing in implementation context"); finish_class (objc_implementation_context); objc_ivar_chain = NULL_TREE; objc_implementation_context = NULL_TREE; @@ -6684,14 +7207,23 @@ start_class (enum tree_code code, tree class_name, tree super_name, class = make_node (code); TYPE_LANG_SLOT_1 (class) = make_tree_vec (CLASS_LANG_SLOT_ELTS); - /* Check for existence of the super class, if one was specified. */ + /* Check for existence of the super class, if one was specified. Note + that we must have seen an @interface, not just a @class. If we + are looking at a @compatibility_alias, traverse it first. */ if ((code == CLASS_INTERFACE_TYPE || code == CLASS_IMPLEMENTATION_TYPE) - && super_name && !objc_is_class_name (super_name)) + && super_name) { - error ("cannot find interface declaration for %qs, superclass of %qs", - IDENTIFIER_POINTER (super_name), - IDENTIFIER_POINTER (class_name)); - super_name = NULL_TREE; + tree super = objc_is_class_name (super_name); + + if (!super || !lookup_interface (super)) + { + error ("cannot find interface declaration for %qs, superclass of %qs", + IDENTIFIER_POINTER (super ? super : super_name), + IDENTIFIER_POINTER (class_name)); + super_name = NULL_TREE; + } + else + super_name = super; } CLASS_NAME (class) = class_name; @@ -6732,9 +7264,10 @@ start_class (enum tree_code code, tree class_name, tree super_name, if (!(implementation_template = lookup_interface (class_name))) { - warning ("cannot find interface declaration for %qs", + warning (0, "cannot find interface declaration for %qs", IDENTIFIER_POINTER (class_name)); - add_class (implementation_template = objc_implementation_context); + add_class (implementation_template = objc_implementation_context, + class_name); } /* If a super class has been specified in the implementation, @@ -6764,11 +7297,11 @@ start_class (enum tree_code code, tree class_name, tree super_name, #ifdef OBJCPLUS error ("duplicate interface declaration for class %qs", #else - warning ("duplicate interface declaration for class %qs", + warning (0, "duplicate interface declaration for class %qs", #endif IDENTIFIER_POINTER (class_name)); else - add_class (class); + add_class (class, class_name); if (protocol_list) CLASS_PROTOCOL_LIST (class) @@ -6825,7 +7358,6 @@ continue_class (tree class) || TREE_CODE (class) == CATEGORY_IMPLEMENTATION_TYPE) { struct imp_entry *imp_entry; - tree ivar_context; /* Check consistency of the instance variables. */ @@ -6840,7 +7372,6 @@ continue_class (tree class) build_private_template (implementation_template); uprivate_record = CLASS_STATIC_TEMPLATE (implementation_template); - ivar_context = TYPE_FIELDS (uprivate_record); objc_instance_type = build_pointer_type (uprivate_record); imp_entry = (struct imp_entry *) ggc_alloc (sizeof (struct imp_entry)); @@ -6852,6 +7383,7 @@ continue_class (tree class) synth_forward_declarations (); imp_entry->class_decl = UOBJC_CLASS_decl; imp_entry->meta_decl = UOBJC_METACLASS_decl; + imp_entry->has_cxx_cdtors = 0; /* Append to front and increment count. */ imp_list = imp_entry; @@ -6864,7 +7396,7 @@ continue_class (tree class) pop_lang_context (); #endif /* OBJCPLUS */ - return ivar_context; + return get_class_ivars (implementation_template); } else if (TREE_CODE (class) == CLASS_INTERFACE_TYPE) @@ -7019,7 +7551,7 @@ start_protocol (enum tree_code code, tree name, tree list) } else { - warning ("duplicate declaration for protocol %qs", + warning (0, "duplicate declaration for protocol %qs", IDENTIFIER_POINTER (name)); } return protocol; @@ -7156,12 +7688,13 @@ 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) == '^'); + 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))); /* Traverse struct aliases; it is important to get the original struct and its tag name (if any). */ @@ -7508,6 +8041,15 @@ start_method_def (tree method) #endif int have_ellipsis = 0; + /* 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; + /* Required to implement _msgSuper. */ objc_method_context = method; UOBJC_SUPER_decl = NULL_TREE; @@ -7536,7 +8078,7 @@ start_method_def (tree method) objc_push_parm (TREE_VALUE (akey)); } - if (TREE_OVERFLOW (METHOD_ADD_ARGS (method))) + if (METHOD_ADD_ARGS_ELLIPSIS_P (method)) have_ellipsis = 1; } @@ -7549,7 +8091,7 @@ static void warn_with_method (const char *message, int mtype, tree method) { /* Add a readable method name to the warning. */ - warning ("%J%s %<%c%s%>", method, + warning (0, "%J%s %<%c%s%>", method, message, mtype, gen_method_decl (method)); } @@ -7586,11 +8128,23 @@ objc_types_are_equivalent (tree type1, tree type2) return 0; } +/* 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) { tree type1, type2; @@ -7603,7 +8157,8 @@ 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)) + if (!objc_types_are_equivalent (type1, type2) + && (strict || !objc_types_share_size_and_alignment (type1, type2))) return 0; /* Compare argument types. */ @@ -7612,7 +8167,10 @@ 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))) + if (!objc_types_are_equivalent (TREE_VALUE (type1), TREE_VALUE (type2)) + && (strict + || !objc_types_share_size_and_alignment (TREE_VALUE (type1), + TREE_VALUE (type2)))) return 0; } @@ -7666,6 +8224,22 @@ objc_start_function (tree name, tree type, tree attrs, cplus_decl_attributes (&fndecl, attrs, 0); start_preparsed_function (fndecl, attrs, /*flags=*/SF_DEFAULT); #else + struct c_label_context_se *nstack_se; + struct c_label_context_vm *nstack_vm; + nstack_se = XOBNEW (&parser_obstack, struct c_label_context_se); + nstack_se->labels_def = NULL; + nstack_se->labels_used = NULL; + nstack_se->next = label_context_stack_se; + label_context_stack_se = nstack_se; + nstack_vm = XOBNEW (&parser_obstack, struct c_label_context_vm); + nstack_vm->labels_def = NULL; + nstack_vm->labels_used = NULL; + nstack_vm->scope = 0; + nstack_vm->next = label_context_stack_vm; + label_context_stack_vm = nstack_vm; + current_function_returns_value = 0; /* Assume, until we see it does. */ + current_function_returns_null = 0; + decl_attributes (&fndecl, attrs, 0); announce_function (fndecl); DECL_INITIAL (fndecl) = error_mark_node; @@ -7756,11 +8330,12 @@ really_start_method (tree method, tree proto = lookup_method_static (implementation_template, METHOD_SEL_NAME (method), - TREE_CODE (method) == CLASS_METHOD_DECL); + ((TREE_CODE (method) == CLASS_METHOD_DECL) + | OBJC_LOOKUP_NO_SUPER)); if (proto) { - if (!comp_proto_with_proto (method, proto)) + if (!comp_proto_with_proto (method, proto, 1)) { char type = (TREE_CODE (method) == INSTANCE_METHOD_DECL ? '-' : '+'); @@ -7932,6 +8507,9 @@ 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; + + if (should_call_super_dealloc) + warning (0, "method possibly missing a [super dealloc] call"); } #if 0 @@ -8103,7 +8681,7 @@ gen_method_decl (tree method) chain = TREE_CHAIN (chain); } - if (TREE_OVERFLOW (METHOD_ADD_ARGS (method))) + if (METHOD_ADD_ARGS_ELLIPSIS_P (method)) strcat (errbuf, ", ..."); } } @@ -8269,7 +8847,7 @@ finish_objc (void) /* A missing @end may not be detected by the parser. */ if (objc_implementation_context) { - warning ("%<@end%> missing in implementation context"); + warning (0, "%<@end%> missing in implementation context"); finish_class (objc_implementation_context); objc_ivar_chain = NULL_TREE; objc_implementation_context = NULL_TREE; @@ -8306,7 +8884,9 @@ finish_objc (void) /* all of the following reference the string pool... */ generate_ivar_lists (); generate_dispatch_tables (); - generate_shared_structures (); + generate_shared_structures (impent->has_cxx_cdtors + ? CLS_HAS_CXX_STRUCTORS + : 0); } else { @@ -8323,7 +8903,7 @@ finish_objc (void) if (protocol_chain) generate_protocols (); - if (flag_replace_objc_classes && imp_list) + 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 +9085,9 @@ static void generate_objc_image_info (void) { tree decl, initlist; + int flags + = ((flag_replace_objc_classes && imp_list ? 1 : 0) + | (flag_objc_gc ? 2 : 0)); decl = start_var_decl (build_array_type (integer_type_node, @@ -8512,7 +9095,7 @@ 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); + 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,9 +9132,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 +#ifdef OBJCPLUS + && CP_DECL_CONTEXT (other) != global_namespace) +#else + && !DECL_FILE_SCOPE_P (other)) +#endif { - warning ("local declaration of %qs hides instance variable", + warning (0, "local declaration of %qs hides instance variable", IDENTIFIER_POINTER (id)); return other; @@ -8563,4 +9151,76 @@ objc_lookup_ivar (tree other, tree id) return build_ivar_reference (id); } +/* Possibly rewrite a function CALL into an OBJ_TYPE_REF expression. This + needs to be done if we are calling a function through a cast. */ + +tree +objc_rewrite_function_call (tree function, tree params) +{ + if (TREE_CODE (function) == NOP_EXPR + && TREE_CODE (TREE_OPERAND (function, 0)) == ADDR_EXPR + && TREE_CODE (TREE_OPERAND (TREE_OPERAND (function, 0), 0)) + == FUNCTION_DECL) + { + function = build (OBJ_TYPE_REF, TREE_TYPE (function), + TREE_OPERAND (function, 0), + TREE_VALUE (params), size_zero_node); + } + + return function; +} + +/* 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 +} + +/* 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; +} + #include "gt-objc-objc-act.h" diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h index 9925d96ce6c..47ee83ed5e3 100644 --- a/gcc/objc/objc-act.h +++ b/gcc/objc/objc-act.h @@ -22,13 +22,18 @@ Boston, MA 02111-1307, USA. */ #ifndef GCC_OBJC_ACT_H #define GCC_OBJC_ACT_H +/* For enum gimplify_status */ +#include "tree-gimple.h" + /*** Language hooks ***/ bool objc_init (void); const char *objc_printable_name (tree, int); +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); +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. */ @@ -47,6 +52,7 @@ int objc_types_compatible_p (tree, tree); #define METHOD_SEL_NAME(DECL) ((DECL)->decl.name) #define METHOD_SEL_ARGS(DECL) ((DECL)->decl.arguments) #define METHOD_ADD_ARGS(DECL) ((DECL)->decl.result) +#define METHOD_ADD_ARGS_ELLIPSIS_P(DECL) ((DECL)->decl.lang_flag_0) #define METHOD_DEFINITION(DECL) ((DECL)->decl.initial) #define METHOD_ENCODING(DECL) ((DECL)->decl.context) @@ -71,43 +77,45 @@ 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. */ + +/* 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) - #define TYPED_OBJECT(TYPE) \ (TREE_CODE (TYPE) == RECORD_TYPE \ && TYPE_HAS_OBJC_INFO (TYPE) \ @@ -164,6 +172,7 @@ struct imp_entry GTY(()) tree imp_template; tree class_decl; /* _OBJC_CLASS_; */ tree meta_decl; /* _OBJC_METACLASS_; */ + BOOL_BITFIELD has_cxx_cdtors : 1; }; extern GTY(()) struct imp_entry *imp_list; @@ -185,6 +194,7 @@ enum objc_tree_index OCTI_SELF_DECL, OCTI_UMSG_DECL, + OCTI_UMSG_FAST_DECL, OCTI_UMSG_SUPER_DECL, OCTI_UMSG_STRET_DECL, OCTI_UMSG_SUPER_STRET_DECL, @@ -235,6 +245,9 @@ enum objc_tree_index OCTI_UUCLS_SUPER_REF, OCTI_METH_TEMPL, OCTI_IVAR_TEMPL, + OCTI_METH_LIST_TEMPL, + OCTI_METH_PROTO_LIST_TEMPL, + OCTI_IVAR_LIST_TEMPL, OCTI_SYMTAB_TEMPL, OCTI_MODULE_TEMPL, OCTI_SUPER_TEMPL, @@ -272,6 +285,11 @@ enum objc_tree_index OCTI_CATCH_TYPE, OCTI_EXECCLASS_DECL, + OCTI_ASSIGN_IVAR_DECL, + OCTI_ASSIGN_IVAR_FAST_DECL, + OCTI_ASSIGN_GLOBAL_DECL, + OCTI_ASSIGN_STRONGCAST_DECL, + OCTI_MAX }; @@ -291,6 +309,7 @@ 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] +#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 +421,19 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX]; #define execclass_decl objc_global_trees[OCTI_EXECCLASS_DECL] +#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] + #define objc_method_template objc_global_trees[OCTI_METH_TEMPL] #define objc_ivar_template objc_global_trees[OCTI_IVAR_TEMPL] +#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] #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..0d64dbd2487 100644 --- a/gcc/objc/objc-lang.c +++ b/gcc/objc/objc-lang.c @@ -47,6 +47,10 @@ 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 +#undef LANG_HOOKS_GIMPLIFY_EXPR +#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr +#undef LANG_HOOKS_GET_CALLEE_FNDECL +#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl /* Each front end provides its own lang hook initializer. */ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; diff --git a/gcc/objcp/ChangeLog b/gcc/objcp/ChangeLog new file mode 100644 index 00000000000..dea594dbd4b --- /dev/null +++ b/gcc/objcp/ChangeLog @@ -0,0 +1,25 @@ +2005-05-18 Geoffrey Keating + + * Make-lang.in (cc1objplus-dummy): New. + (cc1objplus-checksum.c): New. + (cc1objplus-checksum.o): New. + (cc1objplus): Add cc1objplus-checksum.o. + +2005-05-17 Mike Stump + + Yet more Objective-C++... + + * Make-lang.in (objcp/objcp-lang.o): Add tree-gimple.h + (objcp/objcp-decl.o): Likewise. + (objcp/objcp-act.o): Likewise. + * objcp-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Add. + +2005-04-21 Mike Stump + + * ChangeLog: New. + * Make-lang.in: Likewise. + * config-lang.in: Likewise. + * lang-specs.h: Likewise. + * objcp-decl.c: Likewise. + * objcp-decl.h: Likewise. + * objcp-lang.c: Likewise. diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in new file mode 100644 index 00000000000..422e2740598 --- /dev/null +++ b/gcc/objcp/Make-lang.in @@ -0,0 +1,149 @@ +# Top level -*- makefile -*- fragment for GNU Objective-C++ +# Copyright (C) 2005 Free Software Foundation, Inc. +# Contributed by Ziemowit Laski + +#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 + +# 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) + +cc1objplus-dummy$(exeext): $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) \ + $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ + $(OBJCXX_OBJS) dummy-checksum.o $(BACKEND) $(LIBS) + +cc1objplus-checksum.c : cc1objplus-dummy$(exeext) build/genchecksum$(exeext) + build/genchecksum$(exeext) cc1objplus-dummy$(exeext) > $@ + +cc1objplus-checksum.o : cc1objplus-checksum.c + +cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS) + $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \ + $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBS) + +# Objective C++ language specific files. + +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 + +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. +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..b5374ddc5c3 --- /dev/null +++ b/gcc/objcp/config-lang.in @@ -0,0 +1,43 @@ +# Top level configure fragment for GNU Objective-C++. +# Copyright (C) 2005 Free Software Foundation, Inc. +# Contributed by Ziemowit Laski + +#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. + +# 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) + +language="obj-c++" + +compilers="cc1objplus\$(exeext)" + +stagestuff="" + +# 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..be25eb1edcc --- /dev/null +++ b/gcc/objcp/lang-specs.h @@ -0,0 +1,60 @@ +/* Definitions for specs for Objective-C++. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +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..7493a23f609 --- /dev/null +++ b/gcc/objcp/objcp-decl.c @@ -0,0 +1,134 @@ +/* Process the ObjC-specific declarations and variables for + the Objective-C++ compiler. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +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..39cad46d2e9 --- /dev/null +++ b/gcc/objcp/objcp-decl.h @@ -0,0 +1,95 @@ +/* Process the ObjC-specific declarations and variables for + the Objective-C++ compiler. + Copyright (C) 2005 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +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..63f1953a770 --- /dev/null +++ b/gcc/objcp/objcp-lang.c @@ -0,0 +1,145 @@ +/* Language-dependent hooks for Objective-C++. + Copyright 2005 Free Software Foundation, Inc. + Contributed by Ziemowit Laski + +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 +#undef LANG_HOOKS_GIMPLIFY_EXPR +#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr +#undef LANG_HOOKS_GET_CALLEE_FNDECL +#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl +/* 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/opt-functions.awk b/gcc/opt-functions.awk index 35ab4453f31..9dc9640d998 100644 --- a/gcc/opt-functions.awk +++ b/gcc/opt-functions.awk @@ -18,6 +18,21 @@ # Some common subroutines for use by opt[ch]-gen.awk. +# Return nonzero if FLAGS contains a flag matching REGEX. +function flag_set_p(regex, flags) +{ + return (" " flags " ") ~ (" " regex " ") +} + +# Return STRING if FLAGS contains a flag matching regexp REGEX, +# otherwise return the empty string. +function test_flag(regex, flags, string) +{ + if (flag_set_p(regex, flags)) + return string + return "" +} + # If FLAGS contains a "NAME(...argument...)" flag, return the value # of the argument. Return the empty string otherwise. function opt_args(name, flags) @@ -47,24 +62,22 @@ function nth_arg(n, s) # Return a bitmask of CL_* values for option flags FLAGS. function switch_flags (flags) { - flags = " " flags " " result = "0" for (j = 0; j < n_langs; j++) { - regex = " " langs[j] " " + regex = langs[j] gsub ( "\\+", "\\+", regex ) - if (flags ~ regex) - result = result " | " macros[j] + result = result test_flag(regex, flags, " | " macros[j]) } - if (flags ~ " Common ") result = result " | CL_COMMON" - if (flags ~ " Target ") result = result " | CL_TARGET" - if (flags ~ " Joined ") result = result " | CL_JOINED" - if (flags ~ " JoinedOrMissing ") \ - result = result " | CL_JOINED | CL_MISSING_OK" - if (flags ~ " Separate ") result = result " | CL_SEPARATE" - if (flags ~ " RejectNegative ") result = result " | CL_REJECT_NEGATIVE" - if (flags ~ " UInteger ") result = result " | CL_UINTEGER" - if (flags ~ " Undocumented ") result = result " | CL_UNDOCUMENTED" - if (flags ~ " Report ") result = result " | CL_REPORT" + result = result \ + test_flag("Common", flags, " | CL_COMMON") \ + test_flag("Target", flags, " | CL_TARGET") \ + test_flag("Joined", flags, " | CL_JOINED") \ + test_flag("JoinedOrMissing", flags, " | CL_JOINED | CL_MISSING_OK") \ + test_flag("Separate", flags, " | CL_SEPARATE") \ + test_flag("RejectNegative", flags, " | CL_REJECT_NEGATIVE") \ + test_flag("UInteger", flags, " | CL_UINTEGER") \ + test_flag("Undocumented", flags, " | CL_UNDOCUMENTED") \ + test_flag("Report", flags, " | CL_REPORT") sub( "^0 \\| ", "", result ) return result } @@ -84,11 +97,21 @@ function var_set(flags) if (s != "") return "CLVC_EQUAL, " s s = opt_args("Mask", flags); - if (s != "") - return "CLVC_BIT_SET, MASK_" s + if (s != "") { + vn = var_name(flags); + if (vn) + return "CLVC_BIT_SET, OPTION_MASK_" s + else + return "CLVC_BIT_SET, MASK_" s + } s = nth_arg(0, opt_args("InverseMask", flags)); - if (s != "") - return "CLVC_BIT_CLEAR, MASK_" s + if (s != "") { + vn = var_name(flags); + if (vn) + return "CLVC_BIT_CLEAR, OPTION_MASK_" s + else + return "CLVC_BIT_CLEAR, MASK_" s + } return "CLVC_BOOLEAN, 0" } diff --git a/gcc/optabs.c b/gcc/optabs.c index b2021f1d358..d3c4934c544 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -127,7 +127,7 @@ static rtx vector_compare_rtx (tree, bool, enum insn_code); #ifndef HAVE_conditional_trap #define HAVE_conditional_trap 0 -#define gen_conditional_trap(a,b) (abort (), NULL_RTX) +#define gen_conditional_trap(a,b) (gcc_unreachable (), NULL_RTX) #endif /* Add a REG_EQUAL note to the last insn in INSNS. TARGET is being set to @@ -146,10 +146,7 @@ add_equal_note (rtx insns, rtx target, enum rtx_code code, rtx op0, rtx op1) rtx last_insn, insn, set; rtx note; - if (! insns - || ! INSN_P (insns) - || NEXT_INSN (insns) == NULL_RTX) - abort (); + gcc_assert (insns && INSN_P (insns) && NEXT_INSN (insns)); if (GET_RTX_CLASS (code) != RTX_COMM_ARITH && GET_RTX_CLASS (code) != RTX_BIN_ARITH @@ -348,11 +345,10 @@ expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0, rtx pat; rtx xop0 = op0, xop1 = op1, xop2 = op2; - if (ternary_optab->handlers[(int) mode].insn_code == CODE_FOR_nothing) - abort (); + gcc_assert (ternary_optab->handlers[(int) mode].insn_code + != CODE_FOR_nothing); - if (!target - || ! (*insn_data[icode].operand[0].predicate) (target, mode)) + if (!target || !insn_data[icode].operand[0].predicate (target, mode)) temp = gen_reg_rtx (mode); else temp = target; @@ -387,15 +383,15 @@ expand_ternary_op (enum machine_mode mode, optab ternary_optab, rtx op0, /* Now, if insn's predicates don't allow our operands, put them into pseudo regs. */ - if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0) + if (!insn_data[icode].operand[1].predicate (xop0, mode0) && mode0 != VOIDmode) xop0 = copy_to_mode_reg (mode0, xop0); - if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1) + if (!insn_data[icode].operand[2].predicate (xop1, mode1) && mode1 != VOIDmode) xop1 = copy_to_mode_reg (mode1, xop1); - if (! (*insn_data[icode].operand[3].predicate) (xop2, mode2) + if (!insn_data[icode].operand[3].predicate (xop2, mode2) && mode2 != VOIDmode) xop2 = copy_to_mode_reg (mode2, xop2); @@ -927,8 +923,7 @@ expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0, enum optab_methods methods) { optab binop = code_to_optab[(int) code]; - if (binop == 0) - abort (); + gcc_assert (binop); return expand_binop (mode, binop, op0, op1, target, unsignedp, methods); } @@ -1088,15 +1083,15 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, /* Now, if insn's predicates don't allow our operands, put them into pseudo regs. */ - if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0) + if (!insn_data[icode].operand[1].predicate (xop0, mode0) && mode0 != VOIDmode) xop0 = copy_to_mode_reg (mode0, xop0); - if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1) + if (!insn_data[icode].operand[2].predicate (xop1, mode1) && mode1 != VOIDmode) xop1 = copy_to_mode_reg (mode1, xop1); - if (! (*insn_data[icode].operand[0].predicate) (temp, mode)) + if (!insn_data[icode].operand[0].predicate (temp, mode)) temp = gen_reg_rtx (mode); pat = GEN_FCN (icode) (temp, xop0, xop1); @@ -1534,6 +1529,11 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1, } emit_move_insn (target_piece, newx); } + else + { + if (x != target_piece) + emit_move_insn (target_piece, x); + } carry_in = carry_out; } @@ -1824,14 +1824,13 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1, xop0 = convert_to_mode (mode0, xop0, unsignedp); /* Now, if insn doesn't accept these operands, put them into pseudos. */ - if (! (*insn_data[icode].operand[2].predicate) (xop0, mode0)) + if (!insn_data[icode].operand[2].predicate (xop0, mode0)) xop0 = copy_to_mode_reg (mode0, xop0); /* We could handle this, but we should always be called with a pseudo for our targets and all insns should take them as outputs. */ - if (! (*insn_data[icode].operand[0].predicate) (targ0, mode) - || ! (*insn_data[icode].operand[1].predicate) (targ1, mode)) - abort (); + gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode)); + gcc_assert (insn_data[icode].operand[1].predicate (targ1, mode)); pat = GEN_FCN (icode) (targ0, targ1, xop0); if (pat) @@ -1950,17 +1949,16 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1, xop1, unsignedp); /* Now, if insn doesn't accept these operands, put them into pseudos. */ - if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0)) + if (!insn_data[icode].operand[1].predicate (xop0, mode0)) xop0 = copy_to_mode_reg (mode0, xop0); - if (! (*insn_data[icode].operand[2].predicate) (xop1, mode1)) + if (!insn_data[icode].operand[2].predicate (xop1, mode1)) xop1 = copy_to_mode_reg (mode1, xop1); /* We could handle this, but we should always be called with a pseudo for our targets and all insns should take them as outputs. */ - if (! (*insn_data[icode].operand[0].predicate) (targ0, mode) - || ! (*insn_data[icode].operand[3].predicate) (targ1, mode)) - abort (); + gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode)); + gcc_assert (insn_data[icode].operand[3].predicate (targ1, mode)); pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1); if (pat) @@ -2023,8 +2021,7 @@ expand_twoval_binop_libfunc (optab binoptab, rtx op0, rtx op1, rtx insns; /* Exactly one of TARG0 or TARG1 should be non-NULL. */ - if (!((targ0 != NULL_RTX) ^ (targ1 != NULL_RTX))) - abort (); + gcc_assert (!targ0 != !targ1); mode = GET_MODE (op0); if (!binoptab->handlers[(int) mode].libfunc) @@ -2061,8 +2058,7 @@ expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0, rtx target, int unsignedp) { optab unop = code_to_optab[(int) code]; - if (unop == 0) - abort (); + gcc_assert (unop); return expand_unop (mode, unop, op0, target, unsignedp); } @@ -2312,10 +2308,10 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target, /* Now, if insn doesn't accept our operand, put it into a pseudo. */ - if (! (*insn_data[icode].operand[1].predicate) (xop0, mode0)) + if (!insn_data[icode].operand[1].predicate (xop0, mode0)) xop0 = copy_to_mode_reg (mode0, xop0); - if (! (*insn_data[icode].operand[0].predicate) (temp, mode)) + if (!insn_data[icode].operand[0].predicate (temp, mode)) temp = gen_reg_rtx (mode); pat = GEN_FCN (icode) (temp, xop0); @@ -2929,10 +2925,10 @@ emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code) /* Now, if insn does not accept our operands, put them into pseudos. */ - if (! (*insn_data[icode].operand[1].predicate) (op0, mode0)) + if (!insn_data[icode].operand[1].predicate (op0, mode0)) op0 = copy_to_mode_reg (mode0, op0); - if (! (*insn_data[icode].operand[0].predicate) (temp, GET_MODE (temp)) + if (!insn_data[icode].operand[0].predicate (temp, GET_MODE (temp)) || (flag_force_mem && MEM_P (temp))) temp = gen_reg_rtx (GET_MODE (temp)); @@ -2947,6 +2943,39 @@ emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code) emit_move_insn (target, temp); } +struct no_conflict_data +{ + rtx target, first, insn; + bool must_stay; +}; + +/* Called via note_stores by emit_no_conflict_block. Set P->must_stay + if the currently examined clobber / store has to stay in the list of + insns that constitute the actual no_conflict block. */ +static void +no_conflict_move_test (rtx dest, rtx set, void *p0) +{ + struct no_conflict_data *p= p0; + + /* If this inns directly contributes to setting the target, it must stay. */ + if (reg_overlap_mentioned_p (p->target, dest)) + p->must_stay = true; + /* If we haven't committed to keeping any other insns in the list yet, + there is nothing more to check. */ + else if (p->insn == p->first) + return; + /* If this insn sets / clobbers a register that feeds one of the insns + already in the list, this insn has to stay too. */ + else if (reg_mentioned_p (dest, PATTERN (p->first)) + || reg_used_between_p (dest, p->first, p->insn) + /* Likewise if this insn depends on a register set by a previous + insn in the list. */ + || (GET_CODE (set) == SET + && (modified_in_p (SET_SRC (set), p->first) + || modified_between_p (SET_SRC (set), p->first, p->insn)))) + p->must_stay = true; +} + /* Emit code to perform a series of operations on a multi-word quantity, one word at a time. @@ -2992,8 +3021,8 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv) these from the list. */ for (insn = insns; insn; insn = next) { - rtx set = 0, note; - int i; + rtx note; + struct no_conflict_data data; next = NEXT_INSN (insn); @@ -3004,23 +3033,12 @@ emit_no_conflict_block (rtx insns, rtx target, rtx op0, rtx op1, rtx equiv) if ((note = find_reg_note (insn, REG_RETVAL, NULL)) != NULL) remove_note (insn, note); - if (GET_CODE (PATTERN (insn)) == SET || GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER) - set = PATTERN (insn); - else if (GET_CODE (PATTERN (insn)) == PARALLEL) - { - for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++) - if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET) - { - set = XVECEXP (PATTERN (insn), 0, i); - break; - } - } - - if (set == 0) - abort (); - - if (! reg_overlap_mentioned_p (target, SET_DEST (set))) + data.target = target; + data.first = insns; + data.insn = insn; + data.must_stay = 0; + note_stores (PATTERN (insn), no_conflict_move_test, &data); + if (! data.must_stay) { if (PREV_INSN (insn)) NEXT_INSN (PREV_INSN (insn)) = next; @@ -3312,7 +3330,8 @@ can_compare_p (enum rtx_code code, enum machine_mode mode, comparison or emitting a library call to perform the comparison if no insn is available to handle it. The values which are passed in through pointers can be modified; the caller - should perform the comparison on the modified values. */ + should perform the comparison on the modified values. Constant + comparisons must have already been folded. */ static void prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size, @@ -3326,11 +3345,6 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size, class = GET_MODE_CLASS (mode); - /* They could both be VOIDmode if both args are immediate constants, - but we should fold that at an earlier stage. - With no special code here, this will call abort, - reminding the programmer to implement such folding. */ - if (mode != BLKmode && flag_force_mem) { /* Load duplicate non-volatile operands once. */ @@ -3357,11 +3371,10 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size, y = force_reg (mode, y); #ifdef HAVE_cc0 - /* Abort if we have a non-canonical comparison. The RTL documentation - states that canonical comparisons are required only for targets which - have cc0. */ - if (CONSTANT_P (x) && ! CONSTANT_P (y)) - abort (); + /* Make sure if we have a canonical comparison. The RTL + documentation states that canonical comparisons are required only + for targets which have cc0. */ + gcc_assert (!CONSTANT_P (x) || CONSTANT_P (y)); #endif /* Don't let both operands fail to indicate the mode. */ @@ -3380,8 +3393,7 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size, rtx opalign = GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT); - if (size == 0) - abort (); + gcc_assert (size); /* Try to use a memory block compare insn - either cmpstr or cmpmem will do. */ @@ -3478,11 +3490,8 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size, return; } - if (class == MODE_FLOAT) - prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp); - - else - abort (); + gcc_assert (class == MODE_FLOAT); + prepare_float_lib_cmp (px, py, pcomparison, pmode, punsignedp); } /* Before emitting an insn with code ICODE, make sure that X, which is going @@ -3497,7 +3506,7 @@ prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode, if (mode != wider_mode) x = convert_modes (wider_mode, mode, x, unsignedp); - if (! (*insn_data[icode].operand[opnum].predicate) + if (!insn_data[icode].operand[opnum].predicate (x, insn_data[icode].operand[opnum].mode)) { if (no_new_pseudos) @@ -3532,7 +3541,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode, icode = cbranch_optab->handlers[(int) wider_mode].insn_code; if (icode != CODE_FOR_nothing - && (*insn_data[icode].operand[0].predicate) (test, wider_mode)) + && insn_data[icode].operand[0].predicate (test, wider_mode)) { x = prepare_operand (icode, x, 1, mode, wider_mode, unsignedp); y = prepare_operand (icode, y, 2, mode, wider_mode, unsignedp); @@ -3548,7 +3557,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode, x = prepare_operand (icode, x, 0, mode, wider_mode, unsignedp); emit_insn (GEN_FCN (icode) (x)); if (label) - emit_jump_insn ((*bcc_gen_fctn[(int) comparison]) (label)); + emit_jump_insn (bcc_gen_fctn[(int) comparison] (label)); return; } @@ -3561,7 +3570,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode, y = prepare_operand (icode, y, 1, mode, wider_mode, unsignedp); emit_insn (GEN_FCN (icode) (x, y)); if (label) - emit_jump_insn ((*bcc_gen_fctn[(int) comparison]) (label)); + emit_jump_insn (bcc_gen_fctn[(int) comparison] (label)); return; } @@ -3573,7 +3582,7 @@ emit_cmp_and_jump_insn_1 (rtx x, rtx y, enum machine_mode mode, } while (wider_mode != VOIDmode); - abort (); + gcc_unreachable (); } /* Generate code to compare X with Y so that the condition codes are @@ -3604,17 +3613,15 @@ emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size, { /* If we're not emitting a branch, this means some caller is out of sync. */ - if (! label) - abort (); + gcc_assert (label); op0 = y, op1 = x; comparison = swap_condition (comparison); } #ifdef HAVE_cc0 - /* If OP0 is still a constant, then both X and Y must be constants. Force - X into a register to avoid aborting in emit_cmp_insn due to non-canonical - RTL. */ + /* If OP0 is still a constant, then both X and Y must be constants. + Force X into a register to create canonical RTL. */ if (CONSTANT_P (op0)) op0 = force_reg (mode, op0); #endif @@ -3676,8 +3683,7 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison, } } - if (mode == VOIDmode) - abort (); + gcc_assert (mode != VOIDmode); if (mode != orig_mode) { @@ -3735,7 +3741,7 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison, break; default: - abort (); + gcc_unreachable (); } equiv = simplify_gen_ternary (IF_THEN_ELSE, word_mode, word_mode, equiv, true_rtx, false_rtx); @@ -3767,8 +3773,8 @@ prepare_float_lib_cmp (rtx *px, rtx *py, enum rtx_code *pcomparison, void emit_indirect_jump (rtx loc) { - if (! ((*insn_data[(int) CODE_FOR_indirect_jump].operand[0].predicate) - (loc, Pmode))) + if (!insn_data[(int) CODE_FOR_indirect_jump].operand[0].predicate + (loc, Pmode)) loc = copy_to_mode_reg (Pmode, loc); emit_jump_insn (gen_indirect_jump (loc)); @@ -3853,15 +3859,15 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1, /* If the insn doesn't accept these operands, put them in pseudos. */ - if (! (*insn_data[icode].operand[0].predicate) + if (!insn_data[icode].operand[0].predicate (subtarget, insn_data[icode].operand[0].mode)) subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode); - if (! (*insn_data[icode].operand[2].predicate) + if (!insn_data[icode].operand[2].predicate (op2, insn_data[icode].operand[2].mode)) op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2); - if (! (*insn_data[icode].operand[3].predicate) + if (!insn_data[icode].operand[3].predicate (op3, insn_data[icode].operand[3].mode)) op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3); @@ -3985,17 +3991,17 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1, /* If the insn doesn't accept these operands, put them in pseudos. */ - if (! (*insn_data[icode].operand[0].predicate) + if (!insn_data[icode].operand[0].predicate (target, insn_data[icode].operand[0].mode)) subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode); else subtarget = target; - if (! (*insn_data[icode].operand[2].predicate) + if (!insn_data[icode].operand[2].predicate (op2, insn_data[icode].operand[2].mode)) op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2); - if (! (*insn_data[icode].operand[3].predicate) + if (!insn_data[icode].operand[3].predicate (op3, insn_data[icode].operand[3].mode)) op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3); @@ -4037,15 +4043,14 @@ gen_add2_insn (rtx x, rtx y) { int icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code; - if (! ((*insn_data[icode].operand[0].predicate) - (x, insn_data[icode].operand[0].mode)) - || ! ((*insn_data[icode].operand[1].predicate) - (x, insn_data[icode].operand[1].mode)) - || ! ((*insn_data[icode].operand[2].predicate) - (y, insn_data[icode].operand[2].mode))) - abort (); + gcc_assert (insn_data[icode].operand[0].predicate + (x, insn_data[icode].operand[0].mode)); + gcc_assert (insn_data[icode].operand[1].predicate + (x, insn_data[icode].operand[1].mode)); + gcc_assert (insn_data[icode].operand[2].predicate + (y, insn_data[icode].operand[2].mode)); - return (GEN_FCN (icode) (x, x, y)); + return GEN_FCN (icode) (x, x, y); } /* Generate and return an insn body to add r1 and c, @@ -4056,15 +4061,15 @@ gen_add3_insn (rtx r0, rtx r1, rtx c) int icode = (int) add_optab->handlers[(int) GET_MODE (r0)].insn_code; if (icode == CODE_FOR_nothing - || ! ((*insn_data[icode].operand[0].predicate) - (r0, insn_data[icode].operand[0].mode)) - || ! ((*insn_data[icode].operand[1].predicate) - (r1, insn_data[icode].operand[1].mode)) - || ! ((*insn_data[icode].operand[2].predicate) - (c, insn_data[icode].operand[2].mode))) + || !(insn_data[icode].operand[0].predicate + (r0, insn_data[icode].operand[0].mode)) + || !(insn_data[icode].operand[1].predicate + (r1, insn_data[icode].operand[1].mode)) + || !(insn_data[icode].operand[2].predicate + (c, insn_data[icode].operand[2].mode))) return NULL_RTX; - return (GEN_FCN (icode) (r0, r1, c)); + return GEN_FCN (icode) (r0, r1, c); } int @@ -4072,20 +4077,19 @@ have_add2_insn (rtx x, rtx y) { int icode; - if (GET_MODE (x) == VOIDmode) - abort (); + gcc_assert (GET_MODE (x) != VOIDmode); icode = (int) add_optab->handlers[(int) GET_MODE (x)].insn_code; if (icode == CODE_FOR_nothing) return 0; - if (! ((*insn_data[icode].operand[0].predicate) - (x, insn_data[icode].operand[0].mode)) - || ! ((*insn_data[icode].operand[1].predicate) - (x, insn_data[icode].operand[1].mode)) - || ! ((*insn_data[icode].operand[2].predicate) - (y, insn_data[icode].operand[2].mode))) + if (!(insn_data[icode].operand[0].predicate + (x, insn_data[icode].operand[0].mode)) + || !(insn_data[icode].operand[1].predicate + (x, insn_data[icode].operand[1].mode)) + || !(insn_data[icode].operand[2].predicate + (y, insn_data[icode].operand[2].mode))) return 0; return 1; @@ -4098,15 +4102,14 @@ gen_sub2_insn (rtx x, rtx y) { int icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code; - if (! ((*insn_data[icode].operand[0].predicate) - (x, insn_data[icode].operand[0].mode)) - || ! ((*insn_data[icode].operand[1].predicate) - (x, insn_data[icode].operand[1].mode)) - || ! ((*insn_data[icode].operand[2].predicate) - (y, insn_data[icode].operand[2].mode))) - abort (); + gcc_assert (insn_data[icode].operand[0].predicate + (x, insn_data[icode].operand[0].mode)); + gcc_assert (insn_data[icode].operand[1].predicate + (x, insn_data[icode].operand[1].mode)); + gcc_assert (insn_data[icode].operand[2].predicate + (y, insn_data[icode].operand[2].mode)); - return (GEN_FCN (icode) (x, x, y)); + return GEN_FCN (icode) (x, x, y); } /* Generate and return an insn body to subtract r1 and c, @@ -4117,15 +4120,15 @@ gen_sub3_insn (rtx r0, rtx r1, rtx c) int icode = (int) sub_optab->handlers[(int) GET_MODE (r0)].insn_code; if (icode == CODE_FOR_nothing - || ! ((*insn_data[icode].operand[0].predicate) - (r0, insn_data[icode].operand[0].mode)) - || ! ((*insn_data[icode].operand[1].predicate) - (r1, insn_data[icode].operand[1].mode)) - || ! ((*insn_data[icode].operand[2].predicate) - (c, insn_data[icode].operand[2].mode))) + || !(insn_data[icode].operand[0].predicate + (r0, insn_data[icode].operand[0].mode)) + || !(insn_data[icode].operand[1].predicate + (r1, insn_data[icode].operand[1].mode)) + || !(insn_data[icode].operand[2].predicate + (c, insn_data[icode].operand[2].mode))) return NULL_RTX; - return (GEN_FCN (icode) (r0, r1, c)); + return GEN_FCN (icode) (r0, r1, c); } int @@ -4133,20 +4136,19 @@ have_sub2_insn (rtx x, rtx y) { int icode; - if (GET_MODE (x) == VOIDmode) - abort (); + gcc_assert (GET_MODE (x) != VOIDmode); icode = (int) sub_optab->handlers[(int) GET_MODE (x)].insn_code; if (icode == CODE_FOR_nothing) return 0; - if (! ((*insn_data[icode].operand[0].predicate) - (x, insn_data[icode].operand[0].mode)) - || ! ((*insn_data[icode].operand[1].predicate) - (x, insn_data[icode].operand[1].mode)) - || ! ((*insn_data[icode].operand[2].predicate) - (y, insn_data[icode].operand[2].mode))) + if (!(insn_data[icode].operand[0].predicate + (x, insn_data[icode].operand[0].mode)) + || !(insn_data[icode].operand[1].predicate + (x, insn_data[icode].operand[1].mode)) + || !(insn_data[icode].operand[2].predicate + (y, insn_data[icode].operand[2].mode))) return 0; return 1; @@ -4260,8 +4262,7 @@ expand_float (rtx to, rtx from, int unsignedp) enum machine_mode fmode, imode; /* Crash now, because we won't be able to decide which mode to use. */ - if (GET_MODE (from) == VOIDmode) - abort (); + gcc_assert (GET_MODE (from) != VOIDmode); /* Look for an insn to do the conversion. Do it in the specified modes if possible; otherwise convert either input, output or both to @@ -4422,8 +4423,7 @@ expand_float (rtx to, rtx from, int unsignedp) from = force_not_mem (from); libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc; - if (!libfunc) - abort (); + gcc_assert (libfunc); start_sequence (); @@ -4606,8 +4606,7 @@ expand_fix (rtx to, rtx from, int unsignedp) convert_optab tab = unsignedp ? ufix_optab : sfix_optab; libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc; - if (!libfunc) - abort (); + gcc_assert (libfunc); if (flag_force_mem) from = force_not_mem (from); @@ -5028,11 +5027,14 @@ init_optabs (void) parity_optab = init_optab (PARITY); sqrt_optab = init_optab (SQRT); floor_optab = init_optab (UNKNOWN); + lfloor_optab = init_optab (UNKNOWN); ceil_optab = init_optab (UNKNOWN); + lceil_optab = init_optab (UNKNOWN); round_optab = init_optab (UNKNOWN); btrunc_optab = init_optab (UNKNOWN); nearbyint_optab = init_optab (UNKNOWN); rint_optab = init_optab (UNKNOWN); + lrint_optab = init_optab (UNKNOWN); sincos_optab = init_optab (UNKNOWN); sin_optab = init_optab (UNKNOWN); asin_optab = init_optab (UNKNOWN); @@ -5085,6 +5087,29 @@ init_optabs (void) cmpstr_optab[i] = CODE_FOR_nothing; cmpmem_optab[i] = CODE_FOR_nothing; + sync_add_optab[i] = CODE_FOR_nothing; + sync_sub_optab[i] = CODE_FOR_nothing; + sync_ior_optab[i] = CODE_FOR_nothing; + sync_and_optab[i] = CODE_FOR_nothing; + sync_xor_optab[i] = CODE_FOR_nothing; + sync_nand_optab[i] = CODE_FOR_nothing; + sync_old_add_optab[i] = CODE_FOR_nothing; + sync_old_sub_optab[i] = CODE_FOR_nothing; + sync_old_ior_optab[i] = CODE_FOR_nothing; + sync_old_and_optab[i] = CODE_FOR_nothing; + sync_old_xor_optab[i] = CODE_FOR_nothing; + sync_old_nand_optab[i] = CODE_FOR_nothing; + sync_new_add_optab[i] = CODE_FOR_nothing; + sync_new_sub_optab[i] = CODE_FOR_nothing; + sync_new_ior_optab[i] = CODE_FOR_nothing; + sync_new_and_optab[i] = CODE_FOR_nothing; + sync_new_xor_optab[i] = CODE_FOR_nothing; + sync_new_nand_optab[i] = CODE_FOR_nothing; + sync_compare_and_swap[i] = CODE_FOR_nothing; + sync_compare_and_swap_cc[i] = CODE_FOR_nothing; + sync_lock_test_and_set[i] = CODE_FOR_nothing; + sync_lock_release[i] = CODE_FOR_nothing; + #ifdef HAVE_SECONDARY_RELOADS reload_in_optab[i] = reload_out_optab[i] = CODE_FOR_nothing; #endif @@ -5236,8 +5261,7 @@ debug_optab_libfuncs (void) h = &o->handlers[j]; if (h->libfunc) { - if (GET_CODE (h->libfunc) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (h->libfunc) = SYMBOL_REF); fprintf (stderr, "%s\t%s:\t%s\n", GET_RTX_NAME (o->code), GET_MODE_NAME (j), @@ -5257,8 +5281,7 @@ debug_optab_libfuncs (void) h = &o->handlers[j][k]; if (h->libfunc) { - if (GET_CODE (h->libfunc) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (h->libfunc) = SYMBOL_REF); fprintf (stderr, "%s\t%s\t%s:\t%s\n", GET_RTX_NAME (o->code), GET_MODE_NAME (j), @@ -5303,6 +5326,7 @@ gen_cond_trap (enum rtx_code code ATTRIBUTE_UNUSED, rtx op1, emit_insn (GEN_FCN (icode) (op1, op2)); PUT_CODE (trap_rtx, code); + gcc_assert (HAVE_conditional_trap); insn = gen_conditional_trap (trap_rtx, tcode); if (insn) { @@ -5368,7 +5392,7 @@ get_rtx_code (enum tree_code tcode, bool unsignedp) break; default: - abort (); + gcc_unreachable (); } return code; } @@ -5383,29 +5407,23 @@ vector_compare_rtx (tree cond, bool unsignedp, enum insn_code icode) tree t_op0, t_op1; rtx rtx_op0, rtx_op1; - if (!COMPARISON_CLASS_P (cond)) - { - /* This is unlikely. While generating VEC_COND_EXPR, - auto vectorizer ensures that condition is a relational - operation. */ - abort (); - } - else - { - rcode = get_rtx_code (TREE_CODE (cond), unsignedp); - t_op0 = TREE_OPERAND (cond, 0); - t_op1 = TREE_OPERAND (cond, 1); - } + /* This is unlikely. While generating VEC_COND_EXPR, auto vectorizer + ensures that condition is a relational operation. */ + gcc_assert (COMPARISON_CLASS_P (cond)); + rcode = get_rtx_code (TREE_CODE (cond), unsignedp); + t_op0 = TREE_OPERAND (cond, 0); + t_op1 = TREE_OPERAND (cond, 1); + /* Expand operands. */ rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)), 1); rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)), 1); - if (!(*insn_data[icode].operand[4].predicate) (rtx_op0, GET_MODE (rtx_op0)) + if (!insn_data[icode].operand[4].predicate (rtx_op0, GET_MODE (rtx_op0)) && GET_MODE (rtx_op0) != VOIDmode) rtx_op0 = force_reg (GET_MODE (rtx_op0), rtx_op0); - if (!(*insn_data[icode].operand[5].predicate) (rtx_op1, GET_MODE (rtx_op1)) + if (!insn_data[icode].operand[5].predicate (rtx_op1, GET_MODE (rtx_op1)) && GET_MODE (rtx_op1) != VOIDmode) rtx_op1 = force_reg (GET_MODE (rtx_op1), rtx_op1); @@ -5462,13 +5480,13 @@ expand_vec_cond_expr (tree vec_cond_expr, rtx target) /* Expand both operands and force them in reg, if required. */ rtx_op1 = expand_expr (TREE_OPERAND (vec_cond_expr, 1), NULL_RTX, VOIDmode, 1); - if (!(*insn_data[icode].operand[1].predicate) (rtx_op1, mode) + if (!insn_data[icode].operand[1].predicate (rtx_op1, mode) && mode != VOIDmode) rtx_op1 = force_reg (mode, rtx_op1); rtx_op2 = expand_expr (TREE_OPERAND (vec_cond_expr, 2), NULL_RTX, VOIDmode, 1); - if (!(*insn_data[icode].operand[2].predicate) (rtx_op2, mode) + if (!insn_data[icode].operand[2].predicate (rtx_op2, mode) && mode != VOIDmode) rtx_op2 = force_reg (mode, rtx_op2); @@ -5478,4 +5496,514 @@ expand_vec_cond_expr (tree vec_cond_expr, rtx target) return target; } + + +/* This is an internal subroutine of the other compare_and_swap expanders. + MEM, OLD_VAL and NEW_VAL are as you'd expect for a compare-and-swap + operation. TARGET is an optional place to store the value result of + the operation. ICODE is the particular instruction to expand. Return + the result of the operation. */ + +static rtx +expand_val_compare_and_swap_1 (rtx mem, rtx old_val, rtx new_val, + rtx target, enum insn_code icode) +{ + enum machine_mode mode = GET_MODE (mem); + rtx insn; + + if (!target || !insn_data[icode].operand[0].predicate (target, mode)) + target = gen_reg_rtx (mode); + + if (GET_MODE (old_val) != VOIDmode && GET_MODE (old_val) != mode) + old_val = convert_modes (mode, GET_MODE (old_val), old_val, 1); + if (!insn_data[icode].operand[2].predicate (old_val, mode)) + old_val = force_reg (mode, old_val); + + if (GET_MODE (new_val) != VOIDmode && GET_MODE (new_val) != mode) + new_val = convert_modes (mode, GET_MODE (new_val), new_val, 1); + if (!insn_data[icode].operand[3].predicate (new_val, mode)) + new_val = force_reg (mode, new_val); + + insn = GEN_FCN (icode) (target, mem, old_val, new_val); + if (insn == NULL_RTX) + return NULL_RTX; + emit_insn (insn); + + return target; +} + +/* Expand a compare-and-swap operation and return its value. */ + +rtx +expand_val_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target) +{ + enum machine_mode mode = GET_MODE (mem); + enum insn_code icode = sync_compare_and_swap[mode]; + + if (icode == CODE_FOR_nothing) + return NULL_RTX; + + return expand_val_compare_and_swap_1 (mem, old_val, new_val, target, icode); +} + +/* Expand a compare-and-swap operation and store true into the result if + the operation was successful and false otherwise. Return the result. + Unlike other routines, TARGET is not optional. */ + +rtx +expand_bool_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target) +{ + enum machine_mode mode = GET_MODE (mem); + enum insn_code icode; + rtx subtarget, label0, label1; + + /* If the target supports a compare-and-swap pattern that simultaneously + sets some flag for success, then use it. Otherwise use the regular + compare-and-swap and follow that immediately with a compare insn. */ + icode = sync_compare_and_swap_cc[mode]; + switch (icode) + { + default: + subtarget = expand_val_compare_and_swap_1 (mem, old_val, new_val, + NULL_RTX, icode); + if (subtarget != NULL_RTX) + break; + + /* FALLTHRU */ + case CODE_FOR_nothing: + icode = sync_compare_and_swap[mode]; + if (icode == CODE_FOR_nothing) + return NULL_RTX; + + /* Ensure that if old_val == mem, that we're not comparing + against an old value. */ + if (MEM_P (old_val)) + old_val = force_reg (mode, old_val); + + subtarget = expand_val_compare_and_swap_1 (mem, old_val, new_val, + NULL_RTX, icode); + if (subtarget == NULL_RTX) + return NULL_RTX; + + emit_cmp_insn (subtarget, old_val, EQ, const0_rtx, mode, true); + } + + /* If the target has a sane STORE_FLAG_VALUE, then go ahead and use a + setcc instruction from the beginning. We don't work too hard here, + but it's nice to not be stupid about initial code gen either. */ + if (STORE_FLAG_VALUE == 1) + { + icode = setcc_gen_code[EQ]; + if (icode != CODE_FOR_nothing) + { + enum machine_mode cmode = insn_data[icode].operand[0].mode; + rtx insn; + + subtarget = target; + if (!insn_data[icode].operand[0].predicate (target, cmode)) + subtarget = gen_reg_rtx (cmode); + + insn = GEN_FCN (icode) (subtarget); + if (insn) + { + emit_insn (insn); + if (GET_MODE (target) != GET_MODE (subtarget)) + { + convert_move (target, subtarget, 1); + subtarget = target; + } + return subtarget; + } + } + } + + /* Without an appropriate setcc instruction, use a set of branches to + get 1 and 0 stored into target. Presumably if the target has a + STORE_FLAG_VALUE that isn't 1, then this will get cleaned up by ifcvt. */ + + label0 = gen_label_rtx (); + label1 = gen_label_rtx (); + + emit_jump_insn (bcc_gen_fctn[EQ] (label0)); + emit_move_insn (target, const0_rtx); + emit_jump_insn (gen_jump (label1)); + emit_label (label0); + emit_move_insn (target, const1_rtx); + emit_label (label1); + + return target; +} + +/* This is a helper function for the other atomic operations. This function + emits a loop that contains SEQ that iterates until a compare-and-swap + operation at the end succeeds. MEM is the memory to be modified. SEQ is + a set of instructions that takes a value from OLD_REG as an input and + produces a value in NEW_REG as an output. Before SEQ, OLD_REG will be + set to the current contents of MEM. After SEQ, a compare-and-swap will + attempt to update MEM with NEW_REG. The function returns true when the + loop was generated successfully. */ + +static bool +expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq) +{ + enum machine_mode mode = GET_MODE (mem); + enum insn_code icode; + rtx label, cmp_reg, subtarget; + + /* The loop we want to generate looks like + + cmp_reg = mem; + label: + old_reg = cmp_reg; + seq; + cmp_reg = compare-and-swap(mem, old_reg, new_reg) + if (cmp_reg != old_reg) + goto label; + + Note that we only do the plain load from memory once. Subsequent + iterations use the value loaded by the compare-and-swap pattern. */ + + label = gen_label_rtx (); + cmp_reg = gen_reg_rtx (mode); + + emit_move_insn (cmp_reg, mem); + emit_label (label); + emit_move_insn (old_reg, cmp_reg); + if (seq) + emit_insn (seq); + + /* If the target supports a compare-and-swap pattern that simultaneously + sets some flag for success, then use it. Otherwise use the regular + compare-and-swap and follow that immediately with a compare insn. */ + icode = sync_compare_and_swap_cc[mode]; + switch (icode) + { + default: + subtarget = expand_val_compare_and_swap_1 (mem, old_reg, new_reg, + cmp_reg, icode); + if (subtarget != NULL_RTX) + { + gcc_assert (subtarget == cmp_reg); + break; + } + + /* FALLTHRU */ + case CODE_FOR_nothing: + icode = sync_compare_and_swap[mode]; + if (icode == CODE_FOR_nothing) + return false; + + subtarget = expand_val_compare_and_swap_1 (mem, old_reg, new_reg, + cmp_reg, icode); + if (subtarget == NULL_RTX) + return false; + if (subtarget != cmp_reg) + emit_move_insn (cmp_reg, subtarget); + + emit_cmp_insn (cmp_reg, old_reg, EQ, const0_rtx, mode, true); + } + + /* ??? Mark this jump predicted not taken? */ + emit_jump_insn (bcc_gen_fctn[NE] (label)); + + return true; +} + +/* This function generates the atomic operation MEM CODE= VAL. In this + case, we do not care about any resulting value. Returns NULL if we + cannot generate the operation. */ + +rtx +expand_sync_operation (rtx mem, rtx val, enum rtx_code code) +{ + enum machine_mode mode = GET_MODE (mem); + enum insn_code icode; + rtx insn; + + /* Look to see if the target supports the operation directly. */ + switch (code) + { + case PLUS: + icode = sync_add_optab[mode]; + break; + case IOR: + icode = sync_ior_optab[mode]; + break; + case XOR: + icode = sync_xor_optab[mode]; + break; + case AND: + icode = sync_and_optab[mode]; + break; + case NOT: + icode = sync_nand_optab[mode]; + break; + + case MINUS: + icode = sync_sub_optab[mode]; + if (icode == CODE_FOR_nothing) + { + icode = sync_add_optab[mode]; + if (icode != CODE_FOR_nothing) + { + val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1); + code = PLUS; + } + } + break; + + default: + gcc_unreachable (); + } + + /* Generate the direct operation, if present. */ + if (icode != CODE_FOR_nothing) + { + if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) + val = convert_modes (mode, GET_MODE (val), val, 1); + if (!insn_data[icode].operand[1].predicate (val, mode)) + val = force_reg (mode, val); + + insn = GEN_FCN (icode) (mem, val); + if (insn) + { + emit_insn (insn); + return const0_rtx; + } + } + + /* Failing that, generate a compare-and-swap loop in which we perform the + operation with normal arithmetic instructions. */ + if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + { + rtx t0 = gen_reg_rtx (mode), t1; + + start_sequence (); + + t1 = t0; + if (code == NOT) + { + t1 = expand_simple_unop (mode, NOT, t1, NULL_RTX, true); + code = AND; + } + t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX, + true, OPTAB_LIB_WIDEN); + + insn = get_insns (); + end_sequence (); + + if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn)) + return const0_rtx; + } + + return NULL_RTX; +} + +/* This function generates the atomic operation MEM CODE= VAL. In this + case, we do care about the resulting value: if AFTER is true then + return the value MEM holds after the operation, if AFTER is false + then return the value MEM holds before the operation. TARGET is an + optional place for the result value to be stored. */ + +rtx +expand_sync_fetch_operation (rtx mem, rtx val, enum rtx_code code, + bool after, rtx target) +{ + enum machine_mode mode = GET_MODE (mem); + enum insn_code old_code, new_code, icode; + bool compensate; + rtx insn; + + /* Look to see if the target supports the operation directly. */ + switch (code) + { + case PLUS: + old_code = sync_old_add_optab[mode]; + new_code = sync_new_add_optab[mode]; + break; + case IOR: + old_code = sync_old_ior_optab[mode]; + new_code = sync_new_ior_optab[mode]; + break; + case XOR: + old_code = sync_old_xor_optab[mode]; + new_code = sync_new_xor_optab[mode]; + break; + case AND: + old_code = sync_old_and_optab[mode]; + new_code = sync_new_and_optab[mode]; + break; + case NOT: + old_code = sync_old_nand_optab[mode]; + new_code = sync_new_nand_optab[mode]; + break; + + case MINUS: + old_code = sync_old_sub_optab[mode]; + new_code = sync_new_sub_optab[mode]; + if (old_code == CODE_FOR_nothing && new_code == CODE_FOR_nothing) + { + old_code = sync_old_add_optab[mode]; + new_code = sync_new_add_optab[mode]; + if (old_code != CODE_FOR_nothing || new_code != CODE_FOR_nothing) + { + val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1); + code = PLUS; + } + } + break; + + default: + gcc_unreachable (); + } + + /* If the target does supports the proper new/old operation, great. But + if we only support the opposite old/new operation, check to see if we + can compensate. In the case in which the old value is supported, then + we can always perform the operation again with normal arithmetic. In + the case in which the new value is supported, then we can only handle + this in the case the operation is reversible. */ + compensate = false; + if (after) + { + icode = new_code; + if (icode == CODE_FOR_nothing) + { + icode = old_code; + if (icode != CODE_FOR_nothing) + compensate = true; + } + } + else + { + icode = old_code; + if (icode == CODE_FOR_nothing + && (code == PLUS || code == MINUS || code == XOR)) + { + icode = new_code; + if (icode != CODE_FOR_nothing) + compensate = true; + } + } + + /* If we found something supported, great. */ + if (icode != CODE_FOR_nothing) + { + if (!target || !insn_data[icode].operand[0].predicate (target, mode)) + target = gen_reg_rtx (mode); + + if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) + val = convert_modes (mode, GET_MODE (val), val, 1); + if (!insn_data[icode].operand[2].predicate (val, mode)) + val = force_reg (mode, val); + + insn = GEN_FCN (icode) (target, mem, val); + if (insn) + { + emit_insn (insn); + + /* If we need to compensate for using an operation with the + wrong return value, do so now. */ + if (compensate) + { + if (!after) + { + if (code == PLUS) + code = MINUS; + else if (code == MINUS) + code = PLUS; + } + + if (code == NOT) + target = expand_simple_unop (mode, NOT, target, NULL_RTX, true); + target = expand_simple_binop (mode, code, target, val, NULL_RTX, + true, OPTAB_LIB_WIDEN); + } + + return target; + } + } + + /* Failing that, generate a compare-and-swap loop in which we perform the + operation with normal arithmetic instructions. */ + if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + { + rtx t0 = gen_reg_rtx (mode), t1; + + if (!target || !register_operand (target, mode)) + target = gen_reg_rtx (mode); + + start_sequence (); + + if (!after) + emit_move_insn (target, t0); + t1 = t0; + if (code == NOT) + { + t1 = expand_simple_unop (mode, NOT, t1, NULL_RTX, true); + code = AND; + } + t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX, + true, OPTAB_LIB_WIDEN); + if (after) + emit_move_insn (target, t1); + + insn = get_insns (); + end_sequence (); + + if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn)) + return target; + } + + return NULL_RTX; +} + +/* This function expands a test-and-set operation. Ideally we atomically + store VAL in MEM and return the previous value in MEM. Some targets + may not support this operation and only support VAL with the constant 1; + in this case while the return value will be 0/1, but the exact value + stored in MEM is target defined. TARGET is an option place to stick + the return value. */ + +rtx +expand_sync_lock_test_and_set (rtx mem, rtx val, rtx target) +{ + enum machine_mode mode = GET_MODE (mem); + enum insn_code icode; + rtx insn; + + /* If the target supports the test-and-set directly, great. */ + icode = sync_lock_test_and_set[mode]; + if (icode != CODE_FOR_nothing) + { + if (!target || !insn_data[icode].operand[0].predicate (target, mode)) + target = gen_reg_rtx (mode); + + if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) + val = convert_modes (mode, GET_MODE (val), val, 1); + if (!insn_data[icode].operand[2].predicate (val, mode)) + val = force_reg (mode, val); + + insn = GEN_FCN (icode) (target, mem, val); + if (insn) + { + emit_insn (insn); + return target; + } + } + + /* Otherwise, use a compare-and-swap loop for the exchange. */ + if (sync_compare_and_swap[mode] != CODE_FOR_nothing) + { + if (!target || !register_operand (target, mode)) + target = gen_reg_rtx (mode); + if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) + val = convert_modes (mode, GET_MODE (val), val, 1); + if (expand_compare_and_swap_loop (mem, target, val, NULL_RTX)) + return target; + } + + return NULL_RTX; +} + #include "gt-optabs.h" diff --git a/gcc/optabs.h b/gcc/optabs.h index b9aa6ac4161..1426e570fb9 100644 --- a/gcc/optabs.h +++ b/gcc/optabs.h @@ -186,11 +186,14 @@ enum optab_index OTI_log1p, /* Rounding functions */ OTI_floor, + OTI_lfloor, OTI_ceil, + OTI_lceil, OTI_btrunc, OTI_round, OTI_nearbyint, OTI_rint, + OTI_lrint, /* Tangent */ OTI_tan, /* Inverse tangent */ @@ -312,11 +315,14 @@ extern GTY(()) optab optab_table[OTI_MAX]; #define log2_optab (optab_table[OTI_log2]) #define log1p_optab (optab_table[OTI_log1p]) #define floor_optab (optab_table[OTI_floor]) +#define lfloor_optab (optab_table[OTI_lfloor]) #define ceil_optab (optab_table[OTI_ceil]) +#define lceil_optab (optab_table[OTI_lceil]) #define btrunc_optab (optab_table[OTI_btrunc]) #define round_optab (optab_table[OTI_round]) #define nearbyint_optab (optab_table[OTI_nearbyint]) #define rint_optab (optab_table[OTI_rint]) +#define lrint_optab (optab_table[OTI_lrint]) #define tan_optab (optab_table[OTI_tan]) #define atan_optab (optab_table[OTI_atan]) #define copysign_optab (optab_table[OTI_copysign]) @@ -426,6 +432,43 @@ extern enum insn_code clrmem_optab[NUM_MACHINE_MODES]; extern enum insn_code cmpstr_optab[NUM_MACHINE_MODES]; extern enum insn_code cmpmem_optab[NUM_MACHINE_MODES]; +/* Synchronization primitives. This first set is atomic operation for + which we don't care about the resulting value. */ +extern enum insn_code sync_add_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_sub_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_ior_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_and_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_xor_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_nand_optab[NUM_MACHINE_MODES]; + +/* This second set is atomic operations in which we return the value + that existed in memory before the operation. */ +extern enum insn_code sync_old_add_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_old_sub_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_old_ior_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_old_and_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_old_xor_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_old_nand_optab[NUM_MACHINE_MODES]; + +/* This third set is atomic operations in which we return the value + that resulted after performing the operation. */ +extern enum insn_code sync_new_add_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_new_sub_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_new_ior_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_new_and_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_new_xor_optab[NUM_MACHINE_MODES]; +extern enum insn_code sync_new_nand_optab[NUM_MACHINE_MODES]; + +/* Atomic compare and swap. */ +extern enum insn_code sync_compare_and_swap[NUM_MACHINE_MODES]; +extern enum insn_code sync_compare_and_swap_cc[NUM_MACHINE_MODES]; + +/* Atomic exchange with acquire semantics. */ +extern enum insn_code sync_lock_test_and_set[NUM_MACHINE_MODES]; + +/* Atomic clear with release semantics. */ +extern enum insn_code sync_lock_release[NUM_MACHINE_MODES]; + /* Define functions given in optabs.c. */ extern rtx expand_ternary_op (enum machine_mode mode, optab ternary_optab, diff --git a/gcc/optc-gen.awk b/gcc/optc-gen.awk index 3ed1cf881be..4c4eef7a8a2 100644 --- a/gcc/optc-gen.awk +++ b/gcc/optc-gen.awk @@ -42,10 +42,13 @@ BEGIN { n_langs++; } else { - opts[n_opts] = $1 - flags[n_opts] = $2 - help[n_opts] = $3 - n_opts++; + name = opt_args("Mask", $1) + if (name == "") { + opts[n_opts] = $1 + flags[n_opts] = $2 + help[n_opts] = $3 + n_opts++; + } } } @@ -53,9 +56,11 @@ BEGIN { END { print "/* This file is auto-generated by opts.sh. */" print "" -print "#include " -print "#include " quote header_name quote +n_headers = split(header_name, headers, " ") +for (i = 1; i <= n_headers; i++) + print "#include " quote headers[i] quote print "#include " quote "opts.h" quote +print "#include " quote "intl.h" quote print "" for (i = 0; i < n_opts; i++) { @@ -63,22 +68,20 @@ for (i = 0; i < n_opts; i++) { if (name == "") continue; - if (flags[i] ~ "VarExists") + if (flag_set_p("VarExists", flags[i])) + continue; + + init = opt_args("Init", flags[i]) + if (init != "") + init = " = " init; + else if (name in var_seen) continue; - if (flags[i] ~ "Init\\(") - { - init = flags[i]; - sub(".*Init\\(","",init); - sub("\\).*","",init); - init = " = " init; - } - else - init = ""; - - printf ("/* Set by -%s.\n %s */\nint %s%s;\n\n", + printf ("/* Set by -%s.\n %s */\nint %s%s;\n\n", opts[i], help[i], name,init) - } + + var_seen[name] = 1; +} print "const char * const lang_names[] =\n{" @@ -97,47 +100,57 @@ print "const struct cl_option cl_options[] =\n{" for (i = 0; i < n_opts; i++) back_chain[i] = "N_OPTS"; - for (i = 0; i < n_opts; i++) { - # Combine the flags of identical switches. Switches - # appear many times if they are handled by many front - # ends, for example. - while( i + 1 != n_opts && opts[i] == opts[i + 1] ) { - flags[i + 1] = flags[i] " " flags[i + 1]; - i++; - } +for (i = 0; i < n_opts; i++) { + # Combine the flags of identical switches. Switches + # appear many times if they are handled by many front + # ends, for example. + while( i + 1 != n_opts && opts[i] == opts[i + 1] ) { + flags[i + 1] = flags[i] " " flags[i + 1]; + i++; + } - len = length (opts[i]); - enum = "OPT_" opts[i] - if (opts[i] == "finline-limit=") - enum = enum "eq" - gsub ("[^A-Za-z0-9]", "_", enum) - - # If this switch takes joined arguments, back-chain all - # subsequent switches to it for which it is a prefix. If - # a later switch S is a longer prefix of a switch T, T - # will be back-chained to S in a later iteration of this - # for() loop, which is what we want. - if (flags[i] ~ "Joined") { - for (j = i + 1; j < n_opts; j++) { - if (substr (opts[j], 1, len) != opts[i]) - break; - back_chain[j] = enum; - } + len = length (opts[i]); + enum = "OPT_" opts[i] + if (opts[i] == "finline-limit=") + enum = enum "eq" + gsub ("[^A-Za-z0-9]", "_", enum) + + # If this switch takes joined arguments, back-chain all + # subsequent switches to it for which it is a prefix. If + # a later switch S is a longer prefix of a switch T, T + # will be back-chained to S in a later iteration of this + # for() loop, which is what we want. + if (flag_set_p("Joined.*", flags[i])) { + for (j = i + 1; j < n_opts; j++) { + if (substr (opts[j], 1, len) != opts[i]) + break; + back_chain[j] = enum; } + } - s = substr(" ", length (opts[i])) - if (i + 1 == n_opts) - comma = "" - - if (help[i] == "") - hlp = "0" - else - hlp = "N_(" quote help[i] quote ")"; - - printf(" { %c-%s%c,\n %s,\n %s, %u, %s, %s, %s }%s\n", - quote, opts[i], quote, hlp, back_chain[i], len, - switch_flags(flags[i]), - var_ref(flags[i]), var_set(flags[i]), comma) + s = substr(" ", length (opts[i])) + if (i + 1 == n_opts) + comma = "" + + if (help[i] == "") + hlp = "0" + else + hlp = quote help[i] quote; + + printf(" { %c-%s%c,\n %s,\n %s, %u,\n", + quote, opts[i], quote, hlp, back_chain[i], len) + condition = opt_args("Condition", flags[i]) + cl_flags = switch_flags(flags[i]) + if (condition != "") + printf("#if %s\n" \ + " %s,\n" \ + "#else\n" \ + " CL_DISABLED,\n" \ + "#endif\n", + condition, cl_flags, cl_flags) + else + printf(" %s,\n", cl_flags) + printf(" %s, %s }%s\n", var_ref(flags[i]), var_set(flags[i]), comma) } print "};" diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk index 83d19343e87..e95af00d2c4 100644 --- a/gcc/opth-gen.awk +++ b/gcc/opth-gen.awk @@ -26,7 +26,8 @@ BEGIN { n_opts = 0 n_langs = 0 - quote = "\042" + n_extra_masks = 0 + quote = "\042" comma = "," FS=SUBSEP } @@ -38,10 +39,16 @@ BEGIN { n_langs++; } else { - opts[n_opts] = $1 - flags[n_opts] = $2 - help[n_opts] = $3 - n_opts++; + name = opt_args("Mask", $1) + if (name == "") { + opts[n_opts] = $1 + flags[n_opts] = $2 + help[n_opts] = $3 + n_opts++; + } + else { + extra_masks[n_extra_masks++] = name + } } } @@ -54,6 +61,7 @@ print "#ifndef OPTIONS_H" print "#define OPTIONS_H" print "" print "extern int target_flags;" +print "" for (i = 0; i < n_opts; i++) { name = var_name(flags[i]); @@ -67,21 +75,47 @@ for (i = 0; i < n_opts; i++) { } -masknum = 0 for (i = 0; i < n_opts; i++) { name = opt_args("Mask", flags[i]) - if (name != "") - print "#define MASK_" name " (1 << " masknum++ ")" + vname = var_name(flags[i]) + mask = "MASK_" + if (vname != "") { + mask = "OPTION_MASK_" + } + if (name != "" && !flag_set_p("MaskExists", flags[i])) + print "#define " mask name " (1 << " masknum[vname]++ ")" +} +for (i = 0; i < n_extra_masks; i++) { + print "#define MASK_" extra_masks[i] " (1 << " masknum[""]++ ")" +} + +for (var in masknum) { + if (masknum[var] > 31) { + if (var == "") + print "#error too many target masks" + else + print "#error too many masks for " var + } } -if (masknum > 31) - print "#error too many target masks" print "" for (i = 0; i < n_opts; i++) { name = opt_args("Mask", flags[i]) - if (name != "") - print "#define TARGET_" name \ - " ((target_flags & MASK_" name ") != 0)" + vname = var_name(flags[i]) + macro = "OPTION_" + mask = "OPTION_MASK_" + if (vname == "") { + vname = "target_flags" + macro = "TARGET_" + mask = "MASK_" + } + if (name != "" && !flag_set_p("MaskExists", flags[i])) + print "#define " macro name \ + " ((" vname " & " mask name ") != 0)" +} +for (i = 0; i < n_extra_masks; i++) { + print "#define TARGET_" extra_masks[i] \ + " ((target_flags & MASK_" extra_masks[i] ") != 0)" } print "" @@ -107,14 +141,14 @@ print "{" for (i = 0; i < n_opts; i++) back_chain[i] = "N_OPTS"; - for (i = 0; i < n_opts; i++) { - # Combine the flags of identical switches. Switches - # appear many times if they are handled by many front - # ends, for example. - while( i + 1 != n_opts && opts[i] == opts[i + 1] ) { - flags[i + 1] = flags[i] " " flags[i + 1]; - i++; - } +for (i = 0; i < n_opts; i++) { + # Combine the flags of identical switches. Switches + # appear many times if they are handled by many front + # ends, for example. + while( i + 1 != n_opts && opts[i] == opts[i + 1] ) { + flags[i + 1] = flags[i] " " flags[i + 1]; + i++; + } len = length (opts[i]); enum = "OPT_" opts[i] @@ -127,7 +161,7 @@ for (i = 0; i < n_opts; i++) # a later switch S is a longer prefix of a switch T, T # will be back-chained to S in a later iteration of this # for() loop, which is what we want. - if (flags[i] ~ "Joined") { + if (flag_set_p("Joined.*", flags[i])) { for (j = i + 1; j < n_opts; j++) { if (substr (opts[j], 1, len) != opts[i]) break; diff --git a/gcc/opts.c b/gcc/opts.c index 3befb1d4d43..896728c3727 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -255,7 +255,7 @@ complain_wrong_lang (const char *text, const struct cl_option *option, bad_lang = write_langs (lang_mask); /* Eventually this should become a hard error IMO. */ - warning ("command line option \"%s\" is valid for %s but not for %s", + warning (0, "command line option \"%s\" is valid for %s but not for %s", text, ok_langs, bad_lang); free (ok_langs); @@ -315,6 +315,14 @@ handle_option (const char **argv, unsigned int lang_mask) /* We've recognized this switch. */ result = 1; + /* Check to see if the option is disabled for this configuration. */ + if (option->flags & CL_DISABLED) + { + error ("command line option %qs" + " is not supported by this configuration", opt); + goto done; + } + /* Sort out any argument the switch takes. */ if (option->flags & CL_JOINED) { @@ -524,6 +532,7 @@ decode_options (unsigned int argc, const char **argv) flag_tree_sra = 1; flag_tree_copyrename = 1; flag_tree_fre = 1; + flag_tree_copy_prop = 1; flag_tree_sink = 1; flag_tree_salias = 1; @@ -562,6 +571,9 @@ decode_options (unsigned int argc, const char **argv) flag_reorder_blocks = 1; flag_reorder_functions = 1; flag_unit_at_a_time = 1; + flag_tree_store_ccp = 1; + flag_tree_store_copy_prop = 1; + flag_tree_vrp = 1; if (!optimize_size) { @@ -656,7 +668,7 @@ decode_options (unsigned int argc, const char **argv) this to `2' if -Wall is used, so we can avoid giving out lots of errors for people who don't realize what -Wall does. */ if (warn_uninitialized == 1) - warning ("-Wuninitialized is not supported without -O"); + warning (0, "-Wuninitialized is not supported without -O"); } if (flag_really_no_inline == 2) @@ -669,21 +681,17 @@ decode_options (unsigned int argc, const char **argv) if (flag_exceptions && flag_reorder_blocks_and_partition) { - warning + inform ("-freorder-blocks-and-partition does not work with exceptions"); flag_reorder_blocks_and_partition = 0; flag_reorder_blocks = 1; } - /* The optimization to partition hot and cold basic blocks into - separate sections of the .o and executable files does not currently - work correctly with DWARF debugging turned on. Until this is fixed - we will disable the optimization when DWARF debugging is set. */ - - if (flag_reorder_blocks_and_partition && write_symbols == DWARF2_DEBUG) + if (flag_reorder_blocks_and_partition + && !targetm.have_named_sections) { - warning - ("-freorder-blocks-and-partition does not work with -g (currently)"); + inform + ("-freorder-blocks-and-partition does not work on this architecture."); flag_reorder_blocks_and_partition = 0; flag_reorder_blocks = 1; } @@ -818,6 +826,10 @@ common_handle_option (size_t scode, const char *arg, int value) return 0; break; + case OPT_fdiagnostics_show_option: + global_dc->show_option_requested = true; + break; + case OPT_fdump_: if (!dump_switch_p (arg)) return 0; @@ -984,7 +996,7 @@ common_handle_option (size_t scode, const char *arg, int value) else if (!strcmp (arg, "local-exec")) flag_tls_default = TLS_MODEL_LOCAL_EXEC; else - warning ("unknown tls-model \"%s\"", arg); + warning (0, "unknown tls-model \"%s\"", arg); break; case OPT_ftracer: @@ -1036,10 +1048,8 @@ common_handle_option (size_t scode, const char *arg, int value) default: /* If the flag was handled in a standard way, assume the lack of processing here is intentional. */ - if (cl_options[scode].flag_var) - break; - - abort (); + gcc_assert (cl_options[scode].flag_var); + break; } return 1; @@ -1157,7 +1167,7 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg) } if (write_symbols == NO_DEBUG) - warning ("target system does not support debug output"); + warning (0, "target system does not support debug output"); } } else @@ -1402,8 +1412,9 @@ wrap_help (const char *help, const char *item, unsigned int item_width) a simple on-off switch. */ int -option_enabled (const struct cl_option *option) +option_enabled (int opt_idx) { + const struct cl_option *option = &(cl_options[opt_idx]); if (option->flag_var) switch (option->var_cond) { diff --git a/gcc/opts.h b/gcc/opts.h index de1fe31e90a..758f8309abd 100644 --- a/gcc/opts.h +++ b/gcc/opts.h @@ -1,5 +1,5 @@ /* Command line option handling. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -52,6 +52,7 @@ extern const struct cl_option cl_options[]; extern const unsigned int cl_options_count; extern const char *const lang_names[]; +#define CL_DISABLED (1 << 21) /* Disabled in this configuration. */ #define CL_TARGET (1 << 22) /* Target-specific option. */ #define CL_REPORT (1 << 23) /* Report argument with -fverbose-asm */ #define CL_JOINED (1 << 24) /* If takes joined argument. */ @@ -71,7 +72,7 @@ extern const char **in_fnames; extern unsigned num_in_fnames; extern void decode_options (unsigned int argc, const char **argv); -extern int option_enabled (const struct cl_option *); +extern int option_enabled (int opt_idx); extern void print_filtered_help (unsigned int); #endif diff --git a/gcc/output.h b/gcc/output.h index 830178836bd..7c7c1d84513 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -66,12 +66,12 @@ extern void final_start_function (rtx, FILE *, int); extern void final_end_function (void); /* Output assembler code for some insns: all or part of a function. */ -extern void final (rtx, FILE *, int, int); +extern void final (rtx, FILE *, int); /* The final scan for one insn, INSN. Args are same as in `final', except that INSN is the insn being scanned. Value returned is the next insn to be scanned. */ -extern rtx final_scan_insn (rtx, FILE *, int, int, int, int *); +extern rtx final_scan_insn (rtx, FILE *, int, int, int *); /* Replace a SUBREG with a REG or a MEM, based on the thing it is a subreg of. */ @@ -209,6 +209,9 @@ extern void named_section (tree, const char *, int); /* Tell assembler to switch to the section for function DECL. */ extern void function_section (tree); +/* Tell assembler to switch to the most recently used text section. */ +extern void current_function_section (tree); + /* Tell assembler to switch to the section for string merging. */ extern void mergeable_string_section (tree, unsigned HOST_WIDE_INT, unsigned int); @@ -317,8 +320,8 @@ extern bool default_assemble_integer (rtx, unsigned int, int); /* Assemble the integer constant X into an object of SIZE bytes. ALIGN is the alignment of the integer in bits. Return 1 if we were able to output - the constant, otherwise 0. If FORCE is nonzero, abort if we can't output - the constant. */ + the constant, otherwise 0. If FORCE is nonzero the constant must + be outputable. */ extern bool assemble_integer (rtx, unsigned, unsigned, int); /* An interface to assemble_integer for the common case in which a value is @@ -422,7 +425,7 @@ extern rtx current_insn_predicate; extern rtx current_output_insn; /* Nonzero while outputting an `asm' with operands. - This means that inconsistencies are the user's fault, so don't abort. + This means that inconsistencies are the user's fault, so don't die. The precise value is the insn being output, to pass to error_for_asm. */ extern rtx this_is_asm_operands; @@ -431,6 +434,29 @@ extern rtx this_is_asm_operands; extern int size_directive_output; extern tree last_assemble_variable_decl; +enum in_section { no_section, in_text, in_unlikely_executed_text, in_data, + in_named +#ifdef BSS_SECTION_ASM_OP + , in_bss +#endif +#ifdef CTORS_SECTION_ASM_OP + , in_ctors +#endif +#ifdef DTORS_SECTION_ASM_OP + , in_dtors +#endif +#ifdef READONLY_DATA_SECTION_ASM_OP + , in_readonly_data +#endif +#ifdef EXTRA_SECTIONS + , EXTRA_SECTIONS +#endif +}; + +extern const char *last_text_section_name; +extern enum in_section last_text_section; +extern bool first_function_block_is_cold; + /* Decide whether DECL needs to be in a writable section. RELOC is the same as for SELECT_SECTION. */ extern bool decl_readonly_section (tree, int); @@ -519,6 +545,10 @@ extern bool default_valid_pointer_mode (enum machine_mode); extern int default_address_cost (rtx); +/* When performing hot/cold basic block partitioning, insert note in + instruction stream indicating boundary between hot and cold sections. */ +extern void insert_section_boundary_note (void); + /* dbxout helper functions */ #if defined DBX_DEBUGGING_INFO || defined XCOFF_DEBUGGING_INFO diff --git a/gcc/params.c b/gcc/params.c index cc55fae6f67..bae4dbad4f6 100644 --- a/gcc/params.c +++ b/gcc/params.c @@ -1,5 +1,5 @@ /* params.c - Run-time parameters. - Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Mark Mitchell . This file is part of GCC. @@ -61,8 +61,7 @@ set_param_value (const char *name, int value) size_t i; /* Make sure nobody tries to set a parameter to an invalid value. */ - if (value == INVALID_PARAM_VAL) - abort (); + gcc_assert (value != INVALID_PARAM_VAL); /* Scan the parameter table to find a matching entry. */ for (i = 0; i < num_compiler_params; ++i) diff --git a/gcc/params.def b/gcc/params.def index c424ad59f10..d9871a5b00b 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -35,6 +35,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA Be sure to add an entry to invoke.texi summarizing the parameter. */ +/* The maximum number of fields in a variable with only implicit uses + for which structure aliasing will consider trying to track each + field. The default is 5. */ +DEFPARAM (PARAM_SALIAS_MAX_IMPLICIT_FIELDS, + "salias-max-implicit-fields", + "The maximum number of fields in a structure variable without direct structure accesses that GCC will attempt to track separately", + 5, 0, 0) + /* The maximum structure size at which the scalar replacement of aggregates (SRA) pass will perform block copies. The default value, 0, implies that GCC will select the most appropriate size @@ -58,10 +66,9 @@ DEFPARAM (PARAM_SRA_FIELD_STRUCTURE_RATIO, of a function counted in internal gcc instructions (not in real machine instructions) that is eligible for inlining by the tree inliner. - The default value is 500. + The default value is 450. Only functions marked inline (or methods defined in the class - definition for C++) are affected by this, unless you set the - -finline-functions (included in -O3) compiler option. + definition for C++) are affected by this. There are more restrictions to inlining: If inlined functions call other functions, the already inlined instructions are counted and once the recursive inline limit (see @@ -70,7 +77,7 @@ DEFPARAM (PARAM_SRA_FIELD_STRUCTURE_RATIO, DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE, "max-inline-insns-single", "The maximum number of instructions in a single function eligible for inlining", - 500, 0, 0) + 450, 0, 0) /* The single function inlining limit for functions that are inlined by virtue of -finline-functions (-O3). @@ -78,21 +85,21 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE, that is applied to functions marked inlined (or defined in the class declaration in C++) given by the "max-inline-insns-single" parameter. - The default value is 150. */ + The default value is 90. */ DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO, "max-inline-insns-auto", "The maximum number of instructions when automatically inlining", - 120, 0, 0) + 90, 0, 0) DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE, "max-inline-insns-recursive", "The maximum number of instructions inline function can grow to via recursive inlining", - 500, 0, 0) + 450, 0, 0) DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO, "max-inline-insns-recursive-auto", "The maximum number of instructions non-inline function can grow to via recursive inlining", - 500, 0, 0) + 450, 0, 0) DEFPARAM (PARAM_MAX_INLINE_RECURSIVE_DEPTH, "max-inline-recursive-depth", @@ -148,7 +155,7 @@ DEFPARAM(PARAM_MAX_PENDING_LIST_LENGTH, DEFPARAM(PARAM_LARGE_FUNCTION_INSNS, "large-function-insns", "The size of function body to be considered large", - 3000, 0, 0) + 2700, 0, 0) DEFPARAM(PARAM_LARGE_FUNCTION_GROWTH, "large-function-growth", "Maximal growth due to inlining of large function (in percent)", @@ -157,6 +164,10 @@ DEFPARAM(PARAM_INLINE_UNIT_GROWTH, "inline-unit-growth", "how much can given compilation unit grow because of the inlining (in percent)", 50, 0, 0) +DEFPARAM(PARAM_INLINE_CALL_COST, + "inline-call-cost", + "expense of call operation relative to ordinary arithmetic operations", + 16, 0, 0) /* The GCSE optimization will be disabled if it would require significantly more memory than this value. */ @@ -361,6 +372,11 @@ DEFPARAM(PARAM_IV_ALWAYS_PRUNE_CAND_SET_BOUND, "If number of candidates in the set is smaller, we always try to remove unused ivs during its optimization", 10, 0, 0) +DEFPARAM(PARAM_SCEV_MAX_EXPR_SIZE, + "scev-max-expr-size", + "Bound on size of expressions used in the scalar evolutions analyzer", + 20, 0, 0) + /* The product of the next two is used to decide whether or not to use .GLOBAL_VAR. See tree-dfa.c. */ DEFPARAM(PARAM_GLOBAL_VAR_THRESHOLD, @@ -427,6 +443,30 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT, "The upper bound for sharing integer constants", 256, 2, 2) +/* Incremental SSA updates for virtual operands may be very slow if + there is a large number of mappings to process. In those cases, it + is faster to rewrite the virtual symbols from scratch as if they + had been recently introduced. This heuristic cannot be applied to + SSA mappings for real SSA names, only symbols kept in FUD chains. + + PARAM_MIN_VIRTUAL_MAPPINGS specifies the minimum number of virtual + mappings that should be registered to trigger the heuristic. + + PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO specifies the ratio between + mappings and symbols. If the number of virtual mappings is + PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO bigger than the number of + virtual symbols to be updated, then the updater switches to a full + update for those symbols. */ +DEFPARAM (PARAM_MIN_VIRTUAL_MAPPINGS, + "min-virtual-mappings", + "Minimum number of virtual mappings to consider switching to full virtual renames", + 100, 0, 0) + +DEFPARAM (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO, + "virtual-mappings-ratio", + "Ratio between virtual mappings and virtual symbols to do full virtual renames", + 3, 0, 0) + /* Local variables: mode:c diff --git a/gcc/params.h b/gcc/params.h index 1f57a0f91a0..fc1c377fb3b 100644 --- a/gcc/params.h +++ b/gcc/params.h @@ -89,6 +89,8 @@ typedef enum compiler_param (compiler_params[(int) ENUM].value) /* Macros for the various parameters. */ +#define SALIAS_MAX_IMPLICIT_FIELDS \ + PARAM_VALUE (PARAM_SALIAS_MAX_IMPLICIT_FIELDS) #define SRA_MAX_STRUCTURE_SIZE \ PARAM_VALUE (PARAM_SRA_MAX_STRUCTURE_SIZE) #define SRA_FIELD_STRUCTURE_RATIO \ @@ -137,4 +139,8 @@ typedef enum compiler_param PARAM_VALUE (PARAM_INTEGER_SHARE_LIMIT) #define MAX_LAST_VALUE_RTL \ PARAM_VALUE (PARAM_MAX_LAST_VALUE_RTL) +#define MIN_VIRTUAL_MAPPINGS \ + PARAM_VALUE (PARAM_MIN_VIRTUAL_MAPPINGS) +#define VIRTUAL_MAPPINGS_TO_SYMS_RATIO \ + PARAM_VALUE (PARAM_VIRTUAL_MAPPINGS_TO_SYMS_RATIO) #endif /* ! GCC_PARAMS_H */ diff --git a/gcc/passes.c b/gcc/passes.c index 7bb661d0d0e..b51d7c7ddab 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -78,7 +78,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "opts.h" #include "coverage.h" #include "value-prof.h" -#include "alloc-pool.h" #include "tree-pass.h" #include "tree-dump.h" @@ -120,8 +119,7 @@ open_dump_file (enum tree_dump_index index, tree decl) timevar_push (TV_DUMP); - if (dump_file != NULL || dump_file_name != NULL) - abort (); + gcc_assert (!dump_file && !dump_file_name); dump_file_name = get_dump_file_name (index); initializing_dump = !dump_initialized_p (index); @@ -225,7 +223,7 @@ rest_of_decl_compilation (tree decl, (see gcc.c-torture/compile/920624-1.c) */ if ((at_end || !DECL_DEFER_OUTPUT (decl) - || (flag_unit_at_a_time && DECL_INITIAL (decl))) + || DECL_INITIAL (decl)) && !DECL_EXTERNAL (decl)) { if (flag_unit_at_a_time && !cgraph_global_info_ready @@ -252,7 +250,7 @@ rest_of_decl_compilation (tree decl, timevar_pop (TV_SYMOUT); } - /* Let cgraph know about the existance of variables. */ + /* Let cgraph know about the existence of variables. */ if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl)) cgraph_varpool_node (decl); } @@ -285,16 +283,14 @@ rest_of_handle_final (void) different from the DECL_NAME name used in the source file. */ x = DECL_RTL (current_function_decl); - if (!MEM_P (x)) - abort (); + gcc_assert (MEM_P (x)); x = XEXP (x, 0); - if (GET_CODE (x) != SYMBOL_REF) - abort (); + gcc_assert (GET_CODE (x) == SYMBOL_REF); fnname = XSTR (x, 0); assemble_start_function (current_function_decl, fnname); final_start_function (get_insns (), asm_out_file, optimize); - final (get_insns (), asm_out_file, optimize, 0); + final (get_insns (), asm_out_file, optimize); final_end_function (); #ifdef TARGET_UNWIND_INFO @@ -462,7 +458,7 @@ rest_of_handle_old_regalloc (void) timevar_push (TV_JUMP); rebuild_jump_labels (get_insns ()); - purge_all_dead_edges (0); + purge_all_dead_edges (); delete_unreachable_blocks (); timevar_pop (TV_JUMP); @@ -575,24 +571,38 @@ rest_of_handle_partition_blocks (void) static void rest_of_handle_sms (void) { + basic_block bb; + sbitmap blocks; + timevar_push (TV_SMS); open_dump_file (DFI_sms, current_function_decl); /* We want to be able to create new pseudos. */ no_new_pseudos = 0; + /* Collect loop information to be used in SMS. */ + cfg_layout_initialize (CLEANUP_UPDATE_LIFE); sms_schedule (dump_file); close_dump_file (DFI_sms, print_rtl, get_insns ()); - /* Update the life information, because we add pseudos. */ max_regno = max_reg_num (); allocate_reg_info (max_regno, FALSE, FALSE); - update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES, - (PROP_DEATH_NOTES - | PROP_KILL_DEAD_CODE - | PROP_SCAN_DEAD_CODE)); + blocks = sbitmap_alloc (last_basic_block); + sbitmap_ones (blocks); + update_life_info (blocks, UPDATE_LIFE_GLOBAL_RM_NOTES, + (PROP_DEATH_NOTES + | PROP_REG_INFO + | PROP_KILL_DEAD_CODE + | PROP_SCAN_DEAD_CODE)); + no_new_pseudos = 1; + /* Finalize layout changes. */ + FOR_EACH_BB (bb) + if (bb->next_bb != EXIT_BLOCK_PTR) + bb->rbi->next = bb->next_bb; + cfg_layout_finalize (); + free_dominance_info (CDI_DOMINATORS); ggc_collect (); timevar_pop (TV_SMS); } @@ -967,7 +977,7 @@ rest_of_handle_cse (void) tem = cse_main (get_insns (), max_reg_num (), dump_file); if (tem) rebuild_jump_labels (get_insns ()); - if (purge_all_dead_edges (0)) + if (purge_all_dead_edges ()) delete_unreachable_blocks (); delete_trivially_dead_insns (get_insns (), max_reg_num ()); @@ -1007,7 +1017,7 @@ rest_of_handle_cse2 (void) bypassed safely. */ cse_condition_code_reg (); - purge_all_dead_edges (0); + purge_all_dead_edges (); delete_trivially_dead_insns (get_insns (), max_reg_num ()); if (tem) @@ -1050,7 +1060,7 @@ rest_of_handle_gcse (void) timevar_push (TV_CSE); reg_scan (get_insns (), max_reg_num ()); tem2 = cse_main (get_insns (), max_reg_num (), dump_file); - purge_all_dead_edges (0); + purge_all_dead_edges (); delete_trivially_dead_insns (get_insns (), max_reg_num ()); timevar_pop (TV_CSE); cse_not_expected = !flag_rerun_cse_after_loop; @@ -1201,7 +1211,7 @@ rest_of_handle_branch_target_load_optimize (void) && flag_branch_target_load_optimize2 && !warned) { - warning ("branch target register load optimization is not intended " + warning (0, "branch target register load optimization is not intended " "to be run twice"); warned = 1; @@ -1398,7 +1408,7 @@ rest_of_handle_postreload (void) /* reload_cse_regs can eliminate potentially-trapping MEMs. Remove any EH edges associated with them. */ if (flag_non_call_exceptions) - purge_all_dead_edges (0); + purge_all_dead_edges (); close_dump_file (DFI_postreload, print_rtl_with_bb, get_insns ()); timevar_pop (TV_RELOAD_CSE_REGS); @@ -1547,15 +1557,6 @@ rest_of_compilation (void) /* Copy any shared structure that should not be shared. */ unshare_all_rtl (); -#ifdef SETJMP_VIA_SAVE_AREA - /* This must be performed before virtual register instantiation. - Please be aware that everything in the compiler that can look - at the RTL up to this point must understand that REG_SAVE_AREA - is just like a use of the REG contained inside. */ - if (current_function_calls_alloca) - optimize_save_area_alloca (); -#endif - /* Instantiate all virtual registers. */ instantiate_virtual_regs (); diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 2d9f3d2b7b5..54e353c6a23 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,3 +1,62 @@ +2005-05-19 Joseph S. Myers + + * de.po, zh_CN.po: Update. + +2005-05-08 Joseph S. Myers + + * de.po: Update. + +2005-05-07 Joseph S. Myers + + * de.po, zh_CN.po: Update. + +2005-05-05 Joseph S. Myers + + * zh_CN.po: Update. + +2005-05-03 Joseph S. Myers + + * zh_CN.po: Update. + +2005-05-03 Joseph S. Myers + + * de.po: Update. + +2005-05-01 Joseph S. Myers + + * zh_CN.po: New file. + +2005-04-27 Joseph S. Myers + + * be.po, ca.po, da.po, de.po, el.po, es.po, fr.po, ja.po, nl.po, + rw.po, sv.po, tr.po: Update. + +2005-04-24 Joseph S. Myers + + * de.po: Update. + +2005-04-20 Joseph S. Myers + + * de.po: Update. + +2005-04-17 Joseph S. Myers + + * de.po: Update. + +2004-04-06 Richard Sandiford + + PR other/20792 + * exgettext: Don't scan options.c. Scan .opt files for help strings. + * gcc.pot: Regenerate. + +2005-04-06 Joseph S. Myers + + * rw.po: New file. + +2005-03-29 Joseph S. Myers + + * de.po: Update. + 2005-03-06 Joseph S. Myers * es.po: Update. diff --git a/gcc/po/be.po b/gcc/po/be.po index fbacab02bd9..39bd7b014b7 100644 --- a/gcc/po/be.po +++ b/gcc/po/be.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: gcc 3.1\n" "Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n" -"POT-Creation-Date: 2005-02-25 23:36+0000\n" +"POT-Creation-Date: 2005-04-20 21:41-0700\n" "PO-Revision-Date: 2002-05-17 15:54+0200\n" "Last-Translator: Ales Nyakhaychyk \n" "Language-Team: Belarusian \n" @@ -58,93 +58,93 @@ msgstr "аргумент `__builtin_args_info' павінен быць канс msgid "invalid third argument to %<__builtin_prefetch%>; using zero" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:3806 +#: builtins.c:3802 #, fuzzy msgid "argument of %<__builtin_args_info%> must be constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:3812 +#: builtins.c:3808 #, fuzzy msgid "argument of %<__builtin_args_info%> out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: builtins.c:3818 +#: builtins.c:3814 #, fuzzy msgid "missing argument in %<__builtin_args_info%>" msgstr "прапушчан аргумент у `__builtin_args_info'" -#: builtins.c:3914 gimplify.c:1765 +#: builtins.c:3910 gimplify.c:1765 #, fuzzy msgid "too few arguments to function %" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: builtins.c:4077 +#: builtins.c:4073 msgid "first argument to % not of type %" msgstr "" #. Unfortunately, this is merely undefined, rather than a constraint #. violation, so we cannot make this an error. If this call is never #. executed, the program is still strictly conforming. -#: builtins.c:4091 +#: builtins.c:4087 msgid "%qT is promoted to %qT when passed through %<...%>" msgstr "" -#: builtins.c:4096 +#: builtins.c:4092 msgid "(so you should pass %qT not %qT to %)" msgstr "" #. We can, however, treat "undefined" any way we please. #. Call abort to encourage the user to fix the program. -#: builtins.c:4102 c-typeck.c:2023 +#: builtins.c:4098 c-typeck.c:2025 msgid "if this code is reached, the program will abort" msgstr "" -#: builtins.c:4220 +#: builtins.c:4216 msgid "invalid argument to %<__builtin_frame_address%>" msgstr "" -#: builtins.c:4222 +#: builtins.c:4218 msgid "invalid argument to %<__builtin_return_address%>" msgstr "" -#: builtins.c:4235 +#: builtins.c:4231 msgid "unsupported argument to %<__builtin_frame_address%>" msgstr "" -#: builtins.c:4237 +#: builtins.c:4233 msgid "unsupported argument to %<__builtin_return_address%>" msgstr "" -#: builtins.c:4340 +#: builtins.c:4336 #, fuzzy msgid "second argument to %<__builtin_expect%> must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: builtins.c:5590 +#: builtins.c:5586 msgid "%<__builtin_longjmp%> second argument must be 1" msgstr "" -#: builtins.c:5942 +#: builtins.c:5938 #, fuzzy msgid "target format does not support infinity" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: builtins.c:7699 builtins.c:7794 +#: builtins.c:7695 builtins.c:7790 #, fuzzy, c-format msgid "too few arguments to function %qs" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: builtins.c:7705 builtins.c:7800 +#: builtins.c:7701 builtins.c:7796 #, fuzzy, c-format msgid "too many arguments to function %qs" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: builtins.c:7711 builtins.c:7825 +#: builtins.c:7707 builtins.c:7821 #, fuzzy, c-format msgid "non-floating-point argument to function %qs" msgstr "вельмі шмат аргумэнтаў у функцыі `%s'" -#: builtins.c:8911 +#: builtins.c:8907 #, fuzzy msgid "% used in function with fixed args" msgstr "" @@ -153,12 +153,12 @@ msgstr "" #. Evidently an out of date version of ; can't validate #. va_start's second argument, but can still work as intended. -#: builtins.c:8918 +#: builtins.c:8914 #, fuzzy msgid "%<__builtin_next_arg%> called without an argument" msgstr "\"__buitin_next_arg\" выклікаецца без аргумента" -#: builtins.c:8933 +#: builtins.c:8929 msgid "% used with too many arguments" msgstr "" @@ -167,7 +167,7 @@ msgstr "" #. argument. We just warn and set the arg to be the last #. argument so that we will get wrong-code because of #. it. -#: builtins.c:8953 +#: builtins.c:8949 msgid "second parameter of % not last named argument" msgstr "" @@ -274,345 +274,345 @@ msgstr "" #. Common Ada/Pascal programmer's mistake. We always warn #. about this since it is so bad. -#: c-common.c:2371 +#: c-common.c:2375 msgid "the address of %qD, will always evaluate as %" msgstr "" -#: c-common.c:2467 +#: c-common.c:2471 msgid "suggest parentheses around assignment used as truth value" msgstr "" -#: c-common.c:2535 c-common.c:2575 +#: c-common.c:2539 c-common.c:2579 #, fuzzy msgid "invalid use of %" msgstr "нявернае выкарыстанне \"restict\"" -#: c-common.c:2791 +#: c-common.c:2795 #, fuzzy msgid "invalid application of % to a function type" msgstr "Нерэчаісны выбар \"%s\"" -#: c-common.c:2801 +#: c-common.c:2805 #, c-format msgid "invalid application of %qs to a void type" msgstr "" -#: c-common.c:2807 +#: c-common.c:2811 #, fuzzy msgid "invalid application of %qs to incomplete type %qT " msgstr "\"%s\" мае незавершаны тып" -#: c-common.c:2848 +#: c-common.c:2852 msgid "%<__alignof%> applied to a bit-field" msgstr "" -#: c-common.c:3315 +#: c-common.c:3319 #, fuzzy, c-format msgid "cannot disable built-in function %qs" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: c-common.c:3505 +#: c-common.c:3509 msgid "pointers are not permitted as case values" msgstr "" -#: c-common.c:3509 +#: c-common.c:3513 msgid "range expressions in switch statements are non-standard" msgstr "" -#: c-common.c:3534 +#: c-common.c:3538 msgid "empty range specified" msgstr "" -#: c-common.c:3593 +#: c-common.c:3597 msgid "duplicate (or overlapping) case value" msgstr "" -#: c-common.c:3594 +#: c-common.c:3598 msgid "%Jthis is the first entry overlapping that value" msgstr "" -#: c-common.c:3598 +#: c-common.c:3602 msgid "duplicate case value" msgstr "" -#: c-common.c:3599 +#: c-common.c:3603 #, fuzzy msgid "%Jpreviously used here" msgstr "папярэдняе вызначэньне" -#: c-common.c:3603 +#: c-common.c:3607 msgid "multiple default labels in one switch" msgstr "" -#: c-common.c:3604 +#: c-common.c:3608 msgid "%Jthis is the first default label" msgstr "" -#: c-common.c:3653 +#: c-common.c:3657 msgid "%Jcase value %qs not in enumerated type" msgstr "" -#: c-common.c:3656 +#: c-common.c:3660 msgid "%Jcase value %qs not in enumerated type %qT" msgstr "" -#: c-common.c:3723 +#: c-common.c:3727 msgid "%Hswitch missing default case" msgstr "" #. Warn if there are enumerators that don't correspond to #. case expressions. -#: c-common.c:3757 +#: c-common.c:3761 msgid "%Henumeration value %qE not handled in switch" msgstr "" -#: c-common.c:3784 +#: c-common.c:3788 #, fuzzy msgid "taking the address of a label is non-standard" msgstr "ISO C не дазваляе пусты ізыходны файл" -#: c-common.c:3953 c-common.c:3972 c-common.c:3990 c-common.c:4017 -#: c-common.c:4036 c-common.c:4059 c-common.c:4083 c-common.c:4109 -#: c-common.c:4143 c-common.c:4187 c-common.c:4215 c-common.c:4243 -#: c-common.c:4262 c-common.c:4593 c-common.c:4624 c-common.c:4716 -#: c-common.c:4783 c-common.c:4829 c-common.c:4887 c-common.c:4916 -#: c-common.c:5195 c-common.c:5218 c-common.c:5257 tree.c:3254 +#: c-common.c:3957 c-common.c:3976 c-common.c:3994 c-common.c:4021 +#: c-common.c:4040 c-common.c:4063 c-common.c:4087 c-common.c:4113 +#: c-common.c:4147 c-common.c:4191 c-common.c:4219 c-common.c:4247 +#: c-common.c:4266 c-common.c:4597 c-common.c:4628 c-common.c:4720 +#: c-common.c:4787 c-common.c:4833 c-common.c:4891 c-common.c:4920 +#: c-common.c:5199 c-common.c:5222 c-common.c:5261 tree.c:3258 #: config/darwin.c:1236 config/arm/arm.c:2701 config/arm/arm.c:2728 -#: config/avr/avr.c:4601 config/h8300/h8300.c:5779 config/h8300/h8300.c:5802 -#: config/i386/i386.c:1732 config/i386/i386.c:15625 config/ia64/ia64.c:526 +#: config/avr/avr.c:4657 config/h8300/h8300.c:5779 config/h8300/h8300.c:5802 +#: config/i386/i386.c:1732 config/i386/i386.c:15694 config/ia64/ia64.c:526 #: config/ip2k/ip2k.c:3164 config/m68hc11/m68hc11.c:1312 #: config/sh/symbian.c:414 config/sh/symbian.c:421 #, fuzzy, c-format msgid "%qs attribute ignored" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:4300 +#: c-common.c:4304 #, fuzzy, c-format msgid "unknown machine mode %qs" msgstr "невядомы рэжым машыны \"%s\"" -#: c-common.c:4320 +#: c-common.c:4324 msgid "specifying vector types with __attribute__ ((mode)) is deprecated" msgstr "" -#: c-common.c:4322 +#: c-common.c:4326 msgid "use __attribute__ ((vector_size)) instead" msgstr "" -#: c-common.c:4331 +#: c-common.c:4335 #, fuzzy, c-format msgid "unable to emulate %qs" msgstr "немагу адчыніць файл \"%s\"" -#: c-common.c:4341 +#: c-common.c:4345 #, fuzzy, c-format msgid "invalid pointer mode %qs" msgstr "Нерэчаісны выбар \"%s\"" -#: c-common.c:4356 +#: c-common.c:4360 #, fuzzy, c-format msgid "no data type for mode %qs" msgstr "няма тыпа дадзеных для рэжыма \"%s\"" -#: c-common.c:4366 +#: c-common.c:4370 #, c-format msgid "cannot use mode %qs for enumeral types" msgstr "" -#: c-common.c:4390 +#: c-common.c:4394 #, fuzzy, c-format msgid "mode %qs applied to inappropriate type" msgstr "\"%s\" мае незавершаны тып" -#: c-common.c:4421 +#: c-common.c:4425 #, fuzzy msgid "%Jsection attribute cannot be specified for local variables" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:4432 +#: c-common.c:4436 #, fuzzy msgid "%Jsection of %qD conflicts with previous declaration" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c-common.c:4441 +#: c-common.c:4445 #, fuzzy msgid "%Jsection attribute not allowed for %qD" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:4447 +#: c-common.c:4451 #, fuzzy msgid "%Jsection attributes are not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-common.c:4485 +#: c-common.c:4489 msgid "requested alignment is not a constant" msgstr "" -#: c-common.c:4490 +#: c-common.c:4494 msgid "requested alignment is not a power of 2" msgstr "" -#: c-common.c:4495 +#: c-common.c:4499 msgid "requested alignment is too large" msgstr "" -#: c-common.c:4521 +#: c-common.c:4525 msgid "%Jalignment may not be specified for %qD" msgstr "" -#: c-common.c:4559 +#: c-common.c:4563 msgid "%J%qD defined both normally and as an alias" msgstr "" -#: c-common.c:4575 +#: c-common.c:4579 #, fuzzy msgid "alias argument not a string" msgstr "аргумент для \"%s\" прапушчан" -#: c-common.c:4617 +#: c-common.c:4621 #, fuzzy, c-format msgid "%qs attribute ignored on non-class types" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:4630 +#: c-common.c:4634 #, fuzzy msgid "visibility argument not a string" msgstr "аргумент для \"%s\" прапушчан" -#: c-common.c:4642 +#: c-common.c:4646 #, fuzzy, c-format msgid "%qE attribute ignored on types" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:4657 +#: c-common.c:4661 msgid "visibility argument must be one of \"default\", \"hidden\", \"protected\" or \"internal\"" msgstr "" -#: c-common.c:4726 +#: c-common.c:4730 #, fuzzy msgid "tls_model argument not a string" msgstr "не хапае аргументаў у функцыі" -#: c-common.c:4735 +#: c-common.c:4739 msgid "tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\"" msgstr "" -#: c-common.c:4757 c-common.c:4803 +#: c-common.c:4761 c-common.c:4807 #, fuzzy msgid "%J%qE attribute applies only to functions" msgstr "\"%s\" звычайна функцыя" -#: c-common.c:4762 c-common.c:4808 +#: c-common.c:4766 c-common.c:4812 msgid "%Jcan%'t set %qE attribute after definition" msgstr "" -#: c-common.c:4884 +#: c-common.c:4888 #, fuzzy, c-format msgid "%qs attribute ignored for %qs" msgstr "\"%s\" атрыбут ігнарыруецца" -#: c-common.c:4945 +#: c-common.c:4949 #, fuzzy, c-format msgid "invalid vector type for attribute %qs" msgstr "нявернае выкарыстанне \"restict\"" -#: c-common.c:4954 +#: c-common.c:4958 msgid "number of components of the vector not a power of two" msgstr "" -#: c-common.c:4982 +#: c-common.c:4986 msgid "nonnull attribute without arguments on a non-prototype" msgstr "" -#: c-common.c:4997 +#: c-common.c:5001 #, c-format msgid "nonnull argument has invalid operand number (argument %lu)" msgstr "" -#: c-common.c:5016 +#: c-common.c:5020 #, c-format msgid "nonnull argument with out-of-range operand number (argument %lu, operand %lu)" msgstr "" -#: c-common.c:5024 +#: c-common.c:5028 #, c-format msgid "nonnull argument references non-pointer operand (argument %lu, operand %lu)" msgstr "" -#: c-common.c:5079 c-common.c:5116 +#: c-common.c:5083 c-common.c:5120 msgid "missing sentinel in function call" msgstr "" -#: c-common.c:5102 +#: c-common.c:5106 #, fuzzy msgid "not enough arguments to fit a sentinel" msgstr "не хапае аргументаў у функцыі" -#: c-common.c:5158 +#: c-common.c:5162 #, c-format msgid "null argument where non-null required (argument %lu)" msgstr "" -#: c-common.c:5229 +#: c-common.c:5233 msgid "cleanup argument not an identifier" msgstr "" -#: c-common.c:5236 +#: c-common.c:5240 #, fuzzy msgid "cleanup argument not a function" msgstr "вельмі шмат аргументаў у функцыі" -#: c-common.c:5274 +#: c-common.c:5278 #, c-format msgid "%qs attribute requires prototypes with named arguments" msgstr "" -#: c-common.c:5285 +#: c-common.c:5289 #, fuzzy, c-format msgid "%qs attribute only applies to variadic functions" msgstr "\"%s\" звычайна функцыя" -#: c-common.c:5298 +#: c-common.c:5302 #, fuzzy msgid "requested position is not an integer constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: c-common.c:5305 +#: c-common.c:5309 msgid "requested position is less than zero" msgstr "" -#: c-common.c:5611 +#: c-common.c:5615 msgid "%Hignoring return value of %qD, declared with attribute warn_unused_result" msgstr "" -#: c-common.c:5615 +#: c-common.c:5619 msgid "%Hignoring return value of function declared with attribute warn_unused_result" msgstr "" -#: c-common.c:5675 +#: c-common.c:5679 #, fuzzy, c-format msgid "attempt to take address of bit-field structure member %qs" msgstr "не магу атрымаць адрас бітавага поля \"%s\"" -#: c-common.c:5727 +#: c-common.c:5731 msgid "invalid lvalue in assignment" msgstr "" -#: c-common.c:5730 +#: c-common.c:5734 #, fuzzy msgid "invalid lvalue in increment" msgstr "Нерэчаісны выбар \"%s\"" -#: c-common.c:5733 +#: c-common.c:5737 #, fuzzy msgid "invalid lvalue in decrement" msgstr "Нерэчаісны выбар %s" -#: c-common.c:5736 +#: c-common.c:5740 msgid "invalid lvalue in unary %<&%>" msgstr "" -#: c-common.c:5739 +#: c-common.c:5743 msgid "invalid lvalue in asm statement" msgstr "" @@ -621,8 +621,8 @@ msgstr "" #. an unprototyped function, it is compile-time undefined; #. making it a constraint in that case was rejected in #. DR#252. -#: c-convert.c:83 c-typeck.c:1430 c-typeck.c:3526 cp/typeck.c:1351 -#: cp/typeck.c:5842 fortran/convert.c:89 treelang/tree-convert.c:79 +#: c-convert.c:83 c-typeck.c:1432 c-typeck.c:3528 cp/typeck.c:1367 +#: cp/typeck.c:5829 fortran/convert.c:89 treelang/tree-convert.c:79 msgid "void value not ignored as it ought to be" msgstr "" @@ -677,54 +677,54 @@ msgstr "" msgid "an argument type that has a default promotion can%'t match an empty parameter name list declaration" msgstr "" -#: c-decl.c:1065 +#: c-decl.c:1064 msgid "%Jprototype for %qD declares more arguments than previous old-style definition" msgstr "" -#: c-decl.c:1071 +#: c-decl.c:1070 msgid "%Jprototype for %qD declares fewer arguments than previous old-style definition" msgstr "" -#: c-decl.c:1080 +#: c-decl.c:1079 msgid "%Jprototype for %qD declares argument %d with incompatible type" msgstr "" #. If we get here, no errors were found, but do issue a warning #. for this poor-style construct. -#: c-decl.c:1093 +#: c-decl.c:1092 msgid "%Jprototype for %qD follows non-prototype definition" msgstr "" -#: c-decl.c:1108 +#: c-decl.c:1107 #, fuzzy msgid "%Jprevious definition of %qD was here" msgstr "папярэдняе вызначэньне" -#: c-decl.c:1110 +#: c-decl.c:1109 #, fuzzy msgid "%Jprevious implicit declaration of %qD was here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:1112 +#: c-decl.c:1111 #, fuzzy msgid "%Jprevious declaration of %qD was here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:1149 +#: c-decl.c:1148 msgid "%J%qD redeclared as different kind of symbol" msgstr "" -#: c-decl.c:1154 +#: c-decl.c:1153 #, fuzzy msgid "%Jbuilt-in function %qD declared as non-function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:1157 c-decl.c:1273 c-decl.c:1879 +#: c-decl.c:1156 c-decl.c:1272 c-decl.c:1878 #, fuzzy msgid "%Jdeclaration of %qD shadows a built-in function" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: c-decl.c:1166 +#: c-decl.c:1165 #, fuzzy msgid "%Jredeclaration of enumerator %qD" msgstr "абвяшчэньне шаблёну `%#D'" @@ -732,161 +732,161 @@ msgstr "абвяшчэньне шаблёну `%#D'" #. If types don't match for a built-in, throw away the #. built-in. No point in calling locate_old_decl here, it #. won't print anything. -#: c-decl.c:1187 +#: c-decl.c:1186 #, fuzzy msgid "%Jconflicting types for built-in function %qD" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:1211 c-decl.c:1224 c-decl.c:1234 +#: c-decl.c:1210 c-decl.c:1223 c-decl.c:1233 msgid "%Jconflicting types for %qD" msgstr "" -#: c-decl.c:1232 +#: c-decl.c:1231 msgid "%J conflicting type qualifiers for %qD" msgstr "" #. Allow OLDDECL to continue in use. -#: c-decl.c:1249 +#: c-decl.c:1248 #, fuzzy msgid "%Jredefinition of typedef %qD" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:1291 c-decl.c:1301 c-decl.c:1314 c-decl.c:1396 +#: c-decl.c:1290 c-decl.c:1300 c-decl.c:1313 c-decl.c:1395 #, fuzzy msgid "%Jredefinition of %qD" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:1353 c-decl.c:1434 +#: c-decl.c:1352 c-decl.c:1433 msgid "%Jstatic declaration of %qD follows non-static declaration" msgstr "" -#: c-decl.c:1363 c-decl.c:1370 c-decl.c:1423 c-decl.c:1431 +#: c-decl.c:1362 c-decl.c:1369 c-decl.c:1422 c-decl.c:1430 msgid "%Jnon-static declaration of %qD follows static declaration" msgstr "" -#: c-decl.c:1383 +#: c-decl.c:1382 msgid "%Jthread-local declaration of %qD follows non-thread-local declaration" msgstr "" -#: c-decl.c:1386 +#: c-decl.c:1385 msgid "%Jnon-thread-local declaration of %qD follows thread-local declaration" msgstr "" -#: c-decl.c:1416 +#: c-decl.c:1415 #, fuzzy msgid "%Jextern declaration of %qD follows declaration with no linkage" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:1452 +#: c-decl.c:1451 msgid "%Jdeclaration of %qD with no linkage follows extern declaration" msgstr "" -#: c-decl.c:1458 +#: c-decl.c:1457 #, fuzzy msgid "%Jredeclaration of %qD with no linkage" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:1472 +#: c-decl.c:1471 msgid "%Jredeclaration of %qD with different visibility (old visibility preserved)" msgstr "" -#: c-decl.c:1483 +#: c-decl.c:1482 #, fuzzy msgid "%Jinline declaration of %qD follows declaration with attribute noinline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:1490 +#: c-decl.c:1489 #, fuzzy msgid "%Jdeclaration of %qD with attribute noinline follows inline declaration " msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:1505 +#: c-decl.c:1504 msgid "%J%qD declared inline after being called" msgstr "" -#: c-decl.c:1511 +#: c-decl.c:1510 #, fuzzy msgid "%J%qD declared inline after its definition" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:1531 +#: c-decl.c:1530 #, fuzzy msgid "%Jredefinition of parameter %qD" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:1555 +#: c-decl.c:1554 #, fuzzy msgid "%Jredundant redeclaration of %qD" msgstr "Нерэчаіснае абвяшчэнне" -#: c-decl.c:1866 +#: c-decl.c:1865 #, fuzzy msgid "%Jdeclaration of %qD shadows previous non-variable" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c-decl.c:1871 +#: c-decl.c:1870 msgid "%Jdeclaration of %qD shadows a parameter" msgstr "" -#: c-decl.c:1874 +#: c-decl.c:1873 msgid "%Jdeclaration of %qD shadows a global declaration" msgstr "" -#: c-decl.c:1884 +#: c-decl.c:1883 #, fuzzy msgid "%Jdeclaration of %qD shadows a previous local" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: c-decl.c:1887 cp/name-lookup.c:942 cp/name-lookup.c:973 +#: c-decl.c:1886 cp/name-lookup.c:942 cp/name-lookup.c:973 #: cp/name-lookup.c:981 #, fuzzy msgid "%Jshadowed declaration is here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2041 +#: c-decl.c:2040 #, fuzzy msgid "nested extern declaration of %qD" msgstr "пустое абвяшчэнне" -#: c-decl.c:2201 +#: c-decl.c:2200 #, fuzzy, c-format msgid "implicit declaration of function %qE" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2262 +#: c-decl.c:2261 #, fuzzy msgid "incompatible implicit declaration of built-in function %qD" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2271 +#: c-decl.c:2270 #, fuzzy msgid "incompatible implicit declaration of function %qD" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:2324 +#: c-decl.c:2323 #, fuzzy, c-format msgid "%qE undeclared here (not in a function)" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:2329 +#: c-decl.c:2328 #, fuzzy, c-format msgid "%qE undeclared (first use in this function)" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:2333 +#: c-decl.c:2332 msgid "(Each undeclared identifier is reported only once" msgstr "(Аб кожным неабвешчаным ідэнтыфікатары паведамляецца" -#: c-decl.c:2334 +#: c-decl.c:2333 msgid "for each function it appears in.)" msgstr "адзін раз для кожнай функцыі, дзе ён з'яўляецца.)" -#: c-decl.c:2372 +#: c-decl.c:2371 #, c-format msgid "label %qs referenced outside of any function" msgstr "" -#: c-decl.c:2415 +#: c-decl.c:2414 #, fuzzy, c-format msgid "duplicate label declaration %qs" msgstr "паўторнае абвяшчэньне адмеціны `%s'" @@ -896,98 +896,102 @@ msgstr "паўторнае абвяшчэньне адмеціны `%s'" msgid "%Hduplicate label %qD" msgstr "паўтарэнне \"%s\"" -#: c-decl.c:2472 +#: c-decl.c:2460 +msgid "%Jjump into statement expression" +msgstr "" + +#: c-decl.c:2474 msgid "%Htraditional C lacks a separate namespace for labels, identifier %qs conflicts" msgstr "" -#: c-decl.c:2538 +#: c-decl.c:2545 msgid "%H%qs defined as wrong kind of tag" msgstr "" -#: c-decl.c:2761 +#: c-decl.c:2768 msgid "unnamed struct/union that defines no instances" msgstr "" -#: c-decl.c:2769 +#: c-decl.c:2776 msgid "empty declaration with storage class specifier does not redeclare tag" msgstr "" -#: c-decl.c:2780 +#: c-decl.c:2787 msgid "empty declaration with type qualifier does not redeclare tag" msgstr "" -#: c-decl.c:2801 c-decl.c:2808 +#: c-decl.c:2808 c-decl.c:2815 #, fuzzy msgid "useless type name in empty declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:2816 +#: c-decl.c:2823 #, fuzzy msgid "% in empty declaration" msgstr "пустое абвяшчэньне" -#: c-decl.c:2822 +#: c-decl.c:2829 msgid "% in file-scope empty declaration" msgstr "" -#: c-decl.c:2828 +#: c-decl.c:2835 msgid "% in file-scope empty declaration" msgstr "" -#: c-decl.c:2834 +#: c-decl.c:2841 #, fuzzy msgid "useless storage class specifier in empty declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:2840 +#: c-decl.c:2847 msgid "useless %<__thread%> in empty declaration" msgstr "" -#: c-decl.c:2848 +#: c-decl.c:2855 #, fuzzy msgid "useless type qualifier in empty declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: c-decl.c:2855 c-parse.y:781 c-parse.y:783 objc/objc-parse.y:818 +#: c-decl.c:2862 c-parse.y:781 c-parse.y:783 objc/objc-parse.y:818 #: objc/objc-parse.y:820 msgid "empty declaration" msgstr "пустое абвяшчэньне" -#: c-decl.c:2921 +#: c-decl.c:2928 #, fuzzy msgid "ISO C90 does not support % or type qualifiers in parameter array declarators" msgstr "ISO C89 не падтрымлівае \"long long\"" -#: c-decl.c:2924 +#: c-decl.c:2931 #, fuzzy msgid "ISO C90 does not support %<[*]%> array declarators" msgstr "ISO C89 не падтрымлівае \"long long\"" -#: c-decl.c:2927 +#: c-decl.c:2934 #, fuzzy msgid "GCC does not yet properly implement %<[*]%> array declarators" msgstr "ISO C89 не падтрымлівае \"long long\"" -#: c-decl.c:2946 +#: c-decl.c:2953 msgid "static or type qualifiers in abstract declarator" msgstr "" -#: c-decl.c:3005 +#: c-decl.c:3012 #, fuzzy msgid "%J%qD is usually a function" msgstr "`%s' - звычайна функцыя" -#: c-decl.c:3014 cp/decl.c:3617 cp/decl2.c:850 +#: c-decl.c:3021 cp/decl.c:3624 cp/decl2.c:850 #, fuzzy msgid "typedef %qD is initialized (use __typeof__ instead)" msgstr "параметр \"%s\" ініцыялізаваны" -#: c-decl.c:3019 +#: c-decl.c:3026 msgid "function %qD is initialized like a variable" msgstr "" #. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE. -#: c-decl.c:3025 +#: c-decl.c:3032 #, fuzzy msgid "parameter %qD is initialized" msgstr "параметр \"%s\" ініцыялізаваны" @@ -996,795 +1000,795 @@ msgstr "параметр \"%s\" ініцыялізаваны" #. of VLAs themselves count as VLAs, it does not make #. sense to permit them to be initialized given that #. ordinary VLAs may not be initialized. -#: c-decl.c:3044 c-decl.c:3059 c-typeck.c:4380 +#: c-decl.c:3051 c-decl.c:3066 c-typeck.c:4382 msgid "variable-sized object may not be initialized" msgstr "" -#: c-decl.c:3050 +#: c-decl.c:3057 #, fuzzy msgid "variable %qD has initializer but incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:3126 c-decl.c:5741 cp/decl.c:3657 cp/decl.c:9941 +#: c-decl.c:3133 c-decl.c:5690 cp/decl.c:3663 cp/decl.c:9883 #, fuzzy msgid "%Jinline function %qD given attribute noinline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:3194 +#: c-decl.c:3202 msgid "%Jinitializer fails to determine size of %qD" msgstr "" -#: c-decl.c:3199 +#: c-decl.c:3207 #, fuzzy msgid "%Jarray size missing in %qD" msgstr "прапушчан памер масіва ў `%D'" -#: c-decl.c:3215 +#: c-decl.c:3218 #, fuzzy msgid "%Jzero or negative size array %qD" msgstr "нулявы памер масіва `%D'" -#: c-decl.c:3241 varasm.c:1556 +#: c-decl.c:3247 varasm.c:1556 msgid "%Jstorage size of %qD isn%'t known" msgstr "" -#: c-decl.c:3251 +#: c-decl.c:3257 #, fuzzy msgid "%Jstorage size of %qD isn%'t constant" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:3299 +#: c-decl.c:3304 msgid "%Jignoring asm-specifier for non-static local variable %qD" msgstr "" -#: c-decl.c:3329 fortran/f95-lang.c:646 +#: c-decl.c:3334 fortran/f95-lang.c:646 msgid "cannot put object with volatile field into register" msgstr "" -#: c-decl.c:3463 +#: c-decl.c:3468 msgid "ISO C forbids forward parameter declarations" msgstr "" -#: c-decl.c:3648 +#: c-decl.c:3588 msgid "" msgstr "" -#: c-decl.c:3657 +#: c-decl.c:3598 #, fuzzy, c-format msgid "bit-field %qs width not an integer constant" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: c-decl.c:3665 +#: c-decl.c:3606 #, c-format msgid "negative width in bit-field %qs" msgstr "" -#: c-decl.c:3670 +#: c-decl.c:3611 #, c-format msgid "zero width for bit-field %qs" msgstr "" -#: c-decl.c:3680 +#: c-decl.c:3621 #, fuzzy, c-format msgid "bit-field %qs has invalid type" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: c-decl.c:3689 +#: c-decl.c:3630 #, c-format msgid "type of bit-field %qs is a GCC extension" msgstr "" -#: c-decl.c:3698 +#: c-decl.c:3639 #, c-format msgid "width of %qs exceeds its type" msgstr "" -#: c-decl.c:3711 +#: c-decl.c:3652 #, c-format msgid "%qs is narrower than values of its type" msgstr "" -#: c-decl.c:3836 +#: c-decl.c:3777 msgid "type defaults to % in declaration of %qs" msgstr "" -#: c-decl.c:3864 +#: c-decl.c:3805 #, fuzzy msgid "duplicate %" msgstr "паўтарэнне \"const\"" -#: c-decl.c:3866 +#: c-decl.c:3807 #, fuzzy msgid "duplicate %" msgstr "паўтарэнне \"restrict\"" -#: c-decl.c:3868 +#: c-decl.c:3809 #, fuzzy msgid "duplicate %" msgstr "паўтарэнне \"volatile\"" -#: c-decl.c:3887 +#: c-decl.c:3828 msgid "function definition declared %" msgstr "" -#: c-decl.c:3889 +#: c-decl.c:3830 #, fuzzy msgid "function definition declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: c-decl.c:3891 +#: c-decl.c:3832 msgid "function definition declared %" msgstr "" -#: c-decl.c:3893 +#: c-decl.c:3834 #, fuzzy msgid "function definition declared %<__thread%>" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: c-decl.c:3909 +#: c-decl.c:3850 #, c-format msgid "storage class specified for structure field %qs" msgstr "" -#: c-decl.c:3913 cp/decl.c:7053 +#: c-decl.c:3854 cp/decl.c:6994 #, c-format msgid "storage class specified for parameter %qs" msgstr "" -#: c-decl.c:3916 cp/decl.c:7055 +#: c-decl.c:3857 cp/decl.c:6996 msgid "storage class specified for typename" msgstr "" -#: c-decl.c:3929 cp/decl.c:7072 +#: c-decl.c:3870 cp/decl.c:7013 msgid "%qs initialized and declared %" msgstr "" -#: c-decl.c:3931 cp/decl.c:7075 +#: c-decl.c:3872 cp/decl.c:7016 msgid "%qs has both % and initializer" msgstr "" -#: c-decl.c:3936 +#: c-decl.c:3877 msgid "file-scope declaration of %qs specifies %" msgstr "" -#: c-decl.c:3938 +#: c-decl.c:3879 msgid "file-scope declaration of %qs specifies %" msgstr "" -#: c-decl.c:3943 cp/decl.c:7079 +#: c-decl.c:3884 cp/decl.c:7020 msgid "nested function %qs declared %" msgstr "" -#: c-decl.c:3946 cp/decl.c:7089 +#: c-decl.c:3887 cp/decl.c:7030 msgid "function-scope %qs implicitly auto and declared %<__thread%>" msgstr "" #. Only the innermost declarator (making a parameter be of #. array type which is converted to pointer type) #. may have static or type qualifiers. -#: c-decl.c:3993 c-decl.c:4183 +#: c-decl.c:3934 c-decl.c:4124 msgid "static or type qualifiers in non-parameter array declarator" msgstr "" -#: c-decl.c:4039 +#: c-decl.c:3980 #, c-format msgid "declaration of %qs as array of voids" msgstr "" -#: c-decl.c:4045 +#: c-decl.c:3986 #, c-format msgid "declaration of %qs as array of functions" msgstr "" -#: c-decl.c:4050 +#: c-decl.c:3991 #, fuzzy msgid "invalid use of structure with flexible array member" msgstr "нявернае выкарыстанне \"restict\"" -#: c-decl.c:4070 +#: c-decl.c:4011 #, fuzzy, c-format msgid "size of array %qs has non-integer type" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:4075 +#: c-decl.c:4016 #, fuzzy, c-format msgid "ISO C forbids zero-size array %qs" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-decl.c:4082 +#: c-decl.c:4023 #, fuzzy, c-format msgid "size of array %qs is negative" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:4096 +#: c-decl.c:4037 msgid "ISO C90 forbids array %qs whose size can%'t be evaluated" msgstr "" -#: c-decl.c:4100 +#: c-decl.c:4041 #, fuzzy, c-format msgid "ISO C90 forbids variable-size array %qs" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-decl.c:4139 c-decl.c:4303 cp/decl.c:7509 +#: c-decl.c:4080 c-decl.c:4244 cp/decl.c:7451 #, fuzzy, c-format msgid "size of array %qs is too large" msgstr "памер масіва \"%s\" вельмі вялікі" -#: c-decl.c:4150 +#: c-decl.c:4091 #, fuzzy msgid "ISO C90 does not support flexible array members" msgstr "ISO C89 не падтрымлівае комлексныя тыпы" -#: c-decl.c:4160 +#: c-decl.c:4101 msgid "array type has incomplete element type" msgstr "" -#: c-decl.c:4215 cp/decl.c:7179 +#: c-decl.c:4156 cp/decl.c:7121 #, fuzzy, c-format msgid "%qs declared as function returning a function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:4220 cp/decl.c:7184 +#: c-decl.c:4161 cp/decl.c:7126 #, c-format msgid "%qs declared as function returning an array" msgstr "" -#: c-decl.c:4240 +#: c-decl.c:4181 #, fuzzy msgid "function definition has qualified void return type" msgstr "функцыя не вяртае тып string" -#: c-decl.c:4242 +#: c-decl.c:4183 msgid "type qualifiers ignored on function return type" msgstr "" -#: c-decl.c:4271 c-decl.c:4316 c-decl.c:4410 c-decl.c:4501 +#: c-decl.c:4212 c-decl.c:4257 c-decl.c:4351 c-decl.c:4442 msgid "ISO C forbids qualified function types" msgstr "" -#: c-decl.c:4324 +#: c-decl.c:4265 msgid "%Jtypedef %qD declared %" msgstr "" -#: c-decl.c:4354 +#: c-decl.c:4295 msgid "ISO C forbids const or volatile function types" msgstr "" -#: c-decl.c:4374 +#: c-decl.c:4315 #, fuzzy, c-format msgid "variable or field %qs declared void" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:4403 +#: c-decl.c:4344 msgid "attributes in parameter array declarator ignored" msgstr "" -#: c-decl.c:4438 +#: c-decl.c:4379 #, fuzzy msgid "%Jparameter %qD declared %" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:4451 +#: c-decl.c:4392 #, fuzzy, c-format msgid "field %qs declared as a function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:4457 +#: c-decl.c:4398 #, fuzzy, c-format msgid "field %qs has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:4471 c-decl.c:4483 c-decl.c:4487 +#: c-decl.c:4412 c-decl.c:4424 c-decl.c:4428 #, fuzzy, c-format msgid "invalid storage class for function %qs" msgstr "Нерэчаісны выбар \"%s\"" -#: c-decl.c:4507 +#: c-decl.c:4448 msgid "% function returns non-void value" msgstr "" -#: c-decl.c:4535 +#: c-decl.c:4476 #, fuzzy msgid "cannot inline function %" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: c-decl.c:4582 +#: c-decl.c:4523 msgid "variable previously declared % redeclared %" msgstr "" -#: c-decl.c:4591 +#: c-decl.c:4532 msgid "%Jvariable %qD declared %" msgstr "" #. A mere warning is sure to result in improper semantics #. at runtime. Don't bother to allow this to compile. -#: c-decl.c:4622 cp/decl.c:5920 +#: c-decl.c:4563 cp/decl.c:5861 #, fuzzy msgid "thread-local storage not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: c-decl.c:4684 c-decl.c:5778 +#: c-decl.c:4625 c-decl.c:5728 msgid "function declaration isn%'t a prototype" msgstr "" -#: c-decl.c:4692 +#: c-decl.c:4633 msgid "parameter names (without types) in function declaration" msgstr "" -#: c-decl.c:4725 +#: c-decl.c:4666 #, fuzzy msgid "%Jparameter %u (%qD) has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:4728 +#: c-decl.c:4669 #, fuzzy msgid "%Jparameter %u has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:4737 +#: c-decl.c:4678 #, fuzzy msgid "%Jparameter %u (%qD) has void type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:4740 +#: c-decl.c:4681 #, fuzzy msgid "%Jparameter %u has void type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:4797 +#: c-decl.c:4738 msgid "% as only parameter may not be qualified" msgstr "" -#: c-decl.c:4801 c-decl.c:4836 +#: c-decl.c:4742 c-decl.c:4777 #, fuzzy msgid "% must be the only parameter" msgstr "нявернае выкарыстанне \"restict\"" -#: c-decl.c:4829 +#: c-decl.c:4770 msgid "%Jparameter %qD has just a forward declaration" msgstr "" #. The %s will be one of 'struct', 'union', or 'enum'. -#: c-decl.c:4875 +#: c-decl.c:4816 msgid "%<%s %E%> declared inside parameter list" msgstr "" #. The %s will be one of 'struct', 'union', or 'enum'. -#: c-decl.c:4879 +#: c-decl.c:4820 #, c-format msgid "anonymous %s declared inside parameter list" msgstr "" -#: c-decl.c:4884 +#: c-decl.c:4825 msgid "its scope is only this definition or declaration, which is probably not what you want" msgstr "" -#: c-decl.c:5017 +#: c-decl.c:4958 #, fuzzy msgid "redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:5019 +#: c-decl.c:4960 #, fuzzy msgid "redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:5024 +#: c-decl.c:4965 #, fuzzy msgid "nested redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:5027 +#: c-decl.c:4968 #, fuzzy msgid "nested redefinition of %" msgstr "перанакіраванне stdout: %s" -#: c-decl.c:5099 cp/decl.c:3414 +#: c-decl.c:5040 cp/decl.c:3421 msgid "declaration does not declare anything" msgstr "" -#: c-decl.c:5103 +#: c-decl.c:5044 #, fuzzy msgid "ISO C doesn%'t support unnamed structs/unions" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: c-decl.c:5146 c-decl.c:5162 +#: c-decl.c:5087 c-decl.c:5103 #, fuzzy msgid "%Jduplicate member %qD" msgstr "паўтарэнне \"%s\"" -#: c-decl.c:5201 +#: c-decl.c:5142 msgid "union has no named members" msgstr "" -#: c-decl.c:5203 +#: c-decl.c:5144 msgid "union has no members" msgstr "" -#: c-decl.c:5208 +#: c-decl.c:5149 msgid "struct has no named members" msgstr "" -#: c-decl.c:5210 +#: c-decl.c:5151 msgid "struct has no members" msgstr "" -#: c-decl.c:5267 +#: c-decl.c:5208 msgid "%Jflexible array member in union" msgstr "" -#: c-decl.c:5272 +#: c-decl.c:5213 msgid "%Jflexible array member not at end of struct" msgstr "" -#: c-decl.c:5277 +#: c-decl.c:5218 msgid "%Jflexible array member in otherwise empty struct" msgstr "" -#: c-decl.c:5284 +#: c-decl.c:5225 #, fuzzy msgid "%Jinvalid use of structure with flexible array member" msgstr "нявернае выкарыстанне \"restict\"" -#: c-decl.c:5392 +#: c-decl.c:5333 msgid "union cannot be made transparent" msgstr "" -#: c-decl.c:5463 +#: c-decl.c:5404 #, fuzzy msgid "nested redefinition of %" msgstr "перанакіраванне stdout: %s" #. This enum is a named one that has been declared already. -#: c-decl.c:5470 +#: c-decl.c:5411 #, fuzzy msgid "redeclaration of %" msgstr "абвяшчэньне шаблёну `%#D'" -#: c-decl.c:5533 +#: c-decl.c:5474 msgid "enumeration values exceed range of largest integer" msgstr "" -#: c-decl.c:5550 +#: c-decl.c:5491 msgid "specified mode too small for enumeral values" msgstr "" -#: c-decl.c:5649 +#: c-decl.c:5591 #, fuzzy, c-format msgid "enumerator value for %qE is not an integer constant" msgstr "памер масіва \"%s\" адмоўны" -#: c-decl.c:5666 +#: c-decl.c:5608 msgid "overflow in enumeration values" msgstr "" -#: c-decl.c:5671 +#: c-decl.c:5613 msgid "ISO C restricts enumerator values to range of %" msgstr "" -#: c-decl.c:5747 +#: c-decl.c:5696 msgid "return type is an incomplete type" msgstr "" -#: c-decl.c:5755 +#: c-decl.c:5704 #, fuzzy msgid "return type defaults to %" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: c-decl.c:5784 +#: c-decl.c:5735 #, fuzzy msgid "%Jno previous prototype for %qD" msgstr "няма папярэдняга прататыпа для \"%s\"" -#: c-decl.c:5790 +#: c-decl.c:5743 #, fuzzy msgid "%J%qD was used with no prototype before its definition" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:5797 +#: c-decl.c:5750 #, fuzzy msgid "%Jno previous declaration for %qD" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: c-decl.c:5803 +#: c-decl.c:5758 #, fuzzy msgid "%J%qD was used with no declaration before its definition" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: c-decl.c:5836 c-decl.c:6328 +#: c-decl.c:5791 c-decl.c:6285 #, fuzzy msgid "%Jreturn type of %qD is not %" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: c-decl.c:5851 +#: c-decl.c:5806 #, fuzzy msgid "%Jfirst argument of %qD should be %" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: c-decl.c:5860 +#: c-decl.c:5815 #, fuzzy msgid "%Jsecond argument of %qD should be %" msgstr "другім аргументам \"%s\" павінен быць \"char **\"" -#: c-decl.c:5869 +#: c-decl.c:5824 #, fuzzy msgid "%Jthird argument of %qD should probably be %" msgstr "другім аргументам \"%s\" павінен быць \"char **\"" -#: c-decl.c:5879 +#: c-decl.c:5834 msgid "%J%qD takes only zero or two arguments" msgstr "" -#: c-decl.c:5882 +#: c-decl.c:5837 #, fuzzy msgid "%J%qD is normally a non-static function" msgstr "`%s' - звычайна функцыя" -#: c-decl.c:5928 +#: c-decl.c:5883 msgid "%Jold-style parameter declarations in prototyped function definition" msgstr "" -#: c-decl.c:5941 +#: c-decl.c:5896 msgid "%Jtraditional C rejects ISO C style function definitions" msgstr "" -#: c-decl.c:5953 +#: c-decl.c:5908 #, fuzzy msgid "%Jparameter name omitted" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:5993 +#: c-decl.c:5948 msgid "%Jold-style function definition" msgstr "" -#: c-decl.c:6001 +#: c-decl.c:5956 msgid "%Jparameter name missing from parameter list" msgstr "" -#: c-decl.c:6012 +#: c-decl.c:5967 msgid "%J%qD declared as a non-parameter" msgstr "" -#: c-decl.c:6017 +#: c-decl.c:5972 #, fuzzy msgid "%Jmultiple parameters named %qD" msgstr "невыкарыстаемы параметр \"%s\"" -#: c-decl.c:6025 +#: c-decl.c:5980 #, fuzzy msgid "%Jparameter %qD declared with void type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: c-decl.c:6040 c-decl.c:6042 +#: c-decl.c:5995 c-decl.c:5997 msgid "%Jtype of %qD defaults to %" msgstr "" -#: c-decl.c:6061 +#: c-decl.c:6016 #, fuzzy msgid "%Jparameter %qD has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-decl.c:6067 +#: c-decl.c:6022 msgid "%Jdeclaration for parameter %qD but no such parameter" msgstr "" -#: c-decl.c:6117 +#: c-decl.c:6072 #, fuzzy msgid "number of arguments doesn%'t match prototype" msgstr "памылковая колькасьць аргументаў, зададзеных для атрыбута `%s'" -#: c-decl.c:6118 c-decl.c:6148 c-decl.c:6155 +#: c-decl.c:6073 c-decl.c:6103 c-decl.c:6110 #, fuzzy msgid "%Hprototype declaration" msgstr "пустое абвяшчэньне" -#: c-decl.c:6146 +#: c-decl.c:6101 msgid "promoted argument %qD doesn%'t match prototype" msgstr "" -#: c-decl.c:6154 +#: c-decl.c:6109 msgid "argument %qD doesn%'t match prototype" msgstr "" -#: c-decl.c:6361 cp/decl.c:10702 +#: c-decl.c:6318 cp/decl.c:10649 msgid "no return statement in function returning non-void" msgstr "" -#: c-decl.c:6368 +#: c-decl.c:6325 msgid "this function may return with or without a value" msgstr "" #. If we get here, declarations have been used in a for loop without #. the C99 for loop scope. This doesn't make much sense, so don't #. allow it. -#: c-decl.c:6461 +#: c-decl.c:6418 msgid "% loop initial declaration used outside C99 mode" msgstr "" -#: c-decl.c:6490 +#: c-decl.c:6447 msgid "%Jdeclaration of static variable %qD in % loop initial declaration" msgstr "" -#: c-decl.c:6493 +#: c-decl.c:6450 msgid "%Jdeclaration of % variable %qD in % loop initial declaration" msgstr "" -#: c-decl.c:6498 +#: c-decl.c:6455 msgid "% declared in % loop initial declaration" msgstr "" -#: c-decl.c:6502 +#: c-decl.c:6459 msgid "% declared in % loop initial declaration" msgstr "" -#: c-decl.c:6506 +#: c-decl.c:6463 msgid "% declared in % loop initial declaration" msgstr "" -#: c-decl.c:6510 +#: c-decl.c:6467 msgid "%Jdeclaration of non-variable %qD in % loop initial declaration" msgstr "" -#: c-decl.c:6799 c-decl.c:6948 c-decl.c:7159 cp/decl.c:6747 +#: c-decl.c:6756 c-decl.c:6905 c-decl.c:7116 cp/decl.c:6688 #, fuzzy, c-format msgid "duplicate %qs" msgstr "паўтарэньне `%s'" -#: c-decl.c:6820 c-decl.c:6957 c-decl.c:7060 +#: c-decl.c:6777 c-decl.c:6914 c-decl.c:7017 msgid "two or more data types in declaration specifiers" msgstr "" -#: c-decl.c:6832 cp/decl.c:6723 +#: c-decl.c:6789 cp/decl.c:6664 #, fuzzy msgid "% is too long for GCC" msgstr "`long long long' - вельмі доўга для GCC" -#: c-decl.c:6839 c-decl.c:7031 +#: c-decl.c:6796 c-decl.c:6988 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6845 +#: c-decl.c:6802 #, fuzzy msgid "ISO C90 does not support %" msgstr "ISO C89 не падтрымлівае `long long'" -#: c-decl.c:6850 c-decl.c:6870 +#: c-decl.c:6807 c-decl.c:6827 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6853 c-decl.c:6964 +#: c-decl.c:6810 c-decl.c:6921 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6856 c-decl.c:6983 +#: c-decl.c:6813 c-decl.c:6940 msgid "both % and %<_Bool%> in declaration specifiers" msgstr "" -#: c-decl.c:6859 c-decl.c:7002 +#: c-decl.c:6816 c-decl.c:6959 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6862 c-decl.c:7015 +#: c-decl.c:6819 c-decl.c:6972 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6873 c-decl.c:6967 +#: c-decl.c:6830 c-decl.c:6924 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6876 c-decl.c:6986 +#: c-decl.c:6833 c-decl.c:6943 msgid "both % and %<_Bool%> in declaration specifiers" msgstr "" -#: c-decl.c:6879 c-decl.c:7005 +#: c-decl.c:6836 c-decl.c:6962 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6882 c-decl.c:7018 +#: c-decl.c:6839 c-decl.c:6975 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6885 c-decl.c:7034 +#: c-decl.c:6842 c-decl.c:6991 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6893 c-decl.c:6913 +#: c-decl.c:6850 c-decl.c:6870 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6896 c-decl.c:6970 +#: c-decl.c:6853 c-decl.c:6927 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6899 c-decl.c:6989 +#: c-decl.c:6856 c-decl.c:6946 msgid "both % and %<_Bool%> in declaration specifiers" msgstr "" -#: c-decl.c:6902 c-decl.c:7021 +#: c-decl.c:6859 c-decl.c:6978 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6905 c-decl.c:7037 +#: c-decl.c:6862 c-decl.c:6994 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6916 c-decl.c:6973 +#: c-decl.c:6873 c-decl.c:6930 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6919 c-decl.c:6992 +#: c-decl.c:6876 c-decl.c:6949 msgid "both % and %<_Bool%> in declaration specifiers" msgstr "" -#: c-decl.c:6922 c-decl.c:7024 +#: c-decl.c:6879 c-decl.c:6981 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6925 c-decl.c:7040 +#: c-decl.c:6882 c-decl.c:6997 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6933 +#: c-decl.c:6890 #, fuzzy msgid "ISO C90 does not support complex types" msgstr "ISO C89 не падтрымлівае комлексныя тыпы" -#: c-decl.c:6935 c-decl.c:6976 +#: c-decl.c:6892 c-decl.c:6933 msgid "both % and % in declaration specifiers" msgstr "" -#: c-decl.c:6938 c-decl.c:6995 +#: c-decl.c:6895 c-decl.c:6952 msgid "both % and %<_Bool%> in declaration specifiers" msgstr "" -#: c-decl.c:7077 +#: c-decl.c:7034 #, c-format msgid "%qs fails to be a typedef or built in type" msgstr "" -#: c-decl.c:7109 +#: c-decl.c:7066 #, fuzzy, c-format msgid "%qs is not at beginning of declaration" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: c-decl.c:7124 +#: c-decl.c:7081 msgid "%<__thread%> used with %" msgstr "" -#: c-decl.c:7126 +#: c-decl.c:7083 msgid "%<__thread%> used with %" msgstr "" -#: c-decl.c:7128 +#: c-decl.c:7085 msgid "%<__thread%> used with %" msgstr "" -#: c-decl.c:7139 cp/parser.c:7221 +#: c-decl.c:7096 cp/parser.c:7247 msgid "%<__thread%> before %" msgstr "" -#: c-decl.c:7148 cp/parser.c:7211 +#: c-decl.c:7105 cp/parser.c:7237 msgid "%<__thread%> before %" msgstr "" -#: c-decl.c:7164 +#: c-decl.c:7121 msgid "multiple storage classes in declaration specifiers" msgstr "" -#: c-decl.c:7171 +#: c-decl.c:7128 msgid "%<__thread%> used with %qs" msgstr "" -#: c-decl.c:7225 +#: c-decl.c:7182 #, fuzzy msgid "ISO C does not support plain % meaning %" msgstr "ISO C не падтрымлівае просты \"complex\" у значэнні \"double complex\"" -#: c-decl.c:7270 c-decl.c:7296 +#: c-decl.c:7227 c-decl.c:7253 msgid "ISO C does not support complex integer types" msgstr "ISO C не падтрымлівае комлексныя цэлалікавыя тыпы" -#: c-decl.c:7371 toplev.c:848 +#: c-decl.c:7328 toplev.c:850 #, fuzzy msgid "%J%qF used but never defined" msgstr "адмеціна `%D' выкарыстоўвываецца, але ня вызначана" @@ -2310,7 +2314,7 @@ msgstr "" msgid "statement with no effect" msgstr "" -#: c-gimplify.c:315 c-typeck.c:6878 cp/parser.c:6542 +#: c-gimplify.c:315 c-typeck.c:6914 cp/parser.c:6568 msgid "break statement not within loop or switch" msgstr "" @@ -2324,7 +2328,6 @@ msgid "ignoring duplicate directory \"%s\"\n" msgstr "" #: c-incpath.c:73 -#, c-format msgid " as it is a non-system directory that duplicates a system directory\n" msgstr "" @@ -2334,17 +2337,14 @@ msgid "ignoring nonexistent directory \"%s\"\n" msgstr "" #: c-incpath.c:286 -#, c-format msgid "#include \"...\" search starts here:\n" msgstr "" #: c-incpath.c:290 -#, c-format msgid "#include <...> search starts here:\n" msgstr "" #: c-incpath.c:295 -#, c-format msgid "End of search list.\n" msgstr "" @@ -2515,34 +2515,34 @@ msgstr "" msgid "YYDEBUG was not defined at build time, -dy ignored" msgstr "" -#: c-opts.c:1127 +#: c-opts.c:1132 #, c-format msgid "opening dependency file %s: %m" msgstr "" -#: c-opts.c:1137 +#: c-opts.c:1142 #, c-format msgid "closing dependency file %s: %m" msgstr "" -#: c-opts.c:1140 +#: c-opts.c:1145 #, fuzzy, c-format msgid "when writing output to %s: %m" msgstr "памылка запісу ў %s" -#: c-opts.c:1220 +#: c-opts.c:1225 msgid "to generate dependencies you must specify either -M or -MM" msgstr "" -#: c-opts.c:1287 +#: c-opts.c:1292 msgid "" msgstr "" -#: c-opts.c:1302 +#: c-opts.c:1307 msgid "" msgstr "" -#: c-opts.c:1385 +#: c-opts.c:1390 msgid "too late for # directive to set debug directory" msgstr "" @@ -2554,16 +2554,13 @@ msgstr "" #. between diagnostics with "syntax error" in them, and diagnostics #. with "parse error" in them. It's okay to give them both the same #. translation. -#: c-parse.y:54 c-parse.c:5385 c-parse.y:2955 gengtype-yacc.c:1606 -#: java/parse-scan.c:3107 java/parse-scan.y:1370 java/parse.c:6210 -#: java/parse.y:16419 objc/objc-parse.y:53 objc/objc-parse.c:6464 -#: objc/objc-parse.y:3545 +#: c-parse.y:54 c-parse.y:2955 java/parse-scan.y:1370 java/parse.y:16419 +#: objc/objc-parse.y:53 objc/objc-parse.y:3545 msgid "syntax error" msgstr "сінтаксічная памылка" -#: c-parse.c:2157 c-parse.y:2959 gengtype-yacc.c:560 java/parse-scan.c:1934 -#: java/parse-scan.y:1374 java/parse.c:2933 java/parse.y:16423 -#: objc/objc-parse.c:2678 objc/objc-parse.y:3549 +#: /usr/share/bison/bison.simple:179 c-parse.y:2959 java/parse-scan.y:1374 +#: java/parse.y:16423 objc/objc-parse.y:3549 #, fuzzy msgid "syntax error: cannot back up" msgstr "сінтаксічная памылка" @@ -2642,7 +2639,7 @@ msgstr "" msgid "ISO C forbids forward references to % types" msgstr "" -#: c-parse.y:1649 cp/parser.c:9985 objc/objc-parse.y:1698 +#: c-parse.y:1649 cp/parser.c:10015 objc/objc-parse.y:1698 msgid "comma at end of enumerator list" msgstr "" @@ -2688,14 +2685,17 @@ msgstr "" msgid "ISO C requires a named argument before %<...%>" msgstr "" -#: c-parse.c:5381 c-parse.y:2957 gengtype-yacc.c:1602 java/parse-scan.c:3103 -#: java/parse-scan.y:1372 java/parse.c:6206 java/parse.y:16421 -#: objc/objc-parse.c:6460 objc/objc-parse.y:3547 -msgid "syntax error; also virtual memory exhausted" +#: /usr/share/bison/bison.simple:795 c-parse.y:2958 java/parse-scan.y:1373 +#: java/parse.y:16422 objc/objc-parse.y:3548 +msgid "parse error; also virtual memory exhausted" msgstr "" -#: c-parse.c:5506 gengtype-yacc.c:1727 java/parse-scan.c:3228 -#: java/parse.c:6331 objc/objc-parse.c:6585 +#: /usr/share/bison/bison.simple:799 c-parse.y:2956 java/parse-scan.y:1371 +#: java/parse.y:16420 objc/objc-parse.y:3546 +msgid "parse error" +msgstr "граматычная памылка" + +#: /usr/share/bison/bison.simple:924 msgid "parser stack overflow" msgstr "" @@ -2704,14 +2704,9 @@ msgstr "" msgid "syntax error at %qs token" msgstr "сінтаксічная памылка" -#: c-parse.y:2956 java/parse-scan.y:1371 java/parse.y:16420 -#: objc/objc-parse.y:3546 -msgid "parse error" -msgstr "граматычная памылка" - -#: c-parse.y:2958 java/parse-scan.y:1373 java/parse.y:16422 -#: objc/objc-parse.y:3548 -msgid "parse error; also virtual memory exhausted" +#: c-parse.y:2957 java/parse-scan.y:1372 java/parse.y:16421 +#: objc/objc-parse.y:3547 +msgid "syntax error; also virtual memory exhausted" msgstr "" #: c-parse.y:2960 java/parse-scan.y:1375 java/parse.y:16424 @@ -2913,99 +2908,99 @@ msgstr "" msgid "junk at end of %<#pragma GCC visibility%>" msgstr "" -#: c-typeck.c:139 +#: c-typeck.c:141 #, fuzzy, c-format msgid "%qs has an incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: c-typeck.c:161 cp/call.c:2679 +#: c-typeck.c:163 cp/call.c:2679 msgid "invalid use of void expression" msgstr "" -#: c-typeck.c:169 +#: c-typeck.c:171 msgid "invalid use of flexible array member" msgstr "" -#: c-typeck.c:175 +#: c-typeck.c:177 msgid "invalid use of array with unspecified bounds" msgstr "" -#: c-typeck.c:183 +#: c-typeck.c:185 #, fuzzy msgid "invalid use of undefined type %<%s %s%>" msgstr "нявернае выкарыстанне \"restict\"" #. If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. -#: c-typeck.c:187 +#: c-typeck.c:189 #, fuzzy, c-format msgid "invalid use of incomplete typedef %qs" msgstr "нявернае выкарыстанне \"restict\"" -#: c-typeck.c:394 c-typeck.c:419 +#: c-typeck.c:396 c-typeck.c:421 msgid "function types not truly compatible in ISO C" msgstr "" -#: c-typeck.c:803 +#: c-typeck.c:805 msgid "types are not quite compatible" msgstr "" -#: c-typeck.c:1045 +#: c-typeck.c:1047 msgid "function return types not compatible due to %" msgstr "" -#: c-typeck.c:1204 c-typeck.c:2445 +#: c-typeck.c:1206 c-typeck.c:2447 msgid "arithmetic on pointer to an incomplete type" msgstr "" -#: c-typeck.c:1559 +#: c-typeck.c:1561 msgid "%qT has no member named %qs" msgstr "" -#: c-typeck.c:1595 +#: c-typeck.c:1597 #, c-format msgid "request for member %qs in something not a structure or union" msgstr "" -#: c-typeck.c:1629 +#: c-typeck.c:1631 msgid "dereferencing pointer to incomplete type" msgstr "" -#: c-typeck.c:1633 +#: c-typeck.c:1635 msgid "dereferencing % pointer" msgstr "" -#: c-typeck.c:1650 cp/typeck.c:2109 +#: c-typeck.c:1652 cp/typeck.c:2125 #, fuzzy, c-format msgid "invalid type argument of %qs" msgstr "нявернае выкарыстанне \"restict\"" -#: c-typeck.c:1678 cp/typeck.c:2260 +#: c-typeck.c:1680 cp/typeck.c:2276 msgid "subscripted value is neither array nor pointer" msgstr "" -#: c-typeck.c:1689 cp/typeck.c:2179 cp/typeck.c:2265 +#: c-typeck.c:1691 cp/typeck.c:2195 cp/typeck.c:2281 msgid "array subscript is not an integer" msgstr "" -#: c-typeck.c:1695 +#: c-typeck.c:1697 msgid "subscripted value is pointer to function" msgstr "" -#: c-typeck.c:1708 cp/typeck.c:2175 +#: c-typeck.c:1710 cp/typeck.c:2191 msgid "array subscript has type %" msgstr "" -#: c-typeck.c:1748 +#: c-typeck.c:1750 #, fuzzy msgid "ISO C forbids subscripting % array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-typeck.c:1750 +#: c-typeck.c:1752 #, fuzzy msgid "ISO C90 forbids subscripting non-lvalue array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-typeck.c:1987 +#: c-typeck.c:1989 #, fuzzy, c-format msgid "called object %qE is not a function" msgstr "`%D' - гэта ня функцыя," @@ -3013,766 +3008,778 @@ msgstr "`%D' - гэта ня функцыя," #. This situation leads to run-time undefined behavior. We can't, #. therefore, simply error unless we can prove that all possible #. executions of the program must execute the code. -#: c-typeck.c:2019 +#: c-typeck.c:2021 msgid "function called through a non-compatible type" msgstr "" -#: c-typeck.c:2066 c-typeck.c:4327 c-typeck.c:4329 c-typeck.c:4337 -#: c-typeck.c:4362 c-typeck.c:5744 +#: c-typeck.c:2068 c-typeck.c:4329 c-typeck.c:4331 c-typeck.c:4339 +#: c-typeck.c:4364 c-typeck.c:5746 msgid "initializer element is not constant" msgstr "" -#: c-typeck.c:2127 +#: c-typeck.c:2129 #, fuzzy, c-format msgid "too many arguments to function %qE" msgstr "вельмі шмат аргументаў у функцыі" -#: c-typeck.c:2154 +#: c-typeck.c:2156 #, c-format msgid "type of formal parameter %d is incomplete" msgstr "" -#: c-typeck.c:2167 +#: c-typeck.c:2169 #, c-format msgid "passing argument %d of %qE as integer rather than floating due to prototype" msgstr "" -#: c-typeck.c:2172 +#: c-typeck.c:2174 #, c-format msgid "passing argument %d of %qE as integer rather than complex due to prototype" msgstr "" -#: c-typeck.c:2177 +#: c-typeck.c:2179 #, c-format msgid "passing argument %d of %qE as complex rather than floating due to prototype" msgstr "" -#: c-typeck.c:2182 +#: c-typeck.c:2184 #, c-format msgid "passing argument %d of %qE as floating rather than integer due to prototype" msgstr "" -#: c-typeck.c:2187 +#: c-typeck.c:2189 #, c-format msgid "passing argument %d of %qE as complex rather than integer due to prototype" msgstr "" -#: c-typeck.c:2192 +#: c-typeck.c:2194 #, c-format msgid "passing argument %d of %qE as floating rather than complex due to prototype" msgstr "" -#: c-typeck.c:2204 +#: c-typeck.c:2206 msgid "passing argument %d of %qE as % rather than % due to prototype" msgstr "" -#: c-typeck.c:2224 +#: c-typeck.c:2226 #, c-format msgid "passing argument %d of %qE with different width due to prototype" msgstr "" -#: c-typeck.c:2251 +#: c-typeck.c:2253 #, c-format msgid "passing argument %d of %qE as unsigned due to prototype" msgstr "" -#: c-typeck.c:2254 +#: c-typeck.c:2256 #, c-format msgid "passing argument %d of %qE as signed due to prototype" msgstr "" -#: c-typeck.c:2285 +#: c-typeck.c:2287 #, fuzzy, c-format msgid "too few arguments to function %qE" msgstr "не хапае аргументаў у функцыі" -#: c-typeck.c:2321 +#: c-typeck.c:2323 msgid "suggest parentheses around + or - inside shift" msgstr "" -#: c-typeck.c:2328 +#: c-typeck.c:2330 msgid "suggest parentheses around && within ||" msgstr "" -#: c-typeck.c:2337 +#: c-typeck.c:2339 msgid "suggest parentheses around arithmetic in operand of |" msgstr "" -#: c-typeck.c:2341 +#: c-typeck.c:2343 msgid "suggest parentheses around comparison in operand of |" msgstr "" -#: c-typeck.c:2350 +#: c-typeck.c:2352 msgid "suggest parentheses around arithmetic in operand of ^" msgstr "" -#: c-typeck.c:2354 +#: c-typeck.c:2356 msgid "suggest parentheses around comparison in operand of ^" msgstr "" -#: c-typeck.c:2361 +#: c-typeck.c:2363 msgid "suggest parentheses around + or - in operand of &" msgstr "" -#: c-typeck.c:2365 +#: c-typeck.c:2367 msgid "suggest parentheses around comparison in operand of &" msgstr "" -#: c-typeck.c:2371 +#: c-typeck.c:2373 msgid "comparisons like X<=Y<=Z do not have their mathematical meaning" msgstr "" -#: c-typeck.c:2397 +#: c-typeck.c:2399 msgid "pointer of type % used in subtraction" msgstr "" -#: c-typeck.c:2399 +#: c-typeck.c:2401 msgid "pointer to a function used in subtraction" msgstr "" -#: c-typeck.c:2488 +#: c-typeck.c:2490 msgid "wrong type argument to unary plus" msgstr "" -#: c-typeck.c:2501 +#: c-typeck.c:2503 msgid "wrong type argument to unary minus" msgstr "" -#: c-typeck.c:2518 +#: c-typeck.c:2520 #, fuzzy msgid "ISO C does not support %<~%> for complex conjugation" msgstr "ISO C89 не падтрымлівае комлексныя тыпы" -#: c-typeck.c:2524 +#: c-typeck.c:2526 msgid "wrong type argument to bit-complement" msgstr "" -#: c-typeck.c:2532 +#: c-typeck.c:2534 msgid "wrong type argument to abs" msgstr "" -#: c-typeck.c:2544 +#: c-typeck.c:2546 msgid "wrong type argument to conjugation" msgstr "" -#: c-typeck.c:2558 +#: c-typeck.c:2560 msgid "wrong type argument to unary exclamation mark" msgstr "" -#: c-typeck.c:2595 +#: c-typeck.c:2597 #, fuzzy msgid "ISO C does not support %<++%> and %<--%> on complex types" msgstr "ISO C не падтрымлівае \"++\" і \"--\" для тыпу complex" -#: c-typeck.c:2611 c-typeck.c:2643 +#: c-typeck.c:2613 c-typeck.c:2645 #, fuzzy msgid "wrong type argument to increment" msgstr "не хапае аргументаў у функцыі" -#: c-typeck.c:2613 c-typeck.c:2645 +#: c-typeck.c:2615 c-typeck.c:2647 msgid "wrong type argument to decrement" msgstr "" -#: c-typeck.c:2634 +#: c-typeck.c:2636 msgid "increment of pointer to unknown structure" msgstr "" -#: c-typeck.c:2636 +#: c-typeck.c:2638 msgid "decrement of pointer to unknown structure" msgstr "" -#: c-typeck.c:2806 +#: c-typeck.c:2808 #, c-format msgid "assignment of read-only member %qs" msgstr "" -#: c-typeck.c:2807 +#: c-typeck.c:2809 #, c-format msgid "increment of read-only member %qs" msgstr "" -#: c-typeck.c:2808 +#: c-typeck.c:2810 #, c-format msgid "decrement of read-only member %qs" msgstr "" -#: c-typeck.c:2812 +#: c-typeck.c:2814 #, c-format msgid "assignment of read-only variable %qs" msgstr "" -#: c-typeck.c:2813 +#: c-typeck.c:2815 #, c-format msgid "increment of read-only variable %qs" msgstr "" -#: c-typeck.c:2814 +#: c-typeck.c:2816 #, c-format msgid "decrement of read-only variable %qs" msgstr "" -#: c-typeck.c:2817 +#: c-typeck.c:2819 msgid "assignment of read-only location" msgstr "" -#: c-typeck.c:2818 +#: c-typeck.c:2820 msgid "increment of read-only location" msgstr "" -#: c-typeck.c:2819 +#: c-typeck.c:2821 msgid "decrement of read-only location" msgstr "" -#: c-typeck.c:2838 +#: c-typeck.c:2840 #, fuzzy msgid "cannot take address of bit-field %qD" msgstr "не магу атрымаць адрас бітавага поля \"%s\"" -#: c-typeck.c:2866 +#: c-typeck.c:2868 msgid "global register variable %qD used in nested function" msgstr "" -#: c-typeck.c:2869 +#: c-typeck.c:2871 msgid "register variable %qD used in nested function" msgstr "" -#: c-typeck.c:2874 +#: c-typeck.c:2876 msgid "address of global register variable %qD requested" msgstr "" -#: c-typeck.c:2876 +#: c-typeck.c:2878 msgid "address of register variable %qD requested" msgstr "" -#: c-typeck.c:2924 +#: c-typeck.c:2926 msgid "non-lvalue array in conditional expression" msgstr "" -#: c-typeck.c:2968 +#: c-typeck.c:2970 msgid "signed and unsigned type in conditional expression" msgstr "" -#: c-typeck.c:2975 +#: c-typeck.c:2977 msgid "ISO C forbids conditional expr with only one void side" msgstr "" -#: c-typeck.c:2991 c-typeck.c:2999 +#: c-typeck.c:2993 c-typeck.c:3001 msgid "ISO C forbids conditional expr between % and function pointer" msgstr "" -#: c-typeck.c:3006 +#: c-typeck.c:3008 msgid "pointer type mismatch in conditional expression" msgstr "" -#: c-typeck.c:3013 c-typeck.c:3023 +#: c-typeck.c:3015 c-typeck.c:3025 msgid "pointer/integer type mismatch in conditional expression" msgstr "" -#: c-typeck.c:3037 +#: c-typeck.c:3039 msgid "type mismatch in conditional expression" msgstr "" -#: c-typeck.c:3076 +#: c-typeck.c:3078 msgid "left-hand operand of comma expression has no effect" msgstr "" -#: c-typeck.c:3109 +#: c-typeck.c:3111 msgid "cast specifies array type" msgstr "" -#: c-typeck.c:3115 +#: c-typeck.c:3117 msgid "cast specifies function type" msgstr "" -#: c-typeck.c:3125 +#: c-typeck.c:3127 msgid "ISO C forbids casting nonscalar to the same type" msgstr "" -#: c-typeck.c:3143 +#: c-typeck.c:3145 msgid "ISO C forbids casts to union type" msgstr "" -#: c-typeck.c:3152 +#: c-typeck.c:3154 msgid "cast to union type from type not present in union" msgstr "" -#: c-typeck.c:3203 +#: c-typeck.c:3205 msgid "cast adds new qualifiers to function type" msgstr "" #. There are qualifiers present in IN_OTYPE that are not #. present in IN_TYPE. -#: c-typeck.c:3208 +#: c-typeck.c:3210 msgid "cast discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3223 +#: c-typeck.c:3225 msgid "cast increases required alignment of target type" msgstr "" -#: c-typeck.c:3229 +#: c-typeck.c:3231 msgid "cast from pointer to integer of different size" msgstr "" -#: c-typeck.c:3234 +#: c-typeck.c:3236 msgid "cast from function call of type %qT to non-matching type %qT" msgstr "" -#: c-typeck.c:3242 +#: c-typeck.c:3244 msgid "cast to pointer from integer of different size" msgstr "" -#: c-typeck.c:3254 +#: c-typeck.c:3256 msgid "type-punning to incomplete type might break strict-aliasing rules" msgstr "" -#: c-typeck.c:3261 +#: c-typeck.c:3263 msgid "dereferencing type-punned pointer will break strict-aliasing rules" msgstr "" -#: c-typeck.c:3264 +#: c-typeck.c:3266 msgid "dereferencing type-punned pointer might break strict-aliasing rules" msgstr "" -#: c-typeck.c:3276 +#: c-typeck.c:3278 msgid "ISO C forbids conversion of function pointer to object pointer type" msgstr "" -#: c-typeck.c:3285 +#: c-typeck.c:3287 msgid "ISO C forbids conversion of object pointer to function pointer type" msgstr "" -#: c-typeck.c:3537 +#: c-typeck.c:3539 msgid "cannot pass rvalue to reference parameter" msgstr "" -#: c-typeck.c:3646 c-typeck.c:3761 +#: c-typeck.c:3648 c-typeck.c:3763 #, c-format msgid "passing argument %d of %qE makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:3649 c-typeck.c:3764 +#: c-typeck.c:3651 c-typeck.c:3766 msgid "assignment makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:3652 c-typeck.c:3766 +#: c-typeck.c:3654 c-typeck.c:3768 msgid "initialization makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:3655 c-typeck.c:3768 +#: c-typeck.c:3657 c-typeck.c:3770 msgid "return makes qualified function pointer from unqualified" msgstr "" -#: c-typeck.c:3659 c-typeck.c:3729 +#: c-typeck.c:3661 c-typeck.c:3731 #, c-format msgid "passing argument %d of %qE discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3661 c-typeck.c:3731 +#: c-typeck.c:3663 c-typeck.c:3733 msgid "assignment discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3663 c-typeck.c:3733 +#: c-typeck.c:3665 c-typeck.c:3735 msgid "initialization discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3665 c-typeck.c:3735 +#: c-typeck.c:3667 c-typeck.c:3737 msgid "return discards qualifiers from pointer target type" msgstr "" -#: c-typeck.c:3670 +#: c-typeck.c:3672 msgid "ISO C prohibits argument conversion to union type" msgstr "" -#: c-typeck.c:3714 +#: c-typeck.c:3716 msgid "ISO C forbids passing argument %d of %qE between function pointer and %" msgstr "" -#: c-typeck.c:3717 +#: c-typeck.c:3719 msgid "ISO C forbids assignment between function pointer and %" msgstr "" -#: c-typeck.c:3719 +#: c-typeck.c:3721 msgid "ISO C forbids initialization between function pointer and %" msgstr "" -#: c-typeck.c:3721 +#: c-typeck.c:3723 msgid "ISO C forbids return between function pointer and %" msgstr "" -#: c-typeck.c:3744 +#: c-typeck.c:3746 #, c-format msgid "pointer targets in passing argument %d of %qE differ in signedness" msgstr "" -#: c-typeck.c:3746 +#: c-typeck.c:3748 msgid "pointer targets in assignment differ in signedness" msgstr "" -#: c-typeck.c:3748 +#: c-typeck.c:3750 msgid "pointer targets in initialization differ in signedness" msgstr "" -#: c-typeck.c:3750 +#: c-typeck.c:3752 msgid "pointer targets in return differ in signedness" msgstr "" -#: c-typeck.c:3773 +#: c-typeck.c:3775 #, c-format msgid "passing argument %d of %qE from incompatible pointer type" msgstr "" -#: c-typeck.c:3775 +#: c-typeck.c:3777 msgid "assignment from incompatible pointer type" msgstr "" -#: c-typeck.c:3776 +#: c-typeck.c:3778 msgid "initialization from incompatible pointer type" msgstr "" -#: c-typeck.c:3778 +#: c-typeck.c:3780 msgid "return from incompatible pointer type" msgstr "" #. ??? This should not be an error when inlining calls to #. unprototyped functions. -#: c-typeck.c:3785 c-typeck.c:4287 cp/typeck.c:1377 +#: c-typeck.c:3787 c-typeck.c:4289 cp/typeck.c:1393 msgid "invalid use of non-lvalue array" msgstr "" -#: c-typeck.c:3799 +#: c-typeck.c:3801 #, c-format msgid "passing argument %d of %qE makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:3801 +#: c-typeck.c:3803 msgid "assignment makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:3803 +#: c-typeck.c:3805 msgid "initialization makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:3805 +#: c-typeck.c:3807 msgid "return makes pointer from integer without a cast" msgstr "" -#: c-typeck.c:3812 +#: c-typeck.c:3814 #, c-format msgid "passing argument %d of %qE makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:3814 +#: c-typeck.c:3816 msgid "assignment makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:3816 +#: c-typeck.c:3818 msgid "initialization makes integer from pointer without a cast" msgstr "" -#: c-typeck.c:3818 +#: c-typeck.c:3820 msgid "return makes integer from pointer without a cast" msgstr "" #. ??? This should not be an error when inlining calls to #. unprototyped functions. -#: c-typeck.c:3831 +#: c-typeck.c:3833 #, c-format msgid "incompatible type for argument %d of %qE" msgstr "" -#: c-typeck.c:3834 +#: c-typeck.c:3836 msgid "incompatible types in assignment" msgstr "" -#: c-typeck.c:3837 +#: c-typeck.c:3839 #, fuzzy msgid "incompatible types in initialization" msgstr "нерэчаісны ініцыялізатар" -#: c-typeck.c:3840 +#: c-typeck.c:3842 msgid "incompatible types in return" msgstr "" -#: c-typeck.c:3921 +#: c-typeck.c:3923 msgid "traditional C rejects automatic aggregate initialization" msgstr "" #. Use `%s' to print the string in case there are any escape #. characters in the message. -#: c-typeck.c:4086 c-typeck.c:4101 c-typeck.c:4116 final.c:2856 final.c:2858 +#: c-typeck.c:4088 c-typeck.c:4103 c-typeck.c:4118 final.c:2862 final.c:2864 #: gcc.c:4639 rtl-error.c:113 toplev.c:610 config/cris/cris.c:578 -#: cp/parser.c:1884 cp/typeck.c:4131 java/expr.c:405 java/parse.y:5020 +#: cp/parser.c:1894 cp/typeck.c:4158 java/expr.c:409 java/parse.y:5020 #: java/verify.c:1553 java/verify.c:1554 java/verify.c:1573 #, c-format msgid "%s" msgstr "" -#: c-typeck.c:4089 c-typeck.c:4104 c-typeck.c:4119 +#: c-typeck.c:4091 c-typeck.c:4106 c-typeck.c:4121 #, fuzzy, c-format msgid "(near initialization for %qs)" msgstr "ініцыялізацыя" -#: c-typeck.c:4133 +#: c-typeck.c:4135 msgid "array initialized from parenthesized string constant" msgstr "" -#: c-typeck.c:4197 cp/typeck2.c:703 +#: c-typeck.c:4199 cp/typeck2.c:703 msgid "char-array initialized from wide string" msgstr "" -#: c-typeck.c:4202 +#: c-typeck.c:4204 msgid "wchar_t-array initialized from non-wide string" msgstr "" -#: c-typeck.c:4220 cp/typeck2.c:725 +#: c-typeck.c:4222 cp/typeck2.c:725 msgid "initializer-string for array of chars is too long" msgstr "" -#: c-typeck.c:4226 +#: c-typeck.c:4228 msgid "array of inappropriate type initialized from string constant" msgstr "" -#: c-typeck.c:4310 +#: c-typeck.c:4312 msgid "array initialized from non-constant array expression" msgstr "" -#: c-typeck.c:4369 c-typeck.c:5748 +#: c-typeck.c:4371 c-typeck.c:5750 msgid "initializer element is not computable at load time" msgstr "" -#: c-typeck.c:4384 cp/typeck2.c:804 +#: c-typeck.c:4386 cp/typeck2.c:804 msgid "invalid initializer" msgstr "нерэчаісны ініцыялізатар" -#: c-typeck.c:4651 cp/decl.c:4451 +#: c-typeck.c:4653 cp/decl.c:4450 msgid "opaque vector types cannot be initialized" msgstr "" -#: c-typeck.c:4850 +#: c-typeck.c:4852 msgid "extra brace group at end of initializer" msgstr "" -#: c-typeck.c:4870 cp/decl.c:4366 +#: c-typeck.c:4872 cp/decl.c:4365 msgid "missing braces around initializer" msgstr "" -#: c-typeck.c:4931 +#: c-typeck.c:4933 msgid "braces around scalar initializer" msgstr "" -#: c-typeck.c:4988 +#: c-typeck.c:4990 msgid "initialization of flexible array member in a nested context" msgstr "" -#: c-typeck.c:4990 +#: c-typeck.c:4992 msgid "initialization of a flexible array member" msgstr "" -#: c-typeck.c:5017 +#: c-typeck.c:5019 msgid "missing initializer" msgstr "прапушчан ініцыялізатар" -#: c-typeck.c:5039 +#: c-typeck.c:5041 msgid "empty scalar initializer" msgstr "" -#: c-typeck.c:5044 +#: c-typeck.c:5046 msgid "extra elements in scalar initializer" msgstr "" -#: c-typeck.c:5148 c-typeck.c:5223 +#: c-typeck.c:5150 c-typeck.c:5225 msgid "array index in non-array initializer" msgstr "" -#: c-typeck.c:5153 c-typeck.c:5276 +#: c-typeck.c:5155 c-typeck.c:5278 msgid "field name not in record or union initializer" msgstr "" -#: c-typeck.c:5199 +#: c-typeck.c:5201 #, fuzzy msgid "array index in initializer not of integer type" msgstr "\"%s\" мае незавершаны тып" -#: c-typeck.c:5219 c-typeck.c:5221 +#: c-typeck.c:5221 c-typeck.c:5223 msgid "nonconstant array index in initializer" msgstr "" -#: c-typeck.c:5225 c-typeck.c:5228 +#: c-typeck.c:5227 c-typeck.c:5230 msgid "array index in initializer exceeds array bounds" msgstr "" -#: c-typeck.c:5239 +#: c-typeck.c:5241 msgid "empty index range in initializer" msgstr "" -#: c-typeck.c:5248 +#: c-typeck.c:5250 msgid "array index range in initializer exceeds array bounds" msgstr "" -#: c-typeck.c:5288 +#: c-typeck.c:5290 #, c-format msgid "unknown field %qs specified in initializer" msgstr "" -#: c-typeck.c:5324 c-typeck.c:5345 c-typeck.c:5811 +#: c-typeck.c:5326 c-typeck.c:5347 c-typeck.c:5813 msgid "initialized field with side-effects overwritten" msgstr "" -#: c-typeck.c:6020 +#: c-typeck.c:6022 msgid "excess elements in char array initializer" msgstr "" -#: c-typeck.c:6027 c-typeck.c:6073 +#: c-typeck.c:6029 c-typeck.c:6075 msgid "excess elements in struct initializer" msgstr "" -#: c-typeck.c:6088 +#: c-typeck.c:6090 msgid "non-static initialization of a flexible array member" msgstr "" -#: c-typeck.c:6156 +#: c-typeck.c:6158 msgid "excess elements in union initializer" msgstr "" -#: c-typeck.c:6178 +#: c-typeck.c:6180 msgid "traditional C rejects initialization of unions" msgstr "" -#: c-typeck.c:6242 +#: c-typeck.c:6244 msgid "excess elements in array initializer" msgstr "" -#: c-typeck.c:6272 +#: c-typeck.c:6274 msgid "excess elements in vector initializer" msgstr "" -#: c-typeck.c:6296 +#: c-typeck.c:6298 msgid "excess elements in scalar initializer" msgstr "" -#: c-typeck.c:6492 +#: c-typeck.c:6486 +msgid "jump into statement expression" +msgstr "" + +#: c-typeck.c:6511 #, fuzzy msgid "ISO C forbids %" msgstr "ISO C не падтрымлівае \"goto *expr;\"" -#: c-typeck.c:6506 cp/typeck.c:6049 +#: c-typeck.c:6525 cp/typeck.c:6036 #, fuzzy msgid "function declared % has a % statement" msgstr "функцыя не вяртае тып string" -#: c-typeck.c:6513 +#: c-typeck.c:6532 msgid "% with no value, in function returning non-void" msgstr "" -#: c-typeck.c:6520 +#: c-typeck.c:6539 msgid "% with a value, in function returning void" msgstr "" -#: c-typeck.c:6577 +#: c-typeck.c:6596 msgid "function returns address of local variable" msgstr "" -#: c-typeck.c:6638 cp/semantics.c:879 +#: c-typeck.c:6662 cp/semantics.c:879 msgid "switch quantity not an integer" msgstr "" -#: c-typeck.c:6649 +#: c-typeck.c:6673 msgid "% switch expression not converted to % in ISO C" msgstr "" -#: c-typeck.c:6685 cp/parser.c:6051 +#: c-typeck.c:6712 +msgid "case label in statement expression not containing enclosing switch statement" +msgstr "" + +#: c-typeck.c:6715 +msgid "% label in statement expression not containing enclosing switch statement" +msgstr "" + +#: c-typeck.c:6719 cp/parser.c:6076 msgid "case label not within a switch statement" msgstr "" -#: c-typeck.c:6687 +#: c-typeck.c:6721 msgid "% label not within a switch statement" msgstr "" -#: c-typeck.c:6751 +#: c-typeck.c:6787 msgid "%Hsuggest explicit braces to avoid ambiguous %" msgstr "" -#: c-typeck.c:6761 +#: c-typeck.c:6797 #, fuzzy msgid "%Hempty body in an if-statement" msgstr "пустое цела ў else-выражэнні" -#: c-typeck.c:6769 +#: c-typeck.c:6805 #, fuzzy msgid "%Hempty body in an else-statement" msgstr "пустое цела ў else-выражэнні" -#: c-typeck.c:6880 cp/parser.c:6553 +#: c-typeck.c:6916 cp/parser.c:6579 msgid "continue statement not within a loop" msgstr "" -#: c-typeck.c:6900 +#: c-typeck.c:6936 msgid "%Hstatement with no effect" msgstr "" -#: c-typeck.c:6929 +#: c-typeck.c:6965 msgid "expression statement has incomplete type" msgstr "" -#: c-typeck.c:7252 c-typeck.c:7291 +#: c-typeck.c:7334 c-typeck.c:7373 msgid "division by zero" msgstr "" -#: c-typeck.c:7336 cp/typeck.c:2927 +#: c-typeck.c:7418 cp/typeck.c:2943 msgid "right shift count is negative" msgstr "" -#: c-typeck.c:7343 cp/typeck.c:2933 +#: c-typeck.c:7425 cp/typeck.c:2949 msgid "right shift count >= width of type" msgstr "" -#: c-typeck.c:7364 cp/typeck.c:2952 +#: c-typeck.c:7446 cp/typeck.c:2968 msgid "left shift count is negative" msgstr "" -#: c-typeck.c:7367 cp/typeck.c:2954 +#: c-typeck.c:7449 cp/typeck.c:2970 msgid "left shift count >= width of type" msgstr "" -#: c-typeck.c:7384 cp/typeck.c:2989 +#: c-typeck.c:7466 cp/typeck.c:3005 msgid "comparing floating point with == or != is unsafe" msgstr "" -#: c-typeck.c:7408 c-typeck.c:7415 +#: c-typeck.c:7490 c-typeck.c:7497 #, fuzzy msgid "ISO C forbids comparison of % with function pointer" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: c-typeck.c:7419 c-typeck.c:7465 +#: c-typeck.c:7501 c-typeck.c:7547 msgid "comparison of distinct pointer types lacks a cast" msgstr "" -#: c-typeck.c:7433 c-typeck.c:7438 c-typeck.c:7485 c-typeck.c:7490 +#: c-typeck.c:7515 c-typeck.c:7520 c-typeck.c:7567 c-typeck.c:7572 msgid "comparison between pointer and integer" msgstr "" -#: c-typeck.c:7457 +#: c-typeck.c:7539 msgid "comparison of complete and incomplete pointers" msgstr "" -#: c-typeck.c:7460 +#: c-typeck.c:7542 msgid "ISO C forbids ordered comparisons of pointers to functions" msgstr "" -#: c-typeck.c:7473 c-typeck.c:7480 +#: c-typeck.c:7555 c-typeck.c:7562 msgid "ordered comparison of pointer with integer zero" msgstr "" -#: c-typeck.c:7701 +#: c-typeck.c:7783 msgid "comparison between signed and unsigned" msgstr "" -#: c-typeck.c:7747 cp/typeck.c:3396 +#: c-typeck.c:7829 cp/typeck.c:3412 msgid "comparison of promoted ~unsigned with constant" msgstr "" -#: c-typeck.c:7755 cp/typeck.c:3404 +#: c-typeck.c:7837 cp/typeck.c:3420 msgid "comparison of promoted ~unsigned with unsigned" msgstr "" @@ -4128,103 +4135,103 @@ msgstr "" msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)" msgstr "" -#: cgraph.c:278 +#: cgraph.c:282 msgid "function body not available" msgstr "" -#: cgraph.c:280 cgraphunit.c:661 +#: cgraph.c:284 cgraphunit.c:662 msgid "redefined extern inline functions are not considered for inlining" msgstr "" -#: cgraph.c:283 cgraphunit.c:666 +#: cgraph.c:287 cgraphunit.c:667 #, fuzzy msgid "function not considered for inlining" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cgraph.c:285 cgraphunit.c:664 +#: cgraph.c:289 cgraphunit.c:665 msgid "function not inlinable" msgstr "" -#: cgraph.c:615 +#: cgraph.c:673 msgid "%D renamed after being referenced in assembly" msgstr "" -#: cgraphunit.c:512 +#: cgraphunit.c:513 msgid "Shared call_expr:" msgstr "" -#: cgraphunit.c:518 +#: cgraphunit.c:519 #, fuzzy msgid "Edge points to wrong declaration:" msgstr "гэта папярэдняе абвяшчэньне" -#: cgraphunit.c:527 +#: cgraphunit.c:528 msgid "Missing callgraph edge for call expr:" msgstr "" -#: cgraphunit.c:553 +#: cgraphunit.c:554 #, c-format msgid "Aux field set for edge %s->%s" msgstr "" -#: cgraphunit.c:565 +#: cgraphunit.c:566 msgid "Inlined_to pointer is wrong" msgstr "" -#: cgraphunit.c:570 +#: cgraphunit.c:571 msgid "Multiple inline callers" msgstr "" -#: cgraphunit.c:577 +#: cgraphunit.c:578 msgid "Inlined_to pointer set for noninline callers" msgstr "" -#: cgraphunit.c:583 +#: cgraphunit.c:584 msgid "Inlined_to pointer is set but no predecesors found" msgstr "" -#: cgraphunit.c:588 +#: cgraphunit.c:589 msgid "Inlined_to pointer reffers to itself" msgstr "" -#: cgraphunit.c:598 +#: cgraphunit.c:599 msgid "Node not found in DECL_ASSEMBLER_NAME hash" msgstr "" -#: cgraphunit.c:612 +#: cgraphunit.c:613 #, c-format msgid "Edge %s->%s has no corresponding call_expr" msgstr "" -#: cgraphunit.c:623 +#: cgraphunit.c:624 msgid "verify_cgraph_node failed." msgstr "" -#: cgraphunit.c:807 +#: cgraphunit.c:810 msgid "failed to reclaim unneeded function" msgstr "" -#: cgraphunit.c:1194 +#: cgraphunit.c:1201 msgid "--param large-function-growth limit reached" msgstr "" -#: cgraphunit.c:1231 +#: cgraphunit.c:1238 msgid "recursive inlining" msgstr "" -#: cgraphunit.c:1396 cgraphunit.c:1648 +#: cgraphunit.c:1403 cgraphunit.c:1655 msgid "--param max-inline-insns-single limit reached" msgstr "" -#: cgraphunit.c:1420 +#: cgraphunit.c:1427 msgid "--param max-inline-insns-single limit reached after inlining into the callee" msgstr "" -#: cgraphunit.c:1470 +#: cgraphunit.c:1477 msgid "--param inline-unit-growth limit reached" msgstr "" -#: cgraphunit.c:1822 +#: cgraphunit.c:1829 msgid "Nodes with no released memory found." msgstr "" @@ -4388,7 +4395,7 @@ msgstr "" msgid "library lib%s not found" msgstr "Бібліятэка lib%s не знойдзена" -#: combine.c:12524 +#: combine.c:12516 #, c-format msgid "" ";; Combiner statistics: %d attempts, %d substitutions (%d requiring new space),\n" @@ -4396,7 +4403,7 @@ msgid "" "\n" msgstr "" -#: combine.c:12533 +#: combine.c:12525 #, c-format msgid "" "\n" @@ -4508,7 +4515,7 @@ msgstr "" msgid "too many input files" msgstr "вельмі шмат уваходзячых файлаў" -#: cse.c:6772 +#: cse.c:6812 #, c-format msgid ";; Processing block from %d to %d, %d sets.\n" msgstr "" @@ -4559,7 +4566,7 @@ msgstr "" msgid "ENTRY does not dominate bb %d" msgstr "" -#: dwarf2out.c:3388 +#: dwarf2out.c:3393 #, c-format msgid "DW_LOC_OP %s not implemented\n" msgstr "" @@ -4603,58 +4610,54 @@ msgstr "" msgid "stack limits not supported on this target" msgstr "" -#: final.c:1061 +#: final.c:1062 msgid "negative insn length" msgstr "" -#: final.c:2501 +#: final.c:2508 msgid "could not split insn" msgstr "" -#: final.c:2851 +#: final.c:2857 #, fuzzy msgid "invalid 'asm': " msgstr "нерэчаісная маска" -#: final.c:3034 +#: final.c:3040 msgid "nested assembly dialect alternatives" msgstr "" -#: final.c:3051 final.c:3063 +#: final.c:3057 final.c:3069 msgid "unterminated assembly dialect alternative" msgstr "" -#: final.c:3110 +#: final.c:3116 #, c-format msgid "operand number missing after %%-letter" msgstr "" -#: final.c:3113 final.c:3154 +#: final.c:3119 final.c:3160 msgid "operand number out of range" msgstr "" -#: final.c:3173 +#: final.c:3179 #, c-format msgid "invalid %%-code" msgstr "нерэчаісны %%-код" -#: final.c:3203 +#: final.c:3209 #, c-format msgid "'%%l' operand isn't a label" msgstr "" #. We can't handle floating point constants; #. PRINT_OPERAND must handle them. -#. We can't handle floating point constants; PRINT_OPERAND must -#. handle them. -#. We can't handle floating point constants; -#. PRINT_OPERAND must handle them. -#: final.c:3305 vmsdbgout.c:487 config/i386/i386.c:5931 +#: final.c:3311 vmsdbgout.c:488 config/i386/i386.c:5957 #: config/pdp11/pdp11.c:1690 msgid "floating constant misused" msgstr "" -#: final.c:3361 vmsdbgout.c:544 config/i386/i386.c:6009 +#: final.c:3367 vmsdbgout.c:545 config/i386/i386.c:6035 #: config/pdp11/pdp11.c:1737 msgid "invalid expression as operand" msgstr "" @@ -4668,25 +4671,25 @@ msgstr "унутраная памылка" msgid "Attempt to delete prologue/epilogue insn:" msgstr "" -#: fold-const.c:3220 fold-const.c:3231 +#: fold-const.c:3232 fold-const.c:3243 #, c-format msgid "comparison is always %d due to width of bit-field" msgstr "" -#: fold-const.c:4789 fold-const.c:4804 +#: fold-const.c:4807 fold-const.c:4822 #, c-format msgid "comparison is always %d" msgstr "" -#: fold-const.c:4933 +#: fold-const.c:4951 msgid "% of unmatched not-equal tests is always 1" msgstr "" -#: fold-const.c:4938 +#: fold-const.c:4956 msgid "% of mutually exclusive equal-tests is always 0" msgstr "" -#: fold-const.c:9870 +#: fold-const.c:9925 msgid "fold check: original tree changed by fold" msgstr "" @@ -4700,19 +4703,19 @@ msgstr "памер масіва \"%s\" вельмі вялікі" msgid "impossible constraint in %" msgstr "немагчымы апэратар '%s'" -#: function.c:3633 +#: function.c:3614 msgid "%Jvariable %qD might be clobbered by % or %" msgstr "" -#: function.c:3654 +#: function.c:3635 msgid "%Jargument %qD might be clobbered by % or %" msgstr "" -#: function.c:4045 +#: function.c:4026 msgid "function returns an aggregate" msgstr "" -#: function.c:4368 +#: function.c:4349 #, fuzzy msgid "%Junused parameter %qD" msgstr "невыкарыстаемы параметр \"%s\"" @@ -5024,7 +5027,6 @@ msgid "(C)" msgstr "" #: gcc.c:3401 java/gjavah.c:2377 java/jcf-dump.c:917 java/jv-scan.c:129 -#, c-format msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" @@ -5210,7 +5212,6 @@ msgid "libraries: %s\n" msgstr "бібліятэкі: %s\n" #: gcc.c:6328 -#, c-format msgid "" "\n" "For bug reporting instructions, please see:\n" @@ -5595,7 +5596,7 @@ msgstr "" msgid "can't write PCH file: %m" msgstr "не магу запісаць ў %s" -#: ggc-common.c:487 +#: ggc-common.c:487 config/i386/host-cygwin.c:58 #, fuzzy, c-format msgid "can't get position in PCH file: %m" msgstr "немагчыма зачыніць уваходзячы файл %s" @@ -5629,17 +5630,17 @@ msgstr "не магу запісаць ў %s" msgid "unexpected node" msgstr "" -#: gimplify.c:3317 +#: gimplify.c:3344 #, c-format msgid "invalid lvalue in asm output %d" msgstr "" -#: gimplify.c:3364 +#: gimplify.c:3456 #, c-format msgid "memory input %d is not directly addressable" msgstr "" -#: gimplify.c:4219 +#: gimplify.c:4330 msgid "gimplification failed" msgstr "" @@ -5802,7 +5803,7 @@ msgstr "" msgid "invalid parameter %qs" msgstr "нерэчаісны парамэтр `%s'" -#: passes.c:1200 +#: passes.c:1210 msgid "branch target register load optimization is not intended to be run twice" msgstr "" @@ -6167,8 +6168,8 @@ msgstr "" msgid "can't use '%s' as a %s register" msgstr "" -#: regclass.c:781 config/ia64/ia64.c:4568 config/ia64/ia64.c:4575 -#: config/pa/pa.c:336 config/pa/pa.c:343 +#: regclass.c:781 config/ia64/ia64.c:4572 config/ia64/ia64.c:4579 +#: config/pa/pa.c:342 config/pa/pa.c:349 #, c-format msgid "unknown register name: %s" msgstr "невядомая назва рэгістра: %s" @@ -6261,11 +6262,11 @@ msgid "% operand constraint incompatible with operand size" msgstr "" #. It's the compiler's fault. -#: reload1.c:6614 +#: reload1.c:6613 msgid "VOIDmode on an output" msgstr "" -#: reload1.c:6615 +#: reload1.c:6614 msgid "output operand is constant in %" msgstr "" @@ -6519,7 +6520,6 @@ msgid "collect: tweaking %s in %s\n" msgstr "" #: tlink.c:751 -#, c-format msgid "collect: relinking\n" msgstr "" @@ -6558,71 +6558,68 @@ msgstr "" msgid "setting core file size limit to maximum: %m" msgstr "" -#: toplev.c:850 +#: toplev.c:852 msgid "%J%qF declared % but never defined" msgstr "" -#: toplev.c:876 +#: toplev.c:878 #, fuzzy msgid "%J%qD defined but not used" msgstr "адмеціна `%D' вызначана, але не выкарыстоўваецца" -#: toplev.c:899 toplev.c:922 +#: toplev.c:901 toplev.c:924 #, c-format msgid "%qs is deprecated (declared at %s:%d)" msgstr "" -#: toplev.c:925 +#: toplev.c:927 #, c-format msgid "type is deprecated (declared at %s:%d)" msgstr "" -#: toplev.c:931 +#: toplev.c:933 #, c-format msgid "%qs is deprecated" msgstr "" -#: toplev.c:933 +#: toplev.c:935 msgid "type is deprecated" msgstr "" -#: toplev.c:1087 -#, c-format +#: toplev.c:1086 msgid "" "\n" "Target specific options:\n" msgstr "" -#: toplev.c:1101 toplev.c:1120 +#: toplev.c:1100 toplev.c:1119 #, c-format msgid " -m%-23s [undocumented]\n" msgstr "" -#: toplev.c:1129 -#, c-format +#: toplev.c:1128 msgid "" "\n" "There are undocumented target specific options as well.\n" msgstr "" -#: toplev.c:1131 -#, c-format +#: toplev.c:1130 msgid " They exist, but they are not documented.\n" msgstr "" -#: toplev.c:1175 +#: toplev.c:1174 #, c-format msgid "unrecognized gcc debugging option: %c" msgstr "" #. Handle -mfix-and-continue. -#: toplev.c:1237 config/rs6000/rs6000.c:1400 config/rs6000/rs6000.c:1411 +#: toplev.c:1236 config/rs6000/rs6000.c:1408 config/rs6000/rs6000.c:1419 #: config/rs6000/darwin.h:106 #, fuzzy, c-format msgid "invalid option %qs" msgstr "Нерэчаісны выбар %s" -#: toplev.c:1252 +#: toplev.c:1251 #, c-format msgid "" "%s%s%s version %s (%s)\n" @@ -6633,123 +6630,123 @@ msgstr "" "%s\tзкампілявана GNU C версія %s.\n" "%s%s%s версія %s (%s) зкампілявана CC.\n" -#: toplev.c:1259 +#: toplev.c:1258 #, c-format msgid "%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n" msgstr "" -#: toplev.c:1311 +#: toplev.c:1310 msgid "options passed: " msgstr "" -#: toplev.c:1340 +#: toplev.c:1339 msgid "options enabled: " msgstr "выбары ўключаны:" -#: toplev.c:1414 +#: toplev.c:1413 #, fuzzy msgid "can%'t open %s for writing: %m" msgstr "немагчыма адчыніць %s для запісу" -#: toplev.c:1492 config/sh/sh.c:7334 +#: toplev.c:1491 config/sh/sh.c:7334 msgid "created and used with different settings of -fpic" msgstr "" -#: toplev.c:1494 config/sh/sh.c:7336 +#: toplev.c:1493 config/sh/sh.c:7336 msgid "created and used with different settings of -fpie" msgstr "" -#: toplev.c:1545 config/sh/sh.c:7386 +#: toplev.c:1544 config/sh/sh.c:7386 #, c-format msgid "created and used with differing settings of '-m%s'" msgstr "" -#: toplev.c:1548 config/sh/sh.c:7389 +#: toplev.c:1547 config/sh/sh.c:7389 msgid "out of memory" msgstr "" -#: toplev.c:1756 +#: toplev.c:1755 msgid "instruction scheduling not supported on this target machine" msgstr "" -#: toplev.c:1760 +#: toplev.c:1759 msgid "this target machine does not have delayed branches" msgstr "" -#: toplev.c:1764 +#: toplev.c:1763 msgid "value-based profiling not yet implemented in trees." msgstr "" -#: toplev.c:1777 +#: toplev.c:1776 #, c-format msgid "-f%sleading-underscore not supported on this target machine" msgstr "" -#: toplev.c:1851 +#: toplev.c:1850 #, c-format msgid "target system does not support the \"%s\" debug format" msgstr "" -#: toplev.c:1863 +#: toplev.c:1862 msgid "variable tracking requested, but useless unless producing debug info" msgstr "" -#: toplev.c:1866 +#: toplev.c:1865 msgid "variable tracking requested, but not supported by this debug format" msgstr "" -#: toplev.c:1886 +#: toplev.c:1885 #, fuzzy msgid "can%'t open %s: %m" msgstr "немагчыма адчыніць %s" -#: toplev.c:1893 +#: toplev.c:1892 #, fuzzy msgid "-ffunction-sections not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:1898 +#: toplev.c:1897 #, fuzzy msgid "-fdata-sections not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:1905 +#: toplev.c:1904 msgid "-ffunction-sections disabled; it makes profiling impossible" msgstr "" -#: toplev.c:1912 +#: toplev.c:1911 #, fuzzy msgid "-fprefetch-loop-arrays not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:1918 +#: toplev.c:1917 #, fuzzy msgid "-fspeculative-prefetching not supported for this target" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:1924 +#: toplev.c:1923 msgid "-fprefetch-loop-arrays not supported for this target (try -march switches)" msgstr "" -#: toplev.c:1930 +#: toplev.c:1929 #, fuzzy msgid "-fspeculative-prefetching not supported for this target (try -march switches)" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" -#: toplev.c:1939 +#: toplev.c:1938 msgid "-fprefetch-loop-arrays is not supported with -Os" msgstr "" -#: toplev.c:1945 +#: toplev.c:1944 msgid "-ffunction-sections may affect debugging on some targets" msgstr "" -#: toplev.c:2057 +#: toplev.c:2056 #, fuzzy, c-format msgid "error writing to %s: %m" msgstr "памылка запісу ў %s" -#: toplev.c:2059 java/jcf-parse.c:1066 java/jcf-write.c:3538 +#: toplev.c:2058 java/jcf-parse.c:1066 java/jcf-write.c:3538 #, fuzzy, c-format msgid "error closing %s: %m" msgstr "памылка запісу ў %s" @@ -6918,51 +6915,55 @@ msgstr "Немагчыма адчыніць файл з дадзенымі %s.\n msgid "ignoring unknown option %q.*s in %<-fdump-%s%>" msgstr "" -#: tree-inline.c:969 +#: tree-inline.c:974 msgid "%Jfunction %qF can never be inlined because it uses alloca (override using the always_inline attribute)" msgstr "" -#: tree-inline.c:981 +#: tree-inline.c:986 msgid "%Jfunction %qF can never be inlined because it uses setjmp" msgstr "" -#: tree-inline.c:995 +#: tree-inline.c:1000 msgid "%Jfunction %qF can never be inlined because it uses variable argument lists" msgstr "" -#: tree-inline.c:1006 +#: tree-inline.c:1011 msgid "%Jfunction %qF can never be inlined because it uses setjmp-longjmp exception handling" msgstr "" -#: tree-inline.c:1013 +#: tree-inline.c:1018 msgid "%Jfunction %qF can never be inlined because it uses non-local goto" msgstr "" -#: tree-inline.c:1032 +#: tree-inline.c:1029 +msgid "%Jfunction %qF can never be inlined because it uses __builtin_return or __builtin_apply_args" +msgstr "" + +#: tree-inline.c:1048 msgid "%Jfunction %qF can never be inlined because it contains a computed goto" msgstr "" -#: tree-inline.c:1046 +#: tree-inline.c:1062 msgid "%Jfunction %qF can never be inlined because it receives a non-local goto" msgstr "" -#: tree-inline.c:1071 +#: tree-inline.c:1087 msgid "%Jfunction %qF can never be inlined because it uses variable sized variables" msgstr "" -#: tree-inline.c:1495 +#: tree-inline.c:1565 msgid "originally indirect function call not considered for inlining" msgstr "" -#: tree-inline.c:1505 tree-inline.c:1513 +#: tree-inline.c:1575 tree-inline.c:1583 msgid "%Jinlining failed in call to %qF: %s" msgstr "" -#: tree-inline.c:1506 tree-inline.c:1514 +#: tree-inline.c:1576 tree-inline.c:1584 msgid "called from here" msgstr "выклікана адсюль" -#: tree-inline.c:1628 +#: tree-inline.c:1698 msgid "control may reach end of non-void function %qD being inlined" msgstr "" @@ -6985,12 +6986,12 @@ msgstr "" msgid "mudflap: this language is not supported" msgstr "-pipe не падтрымліваецца" -#: tree-optimize.c:720 +#: tree-optimize.c:718 #, fuzzy msgid "%Jsize of return value of %qD is %u bytes" msgstr "памер вяртаемага значэння \"%s\" %u байт" -#: tree-optimize.c:723 +#: tree-optimize.c:721 #, fuzzy msgid "%Jsize of return value of %qD is larger than %wd bytes" msgstr "памер вяртаемага значэння \"%s\" больш чым %d байт" @@ -7149,12 +7150,12 @@ msgstr "" msgid "verify_ssa failed." msgstr "" -#: tree-ssa.c:1376 +#: tree-ssa.c:1379 #, fuzzy msgid "%H%qD is used uninitialized in this function" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: tree-ssa.c:1401 +#: tree-ssa.c:1404 msgid "%H%qD may be used uninitialized in this function" msgstr "" @@ -7167,56 +7168,56 @@ msgstr "" msgid "unsupported defining stmt" msgstr "непадтрымліваемая версія" -#: tree.c:3272 +#: tree.c:3276 msgid "%Jfunction %qD definition is marked dllimport." msgstr "" -#: tree.c:3280 +#: tree.c:3284 msgid "%Jvariable %qD definition is marked dllimport." msgstr "" -#: tree.c:3300 +#: tree.c:3304 msgid "%Jexternal linkage required for symbol %qD because of %qs attribute." msgstr "" -#: tree.c:4453 +#: tree.c:4457 msgid "arrays of functions are not meaningful" msgstr "" -#: tree.c:4505 +#: tree.c:4509 msgid "function return type cannot be function" msgstr "" -#: tree.c:5398 +#: tree.c:5405 msgid "invalid initializer for bit string" msgstr "" -#: tree.c:5482 +#: tree.c:5489 #, c-format msgid "tree check: %s, have %s in %s, at %s:%d" msgstr "" -#: tree.c:5519 +#: tree.c:5526 #, c-format msgid "tree check: expected none of %s, have %s in %s, at %s:%d" msgstr "" -#: tree.c:5532 +#: tree.c:5539 #, c-format msgid "tree check: expected class %qs, have %qs (%s) in %s, at %s:%d" msgstr "" -#: tree.c:5546 +#: tree.c:5553 #, c-format msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d" msgstr "" -#: tree.c:5558 +#: tree.c:5565 #, c-format msgid "tree check: accessed elt %d of phi_node with %d elts in %s, at %s:%d" msgstr "" -#: tree.c:5570 +#: tree.c:5577 #, c-format msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d" msgstr "" @@ -7225,28 +7226,28 @@ msgstr "" msgid "%J%D causes a section type conflict" msgstr "" -#: varasm.c:911 +#: varasm.c:910 msgid "%Jregister name not specified for %qD" msgstr "" -#: varasm.c:913 +#: varasm.c:912 #, fuzzy msgid "%Jinvalid register name for %qD" msgstr "нерэчаісная назва рэгістра `%s'" -#: varasm.c:915 +#: varasm.c:914 msgid "%Jdata type of %qD isn%'t suitable for a register" msgstr "" -#: varasm.c:918 +#: varasm.c:917 msgid "%Jregister specified for %qD isn%'t suitable for data type" msgstr "" -#: varasm.c:928 +#: varasm.c:927 msgid "global register variable has initial value" msgstr "" -#: varasm.c:931 +#: varasm.c:930 msgid "volatile register variables don%'t work as you might wish" msgstr "" @@ -7276,49 +7277,57 @@ msgstr "" msgid "%Jrequested alignment for %qD is greater than implemented alignment of %d" msgstr "" -#: varasm.c:3772 +#: varasm.c:3774 msgid "initializer for integer value is too complicated" msgstr "" -#: varasm.c:3777 +#: varasm.c:3779 msgid "initializer for floating value is not a floating constant" msgstr "" -#: varasm.c:4046 +#: varasm.c:4048 #, fuzzy, c-format msgid "invalid initial value for member %qs" msgstr "нявернае выкарыстанне \"restict\"" -#: varasm.c:4233 varasm.c:4277 +#: varasm.c:4235 varasm.c:4279 msgid "%Jweak declaration of %qD must precede definition" msgstr "" -#: varasm.c:4241 +#: varasm.c:4243 msgid "%Jweak declaration of %qD after first use results in unspecified behavior" msgstr "" -#: varasm.c:4275 +#: varasm.c:4277 msgid "%Jweak declaration of %qD must be public" msgstr "" -#: varasm.c:4284 +#: varasm.c:4286 msgid "%Jweak declaration of %qD not supported" msgstr "" -#: varasm.c:4313 varasm.c:4462 +#: varasm.c:4315 msgid "only weak aliases are supported in this configuration" msgstr "" -#: varasm.c:4465 -msgid "alias definitions not supported in this configuration; ignored" +#: varasm.c:4476 +msgid "%J%qD aliased to undefined symbol %qE" +msgstr "" + +#: varasm.c:4479 +msgid "%J%qD aliased to external symbol %qE" msgstr "" -#: varasm.c:4504 +#: varasm.c:4510 #, fuzzy -msgid "%qD aliased to undefined symbol %qE" -msgstr "нявернае выкарыстанне \"restict\"" +msgid "%Jalias definitions not supported in this configuration" +msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" + +#: varasm.c:4515 +msgid "%Jonly weak aliases are supported in this configuration" +msgstr "" -#: varasm.c:4532 +#: varasm.c:4573 #, fuzzy msgid "visibility attribute not supported in this configuration; ignored" msgstr "атрыбуты секцыі не падтрымліваюцца для гэтай мэты" @@ -7391,235 +7400,239 @@ msgstr "" msgid "The threshold ratio between instantiated fields and the total structure size" msgstr "" -#: params.def:72 +#: params.def:71 msgid "The maximum number of instructions in a single function eligible for inlining" msgstr "" -#: params.def:84 +#: params.def:83 msgid "The maximum number of instructions when automatically inlining" msgstr "" -#: params.def:89 +#: params.def:88 msgid "The maximum number of instructions inline function can grow to via recursive inlining" msgstr "" -#: params.def:94 +#: params.def:93 msgid "The maximum number of instructions non-inline function can grow to via recursive inlining" msgstr "" -#: params.def:99 +#: params.def:98 msgid "The maximum depth of recursive inlining for inline functions" msgstr "" -#: params.def:104 +#: params.def:103 msgid "The maximum depth of recursive inlining for non-inline functions" msgstr "" -#: params.def:111 +#: params.def:110 msgid "If -fvariable-expansion-in-unroller is used, the maximum number of times that an individual variable will be expanded during loop unrolling" msgstr "" -#: params.def:124 +#: params.def:123 msgid "The maximum number of instructions to consider to fill a delay slot" msgstr "" -#: params.def:135 +#: params.def:134 msgid "The maximum number of instructions to consider to find accurate live register information" msgstr "" -#: params.def:145 +#: params.def:144 msgid "The maximum length of scheduling's pending operations list" msgstr "" -#: params.def:150 +#: params.def:149 msgid "The size of function body to be considered large" msgstr "" -#: params.def:154 +#: params.def:153 msgid "Maximal growth due to inlining of large function (in percent)" msgstr "" -#: params.def:158 +#: params.def:157 msgid "how much can given compilation unit grow because of the inlining (in percent)" msgstr "" -#: params.def:165 +#: params.def:161 +msgid "expense of call operation relative to ordinary aritmetic operations" +msgstr "" + +#: params.def:168 msgid "The maximum amount of memory to be allocated by GCSE" msgstr "" -#: params.def:170 +#: params.def:173 msgid "The maximum number of passes to make when doing GCSE" msgstr "" -#: params.def:180 +#: params.def:183 msgid "The threshold ratio for performing partial redundancy elimination after reload." msgstr "" -#: params.def:187 +#: params.def:190 msgid "The threshold ratio of critical edges execution count that permit performing redundancy elimination after reload." msgstr "" -#: params.def:198 +#: params.def:201 msgid "The maximum number of instructions to consider to unroll in a loop" msgstr "" -#: params.def:204 +#: params.def:207 msgid "The maximum number of instructions to consider to unroll in a loop on average" msgstr "" -#: params.def:209 +#: params.def:212 msgid "The maximum number of unrollings of a single loop" msgstr "" -#: params.def:214 +#: params.def:217 msgid "The maximum number of insns of a peeled loop" msgstr "" -#: params.def:219 +#: params.def:222 msgid "The maximum number of peelings of a single loop" msgstr "" -#: params.def:224 +#: params.def:227 msgid "The maximum number of insns of a completely peeled loop" msgstr "" -#: params.def:229 +#: params.def:232 msgid "The maximum number of peelings of a single loop that is peeled completely" msgstr "" -#: params.def:234 +#: params.def:237 msgid "The maximum number of insns of a peeled loop that rolls only once" msgstr "" -#: params.def:240 +#: params.def:243 msgid "The maximum number of insns of an unswitched loop" msgstr "" -#: params.def:245 +#: params.def:248 msgid "The maximum number of unswitchings in a single loop" msgstr "" -#: params.def:252 +#: params.def:255 msgid "Bound on the number of iterations the brute force # of iterations analysis algorithm evaluates" msgstr "" -#: params.def:257 +#: params.def:260 msgid "Maximum number of loops to perform swing modulo scheduling on (mainly for debugging)" msgstr "" -#: params.def:263 +#: params.def:266 msgid "A factor for tuning the upper bound that swing modulo scheduler uses for scheduling a loop" msgstr "" -#: params.def:267 +#: params.def:270 msgid "The number of cycles the swing modulo scheduler considers when \t checking conflicts using DFA" msgstr "" -#: params.def:272 +#: params.def:275 msgid "A threshold on the average loop count considered by the swing modulo scheduler" msgstr "" -#: params.def:277 +#: params.def:280 msgid "Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot" msgstr "" -#: params.def:281 +#: params.def:284 msgid "Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot" msgstr "" -#: params.def:285 +#: params.def:288 msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is available" msgstr "" -#: params.def:289 +#: params.def:292 msgid "The percentage of function, weighted by execution frequency, that must be covered by trace formation. Used when profile feedback is not available" msgstr "" -#: params.def:293 +#: params.def:296 msgid "Maximal code growth caused by tail duplication (in percent)" msgstr "" -#: params.def:297 +#: params.def:300 msgid "Stop reverse growth if the reverse probability of best edge is less than this threshold (in percent)" msgstr "" -#: params.def:301 +#: params.def:304 msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is available" msgstr "" -#: params.def:305 +#: params.def:308 msgid "Stop forward growth if the probability of best edge is less than this threshold (in percent). Used when profile feedback is not available" msgstr "" -#: params.def:311 +#: params.def:314 msgid "The maximum number of incoming edges to consider for crossjumping" msgstr "" -#: params.def:317 +#: params.def:320 msgid "The minimum number of matching instructions to consider for crossjumping" msgstr "" -#: params.def:323 +#: params.def:326 msgid "The maximum number of insns to duplicate when unfactoring computed gotos" msgstr "" -#: params.def:329 +#: params.def:332 msgid "The maximum length of path considered in cse" msgstr "" -#: params.def:336 +#: params.def:339 msgid "The minimum cost of an expensive expression in the loop invariant motion" msgstr "" -#: params.def:345 +#: params.def:348 msgid "Bound on number of candidates below that all candidates are considered in iv optimizations" msgstr "" -#: params.def:353 +#: params.def:356 msgid "Bound on number of iv uses in loop optimized in iv optimizations" msgstr "" -#: params.def:361 +#: params.def:364 msgid "If number of candidates in the set is smaller, we always try to remove unused ivs during its optimization" msgstr "" -#: params.def:368 +#: params.def:371 msgid "Given N calls and V call-clobbered vars in a function. Use .GLOBAL_VAR if NxV is larger than this limit" msgstr "" -#: params.def:373 +#: params.def:376 msgid "The maximum memory locations recorded by cselib" msgstr "" -#: params.def:386 +#: params.def:389 msgid "Minimum heap expansion to trigger garbage collection, as a percentage of the total size of the heap" msgstr "" -#: params.def:391 +#: params.def:394 msgid "Minimum heap size before we start collecting garbage, in kilobytes" msgstr "" -#: params.def:399 +#: params.def:402 msgid "The maximum number of instructions to search backward when looking for equivalent reload" msgstr "" -#: params.def:404 +#: params.def:407 msgid "The maximum number of virtual operands allowed to represent aliases before triggering alias grouping." msgstr "" -#: params.def:409 +#: params.def:412 msgid "The maximum number of blocks in a region to be considered for interblock scheduling" msgstr "" -#: params.def:414 +#: params.def:417 msgid "The maximum number of insns in a region to be considered for interblock scheduling" msgstr "" -#: params.def:419 +#: params.def:422 msgid "The maximum number of RTL nodes that can be recorded as combiner's last value" msgstr "" -#: params.def:427 +#: params.def:430 msgid "The upper bound for sharing integer constants" msgstr "" @@ -7779,7 +7792,7 @@ msgstr "" msgid "bad value %qs for -mfp-trap-mode switch" msgstr "" -#: config/alpha/alpha.c:347 config/rs6000/rs6000.c:1720 +#: config/alpha/alpha.c:347 config/rs6000/rs6000.c:1728 #, c-format msgid "bad value %qs for -mtls-size switch" msgstr "" @@ -7829,24 +7842,24 @@ msgstr "нерэчаіснае значэньне %%H" msgid "invalid %%J value" msgstr "дрэннае %%Q значэнне" -#: config/alpha/alpha.c:4801 config/ia64/ia64.c:4133 +#: config/alpha/alpha.c:4801 config/ia64/ia64.c:4137 #, c-format msgid "invalid %%r value" msgstr "нерэчаіснае значэньне %%r" -#: config/alpha/alpha.c:4811 config/rs6000/rs6000.c:10799 +#: config/alpha/alpha.c:4811 config/rs6000/rs6000.c:10927 #: config/xtensa/xtensa.c:1951 #, c-format msgid "invalid %%R value" msgstr "нерэчаіснае значэньне %%R" -#: config/alpha/alpha.c:4817 config/rs6000/rs6000.c:10718 +#: config/alpha/alpha.c:4817 config/rs6000/rs6000.c:10846 #: config/xtensa/xtensa.c:1918 #, c-format msgid "invalid %%N value" msgstr "нерэчаіснае значэньне %%N" -#: config/alpha/alpha.c:4825 config/rs6000/rs6000.c:10746 +#: config/alpha/alpha.c:4825 config/rs6000/rs6000.c:10874 #, c-format msgid "invalid %%P value" msgstr "нерэчаіснае значэньне %%P" @@ -7861,12 +7874,12 @@ msgstr "нерэчаіснае значэньне %%h" msgid "invalid %%L value" msgstr "нерэчаіснае значэньне %%L" -#: config/alpha/alpha.c:4880 config/rs6000/rs6000.c:10700 +#: config/alpha/alpha.c:4880 config/rs6000/rs6000.c:10828 #, c-format msgid "invalid %%m value" msgstr "нерэчаіснае значэньне %%m" -#: config/alpha/alpha.c:4888 config/rs6000/rs6000.c:10708 +#: config/alpha/alpha.c:4888 config/rs6000/rs6000.c:10836 #, c-format msgid "invalid %%M value" msgstr "нерэчаіснае значэньне %%M" @@ -7877,7 +7890,7 @@ msgid "invalid %%U value" msgstr "нерэчаіснае значэньне %%U" #: config/alpha/alpha.c:4944 config/alpha/alpha.c:4958 -#: config/rs6000/rs6000.c:10807 +#: config/rs6000/rs6000.c:10935 #, c-format msgid "invalid %%s value" msgstr "нерэчаіснае значэньне %%v" @@ -7887,8 +7900,8 @@ msgstr "нерэчаіснае значэньне %%v" msgid "invalid %%C value" msgstr "нерэчаіснае значэньне %%C" -#: config/alpha/alpha.c:5018 config/rs6000/rs6000.c:10537 -#: config/rs6000/rs6000.c:10557 +#: config/alpha/alpha.c:5018 config/rs6000/rs6000.c:10666 +#: config/rs6000/rs6000.c:10685 #, c-format msgid "invalid %%E value" msgstr "нерэчаіснае значэньне %%E" @@ -7897,13 +7910,13 @@ msgstr "нерэчаіснае значэньне %%E" msgid "unknown relocation unspec" msgstr "" -#: config/alpha/alpha.c:5052 config/rs6000/rs6000.c:11125 +#: config/alpha/alpha.c:5052 config/rs6000/rs6000.c:11253 #, c-format msgid "invalid %%xn code" msgstr "нерэчаіснае значэньне %%xn" -#: config/alpha/alpha.c:6037 config/alpha/alpha.c:6040 config/s390/s390.c:8030 -#: config/s390/s390.c:8033 +#: config/alpha/alpha.c:6036 config/alpha/alpha.c:6039 config/s390/s390.c:8033 +#: config/s390/s390.c:8036 msgid "bad builtin fcode" msgstr "" @@ -7912,22 +7925,14 @@ msgstr "" #. each pair being { "NAME", VALUE } #. where VALUE is the bits to set or minus the bits to clear. #. An empty string NAME is used to identify the default VALUE. -#. WARNING: Do not mark empty strings for translation, as calling -#. gettext on an empty string does NOT return an empty -#. string. -#. Macro to define tables used to set the flags. -#. This is a list in braces of pairs in braces, -#. each pair being { "NAME", VALUE } -#. where VALUE is the bits to set or minus the bits to clear. -#. An empty string NAME is used to identify the default VALUE. #: config/alpha/alpha.h:293 config/i386/i386.h:335 config/i386/i386.h:337 #: config/i386/i386.h:339 config/ns32k/ns32k.h:140 config/s390/s390.h:134 -#: config/sparc/sparc.h:622 config/sparc/sparc.h:627 +#: config/sparc/sparc.h:625 config/sparc/sparc.h:630 msgid "Use hardware fp" msgstr "Выкарыстоўваць апаратную плаваючую кропку" #: config/alpha/alpha.h:294 config/i386/i386.h:336 config/i386/i386.h:338 -#: config/sparc/sparc.h:624 config/sparc/sparc.h:629 +#: config/sparc/sparc.h:627 config/sparc/sparc.h:632 msgid "Do not use hardware fp" msgstr "Не выкарыстоўваць апаратную плаваючую кропку" @@ -8087,8 +8092,7 @@ msgid "invalid operand to %%V code" msgstr "нерэчаісны %%-код" #. Unknown flag. -#. Undocumented flag. -#: config/arc/arc.c:1812 config/m32r/m32r.c:2262 config/sparc/sparc.c:7517 +#: config/arc/arc.c:1812 config/m32r/m32r.c:2262 config/sparc/sparc.c:7516 msgid "invalid operand output code" msgstr "" @@ -8097,7 +8101,7 @@ msgstr "" msgid "switch -mcpu=%s conflicts with -march= switch" msgstr "" -#: config/arm/arm.c:810 config/rs6000/rs6000.c:1230 config/sparc/sparc.c:648 +#: config/arm/arm.c:810 config/rs6000/rs6000.c:1238 config/sparc/sparc.c:653 #, c-format msgid "bad value (%s) for %s switch" msgstr "" @@ -8189,12 +8193,12 @@ msgstr "" msgid "unable to use '%s' for PIC register" msgstr "" -#: config/arm/arm.c:2669 config/arm/arm.c:2687 config/avr/avr.c:4620 +#: config/arm/arm.c:2669 config/arm/arm.c:2687 config/avr/avr.c:4676 #: config/c4x/c4x.c:4499 config/h8300/h8300.c:5755 config/i386/i386.c:1704 #: config/i386/i386.c:1750 config/ip2k/ip2k.c:3182 #: config/m68hc11/m68hc11.c:1348 config/m68k/m68k.c:288 #: config/mcore/mcore.c:3379 config/ns32k/ns32k.c:1073 -#: config/rs6000/rs6000.c:17260 config/sh/sh.c:7188 config/sh/sh.c:7209 +#: config/rs6000/rs6000.c:17375 config/sh/sh.c:7188 config/sh/sh.c:7209 #: config/sh/sh.c:7244 config/stormy16/stormy16.c:2413 config/v850/v850.c:2210 #, fuzzy, c-format msgid "%qs attribute only applies to functions" @@ -8236,7 +8240,7 @@ msgid "selector must be an immediate" msgstr "" #. @@@ better error message -#: config/arm/arm.c:12231 config/i386/i386.c:14446 config/i386/i386.c:14480 +#: config/arm/arm.c:12231 config/i386/i386.c:14498 config/i386/i386.c:14532 msgid "mask must be an immediate" msgstr "" @@ -8356,7 +8360,7 @@ msgstr "" msgid "Specify the register to be used for PIC addressing" msgstr "" -#: config/arm/arm.h:396 config/mips/mips.h:784 +#: config/arm/arm.h:396 config/mips/mips.h:792 msgid "Specify an ABI" msgstr "" @@ -8377,61 +8381,65 @@ msgstr "" msgid "large frame pointer change (%d) with -mtiny-stack" msgstr "" -#: config/avr/avr.c:1119 +#: config/avr/avr.c:1117 msgid "bad address, not (reg+disp):" msgstr "" -#: config/avr/avr.c:1127 +#: config/avr/avr.c:1124 +msgid "bad address, not post_inc or pre_dec:" +msgstr "" + +#: config/avr/avr.c:1135 msgid "internal compiler error. Bad address:" msgstr "" -#: config/avr/avr.c:1140 +#: config/avr/avr.c:1148 msgid "internal compiler error. Unknown mode:" msgstr "" -#: config/avr/avr.c:1763 config/avr/avr.c:2424 +#: config/avr/avr.c:1771 config/avr/avr.c:2454 #, fuzzy msgid "invalid insn:" msgstr "Нерэчаісны выбар %s" -#: config/avr/avr.c:1797 config/avr/avr.c:1880 config/avr/avr.c:1929 -#: config/avr/avr.c:1938 config/avr/avr.c:2033 config/avr/avr.c:2202 -#: config/avr/avr.c:2458 config/avr/avr.c:2566 +#: config/avr/avr.c:1805 config/avr/avr.c:1891 config/avr/avr.c:1940 +#: config/avr/avr.c:1968 config/avr/avr.c:2063 config/avr/avr.c:2232 +#: config/avr/avr.c:2488 config/avr/avr.c:2600 msgid "incorrect insn:" msgstr "" -#: config/avr/avr.c:1957 config/avr/avr.c:2118 config/avr/avr.c:2273 -#: config/avr/avr.c:2610 +#: config/avr/avr.c:1987 config/avr/avr.c:2148 config/avr/avr.c:2303 +#: config/avr/avr.c:2666 msgid "unknown move insn:" msgstr "" -#: config/avr/avr.c:2840 +#: config/avr/avr.c:2896 msgid "bad shift insn:" msgstr "" -#: config/avr/avr.c:2956 config/avr/avr.c:3404 config/avr/avr.c:3790 +#: config/avr/avr.c:3012 config/avr/avr.c:3460 config/avr/avr.c:3846 msgid "internal compiler error. Incorrect shift:" msgstr "" -#: config/avr/avr.c:4594 config/ip2k/ip2k.c:3157 +#: config/avr/avr.c:4650 config/ip2k/ip2k.c:3157 msgid "only initialized variables can be placed into program memory area" msgstr "" -#: config/avr/avr.c:4637 +#: config/avr/avr.c:4693 #, c-format msgid "`%s' appears to be a misspelled interrupt handler" msgstr "" -#: config/avr/avr.c:4645 +#: config/avr/avr.c:4701 #, c-format msgid "`%s' appears to be a misspelled signal handler" msgstr "" -#: config/avr/avr.c:4714 +#: config/avr/avr.c:4770 msgid "only uninitialized variables can be placed in the .noinit section" msgstr "" -#: config/avr/avr.c:4728 +#: config/avr/avr.c:4784 #, c-format msgid "MCU %qs supported for assembler only" msgstr "" @@ -8601,6 +8609,11 @@ msgstr "" msgid "c4x_rptb_rpts_p: Repeat block top label moved\n" msgstr "" +#. Name of the c4x assembler. +#. Name of the c4x linker. +#. Define assembler options. +#. Define linker options. +#. Specify the end file to link with. #. Target compilation option flags. #. Small memory model. #. Use 24-bit MPYI for C3x. @@ -9247,7 +9260,6 @@ msgstr "" #. #define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)"); #. #endif #: config/frv/frv.h:550 -#, c-format msgid " (frv)" msgstr "" @@ -9331,12 +9343,22 @@ msgstr "" msgid "Use H8/300 alignment rules" msgstr "" +#: config/i386/host-cygwin.c:65 +#, fuzzy, c-format +msgid "can't extend PCH file: %m" +msgstr "немагчыма стварыць часовы файл" + +#: config/i386/host-cygwin.c:76 +#, fuzzy, c-format +msgid "can't set position in PCH file: %m" +msgstr "немагчыма зачыніць уваходзячы файл %s" + #: config/i386/i386.c:1242 #, c-format msgid "code model %s not supported in PIC mode" msgstr "" -#: config/i386/i386.c:1252 config/sparc/sparc.c:611 +#: config/i386/i386.c:1252 config/sparc/sparc.c:616 #, c-format msgid "bad value (%s) for -mcmodel= switch" msgstr "" @@ -9459,59 +9481,59 @@ msgstr "" msgid "SSE register argument with SSE disabled" msgstr "" -#: config/i386/i386.c:2862 +#: config/i386/i386.c:2867 msgid "SSE vector argument without SSE enabled changes the ABI" msgstr "" -#: config/i386/i386.c:2879 +#: config/i386/i386.c:2884 msgid "MMX vector argument without MMX enabled changes the ABI" msgstr "" -#: config/i386/i386.c:3127 +#: config/i386/i386.c:3132 msgid "SSE vector return without SSE enabled changes the ABI" msgstr "" -#: config/i386/i386.c:6003 +#: config/i386/i386.c:6029 msgid "invalid UNSPEC as operand" msgstr "" -#: config/i386/i386.c:6241 +#: config/i386/i386.c:6267 msgid "extended registers have no high halves" msgstr "" -#: config/i386/i386.c:6256 +#: config/i386/i386.c:6282 msgid "unsupported operand size for extended register" msgstr "" -#: config/i386/i386.c:6572 +#: config/i386/i386.c:6598 msgid "operand is neither a constant nor a condition code, invalid operand code 'c'" msgstr "" -#: config/i386/i386.c:6625 +#: config/i386/i386.c:6651 #, fuzzy, c-format msgid "invalid operand code '%c'" msgstr "Нерэчаісны выбар \"%s\"" -#: config/i386/i386.c:6668 +#: config/i386/i386.c:6694 #, fuzzy msgid "invalid constraints for operand" msgstr "нерэчаісны %%c аперанд" -#: config/i386/i386.c:11919 +#: config/i386/i386.c:11971 #, fuzzy msgid "unknown insn mode" msgstr "невядомы рэжым машыны \"%s\"" -#: config/i386/i386.c:14174 +#: config/i386/i386.c:14226 #, c-format msgid "selector must be an integer constant in the range 0..%i" msgstr "" -#: config/i386/i386.c:14512 +#: config/i386/i386.c:14564 msgid "shift must be an immediate" msgstr "" -#: config/i386/i386.c:15634 +#: config/i386/i386.c:15703 #, fuzzy, c-format msgid "%qs incompatible attribute ignored" msgstr "\"%s\" атрыбут ігнарыруецца" @@ -9788,7 +9810,7 @@ msgstr "" #. option if the fixed part matches. The actual option name is made #. by appending `-m' to the specified name. #: config/i386/i386.h:471 config/ia64/ia64.h:280 config/rs6000/rs6000.h:453 -#: config/s390/s390.h:158 config/sparc/sparc.h:717 +#: config/s390/s390.h:158 config/sparc/sparc.h:720 msgid "Schedule code for given CPU" msgstr "" @@ -9895,41 +9917,41 @@ msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэк msgid "%Jaddress area attribute cannot be specified for functions" msgstr "\"%s\" звычайна функцыя" -#: config/ia64/ia64.c:4183 +#: config/ia64/ia64.c:4187 msgid "ia64_print_operand: unknown code" msgstr "" -#: config/ia64/ia64.c:4556 config/pa/pa.c:324 +#: config/ia64/ia64.c:4560 config/pa/pa.c:330 msgid "value of -mfixed-range must have form REG1-REG2" msgstr "" -#: config/ia64/ia64.c:4583 config/pa/pa.c:351 +#: config/ia64/ia64.c:4587 config/pa/pa.c:357 #, c-format msgid "%s-%s is an empty range" msgstr "" -#: config/ia64/ia64.c:4634 +#: config/ia64/ia64.c:4638 msgid "cannot optimize floating point division for both latency and throughput" msgstr "" -#: config/ia64/ia64.c:4651 +#: config/ia64/ia64.c:4655 msgid "cannot optimize integer division for both latency and throughput" msgstr "" -#: config/ia64/ia64.c:4668 +#: config/ia64/ia64.c:4672 msgid "cannot optimize square root for both latency and throughput" msgstr "" -#: config/ia64/ia64.c:4682 +#: config/ia64/ia64.c:4686 msgid "not yet implemented: latency-optimized inline square root" msgstr "" -#: config/ia64/ia64.c:4694 +#: config/ia64/ia64.c:4698 #, c-format msgid "bad value (%s) for -mtls-size= switch" msgstr "" -#: config/ia64/ia64.c:4710 +#: config/ia64/ia64.c:4714 #, c-format msgid "bad value (%s) for -tune= switch" msgstr "" @@ -10083,7 +10105,7 @@ msgstr "" msgid "PRINT_OPERAND: Unknown punctuation '%c'" msgstr "" -#: config/iq2000/iq2000.c:3314 config/mips/mips.c:4832 +#: config/iq2000/iq2000.c:3314 config/mips/mips.c:4838 #: config/xtensa/xtensa.c:1887 msgid "PRINT_OPERAND null pointer" msgstr "" @@ -10093,12 +10115,12 @@ msgstr "" msgid "invalid %%P operand" msgstr "нерэчаісны %%-код" -#: config/iq2000/iq2000.c:3391 config/rs6000/rs6000.c:10736 +#: config/iq2000/iq2000.c:3391 config/rs6000/rs6000.c:10864 #, c-format msgid "invalid %%p value" msgstr "" -#: config/iq2000/iq2000.c:3455 config/mips/mips.c:4958 +#: config/iq2000/iq2000.c:3455 config/mips/mips.c:4964 #, c-format msgid "invalid use of %%d, %%x, or %%X" msgstr "" @@ -10115,27 +10137,27 @@ msgstr "" msgid "Don't use GP relative sdata/sbss sections" msgstr "" -#: config/iq2000/iq2000.h:78 config/mips/mips.h:589 +#: config/iq2000/iq2000.h:78 config/mips/mips.h:593 msgid "Use ROM instead of RAM" msgstr "" -#: config/iq2000/iq2000.h:80 config/mips/mips.h:591 +#: config/iq2000/iq2000.h:80 config/mips/mips.h:595 msgid "Don't use ROM instead of RAM" msgstr "" -#: config/iq2000/iq2000.h:82 config/mips/mips.h:593 +#: config/iq2000/iq2000.h:82 config/mips/mips.h:597 msgid "Put uninitialized constants in ROM (needs -membedded-data)" msgstr "" -#: config/iq2000/iq2000.h:84 config/mips/mips.h:595 +#: config/iq2000/iq2000.h:84 config/mips/mips.h:599 msgid "Don't put uninitialized constants in ROM" msgstr "" -#: config/iq2000/iq2000.h:106 config/mips/mips.h:780 +#: config/iq2000/iq2000.h:106 config/mips/mips.h:788 msgid "Specify CPU for scheduling purposes" msgstr "" -#: config/iq2000/iq2000.h:108 config/mips/mips.h:782 +#: config/iq2000/iq2000.h:108 config/mips/mips.h:790 msgid "Specify CPU for code generation purposes" msgstr "" @@ -10191,7 +10213,7 @@ msgid "post-increment address is not a register" msgstr "" #: config/m32r/m32r.c:2366 config/m32r/m32r.c:2382 -#: config/rs6000/rs6000.c:17465 +#: config/rs6000/rs6000.c:17580 msgid "bad address" msgstr "дрэнны адрас" @@ -10225,11 +10247,11 @@ msgstr "" msgid "Small data area: none, sdata, use" msgstr "" -#: config/m32r/m32r.h:316 config/mips/mips.h:788 +#: config/m32r/m32r.h:316 config/mips/mips.h:796 msgid "Don't call any cache flush functions" msgstr "" -#: config/m32r/m32r.h:318 config/mips/mips.h:790 +#: config/m32r/m32r.h:318 config/mips/mips.h:798 msgid "Specify cache flush function" msgstr "" @@ -10384,7 +10406,7 @@ msgstr "" msgid "-fPIC is not currently supported on the 68000 or 68010\n" msgstr "" -#: config/m68k/m68k.c:547 config/rs6000/rs6000.c:13592 +#: config/m68k/m68k.c:547 config/rs6000/rs6000.c:13707 msgid "stack limit expression is not supported" msgstr "" @@ -10583,131 +10605,136 @@ msgstr "" msgid "Maximum amount for a single stack increment operation" msgstr "" -#: config/mips/mips.c:4025 +#: config/mips/mips.c:4028 #, c-format msgid "bad value (%s) for -mabi= switch" msgstr "" -#: config/mips/mips.c:4048 +#: config/mips/mips.c:4051 #, c-format msgid "-mips%s conflicts with the other architecture options, which specify a MIPS%d processor" msgstr "" -#: config/mips/mips.c:4067 +#: config/mips/mips.c:4070 #, c-format msgid "-march=%s is not compatible with the selected ABI" msgstr "" -#: config/mips/mips.c:4082 +#: config/mips/mips.c:4085 msgid "-mgp64 used with a 32-bit processor" msgstr "" -#: config/mips/mips.c:4084 +#: config/mips/mips.c:4087 msgid "-mgp32 used with a 64-bit ABI" msgstr "" -#: config/mips/mips.c:4086 +#: config/mips/mips.c:4089 msgid "-mgp64 used with a 32-bit ABI" msgstr "" -#: config/mips/mips.c:4104 config/mips/mips.c:4106 config/mips/mips.c:4108 -#: config/mips/mips.c:4192 +#: config/mips/mips.c:4107 config/mips/mips.c:4109 config/mips/mips.c:4111 +#: config/mips/mips.c:4198 #, fuzzy, c-format msgid "unsupported combination: %s" msgstr "непадтрымліваемая версія" -#: config/mips/mips.c:4136 +#: config/mips/mips.c:4139 msgid "-mint64 is a deprecated option" msgstr "" -#: config/mips/mips.c:4187 +#: config/mips/mips.c:4142 +#, fuzzy +msgid "unrecognized option %<-mfix-vr4130%s%>" +msgstr "нераспазнаны выбар \"-%s\"" + +#: config/mips/mips.c:4193 msgid "generation of Branch Likely instructions enabled, but not supported by architecture" msgstr "" -#: config/mips/mips.c:4204 +#: config/mips/mips.c:4210 msgid "-G is incompatible with PIC code which is the default" msgstr "" -#: config/mips/mips.c:4271 +#: config/mips/mips.c:4277 msgid "-mips3d requires -mpaired-single" msgstr "" -#: config/mips/mips.c:4280 +#: config/mips/mips.c:4286 msgid "-mips3d/-mpaired-single must be used with -mfp64 -mhard-float" msgstr "" -#: config/mips/mips.c:4285 +#: config/mips/mips.c:4291 msgid "-mips3d/-mpaired-single must be used with -mips64" msgstr "" -#: config/mips/mips.c:4643 +#: config/mips/mips.c:4649 msgid "mips_debugger_offset called with non stack/frame/arg pointer" msgstr "" -#: config/mips/mips.c:4769 +#: config/mips/mips.c:4775 #, c-format msgid "internal error: %%) found without a %%( in assembler pattern" msgstr "" -#: config/mips/mips.c:4783 +#: config/mips/mips.c:4789 #, c-format msgid "internal error: %%] found without a %%[ in assembler pattern" msgstr "" -#: config/mips/mips.c:4796 +#: config/mips/mips.c:4802 #, c-format msgid "internal error: %%> found without a %%< in assembler pattern" msgstr "" -#: config/mips/mips.c:4809 +#: config/mips/mips.c:4815 #, c-format msgid "internal error: %%} found without a %%{ in assembler pattern" msgstr "" -#: config/mips/mips.c:4823 +#: config/mips/mips.c:4829 #, c-format msgid "PRINT_OPERAND: unknown punctuation '%c'" msgstr "" -#: config/mips/mips.c:4852 +#: config/mips/mips.c:4858 #, c-format msgid "PRINT_OPERAND, invalid insn for %%C" msgstr "" -#: config/mips/mips.c:4869 +#: config/mips/mips.c:4875 #, c-format msgid "PRINT_OPERAND, invalid insn for %%N" msgstr "" -#: config/mips/mips.c:4878 +#: config/mips/mips.c:4884 #, c-format msgid "PRINT_OPERAND, invalid insn for %%F" msgstr "" -#: config/mips/mips.c:4887 +#: config/mips/mips.c:4893 #, c-format msgid "PRINT_OPERAND, invalid insn for %%W" msgstr "" -#: config/mips/mips.c:4908 +#: config/mips/mips.c:4914 #, fuzzy, c-format msgid "invalid %%Y value" msgstr "дрэннае %%Q значэнне" -#: config/mips/mips.c:4986 +#: config/mips/mips.c:4992 msgid "PRINT_OPERAND, invalid operand for relocation" msgstr "" -#: config/mips/mips.c:7573 +#: config/mips/mips.c:7589 #, c-format msgid "cannot handle inconsistent calls to %qs" msgstr "" -#: config/mips/mips.c:8963 +#: config/mips/mips.c:8989 msgid "the cpu name must be lower case" msgstr "" -#: config/mips/mips.c:8985 +#: config/mips/mips.c:9011 #, c-format msgid "bad value (%s) for %s" msgstr "" @@ -10723,64 +10750,64 @@ msgstr "" #. each pair being { "NAME", VALUE } #. where VALUE is the bits to set or minus the bits to clear. #. An empty string NAME is used to identify the default VALUE. -#: config/mips/mips.h:537 +#: config/mips/mips.h:541 msgid "Use 64-bit int type" msgstr "" -#: config/mips/mips.h:539 +#: config/mips/mips.h:543 msgid "Use 64-bit long type" msgstr "" -#: config/mips/mips.h:541 +#: config/mips/mips.h:545 msgid "Use 32-bit long type" msgstr "" -#: config/mips/mips.h:543 +#: config/mips/mips.h:547 msgid "Optimize lui/addiu address loads" msgstr "" -#: config/mips/mips.h:545 +#: config/mips/mips.h:549 msgid "Don't optimize lui/addiu address loads" msgstr "" -#: config/mips/mips.h:547 +#: config/mips/mips.h:551 msgid "Use GNU as (now ignored)" msgstr "" -#: config/mips/mips.h:549 config/mips/mips.h:551 +#: config/mips/mips.h:553 config/mips/mips.h:555 msgid "Use GP relative sdata/sbss sections (now ignored)" msgstr "" -#: config/mips/mips.h:553 config/mips/mips.h:555 +#: config/mips/mips.h:557 config/mips/mips.h:559 msgid "Don't use GP relative sdata/sbss sections (now ignored)" msgstr "" -#: config/mips/mips.h:557 +#: config/mips/mips.h:561 #, fuzzy msgid "Output compiler statistics (now ignored)" msgstr "Вывесці статыстыку капілятара" -#: config/mips/mips.h:559 +#: config/mips/mips.h:563 msgid "Don't output compiler statistics" msgstr "Не выводзіць статыстыку кампілятара" -#: config/mips/mips.h:561 +#: config/mips/mips.h:565 msgid "Don't optimize block moves" msgstr "" -#: config/mips/mips.h:563 +#: config/mips/mips.h:567 msgid "Optimize block moves" msgstr "" -#: config/mips/mips.h:565 +#: config/mips/mips.h:569 msgid "Use mips-tfile asm postpass" msgstr "" -#: config/mips/mips.h:567 +#: config/mips/mips.h:571 msgid "Don't use mips-tfile asm postpass" msgstr "" -#: config/mips/mips.h:569 config/pa/pa.h:288 +#: config/mips/mips.h:573 config/pa/pa.h:288 msgid "Use software floating point" msgstr "" @@ -10790,198 +10817,211 @@ msgstr "" #. where VALUE is the bits to set or minus the bits to clear and DOC #. is the documentation for --help (NULL if intentionally undocumented). #. An empty string NAME is used to identify the default VALUE. -#: config/mips/mips.h:571 config/pdp11/pdp11.h:61 config/rs6000/rs6000.h:329 +#: config/mips/mips.h:575 config/pdp11/pdp11.h:61 config/rs6000/rs6000.h:329 msgid "Use hardware floating point" msgstr "Выкарыстоўваць апаратную \"плаваючую кропку\"" -#: config/mips/mips.h:573 +#: config/mips/mips.h:577 msgid "Use 64-bit FP registers" msgstr "Выкарыстоўваць 64-бітныя FP-рэгістры" -#: config/mips/mips.h:575 +#: config/mips/mips.h:579 msgid "Use 32-bit FP registers" msgstr "Выкарыстоўваць 32-бітныя FP-рэгістры" -#: config/mips/mips.h:577 +#: config/mips/mips.h:581 msgid "Use 64-bit general registers" msgstr "Выкарыстоўваць 64-бітныя галоўныя рэгістры" -#: config/mips/mips.h:579 +#: config/mips/mips.h:583 msgid "Use 32-bit general registers" msgstr "Выкарыстоўваць 32-бітныя галоўныя рэгістры" -#: config/mips/mips.h:581 +#: config/mips/mips.h:585 msgid "Use Irix PIC" msgstr "Выкарыстоўваць Irix PIC" -#: config/mips/mips.h:583 +#: config/mips/mips.h:587 msgid "Don't use Irix PIC" msgstr "Не выкарыстоўваць Irix PIC" -#: config/mips/mips.h:585 +#: config/mips/mips.h:589 msgid "Use indirect calls" msgstr "" -#: config/mips/mips.h:587 +#: config/mips/mips.h:591 msgid "Don't use indirect calls" msgstr "" -#: config/mips/mips.h:597 +#: config/mips/mips.h:601 msgid "Use big-endian byte order" msgstr "" -#: config/mips/mips.h:599 +#: config/mips/mips.h:603 msgid "Use little-endian byte order" msgstr "" -#: config/mips/mips.h:601 +#: config/mips/mips.h:605 msgid "Use single (32-bit) FP only" msgstr "" -#: config/mips/mips.h:603 +#: config/mips/mips.h:607 msgid "Don't use single (32-bit) FP only" msgstr "" -#: config/mips/mips.h:605 config/mips/mips.h:607 +#: config/mips/mips.h:609 config/mips/mips.h:611 #, fuzzy msgid "Use paired-single floating point instructions" msgstr "Выкарыстоўваць апаратную \"плаваючую кропку\"" -#: config/mips/mips.h:609 config/mips/mips.h:611 +#: config/mips/mips.h:613 config/mips/mips.h:615 msgid "Use MIPS-3D instructions" msgstr "" -#: config/mips/mips.h:613 +#: config/mips/mips.h:617 msgid "Use multiply accumulate" msgstr "" -#: config/mips/mips.h:615 +#: config/mips/mips.h:619 msgid "Don't use multiply accumulate" msgstr "" -#: config/mips/mips.h:617 +#: config/mips/mips.h:621 msgid "Don't generate fused multiply/add instructions" msgstr "" -#: config/mips/mips.h:619 config/rs6000/rs6000.h:345 +#: config/mips/mips.h:623 config/rs6000/rs6000.h:345 msgid "Generate fused multiply/add instructions" msgstr "" -#: config/mips/mips.h:621 +#: config/mips/mips.h:625 msgid "Perform VR4130-specific alignment optimizations" msgstr "" -#: config/mips/mips.h:623 +#: config/mips/mips.h:627 msgid "Don't perform VR4130-specific alignment optimizations" msgstr "" -#: config/mips/mips.h:625 +#: config/mips/mips.h:629 msgid "Work around early 4300 hardware bug" msgstr "" -#: config/mips/mips.h:627 +#: config/mips/mips.h:631 msgid "Don't work around early 4300 hardware bug" msgstr "" -#: config/mips/mips.h:629 +#: config/mips/mips.h:633 msgid "Work around errata for early SB-1 revision 2 cores" msgstr "" -#: config/mips/mips.h:631 +#: config/mips/mips.h:635 msgid "Don't work around errata for early SB-1 revision 2 cores" msgstr "" -#: config/mips/mips.h:633 +#: config/mips/mips.h:637 msgid "Work around R4000 errata" msgstr "" -#: config/mips/mips.h:635 +#: config/mips/mips.h:639 msgid "Don't work around R4000 errata" msgstr "" -#: config/mips/mips.h:637 +#: config/mips/mips.h:641 msgid "Work around R4400 errata" msgstr "" -#: config/mips/mips.h:639 +#: config/mips/mips.h:643 msgid "Don't work around R4400 errata" msgstr "" -#: config/mips/mips.h:641 +#: config/mips/mips.h:645 msgid "Work around certain VR4120 errata" msgstr "" -#: config/mips/mips.h:643 +#: config/mips/mips.h:647 msgid "Don't work around certain VR4120 errata" msgstr "" -#: config/mips/mips.h:645 +#: config/mips/mips.h:649 msgid "Trap on integer divide by zero" msgstr "" -#: config/mips/mips.h:647 +#: config/mips/mips.h:651 msgid "Don't trap on integer divide by zero" msgstr "" -#: config/mips/mips.h:649 +#: config/mips/mips.h:653 msgid "Use trap to check for integer divide by zero" msgstr "" -#: config/mips/mips.h:651 +#: config/mips/mips.h:655 msgid "Use break to check for integer divide by zero" msgstr "" -#: config/mips/mips.h:653 +#: config/mips/mips.h:657 msgid "Use Branch Likely instructions, overriding default for arch" msgstr "" -#: config/mips/mips.h:655 +#: config/mips/mips.h:659 msgid "Don't use Branch Likely instructions, overriding default for arch" msgstr "" -#: config/mips/mips.h:657 +#: config/mips/mips.h:661 msgid "Use NewABI-style %reloc() assembly operators" msgstr "" -#: config/mips/mips.h:659 +#: config/mips/mips.h:663 msgid "Use assembler macros instead of relocation operators" msgstr "" -#: config/mips/mips.h:661 +#: config/mips/mips.h:665 #, fuzzy msgid "Generate mips16 code" msgstr "Стварыць код для DLL" -#: config/mips/mips.h:663 +#: config/mips/mips.h:667 #, fuzzy msgid "Generate normal-mode code" msgstr "Генерыраваць код для GNU ld" -#: config/mips/mips.h:665 +#: config/mips/mips.h:669 msgid "Lift restrictions on GOT size" msgstr "" -#: config/mips/mips.h:667 +#: config/mips/mips.h:671 msgid "Do not lift restrictions on GOT size" msgstr "" -#: config/mips/mips.h:669 +#: config/mips/mips.h:673 #, fuzzy msgid "FP exceptions are enabled" msgstr "выбары ўключаны:" -#: config/mips/mips.h:671 +#: config/mips/mips.h:675 #, fuzzy msgid "FP exceptions are not enabled" msgstr "выбары ўключаны:" -#: config/mips/mips.h:786 +#: config/mips/mips.h:677 +msgid "Assume all symbols have 32-bit values" +msgstr "" + +#: config/mips/mips.h:679 +#, fuzzy +msgid "Don't assume all symbols have 32-bit values" +msgstr "Не ўжываць сімвалічныя назва рэгістраў" + +#: config/mips/mips.h:794 msgid "Specify a Standard MIPS ISA" msgstr "" +#: config/mips/mips.h:800 +msgid "Work around VR4130 mflo/mfhi errata" +msgstr "" + #. Output assembler code to FILE to increment profiler label # LABELNO #. for profiling a function entry. -#: config/mips/mips.h:2318 +#: config/mips/mips.h:2334 msgid "mips16 function profiling" msgstr "" @@ -11075,6 +11115,23 @@ msgstr "" msgid "MMIX Internal: This is not a constant:" msgstr "" +#. For these target macros, there is no generic documentation here. You +#. should read `Using and Porting GCC' for that. Only comments specific +#. to the MMIX target are here. +#. +#. There are however references to the specific texinfo node (comments +#. with "Node:"), so there should be little or nothing amiss. Probably +#. the opposite, since we don't have to care about old littering and +#. soon outdated generic comments. +#. Node: Driver +#. User symbols are in the same name-space as built-in symbols, but we +#. don't need the built-in symbols, so remove those and instead apply +#. stricter operand checking. Don't warn when expanding insns. +#. Pass on -mset-program-start=N and -mset-data-start=M to the linker. +#. Provide default program start 0x100 unless -mno-set-program-start. +#. Don't do this if linking relocatably, with -r. For a final link, +#. produce mmo, unless ELF is requested or when linking relocatably. +#. Put unused option values here. #: config/mmix/mmix.h:132 msgid "Set start-address of the program" msgstr "" @@ -11239,58 +11296,58 @@ msgstr "" msgid "No \"Small register classes\" kludge" msgstr "" -#: config/pa/pa.c:412 +#: config/pa/pa.c:418 #, c-format msgid "" "unknown -mschedule= option (%s).\n" "Valid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n" msgstr "" -#: config/pa/pa.c:437 +#: config/pa/pa.c:443 #, c-format msgid "" "unknown -march= option (%s).\n" "Valid options are 1.0, 1.1, and 2.0\n" msgstr "" -#: config/pa/pa.c:457 +#: config/pa/pa.c:463 #, c-format msgid "" "unknown -munix= option (%s).\n" "Valid options are 93, 95 and 98.\n" msgstr "" -#: config/pa/pa.c:462 +#: config/pa/pa.c:468 #, c-format msgid "" "unknown -munix= option (%s).\n" "Valid options are 93 and 95.\n" msgstr "" -#: config/pa/pa.c:466 +#: config/pa/pa.c:472 #, c-format msgid "" "unknown -munix= option (%s).\n" "Valid option is 93.\n" msgstr "" -#: config/pa/pa.c:483 +#: config/pa/pa.c:489 msgid "PIC code generation is not supported in the portable runtime model\n" msgstr "" -#: config/pa/pa.c:488 +#: config/pa/pa.c:494 msgid "PIC code generation is not compatible with fast indirect calls\n" msgstr "" -#: config/pa/pa.c:493 +#: config/pa/pa.c:499 msgid "-g is only supported when using GAS on this processor," msgstr "" -#: config/pa/pa.c:494 +#: config/pa/pa.c:500 msgid "-g option disabled" msgstr "" -#: config/pa/pa.c:8338 +#: config/pa/pa.c:8348 #, c-format msgid "alignment (%u) for %s exceeds maximum alignment for global common data. Using %u" msgstr "" @@ -11604,234 +11661,234 @@ msgstr "" msgid "junk at end of #pragma longcall" msgstr "" -#: config/rs6000/rs6000.c:1254 +#: config/rs6000/rs6000.c:1262 msgid "-mmultiple is not supported on little endian systems" msgstr "" -#: config/rs6000/rs6000.c:1261 +#: config/rs6000/rs6000.c:1269 msgid "-mstring is not supported on little endian systems" msgstr "" -#: config/rs6000/rs6000.c:1275 +#: config/rs6000/rs6000.c:1283 #, c-format msgid "unknown -mdebug-%s switch" msgstr "" -#: config/rs6000/rs6000.c:1287 +#: config/rs6000/rs6000.c:1295 msgid "unknown -mtraceback arg %qs; expecting %, % or %" msgstr "" -#: config/rs6000/rs6000.c:1298 +#: config/rs6000/rs6000.c:1306 #, c-format msgid "Unknown switch -mlong-double-%s" msgstr "" -#: config/rs6000/rs6000.c:1354 +#: config/rs6000/rs6000.c:1362 msgid "AltiVec and E500 instructions cannot coexist" msgstr "" -#: config/rs6000/rs6000.c:1622 +#: config/rs6000/rs6000.c:1630 #, fuzzy, c-format msgid "unknown -m%s= option specified: '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/rs6000/rs6000.c:1643 +#: config/rs6000/rs6000.c:1651 #, c-format msgid "not configured for ABI: '%s'" msgstr "" -#: config/rs6000/rs6000.c:1651 +#: config/rs6000/rs6000.c:1659 msgid "Using darwin64 ABI" msgstr "" -#: config/rs6000/rs6000.c:1656 +#: config/rs6000/rs6000.c:1664 msgid "Using old darwin ABI" msgstr "" -#: config/rs6000/rs6000.c:1662 +#: config/rs6000/rs6000.c:1670 #, fuzzy, c-format msgid "unknown ABI specified: '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/rs6000/rs6000.c:1679 +#: config/rs6000/rs6000.c:1687 #, fuzzy msgid "invalid option for -mfloat-gprs" msgstr "Нерэчаісны выбар \"%s\"" -#: config/rs6000/rs6000.c:1695 +#: config/rs6000/rs6000.c:1703 msgid "-malign-power is not supported for 64-bit Darwin; it is incompatible with the installed C and C++ libraries" msgstr "" -#: config/rs6000/rs6000.c:1702 +#: config/rs6000/rs6000.c:1710 #, fuzzy, c-format msgid "unknown -malign-XXXXX option specified: '%s'" msgstr "невядомы рэжым машыны \"%s\"" -#: config/rs6000/rs6000.c:4756 +#: config/rs6000/rs6000.c:4770 msgid "GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee" msgstr "" -#: config/rs6000/rs6000.c:4829 +#: config/rs6000/rs6000.c:4843 msgid "Cannot return value in vector register because altivec instructions are disabled, use -maltivec to enable them." msgstr "" -#: config/rs6000/rs6000.c:5018 +#: config/rs6000/rs6000.c:5075 msgid "Cannot pass argument in vector register because altivec instructions are disabled, use -maltivec to enable them." msgstr "" -#: config/rs6000/rs6000.c:5809 +#: config/rs6000/rs6000.c:5938 msgid "GCC vector passed by reference: non-standard ABI extension with no compatibility guarantee" msgstr "" -#: config/rs6000/rs6000.c:6704 +#: config/rs6000/rs6000.c:6833 #, fuzzy msgid "argument 1 must be a 5-bit signed literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:6807 config/rs6000/rs6000.c:7477 +#: config/rs6000/rs6000.c:6936 config/rs6000/rs6000.c:7606 #, fuzzy msgid "argument 2 must be a 5-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:6847 +#: config/rs6000/rs6000.c:6976 #, fuzzy msgid "argument 1 of __builtin_altivec_predicate must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/rs6000/rs6000.c:6901 +#: config/rs6000/rs6000.c:7030 #, fuzzy msgid "argument 1 of __builtin_altivec_predicate is out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: config/rs6000/rs6000.c:7063 +#: config/rs6000/rs6000.c:7192 #, fuzzy msgid "argument 3 must be a 4-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:7235 +#: config/rs6000/rs6000.c:7364 #, fuzzy, c-format msgid "argument to %qs must be a 2-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:7348 +#: config/rs6000/rs6000.c:7477 #, fuzzy msgid "argument to dss must be a 2-bit unsigned literal" msgstr "першым аргументам \"%s\" павінен быць \"int\"" -#: config/rs6000/rs6000.c:7363 +#: config/rs6000/rs6000.c:7492 #, c-format msgid "invalid parameter combination for %qs AltiVec intrinsic" msgstr "" -#: config/rs6000/rs6000.c:7597 +#: config/rs6000/rs6000.c:7726 #, fuzzy msgid "argument 1 of __builtin_spe_predicate must be a constant" msgstr "аргумент `__builtin_args_info' павінен быць канстантай" -#: config/rs6000/rs6000.c:7670 +#: config/rs6000/rs6000.c:7799 #, fuzzy msgid "argument 1 of __builtin_spe_predicate is out of range" msgstr "аргумент `__builtin_args_info' выйшаў за межы" -#: config/rs6000/rs6000.c:10566 +#: config/rs6000/rs6000.c:10694 #, c-format msgid "invalid %%f value" msgstr "" -#: config/rs6000/rs6000.c:10575 +#: config/rs6000/rs6000.c:10703 #, c-format msgid "invalid %%F value" msgstr "" -#: config/rs6000/rs6000.c:10584 +#: config/rs6000/rs6000.c:10712 #, c-format msgid "invalid %%G value" msgstr "" -#: config/rs6000/rs6000.c:10619 +#: config/rs6000/rs6000.c:10747 #, c-format msgid "invalid %%j code" msgstr "" -#: config/rs6000/rs6000.c:10629 +#: config/rs6000/rs6000.c:10757 #, c-format msgid "invalid %%J code" msgstr "" -#: config/rs6000/rs6000.c:10639 +#: config/rs6000/rs6000.c:10767 #, c-format msgid "invalid %%k value" msgstr "" -#: config/rs6000/rs6000.c:10659 config/xtensa/xtensa.c:1937 +#: config/rs6000/rs6000.c:10787 config/xtensa/xtensa.c:1937 #, c-format msgid "invalid %%K value" msgstr "" -#: config/rs6000/rs6000.c:10726 +#: config/rs6000/rs6000.c:10854 #, c-format msgid "invalid %%O value" msgstr "нерэчаіснае значэньне %%O" -#: config/rs6000/rs6000.c:10773 +#: config/rs6000/rs6000.c:10901 #, c-format msgid "invalid %%q value" msgstr "" -#: config/rs6000/rs6000.c:10817 +#: config/rs6000/rs6000.c:10945 #, c-format msgid "invalid %%S value" msgstr "" -#: config/rs6000/rs6000.c:10859 +#: config/rs6000/rs6000.c:10987 #, c-format msgid "invalid %%T value" msgstr "" -#: config/rs6000/rs6000.c:10869 +#: config/rs6000/rs6000.c:10997 #, c-format msgid "invalid %%u value" msgstr "" -#: config/rs6000/rs6000.c:10878 config/xtensa/xtensa.c:1907 +#: config/rs6000/rs6000.c:11006 config/xtensa/xtensa.c:1907 #, c-format msgid "invalid %%v value" msgstr "" -#: config/rs6000/rs6000.c:13555 +#: config/rs6000/rs6000.c:13670 #, fuzzy msgid "stack frame too large" msgstr "%s - вельмі вялікі" -#: config/rs6000/rs6000.c:16073 +#: config/rs6000/rs6000.c:16188 msgid "no profiling of 64-bit code for this ABI" msgstr "" -#: config/rs6000/rs6000.c:17163 +#: config/rs6000/rs6000.c:17278 msgid "use of % in AltiVec types is invalid for 64-bit code" msgstr "" -#: config/rs6000/rs6000.c:17165 +#: config/rs6000/rs6000.c:17280 msgid "use of % in AltiVec types is deprecated; use %" msgstr "" -#: config/rs6000/rs6000.c:17169 +#: config/rs6000/rs6000.c:17284 msgid "use of % in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:17171 +#: config/rs6000/rs6000.c:17286 msgid "use of % in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:17173 +#: config/rs6000/rs6000.c:17288 msgid "use of % in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:17175 +#: config/rs6000/rs6000.c:17290 msgid "use of boolean types in AltiVec types is invalid" msgstr "" -#: config/rs6000/rs6000.c:17177 +#: config/rs6000/rs6000.c:17292 msgid "use of % in AltiVec types is invalid" msgstr "" @@ -12068,7 +12125,7 @@ msgstr "Не генерыраваць сімвальныя інструкцыі" msgid "Do not generate single field mfcr instruction" msgstr "Не генерыраваць сімвальныя інструкцыі" -#: config/rs6000/rs6000.h:451 config/sparc/sparc.h:715 +#: config/rs6000/rs6000.h:451 config/sparc/sparc.h:718 msgid "Use features of and schedule code for given CPU" msgstr "" @@ -12140,7 +12197,7 @@ msgstr "" #. Number of bytes into the frame return addresses can be found. See #. rs6000_stack_info in rs6000.c for more information on how the different #. abi's store the return address. -#: config/rs6000/rs6000.h:1830 +#: config/rs6000/rs6000.h:1833 msgid "RETURN_ADDRESS_OFFSET not supported" msgstr "" @@ -12348,28 +12405,28 @@ msgstr "" msgid "-mstack-guard implies use of -mstack-size" msgstr "" -#: config/s390/s390.c:4310 +#: config/s390/s390.c:4313 msgid "Cannot decompose address." msgstr "" -#: config/s390/s390.c:4502 +#: config/s390/s390.c:4505 msgid "UNKNOWN in print_operand !?" msgstr "" -#: config/s390/s390.c:6549 +#: config/s390/s390.c:6552 msgid "Total size of local variables exceeds architecture limit." msgstr "" -#: config/s390/s390.c:7085 +#: config/s390/s390.c:7088 #, fuzzy, c-format msgid "frame size of %qs is " msgstr "памер \"%s\" - %d байт" -#: config/s390/s390.c:7085 +#: config/s390/s390.c:7088 msgid " bytes" msgstr "" -#: config/s390/s390.c:7089 +#: config/s390/s390.c:7092 #, c-format msgid "%qs uses dynamic stack allocation" msgstr "" @@ -12475,7 +12532,6 @@ msgid "attribute interrupt_handler is not compatible with -m5-compact" msgstr "" #. The sp_switch attribute only has meaning for interrupt functions. -#. The trap_exit attribute only has meaning for interrupt functions. #: config/sh/sh.c:7216 config/sh/sh.c:7251 #, fuzzy, c-format msgid "%qs attribute only applies to interrupt functions" @@ -12521,7 +12577,7 @@ msgstr "" msgid "%Hexternal linkage required for symbol '%D' because of '%s' attribute." msgstr "" -#: config/sh/symbian.c:892 cp/tree.c:2286 +#: config/sh/symbian.c:892 cp/tree.c:2279 #, c-format msgid "lang_* check: failed in %s, at %s:%d" msgstr "" @@ -12534,69 +12590,69 @@ msgstr "" msgid "Profiling is not supported on this target." msgstr "__buitin_saveregs не падтрымліваецца гэтай мэтай" -#: config/sparc/sparc.c:584 +#: config/sparc/sparc.c:589 #, c-format msgid "%s is not supported by this configuration" msgstr "" -#: config/sparc/sparc.c:591 +#: config/sparc/sparc.c:596 msgid "-mlong-double-64 not allowed with -m64" msgstr "" -#: config/sparc/sparc.c:616 +#: config/sparc/sparc.c:621 msgid "-mcmodel= is not supported on 32 bit systems" msgstr "" -#: config/sparc/sparc.c:7325 config/sparc/sparc.c:7331 +#: config/sparc/sparc.c:7324 config/sparc/sparc.c:7330 #, c-format msgid "invalid %%Y operand" msgstr "нерэчаісны %%Y аперанд" -#: config/sparc/sparc.c:7401 +#: config/sparc/sparc.c:7400 #, c-format msgid "invalid %%A operand" msgstr "нерэчаісны %%A аперанд" -#: config/sparc/sparc.c:7411 +#: config/sparc/sparc.c:7410 #, c-format msgid "invalid %%B operand" msgstr "нерэчаісны %%B аперанд" -#: config/sparc/sparc.c:7450 +#: config/sparc/sparc.c:7449 #, c-format msgid "invalid %%c operand" msgstr "нерэчаісны %%c аперанд" -#: config/sparc/sparc.c:7451 +#: config/sparc/sparc.c:7450 #, c-format msgid "invalid %%C operand" msgstr "нерэчаісны %%C аперанд" -#: config/sparc/sparc.c:7472 +#: config/sparc/sparc.c:7471 #, c-format msgid "invalid %%d operand" msgstr "нерэчаісны %%d аперанд" -#: config/sparc/sparc.c:7473 +#: config/sparc/sparc.c:7472 #, c-format msgid "invalid %%D operand" msgstr "нерэчаісны %%D аперанд" -#: config/sparc/sparc.c:7489 +#: config/sparc/sparc.c:7488 #, c-format msgid "invalid %%f operand" msgstr "нерэчаісны %%f аперанд" -#: config/sparc/sparc.c:7503 +#: config/sparc/sparc.c:7502 #, fuzzy, c-format msgid "invalid %%s operand" msgstr "нерэчаісны %%f аперанд" -#: config/sparc/sparc.c:7557 +#: config/sparc/sparc.c:7556 msgid "long long constant not a valid immediate operand" msgstr "" -#: config/sparc/sparc.c:7560 +#: config/sparc/sparc.c:7559 msgid "floating point constant not a valid immediate operand" msgstr "" @@ -12622,95 +12678,95 @@ msgstr "" msgid "Use little-endian byte order for data" msgstr "" -#: config/sparc/sparc.h:632 +#: config/sparc/sparc.h:635 msgid "Assume possible double misalignment" msgstr "" -#: config/sparc/sparc.h:634 +#: config/sparc/sparc.h:637 msgid "Assume all doubles are aligned" msgstr "" -#: config/sparc/sparc.h:636 +#: config/sparc/sparc.h:639 msgid "Pass -assert pure-text to linker" msgstr "" -#: config/sparc/sparc.h:638 +#: config/sparc/sparc.h:641 msgid "Do not pass -assert pure-text to linker" msgstr "" -#: config/sparc/sparc.h:640 +#: config/sparc/sparc.h:643 msgid "Use ABI reserved registers" msgstr "" -#: config/sparc/sparc.h:642 +#: config/sparc/sparc.h:645 msgid "Do not use ABI reserved registers" msgstr "" -#: config/sparc/sparc.h:644 +#: config/sparc/sparc.h:647 msgid "Use hardware quad fp instructions" msgstr "" -#: config/sparc/sparc.h:646 +#: config/sparc/sparc.h:649 msgid "Do not use hardware quad fp instructions" msgstr "" -#: config/sparc/sparc.h:648 +#: config/sparc/sparc.h:651 msgid "Compile for v8plus ABI" msgstr "" -#: config/sparc/sparc.h:650 +#: config/sparc/sparc.h:653 msgid "Do not compile for v8plus ABI" msgstr "" -#: config/sparc/sparc.h:652 +#: config/sparc/sparc.h:655 msgid "Utilize Visual Instruction Set" msgstr "" -#: config/sparc/sparc.h:654 +#: config/sparc/sparc.h:657 msgid "Do not utilize Visual Instruction Set" msgstr "" -#: config/sparc/sparc.h:656 +#: config/sparc/sparc.h:659 msgid "Pointers are 64-bit" msgstr "" -#: config/sparc/sparc.h:658 +#: config/sparc/sparc.h:661 msgid "Pointers are 32-bit" msgstr "" -#: config/sparc/sparc.h:660 +#: config/sparc/sparc.h:663 msgid "Use 32-bit ABI" msgstr "" -#: config/sparc/sparc.h:662 +#: config/sparc/sparc.h:665 msgid "Use 64-bit ABI" msgstr "" -#: config/sparc/sparc.h:664 +#: config/sparc/sparc.h:667 msgid "Use stack bias" msgstr "" -#: config/sparc/sparc.h:666 +#: config/sparc/sparc.h:669 msgid "Do not use stack bias" msgstr "" -#: config/sparc/sparc.h:668 +#: config/sparc/sparc.h:671 msgid "Use structs on stronger alignment for double-word copies" msgstr "" -#: config/sparc/sparc.h:670 +#: config/sparc/sparc.h:673 msgid "Do not use structs on stronger alignment for double-word copies" msgstr "" -#: config/sparc/sparc.h:672 +#: config/sparc/sparc.h:675 msgid "Optimize tail call instructions in assembler and linker" msgstr "" -#: config/sparc/sparc.h:674 +#: config/sparc/sparc.h:677 msgid "Do not optimize tail call instructions in assembler or linker" msgstr "" -#: config/sparc/sparc.h:719 +#: config/sparc/sparc.h:722 msgid "Use given SPARC code model" msgstr "" @@ -13182,174 +13238,166 @@ msgstr "" msgid "no %<%D(int)%> declared for postfix %qs, trying prefix operator instead" msgstr "" -#: cp/call.c:3759 -msgid "using synthesized %q#D for copy assignment" -msgstr "" - -#: cp/call.c:3761 -msgid " where cfront would use %q#D" -msgstr "" - -#: cp/call.c:3793 +#: cp/call.c:3779 msgid "comparison between %q#T and %q#T" msgstr "" -#: cp/call.c:4052 +#: cp/call.c:4038 #, fuzzy msgid "no suitable % for %qT" msgstr "немагчымы апэратар '%s'" -#: cp/call.c:4069 +#: cp/call.c:4055 msgid "%q+#D is private" msgstr "" -#: cp/call.c:4071 +#: cp/call.c:4057 msgid "%q+#D is protected" msgstr "" -#: cp/call.c:4073 +#: cp/call.c:4059 msgid "%q+#D is inaccessible" msgstr "" -#: cp/call.c:4074 +#: cp/call.c:4060 msgid "within this context" msgstr "" -#: cp/call.c:4163 cp/cvt.c:263 +#: cp/call.c:4149 cp/cvt.c:263 #, fuzzy msgid "invalid conversion from %qT to %qT" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/call.c:4165 +#: cp/call.c:4151 msgid " initializing argument %P of %qD" msgstr "" -#: cp/call.c:4177 +#: cp/call.c:4163 msgid "passing NULL to non-pointer argument %P of %qD" msgstr "" -#: cp/call.c:4180 +#: cp/call.c:4166 msgid "converting to non-pointer type %qT from NULL" msgstr "" -#: cp/call.c:4188 +#: cp/call.c:4174 msgid "passing %qT for argument %P to %qD" msgstr "" -#: cp/call.c:4191 +#: cp/call.c:4177 #, fuzzy msgid "converting to %qT from %qT" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/call.c:4200 +#: cp/call.c:4186 msgid "passing negative value %qE for argument %P to %qD" msgstr "" -#: cp/call.c:4203 +#: cp/call.c:4189 msgid "converting negative value %qE to %qT" msgstr "" -#: cp/call.c:4345 +#: cp/call.c:4331 #, fuzzy msgid "cannot bind bitfield %qE to %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/call.c:4348 cp/call.c:4364 +#: cp/call.c:4334 cp/call.c:4350 msgid "cannot bind packed field %qE to %qT" msgstr "" -#: cp/call.c:4351 +#: cp/call.c:4337 #, fuzzy msgid "cannot bind rvalue %qE to %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/call.c:4460 +#: cp/call.c:4446 msgid "cannot pass objects of non-POD type %q#T through %<...%>; call will abort at runtime" msgstr "" #. Undefined behavior [expr.call] 5.2.2/7. -#: cp/call.c:4486 +#: cp/call.c:4472 msgid "cannot receive objects of non-POD type %q#T through %<...%>; call will abort at runtime" msgstr "" -#: cp/call.c:4529 +#: cp/call.c:4515 msgid "the default argument for parameter %d of %qD has not yet been parsed" msgstr "" -#: cp/call.c:4734 +#: cp/call.c:4720 msgid "passing %qT as % argument of %q#D discards qualifiers" msgstr "" -#: cp/call.c:4753 +#: cp/call.c:4739 msgid "%qT is not an accessible base of %qT" msgstr "" -#: cp/call.c:5003 +#: cp/call.c:4989 msgid "could not find class$ field in java interface type %qT" msgstr "" -#: cp/call.c:5263 +#: cp/call.c:5249 msgid "call to non-function %qD" msgstr "" -#: cp/call.c:5288 +#: cp/call.c:5274 msgid "request for member %qD in %qE, which is of non-aggregate type %qT" msgstr "" -#: cp/call.c:5367 +#: cp/call.c:5353 msgid "no matching function for call to %<%T::%s(%A)%#V%>" msgstr "" -#: cp/call.c:5385 +#: cp/call.c:5371 msgid "call of overloaded %<%s(%A)%> is ambiguous" msgstr "" -#: cp/call.c:5409 +#: cp/call.c:5395 msgid "cannot call member function %qD without object" msgstr "" -#: cp/call.c:6014 +#: cp/call.c:6000 msgid "passing %qT chooses %qT over %qT" msgstr "" -#: cp/call.c:6016 cp/name-lookup.c:4104 +#: cp/call.c:6002 cp/name-lookup.c:4105 msgid " in call to %qD" msgstr "" -#: cp/call.c:6073 +#: cp/call.c:6059 msgid "choosing %qD over %qD" msgstr "" -#: cp/call.c:6074 +#: cp/call.c:6060 #, fuzzy msgid " for conversion from %qT to %qT" msgstr "пераўтварэньне з `%T' у `%T'" -#: cp/call.c:6076 +#: cp/call.c:6062 msgid " because conversion sequence for the argument is better" msgstr "" -#: cp/call.c:6197 +#: cp/call.c:6183 msgid "ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:" msgstr "" -#: cp/call.c:6201 +#: cp/call.c:6187 msgid "candidate 1:" msgstr "" -#: cp/call.c:6202 +#: cp/call.c:6188 msgid "candidate 2:" msgstr "" -#: cp/call.c:6338 +#: cp/call.c:6324 msgid "could not convert %qE to %qT" msgstr "" -#: cp/call.c:6469 +#: cp/call.c:6455 msgid "invalid initialization of non-const reference of type %qT from a temporary of type %qT" msgstr "" -#: cp/call.c:6473 +#: cp/call.c:6459 msgid "invalid initialization of reference of type %qT from expression of type %qT" msgstr "" @@ -13426,217 +13474,217 @@ msgid "no unique final overrider for %qD in %qT" msgstr "" #. Here we know it is a hider, and no overrider exists. -#: cp/class.c:2409 +#: cp/class.c:2413 msgid "%qD was hidden" msgstr "" -#: cp/class.c:2410 +#: cp/class.c:2414 msgid " by %qD" msgstr "" -#: cp/class.c:2451 cp/decl2.c:1100 +#: cp/class.c:2455 cp/decl2.c:1100 msgid "%q#D invalid; an anonymous union can only have non-static data members" msgstr "" -#: cp/class.c:2458 cp/decl2.c:1107 +#: cp/class.c:2462 cp/decl2.c:1107 msgid "private member %q#D in anonymous union" msgstr "" -#: cp/class.c:2461 cp/decl2.c:1109 +#: cp/class.c:2465 cp/decl2.c:1109 msgid "protected member %q#D in anonymous union" msgstr "" -#: cp/class.c:2628 +#: cp/class.c:2632 #, fuzzy msgid "bit-field %q#D with non-integral type" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: cp/class.c:2645 +#: cp/class.c:2649 #, fuzzy msgid "bit-field %qD width not an integer constant" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: cp/class.c:2651 +#: cp/class.c:2655 msgid "negative width in bit-field %qD" msgstr "" -#: cp/class.c:2656 +#: cp/class.c:2660 msgid "zero width for bit-field %qD" msgstr "" -#: cp/class.c:2662 +#: cp/class.c:2666 msgid "width of %qD exceeds its type" msgstr "" -#: cp/class.c:2671 +#: cp/class.c:2675 msgid "%qD is too small to hold all values of %q#T" msgstr "" -#: cp/class.c:2731 +#: cp/class.c:2735 msgid "member %q#D with constructor not allowed in union" msgstr "" -#: cp/class.c:2734 +#: cp/class.c:2738 msgid "member %q#D with destructor not allowed in union" msgstr "" -#: cp/class.c:2737 +#: cp/class.c:2741 msgid "member %q#D with copy assignment operator not allowed in union" msgstr "" -#: cp/class.c:2760 +#: cp/class.c:2764 msgid "multiple fields in union %qT initialized" msgstr "" -#: cp/class.c:2821 +#: cp/class.c:2825 msgid "ignoring packed attribute on unpacked non-POD field %q#D" msgstr "" -#: cp/class.c:2881 +#: cp/class.c:2885 msgid "%qD may not be static because it is a member of a union" msgstr "" -#: cp/class.c:2886 +#: cp/class.c:2890 msgid "%qD may not have reference type %qT because it is a member of a union" msgstr "" -#: cp/class.c:2895 +#: cp/class.c:2899 msgid "field %qD in local class cannot be static" msgstr "" -#: cp/class.c:2901 +#: cp/class.c:2905 #, fuzzy msgid "field %qD invalidly declared function type" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: cp/class.c:2907 +#: cp/class.c:2911 #, fuzzy msgid "field %qD invalidly declared method type" msgstr "бітавае поле \"%s\" мае нерэчаісны тып" -#: cp/class.c:2939 +#: cp/class.c:2943 msgid "non-static reference %q#D in class without a constructor" msgstr "" -#: cp/class.c:2986 +#: cp/class.c:2990 msgid "non-static const member %q#D in class without a constructor" msgstr "" -#: cp/class.c:3001 +#: cp/class.c:3005 msgid "field %q#D with same name as class" msgstr "" -#: cp/class.c:3034 +#: cp/class.c:3038 msgid "%q#T has pointer data members" msgstr "" -#: cp/class.c:3038 +#: cp/class.c:3042 msgid " but does not override %<%T(const %T&)%>" msgstr "" -#: cp/class.c:3040 +#: cp/class.c:3044 msgid " or %" msgstr "" -#: cp/class.c:3043 +#: cp/class.c:3047 msgid " but does not override %" msgstr "" -#: cp/class.c:3476 +#: cp/class.c:3480 msgid "offset of empty base %qT may not be ABI-compliant and maychange in a future version of GCC" msgstr "" -#: cp/class.c:3588 +#: cp/class.c:3592 msgid "class %qT will be considered nearly empty in a future version of GCC" msgstr "" -#: cp/class.c:3670 +#: cp/class.c:3674 #, fuzzy msgid "initializer specified for non-virtual method %qD" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/class.c:4333 +#: cp/class.c:4337 msgid "offset of virtual base %qT is not ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:4432 +#: cp/class.c:4436 msgid "direct base %qT inaccessible in %qT due to ambiguity" msgstr "" -#: cp/class.c:4444 +#: cp/class.c:4448 msgid "virtual base %qT inaccessible in %qT due to ambiguity" msgstr "" -#: cp/class.c:4621 +#: cp/class.c:4625 msgid "size assigned to %qT may not be ABI-compliant and may change in a future version of GCC" msgstr "" #. Versions of G++ before G++ 3.4 did not reset the #. DECL_MODE. -#: cp/class.c:4660 +#: cp/class.c:4664 msgid "the offset of %qD may not be ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:4683 +#: cp/class.c:4687 msgid "offset of %qD is not ABI-compliant and may change in a future version of GCC" msgstr "" -#: cp/class.c:4693 +#: cp/class.c:4697 msgid "%qD contains empty classes which may cause base classes to be placed at different locations in a future version of GCC" msgstr "" -#: cp/class.c:4753 +#: cp/class.c:4757 msgid "layout of classes derived from empty class %qT may change in a future version of GCC" msgstr "" -#: cp/class.c:4894 cp/parser.c:12849 +#: cp/class.c:4898 cp/parser.c:12906 #, fuzzy msgid "redefinition of %q#T" msgstr "папярэдняе вызначэньне `%#T'" -#: cp/class.c:5042 +#: cp/class.c:5048 msgid "%q#T has virtual functions but non-virtual destructor" msgstr "" -#: cp/class.c:5139 +#: cp/class.c:5145 msgid "trying to finish struct, but kicked out due to previous parse errors" msgstr "" -#: cp/class.c:5555 +#: cp/class.c:5561 #, fuzzy msgid "language string %<\"%E\"%> not recognized" msgstr "мова %s не распазнана" -#: cp/class.c:5642 +#: cp/class.c:5648 msgid "cannot resolve overloaded function %qD based on conversion to type %qT" msgstr "" -#: cp/class.c:5767 +#: cp/class.c:5773 msgid "no matches converting function %qD to type %q#T" msgstr "" -#: cp/class.c:5790 +#: cp/class.c:5796 msgid "converting overloaded function %qD to type %q#T is ambiguous" msgstr "" -#: cp/class.c:5816 +#: cp/class.c:5822 #, fuzzy msgid "assuming pointer to member %qD" msgstr "прапушчан ініцыялізатар" -#: cp/class.c:5819 +#: cp/class.c:5825 msgid "(a pointer to member can only be formed with %<&%E%>)" msgstr "" -#: cp/class.c:5864 cp/class.c:5895 cp/class.c:6047 cp/class.c:6054 +#: cp/class.c:5870 cp/class.c:5901 cp/class.c:6053 cp/class.c:6060 msgid "not enough type information" msgstr "" -#: cp/class.c:5881 +#: cp/class.c:5887 msgid "argument of type %qT does not match %qT" msgstr "" -#: cp/class.c:6031 +#: cp/class.c:6037 msgid "invalid operation on uninstantiated type" msgstr "" @@ -13645,12 +13693,12 @@ msgstr "" #. A name N used in a class S shall refer to the same declaration #. in its context and when re-evaluated in the completed scope of #. S. -#: cp/class.c:6268 cp/decl.c:1096 cp/name-lookup.c:508 cp/pt.c:2198 +#: cp/class.c:6274 cp/decl.c:1102 cp/name-lookup.c:508 cp/pt.c:2206 #, fuzzy msgid "declaration of %q#D" msgstr "абвяшчэньне `%#D'" -#: cp/class.c:6269 +#: cp/class.c:6275 msgid "changes meaning of %qD from %q+#D" msgstr "" @@ -13675,7 +13723,7 @@ msgstr "" msgid "conversion from %qT to %qT discards qualifiers" msgstr "" -#: cp/cvt.c:515 cp/typeck.c:4840 +#: cp/cvt.c:515 cp/typeck.c:4824 msgid "casting %qT to %qT does not dereference pointer" msgstr "" @@ -13761,99 +13809,99 @@ msgstr "адмеціна `%D' выкарыстоўвываецца, але ня msgid "label %qD defined but not used" msgstr "адмеціна `%D' вызначана, але не выкарыстоўваецца" -#: cp/decl.c:1003 +#: cp/decl.c:1009 msgid "%qD was declared % and later %" msgstr "" -#: cp/decl.c:1004 cp/decl.c:1469 +#: cp/decl.c:1010 cp/decl.c:1475 #, fuzzy msgid "previous declaration of %qD" msgstr "папярэдняе абвяшчэньне `%D'" -#: cp/decl.c:1052 +#: cp/decl.c:1058 #, fuzzy msgid "%Jfunction %qD redeclared as inline" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:1053 +#: cp/decl.c:1059 #, fuzzy msgid "%Jprevious declaration of %qD with attribute noinline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1060 +#: cp/decl.c:1066 #, fuzzy msgid "%Jfunction %qD redeclared with attribute noinline" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:1062 +#: cp/decl.c:1068 #, fuzzy msgid "%Jprevious declaration of %qD was inline" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1083 cp/decl.c:1154 +#: cp/decl.c:1089 cp/decl.c:1160 #, fuzzy msgid "shadowing %s function %q#D" msgstr "у функцыі \"%s\":" -#: cp/decl.c:1092 +#: cp/decl.c:1098 msgid "library function %q#D redeclared as non-function %q#D" msgstr "" -#: cp/decl.c:1097 +#: cp/decl.c:1103 #, fuzzy msgid "conflicts with built-in declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1149 cp/decl.c:1258 cp/decl.c:1274 +#: cp/decl.c:1155 cp/decl.c:1264 cp/decl.c:1280 #, fuzzy msgid "new declaration %q#D" msgstr "новае абвяшчэньне `%#D'" -#: cp/decl.c:1150 +#: cp/decl.c:1156 #, fuzzy msgid "ambiguates built-in declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1221 +#: cp/decl.c:1227 msgid "%q#D redeclared as different kind of symbol" msgstr "" -#: cp/decl.c:1224 +#: cp/decl.c:1230 #, fuzzy msgid "previous declaration of %q#D" msgstr "папярэдняе абвяшчэньне `%#D'" -#: cp/decl.c:1243 +#: cp/decl.c:1249 #, fuzzy msgid "declaration of template %q#D" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:1244 cp/name-lookup.c:509 +#: cp/decl.c:1250 cp/name-lookup.c:509 #, fuzzy msgid "conflicts with previous declaration %q#D" msgstr "канфлікт з папярэднім абвяшчэньнем `%#D'" -#: cp/decl.c:1259 cp/decl.c:1275 +#: cp/decl.c:1265 cp/decl.c:1281 #, fuzzy msgid "ambiguates old declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1267 +#: cp/decl.c:1273 #, fuzzy msgid "declaration of C function %q#D conflicts with" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1269 +#: cp/decl.c:1275 #, fuzzy msgid "previous declaration %q#D here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1282 +#: cp/decl.c:1288 #, fuzzy msgid "conflicting declaration %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1283 +#: cp/decl.c:1289 #, fuzzy msgid "%qD has a previous declaration as %q#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" @@ -13865,77 +13913,77 @@ msgstr "няма папярэдняга аб'яўлення для \"%s\"" #. A namespace-name defined at global scope shall not be #. declared as the name of any other entity in any global scope #. of the program. -#: cp/decl.c:1336 +#: cp/decl.c:1342 #, fuzzy msgid "declaration of namespace %qD conflicts with" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:1337 +#: cp/decl.c:1343 #, fuzzy msgid "previous declaration of namespace %qD here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1349 +#: cp/decl.c:1355 #, fuzzy msgid "%q#D previously defined here" msgstr "папярэдняе вызначэньне" -#: cp/decl.c:1350 +#: cp/decl.c:1356 #, fuzzy msgid "%q#D previously declared here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" #. Prototype decl follows defn w/o prototype. -#: cp/decl.c:1359 +#: cp/decl.c:1365 #, fuzzy msgid "prototype for %q#D" msgstr "няма папярэдняга прататыпа для \"%s\"" -#: cp/decl.c:1360 +#: cp/decl.c:1366 #, fuzzy msgid "%Jfollows non-prototype definition here" msgstr "папярэдняе вызначэньне" -#: cp/decl.c:1372 +#: cp/decl.c:1378 #, fuzzy msgid "previous declaration of %q#D with %qL linkage" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1374 +#: cp/decl.c:1380 #, fuzzy msgid "conflicts with new declaration with %qL linkage" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: cp/decl.c:1397 cp/decl.c:1404 +#: cp/decl.c:1403 cp/decl.c:1410 #, fuzzy msgid "default argument given for parameter %d of %q#D" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/decl.c:1399 cp/decl.c:1406 +#: cp/decl.c:1405 cp/decl.c:1412 #, fuzzy msgid "after previous specification in %q#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1415 +#: cp/decl.c:1421 msgid "%q#D was used before it was declared inline" msgstr "" -#: cp/decl.c:1416 +#: cp/decl.c:1422 #, fuzzy msgid "%Jprevious non-inline declaration here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:1468 +#: cp/decl.c:1474 #, fuzzy msgid "redundant redeclaration of %qD in same scope" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:1562 +#: cp/decl.c:1568 #, c-format msgid "declaration of %qF throws different exceptions" msgstr "" -#: cp/decl.c:1564 +#: cp/decl.c:1570 #, fuzzy, c-format msgid "than previous declaration %qF" msgstr "няма папярэдняга аб'яўлення для \"%s\"" @@ -13948,232 +13996,232 @@ msgstr "няма папярэдняга аб'яўлення для \"%s\"" #. that specialization that would cause an implicit #. instantiation to take place, in every translation unit in #. which such a use occurs. -#: cp/decl.c:1724 +#: cp/decl.c:1730 #, fuzzy msgid "explicit specialization of %qD after first use" msgstr "ініцыялізацыя" -#: cp/decl.c:1803 +#: cp/decl.c:1809 msgid "%J%qD: visibility attribute ignored because it" msgstr "" -#: cp/decl.c:1805 +#: cp/decl.c:1811 #, fuzzy msgid "%Jconflicts with previous declaration here" msgstr "канфлікт з папярэднім абвяшчэньнем `%#D'" -#: cp/decl.c:2048 +#: cp/decl.c:2055 #, c-format msgid "label %qE referenced outside of any function" msgstr "" -#: cp/decl.c:2144 cp/decl.c:2168 cp/decl.c:2256 +#: cp/decl.c:2151 cp/decl.c:2175 cp/decl.c:2263 #, fuzzy msgid "jump to label %qD" msgstr "паўтарэнне \"%s\"" -#: cp/decl.c:2146 cp/decl.c:2170 +#: cp/decl.c:2153 cp/decl.c:2177 msgid "jump to case label" msgstr "" -#: cp/decl.c:2149 cp/decl.c:2173 +#: cp/decl.c:2156 cp/decl.c:2180 #, fuzzy msgid "%H from here" msgstr " адсюль" -#: cp/decl.c:2154 +#: cp/decl.c:2161 #, fuzzy msgid " crosses initialization of %q#D" msgstr "ініцыялізацыя" -#: cp/decl.c:2157 cp/decl.c:2272 +#: cp/decl.c:2164 cp/decl.c:2279 msgid " enters scope of non-POD %q#D" msgstr "" -#: cp/decl.c:2177 cp/decl.c:2276 +#: cp/decl.c:2184 cp/decl.c:2283 msgid " enters try block" msgstr "" -#: cp/decl.c:2179 cp/decl.c:2278 +#: cp/decl.c:2186 cp/decl.c:2285 msgid " enters catch block" msgstr "" -#: cp/decl.c:2257 +#: cp/decl.c:2264 msgid " from here" msgstr " адсюль" #. Can't skip init of __exception_info. -#: cp/decl.c:2268 +#: cp/decl.c:2275 msgid "%J enters catch block" msgstr "" -#: cp/decl.c:2270 +#: cp/decl.c:2277 #, fuzzy msgid " skips initialization of %q#D" msgstr "ініцыялізацыя" -#: cp/decl.c:2304 +#: cp/decl.c:2311 msgid "label named wchar_t" msgstr "" -#: cp/decl.c:2307 +#: cp/decl.c:2314 #, fuzzy msgid "duplicate label %qD" msgstr "паўтарэнне \"%s\"" -#: cp/decl.c:2555 cp/parser.c:3514 +#: cp/decl.c:2562 cp/parser.c:3525 #, fuzzy msgid "%qD used without template parameters" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:2572 cp/decl.c:2663 +#: cp/decl.c:2579 cp/decl.c:2670 msgid "no class template named %q#T in %q#T" msgstr "" -#: cp/decl.c:2593 cp/decl.c:2603 cp/decl.c:2623 +#: cp/decl.c:2600 cp/decl.c:2610 cp/decl.c:2630 #, fuzzy msgid "no type named %q#T in %q#T" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: cp/decl.c:2672 +#: cp/decl.c:2679 #, fuzzy msgid "template parameters do not match template" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:2673 cp/friend.c:317 cp/friend.c:325 +#: cp/decl.c:2680 cp/friend.c:317 cp/friend.c:325 #, fuzzy msgid "%qD declared here" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:3344 +#: cp/decl.c:3351 msgid "%Jan anonymous union cannot have function members" msgstr "" -#: cp/decl.c:3362 +#: cp/decl.c:3369 msgid "member %q#D with constructor not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3366 +#: cp/decl.c:3373 msgid "member %q#D with destructor not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3370 +#: cp/decl.c:3377 msgid "member %q#D with copy assignment operator not allowed in anonymous aggregate" msgstr "" -#: cp/decl.c:3396 +#: cp/decl.c:3403 msgid "multiple types in one declaration" msgstr "" -#: cp/decl.c:3400 +#: cp/decl.c:3407 #, fuzzy msgid "redeclaration of C++ built-in type %qT" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:3437 +#: cp/decl.c:3444 msgid "missing type-name in typedef-declaration" msgstr "" -#: cp/decl.c:3445 +#: cp/decl.c:3452 msgid "ISO C++ prohibits anonymous structs" msgstr "" -#: cp/decl.c:3452 +#: cp/decl.c:3459 #, fuzzy, c-format msgid "%qs can only be specified for functions" msgstr "\"%s\" звычайна функцыя" -#: cp/decl.c:3458 +#: cp/decl.c:3465 msgid "% can only be specified inside a class" msgstr "" -#: cp/decl.c:3460 +#: cp/decl.c:3467 msgid "% can only be specified for constructors" msgstr "" -#: cp/decl.c:3462 +#: cp/decl.c:3469 msgid "a storage class can only be specified for objects and functions" msgstr "" -#: cp/decl.c:3468 +#: cp/decl.c:3475 msgid "qualifiers can only be specified for objects and functions" msgstr "" -#: cp/decl.c:3498 +#: cp/decl.c:3505 #, fuzzy msgid "attribute ignored in declaration of %q#T" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:3499 +#: cp/decl.c:3506 msgid "attribute for %q#T must follow the %qs keyword" msgstr "" -#: cp/decl.c:3622 +#: cp/decl.c:3629 msgid "function %q#D is initialized like a variable" msgstr "" -#: cp/decl.c:3634 +#: cp/decl.c:3641 msgid "declaration of %q#D has % and is initialized" msgstr "" -#: cp/decl.c:3665 +#: cp/decl.c:3671 msgid "%q#D is not a static member of %q#T" msgstr "" -#: cp/decl.c:3671 +#: cp/decl.c:3677 msgid "ISO C++ does not permit %<%T::%D%> to be defined as %<%T::%D%>" msgstr "" -#: cp/decl.c:3680 +#: cp/decl.c:3686 msgid "template header not allowed in member definition of explicitly specialized class" msgstr "" -#: cp/decl.c:3688 +#: cp/decl.c:3694 #, fuzzy msgid "duplicate initialization of %qD" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:3726 +#: cp/decl.c:3732 msgid "declaration of %q#D outside of class is not definition" msgstr "" -#: cp/decl.c:3775 +#: cp/decl.c:3781 #, fuzzy msgid "variable %q#D has initializer but incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:3782 cp/decl.c:4411 +#: cp/decl.c:3788 cp/decl.c:4410 #, fuzzy msgid "elements of array %q#D have incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:3798 +#: cp/decl.c:3804 msgid "aggregate %q#D has incomplete type and cannot be defined" msgstr "" -#: cp/decl.c:3848 +#: cp/decl.c:3854 msgid "%qD declared as reference but not initialized" msgstr "" -#: cp/decl.c:3854 +#: cp/decl.c:3860 msgid "ISO C++ forbids use of initializer list to initialize reference %qD" msgstr "" -#: cp/decl.c:3880 +#: cp/decl.c:3886 #, fuzzy msgid "cannot initialize %qT from %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:3912 +#: cp/decl.c:3919 msgid "initializer fails to determine size of %qD" msgstr "" -#: cp/decl.c:3917 +#: cp/decl.c:3924 #, fuzzy msgid "array size missing in %qD" msgstr "прапушчан памер масіва ў `%D'" -#: cp/decl.c:3929 +#: cp/decl.c:3934 #, fuzzy msgid "zero-size array %qD" msgstr "нулявы памер масіва `%D'" @@ -14181,194 +14229,189 @@ msgstr "нулявы памер масіва `%D'" #. An automatic variable with an incomplete type: that is an error. #. Don't talk about array types here, since we took care of that #. message in grokdeclarator. -#: cp/decl.c:3966 +#: cp/decl.c:3971 msgid "storage size of %qD isn't known" msgstr "" -#: cp/decl.c:3988 +#: cp/decl.c:3993 #, fuzzy msgid "storage size of %qD isn't constant" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:4043 +#: cp/decl.c:4048 msgid "sorry: semantics of inline function static data %q#D are wrong (you'll wind up with multiple copies)" msgstr "" -#: cp/decl.c:4046 +#: cp/decl.c:4051 msgid "%J you can work around this by removing the initializer" msgstr "" -#: cp/decl.c:4073 +#: cp/decl.c:4078 #, fuzzy msgid "uninitialized const %qD" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:4133 -msgid "name %qD used in a GNU-style designated initializer for an array" -msgstr "" - #: cp/decl.c:4143 -#, c-format -msgid "Designated initializer %qE larger than array size" +msgid "name %qD used in a GNU-style designated initializer for an array" msgstr "" -#: cp/decl.c:4215 +#: cp/decl.c:4214 msgid "brace-enclosed initializer used to initialize %qT" msgstr "" -#: cp/decl.c:4280 +#: cp/decl.c:4279 msgid "initializer for %qT must be brace-enclosed" msgstr "" -#: cp/decl.c:4296 +#: cp/decl.c:4295 msgid "ISO C++ does not allow designated initializers" msgstr "" -#: cp/decl.c:4300 +#: cp/decl.c:4299 msgid "%qT has no non-static data member named %qD" msgstr "" -#: cp/decl.c:4364 +#: cp/decl.c:4363 #, fuzzy msgid "too many initializers for %qT" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:4405 +#: cp/decl.c:4404 msgid "variable-sized object %qD may not be initialized" msgstr "" -#: cp/decl.c:4416 +#: cp/decl.c:4415 #, fuzzy msgid "%qD has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:4470 +#: cp/decl.c:4469 msgid "%qD must be initialized by constructor, not by %<{...}%>" msgstr "" -#: cp/decl.c:4506 +#: cp/decl.c:4505 msgid "array %qD initialized by parenthesized string literal %qE" msgstr "" -#: cp/decl.c:4521 +#: cp/decl.c:4520 #, fuzzy msgid "structure %qD with uninitialized const members" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:4523 +#: cp/decl.c:4522 #, fuzzy msgid "structure %qD with uninitialized reference members" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:4723 +#: cp/decl.c:4722 msgid "assignment (not initialization) in declaration" msgstr "" -#: cp/decl.c:4740 +#: cp/decl.c:4739 #, fuzzy msgid "cannot initialize %qD to namespace %qD" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:4781 +#: cp/decl.c:4780 #, fuzzy msgid "shadowing previous type declaration of %q#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:4815 +#: cp/decl.c:4814 msgid "%qD cannot be thread-local because it has non-POD type %qT" msgstr "" -#: cp/decl.c:4830 +#: cp/decl.c:4829 msgid "%qD is thread-local and so cannot be dynamically initialized" msgstr "" -#: cp/decl.c:5447 +#: cp/decl.c:5388 msgid "destructor for alien class %qT cannot be a member" msgstr "" -#: cp/decl.c:5449 +#: cp/decl.c:5390 msgid "constructor for alien class %qT cannot be a member" msgstr "" -#: cp/decl.c:5470 +#: cp/decl.c:5411 msgid "%qD declared as a % %s" msgstr "" -#: cp/decl.c:5472 +#: cp/decl.c:5413 msgid "%qD declared as an % %s" msgstr "" -#: cp/decl.c:5474 +#: cp/decl.c:5415 msgid "% and % function specifiers on %qD invalid in %s declaration" msgstr "" -#: cp/decl.c:5478 +#: cp/decl.c:5419 msgid "%qD declared as a friend" msgstr "" -#: cp/decl.c:5484 +#: cp/decl.c:5425 #, fuzzy msgid "%qD declared with an exception specification" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:5570 +#: cp/decl.c:5511 msgid "cannot declare %<::main%> to be a template" msgstr "" -#: cp/decl.c:5572 +#: cp/decl.c:5513 msgid "cannot declare %<::main%> to be inline" msgstr "" -#: cp/decl.c:5574 +#: cp/decl.c:5515 msgid "cannot declare %<::main%> to be static" msgstr "" -#: cp/decl.c:5578 +#: cp/decl.c:5519 #, fuzzy msgid "%<::main%> must return %" msgstr "`main' павінна вяртаць `int'" -#: cp/decl.c:5608 +#: cp/decl.c:5549 msgid "non-local function %q#D uses anonymous type" msgstr "" -#: cp/decl.c:5611 cp/decl.c:5947 +#: cp/decl.c:5552 cp/decl.c:5888 msgid "%q#D does not refer to the unqualified type, so it is not used for linkage" msgstr "" -#: cp/decl.c:5617 +#: cp/decl.c:5558 msgid "non-local function %q#D uses local type %qT" msgstr "" -#: cp/decl.c:5640 +#: cp/decl.c:5581 #, fuzzy msgid "%smember function %qD cannot have cv-qualifier" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:5664 +#: cp/decl.c:5605 #, fuzzy msgid "defining explicit specialization %qD in friend declaration" msgstr "ініцыялізацыя" #. Something like `template friend void f()'. -#: cp/decl.c:5674 +#: cp/decl.c:5615 #, fuzzy msgid "invalid use of template-id %qD in declaration of primary template" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:5702 +#: cp/decl.c:5643 msgid "default arguments are not allowed in declaration of friend template specialization %qD" msgstr "" -#: cp/decl.c:5710 +#: cp/decl.c:5651 msgid "% is not allowed in declaration of friend template specialization %qD" msgstr "" -#: cp/decl.c:5776 +#: cp/decl.c:5717 msgid "definition of implicitly-declared %qD" msgstr "" -#: cp/decl.c:5796 cp/decl2.c:712 +#: cp/decl.c:5737 cp/decl2.c:712 msgid "no %q#D member function declared in class %qT" msgstr "" @@ -14376,458 +14419,458 @@ msgstr "" #. no linkage can only be used to declare extern "C" #. entities. Since it's not always an error in the #. ISO C++ 90 Standard, we only issue a warning. -#: cp/decl.c:5944 +#: cp/decl.c:5885 msgid "non-local variable %q#D uses anonymous type" msgstr "" -#: cp/decl.c:5953 +#: cp/decl.c:5894 msgid "non-local variable %q#D uses local type %qT" msgstr "" -#: cp/decl.c:6070 +#: cp/decl.c:6011 msgid "invalid in-class initialization of static data member of non-integral type %qT" msgstr "" -#: cp/decl.c:6080 +#: cp/decl.c:6021 msgid "ISO C++ forbids in-class initialization of non-const static member %qD" msgstr "" -#: cp/decl.c:6084 +#: cp/decl.c:6025 msgid "ISO C++ forbids initialization of member constant %qD of non-integral type %qT" msgstr "" -#: cp/decl.c:6104 +#: cp/decl.c:6045 #, fuzzy msgid "size of array %qD has non-integral type %qT" msgstr "памер масіва `%D' не цэлалікавы тып" -#: cp/decl.c:6106 +#: cp/decl.c:6047 #, fuzzy msgid "size of array has non-integral type %qT" msgstr "памер масіва \"%s\" адмоўны" -#: cp/decl.c:6142 +#: cp/decl.c:6083 #, fuzzy msgid "size of array %qD is negative" msgstr "памер масіва `%D' - адмоўны" -#: cp/decl.c:6144 +#: cp/decl.c:6085 msgid "size of array is negative" msgstr "адмоўны памер масіва " -#: cp/decl.c:6152 +#: cp/decl.c:6093 #, fuzzy msgid "ISO C++ forbids zero-size array %qD" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:6154 +#: cp/decl.c:6095 #, fuzzy msgid "ISO C++ forbids zero-size array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:6161 +#: cp/decl.c:6102 #, fuzzy msgid "size of array %qD is not an integral constant-expression" msgstr "памер масіва \"%s\" адмоўны" -#: cp/decl.c:6164 +#: cp/decl.c:6105 msgid "size of array is not an integral constant-expression" msgstr "" -#: cp/decl.c:6169 +#: cp/decl.c:6110 #, fuzzy msgid "ISO C++ forbids variable-size array %qD" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:6171 +#: cp/decl.c:6112 #, fuzzy msgid "ISO C++ forbids variable-size array" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:6201 +#: cp/decl.c:6142 msgid "overflow in array dimension" msgstr "" -#: cp/decl.c:6275 +#: cp/decl.c:6216 #, fuzzy msgid "declaration of %qD as %s" msgstr "абвяшчэньне `%#D'" -#: cp/decl.c:6277 +#: cp/decl.c:6218 #, c-format msgid "creating %s" msgstr "" -#: cp/decl.c:6289 +#: cp/decl.c:6230 msgid "declaration of %qD as multidimensional array must have bounds for all dimensions except the first" msgstr "" -#: cp/decl.c:6293 +#: cp/decl.c:6234 msgid "multidimensional array must have bounds for all dimensions except the first" msgstr "" -#: cp/decl.c:6328 +#: cp/decl.c:6269 msgid "return type specification for constructor invalid" msgstr "" -#: cp/decl.c:6338 +#: cp/decl.c:6279 msgid "return type specification for destructor invalid" msgstr "" -#: cp/decl.c:6351 +#: cp/decl.c:6292 msgid "operator %qT declared to return %qT" msgstr "" -#: cp/decl.c:6353 +#: cp/decl.c:6294 msgid "return type specified for %" msgstr "" -#: cp/decl.c:6375 +#: cp/decl.c:6316 msgid "unnamed variable or field declared void" msgstr "" -#: cp/decl.c:6379 +#: cp/decl.c:6320 #, fuzzy, c-format msgid "variable or field %qE declared void" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:6382 +#: cp/decl.c:6323 msgid "variable or field declared void" msgstr "" -#: cp/decl.c:6537 +#: cp/decl.c:6478 msgid "type %qT is not derived from type %qT" msgstr "" -#: cp/decl.c:6557 cp/decl.c:6649 cp/decl.c:7792 +#: cp/decl.c:6498 cp/decl.c:6590 cp/decl.c:7734 #, fuzzy msgid "declaration of %qD as non-function" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/decl.c:6563 +#: cp/decl.c:6504 #, fuzzy msgid "declaration of %qD as non-member" msgstr "абвяшчэньне `%#D'" -#: cp/decl.c:6593 +#: cp/decl.c:6534 msgid "declarator-id missing; using reserved word %qD" msgstr "" -#: cp/decl.c:6682 +#: cp/decl.c:6623 #, fuzzy, c-format msgid "two or more data types in declaration of %qs" msgstr "пустое абвяшчэнне" -#: cp/decl.c:6725 +#: cp/decl.c:6666 #, fuzzy msgid "ISO C++ does not support %" msgstr "ISO C++ не падтрымлівае \"long long\"" -#: cp/decl.c:6785 cp/decl.c:6787 +#: cp/decl.c:6726 cp/decl.c:6728 #, fuzzy, c-format msgid "ISO C++ forbids declaration of %qs with no type" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/decl.c:6812 +#: cp/decl.c:6753 #, fuzzy, c-format msgid "short, signed or unsigned invalid for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:6814 +#: cp/decl.c:6755 #, fuzzy, c-format msgid "long, short, signed or unsigned invalid for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:6816 +#: cp/decl.c:6757 #, c-format msgid "long and short specified together for %qs" msgstr "" -#: cp/decl.c:6818 +#: cp/decl.c:6759 #, c-format msgid "long or short specified with char for %qs" msgstr "" -#: cp/decl.c:6820 +#: cp/decl.c:6761 #, c-format msgid "long or short specified with floating type for %qs" msgstr "" -#: cp/decl.c:6822 +#: cp/decl.c:6763 #, c-format msgid "signed and unsigned given together for %qs" msgstr "" -#: cp/decl.c:6828 +#: cp/decl.c:6769 #, fuzzy, c-format msgid "long, short, signed or unsigned used invalidly for %qs" msgstr "long, short, signed ці unsigned нерэчаісны для \"%s\"" -#: cp/decl.c:6893 +#: cp/decl.c:6834 #, fuzzy, c-format msgid "complex invalid for %qs" msgstr "complex нерэчаісны для \"%s\"" -#: cp/decl.c:6922 +#: cp/decl.c:6863 msgid "qualifiers are not allowed on declaration of %" msgstr "" -#: cp/decl.c:6934 cp/typeck.c:6404 +#: cp/decl.c:6875 cp/typeck.c:6391 #, fuzzy msgid "ignoring %qV qualifiers added to function type %qT" msgstr "Нерэчаісны выбар \"%s\"" -#: cp/decl.c:6957 +#: cp/decl.c:6898 msgid "member %qD cannot be declared both virtual and static" msgstr "" -#: cp/decl.c:6964 +#: cp/decl.c:6905 #, fuzzy msgid "%<%T::%D%> is not a valid declarator" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/decl.c:6972 +#: cp/decl.c:6913 msgid "typedef declaration invalid in parameter declaration" msgstr "" -#: cp/decl.c:6976 +#: cp/decl.c:6917 msgid "storage class specifiers invalid in parameter declarations" msgstr "" -#: cp/decl.c:6983 +#: cp/decl.c:6924 msgid "virtual outside class declaration" msgstr "" -#: cp/decl.c:6996 cp/decl.c:7003 +#: cp/decl.c:6937 cp/decl.c:6944 #, fuzzy, c-format msgid "multiple storage classes in declaration of %qs" msgstr "паўторнае абвяшчэньне адмеціны `%s'" -#: cp/decl.c:7046 +#: cp/decl.c:6987 #, c-format msgid "storage class specified for %s %qs" msgstr "" -#: cp/decl.c:7083 +#: cp/decl.c:7024 msgid "top-level declaration of %qs specifies %" msgstr "" -#: cp/decl.c:7095 +#: cp/decl.c:7036 msgid "storage class specifiers invalid in friend function declarations" msgstr "" -#: cp/decl.c:7220 +#: cp/decl.c:7162 msgid "destructor cannot be static member function" msgstr "" -#: cp/decl.c:7223 +#: cp/decl.c:7165 msgid "destructors may not be cv-qualified" msgstr "" -#: cp/decl.c:7243 +#: cp/decl.c:7185 msgid "constructor cannot be static member function" msgstr "" -#: cp/decl.c:7246 +#: cp/decl.c:7188 msgid "constructors cannot be declared virtual" msgstr "" -#: cp/decl.c:7251 +#: cp/decl.c:7193 msgid "constructors may not be cv-qualified" msgstr "" -#: cp/decl.c:7271 +#: cp/decl.c:7213 #, fuzzy, c-format msgid "can't initialize friend function %qs" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" #. Cannot be both friend and virtual. -#: cp/decl.c:7275 +#: cp/decl.c:7217 msgid "virtual functions cannot be friends" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7279 +#: cp/decl.c:7221 msgid "friend declaration not in class definition" msgstr "" -#: cp/decl.c:7281 +#: cp/decl.c:7223 #, fuzzy, c-format msgid "can't define friend function %qs in a local class definition" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/decl.c:7294 +#: cp/decl.c:7236 msgid "destructors may not have parameters" msgstr "" -#: cp/decl.c:7313 cp/decl.c:7320 +#: cp/decl.c:7255 cp/decl.c:7262 #, fuzzy msgid "cannot declare reference to %q#T" msgstr "Не магу знайсці файл для класа %s." -#: cp/decl.c:7314 +#: cp/decl.c:7256 #, fuzzy msgid "cannot declare pointer to %q#T" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:7322 +#: cp/decl.c:7264 msgid "cannot declare pointer to %q#T member" msgstr "" -#: cp/decl.c:7361 +#: cp/decl.c:7303 msgid "%qD is a namespace" msgstr "" -#: cp/decl.c:7400 +#: cp/decl.c:7342 msgid "template-id %qD used as a declarator" msgstr "" -#: cp/decl.c:7447 +#: cp/decl.c:7389 msgid "extra qualification %<%T::%> on member %qs ignored" msgstr "" -#: cp/decl.c:7466 +#: cp/decl.c:7408 msgid "cannot declare member function %<%T::%s%> within %<%T%>" msgstr "" -#: cp/decl.c:7481 +#: cp/decl.c:7423 msgid "cannot declare member %<%T::%s%> within %qT" msgstr "" -#: cp/decl.c:7520 +#: cp/decl.c:7462 msgid "data member may not have variably modified type %qT" msgstr "" -#: cp/decl.c:7522 +#: cp/decl.c:7464 msgid "parameter may not have variably modified type %qT" msgstr "" #. [dcl.fct.spec] The explicit specifier shall only be used in #. declarations of constructors within a class definition. -#: cp/decl.c:7530 +#: cp/decl.c:7472 msgid "only declarations of constructors can be %" msgstr "" -#: cp/decl.c:7538 +#: cp/decl.c:7480 #, fuzzy msgid "non-member %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7543 +#: cp/decl.c:7485 msgid "non-object member %qs cannot be declared %" msgstr "" -#: cp/decl.c:7549 +#: cp/decl.c:7491 #, fuzzy msgid "function %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7554 +#: cp/decl.c:7496 #, fuzzy msgid "static %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7559 +#: cp/decl.c:7501 #, fuzzy msgid "const %qs cannot be declared %" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7579 +#: cp/decl.c:7521 msgid "%Jtypedef name may not be a nested-name-specifier" msgstr "" -#: cp/decl.c:7595 +#: cp/decl.c:7537 msgid "ISO C++ forbids nested type %qD with same name as enclosing class" msgstr "" -#: cp/decl.c:7694 +#: cp/decl.c:7636 #, fuzzy, c-format msgid "qualified function types cannot be used to declare %s functions" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7720 +#: cp/decl.c:7662 msgid "type qualifiers specified for friend class declaration" msgstr "" -#: cp/decl.c:7725 +#: cp/decl.c:7667 #, fuzzy msgid "% specified for friend class declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:7733 +#: cp/decl.c:7675 #, fuzzy msgid "template parameters cannot be friends" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:7735 +#: cp/decl.c:7677 msgid "friend declaration requires class-key, i.e. %" msgstr "" -#: cp/decl.c:7739 +#: cp/decl.c:7681 msgid "friend declaration requires class-key, i.e. %" msgstr "" -#: cp/decl.c:7752 +#: cp/decl.c:7694 msgid "trying to make class %qT a friend of global scope" msgstr "" -#: cp/decl.c:7763 +#: cp/decl.c:7705 msgid "invalid qualifiers on non-member function type" msgstr "" -#: cp/decl.c:7782 +#: cp/decl.c:7724 msgid "abstract declarator %qT used as declaration" msgstr "" -#: cp/decl.c:7807 +#: cp/decl.c:7749 #, fuzzy msgid "cannot use %<::%> in parameter declaration" msgstr "Не магу знайсці дэкларацыю пратакола для \"%s\"" #. Something like struct S { int N::j; }; -#: cp/decl.c:7852 +#: cp/decl.c:7794 #, fuzzy msgid "invalid use of %<::%>" msgstr "нерэчаіснае выкарыстаньне `::'" -#: cp/decl.c:7867 +#: cp/decl.c:7809 msgid "can't make %qD into a method -- not in a class" msgstr "" -#: cp/decl.c:7876 +#: cp/decl.c:7818 #, fuzzy msgid "function %qD declared virtual inside a union" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:7885 +#: cp/decl.c:7827 msgid "%qD cannot be declared virtual, since it is always static" msgstr "" -#: cp/decl.c:7903 +#: cp/decl.c:7845 #, fuzzy msgid "declaration of %qD as member of %qT" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:7979 +#: cp/decl.c:7921 #, fuzzy msgid "field %qD has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:7981 +#: cp/decl.c:7923 #, fuzzy msgid "name %qT has incomplete type" msgstr "\"%s\" мае незавершаны тып" -#: cp/decl.c:7990 +#: cp/decl.c:7932 #, fuzzy msgid " in instantiation of template %qT" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:8000 +#: cp/decl.c:7942 #, fuzzy, c-format msgid "%qE is neither function nor member function; cannot be declared friend" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/decl.c:8011 +#: cp/decl.c:7953 msgid "member functions are implicitly friends of their class" msgstr "" @@ -14843,82 +14886,82 @@ msgstr "" #. the rest of the compiler does not correctly #. handle the initialization unless the member is #. static so we make it static below. -#: cp/decl.c:8051 +#: cp/decl.c:7993 #, fuzzy msgid "ISO C++ forbids initialization of member %qD" msgstr "ініцыялізацыя" -#: cp/decl.c:8053 +#: cp/decl.c:7995 msgid "making %qD static" msgstr "" -#: cp/decl.c:8111 +#: cp/decl.c:8053 msgid "storage class % invalid for function %qs" msgstr "" -#: cp/decl.c:8113 +#: cp/decl.c:8055 msgid "storage class % invalid for function %qs" msgstr "" -#: cp/decl.c:8115 +#: cp/decl.c:8057 msgid "storage class %<__thread%> invalid for function %qs" msgstr "" -#: cp/decl.c:8126 +#: cp/decl.c:8068 msgid "% specified invalid for function %qs declared out of global scope" msgstr "" -#: cp/decl.c:8129 +#: cp/decl.c:8071 msgid "% specifier invalid for function %qs declared out of global scope" msgstr "" -#: cp/decl.c:8137 +#: cp/decl.c:8079 #, c-format msgid "virtual non-class function %qs" msgstr "" -#: cp/decl.c:8168 +#: cp/decl.c:8110 msgid "cannot declare member function %qD to have static linkage" msgstr "" #. FIXME need arm citation -#: cp/decl.c:8175 +#: cp/decl.c:8117 msgid "cannot declare static function inside another function" msgstr "" -#: cp/decl.c:8204 +#: cp/decl.c:8146 msgid "% may not be used when defining (as opposed to declaring) a static data member" msgstr "" -#: cp/decl.c:8211 +#: cp/decl.c:8153 msgid "static member %qD declared %" msgstr "" -#: cp/decl.c:8216 +#: cp/decl.c:8158 msgid "cannot explicitly declare member %q#D to have extern linkage" msgstr "" -#: cp/decl.c:8359 +#: cp/decl.c:8301 #, fuzzy msgid "default argument for %q#D has type %qT" msgstr "звычайны аргумэнт для `%#D' мае тып `%T'" -#: cp/decl.c:8362 +#: cp/decl.c:8304 #, fuzzy msgid "default argument for parameter of type %qT has type %qT" msgstr "звычайны аргумэнт для `%#D' мае тып `%T'" -#: cp/decl.c:8379 +#: cp/decl.c:8321 #, fuzzy msgid "default argument %qE uses local variable %qD" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/decl.c:8447 +#: cp/decl.c:8389 #, fuzzy msgid "parameter %qD invalidly declared method type" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:8471 +#: cp/decl.c:8413 msgid "parameter %qD includes %s to array of unknown bound %qT" msgstr "" @@ -14937,115 +14980,115 @@ msgstr "" #. or implicitly defined), there's no need to worry about their #. existence. Theoretically, they should never even be #. instantiated, but that's hard to forestall. -#: cp/decl.c:8630 +#: cp/decl.c:8572 msgid "invalid constructor; you probably meant %<%T (const %T&)%>" msgstr "" -#: cp/decl.c:8754 +#: cp/decl.c:8696 #, fuzzy msgid "%qD may not be declared within a namespace" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:8756 +#: cp/decl.c:8698 #, fuzzy msgid "%qD may not be declared as static" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/decl.c:8776 +#: cp/decl.c:8718 msgid "%qD must be a nonstatic member function" msgstr "" -#: cp/decl.c:8782 +#: cp/decl.c:8724 msgid "%qD must be either a non-static member function or a non-member function" msgstr "" -#: cp/decl.c:8800 +#: cp/decl.c:8742 msgid "%qD must have an argument of class or enumerated type" msgstr "" -#: cp/decl.c:8835 +#: cp/decl.c:8777 #, c-format msgid "conversion to %s%s will never use a type conversion operator" msgstr "" #. 13.4.0.3 -#: cp/decl.c:8843 +#: cp/decl.c:8785 msgid "ISO C++ prohibits overloading operator ?:" msgstr "" -#: cp/decl.c:8893 +#: cp/decl.c:8835 msgid "postfix %qD must take % as its argument" msgstr "" -#: cp/decl.c:8897 +#: cp/decl.c:8839 msgid "postfix %qD must take % as its second argument" msgstr "" -#: cp/decl.c:8904 +#: cp/decl.c:8846 msgid "%qD must take either zero or one argument" msgstr "" -#: cp/decl.c:8906 +#: cp/decl.c:8848 msgid "%qD must take either one or two arguments" msgstr "" -#: cp/decl.c:8927 +#: cp/decl.c:8869 msgid "prefix %qD should return %qT" msgstr "" -#: cp/decl.c:8933 +#: cp/decl.c:8875 msgid "postfix %qD should return %qT" msgstr "" -#: cp/decl.c:8942 +#: cp/decl.c:8884 msgid "%qD must take %" msgstr "" -#: cp/decl.c:8944 cp/decl.c:8952 +#: cp/decl.c:8886 cp/decl.c:8894 msgid "%qD must take exactly one argument" msgstr "" -#: cp/decl.c:8954 +#: cp/decl.c:8896 msgid "%qD must take exactly two arguments" msgstr "" -#: cp/decl.c:8962 +#: cp/decl.c:8904 msgid "user-defined %qD always evaluates both arguments" msgstr "" -#: cp/decl.c:8976 +#: cp/decl.c:8918 msgid "%qD should return by value" msgstr "" -#: cp/decl.c:8988 cp/decl.c:8991 +#: cp/decl.c:8930 cp/decl.c:8933 #, fuzzy msgid "%qD cannot have default arguments" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/decl.c:9049 +#: cp/decl.c:8991 #, fuzzy msgid "using template type parameter %qT after %qs" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/decl.c:9064 +#: cp/decl.c:9006 msgid "using typedef-name %qD after %qs" msgstr "" -#: cp/decl.c:9065 +#: cp/decl.c:9007 #, fuzzy msgid "%qD has a previous declaration here" msgstr "гэта папярэдняе абвяшчэньне" -#: cp/decl.c:9073 +#: cp/decl.c:9015 msgid "%qT referred to as %qs" msgstr "" -#: cp/decl.c:9074 cp/decl.c:9082 +#: cp/decl.c:9016 cp/decl.c:9024 #, fuzzy msgid "%qT has a previous declaration here" msgstr "гэта папярэдняе абвяшчэньне" -#: cp/decl.c:9081 +#: cp/decl.c:9023 msgid "%qT referred to as enum" msgstr "" @@ -15056,56 +15099,56 @@ msgstr "" #. void f(class C); // No template header here #. #. then the required template argument is missing. -#: cp/decl.c:9097 +#: cp/decl.c:9039 #, fuzzy msgid "template argument required for %<%s %T%>" msgstr "параметр \"%s\" ініцыялізаваны" -#: cp/decl.c:9133 cp/name-lookup.c:2595 +#: cp/decl.c:9075 cp/name-lookup.c:2596 msgid "%qD has the same name as the class in which it is declared" msgstr "" -#: cp/decl.c:9271 +#: cp/decl.c:9213 #, fuzzy msgid "use of enum %q#D without previous declaration" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: cp/decl.c:9290 +#: cp/decl.c:9232 #, fuzzy msgid "redeclaration of %qT as a non-template" msgstr "абвяшчэньне шаблёну `%#D'" -#: cp/decl.c:9383 +#: cp/decl.c:9325 msgid "derived union %qT invalid" msgstr "" -#: cp/decl.c:9389 +#: cp/decl.c:9331 msgid "Java class %qT cannot have multiple bases" msgstr "" -#: cp/decl.c:9397 +#: cp/decl.c:9339 msgid "Java class %qT cannot have virtual bases" msgstr "" -#: cp/decl.c:9416 +#: cp/decl.c:9358 msgid "base type %qT fails to be a struct or class type" msgstr "" -#: cp/decl.c:9449 +#: cp/decl.c:9391 msgid "recursive type %qT undefined" msgstr "" -#: cp/decl.c:9451 +#: cp/decl.c:9393 #, fuzzy msgid "duplicate base type %qT invalid" msgstr "паўтарэнне \"restrict\"" -#: cp/decl.c:9521 +#: cp/decl.c:9463 #, fuzzy msgid "multiple definition of %q#T" msgstr "папярэдняе вызначэньне `%#T'" -#: cp/decl.c:9522 +#: cp/decl.c:9464 #, fuzzy msgid "%Jprevious definition here" msgstr "папярэдняе вызначэньне" @@ -15114,43 +15157,43 @@ msgstr "папярэдняе вызначэньне" #. #. IF no integral type can represent all the enumerator values, the #. enumeration is ill-formed. -#: cp/decl.c:9659 +#: cp/decl.c:9601 msgid "no integral type can represent all of the enumerator values for %qT" msgstr "" -#: cp/decl.c:9765 +#: cp/decl.c:9707 msgid "enumerator value for %qD not integer constant" msgstr "" -#: cp/decl.c:9792 +#: cp/decl.c:9734 msgid "overflow in enumeration values at %qD" msgstr "" -#: cp/decl.c:9863 +#: cp/decl.c:9805 #, fuzzy msgid "return type %q#T is incomplete" msgstr "вяртаемы тып \"%s\" не \"int\"" -#: cp/decl.c:9978 cp/typeck.c:6163 +#: cp/decl.c:9920 cp/typeck.c:6150 msgid "% should return a reference to %<*this%>" msgstr "" -#: cp/decl.c:10301 +#: cp/decl.c:10248 #, fuzzy msgid "parameter %qD declared void" msgstr "тып параметра \"%s\" не аб'яўлены" -#: cp/decl.c:10790 +#: cp/decl.c:10737 #, fuzzy msgid "invalid member function declaration" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl.c:10805 +#: cp/decl.c:10752 #, fuzzy msgid "%qD is already defined in class %qT" msgstr "не знойдзен клас \"%s\"" -#: cp/decl.c:11015 +#: cp/decl.c:10962 msgid "static member function %q#D declared with type qualifiers" msgstr "" @@ -15196,7 +15239,7 @@ msgstr "абвяшчэньне шаблёну `%#D'" msgid "invalid use of % in template declaration of %q#D" msgstr "паўторнае абвяшчэнне меткі \"%s\"" -#: cp/decl2.c:504 cp/pt.c:2965 +#: cp/decl2.c:504 cp/pt.c:2973 #, fuzzy msgid "template declaration of %q#D" msgstr "пустое абвяшчэнне" @@ -15294,12 +15337,12 @@ msgstr "" msgid "% takes type %qT as first parameter" msgstr "" -#: cp/decl2.c:2992 +#: cp/decl2.c:3013 #, fuzzy msgid "inline function %qD used but never defined" msgstr "адмеціна `%D' выкарыстоўвываецца, але ня вызначана" -#: cp/decl2.c:3140 +#: cp/decl2.c:3161 #, fuzzy msgid "default argument missing for parameter %P of %q+#D" msgstr "аргумент для \"%s\" прапушчан" @@ -15332,7 +15375,7 @@ msgstr "" msgid "throwing NULL, which has integral, not pointer type" msgstr "" -#: cp/except.c:625 cp/init.c:1893 +#: cp/except.c:625 cp/init.c:1887 msgid "%qD should never be overloaded" msgstr "" @@ -15369,10 +15412,6 @@ msgstr "тып параметра \"%s\" не аб'яўлены" #. [temp.friend] #. Friend declarations shall not declare partial #. specializations. -#. template friend class T::X; -#. [temp.friend] -#. Friend declarations shall not declare partial -#. specializations. #: cp/friend.c:244 cp/friend.c:274 msgid "partial specialization %qT declared %" msgstr "" @@ -15487,149 +15526,149 @@ msgstr "" msgid "%Jinitializations for multiple members of %qT" msgstr "" -#: cp/init.c:677 +#: cp/init.c:682 msgid "%Jbase class %q#T should be explicitly initialized in the copy constructor" msgstr "" -#: cp/init.c:901 cp/init.c:920 +#: cp/init.c:906 cp/init.c:925 msgid "class %qT does not have any field named %qD" msgstr "" -#: cp/init.c:907 +#: cp/init.c:912 msgid "%q#D is a static data member; it can only be initialized at its definition" msgstr "" -#: cp/init.c:914 +#: cp/init.c:919 msgid "%q#D is not a non-static data member of %qT" msgstr "" -#: cp/init.c:953 +#: cp/init.c:958 msgid "unnamed initializer for %qT, which has no base classes" msgstr "" -#: cp/init.c:961 +#: cp/init.c:966 msgid "unnamed initializer for %qT, which uses multiple inheritance" msgstr "" -#: cp/init.c:1007 +#: cp/init.c:1012 msgid "%qD is both a direct base and an indirect virtual base" msgstr "" -#: cp/init.c:1015 +#: cp/init.c:1020 msgid "type %qD is not a direct or virtual base of %qT" msgstr "" -#: cp/init.c:1018 +#: cp/init.c:1023 msgid "type %qD is not a direct base of %qT" msgstr "" -#: cp/init.c:1098 +#: cp/init.c:1103 #, fuzzy msgid "bad array initializer" msgstr "нерэчаісны ініцыялізатар" -#: cp/init.c:1297 +#: cp/init.c:1302 #, fuzzy msgid "%qT is not an aggregate type" msgstr "\"%s\" мае незавершаны тып" -#: cp/init.c:1389 +#: cp/init.c:1394 msgid "qualified type %qT does not match destructor name %<~%T%>" msgstr "" -#: cp/init.c:1397 +#: cp/init.c:1402 msgid "incomplete type %qT does not have member %qD" msgstr "" -#: cp/init.c:1416 +#: cp/init.c:1421 #, fuzzy msgid "%qD is not a member of type %qT" msgstr "\"%s\" мае незавершаны тып" -#: cp/init.c:1443 +#: cp/init.c:1440 #, fuzzy msgid "invalid pointer to bit-field %qD" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/init.c:1545 +#: cp/init.c:1542 #, fuzzy msgid "invalid use of non-static member function %qD" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/init.c:1551 cp/semantics.c:1321 +#: cp/init.c:1548 cp/semantics.c:1321 #, fuzzy msgid "invalid use of non-static data member %qD" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/init.c:1651 +#: cp/init.c:1645 msgid "size in array new must have integral type" msgstr "" -#: cp/init.c:1654 +#: cp/init.c:1648 msgid "zero size array reserves no space" msgstr "" -#: cp/init.c:1662 +#: cp/init.c:1656 msgid "new cannot be applied to a reference type" msgstr "" -#: cp/init.c:1668 +#: cp/init.c:1662 msgid "new cannot be applied to a function type" msgstr "" -#: cp/init.c:1700 +#: cp/init.c:1694 msgid "call to Java constructor, while % undefined" msgstr "" -#: cp/init.c:1716 +#: cp/init.c:1710 #, fuzzy msgid "can't find class$" msgstr "Не магу знайсці клас \"%s\"" -#: cp/init.c:1844 +#: cp/init.c:1838 msgid "invalid type % for new" msgstr "" -#: cp/init.c:1854 +#: cp/init.c:1848 #, fuzzy msgid "uninitialized const in % of %q#T" msgstr "не магу ініцыялізаваць сяброўскую функцыю \"%s\"" -#: cp/init.c:1888 +#: cp/init.c:1882 #, c-format msgid "call to Java constructor with %qs undefined" msgstr "" -#: cp/init.c:1928 +#: cp/init.c:1922 #, fuzzy msgid "request for member %qD is ambiguous" msgstr "памер \"%s\" - %d байт" -#: cp/init.c:2061 +#: cp/init.c:2055 msgid "ISO C++ forbids initialization in array new" msgstr "" -#: cp/init.c:2531 +#: cp/init.c:2530 msgid "initializer ends prematurely" msgstr "" -#: cp/init.c:2584 +#: cp/init.c:2583 msgid "cannot initialize multi-dimensional array with initializer" msgstr "" -#: cp/init.c:2741 +#: cp/init.c:2738 msgid "possible problem detected in invocation of delete operator:" msgstr "" -#: cp/init.c:2744 +#: cp/init.c:2741 msgid "neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined." msgstr "" -#: cp/init.c:2765 +#: cp/init.c:2762 msgid "unknown array size in delete" msgstr "" -#: cp/init.c:2998 +#: cp/init.c:2995 msgid "type to vector delete is neither pointer or array type" msgstr "" @@ -15700,19 +15739,19 @@ msgstr "" msgid "the mangled name of %qD will change in a future version of GCC" msgstr "" -#: cp/method.c:441 +#: cp/method.c:445 msgid "generic thunk code fails for method %q#D which uses %<...%>" msgstr "" -#: cp/method.c:657 +#: cp/method.c:661 msgid "non-static const member %q#D, can't use default assignment operator" msgstr "" -#: cp/method.c:663 +#: cp/method.c:667 msgid "non-static reference member %q#D, can't use default assignment operator" msgstr "" -#: cp/method.c:1078 +#: cp/method.c:1082 msgid "vtable layout for class %qT may not be ABI-compliantand may change in a future version of GCC due to implicit virtual destructor" msgstr "" @@ -15819,493 +15858,497 @@ msgstr "" msgid "%q#D hides constructor for %q#T" msgstr "дэструктару неабходны \"%#D\"" -#: cp/name-lookup.c:1879 +#: cp/name-lookup.c:1880 #, fuzzy msgid "%q#D conflicts with previous using declaration %q#D" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" -#: cp/name-lookup.c:1891 +#: cp/name-lookup.c:1892 #, fuzzy msgid "previous non-function declaration %q#D" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/name-lookup.c:1892 +#: cp/name-lookup.c:1893 #, fuzzy msgid "conflicts with function declaration %q#D" msgstr "секцыя \"%s\" канфліктуе з папярэдняй дэкларацыяй" #. It's a nested name with template parameter dependent scope. #. This can only be using-declaration for class member. -#: cp/name-lookup.c:1970 cp/name-lookup.c:1995 cp/name-lookup.c:3157 +#: cp/name-lookup.c:1971 cp/name-lookup.c:1996 cp/name-lookup.c:3158 #, fuzzy msgid "%qT is not a namespace" msgstr "\"%s\" мае незавершаны тып" #. 7.3.3/5 #. A using-declaration shall not name a template-id. -#: cp/name-lookup.c:1980 +#: cp/name-lookup.c:1981 msgid "a using-declaration cannot specify a template-id. Try %" msgstr "" -#: cp/name-lookup.c:1987 +#: cp/name-lookup.c:1988 #, fuzzy msgid "namespace %qD not allowed in using-declaration" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/name-lookup.c:2023 +#: cp/name-lookup.c:2024 #, fuzzy msgid "%qD not declared" msgstr "YYDEBUG не вызначан." -#: cp/name-lookup.c:2035 cp/name-lookup.c:2080 cp/name-lookup.c:2114 +#: cp/name-lookup.c:2036 cp/name-lookup.c:2081 cp/name-lookup.c:2115 #, fuzzy msgid "%qD is already declared in this scope" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/name-lookup.c:2120 +#: cp/name-lookup.c:2121 msgid "using declaration %qD introduced ambiguous type %qT" msgstr "" -#: cp/name-lookup.c:2691 +#: cp/name-lookup.c:2692 msgid "using-declaration for non-member at class scope" msgstr "" -#: cp/name-lookup.c:2696 +#: cp/name-lookup.c:2697 msgid "using-declaration cannot name destructor" msgstr "" -#: cp/name-lookup.c:2769 +#: cp/name-lookup.c:2770 msgid "declaration of %qD not in a namespace surrounding %qD" msgstr "" -#: cp/name-lookup.c:2777 +#: cp/name-lookup.c:2778 #, fuzzy msgid "explicit qualification in declaration of `%D'" msgstr "пустое абвяшчэнне" -#: cp/name-lookup.c:2813 +#: cp/name-lookup.c:2814 msgid "%qD should have been declared inside %qD" msgstr "" -#: cp/name-lookup.c:2875 +#: cp/name-lookup.c:2876 #, fuzzy msgid "namespace alias %qD not allowed here, assuming %qD" msgstr "\"%s\" - гэта не пачатак дэкларацыі" #. The parser did not find it, so it's not there. -#: cp/name-lookup.c:2990 +#: cp/name-lookup.c:2991 #, fuzzy msgid "unknown namespace %qD" msgstr "невядомы рэжым машыны \"%s\"" -#: cp/name-lookup.c:3151 +#: cp/name-lookup.c:3152 msgid "namespace %qT undeclared" msgstr "" -#: cp/name-lookup.c:3195 +#: cp/name-lookup.c:3196 msgid "strong using only meaningful at namespace scope" msgstr "" -#: cp/name-lookup.c:3202 +#: cp/name-lookup.c:3203 #, fuzzy msgid "%qD attribute directive ignored" msgstr "\"%s\" атрыбут ігнарыруецца" -#: cp/name-lookup.c:3336 +#: cp/name-lookup.c:3337 #, fuzzy msgid "use of %qD is ambiguous" msgstr "памер \"%s\" - %d байт" -#: cp/name-lookup.c:3337 +#: cp/name-lookup.c:3338 #, fuzzy msgid " first declared as %q#D here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/name-lookup.c:3339 +#: cp/name-lookup.c:3340 #, fuzzy msgid " also declared as %q#D here" msgstr "няма папярэдняга аб'яўлення для \"%s\"" -#: cp/name-lookup.c:3354 +#: cp/name-lookup.c:3355 msgid "%qD denotes an ambiguous type" msgstr "" -#: cp/name-lookup.c:3355 +#: cp/name-lookup.c:3356 #, fuzzy msgid "%J first type here" msgstr " адсюль" -#: cp/name-lookup.c:3356 +#: cp/name-lookup.c:3357 msgid "%J other type here" msgstr "" #. This happens for A::B where B is a template, and there are no #. template arguments. -#: cp/name-lookup.c:3420 cp/parser.c:4365 cp/typeck.c:1786 +#: cp/name-lookup.c:3421 cp/parser.c:4384 cp/typeck.c:1802 #, fuzzy msgid "invalid use of %qD" msgstr "нерэчаіснае выкарыстаньне `%D'" -#: cp/name-lookup.c:3460 +#: cp/name-lookup.c:3461 #, fuzzy msgid "%<%D::%D%> is not a template" msgstr "\"%s\" мае незавершаны тып" -#: cp/name-lookup.c:3476 +#: cp/name-lookup.c:3477 #, fuzzy msgid "%qD undeclared in namespace %qD" msgstr "невядомы рэжым машыны \"%s\"" -#: cp/name-lookup.c:4102 +#: cp/name-lookup.c:4103 #, fuzzy msgid "%qD is not a function," msgstr "`%D' - гэта ня функцыя," -#: cp/name-lookup.c:4103 +#: cp/name-lookup.c:4104 msgid " conflict with %qD" msgstr "" -#: cp/name-lookup.c:4868 +#: cp/name-lookup.c:4869 msgid "XXX entering pop_everything ()\n" msgstr "" -#: cp/name-lookup.c:4877 +#: cp/name-lookup.c:4878 msgid "XXX leaving pop_everything ()\n" msgstr "" -#: cp/parser.c:1807 +#: cp/parser.c:1797 +msgid "minimum/maximum operators are deprecated" +msgstr "" + +#: cp/parser.c:1817 #, fuzzy msgid "%<#pragma%> is not allowed here" msgstr "Клас \"%s\" ужо існуе" -#: cp/parser.c:1836 +#: cp/parser.c:1846 msgid "%<%D::%D%> has not been declared" msgstr "" -#: cp/parser.c:1839 cp/semantics.c:2375 +#: cp/parser.c:1849 cp/semantics.c:2379 msgid "%<::%D%> has not been declared" msgstr "" -#: cp/parser.c:1842 +#: cp/parser.c:1852 msgid "request for member %qD in non-class type %qT" msgstr "" -#: cp/parser.c:1845 +#: cp/parser.c:1855 #, fuzzy msgid "%<%T::%D%> has not been declared" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/parser.c:1848 +#: cp/parser.c:1858 #, fuzzy msgid "%qD has not been declared" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/parser.c:1851 +#: cp/parser.c:1861 msgid "%<%D::%D%> %s" msgstr "" -#: cp/parser.c:1853 +#: cp/parser.c:1863 msgid "%<::%D%> %s" msgstr "" -#: cp/parser.c:1855 +#: cp/parser.c:1865 msgid "%qD %s" msgstr "" -#: cp/parser.c:1907 +#: cp/parser.c:1917 msgid "new types may not be defined in a return type" msgstr "" -#: cp/parser.c:1908 +#: cp/parser.c:1918 #, fuzzy msgid "(perhaps a semicolon is missing after the definition of %qT)" msgstr "Не магу знайсці дэкларацыю інтэрфейса для \"%s\"" -#: cp/parser.c:1927 cp/pt.c:4328 +#: cp/parser.c:1937 cp/pt.c:4336 #, fuzzy msgid "%qT is not a template" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:1929 +#: cp/parser.c:1939 #, fuzzy, c-format msgid "%qE is not a template" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:1931 +#: cp/parser.c:1941 #, fuzzy msgid "invalid template-id" msgstr "Нерэчаісны выбар %s" -#: cp/parser.c:1960 +#: cp/parser.c:1970 #, fuzzy, c-format msgid "%s cannot appear in a constant-expression" msgstr "памер масіва \"%s\" адмоўны" -#: cp/parser.c:1985 +#: cp/parser.c:1995 #, fuzzy, c-format msgid "invalid use of template-name %qE without an argument list" msgstr "нявернае выкарыстанне \"restict\"" #. Issue an error message. -#: cp/parser.c:1990 +#: cp/parser.c:2000 #, fuzzy, c-format msgid "%qE does not name a type" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:2021 +#: cp/parser.c:2032 msgid "(perhaps % was intended)" msgstr "" -#: cp/parser.c:2036 +#: cp/parser.c:2047 #, c-format msgid "%qE in namespace %qE does not name a type" msgstr "" -#: cp/parser.c:2039 +#: cp/parser.c:2050 msgid "%qE in class %qT does not name a type" msgstr "" -#: cp/parser.c:2748 +#: cp/parser.c:2759 msgid "ISO C++ forbids braced-groups within expressions" msgstr "" -#: cp/parser.c:2757 +#: cp/parser.c:2768 msgid "statement-expressions are allowed only inside functions" msgstr "" -#: cp/parser.c:2808 +#: cp/parser.c:2819 #, fuzzy msgid "% may not be used in this context" msgstr "\"%s\" не абвешчан (першае выкарыстанне ў гэтай функцыі)" -#: cp/parser.c:2944 +#: cp/parser.c:2955 msgid "local variable %qD may not appear in this context" msgstr "" -#: cp/parser.c:3316 +#: cp/parser.c:3327 msgid "typedef-name %qD used as destructor declarator" msgstr "" -#: cp/parser.c:3965 +#: cp/parser.c:3984 #, fuzzy msgid "ISO C++ forbids compound-literals" msgstr "ISO C не дазваляе дэкларацыі метак (label)" -#: cp/parser.c:4885 +#: cp/parser.c:4904 msgid "array bound forbidden after parenthesized type-id" msgstr "" -#: cp/parser.c:4886 +#: cp/parser.c:4905 msgid "try removing the parentheses around the type-id" msgstr "" -#: cp/parser.c:5087 +#: cp/parser.c:5107 msgid "expression in new-declarator must have integral or enumeration type" msgstr "" -#: cp/parser.c:5276 +#: cp/parser.c:5296 msgid "use of old-style cast" msgstr "" -#: cp/parser.c:6041 +#: cp/parser.c:6066 #, c-format msgid "case label %qE not within a switch statement" msgstr "" -#: cp/parser.c:6584 +#: cp/parser.c:6610 msgid "ISO C++ forbids computed gotos" msgstr "" -#: cp/parser.c:6709 +#: cp/parser.c:6735 msgid "extra %<;%>" msgstr "" -#: cp/parser.c:7028 +#: cp/parser.c:7054 msgid "mixing declarations and function-definitions is forbidden" msgstr "" -#: cp/parser.c:7159 +#: cp/parser.c:7185 #, fuzzy msgid "duplicate %" msgstr "паўтарэньне `%s'" -#: cp/parser.c:7328 +#: cp/parser.c:7354 #, fuzzy msgid "class definition may not be declared a friend" msgstr "віртуальныя функцыі не могуць быць сяброўскімі" -#: cp/parser.c:7641 +#: cp/parser.c:7668 msgid "only constructors take base initializers" msgstr "" -#: cp/parser.c:7692 +#: cp/parser.c:7719 msgid "anachronistic old-style base class initializer" msgstr "" -#: cp/parser.c:7734 +#: cp/parser.c:7761 msgid "keyword % not allowed in this context (a qualified member initializer is implicitly a type)" msgstr "" #. Warn that we do not support `export'. -#: cp/parser.c:8096 +#: cp/parser.c:8127 msgid "keyword % not implemented, and will be ignored" msgstr "" #. Otherwise, emit an error about the invalid digraph, but continue #. parsing because we got our argument list. -#: cp/parser.c:8469 +#: cp/parser.c:8500 msgid "%<<::%> cannot begin a template-argument list" msgstr "" -#: cp/parser.c:8470 +#: cp/parser.c:8501 msgid "%<<:%> is an alternate spelling for %<[%>. Insert whitespace between %<<%> and %<::%>" msgstr "" -#: cp/parser.c:8477 +#: cp/parser.c:8508 msgid "(if you use -fpermissive G++ will accept your code)" msgstr "" -#: cp/parser.c:8541 +#: cp/parser.c:8572 msgid "parse error in template argument list" msgstr "" #. Explain what went wrong. -#: cp/parser.c:8654 +#: cp/parser.c:8685 msgid "non-template %qD used as template" msgstr "" -#: cp/parser.c:8655 +#: cp/parser.c:8686 msgid "use %<%T::template %D%> to indicate that it is a template" msgstr "" -#: cp/parser.c:9245 cp/parser.c:15012 +#: cp/parser.c:9275 cp/parser.c:15071 #, fuzzy, c-format msgid "template declaration of %qs" msgstr "пустое абвяшчэнне" -#: cp/parser.c:9688 +#: cp/parser.c:9718 msgid "using % outside of template" msgstr "" -#: cp/parser.c:9883 +#: cp/parser.c:9913 msgid "type attributes are honored only at type definition" msgstr "" #. [namespace.udecl] #. #. A using declaration shall not name a template-id. -#: cp/parser.c:10265 +#: cp/parser.c:10295 #, fuzzy msgid "a template-id may not appear in a using-declaration" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/parser.c:10595 +#: cp/parser.c:10625 msgid "an asm-specification is not allowed on a function-definition" msgstr "" -#: cp/parser.c:10597 +#: cp/parser.c:10627 #, fuzzy msgid "attributes are not allowed on a function-definition" msgstr "\"%s\" - гэта не пачатак дэкларацыі" -#: cp/parser.c:10728 +#: cp/parser.c:10758 msgid "attributes after parenthesized initializer ignored" msgstr "" -#: cp/parser.c:11113 +#: cp/parser.c:11143 #, fuzzy msgid "array bound is not an integer constant" msgstr "памер масіва \"%s\" адмоўны" -#: cp/parser.c:11183 +#: cp/parser.c:11213 #, fuzzy msgid "%<%T::%D%> is not a type" msgstr "\"%s\" мае незавершаны тып" -#: cp/parser.c:11225 +#: cp/parser.c:11255 #, fuzzy msgid "invalid use of constructor as a template" msgstr "нявернае выкарыстанне \"restict\"" -#: cp/parser.c:11226 +#: cp/parser.c:11256 msgid "use %<%T::%D%> instead of %<%T::%T%> to name the constructor in a qualified name" msgstr "" -#: cp/parser.c:11414 +#: cp/parser.c:11444 #, fuzzy msgid "duplicate cv-qualifier" msgstr "паўтарэнне \"volatile\"" -#: cp/parser.c:11916 +#: cp/parser.c:11973 #, fuzzy msgid "file ends in default argument" msgstr "нехапае аргументаў у функцыі \"%s\"" -#: cp/parser.c:11977 +#: cp/parser.c:12034 msgid "deprecated use of default argument for parameter of non-function" msgstr "" -#: cp/parser.c:11980 +#: cp/parser.c:12037 msgid "default arguments are only permitted for function parameters" msgstr "" -#: cp/parser.c:12722 +#: cp/parser.c:12779 #, fuzzy msgid "invalid class name in declaration of %qD" msgstr "Нерэчаіснае абвяшчэнне" -#: cp/parser.c:12733 +#: cp/parser.c:12790 msgid "declaration of %qD in %qD which does not enclose %qD" msgstr "" -#: cp/parser.c:12746 +#: cp/parser.c:12803 msgid "extra qualification ignored" msgstr "" -#: cp/parser.c:12757 +#: cp/parser.c:12814 #, fuzzy msgid "an explicit specialization must be preceded by %